youverify-liveness-web 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/index.js +776 -715
- package/dist/index.umd.cjs +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -50,9 +50,9 @@ function _t() {
|
|
|
50
50
|
for (xe.sort(Xt); e = xe.shift(); ) e.__d && (t = xe.length, r = void 0, i = (o = (n = e).__v).__e, s = [], a = [], n.__P && ((r = me({}, o)).__v = o.__v + 1, O.vnode && O.vnode(r), _n(n.__P, r, o, n.__n, n.__P.namespaceURI, 32 & o.__u ? [i] : null, s, i ?? Ae(o), !!(32 & o.__u), a), r.__v = o.__v, r.__.__k[r.__i] = r, Dr(s, r, a), r.__e != i && Ar(r)), xe.length > t && xe.sort(Xt));
|
|
51
51
|
_t.__r = 0;
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function Rr(e, t, n, r, o, i, s, a, l, u, d) {
|
|
54
54
|
var c, f, p, _, y, m = r && r.__k || Nr, v = t.length;
|
|
55
|
-
for (n.__d = l, Xo(n, t, m), l = n.__d, c = 0; c < v; c++) (p = n.__k[c]) != null && typeof p != "boolean" && typeof p != "function" && (f = p.__i === -1 ? rt : m[p.__i] || rt, p.__i = c, _n(e, p, f, o, i, s, a, l, u, d), _ = p.__e, p.ref && f.ref != p.ref && (f.ref && yn(f.ref, null, p), d.push(p.ref, p.__c || _, p)), y == null && _ != null && (y = _), 65536 & p.__u || f.__k === p.__k ? l =
|
|
55
|
+
for (n.__d = l, Xo(n, t, m), l = n.__d, c = 0; c < v; c++) (p = n.__k[c]) != null && typeof p != "boolean" && typeof p != "function" && (f = p.__i === -1 ? rt : m[p.__i] || rt, p.__i = c, _n(e, p, f, o, i, s, a, l, u, d), _ = p.__e, p.ref && f.ref != p.ref && (f.ref && yn(f.ref, null, p), d.push(p.ref, p.__c || _, p)), y == null && _ != null && (y = _), 65536 & p.__u || f.__k === p.__k ? l = Ir(p, l, e) : typeof p.type == "function" && p.__d !== void 0 ? l = p.__d : _ && (l = _.nextSibling), p.__d = void 0, p.__u &= -196609);
|
|
56
56
|
n.__d = l, n.__e = y;
|
|
57
57
|
}
|
|
58
58
|
function Xo(e, t, n) {
|
|
@@ -60,10 +60,10 @@ function Xo(e, t, n) {
|
|
|
60
60
|
for (e.__k = [], r = 0; r < l; r++) s = r + c, (o = e.__k[r] = (o = t[r]) == null || typeof o == "boolean" || typeof o == "function" ? null : typeof o == "string" || typeof o == "number" || typeof o == "bigint" || o.constructor == String ? Je(null, o, null, null, null) : Tt(o) ? Je(q, { children: o }, null, null, null) : o.constructor === void 0 && o.__b > 0 ? Je(o.type, o.props, o.key, o.ref ? o.ref : null, o.__v) : o) != null ? (o.__ = e, o.__b = e.__b + 1, a = Zo(o, n, s, d), o.__i = a, i = null, a !== -1 && (d--, (i = n[a]) && (i.__u |= 131072)), i == null || i.__v === null ? (a == -1 && c--, typeof o.type != "function" && (o.__u |= 65536)) : a !== s && (a == s - 1 ? c = a - s : a == s + 1 ? c++ : a > s ? d > l - s ? c += a - s : c-- : a < s && c++, a !== r + c && (o.__u |= 65536))) : (i = n[s]) && i.key == null && i.__e && !(131072 & i.__u) && (i.__e == e.__d && (e.__d = Ae(i)), en(i, i, !1), n[s] = null, d--);
|
|
61
61
|
if (d) for (r = 0; r < u; r++) (i = n[r]) != null && !(131072 & i.__u) && (i.__e == e.__d && (e.__d = Ae(i)), en(i, i));
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function Ir(e, t, n) {
|
|
64
64
|
var r, o;
|
|
65
65
|
if (typeof e.type == "function") {
|
|
66
|
-
for (r = e.__k, o = 0; r && o < r.length; o++) r[o] && (r[o].__ = e, t =
|
|
66
|
+
for (r = e.__k, o = 0; r && o < r.length; o++) r[o] && (r[o].__ = e, t = Ir(r[o], t, n));
|
|
67
67
|
return t;
|
|
68
68
|
}
|
|
69
69
|
e.__e != t && (t && e.type && !n.contains(t) && (t = Ae(e)), n.insertBefore(e.__e, t || null), t = e.__e);
|
|
@@ -124,15 +124,15 @@ function Wn(e) {
|
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
126
|
function _n(e, t, n, r, o, i, s, a, l, u) {
|
|
127
|
-
var d, c, f, p, _, y, m, v, g, $, T, S,
|
|
127
|
+
var d, c, f, p, _, y, m, v, g, $, T, S, M, A, W, F, b = t.type;
|
|
128
128
|
if (t.constructor !== void 0) return null;
|
|
129
129
|
128 & n.__u && (l = !!(32 & n.__u), i = [a = t.__e = n.__e]), (d = O.__b) && d(t);
|
|
130
|
-
e: if (typeof
|
|
131
|
-
if (v = t.props, g = "prototype" in
|
|
130
|
+
e: if (typeof b == "function") try {
|
|
131
|
+
if (v = t.props, g = "prototype" in b && b.prototype.render, $ = (d = b.contextType) && r[d.__c], T = d ? $ ? $.props.value : d.__ : r, n.__c ? m = (c = t.__c = n.__c).__ = c.__E : (g ? t.__c = c = new b(v, T) : (t.__c = c = new ue(v, T), c.constructor = b, c.render = Qo), $ && $.sub(c), c.props = v, c.state || (c.state = {}), c.context = T, c.__n = r, f = c.__d = !0, c.__h = [], c._sb = []), g && c.__s == null && (c.__s = c.state), g && b.getDerivedStateFromProps != null && (c.__s == c.state && (c.__s = me({}, c.__s)), me(c.__s, b.getDerivedStateFromProps(v, c.__s))), p = c.props, _ = c.state, c.__v = t, f) g && b.getDerivedStateFromProps == null && c.componentWillMount != null && c.componentWillMount(), g && c.componentDidMount != null && c.__h.push(c.componentDidMount);
|
|
132
132
|
else {
|
|
133
|
-
if (g &&
|
|
134
|
-
for (t.__v !== n.__v && (c.props = v, c.state = c.__s, c.__d = !1), t.__e = n.__e, t.__k = n.__k, t.__k.forEach(function(
|
|
135
|
-
|
|
133
|
+
if (g && b.getDerivedStateFromProps == null && v !== p && c.componentWillReceiveProps != null && c.componentWillReceiveProps(v, T), !c.__e && (c.shouldComponentUpdate != null && c.shouldComponentUpdate(v, c.__s, T) === !1 || t.__v === n.__v)) {
|
|
134
|
+
for (t.__v !== n.__v && (c.props = v, c.state = c.__s, c.__d = !1), t.__e = n.__e, t.__k = n.__k, t.__k.forEach(function(R) {
|
|
135
|
+
R && (R.__ = t);
|
|
136
136
|
}), S = 0; S < c._sb.length; S++) c.__h.push(c._sb[S]);
|
|
137
137
|
c._sb = [], c.__h.length && s.push(c);
|
|
138
138
|
break e;
|
|
@@ -141,19 +141,19 @@ function _n(e, t, n, r, o, i, s, a, l, u) {
|
|
|
141
141
|
c.componentDidUpdate(p, _, y);
|
|
142
142
|
});
|
|
143
143
|
}
|
|
144
|
-
if (c.context = T, c.props = v, c.__P = e, c.__e = !1,
|
|
145
|
-
for (c.state = c.__s, c.__d = !1,
|
|
144
|
+
if (c.context = T, c.props = v, c.__P = e, c.__e = !1, M = O.__r, A = 0, g) {
|
|
145
|
+
for (c.state = c.__s, c.__d = !1, M && M(t), d = c.render(c.props, c.state, c.context), W = 0; W < c._sb.length; W++) c.__h.push(c._sb[W]);
|
|
146
146
|
c._sb = [];
|
|
147
147
|
} else do
|
|
148
|
-
c.__d = !1,
|
|
149
|
-
while (c.__d && ++
|
|
150
|
-
c.state = c.__s, c.getChildContext != null && (r = me(me({}, r), c.getChildContext())), g && !f && c.getSnapshotBeforeUpdate != null && (y = c.getSnapshotBeforeUpdate(p, _)),
|
|
151
|
-
} catch (
|
|
148
|
+
c.__d = !1, M && M(t), d = c.render(c.props, c.state, c.context), c.state = c.__s;
|
|
149
|
+
while (c.__d && ++A < 25);
|
|
150
|
+
c.state = c.__s, c.getChildContext != null && (r = me(me({}, r), c.getChildContext())), g && !f && c.getSnapshotBeforeUpdate != null && (y = c.getSnapshotBeforeUpdate(p, _)), Rr(e, Tt(F = d != null && d.type === q && d.key == null ? d.props.children : d) ? F : [F], t, n, r, o, i, s, a, l, u), c.base = t.__e, t.__u &= -161, c.__h.length && s.push(c), m && (c.__E = c.__ = null);
|
|
151
|
+
} catch (R) {
|
|
152
152
|
if (t.__v = null, l || i != null) {
|
|
153
153
|
for (t.__u |= l ? 160 : 32; a && a.nodeType === 8 && a.nextSibling; ) a = a.nextSibling;
|
|
154
154
|
i[i.indexOf(a)] = null, t.__e = a;
|
|
155
155
|
} else t.__e = n.__e, t.__k = n.__k;
|
|
156
|
-
O.__e(
|
|
156
|
+
O.__e(R, t, n);
|
|
157
157
|
}
|
|
158
158
|
else i == null && t.__v === n.__v ? (t.__k = n.__k, t.__e = n.__e) : t.__e = Jo(n.__e, t, n, r, o, i, s, l, u);
|
|
159
159
|
(d = O.diffed) && d(t);
|
|
@@ -195,7 +195,7 @@ function Jo(e, t, n, r, o, i, s, a, l) {
|
|
|
195
195
|
}
|
|
196
196
|
for (u in v) p = v[u], u == "children" ? f = p : u == "dangerouslySetInnerHTML" ? d = p : u == "value" ? _ = p : u == "checked" ? y = p : u === "key" || a && typeof p != "function" || m[u] === p || ft(e, u, p, m[u], o);
|
|
197
197
|
if (d) a || c && (d.__html === c.__html || d.__html === e.innerHTML) || (e.innerHTML = d.__html), t.__k = [];
|
|
198
|
-
else if (c && (e.innerHTML = ""),
|
|
198
|
+
else if (c && (e.innerHTML = ""), Rr(e, Tt(f) ? f : [f], t, n, r, g === "foreignObject" ? "http://www.w3.org/1999/xhtml" : o, i, s, i ? i[0] : n.__k && Ae(n, 0), a, l), i != null) for (u = i.length; u--; ) i[u] != null && Lr(i[u]);
|
|
199
199
|
a || (u = "value", _ !== void 0 && (_ !== e[u] || g === "progress" && !_ || g === "option" && _ !== m[u]) && ft(e, u, _, m[u], o), u = "checked", y !== void 0 && y !== e[u] && ft(e, u, y, m[u], o));
|
|
200
200
|
}
|
|
201
201
|
return e;
|
|
@@ -226,12 +226,12 @@ function en(e, t, n) {
|
|
|
226
226
|
function Qo(e, t, n) {
|
|
227
227
|
return this.constructor(e, n);
|
|
228
228
|
}
|
|
229
|
-
function
|
|
229
|
+
function Ue(e, t, n) {
|
|
230
230
|
var r, o, i, s;
|
|
231
231
|
O.__ && O.__(e, t), o = (r = typeof n == "function") ? null : n && n.__k || t.__k, i = [], s = [], _n(t, e = (!r && n || t).__k = de(q, null, [e]), o || rt, rt, t.namespaceURI, !r && n ? [n] : o ? null : t.firstChild ? ot.call(t.childNodes) : null, i, !r && n ? n : o ? o.__e : t.firstChild, r, s), Dr(i, e, s);
|
|
232
232
|
}
|
|
233
233
|
function Or(e, t) {
|
|
234
|
-
|
|
234
|
+
Ue(e, t, Or);
|
|
235
235
|
}
|
|
236
236
|
function ei(e, t, n) {
|
|
237
237
|
var r, o, i, s, a = me({}, e.props);
|
|
@@ -285,17 +285,17 @@ function h(e, t, n, r, o, i) {
|
|
|
285
285
|
if (typeof e == "function" && (s = e.defaultProps)) for (a in s) l[a] === void 0 && (l[a] = s[a]);
|
|
286
286
|
return O.vnode && O.vnode(u), u;
|
|
287
287
|
}
|
|
288
|
-
var ge, B, Ht,
|
|
289
|
-
function
|
|
290
|
-
|
|
288
|
+
var ge, B, Ht, Un, ze = 0, Hr = [], K = O, zn = K.__b, Vn = K.__r, jn = K.diffed, Bn = K.__c, qn = K.unmount, Yn = K.__;
|
|
289
|
+
function Ie(e, t) {
|
|
290
|
+
K.__h && K.__h(B, e, ze || t), ze = 0;
|
|
291
291
|
var n = B.__H || (B.__H = { __: [], __h: [] });
|
|
292
292
|
return e >= n.__.length && n.__.push({}), n.__[e];
|
|
293
293
|
}
|
|
294
|
-
function
|
|
295
|
-
return
|
|
294
|
+
function x(e) {
|
|
295
|
+
return ze = 1, it(Wr, e);
|
|
296
296
|
}
|
|
297
297
|
function it(e, t, n) {
|
|
298
|
-
var r =
|
|
298
|
+
var r = Ie(ge++, 2);
|
|
299
299
|
if (r.t = e, !r.__c && (r.__ = [n ? n(t) : Wr(void 0, t), function(a) {
|
|
300
300
|
var l = r.__N ? r.__N[0] : r.__[0], u = r.t(l, a);
|
|
301
301
|
l !== u && (r.__N = [u, r.__[1]], r.__c.setState({}));
|
|
@@ -329,20 +329,20 @@ function it(e, t, n) {
|
|
|
329
329
|
return r.__N || r.__;
|
|
330
330
|
}
|
|
331
331
|
function H(e, t) {
|
|
332
|
-
var n =
|
|
333
|
-
!
|
|
332
|
+
var n = Ie(ge++, 3);
|
|
333
|
+
!K.__s && bn(n.__H, t) && (n.__ = e, n.i = t, B.__H.__h.push(n));
|
|
334
334
|
}
|
|
335
335
|
function De(e, t) {
|
|
336
|
-
var n =
|
|
337
|
-
!
|
|
336
|
+
var n = Ie(ge++, 4);
|
|
337
|
+
!K.__s && bn(n.__H, t) && (n.__ = e, n.i = t, B.__h.push(n));
|
|
338
338
|
}
|
|
339
339
|
function w(e) {
|
|
340
|
-
return
|
|
340
|
+
return ze = 5, z(function() {
|
|
341
341
|
return { current: e };
|
|
342
342
|
}, []);
|
|
343
343
|
}
|
|
344
344
|
function gn(e, t, n) {
|
|
345
|
-
|
|
345
|
+
ze = 6, De(function() {
|
|
346
346
|
return typeof e == "function" ? (e(t()), function() {
|
|
347
347
|
return e(null);
|
|
348
348
|
}) : e ? (e.current = t(), function() {
|
|
@@ -350,24 +350,24 @@ function gn(e, t, n) {
|
|
|
350
350
|
}) : void 0;
|
|
351
351
|
}, n == null ? n : n.concat(e));
|
|
352
352
|
}
|
|
353
|
-
function
|
|
354
|
-
var n =
|
|
353
|
+
function z(e, t) {
|
|
354
|
+
var n = Ie(ge++, 7);
|
|
355
355
|
return bn(n.__H, t) && (n.__ = e(), n.__H = t, n.__h = e), n.__;
|
|
356
356
|
}
|
|
357
357
|
function U(e, t) {
|
|
358
|
-
return
|
|
358
|
+
return ze = 8, z(function() {
|
|
359
359
|
return e;
|
|
360
360
|
}, t);
|
|
361
361
|
}
|
|
362
362
|
function te(e) {
|
|
363
|
-
var t = B.context[e.__c], n =
|
|
363
|
+
var t = B.context[e.__c], n = Ie(ge++, 9);
|
|
364
364
|
return n.c = e, t ? (n.__ == null && (n.__ = !0, t.sub(B)), t.props.value) : e.__;
|
|
365
365
|
}
|
|
366
366
|
function wn(e, t) {
|
|
367
|
-
|
|
367
|
+
K.useDebugValue && K.useDebugValue(t ? t(e) : e);
|
|
368
368
|
}
|
|
369
369
|
function ni(e) {
|
|
370
|
-
var t =
|
|
370
|
+
var t = Ie(ge++, 10), n = x();
|
|
371
371
|
return t.__ = e, B.componentDidCatch || (B.componentDidCatch = function(r, o) {
|
|
372
372
|
t.__ && t.__(r, o), n[1](r);
|
|
373
373
|
}), [n[0], function() {
|
|
@@ -375,7 +375,7 @@ function ni(e) {
|
|
|
375
375
|
}];
|
|
376
376
|
}
|
|
377
377
|
function ke() {
|
|
378
|
-
var e =
|
|
378
|
+
var e = Ie(ge++, 11);
|
|
379
379
|
if (!e.__) {
|
|
380
380
|
for (var t = B.__v; t !== null && !t.__m && t.__ !== null; ) t = t.__;
|
|
381
381
|
var n = t.__m || (t.__m = [0, 0]);
|
|
@@ -387,26 +387,26 @@ function ri() {
|
|
|
387
387
|
for (var e; e = Hr.shift(); ) if (e.__P && e.__H) try {
|
|
388
388
|
e.__H.__h.forEach(vt), e.__H.__h.forEach(tn), e.__H.__h = [];
|
|
389
389
|
} catch (t) {
|
|
390
|
-
e.__H.__h = [],
|
|
390
|
+
e.__H.__h = [], K.__e(t, e.__v);
|
|
391
391
|
}
|
|
392
392
|
}
|
|
393
|
-
|
|
394
|
-
B = null,
|
|
395
|
-
},
|
|
393
|
+
K.__b = function(e) {
|
|
394
|
+
B = null, zn && zn(e);
|
|
395
|
+
}, K.__ = function(e, t) {
|
|
396
396
|
e && t.__k && t.__k.__m && (e.__m = t.__k.__m), Yn && Yn(e, t);
|
|
397
|
-
},
|
|
398
|
-
|
|
397
|
+
}, K.__r = function(e) {
|
|
398
|
+
Vn && Vn(e), ge = 0;
|
|
399
399
|
var t = (B = e.__c).__H;
|
|
400
400
|
t && (Ht === B ? (t.__h = [], B.__h = [], t.__.forEach(function(n) {
|
|
401
401
|
n.__N && (n.__ = n.__N), n.i = n.__N = void 0;
|
|
402
402
|
})) : (t.__h.forEach(vt), t.__h.forEach(tn), t.__h = [], ge = 0)), Ht = B;
|
|
403
|
-
},
|
|
404
|
-
|
|
403
|
+
}, K.diffed = function(e) {
|
|
404
|
+
jn && jn(e);
|
|
405
405
|
var t = e.__c;
|
|
406
|
-
t && t.__H && (t.__H.__h.length && (Hr.push(t) !== 1 &&
|
|
406
|
+
t && t.__H && (t.__H.__h.length && (Hr.push(t) !== 1 && Un === K.requestAnimationFrame || ((Un = K.requestAnimationFrame) || oi)(ri)), t.__H.__.forEach(function(n) {
|
|
407
407
|
n.i && (n.__H = n.i), n.i = void 0;
|
|
408
408
|
})), Ht = B = null;
|
|
409
|
-
},
|
|
409
|
+
}, K.__c = function(e, t) {
|
|
410
410
|
t.some(function(n) {
|
|
411
411
|
try {
|
|
412
412
|
n.__h.forEach(vt), n.__h = n.__h.filter(function(r) {
|
|
@@ -415,10 +415,10 @@ Z.__b = function(e) {
|
|
|
415
415
|
} catch (r) {
|
|
416
416
|
t.some(function(o) {
|
|
417
417
|
o.__h && (o.__h = []);
|
|
418
|
-
}), t = [],
|
|
418
|
+
}), t = [], K.__e(r, n.__v);
|
|
419
419
|
}
|
|
420
420
|
}), Bn && Bn(e, t);
|
|
421
|
-
},
|
|
421
|
+
}, K.unmount = function(e) {
|
|
422
422
|
qn && qn(e);
|
|
423
423
|
var t, n = e.__c;
|
|
424
424
|
n && n.__H && (n.__H.__.forEach(function(r) {
|
|
@@ -427,7 +427,7 @@ Z.__b = function(e) {
|
|
|
427
427
|
} catch (o) {
|
|
428
428
|
t = o;
|
|
429
429
|
}
|
|
430
|
-
}), n.__H = void 0, t &&
|
|
430
|
+
}), n.__H = void 0, t && K.__e(t, n.__v));
|
|
431
431
|
};
|
|
432
432
|
var Gn = typeof requestAnimationFrame == "function";
|
|
433
433
|
function oi(e) {
|
|
@@ -452,7 +452,7 @@ function bn(e, t) {
|
|
|
452
452
|
function Wr(e, t) {
|
|
453
453
|
return typeof t == "function" ? t(e) : t;
|
|
454
454
|
}
|
|
455
|
-
function
|
|
455
|
+
function Ur(e, t) {
|
|
456
456
|
for (var n in t) e[n] = t[n];
|
|
457
457
|
return e;
|
|
458
458
|
}
|
|
@@ -464,7 +464,7 @@ function nn(e, t) {
|
|
|
464
464
|
function yt(e, t) {
|
|
465
465
|
this.props = e, this.context = t;
|
|
466
466
|
}
|
|
467
|
-
function
|
|
467
|
+
function zr(e, t) {
|
|
468
468
|
function n(o) {
|
|
469
469
|
var i = this.props.ref, s = i == o.ref;
|
|
470
470
|
return !s && i && (i.call ? i(null) : i.current = null), t ? !t(this.props, o) || !s : nn(this.props, o);
|
|
@@ -484,14 +484,14 @@ O.__b = function(e) {
|
|
|
484
484
|
var ii = typeof Symbol < "u" && Symbol.for && Symbol.for("react.forward_ref") || 3911;
|
|
485
485
|
function En(e) {
|
|
486
486
|
function t(n) {
|
|
487
|
-
var r =
|
|
487
|
+
var r = Ur({}, n);
|
|
488
488
|
return delete r.ref, e(r, n.ref || null);
|
|
489
489
|
}
|
|
490
490
|
return t.$$typeof = ii, t.render = t, t.prototype.isReactComponent = t.__f = !0, t.displayName = "ForwardRef(" + (e.displayName || e.name) + ")", t;
|
|
491
491
|
}
|
|
492
492
|
var Xn = function(e, t) {
|
|
493
493
|
return e == null ? null : _e(_e(e).map(t));
|
|
494
|
-
},
|
|
494
|
+
}, Vr = { map: Xn, forEach: Xn, count: function(e) {
|
|
495
495
|
return e ? _e(e).length : 0;
|
|
496
496
|
}, only: function(e) {
|
|
497
497
|
var t = _e(e);
|
|
@@ -505,11 +505,11 @@ O.__e = function(e, t, n, r) {
|
|
|
505
505
|
si(e, t, n, r);
|
|
506
506
|
};
|
|
507
507
|
var Zn = O.unmount;
|
|
508
|
-
function
|
|
508
|
+
function jr(e, t, n) {
|
|
509
509
|
return e && (e.__c && e.__c.__H && (e.__c.__H.__.forEach(function(r) {
|
|
510
510
|
typeof r.__c == "function" && r.__c();
|
|
511
|
-
}), e.__c.__H = null), (e =
|
|
512
|
-
return
|
|
511
|
+
}), e.__c.__H = null), (e = Ur({}, e)).__c != null && (e.__c.__P === n && (e.__c.__P = t), e.__c = null), e.__k = e.__k && e.__k.map(function(r) {
|
|
512
|
+
return jr(r, t, n);
|
|
513
513
|
})), e;
|
|
514
514
|
}
|
|
515
515
|
function Br(e, t, n) {
|
|
@@ -567,7 +567,7 @@ O.unmount = function(e) {
|
|
|
567
567
|
if (this.__b) {
|
|
568
568
|
if (this.__v.__k) {
|
|
569
569
|
var n = document.createElement("div"), r = this.__v.__k[0].__c;
|
|
570
|
-
this.__v.__k[0] =
|
|
570
|
+
this.__v.__k[0] = jr(this.__b, n, r.__O = r.__P);
|
|
571
571
|
}
|
|
572
572
|
this.__b = null;
|
|
573
573
|
}
|
|
@@ -589,7 +589,7 @@ function ai(e) {
|
|
|
589
589
|
function li(e) {
|
|
590
590
|
var t = this, n = e.i;
|
|
591
591
|
t.componentWillUnmount = function() {
|
|
592
|
-
|
|
592
|
+
Ue(null, t.l), t.l = null, t.i = null;
|
|
593
593
|
}, t.i && t.i !== n && t.componentWillUnmount(), t.l || (t.i = n, t.l = { nodeType: 1, parentNode: n, childNodes: [], contains: function() {
|
|
594
594
|
return !0;
|
|
595
595
|
}, appendChild: function(r) {
|
|
@@ -598,7 +598,7 @@ function li(e) {
|
|
|
598
598
|
this.childNodes.push(r), t.i.appendChild(r);
|
|
599
599
|
}, removeChild: function(r) {
|
|
600
600
|
this.childNodes.splice(this.childNodes.indexOf(r) >>> 1, 1), t.i.removeChild(r);
|
|
601
|
-
} }),
|
|
601
|
+
} }), Ue(de(ai, { context: t.context }, e.__v), t.l);
|
|
602
602
|
}
|
|
603
603
|
function kt(e, t) {
|
|
604
604
|
var n = de(li, { __v: e, i: t });
|
|
@@ -628,7 +628,7 @@ var Gr = typeof Symbol < "u" && Symbol.for && Symbol.for("react.element") || 601
|
|
|
628
628
|
return (typeof Symbol < "u" && typeof Symbol() == "symbol" ? /fil|che|rad/ : /fil|che|ra/).test(e);
|
|
629
629
|
};
|
|
630
630
|
function Kr(e, t, n) {
|
|
631
|
-
return t.__k == null && (t.textContent = ""),
|
|
631
|
+
return t.__k == null && (t.textContent = ""), Ue(e, t), typeof n == "function" && n(), e ? e.__c : null;
|
|
632
632
|
}
|
|
633
633
|
function Xr(e, t, n) {
|
|
634
634
|
return Or(e, t), typeof n == "function" && n(), e ? e.__c : null;
|
|
@@ -684,24 +684,24 @@ O.diffed = function(e) {
|
|
|
684
684
|
};
|
|
685
685
|
var Zr = { ReactCurrentDispatcher: { current: { readContext: function(e) {
|
|
686
686
|
return $n.__n[e.__c].props.value;
|
|
687
|
-
}, useCallback: U, useContext: te, useDebugValue: wn, useDeferredValue: Sn, useEffect: H, useId: ke, useImperativeHandle: gn, useInsertionEffect:
|
|
687
|
+
}, useCallback: U, useContext: te, useDebugValue: wn, useDeferredValue: Sn, useEffect: H, useId: ke, useImperativeHandle: gn, useInsertionEffect: Fn, useLayoutEffect: De, useMemo: z, useReducer: it, useRef: w, useState: x, useSyncExternalStore: St, useTransition: Cn } } }, yi = "17.0.2";
|
|
688
688
|
function Jr(e) {
|
|
689
689
|
return de.bind(null, e);
|
|
690
690
|
}
|
|
691
|
-
function
|
|
691
|
+
function je(e) {
|
|
692
692
|
return !!e && e.$$typeof === Gr;
|
|
693
693
|
}
|
|
694
694
|
function Qr(e) {
|
|
695
|
-
return
|
|
695
|
+
return je(e) && e.type === q;
|
|
696
696
|
}
|
|
697
697
|
function eo(e) {
|
|
698
698
|
return !!e && !!e.displayName && (typeof e.displayName == "string" || e.displayName instanceof String) && e.displayName.startsWith("Memo(");
|
|
699
699
|
}
|
|
700
700
|
function Tn(e) {
|
|
701
|
-
return
|
|
701
|
+
return je(e) ? ei.apply(null, arguments) : e;
|
|
702
702
|
}
|
|
703
703
|
function to(e) {
|
|
704
|
-
return !!e.__k && (
|
|
704
|
+
return !!e.__k && (Ue(null, e), !0);
|
|
705
705
|
}
|
|
706
706
|
function no(e) {
|
|
707
707
|
return e && (e.base || e.nodeType === 1 && e) || null;
|
|
@@ -717,12 +717,12 @@ function kn(e) {
|
|
|
717
717
|
function Sn(e) {
|
|
718
718
|
return e;
|
|
719
719
|
}
|
|
720
|
-
function
|
|
720
|
+
function Cn() {
|
|
721
721
|
return [!1, kn];
|
|
722
722
|
}
|
|
723
|
-
var
|
|
723
|
+
var Fn = De, so = je;
|
|
724
724
|
function St(e, t) {
|
|
725
|
-
var n = t(), r =
|
|
725
|
+
var n = t(), r = x({ h: { __: n, v: t } }), o = r[0].h, i = r[1];
|
|
726
726
|
return De(function() {
|
|
727
727
|
o.__ = n, o.v = t, Wt(o) && i({ h: o });
|
|
728
728
|
}, [e, n, t]), H(function() {
|
|
@@ -740,10 +740,10 @@ function Wt(e) {
|
|
|
740
740
|
return !0;
|
|
741
741
|
}
|
|
742
742
|
}
|
|
743
|
-
var
|
|
743
|
+
var L = { useState: x, useId: ke, useReducer: it, useEffect: H, useLayoutEffect: De, useInsertionEffect: Fn, useTransition: Cn, useDeferredValue: Sn, useSyncExternalStore: St, startTransition: kn, useRef: w, useImperativeHandle: gn, useMemo: z, useCallback: U, useContext: te, useDebugValue: wn, version: "17.0.2", Children: Vr, render: Kr, hydrate: Xr, unmountComponentAtNode: to, createPortal: kt, createElement: de, createContext: ie, createFactory: Jr, cloneElement: Tn, createRef: mn, Fragment: q, isValidElement: je, isElement: so, isFragment: Qr, isMemo: eo, findDOMNode: no, Component: ue, PureComponent: yt, memo: zr, forwardRef: En, flushSync: oo, unstable_batchedUpdates: ro, StrictMode: io, Suspense: Qe, SuspenseList: We, lazy: Yr, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: Zr };
|
|
744
744
|
const rr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
745
745
|
__proto__: null,
|
|
746
|
-
Children:
|
|
746
|
+
Children: Vr,
|
|
747
747
|
Component: ue,
|
|
748
748
|
Fragment: q,
|
|
749
749
|
PureComponent: yt,
|
|
@@ -757,7 +757,7 @@ const rr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
757
757
|
createFactory: Jr,
|
|
758
758
|
createPortal: kt,
|
|
759
759
|
createRef: mn,
|
|
760
|
-
default:
|
|
760
|
+
default: L,
|
|
761
761
|
findDOMNode: no,
|
|
762
762
|
flushSync: oo,
|
|
763
763
|
forwardRef: En,
|
|
@@ -765,9 +765,9 @@ const rr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
765
765
|
isElement: so,
|
|
766
766
|
isFragment: Qr,
|
|
767
767
|
isMemo: eo,
|
|
768
|
-
isValidElement:
|
|
768
|
+
isValidElement: je,
|
|
769
769
|
lazy: Yr,
|
|
770
|
-
memo:
|
|
770
|
+
memo: zr,
|
|
771
771
|
render: Kr,
|
|
772
772
|
startTransition: kn,
|
|
773
773
|
unmountComponentAtNode: to,
|
|
@@ -780,16 +780,16 @@ const rr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
780
780
|
useErrorBoundary: ni,
|
|
781
781
|
useId: ke,
|
|
782
782
|
useImperativeHandle: gn,
|
|
783
|
-
useInsertionEffect:
|
|
783
|
+
useInsertionEffect: Fn,
|
|
784
784
|
useLayoutEffect: De,
|
|
785
|
-
useMemo:
|
|
785
|
+
useMemo: z,
|
|
786
786
|
useReducer: it,
|
|
787
787
|
useRef: w,
|
|
788
|
-
useState:
|
|
788
|
+
useState: x,
|
|
789
789
|
useSyncExternalStore: St,
|
|
790
|
-
useTransition:
|
|
790
|
+
useTransition: Cn,
|
|
791
791
|
version: yi
|
|
792
|
-
}, Symbol.toStringTag, { value: "Module" })), ao = typeof document < "u" ?
|
|
792
|
+
}, Symbol.toStringTag, { value: "Module" })), ao = typeof document < "u" ? L.useLayoutEffect : () => {
|
|
793
793
|
};
|
|
794
794
|
function gi(e) {
|
|
795
795
|
const t = w(null);
|
|
@@ -910,38 +910,38 @@ function Si(e) {
|
|
|
910
910
|
}
|
|
911
911
|
};
|
|
912
912
|
}
|
|
913
|
-
let at = null, rn = /* @__PURE__ */ new Set(), et = /* @__PURE__ */ new Map(),
|
|
914
|
-
const
|
|
913
|
+
let at = null, rn = /* @__PURE__ */ new Set(), et = /* @__PURE__ */ new Map(), Re = !1, on = !1;
|
|
914
|
+
const Ci = {
|
|
915
915
|
Tab: !0,
|
|
916
916
|
Escape: !0
|
|
917
917
|
};
|
|
918
918
|
function xn(e, t) {
|
|
919
919
|
for (let n of rn) n(e, t);
|
|
920
920
|
}
|
|
921
|
-
function
|
|
921
|
+
function Fi(e) {
|
|
922
922
|
return !(e.metaKey || !Ei() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
|
|
923
923
|
}
|
|
924
924
|
function gt(e) {
|
|
925
|
-
|
|
925
|
+
Re = !0, Fi(e) && (at = "keyboard", xn("keyboard", e));
|
|
926
926
|
}
|
|
927
927
|
function le(e) {
|
|
928
|
-
at = "pointer", (e.type === "mousedown" || e.type === "pointerdown") && (
|
|
928
|
+
at = "pointer", (e.type === "mousedown" || e.type === "pointerdown") && (Re = !0, xn("pointer", e));
|
|
929
929
|
}
|
|
930
930
|
function co(e) {
|
|
931
|
-
Ti(e) && (
|
|
931
|
+
Ti(e) && (Re = !0, at = "virtual");
|
|
932
932
|
}
|
|
933
933
|
function uo(e) {
|
|
934
|
-
e.target === window || e.target === document || (!
|
|
934
|
+
e.target === window || e.target === document || (!Re && !on && (at = "virtual", xn("virtual", e)), Re = !1, on = !1);
|
|
935
935
|
}
|
|
936
936
|
function fo() {
|
|
937
|
-
|
|
937
|
+
Re = !1, on = !0;
|
|
938
938
|
}
|
|
939
939
|
function sn(e) {
|
|
940
940
|
if (typeof window > "u" || et.get(Pe(e))) return;
|
|
941
941
|
const t = Pe(e), n = st(e);
|
|
942
942
|
let r = t.HTMLElement.prototype.focus;
|
|
943
943
|
t.HTMLElement.prototype.focus = function() {
|
|
944
|
-
|
|
944
|
+
Re = !0, r.apply(this, arguments);
|
|
945
945
|
}, n.addEventListener("keydown", gt, !0), n.addEventListener("keyup", gt, !0), n.addEventListener("click", co, !0), t.addEventListener("focus", uo, !0), t.addEventListener("blur", fo, !1), typeof PointerEvent < "u" ? (n.addEventListener("pointerdown", le, !0), n.addEventListener("pointermove", le, !0), n.addEventListener("pointerup", le, !0)) : (n.addEventListener("mousedown", le, !0), n.addEventListener("mousemove", le, !0), n.addEventListener("mouseup", le, !0)), t.addEventListener("beforeunload", () => {
|
|
946
946
|
po(e);
|
|
947
947
|
}, {
|
|
@@ -979,7 +979,7 @@ const Mi = /* @__PURE__ */ new Set([
|
|
|
979
979
|
function Pi(e, t, n) {
|
|
980
980
|
var r;
|
|
981
981
|
const o = typeof window < "u" ? Pe(n == null ? void 0 : n.target).HTMLInputElement : HTMLInputElement, i = typeof window < "u" ? Pe(n == null ? void 0 : n.target).HTMLTextAreaElement : HTMLTextAreaElement, s = typeof window < "u" ? Pe(n == null ? void 0 : n.target).HTMLElement : HTMLElement, a = typeof window < "u" ? Pe(n == null ? void 0 : n.target).KeyboardEvent : KeyboardEvent;
|
|
982
|
-
return e = e || (n == null ? void 0 : n.target) instanceof o && !Mi.has(n == null || (r = n.target) === null || r === void 0 ? void 0 : r.type) || (n == null ? void 0 : n.target) instanceof i || (n == null ? void 0 : n.target) instanceof s && (n == null ? void 0 : n.target.isContentEditable), !(e && t === "keyboard" && n instanceof a && !
|
|
982
|
+
return e = e || (n == null ? void 0 : n.target) instanceof o && !Mi.has(n == null || (r = n.target) === null || r === void 0 ? void 0 : r.type) || (n == null ? void 0 : n.target) instanceof i || (n == null ? void 0 : n.target) instanceof s && (n == null ? void 0 : n.target.isContentEditable), !(e && t === "keyboard" && n instanceof a && !Ci[n.key]);
|
|
983
983
|
}
|
|
984
984
|
function Ni(e, t, n) {
|
|
985
985
|
sn(), H(() => {
|
|
@@ -1020,7 +1020,7 @@ function Li(e) {
|
|
|
1020
1020
|
}
|
|
1021
1021
|
};
|
|
1022
1022
|
}
|
|
1023
|
-
let wt = !1,
|
|
1023
|
+
let wt = !1, Ut = 0;
|
|
1024
1024
|
function an() {
|
|
1025
1025
|
wt = !0, setTimeout(() => {
|
|
1026
1026
|
wt = !1;
|
|
@@ -1031,19 +1031,19 @@ function or(e) {
|
|
|
1031
1031
|
}
|
|
1032
1032
|
function Ai() {
|
|
1033
1033
|
if (!(typeof document > "u"))
|
|
1034
|
-
return typeof PointerEvent < "u" ? document.addEventListener("pointerup", or) : document.addEventListener("touchend", an),
|
|
1035
|
-
|
|
1034
|
+
return typeof PointerEvent < "u" ? document.addEventListener("pointerup", or) : document.addEventListener("touchend", an), Ut++, () => {
|
|
1035
|
+
Ut--, !(Ut > 0) && (typeof PointerEvent < "u" ? document.removeEventListener("pointerup", or) : document.removeEventListener("touchend", an));
|
|
1036
1036
|
};
|
|
1037
1037
|
}
|
|
1038
|
-
function
|
|
1039
|
-
let { onHoverStart: t, onHoverChange: n, onHoverEnd: r, isDisabled: o } = e, [i, s] =
|
|
1038
|
+
function Ri(e) {
|
|
1039
|
+
let { onHoverStart: t, onHoverChange: n, onHoverEnd: r, isDisabled: o } = e, [i, s] = x(!1), a = w({
|
|
1040
1040
|
isHovered: !1,
|
|
1041
1041
|
ignoreEmulatedMouseEvents: !1,
|
|
1042
1042
|
pointerType: "",
|
|
1043
1043
|
target: null
|
|
1044
1044
|
}).current;
|
|
1045
1045
|
H(Ai, []);
|
|
1046
|
-
let { hoverProps: l, triggerHoverEnd: u } =
|
|
1046
|
+
let { hoverProps: l, triggerHoverEnd: u } = z(() => {
|
|
1047
1047
|
let d = (p, _) => {
|
|
1048
1048
|
if (a.pointerType = _, o || _ === "touch" || a.isHovered || !p.currentTarget.contains(p.target)) return;
|
|
1049
1049
|
a.isHovered = !0;
|
|
@@ -1095,11 +1095,11 @@ function Ii(e) {
|
|
|
1095
1095
|
isHovered: i
|
|
1096
1096
|
};
|
|
1097
1097
|
}
|
|
1098
|
-
function
|
|
1098
|
+
function Ii(e = {}) {
|
|
1099
1099
|
let { autoFocus: t = !1, isTextInput: n, within: r } = e, o = w({
|
|
1100
1100
|
isFocused: !1,
|
|
1101
1101
|
isFocusVisible: t || ho()
|
|
1102
|
-
}), [i, s] =
|
|
1102
|
+
}), [i, s] = x(!1), [a, l] = x(() => o.current.isFocused && o.current.isFocusVisible), u = U(() => l(o.current.isFocused && o.current.isFocusVisible), []), d = U((p) => {
|
|
1103
1103
|
o.current.isFocused = p, s(p), u();
|
|
1104
1104
|
}, [
|
|
1105
1105
|
u
|
|
@@ -1122,10 +1122,10 @@ function Ri(e = {}) {
|
|
|
1122
1122
|
focusProps: r ? f : c
|
|
1123
1123
|
};
|
|
1124
1124
|
}
|
|
1125
|
-
var Di = Object.defineProperty, Oi = (e, t, n) => t in e ? Di(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n,
|
|
1125
|
+
var Di = Object.defineProperty, Oi = (e, t, n) => t in e ? Di(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, zt = (e, t, n) => (Oi(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
1126
1126
|
let Hi = class {
|
|
1127
1127
|
constructor() {
|
|
1128
|
-
|
|
1128
|
+
zt(this, "current", this.detect()), zt(this, "handoffState", "pending"), zt(this, "currentId", 0);
|
|
1129
1129
|
}
|
|
1130
1130
|
set(t) {
|
|
1131
1131
|
this.current !== t && (this.handoffState = "pending", this.currentId = 0, this.current = t);
|
|
@@ -1152,10 +1152,10 @@ let Hi = class {
|
|
|
1152
1152
|
return this.handoffState === "complete";
|
|
1153
1153
|
}
|
|
1154
1154
|
}, Le = new Hi();
|
|
1155
|
-
function
|
|
1155
|
+
function Ct(e) {
|
|
1156
1156
|
return Le.isServer ? null : e instanceof Node ? e.ownerDocument : e != null && e.hasOwnProperty("current") && e.current instanceof Node ? e.current.ownerDocument : document;
|
|
1157
1157
|
}
|
|
1158
|
-
function
|
|
1158
|
+
function Ft(e) {
|
|
1159
1159
|
typeof queueMicrotask == "function" ? queueMicrotask(e) : Promise.resolve().then(e).catch((t) => setTimeout(() => {
|
|
1160
1160
|
throw t;
|
|
1161
1161
|
}));
|
|
@@ -1173,7 +1173,7 @@ function Se() {
|
|
|
1173
1173
|
return t.add(() => clearTimeout(r));
|
|
1174
1174
|
}, microTask(...n) {
|
|
1175
1175
|
let r = { current: !0 };
|
|
1176
|
-
return
|
|
1176
|
+
return Ft(() => {
|
|
1177
1177
|
r.current && n[0]();
|
|
1178
1178
|
}), t.add(() => {
|
|
1179
1179
|
r.current = !1;
|
|
@@ -1197,7 +1197,7 @@ function Se() {
|
|
|
1197
1197
|
return t;
|
|
1198
1198
|
}
|
|
1199
1199
|
function xt() {
|
|
1200
|
-
let [e] =
|
|
1200
|
+
let [e] = x(Se);
|
|
1201
1201
|
return H(() => () => e.dispose(), [e]), e;
|
|
1202
1202
|
}
|
|
1203
1203
|
let re = (e, t) => {
|
|
@@ -1209,29 +1209,29 @@ function Oe(e) {
|
|
|
1209
1209
|
t.current = e;
|
|
1210
1210
|
}, [e]), t;
|
|
1211
1211
|
}
|
|
1212
|
-
let
|
|
1212
|
+
let G = function(e) {
|
|
1213
1213
|
let t = Oe(e);
|
|
1214
|
-
return
|
|
1214
|
+
return L.useCallback((...n) => t.current(...n), [t]);
|
|
1215
1215
|
};
|
|
1216
1216
|
function Wi(e) {
|
|
1217
1217
|
let t = e.width / 2, n = e.height / 2;
|
|
1218
1218
|
return { top: e.clientY - n, right: e.clientX + t, bottom: e.clientY + n, left: e.clientX - t };
|
|
1219
1219
|
}
|
|
1220
|
-
function
|
|
1220
|
+
function Ui(e, t) {
|
|
1221
1221
|
return !(!e || !t || e.right < t.left || e.left > t.right || e.bottom < t.top || e.top > t.bottom);
|
|
1222
1222
|
}
|
|
1223
|
-
function
|
|
1224
|
-
let t = w(null), [n, r] =
|
|
1223
|
+
function zi({ disabled: e = !1 } = {}) {
|
|
1224
|
+
let t = w(null), [n, r] = x(!1), o = xt(), i = G(() => {
|
|
1225
1225
|
t.current = null, r(!1), o.dispose();
|
|
1226
|
-
}), s =
|
|
1226
|
+
}), s = G((a) => {
|
|
1227
1227
|
if (o.dispose(), t.current === null) {
|
|
1228
1228
|
t.current = a.currentTarget, r(!0);
|
|
1229
1229
|
{
|
|
1230
|
-
let l =
|
|
1230
|
+
let l = Ct(a.currentTarget);
|
|
1231
1231
|
o.addEventListener(l, "pointerup", i, !1), o.addEventListener(l, "pointermove", (u) => {
|
|
1232
1232
|
if (t.current) {
|
|
1233
1233
|
let d = Wi(u);
|
|
1234
|
-
r(
|
|
1234
|
+
r(Ui(d, t.current.getBoundingClientRect()));
|
|
1235
1235
|
}
|
|
1236
1236
|
}, !1), o.addEventListener(l, "pointercancel", i, !1);
|
|
1237
1237
|
}
|
|
@@ -1239,9 +1239,9 @@ function Ui({ disabled: e = !1 } = {}) {
|
|
|
1239
1239
|
});
|
|
1240
1240
|
return { pressed: n, pressProps: e ? {} : { onPointerDown: s, onPointerUp: i, onClick: i } };
|
|
1241
1241
|
}
|
|
1242
|
-
let
|
|
1242
|
+
let Vi = ie(void 0);
|
|
1243
1243
|
function vo() {
|
|
1244
|
-
return te(
|
|
1244
|
+
return te(Vi);
|
|
1245
1245
|
}
|
|
1246
1246
|
function ln(...e) {
|
|
1247
1247
|
return Array.from(new Set(e.flatMap((t) => typeof t == "string" ? t.split(" ") : []))).filter(Boolean).join(" ");
|
|
@@ -1256,7 +1256,7 @@ function Te(e, t, ...n) {
|
|
|
1256
1256
|
}
|
|
1257
1257
|
var bt = ((e) => (e[e.None = 0] = "None", e[e.RenderStrategy = 1] = "RenderStrategy", e[e.Static = 2] = "Static", e))(bt || {}), Ee = ((e) => (e[e.Unmount = 0] = "Unmount", e[e.Hidden = 1] = "Hidden", e))(Ee || {});
|
|
1258
1258
|
function ae({ ourProps: e, theirProps: t, slot: n, defaultTag: r, features: o, visible: i = !0, name: s, mergeRefs: a }) {
|
|
1259
|
-
a = a ??
|
|
1259
|
+
a = a ?? ji;
|
|
1260
1260
|
let l = mo(t, e);
|
|
1261
1261
|
if (i) return pt(l, n, r, s, a);
|
|
1262
1262
|
let u = o ?? 0;
|
|
@@ -1275,7 +1275,7 @@ function ae({ ourProps: e, theirProps: t, slot: n, defaultTag: r, features: o, v
|
|
|
1275
1275
|
return pt(l, n, r, s, a);
|
|
1276
1276
|
}
|
|
1277
1277
|
function pt(e, t = {}, n, r, o) {
|
|
1278
|
-
let { as: i = n, children: s, refName: a = "ref", ...l } =
|
|
1278
|
+
let { as: i = n, children: s, refName: a = "ref", ...l } = Vt(e, ["unmount", "static"]), u = e.ref !== void 0 ? { [a]: e.ref } : {}, d = typeof s == "function" ? s(t) : s;
|
|
1279
1279
|
"className" in l && l.className && typeof l.className == "function" && (l.className = l.className(t)), l["aria-labelledby"] && l["aria-labelledby"] === l.id && (l["aria-labelledby"] = void 0);
|
|
1280
1280
|
let c = {};
|
|
1281
1281
|
if (t) {
|
|
@@ -1286,19 +1286,19 @@ function pt(e, t = {}, n, r, o) {
|
|
|
1286
1286
|
for (let _ of p) c[`data-${_}`] = "";
|
|
1287
1287
|
}
|
|
1288
1288
|
}
|
|
1289
|
-
if (i === q && (Object.keys(
|
|
1290
|
-
if (Object.keys(
|
|
1289
|
+
if (i === q && (Object.keys(Fe(l)).length > 0 || Object.keys(Fe(c)).length > 0)) if (!je(d) || Array.isArray(d) && d.length > 1) {
|
|
1290
|
+
if (Object.keys(Fe(l)).length > 0) throw new Error(['Passing props on "Fragment"!', "", `The current component <${r} /> is rendering a "Fragment".`, "However we need to passthrough the following props:", Object.keys(Fe(l)).concat(Object.keys(Fe(c))).map((f) => ` - ${f}`).join(`
|
|
1291
1291
|
`), "", "You can apply a few solutions:", ['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".', "Render a single element as the child so that we can forward the props onto that element."].map((f) => ` - ${f}`).join(`
|
|
1292
1292
|
`)].join(`
|
|
1293
1293
|
`));
|
|
1294
1294
|
} else {
|
|
1295
|
-
let f = d.props, p = f == null ? void 0 : f.className, _ = typeof p == "function" ? (...v) => ln(p(...v), l.className) : ln(p, l.className), y = _ ? { className: _ } : {}, m = mo(d.props,
|
|
1295
|
+
let f = d.props, p = f == null ? void 0 : f.className, _ = typeof p == "function" ? (...v) => ln(p(...v), l.className) : ln(p, l.className), y = _ ? { className: _ } : {}, m = mo(d.props, Fe(Vt(l, ["ref"])));
|
|
1296
1296
|
for (let v in c) v in m && delete c[v];
|
|
1297
1297
|
return Tn(d, Object.assign({}, m, c, u, { ref: o(d.ref, u.ref) }, y));
|
|
1298
1298
|
}
|
|
1299
|
-
return de(i, Object.assign({},
|
|
1299
|
+
return de(i, Object.assign({}, Vt(l, ["ref"]), i !== q && u, i !== q && c), d);
|
|
1300
1300
|
}
|
|
1301
|
-
function
|
|
1301
|
+
function ji(...e) {
|
|
1302
1302
|
return e.every((t) => t == null) ? void 0 : (t) => {
|
|
1303
1303
|
for (let n of e) n != null && (typeof n == "function" ? n(t) : n.current = t);
|
|
1304
1304
|
};
|
|
@@ -1336,12 +1336,12 @@ function oe(e) {
|
|
|
1336
1336
|
var t;
|
|
1337
1337
|
return Object.assign(En(e), { displayName: (t = e.displayName) != null ? t : e.name });
|
|
1338
1338
|
}
|
|
1339
|
-
function
|
|
1339
|
+
function Fe(e) {
|
|
1340
1340
|
let t = Object.assign({}, e);
|
|
1341
1341
|
for (let n in t) t[n] === void 0 && delete t[n];
|
|
1342
1342
|
return t;
|
|
1343
1343
|
}
|
|
1344
|
-
function
|
|
1344
|
+
function Vt(e, t = []) {
|
|
1345
1345
|
let n = Object.assign({}, e);
|
|
1346
1346
|
for (let r of t) r in n && delete n[r];
|
|
1347
1347
|
return n;
|
|
@@ -1349,7 +1349,7 @@ function jt(e, t = []) {
|
|
|
1349
1349
|
let qi = "button";
|
|
1350
1350
|
function Yi(e, t) {
|
|
1351
1351
|
var n;
|
|
1352
|
-
let r = vo(), { disabled: o = r || !1, autoFocus: i = !1, ...s } = e, { isFocusVisible: a, focusProps: l } =
|
|
1352
|
+
let r = vo(), { disabled: o = r || !1, autoFocus: i = !1, ...s } = e, { isFocusVisible: a, focusProps: l } = Ii({ autoFocus: i }), { isHovered: u, hoverProps: d } = Ri({ isDisabled: o }), { pressed: c, pressProps: f } = zi({ disabled: o }), p = Bi({ ref: t, type: (n = s.type) != null ? n : "button", disabled: o || void 0, autoFocus: i }, l, d, f), _ = z(() => ({ disabled: o, hover: u, focus: a, active: c, autofocus: i }), [o, u, a, c, i]);
|
|
1353
1353
|
return ae({ ourProps: p, theirProps: s, slot: _, defaultTag: qi, name: "Button" });
|
|
1354
1354
|
}
|
|
1355
1355
|
let Gi = oe(Yi), Ki = "div";
|
|
@@ -1362,9 +1362,9 @@ function Xi(e, t) {
|
|
|
1362
1362
|
let cn = oe(Xi), Zi = ie(null);
|
|
1363
1363
|
function Ji({ children: e }) {
|
|
1364
1364
|
let t = te(Zi);
|
|
1365
|
-
if (!t) return
|
|
1365
|
+
if (!t) return L.createElement(L.Fragment, null, e);
|
|
1366
1366
|
let { target: n } = t;
|
|
1367
|
-
return n ? kt(
|
|
1367
|
+
return n ? kt(L.createElement(L.Fragment, null, e), n) : null;
|
|
1368
1368
|
}
|
|
1369
1369
|
let _o = Symbol();
|
|
1370
1370
|
function Qi(e, t = !0) {
|
|
@@ -1375,7 +1375,7 @@ function he(...e) {
|
|
|
1375
1375
|
H(() => {
|
|
1376
1376
|
t.current = e;
|
|
1377
1377
|
}, [e]);
|
|
1378
|
-
let n =
|
|
1378
|
+
let n = G((r) => {
|
|
1379
1379
|
for (let o of t.current) o != null && (typeof o == "function" ? o(r) : o.current = r);
|
|
1380
1380
|
});
|
|
1381
1381
|
return e.every((r) => r == null || (r == null ? void 0 : r[_o])) ? void 0 : n;
|
|
@@ -1391,20 +1391,20 @@ function yo() {
|
|
|
1391
1391
|
return e;
|
|
1392
1392
|
}
|
|
1393
1393
|
function es() {
|
|
1394
|
-
let [e, t] =
|
|
1395
|
-
return [e.length > 0 ? e.join(" ") : void 0,
|
|
1396
|
-
let r =
|
|
1394
|
+
let [e, t] = x([]);
|
|
1395
|
+
return [e.length > 0 ? e.join(" ") : void 0, z(() => function(n) {
|
|
1396
|
+
let r = G((i) => (t((s) => [...s, i]), () => t((s) => {
|
|
1397
1397
|
let a = s.slice(), l = a.indexOf(i);
|
|
1398
1398
|
return l !== -1 && a.splice(l, 1), a;
|
|
1399
|
-
}))), o =
|
|
1400
|
-
return
|
|
1399
|
+
}))), o = z(() => ({ register: r, slot: n.slot, name: n.name, props: n.props, value: n.value }), [r, n.slot, n.name, n.props, n.value]);
|
|
1400
|
+
return L.createElement(Mn.Provider, { value: o }, n.children);
|
|
1401
1401
|
}, [t])];
|
|
1402
1402
|
}
|
|
1403
1403
|
let ts = "p";
|
|
1404
1404
|
function ns(e, t) {
|
|
1405
1405
|
let n = ke(), r = vo(), { id: o = `headlessui-description-${n}`, ...i } = e, s = yo(), a = he(t);
|
|
1406
1406
|
re(() => s.register(o), [o, s.register]);
|
|
1407
|
-
let l = r || !1, u =
|
|
1407
|
+
let l = r || !1, u = z(() => ({ ...s.slot, disabled: l }), [s.slot, l]), d = { ref: a, ...s.props, id: o };
|
|
1408
1408
|
return ae({ ourProps: d, theirProps: i, slot: u, defaultTag: ts, name: s.name || "Description" });
|
|
1409
1409
|
}
|
|
1410
1410
|
let rs = oe(ns), os = Object.assign(rs, {});
|
|
@@ -1412,7 +1412,7 @@ var go = ((e) => (e.Space = " ", e.Enter = "Enter", e.Escape = "Escape", e.Backs
|
|
|
1412
1412
|
let is = ie(() => {
|
|
1413
1413
|
});
|
|
1414
1414
|
function ss({ value: e, children: t }) {
|
|
1415
|
-
return
|
|
1415
|
+
return L.createElement(is.Provider, { value: e }, t);
|
|
1416
1416
|
}
|
|
1417
1417
|
let as = class extends Map {
|
|
1418
1418
|
constructor(t) {
|
|
@@ -1476,7 +1476,7 @@ function cs(e, { allowed: t, disallowed: n } = {}) {
|
|
|
1476
1476
|
let a = (i = t == null ? void 0 : t()) != null ? i : [];
|
|
1477
1477
|
for (let l of a) {
|
|
1478
1478
|
if (!l) continue;
|
|
1479
|
-
let u =
|
|
1479
|
+
let u = Ct(l);
|
|
1480
1480
|
if (!u) continue;
|
|
1481
1481
|
let d = l.parentElement;
|
|
1482
1482
|
for (; d && d !== u.body; ) {
|
|
@@ -1519,7 +1519,7 @@ function ps(e = document.body) {
|
|
|
1519
1519
|
var $o = ((e) => (e[e.Strict = 0] = "Strict", e[e.Loose = 1] = "Loose", e))($o || {});
|
|
1520
1520
|
function hs(e, t = 0) {
|
|
1521
1521
|
var n;
|
|
1522
|
-
return e === ((n =
|
|
1522
|
+
return e === ((n = Ct(e)) == null ? void 0 : n.body) ? !1 : Te(t, { 0() {
|
|
1523
1523
|
return e.matches(dn);
|
|
1524
1524
|
}, 1() {
|
|
1525
1525
|
let r = e;
|
|
@@ -1641,7 +1641,7 @@ function bs(e, t, n) {
|
|
|
1641
1641
|
}, !0), ko(r, "blur", (l) => i(l, () => window.document.activeElement instanceof HTMLIFrameElement ? window.document.activeElement : null), !0);
|
|
1642
1642
|
}
|
|
1643
1643
|
function lt(...e) {
|
|
1644
|
-
return
|
|
1644
|
+
return z(() => Ct(...e), [...e]);
|
|
1645
1645
|
}
|
|
1646
1646
|
function So(e, t, n, r) {
|
|
1647
1647
|
let o = Oe(n);
|
|
@@ -1746,21 +1746,21 @@ function Ss(e, t, n = () => ({ containers: [] })) {
|
|
|
1746
1746
|
if (!(!t || !e)) return Ne.dispatch("PUSH", t, n), () => Ne.dispatch("POP", t, n);
|
|
1747
1747
|
}, [e, t]), i;
|
|
1748
1748
|
}
|
|
1749
|
-
function
|
|
1749
|
+
function Cs(e, t, n = () => [document.body]) {
|
|
1750
1750
|
let r = Be(e, "scroll-lock");
|
|
1751
1751
|
Ss(r, t, (o) => {
|
|
1752
1752
|
var i;
|
|
1753
1753
|
return { containers: [...(i = o.containers) != null ? i : [], n] };
|
|
1754
1754
|
});
|
|
1755
1755
|
}
|
|
1756
|
-
function
|
|
1756
|
+
function Fs(e) {
|
|
1757
1757
|
let t = { called: !1 };
|
|
1758
1758
|
return (...n) => {
|
|
1759
1759
|
if (!t.called) return t.called = !0, e(...n);
|
|
1760
1760
|
};
|
|
1761
1761
|
}
|
|
1762
1762
|
function xs(e = 0) {
|
|
1763
|
-
let [t, n] =
|
|
1763
|
+
let [t, n] = x(e), r = U((l) => n(l), [t]), o = U((l) => n((u) => u | l), [t]), i = U((l) => (t & l) === l, [t]), s = U((l) => n((u) => u & ~l), [n]), a = U((l) => n((u) => u ^ l), [n]);
|
|
1764
1764
|
return { flags: t, setFlag: r, addFlag: o, hasFlag: i, removeFlag: s, toggleFlag: a };
|
|
1765
1765
|
}
|
|
1766
1766
|
var Ms = ((e) => (e[e.None = 0] = "None", e[e.Closed = 1] = "Closed", e[e.Enter = 2] = "Enter", e[e.Leave = 4] = "Leave", e))(Ms || {});
|
|
@@ -1770,7 +1770,7 @@ function Ps(e) {
|
|
|
1770
1770
|
return t;
|
|
1771
1771
|
}
|
|
1772
1772
|
function Ns(e, t, n, r) {
|
|
1773
|
-
let [o, i] =
|
|
1773
|
+
let [o, i] = x(n), { hasFlag: s, addFlag: a, removeFlag: l } = xs(e && o ? 3 : 0), u = w(!1), d = w(!1), c = xt();
|
|
1774
1774
|
return re(function f() {
|
|
1775
1775
|
var p;
|
|
1776
1776
|
if (!e) return;
|
|
@@ -1788,12 +1788,12 @@ function Ns(e, t, n, r) {
|
|
|
1788
1788
|
}
|
|
1789
1789
|
function Ls(e, { prepare: t, run: n, done: r, inFlight: o }) {
|
|
1790
1790
|
let i = Se();
|
|
1791
|
-
return
|
|
1791
|
+
return Rs(e, { prepare: t, inFlight: o }), i.nextFrame(() => {
|
|
1792
1792
|
i.add(As(e, r)), n();
|
|
1793
1793
|
}), i.dispose;
|
|
1794
1794
|
}
|
|
1795
1795
|
function As(e, t) {
|
|
1796
|
-
let n =
|
|
1796
|
+
let n = Fs(t), r = Se();
|
|
1797
1797
|
if (!e) return r.dispose;
|
|
1798
1798
|
let { transitionDuration: o, transitionDelay: i } = getComputedStyle(e), [s, a] = [o, i].map((u) => {
|
|
1799
1799
|
let [d = 0] = u.split(",").filter(Boolean).map((c) => c.includes("ms") ? parseFloat(c) : parseFloat(c) * 1e3).sort((c, f) => f - c);
|
|
@@ -1816,7 +1816,7 @@ function As(e, t) {
|
|
|
1816
1816
|
} else n();
|
|
1817
1817
|
return r.dispose;
|
|
1818
1818
|
}
|
|
1819
|
-
function
|
|
1819
|
+
function Rs(e, { inFlight: t, prepare: n }) {
|
|
1820
1820
|
if (t != null && t.current) {
|
|
1821
1821
|
n();
|
|
1822
1822
|
return;
|
|
@@ -1825,7 +1825,7 @@ function Is(e, { inFlight: t, prepare: n }) {
|
|
|
1825
1825
|
e.style.transition = "none", n(), e.offsetHeight, e.style.transition = r;
|
|
1826
1826
|
}
|
|
1827
1827
|
function Pn(e, t) {
|
|
1828
|
-
let n = w([]), r =
|
|
1828
|
+
let n = w([]), r = G(e);
|
|
1829
1829
|
H(() => {
|
|
1830
1830
|
let o = [...n.current];
|
|
1831
1831
|
for (let [i, s] of t.entries()) if (n.current[i] !== s) {
|
|
@@ -1840,11 +1840,11 @@ var ce = ((e) => (e[e.Open = 1] = "Open", e[e.Closed = 2] = "Closed", e[e.Closin
|
|
|
1840
1840
|
function Pt() {
|
|
1841
1841
|
return te(Mt);
|
|
1842
1842
|
}
|
|
1843
|
-
function
|
|
1844
|
-
return
|
|
1843
|
+
function Is({ value: e, children: t }) {
|
|
1844
|
+
return L.createElement(Mt.Provider, { value: e }, t);
|
|
1845
1845
|
}
|
|
1846
1846
|
function Ds({ children: e }) {
|
|
1847
|
-
return
|
|
1847
|
+
return L.createElement(Mt.Provider, { value: null }, e);
|
|
1848
1848
|
}
|
|
1849
1849
|
function Os(e) {
|
|
1850
1850
|
function t() {
|
|
@@ -1859,10 +1859,10 @@ Os(() => {
|
|
|
1859
1859
|
}
|
|
1860
1860
|
window.addEventListener("click", e, { capture: !0 }), window.addEventListener("mousedown", e, { capture: !0 }), window.addEventListener("focus", e, { capture: !0 }), document.body.addEventListener("click", e, { capture: !0 }), document.body.addEventListener("mousedown", e, { capture: !0 }), document.body.addEventListener("focus", e, { capture: !0 });
|
|
1861
1861
|
});
|
|
1862
|
-
function
|
|
1863
|
-
let t =
|
|
1862
|
+
function Co(e) {
|
|
1863
|
+
let t = G(e), n = w(!1);
|
|
1864
1864
|
H(() => (n.current = !1, () => {
|
|
1865
|
-
n.current = !0,
|
|
1865
|
+
n.current = !0, Ft(() => {
|
|
1866
1866
|
n.current && t();
|
|
1867
1867
|
});
|
|
1868
1868
|
}), [t]);
|
|
@@ -1873,20 +1873,20 @@ function Hs() {
|
|
|
1873
1873
|
}, () => !1, () => !e) : !1;
|
|
1874
1874
|
}
|
|
1875
1875
|
function ct() {
|
|
1876
|
-
let e = Hs(), [t, n] =
|
|
1876
|
+
let e = Hs(), [t, n] = x(Le.isHandoffComplete);
|
|
1877
1877
|
return t && Le.isHandoffComplete === !1 && n(!1), H(() => {
|
|
1878
1878
|
t !== !0 && n(!0);
|
|
1879
1879
|
}, [t]), H(() => Le.handoff(), []), e ? !1 : t;
|
|
1880
1880
|
}
|
|
1881
|
-
let
|
|
1881
|
+
let Fo = ie(!1);
|
|
1882
1882
|
function Ws() {
|
|
1883
|
-
return te(
|
|
1883
|
+
return te(Fo);
|
|
1884
1884
|
}
|
|
1885
1885
|
function lr(e) {
|
|
1886
|
-
return
|
|
1886
|
+
return L.createElement(Fo.Provider, { value: e.force }, e.children);
|
|
1887
1887
|
}
|
|
1888
|
-
function
|
|
1889
|
-
let t = Ws(), n = te(Mo), r = lt(e), [o, i] =
|
|
1888
|
+
function Us(e) {
|
|
1889
|
+
let t = Ws(), n = te(Mo), r = lt(e), [o, i] = x(() => {
|
|
1890
1890
|
var s;
|
|
1891
1891
|
if (!t && n !== null) return (s = n.current) != null ? s : null;
|
|
1892
1892
|
if (Le.isServer) return null;
|
|
@@ -1902,10 +1902,10 @@ function zs(e) {
|
|
|
1902
1902
|
t || n !== null && i(n.current);
|
|
1903
1903
|
}, [n, i, t]), o;
|
|
1904
1904
|
}
|
|
1905
|
-
let xo = q,
|
|
1905
|
+
let xo = q, zs = oe(function(e, t) {
|
|
1906
1906
|
let n = e, r = w(null), o = he(Qi((d) => {
|
|
1907
1907
|
r.current = d;
|
|
1908
|
-
}), t), i = lt(r), s =
|
|
1908
|
+
}), t), i = lt(r), s = Us(r), [a] = x(() => {
|
|
1909
1909
|
var d;
|
|
1910
1910
|
return Le.isServer ? null : (d = i == null ? void 0 : i.createElement("div")) != null ? d : null;
|
|
1911
1911
|
}), l = te(pn), u = ct();
|
|
@@ -1913,31 +1913,31 @@ let xo = q, Us = oe(function(e, t) {
|
|
|
1913
1913
|
!s || !a || s.contains(a) || (a.setAttribute("data-headlessui-portal", ""), s.appendChild(a));
|
|
1914
1914
|
}, [s, a]), re(() => {
|
|
1915
1915
|
if (a && l) return l.register(a);
|
|
1916
|
-
}, [l, a]),
|
|
1916
|
+
}, [l, a]), Co(() => {
|
|
1917
1917
|
var d;
|
|
1918
1918
|
!s || !a || (a instanceof Node && s.contains(a) && s.removeChild(a), s.childNodes.length <= 0 && ((d = s.parentElement) == null || d.removeChild(s)));
|
|
1919
1919
|
}), u ? !s || !a ? null : kt(ae({ ourProps: { ref: o }, theirProps: n, slot: {}, defaultTag: xo, name: "Portal" }), a) : null;
|
|
1920
1920
|
});
|
|
1921
|
-
function
|
|
1921
|
+
function Vs(e, t) {
|
|
1922
1922
|
let n = he(t), { enabled: r = !0, ...o } = e;
|
|
1923
|
-
return r ?
|
|
1923
|
+
return r ? L.createElement(zs, { ...o, ref: n }) : ae({ ourProps: { ref: n }, theirProps: o, slot: {}, defaultTag: xo, name: "Portal" });
|
|
1924
1924
|
}
|
|
1925
|
-
let
|
|
1925
|
+
let js = q, Mo = ie(null);
|
|
1926
1926
|
function Bs(e, t) {
|
|
1927
1927
|
let { target: n, ...r } = e, o = { ref: he(t) };
|
|
1928
|
-
return
|
|
1928
|
+
return L.createElement(Mo.Provider, { value: n }, ae({ ourProps: o, theirProps: r, defaultTag: js, name: "Popover.Group" }));
|
|
1929
1929
|
}
|
|
1930
1930
|
let pn = ie(null);
|
|
1931
1931
|
function qs() {
|
|
1932
|
-
let e = te(pn), t = w([]), n =
|
|
1932
|
+
let e = te(pn), t = w([]), n = G((i) => (t.current.push(i), e && e.register(i), () => r(i))), r = G((i) => {
|
|
1933
1933
|
let s = t.current.indexOf(i);
|
|
1934
1934
|
s !== -1 && t.current.splice(s, 1), e && e.unregister(i);
|
|
1935
|
-
}), o =
|
|
1936
|
-
return [t,
|
|
1937
|
-
return
|
|
1935
|
+
}), o = z(() => ({ register: n, unregister: r, portals: t }), [n, r, t]);
|
|
1936
|
+
return [t, z(() => function({ children: i }) {
|
|
1937
|
+
return L.createElement(pn.Provider, { value: o }, i);
|
|
1938
1938
|
}, [o])];
|
|
1939
1939
|
}
|
|
1940
|
-
let Ys = oe(
|
|
1940
|
+
let Ys = oe(Vs), Po = oe(Bs), Gs = Object.assign(Ys, { Group: Po });
|
|
1941
1941
|
function Ks(e, t = typeof document < "u" ? document.defaultView : null, n) {
|
|
1942
1942
|
let r = Be(e, "escape");
|
|
1943
1943
|
So(t, "keydown", (o) => {
|
|
@@ -1946,7 +1946,7 @@ function Ks(e, t = typeof document < "u" ? document.defaultView : null, n) {
|
|
|
1946
1946
|
}
|
|
1947
1947
|
function Xs() {
|
|
1948
1948
|
var e;
|
|
1949
|
-
let [t] =
|
|
1949
|
+
let [t] = x(() => typeof window < "u" && typeof window.matchMedia == "function" ? window.matchMedia("(pointer: coarse)") : null), [n, r] = x((e = t == null ? void 0 : t.matches) != null ? e : !1);
|
|
1950
1950
|
return re(() => {
|
|
1951
1951
|
if (!t) return;
|
|
1952
1952
|
function o(i) {
|
|
@@ -1957,7 +1957,7 @@ function Xs() {
|
|
|
1957
1957
|
}
|
|
1958
1958
|
function Zs({ defaultContainers: e = [], portals: t, mainTreeNodeRef: n } = {}) {
|
|
1959
1959
|
var r;
|
|
1960
|
-
let o = w((r = n == null ? void 0 : n.current) != null ? r : null), i = lt(o), s =
|
|
1960
|
+
let o = w((r = n == null ? void 0 : n.current) != null ? r : null), i = lt(o), s = G(() => {
|
|
1961
1961
|
var a, l, u;
|
|
1962
1962
|
let d = [];
|
|
1963
1963
|
for (let c of e) c !== null && (c instanceof HTMLElement ? d.push(c) : "current" in c && c.current instanceof HTMLElement && d.push(c.current));
|
|
@@ -1965,8 +1965,8 @@ function Zs({ defaultContainers: e = [], portals: t, mainTreeNodeRef: n } = {})
|
|
|
1965
1965
|
for (let c of (a = i == null ? void 0 : i.querySelectorAll("html > *, body > *")) != null ? a : []) c !== document.body && c !== document.head && c instanceof HTMLElement && c.id !== "headlessui-portal-root" && (c.contains(o.current) || c.contains((u = (l = o.current) == null ? void 0 : l.getRootNode()) == null ? void 0 : u.host) || d.some((f) => c.contains(f)) || d.push(c));
|
|
1966
1966
|
return d;
|
|
1967
1967
|
});
|
|
1968
|
-
return { resolveContainers: s, contains:
|
|
1969
|
-
return n != null ? null :
|
|
1968
|
+
return { resolveContainers: s, contains: G((a) => s().some((l) => l.contains(a))), mainTreeNodeRef: o, MainTreeNode: z(() => function() {
|
|
1969
|
+
return n != null ? null : L.createElement(cn, { features: Et.Hidden, ref: o });
|
|
1970
1970
|
}, [o, n]) };
|
|
1971
1971
|
}
|
|
1972
1972
|
function Nn() {
|
|
@@ -1998,7 +1998,7 @@ function ea(e, t) {
|
|
|
1998
1998
|
oa(a, { ownerDocument: u });
|
|
1999
1999
|
let d = ia(a, { ownerDocument: u, container: n, initialFocus: o, initialFocusFallback: i });
|
|
2000
2000
|
sa(a, { ownerDocument: u, container: n, containers: s, previousActiveElement: d });
|
|
2001
|
-
let c = Js(), f =
|
|
2001
|
+
let c = Js(), f = G((v) => {
|
|
2002
2002
|
let g = n.current;
|
|
2003
2003
|
g && (($) => $())(() => {
|
|
2004
2004
|
Te(c.current, { [Ze.Forwards]: () => {
|
|
@@ -2018,16 +2018,16 @@ function ea(e, t) {
|
|
|
2018
2018
|
let $ = v.relatedTarget;
|
|
2019
2019
|
$ instanceof HTMLElement && $.dataset.headlessuiFocusGuard !== "true" && (Lo(g, $) || (y.current ? nt(n.current, Te(c.current, { [Ze.Forwards]: () => ve.Next, [Ze.Backwards]: () => ve.Previous }) | ve.WrapAround, { relativeTo: v.target }) : v.target instanceof HTMLElement && ye(v.target)));
|
|
2020
2020
|
} };
|
|
2021
|
-
return
|
|
2021
|
+
return L.createElement(L.Fragment, null, p && L.createElement(cn, { as: "button", type: "button", "data-headlessui-focus-guard": !0, onFocus: f, features: Et.Focusable }), ae({ ourProps: m, theirProps: l, defaultTag: Qs, name: "FocusTrap" }), p && L.createElement(cn, { as: "button", type: "button", "data-headlessui-focus-guard": !0, onFocus: f, features: Et.Focusable }));
|
|
2022
2022
|
}
|
|
2023
2023
|
let ta = oe(ea), na = Object.assign(ta, { features: Me });
|
|
2024
2024
|
function ra(e = !0) {
|
|
2025
2025
|
let t = w(be.slice());
|
|
2026
2026
|
return Pn(([n], [r]) => {
|
|
2027
|
-
r === !0 && n === !1 &&
|
|
2027
|
+
r === !0 && n === !1 && Ft(() => {
|
|
2028
2028
|
t.current.splice(0);
|
|
2029
2029
|
}), r === !1 && n === !0 && (t.current = be.slice());
|
|
2030
|
-
}, [e, be, t]),
|
|
2030
|
+
}, [e, be, t]), G(() => {
|
|
2031
2031
|
var n;
|
|
2032
2032
|
return (n = t.current.find((r) => r != null && r.isConnected)) != null ? n : null;
|
|
2033
2033
|
});
|
|
@@ -2036,7 +2036,7 @@ function oa(e, { ownerDocument: t }) {
|
|
|
2036
2036
|
let n = !!(e & 8), r = ra(n);
|
|
2037
2037
|
Pn(() => {
|
|
2038
2038
|
n || (t == null ? void 0 : t.activeElement) === (t == null ? void 0 : t.body) && ye(r());
|
|
2039
|
-
}, [n]),
|
|
2039
|
+
}, [n]), Co(() => {
|
|
2040
2040
|
n && ye(r());
|
|
2041
2041
|
});
|
|
2042
2042
|
}
|
|
@@ -2049,7 +2049,7 @@ function ia(e, { ownerDocument: t, container: n, initialFocus: r, initialFocusFa
|
|
|
2049
2049
|
return;
|
|
2050
2050
|
}
|
|
2051
2051
|
let l = n.current;
|
|
2052
|
-
l &&
|
|
2052
|
+
l && Ft(() => {
|
|
2053
2053
|
if (!a.current) return;
|
|
2054
2054
|
let u = t == null ? void 0 : t.activeElement;
|
|
2055
2055
|
if (r != null && r.current) {
|
|
@@ -2091,7 +2091,7 @@ function Lo(e, t) {
|
|
|
2091
2091
|
}
|
|
2092
2092
|
function Ao(e) {
|
|
2093
2093
|
var t;
|
|
2094
|
-
return !!(e.enter || e.enterFrom || e.enterTo || e.leave || e.leaveFrom || e.leaveTo) || ((t = e.as) != null ? t :
|
|
2094
|
+
return !!(e.enter || e.enterFrom || e.enterTo || e.leave || e.leaveFrom || e.leaveTo) || ((t = e.as) != null ? t : Io) !== q || L.Children.count(e.children) === 1;
|
|
2095
2095
|
}
|
|
2096
2096
|
let Nt = ie(null);
|
|
2097
2097
|
Nt.displayName = "TransitionContext";
|
|
@@ -2111,8 +2111,8 @@ Lt.displayName = "NestingContext";
|
|
|
2111
2111
|
function At(e) {
|
|
2112
2112
|
return "children" in e ? At(e.children) : e.current.filter(({ el: t }) => t.current !== null).filter(({ state: t }) => t === "visible").length > 0;
|
|
2113
2113
|
}
|
|
2114
|
-
function
|
|
2115
|
-
let n = Oe(e), r = w([]), o = Nn(), i = xt(), s =
|
|
2114
|
+
function Ro(e, t) {
|
|
2115
|
+
let n = Oe(e), r = w([]), o = Nn(), i = xt(), s = G((p, _ = Ee.Hidden) => {
|
|
2116
2116
|
let y = r.current.findIndex(({ el: m }) => m === p);
|
|
2117
2117
|
y !== -1 && (Te(_, { [Ee.Unmount]() {
|
|
2118
2118
|
r.current.splice(y, 1);
|
|
@@ -2122,87 +2122,87 @@ function Io(e, t) {
|
|
|
2122
2122
|
var m;
|
|
2123
2123
|
!At(r) && o.current && ((m = n.current) == null || m.call(n));
|
|
2124
2124
|
}));
|
|
2125
|
-
}), a =
|
|
2125
|
+
}), a = G((p) => {
|
|
2126
2126
|
let _ = r.current.find(({ el: y }) => y === p);
|
|
2127
2127
|
return _ ? _.state !== "visible" && (_.state = "visible") : r.current.push({ el: p, state: "visible" }), () => s(p, Ee.Unmount);
|
|
2128
|
-
}), l = w([]), u = w(Promise.resolve()), d = w({ enter: [], leave: [] }), c =
|
|
2128
|
+
}), l = w([]), u = w(Promise.resolve()), d = w({ enter: [], leave: [] }), c = G((p, _, y) => {
|
|
2129
2129
|
l.current.splice(0), t && (t.chains.current[_] = t.chains.current[_].filter(([m]) => m !== p)), t == null || t.chains.current[_].push([p, new Promise((m) => {
|
|
2130
2130
|
l.current.push(m);
|
|
2131
2131
|
})]), t == null || t.chains.current[_].push([p, new Promise((m) => {
|
|
2132
2132
|
Promise.all(d.current[_].map(([v, g]) => g)).then(() => m());
|
|
2133
2133
|
})]), _ === "enter" ? u.current = u.current.then(() => t == null ? void 0 : t.wait.current).then(() => y(_)) : y(_);
|
|
2134
|
-
}), f =
|
|
2134
|
+
}), f = G((p, _, y) => {
|
|
2135
2135
|
Promise.all(d.current[_].splice(0).map(([m, v]) => v)).then(() => {
|
|
2136
2136
|
var m;
|
|
2137
2137
|
(m = l.current.shift()) == null || m();
|
|
2138
2138
|
}).then(() => y(_));
|
|
2139
2139
|
});
|
|
2140
|
-
return
|
|
2140
|
+
return z(() => ({ children: r, register: a, unregister: s, onStart: c, onStop: f, wait: u, chains: d }), [a, s, r, c, f, d, u]);
|
|
2141
2141
|
}
|
|
2142
|
-
let
|
|
2142
|
+
let Io = q, Do = bt.RenderStrategy;
|
|
2143
2143
|
function ua(e, t) {
|
|
2144
2144
|
var n, r;
|
|
2145
|
-
let { transition: o = !0, beforeEnter: i, afterEnter: s, beforeLeave: a, afterLeave: l, enter: u, enterFrom: d, enterTo: c, entered: f, leave: p, leaveFrom: _, leaveTo: y, ...m } = e, v = w(null), g = Ao(e), $ = he(...g ? [v, t] : t === null ? [] : [t]), T = (n = m.unmount) == null || n ? Ee.Unmount : Ee.Hidden, { show: S, appear:
|
|
2146
|
-
re(() =>
|
|
2145
|
+
let { transition: o = !0, beforeEnter: i, afterEnter: s, beforeLeave: a, afterLeave: l, enter: u, enterFrom: d, enterTo: c, entered: f, leave: p, leaveFrom: _, leaveTo: y, ...m } = e, v = w(null), g = Ao(e), $ = he(...g ? [v, t] : t === null ? [] : [t]), T = (n = m.unmount) == null || n ? Ee.Unmount : Ee.Hidden, { show: S, appear: M, initial: A } = la(), [W, F] = x(S ? "visible" : "hidden"), b = ca(), { register: R, unregister: j } = b;
|
|
2146
|
+
re(() => R(v), [R, v]), re(() => {
|
|
2147
2147
|
if (T === Ee.Hidden && v.current) {
|
|
2148
2148
|
if (S && W !== "visible") {
|
|
2149
2149
|
F("visible");
|
|
2150
2150
|
return;
|
|
2151
2151
|
}
|
|
2152
|
-
return Te(W, { hidden: () =>
|
|
2152
|
+
return Te(W, { hidden: () => j(v), visible: () => R(v) });
|
|
2153
2153
|
}
|
|
2154
|
-
}, [W, v,
|
|
2154
|
+
}, [W, v, R, j, S, T]);
|
|
2155
2155
|
let I = ct();
|
|
2156
2156
|
re(() => {
|
|
2157
2157
|
if (g && I && W === "visible" && v.current === null) throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?");
|
|
2158
2158
|
}, [v, W, I, g]);
|
|
2159
|
-
let
|
|
2160
|
-
|
|
2161
|
-
},
|
|
2162
|
-
|
|
2163
|
-
let J =
|
|
2164
|
-
|
|
2159
|
+
let Y = A && !M, Q = M && S && A, X = w(!1), k = Ro(() => {
|
|
2160
|
+
X.current || (F("hidden"), j(v));
|
|
2161
|
+
}, b), C = G((Z) => {
|
|
2162
|
+
X.current = !0;
|
|
2163
|
+
let J = Z ? "enter" : "leave";
|
|
2164
|
+
k.onStart(v, J, (ee) => {
|
|
2165
2165
|
ee === "enter" ? i == null || i() : ee === "leave" && (a == null || a());
|
|
2166
2166
|
});
|
|
2167
|
-
}),
|
|
2168
|
-
let J =
|
|
2169
|
-
|
|
2167
|
+
}), N = G((Z) => {
|
|
2168
|
+
let J = Z ? "enter" : "leave";
|
|
2169
|
+
X.current = !1, k.onStop(v, J, (ee) => {
|
|
2170
2170
|
ee === "enter" ? s == null || s() : ee === "leave" && (l == null || l());
|
|
2171
|
-
}), J === "leave" && !At(
|
|
2171
|
+
}), J === "leave" && !At(k) && (F("hidden"), j(v));
|
|
2172
2172
|
});
|
|
2173
2173
|
H(() => {
|
|
2174
|
-
g && o || (
|
|
2174
|
+
g && o || (C(S), N(S));
|
|
2175
2175
|
}, [S, g, o]);
|
|
2176
|
-
let
|
|
2177
|
-
return W === "visible" && (
|
|
2176
|
+
let P = !(!o || !g || !I || Y), [, E] = Ns(P, v, S, { start: C, end: N }), D = Fe({ ref: $, className: ((r = ln(m.className, Q && u, Q && d, E.enter && u, E.enter && E.closed && d, E.enter && !E.closed && c, E.leave && p, E.leave && !E.closed && _, E.leave && E.closed && y, !E.transition && S && f)) == null ? void 0 : r.trim()) || void 0, ...Ps(E) }), V = 0;
|
|
2177
|
+
return W === "visible" && (V |= ce.Open), W === "hidden" && (V |= ce.Closed), E.enter && (V |= ce.Opening), E.leave && (V |= ce.Closing), L.createElement(Lt.Provider, { value: k }, L.createElement(Is, { value: V }, ae({ ourProps: D, theirProps: m, defaultTag: Io, features: Do, visible: W === "visible", name: "Transition.Child" })));
|
|
2178
2178
|
}
|
|
2179
2179
|
function da(e, t) {
|
|
2180
2180
|
let { show: n, appear: r = !1, unmount: o = !0, ...i } = e, s = w(null), a = Ao(e), l = he(...a ? [s, t] : t === null ? [] : [t]);
|
|
2181
2181
|
ct();
|
|
2182
2182
|
let u = Pt();
|
|
2183
2183
|
if (n === void 0 && u !== null && (n = (u & ce.Open) === ce.Open), n === void 0) throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");
|
|
2184
|
-
let [d, c] =
|
|
2184
|
+
let [d, c] = x(n ? "visible" : "hidden"), f = Ro(() => {
|
|
2185
2185
|
n || c("hidden");
|
|
2186
|
-
}), [p, _] =
|
|
2186
|
+
}), [p, _] = x(!0), y = w([n]);
|
|
2187
2187
|
re(() => {
|
|
2188
2188
|
p !== !1 && y.current[y.current.length - 1] !== n && (y.current.push(n), _(!1));
|
|
2189
2189
|
}, [y, n]);
|
|
2190
|
-
let m =
|
|
2190
|
+
let m = z(() => ({ show: n, appear: r, initial: p }), [n, r, p]);
|
|
2191
2191
|
Eo(n, s, () => c("hidden")), re(() => {
|
|
2192
2192
|
n ? c("visible") : !At(f) && s.current !== null && c("hidden");
|
|
2193
2193
|
}, [n, f]);
|
|
2194
|
-
let v = { unmount: o }, g =
|
|
2194
|
+
let v = { unmount: o }, g = G(() => {
|
|
2195
2195
|
var T;
|
|
2196
2196
|
p && _(!1), (T = e.beforeEnter) == null || T.call(e);
|
|
2197
|
-
}), $ =
|
|
2197
|
+
}), $ = G(() => {
|
|
2198
2198
|
var T;
|
|
2199
2199
|
p && _(!1), (T = e.beforeLeave) == null || T.call(e);
|
|
2200
2200
|
});
|
|
2201
|
-
return
|
|
2201
|
+
return L.createElement(Lt.Provider, { value: f }, L.createElement(Nt.Provider, { value: m }, ae({ ourProps: { ...v, as: q, children: L.createElement(Oo, { ref: l, ...v, ...i, beforeEnter: g, beforeLeave: $ }) }, theirProps: {}, defaultTag: q, features: Do, visible: d === "visible", name: "Transition" })));
|
|
2202
2202
|
}
|
|
2203
2203
|
function fa(e, t) {
|
|
2204
2204
|
let n = te(Nt) !== null, r = Pt() !== null;
|
|
2205
|
-
return
|
|
2205
|
+
return L.createElement(L.Fragment, null, !n && r ? L.createElement(hn, { ref: t, ...e }) : L.createElement(Oo, { ref: t, ...e }));
|
|
2206
2206
|
}
|
|
2207
2207
|
let hn = oe(da), Oo = oe(ua), Ln = oe(fa), pe = Object.assign(hn, { Child: Ln, Root: hn });
|
|
2208
2208
|
var pa = ((e) => (e[e.Open = 0] = "Open", e[e.Closed = 1] = "Closed", e))(pa || {}), ha = ((e) => (e[e.SetTitleId = 0] = "SetTitleId", e))(ha || {});
|
|
@@ -2210,11 +2210,11 @@ let va = { 0(e, t) {
|
|
|
2210
2210
|
return e.titleId === t.id ? e : { ...e, titleId: t.id };
|
|
2211
2211
|
} }, An = ie(null);
|
|
2212
2212
|
An.displayName = "DialogContext";
|
|
2213
|
-
function
|
|
2213
|
+
function Rt(e) {
|
|
2214
2214
|
let t = te(An);
|
|
2215
2215
|
if (t === null) {
|
|
2216
2216
|
let n = new Error(`<${e} /> is missing a parent <Dialog /> component.`);
|
|
2217
|
-
throw Error.captureStackTrace && Error.captureStackTrace(n,
|
|
2217
|
+
throw Error.captureStackTrace && Error.captureStackTrace(n, Rt), n;
|
|
2218
2218
|
}
|
|
2219
2219
|
return t;
|
|
2220
2220
|
}
|
|
@@ -2228,23 +2228,23 @@ let cr = oe(function(e, t) {
|
|
|
2228
2228
|
}();
|
|
2229
2229
|
let f = Pt();
|
|
2230
2230
|
o === void 0 && f !== null && (o = (f & ce.Open) === ce.Open);
|
|
2231
|
-
let p = w(null), _ = he(p, t), y = lt(p), m = o ? 0 : 1, [v, g] = it(ma, { titleId: null, descriptionId: null, panelRef: mn() }), $ =
|
|
2232
|
-
var
|
|
2233
|
-
return (
|
|
2234
|
-
} }, { resolveContainers: F, mainTreeNodeRef:
|
|
2235
|
-
cs(u ||
|
|
2236
|
-
var
|
|
2237
|
-
return [(
|
|
2238
|
-
}), disallowed:
|
|
2239
|
-
var
|
|
2240
|
-
return [(
|
|
2241
|
-
}) }), bs(S, F, (
|
|
2242
|
-
|
|
2243
|
-
}), Ks(S, y == null ? void 0 : y.defaultView, (
|
|
2244
|
-
|
|
2245
|
-
}),
|
|
2246
|
-
let [I,
|
|
2247
|
-
return S && !u && (
|
|
2231
|
+
let p = w(null), _ = he(p, t), y = lt(p), m = o ? 0 : 1, [v, g] = it(ma, { titleId: null, descriptionId: null, panelRef: mn() }), $ = G(() => i(!1)), T = G((P) => g({ type: 0, id: P })), S = ct() ? m === 0 : !1, [M, A] = qs(), W = { get current() {
|
|
2232
|
+
var P;
|
|
2233
|
+
return (P = v.panelRef.current) != null ? P : p.current;
|
|
2234
|
+
} }, { resolveContainers: F, mainTreeNodeRef: b, MainTreeNode: R } = Zs({ portals: M, defaultContainers: [W] }), j = f !== null ? (f & ce.Closing) === ce.Closing : !1;
|
|
2235
|
+
cs(u || j ? !1 : S, { allowed: G(() => {
|
|
2236
|
+
var P, E;
|
|
2237
|
+
return [(E = (P = p.current) == null ? void 0 : P.closest("[data-headlessui-portal]")) != null ? E : null];
|
|
2238
|
+
}), disallowed: G(() => {
|
|
2239
|
+
var P, E;
|
|
2240
|
+
return [(E = (P = b.current) == null ? void 0 : P.closest("body > *:not(#headlessui-portal-root)")) != null ? E : null];
|
|
2241
|
+
}) }), bs(S, F, (P) => {
|
|
2242
|
+
P.preventDefault(), $();
|
|
2243
|
+
}), Ks(S, y == null ? void 0 : y.defaultView, (P) => {
|
|
2244
|
+
P.preventDefault(), P.stopPropagation(), document.activeElement && "blur" in document.activeElement && typeof document.activeElement.blur == "function" && document.activeElement.blur(), $();
|
|
2245
|
+
}), Cs(u || j ? !1 : S, y, F), Eo(S, p, $);
|
|
2246
|
+
let [I, Y] = es(), Q = z(() => [{ dialogState: m, close: $, setTitleId: T }, v], [m, v, $, T]), X = z(() => ({ open: m === 0 }), [m]), k = { ref: _, id: r, role: a, tabIndex: -1, "aria-modal": u ? void 0 : m === 0 ? !0 : void 0, "aria-labelledby": v.titleId, "aria-describedby": I }, C = !Xs(), N = Me.None;
|
|
2247
|
+
return S && !u && (N |= Me.RestoreFocus, N |= Me.TabLock, l && (N |= Me.AutoFocus), C && (N |= Me.InitialFocus)), L.createElement(Ds, null, L.createElement(lr, { force: !0 }, L.createElement(Gs, null, L.createElement(An.Provider, { value: Q }, L.createElement(Po, { target: p }, L.createElement(lr, { force: !1 }, L.createElement(Y, { slot: X }, L.createElement(A, null, L.createElement(na, { initialFocus: s, initialFocusFallback: p, containers: F, features: N }, L.createElement(ss, { value: $ }, ae({ ourProps: k, theirProps: d, slot: X, defaultTag: _a, features: ya, visible: m === 0, name: "Dialog" })))))))))), L.createElement(Ji, null, L.createElement(R, null)));
|
|
2248
2248
|
}), _a = "div", ya = bt.RenderStrategy | bt.Static;
|
|
2249
2249
|
function ga(e, t) {
|
|
2250
2250
|
let { transition: n = !1, open: r, ...o } = e, i = Pt(), s = e.hasOwnProperty("open") || i !== null, a = e.hasOwnProperty("onClose");
|
|
@@ -2253,37 +2253,37 @@ function ga(e, t) {
|
|
|
2253
2253
|
if (!a) throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");
|
|
2254
2254
|
if (!i && typeof e.open != "boolean") throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${e.open}`);
|
|
2255
2255
|
if (typeof e.onClose != "function") throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${e.onClose}`);
|
|
2256
|
-
return (r !== void 0 || n) && !o.static ?
|
|
2256
|
+
return (r !== void 0 || n) && !o.static ? L.createElement(pe, { show: r, transition: n, unmount: o.unmount }, L.createElement(cr, { ref: t, ...o })) : L.createElement(cr, { ref: t, open: r, ...o });
|
|
2257
2257
|
}
|
|
2258
2258
|
let wa = "div";
|
|
2259
2259
|
function ba(e, t) {
|
|
2260
|
-
let n = ke(), { id: r = `headlessui-dialog-panel-${n}`, transition: o = !1, ...i } = e, [{ dialogState: s }, a] =
|
|
2260
|
+
let n = ke(), { id: r = `headlessui-dialog-panel-${n}`, transition: o = !1, ...i } = e, [{ dialogState: s }, a] = Rt("Dialog.Panel"), l = he(t, a.panelRef), u = z(() => ({ open: s === 0 }), [s]), d = G((c) => {
|
|
2261
2261
|
c.stopPropagation();
|
|
2262
2262
|
});
|
|
2263
|
-
return
|
|
2263
|
+
return L.createElement(o ? Ln : q, null, ae({ ourProps: { ref: l, id: r, onClick: d }, theirProps: i, slot: u, defaultTag: wa, name: "Dialog.Panel" }));
|
|
2264
2264
|
}
|
|
2265
2265
|
let Ea = "div";
|
|
2266
2266
|
function $a(e, t) {
|
|
2267
|
-
let { transition: n = !1, ...r } = e, [{ dialogState: o }] =
|
|
2268
|
-
return
|
|
2267
|
+
let { transition: n = !1, ...r } = e, [{ dialogState: o }] = Rt("Dialog.Backdrop"), i = z(() => ({ open: o === 0 }), [o]);
|
|
2268
|
+
return L.createElement(n ? Ln : q, null, ae({ ourProps: { ref: t, "aria-hidden": !0 }, theirProps: r, slot: i, defaultTag: Ea, name: "Dialog.Backdrop" }));
|
|
2269
2269
|
}
|
|
2270
2270
|
let Ta = "h2";
|
|
2271
2271
|
function ka(e, t) {
|
|
2272
|
-
let n = ke(), { id: r = `headlessui-dialog-title-${n}`, ...o } = e, [{ dialogState: i, setTitleId: s }] =
|
|
2272
|
+
let n = ke(), { id: r = `headlessui-dialog-title-${n}`, ...o } = e, [{ dialogState: i, setTitleId: s }] = Rt("Dialog.Title"), a = he(t);
|
|
2273
2273
|
H(() => (s(r), () => s(null)), [r, s]);
|
|
2274
|
-
let l =
|
|
2274
|
+
let l = z(() => ({ open: i === 0 }), [i]);
|
|
2275
2275
|
return ae({ ourProps: { ref: a, id: r }, theirProps: o, slot: l, defaultTag: Ta, name: "Dialog.Title" });
|
|
2276
2276
|
}
|
|
2277
2277
|
let Sa = oe(ga), Ho = oe(ba);
|
|
2278
2278
|
oe($a);
|
|
2279
|
-
let
|
|
2279
|
+
let Ca = oe(ka), Fa = Object.assign(Sa, { Panel: Ho, Title: Ca, Description: os });
|
|
2280
2280
|
const xa = "_root_1duny_1", Ma = "_modal_1duny_10", Pa = "_container_1duny_13", Na = "_page_1duny_18", La = "_close_1duny_21", ht = {
|
|
2281
2281
|
root: xa,
|
|
2282
2282
|
modal: Ma,
|
|
2283
2283
|
container: Pa,
|
|
2284
2284
|
page: Na,
|
|
2285
2285
|
close: La
|
|
2286
|
-
}, Aa = "_root_1h6qm_1",
|
|
2286
|
+
}, Aa = "_root_1h6qm_1", Ra = {
|
|
2287
2287
|
root: Aa
|
|
2288
2288
|
}, we = (e) => {
|
|
2289
2289
|
const {
|
|
@@ -2294,7 +2294,7 @@ const xa = "_root_1duny_1", Ma = "_modal_1duny_10", Pa = "_container_1duny_13",
|
|
|
2294
2294
|
strokeWidth: i,
|
|
2295
2295
|
className: s = "",
|
|
2296
2296
|
viewBox: a = "0 0 20 20"
|
|
2297
|
-
} = e, l =
|
|
2297
|
+
} = e, l = z(() => {
|
|
2298
2298
|
switch (n) {
|
|
2299
2299
|
case "sm":
|
|
2300
2300
|
return "yvlw-w-4 yvlw-h-4";
|
|
@@ -2320,7 +2320,7 @@ const xa = "_root_1duny_1", Ma = "_modal_1duny_10", Pa = "_container_1duny_13",
|
|
|
2320
2320
|
children: t
|
|
2321
2321
|
}
|
|
2322
2322
|
);
|
|
2323
|
-
},
|
|
2323
|
+
}, Ia = () => /* @__PURE__ */ h(we, { children: /* @__PURE__ */ h("path", { d: "M10 2a.75.75 0 01.75.75v1.5a.75.75 0 01-1.5 0v-1.5A.75.75 0 0110 2zM10 15a.75.75 0 01.75.75v1.5a.75.75 0 01-1.5 0v-1.5A.75.75 0 0110 15zM10 7a3 3 0 100 6 3 3 0 000-6zM15.657 5.404a.75.75 0 10-1.06-1.06l-1.061 1.06a.75.75 0 001.06 1.06l1.06-1.06zM6.464 14.596a.75.75 0 10-1.06-1.06l-1.06 1.06a.75.75 0 001.06 1.06l1.06-1.06zM18 10a.75.75 0 01-.75.75h-1.5a.75.75 0 010-1.5h1.5A.75.75 0 0118 10zM5 10a.75.75 0 01-.75.75h-1.5a.75.75 0 010-1.5h1.5A.75.75 0 015 10zM14.596 15.657a.75.75 0 001.06-1.06l-1.06-1.061a.75.75 0 10-1.06 1.06l1.06 1.06zM5.404 6.464a.75.75 0 001.06-1.06l-1.06-1.06a.75.75 0 10-1.061 1.06l1.06 1.06z" }) }), Wo = (e) => /* @__PURE__ */ h(we, { ...e, children: /* @__PURE__ */ h(
|
|
2324
2324
|
"path",
|
|
2325
2325
|
{
|
|
2326
2326
|
fillRule: "evenodd",
|
|
@@ -2339,7 +2339,7 @@ const xa = "_root_1duny_1", Ma = "_modal_1duny_10", Pa = "_container_1duny_13",
|
|
|
2339
2339
|
] }), Ha = (e) => /* @__PURE__ */ h(we, { ...e, children: [
|
|
2340
2340
|
/* @__PURE__ */ h("path", { d: "M0 0h24v24H0V0z", fill: "none" }),
|
|
2341
2341
|
/* @__PURE__ */ h("path", { d: "M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0-6c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm0 7c-2.67 0-8 1.34-8 4v2c0 .55.45 1 1 1h14c.55 0 1-.45 1-1v-2c0-2.66-5.33-4-8-4zm6 5H6v-.99c.2-.72 3.3-2.01 6-2.01s5.8 1.29 6 2v1z" })
|
|
2342
|
-
] }), Wa = (e) => /* @__PURE__ */ h(we, { ...e, children: /* @__PURE__ */ h("path", { d: "M18,10l-1.77-2.03l0.25-2.69l-2.63-0.6l-1.37-2.32L10,3.43L7.53,2.36L6.15,4.68L3.53,5.28l0.25,2.69L2,10l1.77,2.03 l-0.25,2.69l2.63,0.6l1.37,2.32L10,16.56l2.47,1.07l1.37-2.32l2.63-0.6l-0.25-2.69L18,10z M13.18,8.47l-4.24,4.24 c-0.2,0.2-0.51,0.2-0.71,0L6.82,11.3c-0.2-0.2-0.2-0.51,0-0.71s0.51-0.2,0.71,0l1.06,1.06l3.89-3.89c0.2-0.2,0.51-0.2,0.71,0 S13.38,8.28,13.18,8.47z" }) }),
|
|
2342
|
+
] }), Wa = (e) => /* @__PURE__ */ h(we, { ...e, children: /* @__PURE__ */ h("path", { d: "M18,10l-1.77-2.03l0.25-2.69l-2.63-0.6l-1.37-2.32L10,3.43L7.53,2.36L6.15,4.68L3.53,5.28l0.25,2.69L2,10l1.77,2.03 l-0.25,2.69l2.63,0.6l1.37,2.32L10,16.56l2.47,1.07l1.37-2.32l2.63-0.6l-0.25-2.69L18,10z M13.18,8.47l-4.24,4.24 c-0.2,0.2-0.51,0.2-0.71,0L6.82,11.3c-0.2-0.2-0.2-0.51,0-0.71s0.51-0.2,0.71,0l1.06,1.06l3.89-3.89c0.2-0.2,0.51-0.2,0.71,0 S13.38,8.28,13.18,8.47z" }) }), Uo = (e) => /* @__PURE__ */ h(we, { ...e, viewBox: "0 0 24 24", children: /* @__PURE__ */ h("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z" }) }), Ua = (e) => /* @__PURE__ */ h(we, { ...e, children: /* @__PURE__ */ h("path", { d: "M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z" }) });
|
|
2343
2343
|
class $e {
|
|
2344
2344
|
static loadVision() {
|
|
2345
2345
|
return import(
|
|
@@ -2426,22 +2426,22 @@ class $e {
|
|
|
2426
2426
|
}
|
|
2427
2427
|
}
|
|
2428
2428
|
}
|
|
2429
|
-
const
|
|
2429
|
+
const za = (e, t) => {
|
|
2430
2430
|
let n;
|
|
2431
2431
|
return typeof OffscreenCanvas < "u" ? n = new OffscreenCanvas(e, t) : (n = document.createElement("canvas"), n.width = e, n.height = t), n;
|
|
2432
|
-
},
|
|
2432
|
+
}, Rn = (e, t, n, r, o) => {
|
|
2433
2433
|
let i = 0, s = 0, a = t, l = n;
|
|
2434
|
-
const d =
|
|
2434
|
+
const d = za(t, n).getContext(
|
|
2435
2435
|
"2d",
|
|
2436
2436
|
o
|
|
2437
2437
|
);
|
|
2438
2438
|
return d.drawImage(e, 0, 0), d.getImageData(i, s, a, l);
|
|
2439
|
-
},
|
|
2439
|
+
}, Va = (e) => new Promise((t) => {
|
|
2440
2440
|
const n = document.createElement("canvas");
|
|
2441
2441
|
let { width: r } = e, { height: o } = e;
|
|
2442
2442
|
e instanceof HTMLVideoElement && (r = e.videoWidth, o = e.videoHeight), n.width = r, n.height = o, n.getContext("2d").drawImage(e, 0, 0), n.toBlob((s) => t(s));
|
|
2443
2443
|
});
|
|
2444
|
-
function
|
|
2444
|
+
function ja(e) {
|
|
2445
2445
|
const { width: t, height: n, data: r } = e;
|
|
2446
2446
|
let o = 0, i = 0;
|
|
2447
2447
|
const s = [0, -1, 0, -1, 4, -1, 0, -1, 0];
|
|
@@ -2469,7 +2469,7 @@ function Ba() {
|
|
|
2469
2469
|
if (MediaRecorder.isTypeSupported("video/mp4"))
|
|
2470
2470
|
return { mimeType: "video/mp4", videoBitsPerSecond: 25e4 };
|
|
2471
2471
|
}
|
|
2472
|
-
function
|
|
2472
|
+
function zo(e = {}) {
|
|
2473
2473
|
const { onRecord: t = () => {
|
|
2474
2474
|
}, onStop: n = () => {
|
|
2475
2475
|
} } = e, r = w([]), o = w(null), i = w(null), s = U((f) => {
|
|
@@ -2490,7 +2490,7 @@ function Uo(e = {}) {
|
|
|
2490
2490
|
"image/jpeg",
|
|
2491
2491
|
0.95
|
|
2492
2492
|
)) : _(null);
|
|
2493
|
-
}) : p = await
|
|
2493
|
+
}) : p = await Va(f), p && (o.current = p);
|
|
2494
2494
|
},
|
|
2495
2495
|
[]
|
|
2496
2496
|
), l = U(() => {
|
|
@@ -2515,61 +2515,96 @@ function Uo(e = {}) {
|
|
|
2515
2515
|
clearSavedPhoto: l
|
|
2516
2516
|
};
|
|
2517
2517
|
}
|
|
2518
|
-
const qa = "https://cdn.svc.youverify.co", Ya = (e
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2518
|
+
const qa = "https://cdn.svc.youverify.co", Ya = "61d880f1e8e15aaf24558f1a", Ga = (e, t, n, r) => {
|
|
2519
|
+
if (t)
|
|
2520
|
+
if (!n)
|
|
2521
|
+
r == null || r({
|
|
2522
|
+
faceImage: "",
|
|
2523
|
+
passed: !1,
|
|
2524
|
+
error: {
|
|
2525
|
+
key: "FORCE_DEV_URL_ERROR",
|
|
2526
|
+
message: "publicKey is required when forceDevUrl is true"
|
|
2527
|
+
}
|
|
2528
|
+
});
|
|
2529
|
+
else if (n !== Ya)
|
|
2530
|
+
r == null || r({
|
|
2531
|
+
faceImage: "",
|
|
2532
|
+
passed: !1,
|
|
2533
|
+
error: {
|
|
2534
|
+
key: "FORCE_DEV_URL_ERROR",
|
|
2535
|
+
message: "Invalid publicKey for forceDevUrl, access denied"
|
|
2536
|
+
}
|
|
2537
|
+
});
|
|
2538
|
+
else
|
|
2539
|
+
return "https://identity.dev.svc.youverify.co";
|
|
2540
|
+
return e ? "https://identity.staging.svc.youverify.co" : "https://identity.svc.youverify.co";
|
|
2541
|
+
};
|
|
2542
|
+
function Ka(e, t, n, r) {
|
|
2543
|
+
const o = Ga(
|
|
2544
|
+
e,
|
|
2545
|
+
t,
|
|
2546
|
+
n,
|
|
2547
|
+
r
|
|
2548
|
+
);
|
|
2549
|
+
return { postData: async (l) => {
|
|
2550
|
+
const {
|
|
2551
|
+
faceImage: u,
|
|
2552
|
+
publicKey: d,
|
|
2553
|
+
passed: c,
|
|
2554
|
+
metadata: f,
|
|
2555
|
+
video: p,
|
|
2556
|
+
sessionId: _
|
|
2557
|
+
} = l, y = new FormData();
|
|
2558
|
+
y.append("files", u), y.append("files", p);
|
|
2559
|
+
const m = await fetch(
|
|
2525
2560
|
`${qa}/v1/uploads/media`,
|
|
2526
2561
|
{
|
|
2527
2562
|
method: "POST",
|
|
2528
2563
|
headers: {
|
|
2529
2564
|
// "Content-Type": "multipart/form-data",
|
|
2530
2565
|
},
|
|
2531
|
-
body:
|
|
2566
|
+
body: y
|
|
2532
2567
|
}
|
|
2533
2568
|
);
|
|
2534
|
-
if (!
|
|
2535
|
-
throw
|
|
2536
|
-
const
|
|
2537
|
-
sessionId:
|
|
2569
|
+
if (!m.ok)
|
|
2570
|
+
throw m;
|
|
2571
|
+
const v = (await m.json()).data, g = {
|
|
2572
|
+
sessionId: _,
|
|
2538
2573
|
components: ["liveness"],
|
|
2539
|
-
faceImage:
|
|
2540
|
-
livenessClip:
|
|
2541
|
-
passed:
|
|
2542
|
-
metadata:
|
|
2574
|
+
faceImage: v[0].cachedLocation,
|
|
2575
|
+
livenessClip: v[1].cachedLocation,
|
|
2576
|
+
passed: c,
|
|
2577
|
+
metadata: f
|
|
2543
2578
|
};
|
|
2544
|
-
|
|
2545
|
-
const
|
|
2579
|
+
d && (g.publicMerchantID = d);
|
|
2580
|
+
const $ = await fetch(`${o}/v1/sdk/identity/liveness/`, {
|
|
2546
2581
|
method: "POST",
|
|
2547
2582
|
headers: {
|
|
2548
2583
|
"Content-Type": "application/json"
|
|
2549
2584
|
},
|
|
2550
|
-
body: JSON.stringify(
|
|
2585
|
+
body: JSON.stringify(g)
|
|
2551
2586
|
});
|
|
2552
|
-
if (
|
|
2553
|
-
throw
|
|
2554
|
-
return (await
|
|
2587
|
+
if (!$.ok)
|
|
2588
|
+
throw $;
|
|
2589
|
+
return (await $.json()).data;
|
|
2555
2590
|
}, fetchSessionToken: async () => {
|
|
2556
2591
|
throw new Error(
|
|
2557
2592
|
"fetchSessionToken is deprecated. Provide sessionToken from your backend."
|
|
2558
2593
|
);
|
|
2559
|
-
}, validateSessionId: async (
|
|
2560
|
-
const
|
|
2594
|
+
}, validateSessionId: async (l) => {
|
|
2595
|
+
const u = await fetch(`${o}/v1/sdk/session/validate`, {
|
|
2561
2596
|
method: "POST",
|
|
2562
2597
|
headers: { "Content-Type": "application/json" },
|
|
2563
|
-
body: JSON.stringify({ sessionId:
|
|
2564
|
-
}),
|
|
2565
|
-
if (!
|
|
2566
|
-
const
|
|
2567
|
-
throw new Error(
|
|
2598
|
+
body: JSON.stringify({ sessionId: l })
|
|
2599
|
+
}), d = await u.json().catch(() => ({}));
|
|
2600
|
+
if (!u.ok) {
|
|
2601
|
+
const c = (d == null ? void 0 : d.message) || "Session validation failed";
|
|
2602
|
+
throw new Error(c);
|
|
2568
2603
|
}
|
|
2569
2604
|
return !0;
|
|
2570
2605
|
} };
|
|
2571
2606
|
}
|
|
2572
|
-
const
|
|
2607
|
+
const Xa = 360, Za = "#125766", Ja = "https://cdn.youverify.co/1721901834404-q2nxqyng5klm918b3BDVU.jpg", dr = "https://cdn.youverify.co", Ge = {
|
|
2573
2608
|
js: {
|
|
2574
2609
|
default: "1731681780468-ttgfiK6Sl1GKegUe-wm4v.js",
|
|
2575
2610
|
simd: "1731681609027-RTOweJqdl8Tt39aAdyie9.js"
|
|
@@ -2578,7 +2613,7 @@ const Ka = 360, Xa = "#125766", Za = "https://cdn.youverify.co/1721901834404-q2n
|
|
|
2578
2613
|
default: "1731681817302-aVNwDW6DP2MsDNTbiav_V.wasm",
|
|
2579
2614
|
simd: "1731681739675-nvF1En4g5rAW4daq5g5DH.wasm"
|
|
2580
2615
|
}
|
|
2581
|
-
},
|
|
2616
|
+
}, Qa = [
|
|
2582
2617
|
0,
|
|
2583
2618
|
97,
|
|
2584
2619
|
115,
|
|
@@ -2621,7 +2656,7 @@ const Ka = 360, Xa = "#125766", Za = "https://cdn.youverify.co/1721901834404-q2n
|
|
|
2621
2656
|
key: "LIGHTING_ERROR",
|
|
2622
2657
|
message: "Please check your lighting. Move to a well-lit area, but avoid harsh light or strong reflections on your face."
|
|
2623
2658
|
}
|
|
2624
|
-
},
|
|
2659
|
+
}, el = {
|
|
2625
2660
|
"complete-the-circle": {
|
|
2626
2661
|
Icon: Da,
|
|
2627
2662
|
name: "Complete The Circle ⭕️",
|
|
@@ -2647,7 +2682,7 @@ const Ka = 360, Xa = "#125766", Za = "https://cdn.youverify.co/1721901834404-q2n
|
|
|
2647
2682
|
name: "Facial Expressions 🤪",
|
|
2648
2683
|
description: "First position your face in the camera frame. Then move your head in a circle to show all the angles of your face"
|
|
2649
2684
|
}
|
|
2650
|
-
},
|
|
2685
|
+
}, Vo = ie({
|
|
2651
2686
|
tasks: [],
|
|
2652
2687
|
namespace: "",
|
|
2653
2688
|
user: void 0,
|
|
@@ -2675,7 +2710,7 @@ const Ka = 360, Xa = "#125766", Za = "https://cdn.youverify.co/1721901834404-q2n
|
|
|
2675
2710
|
isMobileAppWebView: !1
|
|
2676
2711
|
});
|
|
2677
2712
|
let pr, hr = !1;
|
|
2678
|
-
function
|
|
2713
|
+
function tl(e) {
|
|
2679
2714
|
const {
|
|
2680
2715
|
publicKey: t,
|
|
2681
2716
|
tasks: n,
|
|
@@ -2693,20 +2728,26 @@ function el(e) {
|
|
|
2693
2728
|
sandboxEnvironment: f = !0,
|
|
2694
2729
|
isMobileAppWebView: p = !1,
|
|
2695
2730
|
sessionId: _,
|
|
2696
|
-
sessionToken: y
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2731
|
+
sessionToken: y,
|
|
2732
|
+
forceDevUrl: m
|
|
2733
|
+
} = e, [v, g] = x(0), [$, T] = x(0), [S, M] = x(null), [A, W] = x(!1), { saveStream: F, savePhoto: b, savedPhoto: R, clearSavedPhoto: j, savedStreams: I } = zo(), { postData: Y, validateSessionId: Q } = Ka(
|
|
2734
|
+
f,
|
|
2735
|
+
m,
|
|
2736
|
+
t,
|
|
2737
|
+
u
|
|
2738
|
+
), X = z(
|
|
2739
|
+
() => $ === n.length,
|
|
2740
|
+
[n, $]
|
|
2741
|
+
), k = () => {
|
|
2742
|
+
T((E) => E + 1), g((E) => E + 1);
|
|
2743
|
+
}, C = (E) => {
|
|
2744
|
+
const D = new Image();
|
|
2745
|
+
D.crossOrigin = "Anonymous", D.src = Ja, D.onload = () => {
|
|
2746
|
+
const V = Rn(D, D.width, D.height);
|
|
2747
|
+
$e.detectFaces(E, V);
|
|
2707
2748
|
};
|
|
2708
2749
|
}, N = async () => {
|
|
2709
|
-
if (!
|
|
2750
|
+
if (!R.current) {
|
|
2710
2751
|
u({
|
|
2711
2752
|
faceImage: "",
|
|
2712
2753
|
passed: !1,
|
|
@@ -2719,15 +2760,15 @@ function el(e) {
|
|
|
2719
2760
|
return;
|
|
2720
2761
|
}
|
|
2721
2762
|
try {
|
|
2722
|
-
const
|
|
2723
|
-
faceImage:
|
|
2724
|
-
video: new Blob(
|
|
2763
|
+
const E = await Y({
|
|
2764
|
+
faceImage: R.current,
|
|
2765
|
+
video: new Blob(I.current, { type: "video/mp4" }),
|
|
2725
2766
|
publicKey: t,
|
|
2726
2767
|
passed: !0,
|
|
2727
2768
|
metadata: d,
|
|
2728
2769
|
sessionId: _
|
|
2729
2770
|
});
|
|
2730
|
-
l(
|
|
2771
|
+
l(E), a();
|
|
2731
2772
|
} catch {
|
|
2732
2773
|
u({
|
|
2733
2774
|
faceImage: "",
|
|
@@ -2739,7 +2780,7 @@ function el(e) {
|
|
|
2739
2780
|
}
|
|
2740
2781
|
}), a();
|
|
2741
2782
|
}
|
|
2742
|
-
},
|
|
2783
|
+
}, P = async () => {
|
|
2743
2784
|
try {
|
|
2744
2785
|
if (!_)
|
|
2745
2786
|
throw new Error("sessionId is required. Provide it from your backend.");
|
|
@@ -2747,40 +2788,40 @@ function el(e) {
|
|
|
2747
2788
|
throw new Error(
|
|
2748
2789
|
"sessionToken is required. Provide it from your backend."
|
|
2749
2790
|
);
|
|
2750
|
-
await
|
|
2751
|
-
} catch (
|
|
2752
|
-
const
|
|
2791
|
+
await Q(_);
|
|
2792
|
+
} catch (D) {
|
|
2793
|
+
const V = D instanceof Error ? D.message : "Invalid or expired sessionId";
|
|
2753
2794
|
u({
|
|
2754
2795
|
faceImage: "",
|
|
2755
2796
|
passed: !1,
|
|
2756
2797
|
metadata: d,
|
|
2757
2798
|
error: {
|
|
2758
2799
|
key: "invalid_or_expired_session",
|
|
2759
|
-
message:
|
|
2800
|
+
message: V
|
|
2760
2801
|
}
|
|
2761
2802
|
});
|
|
2762
2803
|
return;
|
|
2763
2804
|
}
|
|
2764
|
-
const
|
|
2765
|
-
pr =
|
|
2805
|
+
const E = await $e.loadDetector();
|
|
2806
|
+
pr = E, C(E), M(E);
|
|
2766
2807
|
};
|
|
2767
2808
|
return H(() => {
|
|
2768
2809
|
if (hr) {
|
|
2769
|
-
|
|
2810
|
+
M(pr);
|
|
2770
2811
|
return;
|
|
2771
2812
|
}
|
|
2772
|
-
|
|
2813
|
+
P(), hr = !0;
|
|
2773
2814
|
}, []), /* @__PURE__ */ h(
|
|
2774
|
-
|
|
2815
|
+
Vo.Provider,
|
|
2775
2816
|
{
|
|
2776
2817
|
value: {
|
|
2777
2818
|
tasks: n,
|
|
2778
2819
|
namespace: o,
|
|
2779
2820
|
user: i,
|
|
2780
|
-
currentTaskIndex:
|
|
2781
|
-
completed:
|
|
2782
|
-
completedCount:
|
|
2783
|
-
nextTask:
|
|
2821
|
+
currentTaskIndex: v,
|
|
2822
|
+
completed: X,
|
|
2823
|
+
completedCount: $,
|
|
2824
|
+
nextTask: k,
|
|
2784
2825
|
branding: {
|
|
2785
2826
|
name: (s == null ? void 0 : s.name) ?? "Youverify",
|
|
2786
2827
|
color: (s == null ? void 0 : s.color) ?? void 0,
|
|
@@ -2792,15 +2833,15 @@ function el(e) {
|
|
|
2792
2833
|
poweredByLogo: (s == null ? void 0 : s.poweredByLogo) ?? "/yv_logo.svg"
|
|
2793
2834
|
},
|
|
2794
2835
|
onRequestClose: a,
|
|
2795
|
-
faceDetector:
|
|
2796
|
-
saveStream:
|
|
2797
|
-
savePhoto:
|
|
2798
|
-
clearSavedPhoto:
|
|
2836
|
+
faceDetector: S,
|
|
2837
|
+
saveStream: F,
|
|
2838
|
+
savePhoto: b,
|
|
2839
|
+
clearSavedPhoto: j,
|
|
2799
2840
|
onComplete: N,
|
|
2800
2841
|
onFailure: u,
|
|
2801
2842
|
presentation: c,
|
|
2802
|
-
imageCaptured:
|
|
2803
|
-
setImageCaptured:
|
|
2843
|
+
imageCaptured: A,
|
|
2844
|
+
setImageCaptured: W,
|
|
2804
2845
|
sandboxEnvironment: f,
|
|
2805
2846
|
publicKey: t,
|
|
2806
2847
|
isMobileAppWebView: p,
|
|
@@ -2812,29 +2853,29 @@ function el(e) {
|
|
|
2812
2853
|
);
|
|
2813
2854
|
}
|
|
2814
2855
|
function fe() {
|
|
2815
|
-
return te(
|
|
2816
|
-
}
|
|
2817
|
-
const
|
|
2818
|
-
root:
|
|
2819
|
-
container:
|
|
2820
|
-
lhs:
|
|
2821
|
-
info:
|
|
2822
|
-
active:
|
|
2823
|
-
completed:
|
|
2824
|
-
rhs:
|
|
2825
|
-
profile:
|
|
2826
|
-
avatar:
|
|
2827
|
-
main:
|
|
2828
|
-
content:
|
|
2829
|
-
},
|
|
2830
|
-
root:
|
|
2831
|
-
container:
|
|
2832
|
-
brand:
|
|
2856
|
+
return te(Vo);
|
|
2857
|
+
}
|
|
2858
|
+
const nl = "_root_vqy7d_1", rl = "_container_vqy7d_4", ol = "_lhs_vqy7d_7", il = "_info_vqy7d_11", sl = "_active_vqy7d_32", al = "_completed_vqy7d_39", ll = "_rhs_vqy7d_62", cl = "_profile_vqy7d_65", ul = "_avatar_vqy7d_68", dl = "_main_vqy7d_81", fl = "_content_vqy7d_84", ne = {
|
|
2859
|
+
root: nl,
|
|
2860
|
+
container: rl,
|
|
2861
|
+
lhs: ol,
|
|
2862
|
+
info: il,
|
|
2863
|
+
active: sl,
|
|
2864
|
+
completed: al,
|
|
2865
|
+
rhs: ll,
|
|
2866
|
+
profile: cl,
|
|
2867
|
+
avatar: ul,
|
|
2868
|
+
main: dl,
|
|
2869
|
+
content: fl
|
|
2870
|
+
}, pl = "_root_lryhb_1", hl = "_container_lryhb_1", vl = "_brand_lryhb_6", jt = {
|
|
2871
|
+
root: pl,
|
|
2872
|
+
container: hl,
|
|
2873
|
+
brand: vl
|
|
2833
2874
|
};
|
|
2834
|
-
function
|
|
2875
|
+
function ml() {
|
|
2835
2876
|
const { branding: e, isMobileAppWebView: t, onRequestClose: n, presentation: r } = fe();
|
|
2836
|
-
return /* @__PURE__ */ h("div", { className:
|
|
2837
|
-
/* @__PURE__ */ h("div", { className:
|
|
2877
|
+
return /* @__PURE__ */ h("div", { className: jt.root, children: /* @__PURE__ */ h("div", { className: jt.container, children: [
|
|
2878
|
+
/* @__PURE__ */ h("div", { className: jt.brand, children: (e == null ? void 0 : e.logo) && !(e.hideLogoOnMobile && t) && /* @__PURE__ */ h(
|
|
2838
2879
|
"img",
|
|
2839
2880
|
{
|
|
2840
2881
|
className: "yvlw-h-10",
|
|
@@ -2854,7 +2895,7 @@ function vl() {
|
|
|
2854
2895
|
] }) });
|
|
2855
2896
|
}
|
|
2856
2897
|
const vr = "colorScheme";
|
|
2857
|
-
function
|
|
2898
|
+
function jo() {
|
|
2858
2899
|
const { namespace: e } = fe(), t = () => {
|
|
2859
2900
|
const o = localStorage.getItem(vr);
|
|
2860
2901
|
return !o && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : o;
|
|
@@ -2868,22 +2909,22 @@ function Vo() {
|
|
|
2868
2909
|
return n(o === "dark" ? "light" : "dark");
|
|
2869
2910
|
}, getColorScheme: t };
|
|
2870
2911
|
}
|
|
2871
|
-
const
|
|
2872
|
-
root:
|
|
2912
|
+
const _l = "_root_bcsvc_1", yl = {
|
|
2913
|
+
root: _l
|
|
2873
2914
|
};
|
|
2874
|
-
function
|
|
2915
|
+
function gl() {
|
|
2875
2916
|
if (!(window.screen.width >= 900))
|
|
2876
2917
|
return 10 / 9;
|
|
2877
2918
|
}
|
|
2878
2919
|
function ut(e) {
|
|
2879
2920
|
const { children: t, onStream: n = () => {
|
|
2880
2921
|
}, onRecord: r = () => {
|
|
2881
|
-
} } = e, o = w(null), i = w(0), s = w(null), { start: a, stop: l } =
|
|
2922
|
+
} } = e, o = w(null), i = w(0), s = w(null), { start: a, stop: l } = zo({
|
|
2882
2923
|
onRecord: r
|
|
2883
2924
|
}), u = async () => {
|
|
2884
2925
|
try {
|
|
2885
2926
|
const f = await navigator.mediaDevices.getUserMedia({
|
|
2886
|
-
video: { aspectRatio: { exact:
|
|
2927
|
+
video: { aspectRatio: { exact: gl() } }
|
|
2887
2928
|
});
|
|
2888
2929
|
s.current = f, a(f), o.current && (o.current.srcObject = f);
|
|
2889
2930
|
} catch {
|
|
@@ -2903,25 +2944,25 @@ function ut(e) {
|
|
|
2903
2944
|
return u(), f.addEventListener("canplay", p), () => {
|
|
2904
2945
|
f.removeEventListener("canplay", p), cancelAnimationFrame(i.current), d();
|
|
2905
2946
|
};
|
|
2906
|
-
}, []), /* @__PURE__ */ h("div", { className:
|
|
2947
|
+
}, []), /* @__PURE__ */ h("div", { className: yl.root, children: [
|
|
2907
2948
|
/* @__PURE__ */ h("video", { ref: o, autoPlay: !0, loop: !0, playsInline: !0 }),
|
|
2908
2949
|
t
|
|
2909
2950
|
] });
|
|
2910
2951
|
}
|
|
2911
|
-
const
|
|
2912
|
-
container:
|
|
2913
|
-
focused:
|
|
2914
|
-
progress:
|
|
2915
|
-
completed:
|
|
2916
|
-
marker:
|
|
2917
|
-
}, mr = 360,
|
|
2918
|
-
function
|
|
2952
|
+
const wl = "_container_mcmsr_1", bl = "_focused_mcmsr_12", El = "_progress_mcmsr_15", $l = "_completed_mcmsr_36", Tl = "_marker_mcmsr_40", Ke = {
|
|
2953
|
+
container: wl,
|
|
2954
|
+
focused: bl,
|
|
2955
|
+
progress: El,
|
|
2956
|
+
completed: $l,
|
|
2957
|
+
marker: Tl
|
|
2958
|
+
}, mr = 360, kl = 50;
|
|
2959
|
+
function Sl(e) {
|
|
2919
2960
|
const {
|
|
2920
2961
|
visitedSections: t,
|
|
2921
2962
|
sectionsCount: n,
|
|
2922
2963
|
faceDetected: r,
|
|
2923
|
-
divisions: o =
|
|
2924
|
-
} = e, i =
|
|
2964
|
+
divisions: o = kl
|
|
2965
|
+
} = e, i = z(() => {
|
|
2925
2966
|
const s = [Ke.container];
|
|
2926
2967
|
return r && s.push(Ke.focused), s.join(" ");
|
|
2927
2968
|
}, [r]);
|
|
@@ -2994,7 +3035,7 @@ function Bo() {
|
|
|
2994
3035
|
throw new Error("Position head in frame");
|
|
2995
3036
|
} };
|
|
2996
3037
|
}
|
|
2997
|
-
function
|
|
3038
|
+
function It(e = {}) {
|
|
2998
3039
|
const {
|
|
2999
3040
|
validations: t = ["zoom"],
|
|
3000
3041
|
frameSize: n,
|
|
@@ -3062,7 +3103,7 @@ function Rt(e = {}) {
|
|
|
3062
3103
|
const { videoWidth: y, videoHeight: m } = _;
|
|
3063
3104
|
if (y === 0 || m === 0)
|
|
3064
3105
|
return;
|
|
3065
|
-
const v =
|
|
3106
|
+
const v = Rn(
|
|
3066
3107
|
_,
|
|
3067
3108
|
y,
|
|
3068
3109
|
m
|
|
@@ -3071,23 +3112,23 @@ function Rt(e = {}) {
|
|
|
3071
3112
|
d(g.faces);
|
|
3072
3113
|
} };
|
|
3073
3114
|
}
|
|
3074
|
-
const
|
|
3075
|
-
root:
|
|
3115
|
+
const Cl = "_root_5hgaj_1", Fl = "_container_5hgaj_4", xl = "_progress_5hgaj_7", Ml = "_intro_5hgaj_12", Pl = "_content_5hgaj_15", Nl = "_branding_5hgaj_18", Ll = "_instructionsContainer_5hgaj_22", Al = "_instructions_5hgaj_22", se = {
|
|
3116
|
+
root: Cl,
|
|
3076
3117
|
container: Fl,
|
|
3077
|
-
progress:
|
|
3078
|
-
intro:
|
|
3079
|
-
content:
|
|
3080
|
-
branding:
|
|
3081
|
-
instructionsContainer:
|
|
3082
|
-
instructions:
|
|
3083
|
-
},
|
|
3084
|
-
root:
|
|
3118
|
+
progress: xl,
|
|
3119
|
+
intro: Ml,
|
|
3120
|
+
content: Pl,
|
|
3121
|
+
branding: Nl,
|
|
3122
|
+
instructionsContainer: Ll,
|
|
3123
|
+
instructions: Al
|
|
3124
|
+
}, Rl = "_root_h5elg_1", Il = "_spinner_h5elg_22", _r = {
|
|
3125
|
+
root: Rl,
|
|
3085
3126
|
spinner: Il
|
|
3086
|
-
},
|
|
3087
|
-
container:
|
|
3088
|
-
spin:
|
|
3089
|
-
md:
|
|
3090
|
-
lg:
|
|
3127
|
+
}, Dl = "_container_1vep2_1", Ol = "_spin_1vep2_1", Hl = "_md_1vep2_7", Wl = "_lg_1vep2_10", yr = {
|
|
3128
|
+
container: Dl,
|
|
3129
|
+
spin: Ol,
|
|
3130
|
+
md: Hl,
|
|
3131
|
+
lg: Wl
|
|
3091
3132
|
};
|
|
3092
3133
|
function qo(e) {
|
|
3093
3134
|
const { size: t = "md", message: n, className: r = "" } = e;
|
|
@@ -3136,7 +3177,7 @@ function Dt(e) {
|
|
|
3136
3177
|
},
|
|
3137
3178
|
onReset: s = () => {
|
|
3138
3179
|
}
|
|
3139
|
-
} = e, [a, l] =
|
|
3180
|
+
} = e, [a, l] = x(!1), { completedCount: u, tasks: d, nextTask: c, branding: f, isMobileAppWebView: p } = fe(), _ = z(
|
|
3140
3181
|
() => u * 100 / d.length,
|
|
3141
3182
|
[u, d.length]
|
|
3142
3183
|
);
|
|
@@ -3205,7 +3246,7 @@ function Dt(e) {
|
|
|
3205
3246
|
children: /* @__PURE__ */ h("div", { className: `${se.intro}`, children: /* @__PURE__ */ h(
|
|
3206
3247
|
$t,
|
|
3207
3248
|
{
|
|
3208
|
-
Icon:
|
|
3249
|
+
Icon: Uo,
|
|
3209
3250
|
title: "Oops, task failed!",
|
|
3210
3251
|
description: "Could not confirm liveness on this task. Click on the button below to go again",
|
|
3211
3252
|
onActionClick: s,
|
|
@@ -3218,7 +3259,7 @@ function Dt(e) {
|
|
|
3218
3259
|
}
|
|
3219
3260
|
function Ot(e = {}) {
|
|
3220
3261
|
const { timeout: t, onTimeout: n = () => {
|
|
3221
|
-
} } = e, [r, o] =
|
|
3262
|
+
} } = e, [r, o] = x(!1), i = w(null), s = U(() => {
|
|
3222
3263
|
t && i.current && clearTimeout(i.current);
|
|
3223
3264
|
}, []), a = U(() => {
|
|
3224
3265
|
t && (i.current = setTimeout(() => {
|
|
@@ -3234,24 +3275,24 @@ function Ot(e = {}) {
|
|
|
3234
3275
|
stop: s
|
|
3235
3276
|
};
|
|
3236
3277
|
}
|
|
3237
|
-
const
|
|
3278
|
+
const Ul = 1, Bt = 8, Er = "Place face in frame";
|
|
3238
3279
|
function zl(e) {
|
|
3239
|
-
const { difficulty: t, timeout: n } = e, { saveStream: r } = fe(), [o, i] =
|
|
3280
|
+
const { difficulty: t, timeout: n } = e, { saveStream: r } = fe(), [o, i] = x([]), [s, a] = x(Er), [l, u] = x(!1), [d, c] = x(!1), f = w(/* @__PURE__ */ new Set()), p = w(!1), _ = w(null), {
|
|
3240
3281
|
reset: y,
|
|
3241
3282
|
start: m,
|
|
3242
3283
|
stop: v,
|
|
3243
3284
|
timedOut: g
|
|
3244
3285
|
} = Ot({ timeout: n }), $ = () => {
|
|
3245
3286
|
i([]), a(Er), u(!1), c(!1), f.current = /* @__PURE__ */ new Set(), p.current = !1, _.current = null, y();
|
|
3246
|
-
}, T = (
|
|
3247
|
-
const
|
|
3248
|
-
f.current.has(
|
|
3287
|
+
}, T = (b) => {
|
|
3288
|
+
const R = b * Bt, j = Math.ceil((R + 1) / Xa);
|
|
3289
|
+
f.current.has(j) || (f.current.add(j), i(Array.from(f.current))), f.current.size >= Bt && (v(), setTimeout(() => {
|
|
3249
3290
|
c(!0);
|
|
3250
3291
|
}, 1e3));
|
|
3251
|
-
}, S = (
|
|
3252
|
-
let I = Math.atan2(
|
|
3292
|
+
}, S = (b, R) => {
|
|
3293
|
+
let I = Math.atan2(R, b) * (180 / Math.PI);
|
|
3253
3294
|
return I < 0 && (I += 360), I;
|
|
3254
|
-
},
|
|
3295
|
+
}, M = U(() => {
|
|
3255
3296
|
if (f.current.size === 0)
|
|
3256
3297
|
return 25;
|
|
3257
3298
|
switch (t) {
|
|
@@ -3262,19 +3303,19 @@ function zl(e) {
|
|
|
3262
3303
|
default:
|
|
3263
3304
|
return 10;
|
|
3264
3305
|
}
|
|
3265
|
-
}, []),
|
|
3266
|
-
const { keypoints:
|
|
3267
|
-
return Math.abs(
|
|
3268
|
-
}, { detectFaces: W } =
|
|
3306
|
+
}, []), A = (b) => {
|
|
3307
|
+
const { keypoints: R, box: j } = b, I = { x: j.width * 0.5, y: j.height * 0.5 }, Y = R[Ul], Q = { y: Y.y - j.yMin, x: Y.x - j.xMin }, X = I.x - Q.x, k = Q.y - I.y, C = M();
|
|
3308
|
+
return Math.abs(X) < C && Math.abs(k) < C ? null : S(X, k);
|
|
3309
|
+
}, { detectFaces: W } = It({
|
|
3269
3310
|
frameSize: 280,
|
|
3270
3311
|
validations: ["zoom", "in-frame"],
|
|
3271
|
-
onFace: (
|
|
3312
|
+
onFace: (b) => {
|
|
3272
3313
|
u(!0), a("Slowly move head around to complete circle");
|
|
3273
|
-
const
|
|
3274
|
-
|
|
3314
|
+
const R = A(b);
|
|
3315
|
+
R && T(R);
|
|
3275
3316
|
},
|
|
3276
|
-
onError: (
|
|
3277
|
-
a(
|
|
3317
|
+
onError: (b) => {
|
|
3318
|
+
a(b), i([]), f.current.clear(), _.current = null, p.current = !1;
|
|
3278
3319
|
}
|
|
3279
3320
|
});
|
|
3280
3321
|
return /* @__PURE__ */ h(q, { children: /* @__PURE__ */ h(
|
|
@@ -3289,16 +3330,16 @@ function zl(e) {
|
|
|
3289
3330
|
failed: g,
|
|
3290
3331
|
onReset: $,
|
|
3291
3332
|
onStart: m,
|
|
3292
|
-
children: /* @__PURE__ */ h(ut, { onStream: (
|
|
3333
|
+
children: /* @__PURE__ */ h(ut, { onStream: (b) => {
|
|
3293
3334
|
try {
|
|
3294
|
-
if (!
|
|
3335
|
+
if (!b.current || d)
|
|
3295
3336
|
return;
|
|
3296
|
-
const { videoWidth:
|
|
3297
|
-
W({ ref:
|
|
3337
|
+
const { videoWidth: R } = b.current;
|
|
3338
|
+
W({ ref: b, frameSize: R });
|
|
3298
3339
|
} catch {
|
|
3299
3340
|
}
|
|
3300
3341
|
}, onRecord: r, children: /* @__PURE__ */ h(
|
|
3301
|
-
|
|
3342
|
+
Sl,
|
|
3302
3343
|
{
|
|
3303
3344
|
faceDetected: l,
|
|
3304
3345
|
sectionsCount: Bt,
|
|
@@ -3308,13 +3349,13 @@ function zl(e) {
|
|
|
3308
3349
|
}
|
|
3309
3350
|
) });
|
|
3310
3351
|
}
|
|
3311
|
-
const
|
|
3312
|
-
root:
|
|
3352
|
+
const Vl = "_root_thujo_1", jl = "_sticker_thujo_4", Bl = "_no_thujo_7", ql = "_yes_thujo_12", qt = {
|
|
3353
|
+
root: Vl,
|
|
3313
3354
|
sticker: jl,
|
|
3314
|
-
no:
|
|
3315
|
-
yes:
|
|
3355
|
+
no: Bl,
|
|
3356
|
+
yes: ql
|
|
3316
3357
|
};
|
|
3317
|
-
function
|
|
3358
|
+
function Yl(e) {
|
|
3318
3359
|
const { show: t, stickers: n } = e;
|
|
3319
3360
|
return /* @__PURE__ */ h(q, { children: t && /* @__PURE__ */ h("div", { className: qt.root, children: n.map((r) => /* @__PURE__ */ h(
|
|
3320
3361
|
"div",
|
|
@@ -3325,13 +3366,13 @@ function ql(e) {
|
|
|
3325
3366
|
`sticker-${r}`
|
|
3326
3367
|
)) }) });
|
|
3327
3368
|
}
|
|
3328
|
-
const
|
|
3369
|
+
const Gl = {
|
|
3329
3370
|
question: "Are you alive?",
|
|
3330
3371
|
errorMessage: "You have to be alive to proceed though",
|
|
3331
3372
|
answer: !0
|
|
3332
|
-
},
|
|
3333
|
-
function
|
|
3334
|
-
const { difficulty: t, questions: n = [
|
|
3373
|
+
}, Kl = "Wrong answer. Try again", $r = "Keep face in camera";
|
|
3374
|
+
function Xl(e) {
|
|
3375
|
+
const { difficulty: t, questions: n = [Gl], timeout: r } = e, [o, i] = x($r), [s, a] = x(!1), [l, u] = x(!1), { saveStream: d } = fe(), c = w("inactive"), f = w(0), p = w(!1), _ = w(null), y = w(null), m = w(null), v = () => {
|
|
3335
3376
|
_.current && clearTimeout(_.current), y.current && clearTimeout(y.current);
|
|
3336
3377
|
}, {
|
|
3337
3378
|
reset: g,
|
|
@@ -3341,16 +3382,16 @@ function Kl(e) {
|
|
|
3341
3382
|
} = Ot({
|
|
3342
3383
|
timeout: r,
|
|
3343
3384
|
onTimeout: v
|
|
3344
|
-
}),
|
|
3385
|
+
}), M = () => {
|
|
3345
3386
|
i($r), a(!1), u(!1), c.current = "inactive", f.current = 0, p.current = !1, g();
|
|
3346
|
-
},
|
|
3347
|
-
const { keypoints:
|
|
3348
|
-
return 90 - Math.atan2(
|
|
3387
|
+
}, A = (I) => {
|
|
3388
|
+
const { keypoints: Y } = I, Q = Y[1], X = Y[9], k = Q.x - X.x, C = Q.y - X.y;
|
|
3389
|
+
return 90 - Math.atan2(C, k) * (180 / Math.PI);
|
|
3349
3390
|
}, W = (I) => {
|
|
3350
3391
|
c.current = "inactive", i(n[I].question), _.current = setTimeout(() => {
|
|
3351
3392
|
c.current = "active";
|
|
3352
3393
|
}, 2e3);
|
|
3353
|
-
}, F =
|
|
3394
|
+
}, F = z(() => {
|
|
3354
3395
|
switch (t) {
|
|
3355
3396
|
case "easy":
|
|
3356
3397
|
return 2;
|
|
@@ -3359,39 +3400,39 @@ function Kl(e) {
|
|
|
3359
3400
|
default:
|
|
3360
3401
|
return 4;
|
|
3361
3402
|
}
|
|
3362
|
-
}, []),
|
|
3403
|
+
}, []), b = (I) => {
|
|
3363
3404
|
try {
|
|
3364
3405
|
if (c.current = "inactive", Math.abs(I) < F)
|
|
3365
3406
|
throw new Error("Tilt head further to answer");
|
|
3366
|
-
const
|
|
3367
|
-
if (
|
|
3407
|
+
const Y = I > 0, Q = n[f.current].answer;
|
|
3408
|
+
if (Y === Q)
|
|
3368
3409
|
f.current += 1, f.current === n.length ? (u(!0), T()) : W(f.current);
|
|
3369
3410
|
else
|
|
3370
3411
|
throw new Error(
|
|
3371
|
-
n[f.current].errorMessage ||
|
|
3412
|
+
n[f.current].errorMessage || Kl
|
|
3372
3413
|
);
|
|
3373
|
-
} catch (
|
|
3374
|
-
i(
|
|
3414
|
+
} catch (Y) {
|
|
3415
|
+
i(Y.message), y.current = setTimeout(() => {
|
|
3375
3416
|
W(f.current);
|
|
3376
3417
|
}, 2e3);
|
|
3377
3418
|
}
|
|
3378
|
-
}, { detectFaces:
|
|
3419
|
+
}, { detectFaces: R } = It({
|
|
3379
3420
|
onFace: (I) => {
|
|
3380
3421
|
if (p.current || (a(!0), p.current = !0, W(f.current)), c.current === "inactive")
|
|
3381
3422
|
return;
|
|
3382
|
-
const
|
|
3383
|
-
|
|
3423
|
+
const Y = A(I);
|
|
3424
|
+
b(Y);
|
|
3384
3425
|
},
|
|
3385
3426
|
onError: (I) => {
|
|
3386
3427
|
i(I);
|
|
3387
3428
|
}
|
|
3388
|
-
}),
|
|
3429
|
+
}), j = (I) => {
|
|
3389
3430
|
try {
|
|
3390
3431
|
if (!I.current || l)
|
|
3391
3432
|
return;
|
|
3392
3433
|
m.current = I.current;
|
|
3393
|
-
const { videoWidth:
|
|
3394
|
-
|
|
3434
|
+
const { videoWidth: Y } = I.current;
|
|
3435
|
+
R({ ref: I, frameSize: Y });
|
|
3395
3436
|
} catch {
|
|
3396
3437
|
}
|
|
3397
3438
|
};
|
|
@@ -3404,14 +3445,14 @@ function Kl(e) {
|
|
|
3404
3445
|
},
|
|
3405
3446
|
name: "yes-or-no",
|
|
3406
3447
|
failed: S,
|
|
3407
|
-
onReset:
|
|
3448
|
+
onReset: M,
|
|
3408
3449
|
onStart: $,
|
|
3409
3450
|
completed: l,
|
|
3410
|
-
children: /* @__PURE__ */ h(ut, { onStream:
|
|
3451
|
+
children: /* @__PURE__ */ h(ut, { onStream: j, onRecord: d, children: /* @__PURE__ */ h(Yl, { show: s, stickers: ["yes", "no"] }) })
|
|
3411
3452
|
}
|
|
3412
3453
|
);
|
|
3413
3454
|
}
|
|
3414
|
-
function
|
|
3455
|
+
function Zl(e = {}) {
|
|
3415
3456
|
const { onChange: t = () => {
|
|
3416
3457
|
} } = e, n = !!window.DeviceOrientationEvent, r = (o) => {
|
|
3417
3458
|
t({
|
|
@@ -3426,10 +3467,10 @@ function Xl(e = {}) {
|
|
|
3426
3467
|
canUse: n
|
|
3427
3468
|
};
|
|
3428
3469
|
}
|
|
3429
|
-
function
|
|
3470
|
+
function Ve(e, t) {
|
|
3430
3471
|
return Math.sqrt(e ** 2 + t ** 2);
|
|
3431
3472
|
}
|
|
3432
|
-
function
|
|
3473
|
+
function Jl(e) {
|
|
3433
3474
|
const t = e.slice();
|
|
3434
3475
|
for (let n = t.length - 1; n > 0; n--) {
|
|
3435
3476
|
const r = Math.floor(Math.random() * (n + 1));
|
|
@@ -3437,11 +3478,11 @@ function Zl(e) {
|
|
|
3437
3478
|
}
|
|
3438
3479
|
return t;
|
|
3439
3480
|
}
|
|
3440
|
-
const
|
|
3481
|
+
const Ce = (e, t) => {
|
|
3441
3482
|
for (const [n, r] of Object.entries(e))
|
|
3442
3483
|
if (r === t) return n;
|
|
3443
3484
|
return null;
|
|
3444
|
-
},
|
|
3485
|
+
}, Ql = (e) => {
|
|
3445
3486
|
const t = Object.keys(fr);
|
|
3446
3487
|
for (const n of t)
|
|
3447
3488
|
if (new RegExp(`\\b${n}\\b`, "i").test(e))
|
|
@@ -3451,8 +3492,8 @@ const Fe = (e, t) => {
|
|
|
3451
3492
|
message: "We detected an error during your test. Please TRY AGAIN"
|
|
3452
3493
|
};
|
|
3453
3494
|
};
|
|
3454
|
-
function
|
|
3455
|
-
const { total: t, onMessage: n, onComplete: r, difficulty: o } = e, i = w(null), s = w(!0), a = w(null), l = w(null), u = w(0), d = w(!1), c =
|
|
3495
|
+
function ec(e) {
|
|
3496
|
+
const { total: t, onMessage: n, onComplete: r, difficulty: o } = e, i = w(null), s = w(!0), a = w(null), l = w(null), u = w(0), d = w(!1), c = z(() => {
|
|
3456
3497
|
switch (o) {
|
|
3457
3498
|
case "easy":
|
|
3458
3499
|
return 6;
|
|
@@ -3471,7 +3512,7 @@ function Ql(e) {
|
|
|
3471
3512
|
d.current = !0, n("Great, hang on..."), setTimeout(() => {
|
|
3472
3513
|
r();
|
|
3473
3514
|
}, 500);
|
|
3474
|
-
}, { canUse: p } =
|
|
3515
|
+
}, { canUse: p } = Zl({
|
|
3475
3516
|
onChange: (m) => {
|
|
3476
3517
|
l.current = m;
|
|
3477
3518
|
}
|
|
@@ -3491,10 +3532,10 @@ function Ql(e) {
|
|
|
3491
3532
|
}
|
|
3492
3533
|
if (d.current)
|
|
3493
3534
|
return;
|
|
3494
|
-
const { keypoints: v } = m, g =
|
|
3535
|
+
const { keypoints: v } = m, g = Ve(
|
|
3495
3536
|
v[6].x - v[8].x,
|
|
3496
3537
|
v[6].y - v[8].y
|
|
3497
|
-
), T =
|
|
3538
|
+
), T = Ve(
|
|
3498
3539
|
v[2].x - v[1].x,
|
|
3499
3540
|
v[2].y - v[1].y
|
|
3500
3541
|
) / g * 10;
|
|
@@ -3511,8 +3552,8 @@ function Ql(e) {
|
|
|
3511
3552
|
i.current = null, s.current = !0, a.current = null, l.current = null, u.current = 0, d.current = !1;
|
|
3512
3553
|
} };
|
|
3513
3554
|
}
|
|
3514
|
-
function
|
|
3515
|
-
const { onMessage: t, onComplete: n, difficulty: r } = e, o = w(!1), i =
|
|
3555
|
+
function tc(e) {
|
|
3556
|
+
const { onMessage: t, onComplete: n, difficulty: r } = e, o = w(!1), i = z(() => {
|
|
3516
3557
|
switch (r) {
|
|
3517
3558
|
case "easy":
|
|
3518
3559
|
return 80;
|
|
@@ -3525,11 +3566,11 @@ function ec(e) {
|
|
|
3525
3566
|
return { evaluate: (l) => {
|
|
3526
3567
|
if (o.current)
|
|
3527
3568
|
return;
|
|
3528
|
-
const { keypoints: u } = l, d =
|
|
3569
|
+
const { keypoints: u } = l, d = Ve(
|
|
3529
3570
|
u[6].x - u[8].x,
|
|
3530
3571
|
u[6].y - u[8].y
|
|
3531
3572
|
);
|
|
3532
|
-
if (
|
|
3573
|
+
if (Ve(
|
|
3533
3574
|
u[14].x - u[13].x,
|
|
3534
3575
|
u[14].y - u[13].y
|
|
3535
3576
|
) / d * 100 > i) {
|
|
@@ -3544,7 +3585,7 @@ function ec(e) {
|
|
|
3544
3585
|
} };
|
|
3545
3586
|
}
|
|
3546
3587
|
function Yo(e) {
|
|
3547
|
-
const { total: t, onMessage: n, onComplete: r, difficulty: o } = e, i = w(!0), s = w(!1), a = w(null), l = w(0), u =
|
|
3588
|
+
const { total: t, onMessage: n, onComplete: r, difficulty: o } = e, i = w(!0), s = w(!1), a = w(null), l = w(0), u = z(() => {
|
|
3548
3589
|
switch (o) {
|
|
3549
3590
|
case "easy":
|
|
3550
3591
|
return {
|
|
@@ -3583,10 +3624,10 @@ function Yo(e) {
|
|
|
3583
3624
|
return { evaluate: (y) => {
|
|
3584
3625
|
if (s.current)
|
|
3585
3626
|
return;
|
|
3586
|
-
const { keypoints: m } = y, v =
|
|
3627
|
+
const { keypoints: m } = y, v = Ve(
|
|
3587
3628
|
m[6].x - m[8].x,
|
|
3588
3629
|
m[6].y - m[8].y
|
|
3589
|
-
), $ =
|
|
3630
|
+
), $ = Ve(
|
|
3590
3631
|
m[145].x - m[159].x,
|
|
3591
3632
|
m[145].y - m[159].y
|
|
3592
3633
|
) / v * 100;
|
|
@@ -3596,9 +3637,9 @@ function Yo(e) {
|
|
|
3596
3637
|
} };
|
|
3597
3638
|
}
|
|
3598
3639
|
var Go = /* @__PURE__ */ ((e) => (e.open_mouth = "open_mouth", e.blink = "blink", e))(Go || {});
|
|
3599
|
-
const Tr =
|
|
3600
|
-
function
|
|
3601
|
-
const { difficulty: t, maxBlinks: n = 3, maxNods: r = 3, timeout: o } = e, i = w(0), [s, a] =
|
|
3640
|
+
const Tr = Jl(Object.keys(Go)), kr = "Keep face in camera";
|
|
3641
|
+
function nc(e) {
|
|
3642
|
+
const { difficulty: t, maxBlinks: n = 3, maxNods: r = 3, timeout: o } = e, i = w(0), [s, a] = x(kr), [l, u] = x(!1), [d, c] = x(null), f = w(!1), { saveStream: p } = fe(), {
|
|
3602
3643
|
reset: _,
|
|
3603
3644
|
start: y,
|
|
3604
3645
|
stop: m,
|
|
@@ -3609,42 +3650,42 @@ function tc(e) {
|
|
|
3609
3650
|
return;
|
|
3610
3651
|
}
|
|
3611
3652
|
i.current += 1;
|
|
3612
|
-
}, $ =
|
|
3653
|
+
}, $ = ec({
|
|
3613
3654
|
total: Math.floor(Math.random() * r + 1),
|
|
3614
3655
|
difficulty: t,
|
|
3615
|
-
onMessage: (
|
|
3656
|
+
onMessage: (b) => a(b),
|
|
3616
3657
|
onComplete: g
|
|
3617
|
-
}), T =
|
|
3658
|
+
}), T = tc({
|
|
3618
3659
|
difficulty: t,
|
|
3619
|
-
onMessage: (
|
|
3660
|
+
onMessage: (b) => a(b),
|
|
3620
3661
|
onComplete: g
|
|
3621
3662
|
}), S = Yo({
|
|
3622
3663
|
total: Math.floor(Math.random() * n + 1),
|
|
3623
3664
|
difficulty: t,
|
|
3624
|
-
onMessage: (
|
|
3665
|
+
onMessage: (b) => a(b),
|
|
3625
3666
|
onComplete: g
|
|
3626
|
-
}), { detectFaces:
|
|
3627
|
-
onFace: (
|
|
3667
|
+
}), { detectFaces: M } = It({
|
|
3668
|
+
onFace: (b) => {
|
|
3628
3669
|
switch (f.current || (f.current = !0), Tr[i.current]) {
|
|
3629
3670
|
case "open_mouth":
|
|
3630
|
-
T.evaluate(
|
|
3671
|
+
T.evaluate(b);
|
|
3631
3672
|
break;
|
|
3632
3673
|
case "blink":
|
|
3633
|
-
S.evaluate(
|
|
3674
|
+
S.evaluate(b);
|
|
3634
3675
|
break;
|
|
3635
3676
|
}
|
|
3636
3677
|
},
|
|
3637
|
-
onError: (
|
|
3638
|
-
a(
|
|
3678
|
+
onError: (b) => {
|
|
3679
|
+
a(b);
|
|
3639
3680
|
}
|
|
3640
|
-
}),
|
|
3681
|
+
}), A = () => {
|
|
3641
3682
|
i.current = 0, a(kr), u(!1), f.current = !1, S.reset(), $.reset(), T.reset(), _();
|
|
3642
|
-
}, W = async (
|
|
3683
|
+
}, W = async (b) => {
|
|
3643
3684
|
try {
|
|
3644
|
-
if (!
|
|
3685
|
+
if (!b.current || l)
|
|
3645
3686
|
return;
|
|
3646
|
-
const { videoWidth:
|
|
3647
|
-
await
|
|
3687
|
+
const { videoWidth: R } = b.current;
|
|
3688
|
+
await M({ ref: b, frameSize: R, throttleInterval: 500 });
|
|
3648
3689
|
} catch {
|
|
3649
3690
|
}
|
|
3650
3691
|
}, F = async () => {
|
|
@@ -3658,7 +3699,7 @@ function tc(e) {
|
|
|
3658
3699
|
},
|
|
3659
3700
|
name: "motions",
|
|
3660
3701
|
failed: v,
|
|
3661
|
-
onReset:
|
|
3702
|
+
onReset: A,
|
|
3662
3703
|
completed: l,
|
|
3663
3704
|
onStart: async () => {
|
|
3664
3705
|
await F(), y();
|
|
@@ -3668,8 +3709,8 @@ function tc(e) {
|
|
|
3668
3709
|
);
|
|
3669
3710
|
}
|
|
3670
3711
|
const Sr = "Keep face in camera";
|
|
3671
|
-
function
|
|
3672
|
-
const { difficulty: t, maxBlinks: n = 3, timeout: r } = e, [o, i] =
|
|
3712
|
+
function rc(e) {
|
|
3713
|
+
const { difficulty: t, maxBlinks: n = 3, timeout: r } = e, [o, i] = x(Sr), [s, a] = x(!1), [l, u] = x(null), d = w(!1), { saveStream: c } = fe(), {
|
|
3673
3714
|
reset: f,
|
|
3674
3715
|
start: p,
|
|
3675
3716
|
stop: _,
|
|
@@ -3679,23 +3720,23 @@ function nc(e) {
|
|
|
3679
3720
|
}, v = Yo({
|
|
3680
3721
|
total: Math.floor(Math.random() * n + 1),
|
|
3681
3722
|
difficulty: t,
|
|
3682
|
-
onMessage: (
|
|
3723
|
+
onMessage: (M) => i(M),
|
|
3683
3724
|
onComplete: m
|
|
3684
|
-
}), { detectFaces: g } =
|
|
3685
|
-
onFace: (
|
|
3686
|
-
d.current || (d.current = !0), v.evaluate(
|
|
3725
|
+
}), { detectFaces: g } = It({
|
|
3726
|
+
onFace: (M) => {
|
|
3727
|
+
d.current || (d.current = !0), v.evaluate(M);
|
|
3687
3728
|
},
|
|
3688
|
-
onError: (
|
|
3689
|
-
i(
|
|
3729
|
+
onError: (M) => {
|
|
3730
|
+
i(M);
|
|
3690
3731
|
}
|
|
3691
3732
|
}), $ = () => {
|
|
3692
3733
|
i(Sr), a(!1), d.current = !1, v.reset(), f();
|
|
3693
|
-
}, T = async (
|
|
3734
|
+
}, T = async (M) => {
|
|
3694
3735
|
try {
|
|
3695
|
-
if (!
|
|
3736
|
+
if (!M.current || s)
|
|
3696
3737
|
return;
|
|
3697
|
-
const { videoWidth:
|
|
3698
|
-
await g({ ref:
|
|
3738
|
+
const { videoWidth: A } = M.current;
|
|
3739
|
+
await g({ ref: M, frameSize: A });
|
|
3699
3740
|
} catch {
|
|
3700
3741
|
}
|
|
3701
3742
|
}, S = async () => {
|
|
@@ -3722,23 +3763,23 @@ const Yt = {
|
|
|
3722
3763
|
LEFT_EYE: [36, 37, 38, 39, 40, 41],
|
|
3723
3764
|
RIGHT_EYE: [42, 43, 44, 45, 46, 47],
|
|
3724
3765
|
MOUTH: [48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59]
|
|
3725
|
-
}, mt = (e, t) => Math.sqrt((e.x - t.x) ** 2 + (e.y - t.y) ** 2),
|
|
3766
|
+
}, mt = (e, t) => Math.sqrt((e.x - t.x) ** 2 + (e.y - t.y) ** 2), Cr = (e) => {
|
|
3726
3767
|
if (e.length !== 6) return 0;
|
|
3727
3768
|
const t = mt(e[1], e[5]), n = mt(e[2], e[4]), r = mt(e[0], e[3]);
|
|
3728
3769
|
return (t + n) / (2 * r);
|
|
3729
|
-
},
|
|
3770
|
+
}, oc = (e) => {
|
|
3730
3771
|
if (e.length < 12) return 0;
|
|
3731
3772
|
const t = e[9], n = e[3];
|
|
3732
3773
|
return mt(t, n);
|
|
3733
|
-
},
|
|
3774
|
+
}, ic = (e, t, n, r) => {
|
|
3734
3775
|
var c, f, p;
|
|
3735
3776
|
let o = !0, i = !0;
|
|
3736
3777
|
if (!r) {
|
|
3737
3778
|
const m = Yt.LEFT_EYE.map(
|
|
3738
|
-
(
|
|
3779
|
+
(A) => e[A]
|
|
3739
3780
|
), v = Yt.RIGHT_EYE.map(
|
|
3740
|
-
(
|
|
3741
|
-
), g = Yt.MOUTH.map((
|
|
3781
|
+
(A) => e[A]
|
|
3782
|
+
), g = Yt.MOUTH.map((A) => e[A]), $ = Cr(m), T = Cr(v), S = oc(g);
|
|
3742
3783
|
o = ($ + T) / 2 > 1, i = S < 73.24, o || t("Please look at the camera!"), i || t("Please close your mouth!");
|
|
3743
3784
|
}
|
|
3744
3785
|
const s = 0.5, a = 0.12, l = ((c = r == null ? void 0 : r.find((_) => _.categoryName === "eyeBlinkLeft")) == null ? void 0 : c.score) ?? 0, u = ((f = r == null ? void 0 : r.find((_) => _.categoryName === "eyeBlinkRight")) == null ? void 0 : f.score) ?? 0, d = ((p = r == null ? void 0 : r.find((_) => _.categoryName === "jawOpen")) == null ? void 0 : p.score) ?? 0;
|
|
@@ -3747,7 +3788,7 @@ const Yt = {
|
|
|
3747
3788
|
mouthClosed: i
|
|
3748
3789
|
};
|
|
3749
3790
|
};
|
|
3750
|
-
function
|
|
3791
|
+
function sc(e = {}) {
|
|
3751
3792
|
const {
|
|
3752
3793
|
validations: t = ["zoom", "in-frame"],
|
|
3753
3794
|
frameSize: n,
|
|
@@ -3760,54 +3801,54 @@ function ic(e = {}) {
|
|
|
3760
3801
|
livenessTimeout: s
|
|
3761
3802
|
} = e, { faceDetector: a, savePhoto: l } = fe(), { checkFacialFeatures: u, checkZoomLevel: d, checkInFrame: c } = Bo(), f = w(null), p = w(null), _ = w(!1), y = w(null), m = w(!1), v = w([]), g = U(() => {
|
|
3762
3803
|
p.current && clearTimeout(p.current), y.current && clearTimeout(y.current), v.current.forEach(clearTimeout), m.current = !1, _.current = !0;
|
|
3763
|
-
}, []), $ = w(null), T = w(null), S = w([]),
|
|
3804
|
+
}, []), $ = w(null), T = w(null), S = w([]), M = 10, A = 7.5, W = 2, F = w({
|
|
3764
3805
|
sharpness: 0,
|
|
3765
3806
|
data: null
|
|
3766
|
-
}),
|
|
3767
|
-
const
|
|
3768
|
-
if (!
|
|
3807
|
+
}), b = (k, C) => {
|
|
3808
|
+
const N = k.getContext("2d");
|
|
3809
|
+
if (!N || C.width === 0 || C.height === 0 || !N || C.width === 0 || C.height === 0)
|
|
3769
3810
|
return !1;
|
|
3770
|
-
const
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
), { data:
|
|
3776
|
-
let
|
|
3777
|
-
for (let J = 0; J <
|
|
3778
|
-
0.299 *
|
|
3779
|
-
const
|
|
3780
|
-
return
|
|
3781
|
-
},
|
|
3782
|
-
const
|
|
3783
|
-
if (!(!
|
|
3784
|
-
for (const
|
|
3785
|
-
switch (
|
|
3811
|
+
const P = N.getImageData(
|
|
3812
|
+
C.xMin,
|
|
3813
|
+
C.yMin,
|
|
3814
|
+
C.width,
|
|
3815
|
+
C.height
|
|
3816
|
+
), { data: E } = P;
|
|
3817
|
+
let D = 0, V = 0;
|
|
3818
|
+
for (let J = 0; J < E.length; J += 4)
|
|
3819
|
+
0.299 * E[J] + 0.587 * E[J + 1] + 0.114 * E[J + 2] > 250 && V++;
|
|
3820
|
+
const Z = E.length / 4;
|
|
3821
|
+
return D = V / Z, D > 0.01;
|
|
3822
|
+
}, R = (k, C, N, P) => {
|
|
3823
|
+
const E = C.current, D = E == null ? void 0 : E.parentElement;
|
|
3824
|
+
if (!(!E || !D))
|
|
3825
|
+
for (const V of P)
|
|
3826
|
+
switch (V) {
|
|
3786
3827
|
case "zoom":
|
|
3787
|
-
d(
|
|
3828
|
+
d(k, Math.min(D.clientHeight, D.clientWidth));
|
|
3788
3829
|
break;
|
|
3789
3830
|
case "features":
|
|
3790
3831
|
u(
|
|
3791
|
-
|
|
3792
|
-
Math.min(
|
|
3832
|
+
k,
|
|
3833
|
+
Math.min(D.clientHeight, D.clientWidth)
|
|
3793
3834
|
);
|
|
3794
3835
|
break;
|
|
3795
3836
|
case "in-frame":
|
|
3796
|
-
let
|
|
3797
|
-
|
|
3798
|
-
const J =
|
|
3799
|
-
c(
|
|
3800
|
-
x: (
|
|
3801
|
-
y: (
|
|
3837
|
+
let Z = N;
|
|
3838
|
+
Z || (Z = Math.min(D.clientHeight, D.clientWidth) * 0.7);
|
|
3839
|
+
const J = Z + 200;
|
|
3840
|
+
c(k, {
|
|
3841
|
+
x: (D.clientWidth - J) / 2,
|
|
3842
|
+
y: (D.clientHeight - J) / 2,
|
|
3802
3843
|
width: J,
|
|
3803
3844
|
height: J,
|
|
3804
|
-
offsetX: (
|
|
3805
|
-
offsetY: (
|
|
3845
|
+
offsetX: (E.videoWidth - D.clientWidth) / 2,
|
|
3846
|
+
offsetY: (E.videoHeight - D.clientHeight) / 2
|
|
3806
3847
|
});
|
|
3807
3848
|
break;
|
|
3808
3849
|
}
|
|
3809
|
-
},
|
|
3810
|
-
const
|
|
3850
|
+
}, j = (k) => {
|
|
3851
|
+
const C = [
|
|
3811
3852
|
33,
|
|
3812
3853
|
// Left eye inner corner
|
|
3813
3854
|
133,
|
|
@@ -3820,75 +3861,75 @@ function ic(e = {}) {
|
|
|
3820
3861
|
// Right eye outer corner
|
|
3821
3862
|
386
|
|
3822
3863
|
// Right eye pupil area
|
|
3823
|
-
],
|
|
3824
|
-
for (const
|
|
3825
|
-
const
|
|
3826
|
-
if (!
|
|
3864
|
+
], N = 0.5;
|
|
3865
|
+
for (const P of C) {
|
|
3866
|
+
const E = k[P];
|
|
3867
|
+
if (!E || E.score && E.score < N)
|
|
3827
3868
|
return !1;
|
|
3828
3869
|
}
|
|
3829
3870
|
return !0;
|
|
3830
|
-
}, I = (
|
|
3831
|
-
const
|
|
3832
|
-
if (!
|
|
3871
|
+
}, I = (k, C) => {
|
|
3872
|
+
const N = k.getContext("2d");
|
|
3873
|
+
if (!N || C.width === 0 || C.height === 0)
|
|
3833
3874
|
return !1;
|
|
3834
|
-
const
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
), { data:
|
|
3840
|
-
let
|
|
3841
|
-
for (let
|
|
3842
|
-
const J =
|
|
3843
|
-
|
|
3875
|
+
const P = N.getImageData(
|
|
3876
|
+
C.xMin,
|
|
3877
|
+
C.yMin,
|
|
3878
|
+
C.width,
|
|
3879
|
+
C.height
|
|
3880
|
+
), { data: E } = P;
|
|
3881
|
+
let D = 0;
|
|
3882
|
+
for (let Z = 0; Z < E.length; Z += 4) {
|
|
3883
|
+
const J = E[Z], ee = E[Z + 1], He = E[Z + 2], dt = 0.299 * J + 0.587 * ee + 0.114 * He;
|
|
3884
|
+
D += dt;
|
|
3844
3885
|
}
|
|
3845
|
-
return
|
|
3846
|
-
},
|
|
3847
|
-
const
|
|
3848
|
-
x:
|
|
3849
|
-
y:
|
|
3886
|
+
return D / (E.length / 4) < 60;
|
|
3887
|
+
}, Y = (k) => {
|
|
3888
|
+
const C = {
|
|
3889
|
+
x: k.box.xMin + (k.box.width ?? 0) / 2,
|
|
3890
|
+
y: k.box.yMin + (k.box.height ?? 0) / 2
|
|
3850
3891
|
};
|
|
3851
|
-
if (S.current.push(
|
|
3852
|
-
let
|
|
3892
|
+
if (S.current.push(C), S.current.length > M && S.current.shift(), S.current.length < M) return !1;
|
|
3893
|
+
let N = 0, P = 0, E = 0;
|
|
3853
3894
|
for (let ee = 1; ee < S.current.length; ee++) {
|
|
3854
|
-
const He = S.current[ee - 1], dt = S.current[ee], qe = dt.x - He.x,
|
|
3855
|
-
Dn >= 2 && (
|
|
3895
|
+
const He = S.current[ee - 1], dt = S.current[ee], qe = dt.x - He.x, In = dt.y - He.y, Dn = Math.sqrt(qe * qe + In * In);
|
|
3896
|
+
Dn >= 2 && (N += Dn, ee > 1 && Math.sign(qe) !== Math.sign(E) && Math.abs(qe) > 3 && P++, E = qe);
|
|
3856
3897
|
}
|
|
3857
|
-
const
|
|
3898
|
+
const V = N / (M - 1) > A, Z = P >= W, J = V || Z;
|
|
3858
3899
|
return J && i("🚨 Head shake detected!"), J;
|
|
3859
|
-
},
|
|
3900
|
+
}, Q = (k, C, N, P) => {
|
|
3860
3901
|
try {
|
|
3861
|
-
if (
|
|
3902
|
+
if (k.length === 0 || k.length > 1) {
|
|
3862
3903
|
p.current && (clearTimeout(p.current), p.current = null), i(
|
|
3863
|
-
|
|
3904
|
+
k.length > 1 ? "Please ensure only one face is visible" : "Detecting face..."
|
|
3864
3905
|
);
|
|
3865
3906
|
return;
|
|
3866
3907
|
}
|
|
3867
|
-
const
|
|
3868
|
-
let
|
|
3908
|
+
const E = k[0];
|
|
3909
|
+
let D = "", V = !0;
|
|
3869
3910
|
try {
|
|
3870
|
-
|
|
3911
|
+
R(E, f, n, t);
|
|
3871
3912
|
} catch (ee) {
|
|
3872
|
-
|
|
3913
|
+
D = ee.message, V = !1;
|
|
3873
3914
|
}
|
|
3874
|
-
|
|
3875
|
-
const { eyesOpen:
|
|
3876
|
-
|
|
3915
|
+
Y(E) && (D = "Please hold your head steady", V = !1), P || (D = "Center your face in the frame", V = !1), j(E.keypoints) || (D = "Please ensure your eyes are clearly visible. Remove glasses if necessary.", V = !1);
|
|
3916
|
+
const { eyesOpen: Z, mouthClosed: J } = ic(
|
|
3917
|
+
E.keypoints,
|
|
3877
3918
|
// onError,
|
|
3878
3919
|
i,
|
|
3879
3920
|
!1,
|
|
3880
|
-
|
|
3921
|
+
N
|
|
3881
3922
|
);
|
|
3882
|
-
if (
|
|
3883
|
-
p.current && (clearTimeout(p.current), p.current = null, v.current.forEach(clearTimeout)), i(
|
|
3923
|
+
if (Z ? J || (D = "Please close your mouth", V = !1) : (p.current && (clearTimeout(p.current), p.current = null), V = !1), !V) {
|
|
3924
|
+
p.current && (clearTimeout(p.current), p.current = null, v.current.forEach(clearTimeout)), i(D), r(E, !1, N, !1);
|
|
3884
3925
|
return;
|
|
3885
3926
|
}
|
|
3886
3927
|
if (!p.current) {
|
|
3887
|
-
if (I($.current,
|
|
3928
|
+
if (I($.current, E.box)) {
|
|
3888
3929
|
i("Too dark – move to a well-lit area");
|
|
3889
3930
|
return;
|
|
3890
3931
|
}
|
|
3891
|
-
if (
|
|
3932
|
+
if (b($.current, E.box)) {
|
|
3892
3933
|
i("Too much glare. Please avoid direct light on your face.");
|
|
3893
3934
|
return;
|
|
3894
3935
|
}
|
|
@@ -3898,50 +3939,50 @@ function ic(e = {}) {
|
|
|
3898
3939
|
700
|
|
3899
3940
|
);
|
|
3900
3941
|
v.current = [ee, He], p.current = setTimeout(() => {
|
|
3901
|
-
F.current.data ? (l(F.current.data), r(
|
|
3942
|
+
F.current.data ? (l(F.current.data), r(E, !0, N, !0)) : o("Could not capture a clear photo. Please try again.");
|
|
3902
3943
|
}, 1e3);
|
|
3903
3944
|
}
|
|
3904
3945
|
if (p.current) {
|
|
3905
|
-
const ee =
|
|
3946
|
+
const ee = ja(C);
|
|
3906
3947
|
ee > F.current.sharpness && (F.current = {
|
|
3907
3948
|
sharpness: ee,
|
|
3908
|
-
data:
|
|
3949
|
+
data: C
|
|
3909
3950
|
});
|
|
3910
3951
|
}
|
|
3911
|
-
} catch (
|
|
3912
|
-
o(
|
|
3952
|
+
} catch (E) {
|
|
3953
|
+
o(E.message), k.length > 0 && r(k[0], !1, N, !1);
|
|
3913
3954
|
}
|
|
3914
3955
|
};
|
|
3915
|
-
return { detectFaces: async (
|
|
3956
|
+
return { detectFaces: async (k) => {
|
|
3916
3957
|
if (!a) return;
|
|
3917
|
-
f.current =
|
|
3918
|
-
const
|
|
3919
|
-
if (!
|
|
3958
|
+
f.current = k.ref.current;
|
|
3959
|
+
const C = f.current;
|
|
3960
|
+
if (!C || C.videoWidth === 0) return;
|
|
3920
3961
|
$.current || ($.current = document.createElement("canvas"), T.current = $.current.getContext("2d", {
|
|
3921
3962
|
willReadFrequently: !0
|
|
3922
3963
|
}));
|
|
3923
|
-
const
|
|
3924
|
-
if (!
|
|
3925
|
-
|
|
3926
|
-
const
|
|
3927
|
-
!m.current &&
|
|
3964
|
+
const N = $.current, P = T.current;
|
|
3965
|
+
if (!N || !P) return;
|
|
3966
|
+
N.width = C.videoWidth, N.height = C.videoHeight, P.drawImage(C, 0, 0, N.width, N.height);
|
|
3967
|
+
const E = P.getImageData(0, 0, N.width, N.height);
|
|
3968
|
+
!m.current && C.readyState >= 2 && !_.current && (m.current = !0, y.current = setTimeout(() => {
|
|
3928
3969
|
o("Liveness check TIMED OUT. Please try again."), g();
|
|
3929
3970
|
}, s));
|
|
3930
|
-
const { faces:
|
|
3971
|
+
const { faces: D, blendShapes: V, inBox: Z } = await $e.detectFaces(
|
|
3931
3972
|
a,
|
|
3932
|
-
|
|
3973
|
+
E
|
|
3933
3974
|
);
|
|
3934
|
-
|
|
3975
|
+
Q(D, E, V, Z);
|
|
3935
3976
|
}, cleanup: g };
|
|
3936
3977
|
}
|
|
3937
|
-
const
|
|
3938
|
-
container:
|
|
3939
|
-
progress:
|
|
3940
|
-
completed:
|
|
3941
|
-
marker:
|
|
3978
|
+
const ac = "_container_1ej18_1", lc = "_progress_1ej18_12", cc = "_completed_1ej18_33", uc = "_marker_1ej18_37", Gt = {
|
|
3979
|
+
container: ac,
|
|
3980
|
+
progress: lc,
|
|
3981
|
+
completed: cc,
|
|
3982
|
+
marker: uc
|
|
3942
3983
|
};
|
|
3943
|
-
function
|
|
3944
|
-
const { faceDetected: t } = e, n =
|
|
3984
|
+
function dc(e) {
|
|
3985
|
+
const { faceDetected: t } = e, n = z(() => {
|
|
3945
3986
|
const r = [Gt.container];
|
|
3946
3987
|
return t && r.push(Gt.focused), r.join(" ");
|
|
3947
3988
|
}, [t]);
|
|
@@ -3957,7 +3998,7 @@ const Kt = {
|
|
|
3957
3998
|
SpoofFace: "We detected a spoofing attempt",
|
|
3958
3999
|
FaceTrackingFailed: "We could not detect your face",
|
|
3959
4000
|
ExcessiveFaceBrightnessDetected: "We detected excessive light during the test, please wipe any oil or sweat that might cause a reflection on your face."
|
|
3960
|
-
},
|
|
4001
|
+
}, fc = {
|
|
3961
4002
|
None: "Processing...",
|
|
3962
4003
|
LookAtCamera: "Look at camera.",
|
|
3963
4004
|
FaceNotCentered: "Center your face in the camera.",
|
|
@@ -3977,7 +4018,7 @@ const Kt = {
|
|
|
3977
4018
|
Tip3: "You may be asked to turn your nose towards the green color.",
|
|
3978
4019
|
Continue: "Continue"
|
|
3979
4020
|
};
|
|
3980
|
-
function
|
|
4021
|
+
function pc(e) {
|
|
3981
4022
|
const {
|
|
3982
4023
|
onComplete: t = () => {
|
|
3983
4024
|
},
|
|
@@ -3986,60 +4027,60 @@ function fc(e) {
|
|
|
3986
4027
|
onError: r = () => {
|
|
3987
4028
|
}
|
|
3988
4029
|
// onPictureReady = () => {},
|
|
3989
|
-
} = e, { setColorScheme: o, getColorScheme: i } =
|
|
4030
|
+
} = e, { setColorScheme: o, getColorScheme: i } = jo(), s = w(null), a = w(!1), l = () => {
|
|
3990
4031
|
s.current && (s.current.callAttemptEnd(), s.current.delete(), s.current = null);
|
|
3991
4032
|
}, u = U(() => {
|
|
3992
4033
|
l();
|
|
3993
4034
|
}, []), d = () => {
|
|
3994
4035
|
s.current && l(), s.current = null, a.current = !1;
|
|
3995
4036
|
}, c = (m) => {
|
|
3996
|
-
var
|
|
4037
|
+
var A, W;
|
|
3997
4038
|
const v = m.split(".");
|
|
3998
4039
|
let g = !1;
|
|
3999
4040
|
s.current.setToken(m);
|
|
4000
|
-
let $ = "", T = "", S,
|
|
4041
|
+
let $ = "", T = "", S, M = 0;
|
|
4001
4042
|
if (v.length === 3) {
|
|
4002
4043
|
const F = JSON.parse(atob(v[1]));
|
|
4003
4044
|
if (F.face) {
|
|
4004
|
-
const
|
|
4005
|
-
if (
|
|
4006
|
-
s.current.setEndpoint(
|
|
4045
|
+
const b = JSON.parse(F.face), R = /^https:\/\/[^/:]+\.(api\.cognitive\.microsoft|cognitiveservices\.azure)\.com$/;
|
|
4046
|
+
if (b.endpoint && (R.test(b.endpoint) || b.endpoint === "https://virginia.api.cognitive.microsoft.us")) {
|
|
4047
|
+
s.current.setEndpoint(b.endpoint);
|
|
4007
4048
|
const I = JSON.parse(F["allowed-paths"]);
|
|
4008
4049
|
if (I) {
|
|
4009
|
-
const
|
|
4010
|
-
(
|
|
4011
|
-
)) == null ? void 0 :
|
|
4012
|
-
s.current.setSessionStartPath(
|
|
4013
|
-
const
|
|
4014
|
-
(
|
|
4050
|
+
const Y = (A = I.find(
|
|
4051
|
+
(P) => P.path.toLocaleLowerCase().endsWith("/session/start")
|
|
4052
|
+
)) == null ? void 0 : A.path;
|
|
4053
|
+
s.current.setSessionStartPath(Y);
|
|
4054
|
+
const Q = (W = I.find(
|
|
4055
|
+
(P) => P.path.toLocaleLowerCase().endsWith("/session/attempt/end")
|
|
4015
4056
|
)) == null ? void 0 : W.path;
|
|
4016
|
-
s.current.setAttemptEndPath(
|
|
4017
|
-
const
|
|
4018
|
-
(
|
|
4057
|
+
s.current.setAttemptEndPath(Q);
|
|
4058
|
+
const X = I.find(
|
|
4059
|
+
(P) => P.path.endsWith("/detectLiveness/singleModal")
|
|
4019
4060
|
);
|
|
4020
|
-
|
|
4021
|
-
const
|
|
4022
|
-
(
|
|
4061
|
+
X && ({ path: $, quota: M } = X, s.current.setLivenessPath($));
|
|
4062
|
+
const k = I.find(
|
|
4063
|
+
(P) => P.path.endsWith("/detectLivenessWithVerify/singleModal")
|
|
4023
4064
|
);
|
|
4024
|
-
|
|
4065
|
+
k && ({ path: T, quota: M } = k, s.current.setLivenessWithVerifyPath(
|
|
4025
4066
|
T
|
|
4026
4067
|
));
|
|
4027
|
-
const
|
|
4068
|
+
const C = new Set(
|
|
4028
4069
|
I.map(
|
|
4029
|
-
(
|
|
4030
|
-
var
|
|
4031
|
-
return (
|
|
4070
|
+
(P) => {
|
|
4071
|
+
var E;
|
|
4072
|
+
return (E = P.path) == null ? void 0 : E.split("/")[1];
|
|
4032
4073
|
}
|
|
4033
4074
|
)
|
|
4034
4075
|
);
|
|
4035
|
-
if (
|
|
4036
|
-
const
|
|
4037
|
-
s.current.setApiVersion(
|
|
4076
|
+
if (C.size === 1 && (X || k)) {
|
|
4077
|
+
const P = C.values().next().value;
|
|
4078
|
+
s.current.setApiVersion(P), g = !0, S = b.clientClaims.livenessOperationMode;
|
|
4038
4079
|
}
|
|
4039
4080
|
}
|
|
4040
4081
|
}
|
|
4041
4082
|
}
|
|
4042
|
-
s.current.setOperationQuota(
|
|
4083
|
+
s.current.setOperationQuota(M), s.current.setOperationMode(
|
|
4043
4084
|
window.Module.LivenessOperationMode[S]
|
|
4044
4085
|
), F.sid && s.current.setSid(F.sid), F["azure-resource-id"] && s.current.setResourceId(F["azure-resource-id"]);
|
|
4045
4086
|
}
|
|
@@ -4047,11 +4088,11 @@ function fc(e) {
|
|
|
4047
4088
|
s.current.initialize();
|
|
4048
4089
|
else {
|
|
4049
4090
|
const F = {
|
|
4050
|
-
livenessError:
|
|
4091
|
+
livenessError: Ce(
|
|
4051
4092
|
window.Module.LivenessFailureReason,
|
|
4052
4093
|
window.Module.LivenessFailureReason.InvalidToken
|
|
4053
4094
|
),
|
|
4054
|
-
recognitionError:
|
|
4095
|
+
recognitionError: Ce(
|
|
4055
4096
|
window.Module.RecognitionFailureReason,
|
|
4056
4097
|
window.Module.RecognitionFailureReason.None
|
|
4057
4098
|
)
|
|
@@ -4080,12 +4121,12 @@ function fc(e) {
|
|
|
4080
4121
|
break;
|
|
4081
4122
|
}
|
|
4082
4123
|
if (!a.current && g) {
|
|
4083
|
-
const T =
|
|
4124
|
+
const T = Ce(
|
|
4084
4125
|
window.Module.FeedbackForFace,
|
|
4085
4126
|
$
|
|
4086
4127
|
);
|
|
4087
4128
|
n(
|
|
4088
|
-
T && (
|
|
4129
|
+
T && (fc[T] || "")
|
|
4089
4130
|
);
|
|
4090
4131
|
}
|
|
4091
4132
|
if ($ === window.Module.FeedbackForFace.AttentionNotNeeded) {
|
|
@@ -4094,34 +4135,34 @@ function fc(e) {
|
|
|
4094
4135
|
o(T);
|
|
4095
4136
|
}
|
|
4096
4137
|
}, _ = (m) => {
|
|
4097
|
-
var S,
|
|
4098
|
-
const { livenessResult: v, recognitionResult: g } = m, $ = ((S = v.failureReason) == null ? void 0 : S.value) !== 0 || ((
|
|
4138
|
+
var S, M;
|
|
4139
|
+
const { livenessResult: v, recognitionResult: g } = m, $ = ((S = v.failureReason) == null ? void 0 : S.value) !== 0 || ((M = g.failureReason) == null ? void 0 : M.value) !== 0, T = /* @__PURE__ */ new Set([
|
|
4099
4140
|
"EnvironmentNotSupported",
|
|
4100
4141
|
"ExcessiveFaceBrightnessDetected",
|
|
4101
4142
|
"FaceEyeRegionNotVisible"
|
|
4102
4143
|
]);
|
|
4103
4144
|
if ($) {
|
|
4104
|
-
const
|
|
4105
|
-
livenessError:
|
|
4145
|
+
const A = {
|
|
4146
|
+
livenessError: Ce(
|
|
4106
4147
|
window.Module.LivenessFailureReason,
|
|
4107
4148
|
v.failureReason
|
|
4108
4149
|
),
|
|
4109
|
-
recognitionError:
|
|
4150
|
+
recognitionError: Ce(
|
|
4110
4151
|
window.Module.RecognitionFailureReason,
|
|
4111
4152
|
g.failureReason
|
|
4112
4153
|
)
|
|
4113
4154
|
};
|
|
4114
|
-
|
|
4115
|
-
|
|
4155
|
+
A.livenessError && T.has(A.livenessError) ? t() : r(
|
|
4156
|
+
A.livenessError ? Kt[A.livenessError] || A.livenessError : "Something went wrong"
|
|
4116
4157
|
);
|
|
4117
4158
|
} else {
|
|
4118
|
-
const
|
|
4119
|
-
livenessStatus:
|
|
4159
|
+
const A = {
|
|
4160
|
+
livenessStatus: Ce(
|
|
4120
4161
|
window.Module.LivenessStatus,
|
|
4121
4162
|
v.status
|
|
4122
4163
|
),
|
|
4123
4164
|
recognitionResult: {
|
|
4124
|
-
status:
|
|
4165
|
+
status: Ce(
|
|
4125
4166
|
window.Module.RecognitionStatus,
|
|
4126
4167
|
g.status
|
|
4127
4168
|
),
|
|
@@ -4130,7 +4171,7 @@ function fc(e) {
|
|
|
4130
4171
|
resultId: v.resultId,
|
|
4131
4172
|
digest: v.digest
|
|
4132
4173
|
};
|
|
4133
|
-
|
|
4174
|
+
A.livenessStatus === "RealFace" ? t() : A.livenessStatus === "SpoofFace" ? r(Kt[A.livenessStatus]) : r("Could not validate request");
|
|
4134
4175
|
}
|
|
4135
4176
|
u();
|
|
4136
4177
|
};
|
|
@@ -4142,18 +4183,18 @@ function fc(e) {
|
|
|
4142
4183
|
if (a.current)
|
|
4143
4184
|
v = s.current.generatePayloadAndResult();
|
|
4144
4185
|
else {
|
|
4145
|
-
const { videoWidth: g, videoHeight: $ } = m, T =
|
|
4186
|
+
const { videoWidth: g, videoHeight: $ } = m, T = Rn(m, g, $, void 0, {
|
|
4146
4187
|
willReadFrequently: !0
|
|
4147
4188
|
}), S = window.Module._malloc(T.data.byteLength);
|
|
4148
4189
|
try {
|
|
4149
4190
|
window.Module.HEAPU8.set(T.data, S);
|
|
4150
|
-
const
|
|
4191
|
+
const M = s.current.processFrame(
|
|
4151
4192
|
g,
|
|
4152
4193
|
$,
|
|
4153
4194
|
T.data.byteLength,
|
|
4154
4195
|
S
|
|
4155
4196
|
);
|
|
4156
|
-
|
|
4197
|
+
M.terminate ? v = !0 : M.isValid && p(M);
|
|
4157
4198
|
} finally {
|
|
4158
4199
|
window.Module._free(S);
|
|
4159
4200
|
}
|
|
@@ -4164,8 +4205,8 @@ function fc(e) {
|
|
|
4164
4205
|
destroy: u
|
|
4165
4206
|
};
|
|
4166
4207
|
}
|
|
4167
|
-
const
|
|
4168
|
-
function
|
|
4208
|
+
const Fr = "Detecting face...";
|
|
4209
|
+
function hc({
|
|
4169
4210
|
onImageCaptured: e,
|
|
4170
4211
|
fetchAzureSessionToken: t,
|
|
4171
4212
|
loadAzureSdk: n,
|
|
@@ -4173,13 +4214,13 @@ function pc({
|
|
|
4173
4214
|
onReset: o,
|
|
4174
4215
|
onFailure: i
|
|
4175
4216
|
}) {
|
|
4176
|
-
const [s, a] =
|
|
4217
|
+
const [s, a] = x(Fr), [l, u] = x(!1), d = w("findingFace"), c = w(null), f = w(), p = w(!1), [_, y] = x(0), m = w(!1), [v, g] = x(!1);
|
|
4177
4218
|
H(() => {
|
|
4178
4219
|
y(Math.min(window.innerWidth, window.innerHeight) * 0.6);
|
|
4179
4220
|
}, []), H(() => {
|
|
4180
4221
|
n(), t();
|
|
4181
4222
|
}, []);
|
|
4182
|
-
const $ =
|
|
4223
|
+
const $ = pc({
|
|
4183
4224
|
onMessage: (F) => {
|
|
4184
4225
|
d.current === "analyzingLiveness" && a(F);
|
|
4185
4226
|
},
|
|
@@ -4187,22 +4228,22 @@ function pc({
|
|
|
4187
4228
|
d.current = "done", e(!0);
|
|
4188
4229
|
},
|
|
4189
4230
|
onError: (F) => {
|
|
4190
|
-
const
|
|
4191
|
-
a(
|
|
4231
|
+
const b = Ql(F);
|
|
4232
|
+
a(b.message), d.current = "done", u(!0), r && r(F), i({
|
|
4192
4233
|
faceImage: "",
|
|
4193
4234
|
passed: !1,
|
|
4194
4235
|
metadata: {},
|
|
4195
|
-
error:
|
|
4236
|
+
error: b
|
|
4196
4237
|
});
|
|
4197
4238
|
}
|
|
4198
4239
|
}), T = () => {
|
|
4199
|
-
m.current = !1, a(
|
|
4200
|
-
}, { detectFaces: S, cleanup:
|
|
4240
|
+
m.current = !1, a(Fr), d.current = "findingFace", c.current = null, $.reset(), f.current && cancelAnimationFrame(f.current), u(!1), o();
|
|
4241
|
+
}, { detectFaces: S, cleanup: M } = sc({
|
|
4201
4242
|
validations: ["zoom", "features"],
|
|
4202
4243
|
frameSize: _,
|
|
4203
4244
|
livenessTimeout: 1e4,
|
|
4204
|
-
onFace: async (F,
|
|
4205
|
-
p.current =
|
|
4245
|
+
onFace: async (F, b, R) => {
|
|
4246
|
+
p.current = b, b && d.current === "findingFace" && !m.current && R && (m.current = !0, g(!0));
|
|
4206
4247
|
},
|
|
4207
4248
|
onPhotoSaved: () => {
|
|
4208
4249
|
},
|
|
@@ -4215,33 +4256,33 @@ function pc({
|
|
|
4215
4256
|
});
|
|
4216
4257
|
H(
|
|
4217
4258
|
() => () => {
|
|
4218
|
-
|
|
4259
|
+
M();
|
|
4219
4260
|
},
|
|
4220
4261
|
[]
|
|
4221
4262
|
);
|
|
4222
|
-
const
|
|
4223
|
-
!c.current || c.current.paused || c.current.ended || (d.current === "findingFace" ? S({ ref: c }) : d.current === "analyzingLiveness" && $.processFrame(c.current), d.current !== "done" && (f.current = requestAnimationFrame(
|
|
4263
|
+
const A = () => {
|
|
4264
|
+
!c.current || c.current.paused || c.current.ended || (d.current === "findingFace" ? S({ ref: c }) : d.current === "analyzingLiveness" && $.processFrame(c.current), d.current !== "done" && (f.current = requestAnimationFrame(A)));
|
|
4224
4265
|
};
|
|
4225
4266
|
H(() => {
|
|
4226
4267
|
(async () => {
|
|
4227
4268
|
if (v) {
|
|
4228
|
-
g(!1),
|
|
4269
|
+
g(!1), M();
|
|
4229
4270
|
try {
|
|
4230
4271
|
await n();
|
|
4231
|
-
const
|
|
4232
|
-
if (
|
|
4233
|
-
$.start(
|
|
4272
|
+
const b = await t();
|
|
4273
|
+
if (b)
|
|
4274
|
+
$.start(b), d.current = "analyzingLiveness";
|
|
4234
4275
|
else
|
|
4235
4276
|
throw new Error("Session token could not be retrieved.");
|
|
4236
|
-
} catch (
|
|
4237
|
-
const
|
|
4238
|
-
r && r(
|
|
4277
|
+
} catch (b) {
|
|
4278
|
+
const R = b instanceof Error ? b.message : "Failed to start liveness check.";
|
|
4279
|
+
r && r(R), i({
|
|
4239
4280
|
faceImage: "",
|
|
4240
4281
|
passed: !1,
|
|
4241
4282
|
metadata: {},
|
|
4242
4283
|
error: {
|
|
4243
4284
|
key: "session_token_error",
|
|
4244
|
-
message:
|
|
4285
|
+
message: R
|
|
4245
4286
|
}
|
|
4246
4287
|
}), u(!0);
|
|
4247
4288
|
}
|
|
@@ -4249,7 +4290,7 @@ function pc({
|
|
|
4249
4290
|
})();
|
|
4250
4291
|
}, [v]);
|
|
4251
4292
|
const W = (F) => {
|
|
4252
|
-
F.current && (c.current = F.current,
|
|
4293
|
+
F.current && (c.current = F.current, A());
|
|
4253
4294
|
};
|
|
4254
4295
|
return H(
|
|
4255
4296
|
() => () => {
|
|
@@ -4259,7 +4300,7 @@ function pc({
|
|
|
4259
4300
|
), /* @__PURE__ */ h("div", { className: "yvlw-h-full yvlw-flex yvlw-flex-col yvlw-items-center yvlw-justify-center", children: l ? /* @__PURE__ */ h("div", { className: `${se.intro}`, children: /* @__PURE__ */ h(
|
|
4260
4301
|
$t,
|
|
4261
4302
|
{
|
|
4262
|
-
Icon:
|
|
4303
|
+
Icon: Uo,
|
|
4263
4304
|
title: "Oops, task failed!",
|
|
4264
4305
|
description: s,
|
|
4265
4306
|
onActionClick: T,
|
|
@@ -4267,7 +4308,7 @@ function pc({
|
|
|
4267
4308
|
}
|
|
4268
4309
|
) }) : /* @__PURE__ */ h("div", { className: se.root, children: /* @__PURE__ */ h("div", { className: `${se.container} view`, children: /* @__PURE__ */ h("div", { className: "yvlw-h-full yvlw-flex yvlw-flex-col", children: [
|
|
4269
4310
|
/* @__PURE__ */ h("div", { children: /* @__PURE__ */ h(ut, { onStream: W, children: /* @__PURE__ */ h(q, { children: [
|
|
4270
|
-
/* @__PURE__ */ h(
|
|
4311
|
+
/* @__PURE__ */ h(dc, { faceDetected: p.current }),
|
|
4271
4312
|
d.current === "analyzingLiveness" && /* @__PURE__ */ h("div", { className: "yvlw-bg-black/20 yvlw-z-5" })
|
|
4272
4313
|
] }) }) }),
|
|
4273
4314
|
/* @__PURE__ */ h("div", { className: "yvlw-border-t dark:yvlw-border-gray-800 yvlw-border-gray-200", children: /* @__PURE__ */ h("div", { className: "yvlw-text-center yvlw-mx-auto yvlw-pt-4 yvlw-pb-6 yvlw-px-4", children: [
|
|
@@ -4279,14 +4320,14 @@ function pc({
|
|
|
4279
4320
|
] }) })
|
|
4280
4321
|
] }) }) }) });
|
|
4281
4322
|
}
|
|
4282
|
-
const
|
|
4323
|
+
const vc = () => {
|
|
4283
4324
|
if (window.isAzureSdkLoading)
|
|
4284
4325
|
return window.azureSdkLoadPromise;
|
|
4285
4326
|
window.isAzureSdkLoading = !0;
|
|
4286
4327
|
const e = new Promise((t, n) => {
|
|
4287
4328
|
let r = Ge.js.simd;
|
|
4288
4329
|
try {
|
|
4289
|
-
WebAssembly.validate(new Uint8Array(
|
|
4330
|
+
WebAssembly.validate(new Uint8Array(Qa)) || (r = Ge.js.default);
|
|
4290
4331
|
} catch {
|
|
4291
4332
|
r = Ge.js.simd;
|
|
4292
4333
|
}
|
|
@@ -4309,9 +4350,9 @@ const hc = () => {
|
|
|
4309
4350
|
return window.azureSdkLoadPromise = e, e;
|
|
4310
4351
|
};
|
|
4311
4352
|
let Xe = null;
|
|
4312
|
-
function
|
|
4313
|
-
var
|
|
4314
|
-
const { toggleColorScheme: e, getColorScheme: t, setColorScheme: n } =
|
|
4353
|
+
function mc() {
|
|
4354
|
+
var X;
|
|
4355
|
+
const { toggleColorScheme: e, getColorScheme: t, setColorScheme: n } = jo(), {
|
|
4315
4356
|
user: r,
|
|
4316
4357
|
tasks: o,
|
|
4317
4358
|
currentTaskIndex: i,
|
|
@@ -4323,34 +4364,51 @@ function vc() {
|
|
|
4323
4364
|
clearSavedPhoto: c,
|
|
4324
4365
|
branding: f,
|
|
4325
4366
|
isMobileAppWebView: p
|
|
4326
|
-
} = fe(), [_, y] =
|
|
4367
|
+
} = fe(), [_, y] = x(!1), [m, v] = x(!1), [g, $] = x(null), [T, S] = x(!1), [M, A] = x(!1), [W, F] = x(0), [b, R] = x(null);
|
|
4327
4368
|
H(() => {
|
|
4328
|
-
const
|
|
4329
|
-
n(
|
|
4330
|
-
}, [])
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
)
|
|
4335
|
-
)), E ?? Xe), Y = async () => {
|
|
4369
|
+
const k = t();
|
|
4370
|
+
n(k);
|
|
4371
|
+
}, []), H(() => {
|
|
4372
|
+
s && !T && b === null && R(5);
|
|
4373
|
+
}, [s, T, b]);
|
|
4374
|
+
const j = U(async () => {
|
|
4336
4375
|
try {
|
|
4337
4376
|
y(!0), $(null), await a(), Xe = null, d === "page" && S(!0);
|
|
4338
|
-
} catch (
|
|
4339
|
-
$(
|
|
4377
|
+
} catch (k) {
|
|
4378
|
+
$(k.message);
|
|
4340
4379
|
} finally {
|
|
4341
4380
|
y(!1);
|
|
4342
4381
|
}
|
|
4343
|
-
},
|
|
4344
|
-
|
|
4382
|
+
}, [a, d]);
|
|
4383
|
+
H(() => {
|
|
4384
|
+
if (b === null || T)
|
|
4385
|
+
return;
|
|
4386
|
+
if (b === 0) {
|
|
4387
|
+
j();
|
|
4388
|
+
return;
|
|
4389
|
+
}
|
|
4390
|
+
const k = setTimeout(() => {
|
|
4391
|
+
R((C) => (C ?? 1) - 1);
|
|
4392
|
+
}, 1e3);
|
|
4393
|
+
return () => {
|
|
4394
|
+
clearTimeout(k);
|
|
4395
|
+
};
|
|
4396
|
+
}, [b, T]);
|
|
4397
|
+
const { sessionToken: I } = fe(), Y = async () => (!I && !Xe && (Xe = Promise.reject(
|
|
4398
|
+
new Error(
|
|
4399
|
+
"sessionToken not provided. Generate a sessionToken on your backend and pass it to the SDK."
|
|
4400
|
+
)
|
|
4401
|
+
)), I ?? Xe), Q = U(
|
|
4402
|
+
(k) => k === i ? ne.active : i > k ? ne.completed : "subtext",
|
|
4345
4403
|
[i]
|
|
4346
4404
|
);
|
|
4347
4405
|
return /* @__PURE__ */ h("div", { className: ne.root, children: /* @__PURE__ */ h("div", { className: ne.container, children: [
|
|
4348
4406
|
/* @__PURE__ */ h("div", { className: `${ne.lhs} divider`, children: [
|
|
4349
4407
|
/* @__PURE__ */ h("div", { className: ne.info, children: [
|
|
4350
|
-
/* @__PURE__ */ h(
|
|
4408
|
+
/* @__PURE__ */ h(ml, {}),
|
|
4351
4409
|
/* @__PURE__ */ h("div", { children: /* @__PURE__ */ h("p", { className: "yvlw-text-xs yvlw-m-0 yvlw-p-0 subtext", children: "You have been given this set of tasks to complete. They are pretty easy to do but we will be guiding you every step of the way." }) }),
|
|
4352
4410
|
/* @__PURE__ */ h("ol", { children: [
|
|
4353
|
-
o.map((
|
|
4411
|
+
o.map((k, C) => /* @__PURE__ */ h("li", { className: Q(C), children: el[k.id].name }, `task-${C}`)),
|
|
4354
4412
|
/* @__PURE__ */ h("li", { className: s ? ne.active : "", children: "Complete! 🎉" })
|
|
4355
4413
|
] })
|
|
4356
4414
|
] }),
|
|
@@ -4368,7 +4426,7 @@ function vc() {
|
|
|
4368
4426
|
] }) }),
|
|
4369
4427
|
/* @__PURE__ */ h("div", { onClick: () => e(), role: "button", children: [
|
|
4370
4428
|
/* @__PURE__ */ h("div", { className: "dark:yvlw-hidden", children: /* @__PURE__ */ h(Wo, {}) }),
|
|
4371
|
-
/* @__PURE__ */ h("div", { className: "yvlw-hidden dark:yvlw-block", children: /* @__PURE__ */ h(
|
|
4429
|
+
/* @__PURE__ */ h("div", { className: "yvlw-hidden dark:yvlw-block", children: /* @__PURE__ */ h(Ia, {}) })
|
|
4372
4430
|
] })
|
|
4373
4431
|
] })
|
|
4374
4432
|
] }),
|
|
@@ -4399,7 +4457,7 @@ function vc() {
|
|
|
4399
4457
|
/* @__PURE__ */ h(
|
|
4400
4458
|
pe,
|
|
4401
4459
|
{
|
|
4402
|
-
show: m && !
|
|
4460
|
+
show: m && !M,
|
|
4403
4461
|
as: "div",
|
|
4404
4462
|
leave: "yvlw-transform yvlw-transition yvlw-duration-300",
|
|
4405
4463
|
leaveFrom: "yvlw-translate-y-0 yvlw-opacity-100",
|
|
@@ -4408,16 +4466,16 @@ function vc() {
|
|
|
4408
4466
|
enterTo: "yvlw-translate-y-0 yvlw-opacity-100",
|
|
4409
4467
|
className: "yvlw-h-full yvlw-w-full",
|
|
4410
4468
|
children: /* @__PURE__ */ h("div", { className: ne.completed, children: /* @__PURE__ */ h(
|
|
4411
|
-
|
|
4469
|
+
hc,
|
|
4412
4470
|
{
|
|
4413
|
-
fetchAzureSessionToken:
|
|
4414
|
-
loadAzureSdk:
|
|
4415
|
-
onImageCaptured: (
|
|
4416
|
-
$(null),
|
|
4471
|
+
fetchAzureSessionToken: Y,
|
|
4472
|
+
loadAzureSdk: vc,
|
|
4473
|
+
onImageCaptured: (k) => {
|
|
4474
|
+
$(null), k && A(!0);
|
|
4417
4475
|
},
|
|
4418
|
-
onError: (
|
|
4476
|
+
onError: (k) => $(k),
|
|
4419
4477
|
onReset: () => {
|
|
4420
|
-
Xe = null,
|
|
4478
|
+
Xe = null, A(!1), F((k) => k + 1), c();
|
|
4421
4479
|
},
|
|
4422
4480
|
onFailure: l
|
|
4423
4481
|
},
|
|
@@ -4425,29 +4483,29 @@ function vc() {
|
|
|
4425
4483
|
) })
|
|
4426
4484
|
}
|
|
4427
4485
|
),
|
|
4428
|
-
o.map((
|
|
4429
|
-
let
|
|
4430
|
-
switch (
|
|
4486
|
+
o.map((k, C) => {
|
|
4487
|
+
let N;
|
|
4488
|
+
switch (k.id) {
|
|
4431
4489
|
case "complete-the-circle":
|
|
4432
|
-
|
|
4490
|
+
N = /* @__PURE__ */ h(zl, { ...k });
|
|
4433
4491
|
break;
|
|
4434
4492
|
case "yes-or-no":
|
|
4435
|
-
|
|
4493
|
+
N = /* @__PURE__ */ h(Xl, { ...k });
|
|
4436
4494
|
break;
|
|
4437
4495
|
case "motions":
|
|
4438
|
-
|
|
4496
|
+
N = /* @__PURE__ */ h(nc, { ...k });
|
|
4439
4497
|
break;
|
|
4440
4498
|
case "blink":
|
|
4441
|
-
|
|
4499
|
+
N = /* @__PURE__ */ h(rc, { ...k });
|
|
4442
4500
|
break;
|
|
4443
4501
|
default:
|
|
4444
|
-
|
|
4502
|
+
N = /* @__PURE__ */ h(q, {});
|
|
4445
4503
|
break;
|
|
4446
4504
|
}
|
|
4447
4505
|
return /* @__PURE__ */ h(
|
|
4448
4506
|
pe,
|
|
4449
4507
|
{
|
|
4450
|
-
show: m &&
|
|
4508
|
+
show: m && M && !s && i === C,
|
|
4451
4509
|
appear: !0,
|
|
4452
4510
|
as: "div",
|
|
4453
4511
|
leave: "yvlw-transform yvlw-transition yvlw-duration-300",
|
|
@@ -4456,9 +4514,9 @@ function vc() {
|
|
|
4456
4514
|
enterFrom: "yvlw-translate-y-full yvlw-opacity-0",
|
|
4457
4515
|
enterTo: "yvlw-translate-y-0 yvlw-opacity-100",
|
|
4458
4516
|
className: "yvlw-h-full",
|
|
4459
|
-
children:
|
|
4517
|
+
children: N
|
|
4460
4518
|
},
|
|
4461
|
-
`task-${
|
|
4519
|
+
`task-${C}`
|
|
4462
4520
|
);
|
|
4463
4521
|
}),
|
|
4464
4522
|
/* @__PURE__ */ h(
|
|
@@ -4478,9 +4536,9 @@ function vc() {
|
|
|
4478
4536
|
Icon: Wa,
|
|
4479
4537
|
title: T ? "All Set!" : "Completed",
|
|
4480
4538
|
description: T ? "You can now close or exit the window" : "Your Identity verification has been completed successfully. Thanks for your patience",
|
|
4481
|
-
actionText: "Finish",
|
|
4539
|
+
actionText: b !== null && b > 0 ? `Finish in (${b}s)` : "Finish",
|
|
4482
4540
|
loading: _,
|
|
4483
|
-
onActionClick:
|
|
4541
|
+
onActionClick: j,
|
|
4484
4542
|
hideButton: T,
|
|
4485
4543
|
children: g && /* @__PURE__ */ h("div", { className: "yvlw-mt-3", children: g })
|
|
4486
4544
|
}
|
|
@@ -4491,7 +4549,7 @@ function vc() {
|
|
|
4491
4549
|
/* @__PURE__ */ h("div", { className: `${ne.rhs} divider`, children: r && /* @__PURE__ */ h("div", { className: `${ne.profile} divider`, children: [
|
|
4492
4550
|
/* @__PURE__ */ h("div", { children: /* @__PURE__ */ h("div", { className: ne.avatar, children: [
|
|
4493
4551
|
r.firstName.charAt(0).toUpperCase(),
|
|
4494
|
-
(
|
|
4552
|
+
(X = r.lastName) == null ? void 0 : X.charAt(0).toUpperCase()
|
|
4495
4553
|
] }) }),
|
|
4496
4554
|
/* @__PURE__ */ h("div", { children: [
|
|
4497
4555
|
/* @__PURE__ */ h("h4", { children: [
|
|
@@ -4504,7 +4562,7 @@ function vc() {
|
|
|
4504
4562
|
] }) })
|
|
4505
4563
|
] }) });
|
|
4506
4564
|
}
|
|
4507
|
-
function
|
|
4565
|
+
function _c(e) {
|
|
4508
4566
|
const {
|
|
4509
4567
|
tasks: t,
|
|
4510
4568
|
namespace: n,
|
|
@@ -4520,12 +4578,13 @@ function mc(e) {
|
|
|
4520
4578
|
metadata: c,
|
|
4521
4579
|
sandboxEnvironment: f,
|
|
4522
4580
|
sessionId: p,
|
|
4523
|
-
sessionToken: _
|
|
4524
|
-
|
|
4525
|
-
|
|
4581
|
+
sessionToken: _,
|
|
4582
|
+
forceDevUrl: y
|
|
4583
|
+
} = e, [m, v] = x(e.show), g = () => {
|
|
4584
|
+
v(!1), s();
|
|
4526
4585
|
};
|
|
4527
4586
|
return /* @__PURE__ */ h(
|
|
4528
|
-
|
|
4587
|
+
tl,
|
|
4529
4588
|
{
|
|
4530
4589
|
namespace: n,
|
|
4531
4590
|
publicKey: d,
|
|
@@ -4533,7 +4592,7 @@ function mc(e) {
|
|
|
4533
4592
|
user: r,
|
|
4534
4593
|
branding: o,
|
|
4535
4594
|
isMobileAppWebView: i,
|
|
4536
|
-
onRequestClose:
|
|
4595
|
+
onRequestClose: g,
|
|
4537
4596
|
onSuccess: a,
|
|
4538
4597
|
onFailure: l,
|
|
4539
4598
|
metadata: c,
|
|
@@ -4541,28 +4600,29 @@ function mc(e) {
|
|
|
4541
4600
|
sandboxEnvironment: f,
|
|
4542
4601
|
sessionId: p,
|
|
4543
4602
|
sessionToken: _,
|
|
4603
|
+
forceDevUrl: y,
|
|
4544
4604
|
children: /* @__PURE__ */ h(
|
|
4545
|
-
|
|
4605
|
+
Fa,
|
|
4546
4606
|
{
|
|
4547
4607
|
id: n,
|
|
4548
|
-
open: u === "page" ? !0 :
|
|
4549
|
-
onClose:
|
|
4608
|
+
open: u === "page" ? !0 : m,
|
|
4609
|
+
onClose: g,
|
|
4550
4610
|
transition: !0,
|
|
4551
|
-
className: `${
|
|
4611
|
+
className: `${Ra.root} ${ht.root} ${ht[u]}`,
|
|
4552
4612
|
style: {
|
|
4553
|
-
"--branding-color": (o == null ? void 0 : o.color) ??
|
|
4613
|
+
"--branding-color": (o == null ? void 0 : o.color) ?? Za
|
|
4554
4614
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4555
4615
|
},
|
|
4556
4616
|
children: [
|
|
4557
|
-
u === "modal" && /* @__PURE__ */ h("div", { onClick:
|
|
4558
|
-
/* @__PURE__ */ h(Ho, { className: `${ht.container}`, children: /* @__PURE__ */ h(
|
|
4617
|
+
u === "modal" && /* @__PURE__ */ h("div", { onClick: g, role: "button", className: ht.close, children: /* @__PURE__ */ h(Ua, { className: "yvlw-text-white" }) }),
|
|
4618
|
+
/* @__PURE__ */ h(Ho, { className: `${ht.container}`, children: /* @__PURE__ */ h(mc, {}) })
|
|
4559
4619
|
]
|
|
4560
4620
|
}
|
|
4561
4621
|
)
|
|
4562
4622
|
}
|
|
4563
4623
|
);
|
|
4564
4624
|
}
|
|
4565
|
-
class
|
|
4625
|
+
class wc {
|
|
4566
4626
|
constructor(t) {
|
|
4567
4627
|
this.tasks = [], this.container = null, this.namespace = "liveness-web-sdk", this.loadedScripts = [];
|
|
4568
4628
|
const { presentation: n = "modal" } = t;
|
|
@@ -4612,13 +4672,14 @@ class gc {
|
|
|
4612
4672
|
// }
|
|
4613
4673
|
// }
|
|
4614
4674
|
async start(t) {
|
|
4615
|
-
t && (this.tasks = t), this.validateOptions(), this.container = document.createElement("div"), document.body.appendChild(this.container),
|
|
4675
|
+
t && (this.tasks = t), this.validateOptions(), this.container = document.createElement("div"), document.body.appendChild(this.container), Ue(
|
|
4616
4676
|
/* @__PURE__ */ h(
|
|
4617
|
-
|
|
4677
|
+
_c,
|
|
4618
4678
|
{
|
|
4619
4679
|
namespace: this.namespace,
|
|
4620
4680
|
publicKey: this.props.publicKey,
|
|
4621
4681
|
sandboxEnvironment: this.props.sandboxEnvironment,
|
|
4682
|
+
forceDevUrl: this.props.forceDevUrl,
|
|
4622
4683
|
presentation: this.props.presentation,
|
|
4623
4684
|
show: !0,
|
|
4624
4685
|
tasks: this.tasks,
|
|
@@ -4655,5 +4716,5 @@ class gc {
|
|
|
4655
4716
|
// }
|
|
4656
4717
|
}
|
|
4657
4718
|
export {
|
|
4658
|
-
|
|
4719
|
+
wc as default
|
|
4659
4720
|
};
|