php-wasm
Version:
Run PHP right in the browser or anywhere else JS can run.
8 lines (5 loc) • 195 kB
JavaScript
var PHP = (() => {
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
return (
function(moduleArg = {}) {
var Module=moduleArg;var readyPromiseResolve,readyPromiseReject;Module["ready"]=new Promise(((resolve,reject)=>{readyPromiseResolve=resolve;readyPromiseReject=reject}));["_pib_init","_pib_destroy","_pib_run","_pib_exec","_pib_refresh","_main","_php_embed_init","_php_embed_shutdown","_zend_eval_string","_vrzno_expose_inc_zrefcount","_vrzno_expose_dec_zrefcount","_vrzno_expose_zrefcount","_vrzno_expose_inc_crefcount","_vrzno_expose_dec_crefcount","_vrzno_expose_crefcount","_vrzno_expose_efree","_vrzno_expose_create_bool","_vrzno_expose_create_null","_vrzno_expose_create_undef","_vrzno_expose_create_long","_vrzno_expose_create_double","_vrzno_expose_create_string","_vrzno_expose_create_object_for_target","_vrzno_expose_create_params","_vrzno_expose_set_param","_vrzno_expose_zval_is_target","_vrzno_expose_object_keys","_vrzno_expose_zval_dump","_vrzno_expose_type","_vrzno_expose_callable","_vrzno_expose_long","_vrzno_expose_double","_vrzno_expose_string","_vrzno_expose_property_pointer","_vrzno_exec_callback","_vrzno_del_callback","_fflush","_pib_tokenize","_exec_callback","_del_callback","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")})}}));Module.WeakerMap=Module.WeakerMap||class WeakerMap{constructor(entries){this.registry=new FinReg((held=>this.delete(held)));this.map=new Map;entries&&entries.forEach((([key,value])=>this.set(key,value)))}get size(){return this.map.size}clear(){this.map.clear()}delete(key){this.map.delete(key)}[Symbol.iterator](){const mapIterator=this.map[Symbol.iterator]();return{next:()=>{do{const entry=mapIterator.next();if(entry.done){return{done:true}}const[key,ref]=entry.value;const value=ref.deref();if(!value){this.map.delete(key);continue}return{done:false,value:[key,value]}}while(true)}}}entries(){return{[Symbol.iterator]:()=>this[Symbol.iterator]()}}forEach(callback){for(const[k,v]of this){callback(v,k,this)}}get(key){if(!this.has(key)){return}return this.map.get(key).deref()}has(key){if(!this.map.has(key)){return false}const result=this.map.get(key).deref();if(!result){this.map.delete(key)}return result}keys(){return[...this].map((v=>v[0]))}set(key,value){if(typeof value!=="function"&&typeof value!=="object"){throw new Error("WeakerMap values must be objects.")}if(this.map.has(key)){this.registry.unregister(this.get(key))}this.registry.register(value,key,value);return this.map.set(key,new wRef(value))}values(){return[...this].map((v=>v[1]))}};const FinReg=globalThis.FinalizationRegistry||class{register(){}unregister(){}};const wRef=globalThis.WeakRef||class{constructor(val){this.val=val}deref(){return this.val}};Module.UniqueIndex=Module.UniqueIndex||class UniqueIndex{constructor(){this.byObject=new WeakMap;this.byInteger=new Module.WeakerMap;this.id=0;Object.defineProperty(this,"clear",{configurable:false,writable:false,value:()=>{this.byInteger.clear()}});Object.defineProperty(this,"add",{configurable:false,writable:false,value:callback=>{if(this.byObject.has(callback)){const id=this.byObject.get(callback);return id}const newid=++this.id;this.byObject.set(callback,newid);this.byInteger.set(newid,callback);return newid}});Object.defineProperty(this,"has",{configurable:false,writable:false,value:obj=>{if(this.byObject.has(obj)){const id=this.byObject.get(obj);return this.byInteger.has(id)}}});Object.defineProperty(this,"hasId",{configurable:false,writable:false,value:address=>{if(this.byInteger.has(address)){return this.byInteger.get(address)}}});Object.defineProperty(this,"get",{configurable:false,writable:false,value:address=>{if(this.byInteger.has(address)){return this.byInteger.get(address)}}});Object.defineProperty(this,"getId",{configurable:false,writable:false,value:obj=>{if(this.byObject.has(obj)){return this.byObject.get(obj)}}});Object.defineProperty(this,"remove",{configurable:false,writable:false,value:address=>{const obj=this.byInteger.get(address);if(obj){this.byObject.delete(obj);this.byInteger.delete(address)}}})}};const zvalSym=Symbol("ZVAL");Module.marshalObject=zvalPtr=>{const nativeTarget=Module.ccall("vrzno_expose_zval_is_target","number",["number"],[zvalPtr]);if(nativeTarget&&Module.targets.hasId(nativeTarget)){return Module.targets.get(nativeTarget)}const proxy=new Proxy({},{ownKeys:target=>{const keysLoc=Module.ccall("vrzno_expose_object_keys","number",["number"],[zvalPtr]);const keyJson=UTF8ToString(keysLoc);const keys=JSON.parse(keyJson);_free(keysLoc);keys.push(...Reflect.ownKeys(target));return keys},has:(target,prop)=>{if(typeof prop==="symbol"){return false}const len=lengthBytesUTF8(prop)+1;const namePtr=_malloc(len);stringToUTF8(prop,namePtr,len);const retPtr=Module.ccall("vrzno_expose_property_pointer","number",["number","number"],[zvalPtr,namePtr]);return!!retPtr},get:(target,prop,receiver)=>{if(typeof prop==="symbol"){return target[prop]}const len=lengthBytesUTF8(prop)+1;const namePtr=_malloc(len);stringToUTF8(prop,namePtr,len);const retPtr=Module.ccall("vrzno_expose_property_pointer","number",["number","number"],[zvalPtr,namePtr]);const proxy=Module.zvalToJS(retPtr);if(proxy&&["function","object"].includes(typeof proxy)){Module.zvalMap.set(proxy,retPtr);Module._zvalMap.set(retPtr,proxy)}_free(namePtr);return proxy??Reflect.get(target,prop)},getOwnPropertyDescriptor:(target,prop)=>{if(typeof prop==="symbol"||prop in target){return Reflect.getOwnPropertyDescriptor(target,prop)}const len=lengthBytesUTF8(prop)+1;const namePtr=_malloc(len);stringToUTF8(prop,namePtr,len);const retPtr=Module.ccall("vrzno_expose_property_pointer","number",["number","number"],[zvalPtr,namePtr]);const proxy=Module.zvalToJS(retPtr);if(proxy&&["function","object"].includes(typeof proxy)){Module.zvalMap.set(proxy,retPtr);Module._zvalMap.set(retPtr,proxy)}_free(namePtr);return{configurable:true,enumerable:true,value:target[prop]}}});Object.defineProperty(proxy,zvalSym,{value:`PHP_@{${zvalPtr}}`});Module.zvalMap.set(proxy,zvalPtr);Module._zvalMap.set(zvalPtr,proxy);if(!Module.targets.has(proxy)){Module.targets.add(proxy);Module.ccall("vrzno_expose_inc_zrefcount","number",["number"],[zvalPtr]);Module.fRegistry.register(proxy,zvalPtr,proxy)}return proxy};Module.callableToJs=Module.callableToJs||(funcPtr=>{if(Module.callables.has(funcPtr)){return Module.callables.get(funcPtr)}const wrapped=(...args)=>{let paramPtrs=[],paramsPtr=null;if(args.length){paramsPtr=Module.ccall("vrzno_expose_create_params","number",["number"],[args.length]);paramPtrs=args.map((a=>Module.jsToZval(a)));paramPtrs.forEach(((paramPtr,i)=>{Module.ccall("vrzno_expose_set_param","number",["number","number","number"],[paramsPtr,i,paramPtr])}))}const zvalPtr=Module.ccall("vrzno_exec_callback","number",["number","number","number"],[funcPtr,paramsPtr,args.length]);if(args.length){paramPtrs.forEach(((p,i)=>{if(!args[i]||!["function","object"].includes(typeof args[i])){Module.ccall("vrzno_expose_efree","number",["number"],[p])}}));Module.ccall("vrzno_expose_efree","number",["number","number"],[paramsPtr,false])}if(zvalPtr){const result=Module.zvalToJS(zvalPtr);if(!result||!["function","object"].includes(typeof result)){Module.ccall("vrzno_expose_efree","number",["number"],[zvalPtr])}return result}};Object.defineProperty(wrapped,"name",{value:`PHP_@{${funcPtr}}`});Module.ccall("vrzno_expose_inc_crefcount","number",["number"],[funcPtr]);Module.callables.set(funcPtr,wrapped);return wrapped});Module.zvalToJS=Module.zvalToJS||(zvalPtr=>{if(Module._zvalMap.has(zvalPtr)){return Module._zvalMap.get(zvalPtr)}const IS_UNDEF=0;const IS_NULL=1;const IS_FALSE=2;const IS_TRUE=3;const IS_LONG=4;const IS_DOUBLE=5;const IS_STRING=6;const IS_OBJECT=8;const callable=Module.ccall("vrzno_expose_callable","number",["number"],[zvalPtr]);let valPtr;if(callable){const nativeTarget=Module.ccall("vrzno_expose_zval_is_target","number",["number"],[zvalPtr]);if(nativeTarget){return Module.targets.get(nativeTarget)}const wrapped=nativeTarget?Module.targets.get(nativeTarget):Module.callableToJs(callable);if(!Module.targets.has(wrapped)){Module.targets.add(wrapped);Module.ccall("vrzno_expose_inc_zrefcount","number",["number"],[zvalPtr])}Module.zvalMap.set(wrapped,zvalPtr);Module._zvalMap.set(zvalPtr,wrapped);Module.fRegistry.register(wrapped,zvalPtr,wrapped);return wrapped}const type=Module.ccall("vrzno_expose_type","number",["number"],[zvalPtr]);switch(type){case IS_UNDEF:return undefined;break;case IS_NULL:return null;break;case IS_TRUE:return true;break;case IS_FALSE:return false;break;case IS_LONG:return Module.ccall("vrzno_expose_long","number",["number"],[zvalPtr]);break;case IS_DOUBLE:valPtr=Module.ccall("vrzno_expose_double","number",["number"],[zvalPtr]);if(!valPtr){return null}return getValue(valPtr,"double");break;case IS_STRING:valPtr=Module.ccall("vrzno_expose_string","number",["number"],[zvalPtr]);if(!valPtr){return null}return UTF8ToString(valPtr);break;case IS_OBJECT:const proxy=Module.marshalObject(zvalPtr);return proxy;break;default:return null;break}});Module.jsToZval=Module.jsToZval||(value=>{let zvalPtr;if(typeof value==="undefined"){zvalPtr=Module.ccall("vrzno_expose_create_undef","number",[],[])}else if(value===null){zvalPtr=Module.ccall("vrzno_expose_create_null","number",[],[])}else if([true,false].includes(value)){zvalPtr=Module.ccall("vrzno_expose_create_bool","number",["number"],[value])}else if(value&&["function","object"].includes(typeof value)){let index,existed;if(!Module.targets.has(value)){index=Module.targets.add(value);existed=false}else{index=Module.targets.getId(value);existed=true}const isFunction=typeof value==="function"?index:0;const isConstructor=isFunction&&!!(value.prototype&&value.prototype.constructor);zvalPtr=Module.ccall("vrzno_expose_create_object_for_target","number",["number","number","number"],[index,isFunction,isConstructor]);Module.zvalMap.set(value,zvalPtr);Module._zvalMap.set(zvalPtr,value);if(!existed){Module.ccall("vrzno_expose_inc_zrefcount","number",["number"],[zvalPtr]);Module.fRegistry.register(value,zvalPtr,value)}}else if(typeof value==="number"){if(Number.isInteger(value)){zvalPtr=Module.ccall("vrzno_expose_create_long","number",["number"],[value])}else if(Number.isFinite(value)){zvalPtr=Module.ccall("vrzno_expose_create_double","number",["number"],[value])}}else if(typeof value==="string"){const len=lengthBytesUTF8(value)+1;const strLoc=_malloc(len);stringToUTF8(value,strLoc,len);zvalPtr=Module.ccall("vrzno_expose_create_string","number",["number"],[strLoc]);_free(strLoc)}return zvalPtr});Module.PdoD1Driver=Module.PdoD1Driver||class PdoD1Driver{prepare(db,query){console.log("prepare",{db:db,query:query});return db.prepare(query)}doer(db,query){console.log("doer",{db:db,query:query})}};HEAP8=new Int8Array(1);Module.zvalMap=new WeakMap;Module._zvalMap=Module._zvalMap||new Module.WeakerMap;Module.fRegistry=Module.fRegistry||new FinReg((zvalPtr=>{console.log("Garbage collecting! zVal@"+zvalPtr);Module.ccall("vrzno_expose_dec_zrefcount","number",["number"],[zvalPtr])}));Module.bufferMaps=new WeakMap;Module.callables=Module.callables||new Module.WeakerMap;Module.targets=Module.targets||new Module.UniqueIndex;Module.classes=Module.classes||new WeakMap;Module._classes=Module._classes||new Module.WeakerMap;Module.PdoParams=new WeakMap;Module.pdoDriver=Module.pdoDriver||new Module.PdoD1Driver;Module.targets.add(globalThis);Module.onRefresh=Module.onRefresh||new Set;Module.onRefresh.add((()=>{Module.callables.clear();Module.targets.clear();Module._classes.clear();Module._zvalMap.clear();Module.targets.byObject.set(globalThis,1);Module.targets.byInteger.set(1,globalThis)}));var moduleOverrides=Object.assign({},Module);var arguments_=[];var thisProgram="./this.program";var quit_=(status,toThrow)=>{throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;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;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_=f=>read(f)}readBinary=f=>{let data;if(typeof readbuffer=="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data=="object");return data};readAsync=(f,onload,onerror)=>{setTimeout((()=>onload(readBinary(f))))};if(typeof clearTimeout=="undefined"){globalThis.clearTimeout=id=>{}}if(typeof setTimeout=="undefined"){globalThis.setTimeout=f=>typeof f=="function"?f():abort()}if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit=="function"){quit_=(status,toThrow)=>{setTimeout((()=>{if(!(toThrow instanceof ExitStatus)){let toLog=toThrow;if(toThrow&&typeof toThrow=="object"&&toThrow.stack){toLog=[toThrow,toThrow.stack]}err(`exiting due to exception: ${toLog}`)}quit(status)}));throw toThrow}}if(typeof print!="undefined"){if(typeof console=="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!="undefined"?printErr:print}}else{throw new Error("environment detection error")}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.error.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");var IDBFS="IDBFS is no longer included by default; build with -lidbfs.js";var NODEFS="NODEFS is no longer included by default; build with -lnodefs.js";assert(!ENVIRONMENT_IS_WEB,"web environment detected but not enabled at build time. Add 'web' to `-sENVIRONMENT` to enable.");assert(!ENVIRONMENT_IS_WORKER,"worker environment detected but not enabled at build time. Add 'worker' to `-sENVIRONMENT` to enable.");assert(!ENVIRONMENT_IS_NODE,"node environment detected but not enabled at build time. Add 'node' to `-sENVIRONMENT` to enable.");assert(!ENVIRONMENT_IS_SHELL,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable.");var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];legacyModuleProp("wasmBinary","wasmBinary");var noExitRuntime=Module["noExitRuntime"]||false;legacyModuleProp("noExitRuntime","noExitRuntime");if(typeof WebAssembly!="object"){abort("no native wasm support detected")}var wasmMemory;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed"+(text?": "+text:""))}}var HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateMemoryViews(){var b=wasmMemory.buffer;Module["HEAP8"]=HEAP8=new Int8Array(b);Module["HEAP16"]=HEAP16=new Int16Array(b);Module["HEAP32"]=HEAP32=new Int32Array(b);Module["HEAPU8"]=HEAPU8=new Uint8Array(b);Module["HEAPU16"]=HEAPU16=new Uint16Array(b);Module["HEAPU32"]=HEAPU32=new Uint32Array(b);Module["HEAPF32"]=HEAPF32=new Float32Array(b);Module["HEAPF64"]=HEAPF64=new Float64Array(b)}assert(!Module["STACK_SIZE"],"STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time");assert(typeof Int32Array!="undefined"&&typeof Float64Array!=="undefined"&&Int32Array.prototype.subarray!=undefined&&Int32Array.prototype.set!=undefined,"JS engine does not provide full typed array support");assert(!Module["wasmMemory"],"Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally");assert(!Module["INITIAL_MEMORY"],"Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically");var wasmTable;function writeStackCookie(){var max=_emscripten_stack_get_end();assert((max&3)==0);if(max==0){max+=4}HEAPU32[max>>>2]=34821223;HEAPU32[max+4>>>2]=2310721022;HEAPU32[0>>>2]=1668509029}function checkStackCookie(){if(ABORT)return;var max=_emscripten_stack_get_end();if(max==0){max+=4}var cookie1=HEAPU32[max>>>2];var cookie2=HEAPU32[max+4>>>2];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)}`)}if(HEAPU32[0>>>2]!=1668509029){abort("Runtime error: The application has corrupted its heap memory area (address zero)!")}}(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 __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;var runtimeKeepaliveCounter=0;function keepRuntimeAlive(){return noExitRuntime||runtimeKeepaliveCounter>0}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();if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();FS.ignorePermissions=false;TTY.init();SOCKFS.root=FS.mount(SOCKFS,{},null);PIPEFS.root=FS.mount(PIPEFS,{},null);callRuntimeCallbacks(__ATINIT__)}function preMain(){checkStackCookie();callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){assert(!runtimeExited);Asyncify.state=Asyncify.State.Disabled;checkStackCookie();___funcs_on_exit();callRuntimeCallbacks(__ATEXIT__);FS.quit();TTY.shutdown();runtimeExited=true}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((()=>{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;if(what.indexOf("RuntimeError: unreachable")>=0){what+='. "unreachable" may be due to ASYNCIFY_STACK_SIZE not being large enough (try increasing it)'}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");assert(!runtimeExited,"native function `"+displayName+"` called after runtime exit (use NO_EXIT_RUNTIME to keep it alive after main() exits)");if(!asm[name]){assert(asm[name],"exported native function `"+displayName+"` not found")}return asm[name].apply(null,arguments)}}var wasmBinaryFile;wasmBinaryFile="php-webview.js.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinarySync(file){if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}throw"both async and sync fetching of the wasm failed"}function getBinaryPromise(binaryFile){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch=="function"&&!isFileURI(binaryFile)){return fetch(binaryFile,{credentials:"same-origin"}).then((response=>{if(!response["ok"]){throw"failed to load wasm binary file at '"+binaryFile+"'"}return response["arrayBuffer"]()})).catch((()=>getBinarySync(binaryFile)))}else if(readAsync){return new Promise(((resolve,reject)=>{readAsync(binaryFile,(response=>resolve(new Uint8Array(response))),reject)}))}}return Promise.resolve().then((()=>getBinarySync(binaryFile)))}function instantiateArrayBuffer(binaryFile,imports,receiver){return getBinaryPromise(binaryFile).then((binary=>WebAssembly.instantiate(binary,imports))).then((instance=>instance)).then(receiver,(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(binary,binaryFile,imports,callback){if(!binary&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(binaryFile)&&!isFileURI(binaryFile)&&typeof fetch=="function"){return fetch(binaryFile,{credentials:"same-origin"}).then((response=>{var result=WebAssembly.instantiateStreaming(response,imports);return result.then(callback,(function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(binaryFile,imports,callback)}))}))}return instantiateArrayBuffer(binaryFile,imports,callback)}function createWasm(){var info={"env":wasmImports,"wasi_snapshot_preview1":wasmImports};function receiveInstance(instance,module){var exports=instance.exports;exports=Asyncify.instrumentWasmExports(exports);exports=applySignatureConversions(exports);Module["asm"]=exports;wasmMemory=Module["asm"]["memory"];assert(wasmMemory,"memory not found in wasm exports");updateMemoryViews();wasmTable=Module["asm"]["__indirect_function_table"];assert(wasmTable,"table not found in wasm exports");addOnInit(Module["asm"]["__wasm_call_ctors"]);removeRunDependency("wasm-instantiate");return exports}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"])}if(Module["instantiateWasm"]){try{return Module["instantiateWasm"](info,receiveInstance)}catch(e){err("Module.instantiateWasm callback failed with error: "+e);readyPromiseReject(e)}}instantiateAsync(wasmBinary,wasmBinaryFile,info,receiveInstantiationResult).catch(readyPromiseReject);return{}}var tempDouble;var tempI64;function legacyModuleProp(prop,newName){if(!Object.getOwnPropertyDescriptor(Module,prop)){Object.defineProperty(Module,prop,{configurable:true,get(){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 missingGlobal(sym,msg){if(typeof globalThis!=="undefined"){Object.defineProperty(globalThis,sym,{configurable:true,get(){warnOnce("`"+sym+"` is not longer defined by emscripten. "+msg);return undefined}})}}missingGlobal("buffer","Please use HEAP8.buffer or wasmMemory.buffer");function missingLibrarySymbol(sym){if(typeof globalThis!=="undefined"&&!Object.getOwnPropertyDescriptor(globalThis,sym)){Object.defineProperty(globalThis,sym,{configurable:true,get(){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}})}unexportedRuntimeSymbol(sym)}function unexportedRuntimeSymbol(sym){if(!Object.getOwnPropertyDescriptor(Module,sym)){Object.defineProperty(Module,sym,{configurable:true,get(){var msg="'"+sym+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)";if(isExportedByForceFilesystem(sym)){msg+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"}abort(msg)}})}}var ASM_CONSTS={3572092:($0,$1)=>{const target=Module.targets.get($0);const property=UTF8ToString($1);if(!(property in target)){return Module.jsToZval(undefined)}if(target[property]===null){return Module.jsToZval(null)}const result=target[property];if(!result||!["function","object"].includes(typeof result)){return Module.jsToZval(result)}return 0},3572440:($0,$1,$2)=>{const target=Module.targets.get($0);const property=UTF8ToString($1);const result=target[property];const zvalPtr=$2;if(result&&["function","object"].includes(typeof result)){let index=Module.targets.getId(result);if(!Module.targets.has(result)){index=Module.targets.add(result);Module.zvalMap.set(result,zvalPtr);Module._zvalMap.set(zvalPtr,result)}return index}return 0},3572848:$0=>"function"===typeof Module.targets.get($0)?$0:0,3572916:$0=>!!(Module.targets.get($0).prototype&&Module.targets.get($0).prototype.constructor),3573017:($0,$1,$2)=>{(()=>{const target=Module.targets.get($0);const property=UTF8ToString($1)})()},3573129:($0,$1,$2,$3,$4)=>{(()=>{const target=Module.targets.get($0);const property=UTF8ToString($1);const funcPtr=$2;target[property]=Module.callableToJs(funcPtr)})()},3573332:($0,$1,$2)=>{(()=>{const target=Module.targets.get($0);const property=UTF8ToString($1);const zvalPtr=$2;if(!Module.targets.has(target[property])){target[property]=Module.marshalObject(zvalPtr)}})()},3573539:($0,$1)=>{(()=>{const target=Module.targets.get($0);const property=UTF8ToString($1);delete target[property]})()},3573655:($0,$1)=>{(()=>{const target=Module.targets.get($0);const property=UTF8ToString($1);target[property]=null})()},3573771:($0,$1)=>{(()=>{const target=Module.targets.get($0);const property=UTF8ToString($1);target[property]=false})()},3573888:($0,$1)=>{(()=>{const target=Module.targets.get($0);const property=UTF8ToString($1);target[property]=true})()},3574004:($0,$1,$2)=>{(()=>{const target=Module.targets.get($0);const property=UTF8ToString($1);target[property]=$2})()},3574118:($0,$1,$2)=>{(()=>{const target=Module.targets.get($0);const property=UTF8ToString($1);target[property]=$2})()},3574232:($0,$1,$2)=>{(()=>{const target=Module.targets.get($0);const property=UTF8ToString($1);const newValue=UTF8ToString($2);target[property]=newValue})()},3574387:($0,$1)=>{let target=Module.targets.get($0);const property=$1;if(target instanceof ArrayBuffer){if(!Module.bufferMaps.has(target)){Module.bufferMaps.set(target,new Uint8Array(target))}target=Module.bufferMaps.get(target)}if(!(property in target)){const jsRet="UN";const len=lengthBytesUTF8(jsRet)+1;const strLoc=_malloc(len);stringToUTF8(jsRet,strLoc,len);return strLoc}if(target[property]===null){const jsRet="NU";const len=lengthBytesUTF8(jsRet)+1;const strLoc=_malloc(len);stringToUTF8(jsRet,strLoc,len);return strLoc}const result=target[property];if(!result||!["function","object"].includes(typeof result)){const jsRet="OK"+String(result);const len=lengthBytesUTF8(jsRet)+1;const strLoc=_malloc(len);stringToUTF8(jsRet,strLoc,len);return strLoc}const jsRet="XX";const len=lengthBytesUTF8(jsRet)+1;const strLoc=_malloc(len);stringToUTF8(jsRet,strLoc,len);return strLoc},3575353:($0,$1,$2)=>{const target=Module.targets.get($0);const property=UTF8ToString($1);const result=target[property];const zvalPtr=$2;if(result&&["function","object"].includes(typeof result)){let index=Module.targets.getId(result);if(!Module.targets.has(result)){index=Module.targets.add(result);Module.zvalMap.set(result,zvalPtr);Module._zvalMap.set(zvalPtr,result)}return index}return 0},3575761:$0=>"function"===typeof Module.targets.get($0)?$0:0,3575829:$0=>!!(Module.targets.get($0).prototype&&Module.targets.get($0).prototype.constructor),3575930:($0,$1,$2)=>{(()=>{const target=Module.targets.get($0)})()},3576028:($0,$1,$2,$3)=>{(()=>{const target=Module.targets.get($0);const property=$1;const funcPtr=$2;target[property]=Module.callableToJs(funcPtr)})()},3576194:($0,$1,$2)=>{(()=>{const target=Module.targets.get($0);const property=$1;const zvalPtr=$2;if(!Module.targets.has(target[property])){target[property]=Module.marshalObject(zvalPtr)}})()},3576387:($0,$1)=>{(()=>{const target=Module.targets.get($0);const property=$1;delete target[property]})()},3576489:($0,$1)=>{(()=>{const target=Module.targets.get($0);const property=$1;target[property]=null})()},3576591:($0,$1)=>{(()=>{const target=Module.targets.get($0);const property=$1;target[property]=false})()},3576694:($0,$1)=>{(()=>{const target=Module.targets.get($0);const property=$1;target[property]=true})()},3576796:($0,$1,$2)=>{(()=>{const target=Module.targets.get($0);const property=$1;target[property]=$2})()},3576896:($0,$1,$2)=>{(()=>{const target=Module.targets.get($0);const property=$1;target[property]=$2})()},3576996:($0,$1,$2)=>{(()=>{const target=Module.targets.get($0);const property=$1;const newValue=UTF8ToString($2);target[property]=newValue})()},3577137:($0,$1,$2)=>{const target=Module.targets.get($0);const property=$1;const check_empty=$2;if(Array.isArray(target)){return typeof target[property]!=="undefined"}if(target instanceof ArrayBuffer){if(!Module.bufferMaps.has(target)){Module.bufferMaps.set(target,new Uint8Array(target))}const targetBytes=Module.bufferMaps.get(target);return targetBytes[property]!=="undefined"}if(!check_empty){return property in target}else{return!!target[property]}},3577616:($0,$1)=>{(()=>{const target=Module.targets.get($0);const property=UTF8ToString($1);delete target[property]})()},3577732:($0,$1)=>{(()=>{const target=Module.targets.get($0);const property=$1;delete target[property]})()},3577834:$0=>{const target=Module.targets.get($0);let json;if(typeof target==="function"){json=JSON.stringify({})}else{try{json=JSON.stringify({...target})}catch{json=JSON.stringify({})}}const jsRet=String(json);const len=lengthBytesUTF8(jsRet)+1;const strLoc=_malloc(len);stringToUTF8(jsRet,strLoc,len);return strLoc},3578186:($0,$1)=>{const target=Module.targets.get($0);const property=UTF8ToString($1);return property in target},3578291:$0=>{const target=Module.targets.get($0);const name=target.constructor&&target.constructor.name||"Object";const len=lengthBytesUTF8(name)+1;const namePtr=_malloc(name);stringToUTF8(name,namePtr,len);return namePtr},3578528:($0,$1,$2,$3,$4)=>{const target=Module.targets.get($0);const method_name=UTF8ToString($1);const argp=$2;const argc=$3;const size=$4;const args=[];for(let i=0;i<argc;i++){const loc=argp+i*size;const ptr=Module.getValue(loc,"*");const arg=Module.zvalToJS(ptr);args.push(arg)}const jsRet=target[method_name](...args);const retZval=Module.jsToZval(jsRet);return retZval},3578929:($0,$1,$2,$3)=>{const target=Module.targets.get($0);const argv=$1;const argc=$2;const size=$3;const args=[];for(let i=0;i<argc;i++){args.push(Module.zvalToJS(argv+i*size))}const jsRet=target(...args);return Module.jsToZval(jsRet)},3579181:($0,$1)=>{const target=Module.targets.get($0);const property_name=UTF8ToString($1);const jsRet=target[property_name];return Module.jsToZval(jsRet)},3579332:($0,$1,$2,$3)=>{const _class=Module._classes.get($0);const argv=$1;const argc=$2;const size=$3;const args=[];for(let i=0;i<argc;i++){args.push(Module.zvalToJS(argv+i*size))}const _object=new _class(...args);const index=Module.targets.add(_object);return index},3579617:$0=>{const jsRet=String(eval(UTF8ToString($0)));const len=lengthBytesUTF8(jsRet)+1;const strLoc=_malloc(len);stringToUTF8(jsRet,strLoc,len);return strLoc},3579785:($0,$1)=>{const funcName=UTF8ToString($0);const argJson=UTF8ToString($1);const func=globalThis[funcName];const args=JSON.parse(argJson||"[]")||[];const jsRet=String(func(...args));const len=lengthBytesUTF8(jsRet)+1;const strLoc=_malloc(len);stringToUTF8(jsRet,strLoc,len);return strLoc},3580096:($0,$1)=>{const timeout=Number(UTF8ToString($0));const funcPtr=$1;setTimeout((()=>{Module.ccall("vrzno_exec_callback","number",["number","number","number"],[funcPtr,null,0]);Module.ccall("vrzno_del_callback","number",["number"],[funcPtr])}),timeout)},3580368:$0=>Module.jsToZval(Module[UTF8ToString($0)]),3580422:($0,$1,$2,$3)=>{const _class=Module.targets.get($0);const argv=$1;const argc=$2;const size=$3;const args=[];for(let i=0;i<argc;i++){args.push(Module.zvalToJS(argv+i*size))}const _object=new _class(...args);return Module.jsToZval(_object)},3580682:$0=>{const name=UTF8ToString($0);return Module.jsToZval(import(name))},3580755:$0=>{const target=Module.targets.get($0);return Module.classes.get(target)},3580833:($0,$1)=>{const target=Module.targets.get($0);Module.classes.set(target,$1);Module._classes.set($1,target)},3580941:$0=>{const results=Module.targets.get($0);if(results){return results.length}return 0},3581034:$0=>{const results=Module.targets.get($0);if(results.length){return Object.keys(results[0]).length}return 0},3581150:($0,$1)=>{const targetId=$0;const target=Module.targets.get(targetId);const current=$1;if(current>=target.length){return null}return Module.jsToZval(target[current])},3581327:($0,$1)=>{const results=Module.targets.get($0);if(results.length){const jsRet=Object.keys(results[0])[$1];const len=lengthBytesUTF8(jsRet)+1;const strLoc=_malloc(len);stringToUTF8(jsRet,strLoc,len);return strLoc}return 0},3581565:($0,$1,$2)=>{const results=Module.targets.get($0);const current=-1+$1;if(current>=results.length){return null}const result=results[current];const key=Object.keys(result)[$2];const zval=Module.jsToZval(result[key]);return zval},3581825:($0,$1)=>{const statement=Module.targets.get($0);const paramVal=Module.zvalToJS($1);if(!Module.PdoParams.has(statement)){Module.PdoParams.set(statement,[])}const paramList=Module.PdoParams.get(statement);paramList.push(paramVal)},3582064:($0,$1,$2)=>{console.log("GET ATTR",$0,$1,$2)},3582105:($0,$1,$2)=>{console.log("COL META",$0,$1,$2)},3582146:($0,$1,$2)=>{console.log("CLOSE",$0,$1,$2)},3582184:$0=>{console.log("CLOSE",$0)},3582214:($0,$1)=>{const target=Module.targets.get($0);const query=UTF8ToString($1);if(Module.pdoDriver&&Module.pdoDriver.prepare){const prepared=Module.pdoDriver.prepare(target,query);const zval=Module.jsToZval(prepared);return zval}return null},3582466:($0,$1)=>{console.log("DO",$0,UTF8ToString($1));const target=Module.targets.get($0);const query=UTF8ToString($1);if(Module.pdoDriver&&Module.pdoDriver.doer){return Module.pdoDriver.doer(target,query)}return 1},3582687:$0=>{console.log("BEGIN TXN",$0);return true},3582734:$0=>{console.log("COMMIT TXN",$0);return true},3582782:$0=>{console.log("ROLLBACK TXN",$0);return true},3582832:($0,$1,$2)=>{console.log("SET ATTR",$0,$1,$2);return true},3582886:($0,$1)=>{console.log("LAST INSERT ID",$0,UTF8ToString($1));return 0},3582953:($0,$1,$2)=>{console.log("FETCH ERROR FUNC",$0,$1,$2)},3583002:($0,$1,$2)=>{console.log("GET ATTR",$0,$1,$2);return 0},3583053:$0=>{console.log("SHUTDOWN",$0)},3583086:($0,$1)=>{console.log("GET GC",$0,$1)},3583121:()=>Module.targets.getId(globalThis),3583166:($0,$1)=>{let target=Module.targets.get($0);const property=$1;if(target instanceof ArrayBuffer){if(!Module.bufferMaps.has(target)){Module.bufferMaps.set(target,new Uint8Array(target))}target=Module.bufferMaps.get(target)}if(Array.isArray(target)||ArrayBuffer.isView(target)){if(property>=0&&property<target.length){return 1}}return 0},3583529:($0,$1)=>{let target=Module.targets.get($0);const property=$1;if(target instanceof ArrayBuffer){if(!Module.bufferMaps.has(target)){Module.bufferMaps.set(target,new Uint8Array(target))}target=Module.bufferMaps.get(target)}return Module.jsToZval(target[property])},3583805:$0=>{if(Module.persist){const localPath=Module.persist.localPath||"./persist";const mountPath=Module.persist.mountPath||"/persist";const wasmEnv=UTF8ToString($0);FS.mkdir(mountPath);switch(wasmEnv){case"web":FS.mount(IDBFS,{},mountPath);break;case"node":const fs=require("fs");if(!fs.existsSync(localPath)){fs.mkdirSync(localPath,{recursive:true})}FS.mount(NODEFS,{root:localPath},mountPath);break}}}};function __asyncjs__vrzno_await_internal(targetId){return Asyncify.handleAsync((async()=>{const target=Module.targets.get(targetId);const result=await target;return Module.jsToZval(result)}))}function __asyncjs__pdo_vrzno_real_stmt_execute(targetId){return Asyncify.handleAsync((async()=>{let statement=Module.targets.get(targetId);if(!Module.PdoParams.has(statement)){Module.PdoParams.set(statement,[])}const paramList=Module.PdoParams.get(statement);const bound=paramList.length?statement.bind(...paramList):statement;const result=await bound.run();Module.PdoParams.delete(statement);if(!result.success){return false}return Module.jsToZval(result.results)}))}function ExitStatus(status){this.name="ExitStatus";this.message=`Program terminated with exit(${status})`;this.status=status}var callRuntimeCallbacks=callbacks=>{while(callbacks.length>0){callbacks.shift()(Module)}};function getValue(ptr,type="i8"){if(type.endsWith("*"))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":abort("to do getValue(i64) use WASM_BIGINT");case"float":return HEAPF32[ptr>>>2];case"double":return HEAPF64[ptr>>>3];case"*":return HEAPU32[ptr>>>2];default:abort(`invalid type for getValue: ${type}`)}}var ptrToString=ptr=>{assert(typeof ptr==="number");return"0x"+ptr.toString(16).padStart(8,"0")};var warnOnce=text=>{if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}};function convertI32PairToI53Checked(lo,hi){assert(lo==lo>>>0||lo==(lo|0));assert(hi===(hi|0));return hi+2097152>>>0<4194305-!!lo?(lo>>>0)+hi*4294967296:NaN}var UTF8Decoder=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):undefined;var UTF8ArrayToString=(heapOrArray,idx,maxBytesToRead)=>{idx>>>=0;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};var UTF8ToString=(ptr,maxBytesToRead)=>{assert(typeof ptr=="number");ptr>>>=0;return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""};function ___assert_fail(condition,filename,line,func){condition>>>=0;filename>>>=0;func>>>=0;abort(`Assertion failed: ${UTF8ToString(condition)}, at: `+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}var ___call_sighandler=function(fp,sig){fp>>>=0;return(a1=>dynCall_vi.apply(null,[fp,a1]))(sig)};var PATH={isAbs:path=>path.charAt(0)==="/",splitPath:filename=>{var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:(parts,allowAboveRoot)=>{var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:path=>{var isAbsolute=PATH.isAbs(path),trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter((p=>!!p)),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:path=>{var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:path=>{if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},join:function(){var paths=Array.prototype.slice.call(arguments);return PATH.normalize(paths.join("/"))},join2:(l,r)=>PATH.normalize(l+"/"+r)};var initRandomFill=()=>{if(typeof crypto=="object"&&typeof crypto["getRandomValues"]=="function"){return view=>crypto.getRandomValues(view)}else abort("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: (array) => { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };")};var randomFill=view=>(randomFill=initRandomFill())(view);var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=PATH.isAbs(path)}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter((p=>!!p)),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:(from,to)=>{from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start<arr.length;start++){if(arr[start]!=="")break}var end=arr.length-1;for(;end>=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i<length;i++){if(fromParts[i]!==toParts[i]){samePartsLength=i;break}}var outputParts=[];for(var i=samePartsLength;i<fromParts.length;i++){outputParts.push("..")}outputParts=outputParts.concat(toParts.slice(samePartsLength));return outputParts.join("/")}};var FS_stdin_getChar_buffer=[];var 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 stringToUTF8Array=(str,heap,outIdx,maxBytesToWrite)=>{outIdx>>>=0;assert(typeof str==="string");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++>>>0]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++>>>0]=192|u>>6;heap[outIdx++>>>0]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++>>>0]=224|u>>12;heap[outIdx++>>>0]=128|u>>6&63;heap[outIdx++>>>0]=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++>>>0]=240|u>>18;heap[outIdx++>>>0]=128|u>>12&63;heap[outIdx++>>>0]=128|u>>6&63;heap[outIdx++>>>0]=128|u&63}}heap[outIdx>>>0]=0;return outIdx-startIdx};function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var FS_stdin_getChar=()=>{if(!FS_stdin_getChar_buffer.length){var result=null;if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}FS_stdin_getChar_buffer=intArrayFromString(result,true)}return FS_stdin_getChar_buffer.shift()};var TTY={ttys:[],init:function(){},shutdown:function(){},register:function(dev,ops){TTY.ttys[dev]={input:[],output:[],ops:ops};FS.registerDevice(dev,TTY.stream_ops)},stream_ops:{open:function(stream){var tty=TTY.ttys[stream.node.rdev];if(!tty){throw new FS.ErrnoError(43)}stream.tty=tty;stream.seekable=false},close:function(stream){stream.tty.ops.fsync(stream.tty)},fsync:function(stream){stream.tty.ops.fsync(stream.tty)},read:function(stream,buffer,offset,length,pos){if(!stream.tty||!stream.tty.ops.get_char){throw new FS.ErrnoError(60)}var bytesRead=0;for(var i=0;i<length;i++){var result;try{result=stream.tty.ops.get_char(stream.tty)}catch(e){throw new FS.ErrnoError(29)}if(result===undefined&&bytesRead===0){throw new FS.ErrnoError(6)}if(result===null||result===undefined)break;bytesRead++;buffer[offset+i]=result}if(bytesRead){stream.node.timestamp=Date.now()}return bytesRead},write:function(stream,buffer,offset,length,pos){if(!stream.tty||!stream.tty.ops.put_char){throw new FS.ErrnoError(60)}try{for(var i=0;i<length;i++){stream.tty.ops.put_char(stream.tty,buffer[offset+i])}}catch(e){throw new FS.ErrnoError(29)}if(length){stream.node.timestamp=Date.now()}return i}},default_tty_ops:{get_char:function(tty){return FS_stdin_getChar()},put_char:function(tty,val){if(val===