42 lines
504 KiB
JavaScript
42 lines
504 KiB
JavaScript
|
|
||
|
var Module = (function() {
|
||
|
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
|
||
|
|
||
|
return (
|
||
|
function(Module) {
|
||
|
Module = Module || {};
|
||
|
|
||
|
|
||
|
var d;d||(d=typeof Module !== 'undefined' ? Module : {});var h,n;d.ready=new Promise(function(a,c){h=a;n=c});var q={},r;for(r in d)d.hasOwnProperty(r)&&(q[r]=d[r]);var t="";"undefined"!==typeof document&&document.currentScript&&(t=document.currentScript.src);_scriptDir&&(t=_scriptDir);0!==t.indexOf("blob:")?t=t.substr(0,t.lastIndexOf("/")+1):t="";var aa=d.print||console.log.bind(console),u=d.printErr||console.warn.bind(console);for(r in q)q.hasOwnProperty(r)&&(d[r]=q[r]);q=null;var v;
|
||
|
d.wasmBinary&&(v=d.wasmBinary);var noExitRuntime;d.noExitRuntime&&(noExitRuntime=d.noExitRuntime);"object"!==typeof WebAssembly&&w("no native wasm support detected");var x,y=!1;function A(a){var c=d["_"+a];c||w("Assertion failed: Cannot call unknown function "+(a+", make sure it is exported"));return c}
|
||
|
function B(a,c,b,e){var f={string:function(l){var p=0;if(null!==l&&void 0!==l&&0!==l){var Z=(l.length<<2)+1;p=C(Z);D(l,E,p,Z)}return p},array:function(l){var p=C(l.length);F.set(l,p);return p}},g=A(a),k=[];a=0;if(e)for(var m=0;m<e.length;m++){var z=f[b[m]];z?(0===a&&(a=ba()),k[m]=z(e[m])):k[m]=e[m]}b=g.apply(null,k);b=function(l){return"string"===c?G(l):"boolean"===c?!!l:l}(b);0!==a&&ca(a);return b}var da="undefined"!==typeof TextDecoder?new TextDecoder("utf8"):void 0;
|
||
|
function ea(a,c,b){var e=c+b;for(b=c;a[b]&&!(b>=e);)++b;if(16<b-c&&a.subarray&&da)return da.decode(a.subarray(c,b));for(e="";c<b;){var f=a[c++];if(f&128){var g=a[c++]&63;if(192==(f&224))e+=String.fromCharCode((f&31)<<6|g);else{var k=a[c++]&63;f=224==(f&240)?(f&15)<<12|g<<6|k:(f&7)<<18|g<<12|k<<6|a[c++]&63;65536>f?e+=String.fromCharCode(f):(f-=65536,e+=String.fromCharCode(55296|f>>10,56320|f&1023))}}else e+=String.fromCharCode(f)}return e}function G(a){return a?ea(E,a,void 0):""}
|
||
|
function D(a,c,b,e){if(0<e){e=b+e-1;for(var f=0;f<a.length;++f){var g=a.charCodeAt(f);if(55296<=g&&57343>=g){var k=a.charCodeAt(++f);g=65536+((g&1023)<<10)|k&1023}if(127>=g){if(b>=e)break;c[b++]=g}else{if(2047>=g){if(b+1>=e)break;c[b++]=192|g>>6}else{if(65535>=g){if(b+2>=e)break;c[b++]=224|g>>12}else{if(b+3>=e)break;c[b++]=240|g>>18;c[b++]=128|g>>12&63}c[b++]=128|g>>6&63}c[b++]=128|g&63}}c[b]=0}}
|
||
|
function fa(a){for(var c=0,b=0;b<a.length;++b){var e=a.charCodeAt(b);55296<=e&&57343>=e&&(e=65536+((e&1023)<<10)|a.charCodeAt(++b)&1023);127>=e?++c:c=2047>=e?c+2:65535>=e?c+3:c+4}return c}function ha(a){var c=fa(a)+1,b=H(c);b&&D(a,F,b,c);return b}var I,F,E,J,K=d.INITIAL_MEMORY||16777216;d.wasmMemory?x=d.wasmMemory:x=new WebAssembly.Memory({initial:K/65536,maximum:K/65536});x&&(I=x.buffer);K=I.byteLength;var L=I;I=L;d.HEAP8=F=new Int8Array(L);d.HEAP16=new Int16Array(L);d.HEAP32=J=new Int32Array(L);
|
||
|
d.HEAPU8=E=new Uint8Array(L);d.HEAPU16=new Uint16Array(L);d.HEAPU32=new Uint32Array(L);d.HEAPF32=new Float32Array(L);d.HEAPF64=new Float64Array(L);var M,ia=[],ja=[],ka=[],la=[];function ma(){var a=d.preRun.shift();ia.unshift(a)}var N=0,O=null,P=null;d.preloadedImages={};d.preloadedAudios={};function w(a){if(d.onAbort)d.onAbort(a);u(a);y=!0;a=new WebAssembly.RuntimeError("abort("+a+"). Build with -s ASSERTIONS=1 for more info.");n(a);throw a;}
|
||
|
function Q(a){return String.prototype.startsWith?a.startsWith("data:application/octet-stream;base64,"):0===a.indexOf("data:application/octet-stream;base64,")}var R="data:application/octet-stream;base64,AGFzbQEAAAABqwd6YAR/fn9/AX5gA39/fwF/YAJ/fwF/YAJ/fwBgAX8Bf2ADf39/AGAFf35/f38BfmABfwBgAn9+AX5gBH9/f38Bf2ACf34Bf2ABfAF8YAJ/fwF+YAJ/fgBgA39/fgF/YAF+AX9gA39+fwF+YAN/fn8AYAN/fn8Bf2ADf39/AX5gBX9/f39/AX9gBn9+f39/fwF+YAN/fn4BfmAGf35+f39/AX5gBH9/fn8Bf2AGf39/f39/AX9gAX8BfmACfHwBfGAEf39/fwBgA39+fgF/YAR/f39/AX5gBX9/f39/AGAFf35+fn4AYAd/f39/f39/AX9gBH9+fn8BfmAFf35+f38BfmABfgF+YAAAYAABf2AFf35/fn8Bf2AHf35/fn5+fwF/YAN/f34AYAN/fn4AYAR/fn5/AGAEf35+fwF/YAR/fn5+AX9gBX9+fn5/AX9gBH9+f38AYAV/fn5/fwBgAn5/AGAJf39/f39/f39/AX9gBH9+f38Bf2AGf35/fn5/AX9gAn5/AX9gA35/fwF/YAZ/f39/f38BfmAHf35/f39/fwF+YAR/fn9+AX5gBH9+fn4BfmAGf39/f39/AGAHf39/f39/fwBgBH9/fn8AYAh/f39/f39/fwF/YAR/f39+AX9gBH9+f34Bf2ACf3wBf2AGf3x/f39/AX9gBX9/f39/AX5gAn5+AX5gAnx/AXxgA3x8fwF8YAN/f3wAYAV/fn9/fwBgBH9+f34AYAZ/fn9+fn8AYAJ/fQBgAn98AGADf3x/AGAFf3x/f38AYAF+AGAHfH9/f39/fwBgCn9/f39/f39/f38Bf2AGf39/fn5/AX9gB39/f35+fn8Bf2AFf39+f38Bf2AEf39+fgF/YAV/f35+fwF/YAZ/f35+f38Bf2AGf39+fn5+AX9gBX9+f39/AX9gBn9+f39/fwF/YAV/fn9/fgF/YAV/f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QAAAAAGAAAIBjoAEAgABhAVAAAIAAAAAAAAAAAAAAAABwALGgAACwsbGwYVAgYCBgAACAAGAAYGAAAAAAAABgYGAAAAAAAAAAAAYgAAAAAAAwQHAXAB/AL8AgYJAX8BQbC0xAILB0ENAXMBAAF0AIwGAXUAzwoBdgDmBwF3AKMHAXgApAIBeQDrAQF6AI4JAUEAjQkBQgCMCQFDAP8IAUQA/ggBRQD9CAn9BQEAQQEL+wKSBOkI5wjmCOMI9gj1CPQItAfIBNsGzQa6BqIG5AK8CrQKhwaUCvAJ5gniCdwJ0gn9BcgJwgm7CbQJ5gWjCZ8JmQmTCYsJ2QX2A6gI7AjrB/8E6AfwAaoHnweiCPUH9AS3B5oHmQeYB5YHkQeNB6kG/gmeCJ0InAibCJoIjAWZCJgIlwiWCJUIlAiTCJIIkQiQCI8IjgiNCIwIiwjjA4oI4wOJCIgIhwiGCOwH3QfcB9sH3weKBYUIhAjDB8IHwQfAB78Hvge8B7sHugepB6gHpwfjA6YHjAWlB6QHogehB/kH+Af3B9oH1wfWB9UH1AfTB9IH0QfMB8sHygfJB8gHxwfGB8QHuQe2B7MHsgexB7AHrweuB60HqwedB5wHmwePApcHlQeUB5MHkAeMB48FiweKB4kHiAfkBIcHhgeCB5EFgQfWBtUG1AbTBtIG0QbQBs8GmAXOBswGvgTLBsoGyQbBBMgGxwbGBr0ExQbEBsMGwgbBBsAGvwa+Br0GvAaWA7sGuQa4BrcGtga1BrMGsgaxBrAGrwauB
|
||
|
function oa(){try{if(v)return new Uint8Array(v);var a=R;if(Q(a))try{var c=pa(a.slice(37)),b=new Uint8Array(c.length);for(a=0;a<c.length;++a)b[a]=c.charCodeAt(a);var e=b}catch(g){throw Error("Converting base64 string to bytes failed.");}else e=void 0;var f=e;if(f)return f;throw"both async and sync fetching of the wasm failed";}catch(g){w(g)}}
|
||
|
function qa(){return v||"function"!==typeof fetch?Promise.resolve().then(oa):fetch(R,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+R+"'";return a.arrayBuffer()}).catch(function(){return oa()})}function S(a){for(;0<a.length;){var c=a.shift();if("function"==typeof c)c(d);else{var b=c.M;"number"===typeof b?void 0===c.G?M.get(b)():M.get(b)(c.G):b(void 0===c.G?null:c.G)}}}function ra(){}function sa(){}function ta(){}
|
||
|
function T(a){var c=fa(a)+1,b=H(c);D(a,E,b,c);return b}var ua=[null,[],[]];function va(){function a(k){return(k=k.toTimeString().match(/\(([A-Za-z ]+)\)$/))?k[1]:"GMT"}if(!wa){wa=!0;var c=(new Date).getFullYear(),b=new Date(c,0,1),e=new Date(c,6,1);c=b.getTimezoneOffset();var f=e.getTimezoneOffset(),g=Math.max(c,f);J[xa()>>2]=60*g;J[ya()>>2]=Number(c!=f);b=a(b);e=a(e);b=ha(b);e=ha(e);f<c?(J[U()>>2]=b,J[U()+4>>2]=e):(J[U()>>2]=e,J[U()+4>>2]=b)}}var wa;function za(){}function Aa(){}
|
||
|
(function(){class a{constructor(){this.F=new Set}K(b,e){const f=G(b),g=window.setTimeout(()=>{const k=T(f);try{V(k)}catch(m){}finally{W(k),this.F.delete(g)}},e);this.F.add(g);return g}I(b){this.F.has(b)&&(window.clearTimeout(b),this.F.delete(b))}J(b,e){const f=G(b);b=window.setInterval(()=>{const g=T(f);try{V(g)}catch(k){}finally{W(g)}},e);this.F.add(b);return b}H(b){this.F.has(b)&&(window.clearInterval(b),this.F.delete(b))}L(){this.F.forEach(b=>window.clearTimeout(b));this.F.clear()}}const c=new a;
|
||
|
Aa=c.K.bind(c);ta=c.I.bind(c);za=c.J.bind(c);sa=c.H.bind(c);ra=c.L.bind(c)})();
|
||
|
var pa="function"===typeof atob?atob:function(a){var c="",b=0;a=a.replace(/[^A-Za-z0-9\+\/=]/g,"");do{var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(b++));var f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(b++));var g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(b++));var k="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(b++));e=e<<2|f>>4;
|
||
|
f=(f&15)<<4|g>>2;var m=(g&3)<<6|k;c+=String.fromCharCode(e);64!==g&&(c+=String.fromCharCode(f));64!==k&&(c+=String.fromCharCode(m))}while(b<a.length);return c};ja.push({M:function(){Ba()}});
|
||
|
var Ca={b:function(a,c,b,e){w("Assertion failed: "+G(a)+", at: "+[c?G(c):"unknown filename",b,e?G(e):"unknown function"])},c:function(){w()},q:ra,o:sa,f:ta,n:function(a){let c;try{const b=new window.URL(G(a));c=window.JSON.stringify({cScheme:b.protocol,cUser:b.username,cPassword:b.password,cHost:b.hostname,cPort:b.port,cPath:b.pathname,cParameters:b.search,cFragments:b.F})}catch(b){c=b.message}return T(c)},m:function(a,c){a=G(a);let b;try{b=window.JSON.parse(a)}catch(e){b=a}0!==c?window.alert(a):
|
||
|
window.console.log("DEBUGME",b)},k:function(a,c,b){E.copyWithin(a,c,c+b)},l:function(){w("OOM")},e:function(a,c,b,e){for(var f=0,g=0;g<b;g++){for(var k=J[c+8*g>>2],m=J[c+(8*g+4)>>2],z=0;z<m;z++){var l=E[k+z],p=ua[a];0===l||10===l?((1===a?aa:u)(ea(p,0)),p.length=0):p.push(l)}f+=m}J[e>>2]=f;return 0},d:function(a){var c=Date.now();J[a>>2]=c/1E3|0;J[a+4>>2]=c%1E3*1E3|0;return 0},i:function(a,c){va();a=new Date(1E3*J[a>>2]);J[c>>2]=a.getSeconds();J[c+4>>2]=a.getMinutes();J[c+8>>2]=a.getHours();J[c+12>>
|
||
|
2]=a.getDate();J[c+16>>2]=a.getMonth();J[c+20>>2]=a.getFullYear()-1900;J[c+24>>2]=a.getDay();var b=new Date(a.getFullYear(),0,1);J[c+28>>2]=(a.getTime()-b.getTime())/864E5|0;J[c+36>>2]=-(60*a.getTimezoneOffset());var e=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();b=b.getTimezoneOffset();a=(e!=b&&a.getTimezoneOffset()==Math.min(b,e))|0;J[c+32>>2]=a;a=J[U()+(a?4:0)>>2];J[c+40>>2]=a;return c},j:function(a){a=G(a);window.console.log(a)},a:x,r:function(a,c,b,e){a=G(a);c=G(c);b=G(b);b=`Quickjs -- ${a}: ${c}\n${b}`;
|
||
|
0!==e?window.alert(b):window.console.error(b)},h:function(a){a=G(a);try{const b=window.JSON.parse(a);if(void 0!==b&&null!==b){var c=new window.CustomEvent("updateFromSandbox",{detail:b});window.dispatchEvent(c)}}catch(b){}},p:za,g:Aa};
|
||
|
(function(){function a(f){d.asm=f.exports;M=d.asm.s;N--;d.monitorRunDependencies&&d.monitorRunDependencies(N);0==N&&(null!==O&&(clearInterval(O),O=null),P&&(f=P,P=null,f()))}function c(f){a(f.instance)}function b(f){return qa().then(function(g){return WebAssembly.instantiate(g,e)}).then(f,function(g){u("failed to asynchronously prepare wasm: "+g);w(g)})}var e={a:Ca};N++;d.monitorRunDependencies&&d.monitorRunDependencies(N);if(d.instantiateWasm)try{return d.instantiateWasm(e,a)}catch(f){return u("Module.instantiateWasm callback failed with error: "+
|
||
|
f),!1}(function(){return v||"function"!==typeof WebAssembly.instantiateStreaming||Q(R)||"function"!==typeof fetch?b(c):fetch(R,{credentials:"same-origin"}).then(function(f){return WebAssembly.instantiateStreaming(f,e).then(c,function(g){u("wasm streaming compile failed: "+g);u("falling back to ArrayBuffer instantiation");return b(c)})})})().catch(n);return{}})();
|
||
|
var Ba=d.___wasm_call_ctors=function(){return(Ba=d.___wasm_call_ctors=d.asm.t).apply(null,arguments)},V=d._evalInSandbox=function(){return(V=d._evalInSandbox=d.asm.u).apply(null,arguments)};d._nukeSandbox=function(){return(d._nukeSandbox=d.asm.v).apply(null,arguments)};d._dumpMemoryUse=function(){return(d._dumpMemoryUse=d.asm.w).apply(null,arguments)};
|
||
|
var H=d._malloc=function(){return(H=d._malloc=d.asm.x).apply(null,arguments)},W=d._free=function(){return(W=d._free=d.asm.y).apply(null,arguments)},U=d.__get_tzname=function(){return(U=d.__get_tzname=d.asm.z).apply(null,arguments)},ya=d.__get_daylight=function(){return(ya=d.__get_daylight=d.asm.A).apply(null,arguments)},xa=d.__get_timezone=function(){return(xa=d.__get_timezone=d.asm.B).apply(null,arguments)},ba=d.stackSave=function(){return(ba=d.stackSave=d.asm.C).apply(null,arguments)},ca=d.stackRestore=
|
||
|
function(){return(ca=d.stackRestore=d.asm.D).apply(null,arguments)},C=d.stackAlloc=function(){return(C=d.stackAlloc=d.asm.E).apply(null,arguments)};d.ccall=B;d.cwrap=function(a,c,b,e){b=b||[];var f=b.every(function(g){return"number"===g});return"string"!==c&&f&&!e?A(a):function(){return B(a,c,b,arguments,e)}};var X;P=function Da(){X||Y();X||(P=Da)};
|
||
|
function Y(){function a(){if(!X&&(X=!0,d.calledRun=!0,!y)){S(ja);S(ka);h(d);if(d.onRuntimeInitialized)d.onRuntimeInitialized();if(d.postRun)for("function"==typeof d.postRun&&(d.postRun=[d.postRun]);d.postRun.length;){var c=d.postRun.shift();la.unshift(c)}S(la)}}if(!(0<N)){if(d.preRun)for("function"==typeof d.preRun&&(d.preRun=[d.preRun]);d.preRun.length;)ma();S(ia);0<N||(d.setStatus?(d.setStatus("Running..."),setTimeout(function(){setTimeout(function(){d.setStatus("")},1);a()},1)):a())}}d.run=Y;
|
||
|
if(d.preInit)for("function"==typeof d.preInit&&(d.preInit=[d.preInit]);0<d.preInit.length;)d.preInit.pop()();noExitRuntime=!0;Y();
|
||
|
|
||
|
|
||
|
return Module.ready
|
||
|
}
|
||
|
);
|
||
|
})();
|
||
|
export default Module;
|