@ruvector/edge-full 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,1787 @@
1
+ let wasm;
2
+
3
+ function addHeapObject(obj) {
4
+ if (heap_next === heap.length) heap.push(heap.length + 1);
5
+ const idx = heap_next;
6
+ heap_next = heap[idx];
7
+
8
+ heap[idx] = obj;
9
+ return idx;
10
+ }
11
+
12
+ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
13
+ ? { register: () => {}, unregister: () => {} }
14
+ : new FinalizationRegistry(state => state.dtor(state.a, state.b));
15
+
16
+ function debugString(val) {
17
+ // primitive types
18
+ const type = typeof val;
19
+ if (type == 'number' || type == 'boolean' || val == null) {
20
+ return `${val}`;
21
+ }
22
+ if (type == 'string') {
23
+ return `"${val}"`;
24
+ }
25
+ if (type == 'symbol') {
26
+ const description = val.description;
27
+ if (description == null) {
28
+ return 'Symbol';
29
+ } else {
30
+ return `Symbol(${description})`;
31
+ }
32
+ }
33
+ if (type == 'function') {
34
+ const name = val.name;
35
+ if (typeof name == 'string' && name.length > 0) {
36
+ return `Function(${name})`;
37
+ } else {
38
+ return 'Function';
39
+ }
40
+ }
41
+ // objects
42
+ if (Array.isArray(val)) {
43
+ const length = val.length;
44
+ let debug = '[';
45
+ if (length > 0) {
46
+ debug += debugString(val[0]);
47
+ }
48
+ for(let i = 1; i < length; i++) {
49
+ debug += ', ' + debugString(val[i]);
50
+ }
51
+ debug += ']';
52
+ return debug;
53
+ }
54
+ // Test for built-in
55
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
56
+ let className;
57
+ if (builtInMatches && builtInMatches.length > 1) {
58
+ className = builtInMatches[1];
59
+ } else {
60
+ // Failed to match the standard '[object ClassName]'
61
+ return toString.call(val);
62
+ }
63
+ if (className == 'Object') {
64
+ // we're a user defined class or Object
65
+ // JSON.stringify avoids problems with cycles, and is generally much
66
+ // easier than looping through ownProperties of `val`.
67
+ try {
68
+ return 'Object(' + JSON.stringify(val) + ')';
69
+ } catch (_) {
70
+ return 'Object';
71
+ }
72
+ }
73
+ // errors
74
+ if (val instanceof Error) {
75
+ return `${val.name}: ${val.message}\n${val.stack}`;
76
+ }
77
+ // TODO we could test for more things here, like `Set`s and `Map`s.
78
+ return className;
79
+ }
80
+
81
+ function dropObject(idx) {
82
+ if (idx < 132) return;
83
+ heap[idx] = heap_next;
84
+ heap_next = idx;
85
+ }
86
+
87
+ function getArrayF32FromWasm0(ptr, len) {
88
+ ptr = ptr >>> 0;
89
+ return getFloat32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
90
+ }
91
+
92
+ function getArrayJsValueFromWasm0(ptr, len) {
93
+ ptr = ptr >>> 0;
94
+ const mem = getDataViewMemory0();
95
+ const result = [];
96
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
97
+ result.push(takeObject(mem.getUint32(i, true)));
98
+ }
99
+ return result;
100
+ }
101
+
102
+ function getArrayU8FromWasm0(ptr, len) {
103
+ ptr = ptr >>> 0;
104
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
105
+ }
106
+
107
+ let cachedDataViewMemory0 = null;
108
+ function getDataViewMemory0() {
109
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
110
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
111
+ }
112
+ return cachedDataViewMemory0;
113
+ }
114
+
115
+ let cachedFloat32ArrayMemory0 = null;
116
+ function getFloat32ArrayMemory0() {
117
+ if (cachedFloat32ArrayMemory0 === null || cachedFloat32ArrayMemory0.byteLength === 0) {
118
+ cachedFloat32ArrayMemory0 = new Float32Array(wasm.memory.buffer);
119
+ }
120
+ return cachedFloat32ArrayMemory0;
121
+ }
122
+
123
+ function getStringFromWasm0(ptr, len) {
124
+ ptr = ptr >>> 0;
125
+ return decodeText(ptr, len);
126
+ }
127
+
128
+ let cachedUint8ArrayMemory0 = null;
129
+ function getUint8ArrayMemory0() {
130
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
131
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
132
+ }
133
+ return cachedUint8ArrayMemory0;
134
+ }
135
+
136
+ function getObject(idx) { return heap[idx]; }
137
+
138
+ function handleError(f, args) {
139
+ try {
140
+ return f.apply(this, args);
141
+ } catch (e) {
142
+ wasm.__wbindgen_export3(addHeapObject(e));
143
+ }
144
+ }
145
+
146
+ let heap = new Array(128).fill(undefined);
147
+ heap.push(undefined, null, true, false);
148
+
149
+ let heap_next = heap.length;
150
+
151
+ function isLikeNone(x) {
152
+ return x === undefined || x === null;
153
+ }
154
+
155
+ function makeMutClosure(arg0, arg1, dtor, f) {
156
+ const state = { a: arg0, b: arg1, cnt: 1, dtor };
157
+ const real = (...args) => {
158
+
159
+ // First up with a closure we increment the internal reference
160
+ // count. This ensures that the Rust closure environment won't
161
+ // be deallocated while we're invoking it.
162
+ state.cnt++;
163
+ const a = state.a;
164
+ state.a = 0;
165
+ try {
166
+ return f(a, state.b, ...args);
167
+ } finally {
168
+ state.a = a;
169
+ real._wbg_cb_unref();
170
+ }
171
+ };
172
+ real._wbg_cb_unref = () => {
173
+ if (--state.cnt === 0) {
174
+ state.dtor(state.a, state.b);
175
+ state.a = 0;
176
+ CLOSURE_DTORS.unregister(state);
177
+ }
178
+ };
179
+ CLOSURE_DTORS.register(real, state, state);
180
+ return real;
181
+ }
182
+
183
+ function passArrayF32ToWasm0(arg, malloc) {
184
+ const ptr = malloc(arg.length * 4, 4) >>> 0;
185
+ getFloat32ArrayMemory0().set(arg, ptr / 4);
186
+ WASM_VECTOR_LEN = arg.length;
187
+ return ptr;
188
+ }
189
+
190
+ function passArrayJsValueToWasm0(array, malloc) {
191
+ const ptr = malloc(array.length * 4, 4) >>> 0;
192
+ const mem = getDataViewMemory0();
193
+ for (let i = 0; i < array.length; i++) {
194
+ mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
195
+ }
196
+ WASM_VECTOR_LEN = array.length;
197
+ return ptr;
198
+ }
199
+
200
+ function passStringToWasm0(arg, malloc, realloc) {
201
+ if (realloc === undefined) {
202
+ const buf = cachedTextEncoder.encode(arg);
203
+ const ptr = malloc(buf.length, 1) >>> 0;
204
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
205
+ WASM_VECTOR_LEN = buf.length;
206
+ return ptr;
207
+ }
208
+
209
+ let len = arg.length;
210
+ let ptr = malloc(len, 1) >>> 0;
211
+
212
+ const mem = getUint8ArrayMemory0();
213
+
214
+ let offset = 0;
215
+
216
+ for (; offset < len; offset++) {
217
+ const code = arg.charCodeAt(offset);
218
+ if (code > 0x7F) break;
219
+ mem[ptr + offset] = code;
220
+ }
221
+ if (offset !== len) {
222
+ if (offset !== 0) {
223
+ arg = arg.slice(offset);
224
+ }
225
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
226
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
227
+ const ret = cachedTextEncoder.encodeInto(arg, view);
228
+
229
+ offset += ret.written;
230
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
231
+ }
232
+
233
+ WASM_VECTOR_LEN = offset;
234
+ return ptr;
235
+ }
236
+
237
+ function takeObject(idx) {
238
+ const ret = getObject(idx);
239
+ dropObject(idx);
240
+ return ret;
241
+ }
242
+
243
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
244
+ cachedTextDecoder.decode();
245
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
246
+ let numBytesDecoded = 0;
247
+ function decodeText(ptr, len) {
248
+ numBytesDecoded += len;
249
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
250
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
251
+ cachedTextDecoder.decode();
252
+ numBytesDecoded = len;
253
+ }
254
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
255
+ }
256
+
257
+ const cachedTextEncoder = new TextEncoder();
258
+
259
+ if (!('encodeInto' in cachedTextEncoder)) {
260
+ cachedTextEncoder.encodeInto = function (arg, view) {
261
+ const buf = cachedTextEncoder.encode(arg);
262
+ view.set(buf);
263
+ return {
264
+ read: arg.length,
265
+ written: buf.length
266
+ };
267
+ }
268
+ }
269
+
270
+ let WASM_VECTOR_LEN = 0;
271
+
272
+ function __wasm_bindgen_func_elem_446(arg0, arg1, arg2) {
273
+ wasm.__wasm_bindgen_func_elem_446(arg0, arg1, addHeapObject(arg2));
274
+ }
275
+
276
+ function __wasm_bindgen_func_elem_774(arg0, arg1, arg2, arg3) {
277
+ wasm.__wasm_bindgen_func_elem_774(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
278
+ }
279
+
280
+ const AsyncQueryExecutorFinalization = (typeof FinalizationRegistry === 'undefined')
281
+ ? { register: () => {}, unregister: () => {} }
282
+ : new FinalizationRegistry(ptr => wasm.__wbg_asyncqueryexecutor_free(ptr >>> 0, 1));
283
+
284
+ const AsyncTransactionFinalization = (typeof FinalizationRegistry === 'undefined')
285
+ ? { register: () => {}, unregister: () => {} }
286
+ : new FinalizationRegistry(ptr => wasm.__wbg_asynctransaction_free(ptr >>> 0, 1));
287
+
288
+ const BatchOperationsFinalization = (typeof FinalizationRegistry === 'undefined')
289
+ ? { register: () => {}, unregister: () => {} }
290
+ : new FinalizationRegistry(ptr => wasm.__wbg_batchoperations_free(ptr >>> 0, 1));
291
+
292
+ const GraphDBFinalization = (typeof FinalizationRegistry === 'undefined')
293
+ ? { register: () => {}, unregister: () => {} }
294
+ : new FinalizationRegistry(ptr => wasm.__wbg_graphdb_free(ptr >>> 0, 1));
295
+
296
+ const JsEdgeFinalization = (typeof FinalizationRegistry === 'undefined')
297
+ ? { register: () => {}, unregister: () => {} }
298
+ : new FinalizationRegistry(ptr => wasm.__wbg_jsedge_free(ptr >>> 0, 1));
299
+
300
+ const JsHyperedgeFinalization = (typeof FinalizationRegistry === 'undefined')
301
+ ? { register: () => {}, unregister: () => {} }
302
+ : new FinalizationRegistry(ptr => wasm.__wbg_jshyperedge_free(ptr >>> 0, 1));
303
+
304
+ const JsNodeFinalization = (typeof FinalizationRegistry === 'undefined')
305
+ ? { register: () => {}, unregister: () => {} }
306
+ : new FinalizationRegistry(ptr => wasm.__wbg_jsnode_free(ptr >>> 0, 1));
307
+
308
+ const QueryResultFinalization = (typeof FinalizationRegistry === 'undefined')
309
+ ? { register: () => {}, unregister: () => {} }
310
+ : new FinalizationRegistry(ptr => wasm.__wbg_queryresult_free(ptr >>> 0, 1));
311
+
312
+ const ResultStreamFinalization = (typeof FinalizationRegistry === 'undefined')
313
+ ? { register: () => {}, unregister: () => {} }
314
+ : new FinalizationRegistry(ptr => wasm.__wbg_resultstream_free(ptr >>> 0, 1));
315
+
316
+ /**
317
+ * Async query executor for streaming results
318
+ */
319
+ export class AsyncQueryExecutor {
320
+ __destroy_into_raw() {
321
+ const ptr = this.__wbg_ptr;
322
+ this.__wbg_ptr = 0;
323
+ AsyncQueryExecutorFinalization.unregister(this);
324
+ return ptr;
325
+ }
326
+ free() {
327
+ const ptr = this.__destroy_into_raw();
328
+ wasm.__wbg_asyncqueryexecutor_free(ptr, 0);
329
+ }
330
+ /**
331
+ * Get batch size
332
+ * @returns {number}
333
+ */
334
+ get batchSize() {
335
+ const ret = wasm.asyncqueryexecutor_batchSize(this.__wbg_ptr);
336
+ return ret >>> 0;
337
+ }
338
+ /**
339
+ * Set batch size
340
+ * @param {number} size
341
+ */
342
+ set batchSize(size) {
343
+ wasm.asyncqueryexecutor_set_batchSize(this.__wbg_ptr, size);
344
+ }
345
+ /**
346
+ * Execute query in a Web Worker for background processing
347
+ * @param {string} _query
348
+ * @returns {Promise<any>}
349
+ */
350
+ executeInWorker(_query) {
351
+ const ptr0 = passStringToWasm0(_query, wasm.__wbindgen_export, wasm.__wbindgen_export2);
352
+ const len0 = WASM_VECTOR_LEN;
353
+ const ret = wasm.asyncqueryexecutor_executeInWorker(this.__wbg_ptr, ptr0, len0);
354
+ return takeObject(ret);
355
+ }
356
+ /**
357
+ * Execute query asynchronously with streaming results
358
+ * This is useful for large result sets
359
+ * @param {string} _query
360
+ * @returns {Promise<any>}
361
+ */
362
+ executeStreaming(_query) {
363
+ const ptr0 = passStringToWasm0(_query, wasm.__wbindgen_export, wasm.__wbindgen_export2);
364
+ const len0 = WASM_VECTOR_LEN;
365
+ const ret = wasm.asyncqueryexecutor_executeStreaming(this.__wbg_ptr, ptr0, len0);
366
+ return takeObject(ret);
367
+ }
368
+ /**
369
+ * Create a new async query executor
370
+ * @param {number | null} [batch_size]
371
+ */
372
+ constructor(batch_size) {
373
+ const ret = wasm.asyncqueryexecutor_new(isLikeNone(batch_size) ? 0x100000001 : (batch_size) >>> 0);
374
+ this.__wbg_ptr = ret >>> 0;
375
+ AsyncQueryExecutorFinalization.register(this, this.__wbg_ptr, this);
376
+ return this;
377
+ }
378
+ }
379
+ if (Symbol.dispose) AsyncQueryExecutor.prototype[Symbol.dispose] = AsyncQueryExecutor.prototype.free;
380
+
381
+ /**
382
+ * Async transaction handler
383
+ */
384
+ export class AsyncTransaction {
385
+ __destroy_into_raw() {
386
+ const ptr = this.__wbg_ptr;
387
+ this.__wbg_ptr = 0;
388
+ AsyncTransactionFinalization.unregister(this);
389
+ return ptr;
390
+ }
391
+ free() {
392
+ const ptr = this.__destroy_into_raw();
393
+ wasm.__wbg_asynctransaction_free(ptr, 0);
394
+ }
395
+ /**
396
+ * Check if committed
397
+ * @returns {boolean}
398
+ */
399
+ get isCommitted() {
400
+ const ret = wasm.asynctransaction_isCommitted(this.__wbg_ptr);
401
+ return ret !== 0;
402
+ }
403
+ /**
404
+ * Add operation to transaction
405
+ * @param {string} operation
406
+ */
407
+ addOperation(operation) {
408
+ const ptr0 = passStringToWasm0(operation, wasm.__wbindgen_export, wasm.__wbindgen_export2);
409
+ const len0 = WASM_VECTOR_LEN;
410
+ wasm.asynctransaction_addOperation(this.__wbg_ptr, ptr0, len0);
411
+ }
412
+ /**
413
+ * Get operation count
414
+ * @returns {number}
415
+ */
416
+ get operationCount() {
417
+ const ret = wasm.asynctransaction_operationCount(this.__wbg_ptr);
418
+ return ret >>> 0;
419
+ }
420
+ /**
421
+ * Create a new transaction
422
+ */
423
+ constructor() {
424
+ const ret = wasm.asynctransaction_new();
425
+ this.__wbg_ptr = ret >>> 0;
426
+ AsyncTransactionFinalization.register(this, this.__wbg_ptr, this);
427
+ return this;
428
+ }
429
+ /**
430
+ * Commit transaction asynchronously
431
+ * @returns {Promise<any>}
432
+ */
433
+ commit() {
434
+ const ret = wasm.asynctransaction_commit(this.__wbg_ptr);
435
+ return takeObject(ret);
436
+ }
437
+ /**
438
+ * Rollback transaction
439
+ */
440
+ rollback() {
441
+ wasm.asynctransaction_rollback(this.__wbg_ptr);
442
+ }
443
+ }
444
+ if (Symbol.dispose) AsyncTransaction.prototype[Symbol.dispose] = AsyncTransaction.prototype.free;
445
+
446
+ /**
447
+ * Batch operation executor for improved performance
448
+ */
449
+ export class BatchOperations {
450
+ __destroy_into_raw() {
451
+ const ptr = this.__wbg_ptr;
452
+ this.__wbg_ptr = 0;
453
+ BatchOperationsFinalization.unregister(this);
454
+ return ptr;
455
+ }
456
+ free() {
457
+ const ptr = this.__destroy_into_raw();
458
+ wasm.__wbg_batchoperations_free(ptr, 0);
459
+ }
460
+ /**
461
+ * Execute multiple Cypher statements in batch
462
+ * @param {string[]} statements
463
+ * @returns {Promise<any>}
464
+ */
465
+ executeBatch(statements) {
466
+ const ptr0 = passArrayJsValueToWasm0(statements, wasm.__wbindgen_export);
467
+ const len0 = WASM_VECTOR_LEN;
468
+ const ret = wasm.batchoperations_executeBatch(this.__wbg_ptr, ptr0, len0);
469
+ return takeObject(ret);
470
+ }
471
+ /**
472
+ * Get max batch size
473
+ * @returns {number}
474
+ */
475
+ get maxBatchSize() {
476
+ const ret = wasm.asyncqueryexecutor_batchSize(this.__wbg_ptr);
477
+ return ret >>> 0;
478
+ }
479
+ /**
480
+ * Create a new batch operations handler
481
+ * @param {number | null} [max_batch_size]
482
+ */
483
+ constructor(max_batch_size) {
484
+ const ret = wasm.batchoperations_new(isLikeNone(max_batch_size) ? 0x100000001 : (max_batch_size) >>> 0);
485
+ this.__wbg_ptr = ret >>> 0;
486
+ BatchOperationsFinalization.register(this, this.__wbg_ptr, this);
487
+ return this;
488
+ }
489
+ }
490
+ if (Symbol.dispose) BatchOperations.prototype[Symbol.dispose] = BatchOperations.prototype.free;
491
+
492
+ /**
493
+ * Main GraphDB class for browser usage
494
+ */
495
+ export class GraphDB {
496
+ __destroy_into_raw() {
497
+ const ptr = this.__wbg_ptr;
498
+ this.__wbg_ptr = 0;
499
+ GraphDBFinalization.unregister(this);
500
+ return ptr;
501
+ }
502
+ free() {
503
+ const ptr = this.__destroy_into_raw();
504
+ wasm.__wbg_graphdb_free(ptr, 0);
505
+ }
506
+ /**
507
+ * Create a new edge (relationship)
508
+ *
509
+ * # Arguments
510
+ * * `from` - Source node ID
511
+ * * `to` - Target node ID
512
+ * * `edge_type` - Relationship type
513
+ * * `properties` - JavaScript object with edge properties
514
+ *
515
+ * # Returns
516
+ * Edge ID
517
+ * @param {string} from
518
+ * @param {string} to
519
+ * @param {string} edge_type
520
+ * @param {any} properties
521
+ * @returns {string}
522
+ */
523
+ createEdge(from, to, edge_type, properties) {
524
+ let deferred5_0;
525
+ let deferred5_1;
526
+ try {
527
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
528
+ const ptr0 = passStringToWasm0(from, wasm.__wbindgen_export, wasm.__wbindgen_export2);
529
+ const len0 = WASM_VECTOR_LEN;
530
+ const ptr1 = passStringToWasm0(to, wasm.__wbindgen_export, wasm.__wbindgen_export2);
531
+ const len1 = WASM_VECTOR_LEN;
532
+ const ptr2 = passStringToWasm0(edge_type, wasm.__wbindgen_export, wasm.__wbindgen_export2);
533
+ const len2 = WASM_VECTOR_LEN;
534
+ wasm.graphdb_createEdge(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, addHeapObject(properties));
535
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
536
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
537
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
538
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
539
+ var ptr4 = r0;
540
+ var len4 = r1;
541
+ if (r3) {
542
+ ptr4 = 0; len4 = 0;
543
+ throw takeObject(r2);
544
+ }
545
+ deferred5_0 = ptr4;
546
+ deferred5_1 = len4;
547
+ return getStringFromWasm0(ptr4, len4);
548
+ } finally {
549
+ wasm.__wbindgen_add_to_stack_pointer(16);
550
+ wasm.__wbindgen_export4(deferred5_0, deferred5_1, 1);
551
+ }
552
+ }
553
+ /**
554
+ * Create a new node
555
+ *
556
+ * # Arguments
557
+ * * `labels` - Array of label strings
558
+ * * `properties` - JavaScript object with node properties
559
+ *
560
+ * # Returns
561
+ * Node ID
562
+ * @param {string[]} labels
563
+ * @param {any} properties
564
+ * @returns {string}
565
+ */
566
+ createNode(labels, properties) {
567
+ let deferred3_0;
568
+ let deferred3_1;
569
+ try {
570
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
571
+ const ptr0 = passArrayJsValueToWasm0(labels, wasm.__wbindgen_export);
572
+ const len0 = WASM_VECTOR_LEN;
573
+ wasm.graphdb_createNode(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(properties));
574
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
575
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
576
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
577
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
578
+ var ptr2 = r0;
579
+ var len2 = r1;
580
+ if (r3) {
581
+ ptr2 = 0; len2 = 0;
582
+ throw takeObject(r2);
583
+ }
584
+ deferred3_0 = ptr2;
585
+ deferred3_1 = len2;
586
+ return getStringFromWasm0(ptr2, len2);
587
+ } finally {
588
+ wasm.__wbindgen_add_to_stack_pointer(16);
589
+ wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
590
+ }
591
+ }
592
+ /**
593
+ * Delete an edge by ID
594
+ * @param {string} id
595
+ * @returns {boolean}
596
+ */
597
+ deleteEdge(id) {
598
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
599
+ const len0 = WASM_VECTOR_LEN;
600
+ const ret = wasm.graphdb_deleteEdge(this.__wbg_ptr, ptr0, len0);
601
+ return ret !== 0;
602
+ }
603
+ /**
604
+ * Delete a node by ID
605
+ *
606
+ * # Arguments
607
+ * * `id` - Node ID
608
+ *
609
+ * # Returns
610
+ * True if deleted, false if not found
611
+ * @param {string} id
612
+ * @returns {boolean}
613
+ */
614
+ deleteNode(id) {
615
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
616
+ const len0 = WASM_VECTOR_LEN;
617
+ const ret = wasm.graphdb_deleteNode(this.__wbg_ptr, ptr0, len0);
618
+ return ret !== 0;
619
+ }
620
+ /**
621
+ * Export database as Cypher CREATE statements
622
+ *
623
+ * # Returns
624
+ * String containing Cypher statements
625
+ * @returns {string}
626
+ */
627
+ exportCypher() {
628
+ let deferred1_0;
629
+ let deferred1_1;
630
+ try {
631
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
632
+ wasm.graphdb_exportCypher(retptr, this.__wbg_ptr);
633
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
634
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
635
+ deferred1_0 = r0;
636
+ deferred1_1 = r1;
637
+ return getStringFromWasm0(r0, r1);
638
+ } finally {
639
+ wasm.__wbindgen_add_to_stack_pointer(16);
640
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
641
+ }
642
+ }
643
+ /**
644
+ * Get a hyperedge by ID
645
+ * @param {string} id
646
+ * @returns {JsHyperedge | undefined}
647
+ */
648
+ getHyperedge(id) {
649
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
650
+ const len0 = WASM_VECTOR_LEN;
651
+ const ret = wasm.graphdb_getHyperedge(this.__wbg_ptr, ptr0, len0);
652
+ return ret === 0 ? undefined : JsHyperedge.__wrap(ret);
653
+ }
654
+ /**
655
+ * Import Cypher statements
656
+ *
657
+ * # Arguments
658
+ * * `statements` - Array of Cypher CREATE statements
659
+ *
660
+ * # Returns
661
+ * Number of statements executed
662
+ * @param {string[]} statements
663
+ * @returns {Promise<number>}
664
+ */
665
+ importCypher(statements) {
666
+ const ptr0 = passArrayJsValueToWasm0(statements, wasm.__wbindgen_export);
667
+ const len0 = WASM_VECTOR_LEN;
668
+ const ret = wasm.graphdb_importCypher(this.__wbg_ptr, ptr0, len0);
669
+ return takeObject(ret);
670
+ }
671
+ /**
672
+ * Create a hyperedge (n-ary relationship)
673
+ *
674
+ * # Arguments
675
+ * * `nodes` - Array of node IDs
676
+ * * `description` - Natural language description of the relationship
677
+ * * `embedding` - Optional embedding vector (auto-generated if not provided)
678
+ * * `confidence` - Optional confidence score (0.0-1.0, defaults to 1.0)
679
+ *
680
+ * # Returns
681
+ * Hyperedge ID
682
+ * @param {string[]} nodes
683
+ * @param {string} description
684
+ * @param {Float32Array | null} [embedding]
685
+ * @param {number | null} [confidence]
686
+ * @returns {string}
687
+ */
688
+ createHyperedge(nodes, description, embedding, confidence) {
689
+ let deferred5_0;
690
+ let deferred5_1;
691
+ try {
692
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
693
+ const ptr0 = passArrayJsValueToWasm0(nodes, wasm.__wbindgen_export);
694
+ const len0 = WASM_VECTOR_LEN;
695
+ const ptr1 = passStringToWasm0(description, wasm.__wbindgen_export, wasm.__wbindgen_export2);
696
+ const len1 = WASM_VECTOR_LEN;
697
+ var ptr2 = isLikeNone(embedding) ? 0 : passArrayF32ToWasm0(embedding, wasm.__wbindgen_export);
698
+ var len2 = WASM_VECTOR_LEN;
699
+ wasm.graphdb_createHyperedge(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, isLikeNone(confidence) ? 0x100000001 : Math.fround(confidence));
700
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
701
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
702
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
703
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
704
+ var ptr4 = r0;
705
+ var len4 = r1;
706
+ if (r3) {
707
+ ptr4 = 0; len4 = 0;
708
+ throw takeObject(r2);
709
+ }
710
+ deferred5_0 = ptr4;
711
+ deferred5_1 = len4;
712
+ return getStringFromWasm0(ptr4, len4);
713
+ } finally {
714
+ wasm.__wbindgen_add_to_stack_pointer(16);
715
+ wasm.__wbindgen_export4(deferred5_0, deferred5_1, 1);
716
+ }
717
+ }
718
+ /**
719
+ * Create a new GraphDB instance
720
+ *
721
+ * # Arguments
722
+ * * `metric` - Distance metric for hypergraph embeddings ("euclidean", "cosine", "dotproduct", "manhattan")
723
+ * @param {string | null} [metric]
724
+ */
725
+ constructor(metric) {
726
+ try {
727
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
728
+ var ptr0 = isLikeNone(metric) ? 0 : passStringToWasm0(metric, wasm.__wbindgen_export, wasm.__wbindgen_export2);
729
+ var len0 = WASM_VECTOR_LEN;
730
+ wasm.graphdb_new(retptr, ptr0, len0);
731
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
732
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
733
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
734
+ if (r2) {
735
+ throw takeObject(r1);
736
+ }
737
+ this.__wbg_ptr = r0 >>> 0;
738
+ GraphDBFinalization.register(this, this.__wbg_ptr, this);
739
+ return this;
740
+ } finally {
741
+ wasm.__wbindgen_add_to_stack_pointer(16);
742
+ }
743
+ }
744
+ /**
745
+ * Execute a Cypher query (basic implementation)
746
+ *
747
+ * # Arguments
748
+ * * `cypher` - Cypher query string
749
+ *
750
+ * # Returns
751
+ * Promise<QueryResult> with matching nodes, edges, and hyperedges
752
+ * @param {string} cypher
753
+ * @returns {Promise<QueryResult>}
754
+ */
755
+ query(cypher) {
756
+ const ptr0 = passStringToWasm0(cypher, wasm.__wbindgen_export, wasm.__wbindgen_export2);
757
+ const len0 = WASM_VECTOR_LEN;
758
+ const ret = wasm.graphdb_query(this.__wbg_ptr, ptr0, len0);
759
+ return takeObject(ret);
760
+ }
761
+ /**
762
+ * Get database statistics
763
+ * @returns {any}
764
+ */
765
+ stats() {
766
+ const ret = wasm.graphdb_stats(this.__wbg_ptr);
767
+ return takeObject(ret);
768
+ }
769
+ /**
770
+ * Get an edge by ID
771
+ * @param {string} id
772
+ * @returns {JsEdge | undefined}
773
+ */
774
+ getEdge(id) {
775
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
776
+ const len0 = WASM_VECTOR_LEN;
777
+ const ret = wasm.graphdb_getEdge(this.__wbg_ptr, ptr0, len0);
778
+ return ret === 0 ? undefined : JsEdge.__wrap(ret);
779
+ }
780
+ /**
781
+ * Get a node by ID
782
+ *
783
+ * # Arguments
784
+ * * `id` - Node ID
785
+ *
786
+ * # Returns
787
+ * JsNode or null if not found
788
+ * @param {string} id
789
+ * @returns {JsNode | undefined}
790
+ */
791
+ getNode(id) {
792
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
793
+ const len0 = WASM_VECTOR_LEN;
794
+ const ret = wasm.graphdb_getNode(this.__wbg_ptr, ptr0, len0);
795
+ return ret === 0 ? undefined : JsNode.__wrap(ret);
796
+ }
797
+ }
798
+ if (Symbol.dispose) GraphDB.prototype[Symbol.dispose] = GraphDB.prototype.free;
799
+
800
+ /**
801
+ * JavaScript-compatible Edge (relationship)
802
+ */
803
+ export class JsEdge {
804
+ static __wrap(ptr) {
805
+ ptr = ptr >>> 0;
806
+ const obj = Object.create(JsEdge.prototype);
807
+ obj.__wbg_ptr = ptr;
808
+ JsEdgeFinalization.register(obj, obj.__wbg_ptr, obj);
809
+ return obj;
810
+ }
811
+ __destroy_into_raw() {
812
+ const ptr = this.__wbg_ptr;
813
+ this.__wbg_ptr = 0;
814
+ JsEdgeFinalization.unregister(this);
815
+ return ptr;
816
+ }
817
+ free() {
818
+ const ptr = this.__destroy_into_raw();
819
+ wasm.__wbg_jsedge_free(ptr, 0);
820
+ }
821
+ /**
822
+ * @returns {any}
823
+ */
824
+ get properties() {
825
+ const ret = wasm.jsedge_properties(this.__wbg_ptr);
826
+ return takeObject(ret);
827
+ }
828
+ /**
829
+ * @param {string} key
830
+ * @returns {any}
831
+ */
832
+ getProperty(key) {
833
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_export, wasm.__wbindgen_export2);
834
+ const len0 = WASM_VECTOR_LEN;
835
+ const ret = wasm.jsedge_getProperty(this.__wbg_ptr, ptr0, len0);
836
+ return takeObject(ret);
837
+ }
838
+ /**
839
+ * @returns {string}
840
+ */
841
+ get id() {
842
+ let deferred1_0;
843
+ let deferred1_1;
844
+ try {
845
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
846
+ wasm.jsedge_id(retptr, this.__wbg_ptr);
847
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
848
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
849
+ deferred1_0 = r0;
850
+ deferred1_1 = r1;
851
+ return getStringFromWasm0(r0, r1);
852
+ } finally {
853
+ wasm.__wbindgen_add_to_stack_pointer(16);
854
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
855
+ }
856
+ }
857
+ /**
858
+ * @returns {string}
859
+ */
860
+ get to() {
861
+ let deferred1_0;
862
+ let deferred1_1;
863
+ try {
864
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
865
+ wasm.jsedge_to(retptr, this.__wbg_ptr);
866
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
867
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
868
+ deferred1_0 = r0;
869
+ deferred1_1 = r1;
870
+ return getStringFromWasm0(r0, r1);
871
+ } finally {
872
+ wasm.__wbindgen_add_to_stack_pointer(16);
873
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
874
+ }
875
+ }
876
+ /**
877
+ * @returns {string}
878
+ */
879
+ get from() {
880
+ let deferred1_0;
881
+ let deferred1_1;
882
+ try {
883
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
884
+ wasm.jsedge_from(retptr, this.__wbg_ptr);
885
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
886
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
887
+ deferred1_0 = r0;
888
+ deferred1_1 = r1;
889
+ return getStringFromWasm0(r0, r1);
890
+ } finally {
891
+ wasm.__wbindgen_add_to_stack_pointer(16);
892
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
893
+ }
894
+ }
895
+ /**
896
+ * @returns {string}
897
+ */
898
+ get type() {
899
+ let deferred1_0;
900
+ let deferred1_1;
901
+ try {
902
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
903
+ wasm.jsedge_type(retptr, this.__wbg_ptr);
904
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
905
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
906
+ deferred1_0 = r0;
907
+ deferred1_1 = r1;
908
+ return getStringFromWasm0(r0, r1);
909
+ } finally {
910
+ wasm.__wbindgen_add_to_stack_pointer(16);
911
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
912
+ }
913
+ }
914
+ }
915
+ if (Symbol.dispose) JsEdge.prototype[Symbol.dispose] = JsEdge.prototype.free;
916
+
917
+ /**
918
+ * JavaScript-compatible Hyperedge (n-ary relationship)
919
+ */
920
+ export class JsHyperedge {
921
+ static __wrap(ptr) {
922
+ ptr = ptr >>> 0;
923
+ const obj = Object.create(JsHyperedge.prototype);
924
+ obj.__wbg_ptr = ptr;
925
+ JsHyperedgeFinalization.register(obj, obj.__wbg_ptr, obj);
926
+ return obj;
927
+ }
928
+ __destroy_into_raw() {
929
+ const ptr = this.__wbg_ptr;
930
+ this.__wbg_ptr = 0;
931
+ JsHyperedgeFinalization.unregister(this);
932
+ return ptr;
933
+ }
934
+ free() {
935
+ const ptr = this.__destroy_into_raw();
936
+ wasm.__wbg_jshyperedge_free(ptr, 0);
937
+ }
938
+ /**
939
+ * @returns {number}
940
+ */
941
+ get confidence() {
942
+ const ret = wasm.jshyperedge_confidence(this.__wbg_ptr);
943
+ return ret;
944
+ }
945
+ /**
946
+ * @returns {any}
947
+ */
948
+ get properties() {
949
+ const ret = wasm.jshyperedge_properties(this.__wbg_ptr);
950
+ return takeObject(ret);
951
+ }
952
+ /**
953
+ * @returns {string}
954
+ */
955
+ get description() {
956
+ let deferred1_0;
957
+ let deferred1_1;
958
+ try {
959
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
960
+ wasm.jshyperedge_description(retptr, this.__wbg_ptr);
961
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
962
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
963
+ deferred1_0 = r0;
964
+ deferred1_1 = r1;
965
+ return getStringFromWasm0(r0, r1);
966
+ } finally {
967
+ wasm.__wbindgen_add_to_stack_pointer(16);
968
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
969
+ }
970
+ }
971
+ /**
972
+ * @returns {string}
973
+ */
974
+ get id() {
975
+ let deferred1_0;
976
+ let deferred1_1;
977
+ try {
978
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
979
+ wasm.jshyperedge_id(retptr, this.__wbg_ptr);
980
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
981
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
982
+ deferred1_0 = r0;
983
+ deferred1_1 = r1;
984
+ return getStringFromWasm0(r0, r1);
985
+ } finally {
986
+ wasm.__wbindgen_add_to_stack_pointer(16);
987
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
988
+ }
989
+ }
990
+ /**
991
+ * @returns {string[]}
992
+ */
993
+ get nodes() {
994
+ try {
995
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
996
+ wasm.jshyperedge_nodes(retptr, this.__wbg_ptr);
997
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
998
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
999
+ var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
1000
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
1001
+ return v1;
1002
+ } finally {
1003
+ wasm.__wbindgen_add_to_stack_pointer(16);
1004
+ }
1005
+ }
1006
+ /**
1007
+ * @returns {number}
1008
+ */
1009
+ get order() {
1010
+ const ret = wasm.jshyperedge_order(this.__wbg_ptr);
1011
+ return ret >>> 0;
1012
+ }
1013
+ /**
1014
+ * @returns {Float32Array}
1015
+ */
1016
+ get embedding() {
1017
+ try {
1018
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1019
+ wasm.jshyperedge_embedding(retptr, this.__wbg_ptr);
1020
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1021
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1022
+ var v1 = getArrayF32FromWasm0(r0, r1).slice();
1023
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
1024
+ return v1;
1025
+ } finally {
1026
+ wasm.__wbindgen_add_to_stack_pointer(16);
1027
+ }
1028
+ }
1029
+ }
1030
+ if (Symbol.dispose) JsHyperedge.prototype[Symbol.dispose] = JsHyperedge.prototype.free;
1031
+
1032
+ /**
1033
+ * JavaScript-compatible Node
1034
+ */
1035
+ export class JsNode {
1036
+ static __wrap(ptr) {
1037
+ ptr = ptr >>> 0;
1038
+ const obj = Object.create(JsNode.prototype);
1039
+ obj.__wbg_ptr = ptr;
1040
+ JsNodeFinalization.register(obj, obj.__wbg_ptr, obj);
1041
+ return obj;
1042
+ }
1043
+ __destroy_into_raw() {
1044
+ const ptr = this.__wbg_ptr;
1045
+ this.__wbg_ptr = 0;
1046
+ JsNodeFinalization.unregister(this);
1047
+ return ptr;
1048
+ }
1049
+ free() {
1050
+ const ptr = this.__destroy_into_raw();
1051
+ wasm.__wbg_jsnode_free(ptr, 0);
1052
+ }
1053
+ /**
1054
+ * @returns {any}
1055
+ */
1056
+ get properties() {
1057
+ const ret = wasm.jsnode_properties(this.__wbg_ptr);
1058
+ return takeObject(ret);
1059
+ }
1060
+ /**
1061
+ * Get a specific property value
1062
+ * @param {string} key
1063
+ * @returns {any}
1064
+ */
1065
+ getProperty(key) {
1066
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1067
+ const len0 = WASM_VECTOR_LEN;
1068
+ const ret = wasm.jsnode_getProperty(this.__wbg_ptr, ptr0, len0);
1069
+ return takeObject(ret);
1070
+ }
1071
+ /**
1072
+ * @returns {string}
1073
+ */
1074
+ get id() {
1075
+ let deferred1_0;
1076
+ let deferred1_1;
1077
+ try {
1078
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1079
+ wasm.jsnode_id(retptr, this.__wbg_ptr);
1080
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1081
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1082
+ deferred1_0 = r0;
1083
+ deferred1_1 = r1;
1084
+ return getStringFromWasm0(r0, r1);
1085
+ } finally {
1086
+ wasm.__wbindgen_add_to_stack_pointer(16);
1087
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
1088
+ }
1089
+ }
1090
+ /**
1091
+ * @returns {string[]}
1092
+ */
1093
+ get labels() {
1094
+ try {
1095
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1096
+ wasm.jsnode_labels(retptr, this.__wbg_ptr);
1097
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1098
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1099
+ var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
1100
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
1101
+ return v1;
1102
+ } finally {
1103
+ wasm.__wbindgen_add_to_stack_pointer(16);
1104
+ }
1105
+ }
1106
+ /**
1107
+ * @returns {Float32Array | undefined}
1108
+ */
1109
+ get embedding() {
1110
+ try {
1111
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1112
+ wasm.jsnode_embedding(retptr, this.__wbg_ptr);
1113
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1114
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1115
+ let v1;
1116
+ if (r0 !== 0) {
1117
+ v1 = getArrayF32FromWasm0(r0, r1).slice();
1118
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
1119
+ }
1120
+ return v1;
1121
+ } finally {
1122
+ wasm.__wbindgen_add_to_stack_pointer(16);
1123
+ }
1124
+ }
1125
+ /**
1126
+ * Check if node has a specific label
1127
+ * @param {string} label
1128
+ * @returns {boolean}
1129
+ */
1130
+ hasLabel(label) {
1131
+ const ptr0 = passStringToWasm0(label, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1132
+ const len0 = WASM_VECTOR_LEN;
1133
+ const ret = wasm.jsnode_hasLabel(this.__wbg_ptr, ptr0, len0);
1134
+ return ret !== 0;
1135
+ }
1136
+ }
1137
+ if (Symbol.dispose) JsNode.prototype[Symbol.dispose] = JsNode.prototype.free;
1138
+
1139
+ /**
1140
+ * Query result that can contain nodes, edges, or hyperedges
1141
+ */
1142
+ export class QueryResult {
1143
+ static __wrap(ptr) {
1144
+ ptr = ptr >>> 0;
1145
+ const obj = Object.create(QueryResult.prototype);
1146
+ obj.__wbg_ptr = ptr;
1147
+ QueryResultFinalization.register(obj, obj.__wbg_ptr, obj);
1148
+ return obj;
1149
+ }
1150
+ __destroy_into_raw() {
1151
+ const ptr = this.__wbg_ptr;
1152
+ this.__wbg_ptr = 0;
1153
+ QueryResultFinalization.unregister(this);
1154
+ return ptr;
1155
+ }
1156
+ free() {
1157
+ const ptr = this.__destroy_into_raw();
1158
+ wasm.__wbg_queryresult_free(ptr, 0);
1159
+ }
1160
+ /**
1161
+ * @returns {JsHyperedge[]}
1162
+ */
1163
+ get hyperedges() {
1164
+ try {
1165
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1166
+ wasm.queryresult_hyperedges(retptr, this.__wbg_ptr);
1167
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1168
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1169
+ var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
1170
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
1171
+ return v1;
1172
+ } finally {
1173
+ wasm.__wbindgen_add_to_stack_pointer(16);
1174
+ }
1175
+ }
1176
+ /**
1177
+ * @returns {any}
1178
+ */
1179
+ get data() {
1180
+ const ret = wasm.queryresult_data(this.__wbg_ptr);
1181
+ return takeObject(ret);
1182
+ }
1183
+ /**
1184
+ * @returns {number}
1185
+ */
1186
+ get count() {
1187
+ const ret = wasm.queryresult_count(this.__wbg_ptr);
1188
+ return ret >>> 0;
1189
+ }
1190
+ /**
1191
+ * @returns {JsEdge[]}
1192
+ */
1193
+ get edges() {
1194
+ try {
1195
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1196
+ wasm.queryresult_edges(retptr, this.__wbg_ptr);
1197
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1198
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1199
+ var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
1200
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
1201
+ return v1;
1202
+ } finally {
1203
+ wasm.__wbindgen_add_to_stack_pointer(16);
1204
+ }
1205
+ }
1206
+ /**
1207
+ * @returns {JsNode[]}
1208
+ */
1209
+ get nodes() {
1210
+ try {
1211
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1212
+ wasm.queryresult_nodes(retptr, this.__wbg_ptr);
1213
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1214
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1215
+ var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
1216
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
1217
+ return v1;
1218
+ } finally {
1219
+ wasm.__wbindgen_add_to_stack_pointer(16);
1220
+ }
1221
+ }
1222
+ /**
1223
+ * Check if result is empty
1224
+ * @returns {boolean}
1225
+ */
1226
+ isEmpty() {
1227
+ const ret = wasm.queryresult_isEmpty(this.__wbg_ptr);
1228
+ return ret !== 0;
1229
+ }
1230
+ }
1231
+ if (Symbol.dispose) QueryResult.prototype[Symbol.dispose] = QueryResult.prototype.free;
1232
+
1233
+ /**
1234
+ * Stream handler for large result sets
1235
+ */
1236
+ export class ResultStream {
1237
+ __destroy_into_raw() {
1238
+ const ptr = this.__wbg_ptr;
1239
+ this.__wbg_ptr = 0;
1240
+ ResultStreamFinalization.unregister(this);
1241
+ return ptr;
1242
+ }
1243
+ free() {
1244
+ const ptr = this.__destroy_into_raw();
1245
+ wasm.__wbg_resultstream_free(ptr, 0);
1246
+ }
1247
+ /**
1248
+ * Get chunk size
1249
+ * @returns {number}
1250
+ */
1251
+ get chunkSize() {
1252
+ const ret = wasm.asyncqueryexecutor_batchSize(this.__wbg_ptr);
1253
+ return ret >>> 0;
1254
+ }
1255
+ /**
1256
+ * Get next chunk of results
1257
+ * @returns {Promise<any>}
1258
+ */
1259
+ nextChunk() {
1260
+ const ret = wasm.resultstream_nextChunk(this.__wbg_ptr);
1261
+ return takeObject(ret);
1262
+ }
1263
+ /**
1264
+ * Create a new result stream
1265
+ * @param {number | null} [chunk_size]
1266
+ */
1267
+ constructor(chunk_size) {
1268
+ const ret = wasm.resultstream_new(isLikeNone(chunk_size) ? 0x100000001 : (chunk_size) >>> 0);
1269
+ this.__wbg_ptr = ret >>> 0;
1270
+ ResultStreamFinalization.register(this, this.__wbg_ptr, this);
1271
+ return this;
1272
+ }
1273
+ /**
1274
+ * Reset stream to beginning
1275
+ */
1276
+ reset() {
1277
+ wasm.resultstream_reset(this.__wbg_ptr);
1278
+ }
1279
+ /**
1280
+ * Get current offset
1281
+ * @returns {number}
1282
+ */
1283
+ get offset() {
1284
+ const ret = wasm.resultstream_offset(this.__wbg_ptr);
1285
+ return ret >>> 0;
1286
+ }
1287
+ }
1288
+ if (Symbol.dispose) ResultStream.prototype[Symbol.dispose] = ResultStream.prototype.free;
1289
+
1290
+ /**
1291
+ * Initialize panic hook for better error messages
1292
+ */
1293
+ export function init() {
1294
+ wasm.init();
1295
+ }
1296
+
1297
+ /**
1298
+ * Get version information
1299
+ * @returns {string}
1300
+ */
1301
+ export function version() {
1302
+ let deferred1_0;
1303
+ let deferred1_1;
1304
+ try {
1305
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1306
+ wasm.version(retptr);
1307
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1308
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1309
+ deferred1_0 = r0;
1310
+ deferred1_1 = r1;
1311
+ return getStringFromWasm0(r0, r1);
1312
+ } finally {
1313
+ wasm.__wbindgen_add_to_stack_pointer(16);
1314
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
1315
+ }
1316
+ }
1317
+
1318
+ const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
1319
+
1320
+ async function __wbg_load(module, imports) {
1321
+ if (typeof Response === 'function' && module instanceof Response) {
1322
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
1323
+ try {
1324
+ return await WebAssembly.instantiateStreaming(module, imports);
1325
+ } catch (e) {
1326
+ const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);
1327
+
1328
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
1329
+ 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);
1330
+
1331
+ } else {
1332
+ throw e;
1333
+ }
1334
+ }
1335
+ }
1336
+
1337
+ const bytes = await module.arrayBuffer();
1338
+ return await WebAssembly.instantiate(bytes, imports);
1339
+ } else {
1340
+ const instance = await WebAssembly.instantiate(module, imports);
1341
+
1342
+ if (instance instanceof WebAssembly.Instance) {
1343
+ return { instance, module };
1344
+ } else {
1345
+ return instance;
1346
+ }
1347
+ }
1348
+ }
1349
+
1350
+ function __wbg_get_imports() {
1351
+ const imports = {};
1352
+ imports.wbg = {};
1353
+ imports.wbg.__wbg_Error_52673b7de5a0ca89 = function(arg0, arg1) {
1354
+ const ret = Error(getStringFromWasm0(arg0, arg1));
1355
+ return addHeapObject(ret);
1356
+ };
1357
+ imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
1358
+ const ret = String(getObject(arg1));
1359
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1360
+ const len1 = WASM_VECTOR_LEN;
1361
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1362
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1363
+ };
1364
+ imports.wbg.__wbg___wbindgen_bigint_get_as_i64_6e32f5e6aff02e1d = function(arg0, arg1) {
1365
+ const v = getObject(arg1);
1366
+ const ret = typeof(v) === 'bigint' ? v : undefined;
1367
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
1368
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1369
+ };
1370
+ imports.wbg.__wbg___wbindgen_boolean_get_dea25b33882b895b = function(arg0) {
1371
+ const v = getObject(arg0);
1372
+ const ret = typeof(v) === 'boolean' ? v : undefined;
1373
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
1374
+ };
1375
+ imports.wbg.__wbg___wbindgen_debug_string_adfb662ae34724b6 = function(arg0, arg1) {
1376
+ const ret = debugString(getObject(arg1));
1377
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1378
+ const len1 = WASM_VECTOR_LEN;
1379
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1380
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1381
+ };
1382
+ imports.wbg.__wbg___wbindgen_in_0d3e1e8f0c669317 = function(arg0, arg1) {
1383
+ const ret = getObject(arg0) in getObject(arg1);
1384
+ return ret;
1385
+ };
1386
+ imports.wbg.__wbg___wbindgen_is_bigint_0e1a2e3f55cfae27 = function(arg0) {
1387
+ const ret = typeof(getObject(arg0)) === 'bigint';
1388
+ return ret;
1389
+ };
1390
+ imports.wbg.__wbg___wbindgen_is_function_8d400b8b1af978cd = function(arg0) {
1391
+ const ret = typeof(getObject(arg0)) === 'function';
1392
+ return ret;
1393
+ };
1394
+ imports.wbg.__wbg___wbindgen_is_object_ce774f3490692386 = function(arg0) {
1395
+ const val = getObject(arg0);
1396
+ const ret = typeof(val) === 'object' && val !== null;
1397
+ return ret;
1398
+ };
1399
+ imports.wbg.__wbg___wbindgen_is_string_704ef9c8fc131030 = function(arg0) {
1400
+ const ret = typeof(getObject(arg0)) === 'string';
1401
+ return ret;
1402
+ };
1403
+ imports.wbg.__wbg___wbindgen_is_undefined_f6b95eab589e0269 = function(arg0) {
1404
+ const ret = getObject(arg0) === undefined;
1405
+ return ret;
1406
+ };
1407
+ imports.wbg.__wbg___wbindgen_jsval_eq_b6101cc9cef1fe36 = function(arg0, arg1) {
1408
+ const ret = getObject(arg0) === getObject(arg1);
1409
+ return ret;
1410
+ };
1411
+ imports.wbg.__wbg___wbindgen_jsval_loose_eq_766057600fdd1b0d = function(arg0, arg1) {
1412
+ const ret = getObject(arg0) == getObject(arg1);
1413
+ return ret;
1414
+ };
1415
+ imports.wbg.__wbg___wbindgen_number_get_9619185a74197f95 = function(arg0, arg1) {
1416
+ const obj = getObject(arg1);
1417
+ const ret = typeof(obj) === 'number' ? obj : undefined;
1418
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
1419
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1420
+ };
1421
+ imports.wbg.__wbg___wbindgen_string_get_a2a31e16edf96e42 = function(arg0, arg1) {
1422
+ const obj = getObject(arg1);
1423
+ const ret = typeof(obj) === 'string' ? obj : undefined;
1424
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1425
+ var len1 = WASM_VECTOR_LEN;
1426
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1427
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1428
+ };
1429
+ imports.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) {
1430
+ throw new Error(getStringFromWasm0(arg0, arg1));
1431
+ };
1432
+ imports.wbg.__wbg__wbg_cb_unref_87dfb5aaa0cbcea7 = function(arg0) {
1433
+ getObject(arg0)._wbg_cb_unref();
1434
+ };
1435
+ imports.wbg.__wbg_call_3020136f7a2d6e44 = function() { return handleError(function (arg0, arg1, arg2) {
1436
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
1437
+ return addHeapObject(ret);
1438
+ }, arguments) };
1439
+ imports.wbg.__wbg_call_abb4ff46ce38be40 = function() { return handleError(function (arg0, arg1) {
1440
+ const ret = getObject(arg0).call(getObject(arg1));
1441
+ return addHeapObject(ret);
1442
+ }, arguments) };
1443
+ imports.wbg.__wbg_done_62ea16af4ce34b24 = function(arg0) {
1444
+ const ret = getObject(arg0).done;
1445
+ return ret;
1446
+ };
1447
+ imports.wbg.__wbg_entries_83c79938054e065f = function(arg0) {
1448
+ const ret = Object.entries(getObject(arg0));
1449
+ return addHeapObject(ret);
1450
+ };
1451
+ imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
1452
+ let deferred0_0;
1453
+ let deferred0_1;
1454
+ try {
1455
+ deferred0_0 = arg0;
1456
+ deferred0_1 = arg1;
1457
+ console.error(getStringFromWasm0(arg0, arg1));
1458
+ } finally {
1459
+ wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
1460
+ }
1461
+ };
1462
+ imports.wbg.__wbg_getRandomValues_9b655bdd369112f2 = function() { return handleError(function (arg0, arg1) {
1463
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
1464
+ }, arguments) };
1465
+ imports.wbg.__wbg_get_6b7bd52aca3f9671 = function(arg0, arg1) {
1466
+ const ret = getObject(arg0)[arg1 >>> 0];
1467
+ return addHeapObject(ret);
1468
+ };
1469
+ imports.wbg.__wbg_get_af9dab7e9603ea93 = function() { return handleError(function (arg0, arg1) {
1470
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
1471
+ return addHeapObject(ret);
1472
+ }, arguments) };
1473
+ imports.wbg.__wbg_instanceof_ArrayBuffer_f3320d2419cd0355 = function(arg0) {
1474
+ let result;
1475
+ try {
1476
+ result = getObject(arg0) instanceof ArrayBuffer;
1477
+ } catch (_) {
1478
+ result = false;
1479
+ }
1480
+ const ret = result;
1481
+ return ret;
1482
+ };
1483
+ imports.wbg.__wbg_instanceof_Map_084be8da74364158 = function(arg0) {
1484
+ let result;
1485
+ try {
1486
+ result = getObject(arg0) instanceof Map;
1487
+ } catch (_) {
1488
+ result = false;
1489
+ }
1490
+ const ret = result;
1491
+ return ret;
1492
+ };
1493
+ imports.wbg.__wbg_instanceof_Uint8Array_da54ccc9d3e09434 = function(arg0) {
1494
+ let result;
1495
+ try {
1496
+ result = getObject(arg0) instanceof Uint8Array;
1497
+ } catch (_) {
1498
+ result = false;
1499
+ }
1500
+ const ret = result;
1501
+ return ret;
1502
+ };
1503
+ imports.wbg.__wbg_isArray_51fd9e6422c0a395 = function(arg0) {
1504
+ const ret = Array.isArray(getObject(arg0));
1505
+ return ret;
1506
+ };
1507
+ imports.wbg.__wbg_isSafeInteger_ae7d3f054d55fa16 = function(arg0) {
1508
+ const ret = Number.isSafeInteger(getObject(arg0));
1509
+ return ret;
1510
+ };
1511
+ imports.wbg.__wbg_iterator_27b7c8b35ab3e86b = function() {
1512
+ const ret = Symbol.iterator;
1513
+ return addHeapObject(ret);
1514
+ };
1515
+ imports.wbg.__wbg_jsedge_new = function(arg0) {
1516
+ const ret = JsEdge.__wrap(arg0);
1517
+ return addHeapObject(ret);
1518
+ };
1519
+ imports.wbg.__wbg_jshyperedge_new = function(arg0) {
1520
+ const ret = JsHyperedge.__wrap(arg0);
1521
+ return addHeapObject(ret);
1522
+ };
1523
+ imports.wbg.__wbg_jsnode_new = function(arg0) {
1524
+ const ret = JsNode.__wrap(arg0);
1525
+ return addHeapObject(ret);
1526
+ };
1527
+ imports.wbg.__wbg_length_22ac23eaec9d8053 = function(arg0) {
1528
+ const ret = getObject(arg0).length;
1529
+ return ret;
1530
+ };
1531
+ imports.wbg.__wbg_length_d45040a40c570362 = function(arg0) {
1532
+ const ret = getObject(arg0).length;
1533
+ return ret;
1534
+ };
1535
+ imports.wbg.__wbg_log_0cc1b7768397bcfe = function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
1536
+ let deferred0_0;
1537
+ let deferred0_1;
1538
+ try {
1539
+ deferred0_0 = arg0;
1540
+ deferred0_1 = arg1;
1541
+ console.log(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), getStringFromWasm0(arg4, arg5), getStringFromWasm0(arg6, arg7));
1542
+ } finally {
1543
+ wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
1544
+ }
1545
+ };
1546
+ imports.wbg.__wbg_log_1d990106d99dacb7 = function(arg0) {
1547
+ console.log(getObject(arg0));
1548
+ };
1549
+ imports.wbg.__wbg_log_cb9e190acc5753fb = function(arg0, arg1) {
1550
+ let deferred0_0;
1551
+ let deferred0_1;
1552
+ try {
1553
+ deferred0_0 = arg0;
1554
+ deferred0_1 = arg1;
1555
+ console.log(getStringFromWasm0(arg0, arg1));
1556
+ } finally {
1557
+ wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
1558
+ }
1559
+ };
1560
+ imports.wbg.__wbg_mark_7438147ce31e9d4b = function(arg0, arg1) {
1561
+ performance.mark(getStringFromWasm0(arg0, arg1));
1562
+ };
1563
+ imports.wbg.__wbg_measure_fb7825c11612c823 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
1564
+ let deferred0_0;
1565
+ let deferred0_1;
1566
+ let deferred1_0;
1567
+ let deferred1_1;
1568
+ try {
1569
+ deferred0_0 = arg0;
1570
+ deferred0_1 = arg1;
1571
+ deferred1_0 = arg2;
1572
+ deferred1_1 = arg3;
1573
+ performance.measure(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3));
1574
+ } finally {
1575
+ wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
1576
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
1577
+ }
1578
+ }, arguments) };
1579
+ imports.wbg.__wbg_new_1ba21ce319a06297 = function() {
1580
+ const ret = new Object();
1581
+ return addHeapObject(ret);
1582
+ };
1583
+ imports.wbg.__wbg_new_25f239778d6112b9 = function() {
1584
+ const ret = new Array();
1585
+ return addHeapObject(ret);
1586
+ };
1587
+ imports.wbg.__wbg_new_6421f6084cc5bc5a = function(arg0) {
1588
+ const ret = new Uint8Array(getObject(arg0));
1589
+ return addHeapObject(ret);
1590
+ };
1591
+ imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
1592
+ const ret = new Error();
1593
+ return addHeapObject(ret);
1594
+ };
1595
+ imports.wbg.__wbg_new_b546ae120718850e = function() {
1596
+ const ret = new Map();
1597
+ return addHeapObject(ret);
1598
+ };
1599
+ imports.wbg.__wbg_new_ff12d2b041fb48f1 = function(arg0, arg1) {
1600
+ try {
1601
+ var state0 = {a: arg0, b: arg1};
1602
+ var cb0 = (arg0, arg1) => {
1603
+ const a = state0.a;
1604
+ state0.a = 0;
1605
+ try {
1606
+ return __wasm_bindgen_func_elem_774(a, state0.b, arg0, arg1);
1607
+ } finally {
1608
+ state0.a = a;
1609
+ }
1610
+ };
1611
+ const ret = new Promise(cb0);
1612
+ return addHeapObject(ret);
1613
+ } finally {
1614
+ state0.a = state0.b = 0;
1615
+ }
1616
+ };
1617
+ imports.wbg.__wbg_new_no_args_cb138f77cf6151ee = function(arg0, arg1) {
1618
+ const ret = new Function(getStringFromWasm0(arg0, arg1));
1619
+ return addHeapObject(ret);
1620
+ };
1621
+ imports.wbg.__wbg_next_138a17bbf04e926c = function(arg0) {
1622
+ const ret = getObject(arg0).next;
1623
+ return addHeapObject(ret);
1624
+ };
1625
+ imports.wbg.__wbg_next_3cfe5c0fe2a4cc53 = function() { return handleError(function (arg0) {
1626
+ const ret = getObject(arg0).next();
1627
+ return addHeapObject(ret);
1628
+ }, arguments) };
1629
+ imports.wbg.__wbg_prototypesetcall_dfe9b766cdc1f1fd = function(arg0, arg1, arg2) {
1630
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
1631
+ };
1632
+ imports.wbg.__wbg_queryresult_new = function(arg0) {
1633
+ const ret = QueryResult.__wrap(arg0);
1634
+ return addHeapObject(ret);
1635
+ };
1636
+ imports.wbg.__wbg_queueMicrotask_9b549dfce8865860 = function(arg0) {
1637
+ const ret = getObject(arg0).queueMicrotask;
1638
+ return addHeapObject(ret);
1639
+ };
1640
+ imports.wbg.__wbg_queueMicrotask_fca69f5bfad613a5 = function(arg0) {
1641
+ queueMicrotask(getObject(arg0));
1642
+ };
1643
+ imports.wbg.__wbg_resolve_fd5bfbaa4ce36e1e = function(arg0) {
1644
+ const ret = Promise.resolve(getObject(arg0));
1645
+ return addHeapObject(ret);
1646
+ };
1647
+ imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
1648
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
1649
+ };
1650
+ imports.wbg.__wbg_set_781438a03c0c3c81 = function() { return handleError(function (arg0, arg1, arg2) {
1651
+ const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
1652
+ return ret;
1653
+ }, arguments) };
1654
+ imports.wbg.__wbg_set_7df433eea03a5c14 = function(arg0, arg1, arg2) {
1655
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
1656
+ };
1657
+ imports.wbg.__wbg_set_efaaf145b9377369 = function(arg0, arg1, arg2) {
1658
+ const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
1659
+ return addHeapObject(ret);
1660
+ };
1661
+ imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
1662
+ const ret = getObject(arg1).stack;
1663
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1664
+ const len1 = WASM_VECTOR_LEN;
1665
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1666
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1667
+ };
1668
+ imports.wbg.__wbg_static_accessor_GLOBAL_769e6b65d6557335 = function() {
1669
+ const ret = typeof global === 'undefined' ? null : global;
1670
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
1671
+ };
1672
+ imports.wbg.__wbg_static_accessor_GLOBAL_THIS_60cf02db4de8e1c1 = function() {
1673
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
1674
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
1675
+ };
1676
+ imports.wbg.__wbg_static_accessor_SELF_08f5a74c69739274 = function() {
1677
+ const ret = typeof self === 'undefined' ? null : self;
1678
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
1679
+ };
1680
+ imports.wbg.__wbg_static_accessor_WINDOW_a8924b26aa92d024 = function() {
1681
+ const ret = typeof window === 'undefined' ? null : window;
1682
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
1683
+ };
1684
+ imports.wbg.__wbg_then_4f95312d68691235 = function(arg0, arg1) {
1685
+ const ret = getObject(arg0).then(getObject(arg1));
1686
+ return addHeapObject(ret);
1687
+ };
1688
+ imports.wbg.__wbg_value_57b7b035e117f7ee = function(arg0) {
1689
+ const ret = getObject(arg0).value;
1690
+ return addHeapObject(ret);
1691
+ };
1692
+ imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
1693
+ // Cast intrinsic for `Ref(String) -> Externref`.
1694
+ const ret = getStringFromWasm0(arg0, arg1);
1695
+ return addHeapObject(ret);
1696
+ };
1697
+ imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
1698
+ // Cast intrinsic for `U64 -> Externref`.
1699
+ const ret = BigInt.asUintN(64, arg0);
1700
+ return addHeapObject(ret);
1701
+ };
1702
+ imports.wbg.__wbindgen_cast_5593cb9f9bdfbd52 = function(arg0, arg1) {
1703
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 124, function: Function { arguments: [Externref], shim_idx: 125, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1704
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_445, __wasm_bindgen_func_elem_446);
1705
+ return addHeapObject(ret);
1706
+ };
1707
+ imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
1708
+ // Cast intrinsic for `I64 -> Externref`.
1709
+ const ret = arg0;
1710
+ return addHeapObject(ret);
1711
+ };
1712
+ imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
1713
+ // Cast intrinsic for `F64 -> Externref`.
1714
+ const ret = arg0;
1715
+ return addHeapObject(ret);
1716
+ };
1717
+ imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
1718
+ const ret = getObject(arg0);
1719
+ return addHeapObject(ret);
1720
+ };
1721
+ imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
1722
+ takeObject(arg0);
1723
+ };
1724
+
1725
+ return imports;
1726
+ }
1727
+
1728
+ function __wbg_finalize_init(instance, module) {
1729
+ wasm = instance.exports;
1730
+ __wbg_init.__wbindgen_wasm_module = module;
1731
+ cachedDataViewMemory0 = null;
1732
+ cachedFloat32ArrayMemory0 = null;
1733
+ cachedUint8ArrayMemory0 = null;
1734
+
1735
+
1736
+ wasm.__wbindgen_start();
1737
+ return wasm;
1738
+ }
1739
+
1740
+ function initSync(module) {
1741
+ if (wasm !== undefined) return wasm;
1742
+
1743
+
1744
+ if (typeof module !== 'undefined') {
1745
+ if (Object.getPrototypeOf(module) === Object.prototype) {
1746
+ ({module} = module)
1747
+ } else {
1748
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
1749
+ }
1750
+ }
1751
+
1752
+ const imports = __wbg_get_imports();
1753
+ if (!(module instanceof WebAssembly.Module)) {
1754
+ module = new WebAssembly.Module(module);
1755
+ }
1756
+ const instance = new WebAssembly.Instance(module, imports);
1757
+ return __wbg_finalize_init(instance, module);
1758
+ }
1759
+
1760
+ async function __wbg_init(module_or_path) {
1761
+ if (wasm !== undefined) return wasm;
1762
+
1763
+
1764
+ if (typeof module_or_path !== 'undefined') {
1765
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
1766
+ ({module_or_path} = module_or_path)
1767
+ } else {
1768
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
1769
+ }
1770
+ }
1771
+
1772
+ if (typeof module_or_path === 'undefined') {
1773
+ module_or_path = new URL('ruvector_graph_wasm_bg.wasm', import.meta.url);
1774
+ }
1775
+ const imports = __wbg_get_imports();
1776
+
1777
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
1778
+ module_or_path = fetch(module_or_path);
1779
+ }
1780
+
1781
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
1782
+
1783
+ return __wbg_finalize_init(instance, module);
1784
+ }
1785
+
1786
+ export { initSync };
1787
+ export default __wbg_init;