@incodetech/core 0.0.0-dev-20260723-e73d5099 → 0.0.0-dev-20260723-397b76d8

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 (89) hide show
  1. package/dist/ae-signature.d.ts +2 -1
  2. package/dist/ae-signature.esm.js +1 -1
  3. package/dist/authentication.d.ts +3 -2
  4. package/dist/authentication.esm.js +2 -2
  5. package/dist/{authenticationManager-BCm7eGoK.d.ts → authenticationManager-Ce1nLm5y.d.ts} +1 -1
  6. package/dist/{authenticationManager-Cmio9w7i.esm.js → authenticationManager-DW449fW3.esm.js} +2 -2
  7. package/dist/{authenticationStateMachine-CrkXvIhE.esm.js → authenticationStateMachine-CrvxMmoJ.esm.js} +2 -2
  8. package/dist/consent.d.ts +1 -1
  9. package/dist/{consentManager-3Pbtj-RV.d.ts → consentManager-uhDPdU6i.d.ts} +4 -4
  10. package/dist/{deepsightLoader-Be2xONxN.esm.js → deepsightLoader-BCxEZjuI.esm.js} +1 -1
  11. package/dist/document-capture.d.ts +2 -1
  12. package/dist/document-upload.d.ts +4 -4
  13. package/dist/{documentCaptureManager-CBP2DkPr.d.ts → documentCaptureManager-pEqMY_Oo.d.ts} +2 -104
  14. package/dist/dynamic-forms.d.ts +2 -1
  15. package/dist/dynamic-forms.esm.js +2 -2
  16. package/dist/{dynamicFormsManager-Dposae2l.d.ts → dynamicFormsManager-BYac2uEY.d.ts} +2 -48
  17. package/dist/{dynamicFormsManager-Fi2O2RUM.esm.js → dynamicFormsManager-DI0sCyVB.esm.js} +1 -1
  18. package/dist/ekyb.d.ts +2 -1
  19. package/dist/ekyb.esm.js +3 -2
  20. package/dist/{ekybManager-CObZ7foB.esm.js → ekybManager-D46NN7cx.esm.js} +1 -1
  21. package/dist/{ekybManager-CBX0tM04.d.ts → ekybManager-Dzswb_b8.d.ts} +3 -48
  22. package/dist/{ekybStateMachine-Cw4pz_hf.esm.js → ekybStateMachine-DX7KeqlM.esm.js} +2 -170
  23. package/dist/ekyc.esm.js +3 -2
  24. package/dist/{ekycManager-CI7sN4Ln.esm.js → ekycManager-DRrG5I6e.esm.js} +1 -1
  25. package/dist/{ekycStateMachine-DFQdmBXl.esm.js → ekycStateMachine-DRbbavZy.esm.js} +2 -223
  26. package/dist/ekycUtils-Dew1rBG0.esm.js +223 -0
  27. package/dist/electronic-signature.d.ts +2 -1
  28. package/dist/electronic-signature.esm.js +1 -1
  29. package/dist/extensibility.d.ts +12 -11
  30. package/dist/extensibility.esm.js +9 -9
  31. package/dist/{faceCaptureManagerFactory-DPf1rRsd.d.ts → faceCaptureManagerFactory-BUE6z9iY.d.ts} +2 -4
  32. package/dist/{faceCaptureManagerFactory-CeUzH_6U.esm.js → faceCaptureManagerFactory-BcntOvvC.esm.js} +1 -1
  33. package/dist/{faceCaptureSetup-CtiVwaPe.esm.js → faceCaptureSetup-BUAw6zY_.esm.js} +2 -2
  34. package/dist/flow.d.ts +44 -1
  35. package/dist/flow.esm.js +4 -11
  36. package/dist/flowServices-BU1mMxoQ.esm.js +596 -0
  37. package/dist/geolocation.esm.js +2 -2
  38. package/dist/{geolocationManager-bZDyI0gy.esm.js → geolocationManager-zeqAcVHC.esm.js} +1 -1
  39. package/dist/id-ocr.d.ts +2 -1
  40. package/dist/id.d.ts +2 -1
  41. package/dist/id.esm.js +2 -2
  42. package/dist/{idCaptureManager-Dqn6U25Q.esm.js → idCaptureManager-BqmmPXFm.esm.js} +3 -4
  43. package/dist/idCaptureManager-CtsYvX-Z.d.ts +405 -0
  44. package/dist/{idCaptureStateMachine-B7atraNp.esm.js → idCaptureStateMachine-CnKkMNrI.esm.js} +8 -50
  45. package/dist/{idOcrManager-B-JyjyPb.d.ts → idOcrManager-DlYG277_.d.ts} +2 -163
  46. package/dist/{index-CKbmDFNq.d.ts → index-DGcdhk8Y.d.ts} +2 -64
  47. package/dist/index.d.ts +1 -1
  48. package/dist/index.esm.js +1 -1
  49. package/dist/mandatory-consent.d.ts +2 -1
  50. package/dist/{mandatoryConsentManager-Bc9AKBft.d.ts → mandatoryConsentManager-Ck2e2W4o.d.ts} +6 -25
  51. package/dist/{onDeviceFaceResults-CbO3AqMC.esm.js → onDeviceFaceResults-CWMT6JTR.esm.js} +1 -1
  52. package/dist/personhood.esm.js +2 -2
  53. package/dist/qe-signature.d.ts +2 -1
  54. package/dist/qe-signature.esm.js +1 -1
  55. package/dist/{recordingService-YhyXG0Ch.esm.js → recordingService-CfT3nmFO.esm.js} +1 -1
  56. package/dist/redirect-to-mobile.d.ts +2 -1
  57. package/dist/{redirectToMobileManager-NVQM3o5P.d.ts → redirectToMobileManager-DZlJhqvq.d.ts} +2 -40
  58. package/dist/selfie.d.ts +2 -2
  59. package/dist/selfie.esm.js +4 -4
  60. package/dist/{selfieManager-CgmJu62N.esm.js → selfieManager-D-QJUh3X.esm.js} +2 -2
  61. package/dist/{selfieManager-Dq9wNlcg.d.ts → selfieManager-LabfZln4.d.ts} +1 -1
  62. package/dist/{selfieStateMachine-C_piZ4gb.esm.js → selfieStateMachine-BH-U-y6R.esm.js} +2 -2
  63. package/dist/session-BU4MkUEc.esm.js +1 -0
  64. package/dist/session.d.ts +2 -0
  65. package/dist/session.esm.js +2 -2
  66. package/dist/{sessionInitializer-B5tU3IQv.esm.js → sessionInitializer-DT7IYwRx.esm.js} +58 -11
  67. package/dist/{setup-BBfVpTog.d.ts → setup-B1WTXTQV.d.ts} +15 -0
  68. package/dist/{setup-Cx9IY17e.esm.js → setup-DXdKnXXf.esm.js} +21 -7
  69. package/dist/types-B4BObr_7.d.ts +105 -0
  70. package/dist/types-BAvkiv6L.d.ts +6 -0
  71. package/dist/types-BQgIv5p8.d.ts +21 -0
  72. package/dist/types-BfHiko5D.d.ts +48 -0
  73. package/dist/types-CBJI9n6h.d.ts +163 -0
  74. package/dist/{idCaptureManager-DTe_5dcI.d.ts → types-D0ohdBDu.d.ts} +2 -407
  75. package/dist/types-DPIDuhut2.d.ts +40 -0
  76. package/dist/types-DWaEoU0I.d.ts +64 -0
  77. package/dist/types-xIEGXWk8.d.ts +48 -0
  78. package/dist/video-selfie.esm.js +3 -3
  79. package/dist/wasm.d.ts +1 -1
  80. package/dist/wasm.esm.js +1 -1
  81. package/dist/workflow.d.ts +4 -4
  82. package/dist/workflow.esm.js +16 -11
  83. package/package.json +1 -1
  84. package/dist/flowServices-Caz-Bdol.esm.js +0 -209
  85. package/dist/session-CoL4WBRi.esm.js +0 -1
  86. package/dist/videoSelfieSteps-DHcibfYH.esm.js +0 -57
  87. package/dist/{dynamicFormsStateMachine-DiPpuHgF.esm.js → dynamicFormsStateMachine-BQqAwNQ-.esm.js} +1 -1
  88. package/dist/{electronicSignatureManager-DGFwHdro.esm.js → electronicSignatureManager-BXIpAJ5m.esm.js} +1 -1
  89. package/dist/{geolocationStateMachine-ByU6-nbM.esm.js → geolocationStateMachine-DxSETS9_.esm.js} +1 -1
