@flo-audio/reflo 0.1.1

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/reflo.js ADDED
@@ -0,0 +1,1722 @@
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 getArrayF32FromWasm0(ptr, len) {
75
+ ptr = ptr >>> 0;
76
+ return getFloat32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
77
+ }
78
+
79
+ function getArrayU8FromWasm0(ptr, len) {
80
+ ptr = ptr >>> 0;
81
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
82
+ }
83
+
84
+ let cachedDataViewMemory0 = null;
85
+ function getDataViewMemory0() {
86
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
87
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
88
+ }
89
+ return cachedDataViewMemory0;
90
+ }
91
+
92
+ let cachedFloat32ArrayMemory0 = null;
93
+ function getFloat32ArrayMemory0() {
94
+ if (cachedFloat32ArrayMemory0 === null || cachedFloat32ArrayMemory0.byteLength === 0) {
95
+ cachedFloat32ArrayMemory0 = new Float32Array(wasm.memory.buffer);
96
+ }
97
+ return cachedFloat32ArrayMemory0;
98
+ }
99
+
100
+ function getStringFromWasm0(ptr, len) {
101
+ ptr = ptr >>> 0;
102
+ return decodeText(ptr, len);
103
+ }
104
+
105
+ let cachedUint8ArrayMemory0 = null;
106
+ function getUint8ArrayMemory0() {
107
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
108
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
109
+ }
110
+ return cachedUint8ArrayMemory0;
111
+ }
112
+
113
+ function handleError(f, args) {
114
+ try {
115
+ return f.apply(this, args);
116
+ } catch (e) {
117
+ const idx = addToExternrefTable0(e);
118
+ wasm.__wbindgen_exn_store(idx);
119
+ }
120
+ }
121
+
122
+ function isLikeNone(x) {
123
+ return x === undefined || x === null;
124
+ }
125
+
126
+ function passArray8ToWasm0(arg, malloc) {
127
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
128
+ getUint8ArrayMemory0().set(arg, ptr / 1);
129
+ WASM_VECTOR_LEN = arg.length;
130
+ return ptr;
131
+ }
132
+
133
+ function passArrayF32ToWasm0(arg, malloc) {
134
+ const ptr = malloc(arg.length * 4, 4) >>> 0;
135
+ getFloat32ArrayMemory0().set(arg, ptr / 4);
136
+ WASM_VECTOR_LEN = arg.length;
137
+ return ptr;
138
+ }
139
+
140
+ function passStringToWasm0(arg, malloc, realloc) {
141
+ if (realloc === undefined) {
142
+ const buf = cachedTextEncoder.encode(arg);
143
+ const ptr = malloc(buf.length, 1) >>> 0;
144
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
145
+ WASM_VECTOR_LEN = buf.length;
146
+ return ptr;
147
+ }
148
+
149
+ let len = arg.length;
150
+ let ptr = malloc(len, 1) >>> 0;
151
+
152
+ const mem = getUint8ArrayMemory0();
153
+
154
+ let offset = 0;
155
+
156
+ for (; offset < len; offset++) {
157
+ const code = arg.charCodeAt(offset);
158
+ if (code > 0x7F) break;
159
+ mem[ptr + offset] = code;
160
+ }
161
+ if (offset !== len) {
162
+ if (offset !== 0) {
163
+ arg = arg.slice(offset);
164
+ }
165
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
166
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
167
+ const ret = cachedTextEncoder.encodeInto(arg, view);
168
+
169
+ offset += ret.written;
170
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
171
+ }
172
+
173
+ WASM_VECTOR_LEN = offset;
174
+ return ptr;
175
+ }
176
+
177
+ function takeFromExternrefTable0(idx) {
178
+ const value = wasm.__wbindgen_externrefs.get(idx);
179
+ wasm.__externref_table_dealloc(idx);
180
+ return value;
181
+ }
182
+
183
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
184
+ cachedTextDecoder.decode();
185
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
186
+ let numBytesDecoded = 0;
187
+ function decodeText(ptr, len) {
188
+ numBytesDecoded += len;
189
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
190
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
191
+ cachedTextDecoder.decode();
192
+ numBytesDecoded = len;
193
+ }
194
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
195
+ }
196
+
197
+ const cachedTextEncoder = new TextEncoder();
198
+
199
+ if (!('encodeInto' in cachedTextEncoder)) {
200
+ cachedTextEncoder.encodeInto = function (arg, view) {
201
+ const buf = cachedTextEncoder.encode(arg);
202
+ view.set(buf);
203
+ return {
204
+ read: arg.length,
205
+ written: buf.length
206
+ };
207
+ }
208
+ }
209
+
210
+ let WASM_VECTOR_LEN = 0;
211
+
212
+ const AudioInfoFinalization = (typeof FinalizationRegistry === 'undefined')
213
+ ? { register: () => {}, unregister: () => {} }
214
+ : new FinalizationRegistry(ptr => wasm.__wbg_audioinfo_free(ptr >>> 0, 1));
215
+
216
+ const FloInfoFinalization = (typeof FinalizationRegistry === 'undefined')
217
+ ? { register: () => {}, unregister: () => {} }
218
+ : new FinalizationRegistry(ptr => wasm.__wbg_floinfo_free(ptr >>> 0, 1));
219
+
220
+ const WasmStreamingDecoderFinalization = (typeof FinalizationRegistry === 'undefined')
221
+ ? { register: () => {}, unregister: () => {} }
222
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmstreamingdecoder_free(ptr >>> 0, 1));
223
+
224
+ /**
225
+ * info about a flo file
226
+ */
227
+ export class AudioInfo {
228
+ static __wrap(ptr) {
229
+ ptr = ptr >>> 0;
230
+ const obj = Object.create(AudioInfo.prototype);
231
+ obj.__wbg_ptr = ptr;
232
+ AudioInfoFinalization.register(obj, obj.__wbg_ptr, obj);
233
+ return obj;
234
+ }
235
+ __destroy_into_raw() {
236
+ const ptr = this.__wbg_ptr;
237
+ this.__wbg_ptr = 0;
238
+ AudioInfoFinalization.unregister(this);
239
+ return ptr;
240
+ }
241
+ free() {
242
+ const ptr = this.__destroy_into_raw();
243
+ wasm.__wbg_audioinfo_free(ptr, 0);
244
+ }
245
+ /**
246
+ * Sample rate in Hz
247
+ * @returns {number}
248
+ */
249
+ get sample_rate() {
250
+ const ret = wasm.__wbg_get_audioinfo_sample_rate(this.__wbg_ptr);
251
+ return ret >>> 0;
252
+ }
253
+ /**
254
+ * Sample rate in Hz
255
+ * @param {number} arg0
256
+ */
257
+ set sample_rate(arg0) {
258
+ wasm.__wbg_set_audioinfo_sample_rate(this.__wbg_ptr, arg0);
259
+ }
260
+ /**
261
+ * Number of channels
262
+ * @returns {number}
263
+ */
264
+ get channels() {
265
+ const ret = wasm.__wbg_get_audioinfo_channels(this.__wbg_ptr);
266
+ return ret;
267
+ }
268
+ /**
269
+ * Number of channels
270
+ * @param {number} arg0
271
+ */
272
+ set channels(arg0) {
273
+ wasm.__wbg_set_audioinfo_channels(this.__wbg_ptr, arg0);
274
+ }
275
+ /**
276
+ * Bits per sample
277
+ * @returns {number}
278
+ */
279
+ get bit_depth() {
280
+ const ret = wasm.__wbg_get_audioinfo_bit_depth(this.__wbg_ptr);
281
+ return ret;
282
+ }
283
+ /**
284
+ * Bits per sample
285
+ * @param {number} arg0
286
+ */
287
+ set bit_depth(arg0) {
288
+ wasm.__wbg_set_audioinfo_bit_depth(this.__wbg_ptr, arg0);
289
+ }
290
+ /**
291
+ * Total number of frames
292
+ * @returns {bigint}
293
+ */
294
+ get total_frames() {
295
+ const ret = wasm.__wbg_get_audioinfo_total_frames(this.__wbg_ptr);
296
+ return BigInt.asUintN(64, ret);
297
+ }
298
+ /**
299
+ * Total number of frames
300
+ * @param {bigint} arg0
301
+ */
302
+ set total_frames(arg0) {
303
+ wasm.__wbg_set_audioinfo_total_frames(this.__wbg_ptr, arg0);
304
+ }
305
+ /**
306
+ * Duration in seconds
307
+ * @returns {number}
308
+ */
309
+ get duration_secs() {
310
+ const ret = wasm.__wbg_get_audioinfo_duration_secs(this.__wbg_ptr);
311
+ return ret;
312
+ }
313
+ /**
314
+ * Duration in seconds
315
+ * @param {number} arg0
316
+ */
317
+ set duration_secs(arg0) {
318
+ wasm.__wbg_set_audioinfo_duration_secs(this.__wbg_ptr, arg0);
319
+ }
320
+ /**
321
+ * File size in bytes
322
+ * @returns {number}
323
+ */
324
+ get file_size() {
325
+ const ret = wasm.__wbg_get_audioinfo_file_size(this.__wbg_ptr);
326
+ return ret >>> 0;
327
+ }
328
+ /**
329
+ * File size in bytes
330
+ * @param {number} arg0
331
+ */
332
+ set file_size(arg0) {
333
+ wasm.__wbg_set_audioinfo_file_size(this.__wbg_ptr, arg0);
334
+ }
335
+ /**
336
+ * Compression ratio (original / compressed)
337
+ * @returns {number}
338
+ */
339
+ get compression_ratio() {
340
+ const ret = wasm.__wbg_get_audioinfo_compression_ratio(this.__wbg_ptr);
341
+ return ret;
342
+ }
343
+ /**
344
+ * Compression ratio (original / compressed)
345
+ * @param {number} arg0
346
+ */
347
+ set compression_ratio(arg0) {
348
+ wasm.__wbg_set_audioinfo_compression_ratio(this.__wbg_ptr, arg0);
349
+ }
350
+ /**
351
+ * Is CRC valid?
352
+ * @returns {boolean}
353
+ */
354
+ get crc_valid() {
355
+ const ret = wasm.__wbg_get_audioinfo_crc_valid(this.__wbg_ptr);
356
+ return ret !== 0;
357
+ }
358
+ /**
359
+ * Is CRC valid?
360
+ * @param {boolean} arg0
361
+ */
362
+ set crc_valid(arg0) {
363
+ wasm.__wbg_set_audioinfo_crc_valid(this.__wbg_ptr, arg0);
364
+ }
365
+ /**
366
+ * Is lossy compression mode?
367
+ * @returns {boolean}
368
+ */
369
+ get is_lossy() {
370
+ const ret = wasm.__wbg_get_audioinfo_is_lossy(this.__wbg_ptr);
371
+ return ret !== 0;
372
+ }
373
+ /**
374
+ * Is lossy compression mode?
375
+ * @param {boolean} arg0
376
+ */
377
+ set is_lossy(arg0) {
378
+ wasm.__wbg_set_audioinfo_is_lossy(this.__wbg_ptr, arg0);
379
+ }
380
+ /**
381
+ * Lossy quality 0-4 (only valid if is_lossy)
382
+ * @returns {number}
383
+ */
384
+ get lossy_quality() {
385
+ const ret = wasm.__wbg_get_audioinfo_lossy_quality(this.__wbg_ptr);
386
+ return ret;
387
+ }
388
+ /**
389
+ * Lossy quality 0-4 (only valid if is_lossy)
390
+ * @param {number} arg0
391
+ */
392
+ set lossy_quality(arg0) {
393
+ wasm.__wbg_set_audioinfo_lossy_quality(this.__wbg_ptr, arg0);
394
+ }
395
+ /**
396
+ * @returns {string}
397
+ */
398
+ get version() {
399
+ let deferred1_0;
400
+ let deferred1_1;
401
+ try {
402
+ const ret = wasm.audioinfo_version(this.__wbg_ptr);
403
+ deferred1_0 = ret[0];
404
+ deferred1_1 = ret[1];
405
+ return getStringFromWasm0(ret[0], ret[1]);
406
+ } finally {
407
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
408
+ }
409
+ }
410
+ }
411
+ if (Symbol.dispose) AudioInfo.prototype[Symbol.dispose] = AudioInfo.prototype.free;
412
+
413
+ export class FloInfo {
414
+ static __wrap(ptr) {
415
+ ptr = ptr >>> 0;
416
+ const obj = Object.create(FloInfo.prototype);
417
+ obj.__wbg_ptr = ptr;
418
+ FloInfoFinalization.register(obj, obj.__wbg_ptr, obj);
419
+ return obj;
420
+ }
421
+ __destroy_into_raw() {
422
+ const ptr = this.__wbg_ptr;
423
+ this.__wbg_ptr = 0;
424
+ FloInfoFinalization.unregister(this);
425
+ return ptr;
426
+ }
427
+ free() {
428
+ const ptr = this.__destroy_into_raw();
429
+ wasm.__wbg_floinfo_free(ptr, 0);
430
+ }
431
+ /**
432
+ * @returns {number}
433
+ */
434
+ get sample_rate() {
435
+ const ret = wasm.floinfo_sample_rate(this.__wbg_ptr);
436
+ return ret >>> 0;
437
+ }
438
+ /**
439
+ * @returns {bigint}
440
+ */
441
+ get total_frames() {
442
+ const ret = wasm.floinfo_total_frames(this.__wbg_ptr);
443
+ return BigInt.asUintN(64, ret);
444
+ }
445
+ /**
446
+ * @returns {number}
447
+ */
448
+ get duration_secs() {
449
+ const ret = wasm.floinfo_duration_secs(this.__wbg_ptr);
450
+ return ret;
451
+ }
452
+ /**
453
+ * @returns {number}
454
+ */
455
+ get lossy_quality() {
456
+ const ret = wasm.floinfo_lossy_quality(this.__wbg_ptr);
457
+ return ret;
458
+ }
459
+ /**
460
+ * @returns {number}
461
+ */
462
+ get compression_ratio() {
463
+ const ret = wasm.floinfo_compression_ratio(this.__wbg_ptr);
464
+ return ret;
465
+ }
466
+ /**
467
+ * @returns {string}
468
+ */
469
+ get version() {
470
+ let deferred1_0;
471
+ let deferred1_1;
472
+ try {
473
+ const ret = wasm.floinfo_version(this.__wbg_ptr);
474
+ deferred1_0 = ret[0];
475
+ deferred1_1 = ret[1];
476
+ return getStringFromWasm0(ret[0], ret[1]);
477
+ } finally {
478
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
479
+ }
480
+ }
481
+ /**
482
+ * @returns {number}
483
+ */
484
+ get channels() {
485
+ const ret = wasm.floinfo_channels(this.__wbg_ptr);
486
+ return ret;
487
+ }
488
+ /**
489
+ * @returns {boolean}
490
+ */
491
+ get is_lossy() {
492
+ const ret = wasm.floinfo_is_lossy(this.__wbg_ptr);
493
+ return ret !== 0;
494
+ }
495
+ /**
496
+ * @returns {number}
497
+ */
498
+ get bit_depth() {
499
+ const ret = wasm.floinfo_bit_depth(this.__wbg_ptr);
500
+ return ret;
501
+ }
502
+ /**
503
+ * @returns {boolean}
504
+ */
505
+ get crc_valid() {
506
+ const ret = wasm.floinfo_crc_valid(this.__wbg_ptr);
507
+ return ret !== 0;
508
+ }
509
+ /**
510
+ * @returns {number}
511
+ */
512
+ get file_size() {
513
+ const ret = wasm.floinfo_file_size(this.__wbg_ptr);
514
+ return ret >>> 0;
515
+ }
516
+ }
517
+ if (Symbol.dispose) FloInfo.prototype[Symbol.dispose] = FloInfo.prototype.free;
518
+
519
+ export class WasmStreamingDecoder {
520
+ __destroy_into_raw() {
521
+ const ptr = this.__wbg_ptr;
522
+ this.__wbg_ptr = 0;
523
+ WasmStreamingDecoderFinalization.unregister(this);
524
+ return ptr;
525
+ }
526
+ free() {
527
+ const ptr = this.__destroy_into_raw();
528
+ wasm.__wbg_wasmstreamingdecoder_free(ptr, 0);
529
+ }
530
+ /**
531
+ * Decode the next available frame
532
+ *
533
+ * Returns interleaved f32 samples for one frame, or null if no frame is ready.
534
+ * This enables true streaming: decode and play frames as they arrive.
535
+ *
536
+ * Usage pattern:
537
+ * ```js
538
+ * while (true) {
539
+ * const samples = decoder.next_frame();
540
+ * if (samples === null) break; // No more frames ready
541
+ * playAudio(samples);
542
+ * }
543
+ * ```
544
+ * @returns {any}
545
+ */
546
+ next_frame() {
547
+ const ret = wasm.wasmstreamingdecoder_next_frame(this.__wbg_ptr);
548
+ if (ret[2]) {
549
+ throw takeFromExternrefTable0(ret[1]);
550
+ }
551
+ return takeFromExternrefTable0(ret[0]);
552
+ }
553
+ /**
554
+ * stream done?
555
+ * @returns {boolean}
556
+ */
557
+ is_finished() {
558
+ const ret = wasm.wasmstreamingdecoder_is_finished(this.__wbg_ptr);
559
+ return ret !== 0;
560
+ }
561
+ /**
562
+ * bytes currently buffered
563
+ * @returns {number}
564
+ */
565
+ buffered_bytes() {
566
+ const ret = wasm.wasmstreamingdecoder_buffered_bytes(this.__wbg_ptr);
567
+ return ret >>> 0;
568
+ }
569
+ /**
570
+ * how many frames ready to decode
571
+ * @returns {number}
572
+ */
573
+ available_frames() {
574
+ const ret = wasm.wasmstreamingdecoder_available_frames(this.__wbg_ptr);
575
+ return ret >>> 0;
576
+ }
577
+ /**
578
+ * decode all currently available samples
579
+ * @returns {Float32Array}
580
+ */
581
+ decode_available() {
582
+ const ret = wasm.wasmstreamingdecoder_decode_available(this.__wbg_ptr);
583
+ if (ret[3]) {
584
+ throw takeFromExternrefTable0(ret[2]);
585
+ }
586
+ var v1 = getArrayF32FromWasm0(ret[0], ret[1]).slice();
587
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
588
+ return v1;
589
+ }
590
+ /**
591
+ * current frame index
592
+ * @returns {number}
593
+ */
594
+ current_frame_index() {
595
+ const ret = wasm.wasmstreamingdecoder_current_frame_index(this.__wbg_ptr);
596
+ return ret >>> 0;
597
+ }
598
+ /**
599
+ * new streaming decoder
600
+ */
601
+ constructor() {
602
+ const ret = wasm.wasmstreamingdecoder_new();
603
+ this.__wbg_ptr = ret >>> 0;
604
+ WasmStreamingDecoderFinalization.register(this, this.__wbg_ptr, this);
605
+ return this;
606
+ }
607
+ /**
608
+ * feed data to the decoder, call as bytes come in from network
609
+ * @param {Uint8Array} data
610
+ * @returns {boolean}
611
+ */
612
+ feed(data) {
613
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
614
+ const len0 = WASM_VECTOR_LEN;
615
+ const ret = wasm.wasmstreamingdecoder_feed(this.__wbg_ptr, ptr0, len0);
616
+ if (ret[2]) {
617
+ throw takeFromExternrefTable0(ret[1]);
618
+ }
619
+ return ret[0] !== 0;
620
+ }
621
+ /**
622
+ * Reset the decoder to initial state
623
+ *
624
+ * Use this to start decoding a new stream.
625
+ */
626
+ reset() {
627
+ wasm.wasmstreamingdecoder_reset(this.__wbg_ptr);
628
+ }
629
+ /**
630
+ * Get the current state as a string
631
+ * @returns {string}
632
+ */
633
+ state() {
634
+ let deferred1_0;
635
+ let deferred1_1;
636
+ try {
637
+ const ret = wasm.wasmstreamingdecoder_state(this.__wbg_ptr);
638
+ deferred1_0 = ret[0];
639
+ deferred1_1 = ret[1];
640
+ return getStringFromWasm0(ret[0], ret[1]);
641
+ } finally {
642
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
643
+ }
644
+ }
645
+ /**
646
+ * Get audio information (available after header is parsed)
647
+ *
648
+ * Returns null if header hasn't been parsed yet.
649
+ * @returns {any}
650
+ */
651
+ get_info() {
652
+ const ret = wasm.wasmstreamingdecoder_get_info(this.__wbg_ptr);
653
+ if (ret[2]) {
654
+ throw takeFromExternrefTable0(ret[1]);
655
+ }
656
+ return takeFromExternrefTable0(ret[0]);
657
+ }
658
+ /**
659
+ * Check if the decoder is ready to produce audio
660
+ * @returns {boolean}
661
+ */
662
+ is_ready() {
663
+ const ret = wasm.wasmstreamingdecoder_is_ready(this.__wbg_ptr);
664
+ return ret !== 0;
665
+ }
666
+ /**
667
+ * Check if there was an error
668
+ * @returns {boolean}
669
+ */
670
+ has_error() {
671
+ const ret = wasm.wasmstreamingdecoder_has_error(this.__wbg_ptr);
672
+ return ret !== 0;
673
+ }
674
+ }
675
+ if (Symbol.dispose) WasmStreamingDecoder.prototype[Symbol.dispose] = WasmStreamingDecoder.prototype.free;
676
+
677
+ /**
678
+ * Create metadata from basic fields and serialize to MessagePack
679
+ *
680
+ * # Arguments
681
+ * * `title` - Optional title
682
+ * * `artist` - Optional artist
683
+ * * `album` - Optional album
684
+ *
685
+ * # Returns
686
+ * MessagePack bytes containing metadata
687
+ * @param {string | null} [title]
688
+ * @param {string | null} [artist]
689
+ * @param {string | null} [album]
690
+ * @returns {Uint8Array}
691
+ */
692
+ export function create_metadata(title, artist, album) {
693
+ var ptr0 = isLikeNone(title) ? 0 : passStringToWasm0(title, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
694
+ var len0 = WASM_VECTOR_LEN;
695
+ var ptr1 = isLikeNone(artist) ? 0 : passStringToWasm0(artist, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
696
+ var len1 = WASM_VECTOR_LEN;
697
+ var ptr2 = isLikeNone(album) ? 0 : passStringToWasm0(album, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
698
+ var len2 = WASM_VECTOR_LEN;
699
+ const ret = wasm.create_metadata(ptr0, len0, ptr1, len1, ptr2, len2);
700
+ if (ret[3]) {
701
+ throw takeFromExternrefTable0(ret[2]);
702
+ }
703
+ var v4 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
704
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
705
+ return v4;
706
+ }
707
+
708
+ /**
709
+ * Create metadata from a JavaScript object
710
+ *
711
+ * Accepts an object with any of the supported metadata fields.
712
+ * See FloMetadata for available fields.
713
+ *
714
+ * # Returns
715
+ * MessagePack bytes containing metadata
716
+ * @param {any} obj
717
+ * @returns {Uint8Array}
718
+ */
719
+ export function create_metadata_from_object(obj) {
720
+ const ret = wasm.create_metadata_from_object(obj);
721
+ if (ret[3]) {
722
+ throw takeFromExternrefTable0(ret[2]);
723
+ }
724
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
725
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
726
+ return v1;
727
+ }
728
+
729
+ /**
730
+ * decode flo file to samples
731
+ *
732
+ * This automatically detects whether the file uses lossless or lossy encoding
733
+ * and dispatches to the appropriate decoder.
734
+ *
735
+ * # Arguments
736
+ * * `data` - flo™ file bytes
737
+ *
738
+ * # Returns
739
+ * Interleaved audio samples (f32, -1.0 to 1.0)
740
+ * @param {Uint8Array} data
741
+ * @returns {Float32Array}
742
+ */
743
+ export function decode(data) {
744
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
745
+ const len0 = WASM_VECTOR_LEN;
746
+ const ret = wasm.decode(ptr0, len0);
747
+ if (ret[3]) {
748
+ throw takeFromExternrefTable0(ret[2]);
749
+ }
750
+ var v2 = getArrayF32FromWasm0(ret[0], ret[1]).slice();
751
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
752
+ return v2;
753
+ }
754
+
755
+ /**
756
+ * @param {Uint8Array} flo_bytes
757
+ * @returns {any}
758
+ */
759
+ export function decode_flo_to_samples(flo_bytes) {
760
+ const ptr0 = passArray8ToWasm0(flo_bytes, wasm.__wbindgen_malloc);
761
+ const len0 = WASM_VECTOR_LEN;
762
+ const ret = wasm.decode_flo_to_samples(ptr0, len0);
763
+ if (ret[2]) {
764
+ throw takeFromExternrefTable0(ret[1]);
765
+ }
766
+ return takeFromExternrefTable0(ret[0]);
767
+ }
768
+
769
+ /**
770
+ * @param {Uint8Array} flo_bytes
771
+ * @returns {Uint8Array}
772
+ */
773
+ export function decode_flo_to_wav(flo_bytes) {
774
+ const ptr0 = passArray8ToWasm0(flo_bytes, wasm.__wbindgen_malloc);
775
+ const len0 = WASM_VECTOR_LEN;
776
+ const ret = wasm.decode_flo_to_wav(ptr0, len0);
777
+ if (ret[3]) {
778
+ throw takeFromExternrefTable0(ret[2]);
779
+ }
780
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
781
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
782
+ return v2;
783
+ }
784
+
785
+ /**
786
+ * encode samples to flo lossless
787
+ *
788
+ * # Arguments
789
+ * * `samples` - Interleaved audio samples (f32, -1.0 to 1.0)
790
+ * * `sample_rate` - Sample rate in Hz (e.g., 44100)
791
+ * * `channels` - Number of channels (1 or 2)
792
+ * * `bit_depth` - Bits per sample (16, 24, or 32)
793
+ * * `metadata` - Optional MessagePack metadata
794
+ *
795
+ * # Returns
796
+ * flo™ file as byte array
797
+ *
798
+ * # Note
799
+ * For advanced usage with custom compression levels (0-9),
800
+ * use the `Encoder` builder pattern directly.
801
+ * @param {Float32Array} samples
802
+ * @param {number} sample_rate
803
+ * @param {number} channels
804
+ * @param {number} bit_depth
805
+ * @param {Uint8Array | null} [metadata]
806
+ * @returns {Uint8Array}
807
+ */
808
+ export function encode(samples, sample_rate, channels, bit_depth, metadata) {
809
+ const ptr0 = passArrayF32ToWasm0(samples, wasm.__wbindgen_malloc);
810
+ const len0 = WASM_VECTOR_LEN;
811
+ var ptr1 = isLikeNone(metadata) ? 0 : passArray8ToWasm0(metadata, wasm.__wbindgen_malloc);
812
+ var len1 = WASM_VECTOR_LEN;
813
+ const ret = wasm.encode(ptr0, len0, sample_rate, channels, bit_depth, ptr1, len1);
814
+ if (ret[3]) {
815
+ throw takeFromExternrefTable0(ret[2]);
816
+ }
817
+ var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
818
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
819
+ return v3;
820
+ }
821
+
822
+ /**
823
+ * @param {Uint8Array} audio_bytes
824
+ * @param {boolean} lossy
825
+ * @param {number} quality
826
+ * @param {number} level
827
+ * @returns {Uint8Array}
828
+ */
829
+ export function encode_audio_to_flo(audio_bytes, lossy, quality, level) {
830
+ const ptr0 = passArray8ToWasm0(audio_bytes, wasm.__wbindgen_malloc);
831
+ const len0 = WASM_VECTOR_LEN;
832
+ const ret = wasm.encode_audio_to_flo(ptr0, len0, lossy, quality, level);
833
+ if (ret[3]) {
834
+ throw takeFromExternrefTable0(ret[2]);
835
+ }
836
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
837
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
838
+ return v2;
839
+ }
840
+
841
+ /**
842
+ * encode samples to flo lossy
843
+ *
844
+ * # Arguments
845
+ * * `samples` - Interleaved audio samples (f32, -1.0 to 1.0)
846
+ * * `sample_rate` - Sample rate in Hz (e.g., 44100)
847
+ * * `channels` - Number of audio channels (1 or 2)
848
+ * * `bit_depth` - Bits per sample (typically 16)
849
+ * * `quality` - Quality level 0-4 (0=low/~64kbps, 4=transparent/~320kbps)
850
+ * * `metadata` - Optional MessagePack metadata
851
+ *
852
+ * # Returns
853
+ * flo™ file as byte array
854
+ *
855
+ * # Note
856
+ * For advanced usage with continuous quality control (0.0-1.0) or custom settings,
857
+ * use the `LossyEncoder` builder pattern directly.
858
+ * @param {Float32Array} samples
859
+ * @param {number} sample_rate
860
+ * @param {number} channels
861
+ * @param {number} _bit_depth
862
+ * @param {number} quality
863
+ * @param {Uint8Array | null} [metadata]
864
+ * @returns {Uint8Array}
865
+ */
866
+ export function encode_lossy(samples, sample_rate, channels, _bit_depth, quality, metadata) {
867
+ const ptr0 = passArrayF32ToWasm0(samples, wasm.__wbindgen_malloc);
868
+ const len0 = WASM_VECTOR_LEN;
869
+ var ptr1 = isLikeNone(metadata) ? 0 : passArray8ToWasm0(metadata, wasm.__wbindgen_malloc);
870
+ var len1 = WASM_VECTOR_LEN;
871
+ const ret = wasm.encode_lossy(ptr0, len0, sample_rate, channels, _bit_depth, quality, ptr1, len1);
872
+ if (ret[3]) {
873
+ throw takeFromExternrefTable0(ret[2]);
874
+ }
875
+ var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
876
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
877
+ return v3;
878
+ }
879
+
880
+ /**
881
+ * encode to flo lossy with target bitrate
882
+ *
883
+ * # Arguments
884
+ * * `samples` - Interleaved audio samples (f32, -1.0 to 1.0)
885
+ * * `sample_rate` - Sample rate in Hz (e.g., 44100)
886
+ * * `channels` - Number of audio channels
887
+ * * `bit_depth` - Bits per sample (16, 24, or 32)
888
+ * * `target_bitrate_kbps` - Target bitrate in kbps (e.g., 128, 192, 256, 320)
889
+ * * `metadata` - Optional MessagePack metadata
890
+ *
891
+ * # Returns
892
+ * flo™ file as byte array
893
+ * @param {Float32Array} samples
894
+ * @param {number} sample_rate
895
+ * @param {number} channels
896
+ * @param {number} _bit_depth
897
+ * @param {number} target_bitrate_kbps
898
+ * @param {Uint8Array | null} [metadata]
899
+ * @returns {Uint8Array}
900
+ */
901
+ export function encode_with_bitrate(samples, sample_rate, channels, _bit_depth, target_bitrate_kbps, metadata) {
902
+ const ptr0 = passArrayF32ToWasm0(samples, wasm.__wbindgen_malloc);
903
+ const len0 = WASM_VECTOR_LEN;
904
+ var ptr1 = isLikeNone(metadata) ? 0 : passArray8ToWasm0(metadata, wasm.__wbindgen_malloc);
905
+ var len1 = WASM_VECTOR_LEN;
906
+ const ret = wasm.encode_with_bitrate(ptr0, len0, sample_rate, channels, _bit_depth, target_bitrate_kbps, ptr1, len1);
907
+ if (ret[3]) {
908
+ throw takeFromExternrefTable0(ret[2]);
909
+ }
910
+ var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
911
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
912
+ return v3;
913
+ }
914
+
915
+ /**
916
+ * @param {Uint8Array} audio_bytes
917
+ * @returns {any}
918
+ */
919
+ export function get_audio_file_info(audio_bytes) {
920
+ const ptr0 = passArray8ToWasm0(audio_bytes, wasm.__wbindgen_malloc);
921
+ const len0 = WASM_VECTOR_LEN;
922
+ const ret = wasm.get_audio_file_info(ptr0, len0);
923
+ if (ret[2]) {
924
+ throw takeFromExternrefTable0(ret[1]);
925
+ }
926
+ return takeFromExternrefTable0(ret[0]);
927
+ }
928
+
929
+ /**
930
+ * Get cover art from a flo™ file
931
+ *
932
+ * # Arguments
933
+ * * `data` - flo™ file bytes
934
+ *
935
+ * # Returns
936
+ * Object with `mime_type` and `data` (Uint8Array) or null if no cover
937
+ * @param {Uint8Array} data
938
+ * @returns {any}
939
+ */
940
+ export function get_cover_art(data) {
941
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
942
+ const len0 = WASM_VECTOR_LEN;
943
+ const ret = wasm.get_cover_art(ptr0, len0);
944
+ if (ret[2]) {
945
+ throw takeFromExternrefTable0(ret[1]);
946
+ }
947
+ return takeFromExternrefTable0(ret[0]);
948
+ }
949
+
950
+ /**
951
+ * @param {Uint8Array} flo_bytes
952
+ * @returns {FloInfo}
953
+ */
954
+ export function get_flo_file_info(flo_bytes) {
955
+ const ptr0 = passArray8ToWasm0(flo_bytes, wasm.__wbindgen_malloc);
956
+ const len0 = WASM_VECTOR_LEN;
957
+ const ret = wasm.get_flo_file_info(ptr0, len0);
958
+ if (ret[2]) {
959
+ throw takeFromExternrefTable0(ret[1]);
960
+ }
961
+ return FloInfo.__wrap(ret[0]);
962
+ }
963
+
964
+ /**
965
+ * @param {Uint8Array} flo_bytes
966
+ * @returns {string}
967
+ */
968
+ export function get_flo_metadata_json(flo_bytes) {
969
+ let deferred3_0;
970
+ let deferred3_1;
971
+ try {
972
+ const ptr0 = passArray8ToWasm0(flo_bytes, wasm.__wbindgen_malloc);
973
+ const len0 = WASM_VECTOR_LEN;
974
+ const ret = wasm.get_flo_metadata_json(ptr0, len0);
975
+ var ptr2 = ret[0];
976
+ var len2 = ret[1];
977
+ if (ret[3]) {
978
+ ptr2 = 0; len2 = 0;
979
+ throw takeFromExternrefTable0(ret[2]);
980
+ }
981
+ deferred3_0 = ptr2;
982
+ deferred3_1 = len2;
983
+ return getStringFromWasm0(ptr2, len2);
984
+ } finally {
985
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
986
+ }
987
+ }
988
+
989
+ /**
990
+ * Extract metadata from a flo™ file
991
+ *
992
+ * # Arguments
993
+ * * `data` - flo™ file bytes
994
+ *
995
+ * # Returns
996
+ * JavaScript object with metadata fields (or null if no metadata)
997
+ * @param {Uint8Array} data
998
+ * @returns {any}
999
+ */
1000
+ export function get_metadata(data) {
1001
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
1002
+ const len0 = WASM_VECTOR_LEN;
1003
+ const ret = wasm.get_metadata(ptr0, len0);
1004
+ if (ret[2]) {
1005
+ throw takeFromExternrefTable0(ret[1]);
1006
+ }
1007
+ return takeFromExternrefTable0(ret[0]);
1008
+ }
1009
+
1010
+ /**
1011
+ * Get just the metadata bytes from a flo™ file
1012
+ *
1013
+ * # Arguments
1014
+ * * `flo_data` - flo™ file bytes
1015
+ *
1016
+ * # Returns
1017
+ * Raw MessagePack metadata bytes (or empty array)
1018
+ * @param {Uint8Array} flo_data
1019
+ * @returns {Uint8Array}
1020
+ */
1021
+ export function get_metadata_bytes(flo_data) {
1022
+ const ptr0 = passArray8ToWasm0(flo_data, wasm.__wbindgen_malloc);
1023
+ const len0 = WASM_VECTOR_LEN;
1024
+ const ret = wasm.get_metadata_bytes(ptr0, len0);
1025
+ if (ret[3]) {
1026
+ throw takeFromExternrefTable0(ret[2]);
1027
+ }
1028
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1029
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1030
+ return v2;
1031
+ }
1032
+
1033
+ /**
1034
+ * Get section markers from a flo™ file
1035
+ *
1036
+ * # Returns
1037
+ * Array of section markers or null if none
1038
+ * @param {Uint8Array} data
1039
+ * @returns {any}
1040
+ */
1041
+ export function get_section_markers(data) {
1042
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
1043
+ const len0 = WASM_VECTOR_LEN;
1044
+ const ret = wasm.get_section_markers(ptr0, len0);
1045
+ if (ret[2]) {
1046
+ throw takeFromExternrefTable0(ret[1]);
1047
+ }
1048
+ return takeFromExternrefTable0(ret[0]);
1049
+ }
1050
+
1051
+ /**
1052
+ * Get synced lyrics from a flo™ file
1053
+ *
1054
+ * # Returns
1055
+ * Array of synced lyrics objects or null if none
1056
+ * @param {Uint8Array} data
1057
+ * @returns {any}
1058
+ */
1059
+ export function get_synced_lyrics(data) {
1060
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
1061
+ const len0 = WASM_VECTOR_LEN;
1062
+ const ret = wasm.get_synced_lyrics(ptr0, len0);
1063
+ if (ret[2]) {
1064
+ throw takeFromExternrefTable0(ret[1]);
1065
+ }
1066
+ return takeFromExternrefTable0(ret[0]);
1067
+ }
1068
+
1069
+ /**
1070
+ * Get waveform data from a flo™ file for instant visualization
1071
+ *
1072
+ * # Returns
1073
+ * WaveformData object or null if not present
1074
+ * @param {Uint8Array} data
1075
+ * @returns {any}
1076
+ */
1077
+ export function get_waveform_data(data) {
1078
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
1079
+ const len0 = WASM_VECTOR_LEN;
1080
+ const ret = wasm.get_waveform_data(ptr0, len0);
1081
+ if (ret[2]) {
1082
+ throw takeFromExternrefTable0(ret[1]);
1083
+ }
1084
+ return takeFromExternrefTable0(ret[0]);
1085
+ }
1086
+
1087
+ /**
1088
+ * Check if a flo™ file has metadata
1089
+ * @param {Uint8Array} flo_bytes
1090
+ * @returns {boolean}
1091
+ */
1092
+ export function has_flo_metadata(flo_bytes) {
1093
+ const ptr0 = passArray8ToWasm0(flo_bytes, wasm.__wbindgen_malloc);
1094
+ const len0 = WASM_VECTOR_LEN;
1095
+ const ret = wasm.has_flo_metadata(ptr0, len0);
1096
+ return ret !== 0;
1097
+ }
1098
+
1099
+ /**
1100
+ * does the file have metadata?
1101
+ * @param {Uint8Array} flo_data
1102
+ * @returns {boolean}
1103
+ */
1104
+ export function has_metadata(flo_data) {
1105
+ const ptr0 = passArray8ToWasm0(flo_data, wasm.__wbindgen_malloc);
1106
+ const len0 = WASM_VECTOR_LEN;
1107
+ const ret = wasm.has_metadata(ptr0, len0);
1108
+ return ret !== 0;
1109
+ }
1110
+
1111
+ /**
1112
+ * Get information about a flo™ file
1113
+ *
1114
+ * # Arguments
1115
+ * * `data` - flo™ file bytes
1116
+ *
1117
+ * # Returns
1118
+ * AudioInfo struct with file details
1119
+ * @param {Uint8Array} data
1120
+ * @returns {AudioInfo}
1121
+ */
1122
+ export function info(data) {
1123
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
1124
+ const len0 = WASM_VECTOR_LEN;
1125
+ const ret = wasm.info(ptr0, len0);
1126
+ if (ret[2]) {
1127
+ throw takeFromExternrefTable0(ret[1]);
1128
+ }
1129
+ return AudioInfo.__wrap(ret[0]);
1130
+ }
1131
+
1132
+ export function init() {
1133
+ wasm.init();
1134
+ }
1135
+
1136
+ /**
1137
+ * Replace just the metadata in a flo™ file (convenience function)
1138
+ *
1139
+ * Takes a metadata object directly instead of MessagePack bytes.
1140
+ *
1141
+ * # Arguments
1142
+ * * `flo_data` - Original flo™ file bytes
1143
+ * * `metadata` - JavaScript metadata object
1144
+ *
1145
+ * # Returns
1146
+ * New flo™ file with updated metadata
1147
+ * @param {Uint8Array} flo_data
1148
+ * @param {any} metadata
1149
+ * @returns {Uint8Array}
1150
+ */
1151
+ export function set_metadata(flo_data, metadata) {
1152
+ const ptr0 = passArray8ToWasm0(flo_data, wasm.__wbindgen_malloc);
1153
+ const len0 = WASM_VECTOR_LEN;
1154
+ const ret = wasm.set_metadata(ptr0, len0, metadata);
1155
+ if (ret[3]) {
1156
+ throw takeFromExternrefTable0(ret[2]);
1157
+ }
1158
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1159
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1160
+ return v2;
1161
+ }
1162
+
1163
+ /**
1164
+ * Set a single field in existing metadata bytes
1165
+ *
1166
+ * Uses serde to dynamically set fields - field names match FloMetadata struct.
1167
+ * For complex fields (pictures, synced_lyrics, etc.) use create_metadata_from_object.
1168
+ *
1169
+ * # Arguments
1170
+ * * `metadata` - Existing MessagePack metadata bytes (or empty for new)
1171
+ * * `field` - Field name (e.g., "title", "artist", "bpm")
1172
+ * * `value` - Field value (string, number, or null)
1173
+ *
1174
+ * # Returns
1175
+ * Updated MessagePack metadata bytes
1176
+ * @param {Uint8Array | null | undefined} metadata
1177
+ * @param {string} field
1178
+ * @param {any} value
1179
+ * @returns {Uint8Array}
1180
+ */
1181
+ export function set_metadata_field(metadata, field, value) {
1182
+ var ptr0 = isLikeNone(metadata) ? 0 : passArray8ToWasm0(metadata, wasm.__wbindgen_malloc);
1183
+ var len0 = WASM_VECTOR_LEN;
1184
+ const ptr1 = passStringToWasm0(field, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1185
+ const len1 = WASM_VECTOR_LEN;
1186
+ const ret = wasm.set_metadata_field(ptr0, len0, ptr1, len1, value);
1187
+ if (ret[3]) {
1188
+ throw takeFromExternrefTable0(ret[2]);
1189
+ }
1190
+ var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1191
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1192
+ return v3;
1193
+ }
1194
+
1195
+ /**
1196
+ * Strip all metadata from a flo™ file WITHOUT re-encoding audio!
1197
+ * @param {Uint8Array} flo_bytes
1198
+ * @returns {Uint8Array}
1199
+ */
1200
+ export function strip_flo_metadata(flo_bytes) {
1201
+ const ptr0 = passArray8ToWasm0(flo_bytes, wasm.__wbindgen_malloc);
1202
+ const len0 = WASM_VECTOR_LEN;
1203
+ const ret = wasm.strip_flo_metadata(ptr0, len0);
1204
+ if (ret[3]) {
1205
+ throw takeFromExternrefTable0(ret[2]);
1206
+ }
1207
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1208
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1209
+ return v2;
1210
+ }
1211
+
1212
+ /**
1213
+ * Remove all metadata from a flo™ file
1214
+ *
1215
+ * # Arguments
1216
+ * * `flo_data` - Original flo™ file bytes
1217
+ *
1218
+ * # Returns
1219
+ * New flo™ file with no metadata
1220
+ * @param {Uint8Array} flo_data
1221
+ * @returns {Uint8Array}
1222
+ */
1223
+ export function strip_metadata(flo_data) {
1224
+ const ptr0 = passArray8ToWasm0(flo_data, wasm.__wbindgen_malloc);
1225
+ const len0 = WASM_VECTOR_LEN;
1226
+ const ret = wasm.strip_metadata(ptr0, len0);
1227
+ if (ret[3]) {
1228
+ throw takeFromExternrefTable0(ret[2]);
1229
+ }
1230
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1231
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1232
+ return v2;
1233
+ }
1234
+
1235
+ /**
1236
+ * Update metadata in a flo™ file WITHOUT re-encoding audio!
1237
+ * This is instant because flo™ stores metadata in a separate chunk.
1238
+ *
1239
+ * # Arguments
1240
+ * * `flo_bytes` - Original flo™ file bytes
1241
+ * * `metadata` - JavaScript object with metadata fields
1242
+ *
1243
+ * # Returns
1244
+ * New flo™ file bytes with updated metadata
1245
+ * @param {Uint8Array} flo_bytes
1246
+ * @param {any} metadata
1247
+ * @returns {Uint8Array}
1248
+ */
1249
+ export function update_flo_metadata(flo_bytes, metadata) {
1250
+ const ptr0 = passArray8ToWasm0(flo_bytes, wasm.__wbindgen_malloc);
1251
+ const len0 = WASM_VECTOR_LEN;
1252
+ const ret = wasm.update_flo_metadata(ptr0, len0, metadata);
1253
+ if (ret[3]) {
1254
+ throw takeFromExternrefTable0(ret[2]);
1255
+ }
1256
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1257
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1258
+ return v2;
1259
+ }
1260
+
1261
+ /**
1262
+ * update metadata without re-encoding audio
1263
+ *
1264
+ * # Arguments
1265
+ * * `flo_data` - Original flo™ file bytes
1266
+ * * `new_metadata` - New MessagePack metadata bytes (use create_metadata_*)
1267
+ *
1268
+ * # Returns
1269
+ * New flo™ file with updated metadata
1270
+ * @param {Uint8Array} flo_data
1271
+ * @param {Uint8Array} new_metadata
1272
+ * @returns {Uint8Array}
1273
+ */
1274
+ export function update_metadata(flo_data, new_metadata) {
1275
+ const ptr0 = passArray8ToWasm0(flo_data, wasm.__wbindgen_malloc);
1276
+ const len0 = WASM_VECTOR_LEN;
1277
+ const ptr1 = passArray8ToWasm0(new_metadata, wasm.__wbindgen_malloc);
1278
+ const len1 = WASM_VECTOR_LEN;
1279
+ const ret = wasm.update_metadata(ptr0, len0, ptr1, len1);
1280
+ if (ret[3]) {
1281
+ throw takeFromExternrefTable0(ret[2]);
1282
+ }
1283
+ var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1284
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1285
+ return v3;
1286
+ }
1287
+
1288
+ /**
1289
+ * Validate flo™ file integrity
1290
+ *
1291
+ * # Arguments
1292
+ * * `data` - flo™ file bytes
1293
+ *
1294
+ * # Returns
1295
+ * true if file is valid and CRC matches
1296
+ * @param {Uint8Array} data
1297
+ * @returns {boolean}
1298
+ */
1299
+ export function validate(data) {
1300
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
1301
+ const len0 = WASM_VECTOR_LEN;
1302
+ const ret = wasm.validate(ptr0, len0);
1303
+ if (ret[2]) {
1304
+ throw takeFromExternrefTable0(ret[1]);
1305
+ }
1306
+ return ret[0] !== 0;
1307
+ }
1308
+
1309
+ /**
1310
+ * @param {Uint8Array} flo_bytes
1311
+ * @returns {boolean}
1312
+ */
1313
+ export function validate_flo_file(flo_bytes) {
1314
+ const ptr0 = passArray8ToWasm0(flo_bytes, wasm.__wbindgen_malloc);
1315
+ const len0 = WASM_VECTOR_LEN;
1316
+ const ret = wasm.validate_flo_file(ptr0, len0);
1317
+ if (ret[2]) {
1318
+ throw takeFromExternrefTable0(ret[1]);
1319
+ }
1320
+ return ret[0] !== 0;
1321
+ }
1322
+
1323
+ /**
1324
+ * get lib version
1325
+ * @returns {string}
1326
+ */
1327
+ export function version() {
1328
+ let deferred1_0;
1329
+ let deferred1_1;
1330
+ try {
1331
+ const ret = wasm.version();
1332
+ deferred1_0 = ret[0];
1333
+ deferred1_1 = ret[1];
1334
+ return getStringFromWasm0(ret[0], ret[1]);
1335
+ } finally {
1336
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1337
+ }
1338
+ }
1339
+
1340
+ const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
1341
+
1342
+ async function __wbg_load(module, imports) {
1343
+ if (typeof Response === 'function' && module instanceof Response) {
1344
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
1345
+ try {
1346
+ return await WebAssembly.instantiateStreaming(module, imports);
1347
+ } catch (e) {
1348
+ const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);
1349
+
1350
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
1351
+ 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);
1352
+
1353
+ } else {
1354
+ throw e;
1355
+ }
1356
+ }
1357
+ }
1358
+
1359
+ const bytes = await module.arrayBuffer();
1360
+ return await WebAssembly.instantiate(bytes, imports);
1361
+ } else {
1362
+ const instance = await WebAssembly.instantiate(module, imports);
1363
+
1364
+ if (instance instanceof WebAssembly.Instance) {
1365
+ return { instance, module };
1366
+ } else {
1367
+ return instance;
1368
+ }
1369
+ }
1370
+ }
1371
+
1372
+ function __wbg_get_imports() {
1373
+ const imports = {};
1374
+ imports.wbg = {};
1375
+ imports.wbg.__wbg_Error_52673b7de5a0ca89 = function(arg0, arg1) {
1376
+ const ret = Error(getStringFromWasm0(arg0, arg1));
1377
+ return ret;
1378
+ };
1379
+ imports.wbg.__wbg_Number_2d1dcfcf4ec51736 = function(arg0) {
1380
+ const ret = Number(arg0);
1381
+ return ret;
1382
+ };
1383
+ imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
1384
+ const ret = String(arg1);
1385
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1386
+ const len1 = WASM_VECTOR_LEN;
1387
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1388
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1389
+ };
1390
+ imports.wbg.__wbg___wbindgen_bigint_get_as_i64_6e32f5e6aff02e1d = function(arg0, arg1) {
1391
+ const v = arg1;
1392
+ const ret = typeof(v) === 'bigint' ? v : undefined;
1393
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
1394
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1395
+ };
1396
+ imports.wbg.__wbg___wbindgen_boolean_get_dea25b33882b895b = function(arg0) {
1397
+ const v = arg0;
1398
+ const ret = typeof(v) === 'boolean' ? v : undefined;
1399
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
1400
+ };
1401
+ imports.wbg.__wbg___wbindgen_debug_string_adfb662ae34724b6 = function(arg0, arg1) {
1402
+ const ret = debugString(arg1);
1403
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1404
+ const len1 = WASM_VECTOR_LEN;
1405
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1406
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1407
+ };
1408
+ imports.wbg.__wbg___wbindgen_in_0d3e1e8f0c669317 = function(arg0, arg1) {
1409
+ const ret = arg0 in arg1;
1410
+ return ret;
1411
+ };
1412
+ imports.wbg.__wbg___wbindgen_is_bigint_0e1a2e3f55cfae27 = function(arg0) {
1413
+ const ret = typeof(arg0) === 'bigint';
1414
+ return ret;
1415
+ };
1416
+ imports.wbg.__wbg___wbindgen_is_function_8d400b8b1af978cd = function(arg0) {
1417
+ const ret = typeof(arg0) === 'function';
1418
+ return ret;
1419
+ };
1420
+ imports.wbg.__wbg___wbindgen_is_null_dfda7d66506c95b5 = function(arg0) {
1421
+ const ret = arg0 === null;
1422
+ return ret;
1423
+ };
1424
+ imports.wbg.__wbg___wbindgen_is_object_ce774f3490692386 = function(arg0) {
1425
+ const val = arg0;
1426
+ const ret = typeof(val) === 'object' && val !== null;
1427
+ return ret;
1428
+ };
1429
+ imports.wbg.__wbg___wbindgen_is_string_704ef9c8fc131030 = function(arg0) {
1430
+ const ret = typeof(arg0) === 'string';
1431
+ return ret;
1432
+ };
1433
+ imports.wbg.__wbg___wbindgen_is_undefined_f6b95eab589e0269 = function(arg0) {
1434
+ const ret = arg0 === undefined;
1435
+ return ret;
1436
+ };
1437
+ imports.wbg.__wbg___wbindgen_jsval_eq_b6101cc9cef1fe36 = function(arg0, arg1) {
1438
+ const ret = arg0 === arg1;
1439
+ return ret;
1440
+ };
1441
+ imports.wbg.__wbg___wbindgen_jsval_loose_eq_766057600fdd1b0d = function(arg0, arg1) {
1442
+ const ret = arg0 == arg1;
1443
+ return ret;
1444
+ };
1445
+ imports.wbg.__wbg___wbindgen_number_get_9619185a74197f95 = function(arg0, arg1) {
1446
+ const obj = arg1;
1447
+ const ret = typeof(obj) === 'number' ? obj : undefined;
1448
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
1449
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1450
+ };
1451
+ imports.wbg.__wbg___wbindgen_string_get_a2a31e16edf96e42 = function(arg0, arg1) {
1452
+ const obj = arg1;
1453
+ const ret = typeof(obj) === 'string' ? obj : undefined;
1454
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1455
+ var len1 = WASM_VECTOR_LEN;
1456
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1457
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1458
+ };
1459
+ imports.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) {
1460
+ throw new Error(getStringFromWasm0(arg0, arg1));
1461
+ };
1462
+ imports.wbg.__wbg_call_abb4ff46ce38be40 = function() { return handleError(function (arg0, arg1) {
1463
+ const ret = arg0.call(arg1);
1464
+ return ret;
1465
+ }, arguments) };
1466
+ imports.wbg.__wbg_done_62ea16af4ce34b24 = function(arg0) {
1467
+ const ret = arg0.done;
1468
+ return ret;
1469
+ };
1470
+ imports.wbg.__wbg_entries_83c79938054e065f = function(arg0) {
1471
+ const ret = Object.entries(arg0);
1472
+ return ret;
1473
+ };
1474
+ imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
1475
+ let deferred0_0;
1476
+ let deferred0_1;
1477
+ try {
1478
+ deferred0_0 = arg0;
1479
+ deferred0_1 = arg1;
1480
+ console.error(getStringFromWasm0(arg0, arg1));
1481
+ } finally {
1482
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
1483
+ }
1484
+ };
1485
+ imports.wbg.__wbg_from_29a8414a7a7cd19d = function(arg0) {
1486
+ const ret = Array.from(arg0);
1487
+ return ret;
1488
+ };
1489
+ imports.wbg.__wbg_get_6b7bd52aca3f9671 = function(arg0, arg1) {
1490
+ const ret = arg0[arg1 >>> 0];
1491
+ return ret;
1492
+ };
1493
+ imports.wbg.__wbg_get_af9dab7e9603ea93 = function() { return handleError(function (arg0, arg1) {
1494
+ const ret = Reflect.get(arg0, arg1);
1495
+ return ret;
1496
+ }, arguments) };
1497
+ imports.wbg.__wbg_get_with_ref_key_1dc361bd10053bfe = function(arg0, arg1) {
1498
+ const ret = arg0[arg1];
1499
+ return ret;
1500
+ };
1501
+ imports.wbg.__wbg_instanceof_ArrayBuffer_f3320d2419cd0355 = function(arg0) {
1502
+ let result;
1503
+ try {
1504
+ result = arg0 instanceof ArrayBuffer;
1505
+ } catch (_) {
1506
+ result = false;
1507
+ }
1508
+ const ret = result;
1509
+ return ret;
1510
+ };
1511
+ imports.wbg.__wbg_instanceof_Object_577e21051f7bcb79 = function(arg0) {
1512
+ let result;
1513
+ try {
1514
+ result = arg0 instanceof Object;
1515
+ } catch (_) {
1516
+ result = false;
1517
+ }
1518
+ const ret = result;
1519
+ return ret;
1520
+ };
1521
+ imports.wbg.__wbg_instanceof_Uint8Array_da54ccc9d3e09434 = function(arg0) {
1522
+ let result;
1523
+ try {
1524
+ result = arg0 instanceof Uint8Array;
1525
+ } catch (_) {
1526
+ result = false;
1527
+ }
1528
+ const ret = result;
1529
+ return ret;
1530
+ };
1531
+ imports.wbg.__wbg_isArray_51fd9e6422c0a395 = function(arg0) {
1532
+ const ret = Array.isArray(arg0);
1533
+ return ret;
1534
+ };
1535
+ imports.wbg.__wbg_isSafeInteger_ae7d3f054d55fa16 = function(arg0) {
1536
+ const ret = Number.isSafeInteger(arg0);
1537
+ return ret;
1538
+ };
1539
+ imports.wbg.__wbg_iterator_27b7c8b35ab3e86b = function() {
1540
+ const ret = Symbol.iterator;
1541
+ return ret;
1542
+ };
1543
+ imports.wbg.__wbg_length_22ac23eaec9d8053 = function(arg0) {
1544
+ const ret = arg0.length;
1545
+ return ret;
1546
+ };
1547
+ imports.wbg.__wbg_length_86ce4877baf913bb = function(arg0) {
1548
+ const ret = arg0.length;
1549
+ return ret;
1550
+ };
1551
+ imports.wbg.__wbg_length_d45040a40c570362 = function(arg0) {
1552
+ const ret = arg0.length;
1553
+ return ret;
1554
+ };
1555
+ imports.wbg.__wbg_new_1ba21ce319a06297 = function() {
1556
+ const ret = new Object();
1557
+ return ret;
1558
+ };
1559
+ imports.wbg.__wbg_new_25f239778d6112b9 = function() {
1560
+ const ret = new Array();
1561
+ return ret;
1562
+ };
1563
+ imports.wbg.__wbg_new_6421f6084cc5bc5a = function(arg0) {
1564
+ const ret = new Uint8Array(arg0);
1565
+ return ret;
1566
+ };
1567
+ imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
1568
+ const ret = new Error();
1569
+ return ret;
1570
+ };
1571
+ imports.wbg.__wbg_new_b546ae120718850e = function() {
1572
+ const ret = new Map();
1573
+ return ret;
1574
+ };
1575
+ imports.wbg.__wbg_new_from_slice_41e2764a343e3cb1 = function(arg0, arg1) {
1576
+ const ret = new Float32Array(getArrayF32FromWasm0(arg0, arg1));
1577
+ return ret;
1578
+ };
1579
+ imports.wbg.__wbg_new_from_slice_f9c22b9153b26992 = function(arg0, arg1) {
1580
+ const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
1581
+ return ret;
1582
+ };
1583
+ imports.wbg.__wbg_new_with_length_95ba657dfb7d3dfb = function(arg0) {
1584
+ const ret = new Float32Array(arg0 >>> 0);
1585
+ return ret;
1586
+ };
1587
+ imports.wbg.__wbg_next_138a17bbf04e926c = function(arg0) {
1588
+ const ret = arg0.next;
1589
+ return ret;
1590
+ };
1591
+ imports.wbg.__wbg_next_3cfe5c0fe2a4cc53 = function() { return handleError(function (arg0) {
1592
+ const ret = arg0.next();
1593
+ return ret;
1594
+ }, arguments) };
1595
+ imports.wbg.__wbg_prototypesetcall_dfe9b766cdc1f1fd = function(arg0, arg1, arg2) {
1596
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
1597
+ };
1598
+ imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
1599
+ arg0[arg1] = arg2;
1600
+ };
1601
+ imports.wbg.__wbg_set_781438a03c0c3c81 = function() { return handleError(function (arg0, arg1, arg2) {
1602
+ const ret = Reflect.set(arg0, arg1, arg2);
1603
+ return ret;
1604
+ }, arguments) };
1605
+ imports.wbg.__wbg_set_7df433eea03a5c14 = function(arg0, arg1, arg2) {
1606
+ arg0[arg1 >>> 0] = arg2;
1607
+ };
1608
+ imports.wbg.__wbg_set_cb0e657d1901c8d8 = function(arg0, arg1, arg2) {
1609
+ arg0.set(getArrayF32FromWasm0(arg1, arg2));
1610
+ };
1611
+ imports.wbg.__wbg_set_efaaf145b9377369 = function(arg0, arg1, arg2) {
1612
+ const ret = arg0.set(arg1, arg2);
1613
+ return ret;
1614
+ };
1615
+ imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
1616
+ const ret = arg1.stack;
1617
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1618
+ const len1 = WASM_VECTOR_LEN;
1619
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1620
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1621
+ };
1622
+ imports.wbg.__wbg_stringify_655a6390e1f5eb6b = function() { return handleError(function (arg0) {
1623
+ const ret = JSON.stringify(arg0);
1624
+ return ret;
1625
+ }, arguments) };
1626
+ imports.wbg.__wbg_value_57b7b035e117f7ee = function(arg0) {
1627
+ const ret = arg0.value;
1628
+ return ret;
1629
+ };
1630
+ imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
1631
+ // Cast intrinsic for `Ref(String) -> Externref`.
1632
+ const ret = getStringFromWasm0(arg0, arg1);
1633
+ return ret;
1634
+ };
1635
+ imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
1636
+ // Cast intrinsic for `U64 -> Externref`.
1637
+ const ret = BigInt.asUintN(64, arg0);
1638
+ return ret;
1639
+ };
1640
+ imports.wbg.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) {
1641
+ // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
1642
+ const ret = getArrayU8FromWasm0(arg0, arg1);
1643
+ return ret;
1644
+ };
1645
+ imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
1646
+ // Cast intrinsic for `F64 -> Externref`.
1647
+ const ret = arg0;
1648
+ return ret;
1649
+ };
1650
+ imports.wbg.__wbindgen_init_externref_table = function() {
1651
+ const table = wasm.__wbindgen_externrefs;
1652
+ const offset = table.grow(4);
1653
+ table.set(0, undefined);
1654
+ table.set(offset + 0, undefined);
1655
+ table.set(offset + 1, null);
1656
+ table.set(offset + 2, true);
1657
+ table.set(offset + 3, false);
1658
+ };
1659
+
1660
+ return imports;
1661
+ }
1662
+
1663
+ function __wbg_finalize_init(instance, module) {
1664
+ wasm = instance.exports;
1665
+ __wbg_init.__wbindgen_wasm_module = module;
1666
+ cachedDataViewMemory0 = null;
1667
+ cachedFloat32ArrayMemory0 = null;
1668
+ cachedUint8ArrayMemory0 = null;
1669
+
1670
+
1671
+ wasm.__wbindgen_start();
1672
+ return wasm;
1673
+ }
1674
+
1675
+ function initSync(module) {
1676
+ if (wasm !== undefined) return wasm;
1677
+
1678
+
1679
+ if (typeof module !== 'undefined') {
1680
+ if (Object.getPrototypeOf(module) === Object.prototype) {
1681
+ ({module} = module)
1682
+ } else {
1683
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
1684
+ }
1685
+ }
1686
+
1687
+ const imports = __wbg_get_imports();
1688
+ if (!(module instanceof WebAssembly.Module)) {
1689
+ module = new WebAssembly.Module(module);
1690
+ }
1691
+ const instance = new WebAssembly.Instance(module, imports);
1692
+ return __wbg_finalize_init(instance, module);
1693
+ }
1694
+
1695
+ async function __wbg_init(module_or_path) {
1696
+ if (wasm !== undefined) return wasm;
1697
+
1698
+
1699
+ if (typeof module_or_path !== 'undefined') {
1700
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
1701
+ ({module_or_path} = module_or_path)
1702
+ } else {
1703
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
1704
+ }
1705
+ }
1706
+
1707
+ if (typeof module_or_path === 'undefined') {
1708
+ module_or_path = new URL('reflo_bg.wasm', import.meta.url);
1709
+ }
1710
+ const imports = __wbg_get_imports();
1711
+
1712
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
1713
+ module_or_path = fetch(module_or_path);
1714
+ }
1715
+
1716
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
1717
+
1718
+ return __wbg_finalize_init(instance, module);
1719
+ }
1720
+
1721
+ export { initSync };
1722
+ export default __wbg_init;