@sekyro/web 0.1.0-rc.25 → 0.1.0-rc.26

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 (51) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/{capture-session-doc-O33KRXH7.js → capture-session-doc-WZMI5XPE.js} +1 -1
  3. package/dist/{capture-session-v3-BoGn8vLv.d.cts → capture-session-v3-BKSjJ6L0.d.cts} +1 -1
  4. package/dist/{capture-session-v3-C0bbHvDc.d.ts → capture-session-v3-C1I_GLC9.d.ts} +1 -1
  5. package/dist/{chunk-MXWLCDFX.js → chunk-4DEPREJ3.js} +1 -1
  6. package/dist/{chunk-DIKSFEYQ.js → chunk-65JZHKVG.js} +1 -1
  7. package/dist/{chunk-24F6JCVH.js → chunk-7MZW3FFH.js} +1 -1
  8. package/dist/chunk-DVTK2DGX.js +1 -0
  9. package/dist/chunk-GPFAPAS6.js +3 -0
  10. package/dist/{chunk-EHKCOBE2.js → chunk-LLX2CKZ3.js} +1 -1
  11. package/dist/chunk-LV23FCYP.js +1 -0
  12. package/dist/{chunk-TDLIXFDT.js → chunk-NFHLJOHW.js} +1 -1
  13. package/dist/{chunk-J4S3QMK6.js → chunk-OVP7FAMJ.js} +1 -1
  14. package/dist/{chunk-7HV77AOV.js → chunk-XOTKATN6.js} +1 -1
  15. package/dist/{chunk-4ESM6SSR.js → chunk-ZCW6PNUX.js} +1 -1
  16. package/dist/client/index.cjs +1 -1
  17. package/dist/client/index.d.cts +3 -3
  18. package/dist/client/index.d.ts +3 -3
  19. package/dist/client/index.js +1 -1
  20. package/dist/core/index.cjs +1 -1
  21. package/dist/core/index.d.cts +3 -3
  22. package/dist/core/index.d.ts +3 -3
  23. package/dist/core/index.js +1 -1
  24. package/dist/create-document-capture-OXPLKHOF.js +1 -0
  25. package/dist/{create-verification-DOBYRCV_.d.ts → create-verification-7wPXJN_P.d.ts} +232 -121
  26. package/dist/{create-verification-D5CrT5f5.d.cts → create-verification-YeuI7_B0.d.cts} +232 -121
  27. package/dist/{detector-scanic-YCDNLCGV.js → detector-scanic-23DAYT3H.js} +1 -1
  28. package/dist/{icao-gate-CJPTgKFb.d.ts → icao-gate-BK8TGaCk.d.ts} +1 -1
  29. package/dist/{icao-gate-DGtY696t.d.cts → icao-gate-pD2dUV3P.d.cts} +1 -1
  30. package/dist/{icao-policy-Bm0rG91t.d.cts → icao-policy-CdR6PFHS.d.cts} +2 -2
  31. package/dist/{icao-policy-D8domgld.d.ts → icao-policy-qJpZOOOu.d.ts} +2 -2
  32. package/dist/index.cjs +3 -3
  33. package/dist/index.d.cts +9 -9
  34. package/dist/index.d.ts +9 -9
  35. package/dist/index.js +1 -1
  36. package/dist/internal/index.cjs +3 -3
  37. package/dist/internal/index.d.cts +68 -64
  38. package/dist/internal/index.d.ts +68 -64
  39. package/dist/internal/index.js +1 -1
  40. package/dist/plan-runner-EP26JU6A.js +1 -0
  41. package/dist/{types-ZBcpvLdo.d.ts → types-DB-cZTSn.d.cts} +127 -11
  42. package/dist/{types-ZBcpvLdo.d.cts → types-DB-cZTSn.d.ts} +127 -11
  43. package/dist/upload-file-EGXXM6TQ.js +1 -0
  44. package/package.json +1 -1
  45. package/sbom.cdx.json +10 -10
  46. package/dist/chunk-6XXMWK72.js +0 -1
  47. package/dist/chunk-GLXOSYBH.js +0 -3
  48. package/dist/chunk-MGO2ME5X.js +0 -1
  49. package/dist/create-document-capture-OLKNUVTU.js +0 -1
  50. package/dist/plan-runner-VKPRZ3AD.js +0 -1
  51. package/dist/upload-file-UYXOHCRG.js +0 -1
@@ -1,11 +1,73 @@
1
- import { b2 as DocCatalogEntry, b3 as LiveMrzTuning, b4 as TextLockTuning, b5 as OcrEngineClient, b6 as DocAssistReport, b7 as ReadyInfo, b8 as LoadFailure, b9 as OcrEngineOptions, ba as SubmitRuntime, a4 as LivenessCaptureOptions, a3 as LivenessCaptureHandle, aN as VerificationStep, aL as VerificationResult, aC as StepSnapshot, $ as LivePhotoGateUpdate, bb as HostedClientLike } from '../create-verification-D5CrT5f5.cjs';
2
- export { bc as ANALYSIS_LONG_EDGE, bd as ASPECT_BANDS, be as AttestationError, bf as BLUR_REFUSE_SHARPNESS_MAX, bg as BlurStatus, bh as CAPTURE_CANDIDATE_SPACING_MS, bi as CAPTURE_EXTRA_CANDIDATES, bj as CHALLENGE_EXECUTE_TIMEOUT_MS, bk as CHALLENGE_READY_TIMEOUT_MS, bl as CLIP_MIME_ALLOWLIST, bm as CaptureEngine, bn as CaptureSessionDoc, bo as CaptureSessionDocEvents, bp as CaptureSessionDocOptions, bq as ChallengeAction, br as ChallengeError, m as ChallengeErrorCode, bs as DOC_ANALYSIS_DEFAULTS, bt as DOC_BLACK_FRAME_LUMA, bu as DOC_BLACK_FRAME_TICKS, bv as DOC_CADENCE_HZ, bw as DOC_CAMERA_TUNING_DEFAULTS, bx as DOC_CATALOG, by as DOC_DETECT_WIDTH, bz as DOC_FEEDBACK_STATES, bA as DOC_FIRST_FRAME_MS, bB as DOC_GATE_V1_DEFAULTS, bC as DOC_SHUTTER_DEFAULTS, bD as DeviceReadHint, bE as DocArtifacts, bF as DocAssist, bG as DocAssistEngine, bH as DocAssistTick, bI as DocCameraTuning, bJ as DocCaptureReport, bK as DocCaptureVia, bL as DocChecksPayload, bM as DocEngineLike, bN as DocFeedbackAggregator, bO as DocFeedbackKey, bP as DocFeedbackState, bQ as DocFormat, bR as DocFrameAnalysis, bS as DocFrameMeasures, bT as DocGateQuality, bU as DocGateThresholds, bV as DocGateTick, bW as DocGateTickInput, bX as DocGateV1, bY as DocQuad, bZ as DocQuadPoint, b_ as DocShutterReason, b$ as DocShutterTuning, c0 as DocSide, c1 as DocumentCaptureController, c2 as DocumentCaptureInternals, c3 as EMPTY_GUIDE_METRICS, c4 as EncodedDocument, c5 as ExecuteChallengeOptions, c6 as FLIP_FILL_MIN, c7 as FLIP_GAP_MS, c8 as FLIP_TIMEOUT_MS, c9 as FocusCaps, ca as FramingStatus, cb as GUIDE_LOCK_DEFAULTS, cc as GlareStatus, cd as GrabbedFrame, ce as GuideBlocker, cf as GuideLock, cg as GuideLockTick, ch as GuideLockTuning, ci as GuideMetrics, cj as GuideRect, ck as INFERENCE_RETRY_ATTEMPTS, cl as INFERENCE_RETRY_DEFAULT_S, X as ISSUER_CODES, cm as LANDMARKER_MODEL, cn as LENS_STORAGE_KEY, co as LIVE_MRZ_DEFAULTS, cp as LIVE_PHOTO_IDLE_MS, cq as LIVE_PHOTO_MAX_HZ, cr as LandmarkedFace, cs as LandmarkerLike, ct as LensSource, cu as LightingStatus, cv as LiveMrzCapture, cw as LiveMrzState, cx as LivePhotoGate, cy as LivePhotoKit, cz as LivePhotoKitInternals, cA as LivePhotoKitOptions, cB as LivePhotoStill, cC as LivenessCaptureInternalHandle, cD as LivenessCaptureInternals, cE as LivenessFlowDeps, cF as LivenessFlowOutcome, cG as MANUAL_SHUTTER_MS, cH as MR_DOC_CATALOG, cI as NO_REPORT_MS, cJ as OpenDocCameraDeps, cK as PORTRAIT_JPEG_QUALITY, cL as PRELOAD_BLAZE_INIT_TIMEOUT_MS, cM as PRELOAD_BUDGET_MS, cN as PROCESSING_POLL_DELAY_MS, cO as PROCESSING_POLL_MAX, cP as PortraitCaptureController, cQ as PortraitCaptureInternals, cR as REGISTRY_RETRY_DELAY_MS, cS as ReticleType, cT as SAME_FACE_MAX_DROPS, cU as ScanEvent, cV as ScanLayout, cW as ScanNotice, cX as ScanPhase, cY as ScanReport, cZ as ScanSide, c_ as ScanState, c$ as SubmitExecutor, d0 as TEXT_LOCK_DEFAULTS, d1 as TRANSPORT_REPLAY_ATTEMPTS, d2 as TRANSPORT_REPLAY_DELAY_MS, d3 as VerificationInternals, d4 as analyzeDocFrame, d5 as analyzeGuide, d6 as aspectBand, d7 as aspectFits, d8 as buildDeviceReadHint, d9 as coverPointToVideo, da as createDocumentCaptureInternal, db as createFaceLandmarker, dc as createLivePhotoKit, dd as createLivenessCaptureInternal, de as createPortraitCaptureInternal, df as createVerificationInternal, dg as docZoomFor, dh as encodeDocumentImage, di as executeChallenge, dj as facesOf, dk as feedbackVoteOf, dl as focusOk, dm as guideQuad, dn as guideRegionInFrame, dp as initialScanState, dq as mapEngineState, dr as mapErrorKind, ds as mapGuidanceHint, dt as nextScanState, du as observePortraitFrame, dv as openDocCamera, dw as passportBandOf, dx as portraitMatchStep, dy as preloadedDetectorFactory, dz as quadAreaFrac, dA as quadBounds, dB as quadIou, dC as quadTiltRatio, dD as randomUuid, dE as readStoredLens, dF as resetChallengeFrameForTests, dG as resetLivenessAssetsForTests, dH as resolveDocCameraTuning, dI as resolveDocShutterTuning, dJ as resolveGuideLockTuning, dK as runLivenessFlow, dL as runSubmission, dM as scannerFormatFor, dN as setPreloadLoaderForTests, dO as settledHint, dP as singleShotFocusAt, dQ as specularFraction, dR as supportsFocusMode, dS as warmDocDetector, dT as writeStoredLens } from '../create-verification-D5CrT5f5.cjs';
1
+ import { b5 as SubmitRuntime, a4 as LivenessCaptureOptions, a3 as LivenessCaptureHandle, aQ as VerificationStep, aO as VerificationResult, aF as StepSnapshot, $ as LivePhotoGateUpdate, b6 as HostedClientLike, b7 as DocCatalogEntry, b8 as LiveMrzTuning, b9 as TextLockTuning, ba as OcrEngineClient, bb as DocAssistReport, bc as ReadyInfo, bd as LoadFailure, be as OcrEngineOptions } from '../create-verification-YeuI7_B0.cjs';
2
+ export { bf as ANALYSIS_LONG_EDGE, bg as ASPECT_BANDS, bh as AttestationError, bi as BLUR_REFUSE_SHARPNESS_MAX, bj as BlurStatus, bk as CAPTURE_CANDIDATE_SPACING_MS, bl as CAPTURE_EXTRA_CANDIDATES, bm as CHALLENGE_EXECUTE_TIMEOUT_MS, bn as CHALLENGE_READY_TIMEOUT_MS, bo as CLIP_MIME_ALLOWLIST, bp as CaptureEngine, bq as CaptureSessionDoc, br as CaptureSessionDocEvents, bs as CaptureSessionDocOptions, bt as ChallengeAction, bu as ChallengeError, m as ChallengeErrorCode, bv as DOC_ANALYSIS_DEFAULTS, bw as DOC_BLACK_FRAME_LUMA, bx as DOC_BLACK_FRAME_TICKS, by as DOC_CADENCE_HZ, bz as DOC_CAMERA_TUNING_DEFAULTS, bA as DOC_CATALOG, bB as DOC_DETECT_WIDTH, bC as DOC_FEEDBACK_STATES, bD as DOC_FIRST_FRAME_MS, bE as DOC_GATE_V1_DEFAULTS, bF as DOC_SHUTTER_DEFAULTS, bG as DeviceReadHint, bH as DocArtifacts, bI as DocAssist, bJ as DocAssistEngine, bK as DocAssistTick, bL as DocCameraTuning, bM as DocCaptureReport, bN as DocCaptureVia, bO as DocChecksPayload, bP as DocEngineLike, bQ as DocFeedbackAggregator, bR as DocFeedbackKey, bS as DocFeedbackState, bT as DocFormat, bU as DocFrameAnalysis, bV as DocFrameMeasures, bW as DocGateQuality, bX as DocGateThresholds, bY as DocGateTick, bZ as DocGateTickInput, b_ as DocGateV1, b$ as DocQuad, c0 as DocQuadPoint, c1 as DocShutterReason, c2 as DocShutterTuning, c3 as DocSide, c4 as DocumentCaptureController, c5 as DocumentCaptureInternals, c6 as EMPTY_GUIDE_METRICS, c7 as EncodedDocument, c8 as ExecuteChallengeOptions, c9 as FLIP_FILL_MIN, ca as FLIP_GAP_MS, cb as FLIP_TIMEOUT_MS, cc as FocusCaps, cd as FramingStatus, ce as GUIDE_LOCK_DEFAULTS, cf as GlareStatus, cg as GrabbedFrame, ch as GuideBlocker, ci as GuideLock, cj as GuideLockTick, ck as GuideLockTuning, cl as GuideMetrics, cm as GuideRect, cn as INFERENCE_RETRY_ATTEMPTS, co as INFERENCE_RETRY_DEFAULT_S, X as ISSUER_CODES, cp as LANDMARKER_MODEL, cq as LENS_STORAGE_KEY, cr as LIVE_MRZ_DEFAULTS, cs as LIVE_PHOTO_IDLE_MS, ct as LIVE_PHOTO_MAX_HZ, cu as LandmarkedFace, cv as LandmarkerLike, cw as LensSource, cx as LightingStatus, cy as LiveMrzCapture, cz as LiveMrzState, cA as LivePhotoGate, cB as LivePhotoKit, cC as LivePhotoKitInternals, cD as LivePhotoKitOptions, cE as LivePhotoStill, cF as LivenessCaptureInternalHandle, cG as LivenessCaptureInternals, cH as LivenessFlowDeps, cI as LivenessFlowOutcome, cJ as MANUAL_SHUTTER_MS, cK as MR_DOC_CATALOG, cL as NO_REPORT_MS, cM as OpenDocCameraDeps, cN as PORTRAIT_JPEG_QUALITY, cO as PRELOAD_BLAZE_INIT_TIMEOUT_MS, cP as PRELOAD_BUDGET_MS, cQ as PROCESSING_POLL_DELAY_MS, cR as PROCESSING_POLL_MAX, cS as PortraitCaptureController, cT as PortraitCaptureInternals, cU as REGISTRY_RETRY_DELAY_MS, cV as ReticleType, cW as SAME_FACE_MAX_DROPS, cX as ScanEvent, cY as ScanLayout, cZ as ScanNotice, c_ as ScanPhase, c$ as ScanReport, d0 as ScanSide, d1 as ScanState, d2 as SubmitExecutor, d3 as TEXT_LOCK_DEFAULTS, d4 as TRANSPORT_REPLAY_ATTEMPTS, d5 as TRANSPORT_REPLAY_DELAY_MS, d6 as VerificationInternals, d7 as analyzeDocFrame, d8 as analyzeGuide, d9 as aspectBand, da as aspectFits, db as buildDeviceReadHint, dc as coverPointToVideo, dd as createDocumentCaptureInternal, de as createFaceLandmarker, df as createLivePhotoKit, dg as createLivenessCaptureInternal, dh as createPortraitCaptureInternal, di as createVerificationInternal, dj as docZoomFor, dk as encodeDocumentImage, dl as executeChallenge, dm as facesOf, dn as feedbackVoteOf, dp as focusOk, dq as guideQuad, dr as guideRegionInFrame, ds as initialScanState, dt as mapEngineState, du as mapErrorKind, dv as mapGuidanceHint, dw as nextScanState, dx as observePortraitFrame, dy as openDocCamera, dz as passportBandOf, dA as portraitMatchStep, dB as preloadedDetectorFactory, dC as quadAreaFrac, dD as quadBounds, dE as quadIou, dF as quadTiltRatio, dG as randomUuid, dH as readStoredLens, dI as resetChallengeFrameForTests, dJ as resetLivenessAssetsForTests, dK as resolveDocCameraTuning, dL as resolveDocShutterTuning, dM as resolveGuideLockTuning, dN as runLivenessFlow, dO as runSubmission, dP as scannerFormatFor, dQ as setPreloadLoaderForTests, dR as settledHint, dS as singleShotFocusAt, dT as specularFraction, dU as supportsFocusMode, dV as warmDocDetector, dW as writeStoredLens } from '../create-verification-YeuI7_B0.cjs';
3
3
  export { C as CENTERED_FACTOR, a as CIRCLE_RADIUS_FACTOR, F as FormFactor, I as IN_CIRCLE_FACTOR, d as detectFormFactor, c as detectIsMobile } from '../capture-constraints-CVqpMNGA.cjs';
