@contentauth/c2pa-wasm 0.1.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/package.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "@contentauth/c2pa-wasm",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "module": "./pkg/c2pa.js",
6
+ "types": "./pkg/c2pa.d.ts",
7
+ "files": [
8
+ "pkg/**/*"
9
+ ],
10
+ "exports": {
11
+ ".": {
12
+ "types": "./pkg/c2pa.d.ts",
13
+ "import": "./pkg/c2pa.js",
14
+ "default": "./pkg/c2pa.js"
15
+ },
16
+ "./c2pa.wasm": "./pkg/c2pa_bg.wasm",
17
+ "./package.json": "./package.json",
18
+ "./assets/c2pa_bg.wasm": "./pkg/c2pa_bg.wasm",
19
+ "./assets/c2pa_bg.wasm.d.ts": "./pkg/c2pa_bg.wasm.d.ts"
20
+ }
21
+ }
package/pkg/c2pa.d.ts ADDED
@@ -0,0 +1,86 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Accepts a JSON-serialized string to be loaded as c2pa-rs settings.
5
+ */
6
+ export function loadSettings(settings: string): void;
7
+ /**
8
+ * Called when the WASM binary is initialized.
9
+ */
10
+ export function run(): void;
11
+ /**
12
+ * Wraps a `c2pa::Reader`.
13
+ */
14
+ export class WasmReader {
15
+ private constructor();
16
+ free(): void;
17
+ /**
18
+ * Attempts to create a new `WasmReader` from an asset format and `Blob` of the asset's bytes.
19
+ */
20
+ static fromBlob(format: string, blob: Blob): Promise<WasmReader>;
21
+ /**
22
+ * Attempts to create a new `WasmReader` from an asset format, a `Blob` of the bytes of the initial segment, and a fragment `Blob`.
23
+ */
24
+ static fromBlobFragment(format: string, init: Blob, fragment: Blob): Promise<WasmReader>;
25
+ /**
26
+ * Returns a JSON representation of the asset's manifest store.
27
+ */
28
+ json(): string;
29
+ /**
30
+ * Returns the label of the asset's active manifest.
31
+ */
32
+ activeLabel(): string | undefined;
33
+ /**
34
+ * Accepts a URI reference to a binary object in the resource store and returns a `js_sys::ArrayBuffer` containing the resource's bytes.
35
+ */
36
+ resourceToBuffer(uri: string): ArrayBuffer;
37
+ }
38
+
39
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
40
+
41
+ export interface InitOutput {
42
+ readonly memory: WebAssembly.Memory;
43
+ readonly loadSettings: (a: number, b: number) => [number, number];
44
+ readonly run: () => void;
45
+ readonly __wbg_wasmreader_free: (a: number, b: number) => void;
46
+ readonly wasmreader_fromBlob: (a: number, b: number, c: any) => any;
47
+ readonly wasmreader_fromBlobFragment: (a: number, b: number, c: any, d: any) => any;
48
+ readonly wasmreader_json: (a: number) => [number, number];
49
+ readonly wasmreader_activeLabel: (a: number) => [number, number];
50
+ readonly wasmreader_resourceToBuffer: (a: number, b: number, c: number) => [number, number, number];
51
+ readonly ring_core_0_17_14__bn_mul_mont: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
52
+ readonly __wbindgen_exn_store: (a: number) => void;
53
+ readonly __externref_table_alloc: () => number;
54
+ readonly __wbindgen_export_2: WebAssembly.Table;
55
+ readonly __wbindgen_free: (a: number, b: number, c: number) => void;
56
+ readonly __wbindgen_malloc: (a: number, b: number) => number;
57
+ readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
58
+ readonly __wbindgen_export_6: WebAssembly.Table;
59
+ readonly __externref_table_dealloc: (a: number) => void;
60
+ readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__ha1953f27c342761b: (a: number, b: number) => void;
61
+ readonly closure1391_externref_shim: (a: number, b: number, c: any) => void;
62
+ readonly closure2380_externref_shim: (a: number, b: number, c: any, d: any) => void;
63
+ readonly __wbindgen_start: () => void;
64
+ }
65
+
66
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
67
+ /**
68
+ * Instantiates the given `module`, which can either be bytes or
69
+ * a precompiled `WebAssembly.Module`.
70
+ *
71
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
72
+ *
73
+ * @returns {InitOutput}
74
+ */
75
+ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
76
+
77
+ /**
78
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
79
+ * for everything else, calls `WebAssembly.instantiate` directly.
80
+ *
81
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
82
+ *
83
+ * @returns {Promise<InitOutput>}
84
+ */
85
+ export default function __wbg_init (module_or_path: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
86
+ export declare const WASM_SRI: string;
package/pkg/c2pa.js ADDED
@@ -0,0 +1,781 @@
1
+ let wasm;
2
+
3
+ const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
4
+
5
+ if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
6
+
7
+ let cachedUint8ArrayMemory0 = null;
8
+
9
+ function getUint8ArrayMemory0() {
10
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
11
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
12
+ }
13
+ return cachedUint8ArrayMemory0;
14
+ }
15
+
16
+ function getStringFromWasm0(ptr, len) {
17
+ ptr = ptr >>> 0;
18
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
19
+ }
20
+
21
+ function addToExternrefTable0(obj) {
22
+ const idx = wasm.__externref_table_alloc();
23
+ wasm.__wbindgen_export_2.set(idx, obj);
24
+ return idx;
25
+ }
26
+
27
+ function handleError(f, args) {
28
+ try {
29
+ return f.apply(this, args);
30
+ } catch (e) {
31
+ const idx = addToExternrefTable0(e);
32
+ wasm.__wbindgen_exn_store(idx);
33
+ }
34
+ }
35
+
36
+ let WASM_VECTOR_LEN = 0;
37
+
38
+ const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
39
+
40
+ const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
41
+ ? function (arg, view) {
42
+ return cachedTextEncoder.encodeInto(arg, view);
43
+ }
44
+ : function (arg, view) {
45
+ const buf = cachedTextEncoder.encode(arg);
46
+ view.set(buf);
47
+ return {
48
+ read: arg.length,
49
+ written: buf.length
50
+ };
51
+ });
52
+
53
+ function passStringToWasm0(arg, malloc, realloc) {
54
+
55
+ if (realloc === undefined) {
56
+ const buf = cachedTextEncoder.encode(arg);
57
+ const ptr = malloc(buf.length, 1) >>> 0;
58
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
59
+ WASM_VECTOR_LEN = buf.length;
60
+ return ptr;
61
+ }
62
+
63
+ let len = arg.length;
64
+ let ptr = malloc(len, 1) >>> 0;
65
+
66
+ const mem = getUint8ArrayMemory0();
67
+
68
+ let offset = 0;
69
+
70
+ for (; offset < len; offset++) {
71
+ const code = arg.charCodeAt(offset);
72
+ if (code > 0x7F) break;
73
+ mem[ptr + offset] = code;
74
+ }
75
+
76
+ if (offset !== len) {
77
+ if (offset !== 0) {
78
+ arg = arg.slice(offset);
79
+ }
80
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
81
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
82
+ const ret = encodeString(arg, view);
83
+
84
+ offset += ret.written;
85
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
86
+ }
87
+
88
+ WASM_VECTOR_LEN = offset;
89
+ return ptr;
90
+ }
91
+
92
+ let cachedDataViewMemory0 = null;
93
+
94
+ function getDataViewMemory0() {
95
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
96
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
97
+ }
98
+ return cachedDataViewMemory0;
99
+ }
100
+
101
+ function isLikeNone(x) {
102
+ return x === undefined || x === null;
103
+ }
104
+
105
+ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
106
+ ? { register: () => {}, unregister: () => {} }
107
+ : new FinalizationRegistry(state => {
108
+ wasm.__wbindgen_export_6.get(state.dtor)(state.a, state.b)
109
+ });
110
+
111
+ function makeMutClosure(arg0, arg1, dtor, f) {
112
+ const state = { a: arg0, b: arg1, cnt: 1, dtor };
113
+ const real = (...args) => {
114
+ // First up with a closure we increment the internal reference
115
+ // count. This ensures that the Rust closure environment won't
116
+ // be deallocated while we're invoking it.
117
+ state.cnt++;
118
+ const a = state.a;
119
+ state.a = 0;
120
+ try {
121
+ return f(a, state.b, ...args);
122
+ } finally {
123
+ if (--state.cnt === 0) {
124
+ wasm.__wbindgen_export_6.get(state.dtor)(a, state.b);
125
+ CLOSURE_DTORS.unregister(state);
126
+ } else {
127
+ state.a = a;
128
+ }
129
+ }
130
+ };
131
+ real.original = state;
132
+ CLOSURE_DTORS.register(real, state, state);
133
+ return real;
134
+ }
135
+
136
+ function debugString(val) {
137
+ // primitive types
138
+ const type = typeof val;
139
+ if (type == 'number' || type == 'boolean' || val == null) {
140
+ return `${val}`;
141
+ }
142
+ if (type == 'string') {
143
+ return `"${val}"`;
144
+ }
145
+ if (type == 'symbol') {
146
+ const description = val.description;
147
+ if (description == null) {
148
+ return 'Symbol';
149
+ } else {
150
+ return `Symbol(${description})`;
151
+ }
152
+ }
153
+ if (type == 'function') {
154
+ const name = val.name;
155
+ if (typeof name == 'string' && name.length > 0) {
156
+ return `Function(${name})`;
157
+ } else {
158
+ return 'Function';
159
+ }
160
+ }
161
+ // objects
162
+ if (Array.isArray(val)) {
163
+ const length = val.length;
164
+ let debug = '[';
165
+ if (length > 0) {
166
+ debug += debugString(val[0]);
167
+ }
168
+ for(let i = 1; i < length; i++) {
169
+ debug += ', ' + debugString(val[i]);
170
+ }
171
+ debug += ']';
172
+ return debug;
173
+ }
174
+ // Test for built-in
175
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
176
+ let className;
177
+ if (builtInMatches && builtInMatches.length > 1) {
178
+ className = builtInMatches[1];
179
+ } else {
180
+ // Failed to match the standard '[object ClassName]'
181
+ return toString.call(val);
182
+ }
183
+ if (className == 'Object') {
184
+ // we're a user defined class or Object
185
+ // JSON.stringify avoids problems with cycles, and is generally much
186
+ // easier than looping through ownProperties of `val`.
187
+ try {
188
+ return 'Object(' + JSON.stringify(val) + ')';
189
+ } catch (_) {
190
+ return 'Object';
191
+ }
192
+ }
193
+ // errors
194
+ if (val instanceof Error) {
195
+ return `${val.name}: ${val.message}\n${val.stack}`;
196
+ }
197
+ // TODO we could test for more things here, like `Set`s and `Map`s.
198
+ return className;
199
+ }
200
+
201
+ function takeFromExternrefTable0(idx) {
202
+ const value = wasm.__wbindgen_export_2.get(idx);
203
+ wasm.__externref_table_dealloc(idx);
204
+ return value;
205
+ }
206
+ /**
207
+ * Accepts a JSON-serialized string to be loaded as c2pa-rs settings.
208
+ * @param {string} settings
209
+ */
210
+ export function loadSettings(settings) {
211
+ const ptr0 = passStringToWasm0(settings, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
212
+ const len0 = WASM_VECTOR_LEN;
213
+ const ret = wasm.loadSettings(ptr0, len0);
214
+ if (ret[1]) {
215
+ throw takeFromExternrefTable0(ret[0]);
216
+ }
217
+ }
218
+
219
+ /**
220
+ * Called when the WASM binary is initialized.
221
+ */
222
+ export function run() {
223
+ wasm.run();
224
+ }
225
+
226
+ function __wbg_adapter_26(arg0, arg1) {
227
+ wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__ha1953f27c342761b(arg0, arg1);
228
+ }
229
+
230
+ function __wbg_adapter_29(arg0, arg1, arg2) {
231
+ wasm.closure1391_externref_shim(arg0, arg1, arg2);
232
+ }
233
+
234
+ function __wbg_adapter_123(arg0, arg1, arg2, arg3) {
235
+ wasm.closure2380_externref_shim(arg0, arg1, arg2, arg3);
236
+ }
237
+
238
+ const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
239
+
240
+ const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
241
+
242
+ const WasmReaderFinalization = (typeof FinalizationRegistry === 'undefined')
243
+ ? { register: () => {}, unregister: () => {} }
244
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmreader_free(ptr >>> 0, 1));
245
+ /**
246
+ * Wraps a `c2pa::Reader`.
247
+ */
248
+ export class WasmReader {
249
+
250
+ static __wrap(ptr) {
251
+ ptr = ptr >>> 0;
252
+ const obj = Object.create(WasmReader.prototype);
253
+ obj.__wbg_ptr = ptr;
254
+ WasmReaderFinalization.register(obj, obj.__wbg_ptr, obj);
255
+ return obj;
256
+ }
257
+
258
+ __destroy_into_raw() {
259
+ const ptr = this.__wbg_ptr;
260
+ this.__wbg_ptr = 0;
261
+ WasmReaderFinalization.unregister(this);
262
+ return ptr;
263
+ }
264
+
265
+ free() {
266
+ const ptr = this.__destroy_into_raw();
267
+ wasm.__wbg_wasmreader_free(ptr, 0);
268
+ }
269
+ /**
270
+ * Attempts to create a new `WasmReader` from an asset format and `Blob` of the asset's bytes.
271
+ * @param {string} format
272
+ * @param {Blob} blob
273
+ * @returns {Promise<WasmReader>}
274
+ */
275
+ static fromBlob(format, blob) {
276
+ const ptr0 = passStringToWasm0(format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
277
+ const len0 = WASM_VECTOR_LEN;
278
+ const ret = wasm.wasmreader_fromBlob(ptr0, len0, blob);
279
+ return ret;
280
+ }
281
+ /**
282
+ * Attempts to create a new `WasmReader` from an asset format, a `Blob` of the bytes of the initial segment, and a fragment `Blob`.
283
+ * @param {string} format
284
+ * @param {Blob} init
285
+ * @param {Blob} fragment
286
+ * @returns {Promise<WasmReader>}
287
+ */
288
+ static fromBlobFragment(format, init, fragment) {
289
+ const ptr0 = passStringToWasm0(format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
290
+ const len0 = WASM_VECTOR_LEN;
291
+ const ret = wasm.wasmreader_fromBlobFragment(ptr0, len0, init, fragment);
292
+ return ret;
293
+ }
294
+ /**
295
+ * Returns a JSON representation of the asset's manifest store.
296
+ * @returns {string}
297
+ */
298
+ json() {
299
+ let deferred1_0;
300
+ let deferred1_1;
301
+ try {
302
+ const ret = wasm.wasmreader_json(this.__wbg_ptr);
303
+ deferred1_0 = ret[0];
304
+ deferred1_1 = ret[1];
305
+ return getStringFromWasm0(ret[0], ret[1]);
306
+ } finally {
307
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
308
+ }
309
+ }
310
+ /**
311
+ * Returns the label of the asset's active manifest.
312
+ * @returns {string | undefined}
313
+ */
314
+ activeLabel() {
315
+ const ret = wasm.wasmreader_activeLabel(this.__wbg_ptr);
316
+ let v1;
317
+ if (ret[0] !== 0) {
318
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
319
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
320
+ }
321
+ return v1;
322
+ }
323
+ /**
324
+ * Accepts a URI reference to a binary object in the resource store and returns a `js_sys::ArrayBuffer` containing the resource's bytes.
325
+ * @param {string} uri
326
+ * @returns {ArrayBuffer}
327
+ */
328
+ resourceToBuffer(uri) {
329
+ const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
330
+ const len0 = WASM_VECTOR_LEN;
331
+ const ret = wasm.wasmreader_resourceToBuffer(this.__wbg_ptr, ptr0, len0);
332
+ if (ret[2]) {
333
+ throw takeFromExternrefTable0(ret[1]);
334
+ }
335
+ return takeFromExternrefTable0(ret[0]);
336
+ }
337
+ }
338
+
339
+ async function __wbg_load(module, imports) {
340
+ if (typeof Response === 'function' && module instanceof Response) {
341
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
342
+ try {
343
+ return await WebAssembly.instantiateStreaming(module, imports);
344
+
345
+ } catch (e) {
346
+ if (module.headers.get('Content-Type') != 'application/wasm') {
347
+ 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);
348
+
349
+ } else {
350
+ throw e;
351
+ }
352
+ }
353
+ }
354
+
355
+ const bytes = await module.arrayBuffer();
356
+ return await WebAssembly.instantiate(bytes, imports);
357
+
358
+ } else {
359
+ const instance = await WebAssembly.instantiate(module, imports);
360
+
361
+ if (instance instanceof WebAssembly.Instance) {
362
+ return { instance, module };
363
+
364
+ } else {
365
+ return instance;
366
+ }
367
+ }
368
+ }
369
+
370
+ function __wbg_get_imports() {
371
+ const imports = {};
372
+ imports.wbg = {};
373
+ imports.wbg.__wbg_abort_410ec47a64ac6117 = function(arg0, arg1) {
374
+ arg0.abort(arg1);
375
+ };
376
+ imports.wbg.__wbg_abort_775ef1d17fc65868 = function(arg0) {
377
+ arg0.abort();
378
+ };
379
+ imports.wbg.__wbg_append_8c7dd8d641a5f01b = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
380
+ arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
381
+ }, arguments) };
382
+ imports.wbg.__wbg_arrayBuffer_d1b44c4390db422f = function() { return handleError(function (arg0) {
383
+ const ret = arg0.arrayBuffer();
384
+ return ret;
385
+ }, arguments) };
386
+ imports.wbg.__wbg_buffer_09165b52af8c5237 = function(arg0) {
387
+ const ret = arg0.buffer;
388
+ return ret;
389
+ };
390
+ imports.wbg.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
391
+ const ret = arg0.buffer;
392
+ return ret;
393
+ };
394
+ imports.wbg.__wbg_byteLength_e674b853d9c77e1d = function(arg0) {
395
+ const ret = arg0.byteLength;
396
+ return ret;
397
+ };
398
+ imports.wbg.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
399
+ const ret = arg0.call(arg1);
400
+ return ret;
401
+ }, arguments) };
402
+ imports.wbg.__wbg_call_7cccdd69e0791ae2 = function() { return handleError(function (arg0, arg1, arg2) {
403
+ const ret = arg0.call(arg1, arg2);
404
+ return ret;
405
+ }, arguments) };
406
+ imports.wbg.__wbg_clearTimeout_0b53d391c1b94dda = function(arg0) {
407
+ const ret = clearTimeout(arg0);
408
+ return ret;
409
+ };
410
+ imports.wbg.__wbg_done_769e5ede4b31c67b = function(arg0) {
411
+ const ret = arg0.done;
412
+ return ret;
413
+ };
414
+ imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
415
+ let deferred0_0;
416
+ let deferred0_1;
417
+ try {
418
+ deferred0_0 = arg0;
419
+ deferred0_1 = arg1;
420
+ console.error(getStringFromWasm0(arg0, arg1));
421
+ } finally {
422
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
423
+ }
424
+ };
425
+ imports.wbg.__wbg_fetch_11bff8299d0ecd2b = function(arg0) {
426
+ const ret = fetch(arg0);
427
+ return ret;
428
+ };
429
+ imports.wbg.__wbg_fetch_509096533071c657 = function(arg0, arg1) {
430
+ const ret = arg0.fetch(arg1);
431
+ return ret;
432
+ };
433
+ imports.wbg.__wbg_get_67b2ba62fc30de12 = function() { return handleError(function (arg0, arg1) {
434
+ const ret = Reflect.get(arg0, arg1);
435
+ return ret;
436
+ }, arguments) };
437
+ imports.wbg.__wbg_has_a5ea9117f258a0ec = function() { return handleError(function (arg0, arg1) {
438
+ const ret = Reflect.has(arg0, arg1);
439
+ return ret;
440
+ }, arguments) };
441
+ imports.wbg.__wbg_headers_9cb51cfd2ac780a4 = function(arg0) {
442
+ const ret = arg0.headers;
443
+ return ret;
444
+ };
445
+ imports.wbg.__wbg_instanceof_Response_f2cc20d9f7dfd644 = function(arg0) {
446
+ let result;
447
+ try {
448
+ result = arg0 instanceof Response;
449
+ } catch (_) {
450
+ result = false;
451
+ }
452
+ const ret = result;
453
+ return ret;
454
+ };
455
+ imports.wbg.__wbg_iterator_9a24c88df860dc65 = function() {
456
+ const ret = Symbol.iterator;
457
+ return ret;
458
+ };
459
+ imports.wbg.__wbg_length_a446193dc22c12f8 = function(arg0) {
460
+ const ret = arg0.length;
461
+ return ret;
462
+ };
463
+ imports.wbg.__wbg_new_018dcc2d6c8c2f6a = function() { return handleError(function () {
464
+ const ret = new Headers();
465
+ return ret;
466
+ }, arguments) };
467
+ imports.wbg.__wbg_new_16004015965f986e = function() { return handleError(function () {
468
+ const ret = new FileReaderSync();
469
+ return ret;
470
+ }, arguments) };
471
+ imports.wbg.__wbg_new_23a2665fac83c611 = function(arg0, arg1) {
472
+ try {
473
+ var state0 = {a: arg0, b: arg1};
474
+ var cb0 = (arg0, arg1) => {
475
+ const a = state0.a;
476
+ state0.a = 0;
477
+ try {
478
+ return __wbg_adapter_123(a, state0.b, arg0, arg1);
479
+ } finally {
480
+ state0.a = a;
481
+ }
482
+ };
483
+ const ret = new Promise(cb0);
484
+ return ret;
485
+ } finally {
486
+ state0.a = state0.b = 0;
487
+ }
488
+ };
489
+ imports.wbg.__wbg_new_405e22f390576ce2 = function() {
490
+ const ret = new Object();
491
+ return ret;
492
+ };
493
+ imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
494
+ const ret = new Error();
495
+ return ret;
496
+ };
497
+ imports.wbg.__wbg_new_a12002a7f91c75be = function(arg0) {
498
+ const ret = new Uint8Array(arg0);
499
+ return ret;
500
+ };
501
+ imports.wbg.__wbg_new_c68d7209be747379 = function(arg0, arg1) {
502
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
503
+ return ret;
504
+ };
505
+ imports.wbg.__wbg_new_e25e5aab09ff45db = function() { return handleError(function () {
506
+ const ret = new AbortController();
507
+ return ret;
508
+ }, arguments) };
509
+ imports.wbg.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
510
+ const ret = new Function(getStringFromWasm0(arg0, arg1));
511
+ return ret;
512
+ };
513
+ imports.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function(arg0, arg1, arg2) {
514
+ const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
515
+ return ret;
516
+ };
517
+ imports.wbg.__wbg_newwithlength_a381634e90c276d4 = function(arg0) {
518
+ const ret = new Uint8Array(arg0 >>> 0);
519
+ return ret;
520
+ };
521
+ imports.wbg.__wbg_newwithstrandinit_06c535e0a867c635 = function() { return handleError(function (arg0, arg1, arg2) {
522
+ const ret = new Request(getStringFromWasm0(arg0, arg1), arg2);
523
+ return ret;
524
+ }, arguments) };
525
+ imports.wbg.__wbg_next_25feadfc0913fea9 = function(arg0) {
526
+ const ret = arg0.next;
527
+ return ret;
528
+ };
529
+ imports.wbg.__wbg_next_6574e1a8a62d1055 = function() { return handleError(function (arg0) {
530
+ const ret = arg0.next();
531
+ return ret;
532
+ }, arguments) };
533
+ imports.wbg.__wbg_now_807e54c39636c349 = function() {
534
+ const ret = Date.now();
535
+ return ret;
536
+ };
537
+ imports.wbg.__wbg_queueMicrotask_97d92b4fcc8a61c5 = function(arg0) {
538
+ queueMicrotask(arg0);
539
+ };
540
+ imports.wbg.__wbg_queueMicrotask_d3219def82552485 = function(arg0) {
541
+ const ret = arg0.queueMicrotask;
542
+ return ret;
543
+ };
544
+ imports.wbg.__wbg_readAsArrayBuffer_560aeb9fce36c5c8 = function() { return handleError(function (arg0, arg1) {
545
+ const ret = arg0.readAsArrayBuffer(arg1);
546
+ return ret;
547
+ }, arguments) };
548
+ imports.wbg.__wbg_resolve_4851785c9c5f573d = function(arg0) {
549
+ const ret = Promise.resolve(arg0);
550
+ return ret;
551
+ };
552
+ imports.wbg.__wbg_setTimeout_73ce8df12de4f2f2 = function(arg0, arg1) {
553
+ const ret = setTimeout(arg0, arg1);
554
+ return ret;
555
+ };
556
+ imports.wbg.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
557
+ arg0.set(arg1, arg2 >>> 0);
558
+ };
559
+ imports.wbg.__wbg_setbody_5923b78a95eedf29 = function(arg0, arg1) {
560
+ arg0.body = arg1;
561
+ };
562
+ imports.wbg.__wbg_setcredentials_c3a22f1cd105a2c6 = function(arg0, arg1) {
563
+ arg0.credentials = __wbindgen_enum_RequestCredentials[arg1];
564
+ };
565
+ imports.wbg.__wbg_setheaders_834c0bdb6a8949ad = function(arg0, arg1) {
566
+ arg0.headers = arg1;
567
+ };
568
+ imports.wbg.__wbg_setmethod_3c5280fe5d890842 = function(arg0, arg1, arg2) {
569
+ arg0.method = getStringFromWasm0(arg1, arg2);
570
+ };
571
+ imports.wbg.__wbg_setmode_5dc300b865044b65 = function(arg0, arg1) {
572
+ arg0.mode = __wbindgen_enum_RequestMode[arg1];
573
+ };
574
+ imports.wbg.__wbg_setsignal_75b21ef3a81de905 = function(arg0, arg1) {
575
+ arg0.signal = arg1;
576
+ };
577
+ imports.wbg.__wbg_signal_aaf9ad74119f20a4 = function(arg0) {
578
+ const ret = arg0.signal;
579
+ return ret;
580
+ };
581
+ imports.wbg.__wbg_size_3808d41635a9c259 = function(arg0) {
582
+ const ret = arg0.size;
583
+ return ret;
584
+ };
585
+ imports.wbg.__wbg_slice_bd4c84b64bdfe01f = function() { return handleError(function (arg0, arg1, arg2) {
586
+ const ret = arg0.slice(arg1, arg2);
587
+ return ret;
588
+ }, arguments) };
589
+ imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
590
+ const ret = arg1.stack;
591
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
592
+ const len1 = WASM_VECTOR_LEN;
593
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
594
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
595
+ };
596
+ imports.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() {
597
+ const ret = typeof global === 'undefined' ? null : global;
598
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
599
+ };
600
+ imports.wbg.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function() {
601
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
602
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
603
+ };
604
+ imports.wbg.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function() {
605
+ const ret = typeof self === 'undefined' ? null : self;
606
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
607
+ };
608
+ imports.wbg.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function() {
609
+ const ret = typeof window === 'undefined' ? null : window;
610
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
611
+ };
612
+ imports.wbg.__wbg_status_f6360336ca686bf0 = function(arg0) {
613
+ const ret = arg0.status;
614
+ return ret;
615
+ };
616
+ imports.wbg.__wbg_stringify_f7ed6987935b4a24 = function() { return handleError(function (arg0) {
617
+ const ret = JSON.stringify(arg0);
618
+ return ret;
619
+ }, arguments) };
620
+ imports.wbg.__wbg_then_44b73946d2fb3e7d = function(arg0, arg1) {
621
+ const ret = arg0.then(arg1);
622
+ return ret;
623
+ };
624
+ imports.wbg.__wbg_then_48b406749878a531 = function(arg0, arg1, arg2) {
625
+ const ret = arg0.then(arg1, arg2);
626
+ return ret;
627
+ };
628
+ imports.wbg.__wbg_url_ae10c34ca209681d = function(arg0, arg1) {
629
+ const ret = arg1.url;
630
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
631
+ const len1 = WASM_VECTOR_LEN;
632
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
633
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
634
+ };
635
+ imports.wbg.__wbg_value_cd1ffa7b1ab794f1 = function(arg0) {
636
+ const ret = arg0.value;
637
+ return ret;
638
+ };
639
+ imports.wbg.__wbg_wasmreader_new = function(arg0) {
640
+ const ret = WasmReader.__wrap(arg0);
641
+ return ret;
642
+ };
643
+ imports.wbg.__wbindgen_cb_drop = function(arg0) {
644
+ const obj = arg0.original;
645
+ if (obj.cnt-- == 1) {
646
+ obj.a = 0;
647
+ return true;
648
+ }
649
+ const ret = false;
650
+ return ret;
651
+ };
652
+ imports.wbg.__wbindgen_closure_wrapper9193 = function(arg0, arg1, arg2) {
653
+ const ret = makeMutClosure(arg0, arg1, 1337, __wbg_adapter_26);
654
+ return ret;
655
+ };
656
+ imports.wbg.__wbindgen_closure_wrapper9303 = function(arg0, arg1, arg2) {
657
+ const ret = makeMutClosure(arg0, arg1, 1392, __wbg_adapter_29);
658
+ return ret;
659
+ };
660
+ imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
661
+ const ret = debugString(arg1);
662
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
663
+ const len1 = WASM_VECTOR_LEN;
664
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
665
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
666
+ };
667
+ imports.wbg.__wbindgen_init_externref_table = function() {
668
+ const table = wasm.__wbindgen_export_2;
669
+ const offset = table.grow(4);
670
+ table.set(0, undefined);
671
+ table.set(offset + 0, undefined);
672
+ table.set(offset + 1, null);
673
+ table.set(offset + 2, true);
674
+ table.set(offset + 3, false);
675
+ ;
676
+ };
677
+ imports.wbg.__wbindgen_is_function = function(arg0) {
678
+ const ret = typeof(arg0) === 'function';
679
+ return ret;
680
+ };
681
+ imports.wbg.__wbindgen_is_object = function(arg0) {
682
+ const val = arg0;
683
+ const ret = typeof(val) === 'object' && val !== null;
684
+ return ret;
685
+ };
686
+ imports.wbg.__wbindgen_is_undefined = function(arg0) {
687
+ const ret = arg0 === undefined;
688
+ return ret;
689
+ };
690
+ imports.wbg.__wbindgen_memory = function() {
691
+ const ret = wasm.memory;
692
+ return ret;
693
+ };
694
+ imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
695
+ const obj = arg1;
696
+ const ret = typeof(obj) === 'string' ? obj : undefined;
697
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
698
+ var len1 = WASM_VECTOR_LEN;
699
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
700
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
701
+ };
702
+ imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
703
+ const ret = getStringFromWasm0(arg0, arg1);
704
+ return ret;
705
+ };
706
+ imports.wbg.__wbindgen_throw = function(arg0, arg1) {
707
+ throw new Error(getStringFromWasm0(arg0, arg1));
708
+ };
709
+
710
+ return imports;
711
+ }
712
+
713
+ function __wbg_init_memory(imports, memory) {
714
+
715
+ }
716
+
717
+ function __wbg_finalize_init(instance, module) {
718
+ wasm = instance.exports;
719
+ __wbg_init.__wbindgen_wasm_module = module;
720
+ cachedDataViewMemory0 = null;
721
+ cachedUint8ArrayMemory0 = null;
722
+
723
+
724
+ wasm.__wbindgen_start();
725
+ return wasm;
726
+ }
727
+
728
+ function initSync(module) {
729
+ if (wasm !== undefined) return wasm;
730
+
731
+
732
+ if (typeof module !== 'undefined') {
733
+ if (Object.getPrototypeOf(module) === Object.prototype) {
734
+ ({module} = module)
735
+ } else {
736
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
737
+ }
738
+ }
739
+
740
+ const imports = __wbg_get_imports();
741
+
742
+ __wbg_init_memory(imports);
743
+
744
+ if (!(module instanceof WebAssembly.Module)) {
745
+ module = new WebAssembly.Module(module);
746
+ }
747
+
748
+ const instance = new WebAssembly.Instance(module, imports);
749
+
750
+ return __wbg_finalize_init(instance, module);
751
+ }
752
+
753
+ async function __wbg_init(module_or_path) {
754
+ if (wasm !== undefined) return wasm;
755
+
756
+
757
+ if (typeof module_or_path !== 'undefined') {
758
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
759
+ ({module_or_path} = module_or_path)
760
+ } else {
761
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
762
+ }
763
+ }
764
+
765
+
766
+ const imports = __wbg_get_imports();
767
+
768
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
769
+ module_or_path = fetch(module_or_path);
770
+ }
771
+
772
+ __wbg_init_memory(imports);
773
+
774
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
775
+
776
+ return __wbg_finalize_init(instance, module);
777
+ }
778
+
779
+ export { initSync };
780
+ export default __wbg_init;
781
+ export const WASM_SRI = "sha512-fQMTO3HLS7dtGFRg+QIUqpyyCX5XlwlaFKDhcsIycpdCmb9I5uKk4ATvKIkYyqLZxWdk63gmGEUB3/U4LyT3fQ==";
Binary file
@@ -0,0 +1,24 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ export const memory: WebAssembly.Memory;
4
+ export const loadSettings: (a: number, b: number) => [number, number];
5
+ export const run: () => void;
6
+ export const __wbg_wasmreader_free: (a: number, b: number) => void;
7
+ export const wasmreader_fromBlob: (a: number, b: number, c: any) => any;
8
+ export const wasmreader_fromBlobFragment: (a: number, b: number, c: any, d: any) => any;
9
+ export const wasmreader_json: (a: number) => [number, number];
10
+ export const wasmreader_activeLabel: (a: number) => [number, number];
11
+ export const wasmreader_resourceToBuffer: (a: number, b: number, c: number) => [number, number, number];
12
+ export const ring_core_0_17_14__bn_mul_mont: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
13
+ export const __wbindgen_exn_store: (a: number) => void;
14
+ export const __externref_table_alloc: () => number;
15
+ export const __wbindgen_export_2: WebAssembly.Table;
16
+ export const __wbindgen_free: (a: number, b: number, c: number) => void;
17
+ export const __wbindgen_malloc: (a: number, b: number) => number;
18
+ export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
19
+ export const __wbindgen_export_6: WebAssembly.Table;
20
+ export const __externref_table_dealloc: (a: number) => void;
21
+ export const _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__ha1953f27c342761b: (a: number, b: number) => void;
22
+ export const closure1391_externref_shim: (a: number, b: number, c: any) => void;
23
+ export const closure2380_externref_shim: (a: number, b: number, c: any, d: any) => void;
24
+ export const __wbindgen_start: () => void;