openchemlib-search-wasm 2.1.2 → 2.1.3

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.
Files changed (78) hide show
  1. package/LICENSE +451 -25
  2. package/README.md +12 -5
  3. package/lib/functionKeys/index.d.ts +14 -80
  4. package/lib/functionKeys/index.js +3 -98
  5. package/lib/index.d.ts +118 -258
  6. package/lib/index.js +33 -327
  7. package/package.json +24 -32
  8. package/lib/functionKeys/dictionary.json +0 -72071
  9. package/lib/functionKeys/index.d.ts.map +0 -1
  10. package/lib/functionKeys/index.js.map +0 -1
  11. package/lib/functions.d.ts +0 -38
  12. package/lib/functions.d.ts.map +0 -1
  13. package/lib/functions.js +0 -54
  14. package/lib/functions.js.map +0 -1
  15. package/lib/hex.d.ts +0 -31
  16. package/lib/hex.d.ts.map +0 -1
  17. package/lib/hex.js +0 -41
  18. package/lib/hex.js.map +0 -1
  19. package/lib/index.d.ts.map +0 -1
  20. package/lib/index.js.map +0 -1
  21. package/lib/jpath.d.ts +0 -28
  22. package/lib/jpath.d.ts.map +0 -1
  23. package/lib/jpath.js +0 -73
  24. package/lib/jpath.js.map +0 -1
  25. package/lib/records.d.ts +0 -45
  26. package/lib/records.d.ts.map +0 -1
  27. package/lib/records.js +0 -96
  28. package/lib/records.js.map +0 -1
  29. package/lib/runSearch.d.ts +0 -41
  30. package/lib/runSearch.d.ts.map +0 -1
  31. package/lib/runSearch.js +0 -50
  32. package/lib/runSearch.js.map +0 -1
  33. package/lib/scan.d.ts +0 -159
  34. package/lib/scan.d.ts.map +0 -1
  35. package/lib/scan.js +0 -281
  36. package/lib/scan.js.map +0 -1
  37. package/lib/similaritySearch.d.ts +0 -28
  38. package/lib/similaritySearch.d.ts.map +0 -1
  39. package/lib/similaritySearch.js +0 -86
  40. package/lib/similaritySearch.js.map +0 -1
  41. package/lib/strongHash.d.ts +0 -9
  42. package/lib/strongHash.d.ts.map +0 -1
  43. package/lib/strongHash.js +0 -56
  44. package/lib/strongHash.js.map +0 -1
  45. package/lib/substructureSearch.d.ts +0 -29
  46. package/lib/substructureSearch.d.ts.map +0 -1
  47. package/lib/substructureSearch.js +0 -104
  48. package/lib/substructureSearch.js.map +0 -1
  49. package/lib/types.d.ts +0 -308
  50. package/lib/types.d.ts.map +0 -1
  51. package/lib/types.js +0 -52
  52. package/lib/types.js.map +0 -1
  53. package/lib/wasm/load.d.ts +0 -10
  54. package/lib/wasm/load.d.ts.map +0 -1
  55. package/lib/wasm/load.js +0 -50
  56. package/lib/wasm/load.js.map +0 -1
  57. package/lib/wasm/log.d.ts +0 -36
  58. package/lib/wasm/log.d.ts.map +0 -1
  59. package/lib/wasm/log.js +0 -52
  60. package/lib/wasm/log.js.map +0 -1
  61. package/src/functionKeys/index.ts +0 -181
  62. package/src/functions.ts +0 -56
  63. package/src/hex.ts +0 -43
  64. package/src/index.ts +0 -458
  65. package/src/jpath.ts +0 -77
  66. package/src/records.ts +0 -142
  67. package/src/runSearch.ts +0 -99
  68. package/src/scan.ts +0 -441
  69. package/src/similaritySearch.ts +0 -104
  70. package/src/strongHash.ts +0 -57
  71. package/src/substructureSearch.ts +0 -120
  72. package/src/types.ts +0 -403
  73. package/src/wasm/load.ts +0 -59
  74. package/src/wasm/log.ts +0 -66
  75. package/wasm/data.d.ts +0 -2
  76. package/wasm/data.js +0 -3
  77. package/wasm/runtime.d.ts +0 -31
  78. package/wasm/runtime.js +0 -30