@@ -0,0 +1,405 @@
1
+ import { A as StateMachine, i as ActorRefFrom, l as AnyStateMachine } from "./spawn-D9jgw9pW.js";
2
+ import "./StateMachine-EDpYWy0i.js";
3
+ import { t as Manager } from "./Manager-CQQ99QOI.js";
4
+ import "./Actor-iTq7YY48.js";
5
+ import { t as IVisibilityObserverCapability } from "./IVisibilityObserverCapability-D4tvIB5v.js";
6
+ import "./index-B8weJxmL.js";
7
+ import { t as CameraStream } from "./camera-9wWD-pwg.js";
8
+ import { t as DeepsightService } from "./deepsightService-CR-CYdka.js";
9
+ import { a as RegulationTypes } from "./types-BjTTkLmd.js";
10
+ import { n as PermissionStatus } from "./types-BT-aiBYV.js";
11
+ import { A as ManualUploadSide, C as RecordingSession, F as Pdf417DecodeResult, M as DetectionOrientation, N as IIdCaptureCapability, T as IAnalyticsCapability, a as DetectionArea, c as IdCaptureConfig, d as IdCaptureEvent, g as IdCaptureOutput, h as IdCaptureOnlyConfig, j as ManualUploadTab, l as IdCaptureContext, m as IdCaptureMode, n as CaptureIdResponse, o as DetectionStatus, p as IdCaptureInput, t as AddBarcodeV3Response, u as IdCaptureDependencies, w as UploadIdResponse, x as IdErrorCode, y as IdDocumentType } from "./types-D0ohdBDu.js";
12
+ //#region src/modules/id/idCaptureStateMachine.d.ts
13
+ declare const idCaptureMachine: AnyStateMachine;
14
+ type IdCaptureMachine = StateMachine<IdCaptureContext, IdCaptureEvent, any, any, any, any, any, any, any, IdCaptureInput, any, any, any, any>;
15
+ //#endregion
16
+ //#region src/modules/id/idCaptureActor.d.ts
17
+ type CreateIdCaptureActorOptions = {
18
+ config: IdCaptureConfig;
19
+ dependencies?: IdCaptureDependencies;
20
+ };
21
+ type IdCaptureActor = ActorRefFrom<IdCaptureMachine>;
22
+ declare function createIdCaptureActor(options: CreateIdCaptureActorOptions): IdCaptureActor;
23
+ //#endregion
24
+ //#region src/modules/id/idCaptureOnlyStateMachine.d.ts
25
+ type IdCaptureOnlyContext = IdCaptureContext;
26
+ type IdCaptureOnlyEvent = IdCaptureEvent;
27
+ type IdCaptureOnlyInput = IdCaptureInput;
28
+ /**
29
+ * ID capture state machine variant for the captureOnly flow. Shares the full
30
+ * base ID-capture state tree (chooser, tutorial, permissions, capture,
31
+ * front/back finished, processing, finished); only the upload, process, and
32
+ * recording steps are local instead of remote.
33
+ */
34
+ declare const idCaptureOnlyMachine: AnyStateMachine;
35
+ type IdCaptureOnlyMachine = StateMachine<IdCaptureOnlyContext, IdCaptureOnlyEvent, any, any, any, any, any, any, any, IdCaptureOnlyInput, any, any, any, any>;
36
+ //#endregion
37
+ //#region src/modules/id/idCaptureOnlyActor.d.ts
38
+ type CreateIdCaptureOnlyActorOptions = {
39
+ config: IdCaptureOnlyConfig;
40
+ dependencies?: IdCaptureDependencies;
41
+ };
42
+ type IdCaptureOnlyActor = ActorRefFrom<IdCaptureOnlyMachine>;
43
+ declare function createIdCaptureOnlyActor(options: CreateIdCaptureOnlyActorOptions): IdCaptureOnlyActor;
44
+ //#endregion
45
+ //#region src/modules/id/idCaptureServices.d.ts
46
+ type IdCaptureInitResult = {
47
+ stream: CameraStream;
48
+ provider: IIdCaptureCapability;
49
+ captureResolution?: string;
50
+ cameraFallbackLevel?: number;
51
+ };
52
+ type InitializeIdCaptureParams = {
53
+ config: IdCaptureConfig;
54
+ deepsightService?: DeepsightService;
55
+ };
56
+ declare function initializeIdCapture(params: InitializeIdCaptureParams): Promise<IdCaptureInitResult>;
57
+ declare function stopStream(stream: CameraStream): void;
58
+ type UploadIdImageParams = {
59
+ image: string;
60
+ type: 'front' | 'back';
61
+ sendBase64?: boolean;
62
+ isSecondId?: boolean;
63
+ onlyFront?: boolean;
64
+ glare?: number;
65
+ sharpness?: number;
66
+ shouldSkipGlareBack?: boolean;
67
+ shouldSkipGlareFront?: boolean;
68
+ captureType?: string;
69
+ ageAssurance?: boolean;
70
+ onProgress?: (progress: number) => void;
71
+ metadata?: string;
72
+ signal?: AbortSignal;
73
+ analyticsProvider?: IAnalyticsCapability;
74
+ imageData?: ImageData;
75
+ /**
76
+ * [ENG-44176] When `false`, attaches `extractIdFace=false` as a query param
77
+ * to `POST /omni/add/front-id/v2` so the backend skips biometric face
78
+ * extraction. Forwarded only for `type === 'front'`. Omitted / `true` is a
79
+ * no-op on the wire (backend default is extraction on).
80
+ */
81
+ extractIdFace?: boolean;
82
+ };
83
+ type ValidationError = {
84
+ error: boolean;
85
+ message: string;
86
+ messageDescription?: string;
87
+ errorKey: IdErrorCode;
88
+ };
89
+ declare function validateUploadResponse(response: UploadIdResponse & {
90
+ failReason?: string;
91
+ side?: 'front' | 'back';
92
+ }, sessionState?: {
93
+ skipGlareFront?: boolean;
94
+ skipGlareBack?: boolean;
95
+ }): ValidationError | undefined;
96
+ declare function uploadIdImage(params: UploadIdImageParams): Promise<CaptureIdResponse>;
97
+ type StartRecordingParams = {
98
+ config: IdCaptureConfig;
99
+ stream: CameraStream;
100
+ existing?: RecordingSession;
101
+ type: 'frontId' | 'backId';
102
+ };
103
+ declare function preloadIdRecordingProvider(config: IdCaptureConfig): void;
104
+ declare function startRecordingSession(params: StartRecordingParams): Promise<RecordingSession | undefined>;
105
+ declare function stopRecording(session: RecordingSession): void;
106
+ declare function processId(isSecondId?: boolean, queueName?: string, signal?: AbortSignal): Promise<{
107
+ isDocumentExpired: boolean;
108
+ }>;
109
+ type UploadManualIdFileParams = {
110
+ side: 'front' | 'back' | 'passport';
111
+ /**
112
+ * Raw base64 payload (no `data:<mime>;base64,` prefix). Callers must strip
113
+ * the data-URL prefix — the v2 backend rejects data URLs with
114
+ * `IllegalArgumentException: Illegal base64 character 3a`.
115
+ */
116
+ base64Image: string;
117
+ retry?: boolean;
118
+ onlyFront?: boolean;
119
+ signal?: AbortSignal;
120
+ isSecondId?: boolean;
121
+ /**
122
+ * [ENG-44176] When `false`, attaches `extractIdFace=false` to the upload
123
+ * so the backend skips biometric face extraction. Forwarded only for the
124
+ * `front` and `passport` sides; back uploads ignore it. Omitted / `true`
125
+ * is a no-op on the wire.
126
+ */
127
+ extractIdFace?: boolean;
128
+ };
129
+ /**
130
+ * Upload a user-selected image as front / back / passport ID.
131
+ *
132
+ * Uses the same request shape as the live-camera path (`uploadIdImage`):
133
+ * JSON body `{ base64Image }` with default application/json Content-Type,
134
+ * `captureType=UPLOAD` query param, `retry=true` when retrying.
135
+ * Back is POSTed to `/omni/add/back-id/v2` (or `/omni/add/back-second-id/v2`
136
+ * when `isSecondId`); front and passport go to `/omni/add/front-id/v2` (or
137
+ * `/omni/add/front-second-id/v2` when `isSecondId`).
138
+ *
139
+ * The v2 endpoints reject raw `image/jpeg` bodies with 415, so the caller
140
+ * must convert the File to base64 before calling this service.
141
+ */
142
+ declare function uploadManualIdFile(params: UploadManualIdFileParams): Promise<UploadIdResponse>;
143
+ /**
144
+ * UTF-8-safe base64 encoding of a decoded barcode payload. Uses the browser
145
+ * `TextEncoder` + `btoa` (always available in the SDK's target environment) so
146
+ * non-ASCII payloads survive `btoa`, which only accepts Latin-1.
147
+ */
148
+ declare function barcodeToBase64(raw: string): string;
149
+ type AddBarcodeParams = {
150
+ rawBarcode: string;
151
+ /** When true (default), the server processes the ID from the barcode. */
152
+ processId?: boolean;
153
+ /** PDF417 decode-quality metrics forwarded to the server (best-effort). */
154
+ metrics?: Pdf417DecodeResult | null;
155
+ signal?: AbortSignal;
156
+ };
157
+ /**
158
+ * US Smart Capture: submits a decoded PDF417 barcode to
159
+ * `POST /omni/add/barcode/v3`. The response drives the downstream front-capture
160
+ * and Process ID skips (`forceFrontIdCapture` / `idValidationCompleted`).
161
+ * Mirrors SDK 1's `addBarcode`. Throws (carrying `status`/`data`) on a non-OK
162
+ * response so the caller can fall back to a full-frame upload. The
163
+ * hardware-id token is injected by the shared `api` layer, as in `uploadIdImage`.
164
+ */
165
+ declare function addBarcode(params: AddBarcodeParams): Promise<AddBarcodeV3Response>;
166
+ //#endregion
167
+ //#region src/modules/id/digitalUpload/types.d.ts
168
+ type DigitalUploadFailReason = 'DIGITAL_ID_REQUESTED_BUT_OTHER_PROVIDED' | 'ID_TYPE_UNACCEPTABLE' | 'FILE_CHANGED_ERROR' | 'INVALID_FILE_TYPE' | 'NETWORK_ERROR' | 'GENERIC';
169
+ //#endregion
170
+ //#region src/internal/idCapture/idCaptureManagerFactory.d.ts
171
+ type CaptureStatus = 'initializing' | 'detecting' | 'capturing' | 'uploading' | 'uploadError' | 'success';
172
+ type IdCaptureIdleState = {
173
+ status: 'idle';
174
+ };
175
+ type IdCaptureChooserState = {
176
+ status: 'chooser';
177
+ availableDocumentTypes: IdDocumentType[];
178
+ };
179
+ type IdCaptureLoadingState = {
180
+ status: 'loading';
181
+ };
182
+ type IdCaptureTutorialState = {
183
+ status: 'tutorial';
184
+ selectedDocumentType: IdDocumentType | undefined;
185
+ currentMode: IdCaptureMode;
186
+ };
187
+ type IdCaptureAgeVerificationState = {
188
+ status: 'ageVerification';
189
+ };
190
+ type IdCapturePermissionsState = {
191
+ status: 'permissions';
192
+ permissionStatus: PermissionStatus;
193
+ };
194
+ type IdCaptureCaptureState = {
195
+ status: 'capture';
196
+ captureStatus: CaptureStatus;
197
+ stream: CameraStream | undefined;
198
+ detectionStatus: DetectionStatus;
199
+ debugFrame: ImageData | undefined;
200
+ attemptsRemaining: number;
201
+ uploadError: IdErrorCode | undefined;
202
+ currentMode: IdCaptureMode;
203
+ counterValue: number;
204
+ orientation: DetectionOrientation | undefined;
205
+ idType: string | undefined;
206
+ previewImageUrl?: string;
207
+ uploadProgress?: number;
208
+ ageAssurance: boolean;
209
+ uploadErrorMessage?: string;
210
+ uploadErrorDescription?: string;
211
+ /** Whether back capture is needed after front capture completes */
212
+ needsBackCapture: boolean;
213
+ /** Whether front capture is needed after back capture (usSmartCapture + forceFrontIdCapture) */
214
+ needsFrontCapture: boolean;
215
+ showCaptureButtonInAuto: boolean;
216
+ /** Whether retry is available (attemptsRemaining > 0) */
217
+ canRetry: boolean;
218
+ };
219
+ type IdCaptureMandatoryConsentState = {
220
+ status: 'mandatoryConsent';
221
+ regulationType: RegulationTypes;
222
+ };
223
+ type IdCaptureFrontFinishedState = {
224
+ status: 'frontFinished';
225
+ };
226
+ type IdCaptureBackFinishedState = {
227
+ status: 'backFinished';
228
+ };
229
+ type IdCaptureProcessingState = {
230
+ status: 'processing';
231
+ };
232
+ type IdCaptureExpiredState = {
233
+ status: 'expired';
234
+ /**
235
+ * Remaining attempts after this expired result. Mirrors V1's
236
+ * `idv2.capture.processing.attemptsRemainingLabel` counter and Figma's
237
+ * "X attempts remaining" line on `1-9-11-id-documenterror`.
238
+ */
239
+ attemptsRemaining: number;
240
+ /** Which side just expired — drives the back-specific subtitle in the UI. */
241
+ currentMode: IdCaptureMode;
242
+ };
243
+ type IdCaptureExpiredExhaustedState = {
244
+ status: 'expiredExhausted';
245
+ };
246
+ type IdCaptureFinishedState = {
247
+ status: 'finished';
248
+ /**
249
+ * Terminal output of the ID machine — the downstream module-skip signal
250
+ * (e.g. `skipFaceMatch` for the US Smart Capture "no front, no match" path).
251
+ * UI-driven modules don't auto-propagate machine output to the orchestrator,
252
+ * so the UI forwards this to `flowManager.completeModule(output)` on finish.
253
+ */
254
+ output?: IdCaptureOutput;
255
+ };
256
+ type IdCaptureClosedState = {
257
+ status: 'closed';
258
+ };
259
+ type IdCaptureErrorState = {
260
+ status: 'error';
261
+ error: string;
262
+ };
263
+ type ManualUploadUploadingSide = ManualUploadSide;
264
+ type IdCaptureManualUploadState = {
265
+ status: 'manualUpload';
266
+ phase: 'selecting' | 'uploading' | 'exhausted';
267
+ /** Which side is currently uploading (undefined in `selecting`/`exhausted`). */
268
+ uploadingSide: ManualUploadUploadingSide | undefined;
269
+ activeTab: ManualUploadTab;
270
+ showIdTab: boolean;
271
+ showPassportTab: boolean;
272
+ /** Whether the ID tab should render a back-of-ID slot. */
273
+ showBackSlot: boolean;
274
+ frontFileName: string | undefined;
275
+ backFileName: string | undefined;
276
+ passportFileName: string | undefined;
277
+ frontUploaded: boolean;
278
+ backUploaded: boolean;
279
+ passportUploaded: boolean;
280
+ canContinue: boolean;
281
+ retriesLeft: number;
282
+ /** i18n key for the current error message, if any. */
283
+ errorKey: string | null;
284
+ errorSide: ManualUploadSide | null;
285
+ };
286
+ type IdCaptureDigitalUploadState = {
287
+ status: 'digitalIdUpload';
288
+ phase: 'tutorial' | 'selecting' | 'reviewing' | 'uploading' | 'holding' | 'success' | 'error' | 'fileTooLarge' | 'exhausted';
289
+ file: File | null;
290
+ fileName: string | undefined;
291
+ failReason: DigitalUploadFailReason | null;
292
+ attemptsRemaining: number;
293
+ uploadProgress: number;
294
+ pickerRequestId: number;
295
+ };
296
+ type IdCaptureState = IdCaptureIdleState | IdCaptureChooserState | IdCaptureLoadingState | IdCaptureTutorialState | IdCaptureAgeVerificationState | IdCapturePermissionsState | IdCaptureCaptureState | IdCaptureMandatoryConsentState | IdCaptureFrontFinishedState | IdCaptureBackFinishedState | IdCaptureProcessingState | IdCaptureExpiredState | IdCaptureExpiredExhaustedState | IdCaptureFinishedState | IdCaptureClosedState | IdCaptureErrorState | IdCaptureManualUploadState | IdCaptureDigitalUploadState;
297
+ /**
298
+ * Union of all `idCaptureMachine` variants' actor types. Variants share the
299
+ * same state tree and context shape, so the manager helpers
300
+ * (`mapState`, `createApi`) work uniformly for either flavor at runtime.
301
+ */
302
+ type AnyIdCaptureActor = IdCaptureActor | IdCaptureOnlyActor;
303
+ /**
304
+ * Builds the public ID capture manager from an already-created actor.
305
+ * Used by both `createIdCaptureManager` and `createIdCaptureOnlyManager`.
306
+ *
307
+ * The internal cast to `IdCaptureActor` narrows the union for `createManager`,
308
+ * which is typed against the regular machine. Variants produced via
309
+ * `idCaptureMachine.provide({...})` share the same context and event types,
310
+ * so the cast is sound at runtime — only the actor implementation differs.
311
+ *
312
+ * `visibilityObserver` defaults to the browser `document.visibilitychange`
313
+ * provider so first-party and BYO-actor callers get foreground/background
314
+ * events without extra wiring. Construction lives here — a documented,
315
+ * narrow deviation from "never `new` a provider inside Core" (see
316
+ * `docs/patterns/CAPABILITY.md`). Pass a fake/no-op to override (tests do).
317
+ */
318
+ declare function createIdCaptureManagerFromActor(actor: AnyIdCaptureActor, visibilityObserver?: IVisibilityObserverCapability): Manager<IdCaptureState> & {
319
+ load(): void;
320
+ selectDocument(documentType: IdDocumentType): void;
321
+ nextStep(): Promise<void>;
322
+ requestPermission(): void;
323
+ goToLearnMore(): void;
324
+ back(): void;
325
+ close(): void;
326
+ reset(): void;
327
+ retryCapture(): void;
328
+ continueExhausted(): void;
329
+ continueFromError(): void;
330
+ capture(): void;
331
+ switchToManualCapture(): void;
332
+ continueToBack(): void;
333
+ continueToFront(): void;
334
+ skipBack(): void;
335
+ acceptMandatoryConsent(): void;
336
+ cancelMandatoryConsent(): void;
337
+ /**
338
+ * Updates the detection area used for WASM geometry calculation.
339
+ * Call this when the UI detection area dimensions change (e.g., on resize or orientation change).
340
+ */
341
+ updateDetectionArea(detectionArea: DetectionArea): void;
342
+ /**
343
+ * Manual upload: tab change (ID / Passport). Resets per-tab file selections.
344
+ * Note: there is intentionally no `switchToManualUpload` method — entry to
345
+ * the manual-upload flow is gated by config + Chooser to prevent a
346
+ * dev-console bypass of live camera capture.
347
+ */
348
+ manualUploadChangeTab(tab: ManualUploadTab): void;
349
+ manualUploadSelectFile(side: ManualUploadSide, file: File): void;
350
+ manualUploadContinue(): void;
351
+ manualUploadReset(): void;
352
+ digitalUploadNextStep(): void;
353
+ digitalUploadPickFile(file: File): void;
354
+ digitalUploadConfirm(): void;
355
+ digitalUploadReplace(): void;
356
+ digitalUploadRetry(): void;
357
+ digitalUploadScanInstead(): void;
358
+ digitalUploadChooseAnother(): void;
359
+ };
360
+ type IdCaptureManager = ReturnType<typeof createIdCaptureManagerFromActor>;
361
+ //#endregion
362
+ //#region src/modules/id/idCaptureManager.d.ts
363
+ /**
364
+ * Creates a manager for the regular ID capture flow. The shared
365
+ * `mapState`/`createApi`/state-types live in
366
+ * `internal/idCapture/idCaptureManagerFactory.ts`; this file is a thin
367
+ * wrapper that creates the actor and delegates to the factory.
368
+ *
369
+ * For the captureOnly flow (rich payload delivered locally via `onCapture`),
370
+ * use `createIdCaptureOnlyManager`.
371
+ */
372
+ declare function createIdCaptureManager(options: CreateIdCaptureActorOptions): Manager<IdCaptureState> & {
373
+ load(): void;
374
+ selectDocument(documentType: IdDocumentType): void;
375
+ nextStep(): Promise<void>;
376
+ requestPermission(): void;
377
+ goToLearnMore(): void;
378
+ back(): void;
379
+ close(): void;
380
+ reset(): void;
381
+ retryCapture(): void;
382
+ continueExhausted(): void;
383
+ continueFromError(): void;
384
+ capture(): void;
385
+ switchToManualCapture(): void;
386
+ continueToBack(): void;
387
+ continueToFront(): void;
388
+ skipBack(): void;
389
+ acceptMandatoryConsent(): void;
390
+ cancelMandatoryConsent(): void;
391
+ updateDetectionArea(detectionArea: DetectionArea): void;
392
+ manualUploadChangeTab(tab: ManualUploadTab): void;
393
+ manualUploadSelectFile(side: ManualUploadSide, file: File): void;
394
+ manualUploadContinue(): void;
395
+ manualUploadReset(): void;
396
+ digitalUploadNextStep(): void;
397
+ digitalUploadPickFile(file: File): void;
398
+ digitalUploadConfirm(): void;
399
+ digitalUploadReplace(): void;
400
+ digitalUploadRetry(): void;
401
+ digitalUploadScanInstead(): void;
402
+ digitalUploadChooseAnother(): void;
403
+ };
404
+ //#endregion
405
+ export { createIdCaptureActor as A, CreateIdCaptureOnlyActorOptions as C, idCaptureOnlyMachine as D, IdCaptureOnlyMachine as E, idCaptureMachine as M, CreateIdCaptureActorOptions as O, validateUploadResponse as S, createIdCaptureOnlyActor as T, startRecordingSession as _, AddBarcodeParams as a, uploadIdImage as b, StartRecordingParams as c, ValidationError as d, addBarcode as f, processId as g, preloadIdRecordingProvider as h, createIdCaptureManagerFromActor as i, IdCaptureMachine as j, IdCaptureActor as k, UploadIdImageParams as l, initializeIdCapture as m, IdCaptureManager as n, IdCaptureInitResult as o, barcodeToBase64 as p, IdCaptureState as r, InitializeIdCaptureParams as s, createIdCaptureManager as t, UploadManualIdFileParams as u, stopRecording as v, IdCaptureOnlyActor as w, uploadManualIdFile as x, stopStream as y };
@@ -3,21 +3,20 @@ import { r as getToken, t as api } from "./api-BDTZNnca.esm.js";
3
3
  import { x as revokeObjectURL } from "./events-Dy8PyVO5.esm.js";
