kjarni-wasm 0.2.7 → 0.2.8
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/README.md +8 -4
- package/package.json +2 -2
- package/pkg/kjarni_wasm.d.ts +29 -25
- package/pkg/kjarni_wasm.js +507 -442
- package/pkg/kjarni_wasm_bg.wasm +0 -0
- package/pkg/kjarni_wasm_bg.wasm.d.ts +12 -8
- package/pkg/package.json +2 -2
package/pkg/kjarni_wasm.js
CHANGED
|
@@ -47,12 +47,12 @@ export class WasmChat {
|
|
|
47
47
|
*/
|
|
48
48
|
enablePrefixCache(tokens) {
|
|
49
49
|
try {
|
|
50
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
50
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
51
51
|
wasm.wasmchat_enablePrefixCache(retptr, this.__wbg_ptr, tokens);
|
|
52
52
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
53
53
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
54
54
|
if (r1) {
|
|
55
|
-
throw
|
|
55
|
+
throw takeFromExternrefTable0(r0);
|
|
56
56
|
}
|
|
57
57
|
} finally {
|
|
58
58
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -66,29 +66,31 @@ export class WasmChat {
|
|
|
66
66
|
* @returns {string}
|
|
67
67
|
*/
|
|
68
68
|
generate(prompt, max_new_tokens, temperature) {
|
|
69
|
-
let
|
|
70
|
-
let
|
|
69
|
+
let deferred5_0;
|
|
70
|
+
let deferred5_1;
|
|
71
71
|
try {
|
|
72
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
72
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
73
|
+
const val2 = +max_new_tokens;
|
|
74
|
+
const val3 = +temperature;
|
|
73
75
|
const ptr0 = passStringToWasm0(prompt, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
74
76
|
const len0 = WASM_VECTOR_LEN;
|
|
75
|
-
wasm.wasmchat_generate(retptr, this.__wbg_ptr, ptr0, len0,
|
|
77
|
+
wasm.wasmchat_generate(retptr, this.__wbg_ptr, ptr0, len0, val2, val3);
|
|
76
78
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
77
79
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
78
80
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
79
81
|
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
80
|
-
var
|
|
81
|
-
var
|
|
82
|
+
var ptr4 = r0;
|
|
83
|
+
var len4 = r1;
|
|
82
84
|
if (r3) {
|
|
83
|
-
|
|
84
|
-
throw
|
|
85
|
+
ptr4 = 0; len4 = 0;
|
|
86
|
+
throw takeFromExternrefTable0(r2);
|
|
85
87
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
return getStringFromWasm0(
|
|
88
|
+
deferred5_0 = ptr4;
|
|
89
|
+
deferred5_1 = len4;
|
|
90
|
+
return getStringFromWasm0(ptr4, len4);
|
|
89
91
|
} finally {
|
|
90
92
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
91
|
-
wasm.
|
|
93
|
+
wasm.__wbindgen_export3(deferred5_0, deferred5_1, 1);
|
|
92
94
|
}
|
|
93
95
|
}
|
|
94
96
|
/**
|
|
@@ -111,30 +113,31 @@ export class WasmChat {
|
|
|
111
113
|
* @returns {string}
|
|
112
114
|
*/
|
|
113
115
|
generate_stream(prompt, max_new_tokens, temperature, on_token) {
|
|
114
|
-
let
|
|
115
|
-
let
|
|
116
|
+
let deferred5_0;
|
|
117
|
+
let deferred5_1;
|
|
116
118
|
try {
|
|
117
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
119
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
120
|
+
const val2 = +max_new_tokens;
|
|
121
|
+
const val3 = +temperature;
|
|
118
122
|
const ptr0 = passStringToWasm0(prompt, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
119
123
|
const len0 = WASM_VECTOR_LEN;
|
|
120
|
-
wasm.wasmchat_generate_stream(retptr, this.__wbg_ptr, ptr0, len0,
|
|
124
|
+
wasm.wasmchat_generate_stream(retptr, this.__wbg_ptr, ptr0, len0, val2, val3, on_token);
|
|
121
125
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
122
126
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
123
127
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
124
128
|
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
125
|
-
var
|
|
126
|
-
var
|
|
129
|
+
var ptr4 = r0;
|
|
130
|
+
var len4 = r1;
|
|
127
131
|
if (r3) {
|
|
128
|
-
|
|
129
|
-
throw
|
|
132
|
+
ptr4 = 0; len4 = 0;
|
|
133
|
+
throw takeFromExternrefTable0(r2);
|
|
130
134
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
return getStringFromWasm0(
|
|
135
|
+
deferred5_0 = ptr4;
|
|
136
|
+
deferred5_1 = len4;
|
|
137
|
+
return getStringFromWasm0(ptr4, len4);
|
|
134
138
|
} finally {
|
|
135
139
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
136
|
-
|
|
137
|
-
wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
140
|
+
wasm.__wbindgen_export3(deferred5_0, deferred5_1, 1);
|
|
138
141
|
}
|
|
139
142
|
}
|
|
140
143
|
/**
|
|
@@ -158,23 +161,30 @@ export class WasmChat {
|
|
|
158
161
|
*
|
|
159
162
|
* `model_id` selects the chat template, e.g. `qwen2.5-0.5b-instruct`. Without
|
|
160
163
|
* one the model still generates, but its turn markers will not be applied.
|
|
161
|
-
* @param {Uint8Array} data
|
|
164
|
+
* @param {Uint8Array | number[]} data
|
|
162
165
|
* @param {string | null} [model_id]
|
|
163
166
|
* @returns {WasmChat}
|
|
164
167
|
*/
|
|
165
168
|
static load(data, model_id) {
|
|
166
169
|
try {
|
|
167
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
170
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
171
|
+
let ptr0, len0, ptr1, len1;
|
|
172
|
+
try {
|
|
173
|
+
ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_export);
|
|
174
|
+
len0 = WASM_VECTOR_LEN;
|
|
175
|
+
ptr1 = isLikeNone(model_id) ? 0 : passStringToWasm0(model_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
176
|
+
len1 = WASM_VECTOR_LEN;
|
|
177
|
+
} catch (e) {
|
|
178
|
+
if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
|
|
179
|
+
if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
|
|
180
|
+
throw e;
|
|
181
|
+
}
|
|
172
182
|
wasm.wasmchat_load(retptr, ptr0, len0, ptr1, len1);
|
|
173
183
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
174
184
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
175
185
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
176
186
|
if (r2) {
|
|
177
|
-
throw
|
|
187
|
+
throw takeFromExternrefTable0(r1);
|
|
178
188
|
}
|
|
179
189
|
return WasmChat.__wrap(r0);
|
|
180
190
|
} finally {
|
|
@@ -198,30 +208,31 @@ export class WasmChat {
|
|
|
198
208
|
* @returns {string}
|
|
199
209
|
*/
|
|
200
210
|
send_stream(message, max_new_tokens, temperature, on_token) {
|
|
201
|
-
let
|
|
202
|
-
let
|
|
211
|
+
let deferred5_0;
|
|
212
|
+
let deferred5_1;
|
|
203
213
|
try {
|
|
204
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
214
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
215
|
+
const val2 = +max_new_tokens;
|
|
216
|
+
const val3 = +temperature;
|
|
205
217
|
const ptr0 = passStringToWasm0(message, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
206
218
|
const len0 = WASM_VECTOR_LEN;
|
|
207
|
-
wasm.wasmchat_send_stream(retptr, this.__wbg_ptr, ptr0, len0,
|
|
219
|
+
wasm.wasmchat_send_stream(retptr, this.__wbg_ptr, ptr0, len0, val2, val3, on_token);
|
|
208
220
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
209
221
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
210
222
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
211
223
|
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
212
|
-
var
|
|
213
|
-
var
|
|
224
|
+
var ptr4 = r0;
|
|
225
|
+
var len4 = r1;
|
|
214
226
|
if (r3) {
|
|
215
|
-
|
|
216
|
-
throw
|
|
227
|
+
ptr4 = 0; len4 = 0;
|
|
228
|
+
throw takeFromExternrefTable0(r2);
|
|
217
229
|
}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
return getStringFromWasm0(
|
|
230
|
+
deferred5_0 = ptr4;
|
|
231
|
+
deferred5_1 = len4;
|
|
232
|
+
return getStringFromWasm0(ptr4, len4);
|
|
221
233
|
} finally {
|
|
222
234
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
223
|
-
|
|
224
|
-
wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
235
|
+
wasm.__wbindgen_export3(deferred5_0, deferred5_1, 1);
|
|
225
236
|
}
|
|
226
237
|
}
|
|
227
238
|
}
|
|
@@ -248,52 +259,52 @@ export class WasmClassifier {
|
|
|
248
259
|
wasm.__wbg_wasmclassifier_free(ptr, 0);
|
|
249
260
|
}
|
|
250
261
|
/**
|
|
251
|
-
* Classify
|
|
262
|
+
* Classify a batch, returning the single best label for each input.
|
|
252
263
|
*
|
|
253
|
-
*
|
|
254
|
-
*
|
|
255
|
-
*
|
|
256
|
-
* @param {string} text
|
|
264
|
+
* One result per input, in input order, so the caller can line them up with
|
|
265
|
+
* whatever it passed in.
|
|
266
|
+
* @param {string[]} texts
|
|
257
267
|
* @returns {any}
|
|
258
268
|
*/
|
|
259
|
-
|
|
269
|
+
classify_batch(texts) {
|
|
260
270
|
try {
|
|
261
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
262
|
-
const ptr0 =
|
|
271
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
272
|
+
const ptr0 = passArrayJsValueToWasm0(texts, wasm.__wbindgen_export);
|
|
263
273
|
const len0 = WASM_VECTOR_LEN;
|
|
264
|
-
wasm.
|
|
274
|
+
wasm.wasmclassifier_classify_batch(retptr, this.__wbg_ptr, ptr0, len0);
|
|
265
275
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
266
276
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
267
277
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
268
278
|
if (r2) {
|
|
269
|
-
throw
|
|
279
|
+
throw takeFromExternrefTable0(r1);
|
|
270
280
|
}
|
|
271
|
-
return
|
|
281
|
+
return takeFromExternrefTable0(r0);
|
|
272
282
|
} finally {
|
|
273
283
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
274
284
|
}
|
|
275
285
|
}
|
|
276
286
|
/**
|
|
277
|
-
* Classify
|
|
287
|
+
* Classify one text, returning every label with its score, highest first.
|
|
278
288
|
*
|
|
279
|
-
*
|
|
280
|
-
*
|
|
281
|
-
*
|
|
289
|
+
* Serializing to a `JsValue` panics outside wasm32, so the work lives in
|
|
290
|
+
* [`WasmClassifier::classify_core`] and this is only the conversion. That is
|
|
291
|
+
* what makes the behaviour testable on the host.
|
|
292
|
+
* @param {string} text
|
|
282
293
|
* @returns {any}
|
|
283
294
|
*/
|
|
284
|
-
|
|
295
|
+
classify(text) {
|
|
285
296
|
try {
|
|
286
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
287
|
-
const ptr0 =
|
|
297
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
298
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
288
299
|
const len0 = WASM_VECTOR_LEN;
|
|
289
|
-
wasm.
|
|
300
|
+
wasm.wasmclassifier_classify(retptr, this.__wbg_ptr, ptr0, len0);
|
|
290
301
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
291
302
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
292
303
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
293
304
|
if (r2) {
|
|
294
|
-
throw
|
|
305
|
+
throw takeFromExternrefTable0(r1);
|
|
295
306
|
}
|
|
296
|
-
return
|
|
307
|
+
return takeFromExternrefTable0(r0);
|
|
297
308
|
} finally {
|
|
298
309
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
299
310
|
}
|
|
@@ -304,12 +315,12 @@ export class WasmClassifier {
|
|
|
304
315
|
*/
|
|
305
316
|
labels() {
|
|
306
317
|
try {
|
|
307
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
318
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
308
319
|
wasm.wasmclassifier_labels(retptr, this.__wbg_ptr);
|
|
309
320
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
310
321
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
311
322
|
var v1 = getArrayJsValueFromWasm0(r0, r1);
|
|
312
|
-
wasm.
|
|
323
|
+
wasm.__wbindgen_export3(r0, r1 * 4, 4);
|
|
313
324
|
return v1;
|
|
314
325
|
} finally {
|
|
315
326
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -317,12 +328,12 @@ export class WasmClassifier {
|
|
|
317
328
|
}
|
|
318
329
|
/**
|
|
319
330
|
* Load a classifier from a `.kjq` container.
|
|
320
|
-
* @param {Uint8Array} data
|
|
331
|
+
* @param {Uint8Array | number[]} data
|
|
321
332
|
* @returns {WasmClassifier}
|
|
322
333
|
*/
|
|
323
334
|
static load(data) {
|
|
324
335
|
try {
|
|
325
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
336
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
326
337
|
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_export);
|
|
327
338
|
const len0 = WASM_VECTOR_LEN;
|
|
328
339
|
wasm.wasmclassifier_load(retptr, ptr0, len0);
|
|
@@ -330,7 +341,7 @@ export class WasmClassifier {
|
|
|
330
341
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
331
342
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
332
343
|
if (r2) {
|
|
333
|
-
throw
|
|
344
|
+
throw takeFromExternrefTable0(r1);
|
|
334
345
|
}
|
|
335
346
|
return WasmClassifier.__wrap(r0);
|
|
336
347
|
} finally {
|
|
@@ -372,30 +383,37 @@ export class WasmEncoder {
|
|
|
372
383
|
*/
|
|
373
384
|
encode_file(text, source_path) {
|
|
374
385
|
try {
|
|
375
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
386
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
387
|
+
let ptr0, len0, ptr1, len1;
|
|
388
|
+
try {
|
|
389
|
+
ptr0 = passStringToWasm0(text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
390
|
+
len0 = WASM_VECTOR_LEN;
|
|
391
|
+
ptr1 = passStringToWasm0(source_path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
392
|
+
len1 = WASM_VECTOR_LEN;
|
|
393
|
+
} catch (e) {
|
|
394
|
+
if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
|
|
395
|
+
if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
|
|
396
|
+
throw e;
|
|
397
|
+
}
|
|
380
398
|
wasm.wasmencoder_encode_file(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
381
399
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
382
400
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
383
401
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
384
402
|
if (r2) {
|
|
385
|
-
throw
|
|
403
|
+
throw takeFromExternrefTable0(r1);
|
|
386
404
|
}
|
|
387
|
-
return
|
|
405
|
+
return takeFromExternrefTable0(r0);
|
|
388
406
|
} finally {
|
|
389
407
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
390
408
|
}
|
|
391
409
|
}
|
|
392
410
|
/**
|
|
393
|
-
* @param {Uint8Array} model_data
|
|
411
|
+
* @param {Uint8Array | number[]} model_data
|
|
394
412
|
* @returns {WasmEncoder}
|
|
395
413
|
*/
|
|
396
414
|
static new(model_data) {
|
|
397
415
|
try {
|
|
398
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
416
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
399
417
|
const ptr0 = passArray8ToWasm0(model_data, wasm.__wbindgen_export);
|
|
400
418
|
const len0 = WASM_VECTOR_LEN;
|
|
401
419
|
wasm.wasmencoder_new(retptr, ptr0, len0);
|
|
@@ -403,7 +421,7 @@ export class WasmEncoder {
|
|
|
403
421
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
404
422
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
405
423
|
if (r2) {
|
|
406
|
-
throw
|
|
424
|
+
throw takeFromExternrefTable0(r1);
|
|
407
425
|
}
|
|
408
426
|
return WasmEncoder.__wrap(r0);
|
|
409
427
|
} finally {
|
|
@@ -432,24 +450,33 @@ export class WasmIndexBuilder {
|
|
|
432
450
|
}
|
|
433
451
|
/**
|
|
434
452
|
* @param {string} text
|
|
435
|
-
* @param {Float32Array} embedding
|
|
453
|
+
* @param {Float32Array | number[]} embedding
|
|
436
454
|
* @param {string} source
|
|
437
455
|
* @param {number} chunk_index
|
|
438
456
|
*/
|
|
439
457
|
add_chunk(text, embedding, source, chunk_index) {
|
|
440
458
|
try {
|
|
441
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
442
|
-
const
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
459
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
460
|
+
const val4 = +chunk_index;
|
|
461
|
+
let ptr0, len0, ptr1, len1, ptr2, len2;
|
|
462
|
+
try {
|
|
463
|
+
ptr0 = passStringToWasm0(text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
464
|
+
len0 = WASM_VECTOR_LEN;
|
|
465
|
+
ptr1 = passArrayF32ToWasm0(embedding, wasm.__wbindgen_export);
|
|
466
|
+
len1 = WASM_VECTOR_LEN;
|
|
467
|
+
ptr2 = passStringToWasm0(source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
468
|
+
len2 = WASM_VECTOR_LEN;
|
|
469
|
+
} catch (e) {
|
|
470
|
+
if (ptr2) { wasm.__wbindgen_export3(ptr2, len2 * 1, 1); }
|
|
471
|
+
if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 4, 4); }
|
|
472
|
+
if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
|
|
473
|
+
throw e;
|
|
474
|
+
}
|
|
475
|
+
wasm.wasmindexbuilder_add_chunk(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, val4);
|
|
449
476
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
450
477
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
451
478
|
if (r1) {
|
|
452
|
-
throw
|
|
479
|
+
throw takeFromExternrefTable0(r0);
|
|
453
480
|
}
|
|
454
481
|
} finally {
|
|
455
482
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -462,17 +489,24 @@ export class WasmIndexBuilder {
|
|
|
462
489
|
*/
|
|
463
490
|
add_file(text, source_path) {
|
|
464
491
|
try {
|
|
465
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
492
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
493
|
+
let ptr0, len0, ptr1, len1;
|
|
494
|
+
try {
|
|
495
|
+
ptr0 = passStringToWasm0(text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
496
|
+
len0 = WASM_VECTOR_LEN;
|
|
497
|
+
ptr1 = passStringToWasm0(source_path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
498
|
+
len1 = WASM_VECTOR_LEN;
|
|
499
|
+
} catch (e) {
|
|
500
|
+
if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
|
|
501
|
+
if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
|
|
502
|
+
throw e;
|
|
503
|
+
}
|
|
470
504
|
wasm.wasmindexbuilder_add_file(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
471
505
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
472
506
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
473
507
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
474
508
|
if (r2) {
|
|
475
|
-
throw
|
|
509
|
+
throw takeFromExternrefTable0(r1);
|
|
476
510
|
}
|
|
477
511
|
return r0 >>> 0;
|
|
478
512
|
} finally {
|
|
@@ -491,29 +525,29 @@ export class WasmIndexBuilder {
|
|
|
491
525
|
*/
|
|
492
526
|
finish() {
|
|
493
527
|
try {
|
|
494
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
528
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
495
529
|
wasm.wasmindexbuilder_finish(retptr, this.__wbg_ptr);
|
|
496
530
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
497
531
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
498
532
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
499
533
|
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
500
534
|
if (r3) {
|
|
501
|
-
throw
|
|
535
|
+
throw takeFromExternrefTable0(r2);
|
|
502
536
|
}
|
|
503
537
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
504
|
-
wasm.
|
|
538
|
+
wasm.__wbindgen_export3(r0, r1 * 1, 1);
|
|
505
539
|
return v1;
|
|
506
540
|
} finally {
|
|
507
541
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
508
542
|
}
|
|
509
543
|
}
|
|
510
544
|
/**
|
|
511
|
-
* @param {Uint8Array} model_data
|
|
545
|
+
* @param {Uint8Array | number[]} model_data
|
|
512
546
|
* @returns {WasmIndexBuilder}
|
|
513
547
|
*/
|
|
514
548
|
static new(model_data) {
|
|
515
549
|
try {
|
|
516
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
550
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
517
551
|
const ptr0 = passArray8ToWasm0(model_data, wasm.__wbindgen_export);
|
|
518
552
|
const len0 = WASM_VECTOR_LEN;
|
|
519
553
|
wasm.wasmindexbuilder_new(retptr, ptr0, len0);
|
|
@@ -521,7 +555,7 @@ export class WasmIndexBuilder {
|
|
|
521
555
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
522
556
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
523
557
|
if (r2) {
|
|
524
|
-
throw
|
|
558
|
+
throw takeFromExternrefTable0(r1);
|
|
525
559
|
}
|
|
526
560
|
return WasmIndexBuilder.__wrap(r0);
|
|
527
561
|
} finally {
|
|
@@ -561,32 +595,33 @@ export class WasmModel {
|
|
|
561
595
|
*/
|
|
562
596
|
encode(texts, normalize) {
|
|
563
597
|
try {
|
|
564
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
598
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
599
|
+
const val2 = +normalize;
|
|
565
600
|
const ptr0 = passArrayJsValueToWasm0(texts, wasm.__wbindgen_export);
|
|
566
601
|
const len0 = WASM_VECTOR_LEN;
|
|
567
|
-
wasm.wasmmodel_encode(retptr, this.__wbg_ptr, ptr0, len0,
|
|
602
|
+
wasm.wasmmodel_encode(retptr, this.__wbg_ptr, ptr0, len0, val2);
|
|
568
603
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
569
604
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
570
605
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
571
606
|
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
572
607
|
if (r3) {
|
|
573
|
-
throw
|
|
608
|
+
throw takeFromExternrefTable0(r2);
|
|
574
609
|
}
|
|
575
|
-
var
|
|
576
|
-
wasm.
|
|
577
|
-
return
|
|
610
|
+
var v3 = getArrayF32FromWasm0(r0, r1).slice();
|
|
611
|
+
wasm.__wbindgen_export3(r0, r1 * 4, 4);
|
|
612
|
+
return v3;
|
|
578
613
|
} finally {
|
|
579
614
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
580
615
|
}
|
|
581
616
|
}
|
|
582
617
|
/**
|
|
583
618
|
* Load from a `.kjq` container: config, tokenizer and int8 tensors in one file.
|
|
584
|
-
* @param {Uint8Array} data
|
|
619
|
+
* @param {Uint8Array | number[]} data
|
|
585
620
|
* @returns {WasmModel}
|
|
586
621
|
*/
|
|
587
622
|
static from_quantized(data) {
|
|
588
623
|
try {
|
|
589
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
624
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
590
625
|
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_export);
|
|
591
626
|
const len0 = WASM_VECTOR_LEN;
|
|
592
627
|
wasm.wasmmodel_from_quantized(retptr, ptr0, len0);
|
|
@@ -594,7 +629,7 @@ export class WasmModel {
|
|
|
594
629
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
595
630
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
596
631
|
if (r2) {
|
|
597
|
-
throw
|
|
632
|
+
throw takeFromExternrefTable0(r1);
|
|
598
633
|
}
|
|
599
634
|
return WasmModel.__wrap(r0);
|
|
600
635
|
} finally {
|
|
@@ -608,29 +643,37 @@ export class WasmModel {
|
|
|
608
643
|
*/
|
|
609
644
|
static from_type(model_type) {
|
|
610
645
|
const ret = wasm.wasmmodel_from_type(model_type);
|
|
611
|
-
return
|
|
646
|
+
return ret;
|
|
612
647
|
}
|
|
613
648
|
/**
|
|
614
649
|
* Load from raw safetensors plus its config and tokenizer.
|
|
615
|
-
* @param {Uint8Array} weights_data
|
|
650
|
+
* @param {Uint8Array | number[]} weights_data
|
|
616
651
|
* @param {string} config_json
|
|
617
652
|
* @param {string} tokenizer_json
|
|
618
653
|
*/
|
|
619
654
|
constructor(weights_data, config_json, tokenizer_json) {
|
|
620
655
|
try {
|
|
621
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
656
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
657
|
+
let ptr0, len0, ptr1, len1, ptr2, len2;
|
|
658
|
+
try {
|
|
659
|
+
ptr0 = passArray8ToWasm0(weights_data, wasm.__wbindgen_export);
|
|
660
|
+
len0 = WASM_VECTOR_LEN;
|
|
661
|
+
ptr1 = passStringToWasm0(config_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
662
|
+
len1 = WASM_VECTOR_LEN;
|
|
663
|
+
ptr2 = passStringToWasm0(tokenizer_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
664
|
+
len2 = WASM_VECTOR_LEN;
|
|
665
|
+
} catch (e) {
|
|
666
|
+
if (ptr2) { wasm.__wbindgen_export3(ptr2, len2 * 1, 1); }
|
|
667
|
+
if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
|
|
668
|
+
if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
|
|
669
|
+
throw e;
|
|
670
|
+
}
|
|
628
671
|
wasm.wasmmodel_new(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
629
672
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
630
673
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
631
674
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
632
675
|
if (r2) {
|
|
633
|
-
throw
|
|
676
|
+
throw takeFromExternrefTable0(r1);
|
|
634
677
|
}
|
|
635
678
|
this.__wbg_ptr = r0;
|
|
636
679
|
WasmModelFinalization.register(this, this.__wbg_ptr, this);
|
|
@@ -670,12 +713,12 @@ export class WasmReranker {
|
|
|
670
713
|
* Load a cross-encoder from a `.kjq` container.
|
|
671
714
|
*
|
|
672
715
|
* The engine's `CrossEncoder` loads the classifier head as part of the model.
|
|
673
|
-
* @param {Uint8Array} data
|
|
716
|
+
* @param {Uint8Array | number[]} data
|
|
674
717
|
* @returns {WasmReranker}
|
|
675
718
|
*/
|
|
676
719
|
static load(data) {
|
|
677
720
|
try {
|
|
678
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
721
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
679
722
|
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_export);
|
|
680
723
|
const len0 = WASM_VECTOR_LEN;
|
|
681
724
|
wasm.wasmreranker_load(retptr, ptr0, len0);
|
|
@@ -683,7 +726,7 @@ export class WasmReranker {
|
|
|
683
726
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
684
727
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
685
728
|
if (r2) {
|
|
686
|
-
throw
|
|
729
|
+
throw takeFromExternrefTable0(r1);
|
|
687
730
|
}
|
|
688
731
|
return WasmReranker.__wrap(r0);
|
|
689
732
|
} finally {
|
|
@@ -700,19 +743,27 @@ export class WasmReranker {
|
|
|
700
743
|
*/
|
|
701
744
|
rerank(query, documents, limit) {
|
|
702
745
|
try {
|
|
703
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
704
|
-
const
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
746
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
747
|
+
const val3 = +limit;
|
|
748
|
+
let ptr0, len0, ptr1, len1;
|
|
749
|
+
try {
|
|
750
|
+
ptr0 = passStringToWasm0(query, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
751
|
+
len0 = WASM_VECTOR_LEN;
|
|
752
|
+
ptr1 = passArrayJsValueToWasm0(documents, wasm.__wbindgen_export);
|
|
753
|
+
len1 = WASM_VECTOR_LEN;
|
|
754
|
+
} catch (e) {
|
|
755
|
+
if (ptr1) { wasm.__wbindgen_export8(ptr1, len1); wasm.__wbindgen_export3(ptr1, len1 * 4, 4); }
|
|
756
|
+
if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
|
|
757
|
+
throw e;
|
|
758
|
+
}
|
|
759
|
+
wasm.wasmreranker_rerank(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, val3);
|
|
709
760
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
710
761
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
711
762
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
712
763
|
if (r2) {
|
|
713
|
-
throw
|
|
764
|
+
throw takeFromExternrefTable0(r1);
|
|
714
765
|
}
|
|
715
|
-
return
|
|
766
|
+
return takeFromExternrefTable0(r0);
|
|
716
767
|
} finally {
|
|
717
768
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
718
769
|
}
|
|
@@ -725,17 +776,24 @@ export class WasmReranker {
|
|
|
725
776
|
*/
|
|
726
777
|
score(query, document) {
|
|
727
778
|
try {
|
|
728
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
779
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
780
|
+
let ptr0, len0, ptr1, len1;
|
|
781
|
+
try {
|
|
782
|
+
ptr0 = passStringToWasm0(query, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
783
|
+
len0 = WASM_VECTOR_LEN;
|
|
784
|
+
ptr1 = passStringToWasm0(document, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
785
|
+
len1 = WASM_VECTOR_LEN;
|
|
786
|
+
} catch (e) {
|
|
787
|
+
if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
|
|
788
|
+
if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
|
|
789
|
+
throw e;
|
|
790
|
+
}
|
|
733
791
|
wasm.wasmreranker_score(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
734
792
|
var r0 = getDataViewMemory0().getFloat32(retptr + 4 * 0, true);
|
|
735
793
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
736
794
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
737
795
|
if (r2) {
|
|
738
|
-
throw
|
|
796
|
+
throw takeFromExternrefTable0(r1);
|
|
739
797
|
}
|
|
740
798
|
return r0;
|
|
741
799
|
} finally {
|
|
@@ -764,24 +822,33 @@ export class WasmSearch {
|
|
|
764
822
|
}
|
|
765
823
|
/**
|
|
766
824
|
* @param {string} text
|
|
767
|
-
* @param {Float32Array} embedding
|
|
825
|
+
* @param {Float32Array | number[]} embedding
|
|
768
826
|
* @param {string} source
|
|
769
827
|
* @param {number} chunk_index
|
|
770
828
|
*/
|
|
771
829
|
add_chunk(text, embedding, source, chunk_index) {
|
|
772
830
|
try {
|
|
773
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
774
|
-
const
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
831
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
832
|
+
const val4 = +chunk_index;
|
|
833
|
+
let ptr0, len0, ptr1, len1, ptr2, len2;
|
|
834
|
+
try {
|
|
835
|
+
ptr0 = passStringToWasm0(text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
836
|
+
len0 = WASM_VECTOR_LEN;
|
|
837
|
+
ptr1 = passArrayF32ToWasm0(embedding, wasm.__wbindgen_export);
|
|
838
|
+
len1 = WASM_VECTOR_LEN;
|
|
839
|
+
ptr2 = passStringToWasm0(source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
840
|
+
len2 = WASM_VECTOR_LEN;
|
|
841
|
+
} catch (e) {
|
|
842
|
+
if (ptr2) { wasm.__wbindgen_export3(ptr2, len2 * 1, 1); }
|
|
843
|
+
if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 4, 4); }
|
|
844
|
+
if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
|
|
845
|
+
throw e;
|
|
846
|
+
}
|
|
847
|
+
wasm.wasmsearch_add_chunk(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, val4);
|
|
781
848
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
782
849
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
783
850
|
if (r1) {
|
|
784
|
-
throw
|
|
851
|
+
throw takeFromExternrefTable0(r0);
|
|
785
852
|
}
|
|
786
853
|
} finally {
|
|
787
854
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -795,23 +862,30 @@ export class WasmSearch {
|
|
|
795
862
|
return ret >>> 0;
|
|
796
863
|
}
|
|
797
864
|
/**
|
|
798
|
-
* @param {Uint8Array} model_data
|
|
799
|
-
* @param {Uint8Array} index_data
|
|
865
|
+
* @param {Uint8Array | number[]} model_data
|
|
866
|
+
* @param {Uint8Array | number[]} index_data
|
|
800
867
|
* @returns {WasmSearch}
|
|
801
868
|
*/
|
|
802
869
|
static load(model_data, index_data) {
|
|
803
870
|
try {
|
|
804
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
871
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
872
|
+
let ptr0, len0, ptr1, len1;
|
|
873
|
+
try {
|
|
874
|
+
ptr0 = passArray8ToWasm0(model_data, wasm.__wbindgen_export);
|
|
875
|
+
len0 = WASM_VECTOR_LEN;
|
|
876
|
+
ptr1 = passArray8ToWasm0(index_data, wasm.__wbindgen_export);
|
|
877
|
+
len1 = WASM_VECTOR_LEN;
|
|
878
|
+
} catch (e) {
|
|
879
|
+
if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
|
|
880
|
+
if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
|
|
881
|
+
throw e;
|
|
882
|
+
}
|
|
809
883
|
wasm.wasmsearch_load(retptr, ptr0, len0, ptr1, len1);
|
|
810
884
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
811
885
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
812
886
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
813
887
|
if (r2) {
|
|
814
|
-
throw
|
|
888
|
+
throw takeFromExternrefTable0(r1);
|
|
815
889
|
}
|
|
816
890
|
return WasmSearch.__wrap(r0);
|
|
817
891
|
} finally {
|
|
@@ -833,17 +907,17 @@ export class WasmSearch {
|
|
|
833
907
|
*/
|
|
834
908
|
save_index() {
|
|
835
909
|
try {
|
|
836
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
910
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
837
911
|
wasm.wasmsearch_save_index(retptr, this.__wbg_ptr);
|
|
838
912
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
839
913
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
840
914
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
841
915
|
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
842
916
|
if (r3) {
|
|
843
|
-
throw
|
|
917
|
+
throw takeFromExternrefTable0(r2);
|
|
844
918
|
}
|
|
845
919
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
846
|
-
wasm.
|
|
920
|
+
wasm.__wbindgen_export3(r0, r1 * 1, 1);
|
|
847
921
|
return v1;
|
|
848
922
|
} finally {
|
|
849
923
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -856,17 +930,18 @@ export class WasmSearch {
|
|
|
856
930
|
*/
|
|
857
931
|
search(query, limit) {
|
|
858
932
|
try {
|
|
859
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
933
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
934
|
+
const val2 = +limit;
|
|
860
935
|
const ptr0 = passStringToWasm0(query, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
861
936
|
const len0 = WASM_VECTOR_LEN;
|
|
862
|
-
wasm.wasmsearch_search(retptr, this.__wbg_ptr, ptr0, len0,
|
|
937
|
+
wasm.wasmsearch_search(retptr, this.__wbg_ptr, ptr0, len0, val2);
|
|
863
938
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
864
939
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
865
940
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
866
941
|
if (r2) {
|
|
867
|
-
throw
|
|
942
|
+
throw takeFromExternrefTable0(r1);
|
|
868
943
|
}
|
|
869
|
-
return
|
|
944
|
+
return takeFromExternrefTable0(r0);
|
|
870
945
|
} finally {
|
|
871
946
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
872
947
|
}
|
|
@@ -878,17 +953,18 @@ export class WasmSearch {
|
|
|
878
953
|
*/
|
|
879
954
|
search_keywords(query, limit) {
|
|
880
955
|
try {
|
|
881
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
956
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
957
|
+
const val2 = +limit;
|
|
882
958
|
const ptr0 = passStringToWasm0(query, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
883
959
|
const len0 = WASM_VECTOR_LEN;
|
|
884
|
-
wasm.wasmsearch_search_keywords(retptr, this.__wbg_ptr, ptr0, len0,
|
|
960
|
+
wasm.wasmsearch_search_keywords(retptr, this.__wbg_ptr, ptr0, len0, val2);
|
|
885
961
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
886
962
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
887
963
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
888
964
|
if (r2) {
|
|
889
|
-
throw
|
|
965
|
+
throw takeFromExternrefTable0(r1);
|
|
890
966
|
}
|
|
891
|
-
return
|
|
967
|
+
return takeFromExternrefTable0(r0);
|
|
892
968
|
} finally {
|
|
893
969
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
894
970
|
}
|
|
@@ -900,17 +976,18 @@ export class WasmSearch {
|
|
|
900
976
|
*/
|
|
901
977
|
search_semantic(query, limit) {
|
|
902
978
|
try {
|
|
903
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
979
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
980
|
+
const val2 = +limit;
|
|
904
981
|
const ptr0 = passStringToWasm0(query, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
905
982
|
const len0 = WASM_VECTOR_LEN;
|
|
906
|
-
wasm.wasmsearch_search_semantic(retptr, this.__wbg_ptr, ptr0, len0,
|
|
983
|
+
wasm.wasmsearch_search_semantic(retptr, this.__wbg_ptr, ptr0, len0, val2);
|
|
907
984
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
908
985
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
909
986
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
910
987
|
if (r2) {
|
|
911
|
-
throw
|
|
988
|
+
throw takeFromExternrefTable0(r1);
|
|
912
989
|
}
|
|
913
|
-
return
|
|
990
|
+
return takeFromExternrefTable0(r0);
|
|
914
991
|
} finally {
|
|
915
992
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
916
993
|
}
|
|
@@ -922,17 +999,24 @@ export class WasmSearch {
|
|
|
922
999
|
*/
|
|
923
1000
|
update_file(text, source_path) {
|
|
924
1001
|
try {
|
|
925
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
1002
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
1003
|
+
let ptr0, len0, ptr1, len1;
|
|
1004
|
+
try {
|
|
1005
|
+
ptr0 = passStringToWasm0(text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1006
|
+
len0 = WASM_VECTOR_LEN;
|
|
1007
|
+
ptr1 = passStringToWasm0(source_path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1008
|
+
len1 = WASM_VECTOR_LEN;
|
|
1009
|
+
} catch (e) {
|
|
1010
|
+
if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
|
|
1011
|
+
if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
|
|
1012
|
+
throw e;
|
|
1013
|
+
}
|
|
930
1014
|
wasm.wasmsearch_update_file(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
931
1015
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
932
1016
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
933
1017
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
934
1018
|
if (r2) {
|
|
935
|
-
throw
|
|
1019
|
+
throw takeFromExternrefTable0(r1);
|
|
936
1020
|
}
|
|
937
1021
|
return r0 >>> 0;
|
|
938
1022
|
} finally {
|
|
@@ -955,66 +1039,66 @@ export function set_debug_logging(enabled) {
|
|
|
955
1039
|
function __wbg_get_imports() {
|
|
956
1040
|
const import0 = {
|
|
957
1041
|
__proto__: null,
|
|
958
|
-
|
|
1042
|
+
__wbg_Error_208446807d0d1e30: function(arg0, arg1) {
|
|
959
1043
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
960
|
-
return
|
|
1044
|
+
return ret;
|
|
961
1045
|
},
|
|
962
1046
|
__wbg_String_8564e559799eccda: function(arg0, arg1) {
|
|
963
|
-
const ret = String(
|
|
1047
|
+
const ret = String(arg1);
|
|
964
1048
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
965
1049
|
const len1 = WASM_VECTOR_LEN;
|
|
966
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
967
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1050
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
|
|
1051
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
|
|
968
1052
|
},
|
|
969
|
-
|
|
970
|
-
const ret = debugString(
|
|
1053
|
+
__wbg___wbindgen_debug_string_f249a2a76caa9a55: function(arg0, arg1) {
|
|
1054
|
+
const ret = debugString(arg1);
|
|
971
1055
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
972
1056
|
const len1 = WASM_VECTOR_LEN;
|
|
973
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
974
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1057
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
|
|
1058
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
|
|
975
1059
|
},
|
|
976
|
-
|
|
977
|
-
const ret = typeof(
|
|
1060
|
+
__wbg___wbindgen_is_function_741ff2bb612836f5: function(arg0) {
|
|
1061
|
+
const ret = typeof(arg0) === 'function';
|
|
978
1062
|
return ret;
|
|
979
1063
|
},
|
|
980
|
-
|
|
981
|
-
const val =
|
|
1064
|
+
__wbg___wbindgen_is_object_8b968c3ab8e96595: function(arg0) {
|
|
1065
|
+
const val = arg0;
|
|
982
1066
|
const ret = typeof(val) === 'object' && val !== null;
|
|
983
1067
|
return ret;
|
|
984
1068
|
},
|
|
985
|
-
|
|
986
|
-
const ret = typeof(
|
|
1069
|
+
__wbg___wbindgen_is_string_fc456fee5d3317de: function(arg0) {
|
|
1070
|
+
const ret = typeof(arg0) === 'string';
|
|
987
1071
|
return ret;
|
|
988
1072
|
},
|
|
989
|
-
|
|
990
|
-
const ret =
|
|
1073
|
+
__wbg___wbindgen_is_undefined_be5b34249ff1fc15: function(arg0) {
|
|
1074
|
+
const ret = arg0 === undefined;
|
|
991
1075
|
return ret;
|
|
992
1076
|
},
|
|
993
|
-
|
|
994
|
-
const obj =
|
|
1077
|
+
__wbg___wbindgen_string_get_7ce8eee7fd327545: function(arg0, arg1) {
|
|
1078
|
+
const obj = arg1;
|
|
995
1079
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
996
1080
|
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
997
1081
|
var len1 = WASM_VECTOR_LEN;
|
|
998
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
999
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1082
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
|
|
1083
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
|
|
1000
1084
|
},
|
|
1001
|
-
|
|
1085
|
+
__wbg___wbindgen_throw_4c88d8bf264fd984: function(arg0, arg1) {
|
|
1002
1086
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
1003
1087
|
},
|
|
1004
|
-
|
|
1005
|
-
|
|
1088
|
+
__wbg__wbg_cb_unref_09736879a3f67559: function(arg0) {
|
|
1089
|
+
arg0._wbg_cb_unref();
|
|
1006
1090
|
},
|
|
1007
|
-
|
|
1008
|
-
const ret =
|
|
1009
|
-
return
|
|
1091
|
+
__wbg_arrayBuffer_2c99a9ba14ba536c: function() { return handleError(function (arg0) {
|
|
1092
|
+
const ret = arg0.arrayBuffer();
|
|
1093
|
+
return ret;
|
|
1010
1094
|
}, arguments); },
|
|
1011
|
-
|
|
1012
|
-
const ret =
|
|
1013
|
-
return
|
|
1095
|
+
__wbg_call_a410eb4b59ed5965: function() { return handleError(function (arg0, arg1, arg2) {
|
|
1096
|
+
const ret = arg0.call(arg1, arg2);
|
|
1097
|
+
return ret;
|
|
1014
1098
|
}, arguments); },
|
|
1015
|
-
|
|
1016
|
-
const ret =
|
|
1017
|
-
return
|
|
1099
|
+
__wbg_crypto_23f565a907d30078: function(arg0) {
|
|
1100
|
+
const ret = arg0.crypto;
|
|
1101
|
+
return ret;
|
|
1018
1102
|
},
|
|
1019
1103
|
__wbg_error_757e9472f8410341: function(arg0, arg1) {
|
|
1020
1104
|
let deferred0_0;
|
|
@@ -1024,235 +1108,236 @@ function __wbg_get_imports() {
|
|
|
1024
1108
|
deferred0_1 = arg1;
|
|
1025
1109
|
console.error(getStringFromWasm0(arg0, arg1));
|
|
1026
1110
|
} finally {
|
|
1027
|
-
wasm.
|
|
1111
|
+
wasm.__wbindgen_export3(deferred0_0, deferred0_1, 1);
|
|
1028
1112
|
}
|
|
1029
1113
|
},
|
|
1030
|
-
|
|
1031
|
-
const ret =
|
|
1032
|
-
return
|
|
1114
|
+
__wbg_fetch_acbcb3bcaa94bf5e: function(arg0, arg1, arg2) {
|
|
1115
|
+
const ret = arg0.fetch(getStringFromWasm0(arg1, arg2));
|
|
1116
|
+
return ret;
|
|
1033
1117
|
},
|
|
1034
|
-
|
|
1035
|
-
const ret =
|
|
1036
|
-
return
|
|
1118
|
+
__wbg_fetch_c30fc2ed77d76a76: function(arg0, arg1, arg2) {
|
|
1119
|
+
const ret = arg0.fetch(getStringFromWasm0(arg1, arg2));
|
|
1120
|
+
return ret;
|
|
1037
1121
|
},
|
|
1038
|
-
|
|
1122
|
+
__wbg_getRandomValues_5d8c030b527203a6: function() { return handleError(function (arg0, arg1) {
|
|
1039
1123
|
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
1040
1124
|
}, arguments); },
|
|
1041
|
-
|
|
1042
|
-
|
|
1125
|
+
__wbg_getRandomValues_d2908e0b99612b91: function() { return handleError(function (arg0, arg1) {
|
|
1126
|
+
arg0.getRandomValues(arg1);
|
|
1043
1127
|
}, arguments); },
|
|
1044
|
-
|
|
1128
|
+
__wbg_instanceof_Response_5b0b4f7f1daeae51: function(arg0) {
|
|
1045
1129
|
let result;
|
|
1046
1130
|
try {
|
|
1047
|
-
result =
|
|
1131
|
+
result = arg0 instanceof Response;
|
|
1048
1132
|
} catch (_) {
|
|
1049
1133
|
result = false;
|
|
1050
1134
|
}
|
|
1051
1135
|
const ret = result;
|
|
1052
1136
|
return ret;
|
|
1053
1137
|
},
|
|
1054
|
-
|
|
1138
|
+
__wbg_instanceof_Window_5cf453f5639aa1a2: function(arg0) {
|
|
1055
1139
|
let result;
|
|
1056
1140
|
try {
|
|
1057
|
-
result =
|
|
1141
|
+
result = arg0 instanceof Window;
|
|
1058
1142
|
} catch (_) {
|
|
1059
1143
|
result = false;
|
|
1060
1144
|
}
|
|
1061
1145
|
const ret = result;
|
|
1062
1146
|
return ret;
|
|
1063
1147
|
},
|
|
1064
|
-
|
|
1148
|
+
__wbg_instanceof_WorkerGlobalScope_a8f1cd8c19b6daec: function(arg0) {
|
|
1065
1149
|
let result;
|
|
1066
1150
|
try {
|
|
1067
|
-
result =
|
|
1151
|
+
result = arg0 instanceof WorkerGlobalScope;
|
|
1068
1152
|
} catch (_) {
|
|
1069
1153
|
result = false;
|
|
1070
1154
|
}
|
|
1071
1155
|
const ret = result;
|
|
1072
1156
|
return ret;
|
|
1073
1157
|
},
|
|
1074
|
-
|
|
1075
|
-
const ret =
|
|
1158
|
+
__wbg_length_186163212ffe79c3: function(arg0) {
|
|
1159
|
+
const ret = arg0.length;
|
|
1076
1160
|
return ret;
|
|
1077
1161
|
},
|
|
1078
|
-
|
|
1079
|
-
console.log(
|
|
1162
|
+
__wbg_log_ff86bbb34c295e21: function(arg0) {
|
|
1163
|
+
console.log(arg0);
|
|
1080
1164
|
},
|
|
1081
|
-
|
|
1082
|
-
const ret =
|
|
1083
|
-
return
|
|
1165
|
+
__wbg_msCrypto_d5f06fad6bf1409b: function(arg0) {
|
|
1166
|
+
const ret = arg0.msCrypto;
|
|
1167
|
+
return ret;
|
|
1084
1168
|
},
|
|
1085
|
-
|
|
1086
|
-
const ret = new Uint8Array(
|
|
1087
|
-
return
|
|
1169
|
+
__wbg_new_13de428334042d26: function(arg0) {
|
|
1170
|
+
const ret = new Uint8Array(arg0);
|
|
1171
|
+
return ret;
|
|
1088
1172
|
},
|
|
1089
|
-
|
|
1090
|
-
const ret = new
|
|
1091
|
-
return
|
|
1173
|
+
__wbg_new_37eb45aaf5eeb820: function() {
|
|
1174
|
+
const ret = new Array();
|
|
1175
|
+
return ret;
|
|
1092
1176
|
},
|
|
1093
|
-
|
|
1177
|
+
__wbg_new_7075786089b89c5e: function() {
|
|
1094
1178
|
const ret = new Map();
|
|
1095
|
-
return
|
|
1179
|
+
return ret;
|
|
1096
1180
|
},
|
|
1097
|
-
|
|
1098
|
-
const ret = new
|
|
1099
|
-
return
|
|
1181
|
+
__wbg_new_bb74001155cb8ca8: function() {
|
|
1182
|
+
const ret = new Error();
|
|
1183
|
+
return ret;
|
|
1100
1184
|
},
|
|
1101
|
-
|
|
1102
|
-
const ret = new
|
|
1103
|
-
return
|
|
1185
|
+
__wbg_new_cd4348290afae586: function() {
|
|
1186
|
+
const ret = new Object();
|
|
1187
|
+
return ret;
|
|
1104
1188
|
},
|
|
1105
|
-
|
|
1189
|
+
__wbg_new_typed_e09da9dae6ee5935: function(arg0, arg1) {
|
|
1106
1190
|
try {
|
|
1107
1191
|
var state0 = {a: arg0, b: arg1};
|
|
1108
1192
|
var cb0 = (arg0, arg1) => {
|
|
1109
1193
|
const a = state0.a;
|
|
1110
1194
|
state0.a = 0;
|
|
1111
1195
|
try {
|
|
1112
|
-
return
|
|
1196
|
+
return __wasm_bindgen_func_elem_5769(a, state0.b, arg0, arg1);
|
|
1113
1197
|
} finally {
|
|
1114
1198
|
state0.a = a;
|
|
1115
1199
|
}
|
|
1116
1200
|
};
|
|
1117
1201
|
const ret = new Promise(cb0);
|
|
1118
|
-
return
|
|
1202
|
+
return ret;
|
|
1119
1203
|
} finally {
|
|
1120
1204
|
state0.a = 0;
|
|
1121
1205
|
}
|
|
1122
1206
|
},
|
|
1123
|
-
|
|
1207
|
+
__wbg_new_with_length_01b143a7e5dd5a3e: function(arg0) {
|
|
1124
1208
|
const ret = new Uint8Array(arg0 >>> 0);
|
|
1125
|
-
return
|
|
1209
|
+
return ret;
|
|
1126
1210
|
},
|
|
1127
|
-
|
|
1128
|
-
const ret =
|
|
1129
|
-
return
|
|
1211
|
+
__wbg_node_86166ff8ce1f2002: function(arg0) {
|
|
1212
|
+
const ret = arg0.node;
|
|
1213
|
+
return ret;
|
|
1130
1214
|
},
|
|
1131
|
-
|
|
1215
|
+
__wbg_now_463ac581d2fc7ea3: function() {
|
|
1132
1216
|
const ret = Date.now();
|
|
1133
1217
|
return ret;
|
|
1134
1218
|
},
|
|
1135
1219
|
__wbg_now_e7c6795a7f81e10f: function(arg0) {
|
|
1136
|
-
const ret =
|
|
1220
|
+
const ret = arg0.now();
|
|
1137
1221
|
return ret;
|
|
1138
1222
|
},
|
|
1139
|
-
|
|
1140
|
-
const ret =
|
|
1141
|
-
return
|
|
1223
|
+
__wbg_performance_7e4e4494fdc9d07a: function(arg0) {
|
|
1224
|
+
const ret = arg0.performance;
|
|
1225
|
+
return ret;
|
|
1142
1226
|
},
|
|
1143
|
-
|
|
1144
|
-
const ret =
|
|
1145
|
-
return
|
|
1227
|
+
__wbg_process_91f425a63f58e399: function(arg0) {
|
|
1228
|
+
const ret = arg0.process;
|
|
1229
|
+
return ret;
|
|
1146
1230
|
},
|
|
1147
|
-
|
|
1148
|
-
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1),
|
|
1231
|
+
__wbg_prototypesetcall_13162965d1fe7aa3: function(arg0, arg1, arg2) {
|
|
1232
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
1149
1233
|
},
|
|
1150
|
-
|
|
1151
|
-
const ret =
|
|
1152
|
-
return
|
|
1234
|
+
__wbg_queueMicrotask_1e8503a8a690f0a3: function(arg0) {
|
|
1235
|
+
const ret = arg0.queueMicrotask;
|
|
1236
|
+
return ret;
|
|
1153
1237
|
},
|
|
1154
|
-
|
|
1155
|
-
queueMicrotask(
|
|
1238
|
+
__wbg_queueMicrotask_4a1a4d8dd332373b: function(arg0) {
|
|
1239
|
+
queueMicrotask(arg0);
|
|
1156
1240
|
},
|
|
1157
|
-
|
|
1158
|
-
|
|
1241
|
+
__wbg_randomFillSync_34b023059e3363de: function() { return handleError(function (arg0, arg1) {
|
|
1242
|
+
arg0.randomFillSync(arg1);
|
|
1159
1243
|
}, arguments); },
|
|
1160
|
-
|
|
1244
|
+
__wbg_require_9a7d8cc2e1d275c0: function() { return handleError(function () {
|
|
1161
1245
|
const ret = module.require;
|
|
1162
|
-
return
|
|
1246
|
+
return ret;
|
|
1163
1247
|
}, arguments); },
|
|
1164
|
-
|
|
1165
|
-
const ret = Promise.resolve(
|
|
1166
|
-
return
|
|
1248
|
+
__wbg_resolve_dbf78ab4942478b0: function(arg0) {
|
|
1249
|
+
const ret = Promise.resolve(arg0);
|
|
1250
|
+
return ret;
|
|
1167
1251
|
},
|
|
1168
|
-
|
|
1169
|
-
const ret =
|
|
1170
|
-
return
|
|
1252
|
+
__wbg_set_8282f7e0d2d01336: function(arg0, arg1, arg2) {
|
|
1253
|
+
const ret = arg0.set(arg1, arg2);
|
|
1254
|
+
return ret;
|
|
1171
1255
|
},
|
|
1172
|
-
|
|
1173
|
-
|
|
1256
|
+
__wbg_set_d2d33b52458e984a: function(arg0, arg1, arg2) {
|
|
1257
|
+
arg0[arg1 >>> 0] = arg2;
|
|
1174
1258
|
},
|
|
1175
|
-
|
|
1176
|
-
|
|
1259
|
+
__wbg_set_e4b9a833d288759a: function(arg0, arg1, arg2) {
|
|
1260
|
+
arg0[arg1] = arg2;
|
|
1177
1261
|
},
|
|
1178
|
-
|
|
1179
|
-
const ret =
|
|
1262
|
+
__wbg_stack_575c4e0918581b9c: function(arg0, arg1) {
|
|
1263
|
+
const ret = arg1.stack;
|
|
1180
1264
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1181
1265
|
const len1 = WASM_VECTOR_LEN;
|
|
1182
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1183
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1266
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
|
|
1267
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
|
|
1184
1268
|
},
|
|
1185
|
-
|
|
1186
|
-
const ret = typeof
|
|
1187
|
-
return isLikeNone(ret) ? 0 :
|
|
1269
|
+
__wbg_static_accessor_GLOBAL_THIS_003ee833af9699fc: function() {
|
|
1270
|
+
const ret = typeof globalThis === 'undefined' ? undefined : globalThis;
|
|
1271
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1188
1272
|
},
|
|
1189
|
-
|
|
1190
|
-
const ret = typeof
|
|
1191
|
-
return isLikeNone(ret) ? 0 :
|
|
1273
|
+
__wbg_static_accessor_GLOBAL_e4293fb22cbe77da: function() {
|
|
1274
|
+
const ret = typeof global === 'undefined' ? undefined : global;
|
|
1275
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1192
1276
|
},
|
|
1193
|
-
|
|
1194
|
-
const ret = typeof self === 'undefined' ?
|
|
1195
|
-
return isLikeNone(ret) ? 0 :
|
|
1277
|
+
__wbg_static_accessor_SELF_53bb20457401453d: function() {
|
|
1278
|
+
const ret = typeof self === 'undefined' ? undefined : self;
|
|
1279
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1196
1280
|
},
|
|
1197
|
-
|
|
1198
|
-
const ret = typeof window === 'undefined' ?
|
|
1199
|
-
return isLikeNone(ret) ? 0 :
|
|
1281
|
+
__wbg_static_accessor_WINDOW_b5e0810bfecb7feb: function() {
|
|
1282
|
+
const ret = typeof window === 'undefined' ? undefined : window;
|
|
1283
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1200
1284
|
},
|
|
1201
|
-
|
|
1202
|
-
const ret =
|
|
1203
|
-
return
|
|
1285
|
+
__wbg_subarray_58f388a9247ac0bb: function(arg0, arg1, arg2) {
|
|
1286
|
+
const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
|
|
1287
|
+
return ret;
|
|
1204
1288
|
},
|
|
1205
|
-
|
|
1206
|
-
const ret =
|
|
1207
|
-
return
|
|
1289
|
+
__wbg_text_5240eb2c41de8292: function() { return handleError(function (arg0) {
|
|
1290
|
+
const ret = arg0.text();
|
|
1291
|
+
return ret;
|
|
1208
1292
|
}, arguments); },
|
|
1209
|
-
|
|
1210
|
-
const ret =
|
|
1211
|
-
return
|
|
1293
|
+
__wbg_then_656f253a5dd7d8ea: function(arg0, arg1, arg2) {
|
|
1294
|
+
const ret = arg0.then(arg1, arg2);
|
|
1295
|
+
return ret;
|
|
1212
1296
|
},
|
|
1213
|
-
|
|
1214
|
-
const ret =
|
|
1215
|
-
return
|
|
1297
|
+
__wbg_then_e3f7f2d365708be8: function(arg0, arg1) {
|
|
1298
|
+
const ret = arg0.then(arg1);
|
|
1299
|
+
return ret;
|
|
1216
1300
|
},
|
|
1217
|
-
|
|
1218
|
-
const ret =
|
|
1219
|
-
return
|
|
1301
|
+
__wbg_versions_6e128a981b0df859: function(arg0) {
|
|
1302
|
+
const ret = arg0.versions;
|
|
1303
|
+
return ret;
|
|
1220
1304
|
},
|
|
1221
1305
|
__wbg_wasmmodel_new: function(arg0) {
|
|
1222
1306
|
const ret = WasmModel.__wrap(arg0);
|
|
1223
|
-
return
|
|
1307
|
+
return ret;
|
|
1224
1308
|
},
|
|
1225
1309
|
__wbindgen_generic_0000000000000001: function(arg0, arg1) {
|
|
1226
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
1227
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1228
|
-
return
|
|
1310
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 2090, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
1311
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_5740);
|
|
1312
|
+
return ret;
|
|
1229
1313
|
},
|
|
1230
1314
|
__wbindgen_generic_0000000000000002: function(arg0) {
|
|
1231
1315
|
// Cast intrinsic for `F64 -> Externref`.
|
|
1232
1316
|
const ret = arg0;
|
|
1233
|
-
return
|
|
1317
|
+
return ret;
|
|
1234
1318
|
},
|
|
1235
1319
|
__wbindgen_generic_0000000000000003: function(arg0, arg1) {
|
|
1236
1320
|
// Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
|
|
1237
1321
|
const ret = getArrayU8FromWasm0(arg0, arg1);
|
|
1238
|
-
return
|
|
1322
|
+
return ret;
|
|
1239
1323
|
},
|
|
1240
1324
|
__wbindgen_generic_0000000000000004: function(arg0, arg1) {
|
|
1241
1325
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
1242
1326
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
1243
|
-
return
|
|
1327
|
+
return ret;
|
|
1244
1328
|
},
|
|
1245
1329
|
__wbindgen_generic_0000000000000005: function(arg0) {
|
|
1246
1330
|
// Cast intrinsic for `U64 -> Externref`.
|
|
1247
1331
|
const ret = BigInt.asUintN(64, arg0);
|
|
1248
|
-
return
|
|
1249
|
-
},
|
|
1250
|
-
__wbindgen_object_clone_ref: function(arg0) {
|
|
1251
|
-
const ret = getObject(arg0);
|
|
1252
|
-
return addHeapObject(ret);
|
|
1332
|
+
return ret;
|
|
1253
1333
|
},
|
|
1254
|
-
|
|
1255
|
-
|
|
1334
|
+
__wbindgen_init_externref_table: function() {
|
|
1335
|
+
const table = wasm.__wbindgen_externrefs;
|
|
1336
|
+
table.set(0, undefined);
|
|
1337
|
+
table.set(1024, undefined);
|
|
1338
|
+
table.set(1025, null);
|
|
1339
|
+
table.set(1026, true);
|
|
1340
|
+
table.set(1027, false);
|
|
1256
1341
|
},
|
|
1257
1342
|
};
|
|
1258
1343
|
return {
|
|
@@ -1261,18 +1346,18 @@ function __wbg_get_imports() {
|
|
|
1261
1346
|
};
|
|
1262
1347
|
}
|
|
1263
1348
|
|
|
1264
|
-
function
|
|
1265
|
-
wasm.
|
|
1349
|
+
function __wasm_bindgen_func_elem_5769(arg0, arg1, arg2, arg3) {
|
|
1350
|
+
wasm.__wasm_bindgen_func_elem_5769(arg0, arg1, arg2, arg3);
|
|
1266
1351
|
}
|
|
1267
1352
|
|
|
1268
|
-
function
|
|
1353
|
+
function __wasm_bindgen_func_elem_5740(arg0, arg1, arg2) {
|
|
1269
1354
|
try {
|
|
1270
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1271
|
-
wasm.
|
|
1355
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
|
|
1356
|
+
wasm.__wasm_bindgen_func_elem_5740(retptr, arg0, arg1, arg2);
|
|
1272
1357
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1273
1358
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1274
1359
|
if (r1) {
|
|
1275
|
-
throw
|
|
1360
|
+
throw takeFromExternrefTable0(r0);
|
|
1276
1361
|
}
|
|
1277
1362
|
} finally {
|
|
1278
1363
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -1301,94 +1386,72 @@ const WasmSearchFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
1301
1386
|
? { register: () => {}, unregister: () => {} }
|
|
1302
1387
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmsearch_free(ptr, 1));
|
|
1303
1388
|
|
|
1304
|
-
function
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
heap_next = heap[idx];
|
|
1308
|
-
|
|
1309
|
-
heap[idx] = obj;
|
|
1389
|
+
function addToExternrefTable0(obj) {
|
|
1390
|
+
const idx = wasm.__wbindgen_export5();
|
|
1391
|
+
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
1310
1392
|
return idx;
|
|
1311
1393
|
}
|
|
1312
1394
|
|
|
1313
|
-
function addBorrowedObject(obj) {
|
|
1314
|
-
if (stack_pointer == 1) throw new Error('out of js stack');
|
|
1315
|
-
heap[--stack_pointer] = obj;
|
|
1316
|
-
return stack_pointer;
|
|
1317
|
-
}
|
|
1318
|
-
|
|
1319
1395
|
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
1320
1396
|
? { register: () => {}, unregister: () => {} }
|
|
1321
|
-
: new FinalizationRegistry(state => wasm.
|
|
1397
|
+
: new FinalizationRegistry(state => wasm.__wbindgen_export6(state.a, state.b));
|
|
1322
1398
|
|
|
1323
1399
|
function debugString(val) {
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
return 'Object(' + JSON.stringify(val) + ')';
|
|
1376
|
-
} catch (_) {
|
|
1377
|
-
return 'Object';
|
|
1400
|
+
switch (typeof val) {
|
|
1401
|
+
// primitive types
|
|
1402
|
+
case 'number':
|
|
1403
|
+
case 'boolean':
|
|
1404
|
+
case 'undefined':
|
|
1405
|
+
return `${val}`;
|
|
1406
|
+
case 'string':
|
|
1407
|
+
return JSON.stringify(val);
|
|
1408
|
+
case 'bigint':
|
|
1409
|
+
return `${val}n`;
|
|
1410
|
+
case 'symbol':
|
|
1411
|
+
return val.description !== undefined
|
|
1412
|
+
? `Symbol(${val.description})`
|
|
1413
|
+
: 'Symbol';
|
|
1414
|
+
case 'function':
|
|
1415
|
+
return typeof val.name === 'string' && val.name !== ''
|
|
1416
|
+
? `Function(${val.name})`
|
|
1417
|
+
: 'Function';
|
|
1418
|
+
case 'object': {
|
|
1419
|
+
if (val === null) {
|
|
1420
|
+
return 'null';
|
|
1421
|
+
}
|
|
1422
|
+
// objects
|
|
1423
|
+
if (Array.isArray(val)) {
|
|
1424
|
+
return '[' + Array.from(val, debugString).join(', ') + ']';
|
|
1425
|
+
}
|
|
1426
|
+
// errors
|
|
1427
|
+
if (val instanceof Error) {
|
|
1428
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
1429
|
+
}
|
|
1430
|
+
|
|
1431
|
+
const toStringOutput = toString.call(val);
|
|
1432
|
+
// Test for built-in
|
|
1433
|
+
const className = /\[object ([^\]]+)\]/.exec(toStringOutput)?.[1];
|
|
1434
|
+
|
|
1435
|
+
// Failed to match the standard '[object ClassName]'
|
|
1436
|
+
if (className === undefined) {
|
|
1437
|
+
return toStringOutput;
|
|
1438
|
+
}
|
|
1439
|
+
if (className === 'Object') {
|
|
1440
|
+
// we're a user defined class or Object
|
|
1441
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
1442
|
+
// easier than looping through ownProperties of `val`.
|
|
1443
|
+
try {
|
|
1444
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
1445
|
+
} catch (_) {
|
|
1446
|
+
return 'Object';
|
|
1447
|
+
}
|
|
1448
|
+
}
|
|
1449
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
1450
|
+
return className;
|
|
1378
1451
|
}
|
|
1452
|
+
// Per MDN: 'This list of values is exhaustive.'
|
|
1453
|
+
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof#description
|
|
1379
1454
|
}
|
|
1380
|
-
// errors
|
|
1381
|
-
if (val instanceof Error) {
|
|
1382
|
-
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
1383
|
-
}
|
|
1384
|
-
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
1385
|
-
return className;
|
|
1386
|
-
}
|
|
1387
|
-
|
|
1388
|
-
function dropObject(idx) {
|
|
1389
|
-
if (idx < 1028) return;
|
|
1390
|
-
heap[idx] = heap_next;
|
|
1391
|
-
heap_next = idx;
|
|
1392
1455
|
}
|
|
1393
1456
|
|
|
1394
1457
|
function getArrayF32FromWasm0(ptr, len) {
|
|
@@ -1401,8 +1464,9 @@ function getArrayJsValueFromWasm0(ptr, len) {
|
|
|
1401
1464
|
const mem = getDataViewMemory0();
|
|
1402
1465
|
const result = [];
|
|
1403
1466
|
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
1404
|
-
result.push(
|
|
1467
|
+
result.push(wasm.__wbindgen_externrefs.get(mem.getUint32(i, true)));
|
|
1405
1468
|
}
|
|
1469
|
+
wasm.__wbindgen_export8(ptr, len);
|
|
1406
1470
|
return result;
|
|
1407
1471
|
}
|
|
1408
1472
|
|
|
@@ -1428,7 +1492,8 @@ function getFloat32ArrayMemory0() {
|
|
|
1428
1492
|
}
|
|
1429
1493
|
|
|
1430
1494
|
function getStringFromWasm0(ptr, len) {
|
|
1431
|
-
|
|
1495
|
+
ptr = ptr >>> 0;
|
|
1496
|
+
return decodeText(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
1432
1497
|
}
|
|
1433
1498
|
|
|
1434
1499
|
let cachedUint8ArrayMemory0 = null;
|
|
@@ -1439,21 +1504,15 @@ function getUint8ArrayMemory0() {
|
|
|
1439
1504
|
return cachedUint8ArrayMemory0;
|
|
1440
1505
|
}
|
|
1441
1506
|
|
|
1442
|
-
function getObject(idx) { return heap[idx]; }
|
|
1443
|
-
|
|
1444
1507
|
function handleError(f, args) {
|
|
1445
1508
|
try {
|
|
1446
1509
|
return f.apply(this, args);
|
|
1447
1510
|
} catch (e) {
|
|
1448
|
-
|
|
1511
|
+
const idx = addToExternrefTable0(e);
|
|
1512
|
+
wasm.__wbindgen_export4(idx);
|
|
1449
1513
|
}
|
|
1450
1514
|
}
|
|
1451
1515
|
|
|
1452
|
-
let heap = new Array(1024).fill(undefined);
|
|
1453
|
-
heap.push(undefined, null, true, false);
|
|
1454
|
-
|
|
1455
|
-
let heap_next = heap.length;
|
|
1456
|
-
|
|
1457
1516
|
function isLikeNone(x) {
|
|
1458
1517
|
return x === undefined || x === null;
|
|
1459
1518
|
}
|
|
@@ -1477,7 +1536,7 @@ function makeMutClosure(arg0, arg1, f) {
|
|
|
1477
1536
|
};
|
|
1478
1537
|
real._wbg_cb_unref = () => {
|
|
1479
1538
|
if (--state.cnt === 0) {
|
|
1480
|
-
wasm.
|
|
1539
|
+
wasm.__wbindgen_export6(state.a, state.b);
|
|
1481
1540
|
state.a = 0;
|
|
1482
1541
|
CLOSURE_DTORS.unregister(state);
|
|
1483
1542
|
}
|
|
@@ -1502,9 +1561,9 @@ function passArrayF32ToWasm0(arg, malloc) {
|
|
|
1502
1561
|
|
|
1503
1562
|
function passArrayJsValueToWasm0(array, malloc) {
|
|
1504
1563
|
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
1505
|
-
const mem = getDataViewMemory0();
|
|
1506
1564
|
for (let i = 0; i < array.length; i++) {
|
|
1507
|
-
|
|
1565
|
+
const add = addToExternrefTable0(array[i]);
|
|
1566
|
+
getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
|
|
1508
1567
|
}
|
|
1509
1568
|
WASM_VECTOR_LEN = array.length;
|
|
1510
1569
|
return ptr;
|
|
@@ -1547,26 +1606,24 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
1547
1606
|
return ptr;
|
|
1548
1607
|
}
|
|
1549
1608
|
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
dropObject(idx);
|
|
1555
|
-
return ret;
|
|
1609
|
+
function takeFromExternrefTable0(idx) {
|
|
1610
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
1611
|
+
wasm.__wbindgen_export7(idx);
|
|
1612
|
+
return value;
|
|
1556
1613
|
}
|
|
1557
1614
|
|
|
1558
|
-
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true
|
|
1615
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
|
|
1559
1616
|
cachedTextDecoder.decode();
|
|
1560
1617
|
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
1561
1618
|
let numBytesDecoded = 0;
|
|
1562
|
-
function decodeText(
|
|
1563
|
-
numBytesDecoded +=
|
|
1619
|
+
function decodeText(bytes) {
|
|
1620
|
+
numBytesDecoded += bytes.length;
|
|
1564
1621
|
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
1565
|
-
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true
|
|
1622
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
|
|
1566
1623
|
cachedTextDecoder.decode();
|
|
1567
|
-
numBytesDecoded =
|
|
1624
|
+
numBytesDecoded = bytes.length;
|
|
1568
1625
|
}
|
|
1569
|
-
return cachedTextDecoder.decode(
|
|
1626
|
+
return cachedTextDecoder.decode(bytes);
|
|
1570
1627
|
}
|
|
1571
1628
|
|
|
1572
1629
|
const cachedTextEncoder = new TextEncoder();
|
|
@@ -1655,9 +1712,17 @@ function initSync(module) {
|
|
|
1655
1712
|
return __wbg_finalize_init(instance, module);
|
|
1656
1713
|
}
|
|
1657
1714
|
|
|
1715
|
+
let __wbg_init_promise;
|
|
1658
1716
|
async function __wbg_init(module_or_path) {
|
|
1659
1717
|
if (wasm !== undefined) return wasm;
|
|
1718
|
+
if (__wbg_init_promise === undefined) {
|
|
1719
|
+
__wbg_init_promise = __wbg_init_once(module_or_path);
|
|
1720
|
+
__wbg_init_promise.catch(() => { __wbg_init_promise = undefined; });
|
|
1721
|
+
}
|
|
1722
|
+
return __wbg_init_promise;
|
|
1723
|
+
}
|
|
1660
1724
|
|
|
1725
|
+
async function __wbg_init_once(module_or_path) {
|
|
1661
1726
|
|
|
1662
1727
|
if (module_or_path !== undefined) {
|
|
1663
1728
|
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|