UNPKG

@robotical/martyblocks

Version:

MartyBlocks based on Scratch for Marty the Robot by Robotical

1 lines 164 kB
var createMediapipeSolutionsWasm=(()=>{var e="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0;return"undefined"!=typeof __filename&&(e=e||__filename),function(t){var r,n,o=void 0!==(t=t||{})?t:{};o.ready=new Promise(function(e,t){r=e,n=t}),Object.getOwnPropertyDescriptor(o.ready,"_main")||(Object.defineProperty(o.ready,"_main",{configurable:!0,get:function(){Le("You are getting _main on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(o.ready,"_main",{configurable:!0,set:function(){Le("You are setting _main on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(o.ready,"___getTypeName")||(Object.defineProperty(o.ready,"___getTypeName",{configurable:!0,get:function(){Le("You are getting ___getTypeName on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(o.ready,"___getTypeName",{configurable:!0,set:function(){Le("You are setting ___getTypeName on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(o.ready,"___embind_register_native_and_builtin_types")||(Object.defineProperty(o.ready,"___embind_register_native_and_builtin_types",{configurable:!0,get:function(){Le("You are getting ___embind_register_native_and_builtin_types on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(o.ready,"___embind_register_native_and_builtin_types",{configurable:!0,set:function(){Le("You are setting ___embind_register_native_and_builtin_types on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(o.ready,"___stdio_exit")||(Object.defineProperty(o.ready,"___stdio_exit",{configurable:!0,get:function(){Le("You are getting ___stdio_exit on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(o.ready,"___stdio_exit",{configurable:!0,set:function(){Le("You are setting ___stdio_exit on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(o.ready,"onRuntimeInitialized")||(Object.defineProperty(o.ready,"onRuntimeInitialized",{configurable:!0,get:function(){Le("You are getting onRuntimeInitialized on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(o.ready,"onRuntimeInitialized",{configurable:!0,set:function(){Le("You are setting onRuntimeInitialized on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}));var i=Object.assign({},o),a=[],s="./this.program",u=(e,t)=>{throw t},c="object"==typeof window,l="function"==typeof importScripts,f="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,d=!c&&!f&&!l;if(o.ENVIRONMENT)throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)");var m,p,h,v,g,y,_="";function w(e){if(e instanceof Rn)return;let t=e;e&&"object"==typeof e&&e.stack&&(t=[e,e.stack]),T("exiting due to exception: "+t)}if(f){if("object"!=typeof process||"function"!=typeof require)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");_=l?require("path").dirname(_)+"/":__dirname+"/",y=()=>{g||(v=require("fs"),g=require("path"))},m=function(e,t){return y(),e=g.normalize(e),v.readFileSync(e,t?void 0:"utf8")},h=e=>{var t=m(e,!0);return t.buffer||(t=new Uint8Array(t)),I(t.buffer),t},p=(e,t,r)=>{y(),e=g.normalize(e),v.readFile(e,function(e,n){e?r(e):t(n.buffer)})},process.argv.length>1&&(s=process.argv[1].replace(/\\/g,"/")),a=process.argv.slice(2),process.on("uncaughtException",function(e){if(!(e instanceof Rn))throw e}),process.on("unhandledRejection",function(e){throw e}),u=(e,t)=>{if(we())throw process.exitCode=e,t;w(t),process.exit(e)},o.inspect=function(){return"[Emscripten Module object]"}}else if(d){if("object"==typeof process&&"function"==typeof require||"object"==typeof window||"function"==typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");"undefined"!=typeof read&&(m=function(e){return read(e)}),h=function(e){let t;return"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(t=read(e,"binary"),I("object"==typeof t),t)},p=function(e,t,r){setTimeout(()=>t(h(e)),0)},"undefined"!=typeof scriptArgs?a=scriptArgs:void 0!==arguments&&(a=arguments),"function"==typeof quit&&(u=(e,t)=>{if(_e)throw t;w(t),quit(e)}),"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)}else{if(!c&&!l)throw new Error("environment detection error");if(l?_=self.location.href:"undefined"!=typeof document&&document.currentScript&&(_=document.currentScript.src),e&&(_=e),_=0!==_.indexOf("blob:")?_.substr(0,_.replace(/[?#].*/,"").lastIndexOf("/")+1):"","object"!=typeof window&&"function"!=typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");m=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},l&&(h=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),p=(e,t,r)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?t(n.response):r()},n.onerror=r,n.send(null)}}var b,E=o.print||console.log.bind(console),T=o.printErr||console.warn.bind(console);Object.assign(o,i),i=null,b="fetchSettings",Object.getOwnPropertyDescriptor(o,b)&&Le("`Module."+b+"` was supplied but `"+b+"` not included in INCOMING_MODULE_JS_API"),o.arguments&&(a=o.arguments),x("arguments","arguments_"),o.thisProgram&&(s=o.thisProgram),x("thisProgram","thisProgram"),o.quit&&(u=o.quit),x("quit","quit_"),I(void 0===o.memoryInitializerPrefixURL,"Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),I(void 0===o.pthreadMainPrefixURL,"Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),I(void 0===o.cdInitializerPrefixURL,"Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),I(void 0===o.filePackagePrefixURL,"Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),I(void 0===o.read,"Module.read option was removed (modify read_ in JS)"),I(void 0===o.readAsync,"Module.readAsync option was removed (modify readAsync in JS)"),I(void 0===o.readBinary,"Module.readBinary option was removed (modify readBinary in JS)"),I(void 0===o.setWindowTitle,"Module.setWindowTitle option was removed (modify setWindowTitle in JS)"),I(void 0===o.TOTAL_MEMORY,"Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),x("read","read_"),x("readAsync","readAsync"),x("readBinary","readBinary"),x("setWindowTitle","setWindowTitle"),I(!d,"shell environment detected but not enabled at build time. Add 'shell' to `-s ENVIRONMENT` to enable.");function C(e){C.shown||(C.shown={}),C.shown[e]||(C.shown[e]=1,T(e))}function x(e,t){Object.getOwnPropertyDescriptor(o,e)||Object.defineProperty(o,e,{configurable:!0,get:function(){Le("Module."+e+" has been replaced with plain "+t+" (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}})}function k(e,t){var r="'"+e+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";return t&&(r+=". Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you"),r}function P(e,t){Object.getOwnPropertyDescriptor(o,e)||Object.defineProperty(o,e,{configurable:!0,get:function(){Le(k(e,t))}})}function S(e,t){Object.getOwnPropertyDescriptor(o,e)||(o[e]=()=>Le(k(e,t)))}var A,L=0,F=e=>{L=e};o.wasmBinary&&(A=o.wasmBinary),x("wasmBinary","wasmBinary");var D,O=o.noExitRuntime||!0;x("noExitRuntime","noExitRuntime"),"object"!=typeof WebAssembly&&Le("no native wasm support detected");var B,M=!1;function I(e,t){e||Le("Assertion failed"+(t?": "+t:""))}var R="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function N(e,t,r){for(var n=t+r,o=t;e[o]&&!(o>=n);)++o;if(o-t>16&&e.subarray&&R)return R.decode(e.subarray(t,o));for(var i="";t<o;){var a=e[t++];if(128&a){var s=63&e[t++];if(192!=(224&a)){var u=63&e[t++];if(224==(240&a)?a=(15&a)<<12|s<<6|u:(240!=(248&a)&&C("Invalid UTF-8 leading byte 0x"+a.toString(16)+" encountered when deserializing a UTF-8 string in wasm memory to a JS string!"),a=(7&a)<<18|s<<12|u<<6|63&e[t++]),a<65536)i+=String.fromCharCode(a);else{var c=a-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i}function j(e,t){return e?N(G,e,t):""}function U(e,t,r,n){if(!(n>0))return 0;for(var o=r,i=r+n-1,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343)s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a);if(s<=127){if(r>=i)break;t[r++]=s}else if(s<=2047){if(r+1>=i)break;t[r++]=192|s>>6,t[r++]=128|63&s}else if(s<=65535){if(r+2>=i)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|63&s}else{if(r+3>=i)break;s>1114111&&C("Invalid Unicode code point 0x"+s.toString(16)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF)."),t[r++]=240|s>>18,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}}return t[r]=0,r-o}function z(e,t,r){return I("number"==typeof r,"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),U(e,G,t,r)}function V(e){for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&e.charCodeAt(++r)),n<=127?++t:t+=n<=2047?2:n<=65535?3:4}return t}var W,$,G,H,Y,q,X,K,Z,J="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function Q(e,t){I(e%2==0,"Pointer passed to UTF16ToString must be aligned to two bytes!");for(var r=e,n=r>>1,o=n+t/2;!(n>=o)&&Y[n];)++n;if((r=n<<1)-e>32&&J)return J.decode(G.subarray(e,r));for(var i="",a=0;!(a>=t/2);++a){var s=H[e+2*a>>1];if(0==s)break;i+=String.fromCharCode(s)}return i}function ee(e,t,r){if(I(t%2==0,"Pointer passed to stringToUTF16 must be aligned to two bytes!"),I("number"==typeof r,"stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),void 0===r&&(r=2147483647),r<2)return 0;for(var n=t,o=(r-=2)<2*e.length?r/2:e.length,i=0;i<o;++i){var a=e.charCodeAt(i);H[t>>1]=a,t+=2}return H[t>>1]=0,t-n}function te(e){return 2*e.length}function re(e,t){I(e%4==0,"Pointer passed to UTF32ToString must be aligned to four bytes!");for(var r=0,n="";!(r>=t/4);){var o=q[e+4*r>>2];if(0==o)break;if(++r,o>=65536){var i=o-65536;n+=String.fromCharCode(55296|i>>10,56320|1023&i)}else n+=String.fromCharCode(o)}return n}function ne(e,t,r){if(I(t%4==0,"Pointer passed to stringToUTF32 must be aligned to four bytes!"),I("number"==typeof r,"stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),void 0===r&&(r=2147483647),r<4)return 0;for(var n=t,o=n+r-4,i=0;i<e.length;++i){var a=e.charCodeAt(i);if(a>=55296&&a<=57343)a=65536+((1023&a)<<10)|1023&e.charCodeAt(++i);if(q[t>>2]=a,(t+=4)+4>o)break}return q[t>>2]=0,t-n}function oe(e){for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&++r,t+=4}return t}function ie(e){var t=V(e)+1,r=xn(t);return r&&U(e,$,r,t),r}function ae(e,t){I(e.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)"),$.set(e,t)}function se(e){W=e,o.HEAP8=$=new Int8Array(e),o.HEAP16=H=new Int16Array(e),o.HEAP32=q=new Int32Array(e),o.HEAPU8=G=new Uint8Array(e),o.HEAPU16=Y=new Uint16Array(e),o.HEAPU32=X=new Uint32Array(e),o.HEAPF32=K=new Float32Array(e),o.HEAPF64=Z=new Float64Array(e)}var ue=5242880;o.TOTAL_STACK&&I(ue===o.TOTAL_STACK,"the stack size can no longer be determined at runtime");var ce,le=o.INITIAL_MEMORY||16777216;function fe(){var e=Dn();I(!(3&e)),q[e+4>>2]=34821223,q[e+8>>2]=2310721022,q[0]=1668509029}function de(){if(!M){var e=Dn(),t=X[e+4>>2],r=X[e+8>>2];34821223==t&&2310721022==r||Le("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x"+r.toString(16)+" 0x"+t.toString(16)),1668509029!==q[0]&&Le("Runtime error: The application has corrupted its heap memory area (address zero)!")}}x("INITIAL_MEMORY","INITIAL_MEMORY"),I(le>=ue,"INITIAL_MEMORY should be larger than TOTAL_STACK, was "+le+"! (TOTAL_STACK="+ue+")"),I("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,"JS engine does not provide full typed array support"),I(!o.wasmMemory,"Use of `wasmMemory` detected. Use -s IMPORTED_MEMORY to define wasmMemory externally"),I(16777216==le,"Detected runtime INITIAL_MEMORY setting. Use -s IMPORTED_MEMORY to define wasmMemory dynamically"),function(){var e=new Int16Array(1),t=new Int8Array(e.buffer);if(e[0]=25459,115!==t[0]||99!==t[1])throw"Runtime error: expected the system to be little-endian! (Run with -s SUPPORT_BIG_ENDIAN=1 to bypass)"}();var me=[],pe=[],he=[],ve=[],ge=!1,ye=!1,_e=0;function we(){return O||_e>0}function be(e){me.unshift(e)}function Ee(e){ve.unshift(e)}I(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),I(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),I(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),I(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var Te=0,Ce=null,xe=null,ke={};function Pe(e){for(var t=e;;){if(!ke[e])return e;e=t+Math.random()}}function Se(e){Te++,o.monitorRunDependencies&&o.monitorRunDependencies(Te),e?(I(!ke[e]),ke[e]=1,null===Ce&&"undefined"!=typeof setInterval&&(Ce=setInterval(function(){if(M)return clearInterval(Ce),void(Ce=null);var e=!1;for(var t in ke)e||(e=!0,T("still waiting on run dependencies:")),T("dependency: "+t);e&&T("(end of list)")},1e4))):T("warning: run dependency added without ID")}function Ae(e){if(Te--,o.monitorRunDependencies&&o.monitorRunDependencies(Te),e?(I(ke[e]),delete ke[e]):T("warning: run dependency removed without ID"),0==Te&&(null!==Ce&&(clearInterval(Ce),Ce=null),xe)){var t=xe;xe=null,t()}}function Le(e){o.onAbort&&o.onAbort(e),T(e="Aborted("+e+")"),M=!0,B=1;var t=new WebAssembly.RuntimeError(e);throw n(t),t}o.preloadedImages={},o.preloadedAudios={};var Fe,De,Oe,Be;function Me(e){return e.startsWith("data:application/octet-stream;base64,")}function Ie(e){return e.startsWith("file://")}function Re(e,t){return function(){var r=e,n=t;return t||(n=o.asm),I(ge,"native function `"+r+"` called before runtime initialization"),I(!ye,"native function `"+r+"` called after runtime exit (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),n[e]||I(n[e],"exported native function `"+r+"` not found"),n[e].apply(null,arguments)}}function Ne(e){try{if(e==Fe&&A)return new Uint8Array(A);if(h)return h(e);throw"both async and sync fetching of the wasm failed"}catch(e){Le(e)}}Me(Fe="face_detection_solution_wasm_bin.wasm")||(De=Fe,Fe=o.locateFile?o.locateFile(De,_):_+De);var je,Ue={472800:function(){let e=!0;if(e){const t=Yr;if("function"!=typeof t)return void("undefined"!=typeof console&&console.error('Expected Emscripten global function "findCanvasEventTarget" not found. WebGL context creation may fail.'));Yr=function(e){if(0==e){if(o&&o.canvas)return o.canvas;if(o&&o.canvasCssSelector)return t(o.canvasCssSelector);"undefined"!=typeof console&&console.warn("Module properties canvas and canvasCssSelector not found during WebGL context creation.")}return t(e)},e=!1}},473585:function(){return"undefined"!=typeof wasmOffsetConverter}};function ze(e,t){if(Ye.mainLoop.timingMode=e,Ye.mainLoop.timingValue=t,!Ye.mainLoop.func)return T("emscripten_set_main_loop_timing: Cannot set timing mode for main loop since a main loop does not exist! Call emscripten_set_main_loop first to set one up."),1;if(Ye.mainLoop.running||(Ye.mainLoop.running=!0),0==e)Ye.mainLoop.scheduler=function(){var e=0|Math.max(0,Ye.mainLoop.tickStartTime+t-je());setTimeout(Ye.mainLoop.runner,e)},Ye.mainLoop.method="timeout";else if(1==e)Ye.mainLoop.scheduler=function(){Ye.requestAnimationFrame(Ye.mainLoop.runner)},Ye.mainLoop.method="rAF";else if(2==e){if("undefined"==typeof setImmediate){var r=[],n="setimmediate";addEventListener("message",function(e){e.data!==n&&e.data.target!==n||(e.stopPropagation(),r.shift()())},!0),setImmediate=function(e){r.push(e),l?(void 0===o.setImmediates&&(o.setImmediates=[]),o.setImmediates.push(e),postMessage({target:n})):postMessage(n,"*")}}Ye.mainLoop.scheduler=function(){setImmediate(Ye.mainLoop.runner)},Ye.mainLoop.method="immediate"}return 0}function Ve(e){!function(e,t){B=e,_e||function(){var e=E,t=T,r=!1;E=T=e=>{r=!0};try{Sn(),["stdout","stderr"].forEach(function(e){var t=dt.analyzePath("/dev/"+e);if(t){var n=t.object.rdev,o=st.ttys[n];o&&o.output&&o.output.length&&(r=!0)}})}catch(e){}E=e,T=t,r&&C("stdio streams had content in them that was not flushed. you should set EXIT_RUNTIME to 1 (see the FAQ), or make sure to emit a newline when you printf etc.")}();if(we()){if(!t){var r="program exited (with status: "+e+"), but EXIT_RUNTIME is not set, so halting execution but not exiting the runtime or preventing further async execution (build with EXIT_RUNTIME=1, if you want a true shutdown)";n(r),T(r)}}else de(),ye=!0;jn(e)}(e)}function We(e){if(e instanceof Rn||"unwind"==e)return B;u(1,e)}function $e(e,t,r,n,i){I(!Ye.mainLoop.func,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),Ye.mainLoop.func=e,Ye.mainLoop.arg=n;var a=Ye.mainLoop.currentlyRunningMainloop;function s(){return!(a<Ye.mainLoop.currentlyRunningMainloop)||(function(){if(!we())try{Ve(B)}catch(e){We(e)}}(),!1)}if(Ye.mainLoop.running=!1,Ye.mainLoop.runner=function(){if(!M)if(Ye.mainLoop.queue.length>0){var t=Date.now(),r=Ye.mainLoop.queue.shift();if(r.func(r.arg),Ye.mainLoop.remainingBlockers){var n=Ye.mainLoop.remainingBlockers,i=n%1==0?n-1:Math.floor(n);r.counted?Ye.mainLoop.remainingBlockers=i:(i+=.5,Ye.mainLoop.remainingBlockers=(8*n+i)/9)}if(E('main loop blocker "'+r.name+'" took '+(Date.now()-t)+" ms"),Ye.mainLoop.updateStatus(),!s())return;setTimeout(Ye.mainLoop.runner,0)}else s()&&(Ye.mainLoop.currentFrameNumber=Ye.mainLoop.currentFrameNumber+1|0,1==Ye.mainLoop.timingMode&&Ye.mainLoop.timingValue>1&&Ye.mainLoop.currentFrameNumber%Ye.mainLoop.timingValue!=0?Ye.mainLoop.scheduler():(0==Ye.mainLoop.timingMode&&(Ye.mainLoop.tickStartTime=je()),Wr.newRenderingFrameStarted(),void 0!==Wr&&Wr.currentContext&&!Wr.currentContextIsProxied&&!Wr.currentContext.attributes.explicitSwapControl&&Wr.currentContext.GLctx.commit&&Wr.currentContext.GLctx.commit(),"timeout"===Ye.mainLoop.method&&o.ctx&&(C("Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!"),Ye.mainLoop.method=""),Ye.mainLoop.runIter(e),de(),s()&&("object"==typeof SDL&&SDL.audio&&SDL.audio.queueNewAudioData&&SDL.audio.queueNewAudioData(),Ye.mainLoop.scheduler())))},i||(t&&t>0?ze(0,1e3/t):ze(1,1),Ye.mainLoop.scheduler()),r)throw"unwind"}function Ge(e,t){if(ye||M)T("user callback triggered after runtime exited or application aborted. Ignoring.");else if(t)e();else try{e()}catch(e){We(e)}}function He(e,t){return setTimeout(function(){Ge(e)},t)}je=f?()=>{var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:()=>performance.now();var Ye={mainLoop:{running:!1,scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:function(){Ye.mainLoop.scheduler=null,Ye.mainLoop.currentlyRunningMainloop++},resume:function(){Ye.mainLoop.currentlyRunningMainloop++;var e=Ye.mainLoop.timingMode,t=Ye.mainLoop.timingValue,r=Ye.mainLoop.func;Ye.mainLoop.func=null,$e(r,0,!1,Ye.mainLoop.arg,!0),ze(e,t),Ye.mainLoop.scheduler()},updateStatus:function(){if(o.setStatus){var e=o.statusMessage||"Please wait...",t=Ye.mainLoop.remainingBlockers,r=Ye.mainLoop.expectedBlockers;t?t<r?o.setStatus(e+" ("+(r-t)+"/"+r+")"):o.setStatus(e):o.setStatus("")}},runIter:function(e){if(!M){if(o.preMainLoop)if(!1===o.preMainLoop())return;Ge(e),o.postMainLoop&&o.postMainLoop()}}},isFullscreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init:function(){if(o.preloadPlugins||(o.preloadPlugins=[]),!Ye.initted){Ye.initted=!0;try{new Blob,Ye.hasBlobConstructor=!0}catch(e){Ye.hasBlobConstructor=!1,E("warning: no blob constructor, cannot create blobs with mimetypes")}Ye.BlobBuilder="undefined"!=typeof MozBlobBuilder?MozBlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:Ye.hasBlobConstructor?null:E("warning: no BlobBuilder"),Ye.URLObject="undefined"!=typeof window?window.URL?window.URL:window.webkitURL:void 0,o.noImageDecoding||void 0!==Ye.URLObject||(E("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available."),o.noImageDecoding=!0);var e={canHandle:function(e){return!o.noImageDecoding&&/\.(jpg|jpeg|png|bmp)$/i.test(e)},handle:function(e,t,r,n){var i=null;if(Ye.hasBlobConstructor)try{(i=new Blob([e],{type:Ye.getMimetype(t)})).size!==e.length&&(i=new Blob([new Uint8Array(e).buffer],{type:Ye.getMimetype(t)}))}catch(e){C("Blob constructor present but fails: "+e+"; falling back to blob builder")}if(!i){var a=new Ye.BlobBuilder;a.append(new Uint8Array(e).buffer),i=a.getBlob()}var s=Ye.URLObject.createObjectURL(i);I("string"==typeof s,"createObjectURL must return a url as a string");var u=new Image;u.onload=()=>{I(u.complete,"Image "+t+" could not be decoded");var n=document.createElement("canvas");n.width=u.width,n.height=u.height,n.getContext("2d").drawImage(u,0,0),o.preloadedImages[t]=n,Ye.URLObject.revokeObjectURL(s),r&&r(e)},u.onerror=e=>{E("Image "+s+" could not be decoded"),n&&n()},u.src=s}};o.preloadPlugins.push(e);var t={canHandle:function(e){return!o.noAudioDecoding&&e.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},handle:function(e,t,r,n){var i=!1;function a(n){i||(i=!0,o.preloadedAudios[t]=n,r&&r(e))}function s(){i||(i=!0,o.preloadedAudios[t]=new Audio,n&&n())}if(!Ye.hasBlobConstructor)return s();try{var u=new Blob([e],{type:Ye.getMimetype(t)})}catch(e){return s()}var c=Ye.URLObject.createObjectURL(u);I("string"==typeof c,"createObjectURL must return a url as a string");var l=new Audio;l.addEventListener("canplaythrough",function(){a(l)},!1),l.onerror=function(r){i||(E("warning: browser could not fully decode audio "+t+", trying slower base64 approach"),l.src="data:audio/x-"+t.substr(-3)+";base64,"+function(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r="",n=0,o=0,i=0;i<e.length;i++)for(n=n<<8|e[i],o+=8;o>=6;){var a=n>>o-6&63;o-=6,r+=t[a]}return 2==o?(r+=t[(3&n)<<4],r+="=="):4==o&&(r+=t[(15&n)<<2],r+="="),r}(e),a(l))},l.src=c,He(function(){a(l)},1e4)}};o.preloadPlugins.push(t);var r=o.canvas;r&&(r.requestPointerLock=r.requestPointerLock||r.mozRequestPointerLock||r.webkitRequestPointerLock||r.msRequestPointerLock||function(){},r.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},r.exitPointerLock=r.exitPointerLock.bind(document),document.addEventListener("pointerlockchange",n,!1),document.addEventListener("mozpointerlockchange",n,!1),document.addEventListener("webkitpointerlockchange",n,!1),document.addEventListener("mspointerlockchange",n,!1),o.elementPointerLock&&r.addEventListener("click",function(e){!Ye.pointerLock&&o.canvas.requestPointerLock&&(o.canvas.requestPointerLock(),e.preventDefault())},!1))}function n(){Ye.pointerLock=document.pointerLockElement===o.canvas||document.mozPointerLockElement===o.canvas||document.webkitPointerLockElement===o.canvas||document.msPointerLockElement===o.canvas}},handledByPreloadPlugin:function(e,t,r,n){Ye.init();var i=!1;return o.preloadPlugins.forEach(function(o){i||o.canHandle(t)&&(o.handle(e,t,r,n),i=!0)}),i},createContext:function(e,t,r,n){if(t&&o.ctx&&e==o.canvas)return o.ctx;var i,a;if(t){var s={antialias:!1,alpha:!1,majorVersion:"undefined"!=typeof WebGL2RenderingContext?2:1};if(n)for(var u in n)s[u]=n[u];void 0!==Wr&&(a=Wr.createContext(e,s))&&(i=Wr.getContext(a).GLctx)}else i=e.getContext("2d");return i?(r&&(t||I(void 0===pn,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),o.ctx=i,t&&Wr.makeContextCurrent(a),o.useWebGL=t,Ye.moduleContextCreatedCallbacks.forEach(function(e){e()}),Ye.init()),i):null},destroyContext:function(e,t,r){},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen:function(e,t){Ye.lockPointer=e,Ye.resizeCanvas=t,void 0===Ye.lockPointer&&(Ye.lockPointer=!0),void 0===Ye.resizeCanvas&&(Ye.resizeCanvas=!1);var r=o.canvas;function n(){Ye.isFullscreen=!1;var e=r.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e?(r.exitFullscreen=Ye.exitFullscreen,Ye.lockPointer&&r.requestPointerLock(),Ye.isFullscreen=!0,Ye.resizeCanvas?Ye.setFullscreenCanvasSize():Ye.updateCanvasDimensions(r)):(e.parentNode.insertBefore(r,e),e.parentNode.removeChild(e),Ye.resizeCanvas?Ye.setWindowedCanvasSize():Ye.updateCanvasDimensions(r)),o.onFullScreen&&o.onFullScreen(Ye.isFullscreen),o.onFullscreen&&o.onFullscreen(Ye.isFullscreen)}Ye.fullscreenHandlersInstalled||(Ye.fullscreenHandlersInstalled=!0,document.addEventListener("fullscreenchange",n,!1),document.addEventListener("mozfullscreenchange",n,!1),document.addEventListener("webkitfullscreenchange",n,!1),document.addEventListener("MSFullscreenChange",n,!1));var i=document.createElement("div");r.parentNode.insertBefore(i,r),i.appendChild(r),i.requestFullscreen=i.requestFullscreen||i.mozRequestFullScreen||i.msRequestFullscreen||(i.webkitRequestFullscreen?function(){i.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}:null)||(i.webkitRequestFullScreen?function(){i.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),i.requestFullscreen()},requestFullScreen:function(){Le("Module.requestFullScreen has been replaced by Module.requestFullscreen (without a capital S)")},exitFullscreen:function(){return!!Ye.isFullscreen&&((document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||function(){}).apply(document,[]),!0)},nextRAF:0,fakeRequestAnimationFrame:function(e){var t=Date.now();if(0===Ye.nextRAF)Ye.nextRAF=t+1e3/60;else for(;t+2>=Ye.nextRAF;)Ye.nextRAF+=1e3/60;var r=Math.max(Ye.nextRAF-t,0);setTimeout(e,r)},requestAnimationFrame:function(e){"function"!=typeof requestAnimationFrame?(0,Ye.fakeRequestAnimationFrame)(e):requestAnimationFrame(e)},safeSetTimeout:function(e){return He(e)},safeRequestAnimationFrame:function(e){return Ye.requestAnimationFrame(function(){Ge(e)})},getMimetype:function(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]},getUserMedia:function(e){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(e)},getMovementX:function(e){return e.movementX||e.mozMovementX||e.webkitMovementX||0},getMovementY:function(e){return e.movementY||e.mozMovementY||e.webkitMovementY||0},getMouseWheelDelta:function(e){var t=0;switch(e.type){case"DOMMouseScroll":t=e.detail/3;break;case"mousewheel":t=e.wheelDelta/120;break;case"wheel":switch(t=e.deltaY,e.deltaMode){case 0:t/=100;break;case 1:t/=3;break;case 2:t*=80;break;default:throw"unrecognized mouse wheel delta mode: "+e.deltaMode}break;default:throw"unrecognized mouse wheel event: "+e.type}return t},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent:function(e){if(Ye.pointerLock)"mousemove"!=e.type&&"mozMovementX"in e?Ye.mouseMovementX=Ye.mouseMovementY=0:(Ye.mouseMovementX=Ye.getMovementX(e),Ye.mouseMovementY=Ye.getMovementY(e)),"undefined"!=typeof SDL?(Ye.mouseX=SDL.mouseX+Ye.mouseMovementX,Ye.mouseY=SDL.mouseY+Ye.mouseMovementY):(Ye.mouseX+=Ye.mouseMovementX,Ye.mouseY+=Ye.mouseMovementY);else{var t=o.canvas.getBoundingClientRect(),r=o.canvas.width,n=o.canvas.height,i=void 0!==window.scrollX?window.scrollX:window.pageXOffset,a=void 0!==window.scrollY?window.scrollY:window.pageYOffset;if(I(void 0!==i&&void 0!==a,"Unable to retrieve scroll position, mouse positions likely broken."),"touchstart"===e.type||"touchend"===e.type||"touchmove"===e.type){var s=e.touch;if(void 0===s)return;var u=s.pageX-(i+t.left),c=s.pageY-(a+t.top),l={x:u*=r/t.width,y:c*=n/t.height};if("touchstart"===e.type)Ye.lastTouches[s.identifier]=l,Ye.touches[s.identifier]=l;else if("touchend"===e.type||"touchmove"===e.type){var f=Ye.touches[s.identifier];f||(f=l),Ye.lastTouches[s.identifier]=f,Ye.touches[s.identifier]=l}return}var d=e.pageX-(i+t.left),m=e.pageY-(a+t.top);d*=r/t.width,m*=n/t.height,Ye.mouseMovementX=d-Ye.mouseX,Ye.mouseMovementY=m-Ye.mouseY,Ye.mouseX=d,Ye.mouseY=m}},resizeListeners:[],updateResizeListeners:function(){var e=o.canvas;Ye.resizeListeners.forEach(function(t){t(e.width,e.height)})},setCanvasSize:function(e,t,r){var n=o.canvas;Ye.updateCanvasDimensions(n,e,t),r||Ye.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize:function(){if("undefined"!=typeof SDL){var e=X[SDL.screen>>2];e|=8388608,q[SDL.screen>>2]=e}Ye.updateCanvasDimensions(o.canvas),Ye.updateResizeListeners()},setWindowedCanvasSize:function(){if("undefined"!=typeof SDL){var e=X[SDL.screen>>2];e&=-8388609,q[SDL.screen>>2]=e}Ye.updateCanvasDimensions(o.canvas),Ye.updateResizeListeners()},updateCanvasDimensions:function(e,t,r){t&&r?(e.widthNative=t,e.heightNative=r):(t=e.widthNative,r=e.heightNative);var n=t,i=r;if(o.forcedAspectRatio&&o.forcedAspectRatio>0&&(n/i<o.forcedAspectRatio?n=Math.round(i*o.forcedAspectRatio):i=Math.round(n/o.forcedAspectRatio)),(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e.parentNode&&"undefined"!=typeof screen){var a=Math.min(screen.width/n,screen.height/i);n=Math.round(n*a),i=Math.round(i*a)}Ye.resizeCanvas?(e.width!=n&&(e.width=n),e.height!=i&&(e.height=i),void 0!==e.style&&(e.style.removeProperty("width"),e.style.removeProperty("height"))):(e.width!=t&&(e.width=t),e.height!=r&&(e.height=r),void 0!==e.style&&(n!=t||i!=r?(e.style.setProperty("width",n+"px","important"),e.style.setProperty("height",i+"px","important")):(e.style.removeProperty("width"),e.style.removeProperty("height"))))}};function qe(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var r=t.func;"number"==typeof r?void 0===t.arg?Ze(r)():Ze(r)(t.arg):r(void 0===t.arg?null:t.arg)}else t(o)}}function Xe(e){return e.replace(/\b_Z[\w\d_]+/g,function(e){var t,r=(t=e,C("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"),t);return e===r?e:r+" ["+e+"]"})}var Ke=[];function Ze(e){var t=Ke[e];return t||(e>=Ke.length&&(Ke.length=e+1),Ke[e]=t=ce.get(e)),I(ce.get(e)==t,"JavaScript-side Wasm function table mirror is out of date!"),t}function Je(e){this.excPtr=e,this.ptr=e-16,this.set_type=function(e){q[this.ptr+4>>2]=e},this.get_type=function(){return q[this.ptr+4>>2]},this.set_destructor=function(e){q[this.ptr+8>>2]=e},this.get_destructor=function(){return q[this.ptr+8>>2]},this.set_refcount=function(e){q[this.ptr>>2]=e},this.set_caught=function(e){e=e?1:0,$[this.ptr+12|0]=e},this.get_caught=function(){return 0!=$[this.ptr+12|0]},this.set_rethrown=function(e){e=e?1:0,$[this.ptr+13|0]=e},this.get_rethrown=function(){return 0!=$[this.ptr+13|0]},this.init=function(e,t){this.set_type(e),this.set_destructor(t),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var e=q[this.ptr>>2];q[this.ptr>>2]=e+1},this.release_ref=function(){var e=q[this.ptr>>2];return q[this.ptr>>2]=e-1,I(e>0),1===e}}function Qe(e){this.free=function(){Cn(this.ptr),this.ptr=0},this.set_base_ptr=function(e){q[this.ptr>>2]=e},this.get_base_ptr=function(){return q[this.ptr>>2]},this.set_adjusted_ptr=function(e){q[this.ptr+4>>2]=e},this.get_adjusted_ptr_addr=function(){return this.ptr+4},this.get_adjusted_ptr=function(){return q[this.ptr+4>>2]},this.get_exception_ptr=function(){if(In(this.get_exception_info().get_type()))return q[this.get_base_ptr()>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.get_base_ptr()},this.get_exception_info=function(){return new Je(this.get_base_ptr())},void 0===e?(this.ptr=xn(8),this.set_adjusted_ptr(0)):this.ptr=e}var et=[];var tt=0;function rt(e){try{return Cn(new Je(e).ptr)}catch(e){T("exception during cxa_free_exception: "+e)}}function nt(e){return q[kn()>>2]=e,e}var ot={splitPath:function(e){return/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1)},normalizeArray:function(e,t){for(var r=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:function(e){var t="/"===e.charAt(0),r="/"===e.substr(-1);return(e=ot.normalizeArray(e.split("/").filter(function(e){return!!e}),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:function(e){var t=ot.splitPath(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:function(e){if("/"===e)return"/";var t=(e=(e=ot.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},extname:function(e){return ot.splitPath(e)[3]},join:function(){var e=Array.prototype.slice.call(arguments,0);return ot.normalize(e.join("/"))},join2:function(e,t){return ot.normalize(e+"/"+t)}};function it(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return function(){return crypto.getRandomValues(e),e[0]}}if(f)try{var t=require("crypto");return function(){return t.randomBytes(1)[0]}}catch(e){}return function(){Le("no cryptographic support found for randomDevice. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: function(array) { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };")}}var at={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:dt.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,t="/"===n.charAt(0)}return(t?"/":"")+(e=ot.normalizeArray(e.split("/").filter(function(e){return!!e}),!t).join("/"))||"."},relative:function(e,t){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=at.resolve(e).substr(1),t=at.resolve(t).substr(1);for(var n=r(e.split("/")),o=r(t.split("/")),i=Math.min(n.length,o.length),a=i,s=0;s<i;s++)if(n[s]!==o[s]){a=s;break}var u=[];for(s=a;s<n.length;s++)u.push("..");return(u=u.concat(o.slice(a))).join("/")}},st={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){st.ttys[e]={input:[],output:[],ops:t},dt.registerDevice(e,st.stream_ops)},stream_ops:{open:function(e){var t=st.ttys[e.node.rdev];if(!t)throw new dt.ErrnoError(43);e.tty=t,e.seekable=!1},close:function(e){e.tty.ops.flush(e.tty)},flush:function(e){e.tty.ops.flush(e.tty)},read:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.get_char)throw new dt.ErrnoError(60);for(var i=0,a=0;a<n;a++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new dt.ErrnoError(29)}if(void 0===s&&0===i)throw new dt.ErrnoError(6);if(null==s)break;i++,t[r+a]=s}return i&&(e.node.timestamp=Date.now()),i},write:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.put_char)throw new dt.ErrnoError(60);try{for(var i=0;i<n;i++)e.tty.ops.put_char(e.tty,t[r+i])}catch(e){throw new dt.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(e){if(!e.input.length){var t=null;if(f){var r=Buffer.alloc(256),n=0;try{n=v.readSync(process.stdin.fd,r,0,256,-1)}catch(e){if(!e.toString().includes("EOF"))throw e;n=0}t=n>0?r.slice(0,n).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n");if(!t)return null;e.input=bn(t,!0)}return e.input.shift()},put_char:function(e,t){null===t||10===t?(E(N(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(E(N(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(T(N(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(T(N(e.output,0)),e.output=[])}}};function ut(e){e=function(e,t){return I(t,"alignment argument is required"),Math.ceil(e/t)*t}(e,65536);var t=An(65536,e);return t?(function(e,t){G.fill(0,e,e+t)}(t,e),t):0}var ct={ops_table:null,mount:function(e){return ct.createNode(null,"/",16895,0)},createNode:function(e,t,r,n){if(dt.isBlkdev(r)||dt.isFIFO(r))throw new dt.ErrnoError(63);ct.ops_table||(ct.ops_table={dir:{node:{getattr:ct.node_ops.getattr,setattr:ct.node_ops.setattr,lookup:ct.node_ops.lookup,mknod:ct.node_ops.mknod,rename:ct.node_ops.rename,unlink:ct.node_ops.unlink,rmdir:ct.node_ops.rmdir,readdir:ct.node_ops.readdir,symlink:ct.node_ops.symlink},stream:{llseek:ct.stream_ops.llseek}},file:{node:{getattr:ct.node_ops.getattr,setattr:ct.node_ops.setattr},stream:{llseek:ct.stream_ops.llseek,read:ct.stream_ops.read,write:ct.stream_ops.write,allocate:ct.stream_ops.allocate,mmap:ct.stream_ops.mmap,msync:ct.stream_ops.msync}},link:{node:{getattr:ct.node_ops.getattr,setattr:ct.node_ops.setattr,readlink:ct.node_ops.readlink},stream:{}},chrdev:{node:{getattr:ct.node_ops.getattr,setattr:ct.node_ops.setattr},stream:dt.chrdev_stream_ops}});var o=dt.createNode(e,t,r,n);return dt.isDir(o.mode)?(o.node_ops=ct.ops_table.dir.node,o.stream_ops=ct.ops_table.dir.stream,o.contents={}):dt.isFile(o.mode)?(o.node_ops=ct.ops_table.file.node,o.stream_ops=ct.ops_table.file.stream,o.usedBytes=0,o.contents=null):dt.isLink(o.mode)?(o.node_ops=ct.ops_table.link.node,o.stream_ops=ct.ops_table.link.stream):dt.isChrdev(o.mode)&&(o.node_ops=ct.ops_table.chrdev.node,o.stream_ops=ct.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[t]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage:function(e,t){var r=e.contents?e.contents.length:0;if(!(r>=t)){t=Math.max(t,r*(r<1048576?2:1.125)>>>0),0!=r&&(t=Math.max(t,256));var n=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage:function(e,t){if(e.usedBytes!=t)if(0==t)e.contents=null,e.usedBytes=0;else{var r=e.contents;e.contents=new Uint8Array(t),r&&e.contents.set(r.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr:function(e){var t={};return t.dev=dt.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,dt.isDir(e.mode)?t.size=4096:dt.isFile(e.mode)?t.size=e.usedBytes:dt.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr:function(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&ct.resizeFileStorage(e,t.size)},lookup:function(e,t){throw dt.genericErrors[44]},mknod:function(e,t,r,n){return ct.createNode(e,t,r,n)},rename:function(e,t,r){if(dt.isDir(e.mode)){var n;try{n=dt.lookupNode(t,r)}catch(e){}if(n)for(var o in n.contents)throw new dt.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=r,t.contents[r]=e,t.timestamp=e.parent.timestamp,e.parent=t},unlink:function(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir:function(e,t){var r=dt.lookupNode(e,t);for(var n in r.contents)throw new dt.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir:function(e){var t=[".",".."];for(var r in e.contents)e.contents.hasOwnProperty(r)&&t.push(r);return t},symlink:function(e,t,r){var n=ct.createNode(e,t,41471,0);return n.link=r,n},readlink:function(e){if(!dt.isLink(e.mode))throw new dt.ErrnoError(28);return e.link}},stream_ops:{read:function(e,t,r,n,o){var i=e.node.contents;if(o>=e.node.usedBytes)return 0;var a=Math.min(e.node.usedBytes-o,n);if(I(a>=0),a>8&&i.subarray)t.set(i.subarray(o,o+a),r);else for(var s=0;s<a;s++)t[r+s]=i[o+s];return a},write:function(e,t,r,n,o,i){if(I(!(t instanceof ArrayBuffer)),t.buffer===$.buffer&&(i=!1),!n)return 0;var a=e.node;if(a.timestamp=Date.now(),t.subarray&&(!a.contents||a.contents.subarray)){if(i)return I(0===o,"canOwn must imply no weird position inside the file"),a.contents=t.subarray(r,r+n),a.usedBytes=n,n;if(0===a.usedBytes&&0===o)return a.contents=t.slice(r,r+n),a.usedBytes=n,n;if(o+n<=a.usedBytes)return a.contents.set(t.subarray(r,r+n),o),n}if(ct.expandFileStorage(a,o+n),a.contents.subarray&&t.subarray)a.contents.set(t.subarray(r,r+n),o);else for(var s=0;s<n;s++)a.contents[o+s]=t[r+s];return a.usedBytes=Math.max(a.usedBytes,o+n),n},llseek:function(e,t,r){var n=t;if(1===r?n+=e.position:2===r&&dt.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new dt.ErrnoError(28);return n},allocate:function(e,t,r){ct.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap:function(e,t,r,n,o,i){if(0!==t)throw new dt.ErrnoError(28);if(!dt.isFile(e.node.mode))throw new dt.ErrnoError(43);var a,s,u=e.node.contents;if(2&i||u.buffer!==W){if((n>0||n+r<u.length)&&(u=u.subarray?u.subarray(n,n+r):Array.prototype.slice.call(u,n,n+r)),s=!0,!(a=ut(r)))throw new dt.ErrnoError(48);$.set(u,a)}else s=!1,a=u.byteOffset;return{ptr:a,allocated:s}},msync:function(e,t,r,n,o){if(!dt.isFile(e.node.mode))throw new dt.ErrnoError(43);if(2&o)return 0;ct.stream_ops.write(e,t,0,n,r,!1);return 0}}};var lt={0:"Success",1:"Arg list too long",2:"Permission denied",3:"Address already in use",4:"Address not available",5:"Address family not supported by protocol family",6:"No more processes",7:"Socket already connected",8:"Bad file number",9:"Trying to read unreadable message",10:"Mount device busy",11:"Operation canceled",12:"No children",13:"Connection aborted",14:"Connection refused",15:"Connection reset by peer",16:"File locking deadlock error",17:"Destination address required",18:"Math arg out of domain of func",19:"Quota exceeded",20:"File exists",21:"Bad address",22:"File too large",23:"Host is unreachable",24:"Identifier removed",25:"Illegal byte sequence",26:"Connection already in progress",27:"Interrupted system call",28:"Invalid argument",29:"I/O error",30:"Socket is already connected",31:"Is a directory",32:"Too many symbolic links",33:"Too many open files",34:"Too many links",35:"Message too long",36:"Multihop attempted",37:"File or path name too long",38:"Network interface is not configured",39:"Connection reset by network",40:"Network is unreachable",41:"Too many open files in system",42:"No buffer space available",43:"No such device",44:"No such file or directory",45:"Exec format error",46:"No record locks available",47:"The link has been severed",48:"Not enough core",49:"No message of desired type",50:"Protocol not available",51:"No space left on device",52:"Function not implemented",53:"Socket is not connected",54:"Not a directory",55:"Directory not empty",56:"State not recoverable",57:"Socket operation on non-socket",59:"Not a typewriter",60:"No such device or address",61:"Value too large for defined data type",62:"Previous owner died",63:"Not super-user",64:"Broken pipe",65:"Protocol error",66:"Unknown protocol",67:"Protocol wrong type for socket",68:"Math result not representable",69:"Read only file system",70:"Illegal seek",71:"No such process",72:"Stale file handle",73:"Connection timed out",74:"Text file busy",75:"Cross-device link",100:"Device not a stream",101:"Bad font file fmt",102:"Invalid slot",103:"Invalid request code",104:"No anode",105:"Block device required",106:"Channel number out of range",107:"Level 3 halted",108:"Level 3 reset",109:"Link number out of range",110:"Protocol driver not attached",111:"No CSI structure available",112:"Level 2 halted",113:"Invalid exchange",114:"Invalid request descriptor",115:"Exchange full",116:"No data (for no delay io)",117:"Timer expired",118:"Out of streams resources",119:"Machine is not on the network",120:"Package not installed",121:"The object is remote",122:"Advertise error",123:"Srmount error",124:"Communication error on send",125:"Cross mount point (not really error)",126:"Given log. name not unique",127:"f.d. invalid for this operation",128:"Remote address changed",129:"Can access a needed shared lib",130:"Accessing a corrupted shared lib",131:".lib section in a.out corrupted",132:"Attempting to link in too many libs",133:"Attempting to exec a shared library",135:"Streams pipe error",136:"Too many users",137:"Socket type not supported",138:"Not supported",139:"Protocol family not supported",140:"Can't send after socket shutdown",141:"Too many references",142:"Host is down",148:"No medium (in tape drive)",156:"Level 2 not synchronized"},ft={},dt={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(e,t={})=>{if(!(e=at.resolve(dt.cwd(),e)))return{path:"",node:null};var r={follow_mount:!0,recurse_count:0};for(var n in r)void 0===t[n]&&(t[n]=r[n]);if(t.recurse_count>8)throw new dt.ErrnoError(32);for(var o=ot.normalizeArray(e.split("/").filter(e=>!!e),!1),i=dt.root,a="/",s=0;s<o.length;s++){var u=s===o.length-1;if(u&&t.parent)break;if(i=dt.lookupNode(i,o[s]),a=ot.join2(a,o[s]),dt.isMountpoint(i)&&(!u||u&&t.follow_mount)&&(i=i.mounted.root),!u||t.follow)for(var c=0;dt.isLink(i.mode);){var l=dt.readlink(a);if(a=at.resolve(ot.dirname(a),l),i=dt.lookupPath(a,{recurse_count:t.recurse_count}).node,c++>40)throw new dt.ErrnoError(32)}}return{path:a,node:i}},getPath:e=>{for(var t;;){if(dt.isRoot(e)){var r=e.mount.mountpoint;return t?"/"!==r[r.length-1]?r+"/"+t:r+t:r}t=t?e.name+"/"+t:e.name,e=e.parent}},hashName:(e,t)=>{for(var r=0,n=0;n<t.length;n++)r=(r<<5)-r+t.charCodeAt(n)|0;return(e+r>>>0)%dt.nameTable.length},hashAddNode:e=>{var t=dt.hashName(e.parent.id,e.name);e.name_next=dt.nameTable[t],dt.nameTable[t]=e},hashRemoveNode:e=>{var t=dt.hashName(e.parent.id,e.name);if(dt.nameTable[t]===e)dt.nameTable[t]=e.name_next;else for(var r=dt.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode:(e,t)=>{var r=dt.mayLookup(e);if(r)throw new dt.ErrnoError(r,e);for(var n=dt.hashName(e.id,t),o=dt.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===t)return o}return dt.lookup(e,t)},createNode:(e,t,r,n)=>{I("object"==typeof e);var o=new dt.FSNode(e,t,r,n);return dt.hashAddNode(o),o},destroyNode:e=>{dt.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>!(49152&~e),flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:e=>{var t=dt.flagModes[e];if(void 0===t)throw new Error("Unknown file open mode: "+e);return t},flagsToPermissionString:e=>{var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:(e,t)=>dt.ignorePermissions||(!t.includes("r")||292&e.mode)&&(!t.includes("w")||146&e.mode)&&(!t.includes("x")||73&e.mode)?0:2,mayLookup:e=>{var t=dt.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate:(e,t)=>{try{dt.lookupNode(e,t);return 20}catch(e){}return dt.nodePermissions(e,"wx")},mayDelete:(e,t,r)=>{var n;try{n=dt.lookupNode(e,t)}catch(e){return e.errno}var o=dt.nodePermissions(e,"wx");if(o)return o;if(r){if(!dt.isDir(n.mode))return 54;if(dt.isRo