taglib-wasm 0.1.0 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +144 -79
- package/build/taglib.js +5 -20
- package/build/taglib.wasm +0 -0
- package/index.ts +21 -0
- package/package.json +21 -10
- package/src/enhanced-api.ts +66 -44
- package/src/taglib-embind.ts +231 -0
- package/src/taglib-jsr.ts +544 -0
- package/src/taglib.ts +180 -15
- package/src/types.ts +49 -16
- package/src/wasm-embind.ts +55 -0
- package/src/wasm-jsr.ts +280 -0
- package/src/wasm-workers.ts +159 -0
- package/src/wasm.ts +53 -22
- package/src/workers.ts +345 -0
package/README.md
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
# taglib-wasm
|
|
2
2
|
|
|
3
|
-
[TagLib](https://taglib.org/) is the de-facto standard
|
|
3
|
+
[TagLib](https://taglib.org/) is the most robust, de-facto standard for reading and editing metadata tags (Title, Album, Artist, etc.) in all popular audio formats. See [“Goals & Features”](https://taglib.org/) for the reasons TagLib is so great.
|
|
4
4
|
|
|
5
|
-
`taglib-wasm`
|
|
5
|
+
`taglib-wasm` is designed to be **TagLib for JavaScript/TypeScript** platforms — specifically Deno, Node.js, Bun, web browsers, and Cloudflare Workers. It does this by leveraging technologies including [TagLib](https://taglib.org/) itself, [Emscripten](https://emscripten.org/), and [Wasm](https://webassembly.org/) ([WebAssembly](https://webassembly.org/)).
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
> [!NOTE]
|
|
8
|
+
> I recently created this to support another project I’m creating, but it’s still very new. You’re likely to experience some surprises at this stage of `taglib-wasm`’s development, but I’m extremely moditivated to help address them.
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
## Why?
|
|
11
|
+
|
|
12
|
+
In the process of building a utility to improve the metadata of my music collection, I discovered that the JavaScipt/TypeScipt ecosystem had no battle-tested audio tagging library that supports reading and writing music metadata to all popular audio formats.
|
|
10
13
|
|
|
11
14
|
[`mp3tag.js`](https://mp3tag.js.org/) is mature and active, but only supports MP3 files and ID3 tags. TagLib was an ideal choice from a maturity and capabilities point of view, but wrappers like `node-taglib` appeared to be dormant, and I wanted to avoid making users install platform-specific dependencies whenever possible.
|
|
12
15
|
|
|
13
16
|
## 🎯 Features
|
|
14
17
|
|
|
15
|
-
- **✅ Universal compatibility** – Works
|
|
18
|
+
- **✅ Universal compatibility** – Works with Deno, Node.js, Bun, web browsers, and Cloudflare Workers
|
|
16
19
|
- **✅ TypeScript first** – Complete type definitions and modern API
|
|
17
20
|
- **✅ Full audio format support** – Supports all audio formats supported by TagLib
|
|
18
21
|
- **✅ Format abstraction** – `taglib-wasm` deals with how tags are read from/written to in different file formats
|
|
@@ -22,14 +25,21 @@ In the process of building my own utility to improve the metadata of my own musi
|
|
|
22
25
|
|
|
23
26
|
## 📦 Installation
|
|
24
27
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
### Deno
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
import { TagLib } from "jsr:@charleswiltgen/taglib-wasm";
|
|
32
|
+
```
|
|
28
33
|
|
|
29
|
-
|
|
34
|
+
### Node.js
|
|
35
|
+
|
|
36
|
+
```bash
|
|
30
37
|
npm install taglib-wasm
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Bun
|
|
31
41
|
|
|
32
|
-
|
|
42
|
+
```bash
|
|
33
43
|
bun add taglib-wasm
|
|
34
44
|
```
|
|
35
45
|
|
|
@@ -38,7 +48,7 @@ bun add taglib-wasm
|
|
|
38
48
|
### Deno
|
|
39
49
|
|
|
40
50
|
```typescript
|
|
41
|
-
import { TagLib } from "
|
|
51
|
+
import { TagLib } from "jsr:@charleswiltgen/taglib-wasm";
|
|
42
52
|
|
|
43
53
|
// Initialize TagLib WASM
|
|
44
54
|
const taglib = await TagLib.initialize();
|
|
@@ -63,7 +73,7 @@ file.setAlbum("New Album");
|
|
|
63
73
|
|
|
64
74
|
console.log("Updated tags:", file.tag());
|
|
65
75
|
|
|
66
|
-
//
|
|
76
|
+
// Automatic tag mapping (format-agnostic)
|
|
67
77
|
file.setAcoustidFingerprint("AQADtMmybfGO8NCNEESLnzHyXNOHeHnG...");
|
|
68
78
|
file.setAcoustidId("e7359e88-f1f7-41ed-b9f6-16e58e906997");
|
|
69
79
|
file.setMusicBrainzTrackId("f4d1b6b8-8c1e-4d9a-9f2a-1234567890ab");
|
|
@@ -75,7 +85,7 @@ file.dispose();
|
|
|
75
85
|
### Bun
|
|
76
86
|
|
|
77
87
|
```typescript
|
|
78
|
-
import { TagLib } from
|
|
88
|
+
import { TagLib } from "taglib-wasm";
|
|
79
89
|
|
|
80
90
|
// Initialize TagLib WASM
|
|
81
91
|
const taglib = await TagLib.initialize();
|
|
@@ -100,7 +110,7 @@ file.setAlbum("New Album");
|
|
|
100
110
|
|
|
101
111
|
console.log("Updated tags:", file.tag());
|
|
102
112
|
|
|
103
|
-
//
|
|
113
|
+
// Automatic tag mapping (format-agnostic)
|
|
104
114
|
file.setAcoustidFingerprint("AQADtMmybfGO8NCNEESLnzHyXNOHeHnG...");
|
|
105
115
|
file.setAcoustidId("e7359e88-f1f7-41ed-b9f6-16e58e906997");
|
|
106
116
|
file.setMusicBrainzTrackId("f4d1b6b8-8c1e-4d9a-9f2a-1234567890ab");
|
|
@@ -112,8 +122,8 @@ file.dispose();
|
|
|
112
122
|
### Node.js
|
|
113
123
|
|
|
114
124
|
```typescript
|
|
115
|
-
import { TagLib } from
|
|
116
|
-
import { readFile } from
|
|
125
|
+
import { TagLib } from "taglib-wasm";
|
|
126
|
+
import { readFile } from "fs/promises";
|
|
117
127
|
|
|
118
128
|
// Initialize TagLib WASM
|
|
119
129
|
const taglib = await TagLib.initialize();
|
|
@@ -138,7 +148,7 @@ file.setAlbum("New Album");
|
|
|
138
148
|
|
|
139
149
|
console.log("Updated tags:", file.tag());
|
|
140
150
|
|
|
141
|
-
//
|
|
151
|
+
// Automatic tag mapping (format-agnostic)
|
|
142
152
|
file.setAcoustidFingerprint("AQADtMmybfGO8NCNEESLnzHyXNOHeHnG...");
|
|
143
153
|
file.setAcoustidId("e7359e88-f1f7-41ed-b9f6-16e58e906997");
|
|
144
154
|
file.setMusicBrainzTrackId("f4d1b6b8-8c1e-4d9a-9f2a-1234567890ab");
|
|
@@ -150,7 +160,7 @@ file.dispose();
|
|
|
150
160
|
### Browser
|
|
151
161
|
|
|
152
162
|
```typescript
|
|
153
|
-
import { TagLib } from
|
|
163
|
+
import { TagLib } from "taglib-wasm";
|
|
154
164
|
|
|
155
165
|
// Initialize TagLib WASM
|
|
156
166
|
const taglib = await TagLib.initialize();
|
|
@@ -177,7 +187,7 @@ file.setAlbum("New Album");
|
|
|
177
187
|
|
|
178
188
|
console.log("Updated tags:", file.tag());
|
|
179
189
|
|
|
180
|
-
//
|
|
190
|
+
// Automatic tag mapping (format-agnostic)
|
|
181
191
|
file.setAcoustidFingerprint("AQADtMmybfGO8NCNEESLnzHyXNOHeHnG...");
|
|
182
192
|
file.setAcoustidId("e7359e88-f1f7-41ed-b9f6-16e58e906997");
|
|
183
193
|
file.setMusicBrainzTrackId("f4d1b6b8-8c1e-4d9a-9f2a-1234567890ab");
|
|
@@ -186,6 +196,61 @@ file.setMusicBrainzTrackId("f4d1b6b8-8c1e-4d9a-9f2a-1234567890ab");
|
|
|
186
196
|
file.dispose();
|
|
187
197
|
```
|
|
188
198
|
|
|
199
|
+
### Cloudflare Workers
|
|
200
|
+
|
|
201
|
+
```typescript
|
|
202
|
+
import { TagLib } from "taglib-wasm/workers";
|
|
203
|
+
|
|
204
|
+
export default {
|
|
205
|
+
async fetch(request: Request): Promise<Response> {
|
|
206
|
+
if (request.method === "POST") {
|
|
207
|
+
try {
|
|
208
|
+
// Initialize TagLib WASM
|
|
209
|
+
const taglib = await TagLib.initialize({
|
|
210
|
+
memory: { initial: 8 * 1024 * 1024 }, // 8MB for Workers
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
// Get audio data from request
|
|
214
|
+
const audioData = new Uint8Array(await request.arrayBuffer());
|
|
215
|
+
const file = taglib.openFile(audioData);
|
|
216
|
+
|
|
217
|
+
// Read metadata
|
|
218
|
+
const tags = file.tag();
|
|
219
|
+
const props = file.audioProperties();
|
|
220
|
+
|
|
221
|
+
// Extract metadata
|
|
222
|
+
const metadata = {
|
|
223
|
+
title: tags.title,
|
|
224
|
+
artist: tags.artist,
|
|
225
|
+
album: tags.album,
|
|
226
|
+
year: tags.year,
|
|
227
|
+
genre: tags.genre,
|
|
228
|
+
duration: props.length,
|
|
229
|
+
bitrate: props.bitrate,
|
|
230
|
+
format: file.format(),
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
// Clean up
|
|
234
|
+
file.dispose();
|
|
235
|
+
|
|
236
|
+
return Response.json({
|
|
237
|
+
success: true,
|
|
238
|
+
metadata,
|
|
239
|
+
fileSize: audioData.length,
|
|
240
|
+
});
|
|
241
|
+
} catch (error) {
|
|
242
|
+
return Response.json({
|
|
243
|
+
error: "Failed to process audio file",
|
|
244
|
+
message: (error as Error).message,
|
|
245
|
+
}, { status: 500 });
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
return new Response("Send POST request with audio file", { status: 400 });
|
|
250
|
+
},
|
|
251
|
+
};
|
|
252
|
+
```
|
|
253
|
+
|
|
189
254
|
## 📋 Supported Formats
|
|
190
255
|
|
|
191
256
|
All formats are **fully tested and working**:
|
|
@@ -197,11 +262,12 @@ All formats are **fully tested and working**:
|
|
|
197
262
|
- ✅ **WAV** – INFO chunk metadata
|
|
198
263
|
- 🔄 **Additional formats**: Opus, APE, MPC, WavPack, TrueAudio, and more
|
|
199
264
|
|
|
200
|
-
## 🎯
|
|
265
|
+
## 🎯 Automatic Tag Mapping
|
|
201
266
|
|
|
202
|
-
TagLib WASM supports **
|
|
267
|
+
TagLib WASM supports **automatic tag mapping** so you don’t have to worry about how the same tag is stored differently in different audio container formats.
|
|
203
268
|
|
|
204
269
|
### AcoustID example
|
|
270
|
+
|
|
205
271
|
```typescript
|
|
206
272
|
// Single API works for ALL formats (MP3, FLAC, OGG, MP4)
|
|
207
273
|
file.setAcoustidFingerprint("AQADtMmybfGO8NCNEESLnzHyXNOHeHnG...");
|
|
@@ -214,6 +280,7 @@ file.setAcoustidId("e7359e88-f1f7-41ed-b9f6-16e58e906997");
|
|
|
214
280
|
```
|
|
215
281
|
|
|
216
282
|
### MusicBrainz example
|
|
283
|
+
|
|
217
284
|
```typescript
|
|
218
285
|
// Professional music database integration
|
|
219
286
|
file.setMusicBrainzTrackId("f4d1b6b8-8c1e-4d9a-9f2a-1234567890ab");
|
|
@@ -222,6 +289,7 @@ file.setMusicBrainzArtistId("12345678-90ab-cdef-1234-567890abcdef");
|
|
|
222
289
|
```
|
|
223
290
|
|
|
224
291
|
### Volume example
|
|
292
|
+
|
|
225
293
|
```typescript
|
|
226
294
|
// ReplayGain support (automatic format mapping)
|
|
227
295
|
file.setReplayGainTrackGain("-6.54 dB");
|
|
@@ -234,6 +302,7 @@ file.setAppleSoundCheck("00000150 00000150 00000150 00000150...");
|
|
|
234
302
|
```
|
|
235
303
|
|
|
236
304
|
### Extended fields
|
|
305
|
+
|
|
237
306
|
```typescript
|
|
238
307
|
// Advanced metadata fields
|
|
239
308
|
file.setExtendedTag({
|
|
@@ -249,7 +318,7 @@ file.setExtendedTag({
|
|
|
249
318
|
});
|
|
250
319
|
```
|
|
251
320
|
|
|
252
|
-
**📖 See [
|
|
321
|
+
**📖 See [docs/Automatic-Tag-Mapping.md](docs/Automatic-Tag-Mapping.md) for complete documentation**
|
|
253
322
|
|
|
254
323
|
## 🏗️ Development
|
|
255
324
|
|
|
@@ -272,7 +341,7 @@ deno task test
|
|
|
272
341
|
|
|
273
342
|
### Project Structure
|
|
274
343
|
|
|
275
|
-
```
|
|
344
|
+
```text
|
|
276
345
|
src/
|
|
277
346
|
├── mod.ts # Main module exports
|
|
278
347
|
├── taglib.ts # Core TagLib and AudioFile classes
|
|
@@ -284,7 +353,7 @@ build/
|
|
|
284
353
|
├── taglib.js # Generated Emscripten JavaScript
|
|
285
354
|
└── taglib.wasm # Compiled WebAssembly module
|
|
286
355
|
|
|
287
|
-
|
|
356
|
+
tests/ # Test files and sample audio files
|
|
288
357
|
tests/ # Test suite
|
|
289
358
|
examples/ # Usage examples for different runtimes
|
|
290
359
|
├── deno/ # Deno-specific examples
|
|
@@ -307,12 +376,12 @@ bun run test-systematic.ts
|
|
|
307
376
|
# Run with Node.js
|
|
308
377
|
npm test
|
|
309
378
|
|
|
310
|
-
# Results:
|
|
311
|
-
# ✅ WAV -
|
|
312
|
-
# ✅ MP3 -
|
|
313
|
-
# ✅ FLAC -
|
|
314
|
-
# ✅ OGG -
|
|
315
|
-
# ✅ M4A -
|
|
379
|
+
# Results: All formats working ✅ across all runtimes
|
|
380
|
+
# ✅ WAV - INFO chunk metadata support
|
|
381
|
+
# ✅ MP3 - ID3v1/v2 tag support
|
|
382
|
+
# ✅ FLAC - Vorbis comments and properties
|
|
383
|
+
# ✅ OGG - Vorbis comments
|
|
384
|
+
# ✅ M4A - iTunes-compatible metadata atoms
|
|
316
385
|
```
|
|
317
386
|
|
|
318
387
|
## 🔧 Technical Implementation
|
|
@@ -337,9 +406,9 @@ npm test
|
|
|
337
406
|
|
|
338
407
|
```typescript
|
|
339
408
|
class TagLib {
|
|
340
|
-
static async initialize(config?: TagLibConfig): Promise<TagLib
|
|
341
|
-
openFile(buffer: Uint8Array): AudioFile
|
|
342
|
-
getModule(): TagLibModule
|
|
409
|
+
static async initialize(config?: TagLibConfig): Promise<TagLib>;
|
|
410
|
+
openFile(buffer: Uint8Array): AudioFile;
|
|
411
|
+
getModule(): TagLibModule;
|
|
343
412
|
}
|
|
344
413
|
```
|
|
345
414
|
|
|
@@ -348,51 +417,51 @@ class TagLib {
|
|
|
348
417
|
```typescript
|
|
349
418
|
class AudioFile {
|
|
350
419
|
// Validation
|
|
351
|
-
isValid(): boolean
|
|
352
|
-
format(): string
|
|
420
|
+
isValid(): boolean;
|
|
421
|
+
format(): string;
|
|
353
422
|
|
|
354
423
|
// Properties
|
|
355
|
-
audioProperties(): AudioProperties
|
|
356
|
-
tag(): TagData
|
|
424
|
+
audioProperties(): AudioProperties;
|
|
425
|
+
tag(): TagData;
|
|
357
426
|
|
|
358
427
|
// Tag Writing
|
|
359
|
-
setTitle(title: string): void
|
|
360
|
-
setArtist(artist: string): void
|
|
361
|
-
setAlbum(album: string): void
|
|
362
|
-
setComment(comment: string): void
|
|
363
|
-
setGenre(genre: string): void
|
|
364
|
-
setYear(year: number): void
|
|
365
|
-
setTrack(track: number): void
|
|
428
|
+
setTitle(title: string): void;
|
|
429
|
+
setArtist(artist: string): void;
|
|
430
|
+
setAlbum(album: string): void;
|
|
431
|
+
setComment(comment: string): void;
|
|
432
|
+
setGenre(genre: string): void;
|
|
433
|
+
setYear(year: number): void;
|
|
434
|
+
setTrack(track: number): void;
|
|
366
435
|
|
|
367
436
|
// File Operations
|
|
368
|
-
save(): boolean
|
|
369
|
-
dispose(): void
|
|
437
|
+
save(): boolean;
|
|
438
|
+
dispose(): void;
|
|
370
439
|
|
|
371
|
-
//
|
|
372
|
-
extendedTag(): ExtendedTag
|
|
373
|
-
setExtendedTag(tag: Partial<ExtendedTag>): void
|
|
440
|
+
// Automatic Tag Mapping (Format-Agnostic)
|
|
441
|
+
extendedTag(): ExtendedTag;
|
|
442
|
+
setExtendedTag(tag: Partial<ExtendedTag>): void;
|
|
374
443
|
|
|
375
444
|
// AcoustID Integration
|
|
376
|
-
setAcoustidFingerprint(fingerprint: string): void
|
|
377
|
-
getAcoustidFingerprint(): string | undefined
|
|
378
|
-
setAcoustidId(id: string): void
|
|
379
|
-
getAcoustidId(): string | undefined
|
|
445
|
+
setAcoustidFingerprint(fingerprint: string): void;
|
|
446
|
+
getAcoustidFingerprint(): string | undefined;
|
|
447
|
+
setAcoustidId(id: string): void;
|
|
448
|
+
getAcoustidId(): string | undefined;
|
|
380
449
|
|
|
381
450
|
// MusicBrainz Integration
|
|
382
|
-
setMusicBrainzTrackId(id: string): void
|
|
383
|
-
getMusicBrainzTrackId(): string | undefined
|
|
451
|
+
setMusicBrainzTrackId(id: string): void;
|
|
452
|
+
getMusicBrainzTrackId(): string | undefined;
|
|
384
453
|
|
|
385
454
|
// Volume Normalization
|
|
386
|
-
setReplayGainTrackGain(gain: string): void
|
|
387
|
-
getReplayGainTrackGain(): string | undefined
|
|
388
|
-
setReplayGainTrackPeak(peak: string): void
|
|
389
|
-
getReplayGainTrackPeak(): string | undefined
|
|
390
|
-
setReplayGainAlbumGain(gain: string): void
|
|
391
|
-
getReplayGainAlbumGain(): string | undefined
|
|
392
|
-
setReplayGainAlbumPeak(peak: string): void
|
|
393
|
-
getReplayGainAlbumPeak(): string | undefined
|
|
394
|
-
setAppleSoundCheck(iTunNORM: string): void
|
|
395
|
-
getAppleSoundCheck(): string | undefined
|
|
455
|
+
setReplayGainTrackGain(gain: string): void;
|
|
456
|
+
getReplayGainTrackGain(): string | undefined;
|
|
457
|
+
setReplayGainTrackPeak(peak: string): void;
|
|
458
|
+
getReplayGainTrackPeak(): string | undefined;
|
|
459
|
+
setReplayGainAlbumGain(gain: string): void;
|
|
460
|
+
getReplayGainAlbumGain(): string | undefined;
|
|
461
|
+
setReplayGainAlbumPeak(peak: string): void;
|
|
462
|
+
getReplayGainAlbumPeak(): string | undefined;
|
|
463
|
+
setAppleSoundCheck(iTunNORM: string): void;
|
|
464
|
+
getAppleSoundCheck(): string | undefined;
|
|
396
465
|
}
|
|
397
466
|
```
|
|
398
467
|
|
|
@@ -401,10 +470,10 @@ class AudioFile {
|
|
|
401
470
|
```typescript
|
|
402
471
|
interface TagLibConfig {
|
|
403
472
|
memory?: {
|
|
404
|
-
initial?: number;
|
|
405
|
-
maximum?: number;
|
|
473
|
+
initial?: number; // Initial memory size (default: 16MB)
|
|
474
|
+
maximum?: number; // Maximum memory size (default: 256MB)
|
|
406
475
|
};
|
|
407
|
-
debug?: boolean;
|
|
476
|
+
debug?: boolean; // Enable debug output
|
|
408
477
|
}
|
|
409
478
|
```
|
|
410
479
|
|
|
@@ -412,14 +481,14 @@ interface TagLibConfig {
|
|
|
412
481
|
|
|
413
482
|
TagLib WASM works seamlessly across all major JavaScript runtimes:
|
|
414
483
|
|
|
415
|
-
| Runtime
|
|
416
|
-
|
|
417
|
-
| **Deno**
|
|
418
|
-
| **Bun**
|
|
419
|
-
| **Node.js** | ✅ Full | `npm install taglib-wasm`
|
|
420
|
-
| **Browser** | ✅ Full | CDN/bundler
|
|
484
|
+
| Runtime | Status | Installation | Performance | TypeScript |
|
|
485
|
+
| ----------- | ------- | --------------------------------- | ----------- | ---------- |
|
|
486
|
+
| **Deno** | ✅ Full | `jsr:@charleswiltgen/taglib-wasm` | Excellent | Native |
|
|
487
|
+
| **Bun** | ✅ Full | `bun add taglib-wasm` | Excellent | Native |
|
|
488
|
+
| **Node.js** | ✅ Full | `npm install taglib-wasm` | Good | Via loader |
|
|
489
|
+
| **Browser** | ✅ Full | CDN/bundler | Good | Via build |
|
|
421
490
|
|
|
422
|
-
**📖 See [
|
|
491
|
+
**📖 See [docs/Runtime-Compatibility.md](docs/Runtime-Compatibility.md) for detailed runtime information**
|
|
423
492
|
|
|
424
493
|
## 🚧 Known Limitations
|
|
425
494
|
|
|
@@ -446,7 +515,3 @@ Contributions welcome! Areas of interest:
|
|
|
446
515
|
|
|
447
516
|
- [TagLib](https://taglib.org/) – Excellent audio metadata library
|
|
448
517
|
- [Emscripten](https://emscripten.org/) – WebAssembly compilation toolchain
|
|
449
|
-
|
|
450
|
-
---
|
|
451
|
-
|
|
452
|
-
**Status**: Production Ready - Universal audio metadata handling across all JavaScript runtimes.
|
package/build/taglib.js
CHANGED
|
@@ -1,25 +1,10 @@
|
|
|
1
|
-
var
|
|
1
|
+
var createTagLibModule = (() => {
|
|
2
2
|
var _scriptName = typeof document != 'undefined' ? document.currentScript?.src : undefined;
|
|
3
3
|
return (
|
|
4
4
|
async function(moduleArg = {}) {
|
|
5
5
|
var moduleRtn;
|
|
6
6
|
|
|
7
|
-
var c=moduleArg,aa="object"==typeof window,ba="undefined"!=typeof WorkerGlobalScope,m="object"==typeof process&&process.versions?.node&&"renderer"!=process.type;"undefined"!=typeof __filename&&(_scriptName=__filename);var p="",q,r;
|
|
8
|
-
if(m){var fs=require("fs");p=__dirname+"/";r=a=>{a=t(a)?new URL(a):a;return fs.readFileSync(a)};q=async a=>{a=t(a)?new URL(a):a;return fs.readFileSync(a,void 0)};process.argv.slice(2)}else if(aa||ba){try{p=(new URL(".",_scriptName)).href}catch{}q=async a=>{a=await fetch(a,{credentials:"same-origin"});if(a.ok)return a.arrayBuffer();throw Error(a.status+" : "+a.url);}}console.log.bind(console);var u=console.error.bind(console),v,w=!1,t=a=>a.startsWith("file://"),x,y,z,A,B,C,D,E,F,G,H,I=!1;
|
|
9
|
-
function J(){var a=z.buffer;A=new Int8Array(a);C=new Int16Array(a);B=new Uint8Array(a);new Uint16Array(a);D=new Int32Array(a);E=new Uint32Array(a);F=new Float32Array(a);G=new Float64Array(a);H=new BigInt64Array(a);new BigUint64Array(a)}var K=0,L=null;function M(a){c.onAbort?.(a);a="Aborted("+a+")";u(a);w=!0;a=new WebAssembly.RuntimeError(a+". Build with -sASSERTIONS for more info.");y?.(a);throw a;}var N;
|
|
10
|
-
async function ca(a){if(!v)try{var d=await q(a);return new Uint8Array(d)}catch{}if(a==N&&v)a=new Uint8Array(v);else if(r)a=r(a);else throw"both async and sync fetching of the wasm failed";return a}async function da(a,d){try{var b=await ca(a);return await WebAssembly.instantiate(b,d)}catch(e){u(`failed to asynchronously prepare wasm: ${e}`),M(e)}}
|
|
11
|
-
async function ea(a){var d=N;if(!v&&"function"==typeof WebAssembly.instantiateStreaming&&!m)try{var b=fetch(d,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(b,a)}catch(e){u(`wasm streaming compile failed: ${e}`),u("falling back to ArrayBuffer instantiation")}return da(d,a)}var O=a=>{for(;0<a.length;)a.shift()(c)},P=[],Q=[],fa=()=>{var a=c.preRun.shift();Q.push(a)};class ha{constructor(a){this.J=a-24}}
|
|
12
|
-
var R=0,ia=0,S=a=>{for(var d=0,b=0;b<a.length;++b){var e=a.charCodeAt(b);127>=e?d++:2047>=e?d+=2:55296<=e&&57343>=e?(d+=4,++b):d+=3}return d},T=(a,d,b,e)=>{if(!(0<e))return 0;var f=b;e=b+e-1;for(var h=0;h<a.length;++h){var g=a.codePointAt(h);if(127>=g){if(b>=e)break;d[b++]=g}else if(2047>=g){if(b+1>=e)break;d[b++]=192|g>>6;d[b++]=128|g&63}else if(65535>=g){if(b+2>=e)break;d[b++]=224|g>>12;d[b++]=128|g>>6&63;d[b++]=128|g&63}else{if(b+3>=e)break;d[b++]=240|g>>18;d[b++]=128|g>>12&63;d[b++]=128|g>>6&
|
|
13
|
-
63;d[b++]=128|g&63;h++}}d[b]=0;return b-f},U="undefined"!=typeof TextDecoder?new TextDecoder:void 0,ja=(a=0)=>{for(var d=B,b=a+NaN,e=a;d[e]&&!(e>=b);)++e;if(16<e-a&&d.buffer&&U)return U.decode(d.subarray(a,e));for(b="";a<e;){var f=d[a++];if(f&128){var h=d[a++]&63;if(192==(f&224))b+=String.fromCharCode((f&31)<<6|h);else{var g=d[a++]&63;f=224==(f&240)?(f&15)<<12|h<<6|g:(f&7)<<18|h<<12|g<<6|d[a++]&63;65536>f?b+=String.fromCharCode(f):(f-=65536,b+=String.fromCharCode(55296|f>>10,56320|f&1023))}}else b+=
|
|
14
|
-
String.fromCharCode(f)}return b},ma=(a,d,b,e)=>{var f={string:k=>{var l=0;if(null!==k&&void 0!==k&&0!==k){l=S(k)+1;var Y=V(l);T(k,B,Y,l);l=Y}return l},array:k=>{var l=V(k.length);A.set(k,l);return l}};a=c["_"+a];var h=[],g=0;if(e)for(var n=0;n<e.length;n++){var Z=f[b[n]];Z?(0===g&&(g=ka()),h[n]=Z(e[n])):h[n]=e[n]}b=a(...h);return b=function(k){0!==g&&la(g);return"string"===d?k?ja(k):"":"boolean"===d?!!k:k}(b)};c.printErr&&(u=c.printErr);c.wasmBinary&&(v=c.wasmBinary);c.ccall=ma;
|
|
15
|
-
c.cwrap=(a,d,b,e)=>{var f=!b||b.every(h=>"number"===h||"boolean"===h);return"string"!==d&&f&&!e?c["_"+a]:(...h)=>ma(a,d,b,h,e)};c.setValue=function(a,d,b="i8"){b.endsWith("*")&&(b="*");switch(b){case "i1":A[a]=d;break;case "i8":A[a]=d;break;case "i16":C[a>>1]=d;break;case "i32":D[a>>2]=d;break;case "i64":H[a>>3]=BigInt(d);break;case "float":F[a>>2]=d;break;case "double":G[a>>3]=d;break;case "*":E[a>>2]=d;break;default:M(`invalid type for setValue: ${b}`)}};
|
|
16
|
-
c.getValue=function(a,d="i8"){d.endsWith("*")&&(d="*");switch(d){case "i1":return A[a];case "i8":return A[a];case "i16":return C[a>>1];case "i32":return D[a>>2];case "i64":return H[a>>3];case "float":return F[a>>2];case "double":return G[a>>3];case "*":return E[a>>2];default:M(`invalid type for getValue: ${d}`)}};c.intArrayFromString=(a,d,b)=>{b=Array(0<b?b:S(a)+1);a=T(a,b,0,b.length);d&&(b.length=a);return b};c.ALLOC_NORMAL=0;
|
|
17
|
-
c.allocate=(a,d)=>{d=1==d?V(a.length):na(a.length);a.subarray||a.slice||(a=new Uint8Array(a));B.set(a,d);return d};
|
|
18
|
-
var na,la,V,ka,oa={a:(a,d,b)=>{var e=new ha(a);E[e.J+16>>2]=0;E[e.J+4>>2]=d;E[e.J+8>>2]=b;R=a;ia++;throw R;},b:()=>M(""),c:a=>{var d=B.length;a>>>=0;if(268435456<a)return!1;for(var b=1;4>=b;b*=2){var e=d*(1+.2/b);e=Math.min(e,a+100663296);a:{e=(Math.min(268435456,65536*Math.ceil(Math.max(a,e)/65536))-z.buffer.byteLength+65535)/65536|0;try{z.grow(e);J();var f=1;break a}catch(h){}f=void 0}if(f)return!0}return!1}},W=await (async function(){function a(b){W=b.exports;z=W.d;J();b=W;c._taglib_file_new_from_buffer=
|
|
19
|
-
b.f;c._taglib_file_delete=b.g;c._taglib_file_save=b.h;c._taglib_file_is_valid=b.i;c._taglib_file_format=b.j;c._taglib_file_tag=b.k;c._taglib_tag_title=b.l;c._taglib_tag_artist=b.m;c._taglib_tag_album=b.n;c._taglib_tag_comment=b.o;c._taglib_tag_genre=b.p;c._taglib_tag_year=b.q;c._taglib_tag_track=b.r;c._taglib_tag_set_title=b.s;c._taglib_tag_set_artist=b.t;c._taglib_tag_set_album=b.u;c._taglib_tag_set_comment=b.v;c._taglib_tag_set_genre=b.w;c._taglib_tag_set_year=b.x;c._taglib_tag_set_track=b.y;c._taglib_file_audioproperties=
|
|
20
|
-
b.z;c._taglib_audioproperties_length=b.A;c._taglib_audioproperties_bitrate=b.B;c._taglib_audioproperties_samplerate=b.C;c._taglib_audioproperties_channels=b.D;c._malloc=na=b.E;c._free=b.F;la=b.G;V=b.H;ka=b.I;K--;c.monitorRunDependencies?.(K);0==K&&L&&(b=L,L=null,b());return W}K++;c.monitorRunDependencies?.(K);var d={a:oa};if(c.instantiateWasm)return new Promise(b=>{c.instantiateWasm(d,(e,f)=>{b(a(e,f))})});N??=c.locateFile?c.locateFile("taglib.wasm",p):p+"taglib.wasm";return a((await ea(d)).instance)}());
|
|
21
|
-
function X(){function a(){c.calledRun=!0;if(!w){I=!0;W.e();x?.(c);c.onRuntimeInitialized?.();if(c.postRun)for("function"==typeof c.postRun&&(c.postRun=[c.postRun]);c.postRun.length;){var d=c.postRun.shift();P.push(d)}O(P)}}if(0<K)L=X;else{if(c.preRun)for("function"==typeof c.preRun&&(c.preRun=[c.preRun]);c.preRun.length;)fa();O(Q);0<K?L=X:c.setStatus?(c.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>c.setStatus(""),1);a()},1)):a()}}
|
|
22
|
-
if(c.preInit)for("function"==typeof c.preInit&&(c.preInit=[c.preInit]);0<c.preInit.length;)c.preInit.shift()();X();I?moduleRtn=c:moduleRtn=new Promise((a,d)=>{x=a;y=d});
|
|
7
|
+
var Module=moduleArg;var ENVIRONMENT_IS_WEB=typeof window=="object";var ENVIRONMENT_IS_WORKER=typeof WorkerGlobalScope!="undefined";var ENVIRONMENT_IS_NODE=typeof process=="object"&&process.versions?.node&&process.type!="renderer";var arguments_=[];var thisProgram="./this.program";var quit_=(status,toThrow)=>{throw toThrow};if(typeof __filename!="undefined"){_scriptName=__filename}else if(ENVIRONMENT_IS_WORKER){_scriptName=self.location.href}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var readAsync,readBinary;if(ENVIRONMENT_IS_NODE){var fs=require("fs");scriptDirectory=__dirname+"/";readBinary=filename=>{filename=isFileURI(filename)?new URL(filename):filename;var ret=fs.readFileSync(filename);return ret};readAsync=async(filename,binary=true)=>{filename=isFileURI(filename)?new URL(filename):filename;var ret=fs.readFileSync(filename,binary?undefined:"utf8");return ret};if(process.argv.length>1){thisProgram=process.argv[1].replace(/\\/g,"/")}arguments_=process.argv.slice(2);quit_=(status,toThrow)=>{process.exitCode=status;throw toThrow}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){try{scriptDirectory=new URL(".",_scriptName).href}catch{}{if(ENVIRONMENT_IS_WORKER){readBinary=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=async url=>{if(isFileURI(url)){return new Promise((resolve,reject)=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=()=>{if(xhr.status==200||xhr.status==0&&xhr.response){resolve(xhr.response);return}reject(xhr.status)};xhr.onerror=reject;xhr.send(null)})}var response=await fetch(url,{credentials:"same-origin"});if(response.ok){return response.arrayBuffer()}throw new Error(response.status+" : "+response.url)}}}else{}var out=console.log.bind(console);var err=console.error.bind(console);var wasmBinary;var ABORT=false;var isFileURI=filename=>filename.startsWith("file://");var readyPromiseResolve,readyPromiseReject;var wasmMemory;var HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;var HEAP64,HEAPU64;var runtimeInitialized=false;function updateMemoryViews(){var b=wasmMemory.buffer;HEAP8=new Int8Array(b);HEAP16=new Int16Array(b);HEAPU8=new Uint8Array(b);HEAPU16=new Uint16Array(b);HEAP32=new Int32Array(b);HEAPU32=new Uint32Array(b);HEAPF32=new Float32Array(b);HEAPF64=new Float64Array(b);HEAP64=new BigInt64Array(b);HEAPU64=new BigUint64Array(b)}function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(onPreRuns)}function initRuntime(){runtimeInitialized=true;wasmExports["pa"]()}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(onPostRuns)}var runDependencies=0;var dependenciesFulfilled=null;function addRunDependency(id){runDependencies++;Module["monitorRunDependencies"]?.(runDependencies)}function removeRunDependency(id){runDependencies--;Module["monitorRunDependencies"]?.(runDependencies);if(runDependencies==0){if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}function abort(what){Module["onAbort"]?.(what);what="Aborted("+what+")";err(what);ABORT=true;what+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(what);readyPromiseReject?.(e);throw e}var wasmBinaryFile;function findWasmBinary(){return locateFile("taglib.wasm")}function getBinarySync(file){if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}throw"both async and sync fetching of the wasm failed"}async function getWasmBinary(binaryFile){if(!wasmBinary){try{var response=await readAsync(binaryFile);return new Uint8Array(response)}catch{}}return getBinarySync(binaryFile)}async function instantiateArrayBuffer(binaryFile,imports){try{var binary=await getWasmBinary(binaryFile);var instance=await WebAssembly.instantiate(binary,imports);return instance}catch(reason){err(`failed to asynchronously prepare wasm: ${reason}`);abort(reason)}}async function instantiateAsync(binary,binaryFile,imports){if(!binary&&typeof WebAssembly.instantiateStreaming=="function"&&!isFileURI(binaryFile)&&!ENVIRONMENT_IS_NODE){try{var response=fetch(binaryFile,{credentials:"same-origin"});var instantiationResult=await WebAssembly.instantiateStreaming(response,imports);return instantiationResult}catch(reason){err(`wasm streaming compile failed: ${reason}`);err("falling back to ArrayBuffer instantiation")}}return instantiateArrayBuffer(binaryFile,imports)}function getWasmImports(){return{a:wasmImports}}async function createWasm(){function receiveInstance(instance,module){wasmExports=instance.exports;wasmMemory=wasmExports["oa"];updateMemoryViews();wasmTable=wasmExports["qa"];assignWasmExports(wasmExports);removeRunDependency("wasm-instantiate");return wasmExports}addRunDependency("wasm-instantiate");function receiveInstantiationResult(result){return receiveInstance(result["instance"])}var info=getWasmImports();if(Module["instantiateWasm"]){return new Promise((resolve,reject)=>{Module["instantiateWasm"](info,(mod,inst)=>{resolve(receiveInstance(mod,inst))})})}wasmBinaryFile??=findWasmBinary();var result=await instantiateAsync(wasmBinary,wasmBinaryFile,info);var exports=receiveInstantiationResult(result);return exports}class ExitStatus{name="ExitStatus";constructor(status){this.message=`Program terminated with exit(${status})`;this.status=status}}var callRuntimeCallbacks=callbacks=>{while(callbacks.length>0){callbacks.shift()(Module)}};var onPostRuns=[];var addOnPostRun=cb=>onPostRuns.push(cb);var onPreRuns=[];var addOnPreRun=cb=>onPreRuns.push(cb);function getValue(ptr,type="i8"){if(type.endsWith("*"))type="*";switch(type){case"i1":return HEAP8[ptr];case"i8":return HEAP8[ptr];case"i16":return HEAP16[ptr>>1];case"i32":return HEAP32[ptr>>2];case"i64":return HEAP64[ptr>>3];case"float":return HEAPF32[ptr>>2];case"double":return HEAPF64[ptr>>3];case"*":return HEAPU32[ptr>>2];default:abort(`invalid type for getValue: ${type}`)}}var noExitRuntime=true;function setValue(ptr,value,type="i8"){if(type.endsWith("*"))type="*";switch(type){case"i1":HEAP8[ptr]=value;break;case"i8":HEAP8[ptr]=value;break;case"i16":HEAP16[ptr>>1]=value;break;case"i32":HEAP32[ptr>>2]=value;break;case"i64":HEAP64[ptr>>3]=BigInt(value);break;case"float":HEAPF32[ptr>>2]=value;break;case"double":HEAPF64[ptr>>3]=value;break;case"*":HEAPU32[ptr>>2]=value;break;default:abort(`invalid type for setValue: ${type}`)}}var stackRestore=val=>__emscripten_stack_restore(val);var stackSave=()=>_emscripten_stack_get_current();var exceptionCaught=[];var uncaughtExceptionCount=0;var ___cxa_begin_catch=ptr=>{var info=new ExceptionInfo(ptr);if(!info.get_caught()){info.set_caught(true);uncaughtExceptionCount--}info.set_rethrown(false);exceptionCaught.push(info);___cxa_increment_exception_refcount(ptr);return ___cxa_get_exception_ptr(ptr)};var exceptionLast=0;var ___cxa_end_catch=()=>{_setThrew(0,0);var info=exceptionCaught.pop();___cxa_decrement_exception_refcount(info.excPtr);exceptionLast=0};class ExceptionInfo{constructor(excPtr){this.excPtr=excPtr;this.ptr=excPtr-24}set_type(type){HEAPU32[this.ptr+4>>2]=type}get_type(){return HEAPU32[this.ptr+4>>2]}set_destructor(destructor){HEAPU32[this.ptr+8>>2]=destructor}get_destructor(){return HEAPU32[this.ptr+8>>2]}set_caught(caught){caught=caught?1:0;HEAP8[this.ptr+12]=caught}get_caught(){return HEAP8[this.ptr+12]!=0}set_rethrown(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+13]=rethrown}get_rethrown(){return HEAP8[this.ptr+13]!=0}init(type,destructor){this.set_adjusted_ptr(0);this.set_type(type);this.set_destructor(destructor)}set_adjusted_ptr(adjustedPtr){HEAPU32[this.ptr+16>>2]=adjustedPtr}get_adjusted_ptr(){return HEAPU32[this.ptr+16>>2]}}var setTempRet0=val=>__emscripten_tempret_set(val);var findMatchingCatch=args=>{var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0}var info=new ExceptionInfo(thrown);info.set_adjusted_ptr(thrown);var thrownType=info.get_type();if(!thrownType){setTempRet0(0);return thrown}for(var caughtType of args){if(caughtType===0||caughtType===thrownType){break}var adjusted_ptr_addr=info.ptr+16;if(___cxa_can_catch(caughtType,thrownType,adjusted_ptr_addr)){setTempRet0(caughtType);return thrown}}setTempRet0(thrownType);return thrown};var ___cxa_find_matching_catch_2=()=>findMatchingCatch([]);var ___cxa_find_matching_catch_3=arg0=>findMatchingCatch([arg0]);var ___cxa_rethrow=()=>{var info=exceptionCaught.pop();if(!info){abort("no exception to throw")}var ptr=info.excPtr;if(!info.get_rethrown()){exceptionCaught.push(info);info.set_rethrown(true);info.set_caught(false);uncaughtExceptionCount++}exceptionLast=ptr;throw exceptionLast};var ___cxa_throw=(ptr,type,destructor)=>{var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw exceptionLast};var ___resumeException=ptr=>{if(!exceptionLast){exceptionLast=ptr}throw exceptionLast};var __abort_js=()=>abort("");var AsciiToString=ptr=>{var str="";while(1){var ch=HEAPU8[ptr++];if(!ch)return str;str+=String.fromCharCode(ch)}};var awaitingDependencies={};var registeredTypes={};var typeDependencies={};var BindingError=class BindingError extends Error{constructor(message){super(message);this.name="BindingError"}};var throwBindingError=message=>{throw new BindingError(message)};function sharedRegisterType(rawType,registeredInstance,options={}){var name=registeredInstance.name;if(!rawType){throwBindingError(`type "${name}" must have a positive integer typeid pointer`)}if(registeredTypes.hasOwnProperty(rawType)){if(options.ignoreDuplicateRegistrations){return}else{throwBindingError(`Cannot register type '${name}' twice`)}}registeredTypes[rawType]=registeredInstance;delete typeDependencies[rawType];if(awaitingDependencies.hasOwnProperty(rawType)){var callbacks=awaitingDependencies[rawType];delete awaitingDependencies[rawType];callbacks.forEach(cb=>cb())}}function registerType(rawType,registeredInstance,options={}){return sharedRegisterType(rawType,registeredInstance,options)}var integerReadValueFromPointer=(name,width,signed)=>{switch(width){case 1:return signed?pointer=>HEAP8[pointer]:pointer=>HEAPU8[pointer];case 2:return signed?pointer=>HEAP16[pointer>>1]:pointer=>HEAPU16[pointer>>1];case 4:return signed?pointer=>HEAP32[pointer>>2]:pointer=>HEAPU32[pointer>>2];case 8:return signed?pointer=>HEAP64[pointer>>3]:pointer=>HEAPU64[pointer>>3];default:throw new TypeError(`invalid integer width (${width}): ${name}`)}};var __embind_register_bigint=(primitiveType,name,size,minRange,maxRange)=>{name=AsciiToString(name);const isUnsignedType=minRange===0n;let fromWireType=value=>value;if(isUnsignedType){const bitSize=size*8;fromWireType=value=>BigInt.asUintN(bitSize,value);maxRange=fromWireType(maxRange)}registerType(primitiveType,{name,fromWireType,toWireType:(destructors,value)=>{if(typeof value=="number"){value=BigInt(value)}return value},argPackAdvance:GenericWireTypeSize,readValueFromPointer:integerReadValueFromPointer(name,size,!isUnsignedType),destructorFunction:null})};var GenericWireTypeSize=8;var __embind_register_bool=(rawType,name,trueValue,falseValue)=>{name=AsciiToString(name);registerType(rawType,{name,fromWireType:function(wt){return!!wt},toWireType:function(destructors,o){return o?trueValue:falseValue},argPackAdvance:GenericWireTypeSize,readValueFromPointer:function(pointer){return this["fromWireType"](HEAPU8[pointer])},destructorFunction:null})};var shallowCopyInternalPointer=o=>({count:o.count,deleteScheduled:o.deleteScheduled,preservePointerOnDelete:o.preservePointerOnDelete,ptr:o.ptr,ptrType:o.ptrType,smartPtr:o.smartPtr,smartPtrType:o.smartPtrType});var throwInstanceAlreadyDeleted=obj=>{function getInstanceTypeName(handle){return handle.$$.ptrType.registeredClass.name}throwBindingError(getInstanceTypeName(obj)+" instance already deleted")};var finalizationRegistry=false;var detachFinalizer=handle=>{};var runDestructor=$$=>{if($$.smartPtr){$$.smartPtrType.rawDestructor($$.smartPtr)}else{$$.ptrType.registeredClass.rawDestructor($$.ptr)}};var releaseClassHandle=$$=>{$$.count.value-=1;var toDelete=0===$$.count.value;if(toDelete){runDestructor($$)}};var attachFinalizer=handle=>{if("undefined"===typeof FinalizationRegistry){attachFinalizer=handle=>handle;return handle}finalizationRegistry=new FinalizationRegistry(info=>{releaseClassHandle(info.$$)});attachFinalizer=handle=>{var $$=handle.$$;var hasSmartPtr=!!$$.smartPtr;if(hasSmartPtr){var info={$$};finalizationRegistry.register(handle,info,handle)}return handle};detachFinalizer=handle=>finalizationRegistry.unregister(handle);return attachFinalizer(handle)};var deletionQueue=[];var flushPendingDeletes=()=>{while(deletionQueue.length){var obj=deletionQueue.pop();obj.$$.deleteScheduled=false;obj["delete"]()}};var delayFunction;var init_ClassHandle=()=>{let proto=ClassHandle.prototype;Object.assign(proto,{isAliasOf(other){if(!(this instanceof ClassHandle)){return false}if(!(other instanceof ClassHandle)){return false}var leftClass=this.$$.ptrType.registeredClass;var left=this.$$.ptr;other.$$=other.$$;var rightClass=other.$$.ptrType.registeredClass;var right=other.$$.ptr;while(leftClass.baseClass){left=leftClass.upcast(left);leftClass=leftClass.baseClass}while(rightClass.baseClass){right=rightClass.upcast(right);rightClass=rightClass.baseClass}return leftClass===rightClass&&left===right},clone(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.preservePointerOnDelete){this.$$.count.value+=1;return this}else{var clone=attachFinalizer(Object.create(Object.getPrototypeOf(this),{$$:{value:shallowCopyInternalPointer(this.$$)}}));clone.$$.count.value+=1;clone.$$.deleteScheduled=false;return clone}},delete(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion")}detachFinalizer(this);releaseClassHandle(this.$$);if(!this.$$.preservePointerOnDelete){this.$$.smartPtr=undefined;this.$$.ptr=undefined}},isDeleted(){return!this.$$.ptr},deleteLater(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion")}deletionQueue.push(this);if(deletionQueue.length===1&&delayFunction){delayFunction(flushPendingDeletes)}this.$$.deleteScheduled=true;return this}});const symbolDispose=Symbol.dispose;if(symbolDispose){proto[symbolDispose]=proto["delete"]}};function ClassHandle(){}var createNamedFunction=(name,func)=>Object.defineProperty(func,"name",{value:name});var registeredPointers={};var ensureOverloadTable=(proto,methodName,humanName)=>{if(undefined===proto[methodName].overloadTable){var prevFunc=proto[methodName];proto[methodName]=function(...args){if(!proto[methodName].overloadTable.hasOwnProperty(args.length)){throwBindingError(`Function '${humanName}' called with an invalid number of arguments (${args.length}) - expects one of (${proto[methodName].overloadTable})!`)}return proto[methodName].overloadTable[args.length].apply(this,args)};proto[methodName].overloadTable=[];proto[methodName].overloadTable[prevFunc.argCount]=prevFunc}};var exposePublicSymbol=(name,value,numArguments)=>{if(Module.hasOwnProperty(name)){if(undefined===numArguments||undefined!==Module[name].overloadTable&&undefined!==Module[name].overloadTable[numArguments]){throwBindingError(`Cannot register public name '${name}' twice`)}ensureOverloadTable(Module,name,name);if(Module[name].overloadTable.hasOwnProperty(numArguments)){throwBindingError(`Cannot register multiple overloads of a function with the same number of arguments (${numArguments})!`)}Module[name].overloadTable[numArguments]=value}else{Module[name]=value;Module[name].argCount=numArguments}};var char_0=48;var char_9=57;var makeLegalFunctionName=name=>{name=name.replace(/[^a-zA-Z0-9_]/g,"$");var f=name.charCodeAt(0);if(f>=char_0&&f<=char_9){return`_${name}`}return name};function RegisteredClass(name,constructor,instancePrototype,rawDestructor,baseClass,getActualType,upcast,downcast){this.name=name;this.constructor=constructor;this.instancePrototype=instancePrototype;this.rawDestructor=rawDestructor;this.baseClass=baseClass;this.getActualType=getActualType;this.upcast=upcast;this.downcast=downcast;this.pureVirtualFunctions=[]}var upcastPointer=(ptr,ptrClass,desiredClass)=>{while(ptrClass!==desiredClass){if(!ptrClass.upcast){throwBindingError(`Expected null or instance of ${desiredClass.name}, got an instance of ${ptrClass.name}`)}ptr=ptrClass.upcast(ptr);ptrClass=ptrClass.baseClass}return ptr};var embindRepr=v=>{if(v===null){return"null"}var t=typeof v;if(t==="object"||t==="array"||t==="function"){return v.toString()}else{return""+v}};function constNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError(`null is not a valid ${this.name}`)}return 0}if(!handle.$$){throwBindingError(`Cannot pass "${embindRepr(handle)}" as a ${this.name}`)}if(!handle.$$.ptr){throwBindingError(`Cannot pass deleted object as a pointer of type ${this.name}`)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function genericPointerToWireType(destructors,handle){var ptr;if(handle===null){if(this.isReference){throwBindingError(`null is not a valid ${this.name}`)}if(this.isSmartPointer){ptr=this.rawConstructor();if(destructors!==null){destructors.push(this.rawDestructor,ptr)}return ptr}else{return 0}}if(!handle||!handle.$$){throwBindingError(`Cannot pass "${embindRepr(handle)}" as a ${this.name}`)}if(!handle.$$.ptr){throwBindingError(`Cannot pass deleted object as a pointer of type ${this.name}`)}if(!this.isConst&&handle.$$.ptrType.isConst){throwBindingError(`Cannot convert argument of type ${handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name} to parameter type ${this.name}`)}var handleClass=handle.$$.ptrType.registeredClass;ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);if(this.isSmartPointer){if(undefined===handle.$$.smartPtr){throwBindingError("Passing raw pointer to smart pointer is illegal")}switch(this.sharingPolicy){case 0:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{throwBindingError(`Cannot convert argument of type ${handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name} to parameter type ${this.name}`)}break;case 1:ptr=handle.$$.smartPtr;break;case 2:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{var clonedHandle=handle["clone"]();ptr=this.rawShare(ptr,Emval.toHandle(()=>clonedHandle["delete"]()));if(destructors!==null){destructors.push(this.rawDestructor,ptr)}}break;default:throwBindingError("Unsupporting sharing policy")}}return ptr}function nonConstNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError(`null is not a valid ${this.name}`)}return 0}if(!handle.$$){throwBindingError(`Cannot pass "${embindRepr(handle)}" as a ${this.name}`)}if(!handle.$$.ptr){throwBindingError(`Cannot pass deleted object as a pointer of type ${this.name}`)}if(handle.$$.ptrType.isConst){throwBindingError(`Cannot convert argument of type ${handle.$$.ptrType.name} to parameter type ${this.name}`)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function readPointer(pointer){return this["fromWireType"](HEAPU32[pointer>>2])}var downcastPointer=(ptr,ptrClass,desiredClass)=>{if(ptrClass===desiredClass){return ptr}if(undefined===desiredClass.baseClass){return null}var rv=downcastPointer(ptr,ptrClass,desiredClass.baseClass);if(rv===null){return null}return desiredClass.downcast(rv)};var registeredInstances={};var getBasestPointer=(class_,ptr)=>{if(ptr===undefined){throwBindingError("ptr should not be undefined")}while(class_.baseClass){ptr=class_.upcast(ptr);class_=class_.baseClass}return ptr};var getInheritedInstance=(class_,ptr)=>{ptr=getBasestPointer(class_,ptr);return registeredInstances[ptr]};var InternalError=class InternalError extends Error{constructor(message){super(message);this.name="InternalError"}};var throwInternalError=message=>{throw new InternalError(message)};var makeClassHandle=(prototype,record)=>{if(!record.ptrType||!record.ptr){throwInternalError("makeClassHandle requires ptr and ptrType")}var hasSmartPtrType=!!record.smartPtrType;var hasSmartPtr=!!record.smartPtr;if(hasSmartPtrType!==hasSmartPtr){throwInternalError("Both smartPtrType and smartPtr must be specified")}record.count={value:1};return attachFinalizer(Object.create(prototype,{$$:{value:record,writable:true}}))};function RegisteredPointer_fromWireType(ptr){var rawPointer=this.getPointee(ptr);if(!rawPointer){this.destructor(ptr);return null}var registeredInstance=getInheritedInstance(this.registeredClass,rawPointer);if(undefined!==registeredInstance){if(0===registeredInstance.$$.count.value){registeredInstance.$$.ptr=rawPointer;registeredInstance.$$.smartPtr=ptr;return registeredInstance["clone"]()}else{var rv=registeredInstance["clone"]();this.destructor(ptr);return rv}}function makeDefaultHandle(){if(this.isSmartPointer){return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:rawPointer,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this,ptr})}}var actualType=this.registeredClass.getActualType(rawPointer);var registeredPointerRecord=registeredPointers[actualType];if(!registeredPointerRecord){return makeDefaultHandle.call(this)}var toType;if(this.isConst){toType=registeredPointerRecord.constPointerType}else{toType=registeredPointerRecord.pointerType}var dp=downcastPointer(rawPointer,this.registeredClass,toType.registeredClass);if(dp===null){return makeDefaultHandle.call(this)}if(this.isSmartPointer){return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp})}}var init_RegisteredPointer=()=>{Object.assign(RegisteredPointer.prototype,{getPointee(ptr){if(this.rawGetPointee){ptr=this.rawGetPointee(ptr)}return ptr},destructor(ptr){this.rawDestructor?.(ptr)},argPackAdvance:GenericWireTypeSize,readValueFromPointer:readPointer,fromWireType:RegisteredPointer_fromWireType})};function RegisteredPointer(name,registeredClass,isReference,isConst,isSmartPointer,pointeeType,sharingPolicy,rawGetPointee,rawConstructor,rawShare,rawDestructor){this.name=name;this.registeredClass=registeredClass;this.isReference=isReference;this.isConst=isConst;this.isSmartPointer=isSmartPointer;this.pointeeType=pointeeType;this.sharingPolicy=sharingPolicy;this.rawGetPointee=rawGetPointee;this.rawConstructor=rawConstructor;this.rawShare=rawShare;this.rawDestructor=rawDestructor;if(!isSmartPointer&®isteredClass.baseClass===undefined){if(isConst){this["toWireType"]=constNoSmartPtrRawPointerToWireType;this.destructorFunction=null}else{this["toWireType"]=nonConstNoSmartPtrRawPointerToWireType;this.destructorFunction=null}}else{this["toWireType"]=genericPointerToWireType}}var replacePublicSymbol=(name,value,numArguments)=>{if(!Module.hasOwnProperty(name)){throwInternalError("Replacing nonexistent public symbol")}if(undefined!==Module[name].overloadTable&&undefined!==numArguments){Module[name].overloadTable[numArguments]=value}else{Module[name]=value;Module[name].argCount=numArguments}};var wasmTableMirror=[];var wasmTable;var getWasmTableEntry=funcPtr=>{var func=wasmTableMirror[funcPtr];if(!func){wasmTableMirror[funcPtr]=func=wasmTable.get(funcPtr)}return func};var embind__requireFunction=(signature,rawFunction,isAsync=false)=>{signature=AsciiToString(signature);function makeDynCaller(){var rtn=getWasmTableEntry(rawFunction);return rtn}var fp=makeDynCaller();if(typeof fp!="function"){throwBindingError(`unknown function pointer with signature ${signature}: ${rawFunction}`)}return fp};class UnboundTypeError extends Error{}var getTypeName=type=>{var ptr=___getTypeName(type);var rv=AsciiToString(ptr);_free(ptr);return rv};var throwUnboundTypeError=(message,types)=>{var unboundTypes=[];var seen={};function visit(type){if(seen[type]){return}if(registeredTypes[type]){return}if(typeDependencies[type]){typeDependencies[type].forEach(visit);return}unboundTypes.push(type);seen[type]=true}types.forEach(visit);throw new UnboundTypeError(`${message}: `+unboundTypes.map(getTypeName).join([", "]))};var whenDependentTypesAreResolved=(myTypes,dependentTypes,getTypeConverters)=>{myTypes.forEach(type=>typeDependencies[type]=dependentTypes);function onComplete(typeConverters){var myTypeConverters=getTypeConverters(typeConverters);if(myTypeConverters.length!==myTypes.length){throwInternalError("Mismatched type converter count")}for(var i=0;i<myTypes.length;++i){registerType(myTypes[i],myTypeConverters[i])}}var typeConverters=new Array(dependentTypes.length);var unregisteredTypes=[];var registered=0;dependentTypes.forEach((dt,i)=>{if(registeredTypes.hasOwnProperty(dt)){typeConverters[i]=registeredTypes[dt]}else{unregisteredTypes.push(dt);if(!awaitingDependencies.hasOwnProperty(dt)){awaitingDependencies[dt]=[]}awaitingDependencies[dt].push(()=>{typeConverters[i]=registeredTypes[dt];++registered;if(registered===unregisteredTypes.length){onComplete(typeConverters)}})}});if(0===unregisteredTypes.length){onComplete(typeConverters)}};var __embind_register_class=(rawType,rawPointerType,rawConstPointerType,baseClassRawType,getActualTypeSignature,getActualType,upcastSignature,upcast,downcastSignature,downcast,name,destructorSignature,rawDestructor)=>{name=AsciiToString(name);getActualType=embind__requireFunction(getActualTypeSignature,getActualType);upcast&&=embind__requireFunction(upcastSignature,upcast);downcast&&=embind__requireFunction(downcastSignature,downcast);rawDestructor=embind__requireFunction(destructorSignature,rawDestructor);var legalFunctionName=makeLegalFunctionName(name);exposePublicSymbol(legalFunctionName,function(){throwUnboundTypeError(`Cannot construct ${name} due to unbound types`,[baseClassRawType])});whenDependentTypesAreResolved([rawType,rawPointerType,rawConstPointerType],baseClassRawType?[baseClassRawType]:[],base=>{base=base[0];var baseClass;var basePrototype;if(baseClassRawType){baseClass=base.registeredClass;basePrototype=baseClass.instancePrototype}else{basePrototype=ClassHandle.prototype}var constructor=createNamedFunction(name,function(...args){if(Object.getPrototypeOf(this)!==instancePrototype){throw new BindingError(`Use 'new' to construct ${name}`)}if(undefined===registeredClass.constructor_body){throw new BindingError(`${name} has no accessible constructor`)}var body=registeredClass.constructor_body[args.length];if(undefined===body){throw new BindingError(`Tried to invoke ctor of ${name} with invalid number of parameters (${args.length}) - expected (${Object.keys(registeredClass.constructor_body).toString()}) parameters instead!`)}return body.apply(this,args)});var instancePrototype=Object.create(basePrototype,{constructor:{value:constructor}});constructor.prototype=instancePrototype;var registeredClass=new RegisteredClass(name,constructor,instancePrototype,rawDestructor,baseClass,getActualType,upcast,downcast);if(registeredClass.baseClass){registeredClass.baseClass.__derivedClasses??=[];registeredClass.baseClass.__derivedClasses.push(registeredClass)}var referenceConverter=new RegisteredPointer(name,registeredClass,true,false,false);var pointerConverter=new RegisteredPointer(name+"*",registeredClass,false,false,false);var constPointerConverter=new RegisteredPointer(name+" const*",registeredClass,false,true,false);registeredPointers[rawType]={pointerType:pointerConverter,constPointerType:constPointerConverter};replacePublicSymbol(legalFunctionName,constructor);return[referenceConverter,pointerConverter,constPointerConverter]})};var heap32VectorToArray=(count,firstElement)=>{var array=[];for(var i=0;i<count;i++){array.push(HEAPU32[firstElement+i*4>>2])}return array};var runDestructors=destructors=>{while(destructors.length){var ptr=destructors.pop();var del=destructors.pop();del(ptr)}};function usesDestructorStack(argTypes){for(var i=1;i<argTypes.length;++i){if(argTypes[i]!==null&&argTypes[i].destructorFunction===undefined){return true}}return false}function createJsInvoker(argTypes,isClassMethodFunc,returns,isAsync){var needsDestructorStack=usesDestructorStack(argTypes);var argCount=argTypes.length-2;var argsList=[];var argsListWired=["fn"];if(isClassMethodFunc){argsListWired.push("thisWired")}for(var i=0;i<argCount;++i){argsList.push(`arg${i}`);argsListWired.push(`arg${i}Wired`)}argsList=argsList.join(",");argsListWired=argsListWired.join(",");var invokerFnBody=`return function (${argsList}) {\n`;if(needsDestructorStack){invokerFnBody+="var destructors = [];\n"}var dtorStack=needsDestructorStack?"destructors":"null";var args1=["humanName","throwBindingError","invoker","fn","runDestructors","retType","classParam"];if(isClassMethodFunc){invokerFnBody+=`var thisWired = classParam['toWireType'](${dtorStack}, this);\n`}for(var i=0;i<argCount;++i){invokerFnBody+=`var arg${i}Wired = argType${i}['toWireType'](${dtorStack}, arg${i});\n`;args1.push(`argType${i}`)}invokerFnBody+=(returns||isAsync?"var rv = ":"")+`invoker(${argsListWired});\n`;if(needsDestructorStack){invokerFnBody+="runDestructors(destructors);\n"}else{for(var i=isClassMethodFunc?1:2;i<argTypes.length;++i){var paramName=i===1?"thisWired":"arg"+(i-2)+"Wired";if(argTypes[i].destructorFunction!==null){invokerFnBody+=`${paramName}_dtor(${paramName});\n`;args1.push(`${paramName}_dtor`)}}}if(returns){invokerFnBody+="var ret = retType['fromWireType'](rv);\n"+"return ret;\n"}else{}invokerFnBody+="}\n";return[args1,invokerFnBody]}function craftInvokerFunction(humanName,argTypes,classType,cppInvokerFunc,cppTargetFunc,isAsync){var argCount=argTypes.length;if(argCount<2){throwBindingError("argTypes array size mismatch! Must at least get return value and 'this' types!")}var isClassMethodFunc=argTypes[1]!==null&&classType!==null;var needsDestructorStack=usesDestructorStack(argTypes);var returns=argTypes[0].name!=="void";var closureArgs=[humanName,throwBindingError,cppInvokerFunc,cppTargetFunc,runDestructors,argTypes[0],argTypes[1]];for(var i=0;i<argCount-2;++i){closureArgs.push(argTypes[i+2])}if(!needsDestructorStack){for(var i=isClassMethodFunc?1:2;i<argTypes.length;++i){if(argTypes[i].destructorFunction!==null){closureArgs.push(argTypes[i].destructorFunction)}}}let[args,invokerFnBody]=createJsInvoker(argTypes,isClassMethodFunc,returns,isAsync);var invokerFn=new Function(...args,invokerFnBody)(...closureArgs);return createNamedFunction(humanName,invokerFn)}var __embind_register_class_constructor=(rawClassType,argCount,rawArgTypesAddr,invokerSignature,invoker,rawConstructor)=>{var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);invoker=embind__requireFunction(invokerSignature,invoker);whenDependentTypesAreResolved([],[rawClassType],classType=>{classType=classType[0];var humanName=`constructor ${classType.name}`;if(undefined===classType.registeredClass.constructor_body){classType.registeredClass.constructor_body=[]}if(undefined!==classType.registeredClass.constructor_body[argCount-1]){throw new BindingError(`Cannot register multiple constructors with identical number of parameters (${argCount-1}) for class '${classType.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`)}classType.registeredClass.constructor_body[argCount-1]=()=>{throwUnboundTypeError(`Cannot construct ${classType.name} due to unbound types`,rawArgTypes)};whenDependentTypesAreResolved([],rawArgTypes,argTypes=>{argTypes.splice(1,0,null);classType.registeredClass.constructor_body[argCount-1]=craftInvokerFunction(humanName,argTypes,null,invoker,rawConstructor);return[]});return[]})};var getFunctionName=signature=>{signature=signature.trim();const argsIndex=signature.indexOf("(");if(argsIndex===-1)return signature;return signature.slice(0,argsIndex)};var __embind_register_class_function=(rawClassType,methodName,argCount,rawArgTypesAddr,invokerSignature,rawInvoker,context,isPureVirtual,isAsync,isNonnullReturn)=>{var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);methodName=AsciiToString(methodName);methodName=getFunctionName(methodName);rawInvoker=embind__requireFunction(invokerSignature,rawInvoker,isAsync);whenDependentTypesAreResolved([],[rawClassType],classType=>{classType=classType[0];var humanName=`${classType.name}.${methodName}`;if(methodName.startsWith("@@")){methodName=Symbol[methodName.substring(2)]}if(isPureVirtual){classType.registeredClass.pureVirtualFunctions.push(methodName)}function unboundTypesHandler(){throwUnboundTypeError(`Cannot call ${humanName} due to unbound types`,rawArgTypes)}var proto=classType.registeredClass.instancePrototype;var method=proto[methodName];if(undefined===method||undefined===method.overloadTable&&method.className!==classType.name&&method.argCount===argCount-2){unboundTypesHandler.argCount=argCount-2;unboundTypesHandler.className=classType.name;proto[methodName]=unboundTypesHandler}else{ensureOverloadTable(proto,methodName,humanName);proto[methodName].overloadTable[argCount-2]=unboundTypesHandler}whenDependentTypesAreResolved([],rawArgTypes,argTypes=>{var memberFunction=craftInvokerFunction(humanName,argTypes,classType,rawInvoker,context,isAsync);if(undefined===proto[methodName].overloadTable){memberFunction.argCount=argCount-2;proto[methodName]=memberFunction}else{proto[methodName].overloadTable[argCount-2]=memberFunction}return[]});return[]})};var emval_freelist=[];var emval_handles=[0,1,,1,null,1,true,1,false,1];var __emval_decref=handle=>{if(handle>9&&0===--emval_handles[handle+1]){emval_handles[handle]=undefined;emval_freelist.push(handle)}};var Emval={toValue:handle=>{if(!handle){throwBindingError(`Cannot use deleted val. handle = ${handle}`)}return emval_handles[handle]},toHandle:value=>{switch(value){case undefined:return 2;case null:return 4;case true:return 6;case false:return 8;default:{const handle=emval_freelist.pop()||emval_handles.length;emval_handles[handle]=value;emval_handles[handle+1]=1;return handle}}}};var EmValType={name:"emscripten::val",fromWireType:handle=>{var rv=Emval.toValue(handle);__emval_decref(handle);return rv},toWireType:(destructors,value)=>Emval.toHandle(value),argPackAdvance:GenericWireTypeSize,readValueFromPointer:readPointer,destructorFunction:null};var __embind_register_emval=rawType=>registerType(rawType,EmValType);var floatReadValueFromPointer=(name,width)=>{switch(width){case 4:return function(pointer){return this["fromWireType"](HEAPF32[pointer>>2])};case 8:return function(pointer){return this["fromWireType"](HEAPF64[pointer>>3])};default:throw new TypeError(`invalid float width (${width}): ${name}`)}};var __embind_register_float=(rawType,name,size)=>{name=AsciiToString(name);registerType(rawType,{name,fromWireType:value=>value,toWireType:(destructors,value)=>value,argPackAdvance:GenericWireTypeSize,readValueFromPointer:floatReadValueFromPointer(name,size),destructorFunction:null})};var __embind_register_function=(name,argCount,rawArgTypesAddr,signature,rawInvoker,fn,isAsync,isNonnullReturn)=>{var argTypes=heap32VectorToArray(argCount,rawArgTypesAddr);name=AsciiToString(name);name=getFunctionName(name);rawInvoker=embind__requireFunction(signature,rawInvoker,isAsync);exposePublicSymbol(name,function(){throwUnboundTypeError(`Cannot call ${name} due to unbound types`,argTypes)},argCount-1);whenDependentTypesAreResolved([],argTypes,argTypes=>{var invokerArgsArray=[argTypes[0],null].concat(argTypes.slice(1));replacePublicSymbol(name,craftInvokerFunction(name,invokerArgsArray,null,rawInvoker,fn,isAsync),argCount-1);return[]})};var __embind_register_integer=(primitiveType,name,size,minRange,maxRange)=>{name=AsciiToString(name);const isUnsignedType=minRange===0;let fromWireType=value=>value;if(isUnsignedType){var bitshift=32-8*size;fromWireType=value=>value<<bitshift>>>bitshift;maxRange=fromWireType(maxRange)}registerType(primitiveType,{name,fromWireType,toWireType:(destructors,value)=>value,argPackAdvance:GenericWireTypeSize,readValueFromPointer:integerReadValueFromPointer(name,size,minRange!==0),destructorFunction:null})};var __embind_register_memory_view=(rawType,dataTypeIndex,name)=>{var typeMapping=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array];var TA=typeMapping[dataTypeIndex];function decodeMemoryView(handle){var size=HEAPU32[handle>>2];var data=HEAPU32[handle+4>>2];return new TA(HEAP8.buffer,data,size)}name=AsciiToString(name);registerType(rawType,{name,fromWireType:decodeMemoryView,argPackAdvance:GenericWireTypeSize,readValueFromPointer:decodeMemoryView},{ignoreDuplicateRegistrations:true})};var EmValOptionalType=Object.assign({optional:true},EmValType);var __embind_register_optional=(rawOptionalType,rawType)=>{registerType(rawOptionalType,EmValOptionalType)};var stringToUTF8Array=(str,heap,outIdx,maxBytesToWrite)=>{if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i<str.length;++i){var u=str.codePointAt(i);if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63;i++}}heap[outIdx]=0;return outIdx-startIdx};var stringToUTF8=(str,outPtr,maxBytesToWrite)=>stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite);var lengthBytesUTF8=str=>{var len=0;for(var i=0;i<str.length;++i){var c=str.charCodeAt(i);if(c<=127){len++}else if(c<=2047){len+=2}else if(c>=55296&&c<=57343){len+=4;++i}else{len+=3}}return len};var UTF8Decoder=typeof TextDecoder!="undefined"?new TextDecoder:undefined;var UTF8ArrayToString=(heapOrArray,idx=0,maxBytesToRead=NaN)=>{var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heapOrArray[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heapOrArray.buffer&&UTF8Decoder){return UTF8Decoder.decode(heapOrArray.subarray(idx,endPtr))}var str="";while(idx<endPtr){var u0=heapOrArray[idx++];if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heapOrArray[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heapOrArray[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heapOrArray[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str};var UTF8ToString=(ptr,maxBytesToRead)=>ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):"";var __embind_register_std_string=(rawType,name)=>{name=AsciiToString(name);var stdStringIsUTF8=true;registerType(rawType,{name,fromWireType(value){var length=HEAPU32[value>>2];var payload=value+4;var str;if(stdStringIsUTF8){var decodeStartPtr=payload;for(var i=0;i<=length;++i){var currentBytePtr=payload+i;if(i==length||HEAPU8[currentBytePtr]==0){var maxRead=currentBytePtr-decodeStartPtr;var stringSegment=UTF8ToString(decodeStartPtr,maxRead);if(str===undefined){str=stringSegment}else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+1}}}else{var a=new Array(length);for(var i=0;i<length;++i){a[i]=String.fromCharCode(HEAPU8[payload+i])}str=a.join("")}_free(value);return str},toWireType(destructors,value){if(value instanceof ArrayBuffer){value=new Uint8Array(value)}var length;var valueIsOfTypeString=typeof value=="string";if(!(valueIsOfTypeString||ArrayBuffer.isView(value)&&value.BYTES_PER_ELEMENT==1)){throwBindingError("Cannot pass non-string to std::string")}if(stdStringIsUTF8&&valueIsOfTypeString){length=lengthBytesUTF8(value)}else{length=value.length}var base=_malloc(4+length+1);var ptr=base+4;HEAPU32[base>>2]=length;if(valueIsOfTypeString){if(stdStringIsUTF8){stringToUTF8(value,ptr,length+1)}else{for(var i=0;i<length;++i){var charCode=value.charCodeAt(i);if(charCode>255){_free(base);throwBindingError("String has UTF-16 code units that do not fit in 8 bits")}HEAPU8[ptr+i]=charCode}}}else{HEAPU8.set(value,ptr)}if(destructors!==null){destructors.push(_free,base)}return base},argPackAdvance:GenericWireTypeSize,readValueFromPointer:readPointer,destructorFunction(ptr){_free(ptr)}})};var UTF16Decoder=typeof TextDecoder!="undefined"?new TextDecoder("utf-16le"):undefined;var UTF16ToString=(ptr,maxBytesToRead)=>{var idx=ptr>>1;var maxIdx=idx+maxBytesToRead/2;var endIdx=idx;while(!(endIdx>=maxIdx)&&HEAPU16[endIdx])++endIdx;if(endIdx-idx>16&&UTF16Decoder)return UTF16Decoder.decode(HEAPU16.subarray(idx,endIdx));var str="";for(var i=idx;!(i>=maxIdx);++i){var codeUnit=HEAPU16[i];if(codeUnit==0)break;str+=String.fromCharCode(codeUnit)}return str};var stringToUTF16=(str,outPtr,maxBytesToWrite)=>{maxBytesToWrite??=2147483647;if(maxBytesToWrite<2)return 0;maxBytesToWrite-=2;var startPtr=outPtr;var numCharsToWrite=maxBytesToWrite<str.length*2?maxBytesToWrite/2:str.length;for(var i=0;i<numCharsToWrite;++i){var codeUnit=str.charCodeAt(i);HEAP16[outPtr>>1]=codeUnit;outPtr+=2}HEAP16[outPtr>>1]=0;return outPtr-startPtr};var lengthBytesUTF16=str=>str.length*2;var UTF32ToString=(ptr,maxBytesToRead)=>{var str="";for(var i=0;!(i>=maxBytesToRead/4);i++){var utf32=HEAP32[ptr+i*4>>2];if(!utf32)break;str+=String.fromCodePoint(utf32)}return str};var stringToUTF32=(str,outPtr,maxBytesToWrite)=>{maxBytesToWrite??=2147483647;if(maxBytesToWrite<4)return 0;var startPtr=outPtr;var endPtr=startPtr+maxBytesToWrite-4;for(var i=0;i<str.length;++i){var codePoint=str.codePointAt(i);if(codePoint>65535){i++}HEAP32[outPtr>>2]=codePoint;outPtr+=4;if(outPtr+4>endPtr)break}HEAP32[outPtr>>2]=0;return outPtr-startPtr};var lengthBytesUTF32=str=>{var len=0;for(var i=0;i<str.length;++i){var codePoint=str.codePointAt(i);if(codePoint>65535){i++}len+=4}return len};var __embind_register_std_wstring=(rawType,charSize,name)=>{name=AsciiToString(name);var decodeString,encodeString,readCharAt,lengthBytesUTF;if(charSize===2){decodeString=UTF16ToString;encodeString=stringToUTF16;lengthBytesUTF=lengthBytesUTF16;readCharAt=pointer=>HEAPU16[pointer>>1]}else if(charSize===4){decodeString=UTF32ToString;encodeString=stringToUTF32;lengthBytesUTF=lengthBytesUTF32;readCharAt=pointer=>HEAPU32[pointer>>2]}registerType(rawType,{name,fromWireType:value=>{var length=HEAPU32[value>>2];var str;var decodeStartPtr=value+4;for(var i=0;i<=length;++i){var currentBytePtr=value+4+i*charSize;if(i==length||readCharAt(currentBytePtr)==0){var maxReadBytes=currentBytePtr-decodeStartPtr;var stringSegment=decodeString(decodeStartPtr,maxReadBytes);if(str===undefined){str=stringSegment}else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+charSize}}_free(value);return str},toWireType:(destructors,value)=>{if(!(typeof value=="string")){throwBindingError(`Cannot pass non-string to C++ string type ${name}`)}var length=lengthBytesUTF(value);var ptr=_malloc(4+length+charSize);HEAPU32[ptr>>2]=length/charSize;encodeString(value,ptr+4,length+charSize);if(destructors!==null){destructors.push(_free,ptr)}return ptr},argPackAdvance:GenericWireTypeSize,readValueFromPointer:readPointer,destructorFunction(ptr){_free(ptr)}})};var __embind_register_void=(rawType,name)=>{name=AsciiToString(name);registerType(rawType,{isVoid:true,name,argPackAdvance:0,fromWireType:()=>undefined,toWireType:(destructors,o)=>undefined})};var requireRegisteredType=(rawType,humanName)=>{var impl=registeredTypes[rawType];if(undefined===impl){throwBindingError(`${humanName} has unknown type ${getTypeName(rawType)}`)}return impl};var emval_returnValue=(returnType,destructorsRef,handle)=>{var destructors=[];var result=returnType["toWireType"](destructors,handle);if(destructors.length){HEAPU32[destructorsRef>>2]=Emval.toHandle(destructors)}return result};var __emval_as=(handle,returnType,destructorsRef)=>{handle=Emval.toValue(handle);returnType=requireRegisteredType(returnType,"emval::as");return emval_returnValue(returnType,destructorsRef,handle)};var emval_symbols={};var getStringOrSymbol=address=>{var symbol=emval_symbols[address];if(symbol===undefined){return AsciiToString(address)}return symbol};var emval_methodCallers=[];var __emval_call_method=(caller,objHandle,methodName,destructorsRef,args)=>{caller=emval_methodCallers[caller];objHandle=Emval.toValue(objHandle);methodName=getStringOrSymbol(methodName);return caller(objHandle,objHandle[methodName],destructorsRef,args)};var emval_get_global=()=>globalThis;var __emval_get_global=name=>{if(name===0){return Emval.toHandle(emval_get_global())}else{name=getStringOrSymbol(name);return Emval.toHandle(emval_get_global()[name])}};var emval_addMethodCaller=caller=>{var id=emval_methodCallers.length;emval_methodCallers.push(caller);return id};var emval_lookupTypes=(argCount,argTypes)=>{var a=new Array(argCount);for(var i=0;i<argCount;++i){a[i]=requireRegisteredType(HEAPU32[argTypes+i*4>>2],`parameter ${i}`)}return a};var __emval_get_method_caller=(argCount,argTypes,kind)=>{var types=emval_lookupTypes(argCount,argTypes);var retType=types.shift();argCount--;var functionBody=`return function (obj, func, destructorsRef, args) {\n`;var offset=0;var argsList=[];if(kind===0){argsList.push("obj")}var params=["retType"];var args=[retType];for(var i=0;i<argCount;++i){argsList.push(`arg${i}`);params.push(`argType${i}`);args.push(types[i]);functionBody+=` var arg${i} = argType${i}.readValueFromPointer(args${offset?"+"+offset:""});\n`;offset+=types[i].argPackAdvance}var invoker=kind===1?"new func":"func.call";functionBody+=` var rv = ${invoker}(${argsList.join(", ")});\n`;if(!retType.isVoid){params.push("emval_returnValue");args.push(emval_returnValue);functionBody+=" return emval_returnValue(retType, destructorsRef, rv);\n"}functionBody+="};\n";var invokerFunction=new Function(...params,functionBody)(...args);var functionName=`methodCaller<(${types.map(t=>t.name).join(", ")}) => ${retType.name}>`;return emval_addMethodCaller(createNamedFunction(functionName,invokerFunction))};var __emval_get_property=(handle,key)=>{handle=Emval.toValue(handle);key=Emval.toValue(key);return Emval.toHandle(handle[key])};var __emval_incref=handle=>{if(handle>9){emval_handles[handle+1]+=1}};var __emval_instanceof=(object,constructor)=>{object=Emval.toValue(object);constructor=Emval.toValue(constructor);return object instanceof constructor};var __emval_new_array=()=>Emval.toHandle([]);var __emval_new_cstring=v=>Emval.toHandle(getStringOrSymbol(v));var __emval_new_object=()=>Emval.toHandle({});var __emval_run_destructors=handle=>{var destructors=Emval.toValue(handle);runDestructors(destructors);__emval_decref(handle)};var __emval_set_property=(handle,key,value)=>{handle=Emval.toValue(handle);key=Emval.toValue(key);value=Emval.toValue(value);handle[key]=value};var __emval_take_value=(type,arg)=>{type=requireRegisteredType(type,"_emval_take_value");var v=type["readValueFromPointer"](arg);return Emval.toHandle(v)};var getHeapMax=()=>1073741824;var alignMemory=(size,alignment)=>Math.ceil(size/alignment)*alignment;var growMemory=size=>{var b=wasmMemory.buffer;var pages=(size-b.byteLength+65535)/65536|0;try{wasmMemory.grow(pages);updateMemoryViews();return 1}catch(e){}};var _emscripten_resize_heap=requestedSize=>{var oldSize=HEAPU8.length;requestedSize>>>=0;var maxHeapSize=getHeapMax();if(requestedSize>maxHeapSize){return false}for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignMemory(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=growMemory(newSize);if(replacement){return true}}return false};var _llvm_eh_typeid_for=type=>type;var ALLOC_STACK=1;var stackAlloc=sz=>__emscripten_stack_alloc(sz);var allocate=(slab,allocator)=>{var ret;if(allocator==ALLOC_STACK){ret=stackAlloc(slab.length)}else{ret=_malloc(slab.length)}if(!slab.subarray&&!slab.slice){slab=new Uint8Array(slab)}HEAPU8.set(slab,ret);return ret};init_ClassHandle();init_RegisteredPointer();{if(Module["noExitRuntime"])noExitRuntime=Module["noExitRuntime"];if(Module["print"])out=Module["print"];if(Module["printErr"])err=Module["printErr"];if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"]}Module["setValue"]=setValue;Module["getValue"]=getValue;Module["UTF8ToString"]=UTF8ToString;Module["stringToUTF8"]=stringToUTF8;Module["lengthBytesUTF8"]=lengthBytesUTF8;Module["allocate"]=allocate;var _malloc,___getTypeName,_free,_setThrew,__emscripten_tempret_set,__emscripten_stack_restore,__emscripten_stack_alloc,_emscripten_stack_get_current,___cxa_decrement_exception_refcount,___cxa_increment_exception_refcount,___cxa_can_catch,___cxa_get_exception_ptr;function assignWasmExports(wasmExports){_malloc=wasmExports["ra"];___getTypeName=wasmExports["sa"];_free=wasmExports["ta"];_setThrew=wasmExports["ua"];__emscripten_tempret_set=wasmExports["va"];__emscripten_stack_restore=wasmExports["wa"];__emscripten_stack_alloc=wasmExports["xa"];_emscripten_stack_get_current=wasmExports["ya"];___cxa_decrement_exception_refcount=wasmExports["za"];___cxa_increment_exception_refcount=wasmExports["Aa"];___cxa_can_catch=wasmExports["Ba"];___cxa_get_exception_ptr=wasmExports["Ca"]}var wasmImports={z:___cxa_begin_catch,I:___cxa_end_catch,a:___cxa_find_matching_catch_2,l:___cxa_find_matching_catch_3,$:___cxa_rethrow,y:___cxa_throw,c:___resumeException,S:__abort_js,K:__embind_register_bigint,X:__embind_register_bool,C:__embind_register_class,B:__embind_register_class_constructor,n:__embind_register_class_function,V:__embind_register_emval,J:__embind_register_float,fa:__embind_register_function,w:__embind_register_integer,s:__embind_register_memory_view,da:__embind_register_optional,W:__embind_register_std_string,D:__embind_register_std_wstring,Y:__embind_register_void,P:__emval_as,Q:__emval_call_method,ja:__emval_decref,ia:__emval_get_global,R:__emval_get_method_caller,ga:__emval_get_property,ba:__emval_incref,ea:__emval_instanceof,ma:__emval_new_array,ha:__emval_new_cstring,na:__emval_new_object,ka:__emval_run_destructors,ca:__emval_set_property,F:__emval_take_value,U:_emscripten_resize_heap,G:invoke_diii,la:invoke_diiiii,H:invoke_i,d:invoke_ii,b:invoke_iii,f:invoke_iiii,m:invoke_iiiii,r:invoke_iiiiii,N:invoke_iiiiiiii,Z:invoke_iiiijii,v:invoke_iiij,p:invoke_iiiji,L:invoke_iij,o:invoke_ji,A:invoke_jiiji,O:invoke_jij,t:invoke_v,h:invoke_vi,g:invoke_vii,e:invoke_viii,i:invoke_viiii,u:invoke_viiiii,k:invoke_viiiiii,T:invoke_viiiiiii,aa:invoke_viiiiiiii,x:invoke_viij,q:invoke_viiji,E:invoke_vij,j:invoke_viji,_:invoke_vijj,M:_llvm_eh_typeid_for};var wasmExports=await createWasm();function invoke_iiii(index,a1,a2,a3){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_ii(index,a1){var sp=stackSave();try{return getWasmTableEntry(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iii(index,a1,a2){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viji(index,a1,a2,a3){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiii(index,a1,a2,a3,a4){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viii(index,a1,a2,a3){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_vii(index,a1,a2){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_i(index){var sp=stackSave();try{return getWasmTableEntry(index)()}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_diiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_vi(index,a1){var sp=stackSave();try{getWasmTableEntry(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiii(index,a1,a2,a3,a4){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_diii(index,a1,a2,a3){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_v(index){var sp=stackSave();try{getWasmTableEntry(index)()}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_ji(index,a1){var sp=stackSave();try{return getWasmTableEntry(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);return 0n}}function invoke_iiiji(index,a1,a2,a3,a4){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiij(index,a1,a2,a3){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiji(index,a1,a2,a3,a4){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_jij(index,a1,a2){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);return 0n}}function invoke_viiiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viij(index,a1,a2,a3){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_vij(index,a1,a2){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_jiiji(index,a1,a2,a3,a4){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);return 0n}}function invoke_viiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7,a8)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_vijj(index,a1,a2,a3){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iij(index,a1,a2){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiijii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function run(){if(runDependencies>0){dependenciesFulfilled=run;return}preRun();if(runDependencies>0){dependenciesFulfilled=run;return}function doRun(){Module["calledRun"]=true;if(ABORT)return;initRuntime();readyPromiseResolve?.(Module);Module["onRuntimeInitialized"]?.();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(()=>{setTimeout(()=>Module["setStatus"](""),1);doRun()},1)}else{doRun()}}function preInit(){if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].shift()()}}}preInit();run();if(runtimeInitialized){moduleRtn=Module}else{moduleRtn=new Promise((resolve,reject)=>{readyPromiseResolve=resolve;readyPromiseReject=reject})}
|
|
23
8
|
|
|
24
9
|
|
|
25
10
|
return moduleRtn;
|
|
@@ -27,9 +12,9 @@ if(c.preInit)for("function"==typeof c.preInit&&(c.preInit=[c.preInit]);0<c.preIn
|
|
|
27
12
|
);
|
|
28
13
|
})();
|
|
29
14
|
if (typeof exports === 'object' && typeof module === 'object') {
|
|
30
|
-
module.exports =
|
|
15
|
+
module.exports = createTagLibModule;
|
|
31
16
|
// This default export looks redundant, but it allows TS to import this
|
|
32
17
|
// commonjs style module.
|
|
33
|
-
module.exports.default =
|
|
18
|
+
module.exports.default = createTagLibModule;
|
|
34
19
|
} else if (typeof define === 'function' && define['amd'])
|
|
35
|
-
define([], () =>
|
|
20
|
+
define([], () => createTagLibModule);
|
package/build/taglib.wasm
CHANGED
|
Binary file
|
package/index.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Main module exports for TagLib WASM
|
|
3
|
+
*
|
|
4
|
+
* TagLib v2.1 compiled to WebAssembly with TypeScript bindings
|
|
5
|
+
* for universal audio metadata handling.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export { AudioFile, TagLib } from "./src/taglib.ts";
|
|
9
|
+
export type {
|
|
10
|
+
AudioFormat,
|
|
11
|
+
AudioProperties,
|
|
12
|
+
ExtendedTag,
|
|
13
|
+
FieldMapping,
|
|
14
|
+
METADATA_MAPPINGS,
|
|
15
|
+
Picture,
|
|
16
|
+
PictureType,
|
|
17
|
+
PropertyMap,
|
|
18
|
+
Tag,
|
|
19
|
+
TagLibConfig,
|
|
20
|
+
} from "./src/types.ts";
|
|
21
|
+
export type { TagLibModule } from "./src/wasm.ts";
|