orez 0.5.16 → 0.5.17

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.
Files changed (41) hide show
  1. package/README.md +4 -0
  2. package/dist/sync-browser-host/generated/sqlite3-browser.wasm +0 -0
  3. package/dist/sync-browser-host/generated/sync_wasm.js +824 -0
  4. package/dist/sync-browser-host/generated/sync_wasm_bg.wasm +0 -0
  5. package/dist/sync-browser-host/host.d.ts +8 -0
  6. package/dist/sync-browser-host/host.d.ts.map +1 -0
  7. package/dist/sync-browser-host/host.js +435 -0
  8. package/dist/sync-browser-host/host.js.map +1 -0
  9. package/dist/sync-browser-host/idb-snapshot.d.ts +10 -0
  10. package/dist/sync-browser-host/idb-snapshot.d.ts.map +1 -0
  11. package/dist/sync-browser-host/idb-snapshot.js +109 -0
  12. package/dist/sync-browser-host/idb-snapshot.js.map +1 -0
  13. package/dist/sync-browser-host/index.d.ts +4 -0
  14. package/dist/sync-browser-host/index.d.ts.map +1 -0
  15. package/dist/sync-browser-host/index.js +4 -0
  16. package/dist/sync-browser-host/index.js.map +1 -0
  17. package/dist/sync-browser-host/message-port.d.ts +6 -0
  18. package/dist/sync-browser-host/message-port.d.ts.map +1 -0
  19. package/dist/sync-browser-host/message-port.js +182 -0
  20. package/dist/sync-browser-host/message-port.js.map +1 -0
  21. package/dist/sync-browser-host/sqlite-adapter.d.ts +66 -0
  22. package/dist/sync-browser-host/sqlite-adapter.d.ts.map +1 -0
  23. package/dist/sync-browser-host/sqlite-adapter.js +135 -0
  24. package/dist/sync-browser-host/sqlite-adapter.js.map +1 -0
  25. package/dist/sync-browser-host/types.d.ts +88 -0
  26. package/dist/sync-browser-host/types.d.ts.map +1 -0
  27. package/dist/sync-browser-host/types.js +12 -0
  28. package/dist/sync-browser-host/types.js.map +1 -0
  29. package/dist/test-setup.d.ts +2 -0
  30. package/dist/test-setup.d.ts.map +1 -0
  31. package/dist/test-setup.js +35 -0
  32. package/dist/test-setup.js.map +1 -0
  33. package/dist/zero-http/test-harness.d.ts +2 -6
  34. package/dist/zero-http/test-harness.d.ts.map +1 -1
  35. package/dist/zero-http/test-harness.js +4 -2
  36. package/dist/zero-http/test-harness.js.map +1 -1
  37. package/dist/zero-http/transport.d.ts +17 -4
  38. package/dist/zero-http/transport.d.ts.map +1 -1
  39. package/dist/zero-http/transport.js +391 -44
  40. package/dist/zero-http/transport.js.map +1 -1
  41. package/package.json +14 -4