4
- import { T as HostedSessionView, h as CheckType, ao as PlanStepView } from '../types-ZBcpvLdo.cjs';
5
- export { b0 as ICAO_FALLBACK, aW as IcaoCaptureTuning, b1 as IcaoProfile, b2 as ResolvedIcaoTuning, b3 as resolveIcaoTuning } from '../types-ZBcpvLdo.cjs';
6
- export { B as BackgroundStats, h as Box, C as CLIPPED_LUMA, F as FaceGeometry, i as FaceLighting, c as HeadPose, j as ICAO_CANVAS, k as ICAO_GATE_CRITERIA, l as ICAO_SHARP_REF, I as IcaoCoachKey, d as IcaoCriterionState, m as IcaoFrameObservation, n as IcaoGate, e as IcaoGateCriterion, o as IcaoGateOptions, p as IcaoGateScores, f as IcaoGateSummary, g as IcaoGateUpdate, q as IcaoJudgedCriterion, r as IcaoMeasures, t as IcaoMouthScores, u as IcaoPixelStats, L as LumaPlane, P as Point, R as RegionStats, v as backgroundStats, w as createIcaoGate, x as eyeLineRoll, y as eyeOpenness, z as eyeSpecular, A as faceGeometry, D as faceLighting, E as faceSharpness, G as icaoPixelStats, J as icaoWindow, K as judgeIcao, N as lumaPlane, O as percentile, Q as portraitCropRegion, T as poseFromMatrix, V as regionStats, W as scoreFrame, X as windowOverflow } from '../icao-gate-DGtY696t.cjs';
4
+ import { W as HostedSessionView, h as CheckType, ar as PlanStepView } from '../types-DB-cZTSn.cjs';
5
+ export { bb as ICAO_FALLBACK, b5 as IcaoCaptureTuning, bc as IcaoProfile, bd as ResolvedIcaoTuning, be as resolveIcaoTuning } from '../types-DB-cZTSn.cjs';
6
+ export { B as BackgroundStats, h as Box, C as CLIPPED_LUMA, F as FaceGeometry, i as FaceLighting, c as HeadPose, j as ICAO_CANVAS, k as ICAO_GATE_CRITERIA, l as ICAO_SHARP_REF, I as IcaoCoachKey, d as IcaoCriterionState, m as IcaoFrameObservation, n as IcaoGate, e as IcaoGateCriterion, o as IcaoGateOptions, p as IcaoGateScores, f as IcaoGateSummary, g as IcaoGateUpdate, q as IcaoJudgedCriterion, r as IcaoMeasures, t as IcaoMouthScores, u as IcaoPixelStats, L as LumaPlane, P as Point, R as RegionStats, v as backgroundStats, w as createIcaoGate, x as eyeLineRoll, y as eyeOpenness, z as eyeSpecular, A as faceGeometry, D as faceLighting, E as faceSharpness, G as icaoPixelStats, J as icaoWindow, K as judgeIcao, N as lumaPlane, O as percentile, Q as portraitCropRegion, T as poseFromMatrix, V as regionStats, W as scoreFrame, X as windowOverflow } from '../icao-gate-pD2dUV3P.cjs';
7
7
  import '../detect-worker-CHqsPJoM.cjs';
8
- import '../capture-session-v3-BoGn8vLv.cjs';
8
+ import '../capture-session-v3-BKSjJ6L0.cjs';
9
+
10
+ /** `processing` re-reads (1+2+4+8+15 = 30 s, spec §6.5), then `stalled`. */
11
+ declare const PROCESSING_BACKOFF_MS: readonly number[];
12
+ /** Hosted parity: a resend is offered 30 s after the last send. */
13
+ declare const OTP_RESEND_COOLDOWN_MS = 30000;
14
+ type Executor = (client: HostedClientLike, idempotencyKey: string) => Promise<HostedSessionView>;
15
+ interface RunnerDeps {
16
+ runtime: SubmitRuntime;
17
+ currentView(): HostedSessionView | null;
18
+ ensureView(): Promise<HostedSessionView>;
19
+ refreshView(): Promise<HostedSessionView>;
20
+ ensureConsent(): Promise<void>;
21
+ liveness(options: LivenessCaptureOptions): LivenessCaptureHandle;
22
+ /** A liveness submission chain is in flight (do not flip the UI mid-upload). */
23
+ chainBusy(): boolean;
24
+ destroyed(): boolean;
25
+ sleep(ms: number): Promise<void>;
26
+ isMobile(): boolean;
27
+ now(): number;
28
+ emitStep(step: VerificationStep): void;
29
+ emitResult(result: VerificationResult): void;
30
+ /**
31
+ * The promoted face_match probe key of the last liveness submission (profile
32
+ * v2 §4.4 wrong-number re-entry): after the re-entered NNI passes, the
33
+ * `pending` face_match is resubmitted with it — no new capture. `null` when
34
+ * no liveness was submitted from this page (e.g. after a reload).
35
+ */
36
+ keptFaceKey?(): string | null;
37
+ /** Task 4: binds the document step (selectDocument + capture). */
38
+ bindDocument?(snapshot: Extract<StepSnapshot, {
39
+ kind: "document";
40
+ }>, republish: () => void): VerificationStep;
41
+ /** SDK spec §4.9: binds the ICAO portrait step (capture + portrait_icao / face_match submissions). */
42
+ bindPortrait?(snapshot: Extract<StepSnapshot, {
43
+ kind: "portrait";
44
+ }>, republish: () => void): VerificationStep;
45
+ /** Spec 2026-11-10 §7.4: binds the proof of address step (uploads, the page camera, `poa` submissions). */
46
+ bindProofOfAddress?(snapshot: Extract<StepSnapshot, {
47
+ kind: "proof_of_address";
48
+ }>, republish: () => void): VerificationStep;
49
+ /** Commit a view an action answered (flow model 2026-10-23); absent → re-read the view. */
50
+ setView?(view: HostedSessionView): void;
51
+ /** Step 3 one capture: the ICAO coaching of the running live-photo capture. */
52
+ onLivePhoto?(handler: (gate: LivePhotoGateUpdate) => void): () => void;
53
+ /** Stops every camera of the session (a skipped capture in a simulated session). */
54
+ stopCameras?(): void;
55
+ }
56
+ interface StepRunner {
57
+ run(): Promise<VerificationStep>;
58
+ current(): VerificationStep | null;
59
+ /** Called by the verification on every view update. */
60
+ onView(view: HostedSessionView): void;
61
+ /** Called when the liveness chain becomes idle. */
62
+ onChainIdle(): void;
63
+ /** Re-derive from the current view and publish even if unchanged (local overlay changed). */
64
+ republish(): void;
65
+ /** Submit one step input (exposed for the document binding, Task 4). */
66
+ submit(checkType: CheckType, executor: Executor, onAccepted?: () => void): Promise<void>;
67
+ /** "Skip with test data" answered the liveness or the portrait on this page: a following match has no probe. */
68
+ faceProbeSkipped(): boolean;
69
+ }
70
+ declare function createStepRunner(deps: RunnerDeps): StepRunner;
9
71
 
