@npaw/forge-web 9.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,10 @@
1
+ Copyright (C) NPAW - All Rights Reserved
2
+
3
+ This software is protected under international copyright law. All rights
4
+ reserved and protected by the copyright holders. This software is confidential
5
+ and only available to authorized individuals with the permission of the
6
+ copyright holders. If you obtained this software and do not have permission,
7
+ please contact the copyright holders and delete it.
8
+
9
+ Use of this software requires an active NPAW commercial agreement. See
10
+ https://npaw.com for licensing and support.
package/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # @npaw/forge-web
2
+
3
+ NPAW Forge analytics for Web and TV browsers: application sessions, video and
4
+ ad analytics, network capture, autocapture, and Web Vitals, powered by the
5
+ shared Forge analytics core (WASM).
6
+
7
+ Use of this package requires an active NPAW commercial agreement. See
8
+ [LICENSE](./LICENSE).
9
+
10
+ ## Install
11
+
12
+ ```sh
13
+ npm install @npaw/forge-web
14
+ ```
15
+
16
+ ```ts
17
+ import { NPAWForge, HlsjsAdapter } from "@npaw/forge-web";
18
+
19
+ const forge = await NPAWForge.create({
20
+ accountCode: "<account-code>",
21
+ appName: "Player App",
22
+ appReleaseVersion: "1.0.0",
23
+ startSessionOnInitialize: true,
24
+ });
25
+
26
+ const video = await forge.videoBuilder()
27
+ .setIdentifier("main")
28
+ .setMetadata({ title: "Episode 1", contentType: "vod" })
29
+ .setPlayerAdapter(new HlsjsAdapter(hls))
30
+ .build();
31
+ ```
32
+
33
+ A script-tag IIFE build with `data-*` bootstrap configuration is also
34
+ distributed for TV/browser targets without a bundler.
35
+
36
+ ## Documentation
37
+
38
+ Integration guides, the full adapter catalog (HTML5, Shaka, Hls.js, dash.js,
39
+ Video.js, Bitmovin, THEOplayer, IMA, and more), migration notes, and
40
+ troubleshooting are available from NPAW. Contact your NPAW representative or
41
+ visit https://npaw.com for access and support.
@@ -0,0 +1,52 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ export function forgeRuntimeCreate(config: any): any;
5
+
6
+ export function forgeRuntimeDestroy(handle: number): any;
7
+
8
+ export function forgeRuntimeProcess(handle: number, command: any): any;
9
+
10
+ export function forgeRuntimeRelease(handle: number): any;
11
+
12
+ export function forgeRuntimeVersion(): string;
13
+
14
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
15
+
16
+ export interface InitOutput {
17
+ readonly memory: WebAssembly.Memory;
18
+ readonly forgeRuntimeCreate: (a: any) => any;
19
+ readonly forgeRuntimeDestroy: (a: number) => any;
20
+ readonly forgeRuntimeProcess: (a: number, b: any) => any;
21
+ readonly forgeRuntimeRelease: (a: number) => any;
22
+ readonly forgeRuntimeVersion: () => [number, number];
23
+ readonly __wbindgen_malloc: (a: number, b: number) => number;
24
+ readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
25
+ readonly __wbindgen_exn_store: (a: number) => void;
26
+ readonly __externref_table_alloc: () => number;
27
+ readonly __wbindgen_externrefs: WebAssembly.Table;
28
+ readonly __wbindgen_free: (a: number, b: number, c: number) => void;
29
+ readonly __wbindgen_start: () => void;
30
+ }
31
+
32
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
33
+
34
+ /**
35
+ * Instantiates the given `module`, which can either be bytes or
36
+ * a precompiled `WebAssembly.Module`.
37
+ *
38
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
39
+ *
40
+ * @returns {InitOutput}
41
+ */
42
+ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
43
+
44
+ /**
45
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
46
+ * for everything else, calls `WebAssembly.instantiate` directly.
47
+ *
48
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
49
+ *
50
+ * @returns {Promise<InitOutput>}
51
+ */
52
+ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
@@ -0,0 +1,563 @@
1
+ /* @ts-self-types="./forge_kernel_wasm.d.ts" */
2
+
3
+ /**
4
+ * @param {any} config
5
+ * @returns {any}
6
+ */
7
+ export function forgeRuntimeCreate(config) {
8
+ const ret = wasm.forgeRuntimeCreate(config);
9
+ return ret;
10
+ }
11
+
12
+ /**
13
+ * @param {number} handle
14
+ * @returns {any}
15
+ */
16
+ export function forgeRuntimeDestroy(handle) {
17
+ const ret = wasm.forgeRuntimeDestroy(handle);
18
+ return ret;
19
+ }
20
+
21
+ /**
22
+ * @param {number} handle
23
+ * @param {any} command
24
+ * @returns {any}
25
+ */
26
+ export function forgeRuntimeProcess(handle, command) {
27
+ const ret = wasm.forgeRuntimeProcess(handle, command);
28
+ return ret;
29
+ }
30
+
31
+ /**
32
+ * @param {number} handle
33
+ * @returns {any}
34
+ */
35
+ export function forgeRuntimeRelease(handle) {
36
+ const ret = wasm.forgeRuntimeRelease(handle);
37
+ return ret;
38
+ }
39
+
40
+ /**
41
+ * @returns {string}
42
+ */
43
+ export function forgeRuntimeVersion() {
44
+ let deferred1_0;
45
+ let deferred1_1;
46
+ try {
47
+ const ret = wasm.forgeRuntimeVersion();
48
+ deferred1_0 = ret[0];
49
+ deferred1_1 = ret[1];
50
+ return getStringFromWasm0(ret[0], ret[1]);
51
+ } finally {
52
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
53
+ }
54
+ }
55
+ function __wbg_get_imports() {
56
+ const import0 = {
57
+ __proto__: null,
58
+ __wbg_Error_ef53bc310eb298a0: function(arg0, arg1) {
59
+ const ret = Error(getStringFromWasm0(arg0, arg1));
60
+ return ret;
61
+ },
62
+ __wbg_Number_6b506e6536831eaa: function(arg0) {
63
+ const ret = Number(arg0);
64
+ return ret;
65
+ },
66
+ __wbg_String_8564e559799eccda: function(arg0, arg1) {
67
+ const ret = String(arg1);
68
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
69
+ const len1 = WASM_VECTOR_LEN;
70
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
71
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
72
+ },
73
+ __wbg___wbindgen_bigint_get_as_i64_38130e98eecd467d: function(arg0, arg1) {
74
+ const v = arg1;
75
+ const ret = typeof(v) === 'bigint' ? v : undefined;
76
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
77
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
78
+ },
79
+ __wbg___wbindgen_boolean_get_1a45e2c38d4d41b9: function(arg0) {
80
+ const v = arg0;
81
+ const ret = typeof(v) === 'boolean' ? v : undefined;
82
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
83
+ },
84
+ __wbg___wbindgen_debug_string_0accd80f45e5faa2: function(arg0, arg1) {
85
+ const ret = debugString(arg1);
86
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
87
+ const len1 = WASM_VECTOR_LEN;
88
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
89
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
90
+ },
91
+ __wbg___wbindgen_in_70a403a56e771704: function(arg0, arg1) {
92
+ const ret = arg0 in arg1;
93
+ return ret;
94
+ },
95
+ __wbg___wbindgen_is_bigint_6ffd6468a9bc44b9: function(arg0) {
96
+ const ret = typeof(arg0) === 'bigint';
97
+ return ret;
98
+ },
99
+ __wbg___wbindgen_is_function_754e9f305ff6029e: function(arg0) {
100
+ const ret = typeof(arg0) === 'function';
101
+ return ret;
102
+ },
103
+ __wbg___wbindgen_is_object_56732c2bc353f41d: function(arg0) {
104
+ const val = arg0;
105
+ const ret = typeof(val) === 'object' && val !== null;
106
+ return ret;
107
+ },
108
+ __wbg___wbindgen_is_string_c236cabd84a4d769: function(arg0) {
109
+ const ret = typeof(arg0) === 'string';
110
+ return ret;
111
+ },
112
+ __wbg___wbindgen_is_undefined_67b456be8673d3d7: function(arg0) {
113
+ const ret = arg0 === undefined;
114
+ return ret;
115
+ },
116
+ __wbg___wbindgen_jsval_eq_1068e624fa87f6ab: function(arg0, arg1) {
117
+ const ret = arg0 === arg1;
118
+ return ret;
119
+ },
120
+ __wbg___wbindgen_jsval_loose_eq_2c56564c75129511: function(arg0, arg1) {
121
+ const ret = arg0 == arg1;
122
+ return ret;
123
+ },
124
+ __wbg___wbindgen_number_get_9bb1761122181af2: function(arg0, arg1) {
125
+ const obj = arg1;
126
+ const ret = typeof(obj) === 'number' ? obj : undefined;
127
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
128
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
129
+ },
130
+ __wbg___wbindgen_string_get_72bdf95d3ae505b1: function(arg0, arg1) {
131
+ const obj = arg1;
132
+ const ret = typeof(obj) === 'string' ? obj : undefined;
133
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
134
+ var len1 = WASM_VECTOR_LEN;
135
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
136
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
137
+ },
138
+ __wbg___wbindgen_throw_1506f2235d1bdba0: function(arg0, arg1) {
139
+ throw new Error(getStringFromWasm0(arg0, arg1));
140
+ },
141
+ __wbg_call_8a89609d89f6608a: function() { return handleError(function (arg0, arg1) {
142
+ const ret = arg0.call(arg1);
143
+ return ret;
144
+ }, arguments); },
145
+ __wbg_done_60cf307fcc680536: function(arg0) {
146
+ const ret = arg0.done;
147
+ return ret;
148
+ },
149
+ __wbg_entries_04b37a02507f1713: function(arg0) {
150
+ const ret = Object.entries(arg0);
151
+ return ret;
152
+ },
153
+ __wbg_get_1f8f054ddbaa7db2: function() { return handleError(function (arg0, arg1) {
154
+ const ret = Reflect.get(arg0, arg1);
155
+ return ret;
156
+ }, arguments); },
157
+ __wbg_get_2b48c7d0d006a781: function(arg0, arg1) {
158
+ const ret = arg0[arg1 >>> 0];
159
+ return ret;
160
+ },
161
+ __wbg_get_unchecked_33f6e5c9e2f2d6b2: function(arg0, arg1) {
162
+ const ret = arg0[arg1 >>> 0];
163
+ return ret;
164
+ },
165
+ __wbg_get_with_ref_key_6412cf3094599694: function(arg0, arg1) {
166
+ const ret = arg0[arg1];
167
+ return ret;
168
+ },
169
+ __wbg_instanceof_ArrayBuffer_8f49811467741499: function(arg0) {
170
+ let result;
171
+ try {
172
+ result = arg0 instanceof ArrayBuffer;
173
+ } catch (_) {
174
+ result = false;
175
+ }
176
+ const ret = result;
177
+ return ret;
178
+ },
179
+ __wbg_instanceof_Map_9fc06d9a951bcee6: function(arg0) {
180
+ let result;
181
+ try {
182
+ result = arg0 instanceof Map;
183
+ } catch (_) {
184
+ result = false;
185
+ }
186
+ const ret = result;
187
+ return ret;
188
+ },
189
+ __wbg_instanceof_Uint8Array_86f30649f63ef9c2: function(arg0) {
190
+ let result;
191
+ try {
192
+ result = arg0 instanceof Uint8Array;
193
+ } catch (_) {
194
+ result = false;
195
+ }
196
+ const ret = result;
197
+ return ret;
198
+ },
199
+ __wbg_isArray_67c2c9c4313f4448: function(arg0) {
200
+ const ret = Array.isArray(arg0);
201
+ return ret;
202
+ },
203
+ __wbg_isSafeInteger_66acec27e09e99a7: function(arg0) {
204
+ const ret = Number.isSafeInteger(arg0);
205
+ return ret;
206
+ },
207
+ __wbg_iterator_8732428d309e270e: function() {
208
+ const ret = Symbol.iterator;
209
+ return ret;
210
+ },
211
+ __wbg_length_4a591ecaa01354d9: function(arg0) {
212
+ const ret = arg0.length;
213
+ return ret;
214
+ },
215
+ __wbg_length_66f1a4b2e9026940: function(arg0) {
216
+ const ret = arg0.length;
217
+ return ret;
218
+ },
219
+ __wbg_new_578aeef4b6b94378: function(arg0) {
220
+ const ret = new Uint8Array(arg0);
221
+ return ret;
222
+ },
223
+ __wbg_new_622fc80556be2e26: function() {
224
+ const ret = new Map();
225
+ return ret;
226
+ },
227
+ __wbg_new_ce1ab61c1c2b300d: function() {
228
+ const ret = new Object();
229
+ return ret;
230
+ },
231
+ __wbg_new_d90091b82fdf5b91: function() {
232
+ const ret = new Array();
233
+ return ret;
234
+ },
235
+ __wbg_next_9e03acdf51c4960d: function(arg0) {
236
+ const ret = arg0.next;
237
+ return ret;
238
+ },
239
+ __wbg_next_eb8ca7351fa27906: function() { return handleError(function (arg0) {
240
+ const ret = arg0.next();
241
+ return ret;
242
+ }, arguments); },
243
+ __wbg_prototypesetcall_3249fc62a0fafa30: function(arg0, arg1, arg2) {
244
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
245
+ },
246
+ __wbg_set_52b1e1eb5bed906a: function(arg0, arg1, arg2) {
247
+ const ret = arg0.set(arg1, arg2);
248
+ return ret;
249
+ },
250
+ __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
251
+ arg0[arg1] = arg2;
252
+ },
253
+ __wbg_set_dca99999bba88a9a: function(arg0, arg1, arg2) {
254
+ arg0[arg1 >>> 0] = arg2;
255
+ },
256
+ __wbg_value_f3625092ee4b37f4: function(arg0) {
257
+ const ret = arg0.value;
258
+ return ret;
259
+ },
260
+ __wbindgen_cast_0000000000000001: function(arg0) {
261
+ // Cast intrinsic for `F64 -> Externref`.
262
+ const ret = arg0;
263
+ return ret;
264
+ },
265
+ __wbindgen_cast_0000000000000002: function(arg0) {
266
+ // Cast intrinsic for `I64 -> Externref`.
267
+ const ret = arg0;
268
+ return ret;
269
+ },
270
+ __wbindgen_cast_0000000000000003: function(arg0, arg1) {
271
+ // Cast intrinsic for `Ref(String) -> Externref`.
272
+ const ret = getStringFromWasm0(arg0, arg1);
273
+ return ret;
274
+ },
275
+ __wbindgen_cast_0000000000000004: function(arg0) {
276
+ // Cast intrinsic for `U64 -> Externref`.
277
+ const ret = BigInt.asUintN(64, arg0);
278
+ return ret;
279
+ },
280
+ __wbindgen_init_externref_table: function() {
281
+ const table = wasm.__wbindgen_externrefs;
282
+ const offset = table.grow(4);
283
+ table.set(0, undefined);
284
+ table.set(offset + 0, undefined);
285
+ table.set(offset + 1, null);
286
+ table.set(offset + 2, true);
287
+ table.set(offset + 3, false);
288
+ },
289
+ };
290
+ return {
291
+ __proto__: null,
292
+ "./forge_kernel_wasm_bg.js": import0,
293
+ };
294
+ }
295
+
296
+ function addToExternrefTable0(obj) {
297
+ const idx = wasm.__externref_table_alloc();
298
+ wasm.__wbindgen_externrefs.set(idx, obj);
299
+ return idx;
300
+ }
301
+
302
+ function debugString(val) {
303
+ // primitive types
304
+ const type = typeof val;
305
+ if (type == 'number' || type == 'boolean' || val == null) {
306
+ return `${val}`;
307
+ }
308
+ if (type == 'string') {
309
+ return `"${val}"`;
310
+ }
311
+ if (type == 'symbol') {
312
+ const description = val.description;
313
+ if (description == null) {
314
+ return 'Symbol';
315
+ } else {
316
+ return `Symbol(${description})`;
317
+ }
318
+ }
319
+ if (type == 'function') {
320
+ const name = val.name;
321
+ if (typeof name == 'string' && name.length > 0) {
322
+ return `Function(${name})`;
323
+ } else {
324
+ return 'Function';
325
+ }
326
+ }
327
+ // objects
328
+ if (Array.isArray(val)) {
329
+ const length = val.length;
330
+ let debug = '[';
331
+ if (length > 0) {
332
+ debug += debugString(val[0]);
333
+ }
334
+ for(let i = 1; i < length; i++) {
335
+ debug += ', ' + debugString(val[i]);
336
+ }
337
+ debug += ']';
338
+ return debug;
339
+ }
340
+ // Test for built-in
341
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
342
+ let className;
343
+ if (builtInMatches && builtInMatches.length > 1) {
344
+ className = builtInMatches[1];
345
+ } else {
346
+ // Failed to match the standard '[object ClassName]'
347
+ return toString.call(val);
348
+ }
349
+ if (className == 'Object') {
350
+ // we're a user defined class or Object
351
+ // JSON.stringify avoids problems with cycles, and is generally much
352
+ // easier than looping through ownProperties of `val`.
353
+ try {
354
+ return 'Object(' + JSON.stringify(val) + ')';
355
+ } catch (_) {
356
+ return 'Object';
357
+ }
358
+ }
359
+ // errors
360
+ if (val instanceof Error) {
361
+ return `${val.name}: ${val.message}\n${val.stack}`;
362
+ }
363
+ // TODO we could test for more things here, like `Set`s and `Map`s.
364
+ return className;
365
+ }
366
+
367
+ function getArrayU8FromWasm0(ptr, len) {
368
+ ptr = ptr >>> 0;
369
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
370
+ }
371
+
372
+ let cachedDataViewMemory0 = null;
373
+ function getDataViewMemory0() {
374
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
375
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
376
+ }
377
+ return cachedDataViewMemory0;
378
+ }
379
+
380
+ function getStringFromWasm0(ptr, len) {
381
+ return decodeText(ptr >>> 0, len);
382
+ }
383
+
384
+ let cachedUint8ArrayMemory0 = null;
385
+ function getUint8ArrayMemory0() {
386
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
387
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
388
+ }
389
+ return cachedUint8ArrayMemory0;
390
+ }
391
+
392
+ function handleError(f, args) {
393
+ try {
394
+ return f.apply(this, args);
395
+ } catch (e) {
396
+ const idx = addToExternrefTable0(e);
397
+ wasm.__wbindgen_exn_store(idx);
398
+ }
399
+ }
400
+
401
+ function isLikeNone(x) {
402
+ return x === undefined || x === null;
403
+ }
404
+
405
+ function passStringToWasm0(arg, malloc, realloc) {
406
+ if (realloc === undefined) {
407
+ const buf = cachedTextEncoder.encode(arg);
408
+ const ptr = malloc(buf.length, 1) >>> 0;
409
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
410
+ WASM_VECTOR_LEN = buf.length;
411
+ return ptr;
412
+ }
413
+
414
+ let len = arg.length;
415
+ let ptr = malloc(len, 1) >>> 0;
416
+
417
+ const mem = getUint8ArrayMemory0();
418
+
419
+ let offset = 0;
420
+
421
+ for (; offset < len; offset++) {
422
+ const code = arg.charCodeAt(offset);
423
+ if (code > 0x7F) break;
424
+ mem[ptr + offset] = code;
425
+ }
426
+ if (offset !== len) {
427
+ if (offset !== 0) {
428
+ arg = arg.slice(offset);
429
+ }
430
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
431
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
432
+ const ret = cachedTextEncoder.encodeInto(arg, view);
433
+
434
+ offset += ret.written;
435
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
436
+ }
437
+
438
+ WASM_VECTOR_LEN = offset;
439
+ return ptr;
440
+ }
441
+
442
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
443
+ cachedTextDecoder.decode();
444
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
445
+ let numBytesDecoded = 0;
446
+ function decodeText(ptr, len) {
447
+ numBytesDecoded += len;
448
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
449
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
450
+ cachedTextDecoder.decode();
451
+ numBytesDecoded = len;
452
+ }
453
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
454
+ }
455
+
456
+ const cachedTextEncoder = new TextEncoder();
457
+
458
+ if (!('encodeInto' in cachedTextEncoder)) {
459
+ cachedTextEncoder.encodeInto = function (arg, view) {
460
+ const buf = cachedTextEncoder.encode(arg);
461
+ view.set(buf);
462
+ return {
463
+ read: arg.length,
464
+ written: buf.length
465
+ };
466
+ };
467
+ }
468
+
469
+ let WASM_VECTOR_LEN = 0;
470
+
471
+ let wasmModule, wasmInstance, wasm;
472
+ function __wbg_finalize_init(instance, module) {
473
+ wasmInstance = instance;
474
+ wasm = instance.exports;
475
+ wasmModule = module;
476
+ cachedDataViewMemory0 = null;
477
+ cachedUint8ArrayMemory0 = null;
478
+ wasm.__wbindgen_start();
479
+ return wasm;
480
+ }
481
+
482
+ async function __wbg_load(module, imports) {
483
+ if (typeof Response === 'function' && module instanceof Response) {
484
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
485
+ try {
486
+ return await WebAssembly.instantiateStreaming(module, imports);
487
+ } catch (e) {
488
+ const validResponse = module.ok && expectedResponseType(module.type);
489
+
490
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
491
+ console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
492
+
493
+ } else { throw e; }
494
+ }
495
+ }
496
+
497
+ const bytes = await module.arrayBuffer();
498
+ return await WebAssembly.instantiate(bytes, imports);
499
+ } else {
500
+ const instance = await WebAssembly.instantiate(module, imports);
501
+
502
+ if (instance instanceof WebAssembly.Instance) {
503
+ return { instance, module };
504
+ } else {
505
+ return instance;
506
+ }
507
+ }
508
+
509
+ function expectedResponseType(type) {
510
+ switch (type) {
511
+ case 'basic': case 'cors': case 'default': return true;
512
+ }
513
+ return false;
514
+ }
515
+ }
516
+
517
+ function initSync(module) {
518
+ if (wasm !== undefined) return wasm;
519
+
520
+
521
+ if (module !== undefined) {
522
+ if (Object.getPrototypeOf(module) === Object.prototype) {
523
+ ({module} = module)
524
+ } else {
525
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
526
+ }
527
+ }
528
+
529
+ const imports = __wbg_get_imports();
530
+ if (!(module instanceof WebAssembly.Module)) {
531
+ module = new WebAssembly.Module(module);
532
+ }
533
+ const instance = new WebAssembly.Instance(module, imports);
534
+ return __wbg_finalize_init(instance, module);
535
+ }
536
+
537
+ async function __wbg_init(module_or_path) {
538
+ if (wasm !== undefined) return wasm;
539
+
540
+
541
+ if (module_or_path !== undefined) {
542
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
543
+ ({module_or_path} = module_or_path)
544
+ } else {
545
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
546
+ }
547
+ }
548
+
549
+ if (module_or_path === undefined) {
550
+ module_or_path = new URL('forge_kernel_wasm_bg.wasm', import.meta.url);
551
+ }
552
+ const imports = __wbg_get_imports();
553
+
554
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
555
+ module_or_path = fetch(module_or_path);
556
+ }
557
+
558
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
559
+
560
+ return __wbg_finalize_init(instance, module);
561
+ }
562
+
563
+ export { initSync, __wbg_init as default };
Binary file
@@ -0,0 +1,15 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ export const memory: WebAssembly.Memory;
4
+ export const forgeRuntimeCreate: (a: any) => any;
5
+ export const forgeRuntimeDestroy: (a: number) => any;
6
+ export const forgeRuntimeProcess: (a: number, b: any) => any;
7
+ export const forgeRuntimeRelease: (a: number) => any;
8
+ export const forgeRuntimeVersion: () => [number, number];
9
+ export const __wbindgen_malloc: (a: number, b: number) => number;
10
+ export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
11
+ export const __wbindgen_exn_store: (a: number) => void;
12
+ export const __externref_table_alloc: () => number;
13
+ export const __wbindgen_externrefs: WebAssembly.Table;
14
+ export const __wbindgen_free: (a: number, b: number, c: number) => void;
15
+ export const __wbindgen_start: () => void;