@microblink/blinkid-ux-manager 7.0.0-next.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/blinkid-ux-manager.js +1963 -0
- package/package.json +27 -0
- package/types/core/BlinkIdProcessingError.d.ts +9 -0
- package/types/core/BlinkIdProcessingError.d.ts.map +1 -0
- package/types/core/BlinkIdUxManager.d.ts +97 -0
- package/types/core/BlinkIdUxManager.d.ts.map +1 -0
- package/types/core/blinkid-ui-state.d.ts +24 -0
- package/types/core/blinkid-ui-state.d.ts.map +1 -0
- package/types/core/blinkid-ui-state.test.d.ts +5 -0
- package/types/core/blinkid-ui-state.test.d.ts.map +1 -0
- package/types/core/utils.d.ts +7 -0
- package/types/core/utils.d.ts.map +1 -0
- package/types/index.d.ts +14 -0
- package/types/index.d.ts.map +1 -0
- package/types/ui/BlinkIdFeedbackUi.d.ts +10 -0
- package/types/ui/BlinkIdFeedbackUi.d.ts.map +1 -0
- package/types/ui/LocalizationContext.d.ts +20 -0
- package/types/ui/LocalizationContext.d.ts.map +1 -0
- package/types/ui/TimeoutModal.d.ts +9 -0
- package/types/ui/TimeoutModal.d.ts.map +1 -0
- package/types/ui/UiFeedbackOverlay.d.ts +9 -0
- package/types/ui/UiFeedbackOverlay.d.ts.map +1 -0
- package/types/ui/UnsupportedDocumentModal.d.ts +6 -0
- package/types/ui/UnsupportedDocumentModal.d.ts.map +1 -0
- package/types/ui/blinkIdUiStore.d.ts +18 -0
- package/types/ui/blinkIdUiStore.d.ts.map +1 -0
- package/types/ui/createBlinkIdFeedbackUi.d.ts +18 -0
- package/types/ui/createBlinkIdFeedbackUi.d.ts.map +1 -0
- package/types/ui/feedbackMessages.d.ts +7 -0
- package/types/ui/feedbackMessages.d.ts.map +1 -0
- package/types/ui/locales/en.d.ts +19 -0
- package/types/ui/locales/en.d.ts.map +1 -0
|
@@ -0,0 +1,1963 @@
|
|
|
1
|
+
(function(){"use strict";(r=>{window.__blinkidUxManagerCssCode=r})("*,:before,:after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }.backface-hidden{backface-visibility:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.left--6{left:-1.5rem}.left-0{left:calc(var(--mb-size)*0rem)}.top-0{top:calc(var(--mb-size)*0rem)}.grid{display:grid}.mb-4{margin-bottom:calc(var(--mb-size)*1rem)}.mb-6{margin-bottom:calc(var(--mb-size)*1.5rem)}.mt-2{margin-top:calc(var(--mb-size)*.5rem)}.size-12{width:calc(var(--mb-size)*3rem);height:calc(var(--mb-size)*3rem)}.size-24{width:calc(var(--mb-size)*6rem);height:calc(var(--mb-size)*6rem)}.size-full{width:100%;height:100%}.h-full{height:100%}.h-vh{height:100vh}.max-h-\\[calc\\(100dvh-4rem\\)\\]{max-height:calc(100dvh - 4rem)}.max-w-45{max-width:calc(var(--mb-size)*11.25rem)}.max-w-md{max-width:28rem}.w-35{width:calc(var(--mb-size)*8.75rem)}.w-full{width:100%}.flex{display:flex}.flex-col{flex-direction:column}.perspective-300px{-webkit-perspective:300px;perspective:300px}.rotate-y-180{--un-rotate:0;--un-rotate-y:180deg;transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.preserve-3d{transform-style:preserve-3d}.transform{transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.select-none{-webkit-user-select:none;user-select:none}.appearance-none{-webkit-appearance:none;appearance:none}.place-items-center{place-items:center}.place-self-center{place-self:center}.justify-center{justify-content:center}.gap-1{gap:calc(var(--mb-size)*.25rem)}.gap-4{gap:calc(var(--mb-size)*1rem)}.overflow-y-auto{overflow-y:auto}.rounded-10{border-radius:calc(var(--mb-size)*2.5rem)}.rounded-2{border-radius:calc(var(--mb-size)*.5rem)}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.border-none{border-style:none}.bg-accent-500{--un-bg-opacity:1;background-color:rgb(30 155 255 / var(--un-bg-opacity))}.bg-black{--un-bg-opacity:1;background-color:rgb(0 0 0 / var(--un-bg-opacity))}.bg-dark-100{--un-bg-opacity:1;background-color:rgb(60 60 60 / var(--un-bg-opacity))}.bg-error-500{--un-bg-opacity:1;background-color:rgb(244 63 94 / var(--un-bg-opacity))}.bg-white{--un-bg-opacity:1;background-color:rgb(255 255 255 / var(--un-bg-opacity))}.hover\\:bg-accent-600:hover{--un-bg-opacity:1;background-color:rgb(6 124 255 / var(--un-bg-opacity))}.hover\\:bg-gray-100:hover{--un-bg-opacity:1;background-color:rgb(243 244 246 / var(--un-bg-opacity))}.bg-opacity-30{--un-bg-opacity:.3}.bg-opacity-50{--un-bg-opacity:.5}.\\[\\&\\>path\\]\\:fill-\\[initial\\]>path{fill:initial}.p-6{padding:calc(var(--mb-size)*1.5rem)}.p-8{padding:calc(var(--mb-size)*2rem)}.px-2{padding-left:calc(var(--mb-size)*.5rem);padding-right:calc(var(--mb-size)*.5rem)}.px-4{padding-left:calc(var(--mb-size)*1rem);padding-right:calc(var(--mb-size)*1rem)}.py-2{padding-top:calc(var(--mb-size)*.5rem);padding-bottom:calc(var(--mb-size)*.5rem)}.py-3{padding-top:calc(var(--mb-size)*.75rem);padding-bottom:calc(var(--mb-size)*.75rem)}.text-center{text-align:center}.text-balance{text-wrap:balance}.text-base{font-size:calc(var(--mb-size)*1rem);line-height:calc(var(--mb-size)*1.5rem)}.text-sm{font-size:calc(var(--mb-size)*.875rem);line-height:calc(var(--mb-size)*1.25rem)}.text-size-5{font-size:calc(var(--mb-size)*1.25rem)}.text-gray-800{--un-text-opacity:1;color:rgb(31 41 55 / var(--un-text-opacity))}.text-white{--un-text-opacity:1;color:rgb(255 255 255 / var(--un-text-opacity))}.color-dark-9{--un-text-opacity:1;color:rgb(15 15 15 / var(--un-text-opacity))}.font-bold{font-weight:700}.font-semibold{font-weight:600}.text-shadow-\\[0_1px_4px_rgba\\(0\\,0\\,0\\,0\\.1\\)\\]{text-shadow:0 1px 4px rgba(0,0,0,.1)}.shadow-lg{--un-shadow:var(--un-shadow-inset) 0 10px 15px -3px var(--un-shadow-color, rgb(0 0 0 / .1)),var(--un-shadow-inset) 0 4px 6px -4px var(--un-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.ring-1{--un-ring-width:1px;--un-ring-offset-shadow:var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color);--un-ring-shadow:var(--un-ring-inset) 0 0 0 calc(var(--un-ring-width) + var(--un-ring-offset-width)) var(--un-ring-color);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.ring-gray-900{--un-ring-opacity:1;--un-ring-color:rgb(17 24 39 / var(--un-ring-opacity)) }.backdrop-blur-xl{--un-backdrop-blur:blur(24px);-webkit-backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia);backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia)}.drop-shadow-\\[0_0_15px_rgba\\(0\\,0\\,0\\,0\\.1\\)\\]{--un-drop-shadow:drop-shadow(0 0 15px rgba(0,0,0,.1));filter:var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-duration-100{transition-duration:.1s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.will-change-transform{will-change:transform}@supports (height:100dvh){.supports-\\[\\(height\\:100dvh\\)\\]\\:h-dvh{height:100dvh}}")})();
|
|
2
|
+
import { ProcessingStatus as ce } from "@microblink/blinkid-core";
|
|
3
|
+
import { createComponent as c, isServer as Fe, mergeProps as $e, Dynamic as Rt, spread as Z, template as b, insert as N, use as ye, Portal as Nt, delegateEvents as dt, render as Ut } from "solid-js/web";
|
|
4
|
+
import { cameraManagerStore as It } from "@microblink/camera-manager";
|
|
5
|
+
import { createContext as Pe, onMount as ft, useContext as Ae, createMemo as Oe, on as Lt, untrack as ve, createSignal as ie, useTransition as Ft, createComputed as $t, batch as de, splitProps as Pt, createEffect as fe, onCleanup as De, Switch as Bt, Match as te, Show as Y, createRoot as Gt } from "solid-js";
|
|
6
|
+
import { createWithSignal as zt } from "solid-zustand";
|
|
7
|
+
import { createStore as ht } from "solid-js/store";
|
|
8
|
+
import { Dialog as V } from "@ark-ui/solid/dialog";
|
|
9
|
+
import { EnvironmentProvider as Kt } from "@ark-ui/solid/environment";
|
|
10
|
+
const U = Symbol.for("@ts-pattern/matcher"), Wt = Symbol.for("@ts-pattern/isVariadic"), he = "@ts-pattern/anonymous-select-key", Me = (e) => !!(e && typeof e == "object"), le = (e) => e && !!e[U], k = (e, t, n) => {
|
|
11
|
+
if (le(e)) {
|
|
12
|
+
const r = e[U](), { matched: i, selections: a } = r.match(t);
|
|
13
|
+
return i && a && Object.keys(a).forEach((s) => n(s, a[s])), i;
|
|
14
|
+
}
|
|
15
|
+
if (Me(e)) {
|
|
16
|
+
if (!Me(t)) return !1;
|
|
17
|
+
if (Array.isArray(e)) {
|
|
18
|
+
if (!Array.isArray(t)) return !1;
|
|
19
|
+
let r = [], i = [], a = [];
|
|
20
|
+
for (const s of e.keys()) {
|
|
21
|
+
const o = e[s];
|
|
22
|
+
le(o) && o[Wt] ? a.push(o) : a.length ? i.push(o) : r.push(o);
|
|
23
|
+
}
|
|
24
|
+
if (a.length) {
|
|
25
|
+
if (a.length > 1) throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");
|
|
26
|
+
if (t.length < r.length + i.length) return !1;
|
|
27
|
+
const s = t.slice(0, r.length), o = i.length === 0 ? [] : t.slice(-i.length), u = t.slice(r.length, i.length === 0 ? 1 / 0 : -i.length);
|
|
28
|
+
return r.every((l, f) => k(l, s[f], n)) && i.every((l, f) => k(l, o[f], n)) && (a.length === 0 || k(a[0], u, n));
|
|
29
|
+
}
|
|
30
|
+
return e.length === t.length && e.every((s, o) => k(s, t[o], n));
|
|
31
|
+
}
|
|
32
|
+
return Reflect.ownKeys(e).every((r) => {
|
|
33
|
+
const i = e[r];
|
|
34
|
+
return (r in t || le(a = i) && a[U]().matcherType === "optional") && k(i, t[r], n);
|
|
35
|
+
var a;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
return Object.is(t, e);
|
|
39
|
+
}, G = (e) => {
|
|
40
|
+
var t, n, r;
|
|
41
|
+
return Me(e) ? le(e) ? (t = (n = (r = e[U]()).getSelectionKeys) == null ? void 0 : n.call(r)) != null ? t : [] : Array.isArray(e) ? ae(e, G) : ae(Object.values(e), G) : [];
|
|
42
|
+
}, ae = (e, t) => e.reduce((n, r) => n.concat(t(r)), []);
|
|
43
|
+
function O(e) {
|
|
44
|
+
return Object.assign(e, { optional: () => jt(e), and: (t) => _(e, t), or: (t) => Vt(e, t), select: (t) => t === void 0 ? We(e) : We(t, e) });
|
|
45
|
+
}
|
|
46
|
+
function jt(e) {
|
|
47
|
+
return O({ [U]: () => ({ match: (t) => {
|
|
48
|
+
let n = {};
|
|
49
|
+
const r = (i, a) => {
|
|
50
|
+
n[i] = a;
|
|
51
|
+
};
|
|
52
|
+
return t === void 0 ? (G(e).forEach((i) => r(i, void 0)), { matched: !0, selections: n }) : { matched: k(e, t, r), selections: n };
|
|
53
|
+
}, getSelectionKeys: () => G(e), matcherType: "optional" }) });
|
|
54
|
+
}
|
|
55
|
+
function _(...e) {
|
|
56
|
+
return O({ [U]: () => ({ match: (t) => {
|
|
57
|
+
let n = {};
|
|
58
|
+
const r = (i, a) => {
|
|
59
|
+
n[i] = a;
|
|
60
|
+
};
|
|
61
|
+
return { matched: e.every((i) => k(i, t, r)), selections: n };
|
|
62
|
+
}, getSelectionKeys: () => ae(e, G), matcherType: "and" }) });
|
|
63
|
+
}
|
|
64
|
+
function Vt(...e) {
|
|
65
|
+
return O({ [U]: () => ({ match: (t) => {
|
|
66
|
+
let n = {};
|
|
67
|
+
const r = (i, a) => {
|
|
68
|
+
n[i] = a;
|
|
69
|
+
};
|
|
70
|
+
return ae(e, G).forEach((i) => r(i, void 0)), { matched: e.some((i) => k(i, t, r)), selections: n };
|
|
71
|
+
}, getSelectionKeys: () => ae(e, G), matcherType: "or" }) });
|
|
72
|
+
}
|
|
73
|
+
function m(e) {
|
|
74
|
+
return { [U]: () => ({ match: (t) => ({ matched: !!e(t) }) }) };
|
|
75
|
+
}
|
|
76
|
+
function We(...e) {
|
|
77
|
+
const t = typeof e[0] == "string" ? e[0] : void 0, n = e.length === 2 ? e[1] : typeof e[0] == "string" ? void 0 : e[0];
|
|
78
|
+
return O({ [U]: () => ({ match: (r) => {
|
|
79
|
+
let i = { [t ?? he]: r };
|
|
80
|
+
return { matched: n === void 0 || k(n, r, (a, s) => {
|
|
81
|
+
i[a] = s;
|
|
82
|
+
}), selections: i };
|
|
83
|
+
}, getSelectionKeys: () => [t ?? he].concat(n === void 0 ? [] : G(n)) }) });
|
|
84
|
+
}
|
|
85
|
+
function M(e) {
|
|
86
|
+
return typeof e == "number";
|
|
87
|
+
}
|
|
88
|
+
function I(e) {
|
|
89
|
+
return typeof e == "string";
|
|
90
|
+
}
|
|
91
|
+
function L(e) {
|
|
92
|
+
return typeof e == "bigint";
|
|
93
|
+
}
|
|
94
|
+
O(m(function(e) {
|
|
95
|
+
return !0;
|
|
96
|
+
}));
|
|
97
|
+
const F = (e) => Object.assign(O(e), { startsWith: (t) => {
|
|
98
|
+
return F(_(e, (n = t, m((r) => I(r) && r.startsWith(n)))));
|
|
99
|
+
var n;
|
|
100
|
+
}, endsWith: (t) => {
|
|
101
|
+
return F(_(e, (n = t, m((r) => I(r) && r.endsWith(n)))));
|
|
102
|
+
var n;
|
|
103
|
+
}, minLength: (t) => F(_(e, ((n) => m((r) => I(r) && r.length >= n))(t))), length: (t) => F(_(e, ((n) => m((r) => I(r) && r.length === n))(t))), maxLength: (t) => F(_(e, ((n) => m((r) => I(r) && r.length <= n))(t))), includes: (t) => {
|
|
104
|
+
return F(_(e, (n = t, m((r) => I(r) && r.includes(n)))));
|
|
105
|
+
var n;
|
|
106
|
+
}, regex: (t) => {
|
|
107
|
+
return F(_(e, (n = t, m((r) => I(r) && !!r.match(n)))));
|
|
108
|
+
var n;
|
|
109
|
+
} });
|
|
110
|
+
F(m(I));
|
|
111
|
+
const x = (e) => Object.assign(O(e), { between: (t, n) => x(_(e, ((r, i) => m((a) => M(a) && r <= a && i >= a))(t, n))), lt: (t) => x(_(e, ((n) => m((r) => M(r) && r < n))(t))), gt: (t) => x(_(e, ((n) => m((r) => M(r) && r > n))(t))), lte: (t) => x(_(e, ((n) => m((r) => M(r) && r <= n))(t))), gte: (t) => x(_(e, ((n) => m((r) => M(r) && r >= n))(t))), int: () => x(_(e, m((t) => M(t) && Number.isInteger(t)))), finite: () => x(_(e, m((t) => M(t) && Number.isFinite(t)))), positive: () => x(_(e, m((t) => M(t) && t > 0))), negative: () => x(_(e, m((t) => M(t) && t < 0))) });
|
|
112
|
+
x(m(M));
|
|
113
|
+
const $ = (e) => Object.assign(O(e), { between: (t, n) => $(_(e, ((r, i) => m((a) => L(a) && r <= a && i >= a))(t, n))), lt: (t) => $(_(e, ((n) => m((r) => L(r) && r < n))(t))), gt: (t) => $(_(e, ((n) => m((r) => L(r) && r > n))(t))), lte: (t) => $(_(e, ((n) => m((r) => L(r) && r <= n))(t))), gte: (t) => $(_(e, ((n) => m((r) => L(r) && r >= n))(t))), positive: () => $(_(e, m((t) => L(t) && t > 0))), negative: () => $(_(e, m((t) => L(t) && t < 0))) });
|
|
114
|
+
$(m(L));
|
|
115
|
+
O(m(function(e) {
|
|
116
|
+
return typeof e == "boolean";
|
|
117
|
+
}));
|
|
118
|
+
O(m(function(e) {
|
|
119
|
+
return typeof e == "symbol";
|
|
120
|
+
}));
|
|
121
|
+
O(m(function(e) {
|
|
122
|
+
return e == null;
|
|
123
|
+
}));
|
|
124
|
+
O(m(function(e) {
|
|
125
|
+
return e != null;
|
|
126
|
+
}));
|
|
127
|
+
class Qt extends Error {
|
|
128
|
+
constructor(t) {
|
|
129
|
+
let n;
|
|
130
|
+
try {
|
|
131
|
+
n = JSON.stringify(t);
|
|
132
|
+
} catch {
|
|
133
|
+
n = t;
|
|
134
|
+
}
|
|
135
|
+
super(`Pattern matching error: no pattern matches value ${n}`), this.input = void 0, this.input = t;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
const xe = { matched: !1, value: void 0 };
|
|
139
|
+
function Yt(e) {
|
|
140
|
+
return new ge(e, xe);
|
|
141
|
+
}
|
|
142
|
+
class ge {
|
|
143
|
+
constructor(t, n) {
|
|
144
|
+
this.input = void 0, this.state = void 0, this.input = t, this.state = n;
|
|
145
|
+
}
|
|
146
|
+
with(...t) {
|
|
147
|
+
if (this.state.matched) return this;
|
|
148
|
+
const n = t[t.length - 1], r = [t[0]];
|
|
149
|
+
let i;
|
|
150
|
+
t.length === 3 && typeof t[1] == "function" ? i = t[1] : t.length > 2 && r.push(...t.slice(1, t.length - 1));
|
|
151
|
+
let a = !1, s = {};
|
|
152
|
+
const o = (l, f) => {
|
|
153
|
+
a = !0, s[l] = f;
|
|
154
|
+
}, u = !r.some((l) => k(l, this.input, o)) || i && !i(this.input) ? xe : { matched: !0, value: n(a ? he in s ? s[he] : s : this.input, this.input) };
|
|
155
|
+
return new ge(this.input, u);
|
|
156
|
+
}
|
|
157
|
+
when(t, n) {
|
|
158
|
+
if (this.state.matched) return this;
|
|
159
|
+
const r = !!t(this.input);
|
|
160
|
+
return new ge(this.input, r ? { matched: !0, value: n(this.input, this.input) } : xe);
|
|
161
|
+
}
|
|
162
|
+
otherwise(t) {
|
|
163
|
+
return this.state.matched ? this.state.value : t(this.input);
|
|
164
|
+
}
|
|
165
|
+
exhaustive() {
|
|
166
|
+
if (this.state.matched) return this.state.value;
|
|
167
|
+
throw new Qt(this.input);
|
|
168
|
+
}
|
|
169
|
+
run() {
|
|
170
|
+
return this.exhaustive();
|
|
171
|
+
}
|
|
172
|
+
returnType() {
|
|
173
|
+
return this;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
const me = {
|
|
177
|
+
PROCESSING: {
|
|
178
|
+
key: "PROCESSING",
|
|
179
|
+
reticleType: "processing",
|
|
180
|
+
minDuration: 1e3
|
|
181
|
+
},
|
|
182
|
+
SCAN_BARCODE: {
|
|
183
|
+
key: "SCAN_BARCODE",
|
|
184
|
+
reticleType: "processing",
|
|
185
|
+
minDuration: 1e3
|
|
186
|
+
},
|
|
187
|
+
SIDE_CAPTURED: {
|
|
188
|
+
key: "SIDE_CAPTURED",
|
|
189
|
+
reticleType: "flip",
|
|
190
|
+
minDuration: 2e3,
|
|
191
|
+
singleEmit: !0
|
|
192
|
+
},
|
|
193
|
+
DOCUMENT_CAPTURED: {
|
|
194
|
+
key: "DOCUMENT_CAPTURED",
|
|
195
|
+
reticleType: "done",
|
|
196
|
+
minDuration: 1e3,
|
|
197
|
+
singleEmit: !0
|
|
198
|
+
},
|
|
199
|
+
LOW_QUALITY_FRONT: {
|
|
200
|
+
key: "LOW_QUALITY_FRONT",
|
|
201
|
+
reticleType: "searching",
|
|
202
|
+
minDuration: 1e3
|
|
203
|
+
},
|
|
204
|
+
LOW_QUALITY_BACK: {
|
|
205
|
+
key: "LOW_QUALITY_BACK",
|
|
206
|
+
reticleType: "searching",
|
|
207
|
+
minDuration: 1e3
|
|
208
|
+
},
|
|
209
|
+
SENSING_FRONT: {
|
|
210
|
+
key: "SENSING_FRONT",
|
|
211
|
+
reticleType: "searching",
|
|
212
|
+
minDuration: 1e3
|
|
213
|
+
},
|
|
214
|
+
SENSING_BACK: {
|
|
215
|
+
key: "SENSING_BACK",
|
|
216
|
+
reticleType: "searching",
|
|
217
|
+
minDuration: 1e3
|
|
218
|
+
},
|
|
219
|
+
DOCUMENT_FRAMING_CAMERA_TOO_FAR: {
|
|
220
|
+
key: "DOCUMENT_FRAMING_CAMERA_TOO_FAR",
|
|
221
|
+
reticleType: "error",
|
|
222
|
+
minDuration: 1500
|
|
223
|
+
},
|
|
224
|
+
DOCUMENT_FRAMING_CAMERA_TOO_CLOSE: {
|
|
225
|
+
key: "DOCUMENT_FRAMING_CAMERA_TOO_CLOSE",
|
|
226
|
+
reticleType: "error",
|
|
227
|
+
minDuration: 1500
|
|
228
|
+
},
|
|
229
|
+
DOCUMENT_FRAMING_CAMERA_ANGLE_TOO_STEEP: {
|
|
230
|
+
key: "DOCUMENT_FRAMING_CAMERA_ANGLE_TOO_STEEP",
|
|
231
|
+
reticleType: "error",
|
|
232
|
+
minDuration: 1500
|
|
233
|
+
},
|
|
234
|
+
DOCUMENT_TOO_CLOSE_TO_FRAME_EDGE: {
|
|
235
|
+
key: "DOCUMENT_TOO_CLOSE_TO_FRAME_EDGE",
|
|
236
|
+
reticleType: "error",
|
|
237
|
+
minDuration: 1500
|
|
238
|
+
},
|
|
239
|
+
BLUR_DETECTED: {
|
|
240
|
+
key: "BLUR_DETECTED",
|
|
241
|
+
reticleType: "error",
|
|
242
|
+
minDuration: 1500
|
|
243
|
+
},
|
|
244
|
+
GLARE_DETECTED: {
|
|
245
|
+
key: "GLARE_DETECTED",
|
|
246
|
+
reticleType: "error",
|
|
247
|
+
minDuration: 1500
|
|
248
|
+
},
|
|
249
|
+
OCCLUDED: {
|
|
250
|
+
key: "OCCLUDED",
|
|
251
|
+
reticleType: "error",
|
|
252
|
+
minDuration: 1500
|
|
253
|
+
},
|
|
254
|
+
WRONG_SIDE: {
|
|
255
|
+
key: "WRONG_SIDE",
|
|
256
|
+
reticleType: "error",
|
|
257
|
+
minDuration: 1500
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
function Ht(e) {
|
|
261
|
+
return Yt(
|
|
262
|
+
e
|
|
263
|
+
).with(
|
|
264
|
+
{
|
|
265
|
+
captureState: "document-captured"
|
|
266
|
+
},
|
|
267
|
+
() => "DOCUMENT_CAPTURED"
|
|
268
|
+
).with(
|
|
269
|
+
{
|
|
270
|
+
captureState: "side-captured"
|
|
271
|
+
},
|
|
272
|
+
() => "SIDE_CAPTURED"
|
|
273
|
+
).with(
|
|
274
|
+
{
|
|
275
|
+
captureState: "first-side-capture-in-progress",
|
|
276
|
+
frameAnalysisStatus: {
|
|
277
|
+
framingStatus: "no-document",
|
|
278
|
+
lowQualityInput: !0,
|
|
279
|
+
blurDetected: !1,
|
|
280
|
+
glareDetected: !1
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
() => "LOW_QUALITY_FRONT"
|
|
284
|
+
).with(
|
|
285
|
+
{
|
|
286
|
+
captureState: "second-side-capture-in-progress",
|
|
287
|
+
frameAnalysisStatus: {
|
|
288
|
+
framingStatus: "no-document",
|
|
289
|
+
lowQualityInput: !0,
|
|
290
|
+
blurDetected: !1,
|
|
291
|
+
glareDetected: !1
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
() => "LOW_QUALITY_BACK"
|
|
295
|
+
).with(
|
|
296
|
+
{
|
|
297
|
+
captureState: "first-side-capture-in-progress",
|
|
298
|
+
frameAnalysisStatus: {
|
|
299
|
+
framingStatus: "no-document",
|
|
300
|
+
blurDetected: !1,
|
|
301
|
+
glareDetected: !1
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
() => "SENSING_FRONT"
|
|
305
|
+
).with(
|
|
306
|
+
{
|
|
307
|
+
captureState: "second-side-capture-in-progress",
|
|
308
|
+
frameAnalysisStatus: {
|
|
309
|
+
framingStatus: "no-document",
|
|
310
|
+
blurDetected: !1,
|
|
311
|
+
glareDetected: !1
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
() => "SENSING_BACK"
|
|
315
|
+
).with(
|
|
316
|
+
{
|
|
317
|
+
frameAnalysisStatus: {
|
|
318
|
+
scanningWrongSide: !0
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
() => "WRONG_SIDE"
|
|
322
|
+
).with(
|
|
323
|
+
{
|
|
324
|
+
captureState: "barcode-scanning-in-progress"
|
|
325
|
+
},
|
|
326
|
+
() => "SCAN_BARCODE"
|
|
327
|
+
).with(
|
|
328
|
+
{
|
|
329
|
+
frameAnalysisStatus: {
|
|
330
|
+
framingStatus: "camera-angle-too-steep"
|
|
331
|
+
}
|
|
332
|
+
},
|
|
333
|
+
() => "DOCUMENT_FRAMING_CAMERA_ANGLE_TOO_STEEP"
|
|
334
|
+
).with(
|
|
335
|
+
{
|
|
336
|
+
frameAnalysisStatus: {
|
|
337
|
+
framingStatus: "camera-too-close"
|
|
338
|
+
}
|
|
339
|
+
},
|
|
340
|
+
() => "DOCUMENT_FRAMING_CAMERA_TOO_CLOSE"
|
|
341
|
+
).with(
|
|
342
|
+
{
|
|
343
|
+
frameAnalysisStatus: {
|
|
344
|
+
framingStatus: "camera-too-far"
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
() => "DOCUMENT_FRAMING_CAMERA_TOO_FAR"
|
|
348
|
+
).with(
|
|
349
|
+
{
|
|
350
|
+
frameAnalysisStatus: {
|
|
351
|
+
framingStatus: "document-too-close-to-frame-edge"
|
|
352
|
+
}
|
|
353
|
+
},
|
|
354
|
+
() => "DOCUMENT_TOO_CLOSE_TO_FRAME_EDGE"
|
|
355
|
+
).with(
|
|
356
|
+
{
|
|
357
|
+
frameAnalysisStatus: {
|
|
358
|
+
blurDetected: !0
|
|
359
|
+
}
|
|
360
|
+
},
|
|
361
|
+
() => "BLUR_DETECTED"
|
|
362
|
+
).with(
|
|
363
|
+
{
|
|
364
|
+
frameAnalysisStatus: {
|
|
365
|
+
glareDetected: !0
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
() => "GLARE_DETECTED"
|
|
369
|
+
).with(
|
|
370
|
+
{
|
|
371
|
+
frameAnalysisStatus: {
|
|
372
|
+
framingStatus: "document-not-fully-visible"
|
|
373
|
+
}
|
|
374
|
+
},
|
|
375
|
+
() => "OCCLUDED"
|
|
376
|
+
).with(
|
|
377
|
+
{
|
|
378
|
+
captureState: "first-side-capture-in-progress",
|
|
379
|
+
frameAnalysisStatus: {
|
|
380
|
+
framingStatus: "ok"
|
|
381
|
+
}
|
|
382
|
+
},
|
|
383
|
+
() => "PROCESSING"
|
|
384
|
+
).with(
|
|
385
|
+
{
|
|
386
|
+
captureState: "second-side-capture-in-progress",
|
|
387
|
+
frameAnalysisStatus: {
|
|
388
|
+
framingStatus: "ok"
|
|
389
|
+
}
|
|
390
|
+
},
|
|
391
|
+
() => "PROCESSING"
|
|
392
|
+
).otherwise(() => "SENSING_FRONT");
|
|
393
|
+
}
|
|
394
|
+
function qt(e) {
|
|
395
|
+
const t = Object.keys(e);
|
|
396
|
+
if (t.length === 0)
|
|
397
|
+
throw new Error("No members in object!");
|
|
398
|
+
let n = t[0], r = -1 / 0;
|
|
399
|
+
for (const [i, a] of Object.entries(e))
|
|
400
|
+
a > r && (r = a, n = i);
|
|
401
|
+
return n;
|
|
402
|
+
}
|
|
403
|
+
class Xt {
|
|
404
|
+
initialKey;
|
|
405
|
+
uiStateMap;
|
|
406
|
+
timeWindow = 3e3;
|
|
407
|
+
decayRate = 0.95;
|
|
408
|
+
eventQueue = [];
|
|
409
|
+
/** this is a special queue as min duration of the event can be longer than the `timeWindow` */
|
|
410
|
+
singleEventQueue = [];
|
|
411
|
+
// used for tracking current state
|
|
412
|
+
currentKey;
|
|
413
|
+
currentStateStartTime = performance.now();
|
|
414
|
+
summedScores = {};
|
|
415
|
+
scoreBoard = {};
|
|
416
|
+
get currentState() {
|
|
417
|
+
return this.uiStateMap[this.currentKey];
|
|
418
|
+
}
|
|
419
|
+
getEventQueue() {
|
|
420
|
+
return structuredClone(this.eventQueue);
|
|
421
|
+
}
|
|
422
|
+
getScores() {
|
|
423
|
+
return structuredClone(this.summedScores);
|
|
424
|
+
}
|
|
425
|
+
getScoreBoard() {
|
|
426
|
+
return structuredClone(this.scoreBoard);
|
|
427
|
+
}
|
|
428
|
+
setTimeWindow(t) {
|
|
429
|
+
this.timeWindow = t;
|
|
430
|
+
}
|
|
431
|
+
constructor(t, n, r, i) {
|
|
432
|
+
this.uiStateMap = t, this.initialKey = n, this.currentKey = n, this.getNewUiState(n), r && (this.timeWindow = r), i && (this.decayRate = i);
|
|
433
|
+
}
|
|
434
|
+
reset() {
|
|
435
|
+
this.currentKey = this.initialKey, this.eventQueue = [], this.singleEventQueue = [], this.summedScores = {};
|
|
436
|
+
}
|
|
437
|
+
canShowNewUiState = () => performance.now() - this.currentStateStartTime >= this.currentState.minDuration;
|
|
438
|
+
/**
|
|
439
|
+
* Returns a weighted UI state based on the history
|
|
440
|
+
*/
|
|
441
|
+
getNewUiState(t) {
|
|
442
|
+
const n = performance.now(), r = this.uiStateMap[t].initialWeight, i = {
|
|
443
|
+
key: t,
|
|
444
|
+
timeStamp: n,
|
|
445
|
+
currentWeight: r ?? 1,
|
|
446
|
+
singleEmit: this.uiStateMap[t].singleEmit
|
|
447
|
+
};
|
|
448
|
+
if (i.singleEmit && this.singleEventQueue.push(i), this.canShowNewUiState() && this.singleEventQueue.length > 0) {
|
|
449
|
+
const o = this.singleEventQueue.shift();
|
|
450
|
+
return this.eventQueue = [], this.currentKey = o.key, this.currentStateStartTime = n, this.uiStateMap[o.key];
|
|
451
|
+
}
|
|
452
|
+
if (this.eventQueue.push(i), this.scoreBoard = {}, this.eventQueue.forEach((o) => {
|
|
453
|
+
if (n - o.timeStamp > this.timeWindow) {
|
|
454
|
+
this.eventQueue.shift();
|
|
455
|
+
return;
|
|
456
|
+
}
|
|
457
|
+
const u = o.timeStamp / n;
|
|
458
|
+
o.currentWeight *= this.decayRate * u, this.scoreBoard[o.key] || (this.scoreBoard[o.key] = []), this.scoreBoard[o.key].push(o.currentWeight);
|
|
459
|
+
}), !this.canShowNewUiState())
|
|
460
|
+
return this.uiStateMap[this.currentKey];
|
|
461
|
+
this.summedScores = {};
|
|
462
|
+
for (const o in this.scoreBoard) {
|
|
463
|
+
const u = this.scoreBoard[o];
|
|
464
|
+
if (!u)
|
|
465
|
+
throw new Error("no track - SHOULD NOT HAPPEN");
|
|
466
|
+
if (!this.scoreBoard[o])
|
|
467
|
+
throw new Error("no score board for key");
|
|
468
|
+
const l = u.length / this.eventQueue.length, f = this.scoreBoard[o].reduce((y, g) => y + g, 0);
|
|
469
|
+
this.summedScores[o] = f * l;
|
|
470
|
+
}
|
|
471
|
+
if (Object.keys(this.summedScores).length === 0)
|
|
472
|
+
return this.uiStateMap[this.currentKey];
|
|
473
|
+
const a = qt(this.summedScores), s = this.uiStateMap[a];
|
|
474
|
+
return s.key !== this.currentKey && (this.currentKey = a, this.currentStateStartTime = n), s;
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
async function je(e) {
|
|
478
|
+
return new Promise((t) => setTimeout(t, e));
|
|
479
|
+
}
|
|
480
|
+
class Hr {
|
|
481
|
+
#t = !1;
|
|
482
|
+
#n;
|
|
483
|
+
/** Timeout duration in ms */
|
|
484
|
+
#s = 1e4;
|
|
485
|
+
// 10s
|
|
486
|
+
clearScanTimeout = () => {
|
|
487
|
+
console.debug("⏳🔴 clearing timeout"), window.clearTimeout(this.#n);
|
|
488
|
+
};
|
|
489
|
+
#r = /* @__PURE__ */ new Set();
|
|
490
|
+
#i = /* @__PURE__ */ new Set();
|
|
491
|
+
#a = /* @__PURE__ */ new Set();
|
|
492
|
+
#e = /* @__PURE__ */ new Set();
|
|
493
|
+
#o = /* @__PURE__ */ new Set();
|
|
494
|
+
/**
|
|
495
|
+
* Adds a callback function to be executed when the UI state changes.
|
|
496
|
+
* @param callback - Function to be called when UI state changes. Receives the new UI state as parameter.
|
|
497
|
+
* @returns A cleanup function that removes the callback when called.
|
|
498
|
+
* @example
|
|
499
|
+
* const cleanup = manager.addOnUiStateChangedCallback((newState) => {
|
|
500
|
+
* console.log('UI state changed to:', newState);
|
|
501
|
+
* });
|
|
502
|
+
*
|
|
503
|
+
* cleanup();
|
|
504
|
+
*/
|
|
505
|
+
addOnUiStateChangedCallback(t) {
|
|
506
|
+
return this.#r.add(t), () => {
|
|
507
|
+
this.#r.delete(t);
|
|
508
|
+
};
|
|
509
|
+
}
|
|
510
|
+
/**
|
|
511
|
+
* Registers a callback function to be called when a scan result is available.
|
|
512
|
+
* @param callback - A function that will be called with the scan result.
|
|
513
|
+
* @returns A cleanup function that, when called, will remove the registered callback.
|
|
514
|
+
*
|
|
515
|
+
* @example
|
|
516
|
+
*
|
|
517
|
+
* const cleanup = manager.addOnResultCallback((result) => {
|
|
518
|
+
* console.log('Scan result:', result);
|
|
519
|
+
* });
|
|
520
|
+
*
|
|
521
|
+
* // Later, to remove the callback:
|
|
522
|
+
* cleanup();
|
|
523
|
+
*/
|
|
524
|
+
addOnResultCallback(t) {
|
|
525
|
+
return this.#i.add(t), () => {
|
|
526
|
+
this.#i.delete(t);
|
|
527
|
+
};
|
|
528
|
+
}
|
|
529
|
+
/**
|
|
530
|
+
* Registers a callback function to be called when a frame is processed.
|
|
531
|
+
* @param callback - A function that will be called with the frame analysis result.
|
|
532
|
+
* @returns A cleanup function that, when called, will remove the registered callback.
|
|
533
|
+
*
|
|
534
|
+
* @example
|
|
535
|
+
* const cleanup = manager.addOnFrameProcessCallback((frameResult) => {
|
|
536
|
+
* console.log('Frame processed:', frameResult);
|
|
537
|
+
* });
|
|
538
|
+
*
|
|
539
|
+
* // Later, to remove the callback:
|
|
540
|
+
* cleanup();
|
|
541
|
+
*/
|
|
542
|
+
addOnFrameProcessCallback(t) {
|
|
543
|
+
return this.#a.add(t), () => {
|
|
544
|
+
this.#a.delete(t);
|
|
545
|
+
};
|
|
546
|
+
}
|
|
547
|
+
/**
|
|
548
|
+
* Registers a callback function to be called when an error occurs during processing.
|
|
549
|
+
* @param callback - A function that will be called with the error state.
|
|
550
|
+
* @returns A cleanup function that, when called, will remove the registered callback.
|
|
551
|
+
*
|
|
552
|
+
* @example
|
|
553
|
+
* const cleanup = manager.addOnErrorCallback((error) => {
|
|
554
|
+
* console.error('Processing error:', error);
|
|
555
|
+
* });
|
|
556
|
+
*
|
|
557
|
+
* // Later, to remove the callback:
|
|
558
|
+
* cleanup();
|
|
559
|
+
*/
|
|
560
|
+
addOnErrorCallback(t) {
|
|
561
|
+
return this.#e.add(t), () => {
|
|
562
|
+
this.#e.delete(t);
|
|
563
|
+
};
|
|
564
|
+
}
|
|
565
|
+
/**
|
|
566
|
+
* Registers a callback function to be called when the user cancels the scanning process.
|
|
567
|
+
* @param callback - A function that will be called with the cancellation reason.
|
|
568
|
+
* @returns A cleanup function that, when called, will remove the registered callback.
|
|
569
|
+
*
|
|
570
|
+
* @example
|
|
571
|
+
* const cleanup = manager.addOnUserCancelCallback((reason) => {
|
|
572
|
+
* console.log('User cancelled scan:', reason);
|
|
573
|
+
* });
|
|
574
|
+
*
|
|
575
|
+
* // Later, to remove the callback:
|
|
576
|
+
* cleanup();
|
|
577
|
+
*/
|
|
578
|
+
addOnUserCancelCallback(t) {
|
|
579
|
+
return this.#o.add(t), () => {
|
|
580
|
+
this.#o.delete(t);
|
|
581
|
+
};
|
|
582
|
+
}
|
|
583
|
+
constructor(t, n) {
|
|
584
|
+
this.cameraManager = t, this.blinkIdCore = n, this.feedbackStabilizer = new Xt(
|
|
585
|
+
me,
|
|
586
|
+
"SENSING_FRONT"
|
|
587
|
+
), this.uiState = this.feedbackStabilizer.currentState;
|
|
588
|
+
const r = this.cameraManager.subscribe(
|
|
589
|
+
(a) => a.playbackState,
|
|
590
|
+
(a) => {
|
|
591
|
+
console.debug(`⏯️ ${a}`), a !== "capturing" ? this.clearScanTimeout() : (console.debug("🔁 continuing timeout"), this.#c(this.uiState));
|
|
592
|
+
}
|
|
593
|
+
), i = t.subscribe(
|
|
594
|
+
(a) => a.videoElement,
|
|
595
|
+
(a) => {
|
|
596
|
+
a || (console.debug("Removing timeout subscriptions"), i(), r());
|
|
597
|
+
}
|
|
598
|
+
);
|
|
599
|
+
t.addFrameCaptureCallback(async (a) => {
|
|
600
|
+
if (this.#t)
|
|
601
|
+
return;
|
|
602
|
+
this.#t = !0;
|
|
603
|
+
const s = await n.processImage(a);
|
|
604
|
+
this.#t = !1;
|
|
605
|
+
for (const y of this.#a)
|
|
606
|
+
y(s);
|
|
607
|
+
if (s.processingStatus === ce.StabilityTestFailed)
|
|
608
|
+
return;
|
|
609
|
+
const o = s.processingStatus;
|
|
610
|
+
if (o === ce.UnsupportedByLicense || o === ce.UnsupportedClass || o === ce.ClassFiltered) {
|
|
611
|
+
this.cameraManager.stopFrameCapture(), this.feedbackStabilizer.reset(), this.uiState = this.feedbackStabilizer.currentState;
|
|
612
|
+
for (const y of this.#e)
|
|
613
|
+
y("unsupported-document");
|
|
614
|
+
return;
|
|
615
|
+
}
|
|
616
|
+
const l = Ht(s);
|
|
617
|
+
this.rawUiStateKey = l;
|
|
618
|
+
const f = this.feedbackStabilizer.getNewUiState(l);
|
|
619
|
+
if (f.key !== this.uiState.key) {
|
|
620
|
+
this.uiState = f;
|
|
621
|
+
for (const y of this.#r)
|
|
622
|
+
y(f);
|
|
623
|
+
this.handleUiStateChange(f);
|
|
624
|
+
}
|
|
625
|
+
});
|
|
626
|
+
}
|
|
627
|
+
/**
|
|
628
|
+
* Set the duration of the timeout in milliseconds.
|
|
629
|
+
*/
|
|
630
|
+
setTimeoutDuration(t) {
|
|
631
|
+
this.#s = t;
|
|
632
|
+
}
|
|
633
|
+
#c = (t) => {
|
|
634
|
+
console.debug(`⏳🟢 starting timeout for ${t.key}`), this.#n = window.setTimeout(() => {
|
|
635
|
+
this.cameraManager.stopFrameCapture();
|
|
636
|
+
for (const n of this.#e)
|
|
637
|
+
n("timeout");
|
|
638
|
+
this.feedbackStabilizer.reset(), this.uiState = this.feedbackStabilizer.currentState;
|
|
639
|
+
}, this.#s);
|
|
640
|
+
};
|
|
641
|
+
// Side-effects are handled here
|
|
642
|
+
async handleUiStateChange(t) {
|
|
643
|
+
if (console.debug("state changed", t.key), // low quality
|
|
644
|
+
t.key === "LOW_QUALITY_FRONT" || t.key === "LOW_QUALITY_BACK" || // regular
|
|
645
|
+
t.key === "SENSING_FRONT" || t.key === "SENSING_BACK") {
|
|
646
|
+
this.#n || this.#c(t);
|
|
647
|
+
return;
|
|
648
|
+
}
|
|
649
|
+
if (this.clearScanTimeout(), t.key === "SIDE_CAPTURED") {
|
|
650
|
+
this.cameraManager.stopFrameCapture(), await je(t.minDuration), await this.cameraManager.startFrameCapture();
|
|
651
|
+
return;
|
|
652
|
+
}
|
|
653
|
+
if (t.key === "DOCUMENT_CAPTURED") {
|
|
654
|
+
this.cameraManager.stopFrameCapture(), await je(t.minDuration);
|
|
655
|
+
const n = await this.blinkIdCore.getResult();
|
|
656
|
+
for (const r of this.#i)
|
|
657
|
+
r(n);
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
const Zt = {
|
|
662
|
+
scan_the_front_side: "Scan the front side of the document",
|
|
663
|
+
flip_document: "Flip the document",
|
|
664
|
+
scan_the_back_side: "Scan the back side of the document",
|
|
665
|
+
scan_the_barcode: "Scan the barcode",
|
|
666
|
+
scanning_wrong_side: "Scanning wrong side",
|
|
667
|
+
move_closer: "Move closer",
|
|
668
|
+
move_farther: "Move farther",
|
|
669
|
+
camera_angle_too_steep: "Keep document parallel to phone",
|
|
670
|
+
document_too_close_to_edge: "Move farther",
|
|
671
|
+
blur_detected: "Keep document and phone still",
|
|
672
|
+
glare_detected: "Tilt or move document to remove reflection",
|
|
673
|
+
occluded: "Keep the document fully visible"
|
|
674
|
+
// new one
|
|
675
|
+
// low_quality: "Clean your camera lens or try a different camera",
|
|
676
|
+
// `as const` is required for autocomplete to work
|
|
677
|
+
}, gt = Pe(), Jt = (e) => {
|
|
678
|
+
const [t, n] = ht(
|
|
679
|
+
// we structure clone to avoid proxying to the original object
|
|
680
|
+
structuredClone({
|
|
681
|
+
...Zt,
|
|
682
|
+
// we don't care on init
|
|
683
|
+
// eslint-disable-next-line solid/reactivity
|
|
684
|
+
...e.userStrings
|
|
685
|
+
})
|
|
686
|
+
);
|
|
687
|
+
ft(() => {
|
|
688
|
+
e.setLocalizationRef(n);
|
|
689
|
+
});
|
|
690
|
+
const r = {
|
|
691
|
+
t,
|
|
692
|
+
updateLocalization: n
|
|
693
|
+
};
|
|
694
|
+
return c(gt.Provider, {
|
|
695
|
+
value: r,
|
|
696
|
+
get children() {
|
|
697
|
+
return e.children;
|
|
698
|
+
}
|
|
699
|
+
});
|
|
700
|
+
};
|
|
701
|
+
function en() {
|
|
702
|
+
const e = Ae(gt);
|
|
703
|
+
if (!e)
|
|
704
|
+
throw new Error("LocalizationContext.Provider not in scope.");
|
|
705
|
+
return e;
|
|
706
|
+
}
|
|
707
|
+
function tn(e) {
|
|
708
|
+
const t = typeof e.on == "function" || Array.isArray(e.on) ? e.on : () => e.on;
|
|
709
|
+
return Oe(Lt(t, (n, r) => {
|
|
710
|
+
const i = e.children;
|
|
711
|
+
return typeof i == "function" && i.length > 0 ? i(n, r) : i;
|
|
712
|
+
}));
|
|
713
|
+
}
|
|
714
|
+
var nn = /((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;
|
|
715
|
+
function Ve(e) {
|
|
716
|
+
const t = {};
|
|
717
|
+
let n;
|
|
718
|
+
for (; n = nn.exec(e); )
|
|
719
|
+
t[n[1]] = n[2];
|
|
720
|
+
return t;
|
|
721
|
+
}
|
|
722
|
+
function rn(e, t) {
|
|
723
|
+
if (typeof e == "string") {
|
|
724
|
+
if (typeof t == "string")
|
|
725
|
+
return `${e};${t}`;
|
|
726
|
+
e = Ve(e);
|
|
727
|
+
} else typeof t == "string" && (t = Ve(t));
|
|
728
|
+
return { ...e, ...t };
|
|
729
|
+
}
|
|
730
|
+
function mt(e, t) {
|
|
731
|
+
e.indexOf(t) === -1 && e.push(t);
|
|
732
|
+
}
|
|
733
|
+
function an(e, t) {
|
|
734
|
+
const n = e.indexOf(t);
|
|
735
|
+
n > -1 && e.splice(n, 1);
|
|
736
|
+
}
|
|
737
|
+
const pt = (e, t, n) => Math.min(Math.max(n, e), t), D = {
|
|
738
|
+
duration: 0.3,
|
|
739
|
+
delay: 0,
|
|
740
|
+
endDelay: 0,
|
|
741
|
+
repeat: 0,
|
|
742
|
+
easing: "ease"
|
|
743
|
+
}, se = (e) => typeof e == "number", H = (e) => Array.isArray(e) && !se(e[0]), sn = (e, t, n) => {
|
|
744
|
+
const r = t - e;
|
|
745
|
+
return ((n - e) % r + r) % r + e;
|
|
746
|
+
};
|
|
747
|
+
function on(e, t) {
|
|
748
|
+
return H(e) ? e[sn(0, e.length, t)] : e;
|
|
749
|
+
}
|
|
750
|
+
const yt = (e, t, n) => -n * e + n * t + e, St = () => {
|
|
751
|
+
}, P = (e) => e, Be = (e, t, n) => t - e === 0 ? 1 : (n - e) / (t - e);
|
|
752
|
+
function _t(e, t) {
|
|
753
|
+
const n = e[e.length - 1];
|
|
754
|
+
for (let r = 1; r <= t; r++) {
|
|
755
|
+
const i = Be(0, t, r);
|
|
756
|
+
e.push(yt(n, 1, i));
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
function cn(e) {
|
|
760
|
+
const t = [0];
|
|
761
|
+
return _t(t, e - 1), t;
|
|
762
|
+
}
|
|
763
|
+
function ln(e, t = cn(e.length), n = P) {
|
|
764
|
+
const r = e.length, i = r - t.length;
|
|
765
|
+
return i > 0 && _t(t, i), (a) => {
|
|
766
|
+
let s = 0;
|
|
767
|
+
for (; s < r - 2 && !(a < t[s + 1]); s++)
|
|
768
|
+
;
|
|
769
|
+
let o = pt(0, 1, Be(t[s], t[s + 1], a));
|
|
770
|
+
return o = on(n, s)(o), yt(e[s], e[s + 1], o);
|
|
771
|
+
};
|
|
772
|
+
}
|
|
773
|
+
const vt = (e) => Array.isArray(e) && se(e[0]), ke = (e) => typeof e == "object" && !!e.createAnimation, oe = (e) => typeof e == "function", un = (e) => typeof e == "string", Ee = {
|
|
774
|
+
ms: (e) => e * 1e3,
|
|
775
|
+
s: (e) => e / 1e3
|
|
776
|
+
}, Et = (e, t, n) => (((1 - 3 * n + 3 * t) * e + (3 * n - 6 * t)) * e + 3 * t) * e, dn = 1e-7, fn = 12;
|
|
777
|
+
function hn(e, t, n, r, i) {
|
|
778
|
+
let a, s, o = 0;
|
|
779
|
+
do
|
|
780
|
+
s = t + (n - t) / 2, a = Et(s, r, i) - e, a > 0 ? n = s : t = s;
|
|
781
|
+
while (Math.abs(a) > dn && ++o < fn);
|
|
782
|
+
return s;
|
|
783
|
+
}
|
|
784
|
+
function ne(e, t, n, r) {
|
|
785
|
+
if (e === t && n === r)
|
|
786
|
+
return P;
|
|
787
|
+
const i = (a) => hn(a, 0, 1, e, n);
|
|
788
|
+
return (a) => a === 0 || a === 1 ? a : Et(i(a), t, r);
|
|
789
|
+
}
|
|
790
|
+
const gn = (e, t = "end") => (n) => {
|
|
791
|
+
n = t === "end" ? Math.min(n, 0.999) : Math.max(n, 1e-3);
|
|
792
|
+
const r = n * e, i = t === "end" ? Math.floor(r) : Math.ceil(r);
|
|
793
|
+
return pt(0, 1, i / e);
|
|
794
|
+
}, mn = {
|
|
795
|
+
ease: ne(0.25, 0.1, 0.25, 1),
|
|
796
|
+
"ease-in": ne(0.42, 0, 1, 1),
|
|
797
|
+
"ease-in-out": ne(0.42, 0, 0.58, 1),
|
|
798
|
+
"ease-out": ne(0, 0, 0.58, 1)
|
|
799
|
+
}, pn = /\((.*?)\)/;
|
|
800
|
+
function Qe(e) {
|
|
801
|
+
if (oe(e))
|
|
802
|
+
return e;
|
|
803
|
+
if (vt(e))
|
|
804
|
+
return ne(...e);
|
|
805
|
+
const t = mn[e];
|
|
806
|
+
if (t)
|
|
807
|
+
return t;
|
|
808
|
+
if (e.startsWith("steps")) {
|
|
809
|
+
const n = pn.exec(e);
|
|
810
|
+
if (n) {
|
|
811
|
+
const r = n[1].split(",");
|
|
812
|
+
return gn(parseFloat(r[0]), r[1].trim());
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
return P;
|
|
816
|
+
}
|
|
817
|
+
class yn {
|
|
818
|
+
constructor(t, n = [0, 1], { easing: r, duration: i = D.duration, delay: a = D.delay, endDelay: s = D.endDelay, repeat: o = D.repeat, offset: u, direction: l = "normal", autoplay: f = !0 } = {}) {
|
|
819
|
+
if (this.startTime = null, this.rate = 1, this.t = 0, this.cancelTimestamp = null, this.easing = P, this.duration = 0, this.totalDuration = 0, this.repeat = 0, this.playState = "idle", this.finished = new Promise((g, A) => {
|
|
820
|
+
this.resolve = g, this.reject = A;
|
|
821
|
+
}), r = r || D.easing, ke(r)) {
|
|
822
|
+
const g = r.createAnimation(n);
|
|
823
|
+
r = g.easing, n = g.keyframes || n, i = g.duration || i;
|
|
824
|
+
}
|
|
825
|
+
this.repeat = o, this.easing = H(r) ? P : Qe(r), this.updateDuration(i);
|
|
826
|
+
const y = ln(n, u, H(r) ? r.map(Qe) : P);
|
|
827
|
+
this.tick = (g) => {
|
|
828
|
+
var A;
|
|
829
|
+
a = a;
|
|
830
|
+
let h = 0;
|
|
831
|
+
this.pauseTime !== void 0 ? h = this.pauseTime : h = (g - this.startTime) * this.rate, this.t = h, h /= 1e3, h = Math.max(h - a, 0), this.playState === "finished" && this.pauseTime === void 0 && (h = this.totalDuration);
|
|
832
|
+
const d = h / this.duration;
|
|
833
|
+
let v = Math.floor(d), T = d % 1;
|
|
834
|
+
!T && d >= 1 && (T = 1), T === 1 && v--;
|
|
835
|
+
const z = v % 2;
|
|
836
|
+
(l === "reverse" || l === "alternate" && z || l === "alternate-reverse" && !z) && (T = 1 - T);
|
|
837
|
+
const K = h >= this.totalDuration ? 1 : Math.min(T, 1), R = y(this.easing(K));
|
|
838
|
+
t(R), this.pauseTime === void 0 && (this.playState === "finished" || h >= this.totalDuration + s) ? (this.playState = "finished", (A = this.resolve) === null || A === void 0 || A.call(this, R)) : this.playState !== "idle" && (this.frameRequestId = requestAnimationFrame(this.tick));
|
|
839
|
+
}, f && this.play();
|
|
840
|
+
}
|
|
841
|
+
play() {
|
|
842
|
+
const t = performance.now();
|
|
843
|
+
this.playState = "running", this.pauseTime !== void 0 ? this.startTime = t - this.pauseTime : this.startTime || (this.startTime = t), this.cancelTimestamp = this.startTime, this.pauseTime = void 0, this.frameRequestId = requestAnimationFrame(this.tick);
|
|
844
|
+
}
|
|
845
|
+
pause() {
|
|
846
|
+
this.playState = "paused", this.pauseTime = this.t;
|
|
847
|
+
}
|
|
848
|
+
finish() {
|
|
849
|
+
this.playState = "finished", this.tick(0);
|
|
850
|
+
}
|
|
851
|
+
stop() {
|
|
852
|
+
var t;
|
|
853
|
+
this.playState = "idle", this.frameRequestId !== void 0 && cancelAnimationFrame(this.frameRequestId), (t = this.reject) === null || t === void 0 || t.call(this, !1);
|
|
854
|
+
}
|
|
855
|
+
cancel() {
|
|
856
|
+
this.stop(), this.tick(this.cancelTimestamp);
|
|
857
|
+
}
|
|
858
|
+
reverse() {
|
|
859
|
+
this.rate *= -1;
|
|
860
|
+
}
|
|
861
|
+
commitStyles() {
|
|
862
|
+
}
|
|
863
|
+
updateDuration(t) {
|
|
864
|
+
this.duration = t, this.totalDuration = t * (this.repeat + 1);
|
|
865
|
+
}
|
|
866
|
+
get currentTime() {
|
|
867
|
+
return this.t;
|
|
868
|
+
}
|
|
869
|
+
set currentTime(t) {
|
|
870
|
+
this.pauseTime !== void 0 || this.rate === 0 ? this.pauseTime = t : this.startTime = performance.now() - t / this.rate;
|
|
871
|
+
}
|
|
872
|
+
get playbackRate() {
|
|
873
|
+
return this.rate;
|
|
874
|
+
}
|
|
875
|
+
set playbackRate(t) {
|
|
876
|
+
this.rate = t;
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
var bt = function() {
|
|
880
|
+
};
|
|
881
|
+
process.env.NODE_ENV !== "production" && (bt = function(e, t) {
|
|
882
|
+
if (!e)
|
|
883
|
+
throw new Error(t);
|
|
884
|
+
});
|
|
885
|
+
class Sn {
|
|
886
|
+
setAnimation(t) {
|
|
887
|
+
this.animation = t, t?.finished.then(() => this.clearAnimation()).catch(() => {
|
|
888
|
+
});
|
|
889
|
+
}
|
|
890
|
+
clearAnimation() {
|
|
891
|
+
this.animation = this.generator = void 0;
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
const be = /* @__PURE__ */ new WeakMap();
|
|
895
|
+
function Tt(e) {
|
|
896
|
+
return be.has(e) || be.set(e, {
|
|
897
|
+
transforms: [],
|
|
898
|
+
values: /* @__PURE__ */ new Map()
|
|
899
|
+
}), be.get(e);
|
|
900
|
+
}
|
|
901
|
+
function _n(e, t) {
|
|
902
|
+
return e.has(t) || e.set(t, new Sn()), e.get(t);
|
|
903
|
+
}
|
|
904
|
+
const vn = ["", "X", "Y", "Z"], En = ["translate", "scale", "rotate", "skew"], q = {
|
|
905
|
+
x: "translateX",
|
|
906
|
+
y: "translateY",
|
|
907
|
+
z: "translateZ"
|
|
908
|
+
}, Ye = {
|
|
909
|
+
syntax: "<angle>",
|
|
910
|
+
initialValue: "0deg",
|
|
911
|
+
toDefaultUnit: (e) => e + "deg"
|
|
912
|
+
}, bn = {
|
|
913
|
+
translate: {
|
|
914
|
+
syntax: "<length-percentage>",
|
|
915
|
+
initialValue: "0px",
|
|
916
|
+
toDefaultUnit: (e) => e + "px"
|
|
917
|
+
},
|
|
918
|
+
rotate: Ye,
|
|
919
|
+
scale: {
|
|
920
|
+
syntax: "<number>",
|
|
921
|
+
initialValue: 1,
|
|
922
|
+
toDefaultUnit: P
|
|
923
|
+
},
|
|
924
|
+
skew: Ye
|
|
925
|
+
}, X = /* @__PURE__ */ new Map(), Se = (e) => `--motion-${e}`, pe = ["x", "y", "z"];
|
|
926
|
+
En.forEach((e) => {
|
|
927
|
+
vn.forEach((t) => {
|
|
928
|
+
pe.push(e + t), X.set(Se(e + t), bn[e]);
|
|
929
|
+
});
|
|
930
|
+
});
|
|
931
|
+
const Tn = (e, t) => pe.indexOf(e) - pe.indexOf(t), wn = new Set(pe), Ge = (e) => wn.has(e), Cn = (e, t) => {
|
|
932
|
+
q[t] && (t = q[t]);
|
|
933
|
+
const { transforms: n } = Tt(e);
|
|
934
|
+
mt(n, t), e.style.transform = wt(n);
|
|
935
|
+
}, wt = (e) => e.sort(Tn).reduce(An, "").trim(), An = (e, t) => `${e} ${t}(var(${Se(t)}))`, Re = (e) => e.startsWith("--"), He = /* @__PURE__ */ new Set();
|
|
936
|
+
function On(e) {
|
|
937
|
+
if (!He.has(e)) {
|
|
938
|
+
He.add(e);
|
|
939
|
+
try {
|
|
940
|
+
const { syntax: t, initialValue: n } = X.has(e) ? X.get(e) : {};
|
|
941
|
+
CSS.registerProperty({
|
|
942
|
+
name: e,
|
|
943
|
+
inherits: !1,
|
|
944
|
+
syntax: t,
|
|
945
|
+
initialValue: n
|
|
946
|
+
});
|
|
947
|
+
} catch {
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
const Te = (e, t) => document.createElement("div").animate(e, t), qe = {
|
|
952
|
+
cssRegisterProperty: () => typeof CSS < "u" && Object.hasOwnProperty.call(CSS, "registerProperty"),
|
|
953
|
+
waapi: () => Object.hasOwnProperty.call(Element.prototype, "animate"),
|
|
954
|
+
partialKeyframes: () => {
|
|
955
|
+
try {
|
|
956
|
+
Te({ opacity: [1] });
|
|
957
|
+
} catch {
|
|
958
|
+
return !1;
|
|
959
|
+
}
|
|
960
|
+
return !0;
|
|
961
|
+
},
|
|
962
|
+
finished: () => !!Te({ opacity: [0, 1] }, { duration: 1e-3 }).finished,
|
|
963
|
+
linearEasing: () => {
|
|
964
|
+
try {
|
|
965
|
+
Te({ opacity: 0 }, { easing: "linear(0, 1)" });
|
|
966
|
+
} catch {
|
|
967
|
+
return !1;
|
|
968
|
+
}
|
|
969
|
+
return !0;
|
|
970
|
+
}
|
|
971
|
+
}, we = {}, Q = {};
|
|
972
|
+
for (const e in qe)
|
|
973
|
+
Q[e] = () => (we[e] === void 0 && (we[e] = qe[e]()), we[e]);
|
|
974
|
+
const Dn = 0.015, Mn = (e, t) => {
|
|
975
|
+
let n = "";
|
|
976
|
+
const r = Math.round(t / Dn);
|
|
977
|
+
for (let i = 0; i < r; i++)
|
|
978
|
+
n += e(Be(0, r - 1, i)) + ", ";
|
|
979
|
+
return n.substring(0, n.length - 2);
|
|
980
|
+
}, Xe = (e, t) => oe(e) ? Q.linearEasing() ? `linear(${Mn(e, t)})` : D.easing : vt(e) ? xn(e) : e, xn = ([e, t, n, r]) => `cubic-bezier(${e}, ${t}, ${n}, ${r})`;
|
|
981
|
+
function kn(e, t) {
|
|
982
|
+
for (let n = 0; n < e.length; n++)
|
|
983
|
+
e[n] === null && (e[n] = n ? e[n - 1] : t());
|
|
984
|
+
return e;
|
|
985
|
+
}
|
|
986
|
+
const Rn = (e) => Array.isArray(e) ? e : [e];
|
|
987
|
+
function Ne(e) {
|
|
988
|
+
return q[e] && (e = q[e]), Ge(e) ? Se(e) : e;
|
|
989
|
+
}
|
|
990
|
+
const re = {
|
|
991
|
+
get: (e, t) => {
|
|
992
|
+
t = Ne(t);
|
|
993
|
+
let n = Re(t) ? e.style.getPropertyValue(t) : getComputedStyle(e)[t];
|
|
994
|
+
if (!n && n !== 0) {
|
|
995
|
+
const r = X.get(t);
|
|
996
|
+
r && (n = r.initialValue);
|
|
997
|
+
}
|
|
998
|
+
return n;
|
|
999
|
+
},
|
|
1000
|
+
set: (e, t, n) => {
|
|
1001
|
+
t = Ne(t), Re(t) ? e.style.setProperty(t, n) : e.style[t] = n;
|
|
1002
|
+
}
|
|
1003
|
+
};
|
|
1004
|
+
function Nn(e, t = !0) {
|
|
1005
|
+
if (!(!e || e.playState === "finished"))
|
|
1006
|
+
try {
|
|
1007
|
+
e.stop ? e.stop() : (t && e.commitStyles(), e.cancel());
|
|
1008
|
+
} catch {
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
function Un(e, t) {
|
|
1012
|
+
var n;
|
|
1013
|
+
let r = t?.toDefaultUnit || P;
|
|
1014
|
+
const i = e[e.length - 1];
|
|
1015
|
+
if (un(i)) {
|
|
1016
|
+
const a = ((n = i.match(/(-?[\d.]+)([a-z%]*)/)) === null || n === void 0 ? void 0 : n[2]) || "";
|
|
1017
|
+
a && (r = (s) => s + a);
|
|
1018
|
+
}
|
|
1019
|
+
return r;
|
|
1020
|
+
}
|
|
1021
|
+
function In() {
|
|
1022
|
+
return window.__MOTION_DEV_TOOLS_RECORD;
|
|
1023
|
+
}
|
|
1024
|
+
function Ln(e, t, n, r = {}, i) {
|
|
1025
|
+
const a = In(), s = r.record !== !1 && a;
|
|
1026
|
+
let o, { duration: u = D.duration, delay: l = D.delay, endDelay: f = D.endDelay, repeat: y = D.repeat, easing: g = D.easing, persist: A = !1, direction: h, offset: d, allowWebkitAcceleration: v = !1, autoplay: T = !0 } = r;
|
|
1027
|
+
const z = Tt(e), K = Ge(t);
|
|
1028
|
+
let R = Q.waapi();
|
|
1029
|
+
K && Cn(e, t);
|
|
1030
|
+
const w = Ne(t), W = _n(z.values, w), p = X.get(w);
|
|
1031
|
+
return Nn(W.animation, !(ke(g) && W.generator) && r.record !== !1), () => {
|
|
1032
|
+
const C = () => {
|
|
1033
|
+
var E, ee;
|
|
1034
|
+
return (ee = (E = re.get(e, w)) !== null && E !== void 0 ? E : p?.initialValue) !== null && ee !== void 0 ? ee : 0;
|
|
1035
|
+
};
|
|
1036
|
+
let S = kn(Rn(n), C);
|
|
1037
|
+
const Ke = Un(S, p);
|
|
1038
|
+
if (ke(g)) {
|
|
1039
|
+
const E = g.createAnimation(S, t !== "opacity", C, w, W);
|
|
1040
|
+
g = E.easing, S = E.keyframes || S, u = E.duration || u;
|
|
1041
|
+
}
|
|
1042
|
+
if (Re(w) && (Q.cssRegisterProperty() ? On(w) : R = !1), K && !Q.linearEasing() && (oe(g) || H(g) && g.some(oe)) && (R = !1), R) {
|
|
1043
|
+
p && (S = S.map((j) => se(j) ? p.toDefaultUnit(j) : j)), S.length === 1 && (!Q.partialKeyframes() || s) && S.unshift(C());
|
|
1044
|
+
const E = {
|
|
1045
|
+
delay: Ee.ms(l),
|
|
1046
|
+
duration: Ee.ms(u),
|
|
1047
|
+
endDelay: Ee.ms(f),
|
|
1048
|
+
easing: H(g) ? void 0 : Xe(g, u),
|
|
1049
|
+
direction: h,
|
|
1050
|
+
iterations: y + 1,
|
|
1051
|
+
fill: "both"
|
|
1052
|
+
};
|
|
1053
|
+
o = e.animate({
|
|
1054
|
+
[w]: S,
|
|
1055
|
+
offset: d,
|
|
1056
|
+
easing: H(g) ? g.map((j) => Xe(j, u)) : void 0
|
|
1057
|
+
}, E), o.finished || (o.finished = new Promise((j, kt) => {
|
|
1058
|
+
o.onfinish = j, o.oncancel = kt;
|
|
1059
|
+
}));
|
|
1060
|
+
const ee = S[S.length - 1];
|
|
1061
|
+
o.finished.then(() => {
|
|
1062
|
+
A || (re.set(e, w, ee), o.cancel());
|
|
1063
|
+
}).catch(St), v || (o.playbackRate = 1.000001);
|
|
1064
|
+
} else if (K)
|
|
1065
|
+
S = S.map((E) => typeof E == "string" ? parseFloat(E) : E), S.length === 1 && S.unshift(parseFloat(C())), o = new i((E) => {
|
|
1066
|
+
re.set(e, w, Ke ? Ke(E) : E);
|
|
1067
|
+
}, S, Object.assign(Object.assign({}, r), {
|
|
1068
|
+
duration: u,
|
|
1069
|
+
easing: g
|
|
1070
|
+
}));
|
|
1071
|
+
else {
|
|
1072
|
+
const E = S[S.length - 1];
|
|
1073
|
+
re.set(e, w, p && se(E) ? p.toDefaultUnit(E) : E);
|
|
1074
|
+
}
|
|
1075
|
+
return s && a(e, t, S, {
|
|
1076
|
+
duration: u,
|
|
1077
|
+
delay: l,
|
|
1078
|
+
easing: g,
|
|
1079
|
+
repeat: y,
|
|
1080
|
+
offset: d
|
|
1081
|
+
}, "motion-one"), W.setAnimation(o), o && !T && o.pause(), o;
|
|
1082
|
+
};
|
|
1083
|
+
}
|
|
1084
|
+
const Fn = (e, t) => (
|
|
1085
|
+
/**
|
|
1086
|
+
* TODO: Make test for this
|
|
1087
|
+
* Always return a new object otherwise delay is overwritten by results of stagger
|
|
1088
|
+
* and this results in no stagger
|
|
1089
|
+
*/
|
|
1090
|
+
e[t] ? Object.assign(Object.assign({}, e), e[t]) : Object.assign({}, e)
|
|
1091
|
+
);
|
|
1092
|
+
function $n(e, t) {
|
|
1093
|
+
return typeof e == "string" ? e = document.querySelectorAll(e) : e instanceof Element && (e = [e]), Array.from(e || []);
|
|
1094
|
+
}
|
|
1095
|
+
function Ct(e, t) {
|
|
1096
|
+
var n = {};
|
|
1097
|
+
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
|
|
1098
|
+
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
1099
|
+
for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)
|
|
1100
|
+
t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]);
|
|
1101
|
+
return n;
|
|
1102
|
+
}
|
|
1103
|
+
const Pn = {
|
|
1104
|
+
any: 0,
|
|
1105
|
+
all: 1
|
|
1106
|
+
};
|
|
1107
|
+
function Bn(e, t, { root: n, margin: r, amount: i = "any" } = {}) {
|
|
1108
|
+
if (typeof IntersectionObserver > "u")
|
|
1109
|
+
return () => {
|
|
1110
|
+
};
|
|
1111
|
+
const a = $n(e), s = /* @__PURE__ */ new WeakMap(), o = (l) => {
|
|
1112
|
+
l.forEach((f) => {
|
|
1113
|
+
const y = s.get(f.target);
|
|
1114
|
+
if (f.isIntersecting !== !!y)
|
|
1115
|
+
if (f.isIntersecting) {
|
|
1116
|
+
const g = t(f);
|
|
1117
|
+
oe(g) ? s.set(f.target, g) : u.unobserve(f.target);
|
|
1118
|
+
} else y && (y(f), s.delete(f.target));
|
|
1119
|
+
});
|
|
1120
|
+
}, u = new IntersectionObserver(o, {
|
|
1121
|
+
root: n,
|
|
1122
|
+
rootMargin: r,
|
|
1123
|
+
threshold: typeof i == "number" ? i : Pn[i]
|
|
1124
|
+
});
|
|
1125
|
+
return a.forEach((l) => u.observe(l)), () => u.disconnect();
|
|
1126
|
+
}
|
|
1127
|
+
function Gn(e, t) {
|
|
1128
|
+
return typeof e != typeof t ? !0 : Array.isArray(e) && Array.isArray(t) ? !zn(e, t) : e !== t;
|
|
1129
|
+
}
|
|
1130
|
+
function zn(e, t) {
|
|
1131
|
+
const n = t.length;
|
|
1132
|
+
if (n !== e.length)
|
|
1133
|
+
return !1;
|
|
1134
|
+
for (let r = 0; r < n; r++)
|
|
1135
|
+
if (t[r] !== e[r])
|
|
1136
|
+
return !1;
|
|
1137
|
+
return !0;
|
|
1138
|
+
}
|
|
1139
|
+
function Kn(e) {
|
|
1140
|
+
return typeof e == "object";
|
|
1141
|
+
}
|
|
1142
|
+
function Ze(e, t) {
|
|
1143
|
+
if (Kn(e))
|
|
1144
|
+
return e;
|
|
1145
|
+
if (e && t)
|
|
1146
|
+
return t[e];
|
|
1147
|
+
}
|
|
1148
|
+
let B;
|
|
1149
|
+
function Wn() {
|
|
1150
|
+
if (!B)
|
|
1151
|
+
return;
|
|
1152
|
+
const e = B.sort(Vn).map(Qn);
|
|
1153
|
+
e.forEach(Je), e.forEach(Je), B = void 0;
|
|
1154
|
+
}
|
|
1155
|
+
function Ce(e) {
|
|
1156
|
+
B ? mt(B, e) : (B = [e], requestAnimationFrame(Wn));
|
|
1157
|
+
}
|
|
1158
|
+
function jn(e) {
|
|
1159
|
+
B && an(B, e);
|
|
1160
|
+
}
|
|
1161
|
+
const Vn = (e, t) => e.getDepth() - t.getDepth(), Qn = (e) => e.animateUpdates(), Je = (e) => e.next(), et = (e, t) => new CustomEvent(e, { detail: { target: t } });
|
|
1162
|
+
function Ue(e, t, n) {
|
|
1163
|
+
e.dispatchEvent(new CustomEvent(t, { detail: { originalEvent: n } }));
|
|
1164
|
+
}
|
|
1165
|
+
function tt(e, t, n) {
|
|
1166
|
+
e.dispatchEvent(new CustomEvent(t, { detail: { originalEntry: n } }));
|
|
1167
|
+
}
|
|
1168
|
+
const Yn = {
|
|
1169
|
+
isActive: (e) => !!e.inView,
|
|
1170
|
+
subscribe: (e, { enable: t, disable: n }, { inViewOptions: r = {} }) => {
|
|
1171
|
+
const { once: i } = r, a = Ct(r, ["once"]);
|
|
1172
|
+
return Bn(e, (s) => {
|
|
1173
|
+
if (t(), tt(e, "viewenter", s), !i)
|
|
1174
|
+
return (o) => {
|
|
1175
|
+
n(), tt(e, "viewleave", o);
|
|
1176
|
+
};
|
|
1177
|
+
}, a);
|
|
1178
|
+
}
|
|
1179
|
+
}, nt = (e, t, n) => (r) => {
|
|
1180
|
+
r.pointerType && r.pointerType !== "mouse" || (n(), Ue(e, t, r));
|
|
1181
|
+
}, Hn = {
|
|
1182
|
+
isActive: (e) => !!e.hover,
|
|
1183
|
+
subscribe: (e, { enable: t, disable: n }) => {
|
|
1184
|
+
const r = nt(e, "hoverstart", t), i = nt(e, "hoverend", n);
|
|
1185
|
+
return e.addEventListener("pointerenter", r), e.addEventListener("pointerleave", i), () => {
|
|
1186
|
+
e.removeEventListener("pointerenter", r), e.removeEventListener("pointerleave", i);
|
|
1187
|
+
};
|
|
1188
|
+
}
|
|
1189
|
+
}, qn = {
|
|
1190
|
+
isActive: (e) => !!e.press,
|
|
1191
|
+
subscribe: (e, { enable: t, disable: n }) => {
|
|
1192
|
+
const r = (a) => {
|
|
1193
|
+
n(), Ue(e, "pressend", a), window.removeEventListener("pointerup", r);
|
|
1194
|
+
}, i = (a) => {
|
|
1195
|
+
t(), Ue(e, "pressstart", a), window.addEventListener("pointerup", r);
|
|
1196
|
+
};
|
|
1197
|
+
return e.addEventListener("pointerdown", i), () => {
|
|
1198
|
+
e.removeEventListener("pointerdown", i), window.removeEventListener("pointerup", r);
|
|
1199
|
+
};
|
|
1200
|
+
}
|
|
1201
|
+
}, ue = { inView: Yn, hover: Hn, press: qn }, rt = ["initial", "animate", ...Object.keys(ue), "exit"], Ie = /* @__PURE__ */ new WeakMap();
|
|
1202
|
+
function Xn(e = {}, t) {
|
|
1203
|
+
let n, r = t ? t.getDepth() + 1 : 0;
|
|
1204
|
+
const i = { initial: !0, animate: !0 }, a = {}, s = {};
|
|
1205
|
+
for (const d of rt)
|
|
1206
|
+
s[d] = typeof e[d] == "string" ? e[d] : t?.getContext()[d];
|
|
1207
|
+
const o = e.initial === !1 ? "animate" : "initial";
|
|
1208
|
+
let u = Ze(e[o] || s[o], e.variants) || {}, l = Ct(u, ["transition"]);
|
|
1209
|
+
const f = Object.assign({}, l);
|
|
1210
|
+
function* y() {
|
|
1211
|
+
var d, v;
|
|
1212
|
+
const T = l;
|
|
1213
|
+
l = {};
|
|
1214
|
+
const z = {};
|
|
1215
|
+
for (const p of rt) {
|
|
1216
|
+
if (!i[p])
|
|
1217
|
+
continue;
|
|
1218
|
+
const C = Ze(e[p]);
|
|
1219
|
+
if (C)
|
|
1220
|
+
for (const S in C)
|
|
1221
|
+
S !== "transition" && (l[S] = C[S], z[S] = Fn((v = (d = C.transition) !== null && d !== void 0 ? d : e.transition) !== null && v !== void 0 ? v : {}, S));
|
|
1222
|
+
}
|
|
1223
|
+
const K = /* @__PURE__ */ new Set([
|
|
1224
|
+
...Object.keys(l),
|
|
1225
|
+
...Object.keys(T)
|
|
1226
|
+
]), R = [];
|
|
1227
|
+
K.forEach((p) => {
|
|
1228
|
+
var C;
|
|
1229
|
+
l[p] === void 0 && (l[p] = f[p]), Gn(T[p], l[p]) && ((C = f[p]) !== null && C !== void 0 || (f[p] = re.get(n, p)), R.push(Ln(n, p, l[p], z[p], yn)));
|
|
1230
|
+
}), yield;
|
|
1231
|
+
const w = R.map((p) => p()).filter(Boolean);
|
|
1232
|
+
if (!w.length)
|
|
1233
|
+
return;
|
|
1234
|
+
const W = l;
|
|
1235
|
+
n.dispatchEvent(et("motionstart", W)), Promise.all(w.map((p) => p.finished)).then(() => {
|
|
1236
|
+
n.dispatchEvent(et("motioncomplete", W));
|
|
1237
|
+
}).catch(St);
|
|
1238
|
+
}
|
|
1239
|
+
const g = (d, v) => () => {
|
|
1240
|
+
i[d] = v, Ce(h);
|
|
1241
|
+
}, A = () => {
|
|
1242
|
+
for (const d in ue) {
|
|
1243
|
+
const v = ue[d].isActive(e), T = a[d];
|
|
1244
|
+
v && !T ? a[d] = ue[d].subscribe(n, {
|
|
1245
|
+
enable: g(d, !0),
|
|
1246
|
+
disable: g(d, !1)
|
|
1247
|
+
}, e) : !v && T && (T(), delete a[d]);
|
|
1248
|
+
}
|
|
1249
|
+
}, h = {
|
|
1250
|
+
update: (d) => {
|
|
1251
|
+
n && (e = d, A(), Ce(h));
|
|
1252
|
+
},
|
|
1253
|
+
setActive: (d, v) => {
|
|
1254
|
+
n && (i[d] = v, Ce(h));
|
|
1255
|
+
},
|
|
1256
|
+
animateUpdates: y,
|
|
1257
|
+
getDepth: () => r,
|
|
1258
|
+
getTarget: () => l,
|
|
1259
|
+
getOptions: () => e,
|
|
1260
|
+
getContext: () => s,
|
|
1261
|
+
mount: (d) => (bt(!!d, "Animation state must be mounted with valid Element"), n = d, Ie.set(n, h), A(), () => {
|
|
1262
|
+
Ie.delete(n), jn(h);
|
|
1263
|
+
for (const v in a)
|
|
1264
|
+
a[v]();
|
|
1265
|
+
}),
|
|
1266
|
+
isMounted: () => !!n
|
|
1267
|
+
};
|
|
1268
|
+
return h;
|
|
1269
|
+
}
|
|
1270
|
+
function Zn(e) {
|
|
1271
|
+
const t = {}, n = [];
|
|
1272
|
+
for (let r in e) {
|
|
1273
|
+
const i = e[r];
|
|
1274
|
+
Ge(r) && (q[r] && (r = q[r]), n.push(r), r = Se(r));
|
|
1275
|
+
let a = Array.isArray(i) ? i[0] : i;
|
|
1276
|
+
const s = X.get(r);
|
|
1277
|
+
s && (a = se(i) ? s.toDefaultUnit(i) : i), t[r] = a;
|
|
1278
|
+
}
|
|
1279
|
+
return n.length && (t.transform = wt(n)), t;
|
|
1280
|
+
}
|
|
1281
|
+
var it = Fe ? (e) => e != null && typeof e == "object" && "t" in e : (e) => e instanceof Element;
|
|
1282
|
+
function Le(e, t) {
|
|
1283
|
+
if (t(e))
|
|
1284
|
+
return e;
|
|
1285
|
+
if (typeof e == "function" && !e.length)
|
|
1286
|
+
return Le(e(), t);
|
|
1287
|
+
if (Array.isArray(e))
|
|
1288
|
+
for (const n of e) {
|
|
1289
|
+
const r = Le(n, t);
|
|
1290
|
+
if (r)
|
|
1291
|
+
return r;
|
|
1292
|
+
}
|
|
1293
|
+
return null;
|
|
1294
|
+
}
|
|
1295
|
+
function Jn(e, t = it, n = it) {
|
|
1296
|
+
const r = Oe(e);
|
|
1297
|
+
return Oe(() => Le(r(), Fe ? n : t));
|
|
1298
|
+
}
|
|
1299
|
+
var er = () => {
|
|
1300
|
+
}, at = (e, t) => t();
|
|
1301
|
+
function tr(e, t) {
|
|
1302
|
+
const n = ve(e), r = n ? [n] : [];
|
|
1303
|
+
if (Fe)
|
|
1304
|
+
return () => r;
|
|
1305
|
+
const { onEnter: i = at, onExit: a = at } = t, [s, o] = ie(
|
|
1306
|
+
t.appear ? [] : r
|
|
1307
|
+
), [u] = Ft();
|
|
1308
|
+
let l, f = !1;
|
|
1309
|
+
function y(h, d) {
|
|
1310
|
+
if (!h)
|
|
1311
|
+
return d && d();
|
|
1312
|
+
f = !0, a(h, () => {
|
|
1313
|
+
de(() => {
|
|
1314
|
+
f = !1, o((v) => v.filter((T) => T !== h)), d && d();
|
|
1315
|
+
});
|
|
1316
|
+
});
|
|
1317
|
+
}
|
|
1318
|
+
function g(h) {
|
|
1319
|
+
const d = l;
|
|
1320
|
+
if (!d)
|
|
1321
|
+
return h && h();
|
|
1322
|
+
l = void 0, o((v) => [d, ...v]), i(d, h ?? er);
|
|
1323
|
+
}
|
|
1324
|
+
const A = t.mode === "out-in" ? (
|
|
1325
|
+
// exit -> enter
|
|
1326
|
+
(h) => f || y(h, g)
|
|
1327
|
+
) : t.mode === "in-out" ? (
|
|
1328
|
+
// enter -> exit
|
|
1329
|
+
(h) => g(() => y(h))
|
|
1330
|
+
) : (
|
|
1331
|
+
// exit & enter
|
|
1332
|
+
(h) => {
|
|
1333
|
+
y(h), g();
|
|
1334
|
+
}
|
|
1335
|
+
);
|
|
1336
|
+
return $t(
|
|
1337
|
+
(h) => {
|
|
1338
|
+
const d = e();
|
|
1339
|
+
return ve(u) ? (u(), h) : (d !== h && (l = d, de(() => ve(() => A(h)))), d);
|
|
1340
|
+
},
|
|
1341
|
+
t.appear ? void 0 : n
|
|
1342
|
+
), s;
|
|
1343
|
+
}
|
|
1344
|
+
var At = Pe(), nr = (e) => {
|
|
1345
|
+
const [t, n] = ie(!0), r = {
|
|
1346
|
+
initial: e.initial ?? !0,
|
|
1347
|
+
mount: t
|
|
1348
|
+
}, i = c(At.Provider, {
|
|
1349
|
+
value: r,
|
|
1350
|
+
get children() {
|
|
1351
|
+
return tr(Jn(() => e.children), {
|
|
1352
|
+
appear: r.initial,
|
|
1353
|
+
mode: e.exitBeforeEnter ? "out-in" : "parallel",
|
|
1354
|
+
onExit(a, s) {
|
|
1355
|
+
de(() => {
|
|
1356
|
+
n(!1), Ie.get(a)?.getOptions()?.exit ? a.addEventListener("motioncomplete", s) : s();
|
|
1357
|
+
});
|
|
1358
|
+
},
|
|
1359
|
+
onEnter(a, s) {
|
|
1360
|
+
de(() => {
|
|
1361
|
+
n(!0), s();
|
|
1362
|
+
});
|
|
1363
|
+
}
|
|
1364
|
+
});
|
|
1365
|
+
}
|
|
1366
|
+
});
|
|
1367
|
+
return r.initial = !0, i;
|
|
1368
|
+
};
|
|
1369
|
+
function rr(e, t, n, r) {
|
|
1370
|
+
const i = Xn(n?.initial === !1 ? {
|
|
1371
|
+
...t(),
|
|
1372
|
+
initial: !1
|
|
1373
|
+
} : t(), r);
|
|
1374
|
+
return fe(() => {
|
|
1375
|
+
if (n && !n.mount()) return;
|
|
1376
|
+
const a = e(), s = i.mount(a);
|
|
1377
|
+
fe(() => i.update(t())), De(() => {
|
|
1378
|
+
n && t().exit ? (i.setActive("exit", !0), a.addEventListener("motioncomplete", s)) : s();
|
|
1379
|
+
});
|
|
1380
|
+
}), [i, Zn(i.getTarget())];
|
|
1381
|
+
}
|
|
1382
|
+
var ir = ["initial", "animate", "inView", "inViewOptions", "hover", "press", "variants", "transition", "exit"], ar = ["tag"], st = Pe(), ot = (e) => {
|
|
1383
|
+
const [t, , n] = Pt(e, ir, ar), [r, i] = rr(() => a, () => ({
|
|
1384
|
+
...t
|
|
1385
|
+
}), Ae(At), Ae(st));
|
|
1386
|
+
let a;
|
|
1387
|
+
return c(st.Provider, {
|
|
1388
|
+
value: r,
|
|
1389
|
+
get children() {
|
|
1390
|
+
return c(Rt, $e(n, {
|
|
1391
|
+
ref: (s) => {
|
|
1392
|
+
a = s, e.ref?.(s);
|
|
1393
|
+
},
|
|
1394
|
+
get component() {
|
|
1395
|
+
return e.tag || "div";
|
|
1396
|
+
},
|
|
1397
|
+
get style() {
|
|
1398
|
+
return rn(e.style, i);
|
|
1399
|
+
}
|
|
1400
|
+
}));
|
|
1401
|
+
}
|
|
1402
|
+
});
|
|
1403
|
+
}, J = new Proxy(ot, {
|
|
1404
|
+
get: (e, t) => (n) => c(ot, $e(n, {
|
|
1405
|
+
tag: t
|
|
1406
|
+
}))
|
|
1407
|
+
});
|
|
1408
|
+
function Ot(e) {
|
|
1409
|
+
var t, n, r = "";
|
|
1410
|
+
if (typeof e == "string" || typeof e == "number") r += e;
|
|
1411
|
+
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
1412
|
+
var i = e.length;
|
|
1413
|
+
for (t = 0; t < i; t++) e[t] && (n = Ot(e[t])) && (r && (r += " "), r += n);
|
|
1414
|
+
} else for (n in e) e[n] && (r && (r += " "), r += n);
|
|
1415
|
+
return r;
|
|
1416
|
+
}
|
|
1417
|
+
function Dt() {
|
|
1418
|
+
for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t = Ot(e)) && (r && (r += " "), r += t);
|
|
1419
|
+
return r;
|
|
1420
|
+
}
|
|
1421
|
+
const ct = {
|
|
1422
|
+
SENSING_FRONT: "scan_the_front_side",
|
|
1423
|
+
SENSING_BACK: "scan_the_back_side",
|
|
1424
|
+
SIDE_CAPTURED: "flip_document",
|
|
1425
|
+
WRONG_SIDE: "scanning_wrong_side",
|
|
1426
|
+
SCAN_BARCODE: "scan_the_barcode",
|
|
1427
|
+
// occlusion
|
|
1428
|
+
BLUR_DETECTED: "blur_detected",
|
|
1429
|
+
GLARE_DETECTED: "glare_detected",
|
|
1430
|
+
OCCLUDED: "occluded",
|
|
1431
|
+
// framing
|
|
1432
|
+
DOCUMENT_FRAMING_CAMERA_TOO_CLOSE: "move_farther",
|
|
1433
|
+
DOCUMENT_FRAMING_CAMERA_TOO_FAR: "move_closer",
|
|
1434
|
+
DOCUMENT_TOO_CLOSE_TO_FRAME_EDGE: "document_too_close_to_edge",
|
|
1435
|
+
DOCUMENT_FRAMING_CAMERA_ANGLE_TOO_STEEP: "camera_angle_too_steep",
|
|
1436
|
+
//other
|
|
1437
|
+
LOW_QUALITY_FRONT: "scan_the_front_side",
|
|
1438
|
+
LOW_QUALITY_BACK: "scan_the_back_side"
|
|
1439
|
+
};
|
|
1440
|
+
var sr = /* @__PURE__ */ b('<svg xmlns=http://www.w3.org/2000/svg fill=none viewBox="0 0 96 60"><path fill=#fff fill-rule=evenodd d="M0 6a6 6 0 0 1 6-6h84a6 6 0 0 1 6 6v48a6 6 0 0 1-6 6H6a6 6 0 0 1-6-6zm10.2 7.8c0-1.325 1.11-2.4 2.48-2.4h69.44c1.37 0 2.48 1.075 2.48 2.4s-1.11 2.4-2.48 2.4H12.68c-1.37 0-2.48-1.074-2.48-2.4m70.5 35.4a3.9 3.9 0 1 0 0-7.8 3.9 3.9 0 0 0 0 7.8m-70.5-3c0-1.326 1.098-2.4 2.451-2.4H34.15c1.353 0 2.451 1.075 2.451 2.4s-1.098 2.4-2.451 2.4h-21.5c-1.354 0-2.451-1.075-2.451-2.4Zm2.474-13.8c-1.366 0-2.474 1.075-2.474 2.4 0 1.326 1.108 2.4 2.474 2.4h30.452c1.366 0 2.474-1.075 2.474-2.4s-1.108-2.4-2.474-2.4z"clip-rule=evenodd>');
|
|
1441
|
+
const or = (e = {}) => (() => {
|
|
1442
|
+
var t = sr();
|
|
1443
|
+
return Z(t, e, !0, !0), t;
|
|
1444
|
+
})();
|
|
1445
|
+
var cr = /* @__PURE__ */ b('<svg xmlns=http://www.w3.org/2000/svg fill=none viewBox="0 0 96 60"><path fill=#fff fill-rule=evenodd d="M6 0a6 6 0 0 0-6 6v48a6 6 0 0 0 6 6h84a6 6 0 0 0 6-6V6a6 6 0 0 0-6-6zm42.671 10.8c-1.365 0-2.471 1.074-2.471 2.4s1.106 2.4 2.471 2.4H82.13c1.365 0 2.471-1.075 2.471-2.4s-1.106-2.4-2.471-2.4zM72 49.2c0-1.326 1.058-2.4 2.364-2.4h7.272c1.306 0 2.364 1.075 2.364 2.4s-1.058 2.4-2.364 2.4h-7.272C73.058 51.6 72 50.525 72 49.2M48.702 33.6c-1.382 0-2.502 1.075-2.502 2.4s1.12 2.4 2.502 2.4h15.396c1.382 0 2.502-1.075 2.502-2.4s-1.12-2.4-2.502-2.4zm-2.502-9c0-1.326 1.106-2.4 2.471-2.4H82.13c1.365 0 2.471 1.075 2.471 2.4S83.494 27 82.129 27H48.67c-1.365 0-2.471-1.075-2.471-2.4M13.265 10.8c-1.693 0-3.065 1.407-3.065 3.144v24.024c0 1.117.569 2.097 1.42 2.653.266.174.59.224.894.138a1.12 1.12 0 0 0 .698-.587c1.385-2.82 3.678-5.021 6.438-6.162.373-.154.637-.504.688-.915.05-.41-.119-.816-.443-1.062a7.23 7.23 0 0 1-2.84-5.78c0-3.962 3.115-7.164 6.945-7.164s6.944 3.203 6.944 7.165a7.23 7.23 0 0 1-2.839 5.78 1.16 1.16 0 0 0-.442 1.061c.05.41.314.76.688.915 2.76 1.14 5.052 3.343 6.437 6.162.142.288.395.501.698.587.304.086.628.036.893-.138a3.16 3.16 0 0 0 1.421-2.653V13.944c0-1.737-1.372-3.144-3.065-3.144z"clip-rule=evenodd>');
|
|
1446
|
+
const lr = (e = {}) => (() => {
|
|
1447
|
+
var t = cr();
|
|
1448
|
+
return Z(t, e, !0, !0), t;
|
|
1449
|
+
})();
|
|
1450
|
+
var ur = /* @__PURE__ */ b('<svg xmlns=http://www.w3.org/2000/svg fill=none viewBox="0 0 96 96"><rect width=96 height=96 fill=#fff rx=48></rect><path fill=#000 d="M44.972 57.46a2 2 0 0 1-1.414-.584l-8.484-8.486a2 2 0 1 1 2.826-2.83l7.07 7.07L57.7 39.904a2 2 0 1 1 2.83 2.828L46.386 56.876a2 2 0 0 1-1.414.584">');
|
|
1451
|
+
const dr = (e = {}) => (() => {
|
|
1452
|
+
var t = ur();
|
|
1453
|
+
return Z(t, e, !0, !0), t;
|
|
1454
|
+
})();
|
|
1455
|
+
var fr = /* @__PURE__ */ b('<svg xmlns=http://www.w3.org/2000/svg fill=none viewBox="0 0 100 100"><path fill=#fff fill-rule=evenodd d="M50 7.692C26.634 7.692 7.692 26.634 7.692 50S26.634 92.308 50 92.308 92.308 73.366 92.308 50 73.366 7.692 50 7.692M0 50C0 22.386 22.386 0 50 0s50 22.386 50 50-22.386 50-50 50S0 77.614 0 50"clip-rule=evenodd opacity=.75></path><circle cx=50 cy=50 r=4 fill=#fff>');
|
|
1456
|
+
const hr = (e = {}) => (() => {
|
|
1457
|
+
var t = fr();
|
|
1458
|
+
return Z(t, e, !0, !0), t;
|
|
1459
|
+
})();
|
|
1460
|
+
var gr = /* @__PURE__ */ b('<svg xmlns=http://www.w3.org/2000/svg fill=none viewBox="0 0 100 100"><path fill=#fff fill-rule=evenodd d="M67.122 11.998a42.16 42.16 0 0 0-34.244 0l-3.397-7.644a50.52 50.52 0 0 1 41.038 0zm-55.124 20.88a42.16 42.16 0 0 0 0 34.244l-7.644 3.397a50.52 50.52 0 0 1 0-41.038zm76.004 34.244a42.16 42.16 0 0 0 0-34.244l7.644-3.397a50.52 50.52 0 0 1 0 41.038zm-55.124 20.88a42.16 42.16 0 0 0 34.244 0l3.397 7.644a50.52 50.52 0 0 1-41.038 0z"clip-rule=evenodd opacity=.75></path><circle cx=50 cy=50 r=4 fill=#fff>');
|
|
1461
|
+
const mr = (e = {}) => (() => {
|
|
1462
|
+
var t = gr();
|
|
1463
|
+
return Z(t, e, !0, !0), t;
|
|
1464
|
+
})();
|
|
1465
|
+
var pr = /* @__PURE__ */ b('<svg xmlns=http://www.w3.org/2000/svg fill=none viewBox="0 0 101 100"><path fill=#fff fill-rule=evenodd d="M50.301 7.692C26.935 7.692 7.994 26.634 7.994 50S26.935 92.308 50.3 92.308 92.61 73.366 92.61 50 73.667 7.692 50.301 7.692M.301 50c0-27.614 22.386-50 50-50s50 22.386 50 50-22.386 50-50 50-50-22.386-50-50"clip-rule=evenodd opacity=.3></path><circle cx=50.3 cy=50 r=4 fill=#fff></circle><path fill=#fff fill-rule=evenodd d="M29.148 13.36C8.912 25.043 1.977 50.918 13.662 71.154L7 75C-6.807 51.085 1.387 20.506 25.301 6.699z"clip-rule=evenodd>');
|
|
1466
|
+
const yr = (e = {}) => (() => {
|
|
1467
|
+
var t = pr();
|
|
1468
|
+
return Z(t, e, !0, !0), t;
|
|
1469
|
+
})();
|
|
1470
|
+
var Sr = /* @__PURE__ */ b('<div class="absolute left-0 top-0 grid size-full select-none place-items-center"><div><div class=size-24><div class=absolute aria-hidden>'), _r = /* @__PURE__ */ b('<div class="relative perspective-300px left--6">'), vr = /* @__PURE__ */ b("<div role=alert>"), Er = /* @__PURE__ */ b('<div class="absolute left-0 mt-2 w-full flex justify-center">');
|
|
1471
|
+
const br = (e) => (() => {
|
|
1472
|
+
var t = Sr(), n = t.firstChild, r = n.firstChild, i = r.firstChild;
|
|
1473
|
+
return N(i, c(Bt, {
|
|
1474
|
+
get children() {
|
|
1475
|
+
return [c(te, {
|
|
1476
|
+
get when() {
|
|
1477
|
+
return e.uiState.reticleType === "searching";
|
|
1478
|
+
},
|
|
1479
|
+
get children() {
|
|
1480
|
+
return c(Cr, {});
|
|
1481
|
+
}
|
|
1482
|
+
}), c(te, {
|
|
1483
|
+
get when() {
|
|
1484
|
+
return e.uiState.reticleType === "processing";
|
|
1485
|
+
},
|
|
1486
|
+
get children() {
|
|
1487
|
+
return c(Or, {});
|
|
1488
|
+
}
|
|
1489
|
+
}), c(te, {
|
|
1490
|
+
get when() {
|
|
1491
|
+
return e.uiState.reticleType === "error";
|
|
1492
|
+
},
|
|
1493
|
+
get children() {
|
|
1494
|
+
return c(Ar, {});
|
|
1495
|
+
}
|
|
1496
|
+
}), c(te, {
|
|
1497
|
+
get when() {
|
|
1498
|
+
return e.uiState.reticleType === "done";
|
|
1499
|
+
},
|
|
1500
|
+
get children() {
|
|
1501
|
+
return c(Tr, {});
|
|
1502
|
+
}
|
|
1503
|
+
}), c(te, {
|
|
1504
|
+
get when() {
|
|
1505
|
+
return e.uiState.reticleType === "flip";
|
|
1506
|
+
},
|
|
1507
|
+
get children() {
|
|
1508
|
+
return c(wr, {});
|
|
1509
|
+
}
|
|
1510
|
+
})];
|
|
1511
|
+
}
|
|
1512
|
+
})), N(n, c(Dr, {
|
|
1513
|
+
get uiState() {
|
|
1514
|
+
return e.uiState;
|
|
1515
|
+
}
|
|
1516
|
+
}), null), t;
|
|
1517
|
+
})(), Tr = () => c(J, {
|
|
1518
|
+
initial: {
|
|
1519
|
+
opacity: 0,
|
|
1520
|
+
scale: 0.5
|
|
1521
|
+
},
|
|
1522
|
+
animate: {
|
|
1523
|
+
opacity: 1,
|
|
1524
|
+
scale: 1,
|
|
1525
|
+
transition: {
|
|
1526
|
+
easing: "ease-in-out",
|
|
1527
|
+
duration: 0.3
|
|
1528
|
+
}
|
|
1529
|
+
},
|
|
1530
|
+
exit: {
|
|
1531
|
+
opacity: 0,
|
|
1532
|
+
scale: 5
|
|
1533
|
+
},
|
|
1534
|
+
get children() {
|
|
1535
|
+
return c(dr, {
|
|
1536
|
+
class: "[&>path]:fill-[initial] size-24 drop-shadow-[0_0_15px_rgba(0,0,0,0.1)]"
|
|
1537
|
+
});
|
|
1538
|
+
}
|
|
1539
|
+
}), lt = "w-35 backface-hidden drop-shadow-[0_0_15px_rgba(0,0,0,0.1)]", wr = () => (() => {
|
|
1540
|
+
var e = _r();
|
|
1541
|
+
return N(e, c(J, {
|
|
1542
|
+
class: "relative preserve-3d",
|
|
1543
|
+
initial: {
|
|
1544
|
+
opacity: 0
|
|
1545
|
+
},
|
|
1546
|
+
get animate() {
|
|
1547
|
+
return {
|
|
1548
|
+
opacity: 1,
|
|
1549
|
+
rotateY: ["180deg"],
|
|
1550
|
+
transition: {
|
|
1551
|
+
rotateY: {
|
|
1552
|
+
duration: me.SIDE_CAPTURED.minDuration / 1e3
|
|
1553
|
+
},
|
|
1554
|
+
opacity: {
|
|
1555
|
+
duration: 0.5
|
|
1556
|
+
}
|
|
1557
|
+
}
|
|
1558
|
+
};
|
|
1559
|
+
},
|
|
1560
|
+
exit: {
|
|
1561
|
+
opacity: 0
|
|
1562
|
+
},
|
|
1563
|
+
get children() {
|
|
1564
|
+
return [c(lr, {
|
|
1565
|
+
class: lt
|
|
1566
|
+
}), c(or, {
|
|
1567
|
+
get class() {
|
|
1568
|
+
return Dt(lt, "absolute top-0 left-0 w-full transform rotate-y-180");
|
|
1569
|
+
}
|
|
1570
|
+
})];
|
|
1571
|
+
}
|
|
1572
|
+
})), e;
|
|
1573
|
+
})(), ze = (e) => c(J.div, {
|
|
1574
|
+
get class() {
|
|
1575
|
+
return Dt("grid size-24 place-items-center rounded-full backdrop-blur-xl bg-opacity-30", e.type === "error" ? "bg-error-500 " : "bg-dark-100");
|
|
1576
|
+
},
|
|
1577
|
+
initial: {
|
|
1578
|
+
opacity: 0
|
|
1579
|
+
},
|
|
1580
|
+
animate: {
|
|
1581
|
+
opacity: 1,
|
|
1582
|
+
transition: {
|
|
1583
|
+
delay: 0.05
|
|
1584
|
+
}
|
|
1585
|
+
},
|
|
1586
|
+
transition: {
|
|
1587
|
+
duration: 0.05
|
|
1588
|
+
},
|
|
1589
|
+
get children() {
|
|
1590
|
+
return e.children;
|
|
1591
|
+
}
|
|
1592
|
+
}), Cr = () => c(ze, {
|
|
1593
|
+
type: "searching",
|
|
1594
|
+
get children() {
|
|
1595
|
+
return c(J, {
|
|
1596
|
+
class: "will-change-transform",
|
|
1597
|
+
animate: {
|
|
1598
|
+
opacity: 1,
|
|
1599
|
+
transform: "rotate(360deg)"
|
|
1600
|
+
},
|
|
1601
|
+
transition: {
|
|
1602
|
+
transform: {
|
|
1603
|
+
duration: 1,
|
|
1604
|
+
easing: "ease-in-out",
|
|
1605
|
+
repeat: 1 / 0
|
|
1606
|
+
}
|
|
1607
|
+
},
|
|
1608
|
+
get children() {
|
|
1609
|
+
return c(mr, {
|
|
1610
|
+
class: "size-12"
|
|
1611
|
+
});
|
|
1612
|
+
}
|
|
1613
|
+
});
|
|
1614
|
+
}
|
|
1615
|
+
}), Ar = () => c(ze, {
|
|
1616
|
+
type: "error",
|
|
1617
|
+
get children() {
|
|
1618
|
+
return c(hr, {
|
|
1619
|
+
class: "size-12"
|
|
1620
|
+
});
|
|
1621
|
+
}
|
|
1622
|
+
}), Or = () => c(ze, {
|
|
1623
|
+
type: "processing",
|
|
1624
|
+
get children() {
|
|
1625
|
+
return c(J, {
|
|
1626
|
+
animate: {
|
|
1627
|
+
opacity: 1,
|
|
1628
|
+
rotate: "360deg"
|
|
1629
|
+
},
|
|
1630
|
+
transition: {
|
|
1631
|
+
rotate: {
|
|
1632
|
+
duration: 0.8,
|
|
1633
|
+
easing: [0.23, 0.58, 0.58, 0.23],
|
|
1634
|
+
repeat: 1 / 0
|
|
1635
|
+
}
|
|
1636
|
+
},
|
|
1637
|
+
get children() {
|
|
1638
|
+
return c(yr, {
|
|
1639
|
+
class: "size-12"
|
|
1640
|
+
});
|
|
1641
|
+
}
|
|
1642
|
+
});
|
|
1643
|
+
}
|
|
1644
|
+
}), Dr = (e) => {
|
|
1645
|
+
const {
|
|
1646
|
+
t
|
|
1647
|
+
} = en(), n = () => {
|
|
1648
|
+
const r = e.uiState.key;
|
|
1649
|
+
if (r in ct)
|
|
1650
|
+
return ct[r];
|
|
1651
|
+
};
|
|
1652
|
+
return (() => {
|
|
1653
|
+
var r = Er();
|
|
1654
|
+
return N(r, c(nr, {
|
|
1655
|
+
exitBeforeEnter: !0,
|
|
1656
|
+
get children() {
|
|
1657
|
+
return c(tn, {
|
|
1658
|
+
on: () => e.uiState.key,
|
|
1659
|
+
get children() {
|
|
1660
|
+
return c(Y, {
|
|
1661
|
+
get when() {
|
|
1662
|
+
return n();
|
|
1663
|
+
},
|
|
1664
|
+
get children() {
|
|
1665
|
+
return c(J.div, {
|
|
1666
|
+
initial: {
|
|
1667
|
+
opacity: 0,
|
|
1668
|
+
transform: "translateY(2rem)"
|
|
1669
|
+
},
|
|
1670
|
+
animate: {
|
|
1671
|
+
opacity: 1,
|
|
1672
|
+
transform: "translateY(0)",
|
|
1673
|
+
transition: {
|
|
1674
|
+
delay: 0.05
|
|
1675
|
+
}
|
|
1676
|
+
},
|
|
1677
|
+
transition: {
|
|
1678
|
+
duration: 0.05
|
|
1679
|
+
},
|
|
1680
|
+
exit: {
|
|
1681
|
+
opacity: 0,
|
|
1682
|
+
transform: "translateY(-2rem)"
|
|
1683
|
+
},
|
|
1684
|
+
class: `max-w-45 text-base gap-1 rounded-2 bg-opacity-30 bg-dark-100 px-2 py-3
|
|
1685
|
+
text-center text-balance text-white font-bold
|
|
1686
|
+
text-shadow-[0_1px_4px_rgba(0,0,0,0.1)] backdrop-blur-xl will-change-transform`,
|
|
1687
|
+
get children() {
|
|
1688
|
+
var i = vr();
|
|
1689
|
+
return N(i, () => t[n()]), i;
|
|
1690
|
+
}
|
|
1691
|
+
});
|
|
1692
|
+
}
|
|
1693
|
+
});
|
|
1694
|
+
}
|
|
1695
|
+
});
|
|
1696
|
+
}
|
|
1697
|
+
})), r;
|
|
1698
|
+
})();
|
|
1699
|
+
}, ut = {
|
|
1700
|
+
blinkIdUxManager: null,
|
|
1701
|
+
cameraManagerComponent: null,
|
|
1702
|
+
disposeBlinkIdUiStore: null,
|
|
1703
|
+
errorState: void 0
|
|
1704
|
+
}, _e = Gt((e) => {
|
|
1705
|
+
const [t, n] = ht(
|
|
1706
|
+
{}
|
|
1707
|
+
);
|
|
1708
|
+
return n({
|
|
1709
|
+
...ut,
|
|
1710
|
+
disposeBlinkIdUiStore: () => {
|
|
1711
|
+
e(), n({ ...ut, disposeBlinkIdUiStore: e });
|
|
1712
|
+
}
|
|
1713
|
+
}), { store: t, updateStore: n };
|
|
1714
|
+
});
|
|
1715
|
+
var Mr = /* @__PURE__ */ b("<span>");
|
|
1716
|
+
const xr = (e) => {
|
|
1717
|
+
const [t, n] = ie(), [r, i] = ie();
|
|
1718
|
+
return ft(() => {
|
|
1719
|
+
const a = r();
|
|
1720
|
+
a && n(a.getRootNode());
|
|
1721
|
+
}), c(Y, {
|
|
1722
|
+
get when() {
|
|
1723
|
+
return t();
|
|
1724
|
+
},
|
|
1725
|
+
get fallback() {
|
|
1726
|
+
return (() => {
|
|
1727
|
+
var a = Mr();
|
|
1728
|
+
return ye(i, a), a;
|
|
1729
|
+
})();
|
|
1730
|
+
},
|
|
1731
|
+
children: (a) => c(Kt, {
|
|
1732
|
+
value: () => a(),
|
|
1733
|
+
get children() {
|
|
1734
|
+
return e.children(a());
|
|
1735
|
+
}
|
|
1736
|
+
})
|
|
1737
|
+
});
|
|
1738
|
+
};
|
|
1739
|
+
var kr = /* @__PURE__ */ b("<div class=overflow-y-auto>"), Rr = /* @__PURE__ */ b("<div>");
|
|
1740
|
+
const Mt = (e) => c(xr, {
|
|
1741
|
+
children: () => c(V.Root, $e({
|
|
1742
|
+
onFocusOutside: (t) => t.preventDefault(),
|
|
1743
|
+
onInteractOutside: (t) => t.preventDefault(),
|
|
1744
|
+
restoreFocus: !0,
|
|
1745
|
+
unmountOnExit: !0,
|
|
1746
|
+
lazyMount: !0
|
|
1747
|
+
}, e, {
|
|
1748
|
+
get children() {
|
|
1749
|
+
return c(Y, {
|
|
1750
|
+
get when() {
|
|
1751
|
+
return e.open;
|
|
1752
|
+
},
|
|
1753
|
+
get children() {
|
|
1754
|
+
return c(Nt, {
|
|
1755
|
+
get mount() {
|
|
1756
|
+
return e.mountTarget;
|
|
1757
|
+
},
|
|
1758
|
+
get children() {
|
|
1759
|
+
return c(V.Positioner, {
|
|
1760
|
+
class: "h-vh supports-[(height:100dvh)]:h-dvh top-0 left-0 w-full fixed grid p-8",
|
|
1761
|
+
get children() {
|
|
1762
|
+
return [c(V.Backdrop, {
|
|
1763
|
+
class: "absolute top-0 left-0 w-full h-full bg-black bg-opacity-50"
|
|
1764
|
+
}), c(V.Content, {
|
|
1765
|
+
class: `bg-white color-dark-9 p-6 rounded-lg shadow-lg place-self-center relative flex
|
|
1766
|
+
flex-col max-h-[calc(100dvh-4rem)] max-w-md`,
|
|
1767
|
+
get children() {
|
|
1768
|
+
return [c(Y, {
|
|
1769
|
+
get when() {
|
|
1770
|
+
return e.title;
|
|
1771
|
+
},
|
|
1772
|
+
children: (t) => c(V.Title, {
|
|
1773
|
+
class: "text-size-5 font-semibold mb-4 text-center",
|
|
1774
|
+
get children() {
|
|
1775
|
+
return t();
|
|
1776
|
+
}
|
|
1777
|
+
})
|
|
1778
|
+
}), (() => {
|
|
1779
|
+
var t = kr();
|
|
1780
|
+
return N(t, () => e.children), t;
|
|
1781
|
+
})(), c(Y, {
|
|
1782
|
+
get when() {
|
|
1783
|
+
return e.actions;
|
|
1784
|
+
},
|
|
1785
|
+
get children() {
|
|
1786
|
+
var t = Rr();
|
|
1787
|
+
return N(t, () => e.actions), t;
|
|
1788
|
+
}
|
|
1789
|
+
})];
|
|
1790
|
+
}
|
|
1791
|
+
})];
|
|
1792
|
+
}
|
|
1793
|
+
});
|
|
1794
|
+
}
|
|
1795
|
+
});
|
|
1796
|
+
}
|
|
1797
|
+
});
|
|
1798
|
+
}
|
|
1799
|
+
}))
|
|
1800
|
+
});
|
|
1801
|
+
var Nr = /* @__PURE__ */ b('<p class="mb-6 text-center text-balance">Unable to read the document. Please try again.'), Ur = /* @__PURE__ */ b('<div class="flex justify-center gap-4"><button class="px-4 py-2 text-sm bg-accent-500 text-white rounded-10 hover:bg-accent-600 transition-colors appearance-none border-none">Retry');
|
|
1802
|
+
const Ir = () => {
|
|
1803
|
+
const {
|
|
1804
|
+
store: e,
|
|
1805
|
+
updateStore: t
|
|
1806
|
+
} = _e, n = () => e.errorState === "timeout", r = () => t({
|
|
1807
|
+
errorState: void 0
|
|
1808
|
+
}), i = () => {
|
|
1809
|
+
setTimeout(() => e.cameraManagerComponent.dismount(), 0);
|
|
1810
|
+
};
|
|
1811
|
+
let a;
|
|
1812
|
+
return c(Mt, {
|
|
1813
|
+
get mountTarget() {
|
|
1814
|
+
return e.cameraManagerComponent.overlayLayerNode;
|
|
1815
|
+
},
|
|
1816
|
+
title: "Scan unsuccessful",
|
|
1817
|
+
initialFocusEl: () => a,
|
|
1818
|
+
get open() {
|
|
1819
|
+
return n();
|
|
1820
|
+
},
|
|
1821
|
+
get actions() {
|
|
1822
|
+
return (() => {
|
|
1823
|
+
var s = Ur(), o = s.firstChild;
|
|
1824
|
+
N(s, c(V.CloseTrigger, {
|
|
1825
|
+
class: `px-4 py-2 text-sm bg-white text-gray-800 rounded-10 hover:bg-gray-100
|
|
1826
|
+
transition-colors transition-duration-100 appearance-none border-none ring-1
|
|
1827
|
+
ring-gray-900`,
|
|
1828
|
+
onClick: () => i(),
|
|
1829
|
+
children: "Cancel"
|
|
1830
|
+
}), o), o.$$click = () => {
|
|
1831
|
+
r(), e.blinkIdUxManager.cameraManager.startFrameCapture();
|
|
1832
|
+
};
|
|
1833
|
+
var u = a;
|
|
1834
|
+
return typeof u == "function" ? ye(u, o) : a = o, s;
|
|
1835
|
+
})();
|
|
1836
|
+
},
|
|
1837
|
+
get children() {
|
|
1838
|
+
return Nr();
|
|
1839
|
+
}
|
|
1840
|
+
});
|
|
1841
|
+
};
|
|
1842
|
+
dt(["click"]);
|
|
1843
|
+
var Lr = /* @__PURE__ */ b("<p class=mb-6>Scan the front side of a supported document."), Fr = /* @__PURE__ */ b('<div class="flex justify-center gap-4"><button class="px-4 py-2 text-sm bg-white text-gray-800 rounded-10 hover:bg-gray-100 transition-colors transition-duration-100 appearance-none border-none ring-1 ring-gray-900">Cancel</button><button class="px-4 py-2 text-sm bg-accent-500 text-white rounded-10 hover:bg-accent-600 transition-colors appearance-none border-none">Retry');
|
|
1844
|
+
const $r = () => {
|
|
1845
|
+
const {
|
|
1846
|
+
store: e,
|
|
1847
|
+
updateStore: t
|
|
1848
|
+
} = _e, n = () => e.errorState === "unsupported-document", r = () => t({
|
|
1849
|
+
errorState: void 0
|
|
1850
|
+
});
|
|
1851
|
+
let i;
|
|
1852
|
+
const a = () => {
|
|
1853
|
+
e.cameraManagerComponent.dismount();
|
|
1854
|
+
}, s = async () => {
|
|
1855
|
+
r(), await e.blinkIdUxManager.blinkIdCore.resetScanningSession(), await e.blinkIdUxManager.cameraManager.startFrameCapture();
|
|
1856
|
+
};
|
|
1857
|
+
return c(Mt, {
|
|
1858
|
+
get mountTarget() {
|
|
1859
|
+
return e.cameraManagerComponent.overlayLayerNode;
|
|
1860
|
+
},
|
|
1861
|
+
title: "Document not recognized",
|
|
1862
|
+
initialFocusEl: () => i,
|
|
1863
|
+
get open() {
|
|
1864
|
+
return n();
|
|
1865
|
+
},
|
|
1866
|
+
get actions() {
|
|
1867
|
+
return (() => {
|
|
1868
|
+
var o = Fr(), u = o.firstChild, l = u.nextSibling;
|
|
1869
|
+
u.$$click = () => {
|
|
1870
|
+
a();
|
|
1871
|
+
}, l.$$click = () => void s();
|
|
1872
|
+
var f = i;
|
|
1873
|
+
return typeof f == "function" ? ye(f, l) : i = l, o;
|
|
1874
|
+
})();
|
|
1875
|
+
},
|
|
1876
|
+
get children() {
|
|
1877
|
+
return Lr();
|
|
1878
|
+
}
|
|
1879
|
+
});
|
|
1880
|
+
};
|
|
1881
|
+
dt(["click"]);
|
|
1882
|
+
var Pr = /* @__PURE__ */ b("<div><style id=blinkid-ux-manager-style>");
|
|
1883
|
+
const Br = (e) => {
|
|
1884
|
+
const {
|
|
1885
|
+
store: t,
|
|
1886
|
+
updateStore: n
|
|
1887
|
+
} = _e, [r, i] = ie(t.blinkIdUxManager.uiState);
|
|
1888
|
+
fe(() => {
|
|
1889
|
+
const u = t.blinkIdUxManager.addOnErrorCallback((l) => {
|
|
1890
|
+
n({
|
|
1891
|
+
errorState: l
|
|
1892
|
+
});
|
|
1893
|
+
});
|
|
1894
|
+
De(() => u());
|
|
1895
|
+
});
|
|
1896
|
+
const a = zt(It)((u) => u.playbackState), s = () => a() === "capturing", o = () => s() || r().key === "SIDE_CAPTURED" || r().key === "DOCUMENT_CAPTURED";
|
|
1897
|
+
return fe(() => {
|
|
1898
|
+
const u = t.blinkIdUxManager.addOnUiStateChangedCallback((l) => {
|
|
1899
|
+
let f = l;
|
|
1900
|
+
const y = l.key;
|
|
1901
|
+
y === "LOW_QUALITY_FRONT" && (f = me.SENSING_FRONT), y === "LOW_QUALITY_BACK" && (f = me.SENSING_BACK), i(f);
|
|
1902
|
+
});
|
|
1903
|
+
De(() => u());
|
|
1904
|
+
}), (() => {
|
|
1905
|
+
var u = Pr(), l = u.firstChild;
|
|
1906
|
+
return ye((f) => {
|
|
1907
|
+
window.__blinkidUxManagerCssCode && (f.innerHTML = window.__blinkidUxManagerCssCode);
|
|
1908
|
+
}, l), N(u, c(Jt, {
|
|
1909
|
+
setLocalizationRef: () => {
|
|
1910
|
+
},
|
|
1911
|
+
get userStrings() {
|
|
1912
|
+
return e.localization;
|
|
1913
|
+
},
|
|
1914
|
+
get children() {
|
|
1915
|
+
return [c(Ir, {}), c($r, {}), c(Y, {
|
|
1916
|
+
get when() {
|
|
1917
|
+
return o();
|
|
1918
|
+
},
|
|
1919
|
+
get children() {
|
|
1920
|
+
return c(br, {
|
|
1921
|
+
get uiState() {
|
|
1922
|
+
return r();
|
|
1923
|
+
}
|
|
1924
|
+
});
|
|
1925
|
+
}
|
|
1926
|
+
})];
|
|
1927
|
+
}
|
|
1928
|
+
}), null), u;
|
|
1929
|
+
})();
|
|
1930
|
+
};
|
|
1931
|
+
function qr(e, t, n) {
|
|
1932
|
+
const {
|
|
1933
|
+
store: r,
|
|
1934
|
+
updateStore: i
|
|
1935
|
+
} = _e;
|
|
1936
|
+
i({
|
|
1937
|
+
blinkIdUxManager: e,
|
|
1938
|
+
cameraManagerComponent: t
|
|
1939
|
+
});
|
|
1940
|
+
const a = Ut(() => c(Br, {
|
|
1941
|
+
get localization() {
|
|
1942
|
+
return n?.localizationStrings;
|
|
1943
|
+
}
|
|
1944
|
+
}), t.feedbackLayerNode), s = async () => {
|
|
1945
|
+
n?.preserveSdkInstance || await r.blinkIdUxManager.blinkIdCore.terminateWorker(), a(), r.disposeBlinkIdUiStore();
|
|
1946
|
+
};
|
|
1947
|
+
return t.addOnDismountCallback(() => {
|
|
1948
|
+
setTimeout(() => {
|
|
1949
|
+
s();
|
|
1950
|
+
}, 0);
|
|
1951
|
+
}), a;
|
|
1952
|
+
}
|
|
1953
|
+
const xt = Symbol();
|
|
1954
|
+
globalThis.__BLINKID_UX_MANAGER__ ||= xt;
|
|
1955
|
+
globalThis.__BLINKID_UX_MANAGER__ !== xt && console.warn(
|
|
1956
|
+
"Detected multiple instances of @microblink/blinkid-ux-manager. This can lead to unexpected behavior."
|
|
1957
|
+
);
|
|
1958
|
+
export {
|
|
1959
|
+
Hr as BlinkIdUxManager,
|
|
1960
|
+
me as blinkIdUiStateMap,
|
|
1961
|
+
qr as createBlinkIdFeedbackUi,
|
|
1962
|
+
Ht as getUiStateKeyFromFrameResult
|
|
1963
|
+
};
|