@@ -0,0 +1,824 @@
1
+ /* @ts-self-types="./sync_wasm.d.ts" */
2
+
3
+ /**
4
+ * Apply one ordered page from the upstream ZeroSqlDO change feed. The host
5
+ * owns one transaction around this call; application triggers append the
6
+ * ordinary engine change-log entries consumed by pull/CVR code.
7
+ * @param {any} db
8
+ * @param {any} schema
9
+ * @param {any} batch
10
+ * @returns {any}
11
+ */
12
+ export function engine_apply_upstream(db, schema, batch) {
13
+ const ret = wasm.engine_apply_upstream(db, schema, batch);
14
+ if (ret[2]) {
15
+ throw takeFromExternrefTable0(ret[1]);
16
+ }
17
+ return takeFromExternrefTable0(ret[0]);
18
+ }
19
+
20
+ /**
21
+ * Atomically rebuild application rows from a point-in-time upstream snapshot.
22
+ * @param {any} db
23
+ * @param {any} schema
24
+ * @param {any} snapshot
25
+ * @returns {any}
26
+ */
27
+ export function engine_apply_upstream_snapshot(db, schema, snapshot) {
28
+ const ret = wasm.engine_apply_upstream_snapshot(db, schema, snapshot);
29
+ if (ret[2]) {
30
+ throw takeFromExternrefTable0(ret[1]);
31
+ }
32
+ return takeFromExternrefTable0(ret[0]);
33
+ }
34
+
35
+ /**
36
+ * @param {any} results
37
+ * @returns {any}
38
+ */
39
+ export function engine_assemble_push_response(results) {
40
+ const ret = wasm.engine_assemble_push_response(results);
41
+ if (ret[2]) {
42
+ throw takeFromExternrefTable0(ret[1]);
43
+ }
44
+ return takeFromExternrefTable0(ret[0]);
45
+ }
46
+
47
+ /**
48
+ * Compile a validated Zero query AST for a consumer mutator's transactional
49
+ * `tx.run(...)`. Execution remains in the host-owned application transaction.
50
+ * @param {any} schema
51
+ * @param {any} ast
52
+ * @returns {any}
53
+ */
54
+ export function engine_compile_query(schema, ast) {
55
+ const ret = wasm.engine_compile_query(schema, ast);
56
+ if (ret[2]) {
57
+ throw takeFromExternrefTable0(ret[1]);
58
+ }
59
+ return takeFromExternrefTable0(ret[0]);
60
+ }
61
+
62
+ /**
63
+ * @param {any} db
64
+ * @param {string} client_group_id
65
+ * @param {string} client_id
66
+ * @param {string} mutation_id
67
+ */
68
+ export function engine_finalize(db, client_group_id, client_id, mutation_id) {
69
+ const ptr0 = passStringToWasm0(client_group_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
70
+ const len0 = WASM_VECTOR_LEN;
71
+ const ptr1 = passStringToWasm0(client_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
72
+ const len1 = WASM_VECTOR_LEN;
73
+ const ptr2 = passStringToWasm0(mutation_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
74
+ const len2 = WASM_VECTOR_LEN;
75
+ const ret = wasm.engine_finalize(db, ptr0, len0, ptr1, len1, ptr2, len2);
76
+ if (ret[1]) {
77
+ throw takeFromExternrefTable0(ret[0]);
78
+ }
79
+ }
80
+
81
+ /**
82
+ * Production pull entry. The TypeScript host owns `transactionSync`.
83
+ * @param {any} db
84
+ * @param {any} schema
85
+ * @param {any} visibility
86
+ * @param {any} caps
87
+ * @param {string} retain_changes
88
+ * @param {any} body
89
+ * @param {string} user_id
90
+ * @returns {any}
91
+ */
92
+ export function engine_handle_pull(db, schema, visibility, caps, retain_changes, body, user_id) {
93
+ const ptr0 = passStringToWasm0(retain_changes, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
94
+ const len0 = WASM_VECTOR_LEN;
95
+ const ptr1 = passStringToWasm0(user_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
96
+ const len1 = WASM_VECTOR_LEN;
97
+ const ret = wasm.engine_handle_pull(db, schema, visibility, caps, ptr0, len0, body, ptr1, len1);
98
+ if (ret[2]) {
99
+ throw takeFromExternrefTable0(ret[1]);
100
+ }
101
+ return takeFromExternrefTable0(ret[0]);
102
+ }
103
+
104
+ /**
105
+ * Query-aware pull entry point. Desired-query ASTs are already resolved and
106
+ * validated by the consumer host before crossing this boundary.
107
+ * @param {any} db
108
+ * @param {any} schema
109
+ * @param {string} retain_changes
110
+ * @param {any} body
111
+ * @param {string} user_id
112
+ * @returns {any}
113
+ */
114
+ export function engine_handle_query_pull(db, schema, retain_changes, body, user_id) {
115
+ const ptr0 = passStringToWasm0(retain_changes, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
116
+ const len0 = WASM_VECTOR_LEN;
117
+ const ptr1 = passStringToWasm0(user_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
118
+ const len1 = WASM_VECTOR_LEN;
119
+ const ret = wasm.engine_handle_query_pull(db, schema, ptr0, len0, body, ptr1, len1);
120
+ if (ret[2]) {
121
+ throw takeFromExternrefTable0(ret[1]);
122
+ }
123
+ return takeFromExternrefTable0(ret[0]);
124
+ }
125
+
126
+ /**
127
+ * Initialize the additive query-aware durable tables. The host owns the
128
+ * transaction boundary, exactly as it does for the baseline schema.
129
+ * @param {any} db
130
+ */
131
+ export function engine_init_query_schema(db) {
132
+ const ret = wasm.engine_init_query_schema(db);
133
+ if (ret[1]) {
134
+ throw takeFromExternrefTable0(ret[0]);
135
+ }
136
+ }
137
+
138
+ /**
139
+ * Initialize the sync engine's durable metadata and triggers. The host calls
140
+ * this inside startup `transactionSync` after application DDL and seed.
141
+ * @param {any} db
142
+ * @param {any} schema
143
+ */
144
+ export function engine_init_schema(db, schema) {
145
+ const ret = wasm.engine_init_schema(db, schema);
146
+ if (ret[1]) {
147
+ throw takeFromExternrefTable0(ret[0]);
148
+ }
149
+ }
150
+
151
+ /**
152
+ * @param {any} db
153
+ */
154
+ export function engine_invalidate(db) {
155
+ const ret = wasm.engine_invalidate(db);
156
+ if (ret[1]) {
157
+ throw takeFromExternrefTable0(ret[0]);
158
+ }
159
+ }
160
+
161
+ /**
162
+ * Linear-memory size for authenticated operator soak diagnostics. This is a
163
+ * byte count only; it contains no application or query data.
164
+ * @returns {number}
165
+ */
166
+ export function engine_memory_bytes() {
167
+ const ret = wasm.engine_memory_bytes();
168
+ if (ret[2]) {
169
+ throw takeFromExternrefTable0(ret[1]);
170
+ }
171
+ return ret[0] >>> 0;
172
+ }
173
+
174
+ /**
175
+ * @param {any} db
176
+ * @param {string} client_group_id
177
+ * @param {string} client_id
178
+ * @param {string} mutation_id
179
+ * @param {string} user_id
180
+ * @returns {any}
181
+ */
182
+ export function engine_preflight(db, client_group_id, client_id, mutation_id, user_id) {
183
+ const ptr0 = passStringToWasm0(client_group_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
184
+ const len0 = WASM_VECTOR_LEN;
185
+ const ptr1 = passStringToWasm0(client_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
186
+ const len1 = WASM_VECTOR_LEN;
187
+ const ptr2 = passStringToWasm0(mutation_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
188
+ const len2 = WASM_VECTOR_LEN;
189
+ const ptr3 = passStringToWasm0(user_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
190
+ const len3 = WASM_VECTOR_LEN;
191
+ const ret = wasm.engine_preflight(db, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
192
+ if (ret[2]) {
193
+ throw takeFromExternrefTable0(ret[1]);
194
+ }
195
+ return takeFromExternrefTable0(ret[0]);
196
+ }
197
+
198
+ /**
199
+ * @param {any} db
200
+ * @param {string} retain_changes
201
+ */
202
+ export function engine_prune(db, retain_changes) {
203
+ const ptr0 = passStringToWasm0(retain_changes, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
204
+ const len0 = WASM_VECTOR_LEN;
205
+ const ret = wasm.engine_prune(db, ptr0, len0);
206
+ if (ret[1]) {
207
+ throw takeFromExternrefTable0(ret[0]);
208
+ }
209
+ }
210
+
211
+ /**
212
+ * Validate an entire push before the host opens the first mutation tx.
213
+ * @param {any} body
214
+ * @returns {any}
215
+ */
216
+ export function engine_push_validate(body) {
217
+ const ret = wasm.engine_push_validate(body);
218
+ if (ret[2]) {
219
+ throw takeFromExternrefTable0(ret[1]);
220
+ }
221
+ return takeFromExternrefTable0(ret[0]);
222
+ }
223
+
224
+ /**
225
+ * @param {any} db
226
+ * @param {string} client_group_id
227
+ * @param {string} client_id
228
+ * @param {string} mutation_id
229
+ * @param {string} user_id
230
+ */
231
+ export function engine_record_app_error(db, client_group_id, client_id, mutation_id, user_id) {
232
+ const ptr0 = passStringToWasm0(client_group_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
233
+ const len0 = WASM_VECTOR_LEN;
234
+ const ptr1 = passStringToWasm0(client_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
235
+ const len1 = WASM_VECTOR_LEN;
236
+ const ptr2 = passStringToWasm0(mutation_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
237
+ const len2 = WASM_VECTOR_LEN;
238
+ const ptr3 = passStringToWasm0(user_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
239
+ const len3 = WASM_VECTOR_LEN;
240
+ const ret = wasm.engine_record_app_error(db, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
241
+ if (ret[1]) {
242
+ throw takeFromExternrefTable0(ret[0]);
243
+ }
244
+ }
245
+
246
+ /**
247
+ * @param {any} db
248
+ * @returns {any}
249
+ */
250
+ export function engine_state(db) {
251
+ const ret = wasm.engine_state(db);
252
+ if (ret[2]) {
253
+ throw takeFromExternrefTable0(ret[1]);
254
+ }
255
+ return takeFromExternrefTable0(ret[0]);
256
+ }
257
+
258
+ /**
259
+ * @returns {string}
260
+ */
261
+ export function engine_version() {
262
+ let deferred1_0;
263
+ let deferred1_1;
264
+ try {
265
+ const ret = wasm.engine_version();
266
+ deferred1_0 = ret[0];
267
+ deferred1_1 = ret[1];
268
+ return getStringFromWasm0(ret[0], ret[1]);
269
+ } finally {
270
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
271
+ }
272
+ }
273
+ function __wbg_get_imports() {
274
+ const import0 = {
275
+ __proto__: null,
276
+ __wbg_Error_92b29b0548f8b746: function(arg0, arg1) {
277
+ const ret = Error(getStringFromWasm0(arg0, arg1));
278
+ return ret;
279
+ },
280
+ __wbg_Number_9a4e0ecb0fa16705: function(arg0) {
281
+ const ret = Number(arg0);
282
+ return ret;
283
+ },
284
+ __wbg_String_8564e559799eccda: function(arg0, arg1) {
285
+ const ret = String(arg1);
286
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
287
+ const len1 = WASM_VECTOR_LEN;
288
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
289
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
290
+ },
291
+ __wbg___wbindgen_bigint_get_as_i64_d968e41184ae354f: function(arg0, arg1) {
292
+ const v = arg1;
293
+ const ret = typeof(v) === 'bigint' ? v : undefined;
294
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
295
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
296
+ },
297
+ __wbg___wbindgen_boolean_get_fa956cfa2d1bd751: function(arg0) {
298
+ const v = arg0;
299
+ const ret = typeof(v) === 'boolean' ? v : undefined;
300
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
301
+ },
302
+ __wbg___wbindgen_debug_string_c25d447a39f5578f: function(arg0, arg1) {
303
+ const ret = debugString(arg1);
304
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
305
+ const len1 = WASM_VECTOR_LEN;
306
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
307
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
308
+ },
309
+ __wbg___wbindgen_in_aca499c5de7ff5e5: function(arg0, arg1) {
310
+ const ret = arg0 in arg1;
311
+ return ret;
312
+ },
313
+ __wbg___wbindgen_is_bigint_2f76dc55065b4273: function(arg0) {
314
+ const ret = typeof(arg0) === 'bigint';
315
+ return ret;
316
+ },
317
+ __wbg___wbindgen_is_function_1ff95bcc5517c252: function(arg0) {
318
+ const ret = typeof(arg0) === 'function';
319
+ return ret;
320
+ },
321
+ __wbg___wbindgen_is_object_a27215656b807791: function(arg0) {
322
+ const val = arg0;
323
+ const ret = typeof(val) === 'object' && val !== null;
324
+ return ret;
325
+ },
326
+ __wbg___wbindgen_is_string_ea5e6cc2e4141dfe: function(arg0) {
327
+ const ret = typeof(arg0) === 'string';
328
+ return ret;
329
+ },
330
+ __wbg___wbindgen_is_undefined_c05833b95a3cf397: function(arg0) {
331
+ const ret = arg0 === undefined;
332
+ return ret;
333
+ },
334
+ __wbg___wbindgen_jsval_eq_e659fcf7b0e32763: function(arg0, arg1) {
335
+ const ret = arg0 === arg1;
336
+ return ret;
337
+ },
338
+ __wbg___wbindgen_jsval_loose_eq_db4c3b15f63fc170: function(arg0, arg1) {
339
+ const ret = arg0 == arg1;
340
+ return ret;
341
+ },
342
+ __wbg___wbindgen_memory_de265df8aadd6273: function() {
343
+ const ret = wasm.memory;
344
+ return ret;
345
+ },
346
+ __wbg___wbindgen_number_get_394265ed1e1b84ee: function(arg0, arg1) {
347
+ const obj = arg1;
348
+ const ret = typeof(obj) === 'number' ? obj : undefined;
349
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
350
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
351
+ },
352
+ __wbg___wbindgen_string_get_b0ca35b86a603356: function(arg0, arg1) {
353
+ const obj = arg1;
354
+ const ret = typeof(obj) === 'string' ? obj : undefined;
355
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
356
+ var len1 = WASM_VECTOR_LEN;
357
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
358
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
359
+ },
360
+ __wbg___wbindgen_throw_344f42d3211c4765: function(arg0, arg1) {
361
+ throw new Error(getStringFromWasm0(arg0, arg1));
362
+ },
363
+ __wbg_buffer_0f212447ac64c53b: function(arg0) {
364
+ const ret = arg0.buffer;
365
+ return ret;
366
+ },
367
+ __wbg_byteLength_47eafd0bff4dce39: function(arg0) {
368
+ const ret = arg0.byteLength;
369
+ return ret;
370
+ },
371
+ __wbg_call_8a2dd23819f8a60a: function() { return handleError(function (arg0, arg1) {
372
+ const ret = arg0.call(arg1);
373
+ return ret;
374
+ }, arguments); },
375
+ __wbg_done_89b2b13e91a60321: function(arg0) {
376
+ const ret = arg0.done;
377
+ return ret;
378
+ },
379
+ __wbg_entries_015dc610cd81ede0: function(arg0) {
380
+ const ret = Object.entries(arg0);
381
+ return ret;
382
+ },
383
+ __wbg_exec_59eb0bc29e4f02ff: function() { return handleError(function (arg0, arg1, arg2, arg3) {
384
+ arg0.exec(getStringFromWasm0(arg1, arg2), arg3);
385
+ }, arguments); },
386
+ __wbg_get_507a50627bffa49b: function(arg0, arg1) {
387
+ const ret = arg0[arg1 >>> 0];
388
+ return ret;
389
+ },
390
+ __wbg_get_c7eb1f358a7654df: function() { return handleError(function (arg0, arg1) {
391
+ const ret = Reflect.get(arg0, arg1);
392
+ return ret;
393
+ }, arguments); },
394
+ __wbg_get_unchecked_6e0ad6d2a41b06f6: function(arg0, arg1) {
395
+ const ret = arg0[arg1 >>> 0];
396
+ return ret;
397
+ },
398
+ __wbg_get_with_ref_key_6412cf3094599694: function(arg0, arg1) {
399
+ const ret = arg0[arg1];
400
+ return ret;
401
+ },
402
+ __wbg_instanceof_ArrayBuffer_4480b9e0068a8adb: function(arg0) {
403
+ let result;
404
+ try {
405
+ result = arg0 instanceof ArrayBuffer;
406
+ } catch (_) {
407
+ result = false;
408
+ }
409
+ const ret = result;
410
+ return ret;
411
+ },
412
+ __wbg_instanceof_Map_e5b5e3db98422fcc: function(arg0) {
413
+ let result;
414
+ try {
415
+ result = arg0 instanceof Map;
416
+ } catch (_) {
417
+ result = false;
418
+ }
419
+ const ret = result;
420
+ return ret;
421
+ },
422
+ __wbg_instanceof_Memory_2550e651acb3f2f1: function(arg0) {
423
+ let result;
424
+ try {
425
+ result = arg0 instanceof WebAssembly.Memory;
426
+ } catch (_) {
427
+ result = false;
428
+ }
429
+ const ret = result;
430
+ return ret;
431
+ },
432
+ __wbg_instanceof_Uint8Array_309b927aaf7a3fc7: function(arg0) {
433
+ let result;
434
+ try {
435
+ result = arg0 instanceof Uint8Array;
436
+ } catch (_) {
437
+ result = false;
438
+ }
439
+ const ret = result;
440
+ return ret;
441
+ },
442
+ __wbg_isArray_0677c962b281d01a: function(arg0) {
443
+ const ret = Array.isArray(arg0);
444
+ return ret;
445
+ },
446
+ __wbg_isSafeInteger_04f36e4056f1b851: function(arg0) {
447
+ const ret = Number.isSafeInteger(arg0);
448
+ return ret;
449
+ },
450
+ __wbg_iterator_6f722e4a93058b71: function() {
451
+ const ret = Symbol.iterator;
452
+ return ret;
453
+ },
454
+ __wbg_length_1f0964f4a5e2c6d8: function(arg0) {
455
+ const ret = arg0.length;
456
+ return ret;
457
+ },
458
+ __wbg_length_370319915dc99107: function(arg0) {
459
+ const ret = arg0.length;
460
+ return ret;
461
+ },
462
+ __wbg_new_32b398fb48b6d94a: function() {
463
+ const ret = new Array();
464
+ return ret;
465
+ },
466
+ __wbg_new_7796ffc7ed656783: function() {
467
+ const ret = new Map();
468
+ return ret;
469
+ },
470
+ __wbg_new_b667d279fd5aa943: function(arg0, arg1) {
471
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
472
+ return ret;
473
+ },
474
+ __wbg_new_cd45aabdf6073e84: function(arg0) {
475
+ const ret = new Uint8Array(arg0);
476
+ return ret;
477
+ },
478
+ __wbg_new_da52cf8fe3429cb2: function() {
479
+ const ret = new Object();
480
+ return ret;
481
+ },
482
+ __wbg_next_6dbf2c0ac8cde20f: function(arg0) {
483
+ const ret = arg0.next;
484
+ return ret;
485
+ },
486
+ __wbg_next_71f2aa1cb3d1e37e: function() { return handleError(function (arg0) {
487
+ const ret = arg0.next();
488
+ return ret;
489
+ }, arguments); },
490
+ __wbg_prototypesetcall_4770620bbe4688a0: function(arg0, arg1, arg2) {
491
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
492
+ },
493
+ __wbg_query_03b6ce598fa1096c: function() { return handleError(function (arg0, arg1, arg2, arg3) {
494
+ const ret = arg0.query(getStringFromWasm0(arg1, arg2), arg3);
495
+ return ret;
496
+ }, arguments); },
497
+ __wbg_set_575dd786d51585f8: function(arg0, arg1, arg2) {
498
+ const ret = arg0.set(arg1, arg2);
499
+ return ret;
500
+ },
501
+ __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
502
+ arg0[arg1] = arg2;
503
+ },
504
+ __wbg_set_8535240470bf2500: function() { return handleError(function (arg0, arg1, arg2) {
505
+ const ret = Reflect.set(arg0, arg1, arg2);
506
+ return ret;
507
+ }, arguments); },
508
+ __wbg_set_8a16b38e4805b298: function(arg0, arg1, arg2) {
509
+ arg0[arg1 >>> 0] = arg2;
510
+ },
511
+ __wbg_value_a5d5488a9589444a: function(arg0) {
512
+ const ret = arg0.value;
513
+ return ret;
514
+ },
515
+ __wbindgen_cast_0000000000000001: function(arg0) {
516
+ // Cast intrinsic for `F64 -> Externref`.
517
+ const ret = arg0;
518
+ return ret;
519
+ },
520
+ __wbindgen_cast_0000000000000002: function(arg0) {
521
+ // Cast intrinsic for `I64 -> Externref`.
522
+ const ret = arg0;
523
+ return ret;
524
+ },
525
+ __wbindgen_cast_0000000000000003: function(arg0, arg1) {
526
+ // Cast intrinsic for `Ref(String) -> Externref`.
527
+ const ret = getStringFromWasm0(arg0, arg1);
528
+ return ret;
529
+ },
530
+ __wbindgen_cast_0000000000000004: function(arg0) {
531
+ // Cast intrinsic for `U64 -> Externref`.
532
+ const ret = BigInt.asUintN(64, arg0);
533
+ return ret;
534
+ },
535
+ __wbindgen_init_externref_table: function() {
536
+ const table = wasm.__wbindgen_externrefs;
537
+ const offset = table.grow(4);
538
+ table.set(0, undefined);
539
+ table.set(offset + 0, undefined);
540
+ table.set(offset + 1, null);
541
+ table.set(offset + 2, true);
542
+ table.set(offset + 3, false);
543
+ },
544
+ };
545
+ return {
546
+ __proto__: null,
547
+ "./sync_wasm_bg.js": import0,
548
+ };
549
+ }
550
+
551
+ function addToExternrefTable0(obj) {
552
+ const idx = wasm.__externref_table_alloc();
553
+ wasm.__wbindgen_externrefs.set(idx, obj);
554
+ return idx;
555
+ }
556
+
557
+ function debugString(val) {
558
+ // primitive types
559
+ const type = typeof val;
560
+ if (type == 'number' || type == 'boolean' || val == null) {
561
+ return `${val}`;
562
+ }
563
+ if (type == 'string') {
564
+ return `"${val}"`;
565
+ }
566
+ if (type == 'symbol') {
567
+ const description = val.description;
568
+ if (description == null) {
569
+ return 'Symbol';
570
+ } else {
571
+ return `Symbol(${description})`;
572
+ }
573
+ }
574
+ if (type == 'function') {
575
+ const name = val.name;
576
+ if (typeof name == 'string' && name.length > 0) {
577
+ return `Function(${name})`;
578
+ } else {
579
+ return 'Function';
580
+ }
581
+ }
582
+ // objects
583
+ if (Array.isArray(val)) {
584
+ const length = val.length;
585
+ let debug = '[';
586
+ if (length > 0) {
587
+ debug += debugString(val[0]);
588
+ }
589
+ for(let i = 1; i < length; i++) {
590
+ debug += ', ' + debugString(val[i]);
591
+ }
592
+ debug += ']';
593
+ return debug;
594
+ }
595
+ // Test for built-in
596
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
597
+ let className;
598
+ if (builtInMatches && builtInMatches.length > 1) {
599
+ className = builtInMatches[1];
600
+ } else {
601
+ // Failed to match the standard '[object ClassName]'
602
+ return toString.call(val);
603
+ }
604
+ if (className == 'Object') {
605
+ // we're a user defined class or Object
606
+ // JSON.stringify avoids problems with cycles, and is generally much
607
+ // easier than looping through ownProperties of `val`.
608
+ try {
609
+ return 'Object(' + JSON.stringify(val) + ')';
610
+ } catch (_) {
611
+ return 'Object';
612
+ }
613
+ }
614
+ // errors
615
+ if (val instanceof Error) {
616
+ return `${val.name}: ${val.message}\n${val.stack}`;
617
+ }
618
+ // TODO we could test for more things here, like `Set`s and `Map`s.
619
+ return className;
620
+ }
621
+
622
+ function getArrayU8FromWasm0(ptr, len) {
623
+ ptr = ptr >>> 0;
624
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
625
+ }
626
+
627
+ let cachedDataViewMemory0 = null;
628
+ function getDataViewMemory0() {
629
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
630
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
631
+ }
632
+ return cachedDataViewMemory0;
633
+ }
634
+
635
+ function getStringFromWasm0(ptr, len) {
636
+ return decodeText(ptr >>> 0, len);
637
+ }
638
+
639
+ let cachedUint8ArrayMemory0 = null;
640
+ function getUint8ArrayMemory0() {
641
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
642
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
643
+ }
644
+ return cachedUint8ArrayMemory0;
645
+ }
646
+
647
+ function handleError(f, args) {
648
+ try {
649
+ return f.apply(this, args);
650
+ } catch (e) {
651
+ const idx = addToExternrefTable0(e);
652
+ wasm.__wbindgen_exn_store(idx);
653
+ }
654
+ }
655
+
656
+ function isLikeNone(x) {
657
+ return x === undefined || x === null;
658
+ }
659
+
660
+ function passStringToWasm0(arg, malloc, realloc) {
661
+ if (realloc === undefined) {
662
+ const buf = cachedTextEncoder.encode(arg);
663
+ const ptr = malloc(buf.length, 1) >>> 0;
664
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
665
+ WASM_VECTOR_LEN = buf.length;
666
+ return ptr;
667
+ }
668
+
669
+ let len = arg.length;
670
+ let ptr = malloc(len, 1) >>> 0;
671
+
672
+ const mem = getUint8ArrayMemory0();
673
+
674
+ let offset = 0;
675
+
676
+ for (; offset < len; offset++) {
677
+ const code = arg.charCodeAt(offset);
678
+ if (code > 0x7F) break;
679
+ mem[ptr + offset] = code;
680
+ }
681
+ if (offset !== len) {
682
+ if (offset !== 0) {
683
+ arg = arg.slice(offset);
684
+ }
685
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
686
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
687
+ const ret = cachedTextEncoder.encodeInto(arg, view);
688
+
689
+ offset += ret.written;
690
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
691
+ }
692
+
693
+ WASM_VECTOR_LEN = offset;
694
+ return ptr;
695
+ }
696
+
697
+ function takeFromExternrefTable0(idx) {
698
+ const value = wasm.__wbindgen_externrefs.get(idx);
699
+ wasm.__externref_table_dealloc(idx);
700
+ return value;
701
+ }
702
+
703
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
704
+ cachedTextDecoder.decode();
705
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
706
+ let numBytesDecoded = 0;
707
+ function decodeText(ptr, len) {
708
+ numBytesDecoded += len;
709
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
710
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
711
+ cachedTextDecoder.decode();
712
+ numBytesDecoded = len;
713
+ }
714
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
715
+ }
716
+
717
+ const cachedTextEncoder = new TextEncoder();
718
+
719
+ if (!('encodeInto' in cachedTextEncoder)) {
720
+ cachedTextEncoder.encodeInto = function (arg, view) {
721
+ const buf = cachedTextEncoder.encode(arg);
722
+ view.set(buf);
723
+ return {
724
+ read: arg.length,
725
+ written: buf.length
726
+ };
727
+ };
728
+ }
729
+
730
+ let WASM_VECTOR_LEN = 0;
731
+
732
+ let wasmModule, wasmInstance, wasm;
733
+ function __wbg_finalize_init(instance, module) {
734
+ wasmInstance = instance;
735
+ wasm = instance.exports;
736
+ wasmModule = module;
737
+ cachedDataViewMemory0 = null;
738
+ cachedUint8ArrayMemory0 = null;
739
+ wasm.__wbindgen_start();
740
+ return wasm;
741
+ }
742
+
743
+ async function __wbg_load(module, imports) {
744
+ if (typeof Response === 'function' && module instanceof Response) {
745
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
746
+ try {
747
+ return await WebAssembly.instantiateStreaming(module, imports);
748
+ } catch (e) {
749
+ const validResponse = module.ok && expectedResponseType(module.type);
750
+
751
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
752
+ 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);
753
+
754
+ } else { throw e; }
755
+ }
756
+ }
757
+
758
+ const bytes = await module.arrayBuffer();
759
+ return await WebAssembly.instantiate(bytes, imports);
760
+ } else {
761
+ const instance = await WebAssembly.instantiate(module, imports);
762
+
763
+ if (instance instanceof WebAssembly.Instance) {
764
+ return { instance, module };
765
+ } else {
766
+ return instance;
767
+ }
768
+ }
769
+
770
+ function expectedResponseType(type) {
771
+ switch (type) {
772
+ case 'basic': case 'cors': case 'default': return true;
773
+ }
774
+ return false;
775
+ }
776
+ }
777
+
778
+ function initSync(module) {
779
+ if (wasm !== undefined) return wasm;
780
+
781
+
782
+ if (module !== undefined) {
783
+ if (Object.getPrototypeOf(module) === Object.prototype) {
784
+ ({module} = module)
785
+ } else {
786
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
787
+ }
788
+ }
789
+
790
+ const imports = __wbg_get_imports();
791
+ if (!(module instanceof WebAssembly.Module)) {
792
+ module = new WebAssembly.Module(module);
793
+ }
794
+ const instance = new WebAssembly.Instance(module, imports);
795
+ return __wbg_finalize_init(instance, module);
796
+ }
797
+
798
+ async function __wbg_init(module_or_path) {
799
+ if (wasm !== undefined) return wasm;
800
+
801
+
802
+ if (module_or_path !== undefined) {
803
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
804
+ ({module_or_path} = module_or_path)
805
+ } else {
806
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
807
+ }
808
+ }
809
+
810
+ if (module_or_path === undefined) {
811
+ module_or_path = new URL('sync_wasm_bg.wasm', import.meta.url);
812
+ }
813
+ const imports = __wbg_get_imports();
814
+
815
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
816
+ module_or_path = fetch(module_or_path);
817
+ }
818
+
819
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
820
+
821
+ return __wbg_finalize_init(instance, module);
822
+ }
823
+
824
+ export { initSync, __wbg_init as default };