4
4
  import { t as endpoints } from "./endpoints-CfRg7iAr.esm.js";
5
5
  import { t as addDeviceStats } from "./stats-4DAk7TYl.esm.js";
6
- import { t as getDisableIpify } from "./sessionInitializer-B5tU3IQv.esm.js";
6
+ import { t as getDisableIpify } from "./sessionInitializer-DT7IYwRx.esm.js";
7
7
  import { n as isDesktop } from "./platform-Cd_yWGNG.esm.js";
8
+ import "./session-BU4MkUEc.esm.js";
8
9
  import { a as and, n as sendTo, r as assign, s as not, t as setup } from "./xstate.esm-Cf4e0Cfd.esm.js";
9
10
  import { n as fromPromise, t as fromCallback } from "./xstate-actors.esm-CtI5S0f4.esm.js";
10
11
  import { n as invokeRequestPermissionActor, t as checkPermission } from "./permissionServices-CkHL1BjH.esm.js";
11
- import { _ as StreamCanvasProcessingSession, h as stopRecording$1, m as startRecording, p as createRecordingSession } from "./onDeviceFaceResults-CbO3AqMC.esm.js";
12
- import { t as sleep } from "./ITimerCapability-DgdDzp8G.esm.js";
12
+ import { _ as StreamCanvasProcessingSession, h as stopRecording$1, m as startRecording, p as createRecordingSession } from "./onDeviceFaceResults-CWMT6JTR.esm.js";
13
13
  import { t as IncodeCanvas } from "./canvas-E1zGkel4.esm.js";
