UNPKG

museaikit

Version:

A powerful music-focused AI toolkit

2 lines 219 kB
/*! For license information please see transcription.js.LICENSE.txt */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@tensorflow/tfjs")):"function"==typeof define&&define.amd?define(["tf"],t):"object"==typeof exports?exports.transcription=t(require("@tensorflow/tfjs")):e.transcription=t(e.tf)}(self,(__WEBPACK_EXTERNAL_MODULE__6364__=>(()=>{var __webpack_modules__={283:(e,t,n)=>{"use strict";var r=n(9008);function o(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1}e.exports=function(e){var t=new o;t.pre=e.pre,t.body=e.body,t.post=e.post;var n=e.args.slice(0);t.argTypes=n;for(var i=0;i<n.length;++i){var a=n[i];if("array"===a||"object"==typeof a&&a.blockIndices){if(t.argTypes[i]="array",t.arrayArgs.push(i),t.arrayBlockIndices.push(a.blockIndices?a.blockIndices:0),t.shimArgs.push("array"+i),i<t.pre.args.length&&t.pre.args[i].count>0)throw new Error("cwise: pre() block may not reference array args");if(i<t.post.args.length&&t.post.args[i].count>0)throw new Error("cwise: post() block may not reference array args")}else if("scalar"===a)t.scalarArgs.push(i),t.shimArgs.push("scalar"+i);else if("index"===a){if(t.indexArgs.push(i),i<t.pre.args.length&&t.pre.args[i].count>0)throw new Error("cwise: pre() block may not reference array index");if(i<t.body.args.length&&t.body.args[i].lvalue)throw new Error("cwise: body() block may not write to array index");if(i<t.post.args.length&&t.post.args[i].count>0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===a){if(t.shapeArgs.push(i),i<t.pre.args.length&&t.pre.args[i].lvalue)throw new Error("cwise: pre() block may not write to array shape");if(i<t.body.args.length&&t.body.args[i].lvalue)throw new Error("cwise: body() block may not write to array shape");if(i<t.post.args.length&&t.post.args[i].lvalue)throw new Error("cwise: post() block may not write to array shape")}else{if("object"!=typeof a||!a.offset)throw new Error("cwise: Unknown argument type "+n[i]);t.argTypes[i]="offset",t.offsetArgs.push({array:a.array,offset:a.offset}),t.offsetArgIndex.push(i)}}if(t.arrayArgs.length<=0)throw new Error("cwise: No array arguments specified");if(t.pre.args.length>n.length)throw new Error("cwise: Too many arguments in pre() block");if(t.body.args.length>n.length)throw new Error("cwise: Too many arguments in body() block");if(t.post.args.length>n.length)throw new Error("cwise: Too many arguments in post() block");return t.debug=!!e.printCode||!!e.debug,t.funcName=e.funcName||"cwise",t.blockSize=e.blockSize||64,r(t)}},381:e=>{"use strict";e.exports={}},738:(e,t,n)=>{"use strict";n.d(t,{Cz:()=>g,QK:()=>f,Xi:()=>p,n$:()=>d,uv:()=>h});n(6364);var r=n(9220),o=n.n(r),i=n(1515),a=n(1209),s=n(5862),u=n(8171);const c=16e3,l=(0,s.RD)(c);async function f(e){return(0,s.hd)(e).then((e=>e.arrayBuffer())).then((e=>l.decodeAudioData(e)))}async function p(e){const t=new FileReader;return new Promise(((n,r)=>{t.onerror=()=>{t.abort(),r(new DOMException("Something went wrong reading that file."))},t.onload=()=>{n(t.result)},t.readAsArrayBuffer(e)})).then((e=>l.decodeAudioData(e)))}function h(e,t){t.power||(t.power=2);const n=function(e,t){const n=t.nFft||2048,r=t.winLength||n,o=t.hopLength||Math.floor(r/4);let i=function(e){const t=new Float32Array(e);for(let n=0;n<e;n++)t[n]=.5*(1-Math.cos(2*Math.PI*n/(e-1)));return t}(r);i=function(e,t){if(e.length>t)throw new Error("Data is longer than length.");const n=Math.floor((t-e.length)/2),r=t-e.length-n;return w(e,[n,r])}(i,n),e=function(e,t){const n=w(e,t);for(let e=0;e<t;e++)n[e]=n[2*t-e],n[n.length-e-1]=n[n.length-2*t+e-1];return n}(e,Math.floor(n/2));const a=function(e,t,n){const r=Math.floor((e.length-t)/n)+1,o=Array.from({length:r},((e,n)=>new Float32Array(t)));for(let i=0;i<r;i++){const r=i*n,a=e.slice(r,r+t);o[i].set(a),a.length}return o}(e,n,o),s=[],u=a.length,c=n+2;for(let e=0;e<u;e++){const t=new Float32Array(c);s[e]=t}for(let e=0;e<u;e++){const t=S(b(a[e],i));s[e].set(t.slice(0,c))}return s}(e,t),[r,o]=function(e,t){const n=e.map((e=>function(e,t){return e.map((e=>Math.pow(e,t)))}(function(e){const t=new Float32Array(e.length/2);for(let n=0;n<e.length/2;n++)t[n]=Math.sqrt(e[2*n]*e[2*n]+e[2*n+1]*e[2*n+1]);return t}(e),t))),r=e[0].length-1;return[n,r]}(n,t.power);t.nFft=o;const i=function(e){const t=e.fMin||0,n=e.fMax||e.sampleRate/2,r=e.nMels||128,o=e.nFft||2048,i=function(e,t){return v(0,e/2,Math.floor(1+t/2))}(e.sampleRate,o),a=function(e,t,n){const r=_(t),o=_(n),i=v(r,o,e);return i.map((e=>function(e){return 700*(Math.exp(e/1125)-1)}(e)))}(r+2,t,n),s=function(e){const t=new Float32Array(e.length-1);for(let n=0;n<e.length;n++)t[n]=e[n+1]-e[n];return t}(a),u=function(e,t){const n=[];for(let r=0;r<e.length;r++)n[r]=new Float32Array(t.length);for(let r=0;r<e.length;r++)for(let o=0;o<t.length;o++)n[r][o]=e[r]-t[o];return n}(a,i),c=u[0].length,l=[];for(let e=0;e<r;e++){l[e]=new Float32Array(c);for(let t=0;t<u[e].length;t++){const n=-u[e][t]/s[e],r=u[e+2][t]/s[e+1],o=Math.max(0,Math.min(n,r));l[e][t]=o}}for(let e=0;e<l.length;e++){const t=2/(a[2+e]-a[e]);l[e]=l[e].map((e=>e*t))}return l}(t);return function(e,t){const n=[];for(let r=0;r<e.length;r++)n[r]=y(e[r],t);return n}(r,i)}function d(e,t=1e-10,n=80){const r=e.length,o=e[0].length,i=[];for(let e=0;e<r;e++)i[e]=new Float32Array(o);for(let n=0;n<r;n++)for(let r=0;r<o;r++){const o=e[n][r];i[n][r]=10*Math.log10(Math.max(t,o))}if(n){if(n<0)throw new Error("topDb must be non-negative.");for(let e=0;e<r;e++){const t=i[e].reduce(((e,t)=>Math.max(e,t)));for(let r=0;r<o;r++)i[e][r]=Math.max(i[e][r],t-n)}}return i}function m(e){if(1===e.numberOfChannels)return e.getChannelData(0);if(2!==e.numberOfChannels)throw Error(`${e.numberOfChannels} channel audio is not supported.`);const t=e.getChannelData(0),n=e.getChannelData(1),r=new Float32Array(e.length);for(let o=0;o<e.length;++o)r[o]=(t[o]+n[o])/2;return r}async function g(e,t=c){if(e.sampleRate===t)return m(e);const n=e.sampleRate,r=e.length*t/n;if(s.nr){u.log("Safari does not support WebAudio resampling, so this may be slow.","O&F",5);const t=m(e),n=new Float32Array(r);return a(i(n,[r]),i(t,[t.length])),n}{const n=new OfflineAudioContext(e.numberOfChannels,e.duration*t,t),r=n.createBufferSource();return r.buffer=e,r.connect(n.destination),r.start(),n.startRendering().then((e=>e.getChannelData(0)))}}function y(e,t){if(e.length!==t[0].length)throw new Error(`Each entry in filterbank should have dimensions matching FFT. |mags| = ${e.length}, |filterbank[0]| = ${t[0].length}.`);const n=new Float32Array(t.length);for(let r=0;r<t.length;r++){const o=b(e,t[r]);n[r]=o.reduce(((e,t)=>e+t))}return n}function b(e,t){if(e.length!==t.length)return console.error(`Buffer length ${e.length} != window length ${t.length}.`),null;const n=new Float32Array(e.length);for(let r=0;r<e.length;r++)n[r]=t[r]*e[r];return n}function w(e,t){let n,r;"object"==typeof t?[n,r]=t:n=r=t;const o=new Float32Array(e.length+n+r);return o.set(e,n),o}function S(e){const t=new(o())(e.length),n=t.createComplexArray(),r=t.toComplexArray(e);return t.transform(n,r),n}function v(e,t,n){const r=(t-e)/(n-1),o=new Float32Array(n);for(let t=0;t<n;t++)o[t]=e+r*t;return o}function _(e){return 1125*Math.log(1+e/700)}},953:(e,t,n)=>{"use strict";var r=n(7723),o=n(1515),i=n(6807),a=n(5687);e.exports=function(e,t,n){var s,u,c=t.shape,l=c.length,f=1,p=new Array(l),h=0;for(s=l-1;s>=0;--s)if(p[s]=f,f*=c[s],h=Math.max(h,a.scratchMemory(c[s])),t.shape[s]!==n.shape[s])throw new Error("Shape mismatch, real and imaginary arrays must have same size");var d,m=4*f+h;d="array"===t.dtype||"float64"===t.dtype||"custom"===t.dtype?i.mallocDouble(m):i.mallocFloat(m);var g,y,b,w,S=o(d,c.slice(0),p,0),v=o(d,c.slice(0),p.slice(0),f),_=o(d,c.slice(0),p.slice(0),2*f),A=o(d,c.slice(0),p.slice(0),3*f),N=4*f;for(r.assign(S,t),r.assign(v,n),s=l-1;s>=0&&(a(e,f/c[s],c[s],d,S.offset,v.offset,N),0!==s);--s){for(y=1,b=_.stride,w=A.stride,u=s-1;u<l;++u)w[u]=b[u]=y,y*=c[u];for(u=s-2;u>=0;--u)w[u]=b[u]=y,y*=c[u];r.assign(_,S),r.assign(A,v),g=S,S=_,_=g,g=v,v=A,A=g}r.assign(t,S),r.assign(n,v),i.free(d)}},955:(e,t,n)=>{"use strict";n.r(t),n.d(t,{userAgent:()=>r});const r=""},1115:e=>{"use strict";e.exports=function(e,t,n){return 0===e.length?e:t?(n||e.sort(t),function(e,t){for(var n=1,r=e.length,o=e[0],i=e[0],a=1;a<r;++a)if(i=o,t(o=e[a],i)){if(a===n){n++;continue}e[n++]=o}return e.length=n,e}(e,t)):(n||e.sort(),function(e){for(var t=1,n=e.length,r=e[0],o=e[0],i=1;i<n;++i,o=r)if(o=r,(r=e[i])!==o){if(i===t){t++;continue}e[t++]=r}return e.length=t,e}(e))}},1137:(e,t,n)=>{"use strict";e.exports=u;var r,o=n(5382),i=o.LongBits,a=o.utf8;function s(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function u(e){this.buf=e,this.pos=0,this.len=e.length}var c,l="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new u(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new u(e);throw Error("illegal buffer")},f=function(){return o.Buffer?function(e){return(u.create=function(e){return o.Buffer.isBuffer(e)?new r(e):l(e)})(e)}:l};function p(){var e=new i(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw s(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw s(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function h(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function d(){if(this.pos+8>this.len)throw s(this,8);return new i(h(this.buf,this.pos+=4),h(this.buf,this.pos+=4))}u.create=f(),u.prototype._slice=o.Array.prototype.subarray||o.Array.prototype.slice,u.prototype.uint32=(c=4294967295,function(){if(c=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return c;if((this.pos+=5)>this.len)throw this.pos=this.len,s(this,10);return c}),u.prototype.int32=function(){return 0|this.uint32()},u.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)},u.prototype.bool=function(){return 0!==this.uint32()},u.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return h(this.buf,this.pos+=4)},u.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|h(this.buf,this.pos+=4)},u.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var e=o.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},u.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var e=o.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},u.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw s(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,n):t===n?new this.buf.constructor(0):this._slice.call(this.buf,t,n)},u.prototype.string=function(){var e=this.bytes();return a.read(e,0,e.length)},u.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw s(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw s(this)}while(128&this.buf[this.pos++]);return this},u.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},u._configure=function(e){r=e,u.create=f(),r._configure();var t=o.Long?"toLong":"toNumber";o.merge(u.prototype,{int64:function(){return p.call(this)[t](!1)},uint64:function(){return p.call(this)[t](!0)},sint64:function(){return p.call(this).zzDecode()[t](!1)},fixed64:function(){return d.call(this)[t](!0)},sfixed64:function(){return d.call(this)[t](!1)}})}},1209:(e,t,n)=>{"use strict";var r=n(953),o=n(2433),i=n(7723),a=n(8277)({args:["array","array","scalar","scalar","scalar"],body:function(e,t,n,r,o){var i=t*n;i<r&&(i=r),i>o&&(i=o)}});e.exports=function(e,t,n,s){void 0===n&&(n=-1/0),void 0===s&&(s=1/0);var u=t.shape,c=e.shape;if(t.shape.length!==e.shape.length)throw new Error("ndarray-resample: input and output arrays should have the same dimensions");var l,f=u.map((function(){return 0}));if(1===e.size)return(l=i.sum(t)/t.size)<n&&(l=n),l>s&&(l=s),void e.set.apply(e,f.concat(l));if(1===t.size)return(l=t.get.apply(t,f))<n&&(l=n),l>s&&(l=s),void i.assigns(e,l);for(var p=u.length,h=new Array(p),d=!1,m=0;m<p;m++)h[m]=Math.min(c[m],u[m]),c[m]>u[m]&&(d=!0);var g=o.malloc(u),y=o.malloc(u);i.assign(g,t),i.assigns(y,0),r(1,g,y);var b=g.lo,w=g.hi,S=o.malloc(c),v=o.malloc(c);d&&(i.assigns(S,0),i.assigns(v,0));var _=new Array(p),A=new Array(p),N=new Array(p),O=new Array(p);for(m=0;m<1<<p;++m){for(var k=0;k<p;++k)if(m&1<<k){if(_[k]=h[k]-(h[k]+1>>>1),0===_[k])continue;A[k]=c[k]-_[k],N[k]=u[k]-_[k],O[k]=1&h[k]?0:1}else _[k]=h[k]+1>>>1,A[k]=0,N[k]=0,O[k]=0;i.assign(w.apply(b.apply(S,A),_),w.apply(b.apply(g,N),_)),i.assign(b.apply(w.apply(b.apply(v,A),_),O),b.apply(w.apply(b.apply(y,N),_),O)),i.assigns(w.apply(w.apply(b.apply(v,A),_),O),0)}r(-1,S,v),a(e,S,e.size/t.size,n,s),o.free(g),o.free(y),o.free(S),o.free(v)}},1515:(e,t,n)=>{var r=n(2639),o=n(7634),i="undefined"!=typeof Float64Array;function a(e,t){return e[0]-t[0]}function s(){var e,t=this.stride,n=new Array(t.length);for(e=0;e<n.length;++e)n[e]=[Math.abs(t[e]),e];n.sort(a);var r=new Array(n.length);for(e=0;e<r.length;++e)r[e]=n[e][1];return r}function u(e,t){var n=["View",t,"d",e].join("");t<0&&(n="View_Nil"+e);var o="generic"===e;if(-1===t){var i="function "+n+"(a){this.data=a;};var proto="+n+".prototype;proto.dtype='"+e+"';proto.index=function(){return -1};proto.size=0;proto.dimension=-1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function(){return new "+n+"(this.data);};proto.get=proto.set=function(){};proto.pick=function(){return null};return function construct_"+n+"(a){return new "+n+"(a);}";return new Function(i)()}if(0===t){i="function "+n+"(a,d) {this.data = a;this.offset = d};var proto="+n+".prototype;proto.dtype='"+e+"';proto.index=function(){return this.offset};proto.dimension=0;proto.size=1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function "+n+"_copy() {return new "+n+"(this.data,this.offset)};proto.pick=function "+n+"_pick(){return TrivialArray(this.data);};proto.valueOf=proto.get=function "+n+"_get(){return "+(o?"this.data.get(this.offset)":"this.data[this.offset]")+"};proto.set=function "+n+"_set(v){return "+(o?"this.data.set(this.offset,v)":"this.data[this.offset]=v")+"};return function construct_"+n+"(a,b,c,d){return new "+n+"(a,d)}";return new Function("TrivialArray",i)(c[e][0])}i=["'use strict'"];var a=r(t),u=a.map((function(e){return"i"+e})),l="this.offset+"+a.map((function(e){return"this.stride["+e+"]*i"+e})).join("+"),f=a.map((function(e){return"b"+e})).join(","),p=a.map((function(e){return"c"+e})).join(",");i.push("function "+n+"(a,"+f+","+p+",d){this.data=a","this.shape=["+f+"]","this.stride=["+p+"]","this.offset=d|0}","var proto="+n+".prototype","proto.dtype='"+e+"'","proto.dimension="+t),i.push("Object.defineProperty(proto,'size',{get:function "+n+"_size(){return "+a.map((function(e){return"this.shape["+e+"]"})).join("*"),"}})"),1===t?i.push("proto.order=[0]"):(i.push("Object.defineProperty(proto,'order',{get:"),t<4?(i.push("function "+n+"_order(){"),2===t?i.push("return (Math.abs(this.stride[0])>Math.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===t&&i.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):i.push("ORDER})")),i.push("proto.set=function "+n+"_set("+u.join(",")+",v){"),o?i.push("return this.data.set("+l+",v)}"):i.push("return this.data["+l+"]=v}"),i.push("proto.get=function "+n+"_get("+u.join(",")+"){"),o?i.push("return this.data.get("+l+")}"):i.push("return this.data["+l+"]}"),i.push("proto.index=function "+n+"_index(",u.join(),"){return "+l+"}"),i.push("proto.hi=function "+n+"_hi("+u.join(",")+"){return new "+n+"(this.data,"+a.map((function(e){return["(typeof i",e,"!=='number'||i",e,"<0)?this.shape[",e,"]:i",e,"|0"].join("")})).join(",")+","+a.map((function(e){return"this.stride["+e+"]"})).join(",")+",this.offset)}");var h=a.map((function(e){return"a"+e+"=this.shape["+e+"]"})),d=a.map((function(e){return"c"+e+"=this.stride["+e+"]"}));i.push("proto.lo=function "+n+"_lo("+u.join(",")+"){var b=this.offset,d=0,"+h.join(",")+","+d.join(","));for(var m=0;m<t;++m)i.push("if(typeof i"+m+"==='number'&&i"+m+">=0){d=i"+m+"|0;b+=c"+m+"*d;a"+m+"-=d}");i.push("return new "+n+"(this.data,"+a.map((function(e){return"a"+e})).join(",")+","+a.map((function(e){return"c"+e})).join(",")+",b)}"),i.push("proto.step=function "+n+"_step("+u.join(",")+"){var "+a.map((function(e){return"a"+e+"=this.shape["+e+"]"})).join(",")+","+a.map((function(e){return"b"+e+"=this.stride["+e+"]"})).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(m=0;m<t;++m)i.push("if(typeof i"+m+"==='number'){d=i"+m+"|0;if(d<0){c+=b"+m+"*(a"+m+"-1);a"+m+"=ceil(-a"+m+"/d)}else{a"+m+"=ceil(a"+m+"/d)}b"+m+"*=d}");i.push("return new "+n+"(this.data,"+a.map((function(e){return"a"+e})).join(",")+","+a.map((function(e){return"b"+e})).join(",")+",c)}");var g=new Array(t),y=new Array(t);for(m=0;m<t;++m)g[m]="a[i"+m+"]",y[m]="b[i"+m+"]";i.push("proto.transpose=function "+n+"_transpose("+u+"){"+u.map((function(e,t){return e+"=("+e+"===undefined?"+t+":"+e+"|0)"})).join(";"),"var a=this.shape,b=this.stride;return new "+n+"(this.data,"+g.join(",")+","+y.join(",")+",this.offset)}"),i.push("proto.pick=function "+n+"_pick("+u+"){var a=[],b=[],c=this.offset");for(m=0;m<t;++m)i.push("if(typeof i"+m+"==='number'&&i"+m+">=0){c=(c+this.stride["+m+"]*i"+m+")|0}else{a.push(this.shape["+m+"]);b.push(this.stride["+m+"])}");return i.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),i.push("return function construct_"+n+"(data,shape,stride,offset){return new "+n+"(data,"+a.map((function(e){return"shape["+e+"]"})).join(",")+","+a.map((function(e){return"stride["+e+"]"})).join(",")+",offset)}"),new Function("CTOR_LIST","ORDER",i.join("\n"))(c[e],s)}var c={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],bigint64:[],biguint64:[],buffer:[],generic:[]};e.exports=function(e,t,n,r){if(void 0===e)return(0,c.array[0])([]);"number"==typeof e&&(e=[e]),void 0===t&&(t=[e.length]);var a=t.length;if(void 0===n){n=new Array(a);for(var s=a-1,l=1;s>=0;--s)n[s]=l,l*=t[s]}if(void 0===r){r=0;for(s=0;s<a;++s)n[s]<0&&(r-=(t[s]-1)*n[s])}for(var f=function(e){if(o(e))return"buffer";if(i)switch(Object.prototype.toString.call(e)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object Uint8ClampedArray]":return"uint8_clamped";case"[object BigInt64Array]":return"bigint64";case"[object BigUint64Array]":return"biguint64"}return Array.isArray(e)?"array":"generic"}(e),p=c[f];p.length<=a+1;)p.push(u(f,p.length-1));return(0,p[a+1])(e,t,n,r)}},1758:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(7151),o=r.tensorflow.magenta.NoteSequence},1925:module=>{"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},1979:(e,t)=>{"use strict";var n=t;n.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&"="===e.charAt(t);)++n;return Math.ceil(3*e.length)/4-n};for(var r=new Array(64),o=new Array(123),i=0;i<64;)o[r[i]=i<26?i+65:i<52?i+71:i<62?i-4:i-59|43]=i++;n.encode=function(e,t,n){for(var o,i=null,a=[],s=0,u=0;t<n;){var c=e[t++];switch(u){case 0:a[s++]=r[c>>2],o=(3&c)<<4,u=1;break;case 1:a[s++]=r[o|c>>4],o=(15&c)<<2,u=2;break;case 2:a[s++]=r[o|c>>6],a[s++]=r[63&c],u=0}s>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,a)),s=0)}return u&&(a[s++]=r[o],a[s++]=61,1===u&&(a[s++]=61)),i?(s&&i.push(String.fromCharCode.apply(String,a.slice(0,s))),i.join("")):String.fromCharCode.apply(String,a.slice(0,s))};var a="invalid encoding";n.decode=function(e,t,n){for(var r,i=n,s=0,u=0;u<e.length;){var c=e.charCodeAt(u++);if(61===c&&s>1)break;if(void 0===(c=o[c]))throw Error(a);switch(s){case 0:r=c,s=1;break;case 1:t[n++]=r<<2|(48&c)>>4,r=c,s=2;break;case 2:t[n++]=(15&r)<<4|(60&c)>>2,r=c,s=3;break;case 3:t[n++]=(3&r)<<6|c,s=0}}if(1===s)throw Error(a);return n-i},n.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},2433:(e,t,n)=>{"use strict";var r=n(1515),o=n(7723),i=n(6807);t.clone=function(e){var t=e.dtype;"generic"!==t&&"array"!==t||(t="double");var n=i.malloc(e.size,t),a=r(n,e.shape);return o.assign(a,e),a},t.malloc=function(e,t){t||(t="double");for(var n=1,o=new Array(e.length),a=e.length-1;a>=0;--a)o[a]=n,n*=e[a];return r(i.malloc(n,t),e,o,0)},t.free=function(e){"generic"!==e.dtype&&"array"!==e.dtype&&i.free(e.data)},t.zeros=function(e,t){t||(t="double");for(var n=1,o=new Array(e.length),a=e.length-1;a>=0;--a)o[a]=n,n*=e[a];var s=i.malloc(n,t);for(a=0;a<n;++a)s[a]=0;return r(s,e,o,0)},t.ones=function(e,t){t||(t="double");for(var n=1,o=new Array(e.length),a=e.length-1;a>=0;--a)o[a]=n,n*=e[a];var s=i.malloc(n,t);for(a=0;a<n;++a)s[a]=1;return r(s,e,o,0)},t.eye=function(e,t){var n,o;t||(t="double");var a=1,s=new Array(e.length);for(n=e.length-1;n>=0;--n)s[n]=a,a*=e[n];var u=i.malloc(a,t);for(n=0;n<a;++n)u[n]=0;var c=1/0,l=0;for(n=e.length-1;n>=0;n--)l+=s[n],c=Math.min(c,e[n]);for(n=0,o=0;n<c;n++,o+=l)u[o]=1;return r(u,e,s,0)}},2639:e=>{"use strict";e.exports=function(e){for(var t=new Array(e),n=0;n<e;++n)t[n]=n;return t}},2971:(e,t)=>{"use strict";var n=t;n.length=function(e){for(var t=0,n=0,r=0;r<e.length;++r)(n=e.charCodeAt(r))<128?t+=1:n<2048?t+=2:55296==(64512&n)&&56320==(64512&e.charCodeAt(r+1))?(++r,t+=4):t+=3;return t},n.read=function(e,t,n){if(n-t<1)return"";for(var r,o=null,i=[],a=0;t<n;)(r=e[t++])<128?i[a++]=r:r>191&&r<224?i[a++]=(31&r)<<6|63&e[t++]:r>239&&r<365?(r=((7&r)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,i[a++]=55296+(r>>10),i[a++]=56320+(1023&r)):i[a++]=(15&r)<<12|(63&e[t++])<<6|63&e[t++],a>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,i)),a=0);return o?(a&&o.push(String.fromCharCode.apply(String,i.slice(0,a))),o.join("")):String.fromCharCode.apply(String,i.slice(0,a))},n.write=function(e,t,n){for(var r,o,i=n,a=0;a<e.length;++a)(r=e.charCodeAt(a))<128?t[n++]=r:r<2048?(t[n++]=r>>6|192,t[n++]=63&r|128):55296==(64512&r)&&56320==(64512&(o=e.charCodeAt(a+1)))?(r=65536+((1023&r)<<10)+(1023&o),++a,t[n++]=r>>18|240,t[n++]=r>>12&63|128,t[n++]=r>>6&63|128,t[n++]=63&r|128):(t[n++]=r>>12|224,t[n++]=r>>6&63|128,t[n++]=63&r|128);return n-i}},3179:e=>{"use strict";function t(e,n,r){var o=0|e[r];if(o<=0)return[];var i,a=new Array(o);if(r===e.length-1)for(i=0;i<o;++i)a[i]=n;else for(i=0;i<o;++i)a[i]=t(e,n,r+1);return a}e.exports=function(e,n){switch(void 0===n&&(n=0),typeof e){case"number":if(e>0)return function(e,t){var n,r;for(n=new Array(e),r=0;r<e;++r)n[r]=t;return n}(0|e,n);break;case"object":if("number"==typeof e.length)return t(e,n,0)}return[]}},3474:e=>{"use strict";function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var n=this._listeners[e],r=0;r<n.length;)n[r].fn===t?n.splice(r,1):++r;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],r=1;r<arguments.length;)n.push(arguments[r++]);for(r=0;r<t.length;)t[r].fn.apply(t[r++].ctx,n)}return this}},3918:(e,t,n)=>{"use strict";n.r(t),n.d(t,{now:()=>o,timing:()=>i});const r=global.process.hrtime(),o=()=>{const e=global.process.hrtime(r);return e[0]+e[1]/1e9},i={navigationStart:Date.now()}},4010:(e,t,n)=>{"use strict";e.exports=i;var r=n(1137);(i.prototype=Object.create(r.prototype)).constructor=i;var o=n(5382);function i(e){r.call(this,e)}i._configure=function(){o.Buffer&&(i.prototype._slice=o.Buffer.prototype.slice)},i.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},i._configure()},4110:(e,t,n)=>{"use strict";e.exports=n(7134)},4226:e=>{"use strict";e.exports=function(e,t,n){var r=n||8192,o=r>>>1,i=null,a=r;return function(n){if(n<1||n>o)return e(n);a+n>r&&(i=e(r),a=0);var s=t.call(i,a,a+=n);return 7&a&&(a=1+(7|a)),s}}},4301:(e,t,n)=>{"use strict";e.exports=f;var r,o=n(5382),i=o.LongBits,a=o.base64,s=o.utf8;function u(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function c(){}function l(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function f(){this.len=0,this.head=new u(c,0,0),this.tail=this.head,this.states=null}var p=function(){return o.Buffer?function(){return(f.create=function(){return new r})()}:function(){return new f}};function h(e,t,n){t[n]=255&e}function d(e,t){this.len=e,this.next=void 0,this.val=t}function m(e,t,n){for(;e.hi;)t[n++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=127&e.lo|128,e.lo=e.lo>>>7;t[n++]=e.lo}function g(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}f.create=p(),f.alloc=function(e){return new o.Array(e)},o.Array!==Array&&(f.alloc=o.pool(f.alloc,o.Array.prototype.subarray)),f.prototype._push=function(e,t,n){return this.tail=this.tail.next=new u(e,t,n),this.len+=t,this},d.prototype=Object.create(u.prototype),d.prototype.fn=function(e,t,n){for(;e>127;)t[n++]=127&e|128,e>>>=7;t[n]=e},f.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new d((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},f.prototype.int32=function(e){return e<0?this._push(m,10,i.fromNumber(e)):this.uint32(e)},f.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},f.prototype.uint64=function(e){var t=i.from(e);return this._push(m,t.length(),t)},f.prototype.int64=f.prototype.uint64,f.prototype.sint64=function(e){var t=i.from(e).zzEncode();return this._push(m,t.length(),t)},f.prototype.bool=function(e){return this._push(h,1,e?1:0)},f.prototype.fixed32=function(e){return this._push(g,4,e>>>0)},f.prototype.sfixed32=f.prototype.fixed32,f.prototype.fixed64=function(e){var t=i.from(e);return this._push(g,4,t.lo)._push(g,4,t.hi)},f.prototype.sfixed64=f.prototype.fixed64,f.prototype.float=function(e){return this._push(o.float.writeFloatLE,4,e)},f.prototype.double=function(e){return this._push(o.float.writeDoubleLE,8,e)};var y=o.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r<e.length;++r)t[n+r]=e[r]};f.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(h,1,0);if(o.isString(e)){var n=f.alloc(t=a.length(e));a.decode(e,n,0),e=n}return this.uint32(t)._push(y,t,e)},f.prototype.string=function(e){var t=s.length(e);return t?this.uint32(t)._push(s.write,t,e):this._push(h,1,0)},f.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new u(c,0,0),this.len=0,this},f.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new u(c,0,0),this.len=0),this},f.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},f.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},f._configure=function(e){r=e,f.create=p(),r._configure()}},4370:(e,t,n)=>{"use strict";var r=n(7659),o=n(1115),i=0;function a(e,t,n){this.name=e,this.lvalue=t,this.rvalue=n,this.count=0}function s(e,t,n,r){this.body=e,this.args=t,this.thisVars=n,this.localVars=r}e.exports=function(e){for(var t=["(",e,")()"].join(""),n=r.parse(t,{range:!0}),u="_inline_"+i+++"_",c=function(e){for(var t=e.body[0].expression.callee.params,n=new Array(t.length),r=0;r<t.length;++r)n[r]=t[r].name;return n}(n),l=new Array(c.length),f=0;f<c.length;++f)l[f]=new a([u,"arg",f,"_"].join(""),!1,!1);for(var p=new Array(t.length),h=(f=0,t.length);f<h;++f)p[f]=t.charAt(f);var d,m=[],g=[];function y(e,t){for(var n=e.range[0],r=e.range[1],o=n+1;o<r;++o)p[o]="";p[n]=t}return function e(t,n){if(t.parent=n,"MemberExpression"===t.type)t.computed?(e(t.object,t),e(t.property,t)):"ThisExpression"===t.object.type?y(t,(b=t.property.name,w="this_"+b.replace(/\_/g,"__"),g.push(w),w)):e(t.object,t);else{if("ThisExpression"===t.type)throw new Error("cwise-parser: Computed this is not allowed");if("Identifier"===t.type){var r=t.name,o=c.indexOf(r);if(o>=0){var i=l[o],a=function(e){return"AssignmentExpression"===e.parent.type&&e.parent.left===e?"="===e.parent.operator?1:3:"UpdateExpression"===e.parent.type?3:2}(t);1&a&&(i.lvalue=!0),2&a&&(i.rvalue=!0),++i.count,y(t,i.name)}else(function(e){if("eval"===e)throw new Error("cwise-parser: eval() not allowed");return"undefined"!=typeof window?e in window:"undefined"!=typeof global?e in global:"undefined"!=typeof self&&e in self})(r)||y(t,function(e){var t=u+e.replace(/\_/g,"__");return m.push(t),t}(r))}else if("Literal"===t.type)"string"==typeof t.value&&y(t,"'"+t.value.replace(/\_/g,"\\_").replace(/\'/g,"'")+"'");else{if("WithStatement"===t.type)throw new Error("cwise-parser: with() statements not allowed");for(var s=Object.keys(t),f=0,p=s.length;f<p;++f)if("parent"!==s[f]){var h=t[s[f]];if(h)if(h instanceof Array)for(var d=0;d<h.length;++d)h[d]&&"string"==typeof h[d].type&&e(h[d],t);else"string"==typeof h.type&&e(h,t)}}}var b,w}(n.body[0].expression.callee.body,void 0),o(m),o(g),new s((d=n.body[0].expression.callee.body,p.slice(d.range[0],d.range[1]).join("")),l,g,m)}},4447:(e,t,n)=>{"use strict";e.exports=o;var r=n(5382);function o(e,t,n){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(n)}(o.prototype=Object.create(r.EventEmitter.prototype)).constructor=o,o.prototype.rpcCall=function e(t,n,o,i,a){if(!i)throw TypeError("request must be specified");var s=this;if(!a)return r.asPromise(e,s,t,n,o,i);if(s.rpcImpl)try{return s.rpcImpl(t,n[s.requestDelimited?"encodeDelimited":"encode"](i).finish(),(function(e,n){if(e)return s.emit("error",e,t),a(e);if(null!==n){if(!(n instanceof o))try{n=o[s.responseDelimited?"decodeDelimited":"decode"](n)}catch(e){return s.emit("error",e,t),a(e)}return s.emit("data",n,t),a(null,n)}s.end(!0)}))}catch(e){return s.emit("error",e,t),void setTimeout((function(){a(e)}),0)}else setTimeout((function(){a(Error("already ended"))}),0)},o.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},4649:(e,t)=>{"use strict";function n(e){var t=32;return(e&=-e)&&t--,65535&e&&(t-=16),16711935&e&&(t-=8),252645135&e&&(t-=4),858993459&e&&(t-=2),1431655765&e&&(t-=1),t}t.INT_BITS=32,t.INT_MAX=2147483647,t.INT_MIN=-1<<31,t.sign=function(e){return(e>0)-(e<0)},t.abs=function(e){var t=e>>31;return(e^t)-t},t.min=function(e,t){return t^(e^t)&-(e<t)},t.max=function(e,t){return e^(e^t)&-(e<t)},t.isPow2=function(e){return!(e&e-1||!e)},t.log2=function(e){var t,n;return t=(e>65535)<<4,t|=n=((e>>>=t)>255)<<3,t|=n=((e>>>=n)>15)<<2,(t|=n=((e>>>=n)>3)<<1)|(e>>>=n)>>1},t.log10=function(e){return e>=1e9?9:e>=1e8?8:e>=1e7?7:e>=1e6?6:e>=1e5?5:e>=1e4?4:e>=1e3?3:e>=100?2:e>=10?1:0},t.popCount=function(e){return 16843009*((e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135)>>>24},t.countTrailingZeros=n,t.nextPow2=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)+1},t.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)-(e>>>1)},t.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,27030>>>(e&=15)&1};var r=new Array(256);!function(e){for(var t=0;t<256;++t){var n=t,r=t,o=7;for(n>>>=1;n;n>>>=1)r<<=1,r|=1&n,--o;e[t]=r<<o&255}}(r),t.reverse=function(e){return r[255&e]<<24|r[e>>>8&255]<<16|r[e>>>16&255]<<8|r[e>>>24&255]},t.interleave2=function(e,t){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))<<1},t.deinterleave2=function(e,t){return(e=65535&((e=16711935&((e=252645135&((e=858993459&((e=e>>>t&1431655765)|e>>>1))|e>>>2))|e>>>4))|e>>>16))<<16>>16},t.interleave3=function(e,t,n){return e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2),(e|=(t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2))<<1)|(n=1227133513&((n=3272356035&((n=251719695&((n=4278190335&((n&=1023)|n<<16))|n<<8))|n<<4))|n<<2))<<2},t.deinterleave3=function(e,t){return(e=1023&((e=4278190335&((e=251719695&((e=3272356035&((e=e>>>t&1227133513)|e>>>2))|e>>>4))|e>>>8))|e>>>16))<<22>>22},t.nextCombination=function(e){var t=e|e-1;return t+1|(~t&-~t)-1>>>n(e)+1}},5003:(e,t,n)=>{"use strict";e.exports=o;var r=n(5382);function o(e,t){this.lo=e>>>0,this.hi=t>>>0}var i=o.zero=new o(0,0);i.toNumber=function(){return 0},i.zzEncode=i.zzDecode=function(){return this},i.length=function(){return 1};var a=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(e){if(0===e)return i;var t=e<0;t&&(e=-e);var n=e>>>0,r=(e-n)/4294967296>>>0;return t&&(r=~r>>>0,n=~n>>>0,++n>4294967295&&(n=0,++r>4294967295&&(r=0))),new o(n,r)},o.from=function(e){if("number"==typeof e)return o.fromNumber(e);if(r.isString(e)){if(!r.Long)return o.fromNumber(parseInt(e,10));e=r.Long.fromString(e)}return e.low||e.high?new o(e.low>>>0,e.high>>>0):i},o.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+4294967296*n)}return this.lo+4294967296*this.hi},o.prototype.toLong=function(e){return r.Long?new r.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var s=String.prototype.charCodeAt;o.fromHash=function(e){return e===a?i:new o((s.call(e,0)|s.call(e,1)<<8|s.call(e,2)<<16|s.call(e,3)<<24)>>>0,(s.call(e,4)|s.call(e,5)<<8|s.call(e,6)<<16|s.call(e,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},o.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},o.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}},5285:(e,t,n)=>{"use strict";var r=n(1115);function o(e,t,n){var r,o,i=e.length,a=t.arrayArgs.length,s=t.indexArgs.length>0,u=[],c=[],l=0,f=0;for(r=0;r<i;++r)c.push(["i",r,"=0"].join(""));for(o=0;o<a;++o)for(r=0;r<i;++r)f=l,l=e[r],0===r?c.push(["d",o,"s",r,"=t",o,"p",l].join("")):c.push(["d",o,"s",r,"=(t",o,"p",l,"-s",f,"*t",o,"p",f,")"].join(""));for(c.length>0&&u.push("var "+c.join(",")),r=i-1;r>=0;--r)l=e[r],u.push(["for(i",r,"=0;i",r,"<s",l,";++i",r,"){"].join(""));for(u.push(n),r=0;r<i;++r){for(f=l,l=e[r],o=0;o<a;++o)u.push(["p",o,"+=d",o,"s",r].join(""));s&&(r>0&&u.push(["index[",f,"]-=s",f].join("")),u.push(["++index[",l,"]"].join(""))),u.push("}")}return u.join("\n")}function i(e,t,n){for(var r=e.body,o=[],i=[],a=0;a<e.args.length;++a){var s=e.args[a];if(!(s.count<=0)){var u=new RegExp(s.name,"g"),c="",l=t.arrayArgs.indexOf(a);switch(t.argTypes[a]){case"offset":var f=t.offsetArgIndex.indexOf(a);l=t.offsetArgs[f].array,c="+q"+f;case"array":c="p"+l+c;var p="l"+a,h="a"+l;if(0===t.arrayBlockIndices[l])1===s.count?"generic"===n[l]?s.lvalue?(o.push(["var ",p,"=",h,".get(",c,")"].join("")),r=r.replace(u,p),i.push([h,".set(",c,",",p,")"].join(""))):r=r.replace(u,[h,".get(",c,")"].join("")):r=r.replace(u,[h,"[",c,"]"].join("")):"generic"===n[l]?(o.push(["var ",p,"=",h,".get(",c,")"].join("")),r=r.replace(u,p),s.lvalue&&i.push([h,".set(",c,",",p,")"].join(""))):(o.push(["var ",p,"=",h,"[",c,"]"].join("")),r=r.replace(u,p),s.lvalue&&i.push([h,"[",c,"]=",p].join("")));else{for(var d=[s.name],m=[c],g=0;g<Math.abs(t.arrayBlockIndices[l]);g++)d.push("\\s*\\[([^\\]]+)\\]"),m.push("$"+(g+1)+"*t"+l+"b"+g);if(u=new RegExp(d.join(""),"g"),c=m.join("+"),"generic"===n[l])throw new Error("cwise: Generic arrays not supported in combination with blocks!");r=r.replace(u,[h,"[",c,"]"].join(""))}break;case"scalar":r=r.replace(u,"Y"+t.scalarArgs.indexOf(a));break;case"index":r=r.replace(u,"index");break;case"shape":r=r.replace(u,"shape")}}}return[o.join("\n"),r,i.join("\n")].join("\n").trim()}function a(e){for(var t=new Array(e.length),n=!0,r=0;r<e.length;++r){var o=e[r],i=o.match(/\d+/);i=i?i[0]:"",0===o.charAt(0)?t[r]="u"+o.charAt(1)+i:t[r]=o.charAt(0)+i,r>0&&(n=n&&t[r]===t[r-1])}return n?t[0]:t.join("")}e.exports=function(e,t){for(var n=t[1].length-Math.abs(e.arrayBlockIndices[0])|0,s=new Array(e.arrayArgs.length),u=new Array(e.arrayArgs.length),c=0;c<e.arrayArgs.length;++c)u[c]=t[2*c],s[c]=t[2*c+1];var l=[],f=[],p=[],h=[],d=[];for(c=0;c<e.arrayArgs.length;++c){e.arrayBlockIndices[c]<0?(p.push(0),h.push(n),l.push(n),f.push(n+e.arrayBlockIndices[c])):(p.push(e.arrayBlockIndices[c]),h.push(e.arrayBlockIndices[c]+n),l.push(0),f.push(e.arrayBlockIndices[c]));for(var m=[],g=0;g<s[c].length;g++)p[c]<=s[c][g]&&s[c][g]<h[c]&&m.push(s[c][g]-p[c]);d.push(m)}var y=["SS"],b=["'use strict'"],w=[];for(g=0;g<n;++g)w.push(["s",g,"=SS[",g,"]"].join(""));for(c=0;c<e.arrayArgs.length;++c){y.push("a"+c),y.push("t"+c),y.push("p"+c);for(g=0;g<n;++g)w.push(["t",c,"p",g,"=t",c,"[",p[c]+g,"]"].join(""));for(g=0;g<Math.abs(e.arrayBlockIndices[c]);++g)w.push(["t",c,"b",g,"=t",c,"[",l[c]+g,"]"].join(""))}for(c=0;c<e.scalarArgs.length;++c)y.push("Y"+c);if(e.shapeArgs.length>0&&w.push("shape=SS.slice(0)"),e.indexArgs.length>0){var S=new Array(n);for(c=0;c<n;++c)S[c]="0";w.push(["index=[",S.join(","),"]"].join(""))}for(c=0;c<e.offsetArgs.length;++c){var v=e.offsetArgs[c],_=[];for(g=0;g<v.offset.length;++g)0!==v.offset[g]&&(1===v.offset[g]?_.push(["t",v.array,"p",g].join("")):_.push([v.offset[g],"*t",v.array,"p",g].join("")));0===_.length?w.push("q"+c+"=0"):w.push(["q",c,"=",_.join("+")].join(""))}var A=r([].concat(e.pre.thisVars).concat(e.body.thisVars).concat(e.post.thisVars));for((w=w.concat(A)).length>0&&b.push("var "+w.join(",")),c=0;c<e.arrayArgs.length;++c)b.push("p"+c+"|=0");e.pre.body.length>3&&b.push(i(e.pre,e,u));var N=i(e.body,e,u),O=function(e){for(var t=0,n=e[0].length;t<n;){for(var r=1;r<e.length;++r)if(e[r][t]!==e[0][t])return t;++t}return t}(d);O<n?b.push(function(e,t,n,r){for(var i=t.length,a=n.arrayArgs.length,s=n.blockSize,u=n.indexArgs.length>0,c=[],l=0;l<a;++l)c.push(["var offset",l,"=p",l].join(""));for(l=e;l<i;++l)c.push(["for(var j"+l+"=SS[",t[l],"]|0;j",l,">0;){"].join("")),c.push(["if(j",l,"<",s,"){"].join("")),c.push(["s",t[l],"=j",l].join("")),c.push(["j",l,"=0"].join("")),c.push(["}else{s",t[l],"=",s].join("")),c.push(["j",l,"-=",s,"}"].join("")),u&&c.push(["index[",t[l],"]=j",l].join(""));for(l=0;l<a;++l){for(var f=["offset"+l],p=e;p<i;++p)f.push(["j",p,"*t",l,"p",t[p]].join(""));c.push(["p",l,"=(",f.join("+"),")"].join(""))}for(c.push(o(t,n,r)),l=e;l<i;++l)c.push("}");return c.join("\n")}(O,d[0],e,N)):b.push(o(d[0],e,N)),e.post.body.length>3&&b.push(i(e.post,e,u)),e.debug&&console.log("-----Generated cwise routine for ",t,":\n"+b.join("\n")+"\n----------");var k=[e.funcName||"unnamed","_cwise_loop_",s[0].join("s"),"m",O,a(u)].join("");return new Function(["function ",k,"(",y.join(","),"){",b.join("\n"),"} return ",k].join(""))()}},5382:function(e,t,n){"use strict";var r=t;function o(e,t,n){for(var r=Object.keys(t),o=0;o<r.length;++o)void 0!==e[r[o]]&&n||(e[r[o]]=t[r[o]]);return e}function i(e){function t(e,n){if(!(this instanceof t))return new t(e,n);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),n&&o(this,n)}return(t.prototype=Object.create(Error.prototype)).constructor=t,Object.defineProperty(t.prototype,"name",{get:function(){return e}}),t.prototype.toString=function(){return this.name+": "+this.message},t}r.asPromise=n(6233),r.base64=n(1979),r.EventEmitter=n(3474),r.float=n(5750),r.inquire=n(1925),r.utf8=n(2971),r.pool=n(4226),r.LongBits=n(5003),r.isNode=Boolean("undefined"!=typeof global&&global&&global.process&&global.process.versions&&global.process.versions.node),r.global=r.isNode&&global||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,r.emptyArray=Object.freeze?Object.freeze([]):[],r.emptyObject=Object.freeze?Object.freeze({}):{},r.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},r.isString=function(e){return"string"==typeof e||e instanceof String},r.isObject=function(e){return e&&"object"==typeof e},r.isset=r.isSet=function(e,t){var n=e[t];return!(null==n||!e.hasOwnProperty(t))&&("object"!=typeof n||(Array.isArray(n)?n.length:Object.keys(n).length)>0)},r.Buffer=function(){try{var e=r.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(e){return"number"==typeof e?r.Buffer?r._Buffer_allocUnsafe(e):new r.Array(e):r.Buffer?r._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},r.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||r.inquire("long"),r.key2Re=/^true|false|0|1$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(e){return e?r.LongBits.from(e).toHash():r.LongBits.zeroHash},r.longFromHash=function(e,t){var n=r.LongBits.fromHash(e);return r.Long?r.Long.fromBits(n.lo,n.hi,t):n.toNumber(Boolean(t))},r.merge=o,r.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},r.newError=i,r.ProtocolError=i("ProtocolError"),r.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var e=Object.keys(this),n=e.length-1;n>-1;--n)if(1===t[e[n]]&&void 0!==this[e[n]]&&null!==this[e[n]])return e[n]}},r.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},r.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},r._configure=function(){var e=r.Buffer;e?(r._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},r._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):r._Buffer_from=r._Buffer_allocUnsafe=null}},5440:(e,t)=>{"use strict";var n=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==n)return n;throw new Error("unable to locate global object")}();e.exports=t=n.fetch,n.fetch&&(t.default=n.fetch.bind(n)),t.Headers=n.Headers,t.Request=n.Request,t.Response=n.Response},5687:(e,t,n)=>{var r=n(4649);function o(e,t,n,o,i,a){var s,u,c,l,f,p,h,d,m,g,y,b,w,S,v,_,A,N,O,k,I,x,E,T;for(e|=0,t|=0,i|=0,a|=0,s=n|=0,u=r.log2(s),N=0;N<t;++N){for(h=s>>1,f=0,c=0;c<s-1;c++){for(c<f&&(w=o[i+c],o[i+c]=o[i+f],o[i+f]=w,w=o[a+c],o[a+c]=o[a+f],o[a+f]=w),p=h;p<=f;)f-=p,p>>=1;f+=p}for(y=-1,b=0,g=1,d=0;d<u;d++){for(m=g,g<<=1,_=1,A=0,f=0;f<m;f++){for(c=f;c<s;c+=g)O=o[i+(l=c+m)],k=o[a+l],I=o[i+c],x=o[a+c],S=(E=_*(O+k))-k*(_+A),v=E+(T=O*(A-_)),o[i+l]=I-S,o[a+l]=x-v,o[i+c]+=S,o[a+c]+=v;T=_*(b-y),_=(E=y*(_+A))-A*(y+b),A=E+T}b=Math.sqrt((1-y)/2),e<0&&(b=-b),y=Math.sqrt((1+y)/2)}if(e<0){var P=1/s;for(c=0;c<s;c++)o[i+c]*=P,o[a+c]*=P}i+=n,a+=n}}e.exports=function(e,t,n,i,a,s,u){e|=0,t|=0,n|=0,a|=0,s|=0,r.isPow2(n)?o(e,t,n,i,a,s):function(e,t,n,i,a,s,u){e|=0,t|=0,n|=0,a|=0,s|=0,u|=0;var c,l,f,p,h,d,m,g,y,b=r.nextPow2(2*n+1),w=u,S=w+n,v=S+n,_=v+b,A=_+b,N=A+b,O=-e*Math.PI/n;for(y=0;y<n;++y)l=O*(y*y%(2*n)),p=Math.cos(l),h=Math.sin(l),i[A+(b-y)]=i[A+y]=i[w+y]=p,i[N+(b-y)]=i[N+y]=i[S+y]=h;for(y=n;y<=b-n;++y)i[A+y]=0;for(y=n;y<=b-n;++y)i[N+y]=0;o(1,1,b,i,A,N),O=e<0?1/n:1;for(c=0;c<t;++c){for(y=0;y<n;++y)l=i[a+y],f=i[s+y],d=(p=i[w+y])*(l+f),m=l*((h=-i[S+y])-p),g=f*(p+h),i[v+y]=d-g,i[_+y]=d+m;for(y=n;y<b;++y)i[v+y]=0;for(y=n;y<b;++y)i[_+y]=0;for(o(1,1,b,i,v,_),y=0;y<b;++y)l=i[v+y],f=i[_+y],d=(p=i[A+y])*(l+f),m=l*((h=i[N+y])-p),g=f*(p+h),i[v+y]=d-g,i[_+y]=d+m;for(o(-1,1,b,i,v,_),y=0;y<n;++y)l=i[v+y],f=i[_+y],d=(p=i[w+y])*(l+f),m=l*((h=-i[S+y])-p),g=f*(p+h),i[a+y]=O*(d-g),i[s+y]=O*(d+m);a+=n,s+=n}}(e,t,n,i,a,s,u)},e.exports.scratchMemory=function(e){return r.isPow2(e)?0:2*e+4*r.nextPow2(2*e+1)}},5750:e=>{"use strict";function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),r=128===n[3];function o(e,r,o){t[0]=e,r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2],r[o+3]=n[3]}function i(e,r,o){t[0]=e,r[o]=n[3],r[o+1]=n[2],r[o+2]=n[1],r[o+3]=n[0]}function a(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],t[0]}function s(e,r){return n[3]=e[r],n[2]=e[r+1],n[1]=e[r+2],n[0]=e[r+3],t[0]}e.writeFloatLE=r?o:i,e.writeFloatBE=r?i:o,e.readFloatLE=r?a:s,e.readFloatBE=r?s:a}():function(){function t(e,t,n,r){var o=t<0?1:0;if(o&&(t=-t),0===t)e(1/t>0?0:2147483648,n,r);else if(isNaN(t))e(2143289344,n,r);else if(t>34028234663852886e22)e((o<<31|2139095040)>>>0,n,r);else if(t<11754943508222875e-54)e((o<<31|Math.round(t/1401298464324817e-60))>>>0,n,r);else{var i=Math.floor(Math.log(t)/Math.LN2);e((o<<31|i+127<<23|8388607&Math.round(t*Math.pow(2,-i)*8388608))>>>0,n,r)}}function a(e,t,n){var r=e(t,n),o=2*(r>>31)+1,i=r>>>23&255,a=8388607&r;return 255===i?a?NaN:o*(1/0):0===i?1401298464324817e-60*o*a:o*Math.pow(2,i-150)*(a+8388608)}e.writeFloatLE=t.bind(null,n),e.writeFloatBE=t.bind(null,r),e.readFloatLE=a.bind(null,o),e.readFloatBE=a.bind(null,i)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),r=128===n[7];function o(e,r,o){t[0]=e,r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2],r[o+3]=n[3],r[o+4]=n[4],r[o+5]=n[5],r[o+6]=n[6],r[o+7]=n[7]}function i(e,r,o){t[0]=e,r[o]=n[7],r[o+1]=n[6],r[o+2]=n[5],r[o+3]=n[4],r[o+4]=n[3],r[o+5]=n[2],r[o+6]=n[1],r[o+7]=n[0]}function a(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n[4]=e[r+4],n[5]=e[r+5],n[6]=e[r+6],n[7]=e[r+7],t[0]}function s(e,r){return n[7]=e[r],n[6]=e[r+1],n[5]=e[r+2],n[4]=e[r+3],n[3]=e[r+4],n[2]=e[r+5],n[1]=e[r+6],n[0]=e[r+7],t[0]}e.writeDoubleLE=r?o:i,e.writeDoubleBE=r?i:o,e.readDoubleLE=r?a:s,e.readDoubleBE=r?s:a}():function(){function t(e,t,n,r,o,i){var a=r<0?1:0;if(a&&(r=-r),0===r)e(0,o,i+t),e(1/r>0?0:2147483648,o,i+n);else if(isNaN(r))e(0,o,i+t),e(2146959360,o,i+n);else if(r>17976931348623157e292)e(0,o,i+t),e((a<<31|2146435072)>>>0,o,i+n);else{var s;if(r<22250738585072014e-324)e((s=r/5e-324)>>>0,o,i+t),e((a<<31|s/4294967296)>>>0,o,i+n);else{var u=Math.floor(Math.log(r)/Math.LN2);1024===u&&(u=1023),e(4503599627370496*(s=r*Math.pow(2,-u))>>>0,o,i+t),e((a<<31|u+1023<<20|1048576*s&1048575)>>>0,o,i+n)}}}function a(e,t,n,r,o){var i=e(r,o+t),a=e(r,o+n),s=2*(a>>31)+1,u=a>>>20&2047,c=4294967296*(1048575&a)+i;return 2047===u?c?NaN:s*(1/0):0===u?5e-324*s*c:s*Math.pow(2,u-1075)*(c+4503599627370496)}e.writeDoubleLE=t.bind(null,n,0,4),e.writeDoubleBE=t.bind(null,r,4,0),e.readDoubleLE=a.bind(null,o,0,4),e.readDoubleBE=a.bind(null,i,4,0)}(),e}function n(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function r(e,t,n){t[n]=e>>>24,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=255&e}function o(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function i(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},5862:(e,t,n)=>{"use strict";n.d(t,{hd:()=>u,RD:()=>a,nr:()=>o,FO:()=>c});const r=function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("cannot find the global object")}(),o=(r.fetch.bind(r),r.performance,r.navigator,!!r.webkitOfflineAudioContext),i=void 0!==r.WorkerGlobalScope;function a(e){if(e=o?44100:e,i)throw new Error("Cannot use offline audio context in a web worker.");const t=r.webkitOfflineAudioContext;return o?new t(1,e,e):new r.OfflineAudioContext(1,e,e)}const s="undefined"!=typeof global&&void 0!==global.process,u=s?n(5440):window.fetch.bind(window),c=s?n(3918):window.performance;s?n(955):window.navigator},