@incodetech/core 2.1.1 → 2.2.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (328) hide show
  1. package/dist/{3dAvatarProvider-BwOmTMOy.esm.js → 3dAvatarProvider-g02DTFqT.esm.js} +811 -880
  2. package/dist/Actor-iTq7YY48.d.ts +1 -0
  3. package/dist/BrowserDiagnosticsCryptoProvider-BwGL3Lmi.esm.js +95 -0
  4. package/dist/BrowserLazyImportProvider-BhoA957O.esm.js +114 -0
  5. package/dist/{BrowserStorageProvider-CBHBhKQN.esm.js → BrowserStorageProvider-k-FDkC4W.esm.js} +2 -4
  6. package/dist/{BrowserTimerProvider-CHloo0eQ.esm.js → BrowserTimerProvider-BXhgNxLt.esm.js} +1 -2
  7. package/dist/{BrowserVisibilityObserverProvider-GBS6XSii.esm.js → BrowserVisibilityObserverProvider-BX1BiLDK.esm.js} +1 -2
  8. package/dist/Face2DProvider-UUQt_vRC.esm.js +437 -0
  9. package/dist/{createFaceAvatar-CpdYp9Iy.d.ts → FaceDetectionProvider-Mh6q3EbA.d.ts} +107 -159
  10. package/dist/IBrowserEnvironmentCapability-DEaRRk-R.esm.js +9 -0
  11. package/dist/IFaceAvatarCapability-BrL19G0s.d.ts +23 -0
  12. package/dist/IFeatureManagementCapability-DdEUp6tB.d.ts +1125 -0
  13. package/dist/IIdCaptureCapability-DHTT3FC2.d.ts +237 -0
  14. package/dist/IStorageCapability-ORkQfK3F.d.ts +242 -0
  15. package/dist/{ITimerCapability-DJ73P4RK.esm.js → ITimerCapability-DgdDzp8G.esm.js} +1 -2
  16. package/dist/{Manager-goNPc_h_.d.ts → Manager-CQQ99QOI.d.ts} +1 -0
  17. package/dist/{MotionSensorProvider-BHuHoYvJ.esm.js → MotionSensorProvider-DGiV77J_.esm.js} +2 -37
  18. package/dist/{OpenViduRecordingProvider-CK6A5kiU.esm.js → OpenViduRecordingProvider-Du98qevC.esm.js} +2 -4
  19. package/dist/PrivacyLensProvider-D8PS7AJa.esm.js +405 -0
  20. package/dist/StateMachine-EDpYWy0i.d.ts +6 -0
  21. package/dist/{StreamCanvasCapture-CAqUdVkM.esm.js → StreamCanvasCapture-D2XcXCZ4.esm.js} +2 -4
  22. package/dist/{addressSearch-D7msRieq.esm.js → addressSearch-DQyrvDQj.esm.js} +10 -21
  23. package/dist/ae-signature.d.ts +4 -6
  24. package/dist/ae-signature.esm.js +10 -11
  25. package/dist/antifraud.d.ts +1 -6
  26. package/dist/antifraud.esm.js +3 -8
  27. package/dist/{antifraudManager-5KA84wtF.esm.js → antifraudManager-B8Plzf7a.esm.js} +11 -8
  28. package/dist/{antifraudManager-DCiNI6np.d.ts → antifraudManager-BY36bS12.d.ts} +3 -3
  29. package/dist/{antifraudStateMachine-BQVw46N5.esm.js → antifraudStateMachine-r4VxSBS4.esm.js} +5 -7
  30. package/dist/api-Bx3gKW_y.esm.js +129 -0
  31. package/dist/{apiError-DkOXfFBu.esm.js → apiError-oiEnJIlk.esm.js} +25 -3
  32. package/dist/authentication.d.ts +3 -19
  33. package/dist/authentication.esm.js +3 -35
  34. package/dist/{authenticationManager-BeT6tNZm.d.ts → authenticationManager-BBMGTcwW.d.ts} +3 -4
  35. package/dist/{authenticationManager-BryLnSaF.esm.js → authenticationManager-Dq_tudSW.esm.js} +7 -10
  36. package/dist/{authenticationStateMachine-DbdxfGHx.esm.js → authenticationStateMachine-D4koAtP3.esm.js} +11 -15
  37. package/dist/avatar.d.ts +2 -2
  38. package/dist/avatar.esm.js +2 -3
  39. package/dist/avatar2dWarm-DqucNFX4.esm.js +1330 -0
  40. package/dist/avatarStats-CdUOb3VD.esm.js +136 -0
  41. package/dist/{backCameraStream-ChrMTJv-.esm.js → backCameraStream-CUeYm5eu.esm.js} +20 -8
  42. package/dist/browser-DlFgHpoC-DnyrCR8r.esm.js +1513 -0
  43. package/dist/callback-645_omgz.d.ts +133 -0
  44. package/dist/camera-_2sXMXiF.esm.js +140 -0
  45. package/dist/camera.d.ts +19 -2
  46. package/dist/camera.esm.js +2 -6
  47. package/dist/{canvas-Pi10hG_l.esm.js → canvas-E1zGkel4.esm.js} +1 -2
  48. package/dist/certificate-issuance.d.ts +34 -39
  49. package/dist/certificate-issuance.esm.js +4 -11
  50. package/dist/{certificateIssuanceStateMachine-DlZQT1_u.esm.js → certificateIssuanceStateMachine-COd7_l2T.esm.js} +7 -11
  51. package/dist/consent.d.ts +1 -4
  52. package/dist/consent.esm.js +3 -8
  53. package/dist/{consentManager-BwNu-uC-.esm.js → consentManager-BApTlfA0.esm.js} +5 -7
  54. package/dist/{consentManager-B4PMGXW-.d.ts → consentManager-uhDPdU6i.d.ts} +55 -61
  55. package/dist/{consentStateMachine-BOkVFiU7.esm.js → consentStateMachine-WD-S-Yhs.esm.js} +5 -7
  56. package/dist/{cpf-16m_cGAM.esm.js → cpf-BIADjddF.esm.js} +1 -2
  57. package/dist/createFaceAvatar-BEj18KXi.d.ts +50 -0
  58. package/dist/createFaceAvatar-DQKaRise.esm.js +103 -0
  59. package/dist/cross-document-data-match.d.ts +2 -26
  60. package/dist/cross-document-data-match.esm.js +2 -71
  61. package/dist/crossDocumentDataMatchManager-Dq8Z3SOg.d.ts +41 -0
  62. package/dist/crossDocumentDataMatchManager-OmYvyung.esm.js +84 -0
  63. package/dist/curp-validation.d.ts +1 -11
  64. package/dist/curp-validation.esm.js +3 -8
  65. package/dist/{curpValidationManager-CoqODZx5.d.ts → curpValidationManager-DVGr7Fq7.d.ts} +4 -6
  66. package/dist/{curpValidationManager-Cbji2inV.esm.js → curpValidationManager-UZxcrsrz.esm.js} +11 -7
  67. package/dist/{curpValidationStateMachine-Dlw4qfFb.esm.js → curpValidationStateMachine-9KwnqeoB.esm.js} +22 -14
  68. package/dist/custom-fields.d.ts +2 -5
  69. package/dist/custom-fields.esm.js +24 -11
  70. package/dist/custom-watchlist.d.ts +1 -3
  71. package/dist/custom-watchlist.esm.js +11 -10
  72. package/dist/{customWatchlistStateMachine-D8w0mNxm.esm.js → customWatchlistStateMachine-B_ey3TFj.esm.js} +5 -7
  73. package/dist/{dateUtils-BW6mBV6p.esm.js → dateUtils-CvG0FvK8.esm.js} +1 -2
  74. package/dist/{deepsightService-CViys6T4.esm.js → deepsightLoader-CWE0SvF1.esm.js} +68 -14
  75. package/dist/{deepsightService-BuTOFTr8.d.ts → deepsightService-DLVQS_RH.d.ts} +41 -2
  76. package/dist/device.d.ts +10 -2
  77. package/dist/device.esm.js +21 -21
  78. package/dist/document-capture.d.ts +3 -1816
  79. package/dist/document-capture.esm.js +3 -245
  80. package/dist/document-upload.d.ts +48 -55
  81. package/dist/document-upload.esm.js +8 -14
  82. package/dist/documentCaptureManager-B3t0ydtg.d.ts +2062 -0
  83. package/dist/documentCaptureManager-DszmcU-l.esm.js +296 -0
  84. package/dist/{documentCaptureStateMachine-BkTvU3yq.esm.js → documentCaptureStateMachine-D2jBwwVb.esm.js} +66 -40
  85. package/dist/dynamic-forms.d.ts +2 -4
  86. package/dist/dynamic-forms.esm.js +3 -9
  87. package/dist/{dynamicFormsManager-CHXUBNs4.esm.js → dynamicFormsManager-B-OmpJkU.esm.js} +48 -9
  88. package/dist/{dynamicFormsManager-CKZkE7Wo.d.ts → dynamicFormsManager-fhK0yINk.d.ts} +22 -46
  89. package/dist/{dynamicFormsStateMachine-DJ1HGZff.esm.js → dynamicFormsStateMachine-D_3oLtOE.esm.js} +161 -34
  90. package/dist/ekyb.d.ts +5 -137
  91. package/dist/ekyb.esm.js +4 -179
  92. package/dist/ekybManager-BJVp2ahf.esm.js +178 -0
  93. package/dist/ekybManager-Dzswb_b8.d.ts +114 -0
  94. package/dist/{ekybStateMachine-D9GzA4MW.esm.js → ekybStateMachine-BYcc9VaR.esm.js} +16 -193
  95. package/dist/ekyc.d.ts +2 -79
  96. package/dist/ekyc.esm.js +4 -154
  97. package/dist/ekycManager-BFpHbBoT.d.ts +97 -0
  98. package/dist/ekycManager-oTstTJuL.esm.js +156 -0
  99. package/dist/{ekycStateMachine-DnVRiu3s.esm.js → ekycStateMachine-DHvksnrr.esm.js} +141 -423
  100. package/dist/ekycUtils-Dew1rBG0.esm.js +223 -0
  101. package/dist/electronic-signature.d.ts +3 -5
  102. package/dist/electronic-signature.esm.js +2 -10
  103. package/dist/{electronicSignatureManager-DESRgObX.esm.js → electronicSignatureManager-CApcBEQd.esm.js} +47 -33
  104. package/dist/{index-36QX_21w.d.ts → electronicSignatureManager-CcUXQZS7.d.ts} +220 -251
  105. package/dist/email.d.ts +1 -5
  106. package/dist/email.esm.js +3 -10
  107. package/dist/{emailManager-CMS4q_r6.d.ts → emailManager-CADXW_9X.d.ts} +4 -7
  108. package/dist/{emailManager-B9Vrv3Ma.esm.js → emailManager-tE-YvNtS.esm.js} +76 -12
  109. package/dist/{emailStateMachine-CbmKFVSi.esm.js → emailStateMachine-Bm894MHB.esm.js} +7 -9
  110. package/dist/{endpoints-CwrFQfW7.esm.js → endpoints-CCzL3XD_.esm.js} +55 -6
  111. package/dist/{events-1wxZ97yf.esm.js → events-CxfNJVZW.esm.js} +43 -176
  112. package/dist/events.d.ts +28 -10
  113. package/dist/events.esm.js +2 -4
  114. package/dist/extensibility.d.ts +37 -37
  115. package/dist/extensibility.esm.js +31 -80
  116. package/dist/{externalFetch-hvmz_npP.esm.js → externalFetch-BKBThAUC.esm.js} +2 -4
  117. package/dist/face-match.d.ts +2 -225
  118. package/dist/face-match.esm.js +3 -173
  119. package/dist/{faceCaptureManagerFactory-C9TiGbkA.esm.js → faceCaptureManagerFactory-4VejGOQX.esm.js} +52 -31
  120. package/dist/{faceCaptureManagerFactory-DiJ64oem.d.ts → faceCaptureManagerFactory-BxWPpxyd.d.ts} +63 -24
  121. package/dist/{faceCaptureSetup-BqhqfFHL.esm.js → faceCaptureSetup-BB5KEtbV.esm.js} +57 -36
  122. package/dist/faceMatchManager-BXp2WUT-.esm.js +201 -0
  123. package/dist/faceMatchManager-BnvrZM2F.d.ts +268 -0
  124. package/dist/{faceMatchStateMachine-MDb30gCm.esm.js → faceMatchStateMachine-CJiO2yLO.esm.js} +14 -10
  125. package/dist/feature-management-DS_Nj5Gg.esm.js +615 -0
  126. package/dist/feature-management.d.ts +173 -0
  127. package/dist/feature-management.esm.js +2 -0
  128. package/dist/field-comparison.d.ts +1 -4
  129. package/dist/field-comparison.esm.js +2 -7
  130. package/dist/{fieldComparisonManager-OLKVsG2Z.d.ts → fieldComparisonManager-CBvEGxFx.d.ts} +3 -5
  131. package/dist/{fieldComparisonManager-Cw4uzD7S.esm.js → fieldComparisonManager-DhnYdYZ2.esm.js} +6 -11
  132. package/dist/fiscal-qr.d.ts +1 -6
  133. package/dist/fiscal-qr.esm.js +14 -29
  134. package/dist/flow-events.d.ts +2 -9
  135. package/dist/flow.d.ts +59 -21
  136. package/dist/flow.esm.js +132 -49
  137. package/dist/{flowCompletionService-B6P6_EF3.esm.js → flowCompletionService-Bt3wD28k.esm.js} +4 -6
  138. package/dist/flowServices-b0Pd4F1K.esm.js +620 -0
  139. package/dist/geolocation.d.ts +1 -4
  140. package/dist/geolocation.esm.js +3 -9
  141. package/dist/geolocationManager-Cz744E5S.d.ts +506 -0
  142. package/dist/{geolocationManager-CF6-NizA.esm.js → geolocationManager-DGwnL5lg.esm.js} +44 -16
  143. package/dist/{geolocationStateMachine-CD2XJs1b.esm.js → geolocationStateMachine-il6jz5DZ.esm.js} +53 -28
  144. package/dist/{getBrowser-1yNcfFZR.esm.js → getBrowser-Cb8Zgrgp.esm.js} +1 -2
  145. package/dist/getBrowser-DNrQeL4T.esm.js +16 -0
  146. package/dist/getDeviceClass-9y-kbVDw.esm.js +19 -0
  147. package/dist/{getDeviceClass-C-Dg6IsJ.esm.js → getDeviceClass-CeBiEayS.esm.js} +1 -2
  148. package/dist/getParsedUserAgent-pJjATANs.esm.js +1622 -0
  149. package/dist/government-validation.d.ts +3 -6
  150. package/dist/government-validation.esm.js +7 -13
  151. package/dist/{governmentValidationStateMachine-BE5wiQ7Y.esm.js → governmentValidationStateMachine-BYKYUdza.esm.js} +8 -11
  152. package/dist/home.d.ts +14 -22
  153. package/dist/home.esm.js +3 -8
  154. package/dist/http.d.ts +0 -1
  155. package/dist/http.esm.js +2 -4
  156. package/dist/id-ocr.d.ts +8 -7
  157. package/dist/id-ocr.esm.js +20 -9
  158. package/dist/id-selfie-flow.d.ts +179 -0
  159. package/dist/id-selfie-flow.esm.js +917 -0
  160. package/dist/id-verification.d.ts +2 -191
  161. package/dist/id-verification.esm.js +3 -43
  162. package/dist/id.d.ts +7 -18
  163. package/dist/id.esm.js +47 -53
  164. package/dist/{idCaptureDefaults-CZajItdO.esm.js → idCaptureDefaults-WeHbQM7W.esm.js} +54 -17
  165. package/dist/idCaptureManager-BjU-Wyow.d.ts +429 -0
  166. package/dist/{idCaptureManager-DASPUMtC.esm.js → idCaptureManager-DgohUfUQ.esm.js} +173 -34
  167. package/dist/idCaptureServices-RDiDS9tg.esm.js +396 -0
  168. package/dist/{idCaptureStateMachine-DZ2ZTSxu.esm.js → idCaptureStateMachine-DWocZD_m.esm.js} +438 -585
  169. package/dist/{idOcrManager-Tm4LzKR0.esm.js → idOcrManager-CvJZhmBR.esm.js} +4 -7
  170. package/dist/{idOcrManager-DLfAjDZn.d.ts → idOcrManager-DXc_xRN7.d.ts} +62 -229
  171. package/dist/{idOcrStateMachine-BJxZCxwS.esm.js → idOcrStateMachine-Bq_e3l4E.esm.js} +15 -20
  172. package/dist/idVerificationManager-BB4Pj_N6.d.ts +197 -0
  173. package/dist/idVerificationManager-CduNXhWd.esm.js +51 -0
  174. package/dist/{idVerificationStateMachine-DXN9WcdM.esm.js → idVerificationStateMachine-GEQWUPU2.esm.js} +5 -7
  175. package/dist/identity-reuse.d.ts +1 -4
  176. package/dist/identity-reuse.esm.js +3 -8
  177. package/dist/{identityReuseManager-LjkPvSQN.esm.js → identityReuseManager-D5vXknnJ.esm.js} +24 -7
  178. package/dist/{identityReuseManager-CLVOYxcp.d.ts → identityReuseManager-v2TH5g7e.d.ts} +38 -43
  179. package/dist/{identityReuseStateMachine-Bp-zONoV.esm.js → identityReuseStateMachine-AubRPhIi.esm.js} +6 -8
  180. package/dist/index-B8weJxmL.d.ts +1 -0
  181. package/dist/index-BKOWUhxG.d.ts +258 -0
  182. package/dist/{index-DrpWp15Z.d.ts → index-CLMF0QLQ.d.ts} +3 -3
  183. package/dist/index.d.ts +1 -3
  184. package/dist/index.esm.js +2 -15
  185. package/dist/{invokeOnCaptureCallback-CCS2Ruzi.esm.js → invokeOnCaptureCallback-1m1VJ3Q4.esm.js} +2 -4
  186. package/dist/{lib-Bjd6nOLG.esm.js → lib-DAyUtOTj.esm.js} +1510 -1589
  187. package/dist/mandatory-consent.d.ts +2 -10
  188. package/dist/mandatory-consent.esm.js +3 -8
  189. package/dist/{mandatoryConsentManager-DeBmOHcQ.d.ts → mandatoryConsentManager-B29kR0XA.d.ts} +60 -85
  190. package/dist/{mandatoryConsentManager-DZ26sg4B.esm.js → mandatoryConsentManager-BeELm1zS.esm.js} +4 -7
  191. package/dist/{mandatoryConsentStateMachine-_44ZoDSh.esm.js → mandatoryConsentStateMachine-zroQGzwb.esm.js} +5 -7
  192. package/dist/manualReviewService-D4IkipnN.esm.js +15 -0
  193. package/dist/{mediaRecorderOptions-CClCKAiF.esm.js → mediaRecorderOptions-dALSV8af.esm.js} +2 -4
  194. package/dist/{mediapipeShared-Bcmkzs3x.esm.js → mediapipeShared-B6oNoXEQ.esm.js} +21 -9
  195. package/dist/{onDeviceFaceResults-DILtthks.esm.js → onDeviceFaceResults-C6IRJHQB.esm.js} +30 -87
  196. package/dist/openviduLazy-CCDpFWg1.esm.js +10 -0
  197. package/dist/{otp-B1YeyRXu.d.ts → otp-CEWfTj9v.d.ts} +0 -1
  198. package/dist/{otp-uaXiKt_R.esm.js → otp-D2k3PeSL.esm.js} +3 -14
  199. package/dist/{permissionGuards-BNOe4Tnu.esm.js → permissionGuards-KINpmKtI.esm.js} +2 -4
  200. package/dist/{permissionServices-C_kxhNeo.esm.js → permissionServices-UvUcOSRb.esm.js} +35 -28
  201. package/dist/personhood.d.ts +13 -20
  202. package/dist/personhood.esm.js +153 -85
  203. package/dist/phone.d.ts +1 -5
  204. package/dist/phone.esm.js +3 -10
  205. package/dist/{phoneManager-_KtitbUA.d.ts → phoneManager-BBU8Lq0O.d.ts} +4 -7
  206. package/dist/{phoneManager-CRblfdcI.esm.js → phoneManager-Cpiai2IM.esm.js} +82 -12
  207. package/dist/{phoneStateMachine-DjFGWMjQ.esm.js → phoneStateMachine-E1fUUcNM.esm.js} +7 -9
  208. package/dist/{platform-0Ot-bF_a.esm.js → platform-BJrm5nzZ.esm.js} +31 -11
  209. package/dist/privacyLensWorker-DI-Rg83h.esm.js +355 -0
  210. package/dist/qe-signature.d.ts +4 -6
  211. package/dist/qe-signature.esm.js +10 -11
  212. package/dist/{recordingService-CxaYkITO.esm.js → recordingService-N4RhdyiT.esm.js} +13 -31
  213. package/dist/redirect-to-mobile.d.ts +2 -6
  214. package/dist/redirect-to-mobile.esm.js +3 -10
  215. package/dist/{redirectToMobileManager-dv29o_LS.d.ts → redirectToMobileManager-BD2PvT5B.d.ts} +8 -44
  216. package/dist/{redirectToMobileManager-DbuNUlru.esm.js → redirectToMobileManager-C0dfc7f6.esm.js} +28 -8
  217. package/dist/{redirectToMobileStateMachine-BRaIJWOM.esm.js → redirectToMobileStateMachine-C9SYCJcH.esm.js} +74 -18
  218. package/dist/rolldown-runtime-FZ4Itg2g.esm.js +42 -0
  219. package/dist/{runChildModule-kojSv3MH.esm.js → runChildModule-DpRmKWV0.esm.js} +10 -9
  220. package/dist/{WasmUtilProvider-BgzcXBdl.esm.js → safeStorage-Ep56I-f_.esm.js} +98 -473
  221. package/dist/selfie.d.ts +8 -21
  222. package/dist/selfie.esm.js +40 -47
  223. package/dist/selfieErrorUtils-C2PYBVsp.esm.js +90 -0
  224. package/dist/{selfieManager-B1Px3GGa.esm.js → selfieManager-CmoNiluM.esm.js} +7 -10
  225. package/dist/{selfieManager-4juKfrHG.d.ts → selfieManager-DwlCppg0.d.ts} +3 -4
  226. package/dist/{selfieStateMachine-D0TS93Tu.esm.js → selfieStateMachine-L9pghTly.esm.js} +14 -29
  227. package/dist/{session-CLsU2Jnb.esm.js → session-DeR_I24J.esm.js} +16 -7
  228. package/dist/session.d.ts +12 -10
  229. package/dist/session.esm.js +5 -15
  230. package/dist/sessionInitializer-DNgRpf5Y.esm.js +1865 -0
  231. package/dist/{setup-CfNsYAeB.esm.js → setup-DuYKUt0r.esm.js} +319 -137
  232. package/dist/{setup-CmA2apmN.d.ts → setup-DywQeePQ.d.ts} +186 -4
  233. package/dist/signature.d.ts +2 -96
  234. package/dist/signature.esm.js +3 -108
  235. package/dist/signatureManager-DGBSWz2_.d.ts +106 -0
  236. package/dist/signatureManager-DdPgcmou.esm.js +113 -0
  237. package/dist/{signatureStateMachine-CdhlMih-.esm.js → signatureStateMachine-Cf73DGWO.esm.js} +5 -7
  238. package/dist/spawn-D9jgw9pW.d.ts +1441 -0
  239. package/dist/src-0Jurt29N.esm.js +4482 -0
  240. package/dist/{stats-BVy52wLy.esm.js → stats-B0nFKawG.esm.js} +3 -5
  241. package/dist/stats.esm.js +2 -5
  242. package/dist/topLevelStateName-B5i2avbh.esm.js +41 -0
  243. package/dist/{tri-CFAPtAUM.esm.js → tri-4RsGrIt6.esm.js} +3 -119
  244. package/dist/tri.d.ts +2 -2
  245. package/dist/tri.esm-BIjHhBJ2.esm.js +2620 -0
  246. package/dist/tri.esm.js +2 -4
  247. package/dist/trueSight-BTl_vvd3.esm.js +1 -0
  248. package/dist/trueSightService-s3T95geD.esm.js +1894 -0
  249. package/dist/trust-graph.d.ts +4 -5
  250. package/dist/trust-graph.esm.js +13 -9
  251. package/dist/types-BEwVKkLJ.d.ts +15 -0
  252. package/dist/{types-BKLb3C42.esm.js → types-BN5RPPIZ.esm.js} +1 -2
  253. package/dist/types-BSBzhHRH.d.ts +57 -0
  254. package/dist/types-BX_XkMsQ2.d.ts +21 -0
  255. package/dist/types-BfHiko5D.d.ts +48 -0
  256. package/dist/{types-D8Cl1N2Z.d.ts → types-BfgmV7s72.d.ts} +2 -2
  257. package/dist/types-CJ7Yl9K-2.d.ts +164 -0
  258. package/dist/types-DPIDuhut.d.ts +40 -0
  259. package/dist/types-DVmXIdzW.d.ts +82 -0
  260. package/dist/types-DelMqZLe.d.ts +105 -0
  261. package/dist/types-EELWyWpd.d.ts +6 -0
  262. package/dist/{types-fO6KIdol.d.ts → types-Hmd7U0JA.d.ts} +80 -6
  263. package/dist/{types-BUgeB2X6.d.ts → types-KPvmag_B.d.ts} +7 -7
  264. package/dist/types-M6eb82ra2.d.ts +589 -0
  265. package/dist/{types-DV3wkhQ4.d.ts → types-Vb4P9ovf.d.ts} +1 -3
  266. package/dist/{urlUtils-CpiYwn7w.esm.js → urlUtils-D6phjq1-.esm.js} +1 -2
  267. package/dist/{video-ZY92rkel.esm.js → video-BtSWtHy1.esm.js} +1 -2
  268. package/dist/video-selfie.d.ts +71 -117
  269. package/dist/video-selfie.esm.js +575 -643
  270. package/dist/videoSelfieCameraWarmer-DPx5Lm3d.esm.js +651 -0
  271. package/dist/videoSelfieStepDetector-D3oo2ofo.d.ts +123 -0
  272. package/dist/wasm.d.ts +2 -4
  273. package/dist/wasm.esm.js +4 -15
  274. package/dist/wasmDefaults-DTUrftxR.esm.js +125 -0
  275. package/dist/{wasmDsFlagSync-Ch0mFJNT.esm.js → wasmDsFlagSync-BqUCwLY8.esm.js} +2 -4
  276. package/dist/wasmWebClient-DM8lkb0z.esm.js +407 -0
  277. package/dist/watchlist-for-business.d.ts +1 -3
  278. package/dist/watchlist-for-business.esm.js +9 -9
  279. package/dist/watchlist.d.ts +1 -52
  280. package/dist/watchlist.esm.js +3 -70
  281. package/dist/{watchlistForBusinessStateMachine-R1Yp1g5A.esm.js → watchlistForBusinessStateMachine-BcBMkMvV.esm.js} +5 -7
  282. package/dist/watchlistManager-CjSMmbyq.esm.js +83 -0
  283. package/dist/watchlistManager-DLXef90v.d.ts +68 -0
  284. package/dist/{watchlistStateMachine-D07UVq1m.esm.js → watchlistStateMachine-Bl7Wy9Cm.esm.js} +5 -7
  285. package/dist/workflow.d.ts +239 -203
  286. package/dist/workflow.esm.js +156 -101
  287. package/dist/xstate-actors.esm-CtI5S0f4.esm.js +310 -0
  288. package/dist/{xstate.esm-nY3M5UYm.esm.js → xstate.esm-Cf4e0Cfd.esm.js} +136 -610
  289. package/package.json +14 -9
  290. package/dist/Actor-BwgmOPkb.d.ts +0 -2
  291. package/dist/Face2DProvider-CZU11g6r.esm.js +0 -824
  292. package/dist/FaceDetectionProvider-CPWg-PAH.d.ts +0 -119
  293. package/dist/IWasmUtilCapability-DaSNxgA8.d.ts +0 -150
  294. package/dist/PrivacyLensProvider-B_zrV25p.esm.js +0 -339
  295. package/dist/StateMachine-D5WO6lHS.d.ts +0 -2
  296. package/dist/StreamCanvasCapture-DHaWferF.d.ts +0 -42
  297. package/dist/ae-signature-Pp4oCAHD.esm.js +0 -12
  298. package/dist/api-DsbUi7TO.esm.js +0 -72
  299. package/dist/browser-DlFgHpoC-Br3G10gw.esm.js +0 -1425
  300. package/dist/browserSimulation-DZwEy9bu.esm.js +0 -2804
  301. package/dist/camera-CxxXV0VN.esm.js +0 -79
  302. package/dist/canvas-90BqS0NF.d.ts +0 -112
  303. package/dist/chunk-CIKcdghV.esm.js +0 -49
  304. package/dist/clientLifecycle-VyzRfALg.esm.js +0 -534
  305. package/dist/cpf-ocr.d.ts +0 -10
  306. package/dist/cpf-ocr.esm.js +0 -8
  307. package/dist/cpfOcrManager-9eM4z4o7.esm.js +0 -190
  308. package/dist/cpfOcrManager-C5U9E0hf.d.ts +0 -216
  309. package/dist/createFaceAvatar-BZSg2MNo.esm.js +0 -46
  310. package/dist/deepsightLoader-CU_tiLMx.esm.js +0 -62
  311. package/dist/flowServices-DkQmOkLV.esm.js +0 -208
  312. package/dist/geolocationManager-DaHYFkVO.d.ts +0 -156
  313. package/dist/getDeviceClass-DIjnTPjR.esm.js +0 -14
  314. package/dist/http-CnsKEaJY.esm.js +0 -0
  315. package/dist/idCaptureManager-CwuXtVu6.d.ts +0 -1013
  316. package/dist/index-BAyZ8_iI.d.ts +0 -93
  317. package/dist/openviduLazy-jPgABwrt.esm.js +0 -3
  318. package/dist/openviduLazy-wEojM41w.esm.js +0 -12
  319. package/dist/qe-signature-BnWIpR-O.esm.js +0 -12
  320. package/dist/sessionInitializer-Dj7-aJaP.esm.js +0 -547
  321. package/dist/tri.esm-DDJ1zOqG.esm.js +0 -2593
  322. package/dist/types-BcF-fii5.d.ts +0 -5
  323. package/dist/videoSelfieSteps-Djpv7cjb.esm.js +0 -58
  324. /package/dist/{IVisibilityObserverCapability-BZ1rE7ly.d.ts → IVisibilityObserverCapability-D4tvIB5v.d.ts} +0 -0
  325. /package/dist/{camera-CKU96nwJ.d.ts → camera-9wWD-pwg.d.ts} +0 -0
  326. /package/dist/{flowCompletionService-BOSTlAWo.d.ts → flowCompletionService-BlAHsKyv.d.ts} +0 -0
  327. /package/dist/{types-BgjMAEXl.d.ts → types-Bk_6dmDa.d.ts} +0 -0
  328. /package/dist/{warmup-Dd0iq6KF.d.ts → warmup-Dv2alr2-.d.ts} +0 -0
