@danielmcsheehy/isopleth-wasm 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1223 @@
1
+ /* @ts-self-types="./isopleth_wasm.d.ts" */
2
+
3
+ /**
4
+ * Aggregate `values` by integer `codes` (`< 0` excluded) into `nGroups`
5
+ * buckets with a Plot-style reducer name (`count`, `sum`, `mean`, `p90`, ...).
6
+ * Pass an empty `values` array to reduce over a constant 1 (counts).
7
+ * @param {Int32Array} codes
8
+ * @param {Float64Array} values
9
+ * @param {number} n_groups
10
+ * @param {string} reducer
11
+ * @returns {Float64Array}
12
+ */
13
+ export function aggregate(codes, values, n_groups, reducer) {
14
+ try {
15
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
16
+ const ptr0 = passArray32ToWasm0(codes, wasm.__wbindgen_export);
17
+ const len0 = WASM_VECTOR_LEN;
18
+ const ptr1 = passArrayF64ToWasm0(values, wasm.__wbindgen_export);
19
+ const len1 = WASM_VECTOR_LEN;
20
+ const ptr2 = passStringToWasm0(reducer, wasm.__wbindgen_export, wasm.__wbindgen_export2);
21
+ const len2 = WASM_VECTOR_LEN;
22
+ wasm.aggregate(retptr, ptr0, len0, ptr1, len1, n_groups, ptr2, len2);
23
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
24
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
25
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
26
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
27
+ if (r3) {
28
+ throw takeObject(r2);
29
+ }
30
+ var v4 = getArrayF64FromWasm0(r0, r1).slice();
31
+ wasm.__wbindgen_export4(r0, r1 * 8, 8);
32
+ return v4;
33
+ } finally {
34
+ wasm.__wbindgen_add_to_stack_pointer(16);
35
+ }
36
+ }
37
+
38
+ /**
39
+ * @param {Float64Array} y
40
+ * @param {any} opts
41
+ * @returns {any}
42
+ */
43
+ export function anomalies(y, opts) {
44
+ try {
45
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
46
+ const ptr0 = passArrayF64ToWasm0(y, wasm.__wbindgen_export);
47
+ const len0 = WASM_VECTOR_LEN;
48
+ wasm.anomalies(retptr, ptr0, len0, addHeapObject(opts));
49
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
50
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
51
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
52
+ if (r2) {
53
+ throw takeObject(r1);
54
+ }
55
+ return takeObject(r0);
56
+ } finally {
57
+ wasm.__wbindgen_add_to_stack_pointer(16);
58
+ }
59
+ }
60
+
61
+ /**
62
+ * Bin index per value (`-1` = NaN / out of domain).
63
+ * @param {Float64Array} values
64
+ * @param {Float64Array} edges
65
+ * @returns {Int32Array}
66
+ */
67
+ export function binAssign(values, edges) {
68
+ try {
69
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
70
+ const ptr0 = passArrayF64ToWasm0(values, wasm.__wbindgen_export);
71
+ const len0 = WASM_VECTOR_LEN;
72
+ const ptr1 = passArrayF64ToWasm0(edges, wasm.__wbindgen_export);
73
+ const len1 = WASM_VECTOR_LEN;
74
+ wasm.binAssign(retptr, ptr0, len0, ptr1, len1);
75
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
76
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
77
+ var v3 = getArrayI32FromWasm0(r0, r1).slice();
78
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
79
+ return v3;
80
+ } finally {
81
+ wasm.__wbindgen_add_to_stack_pointer(16);
82
+ }
83
+ }
84
+
85
+ /**
86
+ * Bin edges for `values`. `rule` is one of `auto`, `sturges`, `scott`,
87
+ * `freedman-diaconis`, or `count` (then `count` is the tick-count hint).
88
+ * @param {Float64Array} values
89
+ * @param {string} rule
90
+ * @param {number} count
91
+ * @returns {Float64Array}
92
+ */
93
+ export function binThresholds(values, rule, count) {
94
+ try {
95
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
96
+ const ptr0 = passArrayF64ToWasm0(values, wasm.__wbindgen_export);
97
+ const len0 = WASM_VECTOR_LEN;
98
+ const ptr1 = passStringToWasm0(rule, wasm.__wbindgen_export, wasm.__wbindgen_export2);
99
+ const len1 = WASM_VECTOR_LEN;
100
+ wasm.binThresholds(retptr, ptr0, len0, ptr1, len1, count);
101
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
102
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
103
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
104
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
105
+ if (r3) {
106
+ throw takeObject(r2);
107
+ }
108
+ var v3 = getArrayF64FromWasm0(r0, r1).slice();
109
+ wasm.__wbindgen_export4(r0, r1 * 8, 8);
110
+ return v3;
111
+ } finally {
112
+ wasm.__wbindgen_add_to_stack_pointer(16);
113
+ }
114
+ }
115
+
116
+ /**
117
+ * Bin edges at every multiple of `step` spanning the data.
118
+ * @param {Float64Array} values
119
+ * @param {number} step
120
+ * @returns {Float64Array}
121
+ */
122
+ export function binThresholdsInterval(values, step) {
123
+ try {
124
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
125
+ const ptr0 = passArrayF64ToWasm0(values, wasm.__wbindgen_export);
126
+ const len0 = WASM_VECTOR_LEN;
127
+ wasm.binThresholdsInterval(retptr, ptr0, len0, step);
128
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
129
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
130
+ var v2 = getArrayF64FromWasm0(r0, r1).slice();
131
+ wasm.__wbindgen_export4(r0, r1 * 8, 8);
132
+ return v2;
133
+ } finally {
134
+ wasm.__wbindgen_add_to_stack_pointer(16);
135
+ }
136
+ }
137
+
138
+ /**
139
+ * @param {Int32Array} codes
140
+ * @param {Float64Array} values
141
+ * @param {number} n_groups
142
+ * @param {string | null} [reducer]
143
+ * @param {number | null} [sensitivity]
144
+ * @param {number | null} [threshold]
145
+ * @returns {any}
146
+ */
147
+ export function categoryOutliers(codes, values, n_groups, reducer, sensitivity, threshold) {
148
+ try {
149
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
150
+ const ptr0 = passArray32ToWasm0(codes, wasm.__wbindgen_export);
151
+ const len0 = WASM_VECTOR_LEN;
152
+ const ptr1 = passArrayF64ToWasm0(values, wasm.__wbindgen_export);
153
+ const len1 = WASM_VECTOR_LEN;
154
+ var ptr2 = isLikeNone(reducer) ? 0 : passStringToWasm0(reducer, wasm.__wbindgen_export, wasm.__wbindgen_export2);
155
+ var len2 = WASM_VECTOR_LEN;
156
+ wasm.categoryOutliers(retptr, ptr0, len0, ptr1, len1, n_groups, ptr2, len2, !isLikeNone(sensitivity), isLikeNone(sensitivity) ? 0 : sensitivity, !isLikeNone(threshold), isLikeNone(threshold) ? 0 : threshold);
157
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
158
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
159
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
160
+ if (r2) {
161
+ throw takeObject(r1);
162
+ }
163
+ return takeObject(r0);
164
+ } finally {
165
+ wasm.__wbindgen_add_to_stack_pointer(16);
166
+ }
167
+ }
168
+
169
+ /**
170
+ * @param {Float64Array} y
171
+ * @param {any} opts
172
+ * @returns {any}
173
+ */
174
+ export function changepoints(y, opts) {
175
+ try {
176
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
177
+ const ptr0 = passArrayF64ToWasm0(y, wasm.__wbindgen_export);
178
+ const len0 = WASM_VECTOR_LEN;
179
+ wasm.changepoints(retptr, ptr0, len0, addHeapObject(opts));
180
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
181
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
182
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
183
+ if (r2) {
184
+ throw takeObject(r1);
185
+ }
186
+ return takeObject(r0);
187
+ } finally {
188
+ wasm.__wbindgen_add_to_stack_pointer(16);
189
+ }
190
+ }
191
+
192
+ /**
193
+ * @param {Int32Array} a
194
+ * @param {number} na
195
+ * @param {Int32Array} b
196
+ * @param {number} nb
197
+ * @returns {Int32Array}
198
+ */
199
+ export function combineCodes(a, na, b, nb) {
200
+ try {
201
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
202
+ const ptr0 = passArray32ToWasm0(a, wasm.__wbindgen_export);
203
+ const len0 = WASM_VECTOR_LEN;
204
+ const ptr1 = passArray32ToWasm0(b, wasm.__wbindgen_export);
205
+ const len1 = WASM_VECTOR_LEN;
206
+ wasm.combineCodes(retptr, ptr0, len0, na, ptr1, len1, nb);
207
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
208
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
209
+ var v3 = getArrayI32FromWasm0(r0, r1).slice();
210
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
211
+ return v3;
212
+ } finally {
213
+ wasm.__wbindgen_add_to_stack_pointer(16);
214
+ }
215
+ }
216
+
217
+ /**
218
+ * @param {Int32Array} codes
219
+ * @param {number} n_groups
220
+ * @returns {Float64Array}
221
+ */
222
+ export function counts(codes, n_groups) {
223
+ try {
224
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
225
+ const ptr0 = passArray32ToWasm0(codes, wasm.__wbindgen_export);
226
+ const len0 = WASM_VECTOR_LEN;
227
+ wasm.counts(retptr, ptr0, len0, n_groups);
228
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
229
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
230
+ var v2 = getArrayF64FromWasm0(r0, r1).slice();
231
+ wasm.__wbindgen_export4(r0, r1 * 8, 8);
232
+ return v2;
233
+ } finally {
234
+ wasm.__wbindgen_add_to_stack_pointer(16);
235
+ }
236
+ }
237
+
238
+ /**
239
+ * @param {Float64Array} values
240
+ * @returns {Float64Array}
241
+ */
242
+ export function cumsum(values) {
243
+ try {
244
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
245
+ const ptr0 = passArrayF64ToWasm0(values, wasm.__wbindgen_export);
246
+ const len0 = WASM_VECTOR_LEN;
247
+ wasm.cumsum(retptr, ptr0, len0);
248
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
249
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
250
+ var v2 = getArrayF64FromWasm0(r0, r1).slice();
251
+ wasm.__wbindgen_export4(r0, r1 * 8, 8);
252
+ return v2;
253
+ } finally {
254
+ wasm.__wbindgen_add_to_stack_pointer(16);
255
+ }
256
+ }
257
+
258
+ /**
259
+ * @param {Float64Array} y
260
+ * @param {number} period
261
+ * @returns {any}
262
+ */
263
+ export function decompose(y, period) {
264
+ try {
265
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
266
+ const ptr0 = passArrayF64ToWasm0(y, wasm.__wbindgen_export);
267
+ const len0 = WASM_VECTOR_LEN;
268
+ wasm.decompose(retptr, ptr0, len0, period);
269
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
270
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
271
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
272
+ if (r2) {
273
+ throw takeObject(r1);
274
+ }
275
+ return takeObject(r0);
276
+ } finally {
277
+ wasm.__wbindgen_add_to_stack_pointer(16);
278
+ }
279
+ }
280
+
281
+ /**
282
+ * @param {Float64Array} values
283
+ * @returns {Float64Array}
284
+ */
285
+ export function diff(values) {
286
+ try {
287
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
288
+ const ptr0 = passArrayF64ToWasm0(values, wasm.__wbindgen_export);
289
+ const len0 = WASM_VECTOR_LEN;
290
+ wasm.diff(retptr, ptr0, len0);
291
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
292
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
293
+ var v2 = getArrayF64FromWasm0(r0, r1).slice();
294
+ wasm.__wbindgen_export4(r0, r1 * 8, 8);
295
+ return v2;
296
+ } finally {
297
+ wasm.__wbindgen_add_to_stack_pointer(16);
298
+ }
299
+ }
300
+
301
+ /**
302
+ * @param {Float64Array} y
303
+ * @param {any} opts
304
+ * @returns {any}
305
+ */
306
+ export function forecast(y, opts) {
307
+ try {
308
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
309
+ const ptr0 = passArrayF64ToWasm0(y, wasm.__wbindgen_export);
310
+ const len0 = WASM_VECTOR_LEN;
311
+ wasm.forecast(retptr, ptr0, len0, addHeapObject(opts));
312
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
313
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
314
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
315
+ if (r2) {
316
+ throw takeObject(r1);
317
+ }
318
+ return takeObject(r0);
319
+ } finally {
320
+ wasm.__wbindgen_add_to_stack_pointer(16);
321
+ }
322
+ }
323
+
324
+ /**
325
+ * @param {Float64Array} counts
326
+ * @param {number | null} [sensitivity]
327
+ * @param {number | null} [threshold]
328
+ * @returns {any}
329
+ */
330
+ export function frequencyOutliers(counts, sensitivity, threshold) {
331
+ try {
332
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
333
+ const ptr0 = passArrayF64ToWasm0(counts, wasm.__wbindgen_export);
334
+ const len0 = WASM_VECTOR_LEN;
335
+ wasm.frequencyOutliers(retptr, ptr0, len0, !isLikeNone(sensitivity), isLikeNone(sensitivity) ? 0 : sensitivity, !isLikeNone(threshold), isLikeNone(threshold) ? 0 : threshold);
336
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
337
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
338
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
339
+ if (r2) {
340
+ throw takeObject(r1);
341
+ }
342
+ return takeObject(r0);
343
+ } finally {
344
+ wasm.__wbindgen_add_to_stack_pointer(16);
345
+ }
346
+ }
347
+
348
+ /**
349
+ * @param {Float64Array} values
350
+ * @param {string} method
351
+ * @returns {Float64Array}
352
+ */
353
+ export function impute(values, method) {
354
+ try {
355
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
356
+ const ptr0 = passArrayF64ToWasm0(values, wasm.__wbindgen_export);
357
+ const len0 = WASM_VECTOR_LEN;
358
+ const ptr1 = passStringToWasm0(method, wasm.__wbindgen_export, wasm.__wbindgen_export2);
359
+ const len1 = WASM_VECTOR_LEN;
360
+ wasm.impute(retptr, ptr0, len0, ptr1, len1);
361
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
362
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
363
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
364
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
365
+ if (r3) {
366
+ throw takeObject(r2);
367
+ }
368
+ var v3 = getArrayF64FromWasm0(r0, r1).slice();
369
+ wasm.__wbindgen_export4(r0, r1 * 8, 8);
370
+ return v3;
371
+ } finally {
372
+ wasm.__wbindgen_add_to_stack_pointer(16);
373
+ }
374
+ }
375
+
376
+ /**
377
+ * @param {Float64Array} values
378
+ * @param {string} basis
379
+ * @returns {Float64Array}
380
+ */
381
+ export function normalize(values, basis) {
382
+ try {
383
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
384
+ const ptr0 = passArrayF64ToWasm0(values, wasm.__wbindgen_export);
385
+ const len0 = WASM_VECTOR_LEN;
386
+ const ptr1 = passStringToWasm0(basis, wasm.__wbindgen_export, wasm.__wbindgen_export2);
387
+ const len1 = WASM_VECTOR_LEN;
388
+ wasm.normalize(retptr, ptr0, len0, ptr1, len1);
389
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
390
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
391
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
392
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
393
+ if (r3) {
394
+ throw takeObject(r2);
395
+ }
396
+ var v3 = getArrayF64FromWasm0(r0, r1).slice();
397
+ wasm.__wbindgen_export4(r0, r1 * 8, 8);
398
+ return v3;
399
+ } finally {
400
+ wasm.__wbindgen_add_to_stack_pointer(16);
401
+ }
402
+ }
403
+
404
+ /**
405
+ * @param {Float64Array} values
406
+ * @returns {Float64Array}
407
+ */
408
+ export function pctChange(values) {
409
+ try {
410
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
411
+ const ptr0 = passArrayF64ToWasm0(values, wasm.__wbindgen_export);
412
+ const len0 = WASM_VECTOR_LEN;
413
+ wasm.pctChange(retptr, ptr0, len0);
414
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
415
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
416
+ var v2 = getArrayF64FromWasm0(r0, r1).slice();
417
+ wasm.__wbindgen_export4(r0, r1 * 8, 8);
418
+ return v2;
419
+ } finally {
420
+ wasm.__wbindgen_add_to_stack_pointer(16);
421
+ }
422
+ }
423
+
424
+ /**
425
+ * @param {Float64Array} values
426
+ * @returns {Float64Array}
427
+ */
428
+ export function quantileRank(values) {
429
+ try {
430
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
431
+ const ptr0 = passArrayF64ToWasm0(values, wasm.__wbindgen_export);
432
+ const len0 = WASM_VECTOR_LEN;
433
+ wasm.quantileRank(retptr, ptr0, len0);
434
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
435
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
436
+ var v2 = getArrayF64FromWasm0(r0, r1).slice();
437
+ wasm.__wbindgen_export4(r0, r1 * 8, 8);
438
+ return v2;
439
+ } finally {
440
+ wasm.__wbindgen_add_to_stack_pointer(16);
441
+ }
442
+ }
443
+
444
+ /**
445
+ * @param {Float64Array} values
446
+ * @returns {Float64Array}
447
+ */
448
+ export function rank(values) {
449
+ try {
450
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
451
+ const ptr0 = passArrayF64ToWasm0(values, wasm.__wbindgen_export);
452
+ const len0 = WASM_VECTOR_LEN;
453
+ wasm.rank(retptr, ptr0, len0);
454
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
455
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
456
+ var v2 = getArrayF64FromWasm0(r0, r1).slice();
457
+ wasm.__wbindgen_export4(r0, r1 * 8, 8);
458
+ return v2;
459
+ } finally {
460
+ wasm.__wbindgen_add_to_stack_pointer(16);
461
+ }
462
+ }
463
+
464
+ /**
465
+ * @param {Float64Array} y
466
+ * @param {any} opts
467
+ * @returns {any}
468
+ */
469
+ export function seasonality(y, opts) {
470
+ try {
471
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
472
+ const ptr0 = passArrayF64ToWasm0(y, wasm.__wbindgen_export);
473
+ const len0 = WASM_VECTOR_LEN;
474
+ wasm.seasonality(retptr, ptr0, len0, addHeapObject(opts));
475
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
476
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
477
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
478
+ if (r2) {
479
+ throw takeObject(r1);
480
+ }
481
+ return takeObject(r0);
482
+ } finally {
483
+ wasm.__wbindgen_add_to_stack_pointer(16);
484
+ }
485
+ }
486
+
487
+ /**
488
+ * `series` is a flat row-major `Float64Array` of `nSeries × len` values.
489
+ * @param {Float64Array} series
490
+ * @param {number} n_series
491
+ * @param {string} method
492
+ * @param {number | null} [sensitivity]
493
+ * @returns {any}
494
+ */
495
+ export function seriesOutliers(series, n_series, method, sensitivity) {
496
+ try {
497
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
498
+ const ptr0 = passArrayF64ToWasm0(series, wasm.__wbindgen_export);
499
+ const len0 = WASM_VECTOR_LEN;
500
+ const ptr1 = passStringToWasm0(method, wasm.__wbindgen_export, wasm.__wbindgen_export2);
501
+ const len1 = WASM_VECTOR_LEN;
502
+ wasm.seriesOutliers(retptr, ptr0, len0, n_series, ptr1, len1, !isLikeNone(sensitivity), isLikeNone(sensitivity) ? 0 : sensitivity);
503
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
504
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
505
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
506
+ if (r2) {
507
+ throw takeObject(r1);
508
+ }
509
+ return takeObject(r0);
510
+ } finally {
511
+ wasm.__wbindgen_add_to_stack_pointer(16);
512
+ }
513
+ }
514
+
515
+ export function start() {
516
+ wasm.start();
517
+ }
518
+
519
+ /**
520
+ * `d3.ticks` port, exposed so axes and bins agree.
521
+ * @param {number} start
522
+ * @param {number} stop
523
+ * @param {number} count
524
+ * @returns {Float64Array}
525
+ */
526
+ export function ticks(start, stop, count) {
527
+ try {
528
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
529
+ wasm.ticks(retptr, start, stop, count);
530
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
531
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
532
+ var v1 = getArrayF64FromWasm0(r0, r1).slice();
533
+ wasm.__wbindgen_export4(r0, r1 * 8, 8);
534
+ return v1;
535
+ } finally {
536
+ wasm.__wbindgen_add_to_stack_pointer(16);
537
+ }
538
+ }
539
+
540
+ /**
541
+ * @param {Float64Array} x
542
+ * @param {Float64Array} y
543
+ * @param {string} method
544
+ * @returns {any}
545
+ */
546
+ export function trend(x, y, method) {
547
+ try {
548
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
549
+ const ptr0 = passArrayF64ToWasm0(x, wasm.__wbindgen_export);
550
+ const len0 = WASM_VECTOR_LEN;
551
+ const ptr1 = passArrayF64ToWasm0(y, wasm.__wbindgen_export);
552
+ const len1 = WASM_VECTOR_LEN;
553
+ const ptr2 = passStringToWasm0(method, wasm.__wbindgen_export, wasm.__wbindgen_export2);
554
+ const len2 = WASM_VECTOR_LEN;
555
+ wasm.trend(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
556
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
557
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
558
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
559
+ if (r2) {
560
+ throw takeObject(r1);
561
+ }
562
+ return takeObject(r0);
563
+ } finally {
564
+ wasm.__wbindgen_add_to_stack_pointer(16);
565
+ }
566
+ }
567
+
568
+ /**
569
+ * @returns {string}
570
+ */
571
+ export function version() {
572
+ let deferred1_0;
573
+ let deferred1_1;
574
+ try {
575
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
576
+ wasm.version(retptr);
577
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
578
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
579
+ deferred1_0 = r0;
580
+ deferred1_1 = r1;
581
+ return getStringFromWasm0(r0, r1);
582
+ } finally {
583
+ wasm.__wbindgen_add_to_stack_pointer(16);
584
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
585
+ }
586
+ }
587
+
588
+ /**
589
+ * Rolling window. `anchor` ∈ `start|middle|end`; `reduce` is a reducer name or
590
+ * `difference` / `ratio`.
591
+ * @param {Float64Array} values
592
+ * @param {number} k
593
+ * @param {string} anchor
594
+ * @param {string} reduce
595
+ * @param {boolean} strict
596
+ * @returns {Float64Array}
597
+ */
598
+ function window2(values, k, anchor, reduce, strict) {
599
+ try {
600
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
601
+ const ptr0 = passArrayF64ToWasm0(values, wasm.__wbindgen_export);
602
+ const len0 = WASM_VECTOR_LEN;
603
+ const ptr1 = passStringToWasm0(anchor, wasm.__wbindgen_export, wasm.__wbindgen_export2);
604
+ const len1 = WASM_VECTOR_LEN;
605
+ const ptr2 = passStringToWasm0(reduce, wasm.__wbindgen_export, wasm.__wbindgen_export2);
606
+ const len2 = WASM_VECTOR_LEN;
607
+ wasm.window(retptr, ptr0, len0, k, ptr1, len1, ptr2, len2, strict);
608
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
609
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
610
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
611
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
612
+ if (r3) {
613
+ throw takeObject(r2);
614
+ }
615
+ var v4 = getArrayF64FromWasm0(r0, r1).slice();
616
+ wasm.__wbindgen_export4(r0, r1 * 8, 8);
617
+ return v4;
618
+ } finally {
619
+ wasm.__wbindgen_add_to_stack_pointer(16);
620
+ }
621
+ }
622
+ export { window2 as window }
623
+ function __wbg_get_imports() {
624
+ const import0 = {
625
+ __proto__: null,
626
+ __wbg_Error_30c8987f7c2ed4e2: function(arg0, arg1) {
627
+ const ret = Error(getStringFromWasm0(arg0, arg1));
628
+ return addHeapObject(ret);
629
+ },
630
+ __wbg_Number_14af1003b8dd5ead: function(arg0) {
631
+ const ret = Number(getObject(arg0));
632
+ return ret;
633
+ },
634
+ __wbg_String_8564e559799eccda: function(arg0, arg1) {
635
+ const ret = String(getObject(arg1));
636
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
637
+ const len1 = WASM_VECTOR_LEN;
638
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
639
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
640
+ },
641
+ __wbg___wbindgen_bigint_get_as_i64_a2383202b9353e4c: function(arg0, arg1) {
642
+ const v = getObject(arg1);
643
+ const ret = typeof(v) === 'bigint' ? v : undefined;
644
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
645
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
646
+ },
647
+ __wbg___wbindgen_boolean_get_5b446f51afd21013: function(arg0) {
648
+ const v = getObject(arg0);
649
+ const ret = typeof(v) === 'boolean' ? v : undefined;
650
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
651
+ },
652
+ __wbg___wbindgen_debug_string_4687d8d8c2017d52: function(arg0, arg1) {
653
+ const ret = debugString(getObject(arg1));
654
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
655
+ const len1 = WASM_VECTOR_LEN;
656
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
657
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
658
+ },
659
+ __wbg___wbindgen_in_92f62ee1427d9e49: function(arg0, arg1) {
660
+ const ret = getObject(arg0) in getObject(arg1);
661
+ return ret;
662
+ },
663
+ __wbg___wbindgen_is_bigint_b123553bed3bb382: function(arg0) {
664
+ const ret = typeof(getObject(arg0)) === 'bigint';
665
+ return ret;
666
+ },
667
+ __wbg___wbindgen_is_function_1f9d30630b8b1d3d: function(arg0) {
668
+ const ret = typeof(getObject(arg0)) === 'function';
669
+ return ret;
670
+ },
671
+ __wbg___wbindgen_is_null_e343b7d08827ba72: function(arg0) {
672
+ const ret = getObject(arg0) === null;
673
+ return ret;
674
+ },
675
+ __wbg___wbindgen_is_object_3c45d4f2dde4e749: function(arg0) {
676
+ const val = getObject(arg0);
677
+ const ret = typeof(val) === 'object' && val !== null;
678
+ return ret;
679
+ },
680
+ __wbg___wbindgen_is_string_90b56bc79aad6f6c: function(arg0) {
681
+ const ret = typeof(getObject(arg0)) === 'string';
682
+ return ret;
683
+ },
684
+ __wbg___wbindgen_is_undefined_8865fb403f8fe9d8: function(arg0) {
685
+ const ret = getObject(arg0) === undefined;
686
+ return ret;
687
+ },
688
+ __wbg___wbindgen_jsval_eq_02babf21faa37971: function(arg0, arg1) {
689
+ const ret = getObject(arg0) === getObject(arg1);
690
+ return ret;
691
+ },
692
+ __wbg___wbindgen_jsval_loose_eq_677f21e468d6b461: function(arg0, arg1) {
693
+ const ret = getObject(arg0) == getObject(arg1);
694
+ return ret;
695
+ },
696
+ __wbg___wbindgen_number_get_2e0e7dee9f701a71: function(arg0, arg1) {
697
+ const obj = getObject(arg1);
698
+ const ret = typeof(obj) === 'number' ? obj : undefined;
699
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
700
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
701
+ },
702
+ __wbg___wbindgen_string_get_0380ccaa2f57f0d9: function(arg0, arg1) {
703
+ const obj = getObject(arg1);
704
+ const ret = typeof(obj) === 'string' ? obj : undefined;
705
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
706
+ var len1 = WASM_VECTOR_LEN;
707
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
708
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
709
+ },
710
+ __wbg___wbindgen_throw_41e9ee4f547fc59a: function(arg0, arg1) {
711
+ throw new Error(getStringFromWasm0(arg0, arg1));
712
+ },
713
+ __wbg_call_187d372bd5fdd4aa: function() { return handleError(function (arg0, arg1, arg2) {
714
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
715
+ return addHeapObject(ret);
716
+ }, arguments); },
717
+ __wbg_crypto_38df2bab126b63dc: function(arg0) {
718
+ const ret = getObject(arg0).crypto;
719
+ return addHeapObject(ret);
720
+ },
721
+ __wbg_error_757e9472f8410341: function(arg0, arg1) {
722
+ let deferred0_0;
723
+ let deferred0_1;
724
+ try {
725
+ deferred0_0 = arg0;
726
+ deferred0_1 = arg1;
727
+ console.error(getStringFromWasm0(arg0, arg1));
728
+ } finally {
729
+ wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
730
+ }
731
+ },
732
+ __wbg_getRandomValues_c44a50d8cfdaebeb: function() { return handleError(function (arg0, arg1) {
733
+ getObject(arg0).getRandomValues(getObject(arg1));
734
+ }, arguments); },
735
+ __wbg_get_with_ref_key_6412cf3094599694: function(arg0, arg1) {
736
+ const ret = getObject(arg0)[getObject(arg1)];
737
+ return addHeapObject(ret);
738
+ },
739
+ __wbg_instanceof_ArrayBuffer_a99f175873e5d9b8: function(arg0) {
740
+ let result;
741
+ try {
742
+ result = getObject(arg0) instanceof ArrayBuffer;
743
+ } catch (_) {
744
+ result = false;
745
+ }
746
+ const ret = result;
747
+ return ret;
748
+ },
749
+ __wbg_instanceof_Uint8Array_828cef2aaacafc31: function(arg0) {
750
+ let result;
751
+ try {
752
+ result = getObject(arg0) instanceof Uint8Array;
753
+ } catch (_) {
754
+ result = false;
755
+ }
756
+ const ret = result;
757
+ return ret;
758
+ },
759
+ __wbg_isSafeInteger_717808ad6a54bd9e: function(arg0) {
760
+ const ret = Number.isSafeInteger(getObject(arg0));
761
+ return ret;
762
+ },
763
+ __wbg_length_7f3c00c40364105e: function(arg0) {
764
+ const ret = getObject(arg0).length;
765
+ return ret;
766
+ },
767
+ __wbg_msCrypto_bd5a034af96bcba6: function(arg0) {
768
+ const ret = getObject(arg0).msCrypto;
769
+ return addHeapObject(ret);
770
+ },
771
+ __wbg_new_1dbf7428bba60a42: function(arg0) {
772
+ const ret = new Uint8Array(getObject(arg0));
773
+ return addHeapObject(ret);
774
+ },
775
+ __wbg_new_227d7c05414eb861: function() {
776
+ const ret = new Error();
777
+ return addHeapObject(ret);
778
+ },
779
+ __wbg_new_617a8cdb8bb1130e: function() {
780
+ const ret = new Object();
781
+ return addHeapObject(ret);
782
+ },
783
+ __wbg_new_ee2291f50781bf1d: function() {
784
+ const ret = new Array();
785
+ return addHeapObject(ret);
786
+ },
787
+ __wbg_new_with_length_3da0ad195f6f63ba: function(arg0) {
788
+ const ret = new Uint8Array(arg0 >>> 0);
789
+ return addHeapObject(ret);
790
+ },
791
+ __wbg_node_84ea875411254db1: function(arg0) {
792
+ const ret = getObject(arg0).node;
793
+ return addHeapObject(ret);
794
+ },
795
+ __wbg_process_44c7a14e11e9f69e: function(arg0) {
796
+ const ret = getObject(arg0).process;
797
+ return addHeapObject(ret);
798
+ },
799
+ __wbg_prototypesetcall_bc27214492979395: function(arg0, arg1, arg2) {
800
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
801
+ },
802
+ __wbg_randomFillSync_6c25eac9869eb53c: function() { return handleError(function (arg0, arg1) {
803
+ getObject(arg0).randomFillSync(takeObject(arg1));
804
+ }, arguments); },
805
+ __wbg_require_b4edbdcf3e2a1ef0: function() { return handleError(function () {
806
+ const ret = module.require;
807
+ return addHeapObject(ret);
808
+ }, arguments); },
809
+ __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
810
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
811
+ },
812
+ __wbg_set_bea140a88be9b277: function(arg0, arg1, arg2) {
813
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
814
+ },
815
+ __wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
816
+ const ret = getObject(arg1).stack;
817
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
818
+ const len1 = WASM_VECTOR_LEN;
819
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
820
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
821
+ },
822
+ __wbg_static_accessor_GLOBAL_266715b9d96ba635: function() {
823
+ const ret = typeof global === 'undefined' ? null : global;
824
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
825
+ },
826
+ __wbg_static_accessor_GLOBAL_THIS_10fb7dc1ae063179: function() {
827
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
828
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
829
+ },
830
+ __wbg_static_accessor_SELF_0b583911f537483a: function() {
831
+ const ret = typeof self === 'undefined' ? null : self;
832
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
833
+ },
834
+ __wbg_static_accessor_WINDOW_d7f903d1508cbdc4: function() {
835
+ const ret = typeof window === 'undefined' ? null : window;
836
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
837
+ },
838
+ __wbg_subarray_002b94d5e13d1411: function(arg0, arg1, arg2) {
839
+ const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
840
+ return addHeapObject(ret);
841
+ },
842
+ __wbg_versions_276b2795b1c6a219: function(arg0) {
843
+ const ret = getObject(arg0).versions;
844
+ return addHeapObject(ret);
845
+ },
846
+ __wbindgen_generic_0000000000000001: function(arg0) {
847
+ // Cast intrinsic for `F64 -> Externref`.
848
+ const ret = arg0;
849
+ return addHeapObject(ret);
850
+ },
851
+ __wbindgen_generic_0000000000000002: function(arg0, arg1) {
852
+ // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
853
+ const ret = getArrayU8FromWasm0(arg0, arg1);
854
+ return addHeapObject(ret);
855
+ },
856
+ __wbindgen_generic_0000000000000003: function(arg0, arg1) {
857
+ // Cast intrinsic for `Ref(String) -> Externref`.
858
+ const ret = getStringFromWasm0(arg0, arg1);
859
+ return addHeapObject(ret);
860
+ },
861
+ __wbindgen_generic_0000000000000004: function(arg0) {
862
+ // Cast intrinsic for `U64 -> Externref`.
863
+ const ret = BigInt.asUintN(64, arg0);
864
+ return addHeapObject(ret);
865
+ },
866
+ __wbindgen_object_clone_ref: function(arg0) {
867
+ const ret = getObject(arg0);
868
+ return addHeapObject(ret);
869
+ },
870
+ __wbindgen_object_drop_ref: function(arg0) {
871
+ takeObject(arg0);
872
+ },
873
+ };
874
+ return {
875
+ __proto__: null,
876
+ "./isopleth_wasm_bg.js": import0,
877
+ };
878
+ }
879
+
880
+ function addHeapObject(obj) {
881
+ if (heap_next === heap.length) heap.push(heap.length + 1);
882
+ const idx = heap_next;
883
+ heap_next = heap[idx];
884
+
885
+ heap[idx] = obj;
886
+ return idx;
887
+ }
888
+
889
+ function debugString(val) {
890
+ // primitive types
891
+ const type = typeof val;
892
+ if (type == 'number' || type == 'boolean' || val == null) {
893
+ return `${val}`;
894
+ }
895
+ if (type == 'string') {
896
+ return `"${val}"`;
897
+ }
898
+ if (type == 'symbol') {
899
+ const description = val.description;
900
+ if (description == null) {
901
+ return 'Symbol';
902
+ } else {
903
+ return `Symbol(${description})`;
904
+ }
905
+ }
906
+ if (type == 'function') {
907
+ const name = val.name;
908
+ if (typeof name == 'string' && name.length > 0) {
909
+ return `Function(${name})`;
910
+ } else {
911
+ return 'Function';
912
+ }
913
+ }
914
+ // objects
915
+ if (Array.isArray(val)) {
916
+ const length = val.length;
917
+ let debug = '[';
918
+ if (length > 0) {
919
+ debug += debugString(val[0]);
920
+ }
921
+ for(let i = 1; i < length; i++) {
922
+ debug += ', ' + debugString(val[i]);
923
+ }
924
+ debug += ']';
925
+ return debug;
926
+ }
927
+ // Test for built-in
928
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
929
+ let className;
930
+ if (builtInMatches && builtInMatches.length > 1) {
931
+ className = builtInMatches[1];
932
+ } else {
933
+ // Failed to match the standard '[object ClassName]'
934
+ return toString.call(val);
935
+ }
936
+ if (className == 'Object') {
937
+ // we're a user defined class or Object
938
+ // JSON.stringify avoids problems with cycles, and is generally much
939
+ // easier than looping through ownProperties of `val`.
940
+ try {
941
+ return 'Object(' + JSON.stringify(val) + ')';
942
+ } catch (_) {
943
+ return 'Object';
944
+ }
945
+ }
946
+ // errors
947
+ if (val instanceof Error) {
948
+ return `${val.name}: ${val.message}\n${val.stack}`;
949
+ }
950
+ // TODO we could test for more things here, like `Set`s and `Map`s.
951
+ return className;
952
+ }
953
+
954
+ function dropObject(idx) {
955
+ if (idx < 1028) return;
956
+ heap[idx] = heap_next;
957
+ heap_next = idx;
958
+ }
959
+
960
+ function getArrayF64FromWasm0(ptr, len) {
961
+ ptr = ptr >>> 0;
962
+ return getFloat64ArrayMemory0().subarray(ptr / 8, ptr / 8 + len);
963
+ }
964
+
965
+ function getArrayI32FromWasm0(ptr, len) {
966
+ ptr = ptr >>> 0;
967
+ return getInt32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
968
+ }
969
+
970
+ function getArrayU8FromWasm0(ptr, len) {
971
+ ptr = ptr >>> 0;
972
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
973
+ }
974
+
975
+ let cachedDataViewMemory0 = null;
976
+ function getDataViewMemory0() {
977
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
978
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
979
+ }
980
+ return cachedDataViewMemory0;
981
+ }
982
+
983
+ let cachedFloat64ArrayMemory0 = null;
984
+ function getFloat64ArrayMemory0() {
985
+ if (cachedFloat64ArrayMemory0 === null || cachedFloat64ArrayMemory0.byteLength === 0) {
986
+ cachedFloat64ArrayMemory0 = new Float64Array(wasm.memory.buffer);
987
+ }
988
+ return cachedFloat64ArrayMemory0;
989
+ }
990
+
991
+ let cachedInt32ArrayMemory0 = null;
992
+ function getInt32ArrayMemory0() {
993
+ if (cachedInt32ArrayMemory0 === null || cachedInt32ArrayMemory0.byteLength === 0) {
994
+ cachedInt32ArrayMemory0 = new Int32Array(wasm.memory.buffer);
995
+ }
996
+ return cachedInt32ArrayMemory0;
997
+ }
998
+
999
+ function getStringFromWasm0(ptr, len) {
1000
+ return decodeText(ptr >>> 0, len);
1001
+ }
1002
+
1003
+ let cachedUint32ArrayMemory0 = null;
1004
+ function getUint32ArrayMemory0() {
1005
+ if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
1006
+ cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
1007
+ }
1008
+ return cachedUint32ArrayMemory0;
1009
+ }
1010
+
1011
+ let cachedUint8ArrayMemory0 = null;
1012
+ function getUint8ArrayMemory0() {
1013
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
1014
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
1015
+ }
1016
+ return cachedUint8ArrayMemory0;
1017
+ }
1018
+
1019
+ function getObject(idx) { return heap[idx]; }
1020
+
1021
+ function handleError(f, args) {
1022
+ try {
1023
+ return f.apply(this, args);
1024
+ } catch (e) {
1025
+ wasm.__wbindgen_export3(addHeapObject(e));
1026
+ }
1027
+ }
1028
+
1029
+ let heap = new Array(1024).fill(undefined);
1030
+ heap.push(undefined, null, true, false);
1031
+
1032
+ let heap_next = heap.length;
1033
+
1034
+ function isLikeNone(x) {
1035
+ return x === undefined || x === null;
1036
+ }
1037
+
1038
+ function passArray32ToWasm0(arg, malloc) {
1039
+ const ptr = malloc(arg.length * 4, 4) >>> 0;
1040
+ getUint32ArrayMemory0().set(arg, ptr / 4);
1041
+ WASM_VECTOR_LEN = arg.length;
1042
+ return ptr;
1043
+ }
1044
+
1045
+ function passArrayF64ToWasm0(arg, malloc) {
1046
+ const ptr = malloc(arg.length * 8, 8) >>> 0;
1047
+ getFloat64ArrayMemory0().set(arg, ptr / 8);
1048
+ WASM_VECTOR_LEN = arg.length;
1049
+ return ptr;
1050
+ }
1051
+
1052
+ function passStringToWasm0(arg, malloc, realloc) {
1053
+ if (realloc === undefined) {
1054
+ const buf = cachedTextEncoder.encode(arg);
1055
+ const ptr = malloc(buf.length, 1) >>> 0;
1056
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
1057
+ WASM_VECTOR_LEN = buf.length;
1058
+ return ptr;
1059
+ }
1060
+
1061
+ let len = arg.length;
1062
+ let ptr = malloc(len, 1) >>> 0;
1063
+
1064
+ const mem = getUint8ArrayMemory0();
1065
+
1066
+ let offset = 0;
1067
+
1068
+ for (; offset < len; offset++) {
1069
+ const code = arg.charCodeAt(offset);
1070
+ if (code > 0x7F) break;
1071
+ mem[ptr + offset] = code;
1072
+ }
1073
+ if (offset !== len) {
1074
+ if (offset !== 0) {
1075
+ arg = arg.slice(offset);
1076
+ }
1077
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
1078
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
1079
+ const ret = cachedTextEncoder.encodeInto(arg, view);
1080
+
1081
+ offset += ret.written;
1082
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
1083
+ }
1084
+
1085
+ WASM_VECTOR_LEN = offset;
1086
+ return ptr;
1087
+ }
1088
+
1089
+ function takeObject(idx) {
1090
+ const ret = getObject(idx);
1091
+ dropObject(idx);
1092
+ return ret;
1093
+ }
1094
+
1095
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
1096
+ cachedTextDecoder.decode();
1097
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
1098
+ let numBytesDecoded = 0;
1099
+ function decodeText(ptr, len) {
1100
+ numBytesDecoded += len;
1101
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
1102
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
1103
+ cachedTextDecoder.decode();
1104
+ numBytesDecoded = len;
1105
+ }
1106
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
1107
+ }
1108
+
1109
+ const cachedTextEncoder = new TextEncoder();
1110
+
1111
+ if (!('encodeInto' in cachedTextEncoder)) {
1112
+ cachedTextEncoder.encodeInto = function (arg, view) {
1113
+ const buf = cachedTextEncoder.encode(arg);
1114
+ view.set(buf);
1115
+ return {
1116
+ read: arg.length,
1117
+ written: buf.length
1118
+ };
1119
+ };
1120
+ }
1121
+
1122
+ let WASM_VECTOR_LEN = 0;
1123
+
1124
+ let wasmModule, wasmInstance, wasm;
1125
+ function __wbg_finalize_init(instance, module) {
1126
+ wasmInstance = instance;
1127
+ wasm = instance.exports;
1128
+ wasmModule = module;
1129
+ cachedDataViewMemory0 = null;
1130
+ cachedFloat64ArrayMemory0 = null;
1131
+ cachedInt32ArrayMemory0 = null;
1132
+ cachedUint32ArrayMemory0 = null;
1133
+ cachedUint8ArrayMemory0 = null;
1134
+ wasm.__wbindgen_start();
1135
+ return wasm;
1136
+ }
1137
+
1138
+ async function __wbg_load(module, imports) {
1139
+ if (typeof Response === 'function' && module instanceof Response) {
1140
+ if (!module.ok) {
1141
+ throw new Error(`failed to fetch Wasm: ${module.status} ${module.statusText} fetching '${module.url}'`);
1142
+ }
1143
+
1144
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
1145
+ try {
1146
+ return await WebAssembly.instantiateStreaming(module, imports);
1147
+ } catch (e) {
1148
+ const validResponse = expectedResponseType(module.type);
1149
+
1150
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
1151
+ 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);
1152
+
1153
+ } else { throw e; }
1154
+ }
1155
+ }
1156
+
1157
+ const bytes = await module.arrayBuffer();
1158
+ return await WebAssembly.instantiate(bytes, imports);
1159
+ } else {
1160
+ const instance = await WebAssembly.instantiate(module, imports);
1161
+
1162
+ if (instance instanceof WebAssembly.Instance) {
1163
+ return { instance, module };
1164
+ } else {
1165
+ return instance;
1166
+ }
1167
+ }
1168
+
1169
+ function expectedResponseType(type) {
1170
+ switch (type) {
1171
+ case 'basic': case 'cors': case 'default': return true;
1172
+ }
1173
+ return false;
1174
+ }
1175
+ }
1176
+
1177
+ function initSync(module) {
1178
+ if (wasm !== undefined) return wasm;
1179
+
1180
+
1181
+ if (module !== undefined) {
1182
+ if (Object.getPrototypeOf(module) === Object.prototype) {
1183
+ ({module} = module)
1184
+ } else {
1185
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
1186
+ }
1187
+ }
1188
+
1189
+ const imports = __wbg_get_imports();
1190
+ if (!(module instanceof WebAssembly.Module)) {
1191
+ module = new WebAssembly.Module(module);
1192
+ }
1193
+ const instance = new WebAssembly.Instance(module, imports);
1194
+ return __wbg_finalize_init(instance, module);
1195
+ }
1196
+
1197
+ async function __wbg_init(module_or_path) {
1198
+ if (wasm !== undefined) return wasm;
1199
+
1200
+
1201
+ if (module_or_path !== undefined) {
1202
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
1203
+ ({module_or_path} = module_or_path)
1204
+ } else {
1205
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
1206
+ }
1207
+ }
1208
+
1209
+ if (module_or_path === undefined) {
1210
+ module_or_path = new URL('isopleth_wasm_bg.wasm', import.meta.url);
1211
+ }
1212
+ const imports = __wbg_get_imports();
1213
+
1214
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
1215
+ module_or_path = fetch(module_or_path);
1216
+ }
1217
+
1218
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
1219
+
1220
+ return __wbg_finalize_init(instance, module);
1221
+ }
1222
+
1223
+ export { initSync, __wbg_init as default };