@incodetech/web 0.0.0-dev-20260608-c8c427ca → 0.0.0-dev-20260608-fe5ac64f

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 (206) hide show
  1. package/dist/ae-signature/ae-signature.es.js +15 -13
  2. package/dist/aligndevicelottie-DY_bX_p8.js +12769 -0
  3. package/dist/antifraud/antifraud.es.js +22 -19
  4. package/dist/authentication/authentication.es.js +42 -33
  5. package/dist/autoFocusTitle-DM6PvgcP.js +29 -0
  6. package/dist/{back-horizontal-hint-DsPhKbR4.js → back-horizontal-hint-BXYix0Wj.js} +26 -26
  7. package/dist/back-tutorial-vb1MxlrT.js +14597 -0
  8. package/dist/{back-vertical-hint-BFJbYQrX.js → back-vertical-hint-DNSh6JNH.js} +27 -27
  9. package/dist/backdevicelottie-HypPqBz7.js +16690 -0
  10. package/dist/blurdevicelottie-CBXtBFiJ.js +15951 -0
  11. package/dist/bottomSheet-BuzqNQtG.js +39 -0
  12. package/dist/browser-ponyfill-CLLvZCVg.js +441 -0
  13. package/dist/button-B-qlr4iI.js +35 -0
  14. package/dist/checkbox-CTPETqo5.js +96 -0
  15. package/dist/consent/consent.es.js +75 -64
  16. package/dist/countrySelector-CzyuaDIs.js +60 -0
  17. package/dist/cpf-ocr/cpf-ocr.es.js +2 -2
  18. package/dist/cpfOcr-7DkO3a4-.js +92 -0
  19. package/dist/cpfOcr-BrpGqevl.js +2 -0
  20. package/dist/cross-document-data-match/cross-document-data-match.es.js +20 -17
  21. package/dist/curp-validation/curp-validation.es.js +246 -211
  22. package/dist/customFields-CJxcEDgu.js +140 -0
  23. package/dist/customWatchlist-BvfsU7r-.js +36 -0
  24. package/dist/dateInputComposed-BsPQHG5o.js +1 -0
  25. package/dist/dateInputComposed-DY97tQVK.js +69 -0
  26. package/dist/defineProperty-mefzVtTv.js +39 -0
  27. package/dist/document-capture/document-capture.es.js +2 -2
  28. package/dist/documentCapture-CQSmWEdd.js +876 -0
  29. package/dist/documentCapture-r1zYPBgS.js +2 -0
  30. package/dist/dropdownComposed-BF4L-7mJ.js +380 -0
  31. package/dist/dropdownComposed-mvHuRFHn.js +1 -0
  32. package/dist/dynamicForms-DranXtuE.js +352 -0
  33. package/dist/ekyb/ekyb.es.js +2 -2
  34. package/dist/ekybModule-DOOUw8h0.js +2 -0
  35. package/dist/ekybModule-DSOvdViS.js +279 -0
  36. package/dist/ekyc/ekyc.es.js +2 -2
  37. package/dist/ekycModule-BYHmHRia.js +2 -0
  38. package/dist/ekycModule-DtzcD2wV.js +257 -0
  39. package/dist/electronic-signature/electronic-signature.es.js +2 -2
  40. package/dist/electronic-signature-B0SDITm5.js +426 -0
  41. package/dist/email/email.es.js +198 -78
  42. package/dist/emailInput-D8qiAdjn.js +39 -0
  43. package/dist/errorIcon-B0rmz3rw.js +26 -0
  44. package/dist/expiredId-Du3HsBaI.js +85 -0
  45. package/dist/extensibility-FK5oOsIJ.js +3070 -0
  46. package/dist/extensibility.es.js +26 -26
  47. package/dist/face-match/face-match.es.js +2 -2
  48. package/dist/faceMatch-C0UL_xA7.js +2 -0
  49. package/dist/faceMatch-DJMba1pt.js +343 -0
  50. package/dist/field-comparison/field-comparison.es.js +2 -2
  51. package/dist/fieldComparison-CcJA6KR5.js +88 -0
  52. package/dist/fieldComparison-CvnNOIWA.js +2 -0
  53. package/dist/{flip-animation-CuQ57qTn.js → flip-animation-BGRvygw9.js} +4221 -4221
  54. package/dist/flow/flow.es.js +597 -493
  55. package/dist/{front-horizontal-hint-CKm7PnmS.js → front-horizontal-hint-CLSU0iVo.js} +70 -70
  56. package/dist/{front-vertical-hint-CLHC2qoH.js → front-vertical-hint-BWq-yWQ8.js} +81 -81
  57. package/dist/frontdevicelottie-CLqitJhG.js +17314 -0
  58. package/dist/geolocation/geolocation.es.js +485 -395
  59. package/dist/glaredevicelottie-BS04U6Fc.js +14478 -0
  60. package/dist/governmentValidation/governmentValidation.es.js +67 -59
  61. package/dist/homeScreen-BsEYyiDB.js +264 -0
  62. package/dist/hooks-BtgmGvba.js +149 -0
  63. package/dist/i18n-gTHArCl9.js +2971 -0
  64. package/dist/icons-DKY3xDkf.js +360 -0
  65. package/dist/id/id.es.js +565 -413
  66. package/dist/id-laser-h-DX8UbVNH.js +467 -0
  67. package/dist/id-laser-v-DhnHdjlB.js +490 -0
  68. package/dist/id-tutorial-lj4iKtYT.js +13165 -0
  69. package/dist/id-verification/id-verification.es.js +21 -18
  70. package/dist/idOcr-CfqkKAZH.js +123 -0
  71. package/dist/identity-reuse/identity-reuse.es.js +168 -130
  72. package/dist/incode-logo-57XFniXU.js +4 -0
  73. package/dist/incodeComponent-CDJxFZvS.js +63 -0
  74. package/dist/incodeModule-DkA_yd0X.js +13 -0
  75. package/dist/index.es.js +16 -14
  76. package/dist/inputComposed-5V2nLTqH.js +99 -0
  77. package/dist/inputComposed-BPOYwUBl.js +1 -0
  78. package/dist/loadingIcon-DN62ugKs.js +148 -0
  79. package/dist/lottie_light-Dp9Bz3mf.js +9031 -0
  80. package/dist/mandatoryConsent-DxL7lmfQ.js +107 -0
  81. package/dist/modal-B5QeulDu.js +153 -0
  82. package/dist/modal.hooks-C7K9k_pY.js +202 -0
  83. package/dist/numberedStep-DVAyTPv1.js +13 -0
  84. package/dist/optionAccessibleLabel-Czc2YC8z.js +202 -0
  85. package/dist/otpInput-2IQ-JCK8.js +195 -0
  86. package/dist/page-6bCuq5Q6.js +70 -0
  87. package/dist/{passport-horizontal-hint-C_le0HVU.js → passport-horizontal-hint-DfVsf4Cc.js} +55 -55
  88. package/dist/{passport-tutorial-BYN4T_TE.js → passport-tutorial-zT1ZoA-D.js} +7096 -7084
  89. package/dist/{passport-vertical-hint-H-pyICSv.js → passport-vertical-hint-DVxbTyQp.js} +49 -49
  90. package/dist/pdf-BZA70WbM.js +22398 -0
  91. package/dist/pdfViewer-Dr63sJ51.js +114 -0
  92. package/dist/phone/phone.es.js +214 -87
  93. package/dist/phoneInputComposed-D_IabWKJ.js +12142 -0
  94. package/dist/processing-B_u8wUB7.js +8 -0
  95. package/dist/qe-signature/qe-signature.es.js +15 -13
  96. package/dist/radioGroupComposed-DwYW-Ld-.js +215 -0
  97. package/dist/redirect-to-mobile/redirect-to-mobile.es.js +2099 -859
  98. package/dist/registerIncodeElement-BJJGzVdq.js +11 -0
  99. package/dist/requiredLabelHint-DEadtiwx.js +17 -0
  100. package/dist/richText-C7GUm0WL.js +3153 -0
  101. package/dist/rolldown-runtime--E5BIlTp.js +33 -0
  102. package/dist/selfie/selfie.es.js +54 -42
  103. package/dist/selfieTutorial-CtruLyO2.js +2689 -0
  104. package/dist/signature/signature.es.js +765 -406
  105. package/dist/snackbar-Dz9crm39.js +16 -0
  106. package/dist/spinner-BfBIZkDQ.js +42 -0
  107. package/dist/spinner-DEDtE7Pz.js +1 -0
  108. package/dist/statusPage-B1Ef7J5K.js +28 -0
  109. package/dist/successIcon-rmzr-pxu.js +30 -0
  110. package/dist/tabs--UMd6eEB.js +103 -0
  111. package/dist/transitionSpinner-CWhGcr7c.js +26 -0
  112. package/dist/{tutorial-QzQ536BL.js → tutorial-y-nq6ZhF.js} +832 -578
  113. package/dist/types/index.d.ts +13 -4
  114. package/dist/typography-BK4AmfKX.js +45 -0
  115. package/dist/uiConfig-sgEkFuuA.js +25 -0
  116. package/dist/useModuleLoader-8LslB-YG.js +670 -0
  117. package/dist/vendor-preact-BH7vOa2r.js +957 -0
  118. package/dist/verificationResult-CbVRf6Kh.js +91 -0
  119. package/dist/verifiedByIncode-8QBn-kgZ.js +103 -0
  120. package/dist/watchlist/watchlist.es.js +31 -26
  121. package/dist/watchlistForBusiness-Dfn1UMow.js +80 -0
  122. package/dist/workflow/workflow.es.js +251 -209
  123. package/package.json +4 -2
  124. package/dist/aligndevicelottie-D8KsO77t.js +0 -12757
  125. package/dist/autoFocusTitle-BpYdaSUM.js +0 -16
  126. package/dist/back-tutorial-DhSE2FJo.js +0 -14585
  127. package/dist/backdevicelottie-CJWGVMdw.js +0 -16678
  128. package/dist/blurdevicelottie-Dxt2deEB.js +0 -15939
  129. package/dist/bottomSheet-QrpyatOD.js +0 -31
  130. package/dist/browser-ponyfill-Crda_c5R.js +0 -299
  131. package/dist/button-DcCUEn2n.js +0 -24
  132. package/dist/checkbox-DCCzBAuF.js +0 -86
  133. package/dist/countrySelector-CJ8egQ4C.js +0 -58
  134. package/dist/cpfOcr-Db06i-Lm.js +0 -2
  135. package/dist/cpfOcr-FixhUeMQ.js +0 -79
  136. package/dist/customFields-C1G9xHNX.js +0 -125
  137. package/dist/customWatchlist-IKEblz7u.js +0 -31
  138. package/dist/dateInputComposed-Cg8BvYSK.js +0 -1
  139. package/dist/dateInputComposed-Ddd7HLyM.js +0 -58
  140. package/dist/defineProperty-xczUyn-m.js +0 -39
  141. package/dist/documentCapture-D9I7FjGe.js +0 -2
  142. package/dist/documentCapture-b61wlala.js +0 -765
  143. package/dist/dropdownComposed-B4U0AIak.js +0 -1
  144. package/dist/dropdownComposed-CS2pyn-g.js +0 -293
  145. package/dist/dynamicForms-tYQog0kw.js +0 -298
  146. package/dist/ekybModule-C33C4JES.js +0 -237
  147. package/dist/ekybModule-LON6G2Bz.js +0 -2
  148. package/dist/ekycModule-BJOgtTAh.js +0 -225
  149. package/dist/ekycModule-BSf_DIG7.js +0 -2
  150. package/dist/electronic-signature-OdgTyso4.js +0 -406
  151. package/dist/emailInput-CU7mLB21.js +0 -37
  152. package/dist/errorIcon-DpHzAoAo.js +0 -24
  153. package/dist/expiredId-nfVAZgTL.js +0 -70
  154. package/dist/extensibility-BbNy3mVG.js +0 -2602
  155. package/dist/faceMatch-BIila4kf.js +0 -2
  156. package/dist/faceMatch-DJ7Mqujx.js +0 -206
  157. package/dist/fieldComparison-D2RSFYl-.js +0 -84
  158. package/dist/fieldComparison-DbUyouFd.js +0 -2
  159. package/dist/frontdevicelottie-65Vyfpff.js +0 -17302
  160. package/dist/glaredevicelottie-BEyaqtc6.js +0 -14466
  161. package/dist/homeScreen-CyPddxWl.js +0 -227
  162. package/dist/hooks-MxHtZWTS.js +0 -112
  163. package/dist/i18n-Kzzvkz94.js +0 -2019
  164. package/dist/icons-9I5g9-_1.js +0 -292
  165. package/dist/id-laser-h-iCPbFixz.js +0 -467
  166. package/dist/id-laser-v-CNzwliP2.js +0 -483
  167. package/dist/id-tutorial-CF4nO4oX.js +0 -13153
  168. package/dist/idOcr-DlMLMDqa.js +0 -97
  169. package/dist/incode-logo-DX016usY.js +0 -4
  170. package/dist/incodeComponent-BoFhgK7G.js +0 -50
  171. package/dist/incodeModule-BiCoAJ5k.js +0 -13
  172. package/dist/inputComposed-DAEey9xm.js +0 -94
  173. package/dist/inputComposed-eS4B0Mkh.js +0 -1
  174. package/dist/loadingIcon-BN5YRQUb.js +0 -104
  175. package/dist/lottie_light-DLqSnziX.js +0 -4419
  176. package/dist/mandatoryConsent-DNz2jZ43.js +0 -98
  177. package/dist/modal-ZqAhwiRF.js +0 -135
  178. package/dist/modal.hooks-LdusROLW.js +0 -126
  179. package/dist/numberedStep-CdLWASwL.js +0 -11
  180. package/dist/optionAccessibleLabel-DcygPaME.js +0 -140
  181. package/dist/otpInput-C4pk4BJU.js +0 -157
  182. package/dist/page-DA3R7q0J.js +0 -69
  183. package/dist/pdf-51QeiFSx.js +0 -14967
  184. package/dist/pdfViewer-rKzTHket.js +0 -64
  185. package/dist/phoneInputComposed-CjAxk2Gj.js +0 -11230
  186. package/dist/processing-DPktVde2.js +0 -6
  187. package/dist/radioGroupComposed-DRRxVk9Z.js +0 -178
  188. package/dist/registerIncodeElement-BHWOwdSS.js +0 -7
  189. package/dist/requiredLabelHint-B6FN3v88.js +0 -13
  190. package/dist/richText-6pIbydcz.js +0 -1973
  191. package/dist/rolldown-runtime-CYMK-g2i.js +0 -20
  192. package/dist/selfieTutorial-Yo9AlUoT.js +0 -2677
  193. package/dist/snackbar-CQiiWO4p.js +0 -14
  194. package/dist/spinner-B4dcie2T.js +0 -1
  195. package/dist/spinner-CKnjVHxw.js +0 -39
  196. package/dist/statusPage-B8b3Jg6N.js +0 -28
  197. package/dist/successIcon-SlKgTSty.js +0 -28
  198. package/dist/tabs-D7lGst3Q.js +0 -78
  199. package/dist/transitionSpinner-Di3bOyOu.js +0 -17
  200. package/dist/typography-CxjaknHN.js +0 -28
  201. package/dist/uiConfig-CwpQ-IM6.js +0 -20
  202. package/dist/useModuleLoader-Bqs7fglI.js +0 -517
  203. package/dist/vendor-preact-D6SntenC.js +0 -958
  204. package/dist/verificationResult-DhT3hH1b.js +0 -90
  205. package/dist/verifiedByIncode-DpbxzO0y.js +0 -101
  206. package/dist/watchlistForBusiness-CRXVbH4l.js +0 -75
