@richard.fadiora/liveness-detection 4.2.13 → 4.3.0

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