@incodetech/core 2.4.0 → 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.
Files changed (228) hide show
  1. package/dist/{FaceDetectionProvider-DcPOC2gS.esm.js → FaceDetectionProvider-B83VmClw.esm.js} +29 -64
  2. package/dist/IBrowserEnvironmentCapability-D7JG7ML3.esm.js +16 -0
  3. package/dist/IGeolocationCapability-r49Qo7rR.d.ts +10 -0
  4. package/dist/{IWasmUtilCapability-GF2n7sfm.d.ts → IWasmUtilCapability-Cqiaxydi.d.ts} +31 -4
  5. package/dist/{PhoneValidationProvider-SZiOS0jB.esm.js → PhoneValidationProvider-Co4zk2en.esm.js} +7 -0
  6. package/dist/{StreamCanvasCapture-7JRf-2ck.d.ts → StreamCanvasCapture-C3xNfOsv.d.ts} +12 -3
  7. package/dist/{WasmUtilProvider-DtJuBdt-.esm.js → WasmUtilProvider-GTkoJyFY.esm.js} +75 -22
  8. package/dist/{addressSearch-DPjIKJrX.esm.js → addressSearch-41sMcnJk.esm.js} +72 -31
  9. package/dist/{advanceableErrors-q_pfU3Cn.esm.js → advanceableErrors-k-U-cL5m.esm.js} +1 -2
  10. package/dist/ae-signature.esm.js +1 -1
  11. package/dist/antifraud.esm.js +2 -2
  12. package/dist/{antifraudManager-CaweCYnY.esm.js → antifraudManager-CQ08atTC.esm.js} +2 -2
  13. package/dist/{antifraudStateMachine-DRl0UVyA.esm.js → antifraudStateMachine-BcsUTTIr.esm.js} +1 -1
  14. package/dist/{api-Cz90EHyu.esm.js → api-BO8JA7Pf.esm.js} +6 -5
  15. package/dist/{apiError-DPwFas2f.esm.js → apiError-CfuIvnUy.esm.js} +1 -1
  16. package/dist/attemptCarry-BjTJ6bMQ.esm.js +45 -0
  17. package/dist/authentication.d.ts +3 -3
  18. package/dist/authentication.esm.js +2 -2
  19. package/dist/{authenticationManager-BIZC55Bi.d.ts → authenticationManager-C-cOki0Y.d.ts} +1 -1
  20. package/dist/{authenticationManager-2Lr5V_7p.esm.js → authenticationManager-DvmklBTE.esm.js} +5 -5
  21. package/dist/{authenticationStateMachine-C99B0GFP.esm.js → authenticationStateMachine-BL2ptOA0.esm.js} +3 -3
  22. package/dist/{backCameraStream-CMvXj4X4.esm.js → backCameraStream-C5_NNfUN.esm.js} +3 -43
  23. package/dist/{browser-DlFgHpoC-DnyrCR8r.esm.js → browser-pQZA35G2-DtkAf6sn.esm.js} +161 -150
  24. package/dist/{camera-sIa9ceW2.esm.js → camera-E_Kcre4O.esm.js} +15 -23
  25. package/dist/camera.esm.js +1 -1
  26. package/dist/certificate-issuance.esm.js +2 -2
  27. package/dist/{certificateIssuanceManager-BfeMv2PU.esm.js → certificateIssuanceManager-CM0fuqDC.esm.js} +2 -2
  28. package/dist/{certificateIssuanceStateMachine-Frgjbjw8.esm.js → certificateIssuanceStateMachine-kksIUOPD.esm.js} +2 -2
  29. package/dist/cnpj-Co1ottYN.esm.js +77 -0
  30. package/dist/connectivity-HSl0diCx.esm.js +133 -0
  31. package/dist/consent.d.ts +1 -1
  32. package/dist/consent.esm.js +2 -2
  33. package/dist/{consentManager-CvEu8h_W.esm.js → consentManager-CBwFozhv.esm.js} +4 -3
  34. package/dist/{consentManager-Cv_0QKLD.d.ts → consentManager-_q9yJUku.d.ts} +14 -7
  35. package/dist/{consentStateMachine-DJTgN_-1.esm.js → consentStateMachine-CpmRAcr2.esm.js} +20 -7
  36. package/dist/cross-document-data-match.esm.js +1 -1
  37. package/dist/{crossDocumentDataMatchManager-Cu141CE8.esm.js → crossDocumentDataMatchManager-64O8t10a.esm.js} +2 -2
  38. package/dist/curp-validation.d.ts +1 -1
  39. package/dist/curp-validation.esm.js +2 -2
  40. package/dist/{curpValidationManager-B-z9q5V3.esm.js → curpValidationManager-CLgJQcx0.esm.js} +3 -2
  41. package/dist/{curpValidationManager-C9sqoh9n.d.ts → curpValidationManager-CXpFE-Mv.d.ts} +1 -1
  42. package/dist/{curpValidationStateMachine-vDEFLMPw.esm.js → curpValidationStateMachine-Bx9YhVkJ.esm.js} +28 -20
  43. package/dist/custom-fields.esm.js +1 -1
  44. package/dist/custom-watchlist.esm.js +2 -2
  45. package/dist/{customFieldsManager-D1ex2cFM.esm.js → customFieldsManager-DWt_0YtJ.esm.js} +2 -2
  46. package/dist/{customWatchlistManager-CTI-SGk0.esm.js → customWatchlistManager-D8o-2Nej.esm.js} +2 -2
  47. package/dist/{customWatchlistStateMachine-hmRd0f2I.esm.js → customWatchlistStateMachine-Sbi6DIcK.esm.js} +1 -1
  48. package/dist/{deepsightLoader-DeNvGU3c.esm.js → deepsightLoader-DMxtowCm.esm.js} +6 -28
  49. package/dist/{deepsightService-CKTYDIXD.esm.js → deepsightService-twg3bXqY.esm.js} +20 -59
  50. package/dist/{createCameraCycleOwnership-Dj_LHUvN.esm.js → desktopCameraElection-kHY2IDJi.esm.js} +177 -40
  51. package/dist/device.esm.js +2 -2
  52. package/dist/document-capture.d.ts +2 -2
  53. package/dist/document-capture.esm.js +2 -2
  54. package/dist/{documentCaptureManager-DkyDtm3Y.d.ts → documentCaptureManager-6tnnDkMX.d.ts} +14 -2
  55. package/dist/{documentCaptureManager-DUJwpKC5.esm.js → documentCaptureManager-CMSC_Mhd.esm.js} +26 -19
  56. package/dist/{documentCaptureStateMachine-B8i7GnLh.esm.js → documentCaptureStateMachine-BCwD5Rto.esm.js} +43 -35
  57. package/dist/dynamic-forms.d.ts +2 -2
  58. package/dist/dynamic-forms.esm.js +2 -2
  59. package/dist/{dynamicFormsManager-C0dHs1ty.d.ts → dynamicFormsManager-9kwY8Bf5.d.ts} +1 -1
  60. package/dist/{dynamicFormsManager-DiKYjcF3.esm.js → dynamicFormsManager-DU6W1e20.esm.js} +2 -2
  61. package/dist/{dynamicFormsStateMachine-DEI45xYW.esm.js → dynamicFormsStateMachine-C8Z7k3vo.esm.js} +2 -2
  62. package/dist/ekyb.d.ts +4 -4
  63. package/dist/ekyb.esm.js +3 -3
  64. package/dist/{ekybManager-BaZ_7CEu.d.ts → ekybManager-TB6ZG5lX.d.ts} +2 -2
  65. package/dist/{ekybManager-8WLkNcqg.esm.js → ekybManager-TGfqyjuu.esm.js} +2 -2
  66. package/dist/{ekybStateMachine-BLRT45Ex.esm.js → ekybStateMachine-DBgFuEPK.esm.js} +26 -44
  67. package/dist/ekyc.d.ts +3 -3
  68. package/dist/ekyc.esm.js +3 -3
  69. package/dist/{ekycManager-DW-ynodd.d.ts → ekycManager-BSQteIfC.d.ts} +1 -1
  70. package/dist/{ekycManager-BO-Lui3t.esm.js → ekycManager-C2cgG2Pl.esm.js} +2 -2
  71. package/dist/ekycStateMachine-CuNF7z4O.esm.js +7505 -0
  72. package/dist/ekycUtils-BFncpC4F.esm.js +1401 -0
  73. package/dist/electronic-signature.esm.js +1 -1
  74. package/dist/{electronicSignatureManager-CcIMOb_Y.esm.js → electronicSignatureManager-C7pqXsRm.esm.js} +4 -4
  75. package/dist/email.esm.js +2 -2
  76. package/dist/{emailManager-ButFktRm.esm.js → emailManager-FH_CP0cT.esm.js} +2 -2
  77. package/dist/{emailStateMachine-BXtlC0NV.esm.js → emailStateMachine-Cx-uTaBV.esm.js} +32 -20
  78. package/dist/{events-Du2A4-Qr.esm.js → events-CQteqXfy.esm.js} +2 -2
  79. package/dist/events.esm.js +1 -1
  80. package/dist/extensibility.d.ts +34 -20
  81. package/dist/extensibility.esm.js +34 -34
  82. package/dist/{externalFetch-DrR9xshk.esm.js → externalFetch-CQY41QT1.esm.js} +4 -1
  83. package/dist/face-match.d.ts +1 -1
  84. package/dist/face-match.esm.js +2 -2
  85. package/dist/{faceCaptureManagerFactory-1hzeS_rB.d.ts → faceCaptureManagerFactory-C-xKdj-d.d.ts} +71 -66
  86. package/dist/{faceCaptureManagerFactory-BlGvXzXA.esm.js → faceCaptureManagerFactory-CBm05KnT.esm.js} +4 -4
  87. package/dist/{faceCaptureSetup-TY8RXc2N.esm.js → faceCaptureSetup-BQjCbL51.esm.js} +82 -64
  88. package/dist/{faceMatchManager-DWFUQjMQ.esm.js → faceMatchManager-B2zp7yP4.esm.js} +2 -2
  89. package/dist/{faceMatchManager-DIgG-UFS.d.ts → faceMatchManager-Z4UDLwAv.d.ts} +16 -7
  90. package/dist/{faceMatchStateMachine-CUCvlydD.esm.js → faceMatchStateMachine-ByTMQCUC.esm.js} +40 -27
  91. package/dist/{feature-management-B5rR10uS.esm.js → feature-management-DjAG5lsJ.esm.js} +1 -1
  92. package/dist/feature-management.esm.js +1 -1
  93. package/dist/field-comparison.esm.js +1 -1
  94. package/dist/{fieldComparisonManager-v3knTYV_.esm.js → fieldComparisonManager-CC0vKmpf.esm.js} +2 -2
  95. package/dist/fiscal-qr.esm.js +1 -1
  96. package/dist/{fiscalQrManager-Dt9fHG7h.esm.js → fiscalQrManager-Be-r4oZj.esm.js} +4 -4
  97. package/dist/flow-events.d.ts +1 -1
  98. package/dist/flow.d.ts +10 -10
  99. package/dist/flow.esm.js +8 -11
  100. package/dist/{flowCompletionService-BDI5QpfR.esm.js → flowCompletionService-ChMU2v79.esm.js} +2 -2
  101. package/dist/{flowServices-roD0oIQL.esm.js → flowServices-g2tVWsJl.esm.js} +8 -50
  102. package/dist/geolocation.d.ts +1 -1
  103. package/dist/geolocation.esm.js +2 -2
  104. package/dist/{geolocationManager-Dn24g1fl.d.ts → geolocationManager-6e1i9UIR.d.ts} +15 -17
  105. package/dist/{geolocationManager-DnONzWL5.esm.js → geolocationManager-DLbvZwUB.esm.js} +6 -8
  106. package/dist/{geolocationStateMachine-eWy_G4Os.esm.js → geolocationStateMachine-CAJVongM.esm.js} +12 -8
  107. package/dist/{getDeviceClass-bsWdEDxP.esm.js → getDeviceClass-DoIWuKI8.esm.js} +1 -1
  108. package/dist/government-validation.esm.js +2 -2
  109. package/dist/{governmentValidationManager-BtXWHICu.esm.js → governmentValidationManager-CkX9TEkh.esm.js} +2 -2
  110. package/dist/{governmentValidationStateMachine-COL-Vs48.esm.js → governmentValidationStateMachine-PTPCP26N.esm.js} +1 -1
  111. package/dist/home.d.ts +1 -1
  112. package/dist/home.esm.js +1 -1
  113. package/dist/http.esm.js +1 -1
  114. package/dist/id-ocr.esm.js +2 -2
  115. package/dist/id-selfie-flow.d.ts +1 -1
  116. package/dist/id-selfie-flow.esm.js +9 -9
  117. package/dist/id-verification.esm.js +2 -2
  118. package/dist/id.d.ts +3 -16
  119. package/dist/id.esm.js +3 -3
  120. package/dist/{idCaptureDefaults-BGsG2OAs.esm.js → idCaptureDefaults-MSQoqScU.esm.js} +3 -3
  121. package/dist/{idCaptureManager-0M02hSuC.d.ts → idCaptureManager-DzTfQ1Am.d.ts} +66 -5
  122. package/dist/{idCaptureManager-BrfYjCm_.esm.js → idCaptureManager-zZdTcpG1.esm.js} +63 -17
  123. package/dist/{idCaptureServices-BSj6EH2l.esm.js → idCaptureServices-8OHinO0N.esm.js} +9 -9
  124. package/dist/{idCaptureStateMachine-dXKBYHQp.esm.js → idCaptureStateMachine-B3G6XoDG.esm.js} +914 -536
  125. package/dist/{idOcrManager-D3-HNMXP.esm.js → idOcrManager-B64-fjWg.esm.js} +2 -2
  126. package/dist/{idOcrStateMachine-DyENX6Ki.esm.js → idOcrStateMachine-B1aZnobs.esm.js} +2 -2
  127. package/dist/{idVerificationManager-iWz7Avkr.esm.js → idVerificationManager-_Kebv-Ue.esm.js} +2 -2
  128. package/dist/{idVerificationStateMachine-CL1kUdBe.esm.js → idVerificationStateMachine-DQn6c84z.esm.js} +1 -1
  129. package/dist/identity-reuse.esm.js +2 -2
  130. package/dist/{identityReuseManager-CD1ucp1d.esm.js → identityReuseManager-DDXkNVZi.esm.js} +2 -2
  131. package/dist/{identityReuseStateMachine-DfV81wQC.esm.js → identityReuseStateMachine-Bcnkbjf8.esm.js} +1 -1
  132. package/dist/{index-BKOWUhxG.d.ts → index-DEfwds5y.d.ts} +55 -8
  133. package/dist/{index-CKQ9QBZP.d.ts → index-DMDAk85K.d.ts} +1 -1
  134. package/dist/index.d.ts +1 -1
  135. package/dist/index.esm.js +1 -1
  136. package/dist/{invokeOnCaptureCallback-DYrkOXO6.esm.js → invokeOnCaptureCallback-CXIBwBeE.esm.js} +1 -1
  137. package/dist/mandatory-consent.d.ts +2 -2
  138. package/dist/mandatory-consent.esm.js +2 -2
  139. package/dist/{mandatoryConsentManager-Cwqx1nK7.esm.js → mandatoryConsentManager-43W5d_8G.esm.js} +4 -3
  140. package/dist/{mandatoryConsentManager-BQ43yndC.d.ts → mandatoryConsentManager-xx3mY-xw.d.ts} +11 -4
  141. package/dist/{mandatoryConsentStateMachine-pXWqAHo_.esm.js → mandatoryConsentStateMachine-CVlgdlnt.esm.js} +20 -7
  142. package/dist/{multipartRecordingService-CLwrF5wD.esm.js → multipartRecordingService-DMBxHKS2.esm.js} +3 -13
  143. package/dist/nationalIds-B91f_RuB.esm.js +99 -0
  144. package/dist/{permissionGuards-gcy3U0SL.esm.js → permissionGuards-B3OPL8Si.esm.js} +1 -1
  145. package/dist/{permissionServices-Ca-tSNhT.esm.js → permissionServices-DnBAN_hW.esm.js} +4 -4
  146. package/dist/phone-number.d.ts +7 -1
  147. package/dist/phone-number.esm.js +15 -2
  148. package/dist/phone.d.ts +1 -1
  149. package/dist/phone.esm.js +2 -2
  150. package/dist/{phoneManager-BO-LTih5.d.ts → phoneManager-6nrJkvkG.d.ts} +5 -0
  151. package/dist/{phoneManager-KKUq-Vgo.esm.js → phoneManager-C6jut_pz.esm.js} +3 -3
  152. package/dist/{phoneStateMachine-D2QWS2cu.esm.js → phoneStateMachine-T1-drWfG.esm.js} +37 -25
  153. package/dist/{phoneValidation-DnBcNUNh.esm.js → phoneValidation-OggtfjRt.esm.js} +1 -2
  154. package/dist/{platform-DkcRc9JV.esm.js → platform-aPh7gTWh.esm.js} +15 -1
  155. package/dist/processFaceMatch-BWme3kVV.esm.js +21 -0
  156. package/dist/qe-signature.esm.js +1 -1
  157. package/dist/redirect-to-mobile.d.ts +2 -2
  158. package/dist/redirect-to-mobile.esm.js +2 -2
  159. package/dist/{redirectToMobileManager-uHW3dyuQ.esm.js → redirectToMobileManager-BJXC6Kx9.esm.js} +4 -3
  160. package/dist/{redirectToMobileManager-CVsvpVbQ.d.ts → redirectToMobileManager-Dm9ctRCC.d.ts} +3 -1
  161. package/dist/{redirectToMobileStateMachine-b-H-ipGM.esm.js → redirectToMobileStateMachine-BBMAc2Gb.esm.js} +27 -6
  162. package/dist/{runChildModule-BF_atgNx.esm.js → runChildModule-DPHTqSdF.esm.js} +3 -3
  163. package/dist/{sdkVersion-CsIbltJF.esm.js → sdkVersion-C3_P-Qbq.esm.js} +1 -1
  164. package/dist/selfie.d.ts +4 -4
  165. package/dist/selfie.esm.js +10 -10
  166. package/dist/{selfieErrorUtils-BY0-YbPW.esm.js → selfieErrorUtils-BL0BLMnp.esm.js} +1 -1
  167. package/dist/{selfieManager-BJdNu_nd.d.ts → selfieManager-BMmpUii2.d.ts} +1 -1
  168. package/dist/{selfieManager-vAAwzsHk.esm.js → selfieManager-Cbliomv7.esm.js} +5 -5
  169. package/dist/{selfieStateMachine-BFVp3ElQ.esm.js → selfieStateMachine-B5m_Kn0O.esm.js} +3 -3
  170. package/dist/{session-CpwfoVdH.esm.js → session-DAaAewMX.esm.js} +77 -9
  171. package/dist/session.d.ts +96 -10
  172. package/dist/session.esm.js +7 -6
  173. package/dist/{sessionInitializer-BTjYgE-V.esm.js → sessionInitializer-CWFT4dfw.esm.js} +402 -202
  174. package/dist/{setup-BInNAvQw.esm.js → setup-CDAKwTr7.esm.js} +32 -19
  175. package/dist/{setup-YPKTUCY5.d.ts → setup-D9qt8YVU.d.ts} +2 -2
  176. package/dist/signature.esm.js +2 -2
  177. package/dist/{signatureManager-f_dPAGXn.esm.js → signatureManager-BeEVCcsC.esm.js} +2 -2
  178. package/dist/{signatureStateMachine-C-nUq_oq.esm.js → signatureStateMachine-_1c1vSid.esm.js} +1 -1
  179. package/dist/{stats-BEvexnKC.esm.js → stats-BpMz-hTP.esm.js} +1 -1
  180. package/dist/stats.esm.js +1 -1
  181. package/dist/{tri-xzRLIIMN.esm.js → tri-BajQnjbf.esm.js} +142 -8
  182. package/dist/tri.d.ts +1 -1
  183. package/dist/tri.esm-CzTNi5Q_.esm.js +3826 -0
  184. package/dist/tri.esm.js +1 -1
  185. package/dist/{trueSightService-BMT-TubT.esm.js → trueSightService-BujtUIW6.esm.js} +19 -10
  186. package/dist/trust-graph.esm.js +1 -1
  187. package/dist/{types-yPH8lAH-.d.ts → types--3HDl2SF.d.ts} +2 -2
  188. package/dist/types-B2FK_wYb.d.ts +249 -0
  189. package/dist/types-B9C8W01q.d.ts +34 -0
  190. package/dist/{types-0L-eFDmr.d.ts → types-C397LhmN.d.ts} +1 -1
  191. package/dist/types-D9r3zRfY.d.ts +6 -0
  192. package/dist/{types-DPIDuhut.d.ts → types-DNVzoRvi.d.ts} +2 -1
  193. package/dist/{types-B6HsSzpk.d.ts → types-DuD8TRJU.d.ts} +3 -2
  194. package/dist/{types-Ckir_BEs.d.ts → types-PTZHRhGX.d.ts} +1 -1
  195. package/dist/{types-DUnFZ08M.d.ts → types-ZTZelfbM.d.ts} +2 -2
  196. package/dist/{types-CK8Jbjkp.d.ts → types-e8fCsvvk.d.ts} +1 -1
  197. package/dist/{types-BAxn7MpY.d.ts → types-xEEWCx1j.d.ts} +123 -48
  198. package/dist/{urlUtils-6jsE6rKp.esm.js → urlUtils-eYiyWjh0.esm.js} +4 -1
  199. package/dist/video-selfie.d.ts +8 -8
  200. package/dist/video-selfie.esm.js +95 -22
  201. package/dist/{videoSelfieCameraWarmer-D1xA0u8y.esm.js → videoSelfieCameraWarmer-DjkPpoj_.esm.js} +18 -21
  202. package/dist/{videoSelfieStepDetector-CGsTltqB.d.ts → videoSelfieStepDetector-RfSmlFFW.d.ts} +9 -4
  203. package/dist/{warmup-BElYWRh7.esm.js → warmup-BkfxQZsC.esm.js} +175 -11
  204. package/dist/wasm.d.ts +2 -2
  205. package/dist/wasm.esm.js +3 -3
  206. package/dist/{wasmDsFlagSync-CYj5LL9z.esm.js → wasmDsFlagSync-BhU5H2oR.esm.js} +1 -1
  207. package/dist/wasmMetadataVersionSync-U8EFUr1T.esm.js +27 -0
  208. package/dist/{wasmWebClient-BjZw_7OB.esm.js → wasmWebClient-DTj9auyA.esm.js} +43 -17
  209. package/dist/watchlist-for-business.d.ts +2 -1
  210. package/dist/watchlist-for-business.esm.js +2 -2
  211. package/dist/watchlist.esm.js +2 -2
  212. package/dist/{watchlistForBusinessManager-CZZOFkGl.esm.js → watchlistForBusinessManager-CVay6-9A.esm.js} +37 -7
  213. package/dist/{watchlistForBusinessManager-B3GDPZrr.d.ts → watchlistForBusinessManager-DX2AyM4Y.d.ts} +54 -18
  214. package/dist/watchlistForBusinessStateMachine-DA6K5na4.esm.js +166 -0
  215. package/dist/{watchlistManager-DXtX94SN.esm.js → watchlistManager-B8gQ_rw3.esm.js} +2 -2
  216. package/dist/{watchlistStateMachine-McALifag.esm.js → watchlistStateMachine-CSi_ZhtT.esm.js} +1 -1
  217. package/dist/workflow.d.ts +5 -2
  218. package/dist/workflow.esm.js +57 -47
  219. package/package.json +2 -1
  220. package/dist/IBrowserEnvironmentCapability-DEaRRk-R.esm.js +0 -9
  221. package/dist/ekycStateMachine-CDnI_NRq.esm.js +0 -1443
  222. package/dist/ekycUtils-zY8CdKJL.esm.js +0 -300
  223. package/dist/thumbmark.esm-CRc0cYvz.esm.js +0 -1242
  224. package/dist/tri.esm-BIjHhBJ2.esm.js +0 -2620
  225. package/dist/types-BvLo3U4u.d.ts +0 -134
  226. package/dist/types-zOgZqMni.d.ts +0 -6
  227. package/dist/watchlistForBusinessStateMachine-B66E7jud.esm.js +0 -78
  228. /package/dist/{types-BSBzhHRH2.d.ts → types-BSBzhHRH.d.ts} +0 -0