10
72
  /** At most this many ranked lenses are tried (each costs a camera reopen). */
11
73
  declare const LENS_TRY_MAX = 3;
@@ -273,64 +335,6 @@ declare const OCR_ASSET_SET: {
273
335
  };
274
336
  };
275
337
 
276
- /** `processing` re-reads (1+2+4+8+15 = 30 s, spec §6.5), then `stalled`. */
277
- declare const PROCESSING_BACKOFF_MS: readonly number[];
278
- /** Hosted parity: a resend is offered 30 s after the last send. */
279
- declare const OTP_RESEND_COOLDOWN_MS = 30000;
280
- type Executor = (client: HostedClientLike, idempotencyKey: string) => Promise<HostedSessionView>;
281
- interface RunnerDeps {
282
- runtime: SubmitRuntime;
283
- currentView(): HostedSessionView | null;
284
- ensureView(): Promise<HostedSessionView>;
285
- refreshView(): Promise<HostedSessionView>;
286
- ensureConsent(): Promise<void>;
287
- liveness(options: LivenessCaptureOptions): LivenessCaptureHandle;
288
- /** A liveness submission chain is in flight (do not flip the UI mid-upload). */
289
- chainBusy(): boolean;
290
- destroyed(): boolean;
291
- sleep(ms: number): Promise<void>;
292
- isMobile(): boolean;
293
- now(): number;
294
- emitStep(step: VerificationStep): void;
295
- emitResult(result: VerificationResult): void;
296
- /**
297
- * The promoted face_match probe key of the last liveness submission (profile
298
- * v2 §4.4 wrong-number re-entry): after the re-entered NNI passes, the
299
- * `pending` face_match is resubmitted with it — no new capture. `null` when
300
- * no liveness was submitted from this page (e.g. after a reload).
301
- */
302
- keptFaceKey?(): string | null;
303
- /** Task 4: binds the document step (selectDocument + capture). */
304
- bindDocument?(snapshot: Extract<StepSnapshot, {
305
- kind: "document";
306
- }>, republish: () => void): VerificationStep;
307
- /** SDK spec §4.9: binds the ICAO portrait step (capture + portrait_icao / face_match submissions). */
308
- bindPortrait?(snapshot: Extract<StepSnapshot, {
309
- kind: "portrait";
310
- }>, republish: () => void): VerificationStep;
311
- /** Commit a view an action answered (flow model 2026-10-23); absent → re-read the view. */
312
- setView?(view: HostedSessionView): void;
313
- /** Step 3 one capture: the ICAO coaching of the running live-photo capture. */
314
- onLivePhoto?(handler: (gate: LivePhotoGateUpdate) => void): () => void;
315
- /** Stops every camera of the session (a skipped capture in a simulated session). */
316
- stopCameras?(): void;
317
- }
318
- interface StepRunner {
319
- run(): Promise<VerificationStep>;
320
- current(): VerificationStep | null;
321
- /** Called by the verification on every view update. */
322
- onView(view: HostedSessionView): void;
323
- /** Called when the liveness chain becomes idle. */
324
- onChainIdle(): void;
325
- /** Re-derive from the current view and publish even if unchanged (local overlay changed). */
326
- republish(): void;
327
- /** Submit one step input (exposed for the document binding, Task 4). */
328
- submit(checkType: CheckType, executor: Executor, onAccepted?: () => void): Promise<void>;
329
- /** "Skip with test data" answered the liveness or the portrait on this page: a following match has no probe. */
330
- faceProbeSkipped(): boolean;
331
- }
332
- declare function createStepRunner(deps: RunnerDeps): StepRunner;
333
-
334
338
  /** A check the browser may still submit. */
335
339
  declare function isExecutable(step: Pick<PlanStepView, "state"> | undefined): boolean;
336
340
  /** The session accepts no further submissions. */
