@incodetech/core 2.4.0 → 2.4.1-agentic.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 (252) hide show
  1. package/dist/BrowserNetworkStatusProvider-BrDXBEDd.esm.js +21 -0
  2. package/dist/{multipartRecordingService-CLwrF5wD.esm.js → CameraCompositor-DN7NkJzV.esm.js} +7 -744
  3. package/dist/{FaceDetectionProvider-DcPOC2gS.esm.js → FaceDetectionProvider-CAY43vSI.esm.js} +28 -64
  4. package/dist/IBrowserEnvironmentCapability-D7JG7ML3.esm.js +16 -0
  5. package/dist/IGeolocationCapability-r49Qo7rR.d.ts +10 -0
  6. package/dist/{IWasmUtilCapability-GF2n7sfm.d.ts → IWasmUtilCapability-Cqiaxydi.d.ts} +31 -4
  7. package/dist/MultipartRecordingProvider-D9mauUdS.esm.js +146 -0
  8. package/dist/{PhoneValidationProvider-SZiOS0jB.esm.js → PhoneValidationProvider-Co4zk2en.esm.js} +7 -0
  9. package/dist/{StreamCanvasCapture-7JRf-2ck.d.ts → StreamCanvasCapture-C3xNfOsv.d.ts} +12 -3
  10. package/dist/StreamCanvasProcessingSession-CBnbTnOr.esm.js +42 -0
  11. package/dist/{WasmUtilProvider-DtJuBdt-.esm.js → WasmUtilProvider-Dp2V-Uct.esm.js} +75 -22
  12. package/dist/WorkerEncoderRecordingProvider-B1ODYtgN.esm.js +80 -0
  13. package/dist/addressSearch-DzbE9Ogt.esm.js +254 -0
  14. package/dist/{advanceableErrors-q_pfU3Cn.esm.js → advanceableErrors-k-U-cL5m.esm.js} +1 -2
  15. package/dist/ae-signature.esm.js +1 -1
  16. package/dist/antifraud.esm.js +2 -2
  17. package/dist/{antifraudManager-CaweCYnY.esm.js → antifraudManager-BObuHBjn.esm.js} +2 -2
  18. package/dist/{antifraudStateMachine-DRl0UVyA.esm.js → antifraudStateMachine-Dfrd2-26.esm.js} +1 -1
  19. package/dist/{api-Cz90EHyu.esm.js → api-CpP4PS4S.esm.js} +8 -5
  20. package/dist/{apiError-DPwFas2f.esm.js → apiError-DH-CH4Nz.esm.js} +1 -1
  21. package/dist/attemptCarry-WOkfvFMw.esm.js +45 -0
  22. package/dist/authentication.d.ts +3 -3
  23. package/dist/authentication.esm.js +2 -2
  24. package/dist/{authenticationManager-BIZC55Bi.d.ts → authenticationManager-CWmh7aSY.d.ts} +1 -1
  25. package/dist/{authenticationManager-2Lr5V_7p.esm.js → authenticationManager-DjX0XDyH.esm.js} +5 -5
  26. package/dist/{authenticationStateMachine-C99B0GFP.esm.js → authenticationStateMachine-BMbZL8wm.esm.js} +3 -3
  27. package/dist/backCameraLabel-yda5ugE4.esm.js +67 -0
  28. package/dist/{backCameraStream-CMvXj4X4.esm.js → backCameraStream-DS1oDiUq.esm.js} +12 -107
  29. package/dist/{browser-DlFgHpoC-DnyrCR8r.esm.js → browser-pQZA35G2-DtkAf6sn.esm.js} +161 -150
  30. package/dist/{camera-sIa9ceW2.esm.js → camera-E_Kcre4O.esm.js} +15 -23
  31. package/dist/camera.d.ts +2 -2
  32. package/dist/camera.esm.js +1 -1
  33. package/dist/certificate-issuance.esm.js +2 -2
  34. package/dist/{certificateIssuanceManager-BfeMv2PU.esm.js → certificateIssuanceManager-C1nETQos.esm.js} +2 -2
  35. package/dist/{certificateIssuanceStateMachine-Frgjbjw8.esm.js → certificateIssuanceStateMachine-DThXMDqr.esm.js} +2 -2
  36. package/dist/cnpj-Co1ottYN.esm.js +77 -0
  37. package/dist/connectivity-BCuEoQ-n.esm.js +114 -0
  38. package/dist/consent.d.ts +1 -1
  39. package/dist/consent.esm.js +2 -2
  40. package/dist/{consentManager-CvEu8h_W.esm.js → consentManager-DMlSL6Ax.esm.js} +4 -3
  41. package/dist/{consentManager-Cv_0QKLD.d.ts → consentManager-bjfVXO7p.d.ts} +9 -2
  42. package/dist/{consentStateMachine-DJTgN_-1.esm.js → consentStateMachine-DIYSMxKQ.esm.js} +20 -7
  43. package/dist/cross-document-data-match.esm.js +1 -1
  44. package/dist/{crossDocumentDataMatchManager-Cu141CE8.esm.js → crossDocumentDataMatchManager-BFTdiEDB.esm.js} +2 -2
  45. package/dist/curp-validation.d.ts +1 -1
  46. package/dist/curp-validation.esm.js +2 -2
  47. package/dist/{curpValidationManager-B-z9q5V3.esm.js → curpValidationManager-DNpC3wyf.esm.js} +3 -2
  48. package/dist/{curpValidationManager-C9sqoh9n.d.ts → curpValidationManager-z8428oCM.d.ts} +1 -1
  49. package/dist/{curpValidationStateMachine-vDEFLMPw.esm.js → curpValidationStateMachine-B3iVsDyt.esm.js} +28 -20
  50. package/dist/custom-fields.esm.js +1 -1
  51. package/dist/custom-watchlist.esm.js +2 -2
  52. package/dist/{customFieldsManager-D1ex2cFM.esm.js → customFieldsManager-CvI-pDT3.esm.js} +2 -2
  53. package/dist/{customWatchlistManager-CTI-SGk0.esm.js → customWatchlistManager-BuHtUb0y.esm.js} +2 -2
  54. package/dist/{customWatchlistStateMachine-hmRd0f2I.esm.js → customWatchlistStateMachine-CiVD9wyF.esm.js} +1 -1
  55. package/dist/{deepsightService-CKTYDIXD.esm.js → deepsightLoader-B7DEYoyY.esm.js} +40 -74
  56. package/dist/{createCameraCycleOwnership-Dj_LHUvN.esm.js → desktopCameraElection-BGMtYwk3.esm.js} +177 -40
  57. package/dist/device.esm.js +2 -2
  58. package/dist/document-capture.d.ts +3 -3
  59. package/dist/document-capture.esm.js +2 -2
  60. package/dist/{documentCaptureManager-DkyDtm3Y.d.ts → documentCaptureManager-CD5iQiUI.d.ts} +37 -4
  61. package/dist/{documentCaptureManager-DUJwpKC5.esm.js → documentCaptureManager-DLPqruXJ.esm.js} +27 -19
  62. package/dist/{documentCaptureStateMachine-B8i7GnLh.esm.js → documentCaptureStateMachine-DCvWQhFG.esm.js} +105 -56
  63. package/dist/dynamic-forms.d.ts +2 -2
  64. package/dist/dynamic-forms.esm.js +2 -2
  65. package/dist/{dynamicFormsManager-C0dHs1ty.d.ts → dynamicFormsManager-9kwY8Bf5.d.ts} +1 -1
  66. package/dist/{dynamicFormsManager-DiKYjcF3.esm.js → dynamicFormsManager-DfqCEPg9.esm.js} +2 -2
  67. package/dist/{dynamicFormsStateMachine-DEI45xYW.esm.js → dynamicFormsStateMachine-USQMB-uV.esm.js} +2 -2
  68. package/dist/ekyb.d.ts +4 -4
  69. package/dist/ekyb.esm.js +3 -3
  70. package/dist/{ekybManager-BaZ_7CEu.d.ts → ekybManager-BLOkwmWO.d.ts} +2 -2
  71. package/dist/{ekybManager-8WLkNcqg.esm.js → ekybManager-CR8YSYux.esm.js} +2 -2
  72. package/dist/{ekybStateMachine-BLRT45Ex.esm.js → ekybStateMachine-kHwdz6hm.esm.js} +28 -44
  73. package/dist/ekybUtils-Cw8Ta9Qi.esm.js +140 -0
  74. package/dist/ekyc.d.ts +4 -3
  75. package/dist/ekyc.esm.js +3 -3
  76. package/dist/{ekycManager-DW-ynodd.d.ts → ekycManager-DlGIn9wA.d.ts} +2 -1
  77. package/dist/{ekycManager-BO-Lui3t.esm.js → ekycManager-DymCvmVB.esm.js} +2 -2
  78. package/dist/ekycStateMachine-CoFCUJ2z.esm.js +7578 -0
  79. package/dist/ekycUtils-GRuMELYr.esm.js +1472 -0
  80. package/dist/electronic-signature.esm.js +1 -1
  81. package/dist/{electronicSignatureManager-CcIMOb_Y.esm.js → electronicSignatureManager-BCE3uA3z.esm.js} +4 -4
  82. package/dist/email.esm.js +2 -2
  83. package/dist/{emailManager-ButFktRm.esm.js → emailManager-CGoE3CUe.esm.js} +2 -2
  84. package/dist/{emailStateMachine-BXtlC0NV.esm.js → emailStateMachine-KgHfDNvM.esm.js} +32 -20
  85. package/dist/{events-Du2A4-Qr.esm.js → events-ggpBBaZ8.esm.js} +2 -2
  86. package/dist/events.esm.js +1 -1
  87. package/dist/extensibility.d.ts +37 -22
  88. package/dist/extensibility.esm.js +36 -35
  89. package/dist/{externalFetch-DrR9xshk.esm.js → externalFetch-CQY41QT1.esm.js} +4 -1
  90. package/dist/face-match.d.ts +1 -1
  91. package/dist/face-match.esm.js +2 -2
  92. package/dist/{faceCaptureManagerFactory-1hzeS_rB.d.ts → faceCaptureManagerFactory-DV2ULUYS.d.ts} +71 -66
  93. package/dist/{faceCaptureManagerFactory-BlGvXzXA.esm.js → faceCaptureManagerFactory-Dp90bedH.esm.js} +4 -4
  94. package/dist/{faceCaptureSetup-TY8RXc2N.esm.js → faceCaptureSetup-ZfiWg0fo.esm.js} +84 -457
  95. package/dist/{faceMatchManager-DWFUQjMQ.esm.js → faceMatchManager-D2xKPjjQ.esm.js} +2 -2
  96. package/dist/{faceMatchManager-DIgG-UFS.d.ts → faceMatchManager-Z4UDLwAv.d.ts} +16 -7
  97. package/dist/{faceMatchStateMachine-CUCvlydD.esm.js → faceMatchStateMachine-CUvwiQi9.esm.js} +40 -27
  98. package/dist/{feature-management-B5rR10uS.esm.js → feature-management-BbCIA4og.esm.js} +35 -21
  99. package/dist/feature-management.esm.js +1 -1
  100. package/dist/field-comparison.esm.js +1 -1
  101. package/dist/{fieldComparisonManager-v3knTYV_.esm.js → fieldComparisonManager-DgDbEeFZ.esm.js} +2 -2
  102. package/dist/fiscal-qr.esm.js +1 -1
  103. package/dist/{fiscalQrManager-Dt9fHG7h.esm.js → fiscalQrManager-BZeklojR.esm.js} +4 -4
  104. package/dist/flow-events.d.ts +1 -1
  105. package/dist/flow.d.ts +10 -10
  106. package/dist/flow.esm.js +10 -9
  107. package/dist/{flowCompletionService-BDI5QpfR.esm.js → flowCompletionService-CcCnPs_T.esm.js} +2 -2
  108. package/dist/{flowServices-roD0oIQL.esm.js → flowServices-Dmnc8Rye.esm.js} +69 -185
  109. package/dist/geolocation.d.ts +1 -1
  110. package/dist/geolocation.esm.js +2 -2
  111. package/dist/{geolocationManager-Dn24g1fl.d.ts → geolocationManager-6e1i9UIR.d.ts} +15 -17
  112. package/dist/{geolocationManager-DnONzWL5.esm.js → geolocationManager-BJJ3m_I8.esm.js} +6 -8
  113. package/dist/{geolocationStateMachine-eWy_G4Os.esm.js → geolocationStateMachine-CTI3m4Ie.esm.js} +12 -8
  114. package/dist/{getDeviceClass-bsWdEDxP.esm.js → getDeviceClass-DoIWuKI8.esm.js} +1 -1
  115. package/dist/government-validation.esm.js +2 -2
  116. package/dist/{governmentValidationManager-BtXWHICu.esm.js → governmentValidationManager-CjChjZ3C.esm.js} +2 -2
  117. package/dist/{governmentValidationStateMachine-COL-Vs48.esm.js → governmentValidationStateMachine-AEbn3Afi.esm.js} +1 -1
  118. package/dist/home.d.ts +1 -1
  119. package/dist/home.esm.js +1 -1
  120. package/dist/http.esm.js +1 -1
  121. package/dist/id-ocr.d.ts +1 -1
  122. package/dist/id-ocr.esm.js +2 -2
  123. package/dist/id-selfie-flow.d.ts +1 -1
  124. package/dist/id-selfie-flow.esm.js +10 -9
  125. package/dist/id-verification.esm.js +2 -2
  126. package/dist/id.d.ts +3 -16
  127. package/dist/id.esm.js +4 -4
  128. package/dist/{idCaptureDefaults-BGsG2OAs.esm.js → idCaptureDefaults-Dszuq9ng.esm.js} +3 -3
  129. package/dist/{idCaptureManager-BrfYjCm_.esm.js → idCaptureManager-B3oR4RnA.esm.js} +64 -17
  130. package/dist/{idCaptureManager-0M02hSuC.d.ts → idCaptureManager-CCA2D1Ah.d.ts} +68 -5
  131. package/dist/{idCaptureServices-BSj6EH2l.esm.js → idCaptureServices-DK0QboqT.esm.js} +29 -198
  132. package/dist/{idCaptureStateMachine-dXKBYHQp.esm.js → idCaptureStateMachine-zzar9MPy.esm.js} +914 -536
  133. package/dist/{idOcrManager-DT3kPIB3.d.ts → idOcrManager-BTdHlJ9D.d.ts} +1 -1
  134. package/dist/{idOcrManager-D3-HNMXP.esm.js → idOcrManager-xyEZNOBa.esm.js} +2 -2
  135. package/dist/{idOcrStateMachine-DyENX6Ki.esm.js → idOcrStateMachine-DNKXh4Rn.esm.js} +2 -2
  136. package/dist/{idVerificationManager-iWz7Avkr.esm.js → idVerificationManager-DdnvYfgN.esm.js} +2 -2
  137. package/dist/{idVerificationStateMachine-CL1kUdBe.esm.js → idVerificationStateMachine-DtIBCa32.esm.js} +1 -1
  138. package/dist/identity-reuse.esm.js +2 -2
  139. package/dist/{identityReuseManager-CD1ucp1d.esm.js → identityReuseManager-CcpovlfD.esm.js} +2 -2
  140. package/dist/{identityReuseStateMachine-DfV81wQC.esm.js → identityReuseStateMachine-DxZFWy47.esm.js} +1 -1
  141. package/dist/{index-CKQ9QBZP.d.ts → index-DC0P2Vzw.d.ts} +1 -1
  142. package/dist/{index-BKOWUhxG.d.ts → index-DEfwds5y.d.ts} +55 -8
  143. package/dist/index.d.ts +1 -1
  144. package/dist/index.esm.js +1 -1
  145. package/dist/{invokeOnCaptureCallback-DYrkOXO6.esm.js → invokeOnCaptureCallback-BJ0GVHGr.esm.js} +1 -1
  146. package/dist/kyb-checks.d.ts +3 -0
  147. package/dist/kyb-checks.esm.js +3 -0
  148. package/dist/kybChecksManager-CblEL97E.d.ts +95 -0
  149. package/dist/kybChecksManager-DpGOp4Su.esm.js +89 -0
  150. package/dist/kybChecksStateMachine-B43NAnv7.esm.js +718 -0
  151. package/dist/mandatory-consent.d.ts +2 -2
  152. package/dist/mandatory-consent.esm.js +2 -2
  153. package/dist/{mandatoryConsentManager-Cwqx1nK7.esm.js → mandatoryConsentManager-B4vCYslr.esm.js} +4 -3
  154. package/dist/{mandatoryConsentManager-BQ43yndC.d.ts → mandatoryConsentManager-B88Sm5nd.d.ts} +10 -3
  155. package/dist/{mandatoryConsentStateMachine-pXWqAHo_.esm.js → mandatoryConsentStateMachine-DWslYPA3.esm.js} +20 -7
  156. package/dist/mediaRecorderOptions-B9-IEVtV.esm.js +70 -0
  157. package/dist/multipartRecordingService-BTqkHGG9.esm.js +407 -0
  158. package/dist/nationalIds-B91f_RuB.esm.js +99 -0
  159. package/dist/{permissionGuards-gcy3U0SL.esm.js → permissionGuards-DFV-Ws0a.esm.js} +1 -1
  160. package/dist/{permissionServices-Ca-tSNhT.esm.js → permissionServices-D190ATGD.esm.js} +11 -9
  161. package/dist/phone-number.d.ts +7 -1
  162. package/dist/phone-number.esm.js +15 -2
  163. package/dist/phone.d.ts +1 -1
  164. package/dist/phone.esm.js +2 -2
  165. package/dist/phoneFormat-JJNaWthV.esm.js +75 -0
  166. package/dist/{phoneManager-BO-LTih5.d.ts → phoneManager-6nrJkvkG.d.ts} +5 -0
  167. package/dist/{phoneManager-KKUq-Vgo.esm.js → phoneManager-Dy5tODCU.esm.js} +3 -3
  168. package/dist/phoneServices-DJgyOzU2.esm.js +77 -0
  169. package/dist/{phoneStateMachine-D2QWS2cu.esm.js → phoneStateMachine-DnlPhnw7.esm.js} +54 -82
  170. package/dist/{phoneValidation-DnBcNUNh.esm.js → phoneValidation-OggtfjRt.esm.js} +1 -2
  171. package/dist/{platform-DkcRc9JV.esm.js → platform-aPh7gTWh.esm.js} +15 -1
  172. package/dist/processFaceMatch-Bst83HaS.esm.js +21 -0
  173. package/dist/qe-signature.esm.js +1 -1
  174. package/dist/recordingService-CTko6Cjn.esm.js +397 -0
  175. package/dist/redirect-to-mobile.d.ts +2 -2
  176. package/dist/redirect-to-mobile.esm.js +2 -2
  177. package/dist/{redirectToMobileManager-uHW3dyuQ.esm.js → redirectToMobileManager-CgGaT2NP.esm.js} +5 -4
  178. package/dist/{redirectToMobileManager-CVsvpVbQ.d.ts → redirectToMobileManager-Dm9ctRCC.d.ts} +3 -1
  179. package/dist/{redirectToMobileStateMachine-b-H-ipGM.esm.js → redirectToMobileStateMachine-CbhN8uVN.esm.js} +65 -26
  180. package/dist/resolveForm-O7-r79VA.esm.js +351 -0
  181. package/dist/{runChildModule-BF_atgNx.esm.js → runChildModule-BffFArwl.esm.js} +3 -3
  182. package/dist/{sdkVersion-CsIbltJF.esm.js → sdkVersion-CDd_gaR7.esm.js} +1 -1
  183. package/dist/selfie.d.ts +4 -4
  184. package/dist/selfie.esm.js +10 -10
  185. package/dist/{selfieErrorUtils-BY0-YbPW.esm.js → selfieErrorUtils-f4MgAG2A.esm.js} +1 -1
  186. package/dist/{selfieManager-BJdNu_nd.d.ts → selfieManager-DmZFzs1-.d.ts} +1 -1
  187. package/dist/{selfieManager-vAAwzsHk.esm.js → selfieManager-hopelYEk.esm.js} +5 -5
  188. package/dist/{selfieStateMachine-BFVp3ElQ.esm.js → selfieStateMachine-DaZIVv3Q.esm.js} +3 -3
  189. package/dist/{session-CpwfoVdH.esm.js → session-CdSX4wsZ.esm.js} +77 -9
  190. package/dist/session.d.ts +96 -10
  191. package/dist/session.esm.js +7 -6
  192. package/dist/{sessionInitializer-BTjYgE-V.esm.js → sessionInitializer-DsL7X2j9.esm.js} +465 -206
  193. package/dist/{setup-YPKTUCY5.d.ts → setup-D9qt8YVU.d.ts} +2 -2
  194. package/dist/{setup-BInNAvQw.esm.js → setup-DDahygZs.esm.js} +44 -30
  195. package/dist/signature.esm.js +2 -2
  196. package/dist/{signatureManager-f_dPAGXn.esm.js → signatureManager-CwqjcxPg.esm.js} +2 -2
  197. package/dist/{signatureStateMachine-C-nUq_oq.esm.js → signatureStateMachine-DBVDd1Eu.esm.js} +1 -1
  198. package/dist/{stats-BEvexnKC.esm.js → stats-CatA2dea.esm.js} +1 -1
  199. package/dist/stats.esm.js +1 -1
  200. package/dist/textRules-D4NRinKY.d.ts +41 -0
  201. package/dist/{tri-xzRLIIMN.esm.js → tri-DG6priFa.esm.js} +142 -8
  202. package/dist/tri.d.ts +1 -1
  203. package/dist/tri.esm-CzTNi5Q_.esm.js +3826 -0
  204. package/dist/tri.esm.js +1 -1
  205. package/dist/{trueSightService-BMT-TubT.esm.js → trueSightService-GuLthUVK.esm.js} +19 -10
  206. package/dist/trust-graph.esm.js +1 -1
  207. package/dist/types-B9C8W01q.d.ts +34 -0
  208. package/dist/{types-yPH8lAH-.d.ts → types-BEVHQbbC.d.ts} +2 -2
  209. package/dist/{types-BAxn7MpY.d.ts → types-BPm1JSu7.d.ts} +123 -48
  210. package/dist/{types-0L-eFDmr.d.ts → types-BgRHw-dR.d.ts} +1 -1
  211. package/dist/{types-B6HsSzpk.d.ts → types-CRaFu6wS.d.ts} +6 -3
  212. package/dist/types-CTaL0XJz.d.ts +80 -0
  213. package/dist/{types-Ckir_BEs.d.ts → types-Cd0J0F9D.d.ts} +1 -1
  214. package/dist/{types-CK8Jbjkp.d.ts → types-Csh8vzPo.d.ts} +1 -1
  215. package/dist/types-CuMJ2M7D.d.ts +210 -0
  216. package/dist/{types-DUnFZ08M.d.ts → types-CyNndVAT.d.ts} +16 -8
  217. package/dist/{types-DPIDuhut.d.ts → types-DNVzoRvi.d.ts} +2 -1
  218. package/dist/types-J6g6iKe_.d.ts +6 -0
  219. package/dist/{urlUtils-6jsE6rKp.esm.js → urlUtils-eYiyWjh0.esm.js} +4 -1
  220. package/dist/video-selfie.d.ts +8 -8
  221. package/dist/video-selfie.esm.js +97 -22
  222. package/dist/{videoSelfieCameraWarmer-D1xA0u8y.esm.js → videoSelfieCameraWarmer-e3irGfcO.esm.js} +18 -21
  223. package/dist/{videoSelfieStepDetector-CGsTltqB.d.ts → videoSelfieStepDetector-Dv3Mgws-.d.ts} +9 -4
  224. package/dist/virtualCameraCheck-eFOm2C9q.esm.js +27 -0
  225. package/dist/{warmup-BElYWRh7.esm.js → warmup-DtB0DJpl.esm.js} +198 -27
  226. package/dist/wasm.d.ts +2 -2
  227. package/dist/wasm.esm.js +3 -3
  228. package/dist/{wasmDsFlagSync-CYj5LL9z.esm.js → wasmDsFlagSync-BtiR5pig.esm.js} +1 -1
  229. package/dist/wasmMetadataVersionSync-U8EFUr1T.esm.js +27 -0
  230. package/dist/{wasmWebClient-BjZw_7OB.esm.js → wasmWebClient-BDrax6Eu.esm.js} +55 -26
  231. package/dist/watchlist-for-business.d.ts +2 -1
  232. package/dist/watchlist-for-business.esm.js +2 -2
  233. package/dist/watchlist.esm.js +2 -2
  234. package/dist/{watchlistForBusinessManager-B3GDPZrr.d.ts → watchlistForBusinessManager-DX2AyM4Y.d.ts} +54 -18
  235. package/dist/{watchlistForBusinessManager-CZZOFkGl.esm.js → watchlistForBusinessManager-DqUpAEj_.esm.js} +37 -7
  236. package/dist/watchlistForBusinessStateMachine-DdaPl2PS.esm.js +166 -0
  237. package/dist/{watchlistManager-DXtX94SN.esm.js → watchlistManager-CdpXzT4B.esm.js} +2 -2
  238. package/dist/{watchlistStateMachine-McALifag.esm.js → watchlistStateMachine-ofHW_lPk.esm.js} +1 -1
  239. package/dist/workflow.d.ts +5 -2
  240. package/dist/workflow.esm.js +60 -50
  241. package/package.json +12 -5
  242. package/dist/IBrowserEnvironmentCapability-DEaRRk-R.esm.js +0 -9
  243. package/dist/addressSearch-DPjIKJrX.esm.js +0 -563
  244. package/dist/deepsightLoader-DeNvGU3c.esm.js +0 -55
  245. package/dist/ekycStateMachine-CDnI_NRq.esm.js +0 -1443
  246. package/dist/ekycUtils-zY8CdKJL.esm.js +0 -300
  247. package/dist/thumbmark.esm-CRc0cYvz.esm.js +0 -1242
  248. package/dist/tri.esm-BIjHhBJ2.esm.js +0 -2620
  249. package/dist/types-BvLo3U4u.d.ts +0 -134
  250. package/dist/types-zOgZqMni.d.ts +0 -6
  251. package/dist/watchlistForBusinessStateMachine-B66E7jud.esm.js +0 -78
  252. /package/dist/{types-BSBzhHRH2.d.ts → types-BSBzhHRH.d.ts} +0 -0