14
14
  import { n as getBackCameraStream } from "./backCameraStream-6XQp9RxG.esm.js";
15
15
  import { n as getWindowDimensions } from "./getDeviceClass-CeBiEayS.esm.js";
16
16
  import { t as getDeviceClass } from "./getDeviceClass-BGmoQmjj.esm.js";
17
17
  import { t as StreamCanvasCapture } from "./StreamCanvasCapture-D2XcXCZ4.esm.js";
18
18
  import { n as needsMotionPrimeOnlyFromPermission, r as resolveStoredPermissionResult, t as isReadyForCaptureFromPermission } from "./permissionGuards-5Cu6a8iN.esm.js";
19
- import { i as flagIdManualReview, n as preloadOpenViduProvider } from "./recordingService-YhyXG0Ch.esm.js";
20
- import "./session-CoL4WBRi.esm.js";
19
+ import { i as flagIdManualReview, n as preloadOpenViduProvider } from "./recordingService-CfT3nmFO.esm.js";
21
20
  import { n as DEFAULT_ID_CAPTURE_THRESHOLDS$1, r as IdCaptureProvider } from "./idCaptureDefaults-DCrjeNl5.esm.js";
22
21
  //#region src/modules/id/digitalUpload/digitalUploadErrors.ts
23
22
  const TERMINAL_FAIL_REASONS = /* @__PURE__ */ new Set(["DIGITAL_ID_REQUESTED_BUT_OTHER_PROVIDED", "ID_TYPE_UNACCEPTABLE"]);
