logic-mesh 1.0.0 → 2.0.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/LICENSE +11 -0
- package/README.md +376 -43
- package/dist/EngineSession.d.ts +206 -0
- package/dist/EngineSession.js +277 -0
- package/dist/JsBlocks.d.ts +150 -0
- package/dist/JsBlocks.js +211 -0
- package/dist/LogicMeshError.d.ts +38 -0
- package/dist/LogicMeshError.js +9 -0
- package/dist/ProgramSchema.d.ts +57 -0
- package/dist/ProgramSchema.js +103 -0
- package/dist/ProgramVersion.d.ts +10 -0
- package/dist/ProgramVersion.js +13 -0
- package/dist/TypedBlock.d.ts +32 -2
- package/dist/TypedBlock.js +100 -22
- package/dist/index.d.ts +236 -49
- package/dist/index.js +7 -2
- package/dist/logic_mesh.d.ts +295 -104
- package/dist/logic_mesh.js +1 -1
- package/dist/logic_mesh_bg.js +904 -452
- package/dist/logic_mesh_bg.wasm +0 -0
- package/dist/logic_mesh_bg.wasm.d.ts +45 -26
- package/package.json +35 -20
package/dist/logic_mesh_bg.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Controls the execution
|
|
2
|
+
* Controls the execution of blocks.
|
|
3
|
+
*
|
|
3
4
|
* Loads programs and enables inspection and debugging
|
|
4
|
-
* of
|
|
5
|
+
* of blocks and their inputs and outputs.
|
|
5
6
|
*/
|
|
6
7
|
export class BlocksEngine {
|
|
7
8
|
static __wrap(ptr) {
|
|
@@ -21,6 +22,7 @@ export class BlocksEngine {
|
|
|
21
22
|
wasm.__wbg_blocksengine_free(ptr, 0);
|
|
22
23
|
}
|
|
23
24
|
/**
|
|
25
|
+
* Returns a new `EngineCommand` handle for sending commands.
|
|
24
26
|
* @returns {EngineCommand}
|
|
25
27
|
*/
|
|
26
28
|
engineCommand() {
|
|
@@ -28,44 +30,66 @@ export class BlocksEngine {
|
|
|
28
30
|
return EngineCommand.__wrap(ret);
|
|
29
31
|
}
|
|
30
32
|
/**
|
|
31
|
-
* Lists all
|
|
32
|
-
* @returns {
|
|
33
|
+
* Lists the descriptions of all registered blocks.
|
|
34
|
+
* @returns {BlockDesc[]}
|
|
33
35
|
*/
|
|
34
36
|
listBlocks() {
|
|
35
37
|
const ret = wasm.blocksengine_listBlocks(this.__wbg_ptr);
|
|
36
|
-
return
|
|
38
|
+
return ret;
|
|
37
39
|
}
|
|
38
40
|
/**
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
+
* Creates a new engine instance.
|
|
42
|
+
*
|
|
43
|
+
* `scan_interval` is the engine's scan interval in milliseconds:
|
|
44
|
+
* how long a block that runs on every cycle waits between runs.
|
|
45
|
+
* Left out, the engine's default applies. A fraction of a
|
|
46
|
+
* millisecond is dropped.
|
|
47
|
+
*
|
|
48
|
+
* Throws a `LogicMeshError` with the `InvalidArgument` code if
|
|
49
|
+
* `scan_interval` is negative, not finite, or above
|
|
50
|
+
* `Number.MAX_SAFE_INTEGER`.
|
|
51
|
+
* @param {number | null} [scan_interval]
|
|
41
52
|
*/
|
|
42
|
-
constructor(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
53
|
+
constructor(scan_interval) {
|
|
54
|
+
try {
|
|
55
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
56
|
+
wasm.blocksengine_new(retptr, !isLikeNone(scan_interval), isLikeNone(scan_interval) ? 0 : scan_interval);
|
|
57
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
58
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
59
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
60
|
+
if (r2) {
|
|
61
|
+
throw takeFromExternrefTable0(r1);
|
|
62
|
+
}
|
|
63
|
+
this.__wbg_ptr = r0;
|
|
64
|
+
BlocksEngineFinalization.register(this, this.__wbg_ptr, this);
|
|
65
|
+
return this;
|
|
66
|
+
} finally {
|
|
67
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
68
|
+
}
|
|
47
69
|
}
|
|
48
70
|
/**
|
|
49
|
-
*
|
|
50
|
-
* The block is described by a JsBlockDesc object
|
|
71
|
+
* Registers a new JS block in the registry and returns its name.
|
|
51
72
|
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
73
|
+
* `func`, if provided, is a factory that returns the function
|
|
74
|
+
* executing the block — without it (`null` or `undefined`) the
|
|
75
|
+
* block is a no-op. Pin kinds must be the lowercase Haystack names
|
|
76
|
+
* (`"number"`, `"str"`, …).
|
|
56
77
|
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
78
|
+
* Throws a `LogicMeshError`: `InvalidArgument` if `desc` is not a
|
|
79
|
+
* block description or `func` is neither a function nor left out,
|
|
80
|
+
* `UnknownPinKind`, `UnknownRunCondition` or `BlockNotExternal` for
|
|
81
|
+
* a bad field, and `BlockAlreadyRegistered` if the library already
|
|
82
|
+
* has a block of that name. Nothing is registered then.
|
|
83
|
+
* @param {BlockDesc} desc
|
|
84
|
+
* @param {JsBlockFactory | null | void} func
|
|
61
85
|
* @returns {string}
|
|
62
86
|
*/
|
|
63
87
|
registerBlock(desc, func) {
|
|
64
88
|
let deferred2_0;
|
|
65
89
|
let deferred2_1;
|
|
66
90
|
try {
|
|
67
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
68
|
-
wasm.blocksengine_registerBlock(retptr, this.__wbg_ptr,
|
|
91
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
92
|
+
wasm.blocksengine_registerBlock(retptr, this.__wbg_ptr, desc, func);
|
|
69
93
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
70
94
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
71
95
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -74,31 +98,92 @@ export class BlocksEngine {
|
|
|
74
98
|
var len1 = r1;
|
|
75
99
|
if (r3) {
|
|
76
100
|
ptr1 = 0; len1 = 0;
|
|
77
|
-
throw
|
|
101
|
+
throw takeFromExternrefTable0(r2);
|
|
78
102
|
}
|
|
79
103
|
deferred2_0 = ptr1;
|
|
80
104
|
deferred2_1 = len1;
|
|
81
105
|
return getStringFromWasm0(ptr1, len1);
|
|
82
106
|
} finally {
|
|
83
107
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
84
|
-
wasm.
|
|
108
|
+
wasm.__wbindgen_export3(deferred2_0, deferred2_1, 1);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Registers a JavaScript-implemented connector under `name` in
|
|
113
|
+
* the process-wide connector registry, as the module-level
|
|
114
|
+
* `registerConnector` function does, and throws as it does.
|
|
115
|
+
*
|
|
116
|
+
* Attach the registered connector to the running engine with the
|
|
117
|
+
* `addConnector` engine command.
|
|
118
|
+
* @param {string} name
|
|
119
|
+
* @param {JsConnector} connector
|
|
120
|
+
*/
|
|
121
|
+
registerConnector(name, connector) {
|
|
122
|
+
try {
|
|
123
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
124
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
125
|
+
const len0 = WASM_VECTOR_LEN;
|
|
126
|
+
wasm.blocksengine_registerConnector(retptr, this.__wbg_ptr, ptr0, len0, connector);
|
|
127
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
128
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
129
|
+
if (r1) {
|
|
130
|
+
throw takeFromExternrefTable0(r0);
|
|
131
|
+
}
|
|
132
|
+
} finally {
|
|
133
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
85
134
|
}
|
|
86
135
|
}
|
|
87
136
|
/**
|
|
88
|
-
* Runs the engine asynchronously
|
|
89
|
-
*
|
|
90
|
-
*
|
|
137
|
+
* Runs the engine asynchronously.
|
|
138
|
+
*
|
|
139
|
+
* After this is called, the engine instance can't be used directly —
|
|
140
|
+
* use the command object to communicate with the engine instead.
|
|
91
141
|
* @returns {Promise<void>}
|
|
92
142
|
*/
|
|
93
143
|
run() {
|
|
94
144
|
const ret = wasm.blocksengine_run(this.__wbg_ptr);
|
|
95
|
-
return
|
|
145
|
+
return ret;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Removes the connector registered under `name` from the
|
|
149
|
+
* process-wide connector registry, returning whether a connector
|
|
150
|
+
* was removed, as the module-level `unregisterConnector` function
|
|
151
|
+
* does.
|
|
152
|
+
*
|
|
153
|
+
* Meant for a connector that was registered but never attached. A
|
|
154
|
+
* connector attached to the running engine should instead be
|
|
155
|
+
* removed with the `removeConnector` engine command, which
|
|
156
|
+
* detaches and stops it before unregistering.
|
|
157
|
+
* @param {string} name
|
|
158
|
+
* @returns {boolean}
|
|
159
|
+
*/
|
|
160
|
+
unregisterConnector(name) {
|
|
161
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
162
|
+
const len0 = WASM_VECTOR_LEN;
|
|
163
|
+
const ret = wasm.blocksengine_unregisterConnector(this.__wbg_ptr, ptr0, len0);
|
|
164
|
+
return ret !== 0;
|
|
96
165
|
}
|
|
97
166
|
}
|
|
98
167
|
if (Symbol.dispose) BlocksEngine.prototype[Symbol.dispose] = BlocksEngine.prototype.free;
|
|
99
168
|
|
|
100
169
|
/**
|
|
101
170
|
* Commands a running instance of a Block Engine.
|
|
171
|
+
*
|
|
172
|
+
* Every method sends one request and resolves with the engine's
|
|
173
|
+
* response to it. Calls on one handle may overlap freely, and every
|
|
174
|
+
* handle feeds the same engine, which handles requests in the order
|
|
175
|
+
* they arrive.
|
|
176
|
+
*
|
|
177
|
+
* A failed request rejects its promise with a `LogicMeshError`: an
|
|
178
|
+
* `Error` whose `code` property is the stable name of the failure —
|
|
179
|
+
* `BlockInstanceNotFound`, `UnsupportedProgramVersion`, … — and whose
|
|
180
|
+
* `message` describes it.
|
|
181
|
+
*
|
|
182
|
+
* Haystack values reach JavaScript in one encoding, from every method
|
|
183
|
+
* and in every watch notification, JS block call and connector call
|
|
184
|
+
* alike: the Haystack JSON encoding as JSON-compatible values. A Dict
|
|
185
|
+
* is a plain object, never a `Map`, and `Null`, or a missing value, is
|
|
186
|
+
* `null`, never `undefined`.
|
|
102
187
|
*/
|
|
103
188
|
export class EngineCommand {
|
|
104
189
|
static __wrap(ptr) {
|
|
@@ -118,151 +203,193 @@ export class EngineCommand {
|
|
|
118
203
|
wasm.__wbg_enginecommand_free(ptr, 0);
|
|
119
204
|
}
|
|
120
205
|
/**
|
|
121
|
-
* Adds a block instance to the engine
|
|
122
|
-
*
|
|
206
|
+
* Adds a block instance to the engine, immediately scheduling it
|
|
207
|
+
* for execution, and resolves with its id. Without `lib`, the block
|
|
208
|
+
* is looked up in every library, and a name more than one library
|
|
209
|
+
* holds is rejected.
|
|
123
210
|
* @param {string} block_name
|
|
124
211
|
* @param {string | null} [block_uuid]
|
|
125
212
|
* @param {string | null} [lib]
|
|
126
213
|
* @returns {Promise<string>}
|
|
127
214
|
*/
|
|
128
215
|
addBlock(block_name, block_uuid, lib) {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
216
|
+
let ptr0, len0, ptr1, len1, ptr2, len2;
|
|
217
|
+
try {
|
|
218
|
+
ptr0 = passStringToWasm0(block_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
219
|
+
len0 = WASM_VECTOR_LEN;
|
|
220
|
+
ptr1 = isLikeNone(block_uuid) ? 0 : passStringToWasm0(block_uuid, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
221
|
+
len1 = WASM_VECTOR_LEN;
|
|
222
|
+
ptr2 = isLikeNone(lib) ? 0 : passStringToWasm0(lib, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
223
|
+
len2 = WASM_VECTOR_LEN;
|
|
224
|
+
} catch (e) {
|
|
225
|
+
if (ptr2) { wasm.__wbindgen_export3(ptr2, len2 * 1, 1); }
|
|
226
|
+
if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
|
|
227
|
+
if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
|
|
228
|
+
throw e;
|
|
229
|
+
}
|
|
135
230
|
const ret = wasm.enginecommand_addBlock(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
136
|
-
return
|
|
231
|
+
return ret;
|
|
137
232
|
}
|
|
138
233
|
/**
|
|
139
|
-
*
|
|
234
|
+
* Attaches an already-registered connector, by name, to the
|
|
235
|
+
* running engine: the engine resolves the name in the process-wide
|
|
236
|
+
* connector registry, starts the connector, and manages its
|
|
237
|
+
* lifecycle from then on. Register the connector first, with
|
|
238
|
+
* `registerConnector`.
|
|
140
239
|
*
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
*
|
|
240
|
+
* A paused engine still answers this request, like every other.
|
|
241
|
+
* @param {string} name
|
|
242
|
+
* @returns {Promise<string>}
|
|
243
|
+
*/
|
|
244
|
+
addConnector(name) {
|
|
245
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
246
|
+
const len0 = WASM_VECTOR_LEN;
|
|
247
|
+
const ret = wasm.enginecommand_addConnector(this.__wbg_ptr, ptr0, len0);
|
|
248
|
+
return ret;
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Links an output (or input) of one block to an input of another,
|
|
252
|
+
* and resolves with the link, its id assigned.
|
|
153
253
|
* @param {string} source_block_uuid
|
|
154
254
|
* @param {string} target_block_uuid
|
|
155
255
|
* @param {string} source_block_pin_name
|
|
156
256
|
* @param {string} target_block_pin_name
|
|
157
|
-
* @returns {
|
|
257
|
+
* @returns {LinkData}
|
|
158
258
|
*/
|
|
159
259
|
createLink(source_block_uuid, target_block_uuid, source_block_pin_name, target_block_pin_name) {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
260
|
+
let ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3;
|
|
261
|
+
try {
|
|
262
|
+
ptr0 = passStringToWasm0(source_block_uuid, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
263
|
+
len0 = WASM_VECTOR_LEN;
|
|
264
|
+
ptr1 = passStringToWasm0(target_block_uuid, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
265
|
+
len1 = WASM_VECTOR_LEN;
|
|
266
|
+
ptr2 = passStringToWasm0(source_block_pin_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
267
|
+
len2 = WASM_VECTOR_LEN;
|
|
268
|
+
ptr3 = passStringToWasm0(target_block_pin_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
269
|
+
len3 = WASM_VECTOR_LEN;
|
|
270
|
+
} catch (e) {
|
|
271
|
+
if (ptr3) { wasm.__wbindgen_export3(ptr3, len3 * 1, 1); }
|
|
272
|
+
if (ptr2) { wasm.__wbindgen_export3(ptr2, len2 * 1, 1); }
|
|
273
|
+
if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
|
|
274
|
+
if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
|
|
275
|
+
throw e;
|
|
276
|
+
}
|
|
168
277
|
const ret = wasm.enginecommand_createLink(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
169
|
-
return
|
|
278
|
+
return ret;
|
|
170
279
|
}
|
|
171
280
|
/**
|
|
172
|
-
*
|
|
281
|
+
* Opens a watch on block changes: from now on `callback` is called
|
|
282
|
+
* with a notification for every block change, until `removeWatch`
|
|
283
|
+
* closes the watch. Resolves with the watch's id once the engine
|
|
284
|
+
* opened it.
|
|
173
285
|
*
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
* (
|
|
178
|
-
*
|
|
179
|
-
* dropped fault notifications, which the UI is now load-bearing on
|
|
180
|
-
* (red ring/edge rendering).
|
|
181
|
-
* @param {Function} callback
|
|
182
|
-
* @returns {Promise<void>}
|
|
286
|
+
* Notifications are queued without bound between the engine and
|
|
287
|
+
* the callback, so a burst — such as many blocks faulting while a
|
|
288
|
+
* program loads — is never dropped.
|
|
289
|
+
* @param {(notification: BlockNotification) => void} callback
|
|
290
|
+
* @returns {Promise<number>}
|
|
183
291
|
*/
|
|
184
292
|
createWatch(callback) {
|
|
185
|
-
const ret = wasm.enginecommand_createWatch(this.__wbg_ptr,
|
|
186
|
-
return
|
|
293
|
+
const ret = wasm.enginecommand_createWatch(this.__wbg_ptr, callback);
|
|
294
|
+
return ret;
|
|
187
295
|
}
|
|
188
296
|
/**
|
|
189
|
-
* Evaluates a block by name
|
|
190
|
-
* This will create a block instance and execute it.
|
|
297
|
+
* Evaluates a block by name, returning its output values.
|
|
191
298
|
*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
*
|
|
198
|
-
*
|
|
299
|
+
* Creates a temporary block instance, feeds it the given `inputs`,
|
|
300
|
+
* executes it, and returns the outputs. Without `lib`, the block is
|
|
301
|
+
* looked up in every library, as for `addBlock`. Each input is read
|
|
302
|
+
* as `writeBlockInput` reads its value. An evaluation still running
|
|
303
|
+
* after 5 s — a block waiting for an input `inputs` does not supply,
|
|
304
|
+
* say — rejects with `EvalTimeout`, and the engine goes on answering
|
|
305
|
+
* commands.
|
|
199
306
|
* @param {string} block_name
|
|
200
|
-
* @param {
|
|
307
|
+
* @param {unknown[]} inputs
|
|
201
308
|
* @param {string | null} [lib]
|
|
202
|
-
* @returns {
|
|
309
|
+
* @returns {unknown[]}
|
|
203
310
|
*/
|
|
204
311
|
evalBlock(block_name, inputs, lib) {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
312
|
+
let ptr0, len0, ptr1, len1, ptr2, len2;
|
|
313
|
+
try {
|
|
314
|
+
ptr0 = passStringToWasm0(block_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
315
|
+
len0 = WASM_VECTOR_LEN;
|
|
316
|
+
ptr1 = passArrayJsValueToWasm0(inputs, wasm.__wbindgen_export);
|
|
317
|
+
len1 = WASM_VECTOR_LEN;
|
|
318
|
+
ptr2 = isLikeNone(lib) ? 0 : passStringToWasm0(lib, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
319
|
+
len2 = WASM_VECTOR_LEN;
|
|
320
|
+
} catch (e) {
|
|
321
|
+
if (ptr2) { wasm.__wbindgen_export3(ptr2, len2 * 1, 1); }
|
|
322
|
+
if (ptr1) { wasm.__wbindgen_export7(ptr1, len1); wasm.__wbindgen_export3(ptr1, len1 * 4, 4); }
|
|
323
|
+
if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
|
|
324
|
+
throw e;
|
|
325
|
+
}
|
|
211
326
|
const ret = wasm.enginecommand_evalBlock(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
212
|
-
return
|
|
327
|
+
return ret;
|
|
213
328
|
}
|
|
214
329
|
/**
|
|
215
|
-
*
|
|
216
|
-
*
|
|
217
|
-
* `
|
|
218
|
-
*
|
|
330
|
+
* Returns the engine's current program in the save format, as
|
|
331
|
+
* plain JSON-compatible objects: maps are objects, not `Map`s, and
|
|
332
|
+
* a missing value is `null`. Round-trips through `loadProgram`,
|
|
333
|
+
* editor metadata included.
|
|
334
|
+
* @returns {Program}
|
|
219
335
|
*/
|
|
220
336
|
getProgram() {
|
|
221
337
|
const ret = wasm.enginecommand_getProgram(this.__wbg_ptr);
|
|
222
|
-
return
|
|
338
|
+
return ret;
|
|
223
339
|
}
|
|
224
340
|
/**
|
|
225
|
-
*
|
|
341
|
+
* Resolves with a block's state and pin values, as plain
|
|
342
|
+
* JSON-compatible objects.
|
|
226
343
|
* @param {string} block_uuid
|
|
227
|
-
* @returns {
|
|
344
|
+
* @returns {BlockInspection}
|
|
228
345
|
*/
|
|
229
346
|
inspectBlock(block_uuid) {
|
|
230
347
|
const ptr0 = passStringToWasm0(block_uuid, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
231
348
|
const len0 = WASM_VECTOR_LEN;
|
|
232
349
|
const ret = wasm.enginecommand_inspectBlock(this.__wbg_ptr, ptr0, len0);
|
|
233
|
-
return
|
|
350
|
+
return ret;
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Lists the names of the engine-managed connectors.
|
|
354
|
+
*
|
|
355
|
+
* A paused engine still answers this request, like every other.
|
|
356
|
+
* @returns {Promise<string[]>}
|
|
357
|
+
*/
|
|
358
|
+
listConnectors() {
|
|
359
|
+
const ret = wasm.enginecommand_listConnectors(this.__wbg_ptr);
|
|
360
|
+
return ret;
|
|
234
361
|
}
|
|
235
362
|
/**
|
|
236
|
-
*
|
|
237
|
-
*
|
|
238
|
-
*
|
|
239
|
-
*
|
|
240
|
-
*
|
|
363
|
+
* Loads a full program (blocks, links, pin values, UI and editor
|
|
364
|
+
* metadata) into the engine, all or nothing. The engine is
|
|
365
|
+
* expected to be empty: call `resetEngine` first if reloading.
|
|
366
|
+
*
|
|
367
|
+
* A program with no `version` is a save from before format
|
|
368
|
+
* versions, and loads as one. A program from a newer format is
|
|
369
|
+
* rejected with the `UnsupportedProgramVersion` code before its
|
|
370
|
+
* shape is read; one that is not a program at all with
|
|
371
|
+
* `InvalidProgram`.
|
|
372
|
+
* @param {Program} program
|
|
241
373
|
* @returns {Promise<void>}
|
|
242
374
|
*/
|
|
243
375
|
loadProgram(program) {
|
|
244
|
-
const ret = wasm.enginecommand_loadProgram(this.__wbg_ptr,
|
|
245
|
-
return
|
|
376
|
+
const ret = wasm.enginecommand_loadProgram(this.__wbg_ptr, program);
|
|
377
|
+
return ret;
|
|
246
378
|
}
|
|
247
379
|
/**
|
|
248
|
-
* Pauses
|
|
249
|
-
*
|
|
380
|
+
* Pauses block execution: no block executes until
|
|
381
|
+
* `resumeExecution`, while every other request is still answered.
|
|
382
|
+
* Connector IO tasks keep running. Does nothing if already paused.
|
|
383
|
+
* Resolves once the engine paused.
|
|
250
384
|
* @returns {Promise<void>}
|
|
251
385
|
*/
|
|
252
386
|
pauseExecution() {
|
|
253
387
|
const ret = wasm.enginecommand_pauseExecution(this.__wbg_ptr);
|
|
254
|
-
return
|
|
388
|
+
return ret;
|
|
255
389
|
}
|
|
256
390
|
/**
|
|
257
|
-
* Removes a block instance from the engine
|
|
258
|
-
*
|
|
259
|
-
* and removed from the engine together with all its links.
|
|
260
|
-
*
|
|
261
|
-
* # Arguments
|
|
262
|
-
* * `block_uuid` - The UUID of the block to be removed
|
|
263
|
-
*
|
|
264
|
-
* # Returns
|
|
265
|
-
* The UUID of the removed block
|
|
391
|
+
* Removes a block instance and all its links from the engine,
|
|
392
|
+
* returning the UUID of the removed block.
|
|
266
393
|
* @param {string} block_uuid
|
|
267
394
|
* @returns {Promise<string>}
|
|
268
395
|
*/
|
|
@@ -270,16 +397,25 @@ export class EngineCommand {
|
|
|
270
397
|
const ptr0 = passStringToWasm0(block_uuid, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
271
398
|
const len0 = WASM_VECTOR_LEN;
|
|
272
399
|
const ret = wasm.enginecommand_removeBlock(this.__wbg_ptr, ptr0, len0);
|
|
273
|
-
return
|
|
400
|
+
return ret;
|
|
274
401
|
}
|
|
275
402
|
/**
|
|
276
|
-
*
|
|
277
|
-
*
|
|
278
|
-
*
|
|
279
|
-
* * `link_uuid` - The UUID of the link to be removed
|
|
403
|
+
* Detaches an engine-managed connector by name: the engine stops
|
|
404
|
+
* tracking it, unregisters it from the process-wide registry, and
|
|
405
|
+
* stops it. Returns the removed connector's name.
|
|
280
406
|
*
|
|
281
|
-
*
|
|
282
|
-
*
|
|
407
|
+
* A paused engine still answers this request, like every other.
|
|
408
|
+
* @param {string} name
|
|
409
|
+
* @returns {Promise<string>}
|
|
410
|
+
*/
|
|
411
|
+
removeConnector(name) {
|
|
412
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
413
|
+
const len0 = WASM_VECTOR_LEN;
|
|
414
|
+
const ret = wasm.enginecommand_removeConnector(this.__wbg_ptr, ptr0, len0);
|
|
415
|
+
return ret;
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* Removes a link by UUID, returning `true` if it was found and removed.
|
|
283
419
|
* @param {string} link_uuid
|
|
284
420
|
* @returns {Promise<boolean>}
|
|
285
421
|
*/
|
|
@@ -287,197 +423,435 @@ export class EngineCommand {
|
|
|
287
423
|
const ptr0 = passStringToWasm0(link_uuid, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
288
424
|
const len0 = WASM_VECTOR_LEN;
|
|
289
425
|
const ret = wasm.enginecommand_removeLink(this.__wbg_ptr, ptr0, len0);
|
|
290
|
-
return
|
|
426
|
+
return ret;
|
|
291
427
|
}
|
|
292
428
|
/**
|
|
293
|
-
*
|
|
429
|
+
* Closes the watch `createWatch` resolved with `watch_id`, resolving
|
|
430
|
+
* with whether the engine had it open. Once this resolves, its
|
|
431
|
+
* callback is not called again.
|
|
432
|
+
*
|
|
433
|
+
* Rejects with the `InvalidArgument` code if `watch_id` cannot be
|
|
434
|
+
* a watch id.
|
|
435
|
+
* @param {number} watch_id
|
|
436
|
+
* @returns {Promise<boolean>}
|
|
437
|
+
*/
|
|
438
|
+
removeWatch(watch_id) {
|
|
439
|
+
const ret = wasm.enginecommand_removeWatch(this.__wbg_ptr, watch_id);
|
|
440
|
+
return ret;
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* Resets the engine state, clearing all blocks and links, and
|
|
444
|
+
* unregistering and stopping the engine-managed connectors — also
|
|
445
|
+
* while paused, and the engine stays paused. Resolves once the
|
|
446
|
+
* reset is done.
|
|
294
447
|
* @returns {Promise<void>}
|
|
295
448
|
*/
|
|
296
449
|
resetEngine() {
|
|
297
450
|
const ret = wasm.enginecommand_resetEngine(this.__wbg_ptr);
|
|
298
|
-
return
|
|
451
|
+
return ret;
|
|
299
452
|
}
|
|
300
453
|
/**
|
|
301
|
-
* Resumes
|
|
302
|
-
*
|
|
454
|
+
* Resumes block execution. Does nothing if not paused. Resolves
|
|
455
|
+
* once the engine resumed.
|
|
303
456
|
* @returns {Promise<void>}
|
|
304
457
|
*/
|
|
305
458
|
resumeExecution() {
|
|
306
459
|
const ret = wasm.enginecommand_resumeExecution(this.__wbg_ptr);
|
|
307
|
-
return
|
|
460
|
+
return ret;
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
* Replaces the editor metadata a block is saved with — any JSON
|
|
464
|
+
* object — or removes it if `editor` is `null` or `undefined`.
|
|
465
|
+
* @param {string} block_uuid
|
|
466
|
+
* @param {EditorMetadata | null | undefined} editor
|
|
467
|
+
* @returns {Promise<void>}
|
|
468
|
+
*/
|
|
469
|
+
setBlockEditor(block_uuid, editor) {
|
|
470
|
+
const ptr0 = passStringToWasm0(block_uuid, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
471
|
+
const len0 = WASM_VECTOR_LEN;
|
|
472
|
+
const ret = wasm.enginecommand_setBlockEditor(this.__wbg_ptr, ptr0, len0, editor);
|
|
473
|
+
return ret;
|
|
474
|
+
}
|
|
475
|
+
/**
|
|
476
|
+
* Updates the label and position a block is saved with: each of
|
|
477
|
+
* `label` and `position` that is given replaces the stored one.
|
|
478
|
+
* @param {string} block_uuid
|
|
479
|
+
* @param {string | null | undefined} label
|
|
480
|
+
* @param {Position | null | undefined} position
|
|
481
|
+
* @returns {Promise<void>}
|
|
482
|
+
*/
|
|
483
|
+
setBlockMetadata(block_uuid, label, position) {
|
|
484
|
+
let ptr0, len0, ptr1, len1;
|
|
485
|
+
try {
|
|
486
|
+
ptr0 = passStringToWasm0(block_uuid, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
487
|
+
len0 = WASM_VECTOR_LEN;
|
|
488
|
+
ptr1 = isLikeNone(label) ? 0 : passStringToWasm0(label, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
489
|
+
len1 = WASM_VECTOR_LEN;
|
|
490
|
+
} catch (e) {
|
|
491
|
+
if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
|
|
492
|
+
if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
|
|
493
|
+
throw e;
|
|
494
|
+
}
|
|
495
|
+
const ret = wasm.enginecommand_setBlockMetadata(this.__wbg_ptr, ptr0, len0, ptr1, len1, position);
|
|
496
|
+
return ret;
|
|
308
497
|
}
|
|
309
498
|
/**
|
|
310
|
-
*
|
|
499
|
+
* Stops the engine: `run` resolves, keeping the blocks so a later
|
|
500
|
+
* `run` resumes them. Resolves once block execution and the
|
|
501
|
+
* managed connectors stopped.
|
|
311
502
|
* @returns {Promise<void>}
|
|
312
503
|
*/
|
|
313
504
|
stopEngine() {
|
|
314
505
|
const ret = wasm.enginecommand_stopEngine(this.__wbg_ptr);
|
|
315
|
-
return
|
|
506
|
+
return ret;
|
|
316
507
|
}
|
|
317
508
|
/**
|
|
318
|
-
* Writes
|
|
319
|
-
*
|
|
320
|
-
* # Arguments
|
|
321
|
-
* * `block_uuid` - The UUID of the block to write to
|
|
322
|
-
* * `input_name` - The name of the input to write to
|
|
323
|
-
* * `value` - The value to write
|
|
509
|
+
* Writes a value to a block's input pin, resolving with the input's
|
|
510
|
+
* previous value, or `null` if it had none.
|
|
324
511
|
*
|
|
325
|
-
*
|
|
326
|
-
*
|
|
512
|
+
* `value` is a Haystack value in its JSON encoding, made of plain
|
|
513
|
+
* objects and arrays — `Map`s are read as Dicts too; `null` and
|
|
514
|
+
* `undefined` write `Null`.
|
|
515
|
+
* Anything else, such as a `Date` or a function, rejects with the
|
|
516
|
+
* `InvalidValue` code.
|
|
327
517
|
* @param {string} block_uuid
|
|
328
518
|
* @param {string} input_name
|
|
329
|
-
* @param {
|
|
330
|
-
* @returns {
|
|
519
|
+
* @param {unknown} value
|
|
520
|
+
* @returns {unknown}
|
|
331
521
|
*/
|
|
332
522
|
writeBlockInput(block_uuid, input_name, value) {
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
523
|
+
let ptr0, len0, ptr1, len1;
|
|
524
|
+
try {
|
|
525
|
+
ptr0 = passStringToWasm0(block_uuid, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
526
|
+
len0 = WASM_VECTOR_LEN;
|
|
527
|
+
ptr1 = passStringToWasm0(input_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
528
|
+
len1 = WASM_VECTOR_LEN;
|
|
529
|
+
} catch (e) {
|
|
530
|
+
if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
|
|
531
|
+
if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
|
|
532
|
+
throw e;
|
|
533
|
+
}
|
|
534
|
+
const ret = wasm.enginecommand_writeBlockInput(this.__wbg_ptr, ptr0, len0, ptr1, len1, value);
|
|
535
|
+
return ret;
|
|
339
536
|
}
|
|
340
537
|
/**
|
|
341
|
-
* Writes
|
|
538
|
+
* Writes a value to a block's output pin, resolving with the output's
|
|
539
|
+
* previous value.
|
|
342
540
|
*
|
|
343
|
-
*
|
|
344
|
-
*
|
|
345
|
-
*
|
|
346
|
-
*
|
|
347
|
-
*
|
|
348
|
-
* # Returns
|
|
349
|
-
* The block data
|
|
541
|
+
* `value` is a Haystack value in its JSON encoding, made of plain
|
|
542
|
+
* objects and arrays — `Map`s are read as Dicts too; `null` and
|
|
543
|
+
* `undefined` write `Null`.
|
|
544
|
+
* Anything else, such as a `Date` or a function, rejects with the
|
|
545
|
+
* `InvalidValue` code.
|
|
350
546
|
* @param {string} block_uuid
|
|
351
547
|
* @param {string} output_name
|
|
352
|
-
* @param {
|
|
353
|
-
* @returns {
|
|
548
|
+
* @param {unknown} value
|
|
549
|
+
* @returns {unknown}
|
|
354
550
|
*/
|
|
355
551
|
writeBlockOutput(block_uuid, output_name, value) {
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
552
|
+
let ptr0, len0, ptr1, len1;
|
|
553
|
+
try {
|
|
554
|
+
ptr0 = passStringToWasm0(block_uuid, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
555
|
+
len0 = WASM_VECTOR_LEN;
|
|
556
|
+
ptr1 = passStringToWasm0(output_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
557
|
+
len1 = WASM_VECTOR_LEN;
|
|
558
|
+
} catch (e) {
|
|
559
|
+
if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
|
|
560
|
+
if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
|
|
561
|
+
throw e;
|
|
562
|
+
}
|
|
563
|
+
const ret = wasm.enginecommand_writeBlockOutput(this.__wbg_ptr, ptr0, len0, ptr1, len1, value);
|
|
564
|
+
return ret;
|
|
362
565
|
}
|
|
363
566
|
}
|
|
364
567
|
if (Symbol.dispose) EngineCommand.prototype[Symbol.dispose] = EngineCommand.prototype.free;
|
|
365
568
|
|
|
366
569
|
/**
|
|
367
|
-
*
|
|
570
|
+
* Reports whether the connector currently registered under `name` is
|
|
571
|
+
* a JavaScript connector wrapping exactly `connector` — compared by
|
|
572
|
+
* JS object identity (`===`), the way JS itself distinguishes two
|
|
573
|
+
* same-shaped objects.
|
|
574
|
+
*
|
|
575
|
+
* This is what lets a JS façade decide *ownership* against the live
|
|
576
|
+
* registry rather than its own bookkeeping: a boolean "I registered
|
|
577
|
+
* this" flag goes stale the moment an engine reset unregisters the
|
|
578
|
+
* connector behind the façade's back, after which the same name may
|
|
579
|
+
* be re-registered by someone else. `false` therefore means either
|
|
580
|
+
* "nothing is registered under `name`" or "something else is".
|
|
581
|
+
* @param {string} name
|
|
582
|
+
* @param {JsConnector} connector
|
|
583
|
+
* @returns {boolean}
|
|
584
|
+
*/
|
|
585
|
+
export function connectorIs(name, connector) {
|
|
586
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
587
|
+
const len0 = WASM_VECTOR_LEN;
|
|
588
|
+
const ret = wasm.connectorIs(ptr0, len0, connector);
|
|
589
|
+
return ret !== 0;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
/**
|
|
593
|
+
* Reports whether a connector is registered under `name` in the
|
|
594
|
+
* process-wide connector registry.
|
|
595
|
+
*
|
|
596
|
+
* Lets JS distinguish "not yet registered" from "registered but
|
|
597
|
+
* stale" (e.g. a registry entry that outlived a module re-init)
|
|
598
|
+
* without attempting a registration just to catch the
|
|
599
|
+
* already-registered error — `registerConnector` rejects duplicates,
|
|
600
|
+
* and the registry lives for the process, not the module.
|
|
601
|
+
* @param {string} name
|
|
602
|
+
* @returns {boolean}
|
|
603
|
+
*/
|
|
604
|
+
export function connectorRegistered(name) {
|
|
605
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
606
|
+
const len0 = WASM_VECTOR_LEN;
|
|
607
|
+
const ret = wasm.connectorRegistered(ptr0, len0);
|
|
608
|
+
return ret !== 0;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
/**
|
|
612
|
+
* Creates a new `BlocksEngine`, as its constructor does.
|
|
613
|
+
*
|
|
614
|
+
* `scan_interval` is the engine's scan interval in milliseconds: how
|
|
615
|
+
* long a block that runs on every cycle waits between runs. Left out,
|
|
616
|
+
* the engine's default applies. A fraction of a millisecond is
|
|
617
|
+
* dropped.
|
|
618
|
+
*
|
|
619
|
+
* Throws a `LogicMeshError` with the `InvalidArgument` code if
|
|
620
|
+
* `scan_interval` is negative, not finite, or above
|
|
621
|
+
* `Number.MAX_SAFE_INTEGER`.
|
|
622
|
+
* @param {number | null} [scan_interval]
|
|
368
623
|
* @returns {BlocksEngine}
|
|
369
624
|
*/
|
|
370
|
-
export function initEngine(
|
|
371
|
-
|
|
372
|
-
|
|
625
|
+
export function initEngine(scan_interval) {
|
|
626
|
+
try {
|
|
627
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
628
|
+
wasm.initEngine(retptr, !isLikeNone(scan_interval), isLikeNone(scan_interval) ? 0 : scan_interval);
|
|
629
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
630
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
631
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
632
|
+
if (r2) {
|
|
633
|
+
throw takeFromExternrefTable0(r1);
|
|
634
|
+
}
|
|
635
|
+
return BlocksEngine.__wrap(r0);
|
|
636
|
+
} finally {
|
|
637
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
638
|
+
}
|
|
373
639
|
}
|
|
374
640
|
|
|
375
641
|
export function init_panic_hook() {
|
|
376
642
|
wasm.init_panic_hook();
|
|
377
643
|
}
|
|
378
644
|
|
|
645
|
+
/**
|
|
646
|
+
* Registers a JavaScript-implemented connector under `name` in the
|
|
647
|
+
* process-wide connector registry.
|
|
648
|
+
*
|
|
649
|
+
* `connector` is an object carrying `subscribe`, `publish` and
|
|
650
|
+
* `request` functions plus optional `start` and `stop` (see
|
|
651
|
+
* `JsConnector`). Callable at any time, including while an engine
|
|
652
|
+
* runs; attach the registered connector to a running engine with the
|
|
653
|
+
* `addConnector` engine command.
|
|
654
|
+
*
|
|
655
|
+
* Throws a `LogicMeshError`: `ConnectorMethodMissing`,
|
|
656
|
+
* `ConnectorMethodNotFunction` or `ConnectorPropertyUnreadable` if
|
|
657
|
+
* `connector` does not have the required shape, and
|
|
658
|
+
* `ConnectorAlreadyRegistered` if a connector named `name` is already
|
|
659
|
+
* registered.
|
|
660
|
+
* @param {string} name
|
|
661
|
+
* @param {JsConnector} connector
|
|
662
|
+
*/
|
|
663
|
+
export function registerConnector(name, connector) {
|
|
664
|
+
try {
|
|
665
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
666
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
667
|
+
const len0 = WASM_VECTOR_LEN;
|
|
668
|
+
wasm.registerConnector(retptr, ptr0, len0, connector);
|
|
669
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
670
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
671
|
+
if (r1) {
|
|
672
|
+
throw takeFromExternrefTable0(r0);
|
|
673
|
+
}
|
|
674
|
+
} finally {
|
|
675
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
/**
|
|
680
|
+
* Sets the most verbose level the module logs to the console at:
|
|
681
|
+
* `'off'`, `'error'`, `'warn'` (the default), `'info'`, `'debug'` or
|
|
682
|
+
* `'trace'`.
|
|
683
|
+
*
|
|
684
|
+
* The level is process-wide, as the `log` crate's is: it also limits
|
|
685
|
+
* a logger a Rust application installed instead of the module's own.
|
|
686
|
+
*
|
|
687
|
+
* Throws a `LogicMeshError` with the `InvalidArgument` code for any
|
|
688
|
+
* other level.
|
|
689
|
+
* @param {LogLevel} level
|
|
690
|
+
*/
|
|
691
|
+
export function setLogLevel(level) {
|
|
692
|
+
try {
|
|
693
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
694
|
+
const ptr0 = passStringToWasm0(level, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
695
|
+
const len0 = WASM_VECTOR_LEN;
|
|
696
|
+
wasm.setLogLevel(retptr, ptr0, len0);
|
|
697
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
698
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
699
|
+
if (r1) {
|
|
700
|
+
throw takeFromExternrefTable0(r0);
|
|
701
|
+
}
|
|
702
|
+
} finally {
|
|
703
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
/**
|
|
708
|
+
* The module's start hook, which runs when the module loads: routes
|
|
709
|
+
* panics to `console.error` and installs a console logger at the
|
|
710
|
+
* `'warn'` level.
|
|
711
|
+
*
|
|
712
|
+
* Safe to call again, which does nothing. If a logger is already
|
|
713
|
+
* installed, it is kept, and so is its level.
|
|
714
|
+
*/
|
|
379
715
|
export function start() {
|
|
380
716
|
wasm.start();
|
|
381
717
|
}
|
|
382
|
-
|
|
718
|
+
|
|
719
|
+
/**
|
|
720
|
+
* Removes the connector registered under `name` from the
|
|
721
|
+
* process-wide connector registry, returning whether a connector was
|
|
722
|
+
* removed.
|
|
723
|
+
*
|
|
724
|
+
* Symmetric with `registerConnector` and meant for a connector that
|
|
725
|
+
* was registered but never attached to an engine. A connector
|
|
726
|
+
* attached to a running engine should instead be removed with the
|
|
727
|
+
* `removeConnector` engine command, which detaches and stops it before
|
|
728
|
+
* unregistering — raw unregistration leaves the engine tracking a
|
|
729
|
+
* stale name (the engine copes: detaching it later warns that the
|
|
730
|
+
* connector was already unregistered externally).
|
|
731
|
+
* @param {string} name
|
|
732
|
+
* @returns {boolean}
|
|
733
|
+
*/
|
|
734
|
+
export function unregisterConnector(name) {
|
|
735
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
736
|
+
const len0 = WASM_VECTOR_LEN;
|
|
737
|
+
const ret = wasm.unregisterConnector(ptr0, len0);
|
|
738
|
+
return ret !== 0;
|
|
739
|
+
}
|
|
740
|
+
export function __wbg_Error_208446807d0d1e30(arg0, arg1) {
|
|
383
741
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
384
|
-
return
|
|
742
|
+
return ret;
|
|
743
|
+
}
|
|
744
|
+
export function __wbg_Number_ff192a72a0dcdf6d(arg0) {
|
|
745
|
+
const ret = Number(arg0);
|
|
746
|
+
return ret;
|
|
385
747
|
}
|
|
386
748
|
export function __wbg_String_8564e559799eccda(arg0, arg1) {
|
|
387
|
-
const ret = String(
|
|
749
|
+
const ret = String(arg1);
|
|
388
750
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
389
751
|
const len1 = WASM_VECTOR_LEN;
|
|
390
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
391
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
752
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
|
|
753
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
|
|
392
754
|
}
|
|
393
|
-
export function
|
|
394
|
-
const v =
|
|
755
|
+
export function __wbg___wbindgen_bigint_get_as_i64_11da4b52cd0aedef(arg0, arg1) {
|
|
756
|
+
const v = arg1;
|
|
395
757
|
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
396
|
-
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
397
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
758
|
+
getDataViewMemory0().setBigInt64((arg0 >>> 0) + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
759
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, !isLikeNone(ret), true);
|
|
398
760
|
}
|
|
399
|
-
export function
|
|
400
|
-
const v =
|
|
761
|
+
export function __wbg___wbindgen_boolean_get_4f1baf9a00be3c74(arg0) {
|
|
762
|
+
const v = arg0;
|
|
401
763
|
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
402
764
|
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
403
765
|
}
|
|
404
|
-
export function
|
|
405
|
-
const ret = debugString(
|
|
766
|
+
export function __wbg___wbindgen_debug_string_f249a2a76caa9a55(arg0, arg1) {
|
|
767
|
+
const ret = debugString(arg1);
|
|
406
768
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
407
769
|
const len1 = WASM_VECTOR_LEN;
|
|
408
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
409
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
770
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
|
|
771
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
|
|
772
|
+
}
|
|
773
|
+
export function __wbg___wbindgen_in_3f58a9d3b3a7eed2(arg0, arg1) {
|
|
774
|
+
const ret = arg0 in arg1;
|
|
775
|
+
return ret;
|
|
410
776
|
}
|
|
411
|
-
export function
|
|
412
|
-
const ret =
|
|
777
|
+
export function __wbg___wbindgen_is_bigint_5fa10641e039d3ef(arg0) {
|
|
778
|
+
const ret = typeof(arg0) === 'bigint';
|
|
413
779
|
return ret;
|
|
414
780
|
}
|
|
415
|
-
export function
|
|
416
|
-
const ret = typeof(
|
|
781
|
+
export function __wbg___wbindgen_is_function_741ff2bb612836f5(arg0) {
|
|
782
|
+
const ret = typeof(arg0) === 'function';
|
|
417
783
|
return ret;
|
|
418
784
|
}
|
|
419
|
-
export function
|
|
420
|
-
const ret =
|
|
785
|
+
export function __wbg___wbindgen_is_null_c22311b1cc228e3a(arg0) {
|
|
786
|
+
const ret = arg0 === null;
|
|
421
787
|
return ret;
|
|
422
788
|
}
|
|
423
|
-
export function
|
|
424
|
-
const val =
|
|
789
|
+
export function __wbg___wbindgen_is_object_8b968c3ab8e96595(arg0) {
|
|
790
|
+
const val = arg0;
|
|
425
791
|
const ret = typeof(val) === 'object' && val !== null;
|
|
426
792
|
return ret;
|
|
427
793
|
}
|
|
428
|
-
export function
|
|
429
|
-
const ret = typeof(
|
|
794
|
+
export function __wbg___wbindgen_is_string_fc456fee5d3317de(arg0) {
|
|
795
|
+
const ret = typeof(arg0) === 'string';
|
|
430
796
|
return ret;
|
|
431
797
|
}
|
|
432
|
-
export function
|
|
433
|
-
const ret =
|
|
798
|
+
export function __wbg___wbindgen_is_undefined_be5b34249ff1fc15(arg0) {
|
|
799
|
+
const ret = arg0 === undefined;
|
|
434
800
|
return ret;
|
|
435
801
|
}
|
|
436
|
-
export function
|
|
437
|
-
const ret =
|
|
802
|
+
export function __wbg___wbindgen_jsval_eq_38d7bfbe4cc84039(arg0, arg1) {
|
|
803
|
+
const ret = arg0 === arg1;
|
|
438
804
|
return ret;
|
|
439
805
|
}
|
|
440
|
-
export function
|
|
441
|
-
const ret =
|
|
806
|
+
export function __wbg___wbindgen_jsval_loose_eq_b2f214e2e4b30e36(arg0, arg1) {
|
|
807
|
+
const ret = arg0 == arg1;
|
|
442
808
|
return ret;
|
|
443
809
|
}
|
|
444
|
-
export function
|
|
445
|
-
const obj =
|
|
810
|
+
export function __wbg___wbindgen_number_get_934b640d0889af78(arg0, arg1) {
|
|
811
|
+
const obj = arg1;
|
|
446
812
|
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
447
|
-
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
448
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
813
|
+
getDataViewMemory0().setFloat64((arg0 >>> 0) + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
814
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, !isLikeNone(ret), true);
|
|
449
815
|
}
|
|
450
|
-
export function
|
|
451
|
-
const obj =
|
|
816
|
+
export function __wbg___wbindgen_string_get_7ce8eee7fd327545(arg0, arg1) {
|
|
817
|
+
const obj = arg1;
|
|
452
818
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
453
819
|
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
454
820
|
var len1 = WASM_VECTOR_LEN;
|
|
455
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
456
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
821
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
|
|
822
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
|
|
457
823
|
}
|
|
458
|
-
export function
|
|
824
|
+
export function __wbg___wbindgen_throw_4c88d8bf264fd984(arg0, arg1) {
|
|
459
825
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
460
826
|
}
|
|
461
|
-
export function
|
|
462
|
-
|
|
827
|
+
export function __wbg___wbindgen_typeof_ee4990276e02f607(arg0) {
|
|
828
|
+
const ret = typeof arg0;
|
|
829
|
+
return ret;
|
|
830
|
+
}
|
|
831
|
+
export function __wbg__wbg_cb_unref_09736879a3f67559(arg0) {
|
|
832
|
+
arg0._wbg_cb_unref();
|
|
463
833
|
}
|
|
464
|
-
export function
|
|
465
|
-
const ret =
|
|
466
|
-
return
|
|
834
|
+
export function __wbg_call_40b008ba32f73991() { return handleError(function (arg0, arg1) {
|
|
835
|
+
const ret = arg0.call(arg1);
|
|
836
|
+
return ret;
|
|
837
|
+
}, arguments); }
|
|
838
|
+
export function __wbg_call_a410eb4b59ed5965() { return handleError(function (arg0, arg1, arg2) {
|
|
839
|
+
const ret = arg0.call(arg1, arg2);
|
|
840
|
+
return ret;
|
|
467
841
|
}, arguments); }
|
|
468
|
-
export function
|
|
469
|
-
const ret =
|
|
470
|
-
return
|
|
842
|
+
export function __wbg_call_fc92fee6137d452d() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
843
|
+
const ret = arg0.call(arg1, arg2, arg3);
|
|
844
|
+
return ret;
|
|
471
845
|
}, arguments); }
|
|
472
|
-
export function
|
|
473
|
-
const ret =
|
|
846
|
+
export function __wbg_done_57e08d0be6e30c02(arg0) {
|
|
847
|
+
const ret = arg0.done;
|
|
474
848
|
return ret;
|
|
475
849
|
}
|
|
476
|
-
export function
|
|
477
|
-
const ret = Object.entries(
|
|
478
|
-
return
|
|
850
|
+
export function __wbg_entries_7bb1459bd9b5c2b9(arg0) {
|
|
851
|
+
const ret = Object.entries(arg0);
|
|
852
|
+
return ret;
|
|
479
853
|
}
|
|
480
|
-
export function
|
|
854
|
+
export function __wbg_error_757e9472f8410341(arg0, arg1) {
|
|
481
855
|
let deferred0_0;
|
|
482
856
|
let deferred0_1;
|
|
483
857
|
try {
|
|
@@ -485,278 +859,366 @@ export function __wbg_error_a6fa202b58aa1cd3(arg0, arg1) {
|
|
|
485
859
|
deferred0_1 = arg1;
|
|
486
860
|
console.error(getStringFromWasm0(arg0, arg1));
|
|
487
861
|
} finally {
|
|
488
|
-
wasm.
|
|
862
|
+
wasm.__wbindgen_export3(deferred0_0, deferred0_1, 1);
|
|
489
863
|
}
|
|
490
864
|
}
|
|
491
|
-
export function
|
|
865
|
+
export function __wbg_error_d0b35507fd5ba906(arg0, arg1) {
|
|
492
866
|
console.error(getStringFromWasm0(arg0, arg1));
|
|
493
867
|
}
|
|
494
|
-
export function
|
|
868
|
+
export function __wbg_forEach_d33df67d27c9bd85(arg0, arg1, arg2) {
|
|
869
|
+
try {
|
|
870
|
+
var state0 = {a: arg1, b: arg2};
|
|
871
|
+
var cb0 = (arg0, arg1) => {
|
|
872
|
+
const a = state0.a;
|
|
873
|
+
state0.a = 0;
|
|
874
|
+
try {
|
|
875
|
+
return __wasm_bindgen_func_elem_12718(a, state0.b, arg0, arg1);
|
|
876
|
+
} finally {
|
|
877
|
+
state0.a = a;
|
|
878
|
+
}
|
|
879
|
+
};
|
|
880
|
+
arg0.forEach(cb0);
|
|
881
|
+
} finally {
|
|
882
|
+
state0.a = 0;
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
export function __wbg_getPrototypeOf_8fbf04523e13de29() { return handleError(function (arg0) {
|
|
886
|
+
const ret = Reflect.getPrototypeOf(arg0);
|
|
887
|
+
return ret;
|
|
888
|
+
}, arguments); }
|
|
889
|
+
export function __wbg_getRandomValues_8b6f1f663e6f188d() { return handleError(function (arg0, arg1) {
|
|
495
890
|
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
496
891
|
}, arguments); }
|
|
497
|
-
export function
|
|
892
|
+
export function __wbg_getRandomValues_abdecda20e6541f1() { return handleError(function (arg0, arg1) {
|
|
498
893
|
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
499
894
|
}, arguments); }
|
|
500
|
-
export function
|
|
501
|
-
const ret = Reflect.get(
|
|
502
|
-
return
|
|
895
|
+
export function __wbg_get_2080c49015e35254() { return handleError(function (arg0, arg1) {
|
|
896
|
+
const ret = Reflect.get(arg0, arg1);
|
|
897
|
+
return ret;
|
|
898
|
+
}, arguments); }
|
|
899
|
+
export function __wbg_get_635eea311fa1a291() { return handleError(function (arg0, arg1) {
|
|
900
|
+
const ret = Reflect.get(arg0, arg1);
|
|
901
|
+
return ret;
|
|
503
902
|
}, arguments); }
|
|
504
|
-
export function
|
|
505
|
-
const ret =
|
|
506
|
-
return
|
|
903
|
+
export function __wbg_get_d7176cfb76d71114(arg0, arg1) {
|
|
904
|
+
const ret = arg0[arg1 >>> 0];
|
|
905
|
+
return ret;
|
|
906
|
+
}
|
|
907
|
+
export function __wbg_get_unchecked_e6325ad374eff861(arg0, arg1) {
|
|
908
|
+
const ret = arg0[arg1 >>> 0];
|
|
909
|
+
return ret;
|
|
507
910
|
}
|
|
508
|
-
export function
|
|
509
|
-
const ret =
|
|
510
|
-
return
|
|
911
|
+
export function __wbg_get_with_ref_key_fc601247060b7204(arg0, arg1) {
|
|
912
|
+
const ret = arg0[arg1];
|
|
913
|
+
return ret;
|
|
511
914
|
}
|
|
512
|
-
export function
|
|
513
|
-
|
|
514
|
-
|
|
915
|
+
export function __wbg_instanceof_ArrayBuffer_12cdaa4161423e6b(arg0) {
|
|
916
|
+
let result;
|
|
917
|
+
try {
|
|
918
|
+
result = arg0 instanceof ArrayBuffer;
|
|
919
|
+
} catch (_) {
|
|
920
|
+
result = false;
|
|
921
|
+
}
|
|
922
|
+
const ret = result;
|
|
923
|
+
return ret;
|
|
515
924
|
}
|
|
516
|
-
export function
|
|
925
|
+
export function __wbg_instanceof_Error_74e3cca0c4a69161(arg0) {
|
|
517
926
|
let result;
|
|
518
927
|
try {
|
|
519
|
-
result =
|
|
928
|
+
result = arg0 instanceof Error;
|
|
520
929
|
} catch (_) {
|
|
521
930
|
result = false;
|
|
522
931
|
}
|
|
523
932
|
const ret = result;
|
|
524
933
|
return ret;
|
|
525
934
|
}
|
|
526
|
-
export function
|
|
935
|
+
export function __wbg_instanceof_Map_0b4fc8b62e73f163(arg0) {
|
|
527
936
|
let result;
|
|
528
937
|
try {
|
|
529
|
-
result =
|
|
938
|
+
result = arg0 instanceof Map;
|
|
530
939
|
} catch (_) {
|
|
531
940
|
result = false;
|
|
532
941
|
}
|
|
533
942
|
const ret = result;
|
|
534
943
|
return ret;
|
|
535
944
|
}
|
|
536
|
-
export function
|
|
945
|
+
export function __wbg_instanceof_Uint8Array_d7aeb0dcb3108fea(arg0) {
|
|
537
946
|
let result;
|
|
538
947
|
try {
|
|
539
|
-
result =
|
|
948
|
+
result = arg0 instanceof Uint8Array;
|
|
540
949
|
} catch (_) {
|
|
541
950
|
result = false;
|
|
542
951
|
}
|
|
543
952
|
const ret = result;
|
|
544
953
|
return ret;
|
|
545
954
|
}
|
|
546
|
-
export function
|
|
547
|
-
const ret = Array.isArray(
|
|
955
|
+
export function __wbg_isArray_181eee9e42397260(arg0) {
|
|
956
|
+
const ret = Array.isArray(arg0);
|
|
548
957
|
return ret;
|
|
549
958
|
}
|
|
550
|
-
export function
|
|
551
|
-
const ret = Array.isArray(
|
|
959
|
+
export function __wbg_isArray_bcf1376d0d732d08(arg0) {
|
|
960
|
+
const ret = Array.isArray(arg0);
|
|
552
961
|
return ret;
|
|
553
962
|
}
|
|
554
|
-
export function
|
|
555
|
-
const ret = Number.isSafeInteger(
|
|
963
|
+
export function __wbg_isSafeInteger_1a35ba4d31e71d38(arg0) {
|
|
964
|
+
const ret = Number.isSafeInteger(arg0);
|
|
556
965
|
return ret;
|
|
557
966
|
}
|
|
558
|
-
export function
|
|
967
|
+
export function __wbg_iterator_e4c5e8f68ada7b58() {
|
|
559
968
|
const ret = Symbol.iterator;
|
|
560
|
-
return
|
|
969
|
+
return ret;
|
|
561
970
|
}
|
|
562
|
-
export function
|
|
563
|
-
const ret =
|
|
971
|
+
export function __wbg_length_186163212ffe79c3(arg0) {
|
|
972
|
+
const ret = arg0.length;
|
|
564
973
|
return ret;
|
|
565
974
|
}
|
|
566
|
-
export function
|
|
567
|
-
const ret =
|
|
975
|
+
export function __wbg_length_b03a0fabb109b1e9(arg0) {
|
|
976
|
+
const ret = arg0.length;
|
|
568
977
|
return ret;
|
|
569
978
|
}
|
|
570
|
-
export function
|
|
979
|
+
export function __wbg_log_59c27e5e5e0bbe78(arg0, arg1) {
|
|
571
980
|
console.log(getStringFromWasm0(arg0, arg1));
|
|
572
981
|
}
|
|
573
|
-
export function
|
|
574
|
-
const ret =
|
|
575
|
-
return
|
|
576
|
-
}
|
|
577
|
-
export function __wbg_new_070df68d66325372() {
|
|
578
|
-
const ret = new Map();
|
|
579
|
-
return addHeapObject(ret);
|
|
982
|
+
export function __wbg_name_fd11f69c917c5670(arg0) {
|
|
983
|
+
const ret = arg0.name;
|
|
984
|
+
return ret;
|
|
580
985
|
}
|
|
581
|
-
export function
|
|
582
|
-
const ret = new
|
|
583
|
-
return
|
|
986
|
+
export function __wbg_new_13de428334042d26(arg0) {
|
|
987
|
+
const ret = new Uint8Array(arg0);
|
|
988
|
+
return ret;
|
|
584
989
|
}
|
|
585
|
-
export function
|
|
990
|
+
export function __wbg_new_37eb45aaf5eeb820() {
|
|
586
991
|
const ret = new Array();
|
|
587
|
-
return
|
|
992
|
+
return ret;
|
|
588
993
|
}
|
|
589
|
-
export function
|
|
590
|
-
const ret = new
|
|
591
|
-
return
|
|
994
|
+
export function __wbg_new_7075786089b89c5e() {
|
|
995
|
+
const ret = new Map();
|
|
996
|
+
return ret;
|
|
997
|
+
}
|
|
998
|
+
export function __wbg_new_787b9fb330d55d78(arg0, arg1) {
|
|
999
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
1000
|
+
return ret;
|
|
592
1001
|
}
|
|
593
|
-
export function
|
|
1002
|
+
export function __wbg_new_ba40181b3f24ac80(arg0, arg1) {
|
|
594
1003
|
try {
|
|
595
1004
|
var state0 = {a: arg0, b: arg1};
|
|
596
1005
|
var cb0 = (arg0, arg1) => {
|
|
597
1006
|
const a = state0.a;
|
|
598
1007
|
state0.a = 0;
|
|
599
1008
|
try {
|
|
600
|
-
return
|
|
1009
|
+
return __wasm_bindgen_func_elem_12713(a, state0.b, arg0, arg1);
|
|
601
1010
|
} finally {
|
|
602
1011
|
state0.a = a;
|
|
603
1012
|
}
|
|
604
1013
|
};
|
|
605
1014
|
const ret = new Promise(cb0);
|
|
606
|
-
return
|
|
1015
|
+
return ret;
|
|
607
1016
|
} finally {
|
|
608
1017
|
state0.a = 0;
|
|
609
1018
|
}
|
|
610
1019
|
}
|
|
611
|
-
export function
|
|
1020
|
+
export function __wbg_new_bb74001155cb8ca8() {
|
|
1021
|
+
const ret = new Error();
|
|
1022
|
+
return ret;
|
|
1023
|
+
}
|
|
1024
|
+
export function __wbg_new_cd4348290afae586() {
|
|
1025
|
+
const ret = new Object();
|
|
1026
|
+
return ret;
|
|
1027
|
+
}
|
|
1028
|
+
export function __wbg_new_typed_e09da9dae6ee5935(arg0, arg1) {
|
|
612
1029
|
try {
|
|
613
1030
|
var state0 = {a: arg0, b: arg1};
|
|
614
1031
|
var cb0 = (arg0, arg1) => {
|
|
615
1032
|
const a = state0.a;
|
|
616
1033
|
state0.a = 0;
|
|
617
1034
|
try {
|
|
618
|
-
return
|
|
1035
|
+
return __wasm_bindgen_func_elem_12713(a, state0.b, arg0, arg1);
|
|
619
1036
|
} finally {
|
|
620
1037
|
state0.a = a;
|
|
621
1038
|
}
|
|
622
1039
|
};
|
|
623
1040
|
const ret = new Promise(cb0);
|
|
624
|
-
return
|
|
1041
|
+
return ret;
|
|
625
1042
|
} finally {
|
|
626
1043
|
state0.a = 0;
|
|
627
1044
|
}
|
|
628
1045
|
}
|
|
629
|
-
export function
|
|
630
|
-
const ret =
|
|
631
|
-
return
|
|
1046
|
+
export function __wbg_next_178c1651c11432b3(arg0) {
|
|
1047
|
+
const ret = arg0.next;
|
|
1048
|
+
return ret;
|
|
632
1049
|
}
|
|
633
|
-
export function
|
|
634
|
-
const ret =
|
|
635
|
-
return
|
|
1050
|
+
export function __wbg_next_af5ac6a08bb0a717() { return handleError(function (arg0) {
|
|
1051
|
+
const ret = arg0.next();
|
|
1052
|
+
return ret;
|
|
636
1053
|
}, arguments); }
|
|
637
|
-
export function
|
|
1054
|
+
export function __wbg_now_463ac581d2fc7ea3() {
|
|
638
1055
|
const ret = Date.now();
|
|
639
1056
|
return ret;
|
|
640
1057
|
}
|
|
641
|
-
export function
|
|
642
|
-
|
|
1058
|
+
export function __wbg_now_7da6c518c2e71886() {
|
|
1059
|
+
const ret = performance.now();
|
|
1060
|
+
return ret;
|
|
1061
|
+
}
|
|
1062
|
+
export function __wbg_prototypesetcall_13162965d1fe7aa3(arg0, arg1, arg2) {
|
|
1063
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
1064
|
+
}
|
|
1065
|
+
export function __wbg_push_c9f4893fc209f768(arg0, arg1) {
|
|
1066
|
+
const ret = arg0.push(arg1);
|
|
1067
|
+
return ret;
|
|
643
1068
|
}
|
|
644
|
-
export function
|
|
645
|
-
const ret =
|
|
1069
|
+
export function __wbg_queueMicrotask_1e8503a8a690f0a3(arg0) {
|
|
1070
|
+
const ret = arg0.queueMicrotask;
|
|
646
1071
|
return ret;
|
|
647
1072
|
}
|
|
648
|
-
export function
|
|
649
|
-
|
|
650
|
-
return addHeapObject(ret);
|
|
1073
|
+
export function __wbg_queueMicrotask_4a1a4d8dd332373b(arg0) {
|
|
1074
|
+
queueMicrotask(arg0);
|
|
651
1075
|
}
|
|
652
|
-
export function
|
|
653
|
-
|
|
1076
|
+
export function __wbg_resolve_dbf78ab4942478b0(arg0) {
|
|
1077
|
+
const ret = Promise.resolve(arg0);
|
|
1078
|
+
return ret;
|
|
654
1079
|
}
|
|
655
|
-
export function
|
|
656
|
-
|
|
657
|
-
return addHeapObject(ret);
|
|
1080
|
+
export function __wbg_setTimeout_714243ec9a3f088a(arg0, arg1) {
|
|
1081
|
+
setTimeout(arg0, arg1);
|
|
658
1082
|
}
|
|
659
|
-
export function
|
|
660
|
-
|
|
1083
|
+
export function __wbg_set_2793479888329cb6() { return handleError(function (arg0, arg1, arg2) {
|
|
1084
|
+
const ret = Reflect.set(arg0, arg1, arg2);
|
|
1085
|
+
return ret;
|
|
1086
|
+
}, arguments); }
|
|
1087
|
+
export function __wbg_set_8282f7e0d2d01336(arg0, arg1, arg2) {
|
|
1088
|
+
const ret = arg0.set(arg1, arg2);
|
|
1089
|
+
return ret;
|
|
661
1090
|
}
|
|
662
|
-
export function
|
|
663
|
-
|
|
1091
|
+
export function __wbg_set_d2d33b52458e984a(arg0, arg1, arg2) {
|
|
1092
|
+
arg0[arg1 >>> 0] = arg2;
|
|
664
1093
|
}
|
|
665
|
-
export function
|
|
666
|
-
|
|
1094
|
+
export function __wbg_set_e4b9a833d288759a(arg0, arg1, arg2) {
|
|
1095
|
+
arg0[arg1] = arg2;
|
|
667
1096
|
}
|
|
668
|
-
export function
|
|
669
|
-
|
|
670
|
-
return addHeapObject(ret);
|
|
1097
|
+
export function __wbg_set_name_822e3903f3184979(arg0, arg1, arg2) {
|
|
1098
|
+
arg0.name = getStringFromWasm0(arg1, arg2);
|
|
671
1099
|
}
|
|
672
|
-
export function
|
|
673
|
-
const ret =
|
|
1100
|
+
export function __wbg_stack_575c4e0918581b9c(arg0, arg1) {
|
|
1101
|
+
const ret = arg1.stack;
|
|
674
1102
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
675
1103
|
const len1 = WASM_VECTOR_LEN;
|
|
676
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
677
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1104
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
|
|
1105
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
|
|
1106
|
+
}
|
|
1107
|
+
export function __wbg_static_accessor_GLOBAL_THIS_003ee833af9699fc() {
|
|
1108
|
+
const ret = typeof globalThis === 'undefined' ? undefined : globalThis;
|
|
1109
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
678
1110
|
}
|
|
679
|
-
export function
|
|
680
|
-
const ret = typeof
|
|
681
|
-
return isLikeNone(ret) ? 0 :
|
|
1111
|
+
export function __wbg_static_accessor_GLOBAL_e4293fb22cbe77da() {
|
|
1112
|
+
const ret = typeof global === 'undefined' ? undefined : global;
|
|
1113
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
682
1114
|
}
|
|
683
|
-
export function
|
|
684
|
-
const ret = typeof
|
|
685
|
-
return isLikeNone(ret) ? 0 :
|
|
1115
|
+
export function __wbg_static_accessor_SELF_53bb20457401453d() {
|
|
1116
|
+
const ret = typeof self === 'undefined' ? undefined : self;
|
|
1117
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
686
1118
|
}
|
|
687
|
-
export function
|
|
688
|
-
const ret = typeof
|
|
689
|
-
return isLikeNone(ret) ? 0 :
|
|
1119
|
+
export function __wbg_static_accessor_WINDOW_b5e0810bfecb7feb() {
|
|
1120
|
+
const ret = typeof window === 'undefined' ? undefined : window;
|
|
1121
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1122
|
+
}
|
|
1123
|
+
export function __wbg_then_656f253a5dd7d8ea(arg0, arg1, arg2) {
|
|
1124
|
+
const ret = arg0.then(arg1, arg2);
|
|
1125
|
+
return ret;
|
|
690
1126
|
}
|
|
691
|
-
export function
|
|
692
|
-
const ret =
|
|
693
|
-
return
|
|
1127
|
+
export function __wbg_then_e3f7f2d365708be8(arg0, arg1) {
|
|
1128
|
+
const ret = arg0.then(arg1);
|
|
1129
|
+
return ret;
|
|
694
1130
|
}
|
|
695
|
-
export function
|
|
696
|
-
const ret =
|
|
697
|
-
return
|
|
1131
|
+
export function __wbg_toString_4d043badaf1f4f69(arg0) {
|
|
1132
|
+
const ret = arg0.toString();
|
|
1133
|
+
return ret;
|
|
698
1134
|
}
|
|
699
|
-
export function
|
|
700
|
-
const ret =
|
|
701
|
-
return
|
|
1135
|
+
export function __wbg_value_e0f328965e184931(arg0) {
|
|
1136
|
+
const ret = arg0.value;
|
|
1137
|
+
return ret;
|
|
702
1138
|
}
|
|
703
|
-
export function
|
|
704
|
-
const ret =
|
|
705
|
-
return
|
|
1139
|
+
export function __wbg_values_01b79ec198898dfb(arg0) {
|
|
1140
|
+
const ret = Object.values(arg0);
|
|
1141
|
+
return ret;
|
|
706
1142
|
}
|
|
707
|
-
export function
|
|
1143
|
+
export function __wbg_warn_a9670c930d875050(arg0, arg1) {
|
|
708
1144
|
console.warn(getStringFromWasm0(arg0, arg1));
|
|
709
1145
|
}
|
|
710
|
-
export function
|
|
711
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
712
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
713
|
-
return
|
|
1146
|
+
export function __wbindgen_generic_0000000000000001(arg0, arg1) {
|
|
1147
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref, Externref], shim_idx: 2452, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1148
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_12718);
|
|
1149
|
+
return ret;
|
|
1150
|
+
}
|
|
1151
|
+
export function __wbindgen_generic_0000000000000002(arg0, arg1) {
|
|
1152
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 2446, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
1153
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_12711);
|
|
1154
|
+
return ret;
|
|
1155
|
+
}
|
|
1156
|
+
export function __wbindgen_generic_0000000000000003(arg0, arg1) {
|
|
1157
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 625, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1158
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_9831);
|
|
1159
|
+
return ret;
|
|
714
1160
|
}
|
|
715
|
-
export function
|
|
1161
|
+
export function __wbindgen_generic_0000000000000004(arg0) {
|
|
716
1162
|
// Cast intrinsic for `F64 -> Externref`.
|
|
717
1163
|
const ret = arg0;
|
|
718
|
-
return
|
|
1164
|
+
return ret;
|
|
719
1165
|
}
|
|
720
|
-
export function
|
|
1166
|
+
export function __wbindgen_generic_0000000000000005(arg0) {
|
|
721
1167
|
// Cast intrinsic for `I64 -> Externref`.
|
|
722
1168
|
const ret = arg0;
|
|
723
|
-
return
|
|
1169
|
+
return ret;
|
|
724
1170
|
}
|
|
725
|
-
export function
|
|
1171
|
+
export function __wbindgen_generic_0000000000000006(arg0, arg1) {
|
|
726
1172
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
727
1173
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
728
|
-
return
|
|
1174
|
+
return ret;
|
|
729
1175
|
}
|
|
730
|
-
export function
|
|
1176
|
+
export function __wbindgen_generic_0000000000000007(arg0) {
|
|
731
1177
|
// Cast intrinsic for `U64 -> Externref`.
|
|
732
1178
|
const ret = BigInt.asUintN(64, arg0);
|
|
733
|
-
return
|
|
1179
|
+
return ret;
|
|
1180
|
+
}
|
|
1181
|
+
export function __wbindgen_generic_0000000000000008(arg0, arg1) {
|
|
1182
|
+
var v0 = getArrayJsValueFromWasm0(arg0, arg1);
|
|
1183
|
+
wasm.__wbindgen_export3(arg0, arg1 * 4, 4);
|
|
1184
|
+
// Cast intrinsic for `Vector(NamedExternref("string")) -> Externref`.
|
|
1185
|
+
const ret = v0;
|
|
1186
|
+
return ret;
|
|
734
1187
|
}
|
|
735
|
-
export function
|
|
736
|
-
const
|
|
737
|
-
|
|
1188
|
+
export function __wbindgen_init_externref_table() {
|
|
1189
|
+
const table = wasm.__wbindgen_externrefs;
|
|
1190
|
+
table.set(0, undefined);
|
|
1191
|
+
table.set(1024, undefined);
|
|
1192
|
+
table.set(1025, null);
|
|
1193
|
+
table.set(1026, true);
|
|
1194
|
+
table.set(1027, false);
|
|
738
1195
|
}
|
|
739
|
-
|
|
740
|
-
|
|
1196
|
+
function __wasm_bindgen_func_elem_9831(arg0, arg1, arg2) {
|
|
1197
|
+
wasm.__wasm_bindgen_func_elem_9831(arg0, arg1, arg2);
|
|
741
1198
|
}
|
|
742
|
-
|
|
1199
|
+
|
|
1200
|
+
function __wasm_bindgen_func_elem_12718(arg0, arg1, arg2, arg3) {
|
|
1201
|
+
wasm.__wasm_bindgen_func_elem_12718(arg0, arg1, arg2, arg3);
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
function __wasm_bindgen_func_elem_12713(arg0, arg1, arg2, arg3) {
|
|
1205
|
+
wasm.__wasm_bindgen_func_elem_12713(arg0, arg1, arg2, arg3);
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
function __wasm_bindgen_func_elem_12711(arg0, arg1, arg2) {
|
|
743
1209
|
try {
|
|
744
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
745
|
-
wasm.
|
|
1210
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
1211
|
+
wasm.__wasm_bindgen_func_elem_12711(retptr, arg0, arg1, arg2);
|
|
746
1212
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
747
1213
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
748
1214
|
if (r1) {
|
|
749
|
-
throw
|
|
1215
|
+
throw takeFromExternrefTable0(r0);
|
|
750
1216
|
}
|
|
751
1217
|
} finally {
|
|
752
1218
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
753
1219
|
}
|
|
754
1220
|
}
|
|
755
1221
|
|
|
756
|
-
function __wasm_bindgen_func_elem_10966(arg0, arg1, arg2, arg3) {
|
|
757
|
-
wasm.__wasm_bindgen_func_elem_10966(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
758
|
-
}
|
|
759
|
-
|
|
760
1222
|
const BlocksEngineFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
761
1223
|
? { register: () => {}, unregister: () => {} }
|
|
762
1224
|
: new FinalizationRegistry(ptr => wasm.__wbg_blocksengine_free(ptr, 1));
|
|
@@ -764,88 +1226,83 @@ const EngineCommandFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
764
1226
|
? { register: () => {}, unregister: () => {} }
|
|
765
1227
|
: new FinalizationRegistry(ptr => wasm.__wbg_enginecommand_free(ptr, 1));
|
|
766
1228
|
|
|
767
|
-
function
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
heap_next = heap[idx];
|
|
771
|
-
|
|
772
|
-
heap[idx] = obj;
|
|
1229
|
+
function addToExternrefTable0(obj) {
|
|
1230
|
+
const idx = wasm.__wbindgen_export5();
|
|
1231
|
+
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
773
1232
|
return idx;
|
|
774
1233
|
}
|
|
775
1234
|
|
|
776
1235
|
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
777
1236
|
? { register: () => {}, unregister: () => {} }
|
|
778
|
-
: new FinalizationRegistry(state => wasm.
|
|
1237
|
+
: new FinalizationRegistry(state => wasm.__wbindgen_export6(state.a, state.b));
|
|
779
1238
|
|
|
780
1239
|
function debugString(val) {
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
return 'Object(' + JSON.stringify(val) + ')';
|
|
833
|
-
} catch (_) {
|
|
834
|
-
return 'Object';
|
|
1240
|
+
switch (typeof val) {
|
|
1241
|
+
// primitive types
|
|
1242
|
+
case 'number':
|
|
1243
|
+
case 'boolean':
|
|
1244
|
+
case 'undefined':
|
|
1245
|
+
return `${val}`;
|
|
1246
|
+
case 'string':
|
|
1247
|
+
return JSON.stringify(val);
|
|
1248
|
+
case 'bigint':
|
|
1249
|
+
return `${val}n`;
|
|
1250
|
+
case 'symbol':
|
|
1251
|
+
return val.description !== undefined
|
|
1252
|
+
? `Symbol(${val.description})`
|
|
1253
|
+
: 'Symbol';
|
|
1254
|
+
case 'function':
|
|
1255
|
+
return typeof val.name === 'string' && val.name !== ''
|
|
1256
|
+
? `Function(${val.name})`
|
|
1257
|
+
: 'Function';
|
|
1258
|
+
case 'object': {
|
|
1259
|
+
if (val === null) {
|
|
1260
|
+
return 'null';
|
|
1261
|
+
}
|
|
1262
|
+
// objects
|
|
1263
|
+
if (Array.isArray(val)) {
|
|
1264
|
+
return '[' + Array.from(val, debugString).join(', ') + ']';
|
|
1265
|
+
}
|
|
1266
|
+
// errors
|
|
1267
|
+
if (val instanceof Error) {
|
|
1268
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
const toStringOutput = toString.call(val);
|
|
1272
|
+
// Test for built-in
|
|
1273
|
+
const className = /\[object ([^\]]+)\]/.exec(toStringOutput)?.[1];
|
|
1274
|
+
|
|
1275
|
+
// Failed to match the standard '[object ClassName]'
|
|
1276
|
+
if (className === undefined) {
|
|
1277
|
+
return toStringOutput;
|
|
1278
|
+
}
|
|
1279
|
+
if (className === 'Object') {
|
|
1280
|
+
// we're a user defined class or Object
|
|
1281
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
1282
|
+
// easier than looping through ownProperties of `val`.
|
|
1283
|
+
try {
|
|
1284
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
1285
|
+
} catch (_) {
|
|
1286
|
+
return 'Object';
|
|
1287
|
+
}
|
|
1288
|
+
}
|
|
1289
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
1290
|
+
return className;
|
|
835
1291
|
}
|
|
1292
|
+
// Per MDN: 'This list of values is exhaustive.'
|
|
1293
|
+
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof#description
|
|
836
1294
|
}
|
|
837
|
-
// errors
|
|
838
|
-
if (val instanceof Error) {
|
|
839
|
-
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
840
|
-
}
|
|
841
|
-
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
842
|
-
return className;
|
|
843
1295
|
}
|
|
844
1296
|
|
|
845
|
-
function
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
1297
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
1298
|
+
ptr = ptr >>> 0;
|
|
1299
|
+
const mem = getDataViewMemory0();
|
|
1300
|
+
const result = [];
|
|
1301
|
+
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
1302
|
+
result.push(wasm.__wbindgen_externrefs.get(mem.getUint32(i, true)));
|
|
1303
|
+
}
|
|
1304
|
+
wasm.__wbindgen_export7(ptr, len);
|
|
1305
|
+
return result;
|
|
849
1306
|
}
|
|
850
1307
|
|
|
851
1308
|
function getArrayU8FromWasm0(ptr, len) {
|
|
@@ -862,7 +1319,8 @@ function getDataViewMemory0() {
|
|
|
862
1319
|
}
|
|
863
1320
|
|
|
864
1321
|
function getStringFromWasm0(ptr, len) {
|
|
865
|
-
|
|
1322
|
+
ptr = ptr >>> 0;
|
|
1323
|
+
return decodeText(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
866
1324
|
}
|
|
867
1325
|
|
|
868
1326
|
let cachedUint8ArrayMemory0 = null;
|
|
@@ -873,21 +1331,15 @@ function getUint8ArrayMemory0() {
|
|
|
873
1331
|
return cachedUint8ArrayMemory0;
|
|
874
1332
|
}
|
|
875
1333
|
|
|
876
|
-
function getObject(idx) { return heap[idx]; }
|
|
877
|
-
|
|
878
1334
|
function handleError(f, args) {
|
|
879
1335
|
try {
|
|
880
1336
|
return f.apply(this, args);
|
|
881
1337
|
} catch (e) {
|
|
882
|
-
|
|
1338
|
+
const idx = addToExternrefTable0(e);
|
|
1339
|
+
wasm.__wbindgen_export4(idx);
|
|
883
1340
|
}
|
|
884
1341
|
}
|
|
885
1342
|
|
|
886
|
-
let heap = new Array(1024).fill(undefined);
|
|
887
|
-
heap.push(undefined, null, true, false);
|
|
888
|
-
|
|
889
|
-
let heap_next = heap.length;
|
|
890
|
-
|
|
891
1343
|
function isLikeNone(x) {
|
|
892
1344
|
return x === undefined || x === null;
|
|
893
1345
|
}
|
|
@@ -911,7 +1363,7 @@ function makeMutClosure(arg0, arg1, f) {
|
|
|
911
1363
|
};
|
|
912
1364
|
real._wbg_cb_unref = () => {
|
|
913
1365
|
if (--state.cnt === 0) {
|
|
914
|
-
wasm.
|
|
1366
|
+
wasm.__wbindgen_export6(state.a, state.b);
|
|
915
1367
|
state.a = 0;
|
|
916
1368
|
CLOSURE_DTORS.unregister(state);
|
|
917
1369
|
}
|
|
@@ -922,9 +1374,9 @@ function makeMutClosure(arg0, arg1, f) {
|
|
|
922
1374
|
|
|
923
1375
|
function passArrayJsValueToWasm0(array, malloc) {
|
|
924
1376
|
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
925
|
-
const mem = getDataViewMemory0();
|
|
926
1377
|
for (let i = 0; i < array.length; i++) {
|
|
927
|
-
|
|
1378
|
+
const add = addToExternrefTable0(array[i]);
|
|
1379
|
+
getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
|
|
928
1380
|
}
|
|
929
1381
|
WASM_VECTOR_LEN = array.length;
|
|
930
1382
|
return ptr;
|
|
@@ -967,24 +1419,24 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
967
1419
|
return ptr;
|
|
968
1420
|
}
|
|
969
1421
|
|
|
970
|
-
function
|
|
971
|
-
const
|
|
972
|
-
|
|
973
|
-
return
|
|
1422
|
+
function takeFromExternrefTable0(idx) {
|
|
1423
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
1424
|
+
wasm.__wbindgen_export8(idx);
|
|
1425
|
+
return value;
|
|
974
1426
|
}
|
|
975
1427
|
|
|
976
|
-
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true
|
|
1428
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
|
|
977
1429
|
cachedTextDecoder.decode();
|
|
978
1430
|
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
979
1431
|
let numBytesDecoded = 0;
|
|
980
|
-
function decodeText(
|
|
981
|
-
numBytesDecoded +=
|
|
1432
|
+
function decodeText(bytes) {
|
|
1433
|
+
numBytesDecoded += bytes.length;
|
|
982
1434
|
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
983
|
-
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true
|
|
1435
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
|
|
984
1436
|
cachedTextDecoder.decode();
|
|
985
|
-
numBytesDecoded =
|
|
1437
|
+
numBytesDecoded = bytes.length;
|
|
986
1438
|
}
|
|
987
|
-
return cachedTextDecoder.decode(
|
|
1439
|
+
return cachedTextDecoder.decode(bytes);
|
|
988
1440
|
}
|
|
989
1441
|
|
|
990
1442
|
const cachedTextEncoder = new TextEncoder();
|