UNPKG

ihs-wasm

Version:
9 lines (7 loc) 190 kB
var functionsCPP = (() => { var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined; if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename; return ( function(functionsCPP) { functionsCPP = functionsCPP || {}; var Module=typeof functionsCPP!="undefined"?functionsCPP:{};var readyPromiseResolve,readyPromiseReject;Module["ready"]=new Promise(function(resolve,reject){readyPromiseResolve=resolve;readyPromiseReject=reject});["_createFile","_main","__ZNSt12length_errorD1Ev","__ZSt15get_new_handlerv","__ZTVN10__cxxabiv120__si_class_type_infoE","___memory_base","_memcmp","_emscripten_get_sbrk_ptr","___handle_stack_overflow","___stack_pointer","_segfault","_malloc","__ZTISt12length_error","__ZNSt13runtime_errorD1Ev","__ZNKSt13runtime_error4whatEv","_memcpy","___cxa_throw","___table_base","__ZTVSt13runtime_error","_abort","_strlen","_free","__ZTVSt12length_error","__ZTVSt11logic_error","__ZTISt9exception","__ZNSt9exceptionD2Ev","_alignfault","_memmove","___cxa_allocate_exception","__ZTVSt9exception","___wasm_apply_data_relocs","_fflush","___getTypeName","__embind_initialize_bindings","___set_stack_limits","onRuntimeInitialized"].forEach(prop=>{if(!Object.getOwnPropertyDescriptor(Module["ready"],prop)){Object.defineProperty(Module["ready"],prop,{get:()=>abort("You are getting "+prop+" 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"),set:()=>abort("You are setting "+prop+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")})}});var moduleOverrides=Object.assign({},Module);var arguments_=[];var thisProgram="./this.program";var quit_=(status,toThrow)=>{throw toThrow};var ENVIRONMENT_IS_WEB=typeof window=="object";var ENVIRONMENT_IS_WORKER=typeof importScripts=="function";var ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";var ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(Module["ENVIRONMENT"]){throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)")}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;function logExceptionOnExit(e){if(e instanceof ExitStatus)return;let toLog=e;if(e&&typeof e=="object"&&e.stack){toLog=[e,e.stack]}err("exiting due to exception: "+toLog)}if(ENVIRONMENT_IS_NODE){if(typeof process=="undefined"||!process.release||process.release.name!=="node")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?)");if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}var fs,nodePath;if(typeof require==="function"){fs=require("fs");nodePath=require("path")}read_=(filename,binary)=>{filename=nodePath["normalize"](filename);return fs.readFileSync(filename,binary?undefined:"utf8")};readBinary=filename=>{var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};readAsync=(filename,onload,onerror)=>{filename=nodePath["normalize"](filename);fs.readFile(filename,function(err,data){if(err)onerror(err);else onload(data.buffer)})};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",function(reason){throw reason});quit_=(status,toThrow)=>{if(keepRuntimeAlive()){process["exitCode"]=status;throw toThrow}logExceptionOnExit(toThrow);process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_SHELL){if(typeof process=="object"&&typeof require==="function"||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?)");if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){let data;if(typeof readbuffer=="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data=="object");return data};readAsync=function readAsync(f,onload,onerror){setTimeout(()=>onload(readBinary(f)),0)};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit=="function"){quit_=(status,toThrow)=>{logExceptionOnExit(toThrow);quit(status)}}if(typeof print!="undefined"){if(typeof console=="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1)}else{scriptDirectory=""}if(!(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?)");{read_=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=(url,onload,onerror)=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=()=>{if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=title=>document.title=title}else{throw new Error("environment detection error")}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);Object.assign(Module,moduleOverrides);moduleOverrides=null;checkIncomingModuleAPI();if(Module["arguments"])arguments_=Module["arguments"];legacyModuleProp("arguments","arguments_");if(Module["thisProgram"])thisProgram=Module["thisProgram"];legacyModuleProp("thisProgram","thisProgram");if(Module["quit"])quit_=Module["quit"];legacyModuleProp("quit","quit_");assert(typeof Module["memoryInitializerPrefixURL"]=="undefined","Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["pthreadMainPrefixURL"]=="undefined","Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["cdInitializerPrefixURL"]=="undefined","Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["filePackagePrefixURL"]=="undefined","Module.filePackagePrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["read"]=="undefined","Module.read option was removed (modify read_ in JS)");assert(typeof Module["readAsync"]=="undefined","Module.readAsync option was removed (modify readAsync in JS)");assert(typeof Module["readBinary"]=="undefined","Module.readBinary option was removed (modify readBinary in JS)");assert(typeof Module["setWindowTitle"]=="undefined","Module.setWindowTitle option was removed (modify setWindowTitle in JS)");assert(typeof Module["TOTAL_MEMORY"]=="undefined","Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY");legacyModuleProp("read","read_");legacyModuleProp("readAsync","readAsync");legacyModuleProp("readBinary","readBinary");legacyModuleProp("setWindowTitle","setWindowTitle");assert(!ENVIRONMENT_IS_SHELL,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable.");var STACK_ALIGN=16;var POINTER_SIZE=4;function legacyModuleProp(prop,newName){if(!Object.getOwnPropertyDescriptor(Module,prop)){Object.defineProperty(Module,prop,{configurable:true,get:function(){abort("Module."+prop+" has been replaced with plain "+newName+" (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}})}}function ignoredModuleProp(prop){if(Object.getOwnPropertyDescriptor(Module,prop)){abort("`Module."+prop+"` was supplied but `"+prop+"` not included in INCOMING_MODULE_JS_API")}}function isExportedByForceFilesystem(name){return name==="FS_createPath"||name==="FS_createDataFile"||name==="FS_createPreloadedFile"||name==="FS_unlink"||name==="addRunDependency"||name==="FS_createLazyFile"||name==="FS_createDevice"||name==="removeRunDependency"}function missingLibrarySymbol(sym){if(typeof globalThis!=="undefined"&&!Object.getOwnPropertyDescriptor(globalThis,sym)){Object.defineProperty(globalThis,sym,{configurable:true,get:function(){var msg="`"+sym+"` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line";var librarySymbol=sym;if(!librarySymbol.startsWith("_")){librarySymbol="$"+sym}msg+=" (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE="+librarySymbol+")";if(isExportedByForceFilesystem(sym)){msg+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"}warnOnce(msg);return undefined}})}}function unexportedRuntimeSymbol(sym){if(!Object.getOwnPropertyDescriptor(Module,sym)){Object.defineProperty(Module,sym,{configurable:true,get:function(){var msg="'"+sym+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";if(isExportedByForceFilesystem(sym)){msg+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"}abort(msg)}})}}var dynamicLibraries=Module["dynamicLibraries"]||[];var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];legacyModuleProp("wasmBinary","wasmBinary");var noExitRuntime=Module["noExitRuntime"]||true;legacyModuleProp("noExitRuntime","noExitRuntime");if(typeof WebAssembly!="object"){abort("no native wasm support detected")}function getSafeHeapType(bytes,isFloat){switch(bytes){case 1:return"i8";case 2:return"i16";case 4:return isFloat?"float":"i32";case 8:return isFloat?"double":"i64";default:assert(0,"getSafeHeapType() invalid bytes="+bytes)}}function SAFE_HEAP_STORE(dest,value,bytes,isFloat){if(dest<=0)abort("segmentation fault storing "+bytes+" bytes to address "+dest);if(dest%bytes!==0)abort("alignment error storing to address "+dest+", which was expected to be aligned to a multiple of "+bytes);if(runtimeInitialized){var brk=_sbrk()>>>0;if(dest+bytes>brk)abort("segmentation fault, exceeded the top of the available dynamic heap when storing "+bytes+" bytes to address "+dest+". DYNAMICTOP="+brk);assert(brk>=_emscripten_stack_get_base(),"brk >= _emscripten_stack_get_base() (brk="+brk+", _emscripten_stack_get_base()="+_emscripten_stack_get_base()+")");assert(brk<=wasmMemory.buffer.byteLength,"brk <= wasmMemory.buffer.byteLength (brk="+brk+", wasmMemory.buffer.byteLength="+wasmMemory.buffer.byteLength+")")}setValue_safe(dest,value,getSafeHeapType(bytes,isFloat));return value}function SAFE_HEAP_STORE_D(dest,value,bytes){return SAFE_HEAP_STORE(dest,value,bytes,true)}function SAFE_HEAP_LOAD(dest,bytes,unsigned,isFloat){if(dest<=0)abort("segmentation fault loading "+bytes+" bytes from address "+dest);if(dest%bytes!==0)abort("alignment error loading from address "+dest+", which was expected to be aligned to a multiple of "+bytes);if(runtimeInitialized){var brk=_sbrk()>>>0;if(dest+bytes>brk)abort("segmentation fault, exceeded the top of the available dynamic heap when loading "+bytes+" bytes from address "+dest+". DYNAMICTOP="+brk);assert(brk>=_emscripten_stack_get_base(),"brk >= _emscripten_stack_get_base() (brk="+brk+", _emscripten_stack_get_base()="+_emscripten_stack_get_base()+")");assert(brk<=wasmMemory.buffer.byteLength,"brk <= wasmMemory.buffer.byteLength (brk="+brk+", wasmMemory.buffer.byteLength="+wasmMemory.buffer.byteLength+")")}var type=getSafeHeapType(bytes,isFloat);var ret=getValue_safe(dest,type);if(unsigned)ret=unSign(ret,parseInt(type.substr(1),10));return ret}function SAFE_HEAP_LOAD_D(dest,bytes,unsigned){return SAFE_HEAP_LOAD(dest,bytes,unsigned,true)}function segfault(){abort("segmentation fault")}function alignfault(){abort("alignment fault")}var wasmMemory;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed"+(text?": "+text:""))}}var UTF8Decoder=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):undefined;function UTF8ArrayToString(heapOrArray,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heapOrArray[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heapOrArray.buffer&&UTF8Decoder){return UTF8Decoder.decode(heapOrArray.subarray(idx,endPtr))}var str="";while(idx<endPtr){var u0=heapOrArray[idx++];if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heapOrArray[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heapOrArray[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{if((u0&248)!=240)warnOnce("Invalid UTF-8 leading byte "+ptrToString(u0)+" encountered when deserializing a UTF-8 string in wasm memory to a JS string!");u0=(u0&7)<<18|u1<<12|u2<<6|heapOrArray[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i<str.length;++i){var u=str.charCodeAt(i);if(u>=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;if(u>1114111)warnOnce("Invalid Unicode code point "+ptrToString(u)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF).");heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){assert(typeof maxBytesToWrite=="number","stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i<str.length;++i){var c=str.charCodeAt(i);if(c<=127){len++}else if(c<=2047){len+=2}else if(c>=55296&&c<=57343){len+=4;++i}else{len+=3}}return len}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var STACK_SIZE=5242880;if(Module["STACK_SIZE"])assert(STACK_SIZE===Module["STACK_SIZE"],"the stack size can no longer be determined at runtime");var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;legacyModuleProp("INITIAL_MEMORY","INITIAL_MEMORY");assert(INITIAL_MEMORY>=STACK_SIZE,"INITIAL_MEMORY should be larger than STACK_SIZE, was "+INITIAL_MEMORY+"! (STACK_SIZE="+STACK_SIZE+")");assert(typeof Int32Array!="undefined"&&typeof Float64Array!=="undefined"&&Int32Array.prototype.subarray!=undefined&&Int32Array.prototype.set!=undefined,"JS engine does not provide full typed array support");if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":2147483648/65536})}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;assert(INITIAL_MEMORY%65536===0);updateGlobalBufferAndViews(buffer);var wasmTable=new WebAssembly.Table({"initial":815,"element":"anyfunc"});function writeStackCookie(){var max=_emscripten_stack_get_end();assert((max&3)==0);if(max==0){max+=4}SAFE_HEAP_STORE((max>>2)*4,34821223,4);SAFE_HEAP_STORE((max+4>>2)*4,2310721022,4)}function checkStackCookie(){if(ABORT)return;var max=_emscripten_stack_get_end();if(max==0){max+=4}var cookie1=SAFE_HEAP_LOAD((max>>2)*4,4,1);var cookie2=SAFE_HEAP_LOAD((max+4>>2)*4,4,1);if(cookie1!=34821223||cookie2!=2310721022){abort("Stack overflow! Stack cookie has been overwritten at "+ptrToString(max)+", expected hex dwords 0x89BACDFE and 0x2135467, but received "+ptrToString(cookie2)+" "+ptrToString(cookie1))}}(function(){var h16=new Int16Array(1);var h8=new Int8Array(h16.buffer);h16[0]=25459;if(h8[0]!==115||h8[1]!==99)throw"Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)"})();var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATPOSTRUN__=[];var __RELOC_FUNCS__=[];var runtimeInitialized=false;function keepRuntimeAlive(){return noExitRuntime}function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){assert(!runtimeInitialized);runtimeInitialized=true;checkStackCookie();___set_stack_limits(_emscripten_stack_get_base(),_emscripten_stack_get_end());callRuntimeCallbacks(__RELOC_FUNCS__);if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();FS.ignorePermissions=false;TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){checkStackCookie();callRuntimeCallbacks(__ATMAIN__)}function postRun(){checkStackCookie();if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}assert(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;var runDependencyTracking={};function getUniqueRunDependency(id){var orig=id;while(1){if(!runDependencyTracking[id])return id;id=orig+Math.random()}}function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(id){assert(!runDependencyTracking[id]);runDependencyTracking[id]=1;if(runDependencyWatcher===null&&typeof setInterval!="undefined"){runDependencyWatcher=setInterval(function(){if(ABORT){clearInterval(runDependencyWatcher);runDependencyWatcher=null;return}var shown=false;for(var dep in runDependencyTracking){if(!shown){shown=true;err("still waiting on run dependencies:")}err("dependency: "+dep)}if(shown){err("(end of list)")}},1e4)}}else{err("warning: run dependency added without ID")}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(id){assert(runDependencyTracking[id]);delete runDependencyTracking[id]}else{err("warning: run dependency removed without ID")}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}what="Aborted("+what+")";err(what);ABORT=true;EXITSTATUS=1;var e=new WebAssembly.RuntimeError(what);readyPromiseReject(e);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}function createExportWrapper(name,fixedasm){return function(){var displayName=name;var asm=fixedasm;if(!fixedasm){asm=Module["asm"]}assert(runtimeInitialized,"native function `"+displayName+"` called before runtime initialization");if(!asm[name]){assert(asm[name],"exported native function `"+displayName+"` not found")}return asm[name].apply(null,arguments)}}var wasmBinaryFile;wasmBinaryFile="functions.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}throw"both async and sync fetching of the wasm failed"}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch=="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"env":asmLibraryArg,"wasi_snapshot_preview1":asmLibraryArg,"GOT.mem":new Proxy(asmLibraryArg,GOTHandler),"GOT.func":new Proxy(asmLibraryArg,GOTHandler)};function receiveInstance(instance,module){var exports=instance.exports;exports=relocateExports(exports,1024);var metadata=getDylinkMetadata(module);if(metadata.neededDynlibs){dynamicLibraries=metadata.neededDynlibs.concat(dynamicLibraries)}mergeLibSymbols(exports,"main");Module["asm"]=exports;addOnInit(Module["asm"]["__wasm_call_ctors"]);__RELOC_FUNCS__.push(Module["asm"]["__wasm_apply_data_relocs"]);removeRunDependency("wasm-instantiate")}addRunDependency("wasm-instantiate");var trueModule=Module;function receiveInstantiationResult(result){assert(Module===trueModule,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?");trueModule=null;receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info)}).then(function(instance){return instance}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);if(isFileURI(wasmBinaryFile)){err("warning: Loading from a file URI ("+wasmBinaryFile+") 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")}abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&!ENVIRONMENT_IS_NODE&&typeof fetch=="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);readyPromiseReject(e)}}instantiateAsync().catch(readyPromiseReject);return{}}var tempDouble;var tempI64;var ASM_CONSTS={41948:$0=>{let result=Emval.toValue($0);$("#ihs-wasm-filesystem-demo").append(`<div class="module-export my-1">c++ loading external file: <span class = "module-export-return rounded-pill">${JSON.stringify(result)}</span></div>`)},42174:$0=>{let result=Emval.toValue($0);$("#ihs-wasm-filesystem-demo").append(`<div class="module-export my-1">c++ loading external file: <span class = "module-export-return rounded-pill"> there was an error here: ${JSON.stringify(result)}</span></div>`)},42426:$0=>{let result=Emval.toValue($0);$("#ihs-wasm-side-modules-demo").append(`<div class="module-export my-1">c++ return from side-module: <span class = "module-export-return rounded-pill">${result.func_return}</span></div>`);$("#ihs-wasm-side-modules-demo").append(`<div class="module-export my-1">c++ return from side-module: <span class = "module-export-return rounded-pill">${result.module_info}</span></div>`)},42842:$0=>{let result=Emval.toValue($0);console.log(result)},42899:()=>{FS.mkdir("ihs_wasm");FS.mount(IDBFS,{},"ihs_wasm");FS.syncfs(true,function(err){assert(!err);ccall("createFile","v")});FS.mkdir("ihs_wasm_1");FS.mount(IDBFS,{},"ihs_wasm_1");FS.syncfs(true,function(err){assert(!err)})},43140:$0=>{let result=Emval.toValue($0);console.log(result)},43197:$0=>{pageWasmSettings.push(JSON.parse(Emval.toValue($0).module))}};function readDomElements(selector){let text=$(UTF8ToString(selector)).text();$("#ihs-wasm-functions-demo").append('<div id="div-added-by-cpp">jQuery executed in C++ (this is a DOM element added from C++)</div>');return Emval.toHandle(text)}function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var GOT={};var CurrentModuleWeakSymbols=new Set([]);var GOTHandler={get:function(obj,symName){var rtn=GOT[symName];if(!rtn){rtn=GOT[symName]=new WebAssembly.Global({"value":"i32","mutable":true})}if(!CurrentModuleWeakSymbols.has(symName)){rtn.required=true}return rtn}};function callRuntimeCallbacks(callbacks){while(callbacks.length>0){callbacks.shift()(Module)}}function withStackSave(f){var stack=stackSave();var ret=f();stackRestore(stack);return ret}function demangle(func){demangle.recursionGuard=(demangle.recursionGuard|0)+1;if(demangle.recursionGuard>1)return func;assert(___cxa_demangle);return withStackSave(function(){try{var s=func;if(s.startsWith("__Z"))s=s.substr(1);var len=lengthBytesUTF8(s)+1;var buf=stackAlloc(len);stringToUTF8(s,buf,len);var status=stackAlloc(4);var ret=___cxa_demangle(buf,0,0,status);if(SAFE_HEAP_LOAD((status>>2)*4,4,0)===0&&ret){return UTF8ToString(ret)}}catch(e){}finally{_free(ret);if(demangle.recursionGuard<2)--demangle.recursionGuard}return func})}function getDylinkMetadata(binary){var offset=0;var end=0;function getU8(){return binary[offset++]}function getLEB(){var ret=0;var mul=1;while(1){var byte=binary[offset++];ret+=(byte&127)*mul;mul*=128;if(!(byte&128))break}return ret}function getString(){var len=getLEB();offset+=len;return UTF8ArrayToString(binary,offset-len,len)}function failIf(condition,message){if(condition)throw new Error(message)}var name="dylink.0";if(binary instanceof WebAssembly.Module){var dylinkSection=WebAssembly.Module.customSections(binary,name);if(dylinkSection.length===0){name="dylink";dylinkSection=WebAssembly.Module.customSections(binary,name)}failIf(dylinkSection.length===0,"need dylink section");binary=new Uint8Array(dylinkSection[0]);end=binary.length}else{var int32View=new Uint32Array(new Uint8Array(binary.subarray(0,24)).buffer);var magicNumberFound=int32View[0]==1836278016;failIf(!magicNumberFound,"need to see wasm magic number");failIf(binary[8]!==0,"need the dylink section to be first");offset=9;var section_size=getLEB();end=offset+section_size;name=getString()}var customSection={neededDynlibs:[],tlsExports:new Set,weakImports:new Set};if(name=="dylink"){customSection.memorySize=getLEB();customSection.memoryAlign=getLEB();customSection.tableSize=getLEB();customSection.tableAlign=getLEB();var neededDynlibsCount=getLEB();for(var i=0;i<neededDynlibsCount;++i){var libname=getString();customSection.neededDynlibs.push(libname)}}else{failIf(name!=="dylink.0");var WASM_DYLINK_MEM_INFO=1;var WASM_DYLINK_NEEDED=2;var WASM_DYLINK_EXPORT_INFO=3;var WASM_DYLINK_IMPORT_INFO=4;var WASM_SYMBOL_TLS=256;var WASM_SYMBOL_BINDING_MASK=3;var WASM_SYMBOL_BINDING_WEAK=1;while(offset<end){var subsectionType=getU8();var subsectionSize=getLEB();if(subsectionType===WASM_DYLINK_MEM_INFO){customSection.memorySize=getLEB();customSection.memoryAlign=getLEB();customSection.tableSize=getLEB();customSection.tableAlign=getLEB()}else if(subsectionType===WASM_DYLINK_NEEDED){var neededDynlibsCount=getLEB();for(var i=0;i<neededDynlibsCount;++i){libname=getString();customSection.neededDynlibs.push(libname)}}else if(subsectionType===WASM_DYLINK_EXPORT_INFO){var count=getLEB();while(count--){var symname=getString();var flags=getLEB();if(flags&WASM_SYMBOL_TLS){customSection.tlsExports.add(symname)}}}else if(subsectionType===WASM_DYLINK_IMPORT_INFO){var count=getLEB();while(count--){var modname=getString();var symname=getString();var flags=getLEB();if((flags&WASM_SYMBOL_BINDING_MASK)==WASM_SYMBOL_BINDING_WEAK){customSection.weakImports.add(symname)}}}else{err("unknown dylink.0 subsection: "+subsectionType);offset+=subsectionSize}}}var tableAlign=Math.pow(2,customSection.tableAlign);assert(tableAlign===1,"invalid tableAlign "+tableAlign);assert(offset==end);return customSection}function getValue_safe(ptr,type){switch(type){case"i1":return HEAP8[ptr>>0];case"i8":return HEAP8[ptr>>0];case"i16":return HEAP16[ptr>>1];case"i32":return HEAP32[ptr>>2];case"i64":return HEAP32[ptr>>2];case"float":return HEAPF32[ptr>>2];case"double":return HEAPF64[ptr>>3];default:abort("invalid type for getValue: "+type)}}function asmjsMangle(x){var unmangledSymbols=["stackAlloc","stackSave","stackRestore","getTempRet0","setTempRet0"];return x.indexOf("dynCall_")==0||unmangledSymbols.includes(x)?x:"_"+x}function mergeLibSymbols(exports,libName){for(var sym in exports){if(!exports.hasOwnProperty(sym)){continue}if(!asmLibraryArg.hasOwnProperty(sym)){asmLibraryArg[sym]=exports[sym]}var module_sym=asmjsMangle(sym);if(!Module.hasOwnProperty(module_sym)){Module[module_sym]=exports[sym]}}}var LDSO={loadedLibsByName:{},loadedLibsByHandle:{}};function dynCallLegacy(sig,ptr,args){assert("dynCall_"+sig in Module,"bad function pointer type - dynCall function not found for sig '"+sig+"'");if(args&&args.length){assert(args.length===sig.substring(1).replace(/j/g,"--").length)}else{assert(sig.length==1)}var f=Module["dynCall_"+sig];return args&&args.length?f.apply(null,[ptr].concat(args)):f.call(null,ptr)}var wasmTableMirror=[];function getWasmTableEntry(funcPtr){var func=wasmTableMirror[funcPtr];if(!func){if(funcPtr>=wasmTableMirror.length)wasmTableMirror.length=funcPtr+1;wasmTableMirror[funcPtr]=func=wasmTable.get(funcPtr)}assert(wasmTable.get(funcPtr)==func,"JavaScript-side Wasm function table mirror is out of date!");return func}function dynCall(sig,ptr,args){if(sig.includes("j")){return dynCallLegacy(sig,ptr,args)}assert(getWasmTableEntry(ptr),"missing table entry in dynCall: "+ptr);var rtn=getWasmTableEntry(ptr).apply(null,args);return rtn}function createInvokeFunction(sig){return function(){var sp=stackSave();try{return dynCall(sig,arguments[0],Array.prototype.slice.call(arguments,1))}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}}var ___heap_base=5288960;function zeroMemory(address,size){HEAPU8.fill(0,address,address+size);return address}function getMemory(size){if(runtimeInitialized){return zeroMemory(_malloc(size),size)}var ret=___heap_base;var end=ret+size+15&-16;assert(end<=HEAP8.length,"failure to getMemory - memory growth etc. is not supported there, call malloc/sbrk directly or increase INITIAL_MEMORY");___heap_base=end;GOT["__heap_base"].value=end;return ret}function isInternalSym(symName){return["__cpp_exception","__c_longjmp","__wasm_apply_data_relocs","__dso_handle","__tls_size","__tls_align","__set_stack_limits","_emscripten_tls_init","__wasm_init_tls","__wasm_call_ctors"].includes(symName)}function uleb128Encode(n,target){assert(n<16384);if(n<128){target.push(n)}else{target.push(n%128|128,n>>7)}}function sigToWasmTypes(sig){var typeNames={"i":"i32","j":"i32","f":"f32","d":"f64","p":"i32"};var type={parameters:[],results:sig[0]=="v"?[]:[typeNames[sig[0]]]};for(var i=1;i<sig.length;++i){assert(sig[i]in typeNames,"invalid signature char: "+sig[i]);type.parameters.push(typeNames[sig[i]]);if(sig[i]==="j"){type.parameters.push("i32")}}return type}function generateFuncType(sig,target){var sigRet=sig.slice(0,1);var sigParam=sig.slice(1);var typeCodes={"i":127,"p":127,"j":126,"f":125,"d":124};target.push(96);uleb128Encode(sigParam.length,target);for(var i=0;i<sigParam.length;++i){assert(sigParam[i]in typeCodes,"invalid signature char: "+sigParam[i]);target.push(typeCodes[sigParam[i]])}if(sigRet=="v"){target.push(0)}else{target.push(1,typeCodes[sigRet])}}function convertJsFunctionToWasm(func,sig){if(typeof WebAssembly.Function=="function"){return new WebAssembly.Function(sigToWasmTypes(sig),func)}var typeSectionBody=[1];generateFuncType(sig,typeSectionBody);var bytes=[0,97,115,109,1,0,0,0,1];uleb128Encode(typeSectionBody.length,bytes);bytes.push.apply(bytes,typeSectionBody);bytes.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var module=new WebAssembly.Module(new Uint8Array(bytes));var instance=new WebAssembly.Instance(module,{"e":{"f":func}});var wrappedFunc=instance.exports["f"];return wrappedFunc}function updateTableMap(offset,count){if(functionsInTableMap){for(var i=offset;i<offset+count;i++){var item=getWasmTableEntry(i);if(item){functionsInTableMap.set(item,i)}}}}var functionsInTableMap=undefined;var freeTableIndexes=[];function getEmptyTableSlot(){if(freeTableIndexes.length){return freeTableIndexes.pop()}try{wasmTable.grow(1)}catch(err){if(!(err instanceof RangeError)){throw err}throw"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH."}return wasmTable.length-1}function setWasmTableEntry(idx,func){wasmTable.set(idx,func);wasmTableMirror[idx]=wasmTable.get(idx)}function addFunction(func,sig){assert(typeof func!="undefined");if(!functionsInTableMap){functionsInTableMap=new WeakMap;updateTableMap(0,wasmTable.length)}if(functionsInTableMap.has(func)){return functionsInTableMap.get(func)}var ret=getEmptyTableSlot();try{setWasmTableEntry(ret,func)}catch(err){if(!(err instanceof TypeError)){throw err}assert(typeof sig!="undefined","Missing signature argument to addFunction: "+func);var wrapped=convertJsFunctionToWasm(func,sig);setWasmTableEntry(ret,wrapped)}functionsInTableMap.set(func,ret);return ret}function updateGOT(exports,replace){for(var symName in exports){if(isInternalSym(symName)){continue}var value=exports[symName];if(symName.startsWith("orig$")){symName=symName.split("$")[1];replace=true}if(!GOT[symName]){GOT[symName]=new WebAssembly.Global({"value":"i32","mutable":true})}if(replace||GOT[symName].value==0){if(typeof value=="function"){GOT[symName].value=addFunction(value)}else if(typeof value=="number"){GOT[symName].value=value}else{err("unhandled export type for `"+symName+"`: "+typeof value)}}}}function relocateExports(exports,memoryBase,replace){var relocated={};for(var e in exports){var value=exports[e];if(typeof value=="object"){value=value.value}if(typeof value=="number"){value+=memoryBase}relocated[e]=value}updateGOT(relocated,replace);return relocated}function resolveGlobalSymbol(symName,direct){var sym;if(direct){sym=asmLibraryArg["orig$"+symName]}if(!sym){sym=asmLibraryArg[symName];if(sym&&sym.stub)sym=undefined}if(!sym){sym=Module[asmjsMangle(symName)]}if(!sym&&symName.startsWith("invoke_")){sym=createInvokeFunction(symName.split("_")[1])}if(!sym&&symName.startsWith("__cxa_find_matching_catch")){sym=Module["___cxa_find_matching_catch"]}return sym}function alignMemory(size,alignment){assert(alignment,"alignment argument is required");return Math.ceil(size/alignment)*alignment}function loadWebAssemblyModule(binary,flags,handle){var metadata=getDylinkMetadata(binary);CurrentModuleWeakSymbols=metadata.weakImports;var originalTable=wasmTable;function loadModule(){var needsAllocation=!handle||!SAFE_HEAP_LOAD(handle+24>>0,1,0);if(needsAllocation){var memAlign=Math.pow(2,metadata.memoryAlign);memAlign=Math.max(memAlign,STACK_ALIGN);var memoryBase=metadata.memorySize?alignMemory(getMemory(metadata.memorySize+memAlign),memAlign):0;var tableBase=metadata.tableSize?wasmTable.length:0;if(handle){SAFE_HEAP_STORE(handle+24>>0,1,1);SAFE_HEAP_STORE((handle+28>>2)*4,memoryBase,4);SAFE_HEAP_STORE((handle+32>>2)*4,metadata.memorySize,4);SAFE_HEAP_STORE((handle+36>>2)*4,tableBase,4);SAFE_HEAP_STORE((handle+40>>2)*4,metadata.tableSize,4)}}else{memoryBase=SAFE_HEAP_LOAD((handle+28>>2)*4,4,1);tableBase=SAFE_HEAP_LOAD((handle+36>>2)*4,4,1)}var tableGrowthNeeded=tableBase+metadata.tableSize-wasmTable.length;if(tableGrowthNeeded>0){wasmTable.grow(tableGrowthNeeded)}var moduleExports;function resolveSymbol(sym){var resolved=resolveGlobalSymbol(sym,false);if(!resolved){resolved=moduleExports[sym]}assert(resolved,"undefined symbol `"+sym+"`. perhaps a side module was not linked in? if this global was expected to arrive from a system library, try to build the MAIN_MODULE with EMCC_FORCE_STDLIBS=1 in the environment");return resolved}var proxyHandler={"get":function(stubs,prop){switch(prop){case"__memory_base":return memoryBase;case"__table_base":return tableBase}if(prop in asmLibraryArg){return asmLibraryArg[prop]}if(!(prop in stubs)){var resolved;stubs[prop]=function(){if(!resolved)resolved=resolveSymbol(prop);return resolved.apply(null,arguments)}}return stubs[prop]}};var proxy=new Proxy({},proxyHandler);var info={"GOT.mem":new Proxy({},GOTHandler),"GOT.func":new Proxy({},GOTHandler),"env":proxy,wasi_snapshot_preview1:proxy};function postInstantiation(instance){assert(wasmTable===originalTable);updateTableMap(tableBase,metadata.tableSize);moduleExports=relocateExports(instance.exports,memoryBase);if(!flags.allowUndefined){reportUndefinedSymbols()}if(moduleExports["__set_stack_limits"]){moduleExports["__set_stack_limits"](_emscripten_stack_get_base(),_emscripten_stack_get_end())}var applyRelocs=moduleExports["__wasm_apply_data_relocs"];if(applyRelocs){if(runtimeInitialized){applyRelocs()}else{__RELOC_FUNCS__.push(applyRelocs)}}var init=moduleExports["__wasm_call_ctors"];if(init){if(runtimeInitialized){init()}else{__ATINIT__.push(init)}}return moduleExports}if(flags.loadAsync){if(binary instanceof WebAssembly.Module){var instance=new WebAssembly.Instance(binary,info);return Promise.resolve(postInstantiation(instance))}return WebAssembly.instantiate(binary,info).then(function(result){return postInstantiation(result.instance)})}var module=binary instanceof WebAssembly.Module?binary:new WebAssembly.Module(binary);var instance=new WebAssembly.Instance(module,info);return postInstantiation(instance)}if(flags.loadAsync){return metadata.neededDynlibs.reduce(function(chain,dynNeeded){return chain.then(function(){return loadDynamicLibrary(dynNeeded,flags)})},Promise.resolve()).then(function(){return loadModule()})}metadata.neededDynlibs.forEach(function(dynNeeded){loadDynamicLibrary(dynNeeded,flags)});return loadModule()}function loadDynamicLibrary(lib,flags,handle){flags=flags||{global:true,nodelete:true};var dso=LDSO.loadedLibsByName[lib];if(dso){if(flags.global&&!dso.global){dso.global=true;if(dso.module!=="loading"){mergeLibSymbols(dso.module,lib)}}if(flags.nodelete&&dso.refcount!==Infinity){dso.refcount=Infinity}dso.refcount++;if(handle){LDSO.loadedLibsByHandle[handle]=dso}return flags.loadAsync?Promise.resolve(true):true}dso={refcount:flags.nodelete?Infinity:1,name:lib,module:"loading",global:flags.global};LDSO.loadedLibsByName[lib]=dso;if(handle){LDSO.loadedLibsByHandle[handle]=dso}function loadLibData(libFile){if(flags.fs&&flags.fs.findObject(libFile)){var libData=flags.fs.readFile(libFile,{encoding:"binary"});if(!(libData instanceof Uint8Array)){libData=new Uint8Array(libData)}return flags.loadAsync?Promise.resolve(libData):libData}if(flags.loadAsync){return new Promise(function(resolve,reject){readAsync(libFile,data=>resolve(new Uint8Array(data)),reject)})}if(!readBinary){throw new Error(libFile+": file not found, and synchronous loading of external files is not available")}return readBinary(libFile)}function getLibModule(){if(typeof preloadedWasm!="undefined"&&preloadedWasm[lib]){var libModule=preloadedWasm[lib];return flags.loadAsync?Promise.resolve(libModule):libModule}if(flags.loadAsync){return loadLibData(lib).then(function(libData){return loadWebAssemblyModule(libData,flags,handle)})}return loadWebAssemblyModule(loadLibData(lib),flags,handle)}function moduleLoaded(libModule){if(dso.global){mergeLibSymbols(libModule,lib)}dso.module=libModule}if(flags.loadAsync){return getLibModule().then(function(libModule){moduleLoaded(libModule);return true})}moduleLoaded(getLibModule());return true}function reportUndefinedSymbols(){for(var symName in GOT){if(GOT[symName].value==0){var value=resolveGlobalSymbol(symName,true);if(!value&&!GOT[symName].required){continue}assert(value,"undefined symbol `"+symName+"`. perhaps a side module was not linked in? if this global was expected to arrive from a system library, try to build the MAIN_MODULE with EMCC_FORCE_STDLIBS=1 in the environment");if(typeof value=="function"){GOT[symName].value=addFunction(value,value.sig)}else if(typeof value=="number"){GOT[symName].value=value}else{throw new Error("bad export type for `"+symName+"`: "+typeof value)}}}}function preloadDylibs(){if(!dynamicLibraries.length){reportUndefinedSymbols();return}addRunDependency("preloadDylibs");dynamicLibraries.reduce(function(chain,lib){return chain.then(function(){return loadDynamicLibrary(lib,{loadAsync:true,global:true,nodelete:true,allowUndefined:true})})},Promise.resolve()).then(function(){reportUndefinedSymbols();removeRunDependency("preloadDylibs")})}function ptrToString(ptr){return"0x"+ptr.toString(16).padStart(8,"0")}function setValue_safe(ptr,value,type){switch(type){case"i1":HEAP8[ptr>>0]=value;break;case"i8":HEAP8[ptr>>0]=value;break;case"i16":HEAP16[ptr>>1]=value;break;case"i32":HEAP32[ptr>>2]=value;break;case"i64":tempI64=[value>>>0,(tempDouble=value,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[ptr>>2]=tempI64[0],HEAP32[ptr+4>>2]=tempI64[1];break;case"float":HEAPF32[ptr>>2]=value;break;case"double":HEAPF64[ptr>>3]=value;break;default:abort("invalid type for setValue: "+type)}}function jsStackTrace(){var error=new Error;if(!error.stack){try{throw new Error}catch(e){error=e}if(!error.stack){return"(no stack trace available)"}}return error.stack.toString()}function demangleAll(text){var regex=/\b_Z[\w\d_]+/g;return text.replace(regex,function(x){var y=demangle(x);return x===y?x:y+" ["+x+"]"})}function unSign(value,bits){if(value>=0){return value}return bits<=32?2*Math.abs(1<<bits-1)+value:Math.pow(2,bits)+value}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;if(ENVIRONMENT_IS_NODE)text="warning: "+text;err(text)}}function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}___assert_fail.sig="vppip";function ___cxa_allocate_exception(size){return _malloc(size+24)+24}Module["___cxa_allocate_exception"]=___cxa_allocate_exception;___cxa_allocate_exception.sig="pp";var exceptionCaught=[];function exception_addRef(info){info.add_ref()}var uncaughtExceptionCount=0;function ___cxa_begin_catch(ptr){var info=new ExceptionInfo(ptr);if(!info.get_caught()){info.set_caught(true);uncaughtExceptionCount--}info.set_rethrown(false);exceptionCaught.push(info);exception_addRef(info);return info.get_exception_ptr()}___cxa_begin_catch.sig="pp";var exceptionLast=0;function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-24;this.set_type=function(type){SAFE_HEAP_STORE((this.ptr+4>>2)*4,type,4)};this.get_type=function(){return SAFE_HEAP_LOAD((this.ptr+4>>2)*4,4,1)};this.set_destructor=function(destructor){SAFE_HEAP_STORE((this.ptr+8>>2)*4,destructor,4)};this.get_destructor=function(){return SAFE_HEAP_LOAD((this.ptr+8>>2)*4,4,1)};this.set_refcount=function(refcount){SAFE_HEAP_STORE((this.ptr>>2)*4,refcount,4)};this.set_caught=function(caught){caught=caught?1:0;SAFE_HEAP_STORE(this.ptr+12>>0,caught,1)};this.get_caught=function(){return SAFE_HEAP_LOAD(this.ptr+12>>0,1,0)!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;SAFE_HEAP_STORE(this.ptr+13>>0,rethrown,1)};this.get_rethrown=function(){return SAFE_HEAP_LOAD(this.ptr+13>>0,1,0)!=0};this.init=function(type,destructor){this.set_adjusted_ptr(0);this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){var value=SAFE_HEAP_LOAD((this.ptr>>2)*4,4,0);SAFE_HEAP_STORE((this.ptr>>2)*4,value+1,4)};this.release_ref=function(){var prev=SAFE_HEAP_LOAD((this.ptr>>2)*4,4,0);SAFE_HEAP_STORE((this.ptr>>2)*4,prev-1,4);assert(prev>0);return prev===1};this.set_adjusted_ptr=function(adjustedPtr){SAFE_HEAP_STORE((this.ptr+16>>2)*4,adjustedPtr,4)};this.get_adjusted_ptr=function(){return SAFE_HEAP_LOAD((this.ptr+16>>2)*4,4,1)};this.get_exception_ptr=function(){var isPointer=Module["___cxa_is_pointer_type"](this.get_type());if(isPointer){return SAFE_HEAP_LOAD((this.excPtr>>2)*4,4,1)}var adjusted=this.get_adjusted_ptr();if(adjusted!==0)return adjusted;return this.excPtr}}function ___cxa_free_exception(ptr){try{return _free(new ExceptionInfo(ptr).ptr)}catch(e){err("exception during __cxa_free_exception: "+e)}}___cxa_free_exception.sig="vp";function exception_decRef(info){if(info.release_ref()&&!info.get_rethrown()){var destructor=info.get_destructor();if(destructor){getWasmTableEntry(destructor)(info.excPtr)}___cxa_free_exception(info.excPtr)}}function ___cxa_end_catch(){_setThrew(0);assert(exceptionCaught.length>0);var info=exceptionCaught.pop();exception_decRef(info);exceptionLast=0}___cxa_end_catch.sig="v";function ___resumeException(ptr){if(!exceptionLast){exceptionLast=ptr}throw ptr}___resumeException.sig="vp";function ___cxa_find_matching_catch_2(){var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0}var info=new ExceptionInfo(thrown);info.set_adjusted_ptr(thrown);var thrownType=info.get_type();if(!thrownType){setTempRet0(0);return thrown}for(var i=0;i<arguments.length;i++){var caughtType=arguments[i];if(caughtType===0||caughtType===thrownType){break}var adjusted_ptr_addr=info.ptr+16;if(Module["___cxa_can_catch"](caughtType,thrownType,adjusted_ptr_addr)){setTempRet0(caughtType);return thrown}}setTempRet0(thrownType);return thrown}___cxa_find_matching_catch_2.sig="ppp";function ___cxa_find_matching_catch_3(){var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0}var info=new ExceptionInfo(thrown);info.set_adjusted_ptr(thrown);var thrownType=info.get_type();if(!thrownType){setTempRet0(0);return thrown}for(var i=0;i<arguments.length;i++){var caughtType=arguments[i];if(caughtType===0||caughtType===thrownType){break}var adjusted_ptr_addr=info.ptr+16;if(Module["___cxa_can_catch"](caughtType,thrownType,adjusted_ptr_addr)){setTempRet0(caughtType);return thrown}}setTempRet0(thrownType);return thrown}___cxa_find_matching_catch_3.sig="pppp";function ___cxa_rethrow(){var info=exceptionCaught.pop();if(!info){abort("no exception to throw")}var ptr=info.excPtr;if(!info.get_rethrown()){exceptionCaught.push(info);info.set_rethrown(true);info.set_caught(false);uncaughtExceptionCount++}exceptionLast=ptr;throw ptr}___cxa_rethrow.sig="v";function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}Module["___cxa_throw"]=___cxa_throw;___cxa_throw.sig="vppp";function ___cxa_uncaught_exceptions(){return uncaughtExceptionCount}function ___handle_stack_overflow(requested){requested=requested>>>0;abort("stack overflow (Attempt to set SP to "+ptrToString(requested)+", with stack limits ["+ptrToString(_emscripten_stack_get_end())+" - "+ptrToString(_emscripten_stack_get_base())+"])")}Module["___handle_stack_overflow"]=___handle_stack_overflow;___handle_stack_overflow.sig="vp";var ___memory_base=new WebAssembly.Global({"value":"i32","mutable":false},1024);Module["___memory_base"]=___memory_base;var ___stack_high=5288960;var ___stack_low=46080;var ___stack_pointer=new WebAssembly.Global({"value":"i32","mutable":true},5288960);Module["___stack_pointer"]=___stack_pointer;function setErrNo(value){SAFE_HEAP_STORE((___errno_location()>>2)*4,value,4);return value}var PATH={isAbs:path=>path.charAt(0)==="/",sp