@rivetkit/rivetkit-wasm 0.0.0-sqlite-profiling-compat.4a9a623 → 0.0.0-sqlite-sync-3-0-0-release.14341d0

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,2324 @@
1
+ /* @ts-self-types="./rivetkit_wasm.d.ts" */
2
+
3
+ export class ActorContext {
4
+ static __wrap(ptr) {
5
+ const obj = Object.create(ActorContext.prototype);
6
+ obj.__wbg_ptr = ptr;
7
+ ActorContextFinalization.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
+ ActorContextFinalization.unregister(this);
14
+ return ptr;
15
+ }
16
+ free() {
17
+ const ptr = this.__destroy_into_raw();
18
+ wasm.__wbg_actorcontext_free(ptr, 0);
19
+ }
20
+ /**
21
+ * @returns {any}
22
+ */
23
+ abortSignal() {
24
+ const ret = wasm.actorcontext_abortSignal(this.__wbg_ptr);
25
+ if (ret[2]) {
26
+ throw takeFromExternrefTable0(ret[1]);
27
+ }
28
+ return takeFromExternrefTable0(ret[0]);
29
+ }
30
+ /**
31
+ * @returns {string}
32
+ */
33
+ actorId() {
34
+ let deferred1_0;
35
+ let deferred1_1;
36
+ try {
37
+ const ret = wasm.actorcontext_actorId(this.__wbg_ptr);
38
+ deferred1_0 = ret[0];
39
+ deferred1_1 = ret[1];
40
+ return getStringFromWasm0(ret[0], ret[1]);
41
+ } finally {
42
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
43
+ }
44
+ }
45
+ /**
46
+ * @returns {number}
47
+ */
48
+ beginKeepAwake() {
49
+ const ret = wasm.actorcontext_beginKeepAwake(this.__wbg_ptr);
50
+ return ret >>> 0;
51
+ }
52
+ beginOnStateChange() {
53
+ wasm.actorcontext_beginOnStateChange(this.__wbg_ptr);
54
+ }
55
+ /**
56
+ * @param {number | null} [timeout_ms]
57
+ * @returns {Promise<ActorStateTransaction>}
58
+ */
59
+ beginStateTransaction(timeout_ms) {
60
+ const ret = wasm.actorcontext_beginStateTransaction(this.__wbg_ptr, !isLikeNone(timeout_ms), isLikeNone(timeout_ms) ? 0 : timeout_ms);
61
+ return ret;
62
+ }
63
+ /**
64
+ * @returns {number}
65
+ */
66
+ beginWebsocketCallback() {
67
+ const ret = wasm.actorcontext_beginWebsocketCallback(this.__wbg_ptr);
68
+ return ret >>> 0;
69
+ }
70
+ /**
71
+ * @param {string} name
72
+ * @param {Uint8Array} args
73
+ */
74
+ broadcast(name, args) {
75
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
76
+ const len0 = WASM_VECTOR_LEN;
77
+ const ptr1 = passArray8ToWasm0(args, wasm.__wbindgen_malloc);
78
+ const len1 = WASM_VECTOR_LEN;
79
+ wasm.actorcontext_broadcast(this.__wbg_ptr, ptr0, len0, ptr1, len1);
80
+ }
81
+ /**
82
+ * @param {Uint8Array} params
83
+ * @param {any} request
84
+ * @returns {Promise<ConnHandle>}
85
+ */
86
+ connectConn(params, request) {
87
+ const ptr0 = passArray8ToWasm0(params, wasm.__wbindgen_malloc);
88
+ const len0 = WASM_VECTOR_LEN;
89
+ const ret = wasm.actorcontext_connectConn(this.__wbg_ptr, ptr0, len0, request);
90
+ return ret;
91
+ }
92
+ /**
93
+ * @returns {Array<any>}
94
+ */
95
+ conns() {
96
+ const ret = wasm.actorcontext_conns(this.__wbg_ptr);
97
+ return ret;
98
+ }
99
+ destroy() {
100
+ const ret = wasm.actorcontext_destroy(this.__wbg_ptr);
101
+ if (ret[1]) {
102
+ throw takeFromExternrefTable0(ret[0]);
103
+ }
104
+ }
105
+ /**
106
+ * @returns {Array<any>}
107
+ */
108
+ dirtyHibernatableConns() {
109
+ const ret = wasm.actorcontext_dirtyHibernatableConns(this.__wbg_ptr);
110
+ return ret;
111
+ }
112
+ /**
113
+ * @param {number} region_id
114
+ */
115
+ endKeepAwake(region_id) {
116
+ wasm.actorcontext_endKeepAwake(this.__wbg_ptr, region_id);
117
+ }
118
+ endOnStateChange() {
119
+ wasm.actorcontext_endOnStateChange(this.__wbg_ptr);
120
+ }
121
+ /**
122
+ * @param {number} region_id
123
+ */
124
+ endWebsocketCallback(region_id) {
125
+ wasm.actorcontext_endWebsocketCallback(this.__wbg_ptr, region_id);
126
+ }
127
+ /**
128
+ * @returns {object}
129
+ */
130
+ inspectorSnapshot() {
131
+ const ret = wasm.actorcontext_inspectorSnapshot(this.__wbg_ptr);
132
+ if (ret[2]) {
133
+ throw takeFromExternrefTable0(ret[1]);
134
+ }
135
+ return takeFromExternrefTable0(ret[0]);
136
+ }
137
+ /**
138
+ * @param {Promise<any>} promise
139
+ */
140
+ keepAwake(promise) {
141
+ wasm.actorcontext_keepAwake(this.__wbg_ptr, promise);
142
+ }
143
+ /**
144
+ * @returns {any}
145
+ */
146
+ key() {
147
+ const ret = wasm.actorcontext_key(this.__wbg_ptr);
148
+ if (ret[2]) {
149
+ throw takeFromExternrefTable0(ret[1]);
150
+ }
151
+ return takeFromExternrefTable0(ret[0]);
152
+ }
153
+ /**
154
+ * @returns {Kv}
155
+ */
156
+ kv() {
157
+ const ret = wasm.actorcontext_kv(this.__wbg_ptr);
158
+ return Kv.__wrap(ret);
159
+ }
160
+ /**
161
+ * @returns {string}
162
+ */
163
+ name() {
164
+ let deferred1_0;
165
+ let deferred1_1;
166
+ try {
167
+ const ret = wasm.actorcontext_name(this.__wbg_ptr);
168
+ deferred1_0 = ret[0];
169
+ deferred1_1 = ret[1];
170
+ return getStringFromWasm0(ret[0], ret[1]);
171
+ } finally {
172
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
173
+ }
174
+ }
175
+ constructor() {
176
+ const ret = wasm.actorcontext_new();
177
+ if (ret[2]) {
178
+ throw takeFromExternrefTable0(ret[1]);
179
+ }
180
+ this.__wbg_ptr = ret[0];
181
+ ActorContextFinalization.register(this, this.__wbg_ptr, this);
182
+ return this;
183
+ }
184
+ /**
185
+ * @returns {Queue}
186
+ */
187
+ queue() {
188
+ const ret = wasm.actorcontext_queue(this.__wbg_ptr);
189
+ return Queue.__wrap(ret);
190
+ }
191
+ /**
192
+ * @returns {string}
193
+ */
194
+ region() {
195
+ let deferred1_0;
196
+ let deferred1_1;
197
+ try {
198
+ const ret = wasm.actorcontext_region(this.__wbg_ptr);
199
+ deferred1_0 = ret[0];
200
+ deferred1_1 = ret[1];
201
+ return getStringFromWasm0(ret[0], ret[1]);
202
+ } finally {
203
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
204
+ }
205
+ }
206
+ /**
207
+ * @param {Promise<any>} promise
208
+ */
209
+ registerTask(promise) {
210
+ wasm.actorcontext_registerTask(this.__wbg_ptr, promise);
211
+ }
212
+ /**
213
+ * @param {any} opts
214
+ * @returns {Promise<void>}
215
+ */
216
+ requestSaveAndWait(opts) {
217
+ const ret = wasm.actorcontext_requestSaveAndWait(this.__wbg_ptr, opts);
218
+ return ret;
219
+ }
220
+ /**
221
+ * @param {any} opts
222
+ */
223
+ requestSave(opts) {
224
+ wasm.actorcontext_requestSave(this.__wbg_ptr, opts);
225
+ }
226
+ restartRunHandler() {
227
+ const ret = wasm.actorcontext_restartRunHandler(this.__wbg_ptr);
228
+ if (ret[1]) {
229
+ throw takeFromExternrefTable0(ret[0]);
230
+ }
231
+ }
232
+ /**
233
+ * @returns {any}
234
+ */
235
+ runtimeState() {
236
+ const ret = wasm.actorcontext_runtimeState(this.__wbg_ptr);
237
+ return ret;
238
+ }
239
+ /**
240
+ * @param {any} writes
241
+ * @returns {Promise<void>}
242
+ */
243
+ saveStateAndWorkflowBatch(writes) {
244
+ const ret = wasm.actorcontext_saveStateAndWorkflowBatch(this.__wbg_ptr, writes);
245
+ return ret;
246
+ }
247
+ /**
248
+ * @param {any} payload
249
+ * @returns {Promise<void>}
250
+ */
251
+ saveState(payload) {
252
+ const ret = wasm.actorcontext_saveState(this.__wbg_ptr, payload);
253
+ return ret;
254
+ }
255
+ /**
256
+ * @returns {Schedule}
257
+ */
258
+ schedule() {
259
+ const ret = wasm.actorcontext_schedule(this.__wbg_ptr);
260
+ return Schedule.__wrap(ret);
261
+ }
262
+ /**
263
+ * @param {number | null} [timestamp_ms]
264
+ */
265
+ setAlarm(timestamp_ms) {
266
+ const ret = wasm.actorcontext_setAlarm(this.__wbg_ptr, !isLikeNone(timestamp_ms), isLikeNone(timestamp_ms) ? 0 : timestamp_ms);
267
+ if (ret[1]) {
268
+ throw takeFromExternrefTable0(ret[0]);
269
+ }
270
+ }
271
+ /**
272
+ * @param {number | null} [timestamp_ms]
273
+ * @returns {Promise<void>}
274
+ */
275
+ setRunWakeAt(timestamp_ms) {
276
+ const ret = wasm.actorcontext_setRunWakeAt(this.__wbg_ptr, !isLikeNone(timestamp_ms), isLikeNone(timestamp_ms) ? 0 : timestamp_ms);
277
+ return ret;
278
+ }
279
+ sleep() {
280
+ const ret = wasm.actorcontext_sleep(this.__wbg_ptr);
281
+ if (ret[1]) {
282
+ throw takeFromExternrefTable0(ret[0]);
283
+ }
284
+ }
285
+ /**
286
+ * @returns {SqliteDb}
287
+ */
288
+ sql() {
289
+ const ret = wasm.actorcontext_sql(this.__wbg_ptr);
290
+ return SqliteDb.__wrap(ret);
291
+ }
292
+ /**
293
+ * @returns {Uint8Array}
294
+ */
295
+ state() {
296
+ const ret = wasm.actorcontext_state(this.__wbg_ptr);
297
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
298
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
299
+ return v1;
300
+ }
301
+ /**
302
+ * @returns {Array<any>}
303
+ */
304
+ takePendingHibernationChanges() {
305
+ const ret = wasm.actorcontext_takePendingHibernationChanges(this.__wbg_ptr);
306
+ return ret;
307
+ }
308
+ /**
309
+ * @param {string | null} [bearer_token]
310
+ * @returns {Promise<void>}
311
+ */
312
+ verifyInspectorAuth(bearer_token) {
313
+ var ptr0 = isLikeNone(bearer_token) ? 0 : passStringToWasm0(bearer_token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
314
+ var len0 = WASM_VECTOR_LEN;
315
+ const ret = wasm.actorcontext_verifyInspectorAuth(this.__wbg_ptr, ptr0, len0);
316
+ return ret;
317
+ }
318
+ /**
319
+ * @returns {Promise<void>}
320
+ */
321
+ waitForTrackedShutdownWorkUnbounded() {
322
+ const ret = wasm.actorcontext_waitForTrackedShutdownWorkUnbounded(this.__wbg_ptr);
323
+ return ret;
324
+ }
325
+ /**
326
+ * @returns {Promise<boolean>}
327
+ */
328
+ waitForTrackedShutdownWork() {
329
+ const ret = wasm.actorcontext_waitForTrackedShutdownWork(this.__wbg_ptr);
330
+ return ret;
331
+ }
332
+ /**
333
+ * @param {Promise<any>} promise
334
+ */
335
+ waitUntil(promise) {
336
+ wasm.actorcontext_waitUntil(this.__wbg_ptr, promise);
337
+ }
338
+ }
339
+ if (Symbol.dispose) ActorContext.prototype[Symbol.dispose] = ActorContext.prototype.free;
340
+
341
+ export class ActorFactory {
342
+ __destroy_into_raw() {
343
+ const ptr = this.__wbg_ptr;
344
+ this.__wbg_ptr = 0;
345
+ ActorFactoryFinalization.unregister(this);
346
+ return ptr;
347
+ }
348
+ free() {
349
+ const ptr = this.__destroy_into_raw();
350
+ wasm.__wbg_actorfactory_free(ptr, 0);
351
+ }
352
+ /**
353
+ * @param {any} callbacks
354
+ * @param {any} config
355
+ */
356
+ constructor(callbacks, config) {
357
+ const ret = wasm.actorfactory_new(callbacks, config);
358
+ if (ret[2]) {
359
+ throw takeFromExternrefTable0(ret[1]);
360
+ }
361
+ this.__wbg_ptr = ret[0];
362
+ ActorFactoryFinalization.register(this, this.__wbg_ptr, this);
363
+ return this;
364
+ }
365
+ }
366
+ if (Symbol.dispose) ActorFactory.prototype[Symbol.dispose] = ActorFactory.prototype.free;
367
+
368
+ export class ActorStateTransaction {
369
+ static __wrap(ptr) {
370
+ const obj = Object.create(ActorStateTransaction.prototype);
371
+ obj.__wbg_ptr = ptr;
372
+ ActorStateTransactionFinalization.register(obj, obj.__wbg_ptr, obj);
373
+ return obj;
374
+ }
375
+ __destroy_into_raw() {
376
+ const ptr = this.__wbg_ptr;
377
+ this.__wbg_ptr = 0;
378
+ ActorStateTransactionFinalization.unregister(this);
379
+ return ptr;
380
+ }
381
+ free() {
382
+ const ptr = this.__destroy_into_raw();
383
+ wasm.__wbg_actorstatetransaction_free(ptr, 0);
384
+ }
385
+ /**
386
+ * @param {any} payload
387
+ * @returns {Promise<void>}
388
+ */
389
+ commit(payload) {
390
+ const ret = wasm.actorstatetransaction_commit(this.__wbg_ptr, payload);
391
+ return ret;
392
+ }
393
+ /**
394
+ * @param {string} sql
395
+ * @param {any} params
396
+ * @returns {Promise<any>}
397
+ */
398
+ execute(sql, params) {
399
+ const ptr0 = passStringToWasm0(sql, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
400
+ const len0 = WASM_VECTOR_LEN;
401
+ const ret = wasm.actorstatetransaction_execute(this.__wbg_ptr, ptr0, len0, params);
402
+ return ret;
403
+ }
404
+ /**
405
+ * @returns {Promise<void>}
406
+ */
407
+ rollback() {
408
+ const ret = wasm.actorstatetransaction_rollback(this.__wbg_ptr);
409
+ return ret;
410
+ }
411
+ }
412
+ if (Symbol.dispose) ActorStateTransaction.prototype[Symbol.dispose] = ActorStateTransaction.prototype.free;
413
+
414
+ /**
415
+ * Registration returned by `CancellationToken.onCancelled`.
416
+ */
417
+ export class CancellationListener {
418
+ static __wrap(ptr) {
419
+ const obj = Object.create(CancellationListener.prototype);
420
+ obj.__wbg_ptr = ptr;
421
+ CancellationListenerFinalization.register(obj, obj.__wbg_ptr, obj);
422
+ return obj;
423
+ }
424
+ __destroy_into_raw() {
425
+ const ptr = this.__wbg_ptr;
426
+ this.__wbg_ptr = 0;
427
+ CancellationListenerFinalization.unregister(this);
428
+ return ptr;
429
+ }
430
+ free() {
431
+ const ptr = this.__destroy_into_raw();
432
+ wasm.__wbg_cancellationlistener_free(ptr, 0);
433
+ }
434
+ /**
435
+ * Stops waiting for cancellation without calling the callback.
436
+ */
437
+ release() {
438
+ wasm.cancellationlistener_release(this.__wbg_ptr);
439
+ }
440
+ }
441
+ if (Symbol.dispose) CancellationListener.prototype[Symbol.dispose] = CancellationListener.prototype.free;
442
+
443
+ export class CancellationToken {
444
+ static __wrap(ptr) {
445
+ const obj = Object.create(CancellationToken.prototype);
446
+ obj.__wbg_ptr = ptr;
447
+ CancellationTokenFinalization.register(obj, obj.__wbg_ptr, obj);
448
+ return obj;
449
+ }
450
+ __destroy_into_raw() {
451
+ const ptr = this.__wbg_ptr;
452
+ this.__wbg_ptr = 0;
453
+ CancellationTokenFinalization.unregister(this);
454
+ return ptr;
455
+ }
456
+ free() {
457
+ const ptr = this.__destroy_into_raw();
458
+ wasm.__wbg_cancellationtoken_free(ptr, 0);
459
+ }
460
+ /**
461
+ * @returns {boolean}
462
+ */
463
+ aborted() {
464
+ const ret = wasm.cancellationtoken_aborted(this.__wbg_ptr);
465
+ return ret !== 0;
466
+ }
467
+ cancel() {
468
+ wasm.cancellationtoken_cancel(this.__wbg_ptr);
469
+ }
470
+ constructor() {
471
+ const ret = wasm.cancellationtoken_new();
472
+ this.__wbg_ptr = ret;
473
+ CancellationTokenFinalization.register(this, this.__wbg_ptr, this);
474
+ return this;
475
+ }
476
+ /**
477
+ * Calls `callback` once when the token is cancelled. Release the returned
478
+ * listener when cancellation no longer matters; otherwise the waiting task
479
+ * and the callback stay alive until the token is cancelled.
480
+ * @param {Function} callback
481
+ * @returns {CancellationListener}
482
+ */
483
+ onCancelled(callback) {
484
+ const ret = wasm.cancellationtoken_onCancelled(this.__wbg_ptr, callback);
485
+ return CancellationListener.__wrap(ret);
486
+ }
487
+ }
488
+ if (Symbol.dispose) CancellationToken.prototype[Symbol.dispose] = CancellationToken.prototype.free;
489
+
490
+ export class ConnHandle {
491
+ static __wrap(ptr) {
492
+ const obj = Object.create(ConnHandle.prototype);
493
+ obj.__wbg_ptr = ptr;
494
+ ConnHandleFinalization.register(obj, obj.__wbg_ptr, obj);
495
+ return obj;
496
+ }
497
+ __destroy_into_raw() {
498
+ const ptr = this.__wbg_ptr;
499
+ this.__wbg_ptr = 0;
500
+ ConnHandleFinalization.unregister(this);
501
+ return ptr;
502
+ }
503
+ free() {
504
+ const ptr = this.__destroy_into_raw();
505
+ wasm.__wbg_connhandle_free(ptr, 0);
506
+ }
507
+ /**
508
+ * @param {string | null} [reason]
509
+ * @returns {Promise<void>}
510
+ */
511
+ disconnect(reason) {
512
+ var ptr0 = isLikeNone(reason) ? 0 : passStringToWasm0(reason, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
513
+ var len0 = WASM_VECTOR_LEN;
514
+ const ret = wasm.connhandle_disconnect(this.__wbg_ptr, ptr0, len0);
515
+ return ret;
516
+ }
517
+ /**
518
+ * @returns {string}
519
+ */
520
+ id() {
521
+ let deferred1_0;
522
+ let deferred1_1;
523
+ try {
524
+ const ret = wasm.connhandle_id(this.__wbg_ptr);
525
+ deferred1_0 = ret[0];
526
+ deferred1_1 = ret[1];
527
+ return getStringFromWasm0(ret[0], ret[1]);
528
+ } finally {
529
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
530
+ }
531
+ }
532
+ /**
533
+ * @returns {boolean}
534
+ */
535
+ isHibernatable() {
536
+ const ret = wasm.connhandle_isHibernatable(this.__wbg_ptr);
537
+ return ret !== 0;
538
+ }
539
+ /**
540
+ * @returns {Uint8Array}
541
+ */
542
+ params() {
543
+ const ret = wasm.connhandle_params(this.__wbg_ptr);
544
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
545
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
546
+ return v1;
547
+ }
548
+ /**
549
+ * @param {string} name
550
+ * @param {Uint8Array} args
551
+ */
552
+ send(name, args) {
553
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
554
+ const len0 = WASM_VECTOR_LEN;
555
+ const ptr1 = passArray8ToWasm0(args, wasm.__wbindgen_malloc);
556
+ const len1 = WASM_VECTOR_LEN;
557
+ wasm.connhandle_send(this.__wbg_ptr, ptr0, len0, ptr1, len1);
558
+ }
559
+ /**
560
+ * @param {Uint8Array} state
561
+ */
562
+ setState(state) {
563
+ const ptr0 = passArray8ToWasm0(state, wasm.__wbindgen_malloc);
564
+ const len0 = WASM_VECTOR_LEN;
565
+ wasm.connhandle_setState(this.__wbg_ptr, ptr0, len0);
566
+ }
567
+ /**
568
+ * @returns {Uint8Array}
569
+ */
570
+ state() {
571
+ const ret = wasm.connhandle_state(this.__wbg_ptr);
572
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
573
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
574
+ return v1;
575
+ }
576
+ }
577
+ if (Symbol.dispose) ConnHandle.prototype[Symbol.dispose] = ConnHandle.prototype.free;
578
+
579
+ export class CoreRegistry {
580
+ __destroy_into_raw() {
581
+ const ptr = this.__wbg_ptr;
582
+ this.__wbg_ptr = 0;
583
+ CoreRegistryFinalization.unregister(this);
584
+ return ptr;
585
+ }
586
+ free() {
587
+ const ptr = this.__destroy_into_raw();
588
+ wasm.__wbg_coreregistry_free(ptr, 0);
589
+ }
590
+ /**
591
+ * @param {any} req
592
+ * @param {Function} on_stream_event
593
+ * @param {CancellationToken} cancel_token
594
+ * @param {any} config
595
+ * @returns {Promise<any>}
596
+ */
597
+ handleServerlessRequest(req, on_stream_event, cancel_token, config) {
598
+ _assertClass(cancel_token, CancellationToken);
599
+ const ret = wasm.coreregistry_handleServerlessRequest(this.__wbg_ptr, req, on_stream_event, cancel_token.__wbg_ptr, config);
600
+ return ret;
601
+ }
602
+ constructor() {
603
+ const ret = wasm.coreregistry_new();
604
+ this.__wbg_ptr = ret;
605
+ CoreRegistryFinalization.register(this, this.__wbg_ptr, this);
606
+ return this;
607
+ }
608
+ /**
609
+ * @param {string} name
610
+ * @param {ActorFactory} factory
611
+ */
612
+ register(name, factory) {
613
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
614
+ const len0 = WASM_VECTOR_LEN;
615
+ _assertClass(factory, ActorFactory);
616
+ const ret = wasm.coreregistry_register(this.__wbg_ptr, ptr0, len0, factory.__wbg_ptr);
617
+ if (ret[1]) {
618
+ throw takeFromExternrefTable0(ret[0]);
619
+ }
620
+ }
621
+ /**
622
+ * @param {any} config
623
+ * @returns {Promise<void>}
624
+ */
625
+ serve(config) {
626
+ const ret = wasm.coreregistry_serve(this.__wbg_ptr, config);
627
+ return ret;
628
+ }
629
+ /**
630
+ * @returns {Promise<void>}
631
+ */
632
+ shutdown() {
633
+ const ret = wasm.coreregistry_shutdown(this.__wbg_ptr);
634
+ return ret;
635
+ }
636
+ }
637
+ if (Symbol.dispose) CoreRegistry.prototype[Symbol.dispose] = CoreRegistry.prototype.free;
638
+
639
+ export class Kv {
640
+ static __wrap(ptr) {
641
+ const obj = Object.create(Kv.prototype);
642
+ obj.__wbg_ptr = ptr;
643
+ KvFinalization.register(obj, obj.__wbg_ptr, obj);
644
+ return obj;
645
+ }
646
+ __destroy_into_raw() {
647
+ const ptr = this.__wbg_ptr;
648
+ this.__wbg_ptr = 0;
649
+ KvFinalization.unregister(this);
650
+ return ptr;
651
+ }
652
+ free() {
653
+ const ptr = this.__destroy_into_raw();
654
+ wasm.__wbg_kv_free(ptr, 0);
655
+ }
656
+ /**
657
+ * @param {Array<any>} keys
658
+ * @returns {Promise<void>}
659
+ */
660
+ batchDelete(keys) {
661
+ const ret = wasm.kv_batchDelete(this.__wbg_ptr, keys);
662
+ return ret;
663
+ }
664
+ /**
665
+ * @param {Array<any>} keys
666
+ * @returns {Promise<any>}
667
+ */
668
+ batchGet(keys) {
669
+ const ret = wasm.kv_batchGet(this.__wbg_ptr, keys);
670
+ return ret;
671
+ }
672
+ /**
673
+ * @param {Array<any>} entries
674
+ * @returns {Promise<void>}
675
+ */
676
+ batchPut(entries) {
677
+ const ret = wasm.kv_batchPut(this.__wbg_ptr, entries);
678
+ return ret;
679
+ }
680
+ /**
681
+ * @param {Uint8Array} start
682
+ * @param {Uint8Array} end
683
+ * @returns {Promise<void>}
684
+ */
685
+ deleteRange(start, end) {
686
+ const ptr0 = passArray8ToWasm0(start, wasm.__wbindgen_malloc);
687
+ const len0 = WASM_VECTOR_LEN;
688
+ const ptr1 = passArray8ToWasm0(end, wasm.__wbindgen_malloc);
689
+ const len1 = WASM_VECTOR_LEN;
690
+ const ret = wasm.kv_deleteRange(this.__wbg_ptr, ptr0, len0, ptr1, len1);
691
+ return ret;
692
+ }
693
+ /**
694
+ * @param {Uint8Array} key
695
+ * @returns {Promise<void>}
696
+ */
697
+ delete(key) {
698
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
699
+ const len0 = WASM_VECTOR_LEN;
700
+ const ret = wasm.kv_delete(this.__wbg_ptr, ptr0, len0);
701
+ return ret;
702
+ }
703
+ /**
704
+ * @param {Uint8Array} key
705
+ * @returns {Promise<any>}
706
+ */
707
+ get(key) {
708
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
709
+ const len0 = WASM_VECTOR_LEN;
710
+ const ret = wasm.kv_get(this.__wbg_ptr, ptr0, len0);
711
+ return ret;
712
+ }
713
+ /**
714
+ * @param {Uint8Array} prefix
715
+ * @param {any} options
716
+ * @returns {Promise<any>}
717
+ */
718
+ listPrefix(prefix, options) {
719
+ const ptr0 = passArray8ToWasm0(prefix, wasm.__wbindgen_malloc);
720
+ const len0 = WASM_VECTOR_LEN;
721
+ const ret = wasm.kv_listPrefix(this.__wbg_ptr, ptr0, len0, options);
722
+ return ret;
723
+ }
724
+ /**
725
+ * @param {Uint8Array} start
726
+ * @param {Uint8Array} end
727
+ * @param {any} options
728
+ * @returns {Promise<any>}
729
+ */
730
+ listRange(start, end, options) {
731
+ const ptr0 = passArray8ToWasm0(start, wasm.__wbindgen_malloc);
732
+ const len0 = WASM_VECTOR_LEN;
733
+ const ptr1 = passArray8ToWasm0(end, wasm.__wbindgen_malloc);
734
+ const len1 = WASM_VECTOR_LEN;
735
+ const ret = wasm.kv_listRange(this.__wbg_ptr, ptr0, len0, ptr1, len1, options);
736
+ return ret;
737
+ }
738
+ /**
739
+ * @param {Uint8Array} key
740
+ * @param {Uint8Array} value
741
+ * @returns {Promise<void>}
742
+ */
743
+ put(key, value) {
744
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
745
+ const len0 = WASM_VECTOR_LEN;
746
+ const ptr1 = passArray8ToWasm0(value, wasm.__wbindgen_malloc);
747
+ const len1 = WASM_VECTOR_LEN;
748
+ const ret = wasm.kv_put(this.__wbg_ptr, ptr0, len0, ptr1, len1);
749
+ return ret;
750
+ }
751
+ }
752
+ if (Symbol.dispose) Kv.prototype[Symbol.dispose] = Kv.prototype.free;
753
+
754
+ export class Queue {
755
+ static __wrap(ptr) {
756
+ const obj = Object.create(Queue.prototype);
757
+ obj.__wbg_ptr = ptr;
758
+ QueueFinalization.register(obj, obj.__wbg_ptr, obj);
759
+ return obj;
760
+ }
761
+ __destroy_into_raw() {
762
+ const ptr = this.__wbg_ptr;
763
+ this.__wbg_ptr = 0;
764
+ QueueFinalization.unregister(this);
765
+ return ptr;
766
+ }
767
+ free() {
768
+ const ptr = this.__destroy_into_raw();
769
+ wasm.__wbg_queue_free(ptr, 0);
770
+ }
771
+ /**
772
+ * @param {bigint} message_id
773
+ * @param {string} expected_name
774
+ * @param {Uint8Array | null} [response]
775
+ * @returns {Promise<boolean>}
776
+ */
777
+ completePersisted(message_id, expected_name, response) {
778
+ const ptr0 = passStringToWasm0(expected_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
779
+ const len0 = WASM_VECTOR_LEN;
780
+ var ptr1 = isLikeNone(response) ? 0 : passArray8ToWasm0(response, wasm.__wbindgen_malloc);
781
+ var len1 = WASM_VECTOR_LEN;
782
+ const ret = wasm.queue_completePersisted(this.__wbg_ptr, message_id, ptr0, len0, ptr1, len1);
783
+ return ret;
784
+ }
785
+ /**
786
+ * @param {string} name
787
+ * @param {Uint8Array} body
788
+ * @param {any} options
789
+ * @param {CancellationToken | null} [signal]
790
+ * @returns {Promise<Uint8Array | undefined>}
791
+ */
792
+ enqueueAndWait(name, body, options, signal) {
793
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
794
+ const len0 = WASM_VECTOR_LEN;
795
+ const ptr1 = passArray8ToWasm0(body, wasm.__wbindgen_malloc);
796
+ const len1 = WASM_VECTOR_LEN;
797
+ let ptr2 = 0;
798
+ if (!isLikeNone(signal)) {
799
+ _assertClass(signal, CancellationToken);
800
+ ptr2 = signal.__destroy_into_raw();
801
+ }
802
+ const ret = wasm.queue_enqueueAndWait(this.__wbg_ptr, ptr0, len0, ptr1, len1, options, ptr2);
803
+ return ret;
804
+ }
805
+ /**
806
+ * @returns {Promise<Array<any>>}
807
+ */
808
+ inspectMessages() {
809
+ const ret = wasm.queue_inspectMessages(this.__wbg_ptr);
810
+ return ret;
811
+ }
812
+ /**
813
+ * @returns {number}
814
+ */
815
+ maxSize() {
816
+ const ret = wasm.queue_maxSize(this.__wbg_ptr);
817
+ return ret >>> 0;
818
+ }
819
+ /**
820
+ * @param {any} options
821
+ * @param {CancellationToken | null} [signal]
822
+ * @returns {Promise<Array<any>>}
823
+ */
824
+ nextBatch(options, signal) {
825
+ let ptr0 = 0;
826
+ if (!isLikeNone(signal)) {
827
+ _assertClass(signal, CancellationToken);
828
+ ptr0 = signal.__destroy_into_raw();
829
+ }
830
+ const ret = wasm.queue_nextBatch(this.__wbg_ptr, options, ptr0);
831
+ return ret;
832
+ }
833
+ /**
834
+ * @returns {Promise<void>}
835
+ */
836
+ reset() {
837
+ const ret = wasm.queue_reset(this.__wbg_ptr);
838
+ return ret;
839
+ }
840
+ /**
841
+ * @param {string} name
842
+ * @param {Uint8Array} body
843
+ * @returns {Promise<QueueMessage>}
844
+ */
845
+ send(name, body) {
846
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
847
+ const len0 = WASM_VECTOR_LEN;
848
+ const ptr1 = passArray8ToWasm0(body, wasm.__wbindgen_malloc);
849
+ const len1 = WASM_VECTOR_LEN;
850
+ const ret = wasm.queue_send(this.__wbg_ptr, ptr0, len0, ptr1, len1);
851
+ return ret;
852
+ }
853
+ /**
854
+ * @param {any} options
855
+ * @returns {Array<any>}
856
+ */
857
+ tryNextBatch(options) {
858
+ const ret = wasm.queue_tryNextBatch(this.__wbg_ptr, options);
859
+ if (ret[2]) {
860
+ throw takeFromExternrefTable0(ret[1]);
861
+ }
862
+ return takeFromExternrefTable0(ret[0]);
863
+ }
864
+ /**
865
+ * @param {any} names
866
+ * @param {any} options
867
+ * @returns {Promise<void>}
868
+ */
869
+ waitForNamesAvailable(names, options) {
870
+ const ret = wasm.queue_waitForNamesAvailable(this.__wbg_ptr, names, options);
871
+ return ret;
872
+ }
873
+ /**
874
+ * @param {any} names
875
+ * @param {any} options
876
+ * @param {CancellationToken | null} [signal]
877
+ * @returns {Promise<QueueMessage>}
878
+ */
879
+ waitForNames(names, options, signal) {
880
+ let ptr0 = 0;
881
+ if (!isLikeNone(signal)) {
882
+ _assertClass(signal, CancellationToken);
883
+ ptr0 = signal.__destroy_into_raw();
884
+ }
885
+ const ret = wasm.queue_waitForNames(this.__wbg_ptr, names, options, ptr0);
886
+ return ret;
887
+ }
888
+ }
889
+ if (Symbol.dispose) Queue.prototype[Symbol.dispose] = Queue.prototype.free;
890
+
891
+ export class QueueMessage {
892
+ static __wrap(ptr) {
893
+ const obj = Object.create(QueueMessage.prototype);
894
+ obj.__wbg_ptr = ptr;
895
+ QueueMessageFinalization.register(obj, obj.__wbg_ptr, obj);
896
+ return obj;
897
+ }
898
+ __destroy_into_raw() {
899
+ const ptr = this.__wbg_ptr;
900
+ this.__wbg_ptr = 0;
901
+ QueueMessageFinalization.unregister(this);
902
+ return ptr;
903
+ }
904
+ free() {
905
+ const ptr = this.__destroy_into_raw();
906
+ wasm.__wbg_queuemessage_free(ptr, 0);
907
+ }
908
+ /**
909
+ * @returns {Uint8Array}
910
+ */
911
+ body() {
912
+ const ret = wasm.queuemessage_body(this.__wbg_ptr);
913
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
914
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
915
+ return v1;
916
+ }
917
+ /**
918
+ * @param {any} response
919
+ * @returns {Promise<void>}
920
+ */
921
+ complete(response) {
922
+ const ret = wasm.queuemessage_complete(this.__wbg_ptr, response);
923
+ return ret;
924
+ }
925
+ /**
926
+ * @returns {number}
927
+ */
928
+ createdAt() {
929
+ const ret = wasm.queuemessage_createdAt(this.__wbg_ptr);
930
+ return ret;
931
+ }
932
+ /**
933
+ * @returns {bigint}
934
+ */
935
+ id() {
936
+ const ret = wasm.queuemessage_id(this.__wbg_ptr);
937
+ return BigInt.asUintN(64, ret);
938
+ }
939
+ /**
940
+ * @returns {boolean}
941
+ */
942
+ isCompletable() {
943
+ const ret = wasm.queuemessage_isCompletable(this.__wbg_ptr);
944
+ return ret !== 0;
945
+ }
946
+ /**
947
+ * @returns {string}
948
+ */
949
+ name() {
950
+ let deferred1_0;
951
+ let deferred1_1;
952
+ try {
953
+ const ret = wasm.queuemessage_name(this.__wbg_ptr);
954
+ deferred1_0 = ret[0];
955
+ deferred1_1 = ret[1];
956
+ return getStringFromWasm0(ret[0], ret[1]);
957
+ } finally {
958
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
959
+ }
960
+ }
961
+ }
962
+ if (Symbol.dispose) QueueMessage.prototype[Symbol.dispose] = QueueMessage.prototype.free;
963
+
964
+ export class Schedule {
965
+ static __wrap(ptr) {
966
+ const obj = Object.create(Schedule.prototype);
967
+ obj.__wbg_ptr = ptr;
968
+ ScheduleFinalization.register(obj, obj.__wbg_ptr, obj);
969
+ return obj;
970
+ }
971
+ __destroy_into_raw() {
972
+ const ptr = this.__wbg_ptr;
973
+ this.__wbg_ptr = 0;
974
+ ScheduleFinalization.unregister(this);
975
+ return ptr;
976
+ }
977
+ free() {
978
+ const ptr = this.__destroy_into_raw();
979
+ wasm.__wbg_schedule_free(ptr, 0);
980
+ }
981
+ /**
982
+ * @param {number} duration_ms
983
+ * @param {string} action_name
984
+ * @param {Uint8Array} args
985
+ * @returns {Promise<string>}
986
+ */
987
+ after(duration_ms, action_name, args) {
988
+ const ptr0 = passStringToWasm0(action_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
989
+ const len0 = WASM_VECTOR_LEN;
990
+ const ptr1 = passArray8ToWasm0(args, wasm.__wbindgen_malloc);
991
+ const len1 = WASM_VECTOR_LEN;
992
+ const ret = wasm.schedule_after(this.__wbg_ptr, duration_ms, ptr0, len0, ptr1, len1);
993
+ return ret;
994
+ }
995
+ /**
996
+ * @param {number} timestamp_ms
997
+ * @param {string} action_name
998
+ * @param {Uint8Array} args
999
+ * @returns {Promise<string>}
1000
+ */
1001
+ at(timestamp_ms, action_name, args) {
1002
+ const ptr0 = passStringToWasm0(action_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1003
+ const len0 = WASM_VECTOR_LEN;
1004
+ const ptr1 = passArray8ToWasm0(args, wasm.__wbindgen_malloc);
1005
+ const len1 = WASM_VECTOR_LEN;
1006
+ const ret = wasm.schedule_at(this.__wbg_ptr, timestamp_ms, ptr0, len0, ptr1, len1);
1007
+ return ret;
1008
+ }
1009
+ /**
1010
+ * @param {string} id
1011
+ * @returns {Promise<boolean>}
1012
+ */
1013
+ cancel(id) {
1014
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1015
+ const len0 = WASM_VECTOR_LEN;
1016
+ const ret = wasm.schedule_cancel(this.__wbg_ptr, ptr0, len0);
1017
+ return ret;
1018
+ }
1019
+ /**
1020
+ * @param {string} name
1021
+ * @returns {Promise<boolean>}
1022
+ */
1023
+ cronDelete(name) {
1024
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1025
+ const len0 = WASM_VECTOR_LEN;
1026
+ const ret = wasm.schedule_cronDelete(this.__wbg_ptr, ptr0, len0);
1027
+ return ret;
1028
+ }
1029
+ /**
1030
+ * @param {string} name
1031
+ * @param {number} interval_ms
1032
+ * @param {string} action_name
1033
+ * @param {Uint8Array} args
1034
+ * @param {number | null} [max_history]
1035
+ * @returns {Promise<void>}
1036
+ */
1037
+ cronEvery(name, interval_ms, action_name, args, max_history) {
1038
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1039
+ const len0 = WASM_VECTOR_LEN;
1040
+ const ptr1 = passStringToWasm0(action_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1041
+ const len1 = WASM_VECTOR_LEN;
1042
+ const ptr2 = passArray8ToWasm0(args, wasm.__wbindgen_malloc);
1043
+ const len2 = WASM_VECTOR_LEN;
1044
+ const ret = wasm.schedule_cronEvery(this.__wbg_ptr, ptr0, len0, interval_ms, ptr1, len1, ptr2, len2, !isLikeNone(max_history), isLikeNone(max_history) ? 0 : max_history);
1045
+ return ret;
1046
+ }
1047
+ /**
1048
+ * @param {string} name
1049
+ * @returns {Promise<any>}
1050
+ */
1051
+ cronGet(name) {
1052
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1053
+ const len0 = WASM_VECTOR_LEN;
1054
+ const ret = wasm.schedule_cronGet(this.__wbg_ptr, ptr0, len0);
1055
+ return ret;
1056
+ }
1057
+ /**
1058
+ * @param {string} name
1059
+ * @param {number | null} [limit]
1060
+ * @returns {Promise<any>}
1061
+ */
1062
+ cronHistory(name, limit) {
1063
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1064
+ const len0 = WASM_VECTOR_LEN;
1065
+ const ret = wasm.schedule_cronHistory(this.__wbg_ptr, ptr0, len0, !isLikeNone(limit), isLikeNone(limit) ? 0 : limit);
1066
+ return ret;
1067
+ }
1068
+ /**
1069
+ * @returns {Promise<any>}
1070
+ */
1071
+ cronList() {
1072
+ const ret = wasm.schedule_cronList(this.__wbg_ptr);
1073
+ return ret;
1074
+ }
1075
+ /**
1076
+ * @param {string} name
1077
+ * @param {string} expression
1078
+ * @param {string | null | undefined} timezone
1079
+ * @param {string} action_name
1080
+ * @param {Uint8Array} args
1081
+ * @param {number | null} [max_history]
1082
+ * @returns {Promise<void>}
1083
+ */
1084
+ cronSet(name, expression, timezone, action_name, args, max_history) {
1085
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1086
+ const len0 = WASM_VECTOR_LEN;
1087
+ const ptr1 = passStringToWasm0(expression, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1088
+ const len1 = WASM_VECTOR_LEN;
1089
+ var ptr2 = isLikeNone(timezone) ? 0 : passStringToWasm0(timezone, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1090
+ var len2 = WASM_VECTOR_LEN;
1091
+ const ptr3 = passStringToWasm0(action_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1092
+ const len3 = WASM_VECTOR_LEN;
1093
+ const ptr4 = passArray8ToWasm0(args, wasm.__wbindgen_malloc);
1094
+ const len4 = WASM_VECTOR_LEN;
1095
+ const ret = wasm.schedule_cronSet(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, !isLikeNone(max_history), isLikeNone(max_history) ? 0 : max_history);
1096
+ return ret;
1097
+ }
1098
+ /**
1099
+ * @param {string} id
1100
+ * @returns {Promise<any>}
1101
+ */
1102
+ get(id) {
1103
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1104
+ const len0 = WASM_VECTOR_LEN;
1105
+ const ret = wasm.schedule_get(this.__wbg_ptr, ptr0, len0);
1106
+ return ret;
1107
+ }
1108
+ /**
1109
+ * @returns {Promise<any>}
1110
+ */
1111
+ list() {
1112
+ const ret = wasm.schedule_list(this.__wbg_ptr);
1113
+ return ret;
1114
+ }
1115
+ }
1116
+ if (Symbol.dispose) Schedule.prototype[Symbol.dispose] = Schedule.prototype.free;
1117
+
1118
+ export class SqliteDb {
1119
+ static __wrap(ptr) {
1120
+ const obj = Object.create(SqliteDb.prototype);
1121
+ obj.__wbg_ptr = ptr;
1122
+ SqliteDbFinalization.register(obj, obj.__wbg_ptr, obj);
1123
+ return obj;
1124
+ }
1125
+ __destroy_into_raw() {
1126
+ const ptr = this.__wbg_ptr;
1127
+ this.__wbg_ptr = 0;
1128
+ SqliteDbFinalization.unregister(this);
1129
+ return ptr;
1130
+ }
1131
+ free() {
1132
+ const ptr = this.__destroy_into_raw();
1133
+ wasm.__wbg_sqlitedb_free(ptr, 0);
1134
+ }
1135
+ /**
1136
+ * @param {number | null} [timeout_ms]
1137
+ * @param {string | null} [name]
1138
+ * @returns {Promise<SqliteTransaction>}
1139
+ */
1140
+ beginTransaction(timeout_ms, name) {
1141
+ var ptr0 = isLikeNone(name) ? 0 : passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1142
+ var len0 = WASM_VECTOR_LEN;
1143
+ const ret = wasm.sqlitedb_beginTransaction(this.__wbg_ptr, !isLikeNone(timeout_ms), isLikeNone(timeout_ms) ? 0 : timeout_ms, ptr0, len0);
1144
+ return ret;
1145
+ }
1146
+ /**
1147
+ * @returns {Promise<void>}
1148
+ */
1149
+ close() {
1150
+ const ret = wasm.sqlitedb_close(this.__wbg_ptr);
1151
+ return ret;
1152
+ }
1153
+ /**
1154
+ * @param {string} sql
1155
+ * @returns {Promise<any>}
1156
+ */
1157
+ exec(sql) {
1158
+ const ptr0 = passStringToWasm0(sql, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1159
+ const len0 = WASM_VECTOR_LEN;
1160
+ const ret = wasm.sqlitedb_exec(this.__wbg_ptr, ptr0, len0);
1161
+ return ret;
1162
+ }
1163
+ /**
1164
+ * @param {any} statements
1165
+ * @returns {Promise<any>}
1166
+ */
1167
+ executeBatch(statements) {
1168
+ const ret = wasm.sqlitedb_executeBatch(this.__wbg_ptr, statements);
1169
+ return ret;
1170
+ }
1171
+ /**
1172
+ * @param {string} sql
1173
+ * @param {any} params
1174
+ * @returns {Promise<any>}
1175
+ */
1176
+ execute(sql, params) {
1177
+ const ptr0 = passStringToWasm0(sql, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1178
+ const len0 = WASM_VECTOR_LEN;
1179
+ const ret = wasm.sqlitedb_execute(this.__wbg_ptr, ptr0, len0, params);
1180
+ return ret;
1181
+ }
1182
+ /**
1183
+ * @param {string} sql
1184
+ * @param {any} params
1185
+ * @returns {Promise<any>}
1186
+ */
1187
+ query(sql, params) {
1188
+ const ptr0 = passStringToWasm0(sql, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1189
+ const len0 = WASM_VECTOR_LEN;
1190
+ const ret = wasm.sqlitedb_query(this.__wbg_ptr, ptr0, len0, params);
1191
+ return ret;
1192
+ }
1193
+ /**
1194
+ * @param {string} sql
1195
+ * @param {any} params
1196
+ * @returns {Promise<any>}
1197
+ */
1198
+ run(sql, params) {
1199
+ const ptr0 = passStringToWasm0(sql, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1200
+ const len0 = WASM_VECTOR_LEN;
1201
+ const ret = wasm.sqlitedb_run(this.__wbg_ptr, ptr0, len0, params);
1202
+ return ret;
1203
+ }
1204
+ }
1205
+ if (Symbol.dispose) SqliteDb.prototype[Symbol.dispose] = SqliteDb.prototype.free;
1206
+
1207
+ export class SqliteTransaction {
1208
+ static __wrap(ptr) {
1209
+ const obj = Object.create(SqliteTransaction.prototype);
1210
+ obj.__wbg_ptr = ptr;
1211
+ SqliteTransactionFinalization.register(obj, obj.__wbg_ptr, obj);
1212
+ return obj;
1213
+ }
1214
+ __destroy_into_raw() {
1215
+ const ptr = this.__wbg_ptr;
1216
+ this.__wbg_ptr = 0;
1217
+ SqliteTransactionFinalization.unregister(this);
1218
+ return ptr;
1219
+ }
1220
+ free() {
1221
+ const ptr = this.__destroy_into_raw();
1222
+ wasm.__wbg_sqlitetransaction_free(ptr, 0);
1223
+ }
1224
+ /**
1225
+ * @returns {Promise<void>}
1226
+ */
1227
+ commit() {
1228
+ const ret = wasm.sqlitetransaction_commit(this.__wbg_ptr);
1229
+ return ret;
1230
+ }
1231
+ /**
1232
+ * @param {string} sql
1233
+ * @returns {Promise<any>}
1234
+ */
1235
+ exec(sql) {
1236
+ const ptr0 = passStringToWasm0(sql, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1237
+ const len0 = WASM_VECTOR_LEN;
1238
+ const ret = wasm.sqlitetransaction_exec(this.__wbg_ptr, ptr0, len0);
1239
+ return ret;
1240
+ }
1241
+ /**
1242
+ * @param {string} sql
1243
+ * @param {any} params
1244
+ * @returns {Promise<any>}
1245
+ */
1246
+ execute(sql, params) {
1247
+ const ptr0 = passStringToWasm0(sql, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1248
+ const len0 = WASM_VECTOR_LEN;
1249
+ const ret = wasm.sqlitetransaction_execute(this.__wbg_ptr, ptr0, len0, params);
1250
+ return ret;
1251
+ }
1252
+ /**
1253
+ * @returns {Promise<void>}
1254
+ */
1255
+ rollback() {
1256
+ const ret = wasm.sqlitetransaction_rollback(this.__wbg_ptr);
1257
+ return ret;
1258
+ }
1259
+ }
1260
+ if (Symbol.dispose) SqliteTransaction.prototype[Symbol.dispose] = SqliteTransaction.prototype.free;
1261
+
1262
+ export class WebSocketHandle {
1263
+ static __wrap(ptr) {
1264
+ const obj = Object.create(WebSocketHandle.prototype);
1265
+ obj.__wbg_ptr = ptr;
1266
+ WebSocketHandleFinalization.register(obj, obj.__wbg_ptr, obj);
1267
+ return obj;
1268
+ }
1269
+ __destroy_into_raw() {
1270
+ const ptr = this.__wbg_ptr;
1271
+ this.__wbg_ptr = 0;
1272
+ WebSocketHandleFinalization.unregister(this);
1273
+ return ptr;
1274
+ }
1275
+ free() {
1276
+ const ptr = this.__destroy_into_raw();
1277
+ wasm.__wbg_websockethandle_free(ptr, 0);
1278
+ }
1279
+ /**
1280
+ * @param {number | null} [code]
1281
+ * @param {string | null} [reason]
1282
+ * @returns {Promise<void>}
1283
+ */
1284
+ close(code, reason) {
1285
+ var ptr0 = isLikeNone(reason) ? 0 : passStringToWasm0(reason, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1286
+ var len0 = WASM_VECTOR_LEN;
1287
+ const ret = wasm.websockethandle_close(this.__wbg_ptr, isLikeNone(code) ? 0xFFFFFF : code, ptr0, len0);
1288
+ return ret;
1289
+ }
1290
+ /**
1291
+ * @param {Uint8Array} data
1292
+ * @param {boolean} binary
1293
+ */
1294
+ send(data, binary) {
1295
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
1296
+ const len0 = WASM_VECTOR_LEN;
1297
+ const ret = wasm.websockethandle_send(this.__wbg_ptr, ptr0, len0, binary);
1298
+ if (ret[1]) {
1299
+ throw takeFromExternrefTable0(ret[0]);
1300
+ }
1301
+ }
1302
+ /**
1303
+ * @param {Function} callback
1304
+ */
1305
+ setEventCallback(callback) {
1306
+ wasm.websockethandle_setEventCallback(this.__wbg_ptr, callback);
1307
+ }
1308
+ }
1309
+ if (Symbol.dispose) WebSocketHandle.prototype[Symbol.dispose] = WebSocketHandle.prototype.free;
1310
+
1311
+ /**
1312
+ * @param {Promise<any>} promise
1313
+ * @returns {Promise<any>}
1314
+ */
1315
+ export function awaitPromise(promise) {
1316
+ const ret = wasm.awaitPromise(promise);
1317
+ return ret;
1318
+ }
1319
+
1320
+ /**
1321
+ * @returns {string}
1322
+ */
1323
+ export function bridgeRivetErrorPrefix() {
1324
+ let deferred1_0;
1325
+ let deferred1_1;
1326
+ try {
1327
+ const ret = wasm.bridgeRivetErrorPrefix();
1328
+ deferred1_0 = ret[0];
1329
+ deferred1_1 = ret[1];
1330
+ return getStringFromWasm0(ret[0], ret[1]);
1331
+ } finally {
1332
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1333
+ }
1334
+ }
1335
+
1336
+ /**
1337
+ * @param {Uint8Array} bytes
1338
+ * @returns {Uint8Array}
1339
+ */
1340
+ export function roundTripBytes(bytes) {
1341
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
1342
+ const len0 = WASM_VECTOR_LEN;
1343
+ const ret = wasm.roundTripBytes(ptr0, len0);
1344
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1345
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1346
+ return v2;
1347
+ }
1348
+
1349
+ export function start() {
1350
+ wasm.start();
1351
+ }
1352
+
1353
+ /**
1354
+ * @param {Uint8Array} bytes
1355
+ * @returns {Uint8Array}
1356
+ */
1357
+ export function uint8ArrayFromBytes(bytes) {
1358
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
1359
+ const len0 = WASM_VECTOR_LEN;
1360
+ const ret = wasm.uint8ArrayFromBytes(ptr0, len0);
1361
+ return ret;
1362
+ }
1363
+ function __wbg_get_imports() {
1364
+ const import0 = {
1365
+ __proto__: null,
1366
+ __wbg_Error_30c8987f7c2ed4e2: function(arg0, arg1) {
1367
+ const ret = Error(getStringFromWasm0(arg0, arg1));
1368
+ return ret;
1369
+ },
1370
+ __wbg_Number_14af1003b8dd5ead: function(arg0) {
1371
+ const ret = Number(arg0);
1372
+ return ret;
1373
+ },
1374
+ __wbg_String_8564e559799eccda: function(arg0, arg1) {
1375
+ const ret = String(arg1);
1376
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1377
+ const len1 = WASM_VECTOR_LEN;
1378
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1379
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1380
+ },
1381
+ __wbg___wbindgen_boolean_get_5b446f51afd21013: function(arg0) {
1382
+ const v = arg0;
1383
+ const ret = typeof(v) === 'boolean' ? v : undefined;
1384
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
1385
+ },
1386
+ __wbg___wbindgen_debug_string_4687d8d8c2017d52: function(arg0, arg1) {
1387
+ const ret = debugString(arg1);
1388
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1389
+ const len1 = WASM_VECTOR_LEN;
1390
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1391
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1392
+ },
1393
+ __wbg___wbindgen_in_92f62ee1427d9e49: function(arg0, arg1) {
1394
+ const ret = arg0 in arg1;
1395
+ return ret;
1396
+ },
1397
+ __wbg___wbindgen_is_function_1f9d30630b8b1d3d: function(arg0) {
1398
+ const ret = typeof(arg0) === 'function';
1399
+ return ret;
1400
+ },
1401
+ __wbg___wbindgen_is_null_e343b7d08827ba72: function(arg0) {
1402
+ const ret = arg0 === null;
1403
+ return ret;
1404
+ },
1405
+ __wbg___wbindgen_is_object_3c45d4f2dde4e749: function(arg0) {
1406
+ const val = arg0;
1407
+ const ret = typeof(val) === 'object' && val !== null;
1408
+ return ret;
1409
+ },
1410
+ __wbg___wbindgen_is_string_90b56bc79aad6f6c: function(arg0) {
1411
+ const ret = typeof(arg0) === 'string';
1412
+ return ret;
1413
+ },
1414
+ __wbg___wbindgen_is_undefined_8865fb403f8fe9d8: function(arg0) {
1415
+ const ret = arg0 === undefined;
1416
+ return ret;
1417
+ },
1418
+ __wbg___wbindgen_jsval_loose_eq_677f21e468d6b461: function(arg0, arg1) {
1419
+ const ret = arg0 == arg1;
1420
+ return ret;
1421
+ },
1422
+ __wbg___wbindgen_number_get_2e0e7dee9f701a71: function(arg0, arg1) {
1423
+ const obj = arg1;
1424
+ const ret = typeof(obj) === 'number' ? obj : undefined;
1425
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
1426
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1427
+ },
1428
+ __wbg___wbindgen_string_get_0380ccaa2f57f0d9: function(arg0, arg1) {
1429
+ const obj = arg1;
1430
+ const ret = typeof(obj) === 'string' ? obj : undefined;
1431
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1432
+ var len1 = WASM_VECTOR_LEN;
1433
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1434
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1435
+ },
1436
+ __wbg___wbindgen_throw_41e9ee4f547fc59a: function(arg0, arg1) {
1437
+ throw new Error(getStringFromWasm0(arg0, arg1));
1438
+ },
1439
+ __wbg__wbg_cb_unref_dcc1a90847f04c41: function(arg0) {
1440
+ arg0._wbg_cb_unref();
1441
+ },
1442
+ __wbg_actorcontext_new: function(arg0) {
1443
+ const ret = ActorContext.__wrap(arg0);
1444
+ return ret;
1445
+ },
1446
+ __wbg_actorstatetransaction_new: function(arg0) {
1447
+ const ret = ActorStateTransaction.__wrap(arg0);
1448
+ return ret;
1449
+ },
1450
+ __wbg_buffer_56ec2905a66f58b9: function(arg0) {
1451
+ const ret = arg0.buffer;
1452
+ return ret;
1453
+ },
1454
+ __wbg_bufferedAmount_64b8a4229f549d4b: function(arg0) {
1455
+ const ret = arg0.bufferedAmount;
1456
+ return ret;
1457
+ },
1458
+ __wbg_call_1875a20c43a36133: function() { return handleError(function (arg0, arg1, arg2, arg3) {
1459
+ const ret = arg0.call(arg1, arg2, arg3);
1460
+ return ret;
1461
+ }, arguments); },
1462
+ __wbg_call_187d372bd5fdd4aa: function() { return handleError(function (arg0, arg1, arg2) {
1463
+ const ret = arg0.call(arg1, arg2);
1464
+ return ret;
1465
+ }, arguments); },
1466
+ __wbg_call_6137034ef55c9d0f: function() { return handleError(function (arg0, arg1) {
1467
+ const ret = arg0.call(arg1);
1468
+ return ret;
1469
+ }, arguments); },
1470
+ __wbg_cancellationtoken_new: function(arg0) {
1471
+ const ret = CancellationToken.__wrap(arg0);
1472
+ return ret;
1473
+ },
1474
+ __wbg_close_150f701b1a60e0ac: function() { return handleError(function (arg0, arg1, arg2, arg3) {
1475
+ arg0.close(arg1, getStringFromWasm0(arg2, arg3));
1476
+ }, arguments); },
1477
+ __wbg_close_d3ed56b5763be5ae: function() { return handleError(function (arg0) {
1478
+ arg0.close();
1479
+ }, arguments); },
1480
+ __wbg_code_4cb6dbcfceec1eac: function(arg0) {
1481
+ const ret = arg0.code;
1482
+ return ret;
1483
+ },
1484
+ __wbg_connhandle_new: function(arg0) {
1485
+ const ret = ConnHandle.__wrap(arg0);
1486
+ return ret;
1487
+ },
1488
+ __wbg_construct_2cc135b78387ed16: function() { return handleError(function (arg0, arg1) {
1489
+ const ret = Reflect.construct(arg0, arg1);
1490
+ return ret;
1491
+ }, arguments); },
1492
+ __wbg_crypto_38df2bab126b63dc: function(arg0) {
1493
+ const ret = arg0.crypto;
1494
+ return ret;
1495
+ },
1496
+ __wbg_data_522f7abc70721269: function(arg0) {
1497
+ const ret = arg0.data;
1498
+ return ret;
1499
+ },
1500
+ __wbg_done_b41a1d26cdb37fb6: function(arg0) {
1501
+ const ret = arg0.done;
1502
+ return ret;
1503
+ },
1504
+ __wbg_error_757e9472f8410341: function(arg0, arg1) {
1505
+ let deferred0_0;
1506
+ let deferred0_1;
1507
+ try {
1508
+ deferred0_0 = arg0;
1509
+ deferred0_1 = arg1;
1510
+ console.error(getStringFromWasm0(arg0, arg1));
1511
+ } finally {
1512
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
1513
+ }
1514
+ },
1515
+ __wbg_getRandomValues_869eb80731672410: function() { return handleError(function (arg0, arg1) {
1516
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
1517
+ }, arguments); },
1518
+ __wbg_getRandomValues_c44a50d8cfdaebeb: function() { return handleError(function (arg0, arg1) {
1519
+ arg0.getRandomValues(arg1);
1520
+ }, arguments); },
1521
+ __wbg_get_31af05bd4842a84f: function() { return handleError(function (arg0, arg1) {
1522
+ const ret = Reflect.get(arg0, arg1);
1523
+ return ret;
1524
+ }, arguments); },
1525
+ __wbg_get_658f6698067d9515: function() { return handleError(function (arg0, arg1) {
1526
+ const ret = Reflect.get(arg0, arg1);
1527
+ return ret;
1528
+ }, arguments); },
1529
+ __wbg_get_6c896e0571ddae51: function(arg0, arg1) {
1530
+ const ret = arg0[arg1 >>> 0];
1531
+ return ret;
1532
+ },
1533
+ __wbg_get_unchecked_288889d017702237: function(arg0, arg1) {
1534
+ const ret = arg0[arg1 >>> 0];
1535
+ return ret;
1536
+ },
1537
+ __wbg_get_with_ref_key_6412cf3094599694: function(arg0, arg1) {
1538
+ const ret = arg0[arg1];
1539
+ return ret;
1540
+ },
1541
+ __wbg_instanceof_ArrayBuffer_a99f175873e5d9b8: function(arg0) {
1542
+ let result;
1543
+ try {
1544
+ result = arg0 instanceof ArrayBuffer;
1545
+ } catch (_) {
1546
+ result = false;
1547
+ }
1548
+ const ret = result;
1549
+ return ret;
1550
+ },
1551
+ __wbg_instanceof_Error_80a725f81f2e102d: function(arg0) {
1552
+ let result;
1553
+ try {
1554
+ result = arg0 instanceof Error;
1555
+ } catch (_) {
1556
+ result = false;
1557
+ }
1558
+ const ret = result;
1559
+ return ret;
1560
+ },
1561
+ __wbg_instanceof_Object_67a83cdc00c5d141: function(arg0) {
1562
+ let result;
1563
+ try {
1564
+ result = arg0 instanceof Object;
1565
+ } catch (_) {
1566
+ result = false;
1567
+ }
1568
+ const ret = result;
1569
+ return ret;
1570
+ },
1571
+ __wbg_instanceof_Promise_e1dc6893aa1ece28: function(arg0) {
1572
+ let result;
1573
+ try {
1574
+ result = arg0 instanceof Promise;
1575
+ } catch (_) {
1576
+ result = false;
1577
+ }
1578
+ const ret = result;
1579
+ return ret;
1580
+ },
1581
+ __wbg_instanceof_Uint8Array_828cef2aaacafc31: function(arg0) {
1582
+ let result;
1583
+ try {
1584
+ result = arg0 instanceof Uint8Array;
1585
+ } catch (_) {
1586
+ result = false;
1587
+ }
1588
+ const ret = result;
1589
+ return ret;
1590
+ },
1591
+ __wbg_isArray_e15a2ff68ffdbef2: function(arg0) {
1592
+ const ret = Array.isArray(arg0);
1593
+ return ret;
1594
+ },
1595
+ __wbg_isSafeInteger_717808ad6a54bd9e: function(arg0) {
1596
+ const ret = Number.isSafeInteger(arg0);
1597
+ return ret;
1598
+ },
1599
+ __wbg_iterator_e3c31c892080e444: function() {
1600
+ const ret = Symbol.iterator;
1601
+ return ret;
1602
+ },
1603
+ __wbg_keys_440be172f17c0265: function(arg0) {
1604
+ const ret = Object.keys(arg0);
1605
+ return ret;
1606
+ },
1607
+ __wbg_length_7f3c00c40364105e: function(arg0) {
1608
+ const ret = arg0.length;
1609
+ return ret;
1610
+ },
1611
+ __wbg_length_d4bdea10311bd9cf: function(arg0) {
1612
+ const ret = arg0.length;
1613
+ return ret;
1614
+ },
1615
+ __wbg_message_49f5412048473de5: function(arg0, arg1) {
1616
+ const ret = arg1.message;
1617
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1618
+ const len1 = WASM_VECTOR_LEN;
1619
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1620
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1621
+ },
1622
+ __wbg_message_5f8387f0c32b90a7: function(arg0) {
1623
+ const ret = arg0.message;
1624
+ return ret;
1625
+ },
1626
+ __wbg_msCrypto_bd5a034af96bcba6: function(arg0) {
1627
+ const ret = arg0.msCrypto;
1628
+ return ret;
1629
+ },
1630
+ __wbg_new_1dbf7428bba60a42: function(arg0) {
1631
+ const ret = new Uint8Array(arg0);
1632
+ return ret;
1633
+ },
1634
+ __wbg_new_227d7c05414eb861: function() {
1635
+ const ret = new Error();
1636
+ return ret;
1637
+ },
1638
+ __wbg_new_28744009d011f847: function() {
1639
+ const ret = new Map();
1640
+ return ret;
1641
+ },
1642
+ __wbg_new_343a093a3c2ffb4e: function(arg0, arg1) {
1643
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
1644
+ return ret;
1645
+ },
1646
+ __wbg_new_5502aad30c185fc8: function(arg0, arg1) {
1647
+ try {
1648
+ var state0 = {a: arg0, b: arg1};
1649
+ var cb0 = (arg0, arg1) => {
1650
+ const a = state0.a;
1651
+ state0.a = 0;
1652
+ try {
1653
+ return wasm_bindgen_227c78e08cd5fdae___convert__closures_____invoke___js_sys_9fe07f3e7e97aa2f___Function_fn_wasm_bindgen_227c78e08cd5fdae___JsValue_____wasm_bindgen_227c78e08cd5fdae___sys__Undefined___js_sys_9fe07f3e7e97aa2f___Function_fn_wasm_bindgen_227c78e08cd5fdae___JsValue_____wasm_bindgen_227c78e08cd5fdae___sys__Undefined_______true_(a, state0.b, arg0, arg1);
1654
+ } finally {
1655
+ state0.a = a;
1656
+ }
1657
+ };
1658
+ const ret = new Promise(cb0);
1659
+ return ret;
1660
+ } finally {
1661
+ state0.a = 0;
1662
+ }
1663
+ },
1664
+ __wbg_new_617a8cdb8bb1130e: function() {
1665
+ const ret = new Object();
1666
+ return ret;
1667
+ },
1668
+ __wbg_new_ee2291f50781bf1d: function() {
1669
+ const ret = new Array();
1670
+ return ret;
1671
+ },
1672
+ __wbg_new_from_slice_9a868026ffa4208a: function(arg0, arg1) {
1673
+ const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
1674
+ return ret;
1675
+ },
1676
+ __wbg_new_typed_b01cb72a8af741a3: function(arg0, arg1) {
1677
+ try {
1678
+ var state0 = {a: arg0, b: arg1};
1679
+ var cb0 = (arg0, arg1) => {
1680
+ const a = state0.a;
1681
+ state0.a = 0;
1682
+ try {
1683
+ return wasm_bindgen_227c78e08cd5fdae___convert__closures_____invoke___js_sys_9fe07f3e7e97aa2f___Function_fn_wasm_bindgen_227c78e08cd5fdae___JsValue_____wasm_bindgen_227c78e08cd5fdae___sys__Undefined___js_sys_9fe07f3e7e97aa2f___Function_fn_wasm_bindgen_227c78e08cd5fdae___JsValue_____wasm_bindgen_227c78e08cd5fdae___sys__Undefined_______true_(a, state0.b, arg0, arg1);
1684
+ } finally {
1685
+ state0.a = a;
1686
+ }
1687
+ };
1688
+ const ret = new Promise(cb0);
1689
+ return ret;
1690
+ } finally {
1691
+ state0.a = 0;
1692
+ }
1693
+ },
1694
+ __wbg_new_with_length_3da0ad195f6f63ba: function(arg0) {
1695
+ const ret = new Uint8Array(arg0 >>> 0);
1696
+ return ret;
1697
+ },
1698
+ __wbg_new_with_str_sequence_f79e461d58fdeacc: function() { return handleError(function (arg0, arg1, arg2) {
1699
+ const ret = new WebSocket(getStringFromWasm0(arg0, arg1), arg2);
1700
+ return ret;
1701
+ }, arguments); },
1702
+ __wbg_next_33784799010f1bbe: function(arg0) {
1703
+ const ret = arg0.next;
1704
+ return ret;
1705
+ },
1706
+ __wbg_next_f4aac29c42af995c: function() { return handleError(function (arg0) {
1707
+ const ret = arg0.next();
1708
+ return ret;
1709
+ }, arguments); },
1710
+ __wbg_node_84ea875411254db1: function(arg0) {
1711
+ const ret = arg0.node;
1712
+ return ret;
1713
+ },
1714
+ __wbg_now_aa4ccb83129e9e55: function() {
1715
+ const ret = Date.now();
1716
+ return ret;
1717
+ },
1718
+ __wbg_now_e7c6795a7f81e10f: function(arg0) {
1719
+ const ret = arg0.now();
1720
+ return ret;
1721
+ },
1722
+ __wbg_performance_3fcf6e32a7e1ed0a: function(arg0) {
1723
+ const ret = arg0.performance;
1724
+ return ret;
1725
+ },
1726
+ __wbg_process_44c7a14e11e9f69e: function(arg0) {
1727
+ const ret = arg0.process;
1728
+ return ret;
1729
+ },
1730
+ __wbg_prototypesetcall_bc27214492979395: function(arg0, arg1, arg2) {
1731
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
1732
+ },
1733
+ __wbg_push_2baf45db356cf468: function(arg0, arg1) {
1734
+ const ret = arg0.push(arg1);
1735
+ return ret;
1736
+ },
1737
+ __wbg_queueMicrotask_9833f9a49df95a49: function(arg0) {
1738
+ const ret = arg0.queueMicrotask;
1739
+ return ret;
1740
+ },
1741
+ __wbg_queueMicrotask_a72f977e97f23c5f: function(arg0) {
1742
+ queueMicrotask(arg0);
1743
+ },
1744
+ __wbg_queuemessage_new: function(arg0) {
1745
+ const ret = QueueMessage.__wrap(arg0);
1746
+ return ret;
1747
+ },
1748
+ __wbg_randomFillSync_6c25eac9869eb53c: function() { return handleError(function (arg0, arg1) {
1749
+ arg0.randomFillSync(arg1);
1750
+ }, arguments); },
1751
+ __wbg_readyState_d8514376867e415b: function(arg0) {
1752
+ const ret = arg0.readyState;
1753
+ return ret;
1754
+ },
1755
+ __wbg_reason_832acaf5f4083b7b: function(arg0, arg1) {
1756
+ const ret = arg1.reason;
1757
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1758
+ const len1 = WASM_VECTOR_LEN;
1759
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1760
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1761
+ },
1762
+ __wbg_require_b4edbdcf3e2a1ef0: function() { return handleError(function () {
1763
+ const ret = module.require;
1764
+ return ret;
1765
+ }, arguments); },
1766
+ __wbg_resolve_0076e10020304ede: function(arg0) {
1767
+ const ret = Promise.resolve(arg0);
1768
+ return ret;
1769
+ },
1770
+ __wbg_send_797960c7a6a0270d: function() { return handleError(function (arg0, arg1) {
1771
+ arg0.send(arg1);
1772
+ }, arguments); },
1773
+ __wbg_set_145a351398b48c65: function() { return handleError(function (arg0, arg1, arg2) {
1774
+ const ret = Reflect.set(arg0, arg1, arg2);
1775
+ return ret;
1776
+ }, arguments); },
1777
+ __wbg_set_6ae97e73113c4f0b: function(arg0, arg1, arg2) {
1778
+ const ret = arg0.set(arg1, arg2);
1779
+ return ret;
1780
+ },
1781
+ __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
1782
+ arg0[arg1] = arg2;
1783
+ },
1784
+ __wbg_set_bea140a88be9b277: function(arg0, arg1, arg2) {
1785
+ arg0[arg1 >>> 0] = arg2;
1786
+ },
1787
+ __wbg_set_binaryType_21835bf0df8f70aa: function(arg0, arg1) {
1788
+ arg0.binaryType = __wbindgen_enum_BinaryType[arg1];
1789
+ },
1790
+ __wbg_set_onclose_a84370531f3d2948: function(arg0, arg1) {
1791
+ arg0.onclose = arg1;
1792
+ },
1793
+ __wbg_set_onerror_94ee307653399172: function(arg0, arg1) {
1794
+ arg0.onerror = arg1;
1795
+ },
1796
+ __wbg_set_onmessage_cb6f77d2d8e0402a: function(arg0, arg1) {
1797
+ arg0.onmessage = arg1;
1798
+ },
1799
+ __wbg_set_onopen_c914147e8a2db4b0: function(arg0, arg1) {
1800
+ arg0.onopen = arg1;
1801
+ },
1802
+ __wbg_sqlitetransaction_new: function(arg0) {
1803
+ const ret = SqliteTransaction.__wrap(arg0);
1804
+ return ret;
1805
+ },
1806
+ __wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
1807
+ const ret = arg1.stack;
1808
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1809
+ const len1 = WASM_VECTOR_LEN;
1810
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1811
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1812
+ },
1813
+ __wbg_static_accessor_GLOBAL_266715b9d96ba635: function() {
1814
+ const ret = typeof global === 'undefined' ? null : global;
1815
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1816
+ },
1817
+ __wbg_static_accessor_GLOBAL_THIS_10fb7dc1ae063179: function() {
1818
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
1819
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1820
+ },
1821
+ __wbg_static_accessor_SELF_0b583911f537483a: function() {
1822
+ const ret = typeof self === 'undefined' ? null : self;
1823
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1824
+ },
1825
+ __wbg_static_accessor_WINDOW_d7f903d1508cbdc4: function() {
1826
+ const ret = typeof window === 'undefined' ? null : window;
1827
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1828
+ },
1829
+ __wbg_stringify_52ff602c1cc4fbb6: function() { return handleError(function (arg0) {
1830
+ const ret = JSON.stringify(arg0);
1831
+ return ret;
1832
+ }, arguments); },
1833
+ __wbg_subarray_002b94d5e13d1411: function(arg0, arg1, arg2) {
1834
+ const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
1835
+ return ret;
1836
+ },
1837
+ __wbg_then_c949d5a25a4e78f8: function(arg0, arg1, arg2) {
1838
+ const ret = arg0.then(arg1, arg2);
1839
+ return ret;
1840
+ },
1841
+ __wbg_then_e71170d78fcf8954: function(arg0, arg1) {
1842
+ const ret = arg0.then(arg1);
1843
+ return ret;
1844
+ },
1845
+ __wbg_value_f3c585ee8f5ba40c: function(arg0) {
1846
+ const ret = arg0.value;
1847
+ return ret;
1848
+ },
1849
+ __wbg_versions_276b2795b1c6a219: function(arg0) {
1850
+ const ret = arg0.versions;
1851
+ return ret;
1852
+ },
1853
+ __wbg_websockethandle_new: function(arg0) {
1854
+ const ret = WebSocketHandle.__wrap(arg0);
1855
+ return ret;
1856
+ },
1857
+ __wbindgen_generic_0000000000000001: function(arg0, arg1) {
1858
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 2649, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1859
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_227c78e08cd5fdae___convert__closures_____invoke___wasm_bindgen_227c78e08cd5fdae___JsValue__core_608f92abc48d28da___result__Result_____wasm_bindgen_227c78e08cd5fdae___JsError___true_);
1860
+ return ret;
1861
+ },
1862
+ __wbindgen_generic_0000000000000002: function(arg0, arg1) {
1863
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 2078, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1864
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_227c78e08cd5fdae___convert__closures_____invoke___web_sys_ffe0f709cd0c9189___features__gen_CloseEvent__CloseEvent______true_);
1865
+ return ret;
1866
+ },
1867
+ __wbindgen_generic_0000000000000003: function(arg0, arg1) {
1868
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("ErrorEvent")], shim_idx: 2078, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1869
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_227c78e08cd5fdae___convert__closures_____invoke___web_sys_ffe0f709cd0c9189___features__gen_CloseEvent__CloseEvent______true__119);
1870
+ return ret;
1871
+ },
1872
+ __wbindgen_generic_0000000000000004: function(arg0, arg1) {
1873
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx: 2078, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1874
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_227c78e08cd5fdae___convert__closures_____invoke___web_sys_ffe0f709cd0c9189___features__gen_CloseEvent__CloseEvent______true__120);
1875
+ return ret;
1876
+ },
1877
+ __wbindgen_generic_0000000000000005: function(arg0, arg1) {
1878
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 2078, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1879
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_227c78e08cd5fdae___convert__closures_____invoke___web_sys_ffe0f709cd0c9189___features__gen_CloseEvent__CloseEvent______true__121);
1880
+ return ret;
1881
+ },
1882
+ __wbindgen_generic_0000000000000006: function(arg0) {
1883
+ // Cast intrinsic for `F64 -> Externref`.
1884
+ const ret = arg0;
1885
+ return ret;
1886
+ },
1887
+ __wbindgen_generic_0000000000000007: function(arg0) {
1888
+ // Cast intrinsic for `I64 -> Externref`.
1889
+ const ret = arg0;
1890
+ return ret;
1891
+ },
1892
+ __wbindgen_generic_0000000000000008: function(arg0, arg1) {
1893
+ // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
1894
+ const ret = getArrayU8FromWasm0(arg0, arg1);
1895
+ return ret;
1896
+ },
1897
+ __wbindgen_generic_0000000000000009: function(arg0, arg1) {
1898
+ // Cast intrinsic for `Ref(String) -> Externref`.
1899
+ const ret = getStringFromWasm0(arg0, arg1);
1900
+ return ret;
1901
+ },
1902
+ __wbindgen_generic_000000000000000a: function(arg0) {
1903
+ // Cast intrinsic for `U64 -> Externref`.
1904
+ const ret = BigInt.asUintN(64, arg0);
1905
+ return ret;
1906
+ },
1907
+ __wbindgen_generic_000000000000000b: function(arg0, arg1) {
1908
+ var v0 = getArrayU8FromWasm0(arg0, arg1).slice();
1909
+ wasm.__wbindgen_free(arg0, arg1 * 1, 1);
1910
+ // Cast intrinsic for `Vector(U8) -> Externref`.
1911
+ const ret = v0;
1912
+ return ret;
1913
+ },
1914
+ __wbindgen_init_externref_table: function() {
1915
+ const table = wasm.__wbindgen_externrefs;
1916
+ const offset = table.grow(4);
1917
+ table.set(0, undefined);
1918
+ table.set(offset + 0, undefined);
1919
+ table.set(offset + 1, null);
1920
+ table.set(offset + 2, true);
1921
+ table.set(offset + 3, false);
1922
+ },
1923
+ };
1924
+ return {
1925
+ __proto__: null,
1926
+ "./rivetkit_wasm_bg.js": import0,
1927
+ };
1928
+ }
1929
+
1930
+ function wasm_bindgen_227c78e08cd5fdae___convert__closures_____invoke___web_sys_ffe0f709cd0c9189___features__gen_CloseEvent__CloseEvent______true_(arg0, arg1, arg2) {
1931
+ wasm.wasm_bindgen_227c78e08cd5fdae___convert__closures_____invoke___web_sys_ffe0f709cd0c9189___features__gen_CloseEvent__CloseEvent______true_(arg0, arg1, arg2);
1932
+ }
1933
+
1934
+ function wasm_bindgen_227c78e08cd5fdae___convert__closures_____invoke___web_sys_ffe0f709cd0c9189___features__gen_CloseEvent__CloseEvent______true__119(arg0, arg1, arg2) {
1935
+ wasm.wasm_bindgen_227c78e08cd5fdae___convert__closures_____invoke___web_sys_ffe0f709cd0c9189___features__gen_CloseEvent__CloseEvent______true__119(arg0, arg1, arg2);
1936
+ }
1937
+
1938
+ function wasm_bindgen_227c78e08cd5fdae___convert__closures_____invoke___web_sys_ffe0f709cd0c9189___features__gen_CloseEvent__CloseEvent______true__120(arg0, arg1, arg2) {
1939
+ wasm.wasm_bindgen_227c78e08cd5fdae___convert__closures_____invoke___web_sys_ffe0f709cd0c9189___features__gen_CloseEvent__CloseEvent______true__120(arg0, arg1, arg2);
1940
+ }
1941
+
1942
+ function wasm_bindgen_227c78e08cd5fdae___convert__closures_____invoke___web_sys_ffe0f709cd0c9189___features__gen_CloseEvent__CloseEvent______true__121(arg0, arg1, arg2) {
1943
+ wasm.wasm_bindgen_227c78e08cd5fdae___convert__closures_____invoke___web_sys_ffe0f709cd0c9189___features__gen_CloseEvent__CloseEvent______true__121(arg0, arg1, arg2);
1944
+ }
1945
+
1946
+ function wasm_bindgen_227c78e08cd5fdae___convert__closures_____invoke___wasm_bindgen_227c78e08cd5fdae___JsValue__core_608f92abc48d28da___result__Result_____wasm_bindgen_227c78e08cd5fdae___JsError___true_(arg0, arg1, arg2) {
1947
+ const ret = wasm.wasm_bindgen_227c78e08cd5fdae___convert__closures_____invoke___wasm_bindgen_227c78e08cd5fdae___JsValue__core_608f92abc48d28da___result__Result_____wasm_bindgen_227c78e08cd5fdae___JsError___true_(arg0, arg1, arg2);
1948
+ if (ret[1]) {
1949
+ throw takeFromExternrefTable0(ret[0]);
1950
+ }
1951
+ }
1952
+
1953
+ function wasm_bindgen_227c78e08cd5fdae___convert__closures_____invoke___js_sys_9fe07f3e7e97aa2f___Function_fn_wasm_bindgen_227c78e08cd5fdae___JsValue_____wasm_bindgen_227c78e08cd5fdae___sys__Undefined___js_sys_9fe07f3e7e97aa2f___Function_fn_wasm_bindgen_227c78e08cd5fdae___JsValue_____wasm_bindgen_227c78e08cd5fdae___sys__Undefined_______true_(arg0, arg1, arg2, arg3) {
1954
+ wasm.wasm_bindgen_227c78e08cd5fdae___convert__closures_____invoke___js_sys_9fe07f3e7e97aa2f___Function_fn_wasm_bindgen_227c78e08cd5fdae___JsValue_____wasm_bindgen_227c78e08cd5fdae___sys__Undefined___js_sys_9fe07f3e7e97aa2f___Function_fn_wasm_bindgen_227c78e08cd5fdae___JsValue_____wasm_bindgen_227c78e08cd5fdae___sys__Undefined_______true_(arg0, arg1, arg2, arg3);
1955
+ }
1956
+
1957
+
1958
+ const __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];
1959
+ const ActorContextFinalization = (typeof FinalizationRegistry === 'undefined')
1960
+ ? { register: () => {}, unregister: () => {} }
1961
+ : new FinalizationRegistry(ptr => wasm.__wbg_actorcontext_free(ptr, 1));
1962
+ const ActorFactoryFinalization = (typeof FinalizationRegistry === 'undefined')
1963
+ ? { register: () => {}, unregister: () => {} }
1964
+ : new FinalizationRegistry(ptr => wasm.__wbg_actorfactory_free(ptr, 1));
1965
+ const ActorStateTransactionFinalization = (typeof FinalizationRegistry === 'undefined')
1966
+ ? { register: () => {}, unregister: () => {} }
1967
+ : new FinalizationRegistry(ptr => wasm.__wbg_actorstatetransaction_free(ptr, 1));
1968
+ const CancellationListenerFinalization = (typeof FinalizationRegistry === 'undefined')
1969
+ ? { register: () => {}, unregister: () => {} }
1970
+ : new FinalizationRegistry(ptr => wasm.__wbg_cancellationlistener_free(ptr, 1));
1971
+ const CancellationTokenFinalization = (typeof FinalizationRegistry === 'undefined')
1972
+ ? { register: () => {}, unregister: () => {} }
1973
+ : new FinalizationRegistry(ptr => wasm.__wbg_cancellationtoken_free(ptr, 1));
1974
+ const ConnHandleFinalization = (typeof FinalizationRegistry === 'undefined')
1975
+ ? { register: () => {}, unregister: () => {} }
1976
+ : new FinalizationRegistry(ptr => wasm.__wbg_connhandle_free(ptr, 1));
1977
+ const CoreRegistryFinalization = (typeof FinalizationRegistry === 'undefined')
1978
+ ? { register: () => {}, unregister: () => {} }
1979
+ : new FinalizationRegistry(ptr => wasm.__wbg_coreregistry_free(ptr, 1));
1980
+ const KvFinalization = (typeof FinalizationRegistry === 'undefined')
1981
+ ? { register: () => {}, unregister: () => {} }
1982
+ : new FinalizationRegistry(ptr => wasm.__wbg_kv_free(ptr, 1));
1983
+ const QueueFinalization = (typeof FinalizationRegistry === 'undefined')
1984
+ ? { register: () => {}, unregister: () => {} }
1985
+ : new FinalizationRegistry(ptr => wasm.__wbg_queue_free(ptr, 1));
1986
+ const QueueMessageFinalization = (typeof FinalizationRegistry === 'undefined')
1987
+ ? { register: () => {}, unregister: () => {} }
1988
+ : new FinalizationRegistry(ptr => wasm.__wbg_queuemessage_free(ptr, 1));
1989
+ const ScheduleFinalization = (typeof FinalizationRegistry === 'undefined')
1990
+ ? { register: () => {}, unregister: () => {} }
1991
+ : new FinalizationRegistry(ptr => wasm.__wbg_schedule_free(ptr, 1));
1992
+ const SqliteDbFinalization = (typeof FinalizationRegistry === 'undefined')
1993
+ ? { register: () => {}, unregister: () => {} }
1994
+ : new FinalizationRegistry(ptr => wasm.__wbg_sqlitedb_free(ptr, 1));
1995
+ const SqliteTransactionFinalization = (typeof FinalizationRegistry === 'undefined')
1996
+ ? { register: () => {}, unregister: () => {} }
1997
+ : new FinalizationRegistry(ptr => wasm.__wbg_sqlitetransaction_free(ptr, 1));
1998
+ const WebSocketHandleFinalization = (typeof FinalizationRegistry === 'undefined')
1999
+ ? { register: () => {}, unregister: () => {} }
2000
+ : new FinalizationRegistry(ptr => wasm.__wbg_websockethandle_free(ptr, 1));
2001
+
2002
+ function addToExternrefTable0(obj) {
2003
+ const idx = wasm.__externref_table_alloc();
2004
+ wasm.__wbindgen_externrefs.set(idx, obj);
2005
+ return idx;
2006
+ }
2007
+
2008
+ function _assertClass(instance, klass) {
2009
+ if (!(instance instanceof klass)) {
2010
+ throw new Error(`expected instance of ${klass.name}`);
2011
+ }
2012
+ }
2013
+
2014
+ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
2015
+ ? { register: () => {}, unregister: () => {} }
2016
+ : new FinalizationRegistry(state => wasm.__wbindgen_destroy_closure(state.a, state.b));
2017
+
2018
+ function debugString(val) {
2019
+ // primitive types
2020
+ const type = typeof val;
2021
+ if (type == 'number' || type == 'boolean' || val == null) {
2022
+ return `${val}`;
2023
+ }
2024
+ if (type == 'string') {
2025
+ return `"${val}"`;
2026
+ }
2027
+ if (type == 'symbol') {
2028
+ const description = val.description;
2029
+ if (description == null) {
2030
+ return 'Symbol';
2031
+ } else {
2032
+ return `Symbol(${description})`;
2033
+ }
2034
+ }
2035
+ if (type == 'function') {
2036
+ const name = val.name;
2037
+ if (typeof name == 'string' && name.length > 0) {
2038
+ return `Function(${name})`;
2039
+ } else {
2040
+ return 'Function';
2041
+ }
2042
+ }
2043
+ // objects
2044
+ if (Array.isArray(val)) {
2045
+ const length = val.length;
2046
+ let debug = '[';
2047
+ if (length > 0) {
2048
+ debug += debugString(val[0]);
2049
+ }
2050
+ for(let i = 1; i < length; i++) {
2051
+ debug += ', ' + debugString(val[i]);
2052
+ }
2053
+ debug += ']';
2054
+ return debug;
2055
+ }
2056
+ // Test for built-in
2057
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
2058
+ let className;
2059
+ if (builtInMatches && builtInMatches.length > 1) {
2060
+ className = builtInMatches[1];
2061
+ } else {
2062
+ // Failed to match the standard '[object ClassName]'
2063
+ return toString.call(val);
2064
+ }
2065
+ if (className == 'Object') {
2066
+ // we're a user defined class or Object
2067
+ // JSON.stringify avoids problems with cycles, and is generally much
2068
+ // easier than looping through ownProperties of `val`.
2069
+ try {
2070
+ return 'Object(' + JSON.stringify(val) + ')';
2071
+ } catch (_) {
2072
+ return 'Object';
2073
+ }
2074
+ }
2075
+ // errors
2076
+ if (val instanceof Error) {
2077
+ return `${val.name}: ${val.message}\n${val.stack}`;
2078
+ }
2079
+ // TODO we could test for more things here, like `Set`s and `Map`s.
2080
+ return className;
2081
+ }
2082
+
2083
+ function getArrayU8FromWasm0(ptr, len) {
2084
+ ptr = ptr >>> 0;
2085
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
2086
+ }
2087
+
2088
+ let cachedDataViewMemory0 = null;
2089
+ function getDataViewMemory0() {
2090
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
2091
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
2092
+ }
2093
+ return cachedDataViewMemory0;
2094
+ }
2095
+
2096
+ function getStringFromWasm0(ptr, len) {
2097
+ return decodeText(ptr >>> 0, len);
2098
+ }
2099
+
2100
+ let cachedUint8ArrayMemory0 = null;
2101
+ function getUint8ArrayMemory0() {
2102
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
2103
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
2104
+ }
2105
+ return cachedUint8ArrayMemory0;
2106
+ }
2107
+
2108
+ function handleError(f, args) {
2109
+ try {
2110
+ return f.apply(this, args);
2111
+ } catch (e) {
2112
+ const idx = addToExternrefTable0(e);
2113
+ wasm.__wbindgen_exn_store(idx);
2114
+ }
2115
+ }
2116
+
2117
+ function isLikeNone(x) {
2118
+ return x === undefined || x === null;
2119
+ }
2120
+
2121
+ function makeMutClosure(arg0, arg1, f) {
2122
+ const state = { a: arg0, b: arg1, cnt: 1 };
2123
+ const real = (...args) => {
2124
+
2125
+ // First up with a closure we increment the internal reference
2126
+ // count. This ensures that the Rust closure environment won't
2127
+ // be deallocated while we're invoking it.
2128
+ state.cnt++;
2129
+ const a = state.a;
2130
+ state.a = 0;
2131
+ try {
2132
+ return f(a, state.b, ...args);
2133
+ } finally {
2134
+ state.a = a;
2135
+ real._wbg_cb_unref();
2136
+ }
2137
+ };
2138
+ real._wbg_cb_unref = () => {
2139
+ if (--state.cnt === 0) {
2140
+ wasm.__wbindgen_destroy_closure(state.a, state.b);
2141
+ state.a = 0;
2142
+ CLOSURE_DTORS.unregister(state);
2143
+ }
2144
+ };
2145
+ CLOSURE_DTORS.register(real, state, state);
2146
+ return real;
2147
+ }
2148
+
2149
+ function passArray8ToWasm0(arg, malloc) {
2150
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
2151
+ getUint8ArrayMemory0().set(arg, ptr / 1);
2152
+ WASM_VECTOR_LEN = arg.length;
2153
+ return ptr;
2154
+ }
2155
+
2156
+ function passStringToWasm0(arg, malloc, realloc) {
2157
+ if (realloc === undefined) {
2158
+ const buf = cachedTextEncoder.encode(arg);
2159
+ const ptr = malloc(buf.length, 1) >>> 0;
2160
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
2161
+ WASM_VECTOR_LEN = buf.length;
2162
+ return ptr;
2163
+ }
2164
+
2165
+ let len = arg.length;
2166
+ let ptr = malloc(len, 1) >>> 0;
2167
+
2168
+ const mem = getUint8ArrayMemory0();
2169
+
2170
+ let offset = 0;
2171
+
2172
+ for (; offset < len; offset++) {
2173
+ const code = arg.charCodeAt(offset);
2174
+ if (code > 0x7F) break;
2175
+ mem[ptr + offset] = code;
2176
+ }
2177
+ if (offset !== len) {
2178
+ if (offset !== 0) {
2179
+ arg = arg.slice(offset);
2180
+ }
2181
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
2182
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
2183
+ const ret = cachedTextEncoder.encodeInto(arg, view);
2184
+
2185
+ offset += ret.written;
2186
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
2187
+ }
2188
+
2189
+ WASM_VECTOR_LEN = offset;
2190
+ return ptr;
2191
+ }
2192
+
2193
+ function takeFromExternrefTable0(idx) {
2194
+ const value = wasm.__wbindgen_externrefs.get(idx);
2195
+ wasm.__externref_table_dealloc(idx);
2196
+ return value;
2197
+ }
2198
+
2199
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
2200
+ cachedTextDecoder.decode();
2201
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
2202
+ let numBytesDecoded = 0;
2203
+ function decodeText(ptr, len) {
2204
+ numBytesDecoded += len;
2205
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
2206
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
2207
+ cachedTextDecoder.decode();
2208
+ numBytesDecoded = len;
2209
+ }
2210
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
2211
+ }
2212
+
2213
+ const cachedTextEncoder = new TextEncoder();
2214
+
2215
+ if (!('encodeInto' in cachedTextEncoder)) {
2216
+ cachedTextEncoder.encodeInto = function (arg, view) {
2217
+ const buf = cachedTextEncoder.encode(arg);
2218
+ view.set(buf);
2219
+ return {
2220
+ read: arg.length,
2221
+ written: buf.length
2222
+ };
2223
+ };
2224
+ }
2225
+
2226
+ let WASM_VECTOR_LEN = 0;
2227
+
2228
+ let wasmModule, wasmInstance, wasm;
2229
+ function __wbg_finalize_init(instance, module) {
2230
+ wasmInstance = instance;
2231
+ wasm = instance.exports;
2232
+ wasmModule = module;
2233
+ cachedDataViewMemory0 = null;
2234
+ cachedUint8ArrayMemory0 = null;
2235
+ wasm.__wbindgen_start();
2236
+ return wasm;
2237
+ }
2238
+
2239
+ async function __wbg_load(module, imports) {
2240
+ if (typeof Response === 'function' && module instanceof Response) {
2241
+ if (!module.ok) {
2242
+ throw new Error(`failed to fetch Wasm: ${module.status} ${module.statusText} fetching '${module.url}'`);
2243
+ }
2244
+
2245
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
2246
+ try {
2247
+ return await WebAssembly.instantiateStreaming(module, imports);
2248
+ } catch (e) {
2249
+ const validResponse = expectedResponseType(module.type);
2250
+
2251
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
2252
+ 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);
2253
+
2254
+ } else { throw e; }
2255
+ }
2256
+ }
2257
+
2258
+ const bytes = await module.arrayBuffer();
2259
+ return await WebAssembly.instantiate(bytes, imports);
2260
+ } else {
2261
+ const instance = await WebAssembly.instantiate(module, imports);
2262
+
2263
+ if (instance instanceof WebAssembly.Instance) {
2264
+ return { instance, module };
2265
+ } else {
2266
+ return instance;
2267
+ }
2268
+ }
2269
+
2270
+ function expectedResponseType(type) {
2271
+ switch (type) {
2272
+ case 'basic': case 'cors': case 'default': return true;
2273
+ }
2274
+ return false;
2275
+ }
2276
+ }
2277
+
2278
+ function initSync(module) {
2279
+ if (wasm !== undefined) return wasm;
2280
+
2281
+
2282
+ if (module !== undefined) {
2283
+ if (Object.getPrototypeOf(module) === Object.prototype) {
2284
+ ({module} = module)
2285
+ } else {
2286
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
2287
+ }
2288
+ }
2289
+
2290
+ const imports = __wbg_get_imports();
2291
+ if (!(module instanceof WebAssembly.Module)) {
2292
+ module = new WebAssembly.Module(module);
2293
+ }
2294
+ const instance = new WebAssembly.Instance(module, imports);
2295
+ return __wbg_finalize_init(instance, module);
2296
+ }
2297
+
2298
+ async function __wbg_init(module_or_path) {
2299
+ if (wasm !== undefined) return wasm;
2300
+
2301
+
2302
+ if (module_or_path !== undefined) {
2303
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
2304
+ ({module_or_path} = module_or_path)
2305
+ } else {
2306
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
2307
+ }
2308
+ }
2309
+
2310
+ if (module_or_path === undefined) {
2311
+ module_or_path = new URL('rivetkit_wasm_bg.wasm', import.meta.url);
2312
+ }
2313
+ const imports = __wbg_get_imports();
2314
+
2315
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
2316
+ module_or_path = fetch(module_or_path);
2317
+ }
2318
+
2319
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
2320
+
2321
+ return __wbg_finalize_init(instance, module);
2322
+ }
2323
+
2324
+ export { initSync, __wbg_init as default };