@@ -1,90 +1,98 @@
1
- import { n as e } from "../i18n-Kzzvkz94.js";
2
- import { S as t, v as n } from "../vendor-preact-D6SntenC.js";
3
- import { c as r, o as i } from "../hooks-MxHtZWTS.js";
4
- import { t as a } from "../incodeComponent-BoFhgK7G.js";
5
- import { r as o } from "../loadingIcon-BN5YRQUb.js";
6
- import { t as s } from "../page-DA3R7q0J.js";
7
- import "../extensibility-BbNy3mVG.js";
8
- import { t as c } from "../autoFocusTitle-BpYdaSUM.js";
9
- import { t as l } from "../verificationResult-DhT3hH1b.js";
10
- import { t as u } from "../otpInput-C4pk4BJU.js";
11
- import { t as d } from "../incodeModule-BiCoAJ5k.js";
12
- import { createGovernmentValidationManager as f } from "@incodetech/core/government-validation";
1
+ import { n as useTranslation } from "../i18n-gTHArCl9.js";
2
+ import { S as k, v as u } from "../vendor-preact-BH7vOa2r.js";
3
+ import { c as useManager, o as useModuleTerminalCallbacks } from "../hooks-BtgmGvba.js";
4
+ import { t as IncodeComponent } from "../incodeComponent-CDJxFZvS.js";
5
+ import { r as Spacer } from "../loadingIcon-DN62ugKs.js";
6
+ import { t as Page } from "../page-6bCuq5Q6.js";
7
+ import "../extensibility-FK5oOsIJ.js";
8
+ import { t as AutoFocusTitle } from "../autoFocusTitle-DM6PvgcP.js";
9
+ import { t as VerificationResult } from "../verificationResult-CbVRf6Kh.js";
10
+ import { t as OtpInput } from "../otpInput-2IQ-JCK8.js";
11
+ import { t as registerIncodeModuleElement } from "../incodeModule-DkA_yd0X.js";
12
+ import { createGovernmentValidationManager } from "@incodetech/core/government-validation";
13
13
  //#endregion