@@ -0,0 +1,2620 @@
1
+ const n = class t {
2
+ constructor() {
3
+ this.t = !1;
4
+ }
5
+ static get instance() {
6
+ return t.i || (t.i = new t()), t.i;
7
+ }
8
+ get DEBUG() {
9
+ return this.t;
10
+ }
11
+ set DEBUG(t) {
12
+ this.t = t;
13
+ }
14
+ warn(t, n, ...e) {
15
+ this.t && this.o("warn", t, n, ...e);
16
+ }
17
+ error(t, n, ...e) {
18
+ this.t && this.o("error", t, n, ...e);
19
+ }
20
+ info(t, n, ...e) {
21
+ this.t && this.o("info", t, n, ...e);
22
+ }
23
+ fatal(t, n, e, ...i) {
24
+ this.o(t, n, e, ...i);
25
+ }
26
+ o(t, n, e, ...i) {
27
+ const o = n ? `[${n}]` : "", r = console?.[t];
28
+ r && r(`[IncodeTRI]${o} ${e}`, ...i);
29
+ }
30
+ }.instance;
31
+ function e(t, n, e) {
32
+ let i = t, o = n;
33
+ if ("devicepixelratiochange" === n) {
34
+ const t = window.devicePixelRatio;
35
+ i = window.matchMedia(`(resolution: ${t}dppx)`), o = "change";
36
+ }
37
+ i.addEventListener(o, e, {
38
+ capture: !0,
39
+ passive: !0
40
+ });
41
+ }
42
+ function i(t, n, e) {
43
+ let i = t, o = n;
44
+ if ("devicepixelratiochange" === n) {
45
+ const t = window.devicePixelRatio;
46
+ i = window.matchMedia(`(resolution: ${t}dppx)`), o = "change";
47
+ }
48
+ i.removeEventListener(o, e, { capture: !0 });
49
+ }
50
+ const o = globalThis.setTimeout.bind(globalThis);
51
+ const r = globalThis.clearTimeout.bind(globalThis);
52
+ function s(t, e) {
53
+ try {
54
+ return t();
55
+ } catch (t) {
56
+ n.warn("utils", "safeSync swallowed error:", t);
57
+ }
58
+ }
59
+ async function c(t) {
60
+ try {
61
+ return await t();
62
+ } catch (t) {
63
+ n.warn("utils", "safeAsync swallowed error:", t);
64
+ }
65
+ }
66
+ function a(t) {
67
+ return (n) => s(() => t(n));
68
+ }
69
+ function l(t) {
70
+ return (...e) => {
71
+ try {
72
+ t(...e);
73
+ } catch (t) {
74
+ n.warn("utils", "safeTimer swallowed error:", t);
75
+ }
76
+ };
77
+ }
78
+ function u(t, n) {
79
+ return o(l(t), n);
80
+ }
81
+ function d(t) {
82
+ if (null !== t) try {
83
+ r(t);
84
+ } catch (t) {
85
+ n.warn("utils", "safeClearTimeout swallowed error:", t);
86
+ }
87
+ }
88
+ const h = /* @__PURE__ */ new Set([
89
+ "xmlhttprequest",
90
+ "fetch",
91
+ "beacon",
92
+ "navigation",
93
+ "script",
94
+ "link",
95
+ "css",
96
+ "img",
97
+ "iframe",
98
+ "video",
99
+ "audio"
100
+ ]);
101
+ const f = /* @__PURE__ */ new Set([
102
+ "xmlhttprequest",
103
+ "fetch",
104
+ "beacon"
105
+ ]);
106
+ function p(t, n) {
107
+ return n ? t : null;
108
+ }
109
+ function m(t, n) {
110
+ const e = t, i = t.responseStart > 0, o = p(t.domainLookupEnd - t.domainLookupStart, i), r = p(t.connectEnd - t.connectStart, i), s = p(t.connectEnd > 0 && t.secureConnectionStart > 0 ? t.connectEnd - t.secureConnectionStart : 0, i), c = p(t.responseStart - t.requestStart, i), a = p(t.responseEnd - t.responseStart, i), l = i ? t.transferSize : null, u = i ? t.encodedBodySize : null, d = i ? t.decodedBodySize : null, f = i && t.nextHopProtocol || null, m = i && void 0 !== e.deliveryType ? e.deliveryType : null, w = e.responseStatus, y = void 0 !== w && 0 !== w ? w : null;
111
+ return {
112
+ name: "network_request",
113
+ timestamp: Date.now(),
114
+ performanceTime: t.startTime + t.duration,
115
+ url: n(t.name),
116
+ initiatorType: (v = t.initiatorType, h.has(v) ? v : "other"),
117
+ startTime: t.startTime,
118
+ durationMs: t.duration,
119
+ dnsLookupMs: o,
120
+ tcpConnectMs: r,
121
+ tlsHandshakeMs: s,
122
+ ttfbMs: c,
123
+ responseDownloadMs: a,
124
+ transferSize: l,
125
+ encodedBodySize: u,
126
+ decodedBodySize: d,
127
+ nextHopProtocol: f,
128
+ deliveryType: m,
129
+ responseStatus: y
130
+ };
131
+ var v;
132
+ }
133
+ function w() {}
134
+ const y = 2e3;
135
+ function v(t) {
136
+ return !!t && t.nodeType === Node.TEXT_NODE;
137
+ }
138
+ function b(t, n) {
139
+ return t.tagName?.toLowerCase() === n.toLowerCase();
140
+ }
141
+ function g(t) {
142
+ return !!t && t.nodeType === Node.DOCUMENT_FRAGMENT_NODE;
143
+ }
144
+ function k(t) {
145
+ return !!t && t.hasAttribute("data-tri-ignore");
146
+ }
147
+ function T(t) {
148
+ return !!t && t.hasAttribute("data-tri-redact");
149
+ }
150
+ function _(t, n) {
151
+ return n?.includes(t.toLowerCase()) ?? !1;
152
+ }
153
+ function I(t) {
154
+ try {
155
+ return new URL(t).origin !== window.location.origin;
156
+ } catch {
157
+ return !1;
158
+ }
159
+ }
160
+ function x(t, n) {
161
+ return !t || (t[n]?.enabled ?? !1);
162
+ }
163
+ function S() {
164
+ const t = document.activeElement;
165
+ if (t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement) {
166
+ const n = t.selectionStart, e = t.selectionEnd;
167
+ return null == n || null == e || n === e ? null : t.value.substring(n, e);
168
+ }
169
+ const n = window.getSelection();
170
+ return !n || n.isCollapsed ? null : n.toString() || null;
171
+ }
172
+ function E(t, n) {
173
+ return "off" !== n && !k(t) && !T(t);
174
+ }
175
+ function A(t) {
176
+ const n = document.activeElement;
177
+ if (n instanceof HTMLInputElement || n instanceof HTMLTextAreaElement) return n;
178
+ const e = window.getSelection();
179
+ return (i = ("start" === t ? e?.anchorNode : e?.focusNode) ?? null) ? v(i) ? i.parentElement : i instanceof Element ? i : null : null;
180
+ var i;
181
+ }
182
+ function M() {
183
+ const t = window, n = "__fpjs_p_l_b", e = t[n];
184
+ if (function(t, n) {
185
+ var e;
186
+ const i = null === (e = Object.getOwnPropertyDescriptor) || void 0 === e ? void 0 : e.call(Object, t, n);
187
+ (null == i ? void 0 : i.configurable) ? delete t[n] : i && !i.writable || (t[n] = void 0);
188
+ }(t, n), "function" != typeof (null == e ? void 0 : e.load)) throw new Error($);
189
+ return e;
190
+ }
191
+ const D = "Blocked by CSP";
192
+ const C = "The endpoint parameter is not a valid URL";
193
+ function P(t) {
194
+ return function(t, n) {
195
+ const e = document, i = "securitypolicyviolation";
196
+ let o;
197
+ const r = (n) => {
198
+ const e = new URL(t, location.href), { blockedURI: i } = n;
199
+ i !== e.href && i !== e.protocol.slice(0, -1) && i !== e.origin || (o = n, s());
200
+ };
201
+ e.addEventListener(i, r);
202
+ const s = () => e.removeEventListener(i, r);
203
+ return Promise.resolve().then(n).then((t) => (s(), t), (t) => new Promise((t) => {
204
+ const n = new MessageChannel();
205
+ n.port1.onmessage = () => t(), n.port2.postMessage(null);
206
+ }).then(() => {
207
+ if (s(), o) return (() => {
208
+ throw new Error(D);
209
+ })();
210
+ throw t;
211
+ }));
212
+ }(t, () => function(t) {
213
+ return new Promise((n, e) => {
214
+ if (function(t) {
215
+ if (URL.prototype) try {
216
+ return new URL(t, location.href), !1;
217
+ } catch (t) {
218
+ if (t instanceof Error && "TypeError" === t.name) return !0;
219
+ throw t;
220
+ }
221
+ }(t)) throw new Error(C);
222
+ const i = document.createElement("script"), o = () => {
223
+ var t;
224
+ return null === (t = i.parentNode) || void 0 === t ? void 0 : t.removeChild(i);
225
+ }, r = document.head || document.getElementsByTagName("head")[0];
226
+ i.onload = () => {
227
+ o(), n();
228
+ }, i.onerror = () => {
229
+ o(), e(new Error(R));
230
+ }, i.async = !0, i.src = t, r.appendChild(i);
231
+ });
232
+ }(t)).then(M);
233
+ }
234
+ const z = "API key required";
235
+ var L = "3.12.9";
236
+ const R = "Failed to load the JS script of the agent";
237
+ const $ = "9319";
238
+ const U = { scriptUrl: "https://fpnpmcdn.net/v<version>/<apiKey>/loader_v<loaderVersion>.js" };
239
+ function B(t) {
240
+ function n() {
241
+ return globalThis.window && globalThis.window[t] && void 0 !== globalThis.window[t];
242
+ }
243
+ return {
244
+ get: function(e) {
245
+ if (!n()) return null;
246
+ try {
247
+ const n = window[t].getItem(e) ?? "null";
248
+ return "null" === n ? null : JSON.parse(n);
249
+ } catch {
250
+ return null;
251
+ }
252
+ },
253
+ set: function(e, i) {
254
+ n() && s(() => window[t].setItem(e, JSON.stringify(i)));
255
+ },
256
+ remove: function(e) {
257
+ n() && s(() => window[t].removeItem(e));
258
+ },
259
+ key: function(e) {
260
+ return n() ? window[t].key(e) : null;
261
+ },
262
+ get length() {
263
+ return n() ? window[t].length : 0;
264
+ }
265
+ };
266
+ }
267
+ const O = B("localStorage");
268
+ const q = B("sessionStorage");
269
+ const j = "__tri_fingerprint";
270
+ let H = null;
271
+ let N = null;
272
+ async function F(t) {
273
+ try {
274
+ const e = await (await function(t) {
275
+ return H || (H = function(t) {
276
+ var n, e;
277
+ const { picked: i, rest: o } = function(t, n) {
278
+ const e = {}, i = {};
279
+ for (const [o, r] of Object.entries(t)) n.includes(o) ? e[o] = r : i[o] = r;
280
+ return {
281
+ picked: e,
282
+ rest: i
283
+ };
284
+ }(t, [
285
+ "scriptUrlPattern",
286
+ "token",
287
+ "apiKey"
288
+ ]), r = null !== (n = i.apiKey) && void 0 !== n ? n : i.token, s = null !== (e = function(t, n) {
289
+ return function(t, n) {
290
+ return Object.prototype.hasOwnProperty.call(t, n);
291
+ }(t, n) ? t[n] : void 0;
292
+ }(t, "scriptUrlPattern")) && void 0 !== e ? e : U.scriptUrl, [c, a] = function() {
293
+ const t = [], n = () => {
294
+ t.push({
295
+ time: /* @__PURE__ */ new Date(),
296
+ state: document.visibilityState
297
+ });
298
+ }, e = ((i = document).addEventListener("visibilitychange", o = n, r), () => i.removeEventListener("visibilitychange", o, r));
299
+ var i, o, r;
300
+ return n(), [t, e];
301
+ }();
302
+ return Promise.resolve().then(() => {
303
+ if (!r || "string" != typeof r) throw new Error(z);
304
+ return function(t, n) {
305
+ const e = [], [i, o] = function(t) {
306
+ const n = function(t) {
307
+ const n = [...t];
308
+ return {
309
+ current: () => n[0],
310
+ postpone() {
311
+ const t = n.shift();
312
+ void 0 !== t && n.push(t);
313
+ },
314
+ exclude() {
315
+ n.shift();
316
+ }
317
+ };
318
+ }(t), e = function() {
319
+ let t = 0;
320
+ return () => Math.random() * Math.min(3e3, 100 * Math.pow(2, t++));
321
+ }(), i = /* @__PURE__ */ new Set();
322
+ return [n.current(), (t, o) => {
323
+ let r;
324
+ const s = o instanceof Error ? o.message : "";
325
+ if (s === D || s === C) n.exclude(), r = 0;
326
+ else if (s === $) n.exclude();
327
+ else if (s === R) {
328
+ const e = Date.now() - t.getTime() < 50, o = n.current();
329
+ o && e && !i.has(o) && (i.add(o), r = 0), n.postpone();
330
+ } else n.postpone();
331
+ const c = n.current();
332
+ return void 0 === c ? void 0 : [c, null != r ? r : t.getTime() + e() - Date.now()];
333
+ }];
334
+ }(t);
335
+ let r;
336
+ if (void 0 === i) return Promise.reject(/* @__PURE__ */ new TypeError("The list of script URL patterns is empty"));
337
+ const s = (t) => {
338
+ const i = /* @__PURE__ */ new Date(), c = (n) => e.push({
339
+ url: t,
340
+ startedAt: i,
341
+ finishedAt: /* @__PURE__ */ new Date(),
342
+ error: n
343
+ }), a = n(t);
344
+ return a.then(() => c(), c), a.catch((t) => {
345
+ if (r ??= t, e.length >= 5) throw r;
346
+ const n = o(i, t);
347
+ if (!n) throw r;
348
+ const [c, a] = n;
349
+ return (l = a, new Promise((t) => setTimeout(t, l))).then(() => s(c));
350
+ var l;
351
+ });
352
+ };
353
+ return s(i).then((t) => [t, e]);
354
+ }(function(t, n) {
355
+ return (Array.isArray(t) ? t : [t]).map((t) => function(t, n) {
356
+ const e = encodeURIComponent;
357
+ return t.replace(/<[^<>]+>/g, (t) => "<version>" === t ? "3" : "<apiKey>" === t ? e(n) : "<loaderVersion>" === t ? e(L) : t);
358
+ }(String(t), n));
359
+ }(s, r), P);
360
+ }).catch((t) => {
361
+ throw a(), function(t) {
362
+ return t instanceof Error && t.message === $ ? /* @__PURE__ */ new Error(R) : t;
363
+ }(t);
364
+ }).then(([t, n]) => (a(), t.load({
365
+ ...o,
366
+ ldi: {
367
+ attempts: n,
368
+ visibilityStates: c
369
+ }
370
+ })));
371
+ }({
372
+ apiKey: t.apiKey,
373
+ region: t.region,
374
+ endpoint: t.endpoint,
375
+ scriptUrlPattern: t.scriptUrlPattern
376
+ }).catch((t) => {
377
+ throw H = null, t;
378
+ }), H);
379
+ }(t)).get({
380
+ timeout: t.timeoutMs,
381
+ extendedResult: !0
382
+ });
383
+ if (!e.visitorId) return null;
384
+ const i = t.cacheTtlMs ?? 2592e6;
385
+ return i > 0 && function(t, n, e) {
386
+ const i = {
387
+ visitorId: t,
388
+ requestId: n,
389
+ expiresAt: Date.now() + e
390
+ };
391
+ O.set(j, i);
392
+ }(e.visitorId, e.requestId, i), {
393
+ visitorId: e.visitorId,
394
+ requestId: e.requestId
395
+ };
396
+ } catch {
397
+ return null;
398
+ }
399
+ }
400
+ const X = {
401
+ apiKey: "5uYRiI0XM6p8k4124ELX",
402
+ endpoint: "https://fingerprint.incodesmile.com",
403
+ scriptUrlPattern: "https://fingerprint.incodesmile.com/web/v<version>/<apiKey>/loader_v<loaderVersion>.js"
404
+ };
405
+ const K = {
406
+ focusin: "in",
407
+ focusout: "out"
408
+ };
409
+ function V(t) {
410
+ return t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement || t instanceof HTMLSelectElement;
411
+ }
412
+ const Y = /* @__PURE__ */ new Set([
413
+ "Shift",
414
+ "Control",
415
+ "Alt",
416
+ "Meta",
417
+ "Backspace",
418
+ "Delete",
419
+ "Enter",
420
+ "Tab",
421
+ "CapsLock",
422
+ "ArrowUp",
423
+ "ArrowDown",
424
+ "ArrowLeft",
425
+ "ArrowRight"
426
+ ]);
427
+ const J = {
428
+ mouse: "mouse",
429
+ touch: "touch",
430
+ pen: "pen"
431
+ };
432
+ const G = {
433
+ pointerdown: "down",
434
+ pointerup: "up",
435
+ click: "click",
436
+ dblclick: "dblclick",
437
+ contextmenu: "contextmenu"
438
+ };
439
+ function Z(t, n, e, i, o) {
440
+ return {
441
+ name: "navigation",
442
+ timestamp: Date.now(),
443
+ phase: t,
444
+ type: n,
445
+ from: e.from,
446
+ to: e.to,
447
+ timeOrigin: i,
448
+ timing: o
449
+ };
450
+ }
451
+ const Q = {
452
+ fingerprint: {
453
+ create: function(t) {
454
+ let n = !1;
455
+ return c(async () => {
456
+ const e = await async function(t) {
457
+ const n = function() {
458
+ const t = O.get(j);
459
+ return t ? "string" != typeof t.visitorId || "number" != typeof t.expiresAt || t.expiresAt <= Date.now() ? (O.remove(j), null) : {
460
+ visitorId: t.visitorId,
461
+ requestId: "string" == typeof t.requestId ? t.requestId : ""
462
+ } : null;
463
+ }();
464
+ return n ? {
465
+ visitorId: n.visitorId,
466
+ requestId: n.requestId || null
467
+ } : N || (N = F(t).finally(() => {
468
+ N = null;
469
+ }), N);
470
+ }(X);
471
+ !n && e && t.push({
472
+ name: "fingerprint",
473
+ deviceId: e.visitorId,
474
+ requestId: e.requestId,
475
+ timestamp: Date.now()
476
+ });
477
+ }), () => {
478
+ n = !0;
479
+ };
480
+ },
481
+ layer: "device-fingerprinting"
482
+ },
483
+ pointer: {
484
+ create: function(t, n, o) {
485
+ const r = a((n) => {
486
+ const e = function(n) {
487
+ const e = n, i = function(t) {
488
+ if ("mouse" === t.pointerType) return {
489
+ button: t.button,
490
+ buttons: t.buttons
491
+ };
492
+ const n = {
493
+ force: t.pressure,
494
+ contact: Math.min(t.width, t.height)
495
+ };
496
+ return "pen" === t.pointerType && (n.tiltX = t.tiltX, n.tiltY = t.tiltY, n.twist = t.twist), n;
497
+ }(e);
498
+ return {
499
+ id: e.pointerId,
500
+ name: "pointer",
501
+ timestamp: Date.now(),
502
+ type: J[e.pointerType] ?? "unknown",
503
+ phase: G[n.type],
504
+ isTrusted: e.isTrusted,
505
+ element: t.resolveElement(e.target),
506
+ isPrimary: e.isPrimary,
507
+ modifiers: {
508
+ shift: e.shiftKey,
509
+ ctrl: e.ctrlKey,
510
+ alt: e.altKey,
511
+ meta: e.metaKey
512
+ },
513
+ coordinates: {
514
+ x: e.clientX,
515
+ y: e.clientY
516
+ },
517
+ ...i
518
+ };
519
+ }(n);
520
+ t.push(e);
521
+ });
522
+ return x(o, "pointer") && (e(document, "pointerdown", r), e(document, "pointerup", r)), x(o, "click") && e(document, "click", r), x(o, "dblclick") && e(document, "dblclick", r), x(o, "contextmenu") && e(document, "contextmenu", r), () => {
523
+ i(document, "pointerdown", r), i(document, "pointerup", r), i(document, "click", r), i(document, "dblclick", r), i(document, "contextmenu", r);
524
+ };
525
+ },
526
+ layer: "behavioral",
527
+ events: [
528
+ "pointer",
529
+ "click",
530
+ "dblclick",
531
+ "contextmenu"
532
+ ]
533
+ },
534
+ pointermove: {
535
+ create: function(t) {
536
+ let n = null, o = null;
537
+ const r = a((e) => {
538
+ const i = e;
539
+ n && n.id !== i.pointerId && (t.push(n), n = null), n ? n.samples.ts.length >= 50 ? (t.push(n), n = s(i), c(t)) : (n.samples.x.push(i.clientX), n.samples.y.push(i.clientY), n.samples.ts.push(i.timeStamp), "pen" === i.pointerType && (n.samples.tiltX?.push(i.tiltX), n.samples.tiltY?.push(i.tiltY)), "mouse" !== i.pointerType && (n.samples.force?.push(i.pressure), n.samples.radius?.push(Math.max(i.width, i.height))), c(t)) : (n = s(i), c(t));
540
+ });
541
+ function s(t) {
542
+ const n = function(t) {
543
+ if ("mouse" === t.pointerType) return null;
544
+ const n = {
545
+ force: [t.pressure],
546
+ radius: [Math.max(t.width, t.height)]
547
+ };
548
+ return "pen" === t.pointerType && (n.tiltX = [t.tiltX], n.tiltY = [t.tiltY]), n;
549
+ }(t);
550
+ return {
551
+ name: "pointer",
552
+ timestamp: Date.now(),
553
+ id: t.pointerId,
554
+ type: t.pointerType,
555
+ phase: "move",
556
+ isTrusted: t.isTrusted,
557
+ isPrimary: t.isPrimary,
558
+ samples: {
559
+ x: [t.clientX],
560
+ y: [t.clientY],
561
+ ts: [t.timeStamp],
562
+ ...n ?? {}
563
+ }
564
+ };
565
+ }
566
+ function c(t) {
567
+ o && clearTimeout(o), o = setTimeout(() => {
568
+ n && (t.push(n), n = null), o = null;
569
+ }, y);
570
+ }
571
+ return e(document, "pointermove", r), () => {
572
+ i(document, "pointermove", r), o && (clearTimeout(o), o = null), n && (t.push(n), n = null);
573
+ };
574
+ },
575
+ layer: "behavioral"
576
+ },
577
+ focus: {
578
+ create: function(t) {
579
+ const n = a((n) => {
580
+ const e = function(n) {
581
+ const e = n;
582
+ return {
583
+ name: "focus",
584
+ type: K[n.type] ?? "unknown",
585
+ timestamp: Date.now(),
586
+ isTrusted: e.isTrusted,
587
+ element: t.resolveElement(e.target),
588
+ relatedTarget: t.resolveElement(e.relatedTarget)
589
+ };
590
+ }(n);
591
+ t.push(e);
592
+ });
593
+ return e(document, "focusin", n), e(document, "focusout", n), () => {
594
+ i(document, "focusin", n), i(document, "focusout", n);
595
+ };
596
+ },
597
+ layer: "behavioral"
598
+ },
599
+ input: {
600
+ create: function(t) {
601
+ const n = a((n) => {
602
+ const e = n;
603
+ t.push(function(n) {
604
+ return {
605
+ name: "keystroke",
606
+ type: "input",
607
+ timestamp: Date.now(),
608
+ isTrusted: n.isTrusted,
609
+ element: t.resolveElement(n.target),
610
+ inputType: n.inputType ?? "",
611
+ isComposing: n.isComposing ?? !1,
612
+ length: (e = n.target, e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement ? e.value.length : 0)
613
+ };
614
+ var e;
615
+ }(e)), function(t) {
616
+ if ("insertReplacementText" === t.inputType) return !0;
617
+ const n = t.target;
618
+ return !!V(n) && function(t) {
619
+ try {
620
+ return t.matches(":-webkit-autofill");
621
+ } catch {
622
+ return !1;
623
+ }
624
+ }(n);
625
+ }(e) && t.push(function(t, n) {
626
+ const e = t.target;
627
+ let i = 0;
628
+ return V(e) && (i = e.value.length), {
629
+ name: "autofill",
630
+ timestamp: Date.now(),
631
+ element: n.resolveElement(e),
632
+ length: i
633
+ };
634
+ }(e, t));
635
+ });
636
+ return e(document, "input", n), function() {
637
+ i(document, "input", n);
638
+ };
639
+ },
640
+ layer: "behavioral"
641
+ },
642
+ keystroke: {
643
+ create: function(t) {
644
+ const { resolve: n, reset: o } = function() {
645
+ let t = 0;
646
+ const n = /* @__PURE__ */ new Map();
647
+ return {
648
+ resolve: function(e, i) {
649
+ if ("keydown" === i) {
650
+ const i = n.get(e);
651
+ if (void 0 !== i) return i;
652
+ const o = ++t;
653
+ if (n.size >= 32) {
654
+ const t = n.keys().next().value;
655
+ void 0 !== t && n.delete(t);
656
+ }
657
+ return n.set(e, o), o;
658
+ }
659
+ const o = n.get(e);
660
+ return void 0 !== o ? (n.delete(e), o) : ++t;
661
+ },
662
+ reset: function() {
663
+ n.clear();
664
+ }
665
+ };
666
+ }(), r = a((e) => {
667
+ const i = function(t) {
668
+ const e = t, i = t.type;
669
+ return {
670
+ name: "keystroke",
671
+ type: i,
672
+ id: n(e.code, i),
673
+ timestamp: Date.now(),
674
+ isTrusted: e.isTrusted,
675
+ keys: Y.has(e.key) ? [e.key] : []
676
+ };
677
+ }(e);
678
+ t.push(i);
679
+ }), s = a(() => {
680
+ o();
681
+ });
682
+ return e(document, "keydown", r), e(document, "keyup", r), e(window, "blur", s), () => {
683
+ i(document, "keydown", r), i(document, "keyup", r), i(window, "blur", s);
684
+ };
685
+ },
686
+ layer: "behavioral"
687
+ },
688
+ clipboard: {
689
+ create: function(t, n = "on", o) {
690
+ const r = a((e) => {
691
+ const i = function(e) {
692
+ const i = e, o = e.type, r = ("paste" === e.type ? i.clipboardData?.getData("text/plain") : S()) ?? null, s = E(i.target, n);
693
+ return {
694
+ name: "clipboard",
695
+ type: o,
696
+ timestamp: Date.now(),
697
+ isTrusted: i.isTrusted,
698
+ element: t.resolveElement(i.target),
699
+ length: r?.length ?? 0,
700
+ ...s && r ? { content: r } : {}
701
+ };
702
+ }(e);
703
+ t.push(i);
704
+ });
705
+ return x(o, "paste") && e(document, "paste", r), x(o, "cut") && e(document, "cut", r), x(o, "copy") && e(document, "copy", r), () => {
706
+ i(document, "paste", r), i(document, "cut", r), i(document, "copy", r);
707
+ };
708
+ },
709
+ layer: "behavioral",
710
+ events: [
711
+ "paste",
712
+ "cut",
713
+ "copy"
714
+ ]
715
+ },
716
+ form: {
717
+ create: function(t, n, o) {
718
+ const r = a((n) => {
719
+ const e = {
720
+ name: "form",
721
+ type: (i = n).type,
722
+ timestamp: Date.now(),
723
+ isTrusted: i.isTrusted,
724
+ element: t.resolveElement(i.target)
725
+ };
726
+ var i;
727
+ t.push(e);
728
+ });
729
+ return x(o, "submit") && e(document, "submit", r), x(o, "invalid") && e(document, "invalid", r), () => {
730
+ i(document, "submit", r), i(document, "invalid", r);
731
+ };
732
+ },
733
+ layer: "behavioral",
734
+ events: ["submit", "invalid"]
735
+ },
736
+ change: {
737
+ create: function(t) {
738
+ const n = a((n) => {
739
+ const e = (i = n, {
740
+ name: "change",
741
+ timestamp: Date.now(),
742
+ isTrusted: i.isTrusted,
743
+ element: t.resolveElement(i.target)
744
+ });
745
+ var i;
746
+ t.push(e);
747
+ });
748
+ return e(document, "change", n), () => {
749
+ i(document, "change", n);
750
+ };
751
+ },
752
+ layer: "behavioral"
753
+ },
754
+ selection: {
755
+ create: function(t, n) {
756
+ let o = !1, r = 0, s = null, c = !1, l = !1;
757
+ function u() {
758
+ s && (clearTimeout(s), s = null);
759
+ }
760
+ function d() {
761
+ u(), c || l || (s = setTimeout(() => {
762
+ s = null, o && h("timeout");
763
+ }, 250));
764
+ }
765
+ function h(e) {
766
+ o && (o = !1, u(), function(e) {
767
+ const i = A("end"), o = i && E(i, n), r = S();
768
+ t.push({
769
+ name: "selection",
770
+ phase: "end",
771
+ timestamp: Date.now(),
772
+ trigger: e,
773
+ isTrusted: !0,
774
+ element: t.resolveElement(i),
775
+ length: r?.length ?? 0,
776
+ ...o && r ? { content: r } : {}
777
+ });
778
+ }(e));
779
+ }
780
+ const f = a(() => {
781
+ const n = function() {
782
+ const t = document.getSelection();
783
+ return !t || t.isCollapsed || 0 === t.rangeCount;
784
+ }();
785
+ if (!o && !n) return o = !0, r = Date.now(), t.push({
786
+ name: "selection",
787
+ phase: "start",
788
+ timestamp: r,
789
+ element: t.resolveElement(A("start"))
790
+ }), void d();
791
+ o && n ? h("collapse") : o && d();
792
+ }), p = a((t) => {
793
+ 0 === t.button && (c = !0, u());
794
+ }), m = a((t) => {
795
+ 0 === t.button && (c = !1, o && h("pointer"));
796
+ }), w = a((t) => {
797
+ "Shift" === t.key && (l = !0, u());
798
+ }), y = a((t) => {
799
+ "Shift" === t.key && (l = !1, o && h("keyboard"));
800
+ }), v = a(() => {
801
+ c = !1;
802
+ }), b = a(() => {
803
+ "hidden" === document.visibilityState && (c = !1, l = !1, o && h("timeout"));
804
+ }), g = a(() => {
805
+ c = !1, o && h("pointer");
806
+ });
807
+ return e(document, "selectionchange", f), e(document, "pointerdown", p), e(document, "pointerup", m), e(document, "keydown", w), e(document, "keyup", y), e(document, "contextmenu", v), e(document, "visibilitychange", b), e(document, "dragend", g), () => {
808
+ u(), i(document, "selectionchange", f), i(document, "pointerdown", p), i(document, "pointerup", m), i(document, "keydown", w), i(document, "keyup", y), i(document, "contextmenu", v), i(document, "visibilitychange", b), i(document, "dragend", g);
809
+ };
810
+ },
811
+ layer: "behavioral"
812
+ },
813
+ tab: {
814
+ create: () => () => {},
815
+ layer: "session",
816
+ events: ["state", "count"]
817
+ },
818
+ visibility: {
819
+ create: function(t) {
820
+ const n = a((n) => {
821
+ const e = document.visibilityState;
822
+ if ("visible" !== e && "hidden" !== e) return;
823
+ const i = {
824
+ name: "visibility",
825
+ type: e,
826
+ timestamp: Date.now(),
827
+ isTrusted: n.isTrusted
828
+ };
829
+ t.push(i);
830
+ });
831
+ return e(document, "visibilitychange", n), () => {
832
+ i(document, "visibilitychange", n);
833
+ };
834
+ },
835
+ layer: "session"
836
+ },
837
+ navigation: {
838
+ create: function(t) {
839
+ let n = t.sanitizeUrl(document.referrer || "");
840
+ function o(e) {
841
+ t.push(e), n = e.to ?? "";
842
+ }
843
+ const r = a(() => {
844
+ const [n] = performance.getEntriesByType("navigation");
845
+ var e;
846
+ o(Z("load", n?.type ?? "navigate", {
847
+ from: document.referrer ? t.sanitizeUrl(document.referrer) : null,
848
+ to: t.sanitizeUrl(location.href)
849
+ }, performance.timeOrigin, n ? {
850
+ fetchStart: (e = n).fetchStart,
851
+ domainLookupStart: e.domainLookupStart,
852
+ domainLookupEnd: e.domainLookupEnd,
853
+ connectStart: e.connectStart,
854
+ connectEnd: e.connectEnd,
855
+ requestStart: e.requestStart,
856
+ responseStart: e.responseStart,
857
+ responseEnd: e.responseEnd,
858
+ domInteractive: e.domInteractive,
859
+ domContentLoadedEventStart: e.domContentLoadedEventStart,
860
+ domContentLoadedEventEnd: e.domContentLoadedEventEnd,
861
+ domComplete: e.domComplete,
862
+ loadEventStart: e.loadEventStart,
863
+ loadEventEnd: e.loadEventEnd,
864
+ redirectCount: e.redirectCount,
865
+ transferSize: e.transferSize,
866
+ encodedBodySize: e.encodedBodySize,
867
+ decodedBodySize: e.decodedBodySize
868
+ } : void 0));
869
+ }), c = a((e) => {
870
+ const i = e;
871
+ if (null === i.navigationType) return;
872
+ const r = t.sanitizeUrl(location.href);
873
+ r !== n && o(Z("change", i.navigationType, {
874
+ from: n,
875
+ to: r
876
+ }, performance.timeOrigin));
877
+ }), l = a(() => d("traverse")), u = a(() => d("hashchange"));
878
+ function d(e) {
879
+ const i = t.sanitizeUrl(location.href);
880
+ "hashchange" === e && i === n || o(Z("change", e, {
881
+ from: n,
882
+ to: i
883
+ }, performance.timeOrigin));
884
+ }
885
+ const h = history.pushState, f = history.replaceState, p = function(...t) {
886
+ const n = h.apply(this, t);
887
+ return s(() => d("push")), n;
888
+ }, m = function(...t) {
889
+ const n = f.apply(this, t);
890
+ return s(() => d("replace")), n;
891
+ };
892
+ return window.navigation ? e(window.navigation, "currententrychange", c) : (history.pushState = p, history.replaceState = m, e(window, "popstate", l), e(window, "hashchange", u)), "complete" === document.readyState ? r(new Event("load")) : e(window, "load", r), () => {
893
+ window.navigation ? i(window.navigation, "currententrychange", c) : (history.pushState === p && (history.pushState = h), history.replaceState === m && (history.replaceState = f), i(window, "popstate", l), i(window, "hashchange", u)), i(window, "load", r);
894
+ };
895
+ },
896
+ layer: "session"
897
+ },
898
+ networkconnection: {
899
+ create: function(t) {
900
+ const n = a(() => {
901
+ const n = {
902
+ name: "network",
903
+ type: "connection",
904
+ state: navigator.onLine ? "online" : "offline",
905
+ timestamp: Date.now()
906
+ };
907
+ t.push(n);
908
+ });
909
+ return e(window, "online", n), e(window, "offline", n), () => {
910
+ i(window, "online", n), i(window, "offline", n);
911
+ };
912
+ },
913
+ layer: "session"
914
+ },
915
+ scroll: {
916
+ create: function(t) {
917
+ let n = null, o = null;
918
+ const r = a((e) => n ? n.samples.ts.length >= 50 ? (t.push(n), n = s(e), void c(t)) : (n.samples.x.push(window.scrollX), n.samples.y.push(window.scrollY), n.samples.ts.push(e.timeStamp), void c(t)) : (n = s(e), void c(t)));
919
+ function s(t) {
920
+ return {
921
+ name: "scroll",
922
+ timestamp: Date.now(),
923
+ samples: {
924
+ x: [window.scrollX],
925
+ y: [window.scrollY],
926
+ ts: [t.timeStamp]
927
+ },
928
+ height: window.innerHeight,
929
+ width: window.innerWidth,
930
+ scrollX: window.scrollX,
931
+ scrollY: window.scrollY,
932
+ pageX: window.pageXOffset,
933
+ pageY: window.pageYOffset
934
+ };
935
+ }
936
+ function c(t) {
937
+ o && clearTimeout(o), o = setTimeout(() => {
938
+ n && (t.push(n), n = null), o = null;
939
+ }, y);
940
+ }
941
+ return e(window, "scroll", r), () => {
942
+ i(window, "scroll", r), o && (clearTimeout(o), o = null), n && (t.push(n), n = null);
943
+ };
944
+ },
945
+ layer: "behavioral"
946
+ },
947
+ viewportresize: {
948
+ create: function(t) {
949
+ let n = null, o = null;
950
+ const r = a((e) => n ? n.samples.ts.length >= 50 ? (t.push(n), n = s(e), void c(t)) : (n.samples.height.push(window.innerHeight), n.samples.width.push(window.innerWidth), n.samples.ts.push(e.timeStamp), n.samples.scrollX.push(window.scrollX), n.samples.scrollY.push(window.scrollY), n.samples.dpr.push(window.devicePixelRatio), void c(t)) : (n = s(e), void c(t)));
951
+ function s(t) {
952
+ return {
953
+ name: "viewport",
954
+ type: "resize",
955
+ timestamp: Date.now(),
956
+ samples: {
957
+ height: [window.innerHeight],
958
+ width: [window.innerWidth],
959
+ ts: [t.timeStamp],
960
+ scrollX: [window.scrollX],
961
+ scrollY: [window.scrollY],
962
+ dpr: [window.devicePixelRatio]
963
+ }
964
+ };
965
+ }
966
+ function c(t) {
967
+ o && clearTimeout(o), o = setTimeout(() => {
968
+ n && (t.push(n), n = null), o = null;
969
+ }, y);
970
+ }
971
+ return e(window, "resize", r), () => {
972
+ i(window, "resize", r), o && (clearTimeout(o), o = null), n && (t.push(n), n = null);
973
+ };
974
+ },
975
+ layer: "behavioral"
976
+ },
977
+ viewport: {
978
+ create: function(t, n, o) {
979
+ const r = a((n) => {
980
+ const e = c(n, "orientation");
981
+ t.push(e);
982
+ }), s = a((n) => {
983
+ const e = c(n, "ratiochange");
984
+ t.push(e);
985
+ });
986
+ function c(t, n) {
987
+ return {
988
+ name: "viewport",
989
+ type: n,
990
+ timestamp: Date.now(),
991
+ isTrusted: t.isTrusted,
992
+ height: window.innerHeight,
993
+ width: window.innerWidth,
994
+ scrollX: window.scrollX,
995
+ scrollY: window.scrollY,
996
+ dpr: window.devicePixelRatio
997
+ };
998
+ }
999
+ return x(o, "orientationchange") && e(window, "orientationchange", r), x(o, "devicepixelratiochange") && e(window, "devicepixelratiochange", s), () => {
1000
+ i(window, "orientationchange", r), i(window, "devicepixelratiochange", s);
1001
+ };
1002
+ },
1003
+ layer: "behavioral",
1004
+ events: ["orientationchange", "devicepixelratiochange"]
1005
+ },
1006
+ sensors: {
1007
+ create: function(t, n, o) {
1008
+ let r = null, s = null, c = null, u = null, h = !1;
1009
+ function f() {
1010
+ u && d(u), u = setTimeout(l(() => {
1011
+ p(), u = null;
1012
+ }), y);
1013
+ }
1014
+ function p() {
1015
+ r && (t.push(r), r = null), s && (t.push(s), s = null), c && (t.push(c), c = null);
1016
+ }
1017
+ const m = a((n) => {
1018
+ const e = n, i = e.timeStamp, o = e.acceleration, s = e.accelerationIncludingGravity, c = e.rotationRate;
1019
+ if (!o && !s && !c || null === o?.x && null === o?.y && null === o?.z && null === s?.x && null === s?.y && null === s?.z && null === c?.alpha && null === c?.beta && null === c?.gamma) return;
1020
+ if (!r) return r = {
1021
+ name: "sensors",
1022
+ type: "motion",
1023
+ timestamp: Date.now(),
1024
+ interval: e.interval ?? null,
1025
+ samples: {
1026
+ ax: [o?.x ?? 0],
1027
+ ay: [o?.y ?? 0],
1028
+ az: [o?.z ?? 0],
1029
+ agx: [s?.x ?? 0],
1030
+ agy: [s?.y ?? 0],
1031
+ agz: [s?.z ?? 0],
1032
+ rrAlpha: [c?.alpha ?? 0],
1033
+ rrBeta: [c?.beta ?? 0],
1034
+ rrGamma: [c?.gamma ?? 0],
1035
+ ts: [i]
1036
+ }
1037
+ }, void f();
1038
+ if (r.samples.ts.length >= 50) return t.push(r), r = {
1039
+ name: "sensors",
1040
+ type: "motion",
1041
+ timestamp: Date.now(),
1042
+ interval: e.interval ?? null,
1043
+ samples: {
1044
+ ax: [o?.x ?? 0],
1045
+ ay: [o?.y ?? 0],
1046
+ az: [o?.z ?? 0],
1047
+ agx: [s?.x ?? 0],
1048
+ agy: [s?.y ?? 0],
1049
+ agz: [s?.z ?? 0],
1050
+ rrAlpha: [c?.alpha ?? 0],
1051
+ rrBeta: [c?.beta ?? 0],
1052
+ rrGamma: [c?.gamma ?? 0],
1053
+ ts: [i]
1054
+ }
1055
+ }, void f();
1056
+ const a = r.samples;
1057
+ a.ax.push(o?.x ?? 0), a.ay.push(o?.y ?? 0), a.az.push(o?.z ?? 0), a.agx.push(s?.x ?? 0), a.agy.push(s?.y ?? 0), a.agz.push(s?.z ?? 0), a.rrAlpha.push(c?.alpha ?? 0), a.rrBeta.push(c?.beta ?? 0), a.rrGamma.push(c?.gamma ?? 0), a.ts.push(i), f();
1058
+ }), w = a((n) => {
1059
+ const e = n;
1060
+ if (null == e.alpha && null == e.beta && null == e.gamma) return;
1061
+ const i = e.timeStamp, o = e.webkitCompassHeading ?? 0;
1062
+ if (!s) return s = {
1063
+ name: "sensors",
1064
+ type: "orientation",
1065
+ timestamp: Date.now(),
1066
+ absolute: h || e.absolute,
1067
+ samples: {
1068
+ alpha: [e.alpha ?? 0],
1069
+ beta: [e.beta ?? 0],
1070
+ gamma: [e.gamma ?? 0],
1071
+ compassHeading: [o],
1072
+ ts: [i]
1073
+ }
1074
+ }, void f();
1075
+ if (s.samples.ts.length >= 50) return t.push(s), s = {
1076
+ name: "sensors",
1077
+ type: "orientation",
1078
+ timestamp: Date.now(),
1079
+ absolute: h || e.absolute,
1080
+ samples: {
1081
+ alpha: [e.alpha ?? 0],
1082
+ beta: [e.beta ?? 0],
1083
+ gamma: [e.gamma ?? 0],
1084
+ compassHeading: [o],
1085
+ ts: [i]
1086
+ }
1087
+ }, void f();
1088
+ const r = s.samples;
1089
+ r.alpha.push(e.alpha ?? 0), r.beta.push(e.beta ?? 0), r.gamma.push(e.gamma ?? 0), r.compassHeading.push(o), r.ts.push(i), f();
1090
+ }), v = a((n) => {
1091
+ const e = n.value;
1092
+ if (null == e) return;
1093
+ const i = n.timeStamp;
1094
+ c ? c.samples.ts.length >= 50 ? (t.push(c), c = {
1095
+ name: "sensors",
1096
+ type: "light",
1097
+ timestamp: Date.now(),
1098
+ samples: {
1099
+ lux: [e],
1100
+ ts: [i]
1101
+ }
1102
+ }, f()) : (c.samples.lux.push(e), c.samples.ts.push(i), f()) : (c = {
1103
+ name: "sensors",
1104
+ type: "light",
1105
+ timestamp: Date.now(),
1106
+ samples: {
1107
+ lux: [e],
1108
+ ts: [i]
1109
+ }
1110
+ }, f());
1111
+ });
1112
+ return x(o, "motion") && e(window, "devicemotion", m), x(o, "orientation") && ("ondeviceorientationabsolute" in window ? (h = !0, e(window, "deviceorientationabsolute", w)) : e(window, "deviceorientation", w)), x(o, "light") && e(window, "devicelight", v), function() {
1113
+ i(window, "devicemotion", m), i(window, h ? "deviceorientationabsolute" : "deviceorientation", w), i(window, "devicelight", v), u && (d(u), u = null), p();
1114
+ };
1115
+ },
1116
+ layer: "behavioral",
1117
+ events: [
1118
+ "motion",
1119
+ "orientation",
1120
+ "light"
1121
+ ]
1122
+ },
1123
+ "network-request": {
1124
+ create: function(t) {
1125
+ var e;
1126
+ const i = function(t, e, i, o = f) {
1127
+ if ("undefined" == typeof PerformanceObserver) return w;
1128
+ let r = null;
1129
+ try {
1130
+ r = new PerformanceObserver((n) => {
1131
+ for (const r of n.getEntries()) {
1132
+ const n = r;
1133
+ o.has(n.initiatorType) && (e(n.name) || t(m(n, i)));
1134
+ }
1135
+ }), r.observe({
1136
+ type: "resource",
1137
+ buffered: !0
1138
+ });
1139
+ } catch {
1140
+ return n.warn("network-request", "PerformanceObserver failed to start"), w;
1141
+ }
1142
+ return function() {
1143
+ r?.disconnect(), r = null;
1144
+ };
1145
+ }(function(n) {
1146
+ s(() => t.push(n));
1147
+ }, (e = t.ignoredOrigins, function(t) {
1148
+ try {
1149
+ return e.has(new URL(t).origin);
1150
+ } catch {
1151
+ return !1;
1152
+ }
1153
+ }), t.sanitizeUrl);
1154
+ return function() {
1155
+ i();
1156
+ };
1157
+ },
1158
+ layer: "session"
1159
+ },
1160
+ screen: {
1161
+ create: function(t) {
1162
+ const n = s(() => function() {
1163
+ const t = window.screen;
1164
+ return {
1165
+ name: "screen",
1166
+ timestamp: Date.now(),
1167
+ availWidth: t.availWidth,
1168
+ availHeight: t.availHeight,
1169
+ width: t.width,
1170
+ height: t.height,
1171
+ colorDepth: t.colorDepth,
1172
+ pixelDepth: t.pixelDepth,
1173
+ availLeft: t.availLeft ?? 0,
1174
+ availTop: t.availTop ?? 0,
1175
+ orientation: t.orientation ? {
1176
+ type: t.orientation.type,
1177
+ angle: t.orientation.angle
1178
+ } : null,
1179
+ isExtended: t.isExtended ?? !1,
1180
+ viewport: {
1181
+ height: window.innerHeight,
1182
+ width: window.innerWidth,
1183
+ scrollX: window.scrollX,
1184
+ scrollY: window.scrollY,
1185
+ dpr: window.devicePixelRatio
1186
+ }
1187
+ };
1188
+ }());
1189
+ return n && t.push(n), () => {};
1190
+ },
1191
+ layer: "session"
1192
+ }
1193
+ };
1194
+ const W = Object.keys(Q);
1195
+ const tt = [
1196
+ /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,
1197
+ /^0b[01]+$/i,
1198
+ /^0o[0-7]+$/i,
1199
+ /^0x[0-9a-f]+$/i,
1200
+ /^[a-z][a-z0-9]{1,12}:[A-Za-z0-9+/=_-]{6,}$/i,
1201
+ /^[a-z]{2,8}_(?=.*\d)[A-Za-z0-9]{3,}$/,
1202
+ /^\d{4,}$/,
1203
+ /@/,
1204
+ /^[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{5,}\.[A-Za-z0-9_-]{10,}$/,
1205
+ /^[A-Za-z0-9_-]{20,}={0,2}$/,
1206
+ /^[0-9a-f]{7,}$/i
1207
+ ];
1208
+ function nt(t) {
1209
+ try {
1210
+ const n = new URL(t, location.href);
1211
+ n.username = "", n.password = "", n.hash = "";
1212
+ const e = [...n.searchParams.keys()], i = e.length > 0 ? "?" + e.map((t) => `${encodeURIComponent(t)}=<redacted>`).join("&") : "";
1213
+ n.search = "", n.pathname = n.pathname.split("/").map((t) => "" !== t && function(t) {
1214
+ for (const n of tt) if (n.test(t)) return !0;
1215
+ return !1;
1216
+ }(t) ? ":param" : t).join("/");
1217
+ const o = n.origin + n.pathname + i;
1218
+ return o.length > 2048 ? o.slice(0, 2048) : o;
1219
+ } catch {
1220
+ return "";
1221
+ }
1222
+ }
1223
+ const et = "idle";
1224
+ const it = "ready";
1225
+ const ot = "started";
1226
+ const rt = "collection-disabled";
1227
+ const st = "init-failed";
1228
+ const ct = {
1229
+ flush: {
1230
+ intervalMs: 2e3,
1231
+ maxIntervalMs: 3e4,
1232
+ size: 50,
1233
+ backoffFailureThreshold: 2
1234
+ },
1235
+ queue: { size: 100 }
1236
+ };
1237
+ function at() {
1238
+ const t = {};
1239
+ for (const n of W) t[n] = dt(n, void 0, !0);
1240
+ return t;
1241
+ }
1242
+ function lt(t) {
1243
+ const n = {};
1244
+ for (const e of W) n[e] = dt(e, void 0, t[Q[e].layer] ?? !1);
1245
+ return n;
1246
+ }
1247
+ function ut(t) {
1248
+ const n = {};
1249
+ for (const e of W) {
1250
+ const i = t[e];
1251
+ n[e] = dt(e, i, i?.enabled ?? !1);
1252
+ }
1253
+ return n;
1254
+ }
1255
+ function dt(t, n, e) {
1256
+ const i = Q[t]?.events ?? [];
1257
+ if (0 === i.length) return { enabled: e };
1258
+ const o = n?.events, r = {};
1259
+ for (const t of i) r[t] = { enabled: o?.[t] ?? !0 };
1260
+ return {
1261
+ enabled: e,
1262
+ events: r
1263
+ };
1264
+ }
1265
+ function ht(t) {
1266
+ if (!t) return null;
1267
+ const n = t.split(".")[1], e = atob(n.replace(/-/g, "+").replace(/_/g, "/"));
1268
+ return JSON.parse(e);
1269
+ }
1270
+ const ft = function(t, n = 30) {
1271
+ if (!t) return !0;
1272
+ const e = ht(t);
1273
+ return !e || "number" != typeof e.exp || 1e3 * e.exp <= Date.now() + 1e3 * n;
1274
+ };
1275
+ async function pt(t, n) {
1276
+ return globalThis.navigator && "locks" in globalThis.navigator && "request" in globalThis.navigator.locks && "query" in globalThis.navigator.locks ? navigator.locks.request(t, { mode: "exclusive" }, async () => c(n)) : c(n);
1277
+ }
1278
+ const mt = "__tri";
1279
+ const wt = `${mt}_activity_token`;
1280
+ const yt = `${mt}_activity_id`;
1281
+ const vt = `${mt}_activity_status`;
1282
+ const bt = "__tri_activity_lock";
1283
+ var gt = class {
1284
+ constructor(t) {
1285
+ this.context = t, this.l = null, this.u = null, this.h = null, this.p = null, this.m = !1;
1286
+ }
1287
+ getToken() {
1288
+ return this.l;
1289
+ }
1290
+ getActivityId() {
1291
+ return this.u ?? "";
1292
+ }
1293
+ isActive() {
1294
+ return "ACTIVE" === this.h && null !== this.l;
1295
+ }
1296
+ async start() {
1297
+ return this.m = !0, this.p || (this.p = this.v()), this.p;
1298
+ }
1299
+ async stop() {
1300
+ this.m = !1, this.k(null), this.p = null, this.l && await this.context.stopActivity(), this.T(null);
1301
+ }
1302
+ async refresh() {
1303
+ if (!this.m) return;
1304
+ const t = this.l;
1305
+ await pt(bt, async () => {
1306
+ if (this.l && this.l !== t && !ft(this.l) && "ACTIVE" === this.h) return;
1307
+ const n = this._();
1308
+ n && n.token !== t && !ft(n.token) && "ACTIVE" === n.activityStatus ? this.T(n) : (this.I(), await this.S());
1309
+ });
1310
+ }
1311
+ async v() {
1312
+ try {
1313
+ if (this.l && !ft(this.l)) return;
1314
+ await pt(bt, async () => {
1315
+ await this.S();
1316
+ });
1317
+ } finally {
1318
+ this.p = null;
1319
+ }
1320
+ }
1321
+ async S() {
1322
+ const t = this._();
1323
+ if (t && !ft(t.token) && "ACTIVE" === t.activityStatus) return void this.T(t);
1324
+ t && this.I();
1325
+ const n = await this.context.startActivity();
1326
+ if (!n.ok) return;
1327
+ if (!n.data.token) return;
1328
+ const e = n.data;
1329
+ this.T(e), this.A(e);
1330
+ }
1331
+ _() {
1332
+ const [t, n, e] = [
1333
+ O.get(wt),
1334
+ O.get(yt),
1335
+ O.get(vt)
1336
+ ];
1337
+ return t && n && e ? {
1338
+ token: t,
1339
+ activityId: n,
1340
+ activityStatus: e
1341
+ } : ((t || n || e) && this.I(), null);
1342
+ }
1343
+ A(t) {
1344
+ O.set(wt, t.token), O.set(yt, t.activityId), O.set(vt, t.activityStatus);
1345
+ }
1346
+ I() {
1347
+ this.k(null), this.T(null);
1348
+ }
1349
+ k(t) {
1350
+ if (!t) return O.remove(wt), O.remove(yt), void O.remove(vt);
1351
+ O.set(wt, t.token), O.set(yt, t.activityId), O.set(vt, t.activityStatus);
1352
+ }
1353
+ T(t) {
1354
+ if (!t) return this.l = null, this.u = null, void (this.h = null);
1355
+ this.l = t.token, this.u = t.activityId, this.h = t.activityStatus;
1356
+ }
1357
+ };
1358
+ const kt = [
1359
+ 401,
1360
+ 403,
1361
+ 409
1362
+ ];
1363
+ const Tt = Object.freeze({
1364
+ tab: 80,
1365
+ navigation: 80,
1366
+ visibility: 80,
1367
+ network: 80,
1368
+ screen: 80,
1369
+ fingerprint: 80,
1370
+ pointer: 60,
1371
+ keystroke: 60,
1372
+ autofill: 60,
1373
+ change: 60,
1374
+ form: 60,
1375
+ clipboard: 60,
1376
+ selection: 60,
1377
+ focus: 60,
1378
+ viewport: 60,
1379
+ network_request: 60,
1380
+ scroll: 40,
1381
+ sensors: 40
1382
+ });
1383
+ function _t(t) {
1384
+ return "pointer" === t.name && "move" === t.phase || "viewport" === t.name && "resize" === t.type ? 40 : Tt[t.name];
1385
+ }
1386
+ const It = new Array(256);
1387
+ for (let t = 0; t < 256; t++) It[t] = (t + 256).toString(16).slice(1);
1388
+ const xt = /* @__PURE__ */ new Uint8Array(16);
1389
+ function St(t) {
1390
+ return It[t[0]] + It[t[1]] + It[t[2]] + It[t[3]] + "-" + It[t[4]] + It[t[5]] + "-" + It[t[6]] + It[t[7]] + "-" + It[t[8]] + It[t[9]] + "-" + It[t[10]] + It[t[11]] + It[t[12]] + It[t[13]] + It[t[14]] + It[t[15]];
1391
+ }
1392
+ function Et() {
1393
+ return crypto.randomUUID();
1394
+ }
1395
+ function At() {
1396
+ return crypto.getRandomValues(xt), xt[6] = 15 & xt[6] | 64, xt[8] = 63 & xt[8] | 128, St(xt);
1397
+ }
1398
+ function Mt() {
1399
+ for (let t = 0; t < 16; t++) xt[t] = 256 * Math.random() | 0;
1400
+ return xt[6] = 15 & xt[6] | 64, xt[8] = 63 & xt[8] | 128, St(xt);
1401
+ }
1402
+ const Dt = function() {
1403
+ if ("undefined" != typeof crypto) {
1404
+ if ("function" == typeof crypto.randomUUID) return Et;
1405
+ if ("function" == typeof crypto.getRandomValues) return At;
1406
+ }
1407
+ return Mt;
1408
+ }();
1409
+ function Ct() {
1410
+ return Dt();
1411
+ }
1412
+ var Pt = class {
1413
+ constructor(t, n) {
1414
+ this.M = t, this.D = n, this.C = [], this.P = null, this.L = [], this.R = null, this.m = !1, this.$ = !0, this.U = 0, this.B = 0, this.O = t.flush.intervalMs;
1415
+ }
1416
+ push(t) {
1417
+ if (this.m) {
1418
+ if (this.C.length < this.q() ? this.C.push(t) : this.j(t), this.$) return this.C.length >= this.M.flush.size ? (d(this.P), this.P = null, void this.flush("capacity")) : void this.H();
1419
+ } else n.warn("Transport", "push() called before start() — event dropped");
1420
+ }
1421
+ flush(t) {
1422
+ if (this.m && this.D.isActivityActive()) try {
1423
+ if ("lifecycle" === t) return void this.N();
1424
+ if (0 === this.C.length) return;
1425
+ const e = this.F(t);
1426
+ this.D.ingest(e, !1).then((t) => this.X(t, e)).catch(() => {
1427
+ n.warn("Transport", "ingest threw unexpectedly — batch dropped");
1428
+ }), this.C.length > 0 && this.H();
1429
+ } catch (t) {
1430
+ n.warn("Transport", "flush() threw unexpectedly:", t);
1431
+ }
1432
+ }
1433
+ start() {
1434
+ this.m || (this.m = !0, this.$ = "undefined" == typeof navigator || navigator.onLine);
1435
+ }
1436
+ stop() {
1437
+ if (!this.m) return Promise.resolve();
1438
+ d(this.P), this.P = null, d(this.R), this.R = null;
1439
+ const t = this.N();
1440
+ return this.m = !1, t;
1441
+ }
1442
+ onConnectionChange() {
1443
+ const t = "undefined" == typeof navigator || navigator.onLine;
1444
+ if (t !== this.$) {
1445
+ if (this.$ = t, !this.$) return d(this.P), this.P = null, d(this.R), void (this.R = null);
1446
+ this.C.length > 0 && this.H(), this.L.length > 0 && this.K();
1447
+ }
1448
+ }
1449
+ H() {
1450
+ this.m && this.$ && null === this.P && (this.P = u(() => {
1451
+ this.P = null, this.flush("interval");
1452
+ }, this.O));
1453
+ }
1454
+ K() {
1455
+ this.m && this.$ && null === this.R && (this.R = u(() => {
1456
+ this.R = null, this.V();
1457
+ }, this.O));
1458
+ }
1459
+ V() {
1460
+ if (!this.m || !this.$ || 0 === this.L.length || !this.D.isActivityActive()) return;
1461
+ const t = this.L.shift();
1462
+ this.D.ingest(t.batch, !1).then((n) => this.Y(n, t)).catch(() => {
1463
+ n.warn("Transport", "retry drain ingest threw unexpectedly — batch dropped"), this.L.length > 0 && this.K();
1464
+ });
1465
+ }
1466
+ J(t, e) {
1467
+ this.L.length >= 5 && (this.L.shift(), n.warn("Transport", "retry queue full — oldest batch evicted")), this.L.push({
1468
+ batch: t,
1469
+ attempts: e
1470
+ }), this.K();
1471
+ }
1472
+ X(t, n) {
1473
+ t.ok ? this.G() : this.Z(t) && this.J(n, 1);
1474
+ }
1475
+ Y(t, e) {
1476
+ if (t.ok) return this.G(), void (this.L.length > 0 && this.K());
1477
+ if (this.Z(t)) {
1478
+ if (e.attempts >= 3) return this.W(), n.warn("Transport", "batch dropped after MAX_RETRY_ATTEMPTS", e.batch.batchId), void (this.L.length > 0 && this.K());
1479
+ this.W(), this.J(e.batch, e.attempts + 1);
1480
+ } else this.L.length > 0 && this.K();
1481
+ }
1482
+ W() {
1483
+ this.U++, this.U % this.M.flush.backoffFailureThreshold === 0 && (this.O = Math.min(2 * this.O, this.M.flush.maxIntervalMs));
1484
+ }
1485
+ G() {
1486
+ this.U = 0, this.O = this.M.flush.intervalMs;
1487
+ }
1488
+ q() {
1489
+ return this.M.queue.size * (this.$ ? 1 : 2);
1490
+ }
1491
+ async N() {
1492
+ if (!this.D.isActivityActive()) return Promise.resolve();
1493
+ const t = [];
1494
+ for (const e of this.L) t.push(this.D.ingest(e.batch, !0).catch(() => {
1495
+ n.warn("Transport", "lifecycle retry ingest threw — batch dropped");
1496
+ }));
1497
+ if (this.L = [], this.C.length > 0) {
1498
+ const e = this.F("lifecycle");
1499
+ t.push(this.D.ingest(e, !0).catch(() => {
1500
+ n.warn("Transport", "lifecycle ingest threw — batch dropped");
1501
+ }));
1502
+ }
1503
+ return Promise.allSettled(t).then(() => {});
1504
+ }
1505
+ j(t) {
1506
+ const n = _t(t);
1507
+ for (let e = 0; e < this.C.length; e++) if (_t(this.C[e]) < n) {
1508
+ for (let t = e; t < this.C.length - 1; t++) this.C[t] = this.C[t + 1];
1509
+ this.C.length -= 1, this.C.push(t);
1510
+ return;
1511
+ }
1512
+ }
1513
+ F(t) {
1514
+ const n = "lifecycle" === t ? this.C.splice(-this.M.flush.size) : this.C.splice(0, this.M.flush.size);
1515
+ return {
1516
+ activityId: "",
1517
+ batchId: Ct(),
1518
+ batchSequence: this.B++,
1519
+ clientTimestamp: Date.now(),
1520
+ schemaVersion: "0.1.0",
1521
+ sdkVersion: "0.5.1",
1522
+ sdkPlatform: "web",
1523
+ tabId: this.D.getTabId(),
1524
+ events: n
1525
+ };
1526
+ }
1527
+ Z(t) {
1528
+ if (t.ok) return !1;
1529
+ switch (t.kind) {
1530
+ case "timeout":
1531
+ case "server":
1532
+ case "rate_limited": return !0;
1533
+ default: return !1;
1534
+ }
1535
+ }
1536
+ };
1537
+ const zt = "tri:bcast:";
1538
+ const Lt = "function" == typeof BroadcastChannel ? BroadcastChannel : function() {
1539
+ if ("undefined" == typeof Storage || "undefined" == typeof window) return !1;
1540
+ try {
1541
+ const t = "__tri_bcast_probe__";
1542
+ localStorage.setItem(t, "1");
1543
+ const n = "1" === localStorage.getItem(t);
1544
+ return localStorage.removeItem(t), n;
1545
+ } catch {
1546
+ return !1;
1547
+ }
1548
+ }() ? class {
1549
+ constructor(t) {
1550
+ this.seq = 0, this.closed = !1, this.listeners = /* @__PURE__ */ new Set(), this.onStorageEvent = (t) => {
1551
+ if (this.closed) return;
1552
+ if (!t.key || !t.key.startsWith(`${zt}${this.channelName}:`)) return;
1553
+ if (null === t.newValue) return;
1554
+ let n;
1555
+ s(() => O.remove(t.key));
1556
+ try {
1557
+ n = JSON.parse(t.newValue);
1558
+ } catch {
1559
+ return;
1560
+ }
1561
+ const e = { data: n };
1562
+ for (const t of this.listeners) s(() => t(e));
1563
+ }, this.channelName = t, this.senderId = Ct(), window.addEventListener("storage", this.onStorageEvent);
1564
+ }
1565
+ postMessage(t) {
1566
+ if (this.closed) return;
1567
+ const n = `${zt}${this.channelName}:${this.senderId}:${this.seq++}`;
1568
+ s(() => {
1569
+ O.set(n, t), O.remove(n);
1570
+ });
1571
+ }
1572
+ addEventListener(t, n) {
1573
+ this.listeners.add(n);
1574
+ }
1575
+ removeEventListener(t, n) {
1576
+ this.listeners.delete(n);
1577
+ }
1578
+ close() {
1579
+ this.closed || (this.closed = !0, window.removeEventListener("storage", this.onStorageEvent), this.listeners.clear());
1580
+ }
1581
+ } : class {
1582
+ constructor(t) {
1583
+ n.warn("BroadcastChannel", "BroadcastChannel is unavailable and localStorage is not writable in this context. Cross-tab discovery is disabled; tab count will always be reported as 1.");
1584
+ }
1585
+ postMessage(t) {}
1586
+ addEventListener(t, n) {}
1587
+ removeEventListener(t, n) {}
1588
+ close() {}
1589
+ };
1590
+ const Rt = "__tri_tabId";
1591
+ var $t = class {
1592
+ constructor(t) {
1593
+ this.context = t, this.tt = "", this.m = !1, this.nt = null, this.et = null, this.it = null, this.ot = /* @__PURE__ */ new Map(), this.rt = -1, this.st = null;
1594
+ }
1595
+ async start() {
1596
+ this.m || (this.m = !0, this.tt = this.ct(), this.lt(), this.ut({
1597
+ type: "hello",
1598
+ tabId: this.tt,
1599
+ ts: Date.now()
1600
+ }), this.dt(), this.ht("active"), this.ft());
1601
+ }
1602
+ stop() {
1603
+ this.m && (this.m = !1, this.ht("inactive"), this.ut({
1604
+ type: "bye",
1605
+ tabId: this.tt,
1606
+ ts: Date.now()
1607
+ }), this.wt(this.yt()), this.vt(), this.bt(), this.gt());
1608
+ }
1609
+ getTabId() {
1610
+ return this.tt;
1611
+ }
1612
+ queryTabsNumber() {
1613
+ return this.ot.size + 1;
1614
+ }
1615
+ lt() {
1616
+ try {
1617
+ this.nt = new Lt("__tri_tab_channel"), this.st = this.kt.bind(this), this.nt.addEventListener("message", this.st);
1618
+ } catch (t) {
1619
+ n.warn("TabManager", "failed to open broadcast channel:", t);
1620
+ }
1621
+ }
1622
+ gt() {
1623
+ try {
1624
+ if (!this.nt) return;
1625
+ this.st && this.nt.removeEventListener("message", this.st), this.nt.close();
1626
+ } catch {} finally {
1627
+ this.nt = null, this.st = null;
1628
+ }
1629
+ }
1630
+ dt() {
1631
+ this.et = setInterval(() => {
1632
+ const t = Date.now();
1633
+ this.ut({
1634
+ type: "heartbeat",
1635
+ tabId: this.tt,
1636
+ ts: t
1637
+ });
1638
+ }, 1e3);
1639
+ }
1640
+ vt() {
1641
+ null != this.et && (clearInterval(this.et), this.et = null);
1642
+ }
1643
+ ft() {
1644
+ null != this.it && clearTimeout(this.it), this.it = setTimeout(() => {
1645
+ this.it = null;
1646
+ const t = this.yt() + 1;
1647
+ t !== this.rt && (this.rt = t, this.wt(t));
1648
+ }, 1e3);
1649
+ }
1650
+ bt() {
1651
+ null != this.it && (clearTimeout(this.it), this.it = null);
1652
+ }
1653
+ ut(t) {
1654
+ try {
1655
+ if (!this.nt) return;
1656
+ this.nt.postMessage(t);
1657
+ } catch {
1658
+ n.warn("TabManager", "failed to broadcast message:", t);
1659
+ }
1660
+ }
1661
+ kt(t) {
1662
+ const { type: n, tabId: e } = t.data;
1663
+ if (e === this.tt) return;
1664
+ const i = Date.now();
1665
+ "hello" === n ? (this.ut({
1666
+ type: "ack",
1667
+ tabId: this.tt,
1668
+ ts: i,
1669
+ to: e
1670
+ }), this.ot.set(e, i)) : "heartbeat" === n || "ack" === n ? this.ot.set(e, i) : "bye" === n && this.ot.delete(e);
1671
+ }
1672
+ wt(t) {
1673
+ this.context.events.count && this.context.push({
1674
+ name: "tab",
1675
+ type: "count",
1676
+ tabId: this.tt,
1677
+ timestamp: Date.now(),
1678
+ value: t
1679
+ });
1680
+ }
1681
+ ht(t) {
1682
+ this.context.events.state && this.context.push({
1683
+ name: "tab",
1684
+ type: "state",
1685
+ tabId: this.tt,
1686
+ timestamp: Date.now(),
1687
+ value: t
1688
+ });
1689
+ }
1690
+ ct() {
1691
+ const t = q.get(Rt);
1692
+ if (t) return t;
1693
+ const n = Ct();
1694
+ return q.set(Rt, n), n;
1695
+ }
1696
+ yt(t = Date.now()) {
1697
+ let n = 0;
1698
+ for (const [e, i] of this.ot.entries()) t - i >= 3e3 ? this.ot.delete(e) : n++;
1699
+ return n;
1700
+ }
1701
+ };
1702
+ const Ut = globalThis.CompressionStream;
1703
+ const Bt = globalThis.Response;
1704
+ const Ot = globalThis.Blob;
1705
+ const qt = new TextEncoder();
1706
+ let jt = null;
1707
+ async function Ht(t) {
1708
+ const e = await async function(t) {
1709
+ if ("function" != typeof Ut) return null;
1710
+ try {
1711
+ const n = qt.encode(t), e = new Ot([n]).stream().pipeThrough(new Ut("gzip"));
1712
+ return await new Bt(e).arrayBuffer();
1713
+ } catch (t) {
1714
+ return n.warn("compression", "Native gzip failed:", t), null;
1715
+ }
1716
+ }(t);
1717
+ return null !== e ? e : async function(t) {
1718
+ try {
1719
+ const e = await function() {
1720
+ if (null === jt) {
1721
+ const t = function(t, e = 1e4) {
1722
+ let i = null;
1723
+ const o = new Promise((t) => {
1724
+ i = u(() => {
1725
+ n.warn("import", `Import timed out after ${e}ms`), t(null);
1726
+ }, e);
1727
+ }), r = Promise.resolve().then(t).catch((t) => (n.warn("import", "Import failed:", t), null));
1728
+ return Promise.race([r, o]).finally(() => {
1729
+ d(i);
1730
+ });
1731
+ }(() => import("./browser-DlFgHpoC-DnyrCR8r.esm.js"), 1e4);
1732
+ jt = t, t.then((n) => {
1733
+ null === n && u(() => {
1734
+ jt === t && (jt = null);
1735
+ }, 1e4);
1736
+ });
1737
+ }
1738
+ return jt;
1739
+ }();
1740
+ if (null === e) return null;
1741
+ const { gzipSync: i } = e, o = i(qt.encode(t));
1742
+ return o.buffer.slice(o.byteOffset, o.byteOffset + o.byteLength);
1743
+ } catch (t) {
1744
+ return n.warn("compression", "fflate gzip failed:", t), null;
1745
+ }
1746
+ }(t);
1747
+ }
1748
+ function Nt(t) {
1749
+ const n = { Accept: "application/json" };
1750
+ return t?.hasBody && ("json" === t.contentType ? n["Content-Type"] = "application/json" : "ndjson" === t.contentType && (n["Content-Type"] = "application/x-ndjson"), "gzip" === t.contentEncoding && (n["Content-Encoding"] = "gzip")), t?.token && (n.Authorization = `Bearer ${t.token}`), t?.profileId && (n["x-profile-id"] = t.profileId), t?.api?.version && (n["x-api-version"] = t.api.version), t?.customHeaders && Object.entries(t.customHeaders).forEach(([t, e]) => {
1751
+ n[t] = e;
1752
+ }), n;
1753
+ }
1754
+ const Ft = "function" == typeof globalThis.fetch ? globalThis.fetch.bind(globalThis) : void 0;
1755
+ var Xt = class {
1756
+ constructor(t) {
1757
+ this.context = t;
1758
+ }
1759
+ stop() {}
1760
+ async report(t, e) {
1761
+ const i = {
1762
+ name: t,
1763
+ metadata: e,
1764
+ timestamp: Date.now(),
1765
+ activityId: this.context.getActivityId() ?? ""
1766
+ };
1767
+ try {
1768
+ const o = await this.context.reportEvent(i);
1769
+ if (o.ok) return o;
1770
+ n.warn("EventReport", "Failed to report event:", t, e, "with result:", o);
1771
+ } catch (i) {
1772
+ n.warn("EventReport", "Failed to report event:", t, e, "with error:", i);
1773
+ }
1774
+ }
1775
+ };
1776
+ const Kt = /* @__PURE__ */ new Set([
1777
+ "A",
1778
+ "BUTTON",
1779
+ "INPUT",
1780
+ "SELECT",
1781
+ "TEXTAREA",
1782
+ "SUMMARY",
1783
+ "DETAILS",
1784
+ "LABEL",
1785
+ "OPTION",
1786
+ "FIELDSET"
1787
+ ]);
1788
+ const Vt = /* @__PURE__ */ new Set([
1789
+ "button",
1790
+ "link",
1791
+ "tab",
1792
+ "menuitem",
1793
+ "menuitemcheckbox",
1794
+ "menuitemradio",
1795
+ "checkbox",
1796
+ "radio",
1797
+ "switch",
1798
+ "slider",
1799
+ "spinbutton",
1800
+ "combobox",
1801
+ "listbox",
1802
+ "option",
1803
+ "searchbox",
1804
+ "textbox",
1805
+ "treeitem"
1806
+ ]);
1807
+ const Yt = 255;
1808
+ function Jt(t, n, e, i = nt) {
1809
+ const o = t.tagName.toLowerCase(), r = function(t) {
1810
+ const n = t.parentElement?.children ?? [], e = Math.min(n.length, 1e3);
1811
+ let i = e - 1, o = 0, r = 0;
1812
+ for (let i = 0; i < e; i++) {
1813
+ r++;
1814
+ const e = n[i];
1815
+ if (b(e, t.tagName) && o++, e === t) break;
1816
+ }
1817
+ return {
1818
+ siblings: i,
1819
+ ofType: o,
1820
+ child: r
1821
+ };
1822
+ }(t), s = function(t, n, e) {
1823
+ const i = function(t) {
1824
+ if (!t) return null;
1825
+ const n = t.getAttribute("data-tri-redact-attrs");
1826
+ return n ? n.split(",").map((t) => t.trim().toLowerCase()) : null;
1827
+ }(t), o = {}, r = t.id;
1828
+ r && !_("id", i) && (o.id = r);
1829
+ const s = t.getAttribute("autocomplete");
1830
+ s && !_("autocomplete", i) && (o.autocomplete = s);
1831
+ const c = t.getAttribute("aria-invalid");
1832
+ c && !_("aria-invalid", i) && (o.ariaInvalid = c);
1833
+ const a = t.getAttribute("tabindex");
1834
+ a && !_("tabindex", i) && (o.tabIndex = parseInt(a, 10));
1835
+ const l = function(t) {
1836
+ return t.getAttribute("data-testid") ?? t.getAttribute("data-cy") ?? null;
1837
+ }(t);
1838
+ l && !_("data-testid", i) && (o.testId = l);
1839
+ const u = t.hasAttribute("readonly");
1840
+ u && !_("readonly", i) && (o.readOnly = u);
1841
+ const d = t.hasAttribute("required");
1842
+ d && !_("required", i) && (o.required = d);
1843
+ const h = t.getAttribute("contenteditable");
1844
+ h && !_("contenteditable", i) && (o.contentEditable = "true" === h || "" === h);
1845
+ const f = t.getAttribute("href");
1846
+ f && !_("href", i) && (o.href = {
1847
+ ...n ? {} : { url: e(f) },
1848
+ external: I(f)
1849
+ });
1850
+ const p = t.getAttribute("role");
1851
+ p && !_("role", i) && (o.role = p);
1852
+ const m = t.getAttribute("type");
1853
+ m && !_("type", i) && (o.type = m);
1854
+ const w = t.getAttribute("name");
1855
+ w && !_("name", i) && (o.name = w);
1856
+ const y = t.getAttribute("placeholder");
1857
+ !y || n || _("placeholder", i) || (o.placeholder = y);
1858
+ const v = Array.from(t.classList).slice(0, 5);
1859
+ v.length > 0 && !_("class", i) && (o.classes = v);
1860
+ const b = t.getAttribute("alt");
1861
+ return !b || n || _("alt", i) || (o.alt = b), Object.keys(o).length ? o : null;
1862
+ }(t, n, i);
1863
+ return {
1864
+ tagName: o,
1865
+ frame: e,
1866
+ ...s ? { attributes: s } : {},
1867
+ ...r ? { nth: r } : {}
1868
+ };
1869
+ }
1870
+ function Gt(t, n) {
1871
+ let e = 0;
1872
+ const i = [];
1873
+ return function(t) {
1874
+ return Kt.has(t.tagName);
1875
+ }(t) && (e += 40, i.push("native")), function(t) {
1876
+ return t.hasAttribute("data-tri-interactive");
1877
+ }(t) && (e += 40, i.push("tri-interactive")), function(t) {
1878
+ return b(t, "a") && t.hasAttribute("href");
1879
+ }(t) && (e += 15, i.push("has-href")), function(t) {
1880
+ const n = t.getAttribute("role");
1881
+ return null !== n && Vt.has(n);
1882
+ }(t) && (e += 30, i.push("role")), function(t) {
1883
+ return t.hasAttribute("onclick") || t.hasAttribute("ng-click") || t.hasAttribute("data-action") || t.hasAttribute("@click");
1884
+ }(t) && (e += 20, i.push("click-handler")), function(t) {
1885
+ const n = t.getAttribute("tabindex");
1886
+ if (null === n) return !1;
1887
+ const e = parseInt(n, 10);
1888
+ return null !== e && e >= 0;
1889
+ }(t) && (e += 10, i.push("tabindex")), (t.id || t.getAttribute("data-testid")) && (e += 5, i.push("has-id")), n > 0 && (e += Math.round(15 / n), i.push("depth")), {
1890
+ score: e,
1891
+ reasons: i
1892
+ };
1893
+ }
1894
+ function Zt(t) {
1895
+ return t >= 20;
1896
+ }
1897
+ function Qt(t) {
1898
+ return null !== t && t.width > 0 && t.height > 0 && t.y < window.innerHeight && t.y + t.height > 0 && t.x < window.innerWidth && t.x + t.width > 0;
1899
+ }
1900
+ function Wt(t) {
1901
+ return !0 === t.disabled || "true" === t.getAttribute("aria-disabled");
1902
+ }
1903
+ function tn(t, n = !1) {
1904
+ if (n) return null;
1905
+ const e = en(t, "labelledby");
1906
+ if (e) return {
1907
+ text: rn(e),
1908
+ resolutionMethod: "aria-labelledby",
1909
+ confidence: "high"
1910
+ };
1911
+ const i = on(t);
1912
+ if (i) return {
1913
+ text: rn(i),
1914
+ resolutionMethod: "aria-label",
1915
+ confidence: "high"
1916
+ };
1917
+ const o = function(t) {
1918
+ if (!t.id) return null;
1919
+ const n = document.querySelector(`label[for="${CSS.escape(t.id)}"]`);
1920
+ return n ? nn(n) : null;
1921
+ }(t);
1922
+ if (o) return {
1923
+ text: rn(o),
1924
+ resolutionMethod: "html-for",
1925
+ confidence: "high"
1926
+ };
1927
+ const r = function(t) {
1928
+ const n = t.closest("label");
1929
+ return n ? nn(n) : null;
1930
+ }(t);
1931
+ if (r) return {
1932
+ text: rn(r),
1933
+ resolutionMethod: "wrapping-label",
1934
+ confidence: "high"
1935
+ };
1936
+ const s = function(t) {
1937
+ return t.getAttribute("placeholder")?.trim() ?? null;
1938
+ }(t);
1939
+ if (s) return {
1940
+ text: rn(s),
1941
+ resolutionMethod: "placeholder",
1942
+ confidence: "low"
1943
+ };
1944
+ const c = function(t) {
1945
+ return t.getAttribute("title")?.trim() ?? null;
1946
+ }(t);
1947
+ if (c) return {
1948
+ text: rn(c),
1949
+ resolutionMethod: "title",
1950
+ confidence: "low"
1951
+ };
1952
+ const a = en(t, "describedby");
1953
+ if (a) return {
1954
+ text: rn(a),
1955
+ resolutionMethod: "aria-describedby",
1956
+ confidence: "low"
1957
+ };
1958
+ const l = nn(t);
1959
+ return l ? {
1960
+ text: l,
1961
+ resolutionMethod: "text-content",
1962
+ confidence: "low"
1963
+ } : null;
1964
+ }
1965
+ function nn(t, n = 0) {
1966
+ if (n > 8) return "";
1967
+ if (v(t)) return function(t) {
1968
+ return t ? t.trim().split(/(\s+)/).join("").replace(/[\r\n]/g, " ").replace(/[ ]+/g, " ").substring(0, Yt) : null;
1969
+ }(t.textContent) ?? "";
1970
+ if (!t.childNodes?.length) return "";
1971
+ let e = "";
1972
+ for (const i of t.childNodes) {
1973
+ const t = nn(i, n + 1);
1974
+ if (t && (e = e ? `${e} ${t}` : t, e.length >= Yt)) break;
1975
+ }
1976
+ return rn(e);
1977
+ }
1978
+ function en(t, n) {
1979
+ const e = "labelledby" === n ? "aria-labelledby" : "aria-describedby", i = t?.getAttribute(e);
1980
+ if (!i) return null;
1981
+ const o = i.split(/\s+/), r = [];
1982
+ for (const t of o) {
1983
+ const n = document.getElementById(t);
1984
+ if (!n) continue;
1985
+ const e = on(n) ?? nn(n);
1986
+ e.length && r.push(e);
1987
+ }
1988
+ return r.length ? r.join(" ") : null;
1989
+ }
1990
+ function on(t) {
1991
+ return t?.getAttribute("aria-label")?.trim() ?? null;
1992
+ }
1993
+ function rn(t) {
1994
+ return t.length > Yt ? t.slice(0, Yt) + "..." : t;
1995
+ }
1996
+ function sn(t) {
1997
+ const n = t.getBoundingClientRect();
1998
+ return {
1999
+ x: n.x,
2000
+ y: n.y,
2001
+ width: n.width,
2002
+ height: n.height
2003
+ };
2004
+ }
2005
+ var cn = class {
2006
+ constructor(t) {
2007
+ this.capacity = t, this.cache = /* @__PURE__ */ new Map();
2008
+ }
2009
+ get(t) {
2010
+ return this.cache.get(t);
2011
+ }
2012
+ set(t, n) {
2013
+ if (this.cache.has(t)) this.cache.delete(t);
2014
+ else if (this.cache.size >= this.capacity) {
2015
+ const t = this.cache.keys().next().value;
2016
+ t && this.cache.delete(t);
2017
+ }
2018
+ this.cache.set(t, n);
2019
+ }
2020
+ delete(t) {
2021
+ this.cache.delete(t);
2022
+ }
2023
+ clear() {
2024
+ this.cache.clear();
2025
+ }
2026
+ size() {
2027
+ return this.cache.size;
2028
+ }
2029
+ };
2030
+ async function an(t, o) {
2031
+ const { collectors: r, sdk: s } = t;
2032
+ let c = null, l = null, h = null, f = null;
2033
+ try {
2034
+ c = function(t) {
2035
+ "undefined" != typeof document && "function" == typeof globalThis.fetch || n.warn("FalconService", "createFalconServiceManager called in a non-browser environment — all requests will resolve with { ok: false, kind: 'network' }.");
2036
+ const e = function(t) {
2037
+ const n = t?.timeout, e = t?.baseUrl ?? "", i = t?.api;
2038
+ async function o(t, o, r) {
2039
+ if (void 0 === Ft) return {
2040
+ ok: !1,
2041
+ kind: "network"
2042
+ };
2043
+ const s = e ? `${e}${o}` : o, c = new AbortController();
2044
+ let a = null, l = !1;
2045
+ a = u(() => {
2046
+ l = !0, c.abort();
2047
+ }, n);
2048
+ const h = r?.signal;
2049
+ let f, p = () => {};
2050
+ if (h) if (h.aborted) c.abort();
2051
+ else {
2052
+ const t = () => c.abort();
2053
+ h.addEventListener("abort", t, { once: !0 }), p = () => h.removeEventListener("abort", t);
2054
+ }
2055
+ if (null != r && "body" in r && null != r.body) {
2056
+ const t = function(t) {
2057
+ if (null == t) return {
2058
+ ok: !0,
2059
+ body: void 0
2060
+ };
2061
+ if ("string" == typeof t || t instanceof ArrayBuffer || ArrayBuffer.isView(t) || t instanceof Blob || t instanceof FormData || t instanceof URLSearchParams || t instanceof ReadableStream) return {
2062
+ ok: !0,
2063
+ body: t
2064
+ };
2065
+ try {
2066
+ return {
2067
+ ok: !0,
2068
+ body: JSON.stringify(t)
2069
+ };
2070
+ } catch {
2071
+ return { ok: !1 };
2072
+ }
2073
+ }(r.body);
2074
+ if (!t.ok) return d(a), p(), {
2075
+ ok: !1,
2076
+ kind: "serialize"
2077
+ };
2078
+ f = t.body;
2079
+ }
2080
+ try {
2081
+ const n = await Ft(s, {
2082
+ method: t,
2083
+ headers: Nt({
2084
+ token: r?.token,
2085
+ profileId: r?.profileId,
2086
+ contentType: r?.contentType,
2087
+ contentEncoding: r?.contentEncoding,
2088
+ api: i,
2089
+ hasBody: void 0 !== f,
2090
+ customHeaders: r?.customHeaders
2091
+ }),
2092
+ body: f,
2093
+ signal: c.signal,
2094
+ keepalive: r?.keepalive
2095
+ });
2096
+ if (!n.ok) return 429 === (m = n.status) ? {
2097
+ ok: !1,
2098
+ kind: "rate_limited",
2099
+ status: m
2100
+ } : m >= 400 && m < 500 ? {
2101
+ ok: !1,
2102
+ kind: "client",
2103
+ status: m
2104
+ } : {
2105
+ ok: !1,
2106
+ kind: "server",
2107
+ status: m
2108
+ };
2109
+ if (204 === n.status) return {
2110
+ ok: !0,
2111
+ data: void 0,
2112
+ status: 204
2113
+ };
2114
+ try {
2115
+ return {
2116
+ ok: !0,
2117
+ data: await n.json(),
2118
+ status: n.status
2119
+ };
2120
+ } catch {
2121
+ return c.signal.aborted ? l ? {
2122
+ ok: !1,
2123
+ kind: "timeout"
2124
+ } : {
2125
+ ok: !1,
2126
+ kind: "abort"
2127
+ } : {
2128
+ ok: !1,
2129
+ kind: "parse",
2130
+ status: n.status
2131
+ };
2132
+ }
2133
+ } catch {
2134
+ return l ? {
2135
+ ok: !1,
2136
+ kind: "timeout"
2137
+ } : c.signal.aborted ? {
2138
+ ok: !1,
2139
+ kind: "abort"
2140
+ } : {
2141
+ ok: !1,
2142
+ kind: "network"
2143
+ };
2144
+ } finally {
2145
+ d(a), p();
2146
+ }
2147
+ var m;
2148
+ }
2149
+ return {
2150
+ post: async function(t, n) {
2151
+ return o("POST", t, n);
2152
+ },
2153
+ get: async function(t, n) {
2154
+ return o("GET", t, n);
2155
+ }
2156
+ };
2157
+ }({
2158
+ baseUrl: `${t.api.url}/api/v1`,
2159
+ timeout: 1e4,
2160
+ api: { version: t.api.version }
2161
+ }), i = function(t) {
2162
+ const { getToken: e, refresh: i } = t;
2163
+ let o = null;
2164
+ return { withAuth: async function(t, r) {
2165
+ if (o) {
2166
+ const n = await o;
2167
+ if (n) return t(n);
2168
+ }
2169
+ const s = e() ?? "", c = await t(s);
2170
+ if ((a = c).ok || "client" !== a.kind || !kt.includes(a.status) || !1 === r?.refreshable) return c;
2171
+ var a;
2172
+ const l = await (o || (o = async function() {
2173
+ try {
2174
+ return await i(), e();
2175
+ } catch (t) {
2176
+ return n.warn("AuthMiddleware", "auth refresh failed", t), null;
2177
+ }
2178
+ }().finally(() => {
2179
+ o = null;
2180
+ }), o));
2181
+ return l && l !== s ? t(l) : c;
2182
+ } };
2183
+ }(t), o = () => ({ profileId: t.getProfileId() ?? void 0 });
2184
+ return { api: {
2185
+ ingest: async function(n, r) {
2186
+ return i.withAuth(async (i) => {
2187
+ const { events: s, ...c } = n, a = {
2188
+ ...c,
2189
+ activityId: t.getActivityId()
2190
+ };
2191
+ let l;
2192
+ try {
2193
+ l = await async function(t, n) {
2194
+ const e = function(t, n) {
2195
+ const e = [JSON.stringify(t)];
2196
+ for (let t = 0; t < n.length; t++) try {
2197
+ e.push(JSON.stringify(n[t]));
2198
+ } catch {}
2199
+ return e.join("\n");
2200
+ }(t, n), i = await Ht(e);
2201
+ return i ? {
2202
+ type: "gzip",
2203
+ body: i
2204
+ } : {
2205
+ type: "ndjson",
2206
+ body: e
2207
+ };
2208
+ }(a, s);
2209
+ } catch {
2210
+ return {
2211
+ ok: !1,
2212
+ kind: "serialize"
2213
+ };
2214
+ }
2215
+ return e.post("/events/capture", {
2216
+ body: l.body,
2217
+ token: i,
2218
+ keepalive: r,
2219
+ contentType: "ndjson",
2220
+ contentEncoding: "gzip" === l.type ? "gzip" : void 0,
2221
+ ...o()
2222
+ });
2223
+ }, { refreshable: !r });
2224
+ },
2225
+ reportEvent: async function(t) {
2226
+ return i.withAuth((n) => e.post("/events/report-event", {
2227
+ body: t,
2228
+ token: n,
2229
+ contentType: "json",
2230
+ ...o()
2231
+ }));
2232
+ },
2233
+ startActivity: async function() {
2234
+ return e.post("/events/start-activity", {
2235
+ token: t.getSdkToken(),
2236
+ ...o()
2237
+ });
2238
+ },
2239
+ stopActivity: async function() {
2240
+ return i.withAuth((t) => e.post("/events/end-activity", {
2241
+ token: t,
2242
+ keepalive: !0,
2243
+ ...o()
2244
+ }), { refreshable: !1 });
2245
+ },
2246
+ collectionStatus: async function() {
2247
+ return e.get("/sdk/collection-status", {
2248
+ token: t.getSdkToken(),
2249
+ ...o()
2250
+ });
2251
+ },
2252
+ linkInterview: async function(t) {
2253
+ return i.withAuth((n) => e.post("/events/link-interview", {
2254
+ token: n,
2255
+ contentType: "json",
2256
+ ...o(),
2257
+ customHeaders: { "X-Incode-Hardware-Id": t }
2258
+ }));
2259
+ }
2260
+ } };
2261
+ }({
2262
+ api: {
2263
+ version: s.api.version,
2264
+ url: s.api.url
2265
+ },
2266
+ getSdkToken: () => s.token,
2267
+ getProfileId: () => o.getProfileId(),
2268
+ getToken: () => l?.getToken() ?? null,
2269
+ refresh: async () => l?.refresh() ?? Promise.resolve(),
2270
+ getActivityId: () => l?.getActivityId() ?? ""
2271
+ });
2272
+ const t = await c.api.collectionStatus();
2273
+ if (!t.ok || !0 !== t.data.eventsCollectionEnabled) return { status: "collection-disabled" };
2274
+ l = new gt({
2275
+ startActivity: () => c.api.startActivity(),
2276
+ stopActivity: () => c.api.stopActivity()
2277
+ }), h = new Pt(ct, {
2278
+ ingest: (t, n) => c.api.ingest(t, n),
2279
+ getTabId: () => f?.getTabId() ?? "unknown",
2280
+ isActivityActive: () => l?.isActive() ?? !1
2281
+ });
2282
+ const p = r.tab;
2283
+ f = new $t({
2284
+ push: (t) => h?.push(t),
2285
+ events: {
2286
+ state: p.enabled && p.events.state.enabled,
2287
+ count: p.enabled && p.events.count.enabled
2288
+ }
2289
+ });
2290
+ const m = function(t) {
2291
+ function n(n) {
2292
+ "hidden" === document.visibilityState && t.flush();
2293
+ }
2294
+ function o(n) {
2295
+ t.flush(), t.stopTab(), t.getShouldSkipStopActivity() || t.stopActivity();
2296
+ }
2297
+ const r = a(() => t.onConnectionChange());
2298
+ return {
2299
+ start: function() {
2300
+ e(document, "visibilitychange", n), e(window, "pagehide", o), e(window, "online", r), e(window, "offline", r);
2301
+ },
2302
+ stop: function() {
2303
+ i(document, "visibilitychange", n), i(window, "pagehide", o), i(window, "online", r), i(window, "offline", r);
2304
+ }
2305
+ };
2306
+ }({
2307
+ flush: () => h?.flush("lifecycle"),
2308
+ stopActivity: async () => l?.stop(),
2309
+ stopTab: () => f?.stop(),
2310
+ getShouldSkipStopActivity: () => (f?.queryTabsNumber() ?? 0) > 1,
2311
+ onConnectionChange: () => h?.onConnectionChange()
2312
+ }), w = function(t = {}) {
2313
+ const { elementLevel: n, sanitizeUrl: e = nt } = t, i = n || "redact", o = new cn(6), r = new cn(6);
2314
+ return { resolve: function(t) {
2315
+ if (!t || k(t) || "off" === i) return null;
2316
+ let n = o.get(t);
2317
+ if (n || (n = function(t) {
2318
+ if (!t || k(t)) return {
2319
+ chain: [],
2320
+ redaction: {
2321
+ level: "ignore",
2322
+ index: -1
2323
+ }
2324
+ };
2325
+ const n = [];
2326
+ let e = t, i = -1;
2327
+ for (; e;) {
2328
+ if (k(e)) return {
2329
+ chain: [],
2330
+ redaction: {
2331
+ level: "ignore",
2332
+ index: -1
2333
+ }
2334
+ };
2335
+ T(e) && (i = n.length), n.push(e);
2336
+ const t = e.parentNode;
2337
+ if (!t || b(e, "body")) break;
2338
+ if (g(t)) e = t.host;
2339
+ else {
2340
+ if (t.nodeType !== Node.ELEMENT_NODE) break;
2341
+ e = t;
2342
+ }
2343
+ }
2344
+ return {
2345
+ chain: n,
2346
+ redaction: {
2347
+ level: -1 === i ? "full" : "redact",
2348
+ index: i
2349
+ }
2350
+ };
2351
+ }(t.parentElement), o.set(t, n)), "ignore" === n.redaction.level) return null;
2352
+ const s = "redact" === n.redaction.level || "redact" === i || T(t);
2353
+ let c = r.get(t);
2354
+ return c || (c = function(t, n, i, o) {
2355
+ const r = getComputedStyle(t), s = sn(t), c = function(t, n, e = !1, i = nt) {
2356
+ const o = [], r = [];
2357
+ for (let s = t.length - 1; s >= 0; s--) {
2358
+ const c = t[s], a = e || s <= n, l = s + 1, u = Jt(c, a, sn(c), i), { score: d, reasons: h } = Gt(c, l);
2359
+ if (o.push(u), !Zt(d)) continue;
2360
+ const f = tn(c, a);
2361
+ r.push({
2362
+ ...u,
2363
+ ...f ? { label: f } : {},
2364
+ depth: l,
2365
+ score: d,
2366
+ reasons: h
2367
+ });
2368
+ }
2369
+ return {
2370
+ ancestors: o,
2371
+ interactiveCandidates: r.reverse()
2372
+ };
2373
+ }(n, o, i, e), a = Jt(t, i, s, e), l = function(t, n, e) {
2374
+ const { score: i, reasons: o } = Gt(t, 0);
2375
+ return {
2376
+ interactive: Zt(i),
2377
+ ...o.length > 0 ? { reasons: o } : {},
2378
+ disabled: Wt(t),
2379
+ rendered: "none" !== n?.display,
2380
+ visible: "hidden" !== n?.visibility,
2381
+ inViewport: Qt(e),
2382
+ acceptsPointer: "none" !== n?.pointerEvents,
2383
+ opacity: parseFloat(n?.opacity || "1")
2384
+ };
2385
+ }(t, r, s);
2386
+ let u = null;
2387
+ return i || (u = l.interactive ? tn(t) : null), {
2388
+ tagName: a.tagName,
2389
+ frame: a.frame,
2390
+ viewport: {
2391
+ height: window.innerHeight,
2392
+ width: window.innerWidth,
2393
+ scrollX: window.scrollX,
2394
+ scrollY: window.scrollY,
2395
+ dpr: window.devicePixelRatio
2396
+ },
2397
+ attributes: a.attributes,
2398
+ nth: a.nth,
2399
+ ...u ? { label: u } : {},
2400
+ ancestors: c.ancestors,
2401
+ interactiveCandidates: c.interactiveCandidates,
2402
+ interactivity: l
2403
+ };
2404
+ }(t, n.chain, s, n.redaction.index), r.set(t, c)), c;
2405
+ } };
2406
+ }({
2407
+ elementLevel: s.capture?.element,
2408
+ sanitizeUrl: s.sanitizeUrl
2409
+ }), y = /* @__PURE__ */ new Set();
2410
+ try {
2411
+ y.add(new URL(s.api.url).origin);
2412
+ } catch {}
2413
+ const v = function(t, n, e = "on") {
2414
+ const i = /* @__PURE__ */ new Map();
2415
+ function o(o) {
2416
+ if (i.has(o)) return;
2417
+ const r = Q[o];
2418
+ if (!r || !function(t, n) {
2419
+ return n[t]?.enabled ?? !1;
2420
+ }(o, n)) return;
2421
+ const s = n[o], c = r.create(t, e, s && "events" in s ? s.events : void 0);
2422
+ i.set(o, c);
2423
+ }
2424
+ return {
2425
+ start: o,
2426
+ stopCollector: function(t) {
2427
+ const n = i.get(t);
2428
+ n && (n(), i.delete(t));
2429
+ },
2430
+ stop: function() {
2431
+ for (const [, t] of i) t();
2432
+ i.clear();
2433
+ },
2434
+ isRunning: function(t) {
2435
+ return i.has(t);
2436
+ },
2437
+ autocapture: function() {
2438
+ for (const t of W) o(t);
2439
+ }
2440
+ };
2441
+ }({
2442
+ push: (t) => h?.push(t),
2443
+ resolveElement: (t) => w.resolve(t),
2444
+ sanitizeUrl: s.sanitizeUrl,
2445
+ ignoredOrigins: y
2446
+ }, r, s.capture?.content), _ = new Xt({
2447
+ getActivityId: () => l?.getActivityId() ?? "",
2448
+ reportEvent: (t) => c.api.reportEvent(t)
2449
+ });
2450
+ return {
2451
+ status: "ready",
2452
+ managers: {
2453
+ falconServiceManager: c,
2454
+ activityManager: l,
2455
+ transportManager: h,
2456
+ tabManager: f,
2457
+ lifecycleManager: m,
2458
+ collectorManager: v,
2459
+ eventReportManager: _
2460
+ }
2461
+ };
2462
+ } catch (t) {
2463
+ return n.warn("IncodeTRI", "setup() failed during construction:", t), { status: "init-failed" };
2464
+ }
2465
+ }
2466
+ let ln = class t {
2467
+ constructor() {
2468
+ this.Tt = 0, this._t = null, this.It = et;
2469
+ }
2470
+ static get instance() {
2471
+ return t.i || (t.i = new t()), t.i;
2472
+ }
2473
+ async setup(t) {
2474
+ if (this.It !== et) return n.fatal("error", "setup()", `cannot set up from state '${this.It}' — call reset() (or reload) first. Ignoring.`), st;
2475
+ try {
2476
+ const e = function(t) {
2477
+ if ("undefined" == typeof document) return n.fatal("error", "IncodeTRI", "TRI is not available in a non-browser environment."), null;
2478
+ if (!t?.token) return n.fatal("error", "SDK", "token is required."), null;
2479
+ if (!t.apiURL) return n.fatal("error", "SDK", "Couldn't initialise SDK — apiURL isn't provided."), null;
2480
+ const { element: e, content: i } = t.capture ?? {}, o = {
2481
+ token: t.token,
2482
+ capture: {
2483
+ element: e ?? "redact",
2484
+ content: i ?? "off"
2485
+ },
2486
+ api: {
2487
+ version: t.apiVersion ?? "1.0",
2488
+ url: t.apiURL
2489
+ },
2490
+ sanitizeUrl: (r = t.sanitizeUrl, r ? function(t) {
2491
+ return s(() => r(t, nt)) ?? nt(t);
2492
+ } : nt),
2493
+ DEBUG: t.DEBUG ?? !1
2494
+ };
2495
+ var r;
2496
+ return void 0 === t.collectors && void 0 === t.layers ? {
2497
+ sdk: o,
2498
+ collectors: at()
2499
+ } : void 0 !== t.collectors ? {
2500
+ sdk: o,
2501
+ collectors: ut(t.collectors)
2502
+ } : {
2503
+ sdk: o,
2504
+ collectors: lt(t.layers)
2505
+ };
2506
+ }(t);
2507
+ if (!e) return this.It = st, st;
2508
+ n.DEBUG = e.sdk.DEBUG;
2509
+ const i = await an(e, { getProfileId: () => null });
2510
+ return "collection-disabled" === i.status ? (n.fatal("warn", "setup()", "Collection is disabled for the provided API Key."), this.It = rt, rt) : "init-failed" === i.status ? (this.It = st, st) : (this._t = i.managers, this.It = it, !1 !== t.autostart ? this.start() : it);
2511
+ } catch (t) {
2512
+ return n.warn("setup()", "failed:", t), this.It = st, st;
2513
+ }
2514
+ }
2515
+ async start() {
2516
+ if (this.It === et) return n.warn("start()", "start() requires a prior successful setup() — ignoring."), this.It;
2517
+ if (this.It !== it) return n.fatal("warn", "start()", "TRI is either already started or isn't ready — ignoring."), this.It;
2518
+ this.It = "starting";
2519
+ const t = ++this.Tt;
2520
+ return await this.v(t), this.It;
2521
+ }
2522
+ async stop() {
2523
+ n.warn("stop()", "called");
2524
+ const t = this._t;
2525
+ return t ? (++this.Tt, t.lifecycleManager.stop(), t.collectorManager.stop(), t.tabManager.stop(), t.eventReportManager.stop(), this.It = it, this.xt(t)) : Promise.resolve(this.It);
2526
+ }
2527
+ async reset() {
2528
+ const t = this.stop();
2529
+ return this.It = et, this._t = null, t.then(() => this.It);
2530
+ }
2531
+ async xt(t) {
2532
+ return await function(t) {
2533
+ let n = null;
2534
+ const e = new Promise((t) => {
2535
+ n = u(t, 2e3);
2536
+ });
2537
+ return Promise.race([t.finally(() => d(n)), e]);
2538
+ }(Promise.resolve(t.transportManager.stop())), await t.activityManager.stop(), this.It;
2539
+ }
2540
+ async v(t) {
2541
+ const e = this._t;
2542
+ if (e) {
2543
+ try {
2544
+ if (await e.activityManager.start(), t !== this.Tt) return;
2545
+ if (e.transportManager.start(), await e.tabManager.start(), t !== this.Tt) return;
2546
+ e.lifecycleManager.start(), e.collectorManager.autocapture();
2547
+ } catch (e) {
2548
+ n.warn("start()", "failed during monitoring start:", e), t === this.Tt && (this.It = it);
2549
+ return;
2550
+ }
2551
+ t === this.Tt && (this.It = ot);
2552
+ }
2553
+ }
2554
+ async linkInterview(t) {
2555
+ if (this.It !== ot || !this._t) return n.warn("linkInterview()", "linkInterview() called before start() completed — ignoring."), !1;
2556
+ if (!t) return n.warn("linkInterview()", "linkInterview() called without sessionToken — ignoring."), !1;
2557
+ try {
2558
+ return (await this._t.falconServiceManager.api.linkInterview(t)).ok;
2559
+ } catch (t) {
2560
+ return n.warn("linkInterview()", "failed:", t), !1;
2561
+ }
2562
+ }
2563
+ };
2564
+ async function un(t, n) {
2565
+ const e = n?.apiURL ?? "https://falcon-ingest-k8s.stage.incodetest.com", i = n?.timeout ?? 1e4, o = new AbortController();
2566
+ let r = null, s = !1, c = () => {};
2567
+ i && (r = u(() => {
2568
+ s = !0, o.abort();
2569
+ }, i));
2570
+ const a = n?.signal;
2571
+ if (a) if (a.aborted) o.abort();
2572
+ else {
2573
+ const t = () => o.abort();
2574
+ a.addEventListener("abort", t, { once: !0 }), c = () => a.removeEventListener("abort", t);
2575
+ }
2576
+ try {
2577
+ const n = await fetch(`${e}/api/v1/sdk/init`, {
2578
+ method: "POST",
2579
+ headers: {
2580
+ "content-type": "application/json",
2581
+ "x-api-key": t,
2582
+ "x-api-version": "1.0"
2583
+ },
2584
+ signal: o.signal
2585
+ });
2586
+ if (!n.ok) {
2587
+ let t = n.statusText;
2588
+ try {
2589
+ const e = await n.json();
2590
+ e.errorMessage && (t = e.errorMessage);
2591
+ } catch {}
2592
+ return {
2593
+ token: null,
2594
+ expiresAt: null,
2595
+ tokenType: null,
2596
+ eventsCollectionEnabled: !1,
2597
+ error: {
2598
+ status: n.status,
2599
+ message: t
2600
+ }
2601
+ };
2602
+ }
2603
+ const i = await n.json();
2604
+ return {
2605
+ token: i.token,
2606
+ expiresAt: i.expiresAt,
2607
+ tokenType: i.tokenType,
2608
+ eventsCollectionEnabled: !0,
2609
+ error: null
2610
+ };
2611
+ } catch (t) {
2612
+ throw new Error((s ? "[TRI] createSession timed out" : "[TRI] Failed to create session:") + " " + t.message);
2613
+ } finally {
2614
+ d(r), c();
2615
+ }
2616
+ }
2617
+ ln.i = null;
2618
+ const dn = ln.instance;
2619
+ //#endregion
2620
+ export { un as createSession, dn as default };