@@ -0,0 +1,397 @@
1
+ import { t as api, u as endpoints } from "./api-CpP4PS4S.esm.js";
2
+ import { t as BrowserLazyImportProvider } from "./BrowserLazyImportProvider-BhoA957O.esm.js";
3
+ import { r as createRecordingCompositor } from "./CameraCompositor-DN7NkJzV.esm.js";
4
+ import { t as getAdaptiveMediaRecorderOptions } from "./mediaRecorderOptions-B9-IEVtV.esm.js";
5
+ import { t as WorkerEncoderRecordingProvider } from "./WorkerEncoderRecordingProvider-B1ODYtgN.esm.js";
6
+ import { t as MultipartRecordingService } from "./multipartRecordingService-BTqkHGG9.esm.js";
7
+ //#region ../infra/src/media/VideoTrimmer.ts
8
+ /** A trim that runs longer than this uploads the full recording instead. */
9
+ const TRIM_TIMEOUT_MS = 1e4;
10
+ const trimmer = BrowserLazyImportProvider.getInstance().create(() => import("./videoTrimByCopy-BFfAiNpv.esm.js").then((module) => module.trimLastNSecondsByCopy), {
11
+ label: "Video liveness",
12
+ moduleName: "mediabunny",
13
+ timeoutMs: 1e4,
14
+ disabledMessage: "the full recording will be uploaded untrimmed."
15
+ });
16
+ /** Starts loading the trimmer, e.g. when a recording that will be trimmed starts. */
17
+ function preloadVideoTrimmer() {
18
+ trimmer.load();
19
+ }
20
+ /**
21
+ * Keeps about the last `seconds` of a recording. Never rejects and never
22
+ * hangs: when the trimmer cannot load, fails, or takes longer than
23
+ * {@link TRIM_TIMEOUT_MS}, it resolves the untrimmed recording.
24
+ */
25
+ async function trimLastNSeconds(videoBlob, seconds) {
26
+ const trim = await trimmer.load();
27
+ if (!trim) return videoBlob;
28
+ let timeout;
29
+ try {
30
+ return await Promise.race([trim(videoBlob, seconds), new Promise((resolve) => {
31
+ timeout = setTimeout(() => {
32
+ console.warn("[Video liveness] Trimming timed out; the full recording will be uploaded untrimmed.");
33
+ resolve(videoBlob);
34
+ }, TRIM_TIMEOUT_MS);
35
+ })]);
36
+ } catch (error) {
37
+ console.warn("[Video liveness] Trimming failed; the full recording will be uploaded untrimmed.", error);
38
+ return videoBlob;
39
+ } finally {
40
+ clearTimeout(timeout);
41
+ }
42
+ }
43
+ //#endregion
44
+ //#region ../infra/src/providers/browser/LocalRecordingProvider.ts
45
+ function toBase64(videoBlob) {
46
+ return new Promise((resolve, reject) => {
47
+ const reader = new FileReader();
48
+ reader.onloadend = () => {
49
+ const base64 = reader.result.split(",")[1];
50
+ resolve(base64);
51
+ };
52
+ reader.onerror = () => reject(reader.error ?? /* @__PURE__ */ new Error("FileReader error"));
53
+ reader.readAsDataURL(videoBlob);
54
+ });
55
+ }
56
+ /** `MediaRecorderOptions.videoKeyFrameIntervalDuration`, see `startRecording`. */
57
+ const KEYFRAME_INTERVAL_MS = 1e3;
58
+ var LocalRecordingProvider = class {
59
+ constructor() {
60
+ this.mediaRecorder = null;
61
+ this._isRecording = false;
62
+ this._hasError = false;
63
+ this._error = null;
64
+ this.mimeType = "";
65
+ this.stream = null;
66
+ this.pauseRecordingBound = this.pauseRecording.bind(this);
67
+ }
68
+ get isRecording() {
69
+ return this._isRecording;
70
+ }
71
+ get hasError() {
72
+ return this._hasError;
73
+ }
74
+ get error() {
75
+ return this._error;
76
+ }
77
+ startRecording(stream) {
78
+ this.reset();
79
+ preloadVideoTrimmer();
80
+ this.registerEventListeners();
81
+ this.stream = stream;
82
+ try {
83
+ const options = getAdaptiveMediaRecorderOptions();
84
+ this.mimeType = options.mimeType;
85
+ const recorder = new MediaRecorder(stream.clone(), {
86
+ ...options,
87
+ videoKeyFrameIntervalDuration: KEYFRAME_INTERVAL_MS
88
+ });
89
+ recorder.onerror = (event) => {
90
+ this._error = `Recording error: ${event}`;
91
+ this._isRecording = false;
92
+ this._hasError = true;
93
+ };
94
+ recorder.start();
95
+ this.mediaRecorder = recorder;
96
+ this._isRecording = true;
97
+ this._error = null;
98
+ this._hasError = false;
99
+ } catch (err) {
100
+ this._error = `Failed to start recording: ${err}`;
101
+ this._hasError = true;
102
+ }
103
+ }
104
+ async stopRecording(trimSeconds, encrypt, generateChecksum) {
105
+ const recorder = this.mediaRecorder;
106
+ return new Promise((resolve, reject) => {
107
+ this.removeEventListeners();
108
+ if (recorder && this._isRecording) {
109
+ const chunks = [];
110
+ recorder.ondataavailable = (event) => {
111
+ if (event.data.size > 0) chunks.push(event.data);
112
+ };
113
+ recorder.onstop = async () => {
114
+ try {
115
+ const trimmedVideo = await trimLastNSeconds(new Blob(chunks, { type: this.mimeType }), trimSeconds);
116
+ const encryptedVideoBase64 = encrypt(await toBase64(trimmedVideo));
117
+ generateChecksum(await trimmedVideo.arrayBuffer());
118
+ this._isRecording = false;
119
+ resolve({
120
+ trimmedBlob: trimmedVideo,
121
+ encryptedVideo: encryptedVideoBase64
122
+ });
123
+ } catch (error) {
124
+ this._isRecording = false;
125
+ this._error = `Recording stop failed: ${error}`;
126
+ this._hasError = true;
127
+ reject(error);
128
+ }
129
+ };
130
+ recorder.stop();
131
+ this._isRecording = false;
132
+ } else resolve({
133
+ trimmedBlob: new Blob([], { type: this.mimeType }),
134
+ encryptedVideo: ""
135
+ });
136
+ recorder?.stream?.getTracks().forEach((track) => track.stop());
137
+ });
138
+ }
139
+ /**
140
+ * Discards the in-progress recording without producing a result: detaches
141
+ * the recorder's handlers, stops it, releases its cloned tracks and clears
142
+ * the flags. Idempotent, and safe after `stopRecording` or when never
143
+ * started. Mirrors `MultipartRecordingProvider.reset()` so an attempt that is
144
+ * released before finalization cannot leave a live camera clone behind
145
+ * (ENG-56648).
146
+ */
147
+ reset() {
148
+ this.removeEventListeners();
149
+ const recorder = this.mediaRecorder;
150
+ if (recorder) {
151
+ recorder.ondataavailable = null;
152
+ recorder.onerror = null;
153
+ recorder.onstop = null;
154
+ if (recorder.state !== "inactive") try {
155
+ recorder.stop();
156
+ } catch {}
157
+ recorder.stream?.getTracks().forEach((track) => track.stop());
158
+ this.mediaRecorder = null;
159
+ }
160
+ this.stream = null;
161
+ this._isRecording = false;
162
+ this._error = null;
163
+ this._hasError = false;
164
+ }
165
+ pauseRecording() {
166
+ if (!this._isRecording) return;
167
+ if (this.mediaRecorder?.state === "recording") try {
168
+ this.mediaRecorder.pause();
169
+ } catch {}
170
+ }
171
+ registerEventListeners() {
172
+ document.addEventListener("visibilitychange", this.pauseRecordingBound);
173
+ }
174
+ removeEventListeners() {
175
+ document.removeEventListener("visibilitychange", this.pauseRecordingBound);
176
+ }
177
+ };
178
+ //#endregion
179
+ //#region src/internal/recordings/recordingsRepository.ts
180
+ async function uploadDeepsightVideo(encryptedVideo, token) {
181
+ try {
182
+ return (await api.post(endpoints.deepsightVideoImport, {
183
+ video: encryptedVideo,
184
+ type: "selfie"
185
+ }, { headers: { "X-Incode-Hardware-Id": token } })).data.recordingId ?? "";
186
+ } catch {
187
+ return "";
188
+ }
189
+ }
190
+ //#endregion
191
+ //#region src/internal/faceCapture/recordingService.ts
192
+ /**
193
+ * Records on-device and uploads encrypted video for liveness.
194
+ */
195
+ var LocalRecordingService = class {
196
+ constructor(wasmUtil, sessionToken) {
197
+ this.recorder = new LocalRecordingProvider();
198
+ this.sessionToken = sessionToken;
199
+ this.wasmUtil = wasmUtil;
200
+ }
201
+ async start(stream) {
202
+ this.recorder.startRecording(stream);
203
+ this.wasmUtil.osv();
204
+ }
205
+ async stop() {
206
+ if (!this.recorder.isRecording) return { recordingId: null };
207
+ this.wasmUtil.oev();
208
+ const result = await this.recorder.stopRecording(10, (base64) => this.wasmUtil.encryptImage(base64), (buffer) => this.wasmUtil.ckvcks(buffer));
209
+ if (!this.sessionToken) return { recordingId: null };
210
+ return { recordingId: await uploadDeepsightVideo(result.encryptedVideo, this.sessionToken) };
211
+ }
212
+ prepareUpload() {
213
+ return this.stop();
214
+ }
215
+ async stopAndGetVideo() {
216
+ if (!this.recorder.isRecording) return { videoBase64: void 0 };
217
+ try {
218
+ this.wasmUtil.oev();
219
+ const videoBase64 = (await this.recorder.stopRecording(10, (base64) => base64, () => {})).encryptedVideo;
220
+ return { videoBase64: videoBase64 ? videoBase64 : void 0 };
221
+ } catch {
222
+ return { videoBase64: void 0 };
223
+ }
224
+ }
225
+ cleanup() {
226
+ this.recorder.reset();
227
+ }
228
+ };
229
+ /**
230
+ * Records a regular Selfie capture locally and streams it through the scoped
231
+ * video-selfie-service multipart protocol. The recording is associated with
232
+ * the interview asynchronously by the backend's `selfie` scope consumer, so
233
+ * its upload id must not be forwarded to `/omni/add/face` as a legacy
234
+ * `recordingId`.
235
+ *
236
+ * The recording is scoped to the capture step (ENG-56648). The recorder
237
+ * records a stable `CameraCompositor` stream instead of a raw camera clone, so
238
+ * every attempt can end its own clone before PRC and POC run and the next
239
+ * attempt swaps a fresh clone into the same multipart upload. The owning
240
+ * controller completes the upload once the backend accepts a capture or the
241
+ * step ends without a retry.
242
+ */
243
+ var MultipartFaceRecordingService = class {
244
+ constructor() {
245
+ this.recordingCompositor = createRecordingCompositor();
246
+ this.service = new MultipartRecordingService("selfie", new WorkerEncoderRecordingProvider(this.recordingCompositor));
247
+ this.audioSource = [];
248
+ this.needsVideoSourceReplacement = false;
249
+ this.pausedForAttempt = false;
250
+ this.startInFlight = false;
251
+ this.suspendRequested = false;
252
+ this.stopping = false;
253
+ }
254
+ async start(stream) {
255
+ if (this.stopping) throw new Error("Face recording already completed");
256
+ if (this.compositor) {
257
+ await this.resume(stream);
258
+ return;
259
+ }
260
+ const recordingSource = stream.clone();
261
+ const compositor = this.recordingCompositor;
262
+ this.startInFlight = true;
263
+ try {
264
+ const composite = compositor.start(recordingSource);
265
+ await this.service.start(composite);
266
+ } catch (error) {
267
+ compositor.stop();
268
+ recordingSource.getTracks().forEach((track) => track.stop());
269
+ this.service.cleanup();
270
+ throw error;
271
+ } finally {
272
+ this.startInFlight = false;
273
+ }
274
+ if (this.stopping) {
275
+ compositor.stop();
276
+ recordingSource.getTracks().forEach((track) => track.stop());
277
+ this.service.cleanup();
278
+ return;
279
+ }
280
+ this.compositor = compositor;
281
+ this.recordingSource = recordingSource;
282
+ this.audioSource = recordingSource.getAudioTracks();
283
+ if (this.suspendRequested) {
284
+ this.suspendRequested = false;
285
+ this.suspend();
286
+ }
287
+ }
288
+ /**
289
+ * Pauses the container and ends the camera clone on the calling thread. The
290
+ * composite stream and the upload stay open for the next attempt.
291
+ */
292
+ suspend() {
293
+ if (this.stopping) return;
294
+ if (!this.compositor) {
295
+ this.suspendRequested = this.startInFlight;
296
+ return;
297
+ }
298
+ if (!this.pausedForAttempt) this.pausedForAttempt = this.service.pause();
299
+ this.releaseCameraClone({ keepAudio: true });
300
+ this.needsVideoSourceReplacement = true;
301
+ }
302
+ async prepareUpload() {
303
+ this.suspend();
304
+ return { recordingId: null };
305
+ }
306
+ async stop() {
307
+ await this.complete();
308
+ return { recordingId: null };
309
+ }
310
+ pauseForBackground() {
311
+ this.suspend();
312
+ }
313
+ async resumeFromBackground(stream) {
314
+ if (!this.compositor || this.stopping) return;
315
+ await this.resume(stream);
316
+ }
317
+ async stopAndGetVideo() {
318
+ await this.complete();
319
+ return { videoBase64: void 0 };
320
+ }
321
+ cleanup() {
322
+ this.suspendRequested = false;
323
+ this.pausedForAttempt = false;
324
+ this.needsVideoSourceReplacement = false;
325
+ this.releaseCameraClone({ keepAudio: false });
326
+ this.compositor?.stop();
327
+ this.compositor = void 0;
328
+ this.recordingSource = void 0;
329
+ this.audioSource = [];
330
+ this.service.cleanup();
331
+ }
332
+ /** Swaps this attempt's camera clone into the composite and resumes. */
333
+ async resume(stream) {
334
+ const compositor = this.compositor;
335
+ if (!compositor) return;
336
+ if (this.needsVideoSourceReplacement) {
337
+ const recordingSource = stream.clone();
338
+ recordingSource.getAudioTracks().forEach((track) => track.stop());
339
+ compositor.switchVideo(recordingSource);
340
+ this.needsVideoSourceReplacement = false;
341
+ this.recordingSource = recordingSource;
342
+ const result = await compositor.resume();
343
+ if (result !== "resumed") throw new Error(`Face recording camera did not resume: ${result}`);
344
+ }
345
+ if (this.pausedForAttempt && !this.service.resume()) throw new Error("Face recording did not resume");
346
+ this.pausedForAttempt = false;
347
+ }
348
+ /**
349
+ * Completes the scoped upload. The camera clone ends synchronously before the
350
+ * drain so a step that ends mid-attempt never pins the camera; the composite
351
+ * stays alive until the recorder has emitted its final chunk.
352
+ */
353
+ async complete() {
354
+ this.stopping = true;
355
+ this.suspendRequested = false;
356
+ this.releaseCameraClone({ keepAudio: false });
357
+ try {
358
+ await this.service.stop();
359
+ } finally {
360
+ this.compositor?.stop();
361
+ this.compositor = void 0;
362
+ this.recordingSource = void 0;
363
+ this.audioSource = [];
364
+ this.pausedForAttempt = false;
365
+ this.needsVideoSourceReplacement = false;
366
+ }
367
+ }
368
+ releaseCameraClone(options) {
369
+ try {
370
+ this.compositor?.pause();
371
+ } catch {}
372
+ const tracks = options.keepAudio ? this.recordingSource?.getVideoTracks() ?? [] : /* @__PURE__ */ new Set([...this.recordingSource?.getTracks() ?? [], ...this.audioSource]);
373
+ for (const track of tracks) try {
374
+ track.stop();
375
+ } catch {}
376
+ }
377
+ };
378
+ /**
379
+ * Creates the recording service for the current configuration.
380
+ *
381
+ * Order of precedence:
382
+ * 1. `onDeviceFaceResultsSubmissionEnabled === true` → no recording. The
383
+ * on-device workflow never uploads media, only the staged face-results
384
+ * JSON via `WebApi.postFaceResults`. Mirrors V1's
385
+ * `FaceFlowManager.setRecorders()` early return.
386
+ * 2. `deepsightLiveness === 'VIDEOLIVENESS'` → local Deepsight recorder.
387
+ * 3. `enableFaceRecording === true` → scoped multipart recorder.
388
+ * 4. otherwise → no recording.
389
+ */
390
+ function createRecordingService(params) {
391
+ if (params.config.onDeviceFaceResultsSubmissionEnabled === true) return;
392
+ if (params.localDelivery === true) return params.config.enableFaceRecording === true || params.config.deepsightLiveness === "VIDEOLIVENESS" ? new LocalRecordingService(params.wasmUtil, null) : void 0;
393
+ if (params.config.deepsightLiveness === "VIDEOLIVENESS") return new LocalRecordingService(params.wasmUtil, params.sessionToken);
394
+ if (params.config.enableFaceRecording === true) return new MultipartFaceRecordingService();
395
+ }
396
+ //#endregion
397
+ export { createRecordingService };
@@ -1,5 +1,5 @@
1
- import { n as RedirectToMobileServices, t as RedirectToMobileConfig } from "./types-DPIDuhut.js";
2
- import { a as RedirectToMobileActor, i as createRedirectToMobileManagerFromActor, n as RedirectToMobileState, o as redirectToMobileMachine, r as createRedirectToMobileManager, t as RedirectToMobileManager } from "./redirectToMobileManager-CVsvpVbQ.js";
1
+ import { r as RedirectToMobileServices, t as RedirectToMobileConfig } from "./types-DNVzoRvi.js";
2
+ import { a as RedirectToMobileActor, i as createRedirectToMobileManagerFromActor, n as RedirectToMobileState, o as redirectToMobileMachine, r as createRedirectToMobileManager, t as RedirectToMobileManager } from "./redirectToMobileManager-Dm9ctRCC.js";
3
3
  //#region src/modules/redirect-to-mobile/redirectToMobileServices.d.ts
