@incodetech/web 0.0.0-dev-20260629-bd5fa5af → 0.0.0-dev-20260630-d195eb29
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/ae-signature/ae-signature.es.js +2 -2
- package/dist/antifraud/antifraud.es.js +3 -3
- package/dist/authentication/authentication.es.js +5 -4
- package/dist/cameraView-DIEzM5ru.js +47 -0
- package/dist/{tutorial-D1uQ5zJK.js → capture-Dxt6iWnd.js} +16 -702
- package/dist/certificate-issuance/certificate-issuance.es.js +6 -6
- package/dist/consent/consent.es.js +7 -7
- package/dist/{countrySelector-B4WuNUya.js → countrySelector-SvUOyPo0.js} +1 -1
- package/dist/cpf-ocr/cpf-ocr.es.js +1 -1
- package/dist/{cpfOcr-liTE9e70.js → cpfOcr-CSm-00nk.js} +2 -2
- package/dist/cpfOcr-DEZZicRS.js +2 -0
- package/dist/cross-document-data-match/cross-document-data-match.es.js +3 -3
- package/dist/curp-validation/curp-validation.es.js +6 -6
- package/dist/{customFields-BQ4scZfL.js → customFields-201bo3AI.js} +5 -5
- package/dist/{customWatchlist-7s0_wGtE.js → customWatchlist-CYoRNCim.js} +5 -5
- package/dist/document-capture/document-capture.es.js +1 -1
- package/dist/documentCapture-COIa8mmu.js +2 -0
- package/dist/{documentCapture-Cu_tz2u3.js → documentCapture-Dbp6cy2d.js} +9 -7
- package/dist/{dynamicForms-C54g-lZx.js → dynamicForms-BJ_LI0PU.js} +7 -7
- package/dist/ekyb/ekyb.es.js +1 -1
- package/dist/{ekybModule-Cc6BPxh6.js → ekybModule-X9lbZnqi.js} +10 -10
- package/dist/ekybModule-XMUaiosN.js +2 -0
- package/dist/ekyc/ekyc.es.js +1 -1
- package/dist/{ekycModule-jkXByPXe.js → ekycModule-BB4Nm0Cq.js} +8 -8
- package/dist/ekycModule-CdCSpWq3.js +2 -0
- package/dist/electronic-signature/electronic-signature.es.js +1 -1
- package/dist/{electronic-signature-BZ5w_RAk.js → electronic-signature-D0qnp91I.js} +6 -6
- package/dist/email/email.es.js +6 -6
- package/dist/{emailInput-kuqjdMgv.js → emailInput-D14hKRxf.js} +2 -2
- package/dist/{expiredId-0GUaIbV1.js → expiredId-UiGGdRyM.js} +1 -1
- package/dist/{extensibility-lpmP58bm.js → extensibility-SGdq3PlE.js} +29 -71
- package/dist/extensibility.es.js +11 -9
- package/dist/face-match/face-match.es.js +1 -1
- package/dist/{faceMatch-BSrFwS4c.js → faceMatch-BfwaUAm_.js} +6 -6
- package/dist/faceMatch-T5EmOL8W.js +2 -0
- package/dist/field-comparison/field-comparison.es.js +1 -1
- package/dist/fieldComparison-5yBIO7hm.js +2 -0
- package/dist/{fieldComparison-Bs5VX5F0.js → fieldComparison-CHX1cdUX.js} +6 -6
- package/dist/fiscal-qr/fiscal-qr.es.js +7 -6
- package/dist/flow/flow.es.js +17 -7
- package/dist/flow/styles.css +3147 -2073
- package/dist/geolocation/geolocation.es.js +5 -5
- package/dist/government-validation/government-validation.es.js +7 -7
- package/dist/{homeScreen-BIdVm9KA.js → homeScreen-BFMejvmk.js} +1 -1
- package/dist/{hooks-Da_yP_Dr.js → hooks-CNu7o-v8.js} +39 -2
- package/dist/{i18n-DoP1NB7u.js → i18n-CU4xq8qC.js} +1 -1
- package/dist/id/id.es.js +20 -16
- package/dist/id-verification/id-verification.es.js +4 -4
- package/dist/{idOcr-1KBqdamO.js → idOcr-CZIs3Ue9.js} +8 -8
- package/dist/identity-reuse/identity-reuse.es.js +4 -4
- package/dist/{incodeComponent-Cmi1rlWs.js → incodeComponent-CfzJGETt.js} +2 -2
- package/dist/{incodeModule-M8DszCee.js → incodeModule-B-4_3JrK.js} +1 -1
- package/dist/index.es.js +1 -1
- package/dist/{mandatoryConsent-DOQ0DKgM.js → mandatoryConsent-B9Jdswhx.js} +6 -6
- package/dist/{optionAccessibleLabel-_nvVCTSL.js → optionAccessibleLabel-gfF-58Mv.js} +3 -3
- package/dist/{otpInput-Q_kzSZeD.js → otpInput-ICExSJVT.js} +1 -1
- package/dist/{pdf-BMUXKJuC.js → pdf-BqtJTlor.js} +1 -1
- package/dist/{pdfViewer-bx59Lwwt.js → pdfViewer-LTQA54iS.js} +1 -1
- package/dist/phone/phone.es.js +5 -5
- package/dist/{processing-Boki1Z8j.js → processing-C5pzUUiq.js} +1 -1
- package/dist/qe-signature/qe-signature.es.js +2 -2
- package/dist/{radioGroupComposed-TuAWUAFK.js → radioGroupComposed-DuQxslB2.js} +1 -1
- package/dist/redirect-to-mobile/redirect-to-mobile.es.js +8 -8
- package/dist/{richText-DsTP4H3j.js → richText-CB1fmegc.js} +1 -1
- package/dist/selfie/selfie.es.js +8 -7
- package/dist/selfie/styles.css +112 -61
- package/dist/signature/signature.es.js +7 -7
- package/dist/{transitionSpinner-4rPkt-KM.js → transitionSpinner-SZgloiXn.js} +1 -1
- package/dist/tutorial-Djs82ySW.js +701 -0
- package/dist/types/video-selfie.d.ts +72 -0
- package/dist/{useModuleLoader-BgqZqe95.js → useModuleLoader-CJDUw2W-.js} +19 -17
- package/dist/{verificationResult-B6PBXbp9.js → verificationResult-NWJn7l6C.js} +1 -1
- package/dist/video-selfie/styles.css +1644 -0
- package/dist/video-selfie/video-selfie.es.js +857 -0
- package/dist/watchlist/watchlist.es.js +5 -5
- package/dist/{watchlistForBusiness-DCKlKG81.js → watchlistForBusiness-y_yYQHQW.js} +6 -6
- package/dist/workflow/styles.css +112 -61
- package/dist/workflow/workflow.es.js +7 -7
- package/package.json +11 -2
- package/dist/cpfOcr-BJOYoITy.js +0 -2
- package/dist/documentCapture-CMmbyRwO.js +0 -2
- package/dist/ekybModule-l21Hekpg.js +0 -2
- package/dist/ekycModule-BIbj7hr1.js +0 -2
- package/dist/faceMatch-D_uyeaBt.js +0 -2
- package/dist/fieldComparison-DQ3vMnvn.js +0 -2
- /package/dist/{aligndevicelottie-DMXPhIDs.js → aligndevicelottie-DFscByAI.js} +0 -0
- /package/dist/{back-horizontal-hint-DNIIDrEW.js → back-horizontal-hint-xTnSQbzn.js} +0 -0
- /package/dist/{back-tutorial-B8JJSJBB.js → back-tutorial-cI_4VHmE.js} +0 -0
- /package/dist/{back-vertical-hint-CW6ZS7bP.js → back-vertical-hint-BWWlHfX2.js} +0 -0
- /package/dist/{backdevicelottie-By75Bznp.js → backdevicelottie-COyhTrxM.js} +0 -0
- /package/dist/{blurdevicelottie-C_9VAHkM.js → blurdevicelottie-BLVeJHEG.js} +0 -0
- /package/dist/{browser-ponyfill-C_DpU0lQ.js → browser-ponyfill-Df13Th-G.js} +0 -0
- /package/dist/{defineProperty-CTu-cLWm.js → defineProperty-Qjefk7Uf.js} +0 -0
- /package/dist/{flip-animation-st9bra1p.js → flip-animation-CZYSUtMm.js} +0 -0
- /package/dist/{front-horizontal-hint-DvME-aVk.js → front-horizontal-hint-B84GgTO1.js} +0 -0
- /package/dist/{front-vertical-hint-BUG1VMsP.js → front-vertical-hint-Bs_avngq.js} +0 -0
- /package/dist/{frontdevicelottie-uObOEs8p.js → frontdevicelottie-B4tE2PYQ.js} +0 -0
- /package/dist/{glaredevicelottie-CsfIgqIc.js → glaredevicelottie-D1pR73sx.js} +0 -0
- /package/dist/{id-laser-h-BvVSaLyU.js → id-laser-h-CzPegPMn.js} +0 -0
- /package/dist/{id-laser-v-Dj_RN_s9.js → id-laser-v-BiUXkM4x.js} +0 -0
- /package/dist/{id-tutorial-BOOsXlAJ.js → id-tutorial-DwO90SAm.js} +0 -0
- /package/dist/{lottie_light-BG-RL2Iu.js → lottie_light-C6B2ec41.js} +0 -0
- /package/dist/{numberedStep-Dc0BUU-j.js → numberedStep-CEb-lFJm.js} +0 -0
- /package/dist/{passport-horizontal-hint-BhpVt73n.js → passport-horizontal-hint-Bj0ZJY0g.js} +0 -0
- /package/dist/{passport-tutorial-CeSup6m9.js → passport-tutorial-D9JNsMsM.js} +0 -0
- /package/dist/{passport-vertical-hint-CVRBnZXS.js → passport-vertical-hint-Dfk77xUJ.js} +0 -0
- /package/dist/{registerIncodeElement-CdlNRRv5.js → registerIncodeElement-DaNjbAwZ.js} +0 -0
- /package/dist/{requiredLabelHint-DX3oVNtu.js → requiredLabelHint-D0RhuMed.js} +0 -0
- /package/dist/{selfieTutorial-CYa8bq6B.js → selfieTutorial-pB-N-fj5.js} +0 -0
- /package/dist/{snackbar-CGL6gp9u.js → snackbar-DS7Mv62v.js} +0 -0
- /package/dist/{statusPage-BUm5gtQY.js → statusPage-Bk8nJwXV.js} +0 -0
- /package/dist/{tabs-DUkWjBGk.js → tabs-C__chW-u.js} +0 -0
|
@@ -1,300 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { r as
|
|
5
|
-
import { n as cn, r as Spacer, t as LoadingIcon } from "./loadingIcon-B0ysgiNq.js";
|
|
1
|
+
import { n as useTranslation, t as Trans } from "./i18n-CU4xq8qC.js";
|
|
2
|
+
import { _ as y, h as q, l as A, m as g, v as u, x as k } from "./vendor-preact-DThS2ZQ_.js";
|
|
3
|
+
import { a as useIsMobileDeviceWidth } from "./hooks-CNu7o-v8.js";
|
|
4
|
+
import { n as cn, r as Spacer } from "./loadingIcon-B0ysgiNq.js";
|
|
6
5
|
import { t as Page } from "./page-DidH_RkX.js";
|
|
7
6
|
import { i as TypographyH4, n as TypographyH1, t as Title } from "./typography-BZIpjo97.js";
|
|
8
|
-
import { t as TransitionSpinner } from "./transitionSpinner-
|
|
7
|
+
import { t as TransitionSpinner } from "./transitionSpinner-SZgloiXn.js";
|
|
9
8
|
import { t as Button } from "./button-Ch5-QgHB.js";
|
|
10
|
-
import { t as ErrorIcon } from "./errorIcon-BA4T6iy-.js";
|
|
11
9
|
import { h as WarningIcon } from "./icons-CJJbIpBq.js";
|
|
12
|
-
import { t as SuccessIcon } from "./successIcon-B5mGvdx1.js";
|
|
13
10
|
import { t as Modal } from "./modal-OxkFuuiR.js";
|
|
14
11
|
import { t as BottomSheet } from "./bottomSheet-CnWbbUAM.js";
|
|
15
|
-
import { t as NumberedStep } from "./numberedStep-
|
|
12
|
+
import { t as NumberedStep } from "./numberedStep-CEb-lFJm.js";
|
|
16
13
|
import { getBrowser, getDeviceClass } from "@incodetech/core/device";
|
|
17
14
|
import "@incodetech/core/camera";
|
|
18
|
-
//#region src/shared/errorContent/errorContent.tsx
|
|
19
|
-
var ErrorContent = ({ title, description, attemptsRemaining, onButtonClick, "data-testid": testId }) => {
|
|
20
|
-
const { t } = useTranslation();
|
|
21
|
-
const noMoreAttempts = attemptsRemaining <= 0;
|
|
22
|
-
const titleRef = A(null);
|
|
23
|
-
y(() => {
|
|
24
|
-
titleRef.current?.focus();
|
|
25
|
-
}, []);
|
|
26
|
-
return /* @__PURE__ */ u(Modal.Root, {
|
|
27
|
-
open: true,
|
|
28
|
-
dismissible: false,
|
|
29
|
-
hasBackdrop: false,
|
|
30
|
-
manageInitialFocus: false,
|
|
31
|
-
class: "IncodeErrorContent",
|
|
32
|
-
children: /* @__PURE__ */ u(Modal.Content, {
|
|
33
|
-
class: "IncodeErrorContentContent",
|
|
34
|
-
children: /* @__PURE__ */ u(Page, {
|
|
35
|
-
"data-testid": testId,
|
|
36
|
-
className: "IncodeErrorContentPage",
|
|
37
|
-
children: /* @__PURE__ */ u("div", {
|
|
38
|
-
class: "IncodeErrorContentContainer",
|
|
39
|
-
children: [/* @__PURE__ */ u("div", {
|
|
40
|
-
class: "IncodeErrorContentIconContainer",
|
|
41
|
-
children: [
|
|
42
|
-
noMoreAttempts ? /* @__PURE__ */ u(ErrorIcon, { size: 32 }) : /* @__PURE__ */ u(WarningIcon, { size: 32 }),
|
|
43
|
-
/* @__PURE__ */ u(Spacer, { size: 16 }),
|
|
44
|
-
/* @__PURE__ */ u(Title, {
|
|
45
|
-
ref: titleRef,
|
|
46
|
-
id: "incode-modal-title",
|
|
47
|
-
tabIndex: -1,
|
|
48
|
-
className: "IncodeErrorContentTitle",
|
|
49
|
-
children: title
|
|
50
|
-
}),
|
|
51
|
-
/* @__PURE__ */ u(Spacer, { size: 12 }),
|
|
52
|
-
/* @__PURE__ */ u("p", {
|
|
53
|
-
class: "IncodeErrorContentDescription",
|
|
54
|
-
children: description
|
|
55
|
-
})
|
|
56
|
-
]
|
|
57
|
-
}), /* @__PURE__ */ u("div", {
|
|
58
|
-
class: "IncodeErrorContentAttemptsContainer",
|
|
59
|
-
children: [
|
|
60
|
-
!noMoreAttempts ? /* @__PURE__ */ u("p", {
|
|
61
|
-
class: "IncodeErrorContentAttemptsText",
|
|
62
|
-
children: t("common.attemptsRemaining", { count: attemptsRemaining })
|
|
63
|
-
}) : null,
|
|
64
|
-
/* @__PURE__ */ u(Button, {
|
|
65
|
-
onClick: onButtonClick,
|
|
66
|
-
children: noMoreAttempts ? t("common.continue") : t("common.tryAgain")
|
|
67
|
-
}),
|
|
68
|
-
/* @__PURE__ */ u(Spacer, { size: 16 })
|
|
69
|
-
]
|
|
70
|
-
})]
|
|
71
|
-
})
|
|
72
|
-
})
|
|
73
|
-
})
|
|
74
|
-
});
|
|
75
|
-
};
|
|
76
|
-
//#endregion
|
|
77
|
-
//#region src/shared/lottie/lottie.tsx
|
|
78
|
-
var lottiePromise = null;
|
|
79
|
-
async function loadLottie() {
|
|
80
|
-
if (lottiePromise) return lottiePromise;
|
|
81
|
-
lottiePromise = import("./lottie_light-BG-RL2Iu.js").then((m) => /* @__PURE__ */ __toESM(m.default, 1)).then((mod) => mod.default);
|
|
82
|
-
return lottiePromise;
|
|
83
|
-
}
|
|
84
|
-
var AUTO_STOP_AFTER_MS = 5e3;
|
|
85
|
-
function Lottie({ animationData, loop = true, autoplay = true, reverse = false, style, className, onComplete, autoStop = false, stopFramePosition }) {
|
|
86
|
-
const containerRef = A(null);
|
|
87
|
-
const effectiveAutoplay = reverse ? false : autoplay;
|
|
88
|
-
const animationOptionsRef = A({
|
|
89
|
-
container: containerRef.current,
|
|
90
|
-
renderer: "svg",
|
|
91
|
-
loop,
|
|
92
|
-
autoplay: effectiveAutoplay,
|
|
93
|
-
animationData
|
|
94
|
-
});
|
|
95
|
-
y(() => {
|
|
96
|
-
animationOptionsRef.current = {
|
|
97
|
-
container: containerRef.current,
|
|
98
|
-
renderer: "svg",
|
|
99
|
-
loop,
|
|
100
|
-
autoplay: effectiveAutoplay,
|
|
101
|
-
animationData
|
|
102
|
-
};
|
|
103
|
-
}, [
|
|
104
|
-
animationData,
|
|
105
|
-
loop,
|
|
106
|
-
effectiveAutoplay
|
|
107
|
-
]);
|
|
108
|
-
y(() => {
|
|
109
|
-
if (!containerRef.current) return;
|
|
110
|
-
let anim;
|
|
111
|
-
let stopTimer;
|
|
112
|
-
let isMounted = true;
|
|
113
|
-
loadLottie().then((lottie) => {
|
|
114
|
-
if (!isMounted) return;
|
|
115
|
-
anim = lottie.loadAnimation(animationOptionsRef.current);
|
|
116
|
-
if (reverse) {
|
|
117
|
-
anim.setDirection(-1);
|
|
118
|
-
anim.goToAndPlay(anim.totalFrames - 1, true);
|
|
119
|
-
}
|
|
120
|
-
if (onComplete) anim.addEventListener("complete", onComplete);
|
|
121
|
-
if (autoStop) stopTimer = window.setTimeout(() => {
|
|
122
|
-
const current = anim;
|
|
123
|
-
if (!current) return;
|
|
124
|
-
if (!stopFramePosition) {
|
|
125
|
-
current.pause();
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
const totalFrames = current.totalFrames;
|
|
129
|
-
if (!totalFrames || totalFrames <= 0) {
|
|
130
|
-
current.stop();
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
const targetFrame = stopFramePosition === "last" ? Math.max(totalFrames - 1, 0) : stopFramePosition === "first" ? 0 : Math.floor((totalFrames - 1) / 2);
|
|
134
|
-
current.goToAndStop(targetFrame, true);
|
|
135
|
-
}, AUTO_STOP_AFTER_MS);
|
|
136
|
-
});
|
|
137
|
-
return () => {
|
|
138
|
-
isMounted = false;
|
|
139
|
-
if (stopTimer !== void 0) window.clearTimeout(stopTimer);
|
|
140
|
-
if (anim) {
|
|
141
|
-
if (onComplete) anim.removeEventListener("complete", onComplete);
|
|
142
|
-
anim.destroy();
|
|
143
|
-
}
|
|
144
|
-
};
|
|
145
|
-
}, [
|
|
146
|
-
onComplete,
|
|
147
|
-
reverse,
|
|
148
|
-
autoStop,
|
|
149
|
-
stopFramePosition
|
|
150
|
-
]);
|
|
151
|
-
return /* @__PURE__ */ u("div", {
|
|
152
|
-
ref: containerRef,
|
|
153
|
-
style,
|
|
154
|
-
className,
|
|
155
|
-
"aria-hidden": "true"
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
//#endregion
|
|
159
|
-
//#region src/shared/baseTutorial/replaceBaseTutorial.ts
|
|
160
|
-
/**
|
|
161
|
-
* The brand blues baked into the tutorial animations. The selfie oval/shoulders
|
|
162
|
-
* use `#007aff`; the ID/passport tutorials additionally use `#006aff` (the
|
|
163
|
-
* default brand blue) for their accent. Both are re-tinted to the active
|
|
164
|
-
* branding color.
|
|
165
|
-
*
|
|
166
|
-
* Authored as hex and converted to Lottie's normalized `[r, g, b]` (0–1) form.
|
|
167
|
-
* The two greens are ~0.06 apart, comfortably outside `COLOR_MATCH_TOLERANCE`,
|
|
168
|
-
* so they neither cross-match nor catch the (grayscale/white) document and
|
|
169
|
-
* face artwork.
|
|
170
|
-
*/
|
|
171
|
-
var SOURCE_BRAND_COLORS = ["#007aff", "#006aff"].map(hexToRgbUnit).filter((color) => color !== null);
|
|
172
|
-
/**
|
|
173
|
-
* Per-channel tolerance when matching a source color. The baked values are
|
|
174
|
-
* authored as rounded decimals (e.g. `0.48`), so an exact comparison is too
|
|
175
|
-
* brittle; a small tolerance keeps the match robust without catching
|
|
176
|
-
* unrelated colors.
|
|
177
|
-
*/
|
|
178
|
-
var COLOR_MATCH_TOLERANCE = .02;
|
|
179
|
-
/**
|
|
180
|
-
* Reads a CSS custom property off the document root and returns its value.
|
|
181
|
-
* Returns `fallback` (empty by default) when the property is unset or
|
|
182
|
-
* unavailable (e.g. during SSR / tests). With the default empty fallback the
|
|
183
|
-
* recolor no-ops, leaving the animation's authored colors in place — which are
|
|
184
|
-
* the default brand blue, so no theme-specific literal is needed here.
|
|
185
|
-
*/
|
|
186
|
-
function getCssVariableAsHex(variableName, fallback = "") {
|
|
187
|
-
if (typeof document === "undefined") return fallback;
|
|
188
|
-
return getComputedStyle(document.documentElement).getPropertyValue(variableName).trim() || fallback;
|
|
189
|
-
}
|
|
190
|
-
function hexToRgbUnit(hex) {
|
|
191
|
-
let normalized = hex.replace("#", "").trim();
|
|
192
|
-
if (normalized.length === 3) normalized = normalized.split("").map((char) => char + char).join("");
|
|
193
|
-
const result = /^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(normalized);
|
|
194
|
-
if (!result) return null;
|
|
195
|
-
return [
|
|
196
|
-
Number.parseInt(result[1], 16) / 255,
|
|
197
|
-
Number.parseInt(result[2], 16) / 255,
|
|
198
|
-
Number.parseInt(result[3], 16) / 255
|
|
199
|
-
];
|
|
200
|
-
}
|
|
201
|
-
function channelMatches(a, b) {
|
|
202
|
-
return Math.abs(a - b) <= COLOR_MATCH_TOLERANCE;
|
|
203
|
-
}
|
|
204
|
-
function isSourceColor(r, g, b) {
|
|
205
|
-
return SOURCE_BRAND_COLORS.some(([sr, sg, sb]) => channelMatches(r, sr) && channelMatches(g, sg) && channelMatches(b, sb));
|
|
206
|
-
}
|
|
207
|
-
function isStaticColorArray(value) {
|
|
208
|
-
return Array.isArray(value) && value.length >= 3 && value.every((entry) => typeof entry === "number");
|
|
209
|
-
}
|
|
210
|
-
function recolorSolid(node, target) {
|
|
211
|
-
const colorHolder = node.c;
|
|
212
|
-
if (!colorHolder || typeof colorHolder !== "object") return;
|
|
213
|
-
const k = colorHolder.k;
|
|
214
|
-
if (isStaticColorArray(k) && isSourceColor(k[0], k[1], k[2])) {
|
|
215
|
-
k[0] = target[0];
|
|
216
|
-
k[1] = target[1];
|
|
217
|
-
k[2] = target[2];
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
function recolorGradient(node, target) {
|
|
221
|
-
const gradient = node.g;
|
|
222
|
-
if (!gradient || typeof gradient !== "object") return;
|
|
223
|
-
const { p, k } = gradient;
|
|
224
|
-
const stopCount = typeof p === "number" ? p : 0;
|
|
225
|
-
const stops = k?.k;
|
|
226
|
-
if (stopCount <= 0 || !Array.isArray(stops)) return;
|
|
227
|
-
for (let stop = 0; stop < stopCount; stop++) {
|
|
228
|
-
const base = stop * 4;
|
|
229
|
-
const r = stops[base + 1];
|
|
230
|
-
const g = stops[base + 2];
|
|
231
|
-
const b = stops[base + 3];
|
|
232
|
-
if (typeof r === "number" && typeof g === "number" && typeof b === "number" && isSourceColor(r, g, b)) {
|
|
233
|
-
stops[base + 1] = target[0];
|
|
234
|
-
stops[base + 2] = target[1];
|
|
235
|
-
stops[base + 3] = target[2];
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
function recolorNode(node, target) {
|
|
240
|
-
if (Array.isArray(node)) {
|
|
241
|
-
for (const child of node) recolorNode(child, target);
|
|
242
|
-
return;
|
|
243
|
-
}
|
|
244
|
-
if (!node || typeof node !== "object") return;
|
|
245
|
-
const obj = node;
|
|
246
|
-
if (obj.ty === "fl" || obj.ty === "st") recolorSolid(obj, target);
|
|
247
|
-
else if (obj.ty === "gf" || obj.ty === "gs") recolorGradient(obj, target);
|
|
248
|
-
for (const key of Object.keys(obj)) recolorNode(obj[key], target);
|
|
249
|
-
}
|
|
250
|
-
/**
|
|
251
|
-
* Returns a deep copy of `animationData` with the baked-in brand blue swapped
|
|
252
|
-
* for `hexColor`. The input is never mutated. Unparseable colors leave the
|
|
253
|
-
* animation untouched.
|
|
254
|
-
*/
|
|
255
|
-
function replaceLottieColor(animationData, hexColor) {
|
|
256
|
-
const target = hexToRgbUnit(hexColor);
|
|
257
|
-
if (!target) return animationData;
|
|
258
|
-
const clone = JSON.parse(JSON.stringify(animationData));
|
|
259
|
-
recolorNode(clone, target);
|
|
260
|
-
return clone;
|
|
261
|
-
}
|
|
262
|
-
//#endregion
|
|
263
|
-
//#region src/shared/baseTutorial/baseTutorial.tsx
|
|
264
|
-
var BaseTutorial = ({ className = "", animationData, title, titleId, subtitle, onContinue, buttonText, disclaimerText, isLoading, stopFramePosition = "middle" }) => {
|
|
265
|
-
const themedAnimationData = T(() => animationData ? replaceLottieColor(animationData, getCssVariableAsHex("--primitive-color-brand-500")) : null, [animationData]);
|
|
266
|
-
return /* @__PURE__ */ u(Page, {
|
|
267
|
-
className: cn("IncodeTutorialPage", className),
|
|
268
|
-
title,
|
|
269
|
-
titleId,
|
|
270
|
-
subtitle,
|
|
271
|
-
children: [/* @__PURE__ */ u("div", {
|
|
272
|
-
class: "IncodeBaseTutorialContainer",
|
|
273
|
-
children: /* @__PURE__ */ u("div", {
|
|
274
|
-
class: "IncodeBaseTutorialAnimationContainer",
|
|
275
|
-
"aria-hidden": "true",
|
|
276
|
-
children: themedAnimationData ? /* @__PURE__ */ u(Lottie, {
|
|
277
|
-
animationData: themedAnimationData,
|
|
278
|
-
className: "IncodeBaseTutorialAnimation",
|
|
279
|
-
autoStop: true,
|
|
280
|
-
stopFramePosition
|
|
281
|
-
}) : null
|
|
282
|
-
})
|
|
283
|
-
}), /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ u("p", {
|
|
284
|
-
class: "IncodeBaseTutorialDisclaimer",
|
|
285
|
-
children: disclaimerText
|
|
286
|
-
}), /* @__PURE__ */ u("div", {
|
|
287
|
-
class: "IncodeBaseTutorialButtonContainer",
|
|
288
|
-
children: /* @__PURE__ */ u(Button, {
|
|
289
|
-
onClick: onContinue,
|
|
290
|
-
class: "m-auto max-w-[420px]",
|
|
291
|
-
isLoading,
|
|
292
|
-
children: buttonText
|
|
293
|
-
})
|
|
294
|
-
})] })]
|
|
295
|
-
});
|
|
296
|
-
};
|
|
297
|
-
//#endregion
|
|
298
15
|
//#region src/shared/permissions/camera/boldWithArrow.tsx
|
|
299
16
|
var BoldWithArrow = ({ i18nKey }) => /* @__PURE__ */ u("span", {
|
|
300
17
|
class: "IncodeBoldWithArrow",
|
|
@@ -2326,7 +2043,10 @@ var Permissions = ({ manager, permissionStatus }) => {
|
|
|
2326
2043
|
const { t } = useTranslation();
|
|
2327
2044
|
if (permissionStatus === "requesting") return /* @__PURE__ */ u(TransitionSpinner, {
|
|
2328
2045
|
className: "IncodePermissionsRequestingPage",
|
|
2329
|
-
|
|
2046
|
+
spinnerConfig: {
|
|
2047
|
+
title: t("loadingCircle.holdOn"),
|
|
2048
|
+
subtitle: t("loadingCircle.preparingCamera")
|
|
2049
|
+
}
|
|
2330
2050
|
});
|
|
2331
2051
|
if (permissionStatus === "learnMore") return /* @__PURE__ */ u(LearnMore, {
|
|
2332
2052
|
onAllowPermissions: () => manager.requestPermission(),
|
|
@@ -2372,206 +2092,7 @@ var Permissions = ({ manager, permissionStatus }) => {
|
|
|
2372
2092
|
});
|
|
2373
2093
|
};
|
|
2374
2094
|
//#endregion
|
|
2375
|
-
//#region src/
|
|
2376
|
-
/**
|
|
2377
|
-
* Mounts the avatar `<canvas>` in place of the live selfie video. The element
|
|
2378
|
-
* is created and rendered to in the infra layer; the UI only hosts it and
|
|
2379
|
-
* applies layout + mirror classes (the latter parallels the video's
|
|
2380
|
-
* `.IncodeCaptureVideoMirrored`, keeping handedness in one place). Cosmetic
|
|
2381
|
-
* only — the capture pipeline runs on the real frames regardless.
|
|
2382
|
-
*/
|
|
2383
|
-
var AvatarCanvas = ({ canvas, mirrored }) => {
|
|
2384
|
-
const hostRef = A(null);
|
|
2385
|
-
y(() => {
|
|
2386
|
-
const host = hostRef.current;
|
|
2387
|
-
if (!host || !canvas) return void 0;
|
|
2388
|
-
canvas.classList.add("IncodeCaptureAvatarElement");
|
|
2389
|
-
canvas.classList.toggle("IncodeCaptureAvatarMirrored", mirrored);
|
|
2390
|
-
host.appendChild(canvas);
|
|
2391
|
-
return () => {
|
|
2392
|
-
if (canvas.parentElement === host) host.removeChild(canvas);
|
|
2393
|
-
};
|
|
2394
|
-
}, [canvas, mirrored]);
|
|
2395
|
-
return /* @__PURE__ */ u("div", {
|
|
2396
|
-
ref: hostRef,
|
|
2397
|
-
class: "IncodeCaptureAvatarHost",
|
|
2398
|
-
"aria-hidden": "true"
|
|
2399
|
-
});
|
|
2400
|
-
};
|
|
2401
|
-
//#endregion
|
|
2402
|
-
//#region src/modules/selfie/captureStatusPage.tsx
|
|
2403
|
-
var CaptureStatusPage = ({ icon, title, className, isLoading }) => {
|
|
2404
|
-
const titleRef = A(null);
|
|
2405
|
-
y(() => {
|
|
2406
|
-
titleRef.current?.focus();
|
|
2407
|
-
}, []);
|
|
2408
|
-
return /* @__PURE__ */ u(Page, {
|
|
2409
|
-
className: `IncodeCaptureStatusPage ${className ?? ""}`,
|
|
2410
|
-
children: [/* @__PURE__ */ u(Spacer, { size: 40 }), /* @__PURE__ */ u("div", {
|
|
2411
|
-
class: "IncodeCaptureStatusContainer",
|
|
2412
|
-
role: isLoading ? "status" : void 0,
|
|
2413
|
-
"aria-live": isLoading ? "polite" : void 0,
|
|
2414
|
-
children: [
|
|
2415
|
-
/* @__PURE__ */ u(Spacer, { size: 120 }),
|
|
2416
|
-
icon,
|
|
2417
|
-
/* @__PURE__ */ u(Spacer, { size: 16 }),
|
|
2418
|
-
/* @__PURE__ */ u(Title, {
|
|
2419
|
-
ref: titleRef,
|
|
2420
|
-
className: "IncodeCaptureStatusTitle",
|
|
2421
|
-
tabIndex: -1,
|
|
2422
|
-
children: title
|
|
2423
|
-
})
|
|
2424
|
-
]
|
|
2425
|
-
})]
|
|
2426
|
-
});
|
|
2427
|
-
};
|
|
2428
|
-
//#endregion
|
|
2429
|
-
//#region src/modules/selfie/errorModal.tsx
|
|
2430
|
-
var defaultError = {
|
|
2431
|
-
title: "Something went wrong",
|
|
2432
|
-
description: "Please try again later"
|
|
2433
|
-
};
|
|
2434
|
-
var errorContent = {
|
|
2435
|
-
MASK_ERROR: {
|
|
2436
|
-
title: "notifications.mask",
|
|
2437
|
-
description: "notifications.maskDescription"
|
|
2438
|
-
},
|
|
2439
|
-
BRIGHTNESS_ERROR: {
|
|
2440
|
-
title: "notifications.brightness",
|
|
2441
|
-
description: "notifications.brightnessDescription"
|
|
2442
|
-
},
|
|
2443
|
-
LIVENESS_ERROR: {
|
|
2444
|
-
title: "notifications.spoof",
|
|
2445
|
-
description: "notifications.spoofDescription"
|
|
2446
|
-
},
|
|
2447
|
-
CLOSED_EYES_ERROR: {
|
|
2448
|
-
title: "notifications.closedEyes",
|
|
2449
|
-
description: "notifications.closedEyesDescription"
|
|
2450
|
-
},
|
|
2451
|
-
HEAD_COVER_ERROR: {
|
|
2452
|
-
title: "notifications.removeHeadwear",
|
|
2453
|
-
description: "notifications.removeHeadwearDescription"
|
|
2454
|
-
},
|
|
2455
|
-
LENSES_ERROR: {
|
|
2456
|
-
title: "notifications.lenses",
|
|
2457
|
-
description: "notifications.lensesDescription"
|
|
2458
|
-
},
|
|
2459
|
-
FACE_NOT_FOUND: {
|
|
2460
|
-
title: "notifications.faceNotFound",
|
|
2461
|
-
description: "notifications.faceNotFoundDescription"
|
|
2462
|
-
},
|
|
2463
|
-
MULTIPLE_FACES: {
|
|
2464
|
-
title: "notifications.multiple",
|
|
2465
|
-
description: "notifications.multipleDescription"
|
|
2466
|
-
},
|
|
2467
|
-
TOO_BLURRY_ERROR: defaultError,
|
|
2468
|
-
TOO_DARK_ERROR: defaultError,
|
|
2469
|
-
SERVER_ERROR: defaultError,
|
|
2470
|
-
FACE_CROPPING_FAILED: defaultError,
|
|
2471
|
-
FACE_TOO_SMALL: defaultError,
|
|
2472
|
-
PROCESSING_ERROR: defaultError,
|
|
2473
|
-
BAD_REQUEST: defaultError,
|
|
2474
|
-
USER_IS_NOT_RECOGNIZED: {
|
|
2475
|
-
title: "notifications.accessDenied",
|
|
2476
|
-
description: "notifications.accessDeniedDescription"
|
|
2477
|
-
},
|
|
2478
|
-
SPOOF_ATTEMPT_DETECTED: {
|
|
2479
|
-
title: "notifications.spoof",
|
|
2480
|
-
description: "notifications.spoofDescription"
|
|
2481
|
-
},
|
|
2482
|
-
FACE_TOO_DARK: {
|
|
2483
|
-
title: "notifications.brightness",
|
|
2484
|
-
description: "notifications.brightnessDescription"
|
|
2485
|
-
},
|
|
2486
|
-
LENSES_DETECTED: {
|
|
2487
|
-
title: "notifications.lenses",
|
|
2488
|
-
description: "notifications.lensesDescription"
|
|
2489
|
-
},
|
|
2490
|
-
FACE_MASK_DETECTED: {
|
|
2491
|
-
title: "notifications.mask",
|
|
2492
|
-
description: "notifications.maskDescription"
|
|
2493
|
-
},
|
|
2494
|
-
CLOSED_EYES_DETECTED: {
|
|
2495
|
-
title: "notifications.closedEyes",
|
|
2496
|
-
description: "notifications.closedEyesDescription"
|
|
2497
|
-
},
|
|
2498
|
-
HEAD_COVER_DETECTED: {
|
|
2499
|
-
title: "notifications.removeHeadwear",
|
|
2500
|
-
description: "notifications.removeHeadwearDescription"
|
|
2501
|
-
},
|
|
2502
|
-
FACE_TOO_BLURRY: {
|
|
2503
|
-
title: "notifications.spoof",
|
|
2504
|
-
description: "notifications.spoofDescription"
|
|
2505
|
-
},
|
|
2506
|
-
BAD_PHOTO_QUALITY: {
|
|
2507
|
-
title: "notifications.lowQualityImage",
|
|
2508
|
-
description: "notifications.lowQualityImageDescription"
|
|
2509
|
-
},
|
|
2510
|
-
NONEXISTENT_CUSTOMER: {
|
|
2511
|
-
title: "notifications.nonexistentCustomer",
|
|
2512
|
-
description: "notifications.nonexistentCustomerDescription"
|
|
2513
|
-
},
|
|
2514
|
-
HINT_NOT_PROVIDED: {
|
|
2515
|
-
title: "notifications.hintNotProvided",
|
|
2516
|
-
description: "notifications.hintNotProvidedDescription"
|
|
2517
|
-
},
|
|
2518
|
-
SELFIE_IMAGE_LOW_QUALITY: {
|
|
2519
|
-
title: "notifications.selfieImageLowQuality",
|
|
2520
|
-
description: "notifications.selfieImageLowQualityDescription"
|
|
2521
|
-
}
|
|
2522
|
-
};
|
|
2523
|
-
var ERROR_CODES = [
|
|
2524
|
-
"LIVENESS_ERROR",
|
|
2525
|
-
"BRIGHTNESS_ERROR",
|
|
2526
|
-
"LENSES_ERROR",
|
|
2527
|
-
"MASK_ERROR",
|
|
2528
|
-
"CLOSED_EYES_ERROR",
|
|
2529
|
-
"HEAD_COVER_ERROR",
|
|
2530
|
-
"SERVER_ERROR",
|
|
2531
|
-
"FACE_NOT_FOUND",
|
|
2532
|
-
"MULTIPLE_FACES",
|
|
2533
|
-
"TOO_BLURRY_ERROR",
|
|
2534
|
-
"TOO_DARK_ERROR",
|
|
2535
|
-
"USER_IS_NOT_RECOGNIZED",
|
|
2536
|
-
"SPOOF_ATTEMPT_DETECTED",
|
|
2537
|
-
"FACE_TOO_DARK",
|
|
2538
|
-
"LENSES_DETECTED",
|
|
2539
|
-
"FACE_MASK_DETECTED",
|
|
2540
|
-
"CLOSED_EYES_DETECTED",
|
|
2541
|
-
"HEAD_COVER_DETECTED",
|
|
2542
|
-
"FACE_CROPPING_FAILED",
|
|
2543
|
-
"FACE_TOO_SMALL",
|
|
2544
|
-
"FACE_TOO_BLURRY",
|
|
2545
|
-
"BAD_PHOTO_QUALITY",
|
|
2546
|
-
"PROCESSING_ERROR",
|
|
2547
|
-
"BAD_REQUEST",
|
|
2548
|
-
"NONEXISTENT_CUSTOMER",
|
|
2549
|
-
"HINT_NOT_PROVIDED",
|
|
2550
|
-
"SELFIE_IMAGE_LOW_QUALITY"
|
|
2551
|
-
];
|
|
2552
|
-
var parseErrorCode = (error) => {
|
|
2553
|
-
const upperError = error.toUpperCase();
|
|
2554
|
-
if (upperError.includes("HTTP 400") || upperError.includes("BAD_REQUEST")) return "BAD_REQUEST";
|
|
2555
|
-
if (upperError.includes("HTTP 500") || upperError.includes("SERVER_ERROR")) return "SERVER_ERROR";
|
|
2556
|
-
for (const code of ERROR_CODES) if (upperError.includes(code)) return code;
|
|
2557
|
-
return null;
|
|
2558
|
-
};
|
|
2559
|
-
var ErrorModal = ({ error, attemptsRemaining, onTryAgain }) => {
|
|
2560
|
-
const { t } = useTranslation();
|
|
2561
|
-
if (!error) return null;
|
|
2562
|
-
const { title, description } = errorContent[parseErrorCode(error) ?? error] ?? defaultError;
|
|
2563
|
-
const titleText = t(title) ?? title;
|
|
2564
|
-
const descriptionText = attemptsRemaining <= 0 ? t("notifications.selfieCaptureFailedDescription") : t(description);
|
|
2565
|
-
return /* @__PURE__ */ u(ErrorContent, {
|
|
2566
|
-
"data-testid": "face-capture-error-modal",
|
|
2567
|
-
title: titleText,
|
|
2568
|
-
description: descriptionText,
|
|
2569
|
-
attemptsRemaining,
|
|
2570
|
-
onButtonClick: onTryAgain
|
|
2571
|
-
});
|
|
2572
|
-
};
|
|
2573
|
-
//#endregion
|
|
2574
|
-
//#region src/modules/selfie/faceOutline.tsx
|
|
2095
|
+
//#region src/shared/capture/faceOutline.tsx
|
|
2575
2096
|
var FaceOutline = () => {
|
|
2576
2097
|
return /* @__PURE__ */ u("svg", {
|
|
2577
2098
|
width: "292",
|
|
@@ -2589,7 +2110,7 @@ var FaceOutline = () => {
|
|
|
2589
2110
|
});
|
|
2590
2111
|
};
|
|
2591
2112
|
//#endregion
|
|
2592
|
-
//#region src/
|
|
2113
|
+
//#region src/shared/capture/loadingBorder.tsx
|
|
2593
2114
|
var IDLE_COLOR = "var(--surface-neutral-100)";
|
|
2594
2115
|
var getColor = (borderState) => {
|
|
2595
2116
|
switch (borderState) {
|
|
@@ -2652,65 +2173,7 @@ var LoadingBorder = ({ borderState = "idle" }) => {
|
|
|
2652
2173
|
});
|
|
2653
2174
|
};
|
|
2654
2175
|
//#endregion
|
|
2655
|
-
//#region src/
|
|
2656
|
-
var CameraButton = () => {
|
|
2657
|
-
return /* @__PURE__ */ u("div", {
|
|
2658
|
-
class: "IncodeCameraButton",
|
|
2659
|
-
children: /* @__PURE__ */ u("svg", {
|
|
2660
|
-
width: "64",
|
|
2661
|
-
height: "64",
|
|
2662
|
-
viewBox: "0 0 64 64",
|
|
2663
|
-
fill: "none",
|
|
2664
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2665
|
-
"aria-hidden": "true",
|
|
2666
|
-
children: [
|
|
2667
|
-
/* @__PURE__ */ u("circle", {
|
|
2668
|
-
cx: "32",
|
|
2669
|
-
cy: "32",
|
|
2670
|
-
r: "32",
|
|
2671
|
-
class: "IncodeCameraButtonBackground"
|
|
2672
|
-
}),
|
|
2673
|
-
/* @__PURE__ */ u("path", {
|
|
2674
|
-
d: "M55.5874 31.8191C55.5872 18.6938 44.9464 8.0537 31.821 8.0537C18.6958 8.05385 8.05581 18.6939 8.05566 31.8191C8.05566 44.9444 18.6958 55.5853 31.821 55.5854C44.9465 55.5854 55.5874 44.9445 55.5874 31.8191ZM57.5566 31.8191C57.5566 46.0321 46.034 57.5547 31.821 57.5547C17.6082 57.5545 6.08643 46.032 6.08643 31.8191C6.08657 17.6063 17.6083 6.08462 31.821 6.08447C46.0339 6.08447 57.5565 17.6062 57.5566 31.8191Z",
|
|
2675
|
-
class: "IncodeCameraButtonRing"
|
|
2676
|
-
}),
|
|
2677
|
-
/* @__PURE__ */ u("path", {
|
|
2678
|
-
d: "M35.5186 20.6768C36.887 20.677 37.995 21.777 37.9951 23.1338V24.1045H41.4766C43.0397 24.1052 44.3074 25.3626 44.3076 26.9131V38.5459C44.3076 40.0966 43.0398 41.3535 41.4766 41.3535H21.5381C19.975 41.3533 18.7081 40.0965 18.708 38.5459V26.9131C18.7083 25.3627 19.9751 24.1057 21.5381 24.1055H25.0205V23.1338C25.0206 21.7769 26.1285 20.6768 27.4971 20.6768H35.5186ZM31.5068 26.5273C28.0604 26.5273 25.2559 29.309 25.2559 32.7285C25.2559 36.148 28.0604 38.9297 31.5068 38.9297C34.954 38.9297 37.7588 36.148 37.7588 32.7285C37.7588 29.309 34.954 26.5274 31.5068 26.5273ZM31.5068 28.6348C33.7835 28.6348 35.6357 30.4728 35.6357 32.7305C35.6356 34.9887 33.7833 36.8252 31.5068 36.8252C29.2303 36.8252 27.3791 34.9887 27.3789 32.7305C27.3789 30.4721 29.2302 28.6348 31.5068 28.6348Z",
|
|
2679
|
-
class: "IncodeCameraButtonPath"
|
|
2680
|
-
})
|
|
2681
|
-
]
|
|
2682
|
-
})
|
|
2683
|
-
});
|
|
2684
|
-
};
|
|
2685
|
-
//#endregion
|
|
2686
|
-
//#region src/modules/selfie/manualCaptureButton.tsx
|
|
2687
|
-
var ManualCaptureButton = D(({ onClick, disabled }, ref) => {
|
|
2688
|
-
const { t } = useTranslation();
|
|
2689
|
-
return /* @__PURE__ */ u("div", {
|
|
2690
|
-
class: "IncodeSelfieManualCapture",
|
|
2691
|
-
"data-testid": "manual-capture-button",
|
|
2692
|
-
children: [
|
|
2693
|
-
/* @__PURE__ */ u("p", {
|
|
2694
|
-
id: "manual-capture-instructions",
|
|
2695
|
-
class: "IncodeSelfieManualCaptureText",
|
|
2696
|
-
children: t("selfiev2.manualCapture.instructions")
|
|
2697
|
-
}),
|
|
2698
|
-
/* @__PURE__ */ u(Spacer, { size: 32 }),
|
|
2699
|
-
/* @__PURE__ */ u("div", { children: /* @__PURE__ */ u(Button, {
|
|
2700
|
-
ref,
|
|
2701
|
-
id: "manual-capture-button",
|
|
2702
|
-
variant: "link",
|
|
2703
|
-
onClick,
|
|
2704
|
-
disabled,
|
|
2705
|
-
class: "IncodeSelfieManualCaptureButton",
|
|
2706
|
-
"aria-label": t("selfiev2.manualCapture.captureButton"),
|
|
2707
|
-
children: /* @__PURE__ */ u(CameraButton, {})
|
|
2708
|
-
}) })
|
|
2709
|
-
]
|
|
2710
|
-
});
|
|
2711
|
-
});
|
|
2712
|
-
//#endregion
|
|
2713
|
-
//#region src/modules/selfie/notification.tsx
|
|
2176
|
+
//#region src/shared/capture/notification.tsx
|
|
2714
2177
|
var Notification = ({ detectionState, disabled }) => {
|
|
2715
2178
|
const { t } = useTranslation();
|
|
2716
2179
|
const liveRef = A(null);
|
|
@@ -2738,7 +2201,8 @@ var Notification = ({ detectionState, disabled }) => {
|
|
|
2738
2201
|
faceMask: t("notifications.mask"),
|
|
2739
2202
|
centerFace: t("notifications.centerFaceV2"),
|
|
2740
2203
|
getReady: t("notifications.getReady"),
|
|
2741
|
-
capturing: t("idv2.capture.takingPhoto")
|
|
2204
|
+
capturing: t("idv2.capture.takingPhoto"),
|
|
2205
|
+
error: t("common.tryAgain")
|
|
2742
2206
|
}[detectionState] ?? "";
|
|
2743
2207
|
const announce = q((message) => {
|
|
2744
2208
|
const now = Date.now();
|
|
@@ -2818,154 +2282,4 @@ var Notification = ({ detectionState, disabled }) => {
|
|
|
2818
2282
|
}), /* @__PURE__ */ u(Spacer, { size: 24 })] }) : null] });
|
|
2819
2283
|
};
|
|
2820
2284
|
//#endregion
|
|
2821
|
-
|
|
2822
|
-
var Capture = ({ manager, state }) => {
|
|
2823
|
-
const { captureStatus, stream, detectionStatus, attemptsRemaining, uploadError, assistedOnboarding, ageAssurance, onDeviceMode, obfuscateWithAvatar, avatarCanvas, avatarVariant } = state;
|
|
2824
|
-
const [isManualCapturing, setIsManualCapturing] = d(false);
|
|
2825
|
-
const { t } = useTranslation();
|
|
2826
|
-
const manualCaptureRef = A(null);
|
|
2827
|
-
y(() => {
|
|
2828
|
-
if (detectionStatus === "manualCapture") manualCaptureRef.current?.focus();
|
|
2829
|
-
}, [detectionStatus]);
|
|
2830
|
-
if (captureStatus === "initializing") return /* @__PURE__ */ u(TransitionSpinner, { spinnerConfig: { subtitle: t("loadingCircle.preparingCamera") } });
|
|
2831
|
-
if (captureStatus === "detecting") {
|
|
2832
|
-
if (detectionStatus === "offline") return /* @__PURE__ */ u(Page, { title: "No internet connection" });
|
|
2833
|
-
const getBorderState = () => {
|
|
2834
|
-
if (isManualCapturing) return "capturing";
|
|
2835
|
-
if (detectionStatus === "detecting") return "idle";
|
|
2836
|
-
if (detectionStatus === "getReady") return "loading";
|
|
2837
|
-
if (detectionStatus === "getReadyFinished") return "loading";
|
|
2838
|
-
if (detectionStatus === "success") return "success";
|
|
2839
|
-
if (detectionStatus === "error") return "error";
|
|
2840
|
-
return "idle";
|
|
2841
|
-
};
|
|
2842
|
-
return /* @__PURE__ */ u(Page, {
|
|
2843
|
-
"data-testid": "capture-container",
|
|
2844
|
-
children: [
|
|
2845
|
-
/* @__PURE__ */ u(Title, {
|
|
2846
|
-
className: "IncodeCaptureVisuallyHidden",
|
|
2847
|
-
children: t("selfiev2.capture.title")
|
|
2848
|
-
}),
|
|
2849
|
-
/* @__PURE__ */ u(Spacer, { size: 48 }),
|
|
2850
|
-
/* @__PURE__ */ u("div", {
|
|
2851
|
-
class: "IncodeCaptureContainer",
|
|
2852
|
-
children: [
|
|
2853
|
-
/* @__PURE__ */ u(LoadingBorder, { borderState: getBorderState() }),
|
|
2854
|
-
/* @__PURE__ */ u("div", {
|
|
2855
|
-
class: "IncodeCaptureFrame",
|
|
2856
|
-
children: /* @__PURE__ */ u("div", {
|
|
2857
|
-
class: "IncodeCaptureVideoWrapper",
|
|
2858
|
-
"aria-hidden": "true",
|
|
2859
|
-
children: stream ? /* @__PURE__ */ u(k, { children: [obfuscateWithAvatar ? /* @__PURE__ */ u(AvatarCanvas, {
|
|
2860
|
-
canvas: avatarCanvas,
|
|
2861
|
-
mirrored: !assistedOnboarding
|
|
2862
|
-
}) : /* @__PURE__ */ u(Video, {
|
|
2863
|
-
stream,
|
|
2864
|
-
mirrored: !assistedOnboarding
|
|
2865
|
-
}), obfuscateWithAvatar && avatarVariant !== "privacy-lens" ? null : /* @__PURE__ */ u("div", {
|
|
2866
|
-
class: "IncodeCaptureVideo",
|
|
2867
|
-
children: /* @__PURE__ */ u(FaceOutline, {})
|
|
2868
|
-
})] }) : null
|
|
2869
|
-
})
|
|
2870
|
-
}),
|
|
2871
|
-
/* @__PURE__ */ u(Spacer, { size: 32 }),
|
|
2872
|
-
detectionStatus ? /* @__PURE__ */ u(Notification, {
|
|
2873
|
-
detectionState: detectionStatus,
|
|
2874
|
-
disabled: !!uploadError || isManualCapturing
|
|
2875
|
-
}) : null,
|
|
2876
|
-
detectionStatus === "manualCapture" && !onDeviceMode ? /* @__PURE__ */ u(ManualCaptureButton, {
|
|
2877
|
-
ref: manualCaptureRef,
|
|
2878
|
-
onClick: () => {
|
|
2879
|
-
setIsManualCapturing(true);
|
|
2880
|
-
manager.capture();
|
|
2881
|
-
},
|
|
2882
|
-
disabled: isManualCapturing
|
|
2883
|
-
}) : null
|
|
2884
|
-
]
|
|
2885
|
-
}),
|
|
2886
|
-
uploadError ? /* @__PURE__ */ u(ErrorModal, {
|
|
2887
|
-
error: uploadError,
|
|
2888
|
-
attemptsRemaining,
|
|
2889
|
-
onTryAgain: () => {
|
|
2890
|
-
manager.retryCapture();
|
|
2891
|
-
setIsManualCapturing(false);
|
|
2892
|
-
}
|
|
2893
|
-
}) : null
|
|
2894
|
-
]
|
|
2895
|
-
});
|
|
2896
|
-
}
|
|
2897
|
-
if (captureStatus === "capturing") return /* @__PURE__ */ u(Page, {
|
|
2898
|
-
className: "IncodeCaptureCapturingPage",
|
|
2899
|
-
title: "Capturing",
|
|
2900
|
-
subtitle: "Taking photo...",
|
|
2901
|
-
children: /* @__PURE__ */ u("div", {
|
|
2902
|
-
class: "IncodeCaptureCapturingActions",
|
|
2903
|
-
children: /* @__PURE__ */ u(Button, {
|
|
2904
|
-
isLoading: true,
|
|
2905
|
-
children: "Capturing..."
|
|
2906
|
-
})
|
|
2907
|
-
})
|
|
2908
|
-
});
|
|
2909
|
-
if (captureStatus === "uploading") return /* @__PURE__ */ u(CaptureStatusPage, {
|
|
2910
|
-
className: "IncodeCaptureStatusUploading",
|
|
2911
|
-
isLoading: true,
|
|
2912
|
-
icon: /* @__PURE__ */ u(LoadingIcon, { size: 64 }),
|
|
2913
|
-
title: t(ageAssurance ? "idv2.capture.processing.verifying" : "idv2.capture.processing.uploading")
|
|
2914
|
-
});
|
|
2915
|
-
if (captureStatus === "uploadError") return /* @__PURE__ */ u(ErrorModal, {
|
|
2916
|
-
error: uploadError,
|
|
2917
|
-
attemptsRemaining,
|
|
2918
|
-
onTryAgain: () => {
|
|
2919
|
-
manager.retryCapture();
|
|
2920
|
-
setIsManualCapturing(false);
|
|
2921
|
-
}
|
|
2922
|
-
});
|
|
2923
|
-
if (captureStatus === "success") return /* @__PURE__ */ u(CaptureStatusPage, {
|
|
2924
|
-
icon: /* @__PURE__ */ u(SuccessIcon, { size: 64 }),
|
|
2925
|
-
title: t("idv2.capture.processing.success")
|
|
2926
|
-
});
|
|
2927
|
-
return null;
|
|
2928
|
-
};
|
|
2929
|
-
var Video = ({ stream, mirrored }) => {
|
|
2930
|
-
const ref = A(null);
|
|
2931
|
-
y(() => {
|
|
2932
|
-
if (ref.current && stream) ref.current.srcObject = stream;
|
|
2933
|
-
}, [stream]);
|
|
2934
|
-
return /* @__PURE__ */ u("video", {
|
|
2935
|
-
ref,
|
|
2936
|
-
autoplay: true,
|
|
2937
|
-
playsInline: true,
|
|
2938
|
-
muted: true,
|
|
2939
|
-
"aria-hidden": "true",
|
|
2940
|
-
class: mirrored ? "IncodeCaptureVideoElement IncodeCaptureVideoMirrored" : "IncodeCaptureVideoElement"
|
|
2941
|
-
});
|
|
2942
|
-
};
|
|
2943
|
-
//#endregion
|
|
2944
|
-
//#region src/modules/selfie/tutorial.tsx
|
|
2945
|
-
var Tutorial = ({ manager, ageAssurance = false }) => {
|
|
2946
|
-
const { t } = useTranslation();
|
|
2947
|
-
const [isLoading, setIsLoading] = d(false);
|
|
2948
|
-
const [animationData, setAnimationData] = d(null);
|
|
2949
|
-
y(() => {
|
|
2950
|
-
import("./selfieTutorial-CYa8bq6B.js").then((module) => {
|
|
2951
|
-
setAnimationData(module.default);
|
|
2952
|
-
});
|
|
2953
|
-
}, []);
|
|
2954
|
-
const handleContinue = async () => {
|
|
2955
|
-
setIsLoading(true);
|
|
2956
|
-
await manager.nextStep();
|
|
2957
|
-
};
|
|
2958
|
-
return /* @__PURE__ */ u(BaseTutorial, {
|
|
2959
|
-
animationData,
|
|
2960
|
-
title: t(ageAssurance ? "face.tutorial.ageAssuranceTitle" : "face.tutorial.title"),
|
|
2961
|
-
titleId: "face-tutorial-heading",
|
|
2962
|
-
subtitle: t(ageAssurance ? "face.tutorial.ageAssuranceSubtitle" : "face.tutorial.subtitle"),
|
|
2963
|
-
onContinue: handleContinue,
|
|
2964
|
-
buttonText: t(ageAssurance ? "face.tutorial.ageAssuranceStartCapture" : "face.tutorial.startCapture"),
|
|
2965
|
-
disclaimerText: t("face.tutorial.autoCapture"),
|
|
2966
|
-
isLoading,
|
|
2967
|
-
className: "IncodeSelfieTutorial"
|
|
2968
|
-
});
|
|
2969
|
-
};
|
|
2970
|
-
//#endregion
|
|
2971
|
-
export { Lottie as a, BaseTutorial as i, Capture as n, ErrorContent as o, Permissions as r, Tutorial as t };
|
|
2285
|
+
export { Permissions as i, LoadingBorder as n, FaceOutline as r, Notification as t };
|