@synonymdev/locks-sdk 0.1.0-rc5

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,2094 @@
1
+ /* @ts-self-types="./locks_sdk_wasm.d.ts" */
2
+
3
+ export class BundleId {
4
+ static __wrap(ptr) {
5
+ const obj = Object.create(BundleId.prototype);
6
+ obj.__wbg_ptr = ptr;
7
+ BundleIdFinalization.register(obj, obj.__wbg_ptr, obj);
8
+ return obj;
9
+ }
10
+ __destroy_into_raw() {
11
+ const ptr = this.__wbg_ptr;
12
+ this.__wbg_ptr = 0;
13
+ BundleIdFinalization.unregister(this);
14
+ return ptr;
15
+ }
16
+ free() {
17
+ const ptr = this.__destroy_into_raw();
18
+ wasm.__wbg_bundleid_free(ptr, 0);
19
+ }
20
+ /**
21
+ * @returns {BundleId}
22
+ */
23
+ static generate() {
24
+ const ret = wasm.bundleid_generate();
25
+ return BundleId.__wrap(ret);
26
+ }
27
+ /**
28
+ * @param {string} value
29
+ */
30
+ constructor(value) {
31
+ const ptr0 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
32
+ const len0 = WASM_VECTOR_LEN;
33
+ const ret = wasm.bundleid_new(ptr0, len0);
34
+ if (ret[2]) {
35
+ throw takeFromExternrefTable0(ret[1]);
36
+ }
37
+ this.__wbg_ptr = ret[0];
38
+ BundleIdFinalization.register(this, this.__wbg_ptr, this);
39
+ return this;
40
+ }
41
+ /**
42
+ * @returns {string}
43
+ */
44
+ toString() {
45
+ let deferred1_0;
46
+ let deferred1_1;
47
+ try {
48
+ const ret = wasm.bundleid_toString(this.__wbg_ptr);
49
+ deferred1_0 = ret[0];
50
+ deferred1_1 = ret[1];
51
+ return getStringFromWasm0(ret[0], ret[1]);
52
+ } finally {
53
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
54
+ }
55
+ }
56
+ }
57
+ if (Symbol.dispose) BundleId.prototype[Symbol.dispose] = BundleId.prototype.free;
58
+
59
+ export class ConnectCallback {
60
+ static __wrap(ptr) {
61
+ const obj = Object.create(ConnectCallback.prototype);
62
+ obj.__wbg_ptr = ptr;
63
+ ConnectCallbackFinalization.register(obj, obj.__wbg_ptr, obj);
64
+ return obj;
65
+ }
66
+ __destroy_into_raw() {
67
+ const ptr = this.__wbg_ptr;
68
+ this.__wbg_ptr = 0;
69
+ ConnectCallbackFinalization.unregister(this);
70
+ return ptr;
71
+ }
72
+ free() {
73
+ const ptr = this.__destroy_into_raw();
74
+ wasm.__wbg_connectcallback_free(ptr, 0);
75
+ }
76
+ /**
77
+ * @returns {string}
78
+ */
79
+ get code() {
80
+ let deferred1_0;
81
+ let deferred1_1;
82
+ try {
83
+ const ret = wasm.connectcallback_code(this.__wbg_ptr);
84
+ deferred1_0 = ret[0];
85
+ deferred1_1 = ret[1];
86
+ return getStringFromWasm0(ret[0], ret[1]);
87
+ } finally {
88
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
89
+ }
90
+ }
91
+ /**
92
+ * @returns {string}
93
+ */
94
+ get state() {
95
+ let deferred1_0;
96
+ let deferred1_1;
97
+ try {
98
+ const ret = wasm.connectcallback_state(this.__wbg_ptr);
99
+ deferred1_0 = ret[0];
100
+ deferred1_1 = ret[1];
101
+ return getStringFromWasm0(ret[0], ret[1]);
102
+ } finally {
103
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
104
+ }
105
+ }
106
+ }
107
+ if (Symbol.dispose) ConnectCallback.prototype[Symbol.dispose] = ConnectCallback.prototype.free;
108
+
109
+ export class ConnectUrlOptions {
110
+ __destroy_into_raw() {
111
+ const ptr = this.__wbg_ptr;
112
+ this.__wbg_ptr = 0;
113
+ ConnectUrlOptionsFinalization.unregister(this);
114
+ return ptr;
115
+ }
116
+ free() {
117
+ const ptr = this.__destroy_into_raw();
118
+ wasm.__wbg_connecturloptions_free(ptr, 0);
119
+ }
120
+ /**
121
+ * @param {string} return_to
122
+ * @param {string} state
123
+ */
124
+ constructor(return_to, state) {
125
+ const ptr0 = passStringToWasm0(return_to, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
126
+ const len0 = WASM_VECTOR_LEN;
127
+ const ptr1 = passStringToWasm0(state, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
128
+ const len1 = WASM_VECTOR_LEN;
129
+ const ret = wasm.connecturloptions_new(ptr0, len0, ptr1, len1);
130
+ this.__wbg_ptr = ret;
131
+ ConnectUrlOptionsFinalization.register(this, this.__wbg_ptr, this);
132
+ return this;
133
+ }
134
+ /**
135
+ * @returns {string}
136
+ */
137
+ get returnTo() {
138
+ let deferred1_0;
139
+ let deferred1_1;
140
+ try {
141
+ const ret = wasm.connecturloptions_returnTo(this.__wbg_ptr);
142
+ deferred1_0 = ret[0];
143
+ deferred1_1 = ret[1];
144
+ return getStringFromWasm0(ret[0], ret[1]);
145
+ } finally {
146
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
147
+ }
148
+ }
149
+ /**
150
+ * @returns {string}
151
+ */
152
+ get state() {
153
+ let deferred1_0;
154
+ let deferred1_1;
155
+ try {
156
+ const ret = wasm.connecturloptions_state(this.__wbg_ptr);
157
+ deferred1_0 = ret[0];
158
+ deferred1_1 = ret[1];
159
+ return getStringFromWasm0(ret[0], ret[1]);
160
+ } finally {
161
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
162
+ }
163
+ }
164
+ }
165
+ if (Symbol.dispose) ConnectUrlOptions.prototype[Symbol.dispose] = ConnectUrlOptions.prototype.free;
166
+
167
+ export class CreateContentLockRequestBuilder {
168
+ static __wrap(ptr) {
169
+ const obj = Object.create(CreateContentLockRequestBuilder.prototype);
170
+ obj.__wbg_ptr = ptr;
171
+ CreateContentLockRequestBuilderFinalization.register(obj, obj.__wbg_ptr, obj);
172
+ return obj;
173
+ }
174
+ __destroy_into_raw() {
175
+ const ptr = this.__wbg_ptr;
176
+ this.__wbg_ptr = 0;
177
+ CreateContentLockRequestBuilderFinalization.unregister(this);
178
+ return ptr;
179
+ }
180
+ free() {
181
+ const ptr = this.__destroy_into_raw();
182
+ wasm.__wbg_createcontentlockrequestbuilder_free(ptr, 0);
183
+ }
184
+ /**
185
+ * @param {any} access_policy
186
+ * @returns {CreateContentLockRequestBuilder}
187
+ */
188
+ accessPolicy(access_policy) {
189
+ const ret = wasm.createcontentlockrequestbuilder_accessPolicy(this.__wbg_ptr, access_policy);
190
+ if (ret[2]) {
191
+ throw takeFromExternrefTable0(ret[1]);
192
+ }
193
+ return CreateContentLockRequestBuilder.__wrap(ret[0]);
194
+ }
195
+ /**
196
+ * @returns {any}
197
+ */
198
+ build() {
199
+ const ret = wasm.createcontentlockrequestbuilder_build(this.__wbg_ptr);
200
+ if (ret[2]) {
201
+ throw takeFromExternrefTable0(ret[1]);
202
+ }
203
+ return takeFromExternrefTable0(ret[0]);
204
+ }
205
+ /**
206
+ * @param {any} criteria
207
+ * @returns {CreateContentLockRequestBuilder}
208
+ */
209
+ criteria(criteria) {
210
+ const ret = wasm.createcontentlockrequestbuilder_criteria(this.__wbg_ptr, criteria);
211
+ if (ret[2]) {
212
+ throw takeFromExternrefTable0(ret[1]);
213
+ }
214
+ return CreateContentLockRequestBuilder.__wrap(ret[0]);
215
+ }
216
+ /**
217
+ * @param {any} lock_logic
218
+ * @returns {CreateContentLockRequestBuilder}
219
+ */
220
+ lockLogic(lock_logic) {
221
+ const ret = wasm.createcontentlockrequestbuilder_lockLogic(this.__wbg_ptr, lock_logic);
222
+ if (ret[2]) {
223
+ throw takeFromExternrefTable0(ret[1]);
224
+ }
225
+ return CreateContentLockRequestBuilder.__wrap(ret[0]);
226
+ }
227
+ /**
228
+ * @param {any} lock_server
229
+ * @returns {CreateContentLockRequestBuilder}
230
+ */
231
+ lockServer(lock_server) {
232
+ const ret = wasm.createcontentlockrequestbuilder_lockServer(this.__wbg_ptr, lock_server);
233
+ if (ret[2]) {
234
+ throw takeFromExternrefTable0(ret[1]);
235
+ }
236
+ return CreateContentLockRequestBuilder.__wrap(ret[0]);
237
+ }
238
+ constructor() {
239
+ const ret = wasm.createcontentlockrequestbuilder_new();
240
+ this.__wbg_ptr = ret;
241
+ CreateContentLockRequestBuilderFinalization.register(this, this.__wbg_ptr, this);
242
+ return this;
243
+ }
244
+ /**
245
+ * @param {any} resource
246
+ * @returns {CreateContentLockRequestBuilder}
247
+ */
248
+ primaryResource(resource) {
249
+ const ret = wasm.createcontentlockrequestbuilder_primaryResource(this.__wbg_ptr, resource);
250
+ if (ret[2]) {
251
+ throw takeFromExternrefTable0(ret[1]);
252
+ }
253
+ return CreateContentLockRequestBuilder.__wrap(ret[0]);
254
+ }
255
+ /**
256
+ * @param {any} resource
257
+ * @returns {CreateContentLockRequestBuilder}
258
+ */
259
+ secondaryResource(resource) {
260
+ const ret = wasm.createcontentlockrequestbuilder_secondaryResource(this.__wbg_ptr, resource);
261
+ if (ret[2]) {
262
+ throw takeFromExternrefTable0(ret[1]);
263
+ }
264
+ return CreateContentLockRequestBuilder.__wrap(ret[0]);
265
+ }
266
+ /**
267
+ * @param {any} resources
268
+ * @returns {CreateContentLockRequestBuilder}
269
+ */
270
+ secondaryResources(resources) {
271
+ const ret = wasm.createcontentlockrequestbuilder_secondaryResources(this.__wbg_ptr, resources);
272
+ if (ret[2]) {
273
+ throw takeFromExternrefTable0(ret[1]);
274
+ }
275
+ return CreateContentLockRequestBuilder.__wrap(ret[0]);
276
+ }
277
+ }
278
+ if (Symbol.dispose) CreateContentLockRequestBuilder.prototype[Symbol.dispose] = CreateContentLockRequestBuilder.prototype.free;
279
+
280
+ export class Creator {
281
+ static __wrap(ptr) {
282
+ const obj = Object.create(Creator.prototype);
283
+ obj.__wbg_ptr = ptr;
284
+ CreatorFinalization.register(obj, obj.__wbg_ptr, obj);
285
+ return obj;
286
+ }
287
+ __destroy_into_raw() {
288
+ const ptr = this.__wbg_ptr;
289
+ this.__wbg_ptr = 0;
290
+ CreatorFinalization.unregister(this);
291
+ return ptr;
292
+ }
293
+ free() {
294
+ const ptr = this.__destroy_into_raw();
295
+ wasm.__wbg_creator_free(ptr, 0);
296
+ }
297
+ /**
298
+ * @param {any} body
299
+ * @returns {Promise<any>}
300
+ */
301
+ createContentLock(body) {
302
+ const ret = wasm.creator_createContentLock(this.__wbg_ptr, body);
303
+ return ret;
304
+ }
305
+ /**
306
+ * @param {DeleteGuardedResourceOptions} options
307
+ * @returns {Promise<void>}
308
+ */
309
+ deleteGuardedResource(options) {
310
+ _assertClass(options, DeleteGuardedResourceOptions);
311
+ const ret = wasm.creator_deleteGuardedResource(this.__wbg_ptr, options.__wbg_ptr);
312
+ return ret;
313
+ }
314
+ /**
315
+ * @returns {string}
316
+ */
317
+ exportSessionSecretForTests() {
318
+ let deferred1_0;
319
+ let deferred1_1;
320
+ try {
321
+ const ret = wasm.creator_exportSessionSecretForTests(this.__wbg_ptr);
322
+ deferred1_0 = ret[0];
323
+ deferred1_1 = ret[1];
324
+ return getStringFromWasm0(ret[0], ret[1]);
325
+ } finally {
326
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
327
+ }
328
+ }
329
+ /**
330
+ * @returns {Promise<any>}
331
+ */
332
+ paykitSetupStatus() {
333
+ const ret = wasm.creator_paykitSetupStatus(this.__wbg_ptr);
334
+ return ret;
335
+ }
336
+ /**
337
+ * @param {RegisterGuardedResourceOptions} options
338
+ * @returns {Promise<any>}
339
+ */
340
+ registerGuardedResource(options) {
341
+ _assertClass(options, RegisterGuardedResourceOptions);
342
+ const ret = wasm.creator_registerGuardedResource(this.__wbg_ptr, options.__wbg_ptr);
343
+ return ret;
344
+ }
345
+ /**
346
+ * @param {SetLockServicePointerOptions} options
347
+ * @returns {Promise<void>}
348
+ */
349
+ setLockServicePointer(options) {
350
+ _assertClass(options, SetLockServicePointerOptions);
351
+ const ret = wasm.creator_setLockServicePointer(this.__wbg_ptr, options.__wbg_ptr);
352
+ return ret;
353
+ }
354
+ }
355
+ if (Symbol.dispose) Creator.prototype[Symbol.dispose] = Creator.prototype.free;
356
+
357
+ export class DeleteGuardedResourceOptions {
358
+ __destroy_into_raw() {
359
+ const ptr = this.__wbg_ptr;
360
+ this.__wbg_ptr = 0;
361
+ DeleteGuardedResourceOptionsFinalization.unregister(this);
362
+ return ptr;
363
+ }
364
+ free() {
365
+ const ptr = this.__destroy_into_raw();
366
+ wasm.__wbg_deleteguardedresourceoptions_free(ptr, 0);
367
+ }
368
+ /**
369
+ * @param {string} path
370
+ */
371
+ constructor(path) {
372
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
373
+ const len0 = WASM_VECTOR_LEN;
374
+ const ret = wasm.deleteguardedresourceoptions_new(ptr0, len0);
375
+ this.__wbg_ptr = ret;
376
+ DeleteGuardedResourceOptionsFinalization.register(this, this.__wbg_ptr, this);
377
+ return this;
378
+ }
379
+ /**
380
+ * @returns {string}
381
+ */
382
+ get path() {
383
+ let deferred1_0;
384
+ let deferred1_1;
385
+ try {
386
+ const ret = wasm.deleteguardedresourceoptions_path(this.__wbg_ptr);
387
+ deferred1_0 = ret[0];
388
+ deferred1_1 = ret[1];
389
+ return getStringFromWasm0(ret[0], ret[1]);
390
+ } finally {
391
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
392
+ }
393
+ }
394
+ }
395
+ if (Symbol.dispose) DeleteGuardedResourceOptions.prototype[Symbol.dispose] = DeleteGuardedResourceOptions.prototype.free;
396
+
397
+ export class ExchangeFrontendSessionCodeOptions {
398
+ __destroy_into_raw() {
399
+ const ptr = this.__wbg_ptr;
400
+ this.__wbg_ptr = 0;
401
+ ExchangeFrontendSessionCodeOptionsFinalization.unregister(this);
402
+ return ptr;
403
+ }
404
+ free() {
405
+ const ptr = this.__destroy_into_raw();
406
+ wasm.__wbg_exchangefrontendsessioncodeoptions_free(ptr, 0);
407
+ }
408
+ /**
409
+ * @returns {string}
410
+ */
411
+ get code() {
412
+ let deferred1_0;
413
+ let deferred1_1;
414
+ try {
415
+ const ret = wasm.exchangefrontendsessioncodeoptions_code(this.__wbg_ptr);
416
+ deferred1_0 = ret[0];
417
+ deferred1_1 = ret[1];
418
+ return getStringFromWasm0(ret[0], ret[1]);
419
+ } finally {
420
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
421
+ }
422
+ }
423
+ /**
424
+ * @param {string} code
425
+ * @param {string} state
426
+ */
427
+ constructor(code, state) {
428
+ const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
429
+ const len0 = WASM_VECTOR_LEN;
430
+ const ptr1 = passStringToWasm0(state, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
431
+ const len1 = WASM_VECTOR_LEN;
432
+ const ret = wasm.exchangefrontendsessioncodeoptions_new(ptr0, len0, ptr1, len1);
433
+ this.__wbg_ptr = ret;
434
+ ExchangeFrontendSessionCodeOptionsFinalization.register(this, this.__wbg_ptr, this);
435
+ return this;
436
+ }
437
+ /**
438
+ * @returns {string}
439
+ */
440
+ get state() {
441
+ let deferred1_0;
442
+ let deferred1_1;
443
+ try {
444
+ const ret = wasm.exchangefrontendsessioncodeoptions_state(this.__wbg_ptr);
445
+ deferred1_0 = ret[0];
446
+ deferred1_1 = ret[1];
447
+ return getStringFromWasm0(ret[0], ret[1]);
448
+ } finally {
449
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
450
+ }
451
+ }
452
+ }
453
+ if (Symbol.dispose) ExchangeFrontendSessionCodeOptions.prototype[Symbol.dispose] = ExchangeFrontendSessionCodeOptions.prototype.free;
454
+
455
+ export class IntoUnderlyingByteSource {
456
+ __destroy_into_raw() {
457
+ const ptr = this.__wbg_ptr;
458
+ this.__wbg_ptr = 0;
459
+ IntoUnderlyingByteSourceFinalization.unregister(this);
460
+ return ptr;
461
+ }
462
+ free() {
463
+ const ptr = this.__destroy_into_raw();
464
+ wasm.__wbg_intounderlyingbytesource_free(ptr, 0);
465
+ }
466
+ /**
467
+ * @returns {number}
468
+ */
469
+ get autoAllocateChunkSize() {
470
+ const ret = wasm.intounderlyingbytesource_autoAllocateChunkSize(this.__wbg_ptr);
471
+ return ret >>> 0;
472
+ }
473
+ cancel() {
474
+ const ptr = this.__destroy_into_raw();
475
+ wasm.intounderlyingbytesource_cancel(ptr);
476
+ }
477
+ /**
478
+ * @param {ReadableByteStreamController} controller
479
+ * @returns {Promise<any>}
480
+ */
481
+ pull(controller) {
482
+ const ret = wasm.intounderlyingbytesource_pull(this.__wbg_ptr, controller);
483
+ return ret;
484
+ }
485
+ /**
486
+ * @param {ReadableByteStreamController} controller
487
+ */
488
+ start(controller) {
489
+ wasm.intounderlyingbytesource_start(this.__wbg_ptr, controller);
490
+ }
491
+ /**
492
+ * @returns {ReadableStreamType}
493
+ */
494
+ get type() {
495
+ const ret = wasm.intounderlyingbytesource_type(this.__wbg_ptr);
496
+ return __wbindgen_enum_ReadableStreamType[ret];
497
+ }
498
+ }
499
+ if (Symbol.dispose) IntoUnderlyingByteSource.prototype[Symbol.dispose] = IntoUnderlyingByteSource.prototype.free;
500
+
501
+ export class IntoUnderlyingSink {
502
+ __destroy_into_raw() {
503
+ const ptr = this.__wbg_ptr;
504
+ this.__wbg_ptr = 0;
505
+ IntoUnderlyingSinkFinalization.unregister(this);
506
+ return ptr;
507
+ }
508
+ free() {
509
+ const ptr = this.__destroy_into_raw();
510
+ wasm.__wbg_intounderlyingsink_free(ptr, 0);
511
+ }
512
+ /**
513
+ * @param {any} reason
514
+ * @returns {Promise<any>}
515
+ */
516
+ abort(reason) {
517
+ const ptr = this.__destroy_into_raw();
518
+ const ret = wasm.intounderlyingsink_abort(ptr, reason);
519
+ return ret;
520
+ }
521
+ /**
522
+ * @returns {Promise<any>}
523
+ */
524
+ close() {
525
+ const ptr = this.__destroy_into_raw();
526
+ const ret = wasm.intounderlyingsink_close(ptr);
527
+ return ret;
528
+ }
529
+ /**
530
+ * @param {any} chunk
531
+ * @returns {Promise<any>}
532
+ */
533
+ write(chunk) {
534
+ const ret = wasm.intounderlyingsink_write(this.__wbg_ptr, chunk);
535
+ return ret;
536
+ }
537
+ }
538
+ if (Symbol.dispose) IntoUnderlyingSink.prototype[Symbol.dispose] = IntoUnderlyingSink.prototype.free;
539
+
540
+ export class IntoUnderlyingSource {
541
+ __destroy_into_raw() {
542
+ const ptr = this.__wbg_ptr;
543
+ this.__wbg_ptr = 0;
544
+ IntoUnderlyingSourceFinalization.unregister(this);
545
+ return ptr;
546
+ }
547
+ free() {
548
+ const ptr = this.__destroy_into_raw();
549
+ wasm.__wbg_intounderlyingsource_free(ptr, 0);
550
+ }
551
+ cancel() {
552
+ const ptr = this.__destroy_into_raw();
553
+ wasm.intounderlyingsource_cancel(ptr);
554
+ }
555
+ /**
556
+ * @param {ReadableStreamDefaultController} controller
557
+ * @returns {Promise<any>}
558
+ */
559
+ pull(controller) {
560
+ const ret = wasm.intounderlyingsource_pull(this.__wbg_ptr, controller);
561
+ return ret;
562
+ }
563
+ }
564
+ if (Symbol.dispose) IntoUnderlyingSource.prototype[Symbol.dispose] = IntoUnderlyingSource.prototype.free;
565
+
566
+ export class Locks {
567
+ static __wrap(ptr) {
568
+ const obj = Object.create(Locks.prototype);
569
+ obj.__wbg_ptr = ptr;
570
+ LocksFinalization.register(obj, obj.__wbg_ptr, obj);
571
+ return obj;
572
+ }
573
+ __destroy_into_raw() {
574
+ const ptr = this.__wbg_ptr;
575
+ this.__wbg_ptr = 0;
576
+ LocksFinalization.unregister(this);
577
+ return ptr;
578
+ }
579
+ free() {
580
+ const ptr = this.__destroy_into_raw();
581
+ wasm.__wbg_locks_free(ptr, 0);
582
+ }
583
+ /**
584
+ * @param {ConnectUrlOptions} options
585
+ * @returns {Promise<string>}
586
+ */
587
+ createConnectUrl(options) {
588
+ _assertClass(options, ConnectUrlOptions);
589
+ const ret = wasm.locks_createConnectUrl(this.__wbg_ptr, options.__wbg_ptr);
590
+ return ret;
591
+ }
592
+ /**
593
+ * @param {ExchangeFrontendSessionCodeOptions} options
594
+ * @returns {Promise<Session>}
595
+ */
596
+ exchangeFrontendSessionCode(options) {
597
+ _assertClass(options, ExchangeFrontendSessionCodeOptions);
598
+ const ret = wasm.locks_exchangeFrontendSessionCode(this.__wbg_ptr, options.__wbg_ptr);
599
+ return ret;
600
+ }
601
+ /**
602
+ * @param {string} resource
603
+ * @returns {Promise<Locks>}
604
+ */
605
+ static forContentLock(resource) {
606
+ const ptr0 = passStringToWasm0(resource, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
607
+ const len0 = WASM_VECTOR_LEN;
608
+ const ret = wasm.locks_forContentLock(ptr0, len0);
609
+ return ret;
610
+ }
611
+ /**
612
+ * @param {string} resource
613
+ * @param {LocksOptions} options
614
+ * @returns {Promise<Locks>}
615
+ */
616
+ static forContentLockWithOptions(resource, options) {
617
+ const ptr0 = passStringToWasm0(resource, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
618
+ const len0 = WASM_VECTOR_LEN;
619
+ _assertClass(options, LocksOptions);
620
+ const ret = wasm.locks_forContentLockWithOptions(ptr0, len0, options.__wbg_ptr);
621
+ return ret;
622
+ }
623
+ /**
624
+ * @param {string} creator
625
+ * @returns {Promise<Locks>}
626
+ */
627
+ static forCreator(creator) {
628
+ const ptr0 = passStringToWasm0(creator, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
629
+ const len0 = WASM_VECTOR_LEN;
630
+ const ret = wasm.locks_forCreator(ptr0, len0);
631
+ return ret;
632
+ }
633
+ /**
634
+ * @param {string} creator
635
+ * @param {LocksOptions} options
636
+ * @returns {Promise<Locks>}
637
+ */
638
+ static forCreatorWithOptions(creator, options) {
639
+ const ptr0 = passStringToWasm0(creator, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
640
+ const len0 = WASM_VECTOR_LEN;
641
+ _assertClass(options, LocksOptions);
642
+ const ret = wasm.locks_forCreatorWithOptions(ptr0, len0, options.__wbg_ptr);
643
+ return ret;
644
+ }
645
+ /**
646
+ * @param {string} lock_server
647
+ * @returns {Locks}
648
+ */
649
+ static forServer(lock_server) {
650
+ const ptr0 = passStringToWasm0(lock_server, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
651
+ const len0 = WASM_VECTOR_LEN;
652
+ const ret = wasm.locks_forServer(ptr0, len0);
653
+ if (ret[2]) {
654
+ throw takeFromExternrefTable0(ret[1]);
655
+ }
656
+ return Locks.__wrap(ret[0]);
657
+ }
658
+ /**
659
+ * @param {string} lock_server
660
+ * @param {LocksOptions} options
661
+ * @returns {Locks}
662
+ */
663
+ static forServerWithOptions(lock_server, options) {
664
+ const ptr0 = passStringToWasm0(lock_server, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
665
+ const len0 = WASM_VECTOR_LEN;
666
+ _assertClass(options, LocksOptions);
667
+ const ret = wasm.locks_forServerWithOptions(ptr0, len0, options.__wbg_ptr);
668
+ if (ret[2]) {
669
+ throw takeFromExternrefTable0(ret[1]);
670
+ }
671
+ return Locks.__wrap(ret[0]);
672
+ }
673
+ /**
674
+ * @param {any} pointer
675
+ * @returns {Locks}
676
+ */
677
+ static fromCreatorLockServicePointer(pointer) {
678
+ const ret = wasm.locks_fromCreatorLockServicePointer(pointer);
679
+ if (ret[2]) {
680
+ throw takeFromExternrefTable0(ret[1]);
681
+ }
682
+ return Locks.__wrap(ret[0]);
683
+ }
684
+ /**
685
+ * @param {string} user
686
+ * @returns {Promise<boolean>}
687
+ */
688
+ static hasPaykitData(user) {
689
+ const ptr0 = passStringToWasm0(user, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
690
+ const len0 = WASM_VECTOR_LEN;
691
+ const ret = wasm.locks_hasPaykitData(ptr0, len0);
692
+ return ret;
693
+ }
694
+ /**
695
+ * @param {string} user
696
+ * @param {LocksOptions} options
697
+ * @returns {Promise<boolean>}
698
+ */
699
+ static hasPaykitDataWithOptions(user, options) {
700
+ const ptr0 = passStringToWasm0(user, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
701
+ const len0 = WASM_VECTOR_LEN;
702
+ _assertClass(options, LocksOptions);
703
+ const ret = wasm.locks_hasPaykitDataWithOptions(ptr0, len0, options.__wbg_ptr);
704
+ return ret;
705
+ }
706
+ /**
707
+ * @returns {string}
708
+ */
709
+ lockServer() {
710
+ let deferred1_0;
711
+ let deferred1_1;
712
+ try {
713
+ const ret = wasm.locks_lockServer(this.__wbg_ptr);
714
+ deferred1_0 = ret[0];
715
+ deferred1_1 = ret[1];
716
+ return getStringFromWasm0(ret[0], ret[1]);
717
+ } finally {
718
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
719
+ }
720
+ }
721
+ /**
722
+ * @param {string} callback_url
723
+ * @returns {ConnectCallback}
724
+ */
725
+ static parseConnectCallback(callback_url) {
726
+ const ptr0 = passStringToWasm0(callback_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
727
+ const len0 = WASM_VECTOR_LEN;
728
+ const ret = wasm.locks_parseConnectCallback(ptr0, len0);
729
+ if (ret[2]) {
730
+ throw takeFromExternrefTable0(ret[1]);
731
+ }
732
+ return ConnectCallback.__wrap(ret[0]);
733
+ }
734
+ /**
735
+ * @param {string} resource
736
+ * @returns {Promise<any>}
737
+ */
738
+ static readContentLock(resource) {
739
+ const ptr0 = passStringToWasm0(resource, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
740
+ const len0 = WASM_VECTOR_LEN;
741
+ const ret = wasm.locks_readContentLock(ptr0, len0);
742
+ return ret;
743
+ }
744
+ /**
745
+ * @param {string} resource
746
+ * @param {LocksOptions} options
747
+ * @returns {Promise<any>}
748
+ */
749
+ static readContentLockWithOptions(resource, options) {
750
+ const ptr0 = passStringToWasm0(resource, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
751
+ const len0 = WASM_VECTOR_LEN;
752
+ _assertClass(options, LocksOptions);
753
+ const ret = wasm.locks_readContentLockWithOptions(ptr0, len0, options.__wbg_ptr);
754
+ return ret;
755
+ }
756
+ /**
757
+ * @param {string} secret
758
+ * @returns {Session}
759
+ */
760
+ restoreSession(secret) {
761
+ const ptr0 = passStringToWasm0(secret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
762
+ const len0 = WASM_VECTOR_LEN;
763
+ const ret = wasm.locks_restoreSession(this.__wbg_ptr, ptr0, len0);
764
+ return Session.__wrap(ret);
765
+ }
766
+ /**
767
+ * @returns {Viewer}
768
+ */
769
+ get viewer() {
770
+ const ret = wasm.locks_viewer(this.__wbg_ptr);
771
+ return Viewer.__wrap(ret);
772
+ }
773
+ }
774
+ if (Symbol.dispose) Locks.prototype[Symbol.dispose] = Locks.prototype.free;
775
+
776
+ export class LocksOptions {
777
+ static __wrap(ptr) {
778
+ const obj = Object.create(LocksOptions.prototype);
779
+ obj.__wbg_ptr = ptr;
780
+ LocksOptionsFinalization.register(obj, obj.__wbg_ptr, obj);
781
+ return obj;
782
+ }
783
+ __destroy_into_raw() {
784
+ const ptr = this.__wbg_ptr;
785
+ this.__wbg_ptr = 0;
786
+ LocksOptionsFinalization.unregister(this);
787
+ return ptr;
788
+ }
789
+ free() {
790
+ const ptr = this.__destroy_into_raw();
791
+ wasm.__wbg_locksoptions_free(ptr, 0);
792
+ }
793
+ /**
794
+ * @param {string} relay_url
795
+ * @returns {LocksOptions}
796
+ */
797
+ addPkarrRelay(relay_url) {
798
+ const ptr0 = passStringToWasm0(relay_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
799
+ const len0 = WASM_VECTOR_LEN;
800
+ const ret = wasm.locksoptions_addPkarrRelay(this.__wbg_ptr, ptr0, len0);
801
+ if (ret[2]) {
802
+ throw takeFromExternrefTable0(ret[1]);
803
+ }
804
+ return LocksOptions.__wrap(ret[0]);
805
+ }
806
+ constructor() {
807
+ const ret = wasm.locksoptions_new();
808
+ this.__wbg_ptr = ret;
809
+ LocksOptionsFinalization.register(this, this.__wbg_ptr, this);
810
+ return this;
811
+ }
812
+ /**
813
+ * @returns {string[]}
814
+ */
815
+ get pkarrRelays() {
816
+ const ret = wasm.locksoptions_pkarrRelays(this.__wbg_ptr);
817
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
818
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
819
+ return v1;
820
+ }
821
+ }
822
+ if (Symbol.dispose) LocksOptions.prototype[Symbol.dispose] = LocksOptions.prototype.free;
823
+
824
+ export class RegisterGuardedResourceOptions {
825
+ __destroy_into_raw() {
826
+ const ptr = this.__wbg_ptr;
827
+ this.__wbg_ptr = 0;
828
+ RegisterGuardedResourceOptionsFinalization.unregister(this);
829
+ return ptr;
830
+ }
831
+ free() {
832
+ const ptr = this.__destroy_into_raw();
833
+ wasm.__wbg_registerguardedresourceoptions_free(ptr, 0);
834
+ }
835
+ /**
836
+ * @returns {Uint8Array}
837
+ */
838
+ get bytes() {
839
+ const ret = wasm.registerguardedresourceoptions_bytes(this.__wbg_ptr);
840
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
841
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
842
+ return v1;
843
+ }
844
+ /**
845
+ * @returns {string}
846
+ */
847
+ get contentType() {
848
+ let deferred1_0;
849
+ let deferred1_1;
850
+ try {
851
+ const ret = wasm.registerguardedresourceoptions_contentType(this.__wbg_ptr);
852
+ deferred1_0 = ret[0];
853
+ deferred1_1 = ret[1];
854
+ return getStringFromWasm0(ret[0], ret[1]);
855
+ } finally {
856
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
857
+ }
858
+ }
859
+ /**
860
+ * @param {string} path
861
+ * @param {string} content_type
862
+ * @param {Uint8Array} bytes
863
+ */
864
+ constructor(path, content_type, bytes) {
865
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
866
+ const len0 = WASM_VECTOR_LEN;
867
+ const ptr1 = passStringToWasm0(content_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
868
+ const len1 = WASM_VECTOR_LEN;
869
+ const ptr2 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
870
+ const len2 = WASM_VECTOR_LEN;
871
+ const ret = wasm.registerguardedresourceoptions_new(ptr0, len0, ptr1, len1, ptr2, len2);
872
+ this.__wbg_ptr = ret;
873
+ RegisterGuardedResourceOptionsFinalization.register(this, this.__wbg_ptr, this);
874
+ return this;
875
+ }
876
+ /**
877
+ * @returns {string}
878
+ */
879
+ get path() {
880
+ let deferred1_0;
881
+ let deferred1_1;
882
+ try {
883
+ const ret = wasm.registerguardedresourceoptions_path(this.__wbg_ptr);
884
+ deferred1_0 = ret[0];
885
+ deferred1_1 = ret[1];
886
+ return getStringFromWasm0(ret[0], ret[1]);
887
+ } finally {
888
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
889
+ }
890
+ }
891
+ }
892
+ if (Symbol.dispose) RegisterGuardedResourceOptions.prototype[Symbol.dispose] = RegisterGuardedResourceOptions.prototype.free;
893
+
894
+ export class Session {
895
+ static __wrap(ptr) {
896
+ const obj = Object.create(Session.prototype);
897
+ obj.__wbg_ptr = ptr;
898
+ SessionFinalization.register(obj, obj.__wbg_ptr, obj);
899
+ return obj;
900
+ }
901
+ __destroy_into_raw() {
902
+ const ptr = this.__wbg_ptr;
903
+ this.__wbg_ptr = 0;
904
+ SessionFinalization.unregister(this);
905
+ return ptr;
906
+ }
907
+ free() {
908
+ const ptr = this.__destroy_into_raw();
909
+ wasm.__wbg_session_free(ptr, 0);
910
+ }
911
+ /**
912
+ * @returns {Creator}
913
+ */
914
+ get creator() {
915
+ const ret = wasm.session_creator(this.__wbg_ptr);
916
+ return Creator.__wrap(ret);
917
+ }
918
+ /**
919
+ * @returns {string | undefined}
920
+ */
921
+ creatorPubky() {
922
+ const ret = wasm.session_creatorPubky(this.__wbg_ptr);
923
+ let v1;
924
+ if (ret[0] !== 0) {
925
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
926
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
927
+ }
928
+ return v1;
929
+ }
930
+ /**
931
+ * @returns {string}
932
+ */
933
+ exportSecret() {
934
+ let deferred1_0;
935
+ let deferred1_1;
936
+ try {
937
+ const ret = wasm.session_exportSecret(this.__wbg_ptr);
938
+ deferred1_0 = ret[0];
939
+ deferred1_1 = ret[1];
940
+ return getStringFromWasm0(ret[0], ret[1]);
941
+ } finally {
942
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
943
+ }
944
+ }
945
+ /**
946
+ * @returns {string}
947
+ */
948
+ lockServer() {
949
+ let deferred1_0;
950
+ let deferred1_1;
951
+ try {
952
+ const ret = wasm.session_lockServer(this.__wbg_ptr);
953
+ deferred1_0 = ret[0];
954
+ deferred1_1 = ret[1];
955
+ return getStringFromWasm0(ret[0], ret[1]);
956
+ } finally {
957
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
958
+ }
959
+ }
960
+ /**
961
+ * @returns {Promise<void>}
962
+ */
963
+ signout() {
964
+ const ret = wasm.session_signout(this.__wbg_ptr);
965
+ return ret;
966
+ }
967
+ }
968
+ if (Symbol.dispose) Session.prototype[Symbol.dispose] = Session.prototype.free;
969
+
970
+ export class SetLockServicePointerOptions {
971
+ __destroy_into_raw() {
972
+ const ptr = this.__wbg_ptr;
973
+ this.__wbg_ptr = 0;
974
+ SetLockServicePointerOptionsFinalization.unregister(this);
975
+ return ptr;
976
+ }
977
+ free() {
978
+ const ptr = this.__destroy_into_raw();
979
+ wasm.__wbg_setlockservicepointeroptions_free(ptr, 0);
980
+ }
981
+ /**
982
+ * @returns {string}
983
+ */
984
+ get defaultLockServer() {
985
+ let deferred1_0;
986
+ let deferred1_1;
987
+ try {
988
+ const ret = wasm.setlockservicepointeroptions_defaultLockServer(this.__wbg_ptr);
989
+ deferred1_0 = ret[0];
990
+ deferred1_1 = ret[1];
991
+ return getStringFromWasm0(ret[0], ret[1]);
992
+ } finally {
993
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
994
+ }
995
+ }
996
+ /**
997
+ * @param {string} default_lock_server
998
+ */
999
+ constructor(default_lock_server) {
1000
+ const ptr0 = passStringToWasm0(default_lock_server, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1001
+ const len0 = WASM_VECTOR_LEN;
1002
+ const ret = wasm.setlockservicepointeroptions_new(ptr0, len0);
1003
+ this.__wbg_ptr = ret;
1004
+ SetLockServicePointerOptionsFinalization.register(this, this.__wbg_ptr, this);
1005
+ return this;
1006
+ }
1007
+ }
1008
+ if (Symbol.dispose) SetLockServicePointerOptions.prototype[Symbol.dispose] = SetLockServicePointerOptions.prototype.free;
1009
+
1010
+ export class VerificationTaskHandleOptions {
1011
+ __destroy_into_raw() {
1012
+ const ptr = this.__wbg_ptr;
1013
+ this.__wbg_ptr = 0;
1014
+ VerificationTaskHandleOptionsFinalization.unregister(this);
1015
+ return ptr;
1016
+ }
1017
+ free() {
1018
+ const ptr = this.__destroy_into_raw();
1019
+ wasm.__wbg_verificationtaskhandleoptions_free(ptr, 0);
1020
+ }
1021
+ /**
1022
+ * @returns {string}
1023
+ */
1024
+ get bundleId() {
1025
+ let deferred1_0;
1026
+ let deferred1_1;
1027
+ try {
1028
+ const ret = wasm.verificationtaskhandleoptions_bundleId(this.__wbg_ptr);
1029
+ deferred1_0 = ret[0];
1030
+ deferred1_1 = ret[1];
1031
+ return getStringFromWasm0(ret[0], ret[1]);
1032
+ } finally {
1033
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1034
+ }
1035
+ }
1036
+ /**
1037
+ * @returns {string}
1038
+ */
1039
+ get creator() {
1040
+ let deferred1_0;
1041
+ let deferred1_1;
1042
+ try {
1043
+ const ret = wasm.verificationtaskhandleoptions_creator(this.__wbg_ptr);
1044
+ deferred1_0 = ret[0];
1045
+ deferred1_1 = ret[1];
1046
+ return getStringFromWasm0(ret[0], ret[1]);
1047
+ } finally {
1048
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1049
+ }
1050
+ }
1051
+ /**
1052
+ * @param {string} creator
1053
+ * @param {string} bundle_id
1054
+ */
1055
+ constructor(creator, bundle_id) {
1056
+ const ptr0 = passStringToWasm0(creator, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1057
+ const len0 = WASM_VECTOR_LEN;
1058
+ const ptr1 = passStringToWasm0(bundle_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1059
+ const len1 = WASM_VECTOR_LEN;
1060
+ const ret = wasm.verificationtaskhandleoptions_new(ptr0, len0, ptr1, len1);
1061
+ if (ret[2]) {
1062
+ throw takeFromExternrefTable0(ret[1]);
1063
+ }
1064
+ this.__wbg_ptr = ret[0];
1065
+ VerificationTaskHandleOptionsFinalization.register(this, this.__wbg_ptr, this);
1066
+ return this;
1067
+ }
1068
+ }
1069
+ if (Symbol.dispose) VerificationTaskHandleOptions.prototype[Symbol.dispose] = VerificationTaskHandleOptions.prototype.free;
1070
+
1071
+ export class Viewer {
1072
+ static __wrap(ptr) {
1073
+ const obj = Object.create(Viewer.prototype);
1074
+ obj.__wbg_ptr = ptr;
1075
+ ViewerFinalization.register(obj, obj.__wbg_ptr, obj);
1076
+ return obj;
1077
+ }
1078
+ __destroy_into_raw() {
1079
+ const ptr = this.__wbg_ptr;
1080
+ this.__wbg_ptr = 0;
1081
+ ViewerFinalization.unregister(this);
1082
+ return ptr;
1083
+ }
1084
+ free() {
1085
+ const ptr = this.__destroy_into_raw();
1086
+ wasm.__wbg_viewer_free(ptr, 0);
1087
+ }
1088
+ /**
1089
+ * @param {VerificationTaskHandleOptions} options
1090
+ * @returns {Promise<any>}
1091
+ */
1092
+ completeVerificationTask(options) {
1093
+ _assertClass(options, VerificationTaskHandleOptions);
1094
+ const ret = wasm.viewer_completeVerificationTask(this.__wbg_ptr, options.__wbg_ptr);
1095
+ return ret;
1096
+ }
1097
+ /**
1098
+ * @param {VerificationTaskHandleOptions} options
1099
+ * @returns {Promise<any>}
1100
+ */
1101
+ issueAccessCredential(options) {
1102
+ _assertClass(options, VerificationTaskHandleOptions);
1103
+ const ret = wasm.viewer_issueAccessCredential(this.__wbg_ptr, options.__wbg_ptr);
1104
+ return ret;
1105
+ }
1106
+ /**
1107
+ * @param {VerificationTaskHandleOptions} options
1108
+ * @returns {Promise<any>}
1109
+ */
1110
+ lookupPaykitConnectionState(options) {
1111
+ _assertClass(options, VerificationTaskHandleOptions);
1112
+ const ret = wasm.viewer_lookupPaykitConnectionState(this.__wbg_ptr, options.__wbg_ptr);
1113
+ return ret;
1114
+ }
1115
+ /**
1116
+ * @param {VerificationTaskHandleOptions} options
1117
+ * @returns {Promise<any>}
1118
+ */
1119
+ lookupVerificationTask(options) {
1120
+ _assertClass(options, VerificationTaskHandleOptions);
1121
+ const ret = wasm.viewer_lookupVerificationTask(this.__wbg_ptr, options.__wbg_ptr);
1122
+ return ret;
1123
+ }
1124
+ /**
1125
+ * @param {string} access_credential
1126
+ * @param {string} path
1127
+ * @returns {Promise<Uint8Array>}
1128
+ */
1129
+ proxyReadGuardedResource(access_credential, path) {
1130
+ const ptr0 = passStringToWasm0(access_credential, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1131
+ const len0 = WASM_VECTOR_LEN;
1132
+ const ptr1 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1133
+ const len1 = WASM_VECTOR_LEN;
1134
+ const ret = wasm.viewer_proxyReadGuardedResource(this.__wbg_ptr, ptr0, len0, ptr1, len1);
1135
+ return ret;
1136
+ }
1137
+ /**
1138
+ * @param {string} access_credential
1139
+ * @param {string} path
1140
+ * @returns {Promise<Response>}
1141
+ */
1142
+ proxyReadGuardedResourceResponse(access_credential, path) {
1143
+ const ptr0 = passStringToWasm0(access_credential, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1144
+ const len0 = WASM_VECTOR_LEN;
1145
+ const ptr1 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1146
+ const len1 = WASM_VECTOR_LEN;
1147
+ const ret = wasm.viewer_proxyReadGuardedResourceResponse(this.__wbg_ptr, ptr0, len0, ptr1, len1);
1148
+ return ret;
1149
+ }
1150
+ /**
1151
+ * @param {any} submitted_proof_bundle
1152
+ * @returns {Promise<any>}
1153
+ */
1154
+ submitProofBundle(submitted_proof_bundle) {
1155
+ const ret = wasm.viewer_submitProofBundle(this.__wbg_ptr, submitted_proof_bundle);
1156
+ return ret;
1157
+ }
1158
+ }
1159
+ if (Symbol.dispose) Viewer.prototype[Symbol.dispose] = Viewer.prototype.free;
1160
+ function __wbg_get_imports() {
1161
+ const import0 = {
1162
+ __proto__: null,
1163
+ __wbg_Error_92b29b0548f8b746: function(arg0, arg1) {
1164
+ const ret = Error(getStringFromWasm0(arg0, arg1));
1165
+ return ret;
1166
+ },
1167
+ __wbg_String_8564e559799eccda: function(arg0, arg1) {
1168
+ const ret = String(arg1);
1169
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1170
+ const len1 = WASM_VECTOR_LEN;
1171
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1172
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1173
+ },
1174
+ __wbg___wbindgen_bigint_get_as_i64_d968e41184ae354f: function(arg0, arg1) {
1175
+ const v = arg1;
1176
+ const ret = typeof(v) === 'bigint' ? v : undefined;
1177
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
1178
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1179
+ },
1180
+ __wbg___wbindgen_boolean_get_fa956cfa2d1bd751: function(arg0) {
1181
+ const v = arg0;
1182
+ const ret = typeof(v) === 'boolean' ? v : undefined;
1183
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
1184
+ },
1185
+ __wbg___wbindgen_debug_string_c25d447a39f5578f: function(arg0, arg1) {
1186
+ const ret = debugString(arg1);
1187
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1188
+ const len1 = WASM_VECTOR_LEN;
1189
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1190
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1191
+ },
1192
+ __wbg___wbindgen_in_aca499c5de7ff5e5: function(arg0, arg1) {
1193
+ const ret = arg0 in arg1;
1194
+ return ret;
1195
+ },
1196
+ __wbg___wbindgen_is_bigint_2f76dc55065b4273: function(arg0) {
1197
+ const ret = typeof(arg0) === 'bigint';
1198
+ return ret;
1199
+ },
1200
+ __wbg___wbindgen_is_function_1ff95bcc5517c252: function(arg0) {
1201
+ const ret = typeof(arg0) === 'function';
1202
+ return ret;
1203
+ },
1204
+ __wbg___wbindgen_is_object_a27215656b807791: function(arg0) {
1205
+ const val = arg0;
1206
+ const ret = typeof(val) === 'object' && val !== null;
1207
+ return ret;
1208
+ },
1209
+ __wbg___wbindgen_is_string_ea5e6cc2e4141dfe: function(arg0) {
1210
+ const ret = typeof(arg0) === 'string';
1211
+ return ret;
1212
+ },
1213
+ __wbg___wbindgen_is_undefined_c05833b95a3cf397: function(arg0) {
1214
+ const ret = arg0 === undefined;
1215
+ return ret;
1216
+ },
1217
+ __wbg___wbindgen_jsval_eq_e659fcf7b0e32763: function(arg0, arg1) {
1218
+ const ret = arg0 === arg1;
1219
+ return ret;
1220
+ },
1221
+ __wbg___wbindgen_jsval_loose_eq_db4c3b15f63fc170: function(arg0, arg1) {
1222
+ const ret = arg0 == arg1;
1223
+ return ret;
1224
+ },
1225
+ __wbg___wbindgen_number_get_394265ed1e1b84ee: function(arg0, arg1) {
1226
+ const obj = arg1;
1227
+ const ret = typeof(obj) === 'number' ? obj : undefined;
1228
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
1229
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1230
+ },
1231
+ __wbg___wbindgen_string_get_b0ca35b86a603356: function(arg0, arg1) {
1232
+ const obj = arg1;
1233
+ const ret = typeof(obj) === 'string' ? obj : undefined;
1234
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1235
+ var len1 = WASM_VECTOR_LEN;
1236
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1237
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1238
+ },
1239
+ __wbg___wbindgen_throw_344f42d3211c4765: function(arg0, arg1) {
1240
+ throw new Error(getStringFromWasm0(arg0, arg1));
1241
+ },
1242
+ __wbg__wbg_cb_unref_fffb441def202758: function(arg0) {
1243
+ arg0._wbg_cb_unref();
1244
+ },
1245
+ __wbg_abort_8bae0f33e7833997: function(arg0) {
1246
+ arg0.abort();
1247
+ },
1248
+ __wbg_abort_eee9248a6d680839: function(arg0, arg1) {
1249
+ arg0.abort(arg1);
1250
+ },
1251
+ __wbg_append_01c74e5c6b58aa64: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
1252
+ arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
1253
+ }, arguments); },
1254
+ __wbg_arrayBuffer_3b637f0fa65c5351: function() { return handleError(function (arg0) {
1255
+ const ret = arg0.arrayBuffer();
1256
+ return ret;
1257
+ }, arguments); },
1258
+ __wbg_buffer_54b87055582c8a81: function(arg0) {
1259
+ const ret = arg0.buffer;
1260
+ return ret;
1261
+ },
1262
+ __wbg_byobRequest_06b654bb15590436: function(arg0) {
1263
+ const ret = arg0.byobRequest;
1264
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1265
+ },
1266
+ __wbg_byteLength_41862ca4020b9c43: function(arg0) {
1267
+ const ret = arg0.byteLength;
1268
+ return ret;
1269
+ },
1270
+ __wbg_byteOffset_d42e18c4441f628b: function(arg0) {
1271
+ const ret = arg0.byteOffset;
1272
+ return ret;
1273
+ },
1274
+ __wbg_call_8a2dd23819f8a60a: function() { return handleError(function (arg0, arg1) {
1275
+ const ret = arg0.call(arg1);
1276
+ return ret;
1277
+ }, arguments); },
1278
+ __wbg_call_a6e5c5dce5018821: function() { return handleError(function (arg0, arg1, arg2) {
1279
+ const ret = arg0.call(arg1, arg2);
1280
+ return ret;
1281
+ }, arguments); },
1282
+ __wbg_clearTimeout_333bba87532ab9d3: function(arg0) {
1283
+ const ret = clearTimeout(arg0);
1284
+ return ret;
1285
+ },
1286
+ __wbg_close_249a23304523681b: function() { return handleError(function (arg0) {
1287
+ arg0.close();
1288
+ }, arguments); },
1289
+ __wbg_close_72d318d9c16e83ef: function() { return handleError(function (arg0) {
1290
+ arg0.close();
1291
+ }, arguments); },
1292
+ __wbg_crypto_38df2bab126b63dc: function(arg0) {
1293
+ const ret = arg0.crypto;
1294
+ return ret;
1295
+ },
1296
+ __wbg_done_89b2b13e91a60321: function(arg0) {
1297
+ const ret = arg0.done;
1298
+ return ret;
1299
+ },
1300
+ __wbg_enqueue_6d83b4c6281bafd6: function() { return handleError(function (arg0, arg1) {
1301
+ arg0.enqueue(arg1);
1302
+ }, arguments); },
1303
+ __wbg_entries_015dc610cd81ede0: function(arg0) {
1304
+ const ret = Object.entries(arg0);
1305
+ return ret;
1306
+ },
1307
+ __wbg_entries_900cefd6f70eb290: function(arg0) {
1308
+ const ret = arg0.entries();
1309
+ return ret;
1310
+ },
1311
+ __wbg_fetch_074561c3e313c86f: function(arg0) {
1312
+ const ret = fetch(arg0);
1313
+ return ret;
1314
+ },
1315
+ __wbg_fetch_6ecc661950e58d49: function(arg0, arg1) {
1316
+ const ret = arg0.fetch(arg1);
1317
+ return ret;
1318
+ },
1319
+ __wbg_fetch_b5951fc96f52f786: function(arg0, arg1) {
1320
+ const ret = arg0.fetch(arg1);
1321
+ return ret;
1322
+ },
1323
+ __wbg_getRandomValues_1ad11c1597afb478: function() { return handleError(function (arg0, arg1) {
1324
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
1325
+ }, arguments); },
1326
+ __wbg_getRandomValues_c44a50d8cfdaebeb: function() { return handleError(function (arg0, arg1) {
1327
+ arg0.getRandomValues(arg1);
1328
+ }, arguments); },
1329
+ __wbg_getRandomValues_cc7f052a444bb2ce: function() { return handleError(function (arg0, arg1) {
1330
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
1331
+ }, arguments); },
1332
+ __wbg_get_507a50627bffa49b: function(arg0, arg1) {
1333
+ const ret = arg0[arg1 >>> 0];
1334
+ return ret;
1335
+ },
1336
+ __wbg_get_c7eb1f358a7654df: function() { return handleError(function (arg0, arg1) {
1337
+ const ret = Reflect.get(arg0, arg1);
1338
+ return ret;
1339
+ }, arguments); },
1340
+ __wbg_get_unchecked_6e0ad6d2a41b06f6: function(arg0, arg1) {
1341
+ const ret = arg0[arg1 >>> 0];
1342
+ return ret;
1343
+ },
1344
+ __wbg_has_8374cf06984d8bfc: function() { return handleError(function (arg0, arg1) {
1345
+ const ret = Reflect.has(arg0, arg1);
1346
+ return ret;
1347
+ }, arguments); },
1348
+ __wbg_headers_7b59c5203c8c475d: function(arg0) {
1349
+ const ret = arg0.headers;
1350
+ return ret;
1351
+ },
1352
+ __wbg_headers_cf9c80f30e2a4eff: function(arg0) {
1353
+ const ret = arg0.headers;
1354
+ return ret;
1355
+ },
1356
+ __wbg_instanceof_ArrayBuffer_4480b9e0068a8adb: function(arg0) {
1357
+ let result;
1358
+ try {
1359
+ result = arg0 instanceof ArrayBuffer;
1360
+ } catch (_) {
1361
+ result = false;
1362
+ }
1363
+ const ret = result;
1364
+ return ret;
1365
+ },
1366
+ __wbg_instanceof_Map_e5b5e3db98422fcc: function(arg0) {
1367
+ let result;
1368
+ try {
1369
+ result = arg0 instanceof Map;
1370
+ } catch (_) {
1371
+ result = false;
1372
+ }
1373
+ const ret = result;
1374
+ return ret;
1375
+ },
1376
+ __wbg_instanceof_Response_c8b64b2256f01bec: function(arg0) {
1377
+ let result;
1378
+ try {
1379
+ result = arg0 instanceof Response;
1380
+ } catch (_) {
1381
+ result = false;
1382
+ }
1383
+ const ret = result;
1384
+ return ret;
1385
+ },
1386
+ __wbg_instanceof_Uint8Array_309b927aaf7a3fc7: function(arg0) {
1387
+ let result;
1388
+ try {
1389
+ result = arg0 instanceof Uint8Array;
1390
+ } catch (_) {
1391
+ result = false;
1392
+ }
1393
+ const ret = result;
1394
+ return ret;
1395
+ },
1396
+ __wbg_instanceof_Window_05ba1ee4f6781663: function(arg0) {
1397
+ let result;
1398
+ try {
1399
+ result = arg0 instanceof Window;
1400
+ } catch (_) {
1401
+ result = false;
1402
+ }
1403
+ const ret = result;
1404
+ return ret;
1405
+ },
1406
+ __wbg_isArray_0677c962b281d01a: function(arg0) {
1407
+ const ret = Array.isArray(arg0);
1408
+ return ret;
1409
+ },
1410
+ __wbg_isSafeInteger_04f36e4056f1b851: function(arg0) {
1411
+ const ret = Number.isSafeInteger(arg0);
1412
+ return ret;
1413
+ },
1414
+ __wbg_iterator_6f722e4a93058b71: function() {
1415
+ const ret = Symbol.iterator;
1416
+ return ret;
1417
+ },
1418
+ __wbg_json_77bd792f9a4a3fe1: function() { return handleError(function (arg0) {
1419
+ const ret = arg0.json();
1420
+ return ret;
1421
+ }, arguments); },
1422
+ __wbg_length_1f0964f4a5e2c6d8: function(arg0) {
1423
+ const ret = arg0.length;
1424
+ return ret;
1425
+ },
1426
+ __wbg_length_370319915dc99107: function(arg0) {
1427
+ const ret = arg0.length;
1428
+ return ret;
1429
+ },
1430
+ __wbg_locks_new: function(arg0) {
1431
+ const ret = Locks.__wrap(arg0);
1432
+ return ret;
1433
+ },
1434
+ __wbg_msCrypto_bd5a034af96bcba6: function(arg0) {
1435
+ const ret = arg0.msCrypto;
1436
+ return ret;
1437
+ },
1438
+ __wbg_new_0d809930cd1354c6: function() { return handleError(function () {
1439
+ const ret = new Headers();
1440
+ return ret;
1441
+ }, arguments); },
1442
+ __wbg_new_4339b2a2675a03e3: function() { return handleError(function () {
1443
+ const ret = new AbortController();
1444
+ return ret;
1445
+ }, arguments); },
1446
+ __wbg_new_b667d279fd5aa943: function(arg0, arg1) {
1447
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
1448
+ return ret;
1449
+ },
1450
+ __wbg_new_cd45aabdf6073e84: function(arg0) {
1451
+ const ret = new Uint8Array(arg0);
1452
+ return ret;
1453
+ },
1454
+ __wbg_new_da52cf8fe3429cb2: function() {
1455
+ const ret = new Object();
1456
+ return ret;
1457
+ },
1458
+ __wbg_new_from_slice_77cdfb7977362f3c: function(arg0, arg1) {
1459
+ const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
1460
+ return ret;
1461
+ },
1462
+ __wbg_new_typed_1824d93f294193e5: function(arg0, arg1) {
1463
+ try {
1464
+ var state0 = {a: arg0, b: arg1};
1465
+ var cb0 = (arg0, arg1) => {
1466
+ const a = state0.a;
1467
+ state0.a = 0;
1468
+ try {
1469
+ return wasm_bindgen__convert__closures_____invoke__h0bbd1023632d6b79(a, state0.b, arg0, arg1);
1470
+ } finally {
1471
+ state0.a = a;
1472
+ }
1473
+ };
1474
+ const ret = new Promise(cb0);
1475
+ return ret;
1476
+ } finally {
1477
+ state0.a = 0;
1478
+ }
1479
+ },
1480
+ __wbg_new_with_byte_offset_and_length_54c7724ee3ec7d82: function(arg0, arg1, arg2) {
1481
+ const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
1482
+ return ret;
1483
+ },
1484
+ __wbg_new_with_length_e6785c33c8e4cce8: function(arg0) {
1485
+ const ret = new Uint8Array(arg0 >>> 0);
1486
+ return ret;
1487
+ },
1488
+ __wbg_new_with_str_and_init_d95cbe11ce28e65e: function() { return handleError(function (arg0, arg1, arg2) {
1489
+ const ret = new Request(getStringFromWasm0(arg0, arg1), arg2);
1490
+ return ret;
1491
+ }, arguments); },
1492
+ __wbg_next_6dbf2c0ac8cde20f: function(arg0) {
1493
+ const ret = arg0.next;
1494
+ return ret;
1495
+ },
1496
+ __wbg_next_71f2aa1cb3d1e37e: function() { return handleError(function (arg0) {
1497
+ const ret = arg0.next();
1498
+ return ret;
1499
+ }, arguments); },
1500
+ __wbg_node_84ea875411254db1: function(arg0) {
1501
+ const ret = arg0.node;
1502
+ return ret;
1503
+ },
1504
+ __wbg_now_86c0d4ba3fa605b8: function() {
1505
+ const ret = Date.now();
1506
+ return ret;
1507
+ },
1508
+ __wbg_ok_acc5e3fb89668864: function(arg0) {
1509
+ const ret = arg0.ok;
1510
+ return ret;
1511
+ },
1512
+ __wbg_parse_1c0d8a8656d7e016: function() { return handleError(function (arg0, arg1) {
1513
+ const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
1514
+ return ret;
1515
+ }, arguments); },
1516
+ __wbg_process_44c7a14e11e9f69e: function(arg0) {
1517
+ const ret = arg0.process;
1518
+ return ret;
1519
+ },
1520
+ __wbg_prototypesetcall_4770620bbe4688a0: function(arg0, arg1, arg2) {
1521
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
1522
+ },
1523
+ __wbg_queueMicrotask_0ab5b2d2393e99b9: function(arg0) {
1524
+ const ret = arg0.queueMicrotask;
1525
+ return ret;
1526
+ },
1527
+ __wbg_queueMicrotask_6a09b7bc46549209: function(arg0) {
1528
+ queueMicrotask(arg0);
1529
+ },
1530
+ __wbg_randomFillSync_6c25eac9869eb53c: function() { return handleError(function (arg0, arg1) {
1531
+ arg0.randomFillSync(arg1);
1532
+ }, arguments); },
1533
+ __wbg_require_b4edbdcf3e2a1ef0: function() { return handleError(function () {
1534
+ const ret = module.require;
1535
+ return ret;
1536
+ }, arguments); },
1537
+ __wbg_resolve_2191a4dfe481c25b: function(arg0) {
1538
+ const ret = Promise.resolve(arg0);
1539
+ return ret;
1540
+ },
1541
+ __wbg_respond_510e32df8aeb6817: function() { return handleError(function (arg0, arg1) {
1542
+ arg0.respond(arg1 >>> 0);
1543
+ }, arguments); },
1544
+ __wbg_session_new: function(arg0) {
1545
+ const ret = Session.__wrap(arg0);
1546
+ return ret;
1547
+ },
1548
+ __wbg_setTimeout_3a808dd861dd3c12: function(arg0, arg1) {
1549
+ const ret = setTimeout(arg0, arg1);
1550
+ return ret;
1551
+ },
1552
+ __wbg_set_0de9c62c23d04ad5: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
1553
+ arg0.set(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
1554
+ }, arguments); },
1555
+ __wbg_set_4d7dd76f3dae2926: function(arg0, arg1, arg2) {
1556
+ arg0.set(getArrayU8FromWasm0(arg1, arg2));
1557
+ },
1558
+ __wbg_set_body_029f2d171e0a005f: function(arg0, arg1) {
1559
+ arg0.body = arg1;
1560
+ },
1561
+ __wbg_set_cache_b4a740b195c051f4: function(arg0, arg1) {
1562
+ arg0.cache = __wbindgen_enum_RequestCache[arg1];
1563
+ },
1564
+ __wbg_set_credentials_bb34a40189e3b43b: function(arg0, arg1) {
1565
+ arg0.credentials = __wbindgen_enum_RequestCredentials[arg1];
1566
+ },
1567
+ __wbg_set_headers_9c61d123c3ee1f10: function(arg0, arg1) {
1568
+ arg0.headers = arg1;
1569
+ },
1570
+ __wbg_set_method_5532d59b92d76467: function(arg0, arg1, arg2) {
1571
+ arg0.method = getStringFromWasm0(arg1, arg2);
1572
+ },
1573
+ __wbg_set_mode_66c79886ad78fc05: function(arg0, arg1) {
1574
+ arg0.mode = __wbindgen_enum_RequestMode[arg1];
1575
+ },
1576
+ __wbg_set_name_3bbc583faefa4193: function(arg0, arg1, arg2) {
1577
+ arg0.name = getStringFromWasm0(arg1, arg2);
1578
+ },
1579
+ __wbg_set_signal_c4ef8faddb4c1446: function(arg0, arg1) {
1580
+ arg0.signal = arg1;
1581
+ },
1582
+ __wbg_signal_dad7cb35193abd31: function(arg0) {
1583
+ const ret = arg0.signal;
1584
+ return ret;
1585
+ },
1586
+ __wbg_static_accessor_GLOBAL_4ef717fb391d88b7: function() {
1587
+ const ret = typeof global === 'undefined' ? null : global;
1588
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1589
+ },
1590
+ __wbg_static_accessor_GLOBAL_THIS_8d1badc68b5a74f4: function() {
1591
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
1592
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1593
+ },
1594
+ __wbg_static_accessor_SELF_146583524fe1469b: function() {
1595
+ const ret = typeof self === 'undefined' ? null : self;
1596
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1597
+ },
1598
+ __wbg_static_accessor_WINDOW_f2829a2234d7819e: function() {
1599
+ const ret = typeof window === 'undefined' ? null : window;
1600
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1601
+ },
1602
+ __wbg_status_c45b3b9b3033184a: function(arg0) {
1603
+ const ret = arg0.status;
1604
+ return ret;
1605
+ },
1606
+ __wbg_subarray_3ed232c8a6baee09: function(arg0, arg1, arg2) {
1607
+ const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
1608
+ return ret;
1609
+ },
1610
+ __wbg_text_d3a29f7525a132c3: function() { return handleError(function (arg0) {
1611
+ const ret = arg0.text();
1612
+ return ret;
1613
+ }, arguments); },
1614
+ __wbg_then_16d107c451e9905d: function(arg0, arg1, arg2) {
1615
+ const ret = arg0.then(arg1, arg2);
1616
+ return ret;
1617
+ },
1618
+ __wbg_then_6ec10ae38b3e92f7: function(arg0, arg1) {
1619
+ const ret = arg0.then(arg1);
1620
+ return ret;
1621
+ },
1622
+ __wbg_url_abdb8fb08377f8c0: function(arg0, arg1) {
1623
+ const ret = arg1.url;
1624
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1625
+ const len1 = WASM_VECTOR_LEN;
1626
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1627
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1628
+ },
1629
+ __wbg_value_a5d5488a9589444a: function(arg0) {
1630
+ const ret = arg0.value;
1631
+ return ret;
1632
+ },
1633
+ __wbg_versions_276b2795b1c6a219: function(arg0) {
1634
+ const ret = arg0.versions;
1635
+ return ret;
1636
+ },
1637
+ __wbg_view_21f1d4a4f175dfa9: function(arg0) {
1638
+ const ret = arg0.view;
1639
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1640
+ },
1641
+ __wbindgen_cast_0000000000000001: function(arg0, arg1) {
1642
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 660, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1643
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h91c6e0a7524f6a5b);
1644
+ return ret;
1645
+ },
1646
+ __wbindgen_cast_0000000000000002: function(arg0, arg1) {
1647
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 473, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1648
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h67168fce963d1069);
1649
+ return ret;
1650
+ },
1651
+ __wbindgen_cast_0000000000000003: function(arg0) {
1652
+ // Cast intrinsic for `I64 -> Externref`.
1653
+ const ret = arg0;
1654
+ return ret;
1655
+ },
1656
+ __wbindgen_cast_0000000000000004: function(arg0, arg1) {
1657
+ // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
1658
+ const ret = getArrayU8FromWasm0(arg0, arg1);
1659
+ return ret;
1660
+ },
1661
+ __wbindgen_cast_0000000000000005: function(arg0, arg1) {
1662
+ // Cast intrinsic for `Ref(String) -> Externref`.
1663
+ const ret = getStringFromWasm0(arg0, arg1);
1664
+ return ret;
1665
+ },
1666
+ __wbindgen_cast_0000000000000006: function(arg0) {
1667
+ // Cast intrinsic for `U64 -> Externref`.
1668
+ const ret = BigInt.asUintN(64, arg0);
1669
+ return ret;
1670
+ },
1671
+ __wbindgen_init_externref_table: function() {
1672
+ const table = wasm.__wbindgen_externrefs;
1673
+ const offset = table.grow(4);
1674
+ table.set(0, undefined);
1675
+ table.set(offset + 0, undefined);
1676
+ table.set(offset + 1, null);
1677
+ table.set(offset + 2, true);
1678
+ table.set(offset + 3, false);
1679
+ },
1680
+ };
1681
+ return {
1682
+ __proto__: null,
1683
+ "./locks_sdk_wasm_bg.js": import0,
1684
+ };
1685
+ }
1686
+
1687
+ function wasm_bindgen__convert__closures_____invoke__h67168fce963d1069(arg0, arg1) {
1688
+ wasm.wasm_bindgen__convert__closures_____invoke__h67168fce963d1069(arg0, arg1);
1689
+ }
1690
+
1691
+ function wasm_bindgen__convert__closures_____invoke__h91c6e0a7524f6a5b(arg0, arg1, arg2) {
1692
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h91c6e0a7524f6a5b(arg0, arg1, arg2);
1693
+ if (ret[1]) {
1694
+ throw takeFromExternrefTable0(ret[0]);
1695
+ }
1696
+ }
1697
+
1698
+ function wasm_bindgen__convert__closures_____invoke__h0bbd1023632d6b79(arg0, arg1, arg2, arg3) {
1699
+ wasm.wasm_bindgen__convert__closures_____invoke__h0bbd1023632d6b79(arg0, arg1, arg2, arg3);
1700
+ }
1701
+
1702
+
1703
+ const __wbindgen_enum_ReadableStreamType = ["bytes"];
1704
+
1705
+
1706
+ const __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"];
1707
+
1708
+
1709
+ const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
1710
+
1711
+
1712
+ const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
1713
+ const BundleIdFinalization = (typeof FinalizationRegistry === 'undefined')
1714
+ ? { register: () => {}, unregister: () => {} }
1715
+ : new FinalizationRegistry(ptr => wasm.__wbg_bundleid_free(ptr, 1));
1716
+ const ConnectCallbackFinalization = (typeof FinalizationRegistry === 'undefined')
1717
+ ? { register: () => {}, unregister: () => {} }
1718
+ : new FinalizationRegistry(ptr => wasm.__wbg_connectcallback_free(ptr, 1));
1719
+ const ConnectUrlOptionsFinalization = (typeof FinalizationRegistry === 'undefined')
1720
+ ? { register: () => {}, unregister: () => {} }
1721
+ : new FinalizationRegistry(ptr => wasm.__wbg_connecturloptions_free(ptr, 1));
1722
+ const CreateContentLockRequestBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
1723
+ ? { register: () => {}, unregister: () => {} }
1724
+ : new FinalizationRegistry(ptr => wasm.__wbg_createcontentlockrequestbuilder_free(ptr, 1));
1725
+ const CreatorFinalization = (typeof FinalizationRegistry === 'undefined')
1726
+ ? { register: () => {}, unregister: () => {} }
1727
+ : new FinalizationRegistry(ptr => wasm.__wbg_creator_free(ptr, 1));
1728
+ const DeleteGuardedResourceOptionsFinalization = (typeof FinalizationRegistry === 'undefined')
1729
+ ? { register: () => {}, unregister: () => {} }
1730
+ : new FinalizationRegistry(ptr => wasm.__wbg_deleteguardedresourceoptions_free(ptr, 1));
1731
+ const ExchangeFrontendSessionCodeOptionsFinalization = (typeof FinalizationRegistry === 'undefined')
1732
+ ? { register: () => {}, unregister: () => {} }
1733
+ : new FinalizationRegistry(ptr => wasm.__wbg_exchangefrontendsessioncodeoptions_free(ptr, 1));
1734
+ const IntoUnderlyingByteSourceFinalization = (typeof FinalizationRegistry === 'undefined')
1735
+ ? { register: () => {}, unregister: () => {} }
1736
+ : new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingbytesource_free(ptr, 1));
1737
+ const IntoUnderlyingSinkFinalization = (typeof FinalizationRegistry === 'undefined')
1738
+ ? { register: () => {}, unregister: () => {} }
1739
+ : new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingsink_free(ptr, 1));
1740
+ const IntoUnderlyingSourceFinalization = (typeof FinalizationRegistry === 'undefined')
1741
+ ? { register: () => {}, unregister: () => {} }
1742
+ : new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingsource_free(ptr, 1));
1743
+ const LocksFinalization = (typeof FinalizationRegistry === 'undefined')
1744
+ ? { register: () => {}, unregister: () => {} }
1745
+ : new FinalizationRegistry(ptr => wasm.__wbg_locks_free(ptr, 1));
1746
+ const LocksOptionsFinalization = (typeof FinalizationRegistry === 'undefined')
1747
+ ? { register: () => {}, unregister: () => {} }
1748
+ : new FinalizationRegistry(ptr => wasm.__wbg_locksoptions_free(ptr, 1));
1749
+ const RegisterGuardedResourceOptionsFinalization = (typeof FinalizationRegistry === 'undefined')
1750
+ ? { register: () => {}, unregister: () => {} }
1751
+ : new FinalizationRegistry(ptr => wasm.__wbg_registerguardedresourceoptions_free(ptr, 1));
1752
+ const SessionFinalization = (typeof FinalizationRegistry === 'undefined')
1753
+ ? { register: () => {}, unregister: () => {} }
1754
+ : new FinalizationRegistry(ptr => wasm.__wbg_session_free(ptr, 1));
1755
+ const SetLockServicePointerOptionsFinalization = (typeof FinalizationRegistry === 'undefined')
1756
+ ? { register: () => {}, unregister: () => {} }
1757
+ : new FinalizationRegistry(ptr => wasm.__wbg_setlockservicepointeroptions_free(ptr, 1));
1758
+ const VerificationTaskHandleOptionsFinalization = (typeof FinalizationRegistry === 'undefined')
1759
+ ? { register: () => {}, unregister: () => {} }
1760
+ : new FinalizationRegistry(ptr => wasm.__wbg_verificationtaskhandleoptions_free(ptr, 1));
1761
+ const ViewerFinalization = (typeof FinalizationRegistry === 'undefined')
1762
+ ? { register: () => {}, unregister: () => {} }
1763
+ : new FinalizationRegistry(ptr => wasm.__wbg_viewer_free(ptr, 1));
1764
+
1765
+ function addToExternrefTable0(obj) {
1766
+ const idx = wasm.__externref_table_alloc();
1767
+ wasm.__wbindgen_externrefs.set(idx, obj);
1768
+ return idx;
1769
+ }
1770
+
1771
+ function _assertClass(instance, klass) {
1772
+ if (!(instance instanceof klass)) {
1773
+ throw new Error(`expected instance of ${klass.name}`);
1774
+ }
1775
+ }
1776
+
1777
+ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
1778
+ ? { register: () => {}, unregister: () => {} }
1779
+ : new FinalizationRegistry(state => wasm.__wbindgen_destroy_closure(state.a, state.b));
1780
+
1781
+ function debugString(val) {
1782
+ // primitive types
1783
+ const type = typeof val;
1784
+ if (type == 'number' || type == 'boolean' || val == null) {
1785
+ return `${val}`;
1786
+ }
1787
+ if (type == 'string') {
1788
+ return `"${val}"`;
1789
+ }
1790
+ if (type == 'symbol') {
1791
+ const description = val.description;
1792
+ if (description == null) {
1793
+ return 'Symbol';
1794
+ } else {
1795
+ return `Symbol(${description})`;
1796
+ }
1797
+ }
1798
+ if (type == 'function') {
1799
+ const name = val.name;
1800
+ if (typeof name == 'string' && name.length > 0) {
1801
+ return `Function(${name})`;
1802
+ } else {
1803
+ return 'Function';
1804
+ }
1805
+ }
1806
+ // objects
1807
+ if (Array.isArray(val)) {
1808
+ const length = val.length;
1809
+ let debug = '[';
1810
+ if (length > 0) {
1811
+ debug += debugString(val[0]);
1812
+ }
1813
+ for(let i = 1; i < length; i++) {
1814
+ debug += ', ' + debugString(val[i]);
1815
+ }
1816
+ debug += ']';
1817
+ return debug;
1818
+ }
1819
+ // Test for built-in
1820
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
1821
+ let className;
1822
+ if (builtInMatches && builtInMatches.length > 1) {
1823
+ className = builtInMatches[1];
1824
+ } else {
1825
+ // Failed to match the standard '[object ClassName]'
1826
+ return toString.call(val);
1827
+ }
1828
+ if (className == 'Object') {
1829
+ // we're a user defined class or Object
1830
+ // JSON.stringify avoids problems with cycles, and is generally much
1831
+ // easier than looping through ownProperties of `val`.
1832
+ try {
1833
+ return 'Object(' + JSON.stringify(val) + ')';
1834
+ } catch (_) {
1835
+ return 'Object';
1836
+ }
1837
+ }
1838
+ // errors
1839
+ if (val instanceof Error) {
1840
+ return `${val.name}: ${val.message}\n${val.stack}`;
1841
+ }
1842
+ // TODO we could test for more things here, like `Set`s and `Map`s.
1843
+ return className;
1844
+ }
1845
+
1846
+ function getArrayJsValueFromWasm0(ptr, len) {
1847
+ ptr = ptr >>> 0;
1848
+ const mem = getDataViewMemory0();
1849
+ const result = [];
1850
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
1851
+ result.push(wasm.__wbindgen_externrefs.get(mem.getUint32(i, true)));
1852
+ }
1853
+ wasm.__externref_drop_slice(ptr, len);
1854
+ return result;
1855
+ }
1856
+
1857
+ function getArrayU8FromWasm0(ptr, len) {
1858
+ ptr = ptr >>> 0;
1859
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
1860
+ }
1861
+
1862
+ let cachedDataViewMemory0 = null;
1863
+ function getDataViewMemory0() {
1864
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
1865
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
1866
+ }
1867
+ return cachedDataViewMemory0;
1868
+ }
1869
+
1870
+ function getStringFromWasm0(ptr, len) {
1871
+ return decodeText(ptr >>> 0, len);
1872
+ }
1873
+
1874
+ let cachedUint8ArrayMemory0 = null;
1875
+ function getUint8ArrayMemory0() {
1876
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
1877
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
1878
+ }
1879
+ return cachedUint8ArrayMemory0;
1880
+ }
1881
+
1882
+ function handleError(f, args) {
1883
+ try {
1884
+ return f.apply(this, args);
1885
+ } catch (e) {
1886
+ const idx = addToExternrefTable0(e);
1887
+ wasm.__wbindgen_exn_store(idx);
1888
+ }
1889
+ }
1890
+
1891
+ function isLikeNone(x) {
1892
+ return x === undefined || x === null;
1893
+ }
1894
+
1895
+ function makeMutClosure(arg0, arg1, f) {
1896
+ const state = { a: arg0, b: arg1, cnt: 1 };
1897
+ const real = (...args) => {
1898
+
1899
+ // First up with a closure we increment the internal reference
1900
+ // count. This ensures that the Rust closure environment won't
1901
+ // be deallocated while we're invoking it.
1902
+ state.cnt++;
1903
+ const a = state.a;
1904
+ state.a = 0;
1905
+ try {
1906
+ return f(a, state.b, ...args);
1907
+ } finally {
1908
+ state.a = a;
1909
+ real._wbg_cb_unref();
1910
+ }
1911
+ };
1912
+ real._wbg_cb_unref = () => {
1913
+ if (--state.cnt === 0) {
1914
+ wasm.__wbindgen_destroy_closure(state.a, state.b);
1915
+ state.a = 0;
1916
+ CLOSURE_DTORS.unregister(state);
1917
+ }
1918
+ };
1919
+ CLOSURE_DTORS.register(real, state, state);
1920
+ return real;
1921
+ }
1922
+
1923
+ function passArray8ToWasm0(arg, malloc) {
1924
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
1925
+ getUint8ArrayMemory0().set(arg, ptr / 1);
1926
+ WASM_VECTOR_LEN = arg.length;
1927
+ return ptr;
1928
+ }
1929
+
1930
+ function passStringToWasm0(arg, malloc, realloc) {
1931
+ if (realloc === undefined) {
1932
+ const buf = cachedTextEncoder.encode(arg);
1933
+ const ptr = malloc(buf.length, 1) >>> 0;
1934
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
1935
+ WASM_VECTOR_LEN = buf.length;
1936
+ return ptr;
1937
+ }
1938
+
1939
+ let len = arg.length;
1940
+ let ptr = malloc(len, 1) >>> 0;
1941
+
1942
+ const mem = getUint8ArrayMemory0();
1943
+
1944
+ let offset = 0;
1945
+
1946
+ for (; offset < len; offset++) {
1947
+ const code = arg.charCodeAt(offset);
1948
+ if (code > 0x7F) break;
1949
+ mem[ptr + offset] = code;
1950
+ }
1951
+ if (offset !== len) {
1952
+ if (offset !== 0) {
1953
+ arg = arg.slice(offset);
1954
+ }
1955
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
1956
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
1957
+ const ret = cachedTextEncoder.encodeInto(arg, view);
1958
+
1959
+ offset += ret.written;
1960
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
1961
+ }
1962
+
1963
+ WASM_VECTOR_LEN = offset;
1964
+ return ptr;
1965
+ }
1966
+
1967
+ function takeFromExternrefTable0(idx) {
1968
+ const value = wasm.__wbindgen_externrefs.get(idx);
1969
+ wasm.__externref_table_dealloc(idx);
1970
+ return value;
1971
+ }
1972
+
1973
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
1974
+ cachedTextDecoder.decode();
1975
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
1976
+ let numBytesDecoded = 0;
1977
+ function decodeText(ptr, len) {
1978
+ numBytesDecoded += len;
1979
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
1980
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
1981
+ cachedTextDecoder.decode();
1982
+ numBytesDecoded = len;
1983
+ }
1984
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
1985
+ }
1986
+
1987
+ const cachedTextEncoder = new TextEncoder();
1988
+
1989
+ if (!('encodeInto' in cachedTextEncoder)) {
1990
+ cachedTextEncoder.encodeInto = function (arg, view) {
1991
+ const buf = cachedTextEncoder.encode(arg);
1992
+ view.set(buf);
1993
+ return {
1994
+ read: arg.length,
1995
+ written: buf.length
1996
+ };
1997
+ };
1998
+ }
1999
+
2000
+ let WASM_VECTOR_LEN = 0;
2001
+
2002
+ let wasmModule, wasmInstance, wasm;
2003
+ function __wbg_finalize_init(instance, module) {
2004
+ wasmInstance = instance;
2005
+ wasm = instance.exports;
2006
+ wasmModule = module;
2007
+ cachedDataViewMemory0 = null;
2008
+ cachedUint8ArrayMemory0 = null;
2009
+ wasm.__wbindgen_start();
2010
+ return wasm;
2011
+ }
2012
+
2013
+ async function __wbg_load(module, imports) {
2014
+ if (typeof Response === 'function' && module instanceof Response) {
2015
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
2016
+ try {
2017
+ return await WebAssembly.instantiateStreaming(module, imports);
2018
+ } catch (e) {
2019
+ const validResponse = module.ok && expectedResponseType(module.type);
2020
+
2021
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
2022
+ console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
2023
+
2024
+ } else { throw e; }
2025
+ }
2026
+ }
2027
+
2028
+ const bytes = await module.arrayBuffer();
2029
+ return await WebAssembly.instantiate(bytes, imports);
2030
+ } else {
2031
+ const instance = await WebAssembly.instantiate(module, imports);
2032
+
2033
+ if (instance instanceof WebAssembly.Instance) {
2034
+ return { instance, module };
2035
+ } else {
2036
+ return instance;
2037
+ }
2038
+ }
2039
+
2040
+ function expectedResponseType(type) {
2041
+ switch (type) {
2042
+ case 'basic': case 'cors': case 'default': return true;
2043
+ }
2044
+ return false;
2045
+ }
2046
+ }
2047
+
2048
+ function initSync(module) {
2049
+ if (wasm !== undefined) return wasm;
2050
+
2051
+
2052
+ if (module !== undefined) {
2053
+ if (Object.getPrototypeOf(module) === Object.prototype) {
2054
+ ({module} = module)
2055
+ } else {
2056
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
2057
+ }
2058
+ }
2059
+
2060
+ const imports = __wbg_get_imports();
2061
+ if (!(module instanceof WebAssembly.Module)) {
2062
+ module = new WebAssembly.Module(module);
2063
+ }
2064
+ const instance = new WebAssembly.Instance(module, imports);
2065
+ return __wbg_finalize_init(instance, module);
2066
+ }
2067
+
2068
+ async function __wbg_init(module_or_path) {
2069
+ if (wasm !== undefined) return wasm;
2070
+
2071
+
2072
+ if (module_or_path !== undefined) {
2073
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
2074
+ ({module_or_path} = module_or_path)
2075
+ } else {
2076
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
2077
+ }
2078
+ }
2079
+
2080
+ if (module_or_path === undefined) {
2081
+ module_or_path = new URL('locks_sdk_wasm_bg.wasm', import.meta.url);
2082
+ }
2083
+ const imports = __wbg_get_imports();
2084
+
2085
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
2086
+ module_or_path = fetch(module_or_path);
2087
+ }
2088
+
2089
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
2090
+
2091
+ return __wbg_finalize_init(instance, module);
2092
+ }
2093
+
2094
+ export { initSync, __wbg_init as default };