@incodetech/web 0.0.0-dev-20260313-486e658 → 0.0.0-dev-20260313-bc2dab4

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 (64) hide show
  1. package/dist/{AsYouType-BtKe6-rC.js → AsYouType-CpH-Rmtj.js} +1 -1
  2. package/dist/{Trans-C2X8WLEu.js → Trans-CA9a3vKp.js} +1 -1
  3. package/dist/authentication/authentication.es.js +25 -20
  4. package/dist/base.css +9 -4
  5. package/dist/{browser-ponyfill-CLXJUgvu.js → browser-ponyfill-B6W6hHVY.js} +49 -46
  6. package/dist/{incodeModule-DLGHhn9E.js → button-Ca1tRSTI.js} +153 -239
  7. package/dist/{captureFooter-C2Yrou50.js → captureFooter-X2qN1773.js} +72 -70
  8. package/dist/{chevronDown-D5uHEaU-.js → chevronDown-BUaOuf9J.js} +1 -1
  9. package/dist/{closeIcon-BMPoRQCd.js → closeIcon-BM7WLbKp.js} +1 -1
  10. package/dist/{countries-3p5tkqcx.js → countries-C9bhJe4u.js} +3 -3
  11. package/dist/curp-validation/curp-validation.es.js +26 -25
  12. package/dist/{dateInputComposed-CqHIiKPV.js → dateInputComposed-CvFmQpJ0.js} +11 -10
  13. package/dist/document-capture/styles.css +1 -0
  14. package/dist/{documentCapture-CzGmGxzA.js → documentCapture-PdKA2frR.js} +113 -157
  15. package/dist/{dropdownComposed-BgGKKaXv.js → dropdownComposed-DBm7cotT.js} +8 -6
  16. package/dist/{ekybModule-Bttpjr3j.js → ekybModule-DiFpO2sE.js} +16 -14
  17. package/dist/ekycModule-DdD1iChB.js +370 -0
  18. package/dist/email/email.es.js +86 -63
  19. package/dist/{errorContent-6xl4ArMV.js → errorContent-yUAdbZ5o.js} +5 -5
  20. package/dist/{errorIcon-Cxcv4ISP.js → errorIcon-BL647nVh.js} +1 -1
  21. package/dist/extensibility.es.js +290 -0
  22. package/dist/face-match/styles.css +8 -0
  23. package/dist/{faceMatch-DKqzUCml.js → faceMatch-BjdNG_e0.js} +12 -11
  24. package/dist/fileIcon-DOyMcRWU.js +52 -0
  25. package/dist/flipAnimation-DoMQoFPb.js +1355 -0
  26. package/dist/flow/flow.es.js +157 -157
  27. package/dist/flow/styles.css +15 -3
  28. package/dist/formField-C91ckby4.js +94 -0
  29. package/dist/geolocation/geolocation.es.js +15 -14
  30. package/dist/governmentValidation/governmentValidation.es.js +19 -18
  31. package/dist/id/id.es.js +30 -1354
  32. package/dist/id/styles.css +2 -0
  33. package/dist/incodeModule-aE-LkKwM.js +96 -0
  34. package/dist/index.es.js +7 -7
  35. package/dist/{otpInput-BT0ZXrAt.js → otpInput-cazUY73p.js} +1 -1
  36. package/dist/{page-BJDfLRpO.js → page-BVHG3h0V.js} +1 -1
  37. package/dist/permissions-DwF2Ez1N.js +754 -0
  38. package/dist/phone/phone.es.js +53 -30
  39. package/dist/{phoneInput-d3sq4X5R.js → phoneInput-Duuochsh.js} +4 -4
  40. package/dist/phoneInputComposed-B1gXoSzr.js +107 -0
  41. package/dist/{processing-CGb_3dSE.js → processing-CDgOueI3.js} +3 -3
  42. package/dist/selfie/selfie.es.js +29 -18
  43. package/dist/selfie/styles.css +12 -3
  44. package/dist/{spinner--i134wYq.js → spinner-Cx3FPUCD.js} +13 -11
  45. package/dist/{successIcon-1BcPFhum.js → successIcon-BybULRRU.js} +1 -1
  46. package/dist/{tutorial-DXgOS41l.js → tutorial-Dagmccxh.js} +21 -21
  47. package/dist/types/authentication.d.ts +10 -3
  48. package/dist/types/curp-validation.d.ts +5 -1
  49. package/dist/types/email.d.ts +8 -3
  50. package/dist/types/extensibility.d.ts +671 -0
  51. package/dist/types/flow.d.ts +5 -1
  52. package/dist/types/geolocation.d.ts +5 -1
  53. package/dist/types/governmentValidation.d.ts +5 -1
  54. package/dist/types/id.d.ts +8 -3
  55. package/dist/types/phone.d.ts +8 -3
  56. package/dist/types/selfie.d.ts +8 -3
  57. package/dist/{uiConfig-DisZ_yFB.js → uiConfig-Z6RT23Sl.js} +3 -3
  58. package/dist/useFormScrollable-3O3GeT4m.js +15 -0
  59. package/dist/{warningIcon-WqI5X7cK.js → warningIcon-DyoKeqDd.js} +1 -1
  60. package/package.json +6 -2
  61. package/dist/_commonjsHelpers-DaMA6jEr.js +0 -8
  62. package/dist/baseTutorial-hbezn8sT.js +0 -755
  63. package/dist/ekycModule-DfwZMKdL.js +0 -467
  64. package/dist/verificationResult-CKZqPXb9.js +0 -106
