@sekyro/web 0.1.0-rc.26 → 0.1.0-rc.28
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.
- package/CHANGELOG.md +16 -0
- package/README.md +4 -1
- package/dist/{capture-session-doc-WZMI5XPE.js → capture-session-doc-LUA4Y7PZ.js} +1 -1
- package/dist/{capture-session-v3-BKSjJ6L0.d.cts → capture-session-v3-ClByT4KN.d.cts} +1 -1
- package/dist/{capture-session-v3-C1I_GLC9.d.ts → capture-session-v3-IjQwKfLS.d.ts} +1 -1
- package/dist/chunk-CUBNJXZN.js +1 -0
- package/dist/{chunk-LLX2CKZ3.js → chunk-FSXWIMSG.js} +1 -1
- package/dist/{chunk-XOTKATN6.js → chunk-J7D3S5ZJ.js} +1 -1
- package/dist/{chunk-7MZW3FFH.js → chunk-KLEARRAD.js} +1 -1
- package/dist/chunk-MJUOZH3U.js +1 -0
- package/dist/chunk-MOOWUPOZ.js +1 -0
- package/dist/{chunk-65JZHKVG.js → chunk-QP23DM4Z.js} +1 -1
- package/dist/chunk-R4IQTGF5.js +3 -0
- package/dist/{chunk-LV23FCYP.js → chunk-THQWX6EH.js} +1 -1
- package/dist/client/index.cjs +1 -1
- package/dist/client/index.d.cts +3 -3
- package/dist/client/index.d.ts +3 -3
- package/dist/client/index.js +1 -1
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.d.cts +3 -3
- package/dist/core/index.d.ts +3 -3
- package/dist/core/index.js +1 -1
- package/dist/{create-document-capture-OXPLKHOF.js → create-document-capture-ZTJKSEJB.js} +1 -1
- package/dist/{create-verification-YeuI7_B0.d.cts → create-verification-BN7ebjC2.d.cts} +10 -5
- package/dist/{create-verification-7wPXJN_P.d.ts → create-verification-C4FMWIix.d.ts} +10 -5
- package/dist/{icao-gate-BK8TGaCk.d.ts → icao-gate-CYb-35iH.d.ts} +1 -1
- package/dist/{icao-gate-pD2dUV3P.d.cts → icao-gate-CjbKCatx.d.cts} +1 -1
- package/dist/{icao-policy-CdR6PFHS.d.cts → icao-policy-CAZZYEJ6.d.cts} +2 -2
- package/dist/{icao-policy-qJpZOOOu.d.ts → icao-policy-D4AZivI8.d.ts} +2 -2
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +1 -1
- package/dist/internal/index.cjs +2 -2
- package/dist/internal/index.d.cts +6 -6
- package/dist/internal/index.d.ts +6 -6
- package/dist/internal/index.js +1 -1
- package/dist/{plan-runner-EP26JU6A.js → plan-runner-INQLWFGS.js} +1 -1
- package/dist/popup/index.d.cts +2 -2
- package/dist/popup/index.d.ts +2 -2
- package/dist/popup/index.js +1 -1
- package/dist/{types-DB-cZTSn.d.cts → types-CgHWIEZj.d.cts} +33 -6
- package/dist/{types-DB-cZTSn.d.ts → types-CgHWIEZj.d.ts} +33 -6
- package/package.json +1 -1
- package/sbom.cdx.json +10 -10
- package/dist/chunk-DVTK2DGX.js +0 -1
- package/dist/chunk-GPFAPAS6.js +0 -3
- package/dist/chunk-OVP7FAMJ.js +0 -1
- package/dist/chunk-ZCW6PNUX.js +0 -1
- /package/dist/{chunk-LJYMZQY2.js → chunk-GFJATPUR.js} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
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-
|
|
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-
|
|
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-BN7ebjC2.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-BN7ebjC2.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 { W as HostedSessionView, h as CheckType, ar as PlanStepView } from '../types-
|
|
5
|
-
export {
|
|
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-
|
|
4
|
+
import { W as HostedSessionView, h as CheckType, ar as PlanStepView } from '../types-CgHWIEZj.cjs';
|
|
5
|
+
export { bd as ICAO_FALLBACK, b7 as IcaoCaptureTuning, be as IcaoProfile, bf as ResolvedIcaoTuning, bg as resolveIcaoTuning } from '../types-CgHWIEZj.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-CjbKCatx.cjs';
|
|
7
7
|
import '../detect-worker-CHqsPJoM.cjs';
|
|
8
|
-
import '../capture-session-v3-
|
|
8
|
+
import '../capture-session-v3-ClByT4KN.cjs';
|
|
9
9
|
|
|
10
10
|
/** `processing` re-reads (1+2+4+8+15 = 30 s, spec §6.5), then `stalled`. */
|
|
11
11
|
declare const PROCESSING_BACKOFF_MS: readonly number[];
|
package/dist/internal/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
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-
|
|
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-
|
|
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-C4FMWIix.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-C4FMWIix.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 { W as HostedSessionView, h as CheckType, ar as PlanStepView } from '../types-
|
|
5
|
-
export {
|
|
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-
|
|
4
|
+
import { W as HostedSessionView, h as CheckType, ar as PlanStepView } from '../types-CgHWIEZj.js';
|
|
5
|
+
export { bd as ICAO_FALLBACK, b7 as IcaoCaptureTuning, be as IcaoProfile, bf as ResolvedIcaoTuning, bg as resolveIcaoTuning } from '../types-CgHWIEZj.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-CYb-35iH.js';
|
|
7
7
|
import '../detect-worker-CHqsPJoM.js';
|
|
8
|
-
import '../capture-session-v3-
|
|
8
|
+
import '../capture-session-v3-IjQwKfLS.js';
|
|
9
9
|
|
|
10
10
|
/** `processing` re-reads (1+2+4+8+15 = 30 s, spec §6.5), then `stalled`. */
|
|
11
11
|
declare const PROCESSING_BACKOFF_MS: readonly number[];
|
package/dist/internal/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as me,d as _e,e as Le,h as le,i as ce,j as Se}from"../chunk-
|
|
1
|
+
import{c as me,d as _e,e as Le,h as le,i as ce,j as Se}from"../chunk-CUBNJXZN.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-THQWX6EH.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-KLEARRAD.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-R4IQTGF5.js";import{A as I,B as u,C as D,i as c,j as S,k as R,l as y,o as T,v as f,w as C,x as A,y as O,z as x}from"../chunk-MJUOZH3U.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-QP23DM4Z.js";import"../chunk-7QZWBDI5.js";import"../chunk-MOOWUPOZ.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-J7D3S5ZJ.js";import{c as e,d as t,f as r,g as o,h as p}from"../chunk-TSA6GHUG.js";import"../chunk-FSXWIMSG.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 +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};
|
|
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-CUBNJXZN.js";import{x as Q}from"./chunk-THQWX6EH.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-KLEARRAD.js";import"./chunk-G6LKLN4U.js";import"./chunk-SMKCBUJL.js";import"./chunk-4DEPREJ3.js";import"./chunk-NFHLJOHW.js";import{b as H,c as G,r as j,t as z,u as L}from"./chunk-MJUOZH3U.js";import"./chunk-QP23DM4Z.js";import"./chunk-7QZWBDI5.js";import"./chunk-MOOWUPOZ.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-J7D3S5ZJ.js";import"./chunk-TSA6GHUG.js";import{a as F}from"./chunk-FSXWIMSG.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};
|
package/dist/popup/index.d.cts
CHANGED
|
@@ -9,8 +9,8 @@ interface SekyroEvent {
|
|
|
9
9
|
event: SekyroEventName;
|
|
10
10
|
sessionId: string;
|
|
11
11
|
/**
|
|
12
|
-
* What the session proved (`1`
|
|
13
|
-
*
|
|
12
|
+
* What the session proved (`1` Contact, `2` Human, `3` Identity, `0`
|
|
13
|
+
* nothing proven), on a terminal event when the hosted page knows it. A
|
|
14
14
|
* display hint only: confirm server-side.
|
|
15
15
|
*/
|
|
16
16
|
level?: 0 | 1 | 2 | 3;
|
package/dist/popup/index.d.ts
CHANGED
|
@@ -9,8 +9,8 @@ interface SekyroEvent {
|
|
|
9
9
|
event: SekyroEventName;
|
|
10
10
|
sessionId: string;
|
|
11
11
|
/**
|
|
12
|
-
* What the session proved (`1`
|
|
13
|
-
*
|
|
12
|
+
* What the session proved (`1` Contact, `2` Human, `3` Identity, `0`
|
|
13
|
+
* nothing proven), on a terminal event when the hosted page knows it. A
|
|
14
14
|
* display hint only: confirm server-side.
|
|
15
15
|
*/
|
|
16
16
|
level?: 0 | 1 | 2 | 3;
|
package/dist/popup/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c}from"../chunk-
|
|
1
|
+
import{a,b,c}from"../chunk-GFJATPUR.js";export{a as SEKYRO_EVENTS,b as open,c as openHosted};
|
|
@@ -271,13 +271,19 @@ interface SessionDecidingStep {
|
|
|
271
271
|
service: string;
|
|
272
272
|
}
|
|
273
273
|
/**
|
|
274
|
-
* What a finished session proved
|
|
275
|
-
*
|
|
276
|
-
* independent source; `0` on a `not_verified` session.
|
|
274
|
+
* What a finished session proved: `1` Contact, `2` Human, `3` Identity; `0`
|
|
275
|
+
* when nothing was proven.
|
|
277
276
|
*/
|
|
278
277
|
type VerificationLevel = 0 | 1 | 2 | 3;
|
|
279
|
-
/**
|
|
280
|
-
|
|
278
|
+
/**
|
|
279
|
+
* How a session's {@link VerificationLevel} was proved, weakest first. Level 1
|
|
280
|
+
* Contact: `device_only`, `contact_email`, `contact_phone`, `unbound_identity`
|
|
281
|
+
* (identity data with no live face matched to it). Level 2 Human: `live_only`,
|
|
282
|
+
* `live_unique`. Level 3 Identity: `supplied_biometric`, `document_biometric`,
|
|
283
|
+
* `eid_authenticated`, `chip_biometric`, `registry_biometric`. To require a
|
|
284
|
+
* particular proof, compare with a list of accepted values on your server.
|
|
285
|
+
*/
|
|
286
|
+
type VerificationAssurance = "device_only" | "contact_email" | "contact_phone" | "unbound_identity" | "live_only" | "live_unique" | "supplied_biometric" | "document_biometric" | "eid_authenticated" | "chip_biometric" | "registry_biometric";
|
|
281
287
|
/** Per-check seven-state machine (spec §4.3). */
|
|
282
288
|
type CheckState = "pending" | "input_required" | "processing" | "passed" | "failed" | "review" | "skipped";
|
|
283
289
|
/**
|
|
@@ -1629,12 +1635,33 @@ interface TesterGateInput {
|
|
|
1629
1635
|
type TesterGateResponse = HostedSessionView & {
|
|
1630
1636
|
bound: boolean;
|
|
1631
1637
|
};
|
|
1638
|
+
/**
|
|
1639
|
+
* Why a Sandbox session ran on simulated test data instead of real checks:
|
|
1640
|
+
* - `no_testers`: the organization has no active Sandbox tester;
|
|
1641
|
+
* - `tester_gate_not_used`: testers exist, and nobody ran the tester check at the start of the session;
|
|
1642
|
+
* - `tester_gate_missed`: the tester check ran and recognized nobody.
|
|
1643
|
+
*/
|
|
1644
|
+
type SandboxSimulatedReason = "no_testers" | "tester_gate_not_used" | "tester_gate_missed";
|
|
1645
|
+
/**
|
|
1646
|
+
* A Sandbox session that ran on simulated test data, and why: the `sandbox` object of `GET /sessions/{id}` and of the
|
|
1647
|
+
* session webhooks. Never present in Live, nor on a session an enrolled tester ran.
|
|
1648
|
+
*/
|
|
1649
|
+
interface SandboxSimulation {
|
|
1650
|
+
/** Always `true`. */
|
|
1651
|
+
simulated: true;
|
|
1652
|
+
reason: SandboxSimulatedReason;
|
|
1653
|
+
}
|
|
1632
1654
|
/** The hosted view's `simulation` block (Sandbox DX spec 2026-11-06 §8): what a simulated session tells the flow. */
|
|
1633
1655
|
interface HostedSimulationView {
|
|
1634
1656
|
/** The code that passes the phone, email and national eID code screens: render it, nothing is delivered. */
|
|
1635
1657
|
otpCode: string;
|
|
1636
1658
|
/** The server takes {@link SimulatedCaptureInput} on the document, chip, liveness and portrait steps. */
|
|
1637
1659
|
skipCapture: boolean;
|
|
1660
|
+
/**
|
|
1661
|
+
* Why no enrolled Sandbox tester ran the session; the result screen says it. Absent on an older API and on a session
|
|
1662
|
+
* a tester had bound before being removed.
|
|
1663
|
+
*/
|
|
1664
|
+
reason?: SandboxSimulatedReason;
|
|
1638
1665
|
}
|
|
1639
1666
|
/**
|
|
1640
1667
|
* The input of a camera step skipped in a simulated session (`doc_ocr`, `nfc_chip`, `liveness`, `face_match`,
|
|
@@ -1933,4 +1960,4 @@ interface SubmitCheckBody {
|
|
|
1933
1960
|
forceOutcome?: "pass" | "fail" | "age_over" | "age_uncertain" | "age_under" | "age_unavailable";
|
|
1934
1961
|
}
|
|
1935
1962
|
|
|
1936
|
-
export { type HostedVoiceView as $, type AcceptedDocumentType as A, type HostedDocumentsView as B, type CaptureContext as C, type DecisionReason as D, type EidAfterPass as E, type FaceMatchInput as F, type HostedEidView as G, type HostedAcceptedDocuments as H, type HostedEmailOtpView as I, type HostedFlowRef as J, type HostedIcaoPolicy as K, type HostedIntegrity as L, type HostedLivePhotoTuning as M, type HostedNativeCaptureTuning as N, type HostedOcrTuning as O, type HostedOtpView as P, type HostedPlanView as Q, type HostedPoaRuleKindView as R, type HostedPoaRuleView as S, type HostedPortraitPendingFix as T, type HostedPortraitView as U, type HostedProofOfAddressView as V, type HostedSessionView as W, type HostedSimulationView as X, type HostedStepView as Y, type HostedTesterGateView as Z, type HostedVoiceLocale as _, type AttestationInput as a, type
|
|
1963
|
+
export { type HostedVoiceView as $, type AcceptedDocumentType as A, type HostedDocumentsView as B, type CaptureContext as C, type DecisionReason as D, type EidAfterPass as E, type FaceMatchInput as F, type HostedEidView as G, type HostedAcceptedDocuments as H, type HostedEmailOtpView as I, type HostedFlowRef as J, type HostedIcaoPolicy as K, type HostedIntegrity as L, type HostedLivePhotoTuning as M, type HostedNativeCaptureTuning as N, type HostedOcrTuning as O, type HostedOtpView as P, type HostedPlanView as Q, type HostedPoaRuleKindView as R, type HostedPoaRuleView as S, type HostedPortraitPendingFix as T, type HostedPortraitView as U, type HostedProofOfAddressView as V, type HostedSessionView as W, type HostedSimulationView as X, type HostedStepView as Y, type HostedTesterGateView as Z, type HostedVoiceLocale as _, type AttestationInput as a, type ScreenRampColour as a$, type IcaoCriterion as a0, type IcaoReportEntry as a1, type IdentityConfirmDecision as a2, type IdentityMethod as a3, type IdentitySummarySource as a4, type IdentitySummaryView as a5, type LivenessCaptureInput as a6, type LivenessInput as a7, type LivenessReason as a8, type MatchReason as a9, type PopulationInput as aA, type PopulationReason as aB, type PortraitFix as aC, type PortraitFixReviewInput as aD, type PortraitIcaoInput as aE, type PortraitIcaoReason as aF, type PortraitOutputFormat as aG, type PresignRequest as aH, type PresignUploadResult as aI, type RecordConsentResult as aJ, type ResolvedCaptureMode as aK, type SandboxSimulatedReason as aL, type SandboxSimulation as aM, type SessionDecidingStep as aN, type SessionFailureReason as aO, type SessionReason as aP, type SessionStatus as aQ, type SessionStepView as aR, type SessionView as aS, type SimulatedCaptureInput as aT, type StepResult as aU, type StepSection as aV, type SubmitCheckBody as aW, type TesterGateInput as aX, type TesterGateResponse as aY, type VerificationAssurance as aZ, type VerificationLevel as a_, type MediaKind as aa, type MethodChoiceView as ab, type NationalEidOption as ac, type NfcChipReason as ad, type NfcStepView as ae, type OtpChoiceView as af, type PhoneCountryRule as ag, type PhoneFormat as ah, type PhoneOtpInput as ai, type PhoneOtpReason as aj, type PhotoSource as ak, type PhotoSourcePick as al, type PlanAttempts as am, type PlanChoiceKind as an, type PlanChoiceOption as ao, type PlanChoiceView as ap, type PlanSectionView as aq, type PlanStepView as ar, type PoaImagesInput as as, type PoaInput as at, type PoaKind as au, type PoaLicenceInput as av, type PoaNameMatchMode as aw, type PoaPdfInput as ax, type PoaReason as ay, type PoaRuleSource as az, type CaptureMode as b, type AgeEstimationReason as b0, type CameraUnavailableCause as b1, type CaptureIssueReport as b2, type CaptureProvenance as b3, type HostedBranding as b4, type HostedBrandingColorKey as b5, type HostedLivenessCaptureTuning as b6, type IcaoCaptureTuning as b7, type RetakeHint as b8, type ScreenRampChallenge as b9, type ScreenRampPaint as ba, type ScreenRampRendered as bb, type ScreenRampReport as bc, ICAO_FALLBACK as bd, type IcaoProfile as be, type ResolvedIcaoTuning as bf, resolveIcaoTuning as bg, type PersonMask as bh, type BackgroundUniformity as bi, type CaptureNoncesResult as c, type CaptureProof as d, type CheckInputByType as e, type CheckReason as f, type CheckState as g, type CheckType as h, type ClosedBy as i, type CompleteMediaResult as j, type ConsentLocale as k, type ContactChannel as l, type DocDeviceRead as m, type DocOcrInput as n, type DocReason as o, type DocSide as p, type EidAuthInput as q, type EidReason as r, type EmailOtpInput as s, type EmailOtpReason as t, type FaceMatchReason as u, type HostedCaptureTuning as v, type HostedChallengeView as w, type HostedConsentView as x, type HostedDocumentCaptureTuning as y, type HostedDocumentScanTuning as z };
|
|
@@ -271,13 +271,19 @@ interface SessionDecidingStep {
|
|
|
271
271
|
service: string;
|
|
272
272
|
}
|
|
273
273
|
/**
|
|
274
|
-
* What a finished session proved
|
|
275
|
-
*
|
|
276
|
-
* independent source; `0` on a `not_verified` session.
|
|
274
|
+
* What a finished session proved: `1` Contact, `2` Human, `3` Identity; `0`
|
|
275
|
+
* when nothing was proven.
|
|
277
276
|
*/
|
|
278
277
|
type VerificationLevel = 0 | 1 | 2 | 3;
|
|
279
|
-
/**
|
|
280
|
-
|
|
278
|
+
/**
|
|
279
|
+
* How a session's {@link VerificationLevel} was proved, weakest first. Level 1
|
|
280
|
+
* Contact: `device_only`, `contact_email`, `contact_phone`, `unbound_identity`
|
|
281
|
+
* (identity data with no live face matched to it). Level 2 Human: `live_only`,
|
|
282
|
+
* `live_unique`. Level 3 Identity: `supplied_biometric`, `document_biometric`,
|
|
283
|
+
* `eid_authenticated`, `chip_biometric`, `registry_biometric`. To require a
|
|
284
|
+
* particular proof, compare with a list of accepted values on your server.
|
|
285
|
+
*/
|
|
286
|
+
type VerificationAssurance = "device_only" | "contact_email" | "contact_phone" | "unbound_identity" | "live_only" | "live_unique" | "supplied_biometric" | "document_biometric" | "eid_authenticated" | "chip_biometric" | "registry_biometric";
|
|
281
287
|
/** Per-check seven-state machine (spec §4.3). */
|
|
282
288
|
type CheckState = "pending" | "input_required" | "processing" | "passed" | "failed" | "review" | "skipped";
|
|
283
289
|
/**
|
|
@@ -1629,12 +1635,33 @@ interface TesterGateInput {
|
|
|
1629
1635
|
type TesterGateResponse = HostedSessionView & {
|
|
1630
1636
|
bound: boolean;
|
|
1631
1637
|
};
|
|
1638
|
+
/**
|
|
1639
|
+
* Why a Sandbox session ran on simulated test data instead of real checks:
|
|
1640
|
+
* - `no_testers`: the organization has no active Sandbox tester;
|
|
1641
|
+
* - `tester_gate_not_used`: testers exist, and nobody ran the tester check at the start of the session;
|
|
1642
|
+
* - `tester_gate_missed`: the tester check ran and recognized nobody.
|
|
1643
|
+
*/
|
|
1644
|
+
type SandboxSimulatedReason = "no_testers" | "tester_gate_not_used" | "tester_gate_missed";
|
|
1645
|
+
/**
|
|
1646
|
+
* A Sandbox session that ran on simulated test data, and why: the `sandbox` object of `GET /sessions/{id}` and of the
|
|
1647
|
+
* session webhooks. Never present in Live, nor on a session an enrolled tester ran.
|
|
1648
|
+
*/
|
|
1649
|
+
interface SandboxSimulation {
|
|
1650
|
+
/** Always `true`. */
|
|
1651
|
+
simulated: true;
|
|
1652
|
+
reason: SandboxSimulatedReason;
|
|
1653
|
+
}
|
|
1632
1654
|
/** The hosted view's `simulation` block (Sandbox DX spec 2026-11-06 §8): what a simulated session tells the flow. */
|
|
1633
1655
|
interface HostedSimulationView {
|
|
1634
1656
|
/** The code that passes the phone, email and national eID code screens: render it, nothing is delivered. */
|
|
1635
1657
|
otpCode: string;
|
|
1636
1658
|
/** The server takes {@link SimulatedCaptureInput} on the document, chip, liveness and portrait steps. */
|
|
1637
1659
|
skipCapture: boolean;
|
|
1660
|
+
/**
|
|
1661
|
+
* Why no enrolled Sandbox tester ran the session; the result screen says it. Absent on an older API and on a session
|
|
1662
|
+
* a tester had bound before being removed.
|
|
1663
|
+
*/
|
|
1664
|
+
reason?: SandboxSimulatedReason;
|
|
1638
1665
|
}
|
|
1639
1666
|
/**
|
|
1640
1667
|
* The input of a camera step skipped in a simulated session (`doc_ocr`, `nfc_chip`, `liveness`, `face_match`,
|
|
@@ -1933,4 +1960,4 @@ interface SubmitCheckBody {
|
|
|
1933
1960
|
forceOutcome?: "pass" | "fail" | "age_over" | "age_uncertain" | "age_under" | "age_unavailable";
|
|
1934
1961
|
}
|
|
1935
1962
|
|
|
1936
|
-
export { type HostedVoiceView as $, type AcceptedDocumentType as A, type HostedDocumentsView as B, type CaptureContext as C, type DecisionReason as D, type EidAfterPass as E, type FaceMatchInput as F, type HostedEidView as G, type HostedAcceptedDocuments as H, type HostedEmailOtpView as I, type HostedFlowRef as J, type HostedIcaoPolicy as K, type HostedIntegrity as L, type HostedLivePhotoTuning as M, type HostedNativeCaptureTuning as N, type HostedOcrTuning as O, type HostedOtpView as P, type HostedPlanView as Q, type HostedPoaRuleKindView as R, type HostedPoaRuleView as S, type HostedPortraitPendingFix as T, type HostedPortraitView as U, type HostedProofOfAddressView as V, type HostedSessionView as W, type HostedSimulationView as X, type HostedStepView as Y, type HostedTesterGateView as Z, type HostedVoiceLocale as _, type AttestationInput as a, type
|
|
1963
|
+
export { type HostedVoiceView as $, type AcceptedDocumentType as A, type HostedDocumentsView as B, type CaptureContext as C, type DecisionReason as D, type EidAfterPass as E, type FaceMatchInput as F, type HostedEidView as G, type HostedAcceptedDocuments as H, type HostedEmailOtpView as I, type HostedFlowRef as J, type HostedIcaoPolicy as K, type HostedIntegrity as L, type HostedLivePhotoTuning as M, type HostedNativeCaptureTuning as N, type HostedOcrTuning as O, type HostedOtpView as P, type HostedPlanView as Q, type HostedPoaRuleKindView as R, type HostedPoaRuleView as S, type HostedPortraitPendingFix as T, type HostedPortraitView as U, type HostedProofOfAddressView as V, type HostedSessionView as W, type HostedSimulationView as X, type HostedStepView as Y, type HostedTesterGateView as Z, type HostedVoiceLocale as _, type AttestationInput as a, type ScreenRampColour as a$, type IcaoCriterion as a0, type IcaoReportEntry as a1, type IdentityConfirmDecision as a2, type IdentityMethod as a3, type IdentitySummarySource as a4, type IdentitySummaryView as a5, type LivenessCaptureInput as a6, type LivenessInput as a7, type LivenessReason as a8, type MatchReason as a9, type PopulationInput as aA, type PopulationReason as aB, type PortraitFix as aC, type PortraitFixReviewInput as aD, type PortraitIcaoInput as aE, type PortraitIcaoReason as aF, type PortraitOutputFormat as aG, type PresignRequest as aH, type PresignUploadResult as aI, type RecordConsentResult as aJ, type ResolvedCaptureMode as aK, type SandboxSimulatedReason as aL, type SandboxSimulation as aM, type SessionDecidingStep as aN, type SessionFailureReason as aO, type SessionReason as aP, type SessionStatus as aQ, type SessionStepView as aR, type SessionView as aS, type SimulatedCaptureInput as aT, type StepResult as aU, type StepSection as aV, type SubmitCheckBody as aW, type TesterGateInput as aX, type TesterGateResponse as aY, type VerificationAssurance as aZ, type VerificationLevel as a_, type MediaKind as aa, type MethodChoiceView as ab, type NationalEidOption as ac, type NfcChipReason as ad, type NfcStepView as ae, type OtpChoiceView as af, type PhoneCountryRule as ag, type PhoneFormat as ah, type PhoneOtpInput as ai, type PhoneOtpReason as aj, type PhotoSource as ak, type PhotoSourcePick as al, type PlanAttempts as am, type PlanChoiceKind as an, type PlanChoiceOption as ao, type PlanChoiceView as ap, type PlanSectionView as aq, type PlanStepView as ar, type PoaImagesInput as as, type PoaInput as at, type PoaKind as au, type PoaLicenceInput as av, type PoaNameMatchMode as aw, type PoaPdfInput as ax, type PoaReason as ay, type PoaRuleSource as az, type CaptureMode as b, type AgeEstimationReason as b0, type CameraUnavailableCause as b1, type CaptureIssueReport as b2, type CaptureProvenance as b3, type HostedBranding as b4, type HostedBrandingColorKey as b5, type HostedLivenessCaptureTuning as b6, type IcaoCaptureTuning as b7, type RetakeHint as b8, type ScreenRampChallenge as b9, type ScreenRampPaint as ba, type ScreenRampRendered as bb, type ScreenRampReport as bc, ICAO_FALLBACK as bd, type IcaoProfile as be, type ResolvedIcaoTuning as bf, resolveIcaoTuning as bg, type PersonMask as bh, type BackgroundUniformity as bi, type CaptureNoncesResult as c, type CaptureProof as d, type CheckInputByType as e, type CheckReason as f, type CheckState as g, type CheckType as h, type ClosedBy as i, type CompleteMediaResult as j, type ConsentLocale as k, type ContactChannel as l, type DocDeviceRead as m, type DocOcrInput as n, type DocReason as o, type DocSide as p, type EidAuthInput as q, type EidReason as r, type EmailOtpInput as s, type EmailOtpReason as t, type FaceMatchReason as u, type HostedCaptureTuning as v, type HostedChallengeView as w, type HostedConsentView as x, type HostedDocumentCaptureTuning as y, type HostedDocumentScanTuning as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sekyro/web",
|
|
3
|
-
"version": "0.1.0-rc.
|
|
3
|
+
"version": "0.1.0-rc.28",
|
|
4
4
|
"description": "Sekyro AI web SDK \u2014 browser liveness capture, hosted-verification client and popup embed for Sekyro AI identity verification",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"repository": {
|
package/sbom.cdx.json
CHANGED
|
@@ -97,8 +97,8 @@
|
|
|
97
97
|
"type": "application",
|
|
98
98
|
"name": "web",
|
|
99
99
|
"group": "@sekyro",
|
|
100
|
-
"version": "0.1.0-rc.
|
|
101
|
-
"bom-ref": "@sekyro/web@0.1.0-rc.
|
|
100
|
+
"version": "0.1.0-rc.28",
|
|
101
|
+
"bom-ref": "@sekyro/web@0.1.0-rc.28",
|
|
102
102
|
"description": "Sekyro AI web SDK — browser liveness capture, hosted-verification client and popup embed for Sekyro AI identity verification",
|
|
103
103
|
"licenses": [
|
|
104
104
|
{
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
],
|
|
111
|
-
"purl": "pkg:npm/%40sekyro/web@0.1.0-rc.
|
|
111
|
+
"purl": "pkg:npm/%40sekyro/web@0.1.0-rc.28?vcs_url=git%2Bhttps%3A%2F%2Fgithub.com%2FIBTIKAR-Technologies%2Fibtikar-identity.git%23packages%2Fsekyro-web",
|
|
112
112
|
"externalReferences": [
|
|
113
113
|
{
|
|
114
114
|
"url": "https://github.com/IBTIKAR-Technologies/ibtikar-identity/issues",
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
"name": "tasks-vision",
|
|
151
151
|
"group": "@mediapipe",
|
|
152
152
|
"version": "0.10.35",
|
|
153
|
-
"bom-ref": "@sekyro/web@0.1.0-rc.
|
|
153
|
+
"bom-ref": "@sekyro/web@0.1.0-rc.28|@mediapipe/tasks-vision@0.10.35",
|
|
154
154
|
"licenses": [
|
|
155
155
|
{
|
|
156
156
|
"license": {
|
|
@@ -185,7 +185,7 @@
|
|
|
185
185
|
"name": "thumbmarkjs",
|
|
186
186
|
"group": "@thumbmarkjs",
|
|
187
187
|
"version": "1.12.0",
|
|
188
|
-
"bom-ref": "@sekyro/web@0.1.0-rc.
|
|
188
|
+
"bom-ref": "@sekyro/web@0.1.0-rc.28|@thumbmarkjs/thumbmarkjs@1.12.0",
|
|
189
189
|
"licenses": [
|
|
190
190
|
{
|
|
191
191
|
"license": {
|
|
@@ -218,17 +218,17 @@
|
|
|
218
218
|
],
|
|
219
219
|
"dependencies": [
|
|
220
220
|
{
|
|
221
|
-
"ref": "@sekyro/web@0.1.0-rc.
|
|
221
|
+
"ref": "@sekyro/web@0.1.0-rc.28",
|
|
222
222
|
"dependsOn": [
|
|
223
|
-
"@sekyro/web@0.1.0-rc.
|
|
224
|
-
"@sekyro/web@0.1.0-rc.
|
|
223
|
+
"@sekyro/web@0.1.0-rc.28|@mediapipe/tasks-vision@0.10.35",
|
|
224
|
+
"@sekyro/web@0.1.0-rc.28|@thumbmarkjs/thumbmarkjs@1.12.0"
|
|
225
225
|
]
|
|
226
226
|
},
|
|
227
227
|
{
|
|
228
|
-
"ref": "@sekyro/web@0.1.0-rc.
|
|
228
|
+
"ref": "@sekyro/web@0.1.0-rc.28|@mediapipe/tasks-vision@0.10.35"
|
|
229
229
|
},
|
|
230
230
|
{
|
|
231
|
-
"ref": "@sekyro/web@0.1.0-rc.
|
|
231
|
+
"ref": "@sekyro/web@0.1.0-rc.28|@thumbmarkjs/thumbmarkjs@1.12.0"
|
|
232
232
|
}
|
|
233
233
|
]
|
|
234
234
|
}
|
package/dist/chunk-DVTK2DGX.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A as Re,D as w,E as j,d as K,e as ge,f as ye,g as be,i as _e,j as ee,l as q,m as te,o as Ce,p as Pe,t as ke}from"./chunk-ZCW6PNUX.js";import{c as me,d as he,e as Se}from"./chunk-FPXL63KZ.js";import{c as F,h as Q,i as Me}from"./chunk-XOTKATN6.js";var Ae=["AD","AE","AF","AG","AI","AL","AM","AO","AQ","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","XK","YE","YT","ZA","ZM","ZW"];var qe=["carte_identite","passport","residence_permit","drivers_license"],Qe=["carte_identite","passport","residence_permit"];function Je(e,t){let o=e.byIssuer?.[t]??e.default;return qe.filter(s=>o==="*"?Qe.includes(s):o.includes(s))}function zt(e,t=Ae){return[...new Set([...t,...Object.keys(e.byIssuer??{})])].filter(s=>Je(e,s).length>0).sort()}function Ee(e){if(e.acceptedDocuments)return e.acceptedDocuments;let t=e.acceptedDocumentTypes?.length?[...e.acceptedDocumentTypes]:["carte_identite","passport"];return{default:[],byIssuer:{MR:t}}}var ze=640,Xe=new Set(["network_error","timeout","upload_failed","unknown_error","rate_limit_exceeded"]),Ie=6,ve=1500,Oe={sharpness:1,exposure:1,meanLuma:128},Te=null;function et(e,t){try{Te??(Te=document.createElement("canvas"));let o=Te,s=96/Math.max(1,t.width);o.width=Math.max(1,Math.round(t.width*s)),o.height=Math.max(1,Math.round(t.height*s));let i=o.getContext("2d");if(i===null)return Oe;i.drawImage(e,t.x,t.y,t.width,t.height,0,0,o.width,o.height);let c=i.getImageData(0,0,o.width,o.height);return{sharpness:he(c),exposure:Se(c),meanLuma:me(c)}}catch{return Oe}}async function tt(e,t){let o=e.source;return"convertToBlob"in o?o.convertToBlob({type:"image/jpeg",quality:t}):new Promise((s,i)=>{o.toBlob(c=>c===null?i(new Error("encode failed")):s(c),"image/jpeg",t)})}function on(e,t={}){let o=t.now??(()=>performance.now()),s=t.setTimer??((f,_)=>setTimeout(f,_)),i=t.clearTimer??(f=>clearTimeout(f)),c=t.encode??tt,d=t.quality??et,u=e.tuningVersion??null,p=new Set,S=!1,y=e.video??null,M=null,m=t.grabFrame??null,b=null,v=1e3/Ie,E=null,I=null,O=!1,L=!1,D=Number.NEGATIVE_INFINITY,A=null,G=0,V=null,B=null,z=Promise.all([import("./icao-gate-T3BTOKFJ.js"),import("./icao-tuning-4ETMF53W.js"),import("./create-portrait-capture-5VGYZUOK.js"),import("./landmarker-KB7LVXAU.js"),import("./background-monitor-A7FKJOAG.js")]).then(async([f,_,R,x,T])=>{let k=_.resolveIcaoTuning(e.tuning,e.tuningVersion??void 0);k.background.required&&(I=T.createBackgroundMonitor({tuning:k.backgroundCheck,assetBaseUrl:e.assetBaseUrl??"/models-v3",...t.createSegmenter!==void 0?{createSegmenter:t.createSegmenter}:{},now:o})),M=f.createIcaoGate(k,{policy:e.policy??"reject"}),m??(m=R.defaultGrabber()),b=R.observe,v=1e3/Math.min(Ie,k.cadenceHz);let n=(t.createLandmarker??x.createFaceLandmarker)(e.assetBaseUrl??"/models-v3"),r=await new Promise((a,l)=>{let h=setTimeout(()=>{l(new Error("landmarker init timeout")),n.then(g=>g.close(),()=>{})},x.LANDMARKER_INIT_TIMEOUT_MS);n.then(g=>{clearTimeout(h),a(g)},g=>{clearTimeout(h),l(g)})});S?r.close():E=r}).catch(()=>{O=!0}),H=f=>{for(let _ of p)_({holding:L||O,update:f})},Y=()=>{if(A=null,!(S||E===null||M===null||m===null||b===null||y===null)){if(o()-D>ve){H(null);return}try{let f=m(y,ze);if(f!==null){let _=Math.max(o(),G+1);G=_;let R=E.detect(f.source,_),x=y.videoWidth||f.width,T=y.videoHeight||f.height,k=b(R,f,x,T);k.geometry!==null&&I!==null&&(k.backgroundCheck=I.measure(f,k.geometry.box,x,T));let n=M.push(k,o());L=n.ready,H(n)}}catch{}A=s(Y,v)}},Z=()=>{let f=o()-D>ve;D=o(),f&&(M?.reset(),L=!1,V=null,B=null),A===null&&E!==null&&!S&&(A=s(Y,0))},X=()=>{let f=m===null||y===null?null:m(y,null);if(f===null||M===null||Math.max(f.width,f.height)<e.still.minLongSidePx)return Promise.resolve(null);let _=M.summary();return c(f,e.still.jpegQuality).then(R=>({image:R,width:f.width,height:f.height,gate:_}),()=>null)},W=null;return{engineOptions:{measureQuality:(f,_)=>{y=f,Z();let R=d(f,_);return L||O?R:{...R,sharpness:0}},telemetry:f=>{if(f.type!=="fired"||S)return;V=X();let _=W;_!==null&&V.then(R=>R===null?void 0:_(R).catch(()=>{})),L=!1,A!==null&&i(A),A=null,D=Number.NEGATIVE_INFINITY}},decorate:f=>{let _=new WeakMap,R=new Map,x=r=>{let a=_.get(r);return a===void 0&&(a=(async()=>{let l=await ke(f,"image","image/jpeg",r.image.size,{engine:"portrait"});return await f.uploadToSpaces(l.uploadUrl,r.image,"image/jpeg"),(await f.completeMedia(l.key)).key})(),a.catch(()=>_.delete(r)),_.set(r,a)),a};W=x;let T=async r=>{let a;try{a=await x(r)}catch(l){let h=l?.code;if(typeof h=="string"&&Xe.has(h))throw l;return null}return{media:{portrait:a},gate:Me(r.gate),...u!==null?{tuningVersion:u}:{}}},k=f.submitCheck.bind(f),n=(async(r,a,l)=>{if(r!=="liveness")return k(r,a,l);let h=l?.idempotencyKey,g=h===void 0?void 0:R.get(h);if(g===void 0){let pe=V;g=pe===null?Promise.resolve(null):pe.then(fe=>fe===null?null:T(fe)),h!==void 0&&(R.set(h,g),g.catch(()=>R.delete(h)))}let C=await g;if(C===null)return k("liveness",a,l);let P=await k("liveness",{...a,portraitIcao:C},l);return B=C,P});return new Proxy(f,{get(r,a){if(a==="submitCheck")return n;let l=Reflect.get(r,a);return typeof l=="function"?l.bind(r):l}})},onGate:f=>(p.add(f),()=>p.delete(f)),lastPortraitInput:()=>B,destroy:()=>{S=!0,V=null,B=null,A!==null&&i(A),A=null,p.clear(),z.then(()=>{E?.close(),E=null,I?.close(),I=null})}}}function xe(e){return e.idNumberBound??e.nniBound}function we(e){return e===void 0?void 0:e.idNumberFromDocument??e.nniFromDocument}function Ne(e){let t=e.idNumberMasked??e.nniMasked;return typeof t=="string"&&t!==""?t:void 0}var Le=Object.freeze({nni_invalid:"id_number_invalid",nni_not_found:"registry_record_not_found",nni_recheck:"id_number_recheck",document_nni_mismatch:"document_id_number_mismatch",nni_locked:"id_number_locked",nni_unbound:"id_number_unbound",missing_nni:"missing_id_number",registry_needs_nni_source:"registry_needs_id_number_source"}),nt=new Map(Object.entries(Le)),an=new Map(Object.entries(Le).map(([e,t])=>[t,e]));function Ve(e){return nt.get(e)??e}var ot=new Set(["phone_otp","email_otp","national_eid","document","nfc","population_registry","supplied_identity","summary_confirm","liveness","portrait","face_match","aml_screening","face_dedup","age_estimation","proof_of_address"]),it=new Set(["supplied_identity","aml_screening","face_dedup","age_estimation"]),oe=["document","population_registry","national_eid"],ie=["phone_otp","email_otp"],Ge={identity_method:oe,contact:ie},rt=["population_registry","document"],re="platform_unsupported",st=new Set(["prefilled","user_entered","prefilled_or_entered"]),at={phone_otp:"contact",email_otp:"contact",eid_auth:"identity",doc_ocr:"identity",nfc_chip:"identity",population_registry:"identity",liveness:"live_photo",portrait_icao:"live_photo",face_match:"live_photo",poa:"documents"};function N(e){return e.section??at[e.checkType]??null}function se(e,t){let o=e.plan?.choice;if(o===void 0||o.locked)return;let s=o.options.find(i=>i.id!==o.selected&&i.available!==!1&&t.includes(i.service));return s===void 0?void 0:{nodeId:o.nodeId,option:s}}function ae(e){let t=e.plan,o=t?.choice;if(t===void 0||o===void 0||o.locked||t.current===null||t.current===o.nodeId||ee(e))return null;let s=Ge[o.kind]??[...oe,...ie],i=o.options.flatMap(u=>u.available===!1||!s.includes(u.service)?[]:[u.nationalEid!=null?{id:u.id,service:u.service,nationalEid:u.nationalEid}:{id:u.id,service:u.service}]),c=t.steps.find(u=>u.id===t.current)?.service,d=o.selected??i.find(u=>u.service===c)?.id??null;return i.some(u=>u.id!==d)?{nodeId:o.nodeId,kind:o.kind,current:d,options:i}:null}function Be(e){return e==null?[]:e.options.filter(t=>t.id!==e.current)}function ct(e){let t=e.simulation;if(typeof t!="object"||t===null)return;let{otpCode:o,skipCapture:s}=t;return typeof o=="string"&&o!==""&&typeof s=="boolean"?{otpCode:o,skipCapture:s}:void 0}function ut(e){let t=(e.plan?.sections??[]).map(d=>({id:d.id,state:d.state})),o={sessionId:te(e.sessionId),orgName:e.orgName,sandbox:e.sandbox===!0,returning:e.returning===!0,consentRecorded:e.consentRecorded,expiresAt:e.expiresAt,sections:t.map(d=>d.id),progress:t,purpose:e.purpose??"identity"};e.branding!==void 0&&(o.branding=e.branding),e.cameraUnavailableHandled===!0&&(o.cameraUnavailableHandled=!0);let s=ct(e);s!==void 0&&(o.simulation=s);let i=e.testerGate;i?.offered===!0&&typeof i.attemptsLeft=="number"&&i.attemptsLeft>0&&(o.testerGate={attemptsLeft:i.attemptsLeft});let c=ae(e);return c!==null&&(o.switchable=c),o}function dt(e){let t={attemptsRemaining:ye(e),attemptsExhausted:e.attempts.used>=e.attempts.max};return e.reason!==void 0&&(t.reason=e.reason),e.retakeHint!==void 0&&(t.retakeHint=e.retakeHint),t}var Ue={phone_otp:"phone",email_otp:"email"};function lt(e,t){let o=se(e,[t==="phone_otp"?"email_otp":"phone_otp"]);return o===void 0?void 0:Ue[o.option.service]}function pt(e,t,o,s){let i=t.checkType==="email_otp",c=(i?t.emailOtp:t.otp)??{},d=i?t.emailOtp?.emailSource:t.otp?.numberSource,u=d!==void 0&&st.has(d)?d:i?"prefilled_or_entered":"user_entered",p=typeof c.sentToMasked=="string"&&c.sentToMasked.length>0,S=c.prefilled===!0,y=lt(e,i?"email_otp":"phone_otp"),M={key:t.checkType,context:o,section:N(t),phase:p?"verify":"send",canSwitch:y!==void 0,...s},m=i?{kind:"email_otp",...M,emailSource:u,needsEmail:u!=="prefilled"&&!S}:{kind:"phone_otp",...M,numberSource:u,needsPhone:u!=="prefilled"&&!S,channels:(t.otp?.channels??[]).filter(b=>b==="whatsapp"||b==="sms")};if(y!==void 0&&(m.switchChannel=y),S&&(m.prefilled=!0),p&&(m.sentToMasked=c.sentToMasked),!i&&t.otp?.channel!==void 0&&(m.channel=t.otp.channel),!i&&Array.isArray(t.phoneCountries)&&(m.phoneCountries=t.phoneCountries.filter(b=>typeof b=="string"&&/^[A-Z]{2}$/.test(b))),!i&&Array.isArray(t.phoneRules)){let b=m.phoneCountries??[];m.phoneRules=t.phoneRules.flatMap(v=>{let E=ht(v);return E!==void 0&&b.includes(E.code)?[E]:[]})}return!i&&t.phoneInternational===!0&&(m.phoneInternational=!0),c.expiresAt!==void 0&&(m.codeExpiresAt=c.expiresAt),c.resendAvailableAt!==void 0&&(m.resendAvailableAt=c.resendAvailableAt),m}var ft=/^[\d[\]\-|()?:^]{1,64}$/;function mt(e){try{return typeof e=="string"&&ft.test(e)&&new RegExp(e)!==null}catch{return!1}}var De=e=>typeof e=="number"&&Number.isInteger(e)&&e>=1&&e<=15;function ht(e){let{code:t,dial:o,trunk:s,lengths:i,formats:c}=e??{};if(typeof t!="string"||typeof o!="string"||!/^\d{1,3}$/.test(o)||s!==void 0&&(typeof s!="string"||!/^\d{1,3}$/.test(s))||!Array.isArray(i)||i.length===0||!i.every(De))return;let d={code:t,dial:o,lengths:[...i].sort((u,p)=>u-p)};if(s!==void 0&&(d.trunk=s),c!==void 0){if(!(Array.isArray(c)&&c.length<=8&&c.every(p=>mt(p?.leading)&&Array.isArray(p.groups)&&p.groups.every(De)&&i.includes(p.groups.reduce((S,y)=>S+y,0)))))return;d.formats=c.map(p=>({leading:p.leading,groups:[...p.groups]}))}return d}function St(e,t,o,s){let i=xe(e)===!0?"bound":we(t)===!0?"document":"typed",c=i==="typed"&&t.state==="input_required"&&t.reason!==void 0&&Ve(t.reason)==="id_number_recheck",d=Be(ae(e)),u=!s.attemptsExhausted&&d.length===1&&d[0]?.service==="document";return{kind:"registry",key:"registry",context:o,section:N(t),state:t.state==="input_required"?"input_required":"pending",source:i,recheck:c,canUseDocument:u,...s}}function gt(e,t,o,s,i){let c=[...t.acceptedSides??[]],d={kind:"document",key:"document",context:o,section:N(t),side:c.includes("recto")?"verso":"recto",acceptedSides:c,documents:Ee(e),photo:ue(ce(e.documents),i),...s};return e.detectedCountry!==void 0&&(d.detectedCountry=e.detectedCountry),_t(e)&&(d.ageStepUp=!0),d}function ce(e,t=!0){let o=e?.source==="upload"||e?.source==="choice"?e.source:"camera",s=e?.sourcePick==="camera"||e?.sourcePick==="upload"?e.sourcePick:null;return{source:o,pick:s,uploadOffered:t&&e?.uploadOffered===!0}}function ue(e,t){return t?{...e,cameraOnPhone:!0}:e}var yt=10*1024*1024;function bt(e,t,o,s,i){let c=e.proofOfAddress,d=c?.pdf?.maxBytes,u=c?.phase==="holder_letter"?"holder_letter":"document";return{kind:"proof_of_address",key:"proof_of_address",context:o,section:N(t),phase:u,rule:c?.rule??{country:null,countryFrom:"global",source:"preset_global",kinds:[]},nameMatch:c?.nameMatch??"exact_person",photo:ue(ce(c),i),maxPages:3,pdf:{maxBytes:typeof d=="number"&&d>0?d:yt,maxPages:3},licenceAddressAccepted:u==="document"&&c?.licenceAddressAccepted===!0,...s}}function _t(e){let t=ge(e).find(s=>s.checkType==="age_estimation"),o=t?.reason;return t?.state==="failed"&&(o==="age_uncertain"||o==="age_unavailable")}function Ct(e){let t=q(e,"liveness");return t?.state==="passed"||t?.state==="review"}function He(e,t,o,s,i,c=!1){let d=t.icao?.report,u=e.portrait,p=i==="capture"?u?.pendingFix??null:null;p!==null&&(i="review");let S=Fe(e);return{kind:"portrait",key:`portrait:${i}`,context:o,section:N(t),phase:i,report:Array.isArray(d)?d:null,review:t.state==="review",tuning:e.capture?.icao??null,tuningVersion:e.capture?.tuningVersion??null,icao:Q(e),retakeOnly:i==="capture"&&t.state==="input_required"&&S===void 0&&e.capture?.livePhoto?.oneCapture===!0&&Ct(e),photo:ue(ce(u,i==="capture"),c&&i==="capture"),pendingFix:p,...S!==void 0?{captureMode:S}:{},...u?.reuse?.pending===!0?{reuse:!0}:{},...s}}function Fe(e){let t=e.portrait?.captureMode;return t==="self"||t==="assisted"||t==="choice"?t:void 0}var ne={minLongSidePx:1280,jpegQuality:.95};function Pt(e,t){let o=e.capture?.livePhoto;if(o?.oneCapture!==!0)return null;let s=q(e,"portrait_icao"),i=o.still??ne;return{icao:t==="liveness"&&Q(e)!==null&&Fe(e)===void 0&&s!==void 0&&s.state==="pending"&&s.reason===void 0,still:{minLongSidePx:i.minLongSidePx??ne.minLongSidePx,jpegQuality:i.jpegQuality??ne.jpegQuality}}}function kt(e,t,o,s){let i=t.eid,c=N(t);if(i===void 0||i.challenge!=="app_code")return{kind:"unsupported",key:"unsupported:eid_auth",context:o,section:c,checkType:"eid_auth",reason:"update_required"};let d=Be(ae(e)),u=d.length===1&&rt.includes(d[0]?.service??"")?d[0]:void 0,p=u===void 0?void 0:K[u.service],S=p!==void 0,y={kind:"eid",key:"eid",context:o,section:c,provider:i.provider,providerName:i.providerName,country:i.country,challenge:"app_code",phase:i.awaiting==="code"?"code":"identifier",identifierBound:i.identifierBound===!0,canUseCamera:S,afterPass:i.afterPass==="continue"?"continue":"end",...s};return S&&(y.cameraMethod=p),i.expiresAt!==void 0&&(y.codeExpiresAt=i.expiresAt),i.resendAvailableAt!==void 0&&(y.resendAvailableAt=i.resendAvailableAt),i.resendsRemaining!==void 0&&(y.resendsRemaining=i.resendsRemaining),i.codeAttemptsRemaining!==void 0&&(y.codeAttemptsRemaining=i.codeAttemptsRemaining),y}function Rt(e,t){if(t.checkType!=="face_match"||t.reason!==void 0)return null;let o=q(e,"portrait_icao");return o!==void 0&&(o.state==="passed"||o.state==="review")?o:null}var Mt={rejected:"rejected",inconclusive:"inconclusive",unavailable:"unavailable",abandoned:"expired",not_opened:"expired",cancelled:"expired",superseded:"expired",policy:"policy"};function At(e){return e.reasonCode===re?"platform_unsupported":e.status==="review_pending"?"review":e.status==="verified"?"verified":e.reasonCode==="device_cooldown"?"cooldown":e.reasonCode==="starter_credit_claimed"?"policy":(e.status==="not_verified"&&e.reason!==void 0?Mt[e.reason]:void 0)??"rejected"}function Et(e,t){let o=At(e),s=o==="platform_unsupported"?{sessionId:te(e.sessionId),status:"unavailable",reasonCode:re}:Ce(e,{autoRetry:!1}),i={kind:"result",key:"result",context:t,section:null,display:o,result:s};return e.status==="not_verified"&&e.reason!==void 0&&(i.reason=e.reason),e.reasonCode!==void 0&&(i.reasonCode=e.reasonCode),e.status==="not_verified"&&e.step!==void 0&&(i.step=e.step),e.retryAfter!==void 0&&(i.retryAfter=e.retryAfter),i}function It(e,t,o){let s=e.identitySummary;if(s==null)return null;let i={kind:"identity_summary",key:"identity_summary",context:t,section:o??"identity",summaryKind:s.kind==="partial"?"partial":s.kind??"full",source:s.source,portraitAvailable:s.portrait?.available===!0,retakeAvailable:s.retakeAvailable===!0};for(let d of vt){let u=s[d];typeof u=="string"&&u!==""&&(i[d]=u)}let c=Ne(s);return c!==void 0&&(i.idNumberMasked=c,i.nniMasked=c),i}var vt=["fullName","birthDate","birthYear","nationality","documentType","documentNumberMasked","expiryDate","retakeTarget"];function U(e,t,o,s){return{kind:"unsupported",key:`unsupported:${o}`,context:e,section:t,checkType:o,reason:s}}function Ot(e){return e.kind==="contact"?"contact":(e.kind==="identity_method","identity")}function Tt(e,t){let o=Ge[e.kind]??[...oe,...ie],s=Ot(e),i=e.options.flatMap(d=>{if(d.available===!1||!o.includes(d.service))return[];let u={id:d.id,service:d.service};d.nationalEid!=null&&(u.nationalEid=d.nationalEid);let p=(d.channels??[]).filter(S=>S==="whatsapp"||S==="sms");return d.service==="phone_otp"&&p.length>0&&(u.channels=p),[u]});if(i.length===0){let d=e.options.length>0&&e.options.every(u=>u.service==="nfc");return U(t,s,"choice",d?"platform_unsupported":"update_required")}let c={nodeId:e.nodeId,kind:e.kind,selected:e.selected,options:i};if(e.kind==="identity_method"){let d={kind:"method",key:"method",context:t,section:s,options:i.map(p=>K[p.service]),choice:c},u=i.find(p=>p.nationalEid!==void 0)?.nationalEid;return u!==void 0&&(d.nationalEid=u),d}return e.kind==="contact"?{kind:"contact_choice",key:"contact_choice",context:t,section:s,options:i.map(d=>Ue[d.service]),selected:null,locked:!1,choice:c}:{kind:"choice",key:`choice:${e.nodeId}`,context:t,section:s,choice:c}}function J(e,t={}){let o=ut(e);if(ee(e)||e.reasonCode===re)return Et(e,o);let s=e.plan;if(s===void 0||!Array.isArray(s.sections))return U(o,null,"plan","update_required");let i=be(e);if(i!==null)return Tt(i,o);let c=s.current===null?void 0:s.steps.find(m=>m.id===s.current),d=m=>{let b={kind:"processing",key:"processing",context:o,section:m!==void 0?N(m):s.sections.find(v=>v.state==="current")?.id??null,stalled:!1};return typeof m?.service=="string"&&m.service!==""&&(b.service=m.service),b};if(s.current===null)return d(s.steps.find(m=>m.state==="processing"));if(c===void 0)return U(o,null,"step","update_required");if(!ot.has(c.service))return c.interaction==="server"?d(c):U(o,N(c),c.service,"update_required");if(it.has(c.service)||!_e(c))return d(c);let u=c,p=dt(u),S=u.checkType,y=N(u),M=t.isMobile===!1?Pe(e,u):null;if(M==="phone")return{kind:"mobile_required",key:"mobile_required",context:o,section:y,checkType:S};switch(S){case"phone_otp":case"email_otp":return pt(e,u,o,p);case"population_registry":return St(e,u,o,p);case"eid_auth":return kt(e,u,o,p);case"doc_ocr":return gt(e,u,o,p,M==="upload_or_phone");case"identity_confirm":return It(e,o,y)??d(u);case"portrait_icao":return He(e,u,o,p,"capture",M==="upload_or_phone");case"liveness":case"face_match":{let m=Rt(e,u);if(m!==null)return He(e,m,o,p,"match");let b=u.requiresMobile===!0,v=Q(e);return{kind:"liveness",key:"biometric",context:o,section:y,mode:S==="face_match"?"selfie":"liveness",requiresMobile:b,instructions:v===null?"standard":"icao",icao:v,livePhoto:Pt(e,S),...p}}case"poa":return bt(e,u,o,p,M==="upload_or_phone");case"nfc_chip":return U(o,y,S,"platform_unsupported");default:return U(o,y,S,"update_required")}}var xt=/^[A-Z0-9][A-Z0-9 -]{0,39}$/,wt=Object.freeze({normalize:e=>e.trim().toUpperCase().replace(/\s+/g," "),check:e=>xt.test(e),registrySources:Object.freeze([]),describe:"number must be 1 to 40 letters, digits, spaces or hyphens"}),Nt=/^[A-Z0-9]{4,20}$/,Ke=e=>e.trim().toUpperCase().replace(/[\s-]+/g,""),je=Object.freeze({normalize:Ke,check:e=>Nt.test(Ke(e)),registrySources:Object.freeze([]),describe:"number must be 4 to 20 letters or digits"});function Lt(e){return typeof e=="string"&&/^\d{10}$/.test(e)&&Number(e)%97===1}var Vt=Object.freeze({normalize:e=>e.trim(),check:e=>Lt(e),registrySources:Object.freeze(["MR.anrpts"]),describe:"number must be the 10-digit Mauritanian national ID number with a valid check digit"}),Dt=Object.freeze({...je,check:e=>/^\d{8}$/.test(e.trim()),describe:"number must be the 8-digit Mauritanian driver's license number"}),Ht=Object.freeze({"MR:national_id":Vt,"MR:drivers_license":Dt});function de(e,t){return Ht[`${e.toUpperCase()}:${t}`]??(t==="drivers_license"?je:wt)}var Gt=Object.freeze({MRT:"MR"});function Ye(e,t){let o=e.trim().toUpperCase();return de(Gt[o]??o,t)}function Ze(e){let t=Ye(e.issuingCountry,e.type);return t.check(t.normalize(e.number))}function We(e){return de("MR","national_id").check(e)}function le(e){let t="";for(let o of e){let s=o.codePointAt(0)??0;s>=1632&&s<=1641?t+=String(s-1632):s>=1776&&s<=1785?t+=String(s-1776):o!==" "&&o!=="-"&&o!==" "&&(t+=o)}return t}var Bt=[1e3,2e3,4e3,8e3,15e3],Ut=3e4,Ft=/^\+[1-9]\d{6,14}$/,Kt=/^\d{6}$/,jt=/^\d{6}$/,Yt=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,$e=new Set(["session_not_active","check_not_found","check_already_finalized","check_out_of_order","identity_confirm_required","identity_confirm_locked","choice_locked","choice_option_unavailable","choice_not_found","step_not_on_path","check_not_active"]),Zt={simulatedCapture:!0},Wt=new Set(["network_error","timeout","upload_failed","unknown_error","rate_limit_exceeded"]);function Mn(e){let t=!1,o=null,s="",i=!1,c=!1,d=!1,u={},p={},S=new Set,y=!1,M=!1,m=null,b="idle",v=new Map,E=new Map,I=(n,r,a)=>{let l=`${n}.${r}`,h=v.get(l);if(h!==void 0)return h;let g=E.get(n),C=(g===void 0?a():g.then(a)).finally(()=>{v.delete(l)});v.set(l,C);let P=C.then(()=>{},()=>{});return E.set(n,P),P.then(()=>{E.get(n)===P&&E.delete(n)}),C},O=async(n,r,a)=>{await e.ensureConsent();let l;try{l=await Re(e.runtime,r)}catch(g){if(g instanceof F&&$e.has(g.code)){await e.refreshView();return}throw g}if(a?.(l),e.destroyed())return;let h=l;h.plan!==void 0&&e.setView!==void 0?e.setView(h):await e.refreshView()},L=async n=>{await e.ensureConsent();let r;try{try{r=await n(e.runtime.client)}catch(a){if(!(a instanceof F)||a.code!=="consent_required")throw a;await e.runtime.ensureConsent({force:!0}),r=await n(e.runtime.client)}}catch(a){if(a instanceof F&&$e.has(a.code)){await e.refreshView();return}throw a}e.destroyed()||(r!==void 0&&e.setView!==void 0?e.setView(r):await e.refreshView())},D=(n,r)=>I("choice",`${n}:${r}`,()=>L(a=>a.choose(n,r))),A=(n,r)=>n.options.some(a=>a.id===r)?D(n.nodeId,r):Promise.reject(new RangeError(`option ${String(r)} is not offered`)),G=(n,r)=>{let a=e.currentView(),l=a===null?void 0:se(a,n);return l===void 0?Promise.reject(new RangeError(`the ${r} is not offered`)):D(l.nodeId,l.option.id)},V=n=>I("identity",n,()=>L(r=>r.confirmIdentity===void 0?Promise.reject(new Error("identity confirmation is not available in this build")):r.confirmIdentity(n))),B=(n,r)=>{let a=n.kind,l=a==="phone_otp",h=l?"phone":"email",g={action:"send"};if(l?n.needsPhone:n.needsEmail){let C=r[h]??p[a],P=l?C?.replace(/[\s().-]/g,""):C?.trim();if(P!==void 0||n.phase!=="verify"){if(P===void 0||!(l?Ft:Yt).test(P))return Promise.reject(l?new w("phone","format"):new j("email","format"));g[h]=P}}if(l){let C=n.channels,P=r.channel??(C.length===1?C[0]:void 0);if(C.length>0){if(P===void 0)return Promise.reject(new j("channel","required"));if(!C.includes(P))return Promise.reject(new j("channel","unavailable"))}P!==void 0&&(g.channel=P),g.phoneRules=1}return I(a,"send",()=>O(a,(C,P)=>C.submitCheck(a,g,{idempotencyKey:P}),C=>{qt(C,a)||(u[a]=e.now(),g[h]!==void 0&&(p[a]=g[h]))}))},z=(n,r)=>Kt.test(r)?I(n,"verify",()=>O(n,(a,l)=>a.submitCheck(n,{action:"verify",code:r},{idempotencyKey:l}))):Promise.reject(new w("code","format")),H=(n,r)=>I("eid_auth",n,()=>O("eid_auth",(a,l)=>a.submitCheck("eid_auth",r,{idempotencyKey:l}))),Y=(n,r)=>{if(n.identifierBound)return H("start",{action:"start"});let a=le(r??"");if(n.country==="MR"){if(!/^\d{10}$/.test(a))return Promise.reject(new w("nni","format"));if(!We(a))return Promise.reject(new w("nni","check_digit"))}else if(a==="")return Promise.reject(new w("nni","format"));return H("start",{action:"start",identifier:a})},Z=(n,r,a)=>{if(n.source!=="typed")return Promise.reject(new RangeError("this session already holds the ID number"));let l=le(r);return/^\d{10}$/.test(l)?Ze({type:"national_id",issuingCountry:"MR",number:l})?I("population_registry","submitIdNumber",()=>O("population_registry",(h,g)=>h.submitCheck("population_registry",{idNumber:l,nni:l},{idempotencyKey:g}),()=>{m=`\u2022\u2022\u2022\u2022\u2022\u2022${l.slice(-4)}`})):Promise.reject(new w(a,"check_digit")):Promise.reject(new w(a,"format"))},X=n=>(e.stopCameras?.(),I(n,"skipCapture",()=>O(n,(r,a)=>r.submitCheck(n,Zt,{idempotencyKey:a}),()=>{(n==="liveness"||n==="portrait_icao")&&(y=!0)}))),W=n=>{if(n.kind==="result"||n.context.simulation?.skipCapture!==!0)return n;let r=$t(n);return r===null?n:{...n,skipCapture:()=>X(r)}},$=n=>((n.kind==="document"||n.kind==="portrait"||n.kind==="proof_of_address")&&n.photo?.cameraOnPhone===!0&&(n.refresh=async()=>{await e.refreshView()}),n),f=n=>{switch(n.kind){case"phone_otp":case"email_otp":{let r={...n,send:(l={})=>B(n,l),verify:l=>z(n.kind,l),switchTo:()=>n.canSwitch&&n.switchChannel!==void 0?G([n.switchChannel==="email"?"email_otp":"phone_otp"],"other contact option"):Promise.reject(new RangeError("this session has no other contact option"))},a=u[n.kind];return r.resendAvailableAt===void 0&&a!==void 0&&(r.resendAvailableAt=new Date(a+Ut).toISOString()),r}case"eid":return{...n,start:r=>Y(n,r),verify:r=>jt.test(r)?H("verify",{action:"verify",code:r}):Promise.reject(new w("code","format")),resend:()=>n.resendsRemaining===0?Promise.reject(new RangeError("no new code can be sent for this session")):H("resend",{action:"resend"}),useCamera:()=>n.canUseCamera&&n.cameraMethod!==void 0?G(n.cameraMethod==="document_photo"?["document"]:["population_registry"],"camera path"):Promise.reject(new RangeError("the camera path is not offered"))};case"method":return{...n,select:r=>{let a=n.choice.options.find(l=>K[l.service]===r);return a!==void 0?A(n.choice,a.id):Promise.reject(new RangeError(`method ${String(r)} is not offered`))},choose:r=>A(n.choice,r)};case"choice":return{...n,choose:r=>A(n.choice,r)};case"registry":return{...n,submitIdNumber:r=>Z(n,r,"idNumber"),submitNni:r=>Z(n,r,"nni"),confirm:()=>I("population_registry","confirm",()=>O("population_registry",(r,a)=>r.submitCheck("population_registry",{},{idempotencyKey:a}))),useDocument:()=>n.canUseDocument?G(["document"],"document method"):Promise.reject(new RangeError("the document method is not offered"))};case"document":return e.bindDocument!==void 0?$(e.bindDocument(n,k)):{...n,issuer:null,documentType:null,captureSide:null,selectDocument:()=>{throw new Error("document capture is not available in this build")},capture:()=>{throw new Error("document capture is not available in this build")},uploadDocument:()=>Promise.reject(new Error("document upload is not available in this build"))};case"portrait":return e.bindPortrait!==void 0?$(e.bindPortrait(n,k)):{...n,uploadFailed:!1,resubmit:()=>Promise.resolve(),capture:()=>{throw new Error("portrait capture is not available in this build")},uploadPortrait:()=>Promise.reject(new Error("portrait upload is not available in this build")),confirmFix:()=>Promise.reject(new Error("portrait review is not available in this build"))};case"proof_of_address":return e.bindProofOfAddress!==void 0?$(e.bindProofOfAddress(n,k)):{...n,uploadPages:()=>Promise.reject(new Error("proof of address upload is not available in this build")),uploadHolderLetter:()=>Promise.reject(new Error("proof of address upload is not available in this build")),capturePage:()=>{throw new Error("proof of address capture is not available in this build")}};case"contact_choice":return{...n,select:r=>{let a=r==="phone"?"phone_otp":r==="email"?"email_otp":void 0,l=n.choice.options.find(h=>h.service===a);return l!==void 0?A(n.choice,l.id):Promise.reject(new RangeError(`contact ${String(r)} is not offered`))},choose:r=>A(n.choice,r)};case"identity_summary":return{...n,...n.idNumberMasked===void 0&&n.summaryKind==="partial"&&m!==null?{idNumberMasked:m,nniMasked:m}:{},portrait:async()=>{let r=e.runtime.client;if(!n.portraitAvailable||r.identityPortrait===void 0)return null;try{return await r.identityPortrait()}catch{return null}},confirm:()=>V("confirm"),retake:()=>n.retakeAvailable?V("retake"):Promise.reject(new RangeError("no retake is left"))};case"liveness":return{...n,capture:r=>e.liveness(r),onLivePhoto:r=>n.livePhoto?.icao===!0&&e.onLivePhoto!==void 0?e.onLivePhoto(r):()=>{}};case"mobile_required":case"processing":return{...n,refresh:async()=>{i=!1,await e.refreshView()}};case"unsupported":case"result":return{...n};default:{let r=n;throw new Error(`runner: unhandled step ${JSON.stringify(r)}`)}}},_=n=>W(f(n)),R=async()=>{if(!c){c=!0;try{for(let n of Bt){if(await e.sleep(n),!t||e.destroyed())return;let r=await e.refreshView().catch(()=>null);if(r!==null&&J(r,{isMobile:e.isMobile()}).kind!=="processing")return}i=!0,k()}finally{c=!1}}},x=n=>{if(n.kind!=="liveness"||n.mode!=="selfie")return null;let r={kind:"processing",key:"processing",context:n.context,section:n.section,stalled:!1};if(b==="inflight")return r;if(!M||b==="done")return null;let a=e.keptFaceKey?.()??null;return a===null?null:(b="inflight",O("face_match",(l,h)=>l.submitCheck("face_match",{imageKey:a},{idempotencyKey:h}),()=>{b="done"}).then(()=>{b==="inflight"&&(b="done",k())},()=>{b="done",k()}),r)},T=(n,r=!1)=>{if(!t||e.destroyed()||e.chainBusy())return;let a=J(n,{isMobile:e.isMobile()});a.kind==="registry"&&a.recheck&&(M=!0,b="idle"),a=x(a)??a,a.kind==="processing"?a.stalled=i:i=!1;let l=_(a),h=a.kind==="result"?void 0:a.context.switchable,g=h===void 0?l:{...l,chooseOption:P=>A({nodeId:h.nodeId,kind:h.kind,selected:h.current,options:h.options},P)},C=JSON.stringify(g);a.kind==="registry"&&a.source==="document"&&a.state==="pending"&&!S.has("registry")&&(S.add("registry"),g.confirm().catch(P=>{(!(P instanceof F)||Wt.has(P.code))&&S.delete("registry")})),!(!r&&C===s)&&(s=C,o=g,e.emitStep(g),a.kind==="processing"&&!i&&b!=="inflight"&&R(),a.kind==="result"&&!d&&(d=!0,e.emitResult(a.result)))};function k(){let n=e.currentView();n!==null&&T(n,!0)}return{run:async()=>{if(e.destroyed())throw new Error("verification destroyed");t=!0;let n=await e.ensureView();return o===null&&T(n),o??_(J(n,{isMobile:e.isMobile()}))},current:()=>o,onView:n=>T(n),onChainIdle:()=>{let n=e.currentView();n!==null&&T(n)},republish:k,submit:O,faceProbeSkipped:()=>y}}function $t(e){switch(e.kind){case"document":return"doc_ocr";case"liveness":return e.mode==="selfie"?"face_match":"liveness";case"portrait":return e.phase==="capture"?"portrait_icao":null;case"proof_of_address":return"poa";case"mobile_required":return e.checkType;case"unsupported":return e.checkType==="nfc_chip"?"nfc_chip":null;default:return null}}function qt(e,t){let o=e,s=o?.plan?.steps??o?.steps;return Array.isArray(s)?s.some(i=>i.checkType===t&&typeof i.reason=="string"):!1}export{Je as a,zt as b,Ie as c,ve as d,on as e,Fe as f,J as g,Bt as h,Ut as i,Mn as j};
|