@splatwalk/core 0.3.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,947 @@
1
+ let wasm;
2
+
3
+ function addToExternrefTable0(obj) {
4
+ const idx = wasm.__externref_table_alloc();
5
+ wasm.__wbindgen_externrefs.set(idx, obj);
6
+ return idx;
7
+ }
8
+
9
+ function debugString(val) {
10
+ // primitive types
11
+ const type = typeof val;
12
+ if (type == 'number' || type == 'boolean' || val == null) {
13
+ return `${val}`;
14
+ }
15
+ if (type == 'string') {
16
+ return `"${val}"`;
17
+ }
18
+ if (type == 'symbol') {
19
+ const description = val.description;
20
+ if (description == null) {
21
+ return 'Symbol';
22
+ } else {
23
+ return `Symbol(${description})`;
24
+ }
25
+ }
26
+ if (type == 'function') {
27
+ const name = val.name;
28
+ if (typeof name == 'string' && name.length > 0) {
29
+ return `Function(${name})`;
30
+ } else {
31
+ return 'Function';
32
+ }
33
+ }
34
+ // objects
35
+ if (Array.isArray(val)) {
36
+ const length = val.length;
37
+ let debug = '[';
38
+ if (length > 0) {
39
+ debug += debugString(val[0]);
40
+ }
41
+ for(let i = 1; i < length; i++) {
42
+ debug += ', ' + debugString(val[i]);
43
+ }
44
+ debug += ']';
45
+ return debug;
46
+ }
47
+ // Test for built-in
48
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
49
+ let className;
50
+ if (builtInMatches && builtInMatches.length > 1) {
51
+ className = builtInMatches[1];
52
+ } else {
53
+ // Failed to match the standard '[object ClassName]'
54
+ return toString.call(val);
55
+ }
56
+ if (className == 'Object') {
57
+ // we're a user defined class or Object
58
+ // JSON.stringify avoids problems with cycles, and is generally much
59
+ // easier than looping through ownProperties of `val`.
60
+ try {
61
+ return 'Object(' + JSON.stringify(val) + ')';
62
+ } catch (_) {
63
+ return 'Object';
64
+ }
65
+ }
66
+ // errors
67
+ if (val instanceof Error) {
68
+ return `${val.name}: ${val.message}\n${val.stack}`;
69
+ }
70
+ // TODO we could test for more things here, like `Set`s and `Map`s.
71
+ return className;
72
+ }
73
+
74
+ function getArrayU8FromWasm0(ptr, len) {
75
+ ptr = ptr >>> 0;
76
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
77
+ }
78
+
79
+ let cachedDataViewMemory0 = null;
80
+ function getDataViewMemory0() {
81
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
82
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
83
+ }
84
+ return cachedDataViewMemory0;
85
+ }
86
+
87
+ let cachedFloat32ArrayMemory0 = null;
88
+ function getFloat32ArrayMemory0() {
89
+ if (cachedFloat32ArrayMemory0 === null || cachedFloat32ArrayMemory0.byteLength === 0) {
90
+ cachedFloat32ArrayMemory0 = new Float32Array(wasm.memory.buffer);
91
+ }
92
+ return cachedFloat32ArrayMemory0;
93
+ }
94
+
95
+ function getStringFromWasm0(ptr, len) {
96
+ ptr = ptr >>> 0;
97
+ return decodeText(ptr, len);
98
+ }
99
+
100
+ let cachedUint32ArrayMemory0 = null;
101
+ function getUint32ArrayMemory0() {
102
+ if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
103
+ cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
104
+ }
105
+ return cachedUint32ArrayMemory0;
106
+ }
107
+
108
+ let cachedUint8ArrayMemory0 = null;
109
+ function getUint8ArrayMemory0() {
110
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
111
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
112
+ }
113
+ return cachedUint8ArrayMemory0;
114
+ }
115
+
116
+ function handleError(f, args) {
117
+ try {
118
+ return f.apply(this, args);
119
+ } catch (e) {
120
+ const idx = addToExternrefTable0(e);
121
+ wasm.__wbindgen_exn_store(idx);
122
+ }
123
+ }
124
+
125
+ function isLikeNone(x) {
126
+ return x === undefined || x === null;
127
+ }
128
+
129
+ function passArray32ToWasm0(arg, malloc) {
130
+ const ptr = malloc(arg.length * 4, 4) >>> 0;
131
+ getUint32ArrayMemory0().set(arg, ptr / 4);
132
+ WASM_VECTOR_LEN = arg.length;
133
+ return ptr;
134
+ }
135
+
136
+ function passArray8ToWasm0(arg, malloc) {
137
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
138
+ getUint8ArrayMemory0().set(arg, ptr / 1);
139
+ WASM_VECTOR_LEN = arg.length;
140
+ return ptr;
141
+ }
142
+
143
+ function passArrayF32ToWasm0(arg, malloc) {
144
+ const ptr = malloc(arg.length * 4, 4) >>> 0;
145
+ getFloat32ArrayMemory0().set(arg, ptr / 4);
146
+ WASM_VECTOR_LEN = arg.length;
147
+ return ptr;
148
+ }
149
+
150
+ function passStringToWasm0(arg, malloc, realloc) {
151
+ if (realloc === undefined) {
152
+ const buf = cachedTextEncoder.encode(arg);
153
+ const ptr = malloc(buf.length, 1) >>> 0;
154
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
155
+ WASM_VECTOR_LEN = buf.length;
156
+ return ptr;
157
+ }
158
+
159
+ let len = arg.length;
160
+ let ptr = malloc(len, 1) >>> 0;
161
+
162
+ const mem = getUint8ArrayMemory0();
163
+
164
+ let offset = 0;
165
+
166
+ for (; offset < len; offset++) {
167
+ const code = arg.charCodeAt(offset);
168
+ if (code > 0x7F) break;
169
+ mem[ptr + offset] = code;
170
+ }
171
+ if (offset !== len) {
172
+ if (offset !== 0) {
173
+ arg = arg.slice(offset);
174
+ }
175
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
176
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
177
+ const ret = cachedTextEncoder.encodeInto(arg, view);
178
+
179
+ offset += ret.written;
180
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
181
+ }
182
+
183
+ WASM_VECTOR_LEN = offset;
184
+ return ptr;
185
+ }
186
+
187
+ function takeFromExternrefTable0(idx) {
188
+ const value = wasm.__wbindgen_externrefs.get(idx);
189
+ wasm.__externref_table_dealloc(idx);
190
+ return value;
191
+ }
192
+
193
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
194
+ cachedTextDecoder.decode();
195
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
196
+ let numBytesDecoded = 0;
197
+ function decodeText(ptr, len) {
198
+ numBytesDecoded += len;
199
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
200
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
201
+ cachedTextDecoder.decode();
202
+ numBytesDecoded = len;
203
+ }
204
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
205
+ }
206
+
207
+ const cachedTextEncoder = new TextEncoder();
208
+
209
+ if (!('encodeInto' in cachedTextEncoder)) {
210
+ cachedTextEncoder.encodeInto = function (arg, view) {
211
+ const buf = cachedTextEncoder.encode(arg);
212
+ view.set(buf);
213
+ return {
214
+ read: arg.length,
215
+ written: buf.length
216
+ };
217
+ }
218
+ }
219
+
220
+ let WASM_VECTOR_LEN = 0;
221
+
222
+ /**
223
+ * Extract a triangulated room-floor mesh entirely in WASM: the binary-side
224
+ * equivalent of the TypeScript FAST NAV floor path. Builds the 2.5D walkable
225
+ * ground field, selects the seed-nearest connected floor component (with a
226
+ * relaxed-mask and largest-island fallback), trims stray cells, and triangulates
227
+ * the result. Runs an adaptive recovery ladder (`settings.recovery`, or a
228
+ * built-in default) and returns the same failure reasons as the TS path
229
+ * (`no_component` / `too_small` / `empty_mesh`). Set `settings.emit_glb` to also
230
+ * receive GLB bytes.
231
+ * @param {Uint8Array} data
232
+ * @param {any} settings
233
+ * @returns {any}
234
+ */
235
+ export function build_room_floor_mesh(data, settings) {
236
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
237
+ const len0 = WASM_VECTOR_LEN;
238
+ const ret = wasm.build_room_floor_mesh(ptr0, len0, settings);
239
+ if (ret[2]) {
240
+ throw takeFromExternrefTable0(ret[1]);
241
+ }
242
+ return takeFromExternrefTable0(ret[0]);
243
+ }
244
+
245
+ /**
246
+ * @param {Uint8Array} data
247
+ * @param {any} settings
248
+ * @returns {any}
249
+ */
250
+ export function build_walkable_ground_field(data, settings) {
251
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
252
+ const len0 = WASM_VECTOR_LEN;
253
+ const ret = wasm.build_walkable_ground_field(ptr0, len0, settings);
254
+ if (ret[2]) {
255
+ throw takeFromExternrefTable0(ret[1]);
256
+ }
257
+ return takeFromExternrefTable0(ret[0]);
258
+ }
259
+
260
+ /**
261
+ * @param {Uint8Array} data
262
+ * @param {any} settings
263
+ * @returns {any}
264
+ */
265
+ export function convert_splat_to_mesh(data, settings) {
266
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
267
+ const len0 = WASM_VECTOR_LEN;
268
+ const ret = wasm.convert_splat_to_mesh(ptr0, len0, settings);
269
+ if (ret[2]) {
270
+ throw takeFromExternrefTable0(ret[1]);
271
+ }
272
+ return takeFromExternrefTable0(ret[0]);
273
+ }
274
+
275
+ /**
276
+ * @param {Uint8Array} data
277
+ * @param {any} settings
278
+ * @returns {any}
279
+ */
280
+ export function convert_splat_to_navmesh_basis(data, settings) {
281
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
282
+ const len0 = WASM_VECTOR_LEN;
283
+ const ret = wasm.convert_splat_to_navmesh_basis(ptr0, len0, settings);
284
+ if (ret[2]) {
285
+ throw takeFromExternrefTable0(ret[1]);
286
+ }
287
+ return takeFromExternrefTable0(ret[0]);
288
+ }
289
+
290
+ /**
291
+ * Convert a `.ply`/`.spz` splat into a single (non-LOD) SOG v2 bundle:
292
+ * a `meta.json` plus raw RGBA planes for lossless WebP encoding.
293
+ * @param {Uint8Array} data
294
+ * @param {any} settings
295
+ * @returns {any}
296
+ */
297
+ export function convert_to_sog(data, settings) {
298
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
299
+ const len0 = WASM_VECTOR_LEN;
300
+ const ret = wasm.convert_to_sog(ptr0, len0, settings);
301
+ if (ret[2]) {
302
+ throw takeFromExternrefTable0(ret[1]);
303
+ }
304
+ return takeFromExternrefTable0(ret[0]);
305
+ }
306
+
307
+ /**
308
+ * Export the canonical FAST NAV floor-field preset as a settings object so a
309
+ * binary-only integrator can pass it straight to `build_walkable_ground_field`
310
+ * / `build_room_floor_mesh` (merged with their own per-scene `rotation`,
311
+ * `flip_y`, `collision_seed`, and optional `region_*`) instead of copying a
312
+ * TypeScript-only constant. `build_room_floor_mesh` already applies this preset
313
+ * as its base layer automatically.
314
+ * @returns {any}
315
+ */
316
+ export function fast_nav_preset() {
317
+ const ret = wasm.fast_nav_preset();
318
+ if (ret[2]) {
319
+ throw takeFromExternrefTable0(ret[1]);
320
+ }
321
+ return takeFromExternrefTable0(ret[0]);
322
+ }
323
+
324
+ /**
325
+ * @param {Uint8Array} data
326
+ * @param {any} settings
327
+ * @returns {any}
328
+ */
329
+ export function get_splat_bounds(data, settings) {
330
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
331
+ const len0 = WASM_VECTOR_LEN;
332
+ const ret = wasm.get_splat_bounds(ptr0, len0, settings);
333
+ if (ret[2]) {
334
+ throw takeFromExternrefTable0(ret[1]);
335
+ }
336
+ return takeFromExternrefTable0(ret[0]);
337
+ }
338
+
339
+ /**
340
+ * @returns {string}
341
+ */
342
+ export function init_splatwalk() {
343
+ let deferred1_0;
344
+ let deferred1_1;
345
+ try {
346
+ const ret = wasm.init_splatwalk();
347
+ deferred1_0 = ret[0];
348
+ deferred1_1 = ret[1];
349
+ return getStringFromWasm0(ret[0], ret[1]);
350
+ } finally {
351
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
352
+ }
353
+ }
354
+
355
+ /**
356
+ * Serialize a positions + indices triangle mesh into minimal binary glTF (GLB)
357
+ * bytes (no materials/normals). Lets a binary integrator turn vertex/index
358
+ * buffers into GLB without standing up a 3D engine per call. `positions` are xyz
359
+ * triplets; `indices` are `u32` triangle indices.
360
+ * @param {Float32Array} positions
361
+ * @param {Uint32Array} indices
362
+ * @returns {Uint8Array}
363
+ */
364
+ export function mesh_to_glb(positions, indices) {
365
+ const ptr0 = passArrayF32ToWasm0(positions, wasm.__wbindgen_malloc);
366
+ const len0 = WASM_VECTOR_LEN;
367
+ const ptr1 = passArray32ToWasm0(indices, wasm.__wbindgen_malloc);
368
+ const len1 = WASM_VECTOR_LEN;
369
+ const ret = wasm.mesh_to_glb(ptr0, len0, ptr1, len1);
370
+ if (ret[3]) {
371
+ throw takeFromExternrefTable0(ret[2]);
372
+ }
373
+ var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
374
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
375
+ return v3;
376
+ }
377
+
378
+ /**
379
+ * Reference FAST NAV agent defaults (metres) used by the browser path. Exposed
380
+ * so binary-only integrators don't transcribe them from the docs.
381
+ * @returns {any}
382
+ */
383
+ export function recast_agent_defaults() {
384
+ const ret = wasm.recast_agent_defaults();
385
+ if (ret[2]) {
386
+ throw takeFromExternrefTable0(ret[1]);
387
+ }
388
+ return takeFromExternrefTable0(ret[0]);
389
+ }
390
+
391
+ /**
392
+ * Convert metre-valued agent dimensions into Recast's integer voxel counts
393
+ * (`walkableHeight = ceil(h/ch)`, `walkableClimb = floor(climb/ch)`,
394
+ * `walkableRadius = ceil(r/cs)`) and suggest vertical-bounds padding. Skipping
395
+ * this conversion silently truncates sub-metre climb/radius to `0` voxels,
396
+ * which removes erosion and fragments one walkable level into disjoint islands.
397
+ * Inputs (metres) default to the FAST NAV reference values when omitted.
398
+ * @param {any} settings
399
+ * @returns {any}
400
+ */
401
+ export function recast_config(settings) {
402
+ const ret = wasm.recast_config(settings);
403
+ if (ret[2]) {
404
+ throw takeFromExternrefTable0(ret[1]);
405
+ }
406
+ return takeFromExternrefTable0(ret[0]);
407
+ }
408
+
409
+ /**
410
+ * Register (or, with `None`/`undefined`, clear) an opt-in JS progress callback.
411
+ * It is invoked as `callback(stage: string, fraction: number | undefined)` at
412
+ * the same stage boundaries as the `@progress` line protocol. The line protocol
413
+ * is still emitted as a fallback, so `progress_protocol_v1` consumers keep
414
+ * working and integrators no longer need to monkey-patch the global console.
415
+ * @param {Function | null} [callback]
416
+ */
417
+ export function set_progress_callback(callback) {
418
+ wasm.set_progress_callback(isLikeNone(callback) ? 0 : addToExternrefTable0(callback));
419
+ }
420
+
421
+ /**
422
+ * Slice a `.ply`/`.spz` splat into a streamed-SOG bundle: a `lod-meta.json`
423
+ * manifest, per-chunk `meta.json` files, and raw RGBA planes for the JS layer
424
+ * to encode to lossless WebP. Follows Babylon PR #18563's streaming layout.
425
+ * @param {Uint8Array} data
426
+ * @param {any} settings
427
+ * @returns {any}
428
+ */
429
+ export function slice_splat(data, settings) {
430
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
431
+ const len0 = WASM_VECTOR_LEN;
432
+ const ret = wasm.slice_splat(ptr0, len0, settings);
433
+ if (ret[2]) {
434
+ throw takeFromExternrefTable0(ret[1]);
435
+ }
436
+ return takeFromExternrefTable0(ret[0]);
437
+ }
438
+
439
+ /**
440
+ * JS-reachable integer data-contract version (the same value carried on every
441
+ * result's `api_version`).
442
+ * @returns {number}
443
+ */
444
+ export function splatwalk_api_version() {
445
+ const ret = wasm.splatwalk_api_version();
446
+ return ret;
447
+ }
448
+
449
+ /**
450
+ * JS-reachable capability flags advertised by this build, as a string array.
451
+ * @returns {any}
452
+ */
453
+ export function splatwalk_capabilities() {
454
+ const ret = wasm.splatwalk_capabilities();
455
+ if (ret[2]) {
456
+ throw takeFromExternrefTable0(ret[1]);
457
+ }
458
+ return takeFromExternrefTable0(ret[0]);
459
+ }
460
+
461
+ /**
462
+ * JS-reachable semantic version of the core build. Lets an integrator do cheap
463
+ * pre-flight feature detection (and fail fast on a stale binary) before doing
464
+ * any parse/field work, instead of reading `semver` off an expensive result.
465
+ * @returns {string}
466
+ */
467
+ export function splatwalk_version() {
468
+ let deferred1_0;
469
+ let deferred1_1;
470
+ try {
471
+ const ret = wasm.splatwalk_version();
472
+ deferred1_0 = ret[0];
473
+ deferred1_1 = ret[1];
474
+ return getStringFromWasm0(ret[0], ret[1]);
475
+ } finally {
476
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
477
+ }
478
+ }
479
+
480
+ /**
481
+ * Convert a `.spz` (or `.ply`) splat to a binary little-endian 3DGS `.ply`,
482
+ * preserving the full spherical-harmonic stack. Enables basic `.spz` support
483
+ * by normalizing everything to PLY for the viewer and nav pipeline.
484
+ * @param {Uint8Array} data
485
+ * @returns {Uint8Array}
486
+ */
487
+ export function spz_to_ply(data) {
488
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
489
+ const len0 = WASM_VECTOR_LEN;
490
+ const ret = wasm.spz_to_ply(ptr0, len0);
491
+ if (ret[3]) {
492
+ throw takeFromExternrefTable0(ret[2]);
493
+ }
494
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
495
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
496
+ return v2;
497
+ }
498
+
499
+ /**
500
+ * @param {Uint8Array} data
501
+ * @param {any} settings
502
+ * @returns {any}
503
+ */
504
+ export function suggest_region(data, settings) {
505
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
506
+ const len0 = WASM_VECTOR_LEN;
507
+ const ret = wasm.suggest_region(ptr0, len0, settings);
508
+ if (ret[2]) {
509
+ throw takeFromExternrefTable0(ret[1]);
510
+ }
511
+ return takeFromExternrefTable0(ret[0]);
512
+ }
513
+
514
+ const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
515
+
516
+ async function __wbg_load(module, imports) {
517
+ if (typeof Response === 'function' && module instanceof Response) {
518
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
519
+ try {
520
+ return await WebAssembly.instantiateStreaming(module, imports);
521
+ } catch (e) {
522
+ const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);
523
+
524
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
525
+ 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);
526
+
527
+ } else {
528
+ throw e;
529
+ }
530
+ }
531
+ }
532
+
533
+ const bytes = await module.arrayBuffer();
534
+ return await WebAssembly.instantiate(bytes, imports);
535
+ } else {
536
+ const instance = await WebAssembly.instantiate(module, imports);
537
+
538
+ if (instance instanceof WebAssembly.Instance) {
539
+ return { instance, module };
540
+ } else {
541
+ return instance;
542
+ }
543
+ }
544
+ }
545
+
546
+ function __wbg_get_imports() {
547
+ const imports = {};
548
+ imports.wbg = {};
549
+ imports.wbg.__wbg_Error_52673b7de5a0ca89 = function(arg0, arg1) {
550
+ const ret = Error(getStringFromWasm0(arg0, arg1));
551
+ return ret;
552
+ };
553
+ imports.wbg.__wbg_Number_2d1dcfcf4ec51736 = function(arg0) {
554
+ const ret = Number(arg0);
555
+ return ret;
556
+ };
557
+ imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
558
+ const ret = String(arg1);
559
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
560
+ const len1 = WASM_VECTOR_LEN;
561
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
562
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
563
+ };
564
+ imports.wbg.__wbg___wbindgen_bigint_get_as_i64_6e32f5e6aff02e1d = function(arg0, arg1) {
565
+ const v = arg1;
566
+ const ret = typeof(v) === 'bigint' ? v : undefined;
567
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
568
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
569
+ };
570
+ imports.wbg.__wbg___wbindgen_boolean_get_dea25b33882b895b = function(arg0) {
571
+ const v = arg0;
572
+ const ret = typeof(v) === 'boolean' ? v : undefined;
573
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
574
+ };
575
+ imports.wbg.__wbg___wbindgen_debug_string_adfb662ae34724b6 = function(arg0, arg1) {
576
+ const ret = debugString(arg1);
577
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
578
+ const len1 = WASM_VECTOR_LEN;
579
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
580
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
581
+ };
582
+ imports.wbg.__wbg___wbindgen_in_0d3e1e8f0c669317 = function(arg0, arg1) {
583
+ const ret = arg0 in arg1;
584
+ return ret;
585
+ };
586
+ imports.wbg.__wbg___wbindgen_is_bigint_0e1a2e3f55cfae27 = function(arg0) {
587
+ const ret = typeof(arg0) === 'bigint';
588
+ return ret;
589
+ };
590
+ imports.wbg.__wbg___wbindgen_is_function_8d400b8b1af978cd = function(arg0) {
591
+ const ret = typeof(arg0) === 'function';
592
+ return ret;
593
+ };
594
+ imports.wbg.__wbg___wbindgen_is_null_dfda7d66506c95b5 = function(arg0) {
595
+ const ret = arg0 === null;
596
+ return ret;
597
+ };
598
+ imports.wbg.__wbg___wbindgen_is_object_ce774f3490692386 = function(arg0) {
599
+ const val = arg0;
600
+ const ret = typeof(val) === 'object' && val !== null;
601
+ return ret;
602
+ };
603
+ imports.wbg.__wbg___wbindgen_is_string_704ef9c8fc131030 = function(arg0) {
604
+ const ret = typeof(arg0) === 'string';
605
+ return ret;
606
+ };
607
+ imports.wbg.__wbg___wbindgen_is_undefined_f6b95eab589e0269 = function(arg0) {
608
+ const ret = arg0 === undefined;
609
+ return ret;
610
+ };
611
+ imports.wbg.__wbg___wbindgen_jsval_eq_b6101cc9cef1fe36 = function(arg0, arg1) {
612
+ const ret = arg0 === arg1;
613
+ return ret;
614
+ };
615
+ imports.wbg.__wbg___wbindgen_jsval_loose_eq_766057600fdd1b0d = function(arg0, arg1) {
616
+ const ret = arg0 == arg1;
617
+ return ret;
618
+ };
619
+ imports.wbg.__wbg___wbindgen_number_get_9619185a74197f95 = function(arg0, arg1) {
620
+ const obj = arg1;
621
+ const ret = typeof(obj) === 'number' ? obj : undefined;
622
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
623
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
624
+ };
625
+ imports.wbg.__wbg___wbindgen_string_get_a2a31e16edf96e42 = function(arg0, arg1) {
626
+ const obj = arg1;
627
+ const ret = typeof(obj) === 'string' ? obj : undefined;
628
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
629
+ var len1 = WASM_VECTOR_LEN;
630
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
631
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
632
+ };
633
+ imports.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) {
634
+ throw new Error(getStringFromWasm0(arg0, arg1));
635
+ };
636
+ imports.wbg.__wbg_call_3020136f7a2d6e44 = function() { return handleError(function (arg0, arg1, arg2) {
637
+ const ret = arg0.call(arg1, arg2);
638
+ return ret;
639
+ }, arguments) };
640
+ imports.wbg.__wbg_call_abb4ff46ce38be40 = function() { return handleError(function (arg0, arg1) {
641
+ const ret = arg0.call(arg1);
642
+ return ret;
643
+ }, arguments) };
644
+ imports.wbg.__wbg_call_c8baa5c5e72d274e = function() { return handleError(function (arg0, arg1, arg2, arg3) {
645
+ const ret = arg0.call(arg1, arg2, arg3);
646
+ return ret;
647
+ }, arguments) };
648
+ imports.wbg.__wbg_crypto_86f2631e91b51511 = function(arg0) {
649
+ const ret = arg0.crypto;
650
+ return ret;
651
+ };
652
+ imports.wbg.__wbg_done_62ea16af4ce34b24 = function(arg0) {
653
+ const ret = arg0.done;
654
+ return ret;
655
+ };
656
+ imports.wbg.__wbg_entries_83c79938054e065f = function(arg0) {
657
+ const ret = Object.entries(arg0);
658
+ return ret;
659
+ };
660
+ imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
661
+ let deferred0_0;
662
+ let deferred0_1;
663
+ try {
664
+ deferred0_0 = arg0;
665
+ deferred0_1 = arg1;
666
+ console.error(getStringFromWasm0(arg0, arg1));
667
+ } finally {
668
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
669
+ }
670
+ };
671
+ imports.wbg.__wbg_from_29a8414a7a7cd19d = function(arg0) {
672
+ const ret = Array.from(arg0);
673
+ return ret;
674
+ };
675
+ imports.wbg.__wbg_getRandomValues_b3f15fcbfabb0f8b = function() { return handleError(function (arg0, arg1) {
676
+ arg0.getRandomValues(arg1);
677
+ }, arguments) };
678
+ imports.wbg.__wbg_get_6b7bd52aca3f9671 = function(arg0, arg1) {
679
+ const ret = arg0[arg1 >>> 0];
680
+ return ret;
681
+ };
682
+ imports.wbg.__wbg_get_af9dab7e9603ea93 = function() { return handleError(function (arg0, arg1) {
683
+ const ret = Reflect.get(arg0, arg1);
684
+ return ret;
685
+ }, arguments) };
686
+ imports.wbg.__wbg_get_with_ref_key_1dc361bd10053bfe = function(arg0, arg1) {
687
+ const ret = arg0[arg1];
688
+ return ret;
689
+ };
690
+ imports.wbg.__wbg_instanceof_ArrayBuffer_f3320d2419cd0355 = function(arg0) {
691
+ let result;
692
+ try {
693
+ result = arg0 instanceof ArrayBuffer;
694
+ } catch (_) {
695
+ result = false;
696
+ }
697
+ const ret = result;
698
+ return ret;
699
+ };
700
+ imports.wbg.__wbg_instanceof_Map_084be8da74364158 = function(arg0) {
701
+ let result;
702
+ try {
703
+ result = arg0 instanceof Map;
704
+ } catch (_) {
705
+ result = false;
706
+ }
707
+ const ret = result;
708
+ return ret;
709
+ };
710
+ imports.wbg.__wbg_instanceof_Uint8Array_da54ccc9d3e09434 = function(arg0) {
711
+ let result;
712
+ try {
713
+ result = arg0 instanceof Uint8Array;
714
+ } catch (_) {
715
+ result = false;
716
+ }
717
+ const ret = result;
718
+ return ret;
719
+ };
720
+ imports.wbg.__wbg_isArray_51fd9e6422c0a395 = function(arg0) {
721
+ const ret = Array.isArray(arg0);
722
+ return ret;
723
+ };
724
+ imports.wbg.__wbg_isSafeInteger_ae7d3f054d55fa16 = function(arg0) {
725
+ const ret = Number.isSafeInteger(arg0);
726
+ return ret;
727
+ };
728
+ imports.wbg.__wbg_iterator_27b7c8b35ab3e86b = function() {
729
+ const ret = Symbol.iterator;
730
+ return ret;
731
+ };
732
+ imports.wbg.__wbg_length_22ac23eaec9d8053 = function(arg0) {
733
+ const ret = arg0.length;
734
+ return ret;
735
+ };
736
+ imports.wbg.__wbg_length_d45040a40c570362 = function(arg0) {
737
+ const ret = arg0.length;
738
+ return ret;
739
+ };
740
+ imports.wbg.__wbg_log_007094bd588d732c = function(arg0, arg1) {
741
+ console.log(getStringFromWasm0(arg0, arg1));
742
+ };
743
+ imports.wbg.__wbg_log_1d990106d99dacb7 = function(arg0) {
744
+ console.log(arg0);
745
+ };
746
+ imports.wbg.__wbg_msCrypto_d562bbe83e0d4b91 = function(arg0) {
747
+ const ret = arg0.msCrypto;
748
+ return ret;
749
+ };
750
+ imports.wbg.__wbg_new_1ba21ce319a06297 = function() {
751
+ const ret = new Object();
752
+ return ret;
753
+ };
754
+ imports.wbg.__wbg_new_25f239778d6112b9 = function() {
755
+ const ret = new Array();
756
+ return ret;
757
+ };
758
+ imports.wbg.__wbg_new_6421f6084cc5bc5a = function(arg0) {
759
+ const ret = new Uint8Array(arg0);
760
+ return ret;
761
+ };
762
+ imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
763
+ const ret = new Error();
764
+ return ret;
765
+ };
766
+ imports.wbg.__wbg_new_b546ae120718850e = function() {
767
+ const ret = new Map();
768
+ return ret;
769
+ };
770
+ imports.wbg.__wbg_new_no_args_cb138f77cf6151ee = function(arg0, arg1) {
771
+ const ret = new Function(getStringFromWasm0(arg0, arg1));
772
+ return ret;
773
+ };
774
+ imports.wbg.__wbg_new_with_length_aa5eaf41d35235e5 = function(arg0) {
775
+ const ret = new Uint8Array(arg0 >>> 0);
776
+ return ret;
777
+ };
778
+ imports.wbg.__wbg_next_138a17bbf04e926c = function(arg0) {
779
+ const ret = arg0.next;
780
+ return ret;
781
+ };
782
+ imports.wbg.__wbg_next_3cfe5c0fe2a4cc53 = function() { return handleError(function (arg0) {
783
+ const ret = arg0.next();
784
+ return ret;
785
+ }, arguments) };
786
+ imports.wbg.__wbg_node_e1f24f89a7336c2e = function(arg0) {
787
+ const ret = arg0.node;
788
+ return ret;
789
+ };
790
+ imports.wbg.__wbg_process_3975fd6c72f520aa = function(arg0) {
791
+ const ret = arg0.process;
792
+ return ret;
793
+ };
794
+ imports.wbg.__wbg_prototypesetcall_dfe9b766cdc1f1fd = function(arg0, arg1, arg2) {
795
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
796
+ };
797
+ imports.wbg.__wbg_randomFillSync_f8c153b79f285817 = function() { return handleError(function (arg0, arg1) {
798
+ arg0.randomFillSync(arg1);
799
+ }, arguments) };
800
+ imports.wbg.__wbg_require_b74f47fc2d022fd6 = function() { return handleError(function () {
801
+ const ret = module.require;
802
+ return ret;
803
+ }, arguments) };
804
+ imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
805
+ arg0[arg1] = arg2;
806
+ };
807
+ imports.wbg.__wbg_set_7df433eea03a5c14 = function(arg0, arg1, arg2) {
808
+ arg0[arg1 >>> 0] = arg2;
809
+ };
810
+ imports.wbg.__wbg_set_efaaf145b9377369 = function(arg0, arg1, arg2) {
811
+ const ret = arg0.set(arg1, arg2);
812
+ return ret;
813
+ };
814
+ imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
815
+ const ret = arg1.stack;
816
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
817
+ const len1 = WASM_VECTOR_LEN;
818
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
819
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
820
+ };
821
+ imports.wbg.__wbg_static_accessor_GLOBAL_769e6b65d6557335 = function() {
822
+ const ret = typeof global === 'undefined' ? null : global;
823
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
824
+ };
825
+ imports.wbg.__wbg_static_accessor_GLOBAL_THIS_60cf02db4de8e1c1 = function() {
826
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
827
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
828
+ };
829
+ imports.wbg.__wbg_static_accessor_SELF_08f5a74c69739274 = function() {
830
+ const ret = typeof self === 'undefined' ? null : self;
831
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
832
+ };
833
+ imports.wbg.__wbg_static_accessor_WINDOW_a8924b26aa92d024 = function() {
834
+ const ret = typeof window === 'undefined' ? null : window;
835
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
836
+ };
837
+ imports.wbg.__wbg_subarray_845f2f5bce7d061a = function(arg0, arg1, arg2) {
838
+ const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
839
+ return ret;
840
+ };
841
+ imports.wbg.__wbg_value_57b7b035e117f7ee = function(arg0) {
842
+ const ret = arg0.value;
843
+ return ret;
844
+ };
845
+ imports.wbg.__wbg_versions_4e31226f5e8dc909 = function(arg0) {
846
+ const ret = arg0.versions;
847
+ return ret;
848
+ };
849
+ imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
850
+ // Cast intrinsic for `Ref(String) -> Externref`.
851
+ const ret = getStringFromWasm0(arg0, arg1);
852
+ return ret;
853
+ };
854
+ imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
855
+ // Cast intrinsic for `U64 -> Externref`.
856
+ const ret = BigInt.asUintN(64, arg0);
857
+ return ret;
858
+ };
859
+ imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
860
+ // Cast intrinsic for `I64 -> Externref`.
861
+ const ret = arg0;
862
+ return ret;
863
+ };
864
+ imports.wbg.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) {
865
+ // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
866
+ const ret = getArrayU8FromWasm0(arg0, arg1);
867
+ return ret;
868
+ };
869
+ imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
870
+ // Cast intrinsic for `F64 -> Externref`.
871
+ const ret = arg0;
872
+ return ret;
873
+ };
874
+ imports.wbg.__wbindgen_init_externref_table = function() {
875
+ const table = wasm.__wbindgen_externrefs;
876
+ const offset = table.grow(4);
877
+ table.set(0, undefined);
878
+ table.set(offset + 0, undefined);
879
+ table.set(offset + 1, null);
880
+ table.set(offset + 2, true);
881
+ table.set(offset + 3, false);
882
+ };
883
+
884
+ return imports;
885
+ }
886
+
887
+ function __wbg_finalize_init(instance, module) {
888
+ wasm = instance.exports;
889
+ __wbg_init.__wbindgen_wasm_module = module;
890
+ cachedDataViewMemory0 = null;
891
+ cachedFloat32ArrayMemory0 = null;
892
+ cachedUint32ArrayMemory0 = null;
893
+ cachedUint8ArrayMemory0 = null;
894
+
895
+
896
+ wasm.__wbindgen_start();
897
+ return wasm;
898
+ }
899
+
900
+ function initSync(module) {
901
+ if (wasm !== undefined) return wasm;
902
+
903
+
904
+ if (typeof module !== 'undefined') {
905
+ if (Object.getPrototypeOf(module) === Object.prototype) {
906
+ ({module} = module)
907
+ } else {
908
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
909
+ }
910
+ }
911
+
912
+ const imports = __wbg_get_imports();
913
+ if (!(module instanceof WebAssembly.Module)) {
914
+ module = new WebAssembly.Module(module);
915
+ }
916
+ const instance = new WebAssembly.Instance(module, imports);
917
+ return __wbg_finalize_init(instance, module);
918
+ }
919
+
920
+ async function __wbg_init(module_or_path) {
921
+ if (wasm !== undefined) return wasm;
922
+
923
+
924
+ if (typeof module_or_path !== 'undefined') {
925
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
926
+ ({module_or_path} = module_or_path)
927
+ } else {
928
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
929
+ }
930
+ }
931
+
932
+ if (typeof module_or_path === 'undefined') {
933
+ module_or_path = new URL('wasm_splatwalk_bg.wasm', import.meta.url);
934
+ }
935
+ const imports = __wbg_get_imports();
936
+
937
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
938
+ module_or_path = fetch(module_or_path);
939
+ }
940
+
941
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
942
+
943
+ return __wbg_finalize_init(instance, module);
944
+ }
945
+
946
+ export { initSync };
947
+ export default __wbg_init;