@bitwarden/sdk-internal 0.2.0-main.22 → 0.2.0-main.221

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.
@@ -3,12 +3,15 @@ export function __wbg_set_wasm(val) {
3
3
  wasm = val;
4
4
  }
5
5
 
6
- const lTextDecoder =
7
- typeof TextDecoder === "undefined" ? (0, module.require)("util").TextDecoder : TextDecoder;
6
+ const heap = new Array(128).fill(undefined);
8
7
 
9
- let cachedTextDecoder = new lTextDecoder("utf-8", { ignoreBOM: true, fatal: true });
8
+ heap.push(undefined, null, true, false);
10
9
 
11
- cachedTextDecoder.decode();
10
+ function getObject(idx) {
11
+ return heap[idx];
12
+ }
13
+
14
+ let WASM_VECTOR_LEN = 0;
12
15
 
13
16
  let cachedUint8ArrayMemory0 = null;
14
17
 
@@ -19,44 +22,6 @@ function getUint8ArrayMemory0() {
19
22
  return cachedUint8ArrayMemory0;
20
23
  }
21
24
 
22
- function getStringFromWasm0(ptr, len) {
23
- ptr = ptr >>> 0;
24
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
25
- }
26
-
27
- const heap = new Array(128).fill(undefined);
28
-
29
- heap.push(undefined, null, true, false);
30
-
31
- let heap_next = heap.length;
32
-
33
- function addHeapObject(obj) {
34
- if (heap_next === heap.length) heap.push(heap.length + 1);
35
- const idx = heap_next;
36
- heap_next = heap[idx];
37
-
38
- heap[idx] = obj;
39
- return idx;
40
- }
41
-
42
- function getObject(idx) {
43
- return heap[idx];
44
- }
45
-
46
- function dropObject(idx) {
47
- if (idx < 132) return;
48
- heap[idx] = heap_next;
49
- heap_next = idx;
50
- }
51
-
52
- function takeObject(idx) {
53
- const ret = getObject(idx);
54
- dropObject(idx);
55
- return ret;
56
- }
57
-
58
- let WASM_VECTOR_LEN = 0;
59
-
60
25
  const lTextEncoder =
61
26
  typeof TextEncoder === "undefined" ? (0, module.require)("util").TextEncoder : TextEncoder;
62
27
 
@@ -116,10 +81,6 @@ function passStringToWasm0(arg, malloc, realloc) {
116
81
  return ptr;
117
82
  }
118
83
 
119
- function isLikeNone(x) {
120
- return x === undefined || x === null;
121
- }
122
-
123
84
  let cachedDataViewMemory0 = null;
124
85
 
