@cereusdb/standard 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,964 @@
1
+ import { createEnvImports, createWasiImports, setMemory } from "./env_shim.js?v=ehfix-20260406-1";
2
+ const __env = createEnvImports();
3
+ const __wasi = createWasiImports();
4
+ /* @ts-self-types="./cereusdb.d.ts" */
5
+
6
+ /**
7
+ * Main CereusDB instance for browser use.
8
+ * Wraps a DataFusion SessionContext with spatial extensions registered.
9
+ */
10
+ export class CereusDB {
11
+ static __wrap(ptr) {
12
+ ptr = ptr >>> 0;
13
+ const obj = Object.create(CereusDB.prototype);
14
+ obj.__wbg_ptr = ptr;
15
+ CereusDBFinalization.register(obj, obj.__wbg_ptr, obj);
16
+ return obj;
17
+ }
18
+ __destroy_into_raw() {
19
+ const ptr = this.__wbg_ptr;
20
+ this.__wbg_ptr = 0;
21
+ CereusDBFinalization.unregister(this);
22
+ return ptr;
23
+ }
24
+ free() {
25
+ const ptr = this.__destroy_into_raw();
26
+ __wbg_termination_guard();
27
+ try {
28
+ wasm.__wbg_cereusdb_free(ptr, 0);
29
+ } catch(e) {
30
+ __wbg_handle_catch(e);
31
+ }
32
+
33
+ }
34
+ /**
35
+ * Create a new CereusDB instance.
36
+ * Initializes DataFusion context and registers all spatial functions.
37
+ * @returns {CereusDB}
38
+ */
39
+ static create() {
40
+ let ret;
41
+ __wbg_termination_guard();
42
+ try {
43
+ ret = wasm.cereusdb_create();;
44
+ } catch(e) {
45
+ __wbg_handle_catch(e);
46
+ }
47
+ if (ret[2]) {
48
+ throw takeFromExternrefTable0(ret[1]);
49
+ }
50
+ return CereusDB.__wrap(ret[0]);
51
+ }
52
+ /**
53
+ * Drop a registered table.
54
+ * @param {string} table_name
55
+ */
56
+ drop_table(table_name) {
57
+ const ptr0 = passStringToWasm0(table_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
58
+ const len0 = WASM_VECTOR_LEN;
59
+ let ret;
60
+ __wbg_termination_guard();
61
+ try {
62
+ ret = wasm.cereusdb_drop_table(this.__wbg_ptr, ptr0, len0);;
63
+ } catch(e) {
64
+ __wbg_handle_catch(e);
65
+ }
66
+ if (ret[1]) {
67
+ throw takeFromExternrefTable0(ret[0]);
68
+ }
69
+ }
70
+ /**
71
+ * Register a GeoJSON string as a named table.
72
+ * @param {string} table_name
73
+ * @param {string} geojson
74
+ */
75
+ register_geojson(table_name, geojson) {
76
+ const ptr0 = passStringToWasm0(table_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
77
+ const len0 = WASM_VECTOR_LEN;
78
+ const ptr1 = passStringToWasm0(geojson, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
79
+ const len1 = WASM_VECTOR_LEN;
80
+ let ret;
81
+ __wbg_termination_guard();
82
+ try {
83
+ ret = wasm.cereusdb_register_geojson(this.__wbg_ptr, ptr0, len0, ptr1, len1);;
84
+ } catch(e) {
85
+ __wbg_handle_catch(e);
86
+ }
87
+ if (ret[1]) {
88
+ throw takeFromExternrefTable0(ret[0]);
89
+ }
90
+ }
91
+ /**
92
+ * Register a GeoTIFF buffer as a single-column raster table.
93
+ * Requires the full GDAL-enabled build.
94
+ * @param {string} table_name
95
+ * @param {Uint8Array} data
96
+ */
97
+ register_geotiff_buffer(table_name, data) {
98
+ const ptr0 = passStringToWasm0(table_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
99
+ const len0 = WASM_VECTOR_LEN;
100
+ const ptr1 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
101
+ const len1 = WASM_VECTOR_LEN;
102
+ let ret;
103
+ __wbg_termination_guard();
104
+ try {
105
+ ret = wasm.cereusdb_register_geotiff_buffer(this.__wbg_ptr, ptr0, len0, ptr1, len1);;
106
+ } catch(e) {
107
+ __wbg_handle_catch(e);
108
+ }
109
+ if (ret[1]) {
110
+ throw takeFromExternrefTable0(ret[0]);
111
+ }
112
+ }
113
+ /**
114
+ * Register a Uint8Array containing Parquet data as a named table.
115
+ * Use for files obtained via the browser File API.
116
+ * @param {string} table_name
117
+ * @param {Uint8Array} data
118
+ * @returns {Promise<void>}
119
+ */
120
+ register_parquet_buffer(table_name, data) {
121
+ const ptr0 = passStringToWasm0(table_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
122
+ const len0 = WASM_VECTOR_LEN;
123
+ const ptr1 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
124
+ const len1 = WASM_VECTOR_LEN;
125
+ let ret;
126
+ __wbg_termination_guard();
127
+ try {
128
+ ret = wasm.cereusdb_register_parquet_buffer(this.__wbg_ptr, ptr0, len0, ptr1, len1);;
129
+ } catch(e) {
130
+ __wbg_handle_catch(e);
131
+ }
132
+ return ret;
133
+ }
134
+ /**
135
+ * Register a raster buffer as a single-column raster table.
136
+ * Requires the full GDAL-enabled build.
137
+ * @param {string} table_name
138
+ * @param {string} format
139
+ * @param {Uint8Array} data
140
+ */
141
+ register_raster_buffer(table_name, format, data) {
142
+ const ptr0 = passStringToWasm0(table_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
143
+ const len0 = WASM_VECTOR_LEN;
144
+ const ptr1 = passStringToWasm0(format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
145
+ const len1 = WASM_VECTOR_LEN;
146
+ const ptr2 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
147
+ const len2 = WASM_VECTOR_LEN;
148
+ let ret;
149
+ __wbg_termination_guard();
150
+ try {
151
+ ret = wasm.cereusdb_register_raster_buffer(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);;
152
+ } catch(e) {
153
+ __wbg_handle_catch(e);
154
+ }
155
+ if (ret[1]) {
156
+ throw takeFromExternrefTable0(ret[0]);
157
+ }
158
+ }
159
+ /**
160
+ * Register a remote Parquet file URL as a named table.
161
+ * Pre-fetches the entire file via HTTP, then loads into memory.
162
+ * The server must support CORS.
163
+ * @param {string} table_name
164
+ * @param {string} url
165
+ * @returns {Promise<void>}
166
+ */
167
+ register_remote_parquet(table_name, url) {
168
+ const ptr0 = passStringToWasm0(table_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
169
+ const len0 = WASM_VECTOR_LEN;
170
+ const ptr1 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
171
+ const len1 = WASM_VECTOR_LEN;
172
+ let ret;
173
+ __wbg_termination_guard();
174
+ try {
175
+ ret = wasm.cereusdb_register_remote_parquet(this.__wbg_ptr, ptr0, len0, ptr1, len1);;
176
+ } catch(e) {
177
+ __wbg_handle_catch(e);
178
+ }
179
+ return ret;
180
+ }
181
+ /**
182
+ * Execute a SQL query.
183
+ * Returns results as Arrow IPC bytes (Uint8Array).
184
+ * The caller can decode this with the apache-arrow JS library.
185
+ * @param {string} query
186
+ * @returns {Promise<Uint8Array>}
187
+ */
188
+ sql(query) {
189
+ const ptr0 = passStringToWasm0(query, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
190
+ const len0 = WASM_VECTOR_LEN;
191
+ let ret;
192
+ __wbg_termination_guard();
193
+ try {
194
+ ret = wasm.cereusdb_sql(this.__wbg_ptr, ptr0, len0);;
195
+ } catch(e) {
196
+ __wbg_handle_catch(e);
197
+ }
198
+ return ret;
199
+ }
200
+ /**
201
+ * Execute a SQL query and return results as a JSON string.
202
+ * Convenience method for simple use cases.
203
+ * @param {string} query
204
+ * @returns {Promise<string>}
205
+ */
206
+ sql_json(query) {
207
+ const ptr0 = passStringToWasm0(query, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
208
+ const len0 = WASM_VECTOR_LEN;
209
+ let ret;
210
+ __wbg_termination_guard();
211
+ try {
212
+ ret = wasm.cereusdb_sql_json(this.__wbg_ptr, ptr0, len0);;
213
+ } catch(e) {
214
+ __wbg_handle_catch(e);
215
+ }
216
+ return ret;
217
+ }
218
+ /**
219
+ * List all registered table names.
220
+ * @returns {any}
221
+ */
222
+ tables() {
223
+ let ret;
224
+ __wbg_termination_guard();
225
+ try {
226
+ ret = wasm.cereusdb_tables(this.__wbg_ptr);;
227
+ } catch(e) {
228
+ __wbg_handle_catch(e);
229
+ }
230
+ if (ret[2]) {
231
+ throw takeFromExternrefTable0(ret[1]);
232
+ }
233
+ return takeFromExternrefTable0(ret[0]);
234
+ }
235
+ /**
236
+ * Get version information.
237
+ * @returns {string}
238
+ */
239
+ version() {
240
+ let deferred1_0;
241
+ let deferred1_1;
242
+ try {
243
+ let ret;
244
+ __wbg_termination_guard();
245
+ try {
246
+ ret = wasm.cereusdb_version(this.__wbg_ptr);;
247
+ } catch(e) {
248
+ __wbg_handle_catch(e);
249
+ }
250
+ deferred1_0 = ret[0];
251
+ deferred1_1 = ret[1];
252
+ return getStringFromWasm0(ret[0], ret[1]);
253
+ } finally {
254
+ __wbg_termination_guard();
255
+ try {
256
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
257
+ } catch(e) {
258
+ __wbg_handle_catch(e);
259
+ }
260
+ }
261
+ }
262
+ }
263
+ if (Symbol.dispose) CereusDB.prototype[Symbol.dispose] = CereusDB.prototype.free;
264
+ const import1 = __env;
265
+ const import2 = __env;
266
+ const import3 = __env;
267
+ const import4 = __env;
268
+ const import5 = __env;
269
+ const import6 = __env;
270
+ const import7 = __wasi;
271
+ const import8 = __wasi;
272
+ const import9 = __wasi;
273
+ const import10 = __wasi;
274
+ const import11 = __wasi;
275
+ const import12 = __wasi;
276
+ const import13 = __env;
277
+ const import14 = __env;
278
+ const import15 = __env;
279
+ const import16 = __wasi;
280
+ const import17 = __env;
281
+ const import18 = __env;
282
+ const import19 = __env;
283
+ const import20 = __env;
284
+ const import21 = __env;
285
+ const import22 = __env;
286
+ const import23 = __env;
287
+ const import24 = __env;
288
+ const import25 = __wasi;
289
+ const import26 = __env;
290
+ const import27 = __env;
291
+ const import28 = __env;
292
+ const import29 = __env;
293
+ const import30 = __env;
294
+ const import31 = __env;
295
+ const import32 = __env;
296
+ const import33 = __env;
297
+ const import34 = __wasi;
298
+ const import35 = __wasi;
299
+ const import36 = __env;
300
+ const import37 = __env;
301
+ const import38 = __env;
302
+ const import39 = __env;
303
+ const import40 = __env;
304
+ const import41 = __env;
305
+ const import42 = __env;
306
+ const import43 = __env;
307
+ const import44 = __wasi;
308
+
309
+ function __wbg_get_imports() {
310
+ const import0 = {
311
+ __proto__: null,
312
+ __wbg_String_8564e559799eccda: function(arg0, arg1) {
313
+ const ret = String(arg1);
314
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
315
+ const len1 = WASM_VECTOR_LEN;
316
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
317
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
318
+ },
319
+ __wbg___wbindgen_debug_string_5398f5bb970e0daa: function(arg0, arg1) {
320
+ const ret = debugString(arg1);
321
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
322
+ const len1 = WASM_VECTOR_LEN;
323
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
324
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
325
+ },
326
+ __wbg___wbindgen_is_function_3c846841762788c1: function(arg0) {
327
+ const ret = typeof(arg0) === 'function';
328
+ return ret;
329
+ },
330
+ __wbg___wbindgen_is_undefined_52709e72fb9f179c: function(arg0) {
331
+ const ret = arg0 === undefined;
332
+ return ret;
333
+ },
334
+ __wbg___wbindgen_throw_6ddd609b62940d55: function(arg0, arg1) {
335
+ throw new WebAssembly.Exception(__wbindgen_wrapped_jstag, [new Error(getStringFromWasm0(arg0, arg1))]);
336
+ },
337
+ __wbg__wbg_cb_unref_6b5b6b8576d35cb1: function(arg0) {
338
+ arg0._wbg_cb_unref();
339
+ },
340
+ __wbg_arrayBuffer_eb8e9ca620af2a19: function(arg0) {
341
+ const ret = arg0.arrayBuffer();
342
+ return ret;
343
+ },
344
+ __wbg_call_2d781c1f4d5c0ef8: function(arg0, arg1, arg2) {
345
+ const ret = arg0.call(arg1, arg2);
346
+ return ret;
347
+ },
348
+ __wbg_error_a6fa202b58aa1cd3: function(arg0, arg1) {
349
+ let deferred0_0;
350
+ let deferred0_1;
351
+ try {
352
+ deferred0_0 = arg0;
353
+ deferred0_1 = arg1;
354
+ console.error(getStringFromWasm0(arg0, arg1));
355
+ } finally {
356
+ __wbg_termination_guard();
357
+ try {
358
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
359
+ } catch(e) {
360
+ __wbg_handle_catch(e);
361
+ }
362
+ }
363
+ },
364
+ __wbg_fetch_5550a88cf343aaa9: function(arg0, arg1) {
365
+ const ret = arg0.fetch(arg1);
366
+ return ret;
367
+ },
368
+ __wbg_fetch_f8a611684c3b5fe5: function(arg0, arg1) {
369
+ const ret = arg0.fetch(arg1);
370
+ return ret;
371
+ },
372
+ __wbg_getRandomValues_3f44b700395062e5: function(arg0, arg1) {
373
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
374
+ },
375
+ __wbg_getRandomValues_a1cf2e70b003a59d: function(arg0, arg1) {
376
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
377
+ },
378
+ __wbg_getTime_1dad7b5386ddd2d9: function(arg0) {
379
+ const ret = arg0.getTime();
380
+ return ret;
381
+ },
382
+ __wbg_instanceof_Response_9b4d9fd451e051b1: function(arg0) {
383
+ let result;
384
+ try {
385
+ result = arg0 instanceof Response;
386
+ } catch (_) {
387
+ result = false;
388
+ }
389
+ const ret = result;
390
+ return ret;
391
+ },
392
+ __wbg_instanceof_Window_23e677d2c6843922: function(arg0) {
393
+ let result;
394
+ try {
395
+ result = arg0 instanceof Window;
396
+ } catch (_) {
397
+ result = false;
398
+ }
399
+ const ret = result;
400
+ return ret;
401
+ },
402
+ __wbg_length_ea16607d7b61445b: function(arg0) {
403
+ const ret = arg0.length;
404
+ return ret;
405
+ },
406
+ __wbg_log_524eedafa26daa59: function(arg0) {
407
+ console.log(arg0);
408
+ },
409
+ __wbg_new_0_1dcafdf5e786e876: function() {
410
+ const ret = new Date();
411
+ return ret;
412
+ },
413
+ __wbg_new_227d7c05414eb861: function() {
414
+ const ret = new Error();
415
+ return ret;
416
+ },
417
+ __wbg_new_5f486cdf45a04d78: function(arg0) {
418
+ const ret = new Uint8Array(arg0);
419
+ return ret;
420
+ },
421
+ __wbg_new_a70fbab9066b301f: function() {
422
+ const ret = new Array();
423
+ return ret;
424
+ },
425
+ __wbg_new_ab79df5bd7c26067: function() {
426
+ const ret = new Object();
427
+ return ret;
428
+ },
429
+ __wbg_new_typed_aaaeaf29cf802876: function(arg0, arg1) {
430
+ try {
431
+ var state0 = {a: arg0, b: arg1};
432
+ var cb0 = (arg0, arg1) => {
433
+ const a = state0.a;
434
+ state0.a = 0;
435
+ try {
436
+ return wasm_bindgen__convert__closures_____invoke__h34d4f60983fa9e41(a, state0.b, arg0, arg1);
437
+ } finally {
438
+ state0.a = a;
439
+ }
440
+ };
441
+ const ret = new Promise(cb0);
442
+ return ret;
443
+ } finally {
444
+ state0.a = state0.b = 0;
445
+ }
446
+ },
447
+ __wbg_new_with_length_825018a1616e9e55: function(arg0) {
448
+ const ret = new Uint8Array(arg0 >>> 0);
449
+ return ret;
450
+ },
451
+ __wbg_new_with_str_and_init_b4b54d1a819bc724: function(arg0, arg1, arg2) {
452
+ const ret = new Request(getStringFromWasm0(arg0, arg1), arg2);
453
+ return ret;
454
+ },
455
+ __wbg_now_e7c6795a7f81e10f: function(arg0) {
456
+ const ret = arg0.now();
457
+ return ret;
458
+ },
459
+ __wbg_ok_7ec8b94facac7704: function(arg0) {
460
+ const ret = arg0.ok;
461
+ return ret;
462
+ },
463
+ __wbg_performance_3fcf6e32a7e1ed0a: function(arg0) {
464
+ const ret = arg0.performance;
465
+ return ret;
466
+ },
467
+ __wbg_prototypesetcall_d62e5099504357e6: function(arg0, arg1, arg2) {
468
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
469
+ },
470
+ __wbg_queueMicrotask_0c399741342fb10f: function(arg0) {
471
+ const ret = arg0.queueMicrotask;
472
+ return ret;
473
+ },
474
+ __wbg_queueMicrotask_a082d78ce798393e: function(arg0) {
475
+ queueMicrotask(arg0);
476
+ },
477
+ __wbg_resolve_ae8d83246e5bcc12: function(arg0) {
478
+ const ret = Promise.resolve(arg0);
479
+ return ret;
480
+ },
481
+ __wbg_set_282384002438957f: function(arg0, arg1, arg2) {
482
+ arg0[arg1 >>> 0] = arg2;
483
+ },
484
+ __wbg_set_8c0b3ffcf05d61c2: function(arg0, arg1, arg2) {
485
+ arg0.set(getArrayU8FromWasm0(arg1, arg2));
486
+ },
487
+ __wbg_set_method_8c015e8bcafd7be1: function(arg0, arg1, arg2) {
488
+ arg0.method = getStringFromWasm0(arg1, arg2);
489
+ },
490
+ __wbg_set_mode_5a87f2c809cf37c2: function(arg0, arg1) {
491
+ arg0.mode = __wbindgen_enum_RequestMode[arg1];
492
+ },
493
+ __wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
494
+ const ret = arg1.stack;
495
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
496
+ const len1 = WASM_VECTOR_LEN;
497
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
498
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
499
+ },
500
+ __wbg_static_accessor_GLOBAL_8adb955bd33fac2f: function() {
501
+ const ret = typeof global === 'undefined' ? null : global;
502
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
503
+ },
504
+ __wbg_static_accessor_GLOBAL_THIS_ad356e0db91c7913: function() {
505
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
506
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
507
+ },
508
+ __wbg_static_accessor_SELF_f207c857566db248: function() {
509
+ const ret = typeof self === 'undefined' ? null : self;
510
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
511
+ },
512
+ __wbg_static_accessor_WINDOW_bb9f1ba69d61b386: function() {
513
+ const ret = typeof window === 'undefined' ? null : window;
514
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
515
+ },
516
+ __wbg_status_318629ab93a22955: function(arg0) {
517
+ const ret = arg0.status;
518
+ return ret;
519
+ },
520
+ __wbg_then_098abe61755d12f6: function(arg0, arg1) {
521
+ const ret = arg0.then(arg1);
522
+ return ret;
523
+ },
524
+ __wbg_then_9e335f6dd892bc11: function(arg0, arg1, arg2) {
525
+ const ret = arg0.then(arg1, arg2);
526
+ return ret;
527
+ },
528
+ __wbindgen_cast_0000000000000001: function(arg0, arg1) {
529
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 7159, function: Function { arguments: [Externref], shim_idx: 22230, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
530
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__he74b42d6a982a3c3, wasm_bindgen__convert__closures_____invoke__hf2284274f3d5489c);
531
+ return ret;
532
+ },
533
+ __wbindgen_cast_0000000000000002: function(arg0, arg1) {
534
+ // Cast intrinsic for `Ref(String) -> Externref`.
535
+ const ret = getStringFromWasm0(arg0, arg1);
536
+ return ret;
537
+ },
538
+ __wbindgen_init_externref_table: function() {
539
+ const table = wasm.__wbindgen_externrefs;
540
+ const offset = table.grow(4);
541
+ table.set(0, undefined);
542
+ table.set(offset + 0, undefined);
543
+ table.set(offset + 1, null);
544
+ table.set(offset + 2, true);
545
+ table.set(offset + 3, false);
546
+ },
547
+ __wbindgen_jstag: WebAssembly.JSTag,
548
+ __wbindgen_wrapped_jstag: __wbindgen_wrapped_jstag,
549
+ };
550
+ return {
551
+ __proto__: null,
552
+ "./cereusdb_bg.js": import0,
553
+ "env": import1,
554
+ "env": import2,
555
+ "env": import3,
556
+ "env": import4,
557
+ "env": import5,
558
+ "env": import6,
559
+ "wasi_snapshot_preview1": import7,
560
+ "wasi_snapshot_preview1": import8,
561
+ "wasi_snapshot_preview1": import9,
562
+ "wasi_snapshot_preview1": import10,
563
+ "wasi_snapshot_preview1": import11,
564
+ "wasi_snapshot_preview1": import12,
565
+ "env": import13,
566
+ "env": import14,
567
+ "env": import15,
568
+ "wasi_snapshot_preview1": import16,
569
+ "env": import17,
570
+ "env": import18,
571
+ "env": import19,
572
+ "env": import20,
573
+ "env": import21,
574
+ "env": import22,
575
+ "env": import23,
576
+ "env": import24,
577
+ "wasi_snapshot_preview1": import25,
578
+ "env": import26,
579
+ "env": import27,
580
+ "env": import28,
581
+ "env": import29,
582
+ "env": import30,
583
+ "env": import31,
584
+ "env": import32,
585
+ "env": import33,
586
+ "wasi_snapshot_preview1": import34,
587
+ "wasi_snapshot_preview1": import35,
588
+ "env": import36,
589
+ "env": import37,
590
+ "env": import38,
591
+ "env": import39,
592
+ "env": import40,
593
+ "env": import41,
594
+ "env": import42,
595
+ "env": import43,
596
+ "wasi_snapshot_preview1": import44,
597
+ };
598
+ }
599
+
600
+ const __wbindgen_wrapped_jstag = new WebAssembly.Tag({ parameters: ['externref'] });
601
+
602
+
603
+ let __wbg_terminated_addr;
604
+
605
+
606
+ function __wbg_termination_guard() {
607
+ __wbg_terminated_addr ??= wasm.__instance_terminated.value / 4;
608
+ if (getInt32ArrayMemory0()[__wbg_terminated_addr]) {
609
+ throw new Error('Module terminated');
610
+ }
611
+ }
612
+
613
+
614
+ function __wbg_handle_catch(e) {
615
+ if (e instanceof WebAssembly.Exception && e.is(__wbindgen_wrapped_jstag)) {
616
+ throw e.getArg(__wbindgen_wrapped_jstag, 0);
617
+ }
618
+ getInt32ArrayMemory0()[__wbg_terminated_addr] = 1;
619
+ throw e;
620
+ }
621
+ function wasm_bindgen__convert__closures_____invoke__hf2284274f3d5489c(arg0, arg1, arg2) {
622
+ let ret;
623
+ __wbg_termination_guard();
624
+ try {
625
+ ret = wasm.wasm_bindgen__convert__closures_____invoke__hf2284274f3d5489c(arg0, arg1, arg2);;
626
+ } catch(e) {
627
+ __wbg_handle_catch(e);
628
+ }
629
+ if (ret[1]) {
630
+ throw takeFromExternrefTable0(ret[0]);
631
+ }
632
+ }
633
+
634
+ function wasm_bindgen__convert__closures_____invoke__h34d4f60983fa9e41(arg0, arg1, arg2, arg3) {
635
+ __wbg_termination_guard();
636
+ try {
637
+ wasm.wasm_bindgen__convert__closures_____invoke__h34d4f60983fa9e41(arg0, arg1, arg2, arg3);
638
+ } catch(e) {
639
+ __wbg_handle_catch(e);
640
+ }
641
+ }
642
+
643
+
644
+ const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
645
+ const CereusDBFinalization = (typeof FinalizationRegistry === 'undefined')
646
+ ? { register: () => {}, unregister: () => {} }
647
+ : new FinalizationRegistry(ptr => wasm.__wbg_cereusdb_free(ptr >>> 0, 1));
648
+
649
+ function addToExternrefTable0(obj) {
650
+ const idx = wasm.__externref_table_alloc();
651
+ wasm.__wbindgen_externrefs.set(idx, obj);
652
+ return idx;
653
+ }
654
+
655
+ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
656
+ ? { register: () => {}, unregister: () => {} }
657
+ : new FinalizationRegistry(state => state.dtor(state.a, state.b));
658
+
659
+ function debugString(val) {
660
+ // primitive types
661
+ const type = typeof val;
662
+ if (type == 'number' || type == 'boolean' || val == null) {
663
+ return `${val}`;
664
+ }
665
+ if (type == 'string') {
666
+ return `"${val}"`;
667
+ }
668
+ if (type == 'symbol') {
669
+ const description = val.description;
670
+ if (description == null) {
671
+ return 'Symbol';
672
+ } else {
673
+ return `Symbol(${description})`;
674
+ }
675
+ }
676
+ if (type == 'function') {
677
+ const name = val.name;
678
+ if (typeof name == 'string' && name.length > 0) {
679
+ return `Function(${name})`;
680
+ } else {
681
+ return 'Function';
682
+ }
683
+ }
684
+ // objects
685
+ if (Array.isArray(val)) {
686
+ const length = val.length;
687
+ let debug = '[';
688
+ if (length > 0) {
689
+ debug += debugString(val[0]);
690
+ }
691
+ for(let i = 1; i < length; i++) {
692
+ debug += ', ' + debugString(val[i]);
693
+ }
694
+ debug += ']';
695
+ return debug;
696
+ }
697
+ // Test for built-in
698
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
699
+ let className;
700
+ if (builtInMatches && builtInMatches.length > 1) {
701
+ className = builtInMatches[1];
702
+ } else {
703
+ // Failed to match the standard '[object ClassName]'
704
+ return toString.call(val);
705
+ }
706
+ if (className == 'Object') {
707
+ // we're a user defined class or Object
708
+ // JSON.stringify avoids problems with cycles, and is generally much
709
+ // easier than looping through ownProperties of `val`.
710
+ try {
711
+ return 'Object(' + JSON.stringify(val) + ')';
712
+ } catch (_) {
713
+ return 'Object';
714
+ }
715
+ }
716
+ // errors
717
+ if (val instanceof Error) {
718
+ return `${val.name}: ${val.message}\n${val.stack}`;
719
+ }
720
+ // TODO we could test for more things here, like `Set`s and `Map`s.
721
+ return className;
722
+ }
723
+
724
+ function getArrayU8FromWasm0(ptr, len) {
725
+ ptr = ptr >>> 0;
726
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
727
+ }
728
+
729
+ let cachedDataViewMemory0 = null;
730
+ function getDataViewMemory0() {
731
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
732
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
733
+ }
734
+ return cachedDataViewMemory0;
735
+ }
736
+
737
+ let cachedInt32ArrayMemory0 = null;
738
+ function getInt32ArrayMemory0() {
739
+ if (cachedInt32ArrayMemory0 === null || cachedInt32ArrayMemory0.byteLength === 0) {
740
+ cachedInt32ArrayMemory0 = new Int32Array(wasm.memory.buffer);
741
+ }
742
+ return cachedInt32ArrayMemory0;
743
+ }
744
+
745
+ function getStringFromWasm0(ptr, len) {
746
+ ptr = ptr >>> 0;
747
+ return decodeText(ptr, len);
748
+ }
749
+
750
+ let cachedUint8ArrayMemory0 = null;
751
+ function getUint8ArrayMemory0() {
752
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
753
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
754
+ }
755
+ return cachedUint8ArrayMemory0;
756
+ }
757
+
758
+ function isLikeNone(x) {
759
+ return x === undefined || x === null;
760
+ }
761
+
762
+ function makeMutClosure(arg0, arg1, dtor, f) {
763
+ const state = { a: arg0, b: arg1, cnt: 1, dtor };
764
+ const real = (...args) => {
765
+
766
+ // First up with a closure we increment the internal reference
767
+ // count. This ensures that the Rust closure environment won't
768
+ // be deallocated while we're invoking it.
769
+ state.cnt++;
770
+ const a = state.a;
771
+ state.a = 0;
772
+ try {
773
+ return f(a, state.b, ...args);
774
+ } finally {
775
+ state.a = a;
776
+ real._wbg_cb_unref();
777
+ }
778
+ };
779
+ real._wbg_cb_unref = () => {
780
+ if (--state.cnt === 0) {
781
+ state.dtor(state.a, state.b);
782
+ state.a = 0;
783
+ CLOSURE_DTORS.unregister(state);
784
+ }
785
+ };
786
+ CLOSURE_DTORS.register(real, state, state);
787
+ return real;
788
+ }
789
+
790
+ function passArray8ToWasm0(arg, malloc) {
791
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
792
+ getUint8ArrayMemory0().set(arg, ptr / 1);
793
+ WASM_VECTOR_LEN = arg.length;
794
+ return ptr;
795
+ }
796
+
797
+ function passStringToWasm0(arg, malloc, realloc) {
798
+ if (realloc === undefined) {
799
+ const buf = cachedTextEncoder.encode(arg);
800
+ const ptr = malloc(buf.length, 1) >>> 0;
801
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
802
+ WASM_VECTOR_LEN = buf.length;
803
+ return ptr;
804
+ }
805
+
806
+ let len = arg.length;
807
+ let ptr = malloc(len, 1) >>> 0;
808
+
809
+ const mem = getUint8ArrayMemory0();
810
+
811
+ let offset = 0;
812
+
813
+ for (; offset < len; offset++) {
814
+ const code = arg.charCodeAt(offset);
815
+ if (code > 0x7F) break;
816
+ mem[ptr + offset] = code;
817
+ }
818
+ if (offset !== len) {
819
+ if (offset !== 0) {
820
+ arg = arg.slice(offset);
821
+ }
822
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
823
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
824
+ const ret = cachedTextEncoder.encodeInto(arg, view);
825
+
826
+ offset += ret.written;
827
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
828
+ }
829
+
830
+ WASM_VECTOR_LEN = offset;
831
+ return ptr;
832
+ }
833
+
834
+ function takeFromExternrefTable0(idx) {
835
+ const value = wasm.__wbindgen_externrefs.get(idx);
836
+ wasm.__externref_table_dealloc(idx);
837
+ return value;
838
+ }
839
+
840
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
841
+ cachedTextDecoder.decode();
842
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
843
+ let numBytesDecoded = 0;
844
+ function decodeText(ptr, len) {
845
+ numBytesDecoded += len;
846
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
847
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
848
+ cachedTextDecoder.decode();
849
+ numBytesDecoded = len;
850
+ }
851
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
852
+ }
853
+
854
+ const cachedTextEncoder = new TextEncoder();
855
+
856
+ if (!('encodeInto' in cachedTextEncoder)) {
857
+ cachedTextEncoder.encodeInto = function (arg, view) {
858
+ const buf = cachedTextEncoder.encode(arg);
859
+ view.set(buf);
860
+ return {
861
+ read: arg.length,
862
+ written: buf.length
863
+ };
864
+ };
865
+ }
866
+
867
+ let WASM_VECTOR_LEN = 0;
868
+
869
+ let wasmModule, wasm;
870
+ function __wbg_finalize_init(instance, module) {
871
+ wasm = instance.exports;
872
+ wasmModule = module;
873
+ cachedDataViewMemory0 = null;
874
+ cachedInt32ArrayMemory0 = null;
875
+ cachedUint8ArrayMemory0 = null;
876
+ if (typeof wasm.__wasm_call_ctors === "function") wasm.__wasm_call_ctors();
877
+ wasm.__wbindgen_start();
878
+ return wasm;
879
+ }
880
+
881
+ async function __wbg_load(module, imports) {
882
+ if (typeof Response === 'function' && module instanceof Response) {
883
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
884
+ try {
885
+ return await WebAssembly.instantiateStreaming(module, imports);
886
+ } catch (e) {
887
+ const validResponse = module.ok && expectedResponseType(module.type);
888
+
889
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
890
+ 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);
891
+
892
+ } else { throw e; }
893
+ }
894
+ }
895
+
896
+ const bytes = await module.arrayBuffer();
897
+ return await WebAssembly.instantiate(bytes, imports);
898
+ } else {
899
+ const instance = await WebAssembly.instantiate(module, imports);
900
+
901
+ if (instance instanceof WebAssembly.Instance) {
902
+ return { instance, module };
903
+ } else {
904
+ return instance;
905
+ }
906
+ }
907
+
908
+ function expectedResponseType(type) {
909
+ switch (type) {
910
+ case 'basic': case 'cors': case 'default': return true;
911
+ }
912
+ return false;
913
+ }
914
+ }
915
+
916
+ function initSync(module) {
917
+ if (wasm !== undefined) return wasm;
918
+
919
+
920
+ if (module !== undefined) {
921
+ if (Object.getPrototypeOf(module) === Object.prototype) {
922
+ ({module} = module)
923
+ } else {
924
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
925
+ }
926
+ }
927
+
928
+ const imports = __wbg_get_imports();
929
+ if (!(module instanceof WebAssembly.Module)) {
930
+ module = new WebAssembly.Module(module);
931
+ }
932
+ const instance = new WebAssembly.Instance(module, imports);
933
+ if (instance.exports && instance.exports.memory) setMemory(instance.exports.memory);
934
+ return __wbg_finalize_init(instance, module);
935
+ }
936
+
937
+ async function __wbg_init(module_or_path) {
938
+ if (wasm !== undefined) return wasm;
939
+
940
+
941
+ if (module_or_path !== undefined) {
942
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
943
+ ({module_or_path} = module_or_path)
944
+ } else {
945
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
946
+ }
947
+ }
948
+
949
+ if (module_or_path === undefined) {
950
+ module_or_path = new URL('cereusdb_bg.wasm', import.meta.url);
951
+ }
952
+ const imports = __wbg_get_imports();
953
+
954
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
955
+ module_or_path = fetch(module_or_path);
956
+ }
957
+
958
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
959
+
960
+ if (instance.exports && instance.exports.memory) setMemory(instance.exports.memory);
961
+ return __wbg_finalize_init(instance, module);
962
+ }
963
+
964
+ export { initSync, __wbg_init as default };