UNPKG

hexaeight-sessions

Version:

Authenticate Any Email User In Front-End Apps Using HexaEight Sessions

1 lines 26.5 MB
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.dotnet=t():e.dotnet=t()}(this,(()=>(()=>{var __webpack_modules__={210:module=>{var Module=function(){var _scriptDir="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0;return function(Module){Module=Module||{};var Module=void 0!==Module?Module:{},readyPromiseResolve,readyPromiseReject;Module.ready=new Promise((function(e,t){readyPromiseResolve=e,readyPromiseReject=t}));var moduleOverrides={},key;for(key in Module)Module.hasOwnProperty(key)&&(moduleOverrides[key]=Module[key]);var arguments_=[],thisProgram="./this.program",quit_=function(e,t){throw t},ENVIRONMENT_IS_WEB=!0,ENVIRONMENT_IS_WORKER=!1,ENVIRONMENT_IS_NODE=!1,ENVIRONMENT_IS_SHELL=!1,scriptDirectory="",read_,readAsync,readBinary,setWindowTitle;function locateFile(e){return Module.locateFile?Module.locateFile(e,scriptDirectory):scriptDirectory+e}(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&(ENVIRONMENT_IS_WORKER?scriptDirectory=self.location.href:"undefined"!=typeof document&&document.currentScript&&(scriptDirectory=document.currentScript.src),_scriptDir&&(scriptDirectory=_scriptDir),scriptDirectory=0!==scriptDirectory.indexOf("blob:")?scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1):"",read_=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},ENVIRONMENT_IS_WORKER&&(readBinary=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),readAsync=function(e,t,r){var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=function(){200==n.status||0==n.status&&n.response?t(n.response):r()},n.onerror=r,n.send(null)},setWindowTitle=function(e){document.title=e});var out=Module.print||console.log.bind(console),err=Module.printErr||console.warn.bind(console);for(key in moduleOverrides)moduleOverrides.hasOwnProperty(key)&&(Module[key]=moduleOverrides[key]);moduleOverrides=null,Module.arguments&&(arguments_=Module.arguments),Module.thisProgram&&(thisProgram=Module.thisProgram),Module.quit&&(quit_=Module.quit);var STACK_ALIGN=16;function alignMemory(e,t){return t||(t=STACK_ALIGN),Math.ceil(e/t)*t}function warnOnce(e){warnOnce.shown||(warnOnce.shown={}),warnOnce.shown[e]||(warnOnce.shown[e]=1,err(e))}function convertJsFunctionToWasm(e,t){if("function"==typeof WebAssembly.Function){for(var r={i:"i32",j:"i64",f:"f32",d:"f64"},n={parameters:[],results:"v"==t[0]?[]:[r[t[0]]]},o=1;o<t.length;++o)n.parameters.push(r[t[o]]);return new WebAssembly.Function(n,e)}var _=[1,0,1,96],a=t.slice(0,1),s=t.slice(1),i={i:127,j:126,f:125,d:124};for(_.push(s.length),o=0;o<s.length;++o)_.push(i[s[o]]);"v"==a?_.push(0):_=_.concat([1,i[a]]),_[1]=_.length-2;var u=new Uint8Array([0,97,115,109,1,0,0,0].concat(_,[2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0])),l=new WebAssembly.Module(u);return new WebAssembly.Instance(l,{e:{f:e}}).exports.f}var freeTableIndexes=[],functionsInTableMap;function getEmptyTableSlot(){if(freeTableIndexes.length)return freeTableIndexes.pop();try{wasmTable.grow(1)}catch(e){if(!(e instanceof RangeError))throw e;throw"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH."}return wasmTable.length-1}function addFunctionWasm(e,t){if(!functionsInTableMap){functionsInTableMap=new WeakMap;for(var r=0;r<wasmTable.length;r++){var n=wasmTable.get(r);n&&functionsInTableMap.set(n,r)}}if(functionsInTableMap.has(e))return functionsInTableMap.get(e);var o=getEmptyTableSlot();try{wasmTable.set(o,e)}catch(r){if(!(r instanceof TypeError))throw r;var _=convertJsFunctionToWasm(e,t);wasmTable.set(o,_)}return functionsInTableMap.set(e,o),o}function addFunction(e,t){return addFunctionWasm(e,t)}var tempRet0=0,setTempRet0=function(e){tempRet0=e},getTempRet0=function(){return tempRet0},wasmBinary;Module.wasmBinary&&(wasmBinary=Module.wasmBinary);var noExitRuntime=Module.noExitRuntime||!0,wasmMemory;function setValue(e,t,r,n){switch("*"===(r=r||"i8").charAt(r.length-1)&&(r="i32"),r){case"i1":case"i8":HEAP8[e>>0]=t;break;case"i16":HEAP16[e>>1]=t;break;case"i32":HEAP32[e>>2]=t;break;case"i64":tempI64=[t>>>0,(tempDouble=t,+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[e>>2]=tempI64[0],HEAP32[e+4>>2]=tempI64[1];break;case"float":HEAPF32[e>>2]=t;break;case"double":HEAPF64[e>>3]=t;break;default:abort("invalid type for setValue: "+r)}}function getValue(e,t,r){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return HEAP8[e>>0];case"i16":return HEAP16[e>>1];case"i32":case"i64":return HEAP32[e>>2];case"float":return HEAPF32[e>>2];case"double":return HEAPF64[e>>3];default:abort("invalid type for getValue: "+t)}return null}"object"!=typeof WebAssembly&&abort("no native wasm support detected");var ABORT=!1,EXITSTATUS;function assert(e,t){e||abort("Assertion failed: "+t)}function getCFunc(e){var t=Module["_"+e];return assert(t,"Cannot call unknown function "+e+", make sure it is exported"),t}function ccall(e,t,r,n,o){var _={string:function(e){var t=0;if(null!=e&&0!==e){var r=1+(e.length<<2);stringToUTF8(e,t=stackAlloc(r),r)}return t},array:function(e){var t=stackAlloc(e.length);return writeArrayToMemory(e,t),t}},a=getCFunc(e),s=[],i=0;if(n)for(var u=0;u<n.length;u++){var l=_[r[u]];l?(0===i&&(i=stackSave()),s[u]=l(n[u])):s[u]=n[u]}var c=a.apply(null,s);return c=function(e){return"string"===t?UTF8ToString(e):"boolean"===t?Boolean(e):e}(c),0!==i&&stackRestore(i),c}function cwrap(e,t,r,n){var o=(r=r||[]).every((function(e){return"number"===e}));return"string"!==t&&o&&!n?getCFunc(e):function(){return ccall(e,t,r,arguments,n)}}var ALLOC_STACK=1,UTF8Decoder="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function UTF8ArrayToString(e,t,r){for(var n=t+r,o=t;e[o]&&!(o>=n);)++o;if(o-t>16&&e.subarray&&UTF8Decoder)return UTF8Decoder.decode(e.subarray(t,o));for(var _="";t<o;){var a=e[t++];if(128&a){var s=63&e[t++];if(192!=(224&a)){var i=63&e[t++];if((a=224==(240&a)?(15&a)<<12|s<<6|i:(7&a)<<18|s<<12|i<<6|63&e[t++])<65536)_+=String.fromCharCode(a);else{var u=a-65536;_+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else _+=String.fromCharCode((31&a)<<6|s)}else _+=String.fromCharCode(a)}return _}function UTF8ToString(e,t){return e?UTF8ArrayToString(HEAPU8,e,t):""}function stringToUTF8Array(e,t,r,n){if(!(n>0))return 0;for(var o=r,_=r+n-1,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),s<=127){if(r>=_)break;t[r++]=s}else if(s<=2047){if(r+1>=_)break;t[r++]=192|s>>6,t[r++]=128|63&s}else if(s<=65535){if(r+2>=_)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|63&s}else{if(r+3>=_)break;t[r++]=240|s>>18,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}}return t[r]=0,r-o}function stringToUTF8(e,t,r){return stringToUTF8Array(e,HEAPU8,t,r)}function lengthBytesUTF8(e){for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&e.charCodeAt(++r)),n<=127?++t:t+=n<=2047?2:n<=65535?3:4}return t}var UTF16Decoder="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function stringToUTF16(e,t,r){if(void 0===r&&(r=2147483647),r<2)return 0;for(var n=t,o=(r-=2)<2*e.length?r/2:e.length,_=0;_<o;++_){var a=e.charCodeAt(_);HEAP16[t>>1]=a,t+=2}return HEAP16[t>>1]=0,t-n}function allocateUTF8(e){var t=lengthBytesUTF8(e)+1,r=_malloc(t);return r&&stringToUTF8Array(e,HEAP8,r,t),r}function writeArrayToMemory(e,t){HEAP8.set(e,t)}function writeAsciiToMemory(e,t,r){for(var n=0;n<e.length;++n)HEAP8[t++>>0]=e.charCodeAt(n);r||(HEAP8[t>>0]=0)}function alignUp(e,t){return e%t>0&&(e+=t-e%t),e}function updateGlobalBufferAndViews(e){buffer=e,Module.HEAP8=HEAP8=new Int8Array(e),Module.HEAP16=HEAP16=new Int16Array(e),Module.HEAP32=HEAP32=new Int32Array(e),Module.HEAPU8=HEAPU8=new Uint8Array(e),Module.HEAPU16=HEAPU16=new Uint16Array(e),Module.HEAPU32=HEAPU32=new Uint32Array(e),Module.HEAPF32=HEAPF32=new Float32Array(e),Module.HEAPF64=HEAPF64=new Float64Array(e)}var INITIAL_MEMORY=Module.INITIAL_MEMORY||16777216,wasmTable,__ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATPOSTRUN__=[],runtimeInitialized=!1,runtimeExited=!1;function preRun(){if(Module.preRun)for("function"==typeof Module.preRun&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=!0,Module.noFSInit||FS.init.initialized||FS.init(),TTY.init(),SOCKFS.root=FS.mount(SOCKFS,{},null),callRuntimeCallbacks(__ATINIT__)}function exitRuntime(){runtimeExited=!0}function postRun(){if(Module.postRun)for("function"==typeof Module.postRun&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(e){__ATPRERUN__.unshift(e)}function addOnInit(e){__ATINIT__.unshift(e)}function addOnPostRun(e){__ATPOSTRUN__.unshift(e)}var runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null;function getUniqueRunDependency(e){return e}function addRunDependency(e){runDependencies++,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies)}function removeRunDependency(e){if(runDependencies--,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),0==runDependencies&&(null!==runDependencyWatcher&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var t=dependenciesFulfilled;dependenciesFulfilled=null,t()}}function abort(e){Module.onAbort&&Module.onAbort(e),err(e+=""),ABORT=!0,EXITSTATUS=1,e="abort("+e+"). Build with -s ASSERTIONS=1 for more info.";var t=new WebAssembly.RuntimeError(e);throw readyPromiseReject(t),t}Module.preloadedImages={},Module.preloadedAudios={};var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(e){return e.startsWith(dataURIPrefix)}var wasmBinaryFile="dotnet.wasm",tempDouble,tempI64;function getBinary(e){try{if(e==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(e);throw"both async and sync fetching of the wasm failed"}catch(e){abort(e)}}function getBinaryPromise(){return wasmBinary||!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER||"function"!=typeof fetch?Promise.resolve().then((function(){return getBinary(wasmBinaryFile)})):fetch(wasmBinaryFile,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+wasmBinaryFile+"'";return e.arrayBuffer()})).catch((function(){return getBinary(wasmBinaryFile)}))}function createWasm(){var e={env:asmLibraryArg,wasi_snapshot_preview1:asmLibraryArg};function t(e,t){var r=e.exports;Module.asm=r,updateGlobalBufferAndViews((wasmMemory=Module.asm.memory).buffer),wasmTable=Module.asm.__indirect_function_table,addOnInit(Module.asm.__wasm_call_ctors),removeRunDependency("wasm-instantiate")}function r(e){t(e.instance)}function n(t){return getBinaryPromise().then((function(t){return WebAssembly.instantiate(t,e)})).then(t,(function(e){err("failed to asynchronously prepare wasm: "+e),abort(e)}))}if(addRunDependency("wasm-instantiate"),Module.instantiateWasm)try{return Module.instantiateWasm(e,t)}catch(e){return err("Module.instantiateWasm callback failed with error: "+e),!1}return(wasmBinary||"function"!=typeof WebAssembly.instantiateStreaming||isDataURI(wasmBinaryFile)||"function"!=typeof fetch?n(r):fetch(wasmBinaryFile,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(r,(function(e){return err("wasm streaming compile failed: "+e),err("falling back to ArrayBuffer instantiation"),n(r)}))}))).catch(readyPromiseReject),{}}isDataURI(wasmBinaryFile)||(wasmBinaryFile=locateFile(wasmBinaryFile));var ASM_CONSTS={581932:function(e,t){MONO.string_decoder.decode(e,e+t,!0)},581983:function($0,$1,$2){var js_str=MONO.string_decoder.copy($0);try{var res=eval(js_str);if(setValue($2,0,"i32"),null==res)return 0;res=res.toString()}catch(e){res=e.toString(),setValue($2,1,"i32"),null==res&&(res="unknown exception");var stack=e.stack;stack&&(stack.startsWith(res)?res=stack:res+="\n"+stack)}var buff=Module._malloc(2*(res.length+1));return stringToUTF16(res,buff,2*(res.length+1)),setValue($1,res.length,"i32"),buff},582538:function(e,t,r,n,o){var _=e,a=Module.UTF8ToString(t),s=r,i=Module.UTF8ToString(n),u=o;if(MONO.logging&&MONO.logging.trace)MONO.logging.trace(i,_,a,s,u);else switch(s&&console.trace(a),Module.UTF8ToString(e)){case"critical":case"error":console.error(a);break;case"warning":console.warn(a);break;case"message":default:console.log(a);break;case"info":console.info(a);break;case"debug":console.debug(a)}},583162:function(e,t){var r=e,n=Module.UTF8ToString(t);MONO.logging&&MONO.logging.debugger?MONO.logging.debugger(r,n):console.debug("%s: %s","Debugger.Debug",n)},583402:function(e,t,r,n){MONO.mono_wasm_add_dbg_command_received(e,t,r,n)},583464:function(e,t,r,n){MONO.mono_wasm_add_dbg_command_received(e,t,r,n)},583526:function(e,t,r,n){MONO.mono_wasm_add_dbg_command_received(e,t,r,n)},583588:function(e,t,r,n){MONO.mono_wasm_add_dbg_command_received(e,t,r,n)},583650:function(e,t){MONO.mono_wasm_add_dbg_command_received(1,0,e,t)}};function compile_function(snippet_ptr,len,is_exception){try{var data=MONO.string_decoder.decode(snippet_ptr,snippet_ptr+len),wrapper="(function () { "+data+" })",funcFactory=eval(wrapper),func=funcFactory();if("function"!=typeof func)throw new Error("Code must return an instance of a JavaScript function. Please use `return` statement to return a function.");return setValue(is_exception,0,"i32"),BINDING.js_to_mono_obj(func,!0)}catch(e){return res=e.toString(),setValue(is_exception,1,"i32"),null!==res&&void 0!==res||(res="unknown exception"),BINDING.js_to_mono_obj(res,!0)}}function callRuntimeCallbacks(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var r=t.func;"number"==typeof r?void 0===t.arg?wasmTable.get(r)():wasmTable.get(r)(t.arg):r(void 0===t.arg?null:t.arg)}else t(Module)}}function demangle(e){return e}function demangleAll(e){return e.replace(/\b_Z[\w\d_]+/g,(function(e){var t=demangle(e);return e===t?e:t+" ["+e+"]"}))}function jsStackTrace(){var e=new Error;if(!e.stack){try{throw new Error}catch(t){e=t}if(!e.stack)return"(no stack trace available)"}return e.stack.toString()}var runtimeKeepaliveCounter=0,_emscripten_get_now;function keepRuntimeAlive(){return noExitRuntime||runtimeKeepaliveCounter>0}function ___assert_fail(e,t,r,n){abort("Assertion failed: "+UTF8ToString(e)+", at: "+[t?UTF8ToString(t):"unknown filename",r,n?UTF8ToString(n):"unknown function"])}_emscripten_get_now=function(){return 0};var _emscripten_get_now_is_monotonic=!0;function setErrNo(e){return HEAP32[___errno_location()>>2]=e,e}function _clock_gettime(e,t){var r;if(0===e)r=Date.now();else{if(1!==e&&4!==e||!_emscripten_get_now_is_monotonic)return setErrNo(28),-1;r=_emscripten_get_now()}return HEAP32[t>>2]=r/1e3|0,HEAP32[t+4>>2]=r%1e3*1e3*1e3|0,0}function ___clock_gettime(e,t){return _clock_gettime(e,t)}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(e){return _malloc(e+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function ExceptionInfo(e){this.excPtr=e,this.ptr=e-ExceptionInfoAttrs.SIZE,this.set_type=function(e){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=e},this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]},this.set_destructor=function(e){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=e},this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]},this.set_refcount=function(e){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=e},this.set_caught=function(e){e=e?1:0,HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=e},this.get_caught=function(){return 0!=HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]},this.set_rethrown=function(e){e=e?1:0,HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=e},this.get_rethrown=function(){return 0!=HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]},this.init=function(e,t){this.set_type(e),this.set_destructor(t),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var e=HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2];HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=e+1},this.release_ref=function(){var e=HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2];return HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=e-1,1===e}}function CatchInfo(e){this.free=function(){_free(this.ptr),this.ptr=0},this.set_base_ptr=function(e){HEAP32[this.ptr>>2]=e},this.get_base_ptr=function(){return HEAP32[this.ptr>>2]},this.set_adjusted_ptr=function(e){HEAP32[this.ptr+4>>2]=e},this.get_adjusted_ptr=function(){return HEAP32[this.ptr+4>>2]},this.get_exception_ptr=function(){if(___cxa_is_pointer_type(this.get_exception_info().get_type()))return HEAP32[this.get_base_ptr()>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.get_base_ptr()},this.get_exception_info=function(){return new ExceptionInfo(this.get_base_ptr())},void 0===e?(this.ptr=_malloc(8),this.set_adjusted_ptr(0)):this.ptr=e}var exceptionCaught=[];function exception_addRef(e){e.add_ref()}var uncaughtExceptionCount=0;function ___cxa_begin_catch(e){var t=new CatchInfo(e),r=t.get_exception_info();return r.get_caught()||(r.set_caught(!0),uncaughtExceptionCount--),r.set_rethrown(!1),exceptionCaught.push(t),exception_addRef(r),t.get_exception_ptr()}var exceptionLast=0;function ___cxa_free_exception(e){return _free(new ExceptionInfo(e).ptr)}function exception_decRef(e){if(e.release_ref()&&!e.get_rethrown()){var t=e.get_destructor();t&&wasmTable.get(t)(e.excPtr),___cxa_free_exception(e.excPtr)}}function ___cxa_end_catch(){_setThrew(0);var e=exceptionCaught.pop();exception_decRef(e.get_exception_info()),e.free(),exceptionLast=0}function ___resumeException(e){var t=new CatchInfo(e),r=t.get_base_ptr();throw exceptionLast||(exceptionLast=r),t.free(),r}function ___cxa_find_matching_catch_3(){var e=exceptionLast;if(!e)return setTempRet0(0),0;var t=new ExceptionInfo(e),r=t.get_type(),n=new CatchInfo;if(n.set_base_ptr(e),!r)return setTempRet0(0),0|n.ptr;var o=Array.prototype.slice.call(arguments),_=stackSave(),a=stackAlloc(4);HEAP32[a>>2]=e;for(var s=0;s<o.length;s++){var i=o[s];if(0===i||i===r)break;if(___cxa_can_catch(i,r,a)){var u=HEAP32[a>>2];return e!==u&&n.set_adjusted_ptr(u),setTempRet0(i),0|n.ptr}}return stackRestore(_),setTempRet0(r),0|n.ptr}function ___cxa_throw(e,t,r){throw new ExceptionInfo(e).init(t,r),exceptionLast=e,uncaughtExceptionCount++,e}var PATH={splitPath:function(e){return/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1)},normalizeArray:function(e,t){for(var r=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:function(e){var t="/"===e.charAt(0),r="/"===e.substr(-1);return(e=PATH.normalizeArray(e.split("/").filter((function(e){return!!e})),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:function(e){var t=PATH.splitPath(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:function(e){if("/"===e)return"/";var t=(e=(e=PATH.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},extname:function(e){return PATH.splitPath(e)[3]},join:function(){var e=Array.prototype.slice.call(arguments,0);return PATH.normalize(e.join("/"))},join2:function(e,t){return PATH.normalize(e+"/"+t)}};function getRandomDevice(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return function(){return crypto.getRandomValues(e),e[0]}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:FS.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,t="/"===n.charAt(0)}return(t?"/":"")+(e=PATH.normalizeArray(e.split("/").filter((function(e){return!!e})),!t).join("/"))||"."},relative:function(e,t){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=PATH_FS.resolve(e).substr(1),t=PATH_FS.resolve(t).substr(1);for(var n=r(e.split("/")),o=r(t.split("/")),_=Math.min(n.length,o.length),a=_,s=0;s<_;s++)if(n[s]!==o[s]){a=s;break}var i=[];for(s=a;s<n.length;s++)i.push("..");return(i=i.concat(o.slice(a))).join("/")}},TTY={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){TTY.ttys[e]={input:[],output:[],ops:t},FS.registerDevice(e,TTY.stream_ops)},stream_ops:{open:function(e){var t=TTY.ttys[e.node.rdev];if(!t)throw new FS.ErrnoError(43);e.tty=t,e.seekable=!1},close:function(e){e.tty.ops.flush(e.tty)},flush:function(e){e.tty.ops.flush(e.tty)},read:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.get_char)throw new FS.ErrnoError(60);for(var _=0,a=0;a<n;a++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new FS.ErrnoError(29)}if(void 0===s&&0===_)throw new FS.ErrnoError(6);if(null==s)break;_++,t[r+a]=s}return _&&(e.node.timestamp=Date.now()),_},write:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.put_char)throw new FS.ErrnoError(60);try{for(var _=0;_<n;_++)e.tty.ops.put_char(e.tty,t[r+_])}catch(e){throw new FS.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),_}},default_tty_ops:{get_char:function(e){if(!e.input.length){var t=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n"),!t)return null;e.input=intArrayFromString(t,!0)}return e.input.shift()},put_char:function(e,t){null===t||10===t?(out(UTF8ArrayToString(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(out(UTF8ArrayToString(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(err(UTF8ArrayToString(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(err(UTF8ArrayToString(e.output,0)),e.output=[])}}};function mmapAlloc(e){for(var t=alignMemory(e,65536),r=_malloc(t);e<t;)HEAP8[r+e++]=0;return r}var MEMFS={ops_table:null,mount:function(e){return MEMFS.createNode(null,"/",16895,0)},createNode:function(e,t,r,n){if(FS.isBlkdev(r)||FS.isFIFO(r))throw new FS.ErrnoError(63);MEMFS.ops_table||(MEMFS.ops_table={dir:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,lookup:MEMFS.node_ops.lookup,mknod:MEMFS.node_ops.mknod,rename:MEMFS.node_ops.rename,unlink:MEMFS.node_ops.unlink,rmdir:MEMFS.node_ops.rmdir,readdir:MEMFS.node_ops.readdir,symlink:MEMFS.node_ops.symlink},stream:{llseek:MEMFS.stream_ops.llseek}},file:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:{llseek:MEMFS.stream_ops.llseek,read:MEMFS.stream_ops.read,write:MEMFS.stream_ops.write,allocate:MEMFS.stream_ops.allocate,mmap:MEMFS.stream_ops.mmap,msync:MEMFS.stream_ops.msync}},link:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,readlink:MEMFS.node_ops.readlink},stream:{}},chrdev:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:FS.chrdev_stream_ops}});var o=FS.createNode(e,t,r,n);return FS.isDir(o.mode)?(o.node_ops=MEMFS.ops_table.dir.node,o.stream_ops=MEMFS.ops_table.dir.stream,o.contents={}):FS.isFile(o.mode)?(o.node_ops=MEMFS.ops_table.file.node,o.stream_ops=MEMFS.ops_table.file.stream,o.usedBytes=0,o.contents=null):FS.isLink(o.mode)?(o.node_ops=MEMFS.ops_table.link.node,o.stream_ops=MEMFS.ops_table.link.stream):FS.isChrdev(o.mode)&&(o.node_ops=MEMFS.ops_table.chrdev.node,o.stream_ops=MEMFS.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[t]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage:function(e,t){var r=e.contents?e.contents.length:0;if(!(r>=t)){t=Math.max(t,r*(r<1048576?2:1.125)>>>0),0!=r&&(t=Math.max(t,256));var n=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage:function(e,t){if(e.usedBytes!=t)if(0==t)e.contents=null,e.usedBytes=0;else{var r=e.contents;e.contents=new Uint8Array(t),r&&e.contents.set(r.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr:function(e){var t={};return t.dev=FS.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,FS.isDir(e.mode)?t.size=4096:FS.isFile(e.mode)?t.size=e.usedBytes:FS.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr:function(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&MEMFS.resizeFileStorage(e,t.size)},lookup:function(e,t){throw FS.genericErrors[44]},mknod:function(e,t,r,n){return MEMFS.createNode(e,t,r,n)},rename:function(e,t,r){if(FS.isDir(e.mode)){var n;try{n=FS.lookupNode(t,r)}catch(e){}if(n)for(var o in n.contents)throw new FS.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=r,t.contents[r]=e,t.timestamp=e.parent.timestamp,e.parent=t},unlink:function(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir:function(e,t){var r=FS.lookupNode(e,t);for(var n in r.contents)throw new FS.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir:function(e){var t=[".",".."];for(var r in e.contents)e.contents.hasOwnProperty(r)&&t.push(r);return t},symlink:function(e,t,r){var n=MEMFS.createNode(e,t,41471,0);return n.link=r,n},readlink:function(e){if(!FS.isLink(e.mode))throw new FS.ErrnoError(28);return e.link}},stream_ops:{read:function(e,t,r,n,o){var _=e.node.contents;if(o>=e.node.usedBytes)return 0;var a=Math.min(e.node.usedBytes-o,n);if(a>8&&_.subarray)t.set(_.subarray(o,o+a),r);else for(var s=0;s<a;s++)t[r+s]=_[o+s];return a},write:function(e,t,r,n,o,_){if(t.buffer===HEAP8.buffer&&(_=!1),!n)return 0;var a=e.node;if(a.timestamp=Date.now(),t.subarray&&(!a.contents||a.contents.subarray)){if(_)return a.contents=t.subarray(r,r+n),a.usedBytes=n,n;if(0===a.usedBytes&&0===o)return a.contents=t.slice(r,r+n),a.usedBytes=n,n;if(o+n<=a.usedBytes)return a.contents.set(t.subarray(r,r+n),o),n}if(MEMFS.expandFileStorage(a,o+n),a.contents.subarray&&t.subarray)a.contents.set(t.subarray(r,r+n),o);else for(var s=0;s<n;s++)a.contents[o+s]=t[r+s];return a.usedBytes=Math.max(a.usedBytes,o+n),n},llseek:function(e,t,r){var n=t;if(1===r?n+=e.position:2===r&&FS.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new FS.ErrnoError(28);return n},allocate:function(e,t,r){MEMFS.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap:function(e,t,r,n,o,_){if(0!==t)throw new FS.ErrnoError(28);if(!FS.isFile(e.node.mode))throw new FS.ErrnoError(43);var a,s,i=e.node.contents;if(2&_||i.buffer!==buffer){if((n>0||n+r<i.length)&&(i=i.subarray?i.subarray(n,n+r):Array.prototype.slice.call(i,n,n+r)),s=!0,!(a=mmapAlloc(r)))throw new FS.ErrnoError(48);HEAP8.set(i,a)}else s=!1,a=i.byteOffset;return{ptr:a,allocated:s}},msync:function(e,t,r,n,o){if(!FS.isFile(e.node.mode))throw new FS.ErrnoError(43);return 2&o||MEMFS.stream_ops.write(e,t,0,n,r,!1),0}}},FS={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:function(e,t){if(t=t||{},!(e=PATH_FS.resolve(FS.cwd(),e)))return{path:"",node:null};var r={follow_mount:!0,recurse_count:0};for(var n in r)void 0===t[n]&&(t[n]=r[n]);if(t.recurse_count>8)throw new FS.ErrnoError(32);for(var o=PATH.normalizeArray(e.split("/").filter((function(e){return!!e})),!1),_=FS.root,a="/",s=0;s<o.length;s++){var i=s===o.length-1;if(i&&t.parent)break;if(_=FS.lookupNode(_,o[s]),a=PATH.join2(a,o[s]),FS.isMountpoint(_)&&(!i||i&&t.follow_mount)&&(_=_.mounted.root),!i||t.follow)for(var u=0;FS.isLink(_.mode);){var l=FS.readlink(a);if(a=PATH_FS.resolve(PATH.dirname(a),l),_=FS.lookupPath(a,{recurse_count:t.recurse_count}).node,u++>40)throw new FS.ErrnoError(32)}}return{path:a,node:_}},getPath:function(e){for(var t;;){if(FS.isRoot(e)){var r=e.mount.mountpoint;return t?"/"!==r[r.length-1]?r+"/"+t:r+t:r}t=t?e.name+"/"+t:e.name,e=e.parent}},hashName:function(e,t){for(var r=0,n=0;n<t.length;n++)r=(r<<5)-r+t.charCodeAt(n)|0;return(e+r>>>0)%FS.nameTable.length},hashAddNode:function(e){var t=FS.hashName(e.parent.id,e.name);e.name_next=FS.nameTable[t],FS.nameTable[t]=e},hashRemoveNode:function(e){var t=FS.hashName(e.parent.id,e.name);if(FS.nameTable[t]===e)FS.nameTable[t]=e.name_next;else for(var r=FS.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode:function(e,t){var r=FS.mayLookup(e);if(r)throw new FS.ErrnoError(r,e);for(var n=FS.hashName(e.id,t),o=FS.nameTable[n];o;o=o.name_next){var _=o.name;if(o.parent.id===e.id&&_===t)return o}return FS.lookup(e,t)},createNode:function(e,t,r,n){var o=new FS.FSNode(e,t,r,n);return FS.hashAddNode(o),o},destroyNode:function(e){FS.hashRemoveNode(e)},isRoot:function(e){return e===e.parent},isMountpoint:function(e){return!!e.mounted},isFile:function(e){return 32768==(61440&e)},isDir:function(e){return 16384==(61440&e)},isLink:function(e){return 40960==(61440&e)},isChrdev:function(e){return 8192==(61440&e)},isBlkdev:function(e){return 24576==(61440&e)},isFIFO:function(e){return 4096==(61440&e)},isSocket:function(e){return 49152==(49152&e)},flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:function(e){var t=FS.flagModes[e];if(void 0===t)throw new Error("Unknown file open mode: "+e);return t},flagsToPermissionString:function(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:function(e,t){return FS.ignorePermissions||(!t.includes("r")||292&e.mode)&&(!t.includes("w")||146&e.mode)&&(!t.includes("x")||73&e.mode)?0:2},mayLookup:function(e){return FS.nodePermissions(e,"x")||(e.node_ops.lookup?0:2)},mayCreate:function(e,t){try{return FS.lookupNode(e,t),20}catch(e){}return FS.nodePermissions(e,"wx")},mayDelete:function(e,t,r){var n;try{n=FS.lookupNode(e,t)}catch(e){return e.errno}var o=FS.nodePermissions(e,"wx");if(o)return o;if(r){if(!FS.isDir(n.mode))return 54;if(FS.isRoot(n)||FS.getPath(n)===FS.cwd())return 10}else if(FS.isDir(n.mode))return 31;return 0},mayOpen:function(e,t){return e?FS.isLink(e.mode)?32:FS.isDir(e.mode)&&("r"!==FS.flagsToPermissionString(t)||512&t)?31:FS.nodePermissions(e,FS.flagsToPermissionString(t)):44},MAX_OPEN_FDS:4096,nextfd:function(e,t){e=e||0,t=t||FS.MAX_OPEN_FDS;for(var r=e;r<=t;r++)if(!FS.streams[r])return r;throw new FS.ErrnoError(33)},getStream:function(e){return FS.streams[e]},createStream:function(e,t,r){FS.FSStream||(FS.FSStream=function(){},FS.FSStream.prototype={object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}}});var n=new FS.FSStream;for(var o in e)n[o]=e[o];e=n;var _=FS.nextfd(t,r);return e.fd=_,FS.streams[_]=e,e},closeStream:function(e){FS.streams[e]=null},chrdev_stream_ops:{open:function(e){var t=FS.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:function(){throw new FS.ErrnoError(70)}},major:function(e){return e>>8},minor:function(e){return 255&e},makedev:function(e,t){return e<<8|t},registerDevice:function(e,t){FS.devices[e]={stream_ops:t}},getDevice:function(e){return FS.devices[e]},getMounts:function(e){for(var t=[],r=[e];r.length;){var n=r.pop();t.push(n),r.push.apply(r,n.mounts)}return t},syncfs:function(e,t){"function"==typeof e&&(t=e,e=!1),FS.syncFSRequests++,FS.syncFSRequests>1&&err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var r=FS.getMounts(FS.root.mount),n=0;function o(e){return FS.syncFSRequests--,t(e)}function _(e){if(e)return _.errored?void 0:(_.errored=!0,o(e));++n>=r.length&&o(null)}r.forEach((function(t){if(!t.type.syncfs)return _(null);t.type.syncfs(t,e,_)}))},mount:function(e,t,r){var n,o="/"===r,_=!r;if(o&&FS.root)throw new FS.ErrnoError(10);if(!o&&!_){var a=FS.lookupPath(r,{follow_mount:!1});if(r=a.path,n=a.node,FS.isMountpoint(n))throw new FS.ErrnoError(10);if(!FS.isDir(n.mode))throw new FS.ErrnoError(54)}var s={type:e,opts:t,mountpoint:r,mounts:[]},i=e.mount(s);return i.mount=s,s.root=i,o?FS.root=i:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),i},unmount:function(e){var t=FS.lookupPath(e,{follow_mount:!1});if(!FS.isMountpoint(t.node))throw new FS.ErrnoError(28);var r=t.node,n=r.mounted,o=FS.getMounts(n);Object.keys(FS.nameTable).forEach((function(e){for(var t=FS.nameTable[e];t;){var r=t.name_next;o.includes(t.mount)&&FS.destroyNode(t),t=r}})),r.mounted=null;var _=r.mount.mounts.indexOf(n);r.mount.mounts.splice(_,1)},lookup:function(e,t){return e.node_ops.lookup(e,t)},mknod:function(e,t,r){var n=FS.lookupPath(e,{parent:!0}).node,o=PATH.basename(e);if(!o||"."===o||".."===o)throw new FS.ErrnoError(28);var _=FS.mayCreate(n,o);if(_)throw new FS.ErrnoError(_);if(!n.node_ops.mknod)throw new FS.ErrnoError(63);return n.node_ops.mknod(n,o,t,r)},create:function(e,t){return t=void 0!==t?t:438,t&=4095,t|=32768,FS.mknod(e,t,0)},mkdir:function(e,t){return t=void 0!==t?t:511,t&=1023,t|=16384,FS.mknod(e,t,0)},mkdirTree:function(e,t){for(var r=e.split("/"),n="",o=0;o<r.length;++o)if(r[o]){n+="/"+r[o];try{FS.mkdir(n,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:function(e,t,r){return void 0===r&&(r=t,t=438),t|=8192,FS.mknod(e,t,r)},symlink:function(e,t){if(!PATH_FS.resolve(e))throw new FS.ErrnoError(44);var r=FS.lookupPath(t,{parent:!0}).node;if(!r)throw new FS.ErrnoError(44);var n=PATH.basename(t),o=FS.mayCreate(r,n);if(o)throw new FS.ErrnoError(o);if(!r.node_ops.symlink)throw new FS.ErrnoError(63);return r.node_ops.symlink(r,n,e)},rename:function(e,t){var r,n,o=PATH.dirname(e),_=PATH.dirname(t),a=PATH.basename(e),s=PATH.basename(t);if(r=FS.lookupPath(e,{parent:!0}).node,n=FS.lookupPath(t,{parent:!0}).node,!r||!n)throw new FS.ErrnoError(44);if(r.mount!==n.mount)throw new FS.ErrnoError(75);var i,u=FS.lookupNode(r,a),l=PATH_FS.relative(e,_);if("."!==l.charAt(0))throw new FS.ErrnoError(28);if("."!==(l=PATH_FS.relative(t,o)).charAt(0))throw new FS.ErrnoError(55);try{i=FS.lookupNode(n,s)}catch(e){}if(u!==i){var c=FS.isDir(u.mode),d=FS.mayDelete(r,a,c);if(d)throw new FS.ErrnoError(d);if(d=i?FS.mayDelete(n,s,c):FS.mayCreate(n,s))throw new FS.ErrnoError(d);if(!r.node_ops.rename)throw new FS.ErrnoError(63);if(FS.isMountpoint(u)||i&&FS.isMountpoint(i))throw new FS.ErrnoError(10);if(n!==r&&(d=FS.nodePermissions(r,"w")))throw new FS.ErrnoError(d);try{FS.trackingDelegate.willMovePath&&FS.trackingDelegate.willMovePath(e,t)}catch(r){err("FS.trackingDelegate['willMovePath']('"+e+"', '"+t+"') threw an exception: "+r.message)}FS.hashRemoveNode(u);try{r.node_ops.rename(u,n,s)}catch(e){throw e}finally{FS.hashAddNode(u)}try{FS.trackingDelegate.onMovePath&&FS.trackingDelegate.onMovePath(e,t)}catch(r){err("FS.trackingDelegate['onMovePath']('"+e+"', '"+t+"') threw an exception: "+r.message)}}},rmdir:function(e){var t=FS.lookupPath(e,{parent:!0}).node,r=PATH.basename(e),n=FS.lookupNode(t,r),o=FS.mayDelete(t,r,!0);if(o)throw new FS.ErrnoError(o);if(!t.node_ops.rmdir)throw new FS.ErrnoError(63);if(FS.isMountpoint(n))throw new FS.ErrnoError(10);try{FS.trackingDelegate.willDeletePath&&FS.trackingDelegate.willDeletePath(e)}catch(t){err("FS.trackingDelegate['willDeletePath']('"+e+"') threw an exception: "+t.message)}t.node_ops.rmdir(t,r),FS.destroyNode(n);try{FS.trackingDelegate.onDeletePath&&FS.trackingDelegate.onDeletePath(e)}catch(t){err("FS.trackingDelegate['onDeletePath']('"+e+"') threw an exception: "+t.message)}},readdir:function(e){var t=FS.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new FS.ErrnoError(54);return t.node_ops.readdir(t)},unlink:function(e){var t=FS.lookupPath(e,{parent:!0}).node,r=PATH.basename(e),n=FS.lookupNode(t,r),o=FS.mayDelete(t,r,!1);if(o)throw new FS.ErrnoError(o);if(!t.node_ops.unlink)throw new FS.ErrnoError(63);if(FS.isMountpoint(n))throw new FS.ErrnoError(10);try{FS.trackingDelegate.willDeletePath&&FS.trackingDelegate.willDeletePath(e)}catch(t){err("FS.trackingDelegate['willDeletePath']('"+e+"') threw an exception: "+t.message)}t.node_ops.unlink(t,r),FS.destroyNode(n);try{FS.trackingDelegate.onDeletePath&&FS.trackingDelegate.onDeletePath(e)}catch(t){err("FS.trackingDelegate['onDeletePath']('"+e+"') threw an exception: "+t.message)}},readlink:function(e){var t=FS.lookupPath(e).node;if(!t)throw new FS.ErrnoError(44);if(!t.node_ops.readlink)throw new FS.ErrnoError(28);return PATH_FS.resolve(FS.getPath(t.parent),t.node_ops.readlink(t))},stat:function(e,t){var r=FS.lookupPath(e,{follow:!t}).node;if(!r)throw new FS.ErrnoError(44);if(!r.node_ops.getattr)throw new FS.ErrnoError(63);return r.node_ops.getattr(r)},lstat:function(e){return FS.stat(e,!0)},chmod:function(e,t,r){var n;if(!(n="string"==typeof e?FS.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new FS.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod:function(e,t){FS.chmod(e,t,!0)},fchmod:function(e,t){var r=FS.getStream(e);if(!r)throw new FS.ErrnoError(8);FS.chmod(r.node,t)},chown:function(e,t,r,n){var o;if(!(o="string"==typeof e?FS.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new FS.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:function(e,t,r){FS.chown(e,t,r,!0)},fchown:function(e,t,r){var n=FS.getStream(e);if(!n)throw new FS.ErrnoError(8);FS.chown(n.node,t,r)},truncate:function(e,t){if(t<0)throw new FS.ErrnoError(28);var r;if(!(r="string"==typeof e?FS.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new FS.ErrnoError(63);if(FS.isDir(r.mode))throw new FS.ErrnoError(31);if(!FS.isFile(r.mode))throw new FS.ErrnoError(28);var n=FS.nodePermissions(r,"w");if(n)throw new FS.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate:function(e,t){var r=FS.getStream(e);if(!r)throw new FS.ErrnoError(8);if(0==(2097155&r.flags))throw new FS.ErrnoError(28);FS.truncate(r.node,t)},utime:function(e,t,r){var n=FS.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open:function(e,t,r,n,o){if(""===e)throw new FS.ErrnoError(44);var _;if(r=void 0===r?438:r,r=64&(t="string"==typeof t?FS.modeStringToFlags(t):t)?4095&r|32768:0,"object"==typeof e)_=e;else{e=PATH.normalize(e);try{_=FS.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var a=!1;if(64&t)if(_){if(128&t)throw new FS.ErrnoError(20)}else _=FS.mknod(e,r,0),a=!0;if(!_)throw new FS.ErrnoError(44);if(FS.isChrdev(_.mode)&&(t&=-513),65536&t&&!FS.isDir(_.mode))throw new FS.ErrnoError(54);if(!a){var s=FS.mayOpen(_,t);if(s)throw new FS.ErrnoError(s)}512&t&&FS.truncate(_,0),t&=-131713;var i=FS.createStream({node:_,path:FS.getPath(_),flags:t,seekable:!0,position:0,stream_ops:_.stream_ops,ungotten:[],error:!1},n,o);i.stream_ops.open&&i.stream_ops.open(i),!Module.logReadFiles||1&t||(FS.readFiles||(FS.readFiles={}),e in FS.readFiles||(FS.readFiles[e]=1,err("FS.trackingDelegate error on read file: "+e)));try{if(FS.trackingDelegate.onOpenFile){var u=0;1!=(2097155&t)&&(u|=FS.tracking.openFlags.READ),0!=(2097155&t)&&(u|=FS.tracking.openFlags.WRITE),FS.trackingDelegate.onOpenFile(e,u)}}catch(t){err("FS.trackingDelegate['onOpenFile']('"+e+"', flags) threw an exception: "+t.message)}return i},close:function(e){if(FS.isClosed(e))throw new FS.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{FS.closeStream(e.fd)}e.fd=null},isClosed:function(e){return null===e.fd},llseek:function(e,t,r){if(FS.isClosed(e))throw new FS.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new FS.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new FS.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read:function(e,t,r,n,o){if(n<0||o<0)throw new FS.ErrnoError(28);if(FS.isClosed(e))throw new FS.ErrnoError(8);if(1==(2097155&e.flags))throw new FS.ErrnoError(8);if(FS.isDir(e.node.mode))throw new FS.ErrnoError(31);if(!e.stream_ops.read)throw new FS.ErrnoError(28);var _=void 0!==o;if(_){if(!e.seekable)throw new FS.ErrnoError(70)}else o=e.position;var a=e.stream_ops.read(e,t,r,n,o);return _||(e.position+=a),a},write:function(e,t,r,n,o,_){if(n<0||o<0)throw new FS.ErrnoError(28);if(FS.isClosed(e))throw new FS.ErrnoError(8);if(0==(2097155&e.flags))throw new FS.ErrnoError(8);if(FS.isDir(e.node.mode))throw new FS.ErrnoError(31);if(!e.stream_ops.write)throw new FS.ErrnoError(28);e.seekable&&1024&e.flags&&FS.llseek(e,0,2);var a=void 0!==o;if(a){if(!e.seekable)throw new FS.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,t,r,n,o,_);a||(e.position+=s);try{e.path&&FS.trackingDelegate.onWriteToFile&&FS.trackingDelegate.onWriteToFile(e.path)}catch(t){err("FS.trackingDelegate['onWriteToFile']('"+e.path+"') threw an exception: "+t.message)}return s},allocate:function(e,t,r){if(FS.isClosed(e))throw new FS.ErrnoError(8);if(t<0||r<=0)throw new FS.ErrnoError(28);if(0==(2097155&e.flags))throw new FS.ErrnoError(8);if(!FS.isFile(e.node.mode)&&!FS.isDir(e.node.mode))throw new FS.ErrnoError(43);if(!e.stream_ops.allocate)throw new FS.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap:function(e,t,r,n,o,_){if(0!=(2&o)&&0==(2&_)&&2!=(2097155&e.flags))throw new FS.ErrnoError(2);if(1==(2097155&e.flags))throw new FS.ErrnoError(2);if(!e.stream_ops.mmap)throw new FS.ErrnoError(43);return e.stream_ops.mmap(e,t,r,n,o,_)},msync:function(e,t,r,n,o){return e&&e.stream_ops.msync?e.stream_ops.msync(e,t,r,n,o):0},munmap:function(e){return 0},ioctl:function(e,t,r){if(!e.stream_ops.ioctl)throw new FS.ErrnoError(59);return e.stream_ops.ioctl(e,t,r)},readFile:function(e,t){if((t=t||{}).flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error('Invalid encoding type "'+t.encoding+'"');var r,n=FS.open(e,t.flags),o=FS.stat(e).size,_=new Uint8Array(o);return FS.read(n,_,0,o,0),"utf8"===t.encoding?r=UTF8ArrayToString(_,0):"binary"===t.encoding&&(r=_),FS.close(n),r},writeFile:function(e,t,r){(r=r||{}).flags=r.flags||577;var n=FS.open(e,r.flags,r.mode);if("string"==typeof t){var o=new Uint8Array(lengthBytesUTF8(t)+1),_=stringToUTF8Array(t,o,0,o.length);FS.write(n,o,0,_,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");FS.write(n,t,0,t.byteLength,void 0,r.canOwn)}FS.close(n)},cwd:function(){return FS.currentPath},chdir:function(e){var t=FS.lookupPath(e,{follow:!0});if(null===t.node)throw new FS.ErrnoError(44);if(!FS.isDir(t.node.mode))throw new FS.ErrnoError(54);var r=FS.nodePermissions(t.node,"x");if(r)throw new FS.ErrnoError(r);FS.currentPath=t.path},createDefaultDirectories:function(){FS.mkdir("/tmp"),FS.mkdir("/home"),FS.mkdir("/home/web_user")},createDefaultDevices:function(){FS.mkdir("/dev"),FS.registerDevice(FS.makedev(1,3),{read:function(){return 0},write:function(e,t,r,n,o){return n}}),FS.mkdev("/dev/null",FS.makedev(1,3)),TTY.register(FS.makedev(5,0),TTY.default_tty_ops),TTY.register(FS.makedev(6,0),TTY.default_tty1_ops),FS.mkdev("/dev/tty",FS.makedev(5,0)),FS.mkdev("/dev/tty1",FS.makedev(6,0));var e=getRandomDevice();FS.createDevice("/dev","random",e),FS.createDevice("/dev","urandom",e),FS.mkdir("/dev/shm"),FS.mkdir("/dev/shm/tmp")},createSpecialDirectories:function(){FS.mkdir("/proc");var e=FS.mkdir("/proc/self");FS.mkdir("/proc/self/fd"),FS.mount({mount:function(){var t=FS.createNode(e,"fd",16895,73);return t.node_ops={lookup:function(e,t){var r=+t,n=FS.getStream(r);if(!n)throw new FS.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:function(){return n.path}}};return o.parent=o,o}},t}},{},"/proc/self/fd")},createStandardStreams:function(){Module.stdin?FS.createDevice("/dev","stdin",Module.stdin):FS.symlink("/dev/tty","/dev/stdin"),Module.stdout?FS.createDevice("/dev","stdout",null,Module.stdout):FS.symlink("/dev/tty","/dev/stdout"),Module.stderr?FS.createDevice("/dev","stderr",null,Module.stderr):FS.symlink("/dev/tty1","/dev/stderr"),FS.open("/dev/stdin",0),FS.open("/dev/stdout",1),FS.open("/dev/stderr",1)},ensureErrnoError:function(){FS.ErrnoError||(FS.ErrnoError=function(e,t){this.node=t,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},FS.ErrnoError.prototype=new Error,FS.ErrnoError.prototype.constructor=FS.ErrnoError,[44].forEach((function(e){FS.genericErrors[e]=new FS.ErrnoError(e),FS.genericErrors[e].stack="<generic error, no stack>"})))},staticInit:function(){FS.ensureErrnoError(),FS.nameTable=new Array(4096),FS.mount(MEMFS,{},"/"),FS.createDefaultDirectories(),FS.createDefaultDevices(),FS.createSpecialDirectories(),FS.filesystems={MEMFS}},init:function(e,t,r){FS.init.initialized=!0,FS.ensureErrnoError(),Module.stdin=e||Module.stdin,Module.stdout=t||Module.stdout,Module.stderr=r||Module.stderr,FS.createStandardStreams()},quit:function(){FS.init.initialized=!1;var e=Module._fflush;e&&e(0);for(var t=0;t<FS.streams.length;t++){var r=FS.streams[t];r&&FS.close(r)}},getMode:function(e,t){var r=0;return e&&(r|=365),t&&(r|=146),r},findObject:function(e,t){var r=FS.analyzePath(e,t);return r.exists?r.object:null},analyzePath:function(e,t){try{e=(n=FS.lookupPath(e,{follow:!t})).path}catch(e){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=FS.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=PATH.basename(e),n=FS.lookupPath(e,{follow:!t}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot="/"===n.path}catch(e){r.error=e.errno}return r},createPath:function(e,t,r,n){e="string"==typeof e?e:FS.getPath(e);for(var o=t.split("/").reverse();o.length;){var _=o.pop();if(_){var a=PATH.join2(e,_);try{FS.mkdir(a)}catch(e){}e=a}}return a},createFile:function(e,t,r,n,o){var _=PATH.join2("string"==typeof e?e:FS.getPath(e),t),a=FS.getMode(n,o);return FS.create(_,a)},createDataFile:function(e,t,r,n,o,_){var a=t?PATH.join2("string"==typeof e?e:FS.getPath(e),t):e,s=FS.getMode(n,o),i=FS.create(a,s);if(r){if("string"==typeof r){for(var u=new Array(r.length),l=0,c=r.length;l<c;++l)u[l]=r.charCodeAt(l);r=u}FS.chmod(i,146|s);var d=FS.open(i,577);FS.write(d,r,0,r.length,0,_),FS.close(d),FS.chmod(i,s)}return i},createDevice:function(e,t,r,n){var o=PATH.join2("string"==typeof e?e:FS.getPath(e),t),_=FS.getMode(!!r,!!n);FS.createDevice.major||(FS.createDevice.major=64);var a=FS.makedev(FS.createDevice.major++,0);return FS.registerDevice(a,{open:function(e){e.seekable=!1},close:function(e){n&&n.buffer&&n.buffer.length&&n(10)},read:function(e,t,n,o,_){for(var a=0,s=0;s<o;s++){var i;try{i=r()}catch(e){throw new FS.ErrnoError(29)}if(void 0===i&&0===a)throw new FS.ErrnoError(6);if(null==i)break;a++,t[n+s]=i}return a&&(e.node.timestamp=Date.now()),a},write:function(e,t,r,o,_){for(var a=0;a<o;a++)try{n(t[r+a])}catch(e){throw new FS.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),a}}),FS.mkdev(o,_,a)},forceLoadFile:function(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!read_)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=intArrayFromString(read_(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new FS.ErrnoError(29)}},createLazyFile:function(e,t,r,n,o){function _(){this.lengthKnown=!1,this.chunks=[]}if(_.prototype.get=function(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,r=e/this.chunkSize|0;return this.getter(r)[t]}},_.prototype.setDataGetter=function(e){this.getter=e},_.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",r,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+r+". Status: "+e.status);var t,n=Number(e.getResponseHeader("Content-length")),o=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,_=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,a=1048576;o||(a=n);var s=this;s.setDataGetter((function(e){var t=e*a,o=(e+1)*a-1;if(o=Math.min(o,n-1),void 0===s.chunks[e]&&(s.chunks[e]=function(e,t){if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",r,!1),n!==a&&o.setRequestHeader("Range","bytes="+e+"-"+t),"undefined"!=typeof Uint8Array&&(o.responseType="arraybuffer"),o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+r+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):intArrayFromString(o.responseText||"",!0)}(t,o)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!_&&n||(a=n=1,n=this.getter(0).length,a=n,out("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!ENVIRONMENT_IS_W