@incodetech/core 0.0.0-dev-20261124-bcd99b1e → 0.0.0-dev-20261125-a91bf928

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 (133) hide show
  1. package/dist/{FaceDetectionProvider-D4ncumfe.esm.js → FaceDetectionProvider-D-1rS3WB.esm.js} +4 -4
  2. package/dist/{definitionSource-B-Z2EgJJ.esm.js → addressSearch-DKdOJ_e-.esm.js} +67 -8
  3. package/dist/ae-signature.esm.js +1 -1
  4. package/dist/{phoneFormat-C3q0Ukh4.esm.js → allowedCharacters-Bnir--CN.esm.js} +1 -11
  5. package/dist/{apiError-a7tezk_O.esm.js → apiError-CxKf45Ky.esm.js} +1 -1
  6. package/dist/authentication.d.ts +3 -3
  7. package/dist/authentication.esm.js +2 -2
  8. package/dist/{authenticationManager-Cp64l__H.d.ts → authenticationManager-BManpfgb.d.ts} +1 -1
  9. package/dist/{authenticationManager-IpVKgxPn.esm.js → authenticationManager-CThxh6EJ.esm.js} +3 -3
  10. package/dist/{authenticationStateMachine-B4CuMBgC.esm.js → authenticationStateMachine-DN122Cii.esm.js} +3 -3
  11. package/dist/{calendarDate-DcqGuEht.esm.js → calendarDate-D2zWfUlA.esm.js} +1 -1
  12. package/dist/{cnpj-Bl_olpdX.esm.js → cnpj-CVq3vL39.esm.js} +1 -9
  13. package/dist/cnpj-D5cxwIe-.esm.js +9 -0
  14. package/dist/curp-validation.d.ts +1 -1
  15. package/dist/curp-validation.esm.js +2 -2
  16. package/dist/{curpValidationManager-C6WmQToS.esm.js → curpValidationManager-4v5qMUXm.esm.js} +1 -1
  17. package/dist/{curpValidationManager-Dynwqu2z.d.ts → curpValidationManager-9U7zMZt8.d.ts} +1 -1
  18. package/dist/{curpValidationStateMachine-BbJ4YAzE.esm.js → curpValidationStateMachine-BPkEZtmd.esm.js} +1 -1
  19. package/dist/custom-fields.esm.js +1 -1
  20. package/dist/{customFieldsManager-BBy6X9nh.esm.js → customFieldsManager-BX3u8VPe.esm.js} +1 -1
  21. package/dist/{deepsightCaptureConfig-D0PCzVcM.esm.js → deepsightCaptureConfig-B7HX2BKP.esm.js} +2 -2
  22. package/dist/{deepsightLoader-nbl5Dhvf.esm.js → deepsightLoader-C_fdJi9H.esm.js} +4 -4
  23. package/dist/definitionSource-C_pmsYIx.esm.js +12 -0
  24. package/dist/{desktopCameraElection-C2jhy2Fd.esm.js → desktopCameraElection-A7IPW-RU.esm.js} +4 -4
  25. package/dist/document-capture.d.ts +1 -1
  26. package/dist/document-signature.esm.js +1 -1
  27. package/dist/{documentCaptureManager-DOgJTJ4F.d.ts → documentCaptureManager-sJWgqtUy.d.ts} +4 -4
  28. package/dist/{documentSignatureStateMachine-DoeIrTmr.esm.js → documentSignatureStateMachine-ClNEf1FQ.esm.js} +1 -1
  29. package/dist/dynamic-forms.esm.js +2 -2
  30. package/dist/{dynamicFormsManager-D_QpTKfT.esm.js → dynamicFormsManager-nl9-642J.esm.js} +1 -1
  31. package/dist/{dynamicFormsStateMachine-D_KmQwDZ.esm.js → dynamicFormsStateMachine-DwjwenOE.esm.js} +2 -2
  32. package/dist/ekyb.d.ts +4 -4
  33. package/dist/ekyb.esm.js +2 -2
  34. package/dist/{ekybManager-BG7eju18.esm.js → ekybManager-B-tbtSFb.esm.js} +1 -1
  35. package/dist/{ekybManager-BflWuTe4.d.ts → ekybManager-DZdSXQMK.d.ts} +2 -2
  36. package/dist/{ekybStateMachine-Bc-m_PHQ.esm.js → ekybStateMachine-BC4eZWrb.esm.js} +5 -4
  37. package/dist/ekyc-prefill.d.ts +3 -4
  38. package/dist/ekyc-prefill.esm.js +2 -2
  39. package/dist/ekyc.d.ts +3 -3
  40. package/dist/ekyc.esm.js +2 -2
  41. package/dist/{ekycManager-BPUHoUHy.esm.js → ekycManager-CDxoP5gL.esm.js} +1 -1
  42. package/dist/{ekycManager-BldDiWTJ.d.ts → ekycManager-DusmB-4j.d.ts} +2 -2
  43. package/dist/{ekycPrefillManager-qgG_uUKA.d.ts → ekycPrefillManager-BwmPXfhY.d.ts} +17 -17
  44. package/dist/{ekycPrefillManager-BaX95xIW.esm.js → ekycPrefillManager-Cu5EAnkQ.esm.js} +6 -7
  45. package/dist/{ekycPrefillStateMachine-C8FEAHbH.esm.js → ekycPrefillStateMachine-DdHdgSaW.esm.js} +567 -165
  46. package/dist/{ekycStateMachine-Cq94FpIm.esm.js → ekycStateMachine-CM1YRW27.esm.js} +483 -155
  47. package/dist/electronic-signature.esm.js +1 -1
  48. package/dist/{electronicSignatureManager-bgoE6nL8.esm.js → electronicSignatureManager-knl_X2jh.esm.js} +1 -1
  49. package/dist/extensibility.d.ts +15 -15
  50. package/dist/extensibility.esm.js +17 -17
  51. package/dist/{faceCaptureManagerFactory-DvH9-zIi.esm.js → faceCaptureManagerFactory-D0eN82qj.esm.js} +2 -2
  52. package/dist/{faceCaptureManagerFactory-BZ2XHhkj.d.ts → faceCaptureManagerFactory-Dm7p3T_t.d.ts} +3 -3
  53. package/dist/{faceCaptureSetup-DuFiwK9F.esm.js → faceCaptureSetup-BfedgErd.esm.js} +7 -7
  54. package/dist/{feature-management-DiL2uBlX.esm.js → feature-management-BD2hrfZ3.esm.js} +1 -1
  55. package/dist/feature-management.esm.js +1 -1
  56. package/dist/flow-events.d.ts +1 -1
  57. package/dist/flow.d.ts +7 -7
  58. package/dist/flow.esm.js +3 -3
  59. package/dist/{flowCompletionService-Bs4oWd_W.esm.js → flowCompletionService-DlXzGwgu.esm.js} +1 -1
  60. package/dist/{flowServices-KLGZ3eWm.esm.js → flowServices-CxTdN-OL.esm.js} +4 -4
  61. package/dist/formErrors-lSfh7Y8J.esm.js +512 -0
  62. package/dist/geolocation.d.ts +1 -1
  63. package/dist/geolocation.esm.js +2 -2
  64. package/dist/{geolocationManager-Del2ddmt.d.ts → geolocationManager-CENrvxpK.d.ts} +1 -1
  65. package/dist/{geolocationManager-el4FUmYy.esm.js → geolocationManager-Ch5lOvYH.esm.js} +1 -1
  66. package/dist/{geolocationStateMachine-BnM-qTe3.esm.js → geolocationStateMachine-EN7it_FF.esm.js} +1 -1
  67. package/dist/home.d.ts +1 -1
  68. package/dist/id-ocr.d.ts +1 -1
  69. package/dist/id-ocr.esm.js +2 -2
  70. package/dist/id-selfie-flow.d.ts +1 -1
  71. package/dist/id-selfie-flow.esm.js +6 -6
  72. package/dist/id.d.ts +2 -2
  73. package/dist/id.esm.js +3 -3
  74. package/dist/{idCaptureManager-UnWwLa3I.esm.js → idCaptureManager-CH2bkanx.esm.js} +4 -4
  75. package/dist/{idCaptureManager-Co4ZZ-pd.d.ts → idCaptureManager-jjNknNiP.d.ts} +2 -2
  76. package/dist/{idCaptureServices-DFUdwccM.esm.js → idCaptureServices-BN57-oba.esm.js} +2 -2
  77. package/dist/{idCaptureStateMachine-DGWGB0Tz.esm.js → idCaptureStateMachine-DIM0ZxBY.esm.js} +11 -11
  78. package/dist/{idOcrManager-C3BHGgSb.d.ts → idOcrManager-C0C7lFGd.d.ts} +1 -1
  79. package/dist/{idOcrManager-XTbpfHoF.esm.js → idOcrManager-Dl9eNhT8.esm.js} +1 -1
  80. package/dist/{idOcrStateMachine-B-00PgPh.esm.js → idOcrStateMachine-CEkUWxGy.esm.js} +1 -1
  81. package/dist/{index-RghgiJVx.d.ts → index-B-K_tV2Q.d.ts} +1 -1
  82. package/dist/index.esm.js +1 -1
  83. package/dist/kyb-checks.d.ts +3 -3
  84. package/dist/kyb-checks.esm.js +2 -2
  85. package/dist/{kybChecksManager-CbkCctw0.esm.js → kybChecksManager-Bh-oiXei.esm.js} +2 -2
  86. package/dist/{kybChecksManager-B7Di9auB.d.ts → kybChecksManager-CKDy1mel.d.ts} +1 -1
  87. package/dist/{kybChecksStateMachine-BeB_cgk4.esm.js → kybChecksStateMachine-WIdi80Sq.esm.js} +175 -178
  88. package/dist/mandatory-consent.d.ts +2 -2
  89. package/dist/{mandatoryConsentManager-B_eFZmo-.d.ts → mandatoryConsentManager-Bwl0YPwg.d.ts} +1 -1
  90. package/dist/numericRange-zDZFvRb8.esm.js +274 -0
  91. package/dist/qe-signature.esm.js +1 -1
  92. package/dist/{recordingService-PUU8CObN.esm.js → recordingService-5o50qJ9A.esm.js} +1 -1
  93. package/dist/{runChildModule-BOvtfM8r.esm.js → runChildModule-vqgSWeEF.esm.js} +1 -1
  94. package/dist/{sdkVersion-thMGaHAC.esm.js → sdkVersion-C3x7ZDSE.esm.js} +1 -1
  95. package/dist/selfie.d.ts +3 -3
  96. package/dist/selfie.esm.js +7 -7
  97. package/dist/{selfieErrorUtils-CqudCvHN.esm.js → selfieErrorUtils-BB-nxdeJ.esm.js} +1 -1
  98. package/dist/{selfieManager-DWRVOhOE.esm.js → selfieManager-CpV6Lw0q.esm.js} +3 -3
  99. package/dist/{selfieManager-CKm034l4.d.ts → selfieManager-DOwu6Ukf.d.ts} +1 -1
  100. package/dist/{selfieStateMachine-CNELgWFK.esm.js → selfieStateMachine-Bxi31PsA.esm.js} +3 -3
  101. package/dist/{session-pNSU6n3-.esm.js → session-syFGvfFW.esm.js} +4 -4
  102. package/dist/session.d.ts +1 -1
  103. package/dist/session.esm.js +4 -4
  104. package/dist/{sessionInitializer-BzvYgZCQ.esm.js → sessionInitializer-C4cinkbs.esm.js} +4 -4
  105. package/dist/{setup-BQVlJnC0.esm.js → setup-cZWqRr7-.esm.js} +5 -5
  106. package/dist/trueSight-DK2Q1w9z.esm.js +1 -0
  107. package/dist/{trueSightService-DjwNQ37t.esm.js → trueSightService-Bm5K21-R.esm.js} +1 -1
  108. package/dist/types-BTJWXYHA.d.ts +6 -0
  109. package/dist/{types-BgRHw-dR.d.ts → types-BaA0Qscz.d.ts} +1 -1
  110. package/dist/{types-_rJ2GjgK.d.ts → types-BqDc7tER.d.ts} +1 -1
  111. package/dist/{types-DFgJ26nw.d.ts → types-CH9u9ikn.d.ts} +1 -1
  112. package/dist/{types-Dy4XI7jR.d.ts → types-CRzImo5V.d.ts} +1 -1
  113. package/dist/{types-BiUMy0Vp.d.ts → types-CoXJsu1W.d.ts} +1 -1
  114. package/dist/{textRules-D4NRinKY.d.ts → types-D6Q1D1kx.d.ts} +1 -9
  115. package/dist/{types-CTaL0XJz.d.ts → types-DWqO7owj.d.ts} +2 -24
  116. package/dist/{types-mK4qyHxM.d.ts → types-g3NuVCT9.d.ts} +16 -29
  117. package/dist/{types-aKXf9SVN.d.ts → types-ia31g4VQ.d.ts} +3 -3
  118. package/dist/{types-Bdes6iC1.d.ts → types-tOSLpcSa.d.ts} +10 -2
  119. package/dist/video-selfie.d.ts +1 -1
  120. package/dist/video-selfie.esm.js +3 -3
  121. package/dist/{videoSelfieCameraWarmer-M25qqewS.esm.js → videoSelfieCameraWarmer-B5atbHuu.esm.js} +3 -3
  122. package/dist/{videoSelfieStepDetector-BBXE3DnI.d.ts → videoSelfieStepDetector-Dfj7UUF3.d.ts} +2 -2
  123. package/dist/wasm.esm.js +1 -1
  124. package/dist/watchlist-for-business.esm.js +2 -2
  125. package/dist/{watchlistForBusinessManager-DxeSH80T.esm.js → watchlistForBusinessManager-CiSWk1Lh.esm.js} +1 -1
  126. package/dist/{watchlistForBusinessStateMachine-BC9UWLuZ.esm.js → watchlistForBusinessStateMachine-DiQW42sd.esm.js} +3 -2
  127. package/dist/workflow.d.ts +1 -1
  128. package/dist/workflow.esm.js +21 -21
  129. package/package.json +1 -1
  130. package/dist/addressSearch-BKlynuBr.esm.js +0 -71
  131. package/dist/ekycRules-B7kUzSgu.esm.js +0 -598
  132. package/dist/trueSight-CiveOb7r.esm.js +0 -1
  133. package/dist/types-J7D0pbWH.d.ts +0 -6
