@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,598 +0,0 @@
1
- import { t as getLocalIsoDate } from "./IBrowserEnvironmentCapability-D7JG7ML3.esm.js";
2
- import { n as loadPhoneValidation, t as getPhoneValidation } from "./phoneValidation-OggtfjRt.esm.js";
3
- import { t as isValidCurp } from "./curp-DZGvefg3.esm.js";
4
- import { n as calendarDateError } from "./calendarDate-DcqGuEht.esm.js";
5
- import { i as getPostalCodeErrorParams, o as validatePostalCode, r as getPostalCodeErrorKey, s as STREET_LEVEL_REQUIRED_ERROR } from "./definitionSource-B-Z2EgJJ.esm.js";
6
- import { r as DYNAMIC_REQUIRED_KEY } from "./resolveForm-DaaQSVWp.esm.js";
7
- import { t as validateCPF } from "./cpf-DDXMTLYr.esm.js";
8
- import { n as hasAllowedCharacters } from "./phoneFormat-C3q0Ukh4.esm.js";
9
- //#region src/internal/forms/checks/esDni.ts
10
- const DNI_LETTERS = "TRWAGMYFPDXBNJZSQVHLCKE";
11
- /**
12
- * Spanish DNI: 8 digits and the check letter for their value modulo 23
13
- * (`12345678Z`). A space or hyphen before the letter is ignored. NIEs, the
14
- * foreigners' IDs, are not DNIs and fail.
15
- */
16
- function isValidEsDni(value) {
17
- const dni = value.replace(/[\s-]/g, "").toUpperCase();
18
- const match = /^([0-9]{8})([A-Z])$/.exec(dni);
19
- if (!match) return false;
20
- const [, digits, letter] = match;
21
- return DNI_LETTERS[Number(digits) % 23] === letter;
22
- }
23
- //#endregion
24
- //#region src/internal/forms/checks/fiPersonalIdentityCode.ts
25
- const FI_CHECK_CHARACTERS = "0123456789ABCDEFHJKLMNPRSTUVWXY";
26
- /** The first year of each century sign; the 2023 reform added Y-U and B-F. */
27
- const FI_CENTURY = {
28
- "+": 1800,
29
- "-": 1900,
30
- Y: 1900,
31
- X: 1900,
32
- W: 1900,
33
- V: 1900,
34
- U: 1900,
35
- A: 2e3,
36
- B: 2e3,
37
- C: 2e3,
38
- D: 2e3,
39
- E: 2e3,
40
- F: 2e3
41
- };
42
- const isLeapYear = (year) => year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
43
- const daysInMonth = (year, month) => month === 2 ? isLeapYear(year) ? 29 : 28 : [
44
- 4,
45
- 6,
46
- 9,
47
- 11
48
- ].includes(month) ? 30 : 31;
49
- /**
50
- * Finnish personal identity code (henkilötunnus): `DDMMYY`, a century sign,
51
- * a 3-digit individual number and a check character for the 9 digits modulo
52
- * 31 (`131052-308T`). The date must exist.
53
- */
54
- function isValidFiPersonalIdentityCode(value) {
55
- const match = /^([0-9]{2})([0-9]{2})([0-9]{2})([-+A-FU-Y])([0-9]{3})([0-9A-Y])$/.exec(value.trim().toUpperCase());
56
- if (!match) return false;
57
- const [, dd, mm, yy, sign, individual, check] = match;
58
- const year = FI_CENTURY[sign] + Number(yy);
59
- const month = Number(mm);
60
- const day = Number(dd);
61
- if (month < 1 || month > 12 || day < 1 || day > daysInMonth(year, month)) return false;
62
- return FI_CHECK_CHARACTERS[Number(`${dd}${mm}${yy}${individual}`) % 31] === check;
63
- }
64
- //#endregion
65
- //#region src/internal/forms/checks/inDrivingLicenseNumber.ts
66
- const IN_DRIVING_LICENSE_REGEX = /^[A-Z]{2}[-\s]?[0-9]{2}(?:[0-9]{2})?[-\s]?(?:19|20)[0-9]{2}[-\s]?[0-9]{7}$/i;
67
- /**
68
- * Indian driving licence number format, `SS-RR[RR]-YYYY-NNNNNNN`, with or
69
- * without hyphens (`MH-12-2011-0012345`, `MH1220110012345`). Format only:
70
- * the number has no check digit.
71
- */
72
- function isValidInDrivingLicenseNumber(value) {
73
- return IN_DRIVING_LICENSE_REGEX.test(value.trim());
74
- }
75
- //#endregion
76
- //#region src/internal/forms/checks/rut.ts
77
- /**
78
- * Chilean RUT/RUN: a 7- or 8-digit body and a check character, 0-9 or K,
79
- * computed modulo 11. Dots, a hyphen and spaces are ignored
80
- * (`12.345.678-5`, `12345678-5`, `123456785`).
81
- */
82
- function isValidRut(value) {
83
- const rut = value.replace(/[.\s-]/g, "").toUpperCase();
84
- const match = /^([0-9]{7,8})([0-9K])$/.exec(rut);
85
- if (!match) return false;
86
- const [, body, check] = match;
87
- let sum = 0;
88
- let factor = 2;
89
- for (let i = body.length - 1; i >= 0; i--) {
90
- sum += Number(body[i]) * factor;
91
- factor = factor === 7 ? 2 : factor + 1;
92
- }
93
- const rest = 11 - sum % 11;
94
- return check === (rest === 11 ? "0" : rest === 10 ? "K" : String(rest));
95
- }
96
- //#endregion
97
- //#region src/internal/forms/resolvePrefill.ts
98
- const DISPLAY_MODES = /* @__PURE__ */ new Set([
99
- "editable",
100
- "readOnly",
101
- "hidden"
102
- ]);
103
- const ONE_OF_REQUIRED = "oneOfRequired";
104
- const filled = (value) => value !== void 0 && value.trim() !== "";
105
- function configuredMode(context, group) {
106
- const mode = context.displayModes?.[group];
107
- return mode !== void 0 && DISPLAY_MODES.has(mode) ? mode : "editable";
108
- }
109
- /** The field's prefill source for its group's origin, if it lists one. */
110
- function sourceFor(field, context) {
111
- const origin = context.origins?.[field.group];
112
- if (!origin) return void 0;
113
- return field.prefill?.find((id) => id.startsWith(`${origin}.`));
114
- }
115
- /**
116
- * Decides each shown field's prefilled value and display mode, from the
117
- * resolved form, module configuration's origins and display modes, and the
118
- * values the module read. Pure and synchronous.
119
- *
120
- * A value that fails its field's checks is dropped. A group configured
121
- * `hidden` or `readOnly` becomes `editable` as a whole when one of its
122
- * required fields has no value, or when a `oneOfRequired` rule over it has
123
- * none, so the user can always complete the form. An optional field without
124
- * a value keeps its mode and sends nothing. An editable field filled from one
125
- * of the context's `lockingOrigins` shows read-only.
126
- */
127
- function resolvePrefill(form, context, data, checks) {
128
- const candidates = {};
129
- for (const { field } of form.fields) {
130
- const source = sourceFor(field, context);
131
- const raw = source ? data[source] : void 0;
132
- if (filled(raw)) candidates[field.name] = checks.format(field, raw);
133
- }
134
- const values = {};
135
- for (const { field } of form.fields) {
136
- const value = candidates[field.name];
137
- if (filled(value) && checks.isValid(field, value, candidates)) values[field.name] = value;
138
- }
139
- const isRequired = (resolved) => resolved.required || resolved.requiredIfFilled.some((name) => filled(values[name]));
140
- const promoted = /* @__PURE__ */ new Set();
141
- const promote = (group) => {
142
- if (configuredMode(context, group) !== "editable") promoted.add(group);
143
- };
144
- for (const resolved of form.fields) if (isRequired(resolved) && !filled(values[resolved.field.name])) promote(resolved.field.group);
145
- const groupOf = new Map(form.fields.map(({ field }) => [field.name, field.group]));
146
- for (const { rule, fields } of form.groupRules) {
147
- if (rule.id !== ONE_OF_REQUIRED) continue;
148
- if (fields.some((name) => filled(values[name]))) continue;
149
- for (const name of fields) {
150
- const group = groupOf.get(name);
151
- if (group) promote(group);
152
- }
153
- }
154
- return {
155
- fields: form.fields.map((resolved) => {
156
- const { group, name } = resolved.field;
157
- if (promoted.has(group)) return {
158
- ...resolved,
159
- displayMode: "editable",
160
- displayReason: "promoted"
161
- };
162
- const configured = configuredMode(context, group);
163
- const origin = context.origins?.[group];
164
- if (configured === "editable" && filled(values[name]) && origin !== void 0 && context.lockingOrigins?.includes(origin)) return {
165
- ...resolved,
166
- displayMode: "readOnly",
167
- displayReason: "locked"
168
- };
169
- return {
170
- ...resolved,
171
- displayMode: configured,
172
- displayReason: "configured"
173
- };
174
- }),
175
- values
176
- };
177
- }
178
- //#endregion
179
- //#region src/internal/forms/checks/digitCount.ts
180
- /** `digitCount`: only the digits 0-9, with a count in `lengths` or between `min` and `max`. */
181
- function hasDigitCount(value, count) {
182
- if (!/^[0-9]+$/.test(value)) return false;
183
- const { length } = value;
184
- if (count.lengths) return count.lengths.includes(length);
185
- return (count.min === void 0 || length >= count.min) && (count.max === void 0 || length <= count.max);
186
- }
187
- /**
188
- * The `digitCount` message: one length (`exactDigits`), a list of lengths
189
- * (`digitsOneOf`), or a range (`digitsBetween`), with the counts as params.
190
- */
191
- function digitCountError(count) {
192
- if (count.lengths?.length === 1) return {
193
- key: "verification.errors.exactDigits",
194
- params: { length: count.lengths[0] }
195
- };
196
- if (count.lengths) return {
197
- key: "verification.errors.digitsOneOf",
198
- params: { lengths: [...count.lengths] }
199
- };
200
- return {
201
- key: "verification.errors.digitsBetween",
202
- params: {
203
- min: count.min ?? 0,
204
- max: count.max ?? 0
205
- }
206
- };
207
- }
208
- //#endregion
209
- //#region src/internal/forms/checks/emailFormat.ts
210
- /** One `@`, no whitespace, and a dot inside the domain. */
211
- const EMAIL_PATTERN = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
212
- /** Whether a value has an email's shape: one `@`, no spaces, a dot in the domain. */
213
- function isEmailFormat(value) {
214
- return EMAIL_PATTERN.test(value);
215
- }
216
- //#endregion
217
- //#region src/internal/forms/checks/noPoBox.ts
218
- const PO_BOX_PATTERN = /POBox|P\.O\.Box|pobox|postofficebox|postbox|po\.box|p\.o\.box/i;
219
- /** Whether an address describes a P.O. box, ignoring whitespace and case. */
220
- function isPoBox(address) {
221
- return PO_BOX_PATTERN.test(address.replace(/\s/g, ""));
222
- }
223
- //#endregion
224
- //#region src/internal/forms/checks/charTemplate.ts
225
- const escapeForPattern = (chars) => chars.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
226
- /**
227
- * `charTemplate`: the whole value matches one template, where `9` is a digit,
228
- * `A` an uppercase letter A-Z and any other character stands for itself.
229
- * `ignoreCase` also accepts lowercase letters and literals in either case.
230
- */
231
- function matchesCharTemplate(value, templates, ignoreCase = false) {
232
- return templates.some((template) => {
233
- const pattern = [...template].map((char) => {
234
- if (char === "9") return "[0-9]";
235
- if (char === "A") return "[A-Z]";
236
- return escapeForPattern(char);
237
- }).join("");
238
- return new RegExp(`^${pattern}$`, ignoreCase ? "iu" : "u").test(value);
239
- });
240
- }
241
- //#endregion
242
- //#region src/internal/forms/checks/maxAge.ts
243
- /**
244
- * `maxAge`: an ISO `YYYY-MM-DD` date of birth at most `years` full years
245
- * before `today`, also ISO, in the user's calendar. As in SDK1, someone turns
246
- * a year older on their birthday. Field structure validation checks calendar
247
- * dates before this age rule runs.
248
- */
249
- function isWithinMaxAge(value, today, years) {
250
- if (!/^\d{4}-\d{2}-\d{2}$/.test(value)) return true;
251
- const [birthYear, birthMonthDay] = [value.slice(0, 4), value.slice(5)];
252
- const [todayYear, todayMonthDay] = [today.slice(0, 4), today.slice(5)];
253
- return Number(todayYear) - Number(birthYear) - (todayMonthDay < birthMonthDay ? 1 : 0) <= years;
254
- }
255
- //#endregion
256
- //#region src/internal/forms/checks/nameCharacters.ts
257
- const NAME_REGEX = /^[\p{L}\p{M} '’-]+$/u;
258
- /** `nameCharacters`: letters from any script, spaces, hyphens and apostrophes. */
259
- function hasNameCharacters(value) {
260
- return NAME_REGEX.test(value);
261
- }
262
- //#endregion
263
- //#region src/internal/forms/checks/notFuture.ts
264
- /**
265
- * `notFuture`: an ISO `YYYY-MM-DD` date on or before `today`, also ISO, in
266
- * the user's calendar. Field structure validation checks calendar dates
267
- * before this range rule runs.
268
- */
269
- function isNotFuture(value, today) {
270
- if (!/^\d{4}-\d{2}-\d{2}$/.test(value)) return true;
271
- return value <= today;
272
- }
273
- //#endregion
274
- //#region src/internal/forms/checks/numericRange.ts
275
- /** `numericRange`: a whole number from `min` to `max`. */
276
- function isInNumericRange(value, min, max) {
277
- if (!/^-?[0-9]+$/.test(value)) return false;
278
- const number = Number(value);
279
- return number >= min && number <= max;
280
- }
281
- //#endregion
282
- //#region src/shared/validators/textRules.ts
283
- const CHARACTER_CLASSES = [
284
- "letter",
285
- "digit",
286
- "space"
287
- ];
288
- //#endregion
289
- //#region src/modules/ekyc/ekycValidators.ts
290
- async function loadPhoneValidator() {
291
- if (!await loadPhoneValidation()) throw new Error("Failed to load the phone validation rules");
292
- }
293
- /** Progressively formats an SSN as XXX-XX-XXXX */
294
- function formatSSN(value) {
295
- const ssn = value?.replace(/\D/g, "") ?? "";
296
- if (ssn.length < 4) return ssn;
297
- if (ssn.length < 6) return `${ssn.slice(0, 3)}-${ssn.slice(3)}`;
298
- return `${ssn.slice(0, 3)}-${ssn.slice(3, 5)}-${ssn.slice(5, 9)}`;
299
- }
300
- /**
301
- * Strips characters a name can't contain, as the user types. Keeps everything
302
- * `nameCharacters` allows (letters from any script with their combining marks,
303
- * spaces, hyphens, and straight or typographic apostrophes), plus the commas
304
- * and acute accents (´) SDKv1 kept, so it never strips a valid name.
305
- */
306
- function cleanName(name) {
307
- return (name ?? "").replace(/[^\p{L}\p{M}\s,'’´-]/gu, "").slice(0, 100);
308
- }
309
- function validatePhone(phone, country) {
310
- return getPhoneValidation()?.isValid(phone, country) ?? false;
311
- }
312
- /** The phone's national significant number, or the value as typed. */
313
- function formatPhoneNational(phone, country) {
314
- return getPhoneValidation()?.nationalNumber(phone, country) ?? phone;
315
- }
316
- const ONE_OF_REQUIRED_ERROR_KEY = "verification.errors.dobOrSsnRequired";
317
- /** The error key a `oneOfRequired` group shows: its own message, or DOB-or-SSN. */
318
- const oneOfRequiredErrorKey = (rule) => rule.message ?? "verification.errors.dobOrSsnRequired";
319
- const PHONE_INVALID_KEY = "verification.errors.phoneInvalid";
320
- const INVALID_ID_NUMBER_KEY = "verification.errors.invalidIdNumber";
321
- /**
322
- * A national ID check: blank passes, anything else must satisfy `isValid`.
323
- * The error is the vocabulary's message for these rules; a definition names
324
- * its own with the rule's `message`.
325
- */
326
- const idNumberValidator = (isValid) => (value) => {
327
- if (value.trim().length === 0) return void 0;
328
- if (isValid(value)) return void 0;
329
- return { key: INVALID_ID_NUMBER_KEY };
330
- };
331
- const normalizeFieldValue = (value) => typeof value === "string" ? value : String(value ?? "");
332
- const SSN_FORMAT_REGEX = /^\d{3}-\d{2}-\d{4}$/;
333
- const requiredError = (field) => {
334
- const fieldName = field.displayLabel ?? field.label;
335
- return fieldName ? {
336
- key: DYNAMIC_REQUIRED_KEY,
337
- params: { fieldName }
338
- } : { key: DYNAMIC_REQUIRED_KEY };
339
- };
340
- const isFilled = (values, name) => normalizeFieldValue(values[name]).trim().length > 0;
341
- const createValidators = () => {
342
- const validators = {
343
- required: (value, _rule, field) => {
344
- if (value.trim().length > 0) return void 0;
345
- return requiredError(field);
346
- },
347
- requiredIfFilled: (value, rule, field, values) => {
348
- if (rule.type !== "requiredIfFilled") return void 0;
349
- if (value.trim().length > 0) return void 0;
350
- return rule.fields.some((name) => isFilled(values, name)) ? requiredError(field) : void 0;
351
- },
352
- rulesByOption: (value, rule, field, values) => {
353
- if (rule.type !== "rulesByOption") return void 0;
354
- if (value.trim().length === 0) return void 0;
355
- const option = normalizeFieldValue(values[rule.selector]).trim();
356
- const rules = Object.prototype.hasOwnProperty.call(rule.cases, option) ? rule.cases[option] : void 0;
357
- return evaluateRules(value, rules, field, values, validators);
358
- },
359
- streetLevelRequired: (value) => {
360
- if (value.trim().length > 0) return void 0;
361
- return STREET_LEVEL_REQUIRED_ERROR;
362
- },
363
- cpf: (value) => {
364
- if (value.trim().length === 0) return void 0;
365
- return validateCPF(value) ? void 0 : { key: "verification.errors.invalidTaxId" };
366
- },
367
- ssnFormat: (value) => {
368
- if (value.trim().length === 0) return void 0;
369
- return SSN_FORMAT_REGEX.test(value) ? void 0 : { key: "verification.errors.ssnFormat" };
370
- },
371
- noPoBox: (value) => {
372
- if (value.trim().length === 0) return void 0;
373
- return isPoBox(value) ? { key: "verification.errors.poBox" } : void 0;
374
- },
375
- postalCodeFormat: (value, rule) => {
376
- if (rule.type !== "postalCodeFormat") return void 0;
377
- if (value.trim().length === 0) return void 0;
378
- if (validatePostalCode(value, rule.country)) return void 0;
379
- return {
380
- key: getPostalCodeErrorKey(rule.country),
381
- params: getPostalCodeErrorParams(rule.country)
382
- };
383
- },
384
- phoneFormat: (value, rule) => {
385
- if (rule.type !== "phoneFormat") return void 0;
386
- const trimmed = value.trim();
387
- if (rule.optional && trimmed.length === 0) return void 0;
388
- return validatePhone(trimmed, rule.country) ? void 0 : { key: "verification.errors.phoneInvalid" };
389
- },
390
- emailFormat: (value) => {
391
- if (value.trim().length === 0) return void 0;
392
- return isEmailFormat(value) ? void 0 : { key: "verification.errors.emailInvalid" };
393
- },
394
- exactLength: (value, rule) => {
395
- if (rule.type !== "exactLength") return void 0;
396
- if (value.trim().length === 0) return void 0;
397
- return value.length === rule.length ? void 0 : { key: "verification.errors.exactly10Characters" };
398
- },
399
- nameCharacters: (value) => {
400
- if (value.trim().length === 0) return void 0;
401
- return hasNameCharacters(value.trim()) ? void 0 : { key: "verification.errors.nameCharacters" };
402
- },
403
- notFuture: (value) => {
404
- if (value.trim().length === 0) return void 0;
405
- return isNotFuture(value.trim(), getLocalIsoDate()) ? void 0 : { key: "verification.errors.futureDate" };
406
- },
407
- maxAge: (value, rule) => {
408
- if (rule.type !== "maxAge") return void 0;
409
- if (value.trim().length === 0) return void 0;
410
- return isWithinMaxAge(value.trim(), getLocalIsoDate(), rule.years) ? void 0 : { key: "verification.errors.dateOfBirthMaxAge" };
411
- },
412
- phoneDigits: (value, rule) => {
413
- if (rule.type !== "phoneDigits") return void 0;
414
- const trimmed = value.trim();
415
- if (trimmed.length === 0) return void 0;
416
- const national = getPhoneValidation()?.nationalNumber(trimmed, rule.country);
417
- if (!national) return { key: PHONE_INVALID_KEY };
418
- return national.length >= rule.min && national.length <= rule.max ? void 0 : { key: PHONE_INVALID_KEY };
419
- },
420
- digitCount: (value, rule) => {
421
- if (rule.type !== "digitCount") return void 0;
422
- if (value.trim().length === 0) return void 0;
423
- return hasDigitCount(value.trim(), rule) ? void 0 : digitCountError(rule);
424
- },
425
- allowedCharacters: (value, rule) => {
426
- if (rule.type !== "allowedCharacters") return void 0;
427
- if (value.trim().length === 0) return void 0;
428
- return hasAllowedCharacters(value.trim(), rule.classes, rule.extra) ? void 0 : { key: "verification.errors.invalidCharacters" };
429
- },
430
- charTemplate: (value, rule) => {
431
- if (rule.type !== "charTemplate") return void 0;
432
- if (value.trim().length === 0) return void 0;
433
- return matchesCharTemplate(value.trim(), rule.templates, rule.ignoreCase) ? void 0 : { key: "verification.errors.invalidFormat" };
434
- },
435
- numericRange: (value, rule) => {
436
- if (rule.type !== "numericRange") return void 0;
437
- if (value.trim().length === 0) return void 0;
438
- return isInNumericRange(value.trim(), rule.min, rule.max) ? void 0 : {
439
- key: "verification.errors.numberBetween",
440
- params: {
441
- min: rule.min,
442
- max: rule.max
443
- }
444
- };
445
- },
446
- rut: idNumberValidator(isValidRut),
447
- esDni: idNumberValidator(isValidEsDni),
448
- fiPersonalIdentityCode: idNumberValidator(isValidFiPersonalIdentityCode),
449
- inDrivingLicenseNumber: idNumberValidator(isValidInDrivingLicenseNumber),
450
- curp: idNumberValidator((value) => isValidCurp(value.trim())),
451
- oneOfRequired: (_value, rule, _field, values) => {
452
- if (rule.type !== "oneOfRequired") return void 0;
453
- return rule.fields.some((name) => isFilled(values, name)) ? void 0 : { key: oneOfRequiredErrorKey(rule) };
454
- }
455
- };
456
- return validators;
457
- };
458
- /**
459
- * A rule's own message key shows instead of the validator's, keeping its
460
- * params. `oneOfRequired` already shows its message.
461
- */
462
- const withRuleMessage = (error, rule) => !rule.message || error.key === rule.message ? error : {
463
- ...error,
464
- key: rule.message
465
- };
466
- const evaluateRules = (value, rules, field, values, validators) => {
467
- const dateError = field.type === "date" ? calendarDateError(value.trim()) : void 0;
468
- if (dateError) return { key: dateError };
469
- if (!rules) return void 0;
470
- for (const rule of rules) {
471
- const error = validators[rule.type](value, rule, field, values);
472
- if (error) return withRuleMessage(error, rule);
473
- }
474
- };
475
- function validateEkycForm(values, fields) {
476
- const validators = createValidators();
477
- return fields.reduce((errors, field) => {
478
- const value = normalizeFieldValue(values[field.name]);
479
- const error = evaluateRules(value, field.validation, field, values, validators);
480
- if (error) errors[field.name] = error;
481
- return errors;
482
- }, {});
483
- }
484
- function validateEkycField(values, fieldName, fields) {
485
- const field = fields.find((f) => f.name === fieldName);
486
- if (!field) return void 0;
487
- const validators = createValidators();
488
- const value = normalizeFieldValue(values[field.name]);
489
- return evaluateRules(value, field.validation, field, values, validators);
490
- }
491
- //#endregion
492
- //#region src/modules/ekyc/ekycRules.ts
493
- /** Vocabulary rules expressed as today's `EkycValidationRule` objects. */
494
- const RULES = {
495
- cpf: () => ({ type: "cpf" }),
496
- ssnFormat: () => ({ type: "ssnFormat" }),
497
- noPoBox: () => ({ type: "noPoBox" }),
498
- emailFormat: () => ({ type: "emailFormat" }),
499
- postalCodeFormat: ({ country }) => ({
500
- type: "postalCodeFormat",
501
- country
502
- }),
503
- phoneFormat: ({ country, required }) => ({
504
- type: "phoneFormat",
505
- country,
506
- optional: !required
507
- }),
508
- exactLength: ({ params }) => ({
509
- type: "exactLength",
510
- length: params.length
511
- }),
512
- nameCharacters: () => ({ type: "nameCharacters" }),
513
- notFuture: () => ({ type: "notFuture" }),
514
- maxAge: ({ params }) => ({
515
- type: "maxAge",
516
- years: params.years
517
- }),
518
- phoneDigits: ({ country, params }) => ({
519
- type: "phoneDigits",
520
- country,
521
- min: params.min,
522
- max: params.max
523
- }),
524
- digitCount: ({ params }) => ({
525
- type: "digitCount",
526
- ...params.lengths !== void 0 && { lengths: [...params.lengths] },
527
- ...params.min !== void 0 && { min: params.min },
528
- ...params.max !== void 0 && { max: params.max }
529
- }),
530
- allowedCharacters: ({ params }) => ({
531
- type: "allowedCharacters",
532
- classes: [...params.classes],
533
- ...params.extra !== void 0 && { extra: params.extra }
534
- }),
535
- charTemplate: ({ params }) => ({
536
- type: "charTemplate",
537
- templates: [...params.templates],
538
- ...params.ignoreCase !== void 0 && { ignoreCase: params.ignoreCase }
539
- }),
540
- numericRange: ({ params }) => ({
541
- type: "numericRange",
542
- min: params.min,
543
- max: params.max
544
- }),
545
- rut: () => ({ type: "rut" }),
546
- esDni: () => ({ type: "esDni" }),
547
- fiPersonalIdentityCode: () => ({ type: "fiPersonalIdentityCode" }),
548
- inDrivingLicenseNumber: () => ({ type: "inDrivingLicenseNumber" }),
549
- curp: () => ({ type: "curp" })
550
- };
551
- const isCount = (value) => typeof value === "number" && Number.isInteger(value) && value > 0;
552
- const isInteger = (value) => typeof value === "number" && Number.isInteger(value);
553
- const isNonEmptyArrayOf = (value, item) => Array.isArray(value) && value.length > 0 && value.every(item);
554
- const isString = (value) => typeof value === "string";
555
- const isCharacterClass = (value) => CHARACTER_CLASSES.includes(value);
556
- /**
557
- * Params a projected rule reads. The compiler checks params against the
558
- * vocabulary too; this keeps a definition that skipped it, such as a served
559
- * one later, from projecting a broken rule.
560
- */
561
- const RULE_PARAMS = {
562
- exactLength: ({ length }) => isCount(length),
563
- phoneDigits: ({ min, max }) => isCount(min) && isCount(max) && min <= max,
564
- digitCount: ({ lengths, min, max }) => lengths !== void 0 ? isNonEmptyArrayOf(lengths, isCount) && min === void 0 && max === void 0 : isCount(min) && isCount(max) && min <= max,
565
- allowedCharacters: ({ classes, extra }) => isNonEmptyArrayOf(classes, isCharacterClass) && (extra === void 0 || isString(extra)),
566
- charTemplate: ({ templates, ignoreCase }) => isNonEmptyArrayOf(templates, (t) => isString(t) && t !== "") && (ignoreCase === void 0 || typeof ignoreCase === "boolean"),
567
- numericRange: ({ min, max }) => isInteger(min) && isInteger(max) && min <= max,
568
- maxAge: ({ years }) => isCount(years)
569
- };
570
- /**
571
- * Whether a field rule maps onto a validator: a known id, valid params, and
572
- * a message without params. eKYC's adapter and eKYC Pre-fill's both check
573
- * their definitions with it.
574
- */
575
- function isProjectableRule(rule) {
576
- return Object.prototype.hasOwnProperty.call(RULES, rule.id) && !rule.message?.params && (RULE_PARAMS[rule.id]?.(rule.params ?? {}) ?? true);
577
- }
578
- /**
579
- * A field's vocabulary rules as today's `EkycValidationRule`s, which
580
- * `validateEkycField` runs. eKYC Pre-fill validates with them too.
581
- */
582
- function projectRules(rules, country, required) {
583
- return rules.flatMap((rule) => {
584
- const project = RULES[rule.id];
585
- if (!project) return [];
586
- const projected = project({
587
- country,
588
- required,
589
- params: rule.params ?? {}
590
- });
591
- return [rule.message ? {
592
- ...projected,
593
- message: rule.message.key
594
- } : projected];
595
- });
596
- }
597
- //#endregion
598
- export { ONE_OF_REQUIRED_ERROR_KEY as a, formatSSN as c, validateEkycField as d, validateEkycForm as f, projectRules as i, loadPhoneValidator as l, isCount as n, cleanName as o, resolvePrefill as p, isProjectableRule as r, formatPhoneNational as s, RULES as t, oneOfRequiredErrorKey as u };
@@ -1 +0,0 @@
1
- import "./trueSightService-DjwNQ37t.esm.js";
@@ -1,6 +0,0 @@
1
- import { i as FlowModuleConfig } from "./types-aKXf9SVN.js";
2
- import { t as BaseFaceCaptureConfig } from "./types-_rJ2GjgK.js";
3
- //#region src/modules/authentication/types.d.ts
4
- type AuthenticationConfig = FlowModuleConfig['AUTHENTICATION'] & BaseFaceCaptureConfig;
5
- //#endregion
6
- export { AuthenticationConfig as t };