@incodetech/web 0.0.0-dev-20260403-eccc51c → 0.0.0-dev-20260407-4580f1c

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 (162) hide show
  1. package/dist/AsYouType-DPWqJvFu.js +2482 -0
  2. package/dist/addressAutocomplete-B3f6PGTT.js +108 -0
  3. package/dist/aligndevicelottie-C9xl1spu.js +12757 -0
  4. package/dist/antifraud/antifraud.es.js +17 -18
  5. package/dist/antifraud/styles.css +1 -1
  6. package/dist/authentication/authentication.es.js +28 -50
  7. package/dist/back-horizontal-hint-Be3dUGk6.js +137 -0
  8. package/dist/back-tutorial-BNTyW-1N.js +14584 -0
  9. package/dist/back-vertical-hint-Bz_rnhd-.js +128 -0
  10. package/dist/backdevicelottie-DBB1YCtW.js +16678 -0
  11. package/dist/base.css +327 -67
  12. package/dist/blurdevicelottie-9WvZCZ6C.js +15939 -0
  13. package/dist/browser-ponyfill-B4Qc6yfW.js +299 -0
  14. package/dist/button-DhL5eRT3.js +123 -0
  15. package/dist/checkbox-l8NxPf4o.js +85 -0
  16. package/dist/consent/consent.es.js +82 -89
  17. package/dist/consent/styles.css +1 -1
  18. package/dist/countries-y2ydYDhN.js +8323 -0
  19. package/dist/curp-validation/curp-validation.es.js +271 -313
  20. package/dist/curp-validation/styles.css +1 -1
  21. package/dist/dateInputComposed-B9WqdYx9.js +2 -0
  22. package/dist/dateInputComposed-ndsGHX1M.js +94 -0
  23. package/dist/defineProperty-brqHEHA_.js +39 -0
  24. package/dist/document-capture/styles.css +1 -1
  25. package/dist/documentCapture-wDgRLdon.js +784 -0
  26. package/dist/dropdownComposed-_Ey7wJNG.js +258 -0
  27. package/dist/ekyb/ekyb.es.js +2 -0
  28. package/dist/ekyb/styles.css +1 -1
  29. package/dist/ekybModule-BBOm1y49.js +2 -0
  30. package/dist/ekybModule-fz6i9ZRt.js +286 -0
  31. package/dist/ekyc/ekyc.es.js +2 -0
  32. package/dist/ekyc/styles.css +1 -1
  33. package/dist/ekycModule-SeTFG3AJ.js +233 -0
  34. package/dist/ekycModule-hxIcNX8n.js +2 -0
  35. package/dist/email/email.es.js +110 -154
  36. package/dist/email/styles.css +1 -1
  37. package/dist/extensibility-DJihqIzM.js +2248 -0
  38. package/dist/extensibility.es.js +22 -150
  39. package/dist/face-match/styles.css +147 -73
  40. package/dist/faceMatch-DH8sLx34.js +191 -0
  41. package/dist/flip-animation-DOJzdXB-.js +6983 -0
  42. package/dist/flow/flow.es.js +2273 -2613
  43. package/dist/flow/styles.css +432 -73
  44. package/dist/formField-BRTbY8w9.js +100 -0
  45. package/dist/front-horizontal-hint-aGAhadA2.js +380 -0
  46. package/dist/front-vertical-hint-DZz1VeNp.js +420 -0
  47. package/dist/frontdevicelottie-DadDp6be.js +17302 -0
  48. package/dist/geolocation/geolocation.es.js +852 -832
  49. package/dist/geolocation/styles.css +1 -1
  50. package/dist/glaredevicelottie-BfI84cPw.js +14466 -0
  51. package/dist/governmentValidation/governmentValidation.es.js +100 -106
  52. package/dist/governmentValidation/styles.css +1 -1
  53. package/dist/i18n-DZOHbK9q.js +1916 -0
  54. package/dist/icons-BHbofCgJ.js +245 -0
  55. package/dist/id/id.es.js +53 -59
  56. package/dist/id/styles.css +1 -1
  57. package/dist/id-laser-h-BWyU3VgL.js +467 -0
  58. package/dist/id-laser-v-JiWXUlv0.js +467 -0
  59. package/dist/id-tutorial-Cc9xg5_J.js +13152 -0
  60. package/dist/incodeModule-Bf6yJ8RB.js +18 -0
  61. package/dist/index.es.js +4 -25
  62. package/dist/inputComposed-BhbfD8Ru.js +77 -0
  63. package/dist/loadingIcon-CeQt7Zgb.js +146 -0
  64. package/dist/mandatoryConsent-LBS8E0rj.js +101 -0
  65. package/dist/numberedStep-CQVRixRP.js +11 -0
  66. package/dist/otpInput-CDIG9el7.js +143 -0
  67. package/dist/page-SvlJWUfz.js +61 -0
  68. package/dist/passport-horizontal-hint-CFsGs7Dp.js +293 -0
  69. package/dist/passport-tutorial-z0LN7Hsp.js +11688 -0
  70. package/dist/passport-vertical-hint-BnCpKWeN.js +267 -0
  71. package/dist/phone/phone.es.js +87 -121
  72. package/dist/phone/styles.css +1 -1
  73. package/dist/phoneInput-C9T_8FJt.js +138 -0
  74. package/dist/phoneInputComposed-B-0zieIW.js +407 -0
  75. package/dist/processing-B5zhNH6I.js +15 -0
  76. package/dist/redirect-to-mobile/styles.css +1 -1
  77. package/dist/richText-Db0PfpkE.js +1973 -0
  78. package/dist/rolldown-runtime-CjdbFOpI.js +13 -0
  79. package/dist/selfie/selfie.es.js +29 -50
  80. package/dist/selfie/styles.css +170 -66
  81. package/dist/selfieTutorial-B0MIyPrk.js +2676 -0
  82. package/dist/setup-Dq2bzNKH.js +15 -0
  83. package/dist/signature/signature.es.js +557 -707
  84. package/dist/signature/styles.css +1 -1
  85. package/dist/spacer-DCljE53A.js +59 -0
  86. package/dist/spinner-Bk0YuoLu.js +1 -0
  87. package/dist/spinner-snIGzmm8.js +41 -0
  88. package/dist/successIcon-AHrfmJvv.js +17 -0
  89. package/dist/tutorial-DNOd11tg.js +2780 -0
  90. package/dist/types/ekyb.d.ts +29 -0
  91. package/dist/types/ekyc.d.ts +29 -0
  92. package/dist/types/index.d.ts +0 -8
  93. package/dist/typography-BNbFNFek.js +1 -0
  94. package/dist/typography-DvHeVWfY.js +29 -0
  95. package/dist/uiConfig-CwpQ-IM6.js +20 -0
  96. package/dist/vendor-preact-D6SntenC.js +958 -0
  97. package/dist/warningIcon-Cvj-ayg1.js +17 -0
  98. package/package.json +8 -11
  99. package/dist/AsYouType-D1H_js4X.js +0 -2607
  100. package/dist/Trans-aTzdT_SA.js +0 -55
  101. package/dist/addressAutocomplete-C8-wL1j_.js +0 -153
  102. package/dist/aligndevicelottie-DlQCRPfM.js +0 -29
  103. package/dist/back-horizontal-hint-CSlf9KI1.js +0 -5
  104. package/dist/back-tutorial-An9AcMSe.js +0 -29
  105. package/dist/back-vertical-hint-CNieqiCr.js +0 -5
  106. package/dist/backdevicelottie-B4NgyWmX.js +0 -29
  107. package/dist/blurdevicelottie-_BZRug1c.js +0 -29
  108. package/dist/browser-ponyfill-B6W6hHVY.js +0 -344
  109. package/dist/button-CE9kRlem.js +0 -184
  110. package/dist/cameraView-C2X7klNb.js +0 -55
  111. package/dist/captureOverlay-tCb4R4WE.js +0 -592
  112. package/dist/checkbox-B5X-mfqq.js +0 -137
  113. package/dist/chevronDown-DSHaPKbi.js +0 -23
  114. package/dist/closeIcon-9Hc97omv.js +0 -28
  115. package/dist/countries-DfLkrF0x.js +0 -616
  116. package/dist/dateInputComposed-C7PCzh-U.js +0 -173
  117. package/dist/documentCapture-C0mO-RGE.js +0 -692
  118. package/dist/dropdownComposed-BpinYlrx.js +0 -367
  119. package/dist/ekybModule-Dr6LJUg-.js +0 -357
  120. package/dist/ekycModule-C3mswduI.js +0 -291
  121. package/dist/errorContent-Cb8nmQAE.js +0 -44
  122. package/dist/errorIcon-DEARBrGx.js +0 -26
  123. package/dist/faceMatch-DbDp7D3d.js +0 -237
  124. package/dist/fileIcon-CCSvS10T.js +0 -52
  125. package/dist/flip-animation-COR596wy.js +0 -29
  126. package/dist/flipAnimation-BqV462TA.js +0 -2059
  127. package/dist/formField-CP6wDdfA.js +0 -106
  128. package/dist/front-horizontal-hint-lRLKd7vY.js +0 -7
  129. package/dist/front-vertical-hint-qQoJXRE3.js +0 -7
  130. package/dist/frontdevicelottie-KhKxT5n9.js +0 -29
  131. package/dist/glaredevicelottie-DLuIStvb.js +0 -29
  132. package/dist/id-laser-h-BBV3r3rz.js +0 -29
  133. package/dist/id-laser-v-BTHJaSfx.js +0 -29
  134. package/dist/id-tutorial-B-F5Q28m.js +0 -29
  135. package/dist/incodeModule-C4XIllao.js +0 -96
  136. package/dist/inputComposed-fUbAGrDy.js +0 -103
  137. package/dist/instance-BWYzq8dk.js +0 -2163
  138. package/dist/loadingIcon-DmuPXh70.js +0 -195
  139. package/dist/mandatoryConsent-5xPI0cor.js +0 -94
  140. package/dist/manualCaptureButton-BvFmTyJe.js +0 -372
  141. package/dist/numberedStep-DwUB__mh.js +0 -5
  142. package/dist/otpInput-BFXhqFRT.js +0 -156
  143. package/dist/page-SrUl0qtN.js +0 -69
  144. package/dist/passport-horizontal-hint-BCtpMp1Y.js +0 -5
  145. package/dist/passport-tutorial-CaYBFTqt.js +0 -29
  146. package/dist/passport-vertical-hint-GaLnzqHP.js +0 -5
  147. package/dist/permissions-DT4Fz9MR.js +0 -709
  148. package/dist/phoneInput-CGr8TxOO.js +0 -158
  149. package/dist/phoneInputComposed-Cm9O2Jba.js +0 -206
  150. package/dist/processing-szVOCQwZ.js +0 -19
  151. package/dist/richText-cspvNz2a.js +0 -1807
  152. package/dist/selfieTutorial-Dm_p0ke9.js +0 -29
  153. package/dist/spinner-DygONskw.js +0 -60
  154. package/dist/successIcon-Bjsdc4lF.js +0 -26
  155. package/dist/tutorial-Cdz1025D.js +0 -473
  156. package/dist/types/ekyb/styles.d.ts +0 -1
  157. package/dist/types/ekyc/styles.d.ts +0 -1
  158. package/dist/typography-BDACYR5i.js +0 -14
  159. package/dist/uiConfig-Dnt-2YWB.js +0 -23
  160. package/dist/useMediaQuery-lJdQBmC2.js +0 -18
  161. package/dist/vendor-preact-BoMmvSgn.js +0 -694
  162. package/dist/warningIcon-DQq_MrOB.js +0 -26