@@ -1,15 +1,19 @@
1
+ import { t as getLocalIsoDate } from "./IBrowserEnvironmentCapability-D7JG7ML3.esm.js";
1
2
  import { t as api, u as endpoints } from "./api-BNxrW8xK.esm.js";
2
- import { t as getPhoneValidation } from "./phoneValidation-OggtfjRt.esm.js";
3
+ import { n as loadPhoneValidation, t as getPhoneValidation } from "./phoneValidation-OggtfjRt.esm.js";
3
4
  import { i as assign, t as setup } from "./xstate.esm-CIqUf_i6.esm.js";
4
5
  import { n as fromPromise } from "./xstate-actors.esm-BCcwgosu.esm.js";
5
- import { c as formatSSN, d as validateEkycField, f as validateEkycForm, i as projectRules, l as loadPhoneValidator, n as isCount, o as cleanName, p as resolvePrefill, r as isProjectableRule, s as formatPhoneNational, t as RULES, u as oneOfRequiredErrorKey } from "./ekycRules-B7kUzSgu.esm.js";
6
+ import { t as isValidCurp } from "./curp-DZGvefg3.esm.js";
7
+ import { a as matchesCharTemplate, c as digitCountError, d as isValidRut, f as isValidInDrivingLicenseNumber, i as isWithinMaxAge, l as hasDigitCount, m as isValidEsDni, n as isNotFuture, o as isPoBox, p as isValidFiPersonalIdentityCode, r as hasNameCharacters, s as isEmailFormat, t as isInNumericRange, u as resolvePrefill } from "./numericRange-zDZFvRb8.esm.js";
8
+ import { n as calendarDateError } from "./calendarDate-D2zWfUlA.esm.js";
6
9
  import { n as usStates, t as usStateOptions } from "./usStates-CwOQ2kAx.esm.js";