14
14
  //#region src/modules/governmentValidation/governmentValidation.tsx
15
- var p = ({ config: a, onFinish: d }) => {
16
- let { t: p } = e(), [m, h] = r(() => {
17
- if (!a) throw Error("GovernmentValidation config is required");
18
- return f({ config: a });
15
+ var GovernmentValidationContent = ({ config, onFinish }) => {
16
+ const { t } = useTranslation();
17
+ const [state, manager] = useManager(() => {
18
+ if (!config) throw new Error("GovernmentValidation config is required");
19
+ return createGovernmentValidationManager({ config });
19
20
  });
20
- if (i({
21
- status: m.status === "finished" ? "finished" : "loading",
22
- onFinish: d
23
- }), a.backgroundExecution || m.status === "finished") return null;
24
- let g = m.status === "awaitingOtp" || m.status === "verifyingOtp";
25
- return /* @__PURE__ */ n(t, { children: [
26
- (m.status === "idle" || m.status === "loading") && /* @__PURE__ */ n(l, {
21
+ useModuleTerminalCallbacks({
22
+ status: state.status === "finished" ? "finished" : "loading",
23
+ onFinish
24
+ });
25
+ if (config.backgroundExecution || state.status === "finished") return null;
26
+ const isOtpStep = state.status === "awaitingOtp" || state.status === "verifyingOtp";
27
+ return /* @__PURE__ */ u(k, { children: [
28
+ (state.status === "idle" || state.status === "loading") && /* @__PURE__ */ u(VerificationResult, {
27
29
  status: "submitting",
28
- submittingTitle: `${p("ineCheck.verifying")} ${p("ineCheck.identity")}`
30
+ submittingTitle: `${t("ineCheck.verifying")} ${t("ineCheck.identity")}`
29
31
  }),
30
- m.status === "displaySuccess" && /* @__PURE__ */ n(l, {
32
+ state.status === "displaySuccess" && /* @__PURE__ */ u(VerificationResult, {
31
33
  status: "success",
32
- successTitle: p("ineCheck.verified")
34
+ successTitle: t("ineCheck.verified")
33
35
  }),
34
- m.status === "processing" && /* @__PURE__ */ n(l, {
36
+ state.status === "processing" && /* @__PURE__ */ u(VerificationResult, {
35
37
  status: "success",
36
- successTitle: p("ineCheck.processing")
38
+ successTitle: t("ineCheck.processing")
37
39
  }),
38
- g && (() => {
39
- let e = m.status === "verifyingOtp", t = m.status === "awaitingOtp" ? m.otpError : void 0, r = m.status === "awaitingOtp" && m.otpValidationErrors?.otp ? p("otp.incompleteCode", { length: m.otpLength }) : void 0, i = m.status === "awaitingOtp" ? m.isOtpValid : !0;
40
- return /* @__PURE__ */ n("div", {
40
+ isOtpStep && (() => {
41
+ const isVerifying = state.status === "verifyingOtp";
42
+ const otpError = state.status === "awaitingOtp" ? state.otpError : void 0;
43
+ const otpValidationError = state.status === "awaitingOtp" && state.otpValidationErrors?.otp ? t("otp.incompleteCode", { length: state.otpLength }) : void 0;
44
+ const isOtpValid = state.status === "awaitingOtp" ? state.isOtpValid : true;
45
+ return /* @__PURE__ */ u("div", {
41
46
  class: "IncodeGovtValidation IncodeGovtValidation--otp",
42
- children: /* @__PURE__ */ n(s, {
47
+ children: /* @__PURE__ */ u(Page, {
43
48
  className: "IncodeGovtValidationPage",
44
49
  children: [
45
- /* @__PURE__ */ n(o, { size: 16 }),
46
- /* @__PURE__ */ n("div", {
50
+ /* @__PURE__ */ u(Spacer, { size: 16 }),
51
+ /* @__PURE__ */ u("div", {
47
52
  class: "IncodeGovtValidationOtpInstructions",
48
- children: [/* @__PURE__ */ n(c, { children: p("otp.insertSMS") }), /* @__PURE__ */ n("p", { children: p("otp.focus") })]
53
+ children: [/* @__PURE__ */ u(AutoFocusTitle, { children: t("otp.insertSMS") }), /* @__PURE__ */ u("p", { children: t("otp.focus") })]
49
54
  }),
50
- /* @__PURE__ */ n(u, {
51
- value: m.otpCode,
52
- otpLength: m.otpLength,
53
- resendTimer: m.status === "awaitingOtp" ? m.resendTimer : 0,
54
- canResend: m.status === "awaitingOtp" ? m.canResend : !1,
55
- error: t,
56
- validationError: r,
57
- isValid: i,
58
- onSubmit: (e) => h.submitOtp(e),
59
- onChange: (e) => h.setOtpCode(e),
60
- onValidate: () => h.validateOtp(),
61
- onResend: () => h.resendOtp(),
55
+ /* @__PURE__ */ u(OtpInput, {
56
+ value: state.otpCode,
57
+ otpLength: state.otpLength,
58
+ resendTimer: state.status === "awaitingOtp" ? state.resendTimer : 0,
59
+ canResend: state.status === "awaitingOtp" ? state.canResend : false,
60
+ error: otpError,
61
+ validationError: otpValidationError,
62
+ isValid: isOtpValid,
63
+ onSubmit: (code) => manager.submitOtp(code),
64
+ onChange: (code) => manager.setOtpCode(code),
65
+ onValidate: () => manager.validateOtp(),
66
+ onResend: () => manager.resendOtp(),
62
67
  onBack: () => {},
63
- isLoading: e
68
+ isLoading: isVerifying
64
69
  })
65
70
  ]
66
71
  })
67
72
  });
68
73
  })(),
69
- m.status === "error" && /* @__PURE__ */ n(l, {
74
+ state.status === "error" && /* @__PURE__ */ u(VerificationResult, {
70
75
  status: "failure",
71
- failureTitle: `${p("ineCheck.failure1")} ${p("ineCheck.failure2")}`
76
+ failureTitle: `${t("ineCheck.failure1")} ${t("ineCheck.failure2")}`
72
77
  }),
73
- m.status === "unknown" && /* @__PURE__ */ n(l, {
78
+ state.status === "unknown" && /* @__PURE__ */ u(VerificationResult, {
74
79
  status: "warning",
75
- warningTitle: p("ineCheck.unknown")
80
+ warningTitle: t("ineCheck.unknown")
76
81
  }),
77
- !g && /* @__PURE__ */ n("img", {
82
+ !isOtpStep && /* @__PURE__ */ u("img", {
78
83
  src: "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='263'%20height='32'%20fill='none'%20viewBox='0%200%20263%2032'%3e%3cpath%20fill='%233CB0F7'%20fill-rule='evenodd'%20d='M172.842%204.824h2.986v2.654h-2.986V4.824zM172.922%209.795h2.799l.027%2013.939h-2.826V9.794zM179.773%2010.857c.799-.428%201.772-.778%202.919-1.048%201.146-.27%202.243-.405%203.292-.405%201.865%200%203.243.41%204.131%201.23.889.819%201.333%202.094%201.333%203.826v9.274h-2.799v-8.883c0-1.955-1.057-2.933-3.172-2.933-1.013%200-1.981.177-2.905.531v11.285h-2.799V10.857zM201.284%2024.014c-1.884%200-3.452-.568-4.705-1.704-1.253-1.136-1.879-2.97-1.879-5.503%200-2.607.618-4.493%201.853-5.657%201.235-1.164%202.803-1.746%204.704-1.746%201.44%200%202.808.28%204.105.838v2.626c-1.35-.596-2.585-.894-3.705-.894-1.404%200-2.452.368-3.145%201.104-.693.735-1.04%201.904-1.04%203.505%200%201.676.338%202.9%201.013%203.674.676.772%201.76%201.159%203.252%201.159%201.209%200%202.426-.308%203.652-.922v2.626c-1.279.596-2.648.893-4.105.893zM209.534%2022.254c1.075%201.267%202.679%201.9%204.811%201.9%202.062%200%203.652-.643%204.772-1.928%201.119-1.285%201.679-3.119%201.679-5.502%200-2.384-.542-4.204-1.626-5.462-1.084-1.257-2.701-1.885-4.851-1.885-4.265%200-6.398%202.449-6.398%207.347%200%202.42.538%204.264%201.613%205.53zm8.463-5.53c0%203.296-1.226%204.944-3.678%204.944-1.262%200-2.182-.424-2.759-1.271-.578-.848-.866-2.072-.866-3.674%200-1.601.279-2.816.839-3.645.56-.829%201.489-1.243%202.786-1.243%201.279%200%202.212.405%202.799%201.215.586.81.879%202.035.879%203.673zM235.697%2020.773V3.846h-2.772v6.313c-.498-.261-1.062-.457-1.693-.587-.631-.13-1.186-.195-1.666-.195-2.061%200-3.616.633-4.665%201.899-1.048%201.266-1.572%203.026-1.572%205.28%200%202.811.613%204.78%201.839%205.907%201.226%201.127%202.79%201.69%204.691%201.69.942%200%201.857-.12%202.746-.363.888-.242%201.626-.619%202.212-1.131.587-.512.88-1.14.88-1.886zm-4.198-8.673c.524.14.999.34%201.426.6v7.794c0%20.335-.28.605-.84.81-.56.205-1.248.307-2.066.307-1.421%200-2.417-.442-2.985-1.326-.569-.885-.853-2.11-.853-3.674%200-3.147%201.262-4.72%203.785-4.72.498%200%201.008.07%201.533.21zM249.731%2011.486c-.968-1.406-2.492-2.109-4.571-2.109-1.973%200-3.501.638-4.585%201.913-1.084%201.276-1.626%203.115-1.626%205.517%200%202.347.573%204.158%201.719%205.433%201.146%201.276%202.724%201.914%204.732%201.914%201.795%200%203.385-.317%204.771-.95v-2.737c-.569.335-1.226.61-1.972.824-.747.214-1.529.32-2.346.32-1.262%200-2.235-.358-2.919-1.075-.684-.717-1.071-1.764-1.159-3.142h9.382c.018-2.533-.457-4.502-1.426-5.908zm-6.864%201.075c.534-.521%201.271-.782%202.213-.782.995%200%201.75.275%202.266.824.515.55.835%201.42.959%202.612h-6.477c.16-1.248.506-2.132%201.039-2.654z'%20clip-rule='evenodd'/%3e%3cpath%20fill='%23E9E9EB'%20d='M152.315%2016.205v2.747h4.763v4.94h2.822v-4.94h4.788v-2.747H159.9v-4.914h-2.822v4.914h-4.763z'/%3e%3cpath%20fill='%233E3F42'%20d='M51.46%2024v-7.38h-7.08v2.4h4.48c-.16%201-1.18%202.76-3.8%202.76-2.38%200-4.48-1.66-4.48-4.86%200-3.36%202.32-4.82%204.46-4.82%202.3%200%203.48%201.46%203.84%202.72l2.64-.94c-.7-2.18-2.76-4.36-6.48-4.36-3.84%200-7.26%202.82-7.26%207.4s3.26%207.38%207.08%207.38c2.14%200%203.54-.96%204.18-1.92l.18%201.62h2.24zm6.005-2.12c-1.3%200-2.5-.96-2.5-2.8%200-1.86%201.2-2.8%202.5-2.8s2.5.94%202.5%202.8c0%201.86-1.2%202.8-2.5%202.8zm0-8.02c-2.94%200-5.16%202.18-5.16%205.22%200%203.02%202.22%205.22%205.16%205.22s5.16-2.2%205.16-5.22c0-3.04-2.22-5.22-5.16-5.22zm15.247.3h-2.8l-2.34%206.6-2.44-6.6h-2.92l4.02%209.84h2.66l3.82-9.84zm2.265%203.8c.06-.9.82-1.94%202.2-1.94%201.52%200%202.16.96%202.2%201.94h-4.4zm4.66%202.56c-.32.88-1%201.5-2.24%201.5-1.32%200-2.42-.94-2.48-2.24h7.04c0-.04.04-.44.04-.82%200-3.16-1.82-5.1-4.86-5.1-2.52%200-4.84%202.04-4.84%205.18%200%203.32%202.38%205.26%205.08%205.26%202.42%200%203.98-1.42%204.48-3.12l-2.22-.66zm9.455-6.4c-.2-.02-.4-.04-.62-.04-.84%200-2.2.24-2.8%201.54v-1.46h-2.58V24h2.66v-4.5c0-2.12%201.18-2.78%202.54-2.78.24%200%20.5.02.8.08v-2.68zm3.531%204.22c0-1.14.68-2.04%201.84-2.04%201.28%200%201.82.86%201.82%201.96V24h2.66v-6.2c0-2.16-1.12-3.9-3.56-3.9-1.06%200-2.24.46-2.84%201.48v-1.22h-2.58V24h2.66v-5.66zm10.68%205.66v-5.76c0-1.08.68-1.94%201.84-1.94%201.2%200%201.74.8%201.74%201.86V24h2.64v-5.76c0-1.06.68-1.94%201.82-1.94%201.22%200%201.74.8%201.74%201.86V24h2.58v-6.38c0-2.64-1.74-3.74-3.56-3.74-1.3%200-2.34.44-3.12%201.64-.5-1.06-1.58-1.64-2.92-1.64-1.08%200-2.34.52-2.88%201.48v-1.2h-2.54V24h2.66zm15.995-6.04c.06-.9.82-1.94%202.2-1.94%201.52%200%202.16.96%202.2%201.94h-4.4zm4.66%202.56c-.32.88-1%201.5-2.24%201.5-1.32%200-2.42-.94-2.48-2.24h7.04c0-.04.04-.44.04-.82%200-3.16-1.82-5.1-4.86-5.1-2.52%200-4.84%202.04-4.84%205.18%200%203.32%202.38%205.26%205.08%205.26%202.42%200%203.98-1.42%204.48-3.12l-2.22-.66zm6.114-2.18c0-1.14.68-2.04%201.84-2.04%201.28%200%201.82.86%201.82%201.96V24h2.66v-6.2c0-2.16-1.12-3.9-3.56-3.9-1.06%200-2.24.46-2.84%201.48v-1.22h-2.58V24h2.66v-5.66zm11.3-7.12h-2.4v1.38c0%20.88-.48%201.56-1.52%201.56h-.5v2.36h1.78v4.58c0%201.9%201.2%203.04%203.12%203.04.78%200%201.26-.14%201.5-.24v-2.2c-.14.04-.5.08-.82.08-.76%200-1.16-.28-1.16-1.14v-4.12h1.98v-2.36h-1.98v-2.94zM17.5%2015h-2v7h2v-7zm6%200h-2v7h2v-7zm8.5%209H13v2h19v-2zm-2.5-9h-2v7h2v-7zm-7-6.74L27.71%2011H17.29l5.21-2.74zm0-2.26L13%2011v2h19v-2l-9.5-5z'/%3e%3c/svg%3e",
79
84
  "aria-hidden": "true",
80
85
  alt: "logo",
81
86
  class: "IncodeGovtValidationLogo"
82
87
  })
83
88
  ] });
84
- }, m = ({ config: e, onFinish: t }) => /* @__PURE__ */ n(a, { children: e ? /* @__PURE__ */ n(p, {
85
- config: e,
86
- onFinish: t
87
- }) : null });
88
- d(m, "incode-government-validation");
89
+ };
90
+ var GovernmentValidation = ({ config, onFinish }) => {
91
+ return /* @__PURE__ */ u(IncodeComponent, { children: config ? /* @__PURE__ */ u(GovernmentValidationContent, {
92
+ config,
93
+ onFinish
94
+ }) : null });
95
+ };
96
+ registerIncodeModuleElement(GovernmentValidation, "incode-government-validation");
89
97
  //#endregion
90
- export { m as GovernmentValidation };
98
+ export { GovernmentValidation };
@@ -0,0 +1,264 @@
1
+ import { c as supportedLanguages, n as useTranslation, s as getLanguageEmoji } from "./i18n-gTHArCl9.js";
2
+ import { _ as y, d as T, l as A, p as d, v as u } from "./vendor-preact-BH7vOa2r.js";
3
+ import { n as useUiConfig } from "./uiConfig-sgEkFuuA.js";
4
+ import { r as Spacer } from "./loadingIcon-DN62ugKs.js";
5
+ import "./incode-logo-57XFniXU.js";
6
+ import { t as Button } from "./button-B-qlr4iI.js";
7
+ import { t as Modal } from "./modal-B5QeulDu.js";
8
+ import { t as DropdownComposed } from "./dropdownComposed-BF4L-7mJ.js";
9
+ import "./dropdownComposed-mvHuRFHn.js";
10
+ //#region src/shared/homeScreen/language.ts
11
+ function capitalizeLabel(text, locale) {
12
+ const [firstCharacter, ...rest] = Array.from(text);
13
+ if (!firstCharacter) return text;
14
+ return `${firstCharacter.toLocaleUpperCase(locale)}${rest.join("")}`;
15
+ }
16
+ function getLanguageRegionCode(language) {
17
+ const [, regionPart] = language.split("-");
18
+ if (regionPart && /^[A-Z]{2}$/.test(regionPart)) return regionPart;
19
+ const emoji = getLanguageEmoji(language);
20
+ const codePoints = Array.from(emoji).map((character) => character.codePointAt(0));
21
+ if (codePoints.length !== 2) return null;
22
+ const letters = codePoints.map((codePoint) => {
23
+ if (!codePoint || codePoint < 127462 || codePoint > 127487) return null;
24
+ return String.fromCharCode(codePoint - 127462 + 65);
25
+ });
26
+ if (letters.some((letter) => letter === null)) return null;
27
+ return letters.join("");
28
+ }
29
+ function formatLanguageLabel(language, locale) {
30
+ if (typeof Intl !== "undefined" && typeof Intl.DisplayNames !== "undefined") return capitalizeLabel(new Intl.DisplayNames([locale, "en"], { type: "language" }).of(language) ?? language, locale);
31
+ return capitalizeLabel(language, locale);
32
+ }
33
+ function getSelectedMainLanguageLabel(selectedLanguage, locale) {
34
+ const baseLanguage = selectedLanguage.split("-")[0] || selectedLanguage;
35
+ const regionCode = getLanguageRegionCode(selectedLanguage);
36
+ return `${formatLanguageLabel(baseLanguage, locale)}${regionCode ? ` (${regionCode})` : ""}`;
37
+ }
38
+ function formatOptionLabel(language, locale) {
39
+ const emoji = getLanguageEmoji(language);
40
+ const [baseLang, subTag] = language.split("-");
41
+ const base = baseLang || language;
42
+ const baseDisplay = capitalizeLabel(new Intl.DisplayNames([locale, "en"], { type: "language" }).of(base) ?? base, locale);
43
+ if (subTag && !/^[A-Z]{2}$/.test(subTag)) return `${emoji} ${capitalizeLabel(new Intl.DisplayNames([locale, "en"], { type: "language" }).of(language) ?? language, locale)}`;
44
+ if (subTag) return `${emoji} ${baseDisplay} (${new Intl.DisplayNames([locale, "en"], { type: "region" }).of(subTag) ?? subTag})`;
45
+ const regionCode = getLanguageRegionCode(language);
46
+ if (regionCode) return `${emoji} ${baseDisplay} (${regionCode})`;
47
+ return `${emoji} ${baseDisplay}`;
48
+ }
49
+ /**
50
+ * Same structure as `formatOptionLabel` but with no leading regional-indicator
51
+ * emoji, so screen readers do not announce flag characters.
52
+ */
53
+ function formatOptionAccessibleLabel(language, locale) {
54
+ const [baseLang, subTag] = language.split("-");
55
+ const base = baseLang || language;
56
+ const baseDisplay = capitalizeLabel(new Intl.DisplayNames([locale, "en"], { type: "language" }).of(base) ?? base, locale);
57
+ if (subTag && !/^[A-Z]{2}$/.test(subTag)) return capitalizeLabel(new Intl.DisplayNames([locale, "en"], { type: "language" }).of(language) ?? language, locale);
58
+ if (subTag) return `${baseDisplay} (${new Intl.DisplayNames([locale, "en"], { type: "region" }).of(subTag) ?? subTag})`;
59
+ const regionCode = getLanguageRegionCode(language);
60
+ if (regionCode) return `${baseDisplay} (${regionCode})`;
61
+ return baseDisplay;
62
+ }
63
+ function buildLanguageOptions(locale) {
64
+ const options = [...new Set(supportedLanguages)].map((language) => ({
65
+ value: language,
66
+ label: formatOptionLabel(language, locale),
67
+ ariaLabel: formatOptionAccessibleLabel(language, locale)
68
+ }));
69
+ options.sort((left, right) => left.label.localeCompare(right.label));
70
+ return options;
71
+ }
72
+ async function changeLanguage(changeI18nLanguage, nextLanguage) {
73
+ await changeI18nLanguage(nextLanguage);
74
+ if (typeof document !== "undefined") document.documentElement.lang = nextLanguage;
75
+ }
76
+ function useLanguage() {
77
+ const { i18n } = useTranslation();
78
+ const selectedLanguage = i18n.language || "en";
79
+ const languageOptions = T(() => {
80
+ return buildLanguageOptions(selectedLanguage);
81
+ }, [selectedLanguage]);
82
+ return {
83
+ selectedLanguage,
84
+ selectedMainLanguageLabel: getSelectedMainLanguageLabel(selectedLanguage, selectedLanguage),
85
+ selectedMainLanguageEmoji: getLanguageEmoji(selectedLanguage),
86
+ languageOptions,
87
+ changeLanguage: (nextLanguage) => {
88
+ return changeLanguage(i18n.changeLanguage.bind(i18n), nextLanguage);
89
+ }
90
+ };
91
+ }
92
+ //#endregion
93
+ //#region src/shared/homeScreen/settings.tsx
94
+ function Settings({ onClose }) {
95
+ const { t } = useTranslation();
96
+ const { selectedLanguage, languageOptions, changeLanguage } = useLanguage();
97
+ const titleRef = A(null);
98
+ y(() => {
99
+ titleRef.current?.focus();
100
+ }, []);
101
+ return /* @__PURE__ */ u("section", {
102
+ class: "IncodeHomeSettingsContainer",
103
+ children: [
104
+ /* @__PURE__ */ u("div", {
105
+ class: "IncodeHomeSettingsBody",
106
+ children: [
107
+ /* @__PURE__ */ u("h1", {
108
+ ref: titleRef,
109
+ id: "incode-modal-title",
110
+ class: "IncodeHomeSettingsTitle",
111
+ tabIndex: -1,
112
+ children: t("settings.settings")
113
+ }),
114
+ /* @__PURE__ */ u(Spacer, { size: 32 }),
115
+ /* @__PURE__ */ u("div", {
116
+ class: "IncodeHomeSettingsBodyContent",
117
+ children: /* @__PURE__ */ u(DropdownComposed, {
118
+ id: "home-language",
119
+ label: t("v2.settings.language"),
120
+ value: selectedLanguage,
121
+ options: languageOptions,
122
+ onChange: async (language) => {
123
+ await changeLanguage(language);
124
+ },
125
+ searchable: true,
126
+ "data-testid": "home-language-select"
127
+ })
128
+ })
129
+ ]
130
+ }),
131
+ /* @__PURE__ */ u("div", {
132
+ class: "IncodeHomeSettingsFooter",
133
+ children: /* @__PURE__ */ u(Button, {
134
+ onClick: onClose,
135
+ "data-testid": "home-settings-done-button",
136
+ children: t("settings.done")
137
+ })
138
+ }),
139
+ /* @__PURE__ */ u(Modal.Close, {
140
+ "aria-label": t("settings.close"),
141
+ "data-testid": "home-settings-close-button",
142
+ onClick: onClose
143
+ })
144
+ ]
145
+ });
146
+ }
147
+ //#endregion
148
+ //#region src/shared/homeScreen/settingsIcon.tsx
149
+ function SettingsIcon() {
150
+ return /* @__PURE__ */ u("svg", {
151
+ width: "30",
152
+ height: "30",
153
+ viewBox: "0 0 30 30",
154
+ fill: "none",
155
+ xmlns: "http://www.w3.org/2000/svg",
156
+ "aria-hidden": "true",
157
+ children: [
158
+ /* @__PURE__ */ u("path", {
159
+ fillRule: "evenodd",
160
+ clipRule: "evenodd",
161
+ d: "M4.5 15.3187C4.5 14.1593 5.44055 13.2188 6.6 13.2188C7.75945 13.2188 8.7 14.1593 8.7 15.3187C8.7 16.4782 7.75945 17.4187 6.6 17.4187C5.44055 17.4187 4.5 16.4782 4.5 15.3187Z",
162
+ fill: "currentColor"
163
+ }),
164
+ /* @__PURE__ */ u("path", {
165
+ fillRule: "evenodd",
166
+ clipRule: "evenodd",
167
+ d: "M12.9004 15.3187C12.9004 14.1593 13.841 13.2188 15.0004 13.2188C16.1598 13.2188 17.1004 14.1593 17.1004 15.3187C17.1004 16.4782 16.1598 17.4187 15.0004 17.4187C13.841 17.4187 12.9004 16.4782 12.9004 15.3187Z",
168
+ fill: "currentColor"
169
+ }),
170
+ /* @__PURE__ */ u("path", {
171
+ fillRule: "evenodd",
172
+ clipRule: "evenodd",
173
+ d: "M21.2998 15.3187C21.2998 14.1593 22.2404 13.2188 23.3998 13.2188C24.5592 13.2188 25.4998 14.1593 25.4998 15.3187C25.4998 16.4782 24.5592 17.4187 23.3998 17.4187C22.2404 17.4187 21.2998 16.4782 21.2998 15.3187Z",
174
+ fill: "currentColor"
175
+ })
176
+ ]
177
+ });
178
+ }
179
+ //#endregion
180
+ //#region src/shared/homeScreen/homeScreen.tsx
181
+ function HomeScreen({ onContinue, isContinueLoading }) {
182
+ const { t } = useTranslation();
183
+ const { logoSrc, subtitle } = useUiConfig();
184
+ const { selectedMainLanguageLabel, selectedMainLanguageEmoji } = useLanguage();
185
+ const subtitleRef = A(null);
186
+ const startButtonRef = A(null);
187
+ const displayLogo = logoSrc || "data:image/svg+xml,%3csvg%20width='76'%20height='20'%20viewBox='0%200%2076%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M40.1687%206.01811C42.2312%206.01811%2043.7927%206.59655%2044.8446%207.76024C45.8919%208.91831%2046.4126%2010.5865%2046.4126%2012.7583C46.4126%2014.93%2045.8748%2016.6105%2044.794%2017.7944C43.7102%2018.9815%2042.1729%2019.5735%2040.1937%2019.5735C38.1479%2019.5735%2036.5973%2018.99%2035.5546%2017.8187L35.4273%2017.6701C34.4729%2016.5101%2033.9984%2014.871%2033.9984%2012.7583C33.9984%208.28671%2036.0703%206.01811%2040.1687%206.01811ZM69.1127%206.01781C71.1144%206.01781%2072.5953%206.66904%2073.5373%207.97333C74.4288%209.2077%2074.8837%2010.9053%2074.9066%2013.0629L74.9058%2013.5242H66.1149C66.2174%2014.6334%2066.5602%2015.4734%2067.141%2016.0538C67.7488%2016.662%2068.6195%2016.9679%2069.7639%2016.9679C70.5188%2016.9679%2071.2373%2016.8742%2071.921%2016.6862C72.6048%2016.4995%2073.2105%2016.2581%2073.735%2015.9646L73.9814%2015.8267V18.666L73.8821%2018.7093C72.5607%2019.286%2071.0464%2019.5732%2069.3379%2019.5732C67.4088%2019.5732%2065.8853%2018.986%2064.7769%2017.8093C63.6699%2016.6348%2063.1183%2014.9722%2063.1183%2012.833C63.1183%2010.6451%2063.6389%208.96055%2064.6862%207.78517C65.7359%206.60632%2067.2157%206.01781%2069.1127%206.01781ZM60.3976%201.06738V16.3832C60.3976%2017.0998%2060.0996%2017.7092%2059.5124%2018.198C58.9425%2018.6724%2058.2282%2019.0207%2057.3718%2019.2435C56.5257%2019.4635%2055.6531%2019.5731%2054.7534%2019.5731C52.9298%2019.5731%2051.4237%2019.056%2050.2406%2018.0202C49.0485%2016.9752%2048.4588%2015.1678%2048.4588%2012.6072C48.4588%2010.5545%2048.9627%208.9421%2049.9753%207.77411C50.9938%206.60175%2052.4982%206.01774%2054.4782%206.01774C54.9416%206.01774%2055.4735%206.07665%2056.0742%206.19449C56.582%206.296%2057.0453%206.43849%2057.4648%206.62252V1.06738H60.3976ZM27.911%206.04223C29.2828%206.04223%2030.5881%206.29619%2031.8264%206.80393L31.9291%206.84604V9.55797L31.6992%209.46109C30.4503%208.93473%2029.3127%208.67257%2028.2863%208.67257C27.0102%208.67257%2026.0684%208.98809%2025.4521%209.61162C24.8366%2010.2352%2024.5242%2011.2397%2024.5242%2012.6331C24.5242%2014.0959%2024.8298%2015.1535%2025.4314%2015.8092C26.029%2016.4619%2027.002%2016.7923%2028.3613%2016.7923C29.4706%2016.7923%2030.589%2016.5234%2031.7164%2015.9842L31.9534%2015.8708V18.5903L31.8552%2018.634C30.6349%2019.1773%2029.3283%2019.4483%2027.936%2019.4483C26.2154%2019.4483%2024.7637%2018.9753%2023.5868%2018.0285L23.4123%2017.8829L23.2796%2017.7636C22.1516%2016.7067%2021.5914%2015.0592%2021.5914%2012.8332C21.5914%2010.4557%2022.186%208.72379%2023.3849%207.64725C24.5757%206.57726%2026.0871%206.04223%2027.911%206.04223ZM4.11045%206.39262L4.13613%2019.1987H1.15293V6.39262H4.11045ZM13.5766%206.0423C15.365%206.0423%2016.6948%206.41948%2017.5636%207.18368C18.4372%207.95269%2018.8706%209.13902%2018.8706%2010.7331V19.1984H15.9127V11.0838C15.9127%209.42945%2014.9988%208.62337%2013.1013%208.62337C12.3086%208.62337%2011.5458%208.73548%2010.8133%208.95959L10.5401%209.04888V19.1984H7.58147V7.40579L7.67177%207.35974C8.43481%206.97061%209.36013%206.65415%2010.4506%206.40815L10.8116%206.33134C11.7692%206.13867%2012.6905%206.0423%2013.5766%206.0423ZM40.1687%208.5477C39.0014%208.5477%2038.1814%208.89722%2037.6896%209.59114C37.1869%2010.3012%2036.932%2011.3564%2036.932%2012.7583C36.932%2014.1602%2037.1948%2015.223%2037.7142%2015.9499C38.2224%2016.6613%2039.0345%2017.0182%2040.1687%2017.0182C42.3685%2017.0182%2043.4555%2015.6249%2043.4555%2012.7583C43.4555%2011.325%2043.1888%2010.2632%2042.6636%209.57056C42.1472%208.89036%2041.3203%208.5477%2040.1687%208.5477ZM54.8535%208.59807C52.5835%208.59807%2051.4659%209.9271%2051.4659%2012.6579C51.4659%2014.0276%2051.7253%2015.0917%2052.2391%2015.8527C52.7378%2016.5945%2053.6185%2016.9678%2054.9035%2016.9678C55.6556%2016.9678%2056.2834%2016.8792%2056.7876%2016.7028C57.2156%2016.553%2057.4279%2016.378%2057.4604%2016.186L57.4648%2016.1332V9.25404L57.2778%209.15611C56.9611%208.99923%2056.6189%208.87406%2056.2512%208.78123C55.7705%208.65917%2055.3045%208.59807%2054.8535%208.59807ZM69.0377%208.49888C68.192%208.49888%2067.5412%208.71795%2067.0743%209.15366C66.6631%209.5374%2066.3731%2010.1684%2066.2101%2011.0498L66.1771%2011.2425H71.8784L71.8489%2011.0453C71.7111%2010.208%2071.4421%209.58986%2071.0461%209.18626C70.5969%208.72981%2069.9303%208.49888%2069.0377%208.49888ZM4.21085%201.94156V4.64764H1.07715V1.94156H4.21085Z'%20fill='%23006AFF'/%3e%3c/svg%3e";
188
+ const [settingsOpen, setSettingsOpen] = d(false);
189
+ y(() => {
190
+ subtitleRef.current?.focus();
191
+ }, [subtitle]);
192
+ return /* @__PURE__ */ u("main", {
193
+ class: "IncodeHome",
194
+ children: [/* @__PURE__ */ u("div", {
195
+ class: "IncodeHomeContent",
196
+ children: [
197
+ /* @__PURE__ */ u("header", {
198
+ class: "IncodeHomeHeader",
199
+ children: [/* @__PURE__ */ u("div", {
200
+ class: "IncodeHomeLanguage",
201
+ children: [
202
+ /* @__PURE__ */ u("p", {
203
+ class: "IncodeHomeLanguageLabel",
204
+ children: t("home.language")
205
+ }),
206
+ /* @__PURE__ */ u(Spacer, { size: 8 }),
207
+ /* @__PURE__ */ u("p", {
208
+ class: "IncodeHomeLanguageValue",
209
+ children: [/* @__PURE__ */ u("span", {
210
+ "aria-hidden": "true",
211
+ children: [selectedMainLanguageEmoji, " "]
212
+ }), selectedMainLanguageLabel]
213
+ })
214
+ ]
215
+ }), /* @__PURE__ */ u("button", {
216
+ type: "button",
217
+ class: "IncodeHomeSettingsButton",
218
+ onClick: () => setSettingsOpen(true),
219
+ "aria-label": t("home.goToSettings"),
220
+ "data-testid": "home-settings-button",
221
+ children: /* @__PURE__ */ u(SettingsIcon, {})
222
+ })]
223
+ }),
224
+ /* @__PURE__ */ u("div", {
225
+ class: "IncodeHomeCenterSection",
226
+ children: [/* @__PURE__ */ u("div", {
227
+ class: "IncodeHomeLogoContainer",
228
+ children: /* @__PURE__ */ u("img", {
229
+ src: displayLogo,
230
+ alt: t("home.logo"),
231
+ class: "IncodeHomeLogo",
232
+ "data-testid": "home-logo",
233
+ "aria-hidden": "true"
234
+ })
235
+ }), subtitle ? /* @__PURE__ */ u("h2", {
236
+ ref: subtitleRef,
237
+ class: "IncodeHomeSubtitle",
238
+ tabIndex: -1,
239
+ children: subtitle
240
+ }) : null]
241
+ }),
242
+ /* @__PURE__ */ u(Button, {
243
+ ref: startButtonRef,
244
+ onClick: () => {
245
+ onContinue();
246
+ },
247
+ isLoading: isContinueLoading,
248
+ class: "IncodeHomeStartButton",
249
+ "data-testid": "home-start-button",
250
+ children: t("home.start")
251
+ })
252
+ ]
253
+ }), /* @__PURE__ */ u(Modal.Root, {
254
+ open: settingsOpen,
255
+ onOpenChange: (open) => setSettingsOpen(open),
256
+ returnFocusRef: startButtonRef,
257
+ manageInitialFocus: false,
258
+ class: "IncodeHomeSettingsModal",
259
+ children: /* @__PURE__ */ u(Modal.Content, { children: /* @__PURE__ */ u(Settings, { onClose: () => setSettingsOpen(false) }) })
260
+ })]
261
+ });
262
+ }
263
+ //#endregion
264
+ export { HomeScreen };
@@ -0,0 +1,149 @@
1
+ import { _ as y, l as A, p as d, s as gn } from "./vendor-preact-BH7vOa2r.js";
2
+ import { ScreenOrientationProvider, createScreenOrientationObserver, getDeviceClass } from "@incodetech/core/device";
3
+ import "@incodetech/core/events";
4
+ //#region src/hooks/useManager.ts
5
+ /**
6
+ * Hook for subscribing to manager state updates
7
+ * @param factory - Factory function that creates the manager instance
8
+ * @param options - Configuration options
9
+ * @returns Tuple of [state, manager]
10
+ */
11
+ function useManager(factory, options = {}) {
12
+ const { autoLoad = true, manageLifecycle = true } = options;
13
+ const [manager] = d(factory);
14
+ const [state, setState] = d(() => manager.getState());
15
+ y(() => {
16
+ const unsubscribe = manager.subscribe(setState);
17
+ if (manageLifecycle && autoLoad && manager.load) manager.load();
18
+ return () => {
19
+ unsubscribe();
20
+ if (manageLifecycle) manager.stop?.();
21
+ };
22
+ }, [
23
+ manager,
24
+ autoLoad,
25
+ manageLifecycle
26
+ ]);
27
+ return [state, manager];
28
+ }
29
+ //#endregion
30
+ //#region src/hooks/useScreenOrientation.ts
31
+ var observerInstance = null;
32
+ function getObserver() {
33
+ if (!observerInstance) observerInstance = createScreenOrientationObserver(new ScreenOrientationProvider(), getDeviceClass());
34
+ return observerInstance;
35
+ }
36
+ /**
37
+ * Hook that returns whether the device is in landscape mode on mobile (excluding iPad and desktop).
38
+ * Use this to show a landscape blocker overlay when true.
39
+ */
40
+ function useScreenOrientation() {
41
+ const [isLandscapeMobile, setIsLandscapeMobile] = d(false);
42
+ y(() => {
43
+ const observer = getObserver();
44
+ setIsLandscapeMobile(observer.isLandscapeMobile);
45
+ return observer.subscribe((value) => {
46
+ gn(() => setIsLandscapeMobile(value));
47
+ });
48
+ }, []);
49
+ return { isLandscapeMobile };
50
+ }
51
+ //#endregion
52
+ //#region src/hooks/useModuleTerminalCallbacks.ts
53
+ function isModuleTerminalStatus(status) {
54
+ return status === "finished" || status === "error" || status === "closed" || status === "failed";
55
+ }
56
+ function isTerminalModuleState(state) {
57
+ return isModuleTerminalStatus(state.status);
58
+ }
59
+ function useModuleTerminalCallbacks({ status, onFinish, onError, error, errorCode, moduleErrorCode, errorStatuses }) {
60
+ const terminalFiredRef = A(false);
61
+ y(() => {
62
+ if (terminalFiredRef.current) return;
63
+ if (status === "finished") {
64
+ terminalFiredRef.current = true;
65
+ onFinish?.();
66
+ return;
67
+ }
68
+ if (status === "closed") {
69
+ terminalFiredRef.current = true;
70
+ onError?.(void 0);
71
+ return;
72
+ }
73
+ if ((errorStatuses ?? ["error"]).includes(status)) {
74
+ terminalFiredRef.current = true;
75
+ if (moduleErrorCode !== void 0) onError?.(error, errorCode, moduleErrorCode);
76
+ else onError?.(error, errorCode);
77
+ }
78
+ }, [
79
+ status,
80
+ onFinish,
81
+ onError,
82
+ error,
83
+ errorCode,
84
+ moduleErrorCode,
85
+ errorStatuses
86
+ ]);
87
+ }
88
+ //#endregion
89
+ //#region src/hooks/useFormScrollable.ts
90
+ /**
91
+ * Tracks whether an element's content overflows its visible area vertically.
92
+ * Re-evaluates on element resize and whenever `depCount` changes
93
+ * (e.g. number of form fields).
94
+ */
95
+ function useFormScrollable(ref, depCount) {
96
+ const [isScrollable, setIsScrollable] = d(false);
97
+ y(() => {
98
+ const el = ref.current;
99
+ if (!el) return;
100
+ const check = () => setIsScrollable(el.scrollHeight > el.clientHeight);
101
+ check();
102
+ const ro = new ResizeObserver(check);
103
+ ro.observe(el);
104
+ return () => ro.disconnect();
105
+ }, [depCount, ref]);
106
+ return isScrollable;
107
+ }
108
+ //#endregion
109
+ //#region src/hooks/useMediaQuery.ts
110
+ var MOBILE_QUERY = "(max-width: 767px)";
111
+ function useMediaQuery(query) {
112
+ const [matches, setMatches] = d(() => typeof window !== "undefined" && window.matchMedia(query).matches);
113
+ y(() => {
114
+ if (typeof window === "undefined") return;
115
+ const mql = window.matchMedia(query);
116
+ const onChange = () => setMatches(mql.matches);
117
+ mql.addEventListener("change", onChange);
118
+ return () => mql.removeEventListener("change", onChange);
119
+ }, [query]);
120
+ return matches;
121
+ }
122
+ function useIsMobileDeviceWidth() {
123
+ return useMediaQuery(MOBILE_QUERY);
124
+ }
125
+ //#endregion
126
+ //#region src/hooks/useEventListener.ts
127
+ function useEventListener(eventName, handler) {
128
+ y(() => {
129
+ window.addEventListener(eventName, handler);
130
+ return () => window.removeEventListener(eventName, handler);
131
+ }, [eventName, handler]);
132
+ }
133
+ //#endregion
134
+ //#region src/hooks/useResizeObserver.ts
135
+ function useResizeObserver(ref, onResize) {
136
+ y(() => {
137
+ const element = ref.current;
138
+ if (!element || typeof ResizeObserver === "undefined") {
139
+ onResize();
140
+ return;
141
+ }
142
+ onResize();
143
+ const resizeObserver = new ResizeObserver(onResize);
144
+ resizeObserver.observe(element);
145
+ return () => resizeObserver.disconnect();
146
+ }, [ref, onResize]);
147
+ }
148
+ //#endregion
149
+ export { isTerminalModuleState as a, useManager as c, useFormScrollable as i, useEventListener as n, useModuleTerminalCallbacks as o, useIsMobileDeviceWidth as r, useScreenOrientation as s, useResizeObserver as t };