@incodetech/web 2.0.0-alpha.8 → 2.0.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 -0
- package/dist/ae-signature/styles.css +348 -0
- package/dist/ae-signature/styles2.css +107 -0
- package/dist/aligndevicelottie-DoV8xKjh.js +12757 -0
- package/dist/antifraud/antifraud.es.js +18 -0
- package/dist/antifraud/styles.css +2 -0
- package/dist/authentication/authentication.es.js +29 -0
- package/dist/autoFocusTitle-QexamZ4i.js +16 -0
- package/dist/back-horizontal-hint-B8Brxh3U.js +137 -0
- package/dist/back-tutorial-1NOQobGO.js +14585 -0
- package/dist/back-vertical-hint-BBo36dxn.js +128 -0
- package/dist/backdevicelottie-C_ceuqY7.js +16678 -0
- package/dist/base.css +5218 -639
- package/dist/blurdevicelottie-UO14Y0WC.js +15939 -0
- package/dist/bottomSheet-DE_8TFEC.js +31 -0
- package/dist/browser-ponyfill-jOkuz57z.js +299 -0
- package/dist/button-DcCUEn2n.js +24 -0
- package/dist/checkbox-Cl57ltq_.js +85 -0
- package/dist/consent/consent.es.js +90 -0
- package/dist/consent/styles.css +116 -0
- package/dist/countrySelector-CE-JgIsv.js +58 -0
- package/dist/cpf-ocr/styles.css +45 -0
- package/dist/cpfOcr-D_tbwbvh.js +78 -0
- package/dist/cross-document-data-match/cross-document-data-match.es.js +18 -0
- package/dist/curp-validation/curp-validation.es.js +279 -0
- package/dist/curp-validation/styles.css +82 -0
- package/dist/custom-fields/styles.css +22 -0
- package/dist/customFields-CW38fQUv.js +127 -0
- package/dist/customWatchlist-D9_yjEQd.js +33 -0
- package/dist/dateInputComposed-BpAGsjN6.js +55 -0
- package/dist/dateInputComposed-DU3o6PAV.js +1 -0
- package/dist/defineProperty-Dh8nSJpJ.js +39 -0
- package/dist/document-capture/styles.css +367 -0
- package/dist/documentCapture-xX-JT7ZY.js +763 -0
- package/dist/dropdownComposed-DFRBG22E.js +284 -0
- package/dist/dropdownComposed-DwTzc2YU.js +1 -0
- package/dist/dynamic-forms/styles.css +36 -0
- package/dist/dynamicForms-CJP1Ia6Q.js +262 -0
- package/dist/ekyb/ekyb.es.js +2 -0
- package/dist/ekyb/styles.css +137 -0
- package/dist/ekybModule-BSs7mndb.js +280 -0
- package/dist/ekybModule-D9M3E2Gm.js +2 -0
- package/dist/ekyc/ekyc.es.js +2 -0
- package/dist/ekyc/styles.css +106 -0
- package/dist/ekycModule-CU9pt5YN.js +246 -0
- package/dist/ekycModule-CZw9cLno.js +2 -0
- package/dist/electronic-signature/electronic-signature.es.js +2 -0
- package/dist/electronic-signature-COYXjGdd.js +410 -0
- package/dist/email/email.es.js +87 -145
- package/dist/email/styles.css +5 -116
- package/dist/emailInput-DppGf9pv.js +37 -0
- package/dist/expiredId-BnmzE8T3.js +70 -0
- package/dist/extensibility-CzEJfRwo.js +2586 -0
- package/dist/extensibility.es.js +25 -0
- package/dist/face-match/face-match.es.js +2 -0
- package/dist/face-match/styles.css +910 -0
- package/dist/faceMatch-B8j0g0Yo.js +2 -0
- package/dist/faceMatch-BV8UD7tj.js +201 -0
- package/dist/flip-animation-CgwRsEmK.js +6983 -0
- package/dist/flow/flow.es.js +646 -542
- package/dist/flow/styles.css +4524 -440
- package/dist/front-horizontal-hint-DGGGi8e1.js +380 -0
- package/dist/front-vertical-hint-CNr5mE6Q.js +420 -0
- package/dist/frontdevicelottie-Bu6f9fDE.js +17302 -0
- package/dist/geolocation/geolocation.es.js +857 -0
- package/dist/geolocation/styles.css +158 -0
- package/dist/glaredevicelottie-B10axYs_.js +14466 -0
- package/dist/governmentValidation/governmentValidation.es.js +98 -0
- package/dist/governmentValidation/styles.css +58 -0
- package/dist/homeScreen-DnP1jw9A.js +227 -0
- package/dist/hooks-BVnGysT7.js +80 -0
- package/dist/i18n-9s4OSqwi.js +2010 -0
- package/dist/icons-Cc7zwchP.js +310 -0
- package/dist/id/id.es.js +832 -0
- package/dist/id/styles.css +1287 -0
- package/dist/id-laser-h-mBAzHVOK.js +467 -0
- package/dist/id-laser-v-CrFg4bcJ.js +483 -0
- package/dist/id-ocr/styles.css +46 -0
- package/dist/id-tutorial-BCr42Pnn.js +13153 -0
- package/dist/id-verification/id-verification.es.js +20 -0
- package/dist/idOcr-CCjfWQvH.js +94 -0
- package/dist/identity-reuse/identity-reuse.es.js +198 -0
- package/dist/identity-reuse/styles.css +163 -0
- package/dist/incode-logo-DX016usY.js +4 -0
- package/dist/incodeComponent-C1o4M0ZK.js +50 -0
- package/dist/incodeModule-BqCjVgEI.js +18 -0
- package/dist/index.es.js +16 -6
- package/dist/inputComposed-APSw8C7o.js +89 -0
- package/dist/inputComposed-XYrarFxS.js +1 -0
- package/dist/loadingIcon-BN5YRQUb.js +104 -0
- package/dist/mandatoryConsent-DssKMC3v.js +100 -0
- package/dist/modal-NMxsQHAO.js +135 -0
- package/dist/modal.hooks-CAjcIFZK.js +126 -0
- package/dist/numberedStep-CT-alrK5.js +11 -0
- package/dist/optionAccessibleLabel-CzEeX3Q4.js +140 -0
- package/dist/otpInput-DqRA_egd.js +145 -0
- package/dist/page-C1yT4DLb.js +69 -0
- package/dist/passport-horizontal-hint-Bgquwtac.js +293 -0
- package/dist/passport-tutorial-DwRwtPVX.js +11689 -0
- package/dist/passport-vertical-hint-BT1D5BrW.js +267 -0
- package/dist/pdf-BurGZ08w.js +14967 -0
- package/dist/pdfViewer-BGBNL1Ea.js +63 -0
- package/dist/phone/phone.es.js +98 -3441
- package/dist/phone/styles.css +3 -297
- package/dist/phoneInputComposed-bvWhGLFZ.js +11206 -0
- package/dist/processing-G_y3o32b.js +6 -0
- package/dist/qe-signature/qe-signature.es.js +15 -0
- package/dist/radioGroupComposed-BbmvxmD2.js +177 -0
- package/dist/redirect-to-mobile/styles.css +588 -0
- package/dist/redirectToMobile-C3k1gloW.js +1514 -0
- package/dist/requiredLabelHint-BLwgqozE.js +13 -0
- package/dist/richText-DbJ5sl2n.js +1973 -0
- package/dist/rolldown-runtime-CYMK-g2i.js +20 -0
- package/dist/selfie/selfie.es.js +42 -892
- package/dist/selfie/styles.css +298 -184
- package/dist/selfieTutorial-BgrlUMXP.js +2677 -0
- package/dist/signature/signature.es.js +546 -0
- package/dist/snackbar-BDp8x7Cv.js +14 -0
- package/dist/spinner-B4dcie2T.js +1 -0
- package/dist/spinner-CKnjVHxw.js +39 -0
- package/dist/statusPage-CUI7ApcU.js +28 -0
- package/dist/successIcon-DbILeIz_.js +28 -0
- package/dist/tabs-DaPyP71c.js +78 -0
- package/dist/themes/dark.css +846 -151
- package/dist/themes/light.css +798 -116
- package/dist/transitionSpinner-PIEPU2Vx.js +17 -0
- package/dist/tutorial-9vHAHvMK.js +2587 -0
- package/dist/types/ae-signature.d.ts +40 -0
- package/dist/types/antifraud.d.ts +40 -0
- package/dist/types/authentication.d.ts +45 -0
- package/dist/types/consent.d.ts +41 -0
- package/dist/types/cpf-ocr/styles.d.ts +1 -0
- package/dist/types/cross-document-data-match.d.ts +34 -0
- package/dist/types/curp-validation.d.ts +40 -0
- package/dist/types/custom-fields/styles.d.ts +1 -0
- package/dist/types/document-capture/styles.d.ts +1 -0
- package/dist/types/dynamic-forms/styles.d.ts +1 -0
- package/dist/types/ekyb.d.ts +34 -0
- package/dist/types/ekyc.d.ts +34 -0
- package/dist/types/electronic-signature.d.ts +43 -0
- package/dist/types/email.d.ts +14 -4
- package/dist/types/extensibility.d.ts +981 -0
- package/dist/types/face-match.d.ts +59 -0
- package/dist/types/flow.d.ts +81 -13
- package/dist/types/geolocation.d.ts +41 -0
- package/dist/types/governmentValidation.d.ts +34 -0
- package/dist/types/id-ocr/styles.d.ts +1 -0
- package/dist/types/id-verification.d.ts +40 -0
- package/dist/types/id.d.ts +41 -0
- package/dist/types/identity-reuse.d.ts +43 -0
- package/dist/types/index.d.ts +6 -12
- package/dist/types/mandatory-consent/styles.d.ts +1 -0
- package/dist/types/phone.d.ts +14 -4
- package/dist/types/qe-signature.d.ts +40 -0
- package/dist/types/redirect-to-mobile/styles.d.ts +1 -0
- package/dist/types/selfie.d.ts +14 -4
- package/dist/types/signature.d.ts +40 -0
- package/dist/types/watchlist-for-business/styles.d.ts +1 -0
- package/dist/types/watchlist.d.ts +40 -0
- package/dist/types/workflow.d.ts +91 -0
- package/dist/typography-CxjaknHN.js +28 -0
- package/dist/uiConfig-CwpQ-IM6.js +20 -0
- package/dist/useModuleLoader-BFiVA41N.js +432 -0
- package/dist/vendor-preact-D6SntenC.js +958 -0
- package/dist/verificationResult-BrVbUJ4U.js +97 -0
- package/dist/verifiedByIncode-ChZBpqNy.js +101 -0
- package/dist/watchlist/watchlist.es.js +33 -0
- package/dist/watchlist-for-business/styles.css +18 -0
- package/dist/watchlistForBusiness-BcSNtHCV.js +77 -0
- package/dist/workflow/styles.css +4612 -0
- package/dist/workflow/workflow.es.js +244 -0
- package/package.json +211 -15
- package/dist/browser-ponyfill-B6W6hHVY.js +0 -344
- package/dist/incodeModule-Dv8Qllrv.js +0 -254
- package/dist/instance-B-q0ZREN.js +0 -2140
- package/dist/otpInput-BtoZe0Wz.js +0 -151
- package/dist/page-D9ijzlSn.js +0 -234
- package/dist/selfieTutorial-C-u5GufD.js +0 -29
- package/dist/setup-wNL83jmW.js +0 -20
- package/dist/title-BfO5Dlzk.js +0 -25
- package/dist/uiConfig-CQ1W9cUD.js +0 -23
- package/dist/vendor-preact-CK0WeTOR.js +0 -584
package/dist/flow/flow.es.js
CHANGED
|
@@ -1,557 +1,661 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import "../
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
);
|
|
28
|
-
return /* @__PURE__ */ a(
|
|
29
|
-
"div",
|
|
30
|
-
{
|
|
31
|
-
class: o,
|
|
32
|
-
"data-testid": "spinner",
|
|
33
|
-
"data-title": e,
|
|
34
|
-
"data-subtitle": t,
|
|
35
|
-
"data-size": n,
|
|
36
|
-
children: /* @__PURE__ */ a("div", { class: "IncodeSpinnerContent", children: [
|
|
37
|
-
/* @__PURE__ */ a(W, { size: r }),
|
|
38
|
-
(e || t) && /* @__PURE__ */ a(F, { children: [
|
|
39
|
-
/* @__PURE__ */ a(E, { size: 16 }),
|
|
40
|
-
/* @__PURE__ */ a("div", { class: "IncodeSpinnerText", children: [
|
|
41
|
-
e && /* @__PURE__ */ a(K, { className: "IncodeSpinnerTitle", children: e }),
|
|
42
|
-
t && /* @__PURE__ */ a(F, { children: [
|
|
43
|
-
e && /* @__PURE__ */ a(E, { size: 12 }),
|
|
44
|
-
/* @__PURE__ */ a("p", { class: "IncodeSpinnerSubtitle", children: t })
|
|
45
|
-
] })
|
|
46
|
-
] })
|
|
47
|
-
] })
|
|
48
|
-
] })
|
|
49
|
-
}
|
|
50
|
-
);
|
|
51
|
-
};
|
|
52
|
-
function J(e) {
|
|
53
|
-
let t = e.replace("#", "");
|
|
54
|
-
t.length === 3 && (t = t.split("").map((d) => d + d).join(""));
|
|
55
|
-
const n = /^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);
|
|
56
|
-
if (!n) return null;
|
|
57
|
-
const s = Number.parseInt(n[1], 16) / 255, i = Number.parseInt(n[2], 16) / 255, r = Number.parseInt(n[3], 16) / 255, o = Math.max(s, i, r), c = Math.min(s, i, r);
|
|
58
|
-
let l = 0, p = 0;
|
|
59
|
-
const u = (o + c) / 2;
|
|
60
|
-
if (o !== c) {
|
|
61
|
-
const d = o - c;
|
|
62
|
-
switch (p = u > 0.5 ? d / (2 - o - c) : d / (o + c), o) {
|
|
63
|
-
case s:
|
|
64
|
-
l = ((i - r) / d + (i < r ? 6 : 0)) / 6;
|
|
65
|
-
break;
|
|
66
|
-
case i:
|
|
67
|
-
l = ((r - s) / d + 2) / 6;
|
|
68
|
-
break;
|
|
69
|
-
case r:
|
|
70
|
-
l = ((s - i) / d + 4) / 6;
|
|
71
|
-
break;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
return { h: l * 360, s: p * 100, l: u * 100 };
|
|
1
|
+
import { n as e } from "../i18n-9s4OSqwi.js";
|
|
2
|
+
import { _ as t, c as n, d as r, l as i, o as a, p as o, v as s } from "../vendor-preact-D6SntenC.js";
|
|
3
|
+
import { t as c } from "../uiConfig-CwpQ-IM6.js";
|
|
4
|
+
import { o as l } from "../hooks-BVnGysT7.js";
|
|
5
|
+
import { t as u } from "../incodeComponent-C1o4M0ZK.js";
|
|
6
|
+
import { t as d } from "../transitionSpinner-PIEPU2Vx.js";
|
|
7
|
+
import { t as f } from "../incodeModule-BqCjVgEI.js";
|
|
8
|
+
import { a as p, c as m, d as h, f as g, h as _, l as v, n as y, o as b, p as x, r as S, s as C, t as w, u as T } from "../useModuleLoader-BFiVA41N.js";
|
|
9
|
+
import { getDeviceClass as E } from "@incodetech/core/device";
|
|
10
|
+
import { getRequiredWasmPipelines as D } from "@incodetech/core/flow";
|
|
11
|
+
import { QrValidationError as O, bootstrapSession as k, refreshQrUrlUuid as A } from "@incodetech/core/session";
|
|
12
|
+
//#region src/shared/processing/useDelayedFlag.ts
|
|
13
|
+
function j(e, n) {
|
|
14
|
+
let [r, i] = o(!1);
|
|
15
|
+
return t(() => {
|
|
16
|
+
if (e === !1) {
|
|
17
|
+
i(!1);
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
let t = window.setTimeout(() => {
|
|
21
|
+
i(!0);
|
|
22
|
+
}, n);
|
|
23
|
+
return () => {
|
|
24
|
+
window.clearTimeout(t);
|
|
25
|
+
};
|
|
26
|
+
}, [e, n]), r;
|
|
75
27
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
o = c = l = r;
|
|
81
|
-
else {
|
|
82
|
-
const u = (h, C, m) => (m < 0 && (m += 1), m > 1 && (m -= 1), m < 0.16666666666666666 ? h + (C - h) * 6 * m : m < 0.5 ? C : m < 0.6666666666666666 ? h + (C - h) * (0.6666666666666666 - m) * 6 : h), d = r < 0.5 ? r * (1 + i) : r + i - r * i, f = 2 * r - d;
|
|
83
|
-
o = u(f, d, s + 1 / 3), c = u(f, d, s), l = u(f, d, s - 1 / 3);
|
|
84
|
-
}
|
|
85
|
-
const p = (u) => {
|
|
86
|
-
const d = Math.round(u * 255).toString(16);
|
|
87
|
-
return d.length === 1 ? `0${d}` : d;
|
|
88
|
-
};
|
|
89
|
-
return `#${p(o)}${p(c)}${p(l)}`;
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/modules/flow/createFlowSession.ts
|
|
30
|
+
function M(e) {
|
|
31
|
+
return Array.from(new Uint8Array(e), (e) => e.toString(16).padStart(2, "0")).join("");
|
|
90
32
|
}
|
|
91
|
-
function
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
return {
|
|
96
|
-
50: w(t.h, t.s, 95),
|
|
97
|
-
200: w(t.h, t.s, 80),
|
|
98
|
-
300: w(t.h, t.s, 65),
|
|
99
|
-
400: w(t.h, t.s, Math.min(100, t.l + 10)),
|
|
100
|
-
500: e,
|
|
101
|
-
600: w(t.h, t.s, Math.max(0, t.l - 10)),
|
|
102
|
-
900: w(t.h, t.s, 20)
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
function X(e, t) {
|
|
106
|
-
if (typeof document > "u")
|
|
107
|
-
return;
|
|
108
|
-
const n = Q(e);
|
|
109
|
-
let s = document.getElementById(
|
|
110
|
-
"incode-theme"
|
|
111
|
-
);
|
|
112
|
-
s || (s = document.createElement("style"), s.id = "incode-theme", document.head.appendChild(s));
|
|
113
|
-
const i = t || "#ffffff", r = `
|
|
114
|
-
:root,
|
|
115
|
-
:host {
|
|
116
|
-
--primitive-color-brand-50: ${n[50]};
|
|
117
|
-
--primitive-color-brand-200: ${n[200]};
|
|
118
|
-
--primitive-color-brand-300: ${n[300]};
|
|
119
|
-
--primitive-color-brand-400: ${n[400]};
|
|
120
|
-
--primitive-color-brand-500: ${n[500]};
|
|
121
|
-
--primitive-color-brand-600: ${n[600]};
|
|
122
|
-
--primitive-color-brand-900: ${n[900]};
|
|
123
|
-
--button-primary-text-default: ${i};
|
|
124
|
-
}
|
|
125
|
-
`;
|
|
126
|
-
s.textContent = r;
|
|
127
|
-
}
|
|
128
|
-
async function ee() {
|
|
129
|
-
return (await z.get("/omni/asset/fetch-all")).data;
|
|
33
|
+
async function N(e) {
|
|
34
|
+
let t = globalThis.crypto?.subtle;
|
|
35
|
+
if (!t) throw Error("SHA-1 is not available in this environment");
|
|
36
|
+
return M(await t.digest("SHA-1", new TextEncoder().encode(e)));
|
|
130
37
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
const t = L.get(e);
|
|
136
|
-
if (t)
|
|
137
|
-
return t;
|
|
138
|
-
const s = await (await fetch(e)).blob(), i = await new Promise((r, o) => {
|
|
139
|
-
const c = new FileReader();
|
|
140
|
-
c.onloadend = () => r(c.result), c.onerror = o, c.readAsDataURL(s);
|
|
141
|
-
});
|
|
142
|
-
return L.set(e, i), i;
|
|
38
|
+
async function P(e) {
|
|
39
|
+
if (typeof e.apiKey == "string") return e.apiKey;
|
|
40
|
+
if (typeof e.clientId == "string") return N(e.clientId);
|
|
41
|
+
throw Error("Flow self-loading mode requires apiKey or clientId");
|
|
143
42
|
}
|
|
144
|
-
async function
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
s = (await z.get(t)).data;
|
|
157
|
-
const i = e["logo.png"] || e["logo.svg"] || e["logo.jpg"] || e["logo.jpeg"] || e["logo.webp"] || s.logo;
|
|
158
|
-
let r = i;
|
|
159
|
-
return i && (r = await te(i)), {
|
|
160
|
-
...s,
|
|
161
|
-
logo: r
|
|
162
|
-
};
|
|
43
|
+
async function F(e, t) {
|
|
44
|
+
return k(await P(e), {
|
|
45
|
+
configurationId: e.configurationId,
|
|
46
|
+
externalId: e.externalId,
|
|
47
|
+
externalCustomerId: e.externalCustomerId,
|
|
48
|
+
language: e.lang,
|
|
49
|
+
customFields: e.customFields,
|
|
50
|
+
uuid: e.uuid,
|
|
51
|
+
urlUuid: e.urlUuid,
|
|
52
|
+
interviewId: e.interviewId,
|
|
53
|
+
onUrlUuidRefreshed: e.onUrlUuidRefreshed
|
|
54
|
+
}, t);
|
|
163
55
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region src/modules/flow/flowConfig.ts
|
|
58
|
+
function I(e) {
|
|
59
|
+
return typeof e.token == "string";
|
|
167
60
|
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
SELFIE: () => import("../selfie/selfie.es.js").then((e) => e.Selfie)
|
|
172
|
-
};
|
|
173
|
-
function T() {
|
|
174
|
-
return O({
|
|
175
|
-
modules: {
|
|
176
|
-
PHONE: V,
|
|
177
|
-
EMAIL: _,
|
|
178
|
-
SELFIE: Y
|
|
179
|
-
}
|
|
180
|
-
});
|
|
61
|
+
function L(e) {
|
|
62
|
+
let t = e;
|
|
63
|
+
return typeof t.configurationId == "string" && (typeof t.apiKey == "string" || typeof t.clientId == "string");
|
|
181
64
|
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region src/modules/flow/preloadFlow.ts
|
|
67
|
+
var R = /* @__PURE__ */ new Map();
|
|
68
|
+
function z(e) {
|
|
69
|
+
let t = R.get(e);
|
|
70
|
+
if (!t) throw Error("Preload state not found");
|
|
71
|
+
return {
|
|
72
|
+
get isReady() {
|
|
73
|
+
return t.status === "ready";
|
|
74
|
+
},
|
|
75
|
+
get error() {
|
|
76
|
+
return t.status === "error" ? t.error ?? null : null;
|
|
77
|
+
},
|
|
78
|
+
async waitUntilReady() {
|
|
79
|
+
if (t.status !== "ready") {
|
|
80
|
+
if (t.status === "error") throw Error(t.error ?? "Preload failed");
|
|
81
|
+
return t.readyPromise;
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
cancel() {
|
|
85
|
+
t.status === "loading" && (t.unsubscribe && t.unsubscribe(), t.flowManager.stop(), t.readyReject(/* @__PURE__ */ Error("Preload cancelled")), R.delete(e));
|
|
86
|
+
}
|
|
87
|
+
};
|
|
188
88
|
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
89
|
+
function B(e) {
|
|
90
|
+
let { token: t } = e;
|
|
91
|
+
if (e.urlUuid) throw Error("preloadIncodeFlow does not support urlUuid; pass it to <IncodeFlow> directly so the SDK can rotate it on mount.");
|
|
92
|
+
if (R.has(t)) return z(t);
|
|
93
|
+
let n, r, i = new Promise((e, t) => {
|
|
94
|
+
n = e, r = t;
|
|
95
|
+
}), a = m(e);
|
|
96
|
+
a.getState().presentation.shouldPrefetchHome && g();
|
|
97
|
+
let o = {
|
|
98
|
+
status: "loading",
|
|
99
|
+
flowManager: a,
|
|
100
|
+
config: e,
|
|
101
|
+
readyPromise: i,
|
|
102
|
+
readyResolve: n,
|
|
103
|
+
readyReject: r
|
|
104
|
+
};
|
|
105
|
+
return R.set(t, o), (async () => {
|
|
106
|
+
try {
|
|
107
|
+
await T({
|
|
108
|
+
token: e.token,
|
|
109
|
+
lang: e.lang,
|
|
110
|
+
flowManager: a
|
|
111
|
+
});
|
|
112
|
+
let t = e.disableDashboardTheme ? Promise.resolve({}) : v().then((e) => {
|
|
113
|
+
o.theme = e.theme, o.uiConfig = e.uiConfig;
|
|
114
|
+
});
|
|
115
|
+
o.unsubscribe = a.subscribe((t) => {
|
|
116
|
+
if (t.status === "ready") {
|
|
117
|
+
let n = t;
|
|
118
|
+
_(n, e.wasmConfig), h(n), o.unsubscribe?.(), o.unsubscribe = void 0, o.status = "ready", o.readyResolve();
|
|
119
|
+
} else t.status === "error" && (o.unsubscribe?.(), o.unsubscribe = void 0, o.status = "error", o.error = t.error, o.readyReject(Error(t.error)));
|
|
120
|
+
}), await t;
|
|
121
|
+
} catch (e) {
|
|
122
|
+
o.status = "error", o.error = e instanceof Error ? e.message : "Failed to preload", o.readyReject(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to preload")), R.delete(t);
|
|
123
|
+
}
|
|
124
|
+
})(), z(t);
|
|
199
125
|
}
|
|
200
|
-
function
|
|
201
|
-
|
|
202
|
-
n.length > 0 && q({
|
|
203
|
-
...t,
|
|
204
|
-
pipelines: n
|
|
205
|
-
}).catch((s) => {
|
|
206
|
-
console.error("WASM warmup failed:", s);
|
|
207
|
-
});
|
|
126
|
+
function V(e) {
|
|
127
|
+
return R.get(e) ?? null;
|
|
208
128
|
}
|
|
209
|
-
function
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
const n = S[t];
|
|
213
|
-
n && n().catch(() => {
|
|
214
|
-
});
|
|
215
|
-
}
|
|
129
|
+
function H(e) {
|
|
130
|
+
let t = V(e);
|
|
131
|
+
return t && R.delete(e), t;
|
|
216
132
|
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
onNext: t
|
|
220
|
-
}) => {
|
|
221
|
-
const { t: n } = $();
|
|
222
|
-
return /* @__PURE__ */ a("section", { class: "IncodeUnsupportedModule", "aria-live": "polite", children: /* @__PURE__ */ a("div", { class: "IncodeUnsupportedModuleContent", children: [
|
|
223
|
-
/* @__PURE__ */ a("h2", { class: "IncodeUnsupportedModuleTitle", children: n("unsupportedModule.title", "Module not available") }),
|
|
224
|
-
/* @__PURE__ */ a("p", { class: "IncodeUnsupportedModuleMessage", children: n(
|
|
225
|
-
"unsupportedModule.message",
|
|
226
|
-
`The "${e}" module is not yet supported in this version.`
|
|
227
|
-
) }),
|
|
228
|
-
/* @__PURE__ */ a(
|
|
229
|
-
j,
|
|
230
|
-
{
|
|
231
|
-
onClick: t,
|
|
232
|
-
class: "IncodeUnsupportedModuleButton",
|
|
233
|
-
"data-testid": "unsupported-module-next-button",
|
|
234
|
-
children: n("unsupportedModule.next", "Next")
|
|
235
|
-
}
|
|
236
|
-
)
|
|
237
|
-
] }) });
|
|
238
|
-
}, g = /* @__PURE__ */ new Map();
|
|
133
|
+
//#endregion
|
|
134
|
+
//#region src/modules/flow/useFlowInitialization.ts
|
|
239
135
|
function U(e) {
|
|
240
|
-
|
|
241
|
-
if (!t)
|
|
242
|
-
throw new Error("Preload state not found");
|
|
243
|
-
return {
|
|
244
|
-
get isReady() {
|
|
245
|
-
return t.status === "ready";
|
|
246
|
-
},
|
|
247
|
-
get error() {
|
|
248
|
-
return t.status === "error" ? t.error ?? null : null;
|
|
249
|
-
},
|
|
250
|
-
async waitUntilReady() {
|
|
251
|
-
if (t.status !== "ready") {
|
|
252
|
-
if (t.status === "error")
|
|
253
|
-
throw new Error(t.error ?? "Preload failed");
|
|
254
|
-
return t.readyPromise;
|
|
255
|
-
}
|
|
256
|
-
},
|
|
257
|
-
cancel() {
|
|
258
|
-
t.status === "loading" && (t.unsubscribe && t.unsubscribe(), t.flowManager.stop(), t.readyReject(new Error("Preload cancelled")), g.delete(e));
|
|
259
|
-
}
|
|
260
|
-
};
|
|
261
|
-
}
|
|
262
|
-
function Ie(e) {
|
|
263
|
-
const { token: t } = e;
|
|
264
|
-
if (g.has(t))
|
|
265
|
-
return U(t);
|
|
266
|
-
let n, s;
|
|
267
|
-
const i = new Promise((l, p) => {
|
|
268
|
-
n = l, s = p;
|
|
269
|
-
}), r = T(), o = {
|
|
270
|
-
status: "loading",
|
|
271
|
-
flowManager: r,
|
|
272
|
-
config: e,
|
|
273
|
-
readyPromise: i,
|
|
274
|
-
readyResolve: n,
|
|
275
|
-
readyReject: s
|
|
276
|
-
};
|
|
277
|
-
return g.set(t, o), (async () => {
|
|
278
|
-
try {
|
|
279
|
-
await N({
|
|
280
|
-
apiURL: e.apiURL,
|
|
281
|
-
token: e.token,
|
|
282
|
-
lang: e.lang
|
|
283
|
-
});
|
|
284
|
-
const l = e.disableDashboardTheme ? Promise.resolve({}) : k().then((u) => {
|
|
285
|
-
o.theme = u.theme, o.uiConfig = u.uiConfig;
|
|
286
|
-
}), p = r.subscribe((u) => {
|
|
287
|
-
if (u.status === "ready") {
|
|
288
|
-
const d = u;
|
|
289
|
-
e.wasmConfig && A(d, e.wasmConfig), oe(d), o.unsubscribe?.(), o.unsubscribe = void 0, o.status = "ready", o.readyResolve();
|
|
290
|
-
} else u.status === "error" && (o.unsubscribe?.(), o.unsubscribe = void 0, o.status = "error", o.error = u.error, o.readyReject(new Error(u.error)));
|
|
291
|
-
});
|
|
292
|
-
o.unsubscribe = p, r.load(), await l;
|
|
293
|
-
} catch (l) {
|
|
294
|
-
o.status = "error", o.error = l instanceof Error ? l.message : "Failed to preload", o.readyReject(
|
|
295
|
-
l instanceof Error ? l : new Error("Failed to preload")
|
|
296
|
-
), g.delete(t);
|
|
297
|
-
}
|
|
298
|
-
})(), U(t);
|
|
299
|
-
}
|
|
300
|
-
function v(e) {
|
|
301
|
-
return g.get(e) ?? null;
|
|
302
|
-
}
|
|
303
|
-
function P(e) {
|
|
304
|
-
const t = v(e);
|
|
305
|
-
return t && g.delete(e), t;
|
|
306
|
-
}
|
|
307
|
-
function ae(e) {
|
|
308
|
-
const { apiURL: t, token: n, lang: s, disableDashboardTheme: i, onError: r } = e, o = I(null), [c, l] = x(() => {
|
|
309
|
-
const u = v(n);
|
|
310
|
-
if (u?.status === "ready") {
|
|
311
|
-
const f = P(n);
|
|
312
|
-
if (f)
|
|
313
|
-
return o.current = f.flowManager, f.uiConfig && y(f.uiConfig), { status: "ready", flowManager: f.flowManager };
|
|
314
|
-
}
|
|
315
|
-
const d = T();
|
|
316
|
-
return o.current = d, u?.status === "error" ? {
|
|
317
|
-
status: "error",
|
|
318
|
-
error: u.error ?? "Preload failed",
|
|
319
|
-
flowManager: d
|
|
320
|
-
} : { status: "initializing", flowManager: d };
|
|
321
|
-
}), p = I(!1);
|
|
322
|
-
return M(() => {
|
|
323
|
-
if (c.status !== "initializing")
|
|
324
|
-
return;
|
|
325
|
-
const u = v(n);
|
|
326
|
-
if (u?.status === "loading") {
|
|
327
|
-
u.readyPromise.then(() => {
|
|
328
|
-
const f = P(n);
|
|
329
|
-
f && (o.current = f.flowManager, f.uiConfig && y(f.uiConfig), l({ status: "ready", flowManager: f.flowManager }));
|
|
330
|
-
}).catch((f) => {
|
|
331
|
-
const h = f instanceof Error ? f.message : "Preload failed";
|
|
332
|
-
l({
|
|
333
|
-
status: "error",
|
|
334
|
-
error: h,
|
|
335
|
-
flowManager: c.flowManager
|
|
336
|
-
}), r?.(h);
|
|
337
|
-
});
|
|
338
|
-
return;
|
|
339
|
-
}
|
|
340
|
-
if (p.current)
|
|
341
|
-
return;
|
|
342
|
-
p.current = !0, (async () => {
|
|
343
|
-
try {
|
|
344
|
-
await N({ apiURL: t, token: n, lang: s });
|
|
345
|
-
const f = i ? Promise.resolve() : k().then((h) => {
|
|
346
|
-
h.uiConfig && y(h.uiConfig);
|
|
347
|
-
});
|
|
348
|
-
c.flowManager.load(), await f, l({ status: "ready", flowManager: c.flowManager });
|
|
349
|
-
} catch (f) {
|
|
350
|
-
const h = f instanceof Error ? f.message : "Failed to initialize SDK";
|
|
351
|
-
l({
|
|
352
|
-
status: "error",
|
|
353
|
-
error: h,
|
|
354
|
-
flowManager: c.flowManager
|
|
355
|
-
}), r?.(h);
|
|
356
|
-
}
|
|
357
|
-
})();
|
|
358
|
-
}, [t, n, s, i, r, c]), c;
|
|
136
|
+
e.getState().presentation.shouldPrefetchHome && g();
|
|
359
137
|
}
|
|
360
|
-
function
|
|
361
|
-
|
|
362
|
-
return M(() => {
|
|
363
|
-
if (!t) {
|
|
364
|
-
o({ status: "idle" });
|
|
365
|
-
return;
|
|
366
|
-
}
|
|
367
|
-
const c = S[t];
|
|
368
|
-
if (!c) {
|
|
369
|
-
o({ status: "unsupported", moduleKey: t });
|
|
370
|
-
return;
|
|
371
|
-
}
|
|
372
|
-
o({ status: "loading", moduleKey: t }), n?.(t);
|
|
373
|
-
let l = !1;
|
|
374
|
-
return c().then((p) => {
|
|
375
|
-
l || (o({ status: "loaded", moduleKey: t, Component: p }), s?.(t));
|
|
376
|
-
}).catch((p) => {
|
|
377
|
-
if (!l) {
|
|
378
|
-
const u = p instanceof Error ? p.message : "Failed to load module";
|
|
379
|
-
o({ status: "error", moduleKey: t, error: u }), i?.(`Failed to load ${t}: ${u}`);
|
|
380
|
-
}
|
|
381
|
-
}), () => {
|
|
382
|
-
l = !0;
|
|
383
|
-
};
|
|
384
|
-
}, [t, n, s, i]), r;
|
|
138
|
+
function W() {
|
|
139
|
+
E() === "desktop" && x();
|
|
385
140
|
}
|
|
386
|
-
function
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
141
|
+
function G(e) {
|
|
142
|
+
let { lang: n, disableDashboardTheme: r, enableHome: a, onError: s, useCPF: l } = e, u = I(e) ? e.token : void 0, d = i(null), [f, p] = o(() => {
|
|
143
|
+
let t = u ? V(u) : null;
|
|
144
|
+
if (u && t?.status === "ready") {
|
|
145
|
+
let e = H(u);
|
|
146
|
+
if (e) return d.current = e.flowManager, U(e.flowManager), W(), e.uiConfig && c(e.uiConfig), {
|
|
147
|
+
status: "ready",
|
|
148
|
+
flowManager: e.flowManager
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
let n = m({
|
|
152
|
+
authHint: e.authHint,
|
|
153
|
+
lang: e.lang,
|
|
154
|
+
enableHome: e.enableHome,
|
|
155
|
+
useCPF: e.useCPF
|
|
156
|
+
});
|
|
157
|
+
return d.current = n, U(n), W(), t?.status === "error" ? {
|
|
158
|
+
status: "error",
|
|
159
|
+
error: t.error ?? "Preload failed",
|
|
160
|
+
flowManager: n
|
|
161
|
+
} : {
|
|
162
|
+
status: "initializing",
|
|
163
|
+
flowManager: n
|
|
164
|
+
};
|
|
165
|
+
}), h = i(!1);
|
|
166
|
+
return t(() => {
|
|
167
|
+
if (f.status !== "initializing") return;
|
|
168
|
+
let t = u ? V(u) : null;
|
|
169
|
+
if (u && t?.status === "loading") {
|
|
170
|
+
t.readyPromise.then(() => {
|
|
171
|
+
let e = H(u);
|
|
172
|
+
e && (d.current = e.flowManager, U(e.flowManager), W(), e.uiConfig && c(e.uiConfig), p({
|
|
173
|
+
status: "ready",
|
|
174
|
+
flowManager: e.flowManager
|
|
175
|
+
}));
|
|
176
|
+
}).catch((e) => {
|
|
177
|
+
let t = e instanceof Error ? e.message : "Preload failed", n = e instanceof O ? e.status : void 0;
|
|
178
|
+
p({
|
|
179
|
+
status: "error",
|
|
180
|
+
error: t,
|
|
181
|
+
errorCode: n,
|
|
182
|
+
flowManager: f.flowManager
|
|
183
|
+
}), s?.(t, n);
|
|
184
|
+
});
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
if (h.current) return;
|
|
188
|
+
h.current = !0;
|
|
189
|
+
let i = new AbortController(), { signal: a } = i;
|
|
190
|
+
return (async () => {
|
|
191
|
+
try {
|
|
192
|
+
let t;
|
|
193
|
+
if (I(e)) t = e.token, e.urlUuid && await A({
|
|
194
|
+
urlUuid: e.urlUuid,
|
|
195
|
+
onboardingId: null,
|
|
196
|
+
onRefreshed: e.onUrlUuidRefreshed
|
|
197
|
+
}, a);
|
|
198
|
+
else if (L(e)) t = (await F(e, a)).token;
|
|
199
|
+
else throw Error("Flow requires token, or configurationId with apiKey or clientId");
|
|
200
|
+
await T({
|
|
201
|
+
token: t,
|
|
202
|
+
lang: n,
|
|
203
|
+
flowManager: f.flowManager
|
|
204
|
+
});
|
|
205
|
+
let i = r ? Promise.resolve() : v().then((e) => {
|
|
206
|
+
e.uiConfig && c(e.uiConfig);
|
|
207
|
+
}), o = f.flowManager.waitForReady();
|
|
208
|
+
await Promise.all([o, i]), p({
|
|
209
|
+
status: "ready",
|
|
210
|
+
flowManager: f.flowManager
|
|
211
|
+
});
|
|
212
|
+
} catch (e) {
|
|
213
|
+
if (a.aborted) return;
|
|
214
|
+
let t = e instanceof Error ? e.message : "Failed to initialize SDK", n = e instanceof O ? e.status : void 0;
|
|
215
|
+
p({
|
|
216
|
+
status: "error",
|
|
217
|
+
error: t,
|
|
218
|
+
errorCode: n,
|
|
219
|
+
flowManager: f.flowManager
|
|
220
|
+
}), s?.(t, n);
|
|
221
|
+
}
|
|
222
|
+
})(), () => i.abort();
|
|
223
|
+
}, [
|
|
224
|
+
u,
|
|
225
|
+
n,
|
|
226
|
+
r,
|
|
227
|
+
a,
|
|
228
|
+
l,
|
|
229
|
+
s,
|
|
230
|
+
e,
|
|
231
|
+
f
|
|
232
|
+
]), f;
|
|
400
233
|
}
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
}
|
|
234
|
+
//#endregion
|
|
235
|
+
//#region src/modules/flow/flow.tsx
|
|
236
|
+
var K = n(() => import("../homeScreen-DnP1jw9A.js").then((e) => ({ default: e.HomeScreen }))), q = ({ config: n, onFinish: i, onError: o }) => {
|
|
237
|
+
let { i18n: c } = e(), u = G(r(() => ({
|
|
238
|
+
...n,
|
|
239
|
+
onError: o
|
|
240
|
+
}), [n, o])), [f, m] = l(() => u.flowManager, { autoLoad: !1 }), h = f.presentation.lazyModuleKey, v = f.status === "ready" ? f.currentStep : void 0, x = w({
|
|
241
|
+
moduleKey: h,
|
|
242
|
+
modules: C,
|
|
243
|
+
onModuleLoading: n.onModuleLoading,
|
|
244
|
+
onModuleLoaded: n.onModuleLoaded,
|
|
245
|
+
onError: o
|
|
246
|
+
});
|
|
247
|
+
y({
|
|
248
|
+
moduleKey: f.status === "ready" && f.homeScreen.visible ? v : void 0,
|
|
249
|
+
modules: C
|
|
250
|
+
});
|
|
251
|
+
let T = x.status === "loaded", E = n.enableHome === !0 && f.status === "ready" && f.flow.disableLaunchScreen !== !0 && f.currentStepIndex === 0 && f.homeScreen.visible === !1 && x.status === "loading", O = j(f.presentation.isAwaitingReady === !0, 150), k = j(f.status === "ready" && (x.status === "idle" || x.status === "loading" || x.status === "error"), 150);
|
|
252
|
+
S(f?.status === "ready" ? f.steps : [], f?.status === "ready" ? f.currentStepIndex : -1, C, T), t(() => {
|
|
253
|
+
if (n.onFlowEvent) return m.subscribeFlowEvent(n.onFlowEvent);
|
|
254
|
+
}, [m, n.onFlowEvent]), t(() => {
|
|
255
|
+
f.presentation.shouldPrefetchHome && g();
|
|
256
|
+
}, [f.presentation.shouldPrefetchHome]), t(() => {
|
|
257
|
+
n.lang && c.language !== n.lang && c.changeLanguage(n.lang);
|
|
258
|
+
}, [n.lang, c]), t(() => {
|
|
259
|
+
if (f?.status !== "ready" || f.currentStep === "REDIRECT_TO_MOBILE") return;
|
|
260
|
+
let e = f, t = D(e.flow);
|
|
261
|
+
t.length > 0 && (n.onWasmWarmup?.(t), _(e, n.wasmConfig));
|
|
262
|
+
}, [f, n]), t(() => {
|
|
263
|
+
f?.status === "finished" && i(f.finishStatus);
|
|
264
|
+
}, [
|
|
265
|
+
f?.status,
|
|
266
|
+
i,
|
|
267
|
+
f
|
|
268
|
+
]), t(() => {
|
|
269
|
+
f?.status === "error" && o && o(f.error, f.errorCode);
|
|
270
|
+
}, [
|
|
271
|
+
f?.status,
|
|
272
|
+
o,
|
|
273
|
+
f
|
|
274
|
+
]), t(() => {
|
|
275
|
+
f?.status === "ready" && f.currentStep === "ID" && f.steps.includes("TUTORIAL_ID") && m.completeModule();
|
|
276
|
+
}, [f, m]);
|
|
277
|
+
let A = !(n.spinnerConfig?.title || n.spinnerConfig?.subtitle);
|
|
278
|
+
if (u.status === "error") return /* @__PURE__ */ s("div", {
|
|
279
|
+
class: "IncodeFlow",
|
|
280
|
+
children: /* @__PURE__ */ s("div", { children: ["Error: ", u.error] })
|
|
281
|
+
});
|
|
282
|
+
if (f.homeScreen.visible || E) return /* @__PURE__ */ s("div", {
|
|
283
|
+
class: "IncodeFlow",
|
|
284
|
+
children: /* @__PURE__ */ s(a, {
|
|
285
|
+
fallback: null,
|
|
286
|
+
children: /* @__PURE__ */ s(K, {
|
|
287
|
+
isContinueLoading: f.homeScreen.isContinueLoading || E,
|
|
288
|
+
onContinue: () => m.continueFromHome()
|
|
289
|
+
})
|
|
290
|
+
})
|
|
291
|
+
});
|
|
292
|
+
if (u.status === "initializing") return /* @__PURE__ */ s("div", {
|
|
293
|
+
class: "IncodeFlow",
|
|
294
|
+
children: /* @__PURE__ */ s(d, {
|
|
295
|
+
spinnerConfig: n.spinnerConfig,
|
|
296
|
+
hideText: A
|
|
297
|
+
})
|
|
298
|
+
});
|
|
299
|
+
if (f.presentation.isAwaitingReady) return O ? /* @__PURE__ */ s("div", {
|
|
300
|
+
class: "IncodeFlow",
|
|
301
|
+
children: /* @__PURE__ */ s(d, {
|
|
302
|
+
spinnerConfig: n.spinnerConfig,
|
|
303
|
+
hideText: A
|
|
304
|
+
})
|
|
305
|
+
}) : /* @__PURE__ */ s("div", { class: "IncodeFlow" });
|
|
306
|
+
if (f.status === "error") return /* @__PURE__ */ s("div", {
|
|
307
|
+
class: "IncodeFlow",
|
|
308
|
+
children: /* @__PURE__ */ s("div", { children: ["Error: ", f.error] })
|
|
309
|
+
});
|
|
310
|
+
if (f.status === "finished") return null;
|
|
311
|
+
if (f?.status === "ready") {
|
|
312
|
+
let { currentStep: e, config: t, flow: r } = f, { flowId: i } = r;
|
|
313
|
+
if (!e || !t) return /* @__PURE__ */ s("div", {
|
|
314
|
+
class: "IncodeFlow",
|
|
315
|
+
children: /* @__PURE__ */ s(d, {
|
|
316
|
+
spinnerConfig: n.spinnerConfig,
|
|
317
|
+
hideText: A
|
|
318
|
+
})
|
|
319
|
+
});
|
|
320
|
+
if (b.has(e)) return /* @__PURE__ */ s("div", { class: "IncodeFlow" });
|
|
321
|
+
if (x.status === "unsupported") return /* @__PURE__ */ s("div", {
|
|
322
|
+
class: "IncodeFlow",
|
|
323
|
+
children: /* @__PURE__ */ s(p, {
|
|
324
|
+
moduleKey: e,
|
|
325
|
+
onNext: () => m.completeModule()
|
|
326
|
+
})
|
|
327
|
+
});
|
|
328
|
+
if (x.status === "idle" || x.status === "loading" || x.status === "error") return k ? /* @__PURE__ */ s("div", {
|
|
329
|
+
class: "IncodeFlow",
|
|
330
|
+
children: /* @__PURE__ */ s(d, {
|
|
331
|
+
spinnerConfig: n.spinnerConfig,
|
|
332
|
+
hideText: A
|
|
333
|
+
})
|
|
334
|
+
}) : /* @__PURE__ */ s("div", { class: "IncodeFlow" });
|
|
335
|
+
let { Component: a } = x;
|
|
336
|
+
if (e === "REDIRECT_TO_MOBILE") return /* @__PURE__ */ s("div", {
|
|
337
|
+
class: "IncodeFlow",
|
|
338
|
+
children: /* @__PURE__ */ s(a, {
|
|
339
|
+
config: t,
|
|
340
|
+
onFinish: () => m.completeFlow(),
|
|
341
|
+
onContinue: () => m.completeModule(),
|
|
342
|
+
onError: o
|
|
343
|
+
}, `redirect-to-mobile-${f.currentStepIndex}`)
|
|
344
|
+
});
|
|
345
|
+
if (e === "SELFIE") return /* @__PURE__ */ s("div", {
|
|
346
|
+
class: "IncodeFlow",
|
|
347
|
+
children: /* @__PURE__ */ s(a, {
|
|
348
|
+
config: t,
|
|
349
|
+
onFinish: () => m.completeModule(),
|
|
350
|
+
onError: (e) => {
|
|
351
|
+
o?.(e ?? "Selfie verification error");
|
|
352
|
+
}
|
|
353
|
+
}, `selfie-${f.currentStepIndex}`)
|
|
354
|
+
});
|
|
355
|
+
if (e === "AUTHENTICATION") return /* @__PURE__ */ s("div", {
|
|
356
|
+
class: "IncodeFlow",
|
|
357
|
+
children: /* @__PURE__ */ s(a, {
|
|
358
|
+
config: {
|
|
359
|
+
...t,
|
|
360
|
+
authHint: n.authHint
|
|
361
|
+
},
|
|
362
|
+
onFinish: () => m.completeModule(),
|
|
363
|
+
onError: (e) => {
|
|
364
|
+
o?.(e ?? "Authentication error");
|
|
365
|
+
}
|
|
366
|
+
}, `authentication-${f.currentStepIndex}`)
|
|
367
|
+
});
|
|
368
|
+
if (e === "PHONE") return /* @__PURE__ */ s("div", {
|
|
369
|
+
class: "IncodeFlow",
|
|
370
|
+
children: /* @__PURE__ */ s(a, {
|
|
371
|
+
config: t,
|
|
372
|
+
onFinish: () => m.completeModule(),
|
|
373
|
+
onError: (e) => {
|
|
374
|
+
o?.(e ?? "Phone verification error");
|
|
375
|
+
}
|
|
376
|
+
}, `phone-${f.currentStepIndex}`)
|
|
377
|
+
});
|
|
378
|
+
if (e === "EMAIL") {
|
|
379
|
+
let e = t;
|
|
380
|
+
return !e || typeof e.otpVerification != "boolean" || typeof e.otpExpirationInMinutes != "number" ? /* @__PURE__ */ s("div", {
|
|
381
|
+
class: "IncodeFlow",
|
|
382
|
+
children: /* @__PURE__ */ s("div", { children: "Error: Invalid email configuration" })
|
|
383
|
+
}) : /* @__PURE__ */ s("div", {
|
|
384
|
+
class: "IncodeFlow",
|
|
385
|
+
children: /* @__PURE__ */ s(a, {
|
|
386
|
+
config: e,
|
|
387
|
+
onFinish: () => m.completeModule(),
|
|
388
|
+
onError: (e) => {
|
|
389
|
+
o?.(e ?? "Email verification error");
|
|
390
|
+
}
|
|
391
|
+
}, `email-${f.currentStepIndex}`)
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
if (e === "ID" || e === "SECOND_ID") {
|
|
395
|
+
let n = t;
|
|
396
|
+
return /* @__PURE__ */ s("div", {
|
|
397
|
+
class: "IncodeFlow",
|
|
398
|
+
children: /* @__PURE__ */ s(a, {
|
|
399
|
+
config: e === "SECOND_ID" ? {
|
|
400
|
+
...n,
|
|
401
|
+
isSecondId: !0
|
|
402
|
+
} : n,
|
|
403
|
+
onFinish: () => m.completeModule(),
|
|
404
|
+
onError: (e) => {
|
|
405
|
+
o?.(e ?? "ID capture error");
|
|
406
|
+
}
|
|
407
|
+
}, `id-${f.currentStepIndex}`)
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
if (e === "ID_OCR") {
|
|
411
|
+
let e = t, n = f.steps.includes("SECOND_ID");
|
|
412
|
+
return /* @__PURE__ */ s("div", {
|
|
413
|
+
class: "IncodeFlow",
|
|
414
|
+
children: /* @__PURE__ */ s(a, {
|
|
415
|
+
config: {
|
|
416
|
+
...e,
|
|
417
|
+
secondId: e.secondId ?? n,
|
|
418
|
+
flowId: i
|
|
419
|
+
},
|
|
420
|
+
onFinish: () => m.completeModule(),
|
|
421
|
+
onError: (e) => {
|
|
422
|
+
o?.(e ?? "ID OCR error");
|
|
423
|
+
}
|
|
424
|
+
}, `id-ocr-${f.currentStepIndex}`)
|
|
425
|
+
});
|
|
426
|
+
}
|
|
427
|
+
if (e === "CPF_OCR") return /* @__PURE__ */ s("div", {
|
|
428
|
+
class: "IncodeFlow",
|
|
429
|
+
children: /* @__PURE__ */ s(a, {
|
|
430
|
+
onFinish: () => m.completeModule(),
|
|
431
|
+
onError: (e) => {
|
|
432
|
+
o?.(e ?? "CPF OCR error");
|
|
433
|
+
}
|
|
434
|
+
}, `cpf-ocr-${f.currentStepIndex}`)
|
|
435
|
+
});
|
|
436
|
+
if (e === "FACE_MATCH") return /* @__PURE__ */ s("div", {
|
|
437
|
+
class: "IncodeFlow",
|
|
438
|
+
children: /* @__PURE__ */ s(a, {
|
|
439
|
+
config: t,
|
|
440
|
+
onFinish: () => m.completeModule(),
|
|
441
|
+
onError: (e) => {
|
|
442
|
+
o?.(e ?? "Face match error");
|
|
443
|
+
}
|
|
444
|
+
}, `face-match-${f.currentStepIndex}`)
|
|
445
|
+
});
|
|
446
|
+
if (e === "CURP_VALIDATION") return /* @__PURE__ */ s("div", {
|
|
447
|
+
class: "IncodeFlow",
|
|
448
|
+
children: /* @__PURE__ */ s(a, {
|
|
449
|
+
config: t,
|
|
450
|
+
onFinish: () => m.completeModule(),
|
|
451
|
+
onError: (e) => {
|
|
452
|
+
o?.(e ?? "CURP validation error");
|
|
453
|
+
}
|
|
454
|
+
}, `curp-validation-${f.currentStepIndex}`)
|
|
455
|
+
});
|
|
456
|
+
if (e === "GOVT_VALIDATION_PROVISIONING") return /* @__PURE__ */ s("div", {
|
|
457
|
+
class: "IncodeFlow",
|
|
458
|
+
children: /* @__PURE__ */ s(a, {
|
|
459
|
+
config: t,
|
|
460
|
+
onFinish: () => m.completeModule(),
|
|
461
|
+
onError: (e) => {
|
|
462
|
+
o?.(e ?? "Government validation error");
|
|
463
|
+
}
|
|
464
|
+
}, `govt-validation-${f.currentStepIndex}`)
|
|
465
|
+
});
|
|
466
|
+
if (e === "GEOLOCATION") return /* @__PURE__ */ s("div", {
|
|
467
|
+
class: "IncodeFlow",
|
|
468
|
+
children: /* @__PURE__ */ s(a, {
|
|
469
|
+
config: t,
|
|
470
|
+
onFinish: () => m.completeModule(),
|
|
471
|
+
onError: (e) => {
|
|
472
|
+
o?.(e ?? "Geolocation error");
|
|
473
|
+
}
|
|
474
|
+
}, `geolocation-${f.currentStepIndex}`)
|
|
475
|
+
});
|
|
476
|
+
if (e === "EXTERNAL_VERIFICATION") return /* @__PURE__ */ s("div", {
|
|
477
|
+
class: "IncodeFlow",
|
|
478
|
+
children: /* @__PURE__ */ s(a, {
|
|
479
|
+
config: { flowId: f.flow.flowId },
|
|
480
|
+
onFinish: () => m.completeModule(),
|
|
481
|
+
onError: (e) => {
|
|
482
|
+
o?.(e ?? "External verification error");
|
|
483
|
+
}
|
|
484
|
+
}, `ekyc-${f.currentStepIndex}`)
|
|
485
|
+
});
|
|
486
|
+
if (e === "DOCUMENT_CAPTURE") return /* @__PURE__ */ s("div", {
|
|
487
|
+
class: "IncodeFlow",
|
|
488
|
+
children: /* @__PURE__ */ s(a, {
|
|
489
|
+
config: t,
|
|
490
|
+
onFinish: () => m.completeModule(),
|
|
491
|
+
onError: (e) => {
|
|
492
|
+
o?.(e ?? "Document capture error");
|
|
493
|
+
}
|
|
494
|
+
}, `document-capture-${f.currentStepIndex}`)
|
|
495
|
+
});
|
|
496
|
+
if (e === "ADDRESS") return /* @__PURE__ */ s("div", {
|
|
497
|
+
class: "IncodeFlow",
|
|
498
|
+
children: /* @__PURE__ */ s(a, {
|
|
499
|
+
config: {
|
|
500
|
+
...t,
|
|
501
|
+
processingType: "addressStatement"
|
|
502
|
+
},
|
|
503
|
+
onFinish: () => m.completeModule(),
|
|
504
|
+
onError: (e) => {
|
|
505
|
+
o?.(e ?? "Address capture error");
|
|
506
|
+
}
|
|
507
|
+
}, `address-${f.currentStepIndex}`)
|
|
508
|
+
});
|
|
509
|
+
if (e === "SIGNATURE") return /* @__PURE__ */ s("div", {
|
|
510
|
+
class: "IncodeFlow",
|
|
511
|
+
children: /* @__PURE__ */ s(a, {
|
|
512
|
+
config: t,
|
|
513
|
+
onFinish: () => m.completeModule(),
|
|
514
|
+
onError: (e) => {
|
|
515
|
+
o?.(e ?? "Signature capture error");
|
|
516
|
+
}
|
|
517
|
+
}, `signature-${f.currentStepIndex}`)
|
|
518
|
+
});
|
|
519
|
+
if (e === "EKYB") {
|
|
520
|
+
let e = t;
|
|
521
|
+
return /* @__PURE__ */ s("div", {
|
|
522
|
+
class: "IncodeFlow",
|
|
523
|
+
children: /* @__PURE__ */ s(a, {
|
|
524
|
+
config: {
|
|
525
|
+
flowId: i,
|
|
526
|
+
checkBusinessName: e.checkBusinessName,
|
|
527
|
+
checkAddress: e.checkAddress,
|
|
528
|
+
checkTaxId: e.checkTaxId,
|
|
529
|
+
checkUniqueBeneficialOwner: e.checkUniqueBeneficialOwner
|
|
530
|
+
},
|
|
531
|
+
onFinish: () => m.completeModule(),
|
|
532
|
+
onError: (e) => {
|
|
533
|
+
o?.(e ?? "eKYB verification error");
|
|
534
|
+
}
|
|
535
|
+
}, `ekyb-${f.currentStepIndex}`)
|
|
536
|
+
});
|
|
537
|
+
}
|
|
538
|
+
if (e === "COMBINED_CONSENT") return /* @__PURE__ */ s("div", {
|
|
539
|
+
class: "IncodeFlow",
|
|
540
|
+
children: /* @__PURE__ */ s(a, {
|
|
541
|
+
config: t,
|
|
542
|
+
onFinish: () => m.completeModule(),
|
|
543
|
+
onError: (e) => {
|
|
544
|
+
o?.(e ?? "Combined consent error");
|
|
545
|
+
}
|
|
546
|
+
}, `combined-consent-${f.currentStepIndex}`)
|
|
547
|
+
});
|
|
548
|
+
if (e === "MANDATORY_CONSENT") return /* @__PURE__ */ s("div", {
|
|
549
|
+
class: "IncodeFlow",
|
|
550
|
+
children: /* @__PURE__ */ s(a, {
|
|
551
|
+
config: t,
|
|
552
|
+
onFinish: () => m.completeModule(),
|
|
553
|
+
onError: (e) => {
|
|
554
|
+
o?.(e ?? "Mandatory consent error");
|
|
555
|
+
}
|
|
556
|
+
}, `mandatory-consent-${f.currentStepIndex}`)
|
|
557
|
+
});
|
|
558
|
+
if (e === "AE_SIGNATURE" || e === "QE_SIGNATURE") {
|
|
559
|
+
let n = t, r = e === "QE_SIGNATURE" ? "qe" : "ae";
|
|
560
|
+
return /* @__PURE__ */ s("div", {
|
|
561
|
+
class: "IncodeFlow",
|
|
562
|
+
children: /* @__PURE__ */ s(a, {
|
|
563
|
+
config: {
|
|
564
|
+
uploadDocument: n.uploadDocument,
|
|
565
|
+
downloadDocument: n.downloadDocument
|
|
566
|
+
},
|
|
567
|
+
onFinish: () => m.completeModule(),
|
|
568
|
+
onError: (e) => {
|
|
569
|
+
o?.(e ?? `${r.toUpperCase()} Signature error`);
|
|
570
|
+
}
|
|
571
|
+
}, `${r}-signature-${f.currentStepIndex}`)
|
|
572
|
+
});
|
|
573
|
+
}
|
|
574
|
+
if (e === "ANTIFRAUD") return /* @__PURE__ */ s("div", {
|
|
575
|
+
class: "IncodeFlow",
|
|
576
|
+
children: /* @__PURE__ */ s(a, {
|
|
577
|
+
onFinish: () => m.completeModule(),
|
|
578
|
+
onError: (e) => {
|
|
579
|
+
o?.(e ?? "Antifraud check error");
|
|
580
|
+
}
|
|
581
|
+
}, `antifraud-${f.currentStepIndex}`)
|
|
582
|
+
});
|
|
583
|
+
if (e === "CUSTOM_FIELDS") return /* @__PURE__ */ s("div", {
|
|
584
|
+
class: "IncodeFlow",
|
|
585
|
+
children: /* @__PURE__ */ s(a, {
|
|
586
|
+
config: t,
|
|
587
|
+
onFinish: () => m.completeModule(),
|
|
588
|
+
onError: (e) => {
|
|
589
|
+
o?.(e ?? "Custom fields error");
|
|
590
|
+
}
|
|
591
|
+
}, `custom-fields-${f.currentStepIndex}`)
|
|
592
|
+
});
|
|
593
|
+
if (e === "WATCHLIST") return /* @__PURE__ */ s("div", {
|
|
594
|
+
class: "IncodeFlow",
|
|
595
|
+
children: /* @__PURE__ */ s(a, {
|
|
596
|
+
onFinish: () => m.completeModule(),
|
|
597
|
+
onError: (e) => {
|
|
598
|
+
o?.(e ?? "Watchlist check error");
|
|
599
|
+
}
|
|
600
|
+
}, `watchlist-${f.currentStepIndex}`)
|
|
601
|
+
});
|
|
602
|
+
if (e === "WATCHLIST_BUSINESS") return /* @__PURE__ */ s("div", {
|
|
603
|
+
class: "IncodeFlow",
|
|
604
|
+
children: /* @__PURE__ */ s(a, {
|
|
605
|
+
onFinish: () => m.completeModule(),
|
|
606
|
+
onError: (e) => {
|
|
607
|
+
o?.(e ?? "Watchlist for business check error");
|
|
608
|
+
}
|
|
609
|
+
}, `watchlist-for-business-${f.currentStepIndex}`)
|
|
610
|
+
});
|
|
611
|
+
if (e === "INCODE_WATCHLIST") return /* @__PURE__ */ s("div", {
|
|
612
|
+
class: "IncodeFlow",
|
|
613
|
+
children: /* @__PURE__ */ s(a, {
|
|
614
|
+
config: t,
|
|
615
|
+
onFinish: () => m.completeModule(),
|
|
616
|
+
onError: (e) => {
|
|
617
|
+
o?.(e ?? "Custom watchlist check error");
|
|
618
|
+
}
|
|
619
|
+
}, `incode-watchlist-${f.currentStepIndex}`)
|
|
620
|
+
});
|
|
621
|
+
if (e === "CROSS_DOCUMENT_DATA_MATCH") return /* @__PURE__ */ s("div", {
|
|
622
|
+
class: "IncodeFlow",
|
|
623
|
+
children: /* @__PURE__ */ s(a, {
|
|
624
|
+
onFinish: () => m.completeModule(),
|
|
625
|
+
onError: (e) => {
|
|
626
|
+
o?.(e ?? "Cross document data match error");
|
|
627
|
+
}
|
|
628
|
+
}, `cross-document-data-match-${f.currentStepIndex}`)
|
|
629
|
+
});
|
|
630
|
+
if (e === "DYNAMIC_FORMS") return /* @__PURE__ */ s("div", {
|
|
631
|
+
class: "IncodeFlow",
|
|
632
|
+
children: /* @__PURE__ */ s(a, {
|
|
633
|
+
config: { screens: t.screens.map((e) => ({
|
|
634
|
+
title: e.title,
|
|
635
|
+
hideTitle: e.hideTitle,
|
|
636
|
+
questions: e.questions.map((e) => ({
|
|
637
|
+
questionId: e.questionId,
|
|
638
|
+
question: e.question,
|
|
639
|
+
inputType: e.inputType,
|
|
640
|
+
isOptional: e.isOptional,
|
|
641
|
+
overrides: e.overrides ?? void 0,
|
|
642
|
+
isPredefined: e.isPredefined,
|
|
643
|
+
options: e.options
|
|
644
|
+
}))
|
|
645
|
+
})) },
|
|
646
|
+
onFinish: () => m.completeModule(),
|
|
647
|
+
onError: (e) => {
|
|
648
|
+
o?.(e ?? "Dynamic forms error");
|
|
649
|
+
}
|
|
650
|
+
}, `dynamic-forms-${f.currentStepIndex}`)
|
|
651
|
+
});
|
|
652
|
+
}
|
|
653
|
+
return null;
|
|
654
|
+
}, J = ({ config: e, onFinish: t = () => {}, onError: n }) => /* @__PURE__ */ s(u, { children: e ? /* @__PURE__ */ s(q, {
|
|
655
|
+
config: e,
|
|
656
|
+
onFinish: t,
|
|
657
|
+
onError: n
|
|
658
|
+
}) : null });
|
|
659
|
+
f(J, "incode-flow");
|
|
660
|
+
//#endregion
|
|
661
|
+
export { J as IncodeFlow, B as preloadIncodeFlow };
|