@hpcc-js/wasm 1.17.1 → 1.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/bin/cli.js +1 -1
- package/dist/expatlib.wasm +0 -0
- package/dist/graphviz.es6.js +1 -1
- package/dist/graphviz.es6.js.map +1 -1
- package/dist/graphviz.js +1 -1
- package/dist/graphviz.js.map +1 -1
- package/dist/graphvizlib.wasm +0 -0
- package/dist/index.es6.js +1 -1
- package/dist/index.es6.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/index.node.es6.mjs +1 -1
- package/dist/index.node.es6.mjs.map +1 -1
- package/dist/index.node.js +1 -1
- package/dist/index.node.js.map +1 -1
- package/package.json +1 -1
package/dist/index.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(r,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((r="undefined"!=typeof globalThis?globalThis:r||self)["@hpcc-js/wasm"]={})}(this,(function(r){"use strict";const t={doFetch:void 0,scriptDir:void 0};let e=globalThis.__hpcc_wasmFolder||void 0;function n(r){if(!arguments.length)return e;const t=e;return e=r,t}const o={};async function a(r,e,a,i){const s=`${function(r,t){for(;r.charAt(r.length-1)===t;)r=r.substring(0,r.length-1);return r}(a||n()||t.scriptDir||".","/")}/${function(r,t){for(;r.charAt(0)===t;)r=r.substring(1);return r}(`${e}.wasm`,"/")}`;return o[s]||(o[s]=async function(r,e,n){const o=r.default||r;return n||(n=await t.doFetch(e)),await o({wasmBinary:n})}(r,s,i)),o[s]}let i=document?.currentScript?.src??"";const s=i.substring(0,i.replace(/[?#].*/,"").lastIndexOf("/")+1)+"../dist";var u=(()=>{var r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0;return function(t){var e,n,o=void 0!==(t=t||{})?t:{};o.ready=new Promise((function(r,t){e=r,n=t}));var a=Object.assign({},o),i="./this.program",s="";"undefined"!=typeof document&&document.currentScript&&(s=document.currentScript.src),r&&(s=r),s=0!==s.indexOf("blob:")?s.substr(0,s.replace(/[?#].*/,"").lastIndexOf("/")+1):"";var u,c,p=o.print||console.log.bind(console),l=o.printErr||console.warn.bind(console);Object.assign(o,a),a=null,o.arguments&&o.arguments,o.thisProgram&&(i=o.thisProgram),o.quit&&o.quit,o.wasmBinary&&(u=o.wasmBinary),o.noExitRuntime,"object"!=typeof WebAssembly&&F("no native wasm support detected");var f=!1;function d(r,t){r||F(t)}var m,h,_,v,y,w,E="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function g(r,t,e){for(var n=t+e,o=t;r[o]&&!(o>=n);)++o;if(o-t>16&&r.buffer&&E)return E.decode(r.subarray(t,o));for(var a="";t<o;){var i=r[t++];if(128&i){var s=63&r[t++];if(192!=(224&i)){var u=63&r[t++];if((i=224==(240&i)?(15&i)<<12|s<<6|u:(7&i)<<18|s<<12|u<<6|63&r[t++])<65536)a+=String.fromCharCode(i);else{var c=i-65536;a+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a}function b(r,t){return r?g(_,r,t):""}function k(r){m=r,o.HEAP8=h=new Int8Array(r),o.HEAP16=new Int16Array(r),o.HEAP32=v=new Int32Array(r),o.HEAPU8=_=new Uint8Array(r),o.HEAPU16=new Uint16Array(r),o.HEAPU32=y=new Uint32Array(r),o.HEAPF32=new Float32Array(r),o.HEAPF64=w=new Float64Array(r)}o.INITIAL_MEMORY;var S=[],D=[],A=[];var x=0,P=null;function F(r){o.onAbort&&o.onAbort(r),l(r="Aborted("+r+")"),f=!0,r+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(r);throw n(t),t}var C,M;function R(r){return r.startsWith("data:application/octet-stream;base64,")}function z(r){try{if(r==C&&u)return new Uint8Array(u);throw"both async and sync fetching of the wasm failed"}catch(r){F(r)}}R(C="expatlib.wasm")||(M=C,C=o.locateFile?o.locateFile(M,s):s+M);var j={11554:r=>{var t=o.getCache(o.CExpatJS)[r];if(!t.hasOwnProperty("startElement"))throw"a JSImplementation must implement all functions, you forgot CExpatJS::startElement.";t.startElement()},11772:r=>{var t=o.getCache(o.CExpatJS)[r];if(!t.hasOwnProperty("endElement"))throw"a JSImplementation must implement all functions, you forgot CExpatJS::endElement.";t.endElement()},11984:r=>{var t=o.getCache(o.CExpatJS)[r];if(!t.hasOwnProperty("characterData"))throw"a JSImplementation must implement all functions, you forgot CExpatJS::characterData.";t.characterData()}};function T(r){for(;r.length>0;)r.shift()(o)}var O=[];function B(r){try{return c.grow(r-m.byteLength+65535>>>16),k(c.buffer),1}catch(r){}}var N={};function I(){if(!I.strings){var r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:i||"./this.program"};for(var t in N)void 0===N[t]?delete r[t]:r[t]=N[t];var e=[];for(var t in r)e.push(t+"="+r[t]);I.strings=e}return I.strings}var L=[null,[],[]];function H(r,t){var e=L[r];0===t||10===t?((1===r?p:l)(g(e,0)),e.length=0):e.push(t)}var U={g:function(r,t,e,n){},c:function(){F("")},a:function(r,t,e){var n=function(r,t){var e;for(O.length=0,t>>=2;e=_[r++];)t+=105!=e&t,O.push(105==e?v[t]:w[t++>>1]),++t;return O}(t,e);return j[r].apply(null,n)},j:function(){return Date.now()},k:function(r,t,e){_.copyWithin(r,t,t+e)},e:function(r){var t,e,n=_.length,o=2147483648;if((r>>>=0)>o)return!1;for(var a=1;a<=4;a*=2){var i=n*(1+.2/a);if(i=Math.min(i,r+100663296),B(Math.min(o,(t=Math.max(r,i))+((e=65536)-t%e)%e)))return!0}return!1},h:function(r,t){var e=0;return I().forEach((function(n,o){var a=t+e;y[r+4*o>>2]=a,function(r,t,e){for(var n=0;n<r.length;++n)h[t++>>0]=r.charCodeAt(n);e||(h[t>>0]=0)}(n,a),e+=n.length+1})),0},i:function(r,t){var e=I();y[r>>2]=e.length;var n=0;return e.forEach((function(r){n+=r.length+1})),y[t>>2]=n,0},d:function(r){return 52},f:function(r,t,e,n){return 52},l:function(r,t,e,n,o){return 70},b:function(r,t,e,n){for(var o=0,a=0;a<e;a++){var i=y[t>>2],s=y[t+4>>2];t+=8;for(var u=0;u<s;u++)H(r,_[i+u]);o+=s}return y[n>>2]=o,0}};!function(){var r={a:U};function t(r,t){var e,n=r.exports;o.asm=n,k((c=o.asm.m).buffer),o.asm.G,e=o.asm.n,D.unshift(e),function(r){if(x--,o.monitorRunDependencies&&o.monitorRunDependencies(x),0==x&&P){var t=P;P=null,t()}}()}function e(r){t(r.instance)}function a(t){return(u||"function"!=typeof fetch?Promise.resolve().then((function(){return z(C)})):fetch(C,{credentials:"same-origin"}).then((function(r){if(!r.ok)throw"failed to load wasm binary file at '"+C+"'";return r.arrayBuffer()})).catch((function(){return z(C)}))).then((function(t){return WebAssembly.instantiate(t,r)})).then((function(r){return r})).then(t,(function(r){l("failed to asynchronously prepare wasm: "+r),F(r)}))}if(x++,o.monitorRunDependencies&&o.monitorRunDependencies(x),o.instantiateWasm)try{return o.instantiateWasm(r,t)}catch(r){l("Module.instantiateWasm callback failed with error: "+r),n(r)}(u||"function"!=typeof WebAssembly.instantiateStreaming||R(C)||"function"!=typeof fetch?a(e):fetch(C,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,r).then(e,(function(r){return l("wasm streaming compile failed: "+r),l("falling back to ArrayBuffer instantiation"),a(e)}))}))).catch(n)}(),o.___wasm_call_ctors=function(){return(o.___wasm_call_ctors=o.asm.n).apply(null,arguments)};var G,W=o._emscripten_bind_CExpat_CExpat_0=function(){return(W=o._emscripten_bind_CExpat_CExpat_0=o.asm.o).apply(null,arguments)},J=o._emscripten_bind_CExpat_version_0=function(){return(J=o._emscripten_bind_CExpat_version_0=o.asm.p).apply(null,arguments)},q=o._emscripten_bind_CExpat_create_0=function(){return(q=o._emscripten_bind_CExpat_create_0=o.asm.q).apply(null,arguments)},V=o._emscripten_bind_CExpat_destroy_0=function(){return(V=o._emscripten_bind_CExpat_destroy_0=o.asm.r).apply(null,arguments)},X=o._emscripten_bind_CExpat_parse_1=function(){return(X=o._emscripten_bind_CExpat_parse_1=o.asm.s).apply(null,arguments)},$=o._emscripten_bind_CExpat_tag_0=function(){return($=o._emscripten_bind_CExpat_tag_0=o.asm.t).apply(null,arguments)},Y=o._emscripten_bind_CExpat_attrs_0=function(){return(Y=o._emscripten_bind_CExpat_attrs_0=o.asm.u).apply(null,arguments)},K=o._emscripten_bind_CExpat_content_0=function(){return(K=o._emscripten_bind_CExpat_content_0=o.asm.v).apply(null,arguments)},Q=o._emscripten_bind_CExpat_startElement_0=function(){return(Q=o._emscripten_bind_CExpat_startElement_0=o.asm.w).apply(null,arguments)},Z=o._emscripten_bind_CExpat_endElement_0=function(){return(Z=o._emscripten_bind_CExpat_endElement_0=o.asm.x).apply(null,arguments)},rr=o._emscripten_bind_CExpat_characterData_0=function(){return(rr=o._emscripten_bind_CExpat_characterData_0=o.asm.y).apply(null,arguments)},tr=o._emscripten_bind_CExpat___destroy___0=function(){return(tr=o._emscripten_bind_CExpat___destroy___0=o.asm.z).apply(null,arguments)},er=o._emscripten_bind_VoidPtr___destroy___0=function(){return(er=o._emscripten_bind_VoidPtr___destroy___0=o.asm.A).apply(null,arguments)},nr=o._emscripten_bind_CExpatJS_CExpatJS_0=function(){return(nr=o._emscripten_bind_CExpatJS_CExpatJS_0=o.asm.B).apply(null,arguments)},or=o._emscripten_bind_CExpatJS_startElement_0=function(){return(or=o._emscripten_bind_CExpatJS_startElement_0=o.asm.C).apply(null,arguments)},ar=o._emscripten_bind_CExpatJS_endElement_0=function(){return(ar=o._emscripten_bind_CExpatJS_endElement_0=o.asm.D).apply(null,arguments)},ir=o._emscripten_bind_CExpatJS_characterData_0=function(){return(ir=o._emscripten_bind_CExpatJS_characterData_0=o.asm.E).apply(null,arguments)},sr=o._emscripten_bind_CExpatJS___destroy___0=function(){return(sr=o._emscripten_bind_CExpatJS___destroy___0=o.asm.F).apply(null,arguments)};function ur(r){function t(){G||(G=!0,o.calledRun=!0,f||(T(D),e(o),o.onRuntimeInitialized&&o.onRuntimeInitialized(),function(){if(o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)r=o.postRun.shift(),A.unshift(r);var r;T(A)}()))}x>0||(!function(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)r=o.preRun.shift(),S.unshift(r);var r;T(S)}(),x>0||(o.setStatus?(o.setStatus("Running..."),setTimeout((function(){setTimeout((function(){o.setStatus("")}),1),t()}),1)):t()))}if(o._malloc=function(){return(o._malloc=o.asm.H).apply(null,arguments)},o.___start_em_js=11456,o.___stop_em_js=11554,P=function r(){G||ur(),G||(P=r)},o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();function cr(){}function pr(r){return(r||cr).__cache__}function lr(r,t){var e=pr(t),n=e[r];return n||((n=Object.create((t||cr).prototype)).ptr=r,e[r]=n)}ur(),cr.prototype=Object.create(cr.prototype),cr.prototype.constructor=cr,cr.prototype.__class__=cr,cr.__cache__={},o.WrapperObject=cr,o.getCache=pr,o.wrapPointer=lr,o.castObject=function(r,t){return lr(r.ptr,t)},o.NULL=lr(0),o.destroy=function(r){if(!r.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";r.__destroy__(),delete pr(r.__class__)[r.ptr]},o.compare=function(r,t){return r.ptr===t.ptr},o.getPointer=function(r){return r.ptr},o.getClass=function(r){return r.__class__};var fr={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(fr.needed){for(var r=0;r<fr.temps.length;r++)o._free(fr.temps[r]);fr.temps.length=0,o._free(fr.buffer),fr.buffer=0,fr.size+=fr.needed,fr.needed=0}fr.buffer||(fr.size+=128,fr.buffer=o._malloc(fr.size),d(fr.buffer)),fr.pos=0},alloc:function(r,t){d(fr.buffer);var e,n=t.BYTES_PER_ELEMENT,a=r.length*n;return a=a+7&-8,fr.pos+a>=fr.size?(d(a>0),fr.needed+=a,e=o._malloc(a),fr.temps.push(e)):(e=fr.buffer+fr.pos,fr.pos+=a),e},copy:function(r,t,e){switch(e>>>=0,t.BYTES_PER_ELEMENT){case 2:e>>>=1;break;case 4:e>>>=2;break;case 8:e>>>=3}for(var n=0;n<r.length;n++)t[e+n]=r[n]}};function dr(r){if("string"==typeof r){var t=(n=r,i=a>0?a:function(r){for(var t=0,e=0;e<r.length;++e){var n=r.charCodeAt(e);n<=127?t++:n<=2047?t+=2:n>=55296&&n<=57343?(t+=4,++e):t+=3}return t}(n)+1,s=new Array(i),u=function(r,t,e,n){if(!(n>0))return 0;for(var o=e,a=e+n-1,i=0;i<r.length;++i){var s=r.charCodeAt(i);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&r.charCodeAt(++i)),s<=127){if(e>=a)break;t[e++]=s}else if(s<=2047){if(e+1>=a)break;t[e++]=192|s>>6,t[e++]=128|63&s}else if(s<=65535){if(e+2>=a)break;t[e++]=224|s>>12,t[e++]=128|s>>6&63,t[e++]=128|63&s}else{if(e+3>=a)break;t[e++]=240|s>>18,t[e++]=128|s>>12&63,t[e++]=128|s>>6&63,t[e++]=128|63&s}}return t[e]=0,e-o}(n,s,0,s.length),o&&(s.length=u),s),e=fr.alloc(t,h);return fr.copy(t,h,e),e}var n,o,a,i,s,u;return r}function mr(){this.ptr=W(),pr(mr)[this.ptr]=this}function hr(){throw"cannot construct a VoidPtr, no constructor in IDL"}function _r(){this.ptr=nr(),pr(_r)[this.ptr]=this}return mr.prototype=Object.create(cr.prototype),mr.prototype.constructor=mr,mr.prototype.__class__=mr,mr.__cache__={},o.CExpat=mr,mr.prototype.version=mr.prototype.version=function(){var r=this.ptr;return b(J(r))},mr.prototype.create=mr.prototype.create=function(){var r=this.ptr;return!!q(r)},mr.prototype.destroy=mr.prototype.destroy=function(){var r=this.ptr;V(r)},mr.prototype.parse=mr.prototype.parse=function(r){var t=this.ptr;return fr.prepare(),r=r&&"object"==typeof r?r.ptr:dr(r),!!X(t,r)},mr.prototype.tag=mr.prototype.tag=function(){var r=this.ptr;return b($(r))},mr.prototype.attrs=mr.prototype.attrs=function(){var r=this.ptr;return b(Y(r))},mr.prototype.content=mr.prototype.content=function(){var r=this.ptr;return b(K(r))},mr.prototype.startElement=mr.prototype.startElement=function(){var r=this.ptr;Q(r)},mr.prototype.endElement=mr.prototype.endElement=function(){var r=this.ptr;Z(r)},mr.prototype.characterData=mr.prototype.characterData=function(){var r=this.ptr;rr(r)},mr.prototype.__destroy__=mr.prototype.__destroy__=function(){var r=this.ptr;tr(r)},hr.prototype=Object.create(cr.prototype),hr.prototype.constructor=hr,hr.prototype.__class__=hr,hr.__cache__={},o.VoidPtr=hr,hr.prototype.__destroy__=hr.prototype.__destroy__=function(){var r=this.ptr;er(r)},_r.prototype=Object.create(mr.prototype),_r.prototype.constructor=_r,_r.prototype.__class__=_r,_r.__cache__={},o.CExpatJS=_r,_r.prototype.startElement=_r.prototype.startElement=function(){var r=this.ptr;or(r)},_r.prototype.endElement=_r.prototype.endElement=function(){var r=this.ptr;ar(r)},_r.prototype.characterData=_r.prototype.characterData=function(){var r=this.ptr;ir(r)},_r.prototype.__destroy__=_r.prototype.__destroy__=function(){var r=this.ptr;sr(r)},t.ready}})(),c=Object.freeze({__proto__:null,default:u});class p{constructor(r,t){this.tag=r,this.attrs=t,this._content=""}get content(){return this._content}appendContent(r){this._content+=r}}function l(r,t,e,n){return a(c,"expatlib",e,n).then((e=>{const n=new e.CExpatJS;n.startElement=function(){t.startElement(this.tag(),function(r){const t={},e=r,n=`${String.fromCharCode(1)}`,o=`${n}${n}`;return e.split(o).filter((r=>!!r)).forEach((r=>{const e=r.split(n);t[e[0]]=e[1]})),t}(this.attrs()))},n.endElement=function(){t.endElement(this.tag())},n.characterData=function(){t.characterData(this.content())},n.create();const o=n.parse(r);return n.destroy(),e.destroy(n),o}))}var f=(()=>{var r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0;return function(t){var e,n,o=void 0!==(t=t||{})?t:{};o.ready=new Promise((function(r,t){e=r,n=t}));var a,i,s=Object.assign({},o),u="./this.program",c=(r,t)=>{throw t},p="";"undefined"!=typeof document&&document.currentScript&&(p=document.currentScript.src),r&&(p=r),p=0!==p.indexOf("blob:")?p.substr(0,p.replace(/[?#].*/,"").lastIndexOf("/")+1):"",a=r=>{var t=new XMLHttpRequest;return t.open("GET",r,!1),t.send(null),t.responseText},i=(r,t,e)=>{var n=new XMLHttpRequest;n.open("GET",r,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?t(n.response):e()},n.onerror=e,n.send(null)};var l,f=o.print||console.log.bind(console),d=o.printErr||console.warn.bind(console);Object.assign(o,s),s=null,o.arguments&&o.arguments,o.thisProgram&&(u=o.thisProgram),o.quit&&(c=o.quit),o.wasmBinary&&(l=o.wasmBinary);var m,h=o.noExitRuntime||!0;"object"!=typeof WebAssembly&&N("no native wasm support detected");var _=!1;function v(r,t){r||N(t)}var y,w,E,g,b,k,S,D="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function A(r,t,e){for(var n=t+e,o=t;r[o]&&!(o>=n);)++o;if(o-t>16&&r.buffer&&D)return D.decode(r.subarray(t,o));for(var a="";t<o;){var i=r[t++];if(128&i){var s=63&r[t++];if(192!=(224&i)){var u=63&r[t++];if((i=224==(240&i)?(15&i)<<12|s<<6|u:(7&i)<<18|s<<12|u<<6|63&r[t++])<65536)a+=String.fromCharCode(i);else{var c=i-65536;a+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a}function x(r,t){return r?A(E,r,t):""}function P(r,t,e,n){if(!(n>0))return 0;for(var o=e,a=e+n-1,i=0;i<r.length;++i){var s=r.charCodeAt(i);if(s>=55296&&s<=57343)s=65536+((1023&s)<<10)|1023&r.charCodeAt(++i);if(s<=127){if(e>=a)break;t[e++]=s}else if(s<=2047){if(e+1>=a)break;t[e++]=192|s>>6,t[e++]=128|63&s}else if(s<=65535){if(e+2>=a)break;t[e++]=224|s>>12,t[e++]=128|s>>6&63,t[e++]=128|63&s}else{if(e+3>=a)break;t[e++]=240|s>>18,t[e++]=128|s>>12&63,t[e++]=128|s>>6&63,t[e++]=128|63&s}}return t[e]=0,e-o}function F(r){for(var t=0,e=0;e<r.length;++e){var n=r.charCodeAt(e);n<=127?t++:n<=2047?t+=2:n>=55296&&n<=57343?(t+=4,++e):t+=3}return t}function C(r){y=r,o.HEAP8=w=new Int8Array(r),o.HEAP16=g=new Int16Array(r),o.HEAP32=b=new Int32Array(r),o.HEAPU8=E=new Uint8Array(r),o.HEAPU16=new Uint16Array(r),o.HEAPU32=k=new Uint32Array(r),o.HEAPF32=new Float32Array(r),o.HEAPF64=S=new Float64Array(r)}o.INITIAL_MEMORY;var M=[],R=[],z=[];var j=0,T=null;function O(r){j++,o.monitorRunDependencies&&o.monitorRunDependencies(j)}function B(r){if(j--,o.monitorRunDependencies&&o.monitorRunDependencies(j),0==j&&T){var t=T;T=null,t()}}function N(r){o.onAbort&&o.onAbort(r),d(r="Aborted("+r+")"),_=!0,r+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(r);throw n(t),t}var I,L,H,U;function G(r){return r.startsWith("data:application/octet-stream;base64,")}function W(r){try{if(r==I&&l)return new Uint8Array(l);throw"both async and sync fetching of the wasm failed"}catch(r){N(r)}}G(I="graphvizlib.wasm")||(L=I,I=o.locateFile?o.locateFile(L,p):p+L);var J={163184:(r,t)=>{var e=x(r),n=x(t);rr.createPath("/",X.dirname(e)),rr.writeFile(X.join("/",e),n)}};function q(r){this.name="ExitStatus",this.message="Program terminated with exit("+r+")",this.status=r}function V(r){for(;r.length>0;)r.shift()(o)}var X={isAbs:r=>"/"===r.charAt(0),splitPath:r=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(r).slice(1),normalizeArray:(r,t)=>{for(var e=0,n=r.length-1;n>=0;n--){var o=r[n];"."===o?r.splice(n,1):".."===o?(r.splice(n,1),e++):e&&(r.splice(n,1),e--)}if(t)for(;e;e--)r.unshift("..");return r},normalize:r=>{var t=X.isAbs(r),e="/"===r.substr(-1);return(r=X.normalizeArray(r.split("/").filter((r=>!!r)),!t).join("/"))||t||(r="."),r&&e&&(r+="/"),(t?"/":"")+r},dirname:r=>{var t=X.splitPath(r),e=t[0],n=t[1];return e||n?(n&&(n=n.substr(0,n.length-1)),e+n):"."},basename:r=>{if("/"===r)return"/";var t=(r=(r=X.normalize(r)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?r:r.substr(t+1)},join:function(){var r=Array.prototype.slice.call(arguments);return X.normalize(r.join("/"))},join2:(r,t)=>X.normalize(r+"/"+t)};var $={resolve:function(){for(var r="",t=!1,e=arguments.length-1;e>=-1&&!t;e--){var n=e>=0?arguments[e]:rr.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";r=n+"/"+r,t=X.isAbs(n)}return(t?"/":"")+(r=X.normalizeArray(r.split("/").filter((r=>!!r)),!t).join("/"))||"."},relative:(r,t)=>{function e(r){for(var t=0;t<r.length&&""===r[t];t++);for(var e=r.length-1;e>=0&&""===r[e];e--);return t>e?[]:r.slice(t,e-t+1)}r=$.resolve(r).substr(1),t=$.resolve(t).substr(1);for(var n=e(r.split("/")),o=e(t.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s<a;s++)if(n[s]!==o[s]){i=s;break}var u=[];for(s=i;s<n.length;s++)u.push("..");return(u=u.concat(o.slice(i))).join("/")}};function Y(r,t,e){var n=e>0?e:F(r)+1,o=new Array(n),a=P(r,o,0,o.length);return t&&(o.length=a),o}var K={ttys:[],init:function(){},shutdown:function(){},register:function(r,t){K.ttys[r]={input:[],output:[],ops:t},rr.registerDevice(r,K.stream_ops)},stream_ops:{open:function(r){var t=K.ttys[r.node.rdev];if(!t)throw new rr.ErrnoError(43);r.tty=t,r.seekable=!1},close:function(r){r.tty.ops.fsync(r.tty)},fsync:function(r){r.tty.ops.fsync(r.tty)},read:function(r,t,e,n,o){if(!r.tty||!r.tty.ops.get_char)throw new rr.ErrnoError(60);for(var a=0,i=0;i<n;i++){var s;try{s=r.tty.ops.get_char(r.tty)}catch(r){throw new rr.ErrnoError(29)}if(void 0===s&&0===a)throw new rr.ErrnoError(6);if(null==s)break;a++,t[e+i]=s}return a&&(r.node.timestamp=Date.now()),a},write:function(r,t,e,n,o){if(!r.tty||!r.tty.ops.put_char)throw new rr.ErrnoError(60);try{for(var a=0;a<n;a++)r.tty.ops.put_char(r.tty,t[e+a])}catch(r){throw new rr.ErrnoError(29)}return n&&(r.node.timestamp=Date.now()),a}},default_tty_ops:{get_char:function(r){if(!r.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;r.input=Y(t,!0)}return r.input.shift()},put_char:function(r,t){null===t||10===t?(f(A(r.output,0)),r.output=[]):0!=t&&r.output.push(t)},fsync:function(r){r.output&&r.output.length>0&&(f(A(r.output,0)),r.output=[])}},default_tty1_ops:{put_char:function(r,t){null===t||10===t?(d(A(r.output,0)),r.output=[]):0!=t&&r.output.push(t)},fsync:function(r){r.output&&r.output.length>0&&(d(A(r.output,0)),r.output=[])}}};function Q(r){r=function(r,t){return Math.ceil(r/t)*t}(r,65536);var t=gr(65536,r);return t?function(r,t){return E.fill(0,r,r+t),r}(t,r):0}var Z={ops_table:null,mount:function(r){return Z.createNode(null,"/",16895,0)},createNode:function(r,t,e,n){if(rr.isBlkdev(e)||rr.isFIFO(e))throw new rr.ErrnoError(63);Z.ops_table||(Z.ops_table={dir:{node:{getattr:Z.node_ops.getattr,setattr:Z.node_ops.setattr,lookup:Z.node_ops.lookup,mknod:Z.node_ops.mknod,rename:Z.node_ops.rename,unlink:Z.node_ops.unlink,rmdir:Z.node_ops.rmdir,readdir:Z.node_ops.readdir,symlink:Z.node_ops.symlink},stream:{llseek:Z.stream_ops.llseek}},file:{node:{getattr:Z.node_ops.getattr,setattr:Z.node_ops.setattr},stream:{llseek:Z.stream_ops.llseek,read:Z.stream_ops.read,write:Z.stream_ops.write,allocate:Z.stream_ops.allocate,mmap:Z.stream_ops.mmap,msync:Z.stream_ops.msync}},link:{node:{getattr:Z.node_ops.getattr,setattr:Z.node_ops.setattr,readlink:Z.node_ops.readlink},stream:{}},chrdev:{node:{getattr:Z.node_ops.getattr,setattr:Z.node_ops.setattr},stream:rr.chrdev_stream_ops}});var o=rr.createNode(r,t,e,n);return rr.isDir(o.mode)?(o.node_ops=Z.ops_table.dir.node,o.stream_ops=Z.ops_table.dir.stream,o.contents={}):rr.isFile(o.mode)?(o.node_ops=Z.ops_table.file.node,o.stream_ops=Z.ops_table.file.stream,o.usedBytes=0,o.contents=null):rr.isLink(o.mode)?(o.node_ops=Z.ops_table.link.node,o.stream_ops=Z.ops_table.link.stream):rr.isChrdev(o.mode)&&(o.node_ops=Z.ops_table.chrdev.node,o.stream_ops=Z.ops_table.chrdev.stream),o.timestamp=Date.now(),r&&(r.contents[t]=o,r.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(r){return r.contents?r.contents.subarray?r.contents.subarray(0,r.usedBytes):new Uint8Array(r.contents):new Uint8Array(0)},expandFileStorage:function(r,t){var e=r.contents?r.contents.length:0;if(!(e>=t)){t=Math.max(t,e*(e<1048576?2:1.125)>>>0),0!=e&&(t=Math.max(t,256));var n=r.contents;r.contents=new Uint8Array(t),r.usedBytes>0&&r.contents.set(n.subarray(0,r.usedBytes),0)}},resizeFileStorage:function(r,t){if(r.usedBytes!=t)if(0==t)r.contents=null,r.usedBytes=0;else{var e=r.contents;r.contents=new Uint8Array(t),e&&r.contents.set(e.subarray(0,Math.min(t,r.usedBytes))),r.usedBytes=t}},node_ops:{getattr:function(r){var t={};return t.dev=rr.isChrdev(r.mode)?r.id:1,t.ino=r.id,t.mode=r.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=r.rdev,rr.isDir(r.mode)?t.size=4096:rr.isFile(r.mode)?t.size=r.usedBytes:rr.isLink(r.mode)?t.size=r.link.length:t.size=0,t.atime=new Date(r.timestamp),t.mtime=new Date(r.timestamp),t.ctime=new Date(r.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr:function(r,t){void 0!==t.mode&&(r.mode=t.mode),void 0!==t.timestamp&&(r.timestamp=t.timestamp),void 0!==t.size&&Z.resizeFileStorage(r,t.size)},lookup:function(r,t){throw rr.genericErrors[44]},mknod:function(r,t,e,n){return Z.createNode(r,t,e,n)},rename:function(r,t,e){if(rr.isDir(r.mode)){var n;try{n=rr.lookupNode(t,e)}catch(r){}if(n)for(var o in n.contents)throw new rr.ErrnoError(55)}delete r.parent.contents[r.name],r.parent.timestamp=Date.now(),r.name=e,t.contents[e]=r,t.timestamp=r.parent.timestamp,r.parent=t},unlink:function(r,t){delete r.contents[t],r.timestamp=Date.now()},rmdir:function(r,t){var e=rr.lookupNode(r,t);for(var n in e.contents)throw new rr.ErrnoError(55);delete r.contents[t],r.timestamp=Date.now()},readdir:function(r){var t=[".",".."];for(var e in r.contents)r.contents.hasOwnProperty(e)&&t.push(e);return t},symlink:function(r,t,e){var n=Z.createNode(r,t,41471,0);return n.link=e,n},readlink:function(r){if(!rr.isLink(r.mode))throw new rr.ErrnoError(28);return r.link}},stream_ops:{read:function(r,t,e,n,o){var a=r.node.contents;if(o>=r.node.usedBytes)return 0;var i=Math.min(r.node.usedBytes-o,n);if(i>8&&a.subarray)t.set(a.subarray(o,o+i),e);else for(var s=0;s<i;s++)t[e+s]=a[o+s];return i},write:function(r,t,e,n,o,a){if(t.buffer===w.buffer&&(a=!1),!n)return 0;var i=r.node;if(i.timestamp=Date.now(),t.subarray&&(!i.contents||i.contents.subarray)){if(a)return i.contents=t.subarray(e,e+n),i.usedBytes=n,n;if(0===i.usedBytes&&0===o)return i.contents=t.slice(e,e+n),i.usedBytes=n,n;if(o+n<=i.usedBytes)return i.contents.set(t.subarray(e,e+n),o),n}if(Z.expandFileStorage(i,o+n),i.contents.subarray&&t.subarray)i.contents.set(t.subarray(e,e+n),o);else for(var s=0;s<n;s++)i.contents[o+s]=t[e+s];return i.usedBytes=Math.max(i.usedBytes,o+n),n},llseek:function(r,t,e){var n=t;if(1===e?n+=r.position:2===e&&rr.isFile(r.node.mode)&&(n+=r.node.usedBytes),n<0)throw new rr.ErrnoError(28);return n},allocate:function(r,t,e){Z.expandFileStorage(r.node,t+e),r.node.usedBytes=Math.max(r.node.usedBytes,t+e)},mmap:function(r,t,e,n,o){if(!rr.isFile(r.node.mode))throw new rr.ErrnoError(43);var a,i,s=r.node.contents;if(2&o||s.buffer!==y){if((e>0||e+t<s.length)&&(s=s.subarray?s.subarray(e,e+t):Array.prototype.slice.call(s,e,e+t)),i=!0,!(a=Q(t)))throw new rr.ErrnoError(48);w.set(s,a)}else i=!1,a=s.byteOffset;return{ptr:a,allocated:i}},msync:function(r,t,e,n,o){return Z.stream_ops.write(r,t,0,n,e,!1),0}}};var rr={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(r,t={})=>{if(!(r=$.resolve(rr.cwd(),r)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new rr.ErrnoError(32);for(var e=X.normalizeArray(r.split("/").filter((r=>!!r)),!1),n=rr.root,o="/",a=0;a<e.length;a++){var i=a===e.length-1;if(i&&t.parent)break;if(n=rr.lookupNode(n,e[a]),o=X.join2(o,e[a]),rr.isMountpoint(n)&&(!i||i&&t.follow_mount)&&(n=n.mounted.root),!i||t.follow)for(var s=0;rr.isLink(n.mode);){var u=rr.readlink(o);if(o=$.resolve(X.dirname(o),u),n=rr.lookupPath(o,{recurse_count:t.recurse_count+1}).node,s++>40)throw new rr.ErrnoError(32)}}return{path:o,node:n}},getPath:r=>{for(var t;;){if(rr.isRoot(r)){var e=r.mount.mountpoint;return t?"/"!==e[e.length-1]?e+"/"+t:e+t:e}t=t?r.name+"/"+t:r.name,r=r.parent}},hashName:(r,t)=>{for(var e=0,n=0;n<t.length;n++)e=(e<<5)-e+t.charCodeAt(n)|0;return(r+e>>>0)%rr.nameTable.length},hashAddNode:r=>{var t=rr.hashName(r.parent.id,r.name);r.name_next=rr.nameTable[t],rr.nameTable[t]=r},hashRemoveNode:r=>{var t=rr.hashName(r.parent.id,r.name);if(rr.nameTable[t]===r)rr.nameTable[t]=r.name_next;else for(var e=rr.nameTable[t];e;){if(e.name_next===r){e.name_next=r.name_next;break}e=e.name_next}},lookupNode:(r,t)=>{var e=rr.mayLookup(r);if(e)throw new rr.ErrnoError(e,r);for(var n=rr.hashName(r.id,t),o=rr.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===r.id&&a===t)return o}return rr.lookup(r,t)},createNode:(r,t,e,n)=>{var o=new rr.FSNode(r,t,e,n);return rr.hashAddNode(o),o},destroyNode:r=>{rr.hashRemoveNode(r)},isRoot:r=>r===r.parent,isMountpoint:r=>!!r.mounted,isFile:r=>32768==(61440&r),isDir:r=>16384==(61440&r),isLink:r=>40960==(61440&r),isChrdev:r=>8192==(61440&r),isBlkdev:r=>24576==(61440&r),isFIFO:r=>4096==(61440&r),isSocket:r=>49152==(49152&r),flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:r=>{var t=rr.flagModes[r];if(void 0===t)throw new Error("Unknown file open mode: "+r);return t},flagsToPermissionString:r=>{var t=["r","w","rw"][3&r];return 512&r&&(t+="w"),t},nodePermissions:(r,t)=>rr.ignorePermissions||(!t.includes("r")||292&r.mode)&&(!t.includes("w")||146&r.mode)&&(!t.includes("x")||73&r.mode)?0:2,mayLookup:r=>{var t=rr.nodePermissions(r,"x");return t||(r.node_ops.lookup?0:2)},mayCreate:(r,t)=>{try{rr.lookupNode(r,t);return 20}catch(r){}return rr.nodePermissions(r,"wx")},mayDelete:(r,t,e)=>{var n;try{n=rr.lookupNode(r,t)}catch(r){return r.errno}var o=rr.nodePermissions(r,"wx");if(o)return o;if(e){if(!rr.isDir(n.mode))return 54;if(rr.isRoot(n)||rr.getPath(n)===rr.cwd())return 10}else if(rr.isDir(n.mode))return 31;return 0},mayOpen:(r,t)=>r?rr.isLink(r.mode)?32:rr.isDir(r.mode)&&("r"!==rr.flagsToPermissionString(t)||512&t)?31:rr.nodePermissions(r,rr.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd:(r=0,t=rr.MAX_OPEN_FDS)=>{for(var e=r;e<=t;e++)if(!rr.streams[e])return e;throw new rr.ErrnoError(33)},getStream:r=>rr.streams[r],createStream:(r,t,e)=>{rr.FSStream||(rr.FSStream=function(){this.shared={}},rr.FSStream.prototype={},Object.defineProperties(rr.FSStream.prototype,{object:{get:function(){return this.node},set:function(r){this.node=r}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}},flags:{get:function(){return this.shared.flags},set:function(r){this.shared.flags=r}},position:{get:function(){return this.shared.position},set:function(r){this.shared.position=r}}})),r=Object.assign(new rr.FSStream,r);var n=rr.nextfd(t,e);return r.fd=n,rr.streams[n]=r,r},closeStream:r=>{rr.streams[r]=null},chrdev_stream_ops:{open:r=>{var t=rr.getDevice(r.node.rdev);r.stream_ops=t.stream_ops,r.stream_ops.open&&r.stream_ops.open(r)},llseek:()=>{throw new rr.ErrnoError(70)}},major:r=>r>>8,minor:r=>255&r,makedev:(r,t)=>r<<8|t,registerDevice:(r,t)=>{rr.devices[r]={stream_ops:t}},getDevice:r=>rr.devices[r],getMounts:r=>{for(var t=[],e=[r];e.length;){var n=e.pop();t.push(n),e.push.apply(e,n.mounts)}return t},syncfs:(r,t)=>{"function"==typeof r&&(t=r,r=!1),rr.syncFSRequests++,rr.syncFSRequests>1&&d("warning: "+rr.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var e=rr.getMounts(rr.root.mount),n=0;function o(r){return rr.syncFSRequests--,t(r)}function a(r){if(r)return a.errored?void 0:(a.errored=!0,o(r));++n>=e.length&&o(null)}e.forEach((t=>{if(!t.type.syncfs)return a(null);t.type.syncfs(t,r,a)}))},mount:(r,t,e)=>{var n,o="/"===e,a=!e;if(o&&rr.root)throw new rr.ErrnoError(10);if(!o&&!a){var i=rr.lookupPath(e,{follow_mount:!1});if(e=i.path,n=i.node,rr.isMountpoint(n))throw new rr.ErrnoError(10);if(!rr.isDir(n.mode))throw new rr.ErrnoError(54)}var s={type:r,opts:t,mountpoint:e,mounts:[]},u=r.mount(s);return u.mount=s,s.root=u,o?rr.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:r=>{var t=rr.lookupPath(r,{follow_mount:!1});if(!rr.isMountpoint(t.node))throw new rr.ErrnoError(28);var e=t.node,n=e.mounted,o=rr.getMounts(n);Object.keys(rr.nameTable).forEach((r=>{for(var t=rr.nameTable[r];t;){var e=t.name_next;o.includes(t.mount)&&rr.destroyNode(t),t=e}})),e.mounted=null;var a=e.mount.mounts.indexOf(n);e.mount.mounts.splice(a,1)},lookup:(r,t)=>r.node_ops.lookup(r,t),mknod:(r,t,e)=>{var n=rr.lookupPath(r,{parent:!0}).node,o=X.basename(r);if(!o||"."===o||".."===o)throw new rr.ErrnoError(28);var a=rr.mayCreate(n,o);if(a)throw new rr.ErrnoError(a);if(!n.node_ops.mknod)throw new rr.ErrnoError(63);return n.node_ops.mknod(n,o,t,e)},create:(r,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,rr.mknod(r,t,0)),mkdir:(r,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,rr.mknod(r,t,0)),mkdirTree:(r,t)=>{for(var e=r.split("/"),n="",o=0;o<e.length;++o)if(e[o]){n+="/"+e[o];try{rr.mkdir(n,t)}catch(r){if(20!=r.errno)throw r}}},mkdev:(r,t,e)=>(void 0===e&&(e=t,t=438),t|=8192,rr.mknod(r,t,e)),symlink:(r,t)=>{if(!$.resolve(r))throw new rr.ErrnoError(44);var e=rr.lookupPath(t,{parent:!0}).node;if(!e)throw new rr.ErrnoError(44);var n=X.basename(t),o=rr.mayCreate(e,n);if(o)throw new rr.ErrnoError(o);if(!e.node_ops.symlink)throw new rr.ErrnoError(63);return e.node_ops.symlink(e,n,r)},rename:(r,t)=>{var e,n,o=X.dirname(r),a=X.dirname(t),i=X.basename(r),s=X.basename(t);if(e=rr.lookupPath(r,{parent:!0}).node,n=rr.lookupPath(t,{parent:!0}).node,!e||!n)throw new rr.ErrnoError(44);if(e.mount!==n.mount)throw new rr.ErrnoError(75);var u,c=rr.lookupNode(e,i),p=$.relative(r,a);if("."!==p.charAt(0))throw new rr.ErrnoError(28);if("."!==(p=$.relative(t,o)).charAt(0))throw new rr.ErrnoError(55);try{u=rr.lookupNode(n,s)}catch(r){}if(c!==u){var l=rr.isDir(c.mode),f=rr.mayDelete(e,i,l);if(f)throw new rr.ErrnoError(f);if(f=u?rr.mayDelete(n,s,l):rr.mayCreate(n,s))throw new rr.ErrnoError(f);if(!e.node_ops.rename)throw new rr.ErrnoError(63);if(rr.isMountpoint(c)||u&&rr.isMountpoint(u))throw new rr.ErrnoError(10);if(n!==e&&(f=rr.nodePermissions(e,"w")))throw new rr.ErrnoError(f);rr.hashRemoveNode(c);try{e.node_ops.rename(c,n,s)}catch(r){throw r}finally{rr.hashAddNode(c)}}},rmdir:r=>{var t=rr.lookupPath(r,{parent:!0}).node,e=X.basename(r),n=rr.lookupNode(t,e),o=rr.mayDelete(t,e,!0);if(o)throw new rr.ErrnoError(o);if(!t.node_ops.rmdir)throw new rr.ErrnoError(63);if(rr.isMountpoint(n))throw new rr.ErrnoError(10);t.node_ops.rmdir(t,e),rr.destroyNode(n)},readdir:r=>{var t=rr.lookupPath(r,{follow:!0}).node;if(!t.node_ops.readdir)throw new rr.ErrnoError(54);return t.node_ops.readdir(t)},unlink:r=>{var t=rr.lookupPath(r,{parent:!0}).node;if(!t)throw new rr.ErrnoError(44);var e=X.basename(r),n=rr.lookupNode(t,e),o=rr.mayDelete(t,e,!1);if(o)throw new rr.ErrnoError(o);if(!t.node_ops.unlink)throw new rr.ErrnoError(63);if(rr.isMountpoint(n))throw new rr.ErrnoError(10);t.node_ops.unlink(t,e),rr.destroyNode(n)},readlink:r=>{var t=rr.lookupPath(r).node;if(!t)throw new rr.ErrnoError(44);if(!t.node_ops.readlink)throw new rr.ErrnoError(28);return $.resolve(rr.getPath(t.parent),t.node_ops.readlink(t))},stat:(r,t)=>{var e=rr.lookupPath(r,{follow:!t}).node;if(!e)throw new rr.ErrnoError(44);if(!e.node_ops.getattr)throw new rr.ErrnoError(63);return e.node_ops.getattr(e)},lstat:r=>rr.stat(r,!0),chmod:(r,t,e)=>{var n;"string"==typeof r?n=rr.lookupPath(r,{follow:!e}).node:n=r;if(!n.node_ops.setattr)throw new rr.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod:(r,t)=>{rr.chmod(r,t,!0)},fchmod:(r,t)=>{var e=rr.getStream(r);if(!e)throw new rr.ErrnoError(8);rr.chmod(e.node,t)},chown:(r,t,e,n)=>{var o;"string"==typeof r?o=rr.lookupPath(r,{follow:!n}).node:o=r;if(!o.node_ops.setattr)throw new rr.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(r,t,e)=>{rr.chown(r,t,e,!0)},fchown:(r,t,e)=>{var n=rr.getStream(r);if(!n)throw new rr.ErrnoError(8);rr.chown(n.node,t,e)},truncate:(r,t)=>{if(t<0)throw new rr.ErrnoError(28);var e;"string"==typeof r?e=rr.lookupPath(r,{follow:!0}).node:e=r;if(!e.node_ops.setattr)throw new rr.ErrnoError(63);if(rr.isDir(e.mode))throw new rr.ErrnoError(31);if(!rr.isFile(e.mode))throw new rr.ErrnoError(28);var n=rr.nodePermissions(e,"w");if(n)throw new rr.ErrnoError(n);e.node_ops.setattr(e,{size:t,timestamp:Date.now()})},ftruncate:(r,t)=>{var e=rr.getStream(r);if(!e)throw new rr.ErrnoError(8);if(0==(2097155&e.flags))throw new rr.ErrnoError(28);rr.truncate(e.node,t)},utime:(r,t,e)=>{var n=rr.lookupPath(r,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,e)})},open:(r,t,e)=>{if(""===r)throw new rr.ErrnoError(44);var n;if(e=void 0===e?438:e,e=64&(t="string"==typeof t?rr.modeStringToFlags(t):t)?4095&e|32768:0,"object"==typeof r)n=r;else{r=X.normalize(r);try{n=rr.lookupPath(r,{follow:!(131072&t)}).node}catch(r){}}var a=!1;if(64&t)if(n){if(128&t)throw new rr.ErrnoError(20)}else n=rr.mknod(r,e,0),a=!0;if(!n)throw new rr.ErrnoError(44);if(rr.isChrdev(n.mode)&&(t&=-513),65536&t&&!rr.isDir(n.mode))throw new rr.ErrnoError(54);if(!a){var i=rr.mayOpen(n,t);if(i)throw new rr.ErrnoError(i)}512&t&&!a&&rr.truncate(n,0),t&=-131713;var s=rr.createStream({node:n,path:rr.getPath(n),flags:t,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!o.logReadFiles||1&t||(rr.readFiles||(rr.readFiles={}),r in rr.readFiles||(rr.readFiles[r]=1)),s},close:r=>{if(rr.isClosed(r))throw new rr.ErrnoError(8);r.getdents&&(r.getdents=null);try{r.stream_ops.close&&r.stream_ops.close(r)}catch(r){throw r}finally{rr.closeStream(r.fd)}r.fd=null},isClosed:r=>null===r.fd,llseek:(r,t,e)=>{if(rr.isClosed(r))throw new rr.ErrnoError(8);if(!r.seekable||!r.stream_ops.llseek)throw new rr.ErrnoError(70);if(0!=e&&1!=e&&2!=e)throw new rr.ErrnoError(28);return r.position=r.stream_ops.llseek(r,t,e),r.ungotten=[],r.position},read:(r,t,e,n,o)=>{if(n<0||o<0)throw new rr.ErrnoError(28);if(rr.isClosed(r))throw new rr.ErrnoError(8);if(1==(2097155&r.flags))throw new rr.ErrnoError(8);if(rr.isDir(r.node.mode))throw new rr.ErrnoError(31);if(!r.stream_ops.read)throw new rr.ErrnoError(28);var a=void 0!==o;if(a){if(!r.seekable)throw new rr.ErrnoError(70)}else o=r.position;var i=r.stream_ops.read(r,t,e,n,o);return a||(r.position+=i),i},write:(r,t,e,n,o,a)=>{if(n<0||o<0)throw new rr.ErrnoError(28);if(rr.isClosed(r))throw new rr.ErrnoError(8);if(0==(2097155&r.flags))throw new rr.ErrnoError(8);if(rr.isDir(r.node.mode))throw new rr.ErrnoError(31);if(!r.stream_ops.write)throw new rr.ErrnoError(28);r.seekable&&1024&r.flags&&rr.llseek(r,0,2);var i=void 0!==o;if(i){if(!r.seekable)throw new rr.ErrnoError(70)}else o=r.position;var s=r.stream_ops.write(r,t,e,n,o,a);return i||(r.position+=s),s},allocate:(r,t,e)=>{if(rr.isClosed(r))throw new rr.ErrnoError(8);if(t<0||e<=0)throw new rr.ErrnoError(28);if(0==(2097155&r.flags))throw new rr.ErrnoError(8);if(!rr.isFile(r.node.mode)&&!rr.isDir(r.node.mode))throw new rr.ErrnoError(43);if(!r.stream_ops.allocate)throw new rr.ErrnoError(138);r.stream_ops.allocate(r,t,e)},mmap:(r,t,e,n,o)=>{if(0!=(2&n)&&0==(2&o)&&2!=(2097155&r.flags))throw new rr.ErrnoError(2);if(1==(2097155&r.flags))throw new rr.ErrnoError(2);if(!r.stream_ops.mmap)throw new rr.ErrnoError(43);return r.stream_ops.mmap(r,t,e,n,o)},msync:(r,t,e,n,o)=>r.stream_ops.msync?r.stream_ops.msync(r,t,e,n,o):0,munmap:r=>0,ioctl:(r,t,e)=>{if(!r.stream_ops.ioctl)throw new rr.ErrnoError(59);return r.stream_ops.ioctl(r,t,e)},readFile:(r,t={})=>{if(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 e,n=rr.open(r,t.flags),o=rr.stat(r).size,a=new Uint8Array(o);return rr.read(n,a,0,o,0),"utf8"===t.encoding?e=A(a,0):"binary"===t.encoding&&(e=a),rr.close(n),e},writeFile:(r,t,e={})=>{e.flags=e.flags||577;var n=rr.open(r,e.flags,e.mode);if("string"==typeof t){var o=new Uint8Array(F(t)+1),a=P(t,o,0,o.length);rr.write(n,o,0,a,void 0,e.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");rr.write(n,t,0,t.byteLength,void 0,e.canOwn)}rr.close(n)},cwd:()=>rr.currentPath,chdir:r=>{var t=rr.lookupPath(r,{follow:!0});if(null===t.node)throw new rr.ErrnoError(44);if(!rr.isDir(t.node.mode))throw new rr.ErrnoError(54);var e=rr.nodePermissions(t.node,"x");if(e)throw new rr.ErrnoError(e);rr.currentPath=t.path},createDefaultDirectories:()=>{rr.mkdir("/tmp"),rr.mkdir("/home"),rr.mkdir("/home/web_user")},createDefaultDevices:()=>{rr.mkdir("/dev"),rr.registerDevice(rr.makedev(1,3),{read:()=>0,write:(r,t,e,n,o)=>n}),rr.mkdev("/dev/null",rr.makedev(1,3)),K.register(rr.makedev(5,0),K.default_tty_ops),K.register(rr.makedev(6,0),K.default_tty1_ops),rr.mkdev("/dev/tty",rr.makedev(5,0)),rr.mkdev("/dev/tty1",rr.makedev(6,0));var r=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var r=new Uint8Array(1);return()=>(crypto.getRandomValues(r),r[0])}return()=>N("randomDevice")}();rr.createDevice("/dev","random",r),rr.createDevice("/dev","urandom",r),rr.mkdir("/dev/shm"),rr.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{rr.mkdir("/proc");var r=rr.mkdir("/proc/self");rr.mkdir("/proc/self/fd"),rr.mount({mount:()=>{var t=rr.createNode(r,"fd",16895,73);return t.node_ops={lookup:(r,t)=>{var e=+t,n=rr.getStream(e);if(!n)throw new rr.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},t}},{},"/proc/self/fd")},createStandardStreams:()=>{o.stdin?rr.createDevice("/dev","stdin",o.stdin):rr.symlink("/dev/tty","/dev/stdin"),o.stdout?rr.createDevice("/dev","stdout",null,o.stdout):rr.symlink("/dev/tty","/dev/stdout"),o.stderr?rr.createDevice("/dev","stderr",null,o.stderr):rr.symlink("/dev/tty1","/dev/stderr"),rr.open("/dev/stdin",0),rr.open("/dev/stdout",1),rr.open("/dev/stderr",1)},ensureErrnoError:()=>{rr.ErrnoError||(rr.ErrnoError=function(r,t){this.node=t,this.setErrno=function(r){this.errno=r},this.setErrno(r),this.message="FS error"},rr.ErrnoError.prototype=new Error,rr.ErrnoError.prototype.constructor=rr.ErrnoError,[44].forEach((r=>{rr.genericErrors[r]=new rr.ErrnoError(r),rr.genericErrors[r].stack="<generic error, no stack>"})))},staticInit:()=>{rr.ensureErrnoError(),rr.nameTable=new Array(4096),rr.mount(Z,{},"/"),rr.createDefaultDirectories(),rr.createDefaultDevices(),rr.createSpecialDirectories(),rr.filesystems={MEMFS:Z}},init:(r,t,e)=>{rr.init.initialized=!0,rr.ensureErrnoError(),o.stdin=r||o.stdin,o.stdout=t||o.stdout,o.stderr=e||o.stderr,rr.createStandardStreams()},quit:()=>{rr.init.initialized=!1;for(var r=0;r<rr.streams.length;r++){var t=rr.streams[r];t&&rr.close(t)}},getMode:(r,t)=>{var e=0;return r&&(e|=365),t&&(e|=146),e},findObject:(r,t)=>{var e=rr.analyzePath(r,t);return e.exists?e.object:null},analyzePath:(r,t)=>{try{r=(n=rr.lookupPath(r,{follow:!t})).path}catch(r){}var e={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=rr.lookupPath(r,{parent:!0});e.parentExists=!0,e.parentPath=n.path,e.parentObject=n.node,e.name=X.basename(r),n=rr.lookupPath(r,{follow:!t}),e.exists=!0,e.path=n.path,e.object=n.node,e.name=n.node.name,e.isRoot="/"===n.path}catch(r){e.error=r.errno}return e},createPath:(r,t,e,n)=>{r="string"==typeof r?r:rr.getPath(r);for(var o=t.split("/").reverse();o.length;){var a=o.pop();if(a){var i=X.join2(r,a);try{rr.mkdir(i)}catch(r){}r=i}}return i},createFile:(r,t,e,n,o)=>{var a=X.join2("string"==typeof r?r:rr.getPath(r),t),i=rr.getMode(n,o);return rr.create(a,i)},createDataFile:(r,t,e,n,o,a)=>{var i=t;r&&(r="string"==typeof r?r:rr.getPath(r),i=t?X.join2(r,t):r);var s=rr.getMode(n,o),u=rr.create(i,s);if(e){if("string"==typeof e){for(var c=new Array(e.length),p=0,l=e.length;p<l;++p)c[p]=e.charCodeAt(p);e=c}rr.chmod(u,146|s);var f=rr.open(u,577);rr.write(f,e,0,e.length,0,a),rr.close(f),rr.chmod(u,s)}return u},createDevice:(r,t,e,n)=>{var o=X.join2("string"==typeof r?r:rr.getPath(r),t),a=rr.getMode(!!e,!!n);rr.createDevice.major||(rr.createDevice.major=64);var i=rr.makedev(rr.createDevice.major++,0);return rr.registerDevice(i,{open:r=>{r.seekable=!1},close:r=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(r,t,n,o,a)=>{for(var i=0,s=0;s<o;s++){var u;try{u=e()}catch(r){throw new rr.ErrnoError(29)}if(void 0===u&&0===i)throw new rr.ErrnoError(6);if(null==u)break;i++,t[n+s]=u}return i&&(r.node.timestamp=Date.now()),i},write:(r,t,e,o,a)=>{for(var i=0;i<o;i++)try{n(t[e+i])}catch(r){throw new rr.ErrnoError(29)}return o&&(r.node.timestamp=Date.now()),i}}),rr.mkdev(o,a,i)},forceLoadFile:r=>{if(r.isDevice||r.isFolder||r.link||r.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(!a)throw new Error("Cannot load without read() or XMLHttpRequest.");try{r.contents=Y(a(r.url),!0),r.usedBytes=r.contents.length}catch(r){throw new rr.ErrnoError(29)}},createLazyFile:(r,t,e,n,o)=>{function a(){this.lengthKnown=!1,this.chunks=[]}if(a.prototype.get=function(r){if(!(r>this.length-1||r<0)){var t=r%this.chunkSize,e=r/this.chunkSize|0;return this.getter(e)[t]}},a.prototype.setDataGetter=function(r){this.getter=r},a.prototype.cacheLength=function(){var r=new XMLHttpRequest;if(r.open("HEAD",e,!1),r.send(null),!(r.status>=200&&r.status<300||304===r.status))throw new Error("Couldn't load "+e+". Status: "+r.status);var t,n=Number(r.getResponseHeader("Content-length")),o=(t=r.getResponseHeader("Accept-Ranges"))&&"bytes"===t,a=(t=r.getResponseHeader("Content-Encoding"))&&"gzip"===t,i=1048576;o||(i=n);var s=this;s.setDataGetter((r=>{var t=r*i,o=(r+1)*i-1;if(o=Math.min(o,n-1),void 0===s.chunks[r]&&(s.chunks[r]=((r,t)=>{if(r>t)throw new Error("invalid range ("+r+", "+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",e,!1),n!==i&&o.setRequestHeader("Range","bytes="+r+"-"+t),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 "+e+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):Y(o.responseText||"",!0)})(t,o)),void 0===s.chunks[r])throw new Error("doXHR failed!");return s.chunks[r]})),!a&&n||(i=n=1,n=this.getter(0).length,i=n,f("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=i,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var i={isDevice:!1,url:e},s=rr.createFile(r,t,i,n,o);i.contents?s.contents=i.contents:i.url&&(s.contents=null,s.url=i.url),Object.defineProperties(s,{usedBytes:{get:function(){return this.contents.length}}});var u={};function c(r,t,e,n,o){var a=r.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(a.slice)for(var s=0;s<i;s++)t[e+s]=a[o+s];else for(s=0;s<i;s++)t[e+s]=a.get(o+s);return i}return Object.keys(s.stream_ops).forEach((r=>{var t=s.stream_ops[r];u[r]=function(){return rr.forceLoadFile(s),t.apply(null,arguments)}})),u.read=(r,t,e,n,o)=>(rr.forceLoadFile(s),c(r,t,e,n,o)),u.mmap=(r,t,e,n,o)=>{rr.forceLoadFile(s);var a=Q(t);if(!a)throw new rr.ErrnoError(48);return c(r,w,a,t,e),{ptr:a,allocated:!0}},s.stream_ops=u,s},createPreloadedFile:(r,t,e,n,o,a,s,u,c,p)=>{var l=t?$.resolve(X.join2(r,t)):r;function f(e){function i(e){p&&p(),u||rr.createDataFile(r,t,e,n,o,c),a&&a(),B()}Browser.handledByPreloadPlugin(e,l,i,(()=>{s&&s(),B()}))||i(e)}O(),"string"==typeof e?function(r,t,e,n){var o=n?"":"al "+r;i(r,(e=>{v(e,'Loading data file "'+r+'" failed (no arrayBuffer).'),t(new Uint8Array(e)),o&&B()}),(t=>{if(!e)throw'Loading data file "'+r+'" failed.';e()})),o&&O()}(e,(r=>f(r)),s):f(e)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(r,t,e)=>{t=t||(()=>{}),e=e||(()=>{});var n=rr.indexedDB();try{var o=n.open(rr.DB_NAME(),rr.DB_VERSION)}catch(r){return e(r)}o.onupgradeneeded=()=>{f("creating db"),o.result.createObjectStore(rr.DB_STORE_NAME)},o.onsuccess=()=>{var n=o.result.transaction([rr.DB_STORE_NAME],"readwrite"),a=n.objectStore(rr.DB_STORE_NAME),i=0,s=0,u=r.length;function c(){0==s?t():e()}r.forEach((r=>{var t=a.put(rr.analyzePath(r).object.contents,r);t.onsuccess=()=>{++i+s==u&&c()},t.onerror=()=>{s++,i+s==u&&c()}})),n.onerror=e},o.onerror=e},loadFilesFromDB:(r,t,e)=>{t=t||(()=>{}),e=e||(()=>{});var n=rr.indexedDB();try{var o=n.open(rr.DB_NAME(),rr.DB_VERSION)}catch(r){return e(r)}o.onupgradeneeded=e,o.onsuccess=()=>{var n=o.result;try{var a=n.transaction([rr.DB_STORE_NAME],"readonly")}catch(r){return void e(r)}var i=a.objectStore(rr.DB_STORE_NAME),s=0,u=0,c=r.length;function p(){0==u?t():e()}r.forEach((r=>{var t=i.get(r);t.onsuccess=()=>{rr.analyzePath(r).exists&&rr.unlink(r),rr.createDataFile(X.dirname(r),X.basename(r),t.result,!0,!0,!0),++s+u==c&&p()},t.onerror=()=>{u++,s+u==c&&p()}})),a.onerror=e},o.onerror=e}},tr={DEFAULT_POLLMASK:5,calculateAt:function(r,t,e){if(X.isAbs(t))return t;var n;-100===r?n=rr.cwd():n=tr.getStreamFromFD(r).path;if(0==t.length){if(!e)throw new rr.ErrnoError(44);return n}return X.join2(n,t)},doStat:function(r,t,e){try{var n=r(t)}catch(r){if(r&&r.node&&X.normalize(t)!==X.normalize(rr.getPath(r.node)))return-54;throw r}return b[e>>2]=n.dev,b[e+8>>2]=n.ino,b[e+12>>2]=n.mode,k[e+16>>2]=n.nlink,b[e+20>>2]=n.uid,b[e+24>>2]=n.gid,b[e+28>>2]=n.rdev,U=[n.size>>>0,(H=n.size,+Math.abs(H)>=1?H>0?(0|Math.min(+Math.floor(H/4294967296),4294967295))>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],b[e+40>>2]=U[0],b[e+44>>2]=U[1],b[e+48>>2]=4096,b[e+52>>2]=n.blocks,U=[Math.floor(n.atime.getTime()/1e3)>>>0,(H=Math.floor(n.atime.getTime()/1e3),+Math.abs(H)>=1?H>0?(0|Math.min(+Math.floor(H/4294967296),4294967295))>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],b[e+56>>2]=U[0],b[e+60>>2]=U[1],k[e+64>>2]=0,U=[Math.floor(n.mtime.getTime()/1e3)>>>0,(H=Math.floor(n.mtime.getTime()/1e3),+Math.abs(H)>=1?H>0?(0|Math.min(+Math.floor(H/4294967296),4294967295))>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],b[e+72>>2]=U[0],b[e+76>>2]=U[1],k[e+80>>2]=0,U=[Math.floor(n.ctime.getTime()/1e3)>>>0,(H=Math.floor(n.ctime.getTime()/1e3),+Math.abs(H)>=1?H>0?(0|Math.min(+Math.floor(H/4294967296),4294967295))>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],b[e+88>>2]=U[0],b[e+92>>2]=U[1],k[e+96>>2]=0,U=[n.ino>>>0,(H=n.ino,+Math.abs(H)>=1?H>0?(0|Math.min(+Math.floor(H/4294967296),4294967295))>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],b[e+104>>2]=U[0],b[e+108>>2]=U[1],0},doMsync:function(r,t,e,n,o){if(!rr.isFile(t.node.mode))throw new rr.ErrnoError(43);if(2&n)return 0;var a=E.slice(r,r+e);rr.msync(t,a,o,e,n)},varargs:void 0,get:function(){return tr.varargs+=4,b[tr.varargs-4>>2]},getStr:function(r){return x(r)},getStreamFromFD:function(r){var t=rr.getStream(r);if(!t)throw new rr.ErrnoError(8);return t}};var er=[];function nr(r){try{return m.grow(r-y.byteLength+65535>>>16),C(m.buffer),1}catch(r){}}var or={};function ar(){if(!ar.strings){var r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:u||"./this.program"};for(var t in or)void 0===or[t]?delete r[t]:r[t]=or[t];var e=[];for(var t in r)e.push(t+"="+r[t]);ar.strings=e}return ar.strings}function ir(r){h||(o.onExit&&o.onExit(r),_=!0),c(r,new q(r))}var sr=function(r,t){ir(r)};var ur=function(r,t,e,n){r||(r=this),this.parent=r,this.mount=r.mount,this.mounted=null,this.id=rr.nextInode++,this.name=t,this.mode=e,this.node_ops={},this.stream_ops={},this.rdev=n},cr=365,pr=146;Object.defineProperties(ur.prototype,{read:{get:function(){return(this.mode&cr)===cr},set:function(r){r?this.mode|=cr:this.mode&=-366}},write:{get:function(){return(this.mode&pr)===pr},set:function(r){r?this.mode|=pr:this.mode&=-147}},isFolder:{get:function(){return rr.isDir(this.mode)}},isDevice:{get:function(){return rr.isChrdev(this.mode)}}}),rr.FSNode=ur,rr.staticInit();var lr={k:function(r,t,e,n){try{if(t=tr.getStr(t),t=tr.calculateAt(r,t),-8&e)return-28;var o=rr.lookupPath(t,{follow:!0}).node;if(!o)return-44;var a="";return 4&e&&(a+="r"),2&e&&(a+="w"),1&e&&(a+="x"),a&&rr.nodePermissions(o,a)?-2:0}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},f:function(r,t,e){tr.varargs=e;try{var n=tr.getStreamFromFD(r);switch(t){case 0:return(o=tr.get())<0?-28:rr.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=tr.get();return n.flags|=o,0;case 5:o=tr.get();return g[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return a=28,b[Er()>>2]=a,-1}}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}var a},u:function(r,t){try{var e=tr.getStreamFromFD(r);return tr.doStat(rr.stat,e.path,t)}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},v:function(r,t,e){tr.varargs=e;try{var n=tr.getStreamFromFD(r);switch(t){case 21509:case 21505:case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:case 21523:case 21524:return n.tty?0:-59;case 21519:if(!n.tty)return-59;var o=tr.get();return b[o>>2]=0,0;case 21520:return n.tty?-28:-59;case 21531:o=tr.get();return rr.ioctl(n,t,o);default:return-28}}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},s:function(r,t,e,n){try{t=tr.getStr(t);var o=256&n,a=4096&n;return n&=-4353,t=tr.calculateAt(r,t,a),tr.doStat(o?rr.lstat:rr.stat,t,e)}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},d:function(r,t,e,n){tr.varargs=n;try{t=tr.getStr(t),t=tr.calculateAt(r,t);var o=n?tr.get():0;return rr.open(t,e,o).fd}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},t:function(r,t){try{return r=tr.getStr(r),tr.doStat(rr.stat,r,t)}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},n:function(r,t,e){try{return t=tr.getStr(t),t=tr.calculateAt(r,t),0===e?rr.unlink(t):512===e?rr.rmdir(t):N("Invalid flags passed to unlinkat"),0}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},i:function(){return true},o:function(r,t,e,n,o,a,i){try{var s=tr.getStreamFromFD(n),u=rr.mmap(s,r,o,t,e),c=u.ptr;return b[a>>2]=u.allocated,k[i>>2]=c,0}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},p:function(r,t,e,n,o,a){try{var i=tr.getStreamFromFD(o);2&e&&tr.doMsync(r,i,t,n,a),rr.munmap(i)}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return-r.errno}},a:function(){N("")},w:function(r,t,e){var n=function(r,t){var e;for(er.length=0,t>>=2;e=E[r++];)t+=105!=e&t,er.push(105==e?b[t]:S[t++>>1]),++t;return er}(t,e);return J[r].apply(null,n)},e:function(){return Date.now()},j:function(r,t,e){E.copyWithin(r,t,t+e)},m:function(r){var t,e,n=E.length,o=2147483648;if((r>>>=0)>o)return!1;for(var a=1;a<=4;a*=2){var i=n*(1+.2/a);if(i=Math.min(i,r+100663296),nr(Math.min(o,(t=Math.max(r,i))+((e=65536)-t%e)%e)))return!0}return!1},q:function(r,t){var e=0;return ar().forEach((function(n,o){var a=t+e;k[r+4*o>>2]=a,function(r,t,e){for(var n=0;n<r.length;++n)w[t++>>0]=r.charCodeAt(n);e||(w[t>>0]=0)}(n,a),e+=n.length+1})),0},r:function(r,t){var e=ar();k[r>>2]=e.length;var n=0;return e.forEach((function(r){n+=r.length+1})),k[t>>2]=n,0},b:sr,c:function(r){try{var t=tr.getStreamFromFD(r);return rr.close(t),0}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return r.errno}},g:function(r,t,e,n){try{var o=function(r,t,e,n){for(var o=0,a=0;a<e;a++){var i=k[t>>2],s=k[t+4>>2];t+=8;var u=rr.read(r,w,i,s,n);if(u<0)return-1;if(o+=u,u<s)break}return o}(tr.getStreamFromFD(r),t,e);return k[n>>2]=o,0}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return r.errno}},l:function(r,t,e,n,o){try{var a=(u=e)+2097152>>>0<4194305-!!(s=t)?(s>>>0)+4294967296*u:NaN;if(isNaN(a))return 61;var i=tr.getStreamFromFD(r);return rr.llseek(i,a,n),U=[i.position>>>0,(H=i.position,+Math.abs(H)>=1?H>0?(0|Math.min(+Math.floor(H/4294967296),4294967295))>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],b[o>>2]=U[0],b[o+4>>2]=U[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return r.errno}var s,u},h:function(r,t,e,n){try{var o=function(r,t,e,n){for(var o=0,a=0;a<e;a++){var i=k[t>>2],s=k[t+4>>2];t+=8;var u=rr.write(r,w,i,s,n);if(u<0)return-1;o+=u}return o}(tr.getStreamFromFD(r),t,e);return k[n>>2]=o,0}catch(r){if(void 0===rr||!(r instanceof rr.ErrnoError))throw r;return r.errno}}};!function(){var r={a:lr};function t(r,t){var e,n=r.exports;o.asm=n,C((m=o.asm.x).buffer),o.asm.G,e=o.asm.y,R.unshift(e),B()}function e(r){t(r.instance)}function a(t){return(l||"function"!=typeof fetch?Promise.resolve().then((function(){return W(I)})):fetch(I,{credentials:"same-origin"}).then((function(r){if(!r.ok)throw"failed to load wasm binary file at '"+I+"'";return r.arrayBuffer()})).catch((function(){return W(I)}))).then((function(t){return WebAssembly.instantiate(t,r)})).then((function(r){return r})).then(t,(function(r){d("failed to asynchronously prepare wasm: "+r),N(r)}))}if(O(),o.instantiateWasm)try{return o.instantiateWasm(r,t)}catch(r){d("Module.instantiateWasm callback failed with error: "+r),n(r)}(l||"function"!=typeof WebAssembly.instantiateStreaming||G(I)||"function"!=typeof fetch?a(e):fetch(I,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,r).then(e,(function(r){return d("wasm streaming compile failed: "+r),d("falling back to ArrayBuffer instantiation"),a(e)}))}))).catch(n)}(),o.___wasm_call_ctors=function(){return(o.___wasm_call_ctors=o.asm.y).apply(null,arguments)};var fr=o._emscripten_bind_VoidPtr___destroy___0=function(){return(fr=o._emscripten_bind_VoidPtr___destroy___0=o.asm.z).apply(null,arguments)},dr=o._emscripten_bind_Graphviz_Graphviz_2=function(){return(dr=o._emscripten_bind_Graphviz_Graphviz_2=o.asm.A).apply(null,arguments)},mr=o._emscripten_bind_Graphviz_version_0=function(){return(mr=o._emscripten_bind_Graphviz_version_0=o.asm.B).apply(null,arguments)},hr=o._emscripten_bind_Graphviz_lastError_0=function(){return(hr=o._emscripten_bind_Graphviz_lastError_0=o.asm.C).apply(null,arguments)},_r=o._emscripten_bind_Graphviz_layout_3=function(){return(_r=o._emscripten_bind_Graphviz_layout_3=o.asm.D).apply(null,arguments)},vr=o._emscripten_bind_Graphviz_createFile_2=function(){return(vr=o._emscripten_bind_Graphviz_createFile_2=o.asm.E).apply(null,arguments)},yr=o._emscripten_bind_Graphviz___destroy___0=function(){return(yr=o._emscripten_bind_Graphviz___destroy___0=o.asm.F).apply(null,arguments)};o._free=function(){return(o._free=o.asm.H).apply(null,arguments)},o._malloc=function(){return(o._malloc=o.asm.I).apply(null,arguments)};var wr,Er=o.___errno_location=function(){return(Er=o.___errno_location=o.asm.J).apply(null,arguments)},gr=o._emscripten_builtin_memalign=function(){return(gr=o._emscripten_builtin_memalign=o.asm.K).apply(null,arguments)};function br(r){function t(){wr||(wr=!0,o.calledRun=!0,_||(o.noFSInit||rr.init.initialized||rr.init(),rr.ignorePermissions=!1,V(R),e(o),o.onRuntimeInitialized&&o.onRuntimeInitialized(),function(){if(o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)r=o.postRun.shift(),z.unshift(r);var r;V(z)}()))}j>0||(!function(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)r=o.preRun.shift(),M.unshift(r);var r;V(M)}(),j>0||(o.setStatus?(o.setStatus("Running..."),setTimeout((function(){setTimeout((function(){o.setStatus("")}),1),t()}),1)):t()))}if(o.___start_em_js=163348,o.___stop_em_js=163446,T=function r(){wr||br(),wr||(T=r)},o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();function kr(){}function Sr(r){return(r||kr).__cache__}function Dr(r,t){var e=Sr(t),n=e[r];return n||((n=Object.create((t||kr).prototype)).ptr=r,e[r]=n)}br(),kr.prototype=Object.create(kr.prototype),kr.prototype.constructor=kr,kr.prototype.__class__=kr,kr.__cache__={},o.WrapperObject=kr,o.getCache=Sr,o.wrapPointer=Dr,o.castObject=function(r,t){return Dr(r.ptr,t)},o.NULL=Dr(0),o.destroy=function(r){if(!r.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";r.__destroy__(),delete Sr(r.__class__)[r.ptr]},o.compare=function(r,t){return r.ptr===t.ptr},o.getPointer=function(r){return r.ptr},o.getClass=function(r){return r.__class__};var Ar={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(Ar.needed){for(var r=0;r<Ar.temps.length;r++)o._free(Ar.temps[r]);Ar.temps.length=0,o._free(Ar.buffer),Ar.buffer=0,Ar.size+=Ar.needed,Ar.needed=0}Ar.buffer||(Ar.size+=128,Ar.buffer=o._malloc(Ar.size),v(Ar.buffer)),Ar.pos=0},alloc:function(r,t){v(Ar.buffer);var e,n=t.BYTES_PER_ELEMENT,a=r.length*n;return a=a+7&-8,Ar.pos+a>=Ar.size?(v(a>0),Ar.needed+=a,e=o._malloc(a),Ar.temps.push(e)):(e=Ar.buffer+Ar.pos,Ar.pos+=a),e},copy:function(r,t,e){switch(e>>>=0,t.BYTES_PER_ELEMENT){case 2:e>>>=1;break;case 4:e>>>=2;break;case 8:e>>>=3}for(var n=0;n<r.length;n++)t[e+n]=r[n]}};function xr(r){if("string"==typeof r){var t=Y(r),e=Ar.alloc(t,w);return Ar.copy(t,w,e),e}return r}function Pr(){throw"cannot construct a VoidPtr, no constructor in IDL"}function Fr(r,t){r&&"object"==typeof r&&(r=r.ptr),t&&"object"==typeof t&&(t=t.ptr),this.ptr=dr(r,t),Sr(Fr)[this.ptr]=this}return Pr.prototype=Object.create(kr.prototype),Pr.prototype.constructor=Pr,Pr.prototype.__class__=Pr,Pr.__cache__={},o.VoidPtr=Pr,Pr.prototype.__destroy__=Pr.prototype.__destroy__=function(){var r=this.ptr;fr(r)},Fr.prototype=Object.create(kr.prototype),Fr.prototype.constructor=Fr,Fr.prototype.__class__=Fr,Fr.__cache__={},o.Graphviz=Fr,Fr.prototype.version=Fr.prototype.version=function(){var r=this.ptr;return x(mr(r))},Fr.prototype.lastError=Fr.prototype.lastError=function(){var r=this.ptr;return x(hr(r))},Fr.prototype.layout=Fr.prototype.layout=function(r,t,e){var n=this.ptr;return Ar.prepare(),r=r&&"object"==typeof r?r.ptr:xr(r),t=t&&"object"==typeof t?t.ptr:xr(t),e=e&&"object"==typeof e?e.ptr:xr(e),x(_r(n,r,t,e))},Fr.prototype.createFile=Fr.prototype.createFile=function(r,t){var e=this.ptr;Ar.prepare(),r=r&&"object"==typeof r?r.ptr:xr(r),t=t&&"object"==typeof t?t.ptr:xr(t),vr(e,r,t)},Fr.prototype.__destroy__=Fr.prototype.__destroy__=function(){var r=this.ptr;yr(r)},t.ready}})(),d=Object.freeze({__proto__:null,default:f});function m(r){return{path:r.path,data:`<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n<svg width="${r.width}" height="${r.height}"></svg>`}}function h(r,t){const e={images:[],files:[],...t};var n;[...e.files,...(n=e.images,n.map(m))].forEach((t=>r.createFile(t.path,t.data)))}const _={layout:(r,t="svg",e="dot",n)=>r?a(d,"graphvizlib",n?.wasmFolder,n?.wasmBinary).then((o=>{const a=new o.Graphviz(n?.yInvert?1:0,n?.nop?n?.nop:0);let i;h(a,n);try{i=a.layout(r,t,e)}catch(r){}if(o.destroy(a),!i)throw new Error(o.Graphviz.prototype.lastError());return i})):Promise.resolve(""),circo(r,t="svg",e){return this.layout(r,t,"circo",e)},dot(r,t="svg",e){return this.layout(r,t,"dot",e)},fdp(r,t="svg",e){return this.layout(r,t,"fdp",e)},sfdp(r,t="svg",e){return this.layout(r,t,"sfdp",e)},neato(r,t="svg",e){return this.layout(r,t,"neato",e)},osage(r,t="svg",e){return this.layout(r,t,"osage",e)},patchwork(r,t="svg",e){return this.layout(r,t,"patchwork",e)},twopi(r,t="svg",e){return this.layout(r,t,"twopi",e)}};class v{constructor(r){this._wasm=r}layout(r,t="svg",e="dot",n){if(!r)return"";const o=new this._wasm.Graphviz(n?.yInvert?1:0,n?.nop?n?.nop:0);h(o,n);const a=o.layout(r,t,e);if(this._wasm.destroy(o),!a)throw new Error(this._wasm.Graphviz.prototype.lastError());return a}circo(r,t="svg",e){return this.layout(r,t,"circo",e)}dot(r,t="svg",e){return this.layout(r,t,"dot",e)}fdp(r,t="svg",e){return this.layout(r,t,"fdp",e)}sfdp(r,t="svg",e){return this.layout(r,t,"sfdp",e)}neato(r,t="svg",e){return this.layout(r,t,"neato",e)}osage(r,t="svg",e){return this.layout(r,t,"osage",e)}patchwork(r,t="svg",e){return this.layout(r,t,"patchwork",e)}twopi(r,t="svg",e){return this.layout(r,t,"twopi",e)}}t.doFetch=async function(r){return fetch(r,{credentials:"same-origin"}).then((t=>{if(!t.ok)throw"failed to load wasm binary file at '"+r+"'";return t.arrayBuffer()})).catch((r=>{throw r}))},t.scriptDir=s,r.GraphvizSync=v,r.StackElement=p,r.StackParser=class{constructor(){this._stack=[]}parse(r,t,e){return l(r,this,t,e)}top(){return this._stack[this._stack.length-1]}startElement(r,t){const e=new p(r,t);return this._stack.push(e),e}endElement(r){return this._stack.pop()}characterData(r){this.top().appendContent(r)}},r.expatVersion=function(r,t){return a(c,"expatlib",r,t).then((r=>r.CExpat.prototype.version()))},r.graphviz=_,r.graphvizSync=function(r,t){return a(d,"graphvizlib",r,t).then((r=>new v(r)))},r.graphvizVersion=function(r,t){return a(d,"graphvizlib",r,t).then((r=>r.Graphviz.prototype.version()))},r.parse=l,r.wasmFolder=n,Object.defineProperty(r,"__esModule",{value:!0})}));
|
|
1
|
+
!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((t="undefined"!=typeof globalThis?globalThis:t||self)["@hpcc-js/wasm"]={})}(this,(function(t){"use strict";const r={doFetch:void 0,scriptDir:void 0};let e=globalThis.__hpcc_wasmFolder||void 0;function n(t){if(!arguments.length)return e;const r=e;return e=t,r}const o={};async function a(t,e,a,i){const s=`${function(t,r){for(;t.charAt(t.length-1)===r;)t=t.substring(0,t.length-1);return t}(a||n()||r.scriptDir||".","/")}/${function(t,r){for(;t.charAt(0)===r;)t=t.substring(1);return t}(`${e}.wasm`,"/")}`;return o[s]||(o[s]=async function(t,e,n){const o=t.default||t;return n||(n=await r.doFetch(e)),await o({wasmBinary:n})}(t,s,i)),o[s]}let i=document?.currentScript?.src??"";const s=i.substring(0,i.replace(/[?#].*/,"").lastIndexOf("/")+1)+"../dist";var u=(()=>{var t="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0;return function(r){var e,n,o=void 0!==(r=r||{})?r:{};o.ready=new Promise((function(t,r){e=t,n=r}));var a=Object.assign({},o),i="./this.program",s="";"undefined"!=typeof document&&document.currentScript&&(s=document.currentScript.src),t&&(s=t),s=0!==s.indexOf("blob:")?s.substr(0,s.replace(/[?#].*/,"").lastIndexOf("/")+1):"";var u,c,p=o.print||console.log.bind(console),f=o.printErr||console.warn.bind(console);Object.assign(o,a),a=null,o.arguments&&o.arguments,o.thisProgram&&(i=o.thisProgram),o.quit&&o.quit,o.wasmBinary&&(u=o.wasmBinary),o.noExitRuntime,"object"!=typeof WebAssembly&&M("no native wasm support detected");var l=!1;function d(t,r){t||M(r)}var m,h,_,y,v,w,g="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function E(t,r,e){for(var n=r+e,o=r;t[o]&&!(o>=n);)++o;if(o-r>16&&t.buffer&&g)return g.decode(t.subarray(r,o));for(var a="";r<o;){var i=t[r++];if(128&i){var s=63&t[r++];if(192!=(224&i)){var u=63&t[r++];if((i=224==(240&i)?(15&i)<<12|s<<6|u:(7&i)<<18|s<<12|u<<6|63&t[r++])<65536)a+=String.fromCharCode(i);else{var c=i-65536;a+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a}function b(t,r){return t?E(_,t,r):""}function k(t){m=t,o.HEAP8=h=new Int8Array(t),o.HEAP16=new Int16Array(t),o.HEAP32=y=new Int32Array(t),o.HEAPU8=_=new Uint8Array(t),o.HEAPU16=new Uint16Array(t),o.HEAPU32=v=new Uint32Array(t),o.HEAPF32=new Float32Array(t),o.HEAPF64=w=new Float64Array(t)}o.INITIAL_MEMORY;var S=[],D=[],A=[];var F=0,x=null;function M(t){o.onAbort&&o.onAbort(t),f(t="Aborted("+t+")"),l=!0,t+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(t);throw n(r),r}var P,C;function R(t){return t.startsWith("data:application/octet-stream;base64,")}function z(t){try{if(t==P&&u)return new Uint8Array(u);throw"both async and sync fetching of the wasm failed"}catch(t){M(t)}}R(P="expatlib.wasm")||(C=P,P=o.locateFile?o.locateFile(C,s):s+C);var j={11554:t=>{var r=o.getCache(o.CExpatJS)[t];if(!r.hasOwnProperty("startElement"))throw"a JSImplementation must implement all functions, you forgot CExpatJS::startElement.";r.startElement()},11772:t=>{var r=o.getCache(o.CExpatJS)[t];if(!r.hasOwnProperty("endElement"))throw"a JSImplementation must implement all functions, you forgot CExpatJS::endElement.";r.endElement()},11984:t=>{var r=o.getCache(o.CExpatJS)[t];if(!r.hasOwnProperty("characterData"))throw"a JSImplementation must implement all functions, you forgot CExpatJS::characterData.";r.characterData()}};function O(t){for(;t.length>0;)t.shift()(o)}var T=[];function B(t){try{return c.grow(t-m.byteLength+65535>>>16),k(c.buffer),1}catch(t){}}var N={};function I(){if(!I.strings){var t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:i||"./this.program"};for(var r in N)void 0===N[r]?delete t[r]:t[r]=N[r];var e=[];for(var r in t)e.push(r+"="+t[r]);I.strings=e}return I.strings}var L=[null,[],[]];function H(t,r){var e=L[t];0===r||10===r?((1===t?p:f)(E(e,0)),e.length=0):e.push(r)}var U={g:function(t,r,e,n){},c:function(){M("")},a:function(t,r,e){var n=function(t,r){var e;for(T.length=0,r>>=2;e=_[t++];)r+=105!=e&r,T.push(105==e?y[r]:w[r++>>1]),++r;return T}(r,e);return j[t].apply(null,n)},j:function(){return Date.now()},k:function(t,r,e){_.copyWithin(t,r,r+e)},e:function(t){var r,e,n=_.length,o=2147483648;if((t>>>=0)>o)return!1;for(var a=1;a<=4;a*=2){var i=n*(1+.2/a);if(i=Math.min(i,t+100663296),B(Math.min(o,(r=Math.max(t,i))+((e=65536)-r%e)%e)))return!0}return!1},h:function(t,r){var e=0;return I().forEach((function(n,o){var a=r+e;v[t+4*o>>2]=a,function(t,r,e){for(var n=0;n<t.length;++n)h[r++>>0]=t.charCodeAt(n);e||(h[r>>0]=0)}(n,a),e+=n.length+1})),0},i:function(t,r){var e=I();v[t>>2]=e.length;var n=0;return e.forEach((function(t){n+=t.length+1})),v[r>>2]=n,0},d:function(t){return 52},f:function(t,r,e,n){return 52},l:function(t,r,e,n,o){return 70},b:function(t,r,e,n){for(var o=0,a=0;a<e;a++){var i=v[r>>2],s=v[r+4>>2];r+=8;for(var u=0;u<s;u++)H(t,_[i+u]);o+=s}return v[n>>2]=o,0}};!function(){var t={a:U};function r(t,r){var e,n=t.exports;o.asm=n,k((c=o.asm.m).buffer),o.asm.G,e=o.asm.n,D.unshift(e),function(t){if(F--,o.monitorRunDependencies&&o.monitorRunDependencies(F),0==F&&x){var r=x;x=null,r()}}()}function e(t){r(t.instance)}function a(r){return(u||"function"!=typeof fetch?Promise.resolve().then((function(){return z(P)})):fetch(P,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+P+"'";return t.arrayBuffer()})).catch((function(){return z(P)}))).then((function(r){return WebAssembly.instantiate(r,t)})).then((function(t){return t})).then(r,(function(t){f("failed to asynchronously prepare wasm: "+t),M(t)}))}if(F++,o.monitorRunDependencies&&o.monitorRunDependencies(F),o.instantiateWasm)try{return o.instantiateWasm(t,r)}catch(t){f("Module.instantiateWasm callback failed with error: "+t),n(t)}(u||"function"!=typeof WebAssembly.instantiateStreaming||R(P)||"function"!=typeof fetch?a(e):fetch(P,{credentials:"same-origin"}).then((function(r){return WebAssembly.instantiateStreaming(r,t).then(e,(function(t){return f("wasm streaming compile failed: "+t),f("falling back to ArrayBuffer instantiation"),a(e)}))}))).catch(n)}(),o.___wasm_call_ctors=function(){return(o.___wasm_call_ctors=o.asm.n).apply(null,arguments)};var G,W=o._emscripten_bind_CExpat_CExpat_0=function(){return(W=o._emscripten_bind_CExpat_CExpat_0=o.asm.o).apply(null,arguments)},Y=o._emscripten_bind_CExpat_version_0=function(){return(Y=o._emscripten_bind_CExpat_version_0=o.asm.p).apply(null,arguments)},J=o._emscripten_bind_CExpat_create_0=function(){return(J=o._emscripten_bind_CExpat_create_0=o.asm.q).apply(null,arguments)},q=o._emscripten_bind_CExpat_destroy_0=function(){return(q=o._emscripten_bind_CExpat_destroy_0=o.asm.r).apply(null,arguments)},V=o._emscripten_bind_CExpat_parse_1=function(){return(V=o._emscripten_bind_CExpat_parse_1=o.asm.s).apply(null,arguments)},X=o._emscripten_bind_CExpat_tag_0=function(){return(X=o._emscripten_bind_CExpat_tag_0=o.asm.t).apply(null,arguments)},$=o._emscripten_bind_CExpat_attrs_0=function(){return($=o._emscripten_bind_CExpat_attrs_0=o.asm.u).apply(null,arguments)},K=o._emscripten_bind_CExpat_content_0=function(){return(K=o._emscripten_bind_CExpat_content_0=o.asm.v).apply(null,arguments)},Z=o._emscripten_bind_CExpat_startElement_0=function(){return(Z=o._emscripten_bind_CExpat_startElement_0=o.asm.w).apply(null,arguments)},Q=o._emscripten_bind_CExpat_endElement_0=function(){return(Q=o._emscripten_bind_CExpat_endElement_0=o.asm.x).apply(null,arguments)},tt=o._emscripten_bind_CExpat_characterData_0=function(){return(tt=o._emscripten_bind_CExpat_characterData_0=o.asm.y).apply(null,arguments)},rt=o._emscripten_bind_CExpat___destroy___0=function(){return(rt=o._emscripten_bind_CExpat___destroy___0=o.asm.z).apply(null,arguments)},et=o._emscripten_bind_VoidPtr___destroy___0=function(){return(et=o._emscripten_bind_VoidPtr___destroy___0=o.asm.A).apply(null,arguments)},nt=o._emscripten_bind_CExpatJS_CExpatJS_0=function(){return(nt=o._emscripten_bind_CExpatJS_CExpatJS_0=o.asm.B).apply(null,arguments)},ot=o._emscripten_bind_CExpatJS_startElement_0=function(){return(ot=o._emscripten_bind_CExpatJS_startElement_0=o.asm.C).apply(null,arguments)},at=o._emscripten_bind_CExpatJS_endElement_0=function(){return(at=o._emscripten_bind_CExpatJS_endElement_0=o.asm.D).apply(null,arguments)},it=o._emscripten_bind_CExpatJS_characterData_0=function(){return(it=o._emscripten_bind_CExpatJS_characterData_0=o.asm.E).apply(null,arguments)},st=o._emscripten_bind_CExpatJS___destroy___0=function(){return(st=o._emscripten_bind_CExpatJS___destroy___0=o.asm.F).apply(null,arguments)};function ut(t){function r(){G||(G=!0,o.calledRun=!0,l||(O(D),e(o),o.onRuntimeInitialized&&o.onRuntimeInitialized(),function(){if(o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)t=o.postRun.shift(),A.unshift(t);var t;O(A)}()))}F>0||(!function(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)t=o.preRun.shift(),S.unshift(t);var t;O(S)}(),F>0||(o.setStatus?(o.setStatus("Running..."),setTimeout((function(){setTimeout((function(){o.setStatus("")}),1),r()}),1)):r()))}if(o._malloc=function(){return(o._malloc=o.asm.H).apply(null,arguments)},o.___start_em_js=11456,o.___stop_em_js=11554,x=function t(){G||ut(),G||(x=t)},o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();function ct(){}function pt(t){return(t||ct).__cache__}function ft(t,r){var e=pt(r),n=e[t];return n||((n=Object.create((r||ct).prototype)).ptr=t,e[t]=n)}ut(),ct.prototype=Object.create(ct.prototype),ct.prototype.constructor=ct,ct.prototype.__class__=ct,ct.__cache__={},o.WrapperObject=ct,o.getCache=pt,o.wrapPointer=ft,o.castObject=function(t,r){return ft(t.ptr,r)},o.NULL=ft(0),o.destroy=function(t){if(!t.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";t.__destroy__(),delete pt(t.__class__)[t.ptr]},o.compare=function(t,r){return t.ptr===r.ptr},o.getPointer=function(t){return t.ptr},o.getClass=function(t){return t.__class__};var lt={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(lt.needed){for(var t=0;t<lt.temps.length;t++)o._free(lt.temps[t]);lt.temps.length=0,o._free(lt.buffer),lt.buffer=0,lt.size+=lt.needed,lt.needed=0}lt.buffer||(lt.size+=128,lt.buffer=o._malloc(lt.size),d(lt.buffer)),lt.pos=0},alloc:function(t,r){d(lt.buffer);var e,n=r.BYTES_PER_ELEMENT,a=t.length*n;return a=a+7&-8,lt.pos+a>=lt.size?(d(a>0),lt.needed+=a,e=o._malloc(a),lt.temps.push(e)):(e=lt.buffer+lt.pos,lt.pos+=a),e},copy:function(t,r,e){switch(e>>>=0,r.BYTES_PER_ELEMENT){case 2:e>>>=1;break;case 4:e>>>=2;break;case 8:e>>>=3}for(var n=0;n<t.length;n++)r[e+n]=t[n]}};function dt(t){if("string"==typeof t){var r=(n=t,i=a>0?a:function(t){for(var r=0,e=0;e<t.length;++e){var n=t.charCodeAt(e);n<=127?r++:n<=2047?r+=2:n>=55296&&n<=57343?(r+=4,++e):r+=3}return r}(n)+1,s=new Array(i),u=function(t,r,e,n){if(!(n>0))return 0;for(var o=e,a=e+n-1,i=0;i<t.length;++i){var s=t.charCodeAt(i);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&t.charCodeAt(++i)),s<=127){if(e>=a)break;r[e++]=s}else if(s<=2047){if(e+1>=a)break;r[e++]=192|s>>6,r[e++]=128|63&s}else if(s<=65535){if(e+2>=a)break;r[e++]=224|s>>12,r[e++]=128|s>>6&63,r[e++]=128|63&s}else{if(e+3>=a)break;r[e++]=240|s>>18,r[e++]=128|s>>12&63,r[e++]=128|s>>6&63,r[e++]=128|63&s}}return r[e]=0,e-o}(n,s,0,s.length),o&&(s.length=u),s),e=lt.alloc(r,h);return lt.copy(r,h,e),e}var n,o,a,i,s,u;return t}function mt(){this.ptr=W(),pt(mt)[this.ptr]=this}function ht(){throw"cannot construct a VoidPtr, no constructor in IDL"}function _t(){this.ptr=nt(),pt(_t)[this.ptr]=this}return mt.prototype=Object.create(ct.prototype),mt.prototype.constructor=mt,mt.prototype.__class__=mt,mt.__cache__={},o.CExpat=mt,mt.prototype.version=mt.prototype.version=function(){var t=this.ptr;return b(Y(t))},mt.prototype.create=mt.prototype.create=function(){var t=this.ptr;return!!J(t)},mt.prototype.destroy=mt.prototype.destroy=function(){var t=this.ptr;q(t)},mt.prototype.parse=mt.prototype.parse=function(t){var r=this.ptr;return lt.prepare(),t=t&&"object"==typeof t?t.ptr:dt(t),!!V(r,t)},mt.prototype.tag=mt.prototype.tag=function(){var t=this.ptr;return b(X(t))},mt.prototype.attrs=mt.prototype.attrs=function(){var t=this.ptr;return b($(t))},mt.prototype.content=mt.prototype.content=function(){var t=this.ptr;return b(K(t))},mt.prototype.startElement=mt.prototype.startElement=function(){var t=this.ptr;Z(t)},mt.prototype.endElement=mt.prototype.endElement=function(){var t=this.ptr;Q(t)},mt.prototype.characterData=mt.prototype.characterData=function(){var t=this.ptr;tt(t)},mt.prototype.__destroy__=mt.prototype.__destroy__=function(){var t=this.ptr;rt(t)},ht.prototype=Object.create(ct.prototype),ht.prototype.constructor=ht,ht.prototype.__class__=ht,ht.__cache__={},o.VoidPtr=ht,ht.prototype.__destroy__=ht.prototype.__destroy__=function(){var t=this.ptr;et(t)},_t.prototype=Object.create(mt.prototype),_t.prototype.constructor=_t,_t.prototype.__class__=_t,_t.__cache__={},o.CExpatJS=_t,_t.prototype.startElement=_t.prototype.startElement=function(){var t=this.ptr;ot(t)},_t.prototype.endElement=_t.prototype.endElement=function(){var t=this.ptr;at(t)},_t.prototype.characterData=_t.prototype.characterData=function(){var t=this.ptr;it(t)},_t.prototype.__destroy__=_t.prototype.__destroy__=function(){var t=this.ptr;st(t)},r.ready}})(),c=Object.freeze({__proto__:null,default:u});class p{constructor(t,r){this.tag=t,this.attrs=r,this._content=""}get content(){return this._content}appendContent(t){this._content+=t}}function f(t,r,e,n){return a(c,"expatlib",e,n).then((e=>{const n=new e.CExpatJS;n.startElement=function(){r.startElement(this.tag(),function(t){const r={},e=t,n=`${String.fromCharCode(1)}`,o=`${n}${n}`;return e.split(o).filter((t=>!!t)).forEach((t=>{const e=t.split(n);r[e[0]]=e[1]})),r}(this.attrs()))},n.endElement=function(){r.endElement(this.tag())},n.characterData=function(){r.characterData(this.content())},n.create();const o=n.parse(t);return n.destroy(),e.destroy(n),o}))}var l=(()=>{var t="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0;return function(r){var e,n,o=void 0!==(r=r||{})?r:{};o.ready=new Promise((function(t,r){e=t,n=r}));var a,i,s=Object.assign({},o),u="./this.program",c=(t,r)=>{throw r},p="";"undefined"!=typeof document&&document.currentScript&&(p=document.currentScript.src),t&&(p=t),p=0!==p.indexOf("blob:")?p.substr(0,p.replace(/[?#].*/,"").lastIndexOf("/")+1):"",a=t=>{var r=new XMLHttpRequest;return r.open("GET",t,!1),r.send(null),r.responseText},i=(t,r,e)=>{var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?r(n.response):e()},n.onerror=e,n.send(null)};var f,l=o.print||console.log.bind(console),d=o.printErr||console.warn.bind(console);Object.assign(o,s),s=null,o.arguments&&o.arguments,o.thisProgram&&(u=o.thisProgram),o.quit&&(c=o.quit),o.wasmBinary&&(f=o.wasmBinary);var m,h=o.noExitRuntime||!0;"object"!=typeof WebAssembly&&N("no native wasm support detected");var _=!1;function y(t,r){t||N(r)}var v,w,g,E,b,k,S,D="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function A(t,r,e){for(var n=r+e,o=r;t[o]&&!(o>=n);)++o;if(o-r>16&&t.buffer&&D)return D.decode(t.subarray(r,o));for(var a="";r<o;){var i=t[r++];if(128&i){var s=63&t[r++];if(192!=(224&i)){var u=63&t[r++];if((i=224==(240&i)?(15&i)<<12|s<<6|u:(7&i)<<18|s<<12|u<<6|63&t[r++])<65536)a+=String.fromCharCode(i);else{var c=i-65536;a+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a}function F(t,r){return t?A(g,t,r):""}function x(t,r,e,n){if(!(n>0))return 0;for(var o=e,a=e+n-1,i=0;i<t.length;++i){var s=t.charCodeAt(i);if(s>=55296&&s<=57343)s=65536+((1023&s)<<10)|1023&t.charCodeAt(++i);if(s<=127){if(e>=a)break;r[e++]=s}else if(s<=2047){if(e+1>=a)break;r[e++]=192|s>>6,r[e++]=128|63&s}else if(s<=65535){if(e+2>=a)break;r[e++]=224|s>>12,r[e++]=128|s>>6&63,r[e++]=128|63&s}else{if(e+3>=a)break;r[e++]=240|s>>18,r[e++]=128|s>>12&63,r[e++]=128|s>>6&63,r[e++]=128|63&s}}return r[e]=0,e-o}function M(t){for(var r=0,e=0;e<t.length;++e){var n=t.charCodeAt(e);n<=127?r++:n<=2047?r+=2:n>=55296&&n<=57343?(r+=4,++e):r+=3}return r}function P(t){v=t,o.HEAP8=w=new Int8Array(t),o.HEAP16=E=new Int16Array(t),o.HEAP32=b=new Int32Array(t),o.HEAPU8=g=new Uint8Array(t),o.HEAPU16=new Uint16Array(t),o.HEAPU32=k=new Uint32Array(t),o.HEAPF32=new Float32Array(t),o.HEAPF64=S=new Float64Array(t)}o.INITIAL_MEMORY;var C=[],R=[],z=[];var j=0,O=null;function T(t){j++,o.monitorRunDependencies&&o.monitorRunDependencies(j)}function B(t){if(j--,o.monitorRunDependencies&&o.monitorRunDependencies(j),0==j&&O){var r=O;O=null,r()}}function N(t){o.onAbort&&o.onAbort(t),d(t="Aborted("+t+")"),_=!0,t+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(t);throw n(r),r}var I,L,H,U;function G(t){return t.startsWith("data:application/octet-stream;base64,")}function W(t){try{if(t==I&&f)return new Uint8Array(f);throw"both async and sync fetching of the wasm failed"}catch(t){N(t)}}G(I="graphvizlib.wasm")||(L=I,I=o.locateFile?o.locateFile(L,p):p+L);var Y={175632:(t,r)=>{var e=F(t),n=F(r);rt.createPath("/",X.dirname(e)),rt.writeFile(X.join("/",e),n)}};function J(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function q(t){for(;t.length>0;)t.shift()(o)}function V(t){this.excPtr=t,this.ptr=t-24,this.set_type=function(t){k[this.ptr+4>>2]=t},this.get_type=function(){return k[this.ptr+4>>2]},this.set_destructor=function(t){k[this.ptr+8>>2]=t},this.get_destructor=function(){return k[this.ptr+8>>2]},this.set_refcount=function(t){b[this.ptr>>2]=t},this.set_caught=function(t){t=t?1:0,w[this.ptr+12>>0]=t},this.get_caught=function(){return 0!=w[this.ptr+12>>0]},this.set_rethrown=function(t){t=t?1:0,w[this.ptr+13>>0]=t},this.get_rethrown=function(){return 0!=w[this.ptr+13>>0]},this.init=function(t,r){this.set_adjusted_ptr(0),this.set_type(t),this.set_destructor(r),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var t=b[this.ptr>>2];b[this.ptr>>2]=t+1},this.release_ref=function(){var t=b[this.ptr>>2];return b[this.ptr>>2]=t-1,1===t},this.set_adjusted_ptr=function(t){k[this.ptr+16>>2]=t},this.get_adjusted_ptr=function(){return k[this.ptr+16>>2]},this.get_exception_ptr=function(){if(xt(this.get_type()))return k[this.excPtr>>2];var t=this.get_adjusted_ptr();return 0!==t?t:this.excPtr}}var X={isAbs:t=>"/"===t.charAt(0),splitPath:t=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(t).slice(1),normalizeArray:(t,r)=>{for(var e=0,n=t.length-1;n>=0;n--){var o=t[n];"."===o?t.splice(n,1):".."===o?(t.splice(n,1),e++):e&&(t.splice(n,1),e--)}if(r)for(;e;e--)t.unshift("..");return t},normalize:t=>{var r=X.isAbs(t),e="/"===t.substr(-1);return(t=X.normalizeArray(t.split("/").filter((t=>!!t)),!r).join("/"))||r||(t="."),t&&e&&(t+="/"),(r?"/":"")+t},dirname:t=>{var r=X.splitPath(t),e=r[0],n=r[1];return e||n?(n&&(n=n.substr(0,n.length-1)),e+n):"."},basename:t=>{if("/"===t)return"/";var r=(t=(t=X.normalize(t)).replace(/\/$/,"")).lastIndexOf("/");return-1===r?t:t.substr(r+1)},join:function(){var t=Array.prototype.slice.call(arguments);return X.normalize(t.join("/"))},join2:(t,r)=>X.normalize(t+"/"+r)};var $={resolve:function(){for(var t="",r=!1,e=arguments.length-1;e>=-1&&!r;e--){var n=e>=0?arguments[e]:rt.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";t=n+"/"+t,r=X.isAbs(n)}return(r?"/":"")+(t=X.normalizeArray(t.split("/").filter((t=>!!t)),!r).join("/"))||"."},relative:(t,r)=>{function e(t){for(var r=0;r<t.length&&""===t[r];r++);for(var e=t.length-1;e>=0&&""===t[e];e--);return r>e?[]:t.slice(r,e-r+1)}t=$.resolve(t).substr(1),r=$.resolve(r).substr(1);for(var n=e(t.split("/")),o=e(r.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s<a;s++)if(n[s]!==o[s]){i=s;break}var u=[];for(s=i;s<n.length;s++)u.push("..");return(u=u.concat(o.slice(i))).join("/")}};function K(t,r,e){var n=e>0?e:M(t)+1,o=new Array(n),a=x(t,o,0,o.length);return r&&(o.length=a),o}var Z={ttys:[],init:function(){},shutdown:function(){},register:function(t,r){Z.ttys[t]={input:[],output:[],ops:r},rt.registerDevice(t,Z.stream_ops)},stream_ops:{open:function(t){var r=Z.ttys[t.node.rdev];if(!r)throw new rt.ErrnoError(43);t.tty=r,t.seekable=!1},close:function(t){t.tty.ops.fsync(t.tty)},fsync:function(t){t.tty.ops.fsync(t.tty)},read:function(t,r,e,n,o){if(!t.tty||!t.tty.ops.get_char)throw new rt.ErrnoError(60);for(var a=0,i=0;i<n;i++){var s;try{s=t.tty.ops.get_char(t.tty)}catch(t){throw new rt.ErrnoError(29)}if(void 0===s&&0===a)throw new rt.ErrnoError(6);if(null==s)break;a++,r[e+i]=s}return a&&(t.node.timestamp=Date.now()),a},write:function(t,r,e,n,o){if(!t.tty||!t.tty.ops.put_char)throw new rt.ErrnoError(60);try{for(var a=0;a<n;a++)t.tty.ops.put_char(t.tty,r[e+a])}catch(t){throw new rt.ErrnoError(29)}return n&&(t.node.timestamp=Date.now()),a}},default_tty_ops:{get_char:function(t){if(!t.input.length){var r=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(r=window.prompt("Input: "))&&(r+="\n"):"function"==typeof readline&&null!==(r=readline())&&(r+="\n"),!r)return null;t.input=K(r,!0)}return t.input.shift()},put_char:function(t,r){null===r||10===r?(l(A(t.output,0)),t.output=[]):0!=r&&t.output.push(r)},fsync:function(t){t.output&&t.output.length>0&&(l(A(t.output,0)),t.output=[])}},default_tty1_ops:{put_char:function(t,r){null===r||10===r?(d(A(t.output,0)),t.output=[]):0!=r&&t.output.push(r)},fsync:function(t){t.output&&t.output.length>0&&(d(A(t.output,0)),t.output=[])}}};function Q(t){t=function(t,r){return Math.ceil(t/r)*r}(t,65536);var r=Ft(65536,t);return r?function(t,r){return g.fill(0,t,t+r),t}(r,t):0}var tt={ops_table:null,mount:function(t){return tt.createNode(null,"/",16895,0)},createNode:function(t,r,e,n){if(rt.isBlkdev(e)||rt.isFIFO(e))throw new rt.ErrnoError(63);tt.ops_table||(tt.ops_table={dir:{node:{getattr:tt.node_ops.getattr,setattr:tt.node_ops.setattr,lookup:tt.node_ops.lookup,mknod:tt.node_ops.mknod,rename:tt.node_ops.rename,unlink:tt.node_ops.unlink,rmdir:tt.node_ops.rmdir,readdir:tt.node_ops.readdir,symlink:tt.node_ops.symlink},stream:{llseek:tt.stream_ops.llseek}},file:{node:{getattr:tt.node_ops.getattr,setattr:tt.node_ops.setattr},stream:{llseek:tt.stream_ops.llseek,read:tt.stream_ops.read,write:tt.stream_ops.write,allocate:tt.stream_ops.allocate,mmap:tt.stream_ops.mmap,msync:tt.stream_ops.msync}},link:{node:{getattr:tt.node_ops.getattr,setattr:tt.node_ops.setattr,readlink:tt.node_ops.readlink},stream:{}},chrdev:{node:{getattr:tt.node_ops.getattr,setattr:tt.node_ops.setattr},stream:rt.chrdev_stream_ops}});var o=rt.createNode(t,r,e,n);return rt.isDir(o.mode)?(o.node_ops=tt.ops_table.dir.node,o.stream_ops=tt.ops_table.dir.stream,o.contents={}):rt.isFile(o.mode)?(o.node_ops=tt.ops_table.file.node,o.stream_ops=tt.ops_table.file.stream,o.usedBytes=0,o.contents=null):rt.isLink(o.mode)?(o.node_ops=tt.ops_table.link.node,o.stream_ops=tt.ops_table.link.stream):rt.isChrdev(o.mode)&&(o.node_ops=tt.ops_table.chrdev.node,o.stream_ops=tt.ops_table.chrdev.stream),o.timestamp=Date.now(),t&&(t.contents[r]=o,t.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(t){return t.contents?t.contents.subarray?t.contents.subarray(0,t.usedBytes):new Uint8Array(t.contents):new Uint8Array(0)},expandFileStorage:function(t,r){var e=t.contents?t.contents.length:0;if(!(e>=r)){r=Math.max(r,e*(e<1048576?2:1.125)>>>0),0!=e&&(r=Math.max(r,256));var n=t.contents;t.contents=new Uint8Array(r),t.usedBytes>0&&t.contents.set(n.subarray(0,t.usedBytes),0)}},resizeFileStorage:function(t,r){if(t.usedBytes!=r)if(0==r)t.contents=null,t.usedBytes=0;else{var e=t.contents;t.contents=new Uint8Array(r),e&&t.contents.set(e.subarray(0,Math.min(r,t.usedBytes))),t.usedBytes=r}},node_ops:{getattr:function(t){var r={};return r.dev=rt.isChrdev(t.mode)?t.id:1,r.ino=t.id,r.mode=t.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=t.rdev,rt.isDir(t.mode)?r.size=4096:rt.isFile(t.mode)?r.size=t.usedBytes:rt.isLink(t.mode)?r.size=t.link.length:r.size=0,r.atime=new Date(t.timestamp),r.mtime=new Date(t.timestamp),r.ctime=new Date(t.timestamp),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr:function(t,r){void 0!==r.mode&&(t.mode=r.mode),void 0!==r.timestamp&&(t.timestamp=r.timestamp),void 0!==r.size&&tt.resizeFileStorage(t,r.size)},lookup:function(t,r){throw rt.genericErrors[44]},mknod:function(t,r,e,n){return tt.createNode(t,r,e,n)},rename:function(t,r,e){if(rt.isDir(t.mode)){var n;try{n=rt.lookupNode(r,e)}catch(t){}if(n)for(var o in n.contents)throw new rt.ErrnoError(55)}delete t.parent.contents[t.name],t.parent.timestamp=Date.now(),t.name=e,r.contents[e]=t,r.timestamp=t.parent.timestamp,t.parent=r},unlink:function(t,r){delete t.contents[r],t.timestamp=Date.now()},rmdir:function(t,r){var e=rt.lookupNode(t,r);for(var n in e.contents)throw new rt.ErrnoError(55);delete t.contents[r],t.timestamp=Date.now()},readdir:function(t){var r=[".",".."];for(var e in t.contents)t.contents.hasOwnProperty(e)&&r.push(e);return r},symlink:function(t,r,e){var n=tt.createNode(t,r,41471,0);return n.link=e,n},readlink:function(t){if(!rt.isLink(t.mode))throw new rt.ErrnoError(28);return t.link}},stream_ops:{read:function(t,r,e,n,o){var a=t.node.contents;if(o>=t.node.usedBytes)return 0;var i=Math.min(t.node.usedBytes-o,n);if(i>8&&a.subarray)r.set(a.subarray(o,o+i),e);else for(var s=0;s<i;s++)r[e+s]=a[o+s];return i},write:function(t,r,e,n,o,a){if(r.buffer===w.buffer&&(a=!1),!n)return 0;var i=t.node;if(i.timestamp=Date.now(),r.subarray&&(!i.contents||i.contents.subarray)){if(a)return i.contents=r.subarray(e,e+n),i.usedBytes=n,n;if(0===i.usedBytes&&0===o)return i.contents=r.slice(e,e+n),i.usedBytes=n,n;if(o+n<=i.usedBytes)return i.contents.set(r.subarray(e,e+n),o),n}if(tt.expandFileStorage(i,o+n),i.contents.subarray&&r.subarray)i.contents.set(r.subarray(e,e+n),o);else for(var s=0;s<n;s++)i.contents[o+s]=r[e+s];return i.usedBytes=Math.max(i.usedBytes,o+n),n},llseek:function(t,r,e){var n=r;if(1===e?n+=t.position:2===e&&rt.isFile(t.node.mode)&&(n+=t.node.usedBytes),n<0)throw new rt.ErrnoError(28);return n},allocate:function(t,r,e){tt.expandFileStorage(t.node,r+e),t.node.usedBytes=Math.max(t.node.usedBytes,r+e)},mmap:function(t,r,e,n,o){if(!rt.isFile(t.node.mode))throw new rt.ErrnoError(43);var a,i,s=t.node.contents;if(2&o||s.buffer!==v){if((e>0||e+r<s.length)&&(s=s.subarray?s.subarray(e,e+r):Array.prototype.slice.call(s,e,e+r)),i=!0,!(a=Q(r)))throw new rt.ErrnoError(48);w.set(s,a)}else i=!1,a=s.byteOffset;return{ptr:a,allocated:i}},msync:function(t,r,e,n,o){return tt.stream_ops.write(t,r,0,n,e,!1),0}}};var rt={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(t,r={})=>{if(!(t=$.resolve(rt.cwd(),t)))return{path:"",node:null};if((r=Object.assign({follow_mount:!0,recurse_count:0},r)).recurse_count>8)throw new rt.ErrnoError(32);for(var e=X.normalizeArray(t.split("/").filter((t=>!!t)),!1),n=rt.root,o="/",a=0;a<e.length;a++){var i=a===e.length-1;if(i&&r.parent)break;if(n=rt.lookupNode(n,e[a]),o=X.join2(o,e[a]),rt.isMountpoint(n)&&(!i||i&&r.follow_mount)&&(n=n.mounted.root),!i||r.follow)for(var s=0;rt.isLink(n.mode);){var u=rt.readlink(o);if(o=$.resolve(X.dirname(o),u),n=rt.lookupPath(o,{recurse_count:r.recurse_count+1}).node,s++>40)throw new rt.ErrnoError(32)}}return{path:o,node:n}},getPath:t=>{for(var r;;){if(rt.isRoot(t)){var e=t.mount.mountpoint;return r?"/"!==e[e.length-1]?e+"/"+r:e+r:e}r=r?t.name+"/"+r:t.name,t=t.parent}},hashName:(t,r)=>{for(var e=0,n=0;n<r.length;n++)e=(e<<5)-e+r.charCodeAt(n)|0;return(t+e>>>0)%rt.nameTable.length},hashAddNode:t=>{var r=rt.hashName(t.parent.id,t.name);t.name_next=rt.nameTable[r],rt.nameTable[r]=t},hashRemoveNode:t=>{var r=rt.hashName(t.parent.id,t.name);if(rt.nameTable[r]===t)rt.nameTable[r]=t.name_next;else for(var e=rt.nameTable[r];e;){if(e.name_next===t){e.name_next=t.name_next;break}e=e.name_next}},lookupNode:(t,r)=>{var e=rt.mayLookup(t);if(e)throw new rt.ErrnoError(e,t);for(var n=rt.hashName(t.id,r),o=rt.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===t.id&&a===r)return o}return rt.lookup(t,r)},createNode:(t,r,e,n)=>{var o=new rt.FSNode(t,r,e,n);return rt.hashAddNode(o),o},destroyNode:t=>{rt.hashRemoveNode(t)},isRoot:t=>t===t.parent,isMountpoint:t=>!!t.mounted,isFile:t=>32768==(61440&t),isDir:t=>16384==(61440&t),isLink:t=>40960==(61440&t),isChrdev:t=>8192==(61440&t),isBlkdev:t=>24576==(61440&t),isFIFO:t=>4096==(61440&t),isSocket:t=>49152==(49152&t),flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:t=>{var r=rt.flagModes[t];if(void 0===r)throw new Error("Unknown file open mode: "+t);return r},flagsToPermissionString:t=>{var r=["r","w","rw"][3&t];return 512&t&&(r+="w"),r},nodePermissions:(t,r)=>rt.ignorePermissions||(!r.includes("r")||292&t.mode)&&(!r.includes("w")||146&t.mode)&&(!r.includes("x")||73&t.mode)?0:2,mayLookup:t=>{var r=rt.nodePermissions(t,"x");return r||(t.node_ops.lookup?0:2)},mayCreate:(t,r)=>{try{rt.lookupNode(t,r);return 20}catch(t){}return rt.nodePermissions(t,"wx")},mayDelete:(t,r,e)=>{var n;try{n=rt.lookupNode(t,r)}catch(t){return t.errno}var o=rt.nodePermissions(t,"wx");if(o)return o;if(e){if(!rt.isDir(n.mode))return 54;if(rt.isRoot(n)||rt.getPath(n)===rt.cwd())return 10}else if(rt.isDir(n.mode))return 31;return 0},mayOpen:(t,r)=>t?rt.isLink(t.mode)?32:rt.isDir(t.mode)&&("r"!==rt.flagsToPermissionString(r)||512&r)?31:rt.nodePermissions(t,rt.flagsToPermissionString(r)):44,MAX_OPEN_FDS:4096,nextfd:(t=0,r=rt.MAX_OPEN_FDS)=>{for(var e=t;e<=r;e++)if(!rt.streams[e])return e;throw new rt.ErrnoError(33)},getStream:t=>rt.streams[t],createStream:(t,r,e)=>{rt.FSStream||(rt.FSStream=function(){this.shared={}},rt.FSStream.prototype={},Object.defineProperties(rt.FSStream.prototype,{object:{get:function(){return this.node},set:function(t){this.node=t}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}},flags:{get:function(){return this.shared.flags},set:function(t){this.shared.flags=t}},position:{get:function(){return this.shared.position},set:function(t){this.shared.position=t}}})),t=Object.assign(new rt.FSStream,t);var n=rt.nextfd(r,e);return t.fd=n,rt.streams[n]=t,t},closeStream:t=>{rt.streams[t]=null},chrdev_stream_ops:{open:t=>{var r=rt.getDevice(t.node.rdev);t.stream_ops=r.stream_ops,t.stream_ops.open&&t.stream_ops.open(t)},llseek:()=>{throw new rt.ErrnoError(70)}},major:t=>t>>8,minor:t=>255&t,makedev:(t,r)=>t<<8|r,registerDevice:(t,r)=>{rt.devices[t]={stream_ops:r}},getDevice:t=>rt.devices[t],getMounts:t=>{for(var r=[],e=[t];e.length;){var n=e.pop();r.push(n),e.push.apply(e,n.mounts)}return r},syncfs:(t,r)=>{"function"==typeof t&&(r=t,t=!1),rt.syncFSRequests++,rt.syncFSRequests>1&&d("warning: "+rt.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var e=rt.getMounts(rt.root.mount),n=0;function o(t){return rt.syncFSRequests--,r(t)}function a(t){if(t)return a.errored?void 0:(a.errored=!0,o(t));++n>=e.length&&o(null)}e.forEach((r=>{if(!r.type.syncfs)return a(null);r.type.syncfs(r,t,a)}))},mount:(t,r,e)=>{var n,o="/"===e,a=!e;if(o&&rt.root)throw new rt.ErrnoError(10);if(!o&&!a){var i=rt.lookupPath(e,{follow_mount:!1});if(e=i.path,n=i.node,rt.isMountpoint(n))throw new rt.ErrnoError(10);if(!rt.isDir(n.mode))throw new rt.ErrnoError(54)}var s={type:t,opts:r,mountpoint:e,mounts:[]},u=t.mount(s);return u.mount=s,s.root=u,o?rt.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:t=>{var r=rt.lookupPath(t,{follow_mount:!1});if(!rt.isMountpoint(r.node))throw new rt.ErrnoError(28);var e=r.node,n=e.mounted,o=rt.getMounts(n);Object.keys(rt.nameTable).forEach((t=>{for(var r=rt.nameTable[t];r;){var e=r.name_next;o.includes(r.mount)&&rt.destroyNode(r),r=e}})),e.mounted=null;var a=e.mount.mounts.indexOf(n);e.mount.mounts.splice(a,1)},lookup:(t,r)=>t.node_ops.lookup(t,r),mknod:(t,r,e)=>{var n=rt.lookupPath(t,{parent:!0}).node,o=X.basename(t);if(!o||"."===o||".."===o)throw new rt.ErrnoError(28);var a=rt.mayCreate(n,o);if(a)throw new rt.ErrnoError(a);if(!n.node_ops.mknod)throw new rt.ErrnoError(63);return n.node_ops.mknod(n,o,r,e)},create:(t,r)=>(r=void 0!==r?r:438,r&=4095,r|=32768,rt.mknod(t,r,0)),mkdir:(t,r)=>(r=void 0!==r?r:511,r&=1023,r|=16384,rt.mknod(t,r,0)),mkdirTree:(t,r)=>{for(var e=t.split("/"),n="",o=0;o<e.length;++o)if(e[o]){n+="/"+e[o];try{rt.mkdir(n,r)}catch(t){if(20!=t.errno)throw t}}},mkdev:(t,r,e)=>(void 0===e&&(e=r,r=438),r|=8192,rt.mknod(t,r,e)),symlink:(t,r)=>{if(!$.resolve(t))throw new rt.ErrnoError(44);var e=rt.lookupPath(r,{parent:!0}).node;if(!e)throw new rt.ErrnoError(44);var n=X.basename(r),o=rt.mayCreate(e,n);if(o)throw new rt.ErrnoError(o);if(!e.node_ops.symlink)throw new rt.ErrnoError(63);return e.node_ops.symlink(e,n,t)},rename:(t,r)=>{var e,n,o=X.dirname(t),a=X.dirname(r),i=X.basename(t),s=X.basename(r);if(e=rt.lookupPath(t,{parent:!0}).node,n=rt.lookupPath(r,{parent:!0}).node,!e||!n)throw new rt.ErrnoError(44);if(e.mount!==n.mount)throw new rt.ErrnoError(75);var u,c=rt.lookupNode(e,i),p=$.relative(t,a);if("."!==p.charAt(0))throw new rt.ErrnoError(28);if("."!==(p=$.relative(r,o)).charAt(0))throw new rt.ErrnoError(55);try{u=rt.lookupNode(n,s)}catch(t){}if(c!==u){var f=rt.isDir(c.mode),l=rt.mayDelete(e,i,f);if(l)throw new rt.ErrnoError(l);if(l=u?rt.mayDelete(n,s,f):rt.mayCreate(n,s))throw new rt.ErrnoError(l);if(!e.node_ops.rename)throw new rt.ErrnoError(63);if(rt.isMountpoint(c)||u&&rt.isMountpoint(u))throw new rt.ErrnoError(10);if(n!==e&&(l=rt.nodePermissions(e,"w")))throw new rt.ErrnoError(l);rt.hashRemoveNode(c);try{e.node_ops.rename(c,n,s)}catch(t){throw t}finally{rt.hashAddNode(c)}}},rmdir:t=>{var r=rt.lookupPath(t,{parent:!0}).node,e=X.basename(t),n=rt.lookupNode(r,e),o=rt.mayDelete(r,e,!0);if(o)throw new rt.ErrnoError(o);if(!r.node_ops.rmdir)throw new rt.ErrnoError(63);if(rt.isMountpoint(n))throw new rt.ErrnoError(10);r.node_ops.rmdir(r,e),rt.destroyNode(n)},readdir:t=>{var r=rt.lookupPath(t,{follow:!0}).node;if(!r.node_ops.readdir)throw new rt.ErrnoError(54);return r.node_ops.readdir(r)},unlink:t=>{var r=rt.lookupPath(t,{parent:!0}).node;if(!r)throw new rt.ErrnoError(44);var e=X.basename(t),n=rt.lookupNode(r,e),o=rt.mayDelete(r,e,!1);if(o)throw new rt.ErrnoError(o);if(!r.node_ops.unlink)throw new rt.ErrnoError(63);if(rt.isMountpoint(n))throw new rt.ErrnoError(10);r.node_ops.unlink(r,e),rt.destroyNode(n)},readlink:t=>{var r=rt.lookupPath(t).node;if(!r)throw new rt.ErrnoError(44);if(!r.node_ops.readlink)throw new rt.ErrnoError(28);return $.resolve(rt.getPath(r.parent),r.node_ops.readlink(r))},stat:(t,r)=>{var e=rt.lookupPath(t,{follow:!r}).node;if(!e)throw new rt.ErrnoError(44);if(!e.node_ops.getattr)throw new rt.ErrnoError(63);return e.node_ops.getattr(e)},lstat:t=>rt.stat(t,!0),chmod:(t,r,e)=>{var n;"string"==typeof t?n=rt.lookupPath(t,{follow:!e}).node:n=t;if(!n.node_ops.setattr)throw new rt.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&r|-4096&n.mode,timestamp:Date.now()})},lchmod:(t,r)=>{rt.chmod(t,r,!0)},fchmod:(t,r)=>{var e=rt.getStream(t);if(!e)throw new rt.ErrnoError(8);rt.chmod(e.node,r)},chown:(t,r,e,n)=>{var o;"string"==typeof t?o=rt.lookupPath(t,{follow:!n}).node:o=t;if(!o.node_ops.setattr)throw new rt.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(t,r,e)=>{rt.chown(t,r,e,!0)},fchown:(t,r,e)=>{var n=rt.getStream(t);if(!n)throw new rt.ErrnoError(8);rt.chown(n.node,r,e)},truncate:(t,r)=>{if(r<0)throw new rt.ErrnoError(28);var e;"string"==typeof t?e=rt.lookupPath(t,{follow:!0}).node:e=t;if(!e.node_ops.setattr)throw new rt.ErrnoError(63);if(rt.isDir(e.mode))throw new rt.ErrnoError(31);if(!rt.isFile(e.mode))throw new rt.ErrnoError(28);var n=rt.nodePermissions(e,"w");if(n)throw new rt.ErrnoError(n);e.node_ops.setattr(e,{size:r,timestamp:Date.now()})},ftruncate:(t,r)=>{var e=rt.getStream(t);if(!e)throw new rt.ErrnoError(8);if(0==(2097155&e.flags))throw new rt.ErrnoError(28);rt.truncate(e.node,r)},utime:(t,r,e)=>{var n=rt.lookupPath(t,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(r,e)})},open:(t,r,e)=>{if(""===t)throw new rt.ErrnoError(44);var n;if(e=void 0===e?438:e,e=64&(r="string"==typeof r?rt.modeStringToFlags(r):r)?4095&e|32768:0,"object"==typeof t)n=t;else{t=X.normalize(t);try{n=rt.lookupPath(t,{follow:!(131072&r)}).node}catch(t){}}var a=!1;if(64&r)if(n){if(128&r)throw new rt.ErrnoError(20)}else n=rt.mknod(t,e,0),a=!0;if(!n)throw new rt.ErrnoError(44);if(rt.isChrdev(n.mode)&&(r&=-513),65536&r&&!rt.isDir(n.mode))throw new rt.ErrnoError(54);if(!a){var i=rt.mayOpen(n,r);if(i)throw new rt.ErrnoError(i)}512&r&&!a&&rt.truncate(n,0),r&=-131713;var s=rt.createStream({node:n,path:rt.getPath(n),flags:r,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!o.logReadFiles||1&r||(rt.readFiles||(rt.readFiles={}),t in rt.readFiles||(rt.readFiles[t]=1)),s},close:t=>{if(rt.isClosed(t))throw new rt.ErrnoError(8);t.getdents&&(t.getdents=null);try{t.stream_ops.close&&t.stream_ops.close(t)}catch(t){throw t}finally{rt.closeStream(t.fd)}t.fd=null},isClosed:t=>null===t.fd,llseek:(t,r,e)=>{if(rt.isClosed(t))throw new rt.ErrnoError(8);if(!t.seekable||!t.stream_ops.llseek)throw new rt.ErrnoError(70);if(0!=e&&1!=e&&2!=e)throw new rt.ErrnoError(28);return t.position=t.stream_ops.llseek(t,r,e),t.ungotten=[],t.position},read:(t,r,e,n,o)=>{if(n<0||o<0)throw new rt.ErrnoError(28);if(rt.isClosed(t))throw new rt.ErrnoError(8);if(1==(2097155&t.flags))throw new rt.ErrnoError(8);if(rt.isDir(t.node.mode))throw new rt.ErrnoError(31);if(!t.stream_ops.read)throw new rt.ErrnoError(28);var a=void 0!==o;if(a){if(!t.seekable)throw new rt.ErrnoError(70)}else o=t.position;var i=t.stream_ops.read(t,r,e,n,o);return a||(t.position+=i),i},write:(t,r,e,n,o,a)=>{if(n<0||o<0)throw new rt.ErrnoError(28);if(rt.isClosed(t))throw new rt.ErrnoError(8);if(0==(2097155&t.flags))throw new rt.ErrnoError(8);if(rt.isDir(t.node.mode))throw new rt.ErrnoError(31);if(!t.stream_ops.write)throw new rt.ErrnoError(28);t.seekable&&1024&t.flags&&rt.llseek(t,0,2);var i=void 0!==o;if(i){if(!t.seekable)throw new rt.ErrnoError(70)}else o=t.position;var s=t.stream_ops.write(t,r,e,n,o,a);return i||(t.position+=s),s},allocate:(t,r,e)=>{if(rt.isClosed(t))throw new rt.ErrnoError(8);if(r<0||e<=0)throw new rt.ErrnoError(28);if(0==(2097155&t.flags))throw new rt.ErrnoError(8);if(!rt.isFile(t.node.mode)&&!rt.isDir(t.node.mode))throw new rt.ErrnoError(43);if(!t.stream_ops.allocate)throw new rt.ErrnoError(138);t.stream_ops.allocate(t,r,e)},mmap:(t,r,e,n,o)=>{if(0!=(2&n)&&0==(2&o)&&2!=(2097155&t.flags))throw new rt.ErrnoError(2);if(1==(2097155&t.flags))throw new rt.ErrnoError(2);if(!t.stream_ops.mmap)throw new rt.ErrnoError(43);return t.stream_ops.mmap(t,r,e,n,o)},msync:(t,r,e,n,o)=>t.stream_ops.msync?t.stream_ops.msync(t,r,e,n,o):0,munmap:t=>0,ioctl:(t,r,e)=>{if(!t.stream_ops.ioctl)throw new rt.ErrnoError(59);return t.stream_ops.ioctl(t,r,e)},readFile:(t,r={})=>{if(r.flags=r.flags||0,r.encoding=r.encoding||"binary","utf8"!==r.encoding&&"binary"!==r.encoding)throw new Error('Invalid encoding type "'+r.encoding+'"');var e,n=rt.open(t,r.flags),o=rt.stat(t).size,a=new Uint8Array(o);return rt.read(n,a,0,o,0),"utf8"===r.encoding?e=A(a,0):"binary"===r.encoding&&(e=a),rt.close(n),e},writeFile:(t,r,e={})=>{e.flags=e.flags||577;var n=rt.open(t,e.flags,e.mode);if("string"==typeof r){var o=new Uint8Array(M(r)+1),a=x(r,o,0,o.length);rt.write(n,o,0,a,void 0,e.canOwn)}else{if(!ArrayBuffer.isView(r))throw new Error("Unsupported data type");rt.write(n,r,0,r.byteLength,void 0,e.canOwn)}rt.close(n)},cwd:()=>rt.currentPath,chdir:t=>{var r=rt.lookupPath(t,{follow:!0});if(null===r.node)throw new rt.ErrnoError(44);if(!rt.isDir(r.node.mode))throw new rt.ErrnoError(54);var e=rt.nodePermissions(r.node,"x");if(e)throw new rt.ErrnoError(e);rt.currentPath=r.path},createDefaultDirectories:()=>{rt.mkdir("/tmp"),rt.mkdir("/home"),rt.mkdir("/home/web_user")},createDefaultDevices:()=>{rt.mkdir("/dev"),rt.registerDevice(rt.makedev(1,3),{read:()=>0,write:(t,r,e,n,o)=>n}),rt.mkdev("/dev/null",rt.makedev(1,3)),Z.register(rt.makedev(5,0),Z.default_tty_ops),Z.register(rt.makedev(6,0),Z.default_tty1_ops),rt.mkdev("/dev/tty",rt.makedev(5,0)),rt.mkdev("/dev/tty1",rt.makedev(6,0));var t=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}return()=>N("randomDevice")}();rt.createDevice("/dev","random",t),rt.createDevice("/dev","urandom",t),rt.mkdir("/dev/shm"),rt.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{rt.mkdir("/proc");var t=rt.mkdir("/proc/self");rt.mkdir("/proc/self/fd"),rt.mount({mount:()=>{var r=rt.createNode(t,"fd",16895,73);return r.node_ops={lookup:(t,r)=>{var e=+r,n=rt.getStream(e);if(!n)throw new rt.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},r}},{},"/proc/self/fd")},createStandardStreams:()=>{o.stdin?rt.createDevice("/dev","stdin",o.stdin):rt.symlink("/dev/tty","/dev/stdin"),o.stdout?rt.createDevice("/dev","stdout",null,o.stdout):rt.symlink("/dev/tty","/dev/stdout"),o.stderr?rt.createDevice("/dev","stderr",null,o.stderr):rt.symlink("/dev/tty1","/dev/stderr"),rt.open("/dev/stdin",0),rt.open("/dev/stdout",1),rt.open("/dev/stderr",1)},ensureErrnoError:()=>{rt.ErrnoError||(rt.ErrnoError=function(t,r){this.node=r,this.setErrno=function(t){this.errno=t},this.setErrno(t),this.message="FS error"},rt.ErrnoError.prototype=new Error,rt.ErrnoError.prototype.constructor=rt.ErrnoError,[44].forEach((t=>{rt.genericErrors[t]=new rt.ErrnoError(t),rt.genericErrors[t].stack="<generic error, no stack>"})))},staticInit:()=>{rt.ensureErrnoError(),rt.nameTable=new Array(4096),rt.mount(tt,{},"/"),rt.createDefaultDirectories(),rt.createDefaultDevices(),rt.createSpecialDirectories(),rt.filesystems={MEMFS:tt}},init:(t,r,e)=>{rt.init.initialized=!0,rt.ensureErrnoError(),o.stdin=t||o.stdin,o.stdout=r||o.stdout,o.stderr=e||o.stderr,rt.createStandardStreams()},quit:()=>{rt.init.initialized=!1;for(var t=0;t<rt.streams.length;t++){var r=rt.streams[t];r&&rt.close(r)}},getMode:(t,r)=>{var e=0;return t&&(e|=365),r&&(e|=146),e},findObject:(t,r)=>{var e=rt.analyzePath(t,r);return e.exists?e.object:null},analyzePath:(t,r)=>{try{t=(n=rt.lookupPath(t,{follow:!r})).path}catch(t){}var e={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=rt.lookupPath(t,{parent:!0});e.parentExists=!0,e.parentPath=n.path,e.parentObject=n.node,e.name=X.basename(t),n=rt.lookupPath(t,{follow:!r}),e.exists=!0,e.path=n.path,e.object=n.node,e.name=n.node.name,e.isRoot="/"===n.path}catch(t){e.error=t.errno}return e},createPath:(t,r,e,n)=>{t="string"==typeof t?t:rt.getPath(t);for(var o=r.split("/").reverse();o.length;){var a=o.pop();if(a){var i=X.join2(t,a);try{rt.mkdir(i)}catch(t){}t=i}}return i},createFile:(t,r,e,n,o)=>{var a=X.join2("string"==typeof t?t:rt.getPath(t),r),i=rt.getMode(n,o);return rt.create(a,i)},createDataFile:(t,r,e,n,o,a)=>{var i=r;t&&(t="string"==typeof t?t:rt.getPath(t),i=r?X.join2(t,r):t);var s=rt.getMode(n,o),u=rt.create(i,s);if(e){if("string"==typeof e){for(var c=new Array(e.length),p=0,f=e.length;p<f;++p)c[p]=e.charCodeAt(p);e=c}rt.chmod(u,146|s);var l=rt.open(u,577);rt.write(l,e,0,e.length,0,a),rt.close(l),rt.chmod(u,s)}return u},createDevice:(t,r,e,n)=>{var o=X.join2("string"==typeof t?t:rt.getPath(t),r),a=rt.getMode(!!e,!!n);rt.createDevice.major||(rt.createDevice.major=64);var i=rt.makedev(rt.createDevice.major++,0);return rt.registerDevice(i,{open:t=>{t.seekable=!1},close:t=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(t,r,n,o,a)=>{for(var i=0,s=0;s<o;s++){var u;try{u=e()}catch(t){throw new rt.ErrnoError(29)}if(void 0===u&&0===i)throw new rt.ErrnoError(6);if(null==u)break;i++,r[n+s]=u}return i&&(t.node.timestamp=Date.now()),i},write:(t,r,e,o,a)=>{for(var i=0;i<o;i++)try{n(r[e+i])}catch(t){throw new rt.ErrnoError(29)}return o&&(t.node.timestamp=Date.now()),i}}),rt.mkdev(o,a,i)},forceLoadFile:t=>{if(t.isDevice||t.isFolder||t.link||t.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(!a)throw new Error("Cannot load without read() or XMLHttpRequest.");try{t.contents=K(a(t.url),!0),t.usedBytes=t.contents.length}catch(t){throw new rt.ErrnoError(29)}},createLazyFile:(t,r,e,n,o)=>{function a(){this.lengthKnown=!1,this.chunks=[]}if(a.prototype.get=function(t){if(!(t>this.length-1||t<0)){var r=t%this.chunkSize,e=t/this.chunkSize|0;return this.getter(e)[r]}},a.prototype.setDataGetter=function(t){this.getter=t},a.prototype.cacheLength=function(){var t=new XMLHttpRequest;if(t.open("HEAD",e,!1),t.send(null),!(t.status>=200&&t.status<300||304===t.status))throw new Error("Couldn't load "+e+". Status: "+t.status);var r,n=Number(t.getResponseHeader("Content-length")),o=(r=t.getResponseHeader("Accept-Ranges"))&&"bytes"===r,a=(r=t.getResponseHeader("Content-Encoding"))&&"gzip"===r,i=1048576;o||(i=n);var s=this;s.setDataGetter((t=>{var r=t*i,o=(t+1)*i-1;if(o=Math.min(o,n-1),void 0===s.chunks[t]&&(s.chunks[t]=((t,r)=>{if(t>r)throw new Error("invalid range ("+t+", "+r+") or no bytes requested!");if(r>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",e,!1),n!==i&&o.setRequestHeader("Range","bytes="+t+"-"+r),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 "+e+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):K(o.responseText||"",!0)})(r,o)),void 0===s.chunks[t])throw new Error("doXHR failed!");return s.chunks[t]})),!a&&n||(i=n=1,n=this.getter(0).length,i=n,l("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=i,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var i={isDevice:!1,url:e},s=rt.createFile(t,r,i,n,o);i.contents?s.contents=i.contents:i.url&&(s.contents=null,s.url=i.url),Object.defineProperties(s,{usedBytes:{get:function(){return this.contents.length}}});var u={};function c(t,r,e,n,o){var a=t.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(a.slice)for(var s=0;s<i;s++)r[e+s]=a[o+s];else for(s=0;s<i;s++)r[e+s]=a.get(o+s);return i}return Object.keys(s.stream_ops).forEach((t=>{var r=s.stream_ops[t];u[t]=function(){return rt.forceLoadFile(s),r.apply(null,arguments)}})),u.read=(t,r,e,n,o)=>(rt.forceLoadFile(s),c(t,r,e,n,o)),u.mmap=(t,r,e,n,o)=>{rt.forceLoadFile(s);var a=Q(r);if(!a)throw new rt.ErrnoError(48);return c(t,w,a,r,e),{ptr:a,allocated:!0}},s.stream_ops=u,s},createPreloadedFile:(t,r,e,n,o,a,s,u,c,p)=>{var f=r?$.resolve(X.join2(t,r)):t;function l(e){function i(e){p&&p(),u||rt.createDataFile(t,r,e,n,o,c),a&&a(),B()}Browser.handledByPreloadPlugin(e,f,i,(()=>{s&&s(),B()}))||i(e)}T(),"string"==typeof e?function(t,r,e,n){var o=n?"":"al "+t;i(t,(e=>{y(e,'Loading data file "'+t+'" failed (no arrayBuffer).'),r(new Uint8Array(e)),o&&B()}),(r=>{if(!e)throw'Loading data file "'+t+'" failed.';e()})),o&&T()}(e,(t=>l(t)),s):l(e)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(t,r,e)=>{r=r||(()=>{}),e=e||(()=>{});var n=rt.indexedDB();try{var o=n.open(rt.DB_NAME(),rt.DB_VERSION)}catch(t){return e(t)}o.onupgradeneeded=()=>{l("creating db"),o.result.createObjectStore(rt.DB_STORE_NAME)},o.onsuccess=()=>{var n=o.result.transaction([rt.DB_STORE_NAME],"readwrite"),a=n.objectStore(rt.DB_STORE_NAME),i=0,s=0,u=t.length;function c(){0==s?r():e()}t.forEach((t=>{var r=a.put(rt.analyzePath(t).object.contents,t);r.onsuccess=()=>{++i+s==u&&c()},r.onerror=()=>{s++,i+s==u&&c()}})),n.onerror=e},o.onerror=e},loadFilesFromDB:(t,r,e)=>{r=r||(()=>{}),e=e||(()=>{});var n=rt.indexedDB();try{var o=n.open(rt.DB_NAME(),rt.DB_VERSION)}catch(t){return e(t)}o.onupgradeneeded=e,o.onsuccess=()=>{var n=o.result;try{var a=n.transaction([rt.DB_STORE_NAME],"readonly")}catch(t){return void e(t)}var i=a.objectStore(rt.DB_STORE_NAME),s=0,u=0,c=t.length;function p(){0==u?r():e()}t.forEach((t=>{var r=i.get(t);r.onsuccess=()=>{rt.analyzePath(t).exists&&rt.unlink(t),rt.createDataFile(X.dirname(t),X.basename(t),r.result,!0,!0,!0),++s+u==c&&p()},r.onerror=()=>{u++,s+u==c&&p()}})),a.onerror=e},o.onerror=e}},et={DEFAULT_POLLMASK:5,calculateAt:function(t,r,e){if(X.isAbs(r))return r;var n;-100===t?n=rt.cwd():n=et.getStreamFromFD(t).path;if(0==r.length){if(!e)throw new rt.ErrnoError(44);return n}return X.join2(n,r)},doStat:function(t,r,e){try{var n=t(r)}catch(t){if(t&&t.node&&X.normalize(r)!==X.normalize(rt.getPath(t.node)))return-54;throw t}return b[e>>2]=n.dev,b[e+8>>2]=n.ino,b[e+12>>2]=n.mode,k[e+16>>2]=n.nlink,b[e+20>>2]=n.uid,b[e+24>>2]=n.gid,b[e+28>>2]=n.rdev,U=[n.size>>>0,(H=n.size,+Math.abs(H)>=1?H>0?(0|Math.min(+Math.floor(H/4294967296),4294967295))>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],b[e+40>>2]=U[0],b[e+44>>2]=U[1],b[e+48>>2]=4096,b[e+52>>2]=n.blocks,U=[Math.floor(n.atime.getTime()/1e3)>>>0,(H=Math.floor(n.atime.getTime()/1e3),+Math.abs(H)>=1?H>0?(0|Math.min(+Math.floor(H/4294967296),4294967295))>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],b[e+56>>2]=U[0],b[e+60>>2]=U[1],k[e+64>>2]=0,U=[Math.floor(n.mtime.getTime()/1e3)>>>0,(H=Math.floor(n.mtime.getTime()/1e3),+Math.abs(H)>=1?H>0?(0|Math.min(+Math.floor(H/4294967296),4294967295))>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],b[e+72>>2]=U[0],b[e+76>>2]=U[1],k[e+80>>2]=0,U=[Math.floor(n.ctime.getTime()/1e3)>>>0,(H=Math.floor(n.ctime.getTime()/1e3),+Math.abs(H)>=1?H>0?(0|Math.min(+Math.floor(H/4294967296),4294967295))>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],b[e+88>>2]=U[0],b[e+92>>2]=U[1],k[e+96>>2]=0,U=[n.ino>>>0,(H=n.ino,+Math.abs(H)>=1?H>0?(0|Math.min(+Math.floor(H/4294967296),4294967295))>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],b[e+104>>2]=U[0],b[e+108>>2]=U[1],0},doMsync:function(t,r,e,n,o){if(!rt.isFile(r.node.mode))throw new rt.ErrnoError(43);if(2&n)return 0;var a=g.slice(t,t+e);rt.msync(r,a,o,e,n)},varargs:void 0,get:function(){return et.varargs+=4,b[et.varargs-4>>2]},getStr:function(t){return F(t)},getStreamFromFD:function(t){var r=rt.getStream(t);if(!r)throw new rt.ErrnoError(8);return r}};var nt=[];function ot(t){try{return m.grow(t-v.byteLength+65535>>>16),P(m.buffer),1}catch(t){}}var at={};function it(){if(!it.strings){var t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:u||"./this.program"};for(var r in at)void 0===at[r]?delete t[r]:t[r]=at[r];var e=[];for(var r in t)e.push(r+"="+t[r]);it.strings=e}return it.strings}function st(t){h||(o.onExit&&o.onExit(t),_=!0),c(t,new J(t))}var ut=function(t,r){st(t)};function ct(t){return t%4==0&&(t%100!=0||t%400==0)}var pt=[31,29,31,30,31,30,31,31,30,31,30,31],ft=[31,28,31,30,31,30,31,31,30,31,30,31];function lt(t,r,e,n){var o=b[n+40>>2],a={tm_sec:b[n>>2],tm_min:b[n+4>>2],tm_hour:b[n+8>>2],tm_mday:b[n+12>>2],tm_mon:b[n+16>>2],tm_year:b[n+20>>2],tm_wday:b[n+24>>2],tm_yday:b[n+28>>2],tm_isdst:b[n+32>>2],tm_gmtoff:b[n+36>>2],tm_zone:o?F(o):""},i=F(e),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var u in s)i=i.replace(new RegExp(u,"g"),s[u]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],p=["January","February","March","April","May","June","July","August","September","October","November","December"];function f(t,r,e){for(var n="number"==typeof t?t.toString():t||"";n.length<r;)n=e[0]+n;return n}function l(t,r){return f(t,r,"0")}function d(t,r){function e(t){return t<0?-1:t>0?1:0}var n;return 0===(n=e(t.getFullYear()-r.getFullYear()))&&0===(n=e(t.getMonth()-r.getMonth()))&&(n=e(t.getDate()-r.getDate())),n}function m(t){switch(t.getDay()){case 0:return new Date(t.getFullYear()-1,11,29);case 1:return t;case 2:return new Date(t.getFullYear(),0,3);case 3:return new Date(t.getFullYear(),0,2);case 4:return new Date(t.getFullYear(),0,1);case 5:return new Date(t.getFullYear()-1,11,31);case 6:return new Date(t.getFullYear()-1,11,30)}}function h(t){var r=function(t,r){for(var e=new Date(t.getTime());r>0;){var n=ct(e.getFullYear()),o=e.getMonth(),a=(n?pt:ft)[o];if(!(r>a-e.getDate()))return e.setDate(e.getDate()+r),e;r-=a-e.getDate()+1,e.setDate(1),o<11?e.setMonth(o+1):(e.setMonth(0),e.setFullYear(e.getFullYear()+1))}return e}(new Date(t.tm_year+1900,0,1),t.tm_yday),e=new Date(r.getFullYear(),0,4),n=new Date(r.getFullYear()+1,0,4),o=m(e),a=m(n);return d(o,r)<=0?d(a,r)<=0?r.getFullYear()+1:r.getFullYear():r.getFullYear()-1}var _={"%a":function(t){return c[t.tm_wday].substring(0,3)},"%A":function(t){return c[t.tm_wday]},"%b":function(t){return p[t.tm_mon].substring(0,3)},"%B":function(t){return p[t.tm_mon]},"%C":function(t){return l((t.tm_year+1900)/100|0,2)},"%d":function(t){return l(t.tm_mday,2)},"%e":function(t){return f(t.tm_mday,2," ")},"%g":function(t){return h(t).toString().substring(2)},"%G":function(t){return h(t)},"%H":function(t){return l(t.tm_hour,2)},"%I":function(t){var r=t.tm_hour;return 0==r?r=12:r>12&&(r-=12),l(r,2)},"%j":function(t){return l(t.tm_mday+function(t,r){for(var e=0,n=0;n<=r;e+=t[n++]);return e}(ct(t.tm_year+1900)?pt:ft,t.tm_mon-1),3)},"%m":function(t){return l(t.tm_mon+1,2)},"%M":function(t){return l(t.tm_min,2)},"%n":function(){return"\n"},"%p":function(t){return t.tm_hour>=0&&t.tm_hour<12?"AM":"PM"},"%S":function(t){return l(t.tm_sec,2)},"%t":function(){return"\t"},"%u":function(t){return t.tm_wday||7},"%U":function(t){var r=t.tm_yday+7-t.tm_wday;return l(Math.floor(r/7),2)},"%V":function(t){var r=Math.floor((t.tm_yday+7-(t.tm_wday+6)%7)/7);if((t.tm_wday+371-t.tm_yday-2)%7<=2&&r++,r){if(53==r){var e=(t.tm_wday+371-t.tm_yday)%7;4==e||3==e&&ct(t.tm_year)||(r=1)}}else{r=52;var n=(t.tm_wday+7-t.tm_yday-1)%7;(4==n||5==n&&ct(t.tm_year%400-1))&&r++}return l(r,2)},"%w":function(t){return t.tm_wday},"%W":function(t){var r=t.tm_yday+7-(t.tm_wday+6)%7;return l(Math.floor(r/7),2)},"%y":function(t){return(t.tm_year+1900).toString().substring(2)},"%Y":function(t){return t.tm_year+1900},"%z":function(t){var r=t.tm_gmtoff,e=r>=0;return r=(r=Math.abs(r)/60)/60*100+r%60,(e?"+":"-")+String("0000"+r).slice(-4)},"%Z":function(t){return t.tm_zone},"%%":function(){return"%"}};for(var u in i=i.replace(/%%/g,"\0\0"),_)i.includes(u)&&(i=i.replace(new RegExp(u,"g"),_[u](a)));var y=K(i=i.replace(/\0\0/g,"%"),!1);return y.length>r?0:(function(t,r){w.set(t,r)}(y,t),y.length-1)}var dt=function(t,r,e,n){t||(t=this),this.parent=t,this.mount=t.mount,this.mounted=null,this.id=rt.nextInode++,this.name=r,this.mode=e,this.node_ops={},this.stream_ops={},this.rdev=n},mt=365,ht=146;Object.defineProperties(dt.prototype,{read:{get:function(){return(this.mode&mt)===mt},set:function(t){t?this.mode|=mt:this.mode&=-366}},write:{get:function(){return(this.mode&ht)===ht},set:function(t){t?this.mode|=ht:this.mode&=-147}},isFolder:{get:function(){return rt.isDir(this.mode)}},isDevice:{get:function(){return rt.isChrdev(this.mode)}}}),rt.FSNode=dt,rt.staticInit();var _t={c:function(t){return Dt(t+24)+24},b:function(t,r,e){throw new V(t).init(r,e),t},m:function(t,r,e,n){try{if(r=et.getStr(r),r=et.calculateAt(t,r),-8&e)return-28;var o=rt.lookupPath(r,{follow:!0}).node;if(!o)return-44;var a="";return 4&e&&(a+="r"),2&e&&(a+="w"),1&e&&(a+="x"),a&&rt.nodePermissions(o,a)?-2:0}catch(t){if(void 0===rt||!(t instanceof rt.ErrnoError))throw t;return-t.errno}},j:function(t,r,e){et.varargs=e;try{var n=et.getStreamFromFD(t);switch(r){case 0:return(o=et.get())<0?-28:rt.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=et.get();return n.flags|=o,0;case 5:o=et.get();return E[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return a=28,b[At()>>2]=a,-1}}catch(t){if(void 0===rt||!(t instanceof rt.ErrnoError))throw t;return-t.errno}var a},x:function(t,r){try{var e=et.getStreamFromFD(t);return et.doStat(rt.stat,e.path,r)}catch(t){if(void 0===rt||!(t instanceof rt.ErrnoError))throw t;return-t.errno}},y:function(t,r,e){et.varargs=e;try{var n=et.getStreamFromFD(t);switch(r){case 21509:case 21505:case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:case 21523:case 21524:return n.tty?0:-59;case 21519:if(!n.tty)return-59;var o=et.get();return b[o>>2]=0,0;case 21520:return n.tty?-28:-59;case 21531:o=et.get();return rt.ioctl(n,r,o);default:return-28}}catch(t){if(void 0===rt||!(t instanceof rt.ErrnoError))throw t;return-t.errno}},v:function(t,r,e,n){try{r=et.getStr(r);var o=256&n,a=4096&n;return n&=-4353,r=et.calculateAt(t,r,a),et.doStat(o?rt.lstat:rt.stat,r,e)}catch(t){if(void 0===rt||!(t instanceof rt.ErrnoError))throw t;return-t.errno}},g:function(t,r,e,n){et.varargs=n;try{r=et.getStr(r),r=et.calculateAt(t,r);var o=n?et.get():0;return rt.open(r,e,o).fd}catch(t){if(void 0===rt||!(t instanceof rt.ErrnoError))throw t;return-t.errno}},w:function(t,r){try{return t=et.getStr(t),et.doStat(rt.stat,t,r)}catch(t){if(void 0===rt||!(t instanceof rt.ErrnoError))throw t;return-t.errno}},q:function(t,r,e){try{return r=et.getStr(r),r=et.calculateAt(t,r),0===e?rt.unlink(r):512===e?rt.rmdir(r):N("Invalid flags passed to unlinkat"),0}catch(t){if(void 0===rt||!(t instanceof rt.ErrnoError))throw t;return-t.errno}},k:function(){return true},r:function(t,r,e,n,o,a,i){try{var s=et.getStreamFromFD(n),u=rt.mmap(s,t,o,r,e),c=u.ptr;return b[a>>2]=u.allocated,k[i>>2]=c,0}catch(t){if(void 0===rt||!(t instanceof rt.ErrnoError))throw t;return-t.errno}},s:function(t,r,e,n,o,a){try{var i=et.getStreamFromFD(o);2&e&&et.doMsync(t,i,r,n,a),rt.munmap(i)}catch(t){if(void 0===rt||!(t instanceof rt.ErrnoError))throw t;return-t.errno}},a:function(){N("")},z:function(t,r,e){var n=function(t,r){var e;for(nt.length=0,r>>=2;e=g[t++];)r+=105!=e&r,nt.push(105==e?b[r]:S[r++>>1]),++r;return nt}(r,e);return Y[t].apply(null,n)},f:function(){return Date.now()},l:function(t,r,e){g.copyWithin(t,r,r+e)},p:function(t){var r,e,n=g.length,o=2147483648;if((t>>>=0)>o)return!1;for(var a=1;a<=4;a*=2){var i=n*(1+.2/a);if(i=Math.min(i,t+100663296),ot(Math.min(o,(r=Math.max(t,i))+((e=65536)-r%e)%e)))return!0}return!1},t:function(t,r){var e=0;return it().forEach((function(n,o){var a=r+e;k[t+4*o>>2]=a,function(t,r,e){for(var n=0;n<t.length;++n)w[r++>>0]=t.charCodeAt(n);e||(w[r>>0]=0)}(n,a),e+=n.length+1})),0},u:function(t,r){var e=it();k[t>>2]=e.length;var n=0;return e.forEach((function(t){n+=t.length+1})),k[r>>2]=n,0},d:ut,e:function(t){try{var r=et.getStreamFromFD(t);return rt.close(r),0}catch(t){if(void 0===rt||!(t instanceof rt.ErrnoError))throw t;return t.errno}},h:function(t,r,e,n){try{var o=function(t,r,e,n){for(var o=0,a=0;a<e;a++){var i=k[r>>2],s=k[r+4>>2];r+=8;var u=rt.read(t,w,i,s,n);if(u<0)return-1;if(o+=u,u<s)break}return o}(et.getStreamFromFD(t),r,e);return k[n>>2]=o,0}catch(t){if(void 0===rt||!(t instanceof rt.ErrnoError))throw t;return t.errno}},n:function(t,r,e,n,o){try{var a=(u=e)+2097152>>>0<4194305-!!(s=r)?(s>>>0)+4294967296*u:NaN;if(isNaN(a))return 61;var i=et.getStreamFromFD(t);return rt.llseek(i,a,n),U=[i.position>>>0,(H=i.position,+Math.abs(H)>=1?H>0?(0|Math.min(+Math.floor(H/4294967296),4294967295))>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],b[o>>2]=U[0],b[o+4>>2]=U[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0}catch(t){if(void 0===rt||!(t instanceof rt.ErrnoError))throw t;return t.errno}var s,u},i:function(t,r,e,n){try{var o=function(t,r,e,n){for(var o=0,a=0;a<e;a++){var i=k[r>>2],s=k[r+4>>2];r+=8;var u=rt.write(t,w,i,s,n);if(u<0)return-1;o+=u}return o}(et.getStreamFromFD(t),r,e);return k[n>>2]=o,0}catch(t){if(void 0===rt||!(t instanceof rt.ErrnoError))throw t;return t.errno}},o:function(t,r,e,n,o){return lt(t,r,e,n)}};!function(){var t={a:_t};function r(t,r){var e,n=t.exports;o.asm=n,P((m=o.asm.A).buffer),o.asm.J,e=o.asm.B,R.unshift(e),B()}function e(t){r(t.instance)}function a(r){return(f||"function"!=typeof fetch?Promise.resolve().then((function(){return W(I)})):fetch(I,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+I+"'";return t.arrayBuffer()})).catch((function(){return W(I)}))).then((function(r){return WebAssembly.instantiate(r,t)})).then((function(t){return t})).then(r,(function(t){d("failed to asynchronously prepare wasm: "+t),N(t)}))}if(T(),o.instantiateWasm)try{return o.instantiateWasm(t,r)}catch(t){d("Module.instantiateWasm callback failed with error: "+t),n(t)}(f||"function"!=typeof WebAssembly.instantiateStreaming||G(I)||"function"!=typeof fetch?a(e):fetch(I,{credentials:"same-origin"}).then((function(r){return WebAssembly.instantiateStreaming(r,t).then(e,(function(t){return d("wasm streaming compile failed: "+t),d("falling back to ArrayBuffer instantiation"),a(e)}))}))).catch(n)}(),o.___wasm_call_ctors=function(){return(o.___wasm_call_ctors=o.asm.B).apply(null,arguments)};var yt=o._emscripten_bind_VoidPtr___destroy___0=function(){return(yt=o._emscripten_bind_VoidPtr___destroy___0=o.asm.C).apply(null,arguments)},vt=o._emscripten_bind_Graphviz_Graphviz_2=function(){return(vt=o._emscripten_bind_Graphviz_Graphviz_2=o.asm.D).apply(null,arguments)},wt=o._emscripten_bind_Graphviz_version_0=function(){return(wt=o._emscripten_bind_Graphviz_version_0=o.asm.E).apply(null,arguments)},gt=o._emscripten_bind_Graphviz_lastError_0=function(){return(gt=o._emscripten_bind_Graphviz_lastError_0=o.asm.F).apply(null,arguments)},Et=o._emscripten_bind_Graphviz_layout_3=function(){return(Et=o._emscripten_bind_Graphviz_layout_3=o.asm.G).apply(null,arguments)},bt=o._emscripten_bind_Graphviz_createFile_2=function(){return(bt=o._emscripten_bind_Graphviz_createFile_2=o.asm.H).apply(null,arguments)},kt=o._emscripten_bind_Graphviz___destroy___0=function(){return(kt=o._emscripten_bind_Graphviz___destroy___0=o.asm.I).apply(null,arguments)};o._free=function(){return(o._free=o.asm.K).apply(null,arguments)};var St,Dt=o._malloc=function(){return(Dt=o._malloc=o.asm.L).apply(null,arguments)},At=o.___errno_location=function(){return(At=o.___errno_location=o.asm.M).apply(null,arguments)},Ft=o._emscripten_builtin_memalign=function(){return(Ft=o._emscripten_builtin_memalign=o.asm.N).apply(null,arguments)},xt=o.___cxa_is_pointer_type=function(){return(xt=o.___cxa_is_pointer_type=o.asm.O).apply(null,arguments)};function Mt(t){function r(){St||(St=!0,o.calledRun=!0,_||(o.noFSInit||rt.init.initialized||rt.init(),rt.ignorePermissions=!1,q(R),e(o),o.onRuntimeInitialized&&o.onRuntimeInitialized(),function(){if(o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)t=o.postRun.shift(),z.unshift(t);var t;q(z)}()))}j>0||(!function(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)t=o.preRun.shift(),C.unshift(t);var t;q(C)}(),j>0||(o.setStatus?(o.setStatus("Running..."),setTimeout((function(){setTimeout((function(){o.setStatus("")}),1),r()}),1)):r()))}if(o.___start_em_js=175796,o.___stop_em_js=175894,O=function t(){St||Mt(),St||(O=t)},o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();function Pt(){}function Ct(t){return(t||Pt).__cache__}function Rt(t,r){var e=Ct(r),n=e[t];return n||((n=Object.create((r||Pt).prototype)).ptr=t,e[t]=n)}Mt(),Pt.prototype=Object.create(Pt.prototype),Pt.prototype.constructor=Pt,Pt.prototype.__class__=Pt,Pt.__cache__={},o.WrapperObject=Pt,o.getCache=Ct,o.wrapPointer=Rt,o.castObject=function(t,r){return Rt(t.ptr,r)},o.NULL=Rt(0),o.destroy=function(t){if(!t.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";t.__destroy__(),delete Ct(t.__class__)[t.ptr]},o.compare=function(t,r){return t.ptr===r.ptr},o.getPointer=function(t){return t.ptr},o.getClass=function(t){return t.__class__};var zt={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(zt.needed){for(var t=0;t<zt.temps.length;t++)o._free(zt.temps[t]);zt.temps.length=0,o._free(zt.buffer),zt.buffer=0,zt.size+=zt.needed,zt.needed=0}zt.buffer||(zt.size+=128,zt.buffer=o._malloc(zt.size),y(zt.buffer)),zt.pos=0},alloc:function(t,r){y(zt.buffer);var e,n=r.BYTES_PER_ELEMENT,a=t.length*n;return a=a+7&-8,zt.pos+a>=zt.size?(y(a>0),zt.needed+=a,e=o._malloc(a),zt.temps.push(e)):(e=zt.buffer+zt.pos,zt.pos+=a),e},copy:function(t,r,e){switch(e>>>=0,r.BYTES_PER_ELEMENT){case 2:e>>>=1;break;case 4:e>>>=2;break;case 8:e>>>=3}for(var n=0;n<t.length;n++)r[e+n]=t[n]}};function jt(t){if("string"==typeof t){var r=K(t),e=zt.alloc(r,w);return zt.copy(r,w,e),e}return t}function Ot(){throw"cannot construct a VoidPtr, no constructor in IDL"}function Tt(t,r){t&&"object"==typeof t&&(t=t.ptr),r&&"object"==typeof r&&(r=r.ptr),this.ptr=vt(t,r),Ct(Tt)[this.ptr]=this}return Ot.prototype=Object.create(Pt.prototype),Ot.prototype.constructor=Ot,Ot.prototype.__class__=Ot,Ot.__cache__={},o.VoidPtr=Ot,Ot.prototype.__destroy__=Ot.prototype.__destroy__=function(){var t=this.ptr;yt(t)},Tt.prototype=Object.create(Pt.prototype),Tt.prototype.constructor=Tt,Tt.prototype.__class__=Tt,Tt.__cache__={},o.Graphviz=Tt,Tt.prototype.version=Tt.prototype.version=function(){var t=this.ptr;return F(wt(t))},Tt.prototype.lastError=Tt.prototype.lastError=function(){var t=this.ptr;return F(gt(t))},Tt.prototype.layout=Tt.prototype.layout=function(t,r,e){var n=this.ptr;return zt.prepare(),t=t&&"object"==typeof t?t.ptr:jt(t),r=r&&"object"==typeof r?r.ptr:jt(r),e=e&&"object"==typeof e?e.ptr:jt(e),F(Et(n,t,r,e))},Tt.prototype.createFile=Tt.prototype.createFile=function(t,r){var e=this.ptr;zt.prepare(),t=t&&"object"==typeof t?t.ptr:jt(t),r=r&&"object"==typeof r?r.ptr:jt(r),bt(e,t,r)},Tt.prototype.__destroy__=Tt.prototype.__destroy__=function(){var t=this.ptr;kt(t)},r.ready}})(),d=Object.freeze({__proto__:null,default:l});function m(t){return{path:t.path,data:`<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n<svg width="${t.width}" height="${t.height}"></svg>`}}function h(t,r){const e={images:[],files:[],...r};var n;[...e.files,...(n=e.images,n.map(m))].forEach((r=>t.createFile(r.path,r.data)))}const _={layout:(t,r="svg",e="dot",n)=>t?a(d,"graphvizlib",n?.wasmFolder,n?.wasmBinary).then((o=>{const a=new o.Graphviz(n?.yInvert?1:0,n?.nop?n?.nop:0);let i;h(a,n);try{i=a.layout(t,r,e)}catch(t){}if(o.destroy(a),!i)throw new Error(o.Graphviz.prototype.lastError());return i})):Promise.resolve(""),circo(t,r="svg",e){return this.layout(t,r,"circo",e)},dot(t,r="svg",e){return this.layout(t,r,"dot",e)},fdp(t,r="svg",e){return this.layout(t,r,"fdp",e)},sfdp(t,r="svg",e){return this.layout(t,r,"sfdp",e)},neato(t,r="svg",e){return this.layout(t,r,"neato",e)},osage(t,r="svg",e){return this.layout(t,r,"osage",e)},patchwork(t,r="svg",e){return this.layout(t,r,"patchwork",e)},twopi(t,r="svg",e){return this.layout(t,r,"twopi",e)}};class y{constructor(t){this._wasm=t}layout(t,r="svg",e="dot",n){if(!t)return"";const o=new this._wasm.Graphviz(n?.yInvert?1:0,n?.nop?n?.nop:0);h(o,n);const a=o.layout(t,r,e);if(this._wasm.destroy(o),!a)throw new Error(this._wasm.Graphviz.prototype.lastError());return a}circo(t,r="svg",e){return this.layout(t,r,"circo",e)}dot(t,r="svg",e){return this.layout(t,r,"dot",e)}fdp(t,r="svg",e){return this.layout(t,r,"fdp",e)}sfdp(t,r="svg",e){return this.layout(t,r,"sfdp",e)}neato(t,r="svg",e){return this.layout(t,r,"neato",e)}osage(t,r="svg",e){return this.layout(t,r,"osage",e)}patchwork(t,r="svg",e){return this.layout(t,r,"patchwork",e)}twopi(t,r="svg",e){return this.layout(t,r,"twopi",e)}}r.doFetch=async function(t){return fetch(t,{credentials:"same-origin"}).then((r=>{if(!r.ok)throw"failed to load wasm binary file at '"+t+"'";return r.arrayBuffer()})).catch((t=>{throw t}))},r.scriptDir=s,t.GraphvizSync=y,t.StackElement=p,t.StackParser=class{constructor(){this._stack=[]}parse(t,r,e){return f(t,this,r,e)}top(){return this._stack[this._stack.length-1]}startElement(t,r){const e=new p(t,r);return this._stack.push(e),e}endElement(t){return this._stack.pop()}characterData(t){this.top().appendContent(t)}},t.expatVersion=function(t,r){return a(c,"expatlib",t,r).then((t=>t.CExpat.prototype.version()))},t.graphviz=_,t.graphvizSync=function(t,r){return a(d,"graphvizlib",t,r).then((t=>new y(t)))},t.graphvizVersion=function(t,r){return a(d,"graphvizlib",t,r).then((t=>t.Graphviz.prototype.version()))},t.parse=f,t.wasmFolder=n,Object.defineProperty(t,"__esModule",{value:!0})}));
|