7
- import { a as getPostalCodeMaxLength, c as fillFromSuggestion, l as getStreetLevelErrorForSuggestion, n as formatPostalCode, t as createBundledDefinitionSource, u as keepSuggestionInOptions } from "./definitionSource-B-Z2EgJJ.esm.js";
8
- import { n as checkSupport, t as resolveForm } from "./resolveForm-DaaQSVWp.esm.js";
9
- import { n as searchAddress, r as isFormDefinitionsEnabled, t as debounceSearchActor } from "./addressSearch-BKlynuBr.esm.js";
10
+ import { a as getPostalCodeErrorKey, c as validatePostalCode, d as getStreetLevelErrorForSuggestion, f as keepSuggestionInOptions, i as formatPostalCode, l as STREET_LEVEL_REQUIRED_ERROR, n as searchAddress, o as getPostalCodeErrorParams, r as isFormDefinitionsEnabled, s as getPostalCodeMaxLength, t as debounceSearchActor, u as fillFromSuggestion } from "./addressSearch-DKdOJ_e-.esm.js";
11
+ import { n as checkSupport, r as DYNAMIC_REQUIRED_KEY, t as resolveForm } from "./resolveForm-DaaQSVWp.esm.js";
12
+ import { t as createBundledDefinitionSource } from "./definitionSource-C_pmsYIx.esm.js";
10
13
  import { C as POSTAL_CODE_SOURCES, D as VOCABULARY, E as TAX_ID_SOURCES, S as ONE_OF_REQUIRED_GROUPS, T as STREET_SOURCES, _ as COUNTRY_SELECTOR_DISABLED_SOURCES, a as getEKYCFields, b as MIDDLE_NAME_SOURCES, c as isFieldOptional, d as toEkycConfig, f as withRiskAddonFields, g as COUNTRY_CODE_OMITTED_SOURCES, h as CITY_SOURCES, i as getEKYCDisplayModes, l as mapToEKYCvalue, m as APARTMENT_SOURCES, o as getEkycRiskAddons, p as ADDRESS_STATE_SOURCES, r as getEKYCCountry, s as getRiskAddonFields, t as EKYC_GROUP_KEYS, u as resolveEkycSource, v as EMAIL_SOURCES, w as STATE_CODE_HINTS, x as NAME_SOURCES, y as HOUSE_NO_SOURCES } from "./ekycUtils-C6HZB46m.esm.js";
