@benrogmans/lemma-engine 0.8.2 → 0.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1202 @@
1
+ /* @ts-self-types="./lemma.d.ts" */
2
+
3
+ export class Engine {
4
+ __destroy_into_raw() {
5
+ const ptr = this.__wbg_ptr;
6
+ this.__wbg_ptr = 0;
7
+ EngineFinalization.unregister(this);
8
+ return ptr;
9
+ }
10
+ free() {
11
+ const ptr = this.__destroy_into_raw();
12
+ wasm.__wbg_engine_free(ptr, 0);
13
+ }
14
+ /**
15
+ * Returns formatted source string on success; throws with error message on failure.
16
+ * @param {string} code
17
+ * @param {string | null} [attribute]
18
+ * @returns {any}
19
+ */
20
+ format(code, attribute) {
21
+ try {
22
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
23
+ const ptr0 = passStringToWasm0(code, wasm.__wbindgen_export, wasm.__wbindgen_export2);
24
+ const len0 = WASM_VECTOR_LEN;
25
+ var ptr1 = isLikeNone(attribute) ? 0 : passStringToWasm0(attribute, wasm.__wbindgen_export, wasm.__wbindgen_export2);
26
+ var len1 = WASM_VECTOR_LEN;
27
+ wasm.wasmengine_format(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
28
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
29
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
30
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
31
+ if (r2) {
32
+ throw takeObject(r1);
33
+ }
34
+ return takeObject(r0);
35
+ } finally {
36
+ wasm.__wbindgen_add_to_stack_pointer(16);
37
+ }
38
+ }
39
+ /**
40
+ * @param {string} _spec_name
41
+ * @param {string} _rule_name
42
+ * @param {string} _target_json
43
+ * @param {string} _provided_values_json
44
+ * @returns {any}
45
+ */
46
+ invert(_spec_name, _rule_name, _target_json, _provided_values_json) {
47
+ try {
48
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
49
+ const ptr0 = passStringToWasm0(_spec_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
50
+ const len0 = WASM_VECTOR_LEN;
51
+ const ptr1 = passStringToWasm0(_rule_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
52
+ const len1 = WASM_VECTOR_LEN;
53
+ const ptr2 = passStringToWasm0(_target_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
54
+ const len2 = WASM_VECTOR_LEN;
55
+ const ptr3 = passStringToWasm0(_provided_values_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
56
+ const len3 = WASM_VECTOR_LEN;
57
+ wasm.wasmengine_invert(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
58
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
59
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
60
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
61
+ if (r2) {
62
+ throw takeObject(r1);
63
+ }
64
+ return takeObject(r0);
65
+ } finally {
66
+ wasm.__wbindgen_add_to_stack_pointer(16);
67
+ }
68
+ }
69
+ /**
70
+ * Spec names from the engine (same order as [`Engine::list_specs`]).
71
+ * @returns {any}
72
+ */
73
+ list() {
74
+ try {
75
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
76
+ wasm.wasmengine_list(retptr, this.__wbg_ptr);
77
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
78
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
79
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
80
+ if (r2) {
81
+ throw takeObject(r1);
82
+ }
83
+ return takeObject(r0);
84
+ } finally {
85
+ wasm.__wbindgen_add_to_stack_pointer(16);
86
+ }
87
+ }
88
+ /**
89
+ * Load Lemma source. Resolves with `undefined` on success; rejects with an array of error strings.
90
+ * @param {string} code
91
+ * @param {string} attribute
92
+ * @returns {Promise<any>}
93
+ */
94
+ load(code, attribute) {
95
+ const ptr0 = passStringToWasm0(code, wasm.__wbindgen_export, wasm.__wbindgen_export2);
96
+ const len0 = WASM_VECTOR_LEN;
97
+ const ptr1 = passStringToWasm0(attribute, wasm.__wbindgen_export, wasm.__wbindgen_export2);
98
+ const len1 = WASM_VECTOR_LEN;
99
+ const ret = wasm.wasmengine_load(this.__wbg_ptr, ptr0, len0, ptr1, len1);
100
+ return takeObject(ret);
101
+ }
102
+ constructor() {
103
+ const ret = wasm.wasmengine_new();
104
+ this.__wbg_ptr = ret >>> 0;
105
+ EngineFinalization.register(this, this.__wbg_ptr, this);
106
+ return this;
107
+ }
108
+ /**
109
+ * Evaluate spec. Returns [`crate::evaluation::Response`] as a JS object. Throws on planning/runtime error.
110
+ * @param {string} spec
111
+ * @param {any} rule_names
112
+ * @param {any} fact_values
113
+ * @param {string | null} [effective]
114
+ * @returns {any}
115
+ */
116
+ run(spec, rule_names, fact_values, effective) {
117
+ try {
118
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
119
+ const ptr0 = passStringToWasm0(spec, wasm.__wbindgen_export, wasm.__wbindgen_export2);
120
+ const len0 = WASM_VECTOR_LEN;
121
+ var ptr1 = isLikeNone(effective) ? 0 : passStringToWasm0(effective, wasm.__wbindgen_export, wasm.__wbindgen_export2);
122
+ var len1 = WASM_VECTOR_LEN;
123
+ wasm.wasmengine_run(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(rule_names), addHeapObject(fact_values), ptr1, len1);
124
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
125
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
126
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
127
+ if (r2) {
128
+ throw takeObject(r1);
129
+ }
130
+ return takeObject(r0);
131
+ } finally {
132
+ wasm.__wbindgen_add_to_stack_pointer(16);
133
+ }
134
+ }
135
+ /**
136
+ * Planning schema for the spec ([`crate::planning::execution_plan::SpecSchema`]). Throws on error.
137
+ * @param {string} spec
138
+ * @param {string | null} [effective]
139
+ * @returns {any}
140
+ */
141
+ schema(spec, effective) {
142
+ try {
143
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
144
+ const ptr0 = passStringToWasm0(spec, wasm.__wbindgen_export, wasm.__wbindgen_export2);
145
+ const len0 = WASM_VECTOR_LEN;
146
+ var ptr1 = isLikeNone(effective) ? 0 : passStringToWasm0(effective, wasm.__wbindgen_export, wasm.__wbindgen_export2);
147
+ var len1 = WASM_VECTOR_LEN;
148
+ wasm.wasmengine_schema(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
149
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
150
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
151
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
152
+ if (r2) {
153
+ throw takeObject(r1);
154
+ }
155
+ return takeObject(r0);
156
+ } finally {
157
+ wasm.__wbindgen_add_to_stack_pointer(16);
158
+ }
159
+ }
160
+ }
161
+ if (Symbol.dispose) Engine.prototype[Symbol.dispose] = Engine.prototype.free;
162
+
163
+ export class IntoUnderlyingByteSource {
164
+ __destroy_into_raw() {
165
+ const ptr = this.__wbg_ptr;
166
+ this.__wbg_ptr = 0;
167
+ IntoUnderlyingByteSourceFinalization.unregister(this);
168
+ return ptr;
169
+ }
170
+ free() {
171
+ const ptr = this.__destroy_into_raw();
172
+ wasm.__wbg_intounderlyingbytesource_free(ptr, 0);
173
+ }
174
+ /**
175
+ * @returns {number}
176
+ */
177
+ get autoAllocateChunkSize() {
178
+ const ret = wasm.intounderlyingbytesource_autoAllocateChunkSize(this.__wbg_ptr);
179
+ return ret >>> 0;
180
+ }
181
+ cancel() {
182
+ const ptr = this.__destroy_into_raw();
183
+ wasm.intounderlyingbytesource_cancel(ptr);
184
+ }
185
+ /**
186
+ * @param {ReadableByteStreamController} controller
187
+ * @returns {Promise<any>}
188
+ */
189
+ pull(controller) {
190
+ const ret = wasm.intounderlyingbytesource_pull(this.__wbg_ptr, addHeapObject(controller));
191
+ return takeObject(ret);
192
+ }
193
+ /**
194
+ * @param {ReadableByteStreamController} controller
195
+ */
196
+ start(controller) {
197
+ wasm.intounderlyingbytesource_start(this.__wbg_ptr, addHeapObject(controller));
198
+ }
199
+ /**
200
+ * @returns {ReadableStreamType}
201
+ */
202
+ get type() {
203
+ const ret = wasm.intounderlyingbytesource_type(this.__wbg_ptr);
204
+ return __wbindgen_enum_ReadableStreamType[ret];
205
+ }
206
+ }
207
+ if (Symbol.dispose) IntoUnderlyingByteSource.prototype[Symbol.dispose] = IntoUnderlyingByteSource.prototype.free;
208
+
209
+ export class IntoUnderlyingSink {
210
+ __destroy_into_raw() {
211
+ const ptr = this.__wbg_ptr;
212
+ this.__wbg_ptr = 0;
213
+ IntoUnderlyingSinkFinalization.unregister(this);
214
+ return ptr;
215
+ }
216
+ free() {
217
+ const ptr = this.__destroy_into_raw();
218
+ wasm.__wbg_intounderlyingsink_free(ptr, 0);
219
+ }
220
+ /**
221
+ * @param {any} reason
222
+ * @returns {Promise<any>}
223
+ */
224
+ abort(reason) {
225
+ const ptr = this.__destroy_into_raw();
226
+ const ret = wasm.intounderlyingsink_abort(ptr, addHeapObject(reason));
227
+ return takeObject(ret);
228
+ }
229
+ /**
230
+ * @returns {Promise<any>}
231
+ */
232
+ close() {
233
+ const ptr = this.__destroy_into_raw();
234
+ const ret = wasm.intounderlyingsink_close(ptr);
235
+ return takeObject(ret);
236
+ }
237
+ /**
238
+ * @param {any} chunk
239
+ * @returns {Promise<any>}
240
+ */
241
+ write(chunk) {
242
+ const ret = wasm.intounderlyingsink_write(this.__wbg_ptr, addHeapObject(chunk));
243
+ return takeObject(ret);
244
+ }
245
+ }
246
+ if (Symbol.dispose) IntoUnderlyingSink.prototype[Symbol.dispose] = IntoUnderlyingSink.prototype.free;
247
+
248
+ export class IntoUnderlyingSource {
249
+ __destroy_into_raw() {
250
+ const ptr = this.__wbg_ptr;
251
+ this.__wbg_ptr = 0;
252
+ IntoUnderlyingSourceFinalization.unregister(this);
253
+ return ptr;
254
+ }
255
+ free() {
256
+ const ptr = this.__destroy_into_raw();
257
+ wasm.__wbg_intounderlyingsource_free(ptr, 0);
258
+ }
259
+ cancel() {
260
+ const ptr = this.__destroy_into_raw();
261
+ wasm.intounderlyingsource_cancel(ptr);
262
+ }
263
+ /**
264
+ * @param {ReadableStreamDefaultController} controller
265
+ * @returns {Promise<any>}
266
+ */
267
+ pull(controller) {
268
+ const ret = wasm.intounderlyingsource_pull(this.__wbg_ptr, addHeapObject(controller));
269
+ return takeObject(ret);
270
+ }
271
+ }
272
+ if (Symbol.dispose) IntoUnderlyingSource.prototype[Symbol.dispose] = IntoUnderlyingSource.prototype.free;
273
+
274
+ export class ServerConfig {
275
+ __destroy_into_raw() {
276
+ const ptr = this.__wbg_ptr;
277
+ this.__wbg_ptr = 0;
278
+ ServerConfigFinalization.unregister(this);
279
+ return ptr;
280
+ }
281
+ free() {
282
+ const ptr = this.__destroy_into_raw();
283
+ wasm.__wbg_serverconfig_free(ptr, 0);
284
+ }
285
+ /**
286
+ * @param {AsyncIterator<any>} into_server
287
+ * @param {WritableStream} from_server
288
+ */
289
+ constructor(into_server, from_server) {
290
+ const ret = wasm.serverconfig_new(addHeapObject(into_server), addHeapObject(from_server));
291
+ this.__wbg_ptr = ret >>> 0;
292
+ ServerConfigFinalization.register(this, this.__wbg_ptr, this);
293
+ return this;
294
+ }
295
+ }
296
+ if (Symbol.dispose) ServerConfig.prototype[Symbol.dispose] = ServerConfig.prototype.free;
297
+
298
+ /**
299
+ * Run the Lemma LSP over the given streams. Call from JS after creating
300
+ * an AsyncIterator (client → server messages) and a WritableStream (server → client).
301
+ * @param {ServerConfig} config
302
+ * @returns {Promise<void>}
303
+ */
304
+ export function serve(config) {
305
+ _assertClass(config, ServerConfig);
306
+ var ptr0 = config.__destroy_into_raw();
307
+ const ret = wasm.serve(ptr0);
308
+ return takeObject(ret);
309
+ }
310
+
311
+ function __wbg_get_imports() {
312
+ const import0 = {
313
+ __proto__: null,
314
+ __wbg_Error_83742b46f01ce22d: function(arg0, arg1) {
315
+ const ret = Error(getStringFromWasm0(arg0, arg1));
316
+ return addHeapObject(ret);
317
+ },
318
+ __wbg_Number_a5a435bd7bbec835: function(arg0) {
319
+ const ret = Number(getObject(arg0));
320
+ return ret;
321
+ },
322
+ __wbg_String_8564e559799eccda: function(arg0, arg1) {
323
+ const ret = String(getObject(arg1));
324
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
325
+ const len1 = WASM_VECTOR_LEN;
326
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
327
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
328
+ },
329
+ __wbg___wbindgen_bigint_get_as_i64_447a76b5c6ef7bda: function(arg0, arg1) {
330
+ const v = getObject(arg1);
331
+ const ret = typeof(v) === 'bigint' ? v : undefined;
332
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
333
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
334
+ },
335
+ __wbg___wbindgen_boolean_get_c0f3f60bac5a78d1: function(arg0) {
336
+ const v = getObject(arg0);
337
+ const ret = typeof(v) === 'boolean' ? v : undefined;
338
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
339
+ },
340
+ __wbg___wbindgen_debug_string_5398f5bb970e0daa: function(arg0, arg1) {
341
+ const ret = debugString(getObject(arg1));
342
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
343
+ const len1 = WASM_VECTOR_LEN;
344
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
345
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
346
+ },
347
+ __wbg___wbindgen_in_41dbb8413020e076: function(arg0, arg1) {
348
+ const ret = getObject(arg0) in getObject(arg1);
349
+ return ret;
350
+ },
351
+ __wbg___wbindgen_is_bigint_e2141d4f045b7eda: function(arg0) {
352
+ const ret = typeof(getObject(arg0)) === 'bigint';
353
+ return ret;
354
+ },
355
+ __wbg___wbindgen_is_function_3c846841762788c1: function(arg0) {
356
+ const ret = typeof(getObject(arg0)) === 'function';
357
+ return ret;
358
+ },
359
+ __wbg___wbindgen_is_null_0b605fc6b167c56f: function(arg0) {
360
+ const ret = getObject(arg0) === null;
361
+ return ret;
362
+ },
363
+ __wbg___wbindgen_is_object_781bc9f159099513: function(arg0) {
364
+ const val = getObject(arg0);
365
+ const ret = typeof(val) === 'object' && val !== null;
366
+ return ret;
367
+ },
368
+ __wbg___wbindgen_is_string_7ef6b97b02428fae: function(arg0) {
369
+ const ret = typeof(getObject(arg0)) === 'string';
370
+ return ret;
371
+ },
372
+ __wbg___wbindgen_is_undefined_52709e72fb9f179c: function(arg0) {
373
+ const ret = getObject(arg0) === undefined;
374
+ return ret;
375
+ },
376
+ __wbg___wbindgen_jsval_eq_ee31bfad3e536463: function(arg0, arg1) {
377
+ const ret = getObject(arg0) === getObject(arg1);
378
+ return ret;
379
+ },
380
+ __wbg___wbindgen_jsval_loose_eq_5bcc3bed3c69e72b: function(arg0, arg1) {
381
+ const ret = getObject(arg0) == getObject(arg1);
382
+ return ret;
383
+ },
384
+ __wbg___wbindgen_number_get_34bb9d9dcfa21373: function(arg0, arg1) {
385
+ const obj = getObject(arg1);
386
+ const ret = typeof(obj) === 'number' ? obj : undefined;
387
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
388
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
389
+ },
390
+ __wbg___wbindgen_string_get_395e606bd0ee4427: function(arg0, arg1) {
391
+ const obj = getObject(arg1);
392
+ const ret = typeof(obj) === 'string' ? obj : undefined;
393
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
394
+ var len1 = WASM_VECTOR_LEN;
395
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
396
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
397
+ },
398
+ __wbg___wbindgen_throw_6ddd609b62940d55: function(arg0, arg1) {
399
+ throw new Error(getStringFromWasm0(arg0, arg1));
400
+ },
401
+ __wbg__wbg_cb_unref_6b5b6b8576d35cb1: function(arg0) {
402
+ getObject(arg0)._wbg_cb_unref();
403
+ },
404
+ __wbg_buffer_60b8043cd926067d: function(arg0) {
405
+ const ret = getObject(arg0).buffer;
406
+ return addHeapObject(ret);
407
+ },
408
+ __wbg_byobRequest_6342e5f2b232c0f9: function(arg0) {
409
+ const ret = getObject(arg0).byobRequest;
410
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
411
+ },
412
+ __wbg_byteLength_607b856aa6c5a508: function(arg0) {
413
+ const ret = getObject(arg0).byteLength;
414
+ return ret;
415
+ },
416
+ __wbg_byteOffset_b26b63681c83856c: function(arg0) {
417
+ const ret = getObject(arg0).byteOffset;
418
+ return ret;
419
+ },
420
+ __wbg_call_2d781c1f4d5c0ef8: function() { return handleError(function (arg0, arg1, arg2) {
421
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
422
+ return addHeapObject(ret);
423
+ }, arguments); },
424
+ __wbg_call_e133b57c9155d22c: function() { return handleError(function (arg0, arg1) {
425
+ const ret = getObject(arg0).call(getObject(arg1));
426
+ return addHeapObject(ret);
427
+ }, arguments); },
428
+ __wbg_close_690d36108c557337: function() { return handleError(function (arg0) {
429
+ getObject(arg0).close();
430
+ }, arguments); },
431
+ __wbg_close_737b4b1fbc658540: function() { return handleError(function (arg0) {
432
+ getObject(arg0).close();
433
+ }, arguments); },
434
+ __wbg_close_b94e98d26bd26248: function(arg0) {
435
+ const ret = getObject(arg0).close();
436
+ return addHeapObject(ret);
437
+ },
438
+ __wbg_done_08ce71ee07e3bd17: function(arg0) {
439
+ const ret = getObject(arg0).done;
440
+ return ret;
441
+ },
442
+ __wbg_enqueue_ec3552838b4b7fbf: function() { return handleError(function (arg0, arg1) {
443
+ getObject(arg0).enqueue(getObject(arg1));
444
+ }, arguments); },
445
+ __wbg_entries_e8a20ff8c9757101: function(arg0) {
446
+ const ret = Object.entries(getObject(arg0));
447
+ return addHeapObject(ret);
448
+ },
449
+ __wbg_error_a6fa202b58aa1cd3: function(arg0, arg1) {
450
+ let deferred0_0;
451
+ let deferred0_1;
452
+ try {
453
+ deferred0_0 = arg0;
454
+ deferred0_1 = arg1;
455
+ console.error(getStringFromWasm0(arg0, arg1));
456
+ } finally {
457
+ wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
458
+ }
459
+ },
460
+ __wbg_fetch_8d9b732df7467c44: function(arg0) {
461
+ const ret = fetch(getObject(arg0));
462
+ return addHeapObject(ret);
463
+ },
464
+ __wbg_getTime_1dad7b5386ddd2d9: function(arg0) {
465
+ const ret = getObject(arg0).getTime();
466
+ return ret;
467
+ },
468
+ __wbg_getTimezoneOffset_639bcf2dde21158b: function(arg0) {
469
+ const ret = getObject(arg0).getTimezoneOffset();
470
+ return ret;
471
+ },
472
+ __wbg_getWriter_aa227dc9da7cfa39: function() { return handleError(function (arg0) {
473
+ const ret = getObject(arg0).getWriter();
474
+ return addHeapObject(ret);
475
+ }, arguments); },
476
+ __wbg_get_326e41e095fb2575: function() { return handleError(function (arg0, arg1) {
477
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
478
+ return addHeapObject(ret);
479
+ }, arguments); },
480
+ __wbg_get_a8ee5c45dabc1b3b: function(arg0, arg1) {
481
+ const ret = getObject(arg0)[arg1 >>> 0];
482
+ return addHeapObject(ret);
483
+ },
484
+ __wbg_get_unchecked_329cfe50afab7352: function(arg0, arg1) {
485
+ const ret = getObject(arg0)[arg1 >>> 0];
486
+ return addHeapObject(ret);
487
+ },
488
+ __wbg_instanceof_ArrayBuffer_101e2bf31071a9f6: function(arg0) {
489
+ let result;
490
+ try {
491
+ result = getObject(arg0) instanceof ArrayBuffer;
492
+ } catch (_) {
493
+ result = false;
494
+ }
495
+ const ret = result;
496
+ return ret;
497
+ },
498
+ __wbg_instanceof_Error_4691a5b466e32a80: function(arg0) {
499
+ let result;
500
+ try {
501
+ result = getObject(arg0) instanceof Error;
502
+ } catch (_) {
503
+ result = false;
504
+ }
505
+ const ret = result;
506
+ return ret;
507
+ },
508
+ __wbg_instanceof_Map_f194b366846aca0c: function(arg0) {
509
+ let result;
510
+ try {
511
+ result = getObject(arg0) instanceof Map;
512
+ } catch (_) {
513
+ result = false;
514
+ }
515
+ const ret = result;
516
+ return ret;
517
+ },
518
+ __wbg_instanceof_Response_9b4d9fd451e051b1: function(arg0) {
519
+ let result;
520
+ try {
521
+ result = getObject(arg0) instanceof Response;
522
+ } catch (_) {
523
+ result = false;
524
+ }
525
+ const ret = result;
526
+ return ret;
527
+ },
528
+ __wbg_instanceof_Uint8Array_740438561a5b956d: function(arg0) {
529
+ let result;
530
+ try {
531
+ result = getObject(arg0) instanceof Uint8Array;
532
+ } catch (_) {
533
+ result = false;
534
+ }
535
+ const ret = result;
536
+ return ret;
537
+ },
538
+ __wbg_isArray_33b91feb269ff46e: function(arg0) {
539
+ const ret = Array.isArray(getObject(arg0));
540
+ return ret;
541
+ },
542
+ __wbg_isSafeInteger_ecd6a7f9c3e053cd: function(arg0) {
543
+ const ret = Number.isSafeInteger(getObject(arg0));
544
+ return ret;
545
+ },
546
+ __wbg_iterator_d8f549ec8fb061b1: function() {
547
+ const ret = Symbol.iterator;
548
+ return addHeapObject(ret);
549
+ },
550
+ __wbg_length_b3416cf66a5452c8: function(arg0) {
551
+ const ret = getObject(arg0).length;
552
+ return ret;
553
+ },
554
+ __wbg_length_ea16607d7b61445b: function(arg0) {
555
+ const ret = getObject(arg0).length;
556
+ return ret;
557
+ },
558
+ __wbg_message_00d63f20c41713dd: function(arg0) {
559
+ const ret = getObject(arg0).message;
560
+ return addHeapObject(ret);
561
+ },
562
+ __wbg_name_ecf53d5e050a495d: function(arg0) {
563
+ const ret = getObject(arg0).name;
564
+ return addHeapObject(ret);
565
+ },
566
+ __wbg_new_0837727332ac86ba: function() { return handleError(function () {
567
+ const ret = new Headers();
568
+ return addHeapObject(ret);
569
+ }, arguments); },
570
+ __wbg_new_0_1dcafdf5e786e876: function() {
571
+ const ret = new Date();
572
+ return addHeapObject(ret);
573
+ },
574
+ __wbg_new_227d7c05414eb861: function() {
575
+ const ret = new Error();
576
+ return addHeapObject(ret);
577
+ },
578
+ __wbg_new_49d5571bd3f0c4d4: function() {
579
+ const ret = new Map();
580
+ return addHeapObject(ret);
581
+ },
582
+ __wbg_new_5415f704ce1c4eda: function() { return handleError(function () {
583
+ const ret = new URLSearchParams();
584
+ return addHeapObject(ret);
585
+ }, arguments); },
586
+ __wbg_new_5f486cdf45a04d78: function(arg0) {
587
+ const ret = new Uint8Array(getObject(arg0));
588
+ return addHeapObject(ret);
589
+ },
590
+ __wbg_new_a70fbab9066b301f: function() {
591
+ const ret = new Array();
592
+ return addHeapObject(ret);
593
+ },
594
+ __wbg_new_ab79df5bd7c26067: function() {
595
+ const ret = new Object();
596
+ return addHeapObject(ret);
597
+ },
598
+ __wbg_new_bb1018d527df73cb: function() { return handleError(function (arg0, arg1) {
599
+ const ret = new URL(getStringFromWasm0(arg0, arg1));
600
+ return addHeapObject(ret);
601
+ }, arguments); },
602
+ __wbg_new_d15cb560a6a0e5f0: function(arg0, arg1) {
603
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
604
+ return addHeapObject(ret);
605
+ },
606
+ __wbg_new_fd94ca5c9639abd2: function(arg0) {
607
+ const ret = new Date(getObject(arg0));
608
+ return addHeapObject(ret);
609
+ },
610
+ __wbg_new_from_slice_22da9388ac046e50: function(arg0, arg1) {
611
+ const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
612
+ return addHeapObject(ret);
613
+ },
614
+ __wbg_new_typed_aaaeaf29cf802876: function(arg0, arg1) {
615
+ try {
616
+ var state0 = {a: arg0, b: arg1};
617
+ var cb0 = (arg0, arg1) => {
618
+ const a = state0.a;
619
+ state0.a = 0;
620
+ try {
621
+ return __wasm_bindgen_func_elem_10985(a, state0.b, arg0, arg1);
622
+ } finally {
623
+ state0.a = a;
624
+ }
625
+ };
626
+ const ret = new Promise(cb0);
627
+ return addHeapObject(ret);
628
+ } finally {
629
+ state0.a = state0.b = 0;
630
+ }
631
+ },
632
+ __wbg_new_with_byte_offset_and_length_b2ec5bf7b2f35743: function(arg0, arg1, arg2) {
633
+ const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
634
+ return addHeapObject(ret);
635
+ },
636
+ __wbg_new_with_str_4c859c3e69e6cb15: function() { return handleError(function (arg0, arg1) {
637
+ const ret = new Request(getStringFromWasm0(arg0, arg1));
638
+ return addHeapObject(ret);
639
+ }, arguments); },
640
+ __wbg_new_with_str_and_init_b4b54d1a819bc724: function() { return handleError(function (arg0, arg1, arg2) {
641
+ const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
642
+ return addHeapObject(ret);
643
+ }, arguments); },
644
+ __wbg_next_11b99ee6237339e3: function() { return handleError(function (arg0) {
645
+ const ret = getObject(arg0).next();
646
+ return addHeapObject(ret);
647
+ }, arguments); },
648
+ __wbg_next_9c645ba5e1273237: function() { return handleError(function (arg0) {
649
+ const ret = getObject(arg0).next();
650
+ return addHeapObject(ret);
651
+ }, arguments); },
652
+ __wbg_next_e01a967809d1aa68: function(arg0) {
653
+ const ret = getObject(arg0).next;
654
+ return addHeapObject(ret);
655
+ },
656
+ __wbg_ok_7ec8b94facac7704: function(arg0) {
657
+ const ret = getObject(arg0).ok;
658
+ return ret;
659
+ },
660
+ __wbg_parse_e9eddd2a82c706eb: function() { return handleError(function (arg0, arg1) {
661
+ const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
662
+ return addHeapObject(ret);
663
+ }, arguments); },
664
+ __wbg_prototypesetcall_d62e5099504357e6: function(arg0, arg1, arg2) {
665
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
666
+ },
667
+ __wbg_queueMicrotask_0c399741342fb10f: function(arg0) {
668
+ const ret = getObject(arg0).queueMicrotask;
669
+ return addHeapObject(ret);
670
+ },
671
+ __wbg_queueMicrotask_a082d78ce798393e: function(arg0) {
672
+ queueMicrotask(getObject(arg0));
673
+ },
674
+ __wbg_ready_955a75e9a3b95328: function(arg0) {
675
+ const ret = getObject(arg0).ready;
676
+ return addHeapObject(ret);
677
+ },
678
+ __wbg_releaseLock_0974322a2d3ec3a1: function(arg0) {
679
+ getObject(arg0).releaseLock();
680
+ },
681
+ __wbg_resolve_ae8d83246e5bcc12: function(arg0) {
682
+ const ret = Promise.resolve(getObject(arg0));
683
+ return addHeapObject(ret);
684
+ },
685
+ __wbg_respond_e286ee502e7cf7e4: function() { return handleError(function (arg0, arg1) {
686
+ getObject(arg0).respond(arg1 >>> 0);
687
+ }, arguments); },
688
+ __wbg_search_35617fb7936183df: function(arg0, arg1) {
689
+ const ret = getObject(arg1).search;
690
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
691
+ const len1 = WASM_VECTOR_LEN;
692
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
693
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
694
+ },
695
+ __wbg_set_282384002438957f: function(arg0, arg1, arg2) {
696
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
697
+ },
698
+ __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
699
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
700
+ },
701
+ __wbg_set_8c0b3ffcf05d61c2: function(arg0, arg1, arg2) {
702
+ getObject(arg0).set(getArrayU8FromWasm0(arg1, arg2));
703
+ },
704
+ __wbg_set_bf7251625df30a02: function(arg0, arg1, arg2) {
705
+ const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
706
+ return addHeapObject(ret);
707
+ },
708
+ __wbg_set_headers_3c8fecc693b75327: function(arg0, arg1) {
709
+ getObject(arg0).headers = getObject(arg1);
710
+ },
711
+ __wbg_set_method_8c015e8bcafd7be1: function(arg0, arg1, arg2) {
712
+ getObject(arg0).method = getStringFromWasm0(arg1, arg2);
713
+ },
714
+ __wbg_set_search_bd09fe57b201bac5: function(arg0, arg1, arg2) {
715
+ getObject(arg0).search = getStringFromWasm0(arg1, arg2);
716
+ },
717
+ __wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
718
+ const ret = getObject(arg1).stack;
719
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
720
+ const len1 = WASM_VECTOR_LEN;
721
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
722
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
723
+ },
724
+ __wbg_static_accessor_GLOBAL_8adb955bd33fac2f: function() {
725
+ const ret = typeof global === 'undefined' ? null : global;
726
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
727
+ },
728
+ __wbg_static_accessor_GLOBAL_THIS_ad356e0db91c7913: function() {
729
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
730
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
731
+ },
732
+ __wbg_static_accessor_SELF_f207c857566db248: function() {
733
+ const ret = typeof self === 'undefined' ? null : self;
734
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
735
+ },
736
+ __wbg_static_accessor_WINDOW_bb9f1ba69d61b386: function() {
737
+ const ret = typeof window === 'undefined' ? null : window;
738
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
739
+ },
740
+ __wbg_status_318629ab93a22955: function(arg0) {
741
+ const ret = getObject(arg0).status;
742
+ return ret;
743
+ },
744
+ __wbg_text_372f5b91442c50f9: function() { return handleError(function (arg0) {
745
+ const ret = getObject(arg0).text();
746
+ return addHeapObject(ret);
747
+ }, arguments); },
748
+ __wbg_then_098abe61755d12f6: function(arg0, arg1) {
749
+ const ret = getObject(arg0).then(getObject(arg1));
750
+ return addHeapObject(ret);
751
+ },
752
+ __wbg_then_9e335f6dd892bc11: function(arg0, arg1, arg2) {
753
+ const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
754
+ return addHeapObject(ret);
755
+ },
756
+ __wbg_toString_3272fa0dfd05dd87: function(arg0) {
757
+ const ret = getObject(arg0).toString();
758
+ return addHeapObject(ret);
759
+ },
760
+ __wbg_toString_fca8b5e46235cfb4: function(arg0) {
761
+ const ret = getObject(arg0).toString();
762
+ return addHeapObject(ret);
763
+ },
764
+ __wbg_url_b6f96880b733816c: function(arg0, arg1) {
765
+ const ret = getObject(arg1).url;
766
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
767
+ const len1 = WASM_VECTOR_LEN;
768
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
769
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
770
+ },
771
+ __wbg_value_21fc78aab0322612: function(arg0) {
772
+ const ret = getObject(arg0).value;
773
+ return addHeapObject(ret);
774
+ },
775
+ __wbg_view_f68a712e7315f8b2: function(arg0) {
776
+ const ret = getObject(arg0).view;
777
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
778
+ },
779
+ __wbg_write_6c1ce79b0d7a43ff: function(arg0, arg1) {
780
+ const ret = getObject(arg0).write(getObject(arg1));
781
+ return addHeapObject(ret);
782
+ },
783
+ __wbindgen_cast_0000000000000001: function(arg0, arg1) {
784
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 1257, function: Function { arguments: [Externref], shim_idx: 1313, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
785
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_9731, __wasm_bindgen_func_elem_10982);
786
+ return addHeapObject(ret);
787
+ },
788
+ __wbindgen_cast_0000000000000002: function(arg0, arg1) {
789
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 7, function: Function { arguments: [NamedExternref("IteratorResult<any>")], shim_idx: 8, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
790
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_385, __wasm_bindgen_func_elem_2764);
791
+ return addHeapObject(ret);
792
+ },
793
+ __wbindgen_cast_0000000000000003: function(arg0) {
794
+ // Cast intrinsic for `F64 -> Externref`.
795
+ const ret = arg0;
796
+ return addHeapObject(ret);
797
+ },
798
+ __wbindgen_cast_0000000000000004: function(arg0) {
799
+ // Cast intrinsic for `I64 -> Externref`.
800
+ const ret = arg0;
801
+ return addHeapObject(ret);
802
+ },
803
+ __wbindgen_cast_0000000000000005: function(arg0, arg1) {
804
+ // Cast intrinsic for `Ref(String) -> Externref`.
805
+ const ret = getStringFromWasm0(arg0, arg1);
806
+ return addHeapObject(ret);
807
+ },
808
+ __wbindgen_cast_0000000000000006: function(arg0) {
809
+ // Cast intrinsic for `U64 -> Externref`.
810
+ const ret = BigInt.asUintN(64, arg0);
811
+ return addHeapObject(ret);
812
+ },
813
+ __wbindgen_object_clone_ref: function(arg0) {
814
+ const ret = getObject(arg0);
815
+ return addHeapObject(ret);
816
+ },
817
+ __wbindgen_object_drop_ref: function(arg0) {
818
+ takeObject(arg0);
819
+ },
820
+ };
821
+ return {
822
+ __proto__: null,
823
+ "./lemma_bg.js": import0,
824
+ };
825
+ }
826
+
827
+ function __wasm_bindgen_func_elem_10982(arg0, arg1, arg2) {
828
+ try {
829
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
830
+ wasm.__wasm_bindgen_func_elem_10982(retptr, arg0, arg1, addHeapObject(arg2));
831
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
832
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
833
+ if (r1) {
834
+ throw takeObject(r0);
835
+ }
836
+ } finally {
837
+ wasm.__wbindgen_add_to_stack_pointer(16);
838
+ }
839
+ }
840
+
841
+ function __wasm_bindgen_func_elem_2764(arg0, arg1, arg2) {
842
+ try {
843
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
844
+ wasm.__wasm_bindgen_func_elem_2764(retptr, arg0, arg1, addHeapObject(arg2));
845
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
846
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
847
+ if (r1) {
848
+ throw takeObject(r0);
849
+ }
850
+ } finally {
851
+ wasm.__wbindgen_add_to_stack_pointer(16);
852
+ }
853
+ }
854
+
855
+ function __wasm_bindgen_func_elem_10985(arg0, arg1, arg2, arg3) {
856
+ wasm.__wasm_bindgen_func_elem_10985(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
857
+ }
858
+
859
+
860
+ const __wbindgen_enum_ReadableStreamType = ["bytes"];
861
+ const IntoUnderlyingByteSourceFinalization = (typeof FinalizationRegistry === 'undefined')
862
+ ? { register: () => {}, unregister: () => {} }
863
+ : new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingbytesource_free(ptr >>> 0, 1));
864
+ const IntoUnderlyingSinkFinalization = (typeof FinalizationRegistry === 'undefined')
865
+ ? { register: () => {}, unregister: () => {} }
866
+ : new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingsink_free(ptr >>> 0, 1));
867
+ const IntoUnderlyingSourceFinalization = (typeof FinalizationRegistry === 'undefined')
868
+ ? { register: () => {}, unregister: () => {} }
869
+ : new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingsource_free(ptr >>> 0, 1));
870
+ const ServerConfigFinalization = (typeof FinalizationRegistry === 'undefined')
871
+ ? { register: () => {}, unregister: () => {} }
872
+ : new FinalizationRegistry(ptr => wasm.__wbg_serverconfig_free(ptr >>> 0, 1));
873
+ const EngineFinalization = (typeof FinalizationRegistry === 'undefined')
874
+ ? { register: () => {}, unregister: () => {} }
875
+ : new FinalizationRegistry(ptr => wasm.__wbg_engine_free(ptr >>> 0, 1));
876
+
877
+ function addHeapObject(obj) {
878
+ if (heap_next === heap.length) heap.push(heap.length + 1);
879
+ const idx = heap_next;
880
+ heap_next = heap[idx];
881
+
882
+ heap[idx] = obj;
883
+ return idx;
884
+ }
885
+
886
+ function _assertClass(instance, klass) {
887
+ if (!(instance instanceof klass)) {
888
+ throw new Error(`expected instance of ${klass.name}`);
889
+ }
890
+ }
891
+
892
+ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
893
+ ? { register: () => {}, unregister: () => {} }
894
+ : new FinalizationRegistry(state => state.dtor(state.a, state.b));
895
+
896
+ function debugString(val) {
897
+ // primitive types
898
+ const type = typeof val;
899
+ if (type == 'number' || type == 'boolean' || val == null) {
900
+ return `${val}`;
901
+ }
902
+ if (type == 'string') {
903
+ return `"${val}"`;
904
+ }
905
+ if (type == 'symbol') {
906
+ const description = val.description;
907
+ if (description == null) {
908
+ return 'Symbol';
909
+ } else {
910
+ return `Symbol(${description})`;
911
+ }
912
+ }
913
+ if (type == 'function') {
914
+ const name = val.name;
915
+ if (typeof name == 'string' && name.length > 0) {
916
+ return `Function(${name})`;
917
+ } else {
918
+ return 'Function';
919
+ }
920
+ }
921
+ // objects
922
+ if (Array.isArray(val)) {
923
+ const length = val.length;
924
+ let debug = '[';
925
+ if (length > 0) {
926
+ debug += debugString(val[0]);
927
+ }
928
+ for(let i = 1; i < length; i++) {
929
+ debug += ', ' + debugString(val[i]);
930
+ }
931
+ debug += ']';
932
+ return debug;
933
+ }
934
+ // Test for built-in
935
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
936
+ let className;
937
+ if (builtInMatches && builtInMatches.length > 1) {
938
+ className = builtInMatches[1];
939
+ } else {
940
+ // Failed to match the standard '[object ClassName]'
941
+ return toString.call(val);
942
+ }
943
+ if (className == 'Object') {
944
+ // we're a user defined class or Object
945
+ // JSON.stringify avoids problems with cycles, and is generally much
946
+ // easier than looping through ownProperties of `val`.
947
+ try {
948
+ return 'Object(' + JSON.stringify(val) + ')';
949
+ } catch (_) {
950
+ return 'Object';
951
+ }
952
+ }
953
+ // errors
954
+ if (val instanceof Error) {
955
+ return `${val.name}: ${val.message}\n${val.stack}`;
956
+ }
957
+ // TODO we could test for more things here, like `Set`s and `Map`s.
958
+ return className;
959
+ }
960
+
961
+ function dropObject(idx) {
962
+ if (idx < 1028) return;
963
+ heap[idx] = heap_next;
964
+ heap_next = idx;
965
+ }
966
+
967
+ function getArrayU8FromWasm0(ptr, len) {
968
+ ptr = ptr >>> 0;
969
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
970
+ }
971
+
972
+ let cachedDataViewMemory0 = null;
973
+ function getDataViewMemory0() {
974
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
975
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
976
+ }
977
+ return cachedDataViewMemory0;
978
+ }
979
+
980
+ function getStringFromWasm0(ptr, len) {
981
+ ptr = ptr >>> 0;
982
+ return decodeText(ptr, len);
983
+ }
984
+
985
+ let cachedUint8ArrayMemory0 = null;
986
+ function getUint8ArrayMemory0() {
987
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
988
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
989
+ }
990
+ return cachedUint8ArrayMemory0;
991
+ }
992
+
993
+ function getObject(idx) { return heap[idx]; }
994
+
995
+ function handleError(f, args) {
996
+ try {
997
+ return f.apply(this, args);
998
+ } catch (e) {
999
+ wasm.__wbindgen_export3(addHeapObject(e));
1000
+ }
1001
+ }
1002
+
1003
+ let heap = new Array(1024).fill(undefined);
1004
+ heap.push(undefined, null, true, false);
1005
+
1006
+ let heap_next = heap.length;
1007
+
1008
+ function isLikeNone(x) {
1009
+ return x === undefined || x === null;
1010
+ }
1011
+
1012
+ function makeMutClosure(arg0, arg1, dtor, f) {
1013
+ const state = { a: arg0, b: arg1, cnt: 1, dtor };
1014
+ const real = (...args) => {
1015
+
1016
+ // First up with a closure we increment the internal reference
1017
+ // count. This ensures that the Rust closure environment won't
1018
+ // be deallocated while we're invoking it.
1019
+ state.cnt++;
1020
+ const a = state.a;
1021
+ state.a = 0;
1022
+ try {
1023
+ return f(a, state.b, ...args);
1024
+ } finally {
1025
+ state.a = a;
1026
+ real._wbg_cb_unref();
1027
+ }
1028
+ };
1029
+ real._wbg_cb_unref = () => {
1030
+ if (--state.cnt === 0) {
1031
+ state.dtor(state.a, state.b);
1032
+ state.a = 0;
1033
+ CLOSURE_DTORS.unregister(state);
1034
+ }
1035
+ };
1036
+ CLOSURE_DTORS.register(real, state, state);
1037
+ return real;
1038
+ }
1039
+
1040
+ function passStringToWasm0(arg, malloc, realloc) {
1041
+ if (realloc === undefined) {
1042
+ const buf = cachedTextEncoder.encode(arg);
1043
+ const ptr = malloc(buf.length, 1) >>> 0;
1044
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
1045
+ WASM_VECTOR_LEN = buf.length;
1046
+ return ptr;
1047
+ }
1048
+
1049
+ let len = arg.length;
1050
+ let ptr = malloc(len, 1) >>> 0;
1051
+
1052
+ const mem = getUint8ArrayMemory0();
1053
+
1054
+ let offset = 0;
1055
+
1056
+ for (; offset < len; offset++) {
1057
+ const code = arg.charCodeAt(offset);
1058
+ if (code > 0x7F) break;
1059
+ mem[ptr + offset] = code;
1060
+ }
1061
+ if (offset !== len) {
1062
+ if (offset !== 0) {
1063
+ arg = arg.slice(offset);
1064
+ }
1065
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
1066
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
1067
+ const ret = cachedTextEncoder.encodeInto(arg, view);
1068
+
1069
+ offset += ret.written;
1070
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
1071
+ }
1072
+
1073
+ WASM_VECTOR_LEN = offset;
1074
+ return ptr;
1075
+ }
1076
+
1077
+ function takeObject(idx) {
1078
+ const ret = getObject(idx);
1079
+ dropObject(idx);
1080
+ return ret;
1081
+ }
1082
+
1083
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
1084
+ cachedTextDecoder.decode();
1085
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
1086
+ let numBytesDecoded = 0;
1087
+ function decodeText(ptr, len) {
1088
+ numBytesDecoded += len;
1089
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
1090
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
1091
+ cachedTextDecoder.decode();
1092
+ numBytesDecoded = len;
1093
+ }
1094
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
1095
+ }
1096
+
1097
+ const cachedTextEncoder = new TextEncoder();
1098
+
1099
+ if (!('encodeInto' in cachedTextEncoder)) {
1100
+ cachedTextEncoder.encodeInto = function (arg, view) {
1101
+ const buf = cachedTextEncoder.encode(arg);
1102
+ view.set(buf);
1103
+ return {
1104
+ read: arg.length,
1105
+ written: buf.length
1106
+ };
1107
+ };
1108
+ }
1109
+
1110
+ let WASM_VECTOR_LEN = 0;
1111
+
1112
+ let wasmModule, wasm;
1113
+ function __wbg_finalize_init(instance, module) {
1114
+ wasm = instance.exports;
1115
+ wasmModule = module;
1116
+ cachedDataViewMemory0 = null;
1117
+ cachedUint8ArrayMemory0 = null;
1118
+ return wasm;
1119
+ }
1120
+
1121
+ async function __wbg_load(module, imports) {
1122
+ if (typeof Response === 'function' && module instanceof Response) {
1123
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
1124
+ try {
1125
+ return await WebAssembly.instantiateStreaming(module, imports);
1126
+ } catch (e) {
1127
+ const validResponse = module.ok && expectedResponseType(module.type);
1128
+
1129
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
1130
+ console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
1131
+
1132
+ } else { throw e; }
1133
+ }
1134
+ }
1135
+
1136
+ const bytes = await module.arrayBuffer();
1137
+ return await WebAssembly.instantiate(bytes, imports);
1138
+ } else {
1139
+ const instance = await WebAssembly.instantiate(module, imports);
1140
+
1141
+ if (instance instanceof WebAssembly.Instance) {
1142
+ return { instance, module };
1143
+ } else {
1144
+ return instance;
1145
+ }
1146
+ }
1147
+
1148
+ function expectedResponseType(type) {
1149
+ switch (type) {
1150
+ case 'basic': case 'cors': case 'default': return true;
1151
+ }
1152
+ return false;
1153
+ }
1154
+ }
1155
+
1156
+ function initSync(module) {
1157
+ if (wasm !== undefined) return wasm;
1158
+
1159
+
1160
+ if (module !== undefined) {
1161
+ if (Object.getPrototypeOf(module) === Object.prototype) {
1162
+ ({module} = module)
1163
+ } else {
1164
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
1165
+ }
1166
+ }
1167
+
1168
+ const imports = __wbg_get_imports();
1169
+ if (!(module instanceof WebAssembly.Module)) {
1170
+ module = new WebAssembly.Module(module);
1171
+ }
1172
+ const instance = new WebAssembly.Instance(module, imports);
1173
+ return __wbg_finalize_init(instance, module);
1174
+ }
1175
+
1176
+ async function __wbg_init(module_or_path) {
1177
+ if (wasm !== undefined) return wasm;
1178
+
1179
+
1180
+ if (module_or_path !== undefined) {
1181
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
1182
+ ({module_or_path} = module_or_path)
1183
+ } else {
1184
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
1185
+ }
1186
+ }
1187
+
1188
+ if (module_or_path === undefined) {
1189
+ module_or_path = new URL('lemma_bg.wasm', import.meta.url);
1190
+ }
1191
+ const imports = __wbg_get_imports();
1192
+
1193
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
1194
+ module_or_path = fetch(module_or_path);
1195
+ }
1196
+
1197
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
1198
+
1199
+ return __wbg_finalize_init(instance, module);
1200
+ }
1201
+
1202
+ export { initSync, __wbg_init as default };