125
86
  function getDataViewMemory0() {
@@ -134,6 +95,90 @@ function getDataViewMemory0() {
134
95
  return cachedDataViewMemory0;
135
96
  }
136
97
 
98
+ const lTextDecoder =
99
+ typeof TextDecoder === "undefined" ? (0, module.require)("util").TextDecoder : TextDecoder;
100
+
101
+ let cachedTextDecoder = new lTextDecoder("utf-8", { ignoreBOM: true, fatal: true });
102
+
103
+ cachedTextDecoder.decode();
104
+
105
+ function getStringFromWasm0(ptr, len) {
106
+ ptr = ptr >>> 0;
107
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
108
+ }
109
+
110
+ let heap_next = heap.length;
111
+
112
+ function addHeapObject(obj) {
113
+ if (heap_next === heap.length) heap.push(heap.length + 1);
114
+ const idx = heap_next;
115
+ heap_next = heap[idx];
116
+
117
+ heap[idx] = obj;
118
+ return idx;
119
+ }
120
+
121
+ function handleError(f, args) {
122
+ try {
123
+ return f.apply(this, args);
124
+ } catch (e) {
125
+ wasm.__wbindgen_exn_store(addHeapObject(e));
126
+ }
127
+ }
128
+
129
+ function dropObject(idx) {
130
+ if (idx < 132) return;
131
+ heap[idx] = heap_next;
132
+ heap_next = idx;
133
+ }
134
+
135
+ function takeObject(idx) {
136
+ const ret = getObject(idx);
137
+ dropObject(idx);
138
+ return ret;
139
+ }
140
+
141
+ function getArrayU8FromWasm0(ptr, len) {
142
+ ptr = ptr >>> 0;
143
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
144
+ }
145
+
146
+ function isLikeNone(x) {
147
+ return x === undefined || x === null;
148
+ }
149
+
150
+ const CLOSURE_DTORS =
151
+ typeof FinalizationRegistry === "undefined"
152
+ ? { register: () => {}, unregister: () => {} }
153
+ : new FinalizationRegistry((state) => {
154
+ wasm.__wbindgen_export_4.get(state.dtor)(state.a, state.b);
155
+ });
156
+
157
+ function makeMutClosure(arg0, arg1, dtor, f) {
158
+ const state = { a: arg0, b: arg1, cnt: 1, dtor };
159
+ const real = (...args) => {
160
+ // First up with a closure we increment the internal reference
161
+ // count. This ensures that the Rust closure environment won't
162
+ // be deallocated while we're invoking it.
163
+ state.cnt++;
164
+ const a = state.a;
165
+ state.a = 0;
166
+ try {
167
+ return f(a, state.b, ...args);
168
+ } finally {
169
+ if (--state.cnt === 0) {
170
+ wasm.__wbindgen_export_4.get(state.dtor)(a, state.b);
171
+ CLOSURE_DTORS.unregister(state);
172
+ } else {
173
+ state.a = a;
174
+ }
175
+ }
176
+ };
177
+ real.original = state;
178
+ CLOSURE_DTORS.register(real, state, state);
179
+ return real;
180
+ }
181
+
137
182
  function debugString(val) {
138
183
  // primitive types
139
184
  const type = typeof val;
@@ -175,7 +220,7 @@ function debugString(val) {
175
220
  // Test for built-in
176
221
  const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
177
222
  let className;
178
- if (builtInMatches.length > 1) {
223
+ if (builtInMatches && builtInMatches.length > 1) {
179
224
  className = builtInMatches[1];
180
225
  } else {
181
226
  // Failed to match the standard '[object ClassName]'
@@ -199,45 +244,6 @@ function debugString(val) {
199
244
  return className;
200
245
  }
201
246
 
202
- const CLOSURE_DTORS =
203
- typeof FinalizationRegistry === "undefined"
204
- ? { register: () => {}, unregister: () => {} }
205
- : new FinalizationRegistry((state) => {
206
- wasm.__wbindgen_export_2.get(state.dtor)(state.a, state.b);
207
- });
208
-
209
- function makeMutClosure(arg0, arg1, dtor, f) {
210
- const state = { a: arg0, b: arg1, cnt: 1, dtor };
211
- const real = (...args) => {
212
- // First up with a closure we increment the internal reference
213
- // count. This ensures that the Rust closure environment won't
214
- // be deallocated while we're invoking it.
215
- state.cnt++;
216
- const a = state.a;
217
- state.a = 0;
218
- try {
219
- return f(a, state.b, ...args);
220
- } finally {
221
- if (--state.cnt === 0) {
222
- wasm.__wbindgen_export_2.get(state.dtor)(a, state.b);
223
- CLOSURE_DTORS.unregister(state);
224
- } else {
225
- state.a = a;
226
- }
227
- }
228
- };
229
- real.original = state;
230
- CLOSURE_DTORS.register(real, state, state);
231
- return real;
232
- }
233
- function __wbg_adapter_38(arg0, arg1, arg2) {
234
- wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h6bfa1aa5cb44e9c6(
235
- arg0,
236
- arg1,
237
- addHeapObject(arg2),
238
- );
239
- }
240
-
241
247
  let stack_pointer = 128;
242
248
 
243
249
  function addBorrowedObject(obj) {
@@ -249,9 +255,35 @@ function addBorrowedObject(obj) {
249
255
  * @param {any} error
250
256
  * @returns {boolean}
251
257
  */
252
- export function isCoreError(error) {
258
+ export function isDeriveKeyConnectorError(error) {
259
+ try {
260
+ const ret = wasm.isDeriveKeyConnectorError(addBorrowedObject(error));
261
+ return ret !== 0;
262
+ } finally {
263
+ heap[stack_pointer++] = undefined;
264
+ }
265
+ }
266
+
267
+ /**
268
+ * @param {any} error
269
+ * @returns {boolean}
270
+ */
271
+ export function isEnrollAdminPasswordResetError(error) {
272
+ try {
273
+ const ret = wasm.isEnrollAdminPasswordResetError(addBorrowedObject(error));
274
+ return ret !== 0;
275
+ } finally {
276
+ heap[stack_pointer++] = undefined;
277
+ }
278
+ }
279
+
280
+ /**
281
+ * @param {any} error
282
+ * @returns {boolean}
283
+ */
284
+ export function isCryptoClientError(error) {
253
285
  try {
254
- const ret = wasm.isCoreError(addBorrowedObject(error));
286
+ const ret = wasm.isCryptoClientError(addBorrowedObject(error));
255
287
  return ret !== 0;
256
288
  } finally {
257
289
  heap[stack_pointer++] = undefined;
@@ -275,22 +307,41 @@ export function isEncryptionSettingsError(error) {
275
307
  * @param {any} error
276
308
  * @returns {boolean}
277
309
  */
278
- export function isKeyGenerationError(error) {
310
+ export function isCryptoError(error) {
279
311
  try {
280
- const ret = wasm.isKeyGenerationError(addBorrowedObject(error));
312
+ const ret = wasm.isCryptoError(addBorrowedObject(error));
281
313
  return ret !== 0;
282
314
  } finally {
283
315
  heap[stack_pointer++] = undefined;
284
316
  }
285
317
  }
286
318
 
319
+ function passArrayJsValueToWasm0(array, malloc) {
320
+ const ptr = malloc(array.length * 4, 4) >>> 0;
321
+ const mem = getDataViewMemory0();
322
+ for (let i = 0; i < array.length; i++) {
323
+ mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
324
+ }
325
+ WASM_VECTOR_LEN = array.length;
326
+ return ptr;
327
+ }
328
+
329
+ function getArrayJsValueFromWasm0(ptr, len) {
330
+ ptr = ptr >>> 0;
331
+ const mem = getDataViewMemory0();
332
+ const result = [];
333
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
334
+ result.push(takeObject(mem.getUint32(i, true)));
335
+ }
336
+ return result;
337
+ }
287
338
  /**
288
339
  * @param {any} error
289
340
  * @returns {boolean}
290
341
  */
291
- export function isTestError(error) {
342
+ export function isExportError(error) {
292
343
  try {
293
- const ret = wasm.isTestError(addBorrowedObject(error));
344
+ const ret = wasm.isExportError(addBorrowedObject(error));
294
345
  return ret !== 0;
295
346
  } finally {
296
347
  heap[stack_pointer++] = undefined;
@@ -298,42 +349,520 @@ export function isTestError(error) {
298
349
  }
299
350
 
300
351
  /**
301
- * @param {KeyAlgorithm} key_algorithm
302
- * @returns {GenerateSshKeyResult}
352
+ * @param {any} error
353
+ * @returns {boolean}
303
354
  */
304
- export function generate_ssh_key(key_algorithm) {
355
+ export function isUsernameError(error) {
305
356
  try {
306
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
307
- wasm.generate_ssh_key(retptr, addHeapObject(key_algorithm));
308
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
309
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
310
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
311
- if (r2) {
312
- throw takeObject(r1);
313
- }
314
- return takeObject(r0);
357
+ const ret = wasm.isUsernameError(addBorrowedObject(error));
358
+ return ret !== 0;
315
359
  } finally {
316
- wasm.__wbindgen_add_to_stack_pointer(16);
360
+ heap[stack_pointer++] = undefined;
317
361
  }
318
362
  }
319
363
 
320
- function handleError(f, args) {
364
+ /**
365
+ * @param {any} error
366
+ * @returns {boolean}
367
+ */
368
+ export function isPasswordError(error) {
321
369
  try {
322
- return f.apply(this, args);
323
- } catch (e) {
324
- wasm.__wbindgen_exn_store(addHeapObject(e));
370
+ const ret = wasm.isPasswordError(addBorrowedObject(error));
371
+ return ret !== 0;
372
+ } finally {
373
+ heap[stack_pointer++] = undefined;
325
374
  }
326
375
  }
327
- function __wbg_adapter_125(arg0, arg1, arg2, arg3) {
328
- wasm.wasm_bindgen__convert__closures__invoke2_mut__h7117afb49db7a7fd(
329
- arg0,
330
- arg1,
331
- addHeapObject(arg2),
332
- addHeapObject(arg3),
376
+
377
+ /**
378
+ * @param {any} error
379
+ * @returns {boolean}
380
+ */
381
+ export function isPassphraseError(error) {
382
+ try {
383
+ const ret = wasm.isPassphraseError(addBorrowedObject(error));
384
+ return ret !== 0;
385
+ } finally {
386
+ heap[stack_pointer++] = undefined;
387
+ }
388
+ }
389
+
390
+ function passArray8ToWasm0(arg, malloc) {
391
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
392
+ getUint8ArrayMemory0().set(arg, ptr / 1);
393
+ WASM_VECTOR_LEN = arg.length;
394
+ return ptr;
395
+ }
396
+
397
+ function _assertClass(instance, klass) {
398
+ if (!(instance instanceof klass)) {
399
+ throw new Error(`expected instance of ${klass.name}`);
400
+ }
401
+ }
402
+ /**
403
+ * Registers a DiscoverHandler so that the client can respond to DiscoverRequests.
404
+ * @param {IpcClient} ipc_client
405
+ * @param {DiscoverResponse} response
406
+ * @returns {Promise<void>}
407
+ */
408
+ export function ipcRegisterDiscoverHandler(ipc_client, response) {
409
+ _assertClass(ipc_client, IpcClient);
410
+ const ret = wasm.ipcRegisterDiscoverHandler(ipc_client.__wbg_ptr, addHeapObject(response));
411
+ return takeObject(ret);
412
+ }
413
+
414
+ /**
415
+ * Sends a DiscoverRequest to the specified destination and returns the response.
416
+ * @param {IpcClient} ipc_client
417
+ * @param {Endpoint} destination
418
+ * @param {AbortSignal | null} [abort_signal]
419
+ * @returns {Promise<DiscoverResponse>}
420
+ */
421
+ export function ipcRequestDiscover(ipc_client, destination, abort_signal) {
422
+ _assertClass(ipc_client, IpcClient);
423
+ const ret = wasm.ipcRequestDiscover(
424
+ ipc_client.__wbg_ptr,
425
+ addHeapObject(destination),
426
+ isLikeNone(abort_signal) ? 0 : addHeapObject(abort_signal),
333
427
  );
428
+ return takeObject(ret);
334
429
  }
335
430
 
336
- export const LogLevel = Object.freeze({
431
+ /**
432
+ * @param {any} error
433
+ * @returns {boolean}
434
+ */
435
+ export function isChannelError(error) {
436
+ try {
437
+ const ret = wasm.isChannelError(addBorrowedObject(error));
438
+ return ret !== 0;
439
+ } finally {
440
+ heap[stack_pointer++] = undefined;
441
+ }
442
+ }
443
+
444
+ /**
445
+ * @param {any} error
446
+ * @returns {boolean}
447
+ */
448
+ export function isDeserializeError(error) {
449
+ try {
450
+ const ret = wasm.isDeserializeError(addBorrowedObject(error));
451
+ return ret !== 0;
452
+ } finally {
453
+ heap[stack_pointer++] = undefined;
454
+ }
455
+ }
456
+
457
+ /**
458
+ * @param {any} error
459
+ * @returns {boolean}
460
+ */
461
+ export function isRequestError(error) {
462
+ try {
463
+ const ret = wasm.isRequestError(addBorrowedObject(error));
464
+ return ret !== 0;
465
+ } finally {
466
+ heap[stack_pointer++] = undefined;
467
+ }
468
+ }
469
+
470
+ /**
471
+ * @param {any} error
472
+ * @returns {boolean}
473
+ */
474
+ export function isTypedReceiveError(error) {
475
+ try {
476
+ const ret = wasm.isTypedReceiveError(addBorrowedObject(error));
477
+ return ret !== 0;
478
+ } finally {
479
+ heap[stack_pointer++] = undefined;
480
+ }
481
+ }
482
+
483
+ /**
484
+ * @param {any} error
485
+ * @returns {boolean}
486
+ */
487
+ export function isReceiveError(error) {
488
+ try {
489
+ const ret = wasm.isReceiveError(addBorrowedObject(error));
490
+ return ret !== 0;
491
+ } finally {
492
+ heap[stack_pointer++] = undefined;
493
+ }
494
+ }
495
+
496
+ /**
497
+ * @param {any} error
498
+ * @returns {boolean}
499
+ */
500
+ export function isSubscribeError(error) {
501
+ try {
502
+ const ret = wasm.isSubscribeError(addBorrowedObject(error));
503
+ return ret !== 0;
504
+ } finally {
505
+ heap[stack_pointer++] = undefined;
506
+ }
507
+ }
508
+
509
+ /**
510
+ * @param {any} error
511
+ * @returns {boolean}
512
+ */
513
+ export function isSshKeyExportError(error) {
514
+ try {
515
+ const ret = wasm.isSshKeyExportError(addBorrowedObject(error));
516
+ return ret !== 0;
517
+ } finally {
518
+ heap[stack_pointer++] = undefined;
519
+ }
520
+ }
521
+
522
+ /**
523
+ * @param {any} error
524
+ * @returns {boolean}
525
+ */
526
+ export function isSshKeyImportError(error) {
527
+ try {
528
+ const ret = wasm.isSshKeyImportError(addBorrowedObject(error));
529
+ return ret !== 0;
530
+ } finally {
531
+ heap[stack_pointer++] = undefined;
532
+ }
533
+ }
534
+
535
+ /**
536
+ * @param {any} error
537
+ * @returns {boolean}
538
+ */
539
+ export function isKeyGenerationError(error) {
540
+ try {
541
+ const ret = wasm.isKeyGenerationError(addBorrowedObject(error));
542
+ return ret !== 0;
543
+ } finally {
544
+ heap[stack_pointer++] = undefined;
545
+ }
546
+ }
547
+
548
+ /**
549
+ * @param {any} error
550
+ * @returns {boolean}
551
+ */
552
+ export function isCallError(error) {
553
+ try {
554
+ const ret = wasm.isCallError(addBorrowedObject(error));
555
+ return ret !== 0;
556
+ } finally {
557
+ heap[stack_pointer++] = undefined;
558
+ }
559
+ }
560
+
561
+ /**
562
+ * @param {any} error
563
+ * @returns {boolean}
564
+ */
565
+ export function isDecryptError(error) {
566
+ try {
567
+ const ret = wasm.isDecryptError(addBorrowedObject(error));
568
+ return ret !== 0;
569
+ } finally {
570
+ heap[stack_pointer++] = undefined;
571
+ }
572
+ }
573
+
574
+ /**
575
+ * @param {any} error
576
+ * @returns {boolean}
577
+ */
578
+ export function isEncryptError(error) {
579
+ try {
580
+ const ret = wasm.isEncryptError(addBorrowedObject(error));
581
+ return ret !== 0;
582
+ } finally {
583
+ heap[stack_pointer++] = undefined;
584
+ }
585
+ }
586
+
587
+ /**
588
+ * @param {any} error
589
+ * @returns {boolean}
590
+ */
591
+ export function isTotpError(error) {
592
+ try {
593
+ const ret = wasm.isTotpError(addBorrowedObject(error));
594
+ return ret !== 0;
595
+ } finally {
596
+ heap[stack_pointer++] = undefined;
597
+ }
598
+ }
599
+
600
+ /**
601
+ * @param {any} error
602
+ * @returns {boolean}
603
+ */
604
+ export function isCipherError(error) {
605
+ try {
606
+ const ret = wasm.isCipherError(addBorrowedObject(error));
607
+ return ret !== 0;
608
+ } finally {
609
+ heap[stack_pointer++] = undefined;
610
+ }
611
+ }
612
+
613
+ /**
614
+ * @param {any} error
615
+ * @returns {boolean}
616
+ */
617
+ export function isDecryptFileError(error) {
618
+ try {
619
+ const ret = wasm.isDecryptFileError(addBorrowedObject(error));
620
+ return ret !== 0;
621
+ } finally {
622
+ heap[stack_pointer++] = undefined;
623
+ }
624
+ }
625
+
626
+ /**
627
+ * @param {any} error
628
+ * @returns {boolean}
629
+ */
630
+ export function isEncryptFileError(error) {
631
+ try {
632
+ const ret = wasm.isEncryptFileError(addBorrowedObject(error));
633
+ return ret !== 0;
634
+ } finally {
635
+ heap[stack_pointer++] = undefined;
636
+ }
637
+ }
638
+
639
+ /**
640
+ * @param {LogLevel} level
641
+ */
642
+ export function set_log_level(level) {
643
+ wasm.set_log_level(level);
644
+ }
645
+
646
+ /**
647
+ * @param {LogLevel | null} [log_level]
648
+ */
649
+ export function init_sdk(log_level) {
650
+ wasm.init_sdk(isLikeNone(log_level) ? 5 : log_level);
651
+ }
652
+
653
+ /**
654
+ * Generate a new SSH key pair
655
+ *
656
+ * # Arguments
657
+ * - `key_algorithm` - The algorithm to use for the key pair
658
+ *
659
+ * # Returns
660
+ * - `Ok(SshKey)` if the key was successfully generated
661
+ * - `Err(KeyGenerationError)` if the key could not be generated
662
+ * @param {KeyAlgorithm} key_algorithm
663
+ * @returns {SshKeyView}
664
+ */
665
+ export function generate_ssh_key(key_algorithm) {
666
+ try {
667
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
668
+ wasm.generate_ssh_key(retptr, addHeapObject(key_algorithm));
669
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
670
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
671
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
672
+ if (r2) {
673
+ throw takeObject(r1);
674
+ }
675
+ return takeObject(r0);
676
+ } finally {
677
+ wasm.__wbindgen_add_to_stack_pointer(16);
678
+ }
679
+ }
680
+
681
+ /**
682
+ * Convert a PCKS8 or OpenSSH encrypted or unencrypted private key
683
+ * to an OpenSSH private key with public key and fingerprint
684
+ *
685
+ * # Arguments
686
+ * - `imported_key` - The private key to convert
687
+ * - `password` - The password to use for decrypting the key
688
+ *
689
+ * # Returns
690
+ * - `Ok(SshKey)` if the key was successfully coneverted
691
+ * - `Err(PasswordRequired)` if the key is encrypted and no password was provided
692
+ * - `Err(WrongPassword)` if the password provided is incorrect
693
+ * - `Err(ParsingError)` if the key could not be parsed
694
+ * - `Err(UnsupportedKeyType)` if the key type is not supported
695
+ * @param {string} imported_key
696
+ * @param {string | null} [password]
697
+ * @returns {SshKeyView}
698
+ */
699
+ export function import_ssh_key(imported_key, password) {
700
+ try {
701
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
702
+ const ptr0 = passStringToWasm0(imported_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
703
+ const len0 = WASM_VECTOR_LEN;
704
+ var ptr1 = isLikeNone(password)
705
+ ? 0
706
+ : passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
707
+ var len1 = WASM_VECTOR_LEN;
708
+ wasm.import_ssh_key(retptr, ptr0, len0, ptr1, len1);
709
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
710
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
711
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
712
+ if (r2) {
713
+ throw takeObject(r1);
714
+ }
715
+ return takeObject(r0);
716
+ } finally {
717
+ wasm.__wbindgen_add_to_stack_pointer(16);
718
+ }
719
+ }
720
+
721
+ /**
722
+ * @param {any} error
723
+ * @returns {boolean}
724
+ */
725
+ export function isTestError(error) {
726
+ try {
727
+ const ret = wasm.isTestError(addBorrowedObject(error));
728
+ return ret !== 0;
729
+ } finally {
730
+ heap[stack_pointer++] = undefined;
731
+ }
732
+ }
733
+
734
+ function __wbg_adapter_50(arg0, arg1) {
735
+ wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h31333524c3115e44(
736
+ arg0,
737
+ arg1,
738
+ );
739
+ }
740
+
741
+ function __wbg_adapter_53(arg0, arg1) {
742
+ wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h2b093e5f83b42fbd(
743
+ arg0,
744
+ arg1,
745
+ );
746
+ }
747
+
748
+ function __wbg_adapter_56(arg0, arg1, arg2) {
749
+ wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hb01d8be1001e4f40(
750
+ arg0,
751
+ arg1,
752
+ addHeapObject(arg2),
753
+ );
754
+ }
755
+
756
+ function __wbg_adapter_277(arg0, arg1, arg2, arg3) {
757
+ wasm.wasm_bindgen__convert__closures__invoke2_mut__h8776500d04a3e634(
758
+ arg0,
759
+ arg1,
760
+ addHeapObject(arg2),
761
+ addHeapObject(arg3),
762
+ );
763
+ }
764
+
765
+ /**
766
+ * @enum {300 | 301 | 302 | 303 | 304 | 305}
767
+ */
768
+ export const CardLinkedIdType = Object.freeze({
769
+ CardholderName: 300,
770
+ 300: "CardholderName",
771
+ ExpMonth: 301,
772
+ 301: "ExpMonth",
773
+ ExpYear: 302,
774
+ 302: "ExpYear",
775
+ Code: 303,
776
+ 303: "Code",
777
+ Brand: 304,
778
+ 304: "Brand",
779
+ Number: 305,
780
+ 305: "Number",
781
+ });
782
+ /**
783
+ * @enum {0 | 1}
784
+ */
785
+ export const CipherRepromptType = Object.freeze({
786
+ None: 0,
787
+ 0: "None",
788
+ Password: 1,
789
+ 1: "Password",
790
+ });
791
+ /**
792
+ * @enum {1 | 2 | 3 | 4 | 5}
793
+ */
794
+ export const CipherType = Object.freeze({
795
+ Login: 1,
796
+ 1: "Login",
797
+ SecureNote: 2,
798
+ 2: "SecureNote",
799
+ Card: 3,
800
+ 3: "Card",
801
+ Identity: 4,
802
+ 4: "Identity",
803
+ SshKey: 5,
804
+ 5: "SshKey",
805
+ });
806
+ /**
807
+ * @enum {0 | 1 | 2 | 3}
808
+ */
809
+ export const FieldType = Object.freeze({
810
+ Text: 0,
811
+ 0: "Text",
812
+ Hidden: 1,
813
+ 1: "Hidden",
814
+ Boolean: 2,
815
+ 2: "Boolean",
816
+ Linked: 3,
817
+ 3: "Linked",
818
+ });
819
+ /**
820
+ * @enum {400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418}
821
+ */
822
+ export const IdentityLinkedIdType = Object.freeze({
823
+ Title: 400,
824
+ 400: "Title",
825
+ MiddleName: 401,
826
+ 401: "MiddleName",
827
+ Address1: 402,
828
+ 402: "Address1",
829
+ Address2: 403,
830
+ 403: "Address2",
831
+ Address3: 404,
832
+ 404: "Address3",
833
+ City: 405,
834
+ 405: "City",
835
+ State: 406,
836
+ 406: "State",
837
+ PostalCode: 407,
838
+ 407: "PostalCode",
839
+ Country: 408,
840
+ 408: "Country",
841
+ Company: 409,
842
+ 409: "Company",
843
+ Email: 410,
844
+ 410: "Email",
845
+ Phone: 411,
846
+ 411: "Phone",
847
+ Ssn: 412,
848
+ 412: "Ssn",
849
+ Username: 413,
850
+ 413: "Username",
851
+ PassportNumber: 414,
852
+ 414: "PassportNumber",
853
+ LicenseNumber: 415,
854
+ 415: "LicenseNumber",
855
+ FirstName: 416,
856
+ 416: "FirstName",
857
+ LastName: 417,
858
+ 417: "LastName",
859
+ FullName: 418,
860
+ 418: "FullName",
861
+ });
862
+ /**
863
+ * @enum {0 | 1 | 2 | 3 | 4}
864
+ */
865
+ export const LogLevel = Object.freeze({
337
866
  Trace: 0,
338
867
  0: "Trace",
339
868
  Debug: 1,
@@ -345,201 +874,2261 @@ export const LogLevel = Object.freeze({
345
874
  Error: 4,
346
875
  4: "Error",
347
876
  });
877
+ /**
878
+ * @enum {100 | 101}
879
+ */
880
+ export const LoginLinkedIdType = Object.freeze({
881
+ Username: 100,
882
+ 100: "Username",
883
+ Password: 101,
884
+ 101: "Password",
885
+ });
886
+ /**
887
+ * @enum {0}
888
+ */
889
+ export const SecureNoteType = Object.freeze({
890
+ Generic: 0,
891
+ 0: "Generic",
892
+ });
893
+ /**
894
+ * @enum {0 | 1 | 2 | 3 | 4 | 5}
895
+ */
896
+ export const UriMatchType = Object.freeze({
897
+ Domain: 0,
898
+ 0: "Domain",
899
+ Host: 1,
900
+ 1: "Host",
901
+ StartsWith: 2,
902
+ 2: "StartsWith",
903
+ Exact: 3,
904
+ 3: "Exact",
905
+ RegularExpression: 4,
906
+ 4: "RegularExpression",
907
+ Never: 5,
908
+ 5: "Never",
909
+ });
910
+
911
+ const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
912
+
913
+ const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
914
+
915
+ const AttachmentsClientFinalization =
916
+ typeof FinalizationRegistry === "undefined"
917
+ ? { register: () => {}, unregister: () => {} }
918
+ : new FinalizationRegistry((ptr) => wasm.__wbg_attachmentsclient_free(ptr >>> 0, 1));
919
+
920
+ export class AttachmentsClient {
921
+ static __wrap(ptr) {
922
+ ptr = ptr >>> 0;
923
+ const obj = Object.create(AttachmentsClient.prototype);
924
+ obj.__wbg_ptr = ptr;
925
+ AttachmentsClientFinalization.register(obj, obj.__wbg_ptr, obj);
926
+ return obj;
927
+ }
928
+
929
+ __destroy_into_raw() {
930
+ const ptr = this.__wbg_ptr;
931
+ this.__wbg_ptr = 0;
932
+ AttachmentsClientFinalization.unregister(this);
933
+ return ptr;
934
+ }
935
+
936
+ free() {
937
+ const ptr = this.__destroy_into_raw();
938
+ wasm.__wbg_attachmentsclient_free(ptr, 0);
939
+ }
940
+ /**
941
+ * @param {Cipher} cipher
942
+ * @param {AttachmentView} attachment
943
+ * @param {Uint8Array} encrypted_buffer
944
+ * @returns {Uint8Array}
945
+ */
946
+ decrypt_buffer(cipher, attachment, encrypted_buffer) {
947
+ try {
948
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
949
+ const ptr0 = passArray8ToWasm0(encrypted_buffer, wasm.__wbindgen_malloc);
950
+ const len0 = WASM_VECTOR_LEN;
951
+ wasm.attachmentsclient_decrypt_buffer(
952
+ retptr,
953
+ this.__wbg_ptr,
954
+ addHeapObject(cipher),
955
+ addHeapObject(attachment),
956
+ ptr0,
957
+ len0,
958
+ );
959
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
960
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
961
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
962
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
963
+ if (r3) {
964
+ throw takeObject(r2);
965
+ }
966
+ var v2 = getArrayU8FromWasm0(r0, r1).slice();
967
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
968
+ return v2;
969
+ } finally {
970
+ wasm.__wbindgen_add_to_stack_pointer(16);
971
+ }
972
+ }
973
+ }
974
+
975
+ const BitwardenClientFinalization =
976
+ typeof FinalizationRegistry === "undefined"
977
+ ? { register: () => {}, unregister: () => {} }
978
+ : new FinalizationRegistry((ptr) => wasm.__wbg_bitwardenclient_free(ptr >>> 0, 1));
979
+
980
+ export class BitwardenClient {
981
+ __destroy_into_raw() {
982
+ const ptr = this.__wbg_ptr;
983
+ this.__wbg_ptr = 0;
984
+ BitwardenClientFinalization.unregister(this);
985
+ return ptr;
986
+ }
987
+
988
+ free() {
989
+ const ptr = this.__destroy_into_raw();
990
+ wasm.__wbg_bitwardenclient_free(ptr, 0);
991
+ }
992
+ /**
993
+ * @param {ClientSettings | null | undefined} settings
994
+ * @param {any} token_provider
995
+ */
996
+ constructor(settings, token_provider) {
997
+ const ret = wasm.bitwardenclient_new(
998
+ isLikeNone(settings) ? 0 : addHeapObject(settings),
999
+ addHeapObject(token_provider),
1000
+ );
1001
+ this.__wbg_ptr = ret >>> 0;
1002
+ BitwardenClientFinalization.register(this, this.__wbg_ptr, this);
1003
+ return this;
1004
+ }
1005
+ /**
1006
+ * Test method, echoes back the input
1007
+ * @param {string} msg
1008
+ * @returns {string}
1009
+ */
1010
+ echo(msg) {
1011
+ let deferred2_0;
1012
+ let deferred2_1;
1013
+ try {
1014
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1015
+ const ptr0 = passStringToWasm0(msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1016
+ const len0 = WASM_VECTOR_LEN;
1017
+ wasm.bitwardenclient_echo(retptr, this.__wbg_ptr, ptr0, len0);
1018
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1019
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1020
+ deferred2_0 = r0;
1021
+ deferred2_1 = r1;
1022
+ return getStringFromWasm0(r0, r1);
1023
+ } finally {
1024
+ wasm.__wbindgen_add_to_stack_pointer(16);
1025
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
1026
+ }
1027
+ }
1028
+ /**
1029
+ * @returns {string}
1030
+ */
1031
+ version() {
1032
+ let deferred1_0;
1033
+ let deferred1_1;
1034
+ try {
1035
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1036
+ wasm.bitwardenclient_version(retptr, this.__wbg_ptr);
1037
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1038
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1039
+ deferred1_0 = r0;
1040
+ deferred1_1 = r1;
1041
+ return getStringFromWasm0(r0, r1);
1042
+ } finally {
1043
+ wasm.__wbindgen_add_to_stack_pointer(16);
1044
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1045
+ }
1046
+ }
1047
+ /**
1048
+ * @param {string} msg
1049
+ */
1050
+ throw(msg) {
1051
+ try {
1052
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1053
+ const ptr0 = passStringToWasm0(msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1054
+ const len0 = WASM_VECTOR_LEN;
1055
+ wasm.bitwardenclient_throw(retptr, this.__wbg_ptr, ptr0, len0);
1056
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1057
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1058
+ if (r1) {
1059
+ throw takeObject(r0);
1060
+ }
1061
+ } finally {
1062
+ wasm.__wbindgen_add_to_stack_pointer(16);
1063
+ }
1064
+ }
1065
+ /**
1066
+ * Test method, calls http endpoint
1067
+ * @param {string} url
1068
+ * @returns {Promise<string>}
1069
+ */
1070
+ http_get(url) {
1071
+ const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1072
+ const len0 = WASM_VECTOR_LEN;
1073
+ const ret = wasm.bitwardenclient_http_get(this.__wbg_ptr, ptr0, len0);
1074
+ return takeObject(ret);
1075
+ }
1076
+ /**
1077
+ * @returns {CryptoClient}
1078
+ */
1079
+ crypto() {
1080
+ const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
1081
+ return CryptoClient.__wrap(ret);
1082
+ }
1083
+ /**
1084
+ * @returns {VaultClient}
1085
+ */
1086
+ vault() {
1087
+ const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
1088
+ return VaultClient.__wrap(ret);
1089
+ }
1090
+ /**
1091
+ * Constructs a specific client for platform-specific functionality
1092
+ * @returns {PlatformClient}
1093
+ */
1094
+ platform() {
1095
+ const ret = wasm.bitwardenclient_platform(this.__wbg_ptr);
1096
+ return PlatformClient.__wrap(ret);
1097
+ }
1098
+ /**
1099
+ * Constructs a specific client for generating passwords and passphrases
1100
+ * @returns {GeneratorClient}
1101
+ */
1102
+ generator() {
1103
+ const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
1104
+ return GeneratorClient.__wrap(ret);
1105
+ }
1106
+ /**
1107
+ * @returns {ExporterClient}
1108
+ */
1109
+ exporters() {
1110
+ const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
1111
+ return ExporterClient.__wrap(ret);
1112
+ }
1113
+ }
1114
+
1115
+ const CiphersClientFinalization =
1116
+ typeof FinalizationRegistry === "undefined"
1117
+ ? { register: () => {}, unregister: () => {} }
1118
+ : new FinalizationRegistry((ptr) => wasm.__wbg_ciphersclient_free(ptr >>> 0, 1));
1119
+
1120
+ export class CiphersClient {
1121
+ static __wrap(ptr) {
1122
+ ptr = ptr >>> 0;
1123
+ const obj = Object.create(CiphersClient.prototype);
1124
+ obj.__wbg_ptr = ptr;
1125
+ CiphersClientFinalization.register(obj, obj.__wbg_ptr, obj);
1126
+ return obj;
1127
+ }
1128
+
1129
+ __destroy_into_raw() {
1130
+ const ptr = this.__wbg_ptr;
1131
+ this.__wbg_ptr = 0;
1132
+ CiphersClientFinalization.unregister(this);
1133
+ return ptr;
1134
+ }
1135
+
1136
+ free() {
1137
+ const ptr = this.__destroy_into_raw();
1138
+ wasm.__wbg_ciphersclient_free(ptr, 0);
1139
+ }
1140
+ /**
1141
+ * @param {CipherView} cipher_view
1142
+ * @returns {EncryptionContext}
1143
+ */
1144
+ encrypt(cipher_view) {
1145
+ try {
1146
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1147
+ wasm.ciphersclient_encrypt(retptr, this.__wbg_ptr, addHeapObject(cipher_view));
1148
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1149
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1150
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1151
+ if (r2) {
1152
+ throw takeObject(r1);
1153
+ }
1154
+ return takeObject(r0);
1155
+ } finally {
1156
+ wasm.__wbindgen_add_to_stack_pointer(16);
1157
+ }
1158
+ }
1159
+ /**
1160
+ * @param {Cipher} cipher
1161
+ * @returns {CipherView}
1162
+ */
1163
+ decrypt(cipher) {
1164
+ try {
1165
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1166
+ wasm.ciphersclient_decrypt(retptr, this.__wbg_ptr, addHeapObject(cipher));
1167
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1168
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1169
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1170
+ if (r2) {
1171
+ throw takeObject(r1);
1172
+ }
1173
+ return takeObject(r0);
1174
+ } finally {
1175
+ wasm.__wbindgen_add_to_stack_pointer(16);
1176
+ }
1177
+ }
1178
+ /**
1179
+ * @param {Cipher[]} ciphers
1180
+ * @returns {CipherListView[]}
1181
+ */
1182
+ decrypt_list(ciphers) {
1183
+ try {
1184
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1185
+ const ptr0 = passArrayJsValueToWasm0(ciphers, wasm.__wbindgen_malloc);
1186
+ const len0 = WASM_VECTOR_LEN;
1187
+ wasm.ciphersclient_decrypt_list(retptr, this.__wbg_ptr, ptr0, len0);
1188
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1189
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1190
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1191
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1192
+ if (r3) {
1193
+ throw takeObject(r2);
1194
+ }
1195
+ var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
1196
+ wasm.__wbindgen_free(r0, r1 * 4, 4);
1197
+ return v2;
1198
+ } finally {
1199
+ wasm.__wbindgen_add_to_stack_pointer(16);
1200
+ }
1201
+ }
1202
+ /**
1203
+ * @param {CipherView} cipher_view
1204
+ * @returns {Fido2CredentialView[]}
1205
+ */
1206
+ decrypt_fido2_credentials(cipher_view) {
1207
+ try {
1208
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1209
+ wasm.ciphersclient_decrypt_fido2_credentials(
1210
+ retptr,
1211
+ this.__wbg_ptr,
1212
+ addHeapObject(cipher_view),
1213
+ );
1214
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1215
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1216
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1217
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1218
+ if (r3) {
1219
+ throw takeObject(r2);
1220
+ }
1221
+ var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
1222
+ wasm.__wbindgen_free(r0, r1 * 4, 4);
1223
+ return v1;
1224
+ } finally {
1225
+ wasm.__wbindgen_add_to_stack_pointer(16);
1226
+ }
1227
+ }
1228
+ /**
1229
+ * @param {CipherView} cipher_view
1230
+ * @param {OrganizationId} organization_id
1231
+ * @returns {CipherView}
1232
+ */
1233
+ move_to_organization(cipher_view, organization_id) {
1234
+ try {
1235
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1236
+ wasm.ciphersclient_move_to_organization(
1237
+ retptr,
1238
+ this.__wbg_ptr,
1239
+ addHeapObject(cipher_view),
1240
+ addHeapObject(organization_id),
1241
+ );
1242
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1243
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1244
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1245
+ if (r2) {
1246
+ throw takeObject(r1);
1247
+ }
1248
+ return takeObject(r0);
1249
+ } finally {
1250
+ wasm.__wbindgen_add_to_stack_pointer(16);
1251
+ }
1252
+ }
1253
+ /**
1254
+ * @param {CipherView} cipher_view
1255
+ * @returns {string}
1256
+ */
1257
+ decrypt_fido2_private_key(cipher_view) {
1258
+ let deferred2_0;
1259
+ let deferred2_1;
1260
+ try {
1261
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1262
+ wasm.ciphersclient_decrypt_fido2_private_key(
1263
+ retptr,
1264
+ this.__wbg_ptr,
1265
+ addHeapObject(cipher_view),
1266
+ );
1267
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1268
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1269
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1270
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1271
+ var ptr1 = r0;
1272
+ var len1 = r1;
1273
+ if (r3) {
1274
+ ptr1 = 0;
1275
+ len1 = 0;
1276
+ throw takeObject(r2);
1277
+ }
1278
+ deferred2_0 = ptr1;
1279
+ deferred2_1 = len1;
1280
+ return getStringFromWasm0(ptr1, len1);
1281
+ } finally {
1282
+ wasm.__wbindgen_add_to_stack_pointer(16);
1283
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
1284
+ }
1285
+ }
1286
+ }
1287
+
1288
+ const CryptoClientFinalization =
1289
+ typeof FinalizationRegistry === "undefined"
1290
+ ? { register: () => {}, unregister: () => {} }
1291
+ : new FinalizationRegistry((ptr) => wasm.__wbg_cryptoclient_free(ptr >>> 0, 1));
1292
+ /**
1293
+ * A client for the crypto operations.
1294
+ */
1295
+ export class CryptoClient {
1296
+ static __wrap(ptr) {
1297
+ ptr = ptr >>> 0;
1298
+ const obj = Object.create(CryptoClient.prototype);
1299
+ obj.__wbg_ptr = ptr;
1300
+ CryptoClientFinalization.register(obj, obj.__wbg_ptr, obj);
1301
+ return obj;
1302
+ }
1303
+
1304
+ __destroy_into_raw() {
1305
+ const ptr = this.__wbg_ptr;
1306
+ this.__wbg_ptr = 0;
1307
+ CryptoClientFinalization.unregister(this);
1308
+ return ptr;
1309
+ }
1310
+
1311
+ free() {
1312
+ const ptr = this.__destroy_into_raw();
1313
+ wasm.__wbg_cryptoclient_free(ptr, 0);
1314
+ }
1315
+ /**
1316
+ * Initialization method for the user crypto. Needs to be called before any other crypto
1317
+ * operations.
1318
+ * @param {InitUserCryptoRequest} req
1319
+ * @returns {Promise<void>}
1320
+ */
1321
+ initialize_user_crypto(req) {
1322
+ const ret = wasm.cryptoclient_initialize_user_crypto(this.__wbg_ptr, addHeapObject(req));
1323
+ return takeObject(ret);
1324
+ }
1325
+ /**
1326
+ * Initialization method for the organization crypto. Needs to be called after
1327
+ * `initialize_user_crypto` but before any other crypto operations.
1328
+ * @param {InitOrgCryptoRequest} req
1329
+ * @returns {Promise<void>}
1330
+ */
1331
+ initialize_org_crypto(req) {
1332
+ const ret = wasm.cryptoclient_initialize_org_crypto(this.__wbg_ptr, addHeapObject(req));
1333
+ return takeObject(ret);
1334
+ }
1335
+ /**
1336
+ * Generates a new key pair and encrypts the private key with the provided user key.
1337
+ * Crypto initialization not required.
1338
+ * @param {string} user_key
1339
+ * @returns {MakeKeyPairResponse}
1340
+ */
1341
+ make_key_pair(user_key) {
1342
+ try {
1343
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1344
+ const ptr0 = passStringToWasm0(user_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1345
+ const len0 = WASM_VECTOR_LEN;
1346
+ wasm.cryptoclient_make_key_pair(retptr, this.__wbg_ptr, ptr0, len0);
1347
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1348
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1349
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1350
+ if (r2) {
1351
+ throw takeObject(r1);
1352
+ }
1353
+ return takeObject(r0);
1354
+ } finally {
1355
+ wasm.__wbindgen_add_to_stack_pointer(16);
1356
+ }
1357
+ }
1358
+ /**
1359
+ * Verifies a user's asymmetric keys by decrypting the private key with the provided user
1360
+ * key. Returns if the private key is decryptable and if it is a valid matching key.
1361
+ * Crypto initialization not required.
1362
+ * @param {VerifyAsymmetricKeysRequest} request
1363
+ * @returns {VerifyAsymmetricKeysResponse}
1364
+ */
1365
+ verify_asymmetric_keys(request) {
1366
+ try {
1367
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1368
+ wasm.cryptoclient_verify_asymmetric_keys(retptr, this.__wbg_ptr, addHeapObject(request));
1369
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1370
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1371
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1372
+ if (r2) {
1373
+ throw takeObject(r1);
1374
+ }
1375
+ return takeObject(r0);
1376
+ } finally {
1377
+ wasm.__wbindgen_add_to_stack_pointer(16);
1378
+ }
1379
+ }
1380
+ /**
1381
+ * Makes a new signing key pair and signs the public key for the user
1382
+ * @returns {MakeUserSigningKeysResponse}
1383
+ */
1384
+ make_user_signing_keys_for_enrollment() {
1385
+ try {
1386
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1387
+ wasm.cryptoclient_make_user_signing_keys_for_enrollment(retptr, this.__wbg_ptr);
1388
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1389
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1390
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1391
+ if (r2) {
1392
+ throw takeObject(r1);
1393
+ }
1394
+ return takeObject(r0);
1395
+ } finally {
1396
+ wasm.__wbindgen_add_to_stack_pointer(16);
1397
+ }
1398
+ }
1399
+ /**
1400
+ * Creates a rotated set of account keys for the current state
1401
+ * @param {string} user_key
1402
+ * @returns {RotateUserKeysResponse}
1403
+ */
1404
+ get_v2_rotated_account_keys(user_key) {
1405
+ try {
1406
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1407
+ const ptr0 = passStringToWasm0(user_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1408
+ const len0 = WASM_VECTOR_LEN;
1409
+ wasm.cryptoclient_get_v2_rotated_account_keys(retptr, this.__wbg_ptr, ptr0, len0);
1410
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1411
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1412
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1413
+ if (r2) {
1414
+ throw takeObject(r1);
1415
+ }
1416
+ return takeObject(r0);
1417
+ } finally {
1418
+ wasm.__wbindgen_add_to_stack_pointer(16);
1419
+ }
1420
+ }
1421
+ }
1422
+
1423
+ const ExporterClientFinalization =
1424
+ typeof FinalizationRegistry === "undefined"
1425
+ ? { register: () => {}, unregister: () => {} }
1426
+ : new FinalizationRegistry((ptr) => wasm.__wbg_exporterclient_free(ptr >>> 0, 1));
1427
+
1428
+ export class ExporterClient {
1429
+ static __wrap(ptr) {
1430
+ ptr = ptr >>> 0;
1431
+ const obj = Object.create(ExporterClient.prototype);
1432
+ obj.__wbg_ptr = ptr;
1433
+ ExporterClientFinalization.register(obj, obj.__wbg_ptr, obj);
1434
+ return obj;
1435
+ }
1436
+
1437
+ __destroy_into_raw() {
1438
+ const ptr = this.__wbg_ptr;
1439
+ this.__wbg_ptr = 0;
1440
+ ExporterClientFinalization.unregister(this);
1441
+ return ptr;
1442
+ }
1443
+
1444
+ free() {
1445
+ const ptr = this.__destroy_into_raw();
1446
+ wasm.__wbg_exporterclient_free(ptr, 0);
1447
+ }
1448
+ /**
1449
+ * @param {Folder[]} folders
1450
+ * @param {Cipher[]} ciphers
1451
+ * @param {ExportFormat} format
1452
+ * @returns {string}
1453
+ */
1454
+ export_vault(folders, ciphers, format) {
1455
+ let deferred4_0;
1456
+ let deferred4_1;
1457
+ try {
1458
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1459
+ const ptr0 = passArrayJsValueToWasm0(folders, wasm.__wbindgen_malloc);
1460
+ const len0 = WASM_VECTOR_LEN;
1461
+ const ptr1 = passArrayJsValueToWasm0(ciphers, wasm.__wbindgen_malloc);
1462
+ const len1 = WASM_VECTOR_LEN;
1463
+ wasm.exporterclient_export_vault(
1464
+ retptr,
1465
+ this.__wbg_ptr,
1466
+ ptr0,
1467
+ len0,
1468
+ ptr1,
1469
+ len1,
1470
+ addHeapObject(format),
1471
+ );
1472
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1473
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1474
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1475
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1476
+ var ptr3 = r0;
1477
+ var len3 = r1;
1478
+ if (r3) {
1479
+ ptr3 = 0;
1480
+ len3 = 0;
1481
+ throw takeObject(r2);
1482
+ }
1483
+ deferred4_0 = ptr3;
1484
+ deferred4_1 = len3;
1485
+ return getStringFromWasm0(ptr3, len3);
1486
+ } finally {
1487
+ wasm.__wbindgen_add_to_stack_pointer(16);
1488
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
1489
+ }
1490
+ }
1491
+ /**
1492
+ * @param {Collection[]} collections
1493
+ * @param {Cipher[]} ciphers
1494
+ * @param {ExportFormat} format
1495
+ * @returns {string}
1496
+ */
1497
+ export_organization_vault(collections, ciphers, format) {
1498
+ let deferred4_0;
1499
+ let deferred4_1;
1500
+ try {
1501
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1502
+ const ptr0 = passArrayJsValueToWasm0(collections, wasm.__wbindgen_malloc);
1503
+ const len0 = WASM_VECTOR_LEN;
1504
+ const ptr1 = passArrayJsValueToWasm0(ciphers, wasm.__wbindgen_malloc);
1505
+ const len1 = WASM_VECTOR_LEN;
1506
+ wasm.exporterclient_export_organization_vault(
1507
+ retptr,
1508
+ this.__wbg_ptr,
1509
+ ptr0,
1510
+ len0,
1511
+ ptr1,
1512
+ len1,
1513
+ addHeapObject(format),
1514
+ );
1515
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1516
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1517
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1518
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1519
+ var ptr3 = r0;
1520
+ var len3 = r1;
1521
+ if (r3) {
1522
+ ptr3 = 0;
1523
+ len3 = 0;
1524
+ throw takeObject(r2);
1525
+ }
1526
+ deferred4_0 = ptr3;
1527
+ deferred4_1 = len3;
1528
+ return getStringFromWasm0(ptr3, len3);
1529
+ } finally {
1530
+ wasm.__wbindgen_add_to_stack_pointer(16);
1531
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
1532
+ }
1533
+ }
1534
+ /**
1535
+ * Credential Exchange Format (CXF)
1536
+ *
1537
+ * *Warning:* Expect this API to be unstable, and it will change in the future.
1538
+ *
1539
+ * For use with Apple using [ASCredentialExportManager](https://developer.apple.com/documentation/authenticationservices/ascredentialexportmanager).
1540
+ * Ideally the input should be immediately serialized from [ASImportableAccount](https://developer.apple.com/documentation/authenticationservices/asimportableaccount).
1541
+ * @param {Account} account
1542
+ * @param {Cipher[]} ciphers
1543
+ * @returns {string}
1544
+ */
1545
+ export_cxf(account, ciphers) {
1546
+ let deferred3_0;
1547
+ let deferred3_1;
1548
+ try {
1549
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1550
+ const ptr0 = passArrayJsValueToWasm0(ciphers, wasm.__wbindgen_malloc);
1551
+ const len0 = WASM_VECTOR_LEN;
1552
+ wasm.exporterclient_export_cxf(retptr, this.__wbg_ptr, addHeapObject(account), ptr0, len0);
1553
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1554
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1555
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1556
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1557
+ var ptr2 = r0;
1558
+ var len2 = r1;
1559
+ if (r3) {
1560
+ ptr2 = 0;
1561
+ len2 = 0;
1562
+ throw takeObject(r2);
1563
+ }
1564
+ deferred3_0 = ptr2;
1565
+ deferred3_1 = len2;
1566
+ return getStringFromWasm0(ptr2, len2);
1567
+ } finally {
1568
+ wasm.__wbindgen_add_to_stack_pointer(16);
1569
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
1570
+ }
1571
+ }
1572
+ /**
1573
+ * Credential Exchange Format (CXF)
1574
+ *
1575
+ * *Warning:* Expect this API to be unstable, and it will change in the future.
1576
+ *
1577
+ * For use with Apple using [ASCredentialExportManager](https://developer.apple.com/documentation/authenticationservices/ascredentialexportmanager).
1578
+ * Ideally the input should be immediately serialized from [ASImportableAccount](https://developer.apple.com/documentation/authenticationservices/asimportableaccount).
1579
+ * @param {string} payload
1580
+ * @returns {Cipher[]}
1581
+ */
1582
+ import_cxf(payload) {
1583
+ try {
1584
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1585
+ const ptr0 = passStringToWasm0(payload, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1586
+ const len0 = WASM_VECTOR_LEN;
1587
+ wasm.exporterclient_import_cxf(retptr, this.__wbg_ptr, ptr0, len0);
1588
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1589
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1590
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1591
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1592
+ if (r3) {
1593
+ throw takeObject(r2);
1594
+ }
1595
+ var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
1596
+ wasm.__wbindgen_free(r0, r1 * 4, 4);
1597
+ return v2;
1598
+ } finally {
1599
+ wasm.__wbindgen_add_to_stack_pointer(16);
1600
+ }
1601
+ }
1602
+ }
1603
+
1604
+ const FoldersClientFinalization =
1605
+ typeof FinalizationRegistry === "undefined"
1606
+ ? { register: () => {}, unregister: () => {} }
1607
+ : new FinalizationRegistry((ptr) => wasm.__wbg_foldersclient_free(ptr >>> 0, 1));
1608
+
1609
+ export class FoldersClient {
1610
+ static __wrap(ptr) {
1611
+ ptr = ptr >>> 0;
1612
+ const obj = Object.create(FoldersClient.prototype);
1613
+ obj.__wbg_ptr = ptr;
1614
+ FoldersClientFinalization.register(obj, obj.__wbg_ptr, obj);
1615
+ return obj;
1616
+ }
1617
+
1618
+ __destroy_into_raw() {
1619
+ const ptr = this.__wbg_ptr;
1620
+ this.__wbg_ptr = 0;
1621
+ FoldersClientFinalization.unregister(this);
1622
+ return ptr;
1623
+ }
1624
+
1625
+ free() {
1626
+ const ptr = this.__destroy_into_raw();
1627
+ wasm.__wbg_foldersclient_free(ptr, 0);
1628
+ }
1629
+ /**
1630
+ * @param {FolderView} folder_view
1631
+ * @returns {Folder}
1632
+ */
1633
+ encrypt(folder_view) {
1634
+ try {
1635
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1636
+ wasm.foldersclient_encrypt(retptr, this.__wbg_ptr, addHeapObject(folder_view));
1637
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1638
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1639
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1640
+ if (r2) {
1641
+ throw takeObject(r1);
1642
+ }
1643
+ return takeObject(r0);
1644
+ } finally {
1645
+ wasm.__wbindgen_add_to_stack_pointer(16);
1646
+ }
1647
+ }
1648
+ /**
1649
+ * @param {Folder} folder
1650
+ * @returns {FolderView}
1651
+ */
1652
+ decrypt(folder) {
1653
+ try {
1654
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1655
+ wasm.foldersclient_decrypt(retptr, this.__wbg_ptr, addHeapObject(folder));
1656
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1657
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1658
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1659
+ if (r2) {
1660
+ throw takeObject(r1);
1661
+ }
1662
+ return takeObject(r0);
1663
+ } finally {
1664
+ wasm.__wbindgen_add_to_stack_pointer(16);
1665
+ }
1666
+ }
1667
+ /**
1668
+ * @param {Folder[]} folders
1669
+ * @returns {FolderView[]}
1670
+ */
1671
+ decrypt_list(folders) {
1672
+ try {
1673
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1674
+ const ptr0 = passArrayJsValueToWasm0(folders, wasm.__wbindgen_malloc);
1675
+ const len0 = WASM_VECTOR_LEN;
1676
+ wasm.foldersclient_decrypt_list(retptr, this.__wbg_ptr, ptr0, len0);
1677
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1678
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1679
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1680
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1681
+ if (r3) {
1682
+ throw takeObject(r2);
1683
+ }
1684
+ var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
1685
+ wasm.__wbindgen_free(r0, r1 * 4, 4);
1686
+ return v2;
1687
+ } finally {
1688
+ wasm.__wbindgen_add_to_stack_pointer(16);
1689
+ }
1690
+ }
1691
+ }
1692
+
1693
+ const GeneratorClientFinalization =
1694
+ typeof FinalizationRegistry === "undefined"
1695
+ ? { register: () => {}, unregister: () => {} }
1696
+ : new FinalizationRegistry((ptr) => wasm.__wbg_generatorclient_free(ptr >>> 0, 1));
1697
+
1698
+ export class GeneratorClient {
1699
+ static __wrap(ptr) {
1700
+ ptr = ptr >>> 0;
1701
+ const obj = Object.create(GeneratorClient.prototype);
1702
+ obj.__wbg_ptr = ptr;
1703
+ GeneratorClientFinalization.register(obj, obj.__wbg_ptr, obj);
1704
+ return obj;
1705
+ }
1706
+
1707
+ __destroy_into_raw() {
1708
+ const ptr = this.__wbg_ptr;
1709
+ this.__wbg_ptr = 0;
1710
+ GeneratorClientFinalization.unregister(this);
1711
+ return ptr;
1712
+ }
1713
+
1714
+ free() {
1715
+ const ptr = this.__destroy_into_raw();
1716
+ wasm.__wbg_generatorclient_free(ptr, 0);
1717
+ }
1718
+ /**
1719
+ * Generates a random password.
1720
+ *
1721
+ * The character sets and password length can be customized using the `input` parameter.
1722
+ *
1723
+ * # Examples
1724
+ *
1725
+ * ```
1726
+ * use bitwarden_core::Client;
1727
+ * use bitwarden_generators::{GeneratorClientsExt, PassphraseError, PasswordGeneratorRequest};
1728
+ *
1729
+ * async fn test() -> Result<(), PassphraseError> {
1730
+ * let input = PasswordGeneratorRequest {
1731
+ * lowercase: true,
1732
+ * uppercase: true,
1733
+ * numbers: true,
1734
+ * length: 20,
1735
+ * ..Default::default()
1736
+ * };
1737
+ * let password = Client::new(None).generator().password(input).unwrap();
1738
+ * println!("{}", password);
1739
+ * Ok(())
1740
+ * }
1741
+ * ```
1742
+ * @param {PasswordGeneratorRequest} input
1743
+ * @returns {string}
1744
+ */
1745
+ password(input) {
1746
+ let deferred2_0;
1747
+ let deferred2_1;
1748
+ try {
1749
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1750
+ wasm.generatorclient_password(retptr, this.__wbg_ptr, addHeapObject(input));
1751
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1752
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1753
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1754
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1755
+ var ptr1 = r0;
1756
+ var len1 = r1;
1757
+ if (r3) {
1758
+ ptr1 = 0;
1759
+ len1 = 0;
1760
+ throw takeObject(r2);
1761
+ }
1762
+ deferred2_0 = ptr1;
1763
+ deferred2_1 = len1;
1764
+ return getStringFromWasm0(ptr1, len1);
1765
+ } finally {
1766
+ wasm.__wbindgen_add_to_stack_pointer(16);
1767
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
1768
+ }
1769
+ }
1770
+ /**
1771
+ * Generates a random passphrase.
1772
+ * A passphrase is a combination of random words separated by a character.
1773
+ * An example of passphrase is `correct horse battery staple`.
1774
+ *
1775
+ * The number of words and their case, the word separator, and the inclusion of
1776
+ * a number in the passphrase can be customized using the `input` parameter.
1777
+ *
1778
+ * # Examples
1779
+ *
1780
+ * ```
1781
+ * use bitwarden_core::Client;
1782
+ * use bitwarden_generators::{GeneratorClientsExt, PassphraseError, PassphraseGeneratorRequest};
1783
+ *
1784
+ * async fn test() -> Result<(), PassphraseError> {
1785
+ * let input = PassphraseGeneratorRequest {
1786
+ * num_words: 4,
1787
+ * ..Default::default()
1788
+ * };
1789
+ * let passphrase = Client::new(None).generator().passphrase(input).unwrap();
1790
+ * println!("{}", passphrase);
1791
+ * Ok(())
1792
+ * }
1793
+ * ```
1794
+ * @param {PassphraseGeneratorRequest} input
1795
+ * @returns {string}
1796
+ */
1797
+ passphrase(input) {
1798
+ let deferred2_0;
1799
+ let deferred2_1;
1800
+ try {
1801
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1802
+ wasm.generatorclient_passphrase(retptr, this.__wbg_ptr, addHeapObject(input));
1803
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1804
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1805
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1806
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1807
+ var ptr1 = r0;
1808
+ var len1 = r1;
1809
+ if (r3) {
1810
+ ptr1 = 0;
1811
+ len1 = 0;
1812
+ throw takeObject(r2);
1813
+ }
1814
+ deferred2_0 = ptr1;
1815
+ deferred2_1 = len1;
1816
+ return getStringFromWasm0(ptr1, len1);
1817
+ } finally {
1818
+ wasm.__wbindgen_add_to_stack_pointer(16);
1819
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
1820
+ }
1821
+ }
1822
+ }
1823
+
1824
+ const IncomingMessageFinalization =
1825
+ typeof FinalizationRegistry === "undefined"
1826
+ ? { register: () => {}, unregister: () => {} }
1827
+ : new FinalizationRegistry((ptr) => wasm.__wbg_incomingmessage_free(ptr >>> 0, 1));
1828
+
1829
+ export class IncomingMessage {
1830
+ static __wrap(ptr) {
1831
+ ptr = ptr >>> 0;
1832
+ const obj = Object.create(IncomingMessage.prototype);
1833
+ obj.__wbg_ptr = ptr;
1834
+ IncomingMessageFinalization.register(obj, obj.__wbg_ptr, obj);
1835
+ return obj;
1836
+ }
1837
+
1838
+ __destroy_into_raw() {
1839
+ const ptr = this.__wbg_ptr;
1840
+ this.__wbg_ptr = 0;
1841
+ IncomingMessageFinalization.unregister(this);
1842
+ return ptr;
1843
+ }
1844
+
1845
+ free() {
1846
+ const ptr = this.__destroy_into_raw();
1847
+ wasm.__wbg_incomingmessage_free(ptr, 0);
1848
+ }
1849
+ /**
1850
+ * @returns {Uint8Array}
1851
+ */
1852
+ get payload() {
1853
+ try {
1854
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1855
+ wasm.__wbg_get_incomingmessage_payload(retptr, this.__wbg_ptr);
1856
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1857
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1858
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
1859
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
1860
+ return v1;
1861
+ } finally {
1862
+ wasm.__wbindgen_add_to_stack_pointer(16);
1863
+ }
1864
+ }
1865
+ /**
1866
+ * @param {Uint8Array} arg0
1867
+ */
1868
+ set payload(arg0) {
1869
+ const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1870
+ const len0 = WASM_VECTOR_LEN;
1871
+ wasm.__wbg_set_incomingmessage_payload(this.__wbg_ptr, ptr0, len0);
1872
+ }
1873
+ /**
1874
+ * @returns {Endpoint}
1875
+ */
1876
+ get destination() {
1877
+ const ret = wasm.__wbg_get_incomingmessage_destination(this.__wbg_ptr);
1878
+ return takeObject(ret);
1879
+ }
1880
+ /**
1881
+ * @param {Endpoint} arg0
1882
+ */
1883
+ set destination(arg0) {
1884
+ wasm.__wbg_set_incomingmessage_destination(this.__wbg_ptr, addHeapObject(arg0));
1885
+ }
1886
+ /**
1887
+ * @returns {Endpoint}
1888
+ */
1889
+ get source() {
1890
+ const ret = wasm.__wbg_get_incomingmessage_source(this.__wbg_ptr);
1891
+ return takeObject(ret);
1892
+ }
1893
+ /**
1894
+ * @param {Endpoint} arg0
1895
+ */
1896
+ set source(arg0) {
1897
+ wasm.__wbg_set_incomingmessage_source(this.__wbg_ptr, addHeapObject(arg0));
1898
+ }
1899
+ /**
1900
+ * @returns {string | undefined}
1901
+ */
1902
+ get topic() {
1903
+ try {
1904
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1905
+ wasm.__wbg_get_incomingmessage_topic(retptr, this.__wbg_ptr);
1906
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1907
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1908
+ let v1;
1909
+ if (r0 !== 0) {
1910
+ v1 = getStringFromWasm0(r0, r1).slice();
1911
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
1912
+ }
1913
+ return v1;
1914
+ } finally {
1915
+ wasm.__wbindgen_add_to_stack_pointer(16);
1916
+ }
1917
+ }
1918
+ /**
1919
+ * @param {string | null} [arg0]
1920
+ */
1921
+ set topic(arg0) {
1922
+ var ptr0 = isLikeNone(arg0)
1923
+ ? 0
1924
+ : passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1925
+ var len0 = WASM_VECTOR_LEN;
1926
+ wasm.__wbg_set_incomingmessage_topic(this.__wbg_ptr, ptr0, len0);
1927
+ }
1928
+ /**
1929
+ * @param {Uint8Array} payload
1930
+ * @param {Endpoint} destination
1931
+ * @param {Endpoint} source
1932
+ * @param {string | null} [topic]
1933
+ */
1934
+ constructor(payload, destination, source, topic) {
1935
+ const ptr0 = passArray8ToWasm0(payload, wasm.__wbindgen_malloc);
1936
+ const len0 = WASM_VECTOR_LEN;
1937
+ var ptr1 = isLikeNone(topic)
1938
+ ? 0
1939
+ : passStringToWasm0(topic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1940
+ var len1 = WASM_VECTOR_LEN;
1941
+ const ret = wasm.incomingmessage_new(
1942
+ ptr0,
1943
+ len0,
1944
+ addHeapObject(destination),
1945
+ addHeapObject(source),
1946
+ ptr1,
1947
+ len1,
1948
+ );
1949
+ this.__wbg_ptr = ret >>> 0;
1950
+ IncomingMessageFinalization.register(this, this.__wbg_ptr, this);
1951
+ return this;
1952
+ }
1953
+ /**
1954
+ * Try to parse the payload as JSON.
1955
+ * @returns {any} The parsed JSON value, or undefined if the payload is not valid JSON.
1956
+ */
1957
+ parse_payload_as_json() {
1958
+ const ret = wasm.incomingmessage_parse_payload_as_json(this.__wbg_ptr);
1959
+ return takeObject(ret);
1960
+ }
1961
+ }
1962
+
1963
+ const IpcClientFinalization =
1964
+ typeof FinalizationRegistry === "undefined"
1965
+ ? { register: () => {}, unregister: () => {} }
1966
+ : new FinalizationRegistry((ptr) => wasm.__wbg_ipcclient_free(ptr >>> 0, 1));
1967
+ /**
1968
+ * JavaScript wrapper around the IPC client. For more information, see the
1969
+ * [IpcClient] documentation.
1970
+ */
1971
+ export class IpcClient {
1972
+ __destroy_into_raw() {
1973
+ const ptr = this.__wbg_ptr;
1974
+ this.__wbg_ptr = 0;
1975
+ IpcClientFinalization.unregister(this);
1976
+ return ptr;
1977
+ }
1978
+
1979
+ free() {
1980
+ const ptr = this.__destroy_into_raw();
1981
+ wasm.__wbg_ipcclient_free(ptr, 0);
1982
+ }
1983
+ /**
1984
+ * @param {IpcCommunicationBackend} communication_provider
1985
+ */
1986
+ constructor(communication_provider) {
1987
+ _assertClass(communication_provider, IpcCommunicationBackend);
1988
+ const ret = wasm.ipcclient_new(communication_provider.__wbg_ptr);
1989
+ this.__wbg_ptr = ret >>> 0;
1990
+ IpcClientFinalization.register(this, this.__wbg_ptr, this);
1991
+ return this;
1992
+ }
1993
+ /**
1994
+ * @returns {Promise<void>}
1995
+ */
1996
+ start() {
1997
+ const ret = wasm.ipcclient_start(this.__wbg_ptr);
1998
+ return takeObject(ret);
1999
+ }
2000
+ /**
2001
+ * @returns {Promise<boolean>}
2002
+ */
2003
+ isRunning() {
2004
+ const ret = wasm.ipcclient_isRunning(this.__wbg_ptr);
2005
+ return takeObject(ret);
2006
+ }
2007
+ /**
2008
+ * @param {OutgoingMessage} message
2009
+ * @returns {Promise<void>}
2010
+ */
2011
+ send(message) {
2012
+ _assertClass(message, OutgoingMessage);
2013
+ var ptr0 = message.__destroy_into_raw();
2014
+ const ret = wasm.ipcclient_send(this.__wbg_ptr, ptr0);
2015
+ return takeObject(ret);
2016
+ }
2017
+ /**
2018
+ * @returns {Promise<IpcClientSubscription>}
2019
+ */
2020
+ subscribe() {
2021
+ const ret = wasm.ipcclient_subscribe(this.__wbg_ptr);
2022
+ return takeObject(ret);
2023
+ }
2024
+ }
2025
+
2026
+ const IpcClientSubscriptionFinalization =
2027
+ typeof FinalizationRegistry === "undefined"
2028
+ ? { register: () => {}, unregister: () => {} }
2029
+ : new FinalizationRegistry((ptr) => wasm.__wbg_ipcclientsubscription_free(ptr >>> 0, 1));
2030
+ /**
2031
+ * JavaScript wrapper around the IPC client subscription. For more information, see the
2032
+ * [IpcClientSubscription](crate::IpcClientSubscription) documentation.
2033
+ */
2034
+ export class IpcClientSubscription {
2035
+ static __wrap(ptr) {
2036
+ ptr = ptr >>> 0;
2037
+ const obj = Object.create(IpcClientSubscription.prototype);
2038
+ obj.__wbg_ptr = ptr;
2039
+ IpcClientSubscriptionFinalization.register(obj, obj.__wbg_ptr, obj);
2040
+ return obj;
2041
+ }
2042
+
2043
+ __destroy_into_raw() {
2044
+ const ptr = this.__wbg_ptr;
2045
+ this.__wbg_ptr = 0;
2046
+ IpcClientSubscriptionFinalization.unregister(this);
2047
+ return ptr;
2048
+ }
2049
+
2050
+ free() {
2051
+ const ptr = this.__destroy_into_raw();
2052
+ wasm.__wbg_ipcclientsubscription_free(ptr, 0);
2053
+ }
2054
+ /**
2055
+ * @param {AbortSignal | null} [abort_signal]
2056
+ * @returns {Promise<IncomingMessage>}
2057
+ */
2058
+ receive(abort_signal) {
2059
+ const ret = wasm.ipcclientsubscription_receive(
2060
+ this.__wbg_ptr,
2061
+ isLikeNone(abort_signal) ? 0 : addHeapObject(abort_signal),
2062
+ );
2063
+ return takeObject(ret);
2064
+ }
2065
+ }
2066
+
2067
+ const IpcCommunicationBackendFinalization =
2068
+ typeof FinalizationRegistry === "undefined"
2069
+ ? { register: () => {}, unregister: () => {} }
2070
+ : new FinalizationRegistry((ptr) => wasm.__wbg_ipccommunicationbackend_free(ptr >>> 0, 1));
2071
+ /**
2072
+ * JavaScript implementation of the `CommunicationBackend` trait for IPC communication.
2073
+ */
2074
+ export class IpcCommunicationBackend {
2075
+ __destroy_into_raw() {
2076
+ const ptr = this.__wbg_ptr;
2077
+ this.__wbg_ptr = 0;
2078
+ IpcCommunicationBackendFinalization.unregister(this);
2079
+ return ptr;
2080
+ }
2081
+
2082
+ free() {
2083
+ const ptr = this.__destroy_into_raw();
2084
+ wasm.__wbg_ipccommunicationbackend_free(ptr, 0);
2085
+ }
2086
+ /**
2087
+ * Creates a new instance of the JavaScript communication backend.
2088
+ * @param {IpcCommunicationBackendSender} sender
2089
+ */
2090
+ constructor(sender) {
2091
+ const ret = wasm.ipccommunicationbackend_new(addHeapObject(sender));
2092
+ this.__wbg_ptr = ret >>> 0;
2093
+ IpcCommunicationBackendFinalization.register(this, this.__wbg_ptr, this);
2094
+ return this;
2095
+ }
2096
+ /**
2097
+ * Used by JavaScript to provide an incoming message to the IPC framework.
2098
+ * @param {IncomingMessage} message
2099
+ */
2100
+ receive(message) {
2101
+ try {
2102
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2103
+ _assertClass(message, IncomingMessage);
2104
+ var ptr0 = message.__destroy_into_raw();
2105
+ wasm.ipccommunicationbackend_receive(retptr, this.__wbg_ptr, ptr0);
2106
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2107
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2108
+ if (r1) {
2109
+ throw takeObject(r0);
2110
+ }
2111
+ } finally {
2112
+ wasm.__wbindgen_add_to_stack_pointer(16);
2113
+ }
2114
+ }
2115
+ }
2116
+
2117
+ const OutgoingMessageFinalization =
2118
+ typeof FinalizationRegistry === "undefined"
2119
+ ? { register: () => {}, unregister: () => {} }
2120
+ : new FinalizationRegistry((ptr) => wasm.__wbg_outgoingmessage_free(ptr >>> 0, 1));
2121
+
2122
+ export class OutgoingMessage {
2123
+ static __wrap(ptr) {
2124
+ ptr = ptr >>> 0;
2125
+ const obj = Object.create(OutgoingMessage.prototype);
2126
+ obj.__wbg_ptr = ptr;
2127
+ OutgoingMessageFinalization.register(obj, obj.__wbg_ptr, obj);
2128
+ return obj;
2129
+ }
2130
+
2131
+ __destroy_into_raw() {
2132
+ const ptr = this.__wbg_ptr;
2133
+ this.__wbg_ptr = 0;
2134
+ OutgoingMessageFinalization.unregister(this);
2135
+ return ptr;
2136
+ }
2137
+
2138
+ free() {
2139
+ const ptr = this.__destroy_into_raw();
2140
+ wasm.__wbg_outgoingmessage_free(ptr, 0);
2141
+ }
2142
+ /**
2143
+ * @returns {Uint8Array}
2144
+ */
2145
+ get payload() {
2146
+ try {
2147
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2148
+ wasm.__wbg_get_outgoingmessage_payload(retptr, this.__wbg_ptr);
2149
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2150
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2151
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
2152
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
2153
+ return v1;
2154
+ } finally {
2155
+ wasm.__wbindgen_add_to_stack_pointer(16);
2156
+ }
2157
+ }
2158
+ /**
2159
+ * @param {Uint8Array} arg0
2160
+ */
2161
+ set payload(arg0) {
2162
+ const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
2163
+ const len0 = WASM_VECTOR_LEN;
2164
+ wasm.__wbg_set_outgoingmessage_payload(this.__wbg_ptr, ptr0, len0);
2165
+ }
2166
+ /**
2167
+ * @returns {Endpoint}
2168
+ */
2169
+ get destination() {
2170
+ const ret = wasm.__wbg_get_incomingmessage_destination(this.__wbg_ptr);
2171
+ return takeObject(ret);
2172
+ }
2173
+ /**
2174
+ * @param {Endpoint} arg0
2175
+ */
2176
+ set destination(arg0) {
2177
+ wasm.__wbg_set_incomingmessage_destination(this.__wbg_ptr, addHeapObject(arg0));
2178
+ }
2179
+ /**
2180
+ * @returns {string | undefined}
2181
+ */
2182
+ get topic() {
2183
+ try {
2184
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2185
+ wasm.__wbg_get_outgoingmessage_topic(retptr, this.__wbg_ptr);
2186
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2187
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2188
+ let v1;
2189
+ if (r0 !== 0) {
2190
+ v1 = getStringFromWasm0(r0, r1).slice();
2191
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
2192
+ }
2193
+ return v1;
2194
+ } finally {
2195
+ wasm.__wbindgen_add_to_stack_pointer(16);
2196
+ }
2197
+ }
2198
+ /**
2199
+ * @param {string | null} [arg0]
2200
+ */
2201
+ set topic(arg0) {
2202
+ var ptr0 = isLikeNone(arg0)
2203
+ ? 0
2204
+ : passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2205
+ var len0 = WASM_VECTOR_LEN;
2206
+ wasm.__wbg_set_outgoingmessage_topic(this.__wbg_ptr, ptr0, len0);
2207
+ }
2208
+ /**
2209
+ * @param {Uint8Array} payload
2210
+ * @param {Endpoint} destination
2211
+ * @param {string | null} [topic]
2212
+ */
2213
+ constructor(payload, destination, topic) {
2214
+ const ptr0 = passArray8ToWasm0(payload, wasm.__wbindgen_malloc);
2215
+ const len0 = WASM_VECTOR_LEN;
2216
+ var ptr1 = isLikeNone(topic)
2217
+ ? 0
2218
+ : passStringToWasm0(topic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2219
+ var len1 = WASM_VECTOR_LEN;
2220
+ const ret = wasm.outgoingmessage_new(ptr0, len0, addHeapObject(destination), ptr1, len1);
2221
+ this.__wbg_ptr = ret >>> 0;
2222
+ OutgoingMessageFinalization.register(this, this.__wbg_ptr, this);
2223
+ return this;
2224
+ }
2225
+ /**
2226
+ * Create a new message and encode the payload as JSON.
2227
+ * @param {any} payload
2228
+ * @param {Endpoint} destination
2229
+ * @param {string | null} [topic]
2230
+ * @returns {OutgoingMessage}
2231
+ */
2232
+ static new_json_payload(payload, destination, topic) {
2233
+ try {
2234
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2235
+ var ptr0 = isLikeNone(topic)
2236
+ ? 0
2237
+ : passStringToWasm0(topic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2238
+ var len0 = WASM_VECTOR_LEN;
2239
+ wasm.outgoingmessage_new_json_payload(
2240
+ retptr,
2241
+ addHeapObject(payload),
2242
+ addHeapObject(destination),
2243
+ ptr0,
2244
+ len0,
2245
+ );
2246
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2247
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2248
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2249
+ if (r2) {
2250
+ throw takeObject(r1);
2251
+ }
2252
+ return OutgoingMessage.__wrap(r0);
2253
+ } finally {
2254
+ wasm.__wbindgen_add_to_stack_pointer(16);
2255
+ }
2256
+ }
2257
+ }
348
2258
 
349
- const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
2259
+ const PlatformClientFinalization =
2260
+ typeof FinalizationRegistry === "undefined"
2261
+ ? { register: () => {}, unregister: () => {} }
2262
+ : new FinalizationRegistry((ptr) => wasm.__wbg_platformclient_free(ptr >>> 0, 1));
350
2263
 
351
- const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
2264
+ export class PlatformClient {
2265
+ static __wrap(ptr) {
2266
+ ptr = ptr >>> 0;
2267
+ const obj = Object.create(PlatformClient.prototype);
2268
+ obj.__wbg_ptr = ptr;
2269
+ PlatformClientFinalization.register(obj, obj.__wbg_ptr, obj);
2270
+ return obj;
2271
+ }
352
2272
 
353
- const BitwardenClientFinalization =
2273
+ __destroy_into_raw() {
2274
+ const ptr = this.__wbg_ptr;
2275
+ this.__wbg_ptr = 0;
2276
+ PlatformClientFinalization.unregister(this);
2277
+ return ptr;
2278
+ }
2279
+
2280
+ free() {
2281
+ const ptr = this.__destroy_into_raw();
2282
+ wasm.__wbg_platformclient_free(ptr, 0);
2283
+ }
2284
+ /**
2285
+ * @returns {StateClient}
2286
+ */
2287
+ state() {
2288
+ const ret = wasm.bitwardenclient_platform(this.__wbg_ptr);
2289
+ return StateClient.__wrap(ret);
2290
+ }
2291
+ }
2292
+
2293
+ const PureCryptoFinalization =
354
2294
  typeof FinalizationRegistry === "undefined"
355
2295
  ? { register: () => {}, unregister: () => {} }
356
- : new FinalizationRegistry((ptr) => wasm.__wbg_bitwardenclient_free(ptr >>> 0, 1));
357
-
358
- export class BitwardenClient {
2296
+ : new FinalizationRegistry((ptr) => wasm.__wbg_purecrypto_free(ptr >>> 0, 1));
2297
+ /**
2298
+ * This module represents a stopgap solution to provide access to primitive crypto functions for JS
2299
+ * clients. It is not intended to be used outside of the JS clients and this pattern should not be
2300
+ * proliferated. It is necessary because we want to use SDK crypto prior to the SDK being fully
2301
+ * responsible for state and keys.
2302
+ */
2303
+ export class PureCrypto {
359
2304
  __destroy_into_raw() {
360
2305
  const ptr = this.__wbg_ptr;
361
2306
  this.__wbg_ptr = 0;
362
- BitwardenClientFinalization.unregister(this);
2307
+ PureCryptoFinalization.unregister(this);
363
2308
  return ptr;
364
2309
  }
365
2310
 
366
2311
  free() {
367
2312
  const ptr = this.__destroy_into_raw();
368
- wasm.__wbg_bitwardenclient_free(ptr, 0);
2313
+ wasm.__wbg_purecrypto_free(ptr, 0);
2314
+ }
2315
+ /**
2316
+ * DEPRECATED: Use `symmetric_decrypt_string` instead.
2317
+ * Cleanup ticket: <https://bitwarden.atlassian.net/browse/PM-21247>
2318
+ * @param {string} enc_string
2319
+ * @param {Uint8Array} key
2320
+ * @returns {string}
2321
+ */
2322
+ static symmetric_decrypt(enc_string, key) {
2323
+ let deferred4_0;
2324
+ let deferred4_1;
2325
+ try {
2326
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2327
+ const ptr0 = passStringToWasm0(enc_string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2328
+ const len0 = WASM_VECTOR_LEN;
2329
+ const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
2330
+ const len1 = WASM_VECTOR_LEN;
2331
+ wasm.purecrypto_symmetric_decrypt(retptr, ptr0, len0, ptr1, len1);
2332
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2333
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2334
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2335
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2336
+ var ptr3 = r0;
2337
+ var len3 = r1;
2338
+ if (r3) {
2339
+ ptr3 = 0;
2340
+ len3 = 0;
2341
+ throw takeObject(r2);
2342
+ }
2343
+ deferred4_0 = ptr3;
2344
+ deferred4_1 = len3;
2345
+ return getStringFromWasm0(ptr3, len3);
2346
+ } finally {
2347
+ wasm.__wbindgen_add_to_stack_pointer(16);
2348
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
2349
+ }
2350
+ }
2351
+ /**
2352
+ * @param {string} enc_string
2353
+ * @param {Uint8Array} key
2354
+ * @returns {string}
2355
+ */
2356
+ static symmetric_decrypt_string(enc_string, key) {
2357
+ let deferred4_0;
2358
+ let deferred4_1;
2359
+ try {
2360
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2361
+ const ptr0 = passStringToWasm0(enc_string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2362
+ const len0 = WASM_VECTOR_LEN;
2363
+ const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
2364
+ const len1 = WASM_VECTOR_LEN;
2365
+ wasm.purecrypto_symmetric_decrypt_string(retptr, ptr0, len0, ptr1, len1);
2366
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2367
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2368
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2369
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2370
+ var ptr3 = r0;
2371
+ var len3 = r1;
2372
+ if (r3) {
2373
+ ptr3 = 0;
2374
+ len3 = 0;
2375
+ throw takeObject(r2);
2376
+ }
2377
+ deferred4_0 = ptr3;
2378
+ deferred4_1 = len3;
2379
+ return getStringFromWasm0(ptr3, len3);
2380
+ } finally {
2381
+ wasm.__wbindgen_add_to_stack_pointer(16);
2382
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
2383
+ }
2384
+ }
2385
+ /**
2386
+ * @param {string} enc_string
2387
+ * @param {Uint8Array} key
2388
+ * @returns {Uint8Array}
2389
+ */
2390
+ static symmetric_decrypt_bytes(enc_string, key) {
2391
+ try {
2392
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2393
+ const ptr0 = passStringToWasm0(enc_string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2394
+ const len0 = WASM_VECTOR_LEN;
2395
+ const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
2396
+ const len1 = WASM_VECTOR_LEN;
2397
+ wasm.purecrypto_symmetric_decrypt_bytes(retptr, ptr0, len0, ptr1, len1);
2398
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2399
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2400
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2401
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2402
+ if (r3) {
2403
+ throw takeObject(r2);
2404
+ }
2405
+ var v3 = getArrayU8FromWasm0(r0, r1).slice();
2406
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
2407
+ return v3;
2408
+ } finally {
2409
+ wasm.__wbindgen_add_to_stack_pointer(16);
2410
+ }
2411
+ }
2412
+ /**
2413
+ * DEPRECATED: Use `symmetric_decrypt_filedata` instead.
2414
+ * Cleanup ticket: <https://bitwarden.atlassian.net/browse/PM-21247>
2415
+ * @param {Uint8Array} enc_bytes
2416
+ * @param {Uint8Array} key
2417
+ * @returns {Uint8Array}
2418
+ */
2419
+ static symmetric_decrypt_array_buffer(enc_bytes, key) {
2420
+ try {
2421
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2422
+ const ptr0 = passArray8ToWasm0(enc_bytes, wasm.__wbindgen_malloc);
2423
+ const len0 = WASM_VECTOR_LEN;
2424
+ const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
2425
+ const len1 = WASM_VECTOR_LEN;
2426
+ wasm.purecrypto_symmetric_decrypt_array_buffer(retptr, ptr0, len0, ptr1, len1);
2427
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2428
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2429
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2430
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2431
+ if (r3) {
2432
+ throw takeObject(r2);
2433
+ }
2434
+ var v3 = getArrayU8FromWasm0(r0, r1).slice();
2435
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
2436
+ return v3;
2437
+ } finally {
2438
+ wasm.__wbindgen_add_to_stack_pointer(16);
2439
+ }
2440
+ }
2441
+ /**
2442
+ * @param {Uint8Array} enc_bytes
2443
+ * @param {Uint8Array} key
2444
+ * @returns {Uint8Array}
2445
+ */
2446
+ static symmetric_decrypt_filedata(enc_bytes, key) {
2447
+ try {
2448
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2449
+ const ptr0 = passArray8ToWasm0(enc_bytes, wasm.__wbindgen_malloc);
2450
+ const len0 = WASM_VECTOR_LEN;
2451
+ const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
2452
+ const len1 = WASM_VECTOR_LEN;
2453
+ wasm.purecrypto_symmetric_decrypt_filedata(retptr, ptr0, len0, ptr1, len1);
2454
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2455
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2456
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2457
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2458
+ if (r3) {
2459
+ throw takeObject(r2);
2460
+ }
2461
+ var v3 = getArrayU8FromWasm0(r0, r1).slice();
2462
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
2463
+ return v3;
2464
+ } finally {
2465
+ wasm.__wbindgen_add_to_stack_pointer(16);
2466
+ }
2467
+ }
2468
+ /**
2469
+ * @param {string} plain
2470
+ * @param {Uint8Array} key
2471
+ * @returns {string}
2472
+ */
2473
+ static symmetric_encrypt_string(plain, key) {
2474
+ let deferred4_0;
2475
+ let deferred4_1;
2476
+ try {
2477
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2478
+ const ptr0 = passStringToWasm0(plain, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2479
+ const len0 = WASM_VECTOR_LEN;
2480
+ const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
2481
+ const len1 = WASM_VECTOR_LEN;
2482
+ wasm.purecrypto_symmetric_encrypt_string(retptr, ptr0, len0, ptr1, len1);
2483
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2484
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2485
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2486
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2487
+ var ptr3 = r0;
2488
+ var len3 = r1;
2489
+ if (r3) {
2490
+ ptr3 = 0;
2491
+ len3 = 0;
2492
+ throw takeObject(r2);
2493
+ }
2494
+ deferred4_0 = ptr3;
2495
+ deferred4_1 = len3;
2496
+ return getStringFromWasm0(ptr3, len3);
2497
+ } finally {
2498
+ wasm.__wbindgen_add_to_stack_pointer(16);
2499
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
2500
+ }
2501
+ }
2502
+ /**
2503
+ * DEPRECATED: Only used by send keys
2504
+ * @param {Uint8Array} plain
2505
+ * @param {Uint8Array} key
2506
+ * @returns {string}
2507
+ */
2508
+ static symmetric_encrypt_bytes(plain, key) {
2509
+ let deferred4_0;
2510
+ let deferred4_1;
2511
+ try {
2512
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2513
+ const ptr0 = passArray8ToWasm0(plain, wasm.__wbindgen_malloc);
2514
+ const len0 = WASM_VECTOR_LEN;
2515
+ const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
2516
+ const len1 = WASM_VECTOR_LEN;
2517
+ wasm.purecrypto_symmetric_encrypt_bytes(retptr, ptr0, len0, ptr1, len1);
2518
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2519
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2520
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2521
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2522
+ var ptr3 = r0;
2523
+ var len3 = r1;
2524
+ if (r3) {
2525
+ ptr3 = 0;
2526
+ len3 = 0;
2527
+ throw takeObject(r2);
2528
+ }
2529
+ deferred4_0 = ptr3;
2530
+ deferred4_1 = len3;
2531
+ return getStringFromWasm0(ptr3, len3);
2532
+ } finally {
2533
+ wasm.__wbindgen_add_to_stack_pointer(16);
2534
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
2535
+ }
2536
+ }
2537
+ /**
2538
+ * @param {Uint8Array} plain
2539
+ * @param {Uint8Array} key
2540
+ * @returns {Uint8Array}
2541
+ */
2542
+ static symmetric_encrypt_filedata(plain, key) {
2543
+ try {
2544
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2545
+ const ptr0 = passArray8ToWasm0(plain, wasm.__wbindgen_malloc);
2546
+ const len0 = WASM_VECTOR_LEN;
2547
+ const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
2548
+ const len1 = WASM_VECTOR_LEN;
2549
+ wasm.purecrypto_symmetric_encrypt_filedata(retptr, ptr0, len0, ptr1, len1);
2550
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2551
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2552
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2553
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2554
+ if (r3) {
2555
+ throw takeObject(r2);
2556
+ }
2557
+ var v3 = getArrayU8FromWasm0(r0, r1).slice();
2558
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
2559
+ return v3;
2560
+ } finally {
2561
+ wasm.__wbindgen_add_to_stack_pointer(16);
2562
+ }
2563
+ }
2564
+ /**
2565
+ * @param {string} encrypted_user_key
2566
+ * @param {string} master_password
2567
+ * @param {string} email
2568
+ * @param {Kdf} kdf
2569
+ * @returns {Uint8Array}
2570
+ */
2571
+ static decrypt_user_key_with_master_password(encrypted_user_key, master_password, email, kdf) {
2572
+ try {
2573
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2574
+ const ptr0 = passStringToWasm0(
2575
+ encrypted_user_key,
2576
+ wasm.__wbindgen_malloc,
2577
+ wasm.__wbindgen_realloc,
2578
+ );
2579
+ const len0 = WASM_VECTOR_LEN;
2580
+ const ptr1 = passStringToWasm0(
2581
+ master_password,
2582
+ wasm.__wbindgen_malloc,
2583
+ wasm.__wbindgen_realloc,
2584
+ );
2585
+ const len1 = WASM_VECTOR_LEN;
2586
+ const ptr2 = passStringToWasm0(email, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2587
+ const len2 = WASM_VECTOR_LEN;
2588
+ wasm.purecrypto_decrypt_user_key_with_master_password(
2589
+ retptr,
2590
+ ptr0,
2591
+ len0,
2592
+ ptr1,
2593
+ len1,
2594
+ ptr2,
2595
+ len2,
2596
+ addHeapObject(kdf),
2597
+ );
2598
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2599
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2600
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2601
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2602
+ if (r3) {
2603
+ throw takeObject(r2);
2604
+ }
2605
+ var v4 = getArrayU8FromWasm0(r0, r1).slice();
2606
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
2607
+ return v4;
2608
+ } finally {
2609
+ wasm.__wbindgen_add_to_stack_pointer(16);
2610
+ }
2611
+ }
2612
+ /**
2613
+ * @param {Uint8Array} user_key
2614
+ * @param {string} master_password
2615
+ * @param {string} email
2616
+ * @param {Kdf} kdf
2617
+ * @returns {string}
2618
+ */
2619
+ static encrypt_user_key_with_master_password(user_key, master_password, email, kdf) {
2620
+ let deferred5_0;
2621
+ let deferred5_1;
2622
+ try {
2623
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2624
+ const ptr0 = passArray8ToWasm0(user_key, wasm.__wbindgen_malloc);
2625
+ const len0 = WASM_VECTOR_LEN;
2626
+ const ptr1 = passStringToWasm0(
2627
+ master_password,
2628
+ wasm.__wbindgen_malloc,
2629
+ wasm.__wbindgen_realloc,
2630
+ );
2631
+ const len1 = WASM_VECTOR_LEN;
2632
+ const ptr2 = passStringToWasm0(email, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2633
+ const len2 = WASM_VECTOR_LEN;
2634
+ wasm.purecrypto_encrypt_user_key_with_master_password(
2635
+ retptr,
2636
+ ptr0,
2637
+ len0,
2638
+ ptr1,
2639
+ len1,
2640
+ ptr2,
2641
+ len2,
2642
+ addHeapObject(kdf),
2643
+ );
2644
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2645
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2646
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2647
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2648
+ var ptr4 = r0;
2649
+ var len4 = r1;
2650
+ if (r3) {
2651
+ ptr4 = 0;
2652
+ len4 = 0;
2653
+ throw takeObject(r2);
2654
+ }
2655
+ deferred5_0 = ptr4;
2656
+ deferred5_1 = len4;
2657
+ return getStringFromWasm0(ptr4, len4);
2658
+ } finally {
2659
+ wasm.__wbindgen_add_to_stack_pointer(16);
2660
+ wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
2661
+ }
2662
+ }
2663
+ /**
2664
+ * @returns {Uint8Array}
2665
+ */
2666
+ static make_user_key_aes256_cbc_hmac() {
2667
+ try {
2668
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2669
+ wasm.purecrypto_make_user_key_aes256_cbc_hmac(retptr);
2670
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2671
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2672
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
2673
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
2674
+ return v1;
2675
+ } finally {
2676
+ wasm.__wbindgen_add_to_stack_pointer(16);
2677
+ }
2678
+ }
2679
+ /**
2680
+ * @returns {Uint8Array}
2681
+ */
2682
+ static make_user_key_xchacha20_poly1305() {
2683
+ try {
2684
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2685
+ wasm.purecrypto_make_user_key_xchacha20_poly1305(retptr);
2686
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2687
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2688
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
2689
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
2690
+ return v1;
2691
+ } finally {
2692
+ wasm.__wbindgen_add_to_stack_pointer(16);
2693
+ }
2694
+ }
2695
+ /**
2696
+ * Wraps (encrypts) a symmetric key using a symmetric wrapping key, returning the wrapped key
2697
+ * as an EncString.
2698
+ * @param {Uint8Array} key_to_be_wrapped
2699
+ * @param {Uint8Array} wrapping_key
2700
+ * @returns {string}
2701
+ */
2702
+ static wrap_symmetric_key(key_to_be_wrapped, wrapping_key) {
2703
+ let deferred4_0;
2704
+ let deferred4_1;
2705
+ try {
2706
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2707
+ const ptr0 = passArray8ToWasm0(key_to_be_wrapped, wasm.__wbindgen_malloc);
2708
+ const len0 = WASM_VECTOR_LEN;
2709
+ const ptr1 = passArray8ToWasm0(wrapping_key, wasm.__wbindgen_malloc);
2710
+ const len1 = WASM_VECTOR_LEN;
2711
+ wasm.purecrypto_wrap_symmetric_key(retptr, ptr0, len0, ptr1, len1);
2712
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2713
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2714
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2715
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2716
+ var ptr3 = r0;
2717
+ var len3 = r1;
2718
+ if (r3) {
2719
+ ptr3 = 0;
2720
+ len3 = 0;
2721
+ throw takeObject(r2);
2722
+ }
2723
+ deferred4_0 = ptr3;
2724
+ deferred4_1 = len3;
2725
+ return getStringFromWasm0(ptr3, len3);
2726
+ } finally {
2727
+ wasm.__wbindgen_add_to_stack_pointer(16);
2728
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
2729
+ }
2730
+ }
2731
+ /**
2732
+ * Unwraps (decrypts) a wrapped symmetric key using a symmetric wrapping key, returning the
2733
+ * unwrapped key as a serialized byte array.
2734
+ * @param {string} wrapped_key
2735
+ * @param {Uint8Array} wrapping_key
2736
+ * @returns {Uint8Array}
2737
+ */
2738
+ static unwrap_symmetric_key(wrapped_key, wrapping_key) {
2739
+ try {
2740
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2741
+ const ptr0 = passStringToWasm0(wrapped_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2742
+ const len0 = WASM_VECTOR_LEN;
2743
+ const ptr1 = passArray8ToWasm0(wrapping_key, wasm.__wbindgen_malloc);
2744
+ const len1 = WASM_VECTOR_LEN;
2745
+ wasm.purecrypto_unwrap_symmetric_key(retptr, ptr0, len0, ptr1, len1);
2746
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2747
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2748
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2749
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2750
+ if (r3) {
2751
+ throw takeObject(r2);
2752
+ }
2753
+ var v3 = getArrayU8FromWasm0(r0, r1).slice();
2754
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
2755
+ return v3;
2756
+ } finally {
2757
+ wasm.__wbindgen_add_to_stack_pointer(16);
2758
+ }
2759
+ }
2760
+ /**
2761
+ * Wraps (encrypts) an SPKI DER encoded encapsulation (public) key using a symmetric wrapping
2762
+ * key. Note: Usually, a public key is - by definition - public, so this should not be
2763
+ * used. The specific use-case for this function is to enable rotateable key sets, where
2764
+ * the "public key" is not public, with the intent of preventing the server from being able
2765
+ * to overwrite the user key unlocked by the rotateable keyset.
2766
+ * @param {Uint8Array} encapsulation_key
2767
+ * @param {Uint8Array} wrapping_key
2768
+ * @returns {string}
2769
+ */
2770
+ static wrap_encapsulation_key(encapsulation_key, wrapping_key) {
2771
+ let deferred4_0;
2772
+ let deferred4_1;
2773
+ try {
2774
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2775
+ const ptr0 = passArray8ToWasm0(encapsulation_key, wasm.__wbindgen_malloc);
2776
+ const len0 = WASM_VECTOR_LEN;
2777
+ const ptr1 = passArray8ToWasm0(wrapping_key, wasm.__wbindgen_malloc);
2778
+ const len1 = WASM_VECTOR_LEN;
2779
+ wasm.purecrypto_wrap_encapsulation_key(retptr, ptr0, len0, ptr1, len1);
2780
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2781
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2782
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2783
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2784
+ var ptr3 = r0;
2785
+ var len3 = r1;
2786
+ if (r3) {
2787
+ ptr3 = 0;
2788
+ len3 = 0;
2789
+ throw takeObject(r2);
2790
+ }
2791
+ deferred4_0 = ptr3;
2792
+ deferred4_1 = len3;
2793
+ return getStringFromWasm0(ptr3, len3);
2794
+ } finally {
2795
+ wasm.__wbindgen_add_to_stack_pointer(16);
2796
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
2797
+ }
2798
+ }
2799
+ /**
2800
+ * Unwraps (decrypts) a wrapped SPKI DER encoded encapsulation (public) key using a symmetric
2801
+ * wrapping key.
2802
+ * @param {string} wrapped_key
2803
+ * @param {Uint8Array} wrapping_key
2804
+ * @returns {Uint8Array}
2805
+ */
2806
+ static unwrap_encapsulation_key(wrapped_key, wrapping_key) {
2807
+ try {
2808
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2809
+ const ptr0 = passStringToWasm0(wrapped_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2810
+ const len0 = WASM_VECTOR_LEN;
2811
+ const ptr1 = passArray8ToWasm0(wrapping_key, wasm.__wbindgen_malloc);
2812
+ const len1 = WASM_VECTOR_LEN;
2813
+ wasm.purecrypto_unwrap_decapsulation_key(retptr, ptr0, len0, ptr1, len1);
2814
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2815
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2816
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2817
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2818
+ if (r3) {
2819
+ throw takeObject(r2);
2820
+ }
2821
+ var v3 = getArrayU8FromWasm0(r0, r1).slice();
2822
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
2823
+ return v3;
2824
+ } finally {
2825
+ wasm.__wbindgen_add_to_stack_pointer(16);
2826
+ }
369
2827
  }
370
2828
  /**
371
- * @param {ClientSettings | undefined} [settings]
372
- * @param {LogLevel | undefined} [log_level]
2829
+ * Wraps (encrypts) a PKCS8 DER encoded decapsulation (private) key using a symmetric wrapping
2830
+ * key,
2831
+ * @param {Uint8Array} decapsulation_key
2832
+ * @param {Uint8Array} wrapping_key
2833
+ * @returns {string}
373
2834
  */
374
- constructor(settings, log_level) {
375
- const ret = wasm.bitwardenclient_new(
376
- isLikeNone(settings) ? 0 : addHeapObject(settings),
377
- isLikeNone(log_level) ? 5 : log_level,
378
- );
379
- this.__wbg_ptr = ret >>> 0;
380
- BitwardenClientFinalization.register(this, this.__wbg_ptr, this);
381
- return this;
2835
+ static wrap_decapsulation_key(decapsulation_key, wrapping_key) {
2836
+ let deferred4_0;
2837
+ let deferred4_1;
2838
+ try {
2839
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2840
+ const ptr0 = passArray8ToWasm0(decapsulation_key, wasm.__wbindgen_malloc);
2841
+ const len0 = WASM_VECTOR_LEN;
2842
+ const ptr1 = passArray8ToWasm0(wrapping_key, wasm.__wbindgen_malloc);
2843
+ const len1 = WASM_VECTOR_LEN;
2844
+ wasm.purecrypto_wrap_decapsulation_key(retptr, ptr0, len0, ptr1, len1);
2845
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2846
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2847
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2848
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2849
+ var ptr3 = r0;
2850
+ var len3 = r1;
2851
+ if (r3) {
2852
+ ptr3 = 0;
2853
+ len3 = 0;
2854
+ throw takeObject(r2);
2855
+ }
2856
+ deferred4_0 = ptr3;
2857
+ deferred4_1 = len3;
2858
+ return getStringFromWasm0(ptr3, len3);
2859
+ } finally {
2860
+ wasm.__wbindgen_add_to_stack_pointer(16);
2861
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
2862
+ }
382
2863
  }
383
2864
  /**
384
- * Test method, echoes back the input
385
- * @param {string} msg
386
- * @returns {string}
2865
+ * Unwraps (decrypts) a wrapped PKCS8 DER encoded decapsulation (private) key using a symmetric
2866
+ * wrapping key.
2867
+ * @param {string} wrapped_key
2868
+ * @param {Uint8Array} wrapping_key
2869
+ * @returns {Uint8Array}
387
2870
  */
388
- echo(msg) {
389
- let deferred2_0;
390
- let deferred2_1;
2871
+ static unwrap_decapsulation_key(wrapped_key, wrapping_key) {
391
2872
  try {
392
2873
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
393
- const ptr0 = passStringToWasm0(msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2874
+ const ptr0 = passStringToWasm0(wrapped_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
394
2875
  const len0 = WASM_VECTOR_LEN;
395
- wasm.bitwardenclient_echo(retptr, this.__wbg_ptr, ptr0, len0);
2876
+ const ptr1 = passArray8ToWasm0(wrapping_key, wasm.__wbindgen_malloc);
2877
+ const len1 = WASM_VECTOR_LEN;
2878
+ wasm.purecrypto_unwrap_decapsulation_key(retptr, ptr0, len0, ptr1, len1);
396
2879
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
397
2880
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
398
- deferred2_0 = r0;
399
- deferred2_1 = r1;
400
- return getStringFromWasm0(r0, r1);
2881
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2882
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2883
+ if (r3) {
2884
+ throw takeObject(r2);
2885
+ }
2886
+ var v3 = getArrayU8FromWasm0(r0, r1).slice();
2887
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
2888
+ return v3;
401
2889
  } finally {
402
2890
  wasm.__wbindgen_add_to_stack_pointer(16);
403
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
404
2891
  }
405
2892
  }
406
2893
  /**
2894
+ * Encapsulates (encrypts) a symmetric key using an asymmetric encapsulation key (public key)
2895
+ * in SPKI format, returning the encapsulated key as a string. Note: This is unsigned, so
2896
+ * the sender's authenticity cannot be verified by the recipient.
2897
+ * @param {Uint8Array} shared_key
2898
+ * @param {Uint8Array} encapsulation_key
407
2899
  * @returns {string}
408
2900
  */
409
- version() {
410
- let deferred1_0;
411
- let deferred1_1;
2901
+ static encapsulate_key_unsigned(shared_key, encapsulation_key) {
2902
+ let deferred4_0;
2903
+ let deferred4_1;
412
2904
  try {
413
2905
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
414
- wasm.bitwardenclient_version(retptr, this.__wbg_ptr);
2906
+ const ptr0 = passArray8ToWasm0(shared_key, wasm.__wbindgen_malloc);
2907
+ const len0 = WASM_VECTOR_LEN;
2908
+ const ptr1 = passArray8ToWasm0(encapsulation_key, wasm.__wbindgen_malloc);
2909
+ const len1 = WASM_VECTOR_LEN;
2910
+ wasm.purecrypto_encapsulate_key_unsigned(retptr, ptr0, len0, ptr1, len1);
415
2911
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
416
2912
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
417
- deferred1_0 = r0;
418
- deferred1_1 = r1;
419
- return getStringFromWasm0(r0, r1);
2913
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2914
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2915
+ var ptr3 = r0;
2916
+ var len3 = r1;
2917
+ if (r3) {
2918
+ ptr3 = 0;
2919
+ len3 = 0;
2920
+ throw takeObject(r2);
2921
+ }
2922
+ deferred4_0 = ptr3;
2923
+ deferred4_1 = len3;
2924
+ return getStringFromWasm0(ptr3, len3);
420
2925
  } finally {
421
2926
  wasm.__wbindgen_add_to_stack_pointer(16);
422
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2927
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
423
2928
  }
424
2929
  }
425
2930
  /**
426
- * @param {string} msg
427
- * @returns {Promise<void>}
2931
+ * Decapsulates (decrypts) a symmetric key using an decapsulation key (private key) in PKCS8
2932
+ * DER format. Note: This is unsigned, so the sender's authenticity cannot be verified by the
2933
+ * recipient.
2934
+ * @param {string} encapsulated_key
2935
+ * @param {Uint8Array} decapsulation_key
2936
+ * @returns {Uint8Array}
428
2937
  */
429
- throw(msg) {
430
- const ptr0 = passStringToWasm0(msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
431
- const len0 = WASM_VECTOR_LEN;
432
- const ret = wasm.bitwardenclient_throw(this.__wbg_ptr, ptr0, len0);
433
- return takeObject(ret);
2938
+ static decapsulate_key_unsigned(encapsulated_key, decapsulation_key) {
2939
+ try {
2940
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2941
+ const ptr0 = passStringToWasm0(
2942
+ encapsulated_key,
2943
+ wasm.__wbindgen_malloc,
2944
+ wasm.__wbindgen_realloc,
2945
+ );
2946
+ const len0 = WASM_VECTOR_LEN;
2947
+ const ptr1 = passArray8ToWasm0(decapsulation_key, wasm.__wbindgen_malloc);
2948
+ const len1 = WASM_VECTOR_LEN;
2949
+ wasm.purecrypto_decapsulate_key_unsigned(retptr, ptr0, len0, ptr1, len1);
2950
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2951
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2952
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2953
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2954
+ if (r3) {
2955
+ throw takeObject(r2);
2956
+ }
2957
+ var v3 = getArrayU8FromWasm0(r0, r1).slice();
2958
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
2959
+ return v3;
2960
+ } finally {
2961
+ wasm.__wbindgen_add_to_stack_pointer(16);
2962
+ }
434
2963
  }
435
2964
  /**
436
- * Test method, calls http endpoint
437
- * @param {string} url
438
- * @returns {Promise<string>}
2965
+ * Given a wrapped signing key and the symmetric key it is wrapped with, this returns
2966
+ * the corresponding verifying key.
2967
+ * @param {string} signing_key
2968
+ * @param {Uint8Array} wrapping_key
2969
+ * @returns {Uint8Array}
439
2970
  */
440
- http_get(url) {
441
- const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
442
- const len0 = WASM_VECTOR_LEN;
443
- const ret = wasm.bitwardenclient_http_get(this.__wbg_ptr, ptr0, len0);
444
- return takeObject(ret);
2971
+ static verifying_key_for_signing_key(signing_key, wrapping_key) {
2972
+ try {
2973
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2974
+ const ptr0 = passStringToWasm0(signing_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2975
+ const len0 = WASM_VECTOR_LEN;
2976
+ const ptr1 = passArray8ToWasm0(wrapping_key, wasm.__wbindgen_malloc);
2977
+ const len1 = WASM_VECTOR_LEN;
2978
+ wasm.purecrypto_verifying_key_for_signing_key(retptr, ptr0, len0, ptr1, len1);
2979
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2980
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2981
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2982
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2983
+ if (r3) {
2984
+ throw takeObject(r2);
2985
+ }
2986
+ var v3 = getArrayU8FromWasm0(r0, r1).slice();
2987
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
2988
+ return v3;
2989
+ } finally {
2990
+ wasm.__wbindgen_add_to_stack_pointer(16);
2991
+ }
445
2992
  }
446
2993
  /**
447
- * @returns {ClientCrypto}
2994
+ * Returns the algorithm used for the given verifying key.
2995
+ * @param {Uint8Array} verifying_key
2996
+ * @returns {SignatureAlgorithm}
448
2997
  */
449
- crypto() {
450
- const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
451
- return ClientCrypto.__wrap(ret);
2998
+ static key_algorithm_for_verifying_key(verifying_key) {
2999
+ try {
3000
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3001
+ const ptr0 = passArray8ToWasm0(verifying_key, wasm.__wbindgen_malloc);
3002
+ const len0 = WASM_VECTOR_LEN;
3003
+ wasm.purecrypto_key_algorithm_for_verifying_key(retptr, ptr0, len0);
3004
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3005
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3006
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
3007
+ if (r2) {
3008
+ throw takeObject(r1);
3009
+ }
3010
+ return takeObject(r0);
3011
+ } finally {
3012
+ wasm.__wbindgen_add_to_stack_pointer(16);
3013
+ }
452
3014
  }
453
3015
  /**
454
- * @returns {ClientVault}
3016
+ * For a given signing identity (verifying key), this function verifies that the signing
3017
+ * identity claimed ownership of the public key. This is a one-sided claim and merely shows
3018
+ * that the signing identity has the intent to receive messages encrypted to the public
3019
+ * key.
3020
+ * @param {Uint8Array} signed_public_key
3021
+ * @param {Uint8Array} verifying_key
3022
+ * @returns {Uint8Array}
455
3023
  */
456
- vault() {
457
- const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
458
- return ClientVault.__wrap(ret);
3024
+ static verify_and_unwrap_signed_public_key(signed_public_key, verifying_key) {
3025
+ try {
3026
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3027
+ const ptr0 = passArray8ToWasm0(signed_public_key, wasm.__wbindgen_malloc);
3028
+ const len0 = WASM_VECTOR_LEN;
3029
+ const ptr1 = passArray8ToWasm0(verifying_key, wasm.__wbindgen_malloc);
3030
+ const len1 = WASM_VECTOR_LEN;
3031
+ wasm.purecrypto_verify_and_unwrap_signed_public_key(retptr, ptr0, len0, ptr1, len1);
3032
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3033
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3034
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
3035
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
3036
+ if (r3) {
3037
+ throw takeObject(r2);
3038
+ }
3039
+ var v3 = getArrayU8FromWasm0(r0, r1).slice();
3040
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
3041
+ return v3;
3042
+ } finally {
3043
+ wasm.__wbindgen_add_to_stack_pointer(16);
3044
+ }
459
3045
  }
460
3046
  }
461
3047
 
462
- const ClientCryptoFinalization =
3048
+ const StateClientFinalization =
463
3049
  typeof FinalizationRegistry === "undefined"
464
3050
  ? { register: () => {}, unregister: () => {} }
465
- : new FinalizationRegistry((ptr) => wasm.__wbg_clientcrypto_free(ptr >>> 0, 1));
3051
+ : new FinalizationRegistry((ptr) => wasm.__wbg_stateclient_free(ptr >>> 0, 1));
466
3052
 
467
- export class ClientCrypto {
3053
+ export class StateClient {
468
3054
  static __wrap(ptr) {
469
3055
  ptr = ptr >>> 0;
470
- const obj = Object.create(ClientCrypto.prototype);
3056
+ const obj = Object.create(StateClient.prototype);
471
3057
  obj.__wbg_ptr = ptr;
472
- ClientCryptoFinalization.register(obj, obj.__wbg_ptr, obj);
3058
+ StateClientFinalization.register(obj, obj.__wbg_ptr, obj);
473
3059
  return obj;
474
3060
  }
475
3061
 
476
3062
  __destroy_into_raw() {
477
3063
  const ptr = this.__wbg_ptr;
478
3064
  this.__wbg_ptr = 0;
479
- ClientCryptoFinalization.unregister(this);
3065
+ StateClientFinalization.unregister(this);
480
3066
  return ptr;
481
3067
  }
482
3068
 
483
3069
  free() {
484
3070
  const ptr = this.__destroy_into_raw();
485
- wasm.__wbg_clientcrypto_free(ptr, 0);
3071
+ wasm.__wbg_stateclient_free(ptr, 0);
486
3072
  }
487
3073
  /**
488
- * Initialization method for the user crypto. Needs to be called before any other crypto
489
- * operations.
490
- * @param {InitUserCryptoRequest} req
491
- * @returns {Promise<void>}
492
- */
493
- initialize_user_crypto(req) {
494
- const ret = wasm.clientcrypto_initialize_user_crypto(this.__wbg_ptr, addHeapObject(req));
495
- return takeObject(ret);
496
- }
497
- /**
498
- * Initialization method for the organization crypto. Needs to be called after
499
- * `initialize_user_crypto` but before any other crypto operations.
500
- * @param {InitOrgCryptoRequest} req
501
- * @returns {Promise<void>}
3074
+ * @param {Repository<Cipher>} store
502
3075
  */
503
- initialize_org_crypto(req) {
504
- const ret = wasm.clientcrypto_initialize_org_crypto(this.__wbg_ptr, addHeapObject(req));
505
- return takeObject(ret);
3076
+ register_cipher_repository(store) {
3077
+ wasm.stateclient_register_cipher_repository(this.__wbg_ptr, addHeapObject(store));
506
3078
  }
507
3079
  }
508
3080
 
509
- const ClientFoldersFinalization =
3081
+ const TotpClientFinalization =
510
3082
  typeof FinalizationRegistry === "undefined"
511
3083
  ? { register: () => {}, unregister: () => {} }
512
- : new FinalizationRegistry((ptr) => wasm.__wbg_clientfolders_free(ptr >>> 0, 1));
3084
+ : new FinalizationRegistry((ptr) => wasm.__wbg_totpclient_free(ptr >>> 0, 1));
513
3085
 
514
- export class ClientFolders {
3086
+ export class TotpClient {
515
3087
  static __wrap(ptr) {
516
3088
  ptr = ptr >>> 0;
517
- const obj = Object.create(ClientFolders.prototype);
3089
+ const obj = Object.create(TotpClient.prototype);
518
3090
  obj.__wbg_ptr = ptr;
519
- ClientFoldersFinalization.register(obj, obj.__wbg_ptr, obj);
3091
+ TotpClientFinalization.register(obj, obj.__wbg_ptr, obj);
520
3092
  return obj;
521
3093
  }
522
3094
 
523
3095
  __destroy_into_raw() {
524
3096
  const ptr = this.__wbg_ptr;
525
3097
  this.__wbg_ptr = 0;
526
- ClientFoldersFinalization.unregister(this);
3098
+ TotpClientFinalization.unregister(this);
527
3099
  return ptr;
528
3100
  }
529
3101
 
530
3102
  free() {
531
3103
  const ptr = this.__destroy_into_raw();
532
- wasm.__wbg_clientfolders_free(ptr, 0);
3104
+ wasm.__wbg_totpclient_free(ptr, 0);
533
3105
  }
534
3106
  /**
535
- * Decrypt folder
536
- * @param {Folder} folder
537
- * @returns {FolderView}
3107
+ * Generates a TOTP code from a provided key
3108
+ *
3109
+ * # Arguments
3110
+ * - `key` - Can be:
3111
+ * - A base32 encoded string
3112
+ * - OTP Auth URI
3113
+ * - Steam URI
3114
+ * - `time_ms` - Optional timestamp in milliseconds
3115
+ * @param {string} key
3116
+ * @param {number | null} [time_ms]
3117
+ * @returns {TotpResponse}
538
3118
  */
539
- decrypt(folder) {
3119
+ generate_totp(key, time_ms) {
540
3120
  try {
541
3121
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
542
- wasm.clientfolders_decrypt(retptr, this.__wbg_ptr, addHeapObject(folder));
3122
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3123
+ const len0 = WASM_VECTOR_LEN;
3124
+ wasm.totpclient_generate_totp(
3125
+ retptr,
3126
+ this.__wbg_ptr,
3127
+ ptr0,
3128
+ len0,
3129
+ !isLikeNone(time_ms),
3130
+ isLikeNone(time_ms) ? 0 : time_ms,
3131
+ );
543
3132
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
544
3133
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
545
3134
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -553,240 +3142,294 @@ export class ClientFolders {
553
3142
  }
554
3143
  }
555
3144
 
556
- const ClientVaultFinalization =
3145
+ const VaultClientFinalization =
557
3146
  typeof FinalizationRegistry === "undefined"
558
3147
  ? { register: () => {}, unregister: () => {} }
559
- : new FinalizationRegistry((ptr) => wasm.__wbg_clientvault_free(ptr >>> 0, 1));
3148
+ : new FinalizationRegistry((ptr) => wasm.__wbg_vaultclient_free(ptr >>> 0, 1));
560
3149
 
561
- export class ClientVault {
3150
+ export class VaultClient {
562
3151
  static __wrap(ptr) {
563
3152
  ptr = ptr >>> 0;
564
- const obj = Object.create(ClientVault.prototype);
3153
+ const obj = Object.create(VaultClient.prototype);
565
3154
  obj.__wbg_ptr = ptr;
566
- ClientVaultFinalization.register(obj, obj.__wbg_ptr, obj);
3155
+ VaultClientFinalization.register(obj, obj.__wbg_ptr, obj);
567
3156
  return obj;
568
3157
  }
569
3158
 
570
3159
  __destroy_into_raw() {
571
3160
  const ptr = this.__wbg_ptr;
572
3161
  this.__wbg_ptr = 0;
573
- ClientVaultFinalization.unregister(this);
3162
+ VaultClientFinalization.unregister(this);
574
3163
  return ptr;
575
3164
  }
576
3165
 
577
3166
  free() {
578
3167
  const ptr = this.__destroy_into_raw();
579
- wasm.__wbg_clientvault_free(ptr, 0);
3168
+ wasm.__wbg_vaultclient_free(ptr, 0);
3169
+ }
3170
+ /**
3171
+ * Attachment related operations.
3172
+ * @returns {AttachmentsClient}
3173
+ */
3174
+ attachments() {
3175
+ const ret = wasm.vaultclient_attachments(this.__wbg_ptr);
3176
+ return AttachmentsClient.__wrap(ret);
3177
+ }
3178
+ /**
3179
+ * Cipher related operations.
3180
+ * @returns {CiphersClient}
3181
+ */
3182
+ ciphers() {
3183
+ const ret = wasm.vaultclient_attachments(this.__wbg_ptr);
3184
+ return CiphersClient.__wrap(ret);
580
3185
  }
581
3186
  /**
582
- * @returns {ClientFolders}
3187
+ * Folder related operations.
3188
+ * @returns {FoldersClient}
583
3189
  */
584
3190
  folders() {
585
- const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
586
- return ClientFolders.__wrap(ret);
3191
+ const ret = wasm.vaultclient_attachments(this.__wbg_ptr);
3192
+ return FoldersClient.__wrap(ret);
3193
+ }
3194
+ /**
3195
+ * TOTP related operations.
3196
+ * @returns {TotpClient}
3197
+ */
3198
+ totp() {
3199
+ const ret = wasm.vaultclient_attachments(this.__wbg_ptr);
3200
+ return TotpClient.__wrap(ret);
587
3201
  }
588
3202
  }
589
3203
 
590
- export function __wbindgen_string_new(arg0, arg1) {
591
- const ret = getStringFromWasm0(arg0, arg1);
592
- return addHeapObject(ret);
3204
+ export function __wbg_String_8f0eb39a4a4c2f66(arg0, arg1) {
3205
+ const ret = String(getObject(arg1));
3206
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3207
+ const len1 = WASM_VECTOR_LEN;
3208
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
3209
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
593
3210
  }
594
3211
 
595
- export function __wbg_get_ef828680c64da212() {
596
- return handleError(function (arg0, arg1) {
597
- const ret = Reflect.get(getObject(arg0), getObject(arg1));
598
- return addHeapObject(ret);
3212
+ export function __wbg_abort_410ec47a64ac6117(arg0, arg1) {
3213
+ getObject(arg0).abort(getObject(arg1));
3214
+ }
3215
+
3216
+ export function __wbg_abort_775ef1d17fc65868(arg0) {
3217
+ getObject(arg0).abort();
3218
+ }
3219
+
3220
+ export function __wbg_addEventListener_dc3da056b615f634(arg0, arg1, arg2, arg3) {
3221
+ getObject(arg0).addEventListener(getStringFromWasm0(arg1, arg2), getObject(arg3));
3222
+ }
3223
+
3224
+ export function __wbg_append_299d5d48292c0495() {
3225
+ return handleError(function (arg0, arg1, arg2, arg3, arg4) {
3226
+ getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
599
3227
  }, arguments);
600
3228
  }
601
3229
 
602
- export function __wbindgen_object_drop_ref(arg0) {
603
- takeObject(arg0);
3230
+ export function __wbg_append_8c7dd8d641a5f01b() {
3231
+ return handleError(function (arg0, arg1, arg2, arg3, arg4) {
3232
+ getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
3233
+ }, arguments);
604
3234
  }
605
3235
 
606
- export function __wbindgen_string_get(arg0, arg1) {
607
- const obj = getObject(arg1);
608
- const ret = typeof obj === "string" ? obj : undefined;
609
- var ptr1 = isLikeNone(ret)
610
- ? 0
611
- : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
612
- var len1 = WASM_VECTOR_LEN;
613
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
614
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
3236
+ export function __wbg_append_b2d1fc16de2a0e81() {
3237
+ return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
3238
+ getObject(arg0).append(
3239
+ getStringFromWasm0(arg1, arg2),
3240
+ getObject(arg3),
3241
+ getStringFromWasm0(arg4, arg5),
3242
+ );
3243
+ }, arguments);
615
3244
  }
616
3245
 
617
- export function __wbg_new_fe19e4f3db5c3999(arg0, arg1) {
618
- let deferred0_0;
619
- let deferred0_1;
620
- try {
621
- deferred0_0 = arg0;
622
- deferred0_1 = arg1;
623
- const ret = new Error(getStringFromWasm0(arg0, arg1));
624
- return addHeapObject(ret);
625
- } finally {
626
- wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
627
- }
3246
+ export function __wbg_append_b44785ebeb668479() {
3247
+ return handleError(function (arg0, arg1, arg2, arg3) {
3248
+ getObject(arg0).append(getStringFromWasm0(arg1, arg2), getObject(arg3));
3249
+ }, arguments);
628
3250
  }
629
3251
 
630
- export function __wbg_setname_46d623c31ae39910(arg0, arg1, arg2) {
631
- let deferred0_0;
632
- let deferred0_1;
633
- try {
634
- deferred0_0 = arg1;
635
- deferred0_1 = arg2;
636
- getObject(arg0).name = getStringFromWasm0(arg1, arg2);
637
- } finally {
638
- wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
639
- }
3252
+ export function __wbg_buffer_609cc3eee51ed158(arg0) {
3253
+ const ret = getObject(arg0).buffer;
3254
+ return addHeapObject(ret);
640
3255
  }
641
3256
 
642
- export function __wbg_setvariant_262a12673324f71b(arg0, arg1, arg2) {
643
- let deferred0_0;
644
- let deferred0_1;
645
- try {
646
- deferred0_0 = arg1;
647
- deferred0_1 = arg2;
648
- getObject(arg0).variant = getStringFromWasm0(arg1, arg2);
649
- } finally {
650
- wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
651
- }
3257
+ export function __wbg_call_672a4d21634d4a24() {
3258
+ return handleError(function (arg0, arg1) {
3259
+ const ret = getObject(arg0).call(getObject(arg1));
3260
+ return addHeapObject(ret);
3261
+ }, arguments);
652
3262
  }
653
3263
 
654
- export function __wbindgen_jsval_loose_eq(arg0, arg1) {
655
- const ret = getObject(arg0) == getObject(arg1);
656
- return ret;
3264
+ export function __wbg_call_7cccdd69e0791ae2() {
3265
+ return handleError(function (arg0, arg1, arg2) {
3266
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
3267
+ return addHeapObject(ret);
3268
+ }, arguments);
657
3269
  }
658
3270
 
659
- export function __wbindgen_is_object(arg0) {
660
- const val = getObject(arg0);
661
- const ret = typeof val === "object" && val !== null;
662
- return ret;
3271
+ export function __wbg_clearTimeout_b1115618e821c3b2(arg0) {
3272
+ const ret = clearTimeout(takeObject(arg0));
3273
+ return addHeapObject(ret);
663
3274
  }
664
3275
 
665
- export function __wbg_getwithrefkey_edc2c8960f0f1191(arg0, arg1) {
666
- const ret = getObject(arg0)[getObject(arg1)];
3276
+ export function __wbg_crypto_574e78ad8b13b65f(arg0) {
3277
+ const ret = getObject(arg0).crypto;
667
3278
  return addHeapObject(ret);
668
3279
  }
669
3280
 
670
- export function __wbindgen_is_undefined(arg0) {
671
- const ret = getObject(arg0) === undefined;
672
- return ret;
3281
+ export function __wbg_debug_e17b51583ca6a632(arg0, arg1, arg2, arg3) {
3282
+ console.debug(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
673
3283
  }
674
3284
 
675
- export function __wbindgen_in(arg0, arg1) {
676
- const ret = getObject(arg0) in getObject(arg1);
3285
+ export function __wbg_done_769e5ede4b31c67b(arg0) {
3286
+ const ret = getObject(arg0).done;
677
3287
  return ret;
678
3288
  }
679
3289
 
680
- export function __wbg_isSafeInteger_b9dff570f01a9100(arg0) {
681
- const ret = Number.isSafeInteger(getObject(arg0));
682
- return ret;
3290
+ export function __wbg_entries_3265d4158b33e5dc(arg0) {
3291
+ const ret = Object.entries(getObject(arg0));
3292
+ return addHeapObject(ret);
683
3293
  }
684
3294
 
685
- export function __wbindgen_as_number(arg0) {
686
- const ret = +getObject(arg0);
687
- return ret;
3295
+ export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
3296
+ let deferred0_0;
3297
+ let deferred0_1;
3298
+ try {
3299
+ deferred0_0 = arg0;
3300
+ deferred0_1 = arg1;
3301
+ console.error(getStringFromWasm0(arg0, arg1));
3302
+ } finally {
3303
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
3304
+ }
688
3305
  }
689
3306
 
690
- export function __wbindgen_is_string(arg0) {
691
- const ret = typeof getObject(arg0) === "string";
692
- return ret;
3307
+ export function __wbg_error_80de38b3f7cc3c3c(arg0, arg1, arg2, arg3) {
3308
+ console.error(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
693
3309
  }
694
3310
 
695
- export function __wbg_entries_c02034de337d3ee2(arg0) {
696
- const ret = Object.entries(getObject(arg0));
3311
+ export function __wbg_fetch_3afbdcc7ddbf16fe(arg0) {
3312
+ const ret = fetch(getObject(arg0));
697
3313
  return addHeapObject(ret);
698
3314
  }
699
3315
 
700
- export function __wbg_length_f217bbbf7e8e4df4(arg0) {
701
- const ret = getObject(arg0).length;
702
- return ret;
703
- }
704
-
705
- export function __wbg_get_5419cf6b954aa11d(arg0, arg1) {
706
- const ret = getObject(arg0)[arg1 >>> 0];
3316
+ export function __wbg_fetch_509096533071c657(arg0, arg1) {
3317
+ const ret = getObject(arg0).fetch(getObject(arg1));
707
3318
  return addHeapObject(ret);
708
3319
  }
709
3320
 
710
- export function __wbindgen_object_clone_ref(arg0) {
711
- const ret = getObject(arg0);
712
- return addHeapObject(ret);
3321
+ export function __wbg_getRandomValues_38097e921c2494c3() {
3322
+ return handleError(function (arg0, arg1) {
3323
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
3324
+ }, arguments);
713
3325
  }
714
3326
 
715
- export function __wbg_next_b06e115d1b01e10b() {
716
- return handleError(function (arg0) {
717
- const ret = getObject(arg0).next();
718
- return addHeapObject(ret);
3327
+ export function __wbg_getRandomValues_b8f5dbd5f3995a9e() {
3328
+ return handleError(function (arg0, arg1) {
3329
+ getObject(arg0).getRandomValues(getObject(arg1));
719
3330
  }, arguments);
720
3331
  }
721
3332
 
722
- export function __wbg_done_983b5ffcaec8c583(arg0) {
723
- const ret = getObject(arg0).done;
3333
+ export function __wbg_getTime_46267b1c24877e30(arg0) {
3334
+ const ret = getObject(arg0).getTime();
724
3335
  return ret;
725
3336
  }
726
3337
 
727
- export function __wbg_value_2ab8a198c834c26a(arg0) {
728
- const ret = getObject(arg0).value;
3338
+ export function __wbg_get_67b2ba62fc30de12() {
3339
+ return handleError(function (arg0, arg1) {
3340
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
3341
+ return addHeapObject(ret);
3342
+ }, arguments);
3343
+ }
3344
+
3345
+ export function __wbg_get_b9b93047fe3cf45b(arg0, arg1) {
3346
+ const ret = getObject(arg0)[arg1 >>> 0];
729
3347
  return addHeapObject(ret);
730
3348
  }
731
3349
 
732
- export function __wbg_call_3bfa248576352471() {
3350
+ export function __wbg_get_d74b07b1ba78be21() {
733
3351
  return handleError(function (arg0, arg1, arg2) {
734
- const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
735
- return addHeapObject(ret);
3352
+ let deferred0_0;
3353
+ let deferred0_1;
3354
+ try {
3355
+ deferred0_0 = arg1;
3356
+ deferred0_1 = arg2;
3357
+ const ret = getObject(arg0).get(getStringFromWasm0(arg1, arg2));
3358
+ return addHeapObject(ret);
3359
+ } finally {
3360
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
3361
+ }
736
3362
  }, arguments);
737
3363
  }
738
3364
 
739
- export function __wbg_new_e69b5f66fda8f13c() {
740
- const ret = new Object();
3365
+ export function __wbg_getaccesstoken_cd88c09c15f625e0(arg0) {
3366
+ const ret = getObject(arg0).get_access_token();
741
3367
  return addHeapObject(ret);
742
3368
  }
743
3369
 
744
- export function __wbg_setmethod_ce2da76000b02f6a(arg0, arg1, arg2) {
745
- getObject(arg0).method = getStringFromWasm0(arg1, arg2);
3370
+ export function __wbg_getwithrefkey_1dc361bd10053bfe(arg0, arg1) {
3371
+ const ret = getObject(arg0)[getObject(arg1)];
3372
+ return addHeapObject(ret);
746
3373
  }
747
3374
 
748
- export function __wbg_new_a9ae04a5200606a5() {
749
- return handleError(function () {
750
- const ret = new Headers();
751
- return addHeapObject(ret);
3375
+ export function __wbg_has_a5ea9117f258a0ec() {
3376
+ return handleError(function (arg0, arg1) {
3377
+ const ret = Reflect.has(getObject(arg0), getObject(arg1));
3378
+ return ret;
752
3379
  }, arguments);
753
3380
  }
754
3381
 
755
- export function __wbg_setheaders_f5205d36e423a544(arg0, arg1) {
756
- getObject(arg0).headers = getObject(arg1);
757
- }
758
-
759
- export function __wbg_setmode_4919fd636102c586(arg0, arg1) {
760
- getObject(arg0).mode = __wbindgen_enum_RequestMode[arg1];
3382
+ export function __wbg_headers_9cb51cfd2ac780a4(arg0) {
3383
+ const ret = getObject(arg0).headers;
3384
+ return addHeapObject(ret);
761
3385
  }
762
3386
 
763
- export function __wbg_setcredentials_a4e661320cdb9738(arg0, arg1) {
764
- getObject(arg0).credentials = __wbindgen_enum_RequestCredentials[arg1];
3387
+ export function __wbg_incomingmessage_new(arg0) {
3388
+ const ret = IncomingMessage.__wrap(arg0);
3389
+ return addHeapObject(ret);
765
3390
  }
766
3391
 
767
- export function __wbg_setbody_aa8b691bec428bf4(arg0, arg1) {
768
- getObject(arg0).body = getObject(arg1);
3392
+ export function __wbg_info_033d8b8a0838f1d3(arg0, arg1, arg2, arg3) {
3393
+ console.info(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
769
3394
  }
770
3395
 
771
- export function __wbg_signal_9acfcec9e7dffc22(arg0) {
772
- const ret = getObject(arg0).signal;
773
- return addHeapObject(ret);
3396
+ export function __wbg_instanceof_ArrayBuffer_e14585432e3737fc(arg0) {
3397
+ let result;
3398
+ try {
3399
+ result = getObject(arg0) instanceof ArrayBuffer;
3400
+ } catch (_) {
3401
+ result = false;
3402
+ }
3403
+ const ret = result;
3404
+ return ret;
774
3405
  }
775
3406
 
776
- export function __wbg_setsignal_812ccb8269a7fd90(arg0, arg1) {
777
- getObject(arg0).signal = getObject(arg1);
3407
+ export function __wbg_instanceof_Map_f3469ce2244d2430(arg0) {
3408
+ let result;
3409
+ try {
3410
+ result = getObject(arg0) instanceof Map;
3411
+ } catch (_) {
3412
+ result = false;
3413
+ }
3414
+ const ret = result;
3415
+ return ret;
778
3416
  }
779
3417
 
780
- export function __wbg_append_8b3e7f74a47ea7d5() {
781
- return handleError(function (arg0, arg1, arg2, arg3, arg4) {
782
- getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
783
- }, arguments);
3418
+ export function __wbg_instanceof_Response_f2cc20d9f7dfd644(arg0) {
3419
+ let result;
3420
+ try {
3421
+ result = getObject(arg0) instanceof Response;
3422
+ } catch (_) {
3423
+ result = false;
3424
+ }
3425
+ const ret = result;
3426
+ return ret;
784
3427
  }
785
3428
 
786
- export function __wbg_instanceof_Response_3c0e210a57ff751d(arg0) {
3429
+ export function __wbg_instanceof_Uint8Array_17156bcf118086a9(arg0) {
787
3430
  let result;
788
3431
  try {
789
- result = getObject(arg0) instanceof Response;
3432
+ result = getObject(arg0) instanceof Uint8Array;
790
3433
  } catch (_) {
791
3434
  result = false;
792
3435
  }
@@ -794,65 +3437,72 @@ export function __wbg_instanceof_Response_3c0e210a57ff751d(arg0) {
794
3437
  return ret;
795
3438
  }
796
3439
 
797
- export function __wbg_status_5f4e900d22140a18(arg0) {
798
- const ret = getObject(arg0).status;
3440
+ export function __wbg_ipcclientsubscription_new(arg0) {
3441
+ const ret = IpcClientSubscription.__wrap(arg0);
3442
+ return addHeapObject(ret);
3443
+ }
3444
+
3445
+ export function __wbg_isArray_a1eab7e0d067391b(arg0) {
3446
+ const ret = Array.isArray(getObject(arg0));
799
3447
  return ret;
800
3448
  }
801
3449
 
802
- export function __wbg_url_58af972663531d16(arg0, arg1) {
803
- const ret = getObject(arg1).url;
804
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
805
- const len1 = WASM_VECTOR_LEN;
806
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
807
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
3450
+ export function __wbg_isSafeInteger_343e2beeeece1bb0(arg0) {
3451
+ const ret = Number.isSafeInteger(getObject(arg0));
3452
+ return ret;
808
3453
  }
809
3454
 
810
- export function __wbg_headers_1b9bf90c73fae600(arg0) {
811
- const ret = getObject(arg0).headers;
3455
+ export function __wbg_iterator_9a24c88df860dc65() {
3456
+ const ret = Symbol.iterator;
812
3457
  return addHeapObject(ret);
813
3458
  }
814
3459
 
815
- export function __wbg_stringify_eead5648c09faaf8() {
816
- return handleError(function (arg0) {
817
- const ret = JSON.stringify(getObject(arg0));
818
- return addHeapObject(ret);
819
- }, arguments);
3460
+ export function __wbg_length_a446193dc22c12f8(arg0) {
3461
+ const ret = getObject(arg0).length;
3462
+ return ret;
820
3463
  }
821
3464
 
822
- export function __wbg_abort_c57daab47a6c1215(arg0) {
823
- getObject(arg0).abort();
3465
+ export function __wbg_length_e2d2a49132c1b256(arg0) {
3466
+ const ret = getObject(arg0).length;
3467
+ return ret;
824
3468
  }
825
3469
 
826
- export function __wbg_text_ebeee8b31af4c919() {
3470
+ export function __wbg_list_d70422907576c249() {
827
3471
  return handleError(function (arg0) {
828
- const ret = getObject(arg0).text();
3472
+ const ret = getObject(arg0).list();
829
3473
  return addHeapObject(ret);
830
3474
  }, arguments);
831
3475
  }
832
3476
 
833
- export function __wbindgen_cb_drop(arg0) {
834
- const obj = takeObject(arg0).original;
835
- if (obj.cnt-- == 1) {
836
- obj.a = 0;
837
- return true;
838
- }
839
- const ret = false;
840
- return ret;
3477
+ export function __wbg_log_cad59bb680daec67(arg0, arg1, arg2, arg3) {
3478
+ console.log(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
841
3479
  }
842
3480
 
843
- export function __wbindgen_error_new(arg0, arg1) {
844
- const ret = new Error(getStringFromWasm0(arg0, arg1));
3481
+ export function __wbg_msCrypto_a61aeb35a24c1329(arg0) {
3482
+ const ret = getObject(arg0).msCrypto;
3483
+ return addHeapObject(ret);
3484
+ }
3485
+
3486
+ export function __wbg_new0_f788a2397c7ca929() {
3487
+ const ret = new Date();
845
3488
  return addHeapObject(ret);
846
3489
  }
847
3490
 
848
- export function __wbg_new_1073970097e5a420(arg0, arg1) {
3491
+ export function __wbg_new_018dcc2d6c8c2f6a() {
3492
+ return handleError(function () {
3493
+ const ret = new Headers();
3494
+ return addHeapObject(ret);
3495
+ }, arguments);
3496
+ }
3497
+
3498
+ export function __wbg_new_23a2665fac83c611(arg0, arg1) {
849
3499
  try {
850
3500
  var state0 = { a: arg0, b: arg1 };
851
3501
  var cb0 = (arg0, arg1) => {
852
3502
  const a = state0.a;
853
3503
  state0.a = 0;
854
3504
  try {
855
- return __wbg_adapter_125(a, state0.b, arg0, arg1);
3505
+ return __wbg_adapter_277(a, state0.b, arg0, arg1);
856
3506
  } finally {
857
3507
  state0.a = a;
858
3508
  }
@@ -864,359 +3514,492 @@ export function __wbg_new_1073970097e5a420(arg0, arg1) {
864
3514
  }
865
3515
  }
866
3516
 
867
- export function __wbg_set_f975102236d3c502(arg0, arg1, arg2) {
868
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
3517
+ export function __wbg_new_405e22f390576ce2() {
3518
+ const ret = new Object();
3519
+ return addHeapObject(ret);
3520
+ }
3521
+
3522
+ export function __wbg_new_78feb108b6472713() {
3523
+ const ret = new Array();
3524
+ return addHeapObject(ret);
869
3525
  }
870
3526
 
871
- export function __wbg_new_abda76e883ba8a5f() {
3527
+ export function __wbg_new_8a6f238a6ece86ea() {
872
3528
  const ret = new Error();
873
3529
  return addHeapObject(ret);
874
3530
  }
875
3531
 
876
- export function __wbg_stack_658279fe44541cf6(arg0, arg1) {
877
- const ret = getObject(arg1).stack;
878
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
879
- const len1 = WASM_VECTOR_LEN;
880
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
881
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
3532
+ export function __wbg_new_9fd39a253424609a() {
3533
+ return handleError(function () {
3534
+ const ret = new FormData();
3535
+ return addHeapObject(ret);
3536
+ }, arguments);
3537
+ }
3538
+
3539
+ export function __wbg_new_a12002a7f91c75be(arg0) {
3540
+ const ret = new Uint8Array(getObject(arg0));
3541
+ return addHeapObject(ret);
3542
+ }
3543
+
3544
+ export function __wbg_new_c68d7209be747379(arg0, arg1) {
3545
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
3546
+ return addHeapObject(ret);
3547
+ }
3548
+
3549
+ export function __wbg_new_e25e5aab09ff45db() {
3550
+ return handleError(function () {
3551
+ const ret = new AbortController();
3552
+ return addHeapObject(ret);
3553
+ }, arguments);
882
3554
  }
883
3555
 
884
- export function __wbg_error_f851667af71bcfc6(arg0, arg1) {
3556
+ export function __wbg_new_f24b6d53abe5bc82(arg0, arg1) {
885
3557
  let deferred0_0;
886
3558
  let deferred0_1;
887
3559
  try {
888
3560
  deferred0_0 = arg0;
889
3561
  deferred0_1 = arg1;
890
- console.error(getStringFromWasm0(arg0, arg1));
3562
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
3563
+ return addHeapObject(ret);
891
3564
  } finally {
892
3565
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
893
3566
  }
894
3567
  }
895
3568
 
896
- export function __wbg_crypto_1d1f22824a6a080c(arg0) {
897
- const ret = getObject(arg0).crypto;
3569
+ export function __wbg_newnoargs_105ed471475aaf50(arg0, arg1) {
3570
+ const ret = new Function(getStringFromWasm0(arg0, arg1));
898
3571
  return addHeapObject(ret);
899
3572
  }
900
3573
 
901
- export function __wbg_process_4a72847cc503995b(arg0) {
902
- const ret = getObject(arg0).process;
3574
+ export function __wbg_newwithbyteoffsetandlength_d97e637ebe145a9a(arg0, arg1, arg2) {
3575
+ const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
903
3576
  return addHeapObject(ret);
904
3577
  }
905
3578
 
906
- export function __wbg_versions_f686565e586dd935(arg0) {
907
- const ret = getObject(arg0).versions;
3579
+ export function __wbg_newwithlength_a381634e90c276d4(arg0) {
3580
+ const ret = new Uint8Array(arg0 >>> 0);
3581
+ return addHeapObject(ret);
3582
+ }
3583
+
3584
+ export function __wbg_newwithstrandinit_06c535e0a867c635() {
3585
+ return handleError(function (arg0, arg1, arg2) {
3586
+ const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
3587
+ return addHeapObject(ret);
3588
+ }, arguments);
3589
+ }
3590
+
3591
+ export function __wbg_newwithu8arraysequenceandoptions_068570c487f69127() {
3592
+ return handleError(function (arg0, arg1) {
3593
+ const ret = new Blob(getObject(arg0), getObject(arg1));
3594
+ return addHeapObject(ret);
3595
+ }, arguments);
3596
+ }
3597
+
3598
+ export function __wbg_next_25feadfc0913fea9(arg0) {
3599
+ const ret = getObject(arg0).next;
908
3600
  return addHeapObject(ret);
909
3601
  }
910
3602
 
911
- export function __wbg_node_104a2ff8d6ea03a2(arg0) {
3603
+ export function __wbg_next_6574e1a8a62d1055() {
3604
+ return handleError(function (arg0) {
3605
+ const ret = getObject(arg0).next();
3606
+ return addHeapObject(ret);
3607
+ }, arguments);
3608
+ }
3609
+
3610
+ export function __wbg_node_905d3e251edff8a2(arg0) {
912
3611
  const ret = getObject(arg0).node;
913
3612
  return addHeapObject(ret);
914
3613
  }
915
3614
 
916
- export function __wbg_require_cca90b1a94a0255b() {
3615
+ export function __wbg_parse_def2e24ef1252aff() {
3616
+ return handleError(function (arg0, arg1) {
3617
+ const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
3618
+ return addHeapObject(ret);
3619
+ }, arguments);
3620
+ }
3621
+
3622
+ export function __wbg_process_dc0fbacc7c1c06f7(arg0) {
3623
+ const ret = getObject(arg0).process;
3624
+ return addHeapObject(ret);
3625
+ }
3626
+
3627
+ export function __wbg_push_737cfc8c1432c2c6(arg0, arg1) {
3628
+ const ret = getObject(arg0).push(getObject(arg1));
3629
+ return ret;
3630
+ }
3631
+
3632
+ export function __wbg_queueMicrotask_97d92b4fcc8a61c5(arg0) {
3633
+ queueMicrotask(getObject(arg0));
3634
+ }
3635
+
3636
+ export function __wbg_queueMicrotask_d3219def82552485(arg0) {
3637
+ const ret = getObject(arg0).queueMicrotask;
3638
+ return addHeapObject(ret);
3639
+ }
3640
+
3641
+ export function __wbg_randomFillSync_ac0988aba3254290() {
3642
+ return handleError(function (arg0, arg1) {
3643
+ getObject(arg0).randomFillSync(takeObject(arg1));
3644
+ }, arguments);
3645
+ }
3646
+
3647
+ export function __wbg_remove_6e647c9863046e4c() {
3648
+ return handleError(function (arg0, arg1, arg2) {
3649
+ let deferred0_0;
3650
+ let deferred0_1;
3651
+ try {
3652
+ deferred0_0 = arg1;
3653
+ deferred0_1 = arg2;
3654
+ const ret = getObject(arg0).remove(getStringFromWasm0(arg1, arg2));
3655
+ return addHeapObject(ret);
3656
+ } finally {
3657
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
3658
+ }
3659
+ }, arguments);
3660
+ }
3661
+
3662
+ export function __wbg_require_60cc747a6bc5215a() {
917
3663
  return handleError(function () {
918
3664
  const ret = module.require;
919
3665
  return addHeapObject(ret);
920
3666
  }, arguments);
921
3667
  }
922
3668
 
923
- export function __wbindgen_is_function(arg0) {
924
- const ret = typeof getObject(arg0) === "function";
925
- return ret;
3669
+ export function __wbg_resolve_4851785c9c5f573d(arg0) {
3670
+ const ret = Promise.resolve(getObject(arg0));
3671
+ return addHeapObject(ret);
3672
+ }
3673
+
3674
+ export function __wbg_send_9b8fc6bb517867dd() {
3675
+ return handleError(function (arg0, arg1) {
3676
+ const ret = getObject(arg0).send(OutgoingMessage.__wrap(arg1));
3677
+ return addHeapObject(ret);
3678
+ }, arguments);
3679
+ }
3680
+
3681
+ export function __wbg_setTimeout_ca12ead8b48245e2(arg0, arg1) {
3682
+ const ret = setTimeout(getObject(arg0), arg1);
3683
+ return addHeapObject(ret);
3684
+ }
3685
+
3686
+ export function __wbg_set_37837023f3d740e8(arg0, arg1, arg2) {
3687
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
3688
+ }
3689
+
3690
+ export function __wbg_set_3f1d0b984ed272ed(arg0, arg1, arg2) {
3691
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
3692
+ }
3693
+
3694
+ export function __wbg_set_616a519deee0d894() {
3695
+ return handleError(function (arg0, arg1, arg2, arg3) {
3696
+ let deferred0_0;
3697
+ let deferred0_1;
3698
+ try {
3699
+ deferred0_0 = arg1;
3700
+ deferred0_1 = arg2;
3701
+ const ret = getObject(arg0).set(getStringFromWasm0(arg1, arg2), takeObject(arg3));
3702
+ return addHeapObject(ret);
3703
+ } finally {
3704
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
3705
+ }
3706
+ }, arguments);
3707
+ }
3708
+
3709
+ export function __wbg_set_65595bdd868b3009(arg0, arg1, arg2) {
3710
+ getObject(arg0).set(getObject(arg1), arg2 >>> 0);
3711
+ }
3712
+
3713
+ export function __wbg_setbody_5923b78a95eedf29(arg0, arg1) {
3714
+ getObject(arg0).body = getObject(arg1);
3715
+ }
3716
+
3717
+ export function __wbg_setcredentials_c3a22f1cd105a2c6(arg0, arg1) {
3718
+ getObject(arg0).credentials = __wbindgen_enum_RequestCredentials[arg1];
3719
+ }
3720
+
3721
+ export function __wbg_setheaders_834c0bdb6a8949ad(arg0, arg1) {
3722
+ getObject(arg0).headers = getObject(arg1);
926
3723
  }
927
3724
 
928
- export function __wbg_msCrypto_eb05e62b530a1508(arg0) {
929
- const ret = getObject(arg0).msCrypto;
930
- return addHeapObject(ret);
3725
+ export function __wbg_setmethod_3c5280fe5d890842(arg0, arg1, arg2) {
3726
+ getObject(arg0).method = getStringFromWasm0(arg1, arg2);
931
3727
  }
932
3728
 
933
- export function __wbg_newwithlength_76462a666eca145f(arg0) {
934
- const ret = new Uint8Array(arg0 >>> 0);
935
- return addHeapObject(ret);
3729
+ export function __wbg_setmode_5dc300b865044b65(arg0, arg1) {
3730
+ getObject(arg0).mode = __wbindgen_enum_RequestMode[arg1];
936
3731
  }
937
3732
 
938
- export function __wbindgen_memory() {
939
- const ret = wasm.memory;
940
- return addHeapObject(ret);
3733
+ export function __wbg_setname_c0e2d6f348c746f4(arg0, arg1, arg2) {
3734
+ let deferred0_0;
3735
+ let deferred0_1;
3736
+ try {
3737
+ deferred0_0 = arg1;
3738
+ deferred0_1 = arg2;
3739
+ getObject(arg0).name = getStringFromWasm0(arg1, arg2);
3740
+ } finally {
3741
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
3742
+ }
941
3743
  }
942
3744
 
943
- export function __wbg_buffer_ccaed51a635d8a2d(arg0) {
944
- const ret = getObject(arg0).buffer;
945
- return addHeapObject(ret);
3745
+ export function __wbg_setsignal_75b21ef3a81de905(arg0, arg1) {
3746
+ getObject(arg0).signal = getObject(arg1);
946
3747
  }
947
3748
 
948
- export function __wbg_newwithbyteoffsetandlength_7e3eb787208af730(arg0, arg1, arg2) {
949
- const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
950
- return addHeapObject(ret);
3749
+ export function __wbg_settype_39ed370d3edd403c(arg0, arg1, arg2) {
3750
+ getObject(arg0).type = getStringFromWasm0(arg1, arg2);
951
3751
  }
952
3752
 
953
- export function __wbg_randomFillSync_5c9c955aa56b6049() {
954
- return handleError(function (arg0, arg1) {
955
- getObject(arg0).randomFillSync(takeObject(arg1));
956
- }, arguments);
3753
+ export function __wbg_setvariant_d1d41b778dfe9c17(arg0, arg1, arg2) {
3754
+ let deferred0_0;
3755
+ let deferred0_1;
3756
+ try {
3757
+ deferred0_0 = arg1;
3758
+ deferred0_1 = arg2;
3759
+ getObject(arg0).variant = getStringFromWasm0(arg1, arg2);
3760
+ } finally {
3761
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
3762
+ }
957
3763
  }
958
3764
 
959
- export function __wbg_subarray_975a06f9dbd16995(arg0, arg1, arg2) {
960
- const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
3765
+ export function __wbg_signal_aaf9ad74119f20a4(arg0) {
3766
+ const ret = getObject(arg0).signal;
961
3767
  return addHeapObject(ret);
962
3768
  }
963
3769
 
964
- export function __wbg_getRandomValues_3aa56aa6edec874c() {
965
- return handleError(function (arg0, arg1) {
966
- getObject(arg0).getRandomValues(getObject(arg1));
967
- }, arguments);
3770
+ export function __wbg_stack_0ed75d68575b0f3c(arg0, arg1) {
3771
+ const ret = getObject(arg1).stack;
3772
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3773
+ const len1 = WASM_VECTOR_LEN;
3774
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
3775
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
968
3776
  }
969
3777
 
970
- export function __wbg_new_fec2611eb9180f95(arg0) {
971
- const ret = new Uint8Array(getObject(arg0));
972
- return addHeapObject(ret);
3778
+ export function __wbg_static_accessor_GLOBAL_88a902d13a557d07() {
3779
+ const ret = typeof global === "undefined" ? null : global;
3780
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
973
3781
  }
974
3782
 
975
- export function __wbg_set_ec2fcf81bc573fd9(arg0, arg1, arg2) {
976
- getObject(arg0).set(getObject(arg1), arg2 >>> 0);
3783
+ export function __wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0() {
3784
+ const ret = typeof globalThis === "undefined" ? null : globalThis;
3785
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
977
3786
  }
978
3787
 
979
- export function __wbg_self_bf91bf94d9e04084() {
980
- return handleError(function () {
981
- const ret = self.self;
982
- return addHeapObject(ret);
983
- }, arguments);
3788
+ export function __wbg_static_accessor_SELF_37c5d418e4bf5819() {
3789
+ const ret = typeof self === "undefined" ? null : self;
3790
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
984
3791
  }
985
3792
 
986
- export function __wbg_window_52dd9f07d03fd5f8() {
987
- return handleError(function () {
988
- const ret = window.window;
989
- return addHeapObject(ret);
990
- }, arguments);
3793
+ export function __wbg_static_accessor_WINDOW_5de37043a91a9c40() {
3794
+ const ret = typeof window === "undefined" ? null : window;
3795
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
991
3796
  }
992
3797
 
993
- export function __wbg_globalThis_05c129bf37fcf1be() {
994
- return handleError(function () {
995
- const ret = globalThis.globalThis;
996
- return addHeapObject(ret);
997
- }, arguments);
3798
+ export function __wbg_status_f6360336ca686bf0(arg0) {
3799
+ const ret = getObject(arg0).status;
3800
+ return ret;
998
3801
  }
999
3802
 
1000
- export function __wbg_global_3eca19bb09e9c484() {
1001
- return handleError(function () {
1002
- const ret = global.global;
3803
+ export function __wbg_stringify_f7ed6987935b4a24() {
3804
+ return handleError(function (arg0) {
3805
+ const ret = JSON.stringify(getObject(arg0));
1003
3806
  return addHeapObject(ret);
1004
3807
  }, arguments);
1005
3808
  }
1006
3809
 
1007
- export function __wbg_newnoargs_1ede4bf2ebbaaf43(arg0, arg1) {
1008
- const ret = new Function(getStringFromWasm0(arg0, arg1));
3810
+ export function __wbg_subarray_aa9065fa9dc5df96(arg0, arg1, arg2) {
3811
+ const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
1009
3812
  return addHeapObject(ret);
1010
3813
  }
1011
3814
 
1012
- export function __wbg_call_a9ef466721e824f2() {
1013
- return handleError(function (arg0, arg1) {
1014
- const ret = getObject(arg0).call(getObject(arg1));
3815
+ export function __wbg_text_7805bea50de2af49() {
3816
+ return handleError(function (arg0) {
3817
+ const ret = getObject(arg0).text();
1015
3818
  return addHeapObject(ret);
1016
3819
  }, arguments);
1017
3820
  }
1018
3821
 
1019
- export function __wbg_iterator_695d699a44d6234c() {
1020
- const ret = Symbol.iterator;
3822
+ export function __wbg_then_44b73946d2fb3e7d(arg0, arg1) {
3823
+ const ret = getObject(arg0).then(getObject(arg1));
1021
3824
  return addHeapObject(ret);
1022
3825
  }
1023
3826
 
1024
- export function __wbg_next_13b477da1eaa3897(arg0) {
1025
- const ret = getObject(arg0).next;
3827
+ export function __wbg_then_48b406749878a531(arg0, arg1, arg2) {
3828
+ const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
1026
3829
  return addHeapObject(ret);
1027
3830
  }
1028
3831
 
1029
- export function __wbg_new_034f913e7636e987() {
1030
- const ret = new Array();
1031
- return addHeapObject(ret);
3832
+ export function __wbg_url_ae10c34ca209681d(arg0, arg1) {
3833
+ const ret = getObject(arg1).url;
3834
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3835
+ const len1 = WASM_VECTOR_LEN;
3836
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
3837
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1032
3838
  }
1033
3839
 
1034
- export function __wbg_push_36cf4d81d7da33d1(arg0, arg1) {
1035
- const ret = getObject(arg0).push(getObject(arg1));
1036
- return ret;
3840
+ export function __wbg_value_cd1ffa7b1ab794f1(arg0) {
3841
+ const ret = getObject(arg0).value;
3842
+ return addHeapObject(ret);
1037
3843
  }
1038
3844
 
1039
- export function __wbg_instanceof_ArrayBuffer_74945570b4a62ec7(arg0) {
1040
- let result;
1041
- try {
1042
- result = getObject(arg0) instanceof ArrayBuffer;
1043
- } catch (_) {
1044
- result = false;
1045
- }
1046
- const ret = result;
1047
- return ret;
3845
+ export function __wbg_versions_c01dfd4722a88165(arg0) {
3846
+ const ret = getObject(arg0).versions;
3847
+ return addHeapObject(ret);
1048
3848
  }
1049
3849
 
1050
- export function __wbg_new_70a2f23d1565c04c(arg0, arg1) {
1051
- const ret = new Error(getStringFromWasm0(arg0, arg1));
1052
- return addHeapObject(ret);
3850
+ export function __wbg_warn_aaf1f4664a035bd6(arg0, arg1, arg2, arg3) {
3851
+ console.warn(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
1053
3852
  }
1054
3853
 
1055
- export function __wbg_has_bd717f25f195f23d() {
1056
- return handleError(function (arg0, arg1) {
1057
- const ret = Reflect.has(getObject(arg0), getObject(arg1));
1058
- return ret;
1059
- }, arguments);
3854
+ export function __wbindgen_as_number(arg0) {
3855
+ const ret = +getObject(arg0);
3856
+ return ret;
1060
3857
  }
1061
3858
 
1062
- export function __wbg_resolve_0aad7c1484731c99(arg0) {
1063
- const ret = Promise.resolve(getObject(arg0));
3859
+ export function __wbindgen_bigint_from_i64(arg0) {
3860
+ const ret = arg0;
1064
3861
  return addHeapObject(ret);
1065
3862
  }
1066
3863
 
1067
- export function __wbg_then_748f75edfb032440(arg0, arg1) {
1068
- const ret = getObject(arg0).then(getObject(arg1));
3864
+ export function __wbindgen_bigint_from_u64(arg0) {
3865
+ const ret = BigInt.asUintN(64, arg0);
1069
3866
  return addHeapObject(ret);
1070
3867
  }
1071
3868
 
1072
- export function __wbg_then_4866a7d9f55d8f3e(arg0, arg1, arg2) {
1073
- const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
1074
- return addHeapObject(ret);
3869
+ export function __wbindgen_bigint_get_as_i64(arg0, arg1) {
3870
+ const v = getObject(arg1);
3871
+ const ret = typeof v === "bigint" ? v : undefined;
3872
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
3873
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1075
3874
  }
1076
3875
 
1077
- export function __wbg_length_9254c4bd3b9f23c4(arg0) {
1078
- const ret = getObject(arg0).length;
3876
+ export function __wbindgen_boolean_get(arg0) {
3877
+ const v = getObject(arg0);
3878
+ const ret = typeof v === "boolean" ? (v ? 1 : 0) : 2;
1079
3879
  return ret;
1080
3880
  }
1081
3881
 
1082
- export function __wbg_instanceof_Uint8Array_df0761410414ef36(arg0) {
1083
- let result;
1084
- try {
1085
- result = getObject(arg0) instanceof Uint8Array;
1086
- } catch (_) {
1087
- result = false;
3882
+ export function __wbindgen_cb_drop(arg0) {
3883
+ const obj = takeObject(arg0).original;
3884
+ if (obj.cnt-- == 1) {
3885
+ obj.a = 0;
3886
+ return true;
1088
3887
  }
1089
- const ret = result;
3888
+ const ret = false;
1090
3889
  return ret;
1091
3890
  }
1092
3891
 
1093
- export function __wbg_new_4e7308fbedde3997() {
1094
- return handleError(function () {
1095
- const ret = new FormData();
1096
- return addHeapObject(ret);
1097
- }, arguments);
1098
- }
1099
-
1100
- export function __wbg_append_43a4b1c9d5df4168() {
1101
- return handleError(function (arg0, arg1, arg2, arg3, arg4) {
1102
- getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
1103
- }, arguments);
1104
- }
1105
-
1106
- export function __wbg_settype_623d2ee701e6310a(arg0, arg1, arg2) {
1107
- getObject(arg0).type = getStringFromWasm0(arg1, arg2);
3892
+ export function __wbindgen_closure_wrapper2862(arg0, arg1, arg2) {
3893
+ const ret = makeMutClosure(arg0, arg1, 913, __wbg_adapter_50);
3894
+ return addHeapObject(ret);
1108
3895
  }
1109
3896
 
1110
- export function __wbg_newwithu8arraysequenceandoptions_d41c0fdf78490206() {
1111
- return handleError(function (arg0, arg1) {
1112
- const ret = new Blob(getObject(arg0), getObject(arg1));
1113
- return addHeapObject(ret);
1114
- }, arguments);
3897
+ export function __wbindgen_closure_wrapper3702(arg0, arg1, arg2) {
3898
+ const ret = makeMutClosure(arg0, arg1, 997, __wbg_adapter_53);
3899
+ return addHeapObject(ret);
1115
3900
  }
1116
3901
 
1117
- export function __wbg_append_7ee78799a92a9731() {
1118
- return handleError(function (arg0, arg1, arg2, arg3) {
1119
- getObject(arg0).append(getStringFromWasm0(arg1, arg2), getObject(arg3));
1120
- }, arguments);
3902
+ export function __wbindgen_closure_wrapper4120(arg0, arg1, arg2) {
3903
+ const ret = makeMutClosure(arg0, arg1, 1120, __wbg_adapter_56);
3904
+ return addHeapObject(ret);
1121
3905
  }
1122
3906
 
1123
- export function __wbg_append_8135c71037096394() {
1124
- return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
1125
- getObject(arg0).append(
1126
- getStringFromWasm0(arg1, arg2),
1127
- getObject(arg3),
1128
- getStringFromWasm0(arg4, arg5),
1129
- );
1130
- }, arguments);
3907
+ export function __wbindgen_debug_string(arg0, arg1) {
3908
+ const ret = debugString(getObject(arg1));
3909
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3910
+ const len1 = WASM_VECTOR_LEN;
3911
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
3912
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1131
3913
  }
1132
3914
 
1133
- export function __wbg_fetch_f8d735ba6fe1b719(arg0) {
1134
- const ret = fetch(getObject(arg0));
3915
+ export function __wbindgen_error_new(arg0, arg1) {
3916
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
1135
3917
  return addHeapObject(ret);
1136
3918
  }
1137
3919
 
1138
- export function __wbg_fetch_1fdc4448ed9eec00(arg0, arg1) {
1139
- const ret = getObject(arg0).fetch(getObject(arg1));
1140
- return addHeapObject(ret);
3920
+ export function __wbindgen_in(arg0, arg1) {
3921
+ const ret = getObject(arg0) in getObject(arg1);
3922
+ return ret;
1141
3923
  }
1142
3924
 
1143
- export function __wbg_new_75169ae5a9683c55() {
1144
- return handleError(function () {
1145
- const ret = new AbortController();
1146
- return addHeapObject(ret);
1147
- }, arguments);
3925
+ export function __wbindgen_is_bigint(arg0) {
3926
+ const ret = typeof getObject(arg0) === "bigint";
3927
+ return ret;
1148
3928
  }
1149
3929
 
1150
- export function __wbindgen_boolean_get(arg0) {
1151
- const v = getObject(arg0);
1152
- const ret = typeof v === "boolean" ? (v ? 1 : 0) : 2;
3930
+ export function __wbindgen_is_function(arg0) {
3931
+ const ret = typeof getObject(arg0) === "function";
1153
3932
  return ret;
1154
3933
  }
1155
3934
 
1156
- export function __wbindgen_number_get(arg0, arg1) {
1157
- const obj = getObject(arg1);
1158
- const ret = typeof obj === "number" ? obj : undefined;
1159
- getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
1160
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
3935
+ export function __wbindgen_is_object(arg0) {
3936
+ const val = getObject(arg0);
3937
+ const ret = typeof val === "object" && val !== null;
3938
+ return ret;
1161
3939
  }
1162
3940
 
1163
- export function __wbg_String_b9412f8799faab3e(arg0, arg1) {
1164
- const ret = String(getObject(arg1));
1165
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1166
- const len1 = WASM_VECTOR_LEN;
1167
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1168
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
3941
+ export function __wbindgen_is_string(arg0) {
3942
+ const ret = typeof getObject(arg0) === "string";
3943
+ return ret;
1169
3944
  }
1170
3945
 
1171
- export function __wbindgen_debug_string(arg0, arg1) {
1172
- const ret = debugString(getObject(arg1));
1173
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1174
- const len1 = WASM_VECTOR_LEN;
1175
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1176
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
3946
+ export function __wbindgen_is_undefined(arg0) {
3947
+ const ret = getObject(arg0) === undefined;
3948
+ return ret;
1177
3949
  }
1178
3950
 
1179
- export function __wbindgen_throw(arg0, arg1) {
1180
- throw new Error(getStringFromWasm0(arg0, arg1));
3951
+ export function __wbindgen_jsval_eq(arg0, arg1) {
3952
+ const ret = getObject(arg0) === getObject(arg1);
3953
+ return ret;
1181
3954
  }
1182
3955
 
1183
- export function __wbg_queueMicrotask_848aa4969108a57e(arg0) {
1184
- const ret = getObject(arg0).queueMicrotask;
1185
- return addHeapObject(ret);
3956
+ export function __wbindgen_jsval_loose_eq(arg0, arg1) {
3957
+ const ret = getObject(arg0) == getObject(arg1);
3958
+ return ret;
1186
3959
  }
1187
3960
 
1188
- export function __wbg_queueMicrotask_c5419c06eab41e73(arg0) {
1189
- queueMicrotask(getObject(arg0));
3961
+ export function __wbindgen_memory() {
3962
+ const ret = wasm.memory;
3963
+ return addHeapObject(ret);
1190
3964
  }
1191
3965
 
1192
- export function __wbg_newwithstrandinit_4b92c89af0a8e383() {
1193
- return handleError(function (arg0, arg1, arg2) {
1194
- const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
1195
- return addHeapObject(ret);
1196
- }, arguments);
3966
+ export function __wbindgen_number_get(arg0, arg1) {
3967
+ const obj = getObject(arg1);
3968
+ const ret = typeof obj === "number" ? obj : undefined;
3969
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
3970
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1197
3971
  }
1198
3972
 
1199
- export function __wbg_debug_a0b6c2c5ac9a4bfd(arg0, arg1, arg2, arg3) {
1200
- console.debug(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
3973
+ export function __wbindgen_number_new(arg0) {
3974
+ const ret = arg0;
3975
+ return addHeapObject(ret);
1201
3976
  }
1202
3977
 
1203
- export function __wbg_error_4d17c5bb1ca90c94(arg0, arg1, arg2, arg3) {
1204
- console.error(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
3978
+ export function __wbindgen_object_clone_ref(arg0) {
3979
+ const ret = getObject(arg0);
3980
+ return addHeapObject(ret);
1205
3981
  }
1206
3982
 
1207
- export function __wbg_info_1c7fba7da21072d1(arg0, arg1, arg2, arg3) {
1208
- console.info(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
3983
+ export function __wbindgen_object_drop_ref(arg0) {
3984
+ takeObject(arg0);
1209
3985
  }
1210
3986
 
1211
- export function __wbg_log_4de37a0274d94769(arg0, arg1, arg2, arg3) {
1212
- console.log(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
3987
+ export function __wbindgen_string_get(arg0, arg1) {
3988
+ const obj = getObject(arg1);
3989
+ const ret = typeof obj === "string" ? obj : undefined;
3990
+ var ptr1 = isLikeNone(ret)
3991
+ ? 0
3992
+ : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3993
+ var len1 = WASM_VECTOR_LEN;
3994
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
3995
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1213
3996
  }
1214
3997
 
1215
- export function __wbg_warn_2e2787d40aad9a81(arg0, arg1, arg2, arg3) {
1216
- console.warn(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
3998
+ export function __wbindgen_string_new(arg0, arg1) {
3999
+ const ret = getStringFromWasm0(arg0, arg1);
4000
+ return addHeapObject(ret);
1217
4001
  }
1218
4002
 
1219
- export function __wbindgen_closure_wrapper1820(arg0, arg1, arg2) {
1220
- const ret = makeMutClosure(arg0, arg1, 491, __wbg_adapter_38);
1221
- return addHeapObject(ret);
4003
+ export function __wbindgen_throw(arg0, arg1) {
4004
+ throw new Error(getStringFromWasm0(arg0, arg1));
1222
4005
  }