import "./StateMachine-EDpYWy0i.js"; import "./Actor-iTq7YY48.js"; import { t as CameraStream } from "./camera-9wWD-pwg.js"; import { t as DetectionOrientation } from "./IIdCaptureCapability-DHTT3FC2.js"; import { n as FinishStatus } from "./flowCompletionService-BlAHsKyv.js"; import { a as FacingMode, i as CameraCompositor, n as VideoSelfieDetectionStatus, r as VideoSelfieValidationFailure, s as VideoSelfieStep, t as StepDetector } from "./videoSelfieStepDetector-D3oo2ofo.js"; //#region src/modules/id-selfie-flow/types.d.ts /** * The capture steps an ID + Selfie flow session can run, in flow order. A * strict subset of {@link VideoSelfieStep} so the Video Selfie UI overlays * (steps header, ID/selfie masks) can be reused as-is. */ type IdSelfieFlowStep = Extract; /** * Configuration for the ID + Selfie flow PoC module. * * The module runs the REGULAR onboarding capture pipeline (ID front/back → * `add/front-id` / `add/back-id` → `process/id`, selfie → `add/face` → * `process/face`) behind the Video Selfie single-session UX: one continuous * camera experience that switches facing between the ID and selfie steps. * Nothing is recorded and no microphone access is requested. */ type IdSelfieFlowConfig = { /** Show the instructions tutorial before capture begins. @default false */ showTutorials?: boolean; /** * Validation attempts per capture step before the session fails. * `-1` means unlimited. @default 3 */ numberOfTries?: number; /** Reject selfies wearing glasses. @default false */ validateLenses?: boolean; /** Reject selfies wearing a face mask. @default false */ validateFaceMask?: boolean; /** Reject selfies with closed eyes. @default false */ validateClosedEyes?: boolean; /** Reject selfies wearing head cover. @default false */ validateHeadCover?: boolean; /** Optional queue name forwarded to `POST /omni/process/id`. */ processIdQueueName?: string; /** * Override the capture steps. Defaults to the full * `frontId → backId → selfie` sequence. */ steps?: IdSelfieFlowStep[]; }; //#endregion //#region src/modules/id-selfie-flow/idSelfieFlowStateMachine.d.ts type IdSelfieFlowDependencies = { createCompositor?: () => CameraCompositor; acquireCamera?: (facingMode: FacingMode, withAudio: boolean) => Promise; /** Runs WASM detection + regular-endpoint upload per step; resolves to advance. */ detect?: StepDetector; /** Calls `POST /omni/process/id` once the last ID side is accepted. */ runProcessId?: (queueName: string, signal: AbortSignal) => Promise; /** Fetches `GET /omni/finish-status` once the last step is accepted. */ runFinish?: (signal: AbortSignal) => Promise; /** Minimum time to hold the switching-camera screen before resuming capture. */ switchingCameraMinDwellMs?: number; }; //#endregion //#region src/modules/id-selfie-flow/idSelfieFlowActor.d.ts type CreateIdSelfieFlowActorOptions = { /** Module config; its flags determine the active steps + selfie validations. */ config?: IdSelfieFlowConfig; dependencies?: IdSelfieFlowDependencies; }; //#endregion //#region src/modules/id-selfie-flow/idSelfieFlowManager.d.ts type IdSelfieFlowStatus = 'idle' | 'starting' | 'capturing' | 'validationFeedback' | 'flippingId' | 'processingId' | 'switchingCamera' | 'finishing' | 'success' | 'finished' | 'error' | 'closed'; type IdSelfieFlowState = { /** Current lifecycle status. */ status: IdSelfieFlowStatus; /** The active capture step (e.g. `frontId`, `selfie`). */ step: IdSelfieFlowStep | undefined; /** Zero-based index of the active step. */ stepIndex: number; /** Whether the active step is the last one. */ isLastStep: boolean; /** The active source camera (raw, per-step facing) driving detection. */ stream: MediaStream | undefined; /** * THE session stream: a single composited stream that lives for the whole * session and follows camera switches without ever being interrupted or * killed between steps. Bind the live preview to this one. */ composite: MediaStream | undefined; /** Live per-step detection feedback (e.g. `tooFar`, `blur`, `detecting`). */ detectionStatus: VideoSelfieDetectionStatus | undefined; /** * Live document orientation from the ID detector — the mask follows a * rotated ID exactly like the standalone ID module's overlay. */ orientation: DetectionOrientation | undefined; /** * Autocapture timed out on the active ID step — show a capture button * wired to `manualCapture()`. Sticky until the step advances. */ manualCaptureAvailable: boolean; /** Validation failure shown during the current retry dwell. */ validationFailure: VideoSelfieValidationFailure | undefined; /** Remaining validation attempts for the active step; `-1` means unlimited. */ attemptsRemaining: number; /** * The session's finish status (`GET /omni/finish-status`), available from * `success` onward. */ finishStatus: FinishStatus | undefined; /** Failure detail, set when `status === 'error'`. */ error: string | undefined; }; /** * Creates a manager for the ID + Selfie flow PoC: the regular ID front/back + * selfie capture pipeline (regular endpoints, regular validations) presented * through the Video Selfie continuous-camera UX. No recording, no microphone. * * Exposes `getState()` / `subscribe()` (status, step, preview `stream`) plus * `start()`, `nextStep()`, `retry()`, and `abort()`. */ declare function createIdSelfieFlowManager(options?: CreateIdSelfieFlowActorOptions): { stop(): void; getState(): IdSelfieFlowState; subscribe(listener: (state: IdSelfieFlowState) => void): () => void; /** Acquire the first camera and begin the capture session. */ start(): void; retry(): void; /** * Advance to the next step (manual steps only — the capture steps * auto-advance once the backend accepts the frame). */ nextStep(): void; /** * Capture + upload the current ID frame. Meaningful once * `manualCaptureAvailable` is `true` (autocapture timed out). */ manualCapture(): void; /** Abandon the session. */ abort(): void; }; type IdSelfieFlowManager = ReturnType; //#endregion //#region src/modules/id-selfie-flow/idSelfieFlowWasm.d.ts /** * Warms the WASM pipelines the ID + Selfie flow needs. Idempotent and safe to * call eagerly (e.g. while the tutorial or permissions screen is up). No-op * when WASM was not configured. */ declare function warmupIdSelfieFlowWasm(config: IdSelfieFlowConfig): Promise; //#endregion //#region src/modules/id-selfie-flow/idSelfieFlowDashboardConfig.d.ts type ResolveIdSelfieFlowConfigOptions = { /** * Partial config that wins over the flow-derived values (e.g. a host * forcing `showTutorials`). Keys set to `undefined` are ignored. */ config?: IdSelfieFlowConfig; signal?: AbortSignal; }; /** * Derives the ID + Selfie flow config from the active session's FLOW * configuration — the same dashboard config the regular ID and SELFIE modules * read. Requires an active session token (`initializeSession`). * * Mapping: * - Steps: `frontId`/`backId` when the flow has an ID module (`onlyFront` / * `onlyBack` respected), `selfie` when it has a SELFIE module. * - `showTutorials`: either module's `showTutorial`. * - `numberOfTries`: the larger of the two modules' `captureAttempts`. * - Selfie validations (`validateLenses` / mask / eyes / head cover): from * the SELFIE module config. * * A module missing from the flow simply drops its steps; if neither module is * present the promise rejects. Any `options.config` values win over the * derived ones. If the flow cannot be fetched but `options.config` was * provided, it is returned as-is (standalone fallback). */ declare function resolveIdSelfieFlowConfig(options?: ResolveIdSelfieFlowConfigOptions): Promise; //#endregion export { type CreateIdSelfieFlowActorOptions, type IdSelfieFlowConfig, type IdSelfieFlowManager, type IdSelfieFlowState, type IdSelfieFlowStatus, type IdSelfieFlowStep, createIdSelfieFlowManager, resolveIdSelfieFlowConfig, warmupIdSelfieFlowWasm };