@rivetkit/rivetkit-wasm 0.0.0-pr.4860.2a8ccdf

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,1949 @@
1
+ let wasm;
2
+
3
+ let WASM_VECTOR_LEN = 0;
4
+
5
+ let cachedUint8ArrayMemory0 = null;
6
+
7
+ function getUint8ArrayMemory0() {
8
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
9
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
10
+ }
11
+ return cachedUint8ArrayMemory0;
12
+ }
13
+
14
+ const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
15
+
16
+ const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
17
+ ? function (arg, view) {
18
+ return cachedTextEncoder.encodeInto(arg, view);
19
+ }
20
+ : function (arg, view) {
21
+ const buf = cachedTextEncoder.encode(arg);
22
+ view.set(buf);
23
+ return {
24
+ read: arg.length,
25
+ written: buf.length
26
+ };
27
+ });
28
+
29
+ function passStringToWasm0(arg, malloc, realloc) {
30
+
31
+ if (realloc === undefined) {
32
+ const buf = cachedTextEncoder.encode(arg);
33
+ const ptr = malloc(buf.length, 1) >>> 0;
34
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
35
+ WASM_VECTOR_LEN = buf.length;
36
+ return ptr;
37
+ }
38
+
39
+ let len = arg.length;
40
+ let ptr = malloc(len, 1) >>> 0;
41
+
42
+ const mem = getUint8ArrayMemory0();
43
+
44
+ let offset = 0;
45
+
46
+ for (; offset < len; offset++) {
47
+ const code = arg.charCodeAt(offset);
48
+ if (code > 0x7F) break;
49
+ mem[ptr + offset] = code;
50
+ }
51
+
52
+ if (offset !== len) {
53
+ if (offset !== 0) {
54
+ arg = arg.slice(offset);
55
+ }
56
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
57
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
58
+ const ret = encodeString(arg, view);
59
+
60
+ offset += ret.written;
61
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
62
+ }
63
+
64
+ WASM_VECTOR_LEN = offset;
65
+ return ptr;
66
+ }
67
+
68
+ let cachedDataViewMemory0 = null;
69
+
70
+ function getDataViewMemory0() {
71
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
72
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
73
+ }
74
+ return cachedDataViewMemory0;
75
+ }
76
+
77
+ function addToExternrefTable0(obj) {
78
+ const idx = wasm.__externref_table_alloc();
79
+ wasm.__wbindgen_export_4.set(idx, obj);
80
+ return idx;
81
+ }
82
+
83
+ function handleError(f, args) {
84
+ try {
85
+ return f.apply(this, args);
86
+ } catch (e) {
87
+ const idx = addToExternrefTable0(e);
88
+ wasm.__wbindgen_exn_store(idx);
89
+ }
90
+ }
91
+
92
+ const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
93
+
94
+ if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
95
+
96
+ function getStringFromWasm0(ptr, len) {
97
+ ptr = ptr >>> 0;
98
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
99
+ }
100
+
101
+ function getArrayU8FromWasm0(ptr, len) {
102
+ ptr = ptr >>> 0;
103
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
104
+ }
105
+
106
+ function isLikeNone(x) {
107
+ return x === undefined || x === null;
108
+ }
109
+
110
+ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
111
+ ? { register: () => {}, unregister: () => {} }
112
+ : new FinalizationRegistry(state => {
113
+ wasm.__wbindgen_export_6.get(state.dtor)(state.a, state.b)
114
+ });
115
+
116
+ function makeMutClosure(arg0, arg1, dtor, f) {
117
+ const state = { a: arg0, b: arg1, cnt: 1, dtor };
118
+ const real = (...args) => {
119
+ // First up with a closure we increment the internal reference
120
+ // count. This ensures that the Rust closure environment won't
121
+ // be deallocated while we're invoking it.
122
+ state.cnt++;
123
+ const a = state.a;
124
+ state.a = 0;
125
+ try {
126
+ return f(a, state.b, ...args);
127
+ } finally {
128
+ if (--state.cnt === 0) {
129
+ wasm.__wbindgen_export_6.get(state.dtor)(a, state.b);
130
+ CLOSURE_DTORS.unregister(state);
131
+ } else {
132
+ state.a = a;
133
+ }
134
+ }
135
+ };
136
+ real.original = state;
137
+ CLOSURE_DTORS.register(real, state, state);
138
+ return real;
139
+ }
140
+
141
+ function debugString(val) {
142
+ // primitive types
143
+ const type = typeof val;
144
+ if (type == 'number' || type == 'boolean' || val == null) {
145
+ return `${val}`;
146
+ }
147
+ if (type == 'string') {
148
+ return `"${val}"`;
149
+ }
150
+ if (type == 'symbol') {
151
+ const description = val.description;
152
+ if (description == null) {
153
+ return 'Symbol';
154
+ } else {
155
+ return `Symbol(${description})`;
156
+ }
157
+ }
158
+ if (type == 'function') {
159
+ const name = val.name;
160
+ if (typeof name == 'string' && name.length > 0) {
161
+ return `Function(${name})`;
162
+ } else {
163
+ return 'Function';
164
+ }
165
+ }
166
+ // objects
167
+ if (Array.isArray(val)) {
168
+ const length = val.length;
169
+ let debug = '[';
170
+ if (length > 0) {
171
+ debug += debugString(val[0]);
172
+ }
173
+ for(let i = 1; i < length; i++) {
174
+ debug += ', ' + debugString(val[i]);
175
+ }
176
+ debug += ']';
177
+ return debug;
178
+ }
179
+ // Test for built-in
180
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
181
+ let className;
182
+ if (builtInMatches && builtInMatches.length > 1) {
183
+ className = builtInMatches[1];
184
+ } else {
185
+ // Failed to match the standard '[object ClassName]'
186
+ return toString.call(val);
187
+ }
188
+ if (className == 'Object') {
189
+ // we're a user defined class or Object
190
+ // JSON.stringify avoids problems with cycles, and is generally much
191
+ // easier than looping through ownProperties of `val`.
192
+ try {
193
+ return 'Object(' + JSON.stringify(val) + ')';
194
+ } catch (_) {
195
+ return 'Object';
196
+ }
197
+ }
198
+ // errors
199
+ if (val instanceof Error) {
200
+ return `${val.name}: ${val.message}\n${val.stack}`;
201
+ }
202
+ // TODO we could test for more things here, like `Set`s and `Map`s.
203
+ return className;
204
+ }
205
+
206
+ function passArray8ToWasm0(arg, malloc) {
207
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
208
+ getUint8ArrayMemory0().set(arg, ptr / 1);
209
+ WASM_VECTOR_LEN = arg.length;
210
+ return ptr;
211
+ }
212
+
213
+ function takeFromExternrefTable0(idx) {
214
+ const value = wasm.__wbindgen_export_4.get(idx);
215
+ wasm.__externref_table_dealloc(idx);
216
+ return value;
217
+ }
218
+
219
+ function _assertClass(instance, klass) {
220
+ if (!(instance instanceof klass)) {
221
+ throw new Error(`expected instance of ${klass.name}`);
222
+ }
223
+ }
224
+
225
+ export function start() {
226
+ wasm.start();
227
+ }
228
+
229
+ /**
230
+ * @param {Uint8Array} bytes
231
+ * @returns {Uint8Array}
232
+ */
233
+ export function uint8ArrayFromBytes(bytes) {
234
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
235
+ const len0 = WASM_VECTOR_LEN;
236
+ const ret = wasm.uint8ArrayFromBytes(ptr0, len0);
237
+ return ret;
238
+ }
239
+
240
+ /**
241
+ * @param {Uint8Array} bytes
242
+ * @returns {Uint8Array}
243
+ */
244
+ export function roundTripBytes(bytes) {
245
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
246
+ const len0 = WASM_VECTOR_LEN;
247
+ const ret = wasm.roundTripBytes(ptr0, len0);
248
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
249
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
250
+ return v2;
251
+ }
252
+
253
+ /**
254
+ * @param {Promise<any>} promise
255
+ * @returns {Promise<any>}
256
+ */
257
+ export function awaitPromise(promise) {
258
+ const ret = wasm.awaitPromise(promise);
259
+ return ret;
260
+ }
261
+
262
+ /**
263
+ * @returns {string}
264
+ */
265
+ export function bridgeRivetErrorPrefix() {
266
+ let deferred1_0;
267
+ let deferred1_1;
268
+ try {
269
+ const ret = wasm.bridgeRivetErrorPrefix();
270
+ deferred1_0 = ret[0];
271
+ deferred1_1 = ret[1];
272
+ return getStringFromWasm0(ret[0], ret[1]);
273
+ } finally {
274
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
275
+ }
276
+ }
277
+
278
+ function __wbg_adapter_46(arg0, arg1, arg2) {
279
+ wasm.closure1552_externref_shim(arg0, arg1, arg2);
280
+ }
281
+
282
+ function __wbg_adapter_55(arg0, arg1, arg2) {
283
+ wasm.closure1755_externref_shim(arg0, arg1, arg2);
284
+ }
285
+
286
+ function __wbg_adapter_223(arg0, arg1, arg2, arg3) {
287
+ wasm.closure1974_externref_shim(arg0, arg1, arg2, arg3);
288
+ }
289
+
290
+ const __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];
291
+
292
+ const ActorContextFinalization = (typeof FinalizationRegistry === 'undefined')
293
+ ? { register: () => {}, unregister: () => {} }
294
+ : new FinalizationRegistry(ptr => wasm.__wbg_actorcontext_free(ptr >>> 0, 1));
295
+
296
+ export class ActorContext {
297
+
298
+ static __wrap(ptr) {
299
+ ptr = ptr >>> 0;
300
+ const obj = Object.create(ActorContext.prototype);
301
+ obj.__wbg_ptr = ptr;
302
+ ActorContextFinalization.register(obj, obj.__wbg_ptr, obj);
303
+ return obj;
304
+ }
305
+
306
+ __destroy_into_raw() {
307
+ const ptr = this.__wbg_ptr;
308
+ this.__wbg_ptr = 0;
309
+ ActorContextFinalization.unregister(this);
310
+ return ptr;
311
+ }
312
+
313
+ free() {
314
+ const ptr = this.__destroy_into_raw();
315
+ wasm.__wbg_actorcontext_free(ptr, 0);
316
+ }
317
+ /**
318
+ * @param {Promise<any>} promise
319
+ * @returns {Promise<any>}
320
+ */
321
+ keepAwake(promise) {
322
+ const ret = wasm.actorcontext_keepAwake(this.__wbg_ptr, promise);
323
+ return ret;
324
+ }
325
+ /**
326
+ * @param {any} payload
327
+ * @returns {Promise<void>}
328
+ */
329
+ saveState(payload) {
330
+ const ret = wasm.actorcontext_saveState(this.__wbg_ptr, payload);
331
+ return ret;
332
+ }
333
+ /**
334
+ * @param {Promise<any>} promise
335
+ */
336
+ waitUntil(promise) {
337
+ wasm.actorcontext_waitUntil(this.__wbg_ptr, promise);
338
+ }
339
+ /**
340
+ * @returns {any}
341
+ */
342
+ abortSignal() {
343
+ const ret = wasm.actorcontext_abortSignal(this.__wbg_ptr);
344
+ if (ret[2]) {
345
+ throw takeFromExternrefTable0(ret[1]);
346
+ }
347
+ return takeFromExternrefTable0(ret[0]);
348
+ }
349
+ /**
350
+ * @param {Uint8Array} params
351
+ * @param {any} request
352
+ * @returns {Promise<ConnHandle>}
353
+ */
354
+ connectConn(params, request) {
355
+ const ptr0 = passArray8ToWasm0(params, wasm.__wbindgen_malloc);
356
+ const len0 = WASM_VECTOR_LEN;
357
+ const ret = wasm.actorcontext_connectConn(this.__wbg_ptr, ptr0, len0, request);
358
+ return ret;
359
+ }
360
+ /**
361
+ * @param {any} opts
362
+ */
363
+ requestSave(opts) {
364
+ wasm.actorcontext_requestSave(this.__wbg_ptr, opts);
365
+ }
366
+ /**
367
+ * @param {Promise<any>} promise
368
+ */
369
+ registerTask(promise) {
370
+ wasm.actorcontext_registerTask(this.__wbg_ptr, promise);
371
+ }
372
+ /**
373
+ * @returns {any}
374
+ */
375
+ runtimeState() {
376
+ const ret = wasm.actorcontext_runtimeState(this.__wbg_ptr);
377
+ return ret;
378
+ }
379
+ /**
380
+ * @returns {object}
381
+ */
382
+ inspectorSnapshot() {
383
+ const ret = wasm.actorcontext_inspectorSnapshot(this.__wbg_ptr);
384
+ if (ret[2]) {
385
+ throw takeFromExternrefTable0(ret[1]);
386
+ }
387
+ return takeFromExternrefTable0(ret[0]);
388
+ }
389
+ endOnStateChange() {
390
+ wasm.actorcontext_endOnStateChange(this.__wbg_ptr);
391
+ }
392
+ restartRunHandler() {
393
+ wasm.actorcontext_restartRunHandler(this.__wbg_ptr);
394
+ }
395
+ beginOnStateChange() {
396
+ wasm.actorcontext_beginOnStateChange(this.__wbg_ptr);
397
+ }
398
+ /**
399
+ * @param {any} opts
400
+ * @returns {Promise<void>}
401
+ */
402
+ requestSaveAndWait(opts) {
403
+ const ret = wasm.actorcontext_requestSaveAndWait(this.__wbg_ptr, opts);
404
+ return ret;
405
+ }
406
+ /**
407
+ * @param {string | null} [bearer_token]
408
+ * @returns {Promise<void>}
409
+ */
410
+ verifyInspectorAuth(bearer_token) {
411
+ var ptr0 = isLikeNone(bearer_token) ? 0 : passStringToWasm0(bearer_token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
412
+ var len0 = WASM_VECTOR_LEN;
413
+ const ret = wasm.actorcontext_verifyInspectorAuth(this.__wbg_ptr, ptr0, len0);
414
+ return ret;
415
+ }
416
+ /**
417
+ * @param {number} region_id
418
+ */
419
+ endWebsocketCallback(region_id) {
420
+ wasm.actorcontext_endWebsocketCallback(this.__wbg_ptr, region_id);
421
+ }
422
+ /**
423
+ * @returns {number}
424
+ */
425
+ beginWebsocketCallback() {
426
+ const ret = wasm.actorcontext_beginWebsocketCallback(this.__wbg_ptr);
427
+ return ret >>> 0;
428
+ }
429
+ /**
430
+ * @returns {Array<any>}
431
+ */
432
+ dirtyHibernatableConns() {
433
+ const ret = wasm.actorcontext_dirtyHibernatableConns(this.__wbg_ptr);
434
+ return ret;
435
+ }
436
+ /**
437
+ * @returns {Kv}
438
+ */
439
+ kv() {
440
+ const ret = wasm.actorcontext_kv(this.__wbg_ptr);
441
+ return Kv.__wrap(ret);
442
+ }
443
+ /**
444
+ * @returns {Array<any>}
445
+ */
446
+ takePendingHibernationChanges() {
447
+ const ret = wasm.actorcontext_takePendingHibernationChanges(this.__wbg_ptr);
448
+ return ret;
449
+ }
450
+ /**
451
+ * @returns {any}
452
+ */
453
+ key() {
454
+ const ret = wasm.actorcontext_key(this.__wbg_ptr);
455
+ if (ret[2]) {
456
+ throw takeFromExternrefTable0(ret[1]);
457
+ }
458
+ return takeFromExternrefTable0(ret[0]);
459
+ }
460
+ constructor() {
461
+ const ret = wasm.actorcontext_new();
462
+ if (ret[2]) {
463
+ throw takeFromExternrefTable0(ret[1]);
464
+ }
465
+ this.__wbg_ptr = ret[0] >>> 0;
466
+ ActorContextFinalization.register(this, this.__wbg_ptr, this);
467
+ return this;
468
+ }
469
+ /**
470
+ * @returns {SqliteDb}
471
+ */
472
+ sql() {
473
+ const ret = wasm.actorcontext_sql(this.__wbg_ptr);
474
+ return SqliteDb.__wrap(ret);
475
+ }
476
+ /**
477
+ * @returns {string}
478
+ */
479
+ name() {
480
+ let deferred1_0;
481
+ let deferred1_1;
482
+ try {
483
+ const ret = wasm.actorcontext_name(this.__wbg_ptr);
484
+ deferred1_0 = ret[0];
485
+ deferred1_1 = ret[1];
486
+ return getStringFromWasm0(ret[0], ret[1]);
487
+ } finally {
488
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
489
+ }
490
+ }
491
+ /**
492
+ * @returns {Array<any>}
493
+ */
494
+ conns() {
495
+ const ret = wasm.actorcontext_conns(this.__wbg_ptr);
496
+ return ret;
497
+ }
498
+ /**
499
+ * @returns {Queue}
500
+ */
501
+ queue() {
502
+ const ret = wasm.actorcontext_kv(this.__wbg_ptr);
503
+ return Queue.__wrap(ret);
504
+ }
505
+ sleep() {
506
+ const ret = wasm.actorcontext_sleep(this.__wbg_ptr);
507
+ if (ret[1]) {
508
+ throw takeFromExternrefTable0(ret[0]);
509
+ }
510
+ }
511
+ /**
512
+ * @returns {Uint8Array}
513
+ */
514
+ state() {
515
+ const ret = wasm.actorcontext_state(this.__wbg_ptr);
516
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
517
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
518
+ return v1;
519
+ }
520
+ /**
521
+ * @returns {string}
522
+ */
523
+ region() {
524
+ let deferred1_0;
525
+ let deferred1_1;
526
+ try {
527
+ const ret = wasm.actorcontext_region(this.__wbg_ptr);
528
+ deferred1_0 = ret[0];
529
+ deferred1_1 = ret[1];
530
+ return getStringFromWasm0(ret[0], ret[1]);
531
+ } finally {
532
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
533
+ }
534
+ }
535
+ destroy() {
536
+ const ret = wasm.actorcontext_destroy(this.__wbg_ptr);
537
+ if (ret[1]) {
538
+ throw takeFromExternrefTable0(ret[0]);
539
+ }
540
+ }
541
+ /**
542
+ * @returns {string}
543
+ */
544
+ actorId() {
545
+ let deferred1_0;
546
+ let deferred1_1;
547
+ try {
548
+ const ret = wasm.actorcontext_actorId(this.__wbg_ptr);
549
+ deferred1_0 = ret[0];
550
+ deferred1_1 = ret[1];
551
+ return getStringFromWasm0(ret[0], ret[1]);
552
+ } finally {
553
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
554
+ }
555
+ }
556
+ /**
557
+ * @returns {Schedule}
558
+ */
559
+ schedule() {
560
+ const ret = wasm.actorcontext_kv(this.__wbg_ptr);
561
+ return Schedule.__wrap(ret);
562
+ }
563
+ /**
564
+ * @param {string} name
565
+ * @param {Uint8Array} args
566
+ */
567
+ broadcast(name, args) {
568
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
569
+ const len0 = WASM_VECTOR_LEN;
570
+ const ptr1 = passArray8ToWasm0(args, wasm.__wbindgen_malloc);
571
+ const len1 = WASM_VECTOR_LEN;
572
+ wasm.actorcontext_broadcast(this.__wbg_ptr, ptr0, len0, ptr1, len1);
573
+ }
574
+ /**
575
+ * @param {number | null} [timestamp_ms]
576
+ */
577
+ setAlarm(timestamp_ms) {
578
+ const ret = wasm.actorcontext_setAlarm(this.__wbg_ptr, !isLikeNone(timestamp_ms), isLikeNone(timestamp_ms) ? 0 : timestamp_ms);
579
+ if (ret[1]) {
580
+ throw takeFromExternrefTable0(ret[0]);
581
+ }
582
+ }
583
+ }
584
+
585
+ const ActorFactoryFinalization = (typeof FinalizationRegistry === 'undefined')
586
+ ? { register: () => {}, unregister: () => {} }
587
+ : new FinalizationRegistry(ptr => wasm.__wbg_actorfactory_free(ptr >>> 0, 1));
588
+
589
+ export class ActorFactory {
590
+
591
+ __destroy_into_raw() {
592
+ const ptr = this.__wbg_ptr;
593
+ this.__wbg_ptr = 0;
594
+ ActorFactoryFinalization.unregister(this);
595
+ return ptr;
596
+ }
597
+
598
+ free() {
599
+ const ptr = this.__destroy_into_raw();
600
+ wasm.__wbg_actorfactory_free(ptr, 0);
601
+ }
602
+ /**
603
+ * @param {any} callbacks
604
+ * @param {any} config
605
+ */
606
+ constructor(callbacks, config) {
607
+ const ret = wasm.actorfactory_new(callbacks, config);
608
+ if (ret[2]) {
609
+ throw takeFromExternrefTable0(ret[1]);
610
+ }
611
+ this.__wbg_ptr = ret[0] >>> 0;
612
+ ActorFactoryFinalization.register(this, this.__wbg_ptr, this);
613
+ return this;
614
+ }
615
+ }
616
+
617
+ const CancellationTokenFinalization = (typeof FinalizationRegistry === 'undefined')
618
+ ? { register: () => {}, unregister: () => {} }
619
+ : new FinalizationRegistry(ptr => wasm.__wbg_cancellationtoken_free(ptr >>> 0, 1));
620
+
621
+ export class CancellationToken {
622
+
623
+ __destroy_into_raw() {
624
+ const ptr = this.__wbg_ptr;
625
+ this.__wbg_ptr = 0;
626
+ CancellationTokenFinalization.unregister(this);
627
+ return ptr;
628
+ }
629
+
630
+ free() {
631
+ const ptr = this.__destroy_into_raw();
632
+ wasm.__wbg_cancellationtoken_free(ptr, 0);
633
+ }
634
+ /**
635
+ * @param {Function} callback
636
+ */
637
+ onCancelled(callback) {
638
+ wasm.cancellationtoken_onCancelled(this.__wbg_ptr, callback);
639
+ }
640
+ constructor() {
641
+ const ret = wasm.cancellationtoken_new();
642
+ this.__wbg_ptr = ret >>> 0;
643
+ CancellationTokenFinalization.register(this, this.__wbg_ptr, this);
644
+ return this;
645
+ }
646
+ cancel() {
647
+ wasm.cancellationtoken_cancel(this.__wbg_ptr);
648
+ }
649
+ /**
650
+ * @returns {boolean}
651
+ */
652
+ aborted() {
653
+ const ret = wasm.cancellationtoken_aborted(this.__wbg_ptr);
654
+ return ret !== 0;
655
+ }
656
+ }
657
+
658
+ const ConnHandleFinalization = (typeof FinalizationRegistry === 'undefined')
659
+ ? { register: () => {}, unregister: () => {} }
660
+ : new FinalizationRegistry(ptr => wasm.__wbg_connhandle_free(ptr >>> 0, 1));
661
+
662
+ export class ConnHandle {
663
+
664
+ static __wrap(ptr) {
665
+ ptr = ptr >>> 0;
666
+ const obj = Object.create(ConnHandle.prototype);
667
+ obj.__wbg_ptr = ptr;
668
+ ConnHandleFinalization.register(obj, obj.__wbg_ptr, obj);
669
+ return obj;
670
+ }
671
+
672
+ __destroy_into_raw() {
673
+ const ptr = this.__wbg_ptr;
674
+ this.__wbg_ptr = 0;
675
+ ConnHandleFinalization.unregister(this);
676
+ return ptr;
677
+ }
678
+
679
+ free() {
680
+ const ptr = this.__destroy_into_raw();
681
+ wasm.__wbg_connhandle_free(ptr, 0);
682
+ }
683
+ /**
684
+ * @param {string | null} [reason]
685
+ * @returns {Promise<void>}
686
+ */
687
+ disconnect(reason) {
688
+ var ptr0 = isLikeNone(reason) ? 0 : passStringToWasm0(reason, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
689
+ var len0 = WASM_VECTOR_LEN;
690
+ const ret = wasm.connhandle_disconnect(this.__wbg_ptr, ptr0, len0);
691
+ return ret;
692
+ }
693
+ /**
694
+ * @returns {boolean}
695
+ */
696
+ isHibernatable() {
697
+ const ret = wasm.connhandle_isHibernatable(this.__wbg_ptr);
698
+ return ret !== 0;
699
+ }
700
+ /**
701
+ * @returns {string}
702
+ */
703
+ id() {
704
+ let deferred1_0;
705
+ let deferred1_1;
706
+ try {
707
+ const ret = wasm.connhandle_id(this.__wbg_ptr);
708
+ deferred1_0 = ret[0];
709
+ deferred1_1 = ret[1];
710
+ return getStringFromWasm0(ret[0], ret[1]);
711
+ } finally {
712
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
713
+ }
714
+ }
715
+ /**
716
+ * @param {string} name
717
+ * @param {Uint8Array} args
718
+ */
719
+ send(name, args) {
720
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
721
+ const len0 = WASM_VECTOR_LEN;
722
+ const ptr1 = passArray8ToWasm0(args, wasm.__wbindgen_malloc);
723
+ const len1 = WASM_VECTOR_LEN;
724
+ wasm.connhandle_send(this.__wbg_ptr, ptr0, len0, ptr1, len1);
725
+ }
726
+ /**
727
+ * @returns {Uint8Array}
728
+ */
729
+ state() {
730
+ const ret = wasm.connhandle_state(this.__wbg_ptr);
731
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
732
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
733
+ return v1;
734
+ }
735
+ /**
736
+ * @returns {Uint8Array}
737
+ */
738
+ params() {
739
+ const ret = wasm.connhandle_params(this.__wbg_ptr);
740
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
741
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
742
+ return v1;
743
+ }
744
+ /**
745
+ * @param {Uint8Array} state
746
+ */
747
+ setState(state) {
748
+ const ptr0 = passArray8ToWasm0(state, wasm.__wbindgen_malloc);
749
+ const len0 = WASM_VECTOR_LEN;
750
+ wasm.connhandle_setState(this.__wbg_ptr, ptr0, len0);
751
+ }
752
+ }
753
+
754
+ const CoreRegistryFinalization = (typeof FinalizationRegistry === 'undefined')
755
+ ? { register: () => {}, unregister: () => {} }
756
+ : new FinalizationRegistry(ptr => wasm.__wbg_coreregistry_free(ptr >>> 0, 1));
757
+
758
+ export class CoreRegistry {
759
+
760
+ __destroy_into_raw() {
761
+ const ptr = this.__wbg_ptr;
762
+ this.__wbg_ptr = 0;
763
+ CoreRegistryFinalization.unregister(this);
764
+ return ptr;
765
+ }
766
+
767
+ free() {
768
+ const ptr = this.__destroy_into_raw();
769
+ wasm.__wbg_coreregistry_free(ptr, 0);
770
+ }
771
+ /**
772
+ * @param {any} req
773
+ * @param {Function} on_stream_event
774
+ * @param {CancellationToken} cancel_token
775
+ * @param {any} config
776
+ * @returns {Promise<any>}
777
+ */
778
+ handleServerlessRequest(req, on_stream_event, cancel_token, config) {
779
+ _assertClass(cancel_token, CancellationToken);
780
+ const ret = wasm.coreregistry_handleServerlessRequest(this.__wbg_ptr, req, on_stream_event, cancel_token.__wbg_ptr, config);
781
+ return ret;
782
+ }
783
+ constructor() {
784
+ const ret = wasm.coreregistry_new();
785
+ this.__wbg_ptr = ret >>> 0;
786
+ CoreRegistryFinalization.register(this, this.__wbg_ptr, this);
787
+ return this;
788
+ }
789
+ /**
790
+ * @param {any} config
791
+ * @returns {Promise<void>}
792
+ */
793
+ serve(config) {
794
+ const ret = wasm.coreregistry_serve(this.__wbg_ptr, config);
795
+ return ret;
796
+ }
797
+ /**
798
+ * @param {string} name
799
+ * @param {ActorFactory} factory
800
+ */
801
+ register(name, factory) {
802
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
803
+ const len0 = WASM_VECTOR_LEN;
804
+ _assertClass(factory, ActorFactory);
805
+ const ret = wasm.coreregistry_register(this.__wbg_ptr, ptr0, len0, factory.__wbg_ptr);
806
+ if (ret[1]) {
807
+ throw takeFromExternrefTable0(ret[0]);
808
+ }
809
+ }
810
+ /**
811
+ * @returns {Promise<void>}
812
+ */
813
+ shutdown() {
814
+ const ret = wasm.coreregistry_shutdown(this.__wbg_ptr);
815
+ return ret;
816
+ }
817
+ }
818
+
819
+ const KvFinalization = (typeof FinalizationRegistry === 'undefined')
820
+ ? { register: () => {}, unregister: () => {} }
821
+ : new FinalizationRegistry(ptr => wasm.__wbg_kv_free(ptr >>> 0, 1));
822
+
823
+ export class Kv {
824
+
825
+ static __wrap(ptr) {
826
+ ptr = ptr >>> 0;
827
+ const obj = Object.create(Kv.prototype);
828
+ obj.__wbg_ptr = ptr;
829
+ KvFinalization.register(obj, obj.__wbg_ptr, obj);
830
+ return obj;
831
+ }
832
+
833
+ __destroy_into_raw() {
834
+ const ptr = this.__wbg_ptr;
835
+ this.__wbg_ptr = 0;
836
+ KvFinalization.unregister(this);
837
+ return ptr;
838
+ }
839
+
840
+ free() {
841
+ const ptr = this.__destroy_into_raw();
842
+ wasm.__wbg_kv_free(ptr, 0);
843
+ }
844
+ /**
845
+ * @param {Uint8Array} key
846
+ * @returns {Promise<void>}
847
+ */
848
+ delete(key) {
849
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
850
+ const len0 = WASM_VECTOR_LEN;
851
+ const ret = wasm.kv_delete(this.__wbg_ptr, ptr0, len0);
852
+ return ret;
853
+ }
854
+ /**
855
+ * @param {Uint8Array} start
856
+ * @param {Uint8Array} end
857
+ * @param {any} options
858
+ * @returns {Promise<any>}
859
+ */
860
+ listRange(start, end, options) {
861
+ const ptr0 = passArray8ToWasm0(start, wasm.__wbindgen_malloc);
862
+ const len0 = WASM_VECTOR_LEN;
863
+ const ptr1 = passArray8ToWasm0(end, wasm.__wbindgen_malloc);
864
+ const len1 = WASM_VECTOR_LEN;
865
+ const ret = wasm.kv_listRange(this.__wbg_ptr, ptr0, len0, ptr1, len1, options);
866
+ return ret;
867
+ }
868
+ /**
869
+ * @param {Uint8Array} prefix
870
+ * @param {any} options
871
+ * @returns {Promise<any>}
872
+ */
873
+ listPrefix(prefix, options) {
874
+ const ptr0 = passArray8ToWasm0(prefix, wasm.__wbindgen_malloc);
875
+ const len0 = WASM_VECTOR_LEN;
876
+ const ret = wasm.kv_listPrefix(this.__wbg_ptr, ptr0, len0, options);
877
+ return ret;
878
+ }
879
+ /**
880
+ * @param {Array<any>} keys
881
+ * @returns {Promise<void>}
882
+ */
883
+ batchDelete(keys) {
884
+ const ret = wasm.kv_batchDelete(this.__wbg_ptr, keys);
885
+ return ret;
886
+ }
887
+ /**
888
+ * @param {Uint8Array} start
889
+ * @param {Uint8Array} end
890
+ * @returns {Promise<void>}
891
+ */
892
+ deleteRange(start, end) {
893
+ const ptr0 = passArray8ToWasm0(start, wasm.__wbindgen_malloc);
894
+ const len0 = WASM_VECTOR_LEN;
895
+ const ptr1 = passArray8ToWasm0(end, wasm.__wbindgen_malloc);
896
+ const len1 = WASM_VECTOR_LEN;
897
+ const ret = wasm.kv_deleteRange(this.__wbg_ptr, ptr0, len0, ptr1, len1);
898
+ return ret;
899
+ }
900
+ /**
901
+ * @param {Uint8Array} key
902
+ * @returns {Promise<any>}
903
+ */
904
+ get(key) {
905
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
906
+ const len0 = WASM_VECTOR_LEN;
907
+ const ret = wasm.kv_get(this.__wbg_ptr, ptr0, len0);
908
+ return ret;
909
+ }
910
+ /**
911
+ * @param {Uint8Array} key
912
+ * @param {Uint8Array} value
913
+ * @returns {Promise<void>}
914
+ */
915
+ put(key, value) {
916
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
917
+ const len0 = WASM_VECTOR_LEN;
918
+ const ptr1 = passArray8ToWasm0(value, wasm.__wbindgen_malloc);
919
+ const len1 = WASM_VECTOR_LEN;
920
+ const ret = wasm.kv_put(this.__wbg_ptr, ptr0, len0, ptr1, len1);
921
+ return ret;
922
+ }
923
+ /**
924
+ * @param {Array<any>} keys
925
+ * @returns {Promise<any>}
926
+ */
927
+ batchGet(keys) {
928
+ const ret = wasm.kv_batchGet(this.__wbg_ptr, keys);
929
+ return ret;
930
+ }
931
+ /**
932
+ * @param {Array<any>} entries
933
+ * @returns {Promise<void>}
934
+ */
935
+ batchPut(entries) {
936
+ const ret = wasm.kv_batchPut(this.__wbg_ptr, entries);
937
+ return ret;
938
+ }
939
+ }
940
+
941
+ const QueueFinalization = (typeof FinalizationRegistry === 'undefined')
942
+ ? { register: () => {}, unregister: () => {} }
943
+ : new FinalizationRegistry(ptr => wasm.__wbg_queue_free(ptr >>> 0, 1));
944
+
945
+ export class Queue {
946
+
947
+ static __wrap(ptr) {
948
+ ptr = ptr >>> 0;
949
+ const obj = Object.create(Queue.prototype);
950
+ obj.__wbg_ptr = ptr;
951
+ QueueFinalization.register(obj, obj.__wbg_ptr, obj);
952
+ return obj;
953
+ }
954
+
955
+ __destroy_into_raw() {
956
+ const ptr = this.__wbg_ptr;
957
+ this.__wbg_ptr = 0;
958
+ QueueFinalization.unregister(this);
959
+ return ptr;
960
+ }
961
+
962
+ free() {
963
+ const ptr = this.__destroy_into_raw();
964
+ wasm.__wbg_queue_free(ptr, 0);
965
+ }
966
+ /**
967
+ * @param {any} options
968
+ * @param {CancellationToken | null} [signal]
969
+ * @returns {Promise<Array<any>>}
970
+ */
971
+ nextBatch(options, signal) {
972
+ let ptr0 = 0;
973
+ if (!isLikeNone(signal)) {
974
+ _assertClass(signal, CancellationToken);
975
+ ptr0 = signal.__destroy_into_raw();
976
+ }
977
+ const ret = wasm.queue_nextBatch(this.__wbg_ptr, options, ptr0);
978
+ return ret;
979
+ }
980
+ /**
981
+ * @param {any} options
982
+ * @returns {Array<any>}
983
+ */
984
+ tryNextBatch(options) {
985
+ const ret = wasm.queue_tryNextBatch(this.__wbg_ptr, options);
986
+ if (ret[2]) {
987
+ throw takeFromExternrefTable0(ret[1]);
988
+ }
989
+ return takeFromExternrefTable0(ret[0]);
990
+ }
991
+ /**
992
+ * @param {any} names
993
+ * @param {any} options
994
+ * @param {CancellationToken | null} [signal]
995
+ * @returns {Promise<QueueMessage>}
996
+ */
997
+ waitForNames(names, options, signal) {
998
+ let ptr0 = 0;
999
+ if (!isLikeNone(signal)) {
1000
+ _assertClass(signal, CancellationToken);
1001
+ ptr0 = signal.__destroy_into_raw();
1002
+ }
1003
+ const ret = wasm.queue_waitForNames(this.__wbg_ptr, names, options, ptr0);
1004
+ return ret;
1005
+ }
1006
+ /**
1007
+ * @param {string} name
1008
+ * @param {Uint8Array} body
1009
+ * @param {any} options
1010
+ * @param {CancellationToken | null} [signal]
1011
+ * @returns {Promise<Uint8Array | undefined>}
1012
+ */
1013
+ enqueueAndWait(name, body, options, signal) {
1014
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1015
+ const len0 = WASM_VECTOR_LEN;
1016
+ const ptr1 = passArray8ToWasm0(body, wasm.__wbindgen_malloc);
1017
+ const len1 = WASM_VECTOR_LEN;
1018
+ let ptr2 = 0;
1019
+ if (!isLikeNone(signal)) {
1020
+ _assertClass(signal, CancellationToken);
1021
+ ptr2 = signal.__destroy_into_raw();
1022
+ }
1023
+ const ret = wasm.queue_enqueueAndWait(this.__wbg_ptr, ptr0, len0, ptr1, len1, options, ptr2);
1024
+ return ret;
1025
+ }
1026
+ /**
1027
+ * @returns {Promise<Array<any>>}
1028
+ */
1029
+ inspectMessages() {
1030
+ const ret = wasm.queue_inspectMessages(this.__wbg_ptr);
1031
+ return ret;
1032
+ }
1033
+ /**
1034
+ * @param {any} names
1035
+ * @param {any} options
1036
+ * @returns {Promise<void>}
1037
+ */
1038
+ waitForNamesAvailable(names, options) {
1039
+ const ret = wasm.queue_waitForNamesAvailable(this.__wbg_ptr, names, options);
1040
+ return ret;
1041
+ }
1042
+ /**
1043
+ * @param {string} name
1044
+ * @param {Uint8Array} body
1045
+ * @returns {Promise<QueueMessage>}
1046
+ */
1047
+ send(name, body) {
1048
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1049
+ const len0 = WASM_VECTOR_LEN;
1050
+ const ptr1 = passArray8ToWasm0(body, wasm.__wbindgen_malloc);
1051
+ const len1 = WASM_VECTOR_LEN;
1052
+ const ret = wasm.queue_send(this.__wbg_ptr, ptr0, len0, ptr1, len1);
1053
+ return ret;
1054
+ }
1055
+ /**
1056
+ * @returns {number}
1057
+ */
1058
+ maxSize() {
1059
+ const ret = wasm.queue_maxSize(this.__wbg_ptr);
1060
+ return ret >>> 0;
1061
+ }
1062
+ }
1063
+
1064
+ const QueueMessageFinalization = (typeof FinalizationRegistry === 'undefined')
1065
+ ? { register: () => {}, unregister: () => {} }
1066
+ : new FinalizationRegistry(ptr => wasm.__wbg_queuemessage_free(ptr >>> 0, 1));
1067
+
1068
+ export class QueueMessage {
1069
+
1070
+ static __wrap(ptr) {
1071
+ ptr = ptr >>> 0;
1072
+ const obj = Object.create(QueueMessage.prototype);
1073
+ obj.__wbg_ptr = ptr;
1074
+ QueueMessageFinalization.register(obj, obj.__wbg_ptr, obj);
1075
+ return obj;
1076
+ }
1077
+
1078
+ __destroy_into_raw() {
1079
+ const ptr = this.__wbg_ptr;
1080
+ this.__wbg_ptr = 0;
1081
+ QueueMessageFinalization.unregister(this);
1082
+ return ptr;
1083
+ }
1084
+
1085
+ free() {
1086
+ const ptr = this.__destroy_into_raw();
1087
+ wasm.__wbg_queuemessage_free(ptr, 0);
1088
+ }
1089
+ /**
1090
+ * @returns {number}
1091
+ */
1092
+ createdAt() {
1093
+ const ret = wasm.queuemessage_createdAt(this.__wbg_ptr);
1094
+ return ret;
1095
+ }
1096
+ /**
1097
+ * @returns {boolean}
1098
+ */
1099
+ isCompletable() {
1100
+ const ret = wasm.queuemessage_isCompletable(this.__wbg_ptr);
1101
+ return ret !== 0;
1102
+ }
1103
+ /**
1104
+ * @returns {bigint}
1105
+ */
1106
+ id() {
1107
+ const ret = wasm.queuemessage_id(this.__wbg_ptr);
1108
+ return BigInt.asUintN(64, ret);
1109
+ }
1110
+ /**
1111
+ * @returns {Uint8Array}
1112
+ */
1113
+ body() {
1114
+ const ret = wasm.queuemessage_body(this.__wbg_ptr);
1115
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1116
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1117
+ return v1;
1118
+ }
1119
+ /**
1120
+ * @returns {string}
1121
+ */
1122
+ name() {
1123
+ let deferred1_0;
1124
+ let deferred1_1;
1125
+ try {
1126
+ const ret = wasm.queuemessage_name(this.__wbg_ptr);
1127
+ deferred1_0 = ret[0];
1128
+ deferred1_1 = ret[1];
1129
+ return getStringFromWasm0(ret[0], ret[1]);
1130
+ } finally {
1131
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1132
+ }
1133
+ }
1134
+ /**
1135
+ * @param {any} response
1136
+ * @returns {Promise<void>}
1137
+ */
1138
+ complete(response) {
1139
+ const ret = wasm.queuemessage_complete(this.__wbg_ptr, response);
1140
+ return ret;
1141
+ }
1142
+ }
1143
+
1144
+ const ScheduleFinalization = (typeof FinalizationRegistry === 'undefined')
1145
+ ? { register: () => {}, unregister: () => {} }
1146
+ : new FinalizationRegistry(ptr => wasm.__wbg_schedule_free(ptr >>> 0, 1));
1147
+
1148
+ export class Schedule {
1149
+
1150
+ static __wrap(ptr) {
1151
+ ptr = ptr >>> 0;
1152
+ const obj = Object.create(Schedule.prototype);
1153
+ obj.__wbg_ptr = ptr;
1154
+ ScheduleFinalization.register(obj, obj.__wbg_ptr, obj);
1155
+ return obj;
1156
+ }
1157
+
1158
+ __destroy_into_raw() {
1159
+ const ptr = this.__wbg_ptr;
1160
+ this.__wbg_ptr = 0;
1161
+ ScheduleFinalization.unregister(this);
1162
+ return ptr;
1163
+ }
1164
+
1165
+ free() {
1166
+ const ptr = this.__destroy_into_raw();
1167
+ wasm.__wbg_schedule_free(ptr, 0);
1168
+ }
1169
+ /**
1170
+ * @param {number} timestamp_ms
1171
+ * @param {string} action_name
1172
+ * @param {Uint8Array} args
1173
+ */
1174
+ at(timestamp_ms, action_name, args) {
1175
+ const ptr0 = passStringToWasm0(action_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1176
+ const len0 = WASM_VECTOR_LEN;
1177
+ const ptr1 = passArray8ToWasm0(args, wasm.__wbindgen_malloc);
1178
+ const len1 = WASM_VECTOR_LEN;
1179
+ wasm.schedule_at(this.__wbg_ptr, timestamp_ms, ptr0, len0, ptr1, len1);
1180
+ }
1181
+ /**
1182
+ * @param {number} duration_ms
1183
+ * @param {string} action_name
1184
+ * @param {Uint8Array} args
1185
+ */
1186
+ after(duration_ms, action_name, args) {
1187
+ const ptr0 = passStringToWasm0(action_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1188
+ const len0 = WASM_VECTOR_LEN;
1189
+ const ptr1 = passArray8ToWasm0(args, wasm.__wbindgen_malloc);
1190
+ const len1 = WASM_VECTOR_LEN;
1191
+ wasm.schedule_after(this.__wbg_ptr, duration_ms, ptr0, len0, ptr1, len1);
1192
+ }
1193
+ }
1194
+
1195
+ const SqliteDbFinalization = (typeof FinalizationRegistry === 'undefined')
1196
+ ? { register: () => {}, unregister: () => {} }
1197
+ : new FinalizationRegistry(ptr => wasm.__wbg_sqlitedb_free(ptr >>> 0, 1));
1198
+
1199
+ export class SqliteDb {
1200
+
1201
+ static __wrap(ptr) {
1202
+ ptr = ptr >>> 0;
1203
+ const obj = Object.create(SqliteDb.prototype);
1204
+ obj.__wbg_ptr = ptr;
1205
+ SqliteDbFinalization.register(obj, obj.__wbg_ptr, obj);
1206
+ return obj;
1207
+ }
1208
+
1209
+ __destroy_into_raw() {
1210
+ const ptr = this.__wbg_ptr;
1211
+ this.__wbg_ptr = 0;
1212
+ SqliteDbFinalization.unregister(this);
1213
+ return ptr;
1214
+ }
1215
+
1216
+ free() {
1217
+ const ptr = this.__destroy_into_raw();
1218
+ wasm.__wbg_sqlitedb_free(ptr, 0);
1219
+ }
1220
+ /**
1221
+ * @param {string} sql
1222
+ * @param {any} params
1223
+ * @returns {Promise<any>}
1224
+ */
1225
+ executeWrite(sql, params) {
1226
+ const ptr0 = passStringToWasm0(sql, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1227
+ const len0 = WASM_VECTOR_LEN;
1228
+ const ret = wasm.sqlitedb_executeWrite(this.__wbg_ptr, ptr0, len0, params);
1229
+ return ret;
1230
+ }
1231
+ /**
1232
+ * @param {string} sql
1233
+ * @param {any} params
1234
+ * @returns {Promise<any>}
1235
+ */
1236
+ run(sql, params) {
1237
+ const ptr0 = passStringToWasm0(sql, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1238
+ const len0 = WASM_VECTOR_LEN;
1239
+ const ret = wasm.sqlitedb_run(this.__wbg_ptr, ptr0, len0, params);
1240
+ return ret;
1241
+ }
1242
+ /**
1243
+ * @param {string} sql
1244
+ * @returns {Promise<any>}
1245
+ */
1246
+ exec(sql) {
1247
+ const ptr0 = passStringToWasm0(sql, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1248
+ const len0 = WASM_VECTOR_LEN;
1249
+ const ret = wasm.sqlitedb_exec(this.__wbg_ptr, ptr0, len0);
1250
+ return ret;
1251
+ }
1252
+ /**
1253
+ * @returns {Promise<void>}
1254
+ */
1255
+ close() {
1256
+ const ret = wasm.sqlitedb_close(this.__wbg_ptr);
1257
+ return ret;
1258
+ }
1259
+ /**
1260
+ * @param {string} sql
1261
+ * @param {any} params
1262
+ * @returns {Promise<any>}
1263
+ */
1264
+ query(sql, params) {
1265
+ const ptr0 = passStringToWasm0(sql, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1266
+ const len0 = WASM_VECTOR_LEN;
1267
+ const ret = wasm.sqlitedb_query(this.__wbg_ptr, ptr0, len0, params);
1268
+ return ret;
1269
+ }
1270
+ /**
1271
+ * @param {string} sql
1272
+ * @param {any} params
1273
+ * @returns {Promise<any>}
1274
+ */
1275
+ execute(sql, params) {
1276
+ const ptr0 = passStringToWasm0(sql, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1277
+ const len0 = WASM_VECTOR_LEN;
1278
+ const ret = wasm.sqlitedb_execute(this.__wbg_ptr, ptr0, len0, params);
1279
+ return ret;
1280
+ }
1281
+ }
1282
+
1283
+ const WebSocketHandleFinalization = (typeof FinalizationRegistry === 'undefined')
1284
+ ? { register: () => {}, unregister: () => {} }
1285
+ : new FinalizationRegistry(ptr => wasm.__wbg_websockethandle_free(ptr >>> 0, 1));
1286
+
1287
+ export class WebSocketHandle {
1288
+
1289
+ static __wrap(ptr) {
1290
+ ptr = ptr >>> 0;
1291
+ const obj = Object.create(WebSocketHandle.prototype);
1292
+ obj.__wbg_ptr = ptr;
1293
+ WebSocketHandleFinalization.register(obj, obj.__wbg_ptr, obj);
1294
+ return obj;
1295
+ }
1296
+
1297
+ __destroy_into_raw() {
1298
+ const ptr = this.__wbg_ptr;
1299
+ this.__wbg_ptr = 0;
1300
+ WebSocketHandleFinalization.unregister(this);
1301
+ return ptr;
1302
+ }
1303
+
1304
+ free() {
1305
+ const ptr = this.__destroy_into_raw();
1306
+ wasm.__wbg_websockethandle_free(ptr, 0);
1307
+ }
1308
+ /**
1309
+ * @param {Function} callback
1310
+ */
1311
+ setEventCallback(callback) {
1312
+ wasm.websockethandle_setEventCallback(this.__wbg_ptr, callback);
1313
+ }
1314
+ /**
1315
+ * @param {Uint8Array} data
1316
+ * @param {boolean} binary
1317
+ */
1318
+ send(data, binary) {
1319
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
1320
+ const len0 = WASM_VECTOR_LEN;
1321
+ const ret = wasm.websockethandle_send(this.__wbg_ptr, ptr0, len0, binary);
1322
+ if (ret[1]) {
1323
+ throw takeFromExternrefTable0(ret[0]);
1324
+ }
1325
+ }
1326
+ /**
1327
+ * @param {number | null} [code]
1328
+ * @param {string | null} [reason]
1329
+ * @returns {Promise<void>}
1330
+ */
1331
+ close(code, reason) {
1332
+ var ptr0 = isLikeNone(reason) ? 0 : passStringToWasm0(reason, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1333
+ var len0 = WASM_VECTOR_LEN;
1334
+ const ret = wasm.websockethandle_close(this.__wbg_ptr, isLikeNone(code) ? 0xFFFFFF : code, ptr0, len0);
1335
+ return ret;
1336
+ }
1337
+ }
1338
+
1339
+ async function __wbg_load(module, imports) {
1340
+ if (typeof Response === 'function' && module instanceof Response) {
1341
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
1342
+ try {
1343
+ return await WebAssembly.instantiateStreaming(module, imports);
1344
+
1345
+ } catch (e) {
1346
+ if (module.headers.get('Content-Type') != 'application/wasm') {
1347
+ 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);
1348
+
1349
+ } else {
1350
+ throw e;
1351
+ }
1352
+ }
1353
+ }
1354
+
1355
+ const bytes = await module.arrayBuffer();
1356
+ return await WebAssembly.instantiate(bytes, imports);
1357
+
1358
+ } else {
1359
+ const instance = await WebAssembly.instantiate(module, imports);
1360
+
1361
+ if (instance instanceof WebAssembly.Instance) {
1362
+ return { instance, module };
1363
+
1364
+ } else {
1365
+ return instance;
1366
+ }
1367
+ }
1368
+ }
1369
+
1370
+ function __wbg_get_imports() {
1371
+ const imports = {};
1372
+ imports.wbg = {};
1373
+ imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
1374
+ const ret = String(arg1);
1375
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1376
+ const len1 = WASM_VECTOR_LEN;
1377
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1378
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1379
+ };
1380
+ imports.wbg.__wbg_actorcontext_new = function(arg0) {
1381
+ const ret = ActorContext.__wrap(arg0);
1382
+ return ret;
1383
+ };
1384
+ imports.wbg.__wbg_buffer_09165b52af8c5237 = function(arg0) {
1385
+ const ret = arg0.buffer;
1386
+ return ret;
1387
+ };
1388
+ imports.wbg.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
1389
+ const ret = arg0.buffer;
1390
+ return ret;
1391
+ };
1392
+ imports.wbg.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
1393
+ const ret = arg0.call(arg1);
1394
+ return ret;
1395
+ }, arguments) };
1396
+ imports.wbg.__wbg_call_7cccdd69e0791ae2 = function() { return handleError(function (arg0, arg1, arg2) {
1397
+ const ret = arg0.call(arg1, arg2);
1398
+ return ret;
1399
+ }, arguments) };
1400
+ imports.wbg.__wbg_call_833bed5770ea2041 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
1401
+ const ret = arg0.call(arg1, arg2, arg3);
1402
+ return ret;
1403
+ }, arguments) };
1404
+ imports.wbg.__wbg_close_2893b7d056a0627d = function() { return handleError(function (arg0) {
1405
+ arg0.close();
1406
+ }, arguments) };
1407
+ imports.wbg.__wbg_close_e1253d480ed93ce3 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
1408
+ arg0.close(arg1, getStringFromWasm0(arg2, arg3));
1409
+ }, arguments) };
1410
+ imports.wbg.__wbg_code_f4ec1e6e2e1b0417 = function(arg0) {
1411
+ const ret = arg0.code;
1412
+ return ret;
1413
+ };
1414
+ imports.wbg.__wbg_connhandle_new = function(arg0) {
1415
+ const ret = ConnHandle.__wrap(arg0);
1416
+ return ret;
1417
+ };
1418
+ imports.wbg.__wbg_construct_b91ff0e53b60c0c3 = function() { return handleError(function (arg0, arg1) {
1419
+ const ret = Reflect.construct(arg0, arg1);
1420
+ return ret;
1421
+ }, arguments) };
1422
+ imports.wbg.__wbg_crypto_574e78ad8b13b65f = function(arg0) {
1423
+ const ret = arg0.crypto;
1424
+ return ret;
1425
+ };
1426
+ imports.wbg.__wbg_data_432d9c3df2630942 = function(arg0) {
1427
+ const ret = arg0.data;
1428
+ return ret;
1429
+ };
1430
+ imports.wbg.__wbg_done_769e5ede4b31c67b = function(arg0) {
1431
+ const ret = arg0.done;
1432
+ return ret;
1433
+ };
1434
+ imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
1435
+ let deferred0_0;
1436
+ let deferred0_1;
1437
+ try {
1438
+ deferred0_0 = arg0;
1439
+ deferred0_1 = arg1;
1440
+ console.error(getStringFromWasm0(arg0, arg1));
1441
+ } finally {
1442
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
1443
+ }
1444
+ };
1445
+ imports.wbg.__wbg_getRandomValues_38097e921c2494c3 = function() { return handleError(function (arg0, arg1) {
1446
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
1447
+ }, arguments) };
1448
+ imports.wbg.__wbg_getRandomValues_b8f5dbd5f3995a9e = function() { return handleError(function (arg0, arg1) {
1449
+ arg0.getRandomValues(arg1);
1450
+ }, arguments) };
1451
+ imports.wbg.__wbg_get_67b2ba62fc30de12 = function() { return handleError(function (arg0, arg1) {
1452
+ const ret = Reflect.get(arg0, arg1);
1453
+ return ret;
1454
+ }, arguments) };
1455
+ imports.wbg.__wbg_get_b9b93047fe3cf45b = function(arg0, arg1) {
1456
+ const ret = arg0[arg1 >>> 0];
1457
+ return ret;
1458
+ };
1459
+ imports.wbg.__wbg_getwithrefkey_1dc361bd10053bfe = function(arg0, arg1) {
1460
+ const ret = arg0[arg1];
1461
+ return ret;
1462
+ };
1463
+ imports.wbg.__wbg_instanceof_ArrayBuffer_e14585432e3737fc = function(arg0) {
1464
+ let result;
1465
+ try {
1466
+ result = arg0 instanceof ArrayBuffer;
1467
+ } catch (_) {
1468
+ result = false;
1469
+ }
1470
+ const ret = result;
1471
+ return ret;
1472
+ };
1473
+ imports.wbg.__wbg_instanceof_Error_4d54113b22d20306 = function(arg0) {
1474
+ let result;
1475
+ try {
1476
+ result = arg0 instanceof Error;
1477
+ } catch (_) {
1478
+ result = false;
1479
+ }
1480
+ const ret = result;
1481
+ return ret;
1482
+ };
1483
+ imports.wbg.__wbg_instanceof_Object_7f2dcef8f78644a4 = function(arg0) {
1484
+ let result;
1485
+ try {
1486
+ result = arg0 instanceof Object;
1487
+ } catch (_) {
1488
+ result = false;
1489
+ }
1490
+ const ret = result;
1491
+ return ret;
1492
+ };
1493
+ imports.wbg.__wbg_instanceof_Promise_935168b8f4b49db3 = function(arg0) {
1494
+ let result;
1495
+ try {
1496
+ result = arg0 instanceof Promise;
1497
+ } catch (_) {
1498
+ result = false;
1499
+ }
1500
+ const ret = result;
1501
+ return ret;
1502
+ };
1503
+ imports.wbg.__wbg_instanceof_Uint8Array_17156bcf118086a9 = function(arg0) {
1504
+ let result;
1505
+ try {
1506
+ result = arg0 instanceof Uint8Array;
1507
+ } catch (_) {
1508
+ result = false;
1509
+ }
1510
+ const ret = result;
1511
+ return ret;
1512
+ };
1513
+ imports.wbg.__wbg_isArray_a1eab7e0d067391b = function(arg0) {
1514
+ const ret = Array.isArray(arg0);
1515
+ return ret;
1516
+ };
1517
+ imports.wbg.__wbg_isSafeInteger_343e2beeeece1bb0 = function(arg0) {
1518
+ const ret = Number.isSafeInteger(arg0);
1519
+ return ret;
1520
+ };
1521
+ imports.wbg.__wbg_iterator_9a24c88df860dc65 = function() {
1522
+ const ret = Symbol.iterator;
1523
+ return ret;
1524
+ };
1525
+ imports.wbg.__wbg_keys_5c77a08ddc2fb8a6 = function(arg0) {
1526
+ const ret = Object.keys(arg0);
1527
+ return ret;
1528
+ };
1529
+ imports.wbg.__wbg_length_a446193dc22c12f8 = function(arg0) {
1530
+ const ret = arg0.length;
1531
+ return ret;
1532
+ };
1533
+ imports.wbg.__wbg_length_e2d2a49132c1b256 = function(arg0) {
1534
+ const ret = arg0.length;
1535
+ return ret;
1536
+ };
1537
+ imports.wbg.__wbg_message_97a2af9b89d693a3 = function(arg0) {
1538
+ const ret = arg0.message;
1539
+ return ret;
1540
+ };
1541
+ imports.wbg.__wbg_message_d1685a448ba00178 = function(arg0, arg1) {
1542
+ const ret = arg1.message;
1543
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1544
+ const len1 = WASM_VECTOR_LEN;
1545
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1546
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1547
+ };
1548
+ imports.wbg.__wbg_msCrypto_a61aeb35a24c1329 = function(arg0) {
1549
+ const ret = arg0.msCrypto;
1550
+ return ret;
1551
+ };
1552
+ imports.wbg.__wbg_new_23a2665fac83c611 = function(arg0, arg1) {
1553
+ try {
1554
+ var state0 = {a: arg0, b: arg1};
1555
+ var cb0 = (arg0, arg1) => {
1556
+ const a = state0.a;
1557
+ state0.a = 0;
1558
+ try {
1559
+ return __wbg_adapter_223(a, state0.b, arg0, arg1);
1560
+ } finally {
1561
+ state0.a = a;
1562
+ }
1563
+ };
1564
+ const ret = new Promise(cb0);
1565
+ return ret;
1566
+ } finally {
1567
+ state0.a = state0.b = 0;
1568
+ }
1569
+ };
1570
+ imports.wbg.__wbg_new_405e22f390576ce2 = function() {
1571
+ const ret = new Object();
1572
+ return ret;
1573
+ };
1574
+ imports.wbg.__wbg_new_78feb108b6472713 = function() {
1575
+ const ret = new Array();
1576
+ return ret;
1577
+ };
1578
+ imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
1579
+ const ret = new Error();
1580
+ return ret;
1581
+ };
1582
+ imports.wbg.__wbg_new_a12002a7f91c75be = function(arg0) {
1583
+ const ret = new Uint8Array(arg0);
1584
+ return ret;
1585
+ };
1586
+ imports.wbg.__wbg_new_c68d7209be747379 = function(arg0, arg1) {
1587
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
1588
+ return ret;
1589
+ };
1590
+ imports.wbg.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
1591
+ const ret = new Function(getStringFromWasm0(arg0, arg1));
1592
+ return ret;
1593
+ };
1594
+ imports.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function(arg0, arg1, arg2) {
1595
+ const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
1596
+ return ret;
1597
+ };
1598
+ imports.wbg.__wbg_newwithlength_a381634e90c276d4 = function(arg0) {
1599
+ const ret = new Uint8Array(arg0 >>> 0);
1600
+ return ret;
1601
+ };
1602
+ imports.wbg.__wbg_newwithstrsequence_6e9d6479e1cf978d = function() { return handleError(function (arg0, arg1, arg2) {
1603
+ const ret = new WebSocket(getStringFromWasm0(arg0, arg1), arg2);
1604
+ return ret;
1605
+ }, arguments) };
1606
+ imports.wbg.__wbg_next_25feadfc0913fea9 = function(arg0) {
1607
+ const ret = arg0.next;
1608
+ return ret;
1609
+ };
1610
+ imports.wbg.__wbg_next_6574e1a8a62d1055 = function() { return handleError(function (arg0) {
1611
+ const ret = arg0.next();
1612
+ return ret;
1613
+ }, arguments) };
1614
+ imports.wbg.__wbg_node_905d3e251edff8a2 = function(arg0) {
1615
+ const ret = arg0.node;
1616
+ return ret;
1617
+ };
1618
+ imports.wbg.__wbg_now_2c95c9de01293173 = function(arg0) {
1619
+ const ret = arg0.now();
1620
+ return ret;
1621
+ };
1622
+ imports.wbg.__wbg_now_807e54c39636c349 = function() {
1623
+ const ret = Date.now();
1624
+ return ret;
1625
+ };
1626
+ imports.wbg.__wbg_performance_7a3ffd0b17f663ad = function(arg0) {
1627
+ const ret = arg0.performance;
1628
+ return ret;
1629
+ };
1630
+ imports.wbg.__wbg_process_dc0fbacc7c1c06f7 = function(arg0) {
1631
+ const ret = arg0.process;
1632
+ return ret;
1633
+ };
1634
+ imports.wbg.__wbg_push_737cfc8c1432c2c6 = function(arg0, arg1) {
1635
+ const ret = arg0.push(arg1);
1636
+ return ret;
1637
+ };
1638
+ imports.wbg.__wbg_queueMicrotask_97d92b4fcc8a61c5 = function(arg0) {
1639
+ queueMicrotask(arg0);
1640
+ };
1641
+ imports.wbg.__wbg_queueMicrotask_d3219def82552485 = function(arg0) {
1642
+ const ret = arg0.queueMicrotask;
1643
+ return ret;
1644
+ };
1645
+ imports.wbg.__wbg_queuemessage_new = function(arg0) {
1646
+ const ret = QueueMessage.__wrap(arg0);
1647
+ return ret;
1648
+ };
1649
+ imports.wbg.__wbg_randomFillSync_ac0988aba3254290 = function() { return handleError(function (arg0, arg1) {
1650
+ arg0.randomFillSync(arg1);
1651
+ }, arguments) };
1652
+ imports.wbg.__wbg_readyState_7ef6e63c349899ed = function(arg0) {
1653
+ const ret = arg0.readyState;
1654
+ return ret;
1655
+ };
1656
+ imports.wbg.__wbg_reason_49f1cede8bcf23dd = function(arg0, arg1) {
1657
+ const ret = arg1.reason;
1658
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1659
+ const len1 = WASM_VECTOR_LEN;
1660
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1661
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1662
+ };
1663
+ imports.wbg.__wbg_require_60cc747a6bc5215a = function() { return handleError(function () {
1664
+ const ret = module.require;
1665
+ return ret;
1666
+ }, arguments) };
1667
+ imports.wbg.__wbg_resolve_4851785c9c5f573d = function(arg0) {
1668
+ const ret = Promise.resolve(arg0);
1669
+ return ret;
1670
+ };
1671
+ imports.wbg.__wbg_send_7c4769e24cf1d784 = function() { return handleError(function (arg0, arg1) {
1672
+ arg0.send(arg1);
1673
+ }, arguments) };
1674
+ imports.wbg.__wbg_set_37837023f3d740e8 = function(arg0, arg1, arg2) {
1675
+ arg0[arg1 >>> 0] = arg2;
1676
+ };
1677
+ imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
1678
+ arg0[arg1] = arg2;
1679
+ };
1680
+ imports.wbg.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
1681
+ arg0.set(arg1, arg2 >>> 0);
1682
+ };
1683
+ imports.wbg.__wbg_set_bb8cecf6a62b9f46 = function() { return handleError(function (arg0, arg1, arg2) {
1684
+ const ret = Reflect.set(arg0, arg1, arg2);
1685
+ return ret;
1686
+ }, arguments) };
1687
+ imports.wbg.__wbg_setbinaryType_92fa1ffd873b327c = function(arg0, arg1) {
1688
+ arg0.binaryType = __wbindgen_enum_BinaryType[arg1];
1689
+ };
1690
+ imports.wbg.__wbg_setonclose_14fc475a49d488fc = function(arg0, arg1) {
1691
+ arg0.onclose = arg1;
1692
+ };
1693
+ imports.wbg.__wbg_setonerror_8639efe354b947cd = function(arg0, arg1) {
1694
+ arg0.onerror = arg1;
1695
+ };
1696
+ imports.wbg.__wbg_setonmessage_6eccab530a8fb4c7 = function(arg0, arg1) {
1697
+ arg0.onmessage = arg1;
1698
+ };
1699
+ imports.wbg.__wbg_setonopen_2da654e1f39745d5 = function(arg0, arg1) {
1700
+ arg0.onopen = arg1;
1701
+ };
1702
+ imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
1703
+ const ret = arg1.stack;
1704
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1705
+ const len1 = WASM_VECTOR_LEN;
1706
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1707
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1708
+ };
1709
+ imports.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() {
1710
+ const ret = typeof global === 'undefined' ? null : global;
1711
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1712
+ };
1713
+ imports.wbg.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function() {
1714
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
1715
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1716
+ };
1717
+ imports.wbg.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function() {
1718
+ const ret = typeof self === 'undefined' ? null : self;
1719
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1720
+ };
1721
+ imports.wbg.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function() {
1722
+ const ret = typeof window === 'undefined' ? null : window;
1723
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1724
+ };
1725
+ imports.wbg.__wbg_stringify_f7ed6987935b4a24 = function() { return handleError(function (arg0) {
1726
+ const ret = JSON.stringify(arg0);
1727
+ return ret;
1728
+ }, arguments) };
1729
+ imports.wbg.__wbg_subarray_aa9065fa9dc5df96 = function(arg0, arg1, arg2) {
1730
+ const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
1731
+ return ret;
1732
+ };
1733
+ imports.wbg.__wbg_then_44b73946d2fb3e7d = function(arg0, arg1) {
1734
+ const ret = arg0.then(arg1);
1735
+ return ret;
1736
+ };
1737
+ imports.wbg.__wbg_then_48b406749878a531 = function(arg0, arg1, arg2) {
1738
+ const ret = arg0.then(arg1, arg2);
1739
+ return ret;
1740
+ };
1741
+ imports.wbg.__wbg_value_cd1ffa7b1ab794f1 = function(arg0) {
1742
+ const ret = arg0.value;
1743
+ return ret;
1744
+ };
1745
+ imports.wbg.__wbg_versions_c01dfd4722a88165 = function(arg0) {
1746
+ const ret = arg0.versions;
1747
+ return ret;
1748
+ };
1749
+ imports.wbg.__wbg_websockethandle_new = function(arg0) {
1750
+ const ret = WebSocketHandle.__wrap(arg0);
1751
+ return ret;
1752
+ };
1753
+ imports.wbg.__wbindgen_as_number = function(arg0) {
1754
+ const ret = +arg0;
1755
+ return ret;
1756
+ };
1757
+ imports.wbg.__wbindgen_boolean_get = function(arg0) {
1758
+ const v = arg0;
1759
+ const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
1760
+ return ret;
1761
+ };
1762
+ imports.wbg.__wbindgen_cb_drop = function(arg0) {
1763
+ const obj = arg0.original;
1764
+ if (obj.cnt-- == 1) {
1765
+ obj.a = 0;
1766
+ return true;
1767
+ }
1768
+ const ret = false;
1769
+ return ret;
1770
+ };
1771
+ imports.wbg.__wbindgen_closure_wrapper3601 = function(arg0, arg1, arg2) {
1772
+ const ret = makeMutClosure(arg0, arg1, 1553, __wbg_adapter_46);
1773
+ return ret;
1774
+ };
1775
+ imports.wbg.__wbindgen_closure_wrapper3603 = function(arg0, arg1, arg2) {
1776
+ const ret = makeMutClosure(arg0, arg1, 1553, __wbg_adapter_46);
1777
+ return ret;
1778
+ };
1779
+ imports.wbg.__wbindgen_closure_wrapper3605 = function(arg0, arg1, arg2) {
1780
+ const ret = makeMutClosure(arg0, arg1, 1553, __wbg_adapter_46);
1781
+ return ret;
1782
+ };
1783
+ imports.wbg.__wbindgen_closure_wrapper3607 = function(arg0, arg1, arg2) {
1784
+ const ret = makeMutClosure(arg0, arg1, 1553, __wbg_adapter_46);
1785
+ return ret;
1786
+ };
1787
+ imports.wbg.__wbindgen_closure_wrapper4200 = function(arg0, arg1, arg2) {
1788
+ const ret = makeMutClosure(arg0, arg1, 1756, __wbg_adapter_55);
1789
+ return ret;
1790
+ };
1791
+ imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
1792
+ const ret = debugString(arg1);
1793
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1794
+ const len1 = WASM_VECTOR_LEN;
1795
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1796
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1797
+ };
1798
+ imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
1799
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
1800
+ return ret;
1801
+ };
1802
+ imports.wbg.__wbindgen_in = function(arg0, arg1) {
1803
+ const ret = arg0 in arg1;
1804
+ return ret;
1805
+ };
1806
+ imports.wbg.__wbindgen_init_externref_table = function() {
1807
+ const table = wasm.__wbindgen_export_4;
1808
+ const offset = table.grow(4);
1809
+ table.set(0, undefined);
1810
+ table.set(offset + 0, undefined);
1811
+ table.set(offset + 1, null);
1812
+ table.set(offset + 2, true);
1813
+ table.set(offset + 3, false);
1814
+ ;
1815
+ };
1816
+ imports.wbg.__wbindgen_is_function = function(arg0) {
1817
+ const ret = typeof(arg0) === 'function';
1818
+ return ret;
1819
+ };
1820
+ imports.wbg.__wbindgen_is_null = function(arg0) {
1821
+ const ret = arg0 === null;
1822
+ return ret;
1823
+ };
1824
+ imports.wbg.__wbindgen_is_object = function(arg0) {
1825
+ const val = arg0;
1826
+ const ret = typeof(val) === 'object' && val !== null;
1827
+ return ret;
1828
+ };
1829
+ imports.wbg.__wbindgen_is_string = function(arg0) {
1830
+ const ret = typeof(arg0) === 'string';
1831
+ return ret;
1832
+ };
1833
+ imports.wbg.__wbindgen_is_undefined = function(arg0) {
1834
+ const ret = arg0 === undefined;
1835
+ return ret;
1836
+ };
1837
+ imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
1838
+ const ret = arg0 == arg1;
1839
+ return ret;
1840
+ };
1841
+ imports.wbg.__wbindgen_memory = function() {
1842
+ const ret = wasm.memory;
1843
+ return ret;
1844
+ };
1845
+ imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
1846
+ const obj = arg1;
1847
+ const ret = typeof(obj) === 'number' ? obj : undefined;
1848
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
1849
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1850
+ };
1851
+ imports.wbg.__wbindgen_number_new = function(arg0) {
1852
+ const ret = arg0;
1853
+ return ret;
1854
+ };
1855
+ imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
1856
+ const obj = arg1;
1857
+ const ret = typeof(obj) === 'string' ? obj : undefined;
1858
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1859
+ var len1 = WASM_VECTOR_LEN;
1860
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1861
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1862
+ };
1863
+ imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
1864
+ const ret = getStringFromWasm0(arg0, arg1);
1865
+ return ret;
1866
+ };
1867
+ imports.wbg.__wbindgen_throw = function(arg0, arg1) {
1868
+ throw new Error(getStringFromWasm0(arg0, arg1));
1869
+ };
1870
+ imports.wbg.__wbindgen_uint8_array_new = function(arg0, arg1) {
1871
+ var v0 = getArrayU8FromWasm0(arg0, arg1).slice();
1872
+ wasm.__wbindgen_free(arg0, arg1 * 1, 1);
1873
+ const ret = v0;
1874
+ return ret;
1875
+ };
1876
+
1877
+ return imports;
1878
+ }
1879
+
1880
+ function __wbg_init_memory(imports, memory) {
1881
+
1882
+ }
1883
+
1884
+ function __wbg_finalize_init(instance, module) {
1885
+ wasm = instance.exports;
1886
+ __wbg_init.__wbindgen_wasm_module = module;
1887
+ cachedDataViewMemory0 = null;
1888
+ cachedUint8ArrayMemory0 = null;
1889
+
1890
+
1891
+ wasm.__wbindgen_start();
1892
+ return wasm;
1893
+ }
1894
+
1895
+ function initSync(module) {
1896
+ if (wasm !== undefined) return wasm;
1897
+
1898
+
1899
+ if (typeof module !== 'undefined') {
1900
+ if (Object.getPrototypeOf(module) === Object.prototype) {
1901
+ ({module} = module)
1902
+ } else {
1903
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
1904
+ }
1905
+ }
1906
+
1907
+ const imports = __wbg_get_imports();
1908
+
1909
+ __wbg_init_memory(imports);
1910
+
1911
+ if (!(module instanceof WebAssembly.Module)) {
1912
+ module = new WebAssembly.Module(module);
1913
+ }
1914
+
1915
+ const instance = new WebAssembly.Instance(module, imports);
1916
+
1917
+ return __wbg_finalize_init(instance, module);
1918
+ }
1919
+
1920
+ async function __wbg_init(module_or_path) {
1921
+ if (wasm !== undefined) return wasm;
1922
+
1923
+
1924
+ if (typeof module_or_path !== 'undefined') {
1925
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
1926
+ ({module_or_path} = module_or_path)
1927
+ } else {
1928
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
1929
+ }
1930
+ }
1931
+
1932
+ if (typeof module_or_path === 'undefined') {
1933
+ module_or_path = new URL('rivetkit_wasm_bg.wasm', import.meta.url);
1934
+ }
1935
+ const imports = __wbg_get_imports();
1936
+
1937
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
1938
+ module_or_path = fetch(module_or_path);
1939
+ }
1940
+
1941
+ __wbg_init_memory(imports);
1942
+
1943
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
1944
+
1945
+ return __wbg_finalize_init(instance, module);
1946
+ }
1947
+
1948
+ export { initSync };
1949
+ export default __wbg_init;