package/wasm/runtime.d.ts DELETED
@@ -1,31 +0,0 @@
1
- // Types for the generated TeaVM WasmGC runtime. This committed declaration is
2
- // copied to dist/runtime.d.ts by build/embed-wasm.mjs, next to the generated
3
- // dist/runtime.js it describes.
4
- export interface TeaVMInstance {
5
- exports: Record<string, unknown>;
6
- }
7
-
8
- export interface LoadOptions {
9
- memory?: {
10
- /**
11
- * The maximum the linear memory may grow to, in bytes, and the maximum the `WebAssembly.Memory`
12
- * is declared with. Defaults to 2 GiB, which every instantiation then declares.
13
- */
14
- maxSize?: number;
15
- /** The smallest the linear memory is created at, in bytes. */
16
- minSize?: number;
17
- /** A memory to instantiate against instead of creating one. */
18
- external?: WebAssembly.Memory;
19
- };
20
- /**
21
- * Called with the import object once the runtime has installed its own entries, so one of them
22
- * can be replaced before instantiation. `teavmConsole` is the entry that matters here: the
23
- * runtime fills it with character sinks that call `console.log` and `console.error`.
24
- */
25
- installImports?: (imports: Record<string, unknown>) => void;
26
- }
27
-
28
- export function load(
29
- src: BufferSource | string,
30
- options?: LoadOptions,
31
- ): Promise<TeaVMInstance>;
package/wasm/runtime.js DELETED
@@ -1,30 +0,0 @@
1
- var n=new Map;var s=/.+:wasm-function\[[0-9]+]:0x([0-9a-f]+).*/;function D(e){let t=n.get(e);if(typeof t==="undefined"){t=new Function("return "+e+";");n.set(e,t)}return t()}function O(e,t){new Function("value",e+" = value;")(t)}function x(e,t,n){const r={exports:null,userExports:t,stackDeobfuscator:null};if(!n){o(e)}a(e);l(e);i(e,r);u(e);f(e,r,n);e.teavmMath=Math;return{supplyExports(e){r.exports=e},supplyStackDeobfuscator(e){r.stackDeobfuscator=e}}}var _=Symbol("javaException");var E=class extends Error{#context;[_];constructor(e,t){super();this.#context=e;this[_]=t;e.exports["teavm.setJsException"](t,this)}get message(){const e=this.#context.exports["teavm.exceptionMessage"];const t=this.#context.exports["teavm.stringToJs"];if(typeof e==="function"&&typeof t==="function"){const n=e(this[_]);if(n!=null){return t(n)}}return"(could not fetch message)"}};function o(e){e["wasm:js-string"]={fromCharCode:e=>String.fromCharCode(e),fromCharCodeArray:()=>{throw new Error("Not supported")},intoCharCodeArray:()=>{throw new Error("Not supported")},concat:(e,t)=>e+t,charCodeAt:(e,t)=>e.charCodeAt(t),length:e=>e.length,substring:(e,t,n)=>e.substring(t,n)}}function a(e){e.teavmDate={currentTimeMillis:()=>(new Date).getTime(),dateToString:e=>new Date(e).toString(),getYear:e=>new Date(e).getFullYear(),setYear(e,t){const n=new Date(e);n.setFullYear(t);return n.getTime()},getMonth:e=>new Date(e).getMonth(),setMonth(e,t){const n=new Date(e);n.setMonth(t);return n.getTime()},getDate:e=>new Date(e).getDate(),setDate(e,t){const n=new Date(e);n.setDate(t);return n.getTime()},create:(e,t,n,r,o,a)=>new Date(e,t,n,r,o,a).getTime(),createFromUTC:(e,t,n,r,o,a)=>Date.UTC(e,t,n,r,o,a)}}function l(e){let t="";let n="";e.teavmConsole={putcharStderr(e){if(e===10){console.error(t);t=""}else{t+=String.fromCharCode(e)}},putcharStdout(e){if(e===10){console.log(n);n=""}else{n+=String.fromCharCode(e)}}}}function k(e,t){return(e-1>>t)+1<<t}async function A(u,e,t,n){const r=e.memory??{};const o=t?M(t):{};let f=r.external;const a=e.stack??2*(1<<20);let s=o.dataSize??0;let l=0;for(const h of n){const d=C(h.wasmModule);const g=d.memorySize??0;const v=d.memoryAlignment??1;const x=d.tableSize??0;const A=d.tableAlignment??1;if(g>0){s=k(s,v);h.memoryOffset=s;s+=g}if(x>0){l=k(l,A);h.tableOffset=l;l+=x}}let p=-1;let m=-1;let y=-1;if(n.length>0){s=k(s,4);p=s;m=s;s+=a;s=k(s,4);y=s}let c=r.maxSize;s=k(s,8);const i=s;if(!f){const j=o.min??0;s+=j;s=Math.max(s,r.minSize??0);const J=r.shared??o.shared??false;c??=(1<<31)-1|0;const S=Math.max(j,n.length===0?1:256);const W=J?S:(c-1>>16)+1;f=new WebAssembly.Memory({shared:J,initial:S,maximum:W})}const b=l>0?new WebAssembly.Table({initial:l,element:"anyfunc"}):null;u.env={memory:f};u.teavmMemory={linearMemory(){return f.buffer},notifyHeapResized:r.onResize??function(){},heapOffset:new WebAssembly.Global({value:"i32",mutable:false},i),maxSize:new WebAssembly.Global({value:"i32",mutable:false},c)};const w={malloc:null,free:null,realloc:null};await Promise.all(n.map(async({name:e,wasmModule:n,jsLoader:t,tableOffset:r,memoryOffset:o})=>{const a=await t({wasmMemory:f,instantiateWasm(e,t){e.env={memory:f,malloc:e=>w.malloc(e),free:e=>w.free(e),realloc:(e,t)=>w.realloc(e,t),__indirect_function_table:b,__memory_base:new WebAssembly.Global({value:"i32",mutable:false},o??0),__table_base:new WebAssembly.Global({value:"i32",mutable:false},r??0),__stack_pointer:new WebAssembly.Global({value:"i32",mutable:true},p)};e["GOT.mem"]={__stack_low:new WebAssembly.Global({value:"i32",mutable:true},m),__stack_high:new WebAssembly.Global({value:"i32",mutable:true},y)};WebAssembly.instantiate(n,e).then(t)}});const s={};for(const{name:l,kind:c}of WebAssembly.Module.exports(n)){if(c==="function"){const i=a["_"+l];if(typeof i==="function"){s[l]=i}}}u[e]=s}));return w}var c=class{ptr=0;array;constructor(e){this.array=e}readVarInt(){let e=0;let t=0;while(true){const n=this.array[this.ptr++];e|=(n&127)<<t;if((n&128)===0){return e}t+=7}}};function C(e){const t=WebAssembly.Module.customSections(e,"dylink.0");if(t.length!==1){return{}}const n=new c(new Int8Array(t[0]));const r={};while(n.ptr<n.array.length){const o=n.array[n.ptr++];const a=n.ptr+n.readVarInt();switch(o){case 1:r.memorySize=n.readVarInt();r.memoryAlignment=n.readVarInt();r.tableSize=n.readVarInt();r.tableAlignment=n.readVarInt();break}n.ptr=a}return r}function i(e,a){const r=new FinalizationRegistry(e=>{const t=a.exports["teavm.reportGarbageCollectedValue"];if(typeof t!=="undefined"){t(e.queue,e.ref)}});const n=new FinalizationRegistry(e=>{const t=a.exports?.["teavm.reportGarbageCollectedString"];if(typeof t==="function"){t(e)}});e.teavm={createWeakRef(e,t,n){if(n!==null){r.register(e,{ref:t,queue:n})}return new WeakRef(e)},deref:e=>{const t=e.deref();return t!==void 0?t:null},createStringWeakRef(e,t){n.register(e,t);return new WeakRef(e)},stringDeref:e=>e.deref(),takeStackTrace(r){const e=(new Error).stack??"";const t=[];for(const n of e.split("\n")){const o=s.exec(n);if(o!==null&&o.length>=2){t.push(parseInt(o[1],16))}}return{getStack(){let n;if(a.stackDeobfuscator){try{n=a.stackDeobfuscator(t)}catch(e){console.warn("Could not deobfuscate stack",e)}}if(!n){n=t.map(e=>({className:"java.lang.Throwable$FakeClass",method:"fakeMethod",file:"Throwable.java",line:e}))}else if(r!==null){if(n.length>0&&n[0].className==="java.lang.Throwable"&&n[0].method==="fillInStackTrace"){n.shift()}let t=-1;for(let e=0;e<n.length;++e){if(n[e].method!=="<init>"){break}if(n[e].className===r){t=e+1;break}}if(t>=0){n.splice(0,t)}}return n}}},decorateException(e){new E(a,e)}}}function u(e){e.teavmAsync={offer(e,t,n){const r=Math.max(0,n-Date.now());return setTimeout(()=>{t(e)},r)},kill(e){clearTimeout(e)}}}function M(e){const t=WebAssembly.Module.customSections(e,"teavm.memoryRequirements");if(t.length!==1){return{}}return JSON.parse((new TextDecoder).decode(t[0]))}function f(t,s,e){const l=Symbol("javaObject");const c=Symbol("functions");const o=Symbol("functionOrigin");const i=Symbol("wrapperCallMarker");const a=new WeakMap;const r=new WeakMap;const u=new Map;const f=new FinalizationRegistry(e=>u.delete(e));const n=new WeakMap;let p=2463534242;const m=()=>{let e=p;e^=e<<13;e^=e>>>17;e^=e<<5;p=e;return e};function y(e){return e}function b(t){let n="";const e=t.charAt(0);n+=w(e)?e:"_";for(let e=1;e<t.length;++e){const r=t.charAt(e);n+=h(r)?r:"_"}return n}function w(e){return e>="A"&&e<="Z"||e>="a"&&e<="z"||e==="_"||e==="$"}function h(e){return w(e)||e>="0"&&e<="9"}function d(e,t,n){if(e===null){O(t,n)}else{e[t]=n}}function g(t){if(t instanceof WebAssembly.Exception){const n=s.exports["teavm.javaException"];const r=s.exports["teavm.getJsException"];if(t.is(n)){const o=t.getArg(n,0);const a=A(o);if(a!==null){return a}let e=r(o);if(typeof e==="undefined"){e=new E(s,o)}return e}}return t}function v(e){if(_ in e){return e[_]}else{return s.exports["teavm.js.wrapException"](e)}}function x(e){s.exports["teavm.js.throwException"](v(e));throw e}function A(e){return s.exports["teavm.js.extractException"](e)}function j(e){throw g(e)}function J(e,t){try{return e!==null?e[t]:D(t)}catch(e){x(e)}}function S(t,e){const n=[];const r=[];for(let e=0;e<t.length;++e){const a="p"+e;n.push(a);r.push(a)}if(e){const s=r.length-1;r[s]="..."+r[s]}const o=r.join(", ");return new Function("rethrowJavaAsJs","fn",`return function(${o}) {
2
- try {
3
- return fn(${n.join(", ")});
4
- } catch (e) {
5
- rethrowJavaAsJs(e);
6
- }
7
- };`)(j,t)}function W(e,t){return new Function("constructor",`return function ${e}(marker, javaObject) {
8
- return constructor.call(this, marker, javaObject);
9
- }
10
- `)(t)}t.teavmJso={stringBuiltinsSupported:()=>e,isUndefined:e=>typeof e==="undefined",emptyArray:()=>[],appendToArray:(e,t)=>e.push(t),unwrapBoolean:e=>e?1:0,wrapBoolean:e=>!!e,getProperty:J,setProperty:d,setPropertyPure:d,global(e){try{return D(e)}catch(e){x(e)}},createClass(e,t,n){e=b(e??"JavaObject");let r;const o=W(e,function(e,t){if(e===i){r.call(this,t)}else if(n===null){throw new Error("This class can't be instantiated directly")}else{try{return n.apply(null,arguments)}catch(e){j(e)}}});if(t===null){r=function(e){this[l]=e;this[c]=null}}else{r=function(e){t.call(this,e)}}o.prototype=Object.create(t?t.prototype:Object.prototype);o.prototype.constructor=o;const a=W(e,function(e){return o.call(this,i,e)});a[i]=o;a.prototype=o.prototype;return a},exportClass(e){return e[i]},defineMethod(e,t,n,r){const o=[];const a=[];for(let e=1;e<n.length;++e){const l="p"+e;o.push(l);a.push(l)}if(r){const c=a.length-1;a[c]="..."+a[c]}const s=a.join(", ");e.prototype[t]=new Function("rethrowJavaAsJs","fn",`return function(${s}) {
11
- try {
12
- return fn(${["this",...o].join(", ")});
13
- } catch (e) {
14
- rethrowJavaAsJs(e);
15
- }
16
- };`)(j,n)},defineStaticMethod(e,t,n,r){e[t]=S(n,r)},defineFunction:S,defineProperty(e,t,n,r){const o={get(){try{return n(this)}catch(e){j(e)}}};if(r!==null){o.set=function(e){try{r(this,e)}catch(e){j(e)}}}Object.defineProperty(e.prototype,t,o)},defineStaticProperty(e,t,n,r){const o={get(){try{return n()}catch(e){j(e)}}};if(r!==null){o.set=function(e){try{r(e)}catch(e){j(e)}}}Object.defineProperty(e,t,o)},javaObjectToJS(e,t){if(e===null){return null}const n=a.get(e);if(typeof n!="undefined"){const o=n.deref();if(typeof o!=="undefined"){return o}}const r=new t(e);a.set(e,new WeakRef(r));return r},unwrapJavaObject(e){return e[l]},asFunction(e,t){if(e===null||e===void 0){return null}let n=e[c];if(n===null){n=Object.create(null);e[c]=n}let r=n[t];if(typeof r!=="function"){r=function(){return e[t].apply(e,arguments)};r[o]=e;n[t]=r}return r},functionAsObject(t,e){if(t===null||t===void 0){return null}const n=t[o];if(typeof n!=="undefined"){const r=n[c];if(r!==void 0&&r[e]===t){return n}}return{[e]:function(...e){try{return t(...e)}catch(e){j(e)}}}},wrapObject(t){if(t===null){return null}if(typeof t==="object"||typeof t==="function"||typeof t==="symbol"){const n=t;let e=n[l];if(typeof e==="object"){return e}e=r.get(t)?.deref();if(e!==void 0){return e}e=s.exports["teavm.jso.createWrapper"](t);r.set(t,new WeakRef(e));return e}else{let e=u.get(t)?.deref();if(e!==void 0){return e}e=s.exports["teavm.jso.createWrapper"](t);u.set(t,new WeakRef(e));f.register(e,t);return e}},isPrimitive:(e,t)=>typeof e===t||e===null,instanceOf:(e,t)=>e instanceof t,instanceOfOrNull:(e,t)=>e===null||e instanceof t,sameRef:(e,t)=>e===t,hashCode:t=>{if(typeof t==="object"||typeof t==="function"||typeof t==="symbol"){let e=n.get(t);if(typeof e==="number"){return e}e=m();n.set(t,e);return e}else if(typeof t==="number"){return t|0}else if(typeof t==="bigint"){return Number(BigInt.asIntN(32,t))}else if(typeof t==="boolean"){return t?1:0}else{return 0}},apply:(e,t,n)=>{try{if(e===null){const r=D(t);return r(...n)}else{return e[t](...n)}}catch(e){x(e)}},concatArray:(e,t)=>[...e,...t],getJavaException:e=>e[_],getJSException:e=>{const t=s.exports["teavm.getJsException"];return t(e)},jsExports:()=>s.userExports};for(const M of["wrapByte","wrapShort","wrapChar","wrapInt","wrapLong","wrapFloat","wrapDouble","unwrapByte","unwrapShort","unwrapChar","unwrapInt","unwrapLong","unwrapFloat","unwrapDouble"]){t.teavmJso[M]=y}function k(e){try{return e()}catch(e){x(e)}}const C=[];for(let e=0;e<32;++e){const F=C.length===0?"":C.join(", ");const T=[...C,"body"].join(", ");t.teavmJso["createFunction"+e]=new Function("wrapCallFromJavaToJs",...C,"body",`return new Function('wrapCallFromJavaToJs', ${T}).bind(this, wrapCallFromJavaToJs);`).bind(null,k);t.teavmJso["bindFunction"+e]=(e,...t)=>e.bind(null,...t);t.teavmJso["callFunction"+e]=new Function("rethrowJsAsJava","fn",...C,`try {
17
- return fn(${F});
18
- } catch (e) {
19
- rethrowJsAsJava(e);
20
- }`).bind(null,x);t.teavmJso["callMethod"+e]=new Function("rethrowJsAsJava","getGlobalName","instance","method",...C,`try {
21
- return instance !== null
22
- ? instance[method](${F})
23
- : getGlobalName(method)(${F});
24
- } catch (e) {
25
- rethrowJsAsJava(e);
26
- }`).bind(null,x,D);t.teavmJso["construct"+e]=new Function("rethrowJsAsJava","constructor",...C,`try {
27
- return new constructor(${F});
28
- } catch (e) {
29
- rethrowJsAsJava(e);
30
- }`).bind(null,x);t.teavmJso["arrayOf"+e]=new Function(...C,"return ["+F+"]");C.push("p"+(e+1))}}function e(e){return new Proxy(e,{get(e,t){const n=e[t];return new WebAssembly.Global({value:"externref",mutable:false},n)}})}async function j(e,o){const t=[];const n={};for(const{module:a,name:r}of p(e)){if(a in o){continue}let e=n[a];if(e===void 0){const s=[];e=s;n[a]=e;t.push((async()=>{const e=await import(a);const t={};for(const n of s){const r=n==="__self__"?e:e[n];t[n]=new WebAssembly.Global({value:"externref",mutable:false},r)}o[a]=t})())}e.push(r)}if(t.length===0){return}await Promise.all(t)}function p(e){const t=WebAssembly.Module.customSections(e,"teavm.imports");if(t.length!==1){return WebAssembly.Module.imports(e).filter(e=>e.kind==="global")}return JSON.parse((new TextDecoder).decode(t[0]))}async function t(e,t){if(!t){t={}}const n=t.nodejs||typeof process!=="undefined";const r=t.emscriptenModules??{};const o=t.stackDeobfuscator??{};const a=o.infoLocation??"auto";const s=J(e,n);const[l,c,i,u]=await Promise.all([o.enabled?W(e,o,n):Promise.resolve(null),s,T(e,a,o,n),I(r,n)]);const f={};const p={};const m=x(f,p,await S());const y=await A(f,t,c,u);if(typeof t.installImports!=="undefined"){t.installImports(f)}if(!t.noAutoImports){await j(c,f)}const b=await WebAssembly.instantiate(c,f);y.malloc=b.exports["teavm.malloc"];y.free=b.exports["teavm.free"];y.realloc=b.exports["teavm.realloc"];m.supplyExports(b.exports);if(l){const h=a==="auto"||a==="embedded"?c:null;const d=F(h,i,l);if(d!==null){m.supplyStackDeobfuscator(d)}}const w={exports:p,instance:b,module:c};for(const g in b.exports){const v=b.exports[g];if(v instanceof WebAssembly.Global){Object.defineProperty(p,g,{get:()=>v.value})}}return w}async function J(e,t){if(typeof e!=="string"){return await WebAssembly.compile(e,{builtins:["js-string"]})}const[n,r]=await m(e,t);const o=await WebAssembly.compileStreaming(n,{builtins:["js-string"]});r();return o}var r=null;function S(){if(r===null){r=(async()=>{const e=new Int8Array([0,97,115,109,1,0,0,0,1,7,1,96,1,127,1,100,111,2,31,1,14,119,97,115,109,58,106,115,45,115,116,114,105,110,103,12,102,114,111,109,67,104,97,114,67,111,100,101,0,0,3,1,0,5,4,1,1,0,0,7,10,1,6,109,101,109,111,114,121,2,0,10,-127,-128,-128,0,0]);try{const t=new Response(e,{headers:{"Content-Type":"application/wasm"}});const n=await WebAssembly.compileStreaming(t,{builtins:["js-string"]});await WebAssembly.instantiate(n,{});return true}catch(e){return false}})()}return r}async function W(e,t,n){if(typeof e!=="string"&&!t.path){return null}try{const r={};const o=await J(t.path??`${e}-deobfuscator.wasm`,n);const a=x(r,{},await S());await A(r,{},o,[]);const s=await WebAssembly.instantiate(o,r);a.supplyExports(s.exports);return s}catch(e){console.warn("Could not load deobfuscator",e);return null}}async function m(e,t){if(!t){const n=await fetch(e);return[n,()=>{}]}else{const r=await b();const o=await r.open(e,"r");const a=await o.readableWebStream();const n=new Response(a,{headers:{"Content-Type":"application/wasm"}});return[n,()=>o.close()]}}var y;async function b(){if(!y){y=import("node:fs/promises")}return await y}function F(e,t,n){let r=null;let o=false;function a(){if(!o){o=true;if(t!==null){try{r=n.exports["createFromExternalFile"].value(t)}catch(e){console.warn("Could not load create deobfuscator",e)}}if(r==null&&e!==null){try{r=n.exports["createForModule"].value(e)}catch(e){console.warn("Could not create deobfuscator from module data",e)}}}}return e=>{a();return r!==null?r.deobfuscate(e):[]}}async function T(e,t,n,r){if(!n.enabled){return null}if(typeof e!=="string"&&!n.externalInfoPath){return null}if(t!=="auto"&&t!=="external"){return null}if(typeof n.externalInfoPath==="object"&&n.externalInfoPath instanceof Int8Array){return n.externalInfoPath}const o=n.externalInfoPath??e+".teadbg";let a;if(!r){const s=await fetch(o);if(!s.ok){return null}a=await s.arrayBuffer()}else{const l=await b();a=(await l.readFile(o)).buffer}return new Int8Array(a)}async function I(e,c){const t=Object.entries(e);return Promise.all(t.map(async([e,{pathToJs:t,pathToWasm:n}])=>{const[r,o]=await m(n,c);const[a,s]=await Promise.all([import(t),WebAssembly.compileStreaming(r)]);const l={name:e,jsLoader:a.default,wasmModule:s};o();return l}))}export{x as defaults,t as load,e as wrapImport};