barcode-detector 2.2.2 → 2.2.4

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/dist/es/pure.js CHANGED
@@ -1,263 +1,13 @@
1
- var Ye = (o, h, s) => {
2
- if (!h.has(o))
3
- throw TypeError("Cannot " + s);
1
+ var Qe = (i, f, c) => {
2
+ if (!f.has(i))
3
+ throw TypeError("Cannot " + c);
4
4
  };
5
- var re = (o, h, s) => (Ye(o, h, "read from private field"), s ? s.call(o) : h.get(o)), ze = (o, h, s) => {
6
- if (h.has(o))
5
+ var se = (i, f, c) => (Qe(i, f, "read from private field"), c ? c.call(i) : f.get(i)), Ze = (i, f, c) => {
6
+ if (f.has(i))
7
7
  throw TypeError("Cannot add the same private member more than once");
8
- h instanceof WeakSet ? h.add(o) : h.set(o, s);
9
- }, Ne = (o, h, s, $) => (Ye(o, h, "write to private field"), $ ? $.call(o, s) : h.set(o, s), s);
10
- const Qe = [
11
- ["aztec", "Aztec"],
12
- ["code_128", "Code128"],
13
- ["code_39", "Code39"],
14
- ["code_93", "Code93"],
15
- ["codabar", "Codabar"],
16
- ["databar", "DataBar"],
17
- ["databar_expanded", "DataBarExpanded"],
18
- ["data_matrix", "DataMatrix"],
19
- ["dx_film_edge", "DXFilmEdge"],
20
- ["ean_13", "EAN-13"],
21
- ["ean_8", "EAN-8"],
22
- ["itf", "ITF"],
23
- ["maxi_code", "MaxiCode"],
24
- ["micro_qr_code", "MicroQRCode"],
25
- ["pdf417", "PDF417"],
26
- ["qr_code", "QRCode"],
27
- ["rm_qr_code", "rMQRCode"],
28
- ["upc_a", "UPC-A"],
29
- ["upc_e", "UPC-E"],
30
- ["linear_codes", "Linear-Codes"],
31
- ["matrix_codes", "Matrix-Codes"]
32
- ], Da = [...Qe, ["unknown"]].map((o) => o[0]), It = new Map(
33
- Qe
34
- );
35
- function xa(o) {
36
- for (const [h, s] of It)
37
- if (o === s)
38
- return h;
39
- return "unknown";
40
- }
41
- function Fa(o) {
42
- if (Ze(o))
43
- return {
44
- width: o.naturalWidth,
45
- height: o.naturalHeight
46
- };
47
- if (Je(o))
48
- return {
49
- width: o.width.baseVal.value,
50
- height: o.height.baseVal.value
51
- };
52
- if (Ke(o))
53
- return {
54
- width: o.videoWidth,
55
- height: o.videoHeight
56
- };
57
- if (er(o))
58
- return {
59
- width: o.width,
60
- height: o.height
61
- };
62
- if (nr(o))
63
- return {
64
- width: o.displayWidth,
65
- height: o.displayHeight
66
- };
67
- if (tr(o))
68
- return {
69
- width: o.width,
70
- height: o.height
71
- };
72
- if (rr(o))
73
- return {
74
- width: o.width,
75
- height: o.height
76
- };
77
- throw new TypeError(
78
- "The provided value is not of type '(Blob or HTMLCanvasElement or HTMLImageElement or HTMLVideoElement or ImageBitmap or ImageData or OffscreenCanvas or SVGImageElement or VideoFrame)'."
79
- );
80
- }
81
- function Ze(o) {
82
- try {
83
- return o instanceof HTMLImageElement;
84
- } catch {
85
- return !1;
86
- }
87
- }
88
- function Je(o) {
89
- try {
90
- return o instanceof SVGImageElement;
91
- } catch {
92
- return !1;
93
- }
94
- }
95
- function Ke(o) {
96
- try {
97
- return o instanceof HTMLVideoElement;
98
- } catch {
99
- return !1;
100
- }
101
- }
102
- function tr(o) {
103
- try {
104
- return o instanceof HTMLCanvasElement;
105
- } catch {
106
- return !1;
107
- }
108
- }
109
- function er(o) {
110
- try {
111
- return o instanceof ImageBitmap;
112
- } catch {
113
- return !1;
114
- }
115
- }
116
- function rr(o) {
117
- try {
118
- return o instanceof OffscreenCanvas;
119
- } catch {
120
- return !1;
121
- }
122
- }
123
- function nr(o) {
124
- try {
125
- return o instanceof VideoFrame;
126
- } catch {
127
- return !1;
128
- }
129
- }
130
- function ar(o) {
131
- try {
132
- return o instanceof Blob;
133
- } catch {
134
- return !1;
135
- }
136
- }
137
- function Ma(o) {
138
- try {
139
- return o instanceof ImageData;
140
- } catch {
141
- return !1;
142
- }
143
- }
144
- function Sa(o, h) {
145
- try {
146
- const s = new OffscreenCanvas(o, h);
147
- if (s.getContext("2d") instanceof OffscreenCanvasRenderingContext2D)
148
- return s;
149
- throw void 0;
150
- } catch {
151
- const s = document.createElement("canvas");
152
- return s.width = o, s.height = h, s;
153
- }
154
- }
155
- async function or(o) {
156
- if (Ze(o) && !await Wa(o))
157
- throw new DOMException(
158
- "Failed to load or decode HTMLImageElement.",
159
- "InvalidStateError"
160
- );
161
- if (Je(o) && !await ka(o))
162
- throw new DOMException(
163
- "Failed to load or decode SVGImageElement.",
164
- "InvalidStateError"
165
- );
166
- if (nr(o) && Ha(o))
167
- throw new DOMException("VideoFrame is closed.", "InvalidStateError");
168
- if (Ke(o) && (o.readyState === 0 || o.readyState === 1))
169
- throw new DOMException("Invalid element or state.", "InvalidStateError");
170
- if (er(o) && Ua(o))
171
- throw new DOMException(
172
- "The image source is detached.",
173
- "InvalidStateError"
174
- );
175
- const { width: h, height: s } = Fa(o);
176
- if (h === 0 || s === 0)
177
- return null;
178
- const g = Sa(h, s).getContext("2d");
179
- g.drawImage(o, 0, 0);
180
- try {
181
- return g.getImageData(0, 0, h, s);
182
- } catch {
183
- throw new DOMException("Source would taint origin.", "SecurityError");
184
- }
185
- }
186
- async function ja(o) {
187
- let h;
188
- try {
189
- if (globalThis.createImageBitmap)
190
- h = await createImageBitmap(o);
191
- else if (globalThis.Image) {
192
- h = new Image();
193
- let $ = "";
194
- try {
195
- $ = URL.createObjectURL(o), h.src = $, await h.decode();
196
- } finally {
197
- URL.revokeObjectURL($);
198
- }
199
- } else
200
- return o;
201
- } catch {
202
- throw new DOMException(
203
- "Failed to load or decode Blob.",
204
- "InvalidStateError"
205
- );
206
- }
207
- return await or(h);
208
- }
209
- function Ia(o) {
210
- const { width: h, height: s } = o;
211
- if (h === 0 || s === 0)
212
- return null;
213
- const $ = o.getContext("2d");
214
- try {
215
- return $.getImageData(0, 0, h, s);
216
- } catch {
217
- throw new DOMException("Source would taint origin.", "SecurityError");
218
- }
219
- }
220
- async function Ra(o) {
221
- if (ar(o))
222
- return await ja(o);
223
- if (Ma(o)) {
224
- if (Ba(o))
225
- throw new DOMException(
226
- "The image data has been detached.",
227
- "InvalidStateError"
228
- );
229
- return o;
230
- }
231
- return tr(o) || rr(o) ? Ia(o) : await or(o);
232
- }
233
- async function Wa(o) {
234
- try {
235
- return await o.decode(), !0;
236
- } catch {
237
- return !1;
238
- }
239
- }
240
- async function ka(o) {
241
- var h;
242
- try {
243
- return await ((h = o.decode) == null ? void 0 : h.call(o)), !0;
244
- } catch {
245
- return !1;
246
- }
247
- }
248
- function Ha(o) {
249
- return o.format === null;
250
- }
251
- function Ba(o) {
252
- return o.data.buffer.byteLength === 0;
253
- }
254
- function Ua(o) {
255
- return o.width === 0 && o.height === 0;
256
- }
257
- function Ge(o, h) {
258
- return o instanceof DOMException ? new DOMException(`${h}: ${o.message}`, o.name) : o instanceof Error ? new o.constructor(`${h}: ${o.message}`) : new Error(`${h}: ${o}`);
259
- }
260
- const Xe = [
8
+ f instanceof WeakSet ? f.add(i) : f.set(i, c);
9
+ }, Je = (i, f, c, w) => (Qe(i, f, "write to private field"), w ? w.call(i, c) : f.set(i, c), c);
10
+ const Ke = [
261
11
  "Aztec",
262
12
  "Codabar",
263
13
  "Code128",
@@ -281,30 +31,30 @@ const Xe = [
281
31
  "UPC-A",
282
32
  "UPC-E"
283
33
  ];
284
- function Va(o) {
285
- return o.join("|");
34
+ function Ha(i) {
35
+ return i.join("|");
286
36
  }
287
- function La(o) {
288
- const h = qe(o);
289
- let s = 0, $ = Xe.length - 1;
290
- for (; s <= $; ) {
291
- const g = Math.floor((s + $) / 2), b = Xe[g], H = qe(b);
292
- if (H === h)
293
- return b;
294
- H < h ? s = g + 1 : $ = g - 1;
37
+ function Ba(i) {
38
+ const f = tr(i);
39
+ let c = 0, w = Ke.length - 1;
40
+ for (; c <= w; ) {
41
+ const v = Math.floor((c + w) / 2), $ = Ke[v], B = tr($);
42
+ if (B === f)
43
+ return $;
44
+ B < f ? c = v + 1 : w = v - 1;
295
45
  }
296
46
  return "None";
297
47
  }
298
- function qe(o) {
299
- return o.toLowerCase().replace(/_-\[\]/g, "");
48
+ function tr(i) {
49
+ return i.toLowerCase().replace(/_-\[\]/g, "");
300
50
  }
301
- function Ya(o, h) {
302
- return o.Binarizer[h];
51
+ function Ua(i, f) {
52
+ return i.Binarizer[f];
303
53
  }
304
- function za(o, h) {
305
- return o.CharacterSet[h];
54
+ function Va(i, f) {
55
+ return i.CharacterSet[f];
306
56
  }
307
- const Na = [
57
+ const La = [
308
58
  "Text",
309
59
  "Binary",
310
60
  "Mixed",
@@ -312,16 +62,16 @@ const Na = [
312
62
  "ISO15434",
313
63
  "UnknownECI"
314
64
  ];
315
- function Ga(o) {
316
- return Na[o.value];
65
+ function Ya(i) {
66
+ return La[i.value];
317
67
  }
318
- function Xa(o, h) {
319
- return o.EanAddOnSymbol[h];
68
+ function za(i, f) {
69
+ return i.EanAddOnSymbol[f];
320
70
  }
321
- function qa(o, h) {
322
- return o.TextMode[h];
71
+ function Na(i, f) {
72
+ return i.TextMode[f];
323
73
  }
324
- const lt = {
74
+ const dt = {
325
75
  formats: [],
326
76
  tryHarder: !0,
327
77
  tryRotate: !0,
@@ -342,602 +92,618 @@ const lt = {
342
92
  textMode: "Plain",
343
93
  characterSet: "Unknown"
344
94
  };
345
- function ir(o, h) {
95
+ function rr(i, f) {
346
96
  return {
347
- ...h,
348
- formats: Va(h.formats),
349
- binarizer: Ya(o, h.binarizer),
350
- eanAddOnSymbol: Xa(
351
- o,
352
- h.eanAddOnSymbol
97
+ ...f,
98
+ formats: Ha(f.formats),
99
+ binarizer: Ua(i, f.binarizer),
100
+ eanAddOnSymbol: za(
101
+ i,
102
+ f.eanAddOnSymbol
353
103
  ),
354
- textMode: qa(o, h.textMode),
355
- characterSet: za(
356
- o,
357
- h.characterSet
104
+ textMode: Na(i, f.textMode),
105
+ characterSet: Va(
106
+ i,
107
+ f.characterSet
358
108
  )
359
109
  };
360
110
  }
361
- function sr(o) {
111
+ function nr(i) {
362
112
  return {
363
- ...o,
364
- format: La(o.format),
365
- eccLevel: o.eccLevel,
366
- contentType: Ga(o.contentType)
113
+ ...i,
114
+ format: Ba(i.format),
115
+ eccLevel: i.eccLevel,
116
+ contentType: Ya(i.contentType)
367
117
  };
368
118
  }
369
- const Qa = {
370
- locateFile: (o, h) => {
371
- const s = o.match(/_(.+?)\.wasm$/);
372
- return s ? `https://fastly.jsdelivr.net/npm/zxing-wasm@1.1.3/dist/${s[1]}/${o}` : h + o;
119
+ const Ga = {
120
+ locateFile: (i, f) => {
121
+ const c = i.match(/_(.+?)\.wasm$/);
122
+ return c ? `https://fastly.jsdelivr.net/npm/zxing-wasm@1.2.4/dist/${c[1]}/${i}` : f + i;
373
123
  }
374
124
  };
375
- let ne = /* @__PURE__ */ new WeakMap();
376
- function ae(o, h) {
377
- var s;
378
- const $ = ne.get(o);
379
- if ($ != null && $.modulePromise && (h === void 0 || Object.is(h, $.moduleOverrides)))
380
- return $.modulePromise;
381
- const g = (s = h != null ? h : $ == null ? void 0 : $.moduleOverrides) != null ? s : Qa, b = o({
382
- ...g
125
+ let ue = /* @__PURE__ */ new WeakMap();
126
+ function ce(i, f) {
127
+ var c;
128
+ const w = ue.get(i);
129
+ if (w != null && w.modulePromise && (f === void 0 || Object.is(f, w.moduleOverrides)))
130
+ return w.modulePromise;
131
+ const v = (c = f != null ? f : w == null ? void 0 : w.moduleOverrides) != null ? c : Ga, $ = i({
132
+ ...v
383
133
  });
384
- return ne.set(o, {
385
- moduleOverrides: g,
386
- modulePromise: b
387
- }), b;
134
+ return ue.set(i, {
135
+ moduleOverrides: v,
136
+ modulePromise: $
137
+ }), $;
388
138
  }
389
- function Za(o, h) {
390
- ne.set(o, {
391
- moduleOverrides: h
139
+ function Xa(i, f) {
140
+ ue.set(i, {
141
+ moduleOverrides: f
392
142
  });
393
143
  }
394
- async function Ja(o, h, s = lt) {
395
- const $ = {
396
- ...lt,
397
- ...s
398
- }, g = await ae(o), { size: b } = h, H = new Uint8Array(await h.arrayBuffer()), L = g._malloc(b);
399
- g.HEAPU8.set(H, L);
400
- const B = g.readBarcodesFromImage(
401
- L,
402
- b,
403
- ir(g, $)
144
+ async function qa(i, f, c = dt) {
145
+ const w = {
146
+ ...dt,
147
+ ...c
148
+ }, v = await ce(i), { size: $ } = f, B = new Uint8Array(await f.arrayBuffer()), U = v._malloc($);
149
+ v.HEAPU8.set(B, U);
150
+ const V = v.readBarcodesFromImage(
151
+ U,
152
+ $,
153
+ rr(v, w)
404
154
  );
405
- g._free(L);
406
- const M = [];
407
- for (let Y = 0; Y < B.size(); ++Y)
408
- M.push(
409
- sr(B.get(Y))
155
+ v._free(U);
156
+ const H = [];
157
+ for (let M = 0; M < V.size(); ++M)
158
+ H.push(
159
+ nr(V.get(M))
410
160
  );
411
- return M;
161
+ return H;
412
162
  }
413
- async function Ka(o, h, s = lt) {
414
- const $ = {
415
- ...lt,
416
- ...s
417
- }, g = await ae(o), {
418
- data: b,
419
- width: H,
420
- height: L,
421
- data: { byteLength: B }
422
- } = h, M = g._malloc(B);
423
- g.HEAPU8.set(b, M);
424
- const Y = g.readBarcodesFromPixmap(
425
- M,
163
+ async function Qa(i, f, c = dt) {
164
+ const w = {
165
+ ...dt,
166
+ ...c
167
+ }, v = await ce(i), {
168
+ data: $,
169
+ width: B,
170
+ height: U,
171
+ data: { byteLength: V }
172
+ } = f, H = v._malloc(V);
173
+ v.HEAPU8.set($, H);
174
+ const M = v.readBarcodesFromPixmap(
426
175
  H,
427
- L,
428
- ir(g, $)
176
+ B,
177
+ U,
178
+ rr(v, w)
429
179
  );
430
- g._free(M);
431
- const G = [];
432
- for (let U = 0; U < Y.size(); ++U)
433
- G.push(
434
- sr(Y.get(U))
180
+ v._free(H);
181
+ const K = [];
182
+ for (let L = 0; L < M.size(); ++L)
183
+ K.push(
184
+ nr(M.get(L))
435
185
  );
436
- return G;
186
+ return K;
437
187
  }
438
188
  ({
439
- ...lt,
440
- formats: [...lt.formats]
189
+ ...dt,
190
+ formats: [...dt.formats]
441
191
  });
442
- var Rt = (() => {
443
- var o = typeof document < "u" && document.currentScript ? document.currentScript.src : void 0;
444
- return function(h = {}) {
445
- var s = h, $, g;
446
- s.ready = new Promise((t, e) => {
447
- $ = t, g = e;
192
+ var Ut = (() => {
193
+ var i = typeof document < "u" && document.currentScript ? document.currentScript.src : void 0;
194
+ return function(f = {}) {
195
+ var c = f, w, v;
196
+ c.ready = new Promise((e, t) => {
197
+ w = e, v = t;
448
198
  });
449
- var b = Object.assign({}, s), H = "./this.program", L = typeof window == "object", B = typeof importScripts == "function";
199
+ var $ = Object.assign({}, c), B = "./this.program", U = typeof window == "object", V = typeof Bun < "u", H = typeof importScripts == "function";
450
200
  typeof process == "object" && typeof process.versions == "object" && process.versions.node;
451
201
  var M = "";
452
- function Y(t) {
453
- return s.locateFile ? s.locateFile(t, M) : M + t;
202
+ function K(e) {
203
+ return c.locateFile ? c.locateFile(e, M) : M + e;
454
204
  }
455
- var G;
456
- (L || B) && (B ? M = self.location.href : typeof document < "u" && document.currentScript && (M = document.currentScript.src), o && (M = o), M.indexOf("blob:") !== 0 ? M = M.substr(0, M.replace(/[?#].*/, "").lastIndexOf("/") + 1) : M = "", B && (G = (t) => {
457
- var e = new XMLHttpRequest();
458
- return e.open("GET", t, !1), e.responseType = "arraybuffer", e.send(null), new Uint8Array(e.response);
459
- })), s.print || console.log.bind(console);
460
- var U = s.printErr || console.error.bind(console);
461
- Object.assign(s, b), b = null, s.arguments && s.arguments, s.thisProgram && (H = s.thisProgram), s.quit && s.quit;
462
- var Q;
463
- s.wasmBinary && (Q = s.wasmBinary), typeof WebAssembly != "object" && bt("no native wasm support detected");
464
- var tt, dt = !1, V, W, at, ft, k, T, oe, ie;
465
- function se() {
466
- var t = tt.buffer;
467
- s.HEAP8 = V = new Int8Array(t), s.HEAP16 = at = new Int16Array(t), s.HEAPU8 = W = new Uint8Array(t), s.HEAPU16 = ft = new Uint16Array(t), s.HEAP32 = k = new Int32Array(t), s.HEAPU32 = T = new Uint32Array(t), s.HEAPF32 = oe = new Float32Array(t), s.HEAPF64 = ie = new Float64Array(t);
205
+ var L;
206
+ (U || H || V) && (H ? M = self.location.href : typeof document < "u" && document.currentScript && (M = document.currentScript.src), i && (M = i), M.startsWith("blob:") ? M = "" : M = M.substr(0, M.replace(/[?#].*/, "").lastIndexOf("/") + 1), H && (L = (e) => {
207
+ var t = new XMLHttpRequest();
208
+ return t.open("GET", e, !1), t.responseType = "arraybuffer", t.send(null), new Uint8Array(t.response);
209
+ }));
210
+ var ht = c.print || console.log.bind(console), X = c.printErr || console.error.bind(console);
211
+ Object.assign(c, $), $ = null, c.arguments && c.arguments, c.thisProgram && (B = c.thisProgram), c.quit && c.quit;
212
+ var tt;
213
+ c.wasmBinary && (tt = c.wasmBinary), typeof WebAssembly != "object" && Tt("no native wasm support detected");
214
+ var at, _t = !1, Y, W, ot, ft, R, _, le, de;
215
+ function he() {
216
+ var e = at.buffer;
217
+ c.HEAP8 = Y = new Int8Array(e), c.HEAP16 = ot = new Int16Array(e), c.HEAPU8 = W = new Uint8Array(e), c.HEAPU16 = ft = new Uint16Array(e), c.HEAP32 = R = new Int32Array(e), c.HEAPU32 = _ = new Uint32Array(e), c.HEAPF32 = le = new Float32Array(e), c.HEAPF64 = de = new Float64Array(e);
468
218
  }
469
- var ue = [], ce = [], le = [];
470
- function ur() {
471
- if (s.preRun)
472
- for (typeof s.preRun == "function" && (s.preRun = [s.preRun]); s.preRun.length; )
473
- dr(s.preRun.shift());
474
- Wt(ue);
219
+ var fe = [], pe = [], me = [];
220
+ function pr() {
221
+ if (c.preRun)
222
+ for (typeof c.preRun == "function" && (c.preRun = [c.preRun]); c.preRun.length; )
223
+ vr(c.preRun.shift());
224
+ Vt(fe);
475
225
  }
476
- function cr() {
477
- Wt(ce);
226
+ function mr() {
227
+ Vt(pe);
478
228
  }
479
- function lr() {
480
- if (s.postRun)
481
- for (typeof s.postRun == "function" && (s.postRun = [s.postRun]); s.postRun.length; )
482
- hr(s.postRun.shift());
483
- Wt(le);
229
+ function yr() {
230
+ if (c.postRun)
231
+ for (typeof c.postRun == "function" && (c.postRun = [c.postRun]); c.postRun.length; )
232
+ wr(c.postRun.shift());
233
+ Vt(me);
484
234
  }
485
- function dr(t) {
486
- ue.unshift(t);
235
+ function vr(e) {
236
+ fe.unshift(e);
487
237
  }
488
- function fr(t) {
489
- ce.unshift(t);
238
+ function gr(e) {
239
+ pe.unshift(e);
490
240
  }
491
- function hr(t) {
492
- le.unshift(t);
241
+ function wr(e) {
242
+ me.unshift(e);
493
243
  }
494
- var et = 0, ht = null;
495
- function pr(t) {
496
- var e;
497
- et++, (e = s.monitorRunDependencies) === null || e === void 0 || e.call(s, et);
244
+ var et = 0, pt = null;
245
+ function $r(e) {
246
+ var t;
247
+ et++, (t = c.monitorRunDependencies) === null || t === void 0 || t.call(c, et);
498
248
  }
499
- function mr(t) {
500
- var e;
501
- if (et--, (e = s.monitorRunDependencies) === null || e === void 0 || e.call(s, et), et == 0 && ht) {
502
- var r = ht;
503
- ht = null, r();
249
+ function br(e) {
250
+ var t;
251
+ if (et--, (t = c.monitorRunDependencies) === null || t === void 0 || t.call(c, et), et == 0 && pt) {
252
+ var r = pt;
253
+ pt = null, r();
504
254
  }
505
255
  }
506
- function bt(t) {
507
- var e;
508
- (e = s.onAbort) === null || e === void 0 || e.call(s, t), t = "Aborted(" + t + ")", U(t), dt = !0, t += ". Build with -sASSERTIONS for more info.";
509
- var r = new WebAssembly.RuntimeError(t);
510
- throw g(r), r;
256
+ function Tt(e) {
257
+ var t;
258
+ (t = c.onAbort) === null || t === void 0 || t.call(c, e), e = "Aborted(" + e + ")", X(e), _t = !0, e += ". Build with -sASSERTIONS for more info.";
259
+ var r = new WebAssembly.RuntimeError(e);
260
+ throw v(r), r;
511
261
  }
512
- var vr = "data:application/octet-stream;base64,", de = (t) => t.startsWith(vr), ot;
513
- ot = "zxing_reader.wasm", de(ot) || (ot = Y(ot));
514
- function fe(t) {
515
- if (t == ot && Q)
516
- return new Uint8Array(Q);
517
- if (G)
518
- return G(t);
262
+ var Cr = "data:application/octet-stream;base64,", ye = (e) => e.startsWith(Cr), it;
263
+ it = "zxing_reader.wasm", ye(it) || (it = K(it));
264
+ function ve(e) {
265
+ if (e == it && tt)
266
+ return new Uint8Array(tt);
267
+ if (L)
268
+ return L(e);
519
269
  throw "both async and sync fetching of the wasm failed";
520
270
  }
521
- function yr(t) {
522
- return !Q && (L || B) && typeof fetch == "function" ? fetch(t, {
271
+ function _r(e) {
272
+ return !tt && (U || H || V) && typeof fetch == "function" ? fetch(e, {
523
273
  credentials: "same-origin"
524
- }).then((e) => {
525
- if (!e.ok)
526
- throw "failed to load wasm binary file at '" + t + "'";
527
- return e.arrayBuffer();
528
- }).catch(() => fe(t)) : Promise.resolve().then(() => fe(t));
274
+ }).then((t) => {
275
+ if (!t.ok)
276
+ throw `failed to load wasm binary file at '${e}'`;
277
+ return t.arrayBuffer();
278
+ }).catch(() => ve(e)) : Promise.resolve().then(() => ve(e));
529
279
  }
530
- function he(t, e, r) {
531
- return yr(t).then((n) => WebAssembly.instantiate(n, e)).then((n) => n).then(r, (n) => {
532
- U(`failed to asynchronously prepare wasm: ${n}`), bt(n);
280
+ function ge(e, t, r) {
281
+ return _r(e).then((n) => WebAssembly.instantiate(n, t)).then(r, (n) => {
282
+ X(`failed to asynchronously prepare wasm: ${n}`), Tt(n);
533
283
  });
534
284
  }
535
- function gr(t, e, r, n) {
536
- return !t && typeof WebAssembly.instantiateStreaming == "function" && !de(e) && typeof fetch == "function" ? fetch(e, {
285
+ function Tr(e, t, r, n) {
286
+ return !e && typeof WebAssembly.instantiateStreaming == "function" && !ye(t) && typeof fetch == "function" ? fetch(t, {
537
287
  credentials: "same-origin"
538
288
  }).then((a) => {
539
- var i = WebAssembly.instantiateStreaming(a, r);
540
- return i.then(n, function(u) {
541
- return U(`wasm streaming compile failed: ${u}`), U("falling back to ArrayBuffer instantiation"), he(e, r, n);
289
+ var o = WebAssembly.instantiateStreaming(a, r);
290
+ return o.then(n, function(s) {
291
+ return X(`wasm streaming compile failed: ${s}`), X("falling back to ArrayBuffer instantiation"), ge(t, r, n);
542
292
  });
543
- }) : he(e, r, n);
293
+ }) : ge(t, r, n);
544
294
  }
545
- function wr() {
546
- var t = {
547
- a: sa
295
+ function Pr() {
296
+ var e = {
297
+ a: va
548
298
  };
549
- function e(n, a) {
550
- return S = n.exports, tt = S.ia, se(), _e = S.ma, fr(S.ja), mr(), S;
299
+ function t(n, a) {
300
+ return A = n.exports, at = A.ma, he(), Ae = A.qa, gr(A.na), br(), A;
551
301
  }
552
- pr();
302
+ $r();
553
303
  function r(n) {
554
- e(n.instance);
304
+ t(n.instance);
555
305
  }
556
- if (s.instantiateWasm)
306
+ if (c.instantiateWasm)
557
307
  try {
558
- return s.instantiateWasm(t, e);
308
+ return c.instantiateWasm(e, t);
559
309
  } catch (n) {
560
- U(`Module.instantiateWasm callback failed with error: ${n}`), g(n);
310
+ X(`Module.instantiateWasm callback failed with error: ${n}`), v(n);
561
311
  }
562
- return gr(Q, ot, t, r).catch(g), {};
312
+ return Tr(tt, it, e, r).catch(v), {};
563
313
  }
564
- var Wt = (t) => {
565
- for (; t.length > 0; )
566
- t.shift()(s);
314
+ var Vt = (e) => {
315
+ for (; e.length > 0; )
316
+ e.shift()(c);
567
317
  };
568
- s.noExitRuntime;
569
- var Ct = [], _t = 0, $r = (t) => {
570
- var e = new kt(t);
571
- return e.get_caught() || (e.set_caught(!0), _t--), e.set_rethrown(!1), Ct.push(e), We(e.excPtr), e.get_exception_ptr();
572
- }, Z = 0, br = () => {
573
- P(0, 0);
574
- var t = Ct.pop();
575
- Re(t.excPtr), Z = 0;
318
+ c.noExitRuntime;
319
+ var Pt = [], Et = 0, Er = (e) => {
320
+ var t = new Lt(e);
321
+ return t.get_caught() || (t.set_caught(!0), Et--), t.set_rethrown(!1), Pt.push(t), Ve(t.excPtr), t.get_exception_ptr();
322
+ }, q = 0, Ar = () => {
323
+ T(0, 0);
324
+ var e = Pt.pop();
325
+ Ue(e.excPtr), q = 0;
576
326
  };
577
- function kt(t) {
578
- this.excPtr = t, this.ptr = t - 24, this.set_type = function(e) {
579
- T[this.ptr + 4 >> 2] = e;
580
- }, this.get_type = function() {
581
- return T[this.ptr + 4 >> 2];
582
- }, this.set_destructor = function(e) {
583
- T[this.ptr + 8 >> 2] = e;
584
- }, this.get_destructor = function() {
585
- return T[this.ptr + 8 >> 2];
586
- }, this.set_caught = function(e) {
587
- e = e ? 1 : 0, V[this.ptr + 12 >> 0] = e;
588
- }, this.get_caught = function() {
589
- return V[this.ptr + 12 >> 0] != 0;
590
- }, this.set_rethrown = function(e) {
591
- e = e ? 1 : 0, V[this.ptr + 13 >> 0] = e;
592
- }, this.get_rethrown = function() {
593
- return V[this.ptr + 13 >> 0] != 0;
594
- }, this.init = function(e, r) {
595
- this.set_adjusted_ptr(0), this.set_type(e), this.set_destructor(r);
596
- }, this.set_adjusted_ptr = function(e) {
597
- T[this.ptr + 16 >> 2] = e;
598
- }, this.get_adjusted_ptr = function() {
599
- return T[this.ptr + 16 >> 2];
600
- }, this.get_exception_ptr = function() {
601
- var e = He(this.get_type());
602
- if (e)
603
- return T[this.excPtr >> 2];
327
+ class Lt {
328
+ constructor(t) {
329
+ this.excPtr = t, this.ptr = t - 24;
330
+ }
331
+ set_type(t) {
332
+ _[this.ptr + 4 >> 2] = t;
333
+ }
334
+ get_type() {
335
+ return _[this.ptr + 4 >> 2];
336
+ }
337
+ set_destructor(t) {
338
+ _[this.ptr + 8 >> 2] = t;
339
+ }
340
+ get_destructor() {
341
+ return _[this.ptr + 8 >> 2];
342
+ }
343
+ set_caught(t) {
344
+ t = t ? 1 : 0, Y[this.ptr + 12] = t;
345
+ }
346
+ get_caught() {
347
+ return Y[this.ptr + 12] != 0;
348
+ }
349
+ set_rethrown(t) {
350
+ t = t ? 1 : 0, Y[this.ptr + 13] = t;
351
+ }
352
+ get_rethrown() {
353
+ return Y[this.ptr + 13] != 0;
354
+ }
355
+ init(t, r) {
356
+ this.set_adjusted_ptr(0), this.set_type(t), this.set_destructor(r);
357
+ }
358
+ set_adjusted_ptr(t) {
359
+ _[this.ptr + 16 >> 2] = t;
360
+ }
361
+ get_adjusted_ptr() {
362
+ return _[this.ptr + 16 >> 2];
363
+ }
364
+ get_exception_ptr() {
365
+ var t = Ye(this.get_type());
366
+ if (t)
367
+ return _[this.excPtr >> 2];
604
368
  var r = this.get_adjusted_ptr();
605
369
  return r !== 0 ? r : this.excPtr;
606
- };
370
+ }
607
371
  }
608
- var Cr = (t) => {
609
- throw Z || (Z = t), Z;
610
- }, Ht = (t) => {
611
- var e = Z;
612
- if (!e)
613
- return $t(0), 0;
614
- var r = new kt(e);
615
- r.set_adjusted_ptr(e);
372
+ var Dr = (e) => {
373
+ throw q || (q = e), q;
374
+ }, Yt = (e) => {
375
+ var t = q;
376
+ if (!t)
377
+ return Ct(0), 0;
378
+ var r = new Lt(t);
379
+ r.set_adjusted_ptr(t);
616
380
  var n = r.get_type();
617
381
  if (!n)
618
- return $t(0), e;
619
- for (var a in t) {
620
- var i = t[a];
621
- if (i === 0 || i === n)
382
+ return Ct(0), t;
383
+ for (var a in e) {
384
+ var o = e[a];
385
+ if (o === 0 || o === n)
622
386
  break;
623
- var u = r.ptr + 16;
624
- if (ke(i, n, u))
625
- return $t(i), e;
626
- }
627
- return $t(n), e;
628
- }, _r = () => Ht([]), Tr = (t) => Ht([t]), Pr = (t, e) => Ht([t, e]), Er = () => {
629
- var t = Ct.pop();
630
- t || bt("no exception to throw");
631
- var e = t.excPtr;
632
- throw t.get_rethrown() || (Ct.push(t), t.set_rethrown(!0), t.set_caught(!1), _t++), Z = e, Z;
633
- }, Ar = (t, e, r) => {
634
- var n = new kt(t);
635
- throw n.init(e, r), Z = t, _t++, Z;
636
- }, Or = () => _t, Tt = {}, Bt = (t) => {
637
- for (; t.length; ) {
638
- var e = t.pop(), r = t.pop();
639
- r(e);
387
+ var s = r.ptr + 16;
388
+ if (Le(o, n, s))
389
+ return Ct(o), t;
390
+ }
391
+ return Ct(n), t;
392
+ }, xr = () => Yt([]), Or = (e) => Yt([e]), Fr = (e, t) => Yt([e, t]), Mr = () => {
393
+ var e = Pt.pop();
394
+ e || Tt("no exception to throw");
395
+ var t = e.excPtr;
396
+ throw e.get_rethrown() || (Pt.push(e), e.set_rethrown(!0), e.set_caught(!1), Et++), q = t, q;
397
+ }, Sr = (e, t, r) => {
398
+ var n = new Lt(e);
399
+ throw n.init(t, r), q = e, Et++, q;
400
+ }, jr = () => Et, At = {}, zt = (e) => {
401
+ for (; e.length; ) {
402
+ var t = e.pop(), r = e.pop();
403
+ r(t);
640
404
  }
641
405
  };
642
- function Ut(t) {
643
- return this.fromWireType(k[t >> 2]);
406
+ function mt(e) {
407
+ return this.fromWireType(_[e >> 2]);
644
408
  }
645
- var it = {}, rt = {}, Pt = {}, pe, Et = (t) => {
646
- throw new pe(t);
647
- }, nt = (t, e, r) => {
648
- t.forEach(function(c) {
649
- Pt[c] = e;
409
+ var st = {}, rt = {}, Dt = {}, we, xt = (e) => {
410
+ throw new we(e);
411
+ }, nt = (e, t, r) => {
412
+ e.forEach(function(u) {
413
+ Dt[u] = t;
650
414
  });
651
- function n(c) {
652
- var l = r(c);
653
- l.length !== t.length && Et("Mismatched type converter count");
654
- for (var f = 0; f < t.length; ++f)
655
- X(t[f], l[f]);
656
- }
657
- var a = new Array(e.length), i = [], u = 0;
658
- e.forEach((c, l) => {
659
- rt.hasOwnProperty(c) ? a[l] = rt[c] : (i.push(c), it.hasOwnProperty(c) || (it[c] = []), it[c].push(() => {
660
- a[l] = rt[c], ++u, u === i.length && n(a);
415
+ function n(u) {
416
+ var l = r(u);
417
+ l.length !== e.length && xt("Mismatched type converter count");
418
+ for (var h = 0; h < e.length; ++h)
419
+ N(e[h], l[h]);
420
+ }
421
+ var a = new Array(t.length), o = [], s = 0;
422
+ t.forEach((u, l) => {
423
+ rt.hasOwnProperty(u) ? a[l] = rt[u] : (o.push(u), st.hasOwnProperty(u) || (st[u] = []), st[u].push(() => {
424
+ a[l] = rt[u], ++s, s === o.length && n(a);
661
425
  }));
662
- }), i.length === 0 && n(a);
663
- }, Dr = (t) => {
664
- var e = Tt[t];
665
- delete Tt[t];
666
- var r = e.rawConstructor, n = e.rawDestructor, a = e.fields, i = a.map((u) => u.getterReturnType).concat(a.map((u) => u.setterArgumentType));
667
- nt([t], i, (u) => {
668
- var c = {};
669
- return a.forEach((l, f) => {
670
- var p = l.fieldName, v = u[f], y = l.getter, w = l.getterContext, E = u[f + a.length], x = l.setter, _ = l.setterContext;
671
- c[p] = {
672
- read: (R) => v.fromWireType(y(w, R)),
673
- write: (R, d) => {
426
+ }), o.length === 0 && n(a);
427
+ }, Ir = (e) => {
428
+ var t = At[e];
429
+ delete At[e];
430
+ var r = t.rawConstructor, n = t.rawDestructor, a = t.fields, o = a.map((s) => s.getterReturnType).concat(a.map((s) => s.setterArgumentType));
431
+ nt([e], o, (s) => {
432
+ var u = {};
433
+ return a.forEach((l, h) => {
434
+ var p = l.fieldName, g = s[h], y = l.getter, b = l.getterContext, O = s[h + a.length], k = l.setter, P = l.setterContext;
435
+ u[p] = {
436
+ read: (j) => g.fromWireType(y(b, j)),
437
+ write: (j, d) => {
674
438
  var m = [];
675
- x(_, R, E.toWireType(m, d)), Bt(m);
439
+ k(P, j, O.toWireType(m, d)), zt(m);
676
440
  }
677
441
  };
678
442
  }), [{
679
- name: e.name,
443
+ name: t.name,
680
444
  fromWireType: (l) => {
681
- var f = {};
682
- for (var p in c)
683
- f[p] = c[p].read(l);
684
- return n(l), f;
445
+ var h = {};
446
+ for (var p in u)
447
+ h[p] = u[p].read(l);
448
+ return n(l), h;
685
449
  },
686
- toWireType: (l, f) => {
687
- for (var p in c)
688
- if (!(p in f))
450
+ toWireType: (l, h) => {
451
+ for (var p in u)
452
+ if (!(p in h))
689
453
  throw new TypeError(`Missing field: "${p}"`);
690
- var v = r();
691
- for (p in c)
692
- c[p].write(v, f[p]);
693
- return l !== null && l.push(n, v), v;
454
+ var g = r();
455
+ for (p in u)
456
+ u[p].write(g, h[p]);
457
+ return l !== null && l.push(n, g), g;
694
458
  },
695
- argPackAdvance: q,
696
- readValueFromPointer: Ut,
459
+ argPackAdvance: G,
460
+ readValueFromPointer: mt,
697
461
  destructorFunction: n
698
462
  }];
699
463
  });
700
- }, xr = (t, e, r, n, a) => {
701
- }, Fr = () => {
702
- for (var t = new Array(256), e = 0; e < 256; ++e)
703
- t[e] = String.fromCharCode(e);
704
- me = t;
705
- }, me, I = (t) => {
706
- for (var e = "", r = t; W[r]; )
707
- e += me[W[r++]];
708
- return e;
709
- }, st, C = (t) => {
710
- throw new st(t);
464
+ }, Wr = (e, t, r, n, a) => {
465
+ }, Rr = () => {
466
+ for (var e = new Array(256), t = 0; t < 256; ++t)
467
+ e[t] = String.fromCharCode(t);
468
+ $e = e;
469
+ }, $e, I = (e) => {
470
+ for (var t = "", r = e; W[r]; )
471
+ t += $e[W[r++]];
472
+ return t;
473
+ }, ut, C = (e) => {
474
+ throw new ut(e);
711
475
  };
712
- function Mr(t, e) {
476
+ function kr(e, t) {
713
477
  let r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
714
- var n = e.name;
715
- if (t || C(`type "${n}" must have a positive integer typeid pointer`), rt.hasOwnProperty(t)) {
478
+ var n = t.name;
479
+ if (e || C(`type "${n}" must have a positive integer typeid pointer`), rt.hasOwnProperty(e)) {
716
480
  if (r.ignoreDuplicateRegistrations)
717
481
  return;
718
482
  C(`Cannot register type '${n}' twice`);
719
483
  }
720
- if (rt[t] = e, delete Pt[t], it.hasOwnProperty(t)) {
721
- var a = it[t];
722
- delete it[t], a.forEach((i) => i());
484
+ if (rt[e] = t, delete Dt[e], st.hasOwnProperty(e)) {
485
+ var a = st[e];
486
+ delete st[e], a.forEach((o) => o());
723
487
  }
724
488
  }
725
- function X(t, e) {
489
+ function N(e, t) {
726
490
  let r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
727
- if (!("argPackAdvance" in e))
491
+ if (!("argPackAdvance" in t))
728
492
  throw new TypeError("registerType registeredInstance requires argPackAdvance");
729
- return Mr(t, e, r);
493
+ return kr(e, t, r);
730
494
  }
731
- var q = 8, Sr = (t, e, r, n) => {
732
- e = I(e), X(t, {
733
- name: e,
495
+ var G = 8, Hr = (e, t, r, n) => {
496
+ t = I(t), N(e, {
497
+ name: t,
734
498
  fromWireType: function(a) {
735
499
  return !!a;
736
500
  },
737
- toWireType: function(a, i) {
738
- return i ? r : n;
501
+ toWireType: function(a, o) {
502
+ return o ? r : n;
739
503
  },
740
- argPackAdvance: q,
504
+ argPackAdvance: G,
741
505
  readValueFromPointer: function(a) {
742
506
  return this.fromWireType(W[a]);
743
507
  },
744
508
  destructorFunction: null
745
509
  });
746
- }, jr = (t) => ({
747
- count: t.count,
748
- deleteScheduled: t.deleteScheduled,
749
- preservePointerOnDelete: t.preservePointerOnDelete,
750
- ptr: t.ptr,
751
- ptrType: t.ptrType,
752
- smartPtr: t.smartPtr,
753
- smartPtrType: t.smartPtrType
754
- }), Vt = (t) => {
755
- function e(r) {
510
+ }, Br = (e) => ({
511
+ count: e.count,
512
+ deleteScheduled: e.deleteScheduled,
513
+ preservePointerOnDelete: e.preservePointerOnDelete,
514
+ ptr: e.ptr,
515
+ ptrType: e.ptrType,
516
+ smartPtr: e.smartPtr,
517
+ smartPtrType: e.smartPtrType
518
+ }), Nt = (e) => {
519
+ function t(r) {
756
520
  return r.$$.ptrType.registeredClass.name;
757
521
  }
758
- C(e(t) + " instance already deleted");
759
- }, Lt = !1, ve = (t) => {
760
- }, Ir = (t) => {
761
- t.smartPtr ? t.smartPtrType.rawDestructor(t.smartPtr) : t.ptrType.registeredClass.rawDestructor(t.ptr);
762
- }, ye = (t) => {
763
- t.count.value -= 1;
764
- var e = t.count.value === 0;
765
- e && Ir(t);
766
- }, ge = (t, e, r) => {
767
- if (e === r)
768
- return t;
522
+ C(t(e) + " instance already deleted");
523
+ }, Gt = !1, be = (e) => {
524
+ }, Ur = (e) => {
525
+ e.smartPtr ? e.smartPtrType.rawDestructor(e.smartPtr) : e.ptrType.registeredClass.rawDestructor(e.ptr);
526
+ }, Ce = (e) => {
527
+ e.count.value -= 1;
528
+ var t = e.count.value === 0;
529
+ t && Ur(e);
530
+ }, _e = (e, t, r) => {
531
+ if (t === r)
532
+ return e;
769
533
  if (r.baseClass === void 0)
770
534
  return null;
771
- var n = ge(t, e, r.baseClass);
535
+ var n = _e(e, t, r.baseClass);
772
536
  return n === null ? null : r.downcast(n);
773
- }, we = {}, Rr = () => Object.keys(vt).length, Wr = () => {
774
- var t = [];
775
- for (var e in vt)
776
- vt.hasOwnProperty(e) && t.push(vt[e]);
777
- return t;
778
- }, pt = [], Yt = () => {
779
- for (; pt.length; ) {
780
- var t = pt.pop();
781
- t.$$.deleteScheduled = !1, t.delete();
782
- }
783
- }, mt, kr = (t) => {
784
- mt = t, pt.length && mt && mt(Yt);
785
- }, Hr = () => {
786
- s.getInheritedInstanceCount = Rr, s.getLiveInheritedInstances = Wr, s.flushPendingDeletes = Yt, s.setDelayFunction = kr;
787
- }, vt = {}, Br = (t, e) => {
788
- for (e === void 0 && C("ptr should not be undefined"); t.baseClass; )
789
- e = t.upcast(e), t = t.baseClass;
537
+ }, Te = {}, Vr = () => Object.keys(gt).length, Lr = () => {
538
+ var e = [];
539
+ for (var t in gt)
540
+ gt.hasOwnProperty(t) && e.push(gt[t]);
790
541
  return e;
791
- }, Ur = (t, e) => (e = Br(t, e), vt[e]), At = (t, e) => {
792
- (!e.ptrType || !e.ptr) && Et("makeClassHandle requires ptr and ptrType");
793
- var r = !!e.smartPtrType, n = !!e.smartPtr;
794
- return r !== n && Et("Both smartPtrType and smartPtr must be specified"), e.count = {
542
+ }, yt = [], Xt = () => {
543
+ for (; yt.length; ) {
544
+ var e = yt.pop();
545
+ e.$$.deleteScheduled = !1, e.delete();
546
+ }
547
+ }, vt, Yr = (e) => {
548
+ vt = e, yt.length && vt && vt(Xt);
549
+ }, zr = () => {
550
+ c.getInheritedInstanceCount = Vr, c.getLiveInheritedInstances = Lr, c.flushPendingDeletes = Xt, c.setDelayFunction = Yr;
551
+ }, gt = {}, Nr = (e, t) => {
552
+ for (t === void 0 && C("ptr should not be undefined"); e.baseClass; )
553
+ t = e.upcast(t), e = e.baseClass;
554
+ return t;
555
+ }, Gr = (e, t) => (t = Nr(e, t), gt[t]), Ot = (e, t) => {
556
+ (!t.ptrType || !t.ptr) && xt("makeClassHandle requires ptr and ptrType");
557
+ var r = !!t.smartPtrType, n = !!t.smartPtr;
558
+ return r !== n && xt("Both smartPtrType and smartPtr must be specified"), t.count = {
795
559
  value: 1
796
- }, yt(Object.create(t, {
560
+ }, wt(Object.create(e, {
797
561
  $$: {
798
- value: e,
562
+ value: t,
799
563
  writable: !0
800
564
  }
801
565
  }));
802
566
  };
803
- function Vr(t) {
804
- var e = this.getPointee(t);
805
- if (!e)
806
- return this.destructor(t), null;
807
- var r = Ur(this.registeredClass, e);
567
+ function Xr(e) {
568
+ var t = this.getPointee(e);
569
+ if (!t)
570
+ return this.destructor(e), null;
571
+ var r = Gr(this.registeredClass, t);
808
572
  if (r !== void 0) {
809
573
  if (r.$$.count.value === 0)
810
- return r.$$.ptr = e, r.$$.smartPtr = t, r.clone();
574
+ return r.$$.ptr = t, r.$$.smartPtr = e, r.clone();
811
575
  var n = r.clone();
812
- return this.destructor(t), n;
576
+ return this.destructor(e), n;
813
577
  }
814
578
  function a() {
815
- return this.isSmartPointer ? At(this.registeredClass.instancePrototype, {
579
+ return this.isSmartPointer ? Ot(this.registeredClass.instancePrototype, {
816
580
  ptrType: this.pointeeType,
817
- ptr: e,
581
+ ptr: t,
818
582
  smartPtrType: this,
819
- smartPtr: t
820
- }) : At(this.registeredClass.instancePrototype, {
583
+ smartPtr: e
584
+ }) : Ot(this.registeredClass.instancePrototype, {
821
585
  ptrType: this,
822
- ptr: t
586
+ ptr: e
823
587
  });
824
588
  }
825
- var i = this.registeredClass.getActualType(e), u = we[i];
826
- if (!u)
589
+ var o = this.registeredClass.getActualType(t), s = Te[o];
590
+ if (!s)
827
591
  return a.call(this);
828
- var c;
829
- this.isConst ? c = u.constPointerType : c = u.pointerType;
830
- var l = ge(e, this.registeredClass, c.registeredClass);
831
- return l === null ? a.call(this) : this.isSmartPointer ? At(c.registeredClass.instancePrototype, {
832
- ptrType: c,
592
+ var u;
593
+ this.isConst ? u = s.constPointerType : u = s.pointerType;
594
+ var l = _e(t, this.registeredClass, u.registeredClass);
595
+ return l === null ? a.call(this) : this.isSmartPointer ? Ot(u.registeredClass.instancePrototype, {
596
+ ptrType: u,
833
597
  ptr: l,
834
598
  smartPtrType: this,
835
- smartPtr: t
836
- }) : At(c.registeredClass.instancePrototype, {
837
- ptrType: c,
599
+ smartPtr: e
600
+ }) : Ot(u.registeredClass.instancePrototype, {
601
+ ptrType: u,
838
602
  ptr: l
839
603
  });
840
604
  }
841
- var yt = (t) => typeof FinalizationRegistry > "u" ? (yt = (e) => e, t) : (Lt = new FinalizationRegistry((e) => {
842
- ye(e.$$);
843
- }), yt = (e) => {
844
- var r = e.$$, n = !!r.smartPtr;
605
+ var wt = (e) => typeof FinalizationRegistry > "u" ? (wt = (t) => t, e) : (Gt = new FinalizationRegistry((t) => {
606
+ Ce(t.$$);
607
+ }), wt = (t) => {
608
+ var r = t.$$, n = !!r.smartPtr;
845
609
  if (n) {
846
610
  var a = {
847
611
  $$: r
848
612
  };
849
- Lt.register(e, a, e);
613
+ Gt.register(t, a, t);
850
614
  }
851
- return e;
852
- }, ve = (e) => Lt.unregister(e), yt(t)), Lr = () => {
853
- Object.assign(Ot.prototype, {
854
- isAliasOf(t) {
855
- if (!(this instanceof Ot) || !(t instanceof Ot))
615
+ return t;
616
+ }, be = (t) => Gt.unregister(t), wt(e)), qr = () => {
617
+ Object.assign(Ft.prototype, {
618
+ isAliasOf(e) {
619
+ if (!(this instanceof Ft) || !(e instanceof Ft))
856
620
  return !1;
857
- var e = this.$$.ptrType.registeredClass, r = this.$$.ptr;
858
- t.$$ = t.$$;
859
- for (var n = t.$$.ptrType.registeredClass, a = t.$$.ptr; e.baseClass; )
860
- r = e.upcast(r), e = e.baseClass;
621
+ var t = this.$$.ptrType.registeredClass, r = this.$$.ptr;
622
+ e.$$ = e.$$;
623
+ for (var n = e.$$.ptrType.registeredClass, a = e.$$.ptr; t.baseClass; )
624
+ r = t.upcast(r), t = t.baseClass;
861
625
  for (; n.baseClass; )
862
626
  a = n.upcast(a), n = n.baseClass;
863
- return e === n && r === a;
627
+ return t === n && r === a;
864
628
  },
865
629
  clone() {
866
- if (this.$$.ptr || Vt(this), this.$$.preservePointerOnDelete)
630
+ if (this.$$.ptr || Nt(this), this.$$.preservePointerOnDelete)
867
631
  return this.$$.count.value += 1, this;
868
- var t = yt(Object.create(Object.getPrototypeOf(this), {
632
+ var e = wt(Object.create(Object.getPrototypeOf(this), {
869
633
  $$: {
870
- value: jr(this.$$)
634
+ value: Br(this.$$)
871
635
  }
872
636
  }));
873
- return t.$$.count.value += 1, t.$$.deleteScheduled = !1, t;
637
+ return e.$$.count.value += 1, e.$$.deleteScheduled = !1, e;
874
638
  },
875
639
  delete() {
876
- this.$$.ptr || Vt(this), this.$$.deleteScheduled && !this.$$.preservePointerOnDelete && C("Object already scheduled for deletion"), ve(this), ye(this.$$), this.$$.preservePointerOnDelete || (this.$$.smartPtr = void 0, this.$$.ptr = void 0);
640
+ this.$$.ptr || Nt(this), this.$$.deleteScheduled && !this.$$.preservePointerOnDelete && C("Object already scheduled for deletion"), be(this), Ce(this.$$), this.$$.preservePointerOnDelete || (this.$$.smartPtr = void 0, this.$$.ptr = void 0);
877
641
  },
878
642
  isDeleted() {
879
643
  return !this.$$.ptr;
880
644
  },
881
645
  deleteLater() {
882
- return this.$$.ptr || Vt(this), this.$$.deleteScheduled && !this.$$.preservePointerOnDelete && C("Object already scheduled for deletion"), pt.push(this), pt.length === 1 && mt && mt(Yt), this.$$.deleteScheduled = !0, this;
646
+ return this.$$.ptr || Nt(this), this.$$.deleteScheduled && !this.$$.preservePointerOnDelete && C("Object already scheduled for deletion"), yt.push(this), yt.length === 1 && vt && vt(Xt), this.$$.deleteScheduled = !0, this;
883
647
  }
884
648
  });
885
649
  };
886
- function Ot() {
650
+ function Ft() {
887
651
  }
888
- var gt = (t, e) => Object.defineProperty(e, "name", {
889
- value: t
890
- }), $e = (t, e, r) => {
891
- if (t[e].overloadTable === void 0) {
892
- var n = t[e];
893
- t[e] = function() {
894
- return t[e].overloadTable.hasOwnProperty(arguments.length) || C(`Function '${r}' called with an invalid number of arguments (${arguments.length}) - expects one of (${t[e].overloadTable})!`), t[e].overloadTable[arguments.length].apply(this, arguments);
895
- }, t[e].overloadTable = [], t[e].overloadTable[n.argCount] = n;
896
- }
897
- }, zt = (t, e, r) => {
898
- s.hasOwnProperty(t) ? ((r === void 0 || s[t].overloadTable !== void 0 && s[t].overloadTable[r] !== void 0) && C(`Cannot register public name '${t}' twice`), $e(s, t, t), s.hasOwnProperty(r) && C(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`), s[t].overloadTable[r] = e) : (s[t] = e, r !== void 0 && (s[t].numArguments = r));
899
- }, Yr = 48, zr = 57, Nr = (t) => {
900
- if (t === void 0)
652
+ var $t = (e, t) => Object.defineProperty(t, "name", {
653
+ value: e
654
+ }), Pe = (e, t, r) => {
655
+ if (e[t].overloadTable === void 0) {
656
+ var n = e[t];
657
+ e[t] = function() {
658
+ for (var a = arguments.length, o = new Array(a), s = 0; s < a; s++)
659
+ o[s] = arguments[s];
660
+ return e[t].overloadTable.hasOwnProperty(o.length) || C(`Function '${r}' called with an invalid number of arguments (${o.length}) - expects one of (${e[t].overloadTable})!`), e[t].overloadTable[o.length].apply(this, o);
661
+ }, e[t].overloadTable = [], e[t].overloadTable[n.argCount] = n;
662
+ }
663
+ }, qt = (e, t, r) => {
664
+ c.hasOwnProperty(e) ? ((r === void 0 || c[e].overloadTable !== void 0 && c[e].overloadTable[r] !== void 0) && C(`Cannot register public name '${e}' twice`), Pe(c, e, e), c.hasOwnProperty(r) && C(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`), c[e].overloadTable[r] = t) : (c[e] = t, r !== void 0 && (c[e].numArguments = r));
665
+ }, Qr = 48, Zr = 57, Jr = (e) => {
666
+ if (e === void 0)
901
667
  return "_unknown";
902
- t = t.replace(/[^a-zA-Z0-9_]/g, "$");
903
- var e = t.charCodeAt(0);
904
- return e >= Yr && e <= zr ? `_${t}` : t;
668
+ e = e.replace(/[^a-zA-Z0-9_]/g, "$");
669
+ var t = e.charCodeAt(0);
670
+ return t >= Qr && t <= Zr ? `_${e}` : e;
905
671
  };
906
- function Gr(t, e, r, n, a, i, u, c) {
907
- this.name = t, this.constructor = e, this.instancePrototype = r, this.rawDestructor = n, this.baseClass = a, this.getActualType = i, this.upcast = u, this.downcast = c, this.pureVirtualFunctions = [];
672
+ function Kr(e, t, r, n, a, o, s, u) {
673
+ this.name = e, this.constructor = t, this.instancePrototype = r, this.rawDestructor = n, this.baseClass = a, this.getActualType = o, this.upcast = s, this.downcast = u, this.pureVirtualFunctions = [];
908
674
  }
909
- var Nt = (t, e, r) => {
910
- for (; e !== r; )
911
- e.upcast || C(`Expected null or instance of ${r.name}, got an instance of ${e.name}`), t = e.upcast(t), e = e.baseClass;
912
- return t;
675
+ var Qt = (e, t, r) => {
676
+ for (; t !== r; )
677
+ t.upcast || C(`Expected null or instance of ${r.name}, got an instance of ${t.name}`), e = t.upcast(e), t = t.baseClass;
678
+ return e;
913
679
  };
914
- function Xr(t, e) {
915
- if (e === null)
680
+ function tn(e, t) {
681
+ if (t === null)
916
682
  return this.isReference && C(`null is not a valid ${this.name}`), 0;
917
- e.$$ || C(`Cannot pass "${Zt(e)}" as a ${this.name}`), e.$$.ptr || C(`Cannot pass deleted object as a pointer of type ${this.name}`);
918
- var r = e.$$.ptrType.registeredClass, n = Nt(e.$$.ptr, r, this.registeredClass);
683
+ t.$$ || C(`Cannot pass "${re(t)}" as a ${this.name}`), t.$$.ptr || C(`Cannot pass deleted object as a pointer of type ${this.name}`);
684
+ var r = t.$$.ptrType.registeredClass, n = Qt(t.$$.ptr, r, this.registeredClass);
919
685
  return n;
920
686
  }
921
- function qr(t, e) {
687
+ function en(e, t) {
922
688
  var r;
923
- if (e === null)
924
- return this.isReference && C(`null is not a valid ${this.name}`), this.isSmartPointer ? (r = this.rawConstructor(), t !== null && t.push(this.rawDestructor, r), r) : 0;
925
- (!e || !e.$$) && C(`Cannot pass "${Zt(e)}" as a ${this.name}`), e.$$.ptr || C(`Cannot pass deleted object as a pointer of type ${this.name}`), !this.isConst && e.$$.ptrType.isConst && C(`Cannot convert argument of type ${e.$$.smartPtrType ? e.$$.smartPtrType.name : e.$$.ptrType.name} to parameter type ${this.name}`);
926
- var n = e.$$.ptrType.registeredClass;
927
- if (r = Nt(e.$$.ptr, n, this.registeredClass), this.isSmartPointer)
928
- switch (e.$$.smartPtr === void 0 && C("Passing raw pointer to smart pointer is illegal"), this.sharingPolicy) {
689
+ if (t === null)
690
+ return this.isReference && C(`null is not a valid ${this.name}`), this.isSmartPointer ? (r = this.rawConstructor(), e !== null && e.push(this.rawDestructor, r), r) : 0;
691
+ (!t || !t.$$) && C(`Cannot pass "${re(t)}" as a ${this.name}`), t.$$.ptr || C(`Cannot pass deleted object as a pointer of type ${this.name}`), !this.isConst && t.$$.ptrType.isConst && C(`Cannot convert argument of type ${t.$$.smartPtrType ? t.$$.smartPtrType.name : t.$$.ptrType.name} to parameter type ${this.name}`);
692
+ var n = t.$$.ptrType.registeredClass;
693
+ if (r = Qt(t.$$.ptr, n, this.registeredClass), this.isSmartPointer)
694
+ switch (t.$$.smartPtr === void 0 && C("Passing raw pointer to smart pointer is illegal"), this.sharingPolicy) {
929
695
  case 0:
930
- e.$$.smartPtrType === this ? r = e.$$.smartPtr : C(`Cannot convert argument of type ${e.$$.smartPtrType ? e.$$.smartPtrType.name : e.$$.ptrType.name} to parameter type ${this.name}`);
696
+ t.$$.smartPtrType === this ? r = t.$$.smartPtr : C(`Cannot convert argument of type ${t.$$.smartPtrType ? t.$$.smartPtrType.name : t.$$.ptrType.name} to parameter type ${this.name}`);
931
697
  break;
932
698
  case 1:
933
- r = e.$$.smartPtr;
699
+ r = t.$$.smartPtr;
934
700
  break;
935
701
  case 2:
936
- if (e.$$.smartPtrType === this)
937
- r = e.$$.smartPtr;
702
+ if (t.$$.smartPtrType === this)
703
+ r = t.$$.smartPtr;
938
704
  else {
939
- var a = e.clone();
940
- r = this.rawShare(r, J.toHandle(() => a.delete())), t !== null && t.push(this.rawDestructor, r);
705
+ var a = t.clone();
706
+ r = this.rawShare(r, Z.toHandle(() => a.delete())), e !== null && e.push(this.rawDestructor, r);
941
707
  }
942
708
  break;
943
709
  default:
@@ -945,737 +711,712 @@ var Rt = (() => {
945
711
  }
946
712
  return r;
947
713
  }
948
- function Qr(t, e) {
949
- if (e === null)
714
+ function rn(e, t) {
715
+ if (t === null)
950
716
  return this.isReference && C(`null is not a valid ${this.name}`), 0;
951
- e.$$ || C(`Cannot pass "${Zt(e)}" as a ${this.name}`), e.$$.ptr || C(`Cannot pass deleted object as a pointer of type ${this.name}`), e.$$.ptrType.isConst && C(`Cannot convert argument of type ${e.$$.ptrType.name} to parameter type ${this.name}`);
952
- var r = e.$$.ptrType.registeredClass, n = Nt(e.$$.ptr, r, this.registeredClass);
717
+ t.$$ || C(`Cannot pass "${re(t)}" as a ${this.name}`), t.$$.ptr || C(`Cannot pass deleted object as a pointer of type ${this.name}`), t.$$.ptrType.isConst && C(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);
718
+ var r = t.$$.ptrType.registeredClass, n = Qt(t.$$.ptr, r, this.registeredClass);
953
719
  return n;
954
720
  }
955
- function be(t) {
956
- return this.fromWireType(T[t >> 2]);
957
- }
958
- var Zr = () => {
959
- Object.assign(Dt.prototype, {
960
- getPointee(t) {
961
- return this.rawGetPointee && (t = this.rawGetPointee(t)), t;
962
- },
963
- destructor(t) {
964
- var e;
965
- (e = this.rawDestructor) === null || e === void 0 || e.call(this, t);
721
+ var nn = () => {
722
+ Object.assign(Mt.prototype, {
723
+ getPointee(e) {
724
+ return this.rawGetPointee && (e = this.rawGetPointee(e)), e;
966
725
  },
967
- argPackAdvance: q,
968
- readValueFromPointer: be,
969
- deleteObject(t) {
970
- t !== null && t.delete();
726
+ destructor(e) {
727
+ var t;
728
+ (t = this.rawDestructor) === null || t === void 0 || t.call(this, e);
971
729
  },
972
- fromWireType: Vr
730
+ argPackAdvance: G,
731
+ readValueFromPointer: mt,
732
+ fromWireType: Xr
973
733
  });
974
734
  };
975
- function Dt(t, e, r, n, a, i, u, c, l, f, p) {
976
- this.name = t, this.registeredClass = e, this.isReference = r, this.isConst = n, this.isSmartPointer = a, this.pointeeType = i, this.sharingPolicy = u, this.rawGetPointee = c, this.rawConstructor = l, this.rawShare = f, this.rawDestructor = p, !a && e.baseClass === void 0 ? n ? (this.toWireType = Xr, this.destructorFunction = null) : (this.toWireType = Qr, this.destructorFunction = null) : this.toWireType = qr;
735
+ function Mt(e, t, r, n, a, o, s, u, l, h, p) {
736
+ this.name = e, this.registeredClass = t, this.isReference = r, this.isConst = n, this.isSmartPointer = a, this.pointeeType = o, this.sharingPolicy = s, this.rawGetPointee = u, this.rawConstructor = l, this.rawShare = h, this.rawDestructor = p, !a && t.baseClass === void 0 ? n ? (this.toWireType = tn, this.destructorFunction = null) : (this.toWireType = rn, this.destructorFunction = null) : this.toWireType = en;
977
737
  }
978
- var Ce = (t, e, r) => {
979
- s.hasOwnProperty(t) || Et("Replacing nonexistant public symbol"), s[t].overloadTable !== void 0 && r !== void 0 ? s[t].overloadTable[r] = e : (s[t] = e, s[t].argCount = r);
980
- }, Jr = (t, e, r) => {
981
- var n = s["dynCall_" + t];
982
- return r && r.length ? n.apply(null, [e].concat(r)) : n.call(null, e);
983
- }, xt = [], _e, A = (t) => {
984
- var e = xt[t];
985
- return e || (t >= xt.length && (xt.length = t + 1), xt[t] = e = _e.get(t)), e;
986
- }, Kr = (t, e, r) => {
987
- if (t.includes("j"))
988
- return Jr(t, e, r);
989
- var n = A(e).apply(null, r);
738
+ var Ee = (e, t, r) => {
739
+ c.hasOwnProperty(e) || xt("Replacing nonexistant public symbol"), c[e].overloadTable !== void 0 && r !== void 0 ? c[e].overloadTable[r] = t : (c[e] = t, c[e].argCount = r);
740
+ }, an = (e, t, r) => {
741
+ var n = c["dynCall_" + e];
742
+ return n(t, ...r);
743
+ }, St = [], Ae, E = (e) => {
744
+ var t = St[e];
745
+ return t || (e >= St.length && (St.length = e + 1), St[e] = t = Ae.get(e)), t;
746
+ }, on = function(e, t) {
747
+ let r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
748
+ if (e.includes("j"))
749
+ return an(e, t, r);
750
+ var n = E(t)(...r);
990
751
  return n;
991
- }, tn = (t, e) => {
992
- var r = [];
993
- return function() {
994
- return r.length = 0, Object.assign(r, arguments), Kr(t, e, r);
995
- };
996
- }, N = (t, e) => {
997
- t = I(t);
752
+ }, sn = (e, t) => function() {
753
+ for (var r = arguments.length, n = new Array(r), a = 0; a < r; a++)
754
+ n[a] = arguments[a];
755
+ return on(e, t, n);
756
+ }, z = (e, t) => {
757
+ e = I(e);
998
758
  function r() {
999
- return t.includes("j") ? tn(t, e) : A(e);
759
+ return e.includes("j") ? sn(e, t) : E(t);
1000
760
  }
1001
761
  var n = r();
1002
- return typeof n != "function" && C(`unknown function pointer with signature ${t}: ${e}`), n;
1003
- }, en = (t, e) => {
1004
- var r = gt(e, function(n) {
1005
- this.name = e, this.message = n;
762
+ return typeof n != "function" && C(`unknown function pointer with signature ${e}: ${t}`), n;
763
+ }, un = (e, t) => {
764
+ var r = $t(t, function(n) {
765
+ this.name = t, this.message = n;
1006
766
  var a = new Error(n).stack;
1007
767
  a !== void 0 && (this.stack = this.toString() + `
1008
768
  ` + a.replace(/^Error(:[^\n]*)?\n/, ""));
1009
769
  });
1010
- return r.prototype = Object.create(t.prototype), r.prototype.constructor = r, r.prototype.toString = function() {
770
+ return r.prototype = Object.create(e.prototype), r.prototype.constructor = r, r.prototype.toString = function() {
1011
771
  return this.message === void 0 ? this.name : `${this.name}: ${this.message}`;
1012
772
  }, r;
1013
- }, Te, Pe = (t) => {
1014
- var e = Ie(t), r = I(e);
1015
- return K(e), r;
1016
- }, Ft = (t, e) => {
773
+ }, De, xe = (e) => {
774
+ var t = Be(e), r = I(t);
775
+ return J(t), r;
776
+ }, jt = (e, t) => {
1017
777
  var r = [], n = {};
1018
- function a(i) {
1019
- if (!n[i] && !rt[i]) {
1020
- if (Pt[i]) {
1021
- Pt[i].forEach(a);
778
+ function a(o) {
779
+ if (!n[o] && !rt[o]) {
780
+ if (Dt[o]) {
781
+ Dt[o].forEach(a);
1022
782
  return;
1023
783
  }
1024
- r.push(i), n[i] = !0;
784
+ r.push(o), n[o] = !0;
1025
785
  }
1026
786
  }
1027
- throw e.forEach(a), new Te(`${t}: ` + r.map(Pe).join([", "]));
1028
- }, rn = (t, e, r, n, a, i, u, c, l, f, p, v, y) => {
1029
- p = I(p), i = N(a, i), c && (c = N(u, c)), f && (f = N(l, f)), y = N(v, y);
1030
- var w = Nr(p);
1031
- zt(w, function() {
1032
- Ft(`Cannot construct ${p} due to unbound types`, [n]);
1033
- }), nt([t, e, r], n ? [n] : [], function(E) {
1034
- E = E[0];
1035
- var x, _;
1036
- n ? (x = E.registeredClass, _ = x.instancePrototype) : _ = Ot.prototype;
1037
- var R = gt(p, function() {
787
+ throw t.forEach(a), new De(`${e}: ` + r.map(xe).join([", "]));
788
+ }, cn = (e, t, r, n, a, o, s, u, l, h, p, g, y) => {
789
+ p = I(p), o = z(a, o), u && (u = z(s, u)), h && (h = z(l, h)), y = z(g, y);
790
+ var b = Jr(p);
791
+ qt(b, function() {
792
+ jt(`Cannot construct ${p} due to unbound types`, [n]);
793
+ }), nt([e, t, r], n ? [n] : [], (O) => {
794
+ O = O[0];
795
+ var k, P;
796
+ n ? (k = O.registeredClass, P = k.instancePrototype) : P = Ft.prototype;
797
+ var j = $t(p, function() {
1038
798
  if (Object.getPrototypeOf(this) !== d)
1039
- throw new st("Use 'new' to construct " + p);
799
+ throw new ut("Use 'new' to construct " + p);
1040
800
  if (m.constructor_body === void 0)
1041
- throw new st(p + " has no accessible constructor");
1042
- var Le = m.constructor_body[arguments.length];
1043
- if (Le === void 0)
1044
- throw new st(`Tried to invoke ctor of ${p} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(m.constructor_body).toString()}) parameters instead!`);
1045
- return Le.apply(this, arguments);
1046
- }), d = Object.create(_, {
801
+ throw new ut(p + " has no accessible constructor");
802
+ for (var Xe = arguments.length, kt = new Array(Xe), Ht = 0; Ht < Xe; Ht++)
803
+ kt[Ht] = arguments[Ht];
804
+ var qe = m.constructor_body[kt.length];
805
+ if (qe === void 0)
806
+ throw new ut(`Tried to invoke ctor of ${p} with invalid number of parameters (${kt.length}) - expected (${Object.keys(m.constructor_body).toString()}) parameters instead!`);
807
+ return qe.apply(this, kt);
808
+ }), d = Object.create(P, {
1047
809
  constructor: {
1048
- value: R
810
+ value: j
1049
811
  }
1050
812
  });
1051
- R.prototype = d;
1052
- var m = new Gr(p, R, d, y, x, i, c, f);
813
+ j.prototype = d;
814
+ var m = new Kr(p, j, d, y, k, o, u, h);
1053
815
  if (m.baseClass) {
1054
- var F, j;
1055
- (j = (F = m.baseClass).__derivedClasses) !== null && j !== void 0 || (F.__derivedClasses = []), m.baseClass.__derivedClasses.push(m);
816
+ var F, S;
817
+ (S = (F = m.baseClass).__derivedClasses) !== null && S !== void 0 || (F.__derivedClasses = []), m.baseClass.__derivedClasses.push(m);
1056
818
  }
1057
- var ut = new Dt(p, m, !0, !1, !1), jt = new Dt(p + "*", m, !1, !1, !1), Ve = new Dt(p + " const*", m, !1, !0, !1);
1058
- return we[t] = {
1059
- pointerType: jt,
1060
- constPointerType: Ve
1061
- }, Ce(w, R), [ut, jt, Ve];
819
+ var ct = new Mt(p, m, !0, !1, !1), Rt = new Mt(p + "*", m, !1, !1, !1), Ge = new Mt(p + " const*", m, !1, !0, !1);
820
+ return Te[e] = {
821
+ pointerType: Rt,
822
+ constPointerType: Ge
823
+ }, Ee(b, j), [ct, Rt, Ge];
1062
824
  });
1063
- }, Gt = (t, e) => {
1064
- for (var r = [], n = 0; n < t; n++)
1065
- r.push(T[e + n * 4 >> 2]);
825
+ }, Zt = (e, t) => {
826
+ for (var r = [], n = 0; n < e; n++)
827
+ r.push(_[t + n * 4 >> 2]);
1066
828
  return r;
1067
829
  };
1068
- function nn(t) {
1069
- for (var e = 1; e < t.length; ++e)
1070
- if (t[e] !== null && t[e].destructorFunction === void 0)
830
+ function ln(e) {
831
+ for (var t = 1; t < e.length; ++t)
832
+ if (e[t] !== null && e[t].destructorFunction === void 0)
1071
833
  return !0;
1072
834
  return !1;
1073
835
  }
1074
- function Xt(t, e, r, n, a, i) {
1075
- var u = e.length;
1076
- u < 2 && C("argTypes array size mismatch! Must at least get return value and 'this' types!");
1077
- var c = e[1] !== null && r !== null, l = nn(e), f = e[0].name !== "void", p = u - 2, v = new Array(p), y = [], w = [], E = function() {
1078
- arguments.length !== p && C(`function ${t} called with ${arguments.length} arguments, expected ${p}`), w.length = 0;
1079
- var x;
1080
- y.length = c ? 2 : 1, y[0] = a, c && (x = e[1].toWireType(w, this), y[1] = x);
1081
- for (var _ = 0; _ < p; ++_)
1082
- v[_] = e[_ + 2].toWireType(w, arguments[_]), y.push(v[_]);
1083
- var R = n.apply(null, y);
836
+ function Jt(e, t, r, n, a, o) {
837
+ var s = t.length;
838
+ s < 2 && C("argTypes array size mismatch! Must at least get return value and 'this' types!");
839
+ var u = t[1] !== null && r !== null, l = ln(t), h = t[0].name !== "void", p = s - 2, g = new Array(p), y = [], b = [], O = function() {
840
+ arguments.length !== p && C(`function ${e} called with ${arguments.length} arguments, expected ${p}`), b.length = 0;
841
+ var k;
842
+ y.length = u ? 2 : 1, y[0] = a, u && (k = t[1].toWireType(b, this), y[1] = k);
843
+ for (var P = 0; P < p; ++P)
844
+ g[P] = t[P + 2].toWireType(b, P < 0 || arguments.length <= P ? void 0 : arguments[P]), y.push(g[P]);
845
+ var j = n(...y);
1084
846
  function d(m) {
1085
847
  if (l)
1086
- Bt(w);
848
+ zt(b);
1087
849
  else
1088
- for (var F = c ? 1 : 2; F < e.length; F++) {
1089
- var j = F === 1 ? x : v[F - 2];
1090
- e[F].destructorFunction !== null && e[F].destructorFunction(j);
850
+ for (var F = u ? 1 : 2; F < t.length; F++) {
851
+ var S = F === 1 ? k : g[F - 2];
852
+ t[F].destructorFunction !== null && t[F].destructorFunction(S);
1091
853
  }
1092
- if (f)
1093
- return e[0].fromWireType(m);
854
+ if (h)
855
+ return t[0].fromWireType(m);
1094
856
  }
1095
- return d(R);
857
+ return d(j);
1096
858
  };
1097
- return gt(t, E);
859
+ return $t(e, O);
1098
860
  }
1099
- var an = (t, e, r, n, a, i) => {
1100
- var u = Gt(e, r);
1101
- a = N(n, a), nt([], [t], function(c) {
1102
- c = c[0];
1103
- var l = `constructor ${c.name}`;
1104
- if (c.registeredClass.constructor_body === void 0 && (c.registeredClass.constructor_body = []), c.registeredClass.constructor_body[e - 1] !== void 0)
1105
- throw new st(`Cannot register multiple constructors with identical number of parameters (${e - 1}) for class '${c.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);
1106
- return c.registeredClass.constructor_body[e - 1] = () => {
1107
- Ft(`Cannot construct ${c.name} due to unbound types`, u);
1108
- }, nt([], u, (f) => (f.splice(1, 0, null), c.registeredClass.constructor_body[e - 1] = Xt(l, f, null, a, i), [])), [];
861
+ var dn = (e, t, r, n, a, o) => {
862
+ var s = Zt(t, r);
863
+ a = z(n, a), nt([], [e], (u) => {
864
+ u = u[0];
865
+ var l = `constructor ${u.name}`;
866
+ if (u.registeredClass.constructor_body === void 0 && (u.registeredClass.constructor_body = []), u.registeredClass.constructor_body[t - 1] !== void 0)
867
+ throw new ut(`Cannot register multiple constructors with identical number of parameters (${t - 1}) for class '${u.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);
868
+ return u.registeredClass.constructor_body[t - 1] = () => {
869
+ jt(`Cannot construct ${u.name} due to unbound types`, s);
870
+ }, nt([], s, (h) => (h.splice(1, 0, null), u.registeredClass.constructor_body[t - 1] = Jt(l, h, null, a, o), [])), [];
1109
871
  });
1110
- }, Ee = (t) => {
1111
- t = t.trim();
1112
- const e = t.indexOf("(");
1113
- return e !== -1 ? t.substr(0, e) : t;
1114
- }, on = (t, e, r, n, a, i, u, c, l) => {
1115
- var f = Gt(r, n);
1116
- e = I(e), e = Ee(e), i = N(a, i), nt([], [t], function(p) {
872
+ }, Oe = (e) => {
873
+ e = e.trim();
874
+ const t = e.indexOf("(");
875
+ return t !== -1 ? e.substr(0, t) : e;
876
+ }, hn = (e, t, r, n, a, o, s, u, l) => {
877
+ var h = Zt(r, n);
878
+ t = I(t), t = Oe(t), o = z(a, o), nt([], [e], (p) => {
1117
879
  p = p[0];
1118
- var v = `${p.name}.${e}`;
1119
- e.startsWith("@@") && (e = Symbol[e.substring(2)]), c && p.registeredClass.pureVirtualFunctions.push(e);
880
+ var g = `${p.name}.${t}`;
881
+ t.startsWith("@@") && (t = Symbol[t.substring(2)]), u && p.registeredClass.pureVirtualFunctions.push(t);
1120
882
  function y() {
1121
- Ft(`Cannot call ${v} due to unbound types`, f);
883
+ jt(`Cannot call ${g} due to unbound types`, h);
1122
884
  }
1123
- var w = p.registeredClass.instancePrototype, E = w[e];
1124
- return E === void 0 || E.overloadTable === void 0 && E.className !== p.name && E.argCount === r - 2 ? (y.argCount = r - 2, y.className = p.name, w[e] = y) : ($e(w, e, v), w[e].overloadTable[r - 2] = y), nt([], f, function(x) {
1125
- var _ = Xt(v, x, p, i, u);
1126
- return w[e].overloadTable === void 0 ? (_.argCount = r - 2, w[e] = _) : w[e].overloadTable[r - 2] = _, [];
885
+ var b = p.registeredClass.instancePrototype, O = b[t];
886
+ return O === void 0 || O.overloadTable === void 0 && O.className !== p.name && O.argCount === r - 2 ? (y.argCount = r - 2, y.className = p.name, b[t] = y) : (Pe(b, t, g), b[t].overloadTable[r - 2] = y), nt([], h, (k) => {
887
+ var P = Jt(g, k, p, o, s);
888
+ return b[t].overloadTable === void 0 ? (P.argCount = r - 2, b[t] = P) : b[t].overloadTable[r - 2] = P, [];
1127
889
  }), [];
1128
890
  });
1129
- };
1130
- function sn() {
1131
- Object.assign(Ae.prototype, {
1132
- get(t) {
1133
- return this.allocated[t];
1134
- },
1135
- has(t) {
1136
- return this.allocated[t] !== void 0;
1137
- },
1138
- allocate(t) {
1139
- var e = this.freelist.pop() || this.allocated.length;
1140
- return this.allocated[e] = t, e;
1141
- },
1142
- free(t) {
1143
- this.allocated[t] = void 0, this.freelist.push(t);
1144
- }
1145
- });
1146
- }
1147
- function Ae() {
1148
- this.allocated = [void 0], this.freelist = [];
1149
- }
1150
- var z = new Ae(), qt = (t) => {
1151
- t >= z.reserved && --z.get(t).refcount === 0 && z.free(t);
1152
- }, un = () => {
1153
- for (var t = 0, e = z.reserved; e < z.allocated.length; ++e)
1154
- z.allocated[e] !== void 0 && ++t;
1155
- return t;
1156
- }, cn = () => {
1157
- z.allocated.push({
1158
- value: void 0
1159
- }, {
1160
- value: null
1161
- }, {
1162
- value: !0
1163
- }, {
1164
- value: !1
1165
- }), z.reserved = z.allocated.length, s.count_emval_handles = un;
1166
- }, J = {
1167
- toValue: (t) => (t || C("Cannot use deleted val. handle = " + t), z.get(t).value),
1168
- toHandle: (t) => {
1169
- switch (t) {
891
+ }, Kt = [], Q = [], te = (e) => {
892
+ e > 9 && --Q[e + 1] === 0 && (Q[e] = void 0, Kt.push(e));
893
+ }, fn = () => Q.length / 2 - 5 - Kt.length, pn = () => {
894
+ Q.push(0, 1, void 0, 1, null, 1, !0, 1, !1, 1), c.count_emval_handles = fn;
895
+ }, Z = {
896
+ toValue: (e) => (e || C("Cannot use deleted val. handle = " + e), Q[e]),
897
+ toHandle: (e) => {
898
+ switch (e) {
1170
899
  case void 0:
1171
- return 1;
1172
- case null:
1173
900
  return 2;
901
+ case null:
902
+ return 4;
1174
903
  case !0:
1175
- return 3;
904
+ return 6;
1176
905
  case !1:
1177
- return 4;
1178
- default:
1179
- return z.allocate({
1180
- refcount: 1,
1181
- value: t
1182
- });
906
+ return 8;
907
+ default: {
908
+ const t = Kt.pop() || Q.length;
909
+ return Q[t] = e, Q[t + 1] = 1, t;
910
+ }
1183
911
  }
1184
912
  }
1185
- }, ln = (t, e) => {
1186
- e = I(e), X(t, {
1187
- name: e,
1188
- fromWireType: (r) => {
1189
- var n = J.toValue(r);
1190
- return qt(r), n;
1191
- },
1192
- toWireType: (r, n) => J.toHandle(n),
1193
- argPackAdvance: q,
1194
- readValueFromPointer: Ut,
1195
- destructorFunction: null
1196
- });
1197
- }, dn = (t, e, r) => {
1198
- switch (e) {
913
+ }, mn = {
914
+ name: "emscripten::val",
915
+ fromWireType: (e) => {
916
+ var t = Z.toValue(e);
917
+ return te(e), t;
918
+ },
919
+ toWireType: (e, t) => Z.toHandle(t),
920
+ argPackAdvance: G,
921
+ readValueFromPointer: mt,
922
+ destructorFunction: null
923
+ }, Fe = (e) => N(e, mn), yn = (e, t, r) => {
924
+ switch (t) {
1199
925
  case 1:
1200
926
  return r ? function(n) {
1201
- return this.fromWireType(V[n >> 0]);
927
+ return this.fromWireType(Y[n]);
1202
928
  } : function(n) {
1203
- return this.fromWireType(W[n >> 0]);
929
+ return this.fromWireType(W[n]);
1204
930
  };
1205
931
  case 2:
1206
932
  return r ? function(n) {
1207
- return this.fromWireType(at[n >> 1]);
933
+ return this.fromWireType(ot[n >> 1]);
1208
934
  } : function(n) {
1209
935
  return this.fromWireType(ft[n >> 1]);
1210
936
  };
1211
937
  case 4:
1212
938
  return r ? function(n) {
1213
- return this.fromWireType(k[n >> 2]);
939
+ return this.fromWireType(R[n >> 2]);
1214
940
  } : function(n) {
1215
- return this.fromWireType(T[n >> 2]);
941
+ return this.fromWireType(_[n >> 2]);
1216
942
  };
1217
943
  default:
1218
- throw new TypeError(`invalid integer width (${e}): ${t}`);
944
+ throw new TypeError(`invalid integer width (${t}): ${e}`);
1219
945
  }
1220
- }, fn = (t, e, r, n) => {
1221
- e = I(e);
946
+ }, vn = (e, t, r, n) => {
947
+ t = I(t);
1222
948
  function a() {
1223
949
  }
1224
- a.values = {}, X(t, {
1225
- name: e,
950
+ a.values = {}, N(e, {
951
+ name: t,
1226
952
  constructor: a,
1227
- fromWireType: function(i) {
1228
- return this.constructor.values[i];
953
+ fromWireType: function(o) {
954
+ return this.constructor.values[o];
1229
955
  },
1230
- toWireType: (i, u) => u.value,
1231
- argPackAdvance: q,
1232
- readValueFromPointer: dn(e, r, n),
956
+ toWireType: (o, s) => s.value,
957
+ argPackAdvance: G,
958
+ readValueFromPointer: yn(t, r, n),
1233
959
  destructorFunction: null
1234
- }), zt(e, a);
1235
- }, Qt = (t, e) => {
1236
- var r = rt[t];
1237
- return r === void 0 && C(e + " has unknown type " + Pe(t)), r;
1238
- }, hn = (t, e, r) => {
1239
- var n = Qt(t, "enum");
1240
- e = I(e);
1241
- var a = n.constructor, i = Object.create(n.constructor.prototype, {
960
+ }), qt(t, a);
961
+ }, ee = (e, t) => {
962
+ var r = rt[e];
963
+ return r === void 0 && C(`${t} has unknown type ${xe(e)}`), r;
964
+ }, gn = (e, t, r) => {
965
+ var n = ee(e, "enum");
966
+ t = I(t);
967
+ var a = n.constructor, o = Object.create(n.constructor.prototype, {
1242
968
  value: {
1243
969
  value: r
1244
970
  },
1245
971
  constructor: {
1246
- value: gt(`${n.name}_${e}`, function() {
972
+ value: $t(`${n.name}_${t}`, function() {
1247
973
  })
1248
974
  }
1249
975
  });
1250
- a.values[r] = i, a[e] = i;
1251
- }, Zt = (t) => {
1252
- if (t === null)
976
+ a.values[r] = o, a[t] = o;
977
+ }, re = (e) => {
978
+ if (e === null)
1253
979
  return "null";
1254
- var e = typeof t;
1255
- return e === "object" || e === "array" || e === "function" ? t.toString() : "" + t;
1256
- }, pn = (t, e) => {
1257
- switch (e) {
980
+ var t = typeof e;
981
+ return t === "object" || t === "array" || t === "function" ? e.toString() : "" + e;
982
+ }, wn = (e, t) => {
983
+ switch (t) {
1258
984
  case 4:
1259
985
  return function(r) {
1260
- return this.fromWireType(oe[r >> 2]);
986
+ return this.fromWireType(le[r >> 2]);
1261
987
  };
1262
988
  case 8:
1263
989
  return function(r) {
1264
- return this.fromWireType(ie[r >> 3]);
990
+ return this.fromWireType(de[r >> 3]);
1265
991
  };
1266
992
  default:
1267
- throw new TypeError(`invalid float width (${e}): ${t}`);
993
+ throw new TypeError(`invalid float width (${t}): ${e}`);
1268
994
  }
1269
- }, mn = (t, e, r) => {
1270
- e = I(e), X(t, {
1271
- name: e,
995
+ }, $n = (e, t, r) => {
996
+ t = I(t), N(e, {
997
+ name: t,
1272
998
  fromWireType: (n) => n,
1273
999
  toWireType: (n, a) => a,
1274
- argPackAdvance: q,
1275
- readValueFromPointer: pn(e, r),
1000
+ argPackAdvance: G,
1001
+ readValueFromPointer: wn(t, r),
1276
1002
  destructorFunction: null
1277
1003
  });
1278
- }, vn = (t, e, r, n, a, i, u) => {
1279
- var c = Gt(e, r);
1280
- t = I(t), t = Ee(t), a = N(n, a), zt(t, function() {
1281
- Ft(`Cannot call ${t} due to unbound types`, c);
1282
- }, e - 1), nt([], c, function(l) {
1283
- var f = [l[0], null].concat(l.slice(1));
1284
- return Ce(t, Xt(t, f, null, a, i), e - 1), [];
1004
+ }, bn = (e, t, r, n, a, o, s) => {
1005
+ var u = Zt(t, r);
1006
+ e = I(e), e = Oe(e), a = z(n, a), qt(e, function() {
1007
+ jt(`Cannot call ${e} due to unbound types`, u);
1008
+ }, t - 1), nt([], u, (l) => {
1009
+ var h = [l[0], null].concat(l.slice(1));
1010
+ return Ee(e, Jt(e, h, null, a, o), t - 1), [];
1285
1011
  });
1286
- }, yn = (t, e, r) => {
1287
- switch (e) {
1012
+ }, Cn = (e, t, r) => {
1013
+ switch (t) {
1288
1014
  case 1:
1289
- return r ? (n) => V[n >> 0] : (n) => W[n >> 0];
1015
+ return r ? (n) => Y[n] : (n) => W[n];
1290
1016
  case 2:
1291
- return r ? (n) => at[n >> 1] : (n) => ft[n >> 1];
1017
+ return r ? (n) => ot[n >> 1] : (n) => ft[n >> 1];
1292
1018
  case 4:
1293
- return r ? (n) => k[n >> 2] : (n) => T[n >> 2];
1019
+ return r ? (n) => R[n >> 2] : (n) => _[n >> 2];
1294
1020
  default:
1295
- throw new TypeError(`invalid integer width (${e}): ${t}`);
1021
+ throw new TypeError(`invalid integer width (${t}): ${e}`);
1296
1022
  }
1297
- }, gn = (t, e, r, n, a) => {
1298
- e = I(e);
1299
- var i = (p) => p;
1023
+ }, _n = (e, t, r, n, a) => {
1024
+ t = I(t);
1025
+ var o = (p) => p;
1300
1026
  if (n === 0) {
1301
- var u = 32 - 8 * r;
1302
- i = (p) => p << u >>> u;
1303
- }
1304
- var c = e.includes("unsigned"), l = (p, v) => {
1305
- }, f;
1306
- c ? f = function(p, v) {
1307
- return l(v, this.name), v >>> 0;
1308
- } : f = function(p, v) {
1309
- return l(v, this.name), v;
1310
- }, X(t, {
1311
- name: e,
1312
- fromWireType: i,
1313
- toWireType: f,
1314
- argPackAdvance: q,
1315
- readValueFromPointer: yn(e, r, n !== 0),
1027
+ var s = 32 - 8 * r;
1028
+ o = (p) => p << s >>> s;
1029
+ }
1030
+ var u = t.includes("unsigned"), l = (p, g) => {
1031
+ }, h;
1032
+ u ? h = function(p, g) {
1033
+ return l(g, this.name), g >>> 0;
1034
+ } : h = function(p, g) {
1035
+ return l(g, this.name), g;
1036
+ }, N(e, {
1037
+ name: t,
1038
+ fromWireType: o,
1039
+ toWireType: h,
1040
+ argPackAdvance: G,
1041
+ readValueFromPointer: Cn(t, r, n !== 0),
1316
1042
  destructorFunction: null
1317
1043
  });
1318
- }, wn = (t, e, r) => {
1319
- var n = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array], a = n[e];
1320
- function i(u) {
1321
- var c = T[u >> 2], l = T[u + 4 >> 2];
1322
- return new a(V.buffer, l, c);
1044
+ }, Tn = (e, t, r) => {
1045
+ var n = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array], a = n[t];
1046
+ function o(s) {
1047
+ var u = _[s >> 2], l = _[s + 4 >> 2];
1048
+ return new a(Y.buffer, l, u);
1323
1049
  }
1324
- r = I(r), X(t, {
1050
+ r = I(r), N(e, {
1325
1051
  name: r,
1326
- fromWireType: i,
1327
- argPackAdvance: q,
1328
- readValueFromPointer: i
1052
+ fromWireType: o,
1053
+ argPackAdvance: G,
1054
+ readValueFromPointer: o
1329
1055
  }, {
1330
1056
  ignoreDuplicateRegistrations: !0
1331
1057
  });
1332
- }, Oe = (t, e, r, n) => {
1058
+ }, Pn = (e, t) => {
1059
+ Fe(e);
1060
+ }, Me = (e, t, r, n) => {
1333
1061
  if (!(n > 0))
1334
1062
  return 0;
1335
- for (var a = r, i = r + n - 1, u = 0; u < t.length; ++u) {
1336
- var c = t.charCodeAt(u);
1337
- if (c >= 55296 && c <= 57343) {
1338
- var l = t.charCodeAt(++u);
1339
- c = 65536 + ((c & 1023) << 10) | l & 1023;
1063
+ for (var a = r, o = r + n - 1, s = 0; s < e.length; ++s) {
1064
+ var u = e.charCodeAt(s);
1065
+ if (u >= 55296 && u <= 57343) {
1066
+ var l = e.charCodeAt(++s);
1067
+ u = 65536 + ((u & 1023) << 10) | l & 1023;
1340
1068
  }
1341
- if (c <= 127) {
1342
- if (r >= i)
1069
+ if (u <= 127) {
1070
+ if (r >= o)
1343
1071
  break;
1344
- e[r++] = c;
1345
- } else if (c <= 2047) {
1346
- if (r + 1 >= i)
1072
+ t[r++] = u;
1073
+ } else if (u <= 2047) {
1074
+ if (r + 1 >= o)
1347
1075
  break;
1348
- e[r++] = 192 | c >> 6, e[r++] = 128 | c & 63;
1349
- } else if (c <= 65535) {
1350
- if (r + 2 >= i)
1076
+ t[r++] = 192 | u >> 6, t[r++] = 128 | u & 63;
1077
+ } else if (u <= 65535) {
1078
+ if (r + 2 >= o)
1351
1079
  break;
1352
- e[r++] = 224 | c >> 12, e[r++] = 128 | c >> 6 & 63, e[r++] = 128 | c & 63;
1080
+ t[r++] = 224 | u >> 12, t[r++] = 128 | u >> 6 & 63, t[r++] = 128 | u & 63;
1353
1081
  } else {
1354
- if (r + 3 >= i)
1082
+ if (r + 3 >= o)
1355
1083
  break;
1356
- e[r++] = 240 | c >> 18, e[r++] = 128 | c >> 12 & 63, e[r++] = 128 | c >> 6 & 63, e[r++] = 128 | c & 63;
1084
+ t[r++] = 240 | u >> 18, t[r++] = 128 | u >> 12 & 63, t[r++] = 128 | u >> 6 & 63, t[r++] = 128 | u & 63;
1357
1085
  }
1358
1086
  }
1359
- return e[r] = 0, r - a;
1360
- }, $n = (t, e, r) => Oe(t, W, e, r), De = (t) => {
1361
- for (var e = 0, r = 0; r < t.length; ++r) {
1362
- var n = t.charCodeAt(r);
1363
- n <= 127 ? e++ : n <= 2047 ? e += 2 : n >= 55296 && n <= 57343 ? (e += 4, ++r) : e += 3;
1087
+ return t[r] = 0, r - a;
1088
+ }, En = (e, t, r) => Me(e, W, t, r), Se = (e) => {
1089
+ for (var t = 0, r = 0; r < e.length; ++r) {
1090
+ var n = e.charCodeAt(r);
1091
+ n <= 127 ? t++ : n <= 2047 ? t += 2 : n >= 55296 && n <= 57343 ? (t += 4, ++r) : t += 3;
1364
1092
  }
1365
- return e;
1366
- }, xe = typeof TextDecoder < "u" ? new TextDecoder("utf8") : void 0, bn = (t, e, r) => {
1367
- for (var n = e + r, a = e; t[a] && !(a >= n); )
1093
+ return t;
1094
+ }, je = typeof TextDecoder < "u" ? new TextDecoder("utf8") : void 0, Ie = (e, t, r) => {
1095
+ for (var n = t + r, a = t; e[a] && !(a >= n); )
1368
1096
  ++a;
1369
- if (a - e > 16 && t.buffer && xe)
1370
- return xe.decode(t.subarray(e, a));
1371
- for (var i = ""; e < a; ) {
1372
- var u = t[e++];
1373
- if (!(u & 128)) {
1374
- i += String.fromCharCode(u);
1097
+ if (a - t > 16 && e.buffer && je)
1098
+ return je.decode(e.subarray(t, a));
1099
+ for (var o = ""; t < a; ) {
1100
+ var s = e[t++];
1101
+ if (!(s & 128)) {
1102
+ o += String.fromCharCode(s);
1375
1103
  continue;
1376
1104
  }
1377
- var c = t[e++] & 63;
1378
- if ((u & 224) == 192) {
1379
- i += String.fromCharCode((u & 31) << 6 | c);
1105
+ var u = e[t++] & 63;
1106
+ if ((s & 224) == 192) {
1107
+ o += String.fromCharCode((s & 31) << 6 | u);
1380
1108
  continue;
1381
1109
  }
1382
- var l = t[e++] & 63;
1383
- if ((u & 240) == 224 ? u = (u & 15) << 12 | c << 6 | l : u = (u & 7) << 18 | c << 12 | l << 6 | t[e++] & 63, u < 65536)
1384
- i += String.fromCharCode(u);
1110
+ var l = e[t++] & 63;
1111
+ if ((s & 240) == 224 ? s = (s & 15) << 12 | u << 6 | l : s = (s & 7) << 18 | u << 12 | l << 6 | e[t++] & 63, s < 65536)
1112
+ o += String.fromCharCode(s);
1385
1113
  else {
1386
- var f = u - 65536;
1387
- i += String.fromCharCode(55296 | f >> 10, 56320 | f & 1023);
1114
+ var h = s - 65536;
1115
+ o += String.fromCharCode(55296 | h >> 10, 56320 | h & 1023);
1388
1116
  }
1389
1117
  }
1390
- return i;
1391
- }, Jt = (t, e) => t ? bn(W, t, e) : "", Cn = (t, e) => {
1392
- e = I(e);
1393
- var r = e === "std::string";
1394
- X(t, {
1395
- name: e,
1118
+ return o;
1119
+ }, ne = (e, t) => e ? Ie(W, e, t) : "", An = (e, t) => {
1120
+ t = I(t);
1121
+ var r = t === "std::string";
1122
+ N(e, {
1123
+ name: t,
1396
1124
  fromWireType(n) {
1397
- var a = T[n >> 2], i = n + 4, u;
1125
+ var a = _[n >> 2], o = n + 4, s;
1398
1126
  if (r)
1399
- for (var c = i, l = 0; l <= a; ++l) {
1400
- var f = i + l;
1401
- if (l == a || W[f] == 0) {
1402
- var p = f - c, v = Jt(c, p);
1403
- u === void 0 ? u = v : (u += "\0", u += v), c = f + 1;
1127
+ for (var u = o, l = 0; l <= a; ++l) {
1128
+ var h = o + l;
1129
+ if (l == a || W[h] == 0) {
1130
+ var p = h - u, g = ne(u, p);
1131
+ s === void 0 ? s = g : (s += "\0", s += g), u = h + 1;
1404
1132
  }
1405
1133
  }
1406
1134
  else {
1407
1135
  for (var y = new Array(a), l = 0; l < a; ++l)
1408
- y[l] = String.fromCharCode(W[i + l]);
1409
- u = y.join("");
1136
+ y[l] = String.fromCharCode(W[o + l]);
1137
+ s = y.join("");
1410
1138
  }
1411
- return K(n), u;
1139
+ return J(n), s;
1412
1140
  },
1413
1141
  toWireType(n, a) {
1414
1142
  a instanceof ArrayBuffer && (a = new Uint8Array(a));
1415
- var i, u = typeof a == "string";
1416
- u || a instanceof Uint8Array || a instanceof Uint8ClampedArray || a instanceof Int8Array || C("Cannot pass non-string to std::string"), r && u ? i = De(a) : i = a.length;
1417
- var c = ee(4 + i + 1), l = c + 4;
1418
- if (T[c >> 2] = i, r && u)
1419
- $n(a, l, i + 1);
1420
- else if (u)
1421
- for (var f = 0; f < i; ++f) {
1422
- var p = a.charCodeAt(f);
1423
- p > 255 && (K(l), C("String has UTF-16 code units that do not fit in 8 bits")), W[l + f] = p;
1143
+ var o, s = typeof a == "string";
1144
+ s || a instanceof Uint8Array || a instanceof Uint8ClampedArray || a instanceof Int8Array || C("Cannot pass non-string to std::string"), r && s ? o = Se(a) : o = a.length;
1145
+ var u = ie(4 + o + 1), l = u + 4;
1146
+ if (_[u >> 2] = o, r && s)
1147
+ En(a, l, o + 1);
1148
+ else if (s)
1149
+ for (var h = 0; h < o; ++h) {
1150
+ var p = a.charCodeAt(h);
1151
+ p > 255 && (J(l), C("String has UTF-16 code units that do not fit in 8 bits")), W[l + h] = p;
1424
1152
  }
1425
1153
  else
1426
- for (var f = 0; f < i; ++f)
1427
- W[l + f] = a[f];
1428
- return n !== null && n.push(K, c), c;
1154
+ for (var h = 0; h < o; ++h)
1155
+ W[l + h] = a[h];
1156
+ return n !== null && n.push(J, u), u;
1429
1157
  },
1430
- argPackAdvance: q,
1431
- readValueFromPointer: be,
1158
+ argPackAdvance: G,
1159
+ readValueFromPointer: mt,
1432
1160
  destructorFunction(n) {
1433
- K(n);
1161
+ J(n);
1434
1162
  }
1435
1163
  });
1436
- }, Fe = typeof TextDecoder < "u" ? new TextDecoder("utf-16le") : void 0, _n = (t, e) => {
1437
- for (var r = t, n = r >> 1, a = n + e / 2; !(n >= a) && ft[n]; )
1164
+ }, We = typeof TextDecoder < "u" ? new TextDecoder("utf-16le") : void 0, Dn = (e, t) => {
1165
+ for (var r = e, n = r >> 1, a = n + t / 2; !(n >= a) && ft[n]; )
1438
1166
  ++n;
1439
- if (r = n << 1, r - t > 32 && Fe)
1440
- return Fe.decode(W.subarray(t, r));
1441
- for (var i = "", u = 0; !(u >= e / 2); ++u) {
1442
- var c = at[t + u * 2 >> 1];
1443
- if (c == 0)
1167
+ if (r = n << 1, r - e > 32 && We)
1168
+ return We.decode(W.subarray(e, r));
1169
+ for (var o = "", s = 0; !(s >= t / 2); ++s) {
1170
+ var u = ot[e + s * 2 >> 1];
1171
+ if (u == 0)
1444
1172
  break;
1445
- i += String.fromCharCode(c);
1173
+ o += String.fromCharCode(u);
1446
1174
  }
1447
- return i;
1448
- }, Tn = (t, e, r) => {
1175
+ return o;
1176
+ }, xn = (e, t, r) => {
1449
1177
  var n;
1450
1178
  if ((n = r) !== null && n !== void 0 || (r = 2147483647), r < 2)
1451
1179
  return 0;
1452
1180
  r -= 2;
1453
- for (var a = e, i = r < t.length * 2 ? r / 2 : t.length, u = 0; u < i; ++u) {
1454
- var c = t.charCodeAt(u);
1455
- at[e >> 1] = c, e += 2;
1456
- }
1457
- return at[e >> 1] = 0, e - a;
1458
- }, Pn = (t) => t.length * 2, En = (t, e) => {
1459
- for (var r = 0, n = ""; !(r >= e / 4); ) {
1460
- var a = k[t + r * 4 >> 2];
1181
+ for (var a = t, o = r < e.length * 2 ? r / 2 : e.length, s = 0; s < o; ++s) {
1182
+ var u = e.charCodeAt(s);
1183
+ ot[t >> 1] = u, t += 2;
1184
+ }
1185
+ return ot[t >> 1] = 0, t - a;
1186
+ }, On = (e) => e.length * 2, Fn = (e, t) => {
1187
+ for (var r = 0, n = ""; !(r >= t / 4); ) {
1188
+ var a = R[e + r * 4 >> 2];
1461
1189
  if (a == 0)
1462
1190
  break;
1463
1191
  if (++r, a >= 65536) {
1464
- var i = a - 65536;
1465
- n += String.fromCharCode(55296 | i >> 10, 56320 | i & 1023);
1192
+ var o = a - 65536;
1193
+ n += String.fromCharCode(55296 | o >> 10, 56320 | o & 1023);
1466
1194
  } else
1467
1195
  n += String.fromCharCode(a);
1468
1196
  }
1469
1197
  return n;
1470
- }, An = (t, e, r) => {
1198
+ }, Mn = (e, t, r) => {
1471
1199
  var n;
1472
1200
  if ((n = r) !== null && n !== void 0 || (r = 2147483647), r < 4)
1473
1201
  return 0;
1474
- for (var a = e, i = a + r - 4, u = 0; u < t.length; ++u) {
1475
- var c = t.charCodeAt(u);
1476
- if (c >= 55296 && c <= 57343) {
1477
- var l = t.charCodeAt(++u);
1478
- c = 65536 + ((c & 1023) << 10) | l & 1023;
1202
+ for (var a = t, o = a + r - 4, s = 0; s < e.length; ++s) {
1203
+ var u = e.charCodeAt(s);
1204
+ if (u >= 55296 && u <= 57343) {
1205
+ var l = e.charCodeAt(++s);
1206
+ u = 65536 + ((u & 1023) << 10) | l & 1023;
1479
1207
  }
1480
- if (k[e >> 2] = c, e += 4, e + 4 > i)
1208
+ if (R[t >> 2] = u, t += 4, t + 4 > o)
1481
1209
  break;
1482
1210
  }
1483
- return k[e >> 2] = 0, e - a;
1484
- }, On = (t) => {
1485
- for (var e = 0, r = 0; r < t.length; ++r) {
1486
- var n = t.charCodeAt(r);
1487
- n >= 55296 && n <= 57343 && ++r, e += 4;
1211
+ return R[t >> 2] = 0, t - a;
1212
+ }, Sn = (e) => {
1213
+ for (var t = 0, r = 0; r < e.length; ++r) {
1214
+ var n = e.charCodeAt(r);
1215
+ n >= 55296 && n <= 57343 && ++r, t += 4;
1488
1216
  }
1489
- return e;
1490
- }, Dn = (t, e, r) => {
1217
+ return t;
1218
+ }, jn = (e, t, r) => {
1491
1219
  r = I(r);
1492
- var n, a, i, u, c;
1493
- e === 2 ? (n = _n, a = Tn, u = Pn, i = () => ft, c = 1) : e === 4 && (n = En, a = An, u = On, i = () => T, c = 2), X(t, {
1220
+ var n, a, o, s;
1221
+ t === 2 ? (n = Dn, a = xn, s = On, o = (u) => ft[u >> 1]) : t === 4 && (n = Fn, a = Mn, s = Sn, o = (u) => _[u >> 2]), N(e, {
1494
1222
  name: r,
1495
- fromWireType: (l) => {
1496
- for (var f = T[l >> 2], p = i(), v, y = l + 4, w = 0; w <= f; ++w) {
1497
- var E = l + 4 + w * e;
1498
- if (w == f || p[E >> c] == 0) {
1499
- var x = E - y, _ = n(y, x);
1500
- v === void 0 ? v = _ : (v += "\0", v += _), y = E + e;
1223
+ fromWireType: (u) => {
1224
+ for (var l = _[u >> 2], h, p = u + 4, g = 0; g <= l; ++g) {
1225
+ var y = u + 4 + g * t;
1226
+ if (g == l || o(y) == 0) {
1227
+ var b = y - p, O = n(p, b);
1228
+ h === void 0 ? h = O : (h += "\0", h += O), p = y + t;
1501
1229
  }
1502
1230
  }
1503
- return K(l), v;
1231
+ return J(u), h;
1504
1232
  },
1505
- toWireType: (l, f) => {
1506
- typeof f != "string" && C(`Cannot pass non-string to C++ string type ${r}`);
1507
- var p = u(f), v = ee(4 + p + e);
1508
- return T[v >> 2] = p >> c, a(f, v + 4, p + e), l !== null && l.push(K, v), v;
1233
+ toWireType: (u, l) => {
1234
+ typeof l != "string" && C(`Cannot pass non-string to C++ string type ${r}`);
1235
+ var h = s(l), p = ie(4 + h + t);
1236
+ return _[p >> 2] = h / t, a(l, p + 4, h + t), u !== null && u.push(J, p), p;
1509
1237
  },
1510
- argPackAdvance: q,
1511
- readValueFromPointer: Ut,
1512
- destructorFunction(l) {
1513
- K(l);
1238
+ argPackAdvance: G,
1239
+ readValueFromPointer: mt,
1240
+ destructorFunction(u) {
1241
+ J(u);
1514
1242
  }
1515
1243
  });
1516
- }, xn = (t, e, r, n, a, i) => {
1517
- Tt[t] = {
1518
- name: I(e),
1519
- rawConstructor: N(r, n),
1520
- rawDestructor: N(a, i),
1244
+ }, In = (e, t, r, n, a, o) => {
1245
+ At[e] = {
1246
+ name: I(t),
1247
+ rawConstructor: z(r, n),
1248
+ rawDestructor: z(a, o),
1521
1249
  fields: []
1522
1250
  };
1523
- }, Fn = (t, e, r, n, a, i, u, c, l, f) => {
1524
- Tt[t].fields.push({
1525
- fieldName: I(e),
1251
+ }, Wn = (e, t, r, n, a, o, s, u, l, h) => {
1252
+ At[e].fields.push({
1253
+ fieldName: I(t),
1526
1254
  getterReturnType: r,
1527
- getter: N(n, a),
1528
- getterContext: i,
1529
- setterArgumentType: u,
1530
- setter: N(c, l),
1531
- setterContext: f
1255
+ getter: z(n, a),
1256
+ getterContext: o,
1257
+ setterArgumentType: s,
1258
+ setter: z(u, l),
1259
+ setterContext: h
1532
1260
  });
1533
- }, Mn = (t, e) => {
1534
- e = I(e), X(t, {
1261
+ }, Rn = (e, t) => {
1262
+ t = I(t), N(e, {
1535
1263
  isVoid: !0,
1536
- name: e,
1264
+ name: t,
1537
1265
  argPackAdvance: 0,
1538
1266
  fromWireType: () => {
1539
1267
  },
1540
1268
  toWireType: (r, n) => {
1541
1269
  }
1542
1270
  });
1543
- }, Kt = [], Sn = (t, e, r, n) => (t = Kt[t], e = J.toValue(e), t(null, e, r, n)), jn = {}, In = (t) => {
1544
- var e = jn[t];
1545
- return e === void 0 ? I(t) : e;
1546
- }, Me = () => {
1271
+ }, ae = [], kn = (e, t, r, n) => (e = ae[e], t = Z.toValue(t), e(null, t, r, n)), Hn = {}, Bn = (e) => {
1272
+ var t = Hn[e];
1273
+ return t === void 0 ? I(e) : t;
1274
+ }, Re = () => {
1547
1275
  if (typeof globalThis == "object")
1548
1276
  return globalThis;
1549
- function t(e) {
1550
- e.$$$embind_global$$$ = e;
1551
- var r = typeof $$$embind_global$$$ == "object" && e.$$$embind_global$$$ == e;
1552
- return r || delete e.$$$embind_global$$$, r;
1277
+ function e(t) {
1278
+ t.$$$embind_global$$$ = t;
1279
+ var r = typeof $$$embind_global$$$ == "object" && t.$$$embind_global$$$ == t;
1280
+ return r || delete t.$$$embind_global$$$, r;
1553
1281
  }
1554
- if (typeof $$$embind_global$$$ == "object" || (typeof global == "object" && t(global) ? $$$embind_global$$$ = global : typeof self == "object" && t(self) && ($$$embind_global$$$ = self), typeof $$$embind_global$$$ == "object"))
1282
+ if (typeof $$$embind_global$$$ == "object" || (typeof global == "object" && e(global) ? $$$embind_global$$$ = global : typeof self == "object" && e(self) && ($$$embind_global$$$ = self), typeof $$$embind_global$$$ == "object"))
1555
1283
  return $$$embind_global$$$;
1556
1284
  throw Error("unable to get global object.");
1557
- }, Rn = (t) => t === 0 ? J.toHandle(Me()) : (t = In(t), J.toHandle(Me()[t])), Wn = (t) => {
1558
- var e = Kt.length;
1559
- return Kt.push(t), e;
1560
- }, kn = (t, e) => {
1561
- for (var r = new Array(t), n = 0; n < t; ++n)
1562
- r[n] = Qt(T[e + n * 4 >> 2], "parameter " + n);
1285
+ }, Un = (e) => e === 0 ? Z.toHandle(Re()) : (e = Bn(e), Z.toHandle(Re()[e])), Vn = (e) => {
1286
+ var t = ae.length;
1287
+ return ae.push(e), t;
1288
+ }, Ln = (e, t) => {
1289
+ for (var r = new Array(e), n = 0; n < e; ++n)
1290
+ r[n] = ee(_[t + n * 4 >> 2], "parameter " + n);
1563
1291
  return r;
1564
- }, Hn = Reflect.construct, Bn = (t, e, r) => {
1565
- var n = [], a = t.toWireType(n, r);
1566
- return n.length && (T[e >> 2] = J.toHandle(n)), a;
1567
- }, Un = (t, e, r) => {
1568
- var n = kn(t, e), a = n.shift();
1569
- t--;
1570
- var i = new Array(t), u = (l, f, p, v) => {
1571
- for (var y = 0, w = 0; w < t; ++w)
1572
- i[w] = n[w].readValueFromPointer(v + y), y += n[w].argPackAdvance;
1573
- for (var E = r === 1 ? Hn(f, i) : f.apply(l, i), w = 0; w < t; ++w) {
1574
- var x, _;
1575
- (x = (_ = n[w]).deleteObject) === null || x === void 0 || x.call(_, i[w]);
1576
- }
1577
- return Bn(a, p, E);
1578
- }, c = `methodCaller<(${n.map((l) => l.name).join(", ")}) => ${a.name}>`;
1579
- return Wn(gt(c, u));
1580
- }, Vn = (t) => {
1581
- t > 4 && (z.get(t).refcount += 1);
1582
- }, Ln = (t) => {
1583
- var e = J.toValue(t);
1584
- Bt(e), qt(t);
1585
- }, Yn = (t, e) => {
1586
- t = Qt(t, "_emval_take_value");
1587
- var r = t.readValueFromPointer(e);
1588
- return J.toHandle(r);
1589
- }, zn = () => {
1590
- bt("");
1591
- }, Nn = (t, e, r) => W.copyWithin(t, e, e + r), Gn = () => 2147483648, Xn = (t) => {
1592
- var e = tt.buffer, r = (t - e.byteLength + 65535) / 65536;
1292
+ }, Yn = Reflect.construct, zn = (e, t, r) => {
1293
+ var n = [], a = e.toWireType(n, r);
1294
+ return n.length && (_[t >> 2] = Z.toHandle(n)), a;
1295
+ }, Nn = (e, t, r) => {
1296
+ var n = Ln(e, t), a = n.shift();
1297
+ e--;
1298
+ var o = new Array(e), s = (l, h, p, g) => {
1299
+ for (var y = 0, b = 0; b < e; ++b)
1300
+ o[b] = n[b].readValueFromPointer(g + y), y += n[b].argPackAdvance;
1301
+ var O = r === 1 ? Yn(h, o) : h.apply(l, o);
1302
+ return zn(a, p, O);
1303
+ }, u = `methodCaller<(${n.map((l) => l.name).join(", ")}) => ${a.name}>`;
1304
+ return Vn($t(u, s));
1305
+ }, Gn = (e) => {
1306
+ e > 9 && (Q[e + 1] += 1);
1307
+ }, Xn = (e) => {
1308
+ var t = Z.toValue(e);
1309
+ zt(t), te(e);
1310
+ }, qn = (e, t) => {
1311
+ e = ee(e, "_emval_take_value");
1312
+ var r = e.readValueFromPointer(t);
1313
+ return Z.toHandle(r);
1314
+ }, Qn = () => {
1315
+ Tt("");
1316
+ }, Zn = (e, t, r) => W.copyWithin(e, t, t + r), Jn = () => 2147483648, Kn = (e) => {
1317
+ var t = at.buffer, r = (e - t.byteLength + 65535) / 65536;
1593
1318
  try {
1594
- return tt.grow(r), se(), 1;
1319
+ return at.grow(r), he(), 1;
1595
1320
  } catch {
1596
1321
  }
1597
- }, qn = (t) => {
1598
- var e = W.length;
1599
- t >>>= 0;
1600
- var r = Gn();
1601
- if (t > r)
1322
+ }, ta = (e) => {
1323
+ var t = W.length;
1324
+ e >>>= 0;
1325
+ var r = Jn();
1326
+ if (e > r)
1602
1327
  return !1;
1603
- for (var n = (l, f) => l + (f - l % f) % f, a = 1; a <= 4; a *= 2) {
1604
- var i = e * (1 + 0.2 / a);
1605
- i = Math.min(i, t + 100663296);
1606
- var u = Math.min(r, n(Math.max(t, i), 65536)), c = Xn(u);
1607
- if (c)
1328
+ for (var n = (l, h) => l + (h - l % h) % h, a = 1; a <= 4; a *= 2) {
1329
+ var o = t * (1 + 0.2 / a);
1330
+ o = Math.min(o, e + 100663296);
1331
+ var s = Math.min(r, n(Math.max(e, o), 65536)), u = Kn(s);
1332
+ if (u)
1608
1333
  return !0;
1609
1334
  }
1610
1335
  return !1;
1611
- }, te = {}, Qn = () => H || "./this.program", wt = () => {
1612
- if (!wt.strings) {
1613
- var t = (typeof navigator == "object" && navigator.languages && navigator.languages[0] || "C").replace("-", "_") + ".UTF-8", e = {
1336
+ }, oe = {}, ea = () => B || "./this.program", bt = () => {
1337
+ if (!bt.strings) {
1338
+ var e = (typeof navigator == "object" && navigator.languages && navigator.languages[0] || "C").replace("-", "_") + ".UTF-8", t = {
1614
1339
  USER: "web_user",
1615
1340
  LOGNAME: "web_user",
1616
1341
  PATH: "/",
1617
1342
  PWD: "/",
1618
1343
  HOME: "/home/web_user",
1619
- LANG: t,
1620
- _: Qn()
1344
+ LANG: e,
1345
+ _: ea()
1621
1346
  };
1622
- for (var r in te)
1623
- te[r] === void 0 ? delete e[r] : e[r] = te[r];
1347
+ for (var r in oe)
1348
+ oe[r] === void 0 ? delete t[r] : t[r] = oe[r];
1624
1349
  var n = [];
1625
- for (var r in e)
1626
- n.push(`${r}=${e[r]}`);
1627
- wt.strings = n;
1628
- }
1629
- return wt.strings;
1630
- }, Zn = (t, e) => {
1631
- for (var r = 0; r < t.length; ++r)
1632
- V[e++ >> 0] = t.charCodeAt(r);
1633
- V[e >> 0] = 0;
1634
- }, Jn = (t, e) => {
1350
+ for (var r in t)
1351
+ n.push(`${r}=${t[r]}`);
1352
+ bt.strings = n;
1353
+ }
1354
+ return bt.strings;
1355
+ }, ra = (e, t) => {
1356
+ for (var r = 0; r < e.length; ++r)
1357
+ Y[t++] = e.charCodeAt(r);
1358
+ Y[t] = 0;
1359
+ }, na = (e, t) => {
1635
1360
  var r = 0;
1636
- return wt().forEach((n, a) => {
1637
- var i = e + r;
1638
- T[t + a * 4 >> 2] = i, Zn(n, i), r += n.length + 1;
1361
+ return bt().forEach((n, a) => {
1362
+ var o = t + r;
1363
+ _[e + a * 4 >> 2] = o, ra(n, o), r += n.length + 1;
1639
1364
  }), 0;
1640
- }, Kn = (t, e) => {
1641
- var r = wt();
1642
- T[t >> 2] = r.length;
1365
+ }, aa = (e, t) => {
1366
+ var r = bt();
1367
+ _[e >> 2] = r.length;
1643
1368
  var n = 0;
1644
- return r.forEach((a) => n += a.length + 1), T[e >> 2] = n, 0;
1645
- }, ta = (t) => t, Mt = (t) => t % 4 === 0 && (t % 100 !== 0 || t % 400 === 0), ea = (t, e) => {
1646
- for (var r = 0, n = 0; n <= e; r += t[n++])
1369
+ return r.forEach((a) => n += a.length + 1), _[t >> 2] = n, 0;
1370
+ }, oa = (e) => 52;
1371
+ function ia(e, t, r, n, a) {
1372
+ return 70;
1373
+ }
1374
+ var sa = [null, [], []], ua = (e, t) => {
1375
+ var r = sa[e];
1376
+ t === 0 || t === 10 ? ((e === 1 ? ht : X)(Ie(r, 0)), r.length = 0) : r.push(t);
1377
+ }, ca = (e, t, r, n) => {
1378
+ for (var a = 0, o = 0; o < r; o++) {
1379
+ var s = _[t >> 2], u = _[t + 4 >> 2];
1380
+ t += 8;
1381
+ for (var l = 0; l < u; l++)
1382
+ ua(e, W[s + l]);
1383
+ a += u;
1384
+ }
1385
+ return _[n >> 2] = a, 0;
1386
+ }, la = (e) => e, It = (e) => e % 4 === 0 && (e % 100 !== 0 || e % 400 === 0), da = (e, t) => {
1387
+ for (var r = 0, n = 0; n <= t; r += e[n++])
1647
1388
  ;
1648
1389
  return r;
1649
- }, Se = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], je = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], ra = (t, e) => {
1650
- for (var r = new Date(t.getTime()); e > 0; ) {
1651
- var n = Mt(r.getFullYear()), a = r.getMonth(), i = (n ? Se : je)[a];
1652
- if (e > i - r.getDate())
1653
- e -= i - r.getDate() + 1, r.setDate(1), a < 11 ? r.setMonth(a + 1) : (r.setMonth(0), r.setFullYear(r.getFullYear() + 1));
1390
+ }, ke = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], He = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], ha = (e, t) => {
1391
+ for (var r = new Date(e.getTime()); t > 0; ) {
1392
+ var n = It(r.getFullYear()), a = r.getMonth(), o = (n ? ke : He)[a];
1393
+ if (t > o - r.getDate())
1394
+ t -= o - r.getDate() + 1, r.setDate(1), a < 11 ? r.setMonth(a + 1) : (r.setMonth(0), r.setFullYear(r.getFullYear() + 1));
1654
1395
  else
1655
- return r.setDate(r.getDate() + e), r;
1396
+ return r.setDate(r.getDate() + t), r;
1656
1397
  }
1657
1398
  return r;
1658
1399
  };
1659
- function na(t, e, r) {
1660
- var n = r > 0 ? r : De(t) + 1, a = new Array(n), i = Oe(t, a, 0, a.length);
1661
- return e && (a.length = i), a;
1400
+ function fa(e, t, r) {
1401
+ var n = r > 0 ? r : Se(e) + 1, a = new Array(n), o = Me(e, a, 0, a.length);
1402
+ return t && (a.length = o), a;
1662
1403
  }
1663
- var aa = (t, e) => {
1664
- V.set(t, e);
1665
- }, oa = (t, e, r, n) => {
1666
- var a = T[n + 40 >> 2], i = {
1667
- tm_sec: k[n >> 2],
1668
- tm_min: k[n + 4 >> 2],
1669
- tm_hour: k[n + 8 >> 2],
1670
- tm_mday: k[n + 12 >> 2],
1671
- tm_mon: k[n + 16 >> 2],
1672
- tm_year: k[n + 20 >> 2],
1673
- tm_wday: k[n + 24 >> 2],
1674
- tm_yday: k[n + 28 >> 2],
1675
- tm_isdst: k[n + 32 >> 2],
1676
- tm_gmtoff: k[n + 36 >> 2],
1677
- tm_zone: a ? Jt(a) : ""
1678
- }, u = Jt(r), c = {
1404
+ var pa = (e, t) => {
1405
+ Y.set(e, t);
1406
+ }, ma = (e, t, r, n) => {
1407
+ var a = _[n + 40 >> 2], o = {
1408
+ tm_sec: R[n >> 2],
1409
+ tm_min: R[n + 4 >> 2],
1410
+ tm_hour: R[n + 8 >> 2],
1411
+ tm_mday: R[n + 12 >> 2],
1412
+ tm_mon: R[n + 16 >> 2],
1413
+ tm_year: R[n + 20 >> 2],
1414
+ tm_wday: R[n + 24 >> 2],
1415
+ tm_yday: R[n + 28 >> 2],
1416
+ tm_isdst: R[n + 32 >> 2],
1417
+ tm_gmtoff: R[n + 36 >> 2],
1418
+ tm_zone: a ? ne(a) : ""
1419
+ }, s = ne(r), u = {
1679
1420
  "%c": "%a %b %d %H:%M:%S %Y",
1680
1421
  "%D": "%m/%d/%y",
1681
1422
  "%F": "%Y-%m-%d",
@@ -1705,25 +1446,25 @@ var Rt = (() => {
1705
1446
  "%OW": "%W",
1706
1447
  "%Oy": "%y"
1707
1448
  };
1708
- for (var l in c)
1709
- u = u.replace(new RegExp(l, "g"), c[l]);
1710
- var f = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], p = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
1711
- function v(d, m, F) {
1712
- for (var j = typeof d == "number" ? d.toString() : d || ""; j.length < m; )
1713
- j = F[0] + j;
1714
- return j;
1449
+ for (var l in u)
1450
+ s = s.replace(new RegExp(l, "g"), u[l]);
1451
+ var h = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], p = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
1452
+ function g(d, m, F) {
1453
+ for (var S = typeof d == "number" ? d.toString() : d || ""; S.length < m; )
1454
+ S = F[0] + S;
1455
+ return S;
1715
1456
  }
1716
1457
  function y(d, m) {
1717
- return v(d, m, "0");
1458
+ return g(d, m, "0");
1718
1459
  }
1719
- function w(d, m) {
1720
- function F(ut) {
1721
- return ut < 0 ? -1 : ut > 0 ? 1 : 0;
1460
+ function b(d, m) {
1461
+ function F(ct) {
1462
+ return ct < 0 ? -1 : ct > 0 ? 1 : 0;
1722
1463
  }
1723
- var j;
1724
- return (j = F(d.getFullYear() - m.getFullYear())) === 0 && (j = F(d.getMonth() - m.getMonth())) === 0 && (j = F(d.getDate() - m.getDate())), j;
1464
+ var S;
1465
+ return (S = F(d.getFullYear() - m.getFullYear())) === 0 && (S = F(d.getMonth() - m.getMonth())) === 0 && (S = F(d.getDate() - m.getDate())), S;
1725
1466
  }
1726
- function E(d) {
1467
+ function O(d) {
1727
1468
  switch (d.getDay()) {
1728
1469
  case 0:
1729
1470
  return new Date(d.getFullYear() - 1, 11, 29);
@@ -1741,13 +1482,13 @@ var Rt = (() => {
1741
1482
  return new Date(d.getFullYear() - 1, 11, 30);
1742
1483
  }
1743
1484
  }
1744
- function x(d) {
1745
- var m = ra(new Date(d.tm_year + 1900, 0, 1), d.tm_yday), F = new Date(m.getFullYear(), 0, 4), j = new Date(m.getFullYear() + 1, 0, 4), ut = E(F), jt = E(j);
1746
- return w(ut, m) <= 0 ? w(jt, m) <= 0 ? m.getFullYear() + 1 : m.getFullYear() : m.getFullYear() - 1;
1485
+ function k(d) {
1486
+ var m = ha(new Date(d.tm_year + 1900, 0, 1), d.tm_yday), F = new Date(m.getFullYear(), 0, 4), S = new Date(m.getFullYear() + 1, 0, 4), ct = O(F), Rt = O(S);
1487
+ return b(ct, m) <= 0 ? b(Rt, m) <= 0 ? m.getFullYear() + 1 : m.getFullYear() : m.getFullYear() - 1;
1747
1488
  }
1748
- var _ = {
1749
- "%a": (d) => f[d.tm_wday].substring(0, 3),
1750
- "%A": (d) => f[d.tm_wday],
1489
+ var P = {
1490
+ "%a": (d) => h[d.tm_wday].substring(0, 3),
1491
+ "%A": (d) => h[d.tm_wday],
1751
1492
  "%b": (d) => p[d.tm_mon].substring(0, 3),
1752
1493
  "%B": (d) => p[d.tm_mon],
1753
1494
  "%C": (d) => {
@@ -1755,15 +1496,15 @@ var Rt = (() => {
1755
1496
  return y(m / 100 | 0, 2);
1756
1497
  },
1757
1498
  "%d": (d) => y(d.tm_mday, 2),
1758
- "%e": (d) => v(d.tm_mday, 2, " "),
1759
- "%g": (d) => x(d).toString().substring(2),
1760
- "%G": (d) => x(d),
1499
+ "%e": (d) => g(d.tm_mday, 2, " "),
1500
+ "%g": (d) => k(d).toString().substring(2),
1501
+ "%G": k,
1761
1502
  "%H": (d) => y(d.tm_hour, 2),
1762
1503
  "%I": (d) => {
1763
1504
  var m = d.tm_hour;
1764
1505
  return m == 0 ? m = 12 : m > 12 && (m -= 12), y(m, 2);
1765
1506
  },
1766
- "%j": (d) => y(d.tm_mday + ea(Mt(d.tm_year + 1900) ? Se : je, d.tm_mon - 1), 3),
1507
+ "%j": (d) => y(d.tm_mday + da(It(d.tm_year + 1900) ? ke : He, d.tm_mon - 1), 3),
1767
1508
  "%m": (d) => y(d.tm_mon + 1, 2),
1768
1509
  "%M": (d) => y(d.tm_min, 2),
1769
1510
  "%n": () => `
@@ -1781,12 +1522,12 @@ var Rt = (() => {
1781
1522
  if ((d.tm_wday + 371 - d.tm_yday - 2) % 7 <= 2 && m++, m) {
1782
1523
  if (m == 53) {
1783
1524
  var F = (d.tm_wday + 371 - d.tm_yday) % 7;
1784
- F != 4 && (F != 3 || !Mt(d.tm_year)) && (m = 1);
1525
+ F != 4 && (F != 3 || !It(d.tm_year)) && (m = 1);
1785
1526
  }
1786
1527
  } else {
1787
1528
  m = 52;
1788
- var j = (d.tm_wday + 7 - d.tm_yday - 1) % 7;
1789
- (j == 4 || j == 5 && Mt(d.tm_year % 400 - 1)) && m++;
1529
+ var S = (d.tm_wday + 7 - d.tm_yday - 1) % 7;
1530
+ (S == 4 || S == 5 && It(d.tm_year % 400 - 1)) && m++;
1790
1531
  }
1791
1532
  return y(m, 2);
1792
1533
  },
@@ -1804,449 +1545,703 @@ var Rt = (() => {
1804
1545
  "%Z": (d) => d.tm_zone,
1805
1546
  "%%": () => "%"
1806
1547
  };
1807
- u = u.replace(/%%/g, "\0\0");
1808
- for (var l in _)
1809
- u.includes(l) && (u = u.replace(new RegExp(l, "g"), _[l](i)));
1810
- u = u.replace(/\0\0/g, "%");
1811
- var R = na(u, !1);
1812
- return R.length > e ? 0 : (aa(R, t), R.length - 1);
1813
- }, ia = (t, e, r, n, a) => oa(t, e, r, n);
1814
- pe = s.InternalError = class extends Error {
1815
- constructor(t) {
1816
- super(t), this.name = "InternalError";
1817
- }
1818
- }, Fr(), st = s.BindingError = class extends Error {
1819
- constructor(t) {
1820
- super(t), this.name = "BindingError";
1821
- }
1822
- }, Lr(), Hr(), Zr(), Te = s.UnboundTypeError = en(Error, "UnboundTypeError"), sn(), cn();
1823
- var sa = {
1824
- s: $r,
1825
- u: br,
1826
- b: _r,
1827
- g: Tr,
1828
- q: Pr,
1829
- J: Er,
1830
- f: Ar,
1831
- V: Or,
1832
- d: Cr,
1833
- da: Dr,
1834
- Q: xr,
1835
- _: Sr,
1836
- ca: rn,
1837
- ba: an,
1838
- w: on,
1839
- Y: ln,
1840
- x: fn,
1841
- h: hn,
1842
- L: mn,
1843
- M: vn,
1844
- t: gn,
1845
- o: wn,
1846
- K: Cn,
1847
- C: Dn,
1848
- A: xn,
1849
- ea: Fn,
1850
- $: Mn,
1851
- R: Sn,
1852
- ha: qt,
1853
- fa: Rn,
1854
- Z: Un,
1855
- N: Vn,
1856
- O: Ln,
1857
- aa: Yn,
1858
- B: zn,
1859
- X: Nn,
1860
- W: qn,
1861
- T: Jn,
1862
- U: Kn,
1863
- E: _a,
1864
- D: fa,
1865
- F: Ca,
1866
- n: Ta,
1867
- a: ua,
1868
- e: pa,
1869
- m: da,
1870
- k: va,
1871
- H: $a,
1872
- v: ga,
1873
- G: ba,
1874
- z: Ea,
1875
- P: Oa,
1876
- l: ma,
1877
- j: ha,
1878
- c: la,
1879
- p: ca,
1880
- I: wa,
1881
- r: Pa,
1882
- i: ya,
1883
- y: Aa,
1884
- ga: ta,
1885
- S: ia
1886
- }, S = wr(), K = s._free = (t) => (K = s._free = S.ka)(t), ee = s._malloc = (t) => (ee = s._malloc = S.la)(t), Ie = (t) => (Ie = S.na)(t), P = (t, e) => (P = S.oa)(t, e), $t = (t) => ($t = S.pa)(t), O = () => (O = S.qa)(), D = (t) => (D = S.ra)(t), Re = (t) => (Re = S.sa)(t), We = (t) => (We = S.ta)(t), ke = (t, e, r) => (ke = S.ua)(t, e, r), He = (t) => (He = S.va)(t);
1887
- s.dynCall_viijii = (t, e, r, n, a, i, u) => (s.dynCall_viijii = S.wa)(t, e, r, n, a, i, u);
1888
- var Be = s.dynCall_jiiii = (t, e, r, n, a) => (Be = s.dynCall_jiiii = S.xa)(t, e, r, n, a);
1889
- s.dynCall_iiiiij = (t, e, r, n, a, i, u) => (s.dynCall_iiiiij = S.ya)(t, e, r, n, a, i, u), s.dynCall_iiiiijj = (t, e, r, n, a, i, u, c, l) => (s.dynCall_iiiiijj = S.za)(t, e, r, n, a, i, u, c, l), s.dynCall_iiiiiijj = (t, e, r, n, a, i, u, c, l, f) => (s.dynCall_iiiiiijj = S.Aa)(t, e, r, n, a, i, u, c, l, f);
1890
- function ua(t, e) {
1891
- var r = O();
1548
+ s = s.replace(/%%/g, "\0\0");
1549
+ for (var l in P)
1550
+ s.includes(l) && (s = s.replace(new RegExp(l, "g"), P[l](o)));
1551
+ s = s.replace(/\0\0/g, "%");
1552
+ var j = fa(s, !1);
1553
+ return j.length > t ? 0 : (pa(j, e), j.length - 1);
1554
+ }, ya = (e, t, r, n, a) => ma(e, t, r, n);
1555
+ we = c.InternalError = class extends Error {
1556
+ constructor(e) {
1557
+ super(e), this.name = "InternalError";
1558
+ }
1559
+ }, Rr(), ut = c.BindingError = class extends Error {
1560
+ constructor(e) {
1561
+ super(e), this.name = "BindingError";
1562
+ }
1563
+ }, qr(), zr(), nn(), De = c.UnboundTypeError = un(Error, "UnboundTypeError"), pn();
1564
+ var va = {
1565
+ s: Er,
1566
+ u: Ar,
1567
+ b: xr,
1568
+ g: Or,
1569
+ q: Fr,
1570
+ K: Mr,
1571
+ f: Sr,
1572
+ Y: jr,
1573
+ d: Dr,
1574
+ ha: Ir,
1575
+ U: Wr,
1576
+ ba: Hr,
1577
+ fa: cn,
1578
+ ea: dn,
1579
+ w: hn,
1580
+ aa: Fe,
1581
+ x: vn,
1582
+ h: gn,
1583
+ O: $n,
1584
+ P: bn,
1585
+ t: _n,
1586
+ o: Tn,
1587
+ ga: Pn,
1588
+ N: An,
1589
+ C: jn,
1590
+ A: In,
1591
+ ia: Wn,
1592
+ ca: Rn,
1593
+ E: kn,
1594
+ ka: te,
1595
+ la: Un,
1596
+ M: Nn,
1597
+ Q: Gn,
1598
+ R: Xn,
1599
+ da: qn,
1600
+ B: Qn,
1601
+ $: Zn,
1602
+ Z: ta,
1603
+ W: na,
1604
+ X: aa,
1605
+ _: oa,
1606
+ T: ia,
1607
+ L: ca,
1608
+ F: Sa,
1609
+ D: Ca,
1610
+ G: Ma,
1611
+ m: ja,
1612
+ a: ga,
1613
+ e: Ta,
1614
+ p: ba,
1615
+ k: Fa,
1616
+ I: xa,
1617
+ v: Aa,
1618
+ H: Oa,
1619
+ z: Wa,
1620
+ S: ka,
1621
+ l: Pa,
1622
+ j: _a,
1623
+ c: $a,
1624
+ n: wa,
1625
+ J: Da,
1626
+ r: Ia,
1627
+ i: Ea,
1628
+ y: Ra,
1629
+ ja: la,
1630
+ V: ya
1631
+ }, A = Pr(), J = c._free = (e) => (J = c._free = A.oa)(e), ie = c._malloc = (e) => (ie = c._malloc = A.pa)(e), Be = (e) => (Be = A.ra)(e), T = (e, t) => (T = A.sa)(e, t), Ct = (e) => (Ct = A.ta)(e), D = () => (D = A.ua)(), x = (e) => (x = A.va)(e), Ue = (e) => (Ue = A.wa)(e), Ve = (e) => (Ve = A.xa)(e), Le = (e, t, r) => (Le = A.ya)(e, t, r), Ye = (e) => (Ye = A.za)(e);
1632
+ c.dynCall_viijii = (e, t, r, n, a, o, s) => (c.dynCall_viijii = A.Aa)(e, t, r, n, a, o, s), c.dynCall_jiji = (e, t, r, n, a) => (c.dynCall_jiji = A.Ba)(e, t, r, n, a);
1633
+ var ze = c.dynCall_jiiii = (e, t, r, n, a) => (ze = c.dynCall_jiiii = A.Ca)(e, t, r, n, a);
1634
+ c.dynCall_iiiiij = (e, t, r, n, a, o, s) => (c.dynCall_iiiiij = A.Da)(e, t, r, n, a, o, s), c.dynCall_iiiiijj = (e, t, r, n, a, o, s, u, l) => (c.dynCall_iiiiijj = A.Ea)(e, t, r, n, a, o, s, u, l), c.dynCall_iiiiiijj = (e, t, r, n, a, o, s, u, l, h) => (c.dynCall_iiiiiijj = A.Fa)(e, t, r, n, a, o, s, u, l, h);
1635
+ function ga(e, t) {
1636
+ var r = D();
1892
1637
  try {
1893
- return A(t)(e);
1638
+ return E(e)(t);
1894
1639
  } catch (n) {
1895
- if (D(r), n !== n + 0)
1640
+ if (x(r), n !== n + 0)
1896
1641
  throw n;
1897
- P(1, 0);
1642
+ T(1, 0);
1898
1643
  }
1899
1644
  }
1900
- function ca(t, e, r, n) {
1901
- var a = O();
1645
+ function wa(e, t, r, n) {
1646
+ var a = D();
1902
1647
  try {
1903
- A(t)(e, r, n);
1904
- } catch (i) {
1905
- if (D(a), i !== i + 0)
1906
- throw i;
1907
- P(1, 0);
1648
+ E(e)(t, r, n);
1649
+ } catch (o) {
1650
+ if (x(a), o !== o + 0)
1651
+ throw o;
1652
+ T(1, 0);
1908
1653
  }
1909
1654
  }
1910
- function la(t, e, r) {
1911
- var n = O();
1655
+ function $a(e, t, r) {
1656
+ var n = D();
1912
1657
  try {
1913
- A(t)(e, r);
1658
+ E(e)(t, r);
1914
1659
  } catch (a) {
1915
- if (D(n), a !== a + 0)
1660
+ if (x(n), a !== a + 0)
1916
1661
  throw a;
1917
- P(1, 0);
1662
+ T(1, 0);
1918
1663
  }
1919
1664
  }
1920
- function da(t, e, r, n) {
1921
- var a = O();
1665
+ function ba(e, t, r, n) {
1666
+ var a = D();
1922
1667
  try {
1923
- return A(t)(e, r, n);
1924
- } catch (i) {
1925
- if (D(a), i !== i + 0)
1926
- throw i;
1927
- P(1, 0);
1668
+ return E(e)(t, r, n);
1669
+ } catch (o) {
1670
+ if (x(a), o !== o + 0)
1671
+ throw o;
1672
+ T(1, 0);
1928
1673
  }
1929
1674
  }
1930
- function fa(t, e, r, n, a) {
1931
- var i = O();
1675
+ function Ca(e, t, r, n, a) {
1676
+ var o = D();
1932
1677
  try {
1933
- return A(t)(e, r, n, a);
1934
- } catch (u) {
1935
- if (D(i), u !== u + 0)
1936
- throw u;
1937
- P(1, 0);
1678
+ return E(e)(t, r, n, a);
1679
+ } catch (s) {
1680
+ if (x(o), s !== s + 0)
1681
+ throw s;
1682
+ T(1, 0);
1938
1683
  }
1939
1684
  }
1940
- function ha(t, e) {
1941
- var r = O();
1685
+ function _a(e, t) {
1686
+ var r = D();
1942
1687
  try {
1943
- A(t)(e);
1688
+ E(e)(t);
1944
1689
  } catch (n) {
1945
- if (D(r), n !== n + 0)
1690
+ if (x(r), n !== n + 0)
1946
1691
  throw n;
1947
- P(1, 0);
1692
+ T(1, 0);
1948
1693
  }
1949
1694
  }
1950
- function pa(t, e, r) {
1951
- var n = O();
1695
+ function Ta(e, t, r) {
1696
+ var n = D();
1952
1697
  try {
1953
- return A(t)(e, r);
1698
+ return E(e)(t, r);
1954
1699
  } catch (a) {
1955
- if (D(n), a !== a + 0)
1700
+ if (x(n), a !== a + 0)
1956
1701
  throw a;
1957
- P(1, 0);
1702
+ T(1, 0);
1958
1703
  }
1959
1704
  }
1960
- function ma(t) {
1961
- var e = O();
1705
+ function Pa(e) {
1706
+ var t = D();
1962
1707
  try {
1963
- A(t)();
1708
+ E(e)();
1964
1709
  } catch (r) {
1965
- if (D(e), r !== r + 0)
1710
+ if (x(t), r !== r + 0)
1966
1711
  throw r;
1967
- P(1, 0);
1968
- }
1969
- }
1970
- function va(t, e, r, n, a) {
1971
- var i = O();
1972
- try {
1973
- return A(t)(e, r, n, a);
1974
- } catch (u) {
1975
- if (D(i), u !== u + 0)
1976
- throw u;
1977
- P(1, 0);
1712
+ T(1, 0);
1978
1713
  }
1979
1714
  }
1980
- function ya(t, e, r, n, a, i, u, c, l, f, p) {
1981
- var v = O();
1715
+ function Ea(e, t, r, n, a, o, s, u, l, h, p) {
1716
+ var g = D();
1982
1717
  try {
1983
- A(t)(e, r, n, a, i, u, c, l, f, p);
1718
+ E(e)(t, r, n, a, o, s, u, l, h, p);
1984
1719
  } catch (y) {
1985
- if (D(v), y !== y + 0)
1720
+ if (x(g), y !== y + 0)
1986
1721
  throw y;
1987
- P(1, 0);
1722
+ T(1, 0);
1988
1723
  }
1989
1724
  }
1990
- function ga(t, e, r, n, a, i, u) {
1991
- var c = O();
1725
+ function Aa(e, t, r, n, a, o, s) {
1726
+ var u = D();
1992
1727
  try {
1993
- return A(t)(e, r, n, a, i, u);
1728
+ return E(e)(t, r, n, a, o, s);
1994
1729
  } catch (l) {
1995
- if (D(c), l !== l + 0)
1730
+ if (x(u), l !== l + 0)
1996
1731
  throw l;
1997
- P(1, 0);
1732
+ T(1, 0);
1998
1733
  }
1999
1734
  }
2000
- function wa(t, e, r, n, a) {
2001
- var i = O();
1735
+ function Da(e, t, r, n, a) {
1736
+ var o = D();
2002
1737
  try {
2003
- A(t)(e, r, n, a);
1738
+ E(e)(t, r, n, a);
1739
+ } catch (s) {
1740
+ if (x(o), s !== s + 0)
1741
+ throw s;
1742
+ T(1, 0);
1743
+ }
1744
+ }
1745
+ function xa(e, t, r, n, a, o) {
1746
+ var s = D();
1747
+ try {
1748
+ return E(e)(t, r, n, a, o);
2004
1749
  } catch (u) {
2005
- if (D(i), u !== u + 0)
1750
+ if (x(s), u !== u + 0)
2006
1751
  throw u;
2007
- P(1, 0);
1752
+ T(1, 0);
2008
1753
  }
2009
1754
  }
2010
- function $a(t, e, r, n, a, i) {
2011
- var u = O();
1755
+ function Oa(e, t, r, n, a, o, s, u) {
1756
+ var l = D();
2012
1757
  try {
2013
- return A(t)(e, r, n, a, i);
2014
- } catch (c) {
2015
- if (D(u), c !== c + 0)
2016
- throw c;
2017
- P(1, 0);
1758
+ return E(e)(t, r, n, a, o, s, u);
1759
+ } catch (h) {
1760
+ if (x(l), h !== h + 0)
1761
+ throw h;
1762
+ T(1, 0);
2018
1763
  }
2019
1764
  }
2020
- function ba(t, e, r, n, a, i, u, c) {
2021
- var l = O();
1765
+ function Fa(e, t, r, n, a) {
1766
+ var o = D();
2022
1767
  try {
2023
- return A(t)(e, r, n, a, i, u, c);
2024
- } catch (f) {
2025
- if (D(l), f !== f + 0)
2026
- throw f;
2027
- P(1, 0);
1768
+ return E(e)(t, r, n, a);
1769
+ } catch (s) {
1770
+ if (x(o), s !== s + 0)
1771
+ throw s;
1772
+ T(1, 0);
2028
1773
  }
2029
1774
  }
2030
- function Ca(t, e, r, n) {
2031
- var a = O();
1775
+ function Ma(e, t, r, n) {
1776
+ var a = D();
2032
1777
  try {
2033
- return A(t)(e, r, n);
2034
- } catch (i) {
2035
- if (D(a), i !== i + 0)
2036
- throw i;
2037
- P(1, 0);
1778
+ return E(e)(t, r, n);
1779
+ } catch (o) {
1780
+ if (x(a), o !== o + 0)
1781
+ throw o;
1782
+ T(1, 0);
2038
1783
  }
2039
1784
  }
2040
- function _a(t, e, r, n) {
2041
- var a = O();
1785
+ function Sa(e, t, r, n) {
1786
+ var a = D();
2042
1787
  try {
2043
- return A(t)(e, r, n);
2044
- } catch (i) {
2045
- if (D(a), i !== i + 0)
2046
- throw i;
2047
- P(1, 0);
1788
+ return E(e)(t, r, n);
1789
+ } catch (o) {
1790
+ if (x(a), o !== o + 0)
1791
+ throw o;
1792
+ T(1, 0);
2048
1793
  }
2049
1794
  }
2050
- function Ta(t) {
2051
- var e = O();
1795
+ function ja(e) {
1796
+ var t = D();
2052
1797
  try {
2053
- return A(t)();
1798
+ return E(e)();
2054
1799
  } catch (r) {
2055
- if (D(e), r !== r + 0)
1800
+ if (x(t), r !== r + 0)
2056
1801
  throw r;
2057
- P(1, 0);
1802
+ T(1, 0);
2058
1803
  }
2059
1804
  }
2060
- function Pa(t, e, r, n, a, i, u, c) {
2061
- var l = O();
1805
+ function Ia(e, t, r, n, a, o, s, u) {
1806
+ var l = D();
2062
1807
  try {
2063
- A(t)(e, r, n, a, i, u, c);
2064
- } catch (f) {
2065
- if (D(l), f !== f + 0)
2066
- throw f;
2067
- P(1, 0);
1808
+ E(e)(t, r, n, a, o, s, u);
1809
+ } catch (h) {
1810
+ if (x(l), h !== h + 0)
1811
+ throw h;
1812
+ T(1, 0);
2068
1813
  }
2069
1814
  }
2070
- function Ea(t, e, r, n, a, i, u, c, l, f, p, v) {
2071
- var y = O();
1815
+ function Wa(e, t, r, n, a, o, s, u, l, h, p, g) {
1816
+ var y = D();
2072
1817
  try {
2073
- return A(t)(e, r, n, a, i, u, c, l, f, p, v);
2074
- } catch (w) {
2075
- if (D(y), w !== w + 0)
2076
- throw w;
2077
- P(1, 0);
1818
+ return E(e)(t, r, n, a, o, s, u, l, h, p, g);
1819
+ } catch (b) {
1820
+ if (x(y), b !== b + 0)
1821
+ throw b;
1822
+ T(1, 0);
2078
1823
  }
2079
1824
  }
2080
- function Aa(t, e, r, n, a, i, u, c, l, f, p, v, y, w, E, x) {
2081
- var _ = O();
1825
+ function Ra(e, t, r, n, a, o, s, u, l, h, p, g, y, b, O, k) {
1826
+ var P = D();
2082
1827
  try {
2083
- A(t)(e, r, n, a, i, u, c, l, f, p, v, y, w, E, x);
2084
- } catch (R) {
2085
- if (D(_), R !== R + 0)
2086
- throw R;
2087
- P(1, 0);
1828
+ E(e)(t, r, n, a, o, s, u, l, h, p, g, y, b, O, k);
1829
+ } catch (j) {
1830
+ if (x(P), j !== j + 0)
1831
+ throw j;
1832
+ T(1, 0);
2088
1833
  }
2089
1834
  }
2090
- function Oa(t, e, r, n, a) {
2091
- var i = O();
1835
+ function ka(e, t, r, n, a) {
1836
+ var o = D();
2092
1837
  try {
2093
- return Be(t, e, r, n, a);
2094
- } catch (u) {
2095
- if (D(i), u !== u + 0)
2096
- throw u;
2097
- P(1, 0);
1838
+ return ze(e, t, r, n, a);
1839
+ } catch (s) {
1840
+ if (x(o), s !== s + 0)
1841
+ throw s;
1842
+ T(1, 0);
2098
1843
  }
2099
1844
  }
2100
- var St;
2101
- ht = function t() {
2102
- St || Ue(), St || (ht = t);
1845
+ var Wt;
1846
+ pt = function e() {
1847
+ Wt || Ne(), Wt || (pt = e);
2103
1848
  };
2104
- function Ue() {
2105
- if (et > 0 || (ur(), et > 0))
1849
+ function Ne() {
1850
+ if (et > 0 || (pr(), et > 0))
2106
1851
  return;
2107
- function t() {
2108
- St || (St = !0, s.calledRun = !0, !dt && (cr(), $(s), s.onRuntimeInitialized && s.onRuntimeInitialized(), lr()));
1852
+ function e() {
1853
+ Wt || (Wt = !0, c.calledRun = !0, !_t && (mr(), w(c), c.onRuntimeInitialized && c.onRuntimeInitialized(), yr()));
2109
1854
  }
2110
- s.setStatus ? (s.setStatus("Running..."), setTimeout(function() {
1855
+ c.setStatus ? (c.setStatus("Running..."), setTimeout(function() {
2111
1856
  setTimeout(function() {
2112
- s.setStatus("");
2113
- }, 1), t();
2114
- }, 1)) : t();
1857
+ c.setStatus("");
1858
+ }, 1), e();
1859
+ }, 1)) : e();
2115
1860
  }
2116
- if (s.preInit)
2117
- for (typeof s.preInit == "function" && (s.preInit = [s.preInit]); s.preInit.length > 0; )
2118
- s.preInit.pop()();
2119
- return Ue(), h.ready;
1861
+ if (c.preInit)
1862
+ for (typeof c.preInit == "function" && (c.preInit = [c.preInit]); c.preInit.length > 0; )
1863
+ c.preInit.pop()();
1864
+ return Ne(), f.ready;
2120
1865
  };
2121
1866
  })();
2122
- function to(o) {
2123
- return ae(
2124
- Rt,
2125
- o
1867
+ function Za(i) {
1868
+ return ce(
1869
+ Ut,
1870
+ i
2126
1871
  );
2127
1872
  }
2128
- function ao(o) {
2129
- return Za(
2130
- Rt,
2131
- o
1873
+ function mo(i) {
1874
+ return Xa(
1875
+ Ut,
1876
+ i
2132
1877
  );
2133
1878
  }
2134
- async function eo(o, h) {
2135
- return Ja(
2136
- Rt,
2137
- o,
2138
- h
1879
+ async function Ja(i, f) {
1880
+ return qa(
1881
+ Ut,
1882
+ i,
1883
+ f
2139
1884
  );
2140
1885
  }
2141
- async function ro(o, h) {
2142
- return Ka(
2143
- Rt,
2144
- o,
2145
- h
1886
+ async function Ka(i, f) {
1887
+ return Qa(
1888
+ Ut,
1889
+ i,
1890
+ f
1891
+ );
1892
+ }
1893
+ const ar = [
1894
+ ["aztec", "Aztec"],
1895
+ ["code_128", "Code128"],
1896
+ ["code_39", "Code39"],
1897
+ ["code_93", "Code93"],
1898
+ ["codabar", "Codabar"],
1899
+ ["databar", "DataBar"],
1900
+ ["databar_expanded", "DataBarExpanded"],
1901
+ ["data_matrix", "DataMatrix"],
1902
+ ["dx_film_edge", "DXFilmEdge"],
1903
+ ["ean_13", "EAN-13"],
1904
+ ["ean_8", "EAN-8"],
1905
+ ["itf", "ITF"],
1906
+ ["maxi_code", "MaxiCode"],
1907
+ ["micro_qr_code", "MicroQRCode"],
1908
+ ["pdf417", "PDF417"],
1909
+ ["qr_code", "QRCode"],
1910
+ ["rm_qr_code", "rMQRCode"],
1911
+ ["upc_a", "UPC-A"],
1912
+ ["upc_e", "UPC-E"],
1913
+ ["linear_codes", "Linear-Codes"],
1914
+ ["matrix_codes", "Matrix-Codes"]
1915
+ ], to = [...ar, ["unknown"]].map((i) => i[0]), Bt = new Map(
1916
+ ar
1917
+ );
1918
+ function eo(i) {
1919
+ for (const [f, c] of Bt)
1920
+ if (i === c)
1921
+ return f;
1922
+ return "unknown";
1923
+ }
1924
+ function ro(i) {
1925
+ if (or(i))
1926
+ return {
1927
+ width: i.naturalWidth,
1928
+ height: i.naturalHeight
1929
+ };
1930
+ if (ir(i))
1931
+ return {
1932
+ width: i.width.baseVal.value,
1933
+ height: i.height.baseVal.value
1934
+ };
1935
+ if (sr(i))
1936
+ return {
1937
+ width: i.videoWidth,
1938
+ height: i.videoHeight
1939
+ };
1940
+ if (cr(i))
1941
+ return {
1942
+ width: i.width,
1943
+ height: i.height
1944
+ };
1945
+ if (dr(i))
1946
+ return {
1947
+ width: i.displayWidth,
1948
+ height: i.displayHeight
1949
+ };
1950
+ if (ur(i))
1951
+ return {
1952
+ width: i.width,
1953
+ height: i.height
1954
+ };
1955
+ if (lr(i))
1956
+ return {
1957
+ width: i.width,
1958
+ height: i.height
1959
+ };
1960
+ throw new TypeError(
1961
+ "The provided value is not of type '(Blob or HTMLCanvasElement or HTMLImageElement or HTMLVideoElement or ImageBitmap or ImageData or OffscreenCanvas or SVGImageElement or VideoFrame)'."
2146
1962
  );
2147
1963
  }
2148
- var ct;
2149
- class oo extends EventTarget {
2150
- constructor(s = {}) {
2151
- var $;
1964
+ function or(i) {
1965
+ try {
1966
+ return i instanceof HTMLImageElement;
1967
+ } catch {
1968
+ return !1;
1969
+ }
1970
+ }
1971
+ function ir(i) {
1972
+ try {
1973
+ return i instanceof SVGImageElement;
1974
+ } catch {
1975
+ return !1;
1976
+ }
1977
+ }
1978
+ function sr(i) {
1979
+ try {
1980
+ return i instanceof HTMLVideoElement;
1981
+ } catch {
1982
+ return !1;
1983
+ }
1984
+ }
1985
+ function ur(i) {
1986
+ try {
1987
+ return i instanceof HTMLCanvasElement;
1988
+ } catch {
1989
+ return !1;
1990
+ }
1991
+ }
1992
+ function cr(i) {
1993
+ try {
1994
+ return i instanceof ImageBitmap;
1995
+ } catch {
1996
+ return !1;
1997
+ }
1998
+ }
1999
+ function lr(i) {
2000
+ try {
2001
+ return i instanceof OffscreenCanvas;
2002
+ } catch {
2003
+ return !1;
2004
+ }
2005
+ }
2006
+ function dr(i) {
2007
+ try {
2008
+ return i instanceof VideoFrame;
2009
+ } catch {
2010
+ return !1;
2011
+ }
2012
+ }
2013
+ function hr(i) {
2014
+ try {
2015
+ return i instanceof Blob;
2016
+ } catch {
2017
+ return !1;
2018
+ }
2019
+ }
2020
+ function no(i) {
2021
+ try {
2022
+ return i instanceof ImageData;
2023
+ } catch {
2024
+ return !1;
2025
+ }
2026
+ }
2027
+ function ao(i, f) {
2028
+ try {
2029
+ const c = new OffscreenCanvas(i, f);
2030
+ if (c.getContext("2d") instanceof OffscreenCanvasRenderingContext2D)
2031
+ return c;
2032
+ throw void 0;
2033
+ } catch {
2034
+ const c = document.createElement("canvas");
2035
+ return c.width = i, c.height = f, c;
2036
+ }
2037
+ }
2038
+ async function fr(i) {
2039
+ if (or(i) && !await uo(i))
2040
+ throw new DOMException(
2041
+ "Failed to load or decode HTMLImageElement.",
2042
+ "InvalidStateError"
2043
+ );
2044
+ if (ir(i) && !await co(i))
2045
+ throw new DOMException(
2046
+ "Failed to load or decode SVGImageElement.",
2047
+ "InvalidStateError"
2048
+ );
2049
+ if (dr(i) && lo(i))
2050
+ throw new DOMException("VideoFrame is closed.", "InvalidStateError");
2051
+ if (sr(i) && (i.readyState === 0 || i.readyState === 1))
2052
+ throw new DOMException("Invalid element or state.", "InvalidStateError");
2053
+ if (cr(i) && fo(i))
2054
+ throw new DOMException(
2055
+ "The image source is detached.",
2056
+ "InvalidStateError"
2057
+ );
2058
+ const { width: f, height: c } = ro(i);
2059
+ if (f === 0 || c === 0)
2060
+ return null;
2061
+ const v = ao(f, c).getContext("2d");
2062
+ v.drawImage(i, 0, 0);
2063
+ try {
2064
+ return v.getImageData(0, 0, f, c);
2065
+ } catch {
2066
+ throw new DOMException("Source would taint origin.", "SecurityError");
2067
+ }
2068
+ }
2069
+ async function oo(i) {
2070
+ let f;
2071
+ try {
2072
+ if (globalThis.createImageBitmap)
2073
+ f = await createImageBitmap(i);
2074
+ else if (globalThis.Image) {
2075
+ f = new Image();
2076
+ let w = "";
2077
+ try {
2078
+ w = URL.createObjectURL(i), f.src = w, await f.decode();
2079
+ } finally {
2080
+ URL.revokeObjectURL(w);
2081
+ }
2082
+ } else
2083
+ return i;
2084
+ } catch {
2085
+ throw new DOMException(
2086
+ "Failed to load or decode Blob.",
2087
+ "InvalidStateError"
2088
+ );
2089
+ }
2090
+ return await fr(f);
2091
+ }
2092
+ function io(i) {
2093
+ const { width: f, height: c } = i;
2094
+ if (f === 0 || c === 0)
2095
+ return null;
2096
+ const w = i.getContext("2d");
2097
+ try {
2098
+ return w.getImageData(0, 0, f, c);
2099
+ } catch {
2100
+ throw new DOMException("Source would taint origin.", "SecurityError");
2101
+ }
2102
+ }
2103
+ async function so(i) {
2104
+ if (hr(i))
2105
+ return await oo(i);
2106
+ if (no(i)) {
2107
+ if (ho(i))
2108
+ throw new DOMException(
2109
+ "The image data has been detached.",
2110
+ "InvalidStateError"
2111
+ );
2112
+ return i;
2113
+ }
2114
+ return ur(i) || lr(i) ? io(i) : await fr(i);
2115
+ }
2116
+ async function uo(i) {
2117
+ try {
2118
+ return await i.decode(), !0;
2119
+ } catch {
2120
+ return !1;
2121
+ }
2122
+ }
2123
+ async function co(i) {
2124
+ var f;
2125
+ try {
2126
+ return await ((f = i.decode) == null ? void 0 : f.call(i)), !0;
2127
+ } catch {
2128
+ return !1;
2129
+ }
2130
+ }
2131
+ function lo(i) {
2132
+ return i.format === null;
2133
+ }
2134
+ function ho(i) {
2135
+ return i.data.buffer.byteLength === 0;
2136
+ }
2137
+ function fo(i) {
2138
+ return i.width === 0 && i.height === 0;
2139
+ }
2140
+ function er(i, f) {
2141
+ return i instanceof DOMException ? new DOMException(`${f}: ${i.message}`, i.name) : i instanceof Error ? new i.constructor(`${f}: ${i.message}`) : new Error(`${f}: ${i}`);
2142
+ }
2143
+ var lt;
2144
+ class yo extends EventTarget {
2145
+ constructor(c = {}) {
2146
+ var w;
2152
2147
  super();
2153
- ze(this, ct, void 0);
2148
+ Ze(this, lt, void 0);
2154
2149
  try {
2155
- const g = ($ = s == null ? void 0 : s.formats) == null ? void 0 : $.filter(
2156
- (b) => b !== "unknown"
2150
+ const v = (w = c == null ? void 0 : c.formats) == null ? void 0 : w.filter(
2151
+ ($) => $ !== "unknown"
2157
2152
  );
2158
- if ((g == null ? void 0 : g.length) === 0)
2153
+ if ((v == null ? void 0 : v.length) === 0)
2159
2154
  throw new TypeError("Hint option provided, but is empty.");
2160
- g == null || g.forEach((b) => {
2161
- if (!It.has(b))
2155
+ for (const $ of v != null ? v : [])
2156
+ if (!Bt.has($))
2162
2157
  throw new TypeError(
2163
- `Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${b}' is not a valid enum value of type BarcodeFormat.`
2158
+ `Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${$}' is not a valid enum value of type BarcodeFormat.`
2164
2159
  );
2165
- }), Ne(this, ct, g != null ? g : []), to().then((b) => {
2160
+ Je(this, lt, v != null ? v : []), Za().then(($) => {
2166
2161
  this.dispatchEvent(
2167
2162
  new CustomEvent("load", {
2168
- detail: b
2163
+ detail: $
2169
2164
  })
2170
2165
  );
2171
- }).catch((b) => {
2172
- this.dispatchEvent(new CustomEvent("error", { detail: b }));
2166
+ }).catch(($) => {
2167
+ this.dispatchEvent(new CustomEvent("error", { detail: $ }));
2173
2168
  });
2174
- } catch (g) {
2175
- throw Ge(
2176
- g,
2169
+ } catch (v) {
2170
+ throw er(
2171
+ v,
2177
2172
  "Failed to construct 'BarcodeDetector'"
2178
2173
  );
2179
2174
  }
2180
2175
  }
2181
2176
  static async getSupportedFormats() {
2182
- return Da.filter((s) => s !== "unknown");
2177
+ return to.filter((c) => c !== "unknown");
2183
2178
  }
2184
- async detect(s) {
2179
+ async detect(c) {
2185
2180
  try {
2186
- const $ = await Ra(s);
2187
- if ($ === null)
2181
+ const w = await so(c);
2182
+ if (w === null)
2188
2183
  return [];
2189
- let g;
2184
+ let v;
2190
2185
  try {
2191
- ar($) ? g = await eo($, {
2186
+ hr(w) ? v = await Ja(w, {
2192
2187
  tryHarder: !0,
2193
- formats: re(this, ct).map((b) => It.get(b))
2194
- }) : g = await ro($, {
2188
+ formats: se(this, lt).map(($) => Bt.get($))
2189
+ }) : v = await Ka(w, {
2195
2190
  tryHarder: !0,
2196
- formats: re(this, ct).map((b) => It.get(b))
2191
+ formats: se(this, lt).map(($) => Bt.get($))
2197
2192
  });
2198
- } catch (b) {
2199
- throw console.error(b), new DOMException(
2193
+ } catch ($) {
2194
+ throw console.error($), new DOMException(
2200
2195
  "Barcode detection service unavailable.",
2201
2196
  "NotSupportedError"
2202
2197
  );
2203
2198
  }
2204
- return g.map((b) => {
2199
+ return v.map(($) => {
2205
2200
  const {
2206
- topLeft: { x: H, y: L },
2207
- topRight: { x: B, y: M },
2208
- bottomLeft: { x: Y, y: G },
2209
- bottomRight: { x: U, y: Q }
2210
- } = b.position, tt = Math.min(H, B, Y, U), dt = Math.min(L, M, G, Q), V = Math.max(H, B, Y, U), W = Math.max(L, M, G, Q);
2201
+ topLeft: { x: B, y: U },
2202
+ topRight: { x: V, y: H },
2203
+ bottomLeft: { x: M, y: K },
2204
+ bottomRight: { x: L, y: ht }
2205
+ } = $.position, X = Math.min(B, V, M, L), tt = Math.min(U, H, K, ht), at = Math.max(B, V, M, L), _t = Math.max(U, H, K, ht);
2211
2206
  return {
2212
2207
  boundingBox: new DOMRectReadOnly(
2208
+ X,
2213
2209
  tt,
2214
- dt,
2215
- V - tt,
2216
- W - dt
2210
+ at - X,
2211
+ _t - tt
2217
2212
  ),
2218
- rawValue: b.text,
2219
- format: xa(b.format),
2213
+ rawValue: $.text,
2214
+ format: eo($.format),
2220
2215
  cornerPoints: [
2221
2216
  {
2222
- x: H,
2223
- y: L
2217
+ x: B,
2218
+ y: U
2224
2219
  },
2225
2220
  {
2226
- x: B,
2227
- y: M
2221
+ x: V,
2222
+ y: H
2228
2223
  },
2229
2224
  {
2230
- x: U,
2231
- y: Q
2225
+ x: L,
2226
+ y: ht
2232
2227
  },
2233
2228
  {
2234
- x: Y,
2235
- y: G
2229
+ x: M,
2230
+ y: K
2236
2231
  }
2237
2232
  ]
2238
2233
  };
2239
2234
  });
2240
- } catch ($) {
2241
- throw Ge(
2242
- $,
2235
+ } catch (w) {
2236
+ throw er(
2237
+ w,
2243
2238
  "Failed to execute 'detect' on 'BarcodeDetector'"
2244
2239
  );
2245
2240
  }
2246
2241
  }
2247
2242
  }
2248
- ct = new WeakMap();
2243
+ lt = new WeakMap();
2249
2244
  export {
2250
- oo as BarcodeDetector,
2251
- ao as setZXingModuleOverrides
2245
+ yo as BarcodeDetector,
2246
+ mo as setZXingModuleOverrides
2252
2247
  };