@@ -1,23 +1,86 @@
1
- import { C as subscribeEvent, b as getAnalyticsBatcher, y as addEvent } from "./events-Du2A4-Qr.esm.js";
2
- import { c as setToken, r as getToken, t as api, u as endpoints } from "./api-Cz90EHyu.esm.js";
3
- import { C as noteTokenActivated, _ as isFeatureEnabled, b as noteEnvironment, c as startTrueSightCollection, g as fetchFeatureConfig, u as trueSightLog, v as resetFeatureConfigCache } from "./trueSightService-BMT-TubT.esm.js";
4
- import { t as SDK_VERSION } from "./sdkVersion-CsIbltJF.esm.js";
5
- import { E as updateFeatureManagementUser } from "./feature-management-B5rR10uS.esm.js";
6
- import { n as flushDeviceStatsQueue, r as resetDeviceStatsQueue } from "./stats-BEvexnKC.esm.js";
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 { t as BrowserLazyImportProvider } from "./BrowserLazyImportProvider-BhoA957O.esm.js";
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 { i as linkSessionWithTRI, r as isTRIStarted } from "./tri-xzRLIIMN.esm.js";
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 = ["pid", "device"];
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 metadata = await (await deps.getWasmUtil()).getFingerprintSignals(type);
38
- if (!metadata) return;
39
- if (deps.getToken() !== token) return;
40
- await deps.post(endpoints.deviceFingerprintSignals, {
41
- interviewEvent,
42
- metadata
43
- }, { "X-Incode-Hardware-Id": token });
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
- const { WasmUtilProvider } = await import("./WasmUtilProvider-DtJuBdt-.esm.js").then((n) => n.n);
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
- constructor(ipLookup) {
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 visitorId = await this.startVisitorId();
530
- const [deviceInfo, ip] = await Promise.all([getDeviceFingerprintInfo(), disableIpify ? Promise.resolve("") : this.ipLookup.getIp()]);
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 ../infra/src/providers/browser/IpifyProvider.ts
541
- let cachedIp;
542
- let inFlightLookup;
653
+ //#region src/internal/fingerprint/fingerprintApi.ts
654
+ const PID_WAIT_MS = 3e3;
543
655
  /**
544
- * Resets the module-level IP cache. Intended for tests and full session resets.
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 fingerprint = await dependencies.fingerprintProvider.getFingerprint(disableIpify);
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: fingerprint.visitorId || "",
668
- ip: fingerprint.ip || "",
765
+ hash: deviceHash?.hash ?? "",
766
+ ip,
669
767
  deviceType: "WEBAPP",
670
- data: JSON.stringify(fingerprint),
671
- osVersion: formatOsVersion(fingerprint.deviceInfo.os),
672
- deviceModel: fingerprint.deviceInfo.device.model || "",
673
- browser: formatBrowser(fingerprint.deviceInfo.browser),
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: fingerprint.algorithmName,
678
- algorithmVersion: fingerprint.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 fingerprintProvider = clientFingerprintEnabled ? new FingerprintProvider(new IpifyProvider()) : void 0;
839
- fingerprintProvider?.prime?.();
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(fingerprintProvider, {
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(fingerprintProvider, options, settled) {
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 (fingerprintProvider) try {
917
- const result = await submitDeviceFingerprint(options, {
918
- fingerprintProvider,
919
- browserEnv: new BrowserEnvironmentProvider(),
920
- isCurrentSession: isCurrent
921
- });
922
- if (isCurrent()) {
923
- cachedFingerprintResult = result;
924
- cachedFingerprintSuccess = true;
925
- flushDeviceStatsQueue();
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
- } catch (error) {
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 { IpifyProvider as _, resetSessionInit as a, BrowserEnvironmentProvider as b, setClientIpLookupEnabled as c, registerFlowPreloader as d, resetStandaloneFlowPolicy as f, getFingerprint as g, isBrowserSimulation as h, initializeSession as i, whenSessionFingerprintSettled as l, setStandaloneFlowPolicy as m, getFingerprintEnabled as n, setClientFingerprintEnabled as o, resolveStandaloneFlowPolicy as p, getSessionFingerprintResult as r, setClientHostingApp as s, getDisableIpify as t, getStandaloneFlowPolicy as u, getThumbmarkId as v, fingerprintSignalsReporter as x, getDeviceFingerprintInfo as y };
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 };