@incodetech/web 2.0.1-rc.0 → 2.1.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 +15 -13
- package/dist/ae-signature/styles.css +3 -17
- package/dist/ae-signature/styles2.css +15 -5
- package/dist/aligndevicelottie-DY_bX_p8.js +12769 -0
- package/dist/antifraud/antifraud.es.js +23 -16
- package/dist/authentication/authentication.es.js +42 -27
- package/dist/autoFocusTitle-BzkUiELM.js +29 -0
- package/dist/{back-horizontal-hint-B8Brxh3U.js → back-horizontal-hint-D_8LptLm.js} +26 -26
- package/dist/back-tutorial-vb1MxlrT.js +14597 -0
- package/dist/{back-vertical-hint-BBo36dxn.js → back-vertical-hint-C1evxxq2.js} +27 -27
- package/dist/backdevicelottie-HypPqBz7.js +16690 -0
- package/dist/base.css +1258 -104
- package/dist/blurdevicelottie-CBXtBFiJ.js +15951 -0
- package/dist/bottomSheet-F1GJfQx_.js +39 -0
- package/dist/browser-ponyfill-CLLvZCVg.js +441 -0
- package/dist/button-CM_hgyIP.js +35 -0
- package/dist/checkbox-BoeLHKgp.js +96 -0
- package/dist/consent/consent.es.js +89 -73
- package/dist/consent/styles.css +35 -22
- package/dist/countrySelector-mSWyHSy4.js +60 -0
- package/dist/cpf-ocr/cpf-ocr.es.js +2 -0
- package/dist/cpfOcr-MtpRztkG.js +92 -0
- package/dist/cpfOcr-jJkYCfsX.js +2 -0
- package/dist/cross-document-data-match/cross-document-data-match.es.js +20 -16
- package/dist/curp-validation/curp-validation.es.js +247 -203
- package/dist/customFields-DXXt9HGM.js +140 -0
- package/dist/customWatchlist-DsW04UF6.js +36 -0
- package/dist/dateInputComposed-C_mh4XBg.js +69 -0
- package/dist/dateInputComposed-Cy6a7ymh.js +1 -0
- package/dist/defineProperty-mefzVtTv.js +39 -0
- package/dist/document-capture/document-capture.es.js +2 -0
- package/dist/document-capture/styles.css +2 -5
- package/dist/documentCapture-8ypBJehw.js +2 -0
- package/dist/documentCapture-BDV_921m.js +880 -0
- package/dist/dropdownComposed-CEWBSdGl.js +1 -0
- package/dist/dropdownComposed-_fgAlo_C.js +380 -0
- package/dist/dynamic-forms/styles.css +25 -13
- package/dist/dynamicForms-DyfnsS7E.js +352 -0
- package/dist/ekyb/ekyb.es.js +2 -2
- package/dist/ekyb/styles.css +2 -0
- package/dist/ekybModule-CIPGmCvD.js +279 -0
- package/dist/ekybModule-DFoYpheB.js +2 -0
- package/dist/ekyc/ekyc.es.js +2 -2
- package/dist/ekyc/styles.css +9 -7
- package/dist/ekycModule-BGzwgjl1.js +2 -0
- package/dist/ekycModule-BuTaC5ct.js +257 -0
- package/dist/electronic-signature/electronic-signature.es.js +2 -2
- package/dist/electronic-signature-B-Q7M0wK.js +430 -0
- package/dist/email/email.es.js +199 -66
- package/dist/emailInput-KZmhjOdZ.js +39 -0
- package/dist/errorIcon-DJRZpd8j.js +26 -0
- package/dist/expiredId-Q1t6aVpk.js +85 -0
- package/dist/extensibility-Cs3KQQdC.js +3070 -0
- package/dist/extensibility.es.js +26 -25
- package/dist/face-match/face-match.es.js +2 -2
- package/dist/face-match/styles.css +0 -4
- package/dist/faceMatch--RDHJe4t.js +343 -0
- package/dist/faceMatch-yEKPYaym.js +2 -0
- package/dist/field-comparison/field-comparison.es.js +2 -0
- package/dist/field-comparison/styles.css +16 -0
- package/dist/fieldComparison-CAF86bTC.js +88 -0
- package/dist/fieldComparison-D0an7T_g.js +2 -0
- package/dist/fiscal-qr/fiscal-qr.es.js +224 -0
- package/dist/fiscal-qr/styles.css +71 -0
- package/dist/{flip-animation-CgwRsEmK.js → flip-animation-BGRvygw9.js} +4221 -4221
- package/dist/flow/flow.es.js +619 -484
- package/dist/flow/styles.css +378 -418
- package/dist/{front-horizontal-hint-DGGGi8e1.js → front-horizontal-hint-Uf5bHCsd.js} +70 -70
- package/dist/{front-vertical-hint-CNr5mE6Q.js → front-vertical-hint-DdWNA45v.js} +81 -81
- package/dist/frontdevicelottie-CLqitJhG.js +17314 -0
- package/dist/geolocation/geolocation.es.js +486 -395
- package/dist/glaredevicelottie-BS04U6Fc.js +14478 -0
- package/dist/governmentValidation/governmentValidation.es.js +166 -93
- package/dist/governmentValidation/styles.css +0 -17
- package/dist/homeScreen-BZnIEDrV.js +264 -0
- package/dist/hooks-Da_yP_Dr.js +149 -0
- package/dist/i18n-CoCO2ZuN.js +2971 -0
- package/dist/icons-Dbs9ZfYM.js +360 -0
- package/dist/id/id.es.js +583 -414
- package/dist/id/styles.css +59 -43
- package/dist/id-laser-h-DX8UbVNH.js +467 -0
- package/dist/id-laser-v-DhnHdjlB.js +490 -0
- package/dist/id-tutorial-lj4iKtYT.js +13165 -0
- package/dist/id-verification/id-verification.es.js +21 -17
- package/dist/idOcr-CjGbb4dB.js +123 -0
- package/dist/identity-reuse/identity-reuse.es.js +311 -182
- package/dist/identity-reuse/styles.css +134 -80
- package/dist/incode-logo-57XFniXU.js +4 -0
- package/dist/incodeComponent-wfnHlnXx.js +63 -0
- package/dist/incodeModule-BUDoTwT9.js +13 -0
- package/dist/index.es.js +16 -13
- package/dist/inputComposed-BEn7_nZd.js +1 -0
- package/dist/inputComposed-CQ4AsvZg.js +99 -0
- package/dist/loadingIcon-B0ysgiNq.js +148 -0
- package/dist/lottie_light-Dp9Bz3mf.js +9031 -0
- package/dist/mandatoryConsent-r0PQHmv-.js +107 -0
- package/dist/modal-nTSaG7nB.js +139 -0
- package/dist/modal.hooks-D2xhIuHA.js +195 -0
- package/dist/numberedStep-CEtwZqLp.js +13 -0
- package/dist/optionAccessibleLabel-CnA-mNAU.js +202 -0
- package/dist/otpInput-_JmtVwa0.js +195 -0
- package/dist/page-DxGQj7Gk.js +71 -0
- package/dist/{passport-horizontal-hint-Bgquwtac.js → passport-horizontal-hint-Bbm2mvSn.js} +55 -55
- package/dist/{passport-tutorial-DwRwtPVX.js → passport-tutorial-zT1ZoA-D.js} +7096 -7084
- package/dist/{passport-vertical-hint-BT1D5BrW.js → passport-vertical-hint-DJbCtBiM.js} +49 -49
- package/dist/pdf-BZA70WbM.js +22398 -0
- package/dist/pdfViewer-BK-yVIve.js +114 -0
- package/dist/phone/phone.es.js +214 -70
- package/dist/phoneInputComposed-DjNdsmPE.js +12142 -0
- package/dist/processing-BM-wT-1W.js +8 -0
- package/dist/qe-signature/qe-signature.es.js +15 -13
- package/dist/radioGroupComposed-BNuaopVr.js +215 -0
- package/dist/redirect-to-mobile/redirect-to-mobile.es.js +2774 -0
- package/dist/redirect-to-mobile/styles.css +19 -269
- package/dist/registerIncodeElement-77NGCDsy.js +11 -0
- package/dist/requiredLabelHint-DEadtiwx.js +17 -0
- package/dist/richText-Cf9aMOCk.js +3153 -0
- package/dist/rolldown-runtime--E5BIlTp.js +33 -0
- package/dist/selfie/selfie.es.js +54 -37
- package/dist/selfie/styles.css +0 -4
- package/dist/selfieTutorial-CtruLyO2.js +2689 -0
- package/dist/signature/signature.es.js +778 -405
- package/dist/snackbar-CxepGC3e.js +16 -0
- package/dist/spinner-B6RxGFrI.js +1 -0
- package/dist/spinner-D8a_2LvW.js +42 -0
- package/dist/statusPage-DMYPUwRZ.js +28 -0
- package/dist/successIcon-BAyDPT7I.js +30 -0
- package/dist/tabs-C8npVBbk.js +103 -0
- package/dist/themes/dark.css +5 -0
- package/dist/themes/light.css +4 -0
- package/dist/transitionSpinner-DRRz-NV8.js +26 -0
- package/dist/{tutorial-9vHAHvMK.js → tutorial-D1qaY2Tm.js} +1105 -856
- package/dist/types/ae-signature.d.ts +4 -1
- package/dist/types/antifraud.d.ts +9 -3
- package/dist/types/authentication.d.ts +4 -1
- package/dist/types/consent.d.ts +4 -1
- package/dist/types/cpf-ocr.d.ts +12 -0
- package/dist/types/cross-document-data-match.d.ts +4 -1
- package/dist/types/curp-validation.d.ts +9 -3
- package/dist/types/document-capture.d.ts +37 -0
- package/dist/types/ekyb.d.ts +4 -1
- package/dist/types/ekyc.d.ts +4 -1
- package/dist/types/electronic-signature.d.ts +4 -1
- package/dist/types/email.d.ts +4 -1
- package/dist/types/extensibility.d.ts +40 -15
- package/dist/types/face-match.d.ts +4 -1
- package/dist/types/field-comparison.d.ts +38 -0
- package/dist/types/fiscal-qr.d.ts +43 -0
- package/dist/types/flow.d.ts +5 -2
- package/dist/types/geolocation.d.ts +4 -1
- package/dist/types/governmentValidation.d.ts +4 -1
- package/dist/types/id-verification.d.ts +4 -1
- package/dist/types/id.d.ts +4 -1
- package/dist/types/identity-reuse.d.ts +4 -1
- package/dist/types/index.d.ts +20 -2
- package/dist/types/phone.d.ts +4 -1
- package/dist/types/qe-signature.d.ts +4 -1
- package/dist/types/redirect-to-mobile.d.ts +17 -0
- package/dist/types/selfie.d.ts +4 -1
- package/dist/types/signature.d.ts +4 -1
- package/dist/types/watchlist.d.ts +4 -1
- package/dist/types/workflow.d.ts +55 -11
- package/dist/typography-YLgHHuao.js +45 -0
- package/dist/uiConfig-D2_wawvr.js +25 -0
- package/dist/useModuleLoader-CeJ2jL25.js +672 -0
- package/dist/vendor-preact-DThS2ZQ_.js +955 -0
- package/dist/verificationResult-Do5SpZ6X.js +64 -0
- package/dist/verifiedByIncode-DjXOdCml.js +103 -0
- package/dist/watchlist/watchlist.es.js +31 -28
- package/dist/watchlistForBusiness-BFFXC9d-.js +80 -0
- package/dist/workflow/styles.css +449 -427
- package/dist/workflow/workflow.es.js +268 -182
- package/package.json +32 -10
- package/dist/aligndevicelottie-DoV8xKjh.js +0 -12757
- package/dist/autoFocusTitle-QexamZ4i.js +0 -16
- package/dist/back-tutorial-1NOQobGO.js +0 -14585
- package/dist/backdevicelottie-C_ceuqY7.js +0 -16678
- package/dist/blurdevicelottie-UO14Y0WC.js +0 -15939
- package/dist/bottomSheet-DE_8TFEC.js +0 -31
- package/dist/browser-ponyfill-jOkuz57z.js +0 -299
- package/dist/button-DcCUEn2n.js +0 -24
- package/dist/checkbox-Cl57ltq_.js +0 -85
- package/dist/countrySelector-CE-JgIsv.js +0 -58
- package/dist/cpfOcr-D_tbwbvh.js +0 -78
- package/dist/customFields-CW38fQUv.js +0 -127
- package/dist/customWatchlist-D9_yjEQd.js +0 -33
- package/dist/dateInputComposed-BpAGsjN6.js +0 -55
- package/dist/dateInputComposed-DU3o6PAV.js +0 -1
- package/dist/defineProperty-Dh8nSJpJ.js +0 -39
- package/dist/documentCapture-xX-JT7ZY.js +0 -763
- package/dist/dropdownComposed-DFRBG22E.js +0 -284
- package/dist/dropdownComposed-DwTzc2YU.js +0 -1
- package/dist/dynamicForms-CJP1Ia6Q.js +0 -262
- package/dist/ekybModule-BSs7mndb.js +0 -280
- package/dist/ekybModule-D9M3E2Gm.js +0 -2
- package/dist/ekycModule-CU9pt5YN.js +0 -246
- package/dist/ekycModule-CZw9cLno.js +0 -2
- package/dist/electronic-signature-COYXjGdd.js +0 -410
- package/dist/emailInput-DppGf9pv.js +0 -37
- package/dist/expiredId-BnmzE8T3.js +0 -70
- package/dist/extensibility-CzEJfRwo.js +0 -2586
- package/dist/faceMatch-B8j0g0Yo.js +0 -2
- package/dist/faceMatch-BV8UD7tj.js +0 -201
- package/dist/frontdevicelottie-Bu6f9fDE.js +0 -17302
- package/dist/glaredevicelottie-B10axYs_.js +0 -14466
- package/dist/homeScreen-DnP1jw9A.js +0 -227
- package/dist/hooks-BVnGysT7.js +0 -80
- package/dist/i18n-9s4OSqwi.js +0 -2010
- package/dist/icons-Cc7zwchP.js +0 -310
- package/dist/id-laser-h-mBAzHVOK.js +0 -467
- package/dist/id-laser-v-CrFg4bcJ.js +0 -483
- package/dist/id-tutorial-BCr42Pnn.js +0 -13153
- package/dist/idOcr-CCjfWQvH.js +0 -94
- package/dist/incode-logo-DX016usY.js +0 -4
- package/dist/incodeComponent-C1o4M0ZK.js +0 -50
- package/dist/incodeModule-BqCjVgEI.js +0 -18
- package/dist/inputComposed-APSw8C7o.js +0 -89
- package/dist/inputComposed-XYrarFxS.js +0 -1
- package/dist/loadingIcon-BN5YRQUb.js +0 -104
- package/dist/mandatoryConsent-DssKMC3v.js +0 -100
- package/dist/modal-NMxsQHAO.js +0 -135
- package/dist/modal.hooks-CAjcIFZK.js +0 -126
- package/dist/numberedStep-CT-alrK5.js +0 -11
- package/dist/optionAccessibleLabel-CzEeX3Q4.js +0 -140
- package/dist/otpInput-DqRA_egd.js +0 -145
- package/dist/page-C1yT4DLb.js +0 -69
- package/dist/pdf-BurGZ08w.js +0 -14967
- package/dist/pdfViewer-BGBNL1Ea.js +0 -63
- package/dist/phoneInputComposed-bvWhGLFZ.js +0 -11206
- package/dist/processing-G_y3o32b.js +0 -6
- package/dist/radioGroupComposed-BbmvxmD2.js +0 -177
- package/dist/redirectToMobile-C3k1gloW.js +0 -1514
- package/dist/requiredLabelHint-BLwgqozE.js +0 -13
- package/dist/richText-DbJ5sl2n.js +0 -1973
- package/dist/rolldown-runtime-CYMK-g2i.js +0 -20
- package/dist/selfieTutorial-BgrlUMXP.js +0 -2677
- package/dist/snackbar-BDp8x7Cv.js +0 -14
- package/dist/spinner-B4dcie2T.js +0 -1
- package/dist/spinner-CKnjVHxw.js +0 -39
- package/dist/statusPage-CUI7ApcU.js +0 -28
- package/dist/successIcon-DbILeIz_.js +0 -28
- package/dist/tabs-DaPyP71c.js +0 -78
- package/dist/transitionSpinner-PIEPU2Vx.js +0 -17
- package/dist/types/cpf-ocr/styles.d.ts +0 -1
- package/dist/types/document-capture/styles.d.ts +0 -1
- package/dist/types/redirect-to-mobile/styles.d.ts +0 -1
- package/dist/typography-CxjaknHN.js +0 -28
- package/dist/uiConfig-CwpQ-IM6.js +0 -20
- package/dist/useModuleLoader-BFiVA41N.js +0 -432
- package/dist/vendor-preact-D6SntenC.js +0 -958
- package/dist/verificationResult-BrVbUJ4U.js +0 -97
- package/dist/verifiedByIncode-ChZBpqNy.js +0 -101
- package/dist/watchlistForBusiness-BcSNtHCV.js +0 -77
|
@@ -1,198 +1,327 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
import { _ as
|
|
3
|
-
import { o as
|
|
4
|
-
import { t as
|
|
5
|
-
import { t as
|
|
6
|
-
import { t as
|
|
7
|
-
import { t as
|
|
8
|
-
import { t as
|
|
9
|
-
import { createIdentityReuseManager
|
|
1
|
+
import { n as useTranslation } from "../i18n-CoCO2ZuN.js";
|
|
2
|
+
import { _ as y, v as u } from "../vendor-preact-DThS2ZQ_.js";
|
|
3
|
+
import { c as useManager, o as useModuleTerminalCallbacks } from "../hooks-Da_yP_Dr.js";
|
|
4
|
+
import { t as IncodeComponent } from "../incodeComponent-wfnHlnXx.js";
|
|
5
|
+
import { t as Page } from "../page-DxGQj7Gk.js";
|
|
6
|
+
import { t as Spinner } from "../spinner-D8a_2LvW.js";
|
|
7
|
+
import { t as Button } from "../button-CM_hgyIP.js";
|
|
8
|
+
import { t as registerIncodeModuleElement } from "../incodeModule-BUDoTwT9.js";
|
|
9
|
+
import { SCAN_NEW_DOCUMENT, createIdentityReuseManager } from "@incodetech/core/identity-reuse";
|
|
10
10
|
//#region src/modules/identity-reuse/identity-reuse.tsx
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
11
|
+
/**
|
|
12
|
+
* ISO 3166-1 alpha-3 → alpha-2 mapping for countries the SDK supports.
|
|
13
|
+
* The identity-reuse backend returns alpha-3 codes; flag rendering needs
|
|
14
|
+
* alpha-2. Extend as backend support expands; unmapped codes fall back to "".
|
|
15
|
+
*/
|
|
16
|
+
var ISO3_TO_ISO2 = {
|
|
17
|
+
USA: "US",
|
|
18
|
+
MEX: "MX",
|
|
19
|
+
CAN: "CA",
|
|
20
|
+
GBR: "GB",
|
|
21
|
+
DEU: "DE",
|
|
22
|
+
FRA: "FR",
|
|
23
|
+
ESP: "ES",
|
|
24
|
+
ITA: "IT",
|
|
25
|
+
BRA: "BR",
|
|
26
|
+
ARG: "AR",
|
|
27
|
+
COL: "CO",
|
|
28
|
+
CHL: "CL",
|
|
29
|
+
PER: "PE",
|
|
30
|
+
AUS: "AU",
|
|
31
|
+
NZL: "NZ",
|
|
32
|
+
JPN: "JP",
|
|
33
|
+
KOR: "KR",
|
|
34
|
+
CHN: "CN",
|
|
35
|
+
IND: "IN",
|
|
36
|
+
RUS: "RU",
|
|
37
|
+
ZAF: "ZA",
|
|
38
|
+
NGA: "NG",
|
|
39
|
+
EGY: "EG",
|
|
40
|
+
ARE: "AE",
|
|
41
|
+
SAU: "SA",
|
|
42
|
+
ISR: "IL",
|
|
43
|
+
TUR: "TR",
|
|
44
|
+
NLD: "NL",
|
|
45
|
+
BEL: "BE",
|
|
46
|
+
CHE: "CH",
|
|
47
|
+
AUT: "AT",
|
|
48
|
+
SWE: "SE",
|
|
49
|
+
NOR: "NO",
|
|
50
|
+
DNK: "DK",
|
|
51
|
+
FIN: "FI",
|
|
52
|
+
POL: "PL",
|
|
53
|
+
PRT: "PT",
|
|
54
|
+
IRL: "IE",
|
|
55
|
+
GRC: "GR",
|
|
56
|
+
CZE: "CZ",
|
|
57
|
+
HUN: "HU",
|
|
58
|
+
ROU: "RO",
|
|
59
|
+
UKR: "UA",
|
|
60
|
+
PHL: "PH",
|
|
61
|
+
IDN: "ID",
|
|
62
|
+
MYS: "MY",
|
|
63
|
+
SGP: "SG",
|
|
64
|
+
THA: "TH",
|
|
65
|
+
VNM: "VN",
|
|
66
|
+
PAK: "PK",
|
|
67
|
+
BGD: "BD",
|
|
68
|
+
HKG: "HK",
|
|
69
|
+
TWN: "TW",
|
|
70
|
+
VEN: "VE",
|
|
71
|
+
ECU: "EC",
|
|
72
|
+
GTM: "GT",
|
|
73
|
+
CRI: "CR",
|
|
74
|
+
PAN: "PA",
|
|
75
|
+
DOM: "DO",
|
|
76
|
+
PRI: "PR",
|
|
77
|
+
CUB: "CU",
|
|
78
|
+
JAM: "JM",
|
|
79
|
+
HND: "HN",
|
|
80
|
+
SLV: "SV",
|
|
81
|
+
NIC: "NI",
|
|
82
|
+
BOL: "BO",
|
|
83
|
+
PRY: "PY",
|
|
84
|
+
URY: "UY",
|
|
85
|
+
KEN: "KE",
|
|
86
|
+
GHA: "GH",
|
|
87
|
+
MAR: "MA",
|
|
88
|
+
TUN: "TN",
|
|
89
|
+
KWT: "KW",
|
|
90
|
+
QAT: "QA",
|
|
91
|
+
BHR: "BH",
|
|
92
|
+
OMN: "OM",
|
|
93
|
+
JOR: "JO",
|
|
94
|
+
LBN: "LB",
|
|
95
|
+
SRB: "RS",
|
|
96
|
+
HRV: "HR",
|
|
97
|
+
SVK: "SK",
|
|
98
|
+
SVN: "SI",
|
|
99
|
+
BGR: "BG",
|
|
100
|
+
LTU: "LT",
|
|
101
|
+
LVA: "LV",
|
|
102
|
+
EST: "EE",
|
|
103
|
+
ISL: "IS",
|
|
104
|
+
LUX: "LU",
|
|
105
|
+
MLT: "MT",
|
|
106
|
+
CYP: "CY"
|
|
107
|
+
};
|
|
108
|
+
/** Convert an ISO-2 or ISO-3 country code to a flag emoji. */
|
|
109
|
+
function countryCodeToFlag(countryCode) {
|
|
110
|
+
if (!countryCode) return "";
|
|
111
|
+
const upper = countryCode.toUpperCase();
|
|
112
|
+
const iso2 = upper.length === 3 ? ISO3_TO_ISO2[upper] ?? "" : upper;
|
|
113
|
+
if (iso2.length !== 2) return "";
|
|
114
|
+
const A_OFFSET = 127462 - "A".charCodeAt(0);
|
|
115
|
+
return String.fromCodePoint(iso2.charCodeAt(0) + A_OFFSET, iso2.charCodeAt(1) + A_OFFSET);
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Format a backend verification timestamp as a locale-aware short date
|
|
119
|
+
* (e.g. "15 Apr 2023" in en-US). Auto-detects unit: values >= 1e12 are
|
|
120
|
+
* treated as milliseconds, smaller values as unix seconds (the documents
|
|
121
|
+
* API returns seconds, possibly with fractional millis). Returns null if
|
|
122
|
+
* the value can't be parsed so the caller can hide the row instead of
|
|
123
|
+
* rendering a half-empty "Verified" with no date.
|
|
124
|
+
*/
|
|
125
|
+
function formatVerifiedAt(timestamp, locale) {
|
|
126
|
+
if (!Number.isFinite(timestamp) || timestamp <= 0) return null;
|
|
127
|
+
const ms = timestamp >= 0xe8d4a51000 ? timestamp : timestamp * 1e3;
|
|
128
|
+
const date = new Date(ms);
|
|
129
|
+
if (Number.isNaN(date.getTime())) return null;
|
|
130
|
+
return new Intl.DateTimeFormat(locale, {
|
|
131
|
+
day: "2-digit",
|
|
132
|
+
month: "short",
|
|
133
|
+
year: "numeric"
|
|
134
|
+
}).format(date);
|
|
135
|
+
}
|
|
136
|
+
var RadioDot = ({ checked }) => /* @__PURE__ */ u("span", {
|
|
137
|
+
class: `IncodeIdentityReuseRadio ${checked ? "IncodeIdentityReuseRadioChecked" : ""}`,
|
|
21
138
|
"aria-hidden": "true",
|
|
22
|
-
children: /* @__PURE__ */
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
class: "IncodeIdentityReuseCircleWrapper",
|
|
42
|
-
children: /* @__PURE__ */ n(u, { name: t })
|
|
43
|
-
})
|
|
44
|
-
]
|
|
45
|
-
}), p = ({ config: i, manager: c, onFinish: u, onError: d }) => {
|
|
46
|
-
let { t: p } = e(), [m, h] = r(() => {
|
|
47
|
-
if (c) return c;
|
|
48
|
-
if (!i) throw Error("IdentityReuse config is required when no manager is provided");
|
|
49
|
-
return l({ config: i });
|
|
50
|
-
}, { manageLifecycle: !c });
|
|
51
|
-
t(() => {
|
|
52
|
-
m.status === "finished" && u?.();
|
|
53
|
-
}, [m.status, u]);
|
|
54
|
-
let g = m.status === "error" ? m.error : void 0;
|
|
55
|
-
return t(() => {
|
|
56
|
-
g && d?.(g);
|
|
57
|
-
}, [g, d]), m.status === "idle" || m.status === "loading" || m.status === "submitContinue" || m.status === "submitSkip" ? /* @__PURE__ */ n(o, { title: p("identityReuse.loading") }) : m.status === "oneCandidateFound" ? /* @__PURE__ */ n(a, {
|
|
58
|
-
className: "IncodeIdentityReusePage",
|
|
59
|
-
title: p("identityReuse.title"),
|
|
60
|
-
subtitle: p("identityReuse.subtitle"),
|
|
61
|
-
children: [/* @__PURE__ */ n("div", {
|
|
62
|
-
class: "IncodeIdentityReuseContent",
|
|
63
|
-
children: [/* @__PURE__ */ n(f, {
|
|
64
|
-
providingOrganization: m.selectedOrganizationName,
|
|
65
|
-
receivingOrganization: m.currentOrganizationName
|
|
66
|
-
}), /* @__PURE__ */ n("p", {
|
|
67
|
-
class: "IncodeIdentityReuseDescription",
|
|
68
|
-
children: p("identityReuse.description", { companyName: m.currentOrganizationName })
|
|
69
|
-
})]
|
|
70
|
-
}), /* @__PURE__ */ n("div", {
|
|
71
|
-
class: "IncodeIdentityReuseActions",
|
|
72
|
-
children: [/* @__PURE__ */ n(s, {
|
|
73
|
-
onClick: () => h.submitCandidate(),
|
|
74
|
-
"data-testid": "identity-reuse-continue-button",
|
|
75
|
-
children: p("identityReuse.cta.continue")
|
|
76
|
-
}), /* @__PURE__ */ n(s, {
|
|
77
|
-
onClick: () => h.skip(),
|
|
78
|
-
variant: "link",
|
|
79
|
-
"data-testid": "identity-reuse-verify-button",
|
|
80
|
-
children: p("identityReuse.cta.verify")
|
|
81
|
-
})]
|
|
82
|
-
})]
|
|
83
|
-
}) : m.status === "multiCandidatesFound" ? m.selectionPhase === "candidateSelected" ? /* @__PURE__ */ n(a, {
|
|
84
|
-
className: "IncodeIdentityReusePage",
|
|
85
|
-
title: p("identityReuse.title"),
|
|
86
|
-
subtitle: p("identityReuse.subtitle"),
|
|
87
|
-
children: [/* @__PURE__ */ n("div", {
|
|
88
|
-
class: "IncodeIdentityReuseContent",
|
|
89
|
-
children: [/* @__PURE__ */ n(f, {
|
|
90
|
-
providingOrganization: m.selectedOrganizationName,
|
|
91
|
-
receivingOrganization: m.currentOrganizationName
|
|
92
|
-
}), /* @__PURE__ */ n("p", {
|
|
93
|
-
class: "IncodeIdentityReuseDescription",
|
|
94
|
-
children: p("identityReuse.description", { companyName: m.currentOrganizationName })
|
|
95
|
-
})]
|
|
96
|
-
}), /* @__PURE__ */ n("div", {
|
|
97
|
-
class: "IncodeIdentityReuseActions",
|
|
139
|
+
children: checked ? /* @__PURE__ */ u("span", { class: "IncodeIdentityReuseRadioInner" }) : null
|
|
140
|
+
});
|
|
141
|
+
var DocumentCard = ({ document, selected, recommended, tabIndex, onSelect, locale }) => {
|
|
142
|
+
const { t } = useTranslation();
|
|
143
|
+
const typeLabel = t(`identityReuse.documentType.${document.documentType}`);
|
|
144
|
+
const flag = countryCodeToFlag(document.countryCode);
|
|
145
|
+
const verifiedDate = formatVerifiedAt(document.verifiedAt, locale);
|
|
146
|
+
const verifiedWord = t("identityReuse.verified", { defaultValue: "Verified" });
|
|
147
|
+
const verifiedLabel = verifiedDate ? `${verifiedWord} ${verifiedDate}` : null;
|
|
148
|
+
return /* @__PURE__ */ u("button", {
|
|
149
|
+
type: "button",
|
|
150
|
+
class: `IncodeIdentityReuseCard ${selected ? "IncodeIdentityReuseCardSelected" : ""}`,
|
|
151
|
+
role: "radio",
|
|
152
|
+
"aria-checked": selected,
|
|
153
|
+
tabIndex,
|
|
154
|
+
onClick: onSelect,
|
|
155
|
+
"data-testid": `identity-reuse-document-${document.id}`,
|
|
156
|
+
children: /* @__PURE__ */ u("div", {
|
|
157
|
+
class: "IncodeIdentityReuseCardBody",
|
|
98
158
|
children: [
|
|
99
|
-
/* @__PURE__ */
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
159
|
+
/* @__PURE__ */ u("div", {
|
|
160
|
+
class: "IncodeIdentityReuseCardHeader",
|
|
161
|
+
children: [/* @__PURE__ */ u("div", {
|
|
162
|
+
class: "IncodeIdentityReuseCardHeaderLeft",
|
|
163
|
+
children: [/* @__PURE__ */ u("span", {
|
|
164
|
+
class: "IncodeIdentityReuseCardTypeLabel",
|
|
165
|
+
children: typeLabel
|
|
166
|
+
}), recommended ? /* @__PURE__ */ u("span", {
|
|
167
|
+
class: "IncodeIdentityReuseBadgeRecommended",
|
|
168
|
+
children: t("identityReuse.badge.recommended")
|
|
169
|
+
}) : null]
|
|
170
|
+
}), /* @__PURE__ */ u(RadioDot, { checked: selected })]
|
|
103
171
|
}),
|
|
104
|
-
/* @__PURE__ */
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
172
|
+
/* @__PURE__ */ u("p", {
|
|
173
|
+
class: "IncodeIdentityReuseCardIdentifier",
|
|
174
|
+
children: [flag ? /* @__PURE__ */ u("span", {
|
|
175
|
+
"aria-hidden": "true",
|
|
176
|
+
children: flag
|
|
177
|
+
}) : null, /* @__PURE__ */ u("span", { children: document.maskedNumber })]
|
|
109
178
|
}),
|
|
110
|
-
/* @__PURE__ */
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
children: p("identityReuse.cta.verify")
|
|
115
|
-
})
|
|
179
|
+
verifiedLabel ? /* @__PURE__ */ u("p", {
|
|
180
|
+
class: "IncodeIdentityReuseCardVerified",
|
|
181
|
+
children: verifiedLabel
|
|
182
|
+
}) : null
|
|
116
183
|
]
|
|
117
|
-
})
|
|
118
|
-
})
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
184
|
+
})
|
|
185
|
+
});
|
|
186
|
+
};
|
|
187
|
+
var ScanNewRow = ({ selected, tabIndex, onSelect }) => {
|
|
188
|
+
const { t } = useTranslation();
|
|
189
|
+
return /* @__PURE__ */ u("button", {
|
|
190
|
+
type: "button",
|
|
191
|
+
class: `IncodeIdentityReuseCard IncodeIdentityReuseScanNewCard ${selected ? "IncodeIdentityReuseCardSelected" : ""}`,
|
|
192
|
+
role: "radio",
|
|
193
|
+
"aria-checked": selected,
|
|
194
|
+
tabIndex,
|
|
195
|
+
onClick: onSelect,
|
|
196
|
+
"data-testid": "identity-reuse-scan-new",
|
|
197
|
+
children: [/* @__PURE__ */ u("div", {
|
|
198
|
+
class: "IncodeIdentityReuseScanNewBody",
|
|
199
|
+
children: [/* @__PURE__ */ u("span", {
|
|
200
|
+
class: "IncodeIdentityReuseCardTypeLabel",
|
|
201
|
+
children: t("identityReuse.scanANewDocument")
|
|
202
|
+
}), /* @__PURE__ */ u("span", {
|
|
203
|
+
class: "IncodeIdentityReuseBadgeSlowest",
|
|
204
|
+
children: t("identityReuse.badge.slowest")
|
|
205
|
+
})]
|
|
206
|
+
}), /* @__PURE__ */ u(RadioDot, { checked: selected })]
|
|
207
|
+
});
|
|
208
|
+
};
|
|
209
|
+
var IdentityReuseContent = ({ config, manager: externalManager, onFinish, onError }) => {
|
|
210
|
+
const { t, i18n } = useTranslation();
|
|
211
|
+
const locale = i18n.language || "en";
|
|
212
|
+
const [state, manager] = useManager(() => {
|
|
213
|
+
if (externalManager) return externalManager;
|
|
214
|
+
if (!config) throw new Error("IdentityReuse config is required when no manager is provided");
|
|
215
|
+
return createIdentityReuseManager({ config });
|
|
216
|
+
}, { manageLifecycle: !externalManager });
|
|
217
|
+
useModuleTerminalCallbacks({
|
|
218
|
+
status: state.status === "finished" ? "finished" : "loading",
|
|
219
|
+
onFinish
|
|
220
|
+
});
|
|
221
|
+
const errorMessage = state.status === "error" ? state.error : void 0;
|
|
222
|
+
y(() => {
|
|
223
|
+
if (errorMessage) onError?.(errorMessage);
|
|
224
|
+
}, [errorMessage, onError]);
|
|
225
|
+
if (state.status === "idle" || state.status === "loading" || state.status === "submitting") return /* @__PURE__ */ u(Spinner, { title: t("identityReuse.loading") });
|
|
226
|
+
if (state.status === "documentsFound") {
|
|
227
|
+
const selectedId = state.selectedDocumentId;
|
|
228
|
+
const optionIds = [...state.documents.map((d) => d.id), SCAN_NEW_DOCUMENT];
|
|
229
|
+
const focusedIndex = selectedId === void 0 ? 0 : Math.max(0, optionIds.findIndex((id) => id === selectedId));
|
|
230
|
+
const ctaLabel = selectedId === SCAN_NEW_DOCUMENT ? t("identityReuse.cta.scanNew") : t("identityReuse.cta.confirm");
|
|
231
|
+
const handleRadiogroupKeyDown = (event) => {
|
|
232
|
+
const container = event.currentTarget;
|
|
233
|
+
if (!container) return;
|
|
234
|
+
const buttons = container.querySelectorAll("[role=\"radio\"]");
|
|
235
|
+
if (buttons.length === 0) return;
|
|
236
|
+
const currentIndex = Array.from(buttons).findIndex((b) => b === document.activeElement);
|
|
237
|
+
if (currentIndex === -1) return;
|
|
238
|
+
let nextIndex = currentIndex;
|
|
239
|
+
switch (event.key) {
|
|
240
|
+
case "ArrowDown":
|
|
241
|
+
case "ArrowRight":
|
|
242
|
+
nextIndex = (currentIndex + 1) % buttons.length;
|
|
243
|
+
break;
|
|
244
|
+
case "ArrowUp":
|
|
245
|
+
case "ArrowLeft":
|
|
246
|
+
nextIndex = (currentIndex - 1 + buttons.length) % buttons.length;
|
|
247
|
+
break;
|
|
248
|
+
case "Home":
|
|
249
|
+
nextIndex = 0;
|
|
250
|
+
break;
|
|
251
|
+
case "End":
|
|
252
|
+
nextIndex = buttons.length - 1;
|
|
253
|
+
break;
|
|
254
|
+
default: return;
|
|
255
|
+
}
|
|
256
|
+
event.preventDefault();
|
|
257
|
+
const next = buttons[nextIndex];
|
|
258
|
+
if (next) {
|
|
259
|
+
next.focus();
|
|
260
|
+
next.click();
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
return /* @__PURE__ */ u(Page, {
|
|
264
|
+
className: "IncodeIdentityReusePage",
|
|
265
|
+
title: t("identityReuse.title"),
|
|
266
|
+
subtitle: t("identityReuse.subtitle"),
|
|
267
|
+
children: /* @__PURE__ */ u("div", {
|
|
268
|
+
class: "IncodeIdentityReuseBody",
|
|
269
|
+
children: [/* @__PURE__ */ u("div", {
|
|
270
|
+
class: "IncodeIdentityReuseList",
|
|
271
|
+
role: "radiogroup",
|
|
272
|
+
"aria-label": t("identityReuse.title"),
|
|
273
|
+
onKeyDown: handleRadiogroupKeyDown,
|
|
274
|
+
children: [state.documents.map((document, index) => /* @__PURE__ */ u(DocumentCard, {
|
|
275
|
+
document,
|
|
276
|
+
selected: selectedId === document.id,
|
|
277
|
+
recommended: index === 0,
|
|
278
|
+
tabIndex: index === focusedIndex ? 0 : -1,
|
|
279
|
+
onSelect: () => manager.chooseDocument(document.id),
|
|
280
|
+
locale
|
|
281
|
+
}, document.id)), /* @__PURE__ */ u(ScanNewRow, {
|
|
282
|
+
selected: selectedId === SCAN_NEW_DOCUMENT,
|
|
283
|
+
tabIndex: focusedIndex === state.documents.length ? 0 : -1,
|
|
284
|
+
onSelect: () => manager.chooseDocument(SCAN_NEW_DOCUMENT)
|
|
148
285
|
})]
|
|
149
|
-
},
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
})
|
|
159
|
-
})]
|
|
160
|
-
}) : m.status === "noCandidatesFound" ? /* @__PURE__ */ n(a, {
|
|
161
|
-
className: "IncodeIdentityReusePage",
|
|
162
|
-
title: p("identityReuse.noCandidatesTitle"),
|
|
163
|
-
subtitle: p("identityReuse.noCandidatesSubtitle"),
|
|
164
|
-
children: [/* @__PURE__ */ n("div", { class: "IncodeIdentityReuseContent" }), /* @__PURE__ */ n("div", {
|
|
165
|
-
class: "IncodeIdentityReuseActions",
|
|
166
|
-
children: /* @__PURE__ */ n(s, {
|
|
167
|
-
onClick: () => h.skip(),
|
|
168
|
-
"data-testid": "identity-reuse-continue-button",
|
|
169
|
-
children: p("identityReuse.cta.continueVerification")
|
|
286
|
+
}), /* @__PURE__ */ u("div", {
|
|
287
|
+
class: "IncodeIdentityReuseActions",
|
|
288
|
+
children: /* @__PURE__ */ u(Button, {
|
|
289
|
+
onClick: () => manager.submit(),
|
|
290
|
+
disabled: selectedId === void 0,
|
|
291
|
+
"data-testid": "identity-reuse-confirm-button",
|
|
292
|
+
children: ctaLabel
|
|
293
|
+
})
|
|
294
|
+
})]
|
|
170
295
|
})
|
|
171
|
-
})
|
|
172
|
-
}
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
if (state.status === "error") return /* @__PURE__ */ u(Page, {
|
|
173
299
|
className: "IncodeIdentityReusePage",
|
|
174
|
-
title:
|
|
175
|
-
subtitle:
|
|
176
|
-
children: [/* @__PURE__ */
|
|
300
|
+
title: t("identityReuse.errorTitle"),
|
|
301
|
+
subtitle: state.error,
|
|
302
|
+
children: [/* @__PURE__ */ u("div", { class: "IncodeIdentityReuseContent" }), /* @__PURE__ */ u("div", {
|
|
177
303
|
class: "IncodeIdentityReuseActions",
|
|
178
|
-
children: [/* @__PURE__ */
|
|
179
|
-
onClick: () =>
|
|
304
|
+
children: [/* @__PURE__ */ u(Button, {
|
|
305
|
+
onClick: () => manager.retry(),
|
|
180
306
|
"data-testid": "identity-reuse-retry-button",
|
|
181
|
-
children:
|
|
182
|
-
}), /* @__PURE__ */
|
|
183
|
-
onClick: () =>
|
|
307
|
+
children: t("identityReuse.cta.retry")
|
|
308
|
+
}), /* @__PURE__ */ u(Button, {
|
|
309
|
+
onClick: () => manager.skip(),
|
|
184
310
|
variant: "link",
|
|
185
|
-
"data-testid": "identity-reuse-
|
|
186
|
-
children:
|
|
311
|
+
"data-testid": "identity-reuse-skip-button",
|
|
312
|
+
children: t("identityReuse.cta.skip")
|
|
187
313
|
})]
|
|
188
314
|
})]
|
|
189
|
-
})
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
315
|
+
});
|
|
316
|
+
if (state.status === "finished") return null;
|
|
317
|
+
return null;
|
|
318
|
+
};
|
|
319
|
+
var IdentityReuse = ({ config, manager, onFinish, onError }) => /* @__PURE__ */ u(IncodeComponent, { children: config || manager ? /* @__PURE__ */ u(IdentityReuseContent, {
|
|
320
|
+
config,
|
|
321
|
+
manager,
|
|
322
|
+
onFinish,
|
|
323
|
+
onError
|
|
195
324
|
}) : null });
|
|
196
|
-
|
|
325
|
+
registerIncodeModuleElement(IdentityReuse, "incode-identity-reuse");
|
|
197
326
|
//#endregion
|
|
198
|
-
export {
|
|
327
|
+
export { IdentityReuse };
|