logic-mesh 0.1.10 → 0.9.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.
package/logic_mesh_bg.js DELETED
@@ -1,1125 +0,0 @@
1
- let wasm;
2
- export function __wbg_set_wasm(val) {
3
- wasm = val;
4
- }
5
-
6
-
7
- const heap = new Array(128).fill(undefined);
8
-
9
- heap.push(undefined, null, true, false);
10
-
11
- function getObject(idx) { return heap[idx]; }
12
-
13
- let heap_next = heap.length;
14
-
15
- function dropObject(idx) {
16
- if (idx < 132) return;
17
- heap[idx] = heap_next;
18
- heap_next = idx;
19
- }
20
-
21
- function takeObject(idx) {
22
- const ret = getObject(idx);
23
- dropObject(idx);
24
- return ret;
25
- }
26
-
27
- const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
28
-
29
- let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
30
-
31
- cachedTextDecoder.decode();
32
-
33
- let cachedUint8Memory0 = null;
34
-
35
- function getUint8Memory0() {
36
- if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
37
- cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
38
- }
39
- return cachedUint8Memory0;
40
- }
41
-
42
- function getStringFromWasm0(ptr, len) {
43
- ptr = ptr >>> 0;
44
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
45
- }
46
-
47
- function addHeapObject(obj) {
48
- if (heap_next === heap.length) heap.push(heap.length + 1);
49
- const idx = heap_next;
50
- heap_next = heap[idx];
51
-
52
- heap[idx] = obj;
53
- return idx;
54
- }
55
-
56
- function isLikeNone(x) {
57
- return x === undefined || x === null;
58
- }
59
-
60
- let cachedFloat64Memory0 = null;
61
-
62
- function getFloat64Memory0() {
63
- if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
64
- cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
65
- }
66
- return cachedFloat64Memory0;
67
- }
68
-
69
- let cachedInt32Memory0 = null;
70
-
71
- function getInt32Memory0() {
72
- if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
73
- cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
74
- }
75
- return cachedInt32Memory0;
76
- }
77
-
78
- let WASM_VECTOR_LEN = 0;
79
-
80
- const lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder;
81
-
82
- let cachedTextEncoder = new lTextEncoder('utf-8');
83
-
84
- const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
85
- ? function (arg, view) {
86
- return cachedTextEncoder.encodeInto(arg, view);
87
- }
88
- : function (arg, view) {
89
- const buf = cachedTextEncoder.encode(arg);
90
- view.set(buf);
91
- return {
92
- read: arg.length,
93
- written: buf.length
94
- };
95
- });
96
-
97
- function passStringToWasm0(arg, malloc, realloc) {
98
-
99
- if (realloc === undefined) {
100
- const buf = cachedTextEncoder.encode(arg);
101
- const ptr = malloc(buf.length, 1) >>> 0;
102
- getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
103
- WASM_VECTOR_LEN = buf.length;
104
- return ptr;
105
- }
106
-
107
- let len = arg.length;
108
- let ptr = malloc(len, 1) >>> 0;
109
-
110
- const mem = getUint8Memory0();
111
-
112
- let offset = 0;
113
-
114
- for (; offset < len; offset++) {
115
- const code = arg.charCodeAt(offset);
116
- if (code > 0x7F) break;
117
- mem[ptr + offset] = code;
118
- }
119
-
120
- if (offset !== len) {
121
- if (offset !== 0) {
122
- arg = arg.slice(offset);
123
- }
124
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
125
- const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
126
- const ret = encodeString(arg, view);
127
-
128
- offset += ret.written;
129
- ptr = realloc(ptr, len, offset, 1) >>> 0;
130
- }
131
-
132
- WASM_VECTOR_LEN = offset;
133
- return ptr;
134
- }
135
-
136
- let cachedBigInt64Memory0 = null;
137
-
138
- function getBigInt64Memory0() {
139
- if (cachedBigInt64Memory0 === null || cachedBigInt64Memory0.byteLength === 0) {
140
- cachedBigInt64Memory0 = new BigInt64Array(wasm.memory.buffer);
141
- }
142
- return cachedBigInt64Memory0;
143
- }
144
-
145
- function debugString(val) {
146
- // primitive types
147
- const type = typeof val;
148
- if (type == 'number' || type == 'boolean' || val == null) {
149
- return `${val}`;
150
- }
151
- if (type == 'string') {
152
- return `"${val}"`;
153
- }
154
- if (type == 'symbol') {
155
- const description = val.description;
156
- if (description == null) {
157
- return 'Symbol';
158
- } else {
159
- return `Symbol(${description})`;
160
- }
161
- }
162
- if (type == 'function') {
163
- const name = val.name;
164
- if (typeof name == 'string' && name.length > 0) {
165
- return `Function(${name})`;
166
- } else {
167
- return 'Function';
168
- }
169
- }
170
- // objects
171
- if (Array.isArray(val)) {
172
- const length = val.length;
173
- let debug = '[';
174
- if (length > 0) {
175
- debug += debugString(val[0]);
176
- }
177
- for(let i = 1; i < length; i++) {
178
- debug += ', ' + debugString(val[i]);
179
- }
180
- debug += ']';
181
- return debug;
182
- }
183
- // Test for built-in
184
- const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
185
- let className;
186
- if (builtInMatches.length > 1) {
187
- className = builtInMatches[1];
188
- } else {
189
- // Failed to match the standard '[object ClassName]'
190
- return toString.call(val);
191
- }
192
- if (className == 'Object') {
193
- // we're a user defined class or Object
194
- // JSON.stringify avoids problems with cycles, and is generally much
195
- // easier than looping through ownProperties of `val`.
196
- try {
197
- return 'Object(' + JSON.stringify(val) + ')';
198
- } catch (_) {
199
- return 'Object';
200
- }
201
- }
202
- // errors
203
- if (val instanceof Error) {
204
- return `${val.name}: ${val.message}\n${val.stack}`;
205
- }
206
- // TODO we could test for more things here, like `Set`s and `Map`s.
207
- return className;
208
- }
209
-
210
- const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
211
- ? { register: () => {}, unregister: () => {} }
212
- : new FinalizationRegistry(state => {
213
- wasm.__wbindgen_export_2.get(state.dtor)(state.a, state.b)
214
- });
215
-
216
- function makeMutClosure(arg0, arg1, dtor, f) {
217
- const state = { a: arg0, b: arg1, cnt: 1, dtor };
218
- const real = (...args) => {
219
- // First up with a closure we increment the internal reference
220
- // count. This ensures that the Rust closure environment won't
221
- // be deallocated while we're invoking it.
222
- state.cnt++;
223
- const a = state.a;
224
- state.a = 0;
225
- try {
226
- return f(a, state.b, ...args);
227
- } finally {
228
- if (--state.cnt === 0) {
229
- wasm.__wbindgen_export_2.get(state.dtor)(a, state.b);
230
- CLOSURE_DTORS.unregister(state);
231
- } else {
232
- state.a = a;
233
- }
234
- }
235
- };
236
- real.original = state;
237
- CLOSURE_DTORS.register(real, state, state);
238
- return real;
239
- }
240
- function __wbg_adapter_50(arg0, arg1, arg2) {
241
- wasm.__wbindgen_export_3(arg0, arg1, addHeapObject(arg2));
242
- }
243
-
244
- let cachedUint32Memory0 = null;
245
-
246
- function getUint32Memory0() {
247
- if (cachedUint32Memory0 === null || cachedUint32Memory0.byteLength === 0) {
248
- cachedUint32Memory0 = new Uint32Array(wasm.memory.buffer);
249
- }
250
- return cachedUint32Memory0;
251
- }
252
-
253
- function passArrayJsValueToWasm0(array, malloc) {
254
- const ptr = malloc(array.length * 4, 4) >>> 0;
255
- const mem = getUint32Memory0();
256
- for (let i = 0; i < array.length; i++) {
257
- mem[ptr / 4 + i] = addHeapObject(array[i]);
258
- }
259
- WASM_VECTOR_LEN = array.length;
260
- return ptr;
261
- }
262
- /**
263
- * @param {number | undefined} [sleep_duration]
264
- * @returns {BlocksEngine}
265
- */
266
- export function initEngine(sleep_duration) {
267
- const ret = wasm.initEngine(!isLikeNone(sleep_duration), isLikeNone(sleep_duration) ? 0 : sleep_duration);
268
- return BlocksEngine.__wrap(ret);
269
- }
270
-
271
- /**
272
- */
273
- export function start() {
274
- wasm.start();
275
- }
276
-
277
- /**
278
- */
279
- export function init_panic_hook() {
280
- wasm.init_panic_hook();
281
- }
282
-
283
- function handleError(f, args) {
284
- try {
285
- return f.apply(this, args);
286
- } catch (e) {
287
- wasm.__wbindgen_export_5(addHeapObject(e));
288
- }
289
- }
290
- function __wbg_adapter_159(arg0, arg1, arg2, arg3) {
291
- wasm.__wbindgen_export_6(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
292
- }
293
-
294
- const BlocksEngineFinalization = (typeof FinalizationRegistry === 'undefined')
295
- ? { register: () => {}, unregister: () => {} }
296
- : new FinalizationRegistry(ptr => wasm.__wbg_blocksengine_free(ptr >>> 0));
297
- /**
298
- * Controls the execution or the blocks.
299
- * Loads programs and enables inspection and debugging
300
- * of the blocks and their inputs and outputs.
301
- */
302
- export class BlocksEngine {
303
-
304
- static __wrap(ptr) {
305
- ptr = ptr >>> 0;
306
- const obj = Object.create(BlocksEngine.prototype);
307
- obj.__wbg_ptr = ptr;
308
- BlocksEngineFinalization.register(obj, obj.__wbg_ptr, obj);
309
- return obj;
310
- }
311
-
312
- __destroy_into_raw() {
313
- const ptr = this.__wbg_ptr;
314
- this.__wbg_ptr = 0;
315
- BlocksEngineFinalization.unregister(this);
316
- return ptr;
317
- }
318
-
319
- free() {
320
- const ptr = this.__destroy_into_raw();
321
- wasm.__wbg_blocksengine_free(ptr);
322
- }
323
- /**
324
- * Create a new instance of an engine
325
- * @param {bigint | undefined} [sleep_duration]
326
- */
327
- constructor(sleep_duration) {
328
- const ret = wasm.blocksengine_new(!isLikeNone(sleep_duration), isLikeNone(sleep_duration) ? BigInt(0) : sleep_duration);
329
- this.__wbg_ptr = ret >>> 0;
330
- return this;
331
- }
332
- /**
333
- * Lists all available blocks
334
- * @returns {Array<any>}
335
- */
336
- listBlocks() {
337
- const ret = wasm.blocksengine_listBlocks(this.__wbg_ptr);
338
- return takeObject(ret);
339
- }
340
- /**
341
- * Register a new JS block in the registry
342
- * The block is described by a JsBlockDesc object
343
- *
344
- * # Arguments
345
- * * `desc` - The description of the block
346
- * * `func` - Optional function that implements the block
347
- * logic. If not provided, the block would do nothing.
348
- *
349
- * # Returns
350
- * The name of the block
351
- *
352
- * @param {any} desc
353
- * @param {Function | undefined} [func]
354
- * @returns {string}
355
- */
356
- registerBlock(desc, func) {
357
- let deferred2_0;
358
- let deferred2_1;
359
- try {
360
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
361
- wasm.blocksengine_registerBlock(retptr, this.__wbg_ptr, addHeapObject(desc), isLikeNone(func) ? 0 : addHeapObject(func));
362
- var r0 = getInt32Memory0()[retptr / 4 + 0];
363
- var r1 = getInt32Memory0()[retptr / 4 + 1];
364
- var r2 = getInt32Memory0()[retptr / 4 + 2];
365
- var r3 = getInt32Memory0()[retptr / 4 + 3];
366
- var ptr1 = r0;
367
- var len1 = r1;
368
- if (r3) {
369
- ptr1 = 0; len1 = 0;
370
- throw takeObject(r2);
371
- }
372
- deferred2_0 = ptr1;
373
- deferred2_1 = len1;
374
- return getStringFromWasm0(ptr1, len1);
375
- } finally {
376
- wasm.__wbindgen_add_to_stack_pointer(16);
377
- wasm.__wbindgen_export_4(deferred2_0, deferred2_1, 1);
378
- }
379
- }
380
- /**
381
- * @returns {EngineCommand}
382
- */
383
- engineCommand() {
384
- const ret = wasm.blocksengine_engineCommand(this.__wbg_ptr);
385
- return EngineCommand.__wrap(ret);
386
- }
387
- /**
388
- * Runs the engine asynchronously
389
- * After this is called, the engine instance can't be used directly
390
- * Instead use the command object to communicate with the engine.
391
- * @returns {Promise<void>}
392
- */
393
- run() {
394
- const ret = wasm.blocksengine_run(this.__wbg_ptr);
395
- return takeObject(ret);
396
- }
397
- }
398
-
399
- const EngineCommandFinalization = (typeof FinalizationRegistry === 'undefined')
400
- ? { register: () => {}, unregister: () => {} }
401
- : new FinalizationRegistry(ptr => wasm.__wbg_enginecommand_free(ptr >>> 0));
402
- /**
403
- * Commands a running instance of a Block Engine.
404
- */
405
- export class EngineCommand {
406
-
407
- static __wrap(ptr) {
408
- ptr = ptr >>> 0;
409
- const obj = Object.create(EngineCommand.prototype);
410
- obj.__wbg_ptr = ptr;
411
- EngineCommandFinalization.register(obj, obj.__wbg_ptr, obj);
412
- return obj;
413
- }
414
-
415
- __destroy_into_raw() {
416
- const ptr = this.__wbg_ptr;
417
- this.__wbg_ptr = 0;
418
- EngineCommandFinalization.unregister(this);
419
- return ptr;
420
- }
421
-
422
- free() {
423
- const ptr = this.__destroy_into_raw();
424
- wasm.__wbg_enginecommand_free(ptr);
425
- }
426
- /**
427
- * Adds a block instance to the engine
428
- * to be immediately scheduled for execution
429
- * @param {string} block_name
430
- * @param {string | undefined} [block_uuid]
431
- * @param {string | undefined} [lib]
432
- * @returns {Promise<string>}
433
- */
434
- addBlock(block_name, block_uuid, lib) {
435
- const ptr0 = passStringToWasm0(block_name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
436
- const len0 = WASM_VECTOR_LEN;
437
- var ptr1 = isLikeNone(block_uuid) ? 0 : passStringToWasm0(block_uuid, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
438
- var len1 = WASM_VECTOR_LEN;
439
- var ptr2 = isLikeNone(lib) ? 0 : passStringToWasm0(lib, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
440
- var len2 = WASM_VECTOR_LEN;
441
- const ret = wasm.enginecommand_addBlock(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
442
- return takeObject(ret);
443
- }
444
- /**
445
- * Removes a block instance from the engine
446
- * to be immediately unscheduled for execution
447
- * and removed from the engine together with all its links.
448
- *
449
- * # Arguments
450
- * * `block_uuid` - The UUID of the block to be removed
451
- *
452
- * # Returns
453
- * The UUID of the removed block
454
- * @param {string} block_uuid
455
- * @returns {Promise<string>}
456
- */
457
- removeBlock(block_uuid) {
458
- const ptr0 = passStringToWasm0(block_uuid, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
459
- const len0 = WASM_VECTOR_LEN;
460
- const ret = wasm.enginecommand_removeBlock(this.__wbg_ptr, ptr0, len0);
461
- return takeObject(ret);
462
- }
463
- /**
464
- * Creates a link between two blocks
465
- *
466
- * # Arguments
467
- * * `source_block_uuid` - The UUID of the source block
468
- * * `target_block_uuid` - The UUID of the target block
469
- * * `source_block_pin_name` - The name of the output pin of the source block
470
- * * `target_block_input_name` - The name of the input pin of the target block
471
- *
472
- * # Returns
473
- * A `LinkData` object with the following properties:
474
- * * `source_block_uuid` - The UUID of the source block
475
- * * `target_block_uuid` - The UUID of the target block
476
- * * `source_block_pin_name` - The name of the output pin of the source block
477
- * * `target_block_input_name` - The name of the input pin of the target block
478
- * @param {string} source_block_uuid
479
- * @param {string} target_block_uuid
480
- * @param {string} source_block_pin_name
481
- * @param {string} target_block_pin_name
482
- * @returns {Promise<any>}
483
- */
484
- createLink(source_block_uuid, target_block_uuid, source_block_pin_name, target_block_pin_name) {
485
- const ptr0 = passStringToWasm0(source_block_uuid, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
486
- const len0 = WASM_VECTOR_LEN;
487
- const ptr1 = passStringToWasm0(target_block_uuid, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
488
- const len1 = WASM_VECTOR_LEN;
489
- const ptr2 = passStringToWasm0(source_block_pin_name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
490
- const len2 = WASM_VECTOR_LEN;
491
- const ptr3 = passStringToWasm0(target_block_pin_name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
492
- const len3 = WASM_VECTOR_LEN;
493
- const ret = wasm.enginecommand_createLink(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
494
- return takeObject(ret);
495
- }
496
- /**
497
- * Removes a link between two blocks
498
- *
499
- * # Arguments
500
- * * `link_uuid` - The UUID of the link to be removed
501
- *
502
- * # Returns
503
- * True if the link was removed, false otherwise
504
- * @param {string} link_uuid
505
- * @returns {Promise<boolean>}
506
- */
507
- removeLink(link_uuid) {
508
- const ptr0 = passStringToWasm0(link_uuid, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
509
- const len0 = WASM_VECTOR_LEN;
510
- const ret = wasm.enginecommand_removeLink(this.__wbg_ptr, ptr0, len0);
511
- return takeObject(ret);
512
- }
513
- /**
514
- * Writes the given block out with a value
515
- *
516
- * # Arguments
517
- * * `block_uuid` - The UUID of the block to write to
518
- * * `output_name` - The name of the output to write to
519
- * * `value` - The value to write
520
- *
521
- * # Returns
522
- * The block data
523
- * @param {string} block_uuid
524
- * @param {string} output_name
525
- * @param {any} value
526
- * @returns {Promise<any>}
527
- */
528
- writeBlockOutput(block_uuid, output_name, value) {
529
- const ptr0 = passStringToWasm0(block_uuid, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
530
- const len0 = WASM_VECTOR_LEN;
531
- const ptr1 = passStringToWasm0(output_name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
532
- const len1 = WASM_VECTOR_LEN;
533
- const ret = wasm.enginecommand_writeBlockOutput(this.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(value));
534
- return takeObject(ret);
535
- }
536
- /**
537
- * Writes the given block input with a value
538
- *
539
- * # Arguments
540
- * * `block_uuid` - The UUID of the block to write to
541
- * * `input_name` - The name of the input to write to
542
- * * `value` - The value to write
543
- *
544
- * # Returns
545
- * The previous value of the input
546
- * @param {string} block_uuid
547
- * @param {string} input_name
548
- * @param {any} value
549
- * @returns {Promise<any>}
550
- */
551
- writeBlockInput(block_uuid, input_name, value) {
552
- const ptr0 = passStringToWasm0(block_uuid, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
553
- const len0 = WASM_VECTOR_LEN;
554
- const ptr1 = passStringToWasm0(input_name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
555
- const len1 = WASM_VECTOR_LEN;
556
- const ret = wasm.enginecommand_writeBlockInput(this.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(value));
557
- return takeObject(ret);
558
- }
559
- /**
560
- * Get the current running engine program.
561
- * The program contains the scheduled blocks, their properties, and their links.
562
- * @returns {Promise<any>}
563
- */
564
- getProgram() {
565
- const ret = wasm.enginecommand_getProgram(this.__wbg_ptr);
566
- return takeObject(ret);
567
- }
568
- /**
569
- * Inspects the current state of a block
570
- * @param {string} block_uuid
571
- * @returns {Promise<any>}
572
- */
573
- inspectBlock(block_uuid) {
574
- const ptr0 = passStringToWasm0(block_uuid, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
575
- const len0 = WASM_VECTOR_LEN;
576
- const ret = wasm.enginecommand_inspectBlock(this.__wbg_ptr, ptr0, len0);
577
- return takeObject(ret);
578
- }
579
- /**
580
- * Evaluates a block by name
581
- * This will create a block instance and execute it.
582
- *
583
- * # Arguments
584
- * * `block_name` - The name of the block to evaluate
585
- * * `inputs` - The input values to the block
586
- * * `lib` - Optional, the library to load the block from, defaults to "core"
587
- *
588
- * # Returns
589
- * A list of values representing the outputs of the block
590
- * @param {string} block_name
591
- * @param {any[]} inputs
592
- * @param {string | undefined} [lib]
593
- * @returns {Promise<any>}
594
- */
595
- evalBlock(block_name, inputs, lib) {
596
- const ptr0 = passStringToWasm0(block_name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
597
- const len0 = WASM_VECTOR_LEN;
598
- const ptr1 = passArrayJsValueToWasm0(inputs, wasm.__wbindgen_export_0);
599
- const len1 = WASM_VECTOR_LEN;
600
- var ptr2 = isLikeNone(lib) ? 0 : passStringToWasm0(lib, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
601
- var len2 = WASM_VECTOR_LEN;
602
- const ret = wasm.enginecommand_evalBlock(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
603
- return takeObject(ret);
604
- }
605
- /**
606
- * Creates a watch on block changes
607
- * @param {Function} callback
608
- * @returns {Promise<void>}
609
- */
610
- createWatch(callback) {
611
- const ret = wasm.enginecommand_createWatch(this.__wbg_ptr, addHeapObject(callback));
612
- return takeObject(ret);
613
- }
614
- /**
615
- * Pauses the execution of the engine
616
- * If the engine is already paused, this does nothing
617
- * @returns {Promise<void>}
618
- */
619
- pauseExecution() {
620
- const ret = wasm.enginecommand_pauseExecution(this.__wbg_ptr);
621
- return takeObject(ret);
622
- }
623
- /**
624
- * Resumes the execution of the engine
625
- * If the engine is not paused, this does nothing
626
- * @returns {Promise<void>}
627
- */
628
- resumeExecution() {
629
- const ret = wasm.enginecommand_resumeExecution(this.__wbg_ptr);
630
- return takeObject(ret);
631
- }
632
- /**
633
- * Resets the engine state, clears all blocks and links
634
- * @returns {Promise<void>}
635
- */
636
- resetEngine() {
637
- const ret = wasm.enginecommand_resetEngine(this.__wbg_ptr);
638
- return takeObject(ret);
639
- }
640
- /**
641
- * Stop the engine's execution
642
- * @returns {Promise<void>}
643
- */
644
- stopEngine() {
645
- const ret = wasm.enginecommand_stopEngine(this.__wbg_ptr);
646
- return takeObject(ret);
647
- }
648
- }
649
-
650
- export function __wbindgen_object_drop_ref(arg0) {
651
- takeObject(arg0);
652
- };
653
-
654
- export function __wbg_setTimeout_50044b18c53363ca(arg0, arg1) {
655
- setTimeout(getObject(arg0), arg1);
656
- };
657
-
658
- export function __wbindgen_is_array(arg0) {
659
- const ret = Array.isArray(getObject(arg0));
660
- return ret;
661
- };
662
-
663
- export function __wbindgen_error_new(arg0, arg1) {
664
- const ret = new Error(getStringFromWasm0(arg0, arg1));
665
- return addHeapObject(ret);
666
- };
667
-
668
- export function __wbg_static_accessor_PERFORMANCE_1afe5b5883eb13b9() {
669
- const ret = performance;
670
- return addHeapObject(ret);
671
- };
672
-
673
- export function __wbindgen_string_new(arg0, arg1) {
674
- const ret = getStringFromWasm0(arg0, arg1);
675
- return addHeapObject(ret);
676
- };
677
-
678
- export function __wbg_now_9cd67a1622b7095f(arg0) {
679
- const ret = getObject(arg0).now();
680
- return ret;
681
- };
682
-
683
- export function __wbindgen_is_undefined(arg0) {
684
- const ret = getObject(arg0) === undefined;
685
- return ret;
686
- };
687
-
688
- export function __wbindgen_in(arg0, arg1) {
689
- const ret = getObject(arg0) in getObject(arg1);
690
- return ret;
691
- };
692
-
693
- export function __wbindgen_boolean_get(arg0) {
694
- const v = getObject(arg0);
695
- const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
696
- return ret;
697
- };
698
-
699
- export function __wbindgen_is_bigint(arg0) {
700
- const ret = typeof(getObject(arg0)) === 'bigint';
701
- return ret;
702
- };
703
-
704
- export function __wbindgen_number_get(arg0, arg1) {
705
- const obj = getObject(arg1);
706
- const ret = typeof(obj) === 'number' ? obj : undefined;
707
- getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
708
- getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
709
- };
710
-
711
- export function __wbindgen_bigint_from_i64(arg0) {
712
- const ret = arg0;
713
- return addHeapObject(ret);
714
- };
715
-
716
- export function __wbindgen_jsval_eq(arg0, arg1) {
717
- const ret = getObject(arg0) === getObject(arg1);
718
- return ret;
719
- };
720
-
721
- export function __wbindgen_string_get(arg0, arg1) {
722
- const obj = getObject(arg1);
723
- const ret = typeof(obj) === 'string' ? obj : undefined;
724
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
725
- var len1 = WASM_VECTOR_LEN;
726
- getInt32Memory0()[arg0 / 4 + 1] = len1;
727
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
728
- };
729
-
730
- export function __wbindgen_is_object(arg0) {
731
- const val = getObject(arg0);
732
- const ret = typeof(val) === 'object' && val !== null;
733
- return ret;
734
- };
735
-
736
- export function __wbindgen_bigint_from_u64(arg0) {
737
- const ret = BigInt.asUintN(64, arg0);
738
- return addHeapObject(ret);
739
- };
740
-
741
- export function __wbindgen_object_clone_ref(arg0) {
742
- const ret = getObject(arg0);
743
- return addHeapObject(ret);
744
- };
745
-
746
- export function __wbindgen_jsval_loose_eq(arg0, arg1) {
747
- const ret = getObject(arg0) == getObject(arg1);
748
- return ret;
749
- };
750
-
751
- export function __wbg_String_b9412f8799faab3e(arg0, arg1) {
752
- const ret = String(getObject(arg1));
753
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
754
- const len1 = WASM_VECTOR_LEN;
755
- getInt32Memory0()[arg0 / 4 + 1] = len1;
756
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
757
- };
758
-
759
- export function __wbindgen_number_new(arg0) {
760
- const ret = arg0;
761
- return addHeapObject(ret);
762
- };
763
-
764
- export function __wbg_getwithrefkey_edc2c8960f0f1191(arg0, arg1) {
765
- const ret = getObject(arg0)[getObject(arg1)];
766
- return addHeapObject(ret);
767
- };
768
-
769
- export function __wbg_set_f975102236d3c502(arg0, arg1, arg2) {
770
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
771
- };
772
-
773
- export function __wbg_log_53ed96ea72ace5e9(arg0, arg1) {
774
- console.log(getStringFromWasm0(arg0, arg1));
775
- };
776
-
777
- export function __wbg_error_93b671ae91baaee7(arg0, arg1) {
778
- console.error(getStringFromWasm0(arg0, arg1));
779
- };
780
-
781
- export function __wbg_warn_52c5b3e773c3a056(arg0, arg1) {
782
- console.warn(getStringFromWasm0(arg0, arg1));
783
- };
784
-
785
- export function __wbindgen_cb_drop(arg0) {
786
- const obj = takeObject(arg0).original;
787
- if (obj.cnt-- == 1) {
788
- obj.a = 0;
789
- return true;
790
- }
791
- const ret = false;
792
- return ret;
793
- };
794
-
795
- export function __wbg_queueMicrotask_481971b0d87f3dd4(arg0) {
796
- queueMicrotask(getObject(arg0));
797
- };
798
-
799
- export function __wbg_queueMicrotask_3cbae2ec6b6cd3d6(arg0) {
800
- const ret = getObject(arg0).queueMicrotask;
801
- return addHeapObject(ret);
802
- };
803
-
804
- export function __wbindgen_is_function(arg0) {
805
- const ret = typeof(getObject(arg0)) === 'function';
806
- return ret;
807
- };
808
-
809
- export function __wbg_new_abda76e883ba8a5f() {
810
- const ret = new Error();
811
- return addHeapObject(ret);
812
- };
813
-
814
- export function __wbg_stack_658279fe44541cf6(arg0, arg1) {
815
- const ret = getObject(arg1).stack;
816
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
817
- const len1 = WASM_VECTOR_LEN;
818
- getInt32Memory0()[arg0 / 4 + 1] = len1;
819
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
820
- };
821
-
822
- export function __wbg_error_f851667af71bcfc6(arg0, arg1) {
823
- let deferred0_0;
824
- let deferred0_1;
825
- try {
826
- deferred0_0 = arg0;
827
- deferred0_1 = arg1;
828
- console.error(getStringFromWasm0(arg0, arg1));
829
- } finally {
830
- wasm.__wbindgen_export_4(deferred0_0, deferred0_1, 1);
831
- }
832
- };
833
-
834
- export function __wbg_crypto_d05b68a3572bb8ca(arg0) {
835
- const ret = getObject(arg0).crypto;
836
- return addHeapObject(ret);
837
- };
838
-
839
- export function __wbg_process_b02b3570280d0366(arg0) {
840
- const ret = getObject(arg0).process;
841
- return addHeapObject(ret);
842
- };
843
-
844
- export function __wbg_versions_c1cb42213cedf0f5(arg0) {
845
- const ret = getObject(arg0).versions;
846
- return addHeapObject(ret);
847
- };
848
-
849
- export function __wbg_node_43b1089f407e4ec2(arg0) {
850
- const ret = getObject(arg0).node;
851
- return addHeapObject(ret);
852
- };
853
-
854
- export function __wbindgen_is_string(arg0) {
855
- const ret = typeof(getObject(arg0)) === 'string';
856
- return ret;
857
- };
858
-
859
- export function __wbg_require_9a7e0f667ead4995() { return handleError(function () {
860
- const ret = module.require;
861
- return addHeapObject(ret);
862
- }, arguments) };
863
-
864
- export function __wbg_msCrypto_10fc94afee92bd76(arg0) {
865
- const ret = getObject(arg0).msCrypto;
866
- return addHeapObject(ret);
867
- };
868
-
869
- export function __wbg_randomFillSync_b70ccbdf4926a99d() { return handleError(function (arg0, arg1) {
870
- getObject(arg0).randomFillSync(takeObject(arg1));
871
- }, arguments) };
872
-
873
- export function __wbg_getRandomValues_7e42b4fb8779dc6d() { return handleError(function (arg0, arg1) {
874
- getObject(arg0).getRandomValues(getObject(arg1));
875
- }, arguments) };
876
-
877
- export function __wbg_get_bd8e338fbd5f5cc8(arg0, arg1) {
878
- const ret = getObject(arg0)[arg1 >>> 0];
879
- return addHeapObject(ret);
880
- };
881
-
882
- export function __wbg_length_cd7af8117672b8b8(arg0) {
883
- const ret = getObject(arg0).length;
884
- return ret;
885
- };
886
-
887
- export function __wbg_new_16b304a2cfa7ff4a() {
888
- const ret = new Array();
889
- return addHeapObject(ret);
890
- };
891
-
892
- export function __wbg_newnoargs_e258087cd0daa0ea(arg0, arg1) {
893
- const ret = new Function(getStringFromWasm0(arg0, arg1));
894
- return addHeapObject(ret);
895
- };
896
-
897
- export function __wbg_new_d9bc3a0147634640() {
898
- const ret = new Map();
899
- return addHeapObject(ret);
900
- };
901
-
902
- export function __wbg_next_40fc327bfc8770e6(arg0) {
903
- const ret = getObject(arg0).next;
904
- return addHeapObject(ret);
905
- };
906
-
907
- export function __wbg_next_196c84450b364254() { return handleError(function (arg0) {
908
- const ret = getObject(arg0).next();
909
- return addHeapObject(ret);
910
- }, arguments) };
911
-
912
- export function __wbg_done_298b57d23c0fc80c(arg0) {
913
- const ret = getObject(arg0).done;
914
- return ret;
915
- };
916
-
917
- export function __wbg_value_d93c65011f51a456(arg0) {
918
- const ret = getObject(arg0).value;
919
- return addHeapObject(ret);
920
- };
921
-
922
- export function __wbg_iterator_2cee6dadfd956dfa() {
923
- const ret = Symbol.iterator;
924
- return addHeapObject(ret);
925
- };
926
-
927
- export function __wbg_get_e3c254076557e348() { return handleError(function (arg0, arg1) {
928
- const ret = Reflect.get(getObject(arg0), getObject(arg1));
929
- return addHeapObject(ret);
930
- }, arguments) };
931
-
932
- export function __wbg_call_27c0f87801dedf93() { return handleError(function (arg0, arg1) {
933
- const ret = getObject(arg0).call(getObject(arg1));
934
- return addHeapObject(ret);
935
- }, arguments) };
936
-
937
- export function __wbg_new_72fb9a18b5ae2624() {
938
- const ret = new Object();
939
- return addHeapObject(ret);
940
- };
941
-
942
- export function __wbg_self_ce0dbfc45cf2f5be() { return handleError(function () {
943
- const ret = self.self;
944
- return addHeapObject(ret);
945
- }, arguments) };
946
-
947
- export function __wbg_window_c6fb939a7f436783() { return handleError(function () {
948
- const ret = window.window;
949
- return addHeapObject(ret);
950
- }, arguments) };
951
-
952
- export function __wbg_globalThis_d1e6af4856ba331b() { return handleError(function () {
953
- const ret = globalThis.globalThis;
954
- return addHeapObject(ret);
955
- }, arguments) };
956
-
957
- export function __wbg_global_207b558942527489() { return handleError(function () {
958
- const ret = global.global;
959
- return addHeapObject(ret);
960
- }, arguments) };
961
-
962
- export function __wbg_set_d4638f722068f043(arg0, arg1, arg2) {
963
- getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
964
- };
965
-
966
- export function __wbg_isArray_2ab64d95e09ea0ae(arg0) {
967
- const ret = Array.isArray(getObject(arg0));
968
- return ret;
969
- };
970
-
971
- export function __wbg_push_a5b05aedc7234f9f(arg0, arg1) {
972
- const ret = getObject(arg0).push(getObject(arg1));
973
- return ret;
974
- };
975
-
976
- export function __wbg_instanceof_ArrayBuffer_836825be07d4c9d2(arg0) {
977
- let result;
978
- try {
979
- result = getObject(arg0) instanceof ArrayBuffer;
980
- } catch (_) {
981
- result = false;
982
- }
983
- const ret = result;
984
- return ret;
985
- };
986
-
987
- export function __wbg_call_b3ca7c6051f9bec1() { return handleError(function (arg0, arg1, arg2) {
988
- const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
989
- return addHeapObject(ret);
990
- }, arguments) };
991
-
992
- export function __wbg_instanceof_Map_87917e0a7aaf4012(arg0) {
993
- let result;
994
- try {
995
- result = getObject(arg0) instanceof Map;
996
- } catch (_) {
997
- result = false;
998
- }
999
- const ret = result;
1000
- return ret;
1001
- };
1002
-
1003
- export function __wbg_set_8417257aaedc936b(arg0, arg1, arg2) {
1004
- const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
1005
- return addHeapObject(ret);
1006
- };
1007
-
1008
- export function __wbg_isSafeInteger_f7b04ef02296c4d2(arg0) {
1009
- const ret = Number.isSafeInteger(getObject(arg0));
1010
- return ret;
1011
- };
1012
-
1013
- export function __wbg_entries_95cc2c823b285a09(arg0) {
1014
- const ret = Object.entries(getObject(arg0));
1015
- return addHeapObject(ret);
1016
- };
1017
-
1018
- export function __wbg_new_81740750da40724f(arg0, arg1) {
1019
- try {
1020
- var state0 = {a: arg0, b: arg1};
1021
- var cb0 = (arg0, arg1) => {
1022
- const a = state0.a;
1023
- state0.a = 0;
1024
- try {
1025
- return __wbg_adapter_159(a, state0.b, arg0, arg1);
1026
- } finally {
1027
- state0.a = a;
1028
- }
1029
- };
1030
- const ret = new Promise(cb0);
1031
- return addHeapObject(ret);
1032
- } finally {
1033
- state0.a = state0.b = 0;
1034
- }
1035
- };
1036
-
1037
- export function __wbg_resolve_b0083a7967828ec8(arg0) {
1038
- const ret = Promise.resolve(getObject(arg0));
1039
- return addHeapObject(ret);
1040
- };
1041
-
1042
- export function __wbg_then_0c86a60e8fcfe9f6(arg0, arg1) {
1043
- const ret = getObject(arg0).then(getObject(arg1));
1044
- return addHeapObject(ret);
1045
- };
1046
-
1047
- export function __wbg_then_a73caa9a87991566(arg0, arg1, arg2) {
1048
- const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
1049
- return addHeapObject(ret);
1050
- };
1051
-
1052
- export function __wbg_buffer_12d079cc21e14bdb(arg0) {
1053
- const ret = getObject(arg0).buffer;
1054
- return addHeapObject(ret);
1055
- };
1056
-
1057
- export function __wbg_newwithbyteoffsetandlength_aa4a17c33a06e5cb(arg0, arg1, arg2) {
1058
- const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
1059
- return addHeapObject(ret);
1060
- };
1061
-
1062
- export function __wbg_new_63b92bc8671ed464(arg0) {
1063
- const ret = new Uint8Array(getObject(arg0));
1064
- return addHeapObject(ret);
1065
- };
1066
-
1067
- export function __wbg_set_a47bac70306a19a7(arg0, arg1, arg2) {
1068
- getObject(arg0).set(getObject(arg1), arg2 >>> 0);
1069
- };
1070
-
1071
- export function __wbg_length_c20a40f15020d68a(arg0) {
1072
- const ret = getObject(arg0).length;
1073
- return ret;
1074
- };
1075
-
1076
- export function __wbg_instanceof_Uint8Array_2b3bbecd033d19f6(arg0) {
1077
- let result;
1078
- try {
1079
- result = getObject(arg0) instanceof Uint8Array;
1080
- } catch (_) {
1081
- result = false;
1082
- }
1083
- const ret = result;
1084
- return ret;
1085
- };
1086
-
1087
- export function __wbg_newwithlength_e9b4878cebadb3d3(arg0) {
1088
- const ret = new Uint8Array(arg0 >>> 0);
1089
- return addHeapObject(ret);
1090
- };
1091
-
1092
- export function __wbg_subarray_a1f73cd4b5b42fe1(arg0, arg1, arg2) {
1093
- const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
1094
- return addHeapObject(ret);
1095
- };
1096
-
1097
- export function __wbindgen_bigint_get_as_i64(arg0, arg1) {
1098
- const v = getObject(arg1);
1099
- const ret = typeof(v) === 'bigint' ? v : undefined;
1100
- getBigInt64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? BigInt(0) : ret;
1101
- getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
1102
- };
1103
-
1104
- export function __wbindgen_debug_string(arg0, arg1) {
1105
- const ret = debugString(getObject(arg1));
1106
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1107
- const len1 = WASM_VECTOR_LEN;
1108
- getInt32Memory0()[arg0 / 4 + 1] = len1;
1109
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
1110
- };
1111
-
1112
- export function __wbindgen_throw(arg0, arg1) {
1113
- throw new Error(getStringFromWasm0(arg0, arg1));
1114
- };
1115
-
1116
- export function __wbindgen_memory() {
1117
- const ret = wasm.memory;
1118
- return addHeapObject(ret);
1119
- };
1120
-
1121
- export function __wbindgen_closure_wrapper3498(arg0, arg1, arg2) {
1122
- const ret = makeMutClosure(arg0, arg1, 1251, __wbg_adapter_50);
1123
- return addHeapObject(ret);
1124
- };
1125
-