11
14
  import { t as DateFormattingProvider } from "./DateFormattingProvider-DPq9zco-.esm.js";
12
- import { t as formatPhoneE164 } from "./phoneFormat-C3q0Ukh4.esm.js";
15
+ import { t as validateCPF } from "./cpf-DDXMTLYr.esm.js";
16
+ import { n as hasAllowedCharacters } from "./allowedCharacters-Bnir--CN.esm.js";
13
17
  const brStateOptions = Object.values({
14
18
  AC: {
15
19
  code: "AC",
@@ -124,6 +128,224 @@ const brStateOptions = Object.values({
124
128
  label: state.name
125
129
  }));
126
130
  //#endregion
131
+ //#region src/shared/validators/textRules.ts
132
+ const CHARACTER_CLASSES = [
133
+ "letter",
134
+ "digit",
135
+ "space"
136
+ ];
137
+ //#endregion
138
+ //#region src/shared/phoneFormat.ts
139
+ /**
140
+ * The phone in E.164, or the value as typed when the rules are not loaded
141
+ * (`loadPhoneValidation()`) or the number is not valid.
142
+ */
143
+ function formatPhoneE164(phone, country) {
144
+ return getPhoneValidation()?.formatE164(phone, country) ?? phone;
145
+ }
146
+ //#endregion
147
+ //#region src/modules/ekyc/ekycValidators.ts
148
+ async function loadPhoneValidator() {
149
+ if (!await loadPhoneValidation()) throw new Error("Failed to load the phone validation rules");
150
+ }
151
+ /** Progressively formats an SSN as XXX-XX-XXXX */
152
+ function formatSSN(value) {
153
+ const ssn = value?.replace(/\D/g, "") ?? "";
154
+ if (ssn.length < 4) return ssn;
155
+ if (ssn.length < 6) return `${ssn.slice(0, 3)}-${ssn.slice(3)}`;
156
+ return `${ssn.slice(0, 3)}-${ssn.slice(3, 5)}-${ssn.slice(5, 9)}`;
157
+ }
158
+ /**
159
+ * Strips characters a name can't contain, as the user types. Keeps everything
160
+ * `nameCharacters` allows (letters from any script with their combining marks,
161
+ * spaces, hyphens, and straight or typographic apostrophes), plus the commas
162
+ * and acute accents (´) SDKv1 kept, so it never strips a valid name.
163
+ */
164
+ function cleanName(name) {
165
+ return (name ?? "").replace(/[^\p{L}\p{M}\s,'’´-]/gu, "").slice(0, 100);
166
+ }
167
+ function validatePhone(phone, country) {
168
+ return getPhoneValidation()?.isValid(phone, country) ?? false;
169
+ }
170
+ /** The phone's national significant number, or the value as typed. */
171
+ function formatPhoneNational(phone, country) {
172
+ return getPhoneValidation()?.nationalNumber(phone, country) ?? phone;
173
+ }
174
+ /** The error key a `oneOfRequired` group shows: its own message, or DOB-or-SSN. */
175
+ const oneOfRequiredErrorKey = (rule) => rule.message ?? "verification.errors.dobOrSsnRequired";
176
+ const PHONE_INVALID_KEY = "verification.errors.phoneInvalid";
177
+ const INVALID_ID_NUMBER_KEY = "verification.errors.invalidIdNumber";
178
+ /**
179
+ * A national ID check: blank passes, anything else must satisfy `isValid`.
180
+ * The error is the vocabulary's message for these rules; a definition names
181
+ * its own with the rule's `message`.
182
+ */
183
+ const idNumberValidator = (isValid) => (value) => {
184
+ if (value.trim().length === 0) return void 0;
185
+ if (isValid(value)) return void 0;
186
+ return { key: INVALID_ID_NUMBER_KEY };
187
+ };
188
+ const normalizeFieldValue = (value) => typeof value === "string" ? value : String(value ?? "");
189
+ const SSN_FORMAT_REGEX = /^\d{3}-\d{2}-\d{4}$/;
190
+ const requiredError = (field) => {
191
+ const fieldName = field.displayLabel ?? field.label;
192
+ return fieldName ? {
193
+ key: DYNAMIC_REQUIRED_KEY,
194
+ params: { fieldName }
195
+ } : { key: DYNAMIC_REQUIRED_KEY };
196
+ };
197
+ const isFilled = (values, name) => normalizeFieldValue(values[name]).trim().length > 0;
198
+ const createValidators = () => {
199
+ const validators = {
200
+ required: (value, _rule, field) => {
201
+ if (value.trim().length > 0) return void 0;
202
+ return requiredError(field);
203
+ },
204
+ requiredIfFilled: (value, rule, field, values) => {
205
+ if (rule.type !== "requiredIfFilled") return void 0;
206
+ if (value.trim().length > 0) return void 0;
207
+ return rule.fields.some((name) => isFilled(values, name)) ? requiredError(field) : void 0;
208
+ },
209
+ rulesByOption: (value, rule, field, values) => {
210
+ if (rule.type !== "rulesByOption") return void 0;
211
+ if (value.trim().length === 0) return void 0;
212
+ const option = normalizeFieldValue(values[rule.selector]).trim();
213
+ const rules = Object.prototype.hasOwnProperty.call(rule.cases, option) ? rule.cases[option] : void 0;
214
+ return evaluateRules(value, rules, field, values, validators);
215
+ },
216
+ streetLevelRequired: (value) => {
217
+ if (value.trim().length > 0) return void 0;
218
+ return STREET_LEVEL_REQUIRED_ERROR;
219
+ },
220
+ cpf: (value) => {
221
+ if (value.trim().length === 0) return void 0;
222
+ return validateCPF(value) ? void 0 : { key: "verification.errors.invalidTaxId" };
223
+ },
224
+ ssnFormat: (value) => {
225
+ if (value.trim().length === 0) return void 0;
226
+ return SSN_FORMAT_REGEX.test(value) ? void 0 : { key: "verification.errors.ssnFormat" };
227
+ },
228
+ noPoBox: (value) => {
229
+ if (value.trim().length === 0) return void 0;
230
+ return isPoBox(value) ? { key: "verification.errors.poBox" } : void 0;
231
+ },
232
+ postalCodeFormat: (value, rule) => {
233
+ if (rule.type !== "postalCodeFormat") return void 0;
234
+ if (value.trim().length === 0) return void 0;
235
+ if (validatePostalCode(value, rule.country)) return void 0;
236
+ return {
237
+ key: getPostalCodeErrorKey(rule.country),
238
+ params: getPostalCodeErrorParams(rule.country)
239
+ };
240
+ },
241
+ phoneFormat: (value, rule) => {
242
+ if (rule.type !== "phoneFormat") return void 0;
243
+ const trimmed = value.trim();
244
+ if (rule.optional && trimmed.length === 0) return void 0;
245
+ return validatePhone(trimmed, rule.country) ? void 0 : { key: "verification.errors.phoneInvalid" };
246
+ },
247
+ emailFormat: (value) => {
248
+ if (value.trim().length === 0) return void 0;
249
+ return isEmailFormat(value) ? void 0 : { key: "verification.errors.emailInvalid" };
250
+ },
251
+ exactLength: (value, rule) => {
252
+ if (rule.type !== "exactLength") return void 0;
253
+ if (value.trim().length === 0) return void 0;
254
+ return value.length === rule.length ? void 0 : { key: "verification.errors.exactly10Characters" };
255
+ },
256
+ nameCharacters: (value) => {
257
+ if (value.trim().length === 0) return void 0;
258
+ return hasNameCharacters(value.trim()) ? void 0 : { key: "verification.errors.nameCharacters" };
259
+ },
260
+ notFuture: (value) => {
261
+ if (value.trim().length === 0) return void 0;
262
+ return isNotFuture(value.trim(), getLocalIsoDate()) ? void 0 : { key: "verification.errors.futureDate" };
263
+ },
264
+ maxAge: (value, rule) => {
265
+ if (rule.type !== "maxAge") return void 0;
266
+ if (value.trim().length === 0) return void 0;
267
+ return isWithinMaxAge(value.trim(), getLocalIsoDate(), rule.years) ? void 0 : { key: "verification.errors.dateOfBirthMaxAge" };
268
+ },
269
+ phoneDigits: (value, rule) => {
270
+ if (rule.type !== "phoneDigits") return void 0;
271
+ const trimmed = value.trim();
272
+ if (trimmed.length === 0) return void 0;
273
+ const national = getPhoneValidation()?.nationalNumber(trimmed, rule.country);
274
+ if (!national) return { key: PHONE_INVALID_KEY };
275
+ return national.length >= rule.min && national.length <= rule.max ? void 0 : { key: PHONE_INVALID_KEY };
276
+ },
277
+ digitCount: (value, rule) => {
278
+ if (rule.type !== "digitCount") return void 0;
279
+ if (value.trim().length === 0) return void 0;
280
+ return hasDigitCount(value.trim(), rule) ? void 0 : digitCountError(rule);
281
+ },
282
+ allowedCharacters: (value, rule) => {
283
+ if (rule.type !== "allowedCharacters") return void 0;
284
+ if (value.trim().length === 0) return void 0;
285
+ return hasAllowedCharacters(value.trim(), rule.classes, rule.extra) ? void 0 : { key: "verification.errors.invalidCharacters" };
286
+ },
287
+ charTemplate: (value, rule) => {
288
+ if (rule.type !== "charTemplate") return void 0;
289
+ if (value.trim().length === 0) return void 0;
290
+ return matchesCharTemplate(value.trim(), rule.templates, rule.ignoreCase) ? void 0 : { key: "verification.errors.invalidFormat" };
291
+ },
292
+ numericRange: (value, rule) => {
293
+ if (rule.type !== "numericRange") return void 0;
294
+ if (value.trim().length === 0) return void 0;
295
+ return isInNumericRange(value.trim(), rule.min, rule.max) ? void 0 : {
296
+ key: "verification.errors.numberBetween",
297
+ params: {
298
+ min: rule.min,
299
+ max: rule.max
300
+ }
301
+ };
302
+ },
303
+ rut: idNumberValidator(isValidRut),
304
+ esDni: idNumberValidator(isValidEsDni),
305
+ fiPersonalIdentityCode: idNumberValidator(isValidFiPersonalIdentityCode),
306
+ inDrivingLicenseNumber: idNumberValidator(isValidInDrivingLicenseNumber),
307
+ curp: idNumberValidator((value) => isValidCurp(value.trim())),
308
+ oneOfRequired: (_value, rule, _field, values) => {
309
+ if (rule.type !== "oneOfRequired") return void 0;
310
+ return rule.fields.some((name) => isFilled(values, name)) ? void 0 : { key: oneOfRequiredErrorKey(rule) };
311
+ }
312
+ };
313
+ return validators;
314
+ };
315
+ /**
316
+ * A rule's own message key shows instead of the validator's, keeping its
317
+ * params. `oneOfRequired` already shows its message.
318
+ */
319
+ const withRuleMessage = (error, rule) => !rule.message || error.key === rule.message ? error : {
320
+ ...error,
321
+ key: rule.message
322
+ };
323
+ const evaluateRules = (value, rules, field, values, validators) => {
324
+ const dateError = field.type === "date" ? calendarDateError(value.trim()) : void 0;
325
+ if (dateError) return { key: dateError };
326
+ if (!rules) return void 0;
327
+ for (const rule of rules) {
328
+ const error = validators[rule.type](value, rule, field, values);
329
+ if (error) return withRuleMessage(error, rule);
330
+ }
331
+ };
332
+ function validateEkycForm(values, fields) {
333
+ const validators = createValidators();
334
+ return fields.reduce((errors, field) => {
335
+ const value = normalizeFieldValue(values[field.name]);
336
+ const error = evaluateRules(value, field.validation, field, values, validators);
337
+ if (error) errors[field.name] = error;
338
+ return errors;
339
+ }, {});
340
+ }
341
+ function validateEkycField(values, fieldName, fields) {
342
+ const field = fields.find((f) => f.name === fieldName);
343
+ if (!field) return void 0;
344
+ const validators = createValidators();
345
+ const value = normalizeFieldValue(values[field.name]);
346
+ return evaluateRules(value, field.validation, field, values, validators);
347
+ }
348
+ //#endregion
127
349
  //#region src/modules/ekyc/ekycPrefill.ts
128
350
  /**
129
351
  * eKYC prefill data for form definitions: turns the `ocr-data` and
@@ -7268,6 +7490,260 @@ const caProvinceOptions = Object.values({
7268
7490
  value: province.code,
7269
7491
  label: province.name
7270
7492
  }));
7493
+ const inStateOptions = Object.values({
7494
+ AN: {
7495
+ code: "AN",
7496
+ name: "Andaman and Nicobar Islands"
7497
+ },
7498
+ AP: {
7499
+ code: "AP",
7500
+ name: "Andhra Pradesh"
7501
+ },
7502
+ AR: {
7503
+ code: "AR",
7504
+ name: "Arunachal Pradesh"
7505
+ },
7506
+ AS: {
7507
+ code: "AS",
7508
+ name: "Assam"
7509
+ },
7510
+ BR: {
7511
+ code: "BR",
7512
+ name: "Bihar"
7513
+ },
7514
+ CH: {
7515
+ code: "CH",
7516
+ name: "Chandigarh"
7517
+ },
7518
+ CT: {
7519
+ code: "CT",
7520
+ name: "Chhattisgarh"
7521
+ },
7522
+ DH: {
7523
+ code: "DH",
7524
+ name: "Dadra and Nagar Haveli and Daman and Diu"
7525
+ },
7526
+ DL: {
7527
+ code: "DL",
7528
+ name: "Delhi"
7529
+ },
7530
+ GA: {
7531
+ code: "GA",
7532
+ name: "Goa"
7533
+ },
7534
+ GJ: {
7535
+ code: "GJ",
7536
+ name: "Gujarat"
7537
+ },
7538
+ HR: {
7539
+ code: "HR",
7540
+ name: "Haryana"
7541
+ },
7542
+ HP: {
7543
+ code: "HP",
7544
+ name: "Himachal Pradesh"
7545
+ },
7546
+ JK: {
7547
+ code: "JK",
7548
+ name: "Jammu and Kashmir"
7549
+ },
7550
+ JH: {
7551
+ code: "JH",
7552
+ name: "Jharkhand"
7553
+ },
7554
+ KA: {
7555
+ code: "KA",
7556
+ name: "Karnataka"
7557
+ },
7558
+ KL: {
7559
+ code: "KL",
7560
+ name: "Kerala"
7561
+ },
7562
+ LA: {
7563
+ code: "LA",
7564
+ name: "Ladakh"
7565
+ },
7566
+ LD: {
7567
+ code: "LD",
7568
+ name: "Lakshadweep"
7569
+ },
7570
+ MP: {
7571
+ code: "MP",
7572
+ name: "Madhya Pradesh"
7573
+ },
7574
+ MH: {
7575
+ code: "MH",
7576
+ name: "Maharashtra"
7577
+ },
7578
+ MN: {
7579
+ code: "MN",
7580
+ name: "Manipur"
7581
+ },
7582
+ ML: {
7583
+ code: "ML",
7584
+ name: "Meghalaya"
7585
+ },
7586
+ MZ: {
7587
+ code: "MZ",
7588
+ name: "Mizoram"
7589
+ },
7590
+ NL: {
7591
+ code: "NL",
7592
+ name: "Nagaland"
7593
+ },
7594
+ OR: {
7595
+ code: "OR",
7596
+ name: "Odisha"
7597
+ },
7598
+ PY: {
7599
+ code: "PY",
7600
+ name: "Puducherry"
7601
+ },
7602
+ PB: {
7603
+ code: "PB",
7604
+ name: "Punjab"
7605
+ },
7606
+ RJ: {
7607
+ code: "RJ",
7608
+ name: "Rajasthan"
7609
+ },
7610
+ SK: {
7611
+ code: "SK",
7612
+ name: "Sikkim"
7613
+ },
7614
+ TN: {
7615
+ code: "TN",
7616
+ name: "Tamil Nadu"
7617
+ },
7618
+ TG: {
7619
+ code: "TG",
7620
+ name: "Telangana"
7621
+ },
7622
+ TR: {
7623
+ code: "TR",
7624
+ name: "Tripura"
7625
+ },
7626
+ UP: {
7627
+ code: "UP",
7628
+ name: "Uttar Pradesh"
7629
+ },
7630
+ UK: {
7631
+ code: "UK",
7632
+ name: "Uttarakhand"
7633
+ },
7634
+ WB: {
7635
+ code: "WB",
7636
+ name: "West Bengal"
7637
+ }
7638
+ }).map((state) => ({
7639
+ value: state.code,
7640
+ label: state.name
7641
+ }));
7642
+ //#endregion
7643
+ //#region src/modules/ekyc/ekycRules.ts
7644
+ /** Vocabulary rules expressed as today's `EkycValidationRule` objects. */
7645
+ const RULES = {
7646
+ cpf: () => ({ type: "cpf" }),
7647
+ ssnFormat: () => ({ type: "ssnFormat" }),
7648
+ noPoBox: () => ({ type: "noPoBox" }),
7649
+ emailFormat: () => ({ type: "emailFormat" }),
7650
+ postalCodeFormat: ({ country }) => ({
7651
+ type: "postalCodeFormat",
7652
+ country
7653
+ }),
7654
+ phoneFormat: ({ country, required }) => ({
7655
+ type: "phoneFormat",
7656
+ country,
7657
+ optional: !required
7658
+ }),
7659
+ exactLength: ({ params }) => ({
7660
+ type: "exactLength",
7661
+ length: params.length
7662
+ }),
7663
+ nameCharacters: () => ({ type: "nameCharacters" }),
7664
+ notFuture: () => ({ type: "notFuture" }),
7665
+ maxAge: ({ params }) => ({
7666
+ type: "maxAge",
7667
+ years: params.years
7668
+ }),
7669
+ phoneDigits: ({ country, params }) => ({
7670
+ type: "phoneDigits",
7671
+ country,
7672
+ min: params.min,
7673
+ max: params.max
7674
+ }),
7675
+ digitCount: ({ params }) => ({
7676
+ type: "digitCount",
7677
+ ...params.lengths !== void 0 && { lengths: [...params.lengths] },
7678
+ ...params.min !== void 0 && { min: params.min },
7679
+ ...params.max !== void 0 && { max: params.max }
7680
+ }),
7681
+ allowedCharacters: ({ params }) => ({
7682
+ type: "allowedCharacters",
7683
+ classes: [...params.classes],
7684
+ ...params.extra !== void 0 && { extra: params.extra }
7685
+ }),
7686
+ charTemplate: ({ params }) => ({
7687
+ type: "charTemplate",
7688
+ templates: [...params.templates],
7689
+ ...params.ignoreCase !== void 0 && { ignoreCase: params.ignoreCase }
7690
+ }),
7691
+ numericRange: ({ params }) => ({
7692
+ type: "numericRange",
7693
+ min: params.min,
7694
+ max: params.max
7695
+ }),
7696
+ rut: () => ({ type: "rut" }),
7697
+ esDni: () => ({ type: "esDni" }),
7698
+ fiPersonalIdentityCode: () => ({ type: "fiPersonalIdentityCode" }),
7699
+ inDrivingLicenseNumber: () => ({ type: "inDrivingLicenseNumber" }),
7700
+ curp: () => ({ type: "curp" })
7701
+ };
7702
+ const isCount = (value) => typeof value === "number" && Number.isInteger(value) && value > 0;
7703
+ const isInteger = (value) => typeof value === "number" && Number.isInteger(value);
7704
+ const isNonEmptyArrayOf = (value, item) => Array.isArray(value) && value.length > 0 && value.every(item);
7705
+ const isString = (value) => typeof value === "string";
7706
+ const isCharacterClass = (value) => CHARACTER_CLASSES.includes(value);
7707
+ /**
7708
+ * Params a projected rule reads. The compiler checks params against the
7709
+ * vocabulary too; this keeps a definition that skipped it, such as a served
7710
+ * one later, from projecting a broken rule.
7711
+ */
7712
+ const RULE_PARAMS = {
7713
+ exactLength: ({ length }) => isCount(length),
7714
+ phoneDigits: ({ min, max }) => isCount(min) && isCount(max) && min <= max,
7715
+ digitCount: ({ lengths, min, max }) => lengths !== void 0 ? isNonEmptyArrayOf(lengths, isCount) && min === void 0 && max === void 0 : isCount(min) && isCount(max) && min <= max,
7716
+ allowedCharacters: ({ classes, extra }) => isNonEmptyArrayOf(classes, isCharacterClass) && (extra === void 0 || isString(extra)),
7717
+ charTemplate: ({ templates, ignoreCase }) => isNonEmptyArrayOf(templates, (t) => isString(t) && t !== "") && (ignoreCase === void 0 || typeof ignoreCase === "boolean"),
7718
+ numericRange: ({ min, max }) => isInteger(min) && isInteger(max) && min <= max,
7719
+ maxAge: ({ years }) => isCount(years)
7720
+ };
7721
+ /**
7722
+ * Whether a field rule maps onto a validator: a known id, valid params, and
7723
+ * a message without params. eKYC's adapter checks its definitions with it.
7724
+ */
7725
+ function isProjectableRule(rule) {
7726
+ return Object.prototype.hasOwnProperty.call(RULES, rule.id) && !rule.message?.params && (RULE_PARAMS[rule.id]?.(rule.params ?? {}) ?? true);
7727
+ }
7728
+ /**
7729
+ * A field's vocabulary rules as today's `EkycValidationRule`s, which
7730
+ * `validateEkycField` runs.
7731
+ */
7732
+ function projectRules(rules, country, required) {
7733
+ return rules.flatMap((rule) => {
7734
+ const project = RULES[rule.id];
7735
+ if (!project) return [];
7736
+ const projected = project({
7737
+ country,
7738
+ required,
7739
+ params: rule.params ?? {}
7740
+ });
7741
+ return [rule.message ? {
7742
+ ...projected,
7743
+ message: rule.message.key
7744
+ } : projected];
7745
+ });
7746
+ }
7271
7747
  //#endregion
7272
7748
  //#region src/modules/ekyc/ekycForm.ts
7273
7749
  /**
@@ -7288,155 +7764,7 @@ const caProvinceOptions = Object.values({
7288
7764
  const OPTION_LISTS = {
7289
7765
  US_STATES: usStateOptions,
7290
7766
  BR_STATES: brStateOptions,
7291
- IN_STATES: Object.values({
7292
- AN: {
7293
- code: "AN",
7294
- name: "Andaman and Nicobar Islands"
7295
- },
7296
- AP: {
7297
- code: "AP",
7298
- name: "Andhra Pradesh"
7299
- },
7300
- AR: {
7301
- code: "AR",
7302
- name: "Arunachal Pradesh"
7303
- },
7304
- AS: {
7305
- code: "AS",
7306
- name: "Assam"
7307
- },
7308
- BR: {
7309
- code: "BR",
7310
- name: "Bihar"
7311
- },
7312
- CH: {
7313
- code: "CH",
7314
- name: "Chandigarh"
7315
- },
7316
- CT: {
7317
- code: "CT",
7318
- name: "Chhattisgarh"
7319
- },
7320
- DH: {
7321
- code: "DH",
7322
- name: "Dadra and Nagar Haveli and Daman and Diu"
7323
- },
7324
- DL: {
7325
- code: "DL",
7326
- name: "Delhi"
7327
- },
7328
- GA: {
7329
- code: "GA",
7330
- name: "Goa"
7331
- },
7332
- GJ: {
7333
- code: "GJ",
7334
- name: "Gujarat"
7335
- },
7336
- HR: {
7337
- code: "HR",
7338
- name: "Haryana"
7339
- },
7340
- HP: {
7341
- code: "HP",
7342
- name: "Himachal Pradesh"
7343
- },
7344
- JK: {
7345
- code: "JK",
7346
- name: "Jammu and Kashmir"
7347
- },
7348
- JH: {
7349
- code: "JH",
7350
- name: "Jharkhand"
7351
- },
7352
- KA: {
7353
- code: "KA",
7354
- name: "Karnataka"
7355
- },
7356
- KL: {
7357
- code: "KL",
7358
- name: "Kerala"
7359
- },
7360
- LA: {
7361
- code: "LA",
7362
- name: "Ladakh"
7363
- },
7364
- LD: {
7365
- code: "LD",
7366
- name: "Lakshadweep"
7367
- },
7368
- MP: {
7369
- code: "MP",
7370
- name: "Madhya Pradesh"
7371
- },
7372
- MH: {
7373
- code: "MH",
7374
- name: "Maharashtra"
7375
- },
7376
- MN: {
7377
- code: "MN",
7378
- name: "Manipur"
7379
- },
7380
- ML: {
7381
- code: "ML",
7382
- name: "Meghalaya"
7383
- },
7384
- MZ: {
7385
- code: "MZ",
7386
- name: "Mizoram"
7387
- },
7388
- NL: {
7389
- code: "NL",
7390
- name: "Nagaland"
7391
- },
7392
- OR: {
7393
- code: "OR",
7394
- name: "Odisha"
7395
- },
7396
- PY: {
7397
- code: "PY",
7398
- name: "Puducherry"
7399
- },
7400
- PB: {
7401
- code: "PB",
7402
- name: "Punjab"
7403
- },
7404
- RJ: {
7405
- code: "RJ",
7406
- name: "Rajasthan"
7407
- },
7408
- SK: {
7409
- code: "SK",
7410
- name: "Sikkim"
7411
- },
7412
- TN: {
7413
- code: "TN",
7414
- name: "Tamil Nadu"
7415
- },
7416
- TG: {
7417
- code: "TG",
7418
- name: "Telangana"
7419
- },
7420
- TR: {
7421
- code: "TR",
7422
- name: "Tripura"
7423
- },
7424
- UP: {
7425
- code: "UP",
7426
- name: "Uttar Pradesh"
7427
- },
7428
- UK: {
7429
- code: "UK",
7430
- name: "Uttarakhand"
7431
- },
7432
- WB: {
7433
- code: "WB",
7434
- name: "West Bengal"
7435
- }
7436
- }).map((state) => ({
7437
- value: state.code,
7438
- label: state.name
7439
- })),
7767
+ IN_STATES: inStateOptions,
7440
7768
  CA_PROVINCES: caProvinceOptions,
7441
7769
  PH_ID_TYPES: [
7442
7770
  {
@@ -1,2 +1,2 @@
1
- import { a as NAMIRIAL_QES_CONSENT_KEYS, c as areAllConsented, i as AE_CONSENT_KEYS, l as getConsentKeys, n as createElectronicSignatureManagerFromActor, o as NAMIRIAL_QES_PROVIDER_CODE, r as electronicSignatureMachine, s as QE_CONSENT_KEYS, t as createElectronicSignatureManager, u as getDefaultConsentChecks } from "./electronicSignatureManager-bgoE6nL8.esm.js";
1
+ import { a as NAMIRIAL_QES_CONSENT_KEYS, c as areAllConsented, i as AE_CONSENT_KEYS, l as getConsentKeys, n as createElectronicSignatureManagerFromActor, o as NAMIRIAL_QES_PROVIDER_CODE, r as electronicSignatureMachine, s as QE_CONSENT_KEYS, t as createElectronicSignatureManager, u as getDefaultConsentChecks } from "./electronicSignatureManager-knl_X2jh.esm.js";
2
2
  export { AE_CONSENT_KEYS, NAMIRIAL_QES_CONSENT_KEYS, NAMIRIAL_QES_PROVIDER_CODE, QE_CONSENT_KEYS, areAllConsented, createElectronicSignatureManager, createElectronicSignatureManagerFromActor, electronicSignatureMachine, getConsentKeys, getDefaultConsentChecks };
@@ -2,7 +2,7 @@ import { n as eventModuleNames } from "./types-CBQN04Rh.esm.js";
2
2
  import { t as api, u as endpoints } from "./api-BNxrW8xK.esm.js";
3
3
  import { t as createManagerInstrumentation } from "./events-ChMS-UzR.esm.js";
4
4
  import { t as topLevelStateName } from "./topLevelStateName-B5i2avbh.esm.js";
5
- import { i as toIncodeApiError, n as isConnectivityError, t as IncodeApiError } from "./apiError-a7tezk_O.esm.js";
5
+ import { i as toIncodeApiError, n as isConnectivityError, t as IncodeApiError } from "./apiError-CxKf45Ky.esm.js";
6
6
  import { t as createManager } from "./Manager-BvXAwDv9.esm.js";
7
7
  import { i as assign, s as createActor, t as setup } from "./xstate.esm-CIqUf_i6.esm.js";
8
8
  import { n as fromPromise } from "./xstate-actors.esm-BCcwgosu.esm.js";