@incodetech/web 0.0.0-dev-20260311-e1ad562 → 0.0.0-dev-20260311-e7ef89b
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/{Trans-CrErI8VP.js → Trans-BnPbhF6c.js} +1 -1
- package/dist/authentication/authentication.es.js +3 -3
- package/dist/base.css +0 -8
- package/dist/{baseTutorial-aGGpS1V_.js → baseTutorial-Bn8cRFCG.js} +6 -6
- package/dist/{captureFooter-BVLebxk_.js → captureFooter-qhkTSzDA.js} +1 -1
- package/dist/{chevronDown-DL5WsjxS.js → chevronDown-BZNPUs4a.js} +1 -1
- package/dist/{closeIcon-DmhdnnpJ.js → closeIcon-B5HxSoNj.js} +1 -1
- package/dist/curp-validation/curp-validation.es.js +6 -6
- package/dist/{dateInputComposed-BvBQiMdN.js → dateInputComposed-Badm2Tzx.js} +2 -2
- package/dist/document-capture/styles.css +2 -1
- package/dist/{documentCapture-C3vAq9ev.js → documentCapture-ChFrtfzB.js} +6 -6
- package/dist/{dropdownComposed-BjDHcYMb.js → dropdownComposed-DgA0fNAh.js} +4 -4
- package/dist/{ekybModule-DTkcoFN0.js → ekybModule-C0QO-CSj.js} +4 -4
- package/dist/{ekycModule-D5EJaj53.js → ekycModule-DlnEKSR8.js} +5 -5
- package/dist/email/email.es.js +3 -3
- package/dist/{errorContent-CiicsyRN.js → errorContent-BMXamgg9.js} +4 -4
- package/dist/{faceMatch-CiZ8QEzy.js → faceMatch-DXcWwP9u.js} +2 -2
- package/dist/flow/flow.es.js +136 -151
- package/dist/flow/styles.css +4 -3
- package/dist/geolocation/geolocation.es.js +3 -3
- package/dist/governmentValidation/governmentValidation.es.js +6 -6
- package/dist/id/id.es.js +6 -6
- package/dist/id/styles.css +2 -2
- package/dist/{incodeModule-DAveRAyZ.js → incodeModule-7zNv7YeX.js} +0 -3
- package/dist/{otpInput-CoMOmDGR.js → otpInput-DWZ7I1PN.js} +1 -1
- package/dist/{page-CcgnVEBJ.js → page-Bdz8JP3P.js} +1 -1
- package/dist/phone/phone.es.js +4 -4
- package/dist/{processing-C-wThMBe.js → processing-D6kl543t.js} +2 -2
- package/dist/selfie/selfie.es.js +4 -4
- package/dist/{spinner-IY4lPK0V.js → spinner-BknkxcID.js} +1 -1
- package/dist/{successIcon-BXW0lXvd.js → successIcon-BPe0Wymn.js} +1 -1
- package/dist/themes/dark.css +45 -37
- package/dist/themes/light.css +37 -29
- package/dist/{tutorial-DA8R46NX.js → tutorial-BLmXLzBL.js} +42 -36
- package/dist/{verificationResult-B51cgPGU.js → verificationResult-DNP30nAT.js} +5 -5
- package/dist/{warningIcon-CsSoiruR.js → warningIcon-C9TCAUlH.js} +1 -1
- package/package.json +2 -2
- package/dist/documentUpload-BBr5ijea.js +0 -102
package/dist/flow/flow.es.js
CHANGED
|
@@ -1,55 +1,54 @@
|
|
|
1
|
-
import { u as a, B as
|
|
2
|
-
import { createOrchestratedFlowManager as G, getRequiredWasmPipelines as
|
|
3
|
-
import { A as
|
|
4
|
-
import { api as
|
|
1
|
+
import { u as a, B as _, r as k, I as V, b as z, a as H } from "../incodeModule-7zNv7YeX.js";
|
|
2
|
+
import { createOrchestratedFlowManager as G, getRequiredWasmPipelines as D } from "@incodetech/core/flow";
|
|
3
|
+
import { A as y, d as N, y as g } from "../vendor-preact-DP-hbKuj.js";
|
|
4
|
+
import { api as U, warmupWasm as B } from "@incodetech/core";
|
|
5
5
|
import { s as b } from "../uiConfig-B8PUPgHY.js";
|
|
6
|
-
import { S as C } from "../spinner-
|
|
6
|
+
import { S as C } from "../spinner-BknkxcID.js";
|
|
7
7
|
import { ekybMachine as K } from "@incodetech/core/ekyb";
|
|
8
8
|
import { ekycMachine as W } from "@incodetech/core/ekyc";
|
|
9
9
|
import { emailMachine as j } from "@incodetech/core/email";
|
|
10
10
|
import { faceMatchMachine as Y } from "@incodetech/core/face-match";
|
|
11
11
|
import { geolocationMachine as X } from "@incodetech/core/geolocation";
|
|
12
12
|
import { documentCaptureMachine as S } from "@incodetech/core/document-capture";
|
|
13
|
-
import { documentUploadMachine as q } from "@incodetech/core/document-upload";
|
|
14
13
|
import { idCaptureMachine as E } from "@incodetech/core/id";
|
|
15
|
-
import { phoneMachine as
|
|
16
|
-
import { selfieMachine as
|
|
17
|
-
import { authenticationMachine as
|
|
18
|
-
import { curpValidationMachine as
|
|
19
|
-
import { governmentValidationMachine as
|
|
20
|
-
import { setup as
|
|
21
|
-
function
|
|
14
|
+
import { phoneMachine as q } from "@incodetech/core/phone";
|
|
15
|
+
import { selfieMachine as Z } from "@incodetech/core/selfie";
|
|
16
|
+
import { authenticationMachine as J } from "@incodetech/core/authentication";
|
|
17
|
+
import { curpValidationMachine as Q } from "@incodetech/core/curp-validation";
|
|
18
|
+
import { governmentValidationMachine as ee } from "@incodetech/core/government-validation";
|
|
19
|
+
import { setup as te } from "../index.es.js";
|
|
20
|
+
function ne(e) {
|
|
22
21
|
let t = e.replace("#", "");
|
|
23
22
|
t.length === 3 && (t = t.split("").map((i) => i + i).join(""));
|
|
24
23
|
const o = /^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);
|
|
25
24
|
if (!o) return null;
|
|
26
|
-
const
|
|
25
|
+
const l = Number.parseInt(o[1], 16) / 255, u = Number.parseInt(o[2], 16) / 255, n = Number.parseInt(o[3], 16) / 255, r = Math.max(l, u, n), p = Math.min(l, u, n);
|
|
27
26
|
let s = 0, f = 0;
|
|
28
27
|
const d = (r + p) / 2;
|
|
29
28
|
if (r !== p) {
|
|
30
29
|
const i = r - p;
|
|
31
30
|
switch (f = d > 0.5 ? i / (2 - r - p) : i / (r + p), r) {
|
|
32
|
-
case
|
|
31
|
+
case l:
|
|
33
32
|
s = ((u - n) / i + (u < n ? 6 : 0)) / 6;
|
|
34
33
|
break;
|
|
35
34
|
case u:
|
|
36
|
-
s = ((n -
|
|
35
|
+
s = ((n - l) / i + 2) / 6;
|
|
37
36
|
break;
|
|
38
37
|
case n:
|
|
39
|
-
s = ((
|
|
38
|
+
s = ((l - u) / i + 4) / 6;
|
|
40
39
|
break;
|
|
41
40
|
}
|
|
42
41
|
}
|
|
43
42
|
return { h: s * 360, s: f * 100, l: d * 100 };
|
|
44
43
|
}
|
|
45
44
|
function w(e, t, o) {
|
|
46
|
-
const
|
|
45
|
+
const l = e / 360, u = t / 100, n = o / 100;
|
|
47
46
|
let r, p, s;
|
|
48
47
|
if (u === 0)
|
|
49
48
|
r = p = s = n;
|
|
50
49
|
else {
|
|
51
|
-
const d = (h, M, m) => (m < 0 && (m += 1), m > 1 && (m -= 1), m < 0.16666666666666666 ? h + (M - h) * 6 * m : m < 0.5 ? M : m < 0.6666666666666666 ? h + (M - h) * (0.6666666666666666 - m) * 6 : h), i = n < 0.5 ? n * (1 + u) : n + u - n * u,
|
|
52
|
-
r = d(
|
|
50
|
+
const d = (h, M, m) => (m < 0 && (m += 1), m > 1 && (m -= 1), m < 0.16666666666666666 ? h + (M - h) * 6 * m : m < 0.5 ? M : m < 0.6666666666666666 ? h + (M - h) * (0.6666666666666666 - m) * 6 : h), i = n < 0.5 ? n * (1 + u) : n + u - n * u, c = 2 * n - i;
|
|
51
|
+
r = d(c, i, l + 1 / 3), p = d(c, i, l), s = d(c, i, l - 1 / 3);
|
|
53
52
|
}
|
|
54
53
|
const f = (d) => {
|
|
55
54
|
const i = Math.round(d * 255).toString(16);
|
|
@@ -57,8 +56,8 @@ function w(e, t, o) {
|
|
|
57
56
|
};
|
|
58
57
|
return `#${f(r)}${f(p)}${f(s)}`;
|
|
59
58
|
}
|
|
60
|
-
function
|
|
61
|
-
const t =
|
|
59
|
+
function oe(e) {
|
|
60
|
+
const t = ne(e);
|
|
62
61
|
if (!t)
|
|
63
62
|
throw new Error(`Invalid color format: ${e}`);
|
|
64
63
|
return {
|
|
@@ -71,14 +70,14 @@ function re(e) {
|
|
|
71
70
|
900: w(t.h, t.s, 20)
|
|
72
71
|
};
|
|
73
72
|
}
|
|
74
|
-
function
|
|
73
|
+
function re(e, t) {
|
|
75
74
|
if (typeof document > "u")
|
|
76
75
|
return;
|
|
77
|
-
const o =
|
|
78
|
-
let
|
|
76
|
+
const o = oe(e);
|
|
77
|
+
let l = document.getElementById(
|
|
79
78
|
"incode-theme"
|
|
80
79
|
);
|
|
81
|
-
|
|
80
|
+
l || (l = document.createElement("style"), l.id = "incode-theme", document.head.appendChild(l));
|
|
82
81
|
const u = t || "#ffffff", n = `
|
|
83
82
|
:root,
|
|
84
83
|
:host {
|
|
@@ -92,49 +91,49 @@ function ie(e, t) {
|
|
|
92
91
|
--button-primary-text-default: ${u};
|
|
93
92
|
}
|
|
94
93
|
`;
|
|
95
|
-
|
|
94
|
+
l.textContent = n;
|
|
96
95
|
}
|
|
97
|
-
async function
|
|
98
|
-
return (await
|
|
96
|
+
async function ie() {
|
|
97
|
+
return (await U.get("/omni/asset/fetch-all")).data;
|
|
99
98
|
}
|
|
100
99
|
const A = /* @__PURE__ */ new Map();
|
|
101
|
-
async function
|
|
100
|
+
async function ae(e) {
|
|
102
101
|
if (e.startsWith("data:"))
|
|
103
102
|
return e;
|
|
104
103
|
const t = A.get(e);
|
|
105
104
|
if (t)
|
|
106
105
|
return t;
|
|
107
|
-
const
|
|
106
|
+
const l = await (await fetch(e)).blob(), u = await new Promise((n, r) => {
|
|
108
107
|
const p = new FileReader();
|
|
109
|
-
p.onloadend = () => n(p.result), p.onerror = r, p.readAsDataURL(
|
|
108
|
+
p.onloadend = () => n(p.result), p.onerror = r, p.readAsDataURL(l);
|
|
110
109
|
});
|
|
111
110
|
return A.set(e, u), u;
|
|
112
111
|
}
|
|
113
|
-
async function
|
|
114
|
-
const e = await
|
|
112
|
+
async function se() {
|
|
113
|
+
const e = await ie();
|
|
115
114
|
if (!e.theme)
|
|
116
115
|
throw new Error("Theme URL not found in assets response");
|
|
117
116
|
const t = e.theme, o = t.startsWith("http://") || t.startsWith("https://");
|
|
118
|
-
let
|
|
117
|
+
let l;
|
|
119
118
|
if (o) {
|
|
120
119
|
const r = await fetch(t);
|
|
121
120
|
if (!r.ok)
|
|
122
121
|
throw new Error(`Failed to fetch theme: ${r.statusText}`);
|
|
123
|
-
|
|
122
|
+
l = await r.json();
|
|
124
123
|
} else
|
|
125
|
-
|
|
126
|
-
const u = e["logo.png"] || e["logo.svg"] || e["logo.jpg"] || e["logo.jpeg"] || e["logo.webp"] ||
|
|
124
|
+
l = (await U.get(t)).data;
|
|
125
|
+
const u = e["logo.png"] || e["logo.svg"] || e["logo.jpg"] || e["logo.jpeg"] || e["logo.webp"] || l.logo;
|
|
127
126
|
let n = u;
|
|
128
|
-
return u && (n = await
|
|
129
|
-
...
|
|
127
|
+
return u && (n = await ae(u)), {
|
|
128
|
+
...l,
|
|
130
129
|
logo: n
|
|
131
130
|
};
|
|
132
131
|
}
|
|
133
|
-
async function
|
|
134
|
-
const e = await
|
|
135
|
-
return e.main &&
|
|
132
|
+
async function le() {
|
|
133
|
+
const e = await se();
|
|
134
|
+
return e.main && re(e.main, e.buttonColor), e;
|
|
136
135
|
}
|
|
137
|
-
const T = () => import("../id/id.es.js").then((e) => e.Id),
|
|
136
|
+
const T = () => import("../id/id.es.js").then((e) => e.Id), F = {
|
|
138
137
|
PHONE: () => import("../phone/phone.es.js").then((e) => e.Phone),
|
|
139
138
|
EMAIL: () => import("../email/email.es.js").then((e) => e.Email),
|
|
140
139
|
SELFIE: () => import("../selfie/selfie.es.js").then((e) => e.Selfie),
|
|
@@ -142,36 +141,34 @@ const T = () => import("../id/id.es.js").then((e) => e.Id), y = {
|
|
|
142
141
|
ID: T,
|
|
143
142
|
TUTORIAL_ID: T,
|
|
144
143
|
SECOND_ID: T,
|
|
145
|
-
|
|
146
|
-
FACE_MATCH: () => import("../faceMatch-CiZ8QEzy.js").then((e) => e.FaceMatch),
|
|
144
|
+
FACE_MATCH: () => import("../faceMatch-DXcWwP9u.js").then((e) => e.FaceMatch),
|
|
147
145
|
CURP_VALIDATION: () => import("../curp-validation/curp-validation.es.js").then((e) => e.CurpValidation),
|
|
148
146
|
GOVT_VALIDATION_PROVISIONING: () => import("../governmentValidation/governmentValidation.es.js").then(
|
|
149
147
|
(e) => e.GovernmentValidation
|
|
150
148
|
),
|
|
151
149
|
GEOLOCATION: () => import("../geolocation/geolocation.es.js").then((e) => e.Geolocation),
|
|
152
|
-
EXTERNAL_VERIFICATION: () => import("../ekycModule-
|
|
153
|
-
EKYB: () => import("../ekybModule-
|
|
154
|
-
DOCUMENT_CAPTURE: () => import("../documentCapture-
|
|
150
|
+
EXTERNAL_VERIFICATION: () => import("../ekycModule-DlnEKSR8.js").then((e) => e.EkycModule),
|
|
151
|
+
EKYB: () => import("../ekybModule-C0QO-CSj.js").then((e) => e.EkybModule),
|
|
152
|
+
DOCUMENT_CAPTURE: () => import("../documentCapture-ChFrtfzB.js").then(
|
|
155
153
|
(e) => e.DocumentCapture
|
|
156
154
|
),
|
|
157
|
-
ADDRESS: () => import("../documentCapture-
|
|
155
|
+
ADDRESS: () => import("../documentCapture-ChFrtfzB.js").then(
|
|
158
156
|
(e) => e.DocumentCapture
|
|
159
157
|
)
|
|
160
158
|
};
|
|
161
159
|
function L() {
|
|
162
160
|
return G({
|
|
163
161
|
modules: {
|
|
164
|
-
PHONE:
|
|
162
|
+
PHONE: q,
|
|
165
163
|
EMAIL: j,
|
|
166
|
-
SELFIE:
|
|
167
|
-
AUTHENTICATION:
|
|
164
|
+
SELFIE: Z,
|
|
165
|
+
AUTHENTICATION: J,
|
|
168
166
|
ID: E,
|
|
169
167
|
TUTORIAL_ID: E,
|
|
170
168
|
SECOND_ID: E,
|
|
171
|
-
THIRD_ID: q,
|
|
172
169
|
FACE_MATCH: Y,
|
|
173
|
-
CURP_VALIDATION:
|
|
174
|
-
GOVT_VALIDATION_PROVISIONING:
|
|
170
|
+
CURP_VALIDATION: Q,
|
|
171
|
+
GOVT_VALIDATION_PROVISIONING: ee,
|
|
175
172
|
GEOLOCATION: X,
|
|
176
173
|
EXTERNAL_VERIFICATION: W,
|
|
177
174
|
EKYB: K,
|
|
@@ -181,7 +178,7 @@ function L() {
|
|
|
181
178
|
});
|
|
182
179
|
}
|
|
183
180
|
async function P(e) {
|
|
184
|
-
await
|
|
181
|
+
await te({
|
|
185
182
|
apiURL: e.apiURL,
|
|
186
183
|
token: e.token,
|
|
187
184
|
i18n: { lang: e.lang ?? "en" }
|
|
@@ -189,7 +186,7 @@ async function P(e) {
|
|
|
189
186
|
}
|
|
190
187
|
async function x() {
|
|
191
188
|
try {
|
|
192
|
-
const e = await
|
|
189
|
+
const e = await le(), t = {
|
|
193
190
|
logoSrc: e.logo,
|
|
194
191
|
hideFooterBranding: e.hideFooterBranding
|
|
195
192
|
};
|
|
@@ -198,24 +195,24 @@ async function x() {
|
|
|
198
195
|
return {};
|
|
199
196
|
}
|
|
200
197
|
}
|
|
201
|
-
function
|
|
202
|
-
const o =
|
|
198
|
+
function $(e, t) {
|
|
199
|
+
const o = D(e.flow);
|
|
203
200
|
o.length > 0 && B({
|
|
204
201
|
...t,
|
|
205
202
|
pipelines: o
|
|
206
|
-
}).catch((
|
|
207
|
-
console.error("WASM warmup failed:",
|
|
203
|
+
}).catch((l) => {
|
|
204
|
+
console.error("WASM warmup failed:", l);
|
|
208
205
|
});
|
|
209
206
|
}
|
|
210
|
-
function
|
|
207
|
+
function ce(e) {
|
|
211
208
|
const t = e.currentStep;
|
|
212
209
|
if (t) {
|
|
213
|
-
const o =
|
|
210
|
+
const o = F[t];
|
|
214
211
|
o && o().catch(() => {
|
|
215
212
|
});
|
|
216
213
|
}
|
|
217
214
|
}
|
|
218
|
-
const
|
|
215
|
+
const de = ({
|
|
219
216
|
moduleKey: e,
|
|
220
217
|
onNext: t
|
|
221
218
|
}) => /* @__PURE__ */ a("section", { class: "IncodeUnsupportedModule", "aria-live": "polite", children: /* @__PURE__ */ a("div", { class: "IncodeUnsupportedModuleContent", children: [
|
|
@@ -226,7 +223,7 @@ const ue = ({
|
|
|
226
223
|
'" module is not yet supported in this version.'
|
|
227
224
|
] }),
|
|
228
225
|
/* @__PURE__ */ a(
|
|
229
|
-
|
|
226
|
+
_,
|
|
230
227
|
{
|
|
231
228
|
onClick: t,
|
|
232
229
|
class: "IncodeUnsupportedModuleButton",
|
|
@@ -235,7 +232,7 @@ const ue = ({
|
|
|
235
232
|
}
|
|
236
233
|
)
|
|
237
234
|
] }) }), I = /* @__PURE__ */ new Map();
|
|
238
|
-
function
|
|
235
|
+
function O(e) {
|
|
239
236
|
const t = I.get(e);
|
|
240
237
|
if (!t)
|
|
241
238
|
throw new Error("Preload state not found");
|
|
@@ -258,20 +255,20 @@ function D(e) {
|
|
|
258
255
|
}
|
|
259
256
|
};
|
|
260
257
|
}
|
|
261
|
-
function
|
|
258
|
+
function Pe(e) {
|
|
262
259
|
const { token: t } = e;
|
|
263
260
|
if (I.has(t))
|
|
264
|
-
return
|
|
265
|
-
let o,
|
|
261
|
+
return O(t);
|
|
262
|
+
let o, l;
|
|
266
263
|
const u = new Promise((s, f) => {
|
|
267
|
-
o = s,
|
|
264
|
+
o = s, l = f;
|
|
268
265
|
}), n = L(), r = {
|
|
269
266
|
status: "loading",
|
|
270
267
|
flowManager: n,
|
|
271
268
|
config: e,
|
|
272
269
|
readyPromise: u,
|
|
273
270
|
readyResolve: o,
|
|
274
|
-
readyReject:
|
|
271
|
+
readyReject: l
|
|
275
272
|
};
|
|
276
273
|
return I.set(t, r), (async () => {
|
|
277
274
|
try {
|
|
@@ -285,7 +282,7 @@ function _e(e) {
|
|
|
285
282
|
}), f = n.subscribe((d) => {
|
|
286
283
|
if (d.status === "ready") {
|
|
287
284
|
const i = d;
|
|
288
|
-
e.wasmConfig &&
|
|
285
|
+
e.wasmConfig && $(i, e.wasmConfig), ce(i), r.unsubscribe?.(), r.unsubscribe = void 0, r.status = "ready", r.readyResolve();
|
|
289
286
|
} else d.status === "error" && (r.unsubscribe?.(), r.unsubscribe = void 0, r.status = "error", r.error = d.error, r.readyReject(new Error(d.error)));
|
|
290
287
|
});
|
|
291
288
|
r.unsubscribe = f, n.load(), await s;
|
|
@@ -294,7 +291,7 @@ function _e(e) {
|
|
|
294
291
|
s instanceof Error ? s : new Error("Failed to preload")
|
|
295
292
|
), I.delete(t);
|
|
296
293
|
}
|
|
297
|
-
})(),
|
|
294
|
+
})(), O(t);
|
|
298
295
|
}
|
|
299
296
|
function v(e) {
|
|
300
297
|
return I.get(e) ?? null;
|
|
@@ -303,13 +300,13 @@ function R(e) {
|
|
|
303
300
|
const t = v(e);
|
|
304
301
|
return t && I.delete(e), t;
|
|
305
302
|
}
|
|
306
|
-
function
|
|
307
|
-
const { apiURL: t, token: o, lang:
|
|
303
|
+
function ue(e) {
|
|
304
|
+
const { apiURL: t, token: o, lang: l, disableDashboardTheme: u, onError: n } = e, r = y(null), [p, s] = N(() => {
|
|
308
305
|
const d = v(o);
|
|
309
306
|
if (d?.status === "ready") {
|
|
310
|
-
const
|
|
311
|
-
if (
|
|
312
|
-
return r.current =
|
|
307
|
+
const c = R(o);
|
|
308
|
+
if (c)
|
|
309
|
+
return r.current = c.flowManager, c.uiConfig && b(c.uiConfig), { status: "ready", flowManager: c.flowManager };
|
|
313
310
|
}
|
|
314
311
|
const i = L();
|
|
315
312
|
return r.current = i, d?.status === "error" ? {
|
|
@@ -317,17 +314,17 @@ function fe(e) {
|
|
|
317
314
|
error: d.error ?? "Preload failed",
|
|
318
315
|
flowManager: i
|
|
319
316
|
} : { status: "initializing", flowManager: i };
|
|
320
|
-
}), f =
|
|
317
|
+
}), f = y(!1);
|
|
321
318
|
return g(() => {
|
|
322
319
|
if (p.status !== "initializing")
|
|
323
320
|
return;
|
|
324
321
|
const d = v(o);
|
|
325
322
|
if (d?.status === "loading") {
|
|
326
323
|
d.readyPromise.then(() => {
|
|
327
|
-
const
|
|
328
|
-
|
|
329
|
-
}).catch((
|
|
330
|
-
const h =
|
|
324
|
+
const c = R(o);
|
|
325
|
+
c && (r.current = c.flowManager, c.uiConfig && b(c.uiConfig), s({ status: "ready", flowManager: c.flowManager }));
|
|
326
|
+
}).catch((c) => {
|
|
327
|
+
const h = c instanceof Error ? c.message : "Preload failed";
|
|
331
328
|
s({
|
|
332
329
|
status: "error",
|
|
333
330
|
error: h,
|
|
@@ -340,13 +337,13 @@ function fe(e) {
|
|
|
340
337
|
return;
|
|
341
338
|
f.current = !0, (async () => {
|
|
342
339
|
try {
|
|
343
|
-
await P({ apiURL: t, token: o, lang:
|
|
344
|
-
const
|
|
340
|
+
await P({ apiURL: t, token: o, lang: l });
|
|
341
|
+
const c = u ? Promise.resolve() : x().then((h) => {
|
|
345
342
|
h.uiConfig && b(h.uiConfig);
|
|
346
343
|
});
|
|
347
|
-
p.flowManager.load(), await
|
|
348
|
-
} catch (
|
|
349
|
-
const h =
|
|
344
|
+
p.flowManager.load(), await c, s({ status: "ready", flowManager: p.flowManager });
|
|
345
|
+
} catch (c) {
|
|
346
|
+
const h = c instanceof Error ? c.message : "Failed to initialize SDK";
|
|
350
347
|
s({
|
|
351
348
|
status: "error",
|
|
352
349
|
error: h,
|
|
@@ -354,16 +351,16 @@ function fe(e) {
|
|
|
354
351
|
}), n?.(h);
|
|
355
352
|
}
|
|
356
353
|
})();
|
|
357
|
-
}, [t, o,
|
|
354
|
+
}, [t, o, l, u, n, p]), p;
|
|
358
355
|
}
|
|
359
|
-
function
|
|
360
|
-
const { moduleKey: t, onModuleLoading: o, onModuleLoaded:
|
|
356
|
+
function fe(e) {
|
|
357
|
+
const { moduleKey: t, onModuleLoading: o, onModuleLoaded: l, onError: u } = e, [n, r] = N({ status: "idle" });
|
|
361
358
|
return g(() => {
|
|
362
359
|
if (!t) {
|
|
363
360
|
r({ status: "idle" });
|
|
364
361
|
return;
|
|
365
362
|
}
|
|
366
|
-
const p =
|
|
363
|
+
const p = F[t];
|
|
367
364
|
if (!p) {
|
|
368
365
|
r({ status: "unsupported", moduleKey: t });
|
|
369
366
|
return;
|
|
@@ -371,7 +368,7 @@ function pe(e) {
|
|
|
371
368
|
r({ status: "loading", moduleKey: t }), o?.(t);
|
|
372
369
|
let s = !1;
|
|
373
370
|
return p().then((f) => {
|
|
374
|
-
s || (r({ status: "loaded", moduleKey: t, Component: f }),
|
|
371
|
+
s || (r({ status: "loaded", moduleKey: t, Component: f }), l?.(t));
|
|
375
372
|
}).catch((f) => {
|
|
376
373
|
if (!s) {
|
|
377
374
|
const d = f instanceof Error ? f.message : "Failed to load module";
|
|
@@ -380,49 +377,49 @@ function pe(e) {
|
|
|
380
377
|
}), () => {
|
|
381
378
|
s = !0;
|
|
382
379
|
};
|
|
383
|
-
}, [t, o,
|
|
380
|
+
}, [t, o, l, u]), n;
|
|
384
381
|
}
|
|
385
|
-
function
|
|
386
|
-
const o =
|
|
382
|
+
function pe(e, t) {
|
|
383
|
+
const o = y(/* @__PURE__ */ new Set());
|
|
387
384
|
g(() => {
|
|
388
385
|
if (t < e.length - 1) {
|
|
389
|
-
const
|
|
390
|
-
if (
|
|
391
|
-
o.current.add(
|
|
392
|
-
const u =
|
|
386
|
+
const l = e[t + 1];
|
|
387
|
+
if (l && !o.current.has(l)) {
|
|
388
|
+
o.current.add(l);
|
|
389
|
+
const u = F[l];
|
|
393
390
|
u && u().catch(() => {
|
|
394
|
-
o.current.delete(
|
|
391
|
+
o.current.delete(l);
|
|
395
392
|
});
|
|
396
393
|
}
|
|
397
394
|
}
|
|
398
395
|
}, [e, t]);
|
|
399
396
|
}
|
|
400
|
-
const
|
|
397
|
+
const he = ({
|
|
401
398
|
config: e,
|
|
402
399
|
onFinish: t,
|
|
403
400
|
onError: o
|
|
404
401
|
}) => {
|
|
405
|
-
const { t:
|
|
402
|
+
const { t: l } = z(), u = ue({
|
|
406
403
|
apiURL: e.apiURL,
|
|
407
404
|
token: e.token,
|
|
408
405
|
lang: e.lang,
|
|
409
406
|
disableDashboardTheme: e.disableDashboardTheme,
|
|
410
407
|
onError: o
|
|
411
|
-
}), [n, r] =
|
|
408
|
+
}), [n, r] = H(() => u.flowManager, {
|
|
412
409
|
autoLoad: !1
|
|
413
|
-
}), p =
|
|
410
|
+
}), p = fe({
|
|
414
411
|
moduleKey: n?.status === "ready" ? n.currentStep : void 0,
|
|
415
412
|
onModuleLoading: e.onModuleLoading,
|
|
416
413
|
onModuleLoaded: e.onModuleLoaded,
|
|
417
414
|
onError: o
|
|
418
415
|
});
|
|
419
|
-
if (
|
|
416
|
+
if (pe(
|
|
420
417
|
n?.status === "ready" ? n.steps : [],
|
|
421
418
|
n?.status === "ready" ? n.currentStepIndex : -1
|
|
422
419
|
), g(() => {
|
|
423
420
|
if (n?.status === "ready" && e.wasmConfig) {
|
|
424
|
-
const s = n, f =
|
|
425
|
-
f.length > 0 && (e.onWasmWarmup?.(f),
|
|
421
|
+
const s = n, f = D(s.flow);
|
|
422
|
+
f.length > 0 && (e.onWasmWarmup?.(f), $(s, e.wasmConfig));
|
|
426
423
|
}
|
|
427
424
|
}, [n, e]), g(() => {
|
|
428
425
|
n?.status === "finished" && t(n.finishStatus);
|
|
@@ -468,15 +465,15 @@ const me = ({
|
|
|
468
465
|
return /* @__PURE__ */ a("div", { class: "IncodeFlow", children: /* @__PURE__ */ a(
|
|
469
466
|
C,
|
|
470
467
|
{
|
|
471
|
-
title: e.spinnerConfig?.title ??
|
|
472
|
-
subtitle: e.spinnerConfig?.subtitle ??
|
|
468
|
+
title: e.spinnerConfig?.title ?? l("loadingCircle.hangOn"),
|
|
469
|
+
subtitle: e.spinnerConfig?.subtitle ?? l("loadingCircle.validating"),
|
|
473
470
|
size: e.spinnerConfig?.size,
|
|
474
471
|
fullScreen: !0
|
|
475
472
|
}
|
|
476
473
|
) });
|
|
477
474
|
if (p.status === "unsupported")
|
|
478
475
|
return /* @__PURE__ */ a("div", { class: "IncodeFlow", children: /* @__PURE__ */ a(
|
|
479
|
-
|
|
476
|
+
de,
|
|
480
477
|
{
|
|
481
478
|
moduleKey: s,
|
|
482
479
|
onNext: () => r.completeModule()
|
|
@@ -486,8 +483,8 @@ const me = ({
|
|
|
486
483
|
return /* @__PURE__ */ a("div", { class: "IncodeFlow", children: /* @__PURE__ */ a(
|
|
487
484
|
C,
|
|
488
485
|
{
|
|
489
|
-
title: e.spinnerConfig?.title ??
|
|
490
|
-
subtitle: e.spinnerConfig?.subtitle ??
|
|
486
|
+
title: e.spinnerConfig?.title ?? l("loadingCircle.hangOn"),
|
|
487
|
+
subtitle: e.spinnerConfig?.subtitle ?? l("loadingCircle.validating"),
|
|
491
488
|
size: e.spinnerConfig?.size,
|
|
492
489
|
fullScreen: !0
|
|
493
490
|
}
|
|
@@ -499,8 +496,8 @@ const me = ({
|
|
|
499
496
|
{
|
|
500
497
|
config: f,
|
|
501
498
|
onFinish: () => r.completeModule(),
|
|
502
|
-
onError: (
|
|
503
|
-
o?.(
|
|
499
|
+
onError: (c) => {
|
|
500
|
+
o?.(c ?? "Selfie verification error");
|
|
504
501
|
}
|
|
505
502
|
},
|
|
506
503
|
`selfie-${n.currentStepIndex}`
|
|
@@ -511,8 +508,8 @@ const me = ({
|
|
|
511
508
|
{
|
|
512
509
|
config: { ...f, authHint: e.authHint },
|
|
513
510
|
onFinish: () => r.completeModule(),
|
|
514
|
-
onError: (
|
|
515
|
-
o?.(
|
|
511
|
+
onError: (c) => {
|
|
512
|
+
o?.(c ?? "Authentication error");
|
|
516
513
|
}
|
|
517
514
|
},
|
|
518
515
|
`authentication-${n.currentStepIndex}`
|
|
@@ -523,8 +520,8 @@ const me = ({
|
|
|
523
520
|
{
|
|
524
521
|
config: f,
|
|
525
522
|
onFinish: () => r.completeModule(),
|
|
526
|
-
onError: (
|
|
527
|
-
o?.(
|
|
523
|
+
onError: (c) => {
|
|
524
|
+
o?.(c ?? "Phone verification error");
|
|
528
525
|
}
|
|
529
526
|
},
|
|
530
527
|
`phone-${n.currentStepIndex}`
|
|
@@ -539,25 +536,13 @@ const me = ({
|
|
|
539
536
|
prefill: i.prefill ?? !1
|
|
540
537
|
},
|
|
541
538
|
onFinish: () => r.completeModule(),
|
|
542
|
-
onError: (
|
|
543
|
-
o?.(
|
|
539
|
+
onError: (c) => {
|
|
540
|
+
o?.(c ?? "Email verification error");
|
|
544
541
|
}
|
|
545
542
|
},
|
|
546
543
|
`email-${n.currentStepIndex}`
|
|
547
544
|
) });
|
|
548
545
|
}
|
|
549
|
-
if (s === "THIRD_ID")
|
|
550
|
-
return /* @__PURE__ */ a("div", { class: "IncodeFlow", children: /* @__PURE__ */ a(
|
|
551
|
-
d,
|
|
552
|
-
{
|
|
553
|
-
config: f,
|
|
554
|
-
onFinish: () => r.completeModule(),
|
|
555
|
-
onError: (l) => {
|
|
556
|
-
o?.(l ?? "Document upload error");
|
|
557
|
-
}
|
|
558
|
-
},
|
|
559
|
-
`document-upload-${n.currentStepIndex}`
|
|
560
|
-
) });
|
|
561
546
|
if (s === "TUTORIAL_ID" || s === "SECOND_ID" || // Only render ID if TUTORIAL_ID doesn't exist (otherwise useEffect will skip it)
|
|
562
547
|
s === "ID" && !n.steps.includes("TUTORIAL_ID")) {
|
|
563
548
|
const i = f, h = s === "SECOND_ID" ? { ...i, isSecondId: !0 } : i;
|
|
@@ -574,14 +559,14 @@ const me = ({
|
|
|
574
559
|
) });
|
|
575
560
|
}
|
|
576
561
|
if (s === "FACE_MATCH") {
|
|
577
|
-
const i = f,
|
|
562
|
+
const i = f, c = {
|
|
578
563
|
variant: i.matchingType,
|
|
579
564
|
disableFaceMatchAnimation: i.disableFaceMatchAnimation ?? !1
|
|
580
565
|
};
|
|
581
566
|
return /* @__PURE__ */ a("div", { class: "IncodeFlow", children: /* @__PURE__ */ a(
|
|
582
567
|
d,
|
|
583
568
|
{
|
|
584
|
-
config:
|
|
569
|
+
config: c,
|
|
585
570
|
onFinish: () => r.completeModule(),
|
|
586
571
|
onError: (h) => {
|
|
587
572
|
o?.(h ?? "Face match error");
|
|
@@ -596,8 +581,8 @@ const me = ({
|
|
|
596
581
|
{
|
|
597
582
|
config: f,
|
|
598
583
|
onFinish: () => r.completeModule(),
|
|
599
|
-
onError: (
|
|
600
|
-
o?.(
|
|
584
|
+
onError: (c) => {
|
|
585
|
+
o?.(c ?? "CURP validation error");
|
|
601
586
|
}
|
|
602
587
|
},
|
|
603
588
|
`curp-validation-${n.currentStepIndex}`
|
|
@@ -608,8 +593,8 @@ const me = ({
|
|
|
608
593
|
{
|
|
609
594
|
config: f,
|
|
610
595
|
onFinish: () => r.completeModule(),
|
|
611
|
-
onError: (
|
|
612
|
-
o?.(
|
|
596
|
+
onError: (c) => {
|
|
597
|
+
o?.(c ?? "Government validation error");
|
|
613
598
|
}
|
|
614
599
|
},
|
|
615
600
|
`govt-validation-${n.currentStepIndex}`
|
|
@@ -620,8 +605,8 @@ const me = ({
|
|
|
620
605
|
{
|
|
621
606
|
config: { allowSkip: f.allowUserToSkipGeolocation },
|
|
622
607
|
onFinish: () => r.completeModule(),
|
|
623
|
-
onError: (
|
|
624
|
-
o?.(
|
|
608
|
+
onError: (c) => {
|
|
609
|
+
o?.(c ?? "Geolocation error");
|
|
625
610
|
}
|
|
626
611
|
},
|
|
627
612
|
`geolocation-${n.currentStepIndex}`
|
|
@@ -651,7 +636,7 @@ const me = ({
|
|
|
651
636
|
`document-capture-${n.currentStepIndex}`
|
|
652
637
|
) });
|
|
653
638
|
if (s === "ADDRESS") {
|
|
654
|
-
const i = f,
|
|
639
|
+
const i = f, c = {
|
|
655
640
|
processingType: "addressStatement",
|
|
656
641
|
allowSkipDocumentCapture: !i.disableSkipPoa,
|
|
657
642
|
title: i.title,
|
|
@@ -660,7 +645,7 @@ const me = ({
|
|
|
660
645
|
return /* @__PURE__ */ a("div", { class: "IncodeFlow", children: /* @__PURE__ */ a(
|
|
661
646
|
d,
|
|
662
647
|
{
|
|
663
|
-
config:
|
|
648
|
+
config: c,
|
|
664
649
|
onFinish: () => r.completeModule(),
|
|
665
650
|
onError: (h) => {
|
|
666
651
|
o?.(h ?? "Address capture error");
|
|
@@ -675,29 +660,29 @@ const me = ({
|
|
|
675
660
|
{
|
|
676
661
|
config: f,
|
|
677
662
|
onFinish: () => r.completeModule(),
|
|
678
|
-
onError: (
|
|
679
|
-
o?.(
|
|
663
|
+
onError: (c) => {
|
|
664
|
+
o?.(c ?? "eKYB verification error");
|
|
680
665
|
}
|
|
681
666
|
},
|
|
682
667
|
`ekyb-${n.currentStepIndex}`
|
|
683
668
|
) });
|
|
684
669
|
}
|
|
685
670
|
return null;
|
|
686
|
-
},
|
|
671
|
+
}, me = ({
|
|
687
672
|
config: e,
|
|
688
673
|
onFinish: t = () => {
|
|
689
674
|
},
|
|
690
675
|
onError: o
|
|
691
676
|
}) => /* @__PURE__ */ a(V, { children: e ? /* @__PURE__ */ a(
|
|
692
|
-
|
|
677
|
+
he,
|
|
693
678
|
{
|
|
694
679
|
config: e,
|
|
695
680
|
onFinish: t,
|
|
696
681
|
onError: o
|
|
697
682
|
}
|
|
698
683
|
) : null });
|
|
699
|
-
k(
|
|
684
|
+
k(me, "incode-flow");
|
|
700
685
|
export {
|
|
701
|
-
|
|
702
|
-
|
|
686
|
+
me as IncodeFlow,
|
|
687
|
+
Pe as preloadIncodeFlow
|
|
703
688
|
};
|