@@ -1,11 +1,73 @@
1
- import { b2 as DocCatalogEntry, b3 as LiveMrzTuning, b4 as TextLockTuning, b5 as OcrEngineClient, b6 as DocAssistReport, b7 as ReadyInfo, b8 as LoadFailure, b9 as OcrEngineOptions, ba as SubmitRuntime, a4 as LivenessCaptureOptions, a3 as LivenessCaptureHandle, aN as VerificationStep, aL as VerificationResult, aC as StepSnapshot, $ as LivePhotoGateUpdate, bb as HostedClientLike } from '../create-verification-DOBYRCV_.js';
2
- export { bc as ANALYSIS_LONG_EDGE, bd as ASPECT_BANDS, be as AttestationError, bf as BLUR_REFUSE_SHARPNESS_MAX, bg as BlurStatus, bh as CAPTURE_CANDIDATE_SPACING_MS, bi as CAPTURE_EXTRA_CANDIDATES, bj as CHALLENGE_EXECUTE_TIMEOUT_MS, bk as CHALLENGE_READY_TIMEOUT_MS, bl as CLIP_MIME_ALLOWLIST, bm as CaptureEngine, bn as CaptureSessionDoc, bo as CaptureSessionDocEvents, bp as CaptureSessionDocOptions, bq as ChallengeAction, br as ChallengeError, m as ChallengeErrorCode, bs as DOC_ANALYSIS_DEFAULTS, bt as DOC_BLACK_FRAME_LUMA, bu as DOC_BLACK_FRAME_TICKS, bv as DOC_CADENCE_HZ, bw as DOC_CAMERA_TUNING_DEFAULTS, bx as DOC_CATALOG, by as DOC_DETECT_WIDTH, bz as DOC_FEEDBACK_STATES, bA as DOC_FIRST_FRAME_MS, bB as DOC_GATE_V1_DEFAULTS, bC as DOC_SHUTTER_DEFAULTS, bD as DeviceReadHint, bE as DocArtifacts, bF as DocAssist, bG as DocAssistEngine, bH as DocAssistTick, bI as DocCameraTuning, bJ as DocCaptureReport, bK as DocCaptureVia, bL as DocChecksPayload, bM as DocEngineLike, bN as DocFeedbackAggregator, bO as DocFeedbackKey, bP as DocFeedbackState, bQ as DocFormat, bR as DocFrameAnalysis, bS as DocFrameMeasures, bT as DocGateQuality, bU as DocGateThresholds, bV as DocGateTick, bW as DocGateTickInput, bX as DocGateV1, bY as DocQuad, bZ as DocQuadPoint, b_ as DocShutterReason, b$ as DocShutterTuning, c0 as DocSide, c1 as DocumentCaptureController, c2 as DocumentCaptureInternals, c3 as EMPTY_GUIDE_METRICS, c4 as EncodedDocument, c5 as ExecuteChallengeOptions, c6 as FLIP_FILL_MIN, c7 as FLIP_GAP_MS, c8 as FLIP_TIMEOUT_MS, c9 as FocusCaps, ca as FramingStatus, cb as GUIDE_LOCK_DEFAULTS, cc as GlareStatus, cd as GrabbedFrame, ce as GuideBlocker, cf as GuideLock, cg as GuideLockTick, ch as GuideLockTuning, ci as GuideMetrics, cj as GuideRect, ck as INFERENCE_RETRY_ATTEMPTS, cl as INFERENCE_RETRY_DEFAULT_S, X as ISSUER_CODES, cm as LANDMARKER_MODEL, cn as LENS_STORAGE_KEY, co as LIVE_MRZ_DEFAULTS, cp as LIVE_PHOTO_IDLE_MS, cq as LIVE_PHOTO_MAX_HZ, cr as LandmarkedFace, cs as LandmarkerLike, ct as LensSource, cu as LightingStatus, cv as LiveMrzCapture, cw as LiveMrzState, cx as LivePhotoGate, cy as LivePhotoKit, cz as LivePhotoKitInternals, cA as LivePhotoKitOptions, cB as LivePhotoStill, cC as LivenessCaptureInternalHandle, cD as LivenessCaptureInternals, cE as LivenessFlowDeps, cF as LivenessFlowOutcome, cG as MANUAL_SHUTTER_MS, cH as MR_DOC_CATALOG, cI as NO_REPORT_MS, cJ as OpenDocCameraDeps, cK as PORTRAIT_JPEG_QUALITY, cL as PRELOAD_BLAZE_INIT_TIMEOUT_MS, cM as PRELOAD_BUDGET_MS, cN as PROCESSING_POLL_DELAY_MS, cO as PROCESSING_POLL_MAX, cP as PortraitCaptureController, cQ as PortraitCaptureInternals, cR as REGISTRY_RETRY_DELAY_MS, cS as ReticleType, cT as SAME_FACE_MAX_DROPS, cU as ScanEvent, cV as ScanLayout, cW as ScanNotice, cX as ScanPhase, cY as ScanReport, cZ as ScanSide, c_ as ScanState, c$ as SubmitExecutor, d0 as TEXT_LOCK_DEFAULTS, d1 as TRANSPORT_REPLAY_ATTEMPTS, d2 as TRANSPORT_REPLAY_DELAY_MS, d3 as VerificationInternals, d4 as analyzeDocFrame, d5 as analyzeGuide, d6 as aspectBand, d7 as aspectFits, d8 as buildDeviceReadHint, d9 as coverPointToVideo, da as createDocumentCaptureInternal, db as createFaceLandmarker, dc as createLivePhotoKit, dd as createLivenessCaptureInternal, de as createPortraitCaptureInternal, df as createVerificationInternal, dg as docZoomFor, dh as encodeDocumentImage, di as executeChallenge, dj as facesOf, dk as feedbackVoteOf, dl as focusOk, dm as guideQuad, dn as guideRegionInFrame, dp as initialScanState, dq as mapEngineState, dr as mapErrorKind, ds as mapGuidanceHint, dt as nextScanState, du as observePortraitFrame, dv as openDocCamera, dw as passportBandOf, dx as portraitMatchStep, dy as preloadedDetectorFactory, dz as quadAreaFrac, dA as quadBounds, dB as quadIou, dC as quadTiltRatio, dD as randomUuid, dE as readStoredLens, dF as resetChallengeFrameForTests, dG as resetLivenessAssetsForTests, dH as resolveDocCameraTuning, dI as resolveDocShutterTuning, dJ as resolveGuideLockTuning, dK as runLivenessFlow, dL as runSubmission, dM as scannerFormatFor, dN as setPreloadLoaderForTests, dO as settledHint, dP as singleShotFocusAt, dQ as specularFraction, dR as supportsFocusMode, dS as warmDocDetector, dT as writeStoredLens } from '../create-verification-DOBYRCV_.js';
1
+ import { b5 as SubmitRuntime, a4 as LivenessCaptureOptions, a3 as LivenessCaptureHandle, aQ as VerificationStep, aO as VerificationResult, aF as StepSnapshot, $ as LivePhotoGateUpdate, b6 as HostedClientLike, b7 as DocCatalogEntry, b8 as LiveMrzTuning, b9 as TextLockTuning, ba as OcrEngineClient, bb as DocAssistReport, bc as ReadyInfo, bd as LoadFailure, be as OcrEngineOptions } from '../create-verification-7wPXJN_P.js';
2
+ export { bf as ANALYSIS_LONG_EDGE, bg as ASPECT_BANDS, bh as AttestationError, bi as BLUR_REFUSE_SHARPNESS_MAX, bj as BlurStatus, bk as CAPTURE_CANDIDATE_SPACING_MS, bl as CAPTURE_EXTRA_CANDIDATES, bm as CHALLENGE_EXECUTE_TIMEOUT_MS, bn as CHALLENGE_READY_TIMEOUT_MS, bo as CLIP_MIME_ALLOWLIST, bp as CaptureEngine, bq as CaptureSessionDoc, br as CaptureSessionDocEvents, bs as CaptureSessionDocOptions, bt as ChallengeAction, bu as ChallengeError, m as ChallengeErrorCode, bv as DOC_ANALYSIS_DEFAULTS, bw as DOC_BLACK_FRAME_LUMA, bx as DOC_BLACK_FRAME_TICKS, by as DOC_CADENCE_HZ, bz as DOC_CAMERA_TUNING_DEFAULTS, bA as DOC_CATALOG, bB as DOC_DETECT_WIDTH, bC as DOC_FEEDBACK_STATES, bD as DOC_FIRST_FRAME_MS, bE as DOC_GATE_V1_DEFAULTS, bF as DOC_SHUTTER_DEFAULTS, bG as DeviceReadHint, bH as DocArtifacts, bI as DocAssist, bJ as DocAssistEngine, bK as DocAssistTick, bL as DocCameraTuning, bM as DocCaptureReport, bN as DocCaptureVia, bO as DocChecksPayload, bP as DocEngineLike, bQ as DocFeedbackAggregator, bR as DocFeedbackKey, bS as DocFeedbackState, bT as DocFormat, bU as DocFrameAnalysis, bV as DocFrameMeasures, bW as DocGateQuality, bX as DocGateThresholds, bY as DocGateTick, bZ as DocGateTickInput, b_ as DocGateV1, b$ as DocQuad, c0 as DocQuadPoint, c1 as DocShutterReason, c2 as DocShutterTuning, c3 as DocSide, c4 as DocumentCaptureController, c5 as DocumentCaptureInternals, c6 as EMPTY_GUIDE_METRICS, c7 as EncodedDocument, c8 as ExecuteChallengeOptions, c9 as FLIP_FILL_MIN, ca as FLIP_GAP_MS, cb as FLIP_TIMEOUT_MS, cc as FocusCaps, cd as FramingStatus, ce as GUIDE_LOCK_DEFAULTS, cf as GlareStatus, cg as GrabbedFrame, ch as GuideBlocker, ci as GuideLock, cj as GuideLockTick, ck as GuideLockTuning, cl as GuideMetrics, cm as GuideRect, cn as INFERENCE_RETRY_ATTEMPTS, co as INFERENCE_RETRY_DEFAULT_S, X as ISSUER_CODES, cp as LANDMARKER_MODEL, cq as LENS_STORAGE_KEY, cr as LIVE_MRZ_DEFAULTS, cs as LIVE_PHOTO_IDLE_MS, ct as LIVE_PHOTO_MAX_HZ, cu as LandmarkedFace, cv as LandmarkerLike, cw as LensSource, cx as LightingStatus, cy as LiveMrzCapture, cz as LiveMrzState, cA as LivePhotoGate, cB as LivePhotoKit, cC as LivePhotoKitInternals, cD as LivePhotoKitOptions, cE as LivePhotoStill, cF as LivenessCaptureInternalHandle, cG as LivenessCaptureInternals, cH as LivenessFlowDeps, cI as LivenessFlowOutcome, cJ as MANUAL_SHUTTER_MS, cK as MR_DOC_CATALOG, cL as NO_REPORT_MS, cM as OpenDocCameraDeps, cN as PORTRAIT_JPEG_QUALITY, cO as PRELOAD_BLAZE_INIT_TIMEOUT_MS, cP as PRELOAD_BUDGET_MS, cQ as PROCESSING_POLL_DELAY_MS, cR as PROCESSING_POLL_MAX, cS as PortraitCaptureController, cT as PortraitCaptureInternals, cU as REGISTRY_RETRY_DELAY_MS, cV as ReticleType, cW as SAME_FACE_MAX_DROPS, cX as ScanEvent, cY as ScanLayout, cZ as ScanNotice, c_ as ScanPhase, c$ as ScanReport, d0 as ScanSide, d1 as ScanState, d2 as SubmitExecutor, d3 as TEXT_LOCK_DEFAULTS, d4 as TRANSPORT_REPLAY_ATTEMPTS, d5 as TRANSPORT_REPLAY_DELAY_MS, d6 as VerificationInternals, d7 as analyzeDocFrame, d8 as analyzeGuide, d9 as aspectBand, da as aspectFits, db as buildDeviceReadHint, dc as coverPointToVideo, dd as createDocumentCaptureInternal, de as createFaceLandmarker, df as createLivePhotoKit, dg as createLivenessCaptureInternal, dh as createPortraitCaptureInternal, di as createVerificationInternal, dj as docZoomFor, dk as encodeDocumentImage, dl as executeChallenge, dm as facesOf, dn as feedbackVoteOf, dp as focusOk, dq as guideQuad, dr as guideRegionInFrame, ds as initialScanState, dt as mapEngineState, du as mapErrorKind, dv as mapGuidanceHint, dw as nextScanState, dx as observePortraitFrame, dy as openDocCamera, dz as passportBandOf, dA as portraitMatchStep, dB as preloadedDetectorFactory, dC as quadAreaFrac, dD as quadBounds, dE as quadIou, dF as quadTiltRatio, dG as randomUuid, dH as readStoredLens, dI as resetChallengeFrameForTests, dJ as resetLivenessAssetsForTests, dK as resolveDocCameraTuning, dL as resolveDocShutterTuning, dM as resolveGuideLockTuning, dN as runLivenessFlow, dO as runSubmission, dP as scannerFormatFor, dQ as setPreloadLoaderForTests, dR as settledHint, dS as singleShotFocusAt, dT as specularFraction, dU as supportsFocusMode, dV as warmDocDetector, dW as writeStoredLens } from '../create-verification-7wPXJN_P.js';
3
3
  export { C as CENTERED_FACTOR, a as CIRCLE_RADIUS_FACTOR, F as FormFactor, I as IN_CIRCLE_FACTOR, d as detectFormFactor, c as detectIsMobile } from '../capture-constraints-CVqpMNGA.js';
4
- import { T as HostedSessionView, h as CheckType, ao as PlanStepView } from '../types-ZBcpvLdo.js';
5
- export { b0 as ICAO_FALLBACK, aW as IcaoCaptureTuning, b1 as IcaoProfile, b2 as ResolvedIcaoTuning, b3 as resolveIcaoTuning } from '../types-ZBcpvLdo.js';
6
- export { B as BackgroundStats, h as Box, C as CLIPPED_LUMA, F as FaceGeometry, i as FaceLighting, c as HeadPose, j as ICAO_CANVAS, k as ICAO_GATE_CRITERIA, l as ICAO_SHARP_REF, I as IcaoCoachKey, d as IcaoCriterionState, m as IcaoFrameObservation, n as IcaoGate, e as IcaoGateCriterion, o as IcaoGateOptions, p as IcaoGateScores, f as IcaoGateSummary, g as IcaoGateUpdate, q as IcaoJudgedCriterion, r as IcaoMeasures, t as IcaoMouthScores, u as IcaoPixelStats, L as LumaPlane, P as Point, R as RegionStats, v as backgroundStats, w as createIcaoGate, x as eyeLineRoll, y as eyeOpenness, z as eyeSpecular, A as faceGeometry, D as faceLighting, E as faceSharpness, G as icaoPixelStats, J as icaoWindow, K as judgeIcao, N as lumaPlane, O as percentile, Q as portraitCropRegion, T as poseFromMatrix, V as regionStats, W as scoreFrame, X as windowOverflow } from '../icao-gate-CJPTgKFb.js';
4
+ import { W as HostedSessionView, h as CheckType, ar as PlanStepView } from '../types-DB-cZTSn.js';
5
+ export { bb as ICAO_FALLBACK, b5 as IcaoCaptureTuning, bc as IcaoProfile, bd as ResolvedIcaoTuning, be as resolveIcaoTuning } from '../types-DB-cZTSn.js';
6
+ export { B as BackgroundStats, h as Box, C as CLIPPED_LUMA, F as FaceGeometry, i as FaceLighting, c as HeadPose, j as ICAO_CANVAS, k as ICAO_GATE_CRITERIA, l as ICAO_SHARP_REF, I as IcaoCoachKey, d as IcaoCriterionState, m as IcaoFrameObservation, n as IcaoGate, e as IcaoGateCriterion, o as IcaoGateOptions, p as IcaoGateScores, f as IcaoGateSummary, g as IcaoGateUpdate, q as IcaoJudgedCriterion, r as IcaoMeasures, t as IcaoMouthScores, u as IcaoPixelStats, L as LumaPlane, P as Point, R as RegionStats, v as backgroundStats, w as createIcaoGate, x as eyeLineRoll, y as eyeOpenness, z as eyeSpecular, A as faceGeometry, D as faceLighting, E as faceSharpness, G as icaoPixelStats, J as icaoWindow, K as judgeIcao, N as lumaPlane, O as percentile, Q as portraitCropRegion, T as poseFromMatrix, V as regionStats, W as scoreFrame, X as windowOverflow } from '../icao-gate-BK8TGaCk.js';
7
7
  import '../detect-worker-CHqsPJoM.js';
