@incodetech/core 0.0.0-dev-20260402-7cf9db4 → 0.0.0-dev-20260402-0dc2fb9

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 (39) hide show
  1. package/dist/{Manager-D_DMzMWz.esm.js → Manager-B-qS9P9T.esm.js} +1 -1
  2. package/dist/{StreamCanvasCapture-9VAzOfOv.esm.js → StreamCanvasCapture-BowJVbkC.esm.js} +1 -1
  3. package/dist/{addressSearch-CYGzuJJ3.esm.js → addressSearch-CmmLAvRi.esm.js} +2 -2
  4. package/dist/authentication.esm.js +5 -5
  5. package/dist/{authenticationManager-C9iQ1d2a.esm.js → authenticationManager-BzsB0zC8.esm.js} +4 -4
  6. package/dist/consent.d.ts +53 -53
  7. package/dist/consent.esm.js +2 -2
  8. package/dist/curp-validation.esm.js +2 -2
  9. package/dist/document-capture.d.ts +348 -79
  10. package/dist/document-capture.esm.js +170 -45
  11. package/dist/document-upload.d.ts +49 -49
  12. package/dist/document-upload.esm.js +2 -2
  13. package/dist/ekyb.esm.js +5 -5
  14. package/dist/ekyc.esm.js +3 -3
  15. package/dist/email.esm.js +3 -3
  16. package/dist/{emailManager-C5GCSw78.esm.js → emailManager-E3Cr6KIG.esm.js} +2 -2
  17. package/dist/{endpoints-CCuj1KZH.esm.js → endpoints-DEXxYYFi.esm.js} +1 -0
  18. package/dist/extensibility.esm.js +10 -17
  19. package/dist/face-match.esm.js +2 -2
  20. package/dist/{faceCaptureSetup-DYRykM5Y.esm.js → faceCaptureSetup-Bc7QPf-C.esm.js} +3 -3
  21. package/dist/flow.esm.js +5 -5
  22. package/dist/{flowCompletionService-CBvXiMKa.esm.js → flowCompletionService-CUT-cibE.esm.js} +1 -1
  23. package/dist/{flowServices-CQ3rTJLE.esm.js → flowServices-GUqxIdRY.esm.js} +2 -2
  24. package/dist/geolocation.esm.js +2 -2
  25. package/dist/government-validation.esm.js +2 -2
  26. package/dist/id.esm.js +5 -5
  27. package/dist/{idCaptureManager-D5rjCu9r.esm.js → idCaptureManager-1x6DxWdp.esm.js} +4 -4
  28. package/dist/index.esm.js +5 -5
  29. package/dist/mandatory-consent.d.ts +47 -47
  30. package/dist/mandatory-consent.esm.js +2 -2
  31. package/dist/phone.esm.js +3 -3
  32. package/dist/{phoneManager-CQJim-Ky.esm.js → phoneManager-B0ZiIWOO.esm.js} +2 -2
  33. package/dist/redirect-to-mobile.esm.js +2 -2
  34. package/dist/selfie.esm.js +5 -5
  35. package/dist/{selfieManager-DYW1C2GP.esm.js → selfieManager-CtfKnz4C.esm.js} +3 -3
  36. package/dist/{session-TBPhHmyy.esm.js → session-CIxnj9Wm.esm.js} +10 -3
  37. package/dist/session.esm.js +2 -2
  38. package/dist/signature.esm.js +2 -2
  39. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  import "./Actor-phIcsUhv.js";
2
2
  import { t as CameraStream } from "./camera-Dv2WEhGe.js";
3
3
  import { t as Manager } from "./Manager-BndLda4_.js";
4
- import * as xstate67 from "xstate";
4
+ import * as xstate131 from "xstate";
5
5
 
6
6
  //#region src/modules/document-capture/types.d.ts
7
7
  type DocumentType = 'addressStatement' | 'otherDocument1' | 'otherDocument2' | 'otherDocument3' | 'v5cMultiPageLogbook' | 'circulationCard' | 'financeSettlement' | 'carInvoice' | 'capture' | 'processPoaOcr' | 'processLoaOcr' | 'processAsylumSeekerVisaZaf' | 'processBankStatementOCR' | 'processBankCheck' | 'processV5CLogbook' | 'processCarInvoice' | 'processCirculationCard' | 'processFinanceSettlement';
@@ -9,7 +9,11 @@ declare const DOCUMENT_CAPTURE_ERROR_CODES: {
9
9
  readonly FILE_TOO_LARGE: "FILE_TOO_LARGE";
10
10
  readonly UPLOAD_FAILED: "UPLOAD_FAILED";
11
11
  };
12
+ declare const DOCUMENT_CAPTURE_FINALIZE_ERROR_CODES: {
13
+ readonly UNEXPECTED_ERROR: "UNEXPECTED_ERROR";
14
+ };
12
15
  type DocumentCaptureErrorCode = (typeof DOCUMENT_CAPTURE_ERROR_CODES)[keyof typeof DOCUMENT_CAPTURE_ERROR_CODES];