4
4
  declare const defaultRedirectToMobileServices: RedirectToMobileServices;
5
5
  //#endregion
@@ -1,3 +1,3 @@
1
- import { n as redirectToMobileMachine, r as defaultRedirectToMobileServices } from "./redirectToMobileStateMachine-b-H-ipGM.esm.js";
2
- import { n as createRedirectToMobileManagerFromActor, t as createRedirectToMobileManager } from "./redirectToMobileManager-uHW3dyuQ.esm.js";
1
+ import { n as redirectToMobileMachine, r as defaultRedirectToMobileServices } from "./redirectToMobileStateMachine-CbhN8uVN.esm.js";
2
+ import { n as createRedirectToMobileManagerFromActor, t as createRedirectToMobileManager } from "./redirectToMobileManager-CgGaT2NP.esm.js";
3
3
  export { createRedirectToMobileManager, createRedirectToMobileManagerFromActor, defaultRedirectToMobileServices, redirectToMobileMachine };
@@ -1,8 +1,8 @@
1
- import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-Du2A4-Qr.esm.js";
1
+ import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-ggpBBaZ8.esm.js";
2
2
  import { t as BrowserTimerProvider } from "./BrowserTimerProvider-BXhgNxLt.esm.js";
3
3
  import { s as createActor, u as createManager } from "./xstate.esm-DSajW7CJ.esm.js";
