libav-wasm 0.3.1 → 0.3.2
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/build/index.d.ts +2 -2
- package/build/utils.d.ts +0 -31
- package/build/worker.d.ts +2 -2
- package/build/worker.js +194 -189
- package/package.json +1 -1
package/build/index.d.ts
CHANGED
|
@@ -41,9 +41,9 @@ export type Chunk = {
|
|
|
41
41
|
pos: number;
|
|
42
42
|
};
|
|
43
43
|
export declare const makeRemuxer: ({ publicPath, workerUrl, workerOptions, getStream: _getStream, attachment, subtitle: _subtitle, length, bufferSize }: MakeTransmuxerOptions) => Promise<{
|
|
44
|
-
init: () => Promise<Chunk
|
|
44
|
+
init: () => Promise<Chunk>;
|
|
45
45
|
destroy: (destroyWorker?: boolean) => void;
|
|
46
|
-
read: () => Promise<Chunk
|
|
46
|
+
read: () => Promise<Chunk>;
|
|
47
47
|
seek: (time: number) => Promise<void>;
|
|
48
48
|
getInfo: () => Promise<{
|
|
49
49
|
input: MediaInfo;
|
package/build/utils.d.ts
CHANGED
|
@@ -1,34 +1,3 @@
|
|
|
1
|
-
export declare enum State {
|
|
2
|
-
Idle = 0,
|
|
3
|
-
Requested = 1,
|
|
4
|
-
Responded = 2
|
|
5
|
-
}
|
|
6
|
-
/** https://ffmpeg.org/doxygen/trunk/avformat_8h.html#ac736f8f4afc930ca1cda0b43638cc678 */
|
|
7
|
-
export declare enum SEEK_FLAG {
|
|
8
|
-
NONE = 0,
|
|
9
|
-
/** seek backward */
|
|
10
|
-
AVSEEK_FLAG_BACKWARD = 1,
|
|
11
|
-
/** seeking based on position in bytes */
|
|
12
|
-
AVSEEK_FLAG_BYTE = 2,
|
|
13
|
-
/** seek to any frame, even non-keyframes */
|
|
14
|
-
AVSEEK_FLAG_ANY = 4,
|
|
15
|
-
/** seeking based on frame number */
|
|
16
|
-
AVSEEK_FLAG_FRAME = 8
|
|
17
|
-
}
|
|
18
|
-
export declare enum SEEK_WHENCE_FLAG {
|
|
19
|
-
SEEK_SET = 0,
|
|
20
|
-
SEEK_CUR = 1,
|
|
21
|
-
SEEK_END = 2,
|
|
22
|
-
AVSEEK_SIZE = 65536
|
|
23
|
-
}
|
|
24
|
-
export declare enum AVERROR {
|
|
25
|
-
EOF = -541478725,
|
|
26
|
-
EXIT = 255
|
|
27
|
-
}
|
|
28
|
-
export declare const notifyInterface: (sharedArrayBuffer: SharedArrayBuffer, value: State) => number;
|
|
29
|
-
export declare const waitForInterfaceNotification: (sharedArrayBuffer: SharedArrayBuffer, value: State) => Promise<'ok' | 'timed-out'> | 'not-equal';
|
|
30
|
-
export declare const waitSyncForInterfaceNotification: (sharedArrayBuffer: SharedArrayBuffer, value: State) => "ok" | "timed-out" | "not-equal";
|
|
31
|
-
export declare const freeInterface: (sharedArrayBuffer: SharedArrayBuffer) => Uint8Array;
|
|
32
1
|
export declare function debounceImmediateAndLatest<T extends (...args: any[]) => any>(wait: number, func: T): T;
|
|
33
2
|
export declare const queuedDebounceWithLastCall: <T2 extends any[], T extends (...args: T2) => any>(time: number, func: T) => (...args: Parameters<T>) => Promise<any> | undefined;
|
|
34
3
|
export declare const toStreamChunkSize: (SIZE: number) => (stream: ReadableStream) => ReadableStream<Uint8Array>;
|
package/build/worker.d.ts
CHANGED
|
@@ -14,10 +14,10 @@ declare const resolvers: {
|
|
|
14
14
|
subtitle: (streamIndex: number, isHeader: boolean, data: string, ...rest: [number, number] | [string, string]) => Promise<void>;
|
|
15
15
|
attachment: (filename: string, mimetype: string, buffer: ArrayBuffer) => Promise<void>;
|
|
16
16
|
}) => Promise<{
|
|
17
|
-
init: () => Promise<Chunk
|
|
17
|
+
init: () => Promise<Chunk>;
|
|
18
18
|
destroy: () => void;
|
|
19
19
|
seek: (timestamp: number) => Promise<void>;
|
|
20
|
-
read: () => Promise<Chunk
|
|
20
|
+
read: () => Promise<Chunk>;
|
|
21
21
|
getInfo: () => Promise<{
|
|
22
22
|
input: {
|
|
23
23
|
formatName: string;
|
package/build/worker.js
CHANGED
|
@@ -81,35 +81,35 @@ var Qt = {}, za = {
|
|
|
81
81
|
if (i.ENVIRONMENT)
|
|
82
82
|
throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)");
|
|
83
83
|
var H = "";
|
|
84
|
-
function
|
|
84
|
+
function p(e) {
|
|
85
85
|
return i.locateFile ? i.locateFile(e, H) : H + e;
|
|
86
86
|
}
|
|
87
87
|
var N;
|
|
88
88
|
if (typeof document < "u" && document.currentScript && (H = document.currentScript.src), h && (H = h), H.indexOf("blob:") !== 0 ? H = H.substr(0, H.replace(/[?#].*/, "").lastIndexOf("/") + 1) : H = "", !(typeof window == "object" || typeof importScripts == "function"))
|
|
89
89
|
throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");
|
|
90
90
|
var W = i.print || console.log.bind(console), C = i.printErr || console.error.bind(console);
|
|
91
|
-
Object.assign(i, E), E = null, Ea(), i.arguments && i.arguments, ve("arguments", "arguments_"), i.thisProgram && (S = i.thisProgram), ve("thisProgram", "thisProgram"), i.quit && (F = i.quit), ve("quit", "quit_"),
|
|
91
|
+
Object.assign(i, E), E = null, Ea(), i.arguments && i.arguments, ve("arguments", "arguments_"), i.thisProgram && (S = i.thisProgram), ve("thisProgram", "thisProgram"), i.quit && (F = i.quit), ve("quit", "quit_"), g(typeof i.memoryInitializerPrefixURL > "u", "Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"), g(typeof i.pthreadMainPrefixURL > "u", "Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"), g(typeof i.cdInitializerPrefixURL > "u", "Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"), g(typeof i.filePackagePrefixURL > "u", "Module.filePackagePrefixURL option was removed, use Module.locateFile instead"), g(typeof i.read > "u", "Module.read option was removed (modify read_ in JS)"), g(typeof i.readAsync > "u", "Module.readAsync option was removed (modify readAsync in JS)"), g(typeof i.readBinary > "u", "Module.readBinary option was removed (modify readBinary in JS)"), g(typeof i.setWindowTitle > "u", "Module.setWindowTitle option was removed (modify setWindowTitle in JS)"), g(typeof i.TOTAL_MEMORY > "u", "Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"), ve("read", "read_"), ve("readAsync", "readAsync"), ve("readBinary", "readBinary"), ve("setWindowTitle", "setWindowTitle"), g(!Q, "worker environment detected but not enabled at build time. Add 'worker' to `-sENVIRONMENT` to enable."), g(!z, "node environment detected but not enabled at build time. Add 'node' to `-sENVIRONMENT` to enable."), g(!L, "shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable.");
|
|
92
92
|
var oe;
|
|
93
93
|
i.wasmBinary && (oe = i.wasmBinary), ve("wasmBinary", "wasmBinary");
|
|
94
94
|
var de = i.noExitRuntime || !0;
|
|
95
95
|
ve("noExitRuntime", "noExitRuntime"), typeof WebAssembly != "object" && J("no native wasm support detected");
|
|
96
96
|
var xe, _e = !1, Ue;
|
|
97
|
-
function
|
|
97
|
+
function g(e, t) {
|
|
98
98
|
e || J("Assertion failed" + (t ? ": " + t : ""));
|
|
99
99
|
}
|
|
100
|
-
var se, te, Se, rt,
|
|
100
|
+
var se, te, Se, rt, b, x, er, tr;
|
|
101
101
|
function rr() {
|
|
102
102
|
var e = xe.buffer;
|
|
103
|
-
i.HEAP8 = se = new Int8Array(e), i.HEAP16 = Se = new Int16Array(e), i.HEAP32 =
|
|
103
|
+
i.HEAP8 = se = new Int8Array(e), i.HEAP16 = Se = new Int16Array(e), i.HEAP32 = b = new Int32Array(e), i.HEAPU8 = te = new Uint8Array(e), i.HEAPU16 = rt = new Uint16Array(e), i.HEAPU32 = x = new Uint32Array(e), i.HEAPF32 = er = new Float32Array(e), i.HEAPF64 = tr = new Float64Array(e);
|
|
104
104
|
}
|
|
105
|
-
|
|
105
|
+
g(!i.STACK_SIZE, "STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time"), g(
|
|
106
106
|
typeof Int32Array < "u" && typeof Float64Array < "u" && Int32Array.prototype.subarray != null && Int32Array.prototype.set != null,
|
|
107
107
|
"JS engine does not provide full typed array support"
|
|
108
|
-
),
|
|
108
|
+
), g(!i.wasmMemory, "Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally"), g(!i.INITIAL_MEMORY, "Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically");
|
|
109
109
|
var nr;
|
|
110
110
|
function Xr() {
|
|
111
111
|
var e = Je();
|
|
112
|
-
|
|
112
|
+
g((e & 3) == 0), e == 0 && (e += 4), x[e >> 2] = 34821223, M(34821223), x[e + 4 >> 2] = 2310721022, M(2310721022), x[0] = 1668509029, M(1668509029);
|
|
113
113
|
}
|
|
114
114
|
function Le() {
|
|
115
115
|
if (!_e) {
|
|
@@ -135,7 +135,7 @@ var Qt = {}, za = {
|
|
|
135
135
|
it(wt);
|
|
136
136
|
}
|
|
137
137
|
function rn() {
|
|
138
|
-
|
|
138
|
+
g(!Tt), Tt = !0, Le(), Pn(), it(ir);
|
|
139
139
|
}
|
|
140
140
|
function nn() {
|
|
141
141
|
Le(), it(en);
|
|
@@ -155,10 +155,10 @@ var Qt = {}, za = {
|
|
|
155
155
|
function ln(e) {
|
|
156
156
|
ar.unshift(e);
|
|
157
157
|
}
|
|
158
|
-
|
|
158
|
+
g(Math.imul, "This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"), g(Math.fround, "This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"), g(Math.clz32, "This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"), g(Math.trunc, "This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");
|
|
159
159
|
var be = 0, Fe = null, Ne = null, We = {};
|
|
160
160
|
function un(e) {
|
|
161
|
-
be++, i.monitorRunDependencies && i.monitorRunDependencies(be), e ? (
|
|
161
|
+
be++, i.monitorRunDependencies && i.monitorRunDependencies(be), e ? (g(!We[e]), We[e] = 1, Fe === null && typeof setInterval < "u" && (Fe = setInterval(() => {
|
|
162
162
|
if (_e) {
|
|
163
163
|
clearInterval(Fe), Fe = null;
|
|
164
164
|
return;
|
|
@@ -170,7 +170,7 @@ var Qt = {}, za = {
|
|
|
170
170
|
}, 1e4))) : C("warning: run dependency added without ID");
|
|
171
171
|
}
|
|
172
172
|
function cn(e) {
|
|
173
|
-
if (be--, i.monitorRunDependencies && i.monitorRunDependencies(be), e ? (
|
|
173
|
+
if (be--, i.monitorRunDependencies && i.monitorRunDependencies(be), e ? (g(We[e]), delete We[e]) : C("warning: run dependency removed without ID"), be == 0 && (Fe !== null && (clearInterval(Fe), Fe = null), Ne)) {
|
|
174
174
|
var t = Ne;
|
|
175
175
|
Ne = null, t();
|
|
176
176
|
}
|
|
@@ -223,11 +223,11 @@ var Qt = {}, za = {
|
|
|
223
223
|
function D(e, t) {
|
|
224
224
|
return function() {
|
|
225
225
|
var r = e, n = t;
|
|
226
|
-
return t || (n = i.asm),
|
|
226
|
+
return t || (n = i.asm), g(Tt, "native function `" + r + "` called before runtime initialization"), n[e] || g(n[e], "exported native function `" + r + "` not found"), n[e].apply(null, arguments);
|
|
227
227
|
};
|
|
228
228
|
}
|
|
229
229
|
var we;
|
|
230
|
-
we = "libav.wasm", sr(we) || (we =
|
|
230
|
+
we = "libav.wasm", sr(we) || (we = p(we));
|
|
231
231
|
function lr(e) {
|
|
232
232
|
try {
|
|
233
233
|
if (e == we && oe)
|
|
@@ -267,12 +267,12 @@ var Qt = {}, za = {
|
|
|
267
267
|
};
|
|
268
268
|
function t(a, s) {
|
|
269
269
|
var o = a.exports;
|
|
270
|
-
return o =
|
|
270
|
+
return o = y.instrumentWasmExports(o), i.asm = o, xe = i.asm.memory, g(xe, "memory not found in wasm exports"), rr(), nr = i.asm.__indirect_function_table, g(nr, "table not found in wasm exports"), sn(i.asm.__wasm_call_ctors), cn("wasm-instantiate"), o;
|
|
271
271
|
}
|
|
272
272
|
un("wasm-instantiate");
|
|
273
273
|
var r = i;
|
|
274
274
|
function n(a) {
|
|
275
|
-
|
|
275
|
+
g(i === r, "the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"), r = null, t(a.instance);
|
|
276
276
|
}
|
|
277
277
|
if (i.instantiateWasm)
|
|
278
278
|
try {
|
|
@@ -326,7 +326,7 @@ var Qt = {}, za = {
|
|
|
326
326
|
}
|
|
327
327
|
var yn = 2 ** 8 - 1, bn = 2 ** 16 - 1, wn = 2 ** 32 - 1, Tn = 2 ** 64 - 1, Cn = -(2 ** (8 - 1)) + 1, En = -(2 ** (16 - 1)) + 1, Sn = -(2 ** (32 - 1)) + 1, Fn = -(2 ** (64 - 1)) + 1;
|
|
328
328
|
function nt(e, t, r, n) {
|
|
329
|
-
|
|
329
|
+
g(Number.isInteger(Number(e)), "attempt to write non-integer (" + e + ") into integer heap"), g(e <= n, "value (" + e + ") too large to write as " + t + "-bit value"), g(e >= r, "value (" + e + ") too small to write as " + t + "-bit value");
|
|
330
330
|
}
|
|
331
331
|
var He = (e) => nt(e, 8, Cn, yn), Et = (e) => nt(e, 16, En, bn), M = (e) => nt(e, 32, Sn, wn), dr = (e) => nt(e, 64, Fn, Tn);
|
|
332
332
|
function _r(e) {
|
|
@@ -335,7 +335,7 @@ var Qt = {}, za = {
|
|
|
335
335
|
var it = (e) => {
|
|
336
336
|
for (; e.length > 0; )
|
|
337
337
|
e.shift()(i);
|
|
338
|
-
}, he = (e) => (
|
|
338
|
+
}, he = (e) => (g(typeof e == "number"), "0x" + e.toString(16).padStart(8, "0")), Pn = () => {
|
|
339
339
|
var e = zt(), t = Je();
|
|
340
340
|
Ia(e, t);
|
|
341
341
|
}, ce = (e) => {
|
|
@@ -374,7 +374,7 @@ var Qt = {}, za = {
|
|
|
374
374
|
}
|
|
375
375
|
function In(e, t, r) {
|
|
376
376
|
var n = new An(e);
|
|
377
|
-
n.init(t, r),
|
|
377
|
+
n.init(t, r), g(!1, "Exception thrown, but exception catching is not enabled. Compile with -sNO_DISABLE_EXCEPTION_CATCHING or -sEXCEPTION_CATCHING_ALLOWED=[..] to catch.");
|
|
378
378
|
}
|
|
379
379
|
var Dn = (e) => {
|
|
380
380
|
e = e >>> 0;
|
|
@@ -405,7 +405,7 @@ var Qt = {}, za = {
|
|
|
405
405
|
}
|
|
406
406
|
}
|
|
407
407
|
return s;
|
|
408
|
-
}, St = (e, t) => (
|
|
408
|
+
}, St = (e, t) => (g(typeof e == "number"), e ? hr(te, e, t) : "");
|
|
409
409
|
function Mn(e, t, r) {
|
|
410
410
|
return 0;
|
|
411
411
|
}
|
|
@@ -420,7 +420,7 @@ var Qt = {}, za = {
|
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
422
|
function Ye(e) {
|
|
423
|
-
return this.fromWireType(
|
|
423
|
+
return this.fromWireType(b[e >> 2]);
|
|
424
424
|
}
|
|
425
425
|
var Me = {}, Pe = {}, ot = {}, On = 48, Rn = 57;
|
|
426
426
|
function Pt(e) {
|
|
@@ -572,7 +572,7 @@ var Qt = {}, za = {
|
|
|
572
572
|
else if (r === 2)
|
|
573
573
|
l = Se;
|
|
574
574
|
else if (r === 4)
|
|
575
|
-
l =
|
|
575
|
+
l = b;
|
|
576
576
|
else
|
|
577
577
|
throw new TypeError("Unknown boolean type size: " + t);
|
|
578
578
|
return this.fromWireType(l[o >> s]);
|
|
@@ -832,7 +832,7 @@ Originally allocated`), "captureStackTrace" in Error && Error.captureStackTrace(
|
|
|
832
832
|
i.hasOwnProperty(e) || st("Replacing nonexistant public symbol"), i[e].overloadTable !== void 0 && r !== void 0 ? i[e].overloadTable[r] = t : (i[e] = t, i[e].argCount = r);
|
|
833
833
|
}
|
|
834
834
|
var ui = (e, t, r) => {
|
|
835
|
-
|
|
835
|
+
g("dynCall_" + e in i, `bad function pointer type - dynCall function not found for sig '${e}'`), r && r.length ? g(r.length === e.substring(1).replace(/j/g, "--").length) : g(e.length == 1);
|
|
836
836
|
var n = i["dynCall_" + e];
|
|
837
837
|
return r && r.length ? n.apply(null, [t].concat(r)) : n.call(null, t);
|
|
838
838
|
}, ci = (e, t, r) => ui(e, t, r), fi = (e, t) => {
|
|
@@ -979,7 +979,7 @@ Originally allocated`), "captureStackTrace" in Error && Error.captureStackTrace(
|
|
|
979
979
|
} catch (t) {
|
|
980
980
|
xt(t);
|
|
981
981
|
}
|
|
982
|
-
},
|
|
982
|
+
}, y = { instrumentWasmImports: function(e) {
|
|
983
983
|
var t = [/^invoke_.*$/, /^fd_sync$/, /^__wasi_fd_sync$/, /^__asyncjs__.*$/, /^emscripten_promise_await$/, /^emscripten_idb_load$/, /^emscripten_idb_store$/, /^emscripten_idb_delete$/, /^emscripten_idb_exists$/, /^emscripten_idb_load_blob$/, /^emscripten_idb_store_blob$/, /^emscripten_sleep$/, /^emscripten_wget$/, /^emscripten_wget_data$/, /^emscripten_scan_registers$/, /^emscripten_lazy_load_code$/, /^_load_secondary_module$/, /^emscripten_fiber_swap$/, /^SDL_Delay$/, /^_emval_await$/];
|
|
984
984
|
for (var r in e)
|
|
985
985
|
(function(n) {
|
|
@@ -987,12 +987,12 @@ Originally allocated`), "captureStackTrace" in Error && Error.captureStackTrace(
|
|
|
987
987
|
if (a.sig, typeof a == "function") {
|
|
988
988
|
var s = a.isAsync || t.some((o) => !!n.match(o));
|
|
989
989
|
e[n] = function() {
|
|
990
|
-
var o =
|
|
990
|
+
var o = y.state;
|
|
991
991
|
try {
|
|
992
992
|
return a.apply(null, arguments);
|
|
993
993
|
} finally {
|
|
994
|
-
var l = o ===
|
|
995
|
-
if (
|
|
994
|
+
var l = o === y.State.Normal && y.state === y.State.Disabled, d = n.startsWith("invoke_") && !0;
|
|
995
|
+
if (y.state !== o && !s && !l && !d)
|
|
996
996
|
throw new Error(`import ${n} was not in ASYNCIFY_IMPORTS, but changed the state`);
|
|
997
997
|
}
|
|
998
998
|
};
|
|
@@ -1004,82 +1004,82 @@ Originally allocated`), "captureStackTrace" in Error && Error.captureStackTrace(
|
|
|
1004
1004
|
(function(n) {
|
|
1005
1005
|
var a = e[n];
|
|
1006
1006
|
typeof a == "function" ? t[n] = function() {
|
|
1007
|
-
|
|
1007
|
+
y.exportCallStack.push(n);
|
|
1008
1008
|
try {
|
|
1009
1009
|
return a.apply(null, arguments);
|
|
1010
1010
|
} finally {
|
|
1011
1011
|
if (!_e) {
|
|
1012
|
-
var s =
|
|
1013
|
-
|
|
1012
|
+
var s = y.exportCallStack.pop();
|
|
1013
|
+
g(s === n), y.maybeStopUnwind();
|
|
1014
1014
|
}
|
|
1015
1015
|
}
|
|
1016
1016
|
} : t[n] = a;
|
|
1017
1017
|
})(r);
|
|
1018
1018
|
return t;
|
|
1019
1019
|
}, State: { Normal: 0, Unwinding: 1, Rewinding: 2, Disabled: 3 }, state: 0, StackSize: 4096, currData: null, handleSleepReturnValue: 0, exportCallStack: [], callStackNameToId: {}, callStackIdToName: {}, callStackId: 0, asyncPromiseHandlers: null, sleepCallbacks: [], getCallStackId: function(e) {
|
|
1020
|
-
var t =
|
|
1021
|
-
return t === void 0 && (t =
|
|
1020
|
+
var t = y.callStackNameToId[e];
|
|
1021
|
+
return t === void 0 && (t = y.callStackId++, y.callStackNameToId[e] = t, y.callStackIdToName[t] = e), t;
|
|
1022
1022
|
}, maybeStopUnwind: function() {
|
|
1023
|
-
|
|
1023
|
+
y.currData && y.state === y.State.Unwinding && y.exportCallStack.length === 0 && (y.state = y.State.Normal, ut(Ma), typeof Fibers < "u" && Fibers.trampoline());
|
|
1024
1024
|
}, whenDone: function() {
|
|
1025
|
-
return
|
|
1026
|
-
|
|
1025
|
+
return g(y.currData, "Tried to wait for an async operation when none is in progress."), g(!y.asyncPromiseHandlers, "Cannot have multiple async operations in flight at once"), new Promise((e, t) => {
|
|
1026
|
+
y.asyncPromiseHandlers = { resolve: e, reject: t };
|
|
1027
1027
|
});
|
|
1028
1028
|
}, allocateData: function() {
|
|
1029
|
-
var e = ft(12 +
|
|
1030
|
-
return
|
|
1029
|
+
var e = ft(12 + y.StackSize);
|
|
1030
|
+
return y.setDataHeader(e, e + 12, y.StackSize), y.setDataRewindFunc(e), e;
|
|
1031
1031
|
}, setDataHeader: function(e, t, r) {
|
|
1032
|
-
|
|
1032
|
+
b[e >> 2] = t, M(t), b[e + 4 >> 2] = t + r, M(t + r);
|
|
1033
1033
|
}, setDataRewindFunc: function(e) {
|
|
1034
|
-
var t =
|
|
1035
|
-
|
|
1034
|
+
var t = y.exportCallStack[0], r = y.getCallStackId(t);
|
|
1035
|
+
b[e + 8 >> 2] = r, M(r);
|
|
1036
1036
|
}, getDataRewindFunc: function(e) {
|
|
1037
|
-
var t =
|
|
1037
|
+
var t = b[e + 8 >> 2], r = y.callStackIdToName[t], n = i.asm[r];
|
|
1038
1038
|
return n;
|
|
1039
1039
|
}, doRewind: function(e) {
|
|
1040
|
-
var t =
|
|
1040
|
+
var t = y.getDataRewindFunc(e);
|
|
1041
1041
|
return t();
|
|
1042
1042
|
}, handleSleep: function(e) {
|
|
1043
|
-
if (
|
|
1044
|
-
if (
|
|
1043
|
+
if (g(y.state !== y.State.Disabled, "Asyncify cannot be done during or after the runtime exits"), !_e) {
|
|
1044
|
+
if (y.state === y.State.Normal) {
|
|
1045
1045
|
var t = !1, r = !1;
|
|
1046
1046
|
e((n = 0) => {
|
|
1047
|
-
if (
|
|
1048
|
-
|
|
1047
|
+
if (g(!n || typeof n == "number" || typeof n == "boolean"), !_e && (y.handleSleepReturnValue = n, t = !0, !!r)) {
|
|
1048
|
+
g(!y.exportCallStack.length, "Waking up (starting to rewind) must be done from JS, without compiled code on the stack."), y.state = y.State.Rewinding, ut(() => $a(y.currData)), typeof Browser < "u" && Browser.mainLoop.func && Browser.mainLoop.resume();
|
|
1049
1049
|
var a, s = !1;
|
|
1050
1050
|
try {
|
|
1051
|
-
a =
|
|
1051
|
+
a = y.doRewind(y.currData);
|
|
1052
1052
|
} catch (d) {
|
|
1053
1053
|
a = d, s = !0;
|
|
1054
1054
|
}
|
|
1055
1055
|
var o = !1;
|
|
1056
|
-
if (!
|
|
1057
|
-
var l =
|
|
1058
|
-
l && (
|
|
1056
|
+
if (!y.currData) {
|
|
1057
|
+
var l = y.asyncPromiseHandlers;
|
|
1058
|
+
l && (y.asyncPromiseHandlers = null, (s ? l.reject : l.resolve)(a), o = !0);
|
|
1059
1059
|
}
|
|
1060
1060
|
if (s && !o)
|
|
1061
1061
|
throw a;
|
|
1062
1062
|
}
|
|
1063
|
-
}), r = !0, t || (
|
|
1063
|
+
}), r = !0, t || (y.state = y.State.Unwinding, y.currData = y.allocateData(), typeof Browser < "u" && Browser.mainLoop.func && Browser.mainLoop.pause(), ut(() => Da(y.currData)));
|
|
1064
1064
|
} else
|
|
1065
|
-
|
|
1066
|
-
return
|
|
1065
|
+
y.state === y.State.Rewinding ? (y.state = y.State.Normal, ut(Oa), ge(y.currData), y.currData = null, y.sleepCallbacks.forEach((n) => pi(n))) : J(`invalid state: ${y.state}`);
|
|
1066
|
+
return y.handleSleepReturnValue;
|
|
1067
1067
|
}
|
|
1068
1068
|
}, handleAsync: function(e) {
|
|
1069
|
-
return
|
|
1069
|
+
return y.handleSleep((t) => {
|
|
1070
1070
|
e().then(t);
|
|
1071
1071
|
});
|
|
1072
1072
|
} };
|
|
1073
1073
|
function Ar(e, t, r, n, a, s) {
|
|
1074
1074
|
var o = t.length;
|
|
1075
|
-
o < 2 && U("argTypes array size mismatch! Must at least get return value and 'this' types!"),
|
|
1075
|
+
o < 2 && U("argTypes array size mismatch! Must at least get return value and 'this' types!"), g(!s, "Async bindings are only supported with JSPI.");
|
|
1076
1076
|
for (var l = t[1] !== null && r !== null, d = !1, f = 1; f < t.length; ++f)
|
|
1077
1077
|
if (t[f] !== null && t[f].destructorFunction === void 0) {
|
|
1078
1078
|
d = !0;
|
|
1079
1079
|
break;
|
|
1080
1080
|
}
|
|
1081
1081
|
var m = t[0].name !== "void";
|
|
1082
|
-
s && (n =
|
|
1082
|
+
s && (n = y.makeAsyncFunction(n));
|
|
1083
1083
|
for (var P = "", A = "", f = 0; f < o - 2; ++f)
|
|
1084
1084
|
P += (f !== 0 ? ", " : "") + "arg" + f, A += (f !== 0 ? ", " : "") + "arg" + f + "Wired";
|
|
1085
1085
|
var R = `
|
|
@@ -1096,7 +1096,7 @@ Originally allocated`), "captureStackTrace" in Error && Error.captureStackTrace(
|
|
|
1096
1096
|
R += "var arg" + f + "Wired = argType" + f + ".toWireType(" + j + ", arg" + f + "); // " + t[f + 2].name + `
|
|
1097
1097
|
`, V.push("argType" + f), G.push(t[f + 2]);
|
|
1098
1098
|
if (l && (A = "thisWired" + (A.length > 0 ? ", " : "") + A), R += (m || s ? "var rv = " : "") + "invoker(fn" + (A.length > 0 ? ", " : "") + A + `);
|
|
1099
|
-
`, V.push("Asyncify"), G.push(
|
|
1099
|
+
`, V.push("Asyncify"), G.push(y), R += "function onDone(" + (m ? "rv" : "") + `) {
|
|
1100
1100
|
`, d)
|
|
1101
1101
|
R += `runDestructors(destructors);
|
|
1102
1102
|
`;
|
|
@@ -1114,7 +1114,7 @@ return ret;
|
|
|
1114
1114
|
`, V.push(R), _i(Function, V).apply(null, G);
|
|
1115
1115
|
}
|
|
1116
1116
|
function gi(e, t, r, n, a, s) {
|
|
1117
|
-
|
|
1117
|
+
g(t > 0);
|
|
1118
1118
|
var o = Fr(t, r);
|
|
1119
1119
|
a = fe(n, a), $e([], [e], function(l) {
|
|
1120
1120
|
l = l[0];
|
|
@@ -1146,14 +1146,14 @@ return ret;
|
|
|
1146
1146
|
}
|
|
1147
1147
|
function bi() {
|
|
1148
1148
|
this.allocated = [void 0], this.freelist = [], this.get = function(e) {
|
|
1149
|
-
return
|
|
1149
|
+
return g(this.allocated[e] !== void 0, `invalid handle: ${e}`), this.allocated[e];
|
|
1150
1150
|
}, this.has = function(e) {
|
|
1151
1151
|
return this.allocated[e] !== void 0;
|
|
1152
1152
|
}, this.allocate = function(e) {
|
|
1153
1153
|
var t = this.freelist.pop() || this.allocated.length;
|
|
1154
1154
|
return this.allocated[t] = e, t;
|
|
1155
1155
|
}, this.free = function(e) {
|
|
1156
|
-
|
|
1156
|
+
g(this.allocated[e] !== void 0), this.allocated[e] = void 0, this.freelist.push(e);
|
|
1157
1157
|
};
|
|
1158
1158
|
}
|
|
1159
1159
|
var ae = new bi();
|
|
@@ -1255,7 +1255,7 @@ return ret;
|
|
|
1255
1255
|
};
|
|
1256
1256
|
case 2:
|
|
1257
1257
|
return r ? function(a) {
|
|
1258
|
-
return
|
|
1258
|
+
return b[a >> 2];
|
|
1259
1259
|
} : function(a) {
|
|
1260
1260
|
return x[a >> 2];
|
|
1261
1261
|
};
|
|
@@ -1315,7 +1315,7 @@ return ret;
|
|
|
1315
1315
|
});
|
|
1316
1316
|
}
|
|
1317
1317
|
var Ir = (e, t, r, n) => {
|
|
1318
|
-
if (
|
|
1318
|
+
if (g(typeof e == "string"), !(n > 0))
|
|
1319
1319
|
return 0;
|
|
1320
1320
|
for (var a = r, s = r + n - 1, o = 0; o < e.length; ++o) {
|
|
1321
1321
|
var l = e.charCodeAt(o);
|
|
@@ -1342,7 +1342,7 @@ return ret;
|
|
|
1342
1342
|
}
|
|
1343
1343
|
}
|
|
1344
1344
|
return t[r] = 0, r - a;
|
|
1345
|
-
}, Dr = (e, t, r) => (
|
|
1345
|
+
}, Dr = (e, t, r) => (g(typeof r == "number", "stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"), Ir(e, te, t, r)), Lt = (e) => {
|
|
1346
1346
|
for (var t = 0, r = 0; r < e.length; ++r) {
|
|
1347
1347
|
var n = e.charCodeAt(r);
|
|
1348
1348
|
n <= 127 ? t++ : n <= 2047 ? t += 2 : n >= 55296 && n <= 57343 ? (t += 4, ++r) : t += 3;
|
|
@@ -1396,7 +1396,7 @@ return ret;
|
|
|
1396
1396
|
});
|
|
1397
1397
|
}
|
|
1398
1398
|
var Mr = typeof TextDecoder < "u" ? new TextDecoder("utf-16le") : void 0, Di = (e, t) => {
|
|
1399
|
-
|
|
1399
|
+
g(e % 2 == 0, "Pointer passed to UTF16ToString must be aligned to two bytes!");
|
|
1400
1400
|
for (var r = e, n = r >> 1, a = n + t / 2; !(n >= a) && rt[n]; )
|
|
1401
1401
|
++n;
|
|
1402
1402
|
if (r = n << 1, r - e > 32 && Mr)
|
|
@@ -1409,7 +1409,7 @@ return ret;
|
|
|
1409
1409
|
}
|
|
1410
1410
|
return s;
|
|
1411
1411
|
}, Mi = (e, t, r) => {
|
|
1412
|
-
if (
|
|
1412
|
+
if (g(t % 2 == 0, "Pointer passed to stringToUTF16 must be aligned to two bytes!"), g(typeof r == "number", "stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"), r === void 0 && (r = 2147483647), r < 2)
|
|
1413
1413
|
return 0;
|
|
1414
1414
|
r -= 2;
|
|
1415
1415
|
for (var n = t, a = r < e.length * 2 ? r / 2 : e.length, s = 0; s < a; ++s) {
|
|
@@ -1418,9 +1418,9 @@ return ret;
|
|
|
1418
1418
|
}
|
|
1419
1419
|
return Se[t >> 1] = 0, Et(0), t - n;
|
|
1420
1420
|
}, $i = (e) => e.length * 2, Oi = (e, t) => {
|
|
1421
|
-
|
|
1421
|
+
g(e % 4 == 0, "Pointer passed to UTF32ToString must be aligned to four bytes!");
|
|
1422
1422
|
for (var r = 0, n = ""; !(r >= t / 4); ) {
|
|
1423
|
-
var a =
|
|
1423
|
+
var a = b[e + r * 4 >> 2];
|
|
1424
1424
|
if (a == 0)
|
|
1425
1425
|
break;
|
|
1426
1426
|
if (++r, a >= 65536) {
|
|
@@ -1431,7 +1431,7 @@ return ret;
|
|
|
1431
1431
|
}
|
|
1432
1432
|
return n;
|
|
1433
1433
|
}, Ri = (e, t, r) => {
|
|
1434
|
-
if (
|
|
1434
|
+
if (g(t % 4 == 0, "Pointer passed to stringToUTF32 must be aligned to four bytes!"), g(typeof r == "number", "stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"), r === void 0 && (r = 2147483647), r < 4)
|
|
1435
1435
|
return 0;
|
|
1436
1436
|
for (var n = t, a = n + r - 4, s = 0; s < e.length; ++s) {
|
|
1437
1437
|
var o = e.charCodeAt(s);
|
|
@@ -1439,10 +1439,10 @@ return ret;
|
|
|
1439
1439
|
var l = e.charCodeAt(++s);
|
|
1440
1440
|
o = 65536 + ((o & 1023) << 10) | l & 1023;
|
|
1441
1441
|
}
|
|
1442
|
-
if (
|
|
1442
|
+
if (b[t >> 2] = o, M(o), t += 4, t + 4 > a)
|
|
1443
1443
|
break;
|
|
1444
1444
|
}
|
|
1445
|
-
return
|
|
1445
|
+
return b[t >> 2] = 0, M(0), t - n;
|
|
1446
1446
|
}, ki = (e) => {
|
|
1447
1447
|
for (var t = 0, r = 0; r < e.length; ++r) {
|
|
1448
1448
|
var n = e.charCodeAt(r);
|
|
@@ -1517,7 +1517,7 @@ return ret;
|
|
|
1517
1517
|
return x[r >> 2] = a, t.toWireType(n, e);
|
|
1518
1518
|
}
|
|
1519
1519
|
var $r = function(e) {
|
|
1520
|
-
return
|
|
1520
|
+
return y.handleAsync(() => (e = X.toValue(e), e.then(X.toHandle)));
|
|
1521
1521
|
};
|
|
1522
1522
|
$r.isAsync = !0;
|
|
1523
1523
|
function ji(e, t) {
|
|
@@ -1561,48 +1561,48 @@ return ret;
|
|
|
1561
1561
|
return X.toHandle(r);
|
|
1562
1562
|
}
|
|
1563
1563
|
function Or(e) {
|
|
1564
|
-
return x[e >> 2] +
|
|
1564
|
+
return x[e >> 2] + b[e + 4 >> 2] * 4294967296;
|
|
1565
1565
|
}
|
|
1566
1566
|
var Zi = (e, t) => {
|
|
1567
1567
|
var r = new Date(Or(e) * 1e3);
|
|
1568
|
-
|
|
1568
|
+
b[t >> 2] = r.getUTCSeconds(), M(r.getUTCSeconds()), b[t + 4 >> 2] = r.getUTCMinutes(), M(r.getUTCMinutes()), b[t + 8 >> 2] = r.getUTCHours(), M(r.getUTCHours()), b[t + 12 >> 2] = r.getUTCDate(), M(r.getUTCDate()), b[t + 16 >> 2] = r.getUTCMonth(), M(r.getUTCMonth()), b[t + 20 >> 2] = r.getUTCFullYear() - 1900, M(r.getUTCFullYear() - 1900), b[t + 24 >> 2] = r.getUTCDay(), M(r.getUTCDay());
|
|
1569
1569
|
var n = Date.UTC(r.getUTCFullYear(), 0, 1, 0, 0, 0, 0), a = (r.getTime() - n) / (1e3 * 60 * 60 * 24) | 0;
|
|
1570
|
-
|
|
1570
|
+
b[t + 28 >> 2] = a, M(a);
|
|
1571
1571
|
}, Ge = (e) => e % 4 === 0 && (e % 100 !== 0 || e % 400 === 0), Xi = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335], ea = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334], Rr = (e) => {
|
|
1572
1572
|
var t = Ge(e.getFullYear()), r = t ? Xi : ea, n = r[e.getMonth()] + e.getDate() - 1;
|
|
1573
1573
|
return n;
|
|
1574
1574
|
}, ta = (e, t) => {
|
|
1575
1575
|
var r = new Date(Or(e) * 1e3);
|
|
1576
|
-
|
|
1576
|
+
b[t >> 2] = r.getSeconds(), M(r.getSeconds()), b[t + 4 >> 2] = r.getMinutes(), M(r.getMinutes()), b[t + 8 >> 2] = r.getHours(), M(r.getHours()), b[t + 12 >> 2] = r.getDate(), M(r.getDate()), b[t + 16 >> 2] = r.getMonth(), M(r.getMonth()), b[t + 20 >> 2] = r.getFullYear() - 1900, M(r.getFullYear() - 1900), b[t + 24 >> 2] = r.getDay(), M(r.getDay());
|
|
1577
1577
|
var n = Rr(r) | 0;
|
|
1578
|
-
|
|
1578
|
+
b[t + 28 >> 2] = n, M(n), b[t + 36 >> 2] = -(r.getTimezoneOffset() * 60), M(-(r.getTimezoneOffset() * 60));
|
|
1579
1579
|
var a = new Date(r.getFullYear(), 0, 1), s = new Date(r.getFullYear(), 6, 1).getTimezoneOffset(), o = a.getTimezoneOffset(), l = (s != o && r.getTimezoneOffset() == Math.min(o, s)) | 0;
|
|
1580
|
-
|
|
1580
|
+
b[t + 32 >> 2] = l, M(l);
|
|
1581
1581
|
}, ra = (e) => {
|
|
1582
1582
|
var t = new Date(
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1583
|
+
b[e + 20 >> 2] + 1900,
|
|
1584
|
+
b[e + 16 >> 2],
|
|
1585
|
+
b[e + 12 >> 2],
|
|
1586
|
+
b[e + 8 >> 2],
|
|
1587
|
+
b[e + 4 >> 2],
|
|
1588
|
+
b[e >> 2],
|
|
1589
1589
|
0
|
|
1590
|
-
), r =
|
|
1590
|
+
), r = b[e + 32 >> 2], n = t.getTimezoneOffset(), a = new Date(t.getFullYear(), 0, 1), s = new Date(t.getFullYear(), 6, 1).getTimezoneOffset(), o = a.getTimezoneOffset(), l = Math.min(o, s);
|
|
1591
1591
|
if (r < 0)
|
|
1592
|
-
|
|
1592
|
+
b[e + 32 >> 2] = Number(s != o && l == n), M(Number(s != o && l == n));
|
|
1593
1593
|
else if (r > 0 != (l == n)) {
|
|
1594
1594
|
var d = Math.max(o, s), f = r > 0 ? l : d;
|
|
1595
1595
|
t.setTime(t.getTime() + (f - n) * 6e4);
|
|
1596
1596
|
}
|
|
1597
|
-
|
|
1597
|
+
b[e + 24 >> 2] = t.getDay(), M(t.getDay());
|
|
1598
1598
|
var m = Rr(t) | 0;
|
|
1599
|
-
return
|
|
1599
|
+
return b[e + 28 >> 2] = m, M(m), b[e >> 2] = t.getSeconds(), M(t.getSeconds()), b[e + 4 >> 2] = t.getMinutes(), M(t.getMinutes()), b[e + 8 >> 2] = t.getHours(), M(t.getHours()), b[e + 12 >> 2] = t.getDate(), M(t.getDate()), b[e + 16 >> 2] = t.getMonth(), M(t.getMonth()), b[e + 20 >> 2] = t.getYear(), M(t.getYear()), t.getTime() / 1e3 | 0;
|
|
1600
1600
|
}, kr = (e) => {
|
|
1601
1601
|
var t = Lt(e) + 1, r = ft(t);
|
|
1602
1602
|
return r && Dr(e, r, t), r;
|
|
1603
1603
|
}, na = (e, t, r) => {
|
|
1604
1604
|
var n = new Date().getFullYear(), a = new Date(n, 0, 1), s = new Date(n, 6, 1), o = a.getTimezoneOffset(), l = s.getTimezoneOffset(), d = Math.max(o, l);
|
|
1605
|
-
x[e >> 2] = d * 60, M(d * 60),
|
|
1605
|
+
x[e >> 2] = d * 60, M(d * 60), b[t >> 2] = Number(o != l), M(Number(o != l));
|
|
1606
1606
|
function f(j) {
|
|
1607
1607
|
var V = j.toTimeString().match(/\(([A-Za-z ]+)\)$/);
|
|
1608
1608
|
return V ? V[1] : "GMT";
|
|
@@ -1626,7 +1626,7 @@ return ret;
|
|
|
1626
1626
|
}
|
|
1627
1627
|
}, la = (e) => {
|
|
1628
1628
|
var t = te.length;
|
|
1629
|
-
e = e >>> 0,
|
|
1629
|
+
e = e >>> 0, g(e > t);
|
|
1630
1630
|
var r = xr();
|
|
1631
1631
|
if (e > r)
|
|
1632
1632
|
return C(`Cannot enlarge memory, asked to go up to ${e} bytes, but the limit is ${r} bytes!`), !1;
|
|
@@ -1659,7 +1659,7 @@ return ret;
|
|
|
1659
1659
|
return Qe.strings;
|
|
1660
1660
|
}, ca = (e, t) => {
|
|
1661
1661
|
for (var r = 0; r < e.length; ++r)
|
|
1662
|
-
|
|
1662
|
+
g(e.charCodeAt(r) === (e.charCodeAt(r) & 255)), se[t++ >> 0] = e.charCodeAt(r), He(e.charCodeAt(r));
|
|
1663
1663
|
se[t >> 0] = 0, He(0);
|
|
1664
1664
|
}, fa = (e, t) => {
|
|
1665
1665
|
var r = 0;
|
|
@@ -1679,16 +1679,16 @@ return ret;
|
|
|
1679
1679
|
}, va = (e, t) => {
|
|
1680
1680
|
var r = 0, n = 0, a = 0;
|
|
1681
1681
|
{
|
|
1682
|
-
|
|
1682
|
+
g(e == 0 || e == 1 || e == 2);
|
|
1683
1683
|
var s = 2;
|
|
1684
1684
|
e == 0 ? r = 2 : (e == 1 || e == 2) && (r = 64), a = 1;
|
|
1685
1685
|
}
|
|
1686
|
-
return se[t >> 0] = s, He(s), Se[t + 2 >> 1] = a, Et(a), De = [r >>> 0, (ie = r, +Math.abs(ie) >= 1 ? ie > 0 ? +Math.floor(ie / 4294967296) >>> 0 : ~~+Math.ceil((ie - +(~~ie >>> 0)) / 4294967296) >>> 0 : 0)],
|
|
1686
|
+
return se[t >> 0] = s, He(s), Se[t + 2 >> 1] = a, Et(a), De = [r >>> 0, (ie = r, +Math.abs(ie) >= 1 ? ie > 0 ? +Math.floor(ie / 4294967296) >>> 0 : ~~+Math.ceil((ie - +(~~ie >>> 0)) / 4294967296) >>> 0 : 0)], b[t + 8 >> 2] = De[0], b[t + 12 >> 2] = De[1], dr(r), De = [n >>> 0, (ie = n, +Math.abs(ie) >= 1 ? ie > 0 ? +Math.floor(ie / 4294967296) >>> 0 : ~~+Math.ceil((ie - +(~~ie >>> 0)) / 4294967296) >>> 0 : 0)], b[t + 16 >> 2] = De[0], b[t + 20 >> 2] = De[1], dr(n), 0;
|
|
1687
1687
|
}, ha = (e, t, r, n) => {
|
|
1688
1688
|
J("fd_read called without SYSCALLS_REQUIRE_FILESYSTEM");
|
|
1689
1689
|
}, ma = (e, t, r, n, a) => 70, Ht = [null, [], []], Yt = (e, t) => {
|
|
1690
1690
|
var r = Ht[e];
|
|
1691
|
-
|
|
1691
|
+
g(r), t === 0 || t === 10 ? ((e === 1 ? W : C)(hr(r, 0)), r.length = 0) : r.push(t);
|
|
1692
1692
|
}, pa = () => {
|
|
1693
1693
|
Pa(0), Ht[1].length && Yt(1, 10), Ht[2].length && Yt(2, 10);
|
|
1694
1694
|
}, ga = (e, t, r, n) => {
|
|
@@ -1719,19 +1719,19 @@ return ret;
|
|
|
1719
1719
|
return t && (a.length = s), a;
|
|
1720
1720
|
}
|
|
1721
1721
|
var Ta = (e, t) => {
|
|
1722
|
-
|
|
1722
|
+
g(e.length >= 0, "writeArrayToMemory array must have a length (should be an array or typed array)"), se.set(e, t);
|
|
1723
1723
|
}, Ca = (e, t, r, n) => {
|
|
1724
|
-
var a =
|
|
1725
|
-
tm_sec:
|
|
1726
|
-
tm_min:
|
|
1727
|
-
tm_hour:
|
|
1728
|
-
tm_mday:
|
|
1729
|
-
tm_mon:
|
|
1730
|
-
tm_year:
|
|
1731
|
-
tm_wday:
|
|
1732
|
-
tm_yday:
|
|
1733
|
-
tm_isdst:
|
|
1734
|
-
tm_gmtoff:
|
|
1724
|
+
var a = b[n + 40 >> 2], s = {
|
|
1725
|
+
tm_sec: b[n >> 2],
|
|
1726
|
+
tm_min: b[n + 4 >> 2],
|
|
1727
|
+
tm_hour: b[n + 8 >> 2],
|
|
1728
|
+
tm_mday: b[n + 12 >> 2],
|
|
1729
|
+
tm_mon: b[n + 16 >> 2],
|
|
1730
|
+
tm_year: b[n + 20 >> 2],
|
|
1731
|
+
tm_wday: b[n + 24 >> 2],
|
|
1732
|
+
tm_yday: b[n + 28 >> 2],
|
|
1733
|
+
tm_isdst: b[n + 32 >> 2],
|
|
1734
|
+
tm_gmtoff: b[n + 36 >> 2],
|
|
1735
1735
|
tm_zone: a ? St(a) : ""
|
|
1736
1736
|
}, o = St(r), l = {
|
|
1737
1737
|
"%c": "%a %b %d %H:%M:%S %Y",
|
|
@@ -1921,7 +1921,7 @@ return ret;
|
|
|
1921
1921
|
fd_write: ga,
|
|
1922
1922
|
strftime: Ca
|
|
1923
1923
|
};
|
|
1924
|
-
|
|
1924
|
+
y.instrumentWasmImports(jt), hn();
|
|
1925
1925
|
var ge = D("free"), ft = D("malloc"), Sa = i._main = D("main"), Fa = D("__getTypeName");
|
|
1926
1926
|
i.__embind_initialize_bindings = D("_embind_initialize_bindings");
|
|
1927
1927
|
var Pa = i._fflush = D("fflush"), Nr = function() {
|
|
@@ -2308,7 +2308,7 @@ return ret;
|
|
|
2308
2308
|
dt || Hr(), dt || (Ne = e);
|
|
2309
2309
|
};
|
|
2310
2310
|
function xa() {
|
|
2311
|
-
|
|
2311
|
+
g(be == 0, 'cannot call main when async dependencies remain! (listen on Module["onRuntimeInitialized"])'), g(wt.length == 0, "cannot call main when preRun functions remain to be called");
|
|
2312
2312
|
var e = Sa, t = 0, r = 0;
|
|
2313
2313
|
try {
|
|
2314
2314
|
var n = e(t, r);
|
|
@@ -2404,46 +2404,46 @@ var Jt = {}, Ba = {
|
|
|
2404
2404
|
var H = _ ? _ + S : S;
|
|
2405
2405
|
if (!this._events[H])
|
|
2406
2406
|
return !1;
|
|
2407
|
-
var
|
|
2408
|
-
if (
|
|
2409
|
-
switch (
|
|
2407
|
+
var p = this._events[H], N = arguments.length, W, C;
|
|
2408
|
+
if (p.fn) {
|
|
2409
|
+
switch (p.once && this.removeListener(S, p.fn, void 0, !0), N) {
|
|
2410
2410
|
case 1:
|
|
2411
|
-
return
|
|
2411
|
+
return p.fn.call(p.context), !0;
|
|
2412
2412
|
case 2:
|
|
2413
|
-
return
|
|
2413
|
+
return p.fn.call(p.context, F), !0;
|
|
2414
2414
|
case 3:
|
|
2415
|
-
return
|
|
2415
|
+
return p.fn.call(p.context, F, O), !0;
|
|
2416
2416
|
case 4:
|
|
2417
|
-
return
|
|
2417
|
+
return p.fn.call(p.context, F, O, Q), !0;
|
|
2418
2418
|
case 5:
|
|
2419
|
-
return
|
|
2419
|
+
return p.fn.call(p.context, F, O, Q, z), !0;
|
|
2420
2420
|
case 6:
|
|
2421
|
-
return
|
|
2421
|
+
return p.fn.call(p.context, F, O, Q, z, L), !0;
|
|
2422
2422
|
}
|
|
2423
2423
|
for (C = 1, W = new Array(N - 1); C < N; C++)
|
|
2424
2424
|
W[C - 1] = arguments[C];
|
|
2425
|
-
|
|
2425
|
+
p.fn.apply(p.context, W);
|
|
2426
2426
|
} else {
|
|
2427
|
-
var oe =
|
|
2427
|
+
var oe = p.length, de;
|
|
2428
2428
|
for (C = 0; C < oe; C++)
|
|
2429
|
-
switch (
|
|
2429
|
+
switch (p[C].once && this.removeListener(S, p[C].fn, void 0, !0), N) {
|
|
2430
2430
|
case 1:
|
|
2431
|
-
|
|
2431
|
+
p[C].fn.call(p[C].context);
|
|
2432
2432
|
break;
|
|
2433
2433
|
case 2:
|
|
2434
|
-
|
|
2434
|
+
p[C].fn.call(p[C].context, F);
|
|
2435
2435
|
break;
|
|
2436
2436
|
case 3:
|
|
2437
|
-
|
|
2437
|
+
p[C].fn.call(p[C].context, F, O);
|
|
2438
2438
|
break;
|
|
2439
2439
|
case 4:
|
|
2440
|
-
|
|
2440
|
+
p[C].fn.call(p[C].context, F, O, Q);
|
|
2441
2441
|
break;
|
|
2442
2442
|
default:
|
|
2443
2443
|
if (!W)
|
|
2444
2444
|
for (de = 1, W = new Array(N - 1); de < N; de++)
|
|
2445
2445
|
W[de - 1] = arguments[de];
|
|
2446
|
-
|
|
2446
|
+
p[C].fn.apply(p[C].context, W);
|
|
2447
2447
|
}
|
|
2448
2448
|
}
|
|
2449
2449
|
return !0;
|
|
@@ -2461,9 +2461,9 @@ var Jt = {}, Ba = {
|
|
|
2461
2461
|
if (L.fn)
|
|
2462
2462
|
L.fn === F && (!Q || L.once) && (!O || L.context === O) && k(this, z);
|
|
2463
2463
|
else {
|
|
2464
|
-
for (var H = 0,
|
|
2465
|
-
(L[H].fn !== F || Q && !L[H].once || O && L[H].context !== O) &&
|
|
2466
|
-
|
|
2464
|
+
for (var H = 0, p = [], N = L.length; H < N; H++)
|
|
2465
|
+
(L[H].fn !== F || Q && !L[H].once || O && L[H].context !== O) && p.push(L[H]);
|
|
2466
|
+
p.length ? this._events[z] = p.length === 1 ? p[0] : p : k(this, z);
|
|
2467
2467
|
}
|
|
2468
2468
|
return this;
|
|
2469
2469
|
}, $.prototype.removeAllListeners = function(S) {
|
|
@@ -2585,7 +2585,7 @@ var Y = globalThis && globalThis.__classPrivateFieldSet || function(c, u, _, h,
|
|
|
2585
2585
|
if (typeof u == "function" ? c !== u || !I : !u.has(c))
|
|
2586
2586
|
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
2587
2587
|
return h === "a" ? I.call(c, _) : I ? I.value = _ : u.set(c, _), _;
|
|
2588
|
-
},
|
|
2588
|
+
}, w = globalThis && globalThis.__classPrivateFieldGet || function(c, u, _, h) {
|
|
2589
2589
|
if (_ === "a" && !h)
|
|
2590
2590
|
throw new TypeError("Private accessor was defined without a getter");
|
|
2591
2591
|
if (typeof u == "function" ? c !== u || !h : !u.has(c))
|
|
@@ -2618,111 +2618,111 @@ class eo extends Ga {
|
|
|
2618
2618
|
Y(this, Ze, u.carryoverConcurrencyCount, "f"), Y(this, Xe, u.intervalCap === Number.POSITIVE_INFINITY || u.interval === 0, "f"), Y(this, yt, u.intervalCap, "f"), Y(this, et, u.interval, "f"), Y(this, re, new u.queueClass(), "f"), Y(this, ht, u.queueClass, "f"), this.concurrency = u.concurrency, this.timeout = u.timeout, Y(this, mt, u.throwOnTimeout === !0, "f"), Y(this, Ce, u.autoStart === !1, "f");
|
|
2619
2619
|
}
|
|
2620
2620
|
get concurrency() {
|
|
2621
|
-
return
|
|
2621
|
+
return w(this, tt, "f");
|
|
2622
2622
|
}
|
|
2623
2623
|
set concurrency(u) {
|
|
2624
2624
|
if (!(typeof u == "number" && u >= 1))
|
|
2625
2625
|
throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${u}\` (${typeof u})`);
|
|
2626
|
-
Y(this, tt, u, "f"),
|
|
2626
|
+
Y(this, tt, u, "f"), w(this, B, "m", bt).call(this);
|
|
2627
2627
|
}
|
|
2628
2628
|
async add(u, _ = {}) {
|
|
2629
2629
|
return new Promise((h, I) => {
|
|
2630
2630
|
const i = async () => {
|
|
2631
2631
|
var k, $, E;
|
|
2632
|
-
Y(this, ne, ($ =
|
|
2632
|
+
Y(this, ne, ($ = w(this, ne, "f"), $++, $), "f"), Y(this, Ee, (E = w(this, Ee, "f"), E++, E), "f");
|
|
2633
2633
|
try {
|
|
2634
2634
|
if (!((k = _.signal) === null || k === void 0) && k.aborted) {
|
|
2635
2635
|
I(new Xa("The task was aborted."));
|
|
2636
2636
|
return;
|
|
2637
2637
|
}
|
|
2638
2638
|
const F = await (this.timeout === void 0 && _.timeout === void 0 ? u({ signal: _.signal }) : Ja(Promise.resolve(u({ signal: _.signal })), _.timeout === void 0 ? this.timeout : _.timeout, () => {
|
|
2639
|
-
(_.throwOnTimeout === void 0 ?
|
|
2639
|
+
(_.throwOnTimeout === void 0 ? w(this, mt, "f") : _.throwOnTimeout) && I(Za);
|
|
2640
2640
|
}));
|
|
2641
2641
|
h(F), this.emit("completed", F);
|
|
2642
2642
|
} catch (S) {
|
|
2643
2643
|
I(S), this.emit("error", S);
|
|
2644
2644
|
}
|
|
2645
|
-
|
|
2645
|
+
w(this, B, "m", Zr).call(this);
|
|
2646
2646
|
};
|
|
2647
|
-
|
|
2647
|
+
w(this, re, "f").enqueue(i, _), w(this, B, "m", pt).call(this), this.emit("add");
|
|
2648
2648
|
});
|
|
2649
2649
|
}
|
|
2650
2650
|
async addAll(u, _) {
|
|
2651
2651
|
return Promise.all(u.map(async (h) => this.add(h, _)));
|
|
2652
2652
|
}
|
|
2653
2653
|
start() {
|
|
2654
|
-
return
|
|
2654
|
+
return w(this, Ce, "f") ? (Y(this, Ce, !1, "f"), w(this, B, "m", bt).call(this), this) : this;
|
|
2655
2655
|
}
|
|
2656
2656
|
pause() {
|
|
2657
2657
|
Y(this, Ce, !0, "f");
|
|
2658
2658
|
}
|
|
2659
2659
|
clear() {
|
|
2660
|
-
Y(this, re, new (
|
|
2660
|
+
Y(this, re, new (w(this, ht, "f"))(), "f");
|
|
2661
2661
|
}
|
|
2662
2662
|
async onEmpty() {
|
|
2663
|
-
|
|
2663
|
+
w(this, re, "f").size !== 0 && await w(this, B, "m", gt).call(this, "empty");
|
|
2664
2664
|
}
|
|
2665
2665
|
async onSizeLessThan(u) {
|
|
2666
|
-
|
|
2666
|
+
w(this, re, "f").size < u || await w(this, B, "m", gt).call(this, "next", () => w(this, re, "f").size < u);
|
|
2667
2667
|
}
|
|
2668
2668
|
async onIdle() {
|
|
2669
|
-
|
|
2669
|
+
w(this, ne, "f") === 0 && w(this, re, "f").size === 0 || await w(this, B, "m", gt).call(this, "idle");
|
|
2670
2670
|
}
|
|
2671
2671
|
get size() {
|
|
2672
|
-
return
|
|
2672
|
+
return w(this, re, "f").size;
|
|
2673
2673
|
}
|
|
2674
2674
|
sizeBy(u) {
|
|
2675
|
-
return
|
|
2675
|
+
return w(this, re, "f").filter(u).length;
|
|
2676
2676
|
}
|
|
2677
2677
|
get pending() {
|
|
2678
|
-
return
|
|
2678
|
+
return w(this, ne, "f");
|
|
2679
2679
|
}
|
|
2680
2680
|
get isPaused() {
|
|
2681
|
-
return
|
|
2681
|
+
return w(this, Ce, "f");
|
|
2682
2682
|
}
|
|
2683
2683
|
}
|
|
2684
2684
|
Ze = /* @__PURE__ */ new WeakMap(), Xe = /* @__PURE__ */ new WeakMap(), Ee = /* @__PURE__ */ new WeakMap(), yt = /* @__PURE__ */ new WeakMap(), et = /* @__PURE__ */ new WeakMap(), vt = /* @__PURE__ */ new WeakMap(), ue = /* @__PURE__ */ new WeakMap(), Ke = /* @__PURE__ */ new WeakMap(), re = /* @__PURE__ */ new WeakMap(), ht = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), tt = /* @__PURE__ */ new WeakMap(), Ce = /* @__PURE__ */ new WeakMap(), mt = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new WeakSet(), Vr = function() {
|
|
2685
|
-
return
|
|
2685
|
+
return w(this, Xe, "f") || w(this, Ee, "f") < w(this, yt, "f");
|
|
2686
2686
|
}, Br = function() {
|
|
2687
|
-
return
|
|
2687
|
+
return w(this, ne, "f") < w(this, tt, "f");
|
|
2688
2688
|
}, Zr = function() {
|
|
2689
2689
|
var u;
|
|
2690
|
-
Y(this, ne, (u =
|
|
2690
|
+
Y(this, ne, (u = w(this, ne, "f"), u--, u), "f"), w(this, B, "m", pt).call(this), this.emit("next");
|
|
2691
2691
|
}, Gr = function() {
|
|
2692
|
-
this.emit("empty"),
|
|
2692
|
+
this.emit("empty"), w(this, ne, "f") === 0 && this.emit("idle");
|
|
2693
2693
|
}, Qr = function() {
|
|
2694
|
-
|
|
2694
|
+
w(this, B, "m", Bt).call(this), w(this, B, "m", Vt).call(this), Y(this, Ke, void 0, "f");
|
|
2695
2695
|
}, Jr = function() {
|
|
2696
2696
|
const u = Date.now();
|
|
2697
|
-
if (
|
|
2698
|
-
const _ =
|
|
2697
|
+
if (w(this, ue, "f") === void 0) {
|
|
2698
|
+
const _ = w(this, vt, "f") - u;
|
|
2699
2699
|
if (_ < 0)
|
|
2700
|
-
Y(this, Ee,
|
|
2700
|
+
Y(this, Ee, w(this, Ze, "f") ? w(this, ne, "f") : 0, "f");
|
|
2701
2701
|
else
|
|
2702
|
-
return
|
|
2703
|
-
|
|
2702
|
+
return w(this, Ke, "f") === void 0 && Y(this, Ke, setTimeout(() => {
|
|
2703
|
+
w(this, B, "m", Qr).call(this);
|
|
2704
2704
|
}, _), "f"), !0;
|
|
2705
2705
|
}
|
|
2706
2706
|
return !1;
|
|
2707
2707
|
}, pt = function() {
|
|
2708
|
-
if (
|
|
2709
|
-
return
|
|
2710
|
-
if (!
|
|
2711
|
-
const u = !
|
|
2712
|
-
if (
|
|
2713
|
-
const _ =
|
|
2714
|
-
return _ ? (this.emit("active"), _(), u &&
|
|
2708
|
+
if (w(this, re, "f").size === 0)
|
|
2709
|
+
return w(this, ue, "f") && clearInterval(w(this, ue, "f")), Y(this, ue, void 0, "f"), w(this, B, "m", Gr).call(this), !1;
|
|
2710
|
+
if (!w(this, Ce, "f")) {
|
|
2711
|
+
const u = !w(this, B, "a", Jr);
|
|
2712
|
+
if (w(this, B, "a", Vr) && w(this, B, "a", Br)) {
|
|
2713
|
+
const _ = w(this, re, "f").dequeue();
|
|
2714
|
+
return _ ? (this.emit("active"), _(), u && w(this, B, "m", Vt).call(this), !0) : !1;
|
|
2715
2715
|
}
|
|
2716
2716
|
}
|
|
2717
2717
|
return !1;
|
|
2718
2718
|
}, Vt = function() {
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
},
|
|
2719
|
+
w(this, Xe, "f") || w(this, ue, "f") !== void 0 || (Y(this, ue, setInterval(() => {
|
|
2720
|
+
w(this, B, "m", Bt).call(this);
|
|
2721
|
+
}, w(this, et, "f")), "f"), Y(this, vt, Date.now() + w(this, et, "f"), "f"));
|
|
2722
2722
|
}, Bt = function() {
|
|
2723
|
-
|
|
2723
|
+
w(this, Ee, "f") === 0 && w(this, ne, "f") === 0 && w(this, ue, "f") && (clearInterval(w(this, ue, "f")), Y(this, ue, void 0, "f")), Y(this, Ee, w(this, Ze, "f") ? w(this, ne, "f") : 0, "f"), w(this, B, "m", bt).call(this);
|
|
2724
2724
|
}, bt = function() {
|
|
2725
|
-
for (;
|
|
2725
|
+
for (; w(this, B, "m", pt).call(this); )
|
|
2726
2726
|
;
|
|
2727
2727
|
}, gt = async function(u, _) {
|
|
2728
2728
|
return new Promise((h) => {
|
|
@@ -2740,25 +2740,23 @@ let qe;
|
|
|
2740
2740
|
const to = ja(async ({ publicPath: c, length: u, bufferSize: _, randomRead: h, streamRead: I, clearStream: i, attachment: k, subtitle: $ }) => {
|
|
2741
2741
|
qe || (qe = await qr(c));
|
|
2742
2742
|
let E = new Uint8Array(0), S, F, O;
|
|
2743
|
-
const Q = () => {
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
}));
|
|
2747
|
-
}, z = () => new qe.Remuxer({
|
|
2743
|
+
const Q = () => O || (O = new Promise((p, N) => {
|
|
2744
|
+
S = p, F = N;
|
|
2745
|
+
}), O), z = () => new qe.Remuxer({
|
|
2748
2746
|
promise: Promise.resolve(),
|
|
2749
2747
|
length: u,
|
|
2750
2748
|
bufferSize: _,
|
|
2751
|
-
error: (
|
|
2752
|
-
console.log("worker error",
|
|
2749
|
+
error: (p, N) => {
|
|
2750
|
+
console.log("worker error", p, N);
|
|
2753
2751
|
},
|
|
2754
|
-
subtitle: (
|
|
2755
|
-
$(
|
|
2752
|
+
subtitle: (p, N, W, ...C) => {
|
|
2753
|
+
$(p, N, W, ...C);
|
|
2756
2754
|
},
|
|
2757
|
-
attachment: (
|
|
2755
|
+
attachment: (p, N, W) => {
|
|
2758
2756
|
const C = new Uint8Array(W), oe = C.buffer.slice(C.byteOffset, C.byteOffset + C.byteLength);
|
|
2759
|
-
k(
|
|
2757
|
+
k(p, N, oe);
|
|
2760
2758
|
},
|
|
2761
|
-
streamRead: async (
|
|
2759
|
+
streamRead: async (p) => Promise.race([
|
|
2762
2760
|
new Promise((N) => {
|
|
2763
2761
|
H.on("add", function W() {
|
|
2764
2762
|
H.size !== 0 && (N(void 0), H.off("add", W));
|
|
@@ -2768,24 +2766,24 @@ const to = ja(async ({ publicPath: c, length: u, bufferSize: _, randomRead: h, s
|
|
|
2768
2766
|
done: !1,
|
|
2769
2767
|
cancelled: !0
|
|
2770
2768
|
})),
|
|
2771
|
-
I(Number(
|
|
2769
|
+
I(Number(p)).then(({ buffer: N, done: W, cancelled: C }) => ({
|
|
2772
2770
|
buffer: N ? new Uint8Array(N) : void 0,
|
|
2773
2771
|
done: W,
|
|
2774
2772
|
cancelled: C
|
|
2775
2773
|
}))
|
|
2776
2774
|
]),
|
|
2777
2775
|
clearStream: () => i(),
|
|
2778
|
-
randomRead: async (
|
|
2776
|
+
randomRead: async (p, N) => h(Number(p), N).then((W) => ({
|
|
2779
2777
|
buffer: W ? new Uint8Array(W) : void 0,
|
|
2780
2778
|
done: !1,
|
|
2781
2779
|
cancelled: !1
|
|
2782
2780
|
})),
|
|
2783
|
-
write: (
|
|
2784
|
-
const N = new Uint8Array(E.byteLength +
|
|
2785
|
-
N.set(E), N.set(new Uint8Array(
|
|
2781
|
+
write: (p) => {
|
|
2782
|
+
const N = new Uint8Array(E.byteLength + p.byteLength);
|
|
2783
|
+
N.set(E), N.set(new Uint8Array(p), E.byteLength), E = N;
|
|
2786
2784
|
},
|
|
2787
|
-
flush: async (
|
|
2788
|
-
const oe = Number(
|
|
2785
|
+
flush: async (p, N, W, C) => {
|
|
2786
|
+
const oe = Number(p), de = Number(N);
|
|
2789
2787
|
if (!E.byteLength)
|
|
2790
2788
|
return !0;
|
|
2791
2789
|
if (!S)
|
|
@@ -2800,19 +2798,26 @@ const to = ja(async ({ publicPath: c, length: u, bufferSize: _, randomRead: h, s
|
|
|
2800
2798
|
}), S = void 0, F = void 0, O = void 0, E = new Uint8Array(0), !1;
|
|
2801
2799
|
},
|
|
2802
2800
|
exit: () => {
|
|
2803
|
-
const
|
|
2804
|
-
S = void 0, F = void 0, O = void 0,
|
|
2801
|
+
const p = F;
|
|
2802
|
+
S = void 0, F = void 0, O = void 0, p?.(new Error("exit"));
|
|
2805
2803
|
}
|
|
2806
2804
|
});
|
|
2807
2805
|
let L = z();
|
|
2808
2806
|
const H = new eo({ concurrency: 1 });
|
|
2809
2807
|
return {
|
|
2810
|
-
init: async () =>
|
|
2808
|
+
init: async () => {
|
|
2809
|
+
E = new Uint8Array(0), qe = await qr(c), L = z();
|
|
2810
|
+
const p = Q();
|
|
2811
|
+
return L.init(), p;
|
|
2812
|
+
},
|
|
2811
2813
|
destroy: () => {
|
|
2812
2814
|
L.destroy(), L = void 0, qe = void 0, E = new Uint8Array(0);
|
|
2813
2815
|
},
|
|
2814
|
-
seek: (
|
|
2815
|
-
read: () => H.add(async () =>
|
|
2816
|
+
seek: (p) => H.add(() => L.seek(p)),
|
|
2817
|
+
read: () => H.add(async () => {
|
|
2818
|
+
const p = Q();
|
|
2819
|
+
return L.read(), p;
|
|
2820
|
+
}),
|
|
2816
2821
|
getInfo: async () => L.getInfo()
|
|
2817
2822
|
};
|
|
2818
2823
|
}), ro = {
|