@incodetech/core 2.4.0-rc.4 → 2.4.1-agentic
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/{FaceDetectionProvider-CzQEFzP8.esm.js → FaceDetectionProvider-B83VmClw.esm.js} +29 -64
- package/dist/IBrowserEnvironmentCapability-D7JG7ML3.esm.js +16 -0
- package/dist/IGeolocationCapability-r49Qo7rR.d.ts +10 -0
- package/dist/{IWasmUtilCapability-GF2n7sfm.d.ts → IWasmUtilCapability-Cqiaxydi.d.ts} +31 -4
- package/dist/{PhoneValidationProvider-SZiOS0jB.esm.js → PhoneValidationProvider-Co4zk2en.esm.js} +7 -0
- package/dist/{StreamCanvasCapture-7JRf-2ck.d.ts → StreamCanvasCapture-C3xNfOsv.d.ts} +12 -3
- package/dist/{WasmUtilProvider-DtJuBdt-.esm.js → WasmUtilProvider-GTkoJyFY.esm.js} +75 -22
- package/dist/{addressSearch-DPjIKJrX.esm.js → addressSearch-41sMcnJk.esm.js} +72 -31
- package/dist/{advanceableErrors-q_pfU3Cn.esm.js → advanceableErrors-k-U-cL5m.esm.js} +1 -2
- package/dist/ae-signature.esm.js +1 -1
- package/dist/antifraud.esm.js +2 -2
- package/dist/{antifraudManager-CaweCYnY.esm.js → antifraudManager-CQ08atTC.esm.js} +2 -2
- package/dist/{antifraudStateMachine-DRl0UVyA.esm.js → antifraudStateMachine-BcsUTTIr.esm.js} +1 -1
- package/dist/{api-Cz90EHyu.esm.js → api-BO8JA7Pf.esm.js} +6 -5
- package/dist/{apiError-B_uY7RO6.esm.js → apiError-CfuIvnUy.esm.js} +1 -1
- package/dist/attemptCarry-BjTJ6bMQ.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-C-cOki0Y.d.ts} +1 -1
- package/dist/{authenticationManager-CSHZQTlb.esm.js → authenticationManager-DvmklBTE.esm.js} +5 -5
- package/dist/{authenticationStateMachine-DrO14KyC.esm.js → authenticationStateMachine-BL2ptOA0.esm.js} +3 -3
- package/dist/{backCameraStream-CMvXj4X4.esm.js → backCameraStream-C5_NNfUN.esm.js} +3 -43
- package/dist/{browser-DlFgHpoC-DnyrCR8r.esm.js → browser-pQZA35G2-DtkAf6sn.esm.js} +161 -150
- package/dist/{camera-sIa9ceW2.esm.js → camera-E_Kcre4O.esm.js} +15 -23
- package/dist/camera.esm.js +1 -1
- package/dist/certificate-issuance.esm.js +2 -2
- package/dist/{certificateIssuanceManager-BfeMv2PU.esm.js → certificateIssuanceManager-CM0fuqDC.esm.js} +2 -2
- package/dist/{certificateIssuanceStateMachine-Frgjbjw8.esm.js → certificateIssuanceStateMachine-kksIUOPD.esm.js} +2 -2
- package/dist/cnpj-Co1ottYN.esm.js +77 -0
- package/dist/connectivity-HSl0diCx.esm.js +133 -0
- package/dist/consent.d.ts +1 -1
- package/dist/consent.esm.js +2 -2
- package/dist/{consentManager-CvEu8h_W.esm.js → consentManager-CBwFozhv.esm.js} +4 -3
- package/dist/{consentManager-Cv_0QKLD.d.ts → consentManager-_q9yJUku.d.ts} +14 -7
- package/dist/{consentStateMachine-DJTgN_-1.esm.js → consentStateMachine-CpmRAcr2.esm.js} +20 -7
- package/dist/cross-document-data-match.esm.js +1 -1
- package/dist/{crossDocumentDataMatchManager-Cu141CE8.esm.js → crossDocumentDataMatchManager-64O8t10a.esm.js} +2 -2
- package/dist/curp-validation.d.ts +1 -1
- package/dist/curp-validation.esm.js +2 -2
- package/dist/{curpValidationManager-B-z9q5V3.esm.js → curpValidationManager-CLgJQcx0.esm.js} +3 -2
- package/dist/{curpValidationManager-C9sqoh9n.d.ts → curpValidationManager-CXpFE-Mv.d.ts} +1 -1
- package/dist/{curpValidationStateMachine-vDEFLMPw.esm.js → curpValidationStateMachine-Bx9YhVkJ.esm.js} +28 -20
- package/dist/custom-fields.esm.js +1 -1
- package/dist/custom-watchlist.esm.js +2 -2
- package/dist/{customFieldsManager-D1ex2cFM.esm.js → customFieldsManager-DWt_0YtJ.esm.js} +2 -2
- package/dist/{customWatchlistManager-CTI-SGk0.esm.js → customWatchlistManager-D8o-2Nej.esm.js} +2 -2
- package/dist/{customWatchlistStateMachine-hmRd0f2I.esm.js → customWatchlistStateMachine-Sbi6DIcK.esm.js} +1 -1
- package/dist/{deepsightLoader-DkrG5zbN.esm.js → deepsightLoader-DMxtowCm.esm.js} +6 -28
- package/dist/{deepsightService-BrltL1DF.esm.js → deepsightService-twg3bXqY.esm.js} +20 -59
- package/dist/{createCameraCycleOwnership-Dj_LHUvN.esm.js → desktopCameraElection-kHY2IDJi.esm.js} +177 -40
- package/dist/device.esm.js +2 -2
- package/dist/document-capture.d.ts +2 -2
- package/dist/document-capture.esm.js +2 -2
- package/dist/{documentCaptureManager-DkyDtm3Y.d.ts → documentCaptureManager-6tnnDkMX.d.ts} +14 -2
- package/dist/{documentCaptureManager-DUJwpKC5.esm.js → documentCaptureManager-CMSC_Mhd.esm.js} +26 -19
- package/dist/{documentCaptureStateMachine-B8i7GnLh.esm.js → documentCaptureStateMachine-BCwD5Rto.esm.js} +43 -35
- package/dist/dynamic-forms.d.ts +2 -2
- package/dist/dynamic-forms.esm.js +2 -2
- package/dist/{dynamicFormsManager-C0dHs1ty.d.ts → dynamicFormsManager-9kwY8Bf5.d.ts} +1 -1
- package/dist/{dynamicFormsManager-D7Xnjm7B.esm.js → dynamicFormsManager-DU6W1e20.esm.js} +2 -2
- package/dist/{dynamicFormsStateMachine-Cgk0VPP4.esm.js → dynamicFormsStateMachine-C8Z7k3vo.esm.js} +2 -2
- package/dist/ekyb.d.ts +4 -4
- package/dist/ekyb.esm.js +3 -3
- package/dist/{ekybManager-BaZ_7CEu.d.ts → ekybManager-TB6ZG5lX.d.ts} +2 -2
- package/dist/{ekybManager-yj_Y36jM.esm.js → ekybManager-TGfqyjuu.esm.js} +2 -2
- package/dist/{ekybStateMachine-DIRBMkaD.esm.js → ekybStateMachine-DBgFuEPK.esm.js} +26 -44
- package/dist/ekyc.d.ts +3 -3
- package/dist/ekyc.esm.js +3 -3
- package/dist/{ekycManager-DW-ynodd.d.ts → ekycManager-BSQteIfC.d.ts} +1 -1
- package/dist/{ekycManager-BO-Lui3t.esm.js → ekycManager-C2cgG2Pl.esm.js} +2 -2
- package/dist/ekycStateMachine-CuNF7z4O.esm.js +7505 -0
- package/dist/ekycUtils-BFncpC4F.esm.js +1401 -0
- package/dist/electronic-signature.esm.js +1 -1
- package/dist/{electronicSignatureManager-Btsa7Prh.esm.js → electronicSignatureManager-C7pqXsRm.esm.js} +4 -4
- package/dist/email.esm.js +2 -2
- package/dist/{emailManager-ButFktRm.esm.js → emailManager-FH_CP0cT.esm.js} +2 -2
- package/dist/{emailStateMachine-BXtlC0NV.esm.js → emailStateMachine-Cx-uTaBV.esm.js} +32 -20
- package/dist/{events-Du2A4-Qr.esm.js → events-CQteqXfy.esm.js} +2 -2
- package/dist/events.esm.js +1 -1
- package/dist/extensibility.d.ts +35 -21
- package/dist/extensibility.esm.js +34 -34
- 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-1hzeS_rB.d.ts → faceCaptureManagerFactory-C-xKdj-d.d.ts} +71 -66
- package/dist/{faceCaptureManagerFactory-CdDfnyyb.esm.js → faceCaptureManagerFactory-CBm05KnT.esm.js} +4 -4
- package/dist/{faceCaptureSetup-CCucWLdy.esm.js → faceCaptureSetup-BQjCbL51.esm.js} +82 -64
- package/dist/{faceMatchManager-DWFUQjMQ.esm.js → faceMatchManager-B2zp7yP4.esm.js} +2 -2
- package/dist/{faceMatchManager-DIgG-UFS.d.ts → faceMatchManager-Z4UDLwAv.d.ts} +16 -7
- package/dist/{faceMatchStateMachine-CUCvlydD.esm.js → faceMatchStateMachine-ByTMQCUC.esm.js} +40 -27
- package/dist/{feature-management-DCD0I_XZ.esm.js → feature-management-DjAG5lsJ.esm.js} +1 -1
- package/dist/feature-management.esm.js +1 -1
- package/dist/field-comparison.esm.js +1 -1
- package/dist/{fieldComparisonManager-v3knTYV_.esm.js → fieldComparisonManager-CC0vKmpf.esm.js} +2 -2
- package/dist/fiscal-qr.esm.js +1 -1
- package/dist/{fiscalQrManager-Dt9fHG7h.esm.js → fiscalQrManager-Be-r4oZj.esm.js} +4 -4
- package/dist/flow-events.d.ts +1 -1
- package/dist/flow.d.ts +10 -10
- package/dist/flow.esm.js +8 -11
- package/dist/{flowCompletionService-xFODSJEq.esm.js → flowCompletionService-ChMU2v79.esm.js} +2 -2
- package/dist/{flowServices-COMEf-WP.esm.js → flowServices-g2tVWsJl.esm.js} +8 -50
- package/dist/geolocation.d.ts +1 -1
- package/dist/geolocation.esm.js +2 -2
- package/dist/{geolocationManager-Dn24g1fl.d.ts → geolocationManager-6e1i9UIR.d.ts} +15 -17
- package/dist/{geolocationManager-B2C2yfrn.esm.js → geolocationManager-DLbvZwUB.esm.js} +6 -8
- package/dist/{geolocationStateMachine-Dbg9jw62.esm.js → geolocationStateMachine-CAJVongM.esm.js} +12 -8
- package/dist/{getDeviceClass-bsWdEDxP.esm.js → getDeviceClass-DoIWuKI8.esm.js} +1 -1
- package/dist/government-validation.esm.js +2 -2
- package/dist/{governmentValidationManager-BtXWHICu.esm.js → governmentValidationManager-CkX9TEkh.esm.js} +2 -2
- package/dist/{governmentValidationStateMachine-COL-Vs48.esm.js → governmentValidationStateMachine-PTPCP26N.esm.js} +1 -1
- package/dist/home.d.ts +1 -1
- package/dist/home.esm.js +1 -1
- package/dist/http.esm.js +1 -1
- package/dist/id-ocr.esm.js +2 -2
- package/dist/id-selfie-flow.d.ts +1 -1
- package/dist/id-selfie-flow.esm.js +9 -9
- package/dist/id-verification.esm.js +2 -2
- package/dist/id.d.ts +3 -16
- package/dist/id.esm.js +3 -3
- package/dist/{idCaptureDefaults-BGsG2OAs.esm.js → idCaptureDefaults-MSQoqScU.esm.js} +3 -3
- package/dist/{idCaptureManager-0M02hSuC.d.ts → idCaptureManager-DzTfQ1Am.d.ts} +66 -5
- package/dist/{idCaptureManager-DZtgScdd.esm.js → idCaptureManager-zZdTcpG1.esm.js} +63 -17
- package/dist/{idCaptureServices-mpibFz4U.esm.js → idCaptureServices-8OHinO0N.esm.js} +9 -9
- package/dist/{idCaptureStateMachine-DWJOHeGn.esm.js → idCaptureStateMachine-B3G6XoDG.esm.js} +914 -536
- package/dist/{idOcrManager-D3-HNMXP.esm.js → idOcrManager-B64-fjWg.esm.js} +2 -2
- package/dist/{idOcrStateMachine-DyENX6Ki.esm.js → idOcrStateMachine-B1aZnobs.esm.js} +2 -2
- package/dist/{idVerificationManager-iWz7Avkr.esm.js → idVerificationManager-_Kebv-Ue.esm.js} +2 -2
- package/dist/{idVerificationStateMachine-CL1kUdBe.esm.js → idVerificationStateMachine-DQn6c84z.esm.js} +1 -1
- package/dist/identity-reuse.d.ts +1 -1
- package/dist/identity-reuse.esm.js +2 -2
- package/dist/{identityReuseManager-CD1ucp1d.esm.js → identityReuseManager-DDXkNVZi.esm.js} +2 -2
- package/dist/{identityReuseManager-B1birg5X.d.ts → identityReuseManager-ooAbp6Kc.d.ts} +4 -4
- package/dist/{identityReuseStateMachine-DfV81wQC.esm.js → identityReuseStateMachine-Bcnkbjf8.esm.js} +1 -1
- package/dist/{index-BKOWUhxG.d.ts → index-DEfwds5y.d.ts} +55 -8
- package/dist/{index-CKQ9QBZP.d.ts → index-DMDAk85K.d.ts} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/{invokeOnCaptureCallback-DYrkOXO6.esm.js → invokeOnCaptureCallback-CXIBwBeE.esm.js} +1 -1
- package/dist/mandatory-consent.d.ts +2 -2
- package/dist/mandatory-consent.esm.js +2 -2
- package/dist/{mandatoryConsentManager-Cwqx1nK7.esm.js → mandatoryConsentManager-43W5d_8G.esm.js} +4 -3
- package/dist/{mandatoryConsentManager-okPILEru.d.ts → mandatoryConsentManager-xx3mY-xw.d.ts} +13 -6
- package/dist/{mandatoryConsentStateMachine-pXWqAHo_.esm.js → mandatoryConsentStateMachine-CVlgdlnt.esm.js} +20 -7
- package/dist/{multipartRecordingService-CLwrF5wD.esm.js → multipartRecordingService-DMBxHKS2.esm.js} +3 -13
- package/dist/nationalIds-B91f_RuB.esm.js +99 -0
- package/dist/{permissionGuards-gcy3U0SL.esm.js → permissionGuards-B3OPL8Si.esm.js} +1 -1
- package/dist/{permissionServices-Ca-tSNhT.esm.js → permissionServices-DnBAN_hW.esm.js} +4 -4
- 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/{phoneManager-BO-LTih5.d.ts → phoneManager-6nrJkvkG.d.ts} +5 -0
- package/dist/{phoneManager-KKUq-Vgo.esm.js → phoneManager-C6jut_pz.esm.js} +3 -3
- package/dist/{phoneStateMachine-D2QWS2cu.esm.js → phoneStateMachine-T1-drWfG.esm.js} +37 -25
- 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-BWme3kVV.esm.js +21 -0
- package/dist/qe-signature.esm.js +1 -1
- 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-BJXC6Kx9.esm.js} +4 -3
- package/dist/{redirectToMobileManager-CVsvpVbQ.d.ts → redirectToMobileManager-Dm9ctRCC.d.ts} +3 -1
- package/dist/{redirectToMobileStateMachine-b-H-ipGM.esm.js → redirectToMobileStateMachine-BBMAc2Gb.esm.js} +27 -6
- package/dist/{runChildModule-C09a9ACV.esm.js → runChildModule-DPHTqSdF.esm.js} +3 -3
- package/dist/{sdkVersion-xE2xE2_9.esm.js → sdkVersion-C3_P-Qbq.esm.js} +1 -1
- package/dist/selfie.d.ts +4 -4
- package/dist/selfie.esm.js +10 -10
- package/dist/{selfieErrorUtils-CoXIxVCy.esm.js → selfieErrorUtils-BL0BLMnp.esm.js} +1 -1
- package/dist/{selfieManager-BJdNu_nd.d.ts → selfieManager-BMmpUii2.d.ts} +1 -1
- package/dist/{selfieManager-RcVUu1KJ.esm.js → selfieManager-Cbliomv7.esm.js} +5 -5
- package/dist/{selfieStateMachine-nWbIRIBD.esm.js → selfieStateMachine-B5m_Kn0O.esm.js} +3 -3
- package/dist/{session-Cr4IVgYu.esm.js → session-DAaAewMX.esm.js} +77 -9
- package/dist/session.d.ts +96 -10
- package/dist/session.esm.js +7 -6
- package/dist/{sessionInitializer-c3CChZts.esm.js → sessionInitializer-CWFT4dfw.esm.js} +402 -202
- package/dist/{setup-BvKrAlOo.esm.js → setup-CDAKwTr7.esm.js} +32 -19
- package/dist/{setup-YPKTUCY5.d.ts → setup-D9qt8YVU.d.ts} +2 -2
- package/dist/signature.esm.js +2 -2
- package/dist/{signatureManager-f_dPAGXn.esm.js → signatureManager-BeEVCcsC.esm.js} +2 -2
- package/dist/{signatureStateMachine-C-nUq_oq.esm.js → signatureStateMachine-_1c1vSid.esm.js} +1 -1
- package/dist/{stats-BEvexnKC.esm.js → stats-BpMz-hTP.esm.js} +1 -1
- package/dist/stats.esm.js +1 -1
- package/dist/{tri-xzRLIIMN.esm.js → tri-BajQnjbf.esm.js} +142 -8
- package/dist/tri.d.ts +1 -1
- package/dist/tri.esm-CzTNi5Q_.esm.js +3826 -0
- package/dist/tri.esm.js +1 -1
- package/dist/{trueSightService-BAvhAU7T.esm.js → trueSightService-BujtUIW6.esm.js} +19 -10
- package/dist/trust-graph.esm.js +1 -1
- package/dist/{types-yPH8lAH-.d.ts → types--3HDl2SF.d.ts} +2 -2
- package/dist/types-B2FK_wYb.d.ts +249 -0
- package/dist/types-B9C8W01q.d.ts +34 -0
- package/dist/{types-0L-eFDmr.d.ts → types-C397LhmN.d.ts} +1 -1
- package/dist/types-D9r3zRfY.d.ts +6 -0
- package/dist/{types-DPIDuhut.d.ts → types-DNVzoRvi.d.ts} +2 -1
- package/dist/{types-B6HsSzpk.d.ts → types-DuD8TRJU.d.ts} +3 -2
- package/dist/{types-Ckir_BEs.d.ts → types-PTZHRhGX.d.ts} +1 -1
- package/dist/{types-DUnFZ08M.d.ts → types-ZTZelfbM.d.ts} +2 -2
- package/dist/{types-CK8Jbjkp.d.ts → types-e8fCsvvk.d.ts} +1 -1
- package/dist/{types-BAxn7MpY.d.ts → types-xEEWCx1j.d.ts} +123 -48
- package/dist/{urlUtils-6jsE6rKp.esm.js → urlUtils-eYiyWjh0.esm.js} +4 -1
- package/dist/video-selfie.d.ts +8 -8
- package/dist/video-selfie.esm.js +95 -22
- package/dist/{videoSelfieCameraWarmer-LeE2vbAW.esm.js → videoSelfieCameraWarmer-DjkPpoj_.esm.js} +18 -21
- package/dist/{videoSelfieStepDetector-CGsTltqB.d.ts → videoSelfieStepDetector-RfSmlFFW.d.ts} +9 -4
- package/dist/{warmup-BElYWRh7.esm.js → warmup-BkfxQZsC.esm.js} +175 -11
- package/dist/wasm.d.ts +2 -2
- package/dist/wasm.esm.js +3 -3
- package/dist/{wasmDsFlagSync-CYj5LL9z.esm.js → wasmDsFlagSync-BhU5H2oR.esm.js} +1 -1
- package/dist/wasmMetadataVersionSync-U8EFUr1T.esm.js +27 -0
- package/dist/{wasmWebClient-BjZw_7OB.esm.js → wasmWebClient-DTj9auyA.esm.js} +43 -17
- package/dist/watchlist-for-business.d.ts +2 -1
- package/dist/watchlist-for-business.esm.js +2 -2
- package/dist/watchlist.esm.js +2 -2
- package/dist/{watchlistForBusinessManager-CZZOFkGl.esm.js → watchlistForBusinessManager-CVay6-9A.esm.js} +37 -7
- package/dist/{watchlistForBusinessManager-B3GDPZrr.d.ts → watchlistForBusinessManager-DX2AyM4Y.d.ts} +54 -18
- package/dist/watchlistForBusinessStateMachine-DA6K5na4.esm.js +166 -0
- package/dist/{watchlistManager-DXtX94SN.esm.js → watchlistManager-B8gQ_rw3.esm.js} +2 -2
- package/dist/{watchlistStateMachine-McALifag.esm.js → watchlistStateMachine-CSi_ZhtT.esm.js} +1 -1
- package/dist/workflow.d.ts +5 -2
- package/dist/workflow.esm.js +57 -47
- package/package.json +3 -2
- package/dist/IBrowserEnvironmentCapability-DEaRRk-R.esm.js +0 -9
- package/dist/ekycStateMachine-CDnI_NRq.esm.js +0 -1443
- package/dist/ekycUtils-zY8CdKJL.esm.js +0 -300
- package/dist/thumbmark.esm-CRc0cYvz.esm.js +0 -1242
- package/dist/tri.esm-BIjHhBJ2.esm.js +0 -2620
- 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
|
@@ -1,23 +1,86 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { C as
|
|
4
|
-
import { t as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { n as getTimestamp } from "./IBrowserEnvironmentCapability-D7JG7ML3.esm.js";
|
|
2
|
+
import { n as setWasmMetadataV2Enabled } from "./wasmMetadataVersionSync-U8EFUr1T.esm.js";
|
|
3
|
+
import { C as subscribeEvent, b as getAnalyticsBatcher, y as addEvent } from "./events-CQteqXfy.esm.js";
|
|
4
|
+
import { c as setToken, r as getToken, t as api, u as endpoints } from "./api-BO8JA7Pf.esm.js";
|
|
5
|
+
import { C as noteTokenActivated, _ as isFeatureEnabled, b as noteEnvironment, c as startTrueSightCollection, g as fetchFeatureConfig, u as trueSightLog, v as resetFeatureConfigCache } from "./trueSightService-BujtUIW6.esm.js";
|
|
6
|
+
import { t as SDK_VERSION } from "./sdkVersion-C3_P-Qbq.esm.js";
|
|
7
|
+
import { t as BrowserTimerProvider } from "./BrowserTimerProvider-BXhgNxLt.esm.js";
|
|
8
|
+
import { E as updateFeatureManagementUser } from "./feature-management-DjAG5lsJ.esm.js";
|
|
9
|
+
import { n as flushDeviceStatsQueue, r as resetDeviceStatsQueue } from "./stats-BpMz-hTP.esm.js";
|
|
7
10
|
import { t as getParsedUserAgent } from "./getParsedUserAgent-DhQPeKqw.esm.js";
|
|
8
|
-
import {
|
|
9
|
-
import { a as isIOS } from "./platform-DkcRc9JV.esm.js";
|
|
11
|
+
import { a as isIOS } from "./platform-aPh7gTWh.esm.js";
|
|
10
12
|
import { t as getUserAgent } from "./getBrowser-CBiibsL-.esm.js";
|
|
11
|
-
import {
|
|
13
|
+
import { a as linkSessionWithTRI, i as isTRIStarted, o as readTRIFpSignals } from "./tri-BajQnjbf.esm.js";
|
|
14
|
+
import { i as retryAfterReconnect } from "./connectivity-HSl0diCx.esm.js";
|
|
15
|
+
//#region src/internal/fingerprint/incodeDeviceHash.ts
|
|
16
|
+
function isNonEmptyString(value) {
|
|
17
|
+
return typeof value === "string" && value.trim() !== "";
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Reads the device hash from a PID signal response. The SDK never pairs a
|
|
21
|
+
* hash with an algorithm user-service didn't name, so all three fields must be
|
|
22
|
+
* present.
|
|
23
|
+
*/
|
|
24
|
+
function readIncodeDeviceHash(data) {
|
|
25
|
+
if (typeof data !== "object" || data === null) return null;
|
|
26
|
+
const { deviceHash, algorithmName, algorithmVersion } = data;
|
|
27
|
+
if (!isNonEmptyString(deviceHash) || !isNonEmptyString(algorithmName) || !isNonEmptyString(algorithmVersion)) return null;
|
|
28
|
+
return {
|
|
29
|
+
hash: deviceHash,
|
|
30
|
+
algorithmName,
|
|
31
|
+
algorithmVersion
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function createIncodeDeviceHashWaiter(timer) {
|
|
35
|
+
const pendingByToken = /* @__PURE__ */ new Map();
|
|
36
|
+
function pendingFor(token) {
|
|
37
|
+
let pending = pendingByToken.get(token);
|
|
38
|
+
if (!pending) {
|
|
39
|
+
let settle = () => void 0;
|
|
40
|
+
pending = {
|
|
41
|
+
deviceHash: new Promise((resolve) => {
|
|
42
|
+
settle = resolve;
|
|
43
|
+
}),
|
|
44
|
+
settle
|
|
45
|
+
};
|
|
46
|
+
pendingByToken.set(token, pending);
|
|
47
|
+
}
|
|
48
|
+
return pending;
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
settle(token, deviceHash) {
|
|
52
|
+
pendingFor(token).settle(deviceHash);
|
|
53
|
+
},
|
|
54
|
+
async waitFor(token, timeoutMs) {
|
|
55
|
+
let timeout;
|
|
56
|
+
const timedOut = new Promise((resolve) => {
|
|
57
|
+
timeout = timer.setTimeout(() => resolve(null), Math.max(0, timeoutMs));
|
|
58
|
+
});
|
|
59
|
+
try {
|
|
60
|
+
return await Promise.race([pendingFor(token).deviceHash, timedOut]);
|
|
61
|
+
} finally {
|
|
62
|
+
if (timeout !== void 0) timer.clearTimeout(timeout);
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
reset() {
|
|
66
|
+
pendingByToken.forEach((pending) => pending.settle(null));
|
|
67
|
+
pendingByToken.clear();
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
const incodeDeviceHashWaiter = createIncodeDeviceHashWaiter(BrowserTimerProvider.getInstance());
|
|
72
|
+
//#endregion
|
|
12
73
|
//#region src/internal/fingerprint/fingerprintSignalsReporter.ts
|
|
13
74
|
const START_INTERVIEW_EVENT = "modelLoadEnd";
|
|
14
75
|
const CAPTURE_INTERVIEW_EVENT = "captureAttemptFinished";
|
|
15
|
-
const START_SIGNALS = ["
|
|
76
|
+
const START_SIGNALS = ["device"];
|
|
77
|
+
const MAX_KEPT_SIGNALS = 20;
|
|
16
78
|
function createFingerprintSignalsReporter(deps) {
|
|
17
79
|
let enabled = true;
|
|
18
80
|
let sessionActive = false;
|
|
19
81
|
let wasmReady = false;
|
|
20
82
|
let started = false;
|
|
83
|
+
let pidStarted = false;
|
|
21
84
|
let pendingStartSignals = START_SIGNALS;
|
|
22
85
|
let prefetchStarted = false;
|
|
23
86
|
let deviceDataUpdated = true;
|
|
@@ -26,6 +89,21 @@ function createFingerprintSignalsReporter(deps) {
|
|
|
26
89
|
let optInPending = false;
|
|
27
90
|
let queue = Promise.resolve();
|
|
28
91
|
let generation = 0;
|
|
92
|
+
let keptSignals = [];
|
|
93
|
+
let forward = null;
|
|
94
|
+
let forwardRefused = false;
|
|
95
|
+
function keepOrForward(metadata) {
|
|
96
|
+
if (forward) {
|
|
97
|
+
if (!forward(metadata)) {
|
|
98
|
+
forward = null;
|
|
99
|
+
forwardRefused = true;
|
|
100
|
+
}
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
if (forwardRefused) return;
|
|
104
|
+
keptSignals.push(metadata);
|
|
105
|
+
if (keptSignals.length > MAX_KEPT_SIGNALS) keptSignals.shift();
|
|
106
|
+
}
|
|
29
107
|
function enqueue(work) {
|
|
30
108
|
const scheduledGeneration = generation;
|
|
31
109
|
queue = queue.then(async () => {
|
|
@@ -34,13 +112,24 @@ function createFingerprintSignalsReporter(deps) {
|
|
|
34
112
|
});
|
|
35
113
|
}
|
|
36
114
|
async function send(token, interviewEvent, type) {
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
metadata
|
|
43
|
-
|
|
115
|
+
const isPid = type === "pid";
|
|
116
|
+
let deviceHash = null;
|
|
117
|
+
try {
|
|
118
|
+
const metadata = await (await deps.getWasmUtil()).getFingerprintSignals(type);
|
|
119
|
+
if (!metadata || deps.getToken() !== token) return;
|
|
120
|
+
keepOrForward(metadata);
|
|
121
|
+
const response = await deps.post(endpoints.deviceFingerprintSignals, isPid ? {
|
|
122
|
+
interviewEvent,
|
|
123
|
+
metadata,
|
|
124
|
+
deviceHashRequested: true
|
|
125
|
+
} : {
|
|
126
|
+
interviewEvent,
|
|
127
|
+
metadata
|
|
128
|
+
}, { "X-Incode-Hardware-Id": token });
|
|
129
|
+
deviceHash = isPid && enabled ? readIncodeDeviceHash(response) : null;
|
|
130
|
+
} finally {
|
|
131
|
+
if (isPid) deps.onDeviceHash(token, deviceHash);
|
|
132
|
+
}
|
|
44
133
|
}
|
|
45
134
|
/**
|
|
46
135
|
* Sends `types` in order and stops at the first failure. Resolves to the
|
|
@@ -98,6 +187,7 @@ function createFingerprintSignalsReporter(deps) {
|
|
|
98
187
|
if (!token) return;
|
|
99
188
|
startPrefetch();
|
|
100
189
|
if (optInPending) enqueue(applyNativeOptIn);
|
|
190
|
+
startPid(token);
|
|
101
191
|
if (started || !sessionActive) return;
|
|
102
192
|
started = true;
|
|
103
193
|
ensureSubscribed();
|
|
@@ -117,6 +207,38 @@ function createFingerprintSignalsReporter(deps) {
|
|
|
117
207
|
if (unsent.length > 0) allowRetry(unsent);
|
|
118
208
|
});
|
|
119
209
|
}
|
|
210
|
+
/**
|
|
211
|
+
* PID goes ahead of activation: the activation post waits for the pid. It is
|
|
212
|
+
* queued before DEVICE, so it still precedes it.
|
|
213
|
+
*/
|
|
214
|
+
function startPid(token) {
|
|
215
|
+
if (pidStarted) return;
|
|
216
|
+
pidStarted = true;
|
|
217
|
+
const pidGeneration = generation;
|
|
218
|
+
enqueue(async () => {
|
|
219
|
+
if ((await sendAll(token, START_INTERVIEW_EVENT, ["pid"])).length > 0 && pidGeneration === generation) pidStarted = false;
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
/** Resolves the pid user-service returned for a host's PID, or `null`. */
|
|
223
|
+
async function postHostPid(token, readPid) {
|
|
224
|
+
try {
|
|
225
|
+
const metadata = await readPid();
|
|
226
|
+
if (!metadata || deps.getToken() !== token) return null;
|
|
227
|
+
const response = await deps.post(endpoints.deviceFingerprintSignals, {
|
|
228
|
+
interviewEvent: START_INTERVIEW_EVENT,
|
|
229
|
+
metadata,
|
|
230
|
+
deviceHashRequested: true
|
|
231
|
+
}, { "X-Incode-Hardware-Id": token });
|
|
232
|
+
return enabled ? readIncodeDeviceHash(response) : null;
|
|
233
|
+
} catch (error) {
|
|
234
|
+
deps.reportFailure({
|
|
235
|
+
message: error instanceof Error ? error.message : String(error),
|
|
236
|
+
signalsType: "pid",
|
|
237
|
+
interviewEvent: START_INTERVIEW_EVENT
|
|
238
|
+
});
|
|
239
|
+
return null;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
120
242
|
function onCaptureAttemptFinished() {
|
|
121
243
|
wasmReady = true;
|
|
122
244
|
tryStart();
|
|
@@ -142,6 +264,7 @@ function createFingerprintSignalsReporter(deps) {
|
|
|
142
264
|
generation += 1;
|
|
143
265
|
sessionActive = false;
|
|
144
266
|
started = false;
|
|
267
|
+
pidStarted = false;
|
|
145
268
|
pendingStartSignals = START_SIGNALS;
|
|
146
269
|
optInPending = false;
|
|
147
270
|
deviceDataUpdated = true;
|
|
@@ -173,6 +296,32 @@ function createFingerprintSignalsReporter(deps) {
|
|
|
173
296
|
onCameraInfoUpdated() {
|
|
174
297
|
deviceDataUpdated = true;
|
|
175
298
|
},
|
|
299
|
+
sendHostPid(token, readPid) {
|
|
300
|
+
if (!enabled || pidStarted) return Promise.resolve(false);
|
|
301
|
+
pidStarted = true;
|
|
302
|
+
const pidGeneration = generation;
|
|
303
|
+
const sent = queue.then(async () => {
|
|
304
|
+
if (pidGeneration !== generation) return false;
|
|
305
|
+
const deviceHash = await postHostPid(token, readPid);
|
|
306
|
+
if (pidGeneration !== generation) return false;
|
|
307
|
+
if (deviceHash) {
|
|
308
|
+
deps.onDeviceHash(token, deviceHash);
|
|
309
|
+
return true;
|
|
310
|
+
}
|
|
311
|
+
pidStarted = false;
|
|
312
|
+
tryStart();
|
|
313
|
+
return false;
|
|
314
|
+
});
|
|
315
|
+
queue = sent.then(() => void 0);
|
|
316
|
+
return sent;
|
|
317
|
+
},
|
|
318
|
+
forwardTo(sink) {
|
|
319
|
+
forward = sink;
|
|
320
|
+
forwardRefused = false;
|
|
321
|
+
const kept = keptSignals;
|
|
322
|
+
keptSignals = [];
|
|
323
|
+
kept.forEach(keepOrForward);
|
|
324
|
+
},
|
|
176
325
|
resetSession,
|
|
177
326
|
reset() {
|
|
178
327
|
resetSession();
|
|
@@ -181,16 +330,19 @@ function createFingerprintSignalsReporter(deps) {
|
|
|
181
330
|
prefetchStarted = false;
|
|
182
331
|
unsubscribe?.();
|
|
183
332
|
unsubscribe = null;
|
|
333
|
+
keptSignals = [];
|
|
334
|
+
forward = null;
|
|
335
|
+
forwardRefused = false;
|
|
184
336
|
}
|
|
185
337
|
};
|
|
186
338
|
}
|
|
187
339
|
const fingerprintSignalsReporter = createFingerprintSignalsReporter({
|
|
188
340
|
getWasmUtil: async () => {
|
|
189
|
-
|
|
190
|
-
return WasmUtilProvider.getInstance();
|
|
341
|
+
return (await import("./WasmUtilProvider-GTkoJyFY.esm.js").then((n) => n.n)).WasmUtilProvider.getInstance();
|
|
191
342
|
},
|
|
192
343
|
getToken: () => getToken(),
|
|
193
|
-
post: (url, body, headers) => api.post(url, body, { headers }),
|
|
344
|
+
post: async (url, body, headers) => (await api.post(url, body, { headers })).data,
|
|
345
|
+
onDeviceHash: (token, deviceHash) => incodeDeviceHashWaiter.settle(token, deviceHash),
|
|
194
346
|
subscribe: (listener) => subscribeEvent(listener),
|
|
195
347
|
reportFailure: ({ message, signalsType, interviewEvent }) => trueSightLog("warning", "wasm", "other", `fingerprint signals failed type=${signalsType} event=${interviewEvent} error=${message}`)
|
|
196
348
|
});
|
|
@@ -328,6 +480,55 @@ var BrowserInfoProvider = class {
|
|
|
328
480
|
}
|
|
329
481
|
};
|
|
330
482
|
//#endregion
|
|
483
|
+
//#region ../infra/src/providers/browser/IpifyProvider.ts
|
|
484
|
+
let cachedIp;
|
|
485
|
+
let inFlightLookup;
|
|
486
|
+
/**
|
|
487
|
+
* Resets the module-level IP cache. Intended for tests and full session resets.
|
|
488
|
+
*/
|
|
489
|
+
function resetIpifyCache() {
|
|
490
|
+
cachedIp = void 0;
|
|
491
|
+
inFlightLookup = void 0;
|
|
492
|
+
}
|
|
493
|
+
async function fetchIpFromIpify() {
|
|
494
|
+
if (typeof fetch === "undefined") return "";
|
|
495
|
+
let timeoutId = 0;
|
|
496
|
+
const controller = new AbortController();
|
|
497
|
+
if (AbortSignal.timeout) {
|
|
498
|
+
const signal = AbortSignal.timeout(3e3);
|
|
499
|
+
return (await (await fetch("https://api.ipify.org?format=json", { signal })).json()).ip;
|
|
500
|
+
}
|
|
501
|
+
const timeoutPromise = new Promise((_, reject) => {
|
|
502
|
+
timeoutId = setTimeout(() => {
|
|
503
|
+
controller.abort();
|
|
504
|
+
reject(/* @__PURE__ */ new Error("Request timeout"));
|
|
505
|
+
}, 3e3);
|
|
506
|
+
});
|
|
507
|
+
const fetchPromise = fetch("https://api.ipify.org?format=json", { signal: controller.signal }).then((res) => res.json()).then((data) => data.ip);
|
|
508
|
+
const result = await Promise.race([fetchPromise, timeoutPromise]);
|
|
509
|
+
clearTimeout(timeoutId);
|
|
510
|
+
return result;
|
|
511
|
+
}
|
|
512
|
+
var IpifyProvider = class {
|
|
513
|
+
async getIp() {
|
|
514
|
+
if (cachedIp !== void 0) return cachedIp;
|
|
515
|
+
if (inFlightLookup) return inFlightLookup;
|
|
516
|
+
inFlightLookup = (async () => {
|
|
517
|
+
try {
|
|
518
|
+
const ip = await fetchIpFromIpify();
|
|
519
|
+
cachedIp = ip;
|
|
520
|
+
return ip;
|
|
521
|
+
} catch {
|
|
522
|
+
cachedIp = "";
|
|
523
|
+
return "";
|
|
524
|
+
} finally {
|
|
525
|
+
inFlightLookup = void 0;
|
|
526
|
+
}
|
|
527
|
+
})();
|
|
528
|
+
return inFlightLookup;
|
|
529
|
+
}
|
|
530
|
+
};
|
|
531
|
+
//#endregion
|
|
331
532
|
//#region ../infra/src/device/getDeviceData.ts
|
|
332
533
|
const HIGH_ENTROPY_HINTS = /* @__PURE__ */ new Set([
|
|
333
534
|
"model",
|
|
@@ -425,171 +626,59 @@ async function getDeviceFingerprintInfo() {
|
|
|
425
626
|
}
|
|
426
627
|
}
|
|
427
628
|
//#endregion
|
|
428
|
-
//#region ../infra/src/scheduling/yieldUntilNextPaint.ts
|
|
429
|
-
/**
|
|
430
|
-
* Resolves after the browser has had a chance to commit and paint a queued
|
|
431
|
-
* render.
|
|
432
|
-
*
|
|
433
|
-
* Strategy:
|
|
434
|
-
* - `requestAnimationFrame` callbacks fire BEFORE the paint of the frame
|
|
435
|
-
* they belong to (per the HTML5 "update the rendering" step). If we
|
|
436
|
-
* resolve the promise inside a rAF callback, the await-continuation
|
|
437
|
-
* runs as a microtask immediately after the callback returns — still
|
|
438
|
-
* before the paint phase of that frame. A caller that then blocks the
|
|
439
|
-
* main thread (e.g. synchronous WASM `processPhoto`) starves the paint.
|
|
440
|
-
* - We therefore chain rAF → setTimeout: the rAF fires before frame N's
|
|
441
|
-
* paint, the setTimeout runs as a macrotask scheduled after frame N's
|
|
442
|
-
* "update the rendering" step, which the browser will only get to once
|
|
443
|
-
* the paint actually lands. By the time setTimeout fires, the paint
|
|
444
|
-
* for the queued render is on screen.
|
|
445
|
-
* - In environments where rAF never ticks (jsdom, happy-dom, backgrounded
|
|
446
|
-
* tabs), a parallel `setTimeout` fallback at 100 ms resolves instead.
|
|
447
|
-
* 100 ms is comfortably longer than two real-browser frames so rAF +
|
|
448
|
-
* setTimeout wins reliably in any foregrounded browser. (An earlier
|
|
449
|
-
* implementation raced rAF against a `MessageChannel` macrotask, but
|
|
450
|
-
* MessageChannel drains immediately after the current task's
|
|
451
|
-
* microtasks — before the next paint — so it resolved the promise too
|
|
452
|
-
* early and defeated the whole point of the helper.)
|
|
453
|
-
*
|
|
454
|
-
* Lives in infra because it touches browser APIs (`requestAnimationFrame`,
|
|
455
|
-
* `setTimeout`) that the architecture rules forbid from core. Core modules
|
|
456
|
-
* that need to yield to the browser render loop should import this helper
|
|
457
|
-
* directly via its file path.
|
|
458
|
-
*/
|
|
459
|
-
function yieldUntilNextPaint() {
|
|
460
|
-
return new Promise((resolve) => {
|
|
461
|
-
let resolved = false;
|
|
462
|
-
const done = () => {
|
|
463
|
-
if (resolved) return;
|
|
464
|
-
resolved = true;
|
|
465
|
-
resolve();
|
|
466
|
-
};
|
|
467
|
-
if (typeof requestAnimationFrame === "function") requestAnimationFrame(() => {
|
|
468
|
-
requestAnimationFrame(() => {
|
|
469
|
-
setTimeout(done, 0);
|
|
470
|
-
});
|
|
471
|
-
});
|
|
472
|
-
setTimeout(done, 100);
|
|
473
|
-
});
|
|
474
|
-
}
|
|
475
|
-
//#endregion
|
|
476
|
-
//#region ../infra/src/providers/browser/thumbmarkAdapter.ts
|
|
477
|
-
/**
|
|
478
|
-
* Adapter for @thumbmarkjs/thumbmarkjs. Single point of dependency so bundlers
|
|
479
|
-
* resolve it from infra's node_modules when building apps that depend on core → infra.
|
|
480
|
-
*/
|
|
481
|
-
const THUMBMARK_ALGORITHM = {
|
|
482
|
-
algorithmName: "thumbmarkjs",
|
|
483
|
-
algorithmVersion: "1.6.4"
|
|
484
|
-
};
|
|
485
|
-
/**
|
|
486
|
-
* `logging` must stay disabled. With it on (the upstream default) `getThumbmark()`
|
|
487
|
-
* evaluates a bare, unguarded storage read:
|
|
488
|
-
*
|
|
489
|
-
* options.logging && !sessionStorage.getItem("_tmjs_l") && Math.random() < 1e-4
|
|
490
|
-
*
|
|
491
|
-
* Hosts that delete the bare global as a self-XSS mitigation (`delete
|
|
492
|
-
* window.sessionStorage`) make that a `ReferenceError`, which would cost us the
|
|
493
|
-
* device fingerprint. `logging: false` short-circuits the expression before the
|
|
494
|
-
* read. It also stops upstream's 1-in-10 000 telemetry POST to
|
|
495
|
-
* api.thumbmarkjs.com. Re-check this when bumping the dependency.
|
|
496
|
-
*/
|
|
497
|
-
const THUMBMARK_OPTIONS = {
|
|
498
|
-
logging: false,
|
|
499
|
-
yield: yieldUntilNextPaint
|
|
500
|
-
};
|
|
501
|
-
const lazyThumbmark = BrowserLazyImportProvider.getInstance().create(() => import("./thumbmark.esm-CRc0cYvz.esm.js"), {
|
|
502
|
-
label: "Fingerprint",
|
|
503
|
-
moduleName: "@thumbmarkjs/thumbmarkjs",
|
|
504
|
-
timeoutMs: 1e4,
|
|
505
|
-
disabledMessage: "the device fingerprint is unavailable for this attempt."
|
|
506
|
-
});
|
|
507
|
-
async function getThumbmarkId() {
|
|
508
|
-
const module = await lazyThumbmark.load();
|
|
509
|
-
if (!module) throw new Error("@thumbmarkjs/thumbmarkjs failed to load");
|
|
510
|
-
return (await new module.Thumbmark(THUMBMARK_OPTIONS).get()).thumbmark;
|
|
511
|
-
}
|
|
512
|
-
//#endregion
|
|
513
629
|
//#region ../infra/src/providers/browser/FingerprintProvider.ts
|
|
514
630
|
var FingerprintProvider = class {
|
|
515
|
-
|
|
631
|
+
/**
|
|
632
|
+
* @param readVisitorId - The device id to report, or `null` without one;
|
|
633
|
+
* the result then has an empty `visitorId` and no algorithm fields.
|
|
634
|
+
*/
|
|
635
|
+
constructor(ipLookup, readVisitorId) {
|
|
516
636
|
this.ipLookup = ipLookup;
|
|
517
|
-
|
|
518
|
-
prime() {
|
|
519
|
-
this.startVisitorId();
|
|
520
|
-
}
|
|
521
|
-
startVisitorId() {
|
|
522
|
-
if (!this.visitorIdPromise) {
|
|
523
|
-
this.visitorIdPromise = getThumbmarkId();
|
|
524
|
-
this.visitorIdPromise.catch(() => void 0);
|
|
525
|
-
}
|
|
526
|
-
return this.visitorIdPromise;
|
|
637
|
+
this.readVisitorId = readVisitorId;
|
|
527
638
|
}
|
|
528
639
|
async getFingerprint(disableIpify = false) {
|
|
529
|
-
const
|
|
530
|
-
|
|
640
|
+
const [visitor, deviceInfo, ip] = await Promise.all([
|
|
641
|
+
this.readVisitorId(),
|
|
642
|
+
getDeviceFingerprintInfo(),
|
|
643
|
+
disableIpify ? Promise.resolve("") : this.ipLookup.getIp()
|
|
644
|
+
]);
|
|
531
645
|
return {
|
|
532
|
-
visitorId,
|
|
646
|
+
...visitor ?? { visitorId: "" },
|
|
533
647
|
ip,
|
|
534
|
-
deviceInfo
|
|
535
|
-
...THUMBMARK_ALGORITHM
|
|
648
|
+
deviceInfo
|
|
536
649
|
};
|
|
537
650
|
}
|
|
538
651
|
};
|
|
539
652
|
//#endregion
|
|
540
|
-
//#region
|
|
541
|
-
|
|
542
|
-
let inFlightLookup;
|
|
653
|
+
//#region src/internal/fingerprint/fingerprintApi.ts
|
|
654
|
+
const PID_WAIT_MS = 3e3;
|
|
543
655
|
/**
|
|
544
|
-
*
|
|
656
|
+
* Collects the device fingerprint: device info, the IP, and the Incode pid.
|
|
657
|
+
*
|
|
658
|
+
* `visitorId` is the current session's Incode pid, the device hash
|
|
659
|
+
* user-service returned for the session's PID signal, with the
|
|
660
|
+
* `algorithmName` and `algorithmVersion` it named. While that signal is in
|
|
661
|
+
* flight, this waits up to 3 s for it.
|
|
662
|
+
*
|
|
663
|
+
* Without a session (no token), with `setup({ fingerprint: false })`, or when
|
|
664
|
+
* no pid arrives within 3 s (WASM not loaded, or an older server), `visitorId`
|
|
665
|
+
* is `''` and `algorithmName` and `algorithmVersion` are absent.
|
|
666
|
+
*
|
|
667
|
+
* @param disableIpify - Skip the IP lookup. Defaults to the session's setting.
|
|
545
668
|
*/
|
|
546
|
-
function resetIpifyCache() {
|
|
547
|
-
cachedIp = void 0;
|
|
548
|
-
inFlightLookup = void 0;
|
|
549
|
-
}
|
|
550
|
-
async function fetchIpFromIpify() {
|
|
551
|
-
if (typeof fetch === "undefined") return "";
|
|
552
|
-
let timeoutId = 0;
|
|
553
|
-
const controller = new AbortController();
|
|
554
|
-
if (AbortSignal.timeout) {
|
|
555
|
-
const signal = AbortSignal.timeout(3e3);
|
|
556
|
-
return (await (await fetch("https://api.ipify.org?format=json", { signal })).json()).ip;
|
|
557
|
-
}
|
|
558
|
-
const timeoutPromise = new Promise((_, reject) => {
|
|
559
|
-
timeoutId = setTimeout(() => {
|
|
560
|
-
controller.abort();
|
|
561
|
-
reject(/* @__PURE__ */ new Error("Request timeout"));
|
|
562
|
-
}, 3e3);
|
|
563
|
-
});
|
|
564
|
-
const fetchPromise = fetch("https://api.ipify.org?format=json", { signal: controller.signal }).then((res) => res.json()).then((data) => data.ip);
|
|
565
|
-
const result = await Promise.race([fetchPromise, timeoutPromise]);
|
|
566
|
-
clearTimeout(timeoutId);
|
|
567
|
-
return result;
|
|
568
|
-
}
|
|
569
|
-
var IpifyProvider = class {
|
|
570
|
-
async getIp() {
|
|
571
|
-
if (cachedIp !== void 0) return cachedIp;
|
|
572
|
-
if (inFlightLookup) return inFlightLookup;
|
|
573
|
-
inFlightLookup = (async () => {
|
|
574
|
-
try {
|
|
575
|
-
const ip = await fetchIpFromIpify();
|
|
576
|
-
cachedIp = ip;
|
|
577
|
-
return ip;
|
|
578
|
-
} catch {
|
|
579
|
-
cachedIp = "";
|
|
580
|
-
return "";
|
|
581
|
-
} finally {
|
|
582
|
-
inFlightLookup = void 0;
|
|
583
|
-
}
|
|
584
|
-
})();
|
|
585
|
-
return inFlightLookup;
|
|
586
|
-
}
|
|
587
|
-
};
|
|
588
|
-
//#endregion
|
|
589
|
-
//#region src/internal/fingerprint/fingerprintApi.ts
|
|
590
669
|
async function getFingerprint(disableIpify) {
|
|
591
670
|
const shouldDisableIpify = disableIpify ?? getDisableIpify();
|
|
592
|
-
return new FingerprintProvider(new IpifyProvider()).getFingerprint(shouldDisableIpify);
|
|
671
|
+
return new FingerprintProvider(new IpifyProvider(), readSessionPid).getFingerprint(shouldDisableIpify);
|
|
672
|
+
}
|
|
673
|
+
async function readSessionPid() {
|
|
674
|
+
const token = getToken();
|
|
675
|
+
if (!token || !getFingerprintEnabled()) return null;
|
|
676
|
+
const pid = await incodeDeviceHashWaiter.waitFor(token, PID_WAIT_MS);
|
|
677
|
+
return pid ? {
|
|
678
|
+
visitorId: pid.hash,
|
|
679
|
+
algorithmName: pid.algorithmName,
|
|
680
|
+
algorithmVersion: pid.algorithmVersion
|
|
681
|
+
} : null;
|
|
593
682
|
}
|
|
594
683
|
//#endregion
|
|
595
684
|
//#region src/internal/device/hasLiedBrowser.ts
|
|
@@ -657,25 +746,37 @@ function formatBrowser(browser) {
|
|
|
657
746
|
if (!browser.name || !browser.version) return "Unknown";
|
|
658
747
|
return `${browser.name} ${browser.version}`;
|
|
659
748
|
}
|
|
749
|
+
/**
|
|
750
|
+
* The session's activation post: device data (IP, browser, OS) and, when it
|
|
751
|
+
* arrives in time, the pid as the device hash. Mandatory consent rides on its
|
|
752
|
+
* response.
|
|
753
|
+
*/
|
|
660
754
|
async function submitDeviceFingerprint(options = {}, dependencies) {
|
|
661
755
|
const { disableIpify = false, hostingApp, signal } = options;
|
|
662
756
|
const token = getToken();
|
|
663
|
-
const
|
|
757
|
+
const [deviceInfo, ip, deviceHash] = await Promise.all([
|
|
758
|
+
getDeviceFingerprintInfo(),
|
|
759
|
+
disableIpify ? Promise.resolve("") : dependencies.ipLookup.getIp(),
|
|
760
|
+
dependencies.getDeviceHash?.() ?? null
|
|
761
|
+
]);
|
|
664
762
|
if (getToken() !== token || dependencies.isCurrentSession?.() === false) throw new Error("Session changed during fingerprint collection");
|
|
665
763
|
const hasLiedBrowser = isBrowserSimulation(dependencies.browserEnv);
|
|
666
764
|
const payload = {
|
|
667
|
-
hash:
|
|
668
|
-
ip
|
|
765
|
+
hash: deviceHash?.hash ?? "",
|
|
766
|
+
ip,
|
|
669
767
|
deviceType: "WEBAPP",
|
|
670
|
-
data: JSON.stringify(
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
768
|
+
data: JSON.stringify({
|
|
769
|
+
ip,
|
|
770
|
+
deviceInfo
|
|
771
|
+
}),
|
|
772
|
+
osVersion: formatOsVersion(deviceInfo.os),
|
|
773
|
+
deviceModel: deviceInfo.device.model || "",
|
|
774
|
+
browser: formatBrowser(deviceInfo.browser),
|
|
674
775
|
hasLiedBrowser,
|
|
675
776
|
sdkVersion: SDK_VERSION,
|
|
676
777
|
hostingApp: hostingApp ?? "Web SDK",
|
|
677
|
-
algorithmName:
|
|
678
|
-
algorithmVersion:
|
|
778
|
+
algorithmName: deviceHash?.algorithmName,
|
|
779
|
+
algorithmVersion: deviceHash?.algorithmVersion
|
|
679
780
|
};
|
|
680
781
|
const response = await api.post(endpoints.deviceFingerprint, payload, { signal });
|
|
681
782
|
if (!response.ok) throw new Error(`Failed to submit fingerprint: ${response.status} ${response.statusText}`);
|
|
@@ -718,6 +819,9 @@ let cachedDisableIpify = false;
|
|
|
718
819
|
let clientIpLookupEnabled = true;
|
|
719
820
|
let clientFingerprintEnabled = true;
|
|
720
821
|
let clientHostingApp;
|
|
822
|
+
let clientWasmConfig;
|
|
823
|
+
let clientWasmDisabled = false;
|
|
824
|
+
const DEVICE_HASH_WAIT_MS = 3e3;
|
|
721
825
|
function setClientIpLookupEnabled(enabled) {
|
|
722
826
|
clientIpLookupEnabled = enabled;
|
|
723
827
|
}
|
|
@@ -735,6 +839,69 @@ function setClientFingerprintEnabled(enabled) {
|
|
|
735
839
|
clientFingerprintEnabled = enabled;
|
|
736
840
|
fingerprintSignalsReporter.setEnabled(enabled);
|
|
737
841
|
}
|
|
842
|
+
/**
|
|
843
|
+
* The known WASM config: from `setup({ wasm })`, `setWasmConfig`, or
|
|
844
|
+
* `<incode-flow>` / `<incode-workflow>`, which pass the config their captures
|
|
845
|
+
* load. Activation loads the WASM runtime only when it is known, so headless
|
|
846
|
+
* hosts that never configured WASM don't download it.
|
|
847
|
+
*/
|
|
848
|
+
function setClientWasmConfig(config) {
|
|
849
|
+
clientWasmConfig = config;
|
|
850
|
+
}
|
|
851
|
+
/**
|
|
852
|
+
* `setup({ wasm: false })`: activations load no WASM runtime, so their post
|
|
853
|
+
* sends no device hash, until `setup({ wasm })` or `reset()`.
|
|
854
|
+
*/
|
|
855
|
+
function setClientWasmDisabled(disabled) {
|
|
856
|
+
clientWasmDisabled = disabled;
|
|
857
|
+
}
|
|
858
|
+
/** Why this activation's post won't wait for a pid, if it won't. */
|
|
859
|
+
function deviceHashSkipReason(activationOptedOut) {
|
|
860
|
+
if (activationOptedOut || clientWasmDisabled) return "wasmDisabled";
|
|
861
|
+
return clientWasmConfig || isTRIStarted() ? void 0 : "noWasmConfig";
|
|
862
|
+
}
|
|
863
|
+
/**
|
|
864
|
+
* TRI first: TRI's fpSignals PID is signed with the same key as the runtime's
|
|
865
|
+
* (old signing format, so one string serves every session), so it goes to
|
|
866
|
+
* user-service unchanged as this session's PID and no runtime starts for it.
|
|
867
|
+
* Without a pid back (fpSignals off, blocked or timed out, or a step-up after
|
|
868
|
+
* the tenant's replay window, 11,100 s by default) the runtime starts for the
|
|
869
|
+
* pid as before. Needs TRI's signed `getFpSignals()`: an older TRI's string is
|
|
870
|
+
* unsigned, so user-service returns no pid and the runtime is used.
|
|
871
|
+
*/
|
|
872
|
+
function startSessionPid(token, config) {
|
|
873
|
+
if (!isTRIStarted()) {
|
|
874
|
+
if (config) startSessionWasm(token, config);
|
|
875
|
+
return;
|
|
876
|
+
}
|
|
877
|
+
fingerprintSignalsReporter.sendHostPid(token, async () => (await readTRIFpSignals())?.pid ?? null).then((sent) => {
|
|
878
|
+
if (sent || getToken() !== token) return;
|
|
879
|
+
if (config) startSessionWasm(token, config);
|
|
880
|
+
else incodeDeviceHashWaiter.settle(token, null);
|
|
881
|
+
});
|
|
882
|
+
}
|
|
883
|
+
/**
|
|
884
|
+
* Starts the WASM runtime, without models, so the PID signal can return the
|
|
885
|
+
* pid while activation runs: it is the device hash of the activation post.
|
|
886
|
+
* Capture modules add their pipelines later. A runtime that fails to start
|
|
887
|
+
* ends the post's wait at once.
|
|
888
|
+
*/
|
|
889
|
+
function startSessionWasm(token, config) {
|
|
890
|
+
(async () => {
|
|
891
|
+
try {
|
|
892
|
+
const warmupModule = await import("./warmup-BkfxQZsC.esm.js").then((n) => n.c);
|
|
893
|
+
const warmup = warmupModule.warmupWasm({
|
|
894
|
+
...config,
|
|
895
|
+
pipelines: []
|
|
896
|
+
});
|
|
897
|
+
warmup.catch(() => void 0);
|
|
898
|
+
await Promise.race([warmup, warmupModule.whenWasmRuntimeReady()]);
|
|
899
|
+
fingerprintSignalsReporter.onWasmReady();
|
|
900
|
+
} catch {
|
|
901
|
+
incodeDeviceHashWaiter.settle(token, null);
|
|
902
|
+
}
|
|
903
|
+
})();
|
|
904
|
+
}
|
|
738
905
|
function resolveDisableIpify(serverDisableIpify) {
|
|
739
906
|
return !clientIpLookupEnabled || serverDisableIpify;
|
|
740
907
|
}
|
|
@@ -772,6 +939,14 @@ function createFingerprintSettled() {
|
|
|
772
939
|
function whenSessionFingerprintSettled() {
|
|
773
940
|
return fingerprintSettled?.promise ?? Promise.resolve(cachedFingerprintResult);
|
|
774
941
|
}
|
|
942
|
+
/** Best-effort: the format latch must never fail session initialization. */
|
|
943
|
+
function applyCaptureMetadataFormat(v2Enabled) {
|
|
944
|
+
try {
|
|
945
|
+
setWasmMetadataV2Enabled(v2Enabled);
|
|
946
|
+
} catch (error) {
|
|
947
|
+
trueSightLog("warning", "session", "orchestration", `capture metadata format not applied error=${String(error)}`);
|
|
948
|
+
}
|
|
949
|
+
}
|
|
775
950
|
/**
|
|
776
951
|
* Activates a session by setting the auth token on the HTTP client and
|
|
777
952
|
* preloading session-scoped state.
|
|
@@ -802,7 +977,7 @@ function whenSessionFingerprintSettled() {
|
|
|
802
977
|
* ```
|
|
803
978
|
*/
|
|
804
979
|
async function initializeSession(options = {}) {
|
|
805
|
-
const { token, hostingApp = clientHostingApp, signal, preloadFlow, awaitFingerprint = true } = options;
|
|
980
|
+
const { token, hostingApp = clientHostingApp, signal, preloadFlow, awaitFingerprint = true, wasm } = options;
|
|
806
981
|
let triLinkPromise = Promise.resolve();
|
|
807
982
|
if (token !== void 0 && token !== getToken()) {
|
|
808
983
|
setToken(token);
|
|
@@ -835,32 +1010,37 @@ async function initializeSession(options = {}) {
|
|
|
835
1010
|
}
|
|
836
1011
|
const settled = createFingerprintSettled();
|
|
837
1012
|
fingerprintSettled = settled;
|
|
838
|
-
const
|
|
839
|
-
|
|
1013
|
+
const fingerprintEnabled = clientFingerprintEnabled;
|
|
1014
|
+
const activeToken = getToken();
|
|
1015
|
+
const skipReason = deviceHashSkipReason(wasm === false);
|
|
1016
|
+
if (activeToken && fingerprintEnabled && !skipReason) startSessionPid(activeToken, clientWasmConfig);
|
|
840
1017
|
let fingerprintPromise;
|
|
841
1018
|
sessionInitPromise = (async () => {
|
|
842
1019
|
let features;
|
|
843
1020
|
let serverDisableIpify = false;
|
|
1021
|
+
let captureMetadataV2 = false;
|
|
844
1022
|
try {
|
|
845
|
-
features = await fetchFeatureConfig(signal);
|
|
1023
|
+
features = await retryAfterReconnect(() => fetchFeatureConfig(signal), signal);
|
|
846
1024
|
serverDisableIpify = isFeatureEnabled("DISABLE_IPIFY", features.features);
|
|
1025
|
+
captureMetadataV2 = isFeatureEnabled("DEEPSIGHT_V2", features.features);
|
|
847
1026
|
startTrueSightCollection(features);
|
|
848
1027
|
} catch {
|
|
849
1028
|
features = { sessionIdentifier: "" };
|
|
850
1029
|
trueSightLog("warning", "session", "orchestration", "feature-config fetch failed");
|
|
851
1030
|
startTrueSightCollection();
|
|
852
1031
|
}
|
|
1032
|
+
applyCaptureMetadataFormat(captureMetadataV2);
|
|
853
1033
|
const disableIpify = resolveDisableIpify(serverDisableIpify);
|
|
854
1034
|
const preloadedFlow = await flowPreloadPromise;
|
|
855
1035
|
await updateFeatureManagementUser({ customIDs: {
|
|
856
1036
|
hashed_onboarding_id: features.sessionIdentifier || void 0,
|
|
857
1037
|
flow_id: preloadedFlow?.flowId
|
|
858
1038
|
} });
|
|
859
|
-
fingerprintPromise = submitSessionFingerprint(
|
|
1039
|
+
fingerprintPromise = submitSessionFingerprint(fingerprintEnabled, {
|
|
860
1040
|
disableIpify,
|
|
861
1041
|
hostingApp,
|
|
862
1042
|
signal
|
|
863
|
-
}, settled);
|
|
1043
|
+
}, settled, skipReason);
|
|
864
1044
|
try {
|
|
865
1045
|
const browserInfo = new BrowserInfoProvider().getBrowserInfo();
|
|
866
1046
|
const language = new BrowserEnvironmentProvider().getNavigatorProperty("language");
|
|
@@ -910,25 +1090,43 @@ async function initializeSession(options = {}) {
|
|
|
910
1090
|
* while it still belongs to the current activation (a token change resets
|
|
911
1091
|
* `fingerprintSettled`) and always settles the waiter.
|
|
912
1092
|
*/
|
|
913
|
-
async function submitSessionFingerprint(
|
|
1093
|
+
async function submitSessionFingerprint(enabled, options, settled, skipReason) {
|
|
914
1094
|
const isCurrent = () => fingerprintSettled === settled;
|
|
1095
|
+
const token = getToken();
|
|
1096
|
+
const startedAtMs = getTimestamp();
|
|
1097
|
+
const deadlineMs = startedAtMs + DEVICE_HASH_WAIT_MS;
|
|
1098
|
+
let outcomeLogged = false;
|
|
1099
|
+
const logOutcome = (outcome) => {
|
|
1100
|
+
if (!outcomeLogged) {
|
|
1101
|
+
outcomeLogged = true;
|
|
1102
|
+
trueSightLog("info", "session", "other", `device hash ${outcome}`);
|
|
1103
|
+
}
|
|
1104
|
+
};
|
|
1105
|
+
const getDeviceHash = !skipReason && token ? async () => {
|
|
1106
|
+
const deviceHash = await incodeDeviceHashWaiter.waitFor(token, deadlineMs - getTimestamp());
|
|
1107
|
+
logOutcome(`${deviceHash ? "sent" : "missing"} waitMs=${getTimestamp() - startedAtMs}`);
|
|
1108
|
+
return deviceHash;
|
|
1109
|
+
} : void 0;
|
|
915
1110
|
try {
|
|
916
|
-
if (
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
1111
|
+
if (enabled) {
|
|
1112
|
+
if (skipReason) logOutcome(`skipped reason=${skipReason}`);
|
|
1113
|
+
try {
|
|
1114
|
+
const result = await retryAfterReconnect(() => submitDeviceFingerprint(options, {
|
|
1115
|
+
ipLookup: new IpifyProvider(),
|
|
1116
|
+
browserEnv: new BrowserEnvironmentProvider(),
|
|
1117
|
+
isCurrentSession: isCurrent,
|
|
1118
|
+
getDeviceHash
|
|
1119
|
+
}), options.signal);
|
|
1120
|
+
if (isCurrent()) {
|
|
1121
|
+
cachedFingerprintResult = result;
|
|
1122
|
+
cachedFingerprintSuccess = true;
|
|
1123
|
+
flushDeviceStatsQueue();
|
|
1124
|
+
}
|
|
1125
|
+
} catch (error) {
|
|
1126
|
+
console.warn("Failed to submit device fingerprint:", error);
|
|
1127
|
+
trueSightLog("warning", "session", "other", "device fingerprint submit failed");
|
|
926
1128
|
}
|
|
927
|
-
}
|
|
928
|
-
console.warn("Failed to submit device fingerprint:", error);
|
|
929
|
-
trueSightLog("warning", "session", "other", "device fingerprint submit failed");
|
|
930
|
-
}
|
|
931
|
-
else if (isCurrent()) flushDeviceStatsQueue();
|
|
1129
|
+
} else if (isCurrent()) flushDeviceStatsQueue();
|
|
932
1130
|
} finally {
|
|
933
1131
|
settled.resolve(isCurrent() ? cachedFingerprintResult : void 0);
|
|
934
1132
|
}
|
|
@@ -957,7 +1155,9 @@ function getFingerprintEnabled() {
|
|
|
957
1155
|
* Useful for testing or when starting a new session.
|
|
958
1156
|
*/
|
|
959
1157
|
function resetSessionInit() {
|
|
1158
|
+
applyCaptureMetadataFormat(false);
|
|
960
1159
|
fingerprintSignalsReporter.resetSession();
|
|
1160
|
+
incodeDeviceHashWaiter.reset();
|
|
961
1161
|
sessionInitialized = false;
|
|
962
1162
|
cachedFeatures = null;
|
|
963
1163
|
cachedDisableIpify = false;
|
|
@@ -970,4 +1170,4 @@ function resetSessionInit() {
|
|
|
970
1170
|
resetDeviceStatsQueue();
|
|
971
1171
|
}
|
|
972
1172
|
//#endregion
|
|
973
|
-
export {
|
|
1173
|
+
export { fingerprintSignalsReporter as S, isBrowserSimulation as _, resetSessionInit as a, IpifyProvider as b, setClientIpLookupEnabled as c, whenSessionFingerprintSettled as d, getStandaloneFlowPolicy as f, setStandaloneFlowPolicy as g, resolveStandaloneFlowPolicy as h, initializeSession as i, setClientWasmConfig as l, resetStandaloneFlowPolicy as m, getFingerprintEnabled as n, setClientFingerprintEnabled as o, registerFlowPreloader as p, getSessionFingerprintResult as r, setClientHostingApp as s, getDisableIpify as t, setClientWasmDisabled as u, getFingerprint as v, BrowserEnvironmentProvider as x, getDeviceFingerprintInfo as y };
|