@maxr0ssi/glide-web-ui 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/README.md +75 -0
  2. package/dist/components/GlideDemo.d.ts +16 -0
  3. package/dist/components/GlideDemo.d.ts.map +1 -0
  4. package/dist/components/ScrollArea.d.ts +15 -0
  5. package/dist/components/ScrollArea.d.ts.map +1 -0
  6. package/dist/components/Visualizer.d.ts +20 -0
  7. package/dist/components/Visualizer.d.ts.map +1 -0
  8. package/dist/core/collections.d.ts +22 -0
  9. package/dist/core/collections.d.ts.map +1 -0
  10. package/dist/core/config.d.ts +68 -0
  11. package/dist/core/config.d.ts.map +1 -0
  12. package/dist/core/types.d.ts +35 -0
  13. package/dist/core/types.d.ts.map +1 -0
  14. package/dist/features/alignment.d.ts +36 -0
  15. package/dist/features/alignment.d.ts.map +1 -0
  16. package/dist/features/kinematics.d.ts +31 -0
  17. package/dist/features/kinematics.d.ts.map +1 -0
  18. package/dist/features/poses.d.ts +14 -0
  19. package/dist/features/poses.d.ts.map +1 -0
  20. package/dist/gestures/touchproof-detector.d.ts +37 -0
  21. package/dist/gestures/touchproof-detector.d.ts.map +1 -0
  22. package/dist/gestures/touchproof-scoring.d.ts +30 -0
  23. package/dist/gestures/touchproof-scoring.d.ts.map +1 -0
  24. package/dist/gestures/touchproof-signals.d.ts +16 -0
  25. package/dist/gestures/touchproof-signals.d.ts.map +1 -0
  26. package/dist/gestures/velocity-controller.d.ts +24 -0
  27. package/dist/gestures/velocity-controller.d.ts.map +1 -0
  28. package/dist/gestures/velocity-tracker.d.ts +23 -0
  29. package/dist/gestures/velocity-tracker.d.ts.map +1 -0
  30. package/dist/glide-demo.cjs.js +15 -0
  31. package/dist/glide-demo.es.js +4441 -0
  32. package/dist/hooks/useGlide.d.ts +31 -0
  33. package/dist/hooks/useGlide.d.ts.map +1 -0
  34. package/dist/index.d.ts +9 -0
  35. package/dist/index.d.ts.map +1 -0
  36. package/dist/perception/hand-detector.d.ts +21 -0
  37. package/dist/perception/hand-detector.d.ts.map +1 -0
  38. package/package.json +57 -0
