@incodetech/web 0.0.0-dev-20260219-dfbf2ff → 0.0.0-dev-20260220-bec1051

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