@incodetech/core 0.0.0-dev-20260515-901da9a → 0.0.0-dev-20260515-a07df20

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 (33) hide show
  1. package/dist/ae-signature.d.ts +1 -1
  2. package/dist/consent.d.ts +53 -53
  3. package/dist/cpf-ocr.d.ts +17 -17
  4. package/dist/curp-validation.d.ts +75 -2
  5. package/dist/curp-validation.esm.js +13 -4
  6. package/dist/{curpValidationStateMachine-BN9UT3zL.esm.js → curpValidationStateMachine-CitWLr2c.esm.js} +221 -98
  7. package/dist/document-capture.d.ts +68 -68
  8. package/dist/document-upload.d.ts +40 -40
  9. package/dist/ekyb.esm.js +3 -3
  10. package/dist/{ekybStateMachine-kgHDVPOe.esm.js → ekybStateMachine-BihTKkNC.esm.js} +1 -1
  11. package/dist/electronic-signature.d.ts +1 -1
  12. package/dist/extensibility.esm.js +3 -3
  13. package/dist/flow.d.ts +2 -2
  14. package/dist/flow.esm.js +2 -2
  15. package/dist/{flowServices-sJ_JWhfy.esm.js → flowServices-DZAOYIFW.esm.js} +1 -1
  16. package/dist/home.d.ts +10 -10
  17. package/dist/id-ocr.d.ts +52 -52
  18. package/dist/id-verification.d.ts +25 -25
  19. package/dist/id.esm.js +3 -3
  20. package/dist/{idCaptureManager-BBRl3cZ5.esm.js → idCaptureManager-Ch64CD8w.esm.js} +1 -1
  21. package/dist/{idCaptureStateMachine-Bxmq2inh.esm.js → idCaptureStateMachine-KxWTQqcZ.esm.js} +1 -1
  22. package/dist/identity-reuse.d.ts +40 -40
  23. package/dist/{index-DCn-iHP8.d.ts → index-CNUtzsRO.d.ts} +119 -119
  24. package/dist/index.esm.js +2 -2
  25. package/dist/mandatory-consent.d.ts +50 -50
  26. package/dist/qe-signature.d.ts +1 -1
  27. package/dist/{session-5VY8_gE3.esm.js → session-CONcSjo_.esm.js} +1 -1
  28. package/dist/session.esm.js +1 -1
  29. package/dist/{setup-CztGA3_O.esm.js → setup-BWHiqu6S.esm.js} +1 -1
  30. package/dist/wasm.esm.js +2 -2
  31. package/dist/workflow.d.ts +123 -123
  32. package/dist/workflow.esm.js +5 -5
  33. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import { t as Manager } from "./Manager-C8PrhBOx.js";
2
2
  import "./Actor-CI32dTbG.js";
3
- import { a as AE_CONSENT_KEYS, c as ConsentKey, g as getDefaultConsentChecks, i as electronicSignatureMachine, l as ElectronicSignatureConfig, m as areAllConsented, n as ElectronicSignatureState, s as ConsentChecks, u as ElectronicSignatureDocument } from "./index-DCn-iHP8.js";
3
+ import { a as AE_CONSENT_KEYS, c as ConsentKey, g as getDefaultConsentChecks, i as electronicSignatureMachine, l as ElectronicSignatureConfig, m as areAllConsented, n as ElectronicSignatureState, s as ConsentChecks, u as ElectronicSignatureDocument } from "./index-CNUtzsRO.js";
4
4
 
5
5
  //#region src/modules/ae-signature/index.d.ts
6
6
 
package/dist/consent.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { t as Manager } from "./Manager-C8PrhBOx.js";
2
2
  import "./Actor-CI32dTbG.js";
3
- import * as xstate0 from "xstate";
3
+ import * as xstate1211 from "xstate";
4
4
 
5
5
  //#region src/modules/consent/types.d.ts
