@vkontakte/calls-audio-effects 1.2.1 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/audio-effects.cjs.js +6 -6
- package/audio-effects.esm.js +6 -6
- package/package.json +1 -1
package/audio-effects.cjs.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/calls-audio-effects v1.2.
|
|
3
|
-
*
|
|
2
|
+
* @vkontakte/calls-audio-effects v1.2.3
|
|
3
|
+
* Wed, 17 Jul 2024 10:08:31 GMT
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
"use strict";var ma=Object.create;var ar=Object.defineProperty;var ga=Object.getOwnPropertyDescriptor;var ya=Object.getOwnPropertyNames;var Pt=Object.getPrototypeOf,wa=Object.prototype.hasOwnProperty;var _a=Reflect.get;var Ea=(T,p)=>()=>(p||T((p={exports:{}}).exports,p),p.exports),ka=(T,p)=>{for(var v in p)ar(T,v,{get:p[v],enumerable:!0})},Ct=(T,p,v,w)=>{if(p&&typeof p=="object"||typeof p=="function")for(let u of ya(p))!wa.call(T,u)&&u!==v&&ar(T,u,{get:()=>p[u],enumerable:!(w=ga(p,u))||w.enumerable});return T};var Tt=(T,p,v)=>(v=T!=null?ma(Pt(T)):{},Ct(p||!T||!T.__esModule?ar(v,"default",{value:T,enumerable:!0}):v,T)),ba=T=>Ct(ar({},"__esModule",{value:!0}),T);var le=(T,p,v)=>_a(Pt(T),v,p);var Z=(T,p,v)=>new Promise((w,u)=>{var W=G=>{try{X(v.next(G))}catch(J){u(J)}},L=G=>{try{X(v.throw(G))}catch(J){u(J)}},X=G=>G.done?w(G.value):Promise.resolve(G.value).then(W,L);X((v=v.apply(T,p)).next())});var Dr=Ea((Dt,Sr)=>{var Fr=(()=>{var p;var T=typeof document!="undefined"?(p=document.currentScript)==null?void 0:p.src:void 0;return function(v={}){var w,u=v,W,L,X=new Promise((e,r)=>{W=e,L=r}),G=typeof window=="object",J=typeof importScripts=="function",jr=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";u.expectedDataFileDownloads||(u.expectedDataFileDownloads=0),u.expectedDataFileDownloads++,(()=>{var e=typeof ENVIRONMENT_IS_PTHREAD!="undefined"&&ENVIRONMENT_IS_PTHREAD,r=typeof ENVIRONMENT_IS_WASM_WORKER!="undefined"&&ENVIRONMENT_IS_WASM_WORKER;if(e||r)return;function t(n){var o="";typeof window=="object"?o=window.encodeURIComponent(window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/"):typeof process=="undefined"&&typeof location!="undefined"&&(o=encodeURIComponent(location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"));var i="wasm_bindings.data",s="wasm_bindings.data";typeof u.locateFilePackage=="function"&&!u.locateFile&&(u.locateFile=u.locateFilePackage,z("warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)"));var l=u.locateFile?u.locateFile(s,""):s,c=n.remote_package_size;function f(y,P,R,S){var b=new XMLHttpRequest;b.open("GET",y,!0),b.responseType="arraybuffer",b.onprogress=function(A){var bt,At;var M=y,D=P;if(A.total&&(D=A.total),A.loaded){b.addedTotal?u.dataFileDownloads[M].loaded=A.loaded:(b.addedTotal=!0,u.dataFileDownloads||(u.dataFileDownloads={}),u.dataFileDownloads[M]={loaded:A.loaded,total:D});var x=0,O=0,Ne=0;for(var xe in u.dataFileDownloads){var Ue=u.dataFileDownloads[xe];x+=Ue.total,O+=Ue.loaded,Ne++}x=Math.ceil(x*u.expectedDataFileDownloads/Ne),(bt=u.setStatus)==null||bt.call(u,`Downloading data... (${O}/${x})`)}else u.dataFileDownloads||(At=u.setStatus)==null||At.call(u,"Downloading data...")},b.onerror=function(A){throw new Error("NetworkError for: "+y)},b.onload=function(A){if(b.status==200||b.status==304||b.status==206||b.status==0&&b.response){var M=b.response;R(M)}else throw new Error(b.statusText+" : "+b.responseURL)},b.send(null)}function d(y){console.error("package error:",y)}var g=null,h=u.getPreloadedPackage?u.getPreloadedPackage(l,c):null;h||f(l,c,function(y){g?(g(y),g=null):h=y},d);function m(y){function P(M,D){if(!M)throw D+new Error().stack}function R(M,D,x){this.start=M,this.end=D,this.audio=x}R.prototype={requests:{},open:function(M,D){this.name=D,this.requests[D]=this,y.addRunDependency(`fp ${this.name}`)},send:function(){},onload:function(){var M=this.byteArray.subarray(this.start,this.end);this.finish(M)},finish:function(M){var D=this;y.FS_createDataFile(this.name,null,M,!0,!0,!0),y.removeRunDependency(`fp ${D.name}`),this.requests[this.name]=null}};for(var S=n.files,b=0;b<S.length;++b)new R(S[b].start,S[b].end,S[b].audio||0).open("GET",S[b].filename);function A(M){P(M,"Loading data file failed."),P(M.constructor.name===ArrayBuffer.name,"bad input to processPackageData");var D=new Uint8Array(M);R.prototype.byteArray=D;for(var x=n.files,O=0;O<x.length;++O)R.prototype.requests[x[O].filename].onload();y.removeRunDependency("datafile_wasm_bindings.data")}y.addRunDependency("datafile_wasm_bindings.data"),y.preloadResults||(y.preloadResults={}),y.preloadResults[i]={fromCache:!1},h?(A(h),h=null):g=A}u.calledRun?m(u):(u.preRun||(u.preRun=[]),u.preRun.push(m))}t({files:[{filename:"/animoji_v4.cfg",start:0,end:333},{filename:"/balloon.cfg",start:333,end:409},{filename:"/cathedral.cfg",start:409,end:586},{filename:"/chorus.cfg",start:586,end:865},{filename:"/denoise.cfg",start:865,end:3258},{filename:"/df2_lstm_full_silent.tflite",start:3258,end:3169978},{filename:"/distortion.cfg",start:3169978,end:3170120},{filename:"/echo.cfg",start:3170120,end:3170257},{filename:"/evil.cfg",start:3170257,end:3170398},{filename:"/giant.cfg",start:3170398,end:3170474},{filename:"/hall.cfg",start:3170474,end:3170647},{filename:"/phaser.cfg",start:3170647,end:3170747},{filename:"/robot.cfg",start:3170747,end:3170887},{filename:"/squirell.cfg",start:3170887,end:3170963},{filename:"/wav2lip_lite_rec-v4-v2.tflite",start:3170963,end:7456043}],remote_package_size:7456043})})();var He=null,H=Object.assign({},u),Ir=[],me="./this.program",Ce=(e,r)=>{throw r},K="";function ce(e){return u.locateFile?u.locateFile(e,K):K+e}var ge,Y;(G||J)&&(J?K=self.location.href:typeof document!="undefined"&&document.currentScript&&(K=document.currentScript.src),He&&(K=He),K.startsWith("blob:")?K="":K=K.substr(0,K.replace(/[?#].*/,"").lastIndexOf("/")+1),J&&(Y=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),ge=e=>fetch(e,{credentials:"same-origin"}).then(r=>r.ok?r.arrayBuffer():Promise.reject(new Error(r.status+" : "+r.url))));var ae=u.print||console.log.bind(console),z=u.printErr||console.error.bind(console);Object.assign(u,H),H=null,u.arguments&&(Ir=u.arguments),u.thisProgram&&(me=u.thisProgram),u.quit&&(Ce=u.quit);var Te;u.wasmBinary&&(Te=u.wasmBinary);var Be,lr=!1,ur,U,B,ee,ze,_,F,Nr,xr;function Ur(){var e=Be.buffer;u.HEAP8=U=new Int8Array(e),u.HEAP16=ee=new Int16Array(e),u.HEAPU8=B=new Uint8Array(e),u.HEAPU16=ze=new Uint16Array(e),u.HEAP32=_=new Int32Array(e),u.HEAPU32=F=new Uint32Array(e),u.HEAPF32=Nr=new Float32Array(e),u.HEAPF64=xr=new Float64Array(e)}var Lr=[],Hr=[],Br=[],Mt=!1;function Ot(){if(u.preRun)for(typeof u.preRun=="function"&&(u.preRun=[u.preRun]);u.preRun.length;)It(u.preRun.shift());dr(Lr)}function Wt(){Mt=!0,!u.noFSInit&&!a.init.initialized&&a.init(),a.ignorePermissions=!1,ie.init(),dr(Hr)}function jt(){if(u.postRun)for(typeof u.postRun=="function"&&(u.postRun=[u.postRun]);u.postRun.length;)xt(u.postRun.shift());dr(Br)}function It(e){Lr.unshift(e)}function Nt(e){Hr.unshift(e)}function xt(e){Br.unshift(e)}var fe=0,cr=null,Fe=null;function Sa(e){return e}function Ve(e){var r;fe++,(r=u.monitorRunDependencies)==null||r.call(u,fe)}function Se(e){var t;if(fe--,(t=u.monitorRunDependencies)==null||t.call(u,fe),fe==0&&(cr!==null&&(clearInterval(cr),cr=null),Fe)){var r=Fe;Fe=null,r()}}function fr(e){var t;(t=u.onAbort)==null||t.call(u,e),e="Aborted("+e+")",z(e),lr=!0,ur=1,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw L(r),r}var Ut="data:application/octet-stream;base64,",zr=e=>e.startsWith(Ut);function Lt(){var e="wasm_bindings.wasm";return zr(e)?e:ce(e)}var qe;function Vr(e){if(e==qe&&Te)return new Uint8Array(Te);if(Y)return Y(e);throw"both async and sync fetching of the wasm failed"}function Ht(e){return Te?Promise.resolve().then(()=>Vr(e)):ge(e).then(r=>new Uint8Array(r),()=>Vr(e))}function qr(e,r,t){return Ht(e).then(n=>WebAssembly.instantiate(n,r)).then(t,n=>{z(`failed to asynchronously prepare wasm: ${n}`),fr(n)})}function Bt(e,r,t,n){return!e&&typeof WebAssembly.instantiateStreaming=="function"&&!zr(r)&&typeof fetch=="function"?fetch(r,{credentials:"same-origin"}).then(o=>{var i=WebAssembly.instantiateStreaming(o,t);return i.then(n,function(s){return z(`wasm streaming compile failed: ${s}`),z("falling back to ArrayBuffer instantiation"),qr(r,t,n)})}):qr(r,t,n)}function zt(){return{a:oa}}function Vt(){var e=zt();function r(n,o){return N=n.exports,Be=N.Z,Ur(),ut=N.aa,Nt(N._),Se("wasm-instantiate"),N}Ve("wasm-instantiate");function t(n){r(n.instance)}if(u.instantiateWasm)try{return u.instantiateWasm(e,r)}catch(n){z(`Module.instantiateWasm callback failed with error: ${n}`),L(n)}return qe||(qe=Lt()),Bt(Te,qe,e,t).catch(L),{}}var E,j;function qt(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var dr=e=>{for(;e.length>0;)e.shift()(u)},Gt=u.noExitRuntime||!0;class Kt{constructor(r){this.excPtr=r,this.ptr=r-24}set_type(r){F[this.ptr+4>>2]=r}get_type(){return F[this.ptr+4>>2]}set_destructor(r){F[this.ptr+8>>2]=r}get_destructor(){return F[this.ptr+8>>2]}set_caught(r){r=r?1:0,U[this.ptr+12]=r}get_caught(){return U[this.ptr+12]!=0}set_rethrown(r){r=r?1:0,U[this.ptr+13]=r}get_rethrown(){return U[this.ptr+13]!=0}init(r,t){this.set_adjusted_ptr(0),this.set_type(r),this.set_destructor(t)}set_adjusted_ptr(r){F[this.ptr+16>>2]=r}get_adjusted_ptr(){return F[this.ptr+16>>2]}get_exception_ptr(){var r=Et(this.get_type());if(r)return F[this.excPtr>>2];var t=this.get_adjusted_ptr();return t!==0?t:this.excPtr}}var Gr=0,Xt=0,Yt=(e,r,t)=>{var n=new Kt(e);throw n.init(r,t),Gr=e,Xt++,Gr};function Ge(){var e=_[+I.varargs>>2];return I.varargs+=4,e}var ye=Ge,$={isAbs:e=>e.charAt(0)==="/",splitPath:e=>{var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return r.exec(e).slice(1)},normalizeArray:(e,r)=>{for(var t=0,n=e.length-1;n>=0;n--){var o=e[n];o==="."?e.splice(n,1):o===".."?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:e=>{var r=$.isAbs(e),t=e.substr(-1)==="/";return e=$.normalizeArray(e.split("/").filter(n=>!!n),!r).join("/"),!e&&!r&&(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:e=>{var r=$.splitPath(e),t=r[0],n=r[1];return!t&&!n?".":(n&&(n=n.substr(0,n.length-1)),t+n)},basename:e=>{if(e==="/")return"/";e=$.normalize(e),e=e.replace(/\/$/,"");var r=e.lastIndexOf("/");return r===-1?e:e.substr(r+1)},join:(...e)=>$.normalize(e.join("/")),join2:(e,r)=>$.normalize(e+"/"+r)},Qt=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return e=>crypto.getRandomValues(e);fr("initRandomDevice")},Kr=e=>(Kr=Qt())(e),re={resolve:(...e)=>{for(var r="",t=!1,n=e.length-1;n>=-1&&!t;n--){var o=n>=0?e[n]:a.cwd();if(typeof o!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!o)return"";r=o+"/"+r,t=$.isAbs(o)}return r=$.normalizeArray(r.split("/").filter(i=>!!i),!t).join("/"),(t?"/":"")+r||"."},relative:(e,r)=>{e=re.resolve(e).substr(1),r=re.resolve(r).substr(1);function t(f){for(var d=0;d<f.length&&f[d]==="";d++);for(var g=f.length-1;g>=0&&f[g]==="";g--);return d>g?[]:f.slice(d,g-d+1)}for(var n=t(e.split("/")),o=t(r.split("/")),i=Math.min(n.length,o.length),s=i,l=0;l<i;l++)if(n[l]!==o[l]){s=l;break}for(var c=[],l=s;l<n.length;l++)c.push("..");return c=c.concat(o.slice(s)),c.join("/")}},Xr=typeof TextDecoder!="undefined"?new TextDecoder:void 0,we=(e,r,t)=>{for(var n=r+t,o=r;e[o]&&!(o>=n);)++o;if(o-r>16&&e.buffer&&Xr)return Xr.decode(e.subarray(r,o));for(var i="";r<o;){var s=e[r++];if(!(s&128)){i+=String.fromCharCode(s);continue}var l=e[r++]&63;if((s&224)==192){i+=String.fromCharCode((s&31)<<6|l);continue}var c=e[r++]&63;if((s&240)==224?s=(s&15)<<12|l<<6|c:s=(s&7)<<18|l<<12|c<<6|e[r++]&63,s<65536)i+=String.fromCharCode(s);else{var f=s-65536;i+=String.fromCharCode(55296|f>>10,56320|f&1023)}}return i},vr=[],De=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n<=127?r++:n<=2047?r+=2:n>=55296&&n<=57343?(r+=4,++t):r+=3}return r},pr=(e,r,t,n)=>{if(!(n>0))return 0;for(var o=t,i=t+n-1,s=0;s<e.length;++s){var l=e.charCodeAt(s);if(l>=55296&&l<=57343){var c=e.charCodeAt(++s);l=65536+((l&1023)<<10)|c&1023}if(l<=127){if(t>=i)break;r[t++]=l}else if(l<=2047){if(t+1>=i)break;r[t++]=192|l>>6,r[t++]=128|l&63}else if(l<=65535){if(t+2>=i)break;r[t++]=224|l>>12,r[t++]=128|l>>6&63,r[t++]=128|l&63}else{if(t+3>=i)break;r[t++]=240|l>>18,r[t++]=128|l>>12&63,r[t++]=128|l>>6&63,r[t++]=128|l&63}}return r[t]=0,t-o};function Yr(e,r,t){var n=t>0?t:De(e)+1,o=new Array(n),i=pr(e,o,0,o.length);return r&&(o.length=i),o}var Zt=()=>{if(!vr.length){var e=null;if(typeof window!="undefined"&&typeof window.prompt=="function"&&(e=window.prompt("Input: "),e!==null&&(e+=`
|
|
7
|
-
`)),!e)return null;vr=Yr(e,!0)}return vr.shift()},ie={ttys:[],init(){},shutdown(){},register(e,r){ie.ttys[e]={input:[],output:[],ops:r},a.registerDevice(e,ie.stream_ops)},stream_ops:{open(e){var r=ie.ttys[e.node.rdev];if(!r)throw new a.ErrnoError(43);e.tty=r,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,r,t,n,o){if(!e.tty||!e.tty.ops.get_char)throw new a.ErrnoError(60);for(var i=0,s=0;s<n;s++){var l;try{l=e.tty.ops.get_char(e.tty)}catch(c){throw new a.ErrnoError(29)}if(l===void 0&&i===0)throw new a.ErrnoError(6);if(l==null)break;i++,r[t+s]=l}return i&&(e.node.timestamp=Date.now()),i},write(e,r,t,n,o){if(!e.tty||!e.tty.ops.put_char)throw new a.ErrnoError(60);try{for(var i=0;i<n;i++)e.tty.ops.put_char(e.tty,r[t+i])}catch(s){throw new a.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),i}},default_tty_ops:{get_char(e){return Zt()},put_char(e,r){r===null||r===10?(ae(we(e.output,0)),e.output=[]):r!=0&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(ae(we(e.output,0)),e.output=[])},ioctl_tcgets(e){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ioctl_tcsets(e,r,t){return 0},ioctl_tiocgwinsz(e){return[24,80]}},default_tty1_ops:{put_char(e,r){r===null||r===10?(z(we(e.output,0)),e.output=[]):r!=0&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(z(we(e.output,0)),e.output=[])}}},Jt=(e,r)=>(B.fill(0,e,e+r),e),en=(e,r)=>Math.ceil(e/r)*r,Qr=e=>{e=en(e,65536);var r=_t(65536,e);return r?Jt(r,e):0},k={ops_table:null,mount(e){return k.createNode(null,"/",16895,0)},createNode(e,r,t,n){if(a.isBlkdev(t)||a.isFIFO(t))throw new a.ErrnoError(63);k.ops_table||(k.ops_table={dir:{node:{getattr:k.node_ops.getattr,setattr:k.node_ops.setattr,lookup:k.node_ops.lookup,mknod:k.node_ops.mknod,rename:k.node_ops.rename,unlink:k.node_ops.unlink,rmdir:k.node_ops.rmdir,readdir:k.node_ops.readdir,symlink:k.node_ops.symlink},stream:{llseek:k.stream_ops.llseek}},file:{node:{getattr:k.node_ops.getattr,setattr:k.node_ops.setattr},stream:{llseek:k.stream_ops.llseek,read:k.stream_ops.read,write:k.stream_ops.write,allocate:k.stream_ops.allocate,mmap:k.stream_ops.mmap,msync:k.stream_ops.msync}},link:{node:{getattr:k.node_ops.getattr,setattr:k.node_ops.setattr,readlink:k.node_ops.readlink},stream:{}},chrdev:{node:{getattr:k.node_ops.getattr,setattr:k.node_ops.setattr},stream:a.chrdev_stream_ops}});var o=a.createNode(e,r,t,n);return a.isDir(o.mode)?(o.node_ops=k.ops_table.dir.node,o.stream_ops=k.ops_table.dir.stream,o.contents={}):a.isFile(o.mode)?(o.node_ops=k.ops_table.file.node,o.stream_ops=k.ops_table.file.stream,o.usedBytes=0,o.contents=null):a.isLink(o.mode)?(o.node_ops=k.ops_table.link.node,o.stream_ops=k.ops_table.link.stream):a.isChrdev(o.mode)&&(o.node_ops=k.ops_table.chrdev.node,o.stream_ops=k.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[r]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage(e,r){var t=e.contents?e.contents.length:0;if(!(t>=r)){var n=1024*1024;r=Math.max(r,t*(t<n?2:1.125)>>>0),t!=0&&(r=Math.max(r,256));var o=e.contents;e.contents=new Uint8Array(r),e.usedBytes>0&&e.contents.set(o.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,r){if(e.usedBytes!=r)if(r==0)e.contents=null,e.usedBytes=0;else{var t=e.contents;e.contents=new Uint8Array(r),t&&e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r}},node_ops:{getattr(e){var r={};return r.dev=a.isChrdev(e.mode)?e.id:1,r.ino=e.id,r.mode=e.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=e.rdev,a.isDir(e.mode)?r.size=4096:a.isFile(e.mode)?r.size=e.usedBytes:a.isLink(e.mode)?r.size=e.link.length:r.size=0,r.atime=new Date(e.timestamp),r.mtime=new Date(e.timestamp),r.ctime=new Date(e.timestamp),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr(e,r){r.mode!==void 0&&(e.mode=r.mode),r.timestamp!==void 0&&(e.timestamp=r.timestamp),r.size!==void 0&&k.resizeFileStorage(e,r.size)},lookup(e,r){throw a.genericErrors[44]},mknod(e,r,t,n){return k.createNode(e,r,t,n)},rename(e,r,t){if(a.isDir(e.mode)){var n;try{n=a.lookupNode(r,t)}catch(i){}if(n)for(var o in n.contents)throw new a.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=t,r.contents[t]=e,r.timestamp=e.parent.timestamp},unlink(e,r){delete e.contents[r],e.timestamp=Date.now()},rmdir(e,r){var t=a.lookupNode(e,r);for(var n in t.contents)throw new a.ErrnoError(55);delete e.contents[r],e.timestamp=Date.now()},readdir(e){var r=[".",".."];for(var t of Object.keys(e.contents))r.push(t);return r},symlink(e,r,t){var n=k.createNode(e,r,41471,0);return n.link=t,n},readlink(e){if(!a.isLink(e.mode))throw new a.ErrnoError(28);return e.link}},stream_ops:{read(e,r,t,n,o){var i=e.node.contents;if(o>=e.node.usedBytes)return 0;var s=Math.min(e.node.usedBytes-o,n);if(s>8&&i.subarray)r.set(i.subarray(o,o+s),t);else for(var l=0;l<s;l++)r[t+l]=i[o+l];return s},write(e,r,t,n,o,i){if(r.buffer===U.buffer&&(i=!1),!n)return 0;var s=e.node;if(s.timestamp=Date.now(),r.subarray&&(!s.contents||s.contents.subarray)){if(i)return s.contents=r.subarray(t,t+n),s.usedBytes=n,n;if(s.usedBytes===0&&o===0)return s.contents=r.slice(t,t+n),s.usedBytes=n,n;if(o+n<=s.usedBytes)return s.contents.set(r.subarray(t,t+n),o),n}if(k.expandFileStorage(s,o+n),s.contents.subarray&&r.subarray)s.contents.set(r.subarray(t,t+n),o);else for(var l=0;l<n;l++)s.contents[o+l]=r[t+l];return s.usedBytes=Math.max(s.usedBytes,o+n),n},llseek(e,r,t){var n=r;if(t===1?n+=e.position:t===2&&a.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new a.ErrnoError(28);return n},allocate(e,r,t){k.expandFileStorage(e.node,r+t),e.node.usedBytes=Math.max(e.node.usedBytes,r+t)},mmap(e,r,t,n,o){if(!a.isFile(e.node.mode))throw new a.ErrnoError(43);var i,s,l=e.node.contents;if(!(o&2)&&l.buffer===U.buffer)s=!1,i=l.byteOffset;else{if((t>0||t+r<l.length)&&(l.subarray?l=l.subarray(t,t+r):l=Array.prototype.slice.call(l,t,t+r)),s=!0,i=Qr(r),!i)throw new a.ErrnoError(48);U.set(l,i)}return{ptr:i,allocated:s}},msync(e,r,t,n,o){return k.stream_ops.write(e,r,0,n,t,!1),0}}},rn=(e,r,t,n)=>{var o=n?"":`al ${e}`;ge(e).then(i=>{r(new Uint8Array(i)),o&&Se(o)},i=>{if(t)t();else throw`Loading data file "${e}" failed.`}),o&&Ve(o)},Zr=(e,r,t,n,o,i)=>{a.createDataFile(e,r,t,n,o,i)},tn=u.preloadPlugins||[],nn=(e,r,t,n)=>{typeof Browser!="undefined"&&Browser.init();var o=!1;return tn.forEach(i=>{o||i.canHandle(r)&&(i.handle(e,r,t,n),o=!0)}),o},Jr=(e,r,t,n,o,i,s,l,c,f)=>{var d=r?re.resolve($.join2(e,r)):e,g=`cp ${d}`;function h(m){function y(P){f==null||f(),l||Zr(e,r,P,n,o,c),i==null||i(),Se(g)}nn(m,d,y,()=>{s==null||s(),Se(g)})||y(m)}Ve(g),typeof t=="string"?rn(t,h,s):h(t)},on=e=>{var r={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},t=r[e];if(typeof t=="undefined")throw new Error(`Unknown file open mode: ${e}`);return t},hr=(e,r)=>{var t=0;return e&&(t|=365),r&&(t|=146),t},a={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:class{constructor(e){this.name="ErrnoError",this.errno=e}},genericErrors:{},filesystems:null,syncFSRequests:0,FSStream:class{constructor(){this.shared={}}get object(){return this.node}set object(e){this.node=e}get isRead(){return(this.flags&2097155)!==1}get isWrite(){return(this.flags&2097155)!==0}get isAppend(){return this.flags&1024}get flags(){return this.shared.flags}set flags(e){this.shared.flags=e}get position(){return this.shared.position}set position(e){this.shared.position=e}},FSNode:class{constructor(e,r,t,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=a.nextInode++,this.name=r,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n,this.readMode=365,this.writeMode=146}get read(){return(this.mode&this.readMode)===this.readMode}set read(e){e?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(e){e?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return a.isDir(this.mode)}get isDevice(){return a.isChrdev(this.mode)}},lookupPath(e,r={}){if(e=re.resolve(e),!e)return{path:"",node:null};var t={follow_mount:!0,recurse_count:0};if(r=Object.assign(t,r),r.recurse_count>8)throw new a.ErrnoError(32);for(var n=e.split("/").filter(g=>!!g),o=a.root,i="/",s=0;s<n.length;s++){var l=s===n.length-1;if(l&&r.parent)break;if(o=a.lookupNode(o,n[s]),i=$.join2(i,n[s]),a.isMountpoint(o)&&(!l||l&&r.follow_mount)&&(o=o.mounted.root),!l||r.follow)for(var c=0;a.isLink(o.mode);){var f=a.readlink(i);i=re.resolve($.dirname(i),f);var d=a.lookupPath(i,{recurse_count:r.recurse_count+1});if(o=d.node,c++>40)throw new a.ErrnoError(32)}}return{path:i,node:o}},getPath(e){for(var r;;){if(a.isRoot(e)){var t=e.mount.mountpoint;return r?t[t.length-1]!=="/"?`${t}/${r}`:t+r:t}r=r?`${e.name}/${r}`:e.name,e=e.parent}},hashName(e,r){for(var t=0,n=0;n<r.length;n++)t=(t<<5)-t+r.charCodeAt(n)|0;return(e+t>>>0)%a.nameTable.length},hashAddNode(e){var r=a.hashName(e.parent.id,e.name);e.name_next=a.nameTable[r],a.nameTable[r]=e},hashRemoveNode(e){var r=a.hashName(e.parent.id,e.name);if(a.nameTable[r]===e)a.nameTable[r]=e.name_next;else for(var t=a.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode(e,r){var t=a.mayLookup(e);if(t)throw new a.ErrnoError(t);for(var n=a.hashName(e.id,r),o=a.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===r)return o}return a.lookup(e,r)},createNode(e,r,t,n){var o=new a.FSNode(e,r,t,n);return a.hashAddNode(o),o},destroyNode(e){a.hashRemoveNode(e)},isRoot(e){return e===e.parent},isMountpoint(e){return!!e.mounted},isFile(e){return(e&61440)===32768},isDir(e){return(e&61440)===16384},isLink(e){return(e&61440)===40960},isChrdev(e){return(e&61440)===8192},isBlkdev(e){return(e&61440)===24576},isFIFO(e){return(e&61440)===4096},isSocket(e){return(e&49152)===49152},flagsToPermissionString(e){var r=["r","w","rw"][e&3];return e&512&&(r+="w"),r},nodePermissions(e,r){return a.ignorePermissions?0:r.includes("r")&&!(e.mode&292)||r.includes("w")&&!(e.mode&146)||r.includes("x")&&!(e.mode&73)?2:0},mayLookup(e){if(!a.isDir(e.mode))return 54;var r=a.nodePermissions(e,"x");return r||(e.node_ops.lookup?0:2)},mayCreate(e,r){try{var t=a.lookupNode(e,r);return 20}catch(n){}return a.nodePermissions(e,"wx")},mayDelete(e,r,t){var n;try{n=a.lookupNode(e,r)}catch(i){return i.errno}var o=a.nodePermissions(e,"wx");if(o)return o;if(t){if(!a.isDir(n.mode))return 54;if(a.isRoot(n)||a.getPath(n)===a.cwd())return 10}else if(a.isDir(n.mode))return 31;return 0},mayOpen(e,r){return e?a.isLink(e.mode)?32:a.isDir(e.mode)&&(a.flagsToPermissionString(r)!=="r"||r&512)?31:a.nodePermissions(e,a.flagsToPermissionString(r)):44},MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=a.MAX_OPEN_FDS;e++)if(!a.streams[e])return e;throw new a.ErrnoError(33)},getStreamChecked(e){var r=a.getStream(e);if(!r)throw new a.ErrnoError(8);return r},getStream:e=>a.streams[e],createStream(e,r=-1){return e=Object.assign(new a.FSStream,e),r==-1&&(r=a.nextfd()),e.fd=r,a.streams[r]=e,e},closeStream(e){a.streams[e]=null},dupStream(e,r=-1){var n,o;var t=a.createStream(e,r);return(o=(n=t.stream_ops)==null?void 0:n.dup)==null||o.call(n,t),t},chrdev_stream_ops:{open(e){var t,n;var r=a.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,(n=(t=e.stream_ops).open)==null||n.call(t,e)},llseek(){throw new a.ErrnoError(70)}},major:e=>e>>8,minor:e=>e&255,makedev:(e,r)=>e<<8|r,registerDevice(e,r){a.devices[e]={stream_ops:r}},getDevice:e=>a.devices[e],getMounts(e){for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push(...n.mounts)}return r},syncfs(e,r){typeof e=="function"&&(r=e,e=!1),a.syncFSRequests++,a.syncFSRequests>1&&z(`warning: ${a.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=a.getMounts(a.root.mount),n=0;function o(s){return a.syncFSRequests--,r(s)}function i(s){if(s)return i.errored?void 0:(i.errored=!0,o(s));++n>=t.length&&o(null)}t.forEach(s=>{if(!s.type.syncfs)return i(null);s.type.syncfs(s,e,i)})},mount(e,r,t){var n=t==="/",o=!t,i;if(n&&a.root)throw new a.ErrnoError(10);if(!n&&!o){var s=a.lookupPath(t,{follow_mount:!1});if(t=s.path,i=s.node,a.isMountpoint(i))throw new a.ErrnoError(10);if(!a.isDir(i.mode))throw new a.ErrnoError(54)}var l={type:e,opts:r,mountpoint:t,mounts:[]},c=e.mount(l);return c.mount=l,l.root=c,n?a.root=c:i&&(i.mounted=l,i.mount&&i.mount.mounts.push(l)),c},unmount(e){var r=a.lookupPath(e,{follow_mount:!1});if(!a.isMountpoint(r.node))throw new a.ErrnoError(28);var t=r.node,n=t.mounted,o=a.getMounts(n);Object.keys(a.nameTable).forEach(s=>{for(var l=a.nameTable[s];l;){var c=l.name_next;o.includes(l.mount)&&a.destroyNode(l),l=c}}),t.mounted=null;var i=t.mount.mounts.indexOf(n);t.mount.mounts.splice(i,1)},lookup(e,r){return e.node_ops.lookup(e,r)},mknod(e,r,t){var n=a.lookupPath(e,{parent:!0}),o=n.node,i=$.basename(e);if(!i||i==="."||i==="..")throw new a.ErrnoError(28);var s=a.mayCreate(o,i);if(s)throw new a.ErrnoError(s);if(!o.node_ops.mknod)throw new a.ErrnoError(63);return o.node_ops.mknod(o,i,r,t)},create(e,r){return r=r!==void 0?r:438,r&=4095,r|=32768,a.mknod(e,r,0)},mkdir(e,r){return r=r!==void 0?r:511,r&=1023,r|=16384,a.mknod(e,r,0)},mkdirTree(e,r){for(var t=e.split("/"),n="",o=0;o<t.length;++o)if(t[o]){n+="/"+t[o];try{a.mkdir(n,r)}catch(i){if(i.errno!=20)throw i}}},mkdev(e,r,t){return typeof t=="undefined"&&(t=r,r=438),r|=8192,a.mknod(e,r,t)},symlink(e,r){if(!re.resolve(e))throw new a.ErrnoError(44);var t=a.lookupPath(r,{parent:!0}),n=t.node;if(!n)throw new a.ErrnoError(44);var o=$.basename(r),i=a.mayCreate(n,o);if(i)throw new a.ErrnoError(i);if(!n.node_ops.symlink)throw new a.ErrnoError(63);return n.node_ops.symlink(n,o,e)},rename(e,r){var t=$.dirname(e),n=$.dirname(r),o=$.basename(e),i=$.basename(r),s,l,c;if(s=a.lookupPath(e,{parent:!0}),l=s.node,s=a.lookupPath(r,{parent:!0}),c=s.node,!l||!c)throw new a.ErrnoError(44);if(l.mount!==c.mount)throw new a.ErrnoError(75);var f=a.lookupNode(l,o),d=re.relative(e,n);if(d.charAt(0)!==".")throw new a.ErrnoError(28);if(d=re.relative(r,t),d.charAt(0)!==".")throw new a.ErrnoError(55);var g;try{g=a.lookupNode(c,i)}catch(y){}if(f!==g){var h=a.isDir(f.mode),m=a.mayDelete(l,o,h);if(m)throw new a.ErrnoError(m);if(m=g?a.mayDelete(c,i,h):a.mayCreate(c,i),m)throw new a.ErrnoError(m);if(!l.node_ops.rename)throw new a.ErrnoError(63);if(a.isMountpoint(f)||g&&a.isMountpoint(g))throw new a.ErrnoError(10);if(c!==l&&(m=a.nodePermissions(l,"w"),m))throw new a.ErrnoError(m);a.hashRemoveNode(f);try{l.node_ops.rename(f,c,i),f.parent=c}catch(y){throw y}finally{a.hashAddNode(f)}}},rmdir(e){var r=a.lookupPath(e,{parent:!0}),t=r.node,n=$.basename(e),o=a.lookupNode(t,n),i=a.mayDelete(t,n,!0);if(i)throw new a.ErrnoError(i);if(!t.node_ops.rmdir)throw new a.ErrnoError(63);if(a.isMountpoint(o))throw new a.ErrnoError(10);t.node_ops.rmdir(t,n),a.destroyNode(o)},readdir(e){var r=a.lookupPath(e,{follow:!0}),t=r.node;if(!t.node_ops.readdir)throw new a.ErrnoError(54);return t.node_ops.readdir(t)},unlink(e){var r=a.lookupPath(e,{parent:!0}),t=r.node;if(!t)throw new a.ErrnoError(44);var n=$.basename(e),o=a.lookupNode(t,n),i=a.mayDelete(t,n,!1);if(i)throw new a.ErrnoError(i);if(!t.node_ops.unlink)throw new a.ErrnoError(63);if(a.isMountpoint(o))throw new a.ErrnoError(10);t.node_ops.unlink(t,n),a.destroyNode(o)},readlink(e){var r=a.lookupPath(e),t=r.node;if(!t)throw new a.ErrnoError(44);if(!t.node_ops.readlink)throw new a.ErrnoError(28);return re.resolve(a.getPath(t.parent),t.node_ops.readlink(t))},stat(e,r){var t=a.lookupPath(e,{follow:!r}),n=t.node;if(!n)throw new a.ErrnoError(44);if(!n.node_ops.getattr)throw new a.ErrnoError(63);return n.node_ops.getattr(n)},lstat(e){return a.stat(e,!0)},chmod(e,r,t){var n;if(typeof e=="string"){var o=a.lookupPath(e,{follow:!t});n=o.node}else n=e;if(!n.node_ops.setattr)throw new a.ErrnoError(63);n.node_ops.setattr(n,{mode:r&4095|n.mode&-4096,timestamp:Date.now()})},lchmod(e,r){a.chmod(e,r,!0)},fchmod(e,r){var t=a.getStreamChecked(e);a.chmod(t.node,r)},chown(e,r,t,n){var o;if(typeof e=="string"){var i=a.lookupPath(e,{follow:!n});o=i.node}else o=e;if(!o.node_ops.setattr)throw new a.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown(e,r,t){a.chown(e,r,t,!0)},fchown(e,r,t){var n=a.getStreamChecked(e);a.chown(n.node,r,t)},truncate(e,r){if(r<0)throw new a.ErrnoError(28);var t;if(typeof e=="string"){var n=a.lookupPath(e,{follow:!0});t=n.node}else t=e;if(!t.node_ops.setattr)throw new a.ErrnoError(63);if(a.isDir(t.mode))throw new a.ErrnoError(31);if(!a.isFile(t.mode))throw new a.ErrnoError(28);var o=a.nodePermissions(t,"w");if(o)throw new a.ErrnoError(o);t.node_ops.setattr(t,{size:r,timestamp:Date.now()})},ftruncate(e,r){var t=a.getStreamChecked(e);if(!(t.flags&2097155))throw new a.ErrnoError(28);a.truncate(t.node,r)},utime(e,r,t){var n=a.lookupPath(e,{follow:!0}),o=n.node;o.node_ops.setattr(o,{timestamp:Math.max(r,t)})},open(e,r,t){if(e==="")throw new a.ErrnoError(44);r=typeof r=="string"?on(r):r,r&64?(t=typeof t=="undefined"?438:t,t=t&4095|32768):t=0;var n;if(typeof e=="object")n=e;else{e=$.normalize(e);try{var o=a.lookupPath(e,{follow:!(r&131072)});n=o.node}catch(c){}}var i=!1;if(r&64)if(n){if(r&128)throw new a.ErrnoError(20)}else n=a.mknod(e,t,0),i=!0;if(!n)throw new a.ErrnoError(44);if(a.isChrdev(n.mode)&&(r&=-513),r&65536&&!a.isDir(n.mode))throw new a.ErrnoError(54);if(!i){var s=a.mayOpen(n,r);if(s)throw new a.ErrnoError(s)}r&512&&!i&&a.truncate(n,0),r&=-131713;var l=a.createStream({node:n,path:a.getPath(n),flags:r,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return l.stream_ops.open&&l.stream_ops.open(l),u.logReadFiles&&!(r&1)&&(a.readFiles||(a.readFiles={}),e in a.readFiles||(a.readFiles[e]=1)),l},close(e){if(a.isClosed(e))throw new a.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(r){throw r}finally{a.closeStream(e.fd)}e.fd=null},isClosed(e){return e.fd===null},llseek(e,r,t){if(a.isClosed(e))throw new a.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new a.ErrnoError(70);if(t!=0&&t!=1&&t!=2)throw new a.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read(e,r,t,n,o){if(n<0||o<0)throw new a.ErrnoError(28);if(a.isClosed(e))throw new a.ErrnoError(8);if((e.flags&2097155)===1)throw new a.ErrnoError(8);if(a.isDir(e.node.mode))throw new a.ErrnoError(31);if(!e.stream_ops.read)throw new a.ErrnoError(28);var i=typeof o!="undefined";if(!i)o=e.position;else if(!e.seekable)throw new a.ErrnoError(70);var s=e.stream_ops.read(e,r,t,n,o);return i||(e.position+=s),s},write(e,r,t,n,o,i){if(n<0||o<0)throw new a.ErrnoError(28);if(a.isClosed(e))throw new a.ErrnoError(8);if(!(e.flags&2097155))throw new a.ErrnoError(8);if(a.isDir(e.node.mode))throw new a.ErrnoError(31);if(!e.stream_ops.write)throw new a.ErrnoError(28);e.seekable&&e.flags&1024&&a.llseek(e,0,2);var s=typeof o!="undefined";if(!s)o=e.position;else if(!e.seekable)throw new a.ErrnoError(70);var l=e.stream_ops.write(e,r,t,n,o,i);return s||(e.position+=l),l},allocate(e,r,t){if(a.isClosed(e))throw new a.ErrnoError(8);if(r<0||t<=0)throw new a.ErrnoError(28);if(!(e.flags&2097155))throw new a.ErrnoError(8);if(!a.isFile(e.node.mode)&&!a.isDir(e.node.mode))throw new a.ErrnoError(43);if(!e.stream_ops.allocate)throw new a.ErrnoError(138);e.stream_ops.allocate(e,r,t)},mmap(e,r,t,n,o){if(n&2&&!(o&2)&&(e.flags&2097155)!==2)throw new a.ErrnoError(2);if((e.flags&2097155)===1)throw new a.ErrnoError(2);if(!e.stream_ops.mmap)throw new a.ErrnoError(43);return e.stream_ops.mmap(e,r,t,n,o)},msync(e,r,t,n,o){return e.stream_ops.msync?e.stream_ops.msync(e,r,t,n,o):0},ioctl(e,r,t){if(!e.stream_ops.ioctl)throw new a.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile(e,r={}){if(r.flags=r.flags||0,r.encoding=r.encoding||"binary",r.encoding!=="utf8"&&r.encoding!=="binary")throw new Error(`Invalid encoding type "${r.encoding}"`);var t,n=a.open(e,r.flags),o=a.stat(e),i=o.size,s=new Uint8Array(i);return a.read(n,s,0,i,0),r.encoding==="utf8"?t=we(s,0):r.encoding==="binary"&&(t=s),a.close(n),t},writeFile(e,r,t={}){t.flags=t.flags||577;var n=a.open(e,t.flags,t.mode);if(typeof r=="string"){var o=new Uint8Array(De(r)+1),i=pr(r,o,0,o.length);a.write(n,o,0,i,void 0,t.canOwn)}else if(ArrayBuffer.isView(r))a.write(n,r,0,r.byteLength,void 0,t.canOwn);else throw new Error("Unsupported data type");a.close(n)},cwd:()=>a.currentPath,chdir(e){var r=a.lookupPath(e,{follow:!0});if(r.node===null)throw new a.ErrnoError(44);if(!a.isDir(r.node.mode))throw new a.ErrnoError(54);var t=a.nodePermissions(r.node,"x");if(t)throw new a.ErrnoError(t);a.currentPath=r.path},createDefaultDirectories(){a.mkdir("/tmp"),a.mkdir("/home"),a.mkdir("/home/web_user")},createDefaultDevices(){a.mkdir("/dev"),a.registerDevice(a.makedev(1,3),{read:()=>0,write:(n,o,i,s,l)=>s}),a.mkdev("/dev/null",a.makedev(1,3)),ie.register(a.makedev(5,0),ie.default_tty_ops),ie.register(a.makedev(6,0),ie.default_tty1_ops),a.mkdev("/dev/tty",a.makedev(5,0)),a.mkdev("/dev/tty1",a.makedev(6,0));var e=new Uint8Array(1024),r=0,t=()=>(r===0&&(r=Kr(e).byteLength),e[--r]);a.createDevice("/dev","random",t),a.createDevice("/dev","urandom",t),a.mkdir("/dev/shm"),a.mkdir("/dev/shm/tmp")},createSpecialDirectories(){a.mkdir("/proc");var e=a.mkdir("/proc/self");a.mkdir("/proc/self/fd"),a.mount({mount(){var r=a.createNode(e,"fd",16895,73);return r.node_ops={lookup(t,n){var o=+n,i=a.getStreamChecked(o),s={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>i.path}};return s.parent=s,s}},r}},{},"/proc/self/fd")},createStandardStreams(){u.stdin?a.createDevice("/dev","stdin",u.stdin):a.symlink("/dev/tty","/dev/stdin"),u.stdout?a.createDevice("/dev","stdout",null,u.stdout):a.symlink("/dev/tty","/dev/stdout"),u.stderr?a.createDevice("/dev","stderr",null,u.stderr):a.symlink("/dev/tty1","/dev/stderr");var e=a.open("/dev/stdin",0),r=a.open("/dev/stdout",1),t=a.open("/dev/stderr",1)},staticInit(){[44].forEach(e=>{a.genericErrors[e]=new a.ErrnoError(e),a.genericErrors[e].stack="<generic error, no stack>"}),a.nameTable=new Array(4096),a.mount(k,{},"/"),a.createDefaultDirectories(),a.createDefaultDevices(),a.createSpecialDirectories(),a.filesystems={MEMFS:k}},init(e,r,t){a.init.initialized=!0,u.stdin=e||u.stdin,u.stdout=r||u.stdout,u.stderr=t||u.stderr,a.createStandardStreams()},quit(){a.init.initialized=!1;for(var e=0;e<a.streams.length;e++){var r=a.streams[e];r&&a.close(r)}},findObject(e,r){var t=a.analyzePath(e,r);return t.exists?t.object:null},analyzePath(e,r){try{var t=a.lookupPath(e,{follow:!r});e=t.path}catch(o){}var n={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var t=a.lookupPath(e,{parent:!0});n.parentExists=!0,n.parentPath=t.path,n.parentObject=t.node,n.name=$.basename(e),t=a.lookupPath(e,{follow:!r}),n.exists=!0,n.path=t.path,n.object=t.node,n.name=t.node.name,n.isRoot=t.path==="/"}catch(o){n.error=o.errno}return n},createPath(e,r,t,n){e=typeof e=="string"?e:a.getPath(e);for(var o=r.split("/").reverse();o.length;){var i=o.pop();if(i){var s=$.join2(e,i);try{a.mkdir(s)}catch(l){}e=s}}return s},createFile(e,r,t,n,o){var i=$.join2(typeof e=="string"?e:a.getPath(e),r),s=hr(n,o);return a.create(i,s)},createDataFile(e,r,t,n,o,i){var s=r;e&&(e=typeof e=="string"?e:a.getPath(e),s=r?$.join2(e,r):e);var l=hr(n,o),c=a.create(s,l);if(t){if(typeof t=="string"){for(var f=new Array(t.length),d=0,g=t.length;d<g;++d)f[d]=t.charCodeAt(d);t=f}a.chmod(c,l|146);var h=a.open(c,577);a.write(h,t,0,t.length,0,i),a.close(h),a.chmod(c,l)}},createDevice(e,r,t,n){var o=$.join2(typeof e=="string"?e:a.getPath(e),r),i=hr(!!t,!!n);a.createDevice.major||(a.createDevice.major=64);var s=a.makedev(a.createDevice.major++,0);return a.registerDevice(s,{open(l){l.seekable=!1},close(l){var c;(c=n==null?void 0:n.buffer)!=null&&c.length&&n(10)},read(l,c,f,d,g){for(var h=0,m=0;m<d;m++){var y;try{y=t()}catch(P){throw new a.ErrnoError(29)}if(y===void 0&&h===0)throw new a.ErrnoError(6);if(y==null)break;h++,c[f+m]=y}return h&&(l.node.timestamp=Date.now()),h},write(l,c,f,d,g){for(var h=0;h<d;h++)try{n(c[f+h])}catch(m){throw new a.ErrnoError(29)}return d&&(l.node.timestamp=Date.now()),h}}),a.mkdev(o,i,s)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if(typeof XMLHttpRequest!="undefined")throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");try{e.contents=Y(e.url),e.usedBytes=e.contents.length}catch(r){throw new a.ErrnoError(29)}},createLazyFile(e,r,t,n,o){class i{constructor(){this.lengthKnown=!1,this.chunks=[]}get(m){if(!(m>this.length-1||m<0)){var y=m%this.chunkSize,P=m/this.chunkSize|0;return this.getter(P)[y]}}setDataGetter(m){this.getter=m}cacheLength(){var m=new XMLHttpRequest;if(m.open("HEAD",t,!1),m.send(null),!(m.status>=200&&m.status<300||m.status===304))throw new Error("Couldn't load "+t+". Status: "+m.status);var y=Number(m.getResponseHeader("Content-length")),P,R=(P=m.getResponseHeader("Accept-Ranges"))&&P==="bytes",S=(P=m.getResponseHeader("Content-Encoding"))&&P==="gzip",b=1024*1024;R||(b=y);var A=(D,x)=>{if(D>x)throw new Error("invalid range ("+D+", "+x+") or no bytes requested!");if(x>y-1)throw new Error("only "+y+" bytes available! programmer error!");var O=new XMLHttpRequest;if(O.open("GET",t,!1),y!==b&&O.setRequestHeader("Range","bytes="+D+"-"+x),O.responseType="arraybuffer",O.overrideMimeType&&O.overrideMimeType("text/plain; charset=x-user-defined"),O.send(null),!(O.status>=200&&O.status<300||O.status===304))throw new Error("Couldn't load "+t+". Status: "+O.status);return O.response!==void 0?new Uint8Array(O.response||[]):Yr(O.responseText||"",!0)},M=this;M.setDataGetter(D=>{var x=D*b,O=(D+1)*b-1;if(O=Math.min(O,y-1),typeof M.chunks[D]=="undefined"&&(M.chunks[D]=A(x,O)),typeof M.chunks[D]=="undefined")throw new Error("doXHR failed!");return M.chunks[D]}),(S||!y)&&(b=y=1,y=this.getter(0).length,b=y,ae("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=y,this._chunkSize=b,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if(typeof XMLHttpRequest!="undefined"){if(!J)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var s=new i,l={isDevice:!1,contents:s}}else var l={isDevice:!1,url:t};var c=a.createFile(e,r,l,n,o);l.contents?c.contents=l.contents:l.url&&(c.contents=null,c.url=l.url),Object.defineProperties(c,{usedBytes:{get:function(){return this.contents.length}}});var f={},d=Object.keys(c.stream_ops);d.forEach(h=>{var m=c.stream_ops[h];f[h]=(...y)=>(a.forceLoadFile(c),m(...y))});function g(h,m,y,P,R){var S=h.node.contents;if(R>=S.length)return 0;var b=Math.min(S.length-R,P);if(S.slice)for(var A=0;A<b;A++)m[y+A]=S[R+A];else for(var A=0;A<b;A++)m[y+A]=S.get(R+A);return b}return f.read=(h,m,y,P,R)=>(a.forceLoadFile(c),g(h,m,y,P,R)),f.mmap=(h,m,y,P,R)=>{a.forceLoadFile(c);var S=Qr(m);if(!S)throw new a.ErrnoError(48);return g(h,U,S,m,y),{ptr:S,allocated:!0}},c.stream_ops=f,c}},et=(e,r)=>e?we(B,e,r):"",I={DEFAULT_POLLMASK:5,calculateAt(e,r,t){if($.isAbs(r))return r;var n;if(e===-100)n=a.cwd();else{var o=I.getStreamFromFD(e);n=o.path}if(r.length==0){if(!t)throw new a.ErrnoError(44);return n}return $.join2(n,r)},doStat(e,r,t){var n=e(r);_[t>>2]=n.dev,_[t+4>>2]=n.mode,F[t+8>>2]=n.nlink,_[t+12>>2]=n.uid,_[t+16>>2]=n.gid,_[t+20>>2]=n.rdev,j=[n.size>>>0,(E=n.size,+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],_[t+24>>2]=j[0],_[t+28>>2]=j[1],_[t+32>>2]=4096,_[t+36>>2]=n.blocks;var o=n.atime.getTime(),i=n.mtime.getTime(),s=n.ctime.getTime();return j=[Math.floor(o/1e3)>>>0,(E=Math.floor(o/1e3),+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],_[t+40>>2]=j[0],_[t+44>>2]=j[1],F[t+48>>2]=o%1e3*1e3,j=[Math.floor(i/1e3)>>>0,(E=Math.floor(i/1e3),+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],_[t+56>>2]=j[0],_[t+60>>2]=j[1],F[t+64>>2]=i%1e3*1e3,j=[Math.floor(s/1e3)>>>0,(E=Math.floor(s/1e3),+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],_[t+72>>2]=j[0],_[t+76>>2]=j[1],F[t+80>>2]=s%1e3*1e3,j=[n.ino>>>0,(E=n.ino,+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],_[t+88>>2]=j[0],_[t+92>>2]=j[1],0},doMsync(e,r,t,n,o){if(!a.isFile(r.node.mode))throw new a.ErrnoError(43);if(n&2)return 0;var i=B.slice(e,e+t);a.msync(r,i,o,t,n)},getStreamFromFD(e){var r=a.getStreamChecked(e);return r},varargs:void 0,getStr(e){var r=et(e);return r}};function an(e,r,t){I.varargs=t;try{var n=I.getStreamFromFD(e);switch(r){case 0:{var o=Ge();if(o<0)return-28;for(;a.streams[o];)o++;var i;return i=a.dupStream(n,o),i.fd}case 1:case 2:return 0;case 3:return n.flags;case 4:{var o=Ge();return n.flags|=o,0}case 12:{var o=ye(),s=0;return ee[o+s>>1]=2,0}case 13:case 14:return 0}return-28}catch(l){if(typeof a=="undefined"||l.name!=="ErrnoError")throw l;return-l.errno}}var de=(e,r,t)=>pr(e,B,r,t);function sn(e,r){try{if(r===0)return-28;var t=a.cwd(),n=De(t)+1;return r<n?-68:(de(t,e,r),n)}catch(o){if(typeof a=="undefined"||o.name!=="ErrnoError")throw o;return-o.errno}}function ln(e,r,t){I.varargs=t;try{var n=I.getStreamFromFD(e);switch(r){case 21509:return n.tty?0:-59;case 21505:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var o=n.tty.ops.ioctl_tcgets(n),i=ye();_[i>>2]=o.c_iflag||0,_[i+4>>2]=o.c_oflag||0,_[i+8>>2]=o.c_cflag||0,_[i+12>>2]=o.c_lflag||0;for(var s=0;s<32;s++)U[i+s+17]=o.c_cc[s]||0;return 0}return 0}case 21510:case 21511:case 21512:return n.tty?0:-59;case 21506:case 21507:case 21508:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){for(var i=ye(),l=_[i>>2],c=_[i+4>>2],f=_[i+8>>2],d=_[i+12>>2],g=[],s=0;s<32;s++)g.push(U[i+s+17]);return n.tty.ops.ioctl_tcsets(n.tty,r,{c_iflag:l,c_oflag:c,c_cflag:f,c_lflag:d,c_cc:g})}return 0}case 21519:{if(!n.tty)return-59;var i=ye();return _[i>>2]=0,0}case 21520:return n.tty?-28:-59;case 21531:{var i=ye();return a.ioctl(n,r,i)}case 21523:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var h=n.tty.ops.ioctl_tiocgwinsz(n.tty),i=ye();ee[i>>1]=h[0],ee[i+2>>1]=h[1]}return 0}case 21524:return n.tty?0:-59;case 21515:return n.tty?0:-59;default:return-28}}catch(m){if(typeof a=="undefined"||m.name!=="ErrnoError")throw m;return-m.errno}}function un(e,r,t){try{return r=I.getStr(r),r=I.calculateAt(e,r),r=$.normalize(r),r[r.length-1]==="/"&&(r=r.substr(0,r.length-1)),a.mkdir(r,t,0),0}catch(n){if(typeof a=="undefined"||n.name!=="ErrnoError")throw n;return-n.errno}}function cn(e,r,t,n){I.varargs=n;try{r=I.getStr(r),r=I.calculateAt(e,r);var o=n?Ge():0;return a.open(r,t,o).fd}catch(i){if(typeof a=="undefined"||i.name!=="ErrnoError")throw i;return-i.errno}}function fn(e,r,t,n){try{if(r=I.getStr(r),r=I.calculateAt(e,r),n<=0)return-28;var o=a.readlink(r),i=Math.min(n,De(o)),s=U[t+i];return de(o,t,n+1),U[t+i]=s,i}catch(l){if(typeof a=="undefined"||l.name!=="ErrnoError")throw l;return-l.errno}}function dn(e,r){try{return e=I.getStr(e),I.doStat(a.stat,e,r)}catch(t){if(typeof a=="undefined"||t.name!=="ErrnoError")throw t;return-t.errno}}var vn=()=>{fr("")},pn=(e,r,t,n,o)=>{},hn=()=>{for(var e=new Array(256),r=0;r<256;++r)e[r]=String.fromCharCode(r);rt=e},rt,V=e=>{for(var r="",t=e;B[t];)r+=rt[B[t++]];return r},_e={},ve={},Ke={},Ee,C=e=>{throw new Ee(e)},tt,Xe=e=>{throw new tt(e)},Q=(e,r,t)=>{e.forEach(function(l){Ke[l]=r});function n(l){var c=t(l);c.length!==e.length&&Xe("Mismatched type converter count");for(var f=0;f<e.length;++f)te(e[f],c[f])}var o=new Array(r.length),i=[],s=0;r.forEach((l,c)=>{ve.hasOwnProperty(l)?o[c]=ve[l]:(i.push(l),_e.hasOwnProperty(l)||(_e[l]=[]),_e[l].push(()=>{o[c]=ve[l],++s,s===i.length&&n(o)}))}),i.length===0&&n(o)};function mn(e,r,t={}){var n=r.name;if(e||C(`type "${n}" must have a positive integer typeid pointer`),ve.hasOwnProperty(e)){if(t.ignoreDuplicateRegistrations)return;C(`Cannot register type '${n}' twice`)}if(ve[e]=r,delete Ke[e],_e.hasOwnProperty(e)){var o=_e[e];delete _e[e],o.forEach(i=>i())}}function te(e,r,t={}){if(!("argPackAdvance"in r))throw new TypeError("registerType registeredInstance requires argPackAdvance");return mn(e,r,t)}var se=8,gn=(e,r,t,n)=>{r=V(r),te(e,{name:r,fromWireType:function(o){return!!o},toWireType:function(o,i){return i?t:n},argPackAdvance:se,readValueFromPointer:function(o){return this.fromWireType(B[o])},destructorFunction:null})},yn=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),mr=e=>{function r(t){return t.$$.ptrType.registeredClass.name}C(r(e)+" instance already deleted")},gr=!1,nt=e=>{},wn=e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)},ot=e=>{e.count.value-=1;var r=e.count.value===0;r&&wn(e)},at=(e,r,t)=>{if(r===t)return e;if(t.baseClass===void 0)return null;var n=at(e,r,t.baseClass);return n===null?null:t.downcast(n)},it={},_n=()=>Object.keys(Me).length,En=()=>{var e=[];for(var r in Me)Me.hasOwnProperty(r)&&e.push(Me[r]);return e},Re=[],yr=()=>{for(;Re.length;){var e=Re.pop();e.$$.deleteScheduled=!1,e.delete()}},$e,kn=e=>{$e=e,Re.length&&$e&&$e(yr)},bn=()=>{u.getInheritedInstanceCount=_n,u.getLiveInheritedInstances=En,u.flushPendingDeletes=yr,u.setDelayFunction=kn},Me={},An=(e,r)=>{for(r===void 0&&C("ptr should not be undefined");e.baseClass;)r=e.upcast(r),e=e.baseClass;return r},Pn=(e,r)=>(r=An(e,r),Me[r]),Ye=(e,r)=>{(!r.ptrType||!r.ptr)&&Xe("makeClassHandle requires ptr and ptrType");var t=!!r.smartPtrType,n=!!r.smartPtr;return t!==n&&Xe("Both smartPtrType and smartPtr must be specified"),r.count={value:1},Oe(Object.create(e,{$$:{value:r,writable:!0}}))};function Cn(e){var r=this.getPointee(e);if(!r)return this.destructor(e),null;var t=Pn(this.registeredClass,r);if(t!==void 0){if(t.$$.count.value===0)return t.$$.ptr=r,t.$$.smartPtr=e,t.clone();var n=t.clone();return this.destructor(e),n}function o(){return this.isSmartPointer?Ye(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:r,smartPtrType:this,smartPtr:e}):Ye(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var i=this.registeredClass.getActualType(r),s=it[i];if(!s)return o.call(this);var l;this.isConst?l=s.constPointerType:l=s.pointerType;var c=at(r,this.registeredClass,l.registeredClass);return c===null?o.call(this):this.isSmartPointer?Ye(l.registeredClass.instancePrototype,{ptrType:l,ptr:c,smartPtrType:this,smartPtr:e}):Ye(l.registeredClass.instancePrototype,{ptrType:l,ptr:c})}var Oe=e=>typeof FinalizationRegistry=="undefined"?(Oe=r=>r,e):(gr=new FinalizationRegistry(r=>{ot(r.$$)}),Oe=r=>{var t=r.$$,n=!!t.smartPtr;if(n){var o={$$:t};gr.register(r,o,r)}return r},nt=r=>gr.unregister(r),Oe(e)),Tn=()=>{Object.assign(Qe.prototype,{isAliasOf(e){if(!(this instanceof Qe)||!(e instanceof Qe))return!1;var r=this.$$.ptrType.registeredClass,t=this.$$.ptr;e.$$=e.$$;for(var n=e.$$.ptrType.registeredClass,o=e.$$.ptr;r.baseClass;)t=r.upcast(t),r=r.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return r===n&&t===o},clone(){if(this.$$.ptr||mr(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=Oe(Object.create(Object.getPrototypeOf(this),{$$:{value:yn(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e},delete(){this.$$.ptr||mr(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&C("Object already scheduled for deletion"),nt(this),ot(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||mr(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&C("Object already scheduled for deletion"),Re.push(this),Re.length===1&&$e&&$e(yr),this.$$.deleteScheduled=!0,this}})};function Qe(){}var Ze=(e,r)=>Object.defineProperty(r,"name",{value:e}),wr=(e,r,t)=>{if(e[r].overloadTable===void 0){var n=e[r];e[r]=function(...o){return e[r].overloadTable.hasOwnProperty(o.length)||C(`Function '${t}' called with an invalid number of arguments (${o.length}) - expects one of (${e[r].overloadTable})!`),e[r].overloadTable[o.length].apply(this,o)},e[r].overloadTable=[],e[r].overloadTable[n.argCount]=n}},st=(e,r,t)=>{u.hasOwnProperty(e)?((t===void 0||u[e].overloadTable!==void 0&&u[e].overloadTable[t]!==void 0)&&C(`Cannot register public name '${e}' twice`),wr(u,e,e),u.hasOwnProperty(t)&&C(`Cannot register multiple overloads of a function with the same number of arguments (${t})!`),u[e].overloadTable[t]=r):(u[e]=r,t!==void 0&&(u[e].numArguments=t))},Fn=48,Sn=57,Dn=e=>{if(e===void 0)return"_unknown";e=e.replace(/[^a-zA-Z0-9_]/g,"$");var r=e.charCodeAt(0);return r>=Fn&&r<=Sn?`_${e}`:e};function Rn(e,r,t,n,o,i,s,l){this.name=e,this.constructor=r,this.instancePrototype=t,this.rawDestructor=n,this.baseClass=o,this.getActualType=i,this.upcast=s,this.downcast=l,this.pureVirtualFunctions=[]}var Je=(e,r,t)=>{for(;r!==t;)r.upcast||C(`Expected null or instance of ${t.name}, got an instance of ${r.name}`),e=r.upcast(e),r=r.baseClass;return e};function $n(e,r){if(r===null)return this.isReference&&C(`null is not a valid ${this.name}`),0;r.$$||C(`Cannot pass "${Ar(r)}" as a ${this.name}`),r.$$.ptr||C(`Cannot pass deleted object as a pointer of type ${this.name}`);var t=r.$$.ptrType.registeredClass,n=Je(r.$$.ptr,t,this.registeredClass);return n}function Mn(e,r){var t;if(r===null)return this.isReference&&C(`null is not a valid ${this.name}`),this.isSmartPointer?(t=this.rawConstructor(),e!==null&&e.push(this.rawDestructor,t),t):0;(!r||!r.$$)&&C(`Cannot pass "${Ar(r)}" as a ${this.name}`),r.$$.ptr||C(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&r.$$.ptrType.isConst&&C(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`);var n=r.$$.ptrType.registeredClass;if(t=Je(r.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(r.$$.smartPtr===void 0&&C("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:r.$$.smartPtrType===this?t=r.$$.smartPtr:C(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:t=r.$$.smartPtr;break;case 2:if(r.$$.smartPtrType===this)t=r.$$.smartPtr;else{var o=r.clone();t=this.rawShare(t,he.toHandle(()=>o.delete())),e!==null&&e.push(this.rawDestructor,t)}break;default:C("Unsupporting sharing policy")}return t}function On(e,r){if(r===null)return this.isReference&&C(`null is not a valid ${this.name}`),0;r.$$||C(`Cannot pass "${Ar(r)}" as a ${this.name}`),r.$$.ptr||C(`Cannot pass deleted object as a pointer of type ${this.name}`),r.$$.ptrType.isConst&&C(`Cannot convert argument of type ${r.$$.ptrType.name} to parameter type ${this.name}`);var t=r.$$.ptrType.registeredClass,n=Je(r.$$.ptr,t,this.registeredClass);return n}function er(e){return this.fromWireType(F[e>>2])}var Wn=()=>{Object.assign(We.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){var r;(r=this.rawDestructor)==null||r.call(this,e)},argPackAdvance:se,readValueFromPointer:er,fromWireType:Cn})};function We(e,r,t,n,o,i,s,l,c,f,d){this.name=e,this.registeredClass=r,this.isReference=t,this.isConst=n,this.isSmartPointer=o,this.pointeeType=i,this.sharingPolicy=s,this.rawGetPointee=l,this.rawConstructor=c,this.rawShare=f,this.rawDestructor=d,!o&&r.baseClass===void 0?n?(this.toWireType=$n,this.destructorFunction=null):(this.toWireType=On,this.destructorFunction=null):this.toWireType=Mn}var lt=(e,r,t)=>{u.hasOwnProperty(e)||Xe("Replacing nonexistent public symbol"),u[e].overloadTable!==void 0&&t!==void 0?u[e].overloadTable[t]=r:(u[e]=r,u[e].argCount=t)},jn=(e,r,t)=>{e=e.replace(/p/g,"i");var n=u["dynCall_"+e];return n(r,...t)},rr=[],ut,ct=e=>{var r=rr[e];return r||(e>=rr.length&&(rr.length=e+1),rr[e]=r=ut.get(e)),r},In=(e,r,t=[])=>{if(e.includes("j"))return jn(e,r,t);var n=ct(r)(...t);return n},Nn=(e,r)=>(...t)=>In(e,r,t),q=(e,r)=>{e=V(e);function t(){return e.includes("j")?Nn(e,r):ct(r)}var n=t();return typeof n!="function"&&C(`unknown function pointer with signature ${e}: ${r}`),n},xn=(e,r)=>{var t=Ze(r,function(n){this.name=r,this.message=n;var o=new Error(n).stack;o!==void 0&&(this.stack=this.toString()+`
|
|
8
|
-
`+o.replace(/^Error(:[^\n]*)?\n/,""))});return t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},t},ft,dt=e=>{var r=wt(e),t=V(r);return oe(r),t},pe=(e,r)=>{var t=[],n={};function o(i){if(!n[i]&&!ve[i]){if(Ke[i]){Ke[i].forEach(o);return}t.push(i),n[i]=!0}}throw r.forEach(o),new ft(`${e}: `+t.map(dt).join([", "]))},Un=(e,r,t,n,o,i,s,l,c,f,d,g,h)=>{d=V(d),i=q(o,i),l&&(l=q(s,l)),f&&(f=q(c,f)),h=q(g,h);var m=Dn(d);st(m,function(){pe(`Cannot construct ${d} due to unbound types`,[n])}),Q([e,r,t],n?[n]:[],y=>{var O,Ne;y=y[0];var P,R;n?(P=y.registeredClass,R=P.instancePrototype):R=Qe.prototype;var S=Ze(d,function(...xe){if(Object.getPrototypeOf(this)!==b)throw new Ee("Use 'new' to construct "+d);if(A.constructor_body===void 0)throw new Ee(d+" has no accessible constructor");var Ue=A.constructor_body[xe.length];if(Ue===void 0)throw new Ee(`Tried to invoke ctor of ${d} with invalid number of parameters (${xe.length}) - expected (${Object.keys(A.constructor_body).toString()}) parameters instead!`);return Ue.apply(this,xe)}),b=Object.create(R,{constructor:{value:S}});S.prototype=b;var A=new Rn(d,S,b,h,P,i,l,f);A.baseClass&&((Ne=(O=A.baseClass).__derivedClasses)!=null||(O.__derivedClasses=[]),A.baseClass.__derivedClasses.push(A));var M=new We(d,A,!0,!1,!1),D=new We(d+"*",A,!1,!1,!1),x=new We(d+" const*",A,!1,!0,!1);return it[e]={pointerType:D,constPointerType:x},lt(m,S),[M,D,x]})},_r=e=>{for(;e.length;){var r=e.pop(),t=e.pop();t(r)}};function Ln(e){for(var r=1;r<e.length;++r)if(e[r]!==null&&e[r].destructorFunction===void 0)return!0;return!1}function tr(e,r,t,n,o,i){var s=r.length;s<2&&C("argTypes array size mismatch! Must at least get return value and 'this' types!");var l=r[1]!==null&&t!==null,c=Ln(r),f=r[0].name!=="void",d=s-2,g=new Array(d),h=[],m=[],y=function(...P){P.length!==d&&C(`function ${e} called with ${P.length} arguments, expected ${d}`),m.length=0;var R;h.length=l?2:1,h[0]=o,l&&(R=r[1].toWireType(m,this),h[1]=R);for(var S=0;S<d;++S)g[S]=r[S+2].toWireType(m,P[S]),h.push(g[S]);var b=n(...h);function A(M){if(c)_r(m);else for(var D=l?1:2;D<r.length;D++){var x=D===1?R:g[D-2];r[D].destructorFunction!==null&&r[D].destructorFunction(x)}if(f)return r[0].fromWireType(M)}return A(b)};return Ze(e,y)}var nr=(e,r)=>{for(var t=[],n=0;n<e;n++)t.push(F[r+n*4>>2]);return t},Er=e=>{e=e.trim();let r=e.indexOf("(");return r!==-1?e.substr(0,r):e},Hn=(e,r,t,n,o,i,s,l)=>{var c=nr(t,n);r=V(r),r=Er(r),i=q(o,i),Q([],[e],f=>{f=f[0];var d=`${f.name}.${r}`;function g(){pe(`Cannot call ${d} due to unbound types`,c)}r.startsWith("@@")&&(r=Symbol[r.substring(2)]);var h=f.registeredClass.constructor;return h[r]===void 0?(g.argCount=t-1,h[r]=g):(wr(h,r,d),h[r].overloadTable[t-1]=g),Q([],c,m=>{var y=[m[0],null].concat(m.slice(1)),P=tr(d,y,null,i,s,l);if(h[r].overloadTable===void 0?(P.argCount=t-1,h[r]=P):h[r].overloadTable[t-1]=P,f.registeredClass.__derivedClasses)for(let R of f.registeredClass.__derivedClasses)R.constructor.hasOwnProperty(r)||(R.constructor[r]=P);return[]}),[]})},Bn=(e,r,t,n,o,i)=>{var s=nr(r,t);o=q(n,o),Q([],[e],l=>{l=l[0];var c=`constructor ${l.name}`;if(l.registeredClass.constructor_body===void 0&&(l.registeredClass.constructor_body=[]),l.registeredClass.constructor_body[r-1]!==void 0)throw new Ee(`Cannot register multiple constructors with identical number of parameters (${r-1}) for class '${l.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return l.registeredClass.constructor_body[r-1]=()=>{pe(`Cannot construct ${l.name} due to unbound types`,s)},Q([],s,f=>(f.splice(1,0,null),l.registeredClass.constructor_body[r-1]=tr(c,f,null,o,i),[])),[]})},zn=(e,r,t,n,o,i,s,l,c)=>{var f=nr(t,n);r=V(r),r=Er(r),i=q(o,i),Q([],[e],d=>{d=d[0];var g=`${d.name}.${r}`;r.startsWith("@@")&&(r=Symbol[r.substring(2)]),l&&d.registeredClass.pureVirtualFunctions.push(r);function h(){pe(`Cannot call ${g} due to unbound types`,f)}var m=d.registeredClass.instancePrototype,y=m[r];return y===void 0||y.overloadTable===void 0&&y.className!==d.name&&y.argCount===t-2?(h.argCount=t-2,h.className=d.name,m[r]=h):(wr(m,r,g),m[r].overloadTable[t-2]=h),Q([],f,P=>{var R=tr(g,P,d,i,s,c);return m[r].overloadTable===void 0?(R.argCount=t-2,m[r]=R):m[r].overloadTable[t-2]=R,[]}),[]})},vt=(e,r,t)=>(e instanceof Object||C(`${t} with invalid "this": ${e}`),e instanceof r.registeredClass.constructor||C(`${t} incompatible with "this" of type ${e.constructor.name}`),e.$$.ptr||C(`cannot call emscripten binding method ${t} on deleted object`),Je(e.$$.ptr,e.$$.ptrType.registeredClass,r.registeredClass)),Vn=(e,r,t,n,o,i,s,l,c,f)=>{r=V(r),o=q(n,o),Q([],[e],d=>{d=d[0];var g=`${d.name}.${r}`,h={get(){pe(`Cannot access ${g} due to unbound types`,[t,s])},enumerable:!0,configurable:!0};return c?h.set=()=>pe(`Cannot access ${g} due to unbound types`,[t,s]):h.set=m=>C(g+" is a read-only property"),Object.defineProperty(d.registeredClass.instancePrototype,r,h),Q([],c?[t,s]:[t],m=>{var y=m[0],P={get(){var S=vt(this,d,g+" getter");return y.fromWireType(o(i,S))},enumerable:!0};if(c){c=q(l,c);var R=m[1];P.set=function(S){var b=vt(this,d,g+" setter"),A=[];c(f,b,R.toWireType(A,S)),_r(A)}}return Object.defineProperty(d.registeredClass.instancePrototype,r,P),[]}),[]})},kr=[],ne=[],br=e=>{e>9&&--ne[e+1]===0&&(ne[e]=void 0,kr.push(e))},qn=()=>ne.length/2-5-kr.length,Gn=()=>{ne.push(0,1,void 0,1,null,1,!0,1,!1,1),u.count_emval_handles=qn},he={toValue:e=>(e||C("Cannot use deleted val. handle = "+e),ne[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{let r=kr.pop()||ne.length;return ne[r]=e,ne[r+1]=1,r}}}},Kn={name:"emscripten::val",fromWireType:e=>{var r=he.toValue(e);return br(e),r},toWireType:(e,r)=>he.toHandle(r),argPackAdvance:se,readValueFromPointer:er,destructorFunction:null},pt=e=>te(e,Kn),Ar=e=>{if(e===null)return"null";var r=typeof e;return r==="object"||r==="array"||r==="function"?e.toString():""+e},Xn=(e,r)=>{switch(r){case 4:return function(t){return this.fromWireType(Nr[t>>2])};case 8:return function(t){return this.fromWireType(xr[t>>3])};default:throw new TypeError(`invalid float width (${r}): ${e}`)}},Yn=(e,r,t)=>{r=V(r),te(e,{name:r,fromWireType:n=>n,toWireType:(n,o)=>o,argPackAdvance:se,readValueFromPointer:Xn(r,t),destructorFunction:null})},Qn=(e,r,t,n,o,i,s)=>{var l=nr(r,t);e=V(e),e=Er(e),o=q(n,o),st(e,function(){pe(`Cannot call ${e} due to unbound types`,l)},r-1),Q([],l,c=>{var f=[c[0],null].concat(c.slice(1));return lt(e,tr(e,f,null,o,i,s),r-1),[]})},Zn=(e,r,t)=>{switch(r){case 1:return t?n=>U[n]:n=>B[n];case 2:return t?n=>ee[n>>1]:n=>ze[n>>1];case 4:return t?n=>_[n>>2]:n=>F[n>>2];default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},Jn=(e,r,t,n,o)=>{r=V(r),o===-1&&(o=4294967295);var i=d=>d;if(n===0){var s=32-8*t;i=d=>d<<s>>>s}var l=r.includes("unsigned"),c=(d,g)=>{},f;l?f=function(d,g){return c(g,this.name),g>>>0}:f=function(d,g){return c(g,this.name),g},te(e,{name:r,fromWireType:i,toWireType:f,argPackAdvance:se,readValueFromPointer:Zn(r,t,n!==0),destructorFunction:null})},eo=(e,r,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],o=n[r];function i(s){var l=F[s>>2],c=F[s+4>>2];return new o(U.buffer,c,l)}t=V(t),te(e,{name:t,fromWireType:i,argPackAdvance:se,readValueFromPointer:i},{ignoreDuplicateRegistrations:!0})},ro=(e,r)=>{pt(e)},to=(e,r,t,n,o,i,s,l,c,f,d,g)=>{t=V(t),i=q(o,i),l=q(s,l),f=q(c,f),g=q(d,g),Q([e],[r],h=>{h=h[0];var m=new We(t,h.registeredClass,!1,!1,!0,h,n,i,l,f,g);return[m]})},no=(e,r)=>{r=V(r);var t=r==="std::string";te(e,{name:r,fromWireType(n){var o=F[n>>2],i=n+4,s;if(t)for(var l=i,c=0;c<=o;++c){var f=i+c;if(c==o||B[f]==0){var d=f-l,g=et(l,d);s===void 0?s=g:(s+=String.fromCharCode(0),s+=g),l=f+1}}else{for(var h=new Array(o),c=0;c<o;++c)h[c]=String.fromCharCode(B[i+c]);s=h.join("")}return oe(n),s},toWireType(n,o){o instanceof ArrayBuffer&&(o=new Uint8Array(o));var i,s=typeof o=="string";s||o instanceof Uint8Array||o instanceof Uint8ClampedArray||o instanceof Int8Array||C("Cannot pass non-string to std::string"),t&&s?i=De(o):i=o.length;var l=Tr(4+i+1),c=l+4;if(F[l>>2]=i,t&&s)de(o,c,i+1);else if(s)for(var f=0;f<i;++f){var d=o.charCodeAt(f);d>255&&(oe(c),C("String has UTF-16 code units that do not fit in 8 bits")),B[c+f]=d}else for(var f=0;f<i;++f)B[c+f]=o[f];return n!==null&&n.push(oe,l),l},argPackAdvance:se,readValueFromPointer:er,destructorFunction(n){oe(n)}})},ht=typeof TextDecoder!="undefined"?new TextDecoder("utf-16le"):void 0,oo=(e,r)=>{for(var t=e,n=t>>1,o=n+r/2;!(n>=o)&&ze[n];)++n;if(t=n<<1,t-e>32&&ht)return ht.decode(B.subarray(e,t));for(var i="",s=0;!(s>=r/2);++s){var l=ee[e+s*2>>1];if(l==0)break;i+=String.fromCharCode(l)}return i},ao=(e,r,t)=>{if(t!=null||(t=2147483647),t<2)return 0;t-=2;for(var n=r,o=t<e.length*2?t/2:e.length,i=0;i<o;++i){var s=e.charCodeAt(i);ee[r>>1]=s,r+=2}return ee[r>>1]=0,r-n},io=e=>e.length*2,so=(e,r)=>{for(var t=0,n="";!(t>=r/4);){var o=_[e+t*4>>2];if(o==0)break;if(++t,o>=65536){var i=o-65536;n+=String.fromCharCode(55296|i>>10,56320|i&1023)}else n+=String.fromCharCode(o)}return n},lo=(e,r,t)=>{if(t!=null||(t=2147483647),t<4)return 0;for(var n=r,o=n+t-4,i=0;i<e.length;++i){var s=e.charCodeAt(i);if(s>=55296&&s<=57343){var l=e.charCodeAt(++i);s=65536+((s&1023)<<10)|l&1023}if(_[r>>2]=s,r+=4,r+4>o)break}return _[r>>2]=0,r-n},uo=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n>=55296&&n<=57343&&++t,r+=4}return r},co=(e,r,t)=>{t=V(t);var n,o,i,s;r===2?(n=oo,o=ao,s=io,i=l=>ze[l>>1]):r===4&&(n=so,o=lo,s=uo,i=l=>F[l>>2]),te(e,{name:t,fromWireType:l=>{for(var c=F[l>>2],f,d=l+4,g=0;g<=c;++g){var h=l+4+g*r;if(g==c||i(h)==0){var m=h-d,y=n(d,m);f===void 0?f=y:(f+=String.fromCharCode(0),f+=y),d=h+r}}return oe(l),f},toWireType:(l,c)=>{typeof c!="string"&&C(`Cannot pass non-string to C++ string type ${t}`);var f=s(c),d=Tr(4+f+r);return F[d>>2]=f/r,o(c,d+4,f+r),l!==null&&l.push(oe,d),d},argPackAdvance:se,readValueFromPointer:er,destructorFunction(l){oe(l)}})},fo=(e,r)=>{r=V(r),te(e,{isVoid:!0,name:r,argPackAdvance:0,fromWireType:()=>{},toWireType:(t,n)=>{}})},vo=1,po=()=>vo,ho=(e,r,t)=>B.copyWithin(e,r,r+t),Pr=[],mo=(e,r,t,n)=>(e=Pr[e],r=he.toValue(r),e(null,r,t,n)),go=e=>{var r=Pr.length;return Pr.push(e),r},mt=(e,r)=>{var t=ve[e];return t===void 0&&C(`${r} has unknown type ${dt(e)}`),t},yo=(e,r)=>{for(var t=new Array(e),n=0;n<e;++n)t[n]=mt(F[r+n*4>>2],"parameter "+n);return t},wo=Reflect.construct,_o=(e,r,t)=>{var n=[],o=e.toWireType(n,t);return n.length&&(F[r>>2]=he.toHandle(n)),o},Eo=(e,r,t)=>{var n=yo(e,r),o=n.shift();e--;var i=new Array(e),s=(c,f,d,g)=>{for(var h=0,m=0;m<e;++m)i[m]=n[m].readValueFromPointer(g+h),h+=n[m].argPackAdvance;var y=t===1?wo(f,i):f.apply(c,i);return _o(o,d,y)},l=`methodCaller<(${n.map(c=>c.name).join(", ")}) => ${o.name}>`;return go(Ze(l,s))},ko=e=>{e>9&&(ne[e+1]+=1)},bo=e=>{var r=he.toValue(e);_r(r),br(e)},Ao=(e,r)=>{e=mt(e,"_emval_take_value");var t=e.readValueFromPointer(r);return he.toHandle(t)},je=(e,r)=>r+2097152>>>0<4194305-!!e?(e>>>0)+r*4294967296:NaN;function Po(e,r,t){var n=je(e,r),o=new Date(n*1e3);_[t>>2]=o.getUTCSeconds(),_[t+4>>2]=o.getUTCMinutes(),_[t+8>>2]=o.getUTCHours(),_[t+12>>2]=o.getUTCDate(),_[t+16>>2]=o.getUTCMonth(),_[t+20>>2]=o.getUTCFullYear()-1900,_[t+24>>2]=o.getUTCDay();var i=Date.UTC(o.getUTCFullYear(),0,1,0,0,0,0),s=(o.getTime()-i)/(1e3*60*60*24)|0;_[t+28>>2]=s}var Co=e=>e%4===0&&(e%100!==0||e%400===0),To=[0,31,60,91,121,152,182,213,244,274,305,335],Fo=[0,31,59,90,120,151,181,212,243,273,304,334],So=e=>{var r=Co(e.getFullYear()),t=r?To:Fo,n=t[e.getMonth()]+e.getDate()-1;return n};function Do(e,r,t){var n=je(e,r),o=new Date(n*1e3);_[t>>2]=o.getSeconds(),_[t+4>>2]=o.getMinutes(),_[t+8>>2]=o.getHours(),_[t+12>>2]=o.getDate(),_[t+16>>2]=o.getMonth(),_[t+20>>2]=o.getFullYear()-1900,_[t+24>>2]=o.getDay();var i=So(o)|0;_[t+28>>2]=i,_[t+36>>2]=-(o.getTimezoneOffset()*60);var s=new Date(o.getFullYear(),0,1),l=new Date(o.getFullYear(),6,1).getTimezoneOffset(),c=s.getTimezoneOffset(),f=(l!=c&&o.getTimezoneOffset()==Math.min(c,l))|0;_[t+32>>2]=f}function Ro(e,r,t,n,o,i,s,l){var c=je(o,i);try{if(isNaN(c))return 61;var f=I.getStreamFromFD(n),d=a.mmap(f,e,c,r,t),g=d.ptr;return _[s>>2]=d.allocated,F[l>>2]=g,0}catch(h){if(typeof a=="undefined"||h.name!=="ErrnoError")throw h;return-h.errno}}function $o(e,r,t,n,o,i,s){var l=je(i,s);try{var c=I.getStreamFromFD(o);t&2&&I.doMsync(e,c,r,n,l)}catch(f){if(typeof a=="undefined"||f.name!=="ErrnoError")throw f;return-f.errno}}var Mo=(e,r,t,n)=>{var o=new Date().getFullYear(),i=new Date(o,0,1),s=new Date(o,6,1),l=i.getTimezoneOffset(),c=s.getTimezoneOffset(),f=Math.max(l,c);F[e>>2]=f*60,_[r>>2]=+(l!=c);var d=m=>m.toLocaleTimeString(void 0,{hour12:!1,timeZoneName:"short"}).split(" ")[1],g=d(i),h=d(s);c<l?(de(g,t,17),de(h,n,17)):(de(g,n,17),de(h,t,17))},Oo=()=>Date.now(),gt=()=>2147483648,Wo=()=>gt(),yt;yt=()=>performance.now();var jo=e=>{var r=Be.buffer,t=(e-r.byteLength+65535)/65536;try{return Be.grow(t),Ur(),1}catch(n){}},Io=e=>{var r=B.length;e>>>=0;var t=gt();if(e>t)return!1;for(var n=(c,f)=>c+(f-c%f)%f,o=1;o<=4;o*=2){var i=r*(1+.2/o);i=Math.min(i,e+100663296);var s=Math.min(t,n(Math.max(e,i),65536)),l=jo(s);if(l)return!0}return!1},Cr={},No=()=>me||"./this.program",Ie=()=>{if(!Ie.strings){var e=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:e,_:No()};for(var t in Cr)Cr[t]===void 0?delete r[t]:r[t]=Cr[t];var n=[];for(var t in r)n.push(`${t}=${r[t]}`);Ie.strings=n}return Ie.strings},xo=(e,r)=>{for(var t=0;t<e.length;++t)U[r++]=e.charCodeAt(t);U[r]=0},Uo=(e,r)=>{var t=0;return Ie().forEach((n,o)=>{var i=r+t;F[e+o*4>>2]=i,xo(n,i),t+=n.length+1}),0},Lo=(e,r)=>{var t=Ie();F[e>>2]=t.length;var n=0;return t.forEach(o=>n+=o.length+1),F[r>>2]=n,0},Ho=0,Bo=()=>Gt||Ho>0,zo=e=>{var r;ur=e,Bo()||((r=u.onExit)==null||r.call(u,e),lr=!0),Ce(e,new qt(e))},Vo=(e,r)=>{ur=e,zo(e)},qo=Vo;function Go(e){try{var r=I.getStreamFromFD(e);return a.close(r),0}catch(t){if(typeof a=="undefined"||t.name!=="ErrnoError")throw t;return t.errno}}function Ko(e,r){try{var t=0,n=0,o=0,i=I.getStreamFromFD(e),s=i.tty?2:a.isDir(i.mode)?3:a.isLink(i.mode)?7:4;return U[r]=s,ee[r+2>>1]=o,j=[t>>>0,(E=t,+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],_[r+8>>2]=j[0],_[r+12>>2]=j[1],j=[n>>>0,(E=n,+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],_[r+16>>2]=j[0],_[r+20>>2]=j[1],0}catch(l){if(typeof a=="undefined"||l.name!=="ErrnoError")throw l;return l.errno}}var Xo=(e,r,t,n)=>{for(var o=0,i=0;i<t;i++){var s=F[r>>2],l=F[r+4>>2];r+=8;var c=a.read(e,U,s,l,n);if(c<0)return-1;if(o+=c,c<l)break;typeof n!="undefined"&&(n+=c)}return o};function Yo(e,r,t,n){try{var o=I.getStreamFromFD(e),i=Xo(o,r,t);return F[n>>2]=i,0}catch(s){if(typeof a=="undefined"||s.name!=="ErrnoError")throw s;return s.errno}}function Qo(e,r,t,n,o){var i=je(r,t);try{if(isNaN(i))return 61;var s=I.getStreamFromFD(e);return a.llseek(s,i,n),j=[s.position>>>0,(E=s.position,+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],_[o>>2]=j[0],_[o+4>>2]=j[1],s.getdents&&i===0&&n===0&&(s.getdents=null),0}catch(l){if(typeof a=="undefined"||l.name!=="ErrnoError")throw l;return l.errno}}var Zo=(e,r,t,n)=>{for(var o=0,i=0;i<t;i++){var s=F[r>>2],l=F[r+4>>2];r+=8;var c=a.write(e,U,s,l,n);if(c<0)return-1;o+=c,typeof n!="undefined"&&(n+=c)}return o};function Jo(e,r,t,n){try{var o=I.getStreamFromFD(e),i=Zo(o,r,t);return F[n>>2]=i,0}catch(s){if(typeof a=="undefined"||s.name!=="ErrnoError")throw s;return s.errno}}var ea=a.createPath,ra=e=>a.unlink(e),ta=a.createLazyFile,na=a.createDevice;a.createPreloadedFile=Jr,a.staticInit(),u.FS_createPath=a.createPath,u.FS_createDataFile=a.createDataFile,u.FS_createPreloadedFile=a.createPreloadedFile,u.FS_unlink=a.unlink,u.FS_createLazyFile=a.createLazyFile,u.FS_createDevice=a.createDevice,hn(),Ee=u.BindingError=class extends Error{constructor(r){super(r),this.name="BindingError"}},tt=u.InternalError=class extends Error{constructor(r){super(r),this.name="InternalError"}},Tn(),bn(),Wn(),ft=u.UnboundTypeError=xn(Error,"UnboundTypeError"),Gn();var oa={a:Yt,q:an,M:sn,P:ln,I:un,r:cn,G:fn,N:dn,S:vn,D:pn,U:gn,e:Un,s:Hn,n:Bn,g:zn,m:Vn,T:pt,v:Yn,i:Qn,c:Jn,b:eo,x:ro,o:to,u:no,l:co,V:fo,Q:po,R:ho,X:mo,d:br,Y:Eo,w:ko,W:bo,h:Ao,A:Po,B:Do,y:Ro,z:$o,H:Mo,t:Oo,F:Wo,j:yt,E:Io,K:Uo,L:Lo,f:qo,k:Go,J:Ko,O:Yo,C:Qo,p:Jo},N=Vt(),aa=()=>(aa=N._)(),wt=e=>(wt=N.$)(e),Tr=e=>(Tr=N.ba)(e),oe=e=>(oe=N.ca)(e),_t=(e,r)=>(_t=N.da)(e,r),Et=e=>(Et=N.ea)(e),ia=u.dynCall_jjj=(e,r,t,n,o)=>(ia=u.dynCall_jjj=N.fa)(e,r,t,n,o),sa=u.dynCall_iiiijj=(e,r,t,n,o,i,s,l)=>(sa=u.dynCall_iiiijj=N.ga)(e,r,t,n,o,i,s,l),la=u.dynCall_viijj=(e,r,t,n,o,i,s)=>(la=u.dynCall_viijj=N.ha)(e,r,t,n,o,i,s),ua=u.dynCall_viiijjjj=(e,r,t,n,o,i,s,l,c,f,d,g)=>(ua=u.dynCall_viiijjjj=N.ia)(e,r,t,n,o,i,s,l,c,f,d,g),ca=u.dynCall_iji=(e,r,t,n)=>(ca=u.dynCall_iji=N.ja)(e,r,t,n),fa=u.dynCall_jiji=(e,r,t,n,o)=>(fa=u.dynCall_jiji=N.ka)(e,r,t,n,o),da=u.dynCall_viijii=(e,r,t,n,o,i,s)=>(da=u.dynCall_viijii=N.la)(e,r,t,n,o,i,s),va=u.dynCall_iiiiij=(e,r,t,n,o,i,s)=>(va=u.dynCall_iiiiij=N.ma)(e,r,t,n,o,i,s),pa=u.dynCall_iiiiijj=(e,r,t,n,o,i,s,l,c)=>(pa=u.dynCall_iiiiijj=N.na)(e,r,t,n,o,i,s,l,c),ha=u.dynCall_iiiiiijj=(e,r,t,n,o,i,s,l,c,f)=>(ha=u.dynCall_iiiiiijj=N.oa)(e,r,t,n,o,i,s,l,c,f);u.addRunDependency=Ve,u.removeRunDependency=Se,u.FS_createPreloadedFile=Jr,u.FS_unlink=ra,u.FS_createPath=ea,u.FS_createDevice=na,u.FS_createDataFile=Zr,u.FS_createLazyFile=ta;var or;Fe=function e(){or||kt(),or||(Fe=e)};function kt(){if(fe>0||(Ot(),fe>0))return;function e(){var r;or||(or=!0,u.calledRun=!0,!lr&&(Wt(),W(u),(r=u.onRuntimeInitialized)==null||r.call(u),jt()))}u.setStatus?(u.setStatus("Running..."),setTimeout(function(){setTimeout(function(){u.setStatus("")},1),e()},1)):e()}if(u.preInit)for(typeof u.preInit=="function"&&(u.preInit=[u.preInit]);u.preInit.length>0;)u.preInit.pop()();return kt(),w=X,w}})();typeof Dt=="object"&&typeof Sr=="object"?Sr.exports=Fr:typeof define=="function"&&define.amd&&define([],()=>Fr);Fr.getUrl=function(T){return"https://st.mycdn.me/static/audio-processing/0-0-8/"+T}});var Fa={};ka(Fa,{EffectVmojiLmarksAi:()=>Ae,EffectVmojiLmarksVolume:()=>be,EffectVoiceChange:()=>Pe,EffectVoiceChangeMode:()=>Or,PerformanceMonitorMode:()=>$r,VoiceChangeEffectType:()=>Wr});module.exports=ba(Fa);var Le=class{constructor(p,v="AudioEffects"){this.loggerFunction=p,this.loggerName=v}debug(...p){this.loggerFunction("DEBUG",`[${this.loggerName}]`,...p)}log(...p){this.loggerFunction("LOG",`[${this.loggerName}]`,...p)}warn(...p){this.loggerFunction("WARN",`[${this.loggerName}]`,...p)}error(...p){this.loggerFunction("ERROR",`[${this.loggerName}]`,...p)}};function ir(T,p=[]){let v=p.join(","),w=typeof T=="string"?[T,`exports.default(${v});`]:[`(${T})(${v});`],u=new Blob(w,{type:"application/javascript; charset=utf-8"});return window.URL.createObjectURL(u)}var ke=class{constructor(){this.outputStream=null;this.isInitialized=!1;this.audioContext=null;this.workletNode=null;this.sourceNode=null;this.logger=new Le(()=>{})}init(L){return Z(this,arguments,function*({sampleRate:p,isOutputAudio:v=!1,isOutputStream:w=!1,workletFunction:u,workletName:W}){if(this.logger.debug("init"),this.createAudioContext(p),yield this.createWorklet(u,W),this.workletNode&&this.audioContext&&(v&&(this.workletNode.connect(this.audioContext.destination),this.logger.debug("connected to standart audio output")),w)){let X=this.audioContext.createMediaStreamDestination();this.workletNode.connect(X),this.outputStream=X.stream,this.logger.debug("connected to output MediaStream")}this.isInitialized=!0})}setSource(p){var v;if(this.audioContext&&this.workletNode){let w=null;if(p){let u=new MediaStream(p instanceof MediaStreamTrack?[p]:p.getAudioTracks().filter(W=>W.contentHint!=="music"));w=this.audioContext.createMediaStreamSource(u)}(v=this.sourceNode)==null||v.disconnect(this.workletNode),w==null||w.connect(this.workletNode),this.sourceNode=w,this.logger.debug("source "+(p?"set":"set to null"))}}destroy(){var p;this.logger.debug("destroy"),(p=this.audioContext)==null||p.close(),this.workletNode=null,this.sourceNode=null,this.audioContext=null,this.outputStream=null,this.isInitialized=!1}resume(){var p;this.logger.debug("resume"),(p=this.audioContext)==null||p.resume()}pause(){var p;this.logger.debug("pause"),(p=this.audioContext)==null||p.suspend()}setLogger(p=()=>{},v){this.logger=new Le(p,v)}static isSupported(){try{let p=window;return!!(p.WebAssembly&&p.Worker&&(p.AudioContext||p.webkitAudioContext)&&p.AudioWorkletNode)}catch(p){return!1}}createAudioContext(p){let v=window.AudioContext||window.webkitAudioContext,w=new v(p?{sampleRate:p}:{});this.audioContext=w,this.logger.debug("created AudioContext")}createWorklet(p,v){return Z(this,null,function*(){if(this.logger.debug(`${v} init started`),!this.audioContext)return;yield this.audioContext.audioWorklet.addModule(ir(p));let w=new AudioWorkletNode(this.audioContext,v);return this.workletNode=w,new Promise(u=>{w.port.onmessage=({data:W})=>{switch(W.type){case"init":{this.logger.debug(`${v} init success`),u();break}case"data":{this.onWorkletData(W.data);break}}}})})}sendDataToWorklet(p,v=[]){var w;(w=this.workletNode)==null||w.port.postMessage(p,v)}};function St(){let G=[.26691192,.5013858,.3037737,.58564115,.35116732,.67516255,.41435885,.7225562,.4775504,.7752158,.5881356,.79627967,.68818885,.7594179,.75138044,.7120243,.8040401,.65936464,.85143363,.57510924,.8777635,.4855879,.4512206,.58564115,.5038802,.56457734,.5512739,.5540454,.5776037,.56457734,.60393345,.5540454,.66712505,.56457734,.70398676,.57510924,.65132713,.606705,.6144654,.6172369,.5776037,.6172369,.5407419,.6172369,.5038802,.606705,.46701849,.58564115,.5407419,.58564115,.5776037,.58564115,.6144654,.58564115,.68818885,.57510924,.6144654,.58564115,.5776037,.58564115,.5407419,.58564115],J=G[59],jr=1-G[59];class He extends AudioWorkletProcessor{constructor(){super();this.lastTime=0;this.frameSampleCount=0;this.frameSampleAverage=0;this.maxInputVolume=.3;this.sequence=0;this.port.postMessage({type:"init"})}process(me){var ge;let Ce=currentTime,K=0,ce=(ge=me==null?void 0:me[0])==null?void 0:ge[0];if(ce!=null&&ce.length&&(K=ce.reduce((ae,z)=>ae+Math.abs(z),0)/ce.length),this.frameSampleAverage=(this.frameSampleAverage*this.frameSampleCount+K)/(this.frameSampleCount+1),this.frameSampleCount+=1,Ce-this.lastTime>1/25){let Y=[];for(let z=0;z<31*2;z+=1)Y.push(G[z]);this.frameSampleAverage>.015&&(Y[59]=this.frameSampleAverage/this.maxInputVolume>.5?this.sequence%2===0?this.frameSampleAverage/2:this.frameSampleAverage:this.frameSampleAverage,Y[59]=J+jr*Y[59]/.5),this.sequence+=1,this.frameSampleCount=1,this.maxInputVolume=Math.max(this.maxInputVolume,this.frameSampleAverage),this.lastTime=Ce;let ae=new Float32Array(Y).buffer;this.port.postMessage({type:"data",data:ae},[ae])}return!0}}registerProcessor("vmojiLmarksVolumeWorklet",He)}var be=class extends ke{constructor(){super(...arguments);this.onData=()=>{}}init(){return Z(this,null,function*(){yield le(be.prototype,this,"init").call(this,{workletFunction:St,workletName:"vmojiLmarksVolumeWorklet"})})}onWorkletData(v){this.onData(v)}};var Rr=Tt(Dr());var ue=class extends ke{constructor(){super(...arguments);this.worker=null;this.performanceMonitor=null}init(v){return Z(this,null,function*(){yield le(ue.prototype,this,"init").call(this,v),this.isInitialized=!1,yield this.createWorker(v.workerFunctionString,v.workerArgs),this.isInitialized=!0})}resume(){var v;super.resume(),(v=this.performanceMonitor)==null||v.start()}pause(){var v;super.pause(),(v=this.performanceMonitor)==null||v.stop()}setLogger(v,w){var u;super.setLogger(v,w),(u=this.performanceMonitor)==null||u.setLogger(this.logger)}destroy(){var v,w;super.destroy(),(v=this.performanceMonitor)==null||v.stop(),(w=this.worker)==null||w.terminate(),this.worker=null}sendDataToWorker(v,w=[]){var u;(u=this.worker)==null||u.postMessage(v,w)}static isSupported(){try{let v=window;return!!(super.isSupported()&&v.Worker)}catch(v){return!1}}createWorker(v,w=[]){return new Promise((u,W)=>{this.logger.debug("worker init started"),this.worker=new Worker(ir(v,w)),this.worker.onmessage=({data:L})=>{switch(L.type){case"init":{this.logger.debug("worker init success"),u();break}case"error":{this.logger.error(L.error),W(L.error);break}case"data":{this.onWorkerData(L.data);break}case"debug":{this.logger.debug(L.message);break}}}})}};function Rt(){class T extends AudioWorkletProcessor{constructor(){super(),this.port.postMessage({type:"init"})}process(v){var w;return(w=v==null?void 0:v[0])!=null&&w[0]&&this.port.postMessage({type:"data",data:v[0][0].buffer},[v[0][0].buffer]),!0}}registerProcessor("pureWorklet",T)}var Aa=16e3,Ae=class extends ue{constructor(){super(...arguments);this.onData=()=>{}}init(){return Z(this,null,function*(){yield le(Ae.prototype,this,"init").call(this,{sampleRate:Aa,workletFunction:Rt,workletName:"pureWorklet",workerFunctionString:`"use strict";var exports=(()=>{var p=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var b=(o,t)=>{for(var e in t)p(o,e,{get:t[e],enumerable:!0})},y=(o,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of f(t))!w.call(o,i)&&i!==e&&p(o,i,{get:()=>t[i],enumerable:!(n=m(t,i))||n.enumerable});return o};var A=o=>y(p({},"__esModule",{value:!0}),o);var x={};b(x,{default:()=>v});var v=(o,t)=>{let e=null,n=null;function i(){return o({locateFile:t}).then(r=>{e=r;let l=new e.ConfigInput("animoji_v4.cfg",!0,"/"),s=new e.Config(l);n=e.AnimojiFactory.createAlgorithm(s)})}function g(r){self.postMessage({type:"error",error:typeof r=="number"&&e?e.getExMessage(r):r})}function k(r){var l;if(!(!e||!n))try{let s=new e.vector$float$,h=new Float32Array(r);for(let u of h)s.push_back(u);let a=e.animate(n,s),d=(l=a==null?void 0:a.size)==null?void 0:l.call(a);if(!d)return;let c=new Float32Array(d);for(let u=0;u<d;u++)c[u]=a.get(u);self.postMessage({type:"data",data:c.buffer},[c.buffer])}catch(s){g(s)}}i().then(()=>{self.onmessage=r=>{k(r.data.data)},self.postMessage({type:"init"})}).catch(g)};return A(x);})();
|
|
9
|
-
`,workerArgs:[Rr.default,Rr.default.getUrl]})})}onWorkletData(v){this.sendDataToWorker({data:v},[v])}onWorkerData(v){this.onData(v)}static isSupported(){try{let v=super.isSupported(),w=/firefox/i.test(navigator.userAgent);return v&&!w}catch(v){return!1}}};var
|
|
6
|
+
"use strict";var ma=Object.create;var ar=Object.defineProperty;var ga=Object.getOwnPropertyDescriptor;var ya=Object.getOwnPropertyNames;var Pt=Object.getPrototypeOf,wa=Object.prototype.hasOwnProperty;var _a=Reflect.get;var Ea=(T,p)=>()=>(p||T((p={exports:{}}).exports,p),p.exports),ka=(T,p)=>{for(var v in p)ar(T,v,{get:p[v],enumerable:!0})},Ct=(T,p,v,w)=>{if(p&&typeof p=="object"||typeof p=="function")for(let u of ya(p))!wa.call(T,u)&&u!==v&&ar(T,u,{get:()=>p[u],enumerable:!(w=ga(p,u))||w.enumerable});return T};var Tt=(T,p,v)=>(v=T!=null?ma(Pt(T)):{},Ct(p||!T||!T.__esModule?ar(v,"default",{value:T,enumerable:!0}):v,T)),ba=T=>Ct(ar({},"__esModule",{value:!0}),T);var le=(T,p,v)=>_a(Pt(T),v,p);var J=(T,p,v)=>new Promise((w,u)=>{var M=K=>{try{G(v.next(K))}catch(Z){u(Z)}},L=K=>{try{G(v.throw(K))}catch(Z){u(Z)}},G=K=>K.done?w(K.value):Promise.resolve(K.value).then(M,L);G((v=v.apply(T,p)).next())});var Dr=Ea((Dt,Sr)=>{var Fr=(()=>{var p;var T=typeof document!="undefined"?(p=document.currentScript)==null?void 0:p.src:void 0;return function(v={}){var w,u=v,M,L,G=new Promise((e,r)=>{M=e,L=r}),K=typeof window=="object",Z=typeof importScripts=="function",jr=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";u.expectedDataFileDownloads||(u.expectedDataFileDownloads=0),u.expectedDataFileDownloads++,(()=>{var e=typeof ENVIRONMENT_IS_PTHREAD!="undefined"&&ENVIRONMENT_IS_PTHREAD,r=typeof ENVIRONMENT_IS_WASM_WORKER!="undefined"&&ENVIRONMENT_IS_WASM_WORKER;if(e||r)return;function t(n){var o="";typeof window=="object"?o=window.encodeURIComponent(window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/"):typeof process=="undefined"&&typeof location!="undefined"&&(o=encodeURIComponent(location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"));var i="wasm_bindings.data",s="wasm_bindings.data";typeof u.locateFilePackage=="function"&&!u.locateFile&&(u.locateFile=u.locateFilePackage,z("warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)"));var l=u.locateFile?u.locateFile(s,""):s,c=n.remote_package_size;function f(y,P,R,S){var b=new XMLHttpRequest;b.open("GET",y,!0),b.responseType="arraybuffer",b.onprogress=function(A){var bt,At;var O=y,D=P;if(A.total&&(D=A.total),A.loaded){b.addedTotal?u.dataFileDownloads[O].loaded=A.loaded:(b.addedTotal=!0,u.dataFileDownloads||(u.dataFileDownloads={}),u.dataFileDownloads[O]={loaded:A.loaded,total:D});var x=0,W=0,Ne=0;for(var xe in u.dataFileDownloads){var Ue=u.dataFileDownloads[xe];x+=Ue.total,W+=Ue.loaded,Ne++}x=Math.ceil(x*u.expectedDataFileDownloads/Ne),(bt=u.setStatus)==null||bt.call(u,`Downloading data... (${W}/${x})`)}else u.dataFileDownloads||(At=u.setStatus)==null||At.call(u,"Downloading data...")},b.onerror=function(A){throw new Error("NetworkError for: "+y)},b.onload=function(A){if(b.status==200||b.status==304||b.status==206||b.status==0&&b.response){var O=b.response;R(O)}else throw new Error(b.statusText+" : "+b.responseURL)},b.send(null)}function d(y){console.error("package error:",y)}var g=null,h=u.getPreloadedPackage?u.getPreloadedPackage(l,c):null;h||f(l,c,function(y){g?(g(y),g=null):h=y},d);function m(y){function P(O,D){if(!O)throw D+new Error().stack}function R(O,D,x){this.start=O,this.end=D,this.audio=x}R.prototype={requests:{},open:function(O,D){this.name=D,this.requests[D]=this,y.addRunDependency(`fp ${this.name}`)},send:function(){},onload:function(){var O=this.byteArray.subarray(this.start,this.end);this.finish(O)},finish:function(O){var D=this;y.FS_createDataFile(this.name,null,O,!0,!0,!0),y.removeRunDependency(`fp ${D.name}`),this.requests[this.name]=null}};for(var S=n.files,b=0;b<S.length;++b)new R(S[b].start,S[b].end,S[b].audio||0).open("GET",S[b].filename);function A(O){P(O,"Loading data file failed."),P(O.constructor.name===ArrayBuffer.name,"bad input to processPackageData");var D=new Uint8Array(O);R.prototype.byteArray=D;for(var x=n.files,W=0;W<x.length;++W)R.prototype.requests[x[W].filename].onload();y.removeRunDependency("datafile_wasm_bindings.data")}y.addRunDependency("datafile_wasm_bindings.data"),y.preloadResults||(y.preloadResults={}),y.preloadResults[i]={fromCache:!1},h?(A(h),h=null):g=A}u.calledRun?m(u):(u.preRun||(u.preRun=[]),u.preRun.push(m))}t({files:[{filename:"/animoji_v4.cfg",start:0,end:333},{filename:"/balloon.cfg",start:333,end:409},{filename:"/cathedral.cfg",start:409,end:586},{filename:"/chorus.cfg",start:586,end:865},{filename:"/denoise.cfg",start:865,end:3258},{filename:"/df2_lstm_full_silent.tflite",start:3258,end:3169978},{filename:"/distortion.cfg",start:3169978,end:3170120},{filename:"/echo.cfg",start:3170120,end:3170257},{filename:"/evil.cfg",start:3170257,end:3170398},{filename:"/giant.cfg",start:3170398,end:3170474},{filename:"/hall.cfg",start:3170474,end:3170647},{filename:"/phaser.cfg",start:3170647,end:3170747},{filename:"/robot.cfg",start:3170747,end:3170887},{filename:"/squirell.cfg",start:3170887,end:3170963},{filename:"/wav2lip_lite_rec-v4-v2.tflite",start:3170963,end:7456043}],remote_package_size:7456043})})();var He=null,H=Object.assign({},u),Ir=[],me="./this.program",Ce=(e,r)=>{throw r},X="";function ce(e){return u.locateFile?u.locateFile(e,X):X+e}var ge,Y;(K||Z)&&(Z?X=self.location.href:typeof document!="undefined"&&document.currentScript&&(X=document.currentScript.src),He&&(X=He),X.startsWith("blob:")?X="":X=X.substr(0,X.replace(/[?#].*/,"").lastIndexOf("/")+1),Z&&(Y=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),ge=e=>fetch(e,{credentials:"same-origin"}).then(r=>r.ok?r.arrayBuffer():Promise.reject(new Error(r.status+" : "+r.url))));var ae=u.print||console.log.bind(console),z=u.printErr||console.error.bind(console);Object.assign(u,H),H=null,u.arguments&&(Ir=u.arguments),u.thisProgram&&(me=u.thisProgram),u.quit&&(Ce=u.quit);var Te;u.wasmBinary&&(Te=u.wasmBinary);var Be,lr=!1,ur,U,B,ee,ze,_,F,Nr,xr;function Ur(){var e=Be.buffer;u.HEAP8=U=new Int8Array(e),u.HEAP16=ee=new Int16Array(e),u.HEAPU8=B=new Uint8Array(e),u.HEAPU16=ze=new Uint16Array(e),u.HEAP32=_=new Int32Array(e),u.HEAPU32=F=new Uint32Array(e),u.HEAPF32=Nr=new Float32Array(e),u.HEAPF64=xr=new Float64Array(e)}var Lr=[],Hr=[],Br=[],$t=!1;function Ot(){if(u.preRun)for(typeof u.preRun=="function"&&(u.preRun=[u.preRun]);u.preRun.length;)It(u.preRun.shift());dr(Lr)}function Wt(){$t=!0,!u.noFSInit&&!a.init.initialized&&a.init(),a.ignorePermissions=!1,ie.init(),dr(Hr)}function jt(){if(u.postRun)for(typeof u.postRun=="function"&&(u.postRun=[u.postRun]);u.postRun.length;)xt(u.postRun.shift());dr(Br)}function It(e){Lr.unshift(e)}function Nt(e){Hr.unshift(e)}function xt(e){Br.unshift(e)}var fe=0,cr=null,Fe=null;function Sa(e){return e}function Ve(e){var r;fe++,(r=u.monitorRunDependencies)==null||r.call(u,fe)}function Se(e){var t;if(fe--,(t=u.monitorRunDependencies)==null||t.call(u,fe),fe==0&&(cr!==null&&(clearInterval(cr),cr=null),Fe)){var r=Fe;Fe=null,r()}}function fr(e){var t;(t=u.onAbort)==null||t.call(u,e),e="Aborted("+e+")",z(e),lr=!0,ur=1,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw L(r),r}var Ut="data:application/octet-stream;base64,",zr=e=>e.startsWith(Ut);function Lt(){var e="wasm_bindings.wasm";return zr(e)?e:ce(e)}var qe;function Vr(e){if(e==qe&&Te)return new Uint8Array(Te);if(Y)return Y(e);throw"both async and sync fetching of the wasm failed"}function Ht(e){return Te?Promise.resolve().then(()=>Vr(e)):ge(e).then(r=>new Uint8Array(r),()=>Vr(e))}function qr(e,r,t){return Ht(e).then(n=>WebAssembly.instantiate(n,r)).then(t,n=>{z(`failed to asynchronously prepare wasm: ${n}`),fr(n)})}function Bt(e,r,t,n){return!e&&typeof WebAssembly.instantiateStreaming=="function"&&!zr(r)&&typeof fetch=="function"?fetch(r,{credentials:"same-origin"}).then(o=>{var i=WebAssembly.instantiateStreaming(o,t);return i.then(n,function(s){return z(`wasm streaming compile failed: ${s}`),z("falling back to ArrayBuffer instantiation"),qr(r,t,n)})}):qr(r,t,n)}function zt(){return{a:oa}}function Vt(){var e=zt();function r(n,o){return N=n.exports,Be=N.Z,Ur(),ut=N.aa,Nt(N._),Se("wasm-instantiate"),N}Ve("wasm-instantiate");function t(n){r(n.instance)}if(u.instantiateWasm)try{return u.instantiateWasm(e,r)}catch(n){z(`Module.instantiateWasm callback failed with error: ${n}`),L(n)}return qe||(qe=Lt()),Bt(Te,qe,e,t).catch(L),{}}var E,j;function qt(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var dr=e=>{for(;e.length>0;)e.shift()(u)},Gt=u.noExitRuntime||!0;class Kt{constructor(r){this.excPtr=r,this.ptr=r-24}set_type(r){F[this.ptr+4>>2]=r}get_type(){return F[this.ptr+4>>2]}set_destructor(r){F[this.ptr+8>>2]=r}get_destructor(){return F[this.ptr+8>>2]}set_caught(r){r=r?1:0,U[this.ptr+12]=r}get_caught(){return U[this.ptr+12]!=0}set_rethrown(r){r=r?1:0,U[this.ptr+13]=r}get_rethrown(){return U[this.ptr+13]!=0}init(r,t){this.set_adjusted_ptr(0),this.set_type(r),this.set_destructor(t)}set_adjusted_ptr(r){F[this.ptr+16>>2]=r}get_adjusted_ptr(){return F[this.ptr+16>>2]}get_exception_ptr(){var r=Et(this.get_type());if(r)return F[this.excPtr>>2];var t=this.get_adjusted_ptr();return t!==0?t:this.excPtr}}var Gr=0,Xt=0,Yt=(e,r,t)=>{var n=new Kt(e);throw n.init(r,t),Gr=e,Xt++,Gr};function Ge(){var e=_[+I.varargs>>2];return I.varargs+=4,e}var ye=Ge,$={isAbs:e=>e.charAt(0)==="/",splitPath:e=>{var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return r.exec(e).slice(1)},normalizeArray:(e,r)=>{for(var t=0,n=e.length-1;n>=0;n--){var o=e[n];o==="."?e.splice(n,1):o===".."?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:e=>{var r=$.isAbs(e),t=e.substr(-1)==="/";return e=$.normalizeArray(e.split("/").filter(n=>!!n),!r).join("/"),!e&&!r&&(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:e=>{var r=$.splitPath(e),t=r[0],n=r[1];return!t&&!n?".":(n&&(n=n.substr(0,n.length-1)),t+n)},basename:e=>{if(e==="/")return"/";e=$.normalize(e),e=e.replace(/\/$/,"");var r=e.lastIndexOf("/");return r===-1?e:e.substr(r+1)},join:(...e)=>$.normalize(e.join("/")),join2:(e,r)=>$.normalize(e+"/"+r)},Qt=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return e=>crypto.getRandomValues(e);fr("initRandomDevice")},Kr=e=>(Kr=Qt())(e),re={resolve:(...e)=>{for(var r="",t=!1,n=e.length-1;n>=-1&&!t;n--){var o=n>=0?e[n]:a.cwd();if(typeof o!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!o)return"";r=o+"/"+r,t=$.isAbs(o)}return r=$.normalizeArray(r.split("/").filter(i=>!!i),!t).join("/"),(t?"/":"")+r||"."},relative:(e,r)=>{e=re.resolve(e).substr(1),r=re.resolve(r).substr(1);function t(f){for(var d=0;d<f.length&&f[d]==="";d++);for(var g=f.length-1;g>=0&&f[g]==="";g--);return d>g?[]:f.slice(d,g-d+1)}for(var n=t(e.split("/")),o=t(r.split("/")),i=Math.min(n.length,o.length),s=i,l=0;l<i;l++)if(n[l]!==o[l]){s=l;break}for(var c=[],l=s;l<n.length;l++)c.push("..");return c=c.concat(o.slice(s)),c.join("/")}},Xr=typeof TextDecoder!="undefined"?new TextDecoder:void 0,we=(e,r,t)=>{for(var n=r+t,o=r;e[o]&&!(o>=n);)++o;if(o-r>16&&e.buffer&&Xr)return Xr.decode(e.subarray(r,o));for(var i="";r<o;){var s=e[r++];if(!(s&128)){i+=String.fromCharCode(s);continue}var l=e[r++]&63;if((s&224)==192){i+=String.fromCharCode((s&31)<<6|l);continue}var c=e[r++]&63;if((s&240)==224?s=(s&15)<<12|l<<6|c:s=(s&7)<<18|l<<12|c<<6|e[r++]&63,s<65536)i+=String.fromCharCode(s);else{var f=s-65536;i+=String.fromCharCode(55296|f>>10,56320|f&1023)}}return i},vr=[],De=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n<=127?r++:n<=2047?r+=2:n>=55296&&n<=57343?(r+=4,++t):r+=3}return r},pr=(e,r,t,n)=>{if(!(n>0))return 0;for(var o=t,i=t+n-1,s=0;s<e.length;++s){var l=e.charCodeAt(s);if(l>=55296&&l<=57343){var c=e.charCodeAt(++s);l=65536+((l&1023)<<10)|c&1023}if(l<=127){if(t>=i)break;r[t++]=l}else if(l<=2047){if(t+1>=i)break;r[t++]=192|l>>6,r[t++]=128|l&63}else if(l<=65535){if(t+2>=i)break;r[t++]=224|l>>12,r[t++]=128|l>>6&63,r[t++]=128|l&63}else{if(t+3>=i)break;r[t++]=240|l>>18,r[t++]=128|l>>12&63,r[t++]=128|l>>6&63,r[t++]=128|l&63}}return r[t]=0,t-o};function Yr(e,r,t){var n=t>0?t:De(e)+1,o=new Array(n),i=pr(e,o,0,o.length);return r&&(o.length=i),o}var Jt=()=>{if(!vr.length){var e=null;if(typeof window!="undefined"&&typeof window.prompt=="function"&&(e=window.prompt("Input: "),e!==null&&(e+=`
|
|
7
|
+
`)),!e)return null;vr=Yr(e,!0)}return vr.shift()},ie={ttys:[],init(){},shutdown(){},register(e,r){ie.ttys[e]={input:[],output:[],ops:r},a.registerDevice(e,ie.stream_ops)},stream_ops:{open(e){var r=ie.ttys[e.node.rdev];if(!r)throw new a.ErrnoError(43);e.tty=r,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,r,t,n,o){if(!e.tty||!e.tty.ops.get_char)throw new a.ErrnoError(60);for(var i=0,s=0;s<n;s++){var l;try{l=e.tty.ops.get_char(e.tty)}catch(c){throw new a.ErrnoError(29)}if(l===void 0&&i===0)throw new a.ErrnoError(6);if(l==null)break;i++,r[t+s]=l}return i&&(e.node.timestamp=Date.now()),i},write(e,r,t,n,o){if(!e.tty||!e.tty.ops.put_char)throw new a.ErrnoError(60);try{for(var i=0;i<n;i++)e.tty.ops.put_char(e.tty,r[t+i])}catch(s){throw new a.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),i}},default_tty_ops:{get_char(e){return Jt()},put_char(e,r){r===null||r===10?(ae(we(e.output,0)),e.output=[]):r!=0&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(ae(we(e.output,0)),e.output=[])},ioctl_tcgets(e){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ioctl_tcsets(e,r,t){return 0},ioctl_tiocgwinsz(e){return[24,80]}},default_tty1_ops:{put_char(e,r){r===null||r===10?(z(we(e.output,0)),e.output=[]):r!=0&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(z(we(e.output,0)),e.output=[])}}},Zt=(e,r)=>(B.fill(0,e,e+r),e),en=(e,r)=>Math.ceil(e/r)*r,Qr=e=>{e=en(e,65536);var r=_t(65536,e);return r?Zt(r,e):0},k={ops_table:null,mount(e){return k.createNode(null,"/",16895,0)},createNode(e,r,t,n){if(a.isBlkdev(t)||a.isFIFO(t))throw new a.ErrnoError(63);k.ops_table||(k.ops_table={dir:{node:{getattr:k.node_ops.getattr,setattr:k.node_ops.setattr,lookup:k.node_ops.lookup,mknod:k.node_ops.mknod,rename:k.node_ops.rename,unlink:k.node_ops.unlink,rmdir:k.node_ops.rmdir,readdir:k.node_ops.readdir,symlink:k.node_ops.symlink},stream:{llseek:k.stream_ops.llseek}},file:{node:{getattr:k.node_ops.getattr,setattr:k.node_ops.setattr},stream:{llseek:k.stream_ops.llseek,read:k.stream_ops.read,write:k.stream_ops.write,allocate:k.stream_ops.allocate,mmap:k.stream_ops.mmap,msync:k.stream_ops.msync}},link:{node:{getattr:k.node_ops.getattr,setattr:k.node_ops.setattr,readlink:k.node_ops.readlink},stream:{}},chrdev:{node:{getattr:k.node_ops.getattr,setattr:k.node_ops.setattr},stream:a.chrdev_stream_ops}});var o=a.createNode(e,r,t,n);return a.isDir(o.mode)?(o.node_ops=k.ops_table.dir.node,o.stream_ops=k.ops_table.dir.stream,o.contents={}):a.isFile(o.mode)?(o.node_ops=k.ops_table.file.node,o.stream_ops=k.ops_table.file.stream,o.usedBytes=0,o.contents=null):a.isLink(o.mode)?(o.node_ops=k.ops_table.link.node,o.stream_ops=k.ops_table.link.stream):a.isChrdev(o.mode)&&(o.node_ops=k.ops_table.chrdev.node,o.stream_ops=k.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[r]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage(e,r){var t=e.contents?e.contents.length:0;if(!(t>=r)){var n=1024*1024;r=Math.max(r,t*(t<n?2:1.125)>>>0),t!=0&&(r=Math.max(r,256));var o=e.contents;e.contents=new Uint8Array(r),e.usedBytes>0&&e.contents.set(o.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,r){if(e.usedBytes!=r)if(r==0)e.contents=null,e.usedBytes=0;else{var t=e.contents;e.contents=new Uint8Array(r),t&&e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r}},node_ops:{getattr(e){var r={};return r.dev=a.isChrdev(e.mode)?e.id:1,r.ino=e.id,r.mode=e.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=e.rdev,a.isDir(e.mode)?r.size=4096:a.isFile(e.mode)?r.size=e.usedBytes:a.isLink(e.mode)?r.size=e.link.length:r.size=0,r.atime=new Date(e.timestamp),r.mtime=new Date(e.timestamp),r.ctime=new Date(e.timestamp),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr(e,r){r.mode!==void 0&&(e.mode=r.mode),r.timestamp!==void 0&&(e.timestamp=r.timestamp),r.size!==void 0&&k.resizeFileStorage(e,r.size)},lookup(e,r){throw a.genericErrors[44]},mknod(e,r,t,n){return k.createNode(e,r,t,n)},rename(e,r,t){if(a.isDir(e.mode)){var n;try{n=a.lookupNode(r,t)}catch(i){}if(n)for(var o in n.contents)throw new a.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=t,r.contents[t]=e,r.timestamp=e.parent.timestamp},unlink(e,r){delete e.contents[r],e.timestamp=Date.now()},rmdir(e,r){var t=a.lookupNode(e,r);for(var n in t.contents)throw new a.ErrnoError(55);delete e.contents[r],e.timestamp=Date.now()},readdir(e){var r=[".",".."];for(var t of Object.keys(e.contents))r.push(t);return r},symlink(e,r,t){var n=k.createNode(e,r,41471,0);return n.link=t,n},readlink(e){if(!a.isLink(e.mode))throw new a.ErrnoError(28);return e.link}},stream_ops:{read(e,r,t,n,o){var i=e.node.contents;if(o>=e.node.usedBytes)return 0;var s=Math.min(e.node.usedBytes-o,n);if(s>8&&i.subarray)r.set(i.subarray(o,o+s),t);else for(var l=0;l<s;l++)r[t+l]=i[o+l];return s},write(e,r,t,n,o,i){if(r.buffer===U.buffer&&(i=!1),!n)return 0;var s=e.node;if(s.timestamp=Date.now(),r.subarray&&(!s.contents||s.contents.subarray)){if(i)return s.contents=r.subarray(t,t+n),s.usedBytes=n,n;if(s.usedBytes===0&&o===0)return s.contents=r.slice(t,t+n),s.usedBytes=n,n;if(o+n<=s.usedBytes)return s.contents.set(r.subarray(t,t+n),o),n}if(k.expandFileStorage(s,o+n),s.contents.subarray&&r.subarray)s.contents.set(r.subarray(t,t+n),o);else for(var l=0;l<n;l++)s.contents[o+l]=r[t+l];return s.usedBytes=Math.max(s.usedBytes,o+n),n},llseek(e,r,t){var n=r;if(t===1?n+=e.position:t===2&&a.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new a.ErrnoError(28);return n},allocate(e,r,t){k.expandFileStorage(e.node,r+t),e.node.usedBytes=Math.max(e.node.usedBytes,r+t)},mmap(e,r,t,n,o){if(!a.isFile(e.node.mode))throw new a.ErrnoError(43);var i,s,l=e.node.contents;if(!(o&2)&&l.buffer===U.buffer)s=!1,i=l.byteOffset;else{if((t>0||t+r<l.length)&&(l.subarray?l=l.subarray(t,t+r):l=Array.prototype.slice.call(l,t,t+r)),s=!0,i=Qr(r),!i)throw new a.ErrnoError(48);U.set(l,i)}return{ptr:i,allocated:s}},msync(e,r,t,n,o){return k.stream_ops.write(e,r,0,n,t,!1),0}}},rn=(e,r,t,n)=>{var o=n?"":`al ${e}`;ge(e).then(i=>{r(new Uint8Array(i)),o&&Se(o)},i=>{if(t)t();else throw`Loading data file "${e}" failed.`}),o&&Ve(o)},Jr=(e,r,t,n,o,i)=>{a.createDataFile(e,r,t,n,o,i)},tn=u.preloadPlugins||[],nn=(e,r,t,n)=>{typeof Browser!="undefined"&&Browser.init();var o=!1;return tn.forEach(i=>{o||i.canHandle(r)&&(i.handle(e,r,t,n),o=!0)}),o},Zr=(e,r,t,n,o,i,s,l,c,f)=>{var d=r?re.resolve($.join2(e,r)):e,g=`cp ${d}`;function h(m){function y(P){f==null||f(),l||Jr(e,r,P,n,o,c),i==null||i(),Se(g)}nn(m,d,y,()=>{s==null||s(),Se(g)})||y(m)}Ve(g),typeof t=="string"?rn(t,h,s):h(t)},on=e=>{var r={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},t=r[e];if(typeof t=="undefined")throw new Error(`Unknown file open mode: ${e}`);return t},hr=(e,r)=>{var t=0;return e&&(t|=365),r&&(t|=146),t},a={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:class{constructor(e){this.name="ErrnoError",this.errno=e}},genericErrors:{},filesystems:null,syncFSRequests:0,FSStream:class{constructor(){this.shared={}}get object(){return this.node}set object(e){this.node=e}get isRead(){return(this.flags&2097155)!==1}get isWrite(){return(this.flags&2097155)!==0}get isAppend(){return this.flags&1024}get flags(){return this.shared.flags}set flags(e){this.shared.flags=e}get position(){return this.shared.position}set position(e){this.shared.position=e}},FSNode:class{constructor(e,r,t,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=a.nextInode++,this.name=r,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n,this.readMode=365,this.writeMode=146}get read(){return(this.mode&this.readMode)===this.readMode}set read(e){e?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(e){e?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return a.isDir(this.mode)}get isDevice(){return a.isChrdev(this.mode)}},lookupPath(e,r={}){if(e=re.resolve(e),!e)return{path:"",node:null};var t={follow_mount:!0,recurse_count:0};if(r=Object.assign(t,r),r.recurse_count>8)throw new a.ErrnoError(32);for(var n=e.split("/").filter(g=>!!g),o=a.root,i="/",s=0;s<n.length;s++){var l=s===n.length-1;if(l&&r.parent)break;if(o=a.lookupNode(o,n[s]),i=$.join2(i,n[s]),a.isMountpoint(o)&&(!l||l&&r.follow_mount)&&(o=o.mounted.root),!l||r.follow)for(var c=0;a.isLink(o.mode);){var f=a.readlink(i);i=re.resolve($.dirname(i),f);var d=a.lookupPath(i,{recurse_count:r.recurse_count+1});if(o=d.node,c++>40)throw new a.ErrnoError(32)}}return{path:i,node:o}},getPath(e){for(var r;;){if(a.isRoot(e)){var t=e.mount.mountpoint;return r?t[t.length-1]!=="/"?`${t}/${r}`:t+r:t}r=r?`${e.name}/${r}`:e.name,e=e.parent}},hashName(e,r){for(var t=0,n=0;n<r.length;n++)t=(t<<5)-t+r.charCodeAt(n)|0;return(e+t>>>0)%a.nameTable.length},hashAddNode(e){var r=a.hashName(e.parent.id,e.name);e.name_next=a.nameTable[r],a.nameTable[r]=e},hashRemoveNode(e){var r=a.hashName(e.parent.id,e.name);if(a.nameTable[r]===e)a.nameTable[r]=e.name_next;else for(var t=a.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode(e,r){var t=a.mayLookup(e);if(t)throw new a.ErrnoError(t);for(var n=a.hashName(e.id,r),o=a.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===r)return o}return a.lookup(e,r)},createNode(e,r,t,n){var o=new a.FSNode(e,r,t,n);return a.hashAddNode(o),o},destroyNode(e){a.hashRemoveNode(e)},isRoot(e){return e===e.parent},isMountpoint(e){return!!e.mounted},isFile(e){return(e&61440)===32768},isDir(e){return(e&61440)===16384},isLink(e){return(e&61440)===40960},isChrdev(e){return(e&61440)===8192},isBlkdev(e){return(e&61440)===24576},isFIFO(e){return(e&61440)===4096},isSocket(e){return(e&49152)===49152},flagsToPermissionString(e){var r=["r","w","rw"][e&3];return e&512&&(r+="w"),r},nodePermissions(e,r){return a.ignorePermissions?0:r.includes("r")&&!(e.mode&292)||r.includes("w")&&!(e.mode&146)||r.includes("x")&&!(e.mode&73)?2:0},mayLookup(e){if(!a.isDir(e.mode))return 54;var r=a.nodePermissions(e,"x");return r||(e.node_ops.lookup?0:2)},mayCreate(e,r){try{var t=a.lookupNode(e,r);return 20}catch(n){}return a.nodePermissions(e,"wx")},mayDelete(e,r,t){var n;try{n=a.lookupNode(e,r)}catch(i){return i.errno}var o=a.nodePermissions(e,"wx");if(o)return o;if(t){if(!a.isDir(n.mode))return 54;if(a.isRoot(n)||a.getPath(n)===a.cwd())return 10}else if(a.isDir(n.mode))return 31;return 0},mayOpen(e,r){return e?a.isLink(e.mode)?32:a.isDir(e.mode)&&(a.flagsToPermissionString(r)!=="r"||r&512)?31:a.nodePermissions(e,a.flagsToPermissionString(r)):44},MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=a.MAX_OPEN_FDS;e++)if(!a.streams[e])return e;throw new a.ErrnoError(33)},getStreamChecked(e){var r=a.getStream(e);if(!r)throw new a.ErrnoError(8);return r},getStream:e=>a.streams[e],createStream(e,r=-1){return e=Object.assign(new a.FSStream,e),r==-1&&(r=a.nextfd()),e.fd=r,a.streams[r]=e,e},closeStream(e){a.streams[e]=null},dupStream(e,r=-1){var n,o;var t=a.createStream(e,r);return(o=(n=t.stream_ops)==null?void 0:n.dup)==null||o.call(n,t),t},chrdev_stream_ops:{open(e){var t,n;var r=a.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,(n=(t=e.stream_ops).open)==null||n.call(t,e)},llseek(){throw new a.ErrnoError(70)}},major:e=>e>>8,minor:e=>e&255,makedev:(e,r)=>e<<8|r,registerDevice(e,r){a.devices[e]={stream_ops:r}},getDevice:e=>a.devices[e],getMounts(e){for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push(...n.mounts)}return r},syncfs(e,r){typeof e=="function"&&(r=e,e=!1),a.syncFSRequests++,a.syncFSRequests>1&&z(`warning: ${a.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=a.getMounts(a.root.mount),n=0;function o(s){return a.syncFSRequests--,r(s)}function i(s){if(s)return i.errored?void 0:(i.errored=!0,o(s));++n>=t.length&&o(null)}t.forEach(s=>{if(!s.type.syncfs)return i(null);s.type.syncfs(s,e,i)})},mount(e,r,t){var n=t==="/",o=!t,i;if(n&&a.root)throw new a.ErrnoError(10);if(!n&&!o){var s=a.lookupPath(t,{follow_mount:!1});if(t=s.path,i=s.node,a.isMountpoint(i))throw new a.ErrnoError(10);if(!a.isDir(i.mode))throw new a.ErrnoError(54)}var l={type:e,opts:r,mountpoint:t,mounts:[]},c=e.mount(l);return c.mount=l,l.root=c,n?a.root=c:i&&(i.mounted=l,i.mount&&i.mount.mounts.push(l)),c},unmount(e){var r=a.lookupPath(e,{follow_mount:!1});if(!a.isMountpoint(r.node))throw new a.ErrnoError(28);var t=r.node,n=t.mounted,o=a.getMounts(n);Object.keys(a.nameTable).forEach(s=>{for(var l=a.nameTable[s];l;){var c=l.name_next;o.includes(l.mount)&&a.destroyNode(l),l=c}}),t.mounted=null;var i=t.mount.mounts.indexOf(n);t.mount.mounts.splice(i,1)},lookup(e,r){return e.node_ops.lookup(e,r)},mknod(e,r,t){var n=a.lookupPath(e,{parent:!0}),o=n.node,i=$.basename(e);if(!i||i==="."||i==="..")throw new a.ErrnoError(28);var s=a.mayCreate(o,i);if(s)throw new a.ErrnoError(s);if(!o.node_ops.mknod)throw new a.ErrnoError(63);return o.node_ops.mknod(o,i,r,t)},create(e,r){return r=r!==void 0?r:438,r&=4095,r|=32768,a.mknod(e,r,0)},mkdir(e,r){return r=r!==void 0?r:511,r&=1023,r|=16384,a.mknod(e,r,0)},mkdirTree(e,r){for(var t=e.split("/"),n="",o=0;o<t.length;++o)if(t[o]){n+="/"+t[o];try{a.mkdir(n,r)}catch(i){if(i.errno!=20)throw i}}},mkdev(e,r,t){return typeof t=="undefined"&&(t=r,r=438),r|=8192,a.mknod(e,r,t)},symlink(e,r){if(!re.resolve(e))throw new a.ErrnoError(44);var t=a.lookupPath(r,{parent:!0}),n=t.node;if(!n)throw new a.ErrnoError(44);var o=$.basename(r),i=a.mayCreate(n,o);if(i)throw new a.ErrnoError(i);if(!n.node_ops.symlink)throw new a.ErrnoError(63);return n.node_ops.symlink(n,o,e)},rename(e,r){var t=$.dirname(e),n=$.dirname(r),o=$.basename(e),i=$.basename(r),s,l,c;if(s=a.lookupPath(e,{parent:!0}),l=s.node,s=a.lookupPath(r,{parent:!0}),c=s.node,!l||!c)throw new a.ErrnoError(44);if(l.mount!==c.mount)throw new a.ErrnoError(75);var f=a.lookupNode(l,o),d=re.relative(e,n);if(d.charAt(0)!==".")throw new a.ErrnoError(28);if(d=re.relative(r,t),d.charAt(0)!==".")throw new a.ErrnoError(55);var g;try{g=a.lookupNode(c,i)}catch(y){}if(f!==g){var h=a.isDir(f.mode),m=a.mayDelete(l,o,h);if(m)throw new a.ErrnoError(m);if(m=g?a.mayDelete(c,i,h):a.mayCreate(c,i),m)throw new a.ErrnoError(m);if(!l.node_ops.rename)throw new a.ErrnoError(63);if(a.isMountpoint(f)||g&&a.isMountpoint(g))throw new a.ErrnoError(10);if(c!==l&&(m=a.nodePermissions(l,"w"),m))throw new a.ErrnoError(m);a.hashRemoveNode(f);try{l.node_ops.rename(f,c,i),f.parent=c}catch(y){throw y}finally{a.hashAddNode(f)}}},rmdir(e){var r=a.lookupPath(e,{parent:!0}),t=r.node,n=$.basename(e),o=a.lookupNode(t,n),i=a.mayDelete(t,n,!0);if(i)throw new a.ErrnoError(i);if(!t.node_ops.rmdir)throw new a.ErrnoError(63);if(a.isMountpoint(o))throw new a.ErrnoError(10);t.node_ops.rmdir(t,n),a.destroyNode(o)},readdir(e){var r=a.lookupPath(e,{follow:!0}),t=r.node;if(!t.node_ops.readdir)throw new a.ErrnoError(54);return t.node_ops.readdir(t)},unlink(e){var r=a.lookupPath(e,{parent:!0}),t=r.node;if(!t)throw new a.ErrnoError(44);var n=$.basename(e),o=a.lookupNode(t,n),i=a.mayDelete(t,n,!1);if(i)throw new a.ErrnoError(i);if(!t.node_ops.unlink)throw new a.ErrnoError(63);if(a.isMountpoint(o))throw new a.ErrnoError(10);t.node_ops.unlink(t,n),a.destroyNode(o)},readlink(e){var r=a.lookupPath(e),t=r.node;if(!t)throw new a.ErrnoError(44);if(!t.node_ops.readlink)throw new a.ErrnoError(28);return re.resolve(a.getPath(t.parent),t.node_ops.readlink(t))},stat(e,r){var t=a.lookupPath(e,{follow:!r}),n=t.node;if(!n)throw new a.ErrnoError(44);if(!n.node_ops.getattr)throw new a.ErrnoError(63);return n.node_ops.getattr(n)},lstat(e){return a.stat(e,!0)},chmod(e,r,t){var n;if(typeof e=="string"){var o=a.lookupPath(e,{follow:!t});n=o.node}else n=e;if(!n.node_ops.setattr)throw new a.ErrnoError(63);n.node_ops.setattr(n,{mode:r&4095|n.mode&-4096,timestamp:Date.now()})},lchmod(e,r){a.chmod(e,r,!0)},fchmod(e,r){var t=a.getStreamChecked(e);a.chmod(t.node,r)},chown(e,r,t,n){var o;if(typeof e=="string"){var i=a.lookupPath(e,{follow:!n});o=i.node}else o=e;if(!o.node_ops.setattr)throw new a.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown(e,r,t){a.chown(e,r,t,!0)},fchown(e,r,t){var n=a.getStreamChecked(e);a.chown(n.node,r,t)},truncate(e,r){if(r<0)throw new a.ErrnoError(28);var t;if(typeof e=="string"){var n=a.lookupPath(e,{follow:!0});t=n.node}else t=e;if(!t.node_ops.setattr)throw new a.ErrnoError(63);if(a.isDir(t.mode))throw new a.ErrnoError(31);if(!a.isFile(t.mode))throw new a.ErrnoError(28);var o=a.nodePermissions(t,"w");if(o)throw new a.ErrnoError(o);t.node_ops.setattr(t,{size:r,timestamp:Date.now()})},ftruncate(e,r){var t=a.getStreamChecked(e);if(!(t.flags&2097155))throw new a.ErrnoError(28);a.truncate(t.node,r)},utime(e,r,t){var n=a.lookupPath(e,{follow:!0}),o=n.node;o.node_ops.setattr(o,{timestamp:Math.max(r,t)})},open(e,r,t){if(e==="")throw new a.ErrnoError(44);r=typeof r=="string"?on(r):r,r&64?(t=typeof t=="undefined"?438:t,t=t&4095|32768):t=0;var n;if(typeof e=="object")n=e;else{e=$.normalize(e);try{var o=a.lookupPath(e,{follow:!(r&131072)});n=o.node}catch(c){}}var i=!1;if(r&64)if(n){if(r&128)throw new a.ErrnoError(20)}else n=a.mknod(e,t,0),i=!0;if(!n)throw new a.ErrnoError(44);if(a.isChrdev(n.mode)&&(r&=-513),r&65536&&!a.isDir(n.mode))throw new a.ErrnoError(54);if(!i){var s=a.mayOpen(n,r);if(s)throw new a.ErrnoError(s)}r&512&&!i&&a.truncate(n,0),r&=-131713;var l=a.createStream({node:n,path:a.getPath(n),flags:r,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return l.stream_ops.open&&l.stream_ops.open(l),u.logReadFiles&&!(r&1)&&(a.readFiles||(a.readFiles={}),e in a.readFiles||(a.readFiles[e]=1)),l},close(e){if(a.isClosed(e))throw new a.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(r){throw r}finally{a.closeStream(e.fd)}e.fd=null},isClosed(e){return e.fd===null},llseek(e,r,t){if(a.isClosed(e))throw new a.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new a.ErrnoError(70);if(t!=0&&t!=1&&t!=2)throw new a.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read(e,r,t,n,o){if(n<0||o<0)throw new a.ErrnoError(28);if(a.isClosed(e))throw new a.ErrnoError(8);if((e.flags&2097155)===1)throw new a.ErrnoError(8);if(a.isDir(e.node.mode))throw new a.ErrnoError(31);if(!e.stream_ops.read)throw new a.ErrnoError(28);var i=typeof o!="undefined";if(!i)o=e.position;else if(!e.seekable)throw new a.ErrnoError(70);var s=e.stream_ops.read(e,r,t,n,o);return i||(e.position+=s),s},write(e,r,t,n,o,i){if(n<0||o<0)throw new a.ErrnoError(28);if(a.isClosed(e))throw new a.ErrnoError(8);if(!(e.flags&2097155))throw new a.ErrnoError(8);if(a.isDir(e.node.mode))throw new a.ErrnoError(31);if(!e.stream_ops.write)throw new a.ErrnoError(28);e.seekable&&e.flags&1024&&a.llseek(e,0,2);var s=typeof o!="undefined";if(!s)o=e.position;else if(!e.seekable)throw new a.ErrnoError(70);var l=e.stream_ops.write(e,r,t,n,o,i);return s||(e.position+=l),l},allocate(e,r,t){if(a.isClosed(e))throw new a.ErrnoError(8);if(r<0||t<=0)throw new a.ErrnoError(28);if(!(e.flags&2097155))throw new a.ErrnoError(8);if(!a.isFile(e.node.mode)&&!a.isDir(e.node.mode))throw new a.ErrnoError(43);if(!e.stream_ops.allocate)throw new a.ErrnoError(138);e.stream_ops.allocate(e,r,t)},mmap(e,r,t,n,o){if(n&2&&!(o&2)&&(e.flags&2097155)!==2)throw new a.ErrnoError(2);if((e.flags&2097155)===1)throw new a.ErrnoError(2);if(!e.stream_ops.mmap)throw new a.ErrnoError(43);return e.stream_ops.mmap(e,r,t,n,o)},msync(e,r,t,n,o){return e.stream_ops.msync?e.stream_ops.msync(e,r,t,n,o):0},ioctl(e,r,t){if(!e.stream_ops.ioctl)throw new a.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile(e,r={}){if(r.flags=r.flags||0,r.encoding=r.encoding||"binary",r.encoding!=="utf8"&&r.encoding!=="binary")throw new Error(`Invalid encoding type "${r.encoding}"`);var t,n=a.open(e,r.flags),o=a.stat(e),i=o.size,s=new Uint8Array(i);return a.read(n,s,0,i,0),r.encoding==="utf8"?t=we(s,0):r.encoding==="binary"&&(t=s),a.close(n),t},writeFile(e,r,t={}){t.flags=t.flags||577;var n=a.open(e,t.flags,t.mode);if(typeof r=="string"){var o=new Uint8Array(De(r)+1),i=pr(r,o,0,o.length);a.write(n,o,0,i,void 0,t.canOwn)}else if(ArrayBuffer.isView(r))a.write(n,r,0,r.byteLength,void 0,t.canOwn);else throw new Error("Unsupported data type");a.close(n)},cwd:()=>a.currentPath,chdir(e){var r=a.lookupPath(e,{follow:!0});if(r.node===null)throw new a.ErrnoError(44);if(!a.isDir(r.node.mode))throw new a.ErrnoError(54);var t=a.nodePermissions(r.node,"x");if(t)throw new a.ErrnoError(t);a.currentPath=r.path},createDefaultDirectories(){a.mkdir("/tmp"),a.mkdir("/home"),a.mkdir("/home/web_user")},createDefaultDevices(){a.mkdir("/dev"),a.registerDevice(a.makedev(1,3),{read:()=>0,write:(n,o,i,s,l)=>s}),a.mkdev("/dev/null",a.makedev(1,3)),ie.register(a.makedev(5,0),ie.default_tty_ops),ie.register(a.makedev(6,0),ie.default_tty1_ops),a.mkdev("/dev/tty",a.makedev(5,0)),a.mkdev("/dev/tty1",a.makedev(6,0));var e=new Uint8Array(1024),r=0,t=()=>(r===0&&(r=Kr(e).byteLength),e[--r]);a.createDevice("/dev","random",t),a.createDevice("/dev","urandom",t),a.mkdir("/dev/shm"),a.mkdir("/dev/shm/tmp")},createSpecialDirectories(){a.mkdir("/proc");var e=a.mkdir("/proc/self");a.mkdir("/proc/self/fd"),a.mount({mount(){var r=a.createNode(e,"fd",16895,73);return r.node_ops={lookup(t,n){var o=+n,i=a.getStreamChecked(o),s={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>i.path}};return s.parent=s,s}},r}},{},"/proc/self/fd")},createStandardStreams(){u.stdin?a.createDevice("/dev","stdin",u.stdin):a.symlink("/dev/tty","/dev/stdin"),u.stdout?a.createDevice("/dev","stdout",null,u.stdout):a.symlink("/dev/tty","/dev/stdout"),u.stderr?a.createDevice("/dev","stderr",null,u.stderr):a.symlink("/dev/tty1","/dev/stderr");var e=a.open("/dev/stdin",0),r=a.open("/dev/stdout",1),t=a.open("/dev/stderr",1)},staticInit(){[44].forEach(e=>{a.genericErrors[e]=new a.ErrnoError(e),a.genericErrors[e].stack="<generic error, no stack>"}),a.nameTable=new Array(4096),a.mount(k,{},"/"),a.createDefaultDirectories(),a.createDefaultDevices(),a.createSpecialDirectories(),a.filesystems={MEMFS:k}},init(e,r,t){a.init.initialized=!0,u.stdin=e||u.stdin,u.stdout=r||u.stdout,u.stderr=t||u.stderr,a.createStandardStreams()},quit(){a.init.initialized=!1;for(var e=0;e<a.streams.length;e++){var r=a.streams[e];r&&a.close(r)}},findObject(e,r){var t=a.analyzePath(e,r);return t.exists?t.object:null},analyzePath(e,r){try{var t=a.lookupPath(e,{follow:!r});e=t.path}catch(o){}var n={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var t=a.lookupPath(e,{parent:!0});n.parentExists=!0,n.parentPath=t.path,n.parentObject=t.node,n.name=$.basename(e),t=a.lookupPath(e,{follow:!r}),n.exists=!0,n.path=t.path,n.object=t.node,n.name=t.node.name,n.isRoot=t.path==="/"}catch(o){n.error=o.errno}return n},createPath(e,r,t,n){e=typeof e=="string"?e:a.getPath(e);for(var o=r.split("/").reverse();o.length;){var i=o.pop();if(i){var s=$.join2(e,i);try{a.mkdir(s)}catch(l){}e=s}}return s},createFile(e,r,t,n,o){var i=$.join2(typeof e=="string"?e:a.getPath(e),r),s=hr(n,o);return a.create(i,s)},createDataFile(e,r,t,n,o,i){var s=r;e&&(e=typeof e=="string"?e:a.getPath(e),s=r?$.join2(e,r):e);var l=hr(n,o),c=a.create(s,l);if(t){if(typeof t=="string"){for(var f=new Array(t.length),d=0,g=t.length;d<g;++d)f[d]=t.charCodeAt(d);t=f}a.chmod(c,l|146);var h=a.open(c,577);a.write(h,t,0,t.length,0,i),a.close(h),a.chmod(c,l)}},createDevice(e,r,t,n){var o=$.join2(typeof e=="string"?e:a.getPath(e),r),i=hr(!!t,!!n);a.createDevice.major||(a.createDevice.major=64);var s=a.makedev(a.createDevice.major++,0);return a.registerDevice(s,{open(l){l.seekable=!1},close(l){var c;(c=n==null?void 0:n.buffer)!=null&&c.length&&n(10)},read(l,c,f,d,g){for(var h=0,m=0;m<d;m++){var y;try{y=t()}catch(P){throw new a.ErrnoError(29)}if(y===void 0&&h===0)throw new a.ErrnoError(6);if(y==null)break;h++,c[f+m]=y}return h&&(l.node.timestamp=Date.now()),h},write(l,c,f,d,g){for(var h=0;h<d;h++)try{n(c[f+h])}catch(m){throw new a.ErrnoError(29)}return d&&(l.node.timestamp=Date.now()),h}}),a.mkdev(o,i,s)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if(typeof XMLHttpRequest!="undefined")throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");try{e.contents=Y(e.url),e.usedBytes=e.contents.length}catch(r){throw new a.ErrnoError(29)}},createLazyFile(e,r,t,n,o){class i{constructor(){this.lengthKnown=!1,this.chunks=[]}get(m){if(!(m>this.length-1||m<0)){var y=m%this.chunkSize,P=m/this.chunkSize|0;return this.getter(P)[y]}}setDataGetter(m){this.getter=m}cacheLength(){var m=new XMLHttpRequest;if(m.open("HEAD",t,!1),m.send(null),!(m.status>=200&&m.status<300||m.status===304))throw new Error("Couldn't load "+t+". Status: "+m.status);var y=Number(m.getResponseHeader("Content-length")),P,R=(P=m.getResponseHeader("Accept-Ranges"))&&P==="bytes",S=(P=m.getResponseHeader("Content-Encoding"))&&P==="gzip",b=1024*1024;R||(b=y);var A=(D,x)=>{if(D>x)throw new Error("invalid range ("+D+", "+x+") or no bytes requested!");if(x>y-1)throw new Error("only "+y+" bytes available! programmer error!");var W=new XMLHttpRequest;if(W.open("GET",t,!1),y!==b&&W.setRequestHeader("Range","bytes="+D+"-"+x),W.responseType="arraybuffer",W.overrideMimeType&&W.overrideMimeType("text/plain; charset=x-user-defined"),W.send(null),!(W.status>=200&&W.status<300||W.status===304))throw new Error("Couldn't load "+t+". Status: "+W.status);return W.response!==void 0?new Uint8Array(W.response||[]):Yr(W.responseText||"",!0)},O=this;O.setDataGetter(D=>{var x=D*b,W=(D+1)*b-1;if(W=Math.min(W,y-1),typeof O.chunks[D]=="undefined"&&(O.chunks[D]=A(x,W)),typeof O.chunks[D]=="undefined")throw new Error("doXHR failed!");return O.chunks[D]}),(S||!y)&&(b=y=1,y=this.getter(0).length,b=y,ae("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=y,this._chunkSize=b,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if(typeof XMLHttpRequest!="undefined"){if(!Z)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var s=new i,l={isDevice:!1,contents:s}}else var l={isDevice:!1,url:t};var c=a.createFile(e,r,l,n,o);l.contents?c.contents=l.contents:l.url&&(c.contents=null,c.url=l.url),Object.defineProperties(c,{usedBytes:{get:function(){return this.contents.length}}});var f={},d=Object.keys(c.stream_ops);d.forEach(h=>{var m=c.stream_ops[h];f[h]=(...y)=>(a.forceLoadFile(c),m(...y))});function g(h,m,y,P,R){var S=h.node.contents;if(R>=S.length)return 0;var b=Math.min(S.length-R,P);if(S.slice)for(var A=0;A<b;A++)m[y+A]=S[R+A];else for(var A=0;A<b;A++)m[y+A]=S.get(R+A);return b}return f.read=(h,m,y,P,R)=>(a.forceLoadFile(c),g(h,m,y,P,R)),f.mmap=(h,m,y,P,R)=>{a.forceLoadFile(c);var S=Qr(m);if(!S)throw new a.ErrnoError(48);return g(h,U,S,m,y),{ptr:S,allocated:!0}},c.stream_ops=f,c}},et=(e,r)=>e?we(B,e,r):"",I={DEFAULT_POLLMASK:5,calculateAt(e,r,t){if($.isAbs(r))return r;var n;if(e===-100)n=a.cwd();else{var o=I.getStreamFromFD(e);n=o.path}if(r.length==0){if(!t)throw new a.ErrnoError(44);return n}return $.join2(n,r)},doStat(e,r,t){var n=e(r);_[t>>2]=n.dev,_[t+4>>2]=n.mode,F[t+8>>2]=n.nlink,_[t+12>>2]=n.uid,_[t+16>>2]=n.gid,_[t+20>>2]=n.rdev,j=[n.size>>>0,(E=n.size,+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],_[t+24>>2]=j[0],_[t+28>>2]=j[1],_[t+32>>2]=4096,_[t+36>>2]=n.blocks;var o=n.atime.getTime(),i=n.mtime.getTime(),s=n.ctime.getTime();return j=[Math.floor(o/1e3)>>>0,(E=Math.floor(o/1e3),+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],_[t+40>>2]=j[0],_[t+44>>2]=j[1],F[t+48>>2]=o%1e3*1e3,j=[Math.floor(i/1e3)>>>0,(E=Math.floor(i/1e3),+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],_[t+56>>2]=j[0],_[t+60>>2]=j[1],F[t+64>>2]=i%1e3*1e3,j=[Math.floor(s/1e3)>>>0,(E=Math.floor(s/1e3),+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],_[t+72>>2]=j[0],_[t+76>>2]=j[1],F[t+80>>2]=s%1e3*1e3,j=[n.ino>>>0,(E=n.ino,+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],_[t+88>>2]=j[0],_[t+92>>2]=j[1],0},doMsync(e,r,t,n,o){if(!a.isFile(r.node.mode))throw new a.ErrnoError(43);if(n&2)return 0;var i=B.slice(e,e+t);a.msync(r,i,o,t,n)},getStreamFromFD(e){var r=a.getStreamChecked(e);return r},varargs:void 0,getStr(e){var r=et(e);return r}};function an(e,r,t){I.varargs=t;try{var n=I.getStreamFromFD(e);switch(r){case 0:{var o=Ge();if(o<0)return-28;for(;a.streams[o];)o++;var i;return i=a.dupStream(n,o),i.fd}case 1:case 2:return 0;case 3:return n.flags;case 4:{var o=Ge();return n.flags|=o,0}case 12:{var o=ye(),s=0;return ee[o+s>>1]=2,0}case 13:case 14:return 0}return-28}catch(l){if(typeof a=="undefined"||l.name!=="ErrnoError")throw l;return-l.errno}}var de=(e,r,t)=>pr(e,B,r,t);function sn(e,r){try{if(r===0)return-28;var t=a.cwd(),n=De(t)+1;return r<n?-68:(de(t,e,r),n)}catch(o){if(typeof a=="undefined"||o.name!=="ErrnoError")throw o;return-o.errno}}function ln(e,r,t){I.varargs=t;try{var n=I.getStreamFromFD(e);switch(r){case 21509:return n.tty?0:-59;case 21505:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var o=n.tty.ops.ioctl_tcgets(n),i=ye();_[i>>2]=o.c_iflag||0,_[i+4>>2]=o.c_oflag||0,_[i+8>>2]=o.c_cflag||0,_[i+12>>2]=o.c_lflag||0;for(var s=0;s<32;s++)U[i+s+17]=o.c_cc[s]||0;return 0}return 0}case 21510:case 21511:case 21512:return n.tty?0:-59;case 21506:case 21507:case 21508:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){for(var i=ye(),l=_[i>>2],c=_[i+4>>2],f=_[i+8>>2],d=_[i+12>>2],g=[],s=0;s<32;s++)g.push(U[i+s+17]);return n.tty.ops.ioctl_tcsets(n.tty,r,{c_iflag:l,c_oflag:c,c_cflag:f,c_lflag:d,c_cc:g})}return 0}case 21519:{if(!n.tty)return-59;var i=ye();return _[i>>2]=0,0}case 21520:return n.tty?-28:-59;case 21531:{var i=ye();return a.ioctl(n,r,i)}case 21523:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var h=n.tty.ops.ioctl_tiocgwinsz(n.tty),i=ye();ee[i>>1]=h[0],ee[i+2>>1]=h[1]}return 0}case 21524:return n.tty?0:-59;case 21515:return n.tty?0:-59;default:return-28}}catch(m){if(typeof a=="undefined"||m.name!=="ErrnoError")throw m;return-m.errno}}function un(e,r,t){try{return r=I.getStr(r),r=I.calculateAt(e,r),r=$.normalize(r),r[r.length-1]==="/"&&(r=r.substr(0,r.length-1)),a.mkdir(r,t,0),0}catch(n){if(typeof a=="undefined"||n.name!=="ErrnoError")throw n;return-n.errno}}function cn(e,r,t,n){I.varargs=n;try{r=I.getStr(r),r=I.calculateAt(e,r);var o=n?Ge():0;return a.open(r,t,o).fd}catch(i){if(typeof a=="undefined"||i.name!=="ErrnoError")throw i;return-i.errno}}function fn(e,r,t,n){try{if(r=I.getStr(r),r=I.calculateAt(e,r),n<=0)return-28;var o=a.readlink(r),i=Math.min(n,De(o)),s=U[t+i];return de(o,t,n+1),U[t+i]=s,i}catch(l){if(typeof a=="undefined"||l.name!=="ErrnoError")throw l;return-l.errno}}function dn(e,r){try{return e=I.getStr(e),I.doStat(a.stat,e,r)}catch(t){if(typeof a=="undefined"||t.name!=="ErrnoError")throw t;return-t.errno}}var vn=()=>{fr("")},pn=(e,r,t,n,o)=>{},hn=()=>{for(var e=new Array(256),r=0;r<256;++r)e[r]=String.fromCharCode(r);rt=e},rt,V=e=>{for(var r="",t=e;B[t];)r+=rt[B[t++]];return r},_e={},ve={},Ke={},Ee,C=e=>{throw new Ee(e)},tt,Xe=e=>{throw new tt(e)},Q=(e,r,t)=>{e.forEach(function(l){Ke[l]=r});function n(l){var c=t(l);c.length!==e.length&&Xe("Mismatched type converter count");for(var f=0;f<e.length;++f)te(e[f],c[f])}var o=new Array(r.length),i=[],s=0;r.forEach((l,c)=>{ve.hasOwnProperty(l)?o[c]=ve[l]:(i.push(l),_e.hasOwnProperty(l)||(_e[l]=[]),_e[l].push(()=>{o[c]=ve[l],++s,s===i.length&&n(o)}))}),i.length===0&&n(o)};function mn(e,r,t={}){var n=r.name;if(e||C(`type "${n}" must have a positive integer typeid pointer`),ve.hasOwnProperty(e)){if(t.ignoreDuplicateRegistrations)return;C(`Cannot register type '${n}' twice`)}if(ve[e]=r,delete Ke[e],_e.hasOwnProperty(e)){var o=_e[e];delete _e[e],o.forEach(i=>i())}}function te(e,r,t={}){if(!("argPackAdvance"in r))throw new TypeError("registerType registeredInstance requires argPackAdvance");return mn(e,r,t)}var se=8,gn=(e,r,t,n)=>{r=V(r),te(e,{name:r,fromWireType:function(o){return!!o},toWireType:function(o,i){return i?t:n},argPackAdvance:se,readValueFromPointer:function(o){return this.fromWireType(B[o])},destructorFunction:null})},yn=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),mr=e=>{function r(t){return t.$$.ptrType.registeredClass.name}C(r(e)+" instance already deleted")},gr=!1,nt=e=>{},wn=e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)},ot=e=>{e.count.value-=1;var r=e.count.value===0;r&&wn(e)},at=(e,r,t)=>{if(r===t)return e;if(t.baseClass===void 0)return null;var n=at(e,r,t.baseClass);return n===null?null:t.downcast(n)},it={},_n=()=>Object.keys($e).length,En=()=>{var e=[];for(var r in $e)$e.hasOwnProperty(r)&&e.push($e[r]);return e},Re=[],yr=()=>{for(;Re.length;){var e=Re.pop();e.$$.deleteScheduled=!1,e.delete()}},Me,kn=e=>{Me=e,Re.length&&Me&&Me(yr)},bn=()=>{u.getInheritedInstanceCount=_n,u.getLiveInheritedInstances=En,u.flushPendingDeletes=yr,u.setDelayFunction=kn},$e={},An=(e,r)=>{for(r===void 0&&C("ptr should not be undefined");e.baseClass;)r=e.upcast(r),e=e.baseClass;return r},Pn=(e,r)=>(r=An(e,r),$e[r]),Ye=(e,r)=>{(!r.ptrType||!r.ptr)&&Xe("makeClassHandle requires ptr and ptrType");var t=!!r.smartPtrType,n=!!r.smartPtr;return t!==n&&Xe("Both smartPtrType and smartPtr must be specified"),r.count={value:1},Oe(Object.create(e,{$$:{value:r,writable:!0}}))};function Cn(e){var r=this.getPointee(e);if(!r)return this.destructor(e),null;var t=Pn(this.registeredClass,r);if(t!==void 0){if(t.$$.count.value===0)return t.$$.ptr=r,t.$$.smartPtr=e,t.clone();var n=t.clone();return this.destructor(e),n}function o(){return this.isSmartPointer?Ye(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:r,smartPtrType:this,smartPtr:e}):Ye(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var i=this.registeredClass.getActualType(r),s=it[i];if(!s)return o.call(this);var l;this.isConst?l=s.constPointerType:l=s.pointerType;var c=at(r,this.registeredClass,l.registeredClass);return c===null?o.call(this):this.isSmartPointer?Ye(l.registeredClass.instancePrototype,{ptrType:l,ptr:c,smartPtrType:this,smartPtr:e}):Ye(l.registeredClass.instancePrototype,{ptrType:l,ptr:c})}var Oe=e=>typeof FinalizationRegistry=="undefined"?(Oe=r=>r,e):(gr=new FinalizationRegistry(r=>{ot(r.$$)}),Oe=r=>{var t=r.$$,n=!!t.smartPtr;if(n){var o={$$:t};gr.register(r,o,r)}return r},nt=r=>gr.unregister(r),Oe(e)),Tn=()=>{Object.assign(Qe.prototype,{isAliasOf(e){if(!(this instanceof Qe)||!(e instanceof Qe))return!1;var r=this.$$.ptrType.registeredClass,t=this.$$.ptr;e.$$=e.$$;for(var n=e.$$.ptrType.registeredClass,o=e.$$.ptr;r.baseClass;)t=r.upcast(t),r=r.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return r===n&&t===o},clone(){if(this.$$.ptr||mr(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=Oe(Object.create(Object.getPrototypeOf(this),{$$:{value:yn(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e},delete(){this.$$.ptr||mr(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&C("Object already scheduled for deletion"),nt(this),ot(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||mr(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&C("Object already scheduled for deletion"),Re.push(this),Re.length===1&&Me&&Me(yr),this.$$.deleteScheduled=!0,this}})};function Qe(){}var Je=(e,r)=>Object.defineProperty(r,"name",{value:e}),wr=(e,r,t)=>{if(e[r].overloadTable===void 0){var n=e[r];e[r]=function(...o){return e[r].overloadTable.hasOwnProperty(o.length)||C(`Function '${t}' called with an invalid number of arguments (${o.length}) - expects one of (${e[r].overloadTable})!`),e[r].overloadTable[o.length].apply(this,o)},e[r].overloadTable=[],e[r].overloadTable[n.argCount]=n}},st=(e,r,t)=>{u.hasOwnProperty(e)?((t===void 0||u[e].overloadTable!==void 0&&u[e].overloadTable[t]!==void 0)&&C(`Cannot register public name '${e}' twice`),wr(u,e,e),u.hasOwnProperty(t)&&C(`Cannot register multiple overloads of a function with the same number of arguments (${t})!`),u[e].overloadTable[t]=r):(u[e]=r,t!==void 0&&(u[e].numArguments=t))},Fn=48,Sn=57,Dn=e=>{if(e===void 0)return"_unknown";e=e.replace(/[^a-zA-Z0-9_]/g,"$");var r=e.charCodeAt(0);return r>=Fn&&r<=Sn?`_${e}`:e};function Rn(e,r,t,n,o,i,s,l){this.name=e,this.constructor=r,this.instancePrototype=t,this.rawDestructor=n,this.baseClass=o,this.getActualType=i,this.upcast=s,this.downcast=l,this.pureVirtualFunctions=[]}var Ze=(e,r,t)=>{for(;r!==t;)r.upcast||C(`Expected null or instance of ${t.name}, got an instance of ${r.name}`),e=r.upcast(e),r=r.baseClass;return e};function Mn(e,r){if(r===null)return this.isReference&&C(`null is not a valid ${this.name}`),0;r.$$||C(`Cannot pass "${Ar(r)}" as a ${this.name}`),r.$$.ptr||C(`Cannot pass deleted object as a pointer of type ${this.name}`);var t=r.$$.ptrType.registeredClass,n=Ze(r.$$.ptr,t,this.registeredClass);return n}function $n(e,r){var t;if(r===null)return this.isReference&&C(`null is not a valid ${this.name}`),this.isSmartPointer?(t=this.rawConstructor(),e!==null&&e.push(this.rawDestructor,t),t):0;(!r||!r.$$)&&C(`Cannot pass "${Ar(r)}" as a ${this.name}`),r.$$.ptr||C(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&r.$$.ptrType.isConst&&C(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`);var n=r.$$.ptrType.registeredClass;if(t=Ze(r.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(r.$$.smartPtr===void 0&&C("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:r.$$.smartPtrType===this?t=r.$$.smartPtr:C(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:t=r.$$.smartPtr;break;case 2:if(r.$$.smartPtrType===this)t=r.$$.smartPtr;else{var o=r.clone();t=this.rawShare(t,he.toHandle(()=>o.delete())),e!==null&&e.push(this.rawDestructor,t)}break;default:C("Unsupporting sharing policy")}return t}function On(e,r){if(r===null)return this.isReference&&C(`null is not a valid ${this.name}`),0;r.$$||C(`Cannot pass "${Ar(r)}" as a ${this.name}`),r.$$.ptr||C(`Cannot pass deleted object as a pointer of type ${this.name}`),r.$$.ptrType.isConst&&C(`Cannot convert argument of type ${r.$$.ptrType.name} to parameter type ${this.name}`);var t=r.$$.ptrType.registeredClass,n=Ze(r.$$.ptr,t,this.registeredClass);return n}function er(e){return this.fromWireType(F[e>>2])}var Wn=()=>{Object.assign(We.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){var r;(r=this.rawDestructor)==null||r.call(this,e)},argPackAdvance:se,readValueFromPointer:er,fromWireType:Cn})};function We(e,r,t,n,o,i,s,l,c,f,d){this.name=e,this.registeredClass=r,this.isReference=t,this.isConst=n,this.isSmartPointer=o,this.pointeeType=i,this.sharingPolicy=s,this.rawGetPointee=l,this.rawConstructor=c,this.rawShare=f,this.rawDestructor=d,!o&&r.baseClass===void 0?n?(this.toWireType=Mn,this.destructorFunction=null):(this.toWireType=On,this.destructorFunction=null):this.toWireType=$n}var lt=(e,r,t)=>{u.hasOwnProperty(e)||Xe("Replacing nonexistent public symbol"),u[e].overloadTable!==void 0&&t!==void 0?u[e].overloadTable[t]=r:(u[e]=r,u[e].argCount=t)},jn=(e,r,t)=>{e=e.replace(/p/g,"i");var n=u["dynCall_"+e];return n(r,...t)},rr=[],ut,ct=e=>{var r=rr[e];return r||(e>=rr.length&&(rr.length=e+1),rr[e]=r=ut.get(e)),r},In=(e,r,t=[])=>{if(e.includes("j"))return jn(e,r,t);var n=ct(r)(...t);return n},Nn=(e,r)=>(...t)=>In(e,r,t),q=(e,r)=>{e=V(e);function t(){return e.includes("j")?Nn(e,r):ct(r)}var n=t();return typeof n!="function"&&C(`unknown function pointer with signature ${e}: ${r}`),n},xn=(e,r)=>{var t=Je(r,function(n){this.name=r,this.message=n;var o=new Error(n).stack;o!==void 0&&(this.stack=this.toString()+`
|
|
8
|
+
`+o.replace(/^Error(:[^\n]*)?\n/,""))});return t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},t},ft,dt=e=>{var r=wt(e),t=V(r);return oe(r),t},pe=(e,r)=>{var t=[],n={};function o(i){if(!n[i]&&!ve[i]){if(Ke[i]){Ke[i].forEach(o);return}t.push(i),n[i]=!0}}throw r.forEach(o),new ft(`${e}: `+t.map(dt).join([", "]))},Un=(e,r,t,n,o,i,s,l,c,f,d,g,h)=>{d=V(d),i=q(o,i),l&&(l=q(s,l)),f&&(f=q(c,f)),h=q(g,h);var m=Dn(d);st(m,function(){pe(`Cannot construct ${d} due to unbound types`,[n])}),Q([e,r,t],n?[n]:[],y=>{var W,Ne;y=y[0];var P,R;n?(P=y.registeredClass,R=P.instancePrototype):R=Qe.prototype;var S=Je(d,function(...xe){if(Object.getPrototypeOf(this)!==b)throw new Ee("Use 'new' to construct "+d);if(A.constructor_body===void 0)throw new Ee(d+" has no accessible constructor");var Ue=A.constructor_body[xe.length];if(Ue===void 0)throw new Ee(`Tried to invoke ctor of ${d} with invalid number of parameters (${xe.length}) - expected (${Object.keys(A.constructor_body).toString()}) parameters instead!`);return Ue.apply(this,xe)}),b=Object.create(R,{constructor:{value:S}});S.prototype=b;var A=new Rn(d,S,b,h,P,i,l,f);A.baseClass&&((Ne=(W=A.baseClass).__derivedClasses)!=null||(W.__derivedClasses=[]),A.baseClass.__derivedClasses.push(A));var O=new We(d,A,!0,!1,!1),D=new We(d+"*",A,!1,!1,!1),x=new We(d+" const*",A,!1,!0,!1);return it[e]={pointerType:D,constPointerType:x},lt(m,S),[O,D,x]})},_r=e=>{for(;e.length;){var r=e.pop(),t=e.pop();t(r)}};function Ln(e){for(var r=1;r<e.length;++r)if(e[r]!==null&&e[r].destructorFunction===void 0)return!0;return!1}function tr(e,r,t,n,o,i){var s=r.length;s<2&&C("argTypes array size mismatch! Must at least get return value and 'this' types!");var l=r[1]!==null&&t!==null,c=Ln(r),f=r[0].name!=="void",d=s-2,g=new Array(d),h=[],m=[],y=function(...P){P.length!==d&&C(`function ${e} called with ${P.length} arguments, expected ${d}`),m.length=0;var R;h.length=l?2:1,h[0]=o,l&&(R=r[1].toWireType(m,this),h[1]=R);for(var S=0;S<d;++S)g[S]=r[S+2].toWireType(m,P[S]),h.push(g[S]);var b=n(...h);function A(O){if(c)_r(m);else for(var D=l?1:2;D<r.length;D++){var x=D===1?R:g[D-2];r[D].destructorFunction!==null&&r[D].destructorFunction(x)}if(f)return r[0].fromWireType(O)}return A(b)};return Je(e,y)}var nr=(e,r)=>{for(var t=[],n=0;n<e;n++)t.push(F[r+n*4>>2]);return t},Er=e=>{e=e.trim();let r=e.indexOf("(");return r!==-1?e.substr(0,r):e},Hn=(e,r,t,n,o,i,s,l)=>{var c=nr(t,n);r=V(r),r=Er(r),i=q(o,i),Q([],[e],f=>{f=f[0];var d=`${f.name}.${r}`;function g(){pe(`Cannot call ${d} due to unbound types`,c)}r.startsWith("@@")&&(r=Symbol[r.substring(2)]);var h=f.registeredClass.constructor;return h[r]===void 0?(g.argCount=t-1,h[r]=g):(wr(h,r,d),h[r].overloadTable[t-1]=g),Q([],c,m=>{var y=[m[0],null].concat(m.slice(1)),P=tr(d,y,null,i,s,l);if(h[r].overloadTable===void 0?(P.argCount=t-1,h[r]=P):h[r].overloadTable[t-1]=P,f.registeredClass.__derivedClasses)for(let R of f.registeredClass.__derivedClasses)R.constructor.hasOwnProperty(r)||(R.constructor[r]=P);return[]}),[]})},Bn=(e,r,t,n,o,i)=>{var s=nr(r,t);o=q(n,o),Q([],[e],l=>{l=l[0];var c=`constructor ${l.name}`;if(l.registeredClass.constructor_body===void 0&&(l.registeredClass.constructor_body=[]),l.registeredClass.constructor_body[r-1]!==void 0)throw new Ee(`Cannot register multiple constructors with identical number of parameters (${r-1}) for class '${l.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return l.registeredClass.constructor_body[r-1]=()=>{pe(`Cannot construct ${l.name} due to unbound types`,s)},Q([],s,f=>(f.splice(1,0,null),l.registeredClass.constructor_body[r-1]=tr(c,f,null,o,i),[])),[]})},zn=(e,r,t,n,o,i,s,l,c)=>{var f=nr(t,n);r=V(r),r=Er(r),i=q(o,i),Q([],[e],d=>{d=d[0];var g=`${d.name}.${r}`;r.startsWith("@@")&&(r=Symbol[r.substring(2)]),l&&d.registeredClass.pureVirtualFunctions.push(r);function h(){pe(`Cannot call ${g} due to unbound types`,f)}var m=d.registeredClass.instancePrototype,y=m[r];return y===void 0||y.overloadTable===void 0&&y.className!==d.name&&y.argCount===t-2?(h.argCount=t-2,h.className=d.name,m[r]=h):(wr(m,r,g),m[r].overloadTable[t-2]=h),Q([],f,P=>{var R=tr(g,P,d,i,s,c);return m[r].overloadTable===void 0?(R.argCount=t-2,m[r]=R):m[r].overloadTable[t-2]=R,[]}),[]})},vt=(e,r,t)=>(e instanceof Object||C(`${t} with invalid "this": ${e}`),e instanceof r.registeredClass.constructor||C(`${t} incompatible with "this" of type ${e.constructor.name}`),e.$$.ptr||C(`cannot call emscripten binding method ${t} on deleted object`),Ze(e.$$.ptr,e.$$.ptrType.registeredClass,r.registeredClass)),Vn=(e,r,t,n,o,i,s,l,c,f)=>{r=V(r),o=q(n,o),Q([],[e],d=>{d=d[0];var g=`${d.name}.${r}`,h={get(){pe(`Cannot access ${g} due to unbound types`,[t,s])},enumerable:!0,configurable:!0};return c?h.set=()=>pe(`Cannot access ${g} due to unbound types`,[t,s]):h.set=m=>C(g+" is a read-only property"),Object.defineProperty(d.registeredClass.instancePrototype,r,h),Q([],c?[t,s]:[t],m=>{var y=m[0],P={get(){var S=vt(this,d,g+" getter");return y.fromWireType(o(i,S))},enumerable:!0};if(c){c=q(l,c);var R=m[1];P.set=function(S){var b=vt(this,d,g+" setter"),A=[];c(f,b,R.toWireType(A,S)),_r(A)}}return Object.defineProperty(d.registeredClass.instancePrototype,r,P),[]}),[]})},kr=[],ne=[],br=e=>{e>9&&--ne[e+1]===0&&(ne[e]=void 0,kr.push(e))},qn=()=>ne.length/2-5-kr.length,Gn=()=>{ne.push(0,1,void 0,1,null,1,!0,1,!1,1),u.count_emval_handles=qn},he={toValue:e=>(e||C("Cannot use deleted val. handle = "+e),ne[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{let r=kr.pop()||ne.length;return ne[r]=e,ne[r+1]=1,r}}}},Kn={name:"emscripten::val",fromWireType:e=>{var r=he.toValue(e);return br(e),r},toWireType:(e,r)=>he.toHandle(r),argPackAdvance:se,readValueFromPointer:er,destructorFunction:null},pt=e=>te(e,Kn),Ar=e=>{if(e===null)return"null";var r=typeof e;return r==="object"||r==="array"||r==="function"?e.toString():""+e},Xn=(e,r)=>{switch(r){case 4:return function(t){return this.fromWireType(Nr[t>>2])};case 8:return function(t){return this.fromWireType(xr[t>>3])};default:throw new TypeError(`invalid float width (${r}): ${e}`)}},Yn=(e,r,t)=>{r=V(r),te(e,{name:r,fromWireType:n=>n,toWireType:(n,o)=>o,argPackAdvance:se,readValueFromPointer:Xn(r,t),destructorFunction:null})},Qn=(e,r,t,n,o,i,s)=>{var l=nr(r,t);e=V(e),e=Er(e),o=q(n,o),st(e,function(){pe(`Cannot call ${e} due to unbound types`,l)},r-1),Q([],l,c=>{var f=[c[0],null].concat(c.slice(1));return lt(e,tr(e,f,null,o,i,s),r-1),[]})},Jn=(e,r,t)=>{switch(r){case 1:return t?n=>U[n]:n=>B[n];case 2:return t?n=>ee[n>>1]:n=>ze[n>>1];case 4:return t?n=>_[n>>2]:n=>F[n>>2];default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},Zn=(e,r,t,n,o)=>{r=V(r),o===-1&&(o=4294967295);var i=d=>d;if(n===0){var s=32-8*t;i=d=>d<<s>>>s}var l=r.includes("unsigned"),c=(d,g)=>{},f;l?f=function(d,g){return c(g,this.name),g>>>0}:f=function(d,g){return c(g,this.name),g},te(e,{name:r,fromWireType:i,toWireType:f,argPackAdvance:se,readValueFromPointer:Jn(r,t,n!==0),destructorFunction:null})},eo=(e,r,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],o=n[r];function i(s){var l=F[s>>2],c=F[s+4>>2];return new o(U.buffer,c,l)}t=V(t),te(e,{name:t,fromWireType:i,argPackAdvance:se,readValueFromPointer:i},{ignoreDuplicateRegistrations:!0})},ro=(e,r)=>{pt(e)},to=(e,r,t,n,o,i,s,l,c,f,d,g)=>{t=V(t),i=q(o,i),l=q(s,l),f=q(c,f),g=q(d,g),Q([e],[r],h=>{h=h[0];var m=new We(t,h.registeredClass,!1,!1,!0,h,n,i,l,f,g);return[m]})},no=(e,r)=>{r=V(r);var t=r==="std::string";te(e,{name:r,fromWireType(n){var o=F[n>>2],i=n+4,s;if(t)for(var l=i,c=0;c<=o;++c){var f=i+c;if(c==o||B[f]==0){var d=f-l,g=et(l,d);s===void 0?s=g:(s+=String.fromCharCode(0),s+=g),l=f+1}}else{for(var h=new Array(o),c=0;c<o;++c)h[c]=String.fromCharCode(B[i+c]);s=h.join("")}return oe(n),s},toWireType(n,o){o instanceof ArrayBuffer&&(o=new Uint8Array(o));var i,s=typeof o=="string";s||o instanceof Uint8Array||o instanceof Uint8ClampedArray||o instanceof Int8Array||C("Cannot pass non-string to std::string"),t&&s?i=De(o):i=o.length;var l=Tr(4+i+1),c=l+4;if(F[l>>2]=i,t&&s)de(o,c,i+1);else if(s)for(var f=0;f<i;++f){var d=o.charCodeAt(f);d>255&&(oe(c),C("String has UTF-16 code units that do not fit in 8 bits")),B[c+f]=d}else for(var f=0;f<i;++f)B[c+f]=o[f];return n!==null&&n.push(oe,l),l},argPackAdvance:se,readValueFromPointer:er,destructorFunction(n){oe(n)}})},ht=typeof TextDecoder!="undefined"?new TextDecoder("utf-16le"):void 0,oo=(e,r)=>{for(var t=e,n=t>>1,o=n+r/2;!(n>=o)&&ze[n];)++n;if(t=n<<1,t-e>32&&ht)return ht.decode(B.subarray(e,t));for(var i="",s=0;!(s>=r/2);++s){var l=ee[e+s*2>>1];if(l==0)break;i+=String.fromCharCode(l)}return i},ao=(e,r,t)=>{if(t!=null||(t=2147483647),t<2)return 0;t-=2;for(var n=r,o=t<e.length*2?t/2:e.length,i=0;i<o;++i){var s=e.charCodeAt(i);ee[r>>1]=s,r+=2}return ee[r>>1]=0,r-n},io=e=>e.length*2,so=(e,r)=>{for(var t=0,n="";!(t>=r/4);){var o=_[e+t*4>>2];if(o==0)break;if(++t,o>=65536){var i=o-65536;n+=String.fromCharCode(55296|i>>10,56320|i&1023)}else n+=String.fromCharCode(o)}return n},lo=(e,r,t)=>{if(t!=null||(t=2147483647),t<4)return 0;for(var n=r,o=n+t-4,i=0;i<e.length;++i){var s=e.charCodeAt(i);if(s>=55296&&s<=57343){var l=e.charCodeAt(++i);s=65536+((s&1023)<<10)|l&1023}if(_[r>>2]=s,r+=4,r+4>o)break}return _[r>>2]=0,r-n},uo=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n>=55296&&n<=57343&&++t,r+=4}return r},co=(e,r,t)=>{t=V(t);var n,o,i,s;r===2?(n=oo,o=ao,s=io,i=l=>ze[l>>1]):r===4&&(n=so,o=lo,s=uo,i=l=>F[l>>2]),te(e,{name:t,fromWireType:l=>{for(var c=F[l>>2],f,d=l+4,g=0;g<=c;++g){var h=l+4+g*r;if(g==c||i(h)==0){var m=h-d,y=n(d,m);f===void 0?f=y:(f+=String.fromCharCode(0),f+=y),d=h+r}}return oe(l),f},toWireType:(l,c)=>{typeof c!="string"&&C(`Cannot pass non-string to C++ string type ${t}`);var f=s(c),d=Tr(4+f+r);return F[d>>2]=f/r,o(c,d+4,f+r),l!==null&&l.push(oe,d),d},argPackAdvance:se,readValueFromPointer:er,destructorFunction(l){oe(l)}})},fo=(e,r)=>{r=V(r),te(e,{isVoid:!0,name:r,argPackAdvance:0,fromWireType:()=>{},toWireType:(t,n)=>{}})},vo=1,po=()=>vo,ho=(e,r,t)=>B.copyWithin(e,r,r+t),Pr=[],mo=(e,r,t,n)=>(e=Pr[e],r=he.toValue(r),e(null,r,t,n)),go=e=>{var r=Pr.length;return Pr.push(e),r},mt=(e,r)=>{var t=ve[e];return t===void 0&&C(`${r} has unknown type ${dt(e)}`),t},yo=(e,r)=>{for(var t=new Array(e),n=0;n<e;++n)t[n]=mt(F[r+n*4>>2],"parameter "+n);return t},wo=Reflect.construct,_o=(e,r,t)=>{var n=[],o=e.toWireType(n,t);return n.length&&(F[r>>2]=he.toHandle(n)),o},Eo=(e,r,t)=>{var n=yo(e,r),o=n.shift();e--;var i=new Array(e),s=(c,f,d,g)=>{for(var h=0,m=0;m<e;++m)i[m]=n[m].readValueFromPointer(g+h),h+=n[m].argPackAdvance;var y=t===1?wo(f,i):f.apply(c,i);return _o(o,d,y)},l=`methodCaller<(${n.map(c=>c.name).join(", ")}) => ${o.name}>`;return go(Je(l,s))},ko=e=>{e>9&&(ne[e+1]+=1)},bo=e=>{var r=he.toValue(e);_r(r),br(e)},Ao=(e,r)=>{e=mt(e,"_emval_take_value");var t=e.readValueFromPointer(r);return he.toHandle(t)},je=(e,r)=>r+2097152>>>0<4194305-!!e?(e>>>0)+r*4294967296:NaN;function Po(e,r,t){var n=je(e,r),o=new Date(n*1e3);_[t>>2]=o.getUTCSeconds(),_[t+4>>2]=o.getUTCMinutes(),_[t+8>>2]=o.getUTCHours(),_[t+12>>2]=o.getUTCDate(),_[t+16>>2]=o.getUTCMonth(),_[t+20>>2]=o.getUTCFullYear()-1900,_[t+24>>2]=o.getUTCDay();var i=Date.UTC(o.getUTCFullYear(),0,1,0,0,0,0),s=(o.getTime()-i)/(1e3*60*60*24)|0;_[t+28>>2]=s}var Co=e=>e%4===0&&(e%100!==0||e%400===0),To=[0,31,60,91,121,152,182,213,244,274,305,335],Fo=[0,31,59,90,120,151,181,212,243,273,304,334],So=e=>{var r=Co(e.getFullYear()),t=r?To:Fo,n=t[e.getMonth()]+e.getDate()-1;return n};function Do(e,r,t){var n=je(e,r),o=new Date(n*1e3);_[t>>2]=o.getSeconds(),_[t+4>>2]=o.getMinutes(),_[t+8>>2]=o.getHours(),_[t+12>>2]=o.getDate(),_[t+16>>2]=o.getMonth(),_[t+20>>2]=o.getFullYear()-1900,_[t+24>>2]=o.getDay();var i=So(o)|0;_[t+28>>2]=i,_[t+36>>2]=-(o.getTimezoneOffset()*60);var s=new Date(o.getFullYear(),0,1),l=new Date(o.getFullYear(),6,1).getTimezoneOffset(),c=s.getTimezoneOffset(),f=(l!=c&&o.getTimezoneOffset()==Math.min(c,l))|0;_[t+32>>2]=f}function Ro(e,r,t,n,o,i,s,l){var c=je(o,i);try{if(isNaN(c))return 61;var f=I.getStreamFromFD(n),d=a.mmap(f,e,c,r,t),g=d.ptr;return _[s>>2]=d.allocated,F[l>>2]=g,0}catch(h){if(typeof a=="undefined"||h.name!=="ErrnoError")throw h;return-h.errno}}function Mo(e,r,t,n,o,i,s){var l=je(i,s);try{var c=I.getStreamFromFD(o);t&2&&I.doMsync(e,c,r,n,l)}catch(f){if(typeof a=="undefined"||f.name!=="ErrnoError")throw f;return-f.errno}}var $o=(e,r,t,n)=>{var o=new Date().getFullYear(),i=new Date(o,0,1),s=new Date(o,6,1),l=i.getTimezoneOffset(),c=s.getTimezoneOffset(),f=Math.max(l,c);F[e>>2]=f*60,_[r>>2]=+(l!=c);var d=m=>m.toLocaleTimeString(void 0,{hour12:!1,timeZoneName:"short"}).split(" ")[1],g=d(i),h=d(s);c<l?(de(g,t,17),de(h,n,17)):(de(g,n,17),de(h,t,17))},Oo=()=>Date.now(),gt=()=>2147483648,Wo=()=>gt(),yt;yt=()=>performance.now();var jo=e=>{var r=Be.buffer,t=(e-r.byteLength+65535)/65536;try{return Be.grow(t),Ur(),1}catch(n){}},Io=e=>{var r=B.length;e>>>=0;var t=gt();if(e>t)return!1;for(var n=(c,f)=>c+(f-c%f)%f,o=1;o<=4;o*=2){var i=r*(1+.2/o);i=Math.min(i,e+100663296);var s=Math.min(t,n(Math.max(e,i),65536)),l=jo(s);if(l)return!0}return!1},Cr={},No=()=>me||"./this.program",Ie=()=>{if(!Ie.strings){var e=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:e,_:No()};for(var t in Cr)Cr[t]===void 0?delete r[t]:r[t]=Cr[t];var n=[];for(var t in r)n.push(`${t}=${r[t]}`);Ie.strings=n}return Ie.strings},xo=(e,r)=>{for(var t=0;t<e.length;++t)U[r++]=e.charCodeAt(t);U[r]=0},Uo=(e,r)=>{var t=0;return Ie().forEach((n,o)=>{var i=r+t;F[e+o*4>>2]=i,xo(n,i),t+=n.length+1}),0},Lo=(e,r)=>{var t=Ie();F[e>>2]=t.length;var n=0;return t.forEach(o=>n+=o.length+1),F[r>>2]=n,0},Ho=0,Bo=()=>Gt||Ho>0,zo=e=>{var r;ur=e,Bo()||((r=u.onExit)==null||r.call(u,e),lr=!0),Ce(e,new qt(e))},Vo=(e,r)=>{ur=e,zo(e)},qo=Vo;function Go(e){try{var r=I.getStreamFromFD(e);return a.close(r),0}catch(t){if(typeof a=="undefined"||t.name!=="ErrnoError")throw t;return t.errno}}function Ko(e,r){try{var t=0,n=0,o=0,i=I.getStreamFromFD(e),s=i.tty?2:a.isDir(i.mode)?3:a.isLink(i.mode)?7:4;return U[r]=s,ee[r+2>>1]=o,j=[t>>>0,(E=t,+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],_[r+8>>2]=j[0],_[r+12>>2]=j[1],j=[n>>>0,(E=n,+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],_[r+16>>2]=j[0],_[r+20>>2]=j[1],0}catch(l){if(typeof a=="undefined"||l.name!=="ErrnoError")throw l;return l.errno}}var Xo=(e,r,t,n)=>{for(var o=0,i=0;i<t;i++){var s=F[r>>2],l=F[r+4>>2];r+=8;var c=a.read(e,U,s,l,n);if(c<0)return-1;if(o+=c,c<l)break;typeof n!="undefined"&&(n+=c)}return o};function Yo(e,r,t,n){try{var o=I.getStreamFromFD(e),i=Xo(o,r,t);return F[n>>2]=i,0}catch(s){if(typeof a=="undefined"||s.name!=="ErrnoError")throw s;return s.errno}}function Qo(e,r,t,n,o){var i=je(r,t);try{if(isNaN(i))return 61;var s=I.getStreamFromFD(e);return a.llseek(s,i,n),j=[s.position>>>0,(E=s.position,+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],_[o>>2]=j[0],_[o+4>>2]=j[1],s.getdents&&i===0&&n===0&&(s.getdents=null),0}catch(l){if(typeof a=="undefined"||l.name!=="ErrnoError")throw l;return l.errno}}var Jo=(e,r,t,n)=>{for(var o=0,i=0;i<t;i++){var s=F[r>>2],l=F[r+4>>2];r+=8;var c=a.write(e,U,s,l,n);if(c<0)return-1;o+=c,typeof n!="undefined"&&(n+=c)}return o};function Zo(e,r,t,n){try{var o=I.getStreamFromFD(e),i=Jo(o,r,t);return F[n>>2]=i,0}catch(s){if(typeof a=="undefined"||s.name!=="ErrnoError")throw s;return s.errno}}var ea=a.createPath,ra=e=>a.unlink(e),ta=a.createLazyFile,na=a.createDevice;a.createPreloadedFile=Zr,a.staticInit(),u.FS_createPath=a.createPath,u.FS_createDataFile=a.createDataFile,u.FS_createPreloadedFile=a.createPreloadedFile,u.FS_unlink=a.unlink,u.FS_createLazyFile=a.createLazyFile,u.FS_createDevice=a.createDevice,hn(),Ee=u.BindingError=class extends Error{constructor(r){super(r),this.name="BindingError"}},tt=u.InternalError=class extends Error{constructor(r){super(r),this.name="InternalError"}},Tn(),bn(),Wn(),ft=u.UnboundTypeError=xn(Error,"UnboundTypeError"),Gn();var oa={a:Yt,q:an,M:sn,P:ln,I:un,r:cn,G:fn,N:dn,S:vn,D:pn,U:gn,e:Un,s:Hn,n:Bn,g:zn,m:Vn,T:pt,v:Yn,i:Qn,c:Zn,b:eo,x:ro,o:to,u:no,l:co,V:fo,Q:po,R:ho,X:mo,d:br,Y:Eo,w:ko,W:bo,h:Ao,A:Po,B:Do,y:Ro,z:Mo,H:$o,t:Oo,F:Wo,j:yt,E:Io,K:Uo,L:Lo,f:qo,k:Go,J:Ko,O:Yo,C:Qo,p:Zo},N=Vt(),aa=()=>(aa=N._)(),wt=e=>(wt=N.$)(e),Tr=e=>(Tr=N.ba)(e),oe=e=>(oe=N.ca)(e),_t=(e,r)=>(_t=N.da)(e,r),Et=e=>(Et=N.ea)(e),ia=u.dynCall_jjj=(e,r,t,n,o)=>(ia=u.dynCall_jjj=N.fa)(e,r,t,n,o),sa=u.dynCall_iiiijj=(e,r,t,n,o,i,s,l)=>(sa=u.dynCall_iiiijj=N.ga)(e,r,t,n,o,i,s,l),la=u.dynCall_viijj=(e,r,t,n,o,i,s)=>(la=u.dynCall_viijj=N.ha)(e,r,t,n,o,i,s),ua=u.dynCall_viiijjjj=(e,r,t,n,o,i,s,l,c,f,d,g)=>(ua=u.dynCall_viiijjjj=N.ia)(e,r,t,n,o,i,s,l,c,f,d,g),ca=u.dynCall_iji=(e,r,t,n)=>(ca=u.dynCall_iji=N.ja)(e,r,t,n),fa=u.dynCall_jiji=(e,r,t,n,o)=>(fa=u.dynCall_jiji=N.ka)(e,r,t,n,o),da=u.dynCall_viijii=(e,r,t,n,o,i,s)=>(da=u.dynCall_viijii=N.la)(e,r,t,n,o,i,s),va=u.dynCall_iiiiij=(e,r,t,n,o,i,s)=>(va=u.dynCall_iiiiij=N.ma)(e,r,t,n,o,i,s),pa=u.dynCall_iiiiijj=(e,r,t,n,o,i,s,l,c)=>(pa=u.dynCall_iiiiijj=N.na)(e,r,t,n,o,i,s,l,c),ha=u.dynCall_iiiiiijj=(e,r,t,n,o,i,s,l,c,f)=>(ha=u.dynCall_iiiiiijj=N.oa)(e,r,t,n,o,i,s,l,c,f);u.addRunDependency=Ve,u.removeRunDependency=Se,u.FS_createPreloadedFile=Zr,u.FS_unlink=ra,u.FS_createPath=ea,u.FS_createDevice=na,u.FS_createDataFile=Jr,u.FS_createLazyFile=ta;var or;Fe=function e(){or||kt(),or||(Fe=e)};function kt(){if(fe>0||(Ot(),fe>0))return;function e(){var r;or||(or=!0,u.calledRun=!0,!lr&&(Wt(),M(u),(r=u.onRuntimeInitialized)==null||r.call(u),jt()))}u.setStatus?(u.setStatus("Running..."),setTimeout(function(){setTimeout(function(){u.setStatus("")},1),e()},1)):e()}if(u.preInit)for(typeof u.preInit=="function"&&(u.preInit=[u.preInit]);u.preInit.length>0;)u.preInit.pop()();return kt(),w=G,w}})();typeof Dt=="object"&&typeof Sr=="object"?Sr.exports=Fr:typeof define=="function"&&define.amd&&define([],()=>Fr);Fr.getUrl=function(T){return"https://st.mycdn.me/static/audio-processing/0-0-8/"+T}});var Fa={};ka(Fa,{EffectVmojiLmarksAi:()=>Ae,EffectVmojiLmarksVolume:()=>be,EffectVoiceChange:()=>Pe,EffectVoiceChangeMode:()=>Or,PerformanceMonitorMode:()=>Mr,VoiceChangeEffectType:()=>Wr});module.exports=ba(Fa);var Le=class{constructor(p,v="AudioEffects"){this.loggerFunction=p,this.loggerName=v}debug(...p){this.loggerFunction("DEBUG",`[${this.loggerName}]`,...p)}log(...p){this.loggerFunction("LOG",`[${this.loggerName}]`,...p)}warn(...p){this.loggerFunction("WARN",`[${this.loggerName}]`,...p)}error(...p){this.loggerFunction("ERROR",`[${this.loggerName}]`,...p)}};function ir(T,p=[]){let v=p.join(","),w=typeof T=="string"?[T,`exports.default(${v});`]:[`(${T})(${v});`],u=new Blob(w,{type:"application/javascript; charset=utf-8"});return window.URL.createObjectURL(u)}var ke=class{constructor(){this.outputStream=null;this.isInitialized=!1;this.audioContext=null;this.workletNode=null;this.sourceNode=null;this.logger=new Le(()=>{})}init(L){return J(this,arguments,function*({sampleRate:p,isOutputAudio:v=!1,isOutputStream:w=!1,workletFunction:u,workletName:M}){if(this.logger.debug("init"),this.createAudioContext(p),yield this.createWorklet(u,M),this.workletNode&&this.audioContext&&(v&&(this.workletNode.connect(this.audioContext.destination),this.logger.debug("connected to standart audio output")),w)){let G=this.audioContext.createMediaStreamDestination();this.workletNode.connect(G),this.outputStream=G.stream,this.logger.debug("connected to output MediaStream")}this.isInitialized=!0})}setSource(p){var v;if(this.audioContext&&this.workletNode){let w=null;if(p){let u=new MediaStream(p instanceof MediaStreamTrack?[p]:p.getAudioTracks().filter(M=>M.contentHint!=="music"));w=this.audioContext.createMediaStreamSource(u)}(v=this.sourceNode)==null||v.disconnect(this.workletNode),w==null||w.connect(this.workletNode),this.sourceNode=w,this.logger.debug("source "+(p?"set":"set to null"))}}destroy(){var p;this.logger.debug("destroy"),(p=this.audioContext)==null||p.close(),this.workletNode=null,this.sourceNode=null,this.audioContext=null,this.outputStream=null,this.isInitialized=!1}resume(){var p;this.logger.debug("resume"),(p=this.audioContext)==null||p.resume()}pause(){var p;this.logger.debug("pause"),(p=this.audioContext)==null||p.suspend()}setLogger(p=()=>{},v){this.logger=new Le(p,v)}static isSupported(){try{let p=window;return!!(p.WebAssembly&&p.Worker&&(p.AudioContext||p.webkitAudioContext)&&p.AudioWorkletNode)}catch(p){return!1}}createAudioContext(p){let v=window.AudioContext||window.webkitAudioContext,w=new v(p?{sampleRate:p}:{});this.audioContext=w,this.logger.debug("created AudioContext")}createWorklet(p,v){return J(this,null,function*(){if(this.logger.debug(`${v} init started`),!this.audioContext)return;yield this.audioContext.audioWorklet.addModule(ir(p));let w=new AudioWorkletNode(this.audioContext,v);return this.workletNode=w,new Promise(u=>{w.port.onmessage=({data:M})=>{switch(M.type){case"init":{this.logger.debug(`${v} init success`),u();break}case"data":{this.onWorkletData(M.data);break}}}})})}sendDataToWorklet(p,v=[]){var w;(w=this.workletNode)==null||w.port.postMessage(p,v)}};function St(){let K=[.26691192,.5013858,.3037737,.58564115,.35116732,.67516255,.41435885,.7225562,.4775504,.7752158,.5881356,.79627967,.68818885,.7594179,.75138044,.7120243,.8040401,.65936464,.85143363,.57510924,.8777635,.4855879,.4512206,.58564115,.5038802,.56457734,.5512739,.5540454,.5776037,.56457734,.60393345,.5540454,.66712505,.56457734,.70398676,.57510924,.65132713,.606705,.6144654,.6172369,.5776037,.6172369,.5407419,.6172369,.5038802,.606705,.46701849,.58564115,.5407419,.58564115,.5776037,.58564115,.6144654,.58564115,.68818885,.57510924,.6144654,.58564115,.5776037,.58564115,.5407419,.58564115],Z=K[59],jr=1-K[59];class He extends AudioWorkletProcessor{constructor(){super();this.lastTime=0;this.frameSampleCount=0;this.frameSampleAverage=0;this.maxInputVolume=.3;this.sequence=0;this.port.postMessage({type:"init"})}process(me){var ge;let Ce=currentTime,X=0,ce=(ge=me==null?void 0:me[0])==null?void 0:ge[0];if(ce!=null&&ce.length&&(X=ce.reduce((ae,z)=>ae+Math.abs(z),0)/ce.length),this.frameSampleAverage=(this.frameSampleAverage*this.frameSampleCount+X)/(this.frameSampleCount+1),this.frameSampleCount+=1,Ce-this.lastTime>1/25){let Y=[];for(let z=0;z<31*2;z+=1)Y.push(K[z]);this.frameSampleAverage>.015&&(Y[59]=this.frameSampleAverage/this.maxInputVolume>.5?this.sequence%2===0?this.frameSampleAverage/2:this.frameSampleAverage:this.frameSampleAverage,Y[59]=Z+jr*Y[59]/.5),this.sequence+=1,this.frameSampleCount=1,this.maxInputVolume=Math.max(this.maxInputVolume,this.frameSampleAverage),this.lastTime=Ce;let ae=new Float32Array(Y).buffer;this.port.postMessage({type:"data",data:ae},[ae])}return!0}}registerProcessor("vmojiLmarksVolumeWorklet",He)}var be=class extends ke{constructor(){super(...arguments);this.onData=()=>{}}init(){return J(this,null,function*(){yield le(be.prototype,this,"init").call(this,{workletFunction:St,workletName:"vmojiLmarksVolumeWorklet"})})}onWorkletData(v){this.onData(v)}};var Rr=Tt(Dr());var ue=class extends ke{constructor(){super(...arguments);this.worker=null;this.performanceMonitor=null}init(v){return J(this,null,function*(){yield le(ue.prototype,this,"init").call(this,v),this.isInitialized=!1,yield this.createWorker(v.workerFunctionString,v.workerArgs),this.isInitialized=!0})}resume(){var v;super.resume(),(v=this.performanceMonitor)==null||v.start()}pause(){var v;super.pause(),(v=this.performanceMonitor)==null||v.stop()}setLogger(v,w){var u;super.setLogger(v,w),(u=this.performanceMonitor)==null||u.setLogger(this.logger)}destroy(){var v,w;super.destroy(),(v=this.performanceMonitor)==null||v.stop(),(w=this.worker)==null||w.terminate(),this.worker=null}sendDataToWorker(v,w=[]){var u;(u=this.worker)==null||u.postMessage(v,w)}static isSupported(){try{let v=window;return!!(super.isSupported()&&v.Worker)}catch(v){return!1}}createWorker(v,w=[]){return new Promise((u,M)=>{this.logger.debug("worker init started"),this.worker=new Worker(ir(v,w)),this.worker.onmessage=({data:L})=>{switch(L.type){case"init":{this.logger.debug("worker init success"),u();break}case"error":{this.logger.error(L.error),M(L.error);break}case"data":{this.onWorkerData(L.data);break}case"debug":{this.logger.debug(L.message);break}}}})}};function Rt(){class T extends AudioWorkletProcessor{constructor(){super(),this.port.postMessage({type:"init"})}process(v){var w;return(w=v==null?void 0:v[0])!=null&&w[0]&&this.port.postMessage({type:"data",data:v[0][0].buffer},[v[0][0].buffer]),!0}}registerProcessor("pureWorklet",T)}var Aa=16e3,Ae=class extends ue{constructor(){super(...arguments);this.onData=()=>{}}init(){return J(this,null,function*(){yield le(Ae.prototype,this,"init").call(this,{sampleRate:Aa,workletFunction:Rt,workletName:"pureWorklet",workerFunctionString:`"use strict";var exports=(()=>{var p=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var b=(o,t)=>{for(var e in t)p(o,e,{get:t[e],enumerable:!0})},y=(o,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of f(t))!w.call(o,i)&&i!==e&&p(o,i,{get:()=>t[i],enumerable:!(n=m(t,i))||n.enumerable});return o};var A=o=>y(p({},"__esModule",{value:!0}),o);var x={};b(x,{default:()=>v});var v=(o,t)=>{let e=null,n=null;function i(){return o({locateFile:t}).then(r=>{e=r;let l=new e.ConfigInput("animoji_v4.cfg",!0,"/"),s=new e.Config(l);n=e.AnimojiFactory.createAlgorithm(s)})}function g(r){self.postMessage({type:"error",error:typeof r=="number"&&e?e.getExMessage(r):r})}function k(r){var l;if(!(!e||!n))try{let s=new e.vector$float$,h=new Float32Array(r);for(let u of h)s.push_back(u);let a=e.animate(n,s),d=(l=a==null?void 0:a.size)==null?void 0:l.call(a);if(!d)return;let c=new Float32Array(d);for(let u=0;u<d;u++)c[u]=a.get(u);self.postMessage({type:"data",data:c.buffer},[c.buffer])}catch(s){g(s)}}i().then(()=>{self.onmessage=r=>{k(r.data.data)},self.postMessage({type:"init"})}).catch(g)};return A(x);})();
|
|
9
|
+
`,workerArgs:[Rr.default,Rr.default.getUrl]})})}onWorkletData(v){this.sendDataToWorker({data:v},[v])}onWorkerData(v){this.onData(v)}static isSupported(){try{let v=super.isSupported(),w=/firefox/i.test(navigator.userAgent);return v&&!w}catch(v){return!1}}};var $r=Tt(Dr());function Mt(){class T extends AudioWorkletProcessor{constructor(){super();this.samplesQueue=new Float32Array;this.lastFrameTime=0;this.port.postMessage({type:"init"}),this.port.onmessage=({data:{data:w}})=>{let u=new Float32Array(w);currentTime-this.lastFrameTime>=.1&&(this.samplesQueue=new Float32Array);let M=new Float32Array(this.samplesQueue.length+u.length);M.set(this.samplesQueue,0),M.set(u,this.samplesQueue.length),this.samplesQueue=M,this.lastFrameTime=currentTime}}process(w,u){var M;return(M=w==null?void 0:w[0])!=null&&M[0]&&this.port.postMessage({type:"data",data:w[0][0].buffer},[w[0][0].buffer]),this.samplesQueue.length>=128&&(u[0].forEach(G=>{G.set(this.samplesQueue.subarray(0,128))}),this.samplesQueue=this.samplesQueue.slice(128)),!0}}registerProcessor("voiceChangeWorklet",T)}var Pa=1.4,Ca=1e3,Mr=(v=>(v.PEAK="peak",v.AVG="avg",v))(Mr||{}),sr=class{constructor({badPerformanceThreshold:p=Pa,measureIntervalMs:v=Ca,mode:w="avg",logPerformanceChecks:u=!1,onBadPerformanceCb:M}){this.logger=null;this.interval=0;this.beginMarkTs=0;this.performanceMeasures=[];this.threshold=p,this.intervalMs=v,this.mode=w,this.logPerformanceChecks=u,this.onBadPerformanceCb=M}check(){var p,v,w;if(this.mode==="peak"){let u=Math.max(...this.performanceMeasures);this.logPerformanceChecks&&((p=this.logger)==null||p.debug("performanceMonitor check peak measure:",u.toFixed(2))),u>this.threshold&&this.onBadPerformanceCb(u)}else{let M=this.performanceMeasures.reduce((L,G)=>L+G,0)/this.performanceMeasures.length||0;this.logPerformanceChecks&&((v=this.logger)==null||v.debug("performanceMonitor check measure avg:",M.toFixed(2)),(w=this.logger)==null||w.debug("performanceMonitor check measure arr:",JSON.stringify(this.performanceMeasures))),M>=this.threshold&&this.onBadPerformanceCb(M)}this.performanceMeasures=[]}markBegin(){this.beginMarkTs||(this.beginMarkTs=Date.now())}markEnd(){this.beginMarkTs&&(this.performanceMeasures.push(Date.now()-this.beginMarkTs),this.beginMarkTs=0)}start(){var p;this.interval||(this.interval=window.setInterval(this.check.bind(this),this.intervalMs),this.performanceMeasures=[],this.beginMarkTs=0,(p=this.logger)==null||p.debug("performanceMonitor started"))}stop(){var p;this.interval&&(window.clearInterval(this.interval),this.interval=0,(p=this.logger)==null||p.debug("performanceMonitor stopped"))}setLogger(p){this.logger=p}};var Or=(v=>(v.PLAYBACK="playback",v.OUTPUT_STREAM="output_stream",v))(Or||{}),Wr=(H=>(H.BALLOON="balloon",H.CATHEDRAL="cathedral",H.CHORUS="chorus",H.DISTORTION="distortion",H.ECHO="echo",H.EVIL="evil",H.GIANT="giant",H.HALL="hall",H.PHASER="phaser",H.ROBOT="robot",H.SQUIRELL="squirell",H.DENOISE="denoise",H))(Wr||{}),Ta=44100,Pe=class extends ue{constructor(v="playback",w){super();this.mode=v,w&&(this.performanceMonitor=new sr(w))}init(){return J(this,null,function*(){yield le(Pe.prototype,this,"init").call(this,{sampleRate:Ta,isOutputAudio:this.mode==="playback",isOutputStream:this.mode==="output_stream",workletFunction:Mt,workletName:"voiceChangeWorklet",workerFunctionString:'"use strict";var exports=(()=>{var p=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var W=(n,r)=>{for(var t in r)p(n,t,{get:r[t],enumerable:!0})},A=(n,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let c of y(r))!b.call(n,c)&&c!==t&&p(n,c,{get:()=>r[c],enumerable:!(i=w(r,c))||i.enumerable});return n};var R=n=>A(p({},"__esModule",{value:!0}),n);var E={};W(E,{VoiceChangeWorkerRequestType:()=>f,default:()=>C});var f=(t=>(t.SET_EFFECTS="set_effects",t.DATA="data",t))(f||{}),C=(n,r)=>{let t=null,i=[];function c(){return n({locateFile:r}).then(e=>{t=e})}function h(e,a=!1){if(t)try{for(let o of e){let g=`${o}${a?".cfg":""}`,u=new t.ConfigInput(g,a,"/"),l=new t.Config(u),s=t.EffectFactory.createAlgorithm(l);i.push({configInput:u,config:l,effect:s})}}catch(o){self.postMessage({type:"debug",message:"before error "+JSON.stringify(i)}),d("setEffects error:",o)}}function k(){try{for(let e of i)e.configInput.delete(),e.config.delete(),e.effect.delete()}catch(e){d("clearEffects error:",e)}i=[]}function d(e,a){self.postMessage({type:"error",error:typeof a=="number"&&t?t.getExMessage(a):e+a})}function m(e){var a;if(!(!t||!i.length))try{let o=new t.vector$float$,g=new Float32Array(e);for(let s of g)o.push_back(s);for(let{effect:s}of i)o=t.applyEffect(s,o);let u=(a=o==null?void 0:o.size)==null?void 0:a.call(o);if(!u)return;let l=new Float32Array(u);for(let s=0;s<u;s++)l[s]=o.get(s);self.postMessage({type:"data",data:l.buffer},[l.buffer])}catch(o){d("requestSamples error:",o)}}c().then(()=>{self.onmessage=({data:e})=>{switch(e.type){case"set_effects":{k(),h(e.effects,e.isPreset);break}case"data":{m(e.data);break}}},self.postMessage({type:"init"})}).catch(e=>d("init error:",e))};return R(E);})();\n',workerArgs:[$r.default,$r.default.getUrl]})})}setEffects(v,w){this.logger.debug("setEffects",v,w),this.sendDataToWorker({type:"set_effects",effects:v,isPreset:w})}onWorkletData(v){var w;(w=this.performanceMonitor)==null||w.markBegin(),this.sendDataToWorker({type:"data",data:v},[v])}onWorkerData(v){var w;(w=this.performanceMonitor)==null||w.markEnd(),this.sendDataToWorklet({data:v},[v])}};
|
package/audio-effects.esm.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/calls-audio-effects v1.2.
|
|
3
|
-
*
|
|
2
|
+
* @vkontakte/calls-audio-effects v1.2.3
|
|
3
|
+
* Wed, 17 Jul 2024 10:08:31 GMT
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
var ha=Object.create;var Et=Object.defineProperty;var ma=Object.getOwnPropertyDescriptor;var ga=Object.getOwnPropertyNames;var kt=Object.getPrototypeOf,ya=Object.prototype.hasOwnProperty;var wa=Reflect.get;var _a=(R,h)=>()=>(h||R((h={exports:{}}).exports,h),h.exports);var Ea=(R,h,v,w)=>{if(h&&typeof h=="object"||typeof h=="function")for(let u of ga(h))!ya.call(R,u)&&u!==v&&Et(R,u,{get:()=>h[u],enumerable:!(w=ma(h,u))||w.enumerable});return R};var bt=(R,h,v)=>(v=R!=null?ha(kt(R)):{},Ea(h||!R||!R.__esModule?Et(v,"default",{value:R,enumerable:!0}):v,R));var le=(R,h,v)=>wa(kt(R),v,h);var Z=(R,h,v)=>new Promise((w,u)=>{var W=G=>{try{X(v.next(G))}catch(J){u(J)}},L=G=>{try{X(v.throw(G))}catch(J){u(J)}},X=G=>G.done?w(G.value):Promise.resolve(G.value).then(W,L);X((v=v.apply(R,h)).next())});var Sr=_a((Ct,Fr)=>{var Tr=(()=>{var h;var R=typeof document!="undefined"?(h=document.currentScript)==null?void 0:h.src:void 0;return function(v={}){var w,u=v,W,L,X=new Promise((e,r)=>{W=e,L=r}),G=typeof window=="object",J=typeof importScripts=="function",$r=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";u.expectedDataFileDownloads||(u.expectedDataFileDownloads=0),u.expectedDataFileDownloads++,(()=>{var e=typeof ENVIRONMENT_IS_PTHREAD!="undefined"&&ENVIRONMENT_IS_PTHREAD,r=typeof ENVIRONMENT_IS_WASM_WORKER!="undefined"&&ENVIRONMENT_IS_WASM_WORKER;if(e||r)return;function t(n){var o="";typeof window=="object"?o=window.encodeURIComponent(window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/"):typeof process=="undefined"&&typeof location!="undefined"&&(o=encodeURIComponent(location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"));var i="wasm_bindings.data",s="wasm_bindings.data";typeof u.locateFilePackage=="function"&&!u.locateFile&&(u.locateFile=u.locateFilePackage,z("warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)"));var l=u.locateFile?u.locateFile(s,""):s,c=n.remote_package_size;function f(y,P,D,F){var b=new XMLHttpRequest;b.open("GET",y,!0),b.responseType="arraybuffer",b.onprogress=function(A){var wt,_t;var M=y,S=P;if(A.total&&(S=A.total),A.loaded){b.addedTotal?u.dataFileDownloads[M].loaded=A.loaded:(b.addedTotal=!0,u.dataFileDownloads||(u.dataFileDownloads={}),u.dataFileDownloads[M]={loaded:A.loaded,total:S});var x=0,O=0,We=0;for(var je in u.dataFileDownloads){var Ie=u.dataFileDownloads[je];x+=Ie.total,O+=Ie.loaded,We++}x=Math.ceil(x*u.expectedDataFileDownloads/We),(wt=u.setStatus)==null||wt.call(u,`Downloading data... (${O}/${x})`)}else u.dataFileDownloads||(_t=u.setStatus)==null||_t.call(u,"Downloading data...")},b.onerror=function(A){throw new Error("NetworkError for: "+y)},b.onload=function(A){if(b.status==200||b.status==304||b.status==206||b.status==0&&b.response){var M=b.response;D(M)}else throw new Error(b.statusText+" : "+b.responseURL)},b.send(null)}function d(y){console.error("package error:",y)}var g=null,p=u.getPreloadedPackage?u.getPreloadedPackage(l,c):null;p||f(l,c,function(y){g?(g(y),g=null):p=y},d);function m(y){function P(M,S){if(!M)throw S+new Error().stack}function D(M,S,x){this.start=M,this.end=S,this.audio=x}D.prototype={requests:{},open:function(M,S){this.name=S,this.requests[S]=this,y.addRunDependency(`fp ${this.name}`)},send:function(){},onload:function(){var M=this.byteArray.subarray(this.start,this.end);this.finish(M)},finish:function(M){var S=this;y.FS_createDataFile(this.name,null,M,!0,!0,!0),y.removeRunDependency(`fp ${S.name}`),this.requests[this.name]=null}};for(var F=n.files,b=0;b<F.length;++b)new D(F[b].start,F[b].end,F[b].audio||0).open("GET",F[b].filename);function A(M){P(M,"Loading data file failed."),P(M.constructor.name===ArrayBuffer.name,"bad input to processPackageData");var S=new Uint8Array(M);D.prototype.byteArray=S;for(var x=n.files,O=0;O<x.length;++O)D.prototype.requests[x[O].filename].onload();y.removeRunDependency("datafile_wasm_bindings.data")}y.addRunDependency("datafile_wasm_bindings.data"),y.preloadResults||(y.preloadResults={}),y.preloadResults[i]={fromCache:!1},p?(A(p),p=null):g=A}u.calledRun?m(u):(u.preRun||(u.preRun=[]),u.preRun.push(m))}t({files:[{filename:"/animoji_v4.cfg",start:0,end:333},{filename:"/balloon.cfg",start:333,end:409},{filename:"/cathedral.cfg",start:409,end:586},{filename:"/chorus.cfg",start:586,end:865},{filename:"/denoise.cfg",start:865,end:3258},{filename:"/df2_lstm_full_silent.tflite",start:3258,end:3169978},{filename:"/distortion.cfg",start:3169978,end:3170120},{filename:"/echo.cfg",start:3170120,end:3170257},{filename:"/evil.cfg",start:3170257,end:3170398},{filename:"/giant.cfg",start:3170398,end:3170474},{filename:"/hall.cfg",start:3170474,end:3170647},{filename:"/phaser.cfg",start:3170647,end:3170747},{filename:"/robot.cfg",start:3170747,end:3170887},{filename:"/squirell.cfg",start:3170887,end:3170963},{filename:"/wav2lip_lite_rec-v4-v2.tflite",start:3170963,end:7456043}],remote_package_size:7456043})})();var He=null,H=Object.assign({},u),Mr=[],me="./this.program",be=(e,r)=>{throw r},K="";function ce(e){return u.locateFile?u.locateFile(e,K):K+e}var ge,Y;(G||J)&&(J?K=self.location.href:typeof document!="undefined"&&document.currentScript&&(K=document.currentScript.src),He&&(K=He),K.startsWith("blob:")?K="":K=K.substr(0,K.replace(/[?#].*/,"").lastIndexOf("/")+1),J&&(Y=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),ge=e=>fetch(e,{credentials:"same-origin"}).then(r=>r.ok?r.arrayBuffer():Promise.reject(new Error(r.status+" : "+r.url))));var ae=u.print||console.log.bind(console),z=u.printErr||console.error.bind(console);Object.assign(u,H),H=null,u.arguments&&(Mr=u.arguments),u.thisProgram&&(me=u.thisProgram),u.quit&&(be=u.quit);var Ae;u.wasmBinary&&(Ae=u.wasmBinary);var Be,sr=!1,lr,U,B,ee,ze,_,T,Or,Wr;function jr(){var e=Be.buffer;u.HEAP8=U=new Int8Array(e),u.HEAP16=ee=new Int16Array(e),u.HEAPU8=B=new Uint8Array(e),u.HEAPU16=ze=new Uint16Array(e),u.HEAP32=_=new Int32Array(e),u.HEAPU32=T=new Uint32Array(e),u.HEAPF32=Or=new Float32Array(e),u.HEAPF64=Wr=new Float64Array(e)}var Ir=[],Nr=[],xr=[],$t=!1;function Mt(){if(u.preRun)for(typeof u.preRun=="function"&&(u.preRun=[u.preRun]);u.preRun.length;)jt(u.preRun.shift());fr(Ir)}function Ot(){$t=!0,!u.noFSInit&&!a.init.initialized&&a.init(),a.ignorePermissions=!1,ie.init(),fr(Nr)}function Wt(){if(u.postRun)for(typeof u.postRun=="function"&&(u.postRun=[u.postRun]);u.postRun.length;)Nt(u.postRun.shift());fr(xr)}function jt(e){Ir.unshift(e)}function It(e){Nr.unshift(e)}function Nt(e){xr.unshift(e)}var fe=0,ur=null,Pe=null;function Ca(e){return e}function Ve(e){var r;fe++,(r=u.monitorRunDependencies)==null||r.call(u,fe)}function Ce(e){var t;if(fe--,(t=u.monitorRunDependencies)==null||t.call(u,fe),fe==0&&(ur!==null&&(clearInterval(ur),ur=null),Pe)){var r=Pe;Pe=null,r()}}function cr(e){var t;(t=u.onAbort)==null||t.call(u,e),e="Aborted("+e+")",z(e),sr=!0,lr=1,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw L(r),r}var xt="data:application/octet-stream;base64,",Ur=e=>e.startsWith(xt);function Ut(){var e="wasm_bindings.wasm";return Ur(e)?e:ce(e)}var qe;function Lr(e){if(e==qe&&Ae)return new Uint8Array(Ae);if(Y)return Y(e);throw"both async and sync fetching of the wasm failed"}function Lt(e){return Ae?Promise.resolve().then(()=>Lr(e)):ge(e).then(r=>new Uint8Array(r),()=>Lr(e))}function Hr(e,r,t){return Lt(e).then(n=>WebAssembly.instantiate(n,r)).then(t,n=>{z(`failed to asynchronously prepare wasm: ${n}`),cr(n)})}function Ht(e,r,t,n){return!e&&typeof WebAssembly.instantiateStreaming=="function"&&!Ur(r)&&typeof fetch=="function"?fetch(r,{credentials:"same-origin"}).then(o=>{var i=WebAssembly.instantiateStreaming(o,t);return i.then(n,function(s){return z(`wasm streaming compile failed: ${s}`),z("falling back to ArrayBuffer instantiation"),Hr(r,t,n)})}):Hr(r,t,n)}function Bt(){return{a:na}}function zt(){var e=Bt();function r(n,o){return N=n.exports,Be=N.Z,jr(),at=N.aa,It(N._),Ce("wasm-instantiate"),N}Ve("wasm-instantiate");function t(n){r(n.instance)}if(u.instantiateWasm)try{return u.instantiateWasm(e,r)}catch(n){z(`Module.instantiateWasm callback failed with error: ${n}`),L(n)}return qe||(qe=Ut()),Ht(Ae,qe,e,t).catch(L),{}}var E,j;function Vt(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var fr=e=>{for(;e.length>0;)e.shift()(u)},qt=u.noExitRuntime||!0;class Gt{constructor(r){this.excPtr=r,this.ptr=r-24}set_type(r){T[this.ptr+4>>2]=r}get_type(){return T[this.ptr+4>>2]}set_destructor(r){T[this.ptr+8>>2]=r}get_destructor(){return T[this.ptr+8>>2]}set_caught(r){r=r?1:0,U[this.ptr+12]=r}get_caught(){return U[this.ptr+12]!=0}set_rethrown(r){r=r?1:0,U[this.ptr+13]=r}get_rethrown(){return U[this.ptr+13]!=0}init(r,t){this.set_adjusted_ptr(0),this.set_type(r),this.set_destructor(t)}set_adjusted_ptr(r){T[this.ptr+16>>2]=r}get_adjusted_ptr(){return T[this.ptr+16>>2]}get_exception_ptr(){var r=gt(this.get_type());if(r)return T[this.excPtr>>2];var t=this.get_adjusted_ptr();return t!==0?t:this.excPtr}}var Br=0,Kt=0,Xt=(e,r,t)=>{var n=new Gt(e);throw n.init(r,t),Br=e,Kt++,Br};function Ge(){var e=_[+I.varargs>>2];return I.varargs+=4,e}var ye=Ge,$={isAbs:e=>e.charAt(0)==="/",splitPath:e=>{var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return r.exec(e).slice(1)},normalizeArray:(e,r)=>{for(var t=0,n=e.length-1;n>=0;n--){var o=e[n];o==="."?e.splice(n,1):o===".."?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:e=>{var r=$.isAbs(e),t=e.substr(-1)==="/";return e=$.normalizeArray(e.split("/").filter(n=>!!n),!r).join("/"),!e&&!r&&(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:e=>{var r=$.splitPath(e),t=r[0],n=r[1];return!t&&!n?".":(n&&(n=n.substr(0,n.length-1)),t+n)},basename:e=>{if(e==="/")return"/";e=$.normalize(e),e=e.replace(/\/$/,"");var r=e.lastIndexOf("/");return r===-1?e:e.substr(r+1)},join:(...e)=>$.normalize(e.join("/")),join2:(e,r)=>$.normalize(e+"/"+r)},Yt=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return e=>crypto.getRandomValues(e);cr("initRandomDevice")},zr=e=>(zr=Yt())(e),re={resolve:(...e)=>{for(var r="",t=!1,n=e.length-1;n>=-1&&!t;n--){var o=n>=0?e[n]:a.cwd();if(typeof o!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!o)return"";r=o+"/"+r,t=$.isAbs(o)}return r=$.normalizeArray(r.split("/").filter(i=>!!i),!t).join("/"),(t?"/":"")+r||"."},relative:(e,r)=>{e=re.resolve(e).substr(1),r=re.resolve(r).substr(1);function t(f){for(var d=0;d<f.length&&f[d]==="";d++);for(var g=f.length-1;g>=0&&f[g]==="";g--);return d>g?[]:f.slice(d,g-d+1)}for(var n=t(e.split("/")),o=t(r.split("/")),i=Math.min(n.length,o.length),s=i,l=0;l<i;l++)if(n[l]!==o[l]){s=l;break}for(var c=[],l=s;l<n.length;l++)c.push("..");return c=c.concat(o.slice(s)),c.join("/")}},Vr=typeof TextDecoder!="undefined"?new TextDecoder:void 0,we=(e,r,t)=>{for(var n=r+t,o=r;e[o]&&!(o>=n);)++o;if(o-r>16&&e.buffer&&Vr)return Vr.decode(e.subarray(r,o));for(var i="";r<o;){var s=e[r++];if(!(s&128)){i+=String.fromCharCode(s);continue}var l=e[r++]&63;if((s&224)==192){i+=String.fromCharCode((s&31)<<6|l);continue}var c=e[r++]&63;if((s&240)==224?s=(s&15)<<12|l<<6|c:s=(s&7)<<18|l<<12|c<<6|e[r++]&63,s<65536)i+=String.fromCharCode(s);else{var f=s-65536;i+=String.fromCharCode(55296|f>>10,56320|f&1023)}}return i},dr=[],Te=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n<=127?r++:n<=2047?r+=2:n>=55296&&n<=57343?(r+=4,++t):r+=3}return r},vr=(e,r,t,n)=>{if(!(n>0))return 0;for(var o=t,i=t+n-1,s=0;s<e.length;++s){var l=e.charCodeAt(s);if(l>=55296&&l<=57343){var c=e.charCodeAt(++s);l=65536+((l&1023)<<10)|c&1023}if(l<=127){if(t>=i)break;r[t++]=l}else if(l<=2047){if(t+1>=i)break;r[t++]=192|l>>6,r[t++]=128|l&63}else if(l<=65535){if(t+2>=i)break;r[t++]=224|l>>12,r[t++]=128|l>>6&63,r[t++]=128|l&63}else{if(t+3>=i)break;r[t++]=240|l>>18,r[t++]=128|l>>12&63,r[t++]=128|l>>6&63,r[t++]=128|l&63}}return r[t]=0,t-o};function qr(e,r,t){var n=t>0?t:Te(e)+1,o=new Array(n),i=vr(e,o,0,o.length);return r&&(o.length=i),o}var Qt=()=>{if(!dr.length){var e=null;if(typeof window!="undefined"&&typeof window.prompt=="function"&&(e=window.prompt("Input: "),e!==null&&(e+=`
|
|
7
|
-
`)),!e)return null;dr=qr(e,!0)}return dr.shift()},ie={ttys:[],init(){},shutdown(){},register(e,r){ie.ttys[e]={input:[],output:[],ops:r},a.registerDevice(e,ie.stream_ops)},stream_ops:{open(e){var r=ie.ttys[e.node.rdev];if(!r)throw new a.ErrnoError(43);e.tty=r,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,r,t,n,o){if(!e.tty||!e.tty.ops.get_char)throw new a.ErrnoError(60);for(var i=0,s=0;s<n;s++){var l;try{l=e.tty.ops.get_char(e.tty)}catch(c){throw new a.ErrnoError(29)}if(l===void 0&&i===0)throw new a.ErrnoError(6);if(l==null)break;i++,r[t+s]=l}return i&&(e.node.timestamp=Date.now()),i},write(e,r,t,n,o){if(!e.tty||!e.tty.ops.put_char)throw new a.ErrnoError(60);try{for(var i=0;i<n;i++)e.tty.ops.put_char(e.tty,r[t+i])}catch(s){throw new a.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),i}},default_tty_ops:{get_char(e){return Qt()},put_char(e,r){r===null||r===10?(ae(we(e.output,0)),e.output=[]):r!=0&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(ae(we(e.output,0)),e.output=[])},ioctl_tcgets(e){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ioctl_tcsets(e,r,t){return 0},ioctl_tiocgwinsz(e){return[24,80]}},default_tty1_ops:{put_char(e,r){r===null||r===10?(z(we(e.output,0)),e.output=[]):r!=0&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(z(we(e.output,0)),e.output=[])}}},Zt=(e,r)=>(B.fill(0,e,e+r),e),Jt=(e,r)=>Math.ceil(e/r)*r,Gr=e=>{e=Jt(e,65536);var r=mt(65536,e);return r?Zt(r,e):0},k={ops_table:null,mount(e){return k.createNode(null,"/",16895,0)},createNode(e,r,t,n){if(a.isBlkdev(t)||a.isFIFO(t))throw new a.ErrnoError(63);k.ops_table||(k.ops_table={dir:{node:{getattr:k.node_ops.getattr,setattr:k.node_ops.setattr,lookup:k.node_ops.lookup,mknod:k.node_ops.mknod,rename:k.node_ops.rename,unlink:k.node_ops.unlink,rmdir:k.node_ops.rmdir,readdir:k.node_ops.readdir,symlink:k.node_ops.symlink},stream:{llseek:k.stream_ops.llseek}},file:{node:{getattr:k.node_ops.getattr,setattr:k.node_ops.setattr},stream:{llseek:k.stream_ops.llseek,read:k.stream_ops.read,write:k.stream_ops.write,allocate:k.stream_ops.allocate,mmap:k.stream_ops.mmap,msync:k.stream_ops.msync}},link:{node:{getattr:k.node_ops.getattr,setattr:k.node_ops.setattr,readlink:k.node_ops.readlink},stream:{}},chrdev:{node:{getattr:k.node_ops.getattr,setattr:k.node_ops.setattr},stream:a.chrdev_stream_ops}});var o=a.createNode(e,r,t,n);return a.isDir(o.mode)?(o.node_ops=k.ops_table.dir.node,o.stream_ops=k.ops_table.dir.stream,o.contents={}):a.isFile(o.mode)?(o.node_ops=k.ops_table.file.node,o.stream_ops=k.ops_table.file.stream,o.usedBytes=0,o.contents=null):a.isLink(o.mode)?(o.node_ops=k.ops_table.link.node,o.stream_ops=k.ops_table.link.stream):a.isChrdev(o.mode)&&(o.node_ops=k.ops_table.chrdev.node,o.stream_ops=k.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[r]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage(e,r){var t=e.contents?e.contents.length:0;if(!(t>=r)){var n=1024*1024;r=Math.max(r,t*(t<n?2:1.125)>>>0),t!=0&&(r=Math.max(r,256));var o=e.contents;e.contents=new Uint8Array(r),e.usedBytes>0&&e.contents.set(o.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,r){if(e.usedBytes!=r)if(r==0)e.contents=null,e.usedBytes=0;else{var t=e.contents;e.contents=new Uint8Array(r),t&&e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r}},node_ops:{getattr(e){var r={};return r.dev=a.isChrdev(e.mode)?e.id:1,r.ino=e.id,r.mode=e.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=e.rdev,a.isDir(e.mode)?r.size=4096:a.isFile(e.mode)?r.size=e.usedBytes:a.isLink(e.mode)?r.size=e.link.length:r.size=0,r.atime=new Date(e.timestamp),r.mtime=new Date(e.timestamp),r.ctime=new Date(e.timestamp),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr(e,r){r.mode!==void 0&&(e.mode=r.mode),r.timestamp!==void 0&&(e.timestamp=r.timestamp),r.size!==void 0&&k.resizeFileStorage(e,r.size)},lookup(e,r){throw a.genericErrors[44]},mknod(e,r,t,n){return k.createNode(e,r,t,n)},rename(e,r,t){if(a.isDir(e.mode)){var n;try{n=a.lookupNode(r,t)}catch(i){}if(n)for(var o in n.contents)throw new a.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=t,r.contents[t]=e,r.timestamp=e.parent.timestamp},unlink(e,r){delete e.contents[r],e.timestamp=Date.now()},rmdir(e,r){var t=a.lookupNode(e,r);for(var n in t.contents)throw new a.ErrnoError(55);delete e.contents[r],e.timestamp=Date.now()},readdir(e){var r=[".",".."];for(var t of Object.keys(e.contents))r.push(t);return r},symlink(e,r,t){var n=k.createNode(e,r,41471,0);return n.link=t,n},readlink(e){if(!a.isLink(e.mode))throw new a.ErrnoError(28);return e.link}},stream_ops:{read(e,r,t,n,o){var i=e.node.contents;if(o>=e.node.usedBytes)return 0;var s=Math.min(e.node.usedBytes-o,n);if(s>8&&i.subarray)r.set(i.subarray(o,o+s),t);else for(var l=0;l<s;l++)r[t+l]=i[o+l];return s},write(e,r,t,n,o,i){if(r.buffer===U.buffer&&(i=!1),!n)return 0;var s=e.node;if(s.timestamp=Date.now(),r.subarray&&(!s.contents||s.contents.subarray)){if(i)return s.contents=r.subarray(t,t+n),s.usedBytes=n,n;if(s.usedBytes===0&&o===0)return s.contents=r.slice(t,t+n),s.usedBytes=n,n;if(o+n<=s.usedBytes)return s.contents.set(r.subarray(t,t+n),o),n}if(k.expandFileStorage(s,o+n),s.contents.subarray&&r.subarray)s.contents.set(r.subarray(t,t+n),o);else for(var l=0;l<n;l++)s.contents[o+l]=r[t+l];return s.usedBytes=Math.max(s.usedBytes,o+n),n},llseek(e,r,t){var n=r;if(t===1?n+=e.position:t===2&&a.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new a.ErrnoError(28);return n},allocate(e,r,t){k.expandFileStorage(e.node,r+t),e.node.usedBytes=Math.max(e.node.usedBytes,r+t)},mmap(e,r,t,n,o){if(!a.isFile(e.node.mode))throw new a.ErrnoError(43);var i,s,l=e.node.contents;if(!(o&2)&&l.buffer===U.buffer)s=!1,i=l.byteOffset;else{if((t>0||t+r<l.length)&&(l.subarray?l=l.subarray(t,t+r):l=Array.prototype.slice.call(l,t,t+r)),s=!0,i=Gr(r),!i)throw new a.ErrnoError(48);U.set(l,i)}return{ptr:i,allocated:s}},msync(e,r,t,n,o){return k.stream_ops.write(e,r,0,n,t,!1),0}}},en=(e,r,t,n)=>{var o=n?"":`al ${e}`;ge(e).then(i=>{r(new Uint8Array(i)),o&&Ce(o)},i=>{if(t)t();else throw`Loading data file "${e}" failed.`}),o&&Ve(o)},Kr=(e,r,t,n,o,i)=>{a.createDataFile(e,r,t,n,o,i)},rn=u.preloadPlugins||[],tn=(e,r,t,n)=>{typeof Browser!="undefined"&&Browser.init();var o=!1;return rn.forEach(i=>{o||i.canHandle(r)&&(i.handle(e,r,t,n),o=!0)}),o},Xr=(e,r,t,n,o,i,s,l,c,f)=>{var d=r?re.resolve($.join2(e,r)):e,g=`cp ${d}`;function p(m){function y(P){f==null||f(),l||Kr(e,r,P,n,o,c),i==null||i(),Ce(g)}tn(m,d,y,()=>{s==null||s(),Ce(g)})||y(m)}Ve(g),typeof t=="string"?en(t,p,s):p(t)},nn=e=>{var r={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},t=r[e];if(typeof t=="undefined")throw new Error(`Unknown file open mode: ${e}`);return t},pr=(e,r)=>{var t=0;return e&&(t|=365),r&&(t|=146),t},a={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:class{constructor(e){this.name="ErrnoError",this.errno=e}},genericErrors:{},filesystems:null,syncFSRequests:0,FSStream:class{constructor(){this.shared={}}get object(){return this.node}set object(e){this.node=e}get isRead(){return(this.flags&2097155)!==1}get isWrite(){return(this.flags&2097155)!==0}get isAppend(){return this.flags&1024}get flags(){return this.shared.flags}set flags(e){this.shared.flags=e}get position(){return this.shared.position}set position(e){this.shared.position=e}},FSNode:class{constructor(e,r,t,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=a.nextInode++,this.name=r,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n,this.readMode=365,this.writeMode=146}get read(){return(this.mode&this.readMode)===this.readMode}set read(e){e?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(e){e?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return a.isDir(this.mode)}get isDevice(){return a.isChrdev(this.mode)}},lookupPath(e,r={}){if(e=re.resolve(e),!e)return{path:"",node:null};var t={follow_mount:!0,recurse_count:0};if(r=Object.assign(t,r),r.recurse_count>8)throw new a.ErrnoError(32);for(var n=e.split("/").filter(g=>!!g),o=a.root,i="/",s=0;s<n.length;s++){var l=s===n.length-1;if(l&&r.parent)break;if(o=a.lookupNode(o,n[s]),i=$.join2(i,n[s]),a.isMountpoint(o)&&(!l||l&&r.follow_mount)&&(o=o.mounted.root),!l||r.follow)for(var c=0;a.isLink(o.mode);){var f=a.readlink(i);i=re.resolve($.dirname(i),f);var d=a.lookupPath(i,{recurse_count:r.recurse_count+1});if(o=d.node,c++>40)throw new a.ErrnoError(32)}}return{path:i,node:o}},getPath(e){for(var r;;){if(a.isRoot(e)){var t=e.mount.mountpoint;return r?t[t.length-1]!=="/"?`${t}/${r}`:t+r:t}r=r?`${e.name}/${r}`:e.name,e=e.parent}},hashName(e,r){for(var t=0,n=0;n<r.length;n++)t=(t<<5)-t+r.charCodeAt(n)|0;return(e+t>>>0)%a.nameTable.length},hashAddNode(e){var r=a.hashName(e.parent.id,e.name);e.name_next=a.nameTable[r],a.nameTable[r]=e},hashRemoveNode(e){var r=a.hashName(e.parent.id,e.name);if(a.nameTable[r]===e)a.nameTable[r]=e.name_next;else for(var t=a.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode(e,r){var t=a.mayLookup(e);if(t)throw new a.ErrnoError(t);for(var n=a.hashName(e.id,r),o=a.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===r)return o}return a.lookup(e,r)},createNode(e,r,t,n){var o=new a.FSNode(e,r,t,n);return a.hashAddNode(o),o},destroyNode(e){a.hashRemoveNode(e)},isRoot(e){return e===e.parent},isMountpoint(e){return!!e.mounted},isFile(e){return(e&61440)===32768},isDir(e){return(e&61440)===16384},isLink(e){return(e&61440)===40960},isChrdev(e){return(e&61440)===8192},isBlkdev(e){return(e&61440)===24576},isFIFO(e){return(e&61440)===4096},isSocket(e){return(e&49152)===49152},flagsToPermissionString(e){var r=["r","w","rw"][e&3];return e&512&&(r+="w"),r},nodePermissions(e,r){return a.ignorePermissions?0:r.includes("r")&&!(e.mode&292)||r.includes("w")&&!(e.mode&146)||r.includes("x")&&!(e.mode&73)?2:0},mayLookup(e){if(!a.isDir(e.mode))return 54;var r=a.nodePermissions(e,"x");return r||(e.node_ops.lookup?0:2)},mayCreate(e,r){try{var t=a.lookupNode(e,r);return 20}catch(n){}return a.nodePermissions(e,"wx")},mayDelete(e,r,t){var n;try{n=a.lookupNode(e,r)}catch(i){return i.errno}var o=a.nodePermissions(e,"wx");if(o)return o;if(t){if(!a.isDir(n.mode))return 54;if(a.isRoot(n)||a.getPath(n)===a.cwd())return 10}else if(a.isDir(n.mode))return 31;return 0},mayOpen(e,r){return e?a.isLink(e.mode)?32:a.isDir(e.mode)&&(a.flagsToPermissionString(r)!=="r"||r&512)?31:a.nodePermissions(e,a.flagsToPermissionString(r)):44},MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=a.MAX_OPEN_FDS;e++)if(!a.streams[e])return e;throw new a.ErrnoError(33)},getStreamChecked(e){var r=a.getStream(e);if(!r)throw new a.ErrnoError(8);return r},getStream:e=>a.streams[e],createStream(e,r=-1){return e=Object.assign(new a.FSStream,e),r==-1&&(r=a.nextfd()),e.fd=r,a.streams[r]=e,e},closeStream(e){a.streams[e]=null},dupStream(e,r=-1){var n,o;var t=a.createStream(e,r);return(o=(n=t.stream_ops)==null?void 0:n.dup)==null||o.call(n,t),t},chrdev_stream_ops:{open(e){var t,n;var r=a.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,(n=(t=e.stream_ops).open)==null||n.call(t,e)},llseek(){throw new a.ErrnoError(70)}},major:e=>e>>8,minor:e=>e&255,makedev:(e,r)=>e<<8|r,registerDevice(e,r){a.devices[e]={stream_ops:r}},getDevice:e=>a.devices[e],getMounts(e){for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push(...n.mounts)}return r},syncfs(e,r){typeof e=="function"&&(r=e,e=!1),a.syncFSRequests++,a.syncFSRequests>1&&z(`warning: ${a.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=a.getMounts(a.root.mount),n=0;function o(s){return a.syncFSRequests--,r(s)}function i(s){if(s)return i.errored?void 0:(i.errored=!0,o(s));++n>=t.length&&o(null)}t.forEach(s=>{if(!s.type.syncfs)return i(null);s.type.syncfs(s,e,i)})},mount(e,r,t){var n=t==="/",o=!t,i;if(n&&a.root)throw new a.ErrnoError(10);if(!n&&!o){var s=a.lookupPath(t,{follow_mount:!1});if(t=s.path,i=s.node,a.isMountpoint(i))throw new a.ErrnoError(10);if(!a.isDir(i.mode))throw new a.ErrnoError(54)}var l={type:e,opts:r,mountpoint:t,mounts:[]},c=e.mount(l);return c.mount=l,l.root=c,n?a.root=c:i&&(i.mounted=l,i.mount&&i.mount.mounts.push(l)),c},unmount(e){var r=a.lookupPath(e,{follow_mount:!1});if(!a.isMountpoint(r.node))throw new a.ErrnoError(28);var t=r.node,n=t.mounted,o=a.getMounts(n);Object.keys(a.nameTable).forEach(s=>{for(var l=a.nameTable[s];l;){var c=l.name_next;o.includes(l.mount)&&a.destroyNode(l),l=c}}),t.mounted=null;var i=t.mount.mounts.indexOf(n);t.mount.mounts.splice(i,1)},lookup(e,r){return e.node_ops.lookup(e,r)},mknod(e,r,t){var n=a.lookupPath(e,{parent:!0}),o=n.node,i=$.basename(e);if(!i||i==="."||i==="..")throw new a.ErrnoError(28);var s=a.mayCreate(o,i);if(s)throw new a.ErrnoError(s);if(!o.node_ops.mknod)throw new a.ErrnoError(63);return o.node_ops.mknod(o,i,r,t)},create(e,r){return r=r!==void 0?r:438,r&=4095,r|=32768,a.mknod(e,r,0)},mkdir(e,r){return r=r!==void 0?r:511,r&=1023,r|=16384,a.mknod(e,r,0)},mkdirTree(e,r){for(var t=e.split("/"),n="",o=0;o<t.length;++o)if(t[o]){n+="/"+t[o];try{a.mkdir(n,r)}catch(i){if(i.errno!=20)throw i}}},mkdev(e,r,t){return typeof t=="undefined"&&(t=r,r=438),r|=8192,a.mknod(e,r,t)},symlink(e,r){if(!re.resolve(e))throw new a.ErrnoError(44);var t=a.lookupPath(r,{parent:!0}),n=t.node;if(!n)throw new a.ErrnoError(44);var o=$.basename(r),i=a.mayCreate(n,o);if(i)throw new a.ErrnoError(i);if(!n.node_ops.symlink)throw new a.ErrnoError(63);return n.node_ops.symlink(n,o,e)},rename(e,r){var t=$.dirname(e),n=$.dirname(r),o=$.basename(e),i=$.basename(r),s,l,c;if(s=a.lookupPath(e,{parent:!0}),l=s.node,s=a.lookupPath(r,{parent:!0}),c=s.node,!l||!c)throw new a.ErrnoError(44);if(l.mount!==c.mount)throw new a.ErrnoError(75);var f=a.lookupNode(l,o),d=re.relative(e,n);if(d.charAt(0)!==".")throw new a.ErrnoError(28);if(d=re.relative(r,t),d.charAt(0)!==".")throw new a.ErrnoError(55);var g;try{g=a.lookupNode(c,i)}catch(y){}if(f!==g){var p=a.isDir(f.mode),m=a.mayDelete(l,o,p);if(m)throw new a.ErrnoError(m);if(m=g?a.mayDelete(c,i,p):a.mayCreate(c,i),m)throw new a.ErrnoError(m);if(!l.node_ops.rename)throw new a.ErrnoError(63);if(a.isMountpoint(f)||g&&a.isMountpoint(g))throw new a.ErrnoError(10);if(c!==l&&(m=a.nodePermissions(l,"w"),m))throw new a.ErrnoError(m);a.hashRemoveNode(f);try{l.node_ops.rename(f,c,i),f.parent=c}catch(y){throw y}finally{a.hashAddNode(f)}}},rmdir(e){var r=a.lookupPath(e,{parent:!0}),t=r.node,n=$.basename(e),o=a.lookupNode(t,n),i=a.mayDelete(t,n,!0);if(i)throw new a.ErrnoError(i);if(!t.node_ops.rmdir)throw new a.ErrnoError(63);if(a.isMountpoint(o))throw new a.ErrnoError(10);t.node_ops.rmdir(t,n),a.destroyNode(o)},readdir(e){var r=a.lookupPath(e,{follow:!0}),t=r.node;if(!t.node_ops.readdir)throw new a.ErrnoError(54);return t.node_ops.readdir(t)},unlink(e){var r=a.lookupPath(e,{parent:!0}),t=r.node;if(!t)throw new a.ErrnoError(44);var n=$.basename(e),o=a.lookupNode(t,n),i=a.mayDelete(t,n,!1);if(i)throw new a.ErrnoError(i);if(!t.node_ops.unlink)throw new a.ErrnoError(63);if(a.isMountpoint(o))throw new a.ErrnoError(10);t.node_ops.unlink(t,n),a.destroyNode(o)},readlink(e){var r=a.lookupPath(e),t=r.node;if(!t)throw new a.ErrnoError(44);if(!t.node_ops.readlink)throw new a.ErrnoError(28);return re.resolve(a.getPath(t.parent),t.node_ops.readlink(t))},stat(e,r){var t=a.lookupPath(e,{follow:!r}),n=t.node;if(!n)throw new a.ErrnoError(44);if(!n.node_ops.getattr)throw new a.ErrnoError(63);return n.node_ops.getattr(n)},lstat(e){return a.stat(e,!0)},chmod(e,r,t){var n;if(typeof e=="string"){var o=a.lookupPath(e,{follow:!t});n=o.node}else n=e;if(!n.node_ops.setattr)throw new a.ErrnoError(63);n.node_ops.setattr(n,{mode:r&4095|n.mode&-4096,timestamp:Date.now()})},lchmod(e,r){a.chmod(e,r,!0)},fchmod(e,r){var t=a.getStreamChecked(e);a.chmod(t.node,r)},chown(e,r,t,n){var o;if(typeof e=="string"){var i=a.lookupPath(e,{follow:!n});o=i.node}else o=e;if(!o.node_ops.setattr)throw new a.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown(e,r,t){a.chown(e,r,t,!0)},fchown(e,r,t){var n=a.getStreamChecked(e);a.chown(n.node,r,t)},truncate(e,r){if(r<0)throw new a.ErrnoError(28);var t;if(typeof e=="string"){var n=a.lookupPath(e,{follow:!0});t=n.node}else t=e;if(!t.node_ops.setattr)throw new a.ErrnoError(63);if(a.isDir(t.mode))throw new a.ErrnoError(31);if(!a.isFile(t.mode))throw new a.ErrnoError(28);var o=a.nodePermissions(t,"w");if(o)throw new a.ErrnoError(o);t.node_ops.setattr(t,{size:r,timestamp:Date.now()})},ftruncate(e,r){var t=a.getStreamChecked(e);if(!(t.flags&2097155))throw new a.ErrnoError(28);a.truncate(t.node,r)},utime(e,r,t){var n=a.lookupPath(e,{follow:!0}),o=n.node;o.node_ops.setattr(o,{timestamp:Math.max(r,t)})},open(e,r,t){if(e==="")throw new a.ErrnoError(44);r=typeof r=="string"?nn(r):r,r&64?(t=typeof t=="undefined"?438:t,t=t&4095|32768):t=0;var n;if(typeof e=="object")n=e;else{e=$.normalize(e);try{var o=a.lookupPath(e,{follow:!(r&131072)});n=o.node}catch(c){}}var i=!1;if(r&64)if(n){if(r&128)throw new a.ErrnoError(20)}else n=a.mknod(e,t,0),i=!0;if(!n)throw new a.ErrnoError(44);if(a.isChrdev(n.mode)&&(r&=-513),r&65536&&!a.isDir(n.mode))throw new a.ErrnoError(54);if(!i){var s=a.mayOpen(n,r);if(s)throw new a.ErrnoError(s)}r&512&&!i&&a.truncate(n,0),r&=-131713;var l=a.createStream({node:n,path:a.getPath(n),flags:r,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return l.stream_ops.open&&l.stream_ops.open(l),u.logReadFiles&&!(r&1)&&(a.readFiles||(a.readFiles={}),e in a.readFiles||(a.readFiles[e]=1)),l},close(e){if(a.isClosed(e))throw new a.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(r){throw r}finally{a.closeStream(e.fd)}e.fd=null},isClosed(e){return e.fd===null},llseek(e,r,t){if(a.isClosed(e))throw new a.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new a.ErrnoError(70);if(t!=0&&t!=1&&t!=2)throw new a.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read(e,r,t,n,o){if(n<0||o<0)throw new a.ErrnoError(28);if(a.isClosed(e))throw new a.ErrnoError(8);if((e.flags&2097155)===1)throw new a.ErrnoError(8);if(a.isDir(e.node.mode))throw new a.ErrnoError(31);if(!e.stream_ops.read)throw new a.ErrnoError(28);var i=typeof o!="undefined";if(!i)o=e.position;else if(!e.seekable)throw new a.ErrnoError(70);var s=e.stream_ops.read(e,r,t,n,o);return i||(e.position+=s),s},write(e,r,t,n,o,i){if(n<0||o<0)throw new a.ErrnoError(28);if(a.isClosed(e))throw new a.ErrnoError(8);if(!(e.flags&2097155))throw new a.ErrnoError(8);if(a.isDir(e.node.mode))throw new a.ErrnoError(31);if(!e.stream_ops.write)throw new a.ErrnoError(28);e.seekable&&e.flags&1024&&a.llseek(e,0,2);var s=typeof o!="undefined";if(!s)o=e.position;else if(!e.seekable)throw new a.ErrnoError(70);var l=e.stream_ops.write(e,r,t,n,o,i);return s||(e.position+=l),l},allocate(e,r,t){if(a.isClosed(e))throw new a.ErrnoError(8);if(r<0||t<=0)throw new a.ErrnoError(28);if(!(e.flags&2097155))throw new a.ErrnoError(8);if(!a.isFile(e.node.mode)&&!a.isDir(e.node.mode))throw new a.ErrnoError(43);if(!e.stream_ops.allocate)throw new a.ErrnoError(138);e.stream_ops.allocate(e,r,t)},mmap(e,r,t,n,o){if(n&2&&!(o&2)&&(e.flags&2097155)!==2)throw new a.ErrnoError(2);if((e.flags&2097155)===1)throw new a.ErrnoError(2);if(!e.stream_ops.mmap)throw new a.ErrnoError(43);return e.stream_ops.mmap(e,r,t,n,o)},msync(e,r,t,n,o){return e.stream_ops.msync?e.stream_ops.msync(e,r,t,n,o):0},ioctl(e,r,t){if(!e.stream_ops.ioctl)throw new a.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile(e,r={}){if(r.flags=r.flags||0,r.encoding=r.encoding||"binary",r.encoding!=="utf8"&&r.encoding!=="binary")throw new Error(`Invalid encoding type "${r.encoding}"`);var t,n=a.open(e,r.flags),o=a.stat(e),i=o.size,s=new Uint8Array(i);return a.read(n,s,0,i,0),r.encoding==="utf8"?t=we(s,0):r.encoding==="binary"&&(t=s),a.close(n),t},writeFile(e,r,t={}){t.flags=t.flags||577;var n=a.open(e,t.flags,t.mode);if(typeof r=="string"){var o=new Uint8Array(Te(r)+1),i=vr(r,o,0,o.length);a.write(n,o,0,i,void 0,t.canOwn)}else if(ArrayBuffer.isView(r))a.write(n,r,0,r.byteLength,void 0,t.canOwn);else throw new Error("Unsupported data type");a.close(n)},cwd:()=>a.currentPath,chdir(e){var r=a.lookupPath(e,{follow:!0});if(r.node===null)throw new a.ErrnoError(44);if(!a.isDir(r.node.mode))throw new a.ErrnoError(54);var t=a.nodePermissions(r.node,"x");if(t)throw new a.ErrnoError(t);a.currentPath=r.path},createDefaultDirectories(){a.mkdir("/tmp"),a.mkdir("/home"),a.mkdir("/home/web_user")},createDefaultDevices(){a.mkdir("/dev"),a.registerDevice(a.makedev(1,3),{read:()=>0,write:(n,o,i,s,l)=>s}),a.mkdev("/dev/null",a.makedev(1,3)),ie.register(a.makedev(5,0),ie.default_tty_ops),ie.register(a.makedev(6,0),ie.default_tty1_ops),a.mkdev("/dev/tty",a.makedev(5,0)),a.mkdev("/dev/tty1",a.makedev(6,0));var e=new Uint8Array(1024),r=0,t=()=>(r===0&&(r=zr(e).byteLength),e[--r]);a.createDevice("/dev","random",t),a.createDevice("/dev","urandom",t),a.mkdir("/dev/shm"),a.mkdir("/dev/shm/tmp")},createSpecialDirectories(){a.mkdir("/proc");var e=a.mkdir("/proc/self");a.mkdir("/proc/self/fd"),a.mount({mount(){var r=a.createNode(e,"fd",16895,73);return r.node_ops={lookup(t,n){var o=+n,i=a.getStreamChecked(o),s={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>i.path}};return s.parent=s,s}},r}},{},"/proc/self/fd")},createStandardStreams(){u.stdin?a.createDevice("/dev","stdin",u.stdin):a.symlink("/dev/tty","/dev/stdin"),u.stdout?a.createDevice("/dev","stdout",null,u.stdout):a.symlink("/dev/tty","/dev/stdout"),u.stderr?a.createDevice("/dev","stderr",null,u.stderr):a.symlink("/dev/tty1","/dev/stderr");var e=a.open("/dev/stdin",0),r=a.open("/dev/stdout",1),t=a.open("/dev/stderr",1)},staticInit(){[44].forEach(e=>{a.genericErrors[e]=new a.ErrnoError(e),a.genericErrors[e].stack="<generic error, no stack>"}),a.nameTable=new Array(4096),a.mount(k,{},"/"),a.createDefaultDirectories(),a.createDefaultDevices(),a.createSpecialDirectories(),a.filesystems={MEMFS:k}},init(e,r,t){a.init.initialized=!0,u.stdin=e||u.stdin,u.stdout=r||u.stdout,u.stderr=t||u.stderr,a.createStandardStreams()},quit(){a.init.initialized=!1;for(var e=0;e<a.streams.length;e++){var r=a.streams[e];r&&a.close(r)}},findObject(e,r){var t=a.analyzePath(e,r);return t.exists?t.object:null},analyzePath(e,r){try{var t=a.lookupPath(e,{follow:!r});e=t.path}catch(o){}var n={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var t=a.lookupPath(e,{parent:!0});n.parentExists=!0,n.parentPath=t.path,n.parentObject=t.node,n.name=$.basename(e),t=a.lookupPath(e,{follow:!r}),n.exists=!0,n.path=t.path,n.object=t.node,n.name=t.node.name,n.isRoot=t.path==="/"}catch(o){n.error=o.errno}return n},createPath(e,r,t,n){e=typeof e=="string"?e:a.getPath(e);for(var o=r.split("/").reverse();o.length;){var i=o.pop();if(i){var s=$.join2(e,i);try{a.mkdir(s)}catch(l){}e=s}}return s},createFile(e,r,t,n,o){var i=$.join2(typeof e=="string"?e:a.getPath(e),r),s=pr(n,o);return a.create(i,s)},createDataFile(e,r,t,n,o,i){var s=r;e&&(e=typeof e=="string"?e:a.getPath(e),s=r?$.join2(e,r):e);var l=pr(n,o),c=a.create(s,l);if(t){if(typeof t=="string"){for(var f=new Array(t.length),d=0,g=t.length;d<g;++d)f[d]=t.charCodeAt(d);t=f}a.chmod(c,l|146);var p=a.open(c,577);a.write(p,t,0,t.length,0,i),a.close(p),a.chmod(c,l)}},createDevice(e,r,t,n){var o=$.join2(typeof e=="string"?e:a.getPath(e),r),i=pr(!!t,!!n);a.createDevice.major||(a.createDevice.major=64);var s=a.makedev(a.createDevice.major++,0);return a.registerDevice(s,{open(l){l.seekable=!1},close(l){var c;(c=n==null?void 0:n.buffer)!=null&&c.length&&n(10)},read(l,c,f,d,g){for(var p=0,m=0;m<d;m++){var y;try{y=t()}catch(P){throw new a.ErrnoError(29)}if(y===void 0&&p===0)throw new a.ErrnoError(6);if(y==null)break;p++,c[f+m]=y}return p&&(l.node.timestamp=Date.now()),p},write(l,c,f,d,g){for(var p=0;p<d;p++)try{n(c[f+p])}catch(m){throw new a.ErrnoError(29)}return d&&(l.node.timestamp=Date.now()),p}}),a.mkdev(o,i,s)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if(typeof XMLHttpRequest!="undefined")throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");try{e.contents=Y(e.url),e.usedBytes=e.contents.length}catch(r){throw new a.ErrnoError(29)}},createLazyFile(e,r,t,n,o){class i{constructor(){this.lengthKnown=!1,this.chunks=[]}get(m){if(!(m>this.length-1||m<0)){var y=m%this.chunkSize,P=m/this.chunkSize|0;return this.getter(P)[y]}}setDataGetter(m){this.getter=m}cacheLength(){var m=new XMLHttpRequest;if(m.open("HEAD",t,!1),m.send(null),!(m.status>=200&&m.status<300||m.status===304))throw new Error("Couldn't load "+t+". Status: "+m.status);var y=Number(m.getResponseHeader("Content-length")),P,D=(P=m.getResponseHeader("Accept-Ranges"))&&P==="bytes",F=(P=m.getResponseHeader("Content-Encoding"))&&P==="gzip",b=1024*1024;D||(b=y);var A=(S,x)=>{if(S>x)throw new Error("invalid range ("+S+", "+x+") or no bytes requested!");if(x>y-1)throw new Error("only "+y+" bytes available! programmer error!");var O=new XMLHttpRequest;if(O.open("GET",t,!1),y!==b&&O.setRequestHeader("Range","bytes="+S+"-"+x),O.responseType="arraybuffer",O.overrideMimeType&&O.overrideMimeType("text/plain; charset=x-user-defined"),O.send(null),!(O.status>=200&&O.status<300||O.status===304))throw new Error("Couldn't load "+t+". Status: "+O.status);return O.response!==void 0?new Uint8Array(O.response||[]):qr(O.responseText||"",!0)},M=this;M.setDataGetter(S=>{var x=S*b,O=(S+1)*b-1;if(O=Math.min(O,y-1),typeof M.chunks[S]=="undefined"&&(M.chunks[S]=A(x,O)),typeof M.chunks[S]=="undefined")throw new Error("doXHR failed!");return M.chunks[S]}),(F||!y)&&(b=y=1,y=this.getter(0).length,b=y,ae("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=y,this._chunkSize=b,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if(typeof XMLHttpRequest!="undefined"){if(!J)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var s=new i,l={isDevice:!1,contents:s}}else var l={isDevice:!1,url:t};var c=a.createFile(e,r,l,n,o);l.contents?c.contents=l.contents:l.url&&(c.contents=null,c.url=l.url),Object.defineProperties(c,{usedBytes:{get:function(){return this.contents.length}}});var f={},d=Object.keys(c.stream_ops);d.forEach(p=>{var m=c.stream_ops[p];f[p]=(...y)=>(a.forceLoadFile(c),m(...y))});function g(p,m,y,P,D){var F=p.node.contents;if(D>=F.length)return 0;var b=Math.min(F.length-D,P);if(F.slice)for(var A=0;A<b;A++)m[y+A]=F[D+A];else for(var A=0;A<b;A++)m[y+A]=F.get(D+A);return b}return f.read=(p,m,y,P,D)=>(a.forceLoadFile(c),g(p,m,y,P,D)),f.mmap=(p,m,y,P,D)=>{a.forceLoadFile(c);var F=Gr(m);if(!F)throw new a.ErrnoError(48);return g(p,U,F,m,y),{ptr:F,allocated:!0}},c.stream_ops=f,c}},Yr=(e,r)=>e?we(B,e,r):"",I={DEFAULT_POLLMASK:5,calculateAt(e,r,t){if($.isAbs(r))return r;var n;if(e===-100)n=a.cwd();else{var o=I.getStreamFromFD(e);n=o.path}if(r.length==0){if(!t)throw new a.ErrnoError(44);return n}return $.join2(n,r)},doStat(e,r,t){var n=e(r);_[t>>2]=n.dev,_[t+4>>2]=n.mode,T[t+8>>2]=n.nlink,_[t+12>>2]=n.uid,_[t+16>>2]=n.gid,_[t+20>>2]=n.rdev,j=[n.size>>>0,(E=n.size,+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],_[t+24>>2]=j[0],_[t+28>>2]=j[1],_[t+32>>2]=4096,_[t+36>>2]=n.blocks;var o=n.atime.getTime(),i=n.mtime.getTime(),s=n.ctime.getTime();return j=[Math.floor(o/1e3)>>>0,(E=Math.floor(o/1e3),+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],_[t+40>>2]=j[0],_[t+44>>2]=j[1],T[t+48>>2]=o%1e3*1e3,j=[Math.floor(i/1e3)>>>0,(E=Math.floor(i/1e3),+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],_[t+56>>2]=j[0],_[t+60>>2]=j[1],T[t+64>>2]=i%1e3*1e3,j=[Math.floor(s/1e3)>>>0,(E=Math.floor(s/1e3),+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],_[t+72>>2]=j[0],_[t+76>>2]=j[1],T[t+80>>2]=s%1e3*1e3,j=[n.ino>>>0,(E=n.ino,+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],_[t+88>>2]=j[0],_[t+92>>2]=j[1],0},doMsync(e,r,t,n,o){if(!a.isFile(r.node.mode))throw new a.ErrnoError(43);if(n&2)return 0;var i=B.slice(e,e+t);a.msync(r,i,o,t,n)},getStreamFromFD(e){var r=a.getStreamChecked(e);return r},varargs:void 0,getStr(e){var r=Yr(e);return r}};function on(e,r,t){I.varargs=t;try{var n=I.getStreamFromFD(e);switch(r){case 0:{var o=Ge();if(o<0)return-28;for(;a.streams[o];)o++;var i;return i=a.dupStream(n,o),i.fd}case 1:case 2:return 0;case 3:return n.flags;case 4:{var o=Ge();return n.flags|=o,0}case 12:{var o=ye(),s=0;return ee[o+s>>1]=2,0}case 13:case 14:return 0}return-28}catch(l){if(typeof a=="undefined"||l.name!=="ErrnoError")throw l;return-l.errno}}var de=(e,r,t)=>vr(e,B,r,t);function an(e,r){try{if(r===0)return-28;var t=a.cwd(),n=Te(t)+1;return r<n?-68:(de(t,e,r),n)}catch(o){if(typeof a=="undefined"||o.name!=="ErrnoError")throw o;return-o.errno}}function sn(e,r,t){I.varargs=t;try{var n=I.getStreamFromFD(e);switch(r){case 21509:return n.tty?0:-59;case 21505:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var o=n.tty.ops.ioctl_tcgets(n),i=ye();_[i>>2]=o.c_iflag||0,_[i+4>>2]=o.c_oflag||0,_[i+8>>2]=o.c_cflag||0,_[i+12>>2]=o.c_lflag||0;for(var s=0;s<32;s++)U[i+s+17]=o.c_cc[s]||0;return 0}return 0}case 21510:case 21511:case 21512:return n.tty?0:-59;case 21506:case 21507:case 21508:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){for(var i=ye(),l=_[i>>2],c=_[i+4>>2],f=_[i+8>>2],d=_[i+12>>2],g=[],s=0;s<32;s++)g.push(U[i+s+17]);return n.tty.ops.ioctl_tcsets(n.tty,r,{c_iflag:l,c_oflag:c,c_cflag:f,c_lflag:d,c_cc:g})}return 0}case 21519:{if(!n.tty)return-59;var i=ye();return _[i>>2]=0,0}case 21520:return n.tty?-28:-59;case 21531:{var i=ye();return a.ioctl(n,r,i)}case 21523:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var p=n.tty.ops.ioctl_tiocgwinsz(n.tty),i=ye();ee[i>>1]=p[0],ee[i+2>>1]=p[1]}return 0}case 21524:return n.tty?0:-59;case 21515:return n.tty?0:-59;default:return-28}}catch(m){if(typeof a=="undefined"||m.name!=="ErrnoError")throw m;return-m.errno}}function ln(e,r,t){try{return r=I.getStr(r),r=I.calculateAt(e,r),r=$.normalize(r),r[r.length-1]==="/"&&(r=r.substr(0,r.length-1)),a.mkdir(r,t,0),0}catch(n){if(typeof a=="undefined"||n.name!=="ErrnoError")throw n;return-n.errno}}function un(e,r,t,n){I.varargs=n;try{r=I.getStr(r),r=I.calculateAt(e,r);var o=n?Ge():0;return a.open(r,t,o).fd}catch(i){if(typeof a=="undefined"||i.name!=="ErrnoError")throw i;return-i.errno}}function cn(e,r,t,n){try{if(r=I.getStr(r),r=I.calculateAt(e,r),n<=0)return-28;var o=a.readlink(r),i=Math.min(n,Te(o)),s=U[t+i];return de(o,t,n+1),U[t+i]=s,i}catch(l){if(typeof a=="undefined"||l.name!=="ErrnoError")throw l;return-l.errno}}function fn(e,r){try{return e=I.getStr(e),I.doStat(a.stat,e,r)}catch(t){if(typeof a=="undefined"||t.name!=="ErrnoError")throw t;return-t.errno}}var dn=()=>{cr("")},vn=(e,r,t,n,o)=>{},pn=()=>{for(var e=new Array(256),r=0;r<256;++r)e[r]=String.fromCharCode(r);Qr=e},Qr,V=e=>{for(var r="",t=e;B[t];)r+=Qr[B[t++]];return r},_e={},ve={},Ke={},Ee,C=e=>{throw new Ee(e)},Zr,Xe=e=>{throw new Zr(e)},Q=(e,r,t)=>{e.forEach(function(l){Ke[l]=r});function n(l){var c=t(l);c.length!==e.length&&Xe("Mismatched type converter count");for(var f=0;f<e.length;++f)te(e[f],c[f])}var o=new Array(r.length),i=[],s=0;r.forEach((l,c)=>{ve.hasOwnProperty(l)?o[c]=ve[l]:(i.push(l),_e.hasOwnProperty(l)||(_e[l]=[]),_e[l].push(()=>{o[c]=ve[l],++s,s===i.length&&n(o)}))}),i.length===0&&n(o)};function hn(e,r,t={}){var n=r.name;if(e||C(`type "${n}" must have a positive integer typeid pointer`),ve.hasOwnProperty(e)){if(t.ignoreDuplicateRegistrations)return;C(`Cannot register type '${n}' twice`)}if(ve[e]=r,delete Ke[e],_e.hasOwnProperty(e)){var o=_e[e];delete _e[e],o.forEach(i=>i())}}function te(e,r,t={}){if(!("argPackAdvance"in r))throw new TypeError("registerType registeredInstance requires argPackAdvance");return hn(e,r,t)}var se=8,mn=(e,r,t,n)=>{r=V(r),te(e,{name:r,fromWireType:function(o){return!!o},toWireType:function(o,i){return i?t:n},argPackAdvance:se,readValueFromPointer:function(o){return this.fromWireType(B[o])},destructorFunction:null})},gn=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),hr=e=>{function r(t){return t.$$.ptrType.registeredClass.name}C(r(e)+" instance already deleted")},mr=!1,Jr=e=>{},yn=e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)},et=e=>{e.count.value-=1;var r=e.count.value===0;r&&yn(e)},rt=(e,r,t)=>{if(r===t)return e;if(t.baseClass===void 0)return null;var n=rt(e,r,t.baseClass);return n===null?null:t.downcast(n)},tt={},wn=()=>Object.keys(De).length,_n=()=>{var e=[];for(var r in De)De.hasOwnProperty(r)&&e.push(De[r]);return e},Fe=[],gr=()=>{for(;Fe.length;){var e=Fe.pop();e.$$.deleteScheduled=!1,e.delete()}},Se,En=e=>{Se=e,Fe.length&&Se&&Se(gr)},kn=()=>{u.getInheritedInstanceCount=wn,u.getLiveInheritedInstances=_n,u.flushPendingDeletes=gr,u.setDelayFunction=En},De={},bn=(e,r)=>{for(r===void 0&&C("ptr should not be undefined");e.baseClass;)r=e.upcast(r),e=e.baseClass;return r},An=(e,r)=>(r=bn(e,r),De[r]),Ye=(e,r)=>{(!r.ptrType||!r.ptr)&&Xe("makeClassHandle requires ptr and ptrType");var t=!!r.smartPtrType,n=!!r.smartPtr;return t!==n&&Xe("Both smartPtrType and smartPtr must be specified"),r.count={value:1},Re(Object.create(e,{$$:{value:r,writable:!0}}))};function Pn(e){var r=this.getPointee(e);if(!r)return this.destructor(e),null;var t=An(this.registeredClass,r);if(t!==void 0){if(t.$$.count.value===0)return t.$$.ptr=r,t.$$.smartPtr=e,t.clone();var n=t.clone();return this.destructor(e),n}function o(){return this.isSmartPointer?Ye(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:r,smartPtrType:this,smartPtr:e}):Ye(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var i=this.registeredClass.getActualType(r),s=tt[i];if(!s)return o.call(this);var l;this.isConst?l=s.constPointerType:l=s.pointerType;var c=rt(r,this.registeredClass,l.registeredClass);return c===null?o.call(this):this.isSmartPointer?Ye(l.registeredClass.instancePrototype,{ptrType:l,ptr:c,smartPtrType:this,smartPtr:e}):Ye(l.registeredClass.instancePrototype,{ptrType:l,ptr:c})}var Re=e=>typeof FinalizationRegistry=="undefined"?(Re=r=>r,e):(mr=new FinalizationRegistry(r=>{et(r.$$)}),Re=r=>{var t=r.$$,n=!!t.smartPtr;if(n){var o={$$:t};mr.register(r,o,r)}return r},Jr=r=>mr.unregister(r),Re(e)),Cn=()=>{Object.assign(Qe.prototype,{isAliasOf(e){if(!(this instanceof Qe)||!(e instanceof Qe))return!1;var r=this.$$.ptrType.registeredClass,t=this.$$.ptr;e.$$=e.$$;for(var n=e.$$.ptrType.registeredClass,o=e.$$.ptr;r.baseClass;)t=r.upcast(t),r=r.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return r===n&&t===o},clone(){if(this.$$.ptr||hr(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=Re(Object.create(Object.getPrototypeOf(this),{$$:{value:gn(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e},delete(){this.$$.ptr||hr(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&C("Object already scheduled for deletion"),Jr(this),et(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||hr(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&C("Object already scheduled for deletion"),Fe.push(this),Fe.length===1&&Se&&Se(gr),this.$$.deleteScheduled=!0,this}})};function Qe(){}var Ze=(e,r)=>Object.defineProperty(r,"name",{value:e}),yr=(e,r,t)=>{if(e[r].overloadTable===void 0){var n=e[r];e[r]=function(...o){return e[r].overloadTable.hasOwnProperty(o.length)||C(`Function '${t}' called with an invalid number of arguments (${o.length}) - expects one of (${e[r].overloadTable})!`),e[r].overloadTable[o.length].apply(this,o)},e[r].overloadTable=[],e[r].overloadTable[n.argCount]=n}},nt=(e,r,t)=>{u.hasOwnProperty(e)?((t===void 0||u[e].overloadTable!==void 0&&u[e].overloadTable[t]!==void 0)&&C(`Cannot register public name '${e}' twice`),yr(u,e,e),u.hasOwnProperty(t)&&C(`Cannot register multiple overloads of a function with the same number of arguments (${t})!`),u[e].overloadTable[t]=r):(u[e]=r,t!==void 0&&(u[e].numArguments=t))},Tn=48,Fn=57,Sn=e=>{if(e===void 0)return"_unknown";e=e.replace(/[^a-zA-Z0-9_]/g,"$");var r=e.charCodeAt(0);return r>=Tn&&r<=Fn?`_${e}`:e};function Dn(e,r,t,n,o,i,s,l){this.name=e,this.constructor=r,this.instancePrototype=t,this.rawDestructor=n,this.baseClass=o,this.getActualType=i,this.upcast=s,this.downcast=l,this.pureVirtualFunctions=[]}var Je=(e,r,t)=>{for(;r!==t;)r.upcast||C(`Expected null or instance of ${t.name}, got an instance of ${r.name}`),e=r.upcast(e),r=r.baseClass;return e};function Rn(e,r){if(r===null)return this.isReference&&C(`null is not a valid ${this.name}`),0;r.$$||C(`Cannot pass "${br(r)}" as a ${this.name}`),r.$$.ptr||C(`Cannot pass deleted object as a pointer of type ${this.name}`);var t=r.$$.ptrType.registeredClass,n=Je(r.$$.ptr,t,this.registeredClass);return n}function $n(e,r){var t;if(r===null)return this.isReference&&C(`null is not a valid ${this.name}`),this.isSmartPointer?(t=this.rawConstructor(),e!==null&&e.push(this.rawDestructor,t),t):0;(!r||!r.$$)&&C(`Cannot pass "${br(r)}" as a ${this.name}`),r.$$.ptr||C(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&r.$$.ptrType.isConst&&C(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`);var n=r.$$.ptrType.registeredClass;if(t=Je(r.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(r.$$.smartPtr===void 0&&C("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:r.$$.smartPtrType===this?t=r.$$.smartPtr:C(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:t=r.$$.smartPtr;break;case 2:if(r.$$.smartPtrType===this)t=r.$$.smartPtr;else{var o=r.clone();t=this.rawShare(t,he.toHandle(()=>o.delete())),e!==null&&e.push(this.rawDestructor,t)}break;default:C("Unsupporting sharing policy")}return t}function Mn(e,r){if(r===null)return this.isReference&&C(`null is not a valid ${this.name}`),0;r.$$||C(`Cannot pass "${br(r)}" as a ${this.name}`),r.$$.ptr||C(`Cannot pass deleted object as a pointer of type ${this.name}`),r.$$.ptrType.isConst&&C(`Cannot convert argument of type ${r.$$.ptrType.name} to parameter type ${this.name}`);var t=r.$$.ptrType.registeredClass,n=Je(r.$$.ptr,t,this.registeredClass);return n}function er(e){return this.fromWireType(T[e>>2])}var On=()=>{Object.assign($e.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){var r;(r=this.rawDestructor)==null||r.call(this,e)},argPackAdvance:se,readValueFromPointer:er,fromWireType:Pn})};function $e(e,r,t,n,o,i,s,l,c,f,d){this.name=e,this.registeredClass=r,this.isReference=t,this.isConst=n,this.isSmartPointer=o,this.pointeeType=i,this.sharingPolicy=s,this.rawGetPointee=l,this.rawConstructor=c,this.rawShare=f,this.rawDestructor=d,!o&&r.baseClass===void 0?n?(this.toWireType=Rn,this.destructorFunction=null):(this.toWireType=Mn,this.destructorFunction=null):this.toWireType=$n}var ot=(e,r,t)=>{u.hasOwnProperty(e)||Xe("Replacing nonexistent public symbol"),u[e].overloadTable!==void 0&&t!==void 0?u[e].overloadTable[t]=r:(u[e]=r,u[e].argCount=t)},Wn=(e,r,t)=>{e=e.replace(/p/g,"i");var n=u["dynCall_"+e];return n(r,...t)},rr=[],at,it=e=>{var r=rr[e];return r||(e>=rr.length&&(rr.length=e+1),rr[e]=r=at.get(e)),r},jn=(e,r,t=[])=>{if(e.includes("j"))return Wn(e,r,t);var n=it(r)(...t);return n},In=(e,r)=>(...t)=>jn(e,r,t),q=(e,r)=>{e=V(e);function t(){return e.includes("j")?In(e,r):it(r)}var n=t();return typeof n!="function"&&C(`unknown function pointer with signature ${e}: ${r}`),n},Nn=(e,r)=>{var t=Ze(r,function(n){this.name=r,this.message=n;var o=new Error(n).stack;o!==void 0&&(this.stack=this.toString()+`
|
|
8
|
-
`+o.replace(/^Error(:[^\n]*)?\n/,""))});return t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},t},st,lt=e=>{var r=ht(e),t=V(r);return oe(r),t},pe=(e,r)=>{var t=[],n={};function o(i){if(!n[i]&&!ve[i]){if(Ke[i]){Ke[i].forEach(o);return}t.push(i),n[i]=!0}}throw r.forEach(o),new st(`${e}: `+t.map(lt).join([", "]))},xn=(e,r,t,n,o,i,s,l,c,f,d,g,p)=>{d=V(d),i=q(o,i),l&&(l=q(s,l)),f&&(f=q(c,f)),p=q(g,p);var m=Sn(d);nt(m,function(){pe(`Cannot construct ${d} due to unbound types`,[n])}),Q([e,r,t],n?[n]:[],y=>{var O,We;y=y[0];var P,D;n?(P=y.registeredClass,D=P.instancePrototype):D=Qe.prototype;var F=Ze(d,function(...je){if(Object.getPrototypeOf(this)!==b)throw new Ee("Use 'new' to construct "+d);if(A.constructor_body===void 0)throw new Ee(d+" has no accessible constructor");var Ie=A.constructor_body[je.length];if(Ie===void 0)throw new Ee(`Tried to invoke ctor of ${d} with invalid number of parameters (${je.length}) - expected (${Object.keys(A.constructor_body).toString()}) parameters instead!`);return Ie.apply(this,je)}),b=Object.create(D,{constructor:{value:F}});F.prototype=b;var A=new Dn(d,F,b,p,P,i,l,f);A.baseClass&&((We=(O=A.baseClass).__derivedClasses)!=null||(O.__derivedClasses=[]),A.baseClass.__derivedClasses.push(A));var M=new $e(d,A,!0,!1,!1),S=new $e(d+"*",A,!1,!1,!1),x=new $e(d+" const*",A,!1,!0,!1);return tt[e]={pointerType:S,constPointerType:x},ot(m,F),[M,S,x]})},wr=e=>{for(;e.length;){var r=e.pop(),t=e.pop();t(r)}};function Un(e){for(var r=1;r<e.length;++r)if(e[r]!==null&&e[r].destructorFunction===void 0)return!0;return!1}function tr(e,r,t,n,o,i){var s=r.length;s<2&&C("argTypes array size mismatch! Must at least get return value and 'this' types!");var l=r[1]!==null&&t!==null,c=Un(r),f=r[0].name!=="void",d=s-2,g=new Array(d),p=[],m=[],y=function(...P){P.length!==d&&C(`function ${e} called with ${P.length} arguments, expected ${d}`),m.length=0;var D;p.length=l?2:1,p[0]=o,l&&(D=r[1].toWireType(m,this),p[1]=D);for(var F=0;F<d;++F)g[F]=r[F+2].toWireType(m,P[F]),p.push(g[F]);var b=n(...p);function A(M){if(c)wr(m);else for(var S=l?1:2;S<r.length;S++){var x=S===1?D:g[S-2];r[S].destructorFunction!==null&&r[S].destructorFunction(x)}if(f)return r[0].fromWireType(M)}return A(b)};return Ze(e,y)}var nr=(e,r)=>{for(var t=[],n=0;n<e;n++)t.push(T[r+n*4>>2]);return t},_r=e=>{e=e.trim();let r=e.indexOf("(");return r!==-1?e.substr(0,r):e},Ln=(e,r,t,n,o,i,s,l)=>{var c=nr(t,n);r=V(r),r=_r(r),i=q(o,i),Q([],[e],f=>{f=f[0];var d=`${f.name}.${r}`;function g(){pe(`Cannot call ${d} due to unbound types`,c)}r.startsWith("@@")&&(r=Symbol[r.substring(2)]);var p=f.registeredClass.constructor;return p[r]===void 0?(g.argCount=t-1,p[r]=g):(yr(p,r,d),p[r].overloadTable[t-1]=g),Q([],c,m=>{var y=[m[0],null].concat(m.slice(1)),P=tr(d,y,null,i,s,l);if(p[r].overloadTable===void 0?(P.argCount=t-1,p[r]=P):p[r].overloadTable[t-1]=P,f.registeredClass.__derivedClasses)for(let D of f.registeredClass.__derivedClasses)D.constructor.hasOwnProperty(r)||(D.constructor[r]=P);return[]}),[]})},Hn=(e,r,t,n,o,i)=>{var s=nr(r,t);o=q(n,o),Q([],[e],l=>{l=l[0];var c=`constructor ${l.name}`;if(l.registeredClass.constructor_body===void 0&&(l.registeredClass.constructor_body=[]),l.registeredClass.constructor_body[r-1]!==void 0)throw new Ee(`Cannot register multiple constructors with identical number of parameters (${r-1}) for class '${l.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return l.registeredClass.constructor_body[r-1]=()=>{pe(`Cannot construct ${l.name} due to unbound types`,s)},Q([],s,f=>(f.splice(1,0,null),l.registeredClass.constructor_body[r-1]=tr(c,f,null,o,i),[])),[]})},Bn=(e,r,t,n,o,i,s,l,c)=>{var f=nr(t,n);r=V(r),r=_r(r),i=q(o,i),Q([],[e],d=>{d=d[0];var g=`${d.name}.${r}`;r.startsWith("@@")&&(r=Symbol[r.substring(2)]),l&&d.registeredClass.pureVirtualFunctions.push(r);function p(){pe(`Cannot call ${g} due to unbound types`,f)}var m=d.registeredClass.instancePrototype,y=m[r];return y===void 0||y.overloadTable===void 0&&y.className!==d.name&&y.argCount===t-2?(p.argCount=t-2,p.className=d.name,m[r]=p):(yr(m,r,g),m[r].overloadTable[t-2]=p),Q([],f,P=>{var D=tr(g,P,d,i,s,c);return m[r].overloadTable===void 0?(D.argCount=t-2,m[r]=D):m[r].overloadTable[t-2]=D,[]}),[]})},ut=(e,r,t)=>(e instanceof Object||C(`${t} with invalid "this": ${e}`),e instanceof r.registeredClass.constructor||C(`${t} incompatible with "this" of type ${e.constructor.name}`),e.$$.ptr||C(`cannot call emscripten binding method ${t} on deleted object`),Je(e.$$.ptr,e.$$.ptrType.registeredClass,r.registeredClass)),zn=(e,r,t,n,o,i,s,l,c,f)=>{r=V(r),o=q(n,o),Q([],[e],d=>{d=d[0];var g=`${d.name}.${r}`,p={get(){pe(`Cannot access ${g} due to unbound types`,[t,s])},enumerable:!0,configurable:!0};return c?p.set=()=>pe(`Cannot access ${g} due to unbound types`,[t,s]):p.set=m=>C(g+" is a read-only property"),Object.defineProperty(d.registeredClass.instancePrototype,r,p),Q([],c?[t,s]:[t],m=>{var y=m[0],P={get(){var F=ut(this,d,g+" getter");return y.fromWireType(o(i,F))},enumerable:!0};if(c){c=q(l,c);var D=m[1];P.set=function(F){var b=ut(this,d,g+" setter"),A=[];c(f,b,D.toWireType(A,F)),wr(A)}}return Object.defineProperty(d.registeredClass.instancePrototype,r,P),[]}),[]})},Er=[],ne=[],kr=e=>{e>9&&--ne[e+1]===0&&(ne[e]=void 0,Er.push(e))},Vn=()=>ne.length/2-5-Er.length,qn=()=>{ne.push(0,1,void 0,1,null,1,!0,1,!1,1),u.count_emval_handles=Vn},he={toValue:e=>(e||C("Cannot use deleted val. handle = "+e),ne[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{let r=Er.pop()||ne.length;return ne[r]=e,ne[r+1]=1,r}}}},Gn={name:"emscripten::val",fromWireType:e=>{var r=he.toValue(e);return kr(e),r},toWireType:(e,r)=>he.toHandle(r),argPackAdvance:se,readValueFromPointer:er,destructorFunction:null},ct=e=>te(e,Gn),br=e=>{if(e===null)return"null";var r=typeof e;return r==="object"||r==="array"||r==="function"?e.toString():""+e},Kn=(e,r)=>{switch(r){case 4:return function(t){return this.fromWireType(Or[t>>2])};case 8:return function(t){return this.fromWireType(Wr[t>>3])};default:throw new TypeError(`invalid float width (${r}): ${e}`)}},Xn=(e,r,t)=>{r=V(r),te(e,{name:r,fromWireType:n=>n,toWireType:(n,o)=>o,argPackAdvance:se,readValueFromPointer:Kn(r,t),destructorFunction:null})},Yn=(e,r,t,n,o,i,s)=>{var l=nr(r,t);e=V(e),e=_r(e),o=q(n,o),nt(e,function(){pe(`Cannot call ${e} due to unbound types`,l)},r-1),Q([],l,c=>{var f=[c[0],null].concat(c.slice(1));return ot(e,tr(e,f,null,o,i,s),r-1),[]})},Qn=(e,r,t)=>{switch(r){case 1:return t?n=>U[n]:n=>B[n];case 2:return t?n=>ee[n>>1]:n=>ze[n>>1];case 4:return t?n=>_[n>>2]:n=>T[n>>2];default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},Zn=(e,r,t,n,o)=>{r=V(r),o===-1&&(o=4294967295);var i=d=>d;if(n===0){var s=32-8*t;i=d=>d<<s>>>s}var l=r.includes("unsigned"),c=(d,g)=>{},f;l?f=function(d,g){return c(g,this.name),g>>>0}:f=function(d,g){return c(g,this.name),g},te(e,{name:r,fromWireType:i,toWireType:f,argPackAdvance:se,readValueFromPointer:Qn(r,t,n!==0),destructorFunction:null})},Jn=(e,r,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],o=n[r];function i(s){var l=T[s>>2],c=T[s+4>>2];return new o(U.buffer,c,l)}t=V(t),te(e,{name:t,fromWireType:i,argPackAdvance:se,readValueFromPointer:i},{ignoreDuplicateRegistrations:!0})},eo=(e,r)=>{ct(e)},ro=(e,r,t,n,o,i,s,l,c,f,d,g)=>{t=V(t),i=q(o,i),l=q(s,l),f=q(c,f),g=q(d,g),Q([e],[r],p=>{p=p[0];var m=new $e(t,p.registeredClass,!1,!1,!0,p,n,i,l,f,g);return[m]})},to=(e,r)=>{r=V(r);var t=r==="std::string";te(e,{name:r,fromWireType(n){var o=T[n>>2],i=n+4,s;if(t)for(var l=i,c=0;c<=o;++c){var f=i+c;if(c==o||B[f]==0){var d=f-l,g=Yr(l,d);s===void 0?s=g:(s+=String.fromCharCode(0),s+=g),l=f+1}}else{for(var p=new Array(o),c=0;c<o;++c)p[c]=String.fromCharCode(B[i+c]);s=p.join("")}return oe(n),s},toWireType(n,o){o instanceof ArrayBuffer&&(o=new Uint8Array(o));var i,s=typeof o=="string";s||o instanceof Uint8Array||o instanceof Uint8ClampedArray||o instanceof Int8Array||C("Cannot pass non-string to std::string"),t&&s?i=Te(o):i=o.length;var l=Cr(4+i+1),c=l+4;if(T[l>>2]=i,t&&s)de(o,c,i+1);else if(s)for(var f=0;f<i;++f){var d=o.charCodeAt(f);d>255&&(oe(c),C("String has UTF-16 code units that do not fit in 8 bits")),B[c+f]=d}else for(var f=0;f<i;++f)B[c+f]=o[f];return n!==null&&n.push(oe,l),l},argPackAdvance:se,readValueFromPointer:er,destructorFunction(n){oe(n)}})},ft=typeof TextDecoder!="undefined"?new TextDecoder("utf-16le"):void 0,no=(e,r)=>{for(var t=e,n=t>>1,o=n+r/2;!(n>=o)&&ze[n];)++n;if(t=n<<1,t-e>32&&ft)return ft.decode(B.subarray(e,t));for(var i="",s=0;!(s>=r/2);++s){var l=ee[e+s*2>>1];if(l==0)break;i+=String.fromCharCode(l)}return i},oo=(e,r,t)=>{if(t!=null||(t=2147483647),t<2)return 0;t-=2;for(var n=r,o=t<e.length*2?t/2:e.length,i=0;i<o;++i){var s=e.charCodeAt(i);ee[r>>1]=s,r+=2}return ee[r>>1]=0,r-n},ao=e=>e.length*2,io=(e,r)=>{for(var t=0,n="";!(t>=r/4);){var o=_[e+t*4>>2];if(o==0)break;if(++t,o>=65536){var i=o-65536;n+=String.fromCharCode(55296|i>>10,56320|i&1023)}else n+=String.fromCharCode(o)}return n},so=(e,r,t)=>{if(t!=null||(t=2147483647),t<4)return 0;for(var n=r,o=n+t-4,i=0;i<e.length;++i){var s=e.charCodeAt(i);if(s>=55296&&s<=57343){var l=e.charCodeAt(++i);s=65536+((s&1023)<<10)|l&1023}if(_[r>>2]=s,r+=4,r+4>o)break}return _[r>>2]=0,r-n},lo=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n>=55296&&n<=57343&&++t,r+=4}return r},uo=(e,r,t)=>{t=V(t);var n,o,i,s;r===2?(n=no,o=oo,s=ao,i=l=>ze[l>>1]):r===4&&(n=io,o=so,s=lo,i=l=>T[l>>2]),te(e,{name:t,fromWireType:l=>{for(var c=T[l>>2],f,d=l+4,g=0;g<=c;++g){var p=l+4+g*r;if(g==c||i(p)==0){var m=p-d,y=n(d,m);f===void 0?f=y:(f+=String.fromCharCode(0),f+=y),d=p+r}}return oe(l),f},toWireType:(l,c)=>{typeof c!="string"&&C(`Cannot pass non-string to C++ string type ${t}`);var f=s(c),d=Cr(4+f+r);return T[d>>2]=f/r,o(c,d+4,f+r),l!==null&&l.push(oe,d),d},argPackAdvance:se,readValueFromPointer:er,destructorFunction(l){oe(l)}})},co=(e,r)=>{r=V(r),te(e,{isVoid:!0,name:r,argPackAdvance:0,fromWireType:()=>{},toWireType:(t,n)=>{}})},fo=1,vo=()=>fo,po=(e,r,t)=>B.copyWithin(e,r,r+t),Ar=[],ho=(e,r,t,n)=>(e=Ar[e],r=he.toValue(r),e(null,r,t,n)),mo=e=>{var r=Ar.length;return Ar.push(e),r},dt=(e,r)=>{var t=ve[e];return t===void 0&&C(`${r} has unknown type ${lt(e)}`),t},go=(e,r)=>{for(var t=new Array(e),n=0;n<e;++n)t[n]=dt(T[r+n*4>>2],"parameter "+n);return t},yo=Reflect.construct,wo=(e,r,t)=>{var n=[],o=e.toWireType(n,t);return n.length&&(T[r>>2]=he.toHandle(n)),o},_o=(e,r,t)=>{var n=go(e,r),o=n.shift();e--;var i=new Array(e),s=(c,f,d,g)=>{for(var p=0,m=0;m<e;++m)i[m]=n[m].readValueFromPointer(g+p),p+=n[m].argPackAdvance;var y=t===1?yo(f,i):f.apply(c,i);return wo(o,d,y)},l=`methodCaller<(${n.map(c=>c.name).join(", ")}) => ${o.name}>`;return mo(Ze(l,s))},Eo=e=>{e>9&&(ne[e+1]+=1)},ko=e=>{var r=he.toValue(e);wr(r),kr(e)},bo=(e,r)=>{e=dt(e,"_emval_take_value");var t=e.readValueFromPointer(r);return he.toHandle(t)},Me=(e,r)=>r+2097152>>>0<4194305-!!e?(e>>>0)+r*4294967296:NaN;function Ao(e,r,t){var n=Me(e,r),o=new Date(n*1e3);_[t>>2]=o.getUTCSeconds(),_[t+4>>2]=o.getUTCMinutes(),_[t+8>>2]=o.getUTCHours(),_[t+12>>2]=o.getUTCDate(),_[t+16>>2]=o.getUTCMonth(),_[t+20>>2]=o.getUTCFullYear()-1900,_[t+24>>2]=o.getUTCDay();var i=Date.UTC(o.getUTCFullYear(),0,1,0,0,0,0),s=(o.getTime()-i)/(1e3*60*60*24)|0;_[t+28>>2]=s}var Po=e=>e%4===0&&(e%100!==0||e%400===0),Co=[0,31,60,91,121,152,182,213,244,274,305,335],To=[0,31,59,90,120,151,181,212,243,273,304,334],Fo=e=>{var r=Po(e.getFullYear()),t=r?Co:To,n=t[e.getMonth()]+e.getDate()-1;return n};function So(e,r,t){var n=Me(e,r),o=new Date(n*1e3);_[t>>2]=o.getSeconds(),_[t+4>>2]=o.getMinutes(),_[t+8>>2]=o.getHours(),_[t+12>>2]=o.getDate(),_[t+16>>2]=o.getMonth(),_[t+20>>2]=o.getFullYear()-1900,_[t+24>>2]=o.getDay();var i=Fo(o)|0;_[t+28>>2]=i,_[t+36>>2]=-(o.getTimezoneOffset()*60);var s=new Date(o.getFullYear(),0,1),l=new Date(o.getFullYear(),6,1).getTimezoneOffset(),c=s.getTimezoneOffset(),f=(l!=c&&o.getTimezoneOffset()==Math.min(c,l))|0;_[t+32>>2]=f}function Do(e,r,t,n,o,i,s,l){var c=Me(o,i);try{if(isNaN(c))return 61;var f=I.getStreamFromFD(n),d=a.mmap(f,e,c,r,t),g=d.ptr;return _[s>>2]=d.allocated,T[l>>2]=g,0}catch(p){if(typeof a=="undefined"||p.name!=="ErrnoError")throw p;return-p.errno}}function Ro(e,r,t,n,o,i,s){var l=Me(i,s);try{var c=I.getStreamFromFD(o);t&2&&I.doMsync(e,c,r,n,l)}catch(f){if(typeof a=="undefined"||f.name!=="ErrnoError")throw f;return-f.errno}}var $o=(e,r,t,n)=>{var o=new Date().getFullYear(),i=new Date(o,0,1),s=new Date(o,6,1),l=i.getTimezoneOffset(),c=s.getTimezoneOffset(),f=Math.max(l,c);T[e>>2]=f*60,_[r>>2]=+(l!=c);var d=m=>m.toLocaleTimeString(void 0,{hour12:!1,timeZoneName:"short"}).split(" ")[1],g=d(i),p=d(s);c<l?(de(g,t,17),de(p,n,17)):(de(g,n,17),de(p,t,17))},Mo=()=>Date.now(),vt=()=>2147483648,Oo=()=>vt(),pt;pt=()=>performance.now();var Wo=e=>{var r=Be.buffer,t=(e-r.byteLength+65535)/65536;try{return Be.grow(t),jr(),1}catch(n){}},jo=e=>{var r=B.length;e>>>=0;var t=vt();if(e>t)return!1;for(var n=(c,f)=>c+(f-c%f)%f,o=1;o<=4;o*=2){var i=r*(1+.2/o);i=Math.min(i,e+100663296);var s=Math.min(t,n(Math.max(e,i),65536)),l=Wo(s);if(l)return!0}return!1},Pr={},Io=()=>me||"./this.program",Oe=()=>{if(!Oe.strings){var e=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:e,_:Io()};for(var t in Pr)Pr[t]===void 0?delete r[t]:r[t]=Pr[t];var n=[];for(var t in r)n.push(`${t}=${r[t]}`);Oe.strings=n}return Oe.strings},No=(e,r)=>{for(var t=0;t<e.length;++t)U[r++]=e.charCodeAt(t);U[r]=0},xo=(e,r)=>{var t=0;return Oe().forEach((n,o)=>{var i=r+t;T[e+o*4>>2]=i,No(n,i),t+=n.length+1}),0},Uo=(e,r)=>{var t=Oe();T[e>>2]=t.length;var n=0;return t.forEach(o=>n+=o.length+1),T[r>>2]=n,0},Lo=0,Ho=()=>qt||Lo>0,Bo=e=>{var r;lr=e,Ho()||((r=u.onExit)==null||r.call(u,e),sr=!0),be(e,new Vt(e))},zo=(e,r)=>{lr=e,Bo(e)},Vo=zo;function qo(e){try{var r=I.getStreamFromFD(e);return a.close(r),0}catch(t){if(typeof a=="undefined"||t.name!=="ErrnoError")throw t;return t.errno}}function Go(e,r){try{var t=0,n=0,o=0,i=I.getStreamFromFD(e),s=i.tty?2:a.isDir(i.mode)?3:a.isLink(i.mode)?7:4;return U[r]=s,ee[r+2>>1]=o,j=[t>>>0,(E=t,+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],_[r+8>>2]=j[0],_[r+12>>2]=j[1],j=[n>>>0,(E=n,+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],_[r+16>>2]=j[0],_[r+20>>2]=j[1],0}catch(l){if(typeof a=="undefined"||l.name!=="ErrnoError")throw l;return l.errno}}var Ko=(e,r,t,n)=>{for(var o=0,i=0;i<t;i++){var s=T[r>>2],l=T[r+4>>2];r+=8;var c=a.read(e,U,s,l,n);if(c<0)return-1;if(o+=c,c<l)break;typeof n!="undefined"&&(n+=c)}return o};function Xo(e,r,t,n){try{var o=I.getStreamFromFD(e),i=Ko(o,r,t);return T[n>>2]=i,0}catch(s){if(typeof a=="undefined"||s.name!=="ErrnoError")throw s;return s.errno}}function Yo(e,r,t,n,o){var i=Me(r,t);try{if(isNaN(i))return 61;var s=I.getStreamFromFD(e);return a.llseek(s,i,n),j=[s.position>>>0,(E=s.position,+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],_[o>>2]=j[0],_[o+4>>2]=j[1],s.getdents&&i===0&&n===0&&(s.getdents=null),0}catch(l){if(typeof a=="undefined"||l.name!=="ErrnoError")throw l;return l.errno}}var Qo=(e,r,t,n)=>{for(var o=0,i=0;i<t;i++){var s=T[r>>2],l=T[r+4>>2];r+=8;var c=a.write(e,U,s,l,n);if(c<0)return-1;o+=c,typeof n!="undefined"&&(n+=c)}return o};function Zo(e,r,t,n){try{var o=I.getStreamFromFD(e),i=Qo(o,r,t);return T[n>>2]=i,0}catch(s){if(typeof a=="undefined"||s.name!=="ErrnoError")throw s;return s.errno}}var Jo=a.createPath,ea=e=>a.unlink(e),ra=a.createLazyFile,ta=a.createDevice;a.createPreloadedFile=Xr,a.staticInit(),u.FS_createPath=a.createPath,u.FS_createDataFile=a.createDataFile,u.FS_createPreloadedFile=a.createPreloadedFile,u.FS_unlink=a.unlink,u.FS_createLazyFile=a.createLazyFile,u.FS_createDevice=a.createDevice,pn(),Ee=u.BindingError=class extends Error{constructor(r){super(r),this.name="BindingError"}},Zr=u.InternalError=class extends Error{constructor(r){super(r),this.name="InternalError"}},Cn(),kn(),On(),st=u.UnboundTypeError=Nn(Error,"UnboundTypeError"),qn();var na={a:Xt,q:on,M:an,P:sn,I:ln,r:un,G:cn,N:fn,S:dn,D:vn,U:mn,e:xn,s:Ln,n:Hn,g:Bn,m:zn,T:ct,v:Xn,i:Yn,c:Zn,b:Jn,x:eo,o:ro,u:to,l:uo,V:co,Q:vo,R:po,X:ho,d:kr,Y:_o,w:Eo,W:ko,h:bo,A:Ao,B:So,y:Do,z:Ro,H:$o,t:Mo,F:Oo,j:pt,E:jo,K:xo,L:Uo,f:Vo,k:qo,J:Go,O:Xo,C:Yo,p:Zo},N=zt(),oa=()=>(oa=N._)(),ht=e=>(ht=N.$)(e),Cr=e=>(Cr=N.ba)(e),oe=e=>(oe=N.ca)(e),mt=(e,r)=>(mt=N.da)(e,r),gt=e=>(gt=N.ea)(e),aa=u.dynCall_jjj=(e,r,t,n,o)=>(aa=u.dynCall_jjj=N.fa)(e,r,t,n,o),ia=u.dynCall_iiiijj=(e,r,t,n,o,i,s,l)=>(ia=u.dynCall_iiiijj=N.ga)(e,r,t,n,o,i,s,l),sa=u.dynCall_viijj=(e,r,t,n,o,i,s)=>(sa=u.dynCall_viijj=N.ha)(e,r,t,n,o,i,s),la=u.dynCall_viiijjjj=(e,r,t,n,o,i,s,l,c,f,d,g)=>(la=u.dynCall_viiijjjj=N.ia)(e,r,t,n,o,i,s,l,c,f,d,g),ua=u.dynCall_iji=(e,r,t,n)=>(ua=u.dynCall_iji=N.ja)(e,r,t,n),ca=u.dynCall_jiji=(e,r,t,n,o)=>(ca=u.dynCall_jiji=N.ka)(e,r,t,n,o),fa=u.dynCall_viijii=(e,r,t,n,o,i,s)=>(fa=u.dynCall_viijii=N.la)(e,r,t,n,o,i,s),da=u.dynCall_iiiiij=(e,r,t,n,o,i,s)=>(da=u.dynCall_iiiiij=N.ma)(e,r,t,n,o,i,s),va=u.dynCall_iiiiijj=(e,r,t,n,o,i,s,l,c)=>(va=u.dynCall_iiiiijj=N.na)(e,r,t,n,o,i,s,l,c),pa=u.dynCall_iiiiiijj=(e,r,t,n,o,i,s,l,c,f)=>(pa=u.dynCall_iiiiiijj=N.oa)(e,r,t,n,o,i,s,l,c,f);u.addRunDependency=Ve,u.removeRunDependency=Ce,u.FS_createPreloadedFile=Xr,u.FS_unlink=ea,u.FS_createPath=Jo,u.FS_createDevice=ta,u.FS_createDataFile=Kr,u.FS_createLazyFile=ra;var or;Pe=function e(){or||yt(),or||(Pe=e)};function yt(){if(fe>0||(Mt(),fe>0))return;function e(){var r;or||(or=!0,u.calledRun=!0,!sr&&(Ot(),W(u),(r=u.onRuntimeInitialized)==null||r.call(u),Wt()))}u.setStatus?(u.setStatus("Running..."),setTimeout(function(){setTimeout(function(){u.setStatus("")},1),e()},1)):e()}if(u.preInit)for(typeof u.preInit=="function"&&(u.preInit=[u.preInit]);u.preInit.length>0;)u.preInit.pop()();return yt(),w=X,w}})();typeof Ct=="object"&&typeof Fr=="object"?Fr.exports=Tr:typeof define=="function"&&define.amd&&define([],()=>Tr);Tr.getUrl=function(R){return"https://st.mycdn.me/static/audio-processing/0-0-8/"+R}});var Ne=class{constructor(h,v="AudioEffects"){this.loggerFunction=h,this.loggerName=v}debug(...h){this.loggerFunction("DEBUG",`[${this.loggerName}]`,...h)}log(...h){this.loggerFunction("LOG",`[${this.loggerName}]`,...h)}warn(...h){this.loggerFunction("WARN",`[${this.loggerName}]`,...h)}error(...h){this.loggerFunction("ERROR",`[${this.loggerName}]`,...h)}};function ar(R,h=[]){let v=h.join(","),w=typeof R=="string"?[R,`exports.default(${v});`]:[`(${R})(${v});`],u=new Blob(w,{type:"application/javascript; charset=utf-8"});return window.URL.createObjectURL(u)}var ke=class{constructor(){this.outputStream=null;this.isInitialized=!1;this.audioContext=null;this.workletNode=null;this.sourceNode=null;this.logger=new Ne(()=>{})}init(L){return Z(this,arguments,function*({sampleRate:h,isOutputAudio:v=!1,isOutputStream:w=!1,workletFunction:u,workletName:W}){if(this.logger.debug("init"),this.createAudioContext(h),yield this.createWorklet(u,W),this.workletNode&&this.audioContext&&(v&&(this.workletNode.connect(this.audioContext.destination),this.logger.debug("connected to standart audio output")),w)){let X=this.audioContext.createMediaStreamDestination();this.workletNode.connect(X),this.outputStream=X.stream,this.logger.debug("connected to output MediaStream")}this.isInitialized=!0})}setSource(h){var v;if(this.audioContext&&this.workletNode){let w=null;if(h){let u=new MediaStream(h instanceof MediaStreamTrack?[h]:h.getAudioTracks().filter(W=>W.contentHint!=="music"));w=this.audioContext.createMediaStreamSource(u)}(v=this.sourceNode)==null||v.disconnect(this.workletNode),w==null||w.connect(this.workletNode),this.sourceNode=w,this.logger.debug("source "+(h?"set":"set to null"))}}destroy(){var h;this.logger.debug("destroy"),(h=this.audioContext)==null||h.close(),this.workletNode=null,this.sourceNode=null,this.audioContext=null,this.outputStream=null,this.isInitialized=!1}resume(){var h;this.logger.debug("resume"),(h=this.audioContext)==null||h.resume()}pause(){var h;this.logger.debug("pause"),(h=this.audioContext)==null||h.suspend()}setLogger(h=()=>{},v){this.logger=new Ne(h,v)}static isSupported(){try{let h=window;return!!(h.WebAssembly&&h.Worker&&(h.AudioContext||h.webkitAudioContext)&&h.AudioWorkletNode)}catch(h){return!1}}createAudioContext(h){let v=window.AudioContext||window.webkitAudioContext,w=new v(h?{sampleRate:h}:{});this.audioContext=w,this.logger.debug("created AudioContext")}createWorklet(h,v){return Z(this,null,function*(){if(this.logger.debug(`${v} init started`),!this.audioContext)return;yield this.audioContext.audioWorklet.addModule(ar(h));let w=new AudioWorkletNode(this.audioContext,v);return this.workletNode=w,new Promise(u=>{w.port.onmessage=({data:W})=>{switch(W.type){case"init":{this.logger.debug(`${v} init success`),u();break}case"data":{this.onWorkletData(W.data);break}}}})})}sendDataToWorklet(h,v=[]){var w;(w=this.workletNode)==null||w.port.postMessage(h,v)}};function Pt(){let G=[.26691192,.5013858,.3037737,.58564115,.35116732,.67516255,.41435885,.7225562,.4775504,.7752158,.5881356,.79627967,.68818885,.7594179,.75138044,.7120243,.8040401,.65936464,.85143363,.57510924,.8777635,.4855879,.4512206,.58564115,.5038802,.56457734,.5512739,.5540454,.5776037,.56457734,.60393345,.5540454,.66712505,.56457734,.70398676,.57510924,.65132713,.606705,.6144654,.6172369,.5776037,.6172369,.5407419,.6172369,.5038802,.606705,.46701849,.58564115,.5407419,.58564115,.5776037,.58564115,.6144654,.58564115,.68818885,.57510924,.6144654,.58564115,.5776037,.58564115,.5407419,.58564115],J=G[59],$r=1-G[59];class He extends AudioWorkletProcessor{constructor(){super();this.lastTime=0;this.frameSampleCount=0;this.frameSampleAverage=0;this.maxInputVolume=.3;this.sequence=0;this.port.postMessage({type:"init"})}process(me){var ge;let be=currentTime,K=0,ce=(ge=me==null?void 0:me[0])==null?void 0:ge[0];if(ce!=null&&ce.length&&(K=ce.reduce((ae,z)=>ae+Math.abs(z),0)/ce.length),this.frameSampleAverage=(this.frameSampleAverage*this.frameSampleCount+K)/(this.frameSampleCount+1),this.frameSampleCount+=1,be-this.lastTime>1/25){let Y=[];for(let z=0;z<31*2;z+=1)Y.push(G[z]);this.frameSampleAverage>.015&&(Y[59]=this.frameSampleAverage/this.maxInputVolume>.5?this.sequence%2===0?this.frameSampleAverage/2:this.frameSampleAverage:this.frameSampleAverage,Y[59]=J+$r*Y[59]/.5),this.sequence+=1,this.frameSampleCount=1,this.maxInputVolume=Math.max(this.maxInputVolume,this.frameSampleAverage),this.lastTime=be;let ae=new Float32Array(Y).buffer;this.port.postMessage({type:"data",data:ae},[ae])}return!0}}registerProcessor("vmojiLmarksVolumeWorklet",He)}var xe=class extends ke{constructor(){super(...arguments);this.onData=()=>{}}init(){return Z(this,null,function*(){yield le(xe.prototype,this,"init").call(this,{workletFunction:Pt,workletName:"vmojiLmarksVolumeWorklet"})})}onWorkletData(v){this.onData(v)}};var Dr=bt(Sr());var ue=class extends ke{constructor(){super(...arguments);this.worker=null;this.performanceMonitor=null}init(v){return Z(this,null,function*(){yield le(ue.prototype,this,"init").call(this,v),this.isInitialized=!1,yield this.createWorker(v.workerFunctionString,v.workerArgs),this.isInitialized=!0})}resume(){var v;super.resume(),(v=this.performanceMonitor)==null||v.start()}pause(){var v;super.pause(),(v=this.performanceMonitor)==null||v.stop()}setLogger(v,w){var u;super.setLogger(v,w),(u=this.performanceMonitor)==null||u.setLogger(this.logger)}destroy(){var v,w;super.destroy(),(v=this.performanceMonitor)==null||v.stop(),(w=this.worker)==null||w.terminate(),this.worker=null}sendDataToWorker(v,w=[]){var u;(u=this.worker)==null||u.postMessage(v,w)}static isSupported(){try{let v=window;return!!(super.isSupported()&&v.Worker)}catch(v){return!1}}createWorker(v,w=[]){return new Promise((u,W)=>{this.logger.debug("worker init started"),this.worker=new Worker(ar(v,w)),this.worker.onmessage=({data:L})=>{switch(L.type){case"init":{this.logger.debug("worker init success"),u();break}case"error":{this.logger.error(L.error),W(L.error);break}case"data":{this.onWorkerData(L.data);break}case"debug":{this.logger.debug(L.message);break}}}})}};function Tt(){class R extends AudioWorkletProcessor{constructor(){super(),this.port.postMessage({type:"init"})}process(v){var w;return(w=v==null?void 0:v[0])!=null&&w[0]&&this.port.postMessage({type:"data",data:v[0][0].buffer},[v[0][0].buffer]),!0}}registerProcessor("pureWorklet",R)}var ka=16e3,Ue=class extends ue{constructor(){super(...arguments);this.onData=()=>{}}init(){return Z(this,null,function*(){yield le(Ue.prototype,this,"init").call(this,{sampleRate:ka,workletFunction:Tt,workletName:"pureWorklet",workerFunctionString:`"use strict";var exports=(()=>{var p=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var b=(o,t)=>{for(var e in t)p(o,e,{get:t[e],enumerable:!0})},y=(o,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of f(t))!w.call(o,i)&&i!==e&&p(o,i,{get:()=>t[i],enumerable:!(n=m(t,i))||n.enumerable});return o};var A=o=>y(p({},"__esModule",{value:!0}),o);var x={};b(x,{default:()=>v});var v=(o,t)=>{let e=null,n=null;function i(){return o({locateFile:t}).then(r=>{e=r;let l=new e.ConfigInput("animoji_v4.cfg",!0,"/"),s=new e.Config(l);n=e.AnimojiFactory.createAlgorithm(s)})}function g(r){self.postMessage({type:"error",error:typeof r=="number"&&e?e.getExMessage(r):r})}function k(r){var l;if(!(!e||!n))try{let s=new e.vector$float$,h=new Float32Array(r);for(let u of h)s.push_back(u);let a=e.animate(n,s),d=(l=a==null?void 0:a.size)==null?void 0:l.call(a);if(!d)return;let c=new Float32Array(d);for(let u=0;u<d;u++)c[u]=a.get(u);self.postMessage({type:"data",data:c.buffer},[c.buffer])}catch(s){g(s)}}i().then(()=>{self.onmessage=r=>{k(r.data.data)},self.postMessage({type:"init"})}).catch(g)};return A(x);})();
|
|
9
|
-
`,workerArgs:[Dr.default,Dr.default.getUrl]})})}onWorkletData(v){this.sendDataToWorker({data:v},[v])}onWorkerData(v){this.onData(v)}static isSupported(){try{let v=super.isSupported(),w=/firefox/i.test(navigator.userAgent);return v&&!w}catch(v){return!1}}};var Rr=bt(Sr());function Ft(){class R extends AudioWorkletProcessor{constructor(){super();this.samplesQueue=new Float32Array;this.port.postMessage({type:"init"}),this.port.onmessage=({data:{data:w}})=>{let u=new Float32Array(w)
|
|
6
|
+
var ha=Object.create;var Et=Object.defineProperty;var ma=Object.getOwnPropertyDescriptor;var ga=Object.getOwnPropertyNames;var kt=Object.getPrototypeOf,ya=Object.prototype.hasOwnProperty;var wa=Reflect.get;var _a=(R,h)=>()=>(h||R((h={exports:{}}).exports,h),h.exports);var Ea=(R,h,v,w)=>{if(h&&typeof h=="object"||typeof h=="function")for(let u of ga(h))!ya.call(R,u)&&u!==v&&Et(R,u,{get:()=>h[u],enumerable:!(w=ma(h,u))||w.enumerable});return R};var bt=(R,h,v)=>(v=R!=null?ha(kt(R)):{},Ea(h||!R||!R.__esModule?Et(v,"default",{value:R,enumerable:!0}):v,R));var le=(R,h,v)=>wa(kt(R),v,h);var J=(R,h,v)=>new Promise((w,u)=>{var M=K=>{try{G(v.next(K))}catch(Z){u(Z)}},L=K=>{try{G(v.throw(K))}catch(Z){u(Z)}},G=K=>K.done?w(K.value):Promise.resolve(K.value).then(M,L);G((v=v.apply(R,h)).next())});var Sr=_a((Ct,Fr)=>{var Tr=(()=>{var h;var R=typeof document!="undefined"?(h=document.currentScript)==null?void 0:h.src:void 0;return function(v={}){var w,u=v,M,L,G=new Promise((e,r)=>{M=e,L=r}),K=typeof window=="object",Z=typeof importScripts=="function",Mr=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";u.expectedDataFileDownloads||(u.expectedDataFileDownloads=0),u.expectedDataFileDownloads++,(()=>{var e=typeof ENVIRONMENT_IS_PTHREAD!="undefined"&&ENVIRONMENT_IS_PTHREAD,r=typeof ENVIRONMENT_IS_WASM_WORKER!="undefined"&&ENVIRONMENT_IS_WASM_WORKER;if(e||r)return;function t(n){var o="";typeof window=="object"?o=window.encodeURIComponent(window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/"):typeof process=="undefined"&&typeof location!="undefined"&&(o=encodeURIComponent(location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"));var i="wasm_bindings.data",s="wasm_bindings.data";typeof u.locateFilePackage=="function"&&!u.locateFile&&(u.locateFile=u.locateFilePackage,z("warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)"));var l=u.locateFile?u.locateFile(s,""):s,c=n.remote_package_size;function f(y,P,D,F){var b=new XMLHttpRequest;b.open("GET",y,!0),b.responseType="arraybuffer",b.onprogress=function(A){var wt,_t;var O=y,S=P;if(A.total&&(S=A.total),A.loaded){b.addedTotal?u.dataFileDownloads[O].loaded=A.loaded:(b.addedTotal=!0,u.dataFileDownloads||(u.dataFileDownloads={}),u.dataFileDownloads[O]={loaded:A.loaded,total:S});var x=0,W=0,We=0;for(var je in u.dataFileDownloads){var Ie=u.dataFileDownloads[je];x+=Ie.total,W+=Ie.loaded,We++}x=Math.ceil(x*u.expectedDataFileDownloads/We),(wt=u.setStatus)==null||wt.call(u,`Downloading data... (${W}/${x})`)}else u.dataFileDownloads||(_t=u.setStatus)==null||_t.call(u,"Downloading data...")},b.onerror=function(A){throw new Error("NetworkError for: "+y)},b.onload=function(A){if(b.status==200||b.status==304||b.status==206||b.status==0&&b.response){var O=b.response;D(O)}else throw new Error(b.statusText+" : "+b.responseURL)},b.send(null)}function d(y){console.error("package error:",y)}var g=null,p=u.getPreloadedPackage?u.getPreloadedPackage(l,c):null;p||f(l,c,function(y){g?(g(y),g=null):p=y},d);function m(y){function P(O,S){if(!O)throw S+new Error().stack}function D(O,S,x){this.start=O,this.end=S,this.audio=x}D.prototype={requests:{},open:function(O,S){this.name=S,this.requests[S]=this,y.addRunDependency(`fp ${this.name}`)},send:function(){},onload:function(){var O=this.byteArray.subarray(this.start,this.end);this.finish(O)},finish:function(O){var S=this;y.FS_createDataFile(this.name,null,O,!0,!0,!0),y.removeRunDependency(`fp ${S.name}`),this.requests[this.name]=null}};for(var F=n.files,b=0;b<F.length;++b)new D(F[b].start,F[b].end,F[b].audio||0).open("GET",F[b].filename);function A(O){P(O,"Loading data file failed."),P(O.constructor.name===ArrayBuffer.name,"bad input to processPackageData");var S=new Uint8Array(O);D.prototype.byteArray=S;for(var x=n.files,W=0;W<x.length;++W)D.prototype.requests[x[W].filename].onload();y.removeRunDependency("datafile_wasm_bindings.data")}y.addRunDependency("datafile_wasm_bindings.data"),y.preloadResults||(y.preloadResults={}),y.preloadResults[i]={fromCache:!1},p?(A(p),p=null):g=A}u.calledRun?m(u):(u.preRun||(u.preRun=[]),u.preRun.push(m))}t({files:[{filename:"/animoji_v4.cfg",start:0,end:333},{filename:"/balloon.cfg",start:333,end:409},{filename:"/cathedral.cfg",start:409,end:586},{filename:"/chorus.cfg",start:586,end:865},{filename:"/denoise.cfg",start:865,end:3258},{filename:"/df2_lstm_full_silent.tflite",start:3258,end:3169978},{filename:"/distortion.cfg",start:3169978,end:3170120},{filename:"/echo.cfg",start:3170120,end:3170257},{filename:"/evil.cfg",start:3170257,end:3170398},{filename:"/giant.cfg",start:3170398,end:3170474},{filename:"/hall.cfg",start:3170474,end:3170647},{filename:"/phaser.cfg",start:3170647,end:3170747},{filename:"/robot.cfg",start:3170747,end:3170887},{filename:"/squirell.cfg",start:3170887,end:3170963},{filename:"/wav2lip_lite_rec-v4-v2.tflite",start:3170963,end:7456043}],remote_package_size:7456043})})();var He=null,H=Object.assign({},u),$r=[],me="./this.program",be=(e,r)=>{throw r},X="";function ce(e){return u.locateFile?u.locateFile(e,X):X+e}var ge,Y;(K||Z)&&(Z?X=self.location.href:typeof document!="undefined"&&document.currentScript&&(X=document.currentScript.src),He&&(X=He),X.startsWith("blob:")?X="":X=X.substr(0,X.replace(/[?#].*/,"").lastIndexOf("/")+1),Z&&(Y=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),ge=e=>fetch(e,{credentials:"same-origin"}).then(r=>r.ok?r.arrayBuffer():Promise.reject(new Error(r.status+" : "+r.url))));var ae=u.print||console.log.bind(console),z=u.printErr||console.error.bind(console);Object.assign(u,H),H=null,u.arguments&&($r=u.arguments),u.thisProgram&&(me=u.thisProgram),u.quit&&(be=u.quit);var Ae;u.wasmBinary&&(Ae=u.wasmBinary);var Be,sr=!1,lr,U,B,ee,ze,_,T,Or,Wr;function jr(){var e=Be.buffer;u.HEAP8=U=new Int8Array(e),u.HEAP16=ee=new Int16Array(e),u.HEAPU8=B=new Uint8Array(e),u.HEAPU16=ze=new Uint16Array(e),u.HEAP32=_=new Int32Array(e),u.HEAPU32=T=new Uint32Array(e),u.HEAPF32=Or=new Float32Array(e),u.HEAPF64=Wr=new Float64Array(e)}var Ir=[],Nr=[],xr=[],Mt=!1;function $t(){if(u.preRun)for(typeof u.preRun=="function"&&(u.preRun=[u.preRun]);u.preRun.length;)jt(u.preRun.shift());fr(Ir)}function Ot(){Mt=!0,!u.noFSInit&&!a.init.initialized&&a.init(),a.ignorePermissions=!1,ie.init(),fr(Nr)}function Wt(){if(u.postRun)for(typeof u.postRun=="function"&&(u.postRun=[u.postRun]);u.postRun.length;)Nt(u.postRun.shift());fr(xr)}function jt(e){Ir.unshift(e)}function It(e){Nr.unshift(e)}function Nt(e){xr.unshift(e)}var fe=0,ur=null,Pe=null;function Ca(e){return e}function Ve(e){var r;fe++,(r=u.monitorRunDependencies)==null||r.call(u,fe)}function Ce(e){var t;if(fe--,(t=u.monitorRunDependencies)==null||t.call(u,fe),fe==0&&(ur!==null&&(clearInterval(ur),ur=null),Pe)){var r=Pe;Pe=null,r()}}function cr(e){var t;(t=u.onAbort)==null||t.call(u,e),e="Aborted("+e+")",z(e),sr=!0,lr=1,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw L(r),r}var xt="data:application/octet-stream;base64,",Ur=e=>e.startsWith(xt);function Ut(){var e="wasm_bindings.wasm";return Ur(e)?e:ce(e)}var qe;function Lr(e){if(e==qe&&Ae)return new Uint8Array(Ae);if(Y)return Y(e);throw"both async and sync fetching of the wasm failed"}function Lt(e){return Ae?Promise.resolve().then(()=>Lr(e)):ge(e).then(r=>new Uint8Array(r),()=>Lr(e))}function Hr(e,r,t){return Lt(e).then(n=>WebAssembly.instantiate(n,r)).then(t,n=>{z(`failed to asynchronously prepare wasm: ${n}`),cr(n)})}function Ht(e,r,t,n){return!e&&typeof WebAssembly.instantiateStreaming=="function"&&!Ur(r)&&typeof fetch=="function"?fetch(r,{credentials:"same-origin"}).then(o=>{var i=WebAssembly.instantiateStreaming(o,t);return i.then(n,function(s){return z(`wasm streaming compile failed: ${s}`),z("falling back to ArrayBuffer instantiation"),Hr(r,t,n)})}):Hr(r,t,n)}function Bt(){return{a:na}}function zt(){var e=Bt();function r(n,o){return N=n.exports,Be=N.Z,jr(),at=N.aa,It(N._),Ce("wasm-instantiate"),N}Ve("wasm-instantiate");function t(n){r(n.instance)}if(u.instantiateWasm)try{return u.instantiateWasm(e,r)}catch(n){z(`Module.instantiateWasm callback failed with error: ${n}`),L(n)}return qe||(qe=Ut()),Ht(Ae,qe,e,t).catch(L),{}}var E,j;function Vt(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var fr=e=>{for(;e.length>0;)e.shift()(u)},qt=u.noExitRuntime||!0;class Gt{constructor(r){this.excPtr=r,this.ptr=r-24}set_type(r){T[this.ptr+4>>2]=r}get_type(){return T[this.ptr+4>>2]}set_destructor(r){T[this.ptr+8>>2]=r}get_destructor(){return T[this.ptr+8>>2]}set_caught(r){r=r?1:0,U[this.ptr+12]=r}get_caught(){return U[this.ptr+12]!=0}set_rethrown(r){r=r?1:0,U[this.ptr+13]=r}get_rethrown(){return U[this.ptr+13]!=0}init(r,t){this.set_adjusted_ptr(0),this.set_type(r),this.set_destructor(t)}set_adjusted_ptr(r){T[this.ptr+16>>2]=r}get_adjusted_ptr(){return T[this.ptr+16>>2]}get_exception_ptr(){var r=gt(this.get_type());if(r)return T[this.excPtr>>2];var t=this.get_adjusted_ptr();return t!==0?t:this.excPtr}}var Br=0,Kt=0,Xt=(e,r,t)=>{var n=new Gt(e);throw n.init(r,t),Br=e,Kt++,Br};function Ge(){var e=_[+I.varargs>>2];return I.varargs+=4,e}var ye=Ge,$={isAbs:e=>e.charAt(0)==="/",splitPath:e=>{var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return r.exec(e).slice(1)},normalizeArray:(e,r)=>{for(var t=0,n=e.length-1;n>=0;n--){var o=e[n];o==="."?e.splice(n,1):o===".."?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:e=>{var r=$.isAbs(e),t=e.substr(-1)==="/";return e=$.normalizeArray(e.split("/").filter(n=>!!n),!r).join("/"),!e&&!r&&(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:e=>{var r=$.splitPath(e),t=r[0],n=r[1];return!t&&!n?".":(n&&(n=n.substr(0,n.length-1)),t+n)},basename:e=>{if(e==="/")return"/";e=$.normalize(e),e=e.replace(/\/$/,"");var r=e.lastIndexOf("/");return r===-1?e:e.substr(r+1)},join:(...e)=>$.normalize(e.join("/")),join2:(e,r)=>$.normalize(e+"/"+r)},Yt=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return e=>crypto.getRandomValues(e);cr("initRandomDevice")},zr=e=>(zr=Yt())(e),re={resolve:(...e)=>{for(var r="",t=!1,n=e.length-1;n>=-1&&!t;n--){var o=n>=0?e[n]:a.cwd();if(typeof o!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!o)return"";r=o+"/"+r,t=$.isAbs(o)}return r=$.normalizeArray(r.split("/").filter(i=>!!i),!t).join("/"),(t?"/":"")+r||"."},relative:(e,r)=>{e=re.resolve(e).substr(1),r=re.resolve(r).substr(1);function t(f){for(var d=0;d<f.length&&f[d]==="";d++);for(var g=f.length-1;g>=0&&f[g]==="";g--);return d>g?[]:f.slice(d,g-d+1)}for(var n=t(e.split("/")),o=t(r.split("/")),i=Math.min(n.length,o.length),s=i,l=0;l<i;l++)if(n[l]!==o[l]){s=l;break}for(var c=[],l=s;l<n.length;l++)c.push("..");return c=c.concat(o.slice(s)),c.join("/")}},Vr=typeof TextDecoder!="undefined"?new TextDecoder:void 0,we=(e,r,t)=>{for(var n=r+t,o=r;e[o]&&!(o>=n);)++o;if(o-r>16&&e.buffer&&Vr)return Vr.decode(e.subarray(r,o));for(var i="";r<o;){var s=e[r++];if(!(s&128)){i+=String.fromCharCode(s);continue}var l=e[r++]&63;if((s&224)==192){i+=String.fromCharCode((s&31)<<6|l);continue}var c=e[r++]&63;if((s&240)==224?s=(s&15)<<12|l<<6|c:s=(s&7)<<18|l<<12|c<<6|e[r++]&63,s<65536)i+=String.fromCharCode(s);else{var f=s-65536;i+=String.fromCharCode(55296|f>>10,56320|f&1023)}}return i},dr=[],Te=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n<=127?r++:n<=2047?r+=2:n>=55296&&n<=57343?(r+=4,++t):r+=3}return r},vr=(e,r,t,n)=>{if(!(n>0))return 0;for(var o=t,i=t+n-1,s=0;s<e.length;++s){var l=e.charCodeAt(s);if(l>=55296&&l<=57343){var c=e.charCodeAt(++s);l=65536+((l&1023)<<10)|c&1023}if(l<=127){if(t>=i)break;r[t++]=l}else if(l<=2047){if(t+1>=i)break;r[t++]=192|l>>6,r[t++]=128|l&63}else if(l<=65535){if(t+2>=i)break;r[t++]=224|l>>12,r[t++]=128|l>>6&63,r[t++]=128|l&63}else{if(t+3>=i)break;r[t++]=240|l>>18,r[t++]=128|l>>12&63,r[t++]=128|l>>6&63,r[t++]=128|l&63}}return r[t]=0,t-o};function qr(e,r,t){var n=t>0?t:Te(e)+1,o=new Array(n),i=vr(e,o,0,o.length);return r&&(o.length=i),o}var Qt=()=>{if(!dr.length){var e=null;if(typeof window!="undefined"&&typeof window.prompt=="function"&&(e=window.prompt("Input: "),e!==null&&(e+=`
|
|
7
|
+
`)),!e)return null;dr=qr(e,!0)}return dr.shift()},ie={ttys:[],init(){},shutdown(){},register(e,r){ie.ttys[e]={input:[],output:[],ops:r},a.registerDevice(e,ie.stream_ops)},stream_ops:{open(e){var r=ie.ttys[e.node.rdev];if(!r)throw new a.ErrnoError(43);e.tty=r,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,r,t,n,o){if(!e.tty||!e.tty.ops.get_char)throw new a.ErrnoError(60);for(var i=0,s=0;s<n;s++){var l;try{l=e.tty.ops.get_char(e.tty)}catch(c){throw new a.ErrnoError(29)}if(l===void 0&&i===0)throw new a.ErrnoError(6);if(l==null)break;i++,r[t+s]=l}return i&&(e.node.timestamp=Date.now()),i},write(e,r,t,n,o){if(!e.tty||!e.tty.ops.put_char)throw new a.ErrnoError(60);try{for(var i=0;i<n;i++)e.tty.ops.put_char(e.tty,r[t+i])}catch(s){throw new a.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),i}},default_tty_ops:{get_char(e){return Qt()},put_char(e,r){r===null||r===10?(ae(we(e.output,0)),e.output=[]):r!=0&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(ae(we(e.output,0)),e.output=[])},ioctl_tcgets(e){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ioctl_tcsets(e,r,t){return 0},ioctl_tiocgwinsz(e){return[24,80]}},default_tty1_ops:{put_char(e,r){r===null||r===10?(z(we(e.output,0)),e.output=[]):r!=0&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(z(we(e.output,0)),e.output=[])}}},Jt=(e,r)=>(B.fill(0,e,e+r),e),Zt=(e,r)=>Math.ceil(e/r)*r,Gr=e=>{e=Zt(e,65536);var r=mt(65536,e);return r?Jt(r,e):0},k={ops_table:null,mount(e){return k.createNode(null,"/",16895,0)},createNode(e,r,t,n){if(a.isBlkdev(t)||a.isFIFO(t))throw new a.ErrnoError(63);k.ops_table||(k.ops_table={dir:{node:{getattr:k.node_ops.getattr,setattr:k.node_ops.setattr,lookup:k.node_ops.lookup,mknod:k.node_ops.mknod,rename:k.node_ops.rename,unlink:k.node_ops.unlink,rmdir:k.node_ops.rmdir,readdir:k.node_ops.readdir,symlink:k.node_ops.symlink},stream:{llseek:k.stream_ops.llseek}},file:{node:{getattr:k.node_ops.getattr,setattr:k.node_ops.setattr},stream:{llseek:k.stream_ops.llseek,read:k.stream_ops.read,write:k.stream_ops.write,allocate:k.stream_ops.allocate,mmap:k.stream_ops.mmap,msync:k.stream_ops.msync}},link:{node:{getattr:k.node_ops.getattr,setattr:k.node_ops.setattr,readlink:k.node_ops.readlink},stream:{}},chrdev:{node:{getattr:k.node_ops.getattr,setattr:k.node_ops.setattr},stream:a.chrdev_stream_ops}});var o=a.createNode(e,r,t,n);return a.isDir(o.mode)?(o.node_ops=k.ops_table.dir.node,o.stream_ops=k.ops_table.dir.stream,o.contents={}):a.isFile(o.mode)?(o.node_ops=k.ops_table.file.node,o.stream_ops=k.ops_table.file.stream,o.usedBytes=0,o.contents=null):a.isLink(o.mode)?(o.node_ops=k.ops_table.link.node,o.stream_ops=k.ops_table.link.stream):a.isChrdev(o.mode)&&(o.node_ops=k.ops_table.chrdev.node,o.stream_ops=k.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[r]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage(e,r){var t=e.contents?e.contents.length:0;if(!(t>=r)){var n=1024*1024;r=Math.max(r,t*(t<n?2:1.125)>>>0),t!=0&&(r=Math.max(r,256));var o=e.contents;e.contents=new Uint8Array(r),e.usedBytes>0&&e.contents.set(o.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,r){if(e.usedBytes!=r)if(r==0)e.contents=null,e.usedBytes=0;else{var t=e.contents;e.contents=new Uint8Array(r),t&&e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r}},node_ops:{getattr(e){var r={};return r.dev=a.isChrdev(e.mode)?e.id:1,r.ino=e.id,r.mode=e.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=e.rdev,a.isDir(e.mode)?r.size=4096:a.isFile(e.mode)?r.size=e.usedBytes:a.isLink(e.mode)?r.size=e.link.length:r.size=0,r.atime=new Date(e.timestamp),r.mtime=new Date(e.timestamp),r.ctime=new Date(e.timestamp),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr(e,r){r.mode!==void 0&&(e.mode=r.mode),r.timestamp!==void 0&&(e.timestamp=r.timestamp),r.size!==void 0&&k.resizeFileStorage(e,r.size)},lookup(e,r){throw a.genericErrors[44]},mknod(e,r,t,n){return k.createNode(e,r,t,n)},rename(e,r,t){if(a.isDir(e.mode)){var n;try{n=a.lookupNode(r,t)}catch(i){}if(n)for(var o in n.contents)throw new a.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=t,r.contents[t]=e,r.timestamp=e.parent.timestamp},unlink(e,r){delete e.contents[r],e.timestamp=Date.now()},rmdir(e,r){var t=a.lookupNode(e,r);for(var n in t.contents)throw new a.ErrnoError(55);delete e.contents[r],e.timestamp=Date.now()},readdir(e){var r=[".",".."];for(var t of Object.keys(e.contents))r.push(t);return r},symlink(e,r,t){var n=k.createNode(e,r,41471,0);return n.link=t,n},readlink(e){if(!a.isLink(e.mode))throw new a.ErrnoError(28);return e.link}},stream_ops:{read(e,r,t,n,o){var i=e.node.contents;if(o>=e.node.usedBytes)return 0;var s=Math.min(e.node.usedBytes-o,n);if(s>8&&i.subarray)r.set(i.subarray(o,o+s),t);else for(var l=0;l<s;l++)r[t+l]=i[o+l];return s},write(e,r,t,n,o,i){if(r.buffer===U.buffer&&(i=!1),!n)return 0;var s=e.node;if(s.timestamp=Date.now(),r.subarray&&(!s.contents||s.contents.subarray)){if(i)return s.contents=r.subarray(t,t+n),s.usedBytes=n,n;if(s.usedBytes===0&&o===0)return s.contents=r.slice(t,t+n),s.usedBytes=n,n;if(o+n<=s.usedBytes)return s.contents.set(r.subarray(t,t+n),o),n}if(k.expandFileStorage(s,o+n),s.contents.subarray&&r.subarray)s.contents.set(r.subarray(t,t+n),o);else for(var l=0;l<n;l++)s.contents[o+l]=r[t+l];return s.usedBytes=Math.max(s.usedBytes,o+n),n},llseek(e,r,t){var n=r;if(t===1?n+=e.position:t===2&&a.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new a.ErrnoError(28);return n},allocate(e,r,t){k.expandFileStorage(e.node,r+t),e.node.usedBytes=Math.max(e.node.usedBytes,r+t)},mmap(e,r,t,n,o){if(!a.isFile(e.node.mode))throw new a.ErrnoError(43);var i,s,l=e.node.contents;if(!(o&2)&&l.buffer===U.buffer)s=!1,i=l.byteOffset;else{if((t>0||t+r<l.length)&&(l.subarray?l=l.subarray(t,t+r):l=Array.prototype.slice.call(l,t,t+r)),s=!0,i=Gr(r),!i)throw new a.ErrnoError(48);U.set(l,i)}return{ptr:i,allocated:s}},msync(e,r,t,n,o){return k.stream_ops.write(e,r,0,n,t,!1),0}}},en=(e,r,t,n)=>{var o=n?"":`al ${e}`;ge(e).then(i=>{r(new Uint8Array(i)),o&&Ce(o)},i=>{if(t)t();else throw`Loading data file "${e}" failed.`}),o&&Ve(o)},Kr=(e,r,t,n,o,i)=>{a.createDataFile(e,r,t,n,o,i)},rn=u.preloadPlugins||[],tn=(e,r,t,n)=>{typeof Browser!="undefined"&&Browser.init();var o=!1;return rn.forEach(i=>{o||i.canHandle(r)&&(i.handle(e,r,t,n),o=!0)}),o},Xr=(e,r,t,n,o,i,s,l,c,f)=>{var d=r?re.resolve($.join2(e,r)):e,g=`cp ${d}`;function p(m){function y(P){f==null||f(),l||Kr(e,r,P,n,o,c),i==null||i(),Ce(g)}tn(m,d,y,()=>{s==null||s(),Ce(g)})||y(m)}Ve(g),typeof t=="string"?en(t,p,s):p(t)},nn=e=>{var r={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},t=r[e];if(typeof t=="undefined")throw new Error(`Unknown file open mode: ${e}`);return t},pr=(e,r)=>{var t=0;return e&&(t|=365),r&&(t|=146),t},a={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:class{constructor(e){this.name="ErrnoError",this.errno=e}},genericErrors:{},filesystems:null,syncFSRequests:0,FSStream:class{constructor(){this.shared={}}get object(){return this.node}set object(e){this.node=e}get isRead(){return(this.flags&2097155)!==1}get isWrite(){return(this.flags&2097155)!==0}get isAppend(){return this.flags&1024}get flags(){return this.shared.flags}set flags(e){this.shared.flags=e}get position(){return this.shared.position}set position(e){this.shared.position=e}},FSNode:class{constructor(e,r,t,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=a.nextInode++,this.name=r,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n,this.readMode=365,this.writeMode=146}get read(){return(this.mode&this.readMode)===this.readMode}set read(e){e?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(e){e?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return a.isDir(this.mode)}get isDevice(){return a.isChrdev(this.mode)}},lookupPath(e,r={}){if(e=re.resolve(e),!e)return{path:"",node:null};var t={follow_mount:!0,recurse_count:0};if(r=Object.assign(t,r),r.recurse_count>8)throw new a.ErrnoError(32);for(var n=e.split("/").filter(g=>!!g),o=a.root,i="/",s=0;s<n.length;s++){var l=s===n.length-1;if(l&&r.parent)break;if(o=a.lookupNode(o,n[s]),i=$.join2(i,n[s]),a.isMountpoint(o)&&(!l||l&&r.follow_mount)&&(o=o.mounted.root),!l||r.follow)for(var c=0;a.isLink(o.mode);){var f=a.readlink(i);i=re.resolve($.dirname(i),f);var d=a.lookupPath(i,{recurse_count:r.recurse_count+1});if(o=d.node,c++>40)throw new a.ErrnoError(32)}}return{path:i,node:o}},getPath(e){for(var r;;){if(a.isRoot(e)){var t=e.mount.mountpoint;return r?t[t.length-1]!=="/"?`${t}/${r}`:t+r:t}r=r?`${e.name}/${r}`:e.name,e=e.parent}},hashName(e,r){for(var t=0,n=0;n<r.length;n++)t=(t<<5)-t+r.charCodeAt(n)|0;return(e+t>>>0)%a.nameTable.length},hashAddNode(e){var r=a.hashName(e.parent.id,e.name);e.name_next=a.nameTable[r],a.nameTable[r]=e},hashRemoveNode(e){var r=a.hashName(e.parent.id,e.name);if(a.nameTable[r]===e)a.nameTable[r]=e.name_next;else for(var t=a.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode(e,r){var t=a.mayLookup(e);if(t)throw new a.ErrnoError(t);for(var n=a.hashName(e.id,r),o=a.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===r)return o}return a.lookup(e,r)},createNode(e,r,t,n){var o=new a.FSNode(e,r,t,n);return a.hashAddNode(o),o},destroyNode(e){a.hashRemoveNode(e)},isRoot(e){return e===e.parent},isMountpoint(e){return!!e.mounted},isFile(e){return(e&61440)===32768},isDir(e){return(e&61440)===16384},isLink(e){return(e&61440)===40960},isChrdev(e){return(e&61440)===8192},isBlkdev(e){return(e&61440)===24576},isFIFO(e){return(e&61440)===4096},isSocket(e){return(e&49152)===49152},flagsToPermissionString(e){var r=["r","w","rw"][e&3];return e&512&&(r+="w"),r},nodePermissions(e,r){return a.ignorePermissions?0:r.includes("r")&&!(e.mode&292)||r.includes("w")&&!(e.mode&146)||r.includes("x")&&!(e.mode&73)?2:0},mayLookup(e){if(!a.isDir(e.mode))return 54;var r=a.nodePermissions(e,"x");return r||(e.node_ops.lookup?0:2)},mayCreate(e,r){try{var t=a.lookupNode(e,r);return 20}catch(n){}return a.nodePermissions(e,"wx")},mayDelete(e,r,t){var n;try{n=a.lookupNode(e,r)}catch(i){return i.errno}var o=a.nodePermissions(e,"wx");if(o)return o;if(t){if(!a.isDir(n.mode))return 54;if(a.isRoot(n)||a.getPath(n)===a.cwd())return 10}else if(a.isDir(n.mode))return 31;return 0},mayOpen(e,r){return e?a.isLink(e.mode)?32:a.isDir(e.mode)&&(a.flagsToPermissionString(r)!=="r"||r&512)?31:a.nodePermissions(e,a.flagsToPermissionString(r)):44},MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=a.MAX_OPEN_FDS;e++)if(!a.streams[e])return e;throw new a.ErrnoError(33)},getStreamChecked(e){var r=a.getStream(e);if(!r)throw new a.ErrnoError(8);return r},getStream:e=>a.streams[e],createStream(e,r=-1){return e=Object.assign(new a.FSStream,e),r==-1&&(r=a.nextfd()),e.fd=r,a.streams[r]=e,e},closeStream(e){a.streams[e]=null},dupStream(e,r=-1){var n,o;var t=a.createStream(e,r);return(o=(n=t.stream_ops)==null?void 0:n.dup)==null||o.call(n,t),t},chrdev_stream_ops:{open(e){var t,n;var r=a.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,(n=(t=e.stream_ops).open)==null||n.call(t,e)},llseek(){throw new a.ErrnoError(70)}},major:e=>e>>8,minor:e=>e&255,makedev:(e,r)=>e<<8|r,registerDevice(e,r){a.devices[e]={stream_ops:r}},getDevice:e=>a.devices[e],getMounts(e){for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push(...n.mounts)}return r},syncfs(e,r){typeof e=="function"&&(r=e,e=!1),a.syncFSRequests++,a.syncFSRequests>1&&z(`warning: ${a.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=a.getMounts(a.root.mount),n=0;function o(s){return a.syncFSRequests--,r(s)}function i(s){if(s)return i.errored?void 0:(i.errored=!0,o(s));++n>=t.length&&o(null)}t.forEach(s=>{if(!s.type.syncfs)return i(null);s.type.syncfs(s,e,i)})},mount(e,r,t){var n=t==="/",o=!t,i;if(n&&a.root)throw new a.ErrnoError(10);if(!n&&!o){var s=a.lookupPath(t,{follow_mount:!1});if(t=s.path,i=s.node,a.isMountpoint(i))throw new a.ErrnoError(10);if(!a.isDir(i.mode))throw new a.ErrnoError(54)}var l={type:e,opts:r,mountpoint:t,mounts:[]},c=e.mount(l);return c.mount=l,l.root=c,n?a.root=c:i&&(i.mounted=l,i.mount&&i.mount.mounts.push(l)),c},unmount(e){var r=a.lookupPath(e,{follow_mount:!1});if(!a.isMountpoint(r.node))throw new a.ErrnoError(28);var t=r.node,n=t.mounted,o=a.getMounts(n);Object.keys(a.nameTable).forEach(s=>{for(var l=a.nameTable[s];l;){var c=l.name_next;o.includes(l.mount)&&a.destroyNode(l),l=c}}),t.mounted=null;var i=t.mount.mounts.indexOf(n);t.mount.mounts.splice(i,1)},lookup(e,r){return e.node_ops.lookup(e,r)},mknod(e,r,t){var n=a.lookupPath(e,{parent:!0}),o=n.node,i=$.basename(e);if(!i||i==="."||i==="..")throw new a.ErrnoError(28);var s=a.mayCreate(o,i);if(s)throw new a.ErrnoError(s);if(!o.node_ops.mknod)throw new a.ErrnoError(63);return o.node_ops.mknod(o,i,r,t)},create(e,r){return r=r!==void 0?r:438,r&=4095,r|=32768,a.mknod(e,r,0)},mkdir(e,r){return r=r!==void 0?r:511,r&=1023,r|=16384,a.mknod(e,r,0)},mkdirTree(e,r){for(var t=e.split("/"),n="",o=0;o<t.length;++o)if(t[o]){n+="/"+t[o];try{a.mkdir(n,r)}catch(i){if(i.errno!=20)throw i}}},mkdev(e,r,t){return typeof t=="undefined"&&(t=r,r=438),r|=8192,a.mknod(e,r,t)},symlink(e,r){if(!re.resolve(e))throw new a.ErrnoError(44);var t=a.lookupPath(r,{parent:!0}),n=t.node;if(!n)throw new a.ErrnoError(44);var o=$.basename(r),i=a.mayCreate(n,o);if(i)throw new a.ErrnoError(i);if(!n.node_ops.symlink)throw new a.ErrnoError(63);return n.node_ops.symlink(n,o,e)},rename(e,r){var t=$.dirname(e),n=$.dirname(r),o=$.basename(e),i=$.basename(r),s,l,c;if(s=a.lookupPath(e,{parent:!0}),l=s.node,s=a.lookupPath(r,{parent:!0}),c=s.node,!l||!c)throw new a.ErrnoError(44);if(l.mount!==c.mount)throw new a.ErrnoError(75);var f=a.lookupNode(l,o),d=re.relative(e,n);if(d.charAt(0)!==".")throw new a.ErrnoError(28);if(d=re.relative(r,t),d.charAt(0)!==".")throw new a.ErrnoError(55);var g;try{g=a.lookupNode(c,i)}catch(y){}if(f!==g){var p=a.isDir(f.mode),m=a.mayDelete(l,o,p);if(m)throw new a.ErrnoError(m);if(m=g?a.mayDelete(c,i,p):a.mayCreate(c,i),m)throw new a.ErrnoError(m);if(!l.node_ops.rename)throw new a.ErrnoError(63);if(a.isMountpoint(f)||g&&a.isMountpoint(g))throw new a.ErrnoError(10);if(c!==l&&(m=a.nodePermissions(l,"w"),m))throw new a.ErrnoError(m);a.hashRemoveNode(f);try{l.node_ops.rename(f,c,i),f.parent=c}catch(y){throw y}finally{a.hashAddNode(f)}}},rmdir(e){var r=a.lookupPath(e,{parent:!0}),t=r.node,n=$.basename(e),o=a.lookupNode(t,n),i=a.mayDelete(t,n,!0);if(i)throw new a.ErrnoError(i);if(!t.node_ops.rmdir)throw new a.ErrnoError(63);if(a.isMountpoint(o))throw new a.ErrnoError(10);t.node_ops.rmdir(t,n),a.destroyNode(o)},readdir(e){var r=a.lookupPath(e,{follow:!0}),t=r.node;if(!t.node_ops.readdir)throw new a.ErrnoError(54);return t.node_ops.readdir(t)},unlink(e){var r=a.lookupPath(e,{parent:!0}),t=r.node;if(!t)throw new a.ErrnoError(44);var n=$.basename(e),o=a.lookupNode(t,n),i=a.mayDelete(t,n,!1);if(i)throw new a.ErrnoError(i);if(!t.node_ops.unlink)throw new a.ErrnoError(63);if(a.isMountpoint(o))throw new a.ErrnoError(10);t.node_ops.unlink(t,n),a.destroyNode(o)},readlink(e){var r=a.lookupPath(e),t=r.node;if(!t)throw new a.ErrnoError(44);if(!t.node_ops.readlink)throw new a.ErrnoError(28);return re.resolve(a.getPath(t.parent),t.node_ops.readlink(t))},stat(e,r){var t=a.lookupPath(e,{follow:!r}),n=t.node;if(!n)throw new a.ErrnoError(44);if(!n.node_ops.getattr)throw new a.ErrnoError(63);return n.node_ops.getattr(n)},lstat(e){return a.stat(e,!0)},chmod(e,r,t){var n;if(typeof e=="string"){var o=a.lookupPath(e,{follow:!t});n=o.node}else n=e;if(!n.node_ops.setattr)throw new a.ErrnoError(63);n.node_ops.setattr(n,{mode:r&4095|n.mode&-4096,timestamp:Date.now()})},lchmod(e,r){a.chmod(e,r,!0)},fchmod(e,r){var t=a.getStreamChecked(e);a.chmod(t.node,r)},chown(e,r,t,n){var o;if(typeof e=="string"){var i=a.lookupPath(e,{follow:!n});o=i.node}else o=e;if(!o.node_ops.setattr)throw new a.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown(e,r,t){a.chown(e,r,t,!0)},fchown(e,r,t){var n=a.getStreamChecked(e);a.chown(n.node,r,t)},truncate(e,r){if(r<0)throw new a.ErrnoError(28);var t;if(typeof e=="string"){var n=a.lookupPath(e,{follow:!0});t=n.node}else t=e;if(!t.node_ops.setattr)throw new a.ErrnoError(63);if(a.isDir(t.mode))throw new a.ErrnoError(31);if(!a.isFile(t.mode))throw new a.ErrnoError(28);var o=a.nodePermissions(t,"w");if(o)throw new a.ErrnoError(o);t.node_ops.setattr(t,{size:r,timestamp:Date.now()})},ftruncate(e,r){var t=a.getStreamChecked(e);if(!(t.flags&2097155))throw new a.ErrnoError(28);a.truncate(t.node,r)},utime(e,r,t){var n=a.lookupPath(e,{follow:!0}),o=n.node;o.node_ops.setattr(o,{timestamp:Math.max(r,t)})},open(e,r,t){if(e==="")throw new a.ErrnoError(44);r=typeof r=="string"?nn(r):r,r&64?(t=typeof t=="undefined"?438:t,t=t&4095|32768):t=0;var n;if(typeof e=="object")n=e;else{e=$.normalize(e);try{var o=a.lookupPath(e,{follow:!(r&131072)});n=o.node}catch(c){}}var i=!1;if(r&64)if(n){if(r&128)throw new a.ErrnoError(20)}else n=a.mknod(e,t,0),i=!0;if(!n)throw new a.ErrnoError(44);if(a.isChrdev(n.mode)&&(r&=-513),r&65536&&!a.isDir(n.mode))throw new a.ErrnoError(54);if(!i){var s=a.mayOpen(n,r);if(s)throw new a.ErrnoError(s)}r&512&&!i&&a.truncate(n,0),r&=-131713;var l=a.createStream({node:n,path:a.getPath(n),flags:r,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return l.stream_ops.open&&l.stream_ops.open(l),u.logReadFiles&&!(r&1)&&(a.readFiles||(a.readFiles={}),e in a.readFiles||(a.readFiles[e]=1)),l},close(e){if(a.isClosed(e))throw new a.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(r){throw r}finally{a.closeStream(e.fd)}e.fd=null},isClosed(e){return e.fd===null},llseek(e,r,t){if(a.isClosed(e))throw new a.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new a.ErrnoError(70);if(t!=0&&t!=1&&t!=2)throw new a.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read(e,r,t,n,o){if(n<0||o<0)throw new a.ErrnoError(28);if(a.isClosed(e))throw new a.ErrnoError(8);if((e.flags&2097155)===1)throw new a.ErrnoError(8);if(a.isDir(e.node.mode))throw new a.ErrnoError(31);if(!e.stream_ops.read)throw new a.ErrnoError(28);var i=typeof o!="undefined";if(!i)o=e.position;else if(!e.seekable)throw new a.ErrnoError(70);var s=e.stream_ops.read(e,r,t,n,o);return i||(e.position+=s),s},write(e,r,t,n,o,i){if(n<0||o<0)throw new a.ErrnoError(28);if(a.isClosed(e))throw new a.ErrnoError(8);if(!(e.flags&2097155))throw new a.ErrnoError(8);if(a.isDir(e.node.mode))throw new a.ErrnoError(31);if(!e.stream_ops.write)throw new a.ErrnoError(28);e.seekable&&e.flags&1024&&a.llseek(e,0,2);var s=typeof o!="undefined";if(!s)o=e.position;else if(!e.seekable)throw new a.ErrnoError(70);var l=e.stream_ops.write(e,r,t,n,o,i);return s||(e.position+=l),l},allocate(e,r,t){if(a.isClosed(e))throw new a.ErrnoError(8);if(r<0||t<=0)throw new a.ErrnoError(28);if(!(e.flags&2097155))throw new a.ErrnoError(8);if(!a.isFile(e.node.mode)&&!a.isDir(e.node.mode))throw new a.ErrnoError(43);if(!e.stream_ops.allocate)throw new a.ErrnoError(138);e.stream_ops.allocate(e,r,t)},mmap(e,r,t,n,o){if(n&2&&!(o&2)&&(e.flags&2097155)!==2)throw new a.ErrnoError(2);if((e.flags&2097155)===1)throw new a.ErrnoError(2);if(!e.stream_ops.mmap)throw new a.ErrnoError(43);return e.stream_ops.mmap(e,r,t,n,o)},msync(e,r,t,n,o){return e.stream_ops.msync?e.stream_ops.msync(e,r,t,n,o):0},ioctl(e,r,t){if(!e.stream_ops.ioctl)throw new a.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile(e,r={}){if(r.flags=r.flags||0,r.encoding=r.encoding||"binary",r.encoding!=="utf8"&&r.encoding!=="binary")throw new Error(`Invalid encoding type "${r.encoding}"`);var t,n=a.open(e,r.flags),o=a.stat(e),i=o.size,s=new Uint8Array(i);return a.read(n,s,0,i,0),r.encoding==="utf8"?t=we(s,0):r.encoding==="binary"&&(t=s),a.close(n),t},writeFile(e,r,t={}){t.flags=t.flags||577;var n=a.open(e,t.flags,t.mode);if(typeof r=="string"){var o=new Uint8Array(Te(r)+1),i=vr(r,o,0,o.length);a.write(n,o,0,i,void 0,t.canOwn)}else if(ArrayBuffer.isView(r))a.write(n,r,0,r.byteLength,void 0,t.canOwn);else throw new Error("Unsupported data type");a.close(n)},cwd:()=>a.currentPath,chdir(e){var r=a.lookupPath(e,{follow:!0});if(r.node===null)throw new a.ErrnoError(44);if(!a.isDir(r.node.mode))throw new a.ErrnoError(54);var t=a.nodePermissions(r.node,"x");if(t)throw new a.ErrnoError(t);a.currentPath=r.path},createDefaultDirectories(){a.mkdir("/tmp"),a.mkdir("/home"),a.mkdir("/home/web_user")},createDefaultDevices(){a.mkdir("/dev"),a.registerDevice(a.makedev(1,3),{read:()=>0,write:(n,o,i,s,l)=>s}),a.mkdev("/dev/null",a.makedev(1,3)),ie.register(a.makedev(5,0),ie.default_tty_ops),ie.register(a.makedev(6,0),ie.default_tty1_ops),a.mkdev("/dev/tty",a.makedev(5,0)),a.mkdev("/dev/tty1",a.makedev(6,0));var e=new Uint8Array(1024),r=0,t=()=>(r===0&&(r=zr(e).byteLength),e[--r]);a.createDevice("/dev","random",t),a.createDevice("/dev","urandom",t),a.mkdir("/dev/shm"),a.mkdir("/dev/shm/tmp")},createSpecialDirectories(){a.mkdir("/proc");var e=a.mkdir("/proc/self");a.mkdir("/proc/self/fd"),a.mount({mount(){var r=a.createNode(e,"fd",16895,73);return r.node_ops={lookup(t,n){var o=+n,i=a.getStreamChecked(o),s={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>i.path}};return s.parent=s,s}},r}},{},"/proc/self/fd")},createStandardStreams(){u.stdin?a.createDevice("/dev","stdin",u.stdin):a.symlink("/dev/tty","/dev/stdin"),u.stdout?a.createDevice("/dev","stdout",null,u.stdout):a.symlink("/dev/tty","/dev/stdout"),u.stderr?a.createDevice("/dev","stderr",null,u.stderr):a.symlink("/dev/tty1","/dev/stderr");var e=a.open("/dev/stdin",0),r=a.open("/dev/stdout",1),t=a.open("/dev/stderr",1)},staticInit(){[44].forEach(e=>{a.genericErrors[e]=new a.ErrnoError(e),a.genericErrors[e].stack="<generic error, no stack>"}),a.nameTable=new Array(4096),a.mount(k,{},"/"),a.createDefaultDirectories(),a.createDefaultDevices(),a.createSpecialDirectories(),a.filesystems={MEMFS:k}},init(e,r,t){a.init.initialized=!0,u.stdin=e||u.stdin,u.stdout=r||u.stdout,u.stderr=t||u.stderr,a.createStandardStreams()},quit(){a.init.initialized=!1;for(var e=0;e<a.streams.length;e++){var r=a.streams[e];r&&a.close(r)}},findObject(e,r){var t=a.analyzePath(e,r);return t.exists?t.object:null},analyzePath(e,r){try{var t=a.lookupPath(e,{follow:!r});e=t.path}catch(o){}var n={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var t=a.lookupPath(e,{parent:!0});n.parentExists=!0,n.parentPath=t.path,n.parentObject=t.node,n.name=$.basename(e),t=a.lookupPath(e,{follow:!r}),n.exists=!0,n.path=t.path,n.object=t.node,n.name=t.node.name,n.isRoot=t.path==="/"}catch(o){n.error=o.errno}return n},createPath(e,r,t,n){e=typeof e=="string"?e:a.getPath(e);for(var o=r.split("/").reverse();o.length;){var i=o.pop();if(i){var s=$.join2(e,i);try{a.mkdir(s)}catch(l){}e=s}}return s},createFile(e,r,t,n,o){var i=$.join2(typeof e=="string"?e:a.getPath(e),r),s=pr(n,o);return a.create(i,s)},createDataFile(e,r,t,n,o,i){var s=r;e&&(e=typeof e=="string"?e:a.getPath(e),s=r?$.join2(e,r):e);var l=pr(n,o),c=a.create(s,l);if(t){if(typeof t=="string"){for(var f=new Array(t.length),d=0,g=t.length;d<g;++d)f[d]=t.charCodeAt(d);t=f}a.chmod(c,l|146);var p=a.open(c,577);a.write(p,t,0,t.length,0,i),a.close(p),a.chmod(c,l)}},createDevice(e,r,t,n){var o=$.join2(typeof e=="string"?e:a.getPath(e),r),i=pr(!!t,!!n);a.createDevice.major||(a.createDevice.major=64);var s=a.makedev(a.createDevice.major++,0);return a.registerDevice(s,{open(l){l.seekable=!1},close(l){var c;(c=n==null?void 0:n.buffer)!=null&&c.length&&n(10)},read(l,c,f,d,g){for(var p=0,m=0;m<d;m++){var y;try{y=t()}catch(P){throw new a.ErrnoError(29)}if(y===void 0&&p===0)throw new a.ErrnoError(6);if(y==null)break;p++,c[f+m]=y}return p&&(l.node.timestamp=Date.now()),p},write(l,c,f,d,g){for(var p=0;p<d;p++)try{n(c[f+p])}catch(m){throw new a.ErrnoError(29)}return d&&(l.node.timestamp=Date.now()),p}}),a.mkdev(o,i,s)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if(typeof XMLHttpRequest!="undefined")throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");try{e.contents=Y(e.url),e.usedBytes=e.contents.length}catch(r){throw new a.ErrnoError(29)}},createLazyFile(e,r,t,n,o){class i{constructor(){this.lengthKnown=!1,this.chunks=[]}get(m){if(!(m>this.length-1||m<0)){var y=m%this.chunkSize,P=m/this.chunkSize|0;return this.getter(P)[y]}}setDataGetter(m){this.getter=m}cacheLength(){var m=new XMLHttpRequest;if(m.open("HEAD",t,!1),m.send(null),!(m.status>=200&&m.status<300||m.status===304))throw new Error("Couldn't load "+t+". Status: "+m.status);var y=Number(m.getResponseHeader("Content-length")),P,D=(P=m.getResponseHeader("Accept-Ranges"))&&P==="bytes",F=(P=m.getResponseHeader("Content-Encoding"))&&P==="gzip",b=1024*1024;D||(b=y);var A=(S,x)=>{if(S>x)throw new Error("invalid range ("+S+", "+x+") or no bytes requested!");if(x>y-1)throw new Error("only "+y+" bytes available! programmer error!");var W=new XMLHttpRequest;if(W.open("GET",t,!1),y!==b&&W.setRequestHeader("Range","bytes="+S+"-"+x),W.responseType="arraybuffer",W.overrideMimeType&&W.overrideMimeType("text/plain; charset=x-user-defined"),W.send(null),!(W.status>=200&&W.status<300||W.status===304))throw new Error("Couldn't load "+t+". Status: "+W.status);return W.response!==void 0?new Uint8Array(W.response||[]):qr(W.responseText||"",!0)},O=this;O.setDataGetter(S=>{var x=S*b,W=(S+1)*b-1;if(W=Math.min(W,y-1),typeof O.chunks[S]=="undefined"&&(O.chunks[S]=A(x,W)),typeof O.chunks[S]=="undefined")throw new Error("doXHR failed!");return O.chunks[S]}),(F||!y)&&(b=y=1,y=this.getter(0).length,b=y,ae("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=y,this._chunkSize=b,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if(typeof XMLHttpRequest!="undefined"){if(!Z)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var s=new i,l={isDevice:!1,contents:s}}else var l={isDevice:!1,url:t};var c=a.createFile(e,r,l,n,o);l.contents?c.contents=l.contents:l.url&&(c.contents=null,c.url=l.url),Object.defineProperties(c,{usedBytes:{get:function(){return this.contents.length}}});var f={},d=Object.keys(c.stream_ops);d.forEach(p=>{var m=c.stream_ops[p];f[p]=(...y)=>(a.forceLoadFile(c),m(...y))});function g(p,m,y,P,D){var F=p.node.contents;if(D>=F.length)return 0;var b=Math.min(F.length-D,P);if(F.slice)for(var A=0;A<b;A++)m[y+A]=F[D+A];else for(var A=0;A<b;A++)m[y+A]=F.get(D+A);return b}return f.read=(p,m,y,P,D)=>(a.forceLoadFile(c),g(p,m,y,P,D)),f.mmap=(p,m,y,P,D)=>{a.forceLoadFile(c);var F=Gr(m);if(!F)throw new a.ErrnoError(48);return g(p,U,F,m,y),{ptr:F,allocated:!0}},c.stream_ops=f,c}},Yr=(e,r)=>e?we(B,e,r):"",I={DEFAULT_POLLMASK:5,calculateAt(e,r,t){if($.isAbs(r))return r;var n;if(e===-100)n=a.cwd();else{var o=I.getStreamFromFD(e);n=o.path}if(r.length==0){if(!t)throw new a.ErrnoError(44);return n}return $.join2(n,r)},doStat(e,r,t){var n=e(r);_[t>>2]=n.dev,_[t+4>>2]=n.mode,T[t+8>>2]=n.nlink,_[t+12>>2]=n.uid,_[t+16>>2]=n.gid,_[t+20>>2]=n.rdev,j=[n.size>>>0,(E=n.size,+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],_[t+24>>2]=j[0],_[t+28>>2]=j[1],_[t+32>>2]=4096,_[t+36>>2]=n.blocks;var o=n.atime.getTime(),i=n.mtime.getTime(),s=n.ctime.getTime();return j=[Math.floor(o/1e3)>>>0,(E=Math.floor(o/1e3),+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],_[t+40>>2]=j[0],_[t+44>>2]=j[1],T[t+48>>2]=o%1e3*1e3,j=[Math.floor(i/1e3)>>>0,(E=Math.floor(i/1e3),+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],_[t+56>>2]=j[0],_[t+60>>2]=j[1],T[t+64>>2]=i%1e3*1e3,j=[Math.floor(s/1e3)>>>0,(E=Math.floor(s/1e3),+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],_[t+72>>2]=j[0],_[t+76>>2]=j[1],T[t+80>>2]=s%1e3*1e3,j=[n.ino>>>0,(E=n.ino,+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],_[t+88>>2]=j[0],_[t+92>>2]=j[1],0},doMsync(e,r,t,n,o){if(!a.isFile(r.node.mode))throw new a.ErrnoError(43);if(n&2)return 0;var i=B.slice(e,e+t);a.msync(r,i,o,t,n)},getStreamFromFD(e){var r=a.getStreamChecked(e);return r},varargs:void 0,getStr(e){var r=Yr(e);return r}};function on(e,r,t){I.varargs=t;try{var n=I.getStreamFromFD(e);switch(r){case 0:{var o=Ge();if(o<0)return-28;for(;a.streams[o];)o++;var i;return i=a.dupStream(n,o),i.fd}case 1:case 2:return 0;case 3:return n.flags;case 4:{var o=Ge();return n.flags|=o,0}case 12:{var o=ye(),s=0;return ee[o+s>>1]=2,0}case 13:case 14:return 0}return-28}catch(l){if(typeof a=="undefined"||l.name!=="ErrnoError")throw l;return-l.errno}}var de=(e,r,t)=>vr(e,B,r,t);function an(e,r){try{if(r===0)return-28;var t=a.cwd(),n=Te(t)+1;return r<n?-68:(de(t,e,r),n)}catch(o){if(typeof a=="undefined"||o.name!=="ErrnoError")throw o;return-o.errno}}function sn(e,r,t){I.varargs=t;try{var n=I.getStreamFromFD(e);switch(r){case 21509:return n.tty?0:-59;case 21505:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var o=n.tty.ops.ioctl_tcgets(n),i=ye();_[i>>2]=o.c_iflag||0,_[i+4>>2]=o.c_oflag||0,_[i+8>>2]=o.c_cflag||0,_[i+12>>2]=o.c_lflag||0;for(var s=0;s<32;s++)U[i+s+17]=o.c_cc[s]||0;return 0}return 0}case 21510:case 21511:case 21512:return n.tty?0:-59;case 21506:case 21507:case 21508:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){for(var i=ye(),l=_[i>>2],c=_[i+4>>2],f=_[i+8>>2],d=_[i+12>>2],g=[],s=0;s<32;s++)g.push(U[i+s+17]);return n.tty.ops.ioctl_tcsets(n.tty,r,{c_iflag:l,c_oflag:c,c_cflag:f,c_lflag:d,c_cc:g})}return 0}case 21519:{if(!n.tty)return-59;var i=ye();return _[i>>2]=0,0}case 21520:return n.tty?-28:-59;case 21531:{var i=ye();return a.ioctl(n,r,i)}case 21523:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var p=n.tty.ops.ioctl_tiocgwinsz(n.tty),i=ye();ee[i>>1]=p[0],ee[i+2>>1]=p[1]}return 0}case 21524:return n.tty?0:-59;case 21515:return n.tty?0:-59;default:return-28}}catch(m){if(typeof a=="undefined"||m.name!=="ErrnoError")throw m;return-m.errno}}function ln(e,r,t){try{return r=I.getStr(r),r=I.calculateAt(e,r),r=$.normalize(r),r[r.length-1]==="/"&&(r=r.substr(0,r.length-1)),a.mkdir(r,t,0),0}catch(n){if(typeof a=="undefined"||n.name!=="ErrnoError")throw n;return-n.errno}}function un(e,r,t,n){I.varargs=n;try{r=I.getStr(r),r=I.calculateAt(e,r);var o=n?Ge():0;return a.open(r,t,o).fd}catch(i){if(typeof a=="undefined"||i.name!=="ErrnoError")throw i;return-i.errno}}function cn(e,r,t,n){try{if(r=I.getStr(r),r=I.calculateAt(e,r),n<=0)return-28;var o=a.readlink(r),i=Math.min(n,Te(o)),s=U[t+i];return de(o,t,n+1),U[t+i]=s,i}catch(l){if(typeof a=="undefined"||l.name!=="ErrnoError")throw l;return-l.errno}}function fn(e,r){try{return e=I.getStr(e),I.doStat(a.stat,e,r)}catch(t){if(typeof a=="undefined"||t.name!=="ErrnoError")throw t;return-t.errno}}var dn=()=>{cr("")},vn=(e,r,t,n,o)=>{},pn=()=>{for(var e=new Array(256),r=0;r<256;++r)e[r]=String.fromCharCode(r);Qr=e},Qr,V=e=>{for(var r="",t=e;B[t];)r+=Qr[B[t++]];return r},_e={},ve={},Ke={},Ee,C=e=>{throw new Ee(e)},Jr,Xe=e=>{throw new Jr(e)},Q=(e,r,t)=>{e.forEach(function(l){Ke[l]=r});function n(l){var c=t(l);c.length!==e.length&&Xe("Mismatched type converter count");for(var f=0;f<e.length;++f)te(e[f],c[f])}var o=new Array(r.length),i=[],s=0;r.forEach((l,c)=>{ve.hasOwnProperty(l)?o[c]=ve[l]:(i.push(l),_e.hasOwnProperty(l)||(_e[l]=[]),_e[l].push(()=>{o[c]=ve[l],++s,s===i.length&&n(o)}))}),i.length===0&&n(o)};function hn(e,r,t={}){var n=r.name;if(e||C(`type "${n}" must have a positive integer typeid pointer`),ve.hasOwnProperty(e)){if(t.ignoreDuplicateRegistrations)return;C(`Cannot register type '${n}' twice`)}if(ve[e]=r,delete Ke[e],_e.hasOwnProperty(e)){var o=_e[e];delete _e[e],o.forEach(i=>i())}}function te(e,r,t={}){if(!("argPackAdvance"in r))throw new TypeError("registerType registeredInstance requires argPackAdvance");return hn(e,r,t)}var se=8,mn=(e,r,t,n)=>{r=V(r),te(e,{name:r,fromWireType:function(o){return!!o},toWireType:function(o,i){return i?t:n},argPackAdvance:se,readValueFromPointer:function(o){return this.fromWireType(B[o])},destructorFunction:null})},gn=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),hr=e=>{function r(t){return t.$$.ptrType.registeredClass.name}C(r(e)+" instance already deleted")},mr=!1,Zr=e=>{},yn=e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)},et=e=>{e.count.value-=1;var r=e.count.value===0;r&&yn(e)},rt=(e,r,t)=>{if(r===t)return e;if(t.baseClass===void 0)return null;var n=rt(e,r,t.baseClass);return n===null?null:t.downcast(n)},tt={},wn=()=>Object.keys(De).length,_n=()=>{var e=[];for(var r in De)De.hasOwnProperty(r)&&e.push(De[r]);return e},Fe=[],gr=()=>{for(;Fe.length;){var e=Fe.pop();e.$$.deleteScheduled=!1,e.delete()}},Se,En=e=>{Se=e,Fe.length&&Se&&Se(gr)},kn=()=>{u.getInheritedInstanceCount=wn,u.getLiveInheritedInstances=_n,u.flushPendingDeletes=gr,u.setDelayFunction=En},De={},bn=(e,r)=>{for(r===void 0&&C("ptr should not be undefined");e.baseClass;)r=e.upcast(r),e=e.baseClass;return r},An=(e,r)=>(r=bn(e,r),De[r]),Ye=(e,r)=>{(!r.ptrType||!r.ptr)&&Xe("makeClassHandle requires ptr and ptrType");var t=!!r.smartPtrType,n=!!r.smartPtr;return t!==n&&Xe("Both smartPtrType and smartPtr must be specified"),r.count={value:1},Re(Object.create(e,{$$:{value:r,writable:!0}}))};function Pn(e){var r=this.getPointee(e);if(!r)return this.destructor(e),null;var t=An(this.registeredClass,r);if(t!==void 0){if(t.$$.count.value===0)return t.$$.ptr=r,t.$$.smartPtr=e,t.clone();var n=t.clone();return this.destructor(e),n}function o(){return this.isSmartPointer?Ye(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:r,smartPtrType:this,smartPtr:e}):Ye(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var i=this.registeredClass.getActualType(r),s=tt[i];if(!s)return o.call(this);var l;this.isConst?l=s.constPointerType:l=s.pointerType;var c=rt(r,this.registeredClass,l.registeredClass);return c===null?o.call(this):this.isSmartPointer?Ye(l.registeredClass.instancePrototype,{ptrType:l,ptr:c,smartPtrType:this,smartPtr:e}):Ye(l.registeredClass.instancePrototype,{ptrType:l,ptr:c})}var Re=e=>typeof FinalizationRegistry=="undefined"?(Re=r=>r,e):(mr=new FinalizationRegistry(r=>{et(r.$$)}),Re=r=>{var t=r.$$,n=!!t.smartPtr;if(n){var o={$$:t};mr.register(r,o,r)}return r},Zr=r=>mr.unregister(r),Re(e)),Cn=()=>{Object.assign(Qe.prototype,{isAliasOf(e){if(!(this instanceof Qe)||!(e instanceof Qe))return!1;var r=this.$$.ptrType.registeredClass,t=this.$$.ptr;e.$$=e.$$;for(var n=e.$$.ptrType.registeredClass,o=e.$$.ptr;r.baseClass;)t=r.upcast(t),r=r.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return r===n&&t===o},clone(){if(this.$$.ptr||hr(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=Re(Object.create(Object.getPrototypeOf(this),{$$:{value:gn(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e},delete(){this.$$.ptr||hr(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&C("Object already scheduled for deletion"),Zr(this),et(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||hr(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&C("Object already scheduled for deletion"),Fe.push(this),Fe.length===1&&Se&&Se(gr),this.$$.deleteScheduled=!0,this}})};function Qe(){}var Je=(e,r)=>Object.defineProperty(r,"name",{value:e}),yr=(e,r,t)=>{if(e[r].overloadTable===void 0){var n=e[r];e[r]=function(...o){return e[r].overloadTable.hasOwnProperty(o.length)||C(`Function '${t}' called with an invalid number of arguments (${o.length}) - expects one of (${e[r].overloadTable})!`),e[r].overloadTable[o.length].apply(this,o)},e[r].overloadTable=[],e[r].overloadTable[n.argCount]=n}},nt=(e,r,t)=>{u.hasOwnProperty(e)?((t===void 0||u[e].overloadTable!==void 0&&u[e].overloadTable[t]!==void 0)&&C(`Cannot register public name '${e}' twice`),yr(u,e,e),u.hasOwnProperty(t)&&C(`Cannot register multiple overloads of a function with the same number of arguments (${t})!`),u[e].overloadTable[t]=r):(u[e]=r,t!==void 0&&(u[e].numArguments=t))},Tn=48,Fn=57,Sn=e=>{if(e===void 0)return"_unknown";e=e.replace(/[^a-zA-Z0-9_]/g,"$");var r=e.charCodeAt(0);return r>=Tn&&r<=Fn?`_${e}`:e};function Dn(e,r,t,n,o,i,s,l){this.name=e,this.constructor=r,this.instancePrototype=t,this.rawDestructor=n,this.baseClass=o,this.getActualType=i,this.upcast=s,this.downcast=l,this.pureVirtualFunctions=[]}var Ze=(e,r,t)=>{for(;r!==t;)r.upcast||C(`Expected null or instance of ${t.name}, got an instance of ${r.name}`),e=r.upcast(e),r=r.baseClass;return e};function Rn(e,r){if(r===null)return this.isReference&&C(`null is not a valid ${this.name}`),0;r.$$||C(`Cannot pass "${br(r)}" as a ${this.name}`),r.$$.ptr||C(`Cannot pass deleted object as a pointer of type ${this.name}`);var t=r.$$.ptrType.registeredClass,n=Ze(r.$$.ptr,t,this.registeredClass);return n}function Mn(e,r){var t;if(r===null)return this.isReference&&C(`null is not a valid ${this.name}`),this.isSmartPointer?(t=this.rawConstructor(),e!==null&&e.push(this.rawDestructor,t),t):0;(!r||!r.$$)&&C(`Cannot pass "${br(r)}" as a ${this.name}`),r.$$.ptr||C(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&r.$$.ptrType.isConst&&C(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`);var n=r.$$.ptrType.registeredClass;if(t=Ze(r.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(r.$$.smartPtr===void 0&&C("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:r.$$.smartPtrType===this?t=r.$$.smartPtr:C(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:t=r.$$.smartPtr;break;case 2:if(r.$$.smartPtrType===this)t=r.$$.smartPtr;else{var o=r.clone();t=this.rawShare(t,he.toHandle(()=>o.delete())),e!==null&&e.push(this.rawDestructor,t)}break;default:C("Unsupporting sharing policy")}return t}function $n(e,r){if(r===null)return this.isReference&&C(`null is not a valid ${this.name}`),0;r.$$||C(`Cannot pass "${br(r)}" as a ${this.name}`),r.$$.ptr||C(`Cannot pass deleted object as a pointer of type ${this.name}`),r.$$.ptrType.isConst&&C(`Cannot convert argument of type ${r.$$.ptrType.name} to parameter type ${this.name}`);var t=r.$$.ptrType.registeredClass,n=Ze(r.$$.ptr,t,this.registeredClass);return n}function er(e){return this.fromWireType(T[e>>2])}var On=()=>{Object.assign(Me.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){var r;(r=this.rawDestructor)==null||r.call(this,e)},argPackAdvance:se,readValueFromPointer:er,fromWireType:Pn})};function Me(e,r,t,n,o,i,s,l,c,f,d){this.name=e,this.registeredClass=r,this.isReference=t,this.isConst=n,this.isSmartPointer=o,this.pointeeType=i,this.sharingPolicy=s,this.rawGetPointee=l,this.rawConstructor=c,this.rawShare=f,this.rawDestructor=d,!o&&r.baseClass===void 0?n?(this.toWireType=Rn,this.destructorFunction=null):(this.toWireType=$n,this.destructorFunction=null):this.toWireType=Mn}var ot=(e,r,t)=>{u.hasOwnProperty(e)||Xe("Replacing nonexistent public symbol"),u[e].overloadTable!==void 0&&t!==void 0?u[e].overloadTable[t]=r:(u[e]=r,u[e].argCount=t)},Wn=(e,r,t)=>{e=e.replace(/p/g,"i");var n=u["dynCall_"+e];return n(r,...t)},rr=[],at,it=e=>{var r=rr[e];return r||(e>=rr.length&&(rr.length=e+1),rr[e]=r=at.get(e)),r},jn=(e,r,t=[])=>{if(e.includes("j"))return Wn(e,r,t);var n=it(r)(...t);return n},In=(e,r)=>(...t)=>jn(e,r,t),q=(e,r)=>{e=V(e);function t(){return e.includes("j")?In(e,r):it(r)}var n=t();return typeof n!="function"&&C(`unknown function pointer with signature ${e}: ${r}`),n},Nn=(e,r)=>{var t=Je(r,function(n){this.name=r,this.message=n;var o=new Error(n).stack;o!==void 0&&(this.stack=this.toString()+`
|
|
8
|
+
`+o.replace(/^Error(:[^\n]*)?\n/,""))});return t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},t},st,lt=e=>{var r=ht(e),t=V(r);return oe(r),t},pe=(e,r)=>{var t=[],n={};function o(i){if(!n[i]&&!ve[i]){if(Ke[i]){Ke[i].forEach(o);return}t.push(i),n[i]=!0}}throw r.forEach(o),new st(`${e}: `+t.map(lt).join([", "]))},xn=(e,r,t,n,o,i,s,l,c,f,d,g,p)=>{d=V(d),i=q(o,i),l&&(l=q(s,l)),f&&(f=q(c,f)),p=q(g,p);var m=Sn(d);nt(m,function(){pe(`Cannot construct ${d} due to unbound types`,[n])}),Q([e,r,t],n?[n]:[],y=>{var W,We;y=y[0];var P,D;n?(P=y.registeredClass,D=P.instancePrototype):D=Qe.prototype;var F=Je(d,function(...je){if(Object.getPrototypeOf(this)!==b)throw new Ee("Use 'new' to construct "+d);if(A.constructor_body===void 0)throw new Ee(d+" has no accessible constructor");var Ie=A.constructor_body[je.length];if(Ie===void 0)throw new Ee(`Tried to invoke ctor of ${d} with invalid number of parameters (${je.length}) - expected (${Object.keys(A.constructor_body).toString()}) parameters instead!`);return Ie.apply(this,je)}),b=Object.create(D,{constructor:{value:F}});F.prototype=b;var A=new Dn(d,F,b,p,P,i,l,f);A.baseClass&&((We=(W=A.baseClass).__derivedClasses)!=null||(W.__derivedClasses=[]),A.baseClass.__derivedClasses.push(A));var O=new Me(d,A,!0,!1,!1),S=new Me(d+"*",A,!1,!1,!1),x=new Me(d+" const*",A,!1,!0,!1);return tt[e]={pointerType:S,constPointerType:x},ot(m,F),[O,S,x]})},wr=e=>{for(;e.length;){var r=e.pop(),t=e.pop();t(r)}};function Un(e){for(var r=1;r<e.length;++r)if(e[r]!==null&&e[r].destructorFunction===void 0)return!0;return!1}function tr(e,r,t,n,o,i){var s=r.length;s<2&&C("argTypes array size mismatch! Must at least get return value and 'this' types!");var l=r[1]!==null&&t!==null,c=Un(r),f=r[0].name!=="void",d=s-2,g=new Array(d),p=[],m=[],y=function(...P){P.length!==d&&C(`function ${e} called with ${P.length} arguments, expected ${d}`),m.length=0;var D;p.length=l?2:1,p[0]=o,l&&(D=r[1].toWireType(m,this),p[1]=D);for(var F=0;F<d;++F)g[F]=r[F+2].toWireType(m,P[F]),p.push(g[F]);var b=n(...p);function A(O){if(c)wr(m);else for(var S=l?1:2;S<r.length;S++){var x=S===1?D:g[S-2];r[S].destructorFunction!==null&&r[S].destructorFunction(x)}if(f)return r[0].fromWireType(O)}return A(b)};return Je(e,y)}var nr=(e,r)=>{for(var t=[],n=0;n<e;n++)t.push(T[r+n*4>>2]);return t},_r=e=>{e=e.trim();let r=e.indexOf("(");return r!==-1?e.substr(0,r):e},Ln=(e,r,t,n,o,i,s,l)=>{var c=nr(t,n);r=V(r),r=_r(r),i=q(o,i),Q([],[e],f=>{f=f[0];var d=`${f.name}.${r}`;function g(){pe(`Cannot call ${d} due to unbound types`,c)}r.startsWith("@@")&&(r=Symbol[r.substring(2)]);var p=f.registeredClass.constructor;return p[r]===void 0?(g.argCount=t-1,p[r]=g):(yr(p,r,d),p[r].overloadTable[t-1]=g),Q([],c,m=>{var y=[m[0],null].concat(m.slice(1)),P=tr(d,y,null,i,s,l);if(p[r].overloadTable===void 0?(P.argCount=t-1,p[r]=P):p[r].overloadTable[t-1]=P,f.registeredClass.__derivedClasses)for(let D of f.registeredClass.__derivedClasses)D.constructor.hasOwnProperty(r)||(D.constructor[r]=P);return[]}),[]})},Hn=(e,r,t,n,o,i)=>{var s=nr(r,t);o=q(n,o),Q([],[e],l=>{l=l[0];var c=`constructor ${l.name}`;if(l.registeredClass.constructor_body===void 0&&(l.registeredClass.constructor_body=[]),l.registeredClass.constructor_body[r-1]!==void 0)throw new Ee(`Cannot register multiple constructors with identical number of parameters (${r-1}) for class '${l.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return l.registeredClass.constructor_body[r-1]=()=>{pe(`Cannot construct ${l.name} due to unbound types`,s)},Q([],s,f=>(f.splice(1,0,null),l.registeredClass.constructor_body[r-1]=tr(c,f,null,o,i),[])),[]})},Bn=(e,r,t,n,o,i,s,l,c)=>{var f=nr(t,n);r=V(r),r=_r(r),i=q(o,i),Q([],[e],d=>{d=d[0];var g=`${d.name}.${r}`;r.startsWith("@@")&&(r=Symbol[r.substring(2)]),l&&d.registeredClass.pureVirtualFunctions.push(r);function p(){pe(`Cannot call ${g} due to unbound types`,f)}var m=d.registeredClass.instancePrototype,y=m[r];return y===void 0||y.overloadTable===void 0&&y.className!==d.name&&y.argCount===t-2?(p.argCount=t-2,p.className=d.name,m[r]=p):(yr(m,r,g),m[r].overloadTable[t-2]=p),Q([],f,P=>{var D=tr(g,P,d,i,s,c);return m[r].overloadTable===void 0?(D.argCount=t-2,m[r]=D):m[r].overloadTable[t-2]=D,[]}),[]})},ut=(e,r,t)=>(e instanceof Object||C(`${t} with invalid "this": ${e}`),e instanceof r.registeredClass.constructor||C(`${t} incompatible with "this" of type ${e.constructor.name}`),e.$$.ptr||C(`cannot call emscripten binding method ${t} on deleted object`),Ze(e.$$.ptr,e.$$.ptrType.registeredClass,r.registeredClass)),zn=(e,r,t,n,o,i,s,l,c,f)=>{r=V(r),o=q(n,o),Q([],[e],d=>{d=d[0];var g=`${d.name}.${r}`,p={get(){pe(`Cannot access ${g} due to unbound types`,[t,s])},enumerable:!0,configurable:!0};return c?p.set=()=>pe(`Cannot access ${g} due to unbound types`,[t,s]):p.set=m=>C(g+" is a read-only property"),Object.defineProperty(d.registeredClass.instancePrototype,r,p),Q([],c?[t,s]:[t],m=>{var y=m[0],P={get(){var F=ut(this,d,g+" getter");return y.fromWireType(o(i,F))},enumerable:!0};if(c){c=q(l,c);var D=m[1];P.set=function(F){var b=ut(this,d,g+" setter"),A=[];c(f,b,D.toWireType(A,F)),wr(A)}}return Object.defineProperty(d.registeredClass.instancePrototype,r,P),[]}),[]})},Er=[],ne=[],kr=e=>{e>9&&--ne[e+1]===0&&(ne[e]=void 0,Er.push(e))},Vn=()=>ne.length/2-5-Er.length,qn=()=>{ne.push(0,1,void 0,1,null,1,!0,1,!1,1),u.count_emval_handles=Vn},he={toValue:e=>(e||C("Cannot use deleted val. handle = "+e),ne[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{let r=Er.pop()||ne.length;return ne[r]=e,ne[r+1]=1,r}}}},Gn={name:"emscripten::val",fromWireType:e=>{var r=he.toValue(e);return kr(e),r},toWireType:(e,r)=>he.toHandle(r),argPackAdvance:se,readValueFromPointer:er,destructorFunction:null},ct=e=>te(e,Gn),br=e=>{if(e===null)return"null";var r=typeof e;return r==="object"||r==="array"||r==="function"?e.toString():""+e},Kn=(e,r)=>{switch(r){case 4:return function(t){return this.fromWireType(Or[t>>2])};case 8:return function(t){return this.fromWireType(Wr[t>>3])};default:throw new TypeError(`invalid float width (${r}): ${e}`)}},Xn=(e,r,t)=>{r=V(r),te(e,{name:r,fromWireType:n=>n,toWireType:(n,o)=>o,argPackAdvance:se,readValueFromPointer:Kn(r,t),destructorFunction:null})},Yn=(e,r,t,n,o,i,s)=>{var l=nr(r,t);e=V(e),e=_r(e),o=q(n,o),nt(e,function(){pe(`Cannot call ${e} due to unbound types`,l)},r-1),Q([],l,c=>{var f=[c[0],null].concat(c.slice(1));return ot(e,tr(e,f,null,o,i,s),r-1),[]})},Qn=(e,r,t)=>{switch(r){case 1:return t?n=>U[n]:n=>B[n];case 2:return t?n=>ee[n>>1]:n=>ze[n>>1];case 4:return t?n=>_[n>>2]:n=>T[n>>2];default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},Jn=(e,r,t,n,o)=>{r=V(r),o===-1&&(o=4294967295);var i=d=>d;if(n===0){var s=32-8*t;i=d=>d<<s>>>s}var l=r.includes("unsigned"),c=(d,g)=>{},f;l?f=function(d,g){return c(g,this.name),g>>>0}:f=function(d,g){return c(g,this.name),g},te(e,{name:r,fromWireType:i,toWireType:f,argPackAdvance:se,readValueFromPointer:Qn(r,t,n!==0),destructorFunction:null})},Zn=(e,r,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],o=n[r];function i(s){var l=T[s>>2],c=T[s+4>>2];return new o(U.buffer,c,l)}t=V(t),te(e,{name:t,fromWireType:i,argPackAdvance:se,readValueFromPointer:i},{ignoreDuplicateRegistrations:!0})},eo=(e,r)=>{ct(e)},ro=(e,r,t,n,o,i,s,l,c,f,d,g)=>{t=V(t),i=q(o,i),l=q(s,l),f=q(c,f),g=q(d,g),Q([e],[r],p=>{p=p[0];var m=new Me(t,p.registeredClass,!1,!1,!0,p,n,i,l,f,g);return[m]})},to=(e,r)=>{r=V(r);var t=r==="std::string";te(e,{name:r,fromWireType(n){var o=T[n>>2],i=n+4,s;if(t)for(var l=i,c=0;c<=o;++c){var f=i+c;if(c==o||B[f]==0){var d=f-l,g=Yr(l,d);s===void 0?s=g:(s+=String.fromCharCode(0),s+=g),l=f+1}}else{for(var p=new Array(o),c=0;c<o;++c)p[c]=String.fromCharCode(B[i+c]);s=p.join("")}return oe(n),s},toWireType(n,o){o instanceof ArrayBuffer&&(o=new Uint8Array(o));var i,s=typeof o=="string";s||o instanceof Uint8Array||o instanceof Uint8ClampedArray||o instanceof Int8Array||C("Cannot pass non-string to std::string"),t&&s?i=Te(o):i=o.length;var l=Cr(4+i+1),c=l+4;if(T[l>>2]=i,t&&s)de(o,c,i+1);else if(s)for(var f=0;f<i;++f){var d=o.charCodeAt(f);d>255&&(oe(c),C("String has UTF-16 code units that do not fit in 8 bits")),B[c+f]=d}else for(var f=0;f<i;++f)B[c+f]=o[f];return n!==null&&n.push(oe,l),l},argPackAdvance:se,readValueFromPointer:er,destructorFunction(n){oe(n)}})},ft=typeof TextDecoder!="undefined"?new TextDecoder("utf-16le"):void 0,no=(e,r)=>{for(var t=e,n=t>>1,o=n+r/2;!(n>=o)&&ze[n];)++n;if(t=n<<1,t-e>32&&ft)return ft.decode(B.subarray(e,t));for(var i="",s=0;!(s>=r/2);++s){var l=ee[e+s*2>>1];if(l==0)break;i+=String.fromCharCode(l)}return i},oo=(e,r,t)=>{if(t!=null||(t=2147483647),t<2)return 0;t-=2;for(var n=r,o=t<e.length*2?t/2:e.length,i=0;i<o;++i){var s=e.charCodeAt(i);ee[r>>1]=s,r+=2}return ee[r>>1]=0,r-n},ao=e=>e.length*2,io=(e,r)=>{for(var t=0,n="";!(t>=r/4);){var o=_[e+t*4>>2];if(o==0)break;if(++t,o>=65536){var i=o-65536;n+=String.fromCharCode(55296|i>>10,56320|i&1023)}else n+=String.fromCharCode(o)}return n},so=(e,r,t)=>{if(t!=null||(t=2147483647),t<4)return 0;for(var n=r,o=n+t-4,i=0;i<e.length;++i){var s=e.charCodeAt(i);if(s>=55296&&s<=57343){var l=e.charCodeAt(++i);s=65536+((s&1023)<<10)|l&1023}if(_[r>>2]=s,r+=4,r+4>o)break}return _[r>>2]=0,r-n},lo=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n>=55296&&n<=57343&&++t,r+=4}return r},uo=(e,r,t)=>{t=V(t);var n,o,i,s;r===2?(n=no,o=oo,s=ao,i=l=>ze[l>>1]):r===4&&(n=io,o=so,s=lo,i=l=>T[l>>2]),te(e,{name:t,fromWireType:l=>{for(var c=T[l>>2],f,d=l+4,g=0;g<=c;++g){var p=l+4+g*r;if(g==c||i(p)==0){var m=p-d,y=n(d,m);f===void 0?f=y:(f+=String.fromCharCode(0),f+=y),d=p+r}}return oe(l),f},toWireType:(l,c)=>{typeof c!="string"&&C(`Cannot pass non-string to C++ string type ${t}`);var f=s(c),d=Cr(4+f+r);return T[d>>2]=f/r,o(c,d+4,f+r),l!==null&&l.push(oe,d),d},argPackAdvance:se,readValueFromPointer:er,destructorFunction(l){oe(l)}})},co=(e,r)=>{r=V(r),te(e,{isVoid:!0,name:r,argPackAdvance:0,fromWireType:()=>{},toWireType:(t,n)=>{}})},fo=1,vo=()=>fo,po=(e,r,t)=>B.copyWithin(e,r,r+t),Ar=[],ho=(e,r,t,n)=>(e=Ar[e],r=he.toValue(r),e(null,r,t,n)),mo=e=>{var r=Ar.length;return Ar.push(e),r},dt=(e,r)=>{var t=ve[e];return t===void 0&&C(`${r} has unknown type ${lt(e)}`),t},go=(e,r)=>{for(var t=new Array(e),n=0;n<e;++n)t[n]=dt(T[r+n*4>>2],"parameter "+n);return t},yo=Reflect.construct,wo=(e,r,t)=>{var n=[],o=e.toWireType(n,t);return n.length&&(T[r>>2]=he.toHandle(n)),o},_o=(e,r,t)=>{var n=go(e,r),o=n.shift();e--;var i=new Array(e),s=(c,f,d,g)=>{for(var p=0,m=0;m<e;++m)i[m]=n[m].readValueFromPointer(g+p),p+=n[m].argPackAdvance;var y=t===1?yo(f,i):f.apply(c,i);return wo(o,d,y)},l=`methodCaller<(${n.map(c=>c.name).join(", ")}) => ${o.name}>`;return mo(Je(l,s))},Eo=e=>{e>9&&(ne[e+1]+=1)},ko=e=>{var r=he.toValue(e);wr(r),kr(e)},bo=(e,r)=>{e=dt(e,"_emval_take_value");var t=e.readValueFromPointer(r);return he.toHandle(t)},$e=(e,r)=>r+2097152>>>0<4194305-!!e?(e>>>0)+r*4294967296:NaN;function Ao(e,r,t){var n=$e(e,r),o=new Date(n*1e3);_[t>>2]=o.getUTCSeconds(),_[t+4>>2]=o.getUTCMinutes(),_[t+8>>2]=o.getUTCHours(),_[t+12>>2]=o.getUTCDate(),_[t+16>>2]=o.getUTCMonth(),_[t+20>>2]=o.getUTCFullYear()-1900,_[t+24>>2]=o.getUTCDay();var i=Date.UTC(o.getUTCFullYear(),0,1,0,0,0,0),s=(o.getTime()-i)/(1e3*60*60*24)|0;_[t+28>>2]=s}var Po=e=>e%4===0&&(e%100!==0||e%400===0),Co=[0,31,60,91,121,152,182,213,244,274,305,335],To=[0,31,59,90,120,151,181,212,243,273,304,334],Fo=e=>{var r=Po(e.getFullYear()),t=r?Co:To,n=t[e.getMonth()]+e.getDate()-1;return n};function So(e,r,t){var n=$e(e,r),o=new Date(n*1e3);_[t>>2]=o.getSeconds(),_[t+4>>2]=o.getMinutes(),_[t+8>>2]=o.getHours(),_[t+12>>2]=o.getDate(),_[t+16>>2]=o.getMonth(),_[t+20>>2]=o.getFullYear()-1900,_[t+24>>2]=o.getDay();var i=Fo(o)|0;_[t+28>>2]=i,_[t+36>>2]=-(o.getTimezoneOffset()*60);var s=new Date(o.getFullYear(),0,1),l=new Date(o.getFullYear(),6,1).getTimezoneOffset(),c=s.getTimezoneOffset(),f=(l!=c&&o.getTimezoneOffset()==Math.min(c,l))|0;_[t+32>>2]=f}function Do(e,r,t,n,o,i,s,l){var c=$e(o,i);try{if(isNaN(c))return 61;var f=I.getStreamFromFD(n),d=a.mmap(f,e,c,r,t),g=d.ptr;return _[s>>2]=d.allocated,T[l>>2]=g,0}catch(p){if(typeof a=="undefined"||p.name!=="ErrnoError")throw p;return-p.errno}}function Ro(e,r,t,n,o,i,s){var l=$e(i,s);try{var c=I.getStreamFromFD(o);t&2&&I.doMsync(e,c,r,n,l)}catch(f){if(typeof a=="undefined"||f.name!=="ErrnoError")throw f;return-f.errno}}var Mo=(e,r,t,n)=>{var o=new Date().getFullYear(),i=new Date(o,0,1),s=new Date(o,6,1),l=i.getTimezoneOffset(),c=s.getTimezoneOffset(),f=Math.max(l,c);T[e>>2]=f*60,_[r>>2]=+(l!=c);var d=m=>m.toLocaleTimeString(void 0,{hour12:!1,timeZoneName:"short"}).split(" ")[1],g=d(i),p=d(s);c<l?(de(g,t,17),de(p,n,17)):(de(g,n,17),de(p,t,17))},$o=()=>Date.now(),vt=()=>2147483648,Oo=()=>vt(),pt;pt=()=>performance.now();var Wo=e=>{var r=Be.buffer,t=(e-r.byteLength+65535)/65536;try{return Be.grow(t),jr(),1}catch(n){}},jo=e=>{var r=B.length;e>>>=0;var t=vt();if(e>t)return!1;for(var n=(c,f)=>c+(f-c%f)%f,o=1;o<=4;o*=2){var i=r*(1+.2/o);i=Math.min(i,e+100663296);var s=Math.min(t,n(Math.max(e,i),65536)),l=Wo(s);if(l)return!0}return!1},Pr={},Io=()=>me||"./this.program",Oe=()=>{if(!Oe.strings){var e=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:e,_:Io()};for(var t in Pr)Pr[t]===void 0?delete r[t]:r[t]=Pr[t];var n=[];for(var t in r)n.push(`${t}=${r[t]}`);Oe.strings=n}return Oe.strings},No=(e,r)=>{for(var t=0;t<e.length;++t)U[r++]=e.charCodeAt(t);U[r]=0},xo=(e,r)=>{var t=0;return Oe().forEach((n,o)=>{var i=r+t;T[e+o*4>>2]=i,No(n,i),t+=n.length+1}),0},Uo=(e,r)=>{var t=Oe();T[e>>2]=t.length;var n=0;return t.forEach(o=>n+=o.length+1),T[r>>2]=n,0},Lo=0,Ho=()=>qt||Lo>0,Bo=e=>{var r;lr=e,Ho()||((r=u.onExit)==null||r.call(u,e),sr=!0),be(e,new Vt(e))},zo=(e,r)=>{lr=e,Bo(e)},Vo=zo;function qo(e){try{var r=I.getStreamFromFD(e);return a.close(r),0}catch(t){if(typeof a=="undefined"||t.name!=="ErrnoError")throw t;return t.errno}}function Go(e,r){try{var t=0,n=0,o=0,i=I.getStreamFromFD(e),s=i.tty?2:a.isDir(i.mode)?3:a.isLink(i.mode)?7:4;return U[r]=s,ee[r+2>>1]=o,j=[t>>>0,(E=t,+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],_[r+8>>2]=j[0],_[r+12>>2]=j[1],j=[n>>>0,(E=n,+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],_[r+16>>2]=j[0],_[r+20>>2]=j[1],0}catch(l){if(typeof a=="undefined"||l.name!=="ErrnoError")throw l;return l.errno}}var Ko=(e,r,t,n)=>{for(var o=0,i=0;i<t;i++){var s=T[r>>2],l=T[r+4>>2];r+=8;var c=a.read(e,U,s,l,n);if(c<0)return-1;if(o+=c,c<l)break;typeof n!="undefined"&&(n+=c)}return o};function Xo(e,r,t,n){try{var o=I.getStreamFromFD(e),i=Ko(o,r,t);return T[n>>2]=i,0}catch(s){if(typeof a=="undefined"||s.name!=="ErrnoError")throw s;return s.errno}}function Yo(e,r,t,n,o){var i=$e(r,t);try{if(isNaN(i))return 61;var s=I.getStreamFromFD(e);return a.llseek(s,i,n),j=[s.position>>>0,(E=s.position,+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],_[o>>2]=j[0],_[o+4>>2]=j[1],s.getdents&&i===0&&n===0&&(s.getdents=null),0}catch(l){if(typeof a=="undefined"||l.name!=="ErrnoError")throw l;return l.errno}}var Qo=(e,r,t,n)=>{for(var o=0,i=0;i<t;i++){var s=T[r>>2],l=T[r+4>>2];r+=8;var c=a.write(e,U,s,l,n);if(c<0)return-1;o+=c,typeof n!="undefined"&&(n+=c)}return o};function Jo(e,r,t,n){try{var o=I.getStreamFromFD(e),i=Qo(o,r,t);return T[n>>2]=i,0}catch(s){if(typeof a=="undefined"||s.name!=="ErrnoError")throw s;return s.errno}}var Zo=a.createPath,ea=e=>a.unlink(e),ra=a.createLazyFile,ta=a.createDevice;a.createPreloadedFile=Xr,a.staticInit(),u.FS_createPath=a.createPath,u.FS_createDataFile=a.createDataFile,u.FS_createPreloadedFile=a.createPreloadedFile,u.FS_unlink=a.unlink,u.FS_createLazyFile=a.createLazyFile,u.FS_createDevice=a.createDevice,pn(),Ee=u.BindingError=class extends Error{constructor(r){super(r),this.name="BindingError"}},Jr=u.InternalError=class extends Error{constructor(r){super(r),this.name="InternalError"}},Cn(),kn(),On(),st=u.UnboundTypeError=Nn(Error,"UnboundTypeError"),qn();var na={a:Xt,q:on,M:an,P:sn,I:ln,r:un,G:cn,N:fn,S:dn,D:vn,U:mn,e:xn,s:Ln,n:Hn,g:Bn,m:zn,T:ct,v:Xn,i:Yn,c:Jn,b:Zn,x:eo,o:ro,u:to,l:uo,V:co,Q:vo,R:po,X:ho,d:kr,Y:_o,w:Eo,W:ko,h:bo,A:Ao,B:So,y:Do,z:Ro,H:Mo,t:$o,F:Oo,j:pt,E:jo,K:xo,L:Uo,f:Vo,k:qo,J:Go,O:Xo,C:Yo,p:Jo},N=zt(),oa=()=>(oa=N._)(),ht=e=>(ht=N.$)(e),Cr=e=>(Cr=N.ba)(e),oe=e=>(oe=N.ca)(e),mt=(e,r)=>(mt=N.da)(e,r),gt=e=>(gt=N.ea)(e),aa=u.dynCall_jjj=(e,r,t,n,o)=>(aa=u.dynCall_jjj=N.fa)(e,r,t,n,o),ia=u.dynCall_iiiijj=(e,r,t,n,o,i,s,l)=>(ia=u.dynCall_iiiijj=N.ga)(e,r,t,n,o,i,s,l),sa=u.dynCall_viijj=(e,r,t,n,o,i,s)=>(sa=u.dynCall_viijj=N.ha)(e,r,t,n,o,i,s),la=u.dynCall_viiijjjj=(e,r,t,n,o,i,s,l,c,f,d,g)=>(la=u.dynCall_viiijjjj=N.ia)(e,r,t,n,o,i,s,l,c,f,d,g),ua=u.dynCall_iji=(e,r,t,n)=>(ua=u.dynCall_iji=N.ja)(e,r,t,n),ca=u.dynCall_jiji=(e,r,t,n,o)=>(ca=u.dynCall_jiji=N.ka)(e,r,t,n,o),fa=u.dynCall_viijii=(e,r,t,n,o,i,s)=>(fa=u.dynCall_viijii=N.la)(e,r,t,n,o,i,s),da=u.dynCall_iiiiij=(e,r,t,n,o,i,s)=>(da=u.dynCall_iiiiij=N.ma)(e,r,t,n,o,i,s),va=u.dynCall_iiiiijj=(e,r,t,n,o,i,s,l,c)=>(va=u.dynCall_iiiiijj=N.na)(e,r,t,n,o,i,s,l,c),pa=u.dynCall_iiiiiijj=(e,r,t,n,o,i,s,l,c,f)=>(pa=u.dynCall_iiiiiijj=N.oa)(e,r,t,n,o,i,s,l,c,f);u.addRunDependency=Ve,u.removeRunDependency=Ce,u.FS_createPreloadedFile=Xr,u.FS_unlink=ea,u.FS_createPath=Zo,u.FS_createDevice=ta,u.FS_createDataFile=Kr,u.FS_createLazyFile=ra;var or;Pe=function e(){or||yt(),or||(Pe=e)};function yt(){if(fe>0||($t(),fe>0))return;function e(){var r;or||(or=!0,u.calledRun=!0,!sr&&(Ot(),M(u),(r=u.onRuntimeInitialized)==null||r.call(u),Wt()))}u.setStatus?(u.setStatus("Running..."),setTimeout(function(){setTimeout(function(){u.setStatus("")},1),e()},1)):e()}if(u.preInit)for(typeof u.preInit=="function"&&(u.preInit=[u.preInit]);u.preInit.length>0;)u.preInit.pop()();return yt(),w=G,w}})();typeof Ct=="object"&&typeof Fr=="object"?Fr.exports=Tr:typeof define=="function"&&define.amd&&define([],()=>Tr);Tr.getUrl=function(R){return"https://st.mycdn.me/static/audio-processing/0-0-8/"+R}});var Ne=class{constructor(h,v="AudioEffects"){this.loggerFunction=h,this.loggerName=v}debug(...h){this.loggerFunction("DEBUG",`[${this.loggerName}]`,...h)}log(...h){this.loggerFunction("LOG",`[${this.loggerName}]`,...h)}warn(...h){this.loggerFunction("WARN",`[${this.loggerName}]`,...h)}error(...h){this.loggerFunction("ERROR",`[${this.loggerName}]`,...h)}};function ar(R,h=[]){let v=h.join(","),w=typeof R=="string"?[R,`exports.default(${v});`]:[`(${R})(${v});`],u=new Blob(w,{type:"application/javascript; charset=utf-8"});return window.URL.createObjectURL(u)}var ke=class{constructor(){this.outputStream=null;this.isInitialized=!1;this.audioContext=null;this.workletNode=null;this.sourceNode=null;this.logger=new Ne(()=>{})}init(L){return J(this,arguments,function*({sampleRate:h,isOutputAudio:v=!1,isOutputStream:w=!1,workletFunction:u,workletName:M}){if(this.logger.debug("init"),this.createAudioContext(h),yield this.createWorklet(u,M),this.workletNode&&this.audioContext&&(v&&(this.workletNode.connect(this.audioContext.destination),this.logger.debug("connected to standart audio output")),w)){let G=this.audioContext.createMediaStreamDestination();this.workletNode.connect(G),this.outputStream=G.stream,this.logger.debug("connected to output MediaStream")}this.isInitialized=!0})}setSource(h){var v;if(this.audioContext&&this.workletNode){let w=null;if(h){let u=new MediaStream(h instanceof MediaStreamTrack?[h]:h.getAudioTracks().filter(M=>M.contentHint!=="music"));w=this.audioContext.createMediaStreamSource(u)}(v=this.sourceNode)==null||v.disconnect(this.workletNode),w==null||w.connect(this.workletNode),this.sourceNode=w,this.logger.debug("source "+(h?"set":"set to null"))}}destroy(){var h;this.logger.debug("destroy"),(h=this.audioContext)==null||h.close(),this.workletNode=null,this.sourceNode=null,this.audioContext=null,this.outputStream=null,this.isInitialized=!1}resume(){var h;this.logger.debug("resume"),(h=this.audioContext)==null||h.resume()}pause(){var h;this.logger.debug("pause"),(h=this.audioContext)==null||h.suspend()}setLogger(h=()=>{},v){this.logger=new Ne(h,v)}static isSupported(){try{let h=window;return!!(h.WebAssembly&&h.Worker&&(h.AudioContext||h.webkitAudioContext)&&h.AudioWorkletNode)}catch(h){return!1}}createAudioContext(h){let v=window.AudioContext||window.webkitAudioContext,w=new v(h?{sampleRate:h}:{});this.audioContext=w,this.logger.debug("created AudioContext")}createWorklet(h,v){return J(this,null,function*(){if(this.logger.debug(`${v} init started`),!this.audioContext)return;yield this.audioContext.audioWorklet.addModule(ar(h));let w=new AudioWorkletNode(this.audioContext,v);return this.workletNode=w,new Promise(u=>{w.port.onmessage=({data:M})=>{switch(M.type){case"init":{this.logger.debug(`${v} init success`),u();break}case"data":{this.onWorkletData(M.data);break}}}})})}sendDataToWorklet(h,v=[]){var w;(w=this.workletNode)==null||w.port.postMessage(h,v)}};function Pt(){let K=[.26691192,.5013858,.3037737,.58564115,.35116732,.67516255,.41435885,.7225562,.4775504,.7752158,.5881356,.79627967,.68818885,.7594179,.75138044,.7120243,.8040401,.65936464,.85143363,.57510924,.8777635,.4855879,.4512206,.58564115,.5038802,.56457734,.5512739,.5540454,.5776037,.56457734,.60393345,.5540454,.66712505,.56457734,.70398676,.57510924,.65132713,.606705,.6144654,.6172369,.5776037,.6172369,.5407419,.6172369,.5038802,.606705,.46701849,.58564115,.5407419,.58564115,.5776037,.58564115,.6144654,.58564115,.68818885,.57510924,.6144654,.58564115,.5776037,.58564115,.5407419,.58564115],Z=K[59],Mr=1-K[59];class He extends AudioWorkletProcessor{constructor(){super();this.lastTime=0;this.frameSampleCount=0;this.frameSampleAverage=0;this.maxInputVolume=.3;this.sequence=0;this.port.postMessage({type:"init"})}process(me){var ge;let be=currentTime,X=0,ce=(ge=me==null?void 0:me[0])==null?void 0:ge[0];if(ce!=null&&ce.length&&(X=ce.reduce((ae,z)=>ae+Math.abs(z),0)/ce.length),this.frameSampleAverage=(this.frameSampleAverage*this.frameSampleCount+X)/(this.frameSampleCount+1),this.frameSampleCount+=1,be-this.lastTime>1/25){let Y=[];for(let z=0;z<31*2;z+=1)Y.push(K[z]);this.frameSampleAverage>.015&&(Y[59]=this.frameSampleAverage/this.maxInputVolume>.5?this.sequence%2===0?this.frameSampleAverage/2:this.frameSampleAverage:this.frameSampleAverage,Y[59]=Z+Mr*Y[59]/.5),this.sequence+=1,this.frameSampleCount=1,this.maxInputVolume=Math.max(this.maxInputVolume,this.frameSampleAverage),this.lastTime=be;let ae=new Float32Array(Y).buffer;this.port.postMessage({type:"data",data:ae},[ae])}return!0}}registerProcessor("vmojiLmarksVolumeWorklet",He)}var xe=class extends ke{constructor(){super(...arguments);this.onData=()=>{}}init(){return J(this,null,function*(){yield le(xe.prototype,this,"init").call(this,{workletFunction:Pt,workletName:"vmojiLmarksVolumeWorklet"})})}onWorkletData(v){this.onData(v)}};var Dr=bt(Sr());var ue=class extends ke{constructor(){super(...arguments);this.worker=null;this.performanceMonitor=null}init(v){return J(this,null,function*(){yield le(ue.prototype,this,"init").call(this,v),this.isInitialized=!1,yield this.createWorker(v.workerFunctionString,v.workerArgs),this.isInitialized=!0})}resume(){var v;super.resume(),(v=this.performanceMonitor)==null||v.start()}pause(){var v;super.pause(),(v=this.performanceMonitor)==null||v.stop()}setLogger(v,w){var u;super.setLogger(v,w),(u=this.performanceMonitor)==null||u.setLogger(this.logger)}destroy(){var v,w;super.destroy(),(v=this.performanceMonitor)==null||v.stop(),(w=this.worker)==null||w.terminate(),this.worker=null}sendDataToWorker(v,w=[]){var u;(u=this.worker)==null||u.postMessage(v,w)}static isSupported(){try{let v=window;return!!(super.isSupported()&&v.Worker)}catch(v){return!1}}createWorker(v,w=[]){return new Promise((u,M)=>{this.logger.debug("worker init started"),this.worker=new Worker(ar(v,w)),this.worker.onmessage=({data:L})=>{switch(L.type){case"init":{this.logger.debug("worker init success"),u();break}case"error":{this.logger.error(L.error),M(L.error);break}case"data":{this.onWorkerData(L.data);break}case"debug":{this.logger.debug(L.message);break}}}})}};function Tt(){class R extends AudioWorkletProcessor{constructor(){super(),this.port.postMessage({type:"init"})}process(v){var w;return(w=v==null?void 0:v[0])!=null&&w[0]&&this.port.postMessage({type:"data",data:v[0][0].buffer},[v[0][0].buffer]),!0}}registerProcessor("pureWorklet",R)}var ka=16e3,Ue=class extends ue{constructor(){super(...arguments);this.onData=()=>{}}init(){return J(this,null,function*(){yield le(Ue.prototype,this,"init").call(this,{sampleRate:ka,workletFunction:Tt,workletName:"pureWorklet",workerFunctionString:`"use strict";var exports=(()=>{var p=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var b=(o,t)=>{for(var e in t)p(o,e,{get:t[e],enumerable:!0})},y=(o,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of f(t))!w.call(o,i)&&i!==e&&p(o,i,{get:()=>t[i],enumerable:!(n=m(t,i))||n.enumerable});return o};var A=o=>y(p({},"__esModule",{value:!0}),o);var x={};b(x,{default:()=>v});var v=(o,t)=>{let e=null,n=null;function i(){return o({locateFile:t}).then(r=>{e=r;let l=new e.ConfigInput("animoji_v4.cfg",!0,"/"),s=new e.Config(l);n=e.AnimojiFactory.createAlgorithm(s)})}function g(r){self.postMessage({type:"error",error:typeof r=="number"&&e?e.getExMessage(r):r})}function k(r){var l;if(!(!e||!n))try{let s=new e.vector$float$,h=new Float32Array(r);for(let u of h)s.push_back(u);let a=e.animate(n,s),d=(l=a==null?void 0:a.size)==null?void 0:l.call(a);if(!d)return;let c=new Float32Array(d);for(let u=0;u<d;u++)c[u]=a.get(u);self.postMessage({type:"data",data:c.buffer},[c.buffer])}catch(s){g(s)}}i().then(()=>{self.onmessage=r=>{k(r.data.data)},self.postMessage({type:"init"})}).catch(g)};return A(x);})();
|
|
9
|
+
`,workerArgs:[Dr.default,Dr.default.getUrl]})})}onWorkletData(v){this.sendDataToWorker({data:v},[v])}onWorkerData(v){this.onData(v)}static isSupported(){try{let v=super.isSupported(),w=/firefox/i.test(navigator.userAgent);return v&&!w}catch(v){return!1}}};var Rr=bt(Sr());function Ft(){class R extends AudioWorkletProcessor{constructor(){super();this.samplesQueue=new Float32Array;this.lastFrameTime=0;this.port.postMessage({type:"init"}),this.port.onmessage=({data:{data:w}})=>{let u=new Float32Array(w);currentTime-this.lastFrameTime>=.1&&(this.samplesQueue=new Float32Array);let M=new Float32Array(this.samplesQueue.length+u.length);M.set(this.samplesQueue,0),M.set(u,this.samplesQueue.length),this.samplesQueue=M,this.lastFrameTime=currentTime}}process(w,u){var M;return(M=w==null?void 0:w[0])!=null&&M[0]&&this.port.postMessage({type:"data",data:w[0][0].buffer},[w[0][0].buffer]),this.samplesQueue.length>=128&&(u[0].forEach(G=>{G.set(this.samplesQueue.subarray(0,128))}),this.samplesQueue=this.samplesQueue.slice(128)),!0}}registerProcessor("voiceChangeWorklet",R)}var ba=1.4,Aa=1e3,St=(v=>(v.PEAK="peak",v.AVG="avg",v))(St||{}),ir=class{constructor({badPerformanceThreshold:h=ba,measureIntervalMs:v=Aa,mode:w="avg",logPerformanceChecks:u=!1,onBadPerformanceCb:M}){this.logger=null;this.interval=0;this.beginMarkTs=0;this.performanceMeasures=[];this.threshold=h,this.intervalMs=v,this.mode=w,this.logPerformanceChecks=u,this.onBadPerformanceCb=M}check(){var h,v,w;if(this.mode==="peak"){let u=Math.max(...this.performanceMeasures);this.logPerformanceChecks&&((h=this.logger)==null||h.debug("performanceMonitor check peak measure:",u.toFixed(2))),u>this.threshold&&this.onBadPerformanceCb(u)}else{let M=this.performanceMeasures.reduce((L,G)=>L+G,0)/this.performanceMeasures.length||0;this.logPerformanceChecks&&((v=this.logger)==null||v.debug("performanceMonitor check measure avg:",M.toFixed(2)),(w=this.logger)==null||w.debug("performanceMonitor check measure arr:",JSON.stringify(this.performanceMeasures))),M>=this.threshold&&this.onBadPerformanceCb(M)}this.performanceMeasures=[]}markBegin(){this.beginMarkTs||(this.beginMarkTs=Date.now())}markEnd(){this.beginMarkTs&&(this.performanceMeasures.push(Date.now()-this.beginMarkTs),this.beginMarkTs=0)}start(){var h;this.interval||(this.interval=window.setInterval(this.check.bind(this),this.intervalMs),this.performanceMeasures=[],this.beginMarkTs=0,(h=this.logger)==null||h.debug("performanceMonitor started"))}stop(){var h;this.interval&&(window.clearInterval(this.interval),this.interval=0,(h=this.logger)==null||h.debug("performanceMonitor stopped"))}setLogger(h){this.logger=h}};var Dt=(v=>(v.PLAYBACK="playback",v.OUTPUT_STREAM="output_stream",v))(Dt||{}),Rt=(H=>(H.BALLOON="balloon",H.CATHEDRAL="cathedral",H.CHORUS="chorus",H.DISTORTION="distortion",H.ECHO="echo",H.EVIL="evil",H.GIANT="giant",H.HALL="hall",H.PHASER="phaser",H.ROBOT="robot",H.SQUIRELL="squirell",H.DENOISE="denoise",H))(Rt||{}),Pa=44100,Le=class extends ue{constructor(v="playback",w){super();this.mode=v,w&&(this.performanceMonitor=new ir(w))}init(){return J(this,null,function*(){yield le(Le.prototype,this,"init").call(this,{sampleRate:Pa,isOutputAudio:this.mode==="playback",isOutputStream:this.mode==="output_stream",workletFunction:Ft,workletName:"voiceChangeWorklet",workerFunctionString:'"use strict";var exports=(()=>{var p=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var W=(n,r)=>{for(var t in r)p(n,t,{get:r[t],enumerable:!0})},A=(n,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let c of y(r))!b.call(n,c)&&c!==t&&p(n,c,{get:()=>r[c],enumerable:!(i=w(r,c))||i.enumerable});return n};var R=n=>A(p({},"__esModule",{value:!0}),n);var E={};W(E,{VoiceChangeWorkerRequestType:()=>f,default:()=>C});var f=(t=>(t.SET_EFFECTS="set_effects",t.DATA="data",t))(f||{}),C=(n,r)=>{let t=null,i=[];function c(){return n({locateFile:r}).then(e=>{t=e})}function h(e,a=!1){if(t)try{for(let o of e){let g=`${o}${a?".cfg":""}`,u=new t.ConfigInput(g,a,"/"),l=new t.Config(u),s=t.EffectFactory.createAlgorithm(l);i.push({configInput:u,config:l,effect:s})}}catch(o){self.postMessage({type:"debug",message:"before error "+JSON.stringify(i)}),d("setEffects error:",o)}}function k(){try{for(let e of i)e.configInput.delete(),e.config.delete(),e.effect.delete()}catch(e){d("clearEffects error:",e)}i=[]}function d(e,a){self.postMessage({type:"error",error:typeof a=="number"&&t?t.getExMessage(a):e+a})}function m(e){var a;if(!(!t||!i.length))try{let o=new t.vector$float$,g=new Float32Array(e);for(let s of g)o.push_back(s);for(let{effect:s}of i)o=t.applyEffect(s,o);let u=(a=o==null?void 0:o.size)==null?void 0:a.call(o);if(!u)return;let l=new Float32Array(u);for(let s=0;s<u;s++)l[s]=o.get(s);self.postMessage({type:"data",data:l.buffer},[l.buffer])}catch(o){d("requestSamples error:",o)}}c().then(()=>{self.onmessage=({data:e})=>{switch(e.type){case"set_effects":{k(),h(e.effects,e.isPreset);break}case"data":{m(e.data);break}}},self.postMessage({type:"init"})}).catch(e=>d("init error:",e))};return R(E);})();\n',workerArgs:[Rr.default,Rr.default.getUrl]})})}setEffects(v,w){this.logger.debug("setEffects",v,w),this.sendDataToWorker({type:"set_effects",effects:v,isPreset:w})}onWorkletData(v){var w;(w=this.performanceMonitor)==null||w.markBegin(),this.sendDataToWorker({type:"data",data:v},[v])}onWorkerData(v){var w;(w=this.performanceMonitor)==null||w.markEnd(),this.sendDataToWorklet({data:v},[v])}};export{Ue as EffectVmojiLmarksAi,xe as EffectVmojiLmarksVolume,Le as EffectVoiceChange,Dt as EffectVoiceChangeMode,St as PerformanceMonitorMode,Rt as VoiceChangeEffectType};
|