@@ -1190,15 +1189,6 @@ const shouldSkipProcessIdGuard = ({ context }) => context.skipProcessId === true
1190
1189
  */
1191
1190
  const shouldSubmitBarcodeGuard = ({ context }) => context.currentMode === "back" && context.config.usSmartCapture === true && !!context.decodedBarcode?.text;
1192
1191
  /**
1193
- * US Smart Capture pre-capture fast path: submit the decoded PDF417 barcode the
1194
- * instant it is decoded, before the best-frame auto-capture completes. Reads the
1195
- * barcode from the EVENT — the guard runs before the store action, so
1196
- * `context.decodedBarcode` isn't populated yet. One-shot per attempt via
1197
- * `barcodeFastPathAttempted` (a later best-frame decode falls through to the
1198
- * regular `shouldSubmitBarcode` path).
1199
- */
1200
- const canRunBarcodeFastPathGuard = ({ context, event }) => context.currentMode === "back" && context.config.usSmartCapture === true && !context.barcodeFastPathAttempted && !!event.decoded?.text;
1201
- /**
1202
1192
  * Bug 4 fix: when `expiredExhausted` is reached via the per-upload-expired
1203
1193
  * exhaustion path with a back side captured (or the entire single-side back
1204
1194
  * flow), we want `processId` to run once on Continue so the backend
@@ -1606,13 +1596,12 @@ const processIdActor = fromPromise(async ({ input, signal }) => {
1606
1596
  return processId(input.isSecondId, "", signal);
1607
1597
  });
1608
1598
  const submitBarcodeActor = fromPromise(async ({ input, signal }) => {
1609
- const [response] = await Promise.all([addBarcode({
1599
+ return addBarcode({
1610
1600
  rawBarcode: input.rawBarcode,
1611
1601
  metrics: input.metrics,
1612
1602
  processId: input.processId,
1613
1603
  signal
1614
- }), input.minDurationMs ? sleep(input.minDurationMs) : Promise.resolve()]);
1615
- return response;
1604
+ });
1616
1605
  });
1617
1606
  const startRecordingActor = fromPromise(async ({ input }) => {
1618
1607
  if (!input.stream) return;
@@ -1626,7 +1615,7 @@ const startRecordingActor = fromPromise(async ({ input }) => {
1626
1615
  });
1627
1616
  const initializeDeepsightSessionActor = fromPromise(async ({ input }) => {
1628
1617
  if (!input.dependencies) return;
1629
- const { loadDeepsightSession } = await import("./deepsightLoader-Be2xONxN.esm.js");
1618
+ const { loadDeepsightSession } = await import("./deepsightLoader-BCxEZjuI.esm.js");
1630
1619
  return loadDeepsightSession({
1631
1620
  ds: input.ds,
1632
1621
  storage: input.dependencies.storage,
@@ -1700,7 +1689,6 @@ function getResetContextValues(context) {
1700
1689
  captureOnlyImages: {},
1701
1690
  uploadResponse: void 0,
1702
1691
  decodedBarcode: null,
1703
- barcodeFastPathAttempted: false,
1704
1692
  recordingSession: void 0,
1705
1693
  attemptsRemaining: context.config.captureAttempts,
1706
1694
  expiredAttempts: 0,
@@ -2082,7 +2070,6 @@ const idCaptureMachine = setup({
2082
2070
  storeCapturedImage: assign(({ context, event }) => getStoreCapturedImageValues(context, event)),
2083
2071
  storeBarcodeResponse: assign(({ context, event }) => getBarcodeResponseValues(context, event)),
2084
2072
  storeDecodedBarcode: assign({ decodedBarcode: ({ event }) => event.decoded }),
2085
- setBarcodeFastPathAttempted: assign({ barcodeFastPathAttempted: true }),
2086
2073
  setDetectionStatus: assign({ detectionStatus: ({ event, context }) => getDetectionStatusFromUpdate(context, event) }),
2087
2074
  setCounterValue: assign({ counterValue: ({ event }) => {
2088
2075
  if ("value" in event) return event.value;
@@ -2161,7 +2148,6 @@ const idCaptureMachine = setup({
2161
2148
  wasExpiredFromUpload: wasExpiredFromUploadGuard,
2162
2149
  shouldSkipProcessId: shouldSkipProcessIdGuard,
2163
2150
  shouldSubmitBarcode: shouldSubmitBarcodeGuard,
2164
- canRunBarcodeFastPath: canRunBarcodeFastPathGuard,
2165
2151
  isProcessingExpiredExhausted: isProcessingExpiredExhaustedGuard,
2166
2152
  shouldProcessAfterExhaustion: shouldProcessAfterExhaustionGuard,
2167
2153
  forceFinishAfterProcessing: forceFinishAfterProcessingGuard,
@@ -2192,7 +2178,6 @@ const idCaptureMachine = setup({
2192
2178
  captureOnlyImages: {},
2193
2179
  uploadResponse: void 0,
2194
2180
  decodedBarcode: null,
2195
- barcodeFastPathAttempted: false,
2196
2181
  recordingSession: void 0,
2197
2182
  attemptsRemaining: input.config.captureAttempts,
2198
2183
  expiredAttempts: 0,
@@ -2625,11 +2610,7 @@ const idCaptureMachine = setup({
2625
2610
  target: "capturing",
2626
2611
  actions: assign({ qualityElements: ({ event }) => event.qualityElements })
2627
2612
  },
2628
- BARCODE_DECODED: [{
2629
- target: "capturingBarcode",
2630
- guard: "canRunBarcodeFastPath",
2631
- actions: ["storeDecodedBarcode", "setBarcodeFastPathAttempted"]
2632
- }, { actions: "storeDecodedBarcode" }],
2613
+ BARCODE_DECODED: { actions: "storeDecodedBarcode" },
2633
2614
  MANUAL_CAPTURE: { target: "capturingManual" },
2634
2615
  SWITCH_TO_MANUAL_CAPTURE: {
2635
2616
  target: "manualCaptureWaiting",
@@ -2683,29 +2664,6 @@ const idCaptureMachine = setup({
2683
2664
  },
2684
2665
  onError: { target: "uploading" }
2685
2666
  } },
2686
- capturingBarcode: {
2687
- entry: [
2688
- "captureImage",
2689
- "storeCapturedCanvasInProvider",
2690
- "storeCapturedImage"
2691
- ],
2692
- always: [{ target: "submittingBarcodePreCapture" }]
2693
- },
2694
- submittingBarcodePreCapture: { invoke: {
2695
- id: "submitBarcode",
2696
- src: "submitBarcode",
2697
- input: ({ context }) => ({
2698
- rawBarcode: context.decodedBarcode?.text ?? "",
2699
- metrics: context.decodedBarcode,
2700
- processId: true,
2701
- minDurationMs: 1e3
2702
- }),
2703
- onDone: {
2704
- target: "success",
2705
- actions: "storeBarcodeResponse"
2706
- },
2707
- onError: { target: "detecting" }
2708
- } },
2709
2667
  capturingManual: {
2710
2668
  entry: [
2711
2669
  "captureLatestFrame",