trtc-sdk-v5 5.6.0-beta.9 → 5.6.0

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtc-plugin/beauty",
3
- "version": "5.5.2",
3
+ "version": "5.6.0",
4
4
  "description": "TRTC Web SDK 5.x beauty plugin",
5
5
  "main": "./beauty.esm.js",
6
6
  "author": "longyuqi <longyuqi@tencent.com>",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtc-plugin/virtual-background",
3
- "version": "5.5.2",
3
+ "version": "5.6.0",
4
4
  "description": "TRTC Web SDK 5.x virtual background plugin",
5
5
  "main": "./virtual-background.esm.js",
6
6
  "author": "longyuqi <longyuqi@tencent.com>",
@@ -1,4 +1,4 @@
1
- var lc=Object.defineProperty,uc=Object.defineProperties;var dc=Object.getOwnPropertyDescriptors;var Ai=Object.getOwnPropertySymbols;var fc=Object.prototype.hasOwnProperty,Ec=Object.prototype.propertyIsEnumerable;var vo=(Z,M,n)=>M in Z?lc(Z,M,{enumerable:!0,configurable:!0,writable:!0,value:n}):Z[M]=n,si=(Z,M)=>{for(var n in M||(M={}))fc.call(M,n)&&vo(Z,n,M[n]);if(Ai)for(var n of Ai(M))Ec.call(M,n)&&vo(Z,n,M[n]);return Z},ai=(Z,M)=>uc(Z,dc(M));var Ic=(Z=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(Z,{get:(M,n)=>(typeof require!="undefined"?require:M)[n]}):Z)(function(Z){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+Z+'" is not supported')});var ye=(Z,M,n)=>(vo(Z,typeof M!="symbol"?M+"":M,n),n);async function ci({sdkAppId:Z,userId:M,userSig:n,core:oe}){var De;let he=oe.utils.getAbilityConfigUrl(Z),Be=Math.round(new Date().getTime()/1e3),fe=`${he}?sdkAppId=${Z}&userId=${M}&userSig=${n}&timestamp=${Be}`;try{let ke=await(await fetch(fe)).json();oe.log.info(`virtual background send ${fe}, response: ${JSON.stringify(ke)}`);let{data:Oe}=ke;return(De=Oe==null?void 0:Oe.trtcAutoConf)!=null&&De.web_ar?{auth:!0,timestamp:Be}:{auth:!1}}catch(ve){return oe.log.error("beauty fetch error",ve),{auth:!1}}}var pc={sdkAppId:{required:!0,type:"number"},userId:{required:!0,type:"string"},userSig:{required:!0,type:"string"}};function gi(Z){return{name:"VirtualBackgroundOptions",type:"object",required:!0,allowEmpty:!1,properties:ai(si({},pc),{type:{required:!1,type:"string",values:["image","blur"]},src:{required:!1,type:"string"},onError:{required:!1}}),validate(M,n,oe,he){var Ee;let{RtcError:Be,ErrorCode:fe,ErrorCodeDictionary:De}=Z.errorModule;if(!M)return;let{type:ve,src:ke,onError:Oe}=M;if(ve==="image"&&!ke)throw new Be({code:fe.INVALID_PARAMETER,extraCode:De.INVALID_PARAMETER_REQUIRED,fnName:oe,messageParams:{key:"src"}});if(Oe&&!Z.utils.isFunction(Oe))throw new Be({code:fe.INVALID_PARAMETER,extraCode:De.INVALID_PARAMETER_TYPE,fnName:oe,messageParams:{key:"onError",value:typeof Oe,rule:{type:"Function"}}});if(!((Ee=Z.room.videoManager.cameraTrack)!=null&&Ee.mediaTrack))throw new Be({code:fe.INVALID_OPERATION,extraCode:De.INVALID_OPERATION_NEED_VIDEO,fnName:oe});if(Z.utils.env.CHROME_MAJOR_VERSION<90)throw new Be({code:fe.ENV_NOT_SUPPORTED,extraCode:De.NOT_SUPPORTED_CHROME_VERSION,fnName:oe})}}}function li(Z){return{name:"UpdateVirtualBackgroundOptions",type:"object",required:!0,allowEmpty:!1,properties:{type:{required:!0,type:"string",values:["image","blur"]},src:{required:!1,type:"string"}},validate(M,n,oe,he){if(!M)return;let{RtcError:Be,ErrorCode:fe,ErrorCodeDictionary:De}=Z.errorModule,{type:ve,src:ke}=M;if(ve==="image"&&!ke)throw new Be({code:fe.INVALID_PARAMETER,extraCode:De.INVALID_PARAMETER_REQUIRED,fnName:oe,messageParams:{key:"src"}})}}}function ui(Z){return{name:"StopVirtualBackgroundOptions",required:!1}}var Cc=function(){let Z=typeof document!="undefined"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename!="undefined"&&(Z=Z||__filename),function(M){M=M||{};let n=typeof M!="undefined"?M:{},oe,he;n.ready=new Promise((e,t)=>{oe=e,he=t}),Object.getOwnPropertyDescriptor(n.ready,"_main")||(Object.defineProperty(n.ready,"_main",{configurable:!0,get(){l("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(n.ready,"_main",{configurable:!0,set(){l("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(n.ready,"_emscripten_stack_get_end")||(Object.defineProperty(n.ready,"_emscripten_stack_get_end",{configurable:!0,get(){l("You are getting _emscripten_stack_get_end 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(n.ready,"_emscripten_stack_get_end",{configurable:!0,set(){l("You are setting _emscripten_stack_get_end 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(n.ready,"_emscripten_stack_get_free")||(Object.defineProperty(n.ready,"_emscripten_stack_get_free",{configurable:!0,get(){l("You are getting _emscripten_stack_get_free 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(n.ready,"_emscripten_stack_get_free",{configurable:!0,set(){l("You are setting _emscripten_stack_get_free 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(n.ready,"_emscripten_stack_init")||(Object.defineProperty(n.ready,"_emscripten_stack_init",{configurable:!0,get(){l("You are getting _emscripten_stack_init 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(n.ready,"_emscripten_stack_init",{configurable:!0,set(){l("You are setting _emscripten_stack_init 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(n.ready,"_stackSave")||(Object.defineProperty(n.ready,"_stackSave",{configurable:!0,get(){l("You are getting _stackSave 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(n.ready,"_stackSave",{configurable:!0,set(){l("You are setting _stackSave 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(n.ready,"_stackRestore")||(Object.defineProperty(n.ready,"_stackRestore",{configurable:!0,get(){l("You are getting _stackRestore 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(n.ready,"_stackRestore",{configurable:!0,set(){l("You are setting _stackRestore 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(n.ready,"_stackAlloc")||(Object.defineProperty(n.ready,"_stackAlloc",{configurable:!0,get(){l("You are getting _stackAlloc 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(n.ready,"_stackAlloc",{configurable:!0,set(){l("You are setting _stackAlloc 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(n.ready,"___wasm_call_ctors")||(Object.defineProperty(n.ready,"___wasm_call_ctors",{configurable:!0,get(){l("You are getting ___wasm_call_ctors 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(n.ready,"___wasm_call_ctors",{configurable:!0,set(){l("You are setting ___wasm_call_ctors 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(n.ready,"_fflush")||(Object.defineProperty(n.ready,"_fflush",{configurable:!0,get(){l("You are getting _fflush 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(n.ready,"_fflush",{configurable:!0,set(){l("You are setting _fflush 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(n.ready,"___errno_location")||(Object.defineProperty(n.ready,"___errno_location",{configurable:!0,get(){l("You are getting ___errno_location 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(n.ready,"___errno_location",{configurable:!0,set(){l("You are setting ___errno_location 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(n.ready,"_malloc")||(Object.defineProperty(n.ready,"_malloc",{configurable:!0,get(){l("You are getting _malloc 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(n.ready,"_malloc",{configurable:!0,set(){l("You are setting _malloc 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(n.ready,"_free")||(Object.defineProperty(n.ready,"_free",{configurable:!0,get(){l("You are getting _free 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(n.ready,"_free",{configurable:!0,set(){l("You are setting _free 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(n.ready,"_setThrew")||(Object.defineProperty(n.ready,"_setThrew",{configurable:!0,get(){l("You are getting _setThrew 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(n.ready,"_setThrew",{configurable:!0,set(){l("You are setting _setThrew 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(n.ready,"___cxa_is_pointer_type")||(Object.defineProperty(n.ready,"___cxa_is_pointer_type",{configurable:!0,get(){l("You are getting ___cxa_is_pointer_type 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(n.ready,"___cxa_is_pointer_type",{configurable:!0,set(){l("You are setting ___cxa_is_pointer_type 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(n.ready,"___cxa_can_catch")||(Object.defineProperty(n.ready,"___cxa_can_catch",{configurable:!0,get(){l("You are getting ___cxa_can_catch 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(n.ready,"___cxa_can_catch",{configurable:!0,set(){l("You are setting ___cxa_can_catch 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(n.ready,"_saveSetjmp")||(Object.defineProperty(n.ready,"_saveSetjmp",{configurable:!0,get(){l("You are getting _saveSetjmp 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(n.ready,"_saveSetjmp",{configurable:!0,set(){l("You are setting _saveSetjmp 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(n.ready,"_memalign")||(Object.defineProperty(n.ready,"_memalign",{configurable:!0,get(){l("You are getting _memalign 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(n.ready,"_memalign",{configurable:!0,set(){l("You are setting _memalign 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(n.ready,"_emscripten_main_thread_process_queued_calls")||(Object.defineProperty(n.ready,"_emscripten_main_thread_process_queued_calls",{configurable:!0,get(){l("You are getting _emscripten_main_thread_process_queued_calls 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(n.ready,"_emscripten_main_thread_process_queued_calls",{configurable:!0,set(){l("You are setting _emscripten_main_thread_process_queued_calls 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(n.ready,"_emscripten_webgl_make_context_current")||(Object.defineProperty(n.ready,"_emscripten_webgl_make_context_current",{configurable:!0,get(){l("You are getting _emscripten_webgl_make_context_current 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(n.ready,"_emscripten_webgl_make_context_current",{configurable:!0,set(){l("You are setting _emscripten_webgl_make_context_current 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(n.ready,"_emscripten_webgl_get_current_context")||(Object.defineProperty(n.ready,"_emscripten_webgl_get_current_context",{configurable:!0,get(){l("You are getting _emscripten_webgl_get_current_context 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(n.ready,"_emscripten_webgl_get_current_context",{configurable:!0,set(){l("You are setting _emscripten_webgl_get_current_context 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(n.ready,"__get_tzname")||(Object.defineProperty(n.ready,"__get_tzname",{configurable:!0,get(){l("You are getting __get_tzname 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(n.ready,"__get_tzname",{configurable:!0,set(){l("You are setting __get_tzname 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(n.ready,"__get_daylight")||(Object.defineProperty(n.ready,"__get_daylight",{configurable:!0,get(){l("You are getting __get_daylight 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(n.ready,"__get_daylight",{configurable:!0,set(){l("You are setting __get_daylight 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(n.ready,"__get_timezone")||(Object.defineProperty(n.ready,"__get_timezone",{configurable:!0,get(){l("You are getting __get_timezone 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(n.ready,"__get_timezone",{configurable:!0,set(){l("You are setting __get_timezone 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(n.ready,"_emscripten_builtin_malloc")||(Object.defineProperty(n.ready,"_emscripten_builtin_malloc",{configurable:!0,get(){l("You are getting _emscripten_builtin_malloc 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(n.ready,"_emscripten_builtin_malloc",{configurable:!0,set(){l("You are setting _emscripten_builtin_malloc 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(n.ready,"_emscripten_builtin_free")||(Object.defineProperty(n.ready,"_emscripten_builtin_free",{configurable:!0,get(){l("You are getting _emscripten_builtin_free 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(n.ready,"_emscripten_builtin_free",{configurable:!0,set(){l("You are setting _emscripten_builtin_free 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(n.ready,"_emscripten_builtin_memalign")||(Object.defineProperty(n.ready,"_emscripten_builtin_memalign",{configurable:!0,get(){l("You are getting _emscripten_builtin_memalign 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(n.ready,"_emscripten_builtin_memalign",{configurable:!0,set(){l("You are setting _emscripten_builtin_memalign 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(n.ready,"___getTypeName")||(Object.defineProperty(n.ready,"___getTypeName",{configurable:!0,get(){l("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(n.ready,"___getTypeName",{configurable:!0,set(){l("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(n.ready,"___embind_register_native_and_builtin_types")||(Object.defineProperty(n.ready,"___embind_register_native_and_builtin_types",{configurable:!0,get(){l("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(n.ready,"___embind_register_native_and_builtin_types",{configurable:!0,set(){l("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(n.ready,"onRuntimeInitialized")||(Object.defineProperty(n.ready,"onRuntimeInitialized",{configurable:!0,get(){l("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(n.ready,"onRuntimeInitialized",{configurable:!0,set(){l("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")}}));let Be={},fe;for(fe in n)n.hasOwnProperty(fe)&&(Be[fe]=n[fe]);let De=[],ve="./this.program",ke=function(e,t){throw t},Oe=typeof window=="object",Ee=typeof importScripts=="function",Bt=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",Un=!Oe&&!Bt&&!Ee;if(n.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)");let je="";function ar(e){return n.locateFile?n.locateFile(e,je):je+e}let cr,gr,St,$t,No,xn;if(Oe||Ee){if(Ee?je=self.location.href:typeof document!="undefined"&&document.currentScript&&(je=document.currentScript.src),Z&&(je=Z),je.indexOf("blob:")!==0?je=je.substr(0,je.lastIndexOf("/")+1):je="",!(typeof window=="object"||typeof importScripts=="function"))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?)");cr=function(e){let t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},Ee&&(St=function(e){let t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),gr=function(e,t,r){let o=new XMLHttpRequest;o.open("GET",e,!0),o.responseType="arraybuffer",o.onload=function(){if(o.status==200||o.status==0&&o.response){t(o.response);return}r()},o.onerror=r,o.send(null)},$t=function(e){document.title=e}}else throw new Error("environment detection error");let se=n.print||console.log.bind(console),K=n.printErr||console.warn.bind(console);for(fe in Be)Be.hasOwnProperty(fe)&&(n[fe]=Be[fe]);Be=null,n.arguments&&(De=n.arguments),Object.getOwnPropertyDescriptor(n,"arguments")||Object.defineProperty(n,"arguments",{configurable:!0,get(){l("Module.arguments has been replaced with plain arguments_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),n.thisProgram&&(ve=n.thisProgram),Object.getOwnPropertyDescriptor(n,"thisProgram")||Object.defineProperty(n,"thisProgram",{configurable:!0,get(){l("Module.thisProgram has been replaced with plain thisProgram (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),n.quit&&(ke=n.quit),Object.getOwnPropertyDescriptor(n,"quit")||Object.defineProperty(n,"quit",{configurable:!0,get(){l("Module.quit has been replaced with plain quit_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),P(typeof n.memoryInitializerPrefixURL=="undefined","Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),P(typeof n.pthreadMainPrefixURL=="undefined","Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),P(typeof n.cdInitializerPrefixURL=="undefined","Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),P(typeof n.filePackagePrefixURL=="undefined","Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),P(typeof n.read=="undefined","Module.read option was removed (modify read_ in JS)"),P(typeof n.readAsync=="undefined","Module.readAsync option was removed (modify readAsync in JS)"),P(typeof n.readBinary=="undefined","Module.readBinary option was removed (modify readBinary in JS)"),P(typeof n.setWindowTitle=="undefined","Module.setWindowTitle option was removed (modify setWindowTitle in JS)"),P(typeof n.TOTAL_MEMORY=="undefined","Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),Object.getOwnPropertyDescriptor(n,"read")||Object.defineProperty(n,"read",{configurable:!0,get(){l("Module.read has been replaced with plain read_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),Object.getOwnPropertyDescriptor(n,"readAsync")||Object.defineProperty(n,"readAsync",{configurable:!0,get(){l("Module.readAsync has been replaced with plain readAsync (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),Object.getOwnPropertyDescriptor(n,"readBinary")||Object.defineProperty(n,"readBinary",{configurable:!0,get(){l("Module.readBinary has been replaced with plain readBinary (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),Object.getOwnPropertyDescriptor(n,"setWindowTitle")||Object.defineProperty(n,"setWindowTitle",{configurable:!0,get(){l("Module.setWindowTitle has been replaced with plain setWindowTitle (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),P(!Un,"shell environment detected but not enabled at build time. Add 'shell' to `-s ENVIRONMENT` to enable.");function Re(e){Re.shown||(Re.shown={}),Re.shown[e]||(Re.shown[e]=1,K(e))}function ct(e,t){if(typeof WebAssembly.Function=="function"){let C={i:"i32",j:"i64",f:"f32",d:"f64"},h={parameters:[],results:t[0]=="v"?[]:[C[t[0]]]};for(var r=1;r<t.length;++r)h.parameters.push(C[t[r]]);return new WebAssembly.Function(h,e)}let o=[1,0,1,96],i=t.slice(0,1),A=t.slice(1),s={i:127,j:126,f:125,d:124};o.push(A.length);for(var r=0;r<A.length;++r)o.push(s[A[r]]);i=="v"?o.push(0):o=o.concat([1,s[i]]),o[1]=o.length-2;let c=new Uint8Array([0,97,115,109,1,0,0,0].concat(o,[2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0])),d=new WebAssembly.Module(c);return new WebAssembly.Instance(d,{e:{f:e}}).exports.f}let be=[],Ne;function Vt(){if(be.length)return be.pop();try{F.grow(1)}catch(e){throw e instanceof RangeError?"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.":e}return F.length-1}function mt(e,t){if(!Ne){Ne=new WeakMap;for(let o=0;o<F.length;o++){let i=F.get(o);i&&Ne.set(i,o)}}if(Ne.has(e))return Ne.get(e);let r=Vt();try{F.set(r,e)}catch(o){if(!(o instanceof TypeError))throw o;P(typeof t!="undefined",`Missing signature argument to addFunction: ${e}`);let i=ct(e,t);F.set(r,i)}return Ne.set(e,r),r}let le=0,He=function(e){le=e},Ur=function(){return le},Ft;n.wasmBinary&&(Ft=n.wasmBinary),Object.getOwnPropertyDescriptor(n,"wasmBinary")||Object.defineProperty(n,"wasmBinary",{configurable:!0,get(){l("Module.wasmBinary has been replaced with plain wasmBinary (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}});let xr=n.noExitRuntime||!0;Object.getOwnPropertyDescriptor(n,"noExitRuntime")||Object.defineProperty(n,"noExitRuntime",{configurable:!0,get(){l("Module.noExitRuntime has been replaced with plain noExitRuntime (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),typeof WebAssembly!="object"&&l("no native wasm support detected");let _t,$e=!1,vt;function P(e,t){e||l(`Assertion failed: ${t}`)}function Ln(e){let t=n[`_${e}`];return P(t,`Cannot call unknown function ${e}, make sure it is exported`),t}function Uo(e,t,r,o,i){let A={string(h){let y=0;if(h!=null&&h!==0){let T=(h.length<<2)+1;y=ri(T),Qt(h,y,T)}return y},array(h){let y=ri(h.length);return Yr(h,y),y}};function s(h){return t==="string"?Pe(h):t==="boolean"?!!h:h}let c=Ln(e),d=[],E=0;if(P(t!=="array",'Return type should not be "array".'),o)for(let h=0;h<o.length;h++){let y=A[r[h]];y?(E===0&&(E=L()),d[h]=y(o[h])):d[h]=o[h]}let I=c.apply(null,d);function C(h){return E!==0&&j(E),s(h)}return I=C(I),I}let xo=1,Lr=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):void 0;function yt(e,t,r){let o=t+r,i=t;for(;e[i]&&!(i>=o);)++i;if(i-t>16&&e.subarray&&Lr)return Lr.decode(e.subarray(t,i));let A="";for(;t<i;){let s=e[t++];if(!(s&128)){A+=String.fromCharCode(s);continue}let c=e[t++]&63;if((s&224)==192){A+=String.fromCharCode((s&31)<<6|c);continue}let d=e[t++]&63;if((s&240)==224?s=(s&15)<<12|c<<6|d:((s&248)!=240&&Re(`Invalid UTF-8 leading byte 0x${s.toString(16)} encountered when deserializing a UTF-8 string in wasm memory to a JS string!`),s=(s&7)<<18|c<<12|d<<6|e[t++]&63),s<65536)A+=String.fromCharCode(s);else{let E=s-65536;A+=String.fromCharCode(55296|E>>10,56320|E&1023)}}return A}function Pe(e,t){return e?yt(ce,e,t):""}function Ge(e,t,r,o){if(!(o>0))return 0;let i=r,A=r+o-1;for(let s=0;s<e.length;++s){let c=e.charCodeAt(s);if(c>=55296&&c<=57343){let d=e.charCodeAt(++s);c=65536+((c&1023)<<10)|d&1023}if(c<=127){if(r>=A)break;t[r++]=c}else if(c<=2047){if(r+1>=A)break;t[r++]=192|c>>6,t[r++]=128|c&63}else if(c<=65535){if(r+2>=A)break;t[r++]=224|c>>12,t[r++]=128|c>>6&63,t[r++]=128|c&63}else{if(r+3>=A)break;c>=2097152&&Re(`Invalid Unicode code point 0x${c.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-0x1FFFFF).`),t[r++]=240|c>>18,t[r++]=128|c>>12&63,t[r++]=128|c>>6&63,t[r++]=128|c&63}}return t[r]=0,r-i}function Qt(e,t,r){return P(typeof r=="number","stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),Ge(e,ce,t,r)}function Ye(e){let t=0;for(let r=0;r<e.length;++r){let o=e.charCodeAt(r);o>=55296&&o<=57343&&(o=65536+((o&1023)<<10)|e.charCodeAt(++r)&1023),o<=127?++t:o<=2047?t+=2:o<=65535?t+=3:t+=4}return t}let jr=typeof TextDecoder!="undefined"?new TextDecoder("utf-16le"):void 0;function jn(e,t){P(e%2==0,"Pointer passed to UTF16ToString must be aligned to two bytes!");let r=e,o=r>>1,i=o+t/2;for(;!(o>=i)&&kt[o];)++o;if(r=o<<1,r-e>32&&jr)return jr.decode(ce.subarray(e,r));let A="";for(let s=0;!(s>=t/2);++s){let c=qe[e+s*2>>1];if(c==0)break;A+=String.fromCharCode(c)}return A}function Kt(e,t,r){if(P(t%2==0,"Pointer passed to stringToUTF16 must be aligned to two bytes!"),P(typeof r=="number","stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),r===void 0&&(r=2147483647),r<2)return 0;r-=2;let o=t,i=r<e.length*2?r/2:e.length;for(let A=0;A<i;++A){let s=e.charCodeAt(A);qe[t>>1]=s,t+=2}return qe[t>>1]=0,t-o}function Hr(e){return e.length*2}function Gr(e,t){P(e%4==0,"Pointer passed to UTF32ToString must be aligned to four bytes!");let r=0,o="";for(;!(r>=t/4);){let i=m[e+r*4>>2];if(i==0)break;if(++r,i>=65536){let A=i-65536;o+=String.fromCharCode(55296|A>>10,56320|A&1023)}else o+=String.fromCharCode(i)}return o}function wt(e,t,r){if(P(t%4==0,"Pointer passed to stringToUTF32 must be aligned to four bytes!"),P(typeof r=="number","stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),r===void 0&&(r=2147483647),r<4)return 0;let o=t,i=o+r-4;for(let A=0;A<e.length;++A){let s=e.charCodeAt(A);if(s>=55296&&s<=57343){let c=e.charCodeAt(++A);s=65536+((s&1023)<<10)|c&1023}if(m[t>>2]=s,t+=4,t+4>i)break}return m[t>>2]=0,t-o}function Hn(e){let t=0;for(let r=0;r<e.length;++r){let o=e.charCodeAt(r);o>=55296&&o<=57343&&++r,t+=4}return t}function lr(e){let t=Ye(e)+1,r=Wt(t);return r&&Ge(e,ae,r,t),r}function Yr(e,t){P(e.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)"),ae.set(e,t)}function Gn(e,t,r){for(let o=0;o<e.length;++o)P(e.charCodeAt(o)===e.charCodeAt(o)&255),ae[t++>>0]=e.charCodeAt(o);r||(ae[t>>0]=0)}function Yn(e,t){return e%t>0&&(e+=t-e%t),e}let gt,ae,ce,qe,kt,m,ie,_e,Jt;function Qe(e){gt=e,n.HEAP8=ae=new Int8Array(e),n.HEAP16=qe=new Int16Array(e),n.HEAP32=m=new Int32Array(e),n.HEAPU8=ce=new Uint8Array(e),n.HEAPU16=kt=new Uint16Array(e),n.HEAPU32=ie=new Uint32Array(e),n.HEAPF32=_e=new Float32Array(e),n.HEAPF64=Jt=new Float64Array(e)}let et=5242880;n.TOTAL_STACK&&P(et===n.TOTAL_STACK,"the stack size can no longer be determined at runtime");let Ve=n.INITIAL_MEMORY||16777216;Object.getOwnPropertyDescriptor(n,"INITIAL_MEMORY")||Object.defineProperty(n,"INITIAL_MEMORY",{configurable:!0,get(){l("Module.INITIAL_MEMORY has been replaced with plain INITIAL_MEMORY (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),P(Ve>=et,`INITIAL_MEMORY should be larger than TOTAL_STACK, was ${Ve}! (TOTAL_STACK=${et})`),P(typeof Int32Array!="undefined"&&typeof Float64Array!="undefined"&&Int32Array.prototype.subarray!==void 0&&Int32Array.prototype.set!==void 0,"JS engine does not provide full typed array support"),P(!n.wasmMemory,"Use of `wasmMemory` detected. Use -s IMPORTED_MEMORY to define wasmMemory externally"),P(Ve==16777216,"Detected runtime INITIAL_MEMORY setting. Use -s IMPORTED_MEMORY to define wasmMemory dynamically");let F;function lt(){let e=Mo();P((e&3)==0),ie[(e>>2)+1]=34821223,ie[(e>>2)+2]=2310721022,m[0]=1668509029}function X(){if($e)return;let e=Mo(),t=ie[(e>>2)+1],r=ie[(e>>2)+2];(t!=34821223||r!=2310721022)&&l(`Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x${r.toString(16)} ${t.toString(16)}`),m[0]!==1668509029&&l("Runtime error: The application has corrupted its heap memory area (address zero)!")}(function(){let e=new Int16Array(1),t=new Int8Array(e.buffer);if(e[0]=25459,t[0]!==115||t[1]!==99)throw"Runtime error: expected the system to be little-endian! (Run with -s SUPPORT_BIG_ENDIAN=1 to bypass)"})();let ur=[],Nt=[],ut=[],Xr=[],Ue=!1,Wr=!1,Xn=0;function dr(){return xr||Xn>0}function fr(){if(n.preRun)for(typeof n.preRun=="function"&&(n.preRun=[n.preRun]);n.preRun.length;)Vr(n.preRun.shift());Cr(ur)}function Er(){X(),P(!Ue),Ue=!0,!n.noFSInit&&!a.init.initialized&&a.init(),a.ignorePermissions=!1,de.init(),Cr(Nt)}function $r(){X(),Wr=!0}function Wn(){if(X(),n.postRun)for(typeof n.postRun=="function"&&(n.postRun=[n.postRun]);n.postRun.length;)Jr(n.postRun.shift());Cr(Xr)}function Vr(e){ur.unshift(e)}function Kr(e){Nt.unshift(e)}function Jr(e){Xr.unshift(e)}P(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),P(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),P(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),P(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");let dt=0,ft=null,Ke=null,tt={};function Dt(e){let t=e;for(;;){if(!tt[e])return e;e=t+Math.random()}}function zt(e){dt++,n.monitorRunDependencies&&n.monitorRunDependencies(dt),e?(P(!tt[e]),tt[e]=1,ft===null&&typeof setInterval!="undefined"&&(ft=setInterval(()=>{if($e){clearInterval(ft),ft=null;return}let t=!1;for(let r in tt)t||(t=!0,K("still waiting on run dependencies:")),K(`dependency: ${r}`);t&&K("(end of list)")},1e4))):K("warning: run dependency added without ID")}function Ut(e){if(dt--,n.monitorRunDependencies&&n.monitorRunDependencies(dt),e?(P(tt[e]),delete tt[e]):K("warning: run dependency removed without ID"),dt==0&&(ft!==null&&(clearInterval(ft),ft=null),Ke)){let t=Ke;Ke=null,t()}}n.preloadedImages={},n.preloadedAudios={};function l(e){n.onAbort&&n.onAbort(e),e+="",K(e),$e=!0,vt=1,e=`abort(${e}) at ${to()}`;let r=new WebAssembly.RuntimeError(e);throw he(r),r}let $n="data:application/octet-stream;base64,";function zr(e){return e.startsWith($n)}function bt(e){return e.startsWith("file://")}function $(e,t){return function(){let r=e,o=t;return t||(o=n.asm),P(Ue,`native function \`${r}\` called before runtime initialization`),P(!Wr,`native function \`${r}\` called after runtime exit (use NO_EXIT_RUNTIME to keep it alive after main() exits)`),o[e]||P(o[e],`exported native function \`${r}\` not found`),o[e].apply(null,arguments)}}let ue;ue="selfie_segmentation_solution_simd_wasm_bin.wasm",zr(ue)||(ue=ar(ue));function Zr(e){try{if(e==ue&&Ft)return new Uint8Array(Ft);if(St)return St(e);throw"both async and sync fetching of the wasm failed"}catch(t){l(t)}}function Vn(){if(!Ft&&(Oe||Ee)){if(typeof fetch=="function"&&!bt(ue))return fetch(ue,{credentials:"same-origin"}).then(e=>{if(!e.ok)throw`failed to load wasm binary file at '${ue}'`;return e.arrayBuffer()}).catch(()=>Zr(ue));if(gr)return new Promise((e,t)=>{gr(ue,r=>{e(new Uint8Array(r))},t)})}return Promise.resolve().then(()=>Zr(ue))}function Kn(){let e={env:ti,wasi_snapshot_preview1:ti};function t(s,c){let{exports:d}=s;n.asm=d,_t=n.asm.memory,P(_t,"memory not found in wasm exports"),Qe(_t.buffer),F=n.asm.__indirect_function_table,P(F,"table not found in wasm exports"),Kr(n.asm.__wasm_call_ctors),Ut("wasm-instantiate")}zt("wasm-instantiate");let r=n;function o(s){P(n===r,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),r=null,t(s.instance)}function i(s){return Vn().then(c=>WebAssembly.instantiate(c,e)).then(s,c=>{K(`failed to asynchronously prepare wasm: ${c}`),bt(ue)&&K(`warning: Loading from a file URI (${ue}) is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing`),l(c)})}function A(){return!Ft&&typeof WebAssembly.instantiateStreaming=="function"&&!zr(ue)&&!bt(ue)&&typeof fetch=="function"?fetch(ue,{credentials:"same-origin"}).then(s=>WebAssembly.instantiateStreaming(s,e).then(o,d=>(K(`wasm streaming compile failed: ${d}`),K("falling back to ArrayBuffer instantiation"),i(o)))):i(o)}if(n.instantiateWasm)try{return n.instantiateWasm(e,t)}catch(s){return K(`Module.instantiateWasm callback failed with error: ${s}`),!1}return A().catch(he),{}}let Ce,Je,ze={460656(){let e=!0;if(e){let t=To;if(typeof t!="function"){typeof console!="undefined"&&console.error('Expected Emscripten global function "findCanvasEventTarget" not found. WebGL context creation may fail.');return}To=function(r){if(r==0){if(n&&n.canvas)return n.canvas;if(n&&n.canvasCssSelector)return t(n.canvasCssSelector);typeof console!="undefined"&&console.warn("Module properties canvas and canvasCssSelector not found during WebGL context creation.")}return t(r)},e=!1}},461441(){return typeof wasmOffsetConverter!="undefined"}};function Jn(){return typeof wasmOffsetConverter!="undefined"}function Ir(e,t){if(_.mainLoop.timingMode=e,_.mainLoop.timingValue=t,!_.mainLoop.func)return K("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(_.mainLoop.running||(_.mainLoop.running=!0),e==0)_.mainLoop.scheduler=function(){let o=Math.max(0,_.mainLoop.tickStartTime+t-rt())|0;setTimeout(_.mainLoop.runner,o)},_.mainLoop.method="timeout";else if(e==1)_.mainLoop.scheduler=function(){_.requestAnimationFrame(_.mainLoop.runner)},_.mainLoop.method="rAF";else if(e==2){if(typeof setImmediate=="undefined"){let r=[],o="setimmediate",i=function(A){(A.data===o||A.data.target===o)&&(A.stopPropagation(),r.shift()())};addEventListener("message",i,!0),setImmediate=function(s){r.push(s),Ee?(n.setImmediates===void 0&&(n.setImmediates=[]),n.setImmediates.push(s),postMessage({target:o})):postMessage(o,"*")}}_.mainLoop.scheduler=function(){setImmediate(_.mainLoop.runner)},_.mainLoop.method="immediate"}return 0}let rt;Bt?rt=function(){let e=process.hrtime();return e[0]*1e3+e[1]/1e6}:rt=function(){return performance.now()};function zn(){return!p.currentContext||!p.currentContext.GLctx?-3:p.currentContext.defaultFbo?(p.blitOffscreenFramebuffer(p.currentContext),0):p.currentContext.attributes.explicitSwapControl?0:-3}function pr(e){cc(e)}function Zn(){if(!dr())try{pr(vt)}catch(e){if(e instanceof So)return;throw e}}function qn(e,t,r,o,i){P(!_.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."),_.mainLoop.func=e,_.mainLoop.arg=o;let A=_.mainLoop.currentlyRunningMainloop;function s(){return A<_.mainLoop.currentlyRunningMainloop?(Zn(),!1):!0}if(_.mainLoop.running=!1,_.mainLoop.runner=function(){if(!$e){if(_.mainLoop.queue.length>0){let d=Date.now(),E=_.mainLoop.queue.shift();if(E.func(E.arg),_.mainLoop.remainingBlockers){let I=_.mainLoop.remainingBlockers,C=I%1==0?I-1:Math.floor(I);E.counted?_.mainLoop.remainingBlockers=C:(C=C+.5,_.mainLoop.remainingBlockers=(8*I+C)/9)}if(se(`main loop blocker "${E.name}" took ${Date.now()-d} ms`),_.mainLoop.updateStatus(),!s())return;setTimeout(_.mainLoop.runner,0);return}if(s()){if(_.mainLoop.currentFrameNumber=_.mainLoop.currentFrameNumber+1|0,_.mainLoop.timingMode==1&&_.mainLoop.timingValue>1&&_.mainLoop.currentFrameNumber%_.mainLoop.timingValue!=0){_.mainLoop.scheduler();return}_.mainLoop.timingMode==0&&(_.mainLoop.tickStartTime=rt()),p.newRenderingFrameStarted(),typeof p!="undefined"&&p.currentContext&&!p.currentContextIsProxied&&!p.currentContext.attributes.explicitSwapControl&&p.currentContext.GLctx.commit&&p.currentContext.GLctx.commit(),_.mainLoop.method==="timeout"&&n.ctx&&(Re("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!"),_.mainLoop.method=""),_.mainLoop.runIter(e),X(),s()&&(typeof SDL=="object"&&SDL.audio&&SDL.audio.queueNewAudioData&&SDL.audio.queueNewAudioData(),_.mainLoop.scheduler())}}},i||(t&&t>0?Ir(0,1e3/t):Ir(1,1),_.mainLoop.scheduler()),r)throw"unwind"}function Tt(e,t){if($e){K("user callback triggered after application aborted. Ignoring.");return}if(t){e();return}try{e()}catch(r){if(r instanceof So)return;if(r!=="unwind")throw r&&typeof r=="object"&&r.stack&&K(`exception thrown: ${[r,r.stack]}`),r}}function qr(e,t){return setTimeout(()=>{Tt(e)},t)}var _={mainLoop:{running:!1,scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause(){_.mainLoop.scheduler=null,_.mainLoop.currentlyRunningMainloop++},resume(){_.mainLoop.currentlyRunningMainloop++;let{timingMode:e}=_.mainLoop,{timingValue:t}=_.mainLoop,{func:r}=_.mainLoop;_.mainLoop.func=null,qn(r,0,!1,_.mainLoop.arg,!0),Ir(e,t),_.mainLoop.scheduler()},updateStatus(){if(n.setStatus){let e=n.statusMessage||"Please wait...",t=_.mainLoop.remainingBlockers,r=_.mainLoop.expectedBlockers;t?t<r?n.setStatus(`${e} (${r-t}/${r})`):n.setStatus(e):n.setStatus("")}},runIter(e){$e||n.preMainLoop&&n.preMainLoop()===!1||(Tt(e),n.postMainLoop&&n.postMainLoop())}},isFullscreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init(){if(n.preloadPlugins||(n.preloadPlugins=[]),_.initted)return;_.initted=!0;try{new Blob,_.hasBlobConstructor=!0}catch(i){_.hasBlobConstructor=!1,se("warning: no blob constructor, cannot create blobs with mimetypes")}_.BlobBuilder=typeof MozBlobBuilder!="undefined"?MozBlobBuilder:typeof WebKitBlobBuilder!="undefined"?WebKitBlobBuilder:_.hasBlobConstructor?null:se("warning: no BlobBuilder"),_.URLObject=typeof window!="undefined"?window.URL?window.URL:window.webkitURL:void 0,!n.noImageDecoding&&typeof _.URLObject=="undefined"&&(se("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available."),n.noImageDecoding=!0);let e={};e.canHandle=function(A){return!n.noImageDecoding&&/\.(jpg|jpeg|png|bmp)$/i.test(A)},e.handle=function(A,s,c,d){let E=null;if(_.hasBlobConstructor)try{E=new Blob([A],{type:_.getMimetype(s)}),E.size!==A.length&&(E=new Blob([new Uint8Array(A).buffer],{type:_.getMimetype(s)}))}catch(h){Re(`Blob constructor present but fails: ${h}; falling back to blob builder`)}if(!E){let h=new _.BlobBuilder;h.append(new Uint8Array(A).buffer),E=h.getBlob()}let I=_.URLObject.createObjectURL(E);P(typeof I=="string","createObjectURL must return a url as a string");let C=new Image;C.onload=function(){P(C.complete,`Image ${s} could not be decoded`);let y=document.createElement("canvas");y.width=C.width,y.height=C.height,y.getContext("2d").drawImage(C,0,0),n.preloadedImages[s]=y,_.URLObject.revokeObjectURL(I),c&&c(A)},C.onerror=function(y){se(`Image ${I} could not be decoded`),d&&d()},C.src=I},n.preloadPlugins.push(e);let t={};t.canHandle=function(A){return!n.noAudioDecoding&&A.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},t.handle=function(A,s,c,d){let E=!1;function I(y){E||(E=!0,n.preloadedAudios[s]=y,c&&c(A))}function C(){E||(E=!0,n.preloadedAudios[s]=new Audio,d&&d())}if(_.hasBlobConstructor){try{var h=new Blob([A],{type:_.getMimetype(s)})}catch(N){return C()}let y=_.URLObject.createObjectURL(h);P(typeof y=="string","createObjectURL must return a url as a string");let T=new Audio;T.addEventListener("canplaythrough",()=>{I(T)},!1),T.onerror=function(Y){if(E)return;se(`warning: browser could not fully decode audio ${s}, trying slower base64 approach`);function q(D){let S="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",re="=",U="",me=0,Te=0;for(let Ze=0;Ze<D.length;Ze++)for(me=me<<8|D[Ze],Te+=8;Te>=6;){let gc=me>>Te-6&63;Te-=6,U+=S[gc]}return Te==2?(U+=S[(me&3)<<4],U+=re+re):Te==4&&(U+=S[(me&15)<<2],U+=re),U}T.src=`data:audio/x-${s.substr(-3)};base64,${q(A)}`,I(T)},T.src=y,qr(()=>{I(T)},1e4)}else return C()},n.preloadPlugins.push(t);function r(){_.pointerLock=document.pointerLockElement===n.canvas||document.mozPointerLockElement===n.canvas||document.webkitPointerLockElement===n.canvas||document.msPointerLockElement===n.canvas}let{canvas:o}=n},createContext(e,t,r,o){if(t&&n.ctx&&e==n.canvas)return n.ctx;let i,A;if(t){let s={antialias:!1,alpha:!1,majorVersion:typeof WebGL2RenderingContext!="undefined"?2:1};if(o)for(let c in o)s[c]=o[c];typeof p!="undefined"&&(A=p.createContext(e,s),A&&(i=p.getContext(A).GLctx))}else i=e.getContext("2d");return i?(r&&(t||P(typeof w=="undefined","cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),n.ctx=i,t&&p.makeContextCurrent(A),n.useWebGL=t,_.moduleContextCreatedCallbacks.forEach(s=>{s()}),_.init()),i):null},destroyContext(e,t,r){},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen(e,t){_.lockPointer=e,_.resizeCanvas=t,typeof _.lockPointer=="undefined"&&(_.lockPointer=!0),typeof _.resizeCanvas=="undefined"&&(_.resizeCanvas=!1);let{canvas:r}=n;function o(){_.isFullscreen=!1;let A=r.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===A?(r.exitFullscreen=_.exitFullscreen,_.lockPointer&&r.requestPointerLock(),_.isFullscreen=!0,_.resizeCanvas?_.setFullscreenCanvasSize():_.updateCanvasDimensions(r)):(A.parentNode.insertBefore(r,A),A.parentNode.removeChild(A),_.resizeCanvas?_.setWindowedCanvasSize():_.updateCanvasDimensions(r)),n.onFullScreen&&n.onFullScreen(_.isFullscreen),n.onFullscreen&&n.onFullscreen(_.isFullscreen)}_.fullscreenHandlersInstalled||(_.fullscreenHandlersInstalled=!0);let 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(){l("Module.requestFullScreen has been replaced by Module.requestFullscreen (without a capital S)")},exitFullscreen(){return _.isFullscreen?((document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||function(){}).apply(document,[]),!0):!1},nextRAF:0,fakeRequestAnimationFrame(e){let t=Date.now();if(_.nextRAF===0)_.nextRAF=t+1e3/60;else for(;t+2>=_.nextRAF;)_.nextRAF+=1e3/60;let r=Math.max(_.nextRAF-t,0);setTimeout(e,r)},requestAnimationFrame(e){if(typeof requestAnimationFrame=="function"){requestAnimationFrame(e);return}let t=_.fakeRequestAnimationFrame;t(e)},safeSetTimeout(e){return qr(e)},safeRequestAnimationFrame(e){return _.requestAnimationFrame(()=>{Tt(e)})},getMimetype(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(e){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(e)},getMovementX(e){return e.movementX||e.mozMovementX||e.webkitMovementX||0},getMovementY(e){return e.movementY||e.mozMovementY||e.webkitMovementY||0},getMouseWheelDelta(e){let 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(e){if(_.pointerLock)e.type!="mousemove"&&"mozMovementX"in e?_.mouseMovementX=_.mouseMovementY=0:(_.mouseMovementX=_.getMovementX(e),_.mouseMovementY=_.getMovementY(e)),typeof SDL!="undefined"?(_.mouseX=SDL.mouseX+_.mouseMovementX,_.mouseY=SDL.mouseY+_.mouseMovementY):(_.mouseX+=_.mouseMovementX,_.mouseY+=_.mouseMovementY);else{let t=n.canvas.getBoundingClientRect(),r=n.canvas.width,o=n.canvas.height,i=typeof window.scrollX!="undefined"?window.scrollX:window.pageXOffset,A=typeof window.scrollY!="undefined"?window.scrollY:window.pageYOffset;if(P(typeof i!="undefined"&&typeof A!="undefined","Unable to retrieve scroll position, mouse positions likely broken."),e.type==="touchstart"||e.type==="touchend"||e.type==="touchmove"){let{touch:d}=e;if(d===void 0)return;let E=d.pageX-(i+t.left),I=d.pageY-(A+t.top);E=E*(r/t.width),I=I*(o/t.height);let C={x:E,y:I};if(e.type==="touchstart")_.lastTouches[d.identifier]=C,_.touches[d.identifier]=C;else if(e.type==="touchend"||e.type==="touchmove"){let h=_.touches[d.identifier];h||(h=C),_.lastTouches[d.identifier]=h,_.touches[d.identifier]=C}return}let s=e.pageX-(i+t.left),c=e.pageY-(A+t.top);s=s*(r/t.width),c=c*(o/t.height),_.mouseMovementX=s-_.mouseX,_.mouseMovementY=c-_.mouseY,_.mouseX=s,_.mouseY=c}},resizeListeners:[],updateResizeListeners(){let{canvas:e}=n;_.resizeListeners.forEach(t=>{t(e.width,e.height)})},setCanvasSize(e,t,r){let{canvas:o}=n;_.updateCanvasDimensions(o,e,t),r||_.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize(){if(typeof SDL!="undefined"){let e=ie[SDL.screen>>2];e=e|8388608,m[SDL.screen>>2]=e}_.updateCanvasDimensions(n.canvas),_.updateResizeListeners()},setWindowedCanvasSize(){if(typeof SDL!="undefined"){let e=ie[SDL.screen>>2];e=e&-8388609,m[SDL.screen>>2]=e}_.updateCanvasDimensions(n.canvas),_.updateResizeListeners()},updateCanvasDimensions(e,t,r){t&&r?(e.widthNative=t,e.heightNative=r):(t=e.widthNative,r=e.heightNative);let o=t,i=r;if(n.forcedAspectRatio&&n.forcedAspectRatio>0&&(o/i<n.forcedAspectRatio?o=Math.round(i*n.forcedAspectRatio):i=Math.round(o/n.forcedAspectRatio)),(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e.parentNode&&typeof screen!="undefined"){let A=Math.min(screen.width/o,screen.height/i);o=Math.round(o*A),i=Math.round(i*A)}_.resizeCanvas?(e.width!=o&&(e.width=o),e.height!=i&&(e.height=i),typeof e.style!="undefined"&&(e.style.removeProperty("width"),e.style.removeProperty("height"))):(e.width!=t&&(e.width=t),e.height!=r&&(e.height=r),typeof e.style!="undefined"&&(o!=t||i!=r?(e.style.setProperty("width",`${o}px`,"important"),e.style.setProperty("height",`${i}px`,"important")):(e.style.removeProperty("width"),e.style.removeProperty("height"))))}};function Cr(e){for(;e.length>0;){let t=e.shift();if(typeof t=="function"){t(n);continue}let{func:r}=t;typeof r=="number"?t.arg===void 0?F.get(r)():F.get(r)(t.arg):r(t.arg===void 0?null:t.arg)}}function Zt(e){return Re("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"),e}function en(e){let t=/\b_Z[\w\d_]+/g;return e.replace(t,r=>{let o=Zt(r);return r===o?r:`${o} [${r}]`})}function eo(){let e=new Error;if(!e.stack){try{throw new Error}catch(t){e=t}if(!e.stack)return"(no stack trace available)"}return e.stack.toString()}function to(){let e=eo();return n.extraStackTrace&&(e+=`
1
+ var lc=Object.defineProperty,uc=Object.defineProperties;var dc=Object.getOwnPropertyDescriptors;var Ai=Object.getOwnPropertySymbols;var fc=Object.prototype.hasOwnProperty,Ec=Object.prototype.propertyIsEnumerable;var vo=(Z,M,n)=>M in Z?lc(Z,M,{enumerable:!0,configurable:!0,writable:!0,value:n}):Z[M]=n,si=(Z,M)=>{for(var n in M||(M={}))fc.call(M,n)&&vo(Z,n,M[n]);if(Ai)for(var n of Ai(M))Ec.call(M,n)&&vo(Z,n,M[n]);return Z},ai=(Z,M)=>uc(Z,dc(M));var Ic=(Z=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(Z,{get:(M,n)=>(typeof require!="undefined"?require:M)[n]}):Z)(function(Z){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+Z+'" is not supported')});var ye=(Z,M,n)=>(vo(Z,typeof M!="symbol"?M+"":M,n),n);async function ci({sdkAppId:Z,userId:M,userSig:n,core:oe}){var De;let he=oe.utils.getAbilityConfigUrl(Z),Be=Math.round(new Date().getTime()/1e3),fe=`${he}?sdkAppId=${Z}&userId=${M}&userSig=${n}&timestamp=${Be}`;try{let ke=await(await fetch(fe)).json();oe.log.info(`virtual background send ${fe}, response: ${JSON.stringify(ke)}`);let{data:Oe}=ke;return(De=Oe==null?void 0:Oe.trtcAutoConf)!=null&&De.web_ar?{auth:!0,timestamp:Be}:{auth:!1}}catch(ve){return oe.log.error("beauty fetch error",ve),{auth:!1}}}var pc={sdkAppId:{required:!0,type:"number"},userId:{required:!0,type:"string"},userSig:{required:!0,type:"string"}};function gi(Z){return{name:"VirtualBackgroundOptions",type:"object",required:!0,allowEmpty:!1,properties:ai(si({},pc),{type:{required:!1,type:"string",values:["image","blur"]},src:{required:!1,type:"string"},onError:{required:!1}}),validate(M,n,oe,he){var Ee;let{RtcError:Be,ErrorCode:fe,ErrorCodeDictionary:De}=Z.errorModule;if(!M)return;let{type:ve,src:ke,onError:Oe}=M;if(ve==="image"&&!ke)throw new Be({code:fe.INVALID_PARAMETER,extraCode:De.INVALID_PARAMETER_REQUIRED,fnName:oe,messageParams:{key:"src"}});if(Oe&&!Z.utils.isFunction(Oe))throw new Be({code:fe.INVALID_PARAMETER,extraCode:De.INVALID_PARAMETER_TYPE,fnName:oe,messageParams:{key:"onError",value:typeof Oe,rule:{type:"Function"}}});if(!((Ee=Z.room.videoManager.cameraTrack)!=null&&Ee.mediaTrack))throw new Be({code:fe.INVALID_OPERATION,extraCode:De.INVALID_OPERATION_NEED_VIDEO,fnName:oe});if(Z.environment.CHROME_MAJOR_VERSION<90)throw new Be({code:fe.ENV_NOT_SUPPORTED,extraCode:De.NOT_SUPPORTED_CHROME_VERSION,fnName:oe})}}}function li(Z){return{name:"UpdateVirtualBackgroundOptions",type:"object",required:!0,allowEmpty:!1,properties:{type:{required:!0,type:"string",values:["image","blur"]},src:{required:!1,type:"string"}},validate(M,n,oe,he){if(!M)return;let{RtcError:Be,ErrorCode:fe,ErrorCodeDictionary:De}=Z.errorModule,{type:ve,src:ke}=M;if(ve==="image"&&!ke)throw new Be({code:fe.INVALID_PARAMETER,extraCode:De.INVALID_PARAMETER_REQUIRED,fnName:oe,messageParams:{key:"src"}})}}}function ui(Z){return{name:"StopVirtualBackgroundOptions",required:!1}}var Cc=function(){let Z=typeof document!="undefined"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename!="undefined"&&(Z=Z||__filename),function(M){M=M||{};let n=typeof M!="undefined"?M:{},oe,he;n.ready=new Promise((e,t)=>{oe=e,he=t}),Object.getOwnPropertyDescriptor(n.ready,"_main")||(Object.defineProperty(n.ready,"_main",{configurable:!0,get(){l("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(n.ready,"_main",{configurable:!0,set(){l("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(n.ready,"_emscripten_stack_get_end")||(Object.defineProperty(n.ready,"_emscripten_stack_get_end",{configurable:!0,get(){l("You are getting _emscripten_stack_get_end 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(n.ready,"_emscripten_stack_get_end",{configurable:!0,set(){l("You are setting _emscripten_stack_get_end 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(n.ready,"_emscripten_stack_get_free")||(Object.defineProperty(n.ready,"_emscripten_stack_get_free",{configurable:!0,get(){l("You are getting _emscripten_stack_get_free 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(n.ready,"_emscripten_stack_get_free",{configurable:!0,set(){l("You are setting _emscripten_stack_get_free 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(n.ready,"_emscripten_stack_init")||(Object.defineProperty(n.ready,"_emscripten_stack_init",{configurable:!0,get(){l("You are getting _emscripten_stack_init 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(n.ready,"_emscripten_stack_init",{configurable:!0,set(){l("You are setting _emscripten_stack_init 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(n.ready,"_stackSave")||(Object.defineProperty(n.ready,"_stackSave",{configurable:!0,get(){l("You are getting _stackSave 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(n.ready,"_stackSave",{configurable:!0,set(){l("You are setting _stackSave 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(n.ready,"_stackRestore")||(Object.defineProperty(n.ready,"_stackRestore",{configurable:!0,get(){l("You are getting _stackRestore 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(n.ready,"_stackRestore",{configurable:!0,set(){l("You are setting _stackRestore 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(n.ready,"_stackAlloc")||(Object.defineProperty(n.ready,"_stackAlloc",{configurable:!0,get(){l("You are getting _stackAlloc 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(n.ready,"_stackAlloc",{configurable:!0,set(){l("You are setting _stackAlloc 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(n.ready,"___wasm_call_ctors")||(Object.defineProperty(n.ready,"___wasm_call_ctors",{configurable:!0,get(){l("You are getting ___wasm_call_ctors 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(n.ready,"___wasm_call_ctors",{configurable:!0,set(){l("You are setting ___wasm_call_ctors 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(n.ready,"_fflush")||(Object.defineProperty(n.ready,"_fflush",{configurable:!0,get(){l("You are getting _fflush 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(n.ready,"_fflush",{configurable:!0,set(){l("You are setting _fflush 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(n.ready,"___errno_location")||(Object.defineProperty(n.ready,"___errno_location",{configurable:!0,get(){l("You are getting ___errno_location 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(n.ready,"___errno_location",{configurable:!0,set(){l("You are setting ___errno_location 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(n.ready,"_malloc")||(Object.defineProperty(n.ready,"_malloc",{configurable:!0,get(){l("You are getting _malloc 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(n.ready,"_malloc",{configurable:!0,set(){l("You are setting _malloc 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(n.ready,"_free")||(Object.defineProperty(n.ready,"_free",{configurable:!0,get(){l("You are getting _free 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(n.ready,"_free",{configurable:!0,set(){l("You are setting _free 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(n.ready,"_setThrew")||(Object.defineProperty(n.ready,"_setThrew",{configurable:!0,get(){l("You are getting _setThrew 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(n.ready,"_setThrew",{configurable:!0,set(){l("You are setting _setThrew 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(n.ready,"___cxa_is_pointer_type")||(Object.defineProperty(n.ready,"___cxa_is_pointer_type",{configurable:!0,get(){l("You are getting ___cxa_is_pointer_type 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(n.ready,"___cxa_is_pointer_type",{configurable:!0,set(){l("You are setting ___cxa_is_pointer_type 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(n.ready,"___cxa_can_catch")||(Object.defineProperty(n.ready,"___cxa_can_catch",{configurable:!0,get(){l("You are getting ___cxa_can_catch 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(n.ready,"___cxa_can_catch",{configurable:!0,set(){l("You are setting ___cxa_can_catch 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(n.ready,"_saveSetjmp")||(Object.defineProperty(n.ready,"_saveSetjmp",{configurable:!0,get(){l("You are getting _saveSetjmp 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(n.ready,"_saveSetjmp",{configurable:!0,set(){l("You are setting _saveSetjmp 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(n.ready,"_memalign")||(Object.defineProperty(n.ready,"_memalign",{configurable:!0,get(){l("You are getting _memalign 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(n.ready,"_memalign",{configurable:!0,set(){l("You are setting _memalign 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(n.ready,"_emscripten_main_thread_process_queued_calls")||(Object.defineProperty(n.ready,"_emscripten_main_thread_process_queued_calls",{configurable:!0,get(){l("You are getting _emscripten_main_thread_process_queued_calls 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(n.ready,"_emscripten_main_thread_process_queued_calls",{configurable:!0,set(){l("You are setting _emscripten_main_thread_process_queued_calls 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(n.ready,"_emscripten_webgl_make_context_current")||(Object.defineProperty(n.ready,"_emscripten_webgl_make_context_current",{configurable:!0,get(){l("You are getting _emscripten_webgl_make_context_current 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(n.ready,"_emscripten_webgl_make_context_current",{configurable:!0,set(){l("You are setting _emscripten_webgl_make_context_current 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(n.ready,"_emscripten_webgl_get_current_context")||(Object.defineProperty(n.ready,"_emscripten_webgl_get_current_context",{configurable:!0,get(){l("You are getting _emscripten_webgl_get_current_context 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(n.ready,"_emscripten_webgl_get_current_context",{configurable:!0,set(){l("You are setting _emscripten_webgl_get_current_context 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(n.ready,"__get_tzname")||(Object.defineProperty(n.ready,"__get_tzname",{configurable:!0,get(){l("You are getting __get_tzname 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(n.ready,"__get_tzname",{configurable:!0,set(){l("You are setting __get_tzname 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(n.ready,"__get_daylight")||(Object.defineProperty(n.ready,"__get_daylight",{configurable:!0,get(){l("You are getting __get_daylight 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(n.ready,"__get_daylight",{configurable:!0,set(){l("You are setting __get_daylight 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(n.ready,"__get_timezone")||(Object.defineProperty(n.ready,"__get_timezone",{configurable:!0,get(){l("You are getting __get_timezone 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(n.ready,"__get_timezone",{configurable:!0,set(){l("You are setting __get_timezone 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(n.ready,"_emscripten_builtin_malloc")||(Object.defineProperty(n.ready,"_emscripten_builtin_malloc",{configurable:!0,get(){l("You are getting _emscripten_builtin_malloc 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(n.ready,"_emscripten_builtin_malloc",{configurable:!0,set(){l("You are setting _emscripten_builtin_malloc 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(n.ready,"_emscripten_builtin_free")||(Object.defineProperty(n.ready,"_emscripten_builtin_free",{configurable:!0,get(){l("You are getting _emscripten_builtin_free 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(n.ready,"_emscripten_builtin_free",{configurable:!0,set(){l("You are setting _emscripten_builtin_free 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(n.ready,"_emscripten_builtin_memalign")||(Object.defineProperty(n.ready,"_emscripten_builtin_memalign",{configurable:!0,get(){l("You are getting _emscripten_builtin_memalign 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(n.ready,"_emscripten_builtin_memalign",{configurable:!0,set(){l("You are setting _emscripten_builtin_memalign 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(n.ready,"___getTypeName")||(Object.defineProperty(n.ready,"___getTypeName",{configurable:!0,get(){l("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(n.ready,"___getTypeName",{configurable:!0,set(){l("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(n.ready,"___embind_register_native_and_builtin_types")||(Object.defineProperty(n.ready,"___embind_register_native_and_builtin_types",{configurable:!0,get(){l("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(n.ready,"___embind_register_native_and_builtin_types",{configurable:!0,set(){l("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(n.ready,"onRuntimeInitialized")||(Object.defineProperty(n.ready,"onRuntimeInitialized",{configurable:!0,get(){l("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(n.ready,"onRuntimeInitialized",{configurable:!0,set(){l("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")}}));let Be={},fe;for(fe in n)n.hasOwnProperty(fe)&&(Be[fe]=n[fe]);let De=[],ve="./this.program",ke=function(e,t){throw t},Oe=typeof window=="object",Ee=typeof importScripts=="function",Bt=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",Un=!Oe&&!Bt&&!Ee;if(n.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)");let je="";function ar(e){return n.locateFile?n.locateFile(e,je):je+e}let cr,gr,St,$t,No,xn;if(Oe||Ee){if(Ee?je=self.location.href:typeof document!="undefined"&&document.currentScript&&(je=document.currentScript.src),Z&&(je=Z),je.indexOf("blob:")!==0?je=je.substr(0,je.lastIndexOf("/")+1):je="",!(typeof window=="object"||typeof importScripts=="function"))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?)");cr=function(e){let t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},Ee&&(St=function(e){let t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),gr=function(e,t,r){let o=new XMLHttpRequest;o.open("GET",e,!0),o.responseType="arraybuffer",o.onload=function(){if(o.status==200||o.status==0&&o.response){t(o.response);return}r()},o.onerror=r,o.send(null)},$t=function(e){document.title=e}}else throw new Error("environment detection error");let se=n.print||console.log.bind(console),K=n.printErr||console.warn.bind(console);for(fe in Be)Be.hasOwnProperty(fe)&&(n[fe]=Be[fe]);Be=null,n.arguments&&(De=n.arguments),Object.getOwnPropertyDescriptor(n,"arguments")||Object.defineProperty(n,"arguments",{configurable:!0,get(){l("Module.arguments has been replaced with plain arguments_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),n.thisProgram&&(ve=n.thisProgram),Object.getOwnPropertyDescriptor(n,"thisProgram")||Object.defineProperty(n,"thisProgram",{configurable:!0,get(){l("Module.thisProgram has been replaced with plain thisProgram (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),n.quit&&(ke=n.quit),Object.getOwnPropertyDescriptor(n,"quit")||Object.defineProperty(n,"quit",{configurable:!0,get(){l("Module.quit has been replaced with plain quit_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),P(typeof n.memoryInitializerPrefixURL=="undefined","Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),P(typeof n.pthreadMainPrefixURL=="undefined","Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),P(typeof n.cdInitializerPrefixURL=="undefined","Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),P(typeof n.filePackagePrefixURL=="undefined","Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),P(typeof n.read=="undefined","Module.read option was removed (modify read_ in JS)"),P(typeof n.readAsync=="undefined","Module.readAsync option was removed (modify readAsync in JS)"),P(typeof n.readBinary=="undefined","Module.readBinary option was removed (modify readBinary in JS)"),P(typeof n.setWindowTitle=="undefined","Module.setWindowTitle option was removed (modify setWindowTitle in JS)"),P(typeof n.TOTAL_MEMORY=="undefined","Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),Object.getOwnPropertyDescriptor(n,"read")||Object.defineProperty(n,"read",{configurable:!0,get(){l("Module.read has been replaced with plain read_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),Object.getOwnPropertyDescriptor(n,"readAsync")||Object.defineProperty(n,"readAsync",{configurable:!0,get(){l("Module.readAsync has been replaced with plain readAsync (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),Object.getOwnPropertyDescriptor(n,"readBinary")||Object.defineProperty(n,"readBinary",{configurable:!0,get(){l("Module.readBinary has been replaced with plain readBinary (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),Object.getOwnPropertyDescriptor(n,"setWindowTitle")||Object.defineProperty(n,"setWindowTitle",{configurable:!0,get(){l("Module.setWindowTitle has been replaced with plain setWindowTitle (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),P(!Un,"shell environment detected but not enabled at build time. Add 'shell' to `-s ENVIRONMENT` to enable.");function Re(e){Re.shown||(Re.shown={}),Re.shown[e]||(Re.shown[e]=1,K(e))}function ct(e,t){if(typeof WebAssembly.Function=="function"){let C={i:"i32",j:"i64",f:"f32",d:"f64"},h={parameters:[],results:t[0]=="v"?[]:[C[t[0]]]};for(var r=1;r<t.length;++r)h.parameters.push(C[t[r]]);return new WebAssembly.Function(h,e)}let o=[1,0,1,96],i=t.slice(0,1),A=t.slice(1),s={i:127,j:126,f:125,d:124};o.push(A.length);for(var r=0;r<A.length;++r)o.push(s[A[r]]);i=="v"?o.push(0):o=o.concat([1,s[i]]),o[1]=o.length-2;let c=new Uint8Array([0,97,115,109,1,0,0,0].concat(o,[2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0])),d=new WebAssembly.Module(c);return new WebAssembly.Instance(d,{e:{f:e}}).exports.f}let be=[],Ne;function Vt(){if(be.length)return be.pop();try{F.grow(1)}catch(e){throw e instanceof RangeError?"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.":e}return F.length-1}function mt(e,t){if(!Ne){Ne=new WeakMap;for(let o=0;o<F.length;o++){let i=F.get(o);i&&Ne.set(i,o)}}if(Ne.has(e))return Ne.get(e);let r=Vt();try{F.set(r,e)}catch(o){if(!(o instanceof TypeError))throw o;P(typeof t!="undefined",`Missing signature argument to addFunction: ${e}`);let i=ct(e,t);F.set(r,i)}return Ne.set(e,r),r}let le=0,He=function(e){le=e},Ur=function(){return le},Ft;n.wasmBinary&&(Ft=n.wasmBinary),Object.getOwnPropertyDescriptor(n,"wasmBinary")||Object.defineProperty(n,"wasmBinary",{configurable:!0,get(){l("Module.wasmBinary has been replaced with plain wasmBinary (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}});let xr=n.noExitRuntime||!0;Object.getOwnPropertyDescriptor(n,"noExitRuntime")||Object.defineProperty(n,"noExitRuntime",{configurable:!0,get(){l("Module.noExitRuntime has been replaced with plain noExitRuntime (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),typeof WebAssembly!="object"&&l("no native wasm support detected");let _t,$e=!1,vt;function P(e,t){e||l(`Assertion failed: ${t}`)}function Ln(e){let t=n[`_${e}`];return P(t,`Cannot call unknown function ${e}, make sure it is exported`),t}function Uo(e,t,r,o,i){let A={string(h){let y=0;if(h!=null&&h!==0){let T=(h.length<<2)+1;y=ri(T),Qt(h,y,T)}return y},array(h){let y=ri(h.length);return Yr(h,y),y}};function s(h){return t==="string"?Pe(h):t==="boolean"?!!h:h}let c=Ln(e),d=[],E=0;if(P(t!=="array",'Return type should not be "array".'),o)for(let h=0;h<o.length;h++){let y=A[r[h]];y?(E===0&&(E=L()),d[h]=y(o[h])):d[h]=o[h]}let I=c.apply(null,d);function C(h){return E!==0&&j(E),s(h)}return I=C(I),I}let xo=1,Lr=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):void 0;function yt(e,t,r){let o=t+r,i=t;for(;e[i]&&!(i>=o);)++i;if(i-t>16&&e.subarray&&Lr)return Lr.decode(e.subarray(t,i));let A="";for(;t<i;){let s=e[t++];if(!(s&128)){A+=String.fromCharCode(s);continue}let c=e[t++]&63;if((s&224)==192){A+=String.fromCharCode((s&31)<<6|c);continue}let d=e[t++]&63;if((s&240)==224?s=(s&15)<<12|c<<6|d:((s&248)!=240&&Re(`Invalid UTF-8 leading byte 0x${s.toString(16)} encountered when deserializing a UTF-8 string in wasm memory to a JS string!`),s=(s&7)<<18|c<<12|d<<6|e[t++]&63),s<65536)A+=String.fromCharCode(s);else{let E=s-65536;A+=String.fromCharCode(55296|E>>10,56320|E&1023)}}return A}function Pe(e,t){return e?yt(ce,e,t):""}function Ge(e,t,r,o){if(!(o>0))return 0;let i=r,A=r+o-1;for(let s=0;s<e.length;++s){let c=e.charCodeAt(s);if(c>=55296&&c<=57343){let d=e.charCodeAt(++s);c=65536+((c&1023)<<10)|d&1023}if(c<=127){if(r>=A)break;t[r++]=c}else if(c<=2047){if(r+1>=A)break;t[r++]=192|c>>6,t[r++]=128|c&63}else if(c<=65535){if(r+2>=A)break;t[r++]=224|c>>12,t[r++]=128|c>>6&63,t[r++]=128|c&63}else{if(r+3>=A)break;c>=2097152&&Re(`Invalid Unicode code point 0x${c.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-0x1FFFFF).`),t[r++]=240|c>>18,t[r++]=128|c>>12&63,t[r++]=128|c>>6&63,t[r++]=128|c&63}}return t[r]=0,r-i}function Qt(e,t,r){return P(typeof r=="number","stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),Ge(e,ce,t,r)}function Ye(e){let t=0;for(let r=0;r<e.length;++r){let o=e.charCodeAt(r);o>=55296&&o<=57343&&(o=65536+((o&1023)<<10)|e.charCodeAt(++r)&1023),o<=127?++t:o<=2047?t+=2:o<=65535?t+=3:t+=4}return t}let jr=typeof TextDecoder!="undefined"?new TextDecoder("utf-16le"):void 0;function jn(e,t){P(e%2==0,"Pointer passed to UTF16ToString must be aligned to two bytes!");let r=e,o=r>>1,i=o+t/2;for(;!(o>=i)&&kt[o];)++o;if(r=o<<1,r-e>32&&jr)return jr.decode(ce.subarray(e,r));let A="";for(let s=0;!(s>=t/2);++s){let c=qe[e+s*2>>1];if(c==0)break;A+=String.fromCharCode(c)}return A}function Kt(e,t,r){if(P(t%2==0,"Pointer passed to stringToUTF16 must be aligned to two bytes!"),P(typeof r=="number","stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),r===void 0&&(r=2147483647),r<2)return 0;r-=2;let o=t,i=r<e.length*2?r/2:e.length;for(let A=0;A<i;++A){let s=e.charCodeAt(A);qe[t>>1]=s,t+=2}return qe[t>>1]=0,t-o}function Hr(e){return e.length*2}function Gr(e,t){P(e%4==0,"Pointer passed to UTF32ToString must be aligned to four bytes!");let r=0,o="";for(;!(r>=t/4);){let i=m[e+r*4>>2];if(i==0)break;if(++r,i>=65536){let A=i-65536;o+=String.fromCharCode(55296|A>>10,56320|A&1023)}else o+=String.fromCharCode(i)}return o}function wt(e,t,r){if(P(t%4==0,"Pointer passed to stringToUTF32 must be aligned to four bytes!"),P(typeof r=="number","stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),r===void 0&&(r=2147483647),r<4)return 0;let o=t,i=o+r-4;for(let A=0;A<e.length;++A){let s=e.charCodeAt(A);if(s>=55296&&s<=57343){let c=e.charCodeAt(++A);s=65536+((s&1023)<<10)|c&1023}if(m[t>>2]=s,t+=4,t+4>i)break}return m[t>>2]=0,t-o}function Hn(e){let t=0;for(let r=0;r<e.length;++r){let o=e.charCodeAt(r);o>=55296&&o<=57343&&++r,t+=4}return t}function lr(e){let t=Ye(e)+1,r=Wt(t);return r&&Ge(e,ae,r,t),r}function Yr(e,t){P(e.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)"),ae.set(e,t)}function Gn(e,t,r){for(let o=0;o<e.length;++o)P(e.charCodeAt(o)===e.charCodeAt(o)&255),ae[t++>>0]=e.charCodeAt(o);r||(ae[t>>0]=0)}function Yn(e,t){return e%t>0&&(e+=t-e%t),e}let gt,ae,ce,qe,kt,m,ie,_e,Jt;function Qe(e){gt=e,n.HEAP8=ae=new Int8Array(e),n.HEAP16=qe=new Int16Array(e),n.HEAP32=m=new Int32Array(e),n.HEAPU8=ce=new Uint8Array(e),n.HEAPU16=kt=new Uint16Array(e),n.HEAPU32=ie=new Uint32Array(e),n.HEAPF32=_e=new Float32Array(e),n.HEAPF64=Jt=new Float64Array(e)}let et=5242880;n.TOTAL_STACK&&P(et===n.TOTAL_STACK,"the stack size can no longer be determined at runtime");let Ve=n.INITIAL_MEMORY||16777216;Object.getOwnPropertyDescriptor(n,"INITIAL_MEMORY")||Object.defineProperty(n,"INITIAL_MEMORY",{configurable:!0,get(){l("Module.INITIAL_MEMORY has been replaced with plain INITIAL_MEMORY (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),P(Ve>=et,`INITIAL_MEMORY should be larger than TOTAL_STACK, was ${Ve}! (TOTAL_STACK=${et})`),P(typeof Int32Array!="undefined"&&typeof Float64Array!="undefined"&&Int32Array.prototype.subarray!==void 0&&Int32Array.prototype.set!==void 0,"JS engine does not provide full typed array support"),P(!n.wasmMemory,"Use of `wasmMemory` detected. Use -s IMPORTED_MEMORY to define wasmMemory externally"),P(Ve==16777216,"Detected runtime INITIAL_MEMORY setting. Use -s IMPORTED_MEMORY to define wasmMemory dynamically");let F;function lt(){let e=Mo();P((e&3)==0),ie[(e>>2)+1]=34821223,ie[(e>>2)+2]=2310721022,m[0]=1668509029}function X(){if($e)return;let e=Mo(),t=ie[(e>>2)+1],r=ie[(e>>2)+2];(t!=34821223||r!=2310721022)&&l(`Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x${r.toString(16)} ${t.toString(16)}`),m[0]!==1668509029&&l("Runtime error: The application has corrupted its heap memory area (address zero)!")}(function(){let e=new Int16Array(1),t=new Int8Array(e.buffer);if(e[0]=25459,t[0]!==115||t[1]!==99)throw"Runtime error: expected the system to be little-endian! (Run with -s SUPPORT_BIG_ENDIAN=1 to bypass)"})();let ur=[],Nt=[],ut=[],Xr=[],Ue=!1,Wr=!1,Xn=0;function dr(){return xr||Xn>0}function fr(){if(n.preRun)for(typeof n.preRun=="function"&&(n.preRun=[n.preRun]);n.preRun.length;)Vr(n.preRun.shift());Cr(ur)}function Er(){X(),P(!Ue),Ue=!0,!n.noFSInit&&!a.init.initialized&&a.init(),a.ignorePermissions=!1,de.init(),Cr(Nt)}function $r(){X(),Wr=!0}function Wn(){if(X(),n.postRun)for(typeof n.postRun=="function"&&(n.postRun=[n.postRun]);n.postRun.length;)Jr(n.postRun.shift());Cr(Xr)}function Vr(e){ur.unshift(e)}function Kr(e){Nt.unshift(e)}function Jr(e){Xr.unshift(e)}P(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),P(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),P(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),P(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");let dt=0,ft=null,Ke=null,tt={};function Dt(e){let t=e;for(;;){if(!tt[e])return e;e=t+Math.random()}}function zt(e){dt++,n.monitorRunDependencies&&n.monitorRunDependencies(dt),e?(P(!tt[e]),tt[e]=1,ft===null&&typeof setInterval!="undefined"&&(ft=setInterval(()=>{if($e){clearInterval(ft),ft=null;return}let t=!1;for(let r in tt)t||(t=!0,K("still waiting on run dependencies:")),K(`dependency: ${r}`);t&&K("(end of list)")},1e4))):K("warning: run dependency added without ID")}function Ut(e){if(dt--,n.monitorRunDependencies&&n.monitorRunDependencies(dt),e?(P(tt[e]),delete tt[e]):K("warning: run dependency removed without ID"),dt==0&&(ft!==null&&(clearInterval(ft),ft=null),Ke)){let t=Ke;Ke=null,t()}}n.preloadedImages={},n.preloadedAudios={};function l(e){n.onAbort&&n.onAbort(e),e+="",K(e),$e=!0,vt=1,e=`abort(${e}) at ${to()}`;let r=new WebAssembly.RuntimeError(e);throw he(r),r}let $n="data:application/octet-stream;base64,";function zr(e){return e.startsWith($n)}function bt(e){return e.startsWith("file://")}function $(e,t){return function(){let r=e,o=t;return t||(o=n.asm),P(Ue,`native function \`${r}\` called before runtime initialization`),P(!Wr,`native function \`${r}\` called after runtime exit (use NO_EXIT_RUNTIME to keep it alive after main() exits)`),o[e]||P(o[e],`exported native function \`${r}\` not found`),o[e].apply(null,arguments)}}let ue;ue="selfie_segmentation_solution_simd_wasm_bin.wasm",zr(ue)||(ue=ar(ue));function Zr(e){try{if(e==ue&&Ft)return new Uint8Array(Ft);if(St)return St(e);throw"both async and sync fetching of the wasm failed"}catch(t){l(t)}}function Vn(){if(!Ft&&(Oe||Ee)){if(typeof fetch=="function"&&!bt(ue))return fetch(ue,{credentials:"same-origin"}).then(e=>{if(!e.ok)throw`failed to load wasm binary file at '${ue}'`;return e.arrayBuffer()}).catch(()=>Zr(ue));if(gr)return new Promise((e,t)=>{gr(ue,r=>{e(new Uint8Array(r))},t)})}return Promise.resolve().then(()=>Zr(ue))}function Kn(){let e={env:ti,wasi_snapshot_preview1:ti};function t(s,c){let{exports:d}=s;n.asm=d,_t=n.asm.memory,P(_t,"memory not found in wasm exports"),Qe(_t.buffer),F=n.asm.__indirect_function_table,P(F,"table not found in wasm exports"),Kr(n.asm.__wasm_call_ctors),Ut("wasm-instantiate")}zt("wasm-instantiate");let r=n;function o(s){P(n===r,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),r=null,t(s.instance)}function i(s){return Vn().then(c=>WebAssembly.instantiate(c,e)).then(s,c=>{K(`failed to asynchronously prepare wasm: ${c}`),bt(ue)&&K(`warning: Loading from a file URI (${ue}) is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing`),l(c)})}function A(){return!Ft&&typeof WebAssembly.instantiateStreaming=="function"&&!zr(ue)&&!bt(ue)&&typeof fetch=="function"?fetch(ue,{credentials:"same-origin"}).then(s=>WebAssembly.instantiateStreaming(s,e).then(o,d=>(K(`wasm streaming compile failed: ${d}`),K("falling back to ArrayBuffer instantiation"),i(o)))):i(o)}if(n.instantiateWasm)try{return n.instantiateWasm(e,t)}catch(s){return K(`Module.instantiateWasm callback failed with error: ${s}`),!1}return A().catch(he),{}}let Ce,Je,ze={460656(){let e=!0;if(e){let t=To;if(typeof t!="function"){typeof console!="undefined"&&console.error('Expected Emscripten global function "findCanvasEventTarget" not found. WebGL context creation may fail.');return}To=function(r){if(r==0){if(n&&n.canvas)return n.canvas;if(n&&n.canvasCssSelector)return t(n.canvasCssSelector);typeof console!="undefined"&&console.warn("Module properties canvas and canvasCssSelector not found during WebGL context creation.")}return t(r)},e=!1}},461441(){return typeof wasmOffsetConverter!="undefined"}};function Jn(){return typeof wasmOffsetConverter!="undefined"}function Ir(e,t){if(_.mainLoop.timingMode=e,_.mainLoop.timingValue=t,!_.mainLoop.func)return K("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(_.mainLoop.running||(_.mainLoop.running=!0),e==0)_.mainLoop.scheduler=function(){let o=Math.max(0,_.mainLoop.tickStartTime+t-rt())|0;setTimeout(_.mainLoop.runner,o)},_.mainLoop.method="timeout";else if(e==1)_.mainLoop.scheduler=function(){_.requestAnimationFrame(_.mainLoop.runner)},_.mainLoop.method="rAF";else if(e==2){if(typeof setImmediate=="undefined"){let r=[],o="setimmediate",i=function(A){(A.data===o||A.data.target===o)&&(A.stopPropagation(),r.shift()())};addEventListener("message",i,!0),setImmediate=function(s){r.push(s),Ee?(n.setImmediates===void 0&&(n.setImmediates=[]),n.setImmediates.push(s),postMessage({target:o})):postMessage(o,"*")}}_.mainLoop.scheduler=function(){setImmediate(_.mainLoop.runner)},_.mainLoop.method="immediate"}return 0}let rt;Bt?rt=function(){let e=process.hrtime();return e[0]*1e3+e[1]/1e6}:rt=function(){return performance.now()};function zn(){return!p.currentContext||!p.currentContext.GLctx?-3:p.currentContext.defaultFbo?(p.blitOffscreenFramebuffer(p.currentContext),0):p.currentContext.attributes.explicitSwapControl?0:-3}function pr(e){cc(e)}function Zn(){if(!dr())try{pr(vt)}catch(e){if(e instanceof So)return;throw e}}function qn(e,t,r,o,i){P(!_.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."),_.mainLoop.func=e,_.mainLoop.arg=o;let A=_.mainLoop.currentlyRunningMainloop;function s(){return A<_.mainLoop.currentlyRunningMainloop?(Zn(),!1):!0}if(_.mainLoop.running=!1,_.mainLoop.runner=function(){if(!$e){if(_.mainLoop.queue.length>0){let d=Date.now(),E=_.mainLoop.queue.shift();if(E.func(E.arg),_.mainLoop.remainingBlockers){let I=_.mainLoop.remainingBlockers,C=I%1==0?I-1:Math.floor(I);E.counted?_.mainLoop.remainingBlockers=C:(C=C+.5,_.mainLoop.remainingBlockers=(8*I+C)/9)}if(se(`main loop blocker "${E.name}" took ${Date.now()-d} ms`),_.mainLoop.updateStatus(),!s())return;setTimeout(_.mainLoop.runner,0);return}if(s()){if(_.mainLoop.currentFrameNumber=_.mainLoop.currentFrameNumber+1|0,_.mainLoop.timingMode==1&&_.mainLoop.timingValue>1&&_.mainLoop.currentFrameNumber%_.mainLoop.timingValue!=0){_.mainLoop.scheduler();return}_.mainLoop.timingMode==0&&(_.mainLoop.tickStartTime=rt()),p.newRenderingFrameStarted(),typeof p!="undefined"&&p.currentContext&&!p.currentContextIsProxied&&!p.currentContext.attributes.explicitSwapControl&&p.currentContext.GLctx.commit&&p.currentContext.GLctx.commit(),_.mainLoop.method==="timeout"&&n.ctx&&(Re("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!"),_.mainLoop.method=""),_.mainLoop.runIter(e),X(),s()&&(typeof SDL=="object"&&SDL.audio&&SDL.audio.queueNewAudioData&&SDL.audio.queueNewAudioData(),_.mainLoop.scheduler())}}},i||(t&&t>0?Ir(0,1e3/t):Ir(1,1),_.mainLoop.scheduler()),r)throw"unwind"}function Tt(e,t){if($e){K("user callback triggered after application aborted. Ignoring.");return}if(t){e();return}try{e()}catch(r){if(r instanceof So)return;if(r!=="unwind")throw r&&typeof r=="object"&&r.stack&&K(`exception thrown: ${[r,r.stack]}`),r}}function qr(e,t){return setTimeout(()=>{Tt(e)},t)}var _={mainLoop:{running:!1,scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause(){_.mainLoop.scheduler=null,_.mainLoop.currentlyRunningMainloop++},resume(){_.mainLoop.currentlyRunningMainloop++;let{timingMode:e}=_.mainLoop,{timingValue:t}=_.mainLoop,{func:r}=_.mainLoop;_.mainLoop.func=null,qn(r,0,!1,_.mainLoop.arg,!0),Ir(e,t),_.mainLoop.scheduler()},updateStatus(){if(n.setStatus){let e=n.statusMessage||"Please wait...",t=_.mainLoop.remainingBlockers,r=_.mainLoop.expectedBlockers;t?t<r?n.setStatus(`${e} (${r-t}/${r})`):n.setStatus(e):n.setStatus("")}},runIter(e){$e||n.preMainLoop&&n.preMainLoop()===!1||(Tt(e),n.postMainLoop&&n.postMainLoop())}},isFullscreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init(){if(n.preloadPlugins||(n.preloadPlugins=[]),_.initted)return;_.initted=!0;try{new Blob,_.hasBlobConstructor=!0}catch(i){_.hasBlobConstructor=!1,se("warning: no blob constructor, cannot create blobs with mimetypes")}_.BlobBuilder=typeof MozBlobBuilder!="undefined"?MozBlobBuilder:typeof WebKitBlobBuilder!="undefined"?WebKitBlobBuilder:_.hasBlobConstructor?null:se("warning: no BlobBuilder"),_.URLObject=typeof window!="undefined"?window.URL?window.URL:window.webkitURL:void 0,!n.noImageDecoding&&typeof _.URLObject=="undefined"&&(se("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available."),n.noImageDecoding=!0);let e={};e.canHandle=function(A){return!n.noImageDecoding&&/\.(jpg|jpeg|png|bmp)$/i.test(A)},e.handle=function(A,s,c,d){let E=null;if(_.hasBlobConstructor)try{E=new Blob([A],{type:_.getMimetype(s)}),E.size!==A.length&&(E=new Blob([new Uint8Array(A).buffer],{type:_.getMimetype(s)}))}catch(h){Re(`Blob constructor present but fails: ${h}; falling back to blob builder`)}if(!E){let h=new _.BlobBuilder;h.append(new Uint8Array(A).buffer),E=h.getBlob()}let I=_.URLObject.createObjectURL(E);P(typeof I=="string","createObjectURL must return a url as a string");let C=new Image;C.onload=function(){P(C.complete,`Image ${s} could not be decoded`);let y=document.createElement("canvas");y.width=C.width,y.height=C.height,y.getContext("2d").drawImage(C,0,0),n.preloadedImages[s]=y,_.URLObject.revokeObjectURL(I),c&&c(A)},C.onerror=function(y){se(`Image ${I} could not be decoded`),d&&d()},C.src=I},n.preloadPlugins.push(e);let t={};t.canHandle=function(A){return!n.noAudioDecoding&&A.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},t.handle=function(A,s,c,d){let E=!1;function I(y){E||(E=!0,n.preloadedAudios[s]=y,c&&c(A))}function C(){E||(E=!0,n.preloadedAudios[s]=new Audio,d&&d())}if(_.hasBlobConstructor){try{var h=new Blob([A],{type:_.getMimetype(s)})}catch(N){return C()}let y=_.URLObject.createObjectURL(h);P(typeof y=="string","createObjectURL must return a url as a string");let T=new Audio;T.addEventListener("canplaythrough",()=>{I(T)},!1),T.onerror=function(Y){if(E)return;se(`warning: browser could not fully decode audio ${s}, trying slower base64 approach`);function q(D){let S="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",re="=",U="",me=0,Te=0;for(let Ze=0;Ze<D.length;Ze++)for(me=me<<8|D[Ze],Te+=8;Te>=6;){let gc=me>>Te-6&63;Te-=6,U+=S[gc]}return Te==2?(U+=S[(me&3)<<4],U+=re+re):Te==4&&(U+=S[(me&15)<<2],U+=re),U}T.src=`data:audio/x-${s.substr(-3)};base64,${q(A)}`,I(T)},T.src=y,qr(()=>{I(T)},1e4)}else return C()},n.preloadPlugins.push(t);function r(){_.pointerLock=document.pointerLockElement===n.canvas||document.mozPointerLockElement===n.canvas||document.webkitPointerLockElement===n.canvas||document.msPointerLockElement===n.canvas}let{canvas:o}=n},createContext(e,t,r,o){if(t&&n.ctx&&e==n.canvas)return n.ctx;let i,A;if(t){let s={antialias:!1,alpha:!1,majorVersion:typeof WebGL2RenderingContext!="undefined"?2:1};if(o)for(let c in o)s[c]=o[c];typeof p!="undefined"&&(A=p.createContext(e,s),A&&(i=p.getContext(A).GLctx))}else i=e.getContext("2d");return i?(r&&(t||P(typeof w=="undefined","cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),n.ctx=i,t&&p.makeContextCurrent(A),n.useWebGL=t,_.moduleContextCreatedCallbacks.forEach(s=>{s()}),_.init()),i):null},destroyContext(e,t,r){},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen(e,t){_.lockPointer=e,_.resizeCanvas=t,typeof _.lockPointer=="undefined"&&(_.lockPointer=!0),typeof _.resizeCanvas=="undefined"&&(_.resizeCanvas=!1);let{canvas:r}=n;function o(){_.isFullscreen=!1;let A=r.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===A?(r.exitFullscreen=_.exitFullscreen,_.lockPointer&&r.requestPointerLock(),_.isFullscreen=!0,_.resizeCanvas?_.setFullscreenCanvasSize():_.updateCanvasDimensions(r)):(A.parentNode.insertBefore(r,A),A.parentNode.removeChild(A),_.resizeCanvas?_.setWindowedCanvasSize():_.updateCanvasDimensions(r)),n.onFullScreen&&n.onFullScreen(_.isFullscreen),n.onFullscreen&&n.onFullscreen(_.isFullscreen)}_.fullscreenHandlersInstalled||(_.fullscreenHandlersInstalled=!0);let 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(){l("Module.requestFullScreen has been replaced by Module.requestFullscreen (without a capital S)")},exitFullscreen(){return _.isFullscreen?((document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||function(){}).apply(document,[]),!0):!1},nextRAF:0,fakeRequestAnimationFrame(e){let t=Date.now();if(_.nextRAF===0)_.nextRAF=t+1e3/60;else for(;t+2>=_.nextRAF;)_.nextRAF+=1e3/60;let r=Math.max(_.nextRAF-t,0);setTimeout(e,r)},requestAnimationFrame(e){if(typeof requestAnimationFrame=="function"){requestAnimationFrame(e);return}let t=_.fakeRequestAnimationFrame;t(e)},safeSetTimeout(e){return qr(e)},safeRequestAnimationFrame(e){return _.requestAnimationFrame(()=>{Tt(e)})},getMimetype(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(e){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(e)},getMovementX(e){return e.movementX||e.mozMovementX||e.webkitMovementX||0},getMovementY(e){return e.movementY||e.mozMovementY||e.webkitMovementY||0},getMouseWheelDelta(e){let 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(e){if(_.pointerLock)e.type!="mousemove"&&"mozMovementX"in e?_.mouseMovementX=_.mouseMovementY=0:(_.mouseMovementX=_.getMovementX(e),_.mouseMovementY=_.getMovementY(e)),typeof SDL!="undefined"?(_.mouseX=SDL.mouseX+_.mouseMovementX,_.mouseY=SDL.mouseY+_.mouseMovementY):(_.mouseX+=_.mouseMovementX,_.mouseY+=_.mouseMovementY);else{let t=n.canvas.getBoundingClientRect(),r=n.canvas.width,o=n.canvas.height,i=typeof window.scrollX!="undefined"?window.scrollX:window.pageXOffset,A=typeof window.scrollY!="undefined"?window.scrollY:window.pageYOffset;if(P(typeof i!="undefined"&&typeof A!="undefined","Unable to retrieve scroll position, mouse positions likely broken."),e.type==="touchstart"||e.type==="touchend"||e.type==="touchmove"){let{touch:d}=e;if(d===void 0)return;let E=d.pageX-(i+t.left),I=d.pageY-(A+t.top);E=E*(r/t.width),I=I*(o/t.height);let C={x:E,y:I};if(e.type==="touchstart")_.lastTouches[d.identifier]=C,_.touches[d.identifier]=C;else if(e.type==="touchend"||e.type==="touchmove"){let h=_.touches[d.identifier];h||(h=C),_.lastTouches[d.identifier]=h,_.touches[d.identifier]=C}return}let s=e.pageX-(i+t.left),c=e.pageY-(A+t.top);s=s*(r/t.width),c=c*(o/t.height),_.mouseMovementX=s-_.mouseX,_.mouseMovementY=c-_.mouseY,_.mouseX=s,_.mouseY=c}},resizeListeners:[],updateResizeListeners(){let{canvas:e}=n;_.resizeListeners.forEach(t=>{t(e.width,e.height)})},setCanvasSize(e,t,r){let{canvas:o}=n;_.updateCanvasDimensions(o,e,t),r||_.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize(){if(typeof SDL!="undefined"){let e=ie[SDL.screen>>2];e=e|8388608,m[SDL.screen>>2]=e}_.updateCanvasDimensions(n.canvas),_.updateResizeListeners()},setWindowedCanvasSize(){if(typeof SDL!="undefined"){let e=ie[SDL.screen>>2];e=e&-8388609,m[SDL.screen>>2]=e}_.updateCanvasDimensions(n.canvas),_.updateResizeListeners()},updateCanvasDimensions(e,t,r){t&&r?(e.widthNative=t,e.heightNative=r):(t=e.widthNative,r=e.heightNative);let o=t,i=r;if(n.forcedAspectRatio&&n.forcedAspectRatio>0&&(o/i<n.forcedAspectRatio?o=Math.round(i*n.forcedAspectRatio):i=Math.round(o/n.forcedAspectRatio)),(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e.parentNode&&typeof screen!="undefined"){let A=Math.min(screen.width/o,screen.height/i);o=Math.round(o*A),i=Math.round(i*A)}_.resizeCanvas?(e.width!=o&&(e.width=o),e.height!=i&&(e.height=i),typeof e.style!="undefined"&&(e.style.removeProperty("width"),e.style.removeProperty("height"))):(e.width!=t&&(e.width=t),e.height!=r&&(e.height=r),typeof e.style!="undefined"&&(o!=t||i!=r?(e.style.setProperty("width",`${o}px`,"important"),e.style.setProperty("height",`${i}px`,"important")):(e.style.removeProperty("width"),e.style.removeProperty("height"))))}};function Cr(e){for(;e.length>0;){let t=e.shift();if(typeof t=="function"){t(n);continue}let{func:r}=t;typeof r=="number"?t.arg===void 0?F.get(r)():F.get(r)(t.arg):r(t.arg===void 0?null:t.arg)}}function Zt(e){return Re("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"),e}function en(e){let t=/\b_Z[\w\d_]+/g;return e.replace(t,r=>{let o=Zt(r);return r===o?r:`${o} [${r}]`})}function eo(){let e=new Error;if(!e.stack){try{throw new Error}catch(t){e=t}if(!e.stack)return"(no stack trace available)"}return e.stack.toString()}function to(){let e=eo();return n.extraStackTrace&&(e+=`
2
2
  ${n.extraStackTrace()}`),en(e)}function ro(e){return Wt(e+16)+16}function nt(e,t){}function no(e,t){return void 0}function xt(e){this.excPtr=e,this.ptr=e-16,this.set_type=function(t){m[this.ptr+4>>2]=t},this.get_type=function(){return m[this.ptr+4>>2]},this.set_destructor=function(t){m[this.ptr+8>>2]=t},this.get_destructor=function(){return m[this.ptr+8>>2]},this.set_refcount=function(t){m[this.ptr>>2]=t},this.set_caught=function(t){t=t?1:0,ae[this.ptr+12>>0]=t},this.get_caught=function(){return ae[this.ptr+12>>0]!=0},this.set_rethrown=function(t){t=t?1:0,ae[this.ptr+13>>0]=t},this.get_rethrown=function(){return ae[this.ptr+13>>0]!=0},this.init=function(t,r){this.set_type(t),this.set_destructor(r),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){let t=m[this.ptr>>2];m[this.ptr>>2]=t+1},this.release_ref=function(){let t=m[this.ptr>>2];return m[this.ptr>>2]=t-1,P(t>0),t===1}}function Et(e){this.free=function(){at(this.ptr),this.ptr=0},this.set_base_ptr=function(t){m[this.ptr>>2]=t},this.get_base_ptr=function(){return m[this.ptr>>2]},this.set_adjusted_ptr=function(t){m[this.ptr+4>>2]=t},this.get_adjusted_ptr_addr=function(){return this.ptr+4},this.get_adjusted_ptr=function(){return m[this.ptr+4>>2]},this.get_exception_ptr=function(){if(sa(this.get_exception_info().get_type()))return m[this.get_base_ptr()>>2];let r=this.get_adjusted_ptr();return r!==0?r:this.get_base_ptr()},this.get_exception_info=function(){return new xt(this.get_base_ptr())},e===void 0?(this.ptr=Wt(8),this.set_adjusted_ptr(0)):this.ptr=e}let Ot=[];function oo(e){e.add_ref()}let hr=0;function ot(e){let t=new Et(e),r=t.get_exception_info();return r.get_caught()||(r.set_caught(!0),hr--),r.set_rethrown(!1),Ot.push(t),oo(r),t.get_exception_ptr()}let It=0;function Br(e){try{return at(new xt(e).ptr)}catch(t){K(`exception during cxa_free_exception: ${t}`)}}function tn(e){if(e.release_ref()&&!e.get_rethrown()){let t=e.get_destructor();t&&F.get(t)(e.excPtr),Br(e.excPtr)}}function Lt(){H(0),P(Ot.length>0);let e=Ot.pop();tn(e.get_exception_info()),e.free(),It=0}function io(e){let t=new Et(e),r=t.get_base_ptr();throw It||(It=r),t.free(),`${r} - Exception catching is disabled, this exception cannot be caught. Compile with -s NO_DISABLE_EXCEPTION_CATCHING or -s EXCEPTION_CATCHING_ALLOWED=[..] to catch.`}function rn(){let e=It;if(!e)return He(0),0;let r=new xt(e).get_type(),o=new Et;if(o.set_base_ptr(e),o.set_adjusted_ptr(e),!r)return He(0),o.ptr|0;let i=Array.prototype.slice.call(arguments);for(let A=0;A<i.length;A++){let s=i[A];if(s===0||s===r)break;if(oi(s,r,o.get_adjusted_ptr_addr()))return He(s),o.ptr|0}return He(r),o.ptr|0}function mr(){let e=It;if(!e)return He(0),0;let r=new xt(e).get_type(),o=new Et;if(o.set_base_ptr(e),o.set_adjusted_ptr(e),!r)return He(0),o.ptr|0;let i=Array.prototype.slice.call(arguments);for(let A=0;A<i.length;A++){let s=i[A];if(s===0||s===r)break;if(oi(s,r,o.get_adjusted_ptr_addr()))return He(s),o.ptr|0}return He(r),o.ptr|0}function nn(){let e=Ot.pop();e||l("no exception to throw");let t=e.get_exception_info(),r=e.get_base_ptr();throw t.get_rethrown()?e.free():(Ot.push(e),t.set_rethrown(!0),t.set_caught(!1),hr++),It=r,`${r} - Exception catching is disabled, this exception cannot be caught. Compile with -s NO_DISABLE_EXCEPTION_CATCHING or -s EXCEPTION_CATCHING_ALLOWED=[..] to catch.`}function Ao(e,t){return void 0}function so(e,t,r){throw new xt(e).init(t,r),It=e,hr++,`${e} - Exception catching is disabled, this exception cannot be caught. Compile with -s NO_DISABLE_EXCEPTION_CATCHING or -s EXCEPTION_CATCHING_ALLOWED=[..] to catch.`}function _r(e){return m[ra()>>2]=e,e}var te={splitPath(e){return/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1)},normalizeArray(e,t){let r=0;for(let o=e.length-1;o>=0;o--){let i=e[o];i==="."?e.splice(o,1):i===".."?(e.splice(o,1),r++):r&&(e.splice(o,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize(e){let t=e.charAt(0)==="/",r=e.substr(-1)==="/";return e=te.normalizeArray(e.split("/").filter(o=>!!o),!t).join("/"),!e&&!t&&(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname(e){let t=te.splitPath(e),r=t[0],o=t[1];return!r&&!o?".":(o&&(o=o.substr(0,o.length-1)),r+o)},basename(e){if(e==="/")return"/";e=te.normalize(e),e=e.replace(/\/$/,"");let t=e.lastIndexOf("/");return t===-1?e:e.substr(t+1)},extname(e){return te.splitPath(e)[3]},join(){let e=Array.prototype.slice.call(arguments,0);return te.normalize(e.join("/"))},join2(e,t){return te.normalize(`${e}/${t}`)}};function on(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){let e=new Uint8Array(1);return function(){return crypto.getRandomValues(e),e[0]}}if(Bt)try{let e=Ic("crypto");return function(){return e.randomBytes(1)[0]}}catch(e){}return function(){l("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 Xe={resolve(){let e="",t=!1;for(let r=arguments.length-1;r>=-1&&!t;r--){let o=r>=0?arguments[r]:a.cwd();if(typeof o!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!o)return"";e=`${o}/${e}`,t=o.charAt(0)==="/"}return e=te.normalizeArray(e.split("/").filter(r=>!!r),!t).join("/"),(t?"/":"")+e||"."},relative(e,t){e=Xe.resolve(e).substr(1),t=Xe.resolve(t).substr(1);function r(E){let I=0;for(;I<E.length&&E[I]==="";I++);let C=E.length-1;for(;C>=0&&E[C]==="";C--);return I>C?[]:E.slice(I,C-I+1)}let o=r(e.split("/")),i=r(t.split("/")),A=Math.min(o.length,i.length),s=A;for(var c=0;c<A;c++)if(o[c]!==i[c]){s=c;break}let d=[];for(var c=s;c<o.length;c++)d.push("..");return d=d.concat(i.slice(s)),d.join("/")}},de={ttys:[],init(){},shutdown(){},register(e,t){de.ttys[e]={input:[],output:[],ops:t},a.registerDevice(e,de.stream_ops)},stream_ops:{open(e){let t=de.ttys[e.node.rdev];if(!t)throw new a.ErrnoError(43);e.tty=t,e.seekable=!1},close(e){e.tty.ops.flush(e.tty)},flush(e){e.tty.ops.flush(e.tty)},read(e,t,r,o,i){if(!e.tty||!e.tty.ops.get_char)throw new a.ErrnoError(60);let A=0;for(let c=0;c<o;c++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(d){throw new a.ErrnoError(29)}if(s===void 0&&A===0)throw new a.ErrnoError(6);if(s==null)break;A++,t[r+c]=s}return A&&(e.node.timestamp=Date.now()),A},write(e,t,r,o,i){if(!e.tty||!e.tty.ops.put_char)throw new a.ErrnoError(60);try{for(var A=0;A<o;A++)e.tty.ops.put_char(e.tty,t[r+A])}catch(s){throw new a.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),A}},default_tty_ops:{get_char(e){if(!e.input.length){let t=null;if(Bt){let o=Buffer.alloc(256),i=0;try{i=No.readSync(process.stdin.fd,o,0,256,null)}catch(A){if(A.toString().includes("EOF"))i=0;else throw A}i>0?t=o.slice(0,i).toString("utf-8"):t=null}else typeof window!="undefined"&&typeof window.prompt=="function"?(t=window.prompt("Input: "),t!==null&&(t+=`
3
3
  `)):typeof readline=="function"&&(t=readline(),t!==null&&(t+=`
4
4
  `));if(!t)return null;e.input=Sn(t,!0)}return e.input.shift()},put_char(e,t){t===null||t===10?(se(yt(e.output,0)),e.output=[]):t!=0&&e.output.push(t)},flush(e){e.output&&e.output.length>0&&(se(yt(e.output,0)),e.output=[])}},default_tty1_ops:{put_char(e,t){t===null||t===10?(K(yt(e.output,0)),e.output=[]):t!=0&&e.output.push(t)},flush(e){e.output&&e.output.length>0&&(K(yt(e.output,0)),e.output=[])}}};function yr(e,t){ce.fill(0,e,e+t)}function ao(e,t){return P(t,"alignment argument is required"),Math.ceil(e/t)*t}function An(e){e=ao(e,65536);let t=aa(65536,e);return t?(yr(t,e),t):0}var x={ops_table:null,mount(e){return x.createNode(null,"/",16895,0)},createNode(e,t,r,o){if(a.isBlkdev(r)||a.isFIFO(r))throw new a.ErrnoError(63);x.ops_table||(x.ops_table={dir:{node:{getattr:x.node_ops.getattr,setattr:x.node_ops.setattr,lookup:x.node_ops.lookup,mknod:x.node_ops.mknod,rename:x.node_ops.rename,unlink:x.node_ops.unlink,rmdir:x.node_ops.rmdir,readdir:x.node_ops.readdir,symlink:x.node_ops.symlink},stream:{llseek:x.stream_ops.llseek}},file:{node:{getattr:x.node_ops.getattr,setattr:x.node_ops.setattr},stream:{llseek:x.stream_ops.llseek,read:x.stream_ops.read,write:x.stream_ops.write,allocate:x.stream_ops.allocate,mmap:x.stream_ops.mmap,msync:x.stream_ops.msync}},link:{node:{getattr:x.node_ops.getattr,setattr:x.node_ops.setattr,readlink:x.node_ops.readlink},stream:{}},chrdev:{node:{getattr:x.node_ops.getattr,setattr:x.node_ops.setattr},stream:a.chrdev_stream_ops}});let i=a.createNode(e,t,r,o);return a.isDir(i.mode)?(i.node_ops=x.ops_table.dir.node,i.stream_ops=x.ops_table.dir.stream,i.contents={}):a.isFile(i.mode)?(i.node_ops=x.ops_table.file.node,i.stream_ops=x.ops_table.file.stream,i.usedBytes=0,i.contents=null):a.isLink(i.mode)?(i.node_ops=x.ops_table.link.node,i.stream_ops=x.ops_table.link.stream):a.isChrdev(i.mode)&&(i.node_ops=x.ops_table.chrdev.node,i.stream_ops=x.ops_table.chrdev.stream),i.timestamp=Date.now(),e&&(e.contents[t]=i,e.timestamp=i.timestamp),i},getFileDataAsTypedArray(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage(e,t){let r=e.contents?e.contents.length:0;if(r>=t)return;let o=1024*1024;t=Math.max(t,r*(r<o?2:1.125)>>>0),r!=0&&(t=Math.max(t,256));let i=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(i.subarray(0,e.usedBytes),0)},resizeFileStorage(e,t){if(e.usedBytes!=t)if(t==0)e.contents=null,e.usedBytes=0;else{let 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(e){let t={};return t.dev=a.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,a.isDir(e.mode)?t.size=4096:a.isFile(e.mode)?t.size=e.usedBytes:a.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(e,t){t.mode!==void 0&&(e.mode=t.mode),t.timestamp!==void 0&&(e.timestamp=t.timestamp),t.size!==void 0&&x.resizeFileStorage(e,t.size)},lookup(e,t){throw a.genericErrors[44]},mknod(e,t,r,o){return x.createNode(e,t,r,o)},rename(e,t,r){if(a.isDir(e.mode)){let o;try{o=a.lookupNode(t,r)}catch(i){}if(o)for(let i in o.contents)throw new a.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(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir(e,t){let r=a.lookupNode(e,t);for(let o in r.contents)throw new a.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir(e){let t=[".",".."];for(let r in e.contents)e.contents.hasOwnProperty(r)&&t.push(r);return t},symlink(e,t,r){let o=x.createNode(e,t,41471,0);return o.link=r,o},readlink(e){if(!a.isLink(e.mode))throw new a.ErrnoError(28);return e.link}},stream_ops:{read(e,t,r,o,i){let{contents:A}=e.node;if(i>=e.node.usedBytes)return 0;let s=Math.min(e.node.usedBytes-i,o);if(P(s>=0),s>8&&A.subarray)t.set(A.subarray(i,i+s),r);else for(let c=0;c<s;c++)t[r+c]=A[i+c];return s},write(e,t,r,o,i,A){if(P(!(t instanceof ArrayBuffer)),t.buffer===ae.buffer&&(A=!1),!o)return 0;let{node:s}=e;if(s.timestamp=Date.now(),t.subarray&&(!s.contents||s.contents.subarray)){if(A)return P(i===0,"canOwn must imply no weird position inside the file"),s.contents=t.subarray(r,r+o),s.usedBytes=o,o;if(s.usedBytes===0&&i===0)return s.contents=t.slice(r,r+o),s.usedBytes=o,o;if(i+o<=s.usedBytes)return s.contents.set(t.subarray(r,r+o),i),o}if(x.expandFileStorage(s,i+o),s.contents.subarray&&t.subarray)s.contents.set(t.subarray(r,r+o),i);else for(let c=0;c<o;c++)s.contents[i+c]=t[r+c];return s.usedBytes=Math.max(s.usedBytes,i+o),o},llseek(e,t,r){let o=t;if(r===1?o+=e.position:r===2&&a.isFile(e.node.mode)&&(o+=e.node.usedBytes),o<0)throw new a.ErrnoError(28);return o},allocate(e,t,r){x.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap(e,t,r,o,i,A){if(t!==0)throw new a.ErrnoError(28);if(!a.isFile(e.node.mode))throw new a.ErrnoError(43);let s,c,{contents:d}=e.node;if(!(A&2)&&d.buffer===gt)c=!1,s=d.byteOffset;else{if((o>0||o+r<d.length)&&(d.subarray?d=d.subarray(o,o+r):d=Array.prototype.slice.call(d,o,o+r)),c=!0,s=An(r),!s)throw new a.ErrnoError(48);ae.set(d,s)}return{ptr:s,allocated:c}},msync(e,t,r,o,i){if(!a.isFile(e.node.mode))throw new a.ErrnoError(43);if(i&2)return 0;let A=x.stream_ops.write(e,t,0,o,r,!1);return 0}}};function co(e,t,r,o){let i=o?"":Dt(`al ${e}`);gr(e,A=>{P(A,`Loading data file "${e}" failed (no arrayBuffer).`),t(new Uint8Array(A)),i&&Ut(i)},A=>{if(r)r();else throw`Loading data file "${e}" failed.`}),i&&zt(i)}let Qr={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"},sn={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};var a={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(e,t){if(e=Xe.resolve(a.cwd(),e),t=t||{},!e)return{path:"",node:null};let r={follow_mount:!0,recurse_count:0};for(let s in r)t[s]===void 0&&(t[s]=r[s]);if(t.recurse_count>8)throw new a.ErrnoError(32);let o=te.normalizeArray(e.split("/").filter(s=>!!s),!1),i=a.root,A="/";for(let s=0;s<o.length;s++){let c=s===o.length-1;if(c&&t.parent)break;if(i=a.lookupNode(i,o[s]),A=te.join2(A,o[s]),a.isMountpoint(i)&&(!c||c&&t.follow_mount)&&(i=i.mounted.root),!c||t.follow){let d=0;for(;a.isLink(i.mode);){let E=a.readlink(A);if(A=Xe.resolve(te.dirname(A),E),i=a.lookupPath(A,{recurse_count:t.recurse_count}).node,d++>40)throw new a.ErrnoError(32)}}}return{path:A,node:i}},getPath(e){let t;for(;;){if(a.isRoot(e)){let 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){let r=0;for(let o=0;o<t.length;o++)r=(r<<5)-r+t.charCodeAt(o)|0;return(e+r>>>0)%a.nameTable.length},hashAddNode(e){let t=a.hashName(e.parent.id,e.name);e.name_next=a.nameTable[t],a.nameTable[t]=e},hashRemoveNode(e){let t=a.hashName(e.parent.id,e.name);if(a.nameTable[t]===e)a.nameTable[t]=e.name_next;else{let r=a.nameTable[t];for(;r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}}},lookupNode(e,t){let r=a.mayLookup(e);if(r)throw new a.ErrnoError(r,e);let o=a.hashName(e.id,t);for(let i=a.nameTable[o];i;i=i.name_next){let A=i.name;if(i.parent.id===e.id&&A===t)return i}return a.lookup(e,t)},createNode(e,t,r,o){P(typeof e=="object");let i=new a.FSNode(e,t,r,o);return a.hashAddNode(i),i},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},flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags(e){let t=a.flagModes[e];if(typeof t=="undefined")throw new Error(`Unknown file open mode: ${e}`);return t},flagsToPermissionString(e){let t=["r","w","rw"][e&3];return e&512&&(t+="w"),t},nodePermissions(e,t){return a.ignorePermissions?0:t.includes("r")&&!(e.mode&292)||t.includes("w")&&!(e.mode&146)||t.includes("x")&&!(e.mode&73)?2:0},mayLookup(e){let t=a.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate(e,t){try{let r=a.lookupNode(e,t);return 20}catch(r){}return a.nodePermissions(e,"wx")},mayDelete(e,t,r){let o;try{o=a.lookupNode(e,t)}catch(A){return A.errno}let i=a.nodePermissions(e,"wx");if(i)return i;if(r){if(!a.isDir(o.mode))return 54;if(a.isRoot(o)||a.getPath(o)===a.cwd())return 10}else if(a.isDir(o.mode))return 31;return 0},mayOpen(e,t){return e?a.isLink(e.mode)?32:a.isDir(e.mode)&&(a.flagsToPermissionString(t)!=="r"||t&512)?31:a.nodePermissions(e,a.flagsToPermissionString(t)):44},MAX_OPEN_FDS:4096,nextfd(e,t){e=e||0,t=t||a.MAX_OPEN_FDS;for(let r=e;r<=t;r++)if(!a.streams[r])return r;throw new a.ErrnoError(33)},getStream(e){return a.streams[e]},createStream(e,t,r){a.FSStream||(a.FSStream=function(){},a.FSStream.prototype={object:{get(){return this.node},set(A){this.node=A}},isRead:{get(){return(this.flags&2097155)!==1}},isWrite:{get(){return(this.flags&2097155)!==0}},isAppend:{get(){return this.flags&1024}}});let o=new a.FSStream;for(let A in e)o[A]=e[A];e=o;let i=a.nextfd(t,r);return e.fd=i,a.streams[i]=e,e},closeStream(e){a.streams[e]=null},chrdev_stream_ops:{open(e){let t=a.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek(){throw new a.ErrnoError(70)}},major(e){return e>>8},minor(e){return e&255},makedev(e,t){return e<<8|t},registerDevice(e,t){a.devices[e]={stream_ops:t}},getDevice(e){return a.devices[e]},getMounts(e){let t=[],r=[e];for(;r.length;){let o=r.pop();t.push(o),r.push.apply(r,o.mounts)}return t},syncfs(e,t){typeof e=="function"&&(t=e,e=!1),a.syncFSRequests++,a.syncFSRequests>1&&K(`warning: ${a.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);let r=a.getMounts(a.root.mount),o=0;function i(s){return P(a.syncFSRequests>0),a.syncFSRequests--,t(s)}function A(s){if(s)return A.errored?void 0:(A.errored=!0,i(s));++o>=r.length&&i(null)}r.forEach(s=>{if(!s.type.syncfs)return A(null);s.type.syncfs(s,e,A)})},mount(e,t,r){if(typeof e=="string")throw e;let o=r==="/",i=!r,A;if(o&&a.root)throw new a.ErrnoError(10);if(!o&&!i){let d=a.lookupPath(r,{follow_mount:!1});if(r=d.path,A=d.node,a.isMountpoint(A))throw new a.ErrnoError(10);if(!a.isDir(A.mode))throw new a.ErrnoError(54)}let s={type:e,opts:t,mountpoint:r,mounts:[]},c=e.mount(s);return c.mount=s,s.root=c,o?a.root=c:A&&(A.mounted=s,A.mount&&A.mount.mounts.push(s)),c},unmount(e){let t=a.lookupPath(e,{follow_mount:!1});if(!a.isMountpoint(t.node))throw new a.ErrnoError(28);let{node:r}=t,o=r.mounted,i=a.getMounts(o);Object.keys(a.nameTable).forEach(s=>{let c=a.nameTable[s];for(;c;){let d=c.name_next;i.includes(c.mount)&&a.destroyNode(c),c=d}}),r.mounted=null;let A=r.mount.mounts.indexOf(o);P(A!==-1),r.mount.mounts.splice(A,1)},lookup(e,t){return e.node_ops.lookup(e,t)},mknod(e,t,r){let i=a.lookupPath(e,{parent:!0}).node,A=te.basename(e);if(!A||A==="."||A==="..")throw new a.ErrnoError(28);let s=a.mayCreate(i,A);if(s)throw new a.ErrnoError(s);if(!i.node_ops.mknod)throw new a.ErrnoError(63);return i.node_ops.mknod(i,A,t,r)},create(e,t){return t=t!==void 0?t:438,t&=4095,t|=32768,a.mknod(e,t,0)},mkdir(e,t){return t=t!==void 0?t:511,t&=1023,t|=16384,a.mknod(e,t,0)},mkdirTree(e,t){let r=e.split("/"),o="";for(let i=0;i<r.length;++i)if(r[i]){o+=`/${r[i]}`;try{a.mkdir(o,t)}catch(A){if(A.errno!=20)throw A}}},mkdev(e,t,r){return typeof r=="undefined"&&(r=t,t=438),t|=8192,a.mknod(e,t,r)},symlink(e,t){if(!Xe.resolve(e))throw new a.ErrnoError(44);let o=a.lookupPath(t,{parent:!0}).node;if(!o)throw new a.ErrnoError(44);let i=te.basename(t),A=a.mayCreate(o,i);if(A)throw new a.ErrnoError(A);if(!o.node_ops.symlink)throw new a.ErrnoError(63);return o.node_ops.symlink(o,i,e)},rename(e,t){let r=te.dirname(e),o=te.dirname(t),i=te.basename(e),A=te.basename(t),s,c,d;if(s=a.lookupPath(e,{parent:!0}),c=s.node,s=a.lookupPath(t,{parent:!0}),d=s.node,!c||!d)throw new a.ErrnoError(44);if(c.mount!==d.mount)throw new a.ErrnoError(75);let E=a.lookupNode(c,i),I=Xe.relative(e,o);if(I.charAt(0)!==".")throw new a.ErrnoError(28);if(I=Xe.relative(t,r),I.charAt(0)!==".")throw new a.ErrnoError(55);let C;try{C=a.lookupNode(d,A)}catch(T){}if(E===C)return;let h=a.isDir(E.mode),y=a.mayDelete(c,i,h);if(y)throw new a.ErrnoError(y);if(y=C?a.mayDelete(d,A,h):a.mayCreate(d,A),y)throw new a.ErrnoError(y);if(!c.node_ops.rename)throw new a.ErrnoError(63);if(a.isMountpoint(E)||C&&a.isMountpoint(C))throw new a.ErrnoError(10);if(d!==c&&(y=a.nodePermissions(c,"w"),y))throw new a.ErrnoError(y);try{a.trackingDelegate.willMovePath&&a.trackingDelegate.willMovePath(e,t)}catch(T){K(`FS.trackingDelegate['willMovePath']('${e}', '${t}') threw an exception: ${T.message}`)}a.hashRemoveNode(E);try{c.node_ops.rename(E,d,A)}catch(T){throw T}finally{a.hashAddNode(E)}try{a.trackingDelegate.onMovePath&&a.trackingDelegate.onMovePath(e,t)}catch(T){K(`FS.trackingDelegate['onMovePath']('${e}', '${t}') threw an exception: ${T.message}`)}},rmdir(e){let r=a.lookupPath(e,{parent:!0}).node,o=te.basename(e),i=a.lookupNode(r,o),A=a.mayDelete(r,o,!0);if(A)throw new a.ErrnoError(A);if(!r.node_ops.rmdir)throw new a.ErrnoError(63);if(a.isMountpoint(i))throw new a.ErrnoError(10);try{a.trackingDelegate.willDeletePath&&a.trackingDelegate.willDeletePath(e)}catch(s){K(`FS.trackingDelegate['willDeletePath']('${e}') threw an exception: ${s.message}`)}r.node_ops.rmdir(r,o),a.destroyNode(i);try{a.trackingDelegate.onDeletePath&&a.trackingDelegate.onDeletePath(e)}catch(s){K(`FS.trackingDelegate['onDeletePath']('${e}') threw an exception: ${s.message}`)}},readdir(e){let t=a.lookupPath(e,{follow:!0}),{node:r}=t;if(!r.node_ops.readdir)throw new a.ErrnoError(54);return r.node_ops.readdir(r)},unlink(e){let r=a.lookupPath(e,{parent:!0}).node,o=te.basename(e),i=a.lookupNode(r,o),A=a.mayDelete(r,o,!1);if(A)throw new a.ErrnoError(A);if(!r.node_ops.unlink)throw new a.ErrnoError(63);if(a.isMountpoint(i))throw new a.ErrnoError(10);try{a.trackingDelegate.willDeletePath&&a.trackingDelegate.willDeletePath(e)}catch(s){K(`FS.trackingDelegate['willDeletePath']('${e}') threw an exception: ${s.message}`)}r.node_ops.unlink(r,o),a.destroyNode(i);try{a.trackingDelegate.onDeletePath&&a.trackingDelegate.onDeletePath(e)}catch(s){K(`FS.trackingDelegate['onDeletePath']('${e}') threw an exception: ${s.message}`)}},readlink(e){let r=a.lookupPath(e).node;if(!r)throw new a.ErrnoError(44);if(!r.node_ops.readlink)throw new a.ErrnoError(28);return Xe.resolve(a.getPath(r.parent),r.node_ops.readlink(r))},stat(e,t){let r=a.lookupPath(e,{follow:!t}),{node:o}=r;if(!o)throw new a.ErrnoError(44);if(!o.node_ops.getattr)throw new a.ErrnoError(63);return o.node_ops.getattr(o)},lstat(e){return a.stat(e,!0)},chmod(e,t,r){let o;if(typeof e=="string"?o=a.lookupPath(e,{follow:!r}).node:o=e,!o.node_ops.setattr)throw new a.ErrnoError(63);o.node_ops.setattr(o,{mode:t&4095|o.mode&-4096,timestamp:Date.now()})},lchmod(e,t){a.chmod(e,t,!0)},fchmod(e,t){let r=a.getStream(e);if(!r)throw new a.ErrnoError(8);a.chmod(r.node,t)},chown(e,t,r,o){let i;if(typeof e=="string"?i=a.lookupPath(e,{follow:!o}).node:i=e,!i.node_ops.setattr)throw new a.ErrnoError(63);i.node_ops.setattr(i,{timestamp:Date.now()})},lchown(e,t,r){a.chown(e,t,r,!0)},fchown(e,t,r){let o=a.getStream(e);if(!o)throw new a.ErrnoError(8);a.chown(o.node,t,r)},truncate(e,t){if(t<0)throw new a.ErrnoError(28);let r;if(typeof e=="string"?r=a.lookupPath(e,{follow:!0}).node:r=e,!r.node_ops.setattr)throw new a.ErrnoError(63);if(a.isDir(r.mode))throw new a.ErrnoError(31);if(!a.isFile(r.mode))throw new a.ErrnoError(28);let o=a.nodePermissions(r,"w");if(o)throw new a.ErrnoError(o);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate(e,t){let r=a.getStream(e);if(!r)throw new a.ErrnoError(8);if(!(r.flags&2097155))throw new a.ErrnoError(28);a.truncate(r.node,t)},utime(e,t,r){let o=a.lookupPath(e,{follow:!0}),{node:i}=o;i.node_ops.setattr(i,{timestamp:Math.max(t,r)})},open(e,t,r,o,i){if(e==="")throw new a.ErrnoError(44);t=typeof t=="string"?a.modeStringToFlags(t):t,r=typeof r=="undefined"?438:r,t&64?r=r&4095|32768:r=0;let A;if(typeof e=="object")A=e;else{e=te.normalize(e);try{A=a.lookupPath(e,{follow:!(t&131072)}).node}catch(d){}}let s=!1;if(t&64)if(A){if(t&128)throw new a.ErrnoError(20)}else A=a.mknod(e,r,0),s=!0;if(!A)throw new a.ErrnoError(44);if(a.isChrdev(A.mode)&&(t&=-513),t&65536&&!a.isDir(A.mode))throw new a.ErrnoError(54);if(!s){let d=a.mayOpen(A,t);if(d)throw new a.ErrnoError(d)}t&512&&a.truncate(A,0),t&=-131713;let c=a.createStream({node:A,path:a.getPath(A),flags:t,seekable:!0,position:0,stream_ops:A.stream_ops,ungotten:[],error:!1},o,i);c.stream_ops.open&&c.stream_ops.open(c),n.logReadFiles&&!(t&1)&&(a.readFiles||(a.readFiles={}),e in a.readFiles||(a.readFiles[e]=1,K(`FS.trackingDelegate error on read file: ${e}`)));try{if(a.trackingDelegate.onOpenFile){let d=0;(t&2097155)!==1&&(d|=a.tracking.openFlags.READ),t&2097155&&(d|=a.tracking.openFlags.WRITE),a.trackingDelegate.onOpenFile(e,d)}}catch(d){K(`FS.trackingDelegate['onOpenFile']('${e}', flags) threw an exception: ${d.message}`)}return c},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(t){throw t}finally{a.closeStream(e.fd)}e.fd=null},isClosed(e){return e.fd===null},llseek(e,t,r){if(a.isClosed(e))throw new a.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new a.ErrnoError(70);if(r!=0&&r!=1&&r!=2)throw new a.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read(e,t,r,o,i){if(o<0||i<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);let A=typeof i!="undefined";if(!A)i=e.position;else if(!e.seekable)throw new a.ErrnoError(70);let s=e.stream_ops.read(e,t,r,o,i);return A||(e.position+=s),s},write(e,t,r,o,i,A){if(o<0||i<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);let s=typeof i!="undefined";if(!s)i=e.position;else if(!e.seekable)throw new a.ErrnoError(70);let c=e.stream_ops.write(e,t,r,o,i,A);s||(e.position+=c);try{e.path&&a.trackingDelegate.onWriteToFile&&a.trackingDelegate.onWriteToFile(e.path)}catch(d){K(`FS.trackingDelegate['onWriteToFile']('${e.path}') threw an exception: ${d.message}`)}return c},allocate(e,t,r){if(a.isClosed(e))throw new a.ErrnoError(8);if(t<0||r<=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,t,r)},mmap(e,t,r,o,i,A){if(i&2&&!(A&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,t,r,o,i,A)},msync(e,t,r,o,i){return!e||!e.stream_ops.msync?0:e.stream_ops.msync(e,t,r,o,i)},munmap(e){return 0},ioctl(e,t,r){if(!e.stream_ops.ioctl)throw new a.ErrnoError(59);return e.stream_ops.ioctl(e,t,r)},readFile(e,t){if(t=t||{},t.flags=t.flags||0,t.encoding=t.encoding||"binary",t.encoding!=="utf8"&&t.encoding!=="binary")throw new Error(`Invalid encoding type "${t.encoding}"`);let r,o=a.open(e,t.flags),A=a.stat(e).size,s=new Uint8Array(A);return a.read(o,s,0,A,0),t.encoding==="utf8"?r=yt(s,0):t.encoding==="binary"&&(r=s),a.close(o),r},writeFile(e,t,r){r=r||{},r.flags=r.flags||577;let o=a.open(e,r.flags,r.mode);if(typeof t=="string"){let i=new Uint8Array(Ye(t)+1),A=Ge(t,i,0,i.length);a.write(o,i,0,A,void 0,r.canOwn)}else if(ArrayBuffer.isView(t))a.write(o,t,0,t.byteLength,void 0,r.canOwn);else throw new Error("Unsupported data type");a.close(o)},cwd(){return a.currentPath},chdir(e){let t=a.lookupPath(e,{follow:!0});if(t.node===null)throw new a.ErrnoError(44);if(!a.isDir(t.node.mode))throw new a.ErrnoError(54);let r=a.nodePermissions(t.node,"x");if(r)throw new a.ErrnoError(r);a.currentPath=t.path},createDefaultDirectories(){a.mkdir("/tmp"),a.mkdir("/home"),a.mkdir("/home/web_user")},createDefaultDevices(){a.mkdir("/dev"),a.registerDevice(a.makedev(1,3),{read(){return 0},write(t,r,o,i,A){return i}}),a.mkdev("/dev/null",a.makedev(1,3)),de.register(a.makedev(5,0),de.default_tty_ops),de.register(a.makedev(6,0),de.default_tty1_ops),a.mkdev("/dev/tty",a.makedev(5,0)),a.mkdev("/dev/tty1",a.makedev(6,0));let e=on();a.createDevice("/dev","random",e),a.createDevice("/dev","urandom",e),a.mkdir("/dev/shm"),a.mkdir("/dev/shm/tmp")},createSpecialDirectories(){a.mkdir("/proc");let e=a.mkdir("/proc/self");a.mkdir("/proc/self/fd"),a.mount({mount(){let t=a.createNode(e,"fd",16895,73);return t.node_ops={lookup(r,o){let i=+o,A=a.getStream(i);if(!A)throw new a.ErrnoError(8);let s={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink(){return A.path}}};return s.parent=s,s}},t}},{},"/proc/self/fd")},createStandardStreams(){n.stdin?a.createDevice("/dev","stdin",n.stdin):a.symlink("/dev/tty","/dev/stdin"),n.stdout?a.createDevice("/dev","stdout",null,n.stdout):a.symlink("/dev/tty","/dev/stdout"),n.stderr?a.createDevice("/dev","stderr",null,n.stderr):a.symlink("/dev/tty1","/dev/stderr");let e=a.open("/dev/stdin",0),t=a.open("/dev/stdout",1),r=a.open("/dev/stderr",1);P(e.fd===0,`invalid handle for stdin (${e.fd})`),P(t.fd===1,`invalid handle for stdout (${t.fd})`),P(r.fd===2,`invalid handle for stderr (${r.fd})`)},ensureErrnoError(){a.ErrnoError||(a.ErrnoError=function(t,r){this.node=r,this.setErrno=function(o){this.errno=o;for(let i in sn)if(sn[i]===o){this.code=i;break}},this.setErrno(t),this.message=Qr[t],this.stack&&(Object.defineProperty(this,"stack",{value:new Error().stack,writable:!0}),this.stack=en(this.stack))},a.ErrnoError.prototype=new Error,a.ErrnoError.prototype.constructor=a.ErrnoError,[44].forEach(e=>{a.genericErrors[e]=new a.ErrnoError(e),a.genericErrors[e].stack="<generic error, no stack>"}))},staticInit(){a.ensureErrnoError(),a.nameTable=new Array(4096),a.mount(x,{},"/"),a.createDefaultDirectories(),a.createDefaultDevices(),a.createSpecialDirectories(),a.filesystems={MEMFS:x}},init(e,t,r){P(!a.init.initialized,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)"),a.init.initialized=!0,a.ensureErrnoError(),n.stdin=e||n.stdin,n.stdout=t||n.stdout,n.stderr=r||n.stderr,a.createStandardStreams()},quit(){a.init.initialized=!1;let e=n._fflush;e&&e(0);for(let t=0;t<a.streams.length;t++){let r=a.streams[t];r&&a.close(r)}},getMode(e,t){let r=0;return e&&(r|=365),t&&(r|=146),r},findObject(e,t){let r=a.analyzePath(e,t);return r.exists?r.object:null},analyzePath(e,t){try{var r=a.lookupPath(e,{follow:!t});e=r.path}catch(i){}let o={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var r=a.lookupPath(e,{parent:!0});o.parentExists=!0,o.parentPath=r.path,o.parentObject=r.node,o.name=te.basename(e),r=a.lookupPath(e,{follow:!t}),o.exists=!0,o.path=r.path,o.object=r.node,o.name=r.node.name,o.isRoot=r.path==="/"}catch(i){o.error=i.errno}return o},createPath(e,t,r,o){e=typeof e=="string"?e:a.getPath(e);let i=t.split("/").reverse();for(;i.length;){let s=i.pop();if(s){var A=te.join2(e,s);try{a.mkdir(A)}catch(c){}e=A}}return A},createFile(e,t,r,o,i){let A=te.join2(typeof e=="string"?e:a.getPath(e),t),s=a.getMode(o,i);return a.create(A,s)},createDataFile(e,t,r,o,i,A){let s=t?te.join2(typeof e=="string"?e:a.getPath(e),t):e,c=a.getMode(o,i),d=a.create(s,c);if(r){if(typeof r=="string"){let I=new Array(r.length);for(let C=0,h=r.length;C<h;++C)I[C]=r.charCodeAt(C);r=I}a.chmod(d,c|146);let E=a.open(d,577);a.write(E,r,0,r.length,0,A),a.close(E),a.chmod(d,c)}return d},createDevice(e,t,r,o){let i=te.join2(typeof e=="string"?e:a.getPath(e),t),A=a.getMode(!!r,!!o);a.createDevice.major||(a.createDevice.major=64);let s=a.makedev(a.createDevice.major++,0);return a.registerDevice(s,{open(c){c.seekable=!1},close(c){o&&o.buffer&&o.buffer.length&&o(10)},read(c,d,E,I,C){let h=0;for(let T=0;T<I;T++){var y;try{y=r()}catch(N){throw new a.ErrnoError(29)}if(y===void 0&&h===0)throw new a.ErrnoError(6);if(y==null)break;h++,d[E+T]=y}return h&&(c.node.timestamp=Date.now()),h},write(c,d,E,I,C){for(var h=0;h<I;h++)try{o(d[E+h])}catch(y){throw new a.ErrnoError(29)}return I&&(c.node.timestamp=Date.now()),h}}),a.mkdev(i,A,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.");if(cr)try{e.contents=Sn(cr(e.url),!0),e.usedBytes=e.contents.length}catch(t){throw new a.ErrnoError(29)}else throw new Error("Cannot load without read() or XMLHttpRequest.")},createLazyFile(e,t,r,o,i){function A(){this.lengthKnown=!1,this.chunks=[]}if(A.prototype.get=function(C){if(C>this.length-1||C<0)return;let h=C%this.chunkSize,y=C/this.chunkSize|0;return this.getter(y)[h]},A.prototype.setDataGetter=function(C){this.getter=C},A.prototype.cacheLength=function(){let C=new XMLHttpRequest;if(C.open("HEAD",r,!1),C.send(null),!(C.status>=200&&C.status<300||C.status===304))throw new Error(`Couldn't load ${r}. Status: ${C.status}`);let h=Number(C.getResponseHeader("Content-length")),y,T=(y=C.getResponseHeader("Accept-Ranges"))&&y==="bytes",N=(y=C.getResponseHeader("Content-Encoding"))&&y==="gzip",Y=1024*1024;T||(Y=h);let q=function(S,re){if(S>re)throw new Error(`invalid range (${S}, ${re}) or no bytes requested!`);if(re>h-1)throw new Error(`only ${h} bytes available! programmer error!`);let U=new XMLHttpRequest;if(U.open("GET",r,!1),h!==Y&&U.setRequestHeader("Range",`bytes=${S}-${re}`),typeof Uint8Array!="undefined"&&(U.responseType="arraybuffer"),U.overrideMimeType&&U.overrideMimeType("text/plain; charset=x-user-defined"),U.send(null),!(U.status>=200&&U.status<300||U.status===304))throw new Error(`Couldn't load ${r}. Status: ${U.status}`);return U.response!==void 0?new Uint8Array(U.response||[]):Sn(U.responseText||"",!0)},D=this;D.setDataGetter(S=>{let re=S*Y,U=(S+1)*Y-1;if(U=Math.min(U,h-1),typeof D.chunks[S]=="undefined"&&(D.chunks[S]=q(re,U)),typeof D.chunks[S]=="undefined")throw new Error("doXHR failed!");return D.chunks[S]}),(N||!h)&&(Y=h=1,h=this.getter(0).length,Y=h,se("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=h,this._chunkSize=Y,this.lengthKnown=!0},typeof XMLHttpRequest!="undefined"){if(!Ee)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";let I=new A;Object.defineProperties(I,{length:{get(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:I}}else var s={isDevice:!1,url:r};let c=a.createFile(e,t,s,o,i);s.contents?c.contents=s.contents:s.url&&(c.contents=null,c.url=s.url),Object.defineProperties(c,{usedBytes:{get(){return this.contents.length}}});let d={};return Object.keys(c.stream_ops).forEach(I=>{let C=c.stream_ops[I];d[I]=function(){return a.forceLoadFile(c),C.apply(null,arguments)}}),d.read=function(C,h,y,T,N){a.forceLoadFile(c);let{contents:Y}=C.node;if(N>=Y.length)return 0;let q=Math.min(Y.length-N,T);if(P(q>=0),Y.slice)for(var D=0;D<q;D++)h[y+D]=Y[N+D];else for(var D=0;D<q;D++)h[y+D]=Y.get(N+D);return q},c.stream_ops=d,c},createPreloadedFile(e,t,r,o,i,A,s,c,d,E){_.init();let I=t?Xe.resolve(te.join2(e,t)):e,C=Dt(`cp ${I}`);function h(y){function T(Y){E&&E(),c||a.createDataFile(e,t,Y,o,i,d),A&&A(),Ut(C)}let N=!1;n.preloadPlugins.forEach(Y=>{N||Y.canHandle(I)&&(Y.handle(y,I,T,()=>{s&&s(),Ut(C)}),N=!0)}),N||T(y)}zt(C),typeof r=="string"?co(r,y=>{h(y)},s):h(r)},indexedDB(){return window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB},DB_NAME(){return`EM_FS_${window.location.pathname}`},DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB(e,t,r){t=t||function(){},r=r||function(){};let o=a.indexedDB();try{var i=o.open(a.DB_NAME(),a.DB_VERSION)}catch(A){return r(A)}i.onupgradeneeded=function(){se("creating db"),i.result.createObjectStore(a.DB_STORE_NAME)},i.onsuccess=function(){let c=i.result.transaction([a.DB_STORE_NAME],"readwrite"),d=c.objectStore(a.DB_STORE_NAME),E=0,I=0,C=e.length;function h(){I==0?t():r()}e.forEach(y=>{let T=d.put(a.analyzePath(y).object.contents,y);T.onsuccess=function(){E++,E+I==C&&h()},T.onerror=function(){I++,E+I==C&&h()}}),c.onerror=r},i.onerror=r},loadFilesFromDB(e,t,r){t=t||function(){},r=r||function(){};let o=a.indexedDB();try{var i=o.open(a.DB_NAME(),a.DB_VERSION)}catch(A){return r(A)}i.onupgradeneeded=r,i.onsuccess=function(){let s=i.result;try{var c=s.transaction([a.DB_STORE_NAME],"readonly")}catch(y){r(y);return}let d=c.objectStore(a.DB_STORE_NAME),E=0,I=0,C=e.length;function h(){I==0?t():r()}e.forEach(y=>{let T=d.get(y);T.onsuccess=function(){a.analyzePath(y).exists&&a.unlink(y),a.createDataFile(te.dirname(y),te.basename(y),T.result,!0,!0,!0),E++,E+I==C&&h()},T.onerror=function(){I++,E+I==C&&h()}}),c.onerror=r},i.onerror=r},absolutePath(){l("FS.absolutePath has been removed; use PATH_FS.resolve instead")},createFolder(){l("FS.createFolder has been removed; use FS.mkdir instead")},createLink(){l("FS.createLink has been removed; use FS.symlink instead")},joinPath(){l("FS.joinPath has been removed; use PATH.join instead")},mmapAlloc(){l("FS.mmapAlloc has been replaced by the top level function mmapAlloc")},standardizePath(){l("FS.standardizePath has been removed; use PATH.normalize instead")}},Ae={mappings:{},DEFAULT_POLLMASK:5,umask:511,calculateAt(e,t,r){if(t[0]==="/")return t;let o;if(e===-100)o=a.cwd();else{let i=a.getStream(e);if(!i)throw new a.ErrnoError(8);o=i.path}if(t.length==0){if(!r)throw new a.ErrnoError(44);return o}return te.join2(o,t)},doStat(e,t,r){try{var o=e(t)}catch(i){if(i&&i.node&&te.normalize(t)!==te.normalize(a.getPath(i.node)))return-54;throw i}return m[r>>2]=o.dev,m[r+4>>2]=0,m[r+8>>2]=o.ino,m[r+12>>2]=o.mode,m[r+16>>2]=o.nlink,m[r+20>>2]=o.uid,m[r+24>>2]=o.gid,m[r+28>>2]=o.rdev,m[r+32>>2]=0,Je=[o.size>>>0,(Ce=o.size,+Math.abs(Ce)>=1?Ce>0?(Math.min(+Math.floor(Ce/4294967296),4294967295)|0)>>>0:~~+Math.ceil((Ce-+(~~Ce>>>0))/4294967296)>>>0:0)],m[r+40>>2]=Je[0],m[r+44>>2]=Je[1],m[r+48>>2]=4096,m[r+52>>2]=o.blocks,m[r+56>>2]=o.atime.getTime()/1e3|0,m[r+60>>2]=0,m[r+64>>2]=o.mtime.getTime()/1e3|0,m[r+68>>2]=0,m[r+72>>2]=o.ctime.getTime()/1e3|0,m[r+76>>2]=0,Je=[o.ino>>>0,(Ce=o.ino,+Math.abs(Ce)>=1?Ce>0?(Math.min(+Math.floor(Ce/4294967296),4294967295)|0)>>>0:~~+Math.ceil((Ce-+(~~Ce>>>0))/4294967296)>>>0:0)],m[r+80>>2]=Je[0],m[r+84>>2]=Je[1],0},doMsync(e,t,r,o,i){let A=ce.slice(e,e+r);a.msync(t,A,i,r,o)},doMkdir(e,t){return e=te.normalize(e),e[e.length-1]==="/"&&(e=e.substr(0,e.length-1)),a.mkdir(e,t,0),0},doMknod(e,t,r){switch(t&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return a.mknod(e,t,r),0},doReadlink(e,t,r){if(r<=0)return-28;let o=a.readlink(e),i=Math.min(r,Ye(o)),A=ae[t+i];return Qt(o,t,r+1),ae[t+i]=A,i},doAccess(e,t){if(t&-8)return-28;let r;if(r=a.lookupPath(e,{follow:!0}).node,!r)return-44;let i="";return t&4&&(i+="r"),t&2&&(i+="w"),t&1&&(i+="x"),i&&a.nodePermissions(r,i)?-2:0},doDup(e,t,r){let o=a.getStream(r);return o&&a.close(o),a.open(e,t,0,r,r).fd},doReadv(e,t,r,o){let i=0;for(let A=0;A<r;A++){let s=m[t+A*8>>2],c=m[t+(A*8+4)>>2],d=a.read(e,ae,s,c,o);if(d<0)return-1;if(i+=d,d<c)break}return i},doWritev(e,t,r,o){let i=0;for(let A=0;A<r;A++){let s=m[t+A*8>>2],c=m[t+(A*8+4)>>2],d=a.write(e,ae,s,c,o);if(d<0)return-1;i+=d}return i},varargs:void 0,get(){return P(Ae.varargs!=null),Ae.varargs+=4,m[Ae.varargs-4>>2]},getStr(e){return Pe(e)},getStreamFromFD(e){let t=a.getStream(e);if(!t)throw new a.ErrnoError(8);return t},get64(e,t){return e>=0?P(t===0):P(t===-1),e}};function go(e,t,r){Ae.varargs=r;try{let i=Ae.getStreamFromFD(e);switch(t){case 0:{var o=Ae.get();if(o<0)return-28;let A;return A=a.open(i.path,i.flags,0,o),A.fd}case 1:case 2:return 0;case 3:return i.flags;case 4:{var o=Ae.get();return i.flags|=o,0}case 12:{var o=Ae.get();let s=0;return qe[o+s>>1]=2,0}case 13:case 14:return 0;case 16:case 8:return-28;case 9:return _r(28),-1;default:return-28}}catch(i){return(typeof a=="undefined"||!(i instanceof a.ErrnoError))&&l(i),-i.errno}}function lo(e,t,r){Ae.varargs=r;try{let i=Ae.getStreamFromFD(e);switch(t){case 21509:case 21505:return i.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return i.tty?0:-59;case 21519:{if(!i.tty)return-59;var o=Ae.get();return m[o>>2]=0,0}case 21520:return i.tty?-28:-59;case 21531:{var o=Ae.get();return a.ioctl(i,t,o)}case 21523:return i.tty?0:-59;case 21524:return i.tty?0:-59;default:l(`bad ioctl syscall ${t}`)}}catch(i){return(typeof a=="undefined"||!(i instanceof a.ErrnoError))&&l(i),-i.errno}}function uo(e,t,r,o,i,A){A<<=12;let s,c=!1;if(o&16&&e%65536!==0)return-28;if(o&32){if(s=An(t),!s)return-48;c=!0}else{let d=a.getStream(i);if(!d)return-8;let E=a.mmap(d,e,t,A,r,o);s=E.ptr,c=E.allocated}return Ae.mappings[s]={malloc:s,len:t,allocated:c,fd:i,prot:r,flags:o,offset:A},s}function fo(e,t,r,o,i,A){try{return uo(e,t,r,o,i,A)}catch(s){return(typeof a=="undefined"||!(s instanceof a.ErrnoError))&&l(s),-s.errno}}function Eo(e,t,r){Ae.varargs=r;try{let o=Ae.getStr(e),i=r?Ae.get():0;return a.open(o,t,i).fd}catch(o){return(typeof a=="undefined"||!(o instanceof a.ErrnoError))&&l(o),-o.errno}}function an(e,t){try{return e=Ae.getStr(e),Ae.doStat(a.stat,e,t)}catch(r){return(typeof a=="undefined"||!(r instanceof a.ErrnoError))&&l(r),-r.errno}}let Io=48,po=57;function qt(e){if(e===void 0)return"_unknown";e=e.replace(/[^a-zA-Z0-9_]/g,"$");let t=e.charCodeAt(0);return t>=Io&&t<=po?`_${e}`:e}function jt(e,t){return e=qt(e),new Function("body",`return function ${e}() {