@incodetech/core 2.4.1 → 2.5.0-rc.1
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/dist/Actor-DqjOqDfU.d.ts +1 -0
- package/dist/{BaseWasmProvider-Bq3OHo7P.d.ts → BaseWasmProvider-bBNquvYn.d.ts} +2 -2
- package/dist/BrowserNetworkStatusProvider-BrDXBEDd.esm.js +21 -0
- package/dist/{multipartRecordingService-CLwrF5wD.esm.js → CameraCompositor-ppyMYVoY.esm.js} +7 -744
- package/dist/DateFormattingProvider-DPq9zco-.esm.js +25 -0
- package/dist/{FaceDetectionProvider-J_-1Cwck.esm.js → FaceDetectionProvider-D0DbKUKC.esm.js} +28 -64
- package/dist/IBrowserEnvironmentCapability-D7JG7ML3.esm.js +16 -0
- package/dist/IGeolocationCapability-r49Qo7rR.d.ts +10 -0
- package/dist/{IIdCaptureCapability-CGcEt2Cw.d.ts → IIdCaptureCapability-C-5M8pP1.d.ts} +2 -2
- package/dist/{IWasmUtilCapability-GF2n7sfm.d.ts → IWasmUtilCapability-BRn0wz8v.d.ts} +33 -6
- package/dist/Manager-BvXAwDv9.esm.js +125 -0
- package/dist/{Manager-C9T5amUN.d.ts → Manager-DufwKlav.d.ts} +1 -7
- package/dist/MultipartRecordingProvider-CduV32Qa.esm.js +151 -0
- package/dist/{PhoneValidationProvider-SZiOS0jB.esm.js → PhoneValidationProvider-Co4zk2en.esm.js} +7 -0
- package/dist/{StreamCanvasCapture-7JRf-2ck.d.ts → StreamCanvasCapture-BOwciHDC.d.ts} +20 -4
- package/dist/{StreamCanvasCapture-C9jtgBdT.esm.js → StreamCanvasCapture-CXd87trH.esm.js} +18 -3
- package/dist/StreamCanvasProcessingSession-CBnbTnOr.esm.js +42 -0
- package/dist/{WasmUtilProvider-DtJuBdt-.esm.js → WasmUtilProvider-0xTxgP0R.esm.js} +114 -25
- package/dist/WorkerEncoderRecordingProvider-CsDED9UU.esm.js +80 -0
- package/dist/addressSearch-Rxm1K67A.esm.js +73 -0
- package/dist/{advanceableErrors-q_pfU3Cn.esm.js → advanceableErrors-CxZyPRyh.esm.js} +4 -2
- package/dist/ae-signature.d.ts +2 -2
- package/dist/ae-signature.esm.js +1 -1
- package/dist/antifraud.d.ts +1 -1
- package/dist/antifraud.esm.js +2 -2
- package/dist/{antifraudManager-DbGCvlJs.d.ts → antifraudManager-BxfCsyA7.d.ts} +3 -3
- package/dist/{antifraudManager-CaweCYnY.esm.js → antifraudManager-DKNOi9-z.esm.js} +5 -3
- package/dist/{antifraudStateMachine-DRl0UVyA.esm.js → antifraudStateMachine-BJ6PmCsw.esm.js} +3 -3
- package/dist/{api-Cz90EHyu.esm.js → api-CZpuJuZl.esm.js} +11 -6
- package/dist/{apiError-9Yi8xMeB.esm.js → apiError-DJHHF70K.esm.js} +1 -1
- package/dist/attemptCarry-BecGGZK8.esm.js +45 -0
- package/dist/authentication.d.ts +3 -3
- package/dist/authentication.esm.js +2 -2
- package/dist/{authenticationManager-BIZC55Bi.d.ts → authenticationManager-B0WPJjvz.d.ts} +2 -2
- package/dist/{authenticationManager-pKQS4fHT.esm.js → authenticationManager-CkjV81NT.esm.js} +7 -6
- package/dist/{authenticationStateMachine-D_DygKtQ.esm.js → authenticationStateMachine-BoPwxHAI.esm.js} +50 -18
- package/dist/avatar.d.ts +1 -1
- package/dist/backCameraLabel-yda5ugE4.esm.js +67 -0
- package/dist/{backCameraStream-CMvXj4X4.esm.js → backCameraStream-DS1oDiUq.esm.js} +12 -107
- package/dist/{callback-645_omgz.d.ts → callback-BmjJ1G-5.d.ts} +1 -1
- package/dist/{camera-sIa9ceW2.esm.js → camera-E_Kcre4O.esm.js} +15 -23
- package/dist/camera.d.ts +2 -2
- package/dist/camera.esm.js +1 -1
- package/dist/certificate-issuance.d.ts +1 -1
- package/dist/certificate-issuance.esm.js +2 -2
- package/dist/{certificateIssuanceManager-Dr8A4Lgr.d.ts → certificateIssuanceManager-BcYhxO63.d.ts} +4 -3
- package/dist/{certificateIssuanceManager-BfeMv2PU.esm.js → certificateIssuanceManager-DaUklfNj.esm.js} +5 -3
- package/dist/{certificateIssuanceStateMachine-Frgjbjw8.esm.js → certificateIssuanceStateMachine-_EQcjGE3.esm.js} +4 -4
- package/dist/cnpj-Bl_olpdX.esm.js +79 -0
- package/dist/connectivity-BCuEoQ-n.esm.js +114 -0
- package/dist/consent.d.ts +1 -1
- package/dist/consent.esm.js +2 -2
- package/dist/{consentManager-Ca8FHlC4.d.ts → consentManager-B2F_VeAo.d.ts} +13 -5
- package/dist/{consentManager-CvEu8h_W.esm.js → consentManager-BPocwpm2.esm.js} +7 -4
- package/dist/{consentStateMachine-DJTgN_-1.esm.js → consentStateMachine-DgiIcT9q.esm.js} +22 -9
- package/dist/cpf-DDXMTLYr.esm.js +37 -0
- package/dist/{createFaceAvatar-lYX0VTYs.d.ts → createFaceAvatar-BimBTONm.d.ts} +1 -1
- package/dist/cross-document-data-match.d.ts +1 -1
- package/dist/cross-document-data-match.esm.js +1 -1
- package/dist/{crossDocumentDataMatchManager-Cu141CE8.esm.js → crossDocumentDataMatchManager-BfA29Aji.esm.js} +6 -4
- package/dist/{crossDocumentDataMatchManager-yCWCOzcU.d.ts → crossDocumentDataMatchManager-crZcIUSY.d.ts} +3 -3
- package/dist/curp-DZGvefg3.esm.js +14 -0
- package/dist/curp-validation.d.ts +1 -1
- package/dist/curp-validation.esm.js +2 -2
- package/dist/{curpValidationManager-B-z9q5V3.esm.js → curpValidationManager-CbvBDoE1.esm.js} +6 -3
- package/dist/{curpValidationManager-C9sqoh9n.d.ts → curpValidationManager-Ci2iVuog.d.ts} +4 -4
- package/dist/{curpValidationStateMachine-vDEFLMPw.esm.js → curpValidationStateMachine-BQ8XK2Y3.esm.js} +30 -22
- package/dist/custom-fields.d.ts +1 -1
- package/dist/custom-fields.esm.js +1 -1
- package/dist/custom-watchlist.d.ts +1 -1
- package/dist/custom-watchlist.esm.js +2 -2
- package/dist/{customFieldsManager-D1ex2cFM.esm.js → customFieldsManager-BRqSCR9R.esm.js} +6 -4
- package/dist/{customFieldsManager-CF-cO8ap.d.ts → customFieldsManager-CdWTbsew.d.ts} +3 -3
- package/dist/{customWatchlistManager-CTI-SGk0.esm.js → customWatchlistManager-Bd1ooIDB.esm.js} +5 -3
- package/dist/{customWatchlistManager-DolUswyR.d.ts → customWatchlistManager-lJrveDS4.d.ts} +3 -3
- package/dist/{customWatchlistStateMachine-hmRd0f2I.esm.js → customWatchlistStateMachine-r8nGhyo1.esm.js} +3 -3
- package/dist/{deepsightService-C3DVBOZd.esm.js → deepsightLoader-ngnhyO6B.esm.js} +39 -69
- package/dist/definitionSource-Nw0YCbpe.esm.js +221 -0
- package/dist/{createCameraCycleOwnership-Dj_LHUvN.esm.js → desktopCameraElection-BKFjsQpO.esm.js} +178 -41
- package/dist/device.esm.js +2 -2
- package/dist/document-capture.d.ts +3 -3
- package/dist/document-capture.esm.js +2 -2
- package/dist/{documentCaptureManager-DUJwpKC5.esm.js → documentCaptureManager-BKaJVQxg.esm.js} +30 -20
- package/dist/{documentCaptureManager-DkyDtm3Y.d.ts → documentCaptureManager-BZBmcOKI.d.ts} +41 -7
- package/dist/{documentCaptureStateMachine-B8i7GnLh.esm.js → documentCaptureStateMachine-BYLb5Azk.esm.js} +107 -58
- package/dist/dynamic-forms.d.ts +2 -2
- package/dist/dynamic-forms.esm.js +2 -2
- package/dist/{dynamicFormsManager-C0dHs1ty.d.ts → dynamicFormsManager-C45pTncO.d.ts} +4 -4
- package/dist/{dynamicFormsManager-DK_oc5Oy.esm.js → dynamicFormsManager-CC3t8bqX.esm.js} +5 -3
- package/dist/{dynamicFormsStateMachine-CGlIAWZ6.esm.js → dynamicFormsStateMachine-Vsn6kszV.esm.js} +4 -4
- package/dist/ekyb.d.ts +5 -5
- package/dist/ekyb.esm.js +3 -3
- package/dist/{ekybManager-BaZ_7CEu.d.ts → ekybManager-BflWuTe4.d.ts} +5 -5
- package/dist/{ekybManager-BLgkiWXw.esm.js → ekybManager-DgNO6c0e.esm.js} +5 -3
- package/dist/{ekybStateMachine-BfgOUZMK.esm.js → ekybStateMachine-DHybwePr.esm.js} +40 -56
- package/dist/ekybUtils-Cw8Ta9Qi.esm.js +140 -0
- package/dist/ekyc-prefill.d.ts +17 -0
- package/dist/ekyc-prefill.esm.js +3 -0
- package/dist/ekyc.d.ts +4 -3
- package/dist/ekyc.esm.js +3 -3
- package/dist/{ekycManager-DW-ynodd.d.ts → ekycManager-BKVQazAb.d.ts} +49 -7
- package/dist/{ekycManager-BO-Lui3t.esm.js → ekycManager-nRT0rxei.esm.js} +39 -16
- package/dist/ekycPrefillManager-DOTl3Y2w.d.ts +566 -0
- package/dist/ekycPrefillManager-Drq_nYJ3.esm.js +103 -0
- package/dist/ekycPrefillStateMachine-CycO-K3B.esm.js +687 -0
- package/dist/ekycRules-DXP2hqVw.esm.js +479 -0
- package/dist/ekycStateMachine-nwJRel2s.esm.js +7897 -0
- package/dist/ekycUtils-FcqA6oU4.esm.js +1491 -0
- package/dist/electronic-signature.d.ts +1 -1
- package/dist/electronic-signature.esm.js +1 -1
- package/dist/{electronicSignatureManager-DTSLOvKR.d.ts → electronicSignatureManager-5tYz-a4o.d.ts} +4 -3
- package/dist/{electronicSignatureManager-CjKvJ6E-.esm.js → electronicSignatureManager-hn-_ADP5.esm.js} +8 -6
- package/dist/email.d.ts +1 -1
- package/dist/email.esm.js +2 -2
- package/dist/{emailManager-ButFktRm.esm.js → emailManager-Co4jarT1.esm.js} +5 -3
- package/dist/{emailManager-Dy6omJVp.d.ts → emailManager-pM7ZPuMa.d.ts} +3 -3
- package/dist/{emailStateMachine-BXtlC0NV.esm.js → emailStateMachine-CTEaYncs.esm.js} +34 -22
- package/dist/events-CP3yOzAl.esm.js +299 -0
- package/dist/events.d.ts +3 -1
- package/dist/events.esm.js +2 -1
- package/dist/extensibility.d.ts +43 -41
- package/dist/extensibility.esm.js +39 -37
- package/dist/{externalFetch-DrR9xshk.esm.js → externalFetch-CQY41QT1.esm.js} +4 -1
- package/dist/face-match.d.ts +1 -1
- package/dist/face-match.esm.js +2 -2
- package/dist/{faceCaptureManagerFactory-BDGhg24q.esm.js → faceCaptureManagerFactory-B2POCGth.esm.js} +17 -6
- package/dist/{faceCaptureManagerFactory-1hzeS_rB.d.ts → faceCaptureManagerFactory-BZjGT392.d.ts} +84 -72
- package/dist/{faceCaptureSetup-CvGYG4GZ.esm.js → faceCaptureSetup-DCBK1osx.esm.js} +117 -482
- package/dist/{faceMatchManager-DIgG-UFS.d.ts → faceMatchManager-C5b5WtcY.d.ts} +23 -7
- package/dist/{faceMatchManager-DWFUQjMQ.esm.js → faceMatchManager-CGmNGbov.esm.js} +5 -3
- package/dist/{faceMatchStateMachine-CUCvlydD.esm.js → faceMatchStateMachine-BuHt7kec.esm.js} +68 -29
- package/dist/{feature-management-D4ne_hXW.esm.js → feature-management-BFfuXr1M.esm.js} +35 -21
- package/dist/feature-management.esm.js +1 -1
- package/dist/field-comparison.d.ts +1 -1
- package/dist/field-comparison.esm.js +1 -1
- package/dist/{fieldComparisonManager-v3knTYV_.esm.js → fieldComparisonManager-VgCU4X96.esm.js} +6 -4
- package/dist/{fieldComparisonManager-CUX4gza2.d.ts → fieldComparisonManager-mFOHRhVd.d.ts} +3 -3
- package/dist/fiscal-qr.d.ts +1 -1
- package/dist/fiscal-qr.esm.js +1 -1
- package/dist/{fiscalQrManager-Dt9fHG7h.esm.js → fiscalQrManager-D4G-4xKE.esm.js} +9 -7
- package/dist/{fiscalQrManager-D0Iy7EKR.d.ts → fiscalQrManager-DFnFVpP9.d.ts} +3 -3
- package/dist/flow-events.d.ts +1 -1
- package/dist/flow.d.ts +75 -24
- package/dist/flow.esm.js +288 -70
- package/dist/{flowCompletionService-Cemwaa5b.esm.js → flowCompletionService-Crry_GxY.esm.js} +24 -3
- package/dist/{flowServices-X6Rwf_7E.esm.js → flowServices-Cj8SQjQT.esm.js} +447 -183
- package/dist/geolocation.d.ts +1 -1
- package/dist/geolocation.esm.js +2 -2
- package/dist/{geolocationManager-Dn24g1fl.d.ts → geolocationManager-CENrvxpK.d.ts} +19 -20
- package/dist/{geolocationManager-B0dc5rW9.esm.js → geolocationManager-qpTiVlc6.esm.js} +9 -9
- package/dist/{geolocationStateMachine-B3rcoODF.esm.js → geolocationStateMachine-Dk10UW9G.esm.js} +14 -10
- package/dist/{getDeviceClass-bsWdEDxP.esm.js → getDeviceClass-DoIWuKI8.esm.js} +1 -1
- package/dist/government-validation.d.ts +1 -1
- package/dist/government-validation.esm.js +2 -2
- package/dist/{governmentValidationManager-BtXWHICu.esm.js → governmentValidationManager-6JQQkzha.esm.js} +5 -3
- package/dist/{governmentValidationManager-B82zOut8.d.ts → governmentValidationManager-De_vU7bm.d.ts} +4 -4
- package/dist/{governmentValidationStateMachine-COL-Vs48.esm.js → governmentValidationStateMachine-wBunpfQ9.esm.js} +3 -3
- package/dist/home.d.ts +4 -3
- package/dist/home.esm.js +4 -2
- package/dist/http.esm.js +1 -1
- package/dist/id-ocr.d.ts +2 -2
- package/dist/id-ocr.esm.js +3 -19
- package/dist/id-selfie-flow.d.ts +6 -5
- package/dist/id-selfie-flow.esm.js +14 -12
- package/dist/id-verification.d.ts +1 -1
- package/dist/id-verification.esm.js +2 -2
- package/dist/id.d.ts +4 -17
- package/dist/id.esm.js +4 -4
- package/dist/{idCaptureDefaults-BGsG2OAs.esm.js → idCaptureDefaults-Drh207VJ.esm.js} +3 -3
- package/dist/{idCaptureManager-0M02hSuC.d.ts → idCaptureManager-C4Xk02cS.d.ts} +76 -12
- package/dist/{idCaptureManager-IouAnrFm.esm.js → idCaptureManager-RrDMn2tS.esm.js} +68 -19
- package/dist/{idCaptureServices-VTKIPSpT.esm.js → idCaptureServices-BqDlOnzD.esm.js} +29 -198
- package/dist/{idCaptureStateMachine-_Pn2Xkpb.esm.js → idCaptureStateMachine-DFa1GOap.esm.js} +962 -554
- package/dist/idOcrCpfUtils-D5Gwskxu.esm.js +18 -0
- package/dist/{idOcrManager-DT3kPIB3.d.ts → idOcrManager-C0C7lFGd.d.ts} +7 -6
- package/dist/{idOcrManager-D3-HNMXP.esm.js → idOcrManager-im7VfJQi.esm.js} +5 -3
- package/dist/{idOcrStateMachine-DyENX6Ki.esm.js → idOcrStateMachine-B832arAl.esm.js} +11 -10
- package/dist/{idVerificationManager-BJapZfpy.d.ts → idVerificationManager-B6R8xNZq.d.ts} +4 -3
- package/dist/{idVerificationManager-iWz7Avkr.esm.js → idVerificationManager-PMGM4hXY.esm.js} +5 -3
- package/dist/{idVerificationStateMachine-CL1kUdBe.esm.js → idVerificationStateMachine-DeeugC00.esm.js} +3 -3
- package/dist/identity-reuse.d.ts +2 -2
- package/dist/identity-reuse.esm.js +2 -2
- package/dist/identity-search.d.ts +97 -0
- package/dist/identity-search.esm.js +97 -0
- package/dist/{identityReuseManager-ooAbp6Kc.d.ts → identityReuseManager-CZ-qJ_Aa.d.ts} +82 -15
- package/dist/{identityReuseManager-CD1ucp1d.esm.js → identityReuseManager-CjFZ7WRa.esm.js} +9 -4
- package/dist/{identityReuseStateMachine-DfV81wQC.esm.js → identityReuseStateMachine-CLFjPp13.esm.js} +22 -25
- package/dist/index-DHuAkTe0.d.ts +1 -0
- package/dist/{index-CKQ9QBZP.d.ts → index-DxYNO94y.d.ts} +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/{invokeOnCaptureCallback-DYrkOXO6.esm.js → invokeOnCaptureCallback-lXP41N7b.esm.js} +1 -1
- package/dist/kyb-checks.d.ts +3 -0
- package/dist/kyb-checks.esm.js +3 -0
- package/dist/kybChecksManager-B7Di9auB.d.ts +95 -0
- package/dist/kybChecksManager-CcEXyOlg.esm.js +90 -0
- package/dist/kybChecksStateMachine-DEKqDA2G.esm.js +720 -0
- package/dist/mandatory-consent.d.ts +2 -2
- package/dist/mandatory-consent.esm.js +2 -2
- package/dist/{mandatoryConsentManager-qYojnZYg.d.ts → mandatoryConsentManager-Bh1asNJh.d.ts} +28 -11
- package/dist/{mandatoryConsentManager-Cwqx1nK7.esm.js → mandatoryConsentManager-Dh3pBhOe.esm.js} +7 -4
- package/dist/{mandatoryConsentStateMachine-pXWqAHo_.esm.js → mandatoryConsentStateMachine-BjuI72HZ.esm.js} +32 -13
- package/dist/mediaRecorderOptions-g1TwTlhd.esm.js +87 -0
- package/dist/multipartRecordingService-WgK8ieRI.esm.js +407 -0
- package/dist/{permissionGuards-gcy3U0SL.esm.js → permissionGuards-pcrrqrPR.esm.js} +1 -1
- package/dist/{permissionServices-Ca-tSNhT.esm.js → permissionServices-DFJlH7K3.esm.js} +11 -9
- package/dist/phone-number.d.ts +7 -1
- package/dist/phone-number.esm.js +15 -2
- package/dist/phone.d.ts +1 -1
- package/dist/phone.esm.js +2 -2
- package/dist/phoneFormat-C3q0Ukh4.esm.js +27 -0
- package/dist/{phoneManager-BO-LTih5.d.ts → phoneManager-VO1HEoUZ.d.ts} +8 -3
- package/dist/{phoneManager-KKUq-Vgo.esm.js → phoneManager-rA7updqF.esm.js} +6 -4
- package/dist/phoneServices-CFXcwCFr.esm.js +77 -0
- package/dist/{phoneStateMachine-D2QWS2cu.esm.js → phoneStateMachine-DKdY2Scx.esm.js} +56 -84
- package/dist/{phoneValidation-DnBcNUNh.esm.js → phoneValidation-OggtfjRt.esm.js} +1 -2
- package/dist/{platform-DkcRc9JV.esm.js → platform-aPh7gTWh.esm.js} +15 -1
- package/dist/processFaceMatch-B_DkDTE5.esm.js +21 -0
- package/dist/qe-signature.d.ts +2 -2
- package/dist/qe-signature.esm.js +1 -1
- package/dist/recordingService-DxiwS8TV.esm.js +397 -0
- package/dist/redirect-to-mobile.d.ts +2 -2
- package/dist/redirect-to-mobile.esm.js +2 -2
- package/dist/{redirectToMobileManager-uHW3dyuQ.esm.js → redirectToMobileManager-DjsEtWLq.esm.js} +9 -6
- package/dist/{redirectToMobileManager-CVsvpVbQ.d.ts → redirectToMobileManager-pT6FiPE7.d.ts} +6 -4
- package/dist/{redirectToMobileStateMachine-b-H-ipGM.esm.js → redirectToMobileStateMachine-CMjjUXSu.esm.js} +67 -28
- package/dist/resolveForm-DaaQSVWp.esm.js +146 -0
- package/dist/{runChildModule-DSpP41Hl.esm.js → runChildModule-CJzb91Cf.esm.js} +9 -7
- package/dist/{sdkVersion-DKHwWEyH.esm.js → sdkVersion-k-QlBWlU.esm.js} +1 -1
- package/dist/selfie.d.ts +4 -4
- package/dist/selfie.esm.js +13 -12
- package/dist/{selfieErrorUtils-DoN1KFSQ.esm.js → selfieErrorUtils-F449y_PI.esm.js} +1 -1
- package/dist/{selfieManager-DtQegA6T.esm.js → selfieManager-Ba2YqjfY.esm.js} +7 -6
- package/dist/{selfieManager-BJdNu_nd.d.ts → selfieManager-aPdwxSFt.d.ts} +2 -2
- package/dist/{selfieStateMachine-CnCwJZuC.esm.js → selfieStateMachine-CTjb-Qr4.esm.js} +5 -5
- package/dist/{session-CNUfjlRc.esm.js → session-DPL5QWRx.esm.js} +77 -9
- package/dist/session.d.ts +96 -10
- package/dist/session.esm.js +7 -6
- package/dist/{sessionInitializer-JM_glXR2.esm.js → sessionInitializer-43LQITNU.esm.js} +359 -115
- package/dist/{setup-YPKTUCY5.d.ts → setup-DpOr8H_l.d.ts} +2 -2
- package/dist/{setup-C5tfWt6W.esm.js → setup-lcBOfaNE.esm.js} +36 -27
- package/dist/signature.d.ts +1 -1
- package/dist/signature.esm.js +2 -2
- package/dist/{signatureManager-f_dPAGXn.esm.js → signatureManager-BgAja97K.esm.js} +5 -3
- package/dist/{signatureManager-BpVt_Jv7.d.ts → signatureManager-daT_8fj_.d.ts} +3 -3
- package/dist/{signatureStateMachine-C-nUq_oq.esm.js → signatureStateMachine-CVPmvU2p.esm.js} +3 -3
- package/dist/{spawn-D9jgw9pW.d.ts → spawn-COZKetCS.d.ts} +1 -1
- package/dist/{stats-BEvexnKC.esm.js → stats-DoByUnTa.esm.js} +1 -1
- package/dist/stats.esm.js +1 -1
- package/dist/textRules-D4NRinKY.d.ts +41 -0
- package/dist/{trueSightService-fLmL_cyg.esm.js → trueSightService-Bs6xqUXD.esm.js} +22 -10
- package/dist/trust-graph.d.ts +4 -3
- package/dist/trust-graph.esm.js +5 -3
- package/dist/{types-yPH8lAH-.d.ts → types-9wlf1-GE.d.ts} +3 -3
- package/dist/types-B-PIc0en.d.ts +115 -0
- package/dist/types-B9C8W01q.d.ts +34 -0
- package/dist/{types-0L-eFDmr.d.ts → types-BgRHw-dR.d.ts} +1 -1
- package/dist/{types-CJ7Yl9K-.d.ts → types-Bpo97EOh.d.ts} +4 -2
- package/dist/{types-BQA7lRDV.d.ts → types-C3rfDzgE.d.ts} +4 -2
- package/dist/types-CE1jkHw3.d.ts +6 -0
- package/dist/types-CTaL0XJz.d.ts +80 -0
- package/dist/{types-DUnFZ08M.d.ts → types-CyNndVAT.d.ts} +16 -8
- package/dist/types-DEa3taWc.d.ts +217 -0
- package/dist/{types-CK8Jbjkp.d.ts → types-DFP7eSle.d.ts} +1 -1
- package/dist/{types-Ckir_BEs.d.ts → types-DJPU3W2M.d.ts} +3 -2
- package/dist/{types-DPIDuhut.d.ts → types-DNVzoRvi.d.ts} +2 -1
- package/dist/{events-Du2A4-Qr.esm.js → types-DYYMdAGv.esm.js} +4 -299
- package/dist/{types-B6HsSzpk.d.ts → types-Ddc4Tr_f.d.ts} +42 -6
- package/dist/{types-BAxn7MpY.d.ts → types-YA7ieDOx.d.ts} +125 -50
- package/dist/{urlUtils-6jsE6rKp.esm.js → urlUtils-eYiyWjh0.esm.js} +4 -1
- package/dist/usStates-CwOQ2kAx.esm.js +209 -0
- package/dist/video-selfie.d.ts +16 -14
- package/dist/video-selfie.esm.js +100 -24
- package/dist/{videoSelfieCameraWarmer-BBNKiau1.esm.js → videoSelfieCameraWarmer-a7GBfmEZ.esm.js} +27 -28
- package/dist/{videoSelfieFlowModuleMachine-BCFVHBQ1.esm.js → videoSelfieFlowModuleMachine-IWdxw1TW.esm.js} +1 -1
- package/dist/{videoSelfieStepDetector-CGsTltqB.d.ts → videoSelfieStepDetector-DRrh4P0A.d.ts} +10 -5
- package/dist/virtualCameraCheck-eFOm2C9q.esm.js +27 -0
- package/dist/{warmup-BO57syF6.d.ts → warmup-BNhIuURi.d.ts} +18 -2
- package/dist/{warmup-BElYWRh7.esm.js → warmup-BZOMg303.esm.js} +243 -30
- package/dist/wasm.d.ts +9 -3
- package/dist/wasm.esm.js +3 -3
- package/dist/{wasmDsFlagSync-CYj5LL9z.esm.js → wasmDsFlagSync-DPK7qGgo.esm.js} +1 -1
- package/dist/wasmMetadataVersionSync-U8EFUr1T.esm.js +27 -0
- package/dist/{wasmWebClient-BjZw_7OB.esm.js → wasmWebClient-CyLCM31e.esm.js} +45 -26
- package/dist/watchlist-for-business.d.ts +2 -1
- package/dist/watchlist-for-business.esm.js +2 -2
- package/dist/watchlist.d.ts +1 -1
- package/dist/watchlist.esm.js +2 -2
- package/dist/{watchlistForBusinessManager-CZZOFkGl.esm.js → watchlistForBusinessManager-BH6M4kqA.esm.js} +40 -8
- package/dist/{watchlistForBusinessManager-B3GDPZrr.d.ts → watchlistForBusinessManager-l7ZERQcV.d.ts} +57 -21
- package/dist/watchlistForBusinessStateMachine-BMWm5mcP.esm.js +166 -0
- package/dist/{watchlistManager-DXtX94SN.esm.js → watchlistManager-BDaVjzLW.esm.js} +5 -3
- package/dist/{watchlistManager-DJQOd8Pw.d.ts → watchlistManager-DQq4GxBO.d.ts} +3 -3
- package/dist/{watchlistStateMachine-McALifag.esm.js → watchlistStateMachine-Cx-6QAvu.esm.js} +3 -3
- package/dist/workflow.d.ts +234 -45
- package/dist/workflow.esm.js +194 -80
- package/dist/{xstate-actors.esm-8Gzepa_A.esm.js → xstate-actors.esm-BCcwgosu.esm.js} +1 -1
- package/dist/xstate.cjs-D6Ur0X1F.d.ts +7 -0
- package/dist/{xstate.esm-DSajW7CJ.esm.js → xstate.esm-CIqUf_i6.esm.js} +1 -125
- package/package.json +24 -7
- package/dist/Actor-DpTj5PFb.d.ts +0 -1
- package/dist/IBrowserEnvironmentCapability-DEaRRk-R.esm.js +0 -9
- package/dist/addressSearch-DPjIKJrX.esm.js +0 -563
- package/dist/cpf-uAZTPUBy.esm.js +0 -61
- package/dist/deepsightLoader-sH7920zw.esm.js +0 -55
- package/dist/ekycStateMachine-CDnI_NRq.esm.js +0 -1443
- package/dist/ekycUtils-zY8CdKJL.esm.js +0 -300
- package/dist/index-DpTj5PFb.d.ts +0 -1
- package/dist/types-BvLo3U4u.d.ts +0 -134
- package/dist/types-zOgZqMni.d.ts +0 -6
- package/dist/watchlistForBusinessStateMachine-B66E7jud.esm.js +0 -78
- /package/dist/{types-BSBzhHRH2.d.ts → types-BSBzhHRH.d.ts} +0 -0
package/dist/{idCaptureStateMachine-_Pn2Xkpb.esm.js → idCaptureStateMachine-DFa1GOap.esm.js}
RENAMED
|
@@ -1,33 +1,36 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
import { l as isGoogleWalletSignedRequestsEnabled, u as BrowserStorageProvider } from "./setup-
|
|
3
|
-
import { t as WasmUtilProvider } from "./WasmUtilProvider-
|
|
4
|
-
import { n as eventModuleNames,
|
|
5
|
-
import { r as getToken, t as api, u as endpoints } from "./api-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { n as getTimestamp, r as revokeObjectURL } from "./IBrowserEnvironmentCapability-D7JG7ML3.esm.js";
|
|
2
|
+
import { l as isGoogleWalletSignedRequestsEnabled, t as ensureWasmPipelines, u as BrowserStorageProvider } from "./setup-lcBOfaNE.esm.js";
|
|
3
|
+
import { t as WasmUtilProvider } from "./WasmUtilProvider-0xTxgP0R.esm.js";
|
|
4
|
+
import { n as eventModuleNames, v as addEvent } from "./types-DYYMdAGv.esm.js";
|
|
5
|
+
import { r as getToken, t as api, u as endpoints } from "./api-CZpuJuZl.esm.js";
|
|
6
|
+
import { n as recordExperimentAssignmentOnce, t as createManagerInstrumentation } from "./events-CP3yOzAl.esm.js";
|
|
7
|
+
import { l as trueSightHintTransition, r as noteTrueSightCaptureActivity, u as trueSightLog, y as isTrueSightTesting } from "./trueSightService-Bs6xqUXD.esm.js";
|
|
8
|
+
import { n as getDisableIpify } from "./sessionInitializer-43LQITNU.esm.js";
|
|
8
9
|
import { t as BrowserTimerProvider } from "./BrowserTimerProvider-BXhgNxLt.esm.js";
|
|
9
|
-
import { s as exposeExperimentOnce } from "./feature-management-
|
|
10
|
-
import { t as addDeviceStats } from "./stats-
|
|
11
|
-
import { a as isIOS, s as isIPad, t as isAndroid, u as isMacOsSafari } from "./platform-
|
|
12
|
-
import "./session-
|
|
13
|
-
import {
|
|
14
|
-
import { n as
|
|
15
|
-
import { n as
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
10
|
+
import { s as exposeExperimentOnce } from "./feature-management-BFfuXr1M.esm.js";
|
|
11
|
+
import { t as addDeviceStats } from "./stats-DoByUnTa.esm.js";
|
|
12
|
+
import { a as isIOS, c as isIPhone14OrHigher, f as isSamsungDevice, s as isIPad, t as isAndroid, u as isMacOsSafari } from "./platform-aPh7gTWh.esm.js";
|
|
13
|
+
import "./session-DPL5QWRx.esm.js";
|
|
14
|
+
import { t as createManager } from "./Manager-BvXAwDv9.esm.js";
|
|
15
|
+
import { c as not, i as assign, l as raise, n as enqueueActions, o as and, r as sendTo, s as createActor, t as setup } from "./xstate.esm-CIqUf_i6.esm.js";
|
|
16
|
+
import { n as fromPromise, t as fromCallback } from "./xstate-actors.esm-BCcwgosu.esm.js";
|
|
17
|
+
import { n as getUrlSearchParam, t as buildUrlWithSearchParams } from "./urlUtils-eYiyWjh0.esm.js";
|
|
18
|
+
import { s as isCameraDenialErrorName } from "./camera-E_Kcre4O.esm.js";
|
|
19
|
+
import { i as requestMotionPermission, n as invokeRequestPermissionActor, o as requiresMotionPermissionUserGesture, t as checkPermission, u as queryPermission } from "./permissionServices-DFJlH7K3.esm.js";
|
|
20
|
+
import { i as cameraCycleProvider, n as createCameraCycleOwnership, o as flagIdManualReview, r as runProtectedAttempt, s as PROTECTED_CAPTURE_TARGET, t as electDesktopCameraDevice } from "./desktopCameraElection-BKFjsQpO.esm.js";
|
|
19
21
|
import { t as IncodeCanvas } from "./canvas-BxFzWTt-.esm.js";
|
|
20
|
-
import { n as needsMotionPrimeOnlyFromPermission, r as resolveStoredPermissionResult, t as isReadyForCaptureFromPermission } from "./permissionGuards-
|
|
21
|
-
import {
|
|
22
|
+
import { n as needsMotionPrimeOnlyFromPermission, r as resolveStoredPermissionResult, t as isReadyForCaptureFromPermission } from "./permissionGuards-pcrrqrPR.esm.js";
|
|
23
|
+
import { t as carryAttempts } from "./attemptCarry-BecGGZK8.esm.js";
|
|
24
|
+
import { t as StreamCanvasProcessingSession } from "./StreamCanvasProcessingSession-CBnbTnOr.esm.js";
|
|
22
25
|
import { t as sleep } from "./ITimerCapability-DgdDzp8G.esm.js";
|
|
23
26
|
import { t as getBrowser } from "./getBrowser-Cbe1C4Tn.esm.js";
|
|
24
|
-
import {
|
|
27
|
+
import { t as isBackCameraLabel } from "./backCameraLabel-yda5ugE4.esm.js";
|
|
25
28
|
import { n as getWindowDimensions } from "./getDeviceClass-CeBiEayS.esm.js";
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import { n as
|
|
29
|
-
import {
|
|
30
|
-
import { t as
|
|
29
|
+
import { t as getDeviceClass } from "./getDeviceClass-DoIWuKI8.esm.js";
|
|
30
|
+
import { n as DEFAULT_ID_CAPTURE_THRESHOLDS, r as IdCaptureProvider } from "./idCaptureDefaults-Drh207VJ.esm.js";
|
|
31
|
+
import { C as OPTIMIZING_WATCHDOG_MARGIN_MS, S as CAPTURE_OPTIMIZING, _ as validateUploadResponse, a as finalizeRecordingSession, b as resolveCountdownStepMs, c as isSuspendableRecordingSession, d as processId, f as resumeRecordingAfterPause, g as uploadIdImage, h as stopStream, i as disposeRecordingSession, l as pauseRecordingForAttempt, m as stopRecording, n as addBarcode, o as getRealQualityValue, p as startRecordingSession, s as initializeIdCapture, u as prepareRecordingForCameraRetry, v as ID_ERROR_CODES, w as getIdCameraStream, x as resolveIdCaptureThresholds } from "./idCaptureServices-BqDlOnzD.esm.js";
|
|
32
|
+
import { t as StreamCanvasCapture } from "./StreamCanvasCapture-CXd87trH.esm.js";
|
|
33
|
+
import { n as runVirtualCameraCheck, t as frameSources } from "./virtualCameraCheck-eFOm2C9q.esm.js";
|
|
31
34
|
//#region src/modules/id/digitalUpload/digitalUploadErrors.ts
|
|
32
35
|
const TERMINAL_FAIL_REASONS = /* @__PURE__ */ new Set(["DIGITAL_ID_REQUESTED_BUT_OTHER_PROVIDED", "ID_TYPE_UNACCEPTABLE"]);
|
|
33
36
|
function isKnownFailReason(reason) {
|
|
@@ -550,7 +553,36 @@ const deviceWalletMachine = setup({
|
|
|
550
553
|
function resolveWalletPlatform(provider) {
|
|
551
554
|
if (provider === "apple_web") return "ios";
|
|
552
555
|
if (provider === "google") return "android";
|
|
553
|
-
return
|
|
556
|
+
return isApplePlatform() ? "ios" : "android";
|
|
557
|
+
}
|
|
558
|
+
/** iOS / iPadOS / macOS Safari — the only platforms Apple Wallet web runs on. */
|
|
559
|
+
function isApplePlatform() {
|
|
560
|
+
return isIOS() || isMacOsSafari() || isIPad();
|
|
561
|
+
}
|
|
562
|
+
/**
|
|
563
|
+
* The wallet family this device *certainly* reaches, for naming it in the UI:
|
|
564
|
+
* `apple` on the Apple platform, `samsung` on a detectable Samsung Android
|
|
565
|
+
* device, `android` on any other Android device. `undefined` when the OS gives
|
|
566
|
+
* no certain answer (desktop Chrome, Windows, Linux). Unlike
|
|
567
|
+
* `resolveWalletPlatform`, which must pick a handshake and so maps every
|
|
568
|
+
* non-Apple browser to Google, this does not guess.
|
|
569
|
+
*/
|
|
570
|
+
function resolveWalletDevice() {
|
|
571
|
+
if (isApplePlatform()) return "apple";
|
|
572
|
+
if (isAndroid()) return isSamsungDevice() ? "samsung" : "android";
|
|
573
|
+
}
|
|
574
|
+
/**
|
|
575
|
+
* The device facts the digital-ID funnel filters wallets on: Credentials API
|
|
576
|
+
* availability, the OS wallet the device reaches (the same answer the
|
|
577
|
+
* handshake later launches with) and whether it is a Samsung device.
|
|
578
|
+
* No injected capability reads as "no Credentials API".
|
|
579
|
+
*/
|
|
580
|
+
function getDigitalIdPlatformSupport(credentials) {
|
|
581
|
+
return {
|
|
582
|
+
credentialsAvailable: credentials?.isAvailable() ?? false,
|
|
583
|
+
walletPlatform: resolveWalletPlatform(),
|
|
584
|
+
samsungDevice: isSamsungDevice()
|
|
585
|
+
};
|
|
554
586
|
}
|
|
555
587
|
//#endregion
|
|
556
588
|
//#region src/modules/id/deviceWallet/instrumentation.ts
|
|
@@ -769,6 +801,580 @@ function renderWallet({ onSuccess, onError, ...actorOptions }) {
|
|
|
769
801
|
});
|
|
770
802
|
}
|
|
771
803
|
//#endregion
|
|
804
|
+
//#region src/modules/id/digitalIdCountry.ts
|
|
805
|
+
/** Longest the chooser waits for country signals before rendering. */
|
|
806
|
+
const DIGITAL_ID_COUNTRY_DETECTION_TIMEOUT_MS = 1e3;
|
|
807
|
+
/** Upper-cased ISO 3166-1 alpha-2, or `undefined` for anything else. */
|
|
808
|
+
function normalizeCountryCode(value) {
|
|
809
|
+
if (typeof value !== "string") return;
|
|
810
|
+
const code = value.trim().toUpperCase();
|
|
811
|
+
return /^[A-Z]{2}$/.test(code) ? code : void 0;
|
|
812
|
+
}
|
|
813
|
+
/**
|
|
814
|
+
* The region subtags of BCP 47 language tags, in order, deduped. Tags without
|
|
815
|
+
* an explicit alpha-2 region (`sv`, `es-419`) or that do not parse contribute
|
|
816
|
+
* nothing — a bare language is not a country.
|
|
817
|
+
*/
|
|
818
|
+
function getLocaleRegions(tags) {
|
|
819
|
+
const regions = [];
|
|
820
|
+
for (const tag of tags) {
|
|
821
|
+
let region;
|
|
822
|
+
try {
|
|
823
|
+
region = new Intl.Locale(tag).region;
|
|
824
|
+
} catch {
|
|
825
|
+
region = void 0;
|
|
826
|
+
}
|
|
827
|
+
const code = normalizeCountryCode(region);
|
|
828
|
+
if (code && !regions.includes(code)) regions.push(code);
|
|
829
|
+
}
|
|
830
|
+
return regions;
|
|
831
|
+
}
|
|
832
|
+
/** Whether any signal is wired at all (otherwise detection is a no-op). */
|
|
833
|
+
function hasCountrySignals(dependencies) {
|
|
834
|
+
if (!dependencies) return false;
|
|
835
|
+
return dependencies.ipCountry !== void 0 || dependencies.locale !== void 0 || dependencies.geolocation !== void 0 && dependencies.reverseGeocodeCountry !== void 0;
|
|
836
|
+
}
|
|
837
|
+
async function detectGpsCountry(dependencies, signal) {
|
|
838
|
+
const { geolocation, reverseGeocodeCountry } = dependencies;
|
|
839
|
+
if (!geolocation || !reverseGeocodeCountry) return;
|
|
840
|
+
if (await queryPermission("geolocation") !== "granted") return;
|
|
841
|
+
return reverseGeocodeCountry(await geolocation.getCurrentPosition(), signal);
|
|
842
|
+
}
|
|
843
|
+
/**
|
|
844
|
+
* Region subtags of the browser languages. A locale capability that throws
|
|
845
|
+
* (e.g. a custom one) is dropped like any other failing signal, so detection
|
|
846
|
+
* still never rejects.
|
|
847
|
+
*/
|
|
848
|
+
function readLocaleRegions(locale) {
|
|
849
|
+
if (!locale) return [];
|
|
850
|
+
try {
|
|
851
|
+
return getLocaleRegions(locale.getPreferredLanguages());
|
|
852
|
+
} catch {
|
|
853
|
+
return [];
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
/**
|
|
857
|
+
* Collects the country signals and returns their countries, strongest first,
|
|
858
|
+
* deduped (see the module doc for the order). Never rejects: a failing or
|
|
859
|
+
* late signal is dropped.
|
|
860
|
+
*/
|
|
861
|
+
async function detectDigitalIdCountries(dependencies, options = {}) {
|
|
862
|
+
const { timeoutMs = DIGITAL_ID_COUNTRY_DETECTION_TIMEOUT_MS, signal } = options;
|
|
863
|
+
const timer = BrowserTimerProvider.getInstance();
|
|
864
|
+
let deadlineHandle;
|
|
865
|
+
const deadline = new Promise((resolve) => {
|
|
866
|
+
deadlineHandle = timer.setTimeout(() => resolve(void 0), timeoutMs);
|
|
867
|
+
});
|
|
868
|
+
const settle = (run) => Promise.race([Promise.resolve().then(run).catch(() => void 0), deadline]);
|
|
869
|
+
try {
|
|
870
|
+
const [gpsCountry, ipCountry] = await Promise.all([settle(() => detectGpsCountry(dependencies, signal)), settle(() => dependencies.ipCountry ? dependencies.ipCountry(signal) : Promise.resolve(void 0))]);
|
|
871
|
+
const localeRegions = readLocaleRegions(dependencies.locale);
|
|
872
|
+
const countries = [];
|
|
873
|
+
for (const candidate of [
|
|
874
|
+
gpsCountry,
|
|
875
|
+
ipCountry,
|
|
876
|
+
...localeRegions
|
|
877
|
+
]) {
|
|
878
|
+
const code = normalizeCountryCode(candidate);
|
|
879
|
+
if (code && !countries.includes(code)) countries.push(code);
|
|
880
|
+
}
|
|
881
|
+
return countries;
|
|
882
|
+
} finally {
|
|
883
|
+
if (deadlineHandle !== void 0) timer.clearTimeout(deadlineHandle);
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
//#endregion
|
|
887
|
+
//#region src/modules/id/digitalIdRegistry.ts
|
|
888
|
+
/**
|
|
889
|
+
* True when a digital-ID method uses a full-page web-redirect flow (Trinsic
|
|
890
|
+
* iDIN, FTN, itsme, …). Accepts both the module `FlowType` value (`REDIRECT`) and the
|
|
891
|
+
* backend value (`WEB_REDIRECT`). (Lives here rather than in
|
|
892
|
+
* `idCaptureHelpers` to keep the registry free of circular imports; the
|
|
893
|
+
* helpers re-export it.)
|
|
894
|
+
*/
|
|
895
|
+
function isRedirectFlowType(flowType) {
|
|
896
|
+
return flowType === "REDIRECT" || flowType === "WEB_REDIRECT";
|
|
897
|
+
}
|
|
898
|
+
const DIGITAL_ID_REGISTRY = {
|
|
899
|
+
mDL: [{
|
|
900
|
+
kind: "incodeWallet",
|
|
901
|
+
documentType: "digitalId"
|
|
902
|
+
}, {
|
|
903
|
+
kind: "trinsicRedirect",
|
|
904
|
+
documentType: "digitalIdRedirect",
|
|
905
|
+
providerId: "trinsic_mdl_placeholder",
|
|
906
|
+
method: "MDL"
|
|
907
|
+
}],
|
|
908
|
+
iDIN: [{
|
|
909
|
+
kind: "trinsicRedirect",
|
|
910
|
+
documentType: "digitalIdRedirect",
|
|
911
|
+
providerId: "trinsic_netherlands_idin",
|
|
912
|
+
method: "IDIN",
|
|
913
|
+
countries: ["NL"]
|
|
914
|
+
}],
|
|
915
|
+
FTN: [{
|
|
916
|
+
kind: "trinsicRedirect",
|
|
917
|
+
documentType: "digitalIdRedirect",
|
|
918
|
+
providerId: "trinsic_finnish_trust_network",
|
|
919
|
+
method: "FTN",
|
|
920
|
+
countries: ["FI"]
|
|
921
|
+
}],
|
|
922
|
+
itsme: [{
|
|
923
|
+
kind: "trinsicRedirect",
|
|
924
|
+
documentType: "digitalIdRedirect",
|
|
925
|
+
providerId: "trinsic_belgium_itsme",
|
|
926
|
+
method: "ITSME",
|
|
927
|
+
countries: ["BE"]
|
|
928
|
+
}],
|
|
929
|
+
SPID: [{
|
|
930
|
+
kind: "trinsicRedirect",
|
|
931
|
+
documentType: "digitalIdRedirect",
|
|
932
|
+
providerId: "trinsic_italy_spid",
|
|
933
|
+
method: "SPID",
|
|
934
|
+
countries: ["IT"]
|
|
935
|
+
}],
|
|
936
|
+
MitID: [{
|
|
937
|
+
kind: "trinsicRedirect",
|
|
938
|
+
documentType: "digitalIdRedirect",
|
|
939
|
+
providerId: "trinsic_denmark_mitid",
|
|
940
|
+
method: "MITID",
|
|
941
|
+
countries: ["DK"]
|
|
942
|
+
}],
|
|
943
|
+
BankIDSweden: [{
|
|
944
|
+
kind: "trinsicRedirect",
|
|
945
|
+
documentType: "digitalIdRedirect",
|
|
946
|
+
providerId: "trinsic_sweden_bankid",
|
|
947
|
+
method: "BANKID_SWEDEN",
|
|
948
|
+
countries: ["SE"]
|
|
949
|
+
}],
|
|
950
|
+
FranceIdentite: [{
|
|
951
|
+
kind: "trinsicRedirect",
|
|
952
|
+
documentType: "digitalIdRedirect",
|
|
953
|
+
providerId: "trinsic_france_identite",
|
|
954
|
+
method: "FRANCE_IDENTITE",
|
|
955
|
+
countries: ["FR"]
|
|
956
|
+
}],
|
|
957
|
+
IdentiteNumerique: [{
|
|
958
|
+
kind: "trinsicRedirect",
|
|
959
|
+
documentType: "digitalIdRedirect",
|
|
960
|
+
providerId: "trinsic_france_identite_numerique",
|
|
961
|
+
method: "IDENTITE_NUMERIQUE",
|
|
962
|
+
countries: ["FR"]
|
|
963
|
+
}],
|
|
964
|
+
LAWallet: [{
|
|
965
|
+
kind: "trinsicRedirect",
|
|
966
|
+
documentType: "digitalIdRedirect",
|
|
967
|
+
providerId: "trinsic_usa_louisiana_wallet",
|
|
968
|
+
method: "LA_WALLET",
|
|
969
|
+
countries: ["US"]
|
|
970
|
+
}],
|
|
971
|
+
DigiLocker: [{
|
|
972
|
+
kind: "trinsicRedirect",
|
|
973
|
+
documentType: "digitalIdRedirect",
|
|
974
|
+
providerId: "trinsic_india_digilocker_aadhaar",
|
|
975
|
+
method: "DIGILOCKER",
|
|
976
|
+
countries: ["IN"]
|
|
977
|
+
}]
|
|
978
|
+
};
|
|
979
|
+
const DIGITAL_ID_DOCUMENT_TYPES = Object.keys(DIGITAL_ID_REGISTRY);
|
|
980
|
+
/**
|
|
981
|
+
* Single place that widens `config.digitalIds` to the shapes the backend
|
|
982
|
+
* actually sends — the mapped array or the raw `{ enabled, methods }` object.
|
|
983
|
+
* Shared so the cast is written once.
|
|
984
|
+
*/
|
|
985
|
+
function asDigitalIdsConfig(config) {
|
|
986
|
+
return config.digitalIds;
|
|
987
|
+
}
|
|
988
|
+
/**
|
|
989
|
+
* TODO(test-only): the identity network's test-environment mock providers, one per
|
|
990
|
+
* integration type, for E2E testing — remove before production. Persisted method →
|
|
991
|
+
* provider id only: they are standalone redirect cards, never part of a wallet
|
|
992
|
+
* funnel, so they need no `DigitalIdDocumentType` / `DIGITAL_ID_REGISTRY` entry and
|
|
993
|
+
* stay off the public API. Like every redirect method they render a card only
|
|
994
|
+
* when a flow enables the method in `digitalIds.methods`.
|
|
995
|
+
*/
|
|
996
|
+
const TEST_MOCK_REDIRECT_PROVIDER_BY_METHOD = {
|
|
997
|
+
TRINSIC_TEST_REDIRECT: "trinsic_trinsic_test_redirect",
|
|
998
|
+
TRINSIC_TEST_DELAYED_RESULTS: "trinsic_trinsic_test_delayed_results",
|
|
999
|
+
TRINSIC_TEST_SUB_PROVIDERS: "trinsic_trinsic_test_sub_providers",
|
|
1000
|
+
TRINSIC_TEST_DEEPLINK: "trinsic_trinsic_test_deeplink",
|
|
1001
|
+
TRINSIC_TEST_DEEPLINK_REFRESH: "trinsic_trinsic_test_deeplink_refresh",
|
|
1002
|
+
TRINSIC_TEST_SHOW_CONTENT: "trinsic_trinsic_test_show_content",
|
|
1003
|
+
TRINSIC_TEST_SHOW_CONTENT_REFRESH: "trinsic_trinsic_test_show_content_refresh",
|
|
1004
|
+
TRINSIC_TEST_HANDOFF: "trinsic_trinsic_test_handoff",
|
|
1005
|
+
TRINSIC_TEST_OFFLINE: "trinsic_trinsic_test_offline",
|
|
1006
|
+
TRINSIC_MOCK_OUTPUT: "trinsic_trinsic_mock_output"
|
|
1007
|
+
};
|
|
1008
|
+
/**
|
|
1009
|
+
* Persisted method name → catalog provider id, derived from the registry's
|
|
1010
|
+
* Trinsic entries (single source of truth). Lets the SDK launch iDIN / FTN
|
|
1011
|
+
* from a backend that does not yet send `providerId` on each method.
|
|
1012
|
+
* TODO(roadmap: fully-catalog-driven): remove once every backend enriches
|
|
1013
|
+
* `digitalIds.methods[]` with `providerId` + `flowType`.
|
|
1014
|
+
*/
|
|
1015
|
+
const REDIRECT_PROVIDER_BY_METHOD = (() => {
|
|
1016
|
+
const map = { ...TEST_MOCK_REDIRECT_PROVIDER_BY_METHOD };
|
|
1017
|
+
for (const docType of DIGITAL_ID_DOCUMENT_TYPES) for (const entry of DIGITAL_ID_REGISTRY[docType]) if (entry.kind === "trinsicRedirect") map[entry.method] = entry.providerId;
|
|
1018
|
+
return map;
|
|
1019
|
+
})();
|
|
1020
|
+
/**
|
|
1021
|
+
* Catalog provider id → the countries it serves, from the registry. Lets the
|
|
1022
|
+
* chooser rank redirect providers by country even when the backend does not enrich
|
|
1023
|
+
* `digitalIds.methods[]` with `countries`.
|
|
1024
|
+
*/
|
|
1025
|
+
const REDIRECT_PROVIDER_COUNTRIES = Object.fromEntries(DIGITAL_ID_DOCUMENT_TYPES.flatMap((docType) => DIGITAL_ID_REGISTRY[docType].flatMap((entry) => entry.kind === "trinsicRedirect" && entry.countries ? [[entry.providerId, entry.countries]] : [])));
|
|
1026
|
+
/**
|
|
1027
|
+
* Redirect providers that are the fallback leg of a wallet-first funnel
|
|
1028
|
+
* (mDL): they are reached through the `digitalId` tile's funnel resolution,
|
|
1029
|
+
* not offered as a standalone chooser card.
|
|
1030
|
+
*/
|
|
1031
|
+
const WALLET_FUNNEL_REDIRECT_PROVIDER_IDS = new Set(DIGITAL_ID_DOCUMENT_TYPES.flatMap((docType) => {
|
|
1032
|
+
const entries = DIGITAL_ID_REGISTRY[docType];
|
|
1033
|
+
if (!entries.some((entry) => entry.kind === "incodeWallet")) return [];
|
|
1034
|
+
return entries.flatMap((entry) => entry.kind === "trinsicRedirect" ? [entry.providerId] : []);
|
|
1035
|
+
}));
|
|
1036
|
+
/**
|
|
1037
|
+
* True for a redirect provider that gets its own chooser card (iDIN, FTN, any
|
|
1038
|
+
* catalog-enriched redirect method) — as opposed to the mDL wallet fallback,
|
|
1039
|
+
* which only surfaces through the Digital ID tile.
|
|
1040
|
+
*/
|
|
1041
|
+
function isStandaloneRedirectProvider(providerId) {
|
|
1042
|
+
return !WALLET_FUNNEL_REDIRECT_PROVIDER_IDS.has(providerId);
|
|
1043
|
+
}
|
|
1044
|
+
/**
|
|
1045
|
+
* The provider id a configured method launches with, when it is a
|
|
1046
|
+
* web-redirect method; `undefined` for wallets / other flow shapes.
|
|
1047
|
+
*
|
|
1048
|
+
* Resolution order:
|
|
1049
|
+
* 1. an explicit redirect `flowType` with a `provider` (mapped shape) or
|
|
1050
|
+
* `providerId` (catalog-enriched raw shape) — backend-authoritative;
|
|
1051
|
+
* 2. otherwise the persisted method name via the registry (legacy raw shape).
|
|
1052
|
+
*/
|
|
1053
|
+
function resolveRedirectProviderId(method) {
|
|
1054
|
+
if (method.flowType) {
|
|
1055
|
+
if (!isRedirectFlowType(method.flowType)) return;
|
|
1056
|
+
const explicit = method.provider ?? method.providerId;
|
|
1057
|
+
if (explicit) return explicit;
|
|
1058
|
+
}
|
|
1059
|
+
return method.method ? REDIRECT_PROVIDER_BY_METHOD[method.method.toUpperCase()] : void 0;
|
|
1060
|
+
}
|
|
1061
|
+
/**
|
|
1062
|
+
* Tolerant view over `config.digitalIds`: accepts both the mapped array
|
|
1063
|
+
* (`IdCaptureDigitalIdMethod[]`) and the raw backend object
|
|
1064
|
+
* (`{ enabled, methods: [...] }`). Extracted from the old
|
|
1065
|
+
* `getDigitalIdRedirectMethod` cast so every consumer parses it the same way.
|
|
1066
|
+
*
|
|
1067
|
+
* Honors both dashboard toggles: a raw object with `enabled: false` yields no
|
|
1068
|
+
* methods, and individual methods with `enabled: false` are dropped (absent
|
|
1069
|
+
* `enabled` counts as on). This is what "enabled for the flow / workflow"
|
|
1070
|
+
* means — for the redirect chooser cards as much as for the wallet tile.
|
|
1071
|
+
*/
|
|
1072
|
+
function normalizeDigitalIdMethods(config) {
|
|
1073
|
+
const raw = asDigitalIdsConfig(config);
|
|
1074
|
+
if (!Array.isArray(raw) && raw?.enabled === false) return [];
|
|
1075
|
+
return (Array.isArray(raw) ? raw : raw?.methods ?? []).filter((method) => method.enabled !== false);
|
|
1076
|
+
}
|
|
1077
|
+
/**
|
|
1078
|
+
* Persisted method names of the Incode-native device wallets — the backend
|
|
1079
|
+
* `DigitalIdMethodCatalog` entries of type `MDL`. A catalog-enriched method
|
|
1080
|
+
* carries `type: 'MDL'` instead of relying on the name; both are honoured.
|
|
1081
|
+
*
|
|
1082
|
+
* `SAMSUNG_WALLET` is listed by name because the onboarding catalog does not
|
|
1083
|
+
* enrich it yet: it arrives as a bare `{ method: 'SAMSUNG_WALLET' }`. Without
|
|
1084
|
+
* the name it would fall through to the unfiltered `deviceWallet` flag and
|
|
1085
|
+
* skip `WALLET_PLATFORM_RULES`' Samsung-only rule.
|
|
1086
|
+
*/
|
|
1087
|
+
const DEVICE_WALLET_METHODS = /* @__PURE__ */ new Set([
|
|
1088
|
+
"APPLE_WALLET",
|
|
1089
|
+
"GOOGLE_WALLET",
|
|
1090
|
+
"CA_DMV_WALLET",
|
|
1091
|
+
"SAMSUNG_WALLET"
|
|
1092
|
+
]);
|
|
1093
|
+
/**
|
|
1094
|
+
* True for a configured method the native device-wallet handshake can fulfil.
|
|
1095
|
+
* Redirect methods (iDIN, FTN) never count, whatever their name or type — they
|
|
1096
|
+
* must not surface a wallet tile with no wallet behind it.
|
|
1097
|
+
*
|
|
1098
|
+
* Classifies by *kind* only. Whether a method is switched on is already
|
|
1099
|
+
* settled by `normalizeDigitalIdMethods`, which drops disabled methods before
|
|
1100
|
+
* any caller walks the list.
|
|
1101
|
+
*/
|
|
1102
|
+
function isDeviceWalletMethod(method) {
|
|
1103
|
+
if (method.flowType && isRedirectFlowType(method.flowType)) return false;
|
|
1104
|
+
if (method.type?.toUpperCase() === "MDL") return true;
|
|
1105
|
+
return method.method !== void 0 && DEVICE_WALLET_METHODS.has(method.method.toUpperCase());
|
|
1106
|
+
}
|
|
1107
|
+
/**
|
|
1108
|
+
* Device-level hard filter per wallet method: a wallet the device cannot reach
|
|
1109
|
+
* is never offered. Apple Wallet needs the Apple platform, Google Wallet any
|
|
1110
|
+
* other, and Samsung Wallet a Samsung device. Methods without a rule (CA DMV
|
|
1111
|
+
* Wallet, an unknown catalog `MDL` method) run on either platform.
|
|
1112
|
+
*
|
|
1113
|
+
* A rule only rejects on a known platform fact, so a caller that omits
|
|
1114
|
+
* `walletPlatform` / `samsungDevice` gets no filtering.
|
|
1115
|
+
*/
|
|
1116
|
+
const WALLET_PLATFORM_RULES = {
|
|
1117
|
+
APPLE_WALLET: (platform) => platform.walletPlatform !== "android",
|
|
1118
|
+
GOOGLE_WALLET: (platform) => platform.walletPlatform !== "ios",
|
|
1119
|
+
SAMSUNG_WALLET: (platform) => platform.walletPlatform !== "ios" && platform.samsungDevice !== false
|
|
1120
|
+
};
|
|
1121
|
+
function isDeviceWalletMethodEligible(method, platform) {
|
|
1122
|
+
const rule = method.method !== void 0 ? WALLET_PLATFORM_RULES[method.method.toUpperCase()] : void 0;
|
|
1123
|
+
return rule ? rule(platform) : true;
|
|
1124
|
+
}
|
|
1125
|
+
/**
|
|
1126
|
+
* Whether a device wallet can run for this config on this device: an enabled
|
|
1127
|
+
* wallet method that passes `WALLET_PLATFORM_RULES`, or, when the config lists
|
|
1128
|
+
* no wallet method at all, the legacy `deviceWallet` flag (which names no
|
|
1129
|
+
* wallet, so there is nothing to filter).
|
|
1130
|
+
*
|
|
1131
|
+
* The method list is the authority. The dashboard persists a wallet only in
|
|
1132
|
+
* `digitalIds.methods` and leaves the legacy `deviceWallet` / `appleWallet`
|
|
1133
|
+
* booleans at their stored `false`; the workflow-node response historically
|
|
1134
|
+
* shipped them raw, so reading the list is what keeps the tile visible there
|
|
1135
|
+
* (and matches SDK 1). It also means a config whose only wallet is Apple
|
|
1136
|
+
* Wallet yields `false` on Android even when `deviceWallet` is `true`. Unlike
|
|
1137
|
+
* the backend's `deriveDeviceWalletFlag`, an unrecognised method does not
|
|
1138
|
+
* count as a wallet: it must not launch a handshake that cannot know what to
|
|
1139
|
+
* request.
|
|
1140
|
+
*/
|
|
1141
|
+
function hasEligibleDeviceWallet(config, platform) {
|
|
1142
|
+
const walletMethods = normalizeDigitalIdMethods(config).filter(isDeviceWalletMethod);
|
|
1143
|
+
if (walletMethods.length > 0) return walletMethods.some((method) => isDeviceWalletMethodEligible(method, platform));
|
|
1144
|
+
return config.deviceWallet === true;
|
|
1145
|
+
}
|
|
1146
|
+
/** Whether a funnel entry is activated by config + platform capabilities. */
|
|
1147
|
+
function isEntryActive(entry, config, platform) {
|
|
1148
|
+
if (entry.kind === "incodeWallet") return platform.credentialsAvailable && hasEligibleDeviceWallet(config, platform);
|
|
1149
|
+
return findConfiguredMethod(entry, config) !== void 0;
|
|
1150
|
+
}
|
|
1151
|
+
/**
|
|
1152
|
+
* The configured `digitalIds` method matching a Trinsic funnel entry — by
|
|
1153
|
+
* persisted method name, or (mapped shape) by provider id on a redirect
|
|
1154
|
+
* flowType. First match wins; disabled methods are already dropped by
|
|
1155
|
+
* `normalizeDigitalIdMethods`.
|
|
1156
|
+
*/
|
|
1157
|
+
function findConfiguredMethod(entry, config) {
|
|
1158
|
+
return normalizeDigitalIdMethods(config).find((method) => method.method?.toUpperCase() === entry.method || method.provider === entry.providerId && !!method.flowType && isRedirectFlowType(method.flowType));
|
|
1159
|
+
}
|
|
1160
|
+
/** Normalizes a raw configured method into the mapped shape for the child input. */
|
|
1161
|
+
function toMappedMethod(entry, method) {
|
|
1162
|
+
if (method.flowType && isRedirectFlowType(method.flowType)) return method;
|
|
1163
|
+
return {
|
|
1164
|
+
method: method.method,
|
|
1165
|
+
provider: entry.providerId,
|
|
1166
|
+
flowType: "WEB_REDIRECT",
|
|
1167
|
+
country: method.country ?? method.countries?.[0],
|
|
1168
|
+
displayName: method.displayName,
|
|
1169
|
+
logoUrl: method.logoUrl
|
|
1170
|
+
};
|
|
1171
|
+
}
|
|
1172
|
+
/**
|
|
1173
|
+
* Resolves the implementation that should fulfil a digital-ID document type:
|
|
1174
|
+
* the first funnel entry that is active under the given config and platform.
|
|
1175
|
+
* `undefined` when nothing can run it (the chooser then shows no tile for it).
|
|
1176
|
+
*/
|
|
1177
|
+
function resolveDigitalIdImplementation(docType, config, platform) {
|
|
1178
|
+
for (const entry of DIGITAL_ID_REGISTRY[docType]) {
|
|
1179
|
+
if (!isEntryActive(entry, config, platform)) continue;
|
|
1180
|
+
if (entry.kind === "incodeWallet") return { kind: "incodeWallet" };
|
|
1181
|
+
const method = findConfiguredMethod(entry, config);
|
|
1182
|
+
return {
|
|
1183
|
+
kind: "trinsicRedirect",
|
|
1184
|
+
providerId: entry.providerId,
|
|
1185
|
+
method: method ? toMappedMethod(entry, method) : void 0
|
|
1186
|
+
};
|
|
1187
|
+
}
|
|
1188
|
+
}
|
|
1189
|
+
//#endregion
|
|
1190
|
+
//#region src/modules/id/idCaptureHelpers.ts
|
|
1191
|
+
/**
|
|
1192
|
+
* Normalizes a configured method into the mapped redirect shape for a
|
|
1193
|
+
* resolved provider. The already-mapped shape is returned as-is; the raw
|
|
1194
|
+
* backend shape gets `provider` + `WEB_REDIRECT` filled in.
|
|
1195
|
+
*/
|
|
1196
|
+
function toRedirectMethod(method, provider) {
|
|
1197
|
+
if (method.provider && method.flowType) return method;
|
|
1198
|
+
return {
|
|
1199
|
+
method: method.method,
|
|
1200
|
+
provider,
|
|
1201
|
+
flowType: "WEB_REDIRECT",
|
|
1202
|
+
country: method.country ?? method.countries?.[0],
|
|
1203
|
+
displayName: method.displayName,
|
|
1204
|
+
logoUrl: method.logoUrl
|
|
1205
|
+
};
|
|
1206
|
+
}
|
|
1207
|
+
/**
|
|
1208
|
+
* The enabled web-redirect digital-ID method to launch — the one matching
|
|
1209
|
+
* `providerId` when given (a chooser card was picked), else the first
|
|
1210
|
+
* configured redirect method — or `undefined` when none is configured.
|
|
1211
|
+
* Drives the provider and country passed to the `digitalIdRedirectMachine`.
|
|
1212
|
+
*
|
|
1213
|
+
* Accepts both the mapped array (`IdCaptureDigitalIdMethod[]`) and the raw
|
|
1214
|
+
* backend `configuration.digitalIds` object (`{ enabled, methods: [...] }`);
|
|
1215
|
+
* for the raw shape the provider comes from the backend-enriched
|
|
1216
|
+
* `providerId`/`flowType` when present, else from the persisted method name
|
|
1217
|
+
* via the digital-ID registry (`IDIN` → `trinsic_netherlands_idin`).
|
|
1218
|
+
*/
|
|
1219
|
+
function getDigitalIdRedirectMethod(config, providerId) {
|
|
1220
|
+
for (const method of normalizeDigitalIdMethods(config)) {
|
|
1221
|
+
const provider = resolveRedirectProviderId(method);
|
|
1222
|
+
if (!provider || providerId !== void 0 && provider !== providerId) continue;
|
|
1223
|
+
return toRedirectMethod(method, provider);
|
|
1224
|
+
}
|
|
1225
|
+
}
|
|
1226
|
+
function collectDigitalIdRedirectOptions(config) {
|
|
1227
|
+
const entries = [];
|
|
1228
|
+
for (const method of normalizeDigitalIdMethods(config)) {
|
|
1229
|
+
const providerId = resolveRedirectProviderId(method);
|
|
1230
|
+
if (!providerId || !isStandaloneRedirectProvider(providerId) || entries.some((entry) => entry.option.providerId === providerId)) continue;
|
|
1231
|
+
const countries = (method.countries ?? (method.country ? [method.country] : void 0) ?? REDIRECT_PROVIDER_COUNTRIES[providerId] ?? []).flatMap((country) => normalizeCountryCode(country) ?? []);
|
|
1232
|
+
entries.push({
|
|
1233
|
+
option: {
|
|
1234
|
+
providerId,
|
|
1235
|
+
method: method.method,
|
|
1236
|
+
displayName: method.displayName,
|
|
1237
|
+
logoUrl: method.logoUrl,
|
|
1238
|
+
country: method.country ?? method.countries?.[0] ?? countries[0]
|
|
1239
|
+
},
|
|
1240
|
+
countries
|
|
1241
|
+
});
|
|
1242
|
+
}
|
|
1243
|
+
return entries;
|
|
1244
|
+
}
|
|
1245
|
+
/**
|
|
1246
|
+
* Rank of an option against the detected countries: the index of the
|
|
1247
|
+
* strongest detected country it serves, `Infinity` when it serves none.
|
|
1248
|
+
*/
|
|
1249
|
+
function countryRank(countries, preferredCountries) {
|
|
1250
|
+
const ranks = countries.map((country) => preferredCountries.indexOf(country)).filter((index) => index >= 0);
|
|
1251
|
+
return ranks.length > 0 ? Math.min(...ranks) : Number.POSITIVE_INFINITY;
|
|
1252
|
+
}
|
|
1253
|
+
/**
|
|
1254
|
+
* The digital-ID web-redirect providers that get their own chooser card: one
|
|
1255
|
+
* per enabled redirect method in `config.digitalIds`, deduped by provider.
|
|
1256
|
+
* Wallet-funnel fallbacks (the Trinsic mDL leg) are excluded — they surface
|
|
1257
|
+
* through the Digital ID tile instead.
|
|
1258
|
+
*
|
|
1259
|
+
* Order: providers serving the strongest detected country first
|
|
1260
|
+
* (`preferredCountries`, see `detectDigitalIdCountries`), then those serving
|
|
1261
|
+
* weaker ones, then the rest. Country only ranks — nothing is hidden — and
|
|
1262
|
+
* ties keep backend (dashboard) order. With no detected country this is plain
|
|
1263
|
+
* backend order.
|
|
1264
|
+
*
|
|
1265
|
+
* Card display data (`displayName`, `logoUrl`, `country`) is whatever the
|
|
1266
|
+
* backend enriched the method with; the UI falls back to generic copy / icon
|
|
1267
|
+
* when absent.
|
|
1268
|
+
*/
|
|
1269
|
+
function getAvailableDigitalIdRedirectOptions(config, preferredCountries = []) {
|
|
1270
|
+
const entries = collectDigitalIdRedirectOptions(config);
|
|
1271
|
+
if (preferredCountries.length === 0) return entries.map((entry) => entry.option);
|
|
1272
|
+
return entries.map((entry) => ({
|
|
1273
|
+
entry,
|
|
1274
|
+
rank: countryRank(entry.countries, preferredCountries)
|
|
1275
|
+
})).sort((a, b) => a.rank - b.rank).map(({ entry }) => entry.option);
|
|
1276
|
+
}
|
|
1277
|
+
/**
|
|
1278
|
+
* Re-orders the given redirect options for `preferredCountries` without
|
|
1279
|
+
* changing the set: same ranking as `getAvailableDigitalIdRedirectOptions`,
|
|
1280
|
+
* ties in backend order. Each option's countries come from its configured
|
|
1281
|
+
* method (all of them), falling back to the option's own `country`.
|
|
1282
|
+
*/
|
|
1283
|
+
function rankDigitalIdRedirectOptions(options, config, preferredCountries) {
|
|
1284
|
+
const entries = collectDigitalIdRedirectOptions(config);
|
|
1285
|
+
const backendIndex = (option) => {
|
|
1286
|
+
const index = entries.findIndex((entry) => entry.option.providerId === option.providerId);
|
|
1287
|
+
return index >= 0 ? index : entries.length;
|
|
1288
|
+
};
|
|
1289
|
+
const countriesOf = (option) => {
|
|
1290
|
+
const configured = entries.find((entry) => entry.option.providerId === option.providerId);
|
|
1291
|
+
const own = normalizeCountryCode(option.country);
|
|
1292
|
+
return configured?.countries ?? (own ? [own] : []);
|
|
1293
|
+
};
|
|
1294
|
+
return options.map((option, position) => ({
|
|
1295
|
+
option,
|
|
1296
|
+
rank: countryRank(countriesOf(option), preferredCountries),
|
|
1297
|
+
order: backendIndex(option),
|
|
1298
|
+
position
|
|
1299
|
+
})).sort((a, b) => a.rank - b.rank || a.order - b.order || a.position - b.position).map(({ option }) => option);
|
|
1300
|
+
}
|
|
1301
|
+
/**
|
|
1302
|
+
* Whether country ranking can change the order of the redirect options: at
|
|
1303
|
+
* least two options serving different countries. When it cannot, the chooser
|
|
1304
|
+
* skips country detection entirely (no request, no wait).
|
|
1305
|
+
*/
|
|
1306
|
+
function canRankDigitalIdRedirectOptionsByCountry(config) {
|
|
1307
|
+
const entries = collectDigitalIdRedirectOptions(config);
|
|
1308
|
+
if (entries.length < 2) return false;
|
|
1309
|
+
return new Set(entries.map((entry) => [...entry.countries].sort().join(","))).size > 1;
|
|
1310
|
+
}
|
|
1311
|
+
/**
|
|
1312
|
+
* Map of config properties received from the backend to adjusted, internal document types.
|
|
1313
|
+
*/
|
|
1314
|
+
const DOCUMENT_TYPES_CONFIG_TO_ADJUSTED_MAP = [
|
|
1315
|
+
["enableId", "id"],
|
|
1316
|
+
["enablePassport", "passport"],
|
|
1317
|
+
["digitalIdsUpload", "digitalIdUpload"]
|
|
1318
|
+
];
|
|
1319
|
+
/**
|
|
1320
|
+
* Returns the list of document types enabled by config for the chooser screen, in display order.
|
|
1321
|
+
* Used to populate chooser state so UI and headless consumers can render the correct options.
|
|
1322
|
+
*
|
|
1323
|
+
* Digital-ID document types (device wallet, Trinsic web-redirect) come from
|
|
1324
|
+
* the digital-ID registry funnel: each registry document type contributes the
|
|
1325
|
+
* tile of its first active implementation. A `deviceWallet: true` config on a
|
|
1326
|
+
* platform without the Credentials API therefore shows the Trinsic fallback
|
|
1327
|
+
* tile when one is configured — or no tile at all, instead of a dead-end one.
|
|
1328
|
+
*
|
|
1329
|
+
* @param config - ID capture configuration (from flow or init)
|
|
1330
|
+
* @param platform - Platform capabilities consulted by the digital-ID funnel.
|
|
1331
|
+
* Defaults to no Credentials API for pure-node callers; the machine passes
|
|
1332
|
+
* the real capability check.
|
|
1333
|
+
* @returns Array of IdDocumentType values that should be shown in the document type chooser
|
|
1334
|
+
*/
|
|
1335
|
+
function getAvailableDocumentTypes(config, platform = { credentialsAvailable: false }) {
|
|
1336
|
+
const adjustedDocumentTypes = [];
|
|
1337
|
+
for (const [configProperty, adjustedType] of DOCUMENT_TYPES_CONFIG_TO_ADJUSTED_MAP) if (config[configProperty]) adjustedDocumentTypes.push(adjustedType);
|
|
1338
|
+
for (const docType of DIGITAL_ID_DOCUMENT_TYPES) {
|
|
1339
|
+
const route = resolveDigitalIdImplementation(docType, config, platform);
|
|
1340
|
+
if (!route) continue;
|
|
1341
|
+
const documentType = route.kind === "incodeWallet" ? "digitalId" : "digitalIdRedirect";
|
|
1342
|
+
if (!adjustedDocumentTypes.includes(documentType)) adjustedDocumentTypes.push(documentType);
|
|
1343
|
+
}
|
|
1344
|
+
if (!adjustedDocumentTypes.includes("digitalIdRedirect") && getAvailableDigitalIdRedirectOptions(config).length > 0) adjustedDocumentTypes.push("digitalIdRedirect");
|
|
1345
|
+
return adjustedDocumentTypes;
|
|
1346
|
+
}
|
|
1347
|
+
/**
|
|
1348
|
+
* Computes `idCaptureMachine`'s terminal output — the downstream module-skip
|
|
1349
|
+
* signal read by the Flow orchestrator (via `runChildModule`'s `MODULE_COMPLETE`).
|
|
1350
|
+
*
|
|
1351
|
+
* `skipFaceMatch` is set ONLY for the US Smart Capture *camera back-only* path:
|
|
1352
|
+
* a back image was captured on-device (`capturedImages.back`) and no front was
|
|
1353
|
+
* (`!capturedImages.front`) — "no front, no ID face, no match".
|
|
1354
|
+
*
|
|
1355
|
+
* Requiring a captured back is deliberate and load-bearing: the digital-ID
|
|
1356
|
+
* upload path submits a full ID (front face present) but does NOT
|
|
1357
|
+
* populate `capturedImages` (only the camera path does). Gating on a captured
|
|
1358
|
+
* back excludes those upload paths so a real ID-vs-selfie match is never
|
|
1359
|
+
* silently skipped. `capturedImages.front`/`forceFrontIdCapture` alone are not
|
|
1360
|
+
* enough (a later front upload clears the request; uploads set neither field).
|
|
1361
|
+
*
|
|
1362
|
+
* Always `false` outside US Smart Capture. The selfie/face capture itself is
|
|
1363
|
+
* unaffected — only the ID-vs-selfie match is skipped.
|
|
1364
|
+
*
|
|
1365
|
+
* Also `true` on the Digital ID web-redirect (Trinsic iDIN/FTN) COMPLETED path
|
|
1366
|
+
* when the scheme returned no portrait (`isDigitalIdRedirect && !portraitPresent`,
|
|
1367
|
+
* FM-1/FM-2): there is no ID face to match the selfie against.
|
|
1368
|
+
*/
|
|
1369
|
+
function computeIdCaptureOutput(context) {
|
|
1370
|
+
const frontIdCaptured = Boolean(context.capturedImages.front);
|
|
1371
|
+
const backIdCaptured = Boolean(context.capturedImages.back);
|
|
1372
|
+
return {
|
|
1373
|
+
frontIdCaptured,
|
|
1374
|
+
skipFaceMatch: context.isDigitalIdRedirect === true && context.portraitPresent !== true || context.config.usSmartCapture === true && backIdCaptured && !frontIdCaptured
|
|
1375
|
+
};
|
|
1376
|
+
}
|
|
1377
|
+
//#endregion
|
|
772
1378
|
//#region src/modules/id/idCaptureGuards.ts
|
|
773
1379
|
function getPermissionOutput(event) {
|
|
774
1380
|
if (!("output" in event)) return;
|
|
@@ -778,7 +1384,20 @@ function getPermissionOutput(event) {
|
|
|
778
1384
|
}
|
|
779
1385
|
const hasShowTutorialGuard = ({ context }) => context.config.showTutorial;
|
|
780
1386
|
const hasAgeAssuranceGuard = ({ context }) => context.config.ageAssurance === true;
|
|
781
|
-
|
|
1387
|
+
/** Camera capture has something to capture: an ID or a passport is accepted. */
|
|
1388
|
+
const hasPhysicalDocumentType = (context) => context.availableDocumentTypes.some((type) => type === "id" || type === "passport");
|
|
1389
|
+
/**
|
|
1390
|
+
* The chooser shows when configured, and also when only digital-ID options
|
|
1391
|
+
* are available: hiding it would otherwise fall through to camera capture of
|
|
1392
|
+
* a document the module does not accept (PRI-6436).
|
|
1393
|
+
*/
|
|
1394
|
+
const hasShowDocumentChooserGuard = ({ context }) => context.availableDocumentTypes.length > 0 && !hasPhysicalDocumentType(context) || !context.config.onlyBack && (context.config.showDocumentChooserScreen ?? false);
|
|
1395
|
+
/**
|
|
1396
|
+
* Chooser hidden and a single web-redirect provider (e.g. FTN) is the only
|
|
1397
|
+
* option: enter it directly. Unlike the device wallet, the redirect needs no
|
|
1398
|
+
* user activation, so no chooser click is required (PRI-6436).
|
|
1399
|
+
*/
|
|
1400
|
+
const isSoleDigitalIdRedirectWithoutChooserGuard = ({ context }) => !(context.config.showDocumentChooserScreen ?? false) && context.availableDocumentTypes.length === 1 && context.availableDocumentTypes[0] === "digitalIdRedirect" && context.digitalIdRedirectOptions.length === 1;
|
|
782
1401
|
const isPermissionGrantedGuard = ({ event }) => {
|
|
783
1402
|
return getPermissionOutput(event) === "granted";
|
|
784
1403
|
};
|
|
@@ -874,6 +1493,13 @@ const supportsOptimizingStatusGuard = ({ context }) => context.config.supportsOp
|
|
|
874
1493
|
const isDeepsightEnabledGuard = ({ context }) => context.dependencies !== void 0;
|
|
875
1494
|
const isDeepsightReadyGuard = ({ context }) => context.deepsightService !== void 0;
|
|
876
1495
|
const needsDeepsightInitGuard = ({ context }) => context.dependencies !== void 0 && context.deepsightService === void 0 && !context.deepsightInitAttempted;
|
|
1496
|
+
/**
|
|
1497
|
+
* Route into the chooser through `detectingCountry`: detection has not run
|
|
1498
|
+
* yet, a country signal is wired, and the ranking could actually reorder the
|
|
1499
|
+
* redirect options (two or more serving different countries). Otherwise the
|
|
1500
|
+
* chooser opens at once, with no request and no spinner.
|
|
1501
|
+
*/
|
|
1502
|
+
const needsCountryDetectionGuard = ({ context }) => context.detectedCountries === void 0 && hasCountrySignals(context.dependencies?.countryDetection) && canRankDigitalIdRedirectOptionsByCountry(context.config);
|
|
877
1503
|
/** No capture option is enabled — the ID module is misconfigured. */
|
|
878
1504
|
const hasNoDocumentTypesAvailableGuard = ({ context }) => context.availableDocumentTypes.length === 0;
|
|
879
1505
|
const isDigitalIdUploadSelectedGuard = ({ event }) => event.type === "SELECT_DOCUMENT" && event.documentType === "digitalIdUpload";
|
|
@@ -1420,7 +2046,7 @@ fromPromise(async ({ input }) => {
|
|
|
1420
2046
|
});
|
|
1421
2047
|
fromPromise(async ({ input }) => {
|
|
1422
2048
|
if (!input.dependencies) return;
|
|
1423
|
-
const { loadDeepsightSession } = await import("./deepsightLoader-
|
|
2049
|
+
const { loadDeepsightSession } = await import("./deepsightLoader-ngnhyO6B.esm.js");
|
|
1424
2050
|
return loadDeepsightSession({
|
|
1425
2051
|
ds: input.ds,
|
|
1426
2052
|
storage: input.dependencies.storage,
|
|
@@ -1863,21 +2489,28 @@ function cleanup(service) {
|
|
|
1863
2489
|
service.cleanup();
|
|
1864
2490
|
} catch {}
|
|
1865
2491
|
}
|
|
1866
|
-
function createIdMetadataPreparationCoordinator(load = async (input) => (await import("./deepsightLoader-
|
|
2492
|
+
function createIdMetadataPreparationCoordinator(load = async (input) => (await import("./deepsightLoader-ngnhyO6B.esm.js")).loadDeepsightSession(input)) {
|
|
1867
2493
|
let disposed = false;
|
|
1868
2494
|
let preparation;
|
|
1869
2495
|
let service;
|
|
2496
|
+
let failure;
|
|
1870
2497
|
const prepare = (input) => {
|
|
1871
2498
|
if (disposed) return Promise.reject(/* @__PURE__ */ new Error("ID metadata coordinator is disposed"));
|
|
1872
|
-
|
|
1873
|
-
const
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
2499
|
+
if (!preparation) {
|
|
2500
|
+
const pending = (async () => {
|
|
2501
|
+
const prepared = await load(input);
|
|
2502
|
+
if (disposed) {
|
|
2503
|
+
cleanup(prepared);
|
|
2504
|
+
throw new Error("ID metadata coordinator is disposed");
|
|
2505
|
+
}
|
|
2506
|
+
service = prepared;
|
|
2507
|
+
return prepared;
|
|
2508
|
+
})();
|
|
2509
|
+
preparation = pending;
|
|
2510
|
+
pending.catch((error) => {
|
|
2511
|
+
if (preparation === pending) failure = { error };
|
|
2512
|
+
});
|
|
2513
|
+
}
|
|
1881
2514
|
return preparation;
|
|
1882
2515
|
};
|
|
1883
2516
|
return {
|
|
@@ -1885,10 +2518,19 @@ function createIdMetadataPreparationCoordinator(load = async (input) => (await i
|
|
|
1885
2518
|
prepare(input).catch(() => void 0);
|
|
1886
2519
|
},
|
|
1887
2520
|
prepare,
|
|
2521
|
+
/**
|
|
2522
|
+
* The memoized preparation's rejection once it has settled. `undefined`
|
|
2523
|
+
* while it is pending or after it succeeded. Preparation is never retried,
|
|
2524
|
+
* so a failure here fails every later attempt of this capture too.
|
|
2525
|
+
*/
|
|
2526
|
+
settledFailure() {
|
|
2527
|
+
return failure;
|
|
2528
|
+
},
|
|
1888
2529
|
dispose() {
|
|
1889
2530
|
if (disposed) return;
|
|
1890
2531
|
disposed = true;
|
|
1891
2532
|
preparation = void 0;
|
|
2533
|
+
failure = void 0;
|
|
1892
2534
|
const prepared = service;
|
|
1893
2535
|
service = void 0;
|
|
1894
2536
|
if (prepared) cleanup(prepared);
|
|
@@ -1981,18 +2623,18 @@ function streamUsesBackCamera(stream) {
|
|
|
1981
2623
|
if (isBackCameraLabel(label)) return true;
|
|
1982
2624
|
if (label.includes("front") || label.includes("user")) return false;
|
|
1983
2625
|
}
|
|
2626
|
+
/** The tutorial pre-acquire's default work: have the ID pipeline loaded. */
|
|
2627
|
+
const warmupIdPipeline = () => ensureWasmPipelines(["idCapture"]);
|
|
1984
2628
|
function createIdProtectedCaptureController(dependencies = {}) {
|
|
1985
2629
|
const metadataCoordinator = createIdMetadataPreparationCoordinator(dependencies.loadMetadata);
|
|
1986
2630
|
let disposed = false;
|
|
1987
2631
|
let visible = true;
|
|
1988
2632
|
let preAcquired;
|
|
1989
2633
|
let preAcquirePromise;
|
|
1990
|
-
let preAcquireGeneration = 0;
|
|
1991
2634
|
let provider;
|
|
1992
2635
|
let displayStream;
|
|
1993
2636
|
let frameCapturer;
|
|
1994
2637
|
let captureResolution;
|
|
1995
|
-
let cameraFallbackLevel;
|
|
1996
2638
|
let usingBackCamera;
|
|
1997
2639
|
let previewImageUrl;
|
|
1998
2640
|
let pendingPreviewCanvas;
|
|
@@ -2042,23 +2684,21 @@ function createIdProtectedCaptureController(dependencies = {}) {
|
|
|
2042
2684
|
releasePreAcquired();
|
|
2043
2685
|
preAcquired = value;
|
|
2044
2686
|
captureResolution = streamResolution(value.stream);
|
|
2045
|
-
cameraFallbackLevel = value.fallbackLevel;
|
|
2046
2687
|
usingBackCamera = streamUsesBackCamera(value.stream);
|
|
2047
2688
|
return true;
|
|
2048
2689
|
};
|
|
2690
|
+
/**
|
|
2691
|
+
* Overlaps the ID pipeline warm-up with the tutorial so the attempt's
|
|
2692
|
+
* `configureWorkflow` finds it loaded. Nothing here opens a camera: since
|
|
2693
|
+
* ml-wasm-kit v2.14.52 the kit acquires it inside the protected camera step.
|
|
2694
|
+
* In-flight calls are deduplicated; the warm-up itself is idempotent.
|
|
2695
|
+
*/
|
|
2049
2696
|
const preAcquire = () => {
|
|
2050
2697
|
if (disposed) return Promise.reject(/* @__PURE__ */ new Error("ID protected capture controller is disposed"));
|
|
2051
|
-
if (preAcquired) return Promise.resolve();
|
|
2052
2698
|
if (preAcquirePromise) return preAcquirePromise;
|
|
2053
|
-
const generation = preAcquireGeneration;
|
|
2054
2699
|
const pending = (async () => {
|
|
2055
|
-
|
|
2056
|
-
if (disposed
|
|
2057
|
-
stopStream(value.stream);
|
|
2058
|
-
if (disposed) throw new Error("ID protected capture controller is disposed");
|
|
2059
|
-
return;
|
|
2060
|
-
}
|
|
2061
|
-
acceptPreAcquired(value);
|
|
2700
|
+
await (dependencies.warmupPipelines ?? warmupIdPipeline)();
|
|
2701
|
+
if (disposed) throw new Error("ID protected capture controller is disposed");
|
|
2062
2702
|
})();
|
|
2063
2703
|
preAcquirePromise = pending;
|
|
2064
2704
|
pending.then(() => {
|
|
@@ -2148,6 +2788,7 @@ function createIdProtectedCaptureController(dependencies = {}) {
|
|
|
2148
2788
|
beginAttempt(context, send, getLiveContext) {
|
|
2149
2789
|
if (disposed) throw new Error("ID protected capture controller is disposed");
|
|
2150
2790
|
clearAttempt();
|
|
2791
|
+
usingBackCamera = getDeviceClass() !== "desktop";
|
|
2151
2792
|
if (stepRecording.session && stepRecording.scope !== recordingScopeFor(context)) completeStepRecording();
|
|
2152
2793
|
diagnosticAttempt = {
|
|
2153
2794
|
attempt: ++protectedIdAttemptSequence,
|
|
@@ -2158,7 +2799,6 @@ function createIdProtectedCaptureController(dependencies = {}) {
|
|
|
2158
2799
|
attemptSend = send;
|
|
2159
2800
|
getAttemptLiveContext = getLiveContext;
|
|
2160
2801
|
provider = (dependencies.createProvider ?? createProtectedIdProvider)(context.config, context.currentMode);
|
|
2161
|
-
cycleOwnership = createCameraCycleOwnership(cameraCycleProvider);
|
|
2162
2802
|
logDiagnostic("attempt-start", { aggregationMs: context.config?.thresholds?.framesAggregationInterval ?? DEFAULT_ID_CAPTURE_THRESHOLDS.framesAggregationInterval });
|
|
2163
2803
|
noteTrueSightCaptureActivity(true);
|
|
2164
2804
|
},
|
|
@@ -2171,6 +2811,9 @@ function createIdProtectedCaptureController(dependencies = {}) {
|
|
|
2171
2811
|
disableIpify: context.disableIpify
|
|
2172
2812
|
});
|
|
2173
2813
|
},
|
|
2814
|
+
settledMetadataFailure() {
|
|
2815
|
+
return metadataCoordinator.settledFailure();
|
|
2816
|
+
},
|
|
2174
2817
|
prepareMetadata(context) {
|
|
2175
2818
|
const storage = context.dependencies?.storage;
|
|
2176
2819
|
if (!storage) return Promise.reject(/* @__PURE__ */ new Error("ID metadata storage is unavailable"));
|
|
@@ -2184,7 +2827,6 @@ function createIdProtectedCaptureController(dependencies = {}) {
|
|
|
2184
2827
|
dispose() {
|
|
2185
2828
|
if (disposed) return;
|
|
2186
2829
|
disposed = true;
|
|
2187
|
-
preAcquireGeneration += 1;
|
|
2188
2830
|
metadataCoordinator.dispose();
|
|
2189
2831
|
releasePreAcquired();
|
|
2190
2832
|
clearAttempt();
|
|
@@ -2218,27 +2860,26 @@ function createIdProtectedCaptureController(dependencies = {}) {
|
|
|
2218
2860
|
return visible;
|
|
2219
2861
|
},
|
|
2220
2862
|
storePreAcquiredStream(value) {
|
|
2221
|
-
preAcquireGeneration += 1;
|
|
2222
2863
|
return acceptPreAcquired(value);
|
|
2223
2864
|
},
|
|
2224
2865
|
takePreAcquiredStream() {
|
|
2225
2866
|
const value = preAcquired;
|
|
2226
2867
|
preAcquired = void 0;
|
|
2227
|
-
if (value) cameraFallbackLevel = value.fallbackLevel;
|
|
2228
2868
|
return value;
|
|
2229
2869
|
},
|
|
2230
2870
|
getProvider() {
|
|
2231
2871
|
return provider;
|
|
2232
2872
|
},
|
|
2233
2873
|
getCycleOwnership() {
|
|
2234
|
-
if (!
|
|
2874
|
+
if (!attemptContext) throw new Error("Protected ID cycle ownership is unavailable");
|
|
2875
|
+
cycleOwnership ??= createCameraCycleOwnership(cameraCycleProvider);
|
|
2235
2876
|
return cycleOwnership;
|
|
2236
2877
|
},
|
|
2237
2878
|
getProjection() {
|
|
2238
2879
|
return {
|
|
2239
2880
|
stream: displayStream,
|
|
2240
2881
|
captureResolution,
|
|
2241
|
-
cameraFallbackLevel,
|
|
2882
|
+
cameraFallbackLevel: void 0,
|
|
2242
2883
|
usingBackCamera
|
|
2243
2884
|
};
|
|
2244
2885
|
},
|
|
@@ -2287,14 +2928,12 @@ function createIdProtectedCaptureController(dependencies = {}) {
|
|
|
2287
2928
|
type,
|
|
2288
2929
|
qualityElements: context.qualityElements,
|
|
2289
2930
|
onProgress,
|
|
2290
|
-
deepsightService: void 0,
|
|
2291
2931
|
stream: displayStream,
|
|
2292
2932
|
isSecondId: context.config.isSecondId ?? false,
|
|
2293
2933
|
onlyFront: type === "front" && (context.config.onlyFront ?? false),
|
|
2294
2934
|
ageAssurance: context.config.ageAssurance,
|
|
2295
2935
|
dependencies: context.dependencies,
|
|
2296
2936
|
captureResolution,
|
|
2297
|
-
cameraFallbackLevel,
|
|
2298
2937
|
extractIdFace: context.config.extractIdFace,
|
|
2299
2938
|
croppedCanvas: provider?.getCapturedCanvas() ?? null
|
|
2300
2939
|
};
|
|
@@ -2313,12 +2952,18 @@ function createIdProtectedCaptureController(dependencies = {}) {
|
|
|
2313
2952
|
},
|
|
2314
2953
|
async deliverCaptureOnly(signal) {
|
|
2315
2954
|
if (!dependencies.finalizeCaptureOnly || !attemptContext || !attemptSend) throw new Error(ID_ERROR_CODES.UPLOAD_ERROR);
|
|
2316
|
-
|
|
2955
|
+
const upload = controller.buildCaptureOnlyUpload(attemptContext, (progress) => {
|
|
2317
2956
|
attemptSend?.({
|
|
2318
2957
|
type: "UPLOAD_PROGRESS",
|
|
2319
2958
|
progress
|
|
2320
2959
|
});
|
|
2321
|
-
})
|
|
2960
|
+
});
|
|
2961
|
+
const deepsightService = await controller.prepareMetadata(attemptContext).catch(() => void 0);
|
|
2962
|
+
if (signal.aborted) throw new DOMException("Aborted", "AbortError");
|
|
2963
|
+
return dependencies.finalizeCaptureOnly({
|
|
2964
|
+
...upload,
|
|
2965
|
+
deepsightService
|
|
2966
|
+
}, signal);
|
|
2322
2967
|
},
|
|
2323
2968
|
resourceSink: {
|
|
2324
2969
|
ready(stream) {
|
|
@@ -2327,10 +2972,7 @@ function createIdProtectedCaptureController(dependencies = {}) {
|
|
|
2327
2972
|
return;
|
|
2328
2973
|
}
|
|
2329
2974
|
replaceDisplayStream(stream);
|
|
2330
|
-
logDiagnostic("protected-camera-ready",
|
|
2331
|
-
...getIdCameraTrackDiagnosticFields(stream.getVideoTracks()[0]),
|
|
2332
|
-
fallbackLevel: cameraFallbackLevel
|
|
2333
|
-
});
|
|
2975
|
+
logDiagnostic("protected-camera-ready", getIdCameraTrackDiagnosticFields(stream.getVideoTracks()[0]));
|
|
2334
2976
|
},
|
|
2335
2977
|
autoCommitted: storeCommit,
|
|
2336
2978
|
manualCommitted: storeCommit,
|
|
@@ -2775,48 +3417,34 @@ function createProtectedIdAttemptInput(input) {
|
|
|
2775
3417
|
const target = resolveProtectedIdTarget(context.config, context.currentMode);
|
|
2776
3418
|
const callbackSession = createProtectedIdCallbackSession(input);
|
|
2777
3419
|
let wasmUtil;
|
|
2778
|
-
const preAcquired = controller.takePreAcquiredStream();
|
|
2779
|
-
let selectedVideoTrack = preAcquired?.stream.getVideoTracks()[0];
|
|
2780
|
-
const constraints = getCameraReacquisitionConstraints(selectedVideoTrack, preAcquired?.constraints);
|
|
2781
3420
|
const captureOnly = hasOnCaptureCallback(context.config);
|
|
2782
3421
|
const diagnosticAttempt = controller.getDiagnosticAttempt();
|
|
2783
3422
|
const isAttemptActive = () => !controller.disposed && controller.getProvider() === provider && controller.getDiagnosticAttempt() === diagnosticAttempt;
|
|
2784
|
-
|
|
2785
|
-
if (!diagnosticAttempt) return;
|
|
2786
|
-
logIdCameraDiagnostic("selected-camera", {
|
|
2787
|
-
attempt: diagnosticAttempt.attempt,
|
|
2788
|
-
side: diagnosticAttempt.side,
|
|
2789
|
-
elapsedMs: Math.round(getTimestamp() - diagnosticAttempt.startedAt),
|
|
2790
|
-
...getIdCameraTrackDiagnosticFields(stream.getVideoTracks()[0]),
|
|
2791
|
-
preAcquired: preAcquiredStream,
|
|
2792
|
-
fallbackLevel,
|
|
2793
|
-
workflow: String(workflow),
|
|
2794
|
-
devicePinned: reacquisitionConstraints?.deviceId !== void 0
|
|
2795
|
-
});
|
|
2796
|
-
};
|
|
2797
|
-
if (preAcquired) logSelectedCamera(preAcquired.stream, preAcquired.fallbackLevel, constraints, true);
|
|
3423
|
+
let cameraStepFacts = {};
|
|
2798
3424
|
return {
|
|
2799
3425
|
attemptId: `protected-id-${diagnosticAttempt?.attempt ?? ++protectedIdAttemptSequence}`,
|
|
2800
3426
|
target,
|
|
2801
3427
|
workflow,
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
3428
|
+
preflight: captureOnly ? void 0 : () => {
|
|
3429
|
+
const failure = controller.settledMetadataFailure();
|
|
3430
|
+
if (failure) throw failure.error;
|
|
3431
|
+
},
|
|
3432
|
+
cameraStep: async () => {
|
|
3433
|
+
const di = await electDesktopCameraDevice("environment");
|
|
3434
|
+
const hs = controller.takePreAcquiredStream()?.stream;
|
|
3435
|
+
cameraStepFacts = {
|
|
3436
|
+
preAcquired: hs !== void 0,
|
|
3437
|
+
devicePinned: di !== ""
|
|
3438
|
+
};
|
|
3439
|
+
return {
|
|
3440
|
+
vs: "environment",
|
|
3441
|
+
di,
|
|
3442
|
+
ew: 0,
|
|
3443
|
+
eh: 0,
|
|
3444
|
+
i14: isIPhone14OrHigher(),
|
|
3445
|
+
pa: false,
|
|
3446
|
+
hs
|
|
3447
|
+
};
|
|
2820
3448
|
},
|
|
2821
3449
|
initiallyBackgrounded: !controller.isVisible(),
|
|
2822
3450
|
resourceSink: controller.resourceSink,
|
|
@@ -2830,13 +3458,11 @@ function createProtectedIdAttemptInput(input) {
|
|
|
2830
3458
|
enabled: !captureOnly,
|
|
2831
3459
|
stepRecording: controller.getStepRecording()
|
|
2832
3460
|
}),
|
|
2833
|
-
|
|
2834
|
-
beforeAdopt: captureOnly ? void 0 : async (stream) => {
|
|
2835
|
-
const track = stream.getVideoTracks()[0];
|
|
2836
|
-
if (!track) throw new Error("Protected ID camera has no selected video track");
|
|
3461
|
+
afterReady: captureOnly ? void 0 : async (displayStream) => {
|
|
2837
3462
|
const metadata = await controller.prepareMetadata(context);
|
|
2838
3463
|
if (!isAttemptActive()) return;
|
|
2839
|
-
|
|
3464
|
+
const track = displayStream.getVideoTracks()[0];
|
|
3465
|
+
if (track) await metadata.checkVirtualCamera(track);
|
|
2840
3466
|
},
|
|
2841
3467
|
onStartupTiming(timing) {
|
|
2842
3468
|
if (!diagnosticAttempt) return;
|
|
@@ -2844,6 +3470,8 @@ function createProtectedIdAttemptInput(input) {
|
|
|
2844
3470
|
attempt: diagnosticAttempt.attempt,
|
|
2845
3471
|
side: diagnosticAttempt.side,
|
|
2846
3472
|
elapsedMs: Math.round(getTimestamp() - diagnosticAttempt.startedAt),
|
|
3473
|
+
workflow: String(workflow),
|
|
3474
|
+
...cameraStepFacts,
|
|
2847
3475
|
...timing
|
|
2848
3476
|
});
|
|
2849
3477
|
},
|
|
@@ -2862,12 +3490,6 @@ function createProtectedIdAttemptInput(input) {
|
|
|
2862
3490
|
callbacks: callbackSession.callbacks
|
|
2863
3491
|
});
|
|
2864
3492
|
},
|
|
2865
|
-
async runPrc() {
|
|
2866
|
-
if (!isAttemptActive()) return;
|
|
2867
|
-
wasmUtil = await (input.getWasmUtil ?? WasmUtilProvider.getInstance)();
|
|
2868
|
-
if (!isAttemptActive()) return;
|
|
2869
|
-
await wasmUtil.prc();
|
|
2870
|
-
},
|
|
2871
3493
|
async runPoc() {
|
|
2872
3494
|
if (captureOnly) return;
|
|
2873
3495
|
if (!isAttemptActive()) return;
|
|
@@ -2898,398 +3520,66 @@ function createProtectedIdAttemptInput(input) {
|
|
|
2898
3520
|
motionStatus
|
|
2899
3521
|
});
|
|
2900
3522
|
} catch {}
|
|
2901
|
-
try {
|
|
2902
|
-
const logs = metadata.getPipelineState();
|
|
2903
|
-
if (!isAttemptActive()) return;
|
|
2904
|
-
const projection = controller.getProjection();
|
|
2905
|
-
context.dependencies?.trackCaptureAttemptFinished?.({
|
|
2906
|
-
logs,
|
|
2907
|
-
resolution: projection.captureResolution,
|
|
2908
|
-
fallbackLevel: projection.cameraFallbackLevel
|
|
2909
|
-
});
|
|
2910
|
-
} catch {
|
|
2911
|
-
if (isAttemptActive()) trueSightLog("warning", "deepsight", "idScan", "protected capture diagnostics failed");
|
|
2912
|
-
}
|
|
2913
|
-
}
|
|
2914
|
-
}
|
|
2915
|
-
};
|
|
2916
|
-
}
|
|
2917
|
-
function protectedIdResultToCaptureResponse(result) {
|
|
2918
|
-
const regulationType = result.regulationType === "US" || result.regulationType === "Worldwide" || result.regulationType === "Other" || result.regulationType === "US_Illinois" || result.regulationType === "US_Texas" || result.regulationType === "US_California" || result.regulationType === "US_Washington" ? result.regulationType : void 0;
|
|
2919
|
-
return {
|
|
2920
|
-
sharpness: result.sharpness ?? 0,
|
|
2921
|
-
correctSharpness: result.sharpness != null && result.sharpness >= 10,
|
|
2922
|
-
glare: result.glare ?? 0,
|
|
2923
|
-
correctGlare: result.glare != null && result.glare >= 10,
|
|
2924
|
-
horizontalResolution: 0,
|
|
2925
|
-
classification: result.classification === true,
|
|
2926
|
-
readability: result.readability === true,
|
|
2927
|
-
typeOfId: result.typeOfId ?? "",
|
|
2928
|
-
issueYear: 0,
|
|
2929
|
-
issueName: "",
|
|
2930
|
-
sessionStatus: result.sessionStatus ?? "",
|
|
2931
|
-
countryCode: result.countryCode ?? "",
|
|
2932
|
-
skipBackIdCapture: result.skipBackIdCapture,
|
|
2933
|
-
skipGlareFront: result.skipGlareFront,
|
|
2934
|
-
skipGlareBack: result.skipGlareBack,
|
|
2935
|
-
acceptedDocuments: result.acceptedDocuments ? [...result.acceptedDocuments] : void 0,
|
|
2936
|
-
forceFrontIdCapture: result.forceFrontIdCapture,
|
|
2937
|
-
idValidationCompleted: result.idValidationCompleted,
|
|
2938
|
-
showMandatoryConsent: result.showMandatoryConsent,
|
|
2939
|
-
regulationType,
|
|
2940
|
-
failReason: result.failReason,
|
|
2941
|
-
side: result.side,
|
|
2942
|
-
idQualityAttemptApproved: result.idQualityAttemptApproved,
|
|
2943
|
-
isDocumentExpired: result.isDocumentExpired,
|
|
2944
|
-
success: result.success
|
|
2945
|
-
};
|
|
2946
|
-
}
|
|
2947
|
-
function getProtectedIdUploadRequest(context, sessionToken = getToken()) {
|
|
2948
|
-
const target = resolveProtectedIdTarget(context.config, context.currentMode);
|
|
2949
|
-
const front = context.currentMode !== "back";
|
|
2950
|
-
const params = { captureType: context.manualCaptureTriggered ? "MANUAL" : "AUTO" };
|
|
2951
|
-
if (front && context.config.onlyFront === true) params.onlyFront = true;
|
|
2952
|
-
if (front && context.config.extractIdFace === false) params.extractIdFace = false;
|
|
2953
|
-
const sharpness = context.qualityElements?.sharpness;
|
|
2954
|
-
if (sharpness !== void 0 && sharpness !== 0 && Number.isFinite(sharpness)) params.sharpness = getRealQualityValue(sharpness);
|
|
2955
|
-
return {
|
|
2956
|
-
target,
|
|
2957
|
-
config: {
|
|
2958
|
-
...sessionToken ? { headers: { "X-Incode-Hardware-Id": sessionToken } } : {},
|
|
2959
|
-
params
|
|
2960
|
-
}
|
|
2961
|
-
};
|
|
2962
|
-
}
|
|
2963
|
-
//#endregion
|
|
2964
|
-
//#region src/modules/id/digitalIdRegistry.ts
|
|
2965
|
-
/**
|
|
2966
|
-
* True when a digital-ID method uses a full-page web-redirect flow (Trinsic
|
|
2967
|
-
* iDIN/FTN). Accepts both the module `FlowType` value (`REDIRECT`) and the
|
|
2968
|
-
* backend value (`WEB_REDIRECT`). (Lives here rather than in
|
|
2969
|
-
* `idCaptureHelpers` to keep the registry free of circular imports; the
|
|
2970
|
-
* helpers re-export it.)
|
|
2971
|
-
*/
|
|
2972
|
-
function isRedirectFlowType(flowType) {
|
|
2973
|
-
return flowType === "REDIRECT" || flowType === "WEB_REDIRECT";
|
|
2974
|
-
}
|
|
2975
|
-
const DIGITAL_ID_REGISTRY = {
|
|
2976
|
-
mDL: [{
|
|
2977
|
-
kind: "incodeWallet",
|
|
2978
|
-
documentType: "digitalId"
|
|
2979
|
-
}, {
|
|
2980
|
-
kind: "trinsicRedirect",
|
|
2981
|
-
documentType: "digitalIdRedirect",
|
|
2982
|
-
providerId: "trinsic_mdl_placeholder",
|
|
2983
|
-
method: "MDL"
|
|
2984
|
-
}],
|
|
2985
|
-
iDIN: [{
|
|
2986
|
-
kind: "trinsicRedirect",
|
|
2987
|
-
documentType: "digitalIdRedirect",
|
|
2988
|
-
providerId: "trinsic_netherlands_idin",
|
|
2989
|
-
method: "IDIN"
|
|
2990
|
-
}],
|
|
2991
|
-
FTN: [{
|
|
2992
|
-
kind: "trinsicRedirect",
|
|
2993
|
-
documentType: "digitalIdRedirect",
|
|
2994
|
-
providerId: "trinsic_finnish_trust_network",
|
|
2995
|
-
method: "FTN"
|
|
2996
|
-
}]
|
|
2997
|
-
};
|
|
2998
|
-
const DIGITAL_ID_DOCUMENT_TYPES = Object.keys(DIGITAL_ID_REGISTRY);
|
|
2999
|
-
/**
|
|
3000
|
-
* Single place that widens `config.digitalIds` to the shapes the backend
|
|
3001
|
-
* actually sends — the mapped array or the raw `{ enabled, methods }` object.
|
|
3002
|
-
* Shared so the cast is written once.
|
|
3003
|
-
*/
|
|
3004
|
-
function asDigitalIdsConfig(config) {
|
|
3005
|
-
return config.digitalIds;
|
|
3006
|
-
}
|
|
3007
|
-
/**
|
|
3008
|
-
* Persisted method name → catalog provider id, derived from the registry's
|
|
3009
|
-
* Trinsic entries (single source of truth). Lets the SDK launch iDIN / FTN
|
|
3010
|
-
* from a backend that does not yet send `providerId` on each method.
|
|
3011
|
-
* TODO(roadmap: fully-catalog-driven): remove once every backend enriches
|
|
3012
|
-
* `digitalIds.methods[]` with `providerId` + `flowType`.
|
|
3013
|
-
*/
|
|
3014
|
-
const REDIRECT_PROVIDER_BY_METHOD = (() => {
|
|
3015
|
-
const map = {};
|
|
3016
|
-
for (const docType of DIGITAL_ID_DOCUMENT_TYPES) for (const entry of DIGITAL_ID_REGISTRY[docType]) if (entry.kind === "trinsicRedirect") map[entry.method] = entry.providerId;
|
|
3017
|
-
return map;
|
|
3018
|
-
})();
|
|
3019
|
-
/**
|
|
3020
|
-
* Redirect providers that are the fallback leg of a wallet-first funnel
|
|
3021
|
-
* (mDL): they are reached through the `digitalId` tile's funnel resolution,
|
|
3022
|
-
* not offered as a standalone chooser card.
|
|
3023
|
-
*/
|
|
3024
|
-
const WALLET_FUNNEL_REDIRECT_PROVIDER_IDS = new Set(DIGITAL_ID_DOCUMENT_TYPES.flatMap((docType) => {
|
|
3025
|
-
const entries = DIGITAL_ID_REGISTRY[docType];
|
|
3026
|
-
if (!entries.some((entry) => entry.kind === "incodeWallet")) return [];
|
|
3027
|
-
return entries.flatMap((entry) => entry.kind === "trinsicRedirect" ? [entry.providerId] : []);
|
|
3028
|
-
}));
|
|
3029
|
-
/**
|
|
3030
|
-
* True for a redirect provider that gets its own chooser card (iDIN, FTN, any
|
|
3031
|
-
* catalog-enriched redirect method) — as opposed to the mDL wallet fallback,
|
|
3032
|
-
* which only surfaces through the Digital ID tile.
|
|
3033
|
-
*/
|
|
3034
|
-
function isStandaloneRedirectProvider(providerId) {
|
|
3035
|
-
return !WALLET_FUNNEL_REDIRECT_PROVIDER_IDS.has(providerId);
|
|
3036
|
-
}
|
|
3037
|
-
/**
|
|
3038
|
-
* The provider id a configured method launches with, when it is a
|
|
3039
|
-
* web-redirect method; `undefined` for wallets / other flow shapes.
|
|
3040
|
-
*
|
|
3041
|
-
* Resolution order:
|
|
3042
|
-
* 1. an explicit redirect `flowType` with a `provider` (mapped shape) or
|
|
3043
|
-
* `providerId` (catalog-enriched raw shape) — backend-authoritative;
|
|
3044
|
-
* 2. otherwise the persisted method name via the registry (legacy raw shape).
|
|
3045
|
-
*/
|
|
3046
|
-
function resolveRedirectProviderId(method) {
|
|
3047
|
-
if (method.flowType) {
|
|
3048
|
-
if (!isRedirectFlowType(method.flowType)) return;
|
|
3049
|
-
const explicit = method.provider ?? method.providerId;
|
|
3050
|
-
if (explicit) return explicit;
|
|
3051
|
-
}
|
|
3052
|
-
return method.method ? REDIRECT_PROVIDER_BY_METHOD[method.method.toUpperCase()] : void 0;
|
|
3053
|
-
}
|
|
3054
|
-
/**
|
|
3055
|
-
* Tolerant view over `config.digitalIds`: accepts both the mapped array
|
|
3056
|
-
* (`IdCaptureDigitalIdMethod[]`) and the raw backend object
|
|
3057
|
-
* (`{ enabled, methods: [...] }`). Extracted from the old
|
|
3058
|
-
* `getDigitalIdRedirectMethod` cast so every consumer parses it the same way.
|
|
3059
|
-
*
|
|
3060
|
-
* Honors both dashboard toggles: a raw object with `enabled: false` yields no
|
|
3061
|
-
* methods, and individual methods with `enabled: false` are dropped (absent
|
|
3062
|
-
* `enabled` counts as on). This is what "enabled for the flow / workflow"
|
|
3063
|
-
* means — for the redirect chooser cards as much as for the wallet tile.
|
|
3064
|
-
*/
|
|
3065
|
-
function normalizeDigitalIdMethods(config) {
|
|
3066
|
-
const raw = asDigitalIdsConfig(config);
|
|
3067
|
-
if (!Array.isArray(raw) && raw?.enabled === false) return [];
|
|
3068
|
-
return (Array.isArray(raw) ? raw : raw?.methods ?? []).filter((method) => method.enabled !== false);
|
|
3069
|
-
}
|
|
3070
|
-
/**
|
|
3071
|
-
* Persisted method names of the Incode-native device wallets — the backend
|
|
3072
|
-
* `DigitalIdMethodCatalog` entries of type `MDL`. A catalog-enriched method
|
|
3073
|
-
* carries `type: 'MDL'` instead of relying on the name; both are honoured.
|
|
3074
|
-
*/
|
|
3075
|
-
const DEVICE_WALLET_METHODS = /* @__PURE__ */ new Set([
|
|
3076
|
-
"APPLE_WALLET",
|
|
3077
|
-
"GOOGLE_WALLET",
|
|
3078
|
-
"CA_DMV_WALLET"
|
|
3079
|
-
]);
|
|
3080
|
-
/**
|
|
3081
|
-
* True for a configured method the native device-wallet handshake can fulfil.
|
|
3082
|
-
* Redirect methods (iDIN, FTN) never count, whatever their name or type — they
|
|
3083
|
-
* must not surface a wallet tile with no wallet behind it.
|
|
3084
|
-
*
|
|
3085
|
-
* Classifies by *kind* only. Whether a method is switched on is already
|
|
3086
|
-
* settled by `normalizeDigitalIdMethods`, which drops disabled methods before
|
|
3087
|
-
* any caller walks the list.
|
|
3088
|
-
*/
|
|
3089
|
-
function isDeviceWalletMethod(method) {
|
|
3090
|
-
if (method.flowType && isRedirectFlowType(method.flowType)) return false;
|
|
3091
|
-
if (method.type?.toUpperCase() === "MDL") return true;
|
|
3092
|
-
return method.method !== void 0 && DEVICE_WALLET_METHODS.has(method.method.toUpperCase());
|
|
3093
|
-
}
|
|
3094
|
-
/**
|
|
3095
|
-
* Whether a device wallet is enabled for this ID-capture config: the coarse
|
|
3096
|
-
* `deviceWallet` flag, or an enabled wallet method in `config.digitalIds`.
|
|
3097
|
-
*
|
|
3098
|
-
* The dashboard persists a wallet only in `digitalIds.methods` and leaves the
|
|
3099
|
-
* legacy `deviceWallet` / `appleWallet` booleans at their stored `false`. The
|
|
3100
|
-
* backend derives the booleans from `digitalIds` for the flow response, but
|
|
3101
|
-
* the workflow-node response historically shipped them raw — so a workflow
|
|
3102
|
-
* with Apple Wallet enabled arrived here as `deviceWallet: false`, and the
|
|
3103
|
-
* tile was dropped while SDK 1 (which reads `digitalIds` itself) showed it.
|
|
3104
|
-
* Mirrors the backend's own `deriveDeviceWalletFlag`, minus its "unknown
|
|
3105
|
-
* method counts as a wallet" fallback: an unrecognised method must not
|
|
3106
|
-
* launch a handshake that cannot know what to request.
|
|
3107
|
-
*/
|
|
3108
|
-
function isDeviceWalletEnabled(config) {
|
|
3109
|
-
if (config.deviceWallet === true) return true;
|
|
3110
|
-
return hasEnabledDeviceWalletMethod(config);
|
|
3111
|
-
}
|
|
3112
|
-
/** Whether a funnel entry is activated by config + platform capabilities. */
|
|
3113
|
-
function isEntryActive(entry, config, platform) {
|
|
3114
|
-
if (entry.kind === "incodeWallet") return isDeviceWalletEnabled(config) && platform.credentialsAvailable;
|
|
3115
|
-
return findConfiguredMethod(entry, config) !== void 0;
|
|
3116
|
-
}
|
|
3117
|
-
/**
|
|
3118
|
-
* The configured `digitalIds` method matching a Trinsic funnel entry — by
|
|
3119
|
-
* persisted method name, or (mapped shape) by provider id on a redirect
|
|
3120
|
-
* flowType. First match wins; disabled methods are already dropped by
|
|
3121
|
-
* `normalizeDigitalIdMethods`.
|
|
3122
|
-
*/
|
|
3123
|
-
function findConfiguredMethod(entry, config) {
|
|
3124
|
-
return normalizeDigitalIdMethods(config).find((method) => method.method?.toUpperCase() === entry.method || method.provider === entry.providerId && !!method.flowType && isRedirectFlowType(method.flowType));
|
|
3125
|
-
}
|
|
3126
|
-
/** Normalizes a raw configured method into the mapped shape for the child input. */
|
|
3127
|
-
function toMappedMethod(entry, method) {
|
|
3128
|
-
if (method.flowType && isRedirectFlowType(method.flowType)) return method;
|
|
3129
|
-
return {
|
|
3130
|
-
method: method.method,
|
|
3131
|
-
provider: entry.providerId,
|
|
3132
|
-
flowType: "WEB_REDIRECT",
|
|
3133
|
-
country: method.country ?? method.countries?.[0],
|
|
3134
|
-
displayName: method.displayName,
|
|
3135
|
-
logoUrl: method.logoUrl
|
|
3136
|
-
};
|
|
3137
|
-
}
|
|
3138
|
-
/**
|
|
3139
|
-
* True when `config.digitalIds` carries a device-wallet method that is switched
|
|
3140
|
-
* on, honouring both dashboard toggles: the `digitalIds.enabled` master switch
|
|
3141
|
-
* and each method's own `enabled` flag. An absent `enabled` counts as on, the
|
|
3142
|
-
* tolerant reading the rest of this module uses.
|
|
3143
|
-
*
|
|
3144
|
-
* Both toggles are applied by `normalizeDigitalIdMethods`, so this only has to
|
|
3145
|
-
* ask whether any surviving method is a wallet.
|
|
3146
|
-
*/
|
|
3147
|
-
function hasEnabledDeviceWalletMethod(config) {
|
|
3148
|
-
return normalizeDigitalIdMethods(config).some(isDeviceWalletMethod);
|
|
3149
|
-
}
|
|
3150
|
-
/**
|
|
3151
|
-
* Resolves the implementation that should fulfil a digital-ID document type:
|
|
3152
|
-
* the first funnel entry that is active under the given config and platform.
|
|
3153
|
-
* `undefined` when nothing can run it (the chooser then shows no tile for it).
|
|
3154
|
-
*/
|
|
3155
|
-
function resolveDigitalIdImplementation(docType, config, platform) {
|
|
3156
|
-
for (const entry of DIGITAL_ID_REGISTRY[docType]) {
|
|
3157
|
-
if (!isEntryActive(entry, config, platform)) continue;
|
|
3158
|
-
if (entry.kind === "incodeWallet") return { kind: "incodeWallet" };
|
|
3159
|
-
const method = findConfiguredMethod(entry, config);
|
|
3160
|
-
return {
|
|
3161
|
-
kind: "trinsicRedirect",
|
|
3162
|
-
providerId: entry.providerId,
|
|
3163
|
-
method: method ? toMappedMethod(entry, method) : void 0
|
|
3164
|
-
};
|
|
3165
|
-
}
|
|
3523
|
+
try {
|
|
3524
|
+
const logs = metadata.getPipelineState();
|
|
3525
|
+
if (!isAttemptActive()) return;
|
|
3526
|
+
const projection = controller.getProjection();
|
|
3527
|
+
context.dependencies?.trackCaptureAttemptFinished?.({
|
|
3528
|
+
logs,
|
|
3529
|
+
resolution: projection.captureResolution,
|
|
3530
|
+
fallbackLevel: projection.cameraFallbackLevel
|
|
3531
|
+
});
|
|
3532
|
+
} catch {
|
|
3533
|
+
if (isAttemptActive()) trueSightLog("warning", "deepsight", "idScan", "protected capture diagnostics failed");
|
|
3534
|
+
}
|
|
3535
|
+
}
|
|
3536
|
+
}
|
|
3537
|
+
};
|
|
3166
3538
|
}
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
/**
|
|
3170
|
-
* Normalizes a configured method into the mapped redirect shape for a
|
|
3171
|
-
* resolved provider. The already-mapped shape is returned as-is; the raw
|
|
3172
|
-
* backend shape gets `provider` + `WEB_REDIRECT` filled in.
|
|
3173
|
-
*/
|
|
3174
|
-
function toRedirectMethod(method, provider) {
|
|
3175
|
-
if (method.provider && method.flowType) return method;
|
|
3539
|
+
function protectedIdResultToCaptureResponse(result) {
|
|
3540
|
+
const regulationType = result.regulationType === "US" || result.regulationType === "Worldwide" || result.regulationType === "Other" || result.regulationType === "US_Illinois" || result.regulationType === "US_Texas" || result.regulationType === "US_California" || result.regulationType === "US_Washington" ? result.regulationType : void 0;
|
|
3176
3541
|
return {
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3542
|
+
sharpness: result.sharpness ?? 0,
|
|
3543
|
+
correctSharpness: result.sharpness != null && result.sharpness >= 10,
|
|
3544
|
+
glare: result.glare ?? 0,
|
|
3545
|
+
correctGlare: result.glare != null && result.glare >= 10,
|
|
3546
|
+
horizontalResolution: 0,
|
|
3547
|
+
classification: result.classification === true,
|
|
3548
|
+
readability: result.readability === true,
|
|
3549
|
+
typeOfId: result.typeOfId ?? "",
|
|
3550
|
+
issueYear: 0,
|
|
3551
|
+
issueName: "",
|
|
3552
|
+
sessionStatus: result.sessionStatus ?? "",
|
|
3553
|
+
countryCode: result.countryCode ?? "",
|
|
3554
|
+
skipBackIdCapture: result.skipBackIdCapture,
|
|
3555
|
+
skipGlareFront: result.skipGlareFront,
|
|
3556
|
+
skipGlareBack: result.skipGlareBack,
|
|
3557
|
+
acceptedDocuments: result.acceptedDocuments ? [...result.acceptedDocuments] : void 0,
|
|
3558
|
+
forceFrontIdCapture: result.forceFrontIdCapture,
|
|
3559
|
+
idValidationCompleted: result.idValidationCompleted,
|
|
3560
|
+
showMandatoryConsent: result.showMandatoryConsent,
|
|
3561
|
+
regulationType,
|
|
3562
|
+
failReason: result.failReason,
|
|
3563
|
+
side: result.side,
|
|
3564
|
+
idQualityAttemptApproved: result.idQualityAttemptApproved,
|
|
3565
|
+
isDocumentExpired: result.isDocumentExpired,
|
|
3566
|
+
success: result.success
|
|
3183
3567
|
};
|
|
3184
3568
|
}
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
* for the raw shape the provider comes from the backend-enriched
|
|
3194
|
-
* `providerId`/`flowType` when present, else from the persisted method name
|
|
3195
|
-
* via the digital-ID registry (`IDIN` → `trinsic_netherlands_idin`).
|
|
3196
|
-
*/
|
|
3197
|
-
function getDigitalIdRedirectMethod(config, providerId) {
|
|
3198
|
-
for (const method of normalizeDigitalIdMethods(config)) {
|
|
3199
|
-
const provider = resolveRedirectProviderId(method);
|
|
3200
|
-
if (!provider || providerId !== void 0 && provider !== providerId) continue;
|
|
3201
|
-
return toRedirectMethod(method, provider);
|
|
3202
|
-
}
|
|
3203
|
-
}
|
|
3204
|
-
/**
|
|
3205
|
-
* The digital-ID web-redirect providers that get their own chooser card: one
|
|
3206
|
-
* per enabled redirect method in `config.digitalIds`, in backend (dashboard)
|
|
3207
|
-
* order, deduped by provider. Wallet-funnel fallbacks (the Trinsic mDL leg)
|
|
3208
|
-
* are excluded — they surface through the Digital ID tile instead.
|
|
3209
|
-
*
|
|
3210
|
-
* Card display data (`displayName`, `logoUrl`, `country`) is whatever the
|
|
3211
|
-
* backend enriched the method with; the UI falls back to generic copy / icon
|
|
3212
|
-
* when absent.
|
|
3213
|
-
*/
|
|
3214
|
-
function getAvailableDigitalIdRedirectOptions(config) {
|
|
3215
|
-
const options = [];
|
|
3216
|
-
for (const method of normalizeDigitalIdMethods(config)) {
|
|
3217
|
-
const providerId = resolveRedirectProviderId(method);
|
|
3218
|
-
if (!providerId || !isStandaloneRedirectProvider(providerId) || options.some((option) => option.providerId === providerId)) continue;
|
|
3219
|
-
options.push({
|
|
3220
|
-
providerId,
|
|
3221
|
-
method: method.method,
|
|
3222
|
-
displayName: method.displayName,
|
|
3223
|
-
logoUrl: method.logoUrl,
|
|
3224
|
-
country: method.country ?? method.countries?.[0]
|
|
3225
|
-
});
|
|
3226
|
-
}
|
|
3227
|
-
return options;
|
|
3228
|
-
}
|
|
3229
|
-
/**
|
|
3230
|
-
* Map of config properties received from the backend to adjusted, internal document types.
|
|
3231
|
-
*/
|
|
3232
|
-
const DOCUMENT_TYPES_CONFIG_TO_ADJUSTED_MAP = [
|
|
3233
|
-
["enableId", "id"],
|
|
3234
|
-
["enablePassport", "passport"],
|
|
3235
|
-
["digitalIdsUpload", "digitalIdUpload"]
|
|
3236
|
-
];
|
|
3237
|
-
/**
|
|
3238
|
-
* Returns the list of document types enabled by config for the chooser screen, in display order.
|
|
3239
|
-
* Used to populate chooser state so UI and headless consumers can render the correct options.
|
|
3240
|
-
*
|
|
3241
|
-
* Digital-ID document types (device wallet, Trinsic web-redirect) come from
|
|
3242
|
-
* the digital-ID registry funnel: each registry document type contributes the
|
|
3243
|
-
* tile of its first active implementation. A `deviceWallet: true` config on a
|
|
3244
|
-
* platform without the Credentials API therefore shows the Trinsic fallback
|
|
3245
|
-
* tile when one is configured — or no tile at all, instead of a dead-end one.
|
|
3246
|
-
*
|
|
3247
|
-
* @param config - ID capture configuration (from flow or init)
|
|
3248
|
-
* @param platform - Platform capabilities consulted by the digital-ID funnel.
|
|
3249
|
-
* Defaults to no Credentials API for pure-node callers; the machine passes
|
|
3250
|
-
* the real capability check.
|
|
3251
|
-
* @returns Array of IdDocumentType values that should be shown in the document type chooser
|
|
3252
|
-
*/
|
|
3253
|
-
function getAvailableDocumentTypes(config, platform = { credentialsAvailable: false }) {
|
|
3254
|
-
const adjustedDocumentTypes = [];
|
|
3255
|
-
for (const [configProperty, adjustedType] of DOCUMENT_TYPES_CONFIG_TO_ADJUSTED_MAP) if (config[configProperty]) adjustedDocumentTypes.push(adjustedType);
|
|
3256
|
-
for (const docType of DIGITAL_ID_DOCUMENT_TYPES) {
|
|
3257
|
-
const route = resolveDigitalIdImplementation(docType, config, platform);
|
|
3258
|
-
if (!route) continue;
|
|
3259
|
-
const documentType = route.kind === "incodeWallet" ? "digitalId" : "digitalIdRedirect";
|
|
3260
|
-
if (!adjustedDocumentTypes.includes(documentType)) adjustedDocumentTypes.push(documentType);
|
|
3261
|
-
}
|
|
3262
|
-
if (!adjustedDocumentTypes.includes("digitalIdRedirect") && getAvailableDigitalIdRedirectOptions(config).length > 0) adjustedDocumentTypes.push("digitalIdRedirect");
|
|
3263
|
-
return adjustedDocumentTypes;
|
|
3264
|
-
}
|
|
3265
|
-
/**
|
|
3266
|
-
* Computes `idCaptureMachine`'s terminal output — the downstream module-skip
|
|
3267
|
-
* signal read by the Flow orchestrator (via `runChildModule`'s `MODULE_COMPLETE`).
|
|
3268
|
-
*
|
|
3269
|
-
* `skipFaceMatch` is set ONLY for the US Smart Capture *camera back-only* path:
|
|
3270
|
-
* a back image was captured on-device (`capturedImages.back`) and no front was
|
|
3271
|
-
* (`!capturedImages.front`) — "no front, no ID face, no match".
|
|
3272
|
-
*
|
|
3273
|
-
* Requiring a captured back is deliberate and load-bearing: the digital-ID
|
|
3274
|
-
* upload path submits a full ID (front face present) but does NOT
|
|
3275
|
-
* populate `capturedImages` (only the camera path does). Gating on a captured
|
|
3276
|
-
* back excludes those upload paths so a real ID-vs-selfie match is never
|
|
3277
|
-
* silently skipped. `capturedImages.front`/`forceFrontIdCapture` alone are not
|
|
3278
|
-
* enough (a later front upload clears the request; uploads set neither field).
|
|
3279
|
-
*
|
|
3280
|
-
* Always `false` outside US Smart Capture. The selfie/face capture itself is
|
|
3281
|
-
* unaffected — only the ID-vs-selfie match is skipped.
|
|
3282
|
-
*
|
|
3283
|
-
* Also `true` on the Digital ID web-redirect (Trinsic iDIN/FTN) COMPLETED path
|
|
3284
|
-
* when the scheme returned no portrait (`isDigitalIdRedirect && !portraitPresent`,
|
|
3285
|
-
* FM-1/FM-2): there is no ID face to match the selfie against.
|
|
3286
|
-
*/
|
|
3287
|
-
function computeIdCaptureOutput(context) {
|
|
3288
|
-
const frontIdCaptured = Boolean(context.capturedImages.front);
|
|
3289
|
-
const backIdCaptured = Boolean(context.capturedImages.back);
|
|
3569
|
+
function getProtectedIdUploadRequest(context, sessionToken = getToken()) {
|
|
3570
|
+
const target = resolveProtectedIdTarget(context.config, context.currentMode);
|
|
3571
|
+
const front = context.currentMode !== "back";
|
|
3572
|
+
const params = { captureType: context.manualCaptureTriggered ? "MANUAL" : "AUTO" };
|
|
3573
|
+
if (front && context.config.onlyFront === true) params.onlyFront = true;
|
|
3574
|
+
if (front && context.config.extractIdFace === false) params.extractIdFace = false;
|
|
3575
|
+
const sharpness = context.qualityElements?.sharpness;
|
|
3576
|
+
if (sharpness !== void 0 && sharpness !== 0 && Number.isFinite(sharpness)) params.sharpness = getRealQualityValue(sharpness);
|
|
3290
3577
|
return {
|
|
3291
|
-
|
|
3292
|
-
|
|
3578
|
+
target,
|
|
3579
|
+
config: {
|
|
3580
|
+
...sessionToken ? { headers: { "X-Incode-Hardware-Id": sessionToken } } : {},
|
|
3581
|
+
params
|
|
3582
|
+
}
|
|
3293
3583
|
};
|
|
3294
3584
|
}
|
|
3295
3585
|
//#endregion
|
|
@@ -3834,12 +4124,8 @@ const idCaptureMachine = setup({
|
|
|
3834
4124
|
digitalUploadMachine,
|
|
3835
4125
|
digitalIdRedirectMachine,
|
|
3836
4126
|
deviceWalletMachine,
|
|
3837
|
-
readPendingDigitalIdRedirect: fromPromise(
|
|
3838
|
-
|
|
3839
|
-
if (!pending) return null;
|
|
3840
|
-
await clearPendingRedirect(input.storage);
|
|
3841
|
-
return pending;
|
|
3842
|
-
})
|
|
4127
|
+
readPendingDigitalIdRedirect: fromPromise(({ input }) => readPendingRedirect(input.storage)),
|
|
4128
|
+
detectCountries: fromPromise(({ input, signal }) => detectDigitalIdCountries(input.dependencies, { signal }))
|
|
3843
4129
|
},
|
|
3844
4130
|
actions: {
|
|
3845
4131
|
attachProtectedController: assign(({ self }) => {
|
|
@@ -3847,7 +4133,7 @@ const idCaptureMachine = setup({
|
|
|
3847
4133
|
return {};
|
|
3848
4134
|
}),
|
|
3849
4135
|
startProtectedMetadataPreparation: ({ context, self }) => {
|
|
3850
|
-
|
|
4136
|
+
getIdProtectedCaptureController(self).startMetadataPreparation(context);
|
|
3851
4137
|
},
|
|
3852
4138
|
bindProtectedControllerLifetime: sendTo("protectedControllerLifetime", ({ self }) => ({
|
|
3853
4139
|
type: "BIND_PROTECTED_ID_CONTROLLER",
|
|
@@ -4109,6 +4395,10 @@ const idCaptureMachine = setup({
|
|
|
4109
4395
|
performStopMediaRecording(context);
|
|
4110
4396
|
},
|
|
4111
4397
|
clearRecordingSession: assign({ recordingSession: () => void 0 }),
|
|
4398
|
+
selectSoleDigitalIdRedirect: assign({
|
|
4399
|
+
selectedDocumentType: () => "digitalIdRedirect",
|
|
4400
|
+
selectedDigitalIdProviderId: ({ context }) => context.digitalIdRedirectOptions[0]?.providerId
|
|
4401
|
+
}),
|
|
4112
4402
|
setSelectedDocument: assign({
|
|
4113
4403
|
selectedDocumentType: ({ event }) => {
|
|
4114
4404
|
if ("documentType" in event) return event.documentType;
|
|
@@ -4229,7 +4519,35 @@ const idCaptureMachine = setup({
|
|
|
4229
4519
|
* it runs inside the tile click's `send()`, preserving the transient
|
|
4230
4520
|
* user activation `navigator.credentials.get()` needs on iOS Safari.
|
|
4231
4521
|
*/
|
|
4232
|
-
resolveDigitalIdRoute: assign(({ context }) => ({ digitalIdRoute: resolveDigitalIdImplementation("mDL", context.config,
|
|
4522
|
+
resolveDigitalIdRoute: assign(({ context }) => ({ digitalIdRoute: resolveDigitalIdImplementation("mDL", context.config, getDigitalIdPlatformSupport(context.dependencies?.credentials)) })),
|
|
4523
|
+
/**
|
|
4524
|
+
* Stores the detected countries and re-ranks the redirect options by them
|
|
4525
|
+
* (`getAvailableDigitalIdRedirectOptions`). The option *set* is unchanged —
|
|
4526
|
+
* country only reorders.
|
|
4527
|
+
*/
|
|
4528
|
+
storeDetectedCountries: assign(({ context, event }) => {
|
|
4529
|
+
const countries = event.output ?? [];
|
|
4530
|
+
return {
|
|
4531
|
+
detectedCountries: countries,
|
|
4532
|
+
digitalIdRedirectOptions: getAvailableDigitalIdRedirectOptions(context.config, countries)
|
|
4533
|
+
};
|
|
4534
|
+
}),
|
|
4535
|
+
/**
|
|
4536
|
+
* The user picked a country on the chooser: it becomes the strongest
|
|
4537
|
+
* country, the detected ones stay behind it as tiebreakers, and the
|
|
4538
|
+
* redirect options are re-ranked. An invalid code is ignored.
|
|
4539
|
+
*/
|
|
4540
|
+
setChooserCountry: assign(({ context, event }) => {
|
|
4541
|
+
const country = event.type === "SET_CHOOSER_COUNTRY" ? normalizeCountryCode(event.country) : void 0;
|
|
4542
|
+
if (!country) return {};
|
|
4543
|
+
const countries = [country, ...(context.detectedCountries ?? []).filter((detected) => detected !== country)];
|
|
4544
|
+
return {
|
|
4545
|
+
detectedCountries: countries,
|
|
4546
|
+
digitalIdRedirectOptions: rankDigitalIdRedirectOptions(context.digitalIdRedirectOptions, context.config, countries)
|
|
4547
|
+
};
|
|
4548
|
+
}),
|
|
4549
|
+
/** Detection failed outright: mark it done so it is not retried. */
|
|
4550
|
+
markCountryDetectionFailed: assign({ detectedCountries: () => [] }),
|
|
4233
4551
|
/**
|
|
4234
4552
|
* Records a completed device-wallet (mDL) handshake from the child's
|
|
4235
4553
|
* `onDone` output. Wallet credentials are single-side; the verified
|
|
@@ -4271,6 +4589,13 @@ const idCaptureMachine = setup({
|
|
|
4271
4589
|
digitalIdResumeProviderId: () => void 0,
|
|
4272
4590
|
digitalIdRoute: () => void 0
|
|
4273
4591
|
}),
|
|
4592
|
+
/**
|
|
4593
|
+
* Drops the persisted return-leg record once the digital-ID attempt ends.
|
|
4594
|
+
* Fire-and-forget: a stale record is only read on the host's return route.
|
|
4595
|
+
*/
|
|
4596
|
+
clearPendingDigitalIdRedirect: ({ context }) => {
|
|
4597
|
+
clearPendingRedirect(resolveIdCaptureDependencies(context.dependencies).storage).catch(() => void 0);
|
|
4598
|
+
},
|
|
4274
4599
|
incrementProcessingExpiredAttempts: assign(({ context }) => ({ processingExpiredAttempts: context.processingExpiredAttempts + 1 })),
|
|
4275
4600
|
setSkipProcessId: assign({ skipProcessId: () => true }),
|
|
4276
4601
|
setExpiredFromUpload: assign({ expiredFromUpload: () => true }),
|
|
@@ -4283,10 +4608,15 @@ const idCaptureMachine = setup({
|
|
|
4283
4608
|
isCaptureOnlyDelivery: ({ context }) => hasOnCaptureCallback(context.config),
|
|
4284
4609
|
isProtectedUploadFailure: ({ event }) => protectedFailure(event)?.failure.stage === "upload",
|
|
4285
4610
|
isProtectedManualRefusal: ({ event }) => protectedFailure(event)?.failure.stage === "manualCommit",
|
|
4611
|
+
isProtectedAcquireDenied: ({ event }) => {
|
|
4612
|
+
const failure = protectedFailure(event)?.failure;
|
|
4613
|
+
return failure?.stage === "acquire" && isCameraDenialErrorName(failure.errorName);
|
|
4614
|
+
},
|
|
4286
4615
|
canCaptureManuallyDuringDetection: ({ context }) => context.config.showCaptureButtonInAuto === true && context.detectionStatus !== "capturing",
|
|
4287
4616
|
hasShowTutorial: hasShowTutorialGuard,
|
|
4288
4617
|
hasAgeAssurance: hasAgeAssuranceGuard,
|
|
4289
4618
|
hasShowDocumentChooser: hasShowDocumentChooserGuard,
|
|
4619
|
+
needsCountryDetection: needsCountryDetectionGuard,
|
|
4290
4620
|
isPermissionGranted: ({ event }) => isPermissionGrantedGuard({ event: asPublicIdEvent(event) }),
|
|
4291
4621
|
isReadyForCapture: ({ context, event }) => isReadyForCaptureGuard({
|
|
4292
4622
|
context,
|
|
@@ -4313,6 +4643,7 @@ const idCaptureMachine = setup({
|
|
|
4313
4643
|
isDeepsightReady: isDeepsightReadyGuard,
|
|
4314
4644
|
needsDeepsightInit: needsDeepsightInitGuard,
|
|
4315
4645
|
hasNoDocumentTypesAvailable: hasNoDocumentTypesAvailableGuard,
|
|
4646
|
+
isSoleDigitalIdRedirectWithoutChooser: isSoleDigitalIdRedirectWithoutChooserGuard,
|
|
4316
4647
|
isDigitalIdUploadSelected: ({ event }) => isDigitalIdUploadSelectedGuard({ event: asPublicIdEvent(event) }),
|
|
4317
4648
|
isDigitalIdRedirectSelected: ({ event }) => isDigitalIdRedirectSelectedGuard({ event: asPublicIdEvent(event) }),
|
|
4318
4649
|
isDigitalIdSelected: ({ event }) => isDigitalIdSelectedGuard({ event: asPublicIdEvent(event) }),
|
|
@@ -4383,9 +4714,22 @@ const idCaptureMachine = setup({
|
|
|
4383
4714
|
},
|
|
4384
4715
|
context: ({ input, self }) => {
|
|
4385
4716
|
attachIdProtectedCaptureController(self, createIdProtectedCaptureController());
|
|
4717
|
+
const carried = carryAttempts(input.config.isSecondId ? "secondIdCapture" : "idCapture", self, (s, previous) => {
|
|
4718
|
+
const c = s.context;
|
|
4719
|
+
const child = s.children.digitalIdUpload?.getSnapshot()?.context;
|
|
4720
|
+
const left = Math.min(previous.attemptsRemaining ?? Infinity, c.attemptsRemaining, child?.attemptsRemaining ?? Infinity);
|
|
4721
|
+
return {
|
|
4722
|
+
attemptsRemaining: s.matches("expiredExhausted") || left <= 0 && left < c.config.captureAttempts ? -1 : left,
|
|
4723
|
+
expiredAttempts: Math.max(previous.expiredAttempts ?? 0, c.expiredAttempts),
|
|
4724
|
+
expiredRedirected: c.expiredRedirected,
|
|
4725
|
+
processingExpiredAttempts: c.processingExpiredAttempts,
|
|
4726
|
+
skipProcessId: previous.skipProcessId === true || c.skipProcessId || s.matches("expiredExhausted") && !shouldProcessAfterExhaustionGuard({ context: c })
|
|
4727
|
+
};
|
|
4728
|
+
});
|
|
4729
|
+
const configured = input.config.captureAttempts ?? 1;
|
|
4386
4730
|
const config = {
|
|
4387
4731
|
...input.config,
|
|
4388
|
-
captureAttempts:
|
|
4732
|
+
captureAttempts: Math.max(0, Math.min(configured, carried.attemptsRemaining ?? configured))
|
|
4389
4733
|
};
|
|
4390
4734
|
const currentMode = input.config.onlyBack ? "back" : !input.config.enableId && input.config.enablePassport ? "passport" : input.config.usSmartCapture ? "back" : "front";
|
|
4391
4735
|
return {
|
|
@@ -4409,11 +4753,11 @@ const idCaptureMachine = setup({
|
|
|
4409
4753
|
barcodeFastPathAttempted: false,
|
|
4410
4754
|
barcodeFastPathCaptured: false,
|
|
4411
4755
|
recordingSession: void 0,
|
|
4412
|
-
attemptsRemaining: config.captureAttempts,
|
|
4413
|
-
expiredAttempts: 0,
|
|
4414
|
-
expiredRedirected: false,
|
|
4415
|
-
processingExpiredAttempts: 0,
|
|
4416
|
-
skipProcessId: input.config.skipProcessId === true,
|
|
4756
|
+
attemptsRemaining: Math.min(config.captureAttempts, carried.attemptsRemaining ?? Infinity),
|
|
4757
|
+
expiredAttempts: carried.expiredAttempts ?? 0,
|
|
4758
|
+
expiredRedirected: carried.expiredRedirected ?? false,
|
|
4759
|
+
processingExpiredAttempts: carried.processingExpiredAttempts ?? 0,
|
|
4760
|
+
skipProcessId: input.config.skipProcessId === true || (carried.attemptsRemaining ?? 0) < 0 && carried.skipProcessId === true,
|
|
4417
4761
|
expiredFromUpload: false,
|
|
4418
4762
|
isDigitalUpload: false,
|
|
4419
4763
|
isDigitalIdRedirect: false,
|
|
@@ -4442,8 +4786,10 @@ const idCaptureMachine = setup({
|
|
|
4442
4786
|
dependencies: resolveIdCaptureDependencies(input.dependencies),
|
|
4443
4787
|
disableIpify: getDisableIpify(),
|
|
4444
4788
|
deepsightInitAttempted: false,
|
|
4445
|
-
availableDocumentTypes: getAvailableDocumentTypes(input.config,
|
|
4789
|
+
availableDocumentTypes: getAvailableDocumentTypes(input.config, getDigitalIdPlatformSupport(input.dependencies?.credentials)),
|
|
4446
4790
|
digitalIdRedirectOptions: getAvailableDigitalIdRedirectOptions(input.config),
|
|
4791
|
+
detectedCountries: void 0,
|
|
4792
|
+
walletDevice: resolveWalletDevice(),
|
|
4447
4793
|
selectedDigitalIdProviderId: void 0,
|
|
4448
4794
|
captureResolution: void 0,
|
|
4449
4795
|
cameraFallbackLevel: void 0,
|
|
@@ -4460,11 +4806,25 @@ const idCaptureMachine = setup({
|
|
|
4460
4806
|
target: "digitalIdRedirectReturning",
|
|
4461
4807
|
guard: "hasDigitalIdReturn"
|
|
4462
4808
|
},
|
|
4809
|
+
{
|
|
4810
|
+
target: "processing",
|
|
4811
|
+
guard: ({ context }) => context.attemptsRemaining < 0,
|
|
4812
|
+
actions: ["flagIdManualReview", "setForceFinishAfterProcessing"]
|
|
4813
|
+
},
|
|
4463
4814
|
{
|
|
4464
4815
|
target: "error",
|
|
4465
4816
|
guard: "hasNoDocumentTypesAvailable",
|
|
4466
4817
|
actions: [() => console.error(ID_CAPTURE_NO_DOCUMENT_TYPES_ERROR), assign({ error: () => ID_CAPTURE_NO_DOCUMENT_TYPES_ERROR })]
|
|
4467
4818
|
},
|
|
4819
|
+
{
|
|
4820
|
+
target: "digitalIdRedirect",
|
|
4821
|
+
guard: "isSoleDigitalIdRedirectWithoutChooser",
|
|
4822
|
+
actions: ["selectSoleDigitalIdRedirect"]
|
|
4823
|
+
},
|
|
4824
|
+
{
|
|
4825
|
+
target: "detectingCountry",
|
|
4826
|
+
guard: and(["hasShowDocumentChooser", "needsCountryDetection"])
|
|
4827
|
+
},
|
|
4468
4828
|
{
|
|
4469
4829
|
target: "chooser",
|
|
4470
4830
|
guard: "hasShowDocumentChooser"
|
|
@@ -4479,37 +4839,53 @@ const idCaptureMachine = setup({
|
|
|
4479
4839
|
},
|
|
4480
4840
|
{ target: "loading" }
|
|
4481
4841
|
] } },
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
target: "digitalIdRedirect",
|
|
4490
|
-
guard: "isDigitalIdRedirectSelected",
|
|
4491
|
-
actions: ["setSelectedDocument"]
|
|
4492
|
-
},
|
|
4493
|
-
{
|
|
4494
|
-
target: "digitalIdUpload",
|
|
4495
|
-
guard: "isDigitalIdUploadSelected",
|
|
4496
|
-
actions: ["setSelectedDocument"]
|
|
4497
|
-
},
|
|
4498
|
-
{
|
|
4499
|
-
target: "ageVerification",
|
|
4500
|
-
guard: "hasAgeAssurance",
|
|
4501
|
-
actions: ["setSelectedDocument", "setCurrentMode"]
|
|
4502
|
-
},
|
|
4503
|
-
{
|
|
4504
|
-
target: "tutorial",
|
|
4505
|
-
guard: "hasShowTutorial",
|
|
4506
|
-
actions: ["setSelectedDocument", "setCurrentMode"]
|
|
4842
|
+
detectingCountry: { invoke: {
|
|
4843
|
+
id: "detectCountries",
|
|
4844
|
+
src: "detectCountries",
|
|
4845
|
+
input: ({ context }) => ({ dependencies: context.dependencies?.countryDetection ?? {} }),
|
|
4846
|
+
onDone: {
|
|
4847
|
+
target: "chooser",
|
|
4848
|
+
actions: "storeDetectedCountries"
|
|
4507
4849
|
},
|
|
4508
|
-
{
|
|
4509
|
-
target: "
|
|
4510
|
-
actions:
|
|
4850
|
+
onError: {
|
|
4851
|
+
target: "chooser",
|
|
4852
|
+
actions: "markCountryDetectionFailed"
|
|
4511
4853
|
}
|
|
4512
|
-
|
|
4854
|
+
} },
|
|
4855
|
+
chooser: { on: {
|
|
4856
|
+
SET_CHOOSER_COUNTRY: { actions: "setChooserCountry" },
|
|
4857
|
+
SELECT_DOCUMENT: [
|
|
4858
|
+
{
|
|
4859
|
+
target: "digitalIdRouting",
|
|
4860
|
+
guard: "isDigitalIdSelected",
|
|
4861
|
+
actions: ["setSelectedDocument", "resolveDigitalIdRoute"]
|
|
4862
|
+
},
|
|
4863
|
+
{
|
|
4864
|
+
target: "digitalIdRedirect",
|
|
4865
|
+
guard: "isDigitalIdRedirectSelected",
|
|
4866
|
+
actions: ["setSelectedDocument"]
|
|
4867
|
+
},
|
|
4868
|
+
{
|
|
4869
|
+
target: "digitalIdUpload",
|
|
4870
|
+
guard: "isDigitalIdUploadSelected",
|
|
4871
|
+
actions: ["setSelectedDocument"]
|
|
4872
|
+
},
|
|
4873
|
+
{
|
|
4874
|
+
target: "ageVerification",
|
|
4875
|
+
guard: "hasAgeAssurance",
|
|
4876
|
+
actions: ["setSelectedDocument", "setCurrentMode"]
|
|
4877
|
+
},
|
|
4878
|
+
{
|
|
4879
|
+
target: "tutorial",
|
|
4880
|
+
guard: "hasShowTutorial",
|
|
4881
|
+
actions: ["setSelectedDocument", "setCurrentMode"]
|
|
4882
|
+
},
|
|
4883
|
+
{
|
|
4884
|
+
target: "loading",
|
|
4885
|
+
actions: ["setSelectedDocument", "setCurrentMode"]
|
|
4886
|
+
}
|
|
4887
|
+
]
|
|
4888
|
+
} },
|
|
4513
4889
|
ageVerification: {
|
|
4514
4890
|
entry: "startProtectedMetadataPreparation",
|
|
4515
4891
|
on: { NEXT_STEP: [{
|
|
@@ -4824,6 +5200,11 @@ const idCaptureMachine = setup({
|
|
|
4824
5200
|
guard: "isProtectedUploadFailure",
|
|
4825
5201
|
actions: "setProtectedUploadFailure"
|
|
4826
5202
|
},
|
|
5203
|
+
{
|
|
5204
|
+
target: "#idCapture.permissions.denied",
|
|
5205
|
+
guard: "isProtectedAcquireDenied",
|
|
5206
|
+
actions: assign({ permissionResult: () => "denied" })
|
|
5207
|
+
},
|
|
4827
5208
|
{
|
|
4828
5209
|
target: "#idCapture.error",
|
|
4829
5210
|
actions: "setProtectedFailure"
|
|
@@ -5475,6 +5856,11 @@ const idCaptureMachine = setup({
|
|
|
5475
5856
|
target: "digitalIdRedirect",
|
|
5476
5857
|
actions: ["storePendingDigitalIdRedirect"]
|
|
5477
5858
|
},
|
|
5859
|
+
{
|
|
5860
|
+
target: "detectingCountry",
|
|
5861
|
+
guard: and(["hasShowDocumentChooser", "needsCountryDetection"]),
|
|
5862
|
+
actions: ["clearDigitalIdAttempt"]
|
|
5863
|
+
},
|
|
5478
5864
|
{
|
|
5479
5865
|
target: "chooser",
|
|
5480
5866
|
guard: "hasShowDocumentChooser",
|
|
@@ -5485,14 +5871,22 @@ const idCaptureMachine = setup({
|
|
|
5485
5871
|
actions: ["clearDigitalIdAttempt"]
|
|
5486
5872
|
}
|
|
5487
5873
|
],
|
|
5488
|
-
onError: [
|
|
5489
|
-
|
|
5490
|
-
|
|
5491
|
-
|
|
5492
|
-
|
|
5493
|
-
|
|
5494
|
-
|
|
5495
|
-
|
|
5874
|
+
onError: [
|
|
5875
|
+
{
|
|
5876
|
+
target: "detectingCountry",
|
|
5877
|
+
guard: and(["hasShowDocumentChooser", "needsCountryDetection"]),
|
|
5878
|
+
actions: ["clearDigitalIdAttempt"]
|
|
5879
|
+
},
|
|
5880
|
+
{
|
|
5881
|
+
target: "chooser",
|
|
5882
|
+
guard: "hasShowDocumentChooser",
|
|
5883
|
+
actions: ["clearDigitalIdAttempt"]
|
|
5884
|
+
},
|
|
5885
|
+
{
|
|
5886
|
+
target: "loading",
|
|
5887
|
+
actions: ["clearDigitalIdAttempt"]
|
|
5888
|
+
}
|
|
5889
|
+
]
|
|
5496
5890
|
},
|
|
5497
5891
|
on: { QUIT: { target: "closed" } }
|
|
5498
5892
|
},
|
|
@@ -5525,17 +5919,31 @@ const idCaptureMachine = setup({
|
|
|
5525
5919
|
{
|
|
5526
5920
|
guard: "isDigitalIdRedirectCompleted",
|
|
5527
5921
|
target: "#idCapture.finished",
|
|
5528
|
-
actions: ["storeDigitalIdRedirectResult"]
|
|
5922
|
+
actions: ["storeDigitalIdRedirectResult", "clearPendingDigitalIdRedirect"]
|
|
5923
|
+
},
|
|
5924
|
+
{
|
|
5925
|
+
target: "closed",
|
|
5926
|
+
guard: "isSoleDigitalIdRedirectWithoutChooser",
|
|
5927
|
+
actions: ["clearPendingDigitalIdRedirect"]
|
|
5928
|
+
},
|
|
5929
|
+
{
|
|
5930
|
+
target: "detectingCountry",
|
|
5931
|
+
guard: and(["hasShowDocumentChooser", "needsCountryDetection"]),
|
|
5932
|
+
actions: ["clearPendingDigitalIdRedirect"]
|
|
5529
5933
|
},
|
|
5530
5934
|
{
|
|
5531
5935
|
target: "chooser",
|
|
5532
|
-
guard: "hasShowDocumentChooser"
|
|
5936
|
+
guard: "hasShowDocumentChooser",
|
|
5937
|
+
actions: ["clearPendingDigitalIdRedirect"]
|
|
5533
5938
|
},
|
|
5534
|
-
{
|
|
5939
|
+
{
|
|
5940
|
+
target: "closed",
|
|
5941
|
+
actions: ["clearPendingDigitalIdRedirect"]
|
|
5942
|
+
}
|
|
5535
5943
|
],
|
|
5536
5944
|
onError: {
|
|
5537
5945
|
target: "#idCapture.error",
|
|
5538
|
-
actions: assign({ error: ({ event }) => String(event.error) })
|
|
5946
|
+
actions: [assign({ error: ({ event }) => String(event.error) }), "clearPendingDigitalIdRedirect"]
|
|
5539
5947
|
}
|
|
5540
5948
|
},
|
|
5541
5949
|
on: {
|
|
@@ -5615,4 +6023,4 @@ function provideIdProtectedCaptureController(machine, controller) {
|
|
|
5615
6023
|
});
|
|
5616
6024
|
}
|
|
5617
6025
|
//#endregion
|
|
5618
|
-
export { mapDeviceWalletScreenName as _,
|
|
6026
|
+
export { mapDeviceWalletScreenName as _, createIdProtectedCaptureController as a, hasOnCaptureCallback as c, DIGITAL_ID_REGISTRY as d, isRedirectFlowType as f, BrowserDigitalCredentialsProvider as g, createDeviceWalletManager as h, createIdCaptureOnlyDeliveryActor as i, pickIdCaptureOnlyConfig as l, renderWallet as m, provideIdProtectedCaptureController as n, findIdProtectedCaptureController as o, resolveDigitalIdImplementation as p, attachIdProtectedCaptureController as r, captureOnlyNeedsBack as s, idCaptureMachine as t, DIGITAL_ID_DOCUMENT_TYPES as u, resolveWalletPlatform as v };
|