@@ -1,11 +1,13 @@
1
- import { b as k, u as t, I as U, a as F, S as $, B as R, r as M } from "./incodeModule-DLGHhn9E.js";
2
- import { SUPPORTED_COUNTRIES as I, DEV_ONLY_COUNTRIES as D, createEkybManager as w } from "@incodetech/core/ekyb";
3
- import { T as A, y as v, A as L, k as P } from "./vendor-preact-BXf0bkEs.js";
4
- import "./uiConfig-DisZ_yFB.js";
1
+ import { b as k, u as t, I as U, a as F, S as $, B as R } from "./button-Ca1tRSTI.js";
2
+ import { SUPPORTED_COUNTRIES as I, DEV_ONLY_COUNTRIES as M, createEkybManager as D } from "@incodetech/core/ekyb";
3
+ import { T as w, y as v, A, k as L } from "./vendor-preact-BXf0bkEs.js";
4
+ import "./uiConfig-Z6RT23Sl.js";
5
5
  import "@incodetech/core";
6
- import { F as O, V as E, u as T } from "./verificationResult-CKZqPXb9.js";
7
- import { P as _ } from "./page-BJDfLRpO.js";
8
- import { D as g, I as S } from "./dropdownComposed-BgGKKaXv.js";
6
+ import { u as P } from "./useFormScrollable-3O3GeT4m.js";
7
+ import { P as O } from "./page-BVHG3h0V.js";
8
+ import { F as T, V as E } from "./formField-C91ckby4.js";
9
+ import { r as _ } from "./incodeModule-aE-LkKwM.js";
10
+ import { D as g, I as S } from "./dropdownComposed-DBm7cotT.js";
9
11
  function B(e) {
10
12
  return [...e.toUpperCase()].map((o) => String.fromCodePoint(127462 + o.charCodeAt(0) - 65)).join("");
11
13
  }
