-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwasm_modules.js
43 lines (38 loc) · 9.05 KB
/
wasm_modules.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
var GetNative = (function() {
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;
return (
function(GetNative) {
GetNative = GetNative || {};
var a;a||(a=typeof GetNative !== 'undefined' ? GetNative : {});var k,l;a.ready=new Promise(function(b,c){k=b;l=c});var m={},n;for(n in a)a.hasOwnProperty(n)&&(m[n]=a[n]);var p="object"===typeof window,q="function"===typeof importScripts,r="",t,u,v,w,x;
if("object"===typeof process&&"object"===typeof process.versions&&"string"===typeof process.versions.node)r=q?require("path").dirname(r)+"/":__dirname+"/",t=function(b,c){w||(w=require("fs"));x||(x=require("path"));b=x.normalize(b);return w.readFileSync(b,c?null:"utf8")},v=function(b){b=t(b,!0);b.buffer||(b=new Uint8Array(b));b.buffer||y("Assertion failed: undefined");return b},u=function(b,c,e){w||(w=require("fs"));x||(x=require("path"));b=x.normalize(b);w.readFile(b,function(d,f){d?e(d):c(f.buffer)})},
1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),process.on("uncaughtException",function(b){throw b;}),process.on("unhandledRejection",y),a.inspect=function(){return"[Emscripten Module object]"};else if(p||q)q?r=self.location.href:"undefined"!==typeof document&&document.currentScript&&(r=document.currentScript.src),_scriptDir&&(r=_scriptDir),0!==r.indexOf("blob:")?r=r.substr(0,r.lastIndexOf("/")+1):r="",t=function(b){var c=new XMLHttpRequest;c.open("GET",b,!1);c.send(null);
return c.responseText},q&&(v=function(b){var c=new XMLHttpRequest;c.open("GET",b,!1);c.responseType="arraybuffer";c.send(null);return new Uint8Array(c.response)}),u=function(b,c,e){var d=new XMLHttpRequest;d.open("GET",b,!0);d.responseType="arraybuffer";d.onload=function(){200==d.status||0==d.status&&d.response?c(d.response):e()};d.onerror=e;d.send(null)};var aa=a.print||console.log.bind(console),z=a.printErr||console.warn.bind(console);for(n in m)m.hasOwnProperty(n)&&(a[n]=m[n]);m=null;var A;
a.wasmBinary&&(A=a.wasmBinary);var noExitRuntime=a.noExitRuntime||!0;"object"!==typeof WebAssembly&&y("no native wasm support detected");var B,D=!1,E="undefined"!==typeof TextDecoder?new TextDecoder("utf8"):void 0;
function F(b,c,e){var d=c+e;for(e=c;b[e]&&!(e>=d);)++e;if(16<e-c&&b.subarray&&E)return E.decode(b.subarray(c,e));for(d="";c<e;){var f=b[c++];if(f&128){var g=b[c++]&63;if(192==(f&224))d+=String.fromCharCode((f&31)<<6|g);else{var h=b[c++]&63;f=224==(f&240)?(f&15)<<12|g<<6|h:(f&7)<<18|g<<12|h<<6|b[c++]&63;65536>f?d+=String.fromCharCode(f):(f-=65536,d+=String.fromCharCode(55296|f>>10,56320|f&1023))}}else d+=String.fromCharCode(f)}return d}function G(b){return b?F(H,b,void 0):""}var I,H,J;
function K(){var b=B.buffer;I=b;a.HEAP8=new Int8Array(b);a.HEAP16=new Int16Array(b);a.HEAP32=J=new Int32Array(b);a.HEAPU8=H=new Uint8Array(b);a.HEAPU16=new Uint16Array(b);a.HEAPU32=new Uint32Array(b);a.HEAPF32=new Float32Array(b);a.HEAPF64=new Float64Array(b)}var O,P=[],Q=[],R=[];function ba(){var b=a.preRun.shift();P.unshift(b)}var S=0,T=null,U=null;a.preloadedImages={};a.preloadedAudios={};
function y(b){if(a.onAbort)a.onAbort(b);z(b);D=!0;b=new WebAssembly.RuntimeError("abort("+b+"). Build with -s ASSERTIONS=1 for more info.");l(b);throw b;}function V(){return W.startsWith("data:application/octet-stream;base64,")}var W;W="wasm_modules.wasm";if(!V()){var ca=W;W=a.locateFile?a.locateFile(ca,r):r+ca}function da(){var b=W;try{if(b==W&&A)return new Uint8Array(A);if(v)return v(b);throw"both async and sync fetching of the wasm failed";}catch(c){y(c)}}
function ea(){if(!A&&(p||q)){if("function"===typeof fetch&&!W.startsWith("file://"))return fetch(W,{credentials:"same-origin"}).then(function(b){if(!b.ok)throw"failed to load wasm binary file at '"+W+"'";return b.arrayBuffer()}).catch(function(){return da()});if(u)return new Promise(function(b,c){u(W,function(e){b(new Uint8Array(e))},c)})}return Promise.resolve().then(function(){return da()})}
function X(b){for(;0<b.length;){var c=b.shift();if("function"==typeof c)c(a);else{var e=c.G;"number"===typeof e?void 0===c.F?O.get(e)():O.get(e)(c.F):e(void 0===c.F?null:c.F)}}}
var fa=[null,[],[]],ha={a:function(b,c,e,d){y("Assertion failed: "+G(b)+", at: "+[c?G(c):"unknown filename",e,d?G(d):"unknown function"])},b:function(){y()},e:function(b,c,e){H.copyWithin(b,c,c+e)},f:function(b){var c=H.length;b>>>=0;if(2147483648<b)return!1;for(var e=1;4>=e;e*=2){var d=c*(1+.2/e);d=Math.min(d,b+100663296);d=Math.max(b,d);0<d%65536&&(d+=65536-d%65536);a:{try{B.grow(Math.min(2147483648,d)-I.byteLength+65535>>>16);K();var f=1;break a}catch(g){}f=void 0}if(f)return!0}return!1},g:function(){return 0},
d:function(){},c:function(b,c,e,d){for(var f=0,g=0;g<e;g++){for(var h=J[c+8*g>>2],C=J[c+(8*g+4)>>2],L=0;L<C;L++){var M=H[h+L],N=fa[b];0===M||10===M?((1===b?aa:z)(F(N,0)),N.length=0):N.push(M)}f+=C}J[d>>2]=f;return 0},h:function(b){var c=Date.now();J[b>>2]=c/1E3|0;J[b+4>>2]=c%1E3*1E3|0;return 0}};
(function(){function b(f){a.asm=f.exports;B=a.asm.i;K();O=a.asm.l;Q.unshift(a.asm.j);S--;a.monitorRunDependencies&&a.monitorRunDependencies(S);0==S&&(null!==T&&(clearInterval(T),T=null),U&&(f=U,U=null,f()))}function c(f){b(f.instance)}function e(f){return ea().then(function(g){return WebAssembly.instantiate(g,d)}).then(function(g){return g}).then(f,function(g){z("failed to asynchronously prepare wasm: "+g);y(g)})}var d={a:ha};S++;a.monitorRunDependencies&&a.monitorRunDependencies(S);if(a.instantiateWasm)try{return a.instantiateWasm(d,
b)}catch(f){return z("Module.instantiateWasm callback failed with error: "+f),!1}(function(){return A||"function"!==typeof WebAssembly.instantiateStreaming||V()||W.startsWith("file://")||"function"!==typeof fetch?e(c):fetch(W,{credentials:"same-origin"}).then(function(f){return WebAssembly.instantiateStreaming(f,d).then(c,function(g){z("wasm streaming compile failed: "+g);z("falling back to ArrayBuffer instantiation");return e(c)})})})().catch(l);return{}})();
a.___wasm_call_ctors=function(){return(a.___wasm_call_ctors=a.asm.j).apply(null,arguments)};a._malloc=function(){return(a._malloc=a.asm.k).apply(null,arguments)};a._setOptions=function(){return(a._setOptions=a.asm.m).apply(null,arguments)};a._compute=function(){return(a._compute=a.asm.n).apply(null,arguments)};a._getSum=function(){return(a._getSum=a.asm.o).apply(null,arguments)};a._getSumSq=function(){return(a._getSumSq=a.asm.p).apply(null,arguments)};
a._generate=function(){return(a._generate=a.asm.q).apply(null,arguments)};a._sort=function(){return(a._sort=a.asm.r).apply(null,arguments)};a._setSortMode=function(){return(a._setSortMode=a.asm.s).apply(null,arguments)};a._setSortOption=function(){return(a._setSortOption=a.asm.t).apply(null,arguments)};a._setTimeMatrix=function(){return(a._setTimeMatrix=a.asm.u).apply(null,arguments)};a._size=function(){return(a._size=a.asm.v).apply(null,arguments)};
a._getSchedule=function(){return(a._getSchedule=a.asm.w).apply(null,arguments)};a._getRange=function(){return(a._getRange=a.asm.x).apply(null,arguments)};a._setRefSchedule=function(){return(a._setRefSchedule=a.asm.y).apply(null,arguments)};a._getSearcher=function(){return(a._getSearcher=a.asm.z).apply(null,arguments)};a._findBestMatch=function(){return(a._findBestMatch=a.asm.A).apply(null,arguments)};a._sWSearch=function(){return(a._sWSearch=a.asm.B).apply(null,arguments)};
a._getMatches=function(){return(a._getMatches=a.asm.C).apply(null,arguments)};a._getMatchSize=function(){return(a._getMatchSize=a.asm.D).apply(null,arguments)};a._getScore=function(){return(a._getScore=a.asm.E).apply(null,arguments)};
a.stringToUTF8=function(b,c,e){var d=H;if(0<e){var f=c;e=c+e-1;for(var g=0;g<b.length;++g){var h=b.charCodeAt(g);if(55296<=h&&57343>=h){var C=b.charCodeAt(++g);h=65536+((h&1023)<<10)|C&1023}if(127>=h){if(c>=e)break;d[c++]=h}else{if(2047>=h){if(c+1>=e)break;d[c++]=192|h>>6}else{if(65535>=h){if(c+2>=e)break;d[c++]=224|h>>12}else{if(c+3>=e)break;d[c++]=240|h>>18;d[c++]=128|h>>12&63}d[c++]=128|h>>6&63}d[c++]=128|h&63}}d[c]=0;b=c-f}else b=0;return b};
a.lengthBytesUTF8=function(b){for(var c=0,e=0;e<b.length;++e){var d=b.charCodeAt(e);55296<=d&&57343>=d&&(d=65536+((d&1023)<<10)|b.charCodeAt(++e)&1023);127>=d?++c:c=2047>=d?c+2:65535>=d?c+3:c+4}return c};var Y;U=function ia(){Y||Z();Y||(U=ia)};
function Z(){function b(){if(!Y&&(Y=!0,a.calledRun=!0,!D)){X(Q);k(a);if(a.onRuntimeInitialized)a.onRuntimeInitialized();if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;){var c=a.postRun.shift();R.unshift(c)}X(R)}}if(!(0<S)){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)ba();X(P);0<S||(a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},1);b()},1)):b())}}a.run=Z;
if(a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.pop()();Z();
return GetNative.ready
}
);
})();
if (typeof exports === 'object' && typeof module === 'object')
module.exports = GetNative;
else if (typeof define === 'function' && define['amd'])
define([], function() { return GetNative; });
else if (typeof exports === 'object')
exports["GetNative"] = GetNative;