@incodetech/web 0.0.0-dev-20260224-e49e03c → 0.0.0-dev-20260226-4cb58f5

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.
Files changed (31) hide show
  1. package/dist/{Trans-CkYswaqC.js → Trans-Bdg0o_Cr.js} +3 -3
  2. package/dist/authentication/authentication.es.js +5 -5
  3. package/dist/base.css +62 -0
  4. package/dist/{baseTutorial-BdLJBzYE.js → baseTutorial-BgA1dpRi.js} +5 -5
  5. package/dist/{chevronDown-CU4P7j2Z.js → chevronDown-C5Kn1woB.js} +1 -1
  6. package/dist/curp-validation/curp-validation.es.js +8 -8
  7. package/dist/documentUpload-h5GfSa2m.js +102 -0
  8. package/dist/email/email.es.js +4 -4
  9. package/dist/{errorIcon-DjGwgLyL.js → errorIcon-BT7Rf4z7.js} +1 -1
  10. package/dist/{faceMatch-iEplxPox.js → faceMatch-DL5ICOMJ.js} +4 -4
  11. package/dist/flow/flow.es.js +213 -200
  12. package/dist/flow/styles.css +79 -0
  13. package/dist/geolocation/geolocation.es.js +5 -5
  14. package/dist/governmentValidation/governmentValidation.es.js +8 -8
  15. package/dist/id/id.es.js +7 -7
  16. package/dist/{incodeComponent-3T8Qyjnt.js → incodeComponent-BUltqUSz.js} +3 -3
  17. package/dist/{incodeModule-DPTWfWvu.js → incodeModule-BwGymwZT.js} +1 -1
  18. package/dist/index.es.js +2 -2
  19. package/dist/{otpInput-BZD0CPE9.js → otpInput-B7TR21xE.js} +2 -2
  20. package/dist/phone/phone.es.js +5 -5
  21. package/dist/{processing-Dnu3slQ9.js → processing-B7fzlPZl.js} +3 -3
  22. package/dist/selfie/selfie.es.js +6 -6
  23. package/dist/{setup-BhetRn4n.js → setup-CFo1IZlN.js} +2 -2
  24. package/dist/{spinner-C-EwvA9l.js → spinner-BiENeSCl.js} +2 -2
  25. package/dist/{successIcon-DV200b2L.js → successIcon-CTA9p_2h.js} +1 -1
  26. package/dist/{tutorial-DAI0vAip.js → tutorial-DGo0fw3f.js} +7 -7
  27. package/dist/types/index.d.ts +1 -11
  28. package/dist/{uiConfig-DEqynrWx.js → uiConfig-BG6lJ_HG.js} +1 -1
  29. package/dist/{useTranslation-CD9ZxEvP.js → useTranslation-Cm51-Wm-.js} +1 -1
  30. package/dist/{vendor-preact-CjD4WiuC.js → vendor-preact-CM6KQyKc.js} +73 -67
  31. package/package.json +3 -3
@@ -1,32 +1,33 @@
1
- import { u as l, B as _, r as $, a as H } from "../incodeModule-DPTWfWvu.js";
2
- import { createOrchestratedFlowManager as V, getRequiredWasmPipelines as D } from "@incodetech/core/flow";
3
- import { A as y, d as L, y as g } from "../vendor-preact-CjD4WiuC.js";
4
- import { api as R, warmupWasm as z } from "@incodetech/core";
1
+ import { u as l, B as $, r as _, a as H } from "../incodeModule-BwGymwZT.js";
2
+ import { createOrchestratedFlowManager as V, getRequiredWasmPipelines as O } from "@incodetech/core/flow";
3
+ import { A as y, d as U, y as g } from "../vendor-preact-CM6KQyKc.js";
4
+ import { api as L, warmupWasm as z } from "@incodetech/core";
5
5
  import "../instance-B-q0ZREN.js";
6
- import { u as G } from "../useTranslation-CD9ZxEvP.js";
7
- import { S as C } from "../spinner-C-EwvA9l.js";
6
+ import { u as G } from "../useTranslation-Cm51-Wm-.js";
7
+ import { S as C } from "../spinner-BiENeSCl.js";
8
8
  import { emailMachine as k } from "@incodetech/core/email";
9
9
  import { faceMatchMachine as W } from "@incodetech/core/face-match";
10
10
  import { geolocationMachine as j } from "@incodetech/core/geolocation";
