@incodetech/web 2.1.1 → 2.2.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ae-signature/ae-signature.es.js +7 -4
- package/dist/antifraud/antifraud.es.js +6 -6
- package/dist/authentication/authentication.es.js +7 -7
- package/dist/{autoFocusTitle-CuRu2lPg.js → autoFocusTitle-gLba2mgp.js} +6 -3
- package/dist/{back-horizontal-hint-xTnSQbzn.js → back-horizontal-hint-BBGuJ75y.js} +1 -1
- package/dist/{back-vertical-hint-BWWlHfX2.js → back-vertical-hint-B9usJ5lY.js} +1 -1
- package/dist/base.css +425 -3290
- package/dist/{bottomSheet-CnWbbUAM.js → bottomSheet-Cp8DLulN.js} +7 -8
- package/dist/certificate-issuance/certificate-issuance.es.js +34 -87
- package/dist/certificate-issuance/styles.css +0 -41
- package/dist/{checkbox-1wUHSoaK.js → checkbox-C38Elx0O.js} +5 -5
- package/dist/connectionError-DAeXp8sE.js +45 -0
- package/dist/consent/consent.es.js +10 -12
- package/dist/consent/styles.css +5 -4
- package/dist/{countrySelector-SvUOyPo0.js → countrySelector-2t-ZTgGo.js} +3 -3
- package/dist/cross-document-data-match/cross-document-data-match.es.js +13 -10
- package/dist/curp-validation/curp-validation.es.js +28 -29
- package/dist/curp-validation/styles.css +47 -0
- package/dist/{customFields-BDsXR7A-.js → customFields-B8HQZ7Mh.js} +13 -14
- package/dist/{customWatchlist-CYoRNCim.js → customWatchlist-_tUmZ855.js} +9 -9
- package/dist/dashboardTheme-CVliZSR-.js +223 -0
- package/dist/{dateInputComposed-DuaofcBl.js → dateInputComposed-eRcbt_SL.js} +5 -5
- package/dist/dateInputComposed-ks0-opuq.js +1 -0
- package/dist/document-capture/document-capture.es.js +1 -1
- package/dist/document-capture/styles.css +85 -70
- package/dist/{documentCapture-DhbO-A-V.js → documentCapture-BvEGCYj-.js} +218 -136
- package/dist/documentCapture-DdHdRPzR.js +2 -0
- package/dist/{dropdownComposed-CoU0enG6.js → dropdownComposed-OHDHzt1Q.js} +18 -11
- package/dist/dropdownComposed-kjG4UblM.js +1 -0
- package/dist/dynamic-forms/styles.css +58 -6
- package/dist/{dynamicForms-BifGbC9F.js → dynamicForms-P-4E42IA.js} +53 -45
- package/dist/ekyb/ekyb.es.js +1 -1
- package/dist/ekyb/styles.css +1 -28
- package/dist/ekybModule-CiaxFHXo.js +2 -0
- package/dist/{ekybModule-DGnTw5UV.js → ekybModule-DmjkzVWE.js} +51 -27
- package/dist/ekyc/ekyc.es.js +1 -1
- package/dist/ekyc/styles.css +2 -2
- package/dist/ekycModule-BVt10kgv.js +2 -0
- package/dist/{ekycModule-Dxpdd0ns.js → ekycModule-Da1Fm7ai.js} +45 -19
- package/dist/electronic-signature/electronic-signature.es.js +1 -1
- package/dist/{ae-signature → electronic-signature}/styles.css +2 -2
- package/dist/{electronic-signature-Ueoffasr.js → electronic-signature-yamI6zHM.js} +31 -23
- package/dist/email/email.es.js +10 -11
- package/dist/{emailInput-DsLkDtER.js → emailInput-B0P2Q-pk.js} +4 -4
- package/dist/{expiredId-BZXLrLk-.js → expiredId-BXXE3srN.js} +6 -6
- package/dist/{extensibility-7sRIN0JC.js → extensibility-iJYzpW6H.js} +440 -374
- package/dist/extensibility.es.js +24 -28
- package/dist/face-match/face-match.es.js +1 -1
- package/dist/face-match/styles.css +9 -609
- package/dist/faceMatch-D4XFihTc.js +2 -0
- package/dist/{faceMatch-DyTBoMDm.js → faceMatch-VtEZvsen.js} +71 -79
- package/dist/field-comparison/field-comparison.es.js +1 -1
- package/dist/fieldComparison-B_r9Bal7.js +2 -0
- package/dist/{fieldComparison-L_knHqgw.js → fieldComparison-NLdDSOEh.js} +11 -12
- package/dist/finalSuccessScreen-DryADx1n.js +500 -0
- package/dist/fiscal-qr/fiscal-qr.es.js +12 -12
- package/dist/flip-animation-CvN8FLNc.js +6996 -0
- package/dist/flow/flow.es.js +81 -45
- package/dist/flow/styles.css +908 -5423
- package/dist/{front-horizontal-hint-B84GgTO1.js → front-horizontal-hint-D3CrWViZ.js} +1 -1
- package/dist/{front-vertical-hint-Bs_avngq.js → front-vertical-hint-BoLZvyx5.js} +1 -1
- package/dist/geolocation/geolocation.es.js +36 -13
- package/dist/geolocation/styles.css +1 -1
- package/dist/government-validation/government-validation.es.js +11 -12
- package/dist/{homeScreen-B6T0JVh8.js → homeScreen-Pv3v_0ji.js} +7 -9
- package/dist/{icons-CJJbIpBq.js → icons--ezYG2Fb.js} +92 -7
- package/dist/id/id.es.js +222 -52
- package/dist/id/styles.css +290 -10
- package/dist/id-back-of-card-DO593HH8.js +83 -0
- package/dist/id-back-of-card-vertical-DArEQ0hE.js +88 -0
- package/dist/id-front-of-card-Bcit7Pnq.js +308 -0
- package/dist/id-front-of-card-vertical-Bcr-KXcl.js +278 -0
- package/dist/id-laser-h-BaUHzX-d.js +480 -0
- package/dist/{id-laser-v-BiUXkM4x.js → id-laser-v-Dv9yEYJE.js} +7 -17
- package/dist/id-selfie-flow/id-selfie-flow.es.js +239 -0
- package/dist/id-selfie-flow/styles.css +749 -0
- package/dist/id-verification/id-verification.es.js +13 -9
- package/dist/{idOcr-WFBvqy3b.js → idOcr-gsIXHq6R.js} +14 -15
- package/dist/identity-reuse/identity-reuse.es.js +6 -8
- package/dist/identity-reuse/styles.css +1 -1
- package/dist/{incode-logo-57XFniXU.js → incode-logo-rGFjZHqi.js} +64 -1
- package/dist/incodeComponent-K9ZWg302.js +713 -0
- package/dist/incodeModule-CcLzar_X.js +25 -0
- package/dist/index.es.js +16 -5
- package/dist/{inputComposed-C1R2LAa3.js → inputComposed-BeROn635.js} +9 -9
- package/dist/inputComposed-CADVQW-o.js +1 -0
- package/dist/{mandatoryConsent-D0GTKu-H.js → mandatoryConsent-BtqB-FxY.js} +9 -11
- package/dist/{capture-CkGvdDNH.js → manualCaptureButton-quGa2ufS.js} +68 -198
- package/dist/manualCaptureButton-t_oIol88.js +300 -0
- package/dist/{modal-OxkFuuiR.js → modal-BjjJFpZu.js} +4 -4
- package/dist/{modal.hooks-ZrzmHAUa.js → modal.hooks-BvXzNWvY.js} +1 -1
- package/dist/{numberedStep-CEb-lFJm.js → numberedStep-DUs77Gy3.js} +1 -1
- package/dist/{optionAccessibleLabel-gfF-58Mv.js → optionAccessibleLabel-DgfHD_mx.js} +6 -6
- package/dist/{otpInput-CnDc6pQm.js → otpInput-D5dLXrmC.js} +72 -36
- package/dist/{passport-horizontal-hint-Bj0ZJY0g.js → passport-horizontal-hint-DgnU-8bl.js} +1 -1
- package/dist/{passport-vertical-hint-Dfk77xUJ.js → passport-vertical-hint-Dd2Wknw7.js} +1 -1
- package/dist/{pdf-BqtJTlor.js → pdf-BUoY_2gv.js} +1 -1
- package/dist/pdfViewer-CZb6obcZ.js +2 -0
- package/dist/{pdfViewer-B97DmT9m.js → pdfViewer-vud1VZv6.js} +5 -7
- package/dist/phone/phone.es.js +13 -12
- package/dist/{phoneInputComposed-DMiXfF-1.js → phoneInputComposed-CeVWTS_O.js} +7 -6
- package/dist/{processing-BeUMfdJJ.js → processing-BsvHyDWa.js} +2 -2
- package/dist/qe-signature/qe-signature.es.js +7 -4
- package/dist/{radioGroupComposed-DuQxslB2.js → radioGroupComposed-DzNGUbZQ.js} +16 -15
- package/dist/redirect-to-mobile/redirect-to-mobile.es.js +132 -45
- package/dist/redirect-to-mobile/styles.css +20 -10
- package/dist/{registerIncodeElement-DaNjbAwZ.js → registerIncodeElement-BduCekz5.js} +1 -1
- package/dist/{richText-CB1fmegc.js → richText-CTHBpZOw.js} +3 -1607
- package/dist/selfie/selfie.es.js +10 -10
- package/dist/selfie/styles.css +16 -949
- package/dist/signature/signature.es.js +27 -19
- package/dist/{ae-signature/styles2.css → signature/styles.css} +4 -4
- package/dist/{snackbar-DS7Mv62v.js → snackbar-C9Mqrh0e.js} +2 -2
- package/dist/spacer-CDlQd12V.js +2344 -0
- package/dist/{spinner-BMeIEK1d.js → spinner-CLZ2fz4u.js} +45 -4
- package/dist/statusPage--GVFSUJp.js +36 -0
- package/dist/{successIcon-B5mGvdx1.js → successIcon-Bj8Y9CuI.js} +1 -1
- package/dist/{tabs-C__chW-u.js → tabs-DweBZTV2.js} +4 -3
- package/dist/themes/dark.css +35 -0
- package/dist/themes/light.css +35 -0
- package/dist/{tutorial-CCfPuVKX.js → tutorial-BZZC93Ur.js} +222 -180
- package/dist/types/ae-signature.d.ts +91 -5
- package/dist/types/antifraud.d.ts +86 -3
- package/dist/types/authentication.d.ts +86 -3
- package/dist/types/certificate-issuance.d.ts +86 -3
- package/dist/types/consent.d.ts +86 -3
- package/dist/types/cross-document-data-match.d.ts +88 -4
- package/dist/types/curp-validation.d.ts +86 -3
- package/dist/types/document-capture.d.ts +88 -4
- package/dist/types/ekyb.d.ts +88 -4
- package/dist/types/ekyc.d.ts +88 -4
- package/dist/types/electronic-signature.d.ts +87 -4
- package/dist/types/email.d.ts +82 -22
- package/dist/types/extensibility.d.ts +157 -5
- package/dist/types/face-match.d.ts +84 -22
- package/dist/types/field-comparison.d.ts +86 -3
- package/dist/types/fiscal-qr.d.ts +89 -5
- package/dist/types/flow.d.ts +92 -2
- package/dist/types/geolocation.d.ts +86 -3
- package/dist/types/government-validation.d.ts +86 -3
- package/dist/types/id-selfie-flow.d.ts +161 -0
- package/dist/types/id-verification.d.ts +87 -4
- package/dist/types/id.d.ts +88 -5
- package/dist/types/identity-reuse.d.ts +82 -2
- package/dist/types/index.d.ts +106 -1
- package/dist/types/phone.d.ts +83 -24
- package/dist/types/qe-signature.d.ts +91 -5
- package/dist/types/redirect-to-mobile.d.ts +4 -1
- package/dist/types/selfie.d.ts +86 -3
- package/dist/types/signature.d.ts +91 -5
- package/dist/types/video-selfie.d.ts +83 -6
- package/dist/types/watchlist.d.ts +91 -5
- package/dist/types/workflow.d.ts +85 -2
- package/dist/{i18n-CU4xq8qC.js → uiConfig-B5ASPUL4.js} +26 -3
- package/dist/{useModuleLoader-Bi26kJbg.js → useModuleLoader-D_YpuVsS.js} +37 -248
- package/dist/{vendor-preact-DThS2ZQ_.js → vendor-preact-mvwZ8mJj.js} +1 -1
- package/dist/{verificationResult-BWWkmeiA.js → verificationResult-B8HwR07t.js} +26 -15
- package/dist/video-selfie/styles.css +349 -1202
- package/dist/video-selfie/video-selfie.es.js +120 -381
- package/dist/watchlist/watchlist.es.js +16 -13
- package/dist/{watchlistForBusiness-D2Uo_TwF.js → watchlistForBusiness-D8Is99bZ.js} +12 -13
- package/dist/workflow/styles.css +501 -3977
- package/dist/workflow/workflow.es.js +25 -18
- package/package.json +22 -20
- package/dist/button-Dz6AsbmF.js +0 -40
- package/dist/cameraView-DIEzM5ru.js +0 -47
- package/dist/cpf-ocr/cpf-ocr.es.js +0 -2
- package/dist/cpf-ocr/styles.css +0 -45
- package/dist/cpfOcr-B79245-3.js +0 -2
- package/dist/cpfOcr-BhxT-lRN.js +0 -92
- package/dist/dateInputComposed-DRzZi6uy.js +0 -1
- package/dist/documentCapture-DXYYyxZl.js +0 -2
- package/dist/dropdownComposed-BAoxIIsE.js +0 -1
- package/dist/ekybModule-C6Nttked.js +0 -2
- package/dist/ekycModule-CDIEjI6V.js +0 -2
- package/dist/errorIcon-BA4T6iy-.js +0 -26
- package/dist/faceMatch-B_HvxLm_.js +0 -2
- package/dist/fieldComparison-DfNEuEE5.js +0 -2
- package/dist/flip-animation-CZYSUtMm.js +0 -6983
- package/dist/hooks-CNu7o-v8.js +0 -186
- package/dist/id-laser-h-CzPegPMn.js +0 -467
- package/dist/incodeComponent-CfzJGETt.js +0 -64
- package/dist/incodeModule-B-4_3JrK.js +0 -13
- package/dist/inputComposed-BaY5q9WM.js +0 -1
- package/dist/loadingIcon-B0ysgiNq.js +0 -148
- package/dist/page-DidH_RkX.js +0 -171
- package/dist/spinner-BCDCoi9C.js +0 -1
- package/dist/statusPage-Bk8nJwXV.js +0 -28
- package/dist/transitionSpinner-CuNCqHNi.js +0 -30
- package/dist/types/cpf-ocr.d.ts +0 -12
- package/dist/typography-BZIpjo97.js +0 -45
- package/dist/uiConfig-D2_wawvr.js +0 -25
- /package/dist/{aligndevicelottie-DFscByAI.js → aligndevicelottie-CfoZ5Uus.js} +0 -0
- /package/dist/{back-tutorial-cI_4VHmE.js → back-tutorial-BHyRHyET.js} +0 -0
- /package/dist/{backdevicelottie-COyhTrxM.js → backdevicelottie-yKkczgFy.js} +0 -0
- /package/dist/{blurdevicelottie-BLVeJHEG.js → blurdevicelottie-8BbophdM.js} +0 -0
- /package/dist/{browser-ponyfill-Df13Th-G.js → browser-ponyfill-CBjGwwPW.js} +0 -0
- /package/dist/{defineProperty-Qjefk7Uf.js → defineProperty-BbpBna-2.js} +0 -0
- /package/dist/{frontdevicelottie-B4tE2PYQ.js → frontdevicelottie-CFcahVLk.js} +0 -0
- /package/dist/{glaredevicelottie-D1pR73sx.js → glaredevicelottie-Cnvah0kz.js} +0 -0
- /package/dist/{id-tutorial-DwO90SAm.js → id-tutorial-BOOsXlAJ.js} +0 -0
- /package/dist/{lottie_light-C6B2ec41.js → lottie_light-Bv56F2Ae.js} +0 -0
- /package/dist/{passport-tutorial-D9JNsMsM.js → passport-tutorial-CeSup6m9.js} +0 -0
- /package/dist/{requiredLabelHint-D0RhuMed.js → requiredLabelHint-Dx0WS2cR.js} +0 -0
- /package/dist/{selfieTutorial-pB-N-fj5.js → selfieTutorial-CYa8bq6B.js} +0 -0
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import { i as useTranslation } from "../uiConfig-B5ASPUL4.js";
|
|
2
|
+
import { _ as y, d as T, p as d, v as u } from "../vendor-preact-mvwZ8mJj.js";
|
|
3
|
+
import { _ as useModuleTerminalCallbacks, a as TerminalErrorPage, l as TransitionSpinner, o as Page, t as IncodeComponent, y as useManager } from "../incodeComponent-K9ZWg302.js";
|
|
4
|
+
import { n as Title } from "../spinner-CLZ2fz4u.js";
|
|
5
|
+
import { a as CameraView, r as preloadCaptureAnimations } from "../manualCaptureButton-t_oIol88.js";
|
|
6
|
+
import { n as Permissions } from "../manualCaptureButton-quGa2ufS.js";
|
|
7
|
+
import { t as registerIncodeModuleElement } from "../incodeModule-CcLzar_X.js";
|
|
8
|
+
import { a as IdFlipModal, c as VideoSelfieTutorial, i as IdMask, l as useVideoSelfiePermissions, n as SwitchingCameraScreen, o as preloadIdFlipAnimation, r as StepsHeader, s as SelfieMask, t as VideoSelfieFinalSuccessScreen } from "../finalSuccessScreen-DryADx1n.js";
|
|
9
|
+
import { createIdSelfieFlowManager, resolveIdSelfieFlowConfig, warmupIdSelfieFlowWasm } from "@incodetech/core/id-selfie-flow";
|
|
10
|
+
import { facingModeForStep } from "@incodetech/core/video-selfie";
|
|
11
|
+
//#region src/modules/id-selfie-flow/id-selfie-flow.tsx
|
|
12
|
+
/**
|
|
13
|
+
* @module @incodetech/web/id-selfie-flow
|
|
14
|
+
*
|
|
15
|
+
* ID + Selfie flow UI (PoC) — the REGULAR onboarding capture pipeline (ID
|
|
16
|
+
* front/back → `process/id`, selfie → `process/face`) presented through the
|
|
17
|
+
* Video Selfie continuous-camera UX: one session stream that follows the
|
|
18
|
+
* camera between steps and is never interrupted. Nothing is recorded and no
|
|
19
|
+
* microphone access is requested.
|
|
20
|
+
*
|
|
21
|
+
* @example Web Component usage
|
|
22
|
+
* ```html
|
|
23
|
+
* <script type="module">
|
|
24
|
+
* import '@incodetech/web/id-selfie-flow';
|
|
25
|
+
* import { setup } from '@incodetech/core';
|
|
26
|
+
* setup({ apiURL: 'https://api.example.com', token: 'your-token' });
|
|
27
|
+
* const el = document.querySelector('incode-id-selfie-flow');
|
|
28
|
+
* el.config = {};
|
|
29
|
+
* el.onFinish = () => console.log('done');
|
|
30
|
+
* <\/script>
|
|
31
|
+
* <incode-id-selfie-flow></incode-id-selfie-flow>
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @see {@link createIdSelfieFlowManager} for headless usage.
|
|
35
|
+
*/
|
|
36
|
+
var DEFAULT_STEPS = [
|
|
37
|
+
"frontId",
|
|
38
|
+
"backId",
|
|
39
|
+
"selfie"
|
|
40
|
+
];
|
|
41
|
+
/**
|
|
42
|
+
* Maps the live detection feedback to the selfie mask's visual state (same
|
|
43
|
+
* mapping as the Video Selfie module).
|
|
44
|
+
*/
|
|
45
|
+
var getSelfieVariant = (detectionStatus) => {
|
|
46
|
+
switch (detectionStatus) {
|
|
47
|
+
case "success": return "success";
|
|
48
|
+
case "error": return "error";
|
|
49
|
+
case "capturing": return "processing";
|
|
50
|
+
default: return "idle";
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
/** Full-screen spinner while `process/id` validates the captured document. */
|
|
54
|
+
var ProcessingIdScreen = () => {
|
|
55
|
+
const { t } = useTranslation();
|
|
56
|
+
return /* @__PURE__ */ u(Page, {
|
|
57
|
+
hideHeader: true,
|
|
58
|
+
children: /* @__PURE__ */ u(TransitionSpinner, { spinnerConfig: { title: t("common.processing") } })
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
var IdSelfieFlowContent = ({ config, onFinish, onError }) => {
|
|
62
|
+
const { t } = useTranslation();
|
|
63
|
+
const [state, manager] = useManager(() => createIdSelfieFlowManager({ config }), { autoLoad: false });
|
|
64
|
+
const [phase, setPhase] = d(config?.showTutorials ? "tutorial" : "permissions");
|
|
65
|
+
const { permissionStatus, manager: permissionsManager } = useVideoSelfiePermissions({
|
|
66
|
+
enabled: phase === "permissions",
|
|
67
|
+
onGranted: () => setPhase("capture"),
|
|
68
|
+
onClose: () => onError?.(void 0),
|
|
69
|
+
requestAudio: false
|
|
70
|
+
});
|
|
71
|
+
const steps = T(() => config?.steps ?? DEFAULT_STEPS, [config]);
|
|
72
|
+
const hasIdSteps = steps.includes("frontId") || steps.includes("backId");
|
|
73
|
+
y(() => {
|
|
74
|
+
if ((phase === "tutorial" || phase === "permissions") && config) {
|
|
75
|
+
warmupIdSelfieFlowWasm(config);
|
|
76
|
+
if (hasIdSteps) {
|
|
77
|
+
preloadCaptureAnimations();
|
|
78
|
+
preloadIdFlipAnimation();
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}, [
|
|
82
|
+
phase,
|
|
83
|
+
config,
|
|
84
|
+
hasIdSteps
|
|
85
|
+
]);
|
|
86
|
+
y(() => {
|
|
87
|
+
if (phase !== "capture") return;
|
|
88
|
+
manager.start();
|
|
89
|
+
}, [manager, phase]);
|
|
90
|
+
useModuleTerminalCallbacks({
|
|
91
|
+
status: state.status,
|
|
92
|
+
onFinish: () => onFinish?.(state.finishStatus)
|
|
93
|
+
});
|
|
94
|
+
const step = state.step ?? "selfie";
|
|
95
|
+
if (phase === "tutorial") return /* @__PURE__ */ u(VideoSelfieTutorial, {
|
|
96
|
+
steps,
|
|
97
|
+
copy: {
|
|
98
|
+
title: "Verify your identity",
|
|
99
|
+
subtitle: "You'll be requested to:",
|
|
100
|
+
permissionsLabel: "Allow camera access",
|
|
101
|
+
startLabel: "Start verification"
|
|
102
|
+
},
|
|
103
|
+
onStart: () => setPhase("permissions")
|
|
104
|
+
});
|
|
105
|
+
if (phase === "permissions") return /* @__PURE__ */ u(Permissions, {
|
|
106
|
+
manager: permissionsManager,
|
|
107
|
+
permissionStatus
|
|
108
|
+
});
|
|
109
|
+
if (state.status === "finished" || state.status === "closed") return null;
|
|
110
|
+
if (state.status === "error") return /* @__PURE__ */ u(TerminalErrorPage, {
|
|
111
|
+
message: state.error,
|
|
112
|
+
onRetry: () => manager.retry()
|
|
113
|
+
});
|
|
114
|
+
if (state.status === "processingId" || state.status === "finishing") return /* @__PURE__ */ u(ProcessingIdScreen, {});
|
|
115
|
+
if (state.status === "success") return /* @__PURE__ */ u(VideoSelfieFinalSuccessScreen, {});
|
|
116
|
+
if (state.status === "switchingCamera") return /* @__PURE__ */ u(SwitchingCameraScreen, {
|
|
117
|
+
steps,
|
|
118
|
+
currentIndex: state.stepIndex,
|
|
119
|
+
facing: facingModeForStep(state.step ?? "selfie")
|
|
120
|
+
});
|
|
121
|
+
const isFrontCamera = facingModeForStep(step) === "user";
|
|
122
|
+
const detectionStatus = state.detectionStatus;
|
|
123
|
+
const idMode = step === "backId" ? "back" : "front";
|
|
124
|
+
const stepLabel = t(`videoSelfie.step.${step}`);
|
|
125
|
+
const selfieMessage = () => {
|
|
126
|
+
if (detectionStatus === "success") return t("videoSelfie.lookingGood");
|
|
127
|
+
if (detectionStatus === "capturing") return t("common.processing");
|
|
128
|
+
if (detectionStatus === "error") return t("common.tryAgain");
|
|
129
|
+
switch (detectionStatus) {
|
|
130
|
+
case "tooFar": return t("notifications.moveCloser");
|
|
131
|
+
case "tooClose": return t("notifications.moveAway");
|
|
132
|
+
case "blur": return t("notifications.onBlur");
|
|
133
|
+
case "faceMask": return t("notifications.mask");
|
|
134
|
+
case "lenses": return t("notifications.removeLenses");
|
|
135
|
+
case "eyesClosed": return t("notifications.eyesClosed");
|
|
136
|
+
case "headWear": return t("notifications.removeHeadwear");
|
|
137
|
+
default: return t("videoSelfie.lookCamera");
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
const idValidationMessage = () => {
|
|
141
|
+
switch (state.validationFailure) {
|
|
142
|
+
case "idTypeMismatch": return t("videoSelfie.idValidation.idTypeMismatch");
|
|
143
|
+
case "idScanFailed": return t("notifications.compareID.scanFailed");
|
|
144
|
+
default: return t("common.tryAgain");
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
const idFeedback = () => {
|
|
148
|
+
if (state.status === "validationFeedback" && state.validationFailure !== "selfieVerificationFailed") return {
|
|
149
|
+
variant: "error",
|
|
150
|
+
message: idValidationMessage()
|
|
151
|
+
};
|
|
152
|
+
if (detectionStatus === "capturing") return {
|
|
153
|
+
variant: "processing",
|
|
154
|
+
message: t("videoSelfie.processingStep")
|
|
155
|
+
};
|
|
156
|
+
if (detectionStatus === "success") return {
|
|
157
|
+
variant: "success",
|
|
158
|
+
message: t("videoSelfie.allGood")
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
const renderStepUi = () => {
|
|
162
|
+
if (state.status === "flippingId") return /* @__PURE__ */ u(IdFlipModal, { onComplete: () => manager.nextStep() });
|
|
163
|
+
return isFrontCamera ? /* @__PURE__ */ u(SelfieMask, {
|
|
164
|
+
variant: getSelfieVariant(detectionStatus),
|
|
165
|
+
message: selfieMessage(),
|
|
166
|
+
onManualCapture: state.manualCaptureAvailable ? () => manager.manualCapture() : void 0
|
|
167
|
+
}) : /* @__PURE__ */ u(IdMask, {
|
|
168
|
+
mode: idMode,
|
|
169
|
+
wrongSide: detectionStatus === "wrongSide",
|
|
170
|
+
feedback: idFeedback(),
|
|
171
|
+
orientation: state.orientation ?? "horizontal",
|
|
172
|
+
onManualCapture: state.manualCaptureAvailable ? () => manager.manualCapture() : void 0
|
|
173
|
+
});
|
|
174
|
+
};
|
|
175
|
+
return /* @__PURE__ */ u(Page, {
|
|
176
|
+
hideHeader: true,
|
|
177
|
+
hideFooterBranding: true,
|
|
178
|
+
className: "IncodeVideoSelfieCapturePage",
|
|
179
|
+
children: [/* @__PURE__ */ u(Title, {
|
|
180
|
+
className: "IncodeCaptureVisuallyHidden",
|
|
181
|
+
children: stepLabel
|
|
182
|
+
}), /* @__PURE__ */ u(CameraView, {
|
|
183
|
+
stream: state.stream,
|
|
184
|
+
mirrored: isFrontCamera,
|
|
185
|
+
children: /* @__PURE__ */ u("div", {
|
|
186
|
+
class: "IncodeVideoSelfieOverlay",
|
|
187
|
+
children: [/* @__PURE__ */ u(StepsHeader, {
|
|
188
|
+
steps,
|
|
189
|
+
currentIndex: state.stepIndex
|
|
190
|
+
}), renderStepUi()]
|
|
191
|
+
})
|
|
192
|
+
})]
|
|
193
|
+
});
|
|
194
|
+
};
|
|
195
|
+
/**
|
|
196
|
+
* ID + Selfie flow UI component (PoC). Runs the regular ID + selfie capture
|
|
197
|
+
* pipeline behind the Video Selfie continuous-camera UX.
|
|
198
|
+
*
|
|
199
|
+
* Config is resolved from the active session's FLOW configuration (the same
|
|
200
|
+
* dashboard config the regular ID and SELFIE modules read — steps, attempts,
|
|
201
|
+
* tutorial, selfie validations); any `config` prop values win over the
|
|
202
|
+
* flow-derived ones.
|
|
203
|
+
*
|
|
204
|
+
* @see {@link createIdSelfieFlowManager} for headless usage.
|
|
205
|
+
*/
|
|
206
|
+
var IdSelfieFlow = ({ config, onFinish, onError }) => {
|
|
207
|
+
const [resolved, setResolved] = d({ status: "loading" });
|
|
208
|
+
y(() => {
|
|
209
|
+
const abortController = new AbortController();
|
|
210
|
+
setResolved({ status: "loading" });
|
|
211
|
+
resolveIdSelfieFlowConfig({
|
|
212
|
+
config,
|
|
213
|
+
signal: abortController.signal
|
|
214
|
+
}).then((resolvedConfig) => {
|
|
215
|
+
if (!abortController.signal.aborted) setResolved({
|
|
216
|
+
status: "ready",
|
|
217
|
+
config: resolvedConfig
|
|
218
|
+
});
|
|
219
|
+
}).catch((error) => {
|
|
220
|
+
if (!abortController.signal.aborted) setResolved({
|
|
221
|
+
status: "error",
|
|
222
|
+
error: String(error)
|
|
223
|
+
});
|
|
224
|
+
});
|
|
225
|
+
return () => abortController.abort();
|
|
226
|
+
}, [config]);
|
|
227
|
+
return /* @__PURE__ */ u(IncodeComponent, { children: [
|
|
228
|
+
resolved.status === "loading" && /* @__PURE__ */ u(TransitionSpinner, {}),
|
|
229
|
+
resolved.status === "error" && /* @__PURE__ */ u(TerminalErrorPage, { message: resolved.error }),
|
|
230
|
+
resolved.status === "ready" && /* @__PURE__ */ u(IdSelfieFlowContent, {
|
|
231
|
+
config: resolved.config,
|
|
232
|
+
onFinish,
|
|
233
|
+
onError
|
|
234
|
+
})
|
|
235
|
+
] });
|
|
236
|
+
};
|
|
237
|
+
registerIncodeModuleElement(IdSelfieFlow, "incode-id-selfie-flow");
|
|
238
|
+
//#endregion
|
|
239
|
+
export { IdSelfieFlow };
|