4
4
  import { n as fromPromise, t as fromCallback } from "./xstate-actors.esm-8Gzepa_A.esm.js";
5
- import { n as redirectToMobileMachine, r as defaultRedirectToMobileServices, t as canResendSmsFromContext } from "./redirectToMobileStateMachine-b-H-ipGM.esm.js";
5
+ import { n as redirectToMobileMachine, r as defaultRedirectToMobileServices, t as canResendSmsFromContext } from "./redirectToMobileStateMachine-CbhN8uVN.esm.js";
6
6
  //#region src/modules/redirect-to-mobile/redirectToMobileActor.ts
7
7
  const POLL_INTERVAL_MS = 5e3;
8
8
  const QR_REFRESH_INTERVAL_MS = 5e3;
@@ -58,7 +58,7 @@ function mapState(snapshot) {
58
58
  const typedSnapshot = snapshot;
59
59
  const { context } = typedSnapshot;
60
60
  if (typedSnapshot.matches("idle")) return { status: "idle" };
61
- if (typedSnapshot.matches("generatingUrl") || typedSnapshot.matches("loadingStartInfo")) return { status: "loading" };
61
+ if (typedSnapshot.matches("generatingUrl")) return { status: "loading" };
62
62
  if (typedSnapshot.matches("showingQr")) return {
63
63
  status: "redirecting",
64
64
  redirectUrl: context.redirectUrl,
@@ -74,7 +74,8 @@ function mapState(snapshot) {
74
74
  if (typedSnapshot.matches("closed")) return { status: "closed" };
75
75
  if (typedSnapshot.matches("error")) return {
76
76
  status: "error",
77
- error: context.error ?? "An error occurred"
77
+ error: context.error ?? "An error occurred",
78
+ moduleErrorCode: context.moduleErrorCode
78
79
  };
79
80
  return { status: "idle" };
80
81
  }
@@ -1,7 +1,7 @@
1
1
  import { i as ActorRefFrom } from "./spawn-D9jgw9pW.js";
2
2
  import { t as Manager } from "./Manager-C9T5amUN.js";
3
3
  import "./Actor-DpTj5PFb.js";
4
- import { n as RedirectToMobileServices, t as RedirectToMobileConfig } from "./types-DPIDuhut.js";
4
+ import { n as RedirectToMobileErrorCode, r as RedirectToMobileServices, t as RedirectToMobileConfig } from "./types-DNVzoRvi.js";
5
5
  //#region src/modules/redirect-to-mobile/redirectToMobileStateMachine.d.ts
6
6
  declare const redirectToMobileMachine: any;
7
7
  type RedirectToMobileMachine = typeof redirectToMobileMachine;
@@ -48,6 +48,8 @@ type RedirectToMobileClosedState = {
48
48
  type RedirectToMobileErrorState = {
49
49
  status: 'error';
50
50
  error: string;
51
+ /** Machine-readable code, forwarded as `onError`'s third argument. */
52
+ moduleErrorCode: RedirectToMobileErrorCode | undefined;
51
53
  };
52
54
  type RedirectToMobileState = RedirectToMobileIdleState | RedirectToMobileLoadingState | RedirectToMobileRedirectingState | RedirectToMobileFinishedState | RedirectToMobileContinueState | RedirectToMobileClosedState | RedirectToMobileErrorState;
53
55
  /**
@@ -1,8 +1,8 @@
1
- import { t as api, u as endpoints } from "./api-Cz90EHyu.esm.js";
1
+ import { t as api, u as endpoints } from "./api-CpP4PS4S.esm.js";
2
2
  import { t as BrowserTimerProvider } from "./BrowserTimerProvider-BXhgNxLt.esm.js";
3
3
  import { i as assign, t as setup } from "./xstate.esm-DSajW7CJ.esm.js";
4
4
  import { n as fromPromise, t as fromCallback } from "./xstate-actors.esm-8Gzepa_A.esm.js";
5
- import { n as getUrlSearchParam, t as buildUrlWithSearchParams } from "./urlUtils-6jsE6rKp.esm.js";
5
+ import { n as getUrlSearchParam, r as resolveAgainstPageOrigin, t as buildUrlWithSearchParams } from "./urlUtils-eYiyWjh0.esm.js";
6
6
  //#region src/modules/redirect-to-mobile/redirectToMobileServices.ts
7
7
  async function fetchRedirectUrl(signal) {
8
8
  const res = await api.get(endpoints.onboardingUrl, { signal });
@@ -59,6 +59,14 @@ function buildRedirectUrl(baseUrl, customUrl, config, urlUuid) {
59
59
  url_uuid: urlUuid || void 0
60
60
  });
61
61
  }
62
+ const INVALID_URL_ERROR = "Invalid Redirect to Mobile URL. Use an absolute http or https URL.";
63
+ const ABSOLUTE_HTTP_URL = /^https?:\/\//i;
64
+ function withAbsoluteUrl(config) {
65
+ return config.url?.startsWith("/") ? {
66
+ ...config,
67
+ url: resolveAgainstPageOrigin(config.url)
68
+ } : config;
69
+ }
62
70
  function extractUuidFromUrl(url) {
63
71
  return getUrlSearchParam(url, "uuid") ?? "";
64
72
  }
@@ -132,6 +140,10 @@ const redirectToMobileMachine = setup({
132
140
  return { phonePrefix: event.output.phonePrefix };
133
141
  }),
134
142
  setError: assign(({ event }) => ({ error: String(event.error) })),
143
+ setInvalidUrlError: assign(() => ({
144
+ error: INVALID_URL_ERROR,
145
+ moduleErrorCode: "INVALID_REDIRECT_URL"
146
+ })),
135
147
  completeSmsSend: assign(() => {
136
148
  return {
137
149
  smsSent: true,
@@ -172,13 +184,14 @@ const redirectToMobileMachine = setup({
172
184
  },
173
185
  guards: {
174
186
  hasPhishingResistance: ({ context }) => context.config.qrPhishingResistance === true,
187
+ hasInvalidUrl: ({ context }) => context.config.url !== void 0 && !ABSOLUTE_HTTP_URL.test(context.config.url),
175
188
  canResendSms: ({ context }) => canResendSmsFromContext(context)
176
189
  }
177
190
  }).createMachine({
178
191
  id: "redirectToMobile",
179
192
  initial: "idle",
180
193
  context: ({ input }) => ({
181
- config: input.config,
194
+ config: withAbsoluteUrl(input.config),
182
195
  redirectUrl: "",
183
196
  fetchedBaseUrl: "",
184
197
  uuid: "",
@@ -188,31 +201,54 @@ const redirectToMobileMachine = setup({
188
201
  smsFailed: false,
189
202
  smsResendTimer: 0,
190
203
  smsResendTimerActive: false,
191
- error: void 0
204
+ error: void 0,
205
+ moduleErrorCode: void 0
192
206
  }),
193
207
  states: {
194
- idle: { on: { LOAD: "generatingUrl" } },
195
- generatingUrl: { invoke: {
196
- id: "fetchRedirectUrl",
197
- src: "fetchRedirectUrl",
198
- onDone: {
199
- target: "loadingStartInfo",
200
- actions: "setBaseUrl"
201
- },
202
- onError: {
203
- target: "error",
204
- actions: "setError"
205
- }
206
- } },
207
- loadingStartInfo: { invoke: {
208
- id: "fetchStartInfo",
209
- src: "fetchStartInfo",
210
- onDone: {
211
- target: "showingQr",
212
- actions: "setStartInfo"
208
+ idle: { on: { LOAD: [{
209
+ target: "error",
210
+ guard: "hasInvalidUrl",
211
+ actions: "setInvalidUrlError"
212
+ }, { target: "generatingUrl" }] } },
213
+ generatingUrl: {
214
+ type: "parallel",
215
+ states: {
216
+ redirectUrl: {
217
+ initial: "loading",
218
+ states: {
219
+ loading: { invoke: {
220
+ id: "fetchRedirectUrl",
221
+ src: "fetchRedirectUrl",
222
+ onDone: {
223
+ target: "done",
224
+ actions: "setBaseUrl"
225
+ },
226
+ onError: {
227
+ target: "#redirectToMobile.error",
228
+ actions: "setError"
229
+ }
230
+ } },
231
+ done: { type: "final" }
232
+ }
233
+ },
234
+ startInfo: {
235
+ initial: "loading",
236
+ states: {
237
+ loading: { invoke: {
238
+ id: "fetchStartInfo",
239
+ src: "fetchStartInfo",
240
+ onDone: {
241
+ target: "done",
242
+ actions: "setStartInfo"
243
+ },
244
+ onError: { target: "done" }
245
+ } },
246
+ done: { type: "final" }
247
+ }
248
+ }
213
249
  },
214
- onError: { target: "showingQr" }
215
- } },
250
+ onDone: { target: "showingQr" }
251
+ },
216
252
  showingQr: {
217
253
  type: "parallel",
218
254
  states: {
@@ -294,7 +330,10 @@ const redirectToMobileMachine = setup({
294
330
  },
295
331
  continue: { type: "final" },
296
332
  closed: { type: "final" },
297
- error: { on: { RETRY: "generatingUrl" } }
333
+ error: { on: { RETRY: [{
334
+ guard: "hasInvalidUrl",
335
+ actions: "setInvalidUrlError"
336
+ }, { target: "generatingUrl" }] } }
298
337
  }
299
338
  });
300
339
  //#endregion