11
- import { idCaptureMachine as b } from "@incodetech/core/id";
12
- import { phoneMachine as B } from "@incodetech/core/phone";
13
- import { selfieMachine as K } from "@incodetech/core/selfie";
14
- import { authenticationMachine as q } from "@incodetech/core/authentication";
15
- import { curpValidationMachine as Y } from "@incodetech/core/curp-validation";
16
- import { governmentValidationMachine as Z } from "@incodetech/core/government-validation";
17
- import { s as J } from "../setup-BhetRn4n.js";
18
- import { s as v } from "../uiConfig-DEqynrWx.js";
19
- function Q(e) {
11
+ import { documentUploadMachine as B } from "@incodetech/core/document-upload";
12
+ import { idCaptureMachine as v } from "@incodetech/core/id";
13
+ import { phoneMachine as K } from "@incodetech/core/phone";
14
+ import { selfieMachine as q } from "@incodetech/core/selfie";
15
+ import { authenticationMachine as Y } from "@incodetech/core/authentication";
16
+ import { curpValidationMachine as Z } from "@incodetech/core/curp-validation";
17
+ import { governmentValidationMachine as J } from "@incodetech/core/government-validation";
18
+ import { s as Q } from "../setup-CFo1IZlN.js";
19
+ import { s as b } from "../uiConfig-BG6lJ_HG.js";
20
+ function X(e) {
20
21
  let t = e.replace("#", "");
21
22
  t.length === 3 && (t = t.split("").map((s) => s + s).join(""));
22
- const r = /^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);
23
- if (!r) return null;
24
- const a = Number.parseInt(r[1], 16) / 255, u = Number.parseInt(r[2], 16) / 255, n = Number.parseInt(r[3], 16) / 255, o = Math.max(a, u, n), f = Math.min(a, u, n);
25
- let i = 0, h = 0;
26
- const d = (o + f) / 2;
27
- if (o !== f) {
28
- const s = o - f;
29
- switch (h = d > 0.5 ? s / (2 - o - f) : s / (o + f), o) {
23
+ const o = /^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);
24
+ if (!o) return null;
25
+ const a = Number.parseInt(o[1], 16) / 255, u = Number.parseInt(o[2], 16) / 255, n = Number.parseInt(o[3], 16) / 255, r = Math.max(a, u, n), p = Math.min(a, u, n);
26
+ let i = 0, f = 0;
27
+ const d = (r + p) / 2;
28
+ if (r !== p) {
29
+ const s = r - p;
30
+ switch (f = d > 0.5 ? s / (2 - r - p) : s / (r + p), r) {
30
31
  case a:
31
32
  i = ((u - n) / s + (u < n ? 6 : 0)) / 6;
32
33
  break;
@@ -38,25 +39,25 @@ function Q(e) {
38
39
  break;
39
40
  }
40
41
  }
41
- return { h: i * 360, s: h * 100, l: d * 100 };
42
+ return { h: i * 360, s: f * 100, l: d * 100 };
42
43
  }
43
- function w(e, t, r) {
44
- const a = e / 360, u = t / 100, n = r / 100;
45
- let o, f, i;
44
+ function w(e, t, o) {
45
+ const a = e / 360, u = t / 100, n = o / 100;
46
+ let r, p, i;
46
47
  if (u === 0)
47
- o = f = i = n;
48
+ r = p = i = n;
48
49
  else {
49
- const d = (p, M, m) => (m < 0 && (m += 1), m > 1 && (m -= 1), m < 0.16666666666666666 ? p + (M - p) * 6 * m : m < 0.5 ? M : m < 0.6666666666666666 ? p + (M - p) * (0.6666666666666666 - m) * 6 : p), s = n < 0.5 ? n * (1 + u) : n + u - n * u, c = 2 * n - s;
50
- o = d(c, s, a + 1 / 3), f = d(c, s, a), i = d(c, s, a - 1 / 3);
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), s = n < 0.5 ? n * (1 + u) : n + u - n * u, c = 2 * n - s;
51
+ r = d(c, s, a + 1 / 3), p = d(c, s, a), i = d(c, s, a - 1 / 3);
51
52
  }
52
- const h = (d) => {
53
+ const f = (d) => {
53
54
  const s = Math.round(d * 255).toString(16);
54
55
  return s.length === 1 ? `0${s}` : s;
55
56
  };
56
- return `#${h(o)}${h(f)}${h(i)}`;
57
+ return `#${f(r)}${f(p)}${f(i)}`;
57
58
  }
58
- function X(e) {
59
- const t = Q(e);
59
+ function ee(e) {
60
+ const t = X(e);
60
61
  if (!t)
61
62
  throw new Error(`Invalid color format: ${e}`);
62
63
  return {
@@ -69,10 +70,10 @@ function X(e) {
69
70
  900: w(t.h, t.s, 20)
70
71
  };
71
72
  }
72
- function ee(e, t) {
73
+ function te(e, t) {
73
74
  if (typeof document > "u")
74
75
  return;
75
- const r = X(e);
76
+ const o = ee(e);
76
77
  let a = document.getElementById(
77
78
  "incode-theme"
78
79
  );
@@ -80,57 +81,57 @@ function ee(e, t) {
80
81
  const u = t || "#ffffff", n = `
81
82
  :root,
82
83
  :host {
83
- --primitive-color-brand-50: ${r[50]};
84
- --primitive-color-brand-200: ${r[200]};
85
- --primitive-color-brand-300: ${r[300]};
86
- --primitive-color-brand-400: ${r[400]};
87
- --primitive-color-brand-500: ${r[500]};
88
- --primitive-color-brand-600: ${r[600]};
89
- --primitive-color-brand-900: ${r[900]};
84
+ --primitive-color-brand-50: ${o[50]};
85
+ --primitive-color-brand-200: ${o[200]};
86
+ --primitive-color-brand-300: ${o[300]};
87
+ --primitive-color-brand-400: ${o[400]};
88
+ --primitive-color-brand-500: ${o[500]};
89
+ --primitive-color-brand-600: ${o[600]};
90
+ --primitive-color-brand-900: ${o[900]};
90
91
  --button-primary-text-default: ${u};
91
92
  }
92
93
  `;
93
94
  a.textContent = n;
94
95
  }
95
- async function te() {
96
- return (await R.get("/omni/asset/fetch-all")).data;
96
+ async function ne() {
97
+ return (await L.get("/omni/asset/fetch-all")).data;
97
98
  }
98
99
  const A = /* @__PURE__ */ new Map();
99
- async function ne(e) {
100
+ async function oe(e) {
100
101
  if (e.startsWith("data:"))
101
102
  return e;
102
103
  const t = A.get(e);
103
104
  if (t)
104
105
  return t;
105
- const a = await (await fetch(e)).blob(), u = await new Promise((n, o) => {
106
- const f = new FileReader();
107
- f.onloadend = () => n(f.result), f.onerror = o, f.readAsDataURL(a);
106
+ const a = await (await fetch(e)).blob(), u = await new Promise((n, r) => {
107
+ const p = new FileReader();
108
+ p.onloadend = () => n(p.result), p.onerror = r, p.readAsDataURL(a);
108
109
  });
109
110
  return A.set(e, u), u;
110
111
  }
111
112
  async function re() {
112
- const e = await te();
113
+ const e = await ne();
113
114
  if (!e.theme)
114
115
  throw new Error("Theme URL not found in assets response");
115
- const t = e.theme, r = t.startsWith("http://") || t.startsWith("https://");
116
+ const t = e.theme, o = t.startsWith("http://") || t.startsWith("https://");
116
117
  let a;
117
- if (r) {
118
- const o = await fetch(t);
119
- if (!o.ok)
120
- throw new Error(`Failed to fetch theme: ${o.statusText}`);
121
- a = await o.json();
118
+ if (o) {
119
+ const r = await fetch(t);
120
+ if (!r.ok)
121
+ throw new Error(`Failed to fetch theme: ${r.statusText}`);
122
+ a = await r.json();
122
123
  } else
123
- a = (await R.get(t)).data;
124
+ a = (await L.get(t)).data;
124
125
  const u = e["logo.png"] || e["logo.svg"] || e["logo.jpg"] || e["logo.jpeg"] || e["logo.webp"] || a.logo;
125
126
  let n = u;
126
- return u && (n = await ne(u)), {
127
+ return u && (n = await oe(u)), {
127
128
  ...a,
128
129
  logo: n
129
130
  };
130
131
  }
131
- async function oe() {
132
+ async function ie() {
132
133
  const e = await re();
133
- return e.main && ee(e.main, e.buttonColor), e;
134
+ return e.main && te(e.main, e.buttonColor), e;
134
135
  }
135
136
  const T = () => import("../id/id.es.js").then((e) => e.Id), S = {
136
137
  PHONE: () => import("../phone/phone.es.js").then((e) => e.Phone),
@@ -140,34 +141,34 @@ const T = () => import("../id/id.es.js").then((e) => e.Id), S = {
140
141
  ID: T,
141
142
  TUTORIAL_ID: T,
142
143
  SECOND_ID: T,
143
- THIRD_ID: T,
144
- FACE_MATCH: () => import("../faceMatch-iEplxPox.js").then((e) => e.FaceMatch),
144
+ THIRD_ID: () => import("../documentUpload-h5GfSa2m.js").then((e) => e.DocumentUpload),
145
+ FACE_MATCH: () => import("../faceMatch-DL5ICOMJ.js").then((e) => e.FaceMatch),
145
146
  CURP_VALIDATION: () => import("../curp-validation/curp-validation.es.js").then((e) => e.CurpValidation),
146
147
  GOVT_VALIDATION_PROVISIONING: () => import("../governmentValidation/governmentValidation.es.js").then(
147
148
  (e) => e.GovernmentValidation
148
149
  ),
149
150
  GEOLOCATION: () => import("../geolocation/geolocation.es.js").then((e) => e.Geolocation)
150
151
  };
151
- function U() {
152
+ function R() {
152
153
  return V({
153
154
  modules: {
154
- PHONE: B,
155
+ PHONE: K,
155
156
  EMAIL: k,
156
- SELFIE: K,
157
- AUTHENTICATION: q,
158
- ID: b,
159
- TUTORIAL_ID: b,
160
- SECOND_ID: b,
161
- THIRD_ID: b,
157
+ SELFIE: q,
158
+ AUTHENTICATION: Y,
159
+ ID: v,
160
+ TUTORIAL_ID: v,
161
+ SECOND_ID: v,
162
+ THIRD_ID: B,
162
163
  FACE_MATCH: W,
163
- CURP_VALIDATION: Y,
164
- GOVT_VALIDATION_PROVISIONING: Z,
164
+ CURP_VALIDATION: Z,
165
+ GOVT_VALIDATION_PROVISIONING: J,
165
166
  GEOLOCATION: j
166
167
  }
167
168
  });
168
169
  }
169
170
  async function N(e) {
170
- await J({
171
+ await Q({
171
172
  apiURL: e.apiURL,
172
173
  token: e.token,
173
174
  i18n: { lang: e.lang ?? "en" }
@@ -175,33 +176,33 @@ async function N(e) {
175
176
  }
176
177
  async function P() {
177
178
  try {
178
- const e = await oe(), t = {
179
+ const e = await ie(), t = {
179
180
  logoSrc: e.logo,
180
181
  hideFooterBranding: e.hideFooterBranding
181
182
  };
182
- return v(t), { theme: e, uiConfig: t };
183
+ return b(t), { theme: e, uiConfig: t };
183
184
  } catch {
184
185
  return {};
185
186
  }
186
187
  }
187
188
  function x(e, t) {
188
- const r = D(e.flow);
189
- r.length > 0 && z({
189
+ const o = O(e.flow);
190
+ o.length > 0 && z({
190
191
  ...t,
191
- pipelines: r
192
+ pipelines: o
192
193
  }).catch((a) => {
193
194
  console.error("WASM warmup failed:", a);
194
195
  });
195
196
  }
196
- function ie(e) {
197
+ function ae(e) {
197
198
  const t = e.currentStep;
198
199
  if (t) {
199
- const r = S[t];
200
- r && r().catch(() => {
200
+ const o = S[t];
201
+ o && o().catch(() => {
201
202
  });
202
203
  }
203
204
  }
204
- const ae = ({
205
+ const se = ({
205
206
  moduleKey: e,
206
207
  onNext: t
207
208
  }) => /* @__PURE__ */ l("section", { class: "IncodeUnsupportedModule", "aria-live": "polite", children: /* @__PURE__ */ l("div", { class: "IncodeUnsupportedModuleContent", children: [
@@ -212,7 +213,7 @@ const ae = ({
212
213
  '" module is not yet supported in this version.'
213
214
  ] }),
214
215
  /* @__PURE__ */ l(
215
- _,
216
+ $,
216
217
  {
217
218
  onClick: t,
218
219
  class: "IncodeUnsupportedModuleButton",
@@ -244,22 +245,22 @@ function E(e) {
244
245
  }
245
246
  };
246
247
  }
247
- function De(e) {
248
+ function Le(e) {
248
249
  const { token: t } = e;
249
250
  if (I.has(t))
250
251
  return E(t);
251
- let r, a;
252
- const u = new Promise((i, h) => {
253
- r = i, a = h;
254
- }), n = U(), o = {
252
+ let o, a;
253
+ const u = new Promise((i, f) => {
254
+ o = i, a = f;
255
+ }), n = R(), r = {
255
256
  status: "loading",
256
257
  flowManager: n,
257
258
  config: e,
258
259
  readyPromise: u,
259
- readyResolve: r,
260
+ readyResolve: o,
260
261
  readyReject: a
261
262
  };
262
- return I.set(t, o), (async () => {
263
+ return I.set(t, r), (async () => {
263
264
  try {
264
265
  await N({
265
266
  apiURL: e.apiURL,
@@ -267,16 +268,16 @@ function De(e) {
267
268
  lang: e.lang
268
269
  });
269
270
  const i = e.disableDashboardTheme ? Promise.resolve({}) : P().then((d) => {
270
- o.theme = d.theme, o.uiConfig = d.uiConfig;
271
- }), h = n.subscribe((d) => {
271
+ r.theme = d.theme, r.uiConfig = d.uiConfig;
272
+ }), f = n.subscribe((d) => {
272
273
  if (d.status === "ready") {
273
274
  const s = d;
274
- e.wasmConfig && x(s, e.wasmConfig), ie(s), o.unsubscribe?.(), o.unsubscribe = void 0, o.status = "ready", o.readyResolve();
275
- } else d.status === "error" && (o.unsubscribe?.(), o.unsubscribe = void 0, o.status = "error", o.error = d.error, o.readyReject(new Error(d.error)));
275
+ e.wasmConfig && x(s, e.wasmConfig), ae(s), r.unsubscribe?.(), r.unsubscribe = void 0, r.status = "ready", r.readyResolve();
276
+ } else d.status === "error" && (r.unsubscribe?.(), r.unsubscribe = void 0, r.status = "error", r.error = d.error, r.readyReject(new Error(d.error)));
276
277
  });
277
- o.unsubscribe = h, n.load(), await i;
278
+ r.unsubscribe = f, n.load(), await i;
278
279
  } catch (i) {
279
- o.status = "error", o.error = i instanceof Error ? i.message : "Failed to preload", o.readyReject(
280
+ r.status = "error", r.error = i instanceof Error ? i.message : "Failed to preload", r.readyReject(
280
281
  i instanceof Error ? i : new Error("Failed to preload")
281
282
  ), I.delete(t);
282
283
  }
@@ -285,138 +286,138 @@ function De(e) {
285
286
  function F(e) {
286
287
  return I.get(e) ?? null;
287
288
  }
288
- function O(e) {
289
+ function D(e) {
289
290
  const t = F(e);
290
291
  return t && I.delete(e), t;
291
292
  }
292
- function se(e) {
293
- const { apiURL: t, token: r, lang: a, disableDashboardTheme: u, onError: n } = e, o = y(null), [f, i] = L(() => {
294
- const d = F(r);
293
+ function le(e) {
294
+ const { apiURL: t, token: o, lang: a, disableDashboardTheme: u, onError: n } = e, r = y(null), [p, i] = U(() => {
295
+ const d = F(o);
295
296
  if (d?.status === "ready") {
296
- const c = O(r);
297
+ const c = D(o);
297
298
  if (c)
298
- return o.current = c.flowManager, c.uiConfig && v(c.uiConfig), { status: "ready", flowManager: c.flowManager };
299
+ return r.current = c.flowManager, c.uiConfig && b(c.uiConfig), { status: "ready", flowManager: c.flowManager };
299
300
  }
300
- const s = U();
301
- return o.current = s, d?.status === "error" ? {
301
+ const s = R();
302
+ return r.current = s, d?.status === "error" ? {
302
303
  status: "error",
303
304
  error: d.error ?? "Preload failed",
304
305
  flowManager: s
305
306
  } : { status: "initializing", flowManager: s };
306
- }), h = y(!1);
307
+ }), f = y(!1);
307
308
  return g(() => {
308
- if (f.status !== "initializing")
309
+ if (p.status !== "initializing")
309
310
  return;
310
- const d = F(r);
311
+ const d = F(o);
311
312
  if (d?.status === "loading") {
312
313
  d.readyPromise.then(() => {
313
- const c = O(r);
314
- c && (o.current = c.flowManager, c.uiConfig && v(c.uiConfig), i({ status: "ready", flowManager: c.flowManager }));
314
+ const c = D(o);
315
+ c && (r.current = c.flowManager, c.uiConfig && b(c.uiConfig), i({ status: "ready", flowManager: c.flowManager }));
315
316
  }).catch((c) => {
316
- const p = c instanceof Error ? c.message : "Preload failed";
317
+ const h = c instanceof Error ? c.message : "Preload failed";
317
318
  i({
318
319
  status: "error",
319
- error: p,
320
- flowManager: f.flowManager
321
- }), n?.(p);
320
+ error: h,
321
+ flowManager: p.flowManager
322
+ }), n?.(h);
322
323
  });
323
324
  return;
324
325
  }
325
- if (h.current)
326
+ if (f.current)
326
327
  return;
327
- h.current = !0, (async () => {
328
+ f.current = !0, (async () => {
328
329
  try {
329
- await N({ apiURL: t, token: r, lang: a });
330
- const c = u ? Promise.resolve() : P().then((p) => {
331
- p.uiConfig && v(p.uiConfig);
330
+ await N({ apiURL: t, token: o, lang: a });
331
+ const c = u ? Promise.resolve() : P().then((h) => {
332
+ h.uiConfig && b(h.uiConfig);
332
333
  });
333
- f.flowManager.load(), await c, i({ status: "ready", flowManager: f.flowManager });
334
+ p.flowManager.load(), await c, i({ status: "ready", flowManager: p.flowManager });
334
335
  } catch (c) {
335
- const p = c instanceof Error ? c.message : "Failed to initialize SDK";
336
+ const h = c instanceof Error ? c.message : "Failed to initialize SDK";
336
337
  i({
337
338
  status: "error",
338
- error: p,
339
- flowManager: f.flowManager
340
- }), n?.(p);
339
+ error: h,
340
+ flowManager: p.flowManager
341
+ }), n?.(h);
341
342
  }
342
343
  })();
343
- }, [t, r, a, u, n, f]), f;
344
+ }, [t, o, a, u, n, p]), p;
344
345
  }
345
- function le(e) {
346
- const { moduleKey: t, onModuleLoading: r, onModuleLoaded: a, onError: u } = e, [n, o] = L({ status: "idle" });
346
+ function ce(e) {
347
+ const { moduleKey: t, onModuleLoading: o, onModuleLoaded: a, onError: u } = e, [n, r] = U({ status: "idle" });
347
348
  return g(() => {
348
349
  if (!t) {
349
- o({ status: "idle" });
350
+ r({ status: "idle" });
350
351
  return;
351
352
  }
352
- const f = S[t];
353
- if (!f) {
354
- o({ status: "unsupported", moduleKey: t });
353
+ const p = S[t];
354
+ if (!p) {
355
+ r({ status: "unsupported", moduleKey: t });
355
356
  return;
356
357
  }
357
- o({ status: "loading", moduleKey: t }), r?.(t);
358
+ r({ status: "loading", moduleKey: t }), o?.(t);
358
359
  let i = !1;
359
- return f().then((h) => {
360
- i || (o({ status: "loaded", moduleKey: t, Component: h }), a?.(t));
361
- }).catch((h) => {
360
+ return p().then((f) => {
361
+ i || (r({ status: "loaded", moduleKey: t, Component: f }), a?.(t));
362
+ }).catch((f) => {
362
363
  if (!i) {
363
- const d = h instanceof Error ? h.message : "Failed to load module";
364
- o({ status: "error", moduleKey: t, error: d }), u?.(`Failed to load ${t}: ${d}`);
364
+ const d = f instanceof Error ? f.message : "Failed to load module";
365
+ r({ status: "error", moduleKey: t, error: d }), u?.(`Failed to load ${t}: ${d}`);
365
366
  }
366
367
  }), () => {
367
368
  i = !0;
368
369
  };
369
- }, [t, r, a, u]), n;
370
+ }, [t, o, a, u]), n;
370
371
  }
371
- function ce(e, t) {
372
- const r = y(/* @__PURE__ */ new Set());
372
+ function de(e, t) {
373
+ const o = y(/* @__PURE__ */ new Set());
373
374
  g(() => {
374
375
  if (t < e.length - 1) {
375
376
  const a = e[t + 1];
376
- if (a && !r.current.has(a)) {
377
- r.current.add(a);
377
+ if (a && !o.current.has(a)) {
378
+ o.current.add(a);
378
379
  const u = S[a];
379
380
  u && u().catch(() => {
380
- r.current.delete(a);
381
+ o.current.delete(a);
381
382
  });
382
383
  }
383
384
  }
384
385
  }, [e, t]);
385
386
  }
386
- const de = ({
387
+ const ue = ({
387
388
  config: e,
388
389
  onFinish: t,
389
- onError: r
390
+ onError: o
390
391
  }) => {
391
- const { t: a } = G(), u = se({
392
+ const { t: a } = G(), u = le({
392
393
  apiURL: e.apiURL,
393
394
  token: e.token,
394
395
  lang: e.lang,
395
396
  disableDashboardTheme: e.disableDashboardTheme,
396
- onError: r
397
- }), [n, o] = H(() => u.flowManager, {
397
+ onError: o
398
+ }), [n, r] = H(() => u.flowManager, {
398
399
  autoLoad: !1
399
- }), f = le({
400
+ }), p = ce({
400
401
  moduleKey: n?.status === "ready" ? n.currentStep : void 0,
401
402
  onModuleLoading: e.onModuleLoading,
402
403
  onModuleLoaded: e.onModuleLoaded,
403
- onError: r
404
+ onError: o
404
405
  });
405
- if (ce(
406
+ if (de(
406
407
  n?.status === "ready" ? n.steps : [],
407
408
  n?.status === "ready" ? n.currentStepIndex : -1
408
409
  ), g(() => {
409
410
  if (n?.status === "ready" && e.wasmConfig) {
410
- const i = n, h = D(i.flow);
411
- h.length > 0 && (e.onWasmWarmup?.(h), x(i, e.wasmConfig));
411
+ const i = n, f = O(i.flow);
412
+ f.length > 0 && (e.onWasmWarmup?.(f), x(i, e.wasmConfig));
412
413
  }
413
414
  }, [n, e]), g(() => {
414
415
  n?.status === "finished" && t(n.finishStatus);
415
416
  }, [n?.status, t, n]), g(() => {
416
- n?.status === "error" && r && r(n.error);
417
- }, [n?.status, r, n]), g(() => {
418
- n?.status === "ready" && n.currentStep === "ID" && n.steps.includes("TUTORIAL_ID") && o.completeModule();
419
- }, [n, o]), u.status === "error")
417
+ n?.status === "error" && o && o(n.error);
418
+ }, [n?.status, o, n]), g(() => {
419
+ n?.status === "ready" && n.currentStep === "ID" && n.steps.includes("TUTORIAL_ID") && r.completeModule();
420
+ }, [n, r]), u.status === "error")
420
421
  return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l("div", { children: [
421
422
  "Error: ",
422
423
  u.error
@@ -449,8 +450,8 @@ const de = ({
449
450
  if (n.status === "finished")
450
451
  return null;
451
452
  if (n.status === "ready") {
452
- const { currentStep: i, config: h } = n;
453
- if (!i || !h)
453
+ const { currentStep: i, config: f } = n;
454
+ if (!i || !f)
454
455
  return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
455
456
  C,
456
457
  {
@@ -460,15 +461,15 @@ const de = ({
460
461
  fullScreen: !0
461
462
  }
462
463
  ) });
463
- if (f.status === "unsupported")
464
+ if (p.status === "unsupported")
464
465
  return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
465
- ae,
466
+ se,
466
467
  {
467
468
  moduleKey: i,
468
- onNext: () => o.completeModule()
469
+ onNext: () => r.completeModule()
469
470
  }
470
471
  ) });
471
- if (f.status === "idle" || f.status === "loading" || f.status === "error")
472
+ if (p.status === "idle" || p.status === "loading" || p.status === "error")
472
473
  return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
473
474
  C,
474
475
  {
@@ -478,15 +479,15 @@ const de = ({
478
479
  fullScreen: !0
479
480
  }
480
481
  ) });
481
- const { Component: d } = f;
482
+ const { Component: d } = p;
482
483
  if (i === "SELFIE")
483
484
  return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
484
485
  d,
485
486
  {
486
- config: h,
487
- onFinish: () => o.completeModule(),
487
+ config: f,
488
+ onFinish: () => r.completeModule(),
488
489
  onError: (c) => {
489
- r?.(c ?? "Selfie verification error");
490
+ o?.(c ?? "Selfie verification error");
490
491
  }
491
492
  },
492
493
  `selfie-${n.currentStepIndex}`
@@ -495,10 +496,10 @@ const de = ({
495
496
  return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
496
497
  d,
497
498
  {
498
- config: { ...h, authHint: e.authHint },
499
- onFinish: () => o.completeModule(),
499
+ config: { ...f, authHint: e.authHint },
500
+ onFinish: () => r.completeModule(),
500
501
  onError: (c) => {
501
- r?.(c ?? "Authentication error");
502
+ o?.(c ?? "Authentication error");
502
503
  }
503
504
  },
504
505
  `authentication-${n.currentStepIndex}`
@@ -507,16 +508,16 @@ const de = ({
507
508
  return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
508
509
  d,
509
510
  {
510
- config: h,
511
- onFinish: () => o.completeModule(),
511
+ config: f,
512
+ onFinish: () => r.completeModule(),
512
513
  onError: (c) => {
513
- r?.(c ?? "Phone verification error");
514
+ o?.(c ?? "Phone verification error");
514
515
  }
515
516
  },
516
517
  `phone-${n.currentStepIndex}`
517
518
  ) });
518
519
  if (i === "EMAIL") {
519
- const s = h;
520
+ const s = f;
520
521
  return !s || typeof s.otpVerification != "boolean" || typeof s.otpExpirationInMinutes != "number" ? /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l("div", { children: "Error: Invalid email configuration" }) }) : /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
521
522
  d,
522
523
  {
@@ -524,31 +525,43 @@ const de = ({
524
525
  ...s,
525
526
  prefill: s.prefill ?? !1
526
527
  },
527
- onFinish: () => o.completeModule(),
528
+ onFinish: () => r.completeModule(),
528
529
  onError: (c) => {
529
- r?.(c ?? "Email verification error");
530
+ o?.(c ?? "Email verification error");
530
531
  }
531
532
  },
532
533
  `email-${n.currentStepIndex}`
533
534
  ) });
534
535
  }
535
- if (i === "TUTORIAL_ID" || i === "SECOND_ID" || i === "THIRD_ID" || // Only render ID if TUTORIAL_ID doesn't exist (otherwise useEffect will skip it)
536
+ if (i === "THIRD_ID")
537
+ return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
538
+ d,
539
+ {
540
+ config: f,
541
+ onFinish: () => r.completeModule(),
542
+ onError: (c) => {
543
+ o?.(c ?? "Document upload error");
544
+ }
545
+ },
546
+ `document-upload-${n.currentStepIndex}`
547
+ ) });
548
+ if (i === "TUTORIAL_ID" || i === "SECOND_ID" || // Only render ID if TUTORIAL_ID doesn't exist (otherwise useEffect will skip it)
536
549
  i === "ID" && !n.steps.includes("TUTORIAL_ID")) {
537
- const s = h, p = i === "SECOND_ID" || i === "THIRD_ID" ? { ...s, isSecondId: !0 } : s;
550
+ const s = f, h = i === "SECOND_ID" ? { ...s, isSecondId: !0 } : s;
538
551
  return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
539
552
  d,
540
553
  {
541
- config: p,
542
- onFinish: () => o.completeModule(),
554
+ config: h,
555
+ onFinish: () => r.completeModule(),
543
556
  onError: (M) => {
544
- r?.(M ?? "ID capture error");
557
+ o?.(M ?? "ID capture error");
545
558
  }
546
559
  },
547
560
  `id-${n.currentStepIndex}`
548
561
  ) });
549
562
  }
550
563
  if (i === "FACE_MATCH") {
551
- const s = h, c = {
564
+ const s = f, c = {
552
565
  variant: s.matchingType,
553
566
  disableFaceMatchAnimation: s.disableFaceMatchAnimation ?? !1
554
567
  };
@@ -556,9 +569,9 @@ const de = ({
556
569
  d,
557
570
  {
558
571
  config: c,
559
- onFinish: () => o.completeModule(),
560
- onError: (p) => {
561
- r?.(p ?? "Face match error");
572
+ onFinish: () => r.completeModule(),
573
+ onError: (h) => {
574
+ o?.(h ?? "Face match error");
562
575
  }
563
576
  },
564
577
  `face-match-${n.currentStepIndex}`
@@ -568,10 +581,10 @@ const de = ({
568
581
  return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
569
582
  d,
570
583
  {
571
- config: h,
572
- onFinish: () => o.completeModule(),
584
+ config: f,
585
+ onFinish: () => r.completeModule(),
573
586
  onError: (c) => {
574
- r?.(c ?? "CURP validation error");
587
+ o?.(c ?? "CURP validation error");
575
588
  }
576
589
  },
577
590
  `curp-validation-${n.currentStepIndex}`
@@ -580,10 +593,10 @@ const de = ({
580
593
  return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
581
594
  d,
582
595
  {
583
- config: h,
584
- onFinish: () => o.completeModule(),
596
+ config: f,
597
+ onFinish: () => r.completeModule(),
585
598
  onError: (c) => {
586
- r?.(c ?? "Government validation error");
599
+ o?.(c ?? "Government validation error");
587
600
  }
588
601
  },
589
602
  `govt-validation-${n.currentStepIndex}`
@@ -592,31 +605,31 @@ const de = ({
592
605
  return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
593
606
  d,
594
607
  {
595
- config: { allowSkip: h.allowUserToSkipGeolocation },
596
- onFinish: () => o.completeModule(),
608
+ config: { allowSkip: f.allowUserToSkipGeolocation },
609
+ onFinish: () => r.completeModule(),
597
610
  onError: (c) => {
598
- r?.(c ?? "Geolocation error");
611
+ o?.(c ?? "Geolocation error");
599
612
  }
600
613
  },
601
614
  `geolocation-${n.currentStepIndex}`
602
615
  ) });
603
616
  }
604
617
  return null;
605
- }, ue = ({
618
+ }, fe = ({
606
619
  config: e,
607
620
  onFinish: t = () => {
608
621
  },
609
- onError: r
622
+ onError: o
610
623
  }) => /* @__PURE__ */ l("div", { class: "IncodeComponent", children: e ? /* @__PURE__ */ l(
611
- de,
624
+ ue,
612
625
  {
613
626
  config: e,
614
627
  onFinish: t,
615
- onError: r
628
+ onError: o
616
629
  }
617
630
  ) : null });
618
- $(ue, "incode-flow");
631
+ _(fe, "incode-flow");
619
632
  export {
620
- ue as IncodeFlow,
621
- De as preloadIncodeFlow
633
+ fe as IncodeFlow,
634
+ Le as preloadIncodeFlow
622
635
  };