@sekyro/web 0.1.0-rc.29 → 0.1.0-rc.30
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 +6 -0
- package/README.md +6 -5
- package/dist/{capture-session-doc-YC4CT2EQ.js → capture-session-doc-ESEZJBQM.js} +1 -1
- package/dist/{challenge-frame-5GG4NDF5.js → challenge-frame-YAQJ5YMB.js} +1 -1
- package/dist/{chunk-WOVWAJD4.js → chunk-3LMJ4335.js} +1 -1
- package/dist/{chunk-34IITQFB.js → chunk-7252SFZ6.js} +1 -1
- package/dist/{chunk-IA5M34P7.js → chunk-A7QFTU6M.js} +1 -1
- package/dist/chunk-CMXN4SOZ.js +1 -0
- package/dist/{chunk-XIKMTHHH.js → chunk-KA43AAM7.js} +1 -1
- package/dist/{chunk-6AH7FXVC.js → chunk-ODI4A5K4.js} +1 -1
- package/dist/chunk-OEQJ62CC.js +3 -0
- package/dist/{chunk-AL6LIOLW.js → chunk-S5BUCUZ4.js} +1 -1
- package/dist/{chunk-CKHBGAUA.js → chunk-SLKRT74K.js} +1 -1
- package/dist/{chunk-BF7CLNFA.js → chunk-UTPUHE4J.js} +1 -1
- package/dist/client/index.cjs +1 -1
- package/dist/client/index.js +1 -1
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.js +1 -1
- package/dist/{create-document-capture-O64FR2DA.js → create-document-capture-V7XCRRDV.js} +1 -1
- package/dist/{create-verification-DzPluhA3.d.cts → create-verification-CGBe2yLE.d.cts} +12 -7
- package/dist/{create-verification-BvldYuLZ.d.ts → create-verification-aoY2QoRx.d.ts} +12 -7
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/internal/index.cjs +2 -2
- package/dist/internal/index.d.cts +2 -2
- package/dist/internal/index.d.ts +2 -2
- package/dist/internal/index.js +1 -1
- package/dist/{plan-runner-WGMNUBWJ.js → plan-runner-IXCKR4DB.js} +1 -1
- package/package.json +1 -1
- package/sbom.cdx.json +19 -19
- package/dist/chunk-EVIGRYOX.js +0 -3
- package/dist/chunk-FVWFAO45.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { bc as SubmitRuntime, a9 as LivenessCaptureOptions, a8 as LivenessCaptureHandle, aX as VerificationStep, aV as VerificationResult, aM as StepSnapshot, a4 as LivePhotoGateUpdate, bd as HostedClientLike, be as DocCatalogEntry, bf as LiveMrzTuning, bg as TextLockTuning, bh as OcrEngineClient, bi as DocAssistReport, bj as ReadyInfo, bk as LoadFailure, bl as OcrEngineOptions } from '../create-verification-
|
|
2
|
-
export { bm as ANALYSIS_LONG_EDGE, bn as ASPECT_BANDS, bo as AttestationError, bp as BLUR_REFUSE_SHARPNESS_MAX, bq as BlurStatus, br as CAPTURE_CANDIDATE_SPACING_MS, bs as CAPTURE_EXTRA_CANDIDATES, bt as CHALLENGE_EXECUTE_TIMEOUT_MS, bu as CHALLENGE_READY_TIMEOUT_MS, bv as CLIP_MIME_ALLOWLIST, bw as CaptureEngine, bx as CaptureSessionDoc, by as CaptureSessionDocEvents, bz as CaptureSessionDocOptions, bA as ChallengeAction, bB as ChallengeError, m as ChallengeErrorCode, bC as DOC_ANALYSIS_DEFAULTS, bD as DOC_BLACK_FRAME_LUMA, bE as DOC_BLACK_FRAME_TICKS, bF as DOC_CADENCE_HZ, bG as DOC_CAMERA_TUNING_DEFAULTS, bH as DOC_CATALOG, bI as DOC_DETECT_WIDTH, bJ as DOC_FEEDBACK_STATES, bK as DOC_FIRST_FRAME_MS, bL as DOC_GATE_V1_DEFAULTS, bM as DOC_SHUTTER_DEFAULTS, bN as DeviceReadHint, bO as DocArtifacts, bP as DocAssist, bQ as DocAssistEngine, bR as DocAssistTick, bS as DocCameraTuning, bT as DocCaptureReport, bU as DocCaptureVia, bV as DocChecksPayload, bW as DocEngineLike, bX as DocFeedbackAggregator, bY as DocFeedbackKey, bZ as DocFeedbackState, b_ as DocFormat, b$ as DocFrameAnalysis, c0 as DocFrameMeasures, c1 as DocGateQuality, c2 as DocGateThresholds, c3 as DocGateTick, c4 as DocGateTickInput, c5 as DocGateV1, c6 as DocQuad, c7 as DocQuadPoint, c8 as DocShutterReason, c9 as DocShutterTuning, ca as DocSide, cb as DocumentCaptureController, cc as DocumentCaptureInternals, cd as EMPTY_GUIDE_METRICS, ce as EncodedDocument, cf as ExecuteChallengeOptions, cg as FLIP_FILL_MIN, ch as FLIP_GAP_MS, ci as FLIP_TIMEOUT_MS, cj as FocusCaps, ck as FramingStatus, cl as GUIDE_LOCK_DEFAULTS, cm as GlareStatus, cn as GrabbedFrame, co as GuideBlocker, cp as GuideLock, cq as GuideLockTick, cr as GuideLockTuning, cs as GuideMetrics, ct as GuideRect, cu as INFERENCE_RETRY_ATTEMPTS, cv as INFERENCE_RETRY_DEFAULT_S, a0 as ISSUER_CODES, cw as LANDMARKER_MODEL, cx as LENS_STORAGE_KEY, cy as LIVE_MRZ_DEFAULTS, cz as LIVE_PHOTO_IDLE_MS, cA as LIVE_PHOTO_MAX_HZ, cB as LandmarkedFace, cC as LandmarkerLike, cD as LensSource, cE as LightingStatus, cF as LiveMrzCapture, cG as LiveMrzState, cH as LivePhotoGate, cI as LivePhotoKit, cJ as LivePhotoKitInternals, cK as LivePhotoKitOptions, cL as LivePhotoStill, cM as LivenessCaptureInternalHandle, cN as LivenessCaptureInternals, cO as LivenessFlowDeps, cP as LivenessFlowOutcome, cQ as MANUAL_SHUTTER_MS, cR as MR_DOC_CATALOG, cS as NO_REPORT_MS, cT as OpenDocCameraDeps, cU as PORTRAIT_JPEG_QUALITY, cV as PRELOAD_BLAZE_INIT_TIMEOUT_MS, cW as PRELOAD_BUDGET_MS, cX as PROCESSING_POLL_DELAY_MS, cY as PROCESSING_POLL_MAX, cZ as PortraitCaptureController, c_ as PortraitCaptureInternals, c$ as REGISTRY_RETRY_DELAY_MS, d0 as ReticleType, d1 as SAME_FACE_MAX_DROPS, d2 as ScanEvent, d3 as ScanLayout, d4 as ScanNotice, d5 as ScanPhase, d6 as ScanReport, d7 as ScanSide, d8 as ScanState, d9 as SubmitExecutor, da as TEXT_LOCK_DEFAULTS, db as TRANSPORT_REPLAY_ATTEMPTS, dc as TRANSPORT_REPLAY_DELAY_MS, dd as VerificationInternals, de as analyzeDocFrame, df as analyzeGuide, dg as aspectBand, dh as aspectFits, di as buildDeviceReadHint, dj as coverPointToVideo, dk as createDocumentCaptureInternal, dl as createFaceLandmarker, dm as createLivePhotoKit, dn as createLivenessCaptureInternal, dp as createPortraitCaptureInternal, dq as createVerificationInternal, dr as docZoomFor, ds as encodeDocumentImage, dt as executeChallenge, du as facesOf, dv as feedbackVoteOf, dw as focusOk, dx as guideQuad, dy as guideRegionInFrame, dz as initialScanState, dA as mapEngineState, dB as mapErrorKind, dC as mapGuidanceHint, dD as nextScanState, dE as observePortraitFrame, dF as openDocCamera, dG as passportBandOf, dH as portraitMatchStep, dI as preloadedDetectorFactory, dJ as quadAreaFrac, dK as quadBounds, dL as quadIou, dM as quadTiltRatio, dN as randomUuid, dO as readStoredLens, dP as resetChallengeFrameForTests, dQ as resetLivenessAssetsForTests, dR as resolveDocCameraTuning, dS as resolveDocShutterTuning, dT as resolveGuideLockTuning, dU as runLivenessFlow, dV as runSubmission, dW as scannerFormatFor, dX as setPreloadLoaderForTests, dY as settledHint, dZ as singleShotFocusAt, d_ as specularFraction, d$ as supportsFocusMode, e0 as warmDocDetector, e1 as writeStoredLens } from '../create-verification-
|
|
1
|
+
import { bc as SubmitRuntime, a9 as LivenessCaptureOptions, a8 as LivenessCaptureHandle, aX as VerificationStep, aV as VerificationResult, aM as StepSnapshot, a4 as LivePhotoGateUpdate, bd as HostedClientLike, be as DocCatalogEntry, bf as LiveMrzTuning, bg as TextLockTuning, bh as OcrEngineClient, bi as DocAssistReport, bj as ReadyInfo, bk as LoadFailure, bl as OcrEngineOptions } from '../create-verification-CGBe2yLE.cjs';
|
|
2
|
+
export { bm as ANALYSIS_LONG_EDGE, bn as ASPECT_BANDS, bo as AttestationError, bp as BLUR_REFUSE_SHARPNESS_MAX, bq as BlurStatus, br as CAPTURE_CANDIDATE_SPACING_MS, bs as CAPTURE_EXTRA_CANDIDATES, bt as CHALLENGE_EXECUTE_TIMEOUT_MS, bu as CHALLENGE_READY_TIMEOUT_MS, bv as CLIP_MIME_ALLOWLIST, bw as CaptureEngine, bx as CaptureSessionDoc, by as CaptureSessionDocEvents, bz as CaptureSessionDocOptions, bA as ChallengeAction, bB as ChallengeError, m as ChallengeErrorCode, bC as DOC_ANALYSIS_DEFAULTS, bD as DOC_BLACK_FRAME_LUMA, bE as DOC_BLACK_FRAME_TICKS, bF as DOC_CADENCE_HZ, bG as DOC_CAMERA_TUNING_DEFAULTS, bH as DOC_CATALOG, bI as DOC_DETECT_WIDTH, bJ as DOC_FEEDBACK_STATES, bK as DOC_FIRST_FRAME_MS, bL as DOC_GATE_V1_DEFAULTS, bM as DOC_SHUTTER_DEFAULTS, bN as DeviceReadHint, bO as DocArtifacts, bP as DocAssist, bQ as DocAssistEngine, bR as DocAssistTick, bS as DocCameraTuning, bT as DocCaptureReport, bU as DocCaptureVia, bV as DocChecksPayload, bW as DocEngineLike, bX as DocFeedbackAggregator, bY as DocFeedbackKey, bZ as DocFeedbackState, b_ as DocFormat, b$ as DocFrameAnalysis, c0 as DocFrameMeasures, c1 as DocGateQuality, c2 as DocGateThresholds, c3 as DocGateTick, c4 as DocGateTickInput, c5 as DocGateV1, c6 as DocQuad, c7 as DocQuadPoint, c8 as DocShutterReason, c9 as DocShutterTuning, ca as DocSide, cb as DocumentCaptureController, cc as DocumentCaptureInternals, cd as EMPTY_GUIDE_METRICS, ce as EncodedDocument, cf as ExecuteChallengeOptions, cg as FLIP_FILL_MIN, ch as FLIP_GAP_MS, ci as FLIP_TIMEOUT_MS, cj as FocusCaps, ck as FramingStatus, cl as GUIDE_LOCK_DEFAULTS, cm as GlareStatus, cn as GrabbedFrame, co as GuideBlocker, cp as GuideLock, cq as GuideLockTick, cr as GuideLockTuning, cs as GuideMetrics, ct as GuideRect, cu as INFERENCE_RETRY_ATTEMPTS, cv as INFERENCE_RETRY_DEFAULT_S, a0 as ISSUER_CODES, cw as LANDMARKER_MODEL, cx as LENS_STORAGE_KEY, cy as LIVE_MRZ_DEFAULTS, cz as LIVE_PHOTO_IDLE_MS, cA as LIVE_PHOTO_MAX_HZ, cB as LandmarkedFace, cC as LandmarkerLike, cD as LensSource, cE as LightingStatus, cF as LiveMrzCapture, cG as LiveMrzState, cH as LivePhotoGate, cI as LivePhotoKit, cJ as LivePhotoKitInternals, cK as LivePhotoKitOptions, cL as LivePhotoStill, cM as LivenessCaptureInternalHandle, cN as LivenessCaptureInternals, cO as LivenessFlowDeps, cP as LivenessFlowOutcome, cQ as MANUAL_SHUTTER_MS, cR as MR_DOC_CATALOG, cS as NO_REPORT_MS, cT as OpenDocCameraDeps, cU as PORTRAIT_JPEG_QUALITY, cV as PRELOAD_BLAZE_INIT_TIMEOUT_MS, cW as PRELOAD_BUDGET_MS, cX as PROCESSING_POLL_DELAY_MS, cY as PROCESSING_POLL_MAX, cZ as PortraitCaptureController, c_ as PortraitCaptureInternals, c$ as REGISTRY_RETRY_DELAY_MS, d0 as ReticleType, d1 as SAME_FACE_MAX_DROPS, d2 as ScanEvent, d3 as ScanLayout, d4 as ScanNotice, d5 as ScanPhase, d6 as ScanReport, d7 as ScanSide, d8 as ScanState, d9 as SubmitExecutor, da as TEXT_LOCK_DEFAULTS, db as TRANSPORT_REPLAY_ATTEMPTS, dc as TRANSPORT_REPLAY_DELAY_MS, dd as VerificationInternals, de as analyzeDocFrame, df as analyzeGuide, dg as aspectBand, dh as aspectFits, di as buildDeviceReadHint, dj as coverPointToVideo, dk as createDocumentCaptureInternal, dl as createFaceLandmarker, dm as createLivePhotoKit, dn as createLivenessCaptureInternal, dp as createPortraitCaptureInternal, dq as createVerificationInternal, dr as docZoomFor, ds as encodeDocumentImage, dt as executeChallenge, du as facesOf, dv as feedbackVoteOf, dw as focusOk, dx as guideQuad, dy as guideRegionInFrame, dz as initialScanState, dA as mapEngineState, dB as mapErrorKind, dC as mapGuidanceHint, dD as nextScanState, dE as observePortraitFrame, dF as openDocCamera, dG as passportBandOf, dH as portraitMatchStep, dI as preloadedDetectorFactory, dJ as quadAreaFrac, dK as quadBounds, dL as quadIou, dM as quadTiltRatio, dN as randomUuid, dO as readStoredLens, dP as resetChallengeFrameForTests, dQ as resetLivenessAssetsForTests, dR as resolveDocCameraTuning, dS as resolveDocShutterTuning, dT as resolveGuideLockTuning, dU as runLivenessFlow, dV as runSubmission, dW as scannerFormatFor, dX as setPreloadLoaderForTests, dY as settledHint, dZ as singleShotFocusAt, d_ as specularFraction, d$ as supportsFocusMode, e0 as warmDocDetector, e1 as writeStoredLens } from '../create-verification-CGBe2yLE.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
4
|
import { a9 as HostedSessionView, h as CheckType, aG as PlanStepView } from '../types-CezFEXzl.cjs';
|
|
5
5
|
export { bs as ICAO_FALLBACK, bm as IcaoCaptureTuning, bt as IcaoProfile, bu as ResolvedIcaoTuning, bv as resolveIcaoTuning } from '../types-CezFEXzl.cjs';
|
package/dist/internal/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { bc as SubmitRuntime, a9 as LivenessCaptureOptions, a8 as LivenessCaptureHandle, aX as VerificationStep, aV as VerificationResult, aM as StepSnapshot, a4 as LivePhotoGateUpdate, bd as HostedClientLike, be as DocCatalogEntry, bf as LiveMrzTuning, bg as TextLockTuning, bh as OcrEngineClient, bi as DocAssistReport, bj as ReadyInfo, bk as LoadFailure, bl as OcrEngineOptions } from '../create-verification-
|
|
2
|
-
export { bm as ANALYSIS_LONG_EDGE, bn as ASPECT_BANDS, bo as AttestationError, bp as BLUR_REFUSE_SHARPNESS_MAX, bq as BlurStatus, br as CAPTURE_CANDIDATE_SPACING_MS, bs as CAPTURE_EXTRA_CANDIDATES, bt as CHALLENGE_EXECUTE_TIMEOUT_MS, bu as CHALLENGE_READY_TIMEOUT_MS, bv as CLIP_MIME_ALLOWLIST, bw as CaptureEngine, bx as CaptureSessionDoc, by as CaptureSessionDocEvents, bz as CaptureSessionDocOptions, bA as ChallengeAction, bB as ChallengeError, m as ChallengeErrorCode, bC as DOC_ANALYSIS_DEFAULTS, bD as DOC_BLACK_FRAME_LUMA, bE as DOC_BLACK_FRAME_TICKS, bF as DOC_CADENCE_HZ, bG as DOC_CAMERA_TUNING_DEFAULTS, bH as DOC_CATALOG, bI as DOC_DETECT_WIDTH, bJ as DOC_FEEDBACK_STATES, bK as DOC_FIRST_FRAME_MS, bL as DOC_GATE_V1_DEFAULTS, bM as DOC_SHUTTER_DEFAULTS, bN as DeviceReadHint, bO as DocArtifacts, bP as DocAssist, bQ as DocAssistEngine, bR as DocAssistTick, bS as DocCameraTuning, bT as DocCaptureReport, bU as DocCaptureVia, bV as DocChecksPayload, bW as DocEngineLike, bX as DocFeedbackAggregator, bY as DocFeedbackKey, bZ as DocFeedbackState, b_ as DocFormat, b$ as DocFrameAnalysis, c0 as DocFrameMeasures, c1 as DocGateQuality, c2 as DocGateThresholds, c3 as DocGateTick, c4 as DocGateTickInput, c5 as DocGateV1, c6 as DocQuad, c7 as DocQuadPoint, c8 as DocShutterReason, c9 as DocShutterTuning, ca as DocSide, cb as DocumentCaptureController, cc as DocumentCaptureInternals, cd as EMPTY_GUIDE_METRICS, ce as EncodedDocument, cf as ExecuteChallengeOptions, cg as FLIP_FILL_MIN, ch as FLIP_GAP_MS, ci as FLIP_TIMEOUT_MS, cj as FocusCaps, ck as FramingStatus, cl as GUIDE_LOCK_DEFAULTS, cm as GlareStatus, cn as GrabbedFrame, co as GuideBlocker, cp as GuideLock, cq as GuideLockTick, cr as GuideLockTuning, cs as GuideMetrics, ct as GuideRect, cu as INFERENCE_RETRY_ATTEMPTS, cv as INFERENCE_RETRY_DEFAULT_S, a0 as ISSUER_CODES, cw as LANDMARKER_MODEL, cx as LENS_STORAGE_KEY, cy as LIVE_MRZ_DEFAULTS, cz as LIVE_PHOTO_IDLE_MS, cA as LIVE_PHOTO_MAX_HZ, cB as LandmarkedFace, cC as LandmarkerLike, cD as LensSource, cE as LightingStatus, cF as LiveMrzCapture, cG as LiveMrzState, cH as LivePhotoGate, cI as LivePhotoKit, cJ as LivePhotoKitInternals, cK as LivePhotoKitOptions, cL as LivePhotoStill, cM as LivenessCaptureInternalHandle, cN as LivenessCaptureInternals, cO as LivenessFlowDeps, cP as LivenessFlowOutcome, cQ as MANUAL_SHUTTER_MS, cR as MR_DOC_CATALOG, cS as NO_REPORT_MS, cT as OpenDocCameraDeps, cU as PORTRAIT_JPEG_QUALITY, cV as PRELOAD_BLAZE_INIT_TIMEOUT_MS, cW as PRELOAD_BUDGET_MS, cX as PROCESSING_POLL_DELAY_MS, cY as PROCESSING_POLL_MAX, cZ as PortraitCaptureController, c_ as PortraitCaptureInternals, c$ as REGISTRY_RETRY_DELAY_MS, d0 as ReticleType, d1 as SAME_FACE_MAX_DROPS, d2 as ScanEvent, d3 as ScanLayout, d4 as ScanNotice, d5 as ScanPhase, d6 as ScanReport, d7 as ScanSide, d8 as ScanState, d9 as SubmitExecutor, da as TEXT_LOCK_DEFAULTS, db as TRANSPORT_REPLAY_ATTEMPTS, dc as TRANSPORT_REPLAY_DELAY_MS, dd as VerificationInternals, de as analyzeDocFrame, df as analyzeGuide, dg as aspectBand, dh as aspectFits, di as buildDeviceReadHint, dj as coverPointToVideo, dk as createDocumentCaptureInternal, dl as createFaceLandmarker, dm as createLivePhotoKit, dn as createLivenessCaptureInternal, dp as createPortraitCaptureInternal, dq as createVerificationInternal, dr as docZoomFor, ds as encodeDocumentImage, dt as executeChallenge, du as facesOf, dv as feedbackVoteOf, dw as focusOk, dx as guideQuad, dy as guideRegionInFrame, dz as initialScanState, dA as mapEngineState, dB as mapErrorKind, dC as mapGuidanceHint, dD as nextScanState, dE as observePortraitFrame, dF as openDocCamera, dG as passportBandOf, dH as portraitMatchStep, dI as preloadedDetectorFactory, dJ as quadAreaFrac, dK as quadBounds, dL as quadIou, dM as quadTiltRatio, dN as randomUuid, dO as readStoredLens, dP as resetChallengeFrameForTests, dQ as resetLivenessAssetsForTests, dR as resolveDocCameraTuning, dS as resolveDocShutterTuning, dT as resolveGuideLockTuning, dU as runLivenessFlow, dV as runSubmission, dW as scannerFormatFor, dX as setPreloadLoaderForTests, dY as settledHint, dZ as singleShotFocusAt, d_ as specularFraction, d$ as supportsFocusMode, e0 as warmDocDetector, e1 as writeStoredLens } from '../create-verification-
|
|
1
|
+
import { bc as SubmitRuntime, a9 as LivenessCaptureOptions, a8 as LivenessCaptureHandle, aX as VerificationStep, aV as VerificationResult, aM as StepSnapshot, a4 as LivePhotoGateUpdate, bd as HostedClientLike, be as DocCatalogEntry, bf as LiveMrzTuning, bg as TextLockTuning, bh as OcrEngineClient, bi as DocAssistReport, bj as ReadyInfo, bk as LoadFailure, bl as OcrEngineOptions } from '../create-verification-aoY2QoRx.js';
|
|
2
|
+
export { bm as ANALYSIS_LONG_EDGE, bn as ASPECT_BANDS, bo as AttestationError, bp as BLUR_REFUSE_SHARPNESS_MAX, bq as BlurStatus, br as CAPTURE_CANDIDATE_SPACING_MS, bs as CAPTURE_EXTRA_CANDIDATES, bt as CHALLENGE_EXECUTE_TIMEOUT_MS, bu as CHALLENGE_READY_TIMEOUT_MS, bv as CLIP_MIME_ALLOWLIST, bw as CaptureEngine, bx as CaptureSessionDoc, by as CaptureSessionDocEvents, bz as CaptureSessionDocOptions, bA as ChallengeAction, bB as ChallengeError, m as ChallengeErrorCode, bC as DOC_ANALYSIS_DEFAULTS, bD as DOC_BLACK_FRAME_LUMA, bE as DOC_BLACK_FRAME_TICKS, bF as DOC_CADENCE_HZ, bG as DOC_CAMERA_TUNING_DEFAULTS, bH as DOC_CATALOG, bI as DOC_DETECT_WIDTH, bJ as DOC_FEEDBACK_STATES, bK as DOC_FIRST_FRAME_MS, bL as DOC_GATE_V1_DEFAULTS, bM as DOC_SHUTTER_DEFAULTS, bN as DeviceReadHint, bO as DocArtifacts, bP as DocAssist, bQ as DocAssistEngine, bR as DocAssistTick, bS as DocCameraTuning, bT as DocCaptureReport, bU as DocCaptureVia, bV as DocChecksPayload, bW as DocEngineLike, bX as DocFeedbackAggregator, bY as DocFeedbackKey, bZ as DocFeedbackState, b_ as DocFormat, b$ as DocFrameAnalysis, c0 as DocFrameMeasures, c1 as DocGateQuality, c2 as DocGateThresholds, c3 as DocGateTick, c4 as DocGateTickInput, c5 as DocGateV1, c6 as DocQuad, c7 as DocQuadPoint, c8 as DocShutterReason, c9 as DocShutterTuning, ca as DocSide, cb as DocumentCaptureController, cc as DocumentCaptureInternals, cd as EMPTY_GUIDE_METRICS, ce as EncodedDocument, cf as ExecuteChallengeOptions, cg as FLIP_FILL_MIN, ch as FLIP_GAP_MS, ci as FLIP_TIMEOUT_MS, cj as FocusCaps, ck as FramingStatus, cl as GUIDE_LOCK_DEFAULTS, cm as GlareStatus, cn as GrabbedFrame, co as GuideBlocker, cp as GuideLock, cq as GuideLockTick, cr as GuideLockTuning, cs as GuideMetrics, ct as GuideRect, cu as INFERENCE_RETRY_ATTEMPTS, cv as INFERENCE_RETRY_DEFAULT_S, a0 as ISSUER_CODES, cw as LANDMARKER_MODEL, cx as LENS_STORAGE_KEY, cy as LIVE_MRZ_DEFAULTS, cz as LIVE_PHOTO_IDLE_MS, cA as LIVE_PHOTO_MAX_HZ, cB as LandmarkedFace, cC as LandmarkerLike, cD as LensSource, cE as LightingStatus, cF as LiveMrzCapture, cG as LiveMrzState, cH as LivePhotoGate, cI as LivePhotoKit, cJ as LivePhotoKitInternals, cK as LivePhotoKitOptions, cL as LivePhotoStill, cM as LivenessCaptureInternalHandle, cN as LivenessCaptureInternals, cO as LivenessFlowDeps, cP as LivenessFlowOutcome, cQ as MANUAL_SHUTTER_MS, cR as MR_DOC_CATALOG, cS as NO_REPORT_MS, cT as OpenDocCameraDeps, cU as PORTRAIT_JPEG_QUALITY, cV as PRELOAD_BLAZE_INIT_TIMEOUT_MS, cW as PRELOAD_BUDGET_MS, cX as PROCESSING_POLL_DELAY_MS, cY as PROCESSING_POLL_MAX, cZ as PortraitCaptureController, c_ as PortraitCaptureInternals, c$ as REGISTRY_RETRY_DELAY_MS, d0 as ReticleType, d1 as SAME_FACE_MAX_DROPS, d2 as ScanEvent, d3 as ScanLayout, d4 as ScanNotice, d5 as ScanPhase, d6 as ScanReport, d7 as ScanSide, d8 as ScanState, d9 as SubmitExecutor, da as TEXT_LOCK_DEFAULTS, db as TRANSPORT_REPLAY_ATTEMPTS, dc as TRANSPORT_REPLAY_DELAY_MS, dd as VerificationInternals, de as analyzeDocFrame, df as analyzeGuide, dg as aspectBand, dh as aspectFits, di as buildDeviceReadHint, dj as coverPointToVideo, dk as createDocumentCaptureInternal, dl as createFaceLandmarker, dm as createLivePhotoKit, dn as createLivenessCaptureInternal, dp as createPortraitCaptureInternal, dq as createVerificationInternal, dr as docZoomFor, ds as encodeDocumentImage, dt as executeChallenge, du as facesOf, dv as feedbackVoteOf, dw as focusOk, dx as guideQuad, dy as guideRegionInFrame, dz as initialScanState, dA as mapEngineState, dB as mapErrorKind, dC as mapGuidanceHint, dD as nextScanState, dE as observePortraitFrame, dF as openDocCamera, dG as passportBandOf, dH as portraitMatchStep, dI as preloadedDetectorFactory, dJ as quadAreaFrac, dK as quadBounds, dL as quadIou, dM as quadTiltRatio, dN as randomUuid, dO as readStoredLens, dP as resetChallengeFrameForTests, dQ as resetLivenessAssetsForTests, dR as resolveDocCameraTuning, dS as resolveDocShutterTuning, dT as resolveGuideLockTuning, dU as runLivenessFlow, dV as runSubmission, dW as scannerFormatFor, dX as setPreloadLoaderForTests, dY as settledHint, dZ as singleShotFocusAt, d_ as specularFraction, d$ as supportsFocusMode, e0 as warmDocDetector, e1 as writeStoredLens } from '../create-verification-aoY2QoRx.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
4
|
import { a9 as HostedSessionView, h as CheckType, aG as PlanStepView } from '../types-CezFEXzl.js';
|
|
5
5
|
export { bs as ICAO_FALLBACK, bm as IcaoCaptureTuning, bt as IcaoProfile, bu as ResolvedIcaoTuning, bv as resolveIcaoTuning } from '../types-CezFEXzl.js';
|
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-KA43AAM7.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-SLKRT74K.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-CMXN4SOZ.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-3LMJ4335.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-KXFHVAYQ.js";import{b as De,c as Pe,d as de,e as Me,f as Fe,g as Ne}from"../chunk-VVUQ4PFU.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,z as Oe}from"../chunk-OEQJ62CC.js";import{A as I,C as u,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-UTPUHE4J.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-7252SFZ6.js";import"../chunk-7QZWBDI5.js";import"../chunk-S5BUCUZ4.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-ODI4A5K4.js";import{c as e,d as t,f as r,g as o,h as p}from"../chunk-TSA6GHUG.js";import"../chunk-A7QFTU6M.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,Me 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,Fe 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{d as te}from"./chunk-ZKF2XMNX.js";import"./chunk-JLVZ35QK.js";import{a as J,b as W,e as Z,f as O,g as V,j as ee}from"./chunk-XIKMTHHH.js";import{x as q}from"./chunk-CKHBGAUA.js";import{n as X}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 Q,i as $,x as N}from"./chunk-WOVWAJD4.js";import"./chunk-G6LKLN4U.js";import"./chunk-SMKCBUJL.js";import"./chunk-KXFHVAYQ.js";import"./chunk-VVUQ4PFU.js";import{b as H,c as j,r as z,t as K,u as B}from"./chunk-BF7CLNFA.js";import"./chunk-34IITQFB.js";import"./chunk-7QZWBDI5.js";import"./chunk-AL6LIOLW.js";import{b as G}from"./chunk-SX7TUC3V.js";import"./chunk-POIQGEZM.js";import"./chunk-CPUECYAJ.js";import"./chunk-FPXL63KZ.js";import{c as D,i as Y}from"./chunk-6AH7FXVC.js";import"./chunk-TSA6GHUG.js";import{a as F}from"./chunk-IA5M34P7.js";import"./chunk-FSSMUAKC.js";import"./chunk-DFTCAWMP.js";import"./chunk-DK5YPBDQ.js";var le=2e4,ue=new Set(["media_type_unsupported","media_type_mismatch"]),ne=new Set(["document_upload_not_allowed","portrait_source_not_allowed","uploaded_media_not_allowed"]);function re(e){let o=null,h=Promise.resolve(),c=!1,_=null,S=null,C=!1,E=null,A=!1,M=!1,T=()=>{o?.controller.handle.destroy(),o=null},u=()=>{let t=e.currentView(),n=t===null?null:V(t,{isMobile:e.isMobile()});return n?.kind==="portrait"?n:null},a=()=>{if(e.destroyed())return"self";let t=e.currentView(),n=t===null?void 0:O(t);return n==="self"||n==="assisted"?n:n==="choice"&&e.captureModeSwitch!==void 0?e.captureModeSwitch.pick()??"self":e.cameraMode?.()??K(n??z(t),null)},f=e.captureModeSwitch,m=f===void 0?void 0:{session:()=>{let t=e.currentView();return t!==null&&O(t)==="choice"?"choice":a()},onModeChange:t=>f.choose(t)},y=async(t,n)=>{if(e.destroyed())return;let d=a();n.setFlowState("uploading"),c=!1;let s=null;try{await e.runner().submit("portrait_icao",async(r,v)=>{if(s===null){let k=await B(r,"image","image/jpeg",t.image.size,{engine:"portrait"});await r.uploadToSpaces(k.uploadUrl,t.image,"image/jpeg"),s=(await r.completeMedia(k.key)).key}n.setFlowState("checking");let g={media:{portrait:s},gate:Y(t.gate),...t.tuningVersion!==void 0?{tuningVersion:t.tuningVersion}:{},source:"camera",capture:{mode:d,facingMode:t.facingMode}};return r.submitCheck("portrait_icao",g,{idempotencyKey:v})})}catch(r){c=!0,r instanceof D&&ne.has(r.code)&&await e.refreshView?.().catch(()=>{})}if(n.setFlowState("done"),e.destroyed())return;let i=u();(i===null||i.phase!=="capture")&&o?.controller===n&&T(),e.runner().republish()},R=t=>e.runner().submit("face_match",(n,d)=>n.submitCheck("face_match",e.runner().faceProbeSkipped()?{simulatedCapture:!0}:{},{idempotencyKey:d})).then(()=>{},()=>{c=!0,t()}),b=null,w=async t=>{let n=u();if(n===null||n.phase!=="capture"||!n.photo.uploadOffered)throw new RangeError("upload_not_offered");let{prepareUploadFile:d}=await import("./upload-file-EGXXM6TQ.js"),s=await d(t,e.uploadInternals);if(e.destroyed())return;T(),c=!1;let i=null;try{await e.runner().submit("portrait_icao",async(r,v)=>{if(i===null){let k=await r.presign("image",s.contentType,s.blob.size,{source:"upload"});await r.uploadToSpaces(k.uploadUrl,s.blob,s.contentType),i=(await r.completeMedia(k.key)).key}let g={media:{portrait:i},source:"upload"};return r.submitCheck("portrait_icao",g,{idempotencyKey:v})})}catch(r){throw r instanceof D&&ue.has(r.code)?new TypeError("unsupported_file"):(r instanceof D&&ne.has(r.code)&&await e.refreshView?.().catch(()=>{}),r)}},P=null,I=t=>{if(P!==null)return P;let n=u();if(n===null||n.phase!=="review")return Promise.reject(new RangeError("no_pending_fix"));let d={fixReview:{accept:t}},s=e.runner().submit("portrait_icao",(i,r)=>i.submitCheck("portrait_icao",d,{idempotencyKey:r})).catch(async i=>{throw i instanceof D&&i.code==="portrait_no_pending_fix"&&await e.refreshView?.().catch(()=>{}),i}).finally(()=>{P=null});return P=s,s},l=t=>{let n=()=>w(t),d=(b===null?n():b.then(n,n)).finally(()=>{b===d&&(b=null)});return b=d,d};return{bind:(t,n)=>{if(t.phase==="review")return T(),{...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:I};if(t.phase==="match")return T(),_!==t.attemptsRemaining&&!c&&(_=t.attemptsRemaining,R(n)),{...t,uploadFailed:c,resubmit:()=>(c=!1,_=t.attemptsRemaining,n(),R(n)),capture:()=>{throw new Error("the portrait was already accepted")},uploadPortrait:()=>Promise.reject(new RangeError("upload_not_offered")),confirmFix:I};if(_=null,t.reuse===!0&&t.phase==="capture")return T(),!A&&E!==t.attemptsRemaining&&(E=t.attemptsRemaining,A=!0,e.runner().submit("portrait_icao",(s,i)=>s.submitCheck("portrait_icao",{},{idempotencyKey:i})).then(()=>{M=!1},()=>{M=!0}).finally(()=>{A=!1,n()})),{kind:"processing",key:"processing",context:t.context,section:t.section,stalled:M&&!A,refresh:()=>(M=!1,E=null,n(),Promise.resolve())};let d=e.keptPortraitInput?.()??null;return d!==null&&(C||d!==S&&t.report===null&&t.reason===void 0&&!t.retakeOnly)?(C||(S=d,C=!0,e.runner().submit("portrait_icao",(s,i)=>s.submitCheck("portrait_icao",d,{idempotencyKey:i})).catch(()=>{}).finally(()=>{C=!1,n()})),{kind:"processing",key:"processing",context:t.context,section:t.section,stalled:!1,refresh:()=>Promise.resolve()}):{...t,uploadFailed:c,resubmit:()=>Promise.resolve(),capture:s=>{if(o!==null&&o.video===s.video)return o.controller.handle;T(),c=!1;let i=X({video:s.video,tuning:t.tuning,tuningVersion:t.tuningVersion,...t.icao!=null?{policy:t.icao.policy}:{},...s.keepScreenAwake!==void 0?{keepScreenAwake:s.keepScreenAwake}:{},...s.assetBaseUrl!==void 0?{assetBaseUrl:s.assetBaseUrl}:{}},e.internals,a,m);o={video:s.video,controller:i};let r=i.handle.destroy;i.handle.destroy=()=>{o?.controller===i&&(o=null),r()},i.handle.on("error",k=>{e.reportCaptureIssue?.(H("portrait",k,0))});let v=!1,g=(k,L)=>{let x=i.gateScores();x!==null&&e.reportGate?.({kind:"portrait_gate",platform:"web",outcome:k,...L!==null?{failing:L}:{},...x})};return i.handle.on("gate",k=>{!v&&!k.ready&&(i.gateScores()?.elapsedMs??0)>=le&&(v=!0,g("stuck",k.failing))}),i.handle.on("captured",k=>{g("captured",null),v=!1,h=h.then(()=>y(k,i)).catch(()=>{})}),i.handle},uploadPortrait:l,confirmFix:I}},destroy:T}}var de=.92,ce=()=>G("environment",{width:{ideal:1920},height:{ideal:1080}},{getUserMedia:e=>navigator.mediaDevices.getUserMedia(e),enumerateDevices:()=>navigator.mediaDevices.enumerateDevices()}),pe=e=>{let o=document.createElement("canvas");o.width=e.videoWidth,o.height=e.videoHeight;let h=o.getContext("2d");return h===null||o.width===0||o.height===0?Promise.reject(new Error("the camera has no frame yet")):(h.drawImage(e,0,0,o.width,o.height),new Promise((c,_)=>o.toBlob(S=>S===null?_(new Error("the still could not be encoded")):c(S),"image/jpeg",de)))},me=(e,o)=>{try{e.muted=!0,e.playsInline=!0,e.srcObject=o,e.play().catch(()=>{})}catch{}};function oe(e){let o=null,h=null,c=u=>{let a=(h===null?u():h.then(u,u)).finally(()=>{h===a&&(h=null)});return h=a,a},_=()=>{o?.handle.destroy(),o=null},S=()=>{let u=e.currentView(),a=u===null?null:V(u,{isMobile:e.isMobile()});return a?.kind==="proof_of_address"?a:null},C=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:f,prepareUploadFile:m}=await import("./upload-file-EGXXM6TQ.js"),y=await Promise.all(a.map(b=>f(b)));if(y.includes("bad"))throw new TypeError("unsupported_file");if(y.includes("pdf")){if(a.length>1)throw new RangeError("too_many_pages");let b=a[0];if(b.size>u.pdf.maxBytes)throw new RangeError("file_too_large");return[{kind:"document_file",blob:b,contentType:"application/pdf"}]}let R=[];for(let b of a){let w=await m(b,e.uploadInternals);R.push({kind:"image",blob:w.blob,contentType:w.contentType})}return R},E=async(u,a,f)=>{let m=null;try{await e.runner().submit("poa",async(y,R)=>{if(m===null){let w=[];for(let P of f){let I=a==="upload"?await y.presign(P.kind,P.contentType,P.blob.size,{source:"upload"}):await B(y,P.kind,P.contentType,P.blob.size,{engine:"poa_page"});await y.uploadToSpaces(I.uploadUrl,P.blob,P.contentType),w.push((await y.completeMedia(I.key)).key)}m=w}let b=f[0]?.kind==="document_file"?{part:u,source:"upload",pdfKey:m[0]}:{part:u,source:a,imageKeys:m};return y.submitCheck("poa",b,{idempotencyKey:R})})}catch(y){throw y instanceof D&&(y.code==="media_type_unsupported"||y.code==="media_type_mismatch")?new TypeError("unsupported_file"):(y instanceof D&&(y.code==="document_upload_not_allowed"||y.code==="uploaded_media_not_allowed")&&await e.refreshView?.().catch(()=>{}),y)}},A=async(u,a)=>{let f=S();if(f===null||!f.photo.uploadOffered)throw new RangeError("upload_not_offered");if(u==="holder_letter"&&f.phase!=="holder_letter")throw new RangeError("holder_letter_not_requested");let m=await C(f,a);e.destroyed()||(_(),await E(u,"upload",m))},M=(u,a)=>{let f=null,m=[],y=!0,R=()=>{for(let w of f?.getTracks()??[])w.stop();f=null},b={get pages(){return m},start:async()=>{if(!y||f!==null)return;let w=await(e.pageCamera?.open??ce)();if(!y){for(let P of w.getTracks())P.stop();return}f=w,(e.pageCamera?.attach??me)(u,w)},takePage:async()=>{if(m.length>=a)throw new RangeError("too_many_pages");let w=await(e.pageCamera?.grab??pe)(u);if(m.length>=a)throw new RangeError("too_many_pages");return m=[...m,w],w},removePage:w=>{m=m.filter((P,I)=>I!==w)},submitPages:()=>c(async()=>{if(m.length===0)throw new RangeError("no_pages");let w=S();if(w===null)throw new RangeError("camera_not_offered");let P=w.phase==="holder_letter"?"holder_letter":"document";await E(P,"camera",m.map(I=>({kind:"image",blob:I,contentType:"image/jpeg"}))),o?.handle===b?_():b.destroy()}),destroy:()=>{y=!1,m=[],R(),o?.handle===b&&(o=null)}};return b},T=async()=>{let u=S();if(u===null||!u.licenceAddressAccepted)throw new RangeError("licence_address_not_accepted");if(e.destroyed())return;_();let a={part:"document"};await e.runner().submit("poa",(f,m)=>f.submitCheck("poa",a,{idempotencyKey:m}))};return{bind:u=>({...u,...u.licenceAddressAccepted?{useLicenceAddress:()=>c(T)}:{},uploadPages:a=>c(()=>A("document",a)),uploadHolderLetter:a=>c(()=>A("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;_();let f=M(a.video,u.maxPages);return o={video:a.video,handle:f},f}}),destroy:_}}function ie(e){let o=e;if(typeof o.apiOrigin!="string"||typeof o.sessionToken!="string")return;let h=`${o.apiOrigin}/api/v2/hosted/capture-reports`,c=o.sessionToken;return _=>{try{fetch(h,{method:"POST",headers:{"content-type":"application/json","x-session-token":c,"x-sekyro-sdk":`@sekyro/web/${F}`},body:JSON.stringify({reports:_}),keepalive:!0}).catch(()=>{})}catch{}}}function ae(e){let o=e.apiOrigin;return te("sdk",typeof o=="string"&&/staging|sandbox|localhost/.test(o)?"sandbox":"live")}function fe(e){return ae(e).replace(/\/ocr$/,"/barcode")}function ze(e){let o=null,h=null,c=null,_=j(),S=Promise.resolve(),C=()=>{c?.flow.handle.destroy(),c=null},E=l=>l===null?{}:{documentType:l.documentType,documentCountry:l.issuer},A=async(l,p,t)=>{if(e.destroyed())return;p.setFlowState("uploading");let n=null,d=E(t),s,i=!1,r=e.currentView()?.documents!==void 0;try{await o.submit("doc_ocr",async(x,se)=>{if(n===null){let U=await B(x,"image","image/jpeg",l.image.size,{engine:"document"});await x.uploadToSpaces(U.uploadUrl,l.image,"image/jpeg"),n=(await x.completeMedia(U.key)).key}return p.setFlowState("checking"),s===void 0&&(s=p.takeDeviceRead(l)),x.submitCheck("doc_ocr",{imageKey:n,side:l.side,...s!==null?{deviceRead:s}:{},...r?{source:"camera"}:{},...d},{idempotencyKey:se})})}catch{i=!0}finally{p.setFlowState("done")}if(e.destroyed())return;if(i){p.settle(l.side,{ok:!1,issue:"technical"});return}let v=e.currentView(),g=v===null?null:V(v,{isMobile:e.isMobile()});if(g?.kind!=="document"){p.settle(l.side,{ok:!0}),c?.flow===p?C():p.handle.destroy();return}if(g.reason==="document_type_not_accepted"||g.reason==="document_type_not_supported"){h=null,c?.flow===p&&C(),o.republish();return}let k=g.acceptedSides;l.side!=="single"&&(k.includes(l.side)||g.reason==="side_missing")&&!(k.includes("recto")&&k.includes("verso"))?(p.settle(l.side,{ok:!0}),h?.documentType!=="passport"&&p.handle.setSide(g.side)):g.reason==="document_sides_mismatch"&&k.length===0?(p.settle(l.side,{ok:!1,issue:"reread"}),p.handle.retry()):p.settle(l.side,{ok:!1,issue:"reread"})},M=null,T=async l=>{let p=e.currentView(),t=p===null?null:V(p,{isMobile:e.isMobile()});if(p===null||t?.kind!=="document")throw new RangeError("upload_not_offered");if(!t.photo.uploadOffered)throw new RangeError("upload_not_offered");let n=h,d=n?.documentType==="passport"?"single":t.side,{prepareUploadFile:s}=await import("./upload-file-EGXXM6TQ.js"),i=await s(l,e.uploadInternals);if(e.destroyed())return;C();let r=null,v=E(n);try{await o.submit("doc_ocr",async(g,k)=>{if(r===null){let L=await g.presign("image",i.contentType,i.blob.size,{source:"upload"});await g.uploadToSpaces(L.uploadUrl,i.blob,i.contentType),r=(await g.completeMedia(L.key)).key}return g.submitCheck("doc_ocr",{imageKey:r,side:d,source:"upload",...v},{idempotencyKey:k})})}catch(g){throw g instanceof D&&(g.code==="media_type_unsupported"||g.code==="media_type_mismatch")?new TypeError("unsupported_file"):(g instanceof D&&(g.code==="document_upload_not_allowed"||g.code==="uploaded_media_not_allowed")&&await e.refreshView().catch(()=>{}),g)}},u=(l,p)=>({...l,uploadDocument:t=>{let n=()=>T(t),d=(M===null?n():M.then(n,n)).finally(()=>{M===d&&(M=null)});return M=d,d},issuer:h?.issuer??null,documentType:h?.documentType??null,captureSide:h===null?null:h.documentType==="passport"?"single":l.side,selectDocument:(t,n)=>{if(!W(l.documents).includes(t)||!J(l.documents,t).includes(n))throw new RangeError(`${n} from ${t} is not accepted`);(h?.issuer!==t||h.documentType!==n)&&C(),h={issuer:t,documentType:n},p()},capture:t=>{if(h===null)throw new Error("selectDocument() first");if(c!==null&&c.video===t.video)return c.flow.handle;C();let n=h,d=n.documentType==="passport"?"single":l.acceptedSides.length>0?l.side:void 0,s=q({video:t.video,documentType:n.documentType,issuer:n.issuer,...d!==void 0?{side:d}:{},...t.keepScreenAwake!==void 0?{keepScreenAwake:t.keepScreenAwake}:{},...t.liveMrz!==void 0?{liveMrz:t.liveMrz}:{},...t.barcodeAssetBaseUrl!==void 0?{barcodeAssetBaseUrl:t.barcodeAssetBaseUrl}:{}},{...e.documentInternals??{},...(()=>{let r=e.currentView()?.capture?.document,v=e.documentInternals?.blurRefuseSharpnessMax??r?.scan?.blurRefuseSharpnessMax;return{engineOptions:{camera:$(r?.camera),shutter:Q(r?.scan),guideLock:N(r?.guide),...e.documentInternals?.engineOptions??{}},...typeof v=="number"&&Number.isFinite(v)&&v>=0&&v<=1?{blurRefuseSharpnessMax:v}:{},catalogCapture:e.documentInternals?.catalogCapture??r?.catalog===!0}})(),deferRead:!0,...e.documentInternals?.barcode!==void 0?{}:{barcode:{assetBaseUrl:fe(e.runtime.client)}},...(()=>{let r=e.currentView();if(r===null||e.documentInternals?.webOcr!==void 0)return{};let v=ie(e.runtime.client);return{webOcr:{captureDocument:r.capture?.document,salt:r.sessionId,baseUrl:ae(e.runtime.client),...v!==void 0?{reports:v}:{}}}})()});c={video:t.video,flow:s};let i=s.handle.destroy;return s.handle.destroy=()=>{c?.flow===s&&(c=null),i()},_.newHandle(),s.handle.on("state",r=>_.note(r)),s.handle.on("error",r=>{_.noteError(),e.reportCaptureIssue?.(H("document",r,_.value))}),s.handle.on("captured",r=>{S=S.then(()=>A(r,s,n)).catch(()=>{})}),s.handle}}),a=null,f=null,m=new Set,y=e.runtime.client;e.runtime.client=new Proxy(y,{get(l,p){if(p==="submitCheck")return(f??l).submitCheck.bind(f??l);let t=Reflect.get(l,p);return typeof t=="function"?t.bind(l):t}});let R=()=>{a?.destroy(),a=null,f=null},b=l=>{let p=e.currentView(),t=p===null?null:V(p,{isMobile:e.isMobile()});if(p===null||t?.kind!=="liveness"||t.livePhoto?.icao!==!0)return;if(a===null){let i=Z({tuning:p.capture?.icao??null,tuningVersion:p.capture?.tuningVersion??null,...t.icao!=null?{policy:t.icao.policy}:{},still:t.livePhoto.still,...l.assetBaseUrl!==void 0?{assetBaseUrl:l.assetBaseUrl}:{}},e.livePhotoInternals);a=i,f=i.decorate(y),i.onGate(r=>{for(let v of m)v(r)})}let n=a,d=e.baseCapture??{},s=d.engineOptions?.telemetry;return{...d,engineOptions:{...d.engineOptions??{},measureQuality:n.engineOptions.measureQuality,telemetry:i=>{s?.(i),n.engineOptions.telemetry(i)}}}},w=re({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:l=>ie(e.runtime.client)?.([l])}),P=oe({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()}),I=ee({...e,bindDocument:u,bindPortrait:w.bind,bindProofOfAddress:P.bind,stopCameras:()=>{C(),w.destroy(),P.destroy(),R(),e.stopLiveness?.()},onLivePhoto:l=>(m.add(l),()=>m.delete(l))});return o=I,{...I,captureInternals:b,destroy:()=>{C(),w.destroy(),P.destroy(),R(),m.clear()}}}export{fe as barcodeAssetBase,ze as createPlanRunner,ie as reportSink,ae as sdkAssetBase};
|
|
1
|
+
import{d as te}from"./chunk-ZKF2XMNX.js";import"./chunk-JLVZ35QK.js";import{a as J,b as W,e as Z,f as O,g as V,j as ee}from"./chunk-KA43AAM7.js";import{x as q}from"./chunk-SLKRT74K.js";import{n as X}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 Q,i as $,x as N}from"./chunk-3LMJ4335.js";import"./chunk-G6LKLN4U.js";import"./chunk-SMKCBUJL.js";import"./chunk-KXFHVAYQ.js";import"./chunk-VVUQ4PFU.js";import{b as H,c as j,r as z,t as K,u as B}from"./chunk-UTPUHE4J.js";import"./chunk-7252SFZ6.js";import"./chunk-7QZWBDI5.js";import"./chunk-S5BUCUZ4.js";import{b as G}from"./chunk-SX7TUC3V.js";import"./chunk-POIQGEZM.js";import"./chunk-CPUECYAJ.js";import"./chunk-FPXL63KZ.js";import{c as D,i as Y}from"./chunk-ODI4A5K4.js";import"./chunk-TSA6GHUG.js";import{a as F}from"./chunk-A7QFTU6M.js";import"./chunk-FSSMUAKC.js";import"./chunk-DFTCAWMP.js";import"./chunk-DK5YPBDQ.js";var le=2e4,ue=new Set(["media_type_unsupported","media_type_mismatch"]),ne=new Set(["document_upload_not_allowed","portrait_source_not_allowed","uploaded_media_not_allowed"]);function re(e){let o=null,h=Promise.resolve(),c=!1,_=null,S=null,C=!1,E=null,A=!1,M=!1,T=()=>{o?.controller.handle.destroy(),o=null},u=()=>{let t=e.currentView(),n=t===null?null:V(t,{isMobile:e.isMobile()});return n?.kind==="portrait"?n:null},a=()=>{if(e.destroyed())return"self";let t=e.currentView(),n=t===null?void 0:O(t);return n==="self"||n==="assisted"?n:n==="choice"&&e.captureModeSwitch!==void 0?e.captureModeSwitch.pick()??"self":e.cameraMode?.()??K(n??z(t),null)},f=e.captureModeSwitch,m=f===void 0?void 0:{session:()=>{let t=e.currentView();return t!==null&&O(t)==="choice"?"choice":a()},onModeChange:t=>f.choose(t)},y=async(t,n)=>{if(e.destroyed())return;let d=a();n.setFlowState("uploading"),c=!1;let s=null;try{await e.runner().submit("portrait_icao",async(r,v)=>{if(s===null){let k=await B(r,"image","image/jpeg",t.image.size,{engine:"portrait"});await r.uploadToSpaces(k.uploadUrl,t.image,"image/jpeg"),s=(await r.completeMedia(k.key)).key}n.setFlowState("checking");let g={media:{portrait:s},gate:Y(t.gate),...t.tuningVersion!==void 0?{tuningVersion:t.tuningVersion}:{},source:"camera",capture:{mode:d,facingMode:t.facingMode}};return r.submitCheck("portrait_icao",g,{idempotencyKey:v})})}catch(r){c=!0,r instanceof D&&ne.has(r.code)&&await e.refreshView?.().catch(()=>{})}if(n.setFlowState("done"),e.destroyed())return;let i=u();(i===null||i.phase!=="capture")&&o?.controller===n&&T(),e.runner().republish()},R=t=>e.runner().submit("face_match",(n,d)=>n.submitCheck("face_match",e.runner().faceProbeSkipped()?{simulatedCapture:!0}:{},{idempotencyKey:d})).then(()=>{},()=>{c=!0,t()}),b=null,w=async t=>{let n=u();if(n===null||n.phase!=="capture"||!n.photo.uploadOffered)throw new RangeError("upload_not_offered");let{prepareUploadFile:d}=await import("./upload-file-EGXXM6TQ.js"),s=await d(t,e.uploadInternals);if(e.destroyed())return;T(),c=!1;let i=null;try{await e.runner().submit("portrait_icao",async(r,v)=>{if(i===null){let k=await r.presign("image",s.contentType,s.blob.size,{source:"upload"});await r.uploadToSpaces(k.uploadUrl,s.blob,s.contentType),i=(await r.completeMedia(k.key)).key}let g={media:{portrait:i},source:"upload"};return r.submitCheck("portrait_icao",g,{idempotencyKey:v})})}catch(r){throw r instanceof D&&ue.has(r.code)?new TypeError("unsupported_file"):(r instanceof D&&ne.has(r.code)&&await e.refreshView?.().catch(()=>{}),r)}},P=null,I=t=>{if(P!==null)return P;let n=u();if(n===null||n.phase!=="review")return Promise.reject(new RangeError("no_pending_fix"));let d={fixReview:{accept:t}},s=e.runner().submit("portrait_icao",(i,r)=>i.submitCheck("portrait_icao",d,{idempotencyKey:r})).catch(async i=>{throw i instanceof D&&i.code==="portrait_no_pending_fix"&&await e.refreshView?.().catch(()=>{}),i}).finally(()=>{P=null});return P=s,s},l=t=>{let n=()=>w(t),d=(b===null?n():b.then(n,n)).finally(()=>{b===d&&(b=null)});return b=d,d};return{bind:(t,n)=>{if(t.phase==="review")return T(),{...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:I};if(t.phase==="match")return T(),_!==t.attemptsRemaining&&!c&&(_=t.attemptsRemaining,R(n)),{...t,uploadFailed:c,resubmit:()=>(c=!1,_=t.attemptsRemaining,n(),R(n)),capture:()=>{throw new Error("the portrait was already accepted")},uploadPortrait:()=>Promise.reject(new RangeError("upload_not_offered")),confirmFix:I};if(_=null,t.reuse===!0&&t.phase==="capture")return T(),!A&&E!==t.attemptsRemaining&&(E=t.attemptsRemaining,A=!0,e.runner().submit("portrait_icao",(s,i)=>s.submitCheck("portrait_icao",{},{idempotencyKey:i})).then(()=>{M=!1},()=>{M=!0}).finally(()=>{A=!1,n()})),{kind:"processing",key:"processing",context:t.context,section:t.section,stalled:M&&!A,refresh:()=>(M=!1,E=null,n(),Promise.resolve())};let d=e.keptPortraitInput?.()??null;return d!==null&&(C||d!==S&&t.report===null&&t.reason===void 0&&!t.retakeOnly)?(C||(S=d,C=!0,e.runner().submit("portrait_icao",(s,i)=>s.submitCheck("portrait_icao",d,{idempotencyKey:i})).catch(()=>{}).finally(()=>{C=!1,n()})),{kind:"processing",key:"processing",context:t.context,section:t.section,stalled:!1,refresh:()=>Promise.resolve()}):{...t,uploadFailed:c,resubmit:()=>Promise.resolve(),capture:s=>{if(o!==null&&o.video===s.video)return o.controller.handle;T(),c=!1;let i=X({video:s.video,tuning:t.tuning,tuningVersion:t.tuningVersion,...t.icao!=null?{policy:t.icao.policy}:{},...s.keepScreenAwake!==void 0?{keepScreenAwake:s.keepScreenAwake}:{},...s.assetBaseUrl!==void 0?{assetBaseUrl:s.assetBaseUrl}:{}},e.internals,a,m);o={video:s.video,controller:i};let r=i.handle.destroy;i.handle.destroy=()=>{o?.controller===i&&(o=null),r()},i.handle.on("error",k=>{e.reportCaptureIssue?.(H("portrait",k,0))});let v=!1,g=(k,L)=>{let x=i.gateScores();x!==null&&e.reportGate?.({kind:"portrait_gate",platform:"web",outcome:k,...L!==null?{failing:L}:{},...x})};return i.handle.on("gate",k=>{!v&&!k.ready&&(i.gateScores()?.elapsedMs??0)>=le&&(v=!0,g("stuck",k.failing))}),i.handle.on("captured",k=>{g("captured",null),v=!1,h=h.then(()=>y(k,i)).catch(()=>{})}),i.handle},uploadPortrait:l,confirmFix:I}},destroy:T}}var de=.92,ce=()=>G("environment",{width:{ideal:1920},height:{ideal:1080}},{getUserMedia:e=>navigator.mediaDevices.getUserMedia(e),enumerateDevices:()=>navigator.mediaDevices.enumerateDevices()}),pe=e=>{let o=document.createElement("canvas");o.width=e.videoWidth,o.height=e.videoHeight;let h=o.getContext("2d");return h===null||o.width===0||o.height===0?Promise.reject(new Error("the camera has no frame yet")):(h.drawImage(e,0,0,o.width,o.height),new Promise((c,_)=>o.toBlob(S=>S===null?_(new Error("the still could not be encoded")):c(S),"image/jpeg",de)))},me=(e,o)=>{try{e.muted=!0,e.playsInline=!0,e.srcObject=o,e.play().catch(()=>{})}catch{}};function oe(e){let o=null,h=null,c=u=>{let a=(h===null?u():h.then(u,u)).finally(()=>{h===a&&(h=null)});return h=a,a},_=()=>{o?.handle.destroy(),o=null},S=()=>{let u=e.currentView(),a=u===null?null:V(u,{isMobile:e.isMobile()});return a?.kind==="proof_of_address"?a:null},C=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:f,prepareUploadFile:m}=await import("./upload-file-EGXXM6TQ.js"),y=await Promise.all(a.map(b=>f(b)));if(y.includes("bad"))throw new TypeError("unsupported_file");if(y.includes("pdf")){if(a.length>1)throw new RangeError("too_many_pages");let b=a[0];if(b.size>u.pdf.maxBytes)throw new RangeError("file_too_large");return[{kind:"document_file",blob:b,contentType:"application/pdf"}]}let R=[];for(let b of a){let w=await m(b,e.uploadInternals);R.push({kind:"image",blob:w.blob,contentType:w.contentType})}return R},E=async(u,a,f)=>{let m=null;try{await e.runner().submit("poa",async(y,R)=>{if(m===null){let w=[];for(let P of f){let I=a==="upload"?await y.presign(P.kind,P.contentType,P.blob.size,{source:"upload"}):await B(y,P.kind,P.contentType,P.blob.size,{engine:"poa_page"});await y.uploadToSpaces(I.uploadUrl,P.blob,P.contentType),w.push((await y.completeMedia(I.key)).key)}m=w}let b=f[0]?.kind==="document_file"?{part:u,source:"upload",pdfKey:m[0]}:{part:u,source:a,imageKeys:m};return y.submitCheck("poa",b,{idempotencyKey:R})})}catch(y){throw y instanceof D&&(y.code==="media_type_unsupported"||y.code==="media_type_mismatch")?new TypeError("unsupported_file"):(y instanceof D&&(y.code==="document_upload_not_allowed"||y.code==="uploaded_media_not_allowed")&&await e.refreshView?.().catch(()=>{}),y)}},A=async(u,a)=>{let f=S();if(f===null||!f.photo.uploadOffered)throw new RangeError("upload_not_offered");if(u==="holder_letter"&&f.phase!=="holder_letter")throw new RangeError("holder_letter_not_requested");let m=await C(f,a);e.destroyed()||(_(),await E(u,"upload",m))},M=(u,a)=>{let f=null,m=[],y=!0,R=()=>{for(let w of f?.getTracks()??[])w.stop();f=null},b={get pages(){return m},start:async()=>{if(!y||f!==null)return;let w=await(e.pageCamera?.open??ce)();if(!y){for(let P of w.getTracks())P.stop();return}f=w,(e.pageCamera?.attach??me)(u,w)},takePage:async()=>{if(m.length>=a)throw new RangeError("too_many_pages");let w=await(e.pageCamera?.grab??pe)(u);if(m.length>=a)throw new RangeError("too_many_pages");return m=[...m,w],w},removePage:w=>{m=m.filter((P,I)=>I!==w)},submitPages:()=>c(async()=>{if(m.length===0)throw new RangeError("no_pages");let w=S();if(w===null)throw new RangeError("camera_not_offered");let P=w.phase==="holder_letter"?"holder_letter":"document";await E(P,"camera",m.map(I=>({kind:"image",blob:I,contentType:"image/jpeg"}))),o?.handle===b?_():b.destroy()}),destroy:()=>{y=!1,m=[],R(),o?.handle===b&&(o=null)}};return b},T=async()=>{let u=S();if(u===null||!u.licenceAddressAccepted)throw new RangeError("licence_address_not_accepted");if(e.destroyed())return;_();let a={part:"document"};await e.runner().submit("poa",(f,m)=>f.submitCheck("poa",a,{idempotencyKey:m}))};return{bind:u=>({...u,...u.licenceAddressAccepted?{useLicenceAddress:()=>c(T)}:{},uploadPages:a=>c(()=>A("document",a)),uploadHolderLetter:a=>c(()=>A("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;_();let f=M(a.video,u.maxPages);return o={video:a.video,handle:f},f}}),destroy:_}}function ie(e){let o=e;if(typeof o.apiOrigin!="string"||typeof o.sessionToken!="string")return;let h=`${o.apiOrigin}/api/v2/hosted/capture-reports`,c=o.sessionToken;return _=>{try{fetch(h,{method:"POST",headers:{"content-type":"application/json","x-session-token":c,"x-sekyro-sdk":`@sekyro/web/${F}`},body:JSON.stringify({reports:_}),keepalive:!0}).catch(()=>{})}catch{}}}function ae(e){let o=e.apiOrigin;return te("sdk",typeof o=="string"&&/staging|sandbox|localhost/.test(o)?"sandbox":"live")}function fe(e){return ae(e).replace(/\/ocr$/,"/barcode")}function ze(e){let o=null,h=null,c=null,_=j(),S=Promise.resolve(),C=()=>{c?.flow.handle.destroy(),c=null},E=l=>l===null?{}:{documentType:l.documentType,documentCountry:l.issuer},A=async(l,p,t)=>{if(e.destroyed())return;p.setFlowState("uploading");let n=null,d=E(t),s,i=!1,r=e.currentView()?.documents!==void 0;try{await o.submit("doc_ocr",async(x,se)=>{if(n===null){let U=await B(x,"image","image/jpeg",l.image.size,{engine:"document"});await x.uploadToSpaces(U.uploadUrl,l.image,"image/jpeg"),n=(await x.completeMedia(U.key)).key}return p.setFlowState("checking"),s===void 0&&(s=p.takeDeviceRead(l)),x.submitCheck("doc_ocr",{imageKey:n,side:l.side,...s!==null?{deviceRead:s}:{},...r?{source:"camera"}:{},...d},{idempotencyKey:se})})}catch{i=!0}finally{p.setFlowState("done")}if(e.destroyed())return;if(i){p.settle(l.side,{ok:!1,issue:"technical"});return}let v=e.currentView(),g=v===null?null:V(v,{isMobile:e.isMobile()});if(g?.kind!=="document"){p.settle(l.side,{ok:!0}),c?.flow===p?C():p.handle.destroy();return}if(g.reason==="document_type_not_accepted"||g.reason==="document_type_not_supported"){h=null,c?.flow===p&&C(),o.republish();return}let k=g.acceptedSides;l.side!=="single"&&(k.includes(l.side)||g.reason==="side_missing")&&!(k.includes("recto")&&k.includes("verso"))?(p.settle(l.side,{ok:!0}),h?.documentType!=="passport"&&p.handle.setSide(g.side)):g.reason==="document_sides_mismatch"&&k.length===0?(p.settle(l.side,{ok:!1,issue:"reread"}),p.handle.retry()):p.settle(l.side,{ok:!1,issue:"reread"})},M=null,T=async l=>{let p=e.currentView(),t=p===null?null:V(p,{isMobile:e.isMobile()});if(p===null||t?.kind!=="document")throw new RangeError("upload_not_offered");if(!t.photo.uploadOffered)throw new RangeError("upload_not_offered");let n=h,d=n?.documentType==="passport"?"single":t.side,{prepareUploadFile:s}=await import("./upload-file-EGXXM6TQ.js"),i=await s(l,e.uploadInternals);if(e.destroyed())return;C();let r=null,v=E(n);try{await o.submit("doc_ocr",async(g,k)=>{if(r===null){let L=await g.presign("image",i.contentType,i.blob.size,{source:"upload"});await g.uploadToSpaces(L.uploadUrl,i.blob,i.contentType),r=(await g.completeMedia(L.key)).key}return g.submitCheck("doc_ocr",{imageKey:r,side:d,source:"upload",...v},{idempotencyKey:k})})}catch(g){throw g instanceof D&&(g.code==="media_type_unsupported"||g.code==="media_type_mismatch")?new TypeError("unsupported_file"):(g instanceof D&&(g.code==="document_upload_not_allowed"||g.code==="uploaded_media_not_allowed")&&await e.refreshView().catch(()=>{}),g)}},u=(l,p)=>({...l,uploadDocument:t=>{let n=()=>T(t),d=(M===null?n():M.then(n,n)).finally(()=>{M===d&&(M=null)});return M=d,d},issuer:h?.issuer??null,documentType:h?.documentType??null,captureSide:h===null?null:h.documentType==="passport"?"single":l.side,selectDocument:(t,n)=>{if(!W(l.documents).includes(t)||!J(l.documents,t).includes(n))throw new RangeError(`${n} from ${t} is not accepted`);(h?.issuer!==t||h.documentType!==n)&&C(),h={issuer:t,documentType:n},p()},capture:t=>{if(h===null)throw new Error("selectDocument() first");if(c!==null&&c.video===t.video)return c.flow.handle;C();let n=h,d=n.documentType==="passport"?"single":l.acceptedSides.length>0?l.side:void 0,s=q({video:t.video,documentType:n.documentType,issuer:n.issuer,...d!==void 0?{side:d}:{},...t.keepScreenAwake!==void 0?{keepScreenAwake:t.keepScreenAwake}:{},...t.liveMrz!==void 0?{liveMrz:t.liveMrz}:{},...t.barcodeAssetBaseUrl!==void 0?{barcodeAssetBaseUrl:t.barcodeAssetBaseUrl}:{}},{...e.documentInternals??{},...(()=>{let r=e.currentView()?.capture?.document,v=e.documentInternals?.blurRefuseSharpnessMax??r?.scan?.blurRefuseSharpnessMax;return{engineOptions:{camera:$(r?.camera),shutter:Q(r?.scan),guideLock:N(r?.guide),...e.documentInternals?.engineOptions??{}},...typeof v=="number"&&Number.isFinite(v)&&v>=0&&v<=1?{blurRefuseSharpnessMax:v}:{},catalogCapture:e.documentInternals?.catalogCapture??r?.catalog===!0}})(),deferRead:!0,...e.documentInternals?.barcode!==void 0?{}:{barcode:{assetBaseUrl:fe(e.runtime.client)}},...(()=>{let r=e.currentView();if(r===null||e.documentInternals?.webOcr!==void 0)return{};let v=ie(e.runtime.client);return{webOcr:{captureDocument:r.capture?.document,salt:r.sessionId,baseUrl:ae(e.runtime.client),...v!==void 0?{reports:v}:{}}}})()});c={video:t.video,flow:s};let i=s.handle.destroy;return s.handle.destroy=()=>{c?.flow===s&&(c=null),i()},_.newHandle(),s.handle.on("state",r=>_.note(r)),s.handle.on("error",r=>{_.noteError(),e.reportCaptureIssue?.(H("document",r,_.value))}),s.handle.on("captured",r=>{S=S.then(()=>A(r,s,n)).catch(()=>{})}),s.handle}}),a=null,f=null,m=new Set,y=e.runtime.client;e.runtime.client=new Proxy(y,{get(l,p){if(p==="submitCheck")return(f??l).submitCheck.bind(f??l);let t=Reflect.get(l,p);return typeof t=="function"?t.bind(l):t}});let R=()=>{a?.destroy(),a=null,f=null},b=l=>{let p=e.currentView(),t=p===null?null:V(p,{isMobile:e.isMobile()});if(p===null||t?.kind!=="liveness"||t.livePhoto?.icao!==!0)return;if(a===null){let i=Z({tuning:p.capture?.icao??null,tuningVersion:p.capture?.tuningVersion??null,...t.icao!=null?{policy:t.icao.policy}:{},still:t.livePhoto.still,...l.assetBaseUrl!==void 0?{assetBaseUrl:l.assetBaseUrl}:{}},e.livePhotoInternals);a=i,f=i.decorate(y),i.onGate(r=>{for(let v of m)v(r)})}let n=a,d=e.baseCapture??{},s=d.engineOptions?.telemetry;return{...d,engineOptions:{...d.engineOptions??{},measureQuality:n.engineOptions.measureQuality,telemetry:i=>{s?.(i),n.engineOptions.telemetry(i)}}}},w=re({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:l=>ie(e.runtime.client)?.([l])}),P=oe({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()}),I=ee({...e,bindDocument:u,bindPortrait:w.bind,bindProofOfAddress:P.bind,stopCameras:()=>{C(),w.destroy(),P.destroy(),R(),e.stopLiveness?.()},onLivePhoto:l=>(m.add(l),()=>m.delete(l))});return o=I,{...I,captureInternals:b,destroy:()=>{C(),w.destroy(),P.destroy(),R(),m.clear()}}}export{fe as barcodeAssetBase,ze as createPlanRunner,ie as reportSink,ae as sdkAssetBase};
|
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.30",
|
|
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.30",
|
|
101
|
+
"bom-ref": "@sekyro/web@0.1.0-rc.30",
|
|
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.30?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.30|@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.30|@thumbmarkjs/thumbmarkjs@1.12.0",
|
|
189
189
|
"licenses": [
|
|
190
190
|
{
|
|
191
191
|
"license": {
|
|
@@ -220,7 +220,7 @@
|
|
|
220
220
|
"name": "emscripten",
|
|
221
221
|
"group": "@types",
|
|
222
222
|
"version": "1.41.6",
|
|
223
|
-
"bom-ref": "@sekyro/web@0.1.0-rc.
|
|
223
|
+
"bom-ref": "@sekyro/web@0.1.0-rc.30|@types/emscripten@1.41.6",
|
|
224
224
|
"licenses": [
|
|
225
225
|
{
|
|
226
226
|
"license": {
|
|
@@ -254,7 +254,7 @@
|
|
|
254
254
|
"type": "library",
|
|
255
255
|
"name": "type-fest",
|
|
256
256
|
"version": "4.41.0",
|
|
257
|
-
"bom-ref": "@sekyro/web@0.1.0-rc.
|
|
257
|
+
"bom-ref": "@sekyro/web@0.1.0-rc.30|type-fest@4.41.0",
|
|
258
258
|
"licenses": [
|
|
259
259
|
{
|
|
260
260
|
"expression": "(MIT OR CC0-1.0)",
|
|
@@ -286,7 +286,7 @@
|
|
|
286
286
|
"type": "library",
|
|
287
287
|
"name": "zxing-wasm",
|
|
288
288
|
"version": "2.1.0",
|
|
289
|
-
"bom-ref": "@sekyro/web@0.1.0-rc.
|
|
289
|
+
"bom-ref": "@sekyro/web@0.1.0-rc.30|zxing-wasm@2.1.0",
|
|
290
290
|
"licenses": [
|
|
291
291
|
{
|
|
292
292
|
"license": {
|
|
@@ -319,30 +319,30 @@
|
|
|
319
319
|
],
|
|
320
320
|
"dependencies": [
|
|
321
321
|
{
|
|
322
|
-
"ref": "@sekyro/web@0.1.0-rc.
|
|
322
|
+
"ref": "@sekyro/web@0.1.0-rc.30",
|
|
323
323
|
"dependsOn": [
|
|
324
|
-
"@sekyro/web@0.1.0-rc.
|
|
325
|
-
"@sekyro/web@0.1.0-rc.
|
|
326
|
-
"@sekyro/web@0.1.0-rc.
|
|
324
|
+
"@sekyro/web@0.1.0-rc.30|@mediapipe/tasks-vision@0.10.35",
|
|
325
|
+
"@sekyro/web@0.1.0-rc.30|@thumbmarkjs/thumbmarkjs@1.12.0",
|
|
326
|
+
"@sekyro/web@0.1.0-rc.30|zxing-wasm@2.1.0"
|
|
327
327
|
]
|
|
328
328
|
},
|
|
329
329
|
{
|
|
330
|
-
"ref": "@sekyro/web@0.1.0-rc.
|
|
330
|
+
"ref": "@sekyro/web@0.1.0-rc.30|@mediapipe/tasks-vision@0.10.35"
|
|
331
331
|
},
|
|
332
332
|
{
|
|
333
|
-
"ref": "@sekyro/web@0.1.0-rc.
|
|
333
|
+
"ref": "@sekyro/web@0.1.0-rc.30|@thumbmarkjs/thumbmarkjs@1.12.0"
|
|
334
334
|
},
|
|
335
335
|
{
|
|
336
|
-
"ref": "@sekyro/web@0.1.0-rc.
|
|
336
|
+
"ref": "@sekyro/web@0.1.0-rc.30|@types/emscripten@1.41.6"
|
|
337
337
|
},
|
|
338
338
|
{
|
|
339
|
-
"ref": "@sekyro/web@0.1.0-rc.
|
|
339
|
+
"ref": "@sekyro/web@0.1.0-rc.30|type-fest@4.41.0"
|
|
340
340
|
},
|
|
341
341
|
{
|
|
342
|
-
"ref": "@sekyro/web@0.1.0-rc.
|
|
342
|
+
"ref": "@sekyro/web@0.1.0-rc.30|zxing-wasm@2.1.0",
|
|
343
343
|
"dependsOn": [
|
|
344
|
-
"@sekyro/web@0.1.0-rc.
|
|
345
|
-
"@sekyro/web@0.1.0-rc.
|
|
344
|
+
"@sekyro/web@0.1.0-rc.30|@types/emscripten@1.41.6",
|
|
345
|
+
"@sekyro/web@0.1.0-rc.30|type-fest@4.41.0"
|
|
346
346
|
]
|
|
347
347
|
}
|
|
348
348
|
]
|
package/dist/chunk-EVIGRYOX.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{B as tt,C as nt,D as ot,E as rt,a as je,b as Ye,c as $e,d as K,e as X,f as z,g as We,h as L,i as Qe,j as P,k as D,l as E,m as U,n as N,o as j,p as Ze,q as Y,r as ee,s as Je,t as Xe,u as ze,v as et}from"./chunk-BF7CLNFA.js";import{n as qe}from"./chunk-34IITQFB.js";import{a as Be}from"./chunk-7QZWBDI5.js";import{c as fe,e as Ge,g as Ke,h as te}from"./chunk-6AH7FXVC.js";import{c as De,d as pe}from"./chunk-TSA6GHUG.js";import{b as Ue}from"./chunk-IA5M34P7.js";function ne(e){return e.idNumberBound??e.nniBound}function $(e){return e===void 0?void 0:e.idNumberFromDocument??e.nniFromDocument}function it(e){let t=e.idNumberMasked??e.nniMasked;return typeof t=="string"&&t!==""?t:void 0}var Ft="https://api.sekyro.ai",Ht=5e3,Lt=24e4,Dt=12e4,Ut=3,Bt=3e3,qt=1500,Gt=10;function st(e){return e instanceof Error&&e.name==="ChallengeError"&&e.code||"challenge_failed"}var Kt=new Set(["aborted","embedder_opaque","site_key_rejected"]);function jt(e){return new Promise(t=>setTimeout(t,e))}function Yt(){let e=globalThis.crypto;if(e!==void 0&&typeof e.randomUUID=="function")return e.randomUUID();let t=new Uint8Array(16);if(e!==void 0&&typeof e.getRandomValues=="function")e.getRandomValues(t);else for(let i=0;i<16;i+=1)t[i]=Math.floor(Math.random()*256);t[6]=(t[6]??0)&15|64,t[8]=(t[8]??0)&63|128;let n=[...t].map(i=>i.toString(16).padStart(2,"0")).join("");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}function so(e){return $t(e,{})}function $t(e,t){let n=e.apiOrigin??Ft,i=e.autoRetry??!0,o=e.rearm??"auto",s=t.client??new Ke({apiOrigin:n,sessionToken:e.clientToken,fetch:e.fetch}),a=t.sleep??jt,c=t.uuid??Yt,p=t.getChallengeToken??((r,u)=>import("./challenge-frame-5GG4NDF5.js").then(l=>l.executeChallenge({frameUrl:r.url,siteKey:r.siteKey,action:"liveness",subject:u.subject,signal:u.signal}))),y=Be(),S=null,A=null,d=!1,k=new AbortController,f=null,T=null,W=null,Q=()=>W??Je(f),ke=()=>Xe(ee(f),Q()),R=r=>{f=r,y.emit("view",r),S?.onView(r)},b=()=>f!==null?Promise.resolve(f):(T??(T=s.getSession().then(r=>(R(r),r)).finally(()=>{T=null})),T),I=async()=>{let r=await s.getSession();return R(r),r},re=async(r,u)=>{r.plan!==void 0?R(r):await I()},ie=null,be=async r=>{let u=await b();if(r||!u.consentRecorded){let l=await s.recordConsent(e.locale);l.plan!==void 0?R(l):f!==null&&R({...f,consentRecorded:!0})}Ve(u)},V=r=>r?.force===!0?be(!0):(ie??(ie=be(!1).finally(()=>{ie=null})),ie),se={client:s,ensureConsent:r=>V(r),sleep:a,uuid:c,...t.random!==void 0?{random:t.random}:{},onBusy:r=>{d||y.emit("busy",r)}},xe=!1,we=null,ae=r=>{if(r.status==="verified"||r.status==="not_verified"||r.status==="review"){if(xe)return;xe=!0}we=JSON.stringify(r),y.emit("result",r)},bt=r=>{we!==JSON.stringify(r)&&ae(r)},Ae=async r=>{let u=f;r&&(u=await I().catch(()=>f));let l=u===null?null:L(u);return l!==null&&!d&&y.emit("method",l),l!==null},Pe=null,Re=!1,Ie=!1,Oe=()=>nt(se,(r,u)=>r.submitCheck("population_registry",{},{idempotencyKey:u})),Me=r=>ne(r)===!0||$(E(r,"population_registry"))===!0,xt=async()=>{try{let r=await b();if(P(r)||L(r)!==null||D(r)?.checkType!=="population_registry")return;if(!Me(r)&&$(E(r,"population_registry"))===void 0&&(r=await I()),!Me(r)){Ie=!0;return}await V(),await re(await Oe(),"population_registry");let u=f===null?void 0:E(f,"population_registry");if(u?.state==="input_required"&&u.reason==="registry_unavailable"&&z(u)>0){if(await a(Ht),d)return;await re(await Oe(),"population_registry")}}catch(r){if(r instanceof fe&&(r.code==="check_not_active"||r.code==="step_not_on_path")){await I().catch(()=>{});return}Re=!0;return}f!==null&&P(f)&&ae(j(f,{autoRetry:i}))},Ee=()=>(Pe??(Pe=xt()),Pe),ue=t.now??Date.now,H=null,B,ce,wt=0,de=(r,u)=>`${r.url}
|
|
2
|
-
${r.siteKey}
|
|
3
|
-
${u}`,le=(r,u)=>{let l=ue(),g=p(r,{signal:k.signal,subject:u});return g.then(()=>{ce=void 0},m=>{let C=st(m);if(d||C==="aborted")return;ce=C;let{detail:O,readyMs:w}=m;q({check:"attestation",kind:"unavailable",engineKind:C,attempt:wt++,challengeMs:ue()-l,readyMs:w,detail:O,inApp:Ue()})}),g.catch(()=>{}),{key:de(r,u),at:l,token:g}},ve=(r,u)=>r!==null&&r.key===u&&ue()-r.at<Lt,Ve=r=>{let u=r?.challenge??null;if(r===null||u===null||d)return;let l=U(r.sessionId);ve(H,de(u,l))||(H=le(u,l))},At=async(r,u)=>{let l=de(r,u),g=H;H=null;let m=ve(g,l)?g:le(r,u),C=m===g?0:1,O,w=new Promise(h=>{O=setTimeout(()=>h("late"),Dt)});try{for(;;){let h=await Promise.race([m.token.then(M=>({token:M}),M=>({error:st(M)})),w]);if(h==="late")return!d&&H===null&&(H=m),{error:ce??"timeout"};if("token"in h||d||Kt.has(h.error)||C>=Ut||C>0&&await Promise.race([a(Bt*C),w])==="late")return h;if(d)return{error:"aborted"};C+=1,m=le(r,u)}}finally{clearTimeout(O)}},Te=async()=>{B=void 0;let r=await b(),u=r.challenge;if(u==null)return{};let l=await At(u,U(r.sessionId));if("token"in l)return{channel:"hosted_web",turnstileToken:l.token};if(B=l.error,r.simulation!==void 0)return{channel:"hosted_web"};throw new tt(l.error)},Pt=()=>B,q=r=>{if(d)return;let u=s.reportCaptureIssue;if(u===void 0)return;let l=r.formFactor;try{l??(l=De())}catch{}try{Promise.resolve(u.call(s,{...r,...l!==void 0?{formFactor:l}:{}})).catch(()=>{})}catch{}},x=null,Ne=Promise.resolve(),G=0,Rt=async()=>{let r=await b();for(let u=0;u<Gt&&!d&&!P(r)&&D(r)===void 0&&X(r).some(l=>l.state==="processing")&&(await a(qt),!d);u+=1)r=await I();return r},It=async(r,u,l)=>{let{capture:g}=r,m=()=>d,C=()=>r.alive&&r.attempt===l,O=h=>{C()&&g.setFlowState(h)},w=h=>{if(!m()&&(h.status==="unavailable"&&h.reasonCode!==void 0&&!je(h.reasonCode)&&q({check:"liveness",kind:"unavailable",phase:"upload",engineKind:h.reasonCode,attempt:Math.max(0,r.issues.value)}),ae(h),!!C())){if(h.status==="retry"&&o==="auto"){g.handle.retry();return}g.setFlowState("done")}};if(u.degraded==="NO_RECORDER"){let h=f?.sessionId??(await b().catch(()=>null))?.sessionId??"";w(N(h,"no_recorder"));return}O("uploading");try{if(await Ee(),m())return;let h=await b(),M;if(!P(h)&&L(h)!==null){await Ae(!1),w(N(h.sessionId,"method_required"));return}if(!P(h)){if(D(h)?.checkType==="population_registry"){w(N(h.sessionId,Ie?"nni_unbound":Re?"network":"registry_unavailable"));return}if(await V(),m())return;M=f??h;let Z=await ot({...se,artifacts:u,getAttestation:Te,attestationError:Pt,getView:()=>f??h,refreshView:I,applySubmit:re,onPhase:O,isCancelled:m,onKeyframePromoted:J=>{A=J}});if(m())return;if(Z.kind==="unavailable"){let J=N(h.sessionId,Z.reason),Le=Z.reason==="attestation"?B:void 0;w(Le!==void 0?{...J,attestationError:Le}:J);return}if(Z.kind==="resync"&&await I(),f!==null&&L(f)!==null){await Ae(!1),w(N(h.sessionId,"method_required"));return}h=await Rt()}w(j(h,{autoRetry:i,previous:M}))}catch{if(m())return;w(N(f?.sessionId??"","network"))}},Ot=(r,u)=>{let l=r.attempt;G>0&&r.alive&&r.capture.setFlowState("uploading"),G+=1,Ne=Ne.then(()=>It(r,u,l)).finally(()=>{G-=1,G===0&&S?.onChainIdle()}).catch(()=>{})},Fe=r=>{x?.capture.handle.destroy(),x!==null&&(x.alive=!1);let u=qe(r,S?.captureInternals?.(r)??t.capture,()=>f?.capture?.liveness?.keyframe?.rank===!0,ke,()=>f?.capture?.liveness?.screenRamp,{session:()=>ee(f),onModeChange:m=>{W=m}}),l={capture:u,alive:!0,attempt:0,issues:$e()};x=l,u.handle.on("error",m=>{q(Ye("liveness",m,l.issues.value))}),u.handle.on("state",m=>{if(l.issues.note(m),m==="starting"){l.attempt+=1,Ve(f);let C=f===null?void 0:D(f)?.checkType;(C==="liveness"||C==="face_match")&&V().catch(()=>{})}}),u.handle.on("captured",m=>{Promise.resolve().then(()=>Ot(l,m))});let g=u.handle;return{get state(){return g.state},get captureMode(){return g.captureMode},get facingMode(){return g.facingMode},on:(m,C)=>g.on(m,C),start:async m=>{if(f===null&&await b().catch(()=>{}),!!l.alive)return g.start(m)},retry:()=>g.retry(),switchCamera:()=>g.switchCamera(),canSwitchCaptureMode:()=>g.canSwitchCaptureMode(),setCaptureMode:m=>g.setCaptureMode(m),destroy:()=>{l.alive=!1,x===l&&(x=null),g.destroy()}}},Mt=async()=>{if(d)return null;try{let r=await b();return d?null:L(r)}catch{return null}},Et=async()=>{if(d)return"self";try{let r=await b();if(d)return"self";let u=ee(r);return u==="choice"?Q()??u:u}catch{return"self"}},vt=async()=>{if(d)return!1;try{let r=await b();return d||P(r)||pe()?!1:Y(r,D(r))==="phone"||Y(r,E(r,"liveness"))==="phone"}catch{return!1}},Vt=async()=>{if(d)return!1;try{let r=await b();return!d&&r.returning===!0}catch{return!1}},Tt=async r=>{let u=(await b()).plan?.choice,l=u?.options.find(m=>K[m.service]===r);if(!l)throw new RangeError(`method ${String(r)} is not offered`);let g=await s.choose(u.nodeId,l.id);d||R(g)},He=null,Nt=()=>(He??(He=import("./plan-runner-WGMNUBWJ.js").then(r=>{let u=r.createPlanRunner({runtime:se,currentView:()=>f,cameraMode:ke,captureModeSwitch:{pick:Q,choose:l=>{W=l}},ensureView:b,refreshView:I,ensureConsent:()=>V(),liveness:Fe,stopLiveness:()=>{x!==null&&(x.alive=!1,x.capture.handle.destroy(),x=null)},chainBusy:()=>G>0,destroyed:()=>d,sleep:a,isMobile:pe,now:t.now??Date.now,keptFaceKey:()=>A,setView:R,baseCapture:t.capture,emitStep:l=>{d||y.emit("step",l)},emitResult:bt,reportCaptureIssue:q,documentInternals:t.document,portraitInternals:t.portrait,livePhotoInternals:t.livePhoto,uploadInternals:t.upload,pageCameraInternals:t.pageCamera});return S=u,u})),He);return{consent:()=>V(),startRegistry:Ee,methodChoice:Mt,selectMethod:Tt,reportCameraUnavailable:async r=>{await V();let u=s.reportCameraUnavailable;if(u===void 0)throw new TypeError("this client cannot report a missing camera");let l=await u.call(s,r).catch(g=>{if(g instanceof fe&&g.code==="check_out_of_order")return s.getSession();throw g});d||R(l)},reportCaptureIssue:q,testerGate:async r=>{let u=s.testerGate;if(u===void 0)throw new TypeError("this client cannot run the tester gate");let l=r.clip,g=Ge(r.clipMime??"");if(l===void 0||!et.includes(g))throw new TypeError("the capture has no clip");await V();let m=await ze(s,"clip",g,l.size,{engine:r.engine,durationMs:r.clipMs});await s.uploadToSpaces(m.uploadUrl,l,g);let{key:C}=await s.completeMedia(m.key),O=await Te(),w=await u.call(s,{clipKey:C,attestation:O,captureChannel:r.captureChannel,capture:{...rt(r),attestationError:B}}),{bound:h,...M}=w;return d||(M.plan!==void 0?R(M):await I()),{bound:h===!0}},mobileRequired:vt,captureMode:Et,chooseCaptureMode:r=>{W=r},get captureChoice(){return Q()},returning:Vt,liveness:Fe,run:async()=>{if(d)throw new Error("verification destroyed");return(await Nt()).run()},currentStep:()=>S?.current()??null,voiceClips:async()=>{if(d)return null;try{let r=await b();return d?null:r.voice??null}catch{return null}},on:(r,u)=>y.on(r,u),destroy:()=>{d=!0,k.abort(),S?.destroy(),x!==null&&(x.alive=!1,x.capture.handle.destroy(),x=null),y.clear()}}}var at=["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 Wt=["carte_identite","passport","residence_permit","drivers_license"],Qt=["carte_identite","passport","residence_permit"];function Zt(e,t){let n=e.byIssuer?.[t]??e.default;return Wt.filter(i=>n==="*"?Qt.includes(i):n.includes(i))}function lo(e,t=at){return[...new Set([...t,...Object.keys(e.byIssuer??{})])].filter(i=>Zt(e,i).length>0).sort()}function ut(e){if(e.acceptedDocuments)return e.acceptedDocuments;let t=e.acceptedDocumentTypes?.length?[...e.acceptedDocumentTypes]:["carte_identite","passport"];return{default:[],byIssuer:{MR:t}}}function po(e){return/^[A-Z]{2}$/.test(e)?String.fromCodePoint(...[...e].map(t=>127462+t.charCodeAt(0)-65)):""}var _={fullNameMin:2,fullName:200,email:254,occupation:120,shortText:120,longText:1e3,addressLine:120,addressLines:4,city:80,postcode:16,number:1e12,dateMin:"1900-01-01",dateMax:"2100-12-31"},Jt=new Set(["full_name","birth_date","email","phone","address","country","occupation"]),Xt=new Set(["short_text","long_text","single_choice","multiple_choice","yes_no","date","number"]),zt=new Set(["ar","fa","he","ur"]);function ct(e){return zt.has(e.split("-")[0]?.toLowerCase()??"")?"rtl":"ltr"}function dt(e){if(typeof e!="object"||e===null)return null;let t=e;if(typeof t.locale!="string"||!Array.isArray(t.questions)||t.questions.length===0)return null;let n=t.consents??[];if(!Array.isArray(n))return null;for(let o of t.questions)if(!en(o))return null;for(let o of n)if(!tn(o))return null;let i={locale:t.locale,questions:t.questions,consents:n};return typeof t.title=="string"&&t.title.trim()!==""&&(i.title=t.title),typeof t.intro=="string"&&t.intro.trim()!==""&&(i.intro=t.intro),typeof t.prefill=="object"&&t.prefill!==null&&!Array.isArray(t.prefill)&&(i.prefill=t.prefill),i}function en(e){if(typeof e!="object"||e===null)return!1;let t=e;return typeof t.id!="string"||typeof t.required!="boolean"?!1:t.kind==="field"?typeof t.field=="string"&&Jt.has(t.field):t.kind!=="custom"||typeof t.type!="string"||!Xt.has(t.type)||typeof t.label!="string"?!1:t.type==="single_choice"||t.type==="multiple_choice"?Array.isArray(t.choices)&&t.choices.length>=2&&t.choices.every(n=>typeof n=="object"&&n!==null&&typeof n.value=="string"&&typeof n.label=="string"):!0}function tn(e){if(typeof e!="object"||e===null)return!1;let t=e;if(typeof t.id!="string"||typeof t.required!="boolean"||typeof t.text!="string")return!1;if(t.link===void 0)return!0;let n=t.link;return typeof n=="object"&&n!==null&&typeof n.url=="string"&&/^https:\/\//.test(n.url)&&typeof n.label=="string"}var nn=/^(\d{4})-(\d{2})-(\d{2})$/;function on(e){if(typeof e!="string")return!1;let t=nn.exec(e);return t===null?!1:new Date(Date.UTC(Number(t[1]),Number(t[2])-1,Number(t[3]))).toISOString().slice(0,10)===e&&e>=_.dateMin&&e<=_.dateMax}function rn(e){return typeof e=="number"&&Number.isFinite(e)&&Math.abs(e)<_.number&&Math.round(e*100)/100===e}function lt(e){for(let t of e.matchAll(/\d[\d -]{11,}\d/g)){let n=t[0].replace(/[ -]/g,"");if(n.length>=13&&n.length<=19&&sn(n))return!0}return!1}function sn(e){let t=0;for(let n=0;n<e.length;n++){let i=Number(e[e.length-1-n]);n%2===1&&(i*=2,i>9&&(i-=9)),t+=i}return t%10===0}var an=/^[^\s@]+@[^\s@.]+(\.[^\s@.]+)+$/,un=/^\+[1-9]\d{6,14}$/,pt=/^[A-Z]{2}$/,cn=e=>e===void 0||typeof e=="string"&&e.trim()===""||Array.isArray(e)&&e.length===0;function dn(e=Date.now()){return new Date(e).toISOString().slice(0,10)}function mo(e,t,n=dn()){let i=[];for(let o of e.questions){let s=t.answers[o.id];if(cn(s)){o.required&&i.push({id:o.id,code:"required"});continue}let a=o.kind==="field"?ln(o.field,s,n):fn(o,s,n);a!==null&&i.push({id:o.id,...a})}for(let o of e.consents)o.required&&t.consents[o.id]!==!0&&i.push({id:o.id,code:"consent_required"});return i}function oe(e,t,n=1){if(typeof e!="string")return{code:"required"};let i=e.trim();return[...i].length>t?{code:"too_long",params:{max:t}}:[...i].length<n?{code:"too_short",params:{min:n}}:lt(i)?{code:"card_number"}:null}function ft(e,t,n={}){return on(e)?n.period==="past"&&e>=t?{code:"date_not_past"}:n.period==="future"&&e<=t?{code:"date_not_future"}:n.min!==void 0&&e<n.min?{code:"date_too_early",params:{date:n.min}}:n.max!==void 0&&e>n.max?{code:"date_too_late",params:{date:n.max}}:null:{code:"date_invalid"}}function ln(e,t,n){switch(e){case"full_name":return oe(t,_.fullName,_.fullNameMin);case"occupation":return oe(t,_.occupation);case"birth_date":return ft(t,n,{period:"past"});case"email":return typeof t=="string"&&t.trim().length<=_.email&&an.test(t.trim())?null:{code:"email_invalid"};case"phone":return typeof t=="string"&&un.test(t)?null:{code:"phone_invalid"};case"country":return typeof t=="string"&&pt.test(t)?null:{code:"choice_invalid"};case"address":return pn(t)?null:{code:"address_invalid"};default:return null}}function pn(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=e,n=Array.isArray(t.lines)?t.lines.filter(i=>typeof i=="string"&&i.trim()!==""):[];return typeof t.country=="string"&&pt.test(t.country)&&typeof t.city=="string"&&t.city.trim()!==""&&t.city.trim().length<=_.city&&n.length>=1&&n.length<=_.addressLines&&n.every(i=>i.trim().length<=_.addressLine&&!lt(i))&&(t.postcode===void 0||typeof t.postcode=="string"&&t.postcode.trim().length<=_.postcode)}function fn(e,t,n){let i=new Set((e.choices??[]).map(o=>o.value));switch(e.type){case"short_text":return oe(t,_.shortText);case"long_text":return oe(t,_.longText);case"single_choice":return typeof t=="string"&&i.has(t)?null:{code:"choice_invalid"};case"multiple_choice":return Array.isArray(t)&&t.length>0&&new Set(t).size===t.length&&t.every(o=>i.has(o))?null:{code:"choice_invalid"};case"yes_no":return typeof t=="boolean"?null:{code:"choice_invalid"};case"date":{let o=e.options??{};return ft(t,n,{...typeof o.min=="string"?{min:o.min}:{},...typeof o.max=="string"?{max:o.max}:{},...o.period==="past"||o.period==="future"?{period:o.period}:{}})}case"number":{if(typeof t!="number"||!Number.isFinite(t)||Math.abs(t)>=_.number)return{code:"number_invalid"};let o=e.options??{};return o.integer===!0&&!Number.isInteger(t)?{code:"number_not_integer"}:rn(t)?typeof o.min=="number"&&t<o.min?{code:"number_too_small",params:{min:o.min}}:typeof o.max=="number"&&t>o.max?{code:"number_too_large",params:{max:o.max}}:null:{code:"number_decimals"}}default:return null}}var ho={full_name:_.fullName,occupation:_.occupation,email:_.email,short_text:_.shortText,long_text:_.longText};var mt=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"}),mn=new Map(Object.entries(mt)),go=new Map(Object.entries(mt).map(([e,t])=>[t,e]));function ht(e){return mn.get(e)??e}var Po=["national_number","document_photo","national_eid"],hn=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","form"]),yn=new Set(["supplied_identity","aml_screening","face_dedup","age_estimation"]),he=["document","population_registry","national_eid"],ye=["phone_otp","email_otp"],St={identity_method:he,contact:ye},gn=["population_registry","document"],ge="platform_unsupported",Sn=new Set(["prefilled","user_entered","prefilled_or_entered"]),_n={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",form:"form"};function v(e){return e.section??_n[e.checkType]??null}function Cn(e,t){let n=e.plan?.choice;if(n===void 0||n.locked)return;let i=n.options.find(o=>o.id!==n.selected&&o.available!==!1&&t.includes(o.service));return i===void 0?void 0:{nodeId:n.nodeId,option:i}}function Se(e){let t=e.plan,n=t?.choice;if(t===void 0||n===void 0||n.locked||t.current===null||t.current===n.nodeId||P(e))return null;let i=St[n.kind]??[...he,...ye],o=n.options.flatMap(c=>c.available===!1||!i.includes(c.service)?[]:[c.nationalEid!=null?{id:c.id,service:c.service,nationalEid:c.nationalEid}:{id:c.id,service:c.service}]),s=t.steps.find(c=>c.id===t.current)?.service,a=n.selected??o.find(c=>c.service===s)?.id??null;return o.some(c=>c.id!==a)?{nodeId:n.nodeId,kind:n.kind,current:a,options:o}:null}function _t(e){return e==null?[]:e.options.filter(t=>t.id!==e.current)}function kn(e){let t=e.simulation;if(typeof t!="object"||t===null)return;let{otpCode:n,skipCapture:i}=t;if(typeof n!="string"||n===""||typeof i!="boolean")return;let o=Ze(e);return o!==void 0?{otpCode:n,skipCapture:i,reason:o}:{otpCode:n,skipCapture:i}}function bn(e){let t=(e.plan?.sections??[]).map(a=>({id:a.id,state:a.state})),n={sessionId:U(e.sessionId),orgName:e.orgName,sandbox:e.sandbox===!0,returning:e.returning===!0,consentRecorded:e.consentRecorded,expiresAt:e.expiresAt,sections:t.map(a=>a.id),progress:t,purpose:e.purpose??"identity"};e.branding!==void 0&&(n.branding=e.branding),e.cameraUnavailableHandled===!0&&(n.cameraUnavailableHandled=!0);let i=kn(e);i!==void 0&&(n.simulation=i);let o=e.testerGate;o?.offered===!0&&typeof o.attemptsLeft=="number"&&o.attemptsLeft>0&&(n.testerGate={attemptsLeft:o.attemptsLeft});let s=Se(e);return s!==null&&(n.switchable=s),n}function xn(e){let t={attemptsRemaining:z(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 Ct={phone_otp:"phone",email_otp:"email"};function wn(e,t){let n=Cn(e,[t==="phone_otp"?"email_otp":"phone_otp"]);return n===void 0?void 0:Ct[n.option.service]}function An(e,t,n,i){let o=t.checkType==="email_otp",s=(o?t.emailOtp:t.otp)??{},a=o?t.emailOtp?.emailSource:t.otp?.numberSource,c=a!==void 0&&Sn.has(a)?a:o?"prefilled_or_entered":"user_entered",p=typeof s.sentToMasked=="string"&&s.sentToMasked.length>0,y=s.prefilled===!0,S=wn(e,o?"email_otp":"phone_otp"),A={key:t.checkType,context:n,section:v(t),phase:p?"verify":"send",canSwitch:S!==void 0,...i},d=o?{kind:"email_otp",...A,emailSource:c,needsEmail:c!=="prefilled"&&!y}:{kind:"phone_otp",...A,numberSource:c,needsPhone:c!=="prefilled"&&!y,channels:(t.otp?.channels??[]).filter(k=>k==="whatsapp"||k==="sms")};if(S!==void 0&&(d.switchChannel=S),y&&(d.prefilled=!0),p&&(d.sentToMasked=s.sentToMasked),!o&&t.otp?.channel!==void 0&&(d.channel=t.otp.channel),!o&&Array.isArray(t.phoneCountries)&&(d.phoneCountries=t.phoneCountries.filter(k=>typeof k=="string"&&/^[A-Z]{2}$/.test(k))),!o&&Array.isArray(t.phoneRules)){let k=d.phoneCountries??[];d.phoneRules=t.phoneRules.flatMap(f=>{let T=In(f);return T!==void 0&&k.includes(T.code)?[T]:[]})}return!o&&t.phoneInternational===!0&&(d.phoneInternational=!0),s.expiresAt!==void 0&&(d.codeExpiresAt=s.expiresAt),s.resendAvailableAt!==void 0&&(d.resendAvailableAt=s.resendAvailableAt),d}var Pn=/^[\d[\]\-|()?:^]{1,64}$/;function Rn(e){try{return typeof e=="string"&&Pn.test(e)&&new RegExp(e)!==null}catch{return!1}}var yt=e=>typeof e=="number"&&Number.isInteger(e)&&e>=1&&e<=15;function In(e){let{code:t,dial:n,trunk:i,lengths:o,formats:s}=e??{};if(typeof t!="string"||typeof n!="string"||!/^\d{1,3}$/.test(n)||i!==void 0&&(typeof i!="string"||!/^\d{1,3}$/.test(i))||!Array.isArray(o)||o.length===0||!o.every(yt))return;let a={code:t,dial:n,lengths:[...o].sort((c,p)=>c-p)};if(i!==void 0&&(a.trunk=i),s!==void 0){if(!(Array.isArray(s)&&s.length<=8&&s.every(p=>Rn(p?.leading)&&Array.isArray(p.groups)&&p.groups.every(yt)&&o.includes(p.groups.reduce((y,S)=>y+S,0)))))return;a.formats=s.map(p=>({leading:p.leading,groups:[...p.groups]}))}return a}function On(e,t,n,i){let o=ne(e)===!0?"bound":$(t)===!0?"document":"typed",s=o==="typed"&&t.state==="input_required"&&t.reason!==void 0&&ht(t.reason)==="id_number_recheck",a=_t(Se(e)),c=!i.attemptsExhausted&&a.length===1&&a[0]?.service==="document";return{kind:"registry",key:"registry",context:n,section:v(t),state:t.state==="input_required"?"input_required":"pending",source:o,recheck:s,canUseDocument:c,...i}}function Mn(e,t,n,i,o){let s=[...t.acceptedSides??[]],a={kind:"document",key:"document",context:n,section:v(t),side:s.includes("recto")?"verso":"recto",acceptedSides:s,documents:ut(e),photo:Ce(_e(e.documents),o),...i};return e.detectedCountry!==void 0&&(a.detectedCountry=e.detectedCountry),Vn(e)&&(a.ageStepUp=!0),a}function _e(e,t=!0){let n=e?.source==="upload"||e?.source==="choice"?e.source:"camera",i=e?.sourcePick==="camera"||e?.sourcePick==="upload"?e.sourcePick:null;return{source:n,pick:i,uploadOffered:t&&e?.uploadOffered===!0}}function Ce(e,t){return t?{...e,cameraOnPhone:!0}:e}var En=10*1024*1024;function vn(e,t,n,i,o){let s=e.proofOfAddress,a=s?.pdf?.maxBytes,c=s?.phase==="holder_letter"?"holder_letter":"document";return{kind:"proof_of_address",key:"proof_of_address",context:n,section:v(t),phase:c,rule:s?.rule??{country:null,countryFrom:"global",source:"preset_global",kinds:[]},nameMatch:s?.nameMatch??"exact_person",photo:Ce(_e(s),o),maxPages:3,pdf:{maxBytes:typeof a=="number"&&a>0?a:En,maxPages:3},licenceAddressAccepted:c==="document"&&s?.licenceAddressAccepted===!0,...i}}function Vn(e){let t=X(e).find(i=>i.checkType==="age_estimation"),n=t?.reason;return t?.state==="failed"&&(n==="age_uncertain"||n==="age_unavailable")}function Tn(e){let t=E(e,"liveness");return t?.state==="passed"||t?.state==="review"}function gt(e,t,n,i,o,s=!1){let a=t.icao?.report,c=e.portrait,p=o==="capture"?c?.pendingFix??null:null;p!==null&&(o="review");let y=kt(e);return{kind:"portrait",key:`portrait:${o}`,context:n,section:v(t),phase:o,report:Array.isArray(a)?a:null,review:t.state==="review",tuning:e.capture?.icao??null,tuningVersion:e.capture?.tuningVersion??null,icao:te(e),retakeOnly:o==="capture"&&t.state==="input_required"&&y===void 0&&e.capture?.livePhoto?.oneCapture===!0&&Tn(e),photo:Ce(_e(c,o==="capture"),s&&o==="capture"),pendingFix:p,...y!==void 0?{captureMode:y}:{},...c?.reuse?.pending===!0?{reuse:!0}:{},...i}}function kt(e){let t=e.portrait?.captureMode;return t==="self"||t==="assisted"||t==="choice"?t:void 0}var me={minLongSidePx:1280,jpegQuality:.95};function Nn(e,t){let n=e.capture?.livePhoto;if(n?.oneCapture!==!0)return null;let i=E(e,"portrait_icao"),o=n.still??me;return{icao:t==="liveness"&&te(e)!==null&&kt(e)===void 0&&i!==void 0&&i.state==="pending"&&i.reason===void 0,still:{minLongSidePx:o.minLongSidePx??me.minLongSidePx,jpegQuality:o.jpegQuality??me.jpegQuality}}}function Fn(e,t,n,i){let o=t.eid,s=v(t);if(o===void 0||o.challenge!=="app_code")return{kind:"unsupported",key:"unsupported:eid_auth",context:n,section:s,checkType:"eid_auth",reason:"update_required"};let a=_t(Se(e)),c=a.length===1&&gn.includes(a[0]?.service??"")?a[0]:void 0,p=c===void 0?void 0:K[c.service],y=p!==void 0,S={kind:"eid",key:"eid",context:n,section:s,provider:o.provider,providerName:o.providerName,country:o.country,challenge:"app_code",phase:o.awaiting==="code"?"code":"identifier",identifierBound:o.identifierBound===!0,canUseCamera:y,afterPass:o.afterPass==="continue"?"continue":"end",...i};return y&&(S.cameraMethod=p),o.expiresAt!==void 0&&(S.codeExpiresAt=o.expiresAt),o.resendAvailableAt!==void 0&&(S.resendAvailableAt=o.resendAvailableAt),o.resendsRemaining!==void 0&&(S.resendsRemaining=o.resendsRemaining),o.codeAttemptsRemaining!==void 0&&(S.codeAttemptsRemaining=o.codeAttemptsRemaining),S}function Hn(e,t){if(t.checkType!=="face_match"||t.reason!==void 0)return null;let n=E(e,"portrait_icao");return n!==void 0&&(n.state==="passed"||n.state==="review")?n:null}var Ln={rejected:"rejected",inconclusive:"inconclusive",unavailable:"unavailable",abandoned:"expired",not_opened:"expired",cancelled:"expired",superseded:"expired",policy:"policy"};function Dn(e){return e.reasonCode===ge?"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?Ln[e.reason]:void 0)??"rejected"}function Un(e,t){let n=Dn(e),i=n==="platform_unsupported"?{sessionId:U(e.sessionId),status:"unavailable",reasonCode:ge}:j(e,{autoRetry:!1}),o={kind:"result",key:"result",context:t,section:null,display:n,result:i};return e.status==="not_verified"&&e.reason!==void 0&&(o.reason=e.reason),e.reasonCode!==void 0&&(o.reasonCode=e.reasonCode),e.status==="not_verified"&&e.step!==void 0&&(o.step=e.step),e.retryAfter!==void 0&&(o.retryAfter=e.retryAfter),o}function Bn(e,t,n){let i=e.identitySummary;if(i==null)return null;let o={kind:"identity_summary",key:"identity_summary",context:t,section:n??"identity",summaryKind:i.kind==="partial"?"partial":i.kind??"full",source:i.source,portraitAvailable:i.portrait?.available===!0,retakeAvailable:i.retakeAvailable===!0};for(let a of qn){let c=i[a];typeof c=="string"&&c!==""&&(o[a]=c)}let s=it(i);return s!==void 0&&(o.idNumberMasked=s,o.nniMasked=s),o}var qn=["fullName","birthDate","birthYear","nationality","documentType","documentNumberMasked","expiryDate","retakeTarget"];function F(e,t,n,i){return{kind:"unsupported",key:`unsupported:${n}`,context:e,section:t,checkType:n,reason:i}}function Gn(e){return e.kind==="contact"?"contact":(e.kind==="identity_method","identity")}function Kn(e,t){let n=St[e.kind]??[...he,...ye],i=Gn(e),o=e.options.flatMap(a=>{if(a.available===!1||!n.includes(a.service))return[];let c={id:a.id,service:a.service};a.nationalEid!=null&&(c.nationalEid=a.nationalEid);let p=(a.channels??[]).filter(y=>y==="whatsapp"||y==="sms");return a.service==="phone_otp"&&p.length>0&&(c.channels=p),[c]});if(o.length===0){let a=e.options.length>0&&e.options.every(c=>c.service==="nfc");return F(t,i,"choice",a?"platform_unsupported":"update_required")}let s={nodeId:e.nodeId,kind:e.kind,selected:e.selected,options:o};if(e.kind==="identity_method"){let a={kind:"method",key:"method",context:t,section:i,options:o.map(p=>K[p.service]),choice:s},c=o.find(p=>p.nationalEid!==void 0)?.nationalEid;return c!==void 0&&(a.nationalEid=c),a}return e.kind==="contact"?{kind:"contact_choice",key:"contact_choice",context:t,section:i,options:o.map(a=>Ct[a.service]),selected:null,locked:!1,choice:s}:{kind:"choice",key:`choice:${e.nodeId}`,context:t,section:i,choice:s}}function jn(e,t,n,i){let o=e.nativeApp,s=typeof o=="object"&&o!==null?o:{},a={sekyroApp:s.sekyroApp===!0};return typeof s.link=="string"&&s.link!==""&&(a.link=s.link),a.sekyroApp&&typeof s.sekyroAppLink=="string"&&s.sekyroAppLink.startsWith("sekyro://")&&(a.sekyroAppLink=s.sekyroAppLink),{kind:"native_app_required",key:`native_app_required:${i}`,context:t,section:n,checkType:i,nativeApp:a}}function Ro(e,t={}){let n=bn(e);if(P(e)||e.reasonCode===ge)return Un(e,n);let i=e.plan;if(i===void 0||!Array.isArray(i.sections))return F(n,null,"plan","update_required");let o=We(e);if(o!==null)return Kn(o,n);let s=i.current===null?void 0:i.steps.find(d=>d.id===i.current),a=d=>{let k={kind:"processing",key:"processing",context:n,section:d!==void 0?v(d):i.sections.find(f=>f.state==="current")?.id??null,stalled:!1};return typeof d?.service=="string"&&d.service!==""&&(k.service=d.service),k};if(i.current===null)return a(i.steps.find(d=>d.state==="processing"));if(s===void 0)return F(n,null,"step","update_required");if(!hn.has(s.service))return s.interaction==="server"?a(s):F(n,v(s),s.service,"update_required");if(yn.has(s.service)||!Qe(s))return a(s);let c=s,p=xn(c),y=c.checkType,S=v(c);if(c.requiresNativeApp===!0)return jn(e,n,S,y);let A=t.isMobile===!1?Y(e,c):null;if(A==="phone")return{kind:"mobile_required",key:"mobile_required",context:n,section:S,checkType:y};switch(y){case"phone_otp":case"email_otp":return An(e,c,n,p);case"population_registry":return On(e,c,n,p);case"eid_auth":return Fn(e,c,n,p);case"doc_ocr":return Mn(e,c,n,p,A==="upload_or_phone");case"identity_confirm":return Bn(e,n,S)??a(c);case"portrait_icao":return gt(e,c,n,p,"capture",A==="upload_or_phone");case"liveness":case"face_match":{let d=Hn(e,c);if(d!==null)return gt(e,d,n,p,"match");let k=c.requiresMobile===!0,f=te(e);return{kind:"liveness",key:"biometric",context:n,section:S,mode:y==="face_match"?"selfie":"liveness",requiresMobile:k,instructions:f===null?"standard":"icao",icao:f,livePhoto:Nn(e,y),...p}}case"poa":return vn(e,c,n,p,A==="upload_or_phone");case"form":{let d=dt(c.form);return d===null?F(n,S,y,"update_required"):{kind:"form",key:"form",context:n,section:S,form:d,dir:ct(d.locale),...p}}case"nfc_chip":return F(n,S,y,"platform_unsupported");default:return F(n,S,y,"update_required")}}export{Ft as a,Ht as b,qt as c,Gt as d,Yt as e,so as f,$t as g,at as h,Wt as i,Zt as j,lo as k,ut as l,po as m,_ as n,ct as o,on as p,rn as q,lt as r,dn as s,mo as t,Po as u,ge as v,v as w,Se as x,_t as y,Hn as z,Ro as A};
|
package/dist/chunk-FVWFAO45.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var b=new Set(["challenge_frame_blocked","challenge_script_blocked","site_key_rejected","challenge_failed","timeout","embedder_opaque"]),i=class extends Error{constructor(n,t){super(`Sekyro challenge failed: ${n}${t!==void 0?` (${t})`:""}`),this.name="ChallengeError",this.code=n,t!==void 0&&(this.detail=t)}},E=1e4,_=3e4,p="sekyro.challenge.",v="position:fixed;width:1px;height:1px;inset-block-start:0;inset-inline-start:0;opacity:0;pointer-events:none;border:0",d=null,g=Promise.resolve();function F(){u(),g=Promise.resolve(),m=!1}function c(){return new i("aborted")}function C(){let e=globalThis.crypto;return e!==void 0&&typeof e.randomUUID=="function"?e.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}function h(e){return new URL(e,document.baseURI).origin}function u(){let e=d;if(e!==null){d=null,window.removeEventListener("message",e.listener),e.iframe.remove();for(let n of e.waiters.values())n.reject(new i("challenge_frame_blocked"));e.waiters.clear()}}function M(e,n){if(n.source!==e.iframe.contentWindow||n.origin!==e.origin)return;let t=n.data;if(typeof t!="object"||t===null)return;let r=t;if(typeof r.type!="string"||!r.type.startsWith(p)||r.v!==1)return;if(r.type==="sekyro.challenge.ready"){e.readyMs??(e.readyMs=Date.now()-e.insertedAt),e.isReady=!0,e.onReady?.();return}if(typeof r.id!="string")return;let a=e.waiters.get(r.id);if(a!==void 0){if(r.type==="sekyro.challenge.token"&&typeof r.token=="string"&&r.token!=="")e.waiters.delete(r.id),a.resolve(r.token);else if(r.type==="sekyro.challenge.error"){e.waiters.delete(r.id);let o=typeof r.code=="string"&&b.has(r.code)?r.code:"challenge_failed",s=typeof r.detail=="string"||typeof r.detail=="number"?String(r.detail).slice(0,32):void 0;a.reject(new i(o,s))}}}function k(e){if(d!==null&&d.url===e)return d;u();let n=document.createElement("iframe");n.setAttribute("title","Security check"),n.setAttribute("aria-hidden","true"),n.setAttribute("tabindex","-1"),n.setAttribute("referrerpolicy","no-referrer"),n.setAttribute("style",v);let t={url:e,origin:h(e),iframe:n,isReady:!1,insertedAt:Date.now(),onReady:null,waiters:new Map,listener:r=>M(t,r)};return window.addEventListener("message",t.listener),n.src=e,document.body.appendChild(n),d=t,t}function A(e,n,t){return e.isReady?Promise.resolve():new Promise((r,a)=>{let o=()=>{clearTimeout(l),t?.removeEventListener("abort",s),e.onReady=null},s=()=>{o(),a(c())},l=setTimeout(()=>{o(),a(new i("challenge_frame_blocked"))},n);t?.addEventListener("abort",s,{once:!0}),e.onReady=()=>{o(),r()}})}async function y(e){if(e.signal?.aborted)throw c();let n=k(e.frameUrl);try{return await x(n,e)}catch(t){throw t instanceof i&&n.readyMs!==void 0&&(t.readyMs??(t.readyMs=n.readyMs)),t}}async function x(e,n){let t=n.signal;await A(e,n.readyTimeoutMs??E,t);let r=e.iframe.contentWindow;if(r===null)throw new i("challenge_frame_blocked");let a=n.timeoutMs??_,o=C(),s,l;try{return await new Promise((w,f)=>{e.waiters.set(o,{resolve:w,reject:f}),s=setTimeout(()=>f(new i("timeout")),a),t!==void 0&&(l=()=>f(c()),t.addEventListener("abort",l,{once:!0})),r.postMessage({type:"sekyro.challenge.request",v:1,id:o,siteKey:n.siteKey,action:n.action,subject:n.subject},e.origin)})}finally{clearTimeout(s),t!==void 0&&l!==void 0&&t.removeEventListener("abort",l),e.waiters.delete(o)}}var m=!1;function R(e,n){if(m)return;let t;if(n==="challenge_frame_blocked"){let r=e;try{r=h(e)}catch{}t=`Sekyro: the security check frame could not load. Allow \`frame-src ${r}\` in your Content-Security-Policy.`}else if(n==="embedder_opaque")t="Sekyro: the security check needs a page with an origin. Do not run the SDK in a sandboxed or data: document.";else return;m=!0,console.warn(t)}async function S(e){if(globalThis.origin==="null")throw new i("embedder_opaque");if(e.signal?.aborted)throw c();try{return await y(e)}catch(n){if(u(),e.signal?.aborted||n instanceof i&&n.code==="aborted")throw c();try{return await y(e)}catch(t){throw u(),e.signal?.aborted?c():t instanceof i?t:new i("challenge_failed")}}}function T(e){let n=()=>S(e).catch(r=>{throw r instanceof i&&R(e.frameUrl,r.code),r}),t=g.then(n,n);return g=t.catch(()=>{}),t}export{i as a,E as b,_ as c,F as d,T as e};
|