8
- import '../capture-session-v3-C0bbHvDc.js';
8
+ import '../capture-session-v3-C1I_GLC9.js';
9
+
10
+ /** `processing` re-reads (1+2+4+8+15 = 30 s, spec §6.5), then `stalled`. */
11
+ declare const PROCESSING_BACKOFF_MS: readonly number[];
12
+ /** Hosted parity: a resend is offered 30 s after the last send. */
13
+ declare const OTP_RESEND_COOLDOWN_MS = 30000;
14
+ type Executor = (client: HostedClientLike, idempotencyKey: string) => Promise<HostedSessionView>;
15
+ interface RunnerDeps {
16
+ runtime: SubmitRuntime;
17
+ currentView(): HostedSessionView | null;
18
+ ensureView(): Promise<HostedSessionView>;
19
+ refreshView(): Promise<HostedSessionView>;
20
+ ensureConsent(): Promise<void>;
21
+ liveness(options: LivenessCaptureOptions): LivenessCaptureHandle;
22
+ /** A liveness submission chain is in flight (do not flip the UI mid-upload). */
23
+ chainBusy(): boolean;
24
+ destroyed(): boolean;
25
+ sleep(ms: number): Promise<void>;
26
+ isMobile(): boolean;
27
+ now(): number;
28
+ emitStep(step: VerificationStep): void;
29
+ emitResult(result: VerificationResult): void;
30
+ /**
31
+ * The promoted face_match probe key of the last liveness submission (profile
32
+ * v2 §4.4 wrong-number re-entry): after the re-entered NNI passes, the
33
+ * `pending` face_match is resubmitted with it — no new capture. `null` when
34
+ * no liveness was submitted from this page (e.g. after a reload).
35
+ */
36
+ keptFaceKey?(): string | null;
37
+ /** Task 4: binds the document step (selectDocument + capture). */
38
+ bindDocument?(snapshot: Extract<StepSnapshot, {
39
+ kind: "document";
40
+ }>, republish: () => void): VerificationStep;
41
+ /** SDK spec §4.9: binds the ICAO portrait step (capture + portrait_icao / face_match submissions). */
42
+ bindPortrait?(snapshot: Extract<StepSnapshot, {
43
+ kind: "portrait";
44
+ }>, republish: () => void): VerificationStep;
45
+ /** Spec 2026-11-10 §7.4: binds the proof of address step (uploads, the page camera, `poa` submissions). */
46
+ bindProofOfAddress?(snapshot: Extract<StepSnapshot, {
47
+ kind: "proof_of_address";
48
+ }>, republish: () => void): VerificationStep;
49
+ /** Commit a view an action answered (flow model 2026-10-23); absent → re-read the view. */
50
+ setView?(view: HostedSessionView): void;
51
+ /** Step 3 one capture: the ICAO coaching of the running live-photo capture. */
52
+ onLivePhoto?(handler: (gate: LivePhotoGateUpdate) => void): () => void;
53
+ /** Stops every camera of the session (a skipped capture in a simulated session). */
54
+ stopCameras?(): void;
55
+ }
56
+ interface StepRunner {
57
+ run(): Promise<VerificationStep>;
58
+ current(): VerificationStep | null;
59
+ /** Called by the verification on every view update. */
60
+ onView(view: HostedSessionView): void;
61
+ /** Called when the liveness chain becomes idle. */
62
+ onChainIdle(): void;
63
+ /** Re-derive from the current view and publish even if unchanged (local overlay changed). */
64
+ republish(): void;
65
+ /** Submit one step input (exposed for the document binding, Task 4). */
66
+ submit(checkType: CheckType, executor: Executor, onAccepted?: () => void): Promise<void>;
67
+ /** "Skip with test data" answered the liveness or the portrait on this page: a following match has no probe. */
68
+ faceProbeSkipped(): boolean;
69
+ }
70
+ declare function createStepRunner(deps: RunnerDeps): StepRunner;
9
71
 
10
72
  /** At most this many ranked lenses are tried (each costs a camera reopen). */
11
73
  declare const LENS_TRY_MAX = 3;
@@ -273,64 +335,6 @@ declare const OCR_ASSET_SET: {
273
335
  };
274
336
  };
275
337
 
276
- /** `processing` re-reads (1+2+4+8+15 = 30 s, spec §6.5), then `stalled`. */
277
- declare const PROCESSING_BACKOFF_MS: readonly number[];
278
- /** Hosted parity: a resend is offered 30 s after the last send. */
279
- declare const OTP_RESEND_COOLDOWN_MS = 30000;
280
- type Executor = (client: HostedClientLike, idempotencyKey: string) => Promise<HostedSessionView>;
281
- interface RunnerDeps {
282
- runtime: SubmitRuntime;
283
- currentView(): HostedSessionView | null;
284
- ensureView(): Promise<HostedSessionView>;
285
- refreshView(): Promise<HostedSessionView>;
286
- ensureConsent(): Promise<void>;
287
- liveness(options: LivenessCaptureOptions): LivenessCaptureHandle;
288
- /** A liveness submission chain is in flight (do not flip the UI mid-upload). */
289
- chainBusy(): boolean;
290
- destroyed(): boolean;
291
- sleep(ms: number): Promise<void>;
292
- isMobile(): boolean;
293
- now(): number;
294
- emitStep(step: VerificationStep): void;
295
- emitResult(result: VerificationResult): void;
296
- /**
297
- * The promoted face_match probe key of the last liveness submission (profile
298
- * v2 §4.4 wrong-number re-entry): after the re-entered NNI passes, the
299
- * `pending` face_match is resubmitted with it — no new capture. `null` when
300
- * no liveness was submitted from this page (e.g. after a reload).
301
- */
302
- keptFaceKey?(): string | null;
303
- /** Task 4: binds the document step (selectDocument + capture). */
304
- bindDocument?(snapshot: Extract<StepSnapshot, {
305
- kind: "document";
306
- }>, republish: () => void): VerificationStep;
307
- /** SDK spec §4.9: binds the ICAO portrait step (capture + portrait_icao / face_match submissions). */
308
- bindPortrait?(snapshot: Extract<StepSnapshot, {
309
- kind: "portrait";
310
- }>, republish: () => void): VerificationStep;
311
- /** Commit a view an action answered (flow model 2026-10-23); absent → re-read the view. */
312
- setView?(view: HostedSessionView): void;
313
- /** Step 3 one capture: the ICAO coaching of the running live-photo capture. */
314
- onLivePhoto?(handler: (gate: LivePhotoGateUpdate) => void): () => void;
315
- /** Stops every camera of the session (a skipped capture in a simulated session). */
316
- stopCameras?(): void;
317
- }
318
- interface StepRunner {
319
- run(): Promise<VerificationStep>;
320
- current(): VerificationStep | null;
321
- /** Called by the verification on every view update. */
322
- onView(view: HostedSessionView): void;
323
- /** Called when the liveness chain becomes idle. */
324
- onChainIdle(): void;
325
- /** Re-derive from the current view and publish even if unchanged (local overlay changed). */
326
- republish(): void;
327
- /** Submit one step input (exposed for the document binding, Task 4). */
328
- submit(checkType: CheckType, executor: Executor, onAccepted?: () => void): Promise<void>;
329
- /** "Skip with test data" answered the liveness or the portrait on this page: a following match has no probe. */
330
- faceProbeSkipped(): boolean;
331
- }
332
- declare function createStepRunner(deps: RunnerDeps): StepRunner;
333
-
334
338
  /** A check the browser may still submit. */
335
339
  declare function isExecutable(step: Pick<PlanStepView, "state"> | undefined): boolean;
336
340
  /** The session accepts no further submissions. */