16
+ type DocumentCaptureFinalizeErrorCode = (typeof DOCUMENT_CAPTURE_FINALIZE_ERROR_CODES)[keyof typeof DOCUMENT_CAPTURE_FINALIZE_ERROR_CODES];
13
17
  /**
14
18
  * Configuration for the document capture module.
15
19
  * Parameterized to support both DOCUMENT_CAPTURE and ADDRESS flows.
@@ -43,7 +47,11 @@ type CapturedDocument = {
43
47
  };
44
48
  type DocumentUploadResponse = {
45
49
  success: boolean;
46
- status?: 'ADD_NEXT_PAGE' | 'SUCCESS';
50
+ status?: 'ADD_NEXT_PAGE' | 'OPTIONAL_PAGE_CAPTURE' | 'SUCCESS';
51
+ };
52
+ type FinalizeDocumentResponse = {
53
+ status?: string;
54
+ success?: boolean;
47
55
  };
48
56
  type DocumentCaptureResolvedConfig = {
49
57
  processingType: DocumentType;
@@ -57,23 +65,24 @@ type DocumentCaptureResolvedConfig = {
57
65
  step2Title: string | undefined;
58
66
  step2Text: string | undefined;
59
67
  };
68
+ type DocumentCaptureNextPageType = 'none' | 'required' | 'optional';
60
69
  type DocumentCaptureContext = {
61
70
  config: DocumentCaptureResolvedConfig;
62
71
  stream: CameraStream | undefined;
63
72
  capturedDocument: CapturedDocument | undefined;
64
- captureMethod: 'camera' | 'file' | undefined;
73
+ captureMethod: 'camera' | 'file' | 'gallery' | undefined;
65
74
  progress: number;
66
- error: DocumentCaptureErrorCode | undefined;
75
+ error: DocumentCaptureErrorCode | DocumentCaptureFinalizeErrorCode | undefined;
67
76
  attemptsRemaining: number;
68
77
  pageNumber: number;
69
- pendingNextPage: boolean;
78
+ nextPageType: DocumentCaptureNextPageType;
70
79
  };
71
80
  type DocumentCaptureInput = {
72
81
  config: DocumentCaptureConfig;
73
82
  };
74
83
  //#endregion
75
84
  //#region src/modules/document-capture/documentCaptureStateMachine.d.ts
76
- declare const documentCaptureMachine: xstate67.StateMachine<DocumentCaptureContext, {
85
+ declare const documentCaptureMachine: xstate131.StateMachine<DocumentCaptureContext, {
77
86
  type: "CAPTURE";
78
87
  } | {
79
88
  type: "FILE_SELECTED";
@@ -91,89 +100,116 @@ declare const documentCaptureMachine: xstate67.StateMachine<DocumentCaptureConte
91
100
  type: "RETRY";
92
101
  } | {
93
102
  type: "CONTINUE";
103
+ } | {
104
+ type: "NEXT_PAGE_CAMERA";
105
+ } | {
106
+ type: "NEXT_PAGE_PHOTO_LIBRARY";
107
+ } | {
108
+ type: "ALL_PAGES_CAPTURED";
94
109
  } | {
95
110
  type: "SKIP";
96
111
  } | {
97
112
  type: "CLOSE";
98
113
  }, {
99
- [x: string]: xstate67.ActorRefFromLogic<xstate67.PromiseActorLogic<MediaStream, void, xstate67.EventObject>> | xstate67.ActorRefFromLogic<xstate67.PromiseActorLogic<DocumentUploadResponse, {
114
+ [x: string]: xstate131.ActorRefFromLogic<xstate131.PromiseActorLogic<MediaStream, void, xstate131.EventObject>> | xstate131.ActorRefFromLogic<xstate131.PromiseActorLogic<DocumentUploadResponse, {
100
115
  capturedDocument: NonNullable<DocumentCaptureContext["capturedDocument"]>;
101
116
  processingType: string;
102
117
  onProgress: (progress: number) => void;
103
- }, xstate67.EventObject>> | undefined;
104
- }, xstate67.Values<{
118
+ }, xstate131.EventObject>> | xstate131.ActorRefFromLogic<xstate131.PromiseActorLogic<FinalizeDocumentResponse, {
119
+ processingType: string;
120
+ }, xstate131.EventObject>> | undefined;
121
+ }, xstate131.Values<{
105
122
  initCamera: {
106
123
  src: "initCamera";
107
- logic: xstate67.PromiseActorLogic<MediaStream, void, xstate67.EventObject>;
124
+ logic: xstate131.PromiseActorLogic<MediaStream, void, xstate131.EventObject>;
108
125
  id: string | undefined;
109
126
  };
110
127
  uploadDocument: {
111
128
  src: "uploadDocument";
112
- logic: xstate67.PromiseActorLogic<DocumentUploadResponse, {
129
+ logic: xstate131.PromiseActorLogic<DocumentUploadResponse, {
113
130
  capturedDocument: NonNullable<DocumentCaptureContext["capturedDocument"]>;
114
131
  processingType: string;
115
132
  onProgress: (progress: number) => void;
116
- }, xstate67.EventObject>;
133
+ }, xstate131.EventObject>;
117
134
  id: string | undefined;
118
135
  };
119
- }>, xstate67.Values<{
120
- clearError: {
121
- type: "clearError";
122
- params: xstate67.NonReducibleUnknown;
136
+ finalizeDocumentRequest: {
137
+ src: "finalizeDocumentRequest";
138
+ logic: xstate131.PromiseActorLogic<FinalizeDocumentResponse, {
139
+ processingType: string;
140
+ }, xstate131.EventObject>;
141
+ id: string | undefined;
123
142
  };
143
+ }>, xstate131.Values<{
124
144
  setStream: {
125
145
  type: "setStream";
126
- params: xstate67.NonReducibleUnknown;
146
+ params: xstate131.NonReducibleUnknown;
147
+ };
148
+ setProgress: {
149
+ type: "setProgress";
150
+ params: xstate131.NonReducibleUnknown;
151
+ };
152
+ clearError: {
153
+ type: "clearError";
154
+ params: xstate131.NonReducibleUnknown;
155
+ };
156
+ stopStream: {
157
+ type: "stopStream";
158
+ params: xstate131.NonReducibleUnknown;
127
159
  };
128
160
  setCapturedDocument: {
129
161
  type: "setCapturedDocument";
130
- params: xstate67.NonReducibleUnknown;
162
+ params: xstate131.NonReducibleUnknown;
131
163
  };
132
164
  setFileTooLargeError: {
133
165
  type: "setFileTooLargeError";
134
- params: xstate67.NonReducibleUnknown;
135
- };
136
- setProgress: {
137
- type: "setProgress";
138
- params: xstate67.NonReducibleUnknown;
166
+ params: xstate131.NonReducibleUnknown;
139
167
  };
140
168
  setUploadError: {
141
169
  type: "setUploadError";
142
- params: xstate67.NonReducibleUnknown;
170
+ params: xstate131.NonReducibleUnknown;
171
+ };
172
+ setFinalizeError: {
173
+ type: "setFinalizeError";
174
+ params: xstate131.NonReducibleUnknown;
143
175
  };
144
176
  decrementAttemptsRemaining: {
145
177
  type: "decrementAttemptsRemaining";
146
- params: xstate67.NonReducibleUnknown;
178
+ params: xstate131.NonReducibleUnknown;
147
179
  };
148
180
  setCaptureMethodFile: {
149
181
  type: "setCaptureMethodFile";
150
- params: xstate67.NonReducibleUnknown;
182
+ params: xstate131.NonReducibleUnknown;
151
183
  };
152
184
  setCaptureMethodCamera: {
153
185
  type: "setCaptureMethodCamera";
154
- params: xstate67.NonReducibleUnknown;
186
+ params: xstate131.NonReducibleUnknown;
187
+ };
188
+ setCaptureMethodGallery: {
189
+ type: "setCaptureMethodGallery";
190
+ params: xstate131.NonReducibleUnknown;
155
191
  };
156
192
  clearCapturedDocument: {
157
193
  type: "clearCapturedDocument";
158
- params: xstate67.NonReducibleUnknown;
194
+ params: xstate131.NonReducibleUnknown;
195
+ };
196
+ clearCapturedDocumentGalleryRetake: {
197
+ type: "clearCapturedDocumentGalleryRetake";
198
+ params: xstate131.NonReducibleUnknown;
159
199
  };
160
- setPendingNextPage: {
161
- type: "setPendingNextPage";
162
- params: xstate67.NonReducibleUnknown;
200
+ setNextPageType: {
201
+ type: "setNextPageType";
202
+ params: xstate131.NonReducibleUnknown;
163
203
  };
164
204
  clearForNextPage: {
165
205
  type: "clearForNextPage";
166
- params: xstate67.NonReducibleUnknown;
206
+ params: xstate131.NonReducibleUnknown;
167
207
  };
168
208
  resetProgress: {
169
209
  type: "resetProgress";
170
- params: xstate67.NonReducibleUnknown;
171
- };
172
- stopStream: {
173
- type: "stopStream";
174
- params: xstate67.NonReducibleUnknown;
210
+ params: xstate131.NonReducibleUnknown;
175
211
  };
176
- }>, xstate67.Values<{
212
+ }>, xstate131.Values<{
177
213
  allowSkip: {
178
214
  type: "allowSkip";
179
215
  params: unknown;
@@ -182,10 +218,6 @@ declare const documentCaptureMachine: xstate67.StateMachine<DocumentCaptureConte
182
218
  type: "fileSizeOk";
183
219
  params: unknown;
184
220
  };
185
- hasAttemptsRemaining: {
186
- type: "hasAttemptsRemaining";
187
- params: unknown;
188
- };
189
221
  canRetryCamera: {
190
222
  type: "canRetryCamera";
191
223
  params: unknown;
@@ -202,84 +234,134 @@ declare const documentCaptureMachine: xstate67.StateMachine<DocumentCaptureConte
202
234
  type: "isCameraMode";
203
235
  params: unknown;
204
236
  };
237
+ isCaptureMethodCamera: {
238
+ type: "isCaptureMethodCamera";
239
+ params: unknown;
240
+ };
241
+ isCaptureMethodGallery: {
242
+ type: "isCaptureMethodGallery";
243
+ params: unknown;
244
+ };
205
245
  isCaptureMethodFile: {
206
246
  type: "isCaptureMethodFile";
207
247
  params: unknown;
208
248
  };
209
- isPendingNextPage: {
210
- type: "isPendingNextPage";
249
+ isNextPageOptional: {
250
+ type: "isNextPageOptional";
211
251
  params: unknown;
212
252
  };
213
- }>, never, "finished" | "initCamera" | "tutorial" | "capturing" | "preview" | "closed" | "failure" | "uploading" | "success", string, DocumentCaptureInput, xstate67.NonReducibleUnknown, xstate67.EventObject, xstate67.MetaObject, {
253
+ isNextPageRequired: {
254
+ type: "isNextPageRequired";
255
+ params: unknown;
256
+ };
257
+ canFinalizeOptionalPages: {
258
+ type: "canFinalizeOptionalPages";
259
+ params: unknown;
260
+ };
261
+ fileSizeOkForGallery: {
262
+ type: "fileSizeOkForGallery";
263
+ params: unknown;
264
+ };
265
+ fileSizeOkForNonGallery: {
266
+ type: "fileSizeOkForNonGallery";
267
+ params: unknown;
268
+ };
269
+ }>, never, "initCamera" | "capturing" | "closed" | "uploading" | "finished" | "tutorial" | "preview" | "failure" | "success" | "nextPage" | "finalizing", string, DocumentCaptureInput, xstate131.NonReducibleUnknown, xstate131.EventObject, xstate131.MetaObject, {
214
270
  readonly id: "documentCapture";
215
271
  readonly initial: "tutorial";
216
272
  readonly context: ({
217
273
  input
218
274
  }: {
219
275
  spawn: {
220
- <TSrc extends "initCamera" | "uploadDocument">(logic: TSrc, ...[options]: ({
276
+ <TSrc extends "initCamera" | "uploadDocument" | "finalizeDocumentRequest">(logic: TSrc, ...[options]: ({
221
277
  src: "initCamera";
222
- logic: xstate67.PromiseActorLogic<MediaStream, void, xstate67.EventObject>;
278
+ logic: xstate131.PromiseActorLogic<MediaStream, void, xstate131.EventObject>;
223
279
  id: string | undefined;
224
280
  } extends infer T ? T extends {
225
281
  src: "initCamera";
226
- logic: xstate67.PromiseActorLogic<MediaStream, void, xstate67.EventObject>;
282
+ logic: xstate131.PromiseActorLogic<MediaStream, void, xstate131.EventObject>;
227
283
  id: string | undefined;
228
284
  } ? T extends {
229
285
  src: TSrc;
230
- } ? xstate67.ConditionalRequired<[options?: ({
286
+ } ? xstate131.ConditionalRequired<[options?: ({
231
287
  id?: T["id"] | undefined;
232
288
  systemId?: string;
233
- input?: xstate67.InputFrom<T["logic"]> | undefined;
289
+ input?: xstate131.InputFrom<T["logic"]> | undefined;
234
290
  syncSnapshot?: boolean;
235
- } & { [K in xstate67.RequiredActorOptions<T>]: unknown }) | undefined], xstate67.IsNotNever<xstate67.RequiredActorOptions<T>>> : never : never : never) | ({
291
+ } & { [K in xstate131.RequiredActorOptions<T>]: unknown }) | undefined], xstate131.IsNotNever<xstate131.RequiredActorOptions<T>>> : never : never : never) | ({
236
292
  src: "uploadDocument";
237
- logic: xstate67.PromiseActorLogic<DocumentUploadResponse, {
293
+ logic: xstate131.PromiseActorLogic<DocumentUploadResponse, {
238
294
  capturedDocument: NonNullable<DocumentCaptureContext["capturedDocument"]>;
239
295
  processingType: string;
240
296
  onProgress: (progress: number) => void;
241
- }, xstate67.EventObject>;
297
+ }, xstate131.EventObject>;
242
298
  id: string | undefined;
243
299
  } extends infer T_1 ? T_1 extends {
244
300
  src: "uploadDocument";
245
- logic: xstate67.PromiseActorLogic<DocumentUploadResponse, {
301
+ logic: xstate131.PromiseActorLogic<DocumentUploadResponse, {
246
302
  capturedDocument: NonNullable<DocumentCaptureContext["capturedDocument"]>;
247
303
  processingType: string;
248
304
  onProgress: (progress: number) => void;
249
- }, xstate67.EventObject>;
305
+ }, xstate131.EventObject>;
250
306
  id: string | undefined;
251
307
  } ? T_1 extends {
252
308
  src: TSrc;
253
- } ? xstate67.ConditionalRequired<[options?: ({
309
+ } ? xstate131.ConditionalRequired<[options?: ({
254
310
  id?: T_1["id"] | undefined;
255
311
  systemId?: string;
256
- input?: xstate67.InputFrom<T_1["logic"]> | undefined;
312
+ input?: xstate131.InputFrom<T_1["logic"]> | undefined;
313
+ syncSnapshot?: boolean;
314
+ } & { [K_1 in xstate131.RequiredActorOptions<T_1>]: unknown }) | undefined], xstate131.IsNotNever<xstate131.RequiredActorOptions<T_1>>> : never : never : never) | ({
315
+ src: "finalizeDocumentRequest";
316
+ logic: xstate131.PromiseActorLogic<FinalizeDocumentResponse, {
317
+ processingType: string;
318
+ }, xstate131.EventObject>;
319
+ id: string | undefined;
320
+ } extends infer T_2 ? T_2 extends {
321
+ src: "finalizeDocumentRequest";
322
+ logic: xstate131.PromiseActorLogic<FinalizeDocumentResponse, {
323
+ processingType: string;
324
+ }, xstate131.EventObject>;
325
+ id: string | undefined;
326
+ } ? T_2 extends {
327
+ src: TSrc;
328
+ } ? xstate131.ConditionalRequired<[options?: ({
329
+ id?: T_2["id"] | undefined;
330
+ systemId?: string;
331
+ input?: xstate131.InputFrom<T_2["logic"]> | undefined;
257
332
  syncSnapshot?: boolean;
258
- } & { [K_1 in xstate67.RequiredActorOptions<T_1>]: unknown }) | undefined], xstate67.IsNotNever<xstate67.RequiredActorOptions<T_1>>> : never : never : never)): xstate67.ActorRefFromLogic<xstate67.GetConcreteByKey<xstate67.Values<{
333
+ } & { [K_2 in xstate131.RequiredActorOptions<T_2>]: unknown }) | undefined], xstate131.IsNotNever<xstate131.RequiredActorOptions<T_2>>> : never : never : never)): xstate131.ActorRefFromLogic<xstate131.GetConcreteByKey<xstate131.Values<{
259
334
  initCamera: {
260
335
  src: "initCamera";
261
- logic: xstate67.PromiseActorLogic<MediaStream, void, xstate67.EventObject>;
336
+ logic: xstate131.PromiseActorLogic<MediaStream, void, xstate131.EventObject>;
262
337
  id: string | undefined;
263
338
  };
264
339
  uploadDocument: {
265
340
  src: "uploadDocument";
266
- logic: xstate67.PromiseActorLogic<DocumentUploadResponse, {
341
+ logic: xstate131.PromiseActorLogic<DocumentUploadResponse, {
267
342
  capturedDocument: NonNullable<DocumentCaptureContext["capturedDocument"]>;
268
343
  processingType: string;
269
344
  onProgress: (progress: number) => void;
270
- }, xstate67.EventObject>;
345
+ }, xstate131.EventObject>;
346
+ id: string | undefined;
347
+ };
348
+ finalizeDocumentRequest: {
349
+ src: "finalizeDocumentRequest";
350
+ logic: xstate131.PromiseActorLogic<FinalizeDocumentResponse, {
351
+ processingType: string;
352
+ }, xstate131.EventObject>;
271
353
  id: string | undefined;
272
354
  };
273
355
  }>, "src", TSrc>["logic"]>;
274
- <TLogic extends xstate67.AnyActorLogic>(src: TLogic, ...[options]: xstate67.ConditionalRequired<[options?: ({
356
+ <TLogic extends xstate131.AnyActorLogic>(src: TLogic, ...[options]: xstate131.ConditionalRequired<[options?: ({
275
357
  id?: never;
276
358
  systemId?: string;
277
- input?: xstate67.InputFrom<TLogic> | undefined;
359
+ input?: xstate131.InputFrom<TLogic> | undefined;
278
360
  syncSnapshot?: boolean;
279
- } & { [K in xstate67.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate67.IsNotNever<xstate67.RequiredLogicInput<TLogic>>>): xstate67.ActorRefFromLogic<TLogic>;
361
+ } & { [K in xstate131.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate131.IsNotNever<xstate131.RequiredLogicInput<TLogic>>>): xstate131.ActorRefFromLogic<TLogic>;
280
362
  };
281
363
  input: DocumentCaptureInput;
282
- self: xstate67.ActorRef<xstate67.MachineSnapshot<DocumentCaptureContext, {
364
+ self: xstate131.ActorRef<xstate131.MachineSnapshot<DocumentCaptureContext, {
283
365
  type: "CAPTURE";
284
366
  } | {
285
367
  type: "FILE_SELECTED";
@@ -297,11 +379,17 @@ declare const documentCaptureMachine: xstate67.StateMachine<DocumentCaptureConte
297
379
  type: "RETRY";
298
380
  } | {
299
381
  type: "CONTINUE";
382
+ } | {
383
+ type: "NEXT_PAGE_CAMERA";
384
+ } | {
385
+ type: "NEXT_PAGE_PHOTO_LIBRARY";
386
+ } | {
387
+ type: "ALL_PAGES_CAPTURED";
300
388
  } | {
301
389
  type: "SKIP";
302
390
  } | {
303
391
  type: "CLOSE";
304
- }, Record<string, xstate67.AnyActorRef | undefined>, xstate67.StateValue, string, unknown, any, any>, {
392
+ }, Record<string, xstate131.AnyActorRef | undefined>, xstate131.StateValue, string, unknown, any, any>, {
305
393
  type: "CAPTURE";
306
394
  } | {
307
395
  type: "FILE_SELECTED";
@@ -319,11 +407,17 @@ declare const documentCaptureMachine: xstate67.StateMachine<DocumentCaptureConte
319
407
  type: "RETRY";
320
408
  } | {
321
409
  type: "CONTINUE";
410
+ } | {
411
+ type: "NEXT_PAGE_CAMERA";
412
+ } | {
413
+ type: "NEXT_PAGE_PHOTO_LIBRARY";
414
+ } | {
415
+ type: "ALL_PAGES_CAPTURED";
322
416
  } | {
323
417
  type: "SKIP";
324
418
  } | {
325
419
  type: "CLOSE";
326
- }, xstate67.AnyEventObject>;
420
+ }, xstate131.AnyEventObject>;
327
421
  }) => {
328
422
  config: {
329
423
  processingType: DocumentType;
@@ -344,7 +438,7 @@ declare const documentCaptureMachine: xstate67.StateMachine<DocumentCaptureConte
344
438
  error: undefined;
345
439
  attemptsRemaining: number;
346
440
  pageNumber: number;
347
- pendingNextPage: false;
441
+ nextPageType: "none";
348
442
  };
349
443
  readonly states: {
350
444
  readonly tutorial: {
@@ -396,7 +490,11 @@ declare const documentCaptureMachine: xstate67.StateMachine<DocumentCaptureConte
396
490
  readonly on: {
397
491
  readonly FILE_SELECTED: readonly [{
398
492
  readonly target: "preview";
399
- readonly guard: "fileSizeOk";
493
+ readonly guard: "fileSizeOkForGallery";
494
+ readonly actions: "setCapturedDocument";
495
+ }, {
496
+ readonly target: "preview";
497
+ readonly guard: "fileSizeOkForNonGallery";
400
498
  readonly actions: readonly ["setCapturedDocument", "setCaptureMethodCamera"];
401
499
  }, {
402
500
  readonly target: "capturing";
@@ -418,6 +516,10 @@ declare const documentCaptureMachine: xstate67.StateMachine<DocumentCaptureConte
418
516
  readonly target: "tutorial";
419
517
  readonly guard: "isCaptureMethodFile";
420
518
  readonly actions: "clearCapturedDocument";
519
+ }, {
520
+ readonly target: "capturing";
521
+ readonly guard: "isCaptureMethodGallery";
522
+ readonly actions: "clearCapturedDocumentGalleryRetake";
421
523
  }, {
422
524
  readonly target: "capturing";
423
525
  readonly actions: "clearCapturedDocument";
@@ -455,12 +557,18 @@ declare const documentCaptureMachine: xstate67.StateMachine<DocumentCaptureConte
455
557
  type: "RETRY";
456
558
  } | {
457
559
  type: "CONTINUE";
560
+ } | {
561
+ type: "NEXT_PAGE_CAMERA";
562
+ } | {
563
+ type: "NEXT_PAGE_PHOTO_LIBRARY";
564
+ } | {
565
+ type: "ALL_PAGES_CAPTURED";
458
566
  } | {
459
567
  type: "SKIP";
460
568
  } | {
461
569
  type: "CLOSE";
462
570
  };
463
- self: xstate67.ActorRef<xstate67.MachineSnapshot<DocumentCaptureContext, {
571
+ self: xstate131.ActorRef<xstate131.MachineSnapshot<DocumentCaptureContext, {
464
572
  type: "CAPTURE";
465
573
  } | {
466
574
  type: "FILE_SELECTED";
@@ -478,11 +586,17 @@ declare const documentCaptureMachine: xstate67.StateMachine<DocumentCaptureConte
478
586
  type: "RETRY";
479
587
  } | {
480
588
  type: "CONTINUE";
589
+ } | {
590
+ type: "NEXT_PAGE_CAMERA";
591
+ } | {
592
+ type: "NEXT_PAGE_PHOTO_LIBRARY";
593
+ } | {
594
+ type: "ALL_PAGES_CAPTURED";
481
595
  } | {
482
596
  type: "SKIP";
483
597
  } | {
484
598
  type: "CLOSE";
485
- }, Record<string, xstate67.AnyActorRef>, xstate67.StateValue, string, unknown, any, any>, {
599
+ }, Record<string, xstate131.AnyActorRef>, xstate131.StateValue, string, unknown, any, any>, {
486
600
  type: "CAPTURE";
487
601
  } | {
488
602
  type: "FILE_SELECTED";
@@ -500,11 +614,17 @@ declare const documentCaptureMachine: xstate67.StateMachine<DocumentCaptureConte
500
614
  type: "RETRY";
501
615
  } | {
502
616
  type: "CONTINUE";
617
+ } | {
618
+ type: "NEXT_PAGE_CAMERA";
619
+ } | {
620
+ type: "NEXT_PAGE_PHOTO_LIBRARY";
621
+ } | {
622
+ type: "ALL_PAGES_CAPTURED";
503
623
  } | {
504
624
  type: "SKIP";
505
625
  } | {
506
626
  type: "CLOSE";
507
- }, xstate67.AnyEventObject>;
627
+ }, xstate131.AnyEventObject>;
508
628
  }) => {
509
629
  capturedDocument: CapturedDocument;
510
630
  processingType: DocumentType;
@@ -512,7 +632,7 @@ declare const documentCaptureMachine: xstate67.StateMachine<DocumentCaptureConte
512
632
  };
513
633
  readonly onDone: {
514
634
  readonly target: "success";
515
- readonly actions: readonly ["setPendingNextPage", "stopStream"];
635
+ readonly actions: readonly ["setNextPageType", "stopStream"];
516
636
  };
517
637
  readonly onError: {
518
638
  readonly target: "failure";
@@ -528,12 +648,144 @@ declare const documentCaptureMachine: xstate67.StateMachine<DocumentCaptureConte
528
648
  readonly success: {
529
649
  readonly on: {
530
650
  readonly CONTINUE: readonly [{
531
- readonly target: "tutorial";
532
- readonly guard: "isPendingNextPage";
533
- readonly actions: "clearForNextPage";
651
+ readonly target: "nextPage";
652
+ readonly guard: "isNextPageOptional";
653
+ }, {
654
+ readonly target: "nextPage";
655
+ readonly guard: "isNextPageRequired";
534
656
  }, {
535
657
  readonly target: "finished";
536
658
  }];
659
+ readonly CLOSE: {
660
+ readonly target: "closed";
661
+ };
662
+ };
663
+ };
664
+ readonly nextPage: {
665
+ readonly on: {
666
+ readonly NEXT_PAGE_CAMERA: {
667
+ readonly target: "initCamera";
668
+ readonly actions: readonly ["clearForNextPage", "setCaptureMethodCamera"];
669
+ };
670
+ readonly NEXT_PAGE_PHOTO_LIBRARY: {
671
+ readonly target: "capturing";
672
+ readonly actions: readonly ["clearForNextPage", "setCaptureMethodGallery"];
673
+ };
674
+ readonly ALL_PAGES_CAPTURED: readonly [{
675
+ readonly target: "finalizing";
676
+ readonly guard: "canFinalizeOptionalPages";
677
+ }, {
678
+ readonly target: "finished";
679
+ }];
680
+ readonly CLOSE: {
681
+ readonly target: "closed";
682
+ };
683
+ };
684
+ };
685
+ readonly finalizing: {
686
+ readonly invoke: {
687
+ readonly id: "finalizeDocument";
688
+ readonly src: "finalizeDocumentRequest";
689
+ readonly input: ({
690
+ context
691
+ }: {
692
+ context: DocumentCaptureContext;
693
+ event: {
694
+ type: "CAPTURE";
695
+ } | {
696
+ type: "FILE_SELECTED";
697
+ file: File;
698
+ imageBase64: string;
699
+ fileType: string;
700
+ } | {
701
+ type: "ACCEPT";
702
+ } | {
703
+ type: "RETAKE";
704
+ } | {
705
+ type: "UPLOAD_PROGRESS";
706
+ progress: number;
707
+ } | {
708
+ type: "RETRY";
709
+ } | {
710
+ type: "CONTINUE";
711
+ } | {
712
+ type: "NEXT_PAGE_CAMERA";
713
+ } | {
714
+ type: "NEXT_PAGE_PHOTO_LIBRARY";
715
+ } | {
716
+ type: "ALL_PAGES_CAPTURED";
717
+ } | {
718
+ type: "SKIP";
719
+ } | {
720
+ type: "CLOSE";
721
+ };
722
+ self: xstate131.ActorRef<xstate131.MachineSnapshot<DocumentCaptureContext, {
723
+ type: "CAPTURE";
724
+ } | {
725
+ type: "FILE_SELECTED";
726
+ file: File;
727
+ imageBase64: string;
728
+ fileType: string;
729
+ } | {
730
+ type: "ACCEPT";
731
+ } | {
732
+ type: "RETAKE";
733
+ } | {
734
+ type: "UPLOAD_PROGRESS";
735
+ progress: number;
736
+ } | {
737
+ type: "RETRY";
738
+ } | {
739
+ type: "CONTINUE";
740
+ } | {
741
+ type: "NEXT_PAGE_CAMERA";
742
+ } | {
743
+ type: "NEXT_PAGE_PHOTO_LIBRARY";
744
+ } | {
745
+ type: "ALL_PAGES_CAPTURED";
746
+ } | {
747
+ type: "SKIP";
748
+ } | {
749
+ type: "CLOSE";
750
+ }, Record<string, xstate131.AnyActorRef>, xstate131.StateValue, string, unknown, any, any>, {
751
+ type: "CAPTURE";
752
+ } | {
753
+ type: "FILE_SELECTED";
754
+ file: File;
755
+ imageBase64: string;
756
+ fileType: string;
757
+ } | {
758
+ type: "ACCEPT";
759
+ } | {
760
+ type: "RETAKE";
761
+ } | {
762
+ type: "UPLOAD_PROGRESS";
763
+ progress: number;
764
+ } | {
765
+ type: "RETRY";
766
+ } | {
767
+ type: "CONTINUE";
768
+ } | {
769
+ type: "NEXT_PAGE_CAMERA";
770
+ } | {
771
+ type: "NEXT_PAGE_PHOTO_LIBRARY";
772
+ } | {
773
+ type: "ALL_PAGES_CAPTURED";
774
+ } | {
775
+ type: "SKIP";
776
+ } | {
777
+ type: "CLOSE";
778
+ }, xstate131.AnyEventObject>;
779
+ }) => {
780
+ processingType: DocumentType;
781
+ };
782
+ readonly onDone: {
783
+ readonly target: "finished";
784
+ };
785
+ readonly onError: {
786
+ readonly target: "failure";
787
+ readonly actions: "setFinalizeError";
788
+ };
537
789
  };
538
790
  };
539
791
  readonly failure: {
@@ -589,6 +841,7 @@ type DocumentCaptureCapturingState = {
589
841
  status: 'capturing';
590
842
  stream: MediaStream | undefined;
591
843
  captureMode: 'file' | 'camera';
844
+ captureMethod: 'camera' | 'file' | 'gallery' | undefined;
592
845
  error: DocumentCaptureErrorCode | undefined;
593
846
  pageNumber: number;
594
847
  };
@@ -610,7 +863,7 @@ type DocumentCaptureSuccessState = {
610
863
  imageBase64: string;
611
864
  fileType: string;
612
865
  fileName: string;
613
- pendingNextPage: boolean;
866
+ nextPageType: DocumentCaptureNextPageType;
614
867
  };
615
868
  type DocumentCaptureFailureState = {
616
869
  status: 'failure';
@@ -623,7 +876,20 @@ type DocumentCaptureFinishedState = {
623
876
  type DocumentCaptureClosedState = {
624
877
  status: 'closed';
625
878
  };
626
- type DocumentCaptureState = DocumentCaptureTutorialState | DocumentCaptureInitializingCameraState | DocumentCaptureCapturingState | DocumentCapturePreviewState | DocumentCaptureUploadingState | DocumentCaptureSuccessState | DocumentCaptureFailureState | DocumentCaptureFinishedState | DocumentCaptureClosedState;
879
+ type DocumentCaptureNextPageState = {
880
+ status: 'nextPage';
881
+ imageBase64: string;
882
+ fileType: string;
883
+ fileName: string;
884
+ pageNumber: number;
885
+ nextPageType: Exclude<DocumentCaptureNextPageType, 'none'>;
886
+ captureMode: 'file' | 'camera';
887
+ };
888
+ /** Confirming optional multi-page capture with the backend (short-lived). */
889
+ type DocumentCaptureFinalizingState = {
890
+ status: 'finalizing';
891
+ };
892
+ type DocumentCaptureState = DocumentCaptureTutorialState | DocumentCaptureInitializingCameraState | DocumentCaptureCapturingState | DocumentCapturePreviewState | DocumentCaptureUploadingState | DocumentCaptureSuccessState | DocumentCaptureFailureState | DocumentCaptureFinishedState | DocumentCaptureClosedState | DocumentCaptureNextPageState | DocumentCaptureFinalizingState;
627
893
  declare function createDocumentCaptureManager(options: CreateDocumentCaptureActorOptions): Manager<DocumentCaptureState> & {
628
894
  capture(): void;
629
895
  setFile(file: File, imageBase64: string): void;
@@ -633,7 +899,10 @@ declare function createDocumentCaptureManager(options: CreateDocumentCaptureActo
633
899
  continue(): void;
634
900
  skip(): void;
635
901
  close(): void;
902
+ captureNextPageFromCamera(): void;
903
+ captureNextPageFromFile(): void;
904
+ finishPageCapture(): void;
636
905
  };
637
906
  type DocumentCaptureManager = ReturnType<typeof createDocumentCaptureManager>;
638
907
  //#endregion
639
- export { DOCUMENT_CAPTURE_ERROR_CODES, type DocumentCaptureConfig, type DocumentCaptureErrorCode, type DocumentCaptureManager, type DocumentCaptureState, type DocumentType, createDocumentCaptureManager, documentCaptureMachine };
908
+ export { DOCUMENT_CAPTURE_ERROR_CODES, type DocumentCaptureConfig, type DocumentCaptureErrorCode, type DocumentCaptureManager, type DocumentCaptureNextPageType, type DocumentCaptureState, type DocumentType, createDocumentCaptureManager, documentCaptureMachine };