@@ -0,0 +1,4441 @@
1
+ var s1 = Object.defineProperty;
2
+ var o1 = (t, e, n) => e in t ? s1(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var A = (t, e, n) => o1(t, typeof e != "symbol" ? e + "" : e, n);
4
+ import { jsxs as Et, jsx as I, Fragment as a1 } from "react/jsx-runtime";
5
+ import { useRef as lt, useState as Yt, useCallback as Xr, useEffect as ji } from "react";
6
+ function to() {
7
+ return {
8
+ cameraIndex: 0,
9
+ frameWidth: 960,
10
+ mirror: !0,
11
+ touchThresholdPixels: 50,
12
+ gates: {
13
+ presenceConf: 0.7,
14
+ poses: ["open_palm", "pointing_index", "two_up"],
15
+ preStillMs: 150,
16
+ maxIdleRmsSpeed: 0.08
17
+ },
18
+ kinematics: {
19
+ emaAlpha: 0.35,
20
+ bufferFrames: 24,
21
+ frameLookback: 5
22
+ },
23
+ touchproof: {
24
+ proximityEnter: 0.25,
25
+ proximityExit: 0.4,
26
+ proximityHardCap: 0.5,
27
+ angleEnterDeg: 24,
28
+ angleExitDeg: 32,
29
+ angleHardCapDeg: 45,
30
+ correlationFrames: 5,
31
+ correlationMin: 0.7,
32
+ visibilityAsymmetryMin: 0.12,
33
+ framesToEnter: 4,
34
+ framesToExit: 3,
35
+ fusedEnterThreshold: 0.75,
36
+ fusedExitThreshold: 0.65,
37
+ emaAlpha: 0.3,
38
+ smoothProximity: !0,
39
+ proximityMode: "adaptive",
40
+ baselineLearningRate: 0.02,
41
+ relativeTouchThreshold: 0.85,
42
+ distanceNearPx: 200,
43
+ distanceFarPx: 50,
44
+ kD: 0.3,
45
+ kTheta: 2,
46
+ mfcWindowFrames: 5,
47
+ mfcPatchSize: 15,
48
+ mfcCorrMin: 0.7,
49
+ mfcMagRatioMin: 0.6,
50
+ mfcMagRatioMax: 1.4
51
+ },
52
+ scroll: {
53
+ enabled: !0,
54
+ pixelsPerDegree: 5,
55
+ maxVelocity: 100,
56
+ accelerationCurve: 1.5
57
+ }
58
+ };
59
+ }
60
+ function c1(t) {
61
+ const e = to();
62
+ return {
63
+ ...e,
64
+ ...t,
65
+ gates: { ...e.gates, ...t.gates },
66
+ kinematics: { ...e.kinematics, ...t.kinematics },
67
+ touchproof: { ...e.touchproof, ...t.touchproof },
68
+ scroll: { ...e.scroll, ...t.scroll }
69
+ };
70
+ }
71
+ class sn {
72
+ constructor(e) {
73
+ A(this, "_buf");
74
+ A(this, "_head");
75
+ A(this, "_size");
76
+ A(this, "_capacity");
77
+ if (e < 1) throw new RangeError("capacity must be >= 1");
78
+ this._capacity = e, this._buf = new Array(e), this._head = 0, this._size = 0;
79
+ }
80
+ get length() {
81
+ return this._size;
82
+ }
83
+ get capacity() {
84
+ return this._capacity;
85
+ }
86
+ push(e) {
87
+ const n = (this._head + this._size) % this._capacity;
88
+ this._buf[n] = e, this._size < this._capacity ? this._size++ : this._head = (this._head + 1) % this._capacity;
89
+ }
90
+ at(e) {
91
+ if (e < 0 || e >= this._size)
92
+ throw new RangeError(`index ${e} out of range [0, ${this._size})`);
93
+ return this._buf[(this._head + e) % this._capacity];
94
+ }
95
+ /** Access from end: -1 = last, -2 = second to last, etc. */
96
+ fromEnd(e) {
97
+ if (e >= 0 || -e > this._size)
98
+ throw new RangeError(`offset ${e} out of range`);
99
+ return this.at(this._size + e);
100
+ }
101
+ first() {
102
+ return this._size > 0 ? this.at(0) : void 0;
103
+ }
104
+ last() {
105
+ return this._size > 0 ? this.at(this._size - 1) : void 0;
106
+ }
107
+ clear() {
108
+ this._head = 0, this._size = 0;
109
+ }
110
+ toArray() {
111
+ const e = [];
112
+ for (let n = 0; n < this._size; n++)
113
+ e.push(this.at(n));
114
+ return e;
115
+ }
116
+ *[Symbol.iterator]() {
117
+ for (let e = 0; e < this._size; e++)
118
+ yield this.at(e);
119
+ }
120
+ }
121
+ class ce {
122
+ constructor(e = 0.35, n = 24) {
123
+ A(this, "emaAlpha");
124
+ A(this, "_idxTipEma", null);
125
+ A(this, "_midTipEma", null);
126
+ A(this, "trail");
127
+ A(this, "trailMid");
128
+ A(this, "trailMean");
129
+ this.emaAlpha = e, this.trail = new sn(n), this.trailMid = new sn(n), this.trailMean = new sn(n);
130
+ }
131
+ static mean(e) {
132
+ const n = Math.max(e.length, 1), i = e.reduce((s, o) => s + o[0], 0), r = e.reduce((s, o) => s + o[1], 0);
133
+ return [i / n, r / n];
134
+ }
135
+ static rot(e, n, i) {
136
+ const r = Math.cos(i), s = Math.sin(i);
137
+ return [r * e - s * n, s * e + r * n];
138
+ }
139
+ static ema(e, n, i) {
140
+ return e == null ? n : [i * n[0] + (1 - i) * e[0], i * n[1] + (1 - i) * e[1]];
141
+ }
142
+ compute(e) {
143
+ if (!e || e.length < 21) return null;
144
+ const n = e[0], i = [e[5], e[9], e[13], e[17]], [r, s] = ce.mean([
145
+ [n.x, n.y],
146
+ ...i.map((re) => [re.x, re.y])
147
+ ]), o = e[9], a = Math.atan2(o.y - n.y, o.x - n.x), c = e[8], h = e[12], l = e[5], u = e[9], f = [c.x - r, c.y - s], v = [h.x - r, h.y - s], b = ce.rot(f[0], f[1], -a), M = ce.rot(v[0], v[1], -a);
148
+ this._idxTipEma = ce.ema(this._idxTipEma, b, this.emaAlpha), this._midTipEma = ce.ema(this._midTipEma, M, this.emaAlpha);
149
+ const L = Math.hypot(c.x - l.x, c.y - l.y), z = Math.hypot(h.x - u.x, h.y - u.y);
150
+ this.trail.push(this._idxTipEma), this.trailMid.push(this._midTipEma);
151
+ const tt = (this._idxTipEma[0] + this._midTipEma[0]) / 2, vt = (this._idxTipEma[1] + this._midTipEma[1]) / 2;
152
+ return this.trailMean.push([tt, vt]), {
153
+ palmX: r,
154
+ palmY: s,
155
+ thetaRad: a,
156
+ indexTipRel: this._idxTipEma,
157
+ middleTipRel: this._midTipEma,
158
+ fingerLengthIdx: L,
159
+ fingerLengthMid: z
160
+ };
161
+ }
162
+ getMeanFingertip() {
163
+ return this._idxTipEma == null || this._midTipEma == null ? null : [
164
+ (this._idxTipEma[0] + this._midTipEma[0]) / 2,
165
+ (this._idxTipEma[1] + this._midTipEma[1]) / 2
166
+ ];
167
+ }
168
+ getFingerSpeeds(e = 1) {
169
+ let n = null, i = null;
170
+ if (this.trail.length > e) {
171
+ const r = this.trail.fromEnd(-1), s = this.trail.fromEnd(-(e + 1));
172
+ n = Math.hypot(r[0] - s[0], r[1] - s[1]);
173
+ }
174
+ if (this.trailMid.length > e) {
175
+ const r = this.trailMid.fromEnd(-1), s = this.trailMid.fromEnd(-(e + 1));
176
+ i = Math.hypot(r[0] - s[0], r[1] - s[1]);
177
+ }
178
+ return [n, i];
179
+ }
180
+ }
181
+ var oe = /* @__PURE__ */ ((t) => (t.UNARMED = "UNARMED", t.READY = "READY", t.ARMED = "ARMED", t.COOLDOWN = "COOLDOWN", t))(oe || {});
182
+ function h1() {
183
+ return { openPalm: !1, pointingIndex: !1, twoUp: !1 };
184
+ }
185
+ function l1(t) {
186
+ const e = h1();
187
+ if (!t || t.length < 21) return e;
188
+ const n = t[5], i = t[17], r = t[8], s = t[12], o = t[16], a = Math.abs(n.x - i.x);
189
+ return e.openPalm = a > 0.12, e.pointingIndex = r.y < s.y - 0.02, e.twoUp = r.y < o.y - 0.02 && s.y < o.y - 0.02, e;
190
+ }
191
+ class u1 {
192
+ constructor() {
193
+ A(this, "palmCenter", null);
194
+ A(this, "thetaRad", null);
195
+ A(this, "scale", null);
196
+ A(this, "imageWidth", null);
197
+ A(this, "imageHeight", null);
198
+ }
199
+ /**
200
+ * Update alignment parameters from hand landmarks.
201
+ * Returns true if successful.
202
+ */
203
+ update(e, n, i) {
204
+ if (!e || e.length < 21) return !1;
205
+ this.imageWidth = n, this.imageHeight = i;
206
+ const r = e[0], s = [5, 9, 13, 17], o = [[r.x, r.y]];
207
+ for (const M of s)
208
+ o.push([e[M].x, e[M].y]);
209
+ const a = o.reduce((M, L) => M + L[0], 0) / o.length, c = o.reduce((M, L) => M + L[1], 0) / o.length;
210
+ this.palmCenter = [a, c];
211
+ const h = e[9], l = h.x - r.x, u = h.y - r.y;
212
+ this.thetaRad = Math.atan2(u, l);
213
+ const f = e[8], v = e[5], b = Math.hypot(f.x - v.x, f.y - v.y);
214
+ return this.scale = Math.max(b, 1e-3), !0;
215
+ }
216
+ normalizedToPixel(e, n) {
217
+ return this.imageWidth == null || this.imageHeight == null ? [0, 0] : [Math.round(e * this.imageWidth), Math.round(n * this.imageHeight)];
218
+ }
219
+ pixelToNormalized(e, n) {
220
+ return this.imageWidth == null || this.imageHeight == null ? [0, 0] : [e / this.imageWidth, n / this.imageHeight];
221
+ }
222
+ /** Transform normalized coordinates to hand-aligned coordinates. */
223
+ toHandAligned(e, n) {
224
+ if (this.palmCenter == null || this.thetaRad == null || this.scale == null)
225
+ return [0, 0];
226
+ const i = e - this.palmCenter[0], r = n - this.palmCenter[1], s = Math.cos(-this.thetaRad), o = Math.sin(-this.thetaRad), a = s * i - o * r, c = o * i + s * r;
227
+ return [a / this.scale, c / this.scale];
228
+ }
229
+ /** Inverse: hand-aligned → normalized coordinates. */
230
+ fromHandAligned(e, n) {
231
+ if (this.palmCenter == null || this.thetaRad == null || this.scale == null)
232
+ return [0, 0];
233
+ const i = e * this.scale, r = n * this.scale, s = Math.cos(this.thetaRad), o = Math.sin(this.thetaRad), a = s * i - o * r, c = o * i + s * r;
234
+ return [a + this.palmCenter[0], c + this.palmCenter[1]];
235
+ }
236
+ /** Get fingertip pixel positions: [[indexX, indexY], [middleX, middleY]]. */
237
+ getFingertipPixels(e) {
238
+ if (!e || e.length < 21) return [[0, 0], [0, 0]];
239
+ const n = e[8], i = e[12];
240
+ return [
241
+ this.normalizedToPixel(n.x, n.y),
242
+ this.normalizedToPixel(i.x, i.y)
243
+ ];
244
+ }
245
+ /** Normalized distance between index and middle fingertips (0 = touching). */
246
+ getNormalizedDistance(e) {
247
+ if (!e || e.length < 21 || this.scale == null) return 1 / 0;
248
+ const n = e[8], i = e[12], r = this.toHandAligned(n.x, n.y), s = this.toHandAligned(i.x, i.y);
249
+ return Math.hypot(r[0] - s[0], r[1] - s[1]);
250
+ }
251
+ /** Log-normalized distance (more stable across camera distances). */
252
+ getNormalizedDistanceLog(e) {
253
+ if (!e || e.length < 21) return 1 / 0;
254
+ const n = e[8], i = e[12], r = this.normalizedToPixel(n.x, n.y), s = this.normalizedToPixel(i.x, i.y), o = Math.hypot(r[0] - s[0], r[1] - s[1]);
255
+ return Math.log(1 + o) / Math.log(1 + 30);
256
+ }
257
+ /** Angle between index and middle fingers from palm center (degrees). */
258
+ getFingertipAngle(e) {
259
+ if (!e || e.length < 21) return 0;
260
+ const n = e[8], i = e[12], r = this.toHandAligned(n.x, n.y), s = this.toHandAligned(i.x, i.y), o = Math.hypot(r[0], r[1]), a = Math.hypot(s[0], s[1]);
261
+ if (o < 1e-6 || a < 1e-6) return 0;
262
+ const c = r[0] * s[0] + r[1] * s[1], h = Math.max(-1, Math.min(1, c / (o * a)));
263
+ return Math.acos(h) * (180 / Math.PI);
264
+ }
265
+ /** Distance factor: 0.0 = very close, 1.0 = far away. */
266
+ getHandDistanceFactor() {
267
+ if (this.scale == null || this.imageWidth == null || this.imageHeight == null)
268
+ return 0.5;
269
+ const e = this.scale * Math.max(this.imageWidth, this.imageHeight);
270
+ return Math.max(0, Math.min(1, (200 - e) / 150));
271
+ }
272
+ /** Finger length in pixels. */
273
+ getFingerLengthPixels() {
274
+ return this.scale == null || this.imageWidth == null || this.imageHeight == null ? 100 : this.scale * Math.max(this.imageWidth, this.imageHeight);
275
+ }
276
+ }
277
+ function d1(t, e, n) {
278
+ return t <= e ? 1 : t >= n ? 0 : 1 - (t - e) / (n - e);
279
+ }
280
+ function f1(t, e, n) {
281
+ return t <= e ? 1 : t >= n ? 0 : 1 - (t - e) / (n - e);
282
+ }
283
+ function p1(t, e, n) {
284
+ if (t.visibility == null || e.visibility == null) return 0.5;
285
+ const i = Math.abs(t.visibility - e.visibility);
286
+ return i >= n ? 1 : i / n;
287
+ }
288
+ function g1(t, e, n, i) {
289
+ if (t.length < n) return 0.5;
290
+ const r = [], s = [], o = [], a = [];
291
+ for (let u = 1; u < t.length; u++)
292
+ r.push(t[u][0] - t[u - 1][0]), s.push(t[u][1] - t[u - 1][1]), o.push(e[u][0] - e[u - 1][0]), a.push(e[u][1] - e[u - 1][1]);
293
+ const c = Yr(r, o), h = Yr(s, a);
294
+ let l;
295
+ return c != null && h != null ? l = (c + h) / 2 : c != null ? l = c : h != null ? l = h : l = 0.5, l >= i ? 1 : Math.max(0, l);
296
+ }
297
+ function Yr(t, e) {
298
+ const n = Math.min(t.length, e.length);
299
+ if (n < 2) return null;
300
+ const i = t.slice(0, n).reduce((c, h) => c + h, 0) / n, r = e.slice(0, n).reduce((c, h) => c + h, 0) / n;
301
+ let s = 0, o = 0, a = 0;
302
+ for (let c = 0; c < n; c++) {
303
+ const h = t[c] - i, l = e[c] - r;
304
+ s += h * h, o += l * l, a += h * l;
305
+ }
306
+ return s < 1e-9 || o < 1e-9 ? s < 1e-9 && o < 1e-9 ? 1 : 0 : a / Math.sqrt(s * o);
307
+ }
308
+ function m1(t, e, n, i) {
309
+ if (n.proximityMode === "adaptive" && i != null) {
310
+ const a = i / (t + 1e-3), c = n.relativeTouchThreshold;
311
+ return 1 / (1 + Math.exp(-6 * (a - c)));
312
+ }
313
+ const r = n.kD, s = n.proximityEnter * (1 + r * e), o = n.proximityExit * (1 + r * e);
314
+ return t <= s ? 1 : t >= o ? 0 : 1 - (t - s) / (o - s);
315
+ }
316
+ function y1(t, e, n) {
317
+ const i = n.kTheta, r = n.angleEnterDeg - i * (1 - e), s = n.angleExitDeg - i * (1 - e);
318
+ return t <= r ? 1 : t >= s ? 0 : 1 - (t - r) / (s - r);
319
+ }
320
+ function _1(t) {
321
+ if (t > 0.7)
322
+ return { proximity: 0.45, angle: 0.2, mfc: 0.3, occlusion: 0.05 };
323
+ if (t < 0.3)
324
+ return { proximity: 0.4, angle: 0.3, mfc: 0.25, occlusion: 0.05 };
325
+ const e = (t - 0.3) / 0.4, n = { proximity: 0.4, angle: 0.3, mfc: 0.25, occlusion: 0.05 }, i = { proximity: 0.45, angle: 0.2, mfc: 0.3, occlusion: 0.05 };
326
+ return {
327
+ proximity: n.proximity * (1 - e) + i.proximity * e,
328
+ angle: n.angle * (1 - e) + i.angle * e,
329
+ mfc: n.mfc * (1 - e) + i.mfc * e,
330
+ occlusion: n.occlusion * (1 - e) + i.occlusion * e
331
+ };
332
+ }
333
+ function Pn() {
334
+ return {
335
+ proximityScore: 0,
336
+ angleScore: 0,
337
+ correlationScore: 0,
338
+ visibilityScore: 0,
339
+ mfcScore: 0,
340
+ distanceFactor: 0.5,
341
+ fusedScore: 0,
342
+ isTouching: !1
343
+ };
344
+ }
345
+ class v1 {
346
+ constructor(e) {
347
+ A(this, "config");
348
+ A(this, "aligner");
349
+ A(this, "state", oe.UNARMED);
350
+ A(this, "_enterCounter", 0);
351
+ A(this, "_exitCounter", 0);
352
+ A(this, "_idxPositions");
353
+ A(this, "_midPositions");
354
+ A(this, "_proximityEma", null);
355
+ A(this, "_angleEma", null);
356
+ A(this, "_baselineClose", null);
357
+ A(this, "_baselineFar", null);
358
+ A(this, "_baselineAlpha");
359
+ /** Hardcoded MFC score (no optical flow in browser). */
360
+ A(this, "_lastMfcScore", 0.5);
361
+ this.config = e, this.aligner = new u1(), this._idxPositions = new sn(e.correlationFrames + 1), this._midPositions = new sn(e.correlationFrames + 1), this._baselineAlpha = e.baselineLearningRate;
362
+ }
363
+ /**
364
+ * Update touch detection with new landmarks.
365
+ * Note: no frame_bgr param (MFC excluded).
366
+ */
367
+ update(e, n, i) {
368
+ if (!this.aligner.update(e, n, i) || e.length < 21) return Pn();
369
+ const r = e[8], s = e[12], o = this.config.proximityMode === "logarithmic" ? this.aligner.getNormalizedDistanceLog(e) : this.aligner.getNormalizedDistance(e);
370
+ if (o > this.config.proximityHardCap)
371
+ return {
372
+ proximityScore: 0,
373
+ angleScore: 0,
374
+ correlationScore: 0,
375
+ visibilityScore: 0,
376
+ mfcScore: 0,
377
+ distanceFactor: this.aligner.getHandDistanceFactor(),
378
+ fusedScore: 0,
379
+ isTouching: !1
380
+ };
381
+ const a = d1(
382
+ o,
383
+ this.config.proximityEnter,
384
+ this.config.proximityExit
385
+ );
386
+ let c;
387
+ this.config.smoothProximity ? (this._proximityEma == null ? this._proximityEma = a : this._proximityEma = this.config.emaAlpha * a + (1 - this.config.emaAlpha) * this._proximityEma, c = this._proximityEma) : c = a;
388
+ const h = this.aligner.getFingertipAngle(e);
389
+ if (h > this.config.angleHardCapDeg)
390
+ return {
391
+ proximityScore: c,
392
+ angleScore: 0,
393
+ correlationScore: 0,
394
+ visibilityScore: 0,
395
+ mfcScore: 0,
396
+ distanceFactor: this.aligner.getHandDistanceFactor(),
397
+ fusedScore: 0,
398
+ isTouching: !1
399
+ };
400
+ const l = 0.2;
401
+ this._angleEma == null ? this._angleEma = h : this._angleEma = l * h + (1 - l) * this._angleEma, f1(
402
+ this._angleEma,
403
+ this.config.angleEnterDeg,
404
+ this.config.angleExitDeg
405
+ );
406
+ const u = this.aligner.toHandAligned(r.x, r.y), f = this.aligner.toHandAligned(s.x, s.y);
407
+ this._idxPositions.push(u), this._midPositions.push(f);
408
+ const v = g1(
409
+ this._idxPositions.toArray(),
410
+ this._midPositions.toArray(),
411
+ this.config.correlationFrames,
412
+ this.config.correlationMin
413
+ ), b = p1(
414
+ r,
415
+ s,
416
+ this.config.visibilityAsymmetryMin
417
+ ), M = this.aligner.getHandDistanceFactor();
418
+ this._updateBaseline(o, M);
419
+ const L = this._lastMfcScore, z = _1(M), tt = this._getBaselineDistance(M), vt = m1(
420
+ o,
421
+ M,
422
+ this.config,
423
+ tt
424
+ ), re = y1(h, M, this.config), wn = z.proximity * vt + z.angle * re + z.mfc * L + z.occlusion * b, ci = this._updateState(wn);
425
+ return {
426
+ proximityScore: vt,
427
+ angleScore: re,
428
+ correlationScore: v,
429
+ visibilityScore: b,
430
+ mfcScore: L,
431
+ distanceFactor: M,
432
+ fusedScore: wn,
433
+ isTouching: ci
434
+ };
435
+ }
436
+ _updateState(e) {
437
+ if (this.state === oe.UNARMED) {
438
+ if (e > this.config.fusedEnterThreshold) {
439
+ if (this._enterCounter++, this._enterCounter >= this.config.framesToEnter)
440
+ return this.state = oe.READY, this._enterCounter = 0, !0;
441
+ } else
442
+ this._enterCounter = 0;
443
+ return !1;
444
+ }
445
+ if (this.state === oe.READY) {
446
+ if (e < this.config.fusedExitThreshold) {
447
+ if (this._exitCounter++, this._exitCounter >= this.config.framesToExit)
448
+ return this.state = oe.UNARMED, this._exitCounter = 0, !1;
449
+ } else
450
+ this._exitCounter = 0;
451
+ return !0;
452
+ }
453
+ return !1;
454
+ }
455
+ _updateBaseline(e, n) {
456
+ this.state === oe.UNARMED && (n < 0.3 ? this._baselineClose == null ? this._baselineClose = e : this._baselineClose = this._baselineAlpha * e + (1 - this._baselineAlpha) * this._baselineClose : n > 0.7 && (this._baselineFar == null ? this._baselineFar = e : this._baselineFar = this._baselineAlpha * e + (1 - this._baselineAlpha) * this._baselineFar));
457
+ }
458
+ _getBaselineDistance(e) {
459
+ if (this._baselineClose == null || this._baselineFar == null) return null;
460
+ if (e < 0.3) return this._baselineClose;
461
+ if (e > 0.7) return this._baselineFar;
462
+ const n = (e - 0.3) / 0.4;
463
+ return this._baselineClose * (1 - n) + this._baselineFar * n;
464
+ }
465
+ }
466
+ function A1(t) {
467
+ return Math.sqrt(t.x * t.x + t.y * t.y);
468
+ }
469
+ function $r() {
470
+ return { x: 0, y: 0 };
471
+ }
472
+ class b1 {
473
+ constructor(e = 100, n = 0.3) {
474
+ A(this, "windowMs");
475
+ A(this, "smoothingFactor");
476
+ A(this, "samples", []);
477
+ A(this, "lastVelocity", null);
478
+ A(this, "minSamples", 2);
479
+ A(this, "noiseThreshold", 0.5);
480
+ this.windowMs = e, this.smoothingFactor = n;
481
+ }
482
+ update(e, n, i, r) {
483
+ if (!i)
484
+ return this.reset(), null;
485
+ const s = (e[0] + n[0]) / 2, o = (e[1] + n[1]) / 2;
486
+ this.samples.push({ x: s, y: o, timestampMs: r });
487
+ const a = r - this.windowMs;
488
+ for (; this.samples.length > 0 && this.samples[0].timestampMs < a; )
489
+ this.samples.shift();
490
+ if (this.samples.length < this.minSamples) return null;
491
+ let c = this._calculateVelocity();
492
+ return this.lastVelocity && c && (c = {
493
+ x: this.smoothingFactor * c.x + (1 - this.smoothingFactor) * this.lastVelocity.x,
494
+ y: this.smoothingFactor * c.y + (1 - this.smoothingFactor) * this.lastVelocity.y
495
+ }), this.lastVelocity = c, c;
496
+ }
497
+ _calculateVelocity() {
498
+ if (this.samples.length < 2) return null;
499
+ const e = this.samples[0], n = this.samples[this.samples.length - 1], i = n.timestampMs - e.timestampMs;
500
+ if (i <= 0) return null;
501
+ let r = (n.x - e.x) * 1e3 / i, s = (n.y - e.y) * 1e3 / i;
502
+ return Math.abs(r) < this.noiseThreshold / 1e3 && (r = 0), Math.abs(s) < this.noiseThreshold / 1e3 && (s = 0), { x: r, y: s };
503
+ }
504
+ reset() {
505
+ this.samples = [], this.lastVelocity = null;
506
+ }
507
+ }
508
+ var Me = /* @__PURE__ */ ((t) => (t.IDLE = "idle", t.SCROLLING = "scrolling", t))(Me || {});
509
+ class w1 {
510
+ constructor(e = 1e-3, n = 200) {
511
+ A(this, "minVelocity");
512
+ A(this, "scrollDelayMs");
513
+ A(this, "state", "idle");
514
+ A(this, "wasTouching", !1);
515
+ A(this, "touchStartMs", null);
516
+ this.minVelocity = e, this.scrollDelayMs = n;
517
+ }
518
+ update(e, n, i, r) {
519
+ return i ? (this.state = "idle", this.touchStartMs = null, { velocity: $r(), state: this.state, isActive: !1 }) : (this.state === "idle" ? n && e && A1(e) > this.minVelocity ? (this.touchStartMs == null && (this.touchStartMs = r), r - this.touchStartMs >= this.scrollDelayMs && (this.state = "scrolling")) : n || (this.touchStartMs = null) : this.state === "scrolling" && !n && this.wasTouching && (this.state = "idle", this.touchStartMs = null), this.wasTouching = n, {
520
+ velocity: e ?? $r(),
521
+ state: this.state,
522
+ isActive: this.state === "scrolling" && n
523
+ });
524
+ }
525
+ }
526
+ var Le = typeof self < "u" ? self : {};
527
+ function hn(t, e) {
528
+ t: {
529
+ for (var n = ["CLOSURE_FLAGS"], i = Le, r = 0; r < n.length; r++) if ((i = i[n[r]]) == null) {
530
+ n = null;
531
+ break t;
532
+ }
533
+ n = i;
534
+ }
535
+ return (t = n && n[t]) != null ? t : e;
536
+ }
537
+ function se() {
538
+ throw Error("Invalid UTF8");
539
+ }
540
+ function Jr(t, e) {
541
+ return e = String.fromCharCode.apply(null, e), t == null ? e : t + e;
542
+ }
543
+ let Tn, fi;
544
+ const E1 = typeof TextDecoder < "u";
545
+ let x1;
546
+ const T1 = typeof TextEncoder < "u";
547
+ function eo(t) {
548
+ if (T1) t = (x1 || (x1 = new TextEncoder())).encode(t);
549
+ else {
550
+ let n = 0;
551
+ const i = new Uint8Array(3 * t.length);
552
+ for (let r = 0; r < t.length; r++) {
553
+ var e = t.charCodeAt(r);
554
+ if (e < 128) i[n++] = e;
555
+ else {
556
+ if (e < 2048) i[n++] = e >> 6 | 192;
557
+ else {
558
+ if (e >= 55296 && e <= 57343) {
559
+ if (e <= 56319 && r < t.length) {
560
+ const s = t.charCodeAt(++r);
561
+ if (s >= 56320 && s <= 57343) {
562
+ e = 1024 * (e - 55296) + s - 56320 + 65536, i[n++] = e >> 18 | 240, i[n++] = e >> 12 & 63 | 128, i[n++] = e >> 6 & 63 | 128, i[n++] = 63 & e | 128;
563
+ continue;
564
+ }
565
+ r--;
566
+ }
567
+ e = 65533;
568
+ }
569
+ i[n++] = e >> 12 | 224, i[n++] = e >> 6 & 63 | 128;
570
+ }
571
+ i[n++] = 63 & e | 128;
572
+ }
573
+ }
574
+ t = n === i.length ? i : i.subarray(0, n);
575
+ }
576
+ return t;
577
+ }
578
+ function no(t) {
579
+ Le.setTimeout((() => {
580
+ throw t;
581
+ }), 0);
582
+ }
583
+ var wi, S1 = hn(610401301, !1), Zr = hn(748402147, !0), Gi = hn(824648567, !0), Hi = hn(824656860, hn(1, !0));
584
+ function Qr() {
585
+ var t = Le.navigator;
586
+ return t && (t = t.userAgent) ? t : "";
587
+ }
588
+ const ts = Le.navigator;
589
+ function Un(t) {
590
+ return Un[" "](t), t;
591
+ }
592
+ wi = ts && ts.userAgentData || null, Un[" "] = function() {
593
+ };
594
+ const io = {};
595
+ let nn = null;
596
+ function k1(t) {
597
+ const e = t.length;
598
+ let n = 3 * e / 4;
599
+ n % 3 ? n = Math.floor(n) : "=.".indexOf(t[e - 1]) != -1 && (n = "=.".indexOf(t[e - 2]) != -1 ? n - 2 : n - 1);
600
+ const i = new Uint8Array(n);
601
+ let r = 0;
602
+ return (function(s, o) {
603
+ function a(h) {
604
+ for (; c < s.length; ) {
605
+ const l = s.charAt(c++), u = nn[l];
606
+ if (u != null) return u;
607
+ if (!/^[\s\xa0]*$/.test(l)) throw Error("Unknown base64 encoding at char: " + l);
608
+ }
609
+ return h;
610
+ }
611
+ ro();
612
+ let c = 0;
613
+ for (; ; ) {
614
+ const h = a(-1), l = a(0), u = a(64), f = a(64);
615
+ if (f === 64 && h === -1) break;
616
+ o(h << 2 | l >> 4), u != 64 && (o(l << 4 & 240 | u >> 2), f != 64 && o(u << 6 & 192 | f));
617
+ }
618
+ })(t, (function(s) {
619
+ i[r++] = s;
620
+ })), r !== n ? i.subarray(0, r) : i;
621
+ }
622
+ function ro() {
623
+ if (!nn) {
624
+ nn = {};
625
+ var t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""), e = ["+/=", "+/", "-_=", "-_.", "-_"];
626
+ for (let n = 0; n < 5; n++) {
627
+ const i = t.concat(e[n].split(""));
628
+ io[n] = i;
629
+ for (let r = 0; r < i.length; r++) {
630
+ const s = i[r];
631
+ nn[s] === void 0 && (nn[s] = r);
632
+ }
633
+ }
634
+ }
635
+ }
636
+ var M1 = typeof Uint8Array < "u", so = !(!(S1 && wi && wi.brands.length > 0) && (Qr().indexOf("Trident") != -1 || Qr().indexOf("MSIE") != -1)) && typeof btoa == "function";
637
+ const es = /[-_.]/g, L1 = { "-": "+", _: "/", ".": "=" };
638
+ function F1(t) {
639
+ return L1[t] || "";
640
+ }
641
+ function oo(t) {
642
+ if (!so) return k1(t);
643
+ t = es.test(t) ? t.replace(es, F1) : t, t = atob(t);
644
+ const e = new Uint8Array(t.length);
645
+ for (let n = 0; n < t.length; n++) e[n] = t.charCodeAt(n);
646
+ return e;
647
+ }
648
+ function zi(t) {
649
+ return M1 && t != null && t instanceof Uint8Array;
650
+ }
651
+ var Fe = {};
652
+ function me() {
653
+ return P1 || (P1 = new Ct(null, Fe));
654
+ }
655
+ function Wi(t) {
656
+ ao(Fe);
657
+ var e = t.g;
658
+ return (e = e == null || zi(e) ? e : typeof e == "string" ? oo(e) : null) == null ? e : t.g = e;
659
+ }
660
+ var Ct = class {
661
+ h() {
662
+ return new Uint8Array(Wi(this) || 0);
663
+ }
664
+ constructor(t, e) {
665
+ if (ao(e), this.g = t, t != null && t.length === 0) throw Error("ByteString should be constructed with non-empty values");
666
+ }
667
+ };
668
+ let P1, R1;
669
+ function ao(t) {
670
+ if (t !== Fe) throw Error("illegal external caller");
671
+ }
672
+ function co(t, e) {
673
+ t.__closure__error__context__984382 || (t.__closure__error__context__984382 = {}), t.__closure__error__context__984382.severity = e;
674
+ }
675
+ function Ei(t) {
676
+ return co(t = Error(t), "warning"), t;
677
+ }
678
+ function Pe(t, e) {
679
+ if (t != null) {
680
+ var n = R1 ?? (R1 = {}), i = n[t] || 0;
681
+ i >= e || (n[t] = i + 1, co(t = Error(), "incident"), no(t));
682
+ }
683
+ }
684
+ function je() {
685
+ return typeof BigInt == "function";
686
+ }
687
+ var Ge = typeof Symbol == "function" && typeof Symbol() == "symbol";
688
+ function It(t, e, n = !1) {
689
+ return typeof Symbol == "function" && typeof Symbol() == "symbol" ? n && Symbol.for && t ? Symbol.for(t) : t != null ? Symbol(t) : Symbol() : e;
690
+ }
691
+ var O1 = It("jas", void 0, !0), ns = It(void 0, "0di"), tn = It(void 0, "1oa"), ut = It(void 0, Symbol()), N1 = It(void 0, "0ub"), C1 = It(void 0, "0ubs"), xi = It(void 0, "0ubsb"), I1 = It(void 0, "0actk"), Re = It("m_m", "Pa", !0), is = It();
692
+ const ho = { Ga: { value: 0, configurable: !0, writable: !0, enumerable: !1 } }, lo = Object.defineProperties, p = Ge ? O1 : "Ga";
693
+ var ve;
694
+ const rs = [];
695
+ function pn(t, e) {
696
+ Ge || p in t || lo(t, ho), t[p] |= e;
697
+ }
698
+ function q(t, e) {
699
+ Ge || p in t || lo(t, ho), t[p] = e;
700
+ }
701
+ function gn(t) {
702
+ return pn(t, 34), t;
703
+ }
704
+ function ln(t) {
705
+ return pn(t, 8192), t;
706
+ }
707
+ q(rs, 7), ve = Object.freeze(rs);
708
+ var Oe = {};
709
+ function ft(t, e) {
710
+ return e === void 0 ? t.h !== ye && !!(2 & (0 | t.v[p])) : !!(2 & e) && t.h !== ye;
711
+ }
712
+ const ye = {};
713
+ function Ki(t, e) {
714
+ if (t != null) {
715
+ if (typeof t == "string") t = t ? new Ct(t, Fe) : me();
716
+ else if (t.constructor !== Ct) if (zi(t)) t = t.length ? new Ct(new Uint8Array(t), Fe) : me();
717
+ else {
718
+ if (!e) throw Error();
719
+ t = void 0;
720
+ }
721
+ }
722
+ return t;
723
+ }
724
+ class ss {
725
+ constructor(e, n, i) {
726
+ this.g = e, this.h = n, this.l = i;
727
+ }
728
+ next() {
729
+ const e = this.g.next();
730
+ return e.done || (e.value = this.h.call(this.l, e.value)), e;
731
+ }
732
+ [Symbol.iterator]() {
733
+ return this;
734
+ }
735
+ }
736
+ var D1 = Object.freeze({});
737
+ function uo(t, e, n) {
738
+ const i = 128 & e ? 0 : -1, r = t.length;
739
+ var s;
740
+ (s = !!r) && (s = (s = t[r - 1]) != null && typeof s == "object" && s.constructor === Object);
741
+ const o = r + (s ? -1 : 0);
742
+ for (e = 128 & e ? 1 : 0; e < o; e++) n(e - i, t[e]);
743
+ if (s) {
744
+ t = t[r - 1];
745
+ for (const a in t) !isNaN(a) && n(+a, t[a]);
746
+ }
747
+ }
748
+ var fo = {};
749
+ function He(t) {
750
+ return 128 & t ? fo : void 0;
751
+ }
752
+ function Vn(t) {
753
+ return t.Na = !0, t;
754
+ }
755
+ var B1 = Vn(((t) => typeof t == "number")), os = Vn(((t) => typeof t == "string")), U1 = Vn(((t) => typeof t == "boolean")), jn = typeof Le.BigInt == "function" && typeof Le.BigInt(0) == "bigint";
756
+ function dt(t) {
757
+ var e = t;
758
+ if (os(e)) {
759
+ if (!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(e)) throw Error(String(e));
760
+ } else if (B1(e) && !Number.isSafeInteger(e)) throw Error(String(e));
761
+ return jn ? BigInt(t) : t = U1(t) ? t ? "1" : "0" : os(t) ? t.trim() || "0" : String(t);
762
+ }
763
+ var Ti = Vn(((t) => jn ? t >= j1 && t <= H1 : t[0] === "-" ? as(t, V1) : as(t, G1)));
764
+ const V1 = Number.MIN_SAFE_INTEGER.toString(), j1 = jn ? BigInt(Number.MIN_SAFE_INTEGER) : void 0, G1 = Number.MAX_SAFE_INTEGER.toString(), H1 = jn ? BigInt(Number.MAX_SAFE_INTEGER) : void 0;
765
+ function as(t, e) {
766
+ if (t.length > e.length) return !1;
767
+ if (t.length < e.length || t === e) return !0;
768
+ for (let n = 0; n < t.length; n++) {
769
+ const i = t[n], r = e[n];
770
+ if (i > r) return !1;
771
+ if (i < r) return !0;
772
+ }
773
+ }
774
+ const z1 = typeof Uint8Array.prototype.slice == "function";
775
+ let W1, O = 0, j = 0;
776
+ function cs(t) {
777
+ const e = t >>> 0;
778
+ O = e, j = (t - e) / 4294967296 >>> 0;
779
+ }
780
+ function Ne(t) {
781
+ if (t < 0) {
782
+ cs(-t);
783
+ const [e, n] = $i(O, j);
784
+ O = e >>> 0, j = n >>> 0;
785
+ } else cs(t);
786
+ }
787
+ function qi(t) {
788
+ const e = W1 || (W1 = new DataView(new ArrayBuffer(8)));
789
+ e.setFloat32(0, +t, !0), j = 0, O = e.getUint32(0, !0);
790
+ }
791
+ function Si(t, e) {
792
+ const n = 4294967296 * e + (t >>> 0);
793
+ return Number.isSafeInteger(n) ? n : un(t, e);
794
+ }
795
+ function K1(t, e) {
796
+ return dt(je() ? BigInt.asUintN(64, (BigInt(e >>> 0) << BigInt(32)) + BigInt(t >>> 0)) : un(t, e));
797
+ }
798
+ function Xi(t, e) {
799
+ const n = 2147483648 & e;
800
+ return n && (e = ~e >>> 0, (t = 1 + ~t >>> 0) == 0 && (e = e + 1 >>> 0)), typeof (t = Si(t, e)) == "number" ? n ? -t : t : n ? "-" + t : t;
801
+ }
802
+ function po(t, e) {
803
+ return je() ? dt(BigInt.asIntN(64, (BigInt.asUintN(32, BigInt(e)) << BigInt(32)) + BigInt.asUintN(32, BigInt(t)))) : dt(Yi(t, e));
804
+ }
805
+ function un(t, e) {
806
+ if (t >>>= 0, (e >>>= 0) <= 2097151) var n = "" + (4294967296 * e + t);
807
+ else je() ? n = "" + (BigInt(e) << BigInt(32) | BigInt(t)) : (t = (16777215 & t) + 6777216 * (n = 16777215 & (t >>> 24 | e << 8)) + 6710656 * (e = e >> 16 & 65535), n += 8147497 * e, e *= 2, t >= 1e7 && (n += t / 1e7 >>> 0, t %= 1e7), n >= 1e7 && (e += n / 1e7 >>> 0, n %= 1e7), n = e + hs(n) + hs(t));
808
+ return n;
809
+ }
810
+ function hs(t) {
811
+ return t = String(t), "0000000".slice(t.length) + t;
812
+ }
813
+ function Yi(t, e) {
814
+ if (2147483648 & e) if (je()) t = "" + (BigInt(0 | e) << BigInt(32) | BigInt(t >>> 0));
815
+ else {
816
+ const [n, i] = $i(t, e);
817
+ t = "-" + un(n, i);
818
+ }
819
+ else t = un(t, e);
820
+ return t;
821
+ }
822
+ function Gn(t) {
823
+ if (t.length < 16) Ne(Number(t));
824
+ else if (je()) t = BigInt(t), O = Number(t & BigInt(4294967295)) >>> 0, j = Number(t >> BigInt(32) & BigInt(4294967295));
825
+ else {
826
+ const e = +(t[0] === "-");
827
+ j = O = 0;
828
+ const n = t.length;
829
+ for (let i = e, r = (n - e) % 6 + e; r <= n; i = r, r += 6) {
830
+ const s = Number(t.slice(i, r));
831
+ j *= 1e6, O = 1e6 * O + s, O >= 4294967296 && (j += Math.trunc(O / 4294967296), j >>>= 0, O >>>= 0);
832
+ }
833
+ if (e) {
834
+ const [i, r] = $i(O, j);
835
+ O = i, j = r;
836
+ }
837
+ }
838
+ }
839
+ function $i(t, e) {
840
+ return e = ~e, t ? t = 1 + ~t : e += 1, [t, e];
841
+ }
842
+ function Mt(t) {
843
+ return Array.prototype.slice.call(t);
844
+ }
845
+ const mn = typeof BigInt == "function" ? BigInt.asIntN : void 0, q1 = typeof BigInt == "function" ? BigInt.asUintN : void 0, _e = Number.isSafeInteger, Hn = Number.isFinite, Ce = Math.trunc, X1 = dt(0);
846
+ function rn(t) {
847
+ if (t != null && typeof t != "number") throw Error(`Value of float/double field must be a number, found ${typeof t}: ${t}`);
848
+ return t;
849
+ }
850
+ function Nt(t) {
851
+ return t == null || typeof t == "number" ? t : t === "NaN" || t === "Infinity" || t === "-Infinity" ? Number(t) : void 0;
852
+ }
853
+ function dn(t) {
854
+ if (t != null && typeof t != "boolean") {
855
+ var e = typeof t;
856
+ throw Error(`Expected boolean but got ${e != "object" ? e : t ? Array.isArray(t) ? "array" : e : "null"}: ${t}`);
857
+ }
858
+ return t;
859
+ }
860
+ function go(t) {
861
+ return t == null || typeof t == "boolean" ? t : typeof t == "number" ? !!t : void 0;
862
+ }
863
+ const Y1 = /^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;
864
+ function yn(t) {
865
+ switch (typeof t) {
866
+ case "bigint":
867
+ return !0;
868
+ case "number":
869
+ return Hn(t);
870
+ case "string":
871
+ return Y1.test(t);
872
+ default:
873
+ return !1;
874
+ }
875
+ }
876
+ function ze(t) {
877
+ if (t == null) return t;
878
+ if (typeof t == "string" && t) t = +t;
879
+ else if (typeof t != "number") return;
880
+ return Hn(t) ? 0 | t : void 0;
881
+ }
882
+ function mo(t) {
883
+ if (t == null) return t;
884
+ if (typeof t == "string" && t) t = +t;
885
+ else if (typeof t != "number") return;
886
+ return Hn(t) ? t >>> 0 : void 0;
887
+ }
888
+ function yo(t) {
889
+ const e = t.length;
890
+ return (t[0] === "-" ? e < 20 || e === 20 && t <= "-9223372036854775808" : e < 19 || e === 19 && t <= "9223372036854775807") ? t : (Gn(t), Yi(O, j));
891
+ }
892
+ function Ji(t) {
893
+ return t = Ce(t), _e(t) || (Ne(t), t = Xi(O, j)), t;
894
+ }
895
+ function _o(t) {
896
+ var e = Ce(Number(t));
897
+ return _e(e) ? String(e) : ((e = t.indexOf(".")) !== -1 && (t = t.substring(0, e)), yo(t));
898
+ }
899
+ function vo(t) {
900
+ var e = Ce(Number(t));
901
+ return _e(e) ? dt(e) : ((e = t.indexOf(".")) !== -1 && (t = t.substring(0, e)), je() ? dt(mn(64, BigInt(t))) : dt(yo(t)));
902
+ }
903
+ function Ao(t) {
904
+ return _e(t) ? t = dt(Ji(t)) : (t = Ce(t), _e(t) ? t = String(t) : (Ne(t), t = Yi(O, j)), t = dt(t)), t;
905
+ }
906
+ function $1(t) {
907
+ return t == null ? t : typeof t == "bigint" ? (Ti(t) ? t = Number(t) : (t = mn(64, t), t = Ti(t) ? Number(t) : String(t)), t) : yn(t) ? typeof t == "number" ? Ji(t) : _o(t) : void 0;
908
+ }
909
+ function Rn(t) {
910
+ const e = typeof t;
911
+ return t == null ? t : e === "bigint" ? dt(mn(64, t)) : yn(t) ? e === "string" ? vo(t) : Ao(t) : void 0;
912
+ }
913
+ function bo(t) {
914
+ if (typeof t != "string") throw Error();
915
+ return t;
916
+ }
917
+ function _n(t) {
918
+ if (t != null && typeof t != "string") throw Error();
919
+ return t;
920
+ }
921
+ function Z(t) {
922
+ return t == null || typeof t == "string" ? t : void 0;
923
+ }
924
+ function Zi(t, e, n, i) {
925
+ return t != null && t[Re] === Oe ? t : Array.isArray(t) ? ((i = (n = 0 | t[p]) | 32 & i | 2 & i) !== n && q(t, i), new e(t)) : (n ? 2 & i ? ((t = e[ns]) || (gn((t = new e()).v), t = e[ns] = t), e = t) : e = new e() : e = void 0, e);
926
+ }
927
+ function J1(t, e, n) {
928
+ if (e) t: {
929
+ if (!yn(e = t)) throw Ei("int64");
930
+ switch (typeof e) {
931
+ case "string":
932
+ e = vo(e);
933
+ break t;
934
+ case "bigint":
935
+ e = dt(mn(64, e));
936
+ break t;
937
+ default:
938
+ e = Ao(e);
939
+ }
940
+ }
941
+ else e = Rn(t);
942
+ return (t = e) == null ? n ? X1 : void 0 : t;
943
+ }
944
+ const Z1 = {};
945
+ let Q1 = (function() {
946
+ try {
947
+ return Un(new class extends Map {
948
+ constructor() {
949
+ super();
950
+ }
951
+ }()), !1;
952
+ } catch {
953
+ return !0;
954
+ }
955
+ })();
956
+ class pi {
957
+ constructor() {
958
+ this.g = /* @__PURE__ */ new Map();
959
+ }
960
+ get(e) {
961
+ return this.g.get(e);
962
+ }
963
+ set(e, n) {
964
+ return this.g.set(e, n), this.size = this.g.size, this;
965
+ }
966
+ delete(e) {
967
+ return e = this.g.delete(e), this.size = this.g.size, e;
968
+ }
969
+ clear() {
970
+ this.g.clear(), this.size = this.g.size;
971
+ }
972
+ has(e) {
973
+ return this.g.has(e);
974
+ }
975
+ entries() {
976
+ return this.g.entries();
977
+ }
978
+ keys() {
979
+ return this.g.keys();
980
+ }
981
+ values() {
982
+ return this.g.values();
983
+ }
984
+ forEach(e, n) {
985
+ return this.g.forEach(e, n);
986
+ }
987
+ [Symbol.iterator]() {
988
+ return this.entries();
989
+ }
990
+ }
991
+ const t2 = Q1 ? (Object.setPrototypeOf(pi.prototype, Map.prototype), Object.defineProperties(pi.prototype, { size: { value: 0, configurable: !0, enumerable: !0, writable: !0 } }), pi) : class extends Map {
992
+ constructor() {
993
+ super();
994
+ }
995
+ };
996
+ function ls(t) {
997
+ return t;
998
+ }
999
+ function gi(t) {
1000
+ if (2 & t.J) throw Error("Cannot mutate an immutable Map");
1001
+ }
1002
+ var Gt = class extends t2 {
1003
+ constructor(t, e, n = ls, i = ls) {
1004
+ super(), this.J = 0 | t[p], this.K = e, this.S = n, this.fa = this.K ? e2 : i;
1005
+ for (let r = 0; r < t.length; r++) {
1006
+ const s = t[r], o = n(s[0], !1, !0);
1007
+ let a = s[1];
1008
+ e ? a === void 0 && (a = null) : a = i(s[1], !1, !0, void 0, void 0, this.J), super.set(o, a);
1009
+ }
1010
+ }
1011
+ V(t) {
1012
+ return ln(Array.from(super.entries(), t));
1013
+ }
1014
+ clear() {
1015
+ gi(this), super.clear();
1016
+ }
1017
+ delete(t) {
1018
+ return gi(this), super.delete(this.S(t, !0, !1));
1019
+ }
1020
+ entries() {
1021
+ if (this.K) {
1022
+ var t = super.keys();
1023
+ t = new ss(t, n2, this);
1024
+ } else t = super.entries();
1025
+ return t;
1026
+ }
1027
+ values() {
1028
+ if (this.K) {
1029
+ var t = super.keys();
1030
+ t = new ss(t, Gt.prototype.get, this);
1031
+ } else t = super.values();
1032
+ return t;
1033
+ }
1034
+ forEach(t, e) {
1035
+ this.K ? super.forEach(((n, i, r) => {
1036
+ t.call(e, r.get(i), i, r);
1037
+ })) : super.forEach(t, e);
1038
+ }
1039
+ set(t, e) {
1040
+ return gi(this), (t = this.S(t, !0, !1)) == null ? this : e == null ? (super.delete(t), this) : super.set(t, this.fa(e, !0, !0, this.K, !1, this.J));
1041
+ }
1042
+ Ma(t) {
1043
+ const e = this.S(t[0], !1, !0);
1044
+ t = t[1], t = this.K ? t === void 0 ? null : t : this.fa(t, !1, !0, void 0, !1, this.J), super.set(e, t);
1045
+ }
1046
+ has(t) {
1047
+ return super.has(this.S(t, !1, !1));
1048
+ }
1049
+ get(t) {
1050
+ t = this.S(t, !1, !1);
1051
+ const e = super.get(t);
1052
+ if (e !== void 0) {
1053
+ var n = this.K;
1054
+ return n ? ((n = this.fa(e, !1, !0, n, this.ra, this.J)) !== e && super.set(t, n), n) : e;
1055
+ }
1056
+ }
1057
+ [Symbol.iterator]() {
1058
+ return this.entries();
1059
+ }
1060
+ };
1061
+ function e2(t, e, n, i, r, s) {
1062
+ return t = Zi(t, i, n, s), r && (t = tr(t)), t;
1063
+ }
1064
+ function n2(t) {
1065
+ return [t, this.get(t)];
1066
+ }
1067
+ let i2;
1068
+ function us() {
1069
+ return i2 || (i2 = new Gt(gn([]), void 0, void 0, void 0, Z1));
1070
+ }
1071
+ function zn(t) {
1072
+ return ut ? t[ut] : void 0;
1073
+ }
1074
+ function On(t, e) {
1075
+ for (const n in t) !isNaN(n) && e(t, +n, t[n]);
1076
+ }
1077
+ Gt.prototype.toJSON = void 0;
1078
+ var ki = class {
1079
+ };
1080
+ const r2 = { Ka: !0 };
1081
+ function s2(t, e) {
1082
+ e < 100 || Pe(C1, 1);
1083
+ }
1084
+ function Wn(t, e, n, i) {
1085
+ const r = i !== void 0;
1086
+ i = !!i;
1087
+ var s, o = ut;
1088
+ !r && Ge && o && (s = t[o]) && On(s, s2), o = [];
1089
+ var a = t.length;
1090
+ let c;
1091
+ s = 4294967295;
1092
+ let h = !1;
1093
+ const l = !!(64 & e), u = l ? 128 & e ? 0 : -1 : void 0;
1094
+ 1 & e || (c = a && t[a - 1], c != null && typeof c == "object" && c.constructor === Object ? s = --a : c = void 0, !l || 128 & e || r || (h = !0, s = s - u + u)), e = void 0;
1095
+ for (var f = 0; f < a; f++) {
1096
+ let v = t[f];
1097
+ if (v != null && (v = n(v, i)) != null) if (l && f >= s) {
1098
+ const b = f - u;
1099
+ (e ?? (e = {}))[b] = v;
1100
+ } else o[f] = v;
1101
+ }
1102
+ if (c) for (let v in c) {
1103
+ if ((a = c[v]) == null || (a = n(a, i)) == null) continue;
1104
+ let b;
1105
+ f = +v, l && !Number.isNaN(f) && (b = f + u) < s ? o[b] = a : (e ?? (e = {}))[v] = a;
1106
+ }
1107
+ return e && (h ? o.push(e) : o[s] = e), r && ut && (t = zn(t)) && t instanceof ki && (o[ut] = (function(v) {
1108
+ const b = new ki();
1109
+ return On(v, ((M, L, z) => {
1110
+ b[L] = Mt(z);
1111
+ })), b.da = v.da, b;
1112
+ })(t)), o;
1113
+ }
1114
+ function o2(t) {
1115
+ return t[0] = fn(t[0]), t[1] = fn(t[1]), t;
1116
+ }
1117
+ function fn(t) {
1118
+ switch (typeof t) {
1119
+ case "number":
1120
+ return Number.isFinite(t) ? t : "" + t;
1121
+ case "bigint":
1122
+ return Ti(t) ? Number(t) : "" + t;
1123
+ case "boolean":
1124
+ return t ? 1 : 0;
1125
+ case "object":
1126
+ if (Array.isArray(t)) {
1127
+ var e = 0 | t[p];
1128
+ return t.length === 0 && 1 & e ? void 0 : Wn(t, e, fn);
1129
+ }
1130
+ if (t != null && t[Re] === Oe) return wo(t);
1131
+ if (t instanceof Ct) {
1132
+ if ((e = t.g) == null) t = "";
1133
+ else if (typeof e == "string") t = e;
1134
+ else {
1135
+ if (so) {
1136
+ for (var n = "", i = 0, r = e.length - 10240; i < r; ) n += String.fromCharCode.apply(null, e.subarray(i, i += 10240));
1137
+ n += String.fromCharCode.apply(null, i ? e.subarray(i) : e), e = btoa(n);
1138
+ } else {
1139
+ n === void 0 && (n = 0), ro(), n = io[n], i = Array(Math.floor(e.length / 3)), r = n[64] || "";
1140
+ let h = 0, l = 0;
1141
+ for (; h < e.length - 2; h += 3) {
1142
+ var s = e[h], o = e[h + 1], a = e[h + 2], c = n[s >> 2];
1143
+ s = n[(3 & s) << 4 | o >> 4], o = n[(15 & o) << 2 | a >> 6], a = n[63 & a], i[l++] = c + s + o + a;
1144
+ }
1145
+ switch (c = 0, a = r, e.length - h) {
1146
+ case 2:
1147
+ a = n[(15 & (c = e[h + 1])) << 2] || r;
1148
+ case 1:
1149
+ e = e[h], i[l] = n[e >> 2] + n[(3 & e) << 4 | c >> 4] + a + r;
1150
+ }
1151
+ e = i.join("");
1152
+ }
1153
+ t = t.g = e;
1154
+ }
1155
+ return t;
1156
+ }
1157
+ return t instanceof Gt ? t = t.size !== 0 ? t.V(o2) : void 0 : void 0;
1158
+ }
1159
+ return t;
1160
+ }
1161
+ function wo(t) {
1162
+ return Wn(t = t.v, 0 | t[p], fn);
1163
+ }
1164
+ let a2, c2;
1165
+ function ue(t, e) {
1166
+ return Eo(t, e[0], e[1]);
1167
+ }
1168
+ function Eo(t, e, n, i = 0) {
1169
+ if (t == null) {
1170
+ var r = 32;
1171
+ n ? (t = [n], r |= 128) : t = [], e && (r = -16760833 & r | (1023 & e) << 14);
1172
+ } else {
1173
+ if (!Array.isArray(t)) throw Error("narr");
1174
+ if (r = 0 | t[p], Zr && 1 & r) throw Error("rfarr");
1175
+ if (2048 & r && !(2 & r) && (function() {
1176
+ if (Zr) throw Error("carr");
1177
+ Pe(I1, 5);
1178
+ })(), 256 & r) throw Error("farr");
1179
+ if (64 & r) return (r | i) !== r && q(t, r | i), t;
1180
+ if (n && (r |= 128, n !== t[0])) throw Error("mid");
1181
+ t: {
1182
+ r |= 64;
1183
+ var s = (n = t).length;
1184
+ if (s) {
1185
+ var o = s - 1;
1186
+ const c = n[o];
1187
+ if (c != null && typeof c == "object" && c.constructor === Object) {
1188
+ if ((o -= e = 128 & r ? 0 : -1) >= 1024) throw Error("pvtlmt");
1189
+ for (var a in c) (s = +a) < o && (n[s + e] = c[a], delete c[a]);
1190
+ r = -16760833 & r | (1023 & o) << 14;
1191
+ break t;
1192
+ }
1193
+ }
1194
+ if (e) {
1195
+ if ((a = Math.max(e, s - (128 & r ? 0 : -1))) > 1024) throw Error("spvt");
1196
+ r = -16760833 & r | (1023 & a) << 14;
1197
+ }
1198
+ }
1199
+ }
1200
+ return q(t, 64 | r | i), t;
1201
+ }
1202
+ function h2(t, e) {
1203
+ if (typeof t != "object") return t;
1204
+ if (Array.isArray(t)) {
1205
+ var n = 0 | t[p];
1206
+ return t.length === 0 && 1 & n ? void 0 : ds(t, n, e);
1207
+ }
1208
+ if (t != null && t[Re] === Oe) return fs(t);
1209
+ if (t instanceof Gt) {
1210
+ if (2 & (e = t.J)) return t;
1211
+ if (!t.size) return;
1212
+ if (n = gn(t.V()), t.K) for (t = 0; t < n.length; t++) {
1213
+ const i = n[t];
1214
+ let r = i[1];
1215
+ r = r == null || typeof r != "object" ? void 0 : r != null && r[Re] === Oe ? fs(r) : Array.isArray(r) ? ds(r, 0 | r[p], !!(32 & e)) : void 0, i[1] = r;
1216
+ }
1217
+ return n;
1218
+ }
1219
+ return t instanceof Ct ? t : void 0;
1220
+ }
1221
+ function ds(t, e, n) {
1222
+ return 2 & e || (!n || 4096 & e || 16 & e ? t = We(t, e, !1, n && !(16 & e)) : (pn(t, 34), 4 & e && Object.freeze(t))), t;
1223
+ }
1224
+ function Qi(t, e, n) {
1225
+ return t = new t.constructor(e), n && (t.h = ye), t.m = ye, t;
1226
+ }
1227
+ function fs(t) {
1228
+ const e = t.v, n = 0 | e[p];
1229
+ return ft(t, n) ? t : er(t, e, n) ? Qi(t, e) : We(e, n);
1230
+ }
1231
+ function We(t, e, n, i) {
1232
+ return i ?? (i = !!(34 & e)), t = Wn(t, e, h2, i), i = 32, n && (i |= 2), q(t, e = 16769217 & e | i), t;
1233
+ }
1234
+ function tr(t) {
1235
+ const e = t.v, n = 0 | e[p];
1236
+ return ft(t, n) ? er(t, e, n) ? Qi(t, e, !0) : new t.constructor(We(e, n, !1)) : t;
1237
+ }
1238
+ function Ke(t) {
1239
+ if (t.h !== ye) return !1;
1240
+ var e = t.v;
1241
+ return pn(e = We(e, 0 | e[p]), 2048), t.v = e, t.h = void 0, t.m = void 0, !0;
1242
+ }
1243
+ function qe(t) {
1244
+ if (!Ke(t) && ft(t, 0 | t.v[p])) throw Error();
1245
+ }
1246
+ function Ae(t, e) {
1247
+ e === void 0 && (e = 0 | t[p]), 32 & e && !(4096 & e) && q(t, 4096 | e);
1248
+ }
1249
+ function er(t, e, n) {
1250
+ return !!(2 & n) || !(!(32 & n) || 4096 & n) && (q(e, 2 | n), t.h = ye, !0);
1251
+ }
1252
+ const l2 = dt(0), $t = {};
1253
+ function P(t, e, n, i, r) {
1254
+ if ((e = Ht(t.v, e, n, r)) !== null || i && t.m !== ye) return e;
1255
+ }
1256
+ function Ht(t, e, n, i) {
1257
+ if (e === -1) return null;
1258
+ const r = e + (n ? 0 : -1), s = t.length - 1;
1259
+ let o, a;
1260
+ if (!(s < 1 + (n ? 0 : -1))) {
1261
+ if (r >= s) if (o = t[s], o != null && typeof o == "object" && o.constructor === Object) n = o[e], a = !0;
1262
+ else {
1263
+ if (r !== s) return;
1264
+ n = o;
1265
+ }
1266
+ else n = t[r];
1267
+ if (i && n != null) {
1268
+ if ((i = i(n)) == null) return i;
1269
+ if (!Object.is(i, n)) return a ? o[e] = i : t[r] = i, i;
1270
+ }
1271
+ return n;
1272
+ }
1273
+ }
1274
+ function S(t, e, n, i) {
1275
+ qe(t), W(t = t.v, 0 | t[p], e, n, i);
1276
+ }
1277
+ function W(t, e, n, i, r) {
1278
+ const s = n + (r ? 0 : -1);
1279
+ var o = t.length - 1;
1280
+ if (o >= 1 + (r ? 0 : -1) && s >= o) {
1281
+ const a = t[o];
1282
+ if (a != null && typeof a == "object" && a.constructor === Object) return a[n] = i, e;
1283
+ }
1284
+ return s <= o ? (t[s] = i, e) : (i !== void 0 && (n >= (o = (e ?? (e = 0 | t[p])) >> 14 & 1023 || 536870912) ? i != null && (t[o + (r ? 0 : -1)] = { [n]: i }) : t[s] = i), e);
1285
+ }
1286
+ function he() {
1287
+ return D1 === void 0 ? 2 : 4;
1288
+ }
1289
+ function le(t, e, n, i, r) {
1290
+ let s = t.v, o = 0 | s[p];
1291
+ i = ft(t, o) ? 1 : i, r = !!r || i === 3, i === 2 && Ke(t) && (s = t.v, o = 0 | s[p]);
1292
+ let a = (t = nr(s, e)) === ve ? 7 : 0 | t[p], c = ir(a, o);
1293
+ var h = !(4 & c);
1294
+ if (h) {
1295
+ 4 & c && (t = Mt(t), a = 0, c = fe(c, o), o = W(s, o, e, t));
1296
+ let l = 0, u = 0;
1297
+ for (; l < t.length; l++) {
1298
+ const f = n(t[l]);
1299
+ f != null && (t[u++] = f);
1300
+ }
1301
+ u < l && (t.length = u), n = -513 & (4 | c), c = n &= -1025, c &= -4097;
1302
+ }
1303
+ return c !== a && (q(t, c), 2 & c && Object.freeze(t)), xo(t, c, s, o, e, i, h, r);
1304
+ }
1305
+ function xo(t, e, n, i, r, s, o, a) {
1306
+ let c = e;
1307
+ return s === 1 || s === 4 && (2 & e || !(16 & e) && 32 & i) ? de(e) || ((e |= !t.length || o && !(4096 & e) || 32 & i && !(4096 & e || 16 & e) ? 2 : 256) !== c && q(t, e), Object.freeze(t)) : (s === 2 && de(e) && (t = Mt(t), c = 0, e = fe(e, i), i = W(n, i, r, t)), de(e) || (a || (e |= 16), e !== c && q(t, e))), 2 & e || !(4096 & e || 16 & e) || Ae(n, i), t;
1308
+ }
1309
+ function nr(t, e, n) {
1310
+ return t = Ht(t, e, n), Array.isArray(t) ? t : ve;
1311
+ }
1312
+ function ir(t, e) {
1313
+ return 2 & e && (t |= 2), 1 | t;
1314
+ }
1315
+ function de(t) {
1316
+ return !!(2 & t) && !!(4 & t) || !!(256 & t);
1317
+ }
1318
+ function To(t) {
1319
+ return Ki(t, !0);
1320
+ }
1321
+ function So(t) {
1322
+ t = Mt(t);
1323
+ for (let e = 0; e < t.length; e++) {
1324
+ const n = t[e] = Mt(t[e]);
1325
+ Array.isArray(n[1]) && (n[1] = gn(n[1]));
1326
+ }
1327
+ return ln(t);
1328
+ }
1329
+ function Zt(t, e, n, i) {
1330
+ qe(t), W(t = t.v, 0 | t[p], e, (i === "0" ? Number(n) === 0 : n === i) ? void 0 : n);
1331
+ }
1332
+ function Xe(t, e, n) {
1333
+ if (2 & e) throw Error();
1334
+ const i = He(e);
1335
+ let r = nr(t, n, i), s = r === ve ? 7 : 0 | r[p], o = ir(s, e);
1336
+ return (2 & o || de(o) || 16 & o) && (o === s || de(o) || q(r, o), r = Mt(r), s = 0, o = fe(o, e), W(t, e, n, r, i)), o &= -13, o !== s && q(r, o), r;
1337
+ }
1338
+ function mi(t, e) {
1339
+ var n = _a;
1340
+ return sr(rr(t = t.v), t, void 0, n) === e ? e : -1;
1341
+ }
1342
+ function rr(t) {
1343
+ if (Ge) return t[tn] ?? (t[tn] = /* @__PURE__ */ new Map());
1344
+ if (tn in t) return t[tn];
1345
+ const e = /* @__PURE__ */ new Map();
1346
+ return Object.defineProperty(t, tn, { value: e }), e;
1347
+ }
1348
+ function ko(t, e, n, i, r) {
1349
+ const s = rr(t), o = sr(s, t, e, n, r);
1350
+ return o !== i && (o && (e = W(t, e, o, void 0, r)), s.set(n, i)), e;
1351
+ }
1352
+ function sr(t, e, n, i, r) {
1353
+ let s = t.get(i);
1354
+ if (s != null) return s;
1355
+ s = 0;
1356
+ for (let o = 0; o < i.length; o++) {
1357
+ const a = i[o];
1358
+ Ht(e, a, r) != null && (s !== 0 && (n = W(e, n, s, void 0, r)), s = a);
1359
+ }
1360
+ return t.set(i, s), s;
1361
+ }
1362
+ function or(t, e, n) {
1363
+ let i = 0 | t[p];
1364
+ const r = He(i), s = Ht(t, n, r);
1365
+ let o;
1366
+ if (s != null && s[Re] === Oe) {
1367
+ if (!ft(s)) return Ke(s), s.v;
1368
+ o = s.v;
1369
+ } else Array.isArray(s) && (o = s);
1370
+ if (o) {
1371
+ const a = 0 | o[p];
1372
+ 2 & a && (o = We(o, a));
1373
+ }
1374
+ return o = ue(o, e), o !== s && W(t, i, n, o, r), o;
1375
+ }
1376
+ function Mo(t, e, n, i, r) {
1377
+ let s = !1;
1378
+ if ((i = Ht(t, i, r, ((o) => {
1379
+ const a = Zi(o, n, !1, e);
1380
+ return s = a !== o && a != null, a;
1381
+ }))) != null) return s && !ft(i) && Ae(t, e), i;
1382
+ }
1383
+ function x(t, e, n, i) {
1384
+ let r = t.v, s = 0 | r[p];
1385
+ if ((e = Mo(r, s, e, n, i)) == null) return e;
1386
+ if (s = 0 | r[p], !ft(t, s)) {
1387
+ const o = tr(e);
1388
+ o !== e && (Ke(t) && (r = t.v, s = 0 | r[p]), s = W(r, s, n, e = o, i), Ae(r, s));
1389
+ }
1390
+ return e;
1391
+ }
1392
+ function Lo(t, e, n, i, r, s, o, a) {
1393
+ var c = ft(t, n);
1394
+ s = c ? 1 : s, o = !!o || s === 3, c = a && !c, (s === 2 || c) && Ke(t) && (n = 0 | (e = t.v)[p]);
1395
+ var h = (t = nr(e, r)) === ve ? 7 : 0 | t[p], l = ir(h, n);
1396
+ if (a = !(4 & l)) {
1397
+ var u = t, f = n;
1398
+ const v = !!(2 & l);
1399
+ v && (f |= 2);
1400
+ let b = !v, M = !0, L = 0, z = 0;
1401
+ for (; L < u.length; L++) {
1402
+ const tt = Zi(u[L], i, !1, f);
1403
+ if (tt instanceof i) {
1404
+ if (!v) {
1405
+ const vt = ft(tt);
1406
+ b && (b = !vt), M && (M = vt);
1407
+ }
1408
+ u[z++] = tt;
1409
+ }
1410
+ }
1411
+ z < L && (u.length = z), l |= 4, l = M ? -4097 & l : 4096 | l, l = b ? 8 | l : -9 & l;
1412
+ }
1413
+ if (l !== h && (q(t, l), 2 & l && Object.freeze(t)), c && !(8 & l || !t.length && (s === 1 || s === 4 && (2 & l || !(16 & l) && 32 & n)))) {
1414
+ for (de(l) && (t = Mt(t), l = fe(l, n), n = W(e, n, r, t)), i = t, c = l, h = 0; h < i.length; h++) (u = i[h]) !== (l = tr(u)) && (i[h] = l);
1415
+ c |= 8, q(t, l = c = i.length ? 4096 | c : -4097 & c);
1416
+ }
1417
+ return xo(t, l, e, n, r, s, a, o);
1418
+ }
1419
+ function zt(t, e, n) {
1420
+ const i = t.v;
1421
+ return Lo(t, i, 0 | i[p], e, n, he(), !1, !0);
1422
+ }
1423
+ function Fo(t) {
1424
+ return t == null && (t = void 0), t;
1425
+ }
1426
+ function _(t, e, n, i, r) {
1427
+ return S(t, n, i = Fo(i), r), i && !ft(i) && Ae(t.v), t;
1428
+ }
1429
+ function on(t, e, n, i) {
1430
+ t: {
1431
+ var r = i = Fo(i);
1432
+ qe(t);
1433
+ const s = t.v;
1434
+ let o = 0 | s[p];
1435
+ if (r == null) {
1436
+ const a = rr(s);
1437
+ if (sr(a, s, o, n) !== e) break t;
1438
+ a.set(n, 0);
1439
+ } else o = ko(s, o, n, e);
1440
+ W(s, o, e, r);
1441
+ }
1442
+ i && !ft(i) && Ae(t.v);
1443
+ }
1444
+ function fe(t, e) {
1445
+ return -273 & (2 & e ? 2 | t : -3 & t);
1446
+ }
1447
+ function ar(t, e, n, i) {
1448
+ var r = i;
1449
+ qe(t), t = Lo(t, i = t.v, 0 | i[p], n, e, 2, !0), r = r ?? new n(), t.push(r), e = n = t === ve ? 7 : 0 | t[p], (r = ft(r)) ? (n &= -9, t.length === 1 && (n &= -4097)) : n |= 4096, n !== e && q(t, n), r || Ae(i);
1450
+ }
1451
+ function xt(t, e, n) {
1452
+ return ze(P(t, e, void 0, n));
1453
+ }
1454
+ function Po(t) {
1455
+ return (Hi ? P(t, 2, void 0, void 0, Rn) : Rn(P(t, 2))) ?? l2;
1456
+ }
1457
+ function U(t, e) {
1458
+ return P(t, e, void 0, void 0, Nt) ?? 0;
1459
+ }
1460
+ function Wt(t, e, n) {
1461
+ if (n != null) {
1462
+ if (typeof n != "number" || !Hn(n)) throw Ei("int32");
1463
+ n |= 0;
1464
+ }
1465
+ S(t, e, n);
1466
+ }
1467
+ function y(t, e, n) {
1468
+ S(t, e, rn(n));
1469
+ }
1470
+ function pt(t, e, n) {
1471
+ Zt(t, e, _n(n), "");
1472
+ }
1473
+ function Nn(t, e, n) {
1474
+ {
1475
+ qe(t);
1476
+ const o = t.v;
1477
+ let a = 0 | o[p];
1478
+ if (n == null) W(o, a, e);
1479
+ else {
1480
+ var i = t = n === ve ? 7 : 0 | n[p], r = de(t), s = r || Object.isFrozen(n);
1481
+ for (r || (t = 0), s || (n = Mt(n), i = 0, t = fe(t, a), s = !1), t |= 5, t |= (4 & t ? 512 & t ? 512 : 1024 & t ? 1024 : 0 : void 0) ?? (Hi ? 1024 : 0), r = 0; r < n.length; r++) {
1482
+ const c = n[r], h = bo(c);
1483
+ Object.is(c, h) || (s && (n = Mt(n), i = 0, t = fe(t, a), s = !1), n[r] = h);
1484
+ }
1485
+ t !== i && (s && (n = Mt(n), t = fe(t, a)), q(n, t)), W(o, a, e, n);
1486
+ }
1487
+ }
1488
+ }
1489
+ function Kn(t, e, n) {
1490
+ qe(t), le(t, e, Z, 2, !0).push(bo(n));
1491
+ }
1492
+ var Ee = class {
1493
+ constructor(t, e, n) {
1494
+ if (this.buffer = t, n && !e) throw Error();
1495
+ this.g = e;
1496
+ }
1497
+ };
1498
+ function cr(t, e) {
1499
+ if (typeof t == "string") return new Ee(oo(t), e);
1500
+ if (Array.isArray(t)) return new Ee(new Uint8Array(t), e);
1501
+ if (t.constructor === Uint8Array) return new Ee(t, !1);
1502
+ if (t.constructor === ArrayBuffer) return t = new Uint8Array(t), new Ee(t, !1);
1503
+ if (t.constructor === Ct) return e = Wi(t) || new Uint8Array(0), new Ee(e, !0, t);
1504
+ if (t instanceof Uint8Array) return t = t.constructor === Uint8Array ? t : new Uint8Array(t.buffer, t.byteOffset, t.byteLength), new Ee(t, !1);
1505
+ throw Error();
1506
+ }
1507
+ function Ie(t, e) {
1508
+ let n, i = 0, r = 0, s = 0;
1509
+ const o = t.h;
1510
+ let a = t.g;
1511
+ do
1512
+ n = o[a++], i |= (127 & n) << s, s += 7;
1513
+ while (s < 32 && 128 & n);
1514
+ if (s > 32) for (r |= (127 & n) >> 4, s = 3; s < 32 && 128 & n; s += 7) n = o[a++], r |= (127 & n) << s;
1515
+ if (pe(t, a), !(128 & n)) return e(i >>> 0, r >>> 0);
1516
+ throw Error();
1517
+ }
1518
+ function hr(t) {
1519
+ let e = 0, n = t.g;
1520
+ const i = n + 10, r = t.h;
1521
+ for (; n < i; ) {
1522
+ const s = r[n++];
1523
+ if (e |= s, (128 & s) == 0) return pe(t, n), !!(127 & e);
1524
+ }
1525
+ throw Error();
1526
+ }
1527
+ function ee(t) {
1528
+ const e = t.h;
1529
+ let n = t.g, i = e[n++], r = 127 & i;
1530
+ if (128 & i && (i = e[n++], r |= (127 & i) << 7, 128 & i && (i = e[n++], r |= (127 & i) << 14, 128 & i && (i = e[n++], r |= (127 & i) << 21, 128 & i && (i = e[n++], r |= i << 28, 128 & i && 128 & e[n++] && 128 & e[n++] && 128 & e[n++] && 128 & e[n++] && 128 & e[n++]))))) throw Error();
1531
+ return pe(t, n), r;
1532
+ }
1533
+ function Kt(t) {
1534
+ return ee(t) >>> 0;
1535
+ }
1536
+ function Cn(t) {
1537
+ var e = t.h;
1538
+ const n = t.g;
1539
+ var i = e[n], r = e[n + 1];
1540
+ const s = e[n + 2];
1541
+ return e = e[n + 3], pe(t, t.g + 4), t = 2 * ((r = (i << 0 | r << 8 | s << 16 | e << 24) >>> 0) >> 31) + 1, i = r >>> 23 & 255, r &= 8388607, i == 255 ? r ? NaN : t * (1 / 0) : i == 0 ? 1401298464324817e-60 * t * r : t * Math.pow(2, i - 150) * (r + 8388608);
1542
+ }
1543
+ function u2(t) {
1544
+ return ee(t);
1545
+ }
1546
+ function pe(t, e) {
1547
+ if (t.g = e, e > t.l) throw Error();
1548
+ }
1549
+ function Ro(t, e) {
1550
+ if (e < 0) throw Error();
1551
+ const n = t.g;
1552
+ if ((e = n + e) > t.l) throw Error();
1553
+ return t.g = e, n;
1554
+ }
1555
+ function Oo(t, e) {
1556
+ if (e == 0) return me();
1557
+ var n = Ro(t, e);
1558
+ return t.Y && t.j ? n = t.h.subarray(n, n + e) : (t = t.h, n = n === (e = n + e) ? new Uint8Array(0) : z1 ? t.slice(n, e) : new Uint8Array(t.subarray(n, e))), n.length == 0 ? me() : new Ct(n, Fe);
1559
+ }
1560
+ var ps = [];
1561
+ function No(t, e, n, i) {
1562
+ if (In.length) {
1563
+ const r = In.pop();
1564
+ return r.o(i), r.g.init(t, e, n, i), r;
1565
+ }
1566
+ return new d2(t, e, n, i);
1567
+ }
1568
+ function Co(t) {
1569
+ t.g.clear(), t.l = -1, t.h = -1, In.length < 100 && In.push(t);
1570
+ }
1571
+ function Io(t) {
1572
+ var e = t.g;
1573
+ if (e.g == e.l) return !1;
1574
+ t.m = t.g.g;
1575
+ var n = Kt(t.g);
1576
+ if (e = n >>> 3, !((n &= 7) >= 0 && n <= 5) || e < 1) throw Error();
1577
+ return t.l = e, t.h = n, !0;
1578
+ }
1579
+ function Ln(t) {
1580
+ switch (t.h) {
1581
+ case 0:
1582
+ t.h != 0 ? Ln(t) : hr(t.g);
1583
+ break;
1584
+ case 1:
1585
+ pe(t = t.g, t.g + 8);
1586
+ break;
1587
+ case 2:
1588
+ if (t.h != 2) Ln(t);
1589
+ else {
1590
+ var e = Kt(t.g);
1591
+ pe(t = t.g, t.g + e);
1592
+ }
1593
+ break;
1594
+ case 5:
1595
+ pe(t = t.g, t.g + 4);
1596
+ break;
1597
+ case 3:
1598
+ for (e = t.l; ; ) {
1599
+ if (!Io(t)) throw Error();
1600
+ if (t.h == 4) {
1601
+ if (t.l != e) throw Error();
1602
+ break;
1603
+ }
1604
+ Ln(t);
1605
+ }
1606
+ break;
1607
+ default:
1608
+ throw Error();
1609
+ }
1610
+ }
1611
+ function vn(t, e, n) {
1612
+ const i = t.g.l;
1613
+ var r = Kt(t.g);
1614
+ let s = (r = t.g.g + r) - i;
1615
+ if (s <= 0 && (t.g.l = r, n(e, t, void 0, void 0, void 0), s = r - t.g.g), s) throw Error();
1616
+ return t.g.g = r, t.g.l = i, e;
1617
+ }
1618
+ function lr(t) {
1619
+ var e = Kt(t.g), n = Ro(t = t.g, e);
1620
+ if (t = t.h, E1) {
1621
+ var i, r = t;
1622
+ (i = fi) || (i = fi = new TextDecoder("utf-8", { fatal: !0 })), e = n + e, r = n === 0 && e === r.length ? r : r.subarray(n, e);
1623
+ try {
1624
+ var s = i.decode(r);
1625
+ } catch (a) {
1626
+ if (Tn === void 0) {
1627
+ try {
1628
+ i.decode(new Uint8Array([128]));
1629
+ } catch {
1630
+ }
1631
+ try {
1632
+ i.decode(new Uint8Array([97])), Tn = !0;
1633
+ } catch {
1634
+ Tn = !1;
1635
+ }
1636
+ }
1637
+ throw !Tn && (fi = void 0), a;
1638
+ }
1639
+ } else {
1640
+ e = (s = n) + e, n = [];
1641
+ let a, c = null;
1642
+ for (; s < e; ) {
1643
+ var o = t[s++];
1644
+ o < 128 ? n.push(o) : o < 224 ? s >= e ? se() : (a = t[s++], o < 194 || (192 & a) != 128 ? (s--, se()) : n.push((31 & o) << 6 | 63 & a)) : o < 240 ? s >= e - 1 ? se() : (a = t[s++], (192 & a) != 128 || o === 224 && a < 160 || o === 237 && a >= 160 || (192 & (i = t[s++])) != 128 ? (s--, se()) : n.push((15 & o) << 12 | (63 & a) << 6 | 63 & i)) : o <= 244 ? s >= e - 2 ? se() : (a = t[s++], (192 & a) != 128 || a - 144 + (o << 28) >> 30 != 0 || (192 & (i = t[s++])) != 128 || (192 & (r = t[s++])) != 128 ? (s--, se()) : (o = (7 & o) << 18 | (63 & a) << 12 | (63 & i) << 6 | 63 & r, o -= 65536, n.push(55296 + (o >> 10 & 1023), 56320 + (1023 & o)))) : se(), n.length >= 8192 && (c = Jr(c, n), n.length = 0);
1645
+ }
1646
+ s = Jr(c, n);
1647
+ }
1648
+ return s;
1649
+ }
1650
+ function Do(t) {
1651
+ const e = Kt(t.g);
1652
+ return Oo(t.g, e);
1653
+ }
1654
+ function qn(t, e, n) {
1655
+ var i = Kt(t.g);
1656
+ for (i = t.g.g + i; t.g.g < i; ) n.push(e(t.g));
1657
+ }
1658
+ var d2 = class {
1659
+ constructor(t, e, n, i) {
1660
+ if (ps.length) {
1661
+ const r = ps.pop();
1662
+ r.init(t, e, n, i), t = r;
1663
+ } else t = new class {
1664
+ constructor(r, s, o, a) {
1665
+ this.h = null, this.j = !1, this.g = this.l = this.m = 0, this.init(r, s, o, a);
1666
+ }
1667
+ init(r, s, o, { Y: a = !1, ea: c = !1 } = {}) {
1668
+ this.Y = a, this.ea = c, r && (r = cr(r, this.ea), this.h = r.buffer, this.j = r.g, this.m = s || 0, this.l = o !== void 0 ? this.m + o : this.h.length, this.g = this.m);
1669
+ }
1670
+ clear() {
1671
+ this.h = null, this.j = !1, this.g = this.l = this.m = 0, this.Y = !1;
1672
+ }
1673
+ }(t, e, n, i);
1674
+ this.g = t, this.m = this.g.g, this.h = this.l = -1, this.o(i);
1675
+ }
1676
+ o({ ha: t = !1 } = {}) {
1677
+ this.ha = t;
1678
+ }
1679
+ }, In = [];
1680
+ function gs(t) {
1681
+ return t ? /^\d+$/.test(t) ? (Gn(t), new Mi(O, j)) : null : f2 || (f2 = new Mi(0, 0));
1682
+ }
1683
+ var Mi = class {
1684
+ constructor(t, e) {
1685
+ this.h = t >>> 0, this.g = e >>> 0;
1686
+ }
1687
+ };
1688
+ let f2;
1689
+ function ms(t) {
1690
+ return t ? /^-?\d+$/.test(t) ? (Gn(t), new Li(O, j)) : null : p2 || (p2 = new Li(0, 0));
1691
+ }
1692
+ var Li = class {
1693
+ constructor(t, e) {
1694
+ this.h = t >>> 0, this.g = e >>> 0;
1695
+ }
1696
+ };
1697
+ let p2;
1698
+ function Se(t, e, n) {
1699
+ for (; n > 0 || e > 127; ) t.g.push(127 & e | 128), e = (e >>> 7 | n << 25) >>> 0, n >>>= 7;
1700
+ t.g.push(e);
1701
+ }
1702
+ function Ye(t, e) {
1703
+ for (; e > 127; ) t.g.push(127 & e | 128), e >>>= 7;
1704
+ t.g.push(e);
1705
+ }
1706
+ function Xn(t, e) {
1707
+ if (e >= 0) Ye(t, e);
1708
+ else {
1709
+ for (let n = 0; n < 9; n++) t.g.push(127 & e | 128), e >>= 7;
1710
+ t.g.push(1);
1711
+ }
1712
+ }
1713
+ function ur(t) {
1714
+ var e = O;
1715
+ t.g.push(e >>> 0 & 255), t.g.push(e >>> 8 & 255), t.g.push(e >>> 16 & 255), t.g.push(e >>> 24 & 255);
1716
+ }
1717
+ function De(t, e) {
1718
+ e.length !== 0 && (t.l.push(e), t.h += e.length);
1719
+ }
1720
+ function Tt(t, e, n) {
1721
+ Ye(t.g, 8 * e + n);
1722
+ }
1723
+ function dr(t, e) {
1724
+ return Tt(t, e, 2), e = t.g.end(), De(t, e), e.push(t.h), e;
1725
+ }
1726
+ function fr(t, e) {
1727
+ var n = e.pop();
1728
+ for (n = t.h + t.g.length() - n; n > 127; ) e.push(127 & n | 128), n >>>= 7, t.h++;
1729
+ e.push(n), t.h++;
1730
+ }
1731
+ function Yn(t, e, n) {
1732
+ Tt(t, e, 2), Ye(t.g, n.length), De(t, t.g.end()), De(t, n);
1733
+ }
1734
+ function Dn(t, e, n, i) {
1735
+ n != null && (e = dr(t, e), i(n, t), fr(t, e));
1736
+ }
1737
+ function Dt() {
1738
+ const t = class {
1739
+ constructor() {
1740
+ throw Error();
1741
+ }
1742
+ };
1743
+ return Object.setPrototypeOf(t, t.prototype), t;
1744
+ }
1745
+ var pr = Dt(), Bo = Dt(), gr = Dt(), mr = Dt(), Uo = Dt(), Vo = Dt(), g2 = Dt(), $n = Dt(), jo = Dt(), Go = Dt();
1746
+ function Bt(t, e, n) {
1747
+ var i = t.v;
1748
+ ut && ut in i && (i = i[ut]) && delete i[e.g], e.h ? e.j(t, e.h, e.g, n, e.l) : e.j(t, e.g, n, e.l);
1749
+ }
1750
+ var g = class {
1751
+ constructor(t, e) {
1752
+ this.v = Eo(t, e, void 0, 2048);
1753
+ }
1754
+ toJSON() {
1755
+ return wo(this);
1756
+ }
1757
+ j() {
1758
+ var r;
1759
+ var t = J2, e = this.v, n = t.g, i = ut;
1760
+ if (Ge && i && ((r = e[i]) == null ? void 0 : r[n]) != null && Pe(N1, 3), e = t.g, is && ut && is === void 0 && (i = (n = this.v)[ut]) && (i = i.da)) try {
1761
+ i(n, e, r2);
1762
+ } catch (s) {
1763
+ no(s);
1764
+ }
1765
+ return t.h ? t.m(this, t.h, t.g, t.l) : t.m(this, t.g, t.defaultValue, t.l);
1766
+ }
1767
+ clone() {
1768
+ const t = this.v, e = 0 | t[p];
1769
+ return er(this, t, e) ? Qi(this, t, !0) : new this.constructor(We(t, e, !1));
1770
+ }
1771
+ };
1772
+ g.prototype[Re] = Oe, g.prototype.toString = function() {
1773
+ return this.v.toString();
1774
+ };
1775
+ var $e = class {
1776
+ constructor(t, e, n) {
1777
+ this.g = t, this.h = e, t = pr, this.l = !!t && n === t || !1;
1778
+ }
1779
+ };
1780
+ function Jn(t, e) {
1781
+ return new $e(t, e, pr);
1782
+ }
1783
+ function Ho(t, e, n, i, r) {
1784
+ Dn(t, n, qo(e, i), r);
1785
+ }
1786
+ const m2 = Jn((function(t, e, n, i, r) {
1787
+ return t.h === 2 && (vn(t, or(e, i, n), r), !0);
1788
+ }), Ho), y2 = Jn((function(t, e, n, i, r) {
1789
+ return t.h === 2 && (vn(t, or(e, i, n), r), !0);
1790
+ }), Ho);
1791
+ var Zn = Symbol(), Qn = Symbol(), Fi = Symbol(), ys = Symbol(), _s = Symbol();
1792
+ let zo, Wo;
1793
+ function be(t, e, n, i) {
1794
+ var r = i[t];
1795
+ if (r) return r;
1796
+ (r = {}).qa = i, r.T = (function(u) {
1797
+ switch (typeof u) {
1798
+ case "boolean":
1799
+ return a2 || (a2 = [0, void 0, !0]);
1800
+ case "number":
1801
+ return u > 0 ? void 0 : u === 0 ? c2 || (c2 = [0, void 0]) : [-u, void 0];
1802
+ case "string":
1803
+ return [0, u];
1804
+ case "object":
1805
+ return u;
1806
+ }
1807
+ })(i[0]);
1808
+ var s = i[1];
1809
+ let o = 1;
1810
+ s && s.constructor === Object && (r.ba = s, typeof (s = i[++o]) == "function" && (r.ma = !0, zo ?? (zo = s), Wo ?? (Wo = i[o + 1]), s = i[o += 2]));
1811
+ const a = {};
1812
+ for (; s && Array.isArray(s) && s.length && typeof s[0] == "number" && s[0] > 0; ) {
1813
+ for (var c = 0; c < s.length; c++) a[s[c]] = s;
1814
+ s = i[++o];
1815
+ }
1816
+ for (c = 1; s !== void 0; ) {
1817
+ let u;
1818
+ typeof s == "number" && (c += s, s = i[++o]);
1819
+ var h = void 0;
1820
+ if (s instanceof $e ? u = s : (u = m2, o--), u == null ? void 0 : u.l) {
1821
+ s = i[++o], h = i;
1822
+ var l = o;
1823
+ typeof s == "function" && (s = s(), h[l] = s), h = s;
1824
+ }
1825
+ for (l = c + 1, typeof (s = i[++o]) == "number" && s < 0 && (l -= s, s = i[++o]); c < l; c++) {
1826
+ const f = a[c];
1827
+ h ? n(r, c, u, h, f) : e(r, c, u, f);
1828
+ }
1829
+ }
1830
+ return i[t] = r;
1831
+ }
1832
+ function Ko(t) {
1833
+ return Array.isArray(t) ? t[0] instanceof $e ? t : [y2, t] : [t, void 0];
1834
+ }
1835
+ function qo(t, e) {
1836
+ return t instanceof g ? t.v : Array.isArray(t) ? ue(t, e) : void 0;
1837
+ }
1838
+ function yr(t, e, n, i) {
1839
+ const r = n.g;
1840
+ t[e] = i ? (s, o, a) => r(s, o, a, i) : r;
1841
+ }
1842
+ function _r(t, e, n, i, r) {
1843
+ const s = n.g;
1844
+ let o, a;
1845
+ t[e] = (c, h, l) => s(c, h, l, a || (a = be(Qn, yr, _r, i).T), o || (o = vr(i)), r);
1846
+ }
1847
+ function vr(t) {
1848
+ let e = t[Fi];
1849
+ if (e != null) return e;
1850
+ const n = be(Qn, yr, _r, t);
1851
+ return e = n.ma ? (i, r) => zo(i, r, n) : (i, r) => {
1852
+ for (; Io(r) && r.h != 4; ) {
1853
+ var s = r.l, o = n[s];
1854
+ if (o == null) {
1855
+ var a = n.ba;
1856
+ a && (a = a[s]) && (a = v2(a)) != null && (o = n[s] = a);
1857
+ }
1858
+ if (o == null || !o(r, i, s)) {
1859
+ if (o = (a = r).m, Ln(a), a.ha) var c = void 0;
1860
+ else c = a.g.g - o, a.g.g = o, c = Oo(a.g, c);
1861
+ o = void 0, a = i, c && ((o = a[ut] ?? (a[ut] = new ki()))[s] ?? (o[s] = [])).push(c);
1862
+ }
1863
+ }
1864
+ return (i = zn(i)) && (i.da = n.qa[_s]), !0;
1865
+ }, t[Fi] = e, t[_s] = _2.bind(t), e;
1866
+ }
1867
+ function _2(t, e, n, i) {
1868
+ var r = this[Qn];
1869
+ const s = this[Fi], o = ue(void 0, r.T), a = zn(t);
1870
+ if (a) {
1871
+ var c = !1, h = r.ba;
1872
+ if (h) {
1873
+ if (r = (l, u, f) => {
1874
+ if (f.length !== 0) if (h[u]) for (const v of f) {
1875
+ l = No(v);
1876
+ try {
1877
+ c = !0, s(o, l);
1878
+ } finally {
1879
+ Co(l);
1880
+ }
1881
+ }
1882
+ else i == null || i(t, u, f);
1883
+ }, e == null) On(a, r);
1884
+ else if (a != null) {
1885
+ const l = a[e];
1886
+ l && r(a, e, l);
1887
+ }
1888
+ if (c) {
1889
+ let l = 0 | t[p];
1890
+ if (2 & l && 2048 & l && !(n != null && n.Ka)) throw Error();
1891
+ const u = He(l), f = (v, b) => {
1892
+ if (Ht(t, v, u) != null) {
1893
+ if ((n == null ? void 0 : n.Qa) === 1) return;
1894
+ throw Error();
1895
+ }
1896
+ b != null && (l = W(t, l, v, b, u)), delete a[v];
1897
+ };
1898
+ e == null ? uo(o, 0 | o[p], ((v, b) => {
1899
+ f(v, b);
1900
+ })) : f(e, Ht(o, e, u));
1901
+ }
1902
+ }
1903
+ }
1904
+ }
1905
+ function v2(t) {
1906
+ const e = (t = Ko(t))[0].g;
1907
+ if (t = t[1]) {
1908
+ const n = vr(t), i = be(Qn, yr, _r, t).T;
1909
+ return (r, s, o) => e(r, s, o, i, n);
1910
+ }
1911
+ return e;
1912
+ }
1913
+ function ti(t, e, n) {
1914
+ t[e] = n.h;
1915
+ }
1916
+ function ei(t, e, n, i) {
1917
+ let r, s;
1918
+ const o = n.h;
1919
+ t[e] = (a, c, h) => o(a, c, h, s || (s = be(Zn, ti, ei, i).T), r || (r = Xo(i)));
1920
+ }
1921
+ function Xo(t) {
1922
+ let e = t[ys];
1923
+ if (!e) {
1924
+ const n = be(Zn, ti, ei, t);
1925
+ e = (i, r) => Yo(i, r, n), t[ys] = e;
1926
+ }
1927
+ return e;
1928
+ }
1929
+ function Yo(t, e, n) {
1930
+ uo(t, 0 | t[p], ((i, r) => {
1931
+ if (r != null) {
1932
+ var s = (function(o, a) {
1933
+ var c = o[a];
1934
+ if (c) return c;
1935
+ if ((c = o.ba) && (c = c[a])) {
1936
+ var h = (c = Ko(c))[0].h;
1937
+ if (c = c[1]) {
1938
+ const l = Xo(c), u = be(Zn, ti, ei, c).T;
1939
+ c = o.ma ? Wo(u, l) : (f, v, b) => h(f, v, b, u, l);
1940
+ } else c = h;
1941
+ return o[a] = c;
1942
+ }
1943
+ })(n, i);
1944
+ s ? s(e, r, i) : i < 500 || Pe(xi, 3);
1945
+ }
1946
+ })), (t = zn(t)) && On(t, ((i, r, s) => {
1947
+ for (De(e, e.g.end()), i = 0; i < s.length; i++) De(e, Wi(s[i]) || new Uint8Array(0));
1948
+ }));
1949
+ }
1950
+ const A2 = dt(0);
1951
+ function Je(t, e) {
1952
+ if (Array.isArray(e)) {
1953
+ var n = 0 | e[p];
1954
+ if (4 & n) return e;
1955
+ for (var i = 0, r = 0; i < e.length; i++) {
1956
+ const s = t(e[i]);
1957
+ s != null && (e[r++] = s);
1958
+ }
1959
+ return r < i && (e.length = r), (t = -1537 & (5 | n)) !== n && q(e, t), 2 & t && Object.freeze(e), e;
1960
+ }
1961
+ }
1962
+ function et(t, e, n) {
1963
+ return new $e(t, e, n);
1964
+ }
1965
+ function Ze(t, e, n) {
1966
+ return new $e(t, e, n);
1967
+ }
1968
+ function J(t, e, n) {
1969
+ W(t, 0 | t[p], e, n, He(0 | t[p]));
1970
+ }
1971
+ var b2 = Jn((function(t, e, n, i, r) {
1972
+ if (t.h !== 2) return !1;
1973
+ if (t = Mt(t = vn(t, ue([void 0, void 0], i), r)), r = He(i = 0 | e[p]), 2 & i) throw Error();
1974
+ let s = Ht(e, n, r);
1975
+ if (s instanceof Gt) (2 & s.J) != 0 ? (s = s.V(), s.push(t), W(e, i, n, s, r)) : s.Ma(t);
1976
+ else if (Array.isArray(s)) {
1977
+ var o = 0 | s[p];
1978
+ 8192 & o || q(s, o |= 8192), 2 & o && (s = So(s), W(e, i, n, s, r)), s.push(t);
1979
+ } else W(e, i, n, ln([t]), r);
1980
+ return !0;
1981
+ }), (function(t, e, n, i, r) {
1982
+ if (e instanceof Gt) e.forEach(((s, o) => {
1983
+ Dn(t, n, ue([o, s], i), r);
1984
+ }));
1985
+ else if (Array.isArray(e)) {
1986
+ for (let s = 0; s < e.length; s++) {
1987
+ const o = e[s];
1988
+ Array.isArray(o) && Dn(t, n, ue(o, i), r);
1989
+ }
1990
+ ln(e);
1991
+ }
1992
+ }));
1993
+ function $o(t, e, n) {
1994
+ (e = Nt(e)) != null && (Tt(t, n, 5), t = t.g, qi(e), ur(t));
1995
+ }
1996
+ function Jo(t, e, n) {
1997
+ if (e = (function(i) {
1998
+ if (i == null) return i;
1999
+ const r = typeof i;
2000
+ if (r === "bigint") return String(mn(64, i));
2001
+ if (yn(i)) {
2002
+ if (r === "string") return _o(i);
2003
+ if (r === "number") return Ji(i);
2004
+ }
2005
+ })(e), e != null && (typeof e == "string" && ms(e), e != null))
2006
+ switch (Tt(t, n, 0), typeof e) {
2007
+ case "number":
2008
+ t = t.g, Ne(e), Se(t, O, j);
2009
+ break;
2010
+ case "bigint":
2011
+ n = BigInt.asUintN(64, e), n = new Li(Number(n & BigInt(4294967295)), Number(n >> BigInt(32))), Se(t.g, n.h, n.g);
2012
+ break;
2013
+ default:
2014
+ n = ms(e), Se(t.g, n.h, n.g);
2015
+ }
2016
+ }
2017
+ function Zo(t, e, n) {
2018
+ (e = ze(e)) != null && e != null && (Tt(t, n, 0), Xn(t.g, e));
2019
+ }
2020
+ function Qo(t, e, n) {
2021
+ (e = go(e)) != null && (Tt(t, n, 0), t.g.g.push(e ? 1 : 0));
2022
+ }
2023
+ function ta(t, e, n) {
2024
+ (e = Z(e)) != null && Yn(t, n, eo(e));
2025
+ }
2026
+ function ea(t, e, n, i, r) {
2027
+ Dn(t, n, qo(e, i), r);
2028
+ }
2029
+ function na(t, e, n) {
2030
+ (e = e == null || typeof e == "string" || e instanceof Ct ? e : void 0) != null && Yn(t, n, cr(e, !0).buffer);
2031
+ }
2032
+ function ia(t, e, n) {
2033
+ return (t.h === 5 || t.h === 2) && (e = Xe(e, 0 | e[p], n), t.h == 2 ? qn(t, Cn, e) : e.push(Cn(t.g)), !0);
2034
+ }
2035
+ var G = et((function(t, e, n) {
2036
+ return t.h === 5 && (J(e, n, Cn(t.g)), !0);
2037
+ }), $o, $n), w2 = Ze(ia, (function(t, e, n) {
2038
+ if ((e = Je(Nt, e)) != null) for (let o = 0; o < e.length; o++) {
2039
+ var i = t, r = n, s = e[o];
2040
+ s != null && (Tt(i, r, 5), i = i.g, qi(s), ur(i));
2041
+ }
2042
+ }), $n), Ar = Ze(ia, (function(t, e, n) {
2043
+ if ((e = Je(Nt, e)) != null && e.length) {
2044
+ Tt(t, n, 2), Ye(t.g, 4 * e.length);
2045
+ for (let i = 0; i < e.length; i++) n = t.g, qi(e[i]), ur(n);
2046
+ }
2047
+ }), $n), E2 = et((function(t, e, n) {
2048
+ return t.h === 5 && (J(e, n, (t = Cn(t.g)) === 0 ? void 0 : t), !0);
2049
+ }), $o, $n), ne = et((function(t, e, n) {
2050
+ return Gi ? (t.h !== 0 ? t = !1 : (J(e, n, Ie(t.g, po)), t = !0), t) : t.h === 0 && (J(e, n, Ie(t.g, Xi)), !0);
2051
+ }), Jo, Vo), yi = et((function(t, e, n) {
2052
+ return Gi ? (t.h !== 0 ? e = !1 : (J(e, n, (t = Ie(t.g, po)) === A2 ? void 0 : t), e = !0), e) : t.h === 0 && (J(e, n, (t = Ie(t.g, Xi)) === 0 ? void 0 : t), !0);
2053
+ }), Jo, Vo), x2 = et((function(t, e, n) {
2054
+ return Gi ? (t.h !== 0 ? t = !1 : (J(e, n, Ie(t.g, K1)), t = !0), t) : t.h === 0 && (J(e, n, Ie(t.g, Si)), !0);
2055
+ }), (function(t, e, n) {
2056
+ if (e = (function(i) {
2057
+ if (i == null) return i;
2058
+ var r = typeof i;
2059
+ if (r === "bigint") return String(q1(64, i));
2060
+ if (yn(i)) {
2061
+ if (r === "string") return r = Ce(Number(i)), _e(r) && r >= 0 ? i = String(r) : ((r = i.indexOf(".")) !== -1 && (i = i.substring(0, r)), (r = i[0] !== "-" && ((r = i.length) < 20 || r === 20 && i <= "18446744073709551615")) || (Gn(i), i = un(O, j))), i;
2062
+ if (r === "number") return (i = Ce(i)) >= 0 && _e(i) || (Ne(i), i = Si(O, j)), i;
2063
+ }
2064
+ })(e), e != null && (typeof e == "string" && gs(e), e != null))
2065
+ switch (Tt(t, n, 0), typeof e) {
2066
+ case "number":
2067
+ t = t.g, Ne(e), Se(t, O, j);
2068
+ break;
2069
+ case "bigint":
2070
+ n = BigInt.asUintN(64, e), n = new Mi(Number(n & BigInt(4294967295)), Number(n >> BigInt(32))), Se(t.g, n.h, n.g);
2071
+ break;
2072
+ default:
2073
+ n = gs(e), Se(t.g, n.h, n.g);
2074
+ }
2075
+ }), g2), $ = et((function(t, e, n) {
2076
+ return t.h === 0 && (J(e, n, ee(t.g)), !0);
2077
+ }), Zo, mr), An = Ze((function(t, e, n) {
2078
+ return (t.h === 0 || t.h === 2) && (e = Xe(e, 0 | e[p], n), t.h == 2 ? qn(t, ee, e) : e.push(ee(t.g)), !0);
2079
+ }), (function(t, e, n) {
2080
+ if ((e = Je(ze, e)) != null && e.length) {
2081
+ n = dr(t, n);
2082
+ for (let i = 0; i < e.length; i++) Xn(t.g, e[i]);
2083
+ fr(t, n);
2084
+ }
2085
+ }), mr), Te = et((function(t, e, n) {
2086
+ return t.h === 0 && (J(e, n, (t = ee(t.g)) === 0 ? void 0 : t), !0);
2087
+ }), Zo, mr), V = et((function(t, e, n) {
2088
+ return t.h === 0 && (J(e, n, hr(t.g)), !0);
2089
+ }), Qo, Bo), ge = et((function(t, e, n) {
2090
+ return t.h === 0 && (J(e, n, (t = hr(t.g)) === !1 ? void 0 : t), !0);
2091
+ }), Qo, Bo), Q = Ze((function(t, e, n) {
2092
+ return t.h === 2 && (t = lr(t), Xe(e, 0 | e[p], n).push(t), !0);
2093
+ }), (function(t, e, n) {
2094
+ if ((e = Je(Z, e)) != null) for (let o = 0; o < e.length; o++) {
2095
+ var i = t, r = n, s = e[o];
2096
+ s != null && Yn(i, r, eo(s));
2097
+ }
2098
+ }), gr), Qt = et((function(t, e, n) {
2099
+ return t.h === 2 && (J(e, n, (t = lr(t)) === "" ? void 0 : t), !0);
2100
+ }), ta, gr), k = et((function(t, e, n) {
2101
+ return t.h === 2 && (J(e, n, lr(t)), !0);
2102
+ }), ta, gr), Y = (function(t, e, n = pr) {
2103
+ return new $e(t, e, n);
2104
+ })((function(t, e, n, i, r) {
2105
+ return t.h === 2 && (i = ue(void 0, i), Xe(e, 0 | e[p], n).push(i), vn(t, i, r), !0);
2106
+ }), (function(t, e, n, i, r) {
2107
+ if (Array.isArray(e)) {
2108
+ for (let s = 0; s < e.length; s++) ea(t, e[s], n, i, r);
2109
+ 1 & (t = 0 | e[p]) || q(e, 1 | t);
2110
+ }
2111
+ })), B = Jn((function(t, e, n, i, r, s) {
2112
+ if (t.h !== 2) return !1;
2113
+ let o = 0 | e[p];
2114
+ return ko(e, o, s, n, He(o)), vn(t, e = or(e, i, n), r), !0;
2115
+ }), ea), ra = et((function(t, e, n) {
2116
+ return t.h === 2 && (J(e, n, Do(t)), !0);
2117
+ }), na, jo), T2 = Ze((function(t, e, n) {
2118
+ return (t.h === 0 || t.h === 2) && (e = Xe(e, 0 | e[p], n), t.h == 2 ? qn(t, Kt, e) : e.push(Kt(t.g)), !0);
2119
+ }), (function(t, e, n) {
2120
+ if ((e = Je(mo, e)) != null) for (let o = 0; o < e.length; o++) {
2121
+ var i = t, r = n, s = e[o];
2122
+ s != null && (Tt(i, r, 0), Ye(i.g, s));
2123
+ }
2124
+ }), Uo), S2 = et((function(t, e, n) {
2125
+ return t.h === 0 && (J(e, n, (t = Kt(t.g)) === 0 ? void 0 : t), !0);
2126
+ }), (function(t, e, n) {
2127
+ (e = mo(e)) != null && e != null && (Tt(t, n, 0), Ye(t.g, e));
2128
+ }), Uo), gt = et((function(t, e, n) {
2129
+ return t.h === 0 && (J(e, n, ee(t.g)), !0);
2130
+ }), (function(t, e, n) {
2131
+ (e = ze(e)) != null && (e = parseInt(e, 10), Tt(t, n, 0), Xn(t.g, e));
2132
+ }), Go);
2133
+ class k2 {
2134
+ constructor(e, n) {
2135
+ var i = yt;
2136
+ this.g = e, this.h = n, this.m = x, this.j = _, this.defaultValue = void 0, this.l = i.Oa != null ? fo : void 0;
2137
+ }
2138
+ register() {
2139
+ Un(this);
2140
+ }
2141
+ }
2142
+ function Ut(t, e) {
2143
+ return new k2(t, e);
2144
+ }
2145
+ function ie(t, e) {
2146
+ return (n, i) => {
2147
+ {
2148
+ const s = { ea: !0 };
2149
+ i && Object.assign(s, i), n = No(n, void 0, void 0, s);
2150
+ try {
2151
+ const o = new t(), a = o.v;
2152
+ vr(e)(a, n);
2153
+ var r = o;
2154
+ } finally {
2155
+ Co(n);
2156
+ }
2157
+ }
2158
+ return r;
2159
+ };
2160
+ }
2161
+ function ni(t) {
2162
+ return function() {
2163
+ const e = new class {
2164
+ constructor() {
2165
+ this.l = [], this.h = 0, this.g = new class {
2166
+ constructor() {
2167
+ this.g = [];
2168
+ }
2169
+ length() {
2170
+ return this.g.length;
2171
+ }
2172
+ end() {
2173
+ const o = this.g;
2174
+ return this.g = [], o;
2175
+ }
2176
+ }();
2177
+ }
2178
+ }();
2179
+ Yo(this.v, e, be(Zn, ti, ei, t)), De(e, e.g.end());
2180
+ const n = new Uint8Array(e.h), i = e.l, r = i.length;
2181
+ let s = 0;
2182
+ for (let o = 0; o < r; o++) {
2183
+ const a = i[o];
2184
+ n.set(a, s), s += a.length;
2185
+ }
2186
+ return e.l = [n], n;
2187
+ };
2188
+ }
2189
+ var vs = class extends g {
2190
+ constructor(t) {
2191
+ super(t);
2192
+ }
2193
+ }, As = [0, Qt, et((function(t, e, n) {
2194
+ return t.h === 2 && (J(e, n, (t = Do(t)) === me() ? void 0 : t), !0);
2195
+ }), (function(t, e, n) {
2196
+ if (e != null) {
2197
+ if (e instanceof g) {
2198
+ const i = e.Ra;
2199
+ return void (i ? (e = i(e), e != null && Yn(t, n, cr(e, !0).buffer)) : Pe(xi, 3));
2200
+ }
2201
+ if (Array.isArray(e)) return void Pe(xi, 3);
2202
+ }
2203
+ na(t, e, n);
2204
+ }), jo)];
2205
+ let _i, bs = globalThis.trustedTypes;
2206
+ function ws(t) {
2207
+ var e;
2208
+ return _i === void 0 && (_i = (function() {
2209
+ let n = null;
2210
+ if (!bs) return n;
2211
+ try {
2212
+ const i = (r) => r;
2213
+ n = bs.createPolicy("goog#html", { createHTML: i, createScript: i, createScriptURL: i });
2214
+ } catch {
2215
+ }
2216
+ return n;
2217
+ })()), t = (e = _i) ? e.createScriptURL(t) : t, new class {
2218
+ constructor(n) {
2219
+ this.g = n;
2220
+ }
2221
+ toString() {
2222
+ return this.g + "";
2223
+ }
2224
+ }(t);
2225
+ }
2226
+ function M2(t, ...e) {
2227
+ if (e.length === 0) return ws(t[0]);
2228
+ let n = t[0];
2229
+ for (let i = 0; i < e.length; i++) n += encodeURIComponent(e[i]) + t[i + 1];
2230
+ return ws(n);
2231
+ }
2232
+ var sa = [0, $, gt, V, -1, An, gt, -1, V], L2 = class extends g {
2233
+ constructor(t) {
2234
+ super(t);
2235
+ }
2236
+ }, oa = [0, V, k, V, gt, -1, Ze((function(t, e, n) {
2237
+ return (t.h === 0 || t.h === 2) && (e = Xe(e, 0 | e[p], n), t.h == 2 ? qn(t, u2, e) : e.push(ee(t.g)), !0);
2238
+ }), (function(t, e, n) {
2239
+ if ((e = Je(ze, e)) != null && e.length) {
2240
+ n = dr(t, n);
2241
+ for (let i = 0; i < e.length; i++) Xn(t.g, e[i]);
2242
+ fr(t, n);
2243
+ }
2244
+ }), Go), k, -1, [0, V, -1], gt, V, -1], aa = [0, 3, V, -1, 2, [0, $], [0, gt, V], [0, k, -1], [0]], ca = [0, k, -2], Es = class extends g {
2245
+ constructor(t) {
2246
+ super(t);
2247
+ }
2248
+ }, ha = [0], la = [0, $, V, 1, V, -4], yt = class extends g {
2249
+ constructor(t) {
2250
+ super(t, 2);
2251
+ }
2252
+ }, K = {};
2253
+ K[336783863] = [0, k, V, -1, $, [0, [1, 2, 3, 4, 5, 6, 7, 8, 9], B, ha, B, oa, B, ca, B, la, B, sa, B, [0, k, -2], B, [0, k, gt], B, aa, B, [0, gt, -1, V]], [0, k], V, [0, [1, 3], [2, 4], B, [0, An], -1, B, [0, Q], -1, Y, [0, k, -1]], k];
2254
+ var xs = [0, yi, -1, ge, -3, yi, An, Qt, Te, yi, -1, ge, Te, ge, -2, Qt];
2255
+ function R(t, e) {
2256
+ Kn(t, 3, e);
2257
+ }
2258
+ function w(t, e) {
2259
+ Kn(t, 4, e);
2260
+ }
2261
+ var st = class extends g {
2262
+ constructor(t) {
2263
+ super(t, 500);
2264
+ }
2265
+ o(t) {
2266
+ return _(this, 0, 7, t);
2267
+ }
2268
+ }, an = [-1, {}], Ts = [0, k, 1, an], Ss = [0, k, Q, an];
2269
+ function St(t, e) {
2270
+ ar(t, 1, st, e);
2271
+ }
2272
+ function N(t, e) {
2273
+ Kn(t, 10, e);
2274
+ }
2275
+ function T(t, e) {
2276
+ Kn(t, 15, e);
2277
+ }
2278
+ var _t = class extends g {
2279
+ constructor(t) {
2280
+ super(t, 500);
2281
+ }
2282
+ o(t) {
2283
+ return _(this, 0, 1001, t);
2284
+ }
2285
+ }, ua = [-500, Y, [-500, Qt, -1, Q, -3, [-2, K, V], Y, As, Te, -1, Ts, Ss, Y, [0, Qt, ge], Qt, xs, Te, Q, 987, Q], 4, Y, [-500, k, -1, [-1, {}], 998, k], Y, [-500, k, Q, -1, [-2, {}, V], 997, Q, -1], Te, Y, [-500, k, Q, an, 998, Q], Q, Te, Ts, Ss, Y, [0, Qt, -1, an], Q, -2, xs, Qt, -1, ge, [0, ge, S2], 978, an, Y, As];
2286
+ _t.prototype.g = ni(ua);
2287
+ var F2 = ie(_t, ua), P2 = class extends g {
2288
+ constructor(t) {
2289
+ super(t);
2290
+ }
2291
+ }, da = class extends g {
2292
+ constructor(t) {
2293
+ super(t);
2294
+ }
2295
+ g() {
2296
+ return zt(this, P2, 1);
2297
+ }
2298
+ }, fa = [0, Y, [0, $, G, k, -1]], ii = ie(da, fa), R2 = class extends g {
2299
+ constructor(t) {
2300
+ super(t);
2301
+ }
2302
+ }, O2 = class extends g {
2303
+ constructor(t) {
2304
+ super(t);
2305
+ }
2306
+ }, vi = class extends g {
2307
+ constructor(t) {
2308
+ super(t);
2309
+ }
2310
+ l() {
2311
+ return x(this, R2, 2);
2312
+ }
2313
+ g() {
2314
+ return zt(this, O2, 5);
2315
+ }
2316
+ }, pa = ie(class extends g {
2317
+ constructor(t) {
2318
+ super(t);
2319
+ }
2320
+ }, [0, Q, An, Ar, [0, gt, [0, $, -3], [0, G, -3], [0, $, -1, [0, Y, [0, $, -2]]], Y, [0, G, -1, k, G]], k, -1, ne, Y, [0, $, G], Q, ne]), ga = class extends g {
2321
+ constructor(t) {
2322
+ super(t);
2323
+ }
2324
+ }, ke = ie(class extends g {
2325
+ constructor(t) {
2326
+ super(t);
2327
+ }
2328
+ }, [0, Y, [0, G, -4]]), ma = class extends g {
2329
+ constructor(t) {
2330
+ super(t);
2331
+ }
2332
+ }, bn = ie(class extends g {
2333
+ constructor(t) {
2334
+ super(t);
2335
+ }
2336
+ }, [0, Y, [0, G, -4]]), N2 = class extends g {
2337
+ constructor(t) {
2338
+ super(t);
2339
+ }
2340
+ }, C2 = [0, $, -1, Ar, gt], ya = class extends g {
2341
+ constructor(t) {
2342
+ super(t);
2343
+ }
2344
+ };
2345
+ ya.prototype.g = ni([0, G, -4, ne]);
2346
+ var I2 = class extends g {
2347
+ constructor(t) {
2348
+ super(t);
2349
+ }
2350
+ }, D2 = ie(class extends g {
2351
+ constructor(t) {
2352
+ super(t);
2353
+ }
2354
+ }, [0, Y, [0, 1, $, k, fa], ne]), ks = class extends g {
2355
+ constructor(t) {
2356
+ super(t);
2357
+ }
2358
+ }, B2 = class extends g {
2359
+ constructor(t) {
2360
+ super(t);
2361
+ }
2362
+ na() {
2363
+ const t = P(this, 1, void 0, void 0, To);
2364
+ return t ?? me();
2365
+ }
2366
+ }, U2 = class extends g {
2367
+ constructor(t) {
2368
+ super(t);
2369
+ }
2370
+ }, _a = [1, 2], V2 = ie(class extends g {
2371
+ constructor(t) {
2372
+ super(t);
2373
+ }
2374
+ }, [0, Y, [0, _a, B, [0, Ar], B, [0, ra], $, k], ne]), br = class extends g {
2375
+ constructor(t) {
2376
+ super(t);
2377
+ }
2378
+ }, va = [0, k, $, G, Q, -1], Ms = class extends g {
2379
+ constructor(t) {
2380
+ super(t);
2381
+ }
2382
+ }, j2 = [0, V, -1], Ls = class extends g {
2383
+ constructor(t) {
2384
+ super(t);
2385
+ }
2386
+ }, Fn = [1, 2, 3, 4, 5, 6], Bn = class extends g {
2387
+ constructor(t) {
2388
+ super(t);
2389
+ }
2390
+ g() {
2391
+ return P(this, 1, void 0, void 0, To) != null;
2392
+ }
2393
+ l() {
2394
+ return Z(P(this, 2)) != null;
2395
+ }
2396
+ }, D = class extends g {
2397
+ constructor(t) {
2398
+ super(t);
2399
+ }
2400
+ g() {
2401
+ return go(P(this, 2)) ?? !1;
2402
+ }
2403
+ }, Aa = [0, ra, k, [0, $, ne, -1], [0, x2, ne]], H = [0, Aa, V, [0, Fn, B, la, B, oa, B, sa, B, ha, B, ca, B, aa], gt], ri = class extends g {
2404
+ constructor(t) {
2405
+ super(t);
2406
+ }
2407
+ }, wr = [0, H, G, -1, $], G2 = Ut(502141897, ri);
2408
+ K[502141897] = wr;
2409
+ var H2 = ie(class extends g {
2410
+ constructor(t) {
2411
+ super(t);
2412
+ }
2413
+ }, [0, [0, gt, -1, w2, T2], C2]), ba = class extends g {
2414
+ constructor(t) {
2415
+ super(t);
2416
+ }
2417
+ }, wa = class extends g {
2418
+ constructor(t) {
2419
+ super(t);
2420
+ }
2421
+ }, Pi = [0, H, G, [0, H], V], z2 = Ut(508968150, wa);
2422
+ K[508968150] = [0, H, wr, Pi, G, [0, [0, Aa]]], K[508968149] = Pi;
2423
+ var xe = class extends g {
2424
+ constructor(t) {
2425
+ super(t);
2426
+ }
2427
+ l() {
2428
+ return x(this, br, 2);
2429
+ }
2430
+ g() {
2431
+ S(this, 2);
2432
+ }
2433
+ }, Ea = [0, H, va];
2434
+ K[478825465] = Ea;
2435
+ var W2 = class extends g {
2436
+ constructor(t) {
2437
+ super(t);
2438
+ }
2439
+ }, xa = class extends g {
2440
+ constructor(t) {
2441
+ super(t);
2442
+ }
2443
+ }, Er = class extends g {
2444
+ constructor(t) {
2445
+ super(t);
2446
+ }
2447
+ }, xr = class extends g {
2448
+ constructor(t) {
2449
+ super(t);
2450
+ }
2451
+ }, Ta = class extends g {
2452
+ constructor(t) {
2453
+ super(t);
2454
+ }
2455
+ }, Fs = [0, H, [0, H], Ea, -1], Sa = [0, H, G, $], Tr = [0, H, G], ka = [0, H, Sa, Tr, G], K2 = Ut(479097054, Ta);
2456
+ K[479097054] = [0, H, ka, Fs], K[463370452] = Fs, K[464864288] = Sa;
2457
+ var q2 = Ut(462713202, xr);
2458
+ K[462713202] = ka, K[474472470] = Tr;
2459
+ var X2 = class extends g {
2460
+ constructor(t) {
2461
+ super(t);
2462
+ }
2463
+ }, Ma = class extends g {
2464
+ constructor(t) {
2465
+ super(t);
2466
+ }
2467
+ }, La = class extends g {
2468
+ constructor(t) {
2469
+ super(t);
2470
+ }
2471
+ }, Fa = class extends g {
2472
+ constructor(t) {
2473
+ super(t);
2474
+ }
2475
+ }, Sr = [0, H, G, -1, $], Ri = [0, H, G, V];
2476
+ Fa.prototype.g = ni([0, H, Tr, [0, H], wr, Pi, Sr, Ri]);
2477
+ var Pa = class extends g {
2478
+ constructor(t) {
2479
+ super(t);
2480
+ }
2481
+ }, Y2 = Ut(456383383, Pa);
2482
+ K[456383383] = [0, H, va];
2483
+ var Ra = class extends g {
2484
+ constructor(t) {
2485
+ super(t);
2486
+ }
2487
+ }, $2 = Ut(476348187, Ra);
2488
+ K[476348187] = [0, H, j2];
2489
+ var Oa = class extends g {
2490
+ constructor(t) {
2491
+ super(t);
2492
+ }
2493
+ }, Ps = class extends g {
2494
+ constructor(t) {
2495
+ super(t);
2496
+ }
2497
+ }, Na = [0, gt, -1], J2 = Ut(458105876, class extends g {
2498
+ constructor(t) {
2499
+ super(t);
2500
+ }
2501
+ g() {
2502
+ let t;
2503
+ var e = this.v;
2504
+ const n = 0 | e[p];
2505
+ return t = ft(this, n), e = (function(i, r, s, o) {
2506
+ var a = Ps;
2507
+ !o && Ke(i) && (s = 0 | (r = i.v)[p]);
2508
+ var c = Ht(r, 2);
2509
+ if (i = !1, c == null) {
2510
+ if (o) return us();
2511
+ c = [];
2512
+ } else if (c.constructor === Gt) {
2513
+ if (!(2 & c.J) || o) return c;
2514
+ c = c.V();
2515
+ } else Array.isArray(c) ? i = !!(2 & (0 | c[p])) : c = [];
2516
+ if (o) {
2517
+ if (!c.length) return us();
2518
+ i || (i = !0, gn(c));
2519
+ } else i && (i = !1, ln(c), c = So(c));
2520
+ return !i && 32 & s && pn(c, 32), s = W(r, s, 2, o = new Gt(c, a, J1, void 0)), i || Ae(r, s), o;
2521
+ })(this, e, n, t), !t && Ps && (e.ra = !0), e;
2522
+ }
2523
+ });
2524
+ K[458105876] = [0, Na, b2, [!0, ne, [0, k, -1, Q]], [0, An, V, gt]];
2525
+ var kr = class extends g {
2526
+ constructor(t) {
2527
+ super(t);
2528
+ }
2529
+ }, Ca = Ut(458105758, kr);
2530
+ K[458105758] = [0, H, k, Na];
2531
+ var Ai = class extends g {
2532
+ constructor(t) {
2533
+ super(t);
2534
+ }
2535
+ }, Rs = [0, E2, -1, ge], Z2 = class extends g {
2536
+ constructor(t) {
2537
+ super(t);
2538
+ }
2539
+ }, Ia = class extends g {
2540
+ constructor(t) {
2541
+ super(t);
2542
+ }
2543
+ }, Oi = [1, 2];
2544
+ Ia.prototype.g = ni([0, Oi, B, Rs, B, [0, Y, Rs]]);
2545
+ var Da = class extends g {
2546
+ constructor(t) {
2547
+ super(t);
2548
+ }
2549
+ }, Q2 = Ut(443442058, Da);
2550
+ K[443442058] = [0, H, k, $, G, Q, -1, V, G], K[514774813] = Sr;
2551
+ var Ba = class extends g {
2552
+ constructor(t) {
2553
+ super(t);
2554
+ }
2555
+ }, tc = Ut(516587230, Ba);
2556
+ function Ni(t, e) {
2557
+ return e = e ? e.clone() : new br(), t.displayNamesLocale !== void 0 ? S(e, 1, _n(t.displayNamesLocale)) : t.displayNamesLocale === void 0 && S(e, 1), t.maxResults !== void 0 ? Wt(e, 2, t.maxResults) : "maxResults" in t && S(e, 2), t.scoreThreshold !== void 0 ? y(e, 3, t.scoreThreshold) : "scoreThreshold" in t && S(e, 3), t.categoryAllowlist !== void 0 ? Nn(e, 4, t.categoryAllowlist) : "categoryAllowlist" in t && S(e, 4), t.categoryDenylist !== void 0 ? Nn(e, 5, t.categoryDenylist) : "categoryDenylist" in t && S(e, 5), e;
2558
+ }
2559
+ function Ua(t) {
2560
+ const e = Number(t);
2561
+ return Number.isSafeInteger(e) ? e : String(t);
2562
+ }
2563
+ function Mr(t, e = -1, n = "") {
2564
+ return { categories: t.map(((i) => ({ index: xt(i, 1) ?? 0 ?? -1, score: U(i, 2) ?? 0, categoryName: Z(P(i, 3)) ?? "" ?? "", displayName: Z(P(i, 4)) ?? "" ?? "" }))), headIndex: e, headName: n };
2565
+ }
2566
+ function ec(t) {
2567
+ const e = { classifications: zt(t, I2, 1).map(((n) => {
2568
+ var i;
2569
+ return Mr(((i = x(n, da, 4)) == null ? void 0 : i.g()) ?? [], xt(n, 2) ?? 0, Z(P(n, 3)) ?? "");
2570
+ })) };
2571
+ return (function(n) {
2572
+ return $1(Hi ? P(n, 2, void 0, void 0, Rn) : P(n, 2));
2573
+ })(t) != null && (e.timestampMs = Ua(Po(t))), e;
2574
+ }
2575
+ function Va(t) {
2576
+ var o, a;
2577
+ var e = le(t, 3, Nt, he()), n = le(t, 2, ze, he()), i = le(t, 1, Z, he()), r = le(t, 9, Z, he());
2578
+ const s = { categories: [], keypoints: [] };
2579
+ for (let c = 0; c < e.length; c++) s.categories.push({ score: e[c], index: n[c] ?? -1, categoryName: i[c] ?? "", displayName: r[c] ?? "" });
2580
+ if ((e = (o = x(t, vi, 4)) == null ? void 0 : o.l()) && (s.boundingBox = { originX: xt(e, 1, $t) ?? 0, originY: xt(e, 2, $t) ?? 0, width: xt(e, 3, $t) ?? 0, height: xt(e, 4, $t) ?? 0, angle: 0 }), (a = x(t, vi, 4)) == null ? void 0 : a.g().length) for (const c of x(t, vi, 4).g()) s.keypoints.push({ x: P(c, 1, void 0, $t, Nt) ?? 0, y: P(c, 2, void 0, $t, Nt) ?? 0, score: P(c, 4, void 0, $t, Nt) ?? 0, label: Z(P(c, 3, void 0, $t)) ?? "" });
2581
+ return s;
2582
+ }
2583
+ function si(t) {
2584
+ const e = [];
2585
+ for (const n of zt(t, ma, 1)) e.push({ x: U(n, 1) ?? 0, y: U(n, 2) ?? 0, z: U(n, 3) ?? 0, visibility: U(n, 4) ?? 0 });
2586
+ return e;
2587
+ }
2588
+ function cn(t) {
2589
+ const e = [];
2590
+ for (const n of zt(t, ga, 1)) e.push({ x: U(n, 1) ?? 0, y: U(n, 2) ?? 0, z: U(n, 3) ?? 0, visibility: U(n, 4) ?? 0 });
2591
+ return e;
2592
+ }
2593
+ function Os(t) {
2594
+ return Array.from(t, ((e) => e > 127 ? e - 256 : e));
2595
+ }
2596
+ function Ns(t, e) {
2597
+ if (t.length !== e.length) throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${t.length} vs. ${e.length}).`);
2598
+ let n = 0, i = 0, r = 0;
2599
+ for (let s = 0; s < t.length; s++) n += t[s] * e[s], i += t[s] * t[s], r += e[s] * e[s];
2600
+ if (i <= 0 || r <= 0) throw Error("Cannot compute cosine similarity on embedding with 0 norm.");
2601
+ return n / Math.sqrt(i * r);
2602
+ }
2603
+ let Sn;
2604
+ K[516587230] = [0, H, Sr, Ri, G], K[518928384] = Ri;
2605
+ const nc = new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 5, 1, 96, 0, 1, 123, 3, 2, 1, 0, 10, 10, 1, 8, 0, 65, 0, 253, 15, 253, 98, 11]);
2606
+ async function ja() {
2607
+ if (Sn === void 0) try {
2608
+ await WebAssembly.instantiate(nc), Sn = !0;
2609
+ } catch {
2610
+ Sn = !1;
2611
+ }
2612
+ return Sn;
2613
+ }
2614
+ async function en(t, e = M2``) {
2615
+ const n = await ja() ? "wasm_internal" : "wasm_nosimd_internal";
2616
+ return { wasmLoaderPath: `${e}/${t}_${n}.js`, wasmBinaryPath: `${e}/${t}_${n}.wasm` };
2617
+ }
2618
+ var ae = class {
2619
+ };
2620
+ function Ga() {
2621
+ var t = navigator;
2622
+ return typeof OffscreenCanvas < "u" && (!(function(e = navigator) {
2623
+ return (e = e.userAgent).includes("Safari") && !e.includes("Chrome");
2624
+ })(t) || !!((t = t.userAgent.match(/Version\/([\d]+).*Safari/)) && t.length >= 1 && Number(t[1]) >= 17));
2625
+ }
2626
+ async function Cs(t) {
2627
+ if (typeof importScripts != "function") {
2628
+ const e = document.createElement("script");
2629
+ return e.src = t.toString(), e.crossOrigin = "anonymous", new Promise(((n, i) => {
2630
+ e.addEventListener("load", (() => {
2631
+ n();
2632
+ }), !1), e.addEventListener("error", ((r) => {
2633
+ i(r);
2634
+ }), !1), document.body.appendChild(e);
2635
+ }));
2636
+ }
2637
+ try {
2638
+ importScripts(t.toString());
2639
+ } catch (e) {
2640
+ if (!(e instanceof TypeError)) throw e;
2641
+ await self.import(t.toString());
2642
+ }
2643
+ }
2644
+ function Ha(t) {
2645
+ return t.videoWidth !== void 0 ? [t.videoWidth, t.videoHeight] : t.naturalWidth !== void 0 ? [t.naturalWidth, t.naturalHeight] : t.displayWidth !== void 0 ? [t.displayWidth, t.displayHeight] : [t.width, t.height];
2646
+ }
2647
+ function m(t, e, n) {
2648
+ t.m || console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"), n(e = t.i.stringToNewUTF8(e)), t.i._free(e);
2649
+ }
2650
+ function Is(t, e, n) {
2651
+ if (!t.i.canvas) throw Error("No OpenGL canvas configured.");
2652
+ if (n ? t.i._bindTextureToStream(n) : t.i._bindTextureToCanvas(), !(n = t.i.canvas.getContext("webgl2") || t.i.canvas.getContext("webgl"))) throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");
2653
+ t.i.gpuOriginForWebTexturesIsBottomLeft && n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, !0), n.texImage2D(n.TEXTURE_2D, 0, n.RGBA, n.RGBA, n.UNSIGNED_BYTE, e), t.i.gpuOriginForWebTexturesIsBottomLeft && n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, !1);
2654
+ const [i, r] = Ha(e);
2655
+ return !t.l || i === t.i.canvas.width && r === t.i.canvas.height || (t.i.canvas.width = i, t.i.canvas.height = r), [i, r];
2656
+ }
2657
+ function Ds(t, e, n) {
2658
+ t.m || console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");
2659
+ const i = new Uint32Array(e.length);
2660
+ for (let r = 0; r < e.length; r++) i[r] = t.i.stringToNewUTF8(e[r]);
2661
+ e = t.i._malloc(4 * i.length), t.i.HEAPU32.set(i, e >> 2), n(e);
2662
+ for (const r of i) t.i._free(r);
2663
+ t.i._free(e);
2664
+ }
2665
+ function Rt(t, e, n) {
2666
+ t.i.simpleListeners = t.i.simpleListeners || {}, t.i.simpleListeners[e] = n;
2667
+ }
2668
+ function Jt(t, e, n) {
2669
+ let i = [];
2670
+ t.i.simpleListeners = t.i.simpleListeners || {}, t.i.simpleListeners[e] = (r, s, o) => {
2671
+ s ? (n(i, o), i = []) : i.push(r);
2672
+ };
2673
+ }
2674
+ ae.forVisionTasks = function(t) {
2675
+ return en("vision", t);
2676
+ }, ae.forTextTasks = function(t) {
2677
+ return en("text", t);
2678
+ }, ae.forGenAiExperimentalTasks = function(t) {
2679
+ return en("genai_experimental", t);
2680
+ }, ae.forGenAiTasks = function(t) {
2681
+ return en("genai", t);
2682
+ }, ae.forAudioTasks = function(t) {
2683
+ return en("audio", t);
2684
+ }, ae.isSimdSupported = function() {
2685
+ return ja();
2686
+ };
2687
+ async function ic(t, e, n, i) {
2688
+ return t = await (async (r, s, o, a, c) => {
2689
+ if (s && await Cs(s), !self.ModuleFactory || o && (await Cs(o), !self.ModuleFactory)) throw Error("ModuleFactory not set.");
2690
+ return self.Module && c && ((s = self.Module).locateFile = c.locateFile, c.mainScriptUrlOrBlob && (s.mainScriptUrlOrBlob = c.mainScriptUrlOrBlob)), c = await self.ModuleFactory(self.Module || c), self.ModuleFactory = self.Module = void 0, new r(c, a);
2691
+ })(t, n.wasmLoaderPath, n.assetLoaderPath, e, { locateFile: (r) => r.endsWith(".wasm") ? n.wasmBinaryPath.toString() : n.assetBinaryPath && r.endsWith(".data") ? n.assetBinaryPath.toString() : r }), await t.o(i), t;
2692
+ }
2693
+ function bi(t, e) {
2694
+ const n = x(t.baseOptions, Bn, 1) || new Bn();
2695
+ typeof e == "string" ? (S(n, 2, _n(e)), S(n, 1)) : e instanceof Uint8Array && (S(n, 1, Ki(e, !1)), S(n, 2)), _(t.baseOptions, 0, 1, n);
2696
+ }
2697
+ function Bs(t) {
2698
+ try {
2699
+ const e = t.H.length;
2700
+ if (e === 1) throw Error(t.H[0].message);
2701
+ if (e > 1) throw Error("Encountered multiple errors: " + t.H.map(((n) => n.message)).join(", "));
2702
+ } finally {
2703
+ t.H = [];
2704
+ }
2705
+ }
2706
+ function d(t, e) {
2707
+ t.C = Math.max(t.C, e);
2708
+ }
2709
+ function oi(t, e) {
2710
+ t.B = new st(), pt(t.B, 2, "PassThroughCalculator"), R(t.B, "free_memory"), w(t.B, "free_memory_unused_out"), N(e, "free_memory"), St(e, t.B);
2711
+ }
2712
+ function Be(t, e) {
2713
+ R(t.B, e), w(t.B, e + "_unused_out");
2714
+ }
2715
+ function ai(t) {
2716
+ t.g.addBoolToStream(!0, "free_memory", t.C);
2717
+ }
2718
+ var Ci = class {
2719
+ constructor(t) {
2720
+ this.g = t, this.H = [], this.C = 0, this.g.setAutoRenderToScreen(!1);
2721
+ }
2722
+ l(t, e = !0) {
2723
+ var n, i, r, s, o, a;
2724
+ if (e) {
2725
+ const c = t.baseOptions || {};
2726
+ if ((n = t.baseOptions) != null && n.modelAssetBuffer && ((i = t.baseOptions) != null && i.modelAssetPath)) throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");
2727
+ if (!((r = x(this.baseOptions, Bn, 1)) != null && r.g() || (s = x(this.baseOptions, Bn, 1)) != null && s.l() || (o = t.baseOptions) != null && o.modelAssetBuffer || (a = t.baseOptions) != null && a.modelAssetPath)) throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");
2728
+ if ((function(h, l) {
2729
+ let u = x(h.baseOptions, Ls, 3);
2730
+ if (!u) {
2731
+ var f = u = new Ls(), v = new Es();
2732
+ on(f, 4, Fn, v);
2733
+ }
2734
+ "delegate" in l && (l.delegate === "GPU" ? (l = u, f = new L2(), on(l, 2, Fn, f)) : (l = u, f = new Es(), on(l, 4, Fn, f))), _(h.baseOptions, 0, 3, u);
2735
+ })(this, c), c.modelAssetPath) return fetch(c.modelAssetPath.toString()).then(((h) => {
2736
+ if (h.ok) return h.arrayBuffer();
2737
+ throw Error(`Failed to fetch model: ${c.modelAssetPath} (${h.status})`);
2738
+ })).then(((h) => {
2739
+ try {
2740
+ this.g.i.FS_unlink("/model.dat");
2741
+ } catch {
2742
+ }
2743
+ this.g.i.FS_createDataFile("/", "model.dat", new Uint8Array(h), !0, !1, !1), bi(this, "/model.dat"), this.m(), this.L();
2744
+ }));
2745
+ if (c.modelAssetBuffer instanceof Uint8Array) bi(this, c.modelAssetBuffer);
2746
+ else if (c.modelAssetBuffer) return (async function(h) {
2747
+ const l = [];
2748
+ for (var u = 0; ; ) {
2749
+ const { done: f, value: v } = await h.read();
2750
+ if (f) break;
2751
+ l.push(v), u += v.length;
2752
+ }
2753
+ if (l.length === 0) return new Uint8Array(0);
2754
+ if (l.length === 1) return l[0];
2755
+ h = new Uint8Array(u), u = 0;
2756
+ for (const f of l) h.set(f, u), u += f.length;
2757
+ return h;
2758
+ })(c.modelAssetBuffer).then(((h) => {
2759
+ bi(this, h), this.m(), this.L();
2760
+ }));
2761
+ }
2762
+ return this.m(), this.L(), Promise.resolve();
2763
+ }
2764
+ L() {
2765
+ }
2766
+ ca() {
2767
+ let t;
2768
+ if (this.g.ca(((e) => {
2769
+ t = F2(e);
2770
+ })), !t) throw Error("Failed to retrieve CalculatorGraphConfig");
2771
+ return t;
2772
+ }
2773
+ setGraph(t, e) {
2774
+ this.g.attachErrorListener(((n, i) => {
2775
+ this.H.push(Error(i));
2776
+ })), this.g.Ja(), this.g.setGraph(t, e), this.B = void 0, Bs(this);
2777
+ }
2778
+ finishProcessing() {
2779
+ this.g.finishProcessing(), Bs(this);
2780
+ }
2781
+ close() {
2782
+ this.B = void 0, this.g.closeGraph();
2783
+ }
2784
+ };
2785
+ function te(t, e) {
2786
+ if (!t) throw Error(`Unable to obtain required WebGL resource: ${e}`);
2787
+ return t;
2788
+ }
2789
+ Ci.prototype.close = Ci.prototype.close;
2790
+ class rc {
2791
+ constructor(e, n, i, r) {
2792
+ this.g = e, this.h = n, this.m = i, this.l = r;
2793
+ }
2794
+ bind() {
2795
+ this.g.bindVertexArray(this.h);
2796
+ }
2797
+ close() {
2798
+ this.g.deleteVertexArray(this.h), this.g.deleteBuffer(this.m), this.g.deleteBuffer(this.l);
2799
+ }
2800
+ }
2801
+ function Us(t, e, n) {
2802
+ const i = t.g;
2803
+ if (n = te(i.createShader(n), "Failed to create WebGL shader"), i.shaderSource(n, e), i.compileShader(n), !i.getShaderParameter(n, i.COMPILE_STATUS)) throw Error(`Could not compile WebGL shader: ${i.getShaderInfoLog(n)}`);
2804
+ return i.attachShader(t.h, n), n;
2805
+ }
2806
+ function Vs(t, e) {
2807
+ const n = t.g, i = te(n.createVertexArray(), "Failed to create vertex array");
2808
+ n.bindVertexArray(i);
2809
+ const r = te(n.createBuffer(), "Failed to create buffer");
2810
+ n.bindBuffer(n.ARRAY_BUFFER, r), n.enableVertexAttribArray(t.O), n.vertexAttribPointer(t.O, 2, n.FLOAT, !1, 0, 0), n.bufferData(n.ARRAY_BUFFER, new Float32Array([-1, -1, -1, 1, 1, 1, 1, -1]), n.STATIC_DRAW);
2811
+ const s = te(n.createBuffer(), "Failed to create buffer");
2812
+ return n.bindBuffer(n.ARRAY_BUFFER, s), n.enableVertexAttribArray(t.L), n.vertexAttribPointer(t.L, 2, n.FLOAT, !1, 0, 0), n.bufferData(n.ARRAY_BUFFER, new Float32Array(e ? [0, 1, 0, 0, 1, 0, 1, 1] : [0, 0, 0, 1, 1, 1, 1, 0]), n.STATIC_DRAW), n.bindBuffer(n.ARRAY_BUFFER, null), n.bindVertexArray(null), new rc(n, i, r, s);
2813
+ }
2814
+ function Lr(t, e) {
2815
+ if (t.g) {
2816
+ if (e !== t.g) throw Error("Cannot change GL context once initialized");
2817
+ } else t.g = e;
2818
+ }
2819
+ function sc(t, e, n, i) {
2820
+ return Lr(t, e), t.h || (t.m(), t.D()), n ? (t.u || (t.u = Vs(t, !0)), n = t.u) : (t.A || (t.A = Vs(t, !1)), n = t.A), e.useProgram(t.h), n.bind(), t.l(), t = i(), n.g.bindVertexArray(null), t;
2821
+ }
2822
+ function za(t, e, n) {
2823
+ return Lr(t, e), t = te(e.createTexture(), "Failed to create texture"), e.bindTexture(e.TEXTURE_2D, t), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_S, e.CLAMP_TO_EDGE), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_T, e.CLAMP_TO_EDGE), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, n ?? e.LINEAR), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MAG_FILTER, n ?? e.LINEAR), e.bindTexture(e.TEXTURE_2D, null), t;
2824
+ }
2825
+ function Wa(t, e, n) {
2826
+ Lr(t, e), t.B || (t.B = te(e.createFramebuffer(), "Failed to create framebuffe.")), e.bindFramebuffer(e.FRAMEBUFFER, t.B), e.framebufferTexture2D(e.FRAMEBUFFER, e.COLOR_ATTACHMENT0, e.TEXTURE_2D, n, 0);
2827
+ }
2828
+ function oc(t) {
2829
+ var e;
2830
+ (e = t.g) == null || e.bindFramebuffer(t.g.FRAMEBUFFER, null);
2831
+ }
2832
+ var Ka = class {
2833
+ H() {
2834
+ return `
2835
+ precision mediump float;
2836
+ varying vec2 vTex;
2837
+ uniform sampler2D inputTexture;
2838
+ void main() {
2839
+ gl_FragColor = texture2D(inputTexture, vTex);
2840
+ }
2841
+ `;
2842
+ }
2843
+ m() {
2844
+ const t = this.g;
2845
+ if (this.h = te(t.createProgram(), "Failed to create WebGL program"), this.X = Us(this, `
2846
+ attribute vec2 aVertex;
2847
+ attribute vec2 aTex;
2848
+ varying vec2 vTex;
2849
+ void main(void) {
2850
+ gl_Position = vec4(aVertex, 0.0, 1.0);
2851
+ vTex = aTex;
2852
+ }`, t.VERTEX_SHADER), this.W = Us(this, this.H(), t.FRAGMENT_SHADER), t.linkProgram(this.h), !t.getProgramParameter(this.h, t.LINK_STATUS)) throw Error(`Error during program linking: ${t.getProgramInfoLog(this.h)}`);
2853
+ this.O = t.getAttribLocation(this.h, "aVertex"), this.L = t.getAttribLocation(this.h, "aTex");
2854
+ }
2855
+ D() {
2856
+ }
2857
+ l() {
2858
+ }
2859
+ close() {
2860
+ if (this.h) {
2861
+ const t = this.g;
2862
+ t.deleteProgram(this.h), t.deleteShader(this.X), t.deleteShader(this.W);
2863
+ }
2864
+ this.B && this.g.deleteFramebuffer(this.B), this.A && this.A.close(), this.u && this.u.close();
2865
+ }
2866
+ };
2867
+ function jt(t, e) {
2868
+ switch (e) {
2869
+ case 0:
2870
+ return t.g.find(((n) => n instanceof Uint8Array));
2871
+ case 1:
2872
+ return t.g.find(((n) => n instanceof Float32Array));
2873
+ case 2:
2874
+ return t.g.find(((n) => typeof WebGLTexture < "u" && n instanceof WebGLTexture));
2875
+ default:
2876
+ throw Error(`Type is not supported: ${e}`);
2877
+ }
2878
+ }
2879
+ function Ii(t) {
2880
+ var e = jt(t, 1);
2881
+ if (!e) {
2882
+ if (e = jt(t, 0)) e = new Float32Array(e).map(((i) => i / 255));
2883
+ else {
2884
+ e = new Float32Array(t.width * t.height);
2885
+ const i = Ue(t);
2886
+ var n = Fr(t);
2887
+ if (Wa(n, i, qa(t)), "iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform) || navigator.userAgent.includes("Mac") && "document" in self && "ontouchend" in self.document) {
2888
+ n = new Float32Array(t.width * t.height * 4), i.readPixels(0, 0, t.width, t.height, i.RGBA, i.FLOAT, n);
2889
+ for (let r = 0, s = 0; r < e.length; ++r, s += 4) e[r] = n[s];
2890
+ } else i.readPixels(0, 0, t.width, t.height, i.RED, i.FLOAT, e);
2891
+ }
2892
+ t.g.push(e);
2893
+ }
2894
+ return e;
2895
+ }
2896
+ function qa(t) {
2897
+ let e = jt(t, 2);
2898
+ if (!e) {
2899
+ const n = Ue(t);
2900
+ e = Ya(t);
2901
+ const i = Ii(t), r = Xa(t);
2902
+ n.texImage2D(n.TEXTURE_2D, 0, r, t.width, t.height, 0, n.RED, n.FLOAT, i), Di(t);
2903
+ }
2904
+ return e;
2905
+ }
2906
+ function Ue(t) {
2907
+ if (!t.canvas) throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");
2908
+ return t.h || (t.h = te(t.canvas.getContext("webgl2"), "You cannot use a canvas that is already bound to a different type of rendering context.")), t.h;
2909
+ }
2910
+ function Xa(t) {
2911
+ if (t = Ue(t), !kn) if (t.getExtension("EXT_color_buffer_float") && t.getExtension("OES_texture_float_linear") && t.getExtension("EXT_float_blend")) kn = t.R32F;
2912
+ else {
2913
+ if (!t.getExtension("EXT_color_buffer_half_float")) throw Error("GPU does not fully support 4-channel float32 or float16 formats");
2914
+ kn = t.R16F;
2915
+ }
2916
+ return kn;
2917
+ }
2918
+ function Fr(t) {
2919
+ return t.l || (t.l = new Ka()), t.l;
2920
+ }
2921
+ function Ya(t) {
2922
+ const e = Ue(t);
2923
+ e.viewport(0, 0, t.width, t.height), e.activeTexture(e.TEXTURE0);
2924
+ let n = jt(t, 2);
2925
+ return n || (n = za(Fr(t), e, t.m ? e.LINEAR : e.NEAREST), t.g.push(n), t.j = !0), e.bindTexture(e.TEXTURE_2D, n), n;
2926
+ }
2927
+ function Di(t) {
2928
+ t.h.bindTexture(t.h.TEXTURE_2D, null);
2929
+ }
2930
+ var kn, X = class {
2931
+ constructor(t, e, n, i, r, s, o) {
2932
+ this.g = t, this.m = e, this.j = n, this.canvas = i, this.l = r, this.width = s, this.height = o, this.j && --js === 0 && console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources.");
2933
+ }
2934
+ Fa() {
2935
+ return !!jt(this, 0);
2936
+ }
2937
+ ka() {
2938
+ return !!jt(this, 1);
2939
+ }
2940
+ R() {
2941
+ return !!jt(this, 2);
2942
+ }
2943
+ ja() {
2944
+ return (e = jt(t = this, 0)) || (e = Ii(t), e = new Uint8Array(e.map(((n) => Math.round(255 * n)))), t.g.push(e)), e;
2945
+ var t, e;
2946
+ }
2947
+ ia() {
2948
+ return Ii(this);
2949
+ }
2950
+ N() {
2951
+ return qa(this);
2952
+ }
2953
+ clone() {
2954
+ const t = [];
2955
+ for (const e of this.g) {
2956
+ let n;
2957
+ if (e instanceof Uint8Array) n = new Uint8Array(e);
2958
+ else if (e instanceof Float32Array) n = new Float32Array(e);
2959
+ else {
2960
+ if (!(e instanceof WebGLTexture)) throw Error(`Type is not supported: ${e}`);
2961
+ {
2962
+ const i = Ue(this), r = Fr(this);
2963
+ i.activeTexture(i.TEXTURE1), n = za(r, i, this.m ? i.LINEAR : i.NEAREST), i.bindTexture(i.TEXTURE_2D, n);
2964
+ const s = Xa(this);
2965
+ i.texImage2D(i.TEXTURE_2D, 0, s, this.width, this.height, 0, i.RED, i.FLOAT, null), i.bindTexture(i.TEXTURE_2D, null), Wa(r, i, n), sc(r, i, !1, (() => {
2966
+ Ya(this), i.clearColor(0, 0, 0, 0), i.clear(i.COLOR_BUFFER_BIT), i.drawArrays(i.TRIANGLE_FAN, 0, 4), Di(this);
2967
+ })), oc(r), Di(this);
2968
+ }
2969
+ }
2970
+ t.push(n);
2971
+ }
2972
+ return new X(t, this.m, this.R(), this.canvas, this.l, this.width, this.height);
2973
+ }
2974
+ close() {
2975
+ this.j && Ue(this).deleteTexture(jt(this, 2)), js = -1;
2976
+ }
2977
+ };
2978
+ X.prototype.close = X.prototype.close, X.prototype.clone = X.prototype.clone, X.prototype.getAsWebGLTexture = X.prototype.N, X.prototype.getAsFloat32Array = X.prototype.ia, X.prototype.getAsUint8Array = X.prototype.ja, X.prototype.hasWebGLTexture = X.prototype.R, X.prototype.hasFloat32Array = X.prototype.ka, X.prototype.hasUint8Array = X.prototype.Fa;
2979
+ var js = 250;
2980
+ function Lt(...t) {
2981
+ return t.map((([e, n]) => ({ start: e, end: n })));
2982
+ }
2983
+ const ac = /* @__PURE__ */ (function(t) {
2984
+ return class extends t {
2985
+ Ja() {
2986
+ this.i._registerModelResourcesGraphService();
2987
+ }
2988
+ };
2989
+ })((Gs = class {
2990
+ constructor(t, e) {
2991
+ this.l = !0, this.i = t, this.g = null, this.h = 0, this.m = typeof this.i._addIntToInputStream == "function", e !== void 0 ? this.i.canvas = e : Ga() ? this.i.canvas = new OffscreenCanvas(1, 1) : (console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."), this.i.canvas = document.createElement("canvas"));
2992
+ }
2993
+ async initializeGraph(t) {
2994
+ const e = await (await fetch(t)).arrayBuffer();
2995
+ t = !(t.endsWith(".pbtxt") || t.endsWith(".textproto")), this.setGraph(new Uint8Array(e), t);
2996
+ }
2997
+ setGraphFromString(t) {
2998
+ this.setGraph(new TextEncoder().encode(t), !1);
2999
+ }
3000
+ setGraph(t, e) {
3001
+ const n = t.length, i = this.i._malloc(n);
3002
+ this.i.HEAPU8.set(t, i), e ? this.i._changeBinaryGraph(n, i) : this.i._changeTextGraph(n, i), this.i._free(i);
3003
+ }
3004
+ configureAudio(t, e, n, i, r) {
3005
+ this.i._configureAudio || console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'), m(this, i || "input_audio", ((s) => {
3006
+ m(this, r = r || "audio_header", ((o) => {
3007
+ this.i._configureAudio(s, o, t, e ?? 0, n);
3008
+ }));
3009
+ }));
3010
+ }
3011
+ setAutoResizeCanvas(t) {
3012
+ this.l = t;
3013
+ }
3014
+ setAutoRenderToScreen(t) {
3015
+ this.i._setAutoRenderToScreen(t);
3016
+ }
3017
+ setGpuBufferVerticalFlip(t) {
3018
+ this.i.gpuOriginForWebTexturesIsBottomLeft = t;
3019
+ }
3020
+ ca(t) {
3021
+ Rt(this, "__graph_config__", ((e) => {
3022
+ t(e);
3023
+ })), m(this, "__graph_config__", ((e) => {
3024
+ this.i._getGraphConfig(e, void 0);
3025
+ })), delete this.i.simpleListeners.__graph_config__;
3026
+ }
3027
+ attachErrorListener(t) {
3028
+ this.i.errorListener = t;
3029
+ }
3030
+ attachEmptyPacketListener(t, e) {
3031
+ this.i.emptyPacketListeners = this.i.emptyPacketListeners || {}, this.i.emptyPacketListeners[t] = e;
3032
+ }
3033
+ addAudioToStream(t, e, n) {
3034
+ this.addAudioToStreamWithShape(t, 0, 0, e, n);
3035
+ }
3036
+ addAudioToStreamWithShape(t, e, n, i, r) {
3037
+ const s = 4 * t.length;
3038
+ this.h !== s && (this.g && this.i._free(this.g), this.g = this.i._malloc(s), this.h = s), this.i.HEAPF32.set(t, this.g / 4), m(this, i, ((o) => {
3039
+ this.i._addAudioToInputStream(this.g, e, n, o, r);
3040
+ }));
3041
+ }
3042
+ addGpuBufferToStream(t, e, n) {
3043
+ m(this, e, ((i) => {
3044
+ const [r, s] = Is(this, t, i);
3045
+ this.i._addBoundTextureToStream(i, r, s, n);
3046
+ }));
3047
+ }
3048
+ addBoolToStream(t, e, n) {
3049
+ m(this, e, ((i) => {
3050
+ this.i._addBoolToInputStream(t, i, n);
3051
+ }));
3052
+ }
3053
+ addDoubleToStream(t, e, n) {
3054
+ m(this, e, ((i) => {
3055
+ this.i._addDoubleToInputStream(t, i, n);
3056
+ }));
3057
+ }
3058
+ addFloatToStream(t, e, n) {
3059
+ m(this, e, ((i) => {
3060
+ this.i._addFloatToInputStream(t, i, n);
3061
+ }));
3062
+ }
3063
+ addIntToStream(t, e, n) {
3064
+ m(this, e, ((i) => {
3065
+ this.i._addIntToInputStream(t, i, n);
3066
+ }));
3067
+ }
3068
+ addUintToStream(t, e, n) {
3069
+ m(this, e, ((i) => {
3070
+ this.i._addUintToInputStream(t, i, n);
3071
+ }));
3072
+ }
3073
+ addStringToStream(t, e, n) {
3074
+ m(this, e, ((i) => {
3075
+ m(this, t, ((r) => {
3076
+ this.i._addStringToInputStream(r, i, n);
3077
+ }));
3078
+ }));
3079
+ }
3080
+ addStringRecordToStream(t, e, n) {
3081
+ m(this, e, ((i) => {
3082
+ Ds(this, Object.keys(t), ((r) => {
3083
+ Ds(this, Object.values(t), ((s) => {
3084
+ this.i._addFlatHashMapToInputStream(r, s, Object.keys(t).length, i, n);
3085
+ }));
3086
+ }));
3087
+ }));
3088
+ }
3089
+ addProtoToStream(t, e, n, i) {
3090
+ m(this, n, ((r) => {
3091
+ m(this, e, ((s) => {
3092
+ const o = this.i._malloc(t.length);
3093
+ this.i.HEAPU8.set(t, o), this.i._addProtoToInputStream(o, t.length, s, r, i), this.i._free(o);
3094
+ }));
3095
+ }));
3096
+ }
3097
+ addEmptyPacketToStream(t, e) {
3098
+ m(this, t, ((n) => {
3099
+ this.i._addEmptyPacketToInputStream(n, e);
3100
+ }));
3101
+ }
3102
+ addBoolVectorToStream(t, e, n) {
3103
+ m(this, e, ((i) => {
3104
+ const r = this.i._allocateBoolVector(t.length);
3105
+ if (!r) throw Error("Unable to allocate new bool vector on heap.");
3106
+ for (const s of t) this.i._addBoolVectorEntry(r, s);
3107
+ this.i._addBoolVectorToInputStream(r, i, n);
3108
+ }));
3109
+ }
3110
+ addDoubleVectorToStream(t, e, n) {
3111
+ m(this, e, ((i) => {
3112
+ const r = this.i._allocateDoubleVector(t.length);
3113
+ if (!r) throw Error("Unable to allocate new double vector on heap.");
3114
+ for (const s of t) this.i._addDoubleVectorEntry(r, s);
3115
+ this.i._addDoubleVectorToInputStream(r, i, n);
3116
+ }));
3117
+ }
3118
+ addFloatVectorToStream(t, e, n) {
3119
+ m(this, e, ((i) => {
3120
+ const r = this.i._allocateFloatVector(t.length);
3121
+ if (!r) throw Error("Unable to allocate new float vector on heap.");
3122
+ for (const s of t) this.i._addFloatVectorEntry(r, s);
3123
+ this.i._addFloatVectorToInputStream(r, i, n);
3124
+ }));
3125
+ }
3126
+ addIntVectorToStream(t, e, n) {
3127
+ m(this, e, ((i) => {
3128
+ const r = this.i._allocateIntVector(t.length);
3129
+ if (!r) throw Error("Unable to allocate new int vector on heap.");
3130
+ for (const s of t) this.i._addIntVectorEntry(r, s);
3131
+ this.i._addIntVectorToInputStream(r, i, n);
3132
+ }));
3133
+ }
3134
+ addUintVectorToStream(t, e, n) {
3135
+ m(this, e, ((i) => {
3136
+ const r = this.i._allocateUintVector(t.length);
3137
+ if (!r) throw Error("Unable to allocate new unsigned int vector on heap.");
3138
+ for (const s of t) this.i._addUintVectorEntry(r, s);
3139
+ this.i._addUintVectorToInputStream(r, i, n);
3140
+ }));
3141
+ }
3142
+ addStringVectorToStream(t, e, n) {
3143
+ m(this, e, ((i) => {
3144
+ const r = this.i._allocateStringVector(t.length);
3145
+ if (!r) throw Error("Unable to allocate new string vector on heap.");
3146
+ for (const s of t) m(this, s, ((o) => {
3147
+ this.i._addStringVectorEntry(r, o);
3148
+ }));
3149
+ this.i._addStringVectorToInputStream(r, i, n);
3150
+ }));
3151
+ }
3152
+ addBoolToInputSidePacket(t, e) {
3153
+ m(this, e, ((n) => {
3154
+ this.i._addBoolToInputSidePacket(t, n);
3155
+ }));
3156
+ }
3157
+ addDoubleToInputSidePacket(t, e) {
3158
+ m(this, e, ((n) => {
3159
+ this.i._addDoubleToInputSidePacket(t, n);
3160
+ }));
3161
+ }
3162
+ addFloatToInputSidePacket(t, e) {
3163
+ m(this, e, ((n) => {
3164
+ this.i._addFloatToInputSidePacket(t, n);
3165
+ }));
3166
+ }
3167
+ addIntToInputSidePacket(t, e) {
3168
+ m(this, e, ((n) => {
3169
+ this.i._addIntToInputSidePacket(t, n);
3170
+ }));
3171
+ }
3172
+ addUintToInputSidePacket(t, e) {
3173
+ m(this, e, ((n) => {
3174
+ this.i._addUintToInputSidePacket(t, n);
3175
+ }));
3176
+ }
3177
+ addStringToInputSidePacket(t, e) {
3178
+ m(this, e, ((n) => {
3179
+ m(this, t, ((i) => {
3180
+ this.i._addStringToInputSidePacket(i, n);
3181
+ }));
3182
+ }));
3183
+ }
3184
+ addProtoToInputSidePacket(t, e, n) {
3185
+ m(this, n, ((i) => {
3186
+ m(this, e, ((r) => {
3187
+ const s = this.i._malloc(t.length);
3188
+ this.i.HEAPU8.set(t, s), this.i._addProtoToInputSidePacket(s, t.length, r, i), this.i._free(s);
3189
+ }));
3190
+ }));
3191
+ }
3192
+ addBoolVectorToInputSidePacket(t, e) {
3193
+ m(this, e, ((n) => {
3194
+ const i = this.i._allocateBoolVector(t.length);
3195
+ if (!i) throw Error("Unable to allocate new bool vector on heap.");
3196
+ for (const r of t) this.i._addBoolVectorEntry(i, r);
3197
+ this.i._addBoolVectorToInputSidePacket(i, n);
3198
+ }));
3199
+ }
3200
+ addDoubleVectorToInputSidePacket(t, e) {
3201
+ m(this, e, ((n) => {
3202
+ const i = this.i._allocateDoubleVector(t.length);
3203
+ if (!i) throw Error("Unable to allocate new double vector on heap.");
3204
+ for (const r of t) this.i._addDoubleVectorEntry(i, r);
3205
+ this.i._addDoubleVectorToInputSidePacket(i, n);
3206
+ }));
3207
+ }
3208
+ addFloatVectorToInputSidePacket(t, e) {
3209
+ m(this, e, ((n) => {
3210
+ const i = this.i._allocateFloatVector(t.length);
3211
+ if (!i) throw Error("Unable to allocate new float vector on heap.");
3212
+ for (const r of t) this.i._addFloatVectorEntry(i, r);
3213
+ this.i._addFloatVectorToInputSidePacket(i, n);
3214
+ }));
3215
+ }
3216
+ addIntVectorToInputSidePacket(t, e) {
3217
+ m(this, e, ((n) => {
3218
+ const i = this.i._allocateIntVector(t.length);
3219
+ if (!i) throw Error("Unable to allocate new int vector on heap.");
3220
+ for (const r of t) this.i._addIntVectorEntry(i, r);
3221
+ this.i._addIntVectorToInputSidePacket(i, n);
3222
+ }));
3223
+ }
3224
+ addUintVectorToInputSidePacket(t, e) {
3225
+ m(this, e, ((n) => {
3226
+ const i = this.i._allocateUintVector(t.length);
3227
+ if (!i) throw Error("Unable to allocate new unsigned int vector on heap.");
3228
+ for (const r of t) this.i._addUintVectorEntry(i, r);
3229
+ this.i._addUintVectorToInputSidePacket(i, n);
3230
+ }));
3231
+ }
3232
+ addStringVectorToInputSidePacket(t, e) {
3233
+ m(this, e, ((n) => {
3234
+ const i = this.i._allocateStringVector(t.length);
3235
+ if (!i) throw Error("Unable to allocate new string vector on heap.");
3236
+ for (const r of t) m(this, r, ((s) => {
3237
+ this.i._addStringVectorEntry(i, s);
3238
+ }));
3239
+ this.i._addStringVectorToInputSidePacket(i, n);
3240
+ }));
3241
+ }
3242
+ attachBoolListener(t, e) {
3243
+ Rt(this, t, e), m(this, t, ((n) => {
3244
+ this.i._attachBoolListener(n);
3245
+ }));
3246
+ }
3247
+ attachBoolVectorListener(t, e) {
3248
+ Jt(this, t, e), m(this, t, ((n) => {
3249
+ this.i._attachBoolVectorListener(n);
3250
+ }));
3251
+ }
3252
+ attachIntListener(t, e) {
3253
+ Rt(this, t, e), m(this, t, ((n) => {
3254
+ this.i._attachIntListener(n);
3255
+ }));
3256
+ }
3257
+ attachIntVectorListener(t, e) {
3258
+ Jt(this, t, e), m(this, t, ((n) => {
3259
+ this.i._attachIntVectorListener(n);
3260
+ }));
3261
+ }
3262
+ attachUintListener(t, e) {
3263
+ Rt(this, t, e), m(this, t, ((n) => {
3264
+ this.i._attachUintListener(n);
3265
+ }));
3266
+ }
3267
+ attachUintVectorListener(t, e) {
3268
+ Jt(this, t, e), m(this, t, ((n) => {
3269
+ this.i._attachUintVectorListener(n);
3270
+ }));
3271
+ }
3272
+ attachDoubleListener(t, e) {
3273
+ Rt(this, t, e), m(this, t, ((n) => {
3274
+ this.i._attachDoubleListener(n);
3275
+ }));
3276
+ }
3277
+ attachDoubleVectorListener(t, e) {
3278
+ Jt(this, t, e), m(this, t, ((n) => {
3279
+ this.i._attachDoubleVectorListener(n);
3280
+ }));
3281
+ }
3282
+ attachFloatListener(t, e) {
3283
+ Rt(this, t, e), m(this, t, ((n) => {
3284
+ this.i._attachFloatListener(n);
3285
+ }));
3286
+ }
3287
+ attachFloatVectorListener(t, e) {
3288
+ Jt(this, t, e), m(this, t, ((n) => {
3289
+ this.i._attachFloatVectorListener(n);
3290
+ }));
3291
+ }
3292
+ attachStringListener(t, e) {
3293
+ Rt(this, t, e), m(this, t, ((n) => {
3294
+ this.i._attachStringListener(n);
3295
+ }));
3296
+ }
3297
+ attachStringVectorListener(t, e) {
3298
+ Jt(this, t, e), m(this, t, ((n) => {
3299
+ this.i._attachStringVectorListener(n);
3300
+ }));
3301
+ }
3302
+ attachProtoListener(t, e, n) {
3303
+ Rt(this, t, e), m(this, t, ((i) => {
3304
+ this.i._attachProtoListener(i, n || !1);
3305
+ }));
3306
+ }
3307
+ attachProtoVectorListener(t, e, n) {
3308
+ Jt(this, t, e), m(this, t, ((i) => {
3309
+ this.i._attachProtoVectorListener(i, n || !1);
3310
+ }));
3311
+ }
3312
+ attachAudioListener(t, e, n) {
3313
+ this.i._attachAudioListener || console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'), Rt(this, t, ((i, r) => {
3314
+ i = new Float32Array(i.buffer, i.byteOffset, i.length / 4), e(i, r);
3315
+ })), m(this, t, ((i) => {
3316
+ this.i._attachAudioListener(i, n || !1);
3317
+ }));
3318
+ }
3319
+ finishProcessing() {
3320
+ this.i._waitUntilIdle();
3321
+ }
3322
+ closeGraph() {
3323
+ this.i._closeGraph(), this.i.simpleListeners = void 0, this.i.emptyPacketListeners = void 0;
3324
+ }
3325
+ }, class extends Gs {
3326
+ get ga() {
3327
+ return this.i;
3328
+ }
3329
+ pa(t, e, n) {
3330
+ m(this, e, ((i) => {
3331
+ const [r, s] = Is(this, t, i);
3332
+ this.ga._addBoundTextureAsImageToStream(i, r, s, n);
3333
+ }));
3334
+ }
3335
+ Z(t, e) {
3336
+ Rt(this, t, e), m(this, t, ((n) => {
3337
+ this.ga._attachImageListener(n);
3338
+ }));
3339
+ }
3340
+ aa(t, e) {
3341
+ Jt(this, t, e), m(this, t, ((n) => {
3342
+ this.ga._attachImageVectorListener(n);
3343
+ }));
3344
+ }
3345
+ }));
3346
+ var Gs, Ft = class extends ac {
3347
+ };
3348
+ async function E(t, e, n) {
3349
+ return (async function(i, r, s, o) {
3350
+ return ic(i, r, s, o);
3351
+ })(t, n.canvas ?? (Ga() ? void 0 : document.createElement("canvas")), e, n);
3352
+ }
3353
+ function $a(t, e, n, i) {
3354
+ if (t.U) {
3355
+ const s = new ya();
3356
+ if (n != null && n.regionOfInterest) {
3357
+ if (!t.oa) throw Error("This task doesn't support region-of-interest.");
3358
+ var r = n.regionOfInterest;
3359
+ if (r.left >= r.right || r.top >= r.bottom) throw Error("Expected RectF with left < right and top < bottom.");
3360
+ if (r.left < 0 || r.top < 0 || r.right > 1 || r.bottom > 1) throw Error("Expected RectF values to be in [0,1].");
3361
+ y(s, 1, (r.left + r.right) / 2), y(s, 2, (r.top + r.bottom) / 2), y(s, 4, r.right - r.left), y(s, 3, r.bottom - r.top);
3362
+ } else y(s, 1, 0.5), y(s, 2, 0.5), y(s, 4, 1), y(s, 3, 1);
3363
+ if (n != null && n.rotationDegrees) {
3364
+ if ((n == null ? void 0 : n.rotationDegrees) % 90 != 0) throw Error("Expected rotation to be a multiple of 90°.");
3365
+ if (y(s, 5, -Math.PI * n.rotationDegrees / 180), (n == null ? void 0 : n.rotationDegrees) % 180 != 0) {
3366
+ const [o, a] = Ha(e);
3367
+ n = U(s, 3) * a / o, r = U(s, 4) * o / a, y(s, 4, n), y(s, 3, r);
3368
+ }
3369
+ }
3370
+ t.g.addProtoToStream(s.g(), "mediapipe.NormalizedRect", t.U, i);
3371
+ }
3372
+ t.g.pa(e, t.X, i ?? performance.now()), t.finishProcessing();
3373
+ }
3374
+ function Pt(t, e, n) {
3375
+ var i;
3376
+ if ((i = t.baseOptions) != null && i.g()) throw Error("Task is not initialized with image mode. 'runningMode' must be set to 'IMAGE'.");
3377
+ $a(t, e, n, t.C + 1);
3378
+ }
3379
+ function Vt(t, e, n, i) {
3380
+ var r;
3381
+ if (!((r = t.baseOptions) != null && r.g())) throw Error("Task is not initialized with video mode. 'runningMode' must be set to 'VIDEO'.");
3382
+ $a(t, e, n, i);
3383
+ }
3384
+ function Ve(t, e, n, i) {
3385
+ var r = e.data;
3386
+ const s = e.width, o = s * (e = e.height);
3387
+ if ((r instanceof Uint8Array || r instanceof Float32Array) && r.length !== o) throw Error("Unsupported channel count: " + r.length / o);
3388
+ return t = new X([r], n, !1, t.g.i.canvas, t.P, s, e), i ? t.clone() : t;
3389
+ }
3390
+ var mt = class extends Ci {
3391
+ constructor(t, e, n, i) {
3392
+ super(t), this.g = t, this.X = e, this.U = n, this.oa = i, this.P = new Ka();
3393
+ }
3394
+ l(t, e = !0) {
3395
+ if ("runningMode" in t && S(this.baseOptions, 2, dn(!!t.runningMode && t.runningMode !== "IMAGE")), t.canvas !== void 0 && this.g.i.canvas !== t.canvas) throw Error("You must create a new task to reset the canvas.");
3396
+ return super.l(t, e);
3397
+ }
3398
+ close() {
3399
+ this.P.close(), super.close();
3400
+ }
3401
+ };
3402
+ mt.prototype.close = mt.prototype.close;
3403
+ var At = class extends mt {
3404
+ constructor(t, e) {
3405
+ super(new Ft(t, e), "image_in", "norm_rect_in", !1), this.j = { detections: [] }, _(t = this.h = new ri(), 0, 1, e = new D()), y(this.h, 2, 0.5), y(this.h, 3, 0.3);
3406
+ }
3407
+ get baseOptions() {
3408
+ return x(this.h, D, 1);
3409
+ }
3410
+ set baseOptions(t) {
3411
+ _(this.h, 0, 1, t);
3412
+ }
3413
+ o(t) {
3414
+ return "minDetectionConfidence" in t && y(this.h, 2, t.minDetectionConfidence ?? 0.5), "minSuppressionThreshold" in t && y(this.h, 3, t.minSuppressionThreshold ?? 0.3), this.l(t);
3415
+ }
3416
+ F(t, e) {
3417
+ return this.j = { detections: [] }, Pt(this, t, e), this.j;
3418
+ }
3419
+ G(t, e, n) {
3420
+ return this.j = { detections: [] }, Vt(this, t, n, e), this.j;
3421
+ }
3422
+ m() {
3423
+ var t = new _t();
3424
+ N(t, "image_in"), N(t, "norm_rect_in"), T(t, "detections");
3425
+ const e = new yt();
3426
+ Bt(e, G2, this.h);
3427
+ const n = new st();
3428
+ pt(n, 2, "mediapipe.tasks.vision.face_detector.FaceDetectorGraph"), R(n, "IMAGE:image_in"), R(n, "NORM_RECT:norm_rect_in"), w(n, "DETECTIONS:detections"), n.o(e), St(t, n), this.g.attachProtoVectorListener("detections", ((i, r) => {
3429
+ for (const s of i) i = pa(s), this.j.detections.push(Va(i));
3430
+ d(this, r);
3431
+ })), this.g.attachEmptyPacketListener("detections", ((i) => {
3432
+ d(this, i);
3433
+ })), t = t.g(), this.setGraph(new Uint8Array(t), !0);
3434
+ }
3435
+ };
3436
+ At.prototype.detectForVideo = At.prototype.G, At.prototype.detect = At.prototype.F, At.prototype.setOptions = At.prototype.o, At.createFromModelPath = async function(t, e) {
3437
+ return E(At, t, { baseOptions: { modelAssetPath: e } });
3438
+ }, At.createFromModelBuffer = function(t, e) {
3439
+ return E(At, t, { baseOptions: { modelAssetBuffer: e } });
3440
+ }, At.createFromOptions = function(t, e) {
3441
+ return E(At, t, e);
3442
+ };
3443
+ var Pr = Lt([61, 146], [146, 91], [91, 181], [181, 84], [84, 17], [17, 314], [314, 405], [405, 321], [321, 375], [375, 291], [61, 185], [185, 40], [40, 39], [39, 37], [37, 0], [0, 267], [267, 269], [269, 270], [270, 409], [409, 291], [78, 95], [95, 88], [88, 178], [178, 87], [87, 14], [14, 317], [317, 402], [402, 318], [318, 324], [324, 308], [78, 191], [191, 80], [80, 81], [81, 82], [82, 13], [13, 312], [312, 311], [311, 310], [310, 415], [415, 308]), Rr = Lt([263, 249], [249, 390], [390, 373], [373, 374], [374, 380], [380, 381], [381, 382], [382, 362], [263, 466], [466, 388], [388, 387], [387, 386], [386, 385], [385, 384], [384, 398], [398, 362]), Or = Lt([276, 283], [283, 282], [282, 295], [295, 285], [300, 293], [293, 334], [334, 296], [296, 336]), Ja = Lt([474, 475], [475, 476], [476, 477], [477, 474]), Nr = Lt([33, 7], [7, 163], [163, 144], [144, 145], [145, 153], [153, 154], [154, 155], [155, 133], [33, 246], [246, 161], [161, 160], [160, 159], [159, 158], [158, 157], [157, 173], [173, 133]), Cr = Lt([46, 53], [53, 52], [52, 65], [65, 55], [70, 63], [63, 105], [105, 66], [66, 107]), Za = Lt([469, 470], [470, 471], [471, 472], [472, 469]), Ir = Lt([10, 338], [338, 297], [297, 332], [332, 284], [284, 251], [251, 389], [389, 356], [356, 454], [454, 323], [323, 361], [361, 288], [288, 397], [397, 365], [365, 379], [379, 378], [378, 400], [400, 377], [377, 152], [152, 148], [148, 176], [176, 149], [149, 150], [150, 136], [136, 172], [172, 58], [58, 132], [132, 93], [93, 234], [234, 127], [127, 162], [162, 21], [21, 54], [54, 103], [103, 67], [67, 109], [109, 10]), Qa = [...Pr, ...Rr, ...Or, ...Nr, ...Cr, ...Ir], t1 = Lt([127, 34], [34, 139], [139, 127], [11, 0], [0, 37], [37, 11], [232, 231], [231, 120], [120, 232], [72, 37], [37, 39], [39, 72], [128, 121], [121, 47], [47, 128], [232, 121], [121, 128], [128, 232], [104, 69], [69, 67], [67, 104], [175, 171], [171, 148], [148, 175], [118, 50], [50, 101], [101, 118], [73, 39], [39, 40], [40, 73], [9, 151], [151, 108], [108, 9], [48, 115], [115, 131], [131, 48], [194, 204], [204, 211], [211, 194], [74, 40], [40, 185], [185, 74], [80, 42], [42, 183], [183, 80], [40, 92], [92, 186], [186, 40], [230, 229], [229, 118], [118, 230], [202, 212], [212, 214], [214, 202], [83, 18], [18, 17], [17, 83], [76, 61], [61, 146], [146, 76], [160, 29], [29, 30], [30, 160], [56, 157], [157, 173], [173, 56], [106, 204], [204, 194], [194, 106], [135, 214], [214, 192], [192, 135], [203, 165], [165, 98], [98, 203], [21, 71], [71, 68], [68, 21], [51, 45], [45, 4], [4, 51], [144, 24], [24, 23], [23, 144], [77, 146], [146, 91], [91, 77], [205, 50], [50, 187], [187, 205], [201, 200], [200, 18], [18, 201], [91, 106], [106, 182], [182, 91], [90, 91], [91, 181], [181, 90], [85, 84], [84, 17], [17, 85], [206, 203], [203, 36], [36, 206], [148, 171], [171, 140], [140, 148], [92, 40], [40, 39], [39, 92], [193, 189], [189, 244], [244, 193], [159, 158], [158, 28], [28, 159], [247, 246], [246, 161], [161, 247], [236, 3], [3, 196], [196, 236], [54, 68], [68, 104], [104, 54], [193, 168], [168, 8], [8, 193], [117, 228], [228, 31], [31, 117], [189, 193], [193, 55], [55, 189], [98, 97], [97, 99], [99, 98], [126, 47], [47, 100], [100, 126], [166, 79], [79, 218], [218, 166], [155, 154], [154, 26], [26, 155], [209, 49], [49, 131], [131, 209], [135, 136], [136, 150], [150, 135], [47, 126], [126, 217], [217, 47], [223, 52], [52, 53], [53, 223], [45, 51], [51, 134], [134, 45], [211, 170], [170, 140], [140, 211], [67, 69], [69, 108], [108, 67], [43, 106], [106, 91], [91, 43], [230, 119], [119, 120], [120, 230], [226, 130], [130, 247], [247, 226], [63, 53], [53, 52], [52, 63], [238, 20], [20, 242], [242, 238], [46, 70], [70, 156], [156, 46], [78, 62], [62, 96], [96, 78], [46, 53], [53, 63], [63, 46], [143, 34], [34, 227], [227, 143], [123, 117], [117, 111], [111, 123], [44, 125], [125, 19], [19, 44], [236, 134], [134, 51], [51, 236], [216, 206], [206, 205], [205, 216], [154, 153], [153, 22], [22, 154], [39, 37], [37, 167], [167, 39], [200, 201], [201, 208], [208, 200], [36, 142], [142, 100], [100, 36], [57, 212], [212, 202], [202, 57], [20, 60], [60, 99], [99, 20], [28, 158], [158, 157], [157, 28], [35, 226], [226, 113], [113, 35], [160, 159], [159, 27], [27, 160], [204, 202], [202, 210], [210, 204], [113, 225], [225, 46], [46, 113], [43, 202], [202, 204], [204, 43], [62, 76], [76, 77], [77, 62], [137, 123], [123, 116], [116, 137], [41, 38], [38, 72], [72, 41], [203, 129], [129, 142], [142, 203], [64, 98], [98, 240], [240, 64], [49, 102], [102, 64], [64, 49], [41, 73], [73, 74], [74, 41], [212, 216], [216, 207], [207, 212], [42, 74], [74, 184], [184, 42], [169, 170], [170, 211], [211, 169], [170, 149], [149, 176], [176, 170], [105, 66], [66, 69], [69, 105], [122, 6], [6, 168], [168, 122], [123, 147], [147, 187], [187, 123], [96, 77], [77, 90], [90, 96], [65, 55], [55, 107], [107, 65], [89, 90], [90, 180], [180, 89], [101, 100], [100, 120], [120, 101], [63, 105], [105, 104], [104, 63], [93, 137], [137, 227], [227, 93], [15, 86], [86, 85], [85, 15], [129, 102], [102, 49], [49, 129], [14, 87], [87, 86], [86, 14], [55, 8], [8, 9], [9, 55], [100, 47], [47, 121], [121, 100], [145, 23], [23, 22], [22, 145], [88, 89], [89, 179], [179, 88], [6, 122], [122, 196], [196, 6], [88, 95], [95, 96], [96, 88], [138, 172], [172, 136], [136, 138], [215, 58], [58, 172], [172, 215], [115, 48], [48, 219], [219, 115], [42, 80], [80, 81], [81, 42], [195, 3], [3, 51], [51, 195], [43, 146], [146, 61], [61, 43], [171, 175], [175, 199], [199, 171], [81, 82], [82, 38], [38, 81], [53, 46], [46, 225], [225, 53], [144, 163], [163, 110], [110, 144], [52, 65], [65, 66], [66, 52], [229, 228], [228, 117], [117, 229], [34, 127], [127, 234], [234, 34], [107, 108], [108, 69], [69, 107], [109, 108], [108, 151], [151, 109], [48, 64], [64, 235], [235, 48], [62, 78], [78, 191], [191, 62], [129, 209], [209, 126], [126, 129], [111, 35], [35, 143], [143, 111], [117, 123], [123, 50], [50, 117], [222, 65], [65, 52], [52, 222], [19, 125], [125, 141], [141, 19], [221, 55], [55, 65], [65, 221], [3, 195], [195, 197], [197, 3], [25, 7], [7, 33], [33, 25], [220, 237], [237, 44], [44, 220], [70, 71], [71, 139], [139, 70], [122, 193], [193, 245], [245, 122], [247, 130], [130, 33], [33, 247], [71, 21], [21, 162], [162, 71], [170, 169], [169, 150], [150, 170], [188, 174], [174, 196], [196, 188], [216, 186], [186, 92], [92, 216], [2, 97], [97, 167], [167, 2], [141, 125], [125, 241], [241, 141], [164, 167], [167, 37], [37, 164], [72, 38], [38, 12], [12, 72], [38, 82], [82, 13], [13, 38], [63, 68], [68, 71], [71, 63], [226, 35], [35, 111], [111, 226], [101, 50], [50, 205], [205, 101], [206, 92], [92, 165], [165, 206], [209, 198], [198, 217], [217, 209], [165, 167], [167, 97], [97, 165], [220, 115], [115, 218], [218, 220], [133, 112], [112, 243], [243, 133], [239, 238], [238, 241], [241, 239], [214, 135], [135, 169], [169, 214], [190, 173], [173, 133], [133, 190], [171, 208], [208, 32], [32, 171], [125, 44], [44, 237], [237, 125], [86, 87], [87, 178], [178, 86], [85, 86], [86, 179], [179, 85], [84, 85], [85, 180], [180, 84], [83, 84], [84, 181], [181, 83], [201, 83], [83, 182], [182, 201], [137, 93], [93, 132], [132, 137], [76, 62], [62, 183], [183, 76], [61, 76], [76, 184], [184, 61], [57, 61], [61, 185], [185, 57], [212, 57], [57, 186], [186, 212], [214, 207], [207, 187], [187, 214], [34, 143], [143, 156], [156, 34], [79, 239], [239, 237], [237, 79], [123, 137], [137, 177], [177, 123], [44, 1], [1, 4], [4, 44], [201, 194], [194, 32], [32, 201], [64, 102], [102, 129], [129, 64], [213, 215], [215, 138], [138, 213], [59, 166], [166, 219], [219, 59], [242, 99], [99, 97], [97, 242], [2, 94], [94, 141], [141, 2], [75, 59], [59, 235], [235, 75], [24, 110], [110, 228], [228, 24], [25, 130], [130, 226], [226, 25], [23, 24], [24, 229], [229, 23], [22, 23], [23, 230], [230, 22], [26, 22], [22, 231], [231, 26], [112, 26], [26, 232], [232, 112], [189, 190], [190, 243], [243, 189], [221, 56], [56, 190], [190, 221], [28, 56], [56, 221], [221, 28], [27, 28], [28, 222], [222, 27], [29, 27], [27, 223], [223, 29], [30, 29], [29, 224], [224, 30], [247, 30], [30, 225], [225, 247], [238, 79], [79, 20], [20, 238], [166, 59], [59, 75], [75, 166], [60, 75], [75, 240], [240, 60], [147, 177], [177, 215], [215, 147], [20, 79], [79, 166], [166, 20], [187, 147], [147, 213], [213, 187], [112, 233], [233, 244], [244, 112], [233, 128], [128, 245], [245, 233], [128, 114], [114, 188], [188, 128], [114, 217], [217, 174], [174, 114], [131, 115], [115, 220], [220, 131], [217, 198], [198, 236], [236, 217], [198, 131], [131, 134], [134, 198], [177, 132], [132, 58], [58, 177], [143, 35], [35, 124], [124, 143], [110, 163], [163, 7], [7, 110], [228, 110], [110, 25], [25, 228], [356, 389], [389, 368], [368, 356], [11, 302], [302, 267], [267, 11], [452, 350], [350, 349], [349, 452], [302, 303], [303, 269], [269, 302], [357, 343], [343, 277], [277, 357], [452, 453], [453, 357], [357, 452], [333, 332], [332, 297], [297, 333], [175, 152], [152, 377], [377, 175], [347, 348], [348, 330], [330, 347], [303, 304], [304, 270], [270, 303], [9, 336], [336, 337], [337, 9], [278, 279], [279, 360], [360, 278], [418, 262], [262, 431], [431, 418], [304, 408], [408, 409], [409, 304], [310, 415], [415, 407], [407, 310], [270, 409], [409, 410], [410, 270], [450, 348], [348, 347], [347, 450], [422, 430], [430, 434], [434, 422], [313, 314], [314, 17], [17, 313], [306, 307], [307, 375], [375, 306], [387, 388], [388, 260], [260, 387], [286, 414], [414, 398], [398, 286], [335, 406], [406, 418], [418, 335], [364, 367], [367, 416], [416, 364], [423, 358], [358, 327], [327, 423], [251, 284], [284, 298], [298, 251], [281, 5], [5, 4], [4, 281], [373, 374], [374, 253], [253, 373], [307, 320], [320, 321], [321, 307], [425, 427], [427, 411], [411, 425], [421, 313], [313, 18], [18, 421], [321, 405], [405, 406], [406, 321], [320, 404], [404, 405], [405, 320], [315, 16], [16, 17], [17, 315], [426, 425], [425, 266], [266, 426], [377, 400], [400, 369], [369, 377], [322, 391], [391, 269], [269, 322], [417, 465], [465, 464], [464, 417], [386, 257], [257, 258], [258, 386], [466, 260], [260, 388], [388, 466], [456, 399], [399, 419], [419, 456], [284, 332], [332, 333], [333, 284], [417, 285], [285, 8], [8, 417], [346, 340], [340, 261], [261, 346], [413, 441], [441, 285], [285, 413], [327, 460], [460, 328], [328, 327], [355, 371], [371, 329], [329, 355], [392, 439], [439, 438], [438, 392], [382, 341], [341, 256], [256, 382], [429, 420], [420, 360], [360, 429], [364, 394], [394, 379], [379, 364], [277, 343], [343, 437], [437, 277], [443, 444], [444, 283], [283, 443], [275, 440], [440, 363], [363, 275], [431, 262], [262, 369], [369, 431], [297, 338], [338, 337], [337, 297], [273, 375], [375, 321], [321, 273], [450, 451], [451, 349], [349, 450], [446, 342], [342, 467], [467, 446], [293, 334], [334, 282], [282, 293], [458, 461], [461, 462], [462, 458], [276, 353], [353, 383], [383, 276], [308, 324], [324, 325], [325, 308], [276, 300], [300, 293], [293, 276], [372, 345], [345, 447], [447, 372], [352, 345], [345, 340], [340, 352], [274, 1], [1, 19], [19, 274], [456, 248], [248, 281], [281, 456], [436, 427], [427, 425], [425, 436], [381, 256], [256, 252], [252, 381], [269, 391], [391, 393], [393, 269], [200, 199], [199, 428], [428, 200], [266, 330], [330, 329], [329, 266], [287, 273], [273, 422], [422, 287], [250, 462], [462, 328], [328, 250], [258, 286], [286, 384], [384, 258], [265, 353], [353, 342], [342, 265], [387, 259], [259, 257], [257, 387], [424, 431], [431, 430], [430, 424], [342, 353], [353, 276], [276, 342], [273, 335], [335, 424], [424, 273], [292, 325], [325, 307], [307, 292], [366, 447], [447, 345], [345, 366], [271, 303], [303, 302], [302, 271], [423, 266], [266, 371], [371, 423], [294, 455], [455, 460], [460, 294], [279, 278], [278, 294], [294, 279], [271, 272], [272, 304], [304, 271], [432, 434], [434, 427], [427, 432], [272, 407], [407, 408], [408, 272], [394, 430], [430, 431], [431, 394], [395, 369], [369, 400], [400, 395], [334, 333], [333, 299], [299, 334], [351, 417], [417, 168], [168, 351], [352, 280], [280, 411], [411, 352], [325, 319], [319, 320], [320, 325], [295, 296], [296, 336], [336, 295], [319, 403], [403, 404], [404, 319], [330, 348], [348, 349], [349, 330], [293, 298], [298, 333], [333, 293], [323, 454], [454, 447], [447, 323], [15, 16], [16, 315], [315, 15], [358, 429], [429, 279], [279, 358], [14, 15], [15, 316], [316, 14], [285, 336], [336, 9], [9, 285], [329, 349], [349, 350], [350, 329], [374, 380], [380, 252], [252, 374], [318, 402], [402, 403], [403, 318], [6, 197], [197, 419], [419, 6], [318, 319], [319, 325], [325, 318], [367, 364], [364, 365], [365, 367], [435, 367], [367, 397], [397, 435], [344, 438], [438, 439], [439, 344], [272, 271], [271, 311], [311, 272], [195, 5], [5, 281], [281, 195], [273, 287], [287, 291], [291, 273], [396, 428], [428, 199], [199, 396], [311, 271], [271, 268], [268, 311], [283, 444], [444, 445], [445, 283], [373, 254], [254, 339], [339, 373], [282, 334], [334, 296], [296, 282], [449, 347], [347, 346], [346, 449], [264, 447], [447, 454], [454, 264], [336, 296], [296, 299], [299, 336], [338, 10], [10, 151], [151, 338], [278, 439], [439, 455], [455, 278], [292, 407], [407, 415], [415, 292], [358, 371], [371, 355], [355, 358], [340, 345], [345, 372], [372, 340], [346, 347], [347, 280], [280, 346], [442, 443], [443, 282], [282, 442], [19, 94], [94, 370], [370, 19], [441, 442], [442, 295], [295, 441], [248, 419], [419, 197], [197, 248], [263, 255], [255, 359], [359, 263], [440, 275], [275, 274], [274, 440], [300, 383], [383, 368], [368, 300], [351, 412], [412, 465], [465, 351], [263, 467], [467, 466], [466, 263], [301, 368], [368, 389], [389, 301], [395, 378], [378, 379], [379, 395], [412, 351], [351, 419], [419, 412], [436, 426], [426, 322], [322, 436], [2, 164], [164, 393], [393, 2], [370, 462], [462, 461], [461, 370], [164, 0], [0, 267], [267, 164], [302, 11], [11, 12], [12, 302], [268, 12], [12, 13], [13, 268], [293, 300], [300, 301], [301, 293], [446, 261], [261, 340], [340, 446], [330, 266], [266, 425], [425, 330], [426, 423], [423, 391], [391, 426], [429, 355], [355, 437], [437, 429], [391, 327], [327, 326], [326, 391], [440, 457], [457, 438], [438, 440], [341, 382], [382, 362], [362, 341], [459, 457], [457, 461], [461, 459], [434, 430], [430, 394], [394, 434], [414, 463], [463, 362], [362, 414], [396, 369], [369, 262], [262, 396], [354, 461], [461, 457], [457, 354], [316, 403], [403, 402], [402, 316], [315, 404], [404, 403], [403, 315], [314, 405], [405, 404], [404, 314], [313, 406], [406, 405], [405, 313], [421, 418], [418, 406], [406, 421], [366, 401], [401, 361], [361, 366], [306, 408], [408, 407], [407, 306], [291, 409], [409, 408], [408, 291], [287, 410], [410, 409], [409, 287], [432, 436], [436, 410], [410, 432], [434, 416], [416, 411], [411, 434], [264, 368], [368, 383], [383, 264], [309, 438], [438, 457], [457, 309], [352, 376], [376, 401], [401, 352], [274, 275], [275, 4], [4, 274], [421, 428], [428, 262], [262, 421], [294, 327], [327, 358], [358, 294], [433, 416], [416, 367], [367, 433], [289, 455], [455, 439], [439, 289], [462, 370], [370, 326], [326, 462], [2, 326], [326, 370], [370, 2], [305, 460], [460, 455], [455, 305], [254, 449], [449, 448], [448, 254], [255, 261], [261, 446], [446, 255], [253, 450], [450, 449], [449, 253], [252, 451], [451, 450], [450, 252], [256, 452], [452, 451], [451, 256], [341, 453], [453, 452], [452, 341], [413, 464], [464, 463], [463, 413], [441, 413], [413, 414], [414, 441], [258, 442], [442, 441], [441, 258], [257, 443], [443, 442], [442, 257], [259, 444], [444, 443], [443, 259], [260, 445], [445, 444], [444, 260], [467, 342], [342, 445], [445, 467], [459, 458], [458, 250], [250, 459], [289, 392], [392, 290], [290, 289], [290, 328], [328, 460], [460, 290], [376, 433], [433, 435], [435, 376], [250, 290], [290, 392], [392, 250], [411, 416], [416, 433], [433, 411], [341, 463], [463, 464], [464, 341], [453, 464], [464, 465], [465, 453], [357, 465], [465, 412], [412, 357], [343, 412], [412, 399], [399, 343], [360, 363], [363, 440], [440, 360], [437, 399], [399, 456], [456, 437], [420, 456], [456, 363], [363, 420], [401, 435], [435, 288], [288, 401], [372, 383], [383, 353], [353, 372], [339, 255], [255, 249], [249, 339], [448, 261], [261, 255], [255, 448], [133, 243], [243, 190], [190, 133], [133, 155], [155, 112], [112, 133], [33, 246], [246, 247], [247, 33], [33, 130], [130, 25], [25, 33], [398, 384], [384, 286], [286, 398], [362, 398], [398, 414], [414, 362], [362, 463], [463, 341], [341, 362], [263, 359], [359, 467], [467, 263], [263, 249], [249, 255], [255, 263], [466, 467], [467, 260], [260, 466], [75, 60], [60, 166], [166, 75], [238, 239], [239, 79], [79, 238], [162, 127], [127, 139], [139, 162], [72, 11], [11, 37], [37, 72], [121, 232], [232, 120], [120, 121], [73, 72], [72, 39], [39, 73], [114, 128], [128, 47], [47, 114], [233, 232], [232, 128], [128, 233], [103, 104], [104, 67], [67, 103], [152, 175], [175, 148], [148, 152], [119, 118], [118, 101], [101, 119], [74, 73], [73, 40], [40, 74], [107, 9], [9, 108], [108, 107], [49, 48], [48, 131], [131, 49], [32, 194], [194, 211], [211, 32], [184, 74], [74, 185], [185, 184], [191, 80], [80, 183], [183, 191], [185, 40], [40, 186], [186, 185], [119, 230], [230, 118], [118, 119], [210, 202], [202, 214], [214, 210], [84, 83], [83, 17], [17, 84], [77, 76], [76, 146], [146, 77], [161, 160], [160, 30], [30, 161], [190, 56], [56, 173], [173, 190], [182, 106], [106, 194], [194, 182], [138, 135], [135, 192], [192, 138], [129, 203], [203, 98], [98, 129], [54, 21], [21, 68], [68, 54], [5, 51], [51, 4], [4, 5], [145, 144], [144, 23], [23, 145], [90, 77], [77, 91], [91, 90], [207, 205], [205, 187], [187, 207], [83, 201], [201, 18], [18, 83], [181, 91], [91, 182], [182, 181], [180, 90], [90, 181], [181, 180], [16, 85], [85, 17], [17, 16], [205, 206], [206, 36], [36, 205], [176, 148], [148, 140], [140, 176], [165, 92], [92, 39], [39, 165], [245, 193], [193, 244], [244, 245], [27, 159], [159, 28], [28, 27], [30, 247], [247, 161], [161, 30], [174, 236], [236, 196], [196, 174], [103, 54], [54, 104], [104, 103], [55, 193], [193, 8], [8, 55], [111, 117], [117, 31], [31, 111], [221, 189], [189, 55], [55, 221], [240, 98], [98, 99], [99, 240], [142, 126], [126, 100], [100, 142], [219, 166], [166, 218], [218, 219], [112, 155], [155, 26], [26, 112], [198, 209], [209, 131], [131, 198], [169, 135], [135, 150], [150, 169], [114, 47], [47, 217], [217, 114], [224, 223], [223, 53], [53, 224], [220, 45], [45, 134], [134, 220], [32, 211], [211, 140], [140, 32], [109, 67], [67, 108], [108, 109], [146, 43], [43, 91], [91, 146], [231, 230], [230, 120], [120, 231], [113, 226], [226, 247], [247, 113], [105, 63], [63, 52], [52, 105], [241, 238], [238, 242], [242, 241], [124, 46], [46, 156], [156, 124], [95, 78], [78, 96], [96, 95], [70, 46], [46, 63], [63, 70], [116, 143], [143, 227], [227, 116], [116, 123], [123, 111], [111, 116], [1, 44], [44, 19], [19, 1], [3, 236], [236, 51], [51, 3], [207, 216], [216, 205], [205, 207], [26, 154], [154, 22], [22, 26], [165, 39], [39, 167], [167, 165], [199, 200], [200, 208], [208, 199], [101, 36], [36, 100], [100, 101], [43, 57], [57, 202], [202, 43], [242, 20], [20, 99], [99, 242], [56, 28], [28, 157], [157, 56], [124, 35], [35, 113], [113, 124], [29, 160], [160, 27], [27, 29], [211, 204], [204, 210], [210, 211], [124, 113], [113, 46], [46, 124], [106, 43], [43, 204], [204, 106], [96, 62], [62, 77], [77, 96], [227, 137], [137, 116], [116, 227], [73, 41], [41, 72], [72, 73], [36, 203], [203, 142], [142, 36], [235, 64], [64, 240], [240, 235], [48, 49], [49, 64], [64, 48], [42, 41], [41, 74], [74, 42], [214, 212], [212, 207], [207, 214], [183, 42], [42, 184], [184, 183], [210, 169], [169, 211], [211, 210], [140, 170], [170, 176], [176, 140], [104, 105], [105, 69], [69, 104], [193, 122], [122, 168], [168, 193], [50, 123], [123, 187], [187, 50], [89, 96], [96, 90], [90, 89], [66, 65], [65, 107], [107, 66], [179, 89], [89, 180], [180, 179], [119, 101], [101, 120], [120, 119], [68, 63], [63, 104], [104, 68], [234, 93], [93, 227], [227, 234], [16, 15], [15, 85], [85, 16], [209, 129], [129, 49], [49, 209], [15, 14], [14, 86], [86, 15], [107, 55], [55, 9], [9, 107], [120, 100], [100, 121], [121, 120], [153, 145], [145, 22], [22, 153], [178, 88], [88, 179], [179, 178], [197, 6], [6, 196], [196, 197], [89, 88], [88, 96], [96, 89], [135, 138], [138, 136], [136, 135], [138, 215], [215, 172], [172, 138], [218, 115], [115, 219], [219, 218], [41, 42], [42, 81], [81, 41], [5, 195], [195, 51], [51, 5], [57, 43], [43, 61], [61, 57], [208, 171], [171, 199], [199, 208], [41, 81], [81, 38], [38, 41], [224, 53], [53, 225], [225, 224], [24, 144], [144, 110], [110, 24], [105, 52], [52, 66], [66, 105], [118, 229], [229, 117], [117, 118], [227, 34], [34, 234], [234, 227], [66, 107], [107, 69], [69, 66], [10, 109], [109, 151], [151, 10], [219, 48], [48, 235], [235, 219], [183, 62], [62, 191], [191, 183], [142, 129], [129, 126], [126, 142], [116, 111], [111, 143], [143, 116], [118, 117], [117, 50], [50, 118], [223, 222], [222, 52], [52, 223], [94, 19], [19, 141], [141, 94], [222, 221], [221, 65], [65, 222], [196, 3], [3, 197], [197, 196], [45, 220], [220, 44], [44, 45], [156, 70], [70, 139], [139, 156], [188, 122], [122, 245], [245, 188], [139, 71], [71, 162], [162, 139], [149, 170], [170, 150], [150, 149], [122, 188], [188, 196], [196, 122], [206, 216], [216, 92], [92, 206], [164, 2], [2, 167], [167, 164], [242, 141], [141, 241], [241, 242], [0, 164], [164, 37], [37, 0], [11, 72], [72, 12], [12, 11], [12, 38], [38, 13], [13, 12], [70, 63], [63, 71], [71, 70], [31, 226], [226, 111], [111, 31], [36, 101], [101, 205], [205, 36], [203, 206], [206, 165], [165, 203], [126, 209], [209, 217], [217, 126], [98, 165], [165, 97], [97, 98], [237, 220], [220, 218], [218, 237], [237, 239], [239, 241], [241, 237], [210, 214], [214, 169], [169, 210], [140, 171], [171, 32], [32, 140], [241, 125], [125, 237], [237, 241], [179, 86], [86, 178], [178, 179], [180, 85], [85, 179], [179, 180], [181, 84], [84, 180], [180, 181], [182, 83], [83, 181], [181, 182], [194, 201], [201, 182], [182, 194], [177, 137], [137, 132], [132, 177], [184, 76], [76, 183], [183, 184], [185, 61], [61, 184], [184, 185], [186, 57], [57, 185], [185, 186], [216, 212], [212, 186], [186, 216], [192, 214], [214, 187], [187, 192], [139, 34], [34, 156], [156, 139], [218, 79], [79, 237], [237, 218], [147, 123], [123, 177], [177, 147], [45, 44], [44, 4], [4, 45], [208, 201], [201, 32], [32, 208], [98, 64], [64, 129], [129, 98], [192, 213], [213, 138], [138, 192], [235, 59], [59, 219], [219, 235], [141, 242], [242, 97], [97, 141], [97, 2], [2, 141], [141, 97], [240, 75], [75, 235], [235, 240], [229, 24], [24, 228], [228, 229], [31, 25], [25, 226], [226, 31], [230, 23], [23, 229], [229, 230], [231, 22], [22, 230], [230, 231], [232, 26], [26, 231], [231, 232], [233, 112], [112, 232], [232, 233], [244, 189], [189, 243], [243, 244], [189, 221], [221, 190], [190, 189], [222, 28], [28, 221], [221, 222], [223, 27], [27, 222], [222, 223], [224, 29], [29, 223], [223, 224], [225, 30], [30, 224], [224, 225], [113, 247], [247, 225], [225, 113], [99, 60], [60, 240], [240, 99], [213, 147], [147, 215], [215, 213], [60, 20], [20, 166], [166, 60], [192, 187], [187, 213], [213, 192], [243, 112], [112, 244], [244, 243], [244, 233], [233, 245], [245, 244], [245, 128], [128, 188], [188, 245], [188, 114], [114, 174], [174, 188], [134, 131], [131, 220], [220, 134], [174, 217], [217, 236], [236, 174], [236, 198], [198, 134], [134, 236], [215, 177], [177, 58], [58, 215], [156, 143], [143, 124], [124, 156], [25, 110], [110, 7], [7, 25], [31, 228], [228, 25], [25, 31], [264, 356], [356, 368], [368, 264], [0, 11], [11, 267], [267, 0], [451, 452], [452, 349], [349, 451], [267, 302], [302, 269], [269, 267], [350, 357], [357, 277], [277, 350], [350, 452], [452, 357], [357, 350], [299, 333], [333, 297], [297, 299], [396, 175], [175, 377], [377, 396], [280, 347], [347, 330], [330, 280], [269, 303], [303, 270], [270, 269], [151, 9], [9, 337], [337, 151], [344, 278], [278, 360], [360, 344], [424, 418], [418, 431], [431, 424], [270, 304], [304, 409], [409, 270], [272, 310], [310, 407], [407, 272], [322, 270], [270, 410], [410, 322], [449, 450], [450, 347], [347, 449], [432, 422], [422, 434], [434, 432], [18, 313], [313, 17], [17, 18], [291, 306], [306, 375], [375, 291], [259, 387], [387, 260], [260, 259], [424, 335], [335, 418], [418, 424], [434, 364], [364, 416], [416, 434], [391, 423], [423, 327], [327, 391], [301, 251], [251, 298], [298, 301], [275, 281], [281, 4], [4, 275], [254, 373], [373, 253], [253, 254], [375, 307], [307, 321], [321, 375], [280, 425], [425, 411], [411, 280], [200, 421], [421, 18], [18, 200], [335, 321], [321, 406], [406, 335], [321, 320], [320, 405], [405, 321], [314, 315], [315, 17], [17, 314], [423, 426], [426, 266], [266, 423], [396, 377], [377, 369], [369, 396], [270, 322], [322, 269], [269, 270], [413, 417], [417, 464], [464, 413], [385, 386], [386, 258], [258, 385], [248, 456], [456, 419], [419, 248], [298, 284], [284, 333], [333, 298], [168, 417], [417, 8], [8, 168], [448, 346], [346, 261], [261, 448], [417, 413], [413, 285], [285, 417], [326, 327], [327, 328], [328, 326], [277, 355], [355, 329], [329, 277], [309, 392], [392, 438], [438, 309], [381, 382], [382, 256], [256, 381], [279, 429], [429, 360], [360, 279], [365, 364], [364, 379], [379, 365], [355, 277], [277, 437], [437, 355], [282, 443], [443, 283], [283, 282], [281, 275], [275, 363], [363, 281], [395, 431], [431, 369], [369, 395], [299, 297], [297, 337], [337, 299], [335, 273], [273, 321], [321, 335], [348, 450], [450, 349], [349, 348], [359, 446], [446, 467], [467, 359], [283, 293], [293, 282], [282, 283], [250, 458], [458, 462], [462, 250], [300, 276], [276, 383], [383, 300], [292, 308], [308, 325], [325, 292], [283, 276], [276, 293], [293, 283], [264, 372], [372, 447], [447, 264], [346, 352], [352, 340], [340, 346], [354, 274], [274, 19], [19, 354], [363, 456], [456, 281], [281, 363], [426, 436], [436, 425], [425, 426], [380, 381], [381, 252], [252, 380], [267, 269], [269, 393], [393, 267], [421, 200], [200, 428], [428, 421], [371, 266], [266, 329], [329, 371], [432, 287], [287, 422], [422, 432], [290, 250], [250, 328], [328, 290], [385, 258], [258, 384], [384, 385], [446, 265], [265, 342], [342, 446], [386, 387], [387, 257], [257, 386], [422, 424], [424, 430], [430, 422], [445, 342], [342, 276], [276, 445], [422, 273], [273, 424], [424, 422], [306, 292], [292, 307], [307, 306], [352, 366], [366, 345], [345, 352], [268, 271], [271, 302], [302, 268], [358, 423], [423, 371], [371, 358], [327, 294], [294, 460], [460, 327], [331, 279], [279, 294], [294, 331], [303, 271], [271, 304], [304, 303], [436, 432], [432, 427], [427, 436], [304, 272], [272, 408], [408, 304], [395, 394], [394, 431], [431, 395], [378, 395], [395, 400], [400, 378], [296, 334], [334, 299], [299, 296], [6, 351], [351, 168], [168, 6], [376, 352], [352, 411], [411, 376], [307, 325], [325, 320], [320, 307], [285, 295], [295, 336], [336, 285], [320, 319], [319, 404], [404, 320], [329, 330], [330, 349], [349, 329], [334, 293], [293, 333], [333, 334], [366, 323], [323, 447], [447, 366], [316, 15], [15, 315], [315, 316], [331, 358], [358, 279], [279, 331], [317, 14], [14, 316], [316, 317], [8, 285], [285, 9], [9, 8], [277, 329], [329, 350], [350, 277], [253, 374], [374, 252], [252, 253], [319, 318], [318, 403], [403, 319], [351, 6], [6, 419], [419, 351], [324, 318], [318, 325], [325, 324], [397, 367], [367, 365], [365, 397], [288, 435], [435, 397], [397, 288], [278, 344], [344, 439], [439, 278], [310, 272], [272, 311], [311, 310], [248, 195], [195, 281], [281, 248], [375, 273], [273, 291], [291, 375], [175, 396], [396, 199], [199, 175], [312, 311], [311, 268], [268, 312], [276, 283], [283, 445], [445, 276], [390, 373], [373, 339], [339, 390], [295, 282], [282, 296], [296, 295], [448, 449], [449, 346], [346, 448], [356, 264], [264, 454], [454, 356], [337, 336], [336, 299], [299, 337], [337, 338], [338, 151], [151, 337], [294, 278], [278, 455], [455, 294], [308, 292], [292, 415], [415, 308], [429, 358], [358, 355], [355, 429], [265, 340], [340, 372], [372, 265], [352, 346], [346, 280], [280, 352], [295, 442], [442, 282], [282, 295], [354, 19], [19, 370], [370, 354], [285, 441], [441, 295], [295, 285], [195, 248], [248, 197], [197, 195], [457, 440], [440, 274], [274, 457], [301, 300], [300, 368], [368, 301], [417, 351], [351, 465], [465, 417], [251, 301], [301, 389], [389, 251], [394, 395], [395, 379], [379, 394], [399, 412], [412, 419], [419, 399], [410, 436], [436, 322], [322, 410], [326, 2], [2, 393], [393, 326], [354, 370], [370, 461], [461, 354], [393, 164], [164, 267], [267, 393], [268, 302], [302, 12], [12, 268], [312, 268], [268, 13], [13, 312], [298, 293], [293, 301], [301, 298], [265, 446], [446, 340], [340, 265], [280, 330], [330, 425], [425, 280], [322, 426], [426, 391], [391, 322], [420, 429], [429, 437], [437, 420], [393, 391], [391, 326], [326, 393], [344, 440], [440, 438], [438, 344], [458, 459], [459, 461], [461, 458], [364, 434], [434, 394], [394, 364], [428, 396], [396, 262], [262, 428], [274, 354], [354, 457], [457, 274], [317, 316], [316, 402], [402, 317], [316, 315], [315, 403], [403, 316], [315, 314], [314, 404], [404, 315], [314, 313], [313, 405], [405, 314], [313, 421], [421, 406], [406, 313], [323, 366], [366, 361], [361, 323], [292, 306], [306, 407], [407, 292], [306, 291], [291, 408], [408, 306], [291, 287], [287, 409], [409, 291], [287, 432], [432, 410], [410, 287], [427, 434], [434, 411], [411, 427], [372, 264], [264, 383], [383, 372], [459, 309], [309, 457], [457, 459], [366, 352], [352, 401], [401, 366], [1, 274], [274, 4], [4, 1], [418, 421], [421, 262], [262, 418], [331, 294], [294, 358], [358, 331], [435, 433], [433, 367], [367, 435], [392, 289], [289, 439], [439, 392], [328, 462], [462, 326], [326, 328], [94, 2], [2, 370], [370, 94], [289, 305], [305, 455], [455, 289], [339, 254], [254, 448], [448, 339], [359, 255], [255, 446], [446, 359], [254, 253], [253, 449], [449, 254], [253, 252], [252, 450], [450, 253], [252, 256], [256, 451], [451, 252], [256, 341], [341, 452], [452, 256], [414, 413], [413, 463], [463, 414], [286, 441], [441, 414], [414, 286], [286, 258], [258, 441], [441, 286], [258, 257], [257, 442], [442, 258], [257, 259], [259, 443], [443, 257], [259, 260], [260, 444], [444, 259], [260, 467], [467, 445], [445, 260], [309, 459], [459, 250], [250, 309], [305, 289], [289, 290], [290, 305], [305, 290], [290, 460], [460, 305], [401, 376], [376, 435], [435, 401], [309, 250], [250, 392], [392, 309], [376, 411], [411, 433], [433, 376], [453, 341], [341, 464], [464, 453], [357, 453], [453, 465], [465, 357], [343, 357], [357, 412], [412, 343], [437, 343], [343, 399], [399, 437], [344, 360], [360, 440], [440, 344], [420, 437], [437, 456], [456, 420], [360, 420], [420, 363], [363, 360], [361, 401], [401, 288], [288, 361], [265, 372], [372, 353], [353, 265], [390, 339], [339, 249], [249, 390], [339, 448], [448, 255], [255, 339]);
3444
+ function Hs(t) {
3445
+ t.j = { faceLandmarks: [], faceBlendshapes: [], facialTransformationMatrixes: [] };
3446
+ }
3447
+ var C = class extends mt {
3448
+ constructor(t, e) {
3449
+ super(new Ft(t, e), "image_in", "norm_rect", !1), this.j = { faceLandmarks: [], faceBlendshapes: [], facialTransformationMatrixes: [] }, this.outputFacialTransformationMatrixes = this.outputFaceBlendshapes = !1, _(t = this.h = new wa(), 0, 1, e = new D()), this.A = new ba(), _(this.h, 0, 3, this.A), this.u = new ri(), _(this.h, 0, 2, this.u), Wt(this.u, 4, 1), y(this.u, 2, 0.5), y(this.A, 2, 0.5), y(this.h, 4, 0.5);
3450
+ }
3451
+ get baseOptions() {
3452
+ return x(this.h, D, 1);
3453
+ }
3454
+ set baseOptions(t) {
3455
+ _(this.h, 0, 1, t);
3456
+ }
3457
+ o(t) {
3458
+ return "numFaces" in t && Wt(this.u, 4, t.numFaces ?? 1), "minFaceDetectionConfidence" in t && y(this.u, 2, t.minFaceDetectionConfidence ?? 0.5), "minTrackingConfidence" in t && y(this.h, 4, t.minTrackingConfidence ?? 0.5), "minFacePresenceConfidence" in t && y(this.A, 2, t.minFacePresenceConfidence ?? 0.5), "outputFaceBlendshapes" in t && (this.outputFaceBlendshapes = !!t.outputFaceBlendshapes), "outputFacialTransformationMatrixes" in t && (this.outputFacialTransformationMatrixes = !!t.outputFacialTransformationMatrixes), this.l(t);
3459
+ }
3460
+ F(t, e) {
3461
+ return Hs(this), Pt(this, t, e), this.j;
3462
+ }
3463
+ G(t, e, n) {
3464
+ return Hs(this), Vt(this, t, n, e), this.j;
3465
+ }
3466
+ m() {
3467
+ var t = new _t();
3468
+ N(t, "image_in"), N(t, "norm_rect"), T(t, "face_landmarks");
3469
+ const e = new yt();
3470
+ Bt(e, z2, this.h);
3471
+ const n = new st();
3472
+ pt(n, 2, "mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"), R(n, "IMAGE:image_in"), R(n, "NORM_RECT:norm_rect"), w(n, "NORM_LANDMARKS:face_landmarks"), n.o(e), St(t, n), this.g.attachProtoVectorListener("face_landmarks", ((i, r) => {
3473
+ for (const s of i) i = bn(s), this.j.faceLandmarks.push(si(i));
3474
+ d(this, r);
3475
+ })), this.g.attachEmptyPacketListener("face_landmarks", ((i) => {
3476
+ d(this, i);
3477
+ })), this.outputFaceBlendshapes && (T(t, "blendshapes"), w(n, "BLENDSHAPES:blendshapes"), this.g.attachProtoVectorListener("blendshapes", ((i, r) => {
3478
+ if (this.outputFaceBlendshapes) for (const s of i) i = ii(s), this.j.faceBlendshapes.push(Mr(i.g() ?? []));
3479
+ d(this, r);
3480
+ })), this.g.attachEmptyPacketListener("blendshapes", ((i) => {
3481
+ d(this, i);
3482
+ }))), this.outputFacialTransformationMatrixes && (T(t, "face_geometry"), w(n, "FACE_GEOMETRY:face_geometry"), this.g.attachProtoVectorListener("face_geometry", ((i, r) => {
3483
+ if (this.outputFacialTransformationMatrixes) for (const s of i) (i = x(i = H2(s), N2, 2)) && this.j.facialTransformationMatrixes.push({ rows: xt(i, 1) ?? 0 ?? 0, columns: xt(i, 2) ?? 0 ?? 0, data: le(i, 3, Nt, he()).slice() ?? [] });
3484
+ d(this, r);
3485
+ })), this.g.attachEmptyPacketListener("face_geometry", ((i) => {
3486
+ d(this, i);
3487
+ }))), t = t.g(), this.setGraph(new Uint8Array(t), !0);
3488
+ }
3489
+ };
3490
+ C.prototype.detectForVideo = C.prototype.G, C.prototype.detect = C.prototype.F, C.prototype.setOptions = C.prototype.o, C.createFromModelPath = function(t, e) {
3491
+ return E(C, t, { baseOptions: { modelAssetPath: e } });
3492
+ }, C.createFromModelBuffer = function(t, e) {
3493
+ return E(C, t, { baseOptions: { modelAssetBuffer: e } });
3494
+ }, C.createFromOptions = function(t, e) {
3495
+ return E(C, t, e);
3496
+ }, C.FACE_LANDMARKS_LIPS = Pr, C.FACE_LANDMARKS_LEFT_EYE = Rr, C.FACE_LANDMARKS_LEFT_EYEBROW = Or, C.FACE_LANDMARKS_LEFT_IRIS = Ja, C.FACE_LANDMARKS_RIGHT_EYE = Nr, C.FACE_LANDMARKS_RIGHT_EYEBROW = Cr, C.FACE_LANDMARKS_RIGHT_IRIS = Za, C.FACE_LANDMARKS_FACE_OVAL = Ir, C.FACE_LANDMARKS_CONTOURS = Qa, C.FACE_LANDMARKS_TESSELATION = t1;
3497
+ var Dr = Lt([0, 1], [1, 2], [2, 3], [3, 4], [0, 5], [5, 6], [6, 7], [7, 8], [5, 9], [9, 10], [10, 11], [11, 12], [9, 13], [13, 14], [14, 15], [15, 16], [13, 17], [0, 17], [17, 18], [18, 19], [19, 20]);
3498
+ function zs(t) {
3499
+ t.gestures = [], t.landmarks = [], t.worldLandmarks = [], t.handedness = [];
3500
+ }
3501
+ function Ws(t) {
3502
+ return t.gestures.length === 0 ? { gestures: [], landmarks: [], worldLandmarks: [], handedness: [], handednesses: [] } : { gestures: t.gestures, landmarks: t.landmarks, worldLandmarks: t.worldLandmarks, handedness: t.handedness, handednesses: t.handedness };
3503
+ }
3504
+ function Ks(t, e = !0) {
3505
+ const n = [];
3506
+ for (const r of t) {
3507
+ var i = ii(r);
3508
+ t = [];
3509
+ for (const s of i.g()) i = e && xt(s, 1) != null ? xt(s, 1) ?? 0 : -1, t.push({ score: U(s, 2) ?? 0, index: i, categoryName: Z(P(s, 3)) ?? "" ?? "", displayName: Z(P(s, 4)) ?? "" ?? "" });
3510
+ n.push(t);
3511
+ }
3512
+ return n;
3513
+ }
3514
+ var at = class extends mt {
3515
+ constructor(t, e) {
3516
+ super(new Ft(t, e), "image_in", "norm_rect", !1), this.gestures = [], this.landmarks = [], this.worldLandmarks = [], this.handedness = [], _(t = this.j = new Ta(), 0, 1, e = new D()), this.u = new xr(), _(this.j, 0, 2, this.u), this.D = new Er(), _(this.u, 0, 3, this.D), this.A = new xa(), _(this.u, 0, 2, this.A), this.h = new W2(), _(this.j, 0, 3, this.h), y(this.A, 2, 0.5), y(this.u, 4, 0.5), y(this.D, 2, 0.5);
3517
+ }
3518
+ get baseOptions() {
3519
+ return x(this.j, D, 1);
3520
+ }
3521
+ set baseOptions(t) {
3522
+ _(this.j, 0, 1, t);
3523
+ }
3524
+ o(t) {
3525
+ var r, s, o, a;
3526
+ if (Wt(this.A, 3, t.numHands ?? 1), "minHandDetectionConfidence" in t && y(this.A, 2, t.minHandDetectionConfidence ?? 0.5), "minTrackingConfidence" in t && y(this.u, 4, t.minTrackingConfidence ?? 0.5), "minHandPresenceConfidence" in t && y(this.D, 2, t.minHandPresenceConfidence ?? 0.5), t.cannedGesturesClassifierOptions) {
3527
+ var e = new xe(), n = e, i = Ni(t.cannedGesturesClassifierOptions, (r = x(this.h, xe, 3)) == null ? void 0 : r.l());
3528
+ _(n, 0, 2, i), _(this.h, 0, 3, e);
3529
+ } else t.cannedGesturesClassifierOptions === void 0 && ((s = x(this.h, xe, 3)) == null || s.g());
3530
+ return t.customGesturesClassifierOptions ? (_(n = e = new xe(), 0, 2, i = Ni(t.customGesturesClassifierOptions, (o = x(this.h, xe, 4)) == null ? void 0 : o.l())), _(this.h, 0, 4, e)) : t.customGesturesClassifierOptions === void 0 && ((a = x(this.h, xe, 4)) == null || a.g()), this.l(t);
3531
+ }
3532
+ Ha(t, e) {
3533
+ return zs(this), Pt(this, t, e), Ws(this);
3534
+ }
3535
+ Ia(t, e, n) {
3536
+ return zs(this), Vt(this, t, n, e), Ws(this);
3537
+ }
3538
+ m() {
3539
+ var t = new _t();
3540
+ N(t, "image_in"), N(t, "norm_rect"), T(t, "hand_gestures"), T(t, "hand_landmarks"), T(t, "world_hand_landmarks"), T(t, "handedness");
3541
+ const e = new yt();
3542
+ Bt(e, K2, this.j);
3543
+ const n = new st();
3544
+ pt(n, 2, "mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"), R(n, "IMAGE:image_in"), R(n, "NORM_RECT:norm_rect"), w(n, "HAND_GESTURES:hand_gestures"), w(n, "LANDMARKS:hand_landmarks"), w(n, "WORLD_LANDMARKS:world_hand_landmarks"), w(n, "HANDEDNESS:handedness"), n.o(e), St(t, n), this.g.attachProtoVectorListener("hand_landmarks", ((i, r) => {
3545
+ for (const s of i) {
3546
+ i = bn(s);
3547
+ const o = [];
3548
+ for (const a of zt(i, ma, 1)) o.push({ x: U(a, 1) ?? 0, y: U(a, 2) ?? 0, z: U(a, 3) ?? 0, visibility: U(a, 4) ?? 0 });
3549
+ this.landmarks.push(o);
3550
+ }
3551
+ d(this, r);
3552
+ })), this.g.attachEmptyPacketListener("hand_landmarks", ((i) => {
3553
+ d(this, i);
3554
+ })), this.g.attachProtoVectorListener("world_hand_landmarks", ((i, r) => {
3555
+ for (const s of i) {
3556
+ i = ke(s);
3557
+ const o = [];
3558
+ for (const a of zt(i, ga, 1)) o.push({ x: U(a, 1) ?? 0, y: U(a, 2) ?? 0, z: U(a, 3) ?? 0, visibility: U(a, 4) ?? 0 });
3559
+ this.worldLandmarks.push(o);
3560
+ }
3561
+ d(this, r);
3562
+ })), this.g.attachEmptyPacketListener("world_hand_landmarks", ((i) => {
3563
+ d(this, i);
3564
+ })), this.g.attachProtoVectorListener("hand_gestures", ((i, r) => {
3565
+ this.gestures.push(...Ks(i, !1)), d(this, r);
3566
+ })), this.g.attachEmptyPacketListener("hand_gestures", ((i) => {
3567
+ d(this, i);
3568
+ })), this.g.attachProtoVectorListener("handedness", ((i, r) => {
3569
+ this.handedness.push(...Ks(i)), d(this, r);
3570
+ })), this.g.attachEmptyPacketListener("handedness", ((i) => {
3571
+ d(this, i);
3572
+ })), t = t.g(), this.setGraph(new Uint8Array(t), !0);
3573
+ }
3574
+ };
3575
+ function qs(t) {
3576
+ return { landmarks: t.landmarks, worldLandmarks: t.worldLandmarks, handednesses: t.handedness, handedness: t.handedness };
3577
+ }
3578
+ at.prototype.recognizeForVideo = at.prototype.Ia, at.prototype.recognize = at.prototype.Ha, at.prototype.setOptions = at.prototype.o, at.createFromModelPath = function(t, e) {
3579
+ return E(at, t, { baseOptions: { modelAssetPath: e } });
3580
+ }, at.createFromModelBuffer = function(t, e) {
3581
+ return E(at, t, { baseOptions: { modelAssetBuffer: e } });
3582
+ }, at.createFromOptions = function(t, e) {
3583
+ return E(at, t, e);
3584
+ }, at.HAND_CONNECTIONS = Dr;
3585
+ var rt = class extends mt {
3586
+ constructor(t, e) {
3587
+ super(new Ft(t, e), "image_in", "norm_rect", !1), this.landmarks = [], this.worldLandmarks = [], this.handedness = [], _(t = this.h = new xr(), 0, 1, e = new D()), this.u = new Er(), _(this.h, 0, 3, this.u), this.j = new xa(), _(this.h, 0, 2, this.j), Wt(this.j, 3, 1), y(this.j, 2, 0.5), y(this.u, 2, 0.5), y(this.h, 4, 0.5);
3588
+ }
3589
+ get baseOptions() {
3590
+ return x(this.h, D, 1);
3591
+ }
3592
+ set baseOptions(t) {
3593
+ _(this.h, 0, 1, t);
3594
+ }
3595
+ o(t) {
3596
+ return "numHands" in t && Wt(this.j, 3, t.numHands ?? 1), "minHandDetectionConfidence" in t && y(this.j, 2, t.minHandDetectionConfidence ?? 0.5), "minTrackingConfidence" in t && y(this.h, 4, t.minTrackingConfidence ?? 0.5), "minHandPresenceConfidence" in t && y(this.u, 2, t.minHandPresenceConfidence ?? 0.5), this.l(t);
3597
+ }
3598
+ F(t, e) {
3599
+ return this.landmarks = [], this.worldLandmarks = [], this.handedness = [], Pt(this, t, e), qs(this);
3600
+ }
3601
+ G(t, e, n) {
3602
+ return this.landmarks = [], this.worldLandmarks = [], this.handedness = [], Vt(this, t, n, e), qs(this);
3603
+ }
3604
+ m() {
3605
+ var t = new _t();
3606
+ N(t, "image_in"), N(t, "norm_rect"), T(t, "hand_landmarks"), T(t, "world_hand_landmarks"), T(t, "handedness");
3607
+ const e = new yt();
3608
+ Bt(e, q2, this.h);
3609
+ const n = new st();
3610
+ pt(n, 2, "mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"), R(n, "IMAGE:image_in"), R(n, "NORM_RECT:norm_rect"), w(n, "LANDMARKS:hand_landmarks"), w(n, "WORLD_LANDMARKS:world_hand_landmarks"), w(n, "HANDEDNESS:handedness"), n.o(e), St(t, n), this.g.attachProtoVectorListener("hand_landmarks", ((i, r) => {
3611
+ for (const s of i) i = bn(s), this.landmarks.push(si(i));
3612
+ d(this, r);
3613
+ })), this.g.attachEmptyPacketListener("hand_landmarks", ((i) => {
3614
+ d(this, i);
3615
+ })), this.g.attachProtoVectorListener("world_hand_landmarks", ((i, r) => {
3616
+ for (const s of i) i = ke(s), this.worldLandmarks.push(cn(i));
3617
+ d(this, r);
3618
+ })), this.g.attachEmptyPacketListener("world_hand_landmarks", ((i) => {
3619
+ d(this, i);
3620
+ })), this.g.attachProtoVectorListener("handedness", ((i, r) => {
3621
+ var s = this.handedness, o = s.push;
3622
+ const a = [];
3623
+ for (const c of i) {
3624
+ i = ii(c);
3625
+ const h = [];
3626
+ for (const l of i.g()) h.push({ score: U(l, 2) ?? 0, index: xt(l, 1) ?? 0 ?? -1, categoryName: Z(P(l, 3)) ?? "" ?? "", displayName: Z(P(l, 4)) ?? "" ?? "" });
3627
+ a.push(h);
3628
+ }
3629
+ o.call(s, ...a), d(this, r);
3630
+ })), this.g.attachEmptyPacketListener("handedness", ((i) => {
3631
+ d(this, i);
3632
+ })), t = t.g(), this.setGraph(new Uint8Array(t), !0);
3633
+ }
3634
+ };
3635
+ rt.prototype.detectForVideo = rt.prototype.G, rt.prototype.detect = rt.prototype.F, rt.prototype.setOptions = rt.prototype.o, rt.createFromModelPath = function(t, e) {
3636
+ return E(rt, t, { baseOptions: { modelAssetPath: e } });
3637
+ }, rt.createFromModelBuffer = function(t, e) {
3638
+ return E(rt, t, { baseOptions: { modelAssetBuffer: e } });
3639
+ }, rt.createFromOptions = function(t, e) {
3640
+ return E(rt, t, e);
3641
+ }, rt.HAND_CONNECTIONS = Dr;
3642
+ var e1 = Lt([0, 1], [1, 2], [2, 3], [3, 7], [0, 4], [4, 5], [5, 6], [6, 8], [9, 10], [11, 12], [11, 13], [13, 15], [15, 17], [15, 19], [15, 21], [17, 19], [12, 14], [14, 16], [16, 18], [16, 20], [16, 22], [18, 20], [11, 23], [12, 24], [23, 24], [23, 25], [24, 26], [25, 27], [26, 28], [27, 29], [28, 30], [29, 31], [30, 32], [27, 31], [28, 32]);
3643
+ function Xs(t) {
3644
+ t.h = { faceLandmarks: [], faceBlendshapes: [], poseLandmarks: [], poseWorldLandmarks: [], poseSegmentationMasks: [], leftHandLandmarks: [], leftHandWorldLandmarks: [], rightHandLandmarks: [], rightHandWorldLandmarks: [] };
3645
+ }
3646
+ function Ys(t) {
3647
+ try {
3648
+ if (!t.D) return t.h;
3649
+ t.D(t.h);
3650
+ } finally {
3651
+ ai(t);
3652
+ }
3653
+ }
3654
+ function Mn(t, e) {
3655
+ t = bn(t), e.push(si(t));
3656
+ }
3657
+ var F = class extends mt {
3658
+ constructor(t, e) {
3659
+ super(new Ft(t, e), "input_frames_image", null, !1), this.h = { faceLandmarks: [], faceBlendshapes: [], poseLandmarks: [], poseWorldLandmarks: [], poseSegmentationMasks: [], leftHandLandmarks: [], leftHandWorldLandmarks: [], rightHandLandmarks: [], rightHandWorldLandmarks: [] }, this.outputPoseSegmentationMasks = this.outputFaceBlendshapes = !1, _(t = this.j = new Fa(), 0, 1, e = new D()), this.I = new Er(), _(this.j, 0, 2, this.I), this.W = new X2(), _(this.j, 0, 3, this.W), this.u = new ri(), _(this.j, 0, 4, this.u), this.O = new ba(), _(this.j, 0, 5, this.O), this.A = new Ma(), _(this.j, 0, 6, this.A), this.M = new La(), _(this.j, 0, 7, this.M), y(this.u, 2, 0.5), y(this.u, 3, 0.3), y(this.O, 2, 0.5), y(this.A, 2, 0.5), y(this.A, 3, 0.3), y(this.M, 2, 0.5), y(this.I, 2, 0.5);
3660
+ }
3661
+ get baseOptions() {
3662
+ return x(this.j, D, 1);
3663
+ }
3664
+ set baseOptions(t) {
3665
+ _(this.j, 0, 1, t);
3666
+ }
3667
+ o(t) {
3668
+ return "minFaceDetectionConfidence" in t && y(this.u, 2, t.minFaceDetectionConfidence ?? 0.5), "minFaceSuppressionThreshold" in t && y(this.u, 3, t.minFaceSuppressionThreshold ?? 0.3), "minFacePresenceConfidence" in t && y(this.O, 2, t.minFacePresenceConfidence ?? 0.5), "outputFaceBlendshapes" in t && (this.outputFaceBlendshapes = !!t.outputFaceBlendshapes), "minPoseDetectionConfidence" in t && y(this.A, 2, t.minPoseDetectionConfidence ?? 0.5), "minPoseSuppressionThreshold" in t && y(this.A, 3, t.minPoseSuppressionThreshold ?? 0.3), "minPosePresenceConfidence" in t && y(this.M, 2, t.minPosePresenceConfidence ?? 0.5), "outputPoseSegmentationMasks" in t && (this.outputPoseSegmentationMasks = !!t.outputPoseSegmentationMasks), "minHandLandmarksConfidence" in t && y(this.I, 2, t.minHandLandmarksConfidence ?? 0.5), this.l(t);
3669
+ }
3670
+ F(t, e, n) {
3671
+ const i = typeof e != "function" ? e : {};
3672
+ return this.D = typeof e == "function" ? e : n, Xs(this), Pt(this, t, i), Ys(this);
3673
+ }
3674
+ G(t, e, n, i) {
3675
+ const r = typeof n != "function" ? n : {};
3676
+ return this.D = typeof n == "function" ? n : i, Xs(this), Vt(this, t, r, e), Ys(this);
3677
+ }
3678
+ m() {
3679
+ var t = new _t();
3680
+ N(t, "input_frames_image"), T(t, "pose_landmarks"), T(t, "pose_world_landmarks"), T(t, "face_landmarks"), T(t, "left_hand_landmarks"), T(t, "left_hand_world_landmarks"), T(t, "right_hand_landmarks"), T(t, "right_hand_world_landmarks");
3681
+ const e = new yt(), n = new vs();
3682
+ pt(n, 1, "type.googleapis.com/mediapipe.tasks.vision.holistic_landmarker.proto.HolisticLandmarkerGraphOptions"), (function(r, s) {
3683
+ if (s != null) if (Array.isArray(s)) S(r, 2, Wn(s, 0, fn));
3684
+ else {
3685
+ if (!(typeof s == "string" || s instanceof Ct || zi(s))) throw Error("invalid value in Any.value field: " + s + " expected a ByteString, a base64 encoded string, a Uint8Array or a jspb array");
3686
+ Zt(r, 2, Ki(s, !1), me());
3687
+ }
3688
+ })(n, this.j.g());
3689
+ const i = new st();
3690
+ pt(i, 2, "mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"), ar(i, 8, vs, n), R(i, "IMAGE:input_frames_image"), w(i, "POSE_LANDMARKS:pose_landmarks"), w(i, "POSE_WORLD_LANDMARKS:pose_world_landmarks"), w(i, "FACE_LANDMARKS:face_landmarks"), w(i, "LEFT_HAND_LANDMARKS:left_hand_landmarks"), w(i, "LEFT_HAND_WORLD_LANDMARKS:left_hand_world_landmarks"), w(i, "RIGHT_HAND_LANDMARKS:right_hand_landmarks"), w(i, "RIGHT_HAND_WORLD_LANDMARKS:right_hand_world_landmarks"), i.o(e), St(t, i), oi(this, t), this.g.attachProtoListener("pose_landmarks", ((r, s) => {
3691
+ Mn(r, this.h.poseLandmarks), d(this, s);
3692
+ })), this.g.attachEmptyPacketListener("pose_landmarks", ((r) => {
3693
+ d(this, r);
3694
+ })), this.g.attachProtoListener("pose_world_landmarks", ((r, s) => {
3695
+ var o = this.h.poseWorldLandmarks;
3696
+ r = ke(r), o.push(cn(r)), d(this, s);
3697
+ })), this.g.attachEmptyPacketListener("pose_world_landmarks", ((r) => {
3698
+ d(this, r);
3699
+ })), this.outputPoseSegmentationMasks && (w(i, "POSE_SEGMENTATION_MASK:pose_segmentation_mask"), Be(this, "pose_segmentation_mask"), this.g.Z("pose_segmentation_mask", ((r, s) => {
3700
+ this.h.poseSegmentationMasks = [Ve(this, r, !0, !this.D)], d(this, s);
3701
+ })), this.g.attachEmptyPacketListener("pose_segmentation_mask", ((r) => {
3702
+ this.h.poseSegmentationMasks = [], d(this, r);
3703
+ }))), this.g.attachProtoListener("face_landmarks", ((r, s) => {
3704
+ Mn(r, this.h.faceLandmarks), d(this, s);
3705
+ })), this.g.attachEmptyPacketListener("face_landmarks", ((r) => {
3706
+ d(this, r);
3707
+ })), this.outputFaceBlendshapes && (T(t, "extra_blendshapes"), w(i, "FACE_BLENDSHAPES:extra_blendshapes"), this.g.attachProtoListener("extra_blendshapes", ((r, s) => {
3708
+ var o = this.h.faceBlendshapes;
3709
+ this.outputFaceBlendshapes && (r = ii(r), o.push(Mr(r.g() ?? []))), d(this, s);
3710
+ })), this.g.attachEmptyPacketListener("extra_blendshapes", ((r) => {
3711
+ d(this, r);
3712
+ }))), this.g.attachProtoListener("left_hand_landmarks", ((r, s) => {
3713
+ Mn(r, this.h.leftHandLandmarks), d(this, s);
3714
+ })), this.g.attachEmptyPacketListener("left_hand_landmarks", ((r) => {
3715
+ d(this, r);
3716
+ })), this.g.attachProtoListener("left_hand_world_landmarks", ((r, s) => {
3717
+ var o = this.h.leftHandWorldLandmarks;
3718
+ r = ke(r), o.push(cn(r)), d(this, s);
3719
+ })), this.g.attachEmptyPacketListener("left_hand_world_landmarks", ((r) => {
3720
+ d(this, r);
3721
+ })), this.g.attachProtoListener("right_hand_landmarks", ((r, s) => {
3722
+ Mn(r, this.h.rightHandLandmarks), d(this, s);
3723
+ })), this.g.attachEmptyPacketListener("right_hand_landmarks", ((r) => {
3724
+ d(this, r);
3725
+ })), this.g.attachProtoListener("right_hand_world_landmarks", ((r, s) => {
3726
+ var o = this.h.rightHandWorldLandmarks;
3727
+ r = ke(r), o.push(cn(r)), d(this, s);
3728
+ })), this.g.attachEmptyPacketListener("right_hand_world_landmarks", ((r) => {
3729
+ d(this, r);
3730
+ })), t = t.g(), this.setGraph(new Uint8Array(t), !0);
3731
+ }
3732
+ };
3733
+ F.prototype.detectForVideo = F.prototype.G, F.prototype.detect = F.prototype.F, F.prototype.setOptions = F.prototype.o, F.createFromModelPath = function(t, e) {
3734
+ return E(F, t, { baseOptions: { modelAssetPath: e } });
3735
+ }, F.createFromModelBuffer = function(t, e) {
3736
+ return E(F, t, { baseOptions: { modelAssetBuffer: e } });
3737
+ }, F.createFromOptions = function(t, e) {
3738
+ return E(F, t, e);
3739
+ }, F.HAND_CONNECTIONS = Dr, F.POSE_CONNECTIONS = e1, F.FACE_LANDMARKS_LIPS = Pr, F.FACE_LANDMARKS_LEFT_EYE = Rr, F.FACE_LANDMARKS_LEFT_EYEBROW = Or, F.FACE_LANDMARKS_LEFT_IRIS = Ja, F.FACE_LANDMARKS_RIGHT_EYE = Nr, F.FACE_LANDMARKS_RIGHT_EYEBROW = Cr, F.FACE_LANDMARKS_RIGHT_IRIS = Za, F.FACE_LANDMARKS_FACE_OVAL = Ir, F.FACE_LANDMARKS_CONTOURS = Qa, F.FACE_LANDMARKS_TESSELATION = t1;
3740
+ var bt = class extends mt {
3741
+ constructor(t, e) {
3742
+ super(new Ft(t, e), "input_image", "norm_rect", !0), this.j = { classifications: [] }, _(t = this.h = new Pa(), 0, 1, e = new D());
3743
+ }
3744
+ get baseOptions() {
3745
+ return x(this.h, D, 1);
3746
+ }
3747
+ set baseOptions(t) {
3748
+ _(this.h, 0, 1, t);
3749
+ }
3750
+ o(t) {
3751
+ return _(this.h, 0, 2, Ni(t, x(this.h, br, 2))), this.l(t);
3752
+ }
3753
+ sa(t, e) {
3754
+ return this.j = { classifications: [] }, Pt(this, t, e), this.j;
3755
+ }
3756
+ ta(t, e, n) {
3757
+ return this.j = { classifications: [] }, Vt(this, t, n, e), this.j;
3758
+ }
3759
+ m() {
3760
+ var t = new _t();
3761
+ N(t, "input_image"), N(t, "norm_rect"), T(t, "classifications");
3762
+ const e = new yt();
3763
+ Bt(e, Y2, this.h);
3764
+ const n = new st();
3765
+ pt(n, 2, "mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"), R(n, "IMAGE:input_image"), R(n, "NORM_RECT:norm_rect"), w(n, "CLASSIFICATIONS:classifications"), n.o(e), St(t, n), this.g.attachProtoListener("classifications", ((i, r) => {
3766
+ this.j = ec(D2(i)), d(this, r);
3767
+ })), this.g.attachEmptyPacketListener("classifications", ((i) => {
3768
+ d(this, i);
3769
+ })), t = t.g(), this.setGraph(new Uint8Array(t), !0);
3770
+ }
3771
+ };
3772
+ bt.prototype.classifyForVideo = bt.prototype.ta, bt.prototype.classify = bt.prototype.sa, bt.prototype.setOptions = bt.prototype.o, bt.createFromModelPath = function(t, e) {
3773
+ return E(bt, t, { baseOptions: { modelAssetPath: e } });
3774
+ }, bt.createFromModelBuffer = function(t, e) {
3775
+ return E(bt, t, { baseOptions: { modelAssetBuffer: e } });
3776
+ }, bt.createFromOptions = function(t, e) {
3777
+ return E(bt, t, e);
3778
+ };
3779
+ var ct = class extends mt {
3780
+ constructor(t, e) {
3781
+ super(new Ft(t, e), "image_in", "norm_rect", !0), this.h = new Ra(), this.embeddings = { embeddings: [] }, _(t = this.h, 0, 1, e = new D());
3782
+ }
3783
+ get baseOptions() {
3784
+ return x(this.h, D, 1);
3785
+ }
3786
+ set baseOptions(t) {
3787
+ _(this.h, 0, 1, t);
3788
+ }
3789
+ o(t) {
3790
+ var e = this.h, n = x(this.h, Ms, 2);
3791
+ return n = n ? n.clone() : new Ms(), t.l2Normalize !== void 0 ? S(n, 1, dn(t.l2Normalize)) : "l2Normalize" in t && S(n, 1), t.quantize !== void 0 ? S(n, 2, dn(t.quantize)) : "quantize" in t && S(n, 2), _(e, 0, 2, n), this.l(t);
3792
+ }
3793
+ za(t, e) {
3794
+ return Pt(this, t, e), this.embeddings;
3795
+ }
3796
+ Aa(t, e, n) {
3797
+ return Vt(this, t, n, e), this.embeddings;
3798
+ }
3799
+ m() {
3800
+ var t = new _t();
3801
+ N(t, "image_in"), N(t, "norm_rect"), T(t, "embeddings_out");
3802
+ const e = new yt();
3803
+ Bt(e, $2, this.h);
3804
+ const n = new st();
3805
+ pt(n, 2, "mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"), R(n, "IMAGE:image_in"), R(n, "NORM_RECT:norm_rect"), w(n, "EMBEDDINGS:embeddings_out"), n.o(e), St(t, n), this.g.attachProtoListener("embeddings_out", ((i, r) => {
3806
+ i = V2(i), this.embeddings = (function(s) {
3807
+ return { embeddings: zt(s, U2, 1).map(((o) => {
3808
+ var h, l;
3809
+ const a = { headIndex: xt(o, 3) ?? 0 ?? -1, headName: Z(P(o, 4)) ?? "" ?? "" };
3810
+ var c = o.v;
3811
+ return Mo(c, 0 | c[p], ks, mi(o, 1)) !== void 0 ? (o = le(o = x(o, ks, mi(o, 1), void 0), 1, Nt, he()), a.floatEmbedding = o.slice()) : (c = new Uint8Array(0), a.quantizedEmbedding = ((l = (h = x(o, B2, mi(o, 2), void 0)) == null ? void 0 : h.na()) == null ? void 0 : l.h()) ?? c), a;
3812
+ })), timestampMs: Ua(Po(s)) };
3813
+ })(i), d(this, r);
3814
+ })), this.g.attachEmptyPacketListener("embeddings_out", ((i) => {
3815
+ d(this, i);
3816
+ })), t = t.g(), this.setGraph(new Uint8Array(t), !0);
3817
+ }
3818
+ };
3819
+ ct.cosineSimilarity = function(t, e) {
3820
+ if (t.floatEmbedding && e.floatEmbedding) t = Ns(t.floatEmbedding, e.floatEmbedding);
3821
+ else {
3822
+ if (!t.quantizedEmbedding || !e.quantizedEmbedding) throw Error("Cannot compute cosine similarity between quantized and float embeddings.");
3823
+ t = Ns(Os(t.quantizedEmbedding), Os(e.quantizedEmbedding));
3824
+ }
3825
+ return t;
3826
+ }, ct.prototype.embedForVideo = ct.prototype.Aa, ct.prototype.embed = ct.prototype.za, ct.prototype.setOptions = ct.prototype.o, ct.createFromModelPath = function(t, e) {
3827
+ return E(ct, t, { baseOptions: { modelAssetPath: e } });
3828
+ }, ct.createFromModelBuffer = function(t, e) {
3829
+ return E(ct, t, { baseOptions: { modelAssetBuffer: e } });
3830
+ }, ct.createFromOptions = function(t, e) {
3831
+ return E(ct, t, e);
3832
+ };
3833
+ var Bi = class {
3834
+ constructor(t, e, n) {
3835
+ this.confidenceMasks = t, this.categoryMask = e, this.qualityScores = n;
3836
+ }
3837
+ close() {
3838
+ var t, e;
3839
+ (t = this.confidenceMasks) == null || t.forEach(((n) => {
3840
+ n.close();
3841
+ })), (e = this.categoryMask) == null || e.close();
3842
+ }
3843
+ };
3844
+ function cc(t) {
3845
+ var n, i;
3846
+ const e = (function(r) {
3847
+ return zt(r, st, 1);
3848
+ })(t.ca()).filter(((r) => (Z(P(r, 1)) ?? "").includes("mediapipe.tasks.TensorsToSegmentationCalculator")));
3849
+ if (t.u = [], e.length > 1) throw Error("The graph has more than one mediapipe.tasks.TensorsToSegmentationCalculator.");
3850
+ e.length === 1 && (((i = (n = x(e[0], yt, 7)) == null ? void 0 : n.j()) == null ? void 0 : i.g()) ?? /* @__PURE__ */ new Map()).forEach(((r, s) => {
3851
+ t.u[Number(s)] = Z(P(r, 1)) ?? "";
3852
+ }));
3853
+ }
3854
+ function $s(t) {
3855
+ t.categoryMask = void 0, t.confidenceMasks = void 0, t.qualityScores = void 0;
3856
+ }
3857
+ function Js(t) {
3858
+ try {
3859
+ const e = new Bi(t.confidenceMasks, t.categoryMask, t.qualityScores);
3860
+ if (!t.j) return e;
3861
+ t.j(e);
3862
+ } finally {
3863
+ ai(t);
3864
+ }
3865
+ }
3866
+ Bi.prototype.close = Bi.prototype.close;
3867
+ var it = class extends mt {
3868
+ constructor(t, e) {
3869
+ super(new Ft(t, e), "image_in", "norm_rect", !1), this.u = [], this.outputCategoryMask = !1, this.outputConfidenceMasks = !0, this.h = new kr(), this.A = new Oa(), _(this.h, 0, 3, this.A), _(t = this.h, 0, 1, e = new D());
3870
+ }
3871
+ get baseOptions() {
3872
+ return x(this.h, D, 1);
3873
+ }
3874
+ set baseOptions(t) {
3875
+ _(this.h, 0, 1, t);
3876
+ }
3877
+ o(t) {
3878
+ return t.displayNamesLocale !== void 0 ? S(this.h, 2, _n(t.displayNamesLocale)) : "displayNamesLocale" in t && S(this.h, 2), "outputCategoryMask" in t && (this.outputCategoryMask = t.outputCategoryMask ?? !1), "outputConfidenceMasks" in t && (this.outputConfidenceMasks = t.outputConfidenceMasks ?? !0), super.l(t);
3879
+ }
3880
+ L() {
3881
+ cc(this);
3882
+ }
3883
+ segment(t, e, n) {
3884
+ const i = typeof e != "function" ? e : {};
3885
+ return this.j = typeof e == "function" ? e : n, $s(this), Pt(this, t, i), Js(this);
3886
+ }
3887
+ La(t, e, n, i) {
3888
+ const r = typeof n != "function" ? n : {};
3889
+ return this.j = typeof n == "function" ? n : i, $s(this), Vt(this, t, r, e), Js(this);
3890
+ }
3891
+ Da() {
3892
+ return this.u;
3893
+ }
3894
+ m() {
3895
+ var t = new _t();
3896
+ N(t, "image_in"), N(t, "norm_rect");
3897
+ const e = new yt();
3898
+ Bt(e, Ca, this.h);
3899
+ const n = new st();
3900
+ pt(n, 2, "mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"), R(n, "IMAGE:image_in"), R(n, "NORM_RECT:norm_rect"), n.o(e), St(t, n), oi(this, t), this.outputConfidenceMasks && (T(t, "confidence_masks"), w(n, "CONFIDENCE_MASKS:confidence_masks"), Be(this, "confidence_masks"), this.g.aa("confidence_masks", ((i, r) => {
3901
+ this.confidenceMasks = i.map(((s) => Ve(this, s, !0, !this.j))), d(this, r);
3902
+ })), this.g.attachEmptyPacketListener("confidence_masks", ((i) => {
3903
+ this.confidenceMasks = [], d(this, i);
3904
+ }))), this.outputCategoryMask && (T(t, "category_mask"), w(n, "CATEGORY_MASK:category_mask"), Be(this, "category_mask"), this.g.Z("category_mask", ((i, r) => {
3905
+ this.categoryMask = Ve(this, i, !1, !this.j), d(this, r);
3906
+ })), this.g.attachEmptyPacketListener("category_mask", ((i) => {
3907
+ this.categoryMask = void 0, d(this, i);
3908
+ }))), T(t, "quality_scores"), w(n, "QUALITY_SCORES:quality_scores"), this.g.attachFloatVectorListener("quality_scores", ((i, r) => {
3909
+ this.qualityScores = i, d(this, r);
3910
+ })), this.g.attachEmptyPacketListener("quality_scores", ((i) => {
3911
+ this.categoryMask = void 0, d(this, i);
3912
+ })), t = t.g(), this.setGraph(new Uint8Array(t), !0);
3913
+ }
3914
+ };
3915
+ it.prototype.getLabels = it.prototype.Da, it.prototype.segmentForVideo = it.prototype.La, it.prototype.segment = it.prototype.segment, it.prototype.setOptions = it.prototype.o, it.createFromModelPath = function(t, e) {
3916
+ return E(it, t, { baseOptions: { modelAssetPath: e } });
3917
+ }, it.createFromModelBuffer = function(t, e) {
3918
+ return E(it, t, { baseOptions: { modelAssetBuffer: e } });
3919
+ }, it.createFromOptions = function(t, e) {
3920
+ return E(it, t, e);
3921
+ };
3922
+ var Ui = class {
3923
+ constructor(t, e, n) {
3924
+ this.confidenceMasks = t, this.categoryMask = e, this.qualityScores = n;
3925
+ }
3926
+ close() {
3927
+ var t, e;
3928
+ (t = this.confidenceMasks) == null || t.forEach(((n) => {
3929
+ n.close();
3930
+ })), (e = this.categoryMask) == null || e.close();
3931
+ }
3932
+ };
3933
+ Ui.prototype.close = Ui.prototype.close;
3934
+ var Ot = class extends mt {
3935
+ constructor(t, e) {
3936
+ super(new Ft(t, e), "image_in", "norm_rect_in", !1), this.outputCategoryMask = !1, this.outputConfidenceMasks = !0, this.h = new kr(), this.u = new Oa(), _(this.h, 0, 3, this.u), _(t = this.h, 0, 1, e = new D());
3937
+ }
3938
+ get baseOptions() {
3939
+ return x(this.h, D, 1);
3940
+ }
3941
+ set baseOptions(t) {
3942
+ _(this.h, 0, 1, t);
3943
+ }
3944
+ o(t) {
3945
+ return "outputCategoryMask" in t && (this.outputCategoryMask = t.outputCategoryMask ?? !1), "outputConfidenceMasks" in t && (this.outputConfidenceMasks = t.outputConfidenceMasks ?? !0), super.l(t);
3946
+ }
3947
+ segment(t, e, n, i) {
3948
+ const r = typeof n != "function" ? n : {};
3949
+ if (this.j = typeof n == "function" ? n : i, this.qualityScores = this.categoryMask = this.confidenceMasks = void 0, n = this.C + 1, i = new Ia(), e.keypoint && e.scribble) throw Error("Cannot provide both keypoint and scribble.");
3950
+ if (e.keypoint) {
3951
+ var s = new Ai();
3952
+ Zt(s, 3, dn(!0), !1), Zt(s, 1, rn(e.keypoint.x), 0), Zt(s, 2, rn(e.keypoint.y), 0), on(i, 1, Oi, s);
3953
+ } else {
3954
+ if (!e.scribble) throw Error("Must provide either a keypoint or a scribble.");
3955
+ {
3956
+ const a = new Z2();
3957
+ for (s of e.scribble) Zt(e = new Ai(), 3, dn(!0), !1), Zt(e, 1, rn(s.x), 0), Zt(e, 2, rn(s.y), 0), ar(a, 1, Ai, e);
3958
+ on(i, 2, Oi, a);
3959
+ }
3960
+ }
3961
+ this.g.addProtoToStream(i.g(), "mediapipe.tasks.vision.interactive_segmenter.proto.RegionOfInterest", "roi_in", n), Pt(this, t, r);
3962
+ t: {
3963
+ try {
3964
+ const a = new Ui(this.confidenceMasks, this.categoryMask, this.qualityScores);
3965
+ if (!this.j) {
3966
+ var o = a;
3967
+ break t;
3968
+ }
3969
+ this.j(a);
3970
+ } finally {
3971
+ ai(this);
3972
+ }
3973
+ o = void 0;
3974
+ }
3975
+ return o;
3976
+ }
3977
+ m() {
3978
+ var t = new _t();
3979
+ N(t, "image_in"), N(t, "roi_in"), N(t, "norm_rect_in");
3980
+ const e = new yt();
3981
+ Bt(e, Ca, this.h);
3982
+ const n = new st();
3983
+ pt(n, 2, "mediapipe.tasks.vision.interactive_segmenter.InteractiveSegmenterGraphV2"), R(n, "IMAGE:image_in"), R(n, "ROI:roi_in"), R(n, "NORM_RECT:norm_rect_in"), n.o(e), St(t, n), oi(this, t), this.outputConfidenceMasks && (T(t, "confidence_masks"), w(n, "CONFIDENCE_MASKS:confidence_masks"), Be(this, "confidence_masks"), this.g.aa("confidence_masks", ((i, r) => {
3984
+ this.confidenceMasks = i.map(((s) => Ve(this, s, !0, !this.j))), d(this, r);
3985
+ })), this.g.attachEmptyPacketListener("confidence_masks", ((i) => {
3986
+ this.confidenceMasks = [], d(this, i);
3987
+ }))), this.outputCategoryMask && (T(t, "category_mask"), w(n, "CATEGORY_MASK:category_mask"), Be(this, "category_mask"), this.g.Z("category_mask", ((i, r) => {
3988
+ this.categoryMask = Ve(this, i, !1, !this.j), d(this, r);
3989
+ })), this.g.attachEmptyPacketListener("category_mask", ((i) => {
3990
+ this.categoryMask = void 0, d(this, i);
3991
+ }))), T(t, "quality_scores"), w(n, "QUALITY_SCORES:quality_scores"), this.g.attachFloatVectorListener("quality_scores", ((i, r) => {
3992
+ this.qualityScores = i, d(this, r);
3993
+ })), this.g.attachEmptyPacketListener("quality_scores", ((i) => {
3994
+ this.categoryMask = void 0, d(this, i);
3995
+ })), t = t.g(), this.setGraph(new Uint8Array(t), !0);
3996
+ }
3997
+ };
3998
+ Ot.prototype.segment = Ot.prototype.segment, Ot.prototype.setOptions = Ot.prototype.o, Ot.createFromModelPath = function(t, e) {
3999
+ return E(Ot, t, { baseOptions: { modelAssetPath: e } });
4000
+ }, Ot.createFromModelBuffer = function(t, e) {
4001
+ return E(Ot, t, { baseOptions: { modelAssetBuffer: e } });
4002
+ }, Ot.createFromOptions = function(t, e) {
4003
+ return E(Ot, t, e);
4004
+ };
4005
+ var wt = class extends mt {
4006
+ constructor(t, e) {
4007
+ super(new Ft(t, e), "input_frame_gpu", "norm_rect", !1), this.j = { detections: [] }, _(t = this.h = new Da(), 0, 1, e = new D());
4008
+ }
4009
+ get baseOptions() {
4010
+ return x(this.h, D, 1);
4011
+ }
4012
+ set baseOptions(t) {
4013
+ _(this.h, 0, 1, t);
4014
+ }
4015
+ o(t) {
4016
+ return t.displayNamesLocale !== void 0 ? S(this.h, 2, _n(t.displayNamesLocale)) : "displayNamesLocale" in t && S(this.h, 2), t.maxResults !== void 0 ? Wt(this.h, 3, t.maxResults) : "maxResults" in t && S(this.h, 3), t.scoreThreshold !== void 0 ? y(this.h, 4, t.scoreThreshold) : "scoreThreshold" in t && S(this.h, 4), t.categoryAllowlist !== void 0 ? Nn(this.h, 5, t.categoryAllowlist) : "categoryAllowlist" in t && S(this.h, 5), t.categoryDenylist !== void 0 ? Nn(this.h, 6, t.categoryDenylist) : "categoryDenylist" in t && S(this.h, 6), this.l(t);
4017
+ }
4018
+ F(t, e) {
4019
+ return this.j = { detections: [] }, Pt(this, t, e), this.j;
4020
+ }
4021
+ G(t, e, n) {
4022
+ return this.j = { detections: [] }, Vt(this, t, n, e), this.j;
4023
+ }
4024
+ m() {
4025
+ var t = new _t();
4026
+ N(t, "input_frame_gpu"), N(t, "norm_rect"), T(t, "detections");
4027
+ const e = new yt();
4028
+ Bt(e, Q2, this.h);
4029
+ const n = new st();
4030
+ pt(n, 2, "mediapipe.tasks.vision.ObjectDetectorGraph"), R(n, "IMAGE:input_frame_gpu"), R(n, "NORM_RECT:norm_rect"), w(n, "DETECTIONS:detections"), n.o(e), St(t, n), this.g.attachProtoVectorListener("detections", ((i, r) => {
4031
+ for (const s of i) i = pa(s), this.j.detections.push(Va(i));
4032
+ d(this, r);
4033
+ })), this.g.attachEmptyPacketListener("detections", ((i) => {
4034
+ d(this, i);
4035
+ })), t = t.g(), this.setGraph(new Uint8Array(t), !0);
4036
+ }
4037
+ };
4038
+ wt.prototype.detectForVideo = wt.prototype.G, wt.prototype.detect = wt.prototype.F, wt.prototype.setOptions = wt.prototype.o, wt.createFromModelPath = async function(t, e) {
4039
+ return E(wt, t, { baseOptions: { modelAssetPath: e } });
4040
+ }, wt.createFromModelBuffer = function(t, e) {
4041
+ return E(wt, t, { baseOptions: { modelAssetBuffer: e } });
4042
+ }, wt.createFromOptions = function(t, e) {
4043
+ return E(wt, t, e);
4044
+ };
4045
+ var Vi = class {
4046
+ constructor(t, e, n) {
4047
+ this.landmarks = t, this.worldLandmarks = e, this.segmentationMasks = n;
4048
+ }
4049
+ close() {
4050
+ var t;
4051
+ (t = this.segmentationMasks) == null || t.forEach(((e) => {
4052
+ e.close();
4053
+ }));
4054
+ }
4055
+ };
4056
+ function Zs(t) {
4057
+ t.landmarks = [], t.worldLandmarks = [], t.segmentationMasks = void 0;
4058
+ }
4059
+ function Qs(t) {
4060
+ try {
4061
+ const e = new Vi(t.landmarks, t.worldLandmarks, t.segmentationMasks);
4062
+ if (!t.u) return e;
4063
+ t.u(e);
4064
+ } finally {
4065
+ ai(t);
4066
+ }
4067
+ }
4068
+ Vi.prototype.close = Vi.prototype.close;
4069
+ var ht = class extends mt {
4070
+ constructor(t, e) {
4071
+ super(new Ft(t, e), "image_in", "norm_rect", !1), this.landmarks = [], this.worldLandmarks = [], this.outputSegmentationMasks = !1, _(t = this.h = new Ba(), 0, 1, e = new D()), this.A = new La(), _(this.h, 0, 3, this.A), this.j = new Ma(), _(this.h, 0, 2, this.j), Wt(this.j, 4, 1), y(this.j, 2, 0.5), y(this.A, 2, 0.5), y(this.h, 4, 0.5);
4072
+ }
4073
+ get baseOptions() {
4074
+ return x(this.h, D, 1);
4075
+ }
4076
+ set baseOptions(t) {
4077
+ _(this.h, 0, 1, t);
4078
+ }
4079
+ o(t) {
4080
+ return "numPoses" in t && Wt(this.j, 4, t.numPoses ?? 1), "minPoseDetectionConfidence" in t && y(this.j, 2, t.minPoseDetectionConfidence ?? 0.5), "minTrackingConfidence" in t && y(this.h, 4, t.minTrackingConfidence ?? 0.5), "minPosePresenceConfidence" in t && y(this.A, 2, t.minPosePresenceConfidence ?? 0.5), "outputSegmentationMasks" in t && (this.outputSegmentationMasks = t.outputSegmentationMasks ?? !1), this.l(t);
4081
+ }
4082
+ F(t, e, n) {
4083
+ const i = typeof e != "function" ? e : {};
4084
+ return this.u = typeof e == "function" ? e : n, Zs(this), Pt(this, t, i), Qs(this);
4085
+ }
4086
+ G(t, e, n, i) {
4087
+ const r = typeof n != "function" ? n : {};
4088
+ return this.u = typeof n == "function" ? n : i, Zs(this), Vt(this, t, r, e), Qs(this);
4089
+ }
4090
+ m() {
4091
+ var t = new _t();
4092
+ N(t, "image_in"), N(t, "norm_rect"), T(t, "normalized_landmarks"), T(t, "world_landmarks"), T(t, "segmentation_masks");
4093
+ const e = new yt();
4094
+ Bt(e, tc, this.h);
4095
+ const n = new st();
4096
+ pt(n, 2, "mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"), R(n, "IMAGE:image_in"), R(n, "NORM_RECT:norm_rect"), w(n, "NORM_LANDMARKS:normalized_landmarks"), w(n, "WORLD_LANDMARKS:world_landmarks"), n.o(e), St(t, n), oi(this, t), this.g.attachProtoVectorListener("normalized_landmarks", ((i, r) => {
4097
+ this.landmarks = [];
4098
+ for (const s of i) i = bn(s), this.landmarks.push(si(i));
4099
+ d(this, r);
4100
+ })), this.g.attachEmptyPacketListener("normalized_landmarks", ((i) => {
4101
+ this.landmarks = [], d(this, i);
4102
+ })), this.g.attachProtoVectorListener("world_landmarks", ((i, r) => {
4103
+ this.worldLandmarks = [];
4104
+ for (const s of i) i = ke(s), this.worldLandmarks.push(cn(i));
4105
+ d(this, r);
4106
+ })), this.g.attachEmptyPacketListener("world_landmarks", ((i) => {
4107
+ this.worldLandmarks = [], d(this, i);
4108
+ })), this.outputSegmentationMasks && (w(n, "SEGMENTATION_MASK:segmentation_masks"), Be(this, "segmentation_masks"), this.g.aa("segmentation_masks", ((i, r) => {
4109
+ this.segmentationMasks = i.map(((s) => Ve(this, s, !0, !this.u))), d(this, r);
4110
+ })), this.g.attachEmptyPacketListener("segmentation_masks", ((i) => {
4111
+ this.segmentationMasks = [], d(this, i);
4112
+ }))), t = t.g(), this.setGraph(new Uint8Array(t), !0);
4113
+ }
4114
+ };
4115
+ ht.prototype.detectForVideo = ht.prototype.G, ht.prototype.detect = ht.prototype.F, ht.prototype.setOptions = ht.prototype.o, ht.createFromModelPath = function(t, e) {
4116
+ return E(ht, t, { baseOptions: { modelAssetPath: e } });
4117
+ }, ht.createFromModelBuffer = function(t, e) {
4118
+ return E(ht, t, { baseOptions: { modelAssetBuffer: e } });
4119
+ }, ht.createFromOptions = function(t, e) {
4120
+ return E(ht, t, e);
4121
+ }, ht.POSE_CONNECTIONS = e1;
4122
+ const hc = "https://storage.googleapis.com/mediapipe-models/hand_landmarker/hand_landmarker/float16/1/hand_landmarker.task", lc = "https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@latest/wasm";
4123
+ class uc {
4124
+ constructor() {
4125
+ A(this, "landmarker", null);
4126
+ A(this, "_ready", !1);
4127
+ }
4128
+ get isReady() {
4129
+ return this._ready;
4130
+ }
4131
+ async initialize(e) {
4132
+ const n = (e == null ? void 0 : e.wasmPath) ?? lc, i = (e == null ? void 0 : e.modelPath) ?? hc, r = await ae.forVisionTasks(n);
4133
+ this.landmarker = await rt.createFromOptions(r, {
4134
+ baseOptions: {
4135
+ modelAssetPath: i,
4136
+ delegate: "GPU"
4137
+ },
4138
+ runningMode: "VIDEO",
4139
+ numHands: (e == null ? void 0 : e.numHands) ?? 1,
4140
+ minHandDetectionConfidence: (e == null ? void 0 : e.minDetectionConfidence) ?? 0.5,
4141
+ minTrackingConfidence: (e == null ? void 0 : e.minTrackingConfidence) ?? 0.5
4142
+ }), this._ready = !0;
4143
+ }
4144
+ detect(e, n) {
4145
+ var c, h, l, u, f, v;
4146
+ if (!this.landmarker) return null;
4147
+ const i = this.landmarker.detectForVideo(e, n);
4148
+ if (!i.landmarks || i.landmarks.length === 0) return null;
4149
+ const r = i.landmarks[0], s = ((l = (h = (c = i.handednesses) == null ? void 0 : c[0]) == null ? void 0 : h[0]) == null ? void 0 : l.categoryName) ?? "Right", o = ((v = (f = (u = i.handednesses) == null ? void 0 : u[0]) == null ? void 0 : f[0]) == null ? void 0 : v.score) ?? 0;
4150
+ return {
4151
+ landmarks: r.map((b) => ({
4152
+ x: b.x,
4153
+ y: b.y,
4154
+ visibility: b.visibility ?? void 0
4155
+ })),
4156
+ handedness: s,
4157
+ confidence: o
4158
+ };
4159
+ }
4160
+ destroy() {
4161
+ var e;
4162
+ (e = this.landmarker) == null || e.close(), this.landmarker = null, this._ready = !1;
4163
+ }
4164
+ }
4165
+ function dc(t = {}) {
4166
+ const { modelPath: e, config: n, enabled: i = !0 } = t, r = lt(null), s = lt(null), o = lt(0), a = lt(0), c = lt(0), [h, l] = Yt(!1), [u, f] = Yt(!1), [v, b] = Yt(null), [M, L] = Yt(Pn()), [z, tt] = Yt(null), [vt, re] = Yt(Me.IDLE), [wn, ci] = Yt(null), [n1, i1] = Yt(0), Br = lt(
4167
+ n ? c1(n) : to()
4168
+ ), hi = lt(null), Ur = lt(null), li = lt(null), ui = lt(null), di = lt(null), Vr = lt(0), jr = Xr(() => {
4169
+ const nt = Br.current;
4170
+ Ur.current = new ce(
4171
+ nt.kinematics.emaAlpha,
4172
+ nt.kinematics.bufferFrames
4173
+ ), li.current = new v1(nt.touchproof), ui.current = new b1(), di.current = new w1();
4174
+ }, []), En = Xr(() => {
4175
+ var zr;
4176
+ const nt = r.current, qt = hi.current;
4177
+ if (!nt || !(qt != null && qt.isReady) || nt.readyState < 2) {
4178
+ o.current = requestAnimationFrame(En);
4179
+ return;
4180
+ }
4181
+ const we = performance.now(), ot = nt.videoWidth, kt = nt.videoHeight, Xt = qt.detect(nt, we);
4182
+ let Qe = Pn(), xn = null, Gr = Me.IDLE, Hr = null;
4183
+ if (Xt && Xt.landmarks.length >= 21) {
4184
+ Hr = Xt.landmarks, (zr = Ur.current) == null || zr.compute(Xt.landmarks);
4185
+ const r1 = l1(Xt.landmarks);
4186
+ li.current && (Qe = li.current.update(Xt.landmarks, ot, kt));
4187
+ const Wr = Xt.landmarks[8], Kr = Xt.landmarks[12];
4188
+ if (ui.current && (xn = ui.current.update(
4189
+ [Wr.x, Wr.y],
4190
+ [Kr.x, Kr.y],
4191
+ Qe.isTouching,
4192
+ we
4193
+ )), di.current) {
4194
+ const qr = di.current.update(
4195
+ xn,
4196
+ Qe.isTouching,
4197
+ r1.openPalm && !Qe.isTouching,
4198
+ we
4199
+ );
4200
+ Gr = qr.state, xn = qr.velocity;
4201
+ }
4202
+ }
4203
+ Vr.current++, Vr.current % 2 === 0 && (L(Qe), tt(xn), re(Gr), ci(Hr)), a.current++, we - c.current >= 1e3 && (i1(a.current), a.current = 0, c.current = we), o.current = requestAnimationFrame(En);
4204
+ }, []);
4205
+ return ji(() => {
4206
+ if (!i) return;
4207
+ let nt = !1;
4208
+ const qt = new uc();
4209
+ return hi.current = qt, (async () => {
4210
+ f(!0), b(null);
4211
+ try {
4212
+ const ot = await navigator.mediaDevices.getUserMedia({
4213
+ video: { width: { ideal: 640 }, height: { ideal: 480 }, facingMode: "user" }
4214
+ });
4215
+ if (nt) {
4216
+ ot.getTracks().forEach((kt) => kt.stop());
4217
+ return;
4218
+ }
4219
+ if (r.current && (r.current.srcObject = ot, await r.current.play()), await qt.initialize({ modelPath: e }), nt) return;
4220
+ jr(), l(!0), f(!1), o.current = requestAnimationFrame(En);
4221
+ } catch (ot) {
4222
+ if (nt) return;
4223
+ const kt = ot instanceof Error ? ot.message : "Failed to initialize Glide";
4224
+ kt.includes("Permission") || kt.includes("NotAllowed") ? b("Camera access denied. Please allow camera access and reload.") : kt.includes("NotFound") || kt.includes("DevicesNotFound") ? b("No camera found. Please connect a camera and reload.") : b(kt), f(!1);
4225
+ }
4226
+ })(), () => {
4227
+ nt = !0, cancelAnimationFrame(o.current);
4228
+ const ot = r.current;
4229
+ ot != null && ot.srcObject && (ot.srcObject.getTracks().forEach((kt) => kt.stop()), ot.srcObject = null), qt.destroy(), hi.current = null;
4230
+ };
4231
+ }, [i, e, jr, En]), {
4232
+ videoRef: r,
4233
+ canvasRef: s,
4234
+ isReady: h,
4235
+ isLoading: u,
4236
+ error: v,
4237
+ signals: M,
4238
+ velocity: z,
4239
+ gestureState: vt,
4240
+ landmarks: wn,
4241
+ fps: n1,
4242
+ config: Br.current
4243
+ };
4244
+ }
4245
+ const fc = [
4246
+ [0, 1],
4247
+ [1, 2],
4248
+ [2, 3],
4249
+ [3, 4],
4250
+ // thumb
4251
+ [0, 5],
4252
+ [5, 6],
4253
+ [6, 7],
4254
+ [7, 8],
4255
+ // index
4256
+ [5, 9],
4257
+ [9, 10],
4258
+ [10, 11],
4259
+ [11, 12],
4260
+ // middle
4261
+ [9, 13],
4262
+ [13, 14],
4263
+ [14, 15],
4264
+ [15, 16],
4265
+ // ring
4266
+ [13, 17],
4267
+ [17, 18],
4268
+ [18, 19],
4269
+ [19, 20],
4270
+ // pinky
4271
+ [0, 17]
4272
+ // palm
4273
+ ], pc = ({
4274
+ videoRef: t,
4275
+ canvasRef: e,
4276
+ landmarks: n,
4277
+ signals: i,
4278
+ gestureState: r,
4279
+ fps: s,
4280
+ isLoading: o,
4281
+ error: a
4282
+ }) => {
4283
+ ji(() => {
4284
+ const h = e.current, l = t.current;
4285
+ if (!h || !l) return;
4286
+ const u = h.getContext("2d");
4287
+ if (!u) return;
4288
+ const v = setInterval(() => {
4289
+ if (h.width = l.videoWidth || 640, h.height = l.videoHeight || 480, u.clearRect(0, 0, h.width, h.height), !n || n.length < 21) return;
4290
+ const b = h.width, M = h.height;
4291
+ u.lineWidth = 2, u.strokeStyle = "rgba(255, 255, 255, 0.6)";
4292
+ for (const [L, z] of fc) {
4293
+ const tt = n[L], vt = n[z];
4294
+ u.beginPath(), u.moveTo(tt.x * b, tt.y * M), u.lineTo(vt.x * b, vt.y * M), u.stroke();
4295
+ }
4296
+ for (let L = 0; L < n.length; L++) {
4297
+ const z = n[L], tt = L === 8 || L === 12;
4298
+ u.beginPath(), u.arc(z.x * b, z.y * M, tt ? 6 : 3, 0, Math.PI * 2), tt ? u.fillStyle = i.isTouching ? "#22c55e" : "#ef4444" : u.fillStyle = "rgba(255, 255, 255, 0.8)", u.fill();
4299
+ }
4300
+ }, 50);
4301
+ return () => clearInterval(v);
4302
+ }, [e, t, n, i.isTouching]);
4303
+ const c = [
4304
+ { label: "Proximity", value: i.proximityScore, color: "#3b82f6" },
4305
+ { label: "Angle", value: i.angleScore, color: "#8b5cf6" },
4306
+ { label: "Correlation", value: i.correlationScore, color: "#06b6d4" },
4307
+ { label: "Visibility", value: i.visibilityScore, color: "#f59e0b" },
4308
+ { label: "Fused", value: i.fusedScore, color: i.isTouching ? "#22c55e" : "#ef4444" }
4309
+ ];
4310
+ return /* @__PURE__ */ Et("div", { className: "glide-visualizer", children: [
4311
+ /* @__PURE__ */ Et("div", { className: "glide-video-container", children: [
4312
+ /* @__PURE__ */ I(
4313
+ "video",
4314
+ {
4315
+ ref: t,
4316
+ autoPlay: !0,
4317
+ playsInline: !0,
4318
+ muted: !0,
4319
+ style: { width: "100%", height: "100%", objectFit: "cover", transform: "scaleX(-1)" }
4320
+ }
4321
+ ),
4322
+ /* @__PURE__ */ I(
4323
+ "canvas",
4324
+ {
4325
+ ref: e,
4326
+ className: "glide-canvas-overlay",
4327
+ style: { transform: "scaleX(-1)" }
4328
+ }
4329
+ ),
4330
+ /* @__PURE__ */ Et("div", { className: "glide-status-overlay", children: [
4331
+ /* @__PURE__ */ Et("span", { className: "glide-fps", children: [
4332
+ s,
4333
+ " FPS"
4334
+ ] }),
4335
+ /* @__PURE__ */ I("span", { className: `glide-state glide-state--${r}`, children: r === Me.SCROLLING ? "SCROLLING" : "IDLE" })
4336
+ ] }),
4337
+ o && /* @__PURE__ */ Et("div", { className: "glide-loading-overlay", children: [
4338
+ /* @__PURE__ */ I("div", { className: "glide-spinner" }),
4339
+ /* @__PURE__ */ I("p", { children: "Loading hand detection model..." })
4340
+ ] }),
4341
+ a && /* @__PURE__ */ I("div", { className: "glide-error-overlay", children: /* @__PURE__ */ I("p", { children: a }) })
4342
+ ] }),
4343
+ /* @__PURE__ */ Et("div", { className: "glide-signal-dashboard", children: [
4344
+ c.map((h) => /* @__PURE__ */ Et("div", { className: "glide-signal-row", children: [
4345
+ /* @__PURE__ */ I("span", { className: "glide-signal-label", children: h.label }),
4346
+ /* @__PURE__ */ I("div", { className: "glide-signal-bar-bg", children: /* @__PURE__ */ I(
4347
+ "div",
4348
+ {
4349
+ className: "glide-signal-bar-fill",
4350
+ style: {
4351
+ width: `${Math.max(0, Math.min(100, h.value * 100))}%`,
4352
+ backgroundColor: h.color
4353
+ }
4354
+ }
4355
+ ) }),
4356
+ /* @__PURE__ */ I("span", { className: "glide-signal-value", children: h.value.toFixed(2) })
4357
+ ] }, h.label)),
4358
+ /* @__PURE__ */ Et("div", { className: "glide-signal-row", children: [
4359
+ /* @__PURE__ */ I("span", { className: "glide-signal-label", children: "Distance" }),
4360
+ /* @__PURE__ */ I("div", { className: "glide-signal-bar-bg", children: /* @__PURE__ */ I(
4361
+ "div",
4362
+ {
4363
+ className: "glide-signal-bar-fill",
4364
+ style: {
4365
+ width: `${i.distanceFactor * 100}%`,
4366
+ backgroundColor: "#64748b"
4367
+ }
4368
+ }
4369
+ ) }),
4370
+ /* @__PURE__ */ I("span", { className: "glide-signal-value", children: i.distanceFactor.toFixed(2) })
4371
+ ] })
4372
+ ] })
4373
+ ] });
4374
+ }, gc = /* @__PURE__ */ Et(a1, { children: [
4375
+ /* @__PURE__ */ I("h2", { children: "Scroll Demo" }),
4376
+ /* @__PURE__ */ I("p", { children: "This area responds to your Glide gestures. Pinch your index and middle fingers together, then move them up or down to scroll." }),
4377
+ Array.from({ length: 20 }, (t, e) => /* @__PURE__ */ Et("div", { className: "glide-scroll-section", children: [
4378
+ /* @__PURE__ */ Et("h3", { children: [
4379
+ "Section ",
4380
+ e + 1
4381
+ ] }),
4382
+ /* @__PURE__ */ I("p", { children: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat." }),
4383
+ /* @__PURE__ */ I("p", { children: "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." })
4384
+ ] }, e))
4385
+ ] }), mc = ({
4386
+ velocity: t,
4387
+ gestureState: e,
4388
+ isActive: n,
4389
+ children: i
4390
+ }) => {
4391
+ const r = lt(null);
4392
+ return ji(() => {
4393
+ if (!n || e !== Me.SCROLLING || !t || !r.current) return;
4394
+ const s = -t.y * 1400;
4395
+ r.current.scrollBy({ top: s / 60 });
4396
+ }, [t, e, n]), /* @__PURE__ */ I(
4397
+ "div",
4398
+ {
4399
+ ref: r,
4400
+ className: `glide-scroll-area ${n ? "glide-scroll-area--active" : ""}`,
4401
+ children: i ?? gc
4402
+ }
4403
+ );
4404
+ }, Ac = ({
4405
+ modelPath: t,
4406
+ config: e,
4407
+ showVisualizer: n = !0,
4408
+ scrollContent: i,
4409
+ className: r = "",
4410
+ style: s
4411
+ }) => {
4412
+ const o = dc({ modelPath: t, config: e }), a = i === null;
4413
+ return /* @__PURE__ */ Et("div", { className: `glide-demo ${a ? "glide-demo--full" : ""} ${r}`, style: s, children: [
4414
+ n && /* @__PURE__ */ I(
4415
+ pc,
4416
+ {
4417
+ videoRef: o.videoRef,
4418
+ canvasRef: o.canvasRef,
4419
+ landmarks: o.landmarks,
4420
+ signals: o.signals,
4421
+ gestureState: o.gestureState,
4422
+ fps: o.fps,
4423
+ isLoading: o.isLoading,
4424
+ error: o.error
4425
+ }
4426
+ ),
4427
+ !a && /* @__PURE__ */ I(
4428
+ mc,
4429
+ {
4430
+ velocity: o.velocity,
4431
+ gestureState: o.gestureState,
4432
+ isActive: o.gestureState === Me.SCROLLING,
4433
+ children: i
4434
+ }
4435
+ )
4436
+ ] });
4437
+ };
4438
+ export {
4439
+ Ac as GlideDemo,
4440
+ dc as useGlide
4441
+ };