@@ -1 +1 @@
1
- import{c as me,d as _e,e as Le,h as le,i as ce,j as Se}from"../chunk-6XXMWK72.js";import{a as W,b as ve,c as ge,d as he,e as Ge,f as be,g as He,h as Ye,i as Ue,j as k,k as K,l as w,m as X,n as Z,o as J,p as Q,q as j,r as q,s as $,t as ee,u as te,x as re}from"../chunk-MGO2ME5X.js";import{a as Bt,b as Vt,c as Xt,d as Zt,e as Jt,f as Qt,g as jt,h as qt,i as $t,j as ne,k as ie,m as se,n as Ee}from"../chunk-VWGKUQ3C.js";import{a as Ft,b as Nt,c as vt,d as gt,e as ht,f as Gt,g as bt,h as Ht,i as Yt,j as Ut,k as Wt,l as kt,m as Kt}from"../chunk-53POX7U4.js";import{a as wt,b as zt}from"../chunk-33KKMPJ5.js";import{b as oe,c as pe,d as ae}from"../chunk-CJHMFPL6.js";import"../chunk-RI3E7GBN.js";import"../chunk-GI3UFGRQ.js";import{a as P,b as d,c as M,d as F,e as N}from"../chunk-HVW2AB35.js";import{A as Ct,B as At,C as Ot,D as xt,E as It,F as ut,G as Dt,H as Pt,I as dt,J as Mt,a as Ke,b as we,c as ze,d as je,e as qe,f as $e,g as et,h as tt,i as rt,j as ot,k as pt,l as at,m as nt,n as it,o as st,p as Et,q as mt,r as _t,s as Lt,t as lt,u as ct,v as St,w as Rt,x as yt,y as Tt,z as ft}from"../chunk-24F6JCVH.js";import{a as v,b as g,c as h,d as G,e as b,f as H,g as Y,h as U,i as z,j as B,l as V}from"../chunk-G6LKLN4U.js";import{a as We,b as ke}from"../chunk-SMKCBUJL.js";import{a as Be,b as Ve,c as Xe,d as Ze,e as Je,f as Qe}from"../chunk-MXWLCDFX.js";import{a as De,b as Pe,c as de,d as Me,e as Fe,f as Ne}from"../chunk-TDLIXFDT.js";import{b as ye,c as Te,d as fe,e as Ce,g as Ae,h as er,i as tr,j as rr,k as or,l as pr,m as ar,s as Oe}from"../chunk-GLXOSYBH.js";import{A as u,B as D,i as c,j as S,k as R,l as y,o as T,u as f,v as C,w as A,x as O,y as x,z as I}from"../chunk-4ESM6SSR.js";import{a,b as n,c as i,d as s,i as E,j as m,k as _,l as L,n as l}from"../chunk-DIKSFEYQ.js";import"../chunk-7QZWBDI5.js";import"../chunk-J4S3QMK6.js";import"../chunk-SX7TUC3V.js";import"../chunk-POIQGEZM.js";import{p as xe,q as Ie,r as ue}from"../chunk-CPUECYAJ.js";import"../chunk-FPXL63KZ.js";import"../chunk-7HV77AOV.js";import{c as e,d as t,f as r,g as o,h as p}from"../chunk-TSA6GHUG.js";import"../chunk-EHKCOBE2.js";import"../chunk-FSSMUAKC.js";import{a as Re}from"../chunk-DFTCAWMP.js";import"../chunk-DK5YPBDQ.js";export{ne as ANALYSIS_LONG_EDGE,De as ASPECT_BANDS,I as AttestationError,He as BLUR_REFUSE_SHARPNESS_MAX,Mt as CAPTURE_CANDIDATE_SPACING_MS,dt as CAPTURE_EXTRA_CANDIDATES,p as CENTERED_FACTOR,M as CHALLENGE_EXECUTE_TIMEOUT_MS,d as CHALLENGE_READY_TIMEOUT_MS,r as CIRCLE_RADIUS_FACTOR,Bt as CLIPPED_LUMA,f as CLIP_MIME_ALLOWLIST,Dt as CaptureSessionDoc,P as ChallengeError,tr as DOCUMENT_TYPE_ORDER,je as DOC_ANALYSIS_DEFAULTS,At as DOC_BLACK_FRAME_LUMA,Ot as DOC_BLACK_FRAME_TICKS,xt as DOC_CADENCE_HZ,tt as DOC_CAMERA_TUNING_DEFAULTS,Fe as DOC_CATALOG,Be as DOC_DETECT_WIDTH,Ke as DOC_FEEDBACK_STATES,Ct as DOC_FIRST_FRAME_MS,Ve as DOC_GATE_V1_DEFAULTS,It as DOC_SHUTTER_DEFAULTS,V as DocAssist,ze as DocFeedbackAggregator,Qe as DocGateV1,Lt as EMPTY_GUIDE_METRICS,ge as FLIP_FILL_MIN,ve as FLIP_GAP_MS,he as FLIP_TIMEOUT_MS,Rt as GUIDE_LOCK_DEFAULTS,Tt as GuideLock,gt as ICAO_CANVAS,wt as ICAO_FALLBACK,Ht as ICAO_GATE_CRITERIA,Vt as ICAO_SHARP_REF,O as INFERENCE_RETRY_ATTEMPTS,x as INFERENCE_RETRY_DEFAULT_S,o as IN_CIRCLE_FACTOR,er as ISSUER_CODES,oe as LANDMARKER_MODEL,ot as LENS_STORAGE_KEY,xe as LENS_TRY_MAX,B as LIVE_MRZ_DEFAULTS,_e as LIVE_PHOTO_IDLE_MS,me as LIVE_PHOTO_MAX_HZ,Ge as MANUAL_SHUTTER_MS,We as MRZ_BAND_DEFAULTS,Me as MR_DOC_CATALOG,be as NO_REPORT_MS,Re as OCR_ASSET_SET,ce as OTP_RESEND_COOLDOWN_MS,ie as PORTRAIT_JPEG_QUALITY,a as PRELOAD_BLAZE_INIT_TIMEOUT_MS,n as PRELOAD_BUDGET_MS,le as PROCESSING_BACKOFF_MS,Te as PROCESSING_POLL_DELAY_MS,fe as PROCESSING_POLL_MAX,h as REGION_PAD,ye as REGISTRY_RETRY_DELAY_MS,te as SAME_FACE_MAX_DROPS,v as SHARPNESS_LONG_EDGE,z as TEXT_LOCK_DEFAULTS,C as TRANSPORT_REPLAY_ATTEMPTS,A as TRANSPORT_REPLAY_DELAY_MS,J as WEB_OCR_ENGINE,or as acceptedIssuers,rr as acceptedTypesFor,et as analyzeDocFrame,ct as analyzeGuide,Pe as aspectBand,de as aspectFits,jt as backgroundStats,q as browserFamily,X as buildDeviceReadHint,K as classifyCardSide,k as classifyCardSideWith,st as coverPointToVideo,re as createDocumentCaptureInternal,ae as createFaceLandmarker,Kt as createIcaoGate,Le as createLivePhotoKit,l as createLivenessCaptureInternal,Ee as createPortraitCaptureInternal,Se as createStepRunner,Ae as createVerificationInternal,b as cropImage,e as detectFormFactor,t as detectIsMobile,ke as detectMrzBand,Et as docZoomFor,W as encodeDocumentImage,N as executeChallenge,vt as eyeLineRoll,Ut as eyeOpenness,Qt as eyeSpecular,Ft as faceGeometry,Jt as faceLighting,qt as faceSharpness,pe as facesOf,we as feedbackVoteOf,ar as flagOf,mt as focusOk,ee as formatMismatch,R as frontierStep,St as guideQuad,lt as guideRegionInFrame,$t as icaoPixelStats,ht as icaoWindow,Ye as initialScanState,c as isExecutable,S as isTerminalView,Yt as judgeIcao,Ie as lensKindOf,$ as liveMrzWireReport,Xt as lumaPlane,_ as mapEngineState,L as mapErrorKind,m as mapGuidanceHint,T as mapSessionResult,U as measureBitmapSharpness,Y as measureRegionSharpness,Ue as nextScanState,se as observePortraitFrame,_t as openDocCamera,Pt as passportBandOf,Wt as percentile,g as photoSharpness,bt as portraitCropRegion,Oe as portraitMatchStep,Nt as poseFromMatrix,E as preloadedDetectorFactory,Xe as quadAreaFrac,Je as quadBounds,Ze as quadIou,$e as quadTiltRatio,Ce as randomUuid,ue as rankBackCameras,pt as readStoredLens,Zt as regionStats,F as resetChallengeFrameForTests,s as resetLivenessAssetsForTests,H as resizeLongEdge,pr as resolveAcceptedDocuments,rt as resolveDocCameraTuning,ut as resolveDocShutterTuning,yt as resolveGuideLockTuning,zt as resolveIcaoTuning,Q as resolveWebOcrPlan,D as runLivenessFlow,u as runSubmission,Ne as scannerFormatFor,kt as scoreFrame,i as setPreloadLoaderForTests,Z as settledHint,it as singleShotFocusAt,qe as specularFraction,j as startWebOcr,y as stepOf,G as stillRegionOf,w as stillToImageData,nt as supportsFocusMode,ft as warmDocDetector,Gt as windowOverflow,at as writeStoredLens};
1
+ import{c as me,d as _e,e as Le,h as le,i as ce,j as Se}from"../chunk-DVTK2DGX.js";import{a as W,b as ve,c as ge,d as he,e as Ge,f as be,g as He,h as Ye,i as Ue,j as k,k as K,l as w,m as X,n as Z,o as J,p as Q,q as j,r as q,s as $,t as ee,u as te,x as re}from"../chunk-LV23FCYP.js";import{a as Bt,b as Vt,c as Xt,d as Zt,e as Jt,f as Qt,g as jt,h as qt,i as $t,j as ne,k as ie,m as se,n as Ee}from"../chunk-VWGKUQ3C.js";import{a as Ft,b as Nt,c as vt,d as gt,e as ht,f as Gt,g as bt,h as Ht,i as Yt,j as Ut,k as Wt,l as kt,m as Kt}from"../chunk-53POX7U4.js";import{a as wt,b as zt}from"../chunk-33KKMPJ5.js";import{b as oe,c as pe,d as ae}from"../chunk-CJHMFPL6.js";import"../chunk-RI3E7GBN.js";import"../chunk-GI3UFGRQ.js";import{a as P,b as d,c as M,d as F,e as N}from"../chunk-HVW2AB35.js";import{A as Ct,B as At,C as Ot,D as xt,E as It,F as ut,G as Dt,H as Pt,I as dt,J as Mt,a as Ke,b as we,c as ze,d as je,e as qe,f as $e,g as et,h as tt,i as rt,j as ot,k as pt,l as at,m as nt,n as it,o as st,p as Et,q as mt,r as _t,s as Lt,t as lt,u as ct,v as St,w as Rt,x as yt,y as Tt,z as ft}from"../chunk-7MZW3FFH.js";import{a as v,b as g,c as h,d as G,e as b,f as H,g as Y,h as U,i as z,j as B,l as V}from"../chunk-G6LKLN4U.js";import{a as We,b as ke}from"../chunk-SMKCBUJL.js";import{a as Be,b as Ve,c as Xe,d as Ze,e as Je,f as Qe}from"../chunk-4DEPREJ3.js";import{a as De,b as Pe,c as de,d as Me,e as Fe,f as Ne}from"../chunk-NFHLJOHW.js";import{b as ye,c as Te,d as fe,e as Ce,g as Ae,h as er,i as tr,j as rr,k as or,l as pr,m as ar,s as Oe}from"../chunk-GPFAPAS6.js";import{A as u,B as D,i as c,j as S,k as R,l as y,o as T,u as f,v as C,w as A,x as O,y as x,z as I}from"../chunk-ZCW6PNUX.js";import{a,b as n,c as i,d as s,i as E,j as m,k as _,l as L,n as l}from"../chunk-65JZHKVG.js";import"../chunk-7QZWBDI5.js";import"../chunk-OVP7FAMJ.js";import"../chunk-SX7TUC3V.js";import"../chunk-POIQGEZM.js";import{p as xe,q as Ie,r as ue}from"../chunk-CPUECYAJ.js";import"../chunk-FPXL63KZ.js";import"../chunk-XOTKATN6.js";import{c as e,d as t,f as r,g as o,h as p}from"../chunk-TSA6GHUG.js";import"../chunk-LLX2CKZ3.js";import"../chunk-FSSMUAKC.js";import{a as Re}from"../chunk-DFTCAWMP.js";import"../chunk-DK5YPBDQ.js";export{ne as ANALYSIS_LONG_EDGE,De as ASPECT_BANDS,I as AttestationError,He as BLUR_REFUSE_SHARPNESS_MAX,Mt as CAPTURE_CANDIDATE_SPACING_MS,dt as CAPTURE_EXTRA_CANDIDATES,p as CENTERED_FACTOR,M as CHALLENGE_EXECUTE_TIMEOUT_MS,d as CHALLENGE_READY_TIMEOUT_MS,r as CIRCLE_RADIUS_FACTOR,Bt as CLIPPED_LUMA,f as CLIP_MIME_ALLOWLIST,Dt as CaptureSessionDoc,P as ChallengeError,tr as DOCUMENT_TYPE_ORDER,je as DOC_ANALYSIS_DEFAULTS,At as DOC_BLACK_FRAME_LUMA,Ot as DOC_BLACK_FRAME_TICKS,xt as DOC_CADENCE_HZ,tt as DOC_CAMERA_TUNING_DEFAULTS,Fe as DOC_CATALOG,Be as DOC_DETECT_WIDTH,Ke as DOC_FEEDBACK_STATES,Ct as DOC_FIRST_FRAME_MS,Ve as DOC_GATE_V1_DEFAULTS,It as DOC_SHUTTER_DEFAULTS,V as DocAssist,ze as DocFeedbackAggregator,Qe as DocGateV1,Lt as EMPTY_GUIDE_METRICS,ge as FLIP_FILL_MIN,ve as FLIP_GAP_MS,he as FLIP_TIMEOUT_MS,Rt as GUIDE_LOCK_DEFAULTS,Tt as GuideLock,gt as ICAO_CANVAS,wt as ICAO_FALLBACK,Ht as ICAO_GATE_CRITERIA,Vt as ICAO_SHARP_REF,O as INFERENCE_RETRY_ATTEMPTS,x as INFERENCE_RETRY_DEFAULT_S,o as IN_CIRCLE_FACTOR,er as ISSUER_CODES,oe as LANDMARKER_MODEL,ot as LENS_STORAGE_KEY,xe as LENS_TRY_MAX,B as LIVE_MRZ_DEFAULTS,_e as LIVE_PHOTO_IDLE_MS,me as LIVE_PHOTO_MAX_HZ,Ge as MANUAL_SHUTTER_MS,We as MRZ_BAND_DEFAULTS,Me as MR_DOC_CATALOG,be as NO_REPORT_MS,Re as OCR_ASSET_SET,ce as OTP_RESEND_COOLDOWN_MS,ie as PORTRAIT_JPEG_QUALITY,a as PRELOAD_BLAZE_INIT_TIMEOUT_MS,n as PRELOAD_BUDGET_MS,le as PROCESSING_BACKOFF_MS,Te as PROCESSING_POLL_DELAY_MS,fe as PROCESSING_POLL_MAX,h as REGION_PAD,ye as REGISTRY_RETRY_DELAY_MS,te as SAME_FACE_MAX_DROPS,v as SHARPNESS_LONG_EDGE,z as TEXT_LOCK_DEFAULTS,C as TRANSPORT_REPLAY_ATTEMPTS,A as TRANSPORT_REPLAY_DELAY_MS,J as WEB_OCR_ENGINE,or as acceptedIssuers,rr as acceptedTypesFor,et as analyzeDocFrame,ct as analyzeGuide,Pe as aspectBand,de as aspectFits,jt as backgroundStats,q as browserFamily,X as buildDeviceReadHint,K as classifyCardSide,k as classifyCardSideWith,st as coverPointToVideo,re as createDocumentCaptureInternal,ae as createFaceLandmarker,Kt as createIcaoGate,Le as createLivePhotoKit,l as createLivenessCaptureInternal,Ee as createPortraitCaptureInternal,Se as createStepRunner,Ae as createVerificationInternal,b as cropImage,e as detectFormFactor,t as detectIsMobile,ke as detectMrzBand,Et as docZoomFor,W as encodeDocumentImage,N as executeChallenge,vt as eyeLineRoll,Ut as eyeOpenness,Qt as eyeSpecular,Ft as faceGeometry,Jt as faceLighting,qt as faceSharpness,pe as facesOf,we as feedbackVoteOf,ar as flagOf,mt as focusOk,ee as formatMismatch,R as frontierStep,St as guideQuad,lt as guideRegionInFrame,$t as icaoPixelStats,ht as icaoWindow,Ye as initialScanState,c as isExecutable,S as isTerminalView,Yt as judgeIcao,Ie as lensKindOf,$ as liveMrzWireReport,Xt as lumaPlane,_ as mapEngineState,L as mapErrorKind,m as mapGuidanceHint,T as mapSessionResult,U as measureBitmapSharpness,Y as measureRegionSharpness,Ue as nextScanState,se as observePortraitFrame,_t as openDocCamera,Pt as passportBandOf,Wt as percentile,g as photoSharpness,bt as portraitCropRegion,Oe as portraitMatchStep,Nt as poseFromMatrix,E as preloadedDetectorFactory,Xe as quadAreaFrac,Je as quadBounds,Ze as quadIou,$e as quadTiltRatio,Ce as randomUuid,ue as rankBackCameras,pt as readStoredLens,Zt as regionStats,F as resetChallengeFrameForTests,s as resetLivenessAssetsForTests,H as resizeLongEdge,pr as resolveAcceptedDocuments,rt as resolveDocCameraTuning,ut as resolveDocShutterTuning,yt as resolveGuideLockTuning,zt as resolveIcaoTuning,Q as resolveWebOcrPlan,D as runLivenessFlow,u as runSubmission,Ne as scannerFormatFor,kt as scoreFrame,i as setPreloadLoaderForTests,Z as settledHint,it as singleShotFocusAt,qe as specularFraction,j as startWebOcr,y as stepOf,G as stillRegionOf,w as stillToImageData,nt as supportsFocusMode,ft as warmDocDetector,Gt as windowOverflow,at as writeStoredLens};
@@ -0,0 +1 @@
1
+ import{e as ee}from"./chunk-A3FUGHAH.js";import{a as q,b as J,e as X,f as B,g as x,j as Z}from"./chunk-DVTK2DGX.js";import{x as Q}from"./chunk-LV23FCYP.js";import{n as Y}from"./chunk-VWGKUQ3C.js";import"./chunk-53POX7U4.js";import"./chunk-33KKMPJ5.js";import"./chunk-CJHMFPL6.js";import"./chunk-RI3E7GBN.js";import"./chunk-GI3UFGRQ.js";import{F as $,i as K,x as N}from"./chunk-7MZW3FFH.js";import"./chunk-G6LKLN4U.js";import"./chunk-SMKCBUJL.js";import"./chunk-4DEPREJ3.js";import"./chunk-NFHLJOHW.js";import{b as H,c as G,q as j,s as z,t as L}from"./chunk-ZCW6PNUX.js";import"./chunk-65JZHKVG.js";import"./chunk-7QZWBDI5.js";import"./chunk-OVP7FAMJ.js";import{b as U}from"./chunk-SX7TUC3V.js";import"./chunk-POIQGEZM.js";import"./chunk-CPUECYAJ.js";import"./chunk-FPXL63KZ.js";import{c as T,i as W}from"./chunk-XOTKATN6.js";import"./chunk-TSA6GHUG.js";import{a as F}from"./chunk-LLX2CKZ3.js";import"./chunk-FSSMUAKC.js";import"./chunk-DFTCAWMP.js";import"./chunk-DK5YPBDQ.js";var ie=2e4,ae=new Set(["media_type_unsupported","media_type_mismatch"]),te=new Set(["document_upload_not_allowed","portrait_source_not_allowed","uploaded_media_not_allowed"]);function ne(e){let o=null,f=Promise.resolve(),c=!1,b=null,I=null,_=!1,E=null,V=!1,C=!1,R=()=>{o?.controller.handle.destroy(),o=null},u=()=>{let t=e.currentView(),r=t===null?null:x(t,{isMobile:e.isMobile()});return r?.kind==="portrait"?r:null},a=()=>{if(e.destroyed())return"self";let t=e.currentView(),r=t===null?void 0:B(t);return r==="self"||r==="assisted"?r:r==="choice"&&e.captureModeSwitch!==void 0?e.captureModeSwitch.pick()??"self":e.cameraMode?.()??z(r??j(t),null)},h=e.captureModeSwitch,p=h===void 0?void 0:{session:()=>{let t=e.currentView();return t!==null&&B(t)==="choice"?"choice":a()},onModeChange:t=>h.choose(t)},g=async(t,r)=>{if(e.destroyed())return;let d=a();r.setFlowState("uploading"),c=!1;let l=null;try{await e.runner().submit("portrait_icao",async(n,w)=>{if(l===null){let k=await L(n,"image","image/jpeg",t.image.size,{engine:"portrait"});await n.uploadToSpaces(k.uploadUrl,t.image,"image/jpeg"),l=(await n.completeMedia(k.key)).key}r.setFlowState("checking");let D={media:{portrait:l},gate:W(t.gate),...t.tuningVersion!==void 0?{tuningVersion:t.tuningVersion}:{},source:"camera",capture:{mode:d,facingMode:t.facingMode}};return n.submitCheck("portrait_icao",D,{idempotencyKey:w})})}catch(n){c=!0,n instanceof T&&te.has(n.code)&&await e.refreshView?.().catch(()=>{})}if(r.setFlowState("done"),e.destroyed())return;let i=u();(i===null||i.phase!=="capture")&&o?.controller===r&&R(),e.runner().republish()},M=t=>e.runner().submit("face_match",(r,d)=>r.submitCheck("face_match",e.runner().faceProbeSkipped()?{simulatedCapture:!0}:{},{idempotencyKey:d})).then(()=>{},()=>{c=!0,t()}),P=null,y=async t=>{let r=u();if(r===null||r.phase!=="capture"||!r.photo.uploadOffered)throw new RangeError("upload_not_offered");let{prepareUploadFile:d}=await import("./upload-file-EGXXM6TQ.js"),l=await d(t,e.uploadInternals);if(e.destroyed())return;R(),c=!1;let i=null;try{await e.runner().submit("portrait_icao",async(n,w)=>{if(i===null){let k=await n.presign("image",l.contentType,l.blob.size,{source:"upload"});await n.uploadToSpaces(k.uploadUrl,l.blob,l.contentType),i=(await n.completeMedia(k.key)).key}let D={media:{portrait:i},source:"upload"};return n.submitCheck("portrait_icao",D,{idempotencyKey:w})})}catch(n){throw n instanceof T&&ae.has(n.code)?new TypeError("unsupported_file"):(n instanceof T&&te.has(n.code)&&await e.refreshView?.().catch(()=>{}),n)}},v=null,S=t=>{if(v!==null)return v;let r=u();if(r===null||r.phase!=="review")return Promise.reject(new RangeError("no_pending_fix"));let d={fixReview:{accept:t}},l=e.runner().submit("portrait_icao",(i,n)=>i.submitCheck("portrait_icao",d,{idempotencyKey:n})).catch(async i=>{throw i instanceof T&&i.code==="portrait_no_pending_fix"&&await e.refreshView?.().catch(()=>{}),i}).finally(()=>{v=null});return v=l,l},s=t=>{let r=()=>y(t),d=(P===null?r():P.then(r,r)).finally(()=>{P===d&&(P=null)});return P=d,d};return{bind:(t,r)=>{if(t.phase==="review")return R(),{...t,uploadFailed:c,resubmit:()=>Promise.resolve(),capture:()=>{throw new Error("the adjusted photo waits for confirmFix()")},uploadPortrait:()=>Promise.reject(new RangeError("upload_not_offered")),confirmFix:S};if(t.phase==="match")return R(),b!==t.attemptsRemaining&&!c&&(b=t.attemptsRemaining,M(r)),{...t,uploadFailed:c,resubmit:()=>(c=!1,b=t.attemptsRemaining,r(),M(r)),capture:()=>{throw new Error("the portrait was already accepted")},uploadPortrait:()=>Promise.reject(new RangeError("upload_not_offered")),confirmFix:S};if(b=null,t.reuse===!0&&t.phase==="capture")return R(),!V&&E!==t.attemptsRemaining&&(E=t.attemptsRemaining,V=!0,e.runner().submit("portrait_icao",(l,i)=>l.submitCheck("portrait_icao",{},{idempotencyKey:i})).then(()=>{C=!1},()=>{C=!0}).finally(()=>{V=!1,r()})),{kind:"processing",key:"processing",context:t.context,section:t.section,stalled:C&&!V,refresh:()=>(C=!1,E=null,r(),Promise.resolve())};let d=e.keptPortraitInput?.()??null;return d!==null&&(_||d!==I&&t.report===null&&t.reason===void 0&&!t.retakeOnly)?(_||(I=d,_=!0,e.runner().submit("portrait_icao",(l,i)=>l.submitCheck("portrait_icao",d,{idempotencyKey:i})).catch(()=>{}).finally(()=>{_=!1,r()})),{kind:"processing",key:"processing",context:t.context,section:t.section,stalled:!1,refresh:()=>Promise.resolve()}):{...t,uploadFailed:c,resubmit:()=>Promise.resolve(),capture:l=>{if(o!==null&&o.video===l.video)return o.controller.handle;R(),c=!1;let i=Y({video:l.video,tuning:t.tuning,tuningVersion:t.tuningVersion,...t.icao!=null?{policy:t.icao.policy}:{},...l.keepScreenAwake!==void 0?{keepScreenAwake:l.keepScreenAwake}:{},...l.assetBaseUrl!==void 0?{assetBaseUrl:l.assetBaseUrl}:{}},e.internals,a,p);o={video:l.video,controller:i};let n=i.handle.destroy;i.handle.destroy=()=>{o?.controller===i&&(o=null),n()},i.handle.on("error",k=>{e.reportCaptureIssue?.(H("portrait",k,0))});let w=!1,D=(k,O)=>{let A=i.gateScores();A!==null&&e.reportGate?.({kind:"portrait_gate",platform:"web",outcome:k,...O!==null?{failing:O}:{},...A})};return i.handle.on("gate",k=>{!w&&!k.ready&&(i.gateScores()?.elapsedMs??0)>=ie&&(w=!0,D("stuck",k.failing))}),i.handle.on("captured",k=>{D("captured",null),w=!1,f=f.then(()=>g(k,i)).catch(()=>{})}),i.handle},uploadPortrait:s,confirmFix:S}},destroy:R}}var le=.92,se=()=>U("environment",{width:{ideal:1920},height:{ideal:1080}},{getUserMedia:e=>navigator.mediaDevices.getUserMedia(e),enumerateDevices:()=>navigator.mediaDevices.enumerateDevices()}),ue=e=>{let o=document.createElement("canvas");o.width=e.videoWidth,o.height=e.videoHeight;let f=o.getContext("2d");return f===null||o.width===0||o.height===0?Promise.reject(new Error("the camera has no frame yet")):(f.drawImage(e,0,0,o.width,o.height),new Promise((c,b)=>o.toBlob(I=>I===null?b(new Error("the still could not be encoded")):c(I),"image/jpeg",le)))},de=(e,o)=>{try{e.muted=!0,e.playsInline=!0,e.srcObject=o,e.play().catch(()=>{})}catch{}};function re(e){let o=null,f=null,c=u=>{let a=(f===null?u():f.then(u,u)).finally(()=>{f===a&&(f=null)});return f=a,a},b=()=>{o?.handle.destroy(),o=null},I=()=>{let u=e.currentView(),a=u===null?null:x(u,{isMobile:e.isMobile()});return a?.kind==="proof_of_address"?a:null},_=async(u,a)=>{if(a.length===0)throw new RangeError("no_pages");if(a.length>u.maxPages)throw new RangeError("too_many_pages");let{pdfFileKind:h,prepareUploadFile:p}=await import("./upload-file-EGXXM6TQ.js"),g=await Promise.all(a.map(P=>h(P)));if(g.includes("bad"))throw new TypeError("unsupported_file");if(g.includes("pdf")){if(a.length>1)throw new RangeError("too_many_pages");let P=a[0];if(P.size>u.pdf.maxBytes)throw new RangeError("file_too_large");return[{kind:"document_file",blob:P,contentType:"application/pdf"}]}let M=[];for(let P of a){let y=await p(P,e.uploadInternals);M.push({kind:"image",blob:y.blob,contentType:y.contentType})}return M},E=async(u,a,h)=>{let p=null;try{await e.runner().submit("poa",async(g,M)=>{if(p===null){let y=[];for(let v of h){let S=a==="upload"?await g.presign(v.kind,v.contentType,v.blob.size,{source:"upload"}):await L(g,v.kind,v.contentType,v.blob.size,{engine:"poa_page"});await g.uploadToSpaces(S.uploadUrl,v.blob,v.contentType),y.push((await g.completeMedia(S.key)).key)}p=y}let P=h[0]?.kind==="document_file"?{part:u,source:"upload",pdfKey:p[0]}:{part:u,source:a,imageKeys:p};return g.submitCheck("poa",P,{idempotencyKey:M})})}catch(g){throw g instanceof T&&(g.code==="media_type_unsupported"||g.code==="media_type_mismatch")?new TypeError("unsupported_file"):(g instanceof T&&(g.code==="document_upload_not_allowed"||g.code==="uploaded_media_not_allowed")&&await e.refreshView?.().catch(()=>{}),g)}},V=async(u,a)=>{let h=I();if(h===null||!h.photo.uploadOffered)throw new RangeError("upload_not_offered");if(u==="holder_letter"&&h.phase!=="holder_letter")throw new RangeError("holder_letter_not_requested");let p=await _(h,a);e.destroyed()||(b(),await E(u,"upload",p))},C=(u,a)=>{let h=null,p=[],g=!0,M=()=>{for(let y of h?.getTracks()??[])y.stop();h=null},P={get pages(){return p},start:async()=>{if(!g||h!==null)return;let y=await(e.pageCamera?.open??se)();if(!g){for(let v of y.getTracks())v.stop();return}h=y,(e.pageCamera?.attach??de)(u,y)},takePage:async()=>{if(p.length>=a)throw new RangeError("too_many_pages");let y=await(e.pageCamera?.grab??ue)(u);if(p.length>=a)throw new RangeError("too_many_pages");return p=[...p,y],y},removePage:y=>{p=p.filter((v,S)=>S!==y)},submitPages:()=>c(async()=>{if(p.length===0)throw new RangeError("no_pages");let y=I();if(y===null)throw new RangeError("camera_not_offered");let v=y.phase==="holder_letter"?"holder_letter":"document";await E(v,"camera",p.map(S=>({kind:"image",blob:S,contentType:"image/jpeg"}))),o?.handle===P?b():P.destroy()}),destroy:()=>{g=!1,p=[],M(),o?.handle===P&&(o=null)}};return P},R=async()=>{let u=I();if(u===null||!u.licenceAddressAccepted)throw new RangeError("licence_address_not_accepted");if(e.destroyed())return;b();let a={part:"document"};await e.runner().submit("poa",(h,p)=>h.submitCheck("poa",a,{idempotencyKey:p}))};return{bind:u=>({...u,...u.licenceAddressAccepted?{useLicenceAddress:()=>c(R)}:{},uploadPages:a=>c(()=>V("document",a)),uploadHolderLetter:a=>c(()=>V("holder_letter",a)),capturePage:a=>{if(u.photo.source==="upload")throw new RangeError("camera_not_offered");if(o!==null&&o.video===a.video)return o.handle;b();let h=C(a.video,u.maxPages);return o={video:a.video,handle:h},h}}),destroy:b}}function oe(e){let o=e;if(typeof o.apiOrigin!="string"||typeof o.sessionToken!="string")return;let f=`${o.apiOrigin}/api/v2/hosted/capture-reports`,c=o.sessionToken;return b=>{try{fetch(f,{method:"POST",headers:{"content-type":"application/json","x-session-token":c,"x-sekyro-sdk":`@sekyro/web/${F}`},body:JSON.stringify({reports:b}),keepalive:!0}).catch(()=>{})}catch{}}}function ce(e){let o=e.apiOrigin;return ee("sdk",typeof o=="string"&&/staging|sandbox|localhost/.test(o)?"sandbox":"live")}function Ue(e){let o=null,f=null,c=null,b=G(),I=Promise.resolve(),_=()=>{c?.flow.handle.destroy(),c=null},E=()=>f?.documentType==="drivers_license"?{documentType:"drivers_license"}:{},V=async(s,m)=>{if(e.destroyed())return;m.setFlowState("uploading");let t=null,r,d=!1,l=e.currentView()?.documents!==void 0;try{await o.submit("doc_ocr",async(k,O)=>{if(t===null){let A=await L(k,"image","image/jpeg",s.image.size,{engine:"document"});await k.uploadToSpaces(A.uploadUrl,s.image,"image/jpeg"),t=(await k.completeMedia(A.key)).key}return m.setFlowState("checking"),r===void 0&&(r=m.takeDeviceRead(s)),k.submitCheck("doc_ocr",{imageKey:t,side:s.side,...r!==null?{deviceRead:r}:{},...l?{source:"camera"}:{},...E()},{idempotencyKey:O})})}catch{d=!0}finally{m.setFlowState("done")}if(e.destroyed())return;if(d){m.settle(s.side,{ok:!1,issue:"technical"});return}let i=e.currentView(),n=i===null?null:x(i,{isMobile:e.isMobile()});if(n?.kind!=="document"){m.settle(s.side,{ok:!0}),c?.flow===m?_():m.handle.destroy();return}if(n.reason==="document_type_not_accepted"){f=null,c?.flow===m&&_(),o.republish();return}let w=n.acceptedSides;s.side!=="single"&&(w.includes(s.side)||n.reason==="side_missing")&&!(w.includes("recto")&&w.includes("verso"))?(m.settle(s.side,{ok:!0}),f?.documentType!=="passport"&&m.handle.setSide(n.side)):m.settle(s.side,{ok:!1,issue:"reread"})},C=null,R=async s=>{let m=e.currentView(),t=m===null?null:x(m,{isMobile:e.isMobile()});if(m===null||t?.kind!=="document")throw new RangeError("upload_not_offered");if(!t.photo.uploadOffered)throw new RangeError("upload_not_offered");let r=f?.documentType==="passport"?"single":t.side,{prepareUploadFile:d}=await import("./upload-file-EGXXM6TQ.js"),l=await d(s,e.uploadInternals);if(e.destroyed())return;_();let i=null;try{await o.submit("doc_ocr",async(n,w)=>{if(i===null){let D=await n.presign("image",l.contentType,l.blob.size,{source:"upload"});await n.uploadToSpaces(D.uploadUrl,l.blob,l.contentType),i=(await n.completeMedia(D.key)).key}return n.submitCheck("doc_ocr",{imageKey:i,side:r,source:"upload",...E()},{idempotencyKey:w})})}catch(n){throw n instanceof T&&(n.code==="media_type_unsupported"||n.code==="media_type_mismatch")?new TypeError("unsupported_file"):(n instanceof T&&(n.code==="document_upload_not_allowed"||n.code==="uploaded_media_not_allowed")&&await e.refreshView().catch(()=>{}),n)}},u=(s,m)=>({...s,uploadDocument:t=>{let r=()=>R(t),d=(C===null?r():C.then(r,r)).finally(()=>{C===d&&(C=null)});return C=d,d},issuer:f?.issuer??null,documentType:f?.documentType??null,captureSide:f===null?null:f.documentType==="passport"?"single":s.side,selectDocument:(t,r)=>{if(!J(s.documents).includes(t)||!q(s.documents,t).includes(r))throw new RangeError(`${r} from ${t} is not accepted`);(f?.issuer!==t||f.documentType!==r)&&_(),f={issuer:t,documentType:r},m()},capture:t=>{if(f===null)throw new Error("selectDocument() first");if(c!==null&&c.video===t.video)return c.flow.handle;_();let r=f,d=r.documentType==="passport"?"single":s.acceptedSides.length>0?s.side:void 0,l=Q({video:t.video,documentType:r.documentType,issuer:r.issuer,...d!==void 0?{side:d}:{},...t.keepScreenAwake!==void 0?{keepScreenAwake:t.keepScreenAwake}:{},...t.liveMrz!==void 0?{liveMrz:t.liveMrz}:{}},{...e.documentInternals??{},...(()=>{let n=e.currentView()?.capture?.document,w=e.documentInternals?.blurRefuseSharpnessMax??n?.scan?.blurRefuseSharpnessMax;return{engineOptions:{camera:K(n?.camera),shutter:$(n?.scan),guideLock:N(n?.guide),...e.documentInternals?.engineOptions??{}},...typeof w=="number"&&Number.isFinite(w)&&w>=0&&w<=1?{blurRefuseSharpnessMax:w}:{}}})(),deferRead:!0,...(()=>{let n=e.currentView();if(n===null||e.documentInternals?.webOcr!==void 0)return{};let w=oe(e.runtime.client);return{webOcr:{captureDocument:n.capture?.document,salt:n.sessionId,baseUrl:ce(e.runtime.client),...w!==void 0?{reports:w}:{}}}})()});c={video:t.video,flow:l};let i=l.handle.destroy;return l.handle.destroy=()=>{c?.flow===l&&(c=null),i()},b.newHandle(),l.handle.on("state",n=>b.note(n)),l.handle.on("error",n=>{b.noteError(),e.reportCaptureIssue?.(H("document",n,b.value))}),l.handle.on("captured",n=>{I=I.then(()=>V(n,l)).catch(()=>{})}),l.handle}}),a=null,h=null,p=new Set,g=e.runtime.client;e.runtime.client=new Proxy(g,{get(s,m){if(m==="submitCheck")return(h??s).submitCheck.bind(h??s);let t=Reflect.get(s,m);return typeof t=="function"?t.bind(s):t}});let M=()=>{a?.destroy(),a=null,h=null},P=s=>{let m=e.currentView(),t=m===null?null:x(m,{isMobile:e.isMobile()});if(m===null||t?.kind!=="liveness"||t.livePhoto?.icao!==!0)return;if(a===null){let i=X({tuning:m.capture?.icao??null,tuningVersion:m.capture?.tuningVersion??null,...t.icao!=null?{policy:t.icao.policy}:{},still:t.livePhoto.still,...s.assetBaseUrl!==void 0?{assetBaseUrl:s.assetBaseUrl}:{}},e.livePhotoInternals);a=i,h=i.decorate(g),i.onGate(n=>{for(let w of p)w(n)})}let r=a,d=e.baseCapture??{},l=d.engineOptions?.telemetry;return{...d,engineOptions:{...d.engineOptions??{},measureQuality:r.engineOptions.measureQuality,telemetry:i=>{l?.(i),r.engineOptions.telemetry(i)}}}},y=ne({keptPortraitInput:()=>a?.lastPortraitInput()??null,runner:()=>o,currentView:e.currentView,...e.cameraMode!==void 0?{cameraMode:e.cameraMode}:{},...e.captureModeSwitch!==void 0?{captureModeSwitch:e.captureModeSwitch}:{},destroyed:e.destroyed,isMobile:e.isMobile,...e.portraitInternals!==void 0?{internals:e.portraitInternals}:{},...e.uploadInternals!==void 0?{uploadInternals:e.uploadInternals}:{},refreshView:()=>e.refreshView(),...e.reportCaptureIssue!==void 0?{reportCaptureIssue:e.reportCaptureIssue}:{},reportGate:s=>oe(e.runtime.client)?.([s])}),v=re({runner:()=>o,currentView:e.currentView,destroyed:e.destroyed,isMobile:e.isMobile,...e.uploadInternals!==void 0?{uploadInternals:e.uploadInternals}:{},...e.pageCameraInternals!==void 0?{pageCamera:e.pageCameraInternals}:{},refreshView:()=>e.refreshView()}),S=Z({...e,bindDocument:u,bindPortrait:y.bind,bindProofOfAddress:v.bind,stopCameras:()=>{_(),y.destroy(),v.destroy(),M(),e.stopLiveness?.()},onLivePhoto:s=>(p.add(s),()=>p.delete(s))});return o=S,{...S,captureInternals:P,destroy:()=>{_(),y.destroy(),v.destroy(),M(),p.clear()}}}export{Ue as createPlanRunner,oe as reportSink,ce as sdkAssetBase};