@@ -37,7 +39,7 @@ const K = ({
37
39
  value: e,
38
40
  onChange: o
39
41
  }) => {
40
- const { t: r } = k(), n = A(() => (G() ? [...I, ...D] : [...I]).map(q).sort((u, l) => u.label.localeCompare(l.label)), []);
42
+ const { t: r } = k(), n = w(() => (G() ? [...I, ...M] : [...I]).map(q).sort((u, l) => u.label.localeCompare(l.label)), []);
41
43
  return /* @__PURE__ */ t("div", { className: "IncodeEkybCountrySelector", children: /* @__PURE__ */ t(
42
44
  g,
43
45
  {
@@ -78,7 +80,7 @@ const K = ({
78
80
  );
79
81
  }
80
82
  return /* @__PURE__ */ t(
81
- O,
83
+ T,
82
84
  {
83
85
  name: e.name,
84
86
  label: e.label,
@@ -153,7 +155,7 @@ const K = ({
153
155
  )
154
156
  ] });
155
157
  }, W = ({ config: e, onFinish: o, onError: r }) => {
156
- const [n, c] = F(() => w({ config: e }), {
158
+ const [n, c] = F(() => D({ config: e }), {
157
159
  autoLoad: !1
158
160
  });
159
161
  v(() => {
@@ -171,8 +173,8 @@ const K = ({
171
173
  "state",
172
174
  "postalCode"
173
175
  ]), Y = ({ state: e, manager: o }) => {
174
- const { country: r, fields: n, values: c, displayErrors: u, isValid: l, ubos: m, canAddUbo: a } = e, { t: b } = k(), i = L(null), h = T(i, n.length), d = n.filter((s) => !f.has(s.name)), C = n.filter((s) => f.has(s.name));
175
- return /* @__PURE__ */ t(_, { className: `IncodeEkybPage${h ? " IncodeEkybPageScrollable" : ""}`, title: b("ekyb.title"), children: [
176
+ const { country: r, fields: n, values: c, displayErrors: u, isValid: l, ubos: m, canAddUbo: a } = e, { t: b } = k(), i = A(null), h = P(i, n.length), d = n.filter((s) => !f.has(s.name)), C = n.filter((s) => f.has(s.name));
177
+ return /* @__PURE__ */ t(O, { className: `IncodeEkybPage${h ? " IncodeEkybPageScrollable" : ""}`, title: b("ekyb.title"), children: [
176
178
  /* @__PURE__ */ t("div", { ref: i, className: "IncodeEkybForm", children: [
177
179
  /* @__PURE__ */ t(
178
180
  K,
@@ -192,7 +194,7 @@ const K = ({
192
194
  },
193
195
  s.name
194
196
  )),
195
- C.length > 0 && /* @__PURE__ */ t(P, { children: [
197
+ C.length > 0 && /* @__PURE__ */ t(L, { children: [
196
198
  /* @__PURE__ */ t("h3", { className: "IncodeEkybSectionHeader", children: b("ekyb.addressDetails") }),
197
199
  C.map((s) => /* @__PURE__ */ t(
198
200
  N,
@@ -236,7 +238,7 @@ const K = ({
236
238
  onFinish: o,
237
239
  onError: r
238
240
  }) => /* @__PURE__ */ t(U, { children: e ? /* @__PURE__ */ t(W, { config: e, onFinish: o, onError: r }) : null });
239
- M(j, "incode-ekyb");
241
+ _(j, "incode-ekyb");
240
242
  export {
241
243
  j as EkybModule
242
244
  };
@@ -0,0 +1,370 @@
1
+ import { b as L, u as t, I as q, a as O, S as V, B as K } from "./button-Ca1tRSTI.js";
2
+ import { createEkycManager as B } from "@incodetech/core/ekyc";
3
+ import { d as w, A as x, y as N, q as H } from "./vendor-preact-BXf0bkEs.js";
4
+ import "./uiConfig-Z6RT23Sl.js";
5
+ import "@incodetech/core";
6
+ import { u as T } from "./useFormScrollable-3O3GeT4m.js";
7
+ import { D as Q } from "./dateInputComposed-CvFmQpJ0.js";
8
+ import { I as z, D as G } from "./dropdownComposed-DBm7cotT.js";
9
+ import { V as S, F as U } from "./formField-C91ckby4.js";
10
+ import { P as W } from "./page-BVHG3h0V.js";
11
+ import { r as j } from "./incodeModule-aE-LkKwM.js";
12
+ import { P as J } from "./phoneInputComposed-B1gXoSzr.js";
13
+ import { u as X } from "./useMediaQuery-CiSMgDyi.js";
14
+ const Y = ({
15
+ label: y,
16
+ value: n,
17
+ error: h,
18
+ suggestions: l,
19
+ readonly: a,
20
+ optional: b,
21
+ onChange: E,
22
+ onSearch: M,
23
+ onSelect: F
24
+ }) => {
25
+ const { t: v } = L(), [D, I] = w(!1), [r, C] = w(!1), [P, g] = w(""), [k, A] = w(-1), $ = x(null), e = "ekyc-address-listbox", i = X(), p = v(y), u = b ? `${p} (${v("common.optional")})` : p;
26
+ N(() => {
27
+ function o(d) {
28
+ $.current && !$.current.contains(d.target) && I(!1);
29
+ }
30
+ return document.addEventListener("mousedown", o), () => document.removeEventListener("mousedown", o);
31
+ }, []), N(() => {
32
+ A(-1);
33
+ }, [l]);
34
+ const c = H(
35
+ (o) => {
36
+ F(o), I(!1), C(!1), A(-1);
37
+ },
38
+ [F]
39
+ ), s = (o) => {
40
+ E(o), o.length >= 3 ? i ? (C(!0), g(o)) : (M(o), I(!0)) : I(!1);
41
+ }, m = (o) => {
42
+ !D || l.length === 0 || (o.key === "ArrowDown" ? (o.preventDefault(), A((d) => d < l.length - 1 ? d + 1 : 0)) : o.key === "ArrowUp" ? (o.preventDefault(), A((d) => d > 0 ? d - 1 : l.length - 1)) : o.key === "Enter" && k >= 0 ? (o.preventDefault(), c(l[k])) : o.key === "Escape" && (I(!1), A(-1)));
43
+ }, f = !i && D && l.length > 0, R = f && k >= 0 ? `${e}-option-${k}` : void 0;
44
+ return /* @__PURE__ */ t("div", { className: "IncodeAddressAutocomplete", ref: $, children: [
45
+ /* @__PURE__ */ t(
46
+ z,
47
+ {
48
+ id: "ekyc-street",
49
+ label: u,
50
+ name: "street",
51
+ value: n,
52
+ readOnly: a,
53
+ error: h ? v(h) : void 0,
54
+ onInput: (o) => s(o.target.value),
55
+ onKeyDown: m,
56
+ role: "combobox",
57
+ "aria-expanded": f,
58
+ "aria-controls": e,
59
+ "aria-activedescendant": R,
60
+ "aria-autocomplete": "list",
61
+ "data-testid": "ekyc-address-input"
62
+ }
63
+ ),
64
+ f && /* @__PURE__ */ t(
65
+ "ul",
66
+ {
67
+ id: e,
68
+ role: "listbox",
69
+ className: "IncodeAddressAutocompleteSuggestions",
70
+ children: l.map((o, d) => /* @__PURE__ */ t(
71
+ "li",
72
+ {
73
+ id: `${e}-option-${d}`,
74
+ role: "option",
75
+ "aria-selected": d === k,
76
+ className: `IncodeAddressAutocompleteSuggestion${d === k ? "IncodeAddressAutocompleteSuggestionActive" : ""}`,
77
+ onClick: () => c(o),
78
+ children: o.label
79
+ },
80
+ o.id
81
+ ))
82
+ }
83
+ ),
84
+ i && r && /* @__PURE__ */ t("div", { className: "IncodeAddressAutocompleteModalOverlay", children: /* @__PURE__ */ t("div", { className: "IncodeAddressAutocompleteModal", children: [
85
+ /* @__PURE__ */ t("div", { className: "IncodeAddressAutocompleteModalHeader", children: [
86
+ /* @__PURE__ */ t("h3", { children: v("verification.addressSearch") }),
87
+ /* @__PURE__ */ t(
88
+ "button",
89
+ {
90
+ className: "IncodeAddressAutocompleteModalClose",
91
+ onClick: () => C(!1),
92
+ type: "button",
93
+ children: "×"
94
+ }
95
+ )
96
+ ] }),
97
+ /* @__PURE__ */ t("div", { className: "IncodeAddressAutocompleteModalBody", children: [
98
+ /* @__PURE__ */ t(
99
+ "input",
100
+ {
101
+ className: "IncodeAddressAutocompleteModalInput",
102
+ type: "text",
103
+ value: P,
104
+ placeholder: v("verification.addressPlaceholder"),
105
+ onInput: (o) => {
106
+ const d = o.target.value;
107
+ g(d), d.length >= 3 && M(d);
108
+ },
109
+ autoFocus: !0
110
+ }
111
+ ),
112
+ l.length > 0 && /* @__PURE__ */ t(
113
+ "ul",
114
+ {
115
+ role: "listbox",
116
+ className: "IncodeAddressAutocompleteModalSuggestions",
117
+ children: l.map((o) => /* @__PURE__ */ t(
118
+ "li",
119
+ {
120
+ role: "option",
121
+ className: "IncodeAddressAutocompleteModalSuggestion",
122
+ onClick: () => c(o),
123
+ children: o.label
124
+ },
125
+ o.id
126
+ ))
127
+ }
128
+ ),
129
+ /* @__PURE__ */ t(
130
+ "button",
131
+ {
132
+ className: "IncodeAddressAutocompleteEnterManually",
133
+ onClick: () => C(!1),
134
+ type: "button",
135
+ children: v("verification.enterManually")
136
+ }
137
+ )
138
+ ] })
139
+ ] }) })
140
+ ] });
141
+ }, Z = ({ config: y, onFinish: n, onError: h }) => {
142
+ const { t: l } = L(), [a, b] = O(() => B({ config: y }));
143
+ N(() => {
144
+ (a.status === "finished" || a.status === "closed") && n?.();
145
+ }, [a.status, n]);
146
+ const E = a.status === "error" ? a.errorMessage : void 0;
147
+ return N(() => {
148
+ a.status === "error" && h?.(E);
149
+ }, [a.status, h, E]), a.status === "finished" || a.status === "closed" ? null : a.status === "loading" ? /* @__PURE__ */ t(
150
+ S,
151
+ {
152
+ status: "submitting",
153
+ submittingTitle: l("common.loading")
154
+ }
155
+ ) : a.status === "submitting" ? /* @__PURE__ */ t(S, { status: "submitting" }) : a.status === "success" ? /* @__PURE__ */ t(S, { status: "success" }) : a.status === "error" ? /* @__PURE__ */ t(
156
+ S,
157
+ {
158
+ status: "failure",
159
+ onRetry: () => b.retry(),
160
+ onSkip: () => b.skip()
161
+ }
162
+ ) : a.status === "misconfigured" ? /* @__PURE__ */ t(
163
+ S,
164
+ {
165
+ status: "failure",
166
+ failureTitle: l("verification.noFormFields"),
167
+ onSkip: () => b.close(),
168
+ skipLabel: l("common.close")
169
+ }
170
+ ) : a.status === "form" ? /* @__PURE__ */ t(_, { state: a, manager: b }) : null;
171
+ }, _ = ({ state: y, manager: n }) => {
172
+ const {
173
+ fields: h,
174
+ values: l,
175
+ displayErrors: a,
176
+ errorParams: b,
177
+ isValid: E,
178
+ addressSuggestions: M,
179
+ prefilled: F,
180
+ hideEmail: v,
181
+ fieldsCountry: D,
182
+ submitError: I
183
+ } = y, { t: r } = L(), C = x(null), P = x(null), g = x(void 0), k = T(C, h.length);
184
+ N(() => {
185
+ const e = a.postalCode, i = g.current;
186
+ if (g.current = e, !e || i === e)
187
+ return;
188
+ const p = requestAnimationFrame(() => {
189
+ const u = P.current;
190
+ if (!u) return;
191
+ (u.querySelector("#postalCode-error") ?? u).scrollIntoView({
192
+ behavior: "smooth",
193
+ block: "nearest"
194
+ });
195
+ });
196
+ return () => cancelAnimationFrame(p);
197
+ }, [a.postalCode]);
198
+ let A;
199
+ return /* @__PURE__ */ t(W, { className: `IncodeEkycPage${k ? " IncodeEkycPageScrollable" : ""}`, title: r("verification.title"), children: [
200
+ /* @__PURE__ */ t("div", { ref: C, className: "IncodeEkycForm", children: h.map((e) => {
201
+ if (e.name === "email" && v) return null;
202
+ let i = null;
203
+ e.section && e.section !== A && (A = e.section, i = /* @__PURE__ */ t("h3", { className: "IncodeEkycSectionHeader", children: r({
204
+ address: "verification.labels.addressDetailsSection",
205
+ driverLicense: "verification.labels.dlDetailsSection"
206
+ }[e.section] ?? e.section) }));
207
+ const p = e.readonly || F[e.name], u = l[e.name] ?? "", c = a[e.name];
208
+ if (e.name === "street" && e.section === "address")
209
+ return /* @__PURE__ */ t("div", { children: [
210
+ i,
211
+ /* @__PURE__ */ t(
212
+ Y,
213
+ {
214
+ label: e.label,
215
+ value: u,
216
+ error: c,
217
+ suggestions: M,
218
+ readonly: p,
219
+ onChange: (s) => n.setField("street", s),
220
+ onSearch: (s) => n.searchAddress(s),
221
+ onSelect: (s) => n.selectAddress(s)
222
+ }
223
+ )
224
+ ] }, e.name);
225
+ if (e.type === "dropdown") {
226
+ const s = r(e.label);
227
+ return /* @__PURE__ */ t("div", { children: [
228
+ i,
229
+ /* @__PURE__ */ t(
230
+ G,
231
+ {
232
+ id: `ekyc-${e.name}`,
233
+ label: s,
234
+ placeholder: e.placeholder ? r(e.placeholder) : void 0,
235
+ value: u,
236
+ options: (e.options ?? []).map((m) => ({
237
+ ...m,
238
+ label: r(m.label)
239
+ })),
240
+ error: c ? r(c) : void 0,
241
+ disabled: p,
242
+ searchable: !0,
243
+ onChange: (m) => n.setField(e.name, m),
244
+ "data-testid": `ekyc-field-${e.name}`
245
+ }
246
+ )
247
+ ] }, e.name);
248
+ }
249
+ if (e.type === "date") {
250
+ const s = r(e.label);
251
+ return /* @__PURE__ */ t("div", { children: [
252
+ i,
253
+ /* @__PURE__ */ t(
254
+ Q,
255
+ {
256
+ id: `ekyc-${e.name}`,
257
+ label: s,
258
+ value: u,
259
+ error: c ? r(c) : void 0,
260
+ disabled: p,
261
+ onInput: (m) => {
262
+ const f = m.target;
263
+ n.setField(e.name, f.value);
264
+ },
265
+ "data-testid": `ekyc-field-${e.name}`
266
+ }
267
+ )
268
+ ] }, e.name);
269
+ }
270
+ if (e.type === "phone") {
271
+ const s = r(e.label);
272
+ return /* @__PURE__ */ t("div", { children: [
273
+ i,
274
+ /* @__PURE__ */ t(
275
+ J,
276
+ {
277
+ id: `ekyc-${e.name}`,
278
+ label: s,
279
+ countryCode: D,
280
+ value: u,
281
+ placeholder: e.placeholder,
282
+ error: c ? r(c) : void 0,
283
+ disabled: p,
284
+ disableCountrySelector: e.disableCountrySelector,
285
+ required: e.required,
286
+ onChange: (m) => n.setField(e.name, m),
287
+ "data-testid": `ekyc-field-${e.name}`
288
+ }
289
+ )
290
+ ] }, e.name);
291
+ }
292
+ return e.type === "radio" ? /* @__PURE__ */ t("div", { children: [
293
+ i,
294
+ /* @__PURE__ */ t("div", { className: "IncodeEkycRadioGroup", children: [
295
+ /* @__PURE__ */ t("label", { className: "IncodeEkycRadioLabel", children: r(e.label) }),
296
+ /* @__PURE__ */ t("div", { className: "IncodeEkycRadioOptions", children: e.options?.map((s) => /* @__PURE__ */ t(
297
+ "label",
298
+ {
299
+ className: "IncodeEkycRadioOption",
300
+ children: [
301
+ /* @__PURE__ */ t(
302
+ "input",
303
+ {
304
+ type: "radio",
305
+ name: e.name,
306
+ checked: u === s.value,
307
+ value: s.value,
308
+ onChange: () => n.setField(e.name, s.value),
309
+ disabled: p
310
+ }
311
+ ),
312
+ /* @__PURE__ */ t("span", { children: r(s.label) })
313
+ ]
314
+ },
315
+ s.value
316
+ )) }),
317
+ c && /* @__PURE__ */ t("span", { className: "IncodeEkycFieldError", children: r(c) })
318
+ ] })
319
+ ] }, e.name) : /* @__PURE__ */ t(
320
+ "div",
321
+ {
322
+ ref: e.name === "postalCode" ? P : void 0,
323
+ children: [
324
+ i,
325
+ /* @__PURE__ */ t(
326
+ U,
327
+ {
328
+ name: e.name,
329
+ label: e.label,
330
+ value: u,
331
+ error: c,
332
+ errorParams: b[e.name],
333
+ type: e.type,
334
+ placeholder: e.placeholder,
335
+ placeholderParams: e.placeholderParams,
336
+ required: e.required,
337
+ optional: e.optional,
338
+ readonly: p,
339
+ maxLength: e.maxLength,
340
+ onChange: (s, m) => n.setField(s, m)
341
+ }
342
+ )
343
+ ]
344
+ },
345
+ e.name
346
+ );
347
+ }) }),
348
+ /* @__PURE__ */ t("div", { className: "IncodeEkycFooter", children: [
349
+ /* @__PURE__ */ t(V, { size: 32 }),
350
+ I && /* @__PURE__ */ t("p", { className: "IncodeEkycSubmitError", children: r(I) }),
351
+ /* @__PURE__ */ t(
352
+ K,
353
+ {
354
+ onClick: () => n.submit(),
355
+ disabled: !E,
356
+ "data-testid": "ekyc-submit",
357
+ children: r("common.continue")
358
+ }
359
+ )
360
+ ] })
361
+ ] });
362
+ }, ee = ({
363
+ config: y,
364
+ onFinish: n,
365
+ onError: h
366
+ }) => /* @__PURE__ */ t(q, { children: y ? /* @__PURE__ */ t(Z, { config: y, onFinish: n, onError: h }) : null });
367
+ j(ee, "incode-ekyc");
368
+ export {
369
+ ee as EkycModule
370
+ };
@@ -1,42 +1,43 @@
1
- import { u as e, S as g, r as b, I as h, a as v, B as O } from "../incodeModule-DLGHhn9E.js";
1
+ import { u as i, S as f, I as h, a as v, B as O } from "../button-Ca1tRSTI.js";
2
2
  import { createEmailManager as y } from "@incodetech/core/email";
3
- import { d as f, y as V, k as P } from "../vendor-preact-BXf0bkEs.js";
3
+ import { d as b, y as V, k as P } from "../vendor-preact-BXf0bkEs.js";
4
4
  import "@incodetech/core";
5
- import { O as k } from "../otpInput-BT0ZXrAt.js";
6
- import { P as E } from "../page-BJDfLRpO.js";
7
- const I = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, w = ({
8
- prefilledEmail: i,
5
+ import { O as k } from "../otpInput-cazUY73p.js";
6
+ import { P as I } from "../page-BVHG3h0V.js";
7
+ import { r as w } from "../incodeModule-aE-LkKwM.js";
8
+ const g = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, C = ({
9
+ prefilledEmail: e,
9
10
  emailError: a,
10
11
  disabled: r = !1,
11
- onEmailChange: t
12
+ onEmailChange: n
12
13
  }) => {
13
- const [n, o] = f("");
14
+ const [t, s] = b("");
14
15
  V(() => {
15
- if (i) {
16
- o(i);
17
- const s = I.test(i.trim());
18
- t(i.trim(), s);
16
+ if (e) {
17
+ s(e);
18
+ const c = g.test(e.trim());
19
+ n(e.trim(), c);
19
20
  }
20
- }, [i, t]);
21
- const m = (s) => {
22
- const u = s.target.value;
23
- o(u);
24
- const l = u.trim(), c = l.length > 0 && I.test(l);
25
- t(l, c);
26
- }, p = a ? "email-error" : void 0;
27
- return /* @__PURE__ */ e("div", { class: "IncodeEmailInput", children: /* @__PURE__ */ e("div", { class: "IncodeEmailInputContainer", children: [
28
- /* @__PURE__ */ e(
21
+ }, [e, n]);
22
+ const m = (c) => {
23
+ const l = c.target.value;
24
+ s(l);
25
+ const d = l.trim(), p = d.length > 0 && g.test(d);
26
+ n(d, p);
27
+ }, u = a ? "email-error" : void 0;
28
+ return /* @__PURE__ */ i("div", { class: "IncodeEmailInput", children: /* @__PURE__ */ i("div", { class: "IncodeEmailInputContainer", children: [
29
+ /* @__PURE__ */ i(
29
30
  "div",
30
31
  {
31
32
  class: `IncodeEmailInputWrapper ${a ? "IncodeEmailInputWrapperError" : ""} ${r ? "IncodeEmailInputWrapperDisabled" : ""}`,
32
33
  children: [
33
- /* @__PURE__ */ e("label", { for: "email-input", class: "IncodeEmailInputLabel", children: "Email" }),
34
- /* @__PURE__ */ e(
34
+ /* @__PURE__ */ i("label", { for: "email-input", class: "IncodeEmailInputLabel", children: "Email" }),
35
+ /* @__PURE__ */ i(
35
36
  "input",
36
37
  {
37
38
  id: "email-input",
38
39
  type: "email",
39
- value: n,
40
+ value: t,
40
41
  onInput: m,
41
42
  placeholder: "Email",
42
43
  disabled: r,
@@ -44,19 +45,19 @@ const I = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, w = ({
44
45
  "data-testid": "email-input",
45
46
  "aria-label": "Email address",
46
47
  "aria-invalid": a ? "true" : "false",
47
- "aria-describedby": p,
48
+ "aria-describedby": u,
48
49
  autocomplete: "email"
49
50
  }
50
51
  )
51
52
  ]
52
53
  }
53
54
  ),
54
- a && /* @__PURE__ */ e(P, { children: [
55
- /* @__PURE__ */ e(g, { size: 8 }),
56
- /* @__PURE__ */ e(
55
+ a && /* @__PURE__ */ i(P, { children: [
56
+ /* @__PURE__ */ i(f, { size: 8 }),
57
+ /* @__PURE__ */ i(
57
58
  "p",
58
59
  {
59
- id: p,
60
+ id: u,
60
61
  class: "IncodeEmailInputError",
61
62
  "data-testid": "email-error",
62
63
  role: "alert",
@@ -65,39 +66,48 @@ const I = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, w = ({
65
66
  )
66
67
  ] })
67
68
  ] }) });
68
- }, C = ({ config: i, onFinish: a, onError: r }) => {
69
- const [t, n] = v(() => {
70
- if (!i)
71
- throw new Error("Email config is required");
72
- return y({ config: i });
73
- }), [o, m] = f(!1);
69
+ }, L = ({
70
+ config: e,
71
+ manager: a,
72
+ onFinish: r,
73
+ onError: n
74
+ }) => {
75
+ const [t, s] = v(
76
+ () => {
77
+ if (a) return a;
78
+ if (!e)
79
+ throw new Error("Email config is required");
80
+ return y({ config: e });
81
+ },
82
+ { manageLifecycle: !a }
83
+ ), [m, u] = b(!1);
74
84
  if (t.status === "idle" || t.status === "loadingPrefill" || t.status === "inputting" || t.status === "submitting" || t.status === "sendingOtp") {
75
- const s = t.status === "idle" || t.status === "loadingPrefill" || t.status === "submitting" || t.status === "sendingOtp", d = t.status === "inputting" ? t.prefilledEmail : void 0, u = t.status === "inputting" ? t.emailError : void 0;
76
- return /* @__PURE__ */ e(
77
- E,
85
+ const o = t.status === "idle" || t.status === "loadingPrefill" || t.status === "submitting" || t.status === "sendingOtp", l = t.status === "inputting" ? t.prefilledEmail : void 0, d = t.status === "inputting" ? t.emailError : void 0;
86
+ return /* @__PURE__ */ i(
87
+ I,
78
88
  {
79
89
  className: "IncodeEmailPage",
80
90
  title: "Verify Email",
81
- subtitle: i.otpVerification ? "We will send you a verification code" : void 0,
91
+ subtitle: e.otpVerification ? "We will send you a verification code" : void 0,
82
92
  children: [
83
- /* @__PURE__ */ e(
84
- w,
93
+ /* @__PURE__ */ i(
94
+ C,
85
95
  {
86
- prefilledEmail: d,
87
- emailError: u,
88
- disabled: s,
89
- onEmailChange: (l, c) => {
90
- n.setEmail(l, c), m(c);
96
+ prefilledEmail: l,
97
+ emailError: d,
98
+ disabled: o,
99
+ onEmailChange: (p, E) => {
100
+ s.setEmail(p, E), u(E);
91
101
  }
92
102
  }
93
103
  ),
94
- /* @__PURE__ */ e(g, {}),
95
- /* @__PURE__ */ e(
104
+ /* @__PURE__ */ i(f, {}),
105
+ /* @__PURE__ */ i(
96
106
  O,
97
107
  {
98
- onClick: () => n.submit(),
99
- disabled: !o,
100
- isLoading: s,
108
+ onClick: () => s.submit(),
109
+ disabled: !m,
110
+ isLoading: o,
101
111
  "data-testid": "email-submit",
102
112
  children: "Continue"
103
113
  }
@@ -107,31 +117,44 @@ const I = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, w = ({
107
117
  );
108
118
  }
109
119
  if (t.status === "awaitingOtp" || t.status === "verifyingOtp" || t.status === "otpError") {
110
- const s = t.status === "verifyingOtp";
111
- return /* @__PURE__ */ e(
112
- E,
120
+ const o = t.status === "verifyingOtp";
121
+ return /* @__PURE__ */ i(
122
+ I,
113
123
  {
114
124
  className: "IncodeEmailPage IncodeEmailOtpPage",
115
125
  title: "Enter Verification Code",
116
- children: /* @__PURE__ */ e(
126
+ children: /* @__PURE__ */ i(
117
127
  k,
118
128
  {
119
129
  resendTimer: t.status === "awaitingOtp" ? t.resendTimer : 0,
120
130
  canResend: t.status === "awaitingOtp" ? t.canResend : !1,
121
131
  error: t.status === "otpError" ? t.error : void 0,
122
- onSubmit: (d) => n.submitOtp(d),
123
- onResend: () => n.resendOtp(),
124
- onBack: () => n.back(),
132
+ onSubmit: (l) => s.submitOtp(l),
133
+ onResend: () => s.resendOtp(),
134
+ onBack: () => s.back(),
125
135
  backLinkText: "change email address",
126
- isLoading: s
136
+ isLoading: o
127
137
  }
128
138
  )
129
139
  }
130
140
  );
131
141
  }
132
- return t.status === "finished" ? (a?.(), null) : (t.status === "error" && r?.(t.error), null);
133
- }, L = ({ config: i, onFinish: a, onError: r }) => /* @__PURE__ */ e(h, { children: i ? /* @__PURE__ */ e(C, { config: i, onFinish: a, onError: r }) : null });
134
- b(L, "incode-email");
142
+ return t.status === "finished" ? (r?.(), null) : (t.status === "error" && n?.(t.error), null);
143
+ }, S = ({
144
+ config: e,
145
+ manager: a,
146
+ onFinish: r,
147
+ onError: n
148
+ }) => /* @__PURE__ */ i(h, { children: e ? /* @__PURE__ */ i(
149
+ L,
150
+ {
151
+ config: e,
152
+ manager: a,
153
+ onFinish: r,
154
+ onError: n
155
+ }
156
+ ) : null });
157
+ w(S, "incode-email");
135
158
  export {
136
- L as Email
159
+ S as Email
137
160
  };
@@ -1,9 +1,9 @@
1
- import { b as l, u as n, S as r, B as m } from "./incodeModule-DLGHhn9E.js";
1
+ import { b as l, u as n, S as r, B as m } from "./button-Ca1tRSTI.js";
2
2
  import { A as p, y as C } from "./vendor-preact-BXf0bkEs.js";
3
- import { E } from "./errorIcon-Cxcv4ISP.js";
4
- import { W as I } from "./warningIcon-WqI5X7cK.js";
5
- import { P as f } from "./page-BJDfLRpO.js";
6
- import { T as h } from "./spinner--i134wYq.js";
3
+ import { E } from "./errorIcon-BL647nVh.js";
4
+ import { W as I } from "./warningIcon-DyoKeqDd.js";
5
+ import { P as f } from "./page-BVHG3h0V.js";
6
+ import { T as h } from "./spinner-Cx3FPUCD.js";
7
7
  const x = ({
8
8
  title: c,
9
9
  description: s,