6
6
  type ConsentConfig = {
@@ -36,7 +36,7 @@ type ConsentContext = {
36
36
  type ConsentInput = {
37
37
  config: ConsentConfig;
38
38
  };
39
- declare const consentMachine: xstate0.StateMachine<ConsentContext, {
39
+ declare const consentMachine: xstate1211.StateMachine<ConsentContext, {
40
40
  type: "LOAD";
41
41
  } | {
42
42
  type: "TOGGLE_CHECKBOX";
@@ -48,53 +48,53 @@ declare const consentMachine: xstate0.StateMachine<ConsentContext, {
48
48
  } | {
49
49
  type: "RESET";
50
50
  }, {
51
- [x: string]: xstate0.ActorRefFromLogic<xstate0.PromiseActorLogic<FetchCombinedConsentResponse, {
51
+ [x: string]: xstate1211.ActorRefFromLogic<xstate1211.PromiseActorLogic<FetchCombinedConsentResponse, {
52
52
  consentId: string;
53
- }, xstate0.EventObject>> | xstate0.ActorRefFromLogic<xstate0.PromiseActorLogic<void, {
53
+ }, xstate1211.EventObject>> | xstate1211.ActorRefFromLogic<xstate1211.PromiseActorLogic<void, {
54
54
  languageConsentId: string;
55
55
  checkboxes: ConsentCheckbox[];
56
- }, xstate0.EventObject>> | undefined;
57
- }, xstate0.Values<{
56
+ }, xstate1211.EventObject>> | undefined;
57
+ }, xstate1211.Values<{
58
58
  fetchConsent: {
59
59
  src: "fetchConsent";
60
- logic: xstate0.PromiseActorLogic<FetchCombinedConsentResponse, {
60
+ logic: xstate1211.PromiseActorLogic<FetchCombinedConsentResponse, {
61
61
  consentId: string;
62
- }, xstate0.EventObject>;
62
+ }, xstate1211.EventObject>;
63
63
  id: string | undefined;
64
64
  };
65
65
  submitConsent: {
66
66
  src: "submitConsent";
67
- logic: xstate0.PromiseActorLogic<void, {
67
+ logic: xstate1211.PromiseActorLogic<void, {
68
68
  languageConsentId: string;
69
69
  checkboxes: ConsentCheckbox[];
70
- }, xstate0.EventObject>;
70
+ }, xstate1211.EventObject>;
71
71
  id: string | undefined;
72
72
  };
73
- }>, xstate0.Values<{
74
- setConsentData: {
75
- type: "setConsentData";
76
- params: xstate0.NonReducibleUnknown;
77
- };
78
- toggleCheckbox: {
79
- type: "toggleCheckbox";
80
- params: xstate0.NonReducibleUnknown;
81
- };
73
+ }>, xstate1211.Values<{
82
74
  setError: {
83
75
  type: "setError";
84
- params: xstate0.NonReducibleUnknown;
76
+ params: xstate1211.NonReducibleUnknown;
85
77
  };
86
78
  clearError: {
87
79
  type: "clearError";
88
- params: xstate0.NonReducibleUnknown;
80
+ params: xstate1211.NonReducibleUnknown;
89
81
  };
90
82
  resetContext: {
91
83
  type: "resetContext";
92
- params: xstate0.NonReducibleUnknown;
84
+ params: xstate1211.NonReducibleUnknown;
85
+ };
86
+ setConsentData: {
87
+ type: "setConsentData";
88
+ params: xstate1211.NonReducibleUnknown;
89
+ };
90
+ toggleCheckbox: {
91
+ type: "toggleCheckbox";
92
+ params: xstate1211.NonReducibleUnknown;
93
93
  };
94
94
  }>, {
95
95
  type: "canSubmit";
96
96
  params: unknown;
97
- }, never, "error" | "idle" | "finished" | "loading" | "display" | "submitting", string, ConsentInput, xstate0.NonReducibleUnknown, xstate0.EventObject, xstate0.MetaObject, {
97
+ }, never, "error" | "idle" | "finished" | "loading" | "display" | "submitting", string, ConsentInput, xstate1211.NonReducibleUnknown, xstate1211.EventObject, xstate1211.MetaObject, {
98
98
  readonly id: "consent";
99
99
  readonly initial: "idle";
100
100
  readonly context: ({
@@ -103,70 +103,70 @@ declare const consentMachine: xstate0.StateMachine<ConsentContext, {
103
103
  spawn: {
104
104
  <TSrc extends "fetchConsent" | "submitConsent">(logic: TSrc, ...[options]: ({
105
105
  src: "fetchConsent";
106
- logic: xstate0.PromiseActorLogic<FetchCombinedConsentResponse, {
106
+ logic: xstate1211.PromiseActorLogic<FetchCombinedConsentResponse, {
107
107
  consentId: string;
108
- }, xstate0.EventObject>;
108
+ }, xstate1211.EventObject>;
109
109
  id: string | undefined;
110
110
  } extends infer T ? T extends {
111
111
  src: "fetchConsent";
112
- logic: xstate0.PromiseActorLogic<FetchCombinedConsentResponse, {
112
+ logic: xstate1211.PromiseActorLogic<FetchCombinedConsentResponse, {
113
113
  consentId: string;
114
- }, xstate0.EventObject>;
114
+ }, xstate1211.EventObject>;
115
115
  id: string | undefined;
116
116
  } ? T extends {
117
117
  src: TSrc;
118
- } ? xstate0.ConditionalRequired<[options?: ({
118
+ } ? xstate1211.ConditionalRequired<[options?: ({
119
119
  id?: T["id"] | undefined;
120
120
  systemId?: string;
121
- input?: xstate0.InputFrom<T["logic"]> | undefined;
121
+ input?: xstate1211.InputFrom<T["logic"]> | undefined;
122
122
  syncSnapshot?: boolean;
123
- } & { [K in xstate0.RequiredActorOptions<T>]: unknown }) | undefined], xstate0.IsNotNever<xstate0.RequiredActorOptions<T>>> : never : never : never) | ({
123
+ } & { [K in xstate1211.RequiredActorOptions<T>]: unknown }) | undefined], xstate1211.IsNotNever<xstate1211.RequiredActorOptions<T>>> : never : never : never) | ({
124
124
  src: "submitConsent";
125
- logic: xstate0.PromiseActorLogic<void, {
125
+ logic: xstate1211.PromiseActorLogic<void, {
126
126
  languageConsentId: string;
127
127
  checkboxes: ConsentCheckbox[];
128
- }, xstate0.EventObject>;
128
+ }, xstate1211.EventObject>;
129
129
  id: string | undefined;
130
130
  } extends infer T_1 ? T_1 extends {
131
131
  src: "submitConsent";
132
- logic: xstate0.PromiseActorLogic<void, {
132
+ logic: xstate1211.PromiseActorLogic<void, {
133
133
  languageConsentId: string;
134
134
  checkboxes: ConsentCheckbox[];
135
- }, xstate0.EventObject>;
135
+ }, xstate1211.EventObject>;
136
136
  id: string | undefined;
137
137
  } ? T_1 extends {
138
138
  src: TSrc;
139
- } ? xstate0.ConditionalRequired<[options?: ({
139
+ } ? xstate1211.ConditionalRequired<[options?: ({
140
140
  id?: T_1["id"] | undefined;
141
141
  systemId?: string;
142
- input?: xstate0.InputFrom<T_1["logic"]> | undefined;
142
+ input?: xstate1211.InputFrom<T_1["logic"]> | undefined;
143
143
  syncSnapshot?: boolean;
144
- } & { [K_1 in xstate0.RequiredActorOptions<T_1>]: unknown }) | undefined], xstate0.IsNotNever<xstate0.RequiredActorOptions<T_1>>> : never : never : never)): xstate0.ActorRefFromLogic<xstate0.GetConcreteByKey<xstate0.Values<{
144
+ } & { [K_1 in xstate1211.RequiredActorOptions<T_1>]: unknown }) | undefined], xstate1211.IsNotNever<xstate1211.RequiredActorOptions<T_1>>> : never : never : never)): xstate1211.ActorRefFromLogic<xstate1211.GetConcreteByKey<xstate1211.Values<{
145
145
  fetchConsent: {
146
146
  src: "fetchConsent";
147
- logic: xstate0.PromiseActorLogic<FetchCombinedConsentResponse, {
147
+ logic: xstate1211.PromiseActorLogic<FetchCombinedConsentResponse, {
148
148
  consentId: string;
149
- }, xstate0.EventObject>;
149
+ }, xstate1211.EventObject>;
150
150
  id: string | undefined;
151
151
  };
152
152
  submitConsent: {
153
153
  src: "submitConsent";
154
- logic: xstate0.PromiseActorLogic<void, {
154
+ logic: xstate1211.PromiseActorLogic<void, {
155
155
  languageConsentId: string;
156
156
  checkboxes: ConsentCheckbox[];
157
- }, xstate0.EventObject>;
157
+ }, xstate1211.EventObject>;
158
158
  id: string | undefined;
159
159
  };
160
160
  }>, "src", TSrc>["logic"]>;
161
- <TLogic extends xstate0.AnyActorLogic>(src: TLogic, ...[options]: xstate0.ConditionalRequired<[options?: ({
161
+ <TLogic extends xstate1211.AnyActorLogic>(src: TLogic, ...[options]: xstate1211.ConditionalRequired<[options?: ({
162
162
  id?: never;
163
163
  systemId?: string;
164
- input?: xstate0.InputFrom<TLogic> | undefined;
164
+ input?: xstate1211.InputFrom<TLogic> | undefined;
165
165
  syncSnapshot?: boolean;
166
- } & { [K in xstate0.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate0.IsNotNever<xstate0.RequiredLogicInput<TLogic>>>): xstate0.ActorRefFromLogic<TLogic>;
166
+ } & { [K in xstate1211.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate1211.IsNotNever<xstate1211.RequiredLogicInput<TLogic>>>): xstate1211.ActorRefFromLogic<TLogic>;
167
167
  };
168
168
  input: ConsentInput;
169
- self: xstate0.ActorRef<xstate0.MachineSnapshot<ConsentContext, {
169
+ self: xstate1211.ActorRef<xstate1211.MachineSnapshot<ConsentContext, {
170
170
  type: "LOAD";
171
171
  } | {
172
172
  type: "TOGGLE_CHECKBOX";
@@ -177,7 +177,7 @@ declare const consentMachine: xstate0.StateMachine<ConsentContext, {
177
177
  type: "RETRY";
178
178
  } | {
179
179
  type: "RESET";
180
- }, Record<string, xstate0.AnyActorRef | undefined>, xstate0.StateValue, string, unknown, any, any>, {
180
+ }, Record<string, xstate1211.AnyActorRef | undefined>, xstate1211.StateValue, string, unknown, any, any>, {
181
181
  type: "LOAD";
182
182
  } | {
183
183
  type: "TOGGLE_CHECKBOX";
@@ -188,7 +188,7 @@ declare const consentMachine: xstate0.StateMachine<ConsentContext, {
188
188
  type: "RETRY";
189
189
  } | {
190
190
  type: "RESET";
191
- }, xstate0.AnyEventObject>;
191
+ }, xstate1211.AnyEventObject>;
192
192
  }) => {
193
193
  config: ConsentConfig;
194
194
  title: string;
@@ -226,7 +226,7 @@ declare const consentMachine: xstate0.StateMachine<ConsentContext, {
226
226
  } | {
227
227
  type: "RESET";
228
228
  };
229
- self: xstate0.ActorRef<xstate0.MachineSnapshot<ConsentContext, {
229
+ self: xstate1211.ActorRef<xstate1211.MachineSnapshot<ConsentContext, {
230
230
  type: "LOAD";
231
231
  } | {
232
232
  type: "TOGGLE_CHECKBOX";
@@ -237,7 +237,7 @@ declare const consentMachine: xstate0.StateMachine<ConsentContext, {
237
237
  type: "RETRY";
238
238
  } | {
239
239
  type: "RESET";
240
- }, Record<string, xstate0.AnyActorRef>, xstate0.StateValue, string, unknown, any, any>, {
240
+ }, Record<string, xstate1211.AnyActorRef>, xstate1211.StateValue, string, unknown, any, any>, {
241
241
  type: "LOAD";
242
242
  } | {
243
243
  type: "TOGGLE_CHECKBOX";
@@ -248,7 +248,7 @@ declare const consentMachine: xstate0.StateMachine<ConsentContext, {
248
248
  type: "RETRY";
249
249
  } | {
250
250
  type: "RESET";
251
- }, xstate0.AnyEventObject>;
251
+ }, xstate1211.AnyEventObject>;
252
252
  }) => {
253
253
  consentId: string;
254
254
  };
@@ -297,7 +297,7 @@ declare const consentMachine: xstate0.StateMachine<ConsentContext, {
297
297
  } | {
298
298
  type: "RESET";
299
299
  };
300
- self: xstate0.ActorRef<xstate0.MachineSnapshot<ConsentContext, {
300
+ self: xstate1211.ActorRef<xstate1211.MachineSnapshot<ConsentContext, {
301
301
  type: "LOAD";
302
302
  } | {
303
303
  type: "TOGGLE_CHECKBOX";
@@ -308,7 +308,7 @@ declare const consentMachine: xstate0.StateMachine<ConsentContext, {
308
308
  type: "RETRY";
309
309
  } | {
310
310
  type: "RESET";
311
- }, Record<string, xstate0.AnyActorRef>, xstate0.StateValue, string, unknown, any, any>, {
311
+ }, Record<string, xstate1211.AnyActorRef>, xstate1211.StateValue, string, unknown, any, any>, {
312
312
  type: "LOAD";
313
313
  } | {
314
314
  type: "TOGGLE_CHECKBOX";
@@ -319,7 +319,7 @@ declare const consentMachine: xstate0.StateMachine<ConsentContext, {
319
319
  type: "RETRY";
320
320
  } | {
321
321
  type: "RESET";
322
- }, xstate0.AnyEventObject>;
322
+ }, xstate1211.AnyEventObject>;
323
323
  }) => {
324
324
  languageConsentId: string;
325
325
  checkboxes: ConsentCheckbox[];
package/dist/cpf-ocr.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { t as Manager } from "./Manager-C8PrhBOx.js";
2
- import * as xstate67 from "xstate";
2
+ import * as xstate1279 from "xstate";
3
3
 
4
4
  //#region src/modules/cpf-ocr/cpfOcrManager.d.ts
5
5
  type CpfOcrIdleState = {
@@ -47,7 +47,7 @@ type CpfOcrContext = {
47
47
  error: string | undefined;
48
48
  };
49
49
  type CpfOcrInput = Record<string, never>;
50
- declare const cpfOcrMachine: xstate67.StateMachine<CpfOcrContext, {
50
+ declare const cpfOcrMachine: xstate1279.StateMachine<CpfOcrContext, {
51
51
  type: "LOAD";
52
52
  } | {
53
53
  type: "SET_CPF";
@@ -57,43 +57,43 @@ declare const cpfOcrMachine: xstate67.StateMachine<CpfOcrContext, {
57
57
  } | {
58
58
  type: "RETRY";
59
59
  }, {
60
- [x: string]: xstate67.ActorRefFromLogic<xstate67.PromiseActorLogic<CpfOcrDataResponse, void, xstate67.EventObject>> | xstate67.ActorRefFromLogic<xstate67.PromiseActorLogic<CpfOcrUpdateResponse, {
60
+ [x: string]: xstate1279.ActorRefFromLogic<xstate1279.PromiseActorLogic<CpfOcrDataResponse, void, xstate1279.EventObject>> | xstate1279.ActorRefFromLogic<xstate1279.PromiseActorLogic<CpfOcrUpdateResponse, {
61
61
  cpf: string;
62
- }, xstate67.EventObject>> | undefined;
63
- }, xstate67.Values<{
62
+ }, xstate1279.EventObject>> | undefined;
63
+ }, xstate1279.Values<{
64
64
  fetchCpfOcrData: {
65
65
  src: "fetchCpfOcrData";
66
- logic: xstate67.PromiseActorLogic<CpfOcrDataResponse, void, xstate67.EventObject>;
66
+ logic: xstate1279.PromiseActorLogic<CpfOcrDataResponse, void, xstate1279.EventObject>;
67
67
  id: string | undefined;
68
68
  };
69
69
  submitCpfOcr: {
70
70
  src: "submitCpfOcr";
71
- logic: xstate67.PromiseActorLogic<CpfOcrUpdateResponse, {
71
+ logic: xstate1279.PromiseActorLogic<CpfOcrUpdateResponse, {
72
72
  cpf: string;
73
- }, xstate67.EventObject>;
73
+ }, xstate1279.EventObject>;
74
74
  id: string | undefined;
75
75
  };
76
- }>, xstate67.Values<{
76
+ }>, xstate1279.Values<{
77
77
  setError: {
78
78
  type: "setError";
79
- params: xstate67.NonReducibleUnknown;
79
+ params: xstate1279.NonReducibleUnknown;
80
80
  };
81
81
  clearError: {
82
82
  type: "clearError";
83
- params: xstate67.NonReducibleUnknown;
83
+ params: xstate1279.NonReducibleUnknown;
84
84
  };
85
85
  setPrefill: {
86
86
  type: "setPrefill";
87
- params: xstate67.NonReducibleUnknown;
87
+ params: xstate1279.NonReducibleUnknown;
88
88
  };
89
89
  setCpf: {
90
90
  type: "setCpf";
91
- params: xstate67.NonReducibleUnknown;
91
+ params: xstate1279.NonReducibleUnknown;
92
92
  };
93
93
  }>, {
94
94
  type: "isValid";
95
95
  params: unknown;
96
- }, never, "error" | "idle" | "finished" | "loading" | "submitting" | "inputting", string, CpfOcrInput, xstate67.NonReducibleUnknown, xstate67.EventObject, xstate67.MetaObject, {
96
+ }, never, "error" | "idle" | "finished" | "loading" | "submitting" | "inputting", string, CpfOcrInput, xstate1279.NonReducibleUnknown, xstate1279.EventObject, xstate1279.MetaObject, {
97
97
  readonly id: "cpfOcr";
98
98
  readonly initial: "idle";
99
99
  readonly context: {
@@ -148,7 +148,7 @@ declare const cpfOcrMachine: xstate67.StateMachine<CpfOcrContext, {
148
148
  } | {
149
149
  type: "RETRY";
150
150
  };
151
- self: xstate67.ActorRef<xstate67.MachineSnapshot<CpfOcrContext, {
151
+ self: xstate1279.ActorRef<xstate1279.MachineSnapshot<CpfOcrContext, {
152
152
  type: "LOAD";
153
153
  } | {
154
154
  type: "SET_CPF";
@@ -157,7 +157,7 @@ declare const cpfOcrMachine: xstate67.StateMachine<CpfOcrContext, {
157
157
  type: "SUBMIT";
158
158
  } | {
159
159
  type: "RETRY";
160
- }, Record<string, xstate67.AnyActorRef>, xstate67.StateValue, string, unknown, any, any>, {
160
+ }, Record<string, xstate1279.AnyActorRef>, xstate1279.StateValue, string, unknown, any, any>, {
161
161
  type: "LOAD";
162
162
  } | {
163
163
  type: "SET_CPF";
@@ -166,7 +166,7 @@ declare const cpfOcrMachine: xstate67.StateMachine<CpfOcrContext, {
166
166
  type: "SUBMIT";
167
167
  } | {
168
168
  type: "RETRY";
169
- }, xstate67.AnyEventObject>;
169
+ }, xstate1279.AnyEventObject>;
170
170
  }) => {
171
171
  cpf: string;
172
172
  };
@@ -21,13 +21,46 @@ type GenerateCurpForm = {
21
21
  birthState: string;
22
22
  };
23
23
  type GenerateCurpFieldType = 'text' | 'date' | 'dropdown';
24
+ /**
25
+ * Discriminated union of validation rules supported across both CURP screens.
26
+ * `required` is used by Generate-CURP fields; `curpFormat` is used by the
27
+ * single-field CURP entry.
28
+ */
29
+ type CurpValidationRule = {
30
+ type: 'required';
31
+ } | {
32
+ type: 'curpFormat';
33
+ };
24
34
  type GenerateCurpFieldDef = {
25
35
  key: keyof GenerateCurpForm;
26
36
  labelKey: string;
27
37
  type: GenerateCurpFieldType;
28
38
  required: boolean;
29
39
  autoComplete?: string;
40
+ /**
41
+ * Validation rules evaluated by the state machine on blur (per-field) and
42
+ * on submit (full form). Required fields should include `{ type: 'required' }`.
43
+ * Optional fields (e.g. `secondLastName`) omit this entirely.
44
+ */
45
+ validation?: CurpValidationRule[];
46
+ };
47
+ /**
48
+ * Configuration for the single CURP-entry field on the gateway screen.
49
+ * Intentionally has no `required` rule: the user can leave it empty and
50
+ * use the "I don't have my CURP" escape-hatch button instead.
51
+ */
52
+ type EnterCurpFieldDef = {
53
+ key: 'curp';
54
+ labelKey: string;
55
+ validation?: CurpValidationRule[];
30
56
  };
57
+ /**
58
+ * Map of field-key → i18n error key currently displayed for that field.
59
+ * Empty/undefined means no errors are currently shown. The state machine
60
+ * is the single source of truth for which entries exist here — UI must
61
+ * render this map as-is without further gating.
62
+ */
63
+ type CurpValidationErrors = Partial<Record<string, string>>;
31
64
  //#endregion
32
65
  //#region src/modules/curp-validation/curpValidationStateMachine.d.ts
33
66
 
@@ -45,10 +78,21 @@ type CurpValidationIdleState = {
45
78
  type CurpValidationLoadingState = {
46
79
  status: 'loading';
47
80
  };
81
+ /**
82
+ * State exposed to UI for the CURP entry gateway screen.
83
+ *
84
+ * `isValid` is **derived** from `validationErrors`: it is `true` whenever
85
+ * no errors are currently displayed (including the initial empty render).
86
+ * The UI must not treat `isValid` as "the form would pass full validation
87
+ * right now" — that was the old pessimistic semantic. Use the absence of
88
+ * errors plus an additional `curp.length === 0` no-op guard on the submit
89
+ * button instead.
90
+ */
48
91
  type CurpValidationEnterCurpState = {
49
92
  status: 'enterCurp';
50
93
  curp: string;
51
94
  isValid: boolean;
95
+ validationErrors?: CurpValidationErrors;
52
96
  };
53
97
  type CurpValidationVerifyingState = {
54
98
  status: 'verifying';
@@ -60,10 +104,19 @@ type CurpValidationFailureState = {
60
104
  status: 'failure';
61
105
  retriesLeft: number;
62
106
  };
107
+ /**
108
+ * State exposed to UI for the multi-field Generate CURP form.
109
+ *
110
+ * `isValid` is derived: `true` when no errors are currently displayed.
111
+ * Validation runs on blur (single field) and on submit (full form);
112
+ * `validationErrors` reflects exactly what should be rendered next
113
+ * to each input.
114
+ */
63
115
  type CurpValidationGenerateCurpState = {
64
116
  status: 'generateCurp';
65
117
  form: GenerateCurpForm;
66
118
  isValid: boolean;
119
+ validationErrors?: CurpValidationErrors;
67
120
  };
68
121
  type CurpValidationGeneratingState = {
69
122
  status: 'generating';
@@ -86,6 +139,13 @@ type CurpValidationState = CurpValidationIdleState | CurpValidationLoadingState
86
139
  declare function createCurpValidationManager(options: CreateCurpValidationActorOptions): Manager<CurpValidationState> & {
87
140
  load(): void;
88
141
  setCurp(curp: string): void;
142
+ /**
143
+ * Triggers single-field on-blur validation. The state machine routes
144
+ * the event to the validator for the currently active screen and
145
+ * updates the corresponding `validationErrors` map. Sending a field
146
+ * key that does not belong to the active screen is a no-op.
147
+ */
148
+ validateField(field: "curp" | keyof GenerateCurpForm): void;
89
149
  verify(): void;
90
150
  switchToGenerate(): void;
91
151
  setGenerateForm(form: Partial<GenerateCurpForm>): void;
@@ -108,8 +168,21 @@ declare const mexicanStates: MexicanState[];
108
168
  * Declarative schema for the CURP generation form.
109
169
  *
110
170
  * `secondLastName` is intentionally optional: many people in Mexico have
111
- * only a single paternal surname.
171
+ * only a single paternal surname. It carries no validation rules.
112
172
  */
113
173
  declare const GENERATE_CURP_FIELDS: GenerateCurpFieldDef[];
174
+ /**
175
+ * Config for the single field on the CURP entry gateway screen.
176
+ *
177
+ * Validation contains only `curpFormat` — there is intentionally no
178
+ * `required` rule. The user can legitimately leave this field empty
179
+ * and use the "I don't have my CURP" button to switch to the Generate
180
+ * flow; surfacing a "required" error on blur of an empty field would
181
+ * be misleading.
182
+ *
183
+ * The Continue button on this screen is gated by a UI-level no-op guard
184
+ * (`curp.length === 0`) instead, which lives in `curpInput.tsx`.
185
+ */
186
+ declare const ENTER_CURP_FIELD: EnterCurpFieldDef;
114
187
  //#endregion
115
- export { type CurpValidationConfig, type CurpValidationManager, type CurpValidationState, GENERATE_CURP_FIELDS, type GenerateCurpFieldDef, type GenerateCurpFieldType, type GenerateCurpForm, createCurpValidationManager, curpValidationMachine, mexicanStates };
188
+ export { type CurpValidationConfig, type CurpValidationErrors, type CurpValidationManager, type CurpValidationRule, type CurpValidationState, ENTER_CURP_FIELD, type EnterCurpFieldDef, GENERATE_CURP_FIELDS, type GenerateCurpFieldDef, type GenerateCurpFieldType, type GenerateCurpForm, createCurpValidationManager, curpValidationMachine, mexicanStates };
@@ -2,7 +2,7 @@ import "./api-CESGtpbH.esm.js";
2
2
  import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-D6-e4vok.esm.js";
3
3
  import "./endpoints-CnN3SyDa.esm.js";
4
4
  import { c as createManager, s as createActor } from "./xstate.esm-B70JrNqo.esm.js";
5
- import { n as mexicanStates, r as GENERATE_CURP_FIELDS, t as curpValidationMachine } from "./curpValidationStateMachine-BN9UT3zL.esm.js";
5
+ import { i as mexicanStates, n as ENTER_CURP_FIELD, r as GENERATE_CURP_FIELDS, t as curpValidationMachine } from "./curpValidationStateMachine-CitWLr2c.esm.js";
6
6
 
7
7
  //#region src/modules/curp-validation/curpValidationActor.ts
8
8
  function createCurpValidationActor(options) {
@@ -11,6 +11,7 @@ function createCurpValidationActor(options) {
11
11
 
12
12
  //#endregion
13
13
  //#region src/modules/curp-validation/curpValidationManager.ts
14
+ const hasNoErrors = (errors) => Object.keys(errors ?? {}).length === 0;
14
15
  function mapState(snapshot) {
15
16
  const typedSnapshot = snapshot;
16
17
  const { context } = typedSnapshot;
@@ -19,7 +20,8 @@ function mapState(snapshot) {
19
20
  if (typedSnapshot.matches("enterCurp")) return {
20
21
  status: "enterCurp",
21
22
  curp: context.curp,
22
- isValid: context.isValid
23
+ isValid: hasNoErrors(context.enterCurpValidationErrors),
24
+ validationErrors: context.enterCurpValidationErrors
23
25
  };
24
26
  if (typedSnapshot.matches("verifying")) return { status: "verifying" };
25
27
  if (typedSnapshot.matches("success")) return { status: "success" };
@@ -30,7 +32,8 @@ function mapState(snapshot) {
30
32
  if (typedSnapshot.matches("generateCurp")) return {
31
33
  status: "generateCurp",
32
34
  form: context.generateForm,
33
- isValid: context.isGenerateFormValid
35
+ isValid: hasNoErrors(context.generateCurpValidationErrors),
36
+ validationErrors: context.generateCurpValidationErrors
34
37
  };
35
38
  if (typedSnapshot.matches("generating")) return { status: "generating" };
36
39
  if (typedSnapshot.matches("confirmCurp")) return {
@@ -56,6 +59,12 @@ function createApi({ actor, trackElementClicked }) {
56
59
  curp
57
60
  });
58
61
  },
62
+ validateField(field) {
63
+ actor.send({
64
+ type: "VALIDATE_FIELD",
65
+ field
66
+ });
67
+ },
59
68
  verify() {
60
69
  trackElementClicked?.("verify");
61
70
  actor.send({ type: "VERIFY" });
@@ -98,4 +107,4 @@ function createCurpValidationManager(options) {
98
107
  }
99
108
 
100
109
  //#endregion
101
- export { GENERATE_CURP_FIELDS, createCurpValidationManager, curpValidationMachine, mexicanStates };
110
+ export { ENTER_CURP_FIELD, GENERATE_CURP_FIELDS, createCurpValidationManager, curpValidationMachine, mexicanStates };