@rabbitlock/runtime 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,849 @@
1
+ let wasm;
2
+ export function __wbg_set_wasm(val) {
3
+ wasm = val;
4
+ }
5
+
6
+ function addToExternrefTable0(obj) {
7
+ const idx = wasm.__externref_table_alloc();
8
+ wasm.__wbindgen_externrefs.set(idx, obj);
9
+ return idx;
10
+ }
11
+
12
+ function debugString(val) {
13
+ // primitive types
14
+ const type = typeof val;
15
+ if (type == 'number' || type == 'boolean' || val == null) {
16
+ return `${val}`;
17
+ }
18
+ if (type == 'string') {
19
+ return `"${val}"`;
20
+ }
21
+ if (type == 'symbol') {
22
+ const description = val.description;
23
+ if (description == null) {
24
+ return 'Symbol';
25
+ } else {
26
+ return `Symbol(${description})`;
27
+ }
28
+ }
29
+ if (type == 'function') {
30
+ const name = val.name;
31
+ if (typeof name == 'string' && name.length > 0) {
32
+ return `Function(${name})`;
33
+ } else {
34
+ return 'Function';
35
+ }
36
+ }
37
+ // objects
38
+ if (Array.isArray(val)) {
39
+ const length = val.length;
40
+ let debug = '[';
41
+ if (length > 0) {
42
+ debug += debugString(val[0]);
43
+ }
44
+ for(let i = 1; i < length; i++) {
45
+ debug += ', ' + debugString(val[i]);
46
+ }
47
+ debug += ']';
48
+ return debug;
49
+ }
50
+ // Test for built-in
51
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
52
+ let className;
53
+ if (builtInMatches && builtInMatches.length > 1) {
54
+ className = builtInMatches[1];
55
+ } else {
56
+ // Failed to match the standard '[object ClassName]'
57
+ return toString.call(val);
58
+ }
59
+ if (className == 'Object') {
60
+ // we're a user defined class or Object
61
+ // JSON.stringify avoids problems with cycles, and is generally much
62
+ // easier than looping through ownProperties of `val`.
63
+ try {
64
+ return 'Object(' + JSON.stringify(val) + ')';
65
+ } catch (_) {
66
+ return 'Object';
67
+ }
68
+ }
69
+ // errors
70
+ if (val instanceof Error) {
71
+ return `${val.name}: ${val.message}\n${val.stack}`;
72
+ }
73
+ // TODO we could test for more things here, like `Set`s and `Map`s.
74
+ return className;
75
+ }
76
+
77
+ function getArrayU8FromWasm0(ptr, len) {
78
+ ptr = ptr >>> 0;
79
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
80
+ }
81
+
82
+ let cachedDataViewMemory0 = null;
83
+ function getDataViewMemory0() {
84
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
85
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
86
+ }
87
+ return cachedDataViewMemory0;
88
+ }
89
+
90
+ function getStringFromWasm0(ptr, len) {
91
+ ptr = ptr >>> 0;
92
+ return decodeText(ptr, len);
93
+ }
94
+
95
+ let cachedUint8ArrayMemory0 = null;
96
+ function getUint8ArrayMemory0() {
97
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
98
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
99
+ }
100
+ return cachedUint8ArrayMemory0;
101
+ }
102
+
103
+ function handleError(f, args) {
104
+ try {
105
+ return f.apply(this, args);
106
+ } catch (e) {
107
+ const idx = addToExternrefTable0(e);
108
+ wasm.__wbindgen_exn_store(idx);
109
+ }
110
+ }
111
+
112
+ function isLikeNone(x) {
113
+ return x === undefined || x === null;
114
+ }
115
+
116
+ function passArray8ToWasm0(arg, malloc) {
117
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
118
+ getUint8ArrayMemory0().set(arg, ptr / 1);
119
+ WASM_VECTOR_LEN = arg.length;
120
+ return ptr;
121
+ }
122
+
123
+ function passStringToWasm0(arg, malloc, realloc) {
124
+ if (realloc === undefined) {
125
+ const buf = cachedTextEncoder.encode(arg);
126
+ const ptr = malloc(buf.length, 1) >>> 0;
127
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
128
+ WASM_VECTOR_LEN = buf.length;
129
+ return ptr;
130
+ }
131
+
132
+ let len = arg.length;
133
+ let ptr = malloc(len, 1) >>> 0;
134
+
135
+ const mem = getUint8ArrayMemory0();
136
+
137
+ let offset = 0;
138
+
139
+ for (; offset < len; offset++) {
140
+ const code = arg.charCodeAt(offset);
141
+ if (code > 0x7F) break;
142
+ mem[ptr + offset] = code;
143
+ }
144
+ if (offset !== len) {
145
+ if (offset !== 0) {
146
+ arg = arg.slice(offset);
147
+ }
148
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
149
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
150
+ const ret = cachedTextEncoder.encodeInto(arg, view);
151
+
152
+ offset += ret.written;
153
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
154
+ }
155
+
156
+ WASM_VECTOR_LEN = offset;
157
+ return ptr;
158
+ }
159
+
160
+ function takeFromExternrefTable0(idx) {
161
+ const value = wasm.__wbindgen_externrefs.get(idx);
162
+ wasm.__externref_table_dealloc(idx);
163
+ return value;
164
+ }
165
+
166
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
167
+ cachedTextDecoder.decode();
168
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
169
+ let numBytesDecoded = 0;
170
+ function decodeText(ptr, len) {
171
+ numBytesDecoded += len;
172
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
173
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
174
+ cachedTextDecoder.decode();
175
+ numBytesDecoded = len;
176
+ }
177
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
178
+ }
179
+
180
+ const cachedTextEncoder = new TextEncoder();
181
+
182
+ if (!('encodeInto' in cachedTextEncoder)) {
183
+ cachedTextEncoder.encodeInto = function (arg, view) {
184
+ const buf = cachedTextEncoder.encode(arg);
185
+ view.set(buf);
186
+ return {
187
+ read: arg.length,
188
+ written: buf.length
189
+ };
190
+ }
191
+ }
192
+
193
+ let WASM_VECTOR_LEN = 0;
194
+
195
+ /**
196
+ * @returns {boolean}
197
+ */
198
+ export function check_age_installed() {
199
+ const ret = wasm.check_age_installed();
200
+ return ret !== 0;
201
+ }
202
+
203
+ /**
204
+ * @param {any} files_js
205
+ * @returns {Uint8Array}
206
+ */
207
+ export function create_zip_archive(files_js) {
208
+ const ret = wasm.create_zip_archive(files_js);
209
+ if (ret[3]) {
210
+ throw takeFromExternrefTable0(ret[2]);
211
+ }
212
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
213
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
214
+ return v1;
215
+ }
216
+
217
+ /**
218
+ * @param {string} json_input
219
+ * @param {string} private_key
220
+ * @returns {string}
221
+ */
222
+ export function decrypt_and_verify_sops(json_input, private_key) {
223
+ let deferred4_0;
224
+ let deferred4_1;
225
+ try {
226
+ const ptr0 = passStringToWasm0(json_input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
227
+ const len0 = WASM_VECTOR_LEN;
228
+ const ptr1 = passStringToWasm0(private_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
229
+ const len1 = WASM_VECTOR_LEN;
230
+ const ret = wasm.decrypt_and_verify_sops(ptr0, len0, ptr1, len1);
231
+ var ptr3 = ret[0];
232
+ var len3 = ret[1];
233
+ if (ret[3]) {
234
+ ptr3 = 0; len3 = 0;
235
+ throw takeFromExternrefTable0(ret[2]);
236
+ }
237
+ deferred4_0 = ptr3;
238
+ deferred4_1 = len3;
239
+ return getStringFromWasm0(ptr3, len3);
240
+ } finally {
241
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
242
+ }
243
+ }
244
+
245
+ /**
246
+ * @param {Uint8Array} data
247
+ * @param {string} identity_str
248
+ * @returns {Uint8Array}
249
+ */
250
+ export function decrypt_binary_age(data, identity_str) {
251
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
252
+ const len0 = WASM_VECTOR_LEN;
253
+ const ptr1 = passStringToWasm0(identity_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
254
+ const len1 = WASM_VECTOR_LEN;
255
+ const ret = wasm.decrypt_binary_age(ptr0, len0, ptr1, len1);
256
+ if (ret[3]) {
257
+ throw takeFromExternrefTable0(ret[2]);
258
+ }
259
+ var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
260
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
261
+ return v3;
262
+ }
263
+
264
+ /**
265
+ * @param {string} json_input
266
+ * @param {string} private_key
267
+ * @returns {string}
268
+ */
269
+ export function decrypt_data_key(json_input, private_key) {
270
+ let deferred4_0;
271
+ let deferred4_1;
272
+ try {
273
+ const ptr0 = passStringToWasm0(json_input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
274
+ const len0 = WASM_VECTOR_LEN;
275
+ const ptr1 = passStringToWasm0(private_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
276
+ const len1 = WASM_VECTOR_LEN;
277
+ const ret = wasm.decrypt_data_key(ptr0, len0, ptr1, len1);
278
+ var ptr3 = ret[0];
279
+ var len3 = ret[1];
280
+ if (ret[3]) {
281
+ ptr3 = 0; len3 = 0;
282
+ throw takeFromExternrefTable0(ret[2]);
283
+ }
284
+ deferred4_0 = ptr3;
285
+ deferred4_1 = len3;
286
+ return getStringFromWasm0(ptr3, len3);
287
+ } finally {
288
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
289
+ }
290
+ }
291
+
292
+ /**
293
+ * Decrypt and return the full decrypted SOPS file as JSON string
294
+ * Returns: JSON string with decrypted values (sops metadata still encrypted)
295
+ * @param {string} json_input
296
+ * @param {string} private_key
297
+ * @returns {string}
298
+ */
299
+ export function decrypt_sops_content(json_input, private_key) {
300
+ let deferred4_0;
301
+ let deferred4_1;
302
+ try {
303
+ const ptr0 = passStringToWasm0(json_input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
304
+ const len0 = WASM_VECTOR_LEN;
305
+ const ptr1 = passStringToWasm0(private_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
306
+ const len1 = WASM_VECTOR_LEN;
307
+ const ret = wasm.decrypt_sops_content(ptr0, len0, ptr1, len1);
308
+ var ptr3 = ret[0];
309
+ var len3 = ret[1];
310
+ if (ret[3]) {
311
+ ptr3 = 0; len3 = 0;
312
+ throw takeFromExternrefTable0(ret[2]);
313
+ }
314
+ deferred4_0 = ptr3;
315
+ deferred4_1 = len3;
316
+ return getStringFromWasm0(ptr3, len3);
317
+ } finally {
318
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
319
+ }
320
+ }
321
+
322
+ /**
323
+ * @param {string} seed_hex
324
+ * @returns {string}
325
+ */
326
+ export function derive_age_keys(seed_hex) {
327
+ let deferred3_0;
328
+ let deferred3_1;
329
+ try {
330
+ const ptr0 = passStringToWasm0(seed_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
331
+ const len0 = WASM_VECTOR_LEN;
332
+ const ret = wasm.derive_age_keys(ptr0, len0);
333
+ var ptr2 = ret[0];
334
+ var len2 = ret[1];
335
+ if (ret[3]) {
336
+ ptr2 = 0; len2 = 0;
337
+ throw takeFromExternrefTable0(ret[2]);
338
+ }
339
+ deferred3_0 = ptr2;
340
+ deferred3_1 = len2;
341
+ return getStringFromWasm0(ptr2, len2);
342
+ } finally {
343
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
344
+ }
345
+ }
346
+
347
+ /**
348
+ * @param {Uint8Array} data
349
+ * @param {string} recipient_pubkey
350
+ * @returns {Uint8Array}
351
+ */
352
+ export function encrypt_binary_age(data, recipient_pubkey) {
353
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
354
+ const len0 = WASM_VECTOR_LEN;
355
+ const ptr1 = passStringToWasm0(recipient_pubkey, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
356
+ const len1 = WASM_VECTOR_LEN;
357
+ const ret = wasm.encrypt_binary_age(ptr0, len0, ptr1, len1);
358
+ if (ret[3]) {
359
+ throw takeFromExternrefTable0(ret[2]);
360
+ }
361
+ var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
362
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
363
+ return v3;
364
+ }
365
+
366
+ /**
367
+ * @param {string} plain_json
368
+ * @param {string} data_key_hex
369
+ * @returns {string}
370
+ */
371
+ export function encrypt_sops_json(plain_json, data_key_hex) {
372
+ let deferred4_0;
373
+ let deferred4_1;
374
+ try {
375
+ const ptr0 = passStringToWasm0(plain_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
376
+ const len0 = WASM_VECTOR_LEN;
377
+ const ptr1 = passStringToWasm0(data_key_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
378
+ const len1 = WASM_VECTOR_LEN;
379
+ const ret = wasm.encrypt_sops_json(ptr0, len0, ptr1, len1);
380
+ var ptr3 = ret[0];
381
+ var len3 = ret[1];
382
+ if (ret[3]) {
383
+ ptr3 = 0; len3 = 0;
384
+ throw takeFromExternrefTable0(ret[2]);
385
+ }
386
+ deferred4_0 = ptr3;
387
+ deferred4_1 = len3;
388
+ return getStringFromWasm0(ptr3, len3);
389
+ } finally {
390
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
391
+ }
392
+ }
393
+
394
+ /**
395
+ * @param {string} name
396
+ * @returns {string}
397
+ */
398
+ export function greet(name) {
399
+ let deferred2_0;
400
+ let deferred2_1;
401
+ try {
402
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
403
+ const len0 = WASM_VECTOR_LEN;
404
+ const ret = wasm.greet(ptr0, len0);
405
+ deferred2_0 = ret[0];
406
+ deferred2_1 = ret[1];
407
+ return getStringFromWasm0(ret[0], ret[1]);
408
+ } finally {
409
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
410
+ }
411
+ }
412
+
413
+ /**
414
+ * @param {string} json_input
415
+ * @returns {string}
416
+ */
417
+ export function parse_and_verify_sops(json_input) {
418
+ let deferred2_0;
419
+ let deferred2_1;
420
+ try {
421
+ const ptr0 = passStringToWasm0(json_input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
422
+ const len0 = WASM_VECTOR_LEN;
423
+ const ret = wasm.parse_and_verify_sops(ptr0, len0);
424
+ deferred2_0 = ret[0];
425
+ deferred2_1 = ret[1];
426
+ return getStringFromWasm0(ret[0], ret[1]);
427
+ } finally {
428
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
429
+ }
430
+ }
431
+
432
+ /**
433
+ * Decapsulate a shared secret using your private key
434
+ * secret_key_hex: 2432 bytes as hex
435
+ * ciphertext_hex: 1120 bytes as hex
436
+ * Returns: shared_secret_hex (64 hex chars = 32 bytes)
437
+ * @param {string} secret_key_hex
438
+ * @param {string} ciphertext_hex
439
+ * @returns {string}
440
+ */
441
+ export function pq_decapsulate(secret_key_hex, ciphertext_hex) {
442
+ let deferred4_0;
443
+ let deferred4_1;
444
+ try {
445
+ const ptr0 = passStringToWasm0(secret_key_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
446
+ const len0 = WASM_VECTOR_LEN;
447
+ const ptr1 = passStringToWasm0(ciphertext_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
448
+ const len1 = WASM_VECTOR_LEN;
449
+ const ret = wasm.pq_decapsulate(ptr0, len0, ptr1, len1);
450
+ var ptr3 = ret[0];
451
+ var len3 = ret[1];
452
+ if (ret[3]) {
453
+ ptr3 = 0; len3 = 0;
454
+ throw takeFromExternrefTable0(ret[2]);
455
+ }
456
+ deferred4_0 = ptr3;
457
+ deferred4_1 = len3;
458
+ return getStringFromWasm0(ptr3, len3);
459
+ } finally {
460
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
461
+ }
462
+ }
463
+
464
+ /**
465
+ * Encapsulate a shared secret for a recipient's hybrid public key
466
+ * pub_key_hex: 1216 bytes (32 X25519 + 1184 ML-KEM) as hex
467
+ * Returns: "shared_secret_hex:ciphertext_hex"
468
+ * @param {string} pub_key_hex
469
+ * @returns {string}
470
+ */
471
+ export function pq_encapsulate(pub_key_hex) {
472
+ let deferred3_0;
473
+ let deferred3_1;
474
+ try {
475
+ const ptr0 = passStringToWasm0(pub_key_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
476
+ const len0 = WASM_VECTOR_LEN;
477
+ const ret = wasm.pq_encapsulate(ptr0, len0);
478
+ var ptr2 = ret[0];
479
+ var len2 = ret[1];
480
+ if (ret[3]) {
481
+ ptr2 = 0; len2 = 0;
482
+ throw takeFromExternrefTable0(ret[2]);
483
+ }
484
+ deferred3_0 = ptr2;
485
+ deferred3_1 = len2;
486
+ return getStringFromWasm0(ptr2, len2);
487
+ } finally {
488
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
489
+ }
490
+ }
491
+
492
+ /**
493
+ * Generate a new hybrid keypair (X25519 + ML-KEM-768)
494
+ * Returns: "secret_key_hex:public_key_hex"
495
+ * @returns {string}
496
+ */
497
+ export function pq_generate_keypair() {
498
+ let deferred1_0;
499
+ let deferred1_1;
500
+ try {
501
+ const ret = wasm.pq_generate_keypair();
502
+ deferred1_0 = ret[0];
503
+ deferred1_1 = ret[1];
504
+ return getStringFromWasm0(ret[0], ret[1]);
505
+ } finally {
506
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
507
+ }
508
+ }
509
+
510
+ /**
511
+ * Get the size constants for documentation
512
+ * Get the size constants for documentation
513
+ * @returns {string}
514
+ */
515
+ export function pq_get_sizes() {
516
+ let deferred1_0;
517
+ let deferred1_1;
518
+ try {
519
+ const ret = wasm.pq_get_sizes();
520
+ deferred1_0 = ret[0];
521
+ deferred1_1 = ret[1];
522
+ return getStringFromWasm0(ret[0], ret[1]);
523
+ } finally {
524
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
525
+ }
526
+ }
527
+
528
+ /**
529
+ * @param {string} identity
530
+ * @param {string} encrypted_pem
531
+ * @returns {string}
532
+ */
533
+ export function try_decrypt_age_key(identity, encrypted_pem) {
534
+ let deferred3_0;
535
+ let deferred3_1;
536
+ try {
537
+ const ptr0 = passStringToWasm0(identity, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
538
+ const len0 = WASM_VECTOR_LEN;
539
+ const ptr1 = passStringToWasm0(encrypted_pem, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
540
+ const len1 = WASM_VECTOR_LEN;
541
+ const ret = wasm.try_decrypt_age_key(ptr0, len0, ptr1, len1);
542
+ deferred3_0 = ret[0];
543
+ deferred3_1 = ret[1];
544
+ return getStringFromWasm0(ret[0], ret[1]);
545
+ } finally {
546
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
547
+ }
548
+ }
549
+
550
+ /**
551
+ * @param {string} json_input
552
+ * @param {string} data_key_hex
553
+ * @returns {string}
554
+ */
555
+ export function verify_sops_integrity(json_input, data_key_hex) {
556
+ let deferred3_0;
557
+ let deferred3_1;
558
+ try {
559
+ const ptr0 = passStringToWasm0(json_input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
560
+ const len0 = WASM_VECTOR_LEN;
561
+ const ptr1 = passStringToWasm0(data_key_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
562
+ const len1 = WASM_VECTOR_LEN;
563
+ const ret = wasm.verify_sops_integrity(ptr0, len0, ptr1, len1);
564
+ deferred3_0 = ret[0];
565
+ deferred3_1 = ret[1];
566
+ return getStringFromWasm0(ret[0], ret[1]);
567
+ } finally {
568
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
569
+ }
570
+ }
571
+
572
+ export function __wbg_Error_52673b7de5a0ca89(arg0, arg1) {
573
+ const ret = Error(getStringFromWasm0(arg0, arg1));
574
+ return ret;
575
+ };
576
+
577
+ export function __wbg_Number_2d1dcfcf4ec51736(arg0) {
578
+ const ret = Number(arg0);
579
+ return ret;
580
+ };
581
+
582
+ export function __wbg_String_8f0eb39a4a4c2f66(arg0, arg1) {
583
+ const ret = String(arg1);
584
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
585
+ const len1 = WASM_VECTOR_LEN;
586
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
587
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
588
+ };
589
+
590
+ export function __wbg___wbindgen_boolean_get_dea25b33882b895b(arg0) {
591
+ const v = arg0;
592
+ const ret = typeof(v) === 'boolean' ? v : undefined;
593
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
594
+ };
595
+
596
+ export function __wbg___wbindgen_debug_string_adfb662ae34724b6(arg0, arg1) {
597
+ const ret = debugString(arg1);
598
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
599
+ const len1 = WASM_VECTOR_LEN;
600
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
601
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
602
+ };
603
+
604
+ export function __wbg___wbindgen_in_0d3e1e8f0c669317(arg0, arg1) {
605
+ const ret = arg0 in arg1;
606
+ return ret;
607
+ };
608
+
609
+ export function __wbg___wbindgen_is_function_8d400b8b1af978cd(arg0) {
610
+ const ret = typeof(arg0) === 'function';
611
+ return ret;
612
+ };
613
+
614
+ export function __wbg___wbindgen_is_object_ce774f3490692386(arg0) {
615
+ const val = arg0;
616
+ const ret = typeof(val) === 'object' && val !== null;
617
+ return ret;
618
+ };
619
+
620
+ export function __wbg___wbindgen_is_string_704ef9c8fc131030(arg0) {
621
+ const ret = typeof(arg0) === 'string';
622
+ return ret;
623
+ };
624
+
625
+ export function __wbg___wbindgen_is_undefined_f6b95eab589e0269(arg0) {
626
+ const ret = arg0 === undefined;
627
+ return ret;
628
+ };
629
+
630
+ export function __wbg___wbindgen_jsval_loose_eq_766057600fdd1b0d(arg0, arg1) {
631
+ const ret = arg0 == arg1;
632
+ return ret;
633
+ };
634
+
635
+ export function __wbg___wbindgen_number_get_9619185a74197f95(arg0, arg1) {
636
+ const obj = arg1;
637
+ const ret = typeof(obj) === 'number' ? obj : undefined;
638
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
639
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
640
+ };
641
+
642
+ export function __wbg___wbindgen_string_get_a2a31e16edf96e42(arg0, arg1) {
643
+ const obj = arg1;
644
+ const ret = typeof(obj) === 'string' ? obj : undefined;
645
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
646
+ var len1 = WASM_VECTOR_LEN;
647
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
648
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
649
+ };
650
+
651
+ export function __wbg___wbindgen_throw_dd24417ed36fc46e(arg0, arg1) {
652
+ throw new Error(getStringFromWasm0(arg0, arg1));
653
+ };
654
+
655
+ export function __wbg_call_3020136f7a2d6e44() { return handleError(function (arg0, arg1, arg2) {
656
+ const ret = arg0.call(arg1, arg2);
657
+ return ret;
658
+ }, arguments) };
659
+
660
+ export function __wbg_call_abb4ff46ce38be40() { return handleError(function (arg0, arg1) {
661
+ const ret = arg0.call(arg1);
662
+ return ret;
663
+ }, arguments) };
664
+
665
+ export function __wbg_crypto_574e78ad8b13b65f(arg0) {
666
+ const ret = arg0.crypto;
667
+ return ret;
668
+ };
669
+
670
+ export function __wbg_done_62ea16af4ce34b24(arg0) {
671
+ const ret = arg0.done;
672
+ return ret;
673
+ };
674
+
675
+ export function __wbg_getRandomValues_b8f5dbd5f3995a9e() { return handleError(function (arg0, arg1) {
676
+ arg0.getRandomValues(arg1);
677
+ }, arguments) };
678
+
679
+ export function __wbg_get_6b7bd52aca3f9671(arg0, arg1) {
680
+ const ret = arg0[arg1 >>> 0];
681
+ return ret;
682
+ };
683
+
684
+ export function __wbg_get_af9dab7e9603ea93() { return handleError(function (arg0, arg1) {
685
+ const ret = Reflect.get(arg0, arg1);
686
+ return ret;
687
+ }, arguments) };
688
+
689
+ export function __wbg_get_with_ref_key_1dc361bd10053bfe(arg0, arg1) {
690
+ const ret = arg0[arg1];
691
+ return ret;
692
+ };
693
+
694
+ export function __wbg_instanceof_ArrayBuffer_f3320d2419cd0355(arg0) {
695
+ let result;
696
+ try {
697
+ result = arg0 instanceof ArrayBuffer;
698
+ } catch (_) {
699
+ result = false;
700
+ }
701
+ const ret = result;
702
+ return ret;
703
+ };
704
+
705
+ export function __wbg_instanceof_Uint8Array_da54ccc9d3e09434(arg0) {
706
+ let result;
707
+ try {
708
+ result = arg0 instanceof Uint8Array;
709
+ } catch (_) {
710
+ result = false;
711
+ }
712
+ const ret = result;
713
+ return ret;
714
+ };
715
+
716
+ export function __wbg_isArray_51fd9e6422c0a395(arg0) {
717
+ const ret = Array.isArray(arg0);
718
+ return ret;
719
+ };
720
+
721
+ export function __wbg_isSafeInteger_ae7d3f054d55fa16(arg0) {
722
+ const ret = Number.isSafeInteger(arg0);
723
+ return ret;
724
+ };
725
+
726
+ export function __wbg_iterator_27b7c8b35ab3e86b() {
727
+ const ret = Symbol.iterator;
728
+ return ret;
729
+ };
730
+
731
+ export function __wbg_length_22ac23eaec9d8053(arg0) {
732
+ const ret = arg0.length;
733
+ return ret;
734
+ };
735
+
736
+ export function __wbg_length_d45040a40c570362(arg0) {
737
+ const ret = arg0.length;
738
+ return ret;
739
+ };
740
+
741
+ export function __wbg_msCrypto_a61aeb35a24c1329(arg0) {
742
+ const ret = arg0.msCrypto;
743
+ return ret;
744
+ };
745
+
746
+ export function __wbg_new_6421f6084cc5bc5a(arg0) {
747
+ const ret = new Uint8Array(arg0);
748
+ return ret;
749
+ };
750
+
751
+ export function __wbg_new_no_args_cb138f77cf6151ee(arg0, arg1) {
752
+ const ret = new Function(getStringFromWasm0(arg0, arg1));
753
+ return ret;
754
+ };
755
+
756
+ export function __wbg_new_with_length_aa5eaf41d35235e5(arg0) {
757
+ const ret = new Uint8Array(arg0 >>> 0);
758
+ return ret;
759
+ };
760
+
761
+ export function __wbg_next_138a17bbf04e926c(arg0) {
762
+ const ret = arg0.next;
763
+ return ret;
764
+ };
765
+
766
+ export function __wbg_next_3cfe5c0fe2a4cc53() { return handleError(function (arg0) {
767
+ const ret = arg0.next();
768
+ return ret;
769
+ }, arguments) };
770
+
771
+ export function __wbg_node_905d3e251edff8a2(arg0) {
772
+ const ret = arg0.node;
773
+ return ret;
774
+ };
775
+
776
+ export function __wbg_process_dc0fbacc7c1c06f7(arg0) {
777
+ const ret = arg0.process;
778
+ return ret;
779
+ };
780
+
781
+ export function __wbg_prototypesetcall_dfe9b766cdc1f1fd(arg0, arg1, arg2) {
782
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
783
+ };
784
+
785
+ export function __wbg_randomFillSync_ac0988aba3254290() { return handleError(function (arg0, arg1) {
786
+ arg0.randomFillSync(arg1);
787
+ }, arguments) };
788
+
789
+ export function __wbg_require_60cc747a6bc5215a() { return handleError(function () {
790
+ const ret = module.require;
791
+ return ret;
792
+ }, arguments) };
793
+
794
+ export function __wbg_static_accessor_GLOBAL_769e6b65d6557335() {
795
+ const ret = typeof global === 'undefined' ? null : global;
796
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
797
+ };
798
+
799
+ export function __wbg_static_accessor_GLOBAL_THIS_60cf02db4de8e1c1() {
800
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
801
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
802
+ };
803
+
804
+ export function __wbg_static_accessor_SELF_08f5a74c69739274() {
805
+ const ret = typeof self === 'undefined' ? null : self;
806
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
807
+ };
808
+
809
+ export function __wbg_static_accessor_WINDOW_a8924b26aa92d024() {
810
+ const ret = typeof window === 'undefined' ? null : window;
811
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
812
+ };
813
+
814
+ export function __wbg_subarray_845f2f5bce7d061a(arg0, arg1, arg2) {
815
+ const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
816
+ return ret;
817
+ };
818
+
819
+ export function __wbg_value_57b7b035e117f7ee(arg0) {
820
+ const ret = arg0.value;
821
+ return ret;
822
+ };
823
+
824
+ export function __wbg_versions_c01dfd4722a88165(arg0) {
825
+ const ret = arg0.versions;
826
+ return ret;
827
+ };
828
+
829
+ export function __wbindgen_cast_2241b6af4c4b2941(arg0, arg1) {
830
+ // Cast intrinsic for `Ref(String) -> Externref`.
831
+ const ret = getStringFromWasm0(arg0, arg1);
832
+ return ret;
833
+ };
834
+
835
+ export function __wbindgen_cast_cb9088102bce6b30(arg0, arg1) {
836
+ // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
837
+ const ret = getArrayU8FromWasm0(arg0, arg1);
838
+ return ret;
839
+ };
840
+
841
+ export function __wbindgen_init_externref_table() {
842
+ const table = wasm.__wbindgen_externrefs;
843
+ const offset = table.grow(4);
844
+ table.set(0, undefined);
845
+ table.set(offset + 0, undefined);
846
+ table.set(offset + 1, null);
847
+ table.set(offset + 2, true);
848
+ table.set(offset + 3, false);
849
+ };