@cipherstash/protect-ffi 0.23.0 → 0.25.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.
@@ -0,0 +1,1051 @@
1
+ export class IntoUnderlyingByteSource {
2
+ __destroy_into_raw() {
3
+ const ptr = this.__wbg_ptr;
4
+ this.__wbg_ptr = 0;
5
+ IntoUnderlyingByteSourceFinalization.unregister(this);
6
+ return ptr;
7
+ }
8
+ free() {
9
+ const ptr = this.__destroy_into_raw();
10
+ wasm.__wbg_intounderlyingbytesource_free(ptr, 0);
11
+ }
12
+ /**
13
+ * @returns {number}
14
+ */
15
+ get autoAllocateChunkSize() {
16
+ const ret = wasm.intounderlyingbytesource_autoAllocateChunkSize(this.__wbg_ptr);
17
+ return ret >>> 0;
18
+ }
19
+ cancel() {
20
+ const ptr = this.__destroy_into_raw();
21
+ wasm.intounderlyingbytesource_cancel(ptr);
22
+ }
23
+ /**
24
+ * @param {ReadableByteStreamController} controller
25
+ * @returns {Promise<any>}
26
+ */
27
+ pull(controller) {
28
+ const ret = wasm.intounderlyingbytesource_pull(this.__wbg_ptr, controller);
29
+ return ret;
30
+ }
31
+ /**
32
+ * @param {ReadableByteStreamController} controller
33
+ */
34
+ start(controller) {
35
+ wasm.intounderlyingbytesource_start(this.__wbg_ptr, controller);
36
+ }
37
+ /**
38
+ * @returns {ReadableStreamType}
39
+ */
40
+ get type() {
41
+ const ret = wasm.intounderlyingbytesource_type(this.__wbg_ptr);
42
+ return __wbindgen_enum_ReadableStreamType[ret];
43
+ }
44
+ }
45
+ if (Symbol.dispose) IntoUnderlyingByteSource.prototype[Symbol.dispose] = IntoUnderlyingByteSource.prototype.free;
46
+
47
+ export class IntoUnderlyingSink {
48
+ __destroy_into_raw() {
49
+ const ptr = this.__wbg_ptr;
50
+ this.__wbg_ptr = 0;
51
+ IntoUnderlyingSinkFinalization.unregister(this);
52
+ return ptr;
53
+ }
54
+ free() {
55
+ const ptr = this.__destroy_into_raw();
56
+ wasm.__wbg_intounderlyingsink_free(ptr, 0);
57
+ }
58
+ /**
59
+ * @param {any} reason
60
+ * @returns {Promise<any>}
61
+ */
62
+ abort(reason) {
63
+ const ptr = this.__destroy_into_raw();
64
+ const ret = wasm.intounderlyingsink_abort(ptr, reason);
65
+ return ret;
66
+ }
67
+ /**
68
+ * @returns {Promise<any>}
69
+ */
70
+ close() {
71
+ const ptr = this.__destroy_into_raw();
72
+ const ret = wasm.intounderlyingsink_close(ptr);
73
+ return ret;
74
+ }
75
+ /**
76
+ * @param {any} chunk
77
+ * @returns {Promise<any>}
78
+ */
79
+ write(chunk) {
80
+ const ret = wasm.intounderlyingsink_write(this.__wbg_ptr, chunk);
81
+ return ret;
82
+ }
83
+ }
84
+ if (Symbol.dispose) IntoUnderlyingSink.prototype[Symbol.dispose] = IntoUnderlyingSink.prototype.free;
85
+
86
+ export class IntoUnderlyingSource {
87
+ __destroy_into_raw() {
88
+ const ptr = this.__wbg_ptr;
89
+ this.__wbg_ptr = 0;
90
+ IntoUnderlyingSourceFinalization.unregister(this);
91
+ return ptr;
92
+ }
93
+ free() {
94
+ const ptr = this.__destroy_into_raw();
95
+ wasm.__wbg_intounderlyingsource_free(ptr, 0);
96
+ }
97
+ cancel() {
98
+ const ptr = this.__destroy_into_raw();
99
+ wasm.intounderlyingsource_cancel(ptr);
100
+ }
101
+ /**
102
+ * @param {ReadableStreamDefaultController} controller
103
+ * @returns {Promise<any>}
104
+ */
105
+ pull(controller) {
106
+ const ret = wasm.intounderlyingsource_pull(this.__wbg_ptr, controller);
107
+ return ret;
108
+ }
109
+ }
110
+ if (Symbol.dispose) IntoUnderlyingSource.prototype[Symbol.dispose] = IntoUnderlyingSource.prototype.free;
111
+
112
+ /**
113
+ * Wasm-side client handle. Wraps the same `ScopedCipher` +
114
+ * `ZeroKMSWithClientKey` pair the Neon side does, parameterised by
115
+ * [`JsAuthStrategy`] instead of `AutoStrategy`.
116
+ */
117
+ export class WasmClient {
118
+ static __wrap(ptr) {
119
+ ptr = ptr >>> 0;
120
+ const obj = Object.create(WasmClient.prototype);
121
+ obj.__wbg_ptr = ptr;
122
+ WasmClientFinalization.register(obj, obj.__wbg_ptr, obj);
123
+ return obj;
124
+ }
125
+ __destroy_into_raw() {
126
+ const ptr = this.__wbg_ptr;
127
+ this.__wbg_ptr = 0;
128
+ WasmClientFinalization.unregister(this);
129
+ return ptr;
130
+ }
131
+ free() {
132
+ const ptr = this.__destroy_into_raw();
133
+ wasm.__wbg_wasmclient_free(ptr, 0);
134
+ }
135
+ }
136
+ if (Symbol.dispose) WasmClient.prototype[Symbol.dispose] = WasmClient.prototype.free;
137
+
138
+ /**
139
+ * @param {WasmClient} client
140
+ * @param {any} opts
141
+ * @returns {Promise<any>}
142
+ */
143
+ export function decrypt(client, opts) {
144
+ _assertClass(client, WasmClient);
145
+ const ret = wasm.decrypt(client.__wbg_ptr, opts);
146
+ return ret;
147
+ }
148
+
149
+ /**
150
+ * @param {WasmClient} client
151
+ * @param {any} opts
152
+ * @returns {Promise<any>}
153
+ */
154
+ export function decryptBulk(client, opts) {
155
+ _assertClass(client, WasmClient);
156
+ const ret = wasm.decryptBulk(client.__wbg_ptr, opts);
157
+ return ret;
158
+ }
159
+
160
+ /**
161
+ * @param {WasmClient} client
162
+ * @param {any} opts
163
+ * @returns {Promise<any>}
164
+ */
165
+ export function decryptBulkFallible(client, opts) {
166
+ _assertClass(client, WasmClient);
167
+ const ret = wasm.decryptBulkFallible(client.__wbg_ptr, opts);
168
+ return ret;
169
+ }
170
+
171
+ /**
172
+ * @param {WasmClient} client
173
+ * @param {any} opts
174
+ * @returns {Promise<any>}
175
+ */
176
+ export function encrypt(client, opts) {
177
+ _assertClass(client, WasmClient);
178
+ const ret = wasm.encrypt(client.__wbg_ptr, opts);
179
+ return ret;
180
+ }
181
+
182
+ /**
183
+ * @param {WasmClient} client
184
+ * @param {any} opts
185
+ * @returns {Promise<any>}
186
+ */
187
+ export function encryptBulk(client, opts) {
188
+ _assertClass(client, WasmClient);
189
+ const ret = wasm.encryptBulk(client.__wbg_ptr, opts);
190
+ return ret;
191
+ }
192
+
193
+ /**
194
+ * @param {WasmClient} client
195
+ * @param {any} opts
196
+ * @returns {Promise<any>}
197
+ */
198
+ export function encryptQuery(client, opts) {
199
+ _assertClass(client, WasmClient);
200
+ const ret = wasm.encryptQuery(client.__wbg_ptr, opts);
201
+ return ret;
202
+ }
203
+
204
+ /**
205
+ * @param {WasmClient} client
206
+ * @param {any} opts
207
+ * @returns {Promise<any>}
208
+ */
209
+ export function encryptQueryBulk(client, opts) {
210
+ _assertClass(client, WasmClient);
211
+ const ret = wasm.encryptQueryBulk(client.__wbg_ptr, opts);
212
+ return ret;
213
+ }
214
+
215
+ /**
216
+ * Install [`console_error_panic_hook`] so Rust panics surface as a JS
217
+ * `Error` in the browser / Node console instead of a bare
218
+ * `RuntimeError: unreachable executed` from the wasm trap. Idempotent —
219
+ * safe to call from any number of entry points.
220
+ *
221
+ * Wired via `#[wasm_bindgen(start)]` so it runs once at module
222
+ * instantiation, before any `newClient` / `encrypt` / `decrypt` call.
223
+ */
224
+ export function init() {
225
+ wasm.init();
226
+ }
227
+
228
+ /**
229
+ * @param {any} raw
230
+ * @returns {boolean}
231
+ */
232
+ export function isEncrypted(raw) {
233
+ const ret = wasm.isEncrypted(raw);
234
+ return ret !== 0;
235
+ }
236
+
237
+ /**
238
+ * Construct a [`WasmClient`].
239
+ *
240
+ * `opts.strategy` must be an `@cipherstash/auth`-shaped object — anything
241
+ * with a `getToken(): Promise<{ token: string, ... }>` method works. It is
242
+ * required: wasm has no env / filesystem fallback path.
243
+ * @param {any} opts
244
+ * @returns {Promise<WasmClient>}
245
+ */
246
+ export function newClient(opts) {
247
+ const ret = wasm.newClient(opts);
248
+ return ret;
249
+ }
250
+ export function __wbg_Error_83742b46f01ce22d(arg0, arg1) {
251
+ const ret = Error(getStringFromWasm0(arg0, arg1));
252
+ return ret;
253
+ }
254
+ export function __wbg_Number_a5a435bd7bbec835(arg0) {
255
+ const ret = Number(arg0);
256
+ return ret;
257
+ }
258
+ export function __wbg_String_8564e559799eccda(arg0, arg1) {
259
+ const ret = String(arg1);
260
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
261
+ const len1 = WASM_VECTOR_LEN;
262
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
263
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
264
+ }
265
+ export function __wbg___wbindgen_bigint_get_as_i64_447a76b5c6ef7bda(arg0, arg1) {
266
+ const v = arg1;
267
+ const ret = typeof(v) === 'bigint' ? v : undefined;
268
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
269
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
270
+ }
271
+ export function __wbg___wbindgen_boolean_get_c0f3f60bac5a78d1(arg0) {
272
+ const v = arg0;
273
+ const ret = typeof(v) === 'boolean' ? v : undefined;
274
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
275
+ }
276
+ export function __wbg___wbindgen_debug_string_5398f5bb970e0daa(arg0, arg1) {
277
+ const ret = debugString(arg1);
278
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
279
+ const len1 = WASM_VECTOR_LEN;
280
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
281
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
282
+ }
283
+ export function __wbg___wbindgen_in_41dbb8413020e076(arg0, arg1) {
284
+ const ret = arg0 in arg1;
285
+ return ret;
286
+ }
287
+ export function __wbg___wbindgen_is_bigint_e2141d4f045b7eda(arg0) {
288
+ const ret = typeof(arg0) === 'bigint';
289
+ return ret;
290
+ }
291
+ export function __wbg___wbindgen_is_function_3c846841762788c1(arg0) {
292
+ const ret = typeof(arg0) === 'function';
293
+ return ret;
294
+ }
295
+ export function __wbg___wbindgen_is_null_0b605fc6b167c56f(arg0) {
296
+ const ret = arg0 === null;
297
+ return ret;
298
+ }
299
+ export function __wbg___wbindgen_is_object_781bc9f159099513(arg0) {
300
+ const val = arg0;
301
+ const ret = typeof(val) === 'object' && val !== null;
302
+ return ret;
303
+ }
304
+ export function __wbg___wbindgen_is_string_7ef6b97b02428fae(arg0) {
305
+ const ret = typeof(arg0) === 'string';
306
+ return ret;
307
+ }
308
+ export function __wbg___wbindgen_is_undefined_52709e72fb9f179c(arg0) {
309
+ const ret = arg0 === undefined;
310
+ return ret;
311
+ }
312
+ export function __wbg___wbindgen_jsval_eq_ee31bfad3e536463(arg0, arg1) {
313
+ const ret = arg0 === arg1;
314
+ return ret;
315
+ }
316
+ export function __wbg___wbindgen_jsval_loose_eq_5bcc3bed3c69e72b(arg0, arg1) {
317
+ const ret = arg0 == arg1;
318
+ return ret;
319
+ }
320
+ export function __wbg___wbindgen_number_get_34bb9d9dcfa21373(arg0, arg1) {
321
+ const obj = arg1;
322
+ const ret = typeof(obj) === 'number' ? obj : undefined;
323
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
324
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
325
+ }
326
+ export function __wbg___wbindgen_string_get_395e606bd0ee4427(arg0, arg1) {
327
+ const obj = arg1;
328
+ const ret = typeof(obj) === 'string' ? obj : undefined;
329
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
330
+ var len1 = WASM_VECTOR_LEN;
331
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
332
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
333
+ }
334
+ export function __wbg___wbindgen_throw_6ddd609b62940d55(arg0, arg1) {
335
+ throw new Error(getStringFromWasm0(arg0, arg1));
336
+ }
337
+ export function __wbg__wbg_cb_unref_6b5b6b8576d35cb1(arg0) {
338
+ arg0._wbg_cb_unref();
339
+ }
340
+ export function __wbg_abort_5ef96933660780b7(arg0) {
341
+ arg0.abort();
342
+ }
343
+ export function __wbg_abort_6479c2d794ebf2ee(arg0, arg1) {
344
+ arg0.abort(arg1);
345
+ }
346
+ export function __wbg_append_608dfb635ee8998f() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
347
+ arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
348
+ }, arguments); }
349
+ export function __wbg_arrayBuffer_eb8e9ca620af2a19() { return handleError(function (arg0) {
350
+ const ret = arg0.arrayBuffer();
351
+ return ret;
352
+ }, arguments); }
353
+ export function __wbg_buffer_60b8043cd926067d(arg0) {
354
+ const ret = arg0.buffer;
355
+ return ret;
356
+ }
357
+ export function __wbg_byobRequest_6342e5f2b232c0f9(arg0) {
358
+ const ret = arg0.byobRequest;
359
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
360
+ }
361
+ export function __wbg_byteLength_607b856aa6c5a508(arg0) {
362
+ const ret = arg0.byteLength;
363
+ return ret;
364
+ }
365
+ export function __wbg_byteOffset_b26b63681c83856c(arg0) {
366
+ const ret = arg0.byteOffset;
367
+ return ret;
368
+ }
369
+ export function __wbg_call_2d781c1f4d5c0ef8() { return handleError(function (arg0, arg1, arg2) {
370
+ const ret = arg0.call(arg1, arg2);
371
+ return ret;
372
+ }, arguments); }
373
+ export function __wbg_call_e133b57c9155d22c() { return handleError(function (arg0, arg1) {
374
+ const ret = arg0.call(arg1);
375
+ return ret;
376
+ }, arguments); }
377
+ export function __wbg_clearTimeout_2256f1e7b94ef517(arg0) {
378
+ const ret = clearTimeout(arg0);
379
+ return ret;
380
+ }
381
+ export function __wbg_close_690d36108c557337() { return handleError(function (arg0) {
382
+ arg0.close();
383
+ }, arguments); }
384
+ export function __wbg_close_737b4b1fbc658540() { return handleError(function (arg0) {
385
+ arg0.close();
386
+ }, arguments); }
387
+ export function __wbg_crypto_38df2bab126b63dc(arg0) {
388
+ const ret = arg0.crypto;
389
+ return ret;
390
+ }
391
+ export function __wbg_done_08ce71ee07e3bd17(arg0) {
392
+ const ret = arg0.done;
393
+ return ret;
394
+ }
395
+ export function __wbg_enqueue_ec3552838b4b7fbf() { return handleError(function (arg0, arg1) {
396
+ arg0.enqueue(arg1);
397
+ }, arguments); }
398
+ export function __wbg_entries_5b8fe91cea59610e(arg0) {
399
+ const ret = arg0.entries();
400
+ return ret;
401
+ }
402
+ export function __wbg_entries_e8a20ff8c9757101(arg0) {
403
+ const ret = Object.entries(arg0);
404
+ return ret;
405
+ }
406
+ export function __wbg_error_a6fa202b58aa1cd3(arg0, arg1) {
407
+ let deferred0_0;
408
+ let deferred0_1;
409
+ try {
410
+ deferred0_0 = arg0;
411
+ deferred0_1 = arg1;
412
+ console.error(getStringFromWasm0(arg0, arg1));
413
+ } finally {
414
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
415
+ }
416
+ }
417
+ export function __wbg_fetch_43b2f110608a59ff(arg0) {
418
+ const ret = fetch(arg0);
419
+ return ret;
420
+ }
421
+ export function __wbg_fetch_5550a88cf343aaa9(arg0, arg1) {
422
+ const ret = arg0.fetch(arg1);
423
+ return ret;
424
+ }
425
+ export function __wbg_getRandomValues_c44a50d8cfdaebeb() { return handleError(function (arg0, arg1) {
426
+ arg0.getRandomValues(arg1);
427
+ }, arguments); }
428
+ export function __wbg_get_326e41e095fb2575() { return handleError(function (arg0, arg1) {
429
+ const ret = Reflect.get(arg0, arg1);
430
+ return ret;
431
+ }, arguments); }
432
+ export function __wbg_get_3ef1eba1850ade27() { return handleError(function (arg0, arg1) {
433
+ const ret = Reflect.get(arg0, arg1);
434
+ return ret;
435
+ }, arguments); }
436
+ export function __wbg_get_a8ee5c45dabc1b3b(arg0, arg1) {
437
+ const ret = arg0[arg1 >>> 0];
438
+ return ret;
439
+ }
440
+ export function __wbg_get_unchecked_329cfe50afab7352(arg0, arg1) {
441
+ const ret = arg0[arg1 >>> 0];
442
+ return ret;
443
+ }
444
+ export function __wbg_get_with_ref_key_6412cf3094599694(arg0, arg1) {
445
+ const ret = arg0[arg1];
446
+ return ret;
447
+ }
448
+ export function __wbg_has_926ef2ff40b308cf() { return handleError(function (arg0, arg1) {
449
+ const ret = Reflect.has(arg0, arg1);
450
+ return ret;
451
+ }, arguments); }
452
+ export function __wbg_headers_eb2234545f9ff993(arg0) {
453
+ const ret = arg0.headers;
454
+ return ret;
455
+ }
456
+ export function __wbg_instanceof_ArrayBuffer_101e2bf31071a9f6(arg0) {
457
+ let result;
458
+ try {
459
+ result = arg0 instanceof ArrayBuffer;
460
+ } catch (_) {
461
+ result = false;
462
+ }
463
+ const ret = result;
464
+ return ret;
465
+ }
466
+ export function __wbg_instanceof_Map_f194b366846aca0c(arg0) {
467
+ let result;
468
+ try {
469
+ result = arg0 instanceof Map;
470
+ } catch (_) {
471
+ result = false;
472
+ }
473
+ const ret = result;
474
+ return ret;
475
+ }
476
+ export function __wbg_instanceof_Promise_7c3bdd7805c2c6e6(arg0) {
477
+ let result;
478
+ try {
479
+ result = arg0 instanceof Promise;
480
+ } catch (_) {
481
+ result = false;
482
+ }
483
+ const ret = result;
484
+ return ret;
485
+ }
486
+ export function __wbg_instanceof_Response_9b4d9fd451e051b1(arg0) {
487
+ let result;
488
+ try {
489
+ result = arg0 instanceof Response;
490
+ } catch (_) {
491
+ result = false;
492
+ }
493
+ const ret = result;
494
+ return ret;
495
+ }
496
+ export function __wbg_instanceof_Uint8Array_740438561a5b956d(arg0) {
497
+ let result;
498
+ try {
499
+ result = arg0 instanceof Uint8Array;
500
+ } catch (_) {
501
+ result = false;
502
+ }
503
+ const ret = result;
504
+ return ret;
505
+ }
506
+ export function __wbg_isArray_33b91feb269ff46e(arg0) {
507
+ const ret = Array.isArray(arg0);
508
+ return ret;
509
+ }
510
+ export function __wbg_isSafeInteger_ecd6a7f9c3e053cd(arg0) {
511
+ const ret = Number.isSafeInteger(arg0);
512
+ return ret;
513
+ }
514
+ export function __wbg_iterator_d8f549ec8fb061b1() {
515
+ const ret = Symbol.iterator;
516
+ return ret;
517
+ }
518
+ export function __wbg_length_b3416cf66a5452c8(arg0) {
519
+ const ret = arg0.length;
520
+ return ret;
521
+ }
522
+ export function __wbg_length_ea16607d7b61445b(arg0) {
523
+ const ret = arg0.length;
524
+ return ret;
525
+ }
526
+ export function __wbg_msCrypto_bd5a034af96bcba6(arg0) {
527
+ const ret = arg0.msCrypto;
528
+ return ret;
529
+ }
530
+ export function __wbg_new_0837727332ac86ba() { return handleError(function () {
531
+ const ret = new Headers();
532
+ return ret;
533
+ }, arguments); }
534
+ export function __wbg_new_227d7c05414eb861() {
535
+ const ret = new Error();
536
+ return ret;
537
+ }
538
+ export function __wbg_new_49d5571bd3f0c4d4() {
539
+ const ret = new Map();
540
+ return ret;
541
+ }
542
+ export function __wbg_new_5f486cdf45a04d78(arg0) {
543
+ const ret = new Uint8Array(arg0);
544
+ return ret;
545
+ }
546
+ export function __wbg_new_a70fbab9066b301f() {
547
+ const ret = new Array();
548
+ return ret;
549
+ }
550
+ export function __wbg_new_ab79df5bd7c26067() {
551
+ const ret = new Object();
552
+ return ret;
553
+ }
554
+ export function __wbg_new_c518c60af666645b() { return handleError(function () {
555
+ const ret = new AbortController();
556
+ return ret;
557
+ }, arguments); }
558
+ export function __wbg_new_d15cb560a6a0e5f0(arg0, arg1) {
559
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
560
+ return ret;
561
+ }
562
+ export function __wbg_new_from_slice_22da9388ac046e50(arg0, arg1) {
563
+ const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
564
+ return ret;
565
+ }
566
+ export function __wbg_new_typed_aaaeaf29cf802876(arg0, arg1) {
567
+ try {
568
+ var state0 = {a: arg0, b: arg1};
569
+ var cb0 = (arg0, arg1) => {
570
+ const a = state0.a;
571
+ state0.a = 0;
572
+ try {
573
+ return wasm_bindgen__convert__closures_____invoke__h1201fec59d36da32(a, state0.b, arg0, arg1);
574
+ } finally {
575
+ state0.a = a;
576
+ }
577
+ };
578
+ const ret = new Promise(cb0);
579
+ return ret;
580
+ } finally {
581
+ state0.a = state0.b = 0;
582
+ }
583
+ }
584
+ export function __wbg_new_with_byte_offset_and_length_b2ec5bf7b2f35743(arg0, arg1, arg2) {
585
+ const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
586
+ return ret;
587
+ }
588
+ export function __wbg_new_with_length_825018a1616e9e55(arg0) {
589
+ const ret = new Uint8Array(arg0 >>> 0);
590
+ return ret;
591
+ }
592
+ export function __wbg_new_with_str_and_init_b4b54d1a819bc724() { return handleError(function (arg0, arg1, arg2) {
593
+ const ret = new Request(getStringFromWasm0(arg0, arg1), arg2);
594
+ return ret;
595
+ }, arguments); }
596
+ export function __wbg_next_11b99ee6237339e3() { return handleError(function (arg0) {
597
+ const ret = arg0.next();
598
+ return ret;
599
+ }, arguments); }
600
+ export function __wbg_next_e01a967809d1aa68(arg0) {
601
+ const ret = arg0.next;
602
+ return ret;
603
+ }
604
+ export function __wbg_node_84ea875411254db1(arg0) {
605
+ const ret = arg0.node;
606
+ return ret;
607
+ }
608
+ export function __wbg_process_44c7a14e11e9f69e(arg0) {
609
+ const ret = arg0.process;
610
+ return ret;
611
+ }
612
+ export function __wbg_prototypesetcall_d62e5099504357e6(arg0, arg1, arg2) {
613
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
614
+ }
615
+ export function __wbg_queueMicrotask_0c399741342fb10f(arg0) {
616
+ const ret = arg0.queueMicrotask;
617
+ return ret;
618
+ }
619
+ export function __wbg_queueMicrotask_a082d78ce798393e(arg0) {
620
+ queueMicrotask(arg0);
621
+ }
622
+ export function __wbg_randomFillSync_6c25eac9869eb53c() { return handleError(function (arg0, arg1) {
623
+ arg0.randomFillSync(arg1);
624
+ }, arguments); }
625
+ export function __wbg_require_b4edbdcf3e2a1ef0() { return handleError(function () {
626
+ const ret = module.require;
627
+ return ret;
628
+ }, arguments); }
629
+ export function __wbg_resolve_ae8d83246e5bcc12(arg0) {
630
+ const ret = Promise.resolve(arg0);
631
+ return ret;
632
+ }
633
+ export function __wbg_respond_e286ee502e7cf7e4() { return handleError(function (arg0, arg1) {
634
+ arg0.respond(arg1 >>> 0);
635
+ }, arguments); }
636
+ export function __wbg_setTimeout_b188b3bcc8977c7d(arg0, arg1) {
637
+ const ret = setTimeout(arg0, arg1);
638
+ return ret;
639
+ }
640
+ export function __wbg_set_282384002438957f(arg0, arg1, arg2) {
641
+ arg0[arg1 >>> 0] = arg2;
642
+ }
643
+ export function __wbg_set_6be42768c690e380(arg0, arg1, arg2) {
644
+ arg0[arg1] = arg2;
645
+ }
646
+ export function __wbg_set_8c0b3ffcf05d61c2(arg0, arg1, arg2) {
647
+ arg0.set(getArrayU8FromWasm0(arg1, arg2));
648
+ }
649
+ export function __wbg_set_bf7251625df30a02(arg0, arg1, arg2) {
650
+ const ret = arg0.set(arg1, arg2);
651
+ return ret;
652
+ }
653
+ export function __wbg_set_body_a3d856b097dfda04(arg0, arg1) {
654
+ arg0.body = arg1;
655
+ }
656
+ export function __wbg_set_cache_ec7e430c6056ebda(arg0, arg1) {
657
+ arg0.cache = __wbindgen_enum_RequestCache[arg1];
658
+ }
659
+ export function __wbg_set_credentials_ed63183445882c65(arg0, arg1) {
660
+ arg0.credentials = __wbindgen_enum_RequestCredentials[arg1];
661
+ }
662
+ export function __wbg_set_headers_3c8fecc693b75327(arg0, arg1) {
663
+ arg0.headers = arg1;
664
+ }
665
+ export function __wbg_set_method_8c015e8bcafd7be1(arg0, arg1, arg2) {
666
+ arg0.method = getStringFromWasm0(arg1, arg2);
667
+ }
668
+ export function __wbg_set_mode_5a87f2c809cf37c2(arg0, arg1) {
669
+ arg0.mode = __wbindgen_enum_RequestMode[arg1];
670
+ }
671
+ export function __wbg_set_signal_0cebecb698f25d21(arg0, arg1) {
672
+ arg0.signal = arg1;
673
+ }
674
+ export function __wbg_signal_166e1da31adcac18(arg0) {
675
+ const ret = arg0.signal;
676
+ return ret;
677
+ }
678
+ export function __wbg_stack_3b0d974bbf31e44f(arg0, arg1) {
679
+ const ret = arg1.stack;
680
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
681
+ const len1 = WASM_VECTOR_LEN;
682
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
683
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
684
+ }
685
+ export function __wbg_static_accessor_GLOBAL_8adb955bd33fac2f() {
686
+ const ret = typeof global === 'undefined' ? null : global;
687
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
688
+ }
689
+ export function __wbg_static_accessor_GLOBAL_THIS_ad356e0db91c7913() {
690
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
691
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
692
+ }
693
+ export function __wbg_static_accessor_SELF_f207c857566db248() {
694
+ const ret = typeof self === 'undefined' ? null : self;
695
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
696
+ }
697
+ export function __wbg_static_accessor_WINDOW_bb9f1ba69d61b386() {
698
+ const ret = typeof window === 'undefined' ? null : window;
699
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
700
+ }
701
+ export function __wbg_status_318629ab93a22955(arg0) {
702
+ const ret = arg0.status;
703
+ return ret;
704
+ }
705
+ export function __wbg_subarray_a068d24e39478a8a(arg0, arg1, arg2) {
706
+ const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
707
+ return ret;
708
+ }
709
+ export function __wbg_text_372f5b91442c50f9() { return handleError(function (arg0) {
710
+ const ret = arg0.text();
711
+ return ret;
712
+ }, arguments); }
713
+ export function __wbg_then_098abe61755d12f6(arg0, arg1) {
714
+ const ret = arg0.then(arg1);
715
+ return ret;
716
+ }
717
+ export function __wbg_then_9e335f6dd892bc11(arg0, arg1, arg2) {
718
+ const ret = arg0.then(arg1, arg2);
719
+ return ret;
720
+ }
721
+ export function __wbg_url_7fefc1820fba4e0c(arg0, arg1) {
722
+ const ret = arg1.url;
723
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
724
+ const len1 = WASM_VECTOR_LEN;
725
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
726
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
727
+ }
728
+ export function __wbg_value_21fc78aab0322612(arg0) {
729
+ const ret = arg0.value;
730
+ return ret;
731
+ }
732
+ export function __wbg_versions_276b2795b1c6a219(arg0) {
733
+ const ret = arg0.versions;
734
+ return ret;
735
+ }
736
+ export function __wbg_view_f68a712e7315f8b2(arg0) {
737
+ const ret = arg0.view;
738
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
739
+ }
740
+ export function __wbg_wasmclient_new(arg0) {
741
+ const ret = WasmClient.__wrap(arg0);
742
+ return ret;
743
+ }
744
+ export function __wbindgen_cast_0000000000000001(arg0, arg1) {
745
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 494, function: Function { arguments: [], shim_idx: 495, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
746
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h379cc5f9ba73967b, wasm_bindgen__convert__closures_____invoke__hc060a2339985e908);
747
+ return ret;
748
+ }
749
+ export function __wbindgen_cast_0000000000000002(arg0, arg1) {
750
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 542, function: Function { arguments: [Externref], shim_idx: 543, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
751
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h18e55ed08acd10aa, wasm_bindgen__convert__closures_____invoke__h425499e9ab8a95b4);
752
+ return ret;
753
+ }
754
+ export function __wbindgen_cast_0000000000000003(arg0) {
755
+ // Cast intrinsic for `F64 -> Externref`.
756
+ const ret = arg0;
757
+ return ret;
758
+ }
759
+ export function __wbindgen_cast_0000000000000004(arg0) {
760
+ // Cast intrinsic for `I64 -> Externref`.
761
+ const ret = arg0;
762
+ return ret;
763
+ }
764
+ export function __wbindgen_cast_0000000000000005(arg0, arg1) {
765
+ // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
766
+ const ret = getArrayU8FromWasm0(arg0, arg1);
767
+ return ret;
768
+ }
769
+ export function __wbindgen_cast_0000000000000006(arg0, arg1) {
770
+ // Cast intrinsic for `Ref(String) -> Externref`.
771
+ const ret = getStringFromWasm0(arg0, arg1);
772
+ return ret;
773
+ }
774
+ export function __wbindgen_cast_0000000000000007(arg0) {
775
+ // Cast intrinsic for `U64 -> Externref`.
776
+ const ret = BigInt.asUintN(64, arg0);
777
+ return ret;
778
+ }
779
+ export function __wbindgen_init_externref_table() {
780
+ const table = wasm.__wbindgen_externrefs;
781
+ const offset = table.grow(4);
782
+ table.set(0, undefined);
783
+ table.set(offset + 0, undefined);
784
+ table.set(offset + 1, null);
785
+ table.set(offset + 2, true);
786
+ table.set(offset + 3, false);
787
+ }
788
+ function wasm_bindgen__convert__closures_____invoke__hc060a2339985e908(arg0, arg1) {
789
+ wasm.wasm_bindgen__convert__closures_____invoke__hc060a2339985e908(arg0, arg1);
790
+ }
791
+
792
+ function wasm_bindgen__convert__closures_____invoke__h425499e9ab8a95b4(arg0, arg1, arg2) {
793
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h425499e9ab8a95b4(arg0, arg1, arg2);
794
+ if (ret[1]) {
795
+ throw takeFromExternrefTable0(ret[0]);
796
+ }
797
+ }
798
+
799
+ function wasm_bindgen__convert__closures_____invoke__h1201fec59d36da32(arg0, arg1, arg2, arg3) {
800
+ wasm.wasm_bindgen__convert__closures_____invoke__h1201fec59d36da32(arg0, arg1, arg2, arg3);
801
+ }
802
+
803
+
804
+ const __wbindgen_enum_ReadableStreamType = ["bytes"];
805
+
806
+
807
+ const __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"];
808
+
809
+
810
+ const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
811
+
812
+
813
+ const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
814
+ const IntoUnderlyingByteSourceFinalization = (typeof FinalizationRegistry === 'undefined')
815
+ ? { register: () => {}, unregister: () => {} }
816
+ : new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingbytesource_free(ptr >>> 0, 1));
817
+ const IntoUnderlyingSinkFinalization = (typeof FinalizationRegistry === 'undefined')
818
+ ? { register: () => {}, unregister: () => {} }
819
+ : new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingsink_free(ptr >>> 0, 1));
820
+ const IntoUnderlyingSourceFinalization = (typeof FinalizationRegistry === 'undefined')
821
+ ? { register: () => {}, unregister: () => {} }
822
+ : new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingsource_free(ptr >>> 0, 1));
823
+ const WasmClientFinalization = (typeof FinalizationRegistry === 'undefined')
824
+ ? { register: () => {}, unregister: () => {} }
825
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmclient_free(ptr >>> 0, 1));
826
+
827
+ function addToExternrefTable0(obj) {
828
+ const idx = wasm.__externref_table_alloc();
829
+ wasm.__wbindgen_externrefs.set(idx, obj);
830
+ return idx;
831
+ }
832
+
833
+ function _assertClass(instance, klass) {
834
+ if (!(instance instanceof klass)) {
835
+ throw new Error(`expected instance of ${klass.name}`);
836
+ }
837
+ }
838
+
839
+ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
840
+ ? { register: () => {}, unregister: () => {} }
841
+ : new FinalizationRegistry(state => state.dtor(state.a, state.b));
842
+
843
+ function debugString(val) {
844
+ // primitive types
845
+ const type = typeof val;
846
+ if (type == 'number' || type == 'boolean' || val == null) {
847
+ return `${val}`;
848
+ }
849
+ if (type == 'string') {
850
+ return `"${val}"`;
851
+ }
852
+ if (type == 'symbol') {
853
+ const description = val.description;
854
+ if (description == null) {
855
+ return 'Symbol';
856
+ } else {
857
+ return `Symbol(${description})`;
858
+ }
859
+ }
860
+ if (type == 'function') {
861
+ const name = val.name;
862
+ if (typeof name == 'string' && name.length > 0) {
863
+ return `Function(${name})`;
864
+ } else {
865
+ return 'Function';
866
+ }
867
+ }
868
+ // objects
869
+ if (Array.isArray(val)) {
870
+ const length = val.length;
871
+ let debug = '[';
872
+ if (length > 0) {
873
+ debug += debugString(val[0]);
874
+ }
875
+ for(let i = 1; i < length; i++) {
876
+ debug += ', ' + debugString(val[i]);
877
+ }
878
+ debug += ']';
879
+ return debug;
880
+ }
881
+ // Test for built-in
882
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
883
+ let className;
884
+ if (builtInMatches && builtInMatches.length > 1) {
885
+ className = builtInMatches[1];
886
+ } else {
887
+ // Failed to match the standard '[object ClassName]'
888
+ return toString.call(val);
889
+ }
890
+ if (className == 'Object') {
891
+ // we're a user defined class or Object
892
+ // JSON.stringify avoids problems with cycles, and is generally much
893
+ // easier than looping through ownProperties of `val`.
894
+ try {
895
+ return 'Object(' + JSON.stringify(val) + ')';
896
+ } catch (_) {
897
+ return 'Object';
898
+ }
899
+ }
900
+ // errors
901
+ if (val instanceof Error) {
902
+ return `${val.name}: ${val.message}\n${val.stack}`;
903
+ }
904
+ // TODO we could test for more things here, like `Set`s and `Map`s.
905
+ return className;
906
+ }
907
+
908
+ function getArrayU8FromWasm0(ptr, len) {
909
+ ptr = ptr >>> 0;
910
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
911
+ }
912
+
913
+ let cachedDataViewMemory0 = null;
914
+ function getDataViewMemory0() {
915
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
916
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
917
+ }
918
+ return cachedDataViewMemory0;
919
+ }
920
+
921
+ function getStringFromWasm0(ptr, len) {
922
+ ptr = ptr >>> 0;
923
+ return decodeText(ptr, len);
924
+ }
925
+
926
+ let cachedUint8ArrayMemory0 = null;
927
+ function getUint8ArrayMemory0() {
928
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
929
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
930
+ }
931
+ return cachedUint8ArrayMemory0;
932
+ }
933
+
934
+ function handleError(f, args) {
935
+ try {
936
+ return f.apply(this, args);
937
+ } catch (e) {
938
+ const idx = addToExternrefTable0(e);
939
+ wasm.__wbindgen_exn_store(idx);
940
+ }
941
+ }
942
+
943
+ function isLikeNone(x) {
944
+ return x === undefined || x === null;
945
+ }
946
+
947
+ function makeMutClosure(arg0, arg1, dtor, f) {
948
+ const state = { a: arg0, b: arg1, cnt: 1, dtor };
949
+ const real = (...args) => {
950
+
951
+ // First up with a closure we increment the internal reference
952
+ // count. This ensures that the Rust closure environment won't
953
+ // be deallocated while we're invoking it.
954
+ state.cnt++;
955
+ const a = state.a;
956
+ state.a = 0;
957
+ try {
958
+ return f(a, state.b, ...args);
959
+ } finally {
960
+ state.a = a;
961
+ real._wbg_cb_unref();
962
+ }
963
+ };
964
+ real._wbg_cb_unref = () => {
965
+ if (--state.cnt === 0) {
966
+ state.dtor(state.a, state.b);
967
+ state.a = 0;
968
+ CLOSURE_DTORS.unregister(state);
969
+ }
970
+ };
971
+ CLOSURE_DTORS.register(real, state, state);
972
+ return real;
973
+ }
974
+
975
+ function passStringToWasm0(arg, malloc, realloc) {
976
+ if (realloc === undefined) {
977
+ const buf = cachedTextEncoder.encode(arg);
978
+ const ptr = malloc(buf.length, 1) >>> 0;
979
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
980
+ WASM_VECTOR_LEN = buf.length;
981
+ return ptr;
982
+ }
983
+
984
+ let len = arg.length;
985
+ let ptr = malloc(len, 1) >>> 0;
986
+
987
+ const mem = getUint8ArrayMemory0();
988
+
989
+ let offset = 0;
990
+
991
+ for (; offset < len; offset++) {
992
+ const code = arg.charCodeAt(offset);
993
+ if (code > 0x7F) break;
994
+ mem[ptr + offset] = code;
995
+ }
996
+ if (offset !== len) {
997
+ if (offset !== 0) {
998
+ arg = arg.slice(offset);
999
+ }
1000
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
1001
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
1002
+ const ret = cachedTextEncoder.encodeInto(arg, view);
1003
+
1004
+ offset += ret.written;
1005
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
1006
+ }
1007
+
1008
+ WASM_VECTOR_LEN = offset;
1009
+ return ptr;
1010
+ }
1011
+
1012
+ function takeFromExternrefTable0(idx) {
1013
+ const value = wasm.__wbindgen_externrefs.get(idx);
1014
+ wasm.__externref_table_dealloc(idx);
1015
+ return value;
1016
+ }
1017
+
1018
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
1019
+ cachedTextDecoder.decode();
1020
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
1021
+ let numBytesDecoded = 0;
1022
+ function decodeText(ptr, len) {
1023
+ numBytesDecoded += len;
1024
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
1025
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
1026
+ cachedTextDecoder.decode();
1027
+ numBytesDecoded = len;
1028
+ }
1029
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
1030
+ }
1031
+
1032
+ const cachedTextEncoder = new TextEncoder();
1033
+
1034
+ if (!('encodeInto' in cachedTextEncoder)) {
1035
+ cachedTextEncoder.encodeInto = function (arg, view) {
1036
+ const buf = cachedTextEncoder.encode(arg);
1037
+ view.set(buf);
1038
+ return {
1039
+ read: arg.length,
1040
+ written: buf.length
1041
+ };
1042
+ };
1043
+ }
1044
+
1045
+ let WASM_VECTOR_LEN = 0;
1046
+
1047
+
1048
+ let wasm;
1049
+ export function __wbg_set_wasm(val) {
1050
+ wasm = val;
1051
+ }