@@ -0,0 +1,233 @@
1
+ import { n as e } from "./i18n-DZOHbK9q.js";
2
+ import { _ as t, d as n, h as r, l as i, p as a, v as o } from "./vendor-preact-D6SntenC.js";
3
+ import { c as s, o as c, r as l } from "./loadingIcon-CeQt7Zgb.js";
4
+ import { t as u } from "./button-DhL5eRT3.js";
5
+ import { t as d } from "./page-SvlJWUfz.js";
6
+ import { t as f } from "./spinner-snIGzmm8.js";
7
+ import { n as p, r as m, t as h } from "./formField-BRTbY8w9.js";
8
+ import { t as g } from "./phoneInputComposed-B-0zieIW.js";
9
+ import { t as _ } from "./dropdownComposed-_Ey7wJNG.js";
10
+ import { t as v } from "./dateInputComposed-ndsGHX1M.js";
11
+ import { t as y } from "./incodeModule-Bf6yJ8RB.js";
12
+ import { t as b } from "./addressAutocomplete-B3f6PGTT.js";
13
+ import { computeEkycDisplayErrors as x, createEkycManager as S } from "@incodetech/core/ekyc";
14
+ //#region src/modules/ekyc/ekycModule.tsx
15
+ var C = ({ config: n, onFinish: r }) => {
16
+ let { t: i } = e(), [a, c] = s(() => S({ config: n }));
17
+ return t(() => {
18
+ (a.status === "finished" || a.status === "closed") && r?.();
19
+ }, [a.status, r]), a.status === "finished" || a.status === "closed" ? null : a.status === "loading" ? /* @__PURE__ */ o(m, {
20
+ status: "submitting",
21
+ submittingTitle: i("common.loading")
22
+ }) : a.status === "submitting" ? /* @__PURE__ */ o(d, { children: /* @__PURE__ */ o(f, {
23
+ fullScreen: !1,
24
+ title: i("common.processing"),
25
+ className: "IncodeEkycSpinner"
26
+ }) }) : a.status === "success" ? /* @__PURE__ */ o(m, { status: "success" }) : a.status === "error" ? /* @__PURE__ */ o(m, {
27
+ status: "failure",
28
+ onRetry: () => c.retry(),
29
+ onSkip: () => c.skip()
30
+ }) : a.status === "misconfigured" ? /* @__PURE__ */ o(m, {
31
+ status: "failure",
32
+ failureTitle: i("verification.noFormFields"),
33
+ onSkip: () => c.close(),
34
+ skipLabel: i("common.close")
35
+ }) : a.status === "form" ? /* @__PURE__ */ o(T, {
36
+ state: a,
37
+ manager: c
38
+ }) : null;
39
+ }, w = [
40
+ "street",
41
+ "city",
42
+ "state",
43
+ "postalCode",
44
+ "houseNo"
45
+ ], T = ({ state: s, manager: l }) => {
46
+ let { fields: f, values: m, errors: y, isValid: S, addressSuggestions: C, prefilled: T, hideEmail: E, fieldsCountry: D, submitError: O, submitAttempted: k } = s, { t: A } = e(), j = i(null), M = i(null), N = i(void 0), P = c(j, f.length), [F, I] = a({}), L = r((e) => {
47
+ I((t) => t[e] ? t : {
48
+ ...t,
49
+ [e]: !0
50
+ });
51
+ }, []), { displayErrors: R, errorParams: z } = n(() => x(y, F, k, D, f), [
52
+ y,
53
+ F,
54
+ k,
55
+ D,
56
+ f
57
+ ]), B = r((e) => L(e), [L]), V = r((e, t) => {
58
+ L(e), l.setField(e, t);
59
+ }, [l, L]), H = r((e) => {
60
+ for (let e of w) L(e);
61
+ l.selectAddress(e);
62
+ }, [l, L]);
63
+ t(() => {
64
+ let e = R.postalCode, t = N.current;
65
+ if (N.current = e, !e || t === e) return;
66
+ let n = requestAnimationFrame(() => {
67
+ let e = M.current;
68
+ e && (e.querySelector("#postalCode-error") ?? e).scrollIntoView({
69
+ behavior: "smooth",
70
+ block: "nearest"
71
+ });
72
+ });
73
+ return () => cancelAnimationFrame(n);
74
+ }, [R.postalCode]);
75
+ let U = (e, t) => p(A, t, z[e]), W;
76
+ return /* @__PURE__ */ o(d, {
77
+ className: `IncodeEkycPage${P ? " IncodeEkycPageScrollable" : ""}`,
78
+ title: A("verification.title"),
79
+ children: [/* @__PURE__ */ o("div", {
80
+ ref: j,
81
+ className: "IncodeEkycForm",
82
+ children: f.map((e) => {
83
+ if (e.name === "email" && E) return null;
84
+ let t = null;
85
+ e.section && e.section !== W && (W = e.section, t = /* @__PURE__ */ o("h3", {
86
+ className: "IncodeEkycSectionHeader",
87
+ children: A({
88
+ address: "verification.labels.addressDetailsSection",
89
+ driverLicense: "verification.labels.dlDetailsSection"
90
+ }[e.section] ?? e.section)
91
+ }));
92
+ let n = e.readonly || T[e.name], r = m[e.name] ?? "", i = R[e.name];
93
+ if (e.name === "street" && e.section === "address") return /* @__PURE__ */ o("div", { children: [t, /* @__PURE__ */ o(b, {
94
+ label: e.label,
95
+ value: r,
96
+ error: i,
97
+ errorParams: z[e.name],
98
+ suggestions: C,
99
+ readonly: n,
100
+ optional: !e.required,
101
+ onChange: (e) => V("street", e),
102
+ onSearch: (e) => l.searchAddress(e),
103
+ onSelect: H,
104
+ onBlur: () => B("street")
105
+ })] }, e.name);
106
+ if (e.type === "dropdown") {
107
+ let a = A(e.label);
108
+ return /* @__PURE__ */ o("div", { children: [t, /* @__PURE__ */ o(_, {
109
+ id: `ekyc-${e.name}`,
110
+ label: a,
111
+ placeholder: e.placeholder ? A(e.placeholder) : void 0,
112
+ value: r,
113
+ options: (e.options ?? []).map((e) => ({
114
+ ...e,
115
+ label: A(e.label)
116
+ })),
117
+ error: U(e.name, i),
118
+ disabled: n,
119
+ searchable: !0,
120
+ onChange: (t) => V(e.name, t),
121
+ onBlur: () => B(e.name),
122
+ "data-testid": `ekyc-field-${e.name}`
123
+ })] }, e.name);
124
+ }
125
+ if (e.type === "date") {
126
+ let a = A(e.label);
127
+ return /* @__PURE__ */ o("div", { children: [t, /* @__PURE__ */ o(v, {
128
+ id: `ekyc-${e.name}`,
129
+ label: a,
130
+ value: r,
131
+ error: U(e.name, i),
132
+ disabled: n,
133
+ onInput: (t) => {
134
+ let n = t.target;
135
+ V(e.name, n.value);
136
+ },
137
+ onBlur: () => B(e.name),
138
+ "data-testid": `ekyc-field-${e.name}`
139
+ })] }, e.name);
140
+ }
141
+ if (e.type === "phone") {
142
+ let a = A(e.label);
143
+ return /* @__PURE__ */ o("div", { children: [t, /* @__PURE__ */ o(g, {
144
+ id: `ekyc-${e.name}`,
145
+ label: a,
146
+ countryCode: D,
147
+ value: r,
148
+ placeholder: e.placeholder,
149
+ error: U(e.name, i),
150
+ disabled: n,
151
+ disableCountrySelector: e.disableCountrySelector,
152
+ required: !1,
153
+ onChange: (t) => V(e.name, t),
154
+ onBlur: () => B(e.name),
155
+ "data-testid": `ekyc-field-${e.name}`
156
+ })] }, e.name);
157
+ }
158
+ return e.type === "radio" ? /* @__PURE__ */ o("div", { children: [t, /* @__PURE__ */ o("div", {
159
+ className: "IncodeEkycRadioGroup",
160
+ children: [
161
+ /* @__PURE__ */ o("label", {
162
+ className: "IncodeEkycRadioLabel",
163
+ children: A(e.label)
164
+ }),
165
+ /* @__PURE__ */ o("div", {
166
+ className: "IncodeEkycRadioOptions",
167
+ children: e.options?.map((t) => /* @__PURE__ */ o("label", {
168
+ className: "IncodeEkycRadioOption",
169
+ children: [/* @__PURE__ */ o("input", {
170
+ type: "radio",
171
+ name: e.name,
172
+ checked: r === t.value,
173
+ value: t.value,
174
+ onChange: () => V(e.name, t.value),
175
+ onBlur: () => B(e.name),
176
+ disabled: n
177
+ }), /* @__PURE__ */ o("span", { children: A(t.label) })]
178
+ }, t.value))
179
+ }),
180
+ i && /* @__PURE__ */ o("span", {
181
+ className: "IncodeEkycFieldError",
182
+ children: U(e.name, i)
183
+ })
184
+ ]
185
+ })] }, e.name) : /* @__PURE__ */ o("div", {
186
+ ref: e.name === "postalCode" ? M : void 0,
187
+ children: [t, /* @__PURE__ */ o(h, {
188
+ name: e.name,
189
+ label: e.label,
190
+ value: r,
191
+ error: i,
192
+ errorParams: z[e.name],
193
+ type: e.type,
194
+ placeholder: e.placeholder,
195
+ placeholderParams: e.placeholderParams,
196
+ required: e.required,
197
+ optional: e.optional,
198
+ readonly: n,
199
+ maxLength: e.maxLength,
200
+ onChange: V,
201
+ onBlur: B
202
+ })]
203
+ }, e.name);
204
+ })
205
+ }), /* @__PURE__ */ o("div", {
206
+ className: "IncodeEkycFooter",
207
+ children: [
208
+ O && /* @__PURE__ */ o("p", {
209
+ className: "IncodeEkycSubmitError",
210
+ children: A(O)
211
+ }),
212
+ /* @__PURE__ */ o(u, {
213
+ onClick: () => l.submit(),
214
+ disabled: !S,
215
+ "data-testid": "ekyc-submit",
216
+ children: A("common.continue")
217
+ }),
218
+ O === "verification.errors.countryNotSupported" && /* @__PURE__ */ o(u, {
219
+ variant: "link",
220
+ onClick: () => l.skip(),
221
+ "data-testid": "ekyc-skip",
222
+ children: A("verification.labels.skip")
223
+ })
224
+ ]
225
+ })]
226
+ });
227
+ }, E = ({ config: e, onFinish: t }) => /* @__PURE__ */ o(l, { children: e ? /* @__PURE__ */ o(C, {
228
+ config: e,
229
+ onFinish: t
230
+ }) : null });
231
+ y(E, "incode-ekyc");
232
+ //#endregion
233
+ export { E as t };
@@ -0,0 +1,2 @@
1
+ import { t as e } from "./ekycModule-SeTFG3AJ.js";
2
+ export { e as EkycModule };
@@ -1,154 +1,110 @@
1
- import { b as v, u as e, I as O, a as w, S as C } from "../loadingIcon-DmuPXh70.js";
2
- import { createEmailManager as y } from "@incodetech/core/email";
3
- import { d as b, y as P } from "../vendor-preact-BoMmvSgn.js";
4
- import "@incodetech/core";
5
- import { B as V } from "../button-CE9kRlem.js";
6
- import { O as R } from "../otpInput-BFXhqFRT.js";
7
- import { P as I } from "../page-SrUl0qtN.js";
8
- import { r as S } from "../incodeModule-C4XIllao.js";
9
- import "../instance-BWYzq8dk.js";
10
- import "../typography-BDACYR5i.js";
11
- import { a as k } from "../inputComposed-fUbAGrDy.js";
12
- import "../checkbox-B5X-mfqq.js";
13
- import "../phoneInputComposed-Cm9O2Jba.js";
14
- import "../dateInputComposed-C7PCzh-U.js";
15
- import "../captureOverlay-tCb4R4WE.js";
16
- import "../manualCaptureButton-BvFmTyJe.js";
17
- import "../countries-DfLkrF0x.js";
18
- const h = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, L = ({
19
- prefilledEmail: i,
20
- emailError: s,
21
- label: m,
22
- disabled: c = !1,
23
- required: a = !1,
24
- onEmailChange: t
25
- }) => {
26
- const { t: l } = v(), [f, p] = b("");
27
- P(() => {
28
- if (i) {
29
- p(i);
30
- const r = h.test(i.trim());
31
- t(i.trim(), r);
32
- }
33
- }, [i, t]);
34
- const E = (r) => {
35
- const d = r.target.value;
36
- p(d);
37
- const o = d.trim(), u = o.length > 0 && h.test(o);
38
- t(o, u);
39
- }, n = s ? "email-error" : void 0;
40
- return /* @__PURE__ */ e("div", { class: "IncodeEmailInput", children: /* @__PURE__ */ e("div", { class: "IncodeEmailInputContainer", children: /* @__PURE__ */ e(
41
- k,
42
- {
43
- id: "email-input",
44
- type: "email",
45
- value: f,
46
- onInput: E,
47
- placeholder: l("email.placeholder"),
48
- disabled: c,
49
- required: a,
50
- label: m,
51
- "data-testid": "email-input",
52
- "aria-label": m ? void 0 : "Email address",
53
- "aria-invalid": s ? "true" : void 0,
54
- "aria-describedby": n || void 0,
55
- autocomplete: "email",
56
- error: s,
57
- showErrorIcon: !0
58
- }
59
- ) }) });
60
- }, T = ({
61
- config: i,
62
- manager: s,
63
- onFinish: m,
64
- onError: c
65
- }) => {
66
- const { t: a } = v(), [t, l] = w(
67
- () => {
68
- if (s) return s;
69
- if (!i)
70
- throw new Error("Email config is required");
71
- return y({ config: i });
72
- },
73
- { manageLifecycle: !s }
74
- ), [f, p] = b(!1);
75
- if (t.status === "idle" || t.status === "loadingPrefill" || t.status === "inputting" || t.status === "submitting" || t.status === "sendingInitialOtp") {
76
- const n = t.status === "idle" || t.status === "loadingPrefill" || t.status === "submitting" || t.status === "sendingInitialOtp", r = t.status === "inputting" ? t.prefilledEmail : void 0, g = t.status === "inputting" && t.emailError ? a(t.emailError) : void 0, d = t.status === "inputting" ? t.otpVerification ?? !1 : !1;
77
- return /* @__PURE__ */ e(
78
- I,
79
- {
80
- className: "IncodeEmailPage",
81
- title: a("otp.enterCodeEmail"),
82
- subtitle: d ? a("email.willSendCode") : void 0,
83
- children: [
84
- /* @__PURE__ */ e(
85
- L,
86
- {
87
- prefilledEmail: r,
88
- emailError: g,
89
- disabled: n,
90
- onEmailChange: (o, u) => {
91
- l.setEmail(o, u), p(u);
92
- }
93
- }
94
- ),
95
- /* @__PURE__ */ e(C, {}),
96
- /* @__PURE__ */ e(
97
- V,
98
- {
99
- onClick: () => l.submit(),
100
- disabled: !f,
101
- isLoading: n,
102
- "data-testid": "email-submit",
103
- children: a("common.continue")
104
- }
105
- )
106
- ]
107
- },
108
- "email-input"
109
- );
110
- }
111
- if (t.status === "awaitingOtp" || t.status === "verifyingOtp" || t.status === "otpError" || t.status === "resendingOtp") {
112
- const n = t.status === "verifyingOtp", r = t.status === "otpError", g = t.status === "awaitingOtp", d = t.status === "resendingOtp", o = g || r || n;
113
- return /* @__PURE__ */ e(
114
- I,
115
- {
116
- className: "IncodeEmailPage IncodeEmailOtpPage",
117
- title: a("otp.enterCodeEmail"),
118
- children: /* @__PURE__ */ e(
119
- R,
120
- {
121
- resendTimer: o ? t.resendTimer : 0,
122
- canResend: o ? t.canResend : !1,
123
- error: r ? a(t.otpError) : void 0,
124
- isLoading: n,
125
- disabled: d || n,
126
- onSubmit: (u) => l.submitOtp(u),
127
- onResend: () => l.resendOtp(),
128
- onBack: () => l.back(),
129
- backLinkText: "otp.changeEmail"
130
- }
131
- )
132
- },
133
- "email-otp"
134
- );
135
- }
136
- return t.status === "finished" ? (m?.(), null) : (t.status === "error" && c?.(t.error), null);
137
- }, B = ({
138
- config: i,
139
- manager: s,
140
- onFinish: m,
141
- onError: c
142
- }) => /* @__PURE__ */ e(O, { children: i || s ? /* @__PURE__ */ e(
143
- T,
144
- {
145
- config: i,
146
- manager: s,
147
- onFinish: m,
148
- onError: c
149
- }
150
- ) : null });
151
- S(B, "incode-email");
152
- export {
153
- B as Email
154
- };
1
+ import { n as e } from "../i18n-DZOHbK9q.js";
2
+ import { _ as t, p as n, v as r } from "../vendor-preact-D6SntenC.js";
3
+ import { c as i, r as a } from "../loadingIcon-CeQt7Zgb.js";
4
+ import { t as o } from "../spacer-DCljE53A.js";
5
+ import { t as s } from "../button-DhL5eRT3.js";
6
+ import { t as c } from "../page-SvlJWUfz.js";
7
+ import "../extensibility-DJihqIzM.js";
8
+ import { t as l } from "../inputComposed-BhbfD8Ru.js";
9
+ import { t as u } from "../otpInput-CDIG9el7.js";
10
+ import { t as d } from "../incodeModule-Bf6yJ8RB.js";
11
+ import { createEmailManager as f } from "@incodetech/core/email";
12
+ //#region src/modules/email/emailInput.tsx
13
+ var p = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, m = ({ prefilledEmail: i, emailError: a, label: o, disabled: s = !1, required: c = !1, onEmailChange: u }) => {
14
+ let { t: d } = e(), [f, m] = n("");
15
+ t(() => {
16
+ if (i) {
17
+ m(i);
18
+ let e = p.test(i.trim());
19
+ u(i.trim(), e);
20
+ }
21
+ }, [i, u]);
22
+ let h = (e) => {
23
+ let t = e.target.value;
24
+ m(t);
25
+ let n = t.trim();
26
+ u(n, n.length > 0 && p.test(n));
27
+ }, g = a ? "email-error" : void 0;
28
+ return /* @__PURE__ */ r("div", {
29
+ class: "IncodeEmailInput",
30
+ children: /* @__PURE__ */ r("div", {
31
+ class: "IncodeEmailInputContainer",
32
+ children: /* @__PURE__ */ r(l, {
33
+ id: "email-input",
34
+ type: "email",
35
+ value: f,
36
+ onInput: h,
37
+ placeholder: d("email.placeholder"),
38
+ disabled: s,
39
+ required: c,
40
+ label: o,
41
+ "data-testid": "email-input",
42
+ "aria-label": o ? void 0 : "Email address",
43
+ "aria-invalid": a ? "true" : void 0,
44
+ "aria-describedby": g || void 0,
45
+ autocomplete: "email",
46
+ error: a,
47
+ showErrorIcon: !0
48
+ })
49
+ })
50
+ });
51
+ }, h = ({ config: t, manager: a, onFinish: l, onError: d }) => {
52
+ let { t: p } = e(), [h, g] = i(() => {
53
+ if (a) return a;
54
+ if (!t) throw Error("Email config is required");
55
+ return f({ config: t });
56
+ }, { manageLifecycle: !a }), [_, v] = n(!1);
57
+ if (h.status === "idle" || h.status === "loadingPrefill" || h.status === "inputting" || h.status === "submitting" || h.status === "sendingInitialOtp") {
58
+ let e = h.status === "idle" || h.status === "loadingPrefill" || h.status === "submitting" || h.status === "sendingInitialOtp", t = h.status === "inputting" ? h.prefilledEmail : void 0, n = h.status === "inputting" && h.emailError ? p(h.emailError) : void 0, i = h.status === "inputting" ? h.otpVerification ?? !1 : !1;
59
+ return /* @__PURE__ */ r(c, {
60
+ className: "IncodeEmailPage",
61
+ title: p("otp.enterCodeEmail"),
62
+ subtitle: i ? p("email.willSendCode") : void 0,
63
+ children: [
64
+ /* @__PURE__ */ r(m, {
65
+ prefilledEmail: t,
66
+ emailError: n,
67
+ disabled: e,
68
+ onEmailChange: (e, t) => {
69
+ g.setEmail(e, t), v(t);
70
+ }
71
+ }),
72
+ /* @__PURE__ */ r(o, {}),
73
+ /* @__PURE__ */ r(s, {
74
+ onClick: () => g.submit(),
75
+ disabled: !_,
76
+ isLoading: e,
77
+ "data-testid": "email-submit",
78
+ children: p("common.continue")
79
+ })
80
+ ]
81
+ }, "email-input");
82
+ }
83
+ if (h.status === "awaitingOtp" || h.status === "verifyingOtp" || h.status === "otpError" || h.status === "resendingOtp") {
84
+ let e = h.status === "verifyingOtp", t = h.status === "otpError", n = h.status === "awaitingOtp", i = h.status === "resendingOtp", a = n || t || e;
85
+ return /* @__PURE__ */ r(c, {
86
+ className: "IncodeEmailPage IncodeEmailOtpPage",
87
+ title: p("otp.enterCodeEmail"),
88
+ children: /* @__PURE__ */ r(u, {
89
+ resendTimer: a ? h.resendTimer : 0,
90
+ canResend: a ? h.canResend : !1,
91
+ error: t ? p(h.otpError) : void 0,
92
+ isLoading: e,
93
+ disabled: i || e,
94
+ onSubmit: (e) => g.submitOtp(e),
95
+ onResend: () => g.resendOtp(),
96
+ onBack: () => g.back(),
97
+ backLinkText: "otp.changeEmail"
98
+ })
99
+ }, "email-otp");
100
+ }
101
+ return h.status === "finished" ? (l?.(), null) : (h.status === "error" && d?.(h.error), null);
102
+ }, g = ({ config: e, manager: t, onFinish: n, onError: i }) => /* @__PURE__ */ r(a, { children: e || t ? /* @__PURE__ */ r(h, {
103
+ config: e,
104
+ manager: t,
105
+ onFinish: n,
106
+ onError: i
107
+ }) : null });
108
+ d(g, "incode-email");
109
+ //#endregion
110
+ export { g as Email };
@@ -1,4 +1,4 @@
1
- /*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */
1
+ /*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */
2
2
  .IncodeEmailPage .IncodePageContent {
3
3
  padding-top: var(--spacing-32, var(--spacing-32, 32px));
4
4
  padding-bottom: var(--spacing-16, var(--spacing-16, 16px));