@incodetech/core 2.4.1 → 2.5.0-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 (340) hide show
  1. package/dist/Actor-DqjOqDfU.d.ts +1 -0
  2. package/dist/{BaseWasmProvider-Bq3OHo7P.d.ts → BaseWasmProvider-CPdofn7R.d.ts} +3 -5
  3. package/dist/BrowserNetworkStatusProvider-BrDXBEDd.esm.js +21 -0
  4. package/dist/{multipartRecordingService-CLwrF5wD.esm.js → CameraCompositor-C7N1N61V.esm.js} +61 -744
  5. package/dist/DateFormattingProvider-DPq9zco-.esm.js +25 -0
  6. package/dist/{FaceDetectionProvider-J_-1Cwck.esm.js → FaceDetectionProvider-Cy2EAL0i.esm.js} +38 -66
  7. package/dist/IBrowserEnvironmentCapability-D7JG7ML3.esm.js +16 -0
  8. package/dist/IGeolocationCapability-r49Qo7rR.d.ts +10 -0
  9. package/dist/{IIdCaptureCapability-CGcEt2Cw.d.ts → IIdCaptureCapability-BRAZQtkM.d.ts} +4 -3
  10. package/dist/{IWasmUtilCapability-GF2n7sfm.d.ts → IWasmUtilCapability-CLWIYHB4.d.ts} +35 -7
  11. package/dist/Manager-BvXAwDv9.esm.js +125 -0
  12. package/dist/{Manager-C9T5amUN.d.ts → Manager-DufwKlav.d.ts} +1 -7
  13. package/dist/{MotionSensorProvider-DYxh8TjR.esm.js → MotionSensorProvider-BAGydZPH.esm.js} +20 -0
  14. package/dist/MultipartRecordingProvider-BtMQZEbg.esm.js +151 -0
  15. package/dist/{PhoneValidationProvider-SZiOS0jB.esm.js → PhoneValidationProvider-Co4zk2en.esm.js} +7 -0
  16. package/dist/{StreamCanvasCapture-7JRf-2ck.d.ts → StreamCanvasCapture-BqaHTJF0.d.ts} +36 -5
  17. package/dist/{StreamCanvasCapture-C9jtgBdT.esm.js → StreamCanvasCapture-CXd87trH.esm.js} +18 -3
  18. package/dist/StreamCanvasProcessingSession-CBnbTnOr.esm.js +42 -0
  19. package/dist/{WasmUtilProvider-DtJuBdt-.esm.js → WasmUtilProvider-C4x5gc1c.esm.js} +135 -25
  20. package/dist/WorkerEncoderRecordingProvider-BO7urYwT.esm.js +80 -0
  21. package/dist/addressSearch-DBJeg_g3.esm.js +301 -0
  22. package/dist/{advanceableErrors-q_pfU3Cn.esm.js → advanceableErrors-CxZyPRyh.esm.js} +4 -2
  23. package/dist/ae-signature.d.ts +2 -2
  24. package/dist/ae-signature.esm.js +1 -1
  25. package/dist/allowedCharacters-Bnir--CN.esm.js +17 -0
  26. package/dist/antifraud.d.ts +1 -1
  27. package/dist/antifraud.esm.js +2 -2
  28. package/dist/{antifraudManager-DbGCvlJs.d.ts → antifraudManager-BxfCsyA7.d.ts} +3 -3
  29. package/dist/{antifraudManager-CaweCYnY.esm.js → antifraudManager-DRMBLSh7.esm.js} +5 -3
  30. package/dist/{antifraudStateMachine-DRl0UVyA.esm.js → antifraudStateMachine-Bi0m60oV.esm.js} +4 -6
  31. package/dist/{api-Cz90EHyu.esm.js → api-B58edv6M.esm.js} +13 -7
  32. package/dist/{apiError-9Yi8xMeB.esm.js → apiError-B9-B3cMq.esm.js} +1 -1
  33. package/dist/attemptCarry-CxiYlUAO.esm.js +45 -0
  34. package/dist/authentication.d.ts +3 -3
  35. package/dist/authentication.esm.js +2 -2
  36. package/dist/{authenticationManager-BIZC55Bi.d.ts → authenticationManager-CkD0JR7Q.d.ts} +2 -2
  37. package/dist/{authenticationManager-pKQS4fHT.esm.js → authenticationManager-DNWtc0eq.esm.js} +7 -6
  38. package/dist/{authenticationStateMachine-D_DygKtQ.esm.js → authenticationStateMachine-CJ9i4Al-.esm.js} +50 -18
  39. package/dist/avatar.d.ts +1 -1
  40. package/dist/backCameraLabel-yda5ugE4.esm.js +67 -0
  41. package/dist/{backCameraStream-CMvXj4X4.esm.js → backCameraStream-6qVHvj76.esm.js} +12 -107
  42. package/dist/{browser-DlFgHpoC-DnyrCR8r.esm.js → browser-pQZA35G2-B4Dwja1e.esm.js} +161 -150
  43. package/dist/calendarDate-D2zWfUlA.esm.js +35 -0
  44. package/dist/{callback-645_omgz.d.ts → callback-BmjJ1G-5.d.ts} +1 -1
  45. package/dist/camera-9yYDUOsO.d.ts +5 -0
  46. package/dist/{camera-sIa9ceW2.esm.js → camera-CJKApt0x.esm.js} +19 -20
  47. package/dist/camera.d.ts +9 -5
  48. package/dist/camera.esm.js +1 -1
  49. package/dist/certificate-issuance.d.ts +1 -1
  50. package/dist/certificate-issuance.esm.js +2 -2
  51. package/dist/{certificateIssuanceManager-Dr8A4Lgr.d.ts → certificateIssuanceManager-BcYhxO63.d.ts} +4 -3
  52. package/dist/{certificateIssuanceManager-BfeMv2PU.esm.js → certificateIssuanceManager-Ctj6AJC7.esm.js} +5 -3
  53. package/dist/{certificateIssuanceStateMachine-Frgjbjw8.esm.js → certificateIssuanceStateMachine-DDqN9kvL.esm.js} +4 -4
  54. package/dist/cnpj-CVq3vL39.esm.js +71 -0
  55. package/dist/cnpj-D5cxwIe-.esm.js +9 -0
  56. package/dist/connectivity-BCuEoQ-n.esm.js +114 -0
  57. package/dist/consent.d.ts +1 -1
  58. package/dist/consent.esm.js +2 -2
  59. package/dist/{consentManager-Ca8FHlC4.d.ts → consentManager-B0YKqYtZ.d.ts} +20 -12
  60. package/dist/{consentManager-CvEu8h_W.esm.js → consentManager-CyoeiABc.esm.js} +7 -4
  61. package/dist/{consentStateMachine-DJTgN_-1.esm.js → consentStateMachine-BTUrAslr.esm.js} +25 -15
  62. package/dist/cpf-DDXMTLYr.esm.js +37 -0
  63. package/dist/{createFaceAvatar-lYX0VTYs.d.ts → createFaceAvatar-Ct9QrQ66.d.ts} +1 -1
  64. package/dist/cross-document-data-match.d.ts +1 -1
  65. package/dist/cross-document-data-match.esm.js +1 -1
  66. package/dist/{crossDocumentDataMatchManager-Cu141CE8.esm.js → crossDocumentDataMatchManager-cmQmp7Bi.esm.js} +6 -5
  67. package/dist/{crossDocumentDataMatchManager-yCWCOzcU.d.ts → crossDocumentDataMatchManager-crZcIUSY.d.ts} +3 -3
  68. package/dist/curp-DZGvefg3.esm.js +14 -0
  69. package/dist/curp-validation.d.ts +1 -1
  70. package/dist/curp-validation.esm.js +2 -2
  71. package/dist/{curpValidationManager-B-z9q5V3.esm.js → curpValidationManager-EW44fVpH.esm.js} +6 -3
  72. package/dist/{curpValidationManager-C9sqoh9n.d.ts → curpValidationManager-HOidAKvT.d.ts} +4 -4
  73. package/dist/{curpValidationStateMachine-vDEFLMPw.esm.js → curpValidationStateMachine-BFkt90Zs.esm.js} +41 -34
  74. package/dist/custom-fields.d.ts +1 -1
  75. package/dist/custom-fields.esm.js +1 -1
  76. package/dist/custom-watchlist.d.ts +1 -1
  77. package/dist/custom-watchlist.esm.js +2 -2
  78. package/dist/{customFieldsManager-CF-cO8ap.d.ts → customFieldsManager-CdWTbsew.d.ts} +3 -3
  79. package/dist/{customFieldsManager-D1ex2cFM.esm.js → customFieldsManager-DPMBJrcH.esm.js} +15 -17
  80. package/dist/{customWatchlistManager-CTI-SGk0.esm.js → customWatchlistManager-DiYpPjZx.esm.js} +5 -3
  81. package/dist/{customWatchlistManager-DolUswyR.d.ts → customWatchlistManager-lJrveDS4.d.ts} +3 -3
  82. package/dist/{customWatchlistStateMachine-hmRd0f2I.esm.js → customWatchlistStateMachine-D7VxQggF.esm.js} +4 -6
  83. package/dist/deepsightCaptureConfig-BxD3mSac.esm.js +70 -0
  84. package/dist/{deepsightService-C3DVBOZd.esm.js → deepsightLoader-KYZP8_x-.esm.js} +41 -74
  85. package/dist/definitionSource-B9WTvQb9.esm.js +30 -0
  86. package/dist/{createCameraCycleOwnership-Dj_LHUvN.esm.js → desktopCameraElection-BGQRIA2u.esm.js} +278 -44
  87. package/dist/device.d.ts +3 -3
  88. package/dist/device.esm.js +16 -16
  89. package/dist/document-capture.d.ts +3 -3
  90. package/dist/document-capture.esm.js +2 -2
  91. package/dist/document-signature.d.ts +123 -0
  92. package/dist/document-signature.esm.js +149 -0
  93. package/dist/{documentCaptureManager-DUJwpKC5.esm.js → documentCaptureManager-SRG6YEMh.esm.js} +30 -20
  94. package/dist/{documentCaptureManager-DkyDtm3Y.d.ts → documentCaptureManager-sJWgqtUy.d.ts} +42 -8
  95. package/dist/{documentCaptureStateMachine-B8i7GnLh.esm.js → documentCaptureStateMachine-Bh0uyfGq.esm.js} +110 -63
  96. package/dist/documentSignatureStateMachine-CLljjltG.esm.js +219 -0
  97. package/dist/dynamic-forms.d.ts +2 -2
  98. package/dist/dynamic-forms.esm.js +2 -2
  99. package/dist/{dynamicFormsManager-C0dHs1ty.d.ts → dynamicFormsManager-C45pTncO.d.ts} +4 -4
  100. package/dist/{dynamicFormsManager-DK_oc5Oy.esm.js → dynamicFormsManager-CnU2hRvl.esm.js} +5 -3
  101. package/dist/{dynamicFormsStateMachine-CGlIAWZ6.esm.js → dynamicFormsStateMachine-huYmjamB.esm.js} +12 -13
  102. package/dist/ekyb.d.ts +5 -5
  103. package/dist/ekyb.esm.js +3 -3
  104. package/dist/{ekybManager-BLgkiWXw.esm.js → ekybManager-CaEErq39.esm.js} +5 -3
  105. package/dist/{ekybManager-BaZ_7CEu.d.ts → ekybManager-Cjk8pQX0.d.ts} +5 -5
  106. package/dist/ekybStateMachine-BIU8KIMv.esm.js +2173 -0
  107. package/dist/ekybUtils-Dl0MU-ib.esm.js +172 -0
  108. package/dist/ekyc-prefill.d.ts +17 -0
  109. package/dist/ekyc-prefill.esm.js +3 -0
  110. package/dist/ekyc.d.ts +4 -3
  111. package/dist/ekyc.esm.js +3 -3
  112. package/dist/{ekycManager-BO-Lui3t.esm.js → ekycManager-D2K8AaMV.esm.js} +39 -16
  113. package/dist/{ekycManager-DW-ynodd.d.ts → ekycManager-DusmB-4j.d.ts} +49 -7
  114. package/dist/ekycPrefillManager-BwmPXfhY.d.ts +566 -0
  115. package/dist/ekycPrefillManager-CENQjdNq.esm.js +102 -0
  116. package/dist/ekycPrefillStateMachine-jT3hIt2X.esm.js +1289 -0
  117. package/dist/ekycStateMachine-6EKndBd7.esm.js +9024 -0
  118. package/dist/ekycUtils-C6HZB46m.esm.js +1532 -0
  119. package/dist/electronic-signature.d.ts +1 -1
  120. package/dist/electronic-signature.esm.js +1 -1
  121. package/dist/{electronicSignatureManager-DTSLOvKR.d.ts → electronicSignatureManager-5tYz-a4o.d.ts} +4 -3
  122. package/dist/{electronicSignatureManager-CjKvJ6E-.esm.js → electronicSignatureManager-wM8WTgzP.esm.js} +12 -18
  123. package/dist/email.d.ts +1 -1
  124. package/dist/email.esm.js +2 -2
  125. package/dist/{emailManager-ButFktRm.esm.js → emailManager-BBdRYLtH.esm.js} +5 -3
  126. package/dist/{emailManager-Dy6omJVp.d.ts → emailManager-pM7ZPuMa.d.ts} +3 -3
  127. package/dist/{emailStateMachine-BXtlC0NV.esm.js → emailStateMachine-DO7lWYvn.esm.js} +35 -25
  128. package/dist/events-PUWyizJn.esm.js +299 -0
  129. package/dist/events.d.ts +4 -4
  130. package/dist/events.esm.js +2 -1
  131. package/dist/extensibility.d.ts +57 -41
  132. package/dist/extensibility.esm.js +39 -37
  133. package/dist/{externalFetch-DrR9xshk.esm.js → externalFetch-cUjJYyXj.esm.js} +4 -1
  134. package/dist/face-match.d.ts +1 -1
  135. package/dist/face-match.esm.js +2 -2
  136. package/dist/{faceCaptureManagerFactory-1hzeS_rB.d.ts → faceCaptureManagerFactory-D1EJw36F.d.ts} +101 -77
  137. package/dist/{faceCaptureManagerFactory-BDGhg24q.esm.js → faceCaptureManagerFactory-DbEARG3h.esm.js} +29 -12
  138. package/dist/{faceCaptureSetup-CvGYG4GZ.esm.js → faceCaptureSetup-VaAjMpWX.esm.js} +189 -513
  139. package/dist/{faceMatchManager-DIgG-UFS.d.ts → faceMatchManager-C5b5WtcY.d.ts} +23 -7
  140. package/dist/{faceMatchManager-DWFUQjMQ.esm.js → faceMatchManager-nBvS9z0o.esm.js} +5 -3
  141. package/dist/{faceMatchStateMachine-CUCvlydD.esm.js → faceMatchStateMachine-48O8j_Lx.esm.js} +70 -42
  142. package/dist/{feature-management-D4ne_hXW.esm.js → feature-management-D7oLtULO.esm.js} +37 -22
  143. package/dist/feature-management.esm.js +1 -1
  144. package/dist/field-comparison.d.ts +1 -1
  145. package/dist/field-comparison.esm.js +1 -1
  146. package/dist/{fieldComparisonManager-v3knTYV_.esm.js → fieldComparisonManager-B1ipvtnp.esm.js} +7 -7
  147. package/dist/{fieldComparisonManager-CUX4gza2.d.ts → fieldComparisonManager-mFOHRhVd.d.ts} +3 -3
  148. package/dist/fiscal-qr.d.ts +1 -1
  149. package/dist/fiscal-qr.esm.js +1 -1
  150. package/dist/{fiscalQrManager-D0Iy7EKR.d.ts → fiscalQrManager-DFnFVpP9.d.ts} +3 -3
  151. package/dist/{fiscalQrManager-Dt9fHG7h.esm.js → fiscalQrManager-yecjuXV4.esm.js} +9 -8
  152. package/dist/flow-events.d.ts +1 -1
  153. package/dist/flow.d.ts +73 -24
  154. package/dist/flow.esm.js +261 -66
  155. package/dist/{flowCompletionService-Cemwaa5b.esm.js → flowCompletionService-CIjaIpMH.esm.js} +2 -2
  156. package/dist/flowServices-Dqt75TXx.esm.js +951 -0
  157. package/dist/formErrors-lSfh7Y8J.esm.js +512 -0
  158. package/dist/geolocation.d.ts +1 -1
  159. package/dist/geolocation.esm.js +2 -2
  160. package/dist/{geolocationManager-Dn24g1fl.d.ts → geolocationManager-CENrvxpK.d.ts} +19 -20
  161. package/dist/{geolocationManager-B0dc5rW9.esm.js → geolocationManager-DHfgXhEs.esm.js} +9 -9
  162. package/dist/{geolocationStateMachine-B3rcoODF.esm.js → geolocationStateMachine-CrEspaN-.esm.js} +16 -14
  163. package/dist/{getDeviceClass-bsWdEDxP.esm.js → getDeviceClass-Dcy9erbl.esm.js} +1 -1
  164. package/dist/government-validation.d.ts +1 -1
  165. package/dist/government-validation.esm.js +2 -2
  166. package/dist/{governmentValidationManager-BtXWHICu.esm.js → governmentValidationManager-0-L21hu6.esm.js} +5 -3
  167. package/dist/{governmentValidationManager-B82zOut8.d.ts → governmentValidationManager-De_vU7bm.d.ts} +4 -4
  168. package/dist/{governmentValidationStateMachine-COL-Vs48.esm.js → governmentValidationStateMachine-BFIcq3UB.esm.js} +4 -6
  169. package/dist/home.d.ts +4 -3
  170. package/dist/home.esm.js +4 -2
  171. package/dist/http.esm.js +1 -1
  172. package/dist/id-ocr.d.ts +2 -2
  173. package/dist/id-ocr.esm.js +3 -3
  174. package/dist/id-selfie-flow.d.ts +7 -6
  175. package/dist/id-selfie-flow.esm.js +14 -12
  176. package/dist/id-verification.d.ts +1 -1
  177. package/dist/id-verification.esm.js +2 -2
  178. package/dist/id.d.ts +6 -19
  179. package/dist/id.esm.js +4 -4
  180. package/dist/{idCaptureDefaults-BGsG2OAs.esm.js → idCaptureDefaults-CNopPetU.esm.js} +17 -7
  181. package/dist/{idCaptureManager-IouAnrFm.esm.js → idCaptureManager-BPDCAV04.esm.js} +95 -34
  182. package/dist/{idCaptureManager-0M02hSuC.d.ts → idCaptureManager-CNFBeYgV.d.ts} +105 -16
  183. package/dist/{idCaptureServices-VTKIPSpT.esm.js → idCaptureServices-CWZFmS7l.esm.js} +36 -213
  184. package/dist/{idCaptureStateMachine-_Pn2Xkpb.esm.js → idCaptureStateMachine-Cyt2BvPB.esm.js} +3081 -2510
  185. package/dist/{idOcrManager-DT3kPIB3.d.ts → idOcrManager-DflRx-_u.d.ts} +6 -5
  186. package/dist/{idOcrManager-D3-HNMXP.esm.js → idOcrManager-bjBLjrEE.esm.js} +5 -3
  187. package/dist/{idOcrStateMachine-DyENX6Ki.esm.js → idOcrStateMachine-D5ifJ1B8.esm.js} +20 -16
  188. package/dist/{idVerificationManager-BJapZfpy.d.ts → idVerificationManager-B6R8xNZq.d.ts} +4 -3
  189. package/dist/{idVerificationManager-iWz7Avkr.esm.js → idVerificationManager-C8Ja-vKq.esm.js} +5 -3
  190. package/dist/{idVerificationStateMachine-CL1kUdBe.esm.js → idVerificationStateMachine-BMnfZZli.esm.js} +4 -6
  191. package/dist/identity-reuse.d.ts +2 -2
  192. package/dist/identity-reuse.esm.js +2 -2
  193. package/dist/identity-search.d.ts +97 -0
  194. package/dist/identity-search.esm.js +96 -0
  195. package/dist/{identityReuseManager-CD1ucp1d.esm.js → identityReuseManager-B5BWAleT.esm.js} +9 -4
  196. package/dist/{identityReuseManager-ooAbp6Kc.d.ts → identityReuseManager-CZ-qJ_Aa.d.ts} +82 -15
  197. package/dist/{identityReuseStateMachine-DfV81wQC.esm.js → identityReuseStateMachine-Cuggm1UP.esm.js} +24 -31
  198. package/dist/{index-BKOWUhxG.d.ts → index-BMr3MZEI.d.ts} +93 -22
  199. package/dist/{index-CKQ9QBZP.d.ts → index-BoGlwLGK.d.ts} +2 -2
  200. package/dist/index-DHuAkTe0.d.ts +1 -0
  201. package/dist/index.d.ts +1 -1
  202. package/dist/index.esm.js +1 -1
  203. package/dist/{invokeOnCaptureCallback-DYrkOXO6.esm.js → invokeOnCaptureCallback-D2FOfi4O.esm.js} +1 -1
  204. package/dist/kyb-checks.d.ts +3 -0
  205. package/dist/kyb-checks.esm.js +3 -0
  206. package/dist/kybChecksManager-BF2vf0Q2.esm.js +90 -0
  207. package/dist/kybChecksManager-CKDy1mel.d.ts +95 -0
  208. package/dist/kybChecksStateMachine-oBQfgdka.esm.js +713 -0
  209. package/dist/mandatory-consent.d.ts +2 -2
  210. package/dist/mandatory-consent.esm.js +2 -2
  211. package/dist/{mandatoryConsentManager-qYojnZYg.d.ts → mandatoryConsentManager-BcxCesP5.d.ts} +30 -13
  212. package/dist/{mandatoryConsentManager-Cwqx1nK7.esm.js → mandatoryConsentManager-FfgHdPYw.esm.js} +7 -4
  213. package/dist/{mandatoryConsentStateMachine-pXWqAHo_.esm.js → mandatoryConsentStateMachine-CXuYC3qR.esm.js} +35 -19
  214. package/dist/mediaRecorderOptions-Di_V9TnZ.esm.js +87 -0
  215. package/dist/multipartRecordingService-CFmOUGQt.esm.js +407 -0
  216. package/dist/numericRange-2e1vw1W0.esm.js +256 -0
  217. package/dist/{permissionGuards-gcy3U0SL.esm.js → permissionGuards-CZTCRHT-.esm.js} +1 -1
  218. package/dist/{permissionServices-Ca-tSNhT.esm.js → permissionServices-Vd86JiW9.esm.js} +47 -19
  219. package/dist/phone-number.d.ts +7 -1
  220. package/dist/phone-number.esm.js +15 -2
  221. package/dist/phone.d.ts +1 -1
  222. package/dist/phone.esm.js +2 -2
  223. package/dist/{phoneManager-BO-LTih5.d.ts → phoneManager-bA-xw2TP.d.ts} +8 -11
  224. package/dist/{phoneManager-KKUq-Vgo.esm.js → phoneManager-oIMdbeLG.esm.js} +8 -7
  225. package/dist/phoneServices-Dk4j3NhI.esm.js +63 -0
  226. package/dist/{phoneStateMachine-D2QWS2cu.esm.js → phoneStateMachine-Cu3y7ewi.esm.js} +57 -90
  227. package/dist/{phoneValidation-DnBcNUNh.esm.js → phoneValidation-OggtfjRt.esm.js} +1 -2
  228. package/dist/{platform-DkcRc9JV.esm.js → platform-GIg4uPWe.esm.js} +15 -4
  229. package/dist/processFaceMatch-CHeI0DEt.esm.js +21 -0
  230. package/dist/qe-signature.d.ts +2 -2
  231. package/dist/qe-signature.esm.js +1 -1
  232. package/dist/recordingService-DK3kjUby.esm.js +404 -0
  233. package/dist/redirect-to-mobile.d.ts +2 -2
  234. package/dist/redirect-to-mobile.esm.js +2 -2
  235. package/dist/{redirectToMobileManager-CVsvpVbQ.d.ts → redirectToMobileManager-Db99n9Yu.d.ts} +7 -4
  236. package/dist/{redirectToMobileManager-uHW3dyuQ.esm.js → redirectToMobileManager-yYJGE47m.esm.js} +10 -6
  237. package/dist/{redirectToMobileStateMachine-b-H-ipGM.esm.js → redirectToMobileStateMachine-g_NbyHrL.esm.js} +82 -46
  238. package/dist/resolveForm-DaaQSVWp.esm.js +146 -0
  239. package/dist/{runChildModule-DSpP41Hl.esm.js → runChildModule-x1rrxjYY.esm.js} +9 -7
  240. package/dist/{sdkVersion-DKHwWEyH.esm.js → sdkVersion-kRh5h82H.esm.js} +1 -1
  241. package/dist/selfie.d.ts +6 -6
  242. package/dist/selfie.esm.js +15 -13
  243. package/dist/{selfieErrorUtils-DoN1KFSQ.esm.js → selfieErrorUtils-B9GfiS9f.esm.js} +1 -1
  244. package/dist/{selfieManager-DtQegA6T.esm.js → selfieManager-CivYjnF5.esm.js} +7 -6
  245. package/dist/{selfieManager-BJdNu_nd.d.ts → selfieManager-CqDlUy6B.d.ts} +2 -2
  246. package/dist/{selfieStateMachine-CnCwJZuC.esm.js → selfieStateMachine-dLwrXWll.esm.js} +5 -5
  247. package/dist/{session-CNUfjlRc.esm.js → session-DeJ-rd9u.esm.js} +78 -9
  248. package/dist/session.d.ts +85 -9
  249. package/dist/session.esm.js +7 -6
  250. package/dist/{sessionInitializer-JM_glXR2.esm.js → sessionInitializer-uZgyxsrL.esm.js} +442 -208
  251. package/dist/{setup-YPKTUCY5.d.ts → setup-Cr2KCwau.d.ts} +7 -6
  252. package/dist/{setup-C5tfWt6W.esm.js → setup-D0QZHkS8.esm.js} +42 -29
  253. package/dist/signature.d.ts +1 -1
  254. package/dist/signature.esm.js +2 -2
  255. package/dist/{signatureManager-f_dPAGXn.esm.js → signatureManager-DRUflksL.esm.js} +5 -3
  256. package/dist/{signatureManager-BpVt_Jv7.d.ts → signatureManager-daT_8fj_.d.ts} +3 -3
  257. package/dist/{signatureStateMachine-C-nUq_oq.esm.js → signatureStateMachine-BQZenxel.esm.js} +5 -7
  258. package/dist/{spawn-D9jgw9pW.d.ts → spawn-COZKetCS.d.ts} +1 -1
  259. package/dist/{stats-BEvexnKC.esm.js → stats-DHu3li6G.esm.js} +1 -1
  260. package/dist/stats.esm.js +1 -1
  261. package/dist/step-up.d.ts +379 -0
  262. package/dist/step-up.esm.js +640 -0
  263. package/dist/{tri-xzRLIIMN.esm.js → tri-D_gHPWrq.esm.js} +137 -8
  264. package/dist/tri.d.ts +2 -2
  265. package/dist/tri.esm-CftnGf9w.esm.js +3115 -0
  266. package/dist/tri.esm.js +2 -2
  267. package/dist/trueSight-CbrZUzLx.esm.js +1 -0
  268. package/dist/{trueSightService-fLmL_cyg.esm.js → trueSightService-BMp8g65B.esm.js} +25 -16
  269. package/dist/trust-graph.d.ts +87 -27
  270. package/dist/trust-graph.esm.js +6 -25
  271. package/dist/trustGraphStateMachine-0Ehwried.esm.js +58 -0
  272. package/dist/types-B9C8W01q.d.ts +34 -0
  273. package/dist/types-BNkzXOXE.d.ts +45 -0
  274. package/dist/{types-B6HsSzpk.d.ts → types-BZsmNYom.d.ts} +77 -9
  275. package/dist/types-BinnzVrL.d.ts +6 -0
  276. package/dist/{types-CJ7Yl9K-.d.ts → types-Bpo97EOh.d.ts} +4 -2
  277. package/dist/{types-0L-eFDmr.d.ts → types-BwMpWCVG.d.ts} +6 -2
  278. package/dist/{types-BQA7lRDV.d.ts → types-C3rfDzgE.d.ts} +4 -2
  279. package/dist/types-CXTDuzUJ.d.ts +16 -0
  280. package/dist/{types-BEwVKkLJ.d.ts → types-CeEcakO7.d.ts} +7 -1
  281. package/dist/{types-DUnFZ08M.d.ts → types-Cy6Lx3L6.d.ts} +18 -10
  282. package/dist/{types-BAxn7MpY.d.ts → types-D-FEM1rT.d.ts} +156 -58
  283. package/dist/types-D6Q1D1kx.d.ts +33 -0
  284. package/dist/{events-Du2A4-Qr.esm.js → types-DLsivQsu.esm.js} +6 -303
  285. package/dist/{types-DPIDuhut.d.ts → types-DNVzoRvi.d.ts} +2 -1
  286. package/dist/types-DWqO7owj.d.ts +58 -0
  287. package/dist/{types-yPH8lAH-.d.ts → types-HHgsFhZn.d.ts} +16 -3
  288. package/dist/{types-Ckir_BEs.d.ts → types-LbccjQYX.d.ts} +3 -2
  289. package/dist/{types-CK8Jbjkp.d.ts → types-PnJXvTkV.d.ts} +1 -1
  290. package/dist/types-g3NuVCT9.d.ts +118 -0
  291. package/dist/types-tOSLpcSa.d.ts +231 -0
  292. package/dist/urlUtils-B2wagB5v.esm.js +39 -0
  293. package/dist/usStates-CwOQ2kAx.esm.js +209 -0
  294. package/dist/video-selfie.d.ts +27 -17
  295. package/dist/video-selfie.esm.js +105 -26
  296. package/dist/{videoSelfieCameraWarmer-BBNKiau1.esm.js → videoSelfieCameraWarmer-BpP0_lDr.esm.js} +47 -29
  297. package/dist/{videoSelfieFlowModuleMachine-BCFVHBQ1.esm.js → videoSelfieFlowModuleMachine-IWdxw1TW.esm.js} +1 -1
  298. package/dist/{videoSelfieStepDetector-CGsTltqB.d.ts → videoSelfieStepDetector-CxOc3kSI.d.ts} +24 -9
  299. package/dist/virtualCameraCheck-eFOm2C9q.esm.js +27 -0
  300. package/dist/{warmup-BElYWRh7.esm.js → warmup-ClZxXOkg.esm.js} +378 -57
  301. package/dist/{warmup-BO57syF6.d.ts → warmup-SWu5L7cW.d.ts} +19 -2
  302. package/dist/wasm.d.ts +9 -3
  303. package/dist/wasm.esm.js +3 -3
  304. package/dist/wasmDeepsightConfigSync-DukEcrU8.esm.js +77 -0
  305. package/dist/{wasmDsFlagSync-CYj5LL9z.esm.js → wasmDsFlagSync-Bw-P5OG1.esm.js} +1 -1
  306. package/dist/{wasmWebClient-BjZw_7OB.esm.js → wasmWebClient-BLtlzQhv.esm.js} +77 -29
  307. package/dist/watchlist-for-business.d.ts +2 -1
  308. package/dist/watchlist-for-business.esm.js +2 -2
  309. package/dist/watchlist.d.ts +1 -1
  310. package/dist/watchlist.esm.js +2 -2
  311. package/dist/{watchlistForBusinessManager-CZZOFkGl.esm.js → watchlistForBusinessManager-d8kdf35n.esm.js} +40 -8
  312. package/dist/{watchlistForBusinessManager-B3GDPZrr.d.ts → watchlistForBusinessManager-l7ZERQcV.d.ts} +57 -21
  313. package/dist/watchlistForBusinessStateMachine-Y9wFmuMH.esm.js +170 -0
  314. package/dist/{watchlistManager-DXtX94SN.esm.js → watchlistManager-D1BVrd3H.esm.js} +5 -3
  315. package/dist/{watchlistManager-DJQOd8Pw.d.ts → watchlistManager-DQq4GxBO.d.ts} +3 -3
  316. package/dist/{watchlistStateMachine-McALifag.esm.js → watchlistStateMachine-Da4p0sTE.esm.js} +4 -6
  317. package/dist/workflow.d.ts +10 -6
  318. package/dist/workflow.esm.js +95 -60
  319. package/dist/{xstate-actors.esm-8Gzepa_A.esm.js → xstate-actors.esm-BCcwgosu.esm.js} +1 -1
  320. package/dist/xstate.cjs-D6Ur0X1F.d.ts +7 -0
  321. package/dist/{xstate.esm-DSajW7CJ.esm.js → xstate.esm-CIqUf_i6.esm.js} +1 -125
  322. package/package.json +34 -7
  323. package/dist/Actor-DpTj5PFb.d.ts +0 -1
  324. package/dist/IBrowserEnvironmentCapability-DEaRRk-R.esm.js +0 -9
  325. package/dist/addressSearch-DPjIKJrX.esm.js +0 -563
  326. package/dist/camera-9wWD-pwg.d.ts +0 -4
  327. package/dist/cpf-uAZTPUBy.esm.js +0 -61
  328. package/dist/deepsightLoader-sH7920zw.esm.js +0 -55
  329. package/dist/ekybStateMachine-BfgOUZMK.esm.js +0 -933
  330. package/dist/ekycStateMachine-CDnI_NRq.esm.js +0 -1443
  331. package/dist/ekycUtils-zY8CdKJL.esm.js +0 -300
  332. package/dist/flowServices-X6Rwf_7E.esm.js +0 -688
  333. package/dist/index-DpTj5PFb.d.ts +0 -1
  334. package/dist/thumbmark.esm-CRc0cYvz.esm.js +0 -1242
  335. package/dist/tri.esm-BIjHhBJ2.esm.js +0 -2620
  336. package/dist/types-BvLo3U4u.d.ts +0 -134
  337. package/dist/types-zOgZqMni.d.ts +0 -6
  338. package/dist/urlUtils-6jsE6rKp.esm.js +0 -23
  339. package/dist/watchlistForBusinessStateMachine-B66E7jud.esm.js +0 -78
  340. /package/dist/{types-BSBzhHRH2.d.ts → types-BSBzhHRH.d.ts} +0 -0
@@ -1,19 +1,21 @@
1
- import { t as getTimestamp } from "./IBrowserEnvironmentCapability-DEaRRk-R.esm.js";
2
- import { r as getToken, t as api, u as endpoints } from "./api-Cz90EHyu.esm.js";
3
- import { l as trueSightHintTransition, r as noteTrueSightCaptureActivity, u as trueSightLog, y as isTrueSightTesting } from "./trueSightService-fLmL_cyg.esm.js";
4
- import "./sessionInitializer-JM_glXR2.esm.js";
5
- import { t as addDeviceStats } from "./stats-BEvexnKC.esm.js";
6
- import { t as BrowserLazyImportProvider } from "./BrowserLazyImportProvider-BhoA957O.esm.js";
7
- import { i as assign, n as enqueueActions, r as sendTo, t as setup } from "./xstate.esm-DSajW7CJ.esm.js";
8
- import { n as fromPromise, t as fromCallback } from "./xstate-actors.esm-8Gzepa_A.esm.js";
9
- import { n as invokeRequestPermissionActor, t as checkPermission } from "./permissionServices-Ca-tSNhT.esm.js";
10
- import { a as sendLabelInspectionEvent, d as FACE_ERROR_CODES, i as initializeDeepsightSession, r as initializeCamera, s as stopStream, t as FaceDetectionProvider, u as getFaceUploadErrorCode } from "./FaceDetectionProvider-J_-1Cwck.esm.js";
11
- import { i as flagFaceManualReview, n as runProtectedAttempt, o as PROTECTED_CAPTURE_TARGET, r as cameraCycleProvider, t as createCameraCycleOwnership } from "./createCameraCycleOwnership-Dj_LHUvN.esm.js";
1
+ import { n as getTimestamp } from "./IBrowserEnvironmentCapability-D7JG7ML3.esm.js";
2
+ import { r as getToken } from "./api-B58edv6M.esm.js";
3
+ import { l as trueSightHintTransition, r as noteTrueSightCaptureActivity, u as trueSightLog, y as isTrueSightTesting } from "./trueSightService-BMp8g65B.esm.js";
4
+ import "./trueSight-CbrZUzLx.esm.js";
5
+ import { t as addDeviceStats } from "./stats-DHu3li6G.esm.js";
6
+ import { s as isIPhone14OrHigher } from "./platform-GIg4uPWe.esm.js";
7
+ import { i as assign, n as enqueueActions, r as sendTo, t as setup } from "./xstate.esm-CIqUf_i6.esm.js";
8
+ import { n as fromPromise, t as fromCallback } from "./xstate-actors.esm-BCcwgosu.esm.js";
9
+ import { c as isCameraDenialErrorName } from "./camera-CJKApt0x.esm.js";
10
+ import { n as checkPermission, r as invokeRequestPermissionActor, t as canPrimeMotionWithoutUserGesture } from "./permissionServices-Vd86JiW9.esm.js";
11
+ import { t as getDeviceClass } from "./getDeviceClass-Dcy9erbl.esm.js";
12
+ import { n as recordsLivenessClip, r as wantsDeepsightMotion } from "./deepsightCaptureConfig-BxD3mSac.esm.js";
13
+ import { a as sendLabelInspectionEvent, i as probeFaceCamera, l as getFaceUploadErrorCode, r as initializeDeepsightSession, t as FaceDetectionProvider, u as FACE_ERROR_CODES } from "./FaceDetectionProvider-Cy2EAL0i.esm.js";
14
+ import { a as cameraCycleProvider, c as deepsightSignalConfigActor, i as runProtectedAttempt, l as PROTECTED_CAPTURE_TARGET, n as createCameraCycleOwnership, o as flagFaceManualReview, r as readIadCameraStepGates, t as electDesktopCameraDevice } from "./desktopCameraElection-BGQRIA2u.esm.js";
12
15
  import { n as releaseFaceAvatarWarmup, r as warmFaceAvatar, t as createFaceAvatar } from "./createFaceAvatar-BNHdeFj8.esm.js";
13
16
  import { t as IncodeCanvas } from "./canvas-BxFzWTt-.esm.js";
14
- import { n as needsMotionPrimeOnlyFromPermission, r as resolveStoredPermissionResult, t as isReadyForCaptureFromPermission } from "./permissionGuards-gcy3U0SL.esm.js";
15
- import { a as getAdaptiveMediaRecorderOptions, i as createRecordingCompositor, n as WorkerEncoderRecordingProvider, t as MultipartRecordingService } from "./multipartRecordingService-CLwrF5wD.esm.js";
16
- import { t as getDeviceClass } from "./getDeviceClass-bsWdEDxP.esm.js";
17
+ import { n as needsMotionPrimeOnlyFromPermission, r as resolveStoredPermissionResult, t as isReadyForCaptureFromPermission } from "./permissionGuards-CZTCRHT-.esm.js";
18
+ import { t as carryAttempts } from "./attemptCarry-CxiYlUAO.esm.js";
17
19
  //#region src/internal/avatar/concealment.ts
18
20
  /**
19
21
  * Maps a backend concealment option to the internal avatar flags. `OPTION_NONE`
@@ -69,398 +71,17 @@ function logFaceCameraDiagnostic(event, fields) {
69
71
  console.debug(`${FACE_CAMERA_DIAGNOSTIC_PREFIX} ${event} ${JSON.stringify(fields)}`);
70
72
  }
71
73
  //#endregion
72
- //#region ../infra/src/media/VideoTrimmer.ts
73
- /** A trim that runs longer than this uploads the full recording instead. */
74
- const TRIM_TIMEOUT_MS = 1e4;
75
- const trimmer = BrowserLazyImportProvider.getInstance().create(() => import("./videoTrimByCopy-BFfAiNpv.esm.js").then((module) => module.trimLastNSecondsByCopy), {
76
- label: "Video liveness",
77
- moduleName: "mediabunny",
78
- timeoutMs: 1e4,
79
- disabledMessage: "the full recording will be uploaded untrimmed."
80
- });
81
- /** Starts loading the trimmer, e.g. when a recording that will be trimmed starts. */
82
- function preloadVideoTrimmer() {
83
- trimmer.load();
84
- }
85
- /**
86
- * Keeps about the last `seconds` of a recording. Never rejects and never
87
- * hangs: when the trimmer cannot load, fails, or takes longer than
88
- * {@link TRIM_TIMEOUT_MS}, it resolves the untrimmed recording.
89
- */
90
- async function trimLastNSeconds(videoBlob, seconds) {
91
- const trim = await trimmer.load();
92
- if (!trim) return videoBlob;
93
- let timeout;
94
- try {
95
- return await Promise.race([trim(videoBlob, seconds), new Promise((resolve) => {
96
- timeout = setTimeout(() => {
97
- console.warn("[Video liveness] Trimming timed out; the full recording will be uploaded untrimmed.");
98
- resolve(videoBlob);
99
- }, TRIM_TIMEOUT_MS);
100
- })]);
101
- } catch (error) {
102
- console.warn("[Video liveness] Trimming failed; the full recording will be uploaded untrimmed.", error);
103
- return videoBlob;
104
- } finally {
105
- clearTimeout(timeout);
106
- }
107
- }
108
- //#endregion
109
- //#region ../infra/src/providers/browser/LocalRecordingProvider.ts
110
- function toBase64(videoBlob) {
111
- return new Promise((resolve, reject) => {
112
- const reader = new FileReader();
113
- reader.onloadend = () => {
114
- const base64 = reader.result.split(",")[1];
115
- resolve(base64);
116
- };
117
- reader.onerror = () => reject(reader.error ?? /* @__PURE__ */ new Error("FileReader error"));
118
- reader.readAsDataURL(videoBlob);
119
- });
120
- }
121
- /** `MediaRecorderOptions.videoKeyFrameIntervalDuration`, see `startRecording`. */
122
- const KEYFRAME_INTERVAL_MS = 1e3;
123
- var LocalRecordingProvider = class {
124
- constructor() {
125
- this.mediaRecorder = null;
126
- this._isRecording = false;
127
- this._hasError = false;
128
- this._error = null;
129
- this.mimeType = "";
130
- this.stream = null;
131
- this.pauseRecordingBound = this.pauseRecording.bind(this);
132
- }
133
- get isRecording() {
134
- return this._isRecording;
135
- }
136
- get hasError() {
137
- return this._hasError;
138
- }
139
- get error() {
140
- return this._error;
141
- }
142
- startRecording(stream) {
143
- this.reset();
144
- preloadVideoTrimmer();
145
- this.registerEventListeners();
146
- this.stream = stream;
147
- try {
148
- const options = getAdaptiveMediaRecorderOptions();
149
- this.mimeType = options.mimeType;
150
- const recorder = new MediaRecorder(stream.clone(), {
151
- ...options,
152
- videoKeyFrameIntervalDuration: KEYFRAME_INTERVAL_MS
153
- });
154
- recorder.onerror = (event) => {
155
- this._error = `Recording error: ${event}`;
156
- this._isRecording = false;
157
- this._hasError = true;
158
- };
159
- recorder.start();
160
- this.mediaRecorder = recorder;
161
- this._isRecording = true;
162
- this._error = null;
163
- this._hasError = false;
164
- } catch (err) {
165
- this._error = `Failed to start recording: ${err}`;
166
- this._hasError = true;
167
- }
168
- }
169
- async stopRecording(trimSeconds, encrypt, generateChecksum) {
170
- const recorder = this.mediaRecorder;
171
- return new Promise((resolve, reject) => {
172
- this.removeEventListeners();
173
- if (recorder && this._isRecording) {
174
- const chunks = [];
175
- recorder.ondataavailable = (event) => {
176
- if (event.data.size > 0) chunks.push(event.data);
177
- };
178
- recorder.onstop = async () => {
179
- try {
180
- const trimmedVideo = await trimLastNSeconds(new Blob(chunks, { type: this.mimeType }), trimSeconds);
181
- const encryptedVideoBase64 = encrypt(await toBase64(trimmedVideo));
182
- generateChecksum(await trimmedVideo.arrayBuffer());
183
- this._isRecording = false;
184
- resolve({
185
- trimmedBlob: trimmedVideo,
186
- encryptedVideo: encryptedVideoBase64
187
- });
188
- } catch (error) {
189
- this._isRecording = false;
190
- this._error = `Recording stop failed: ${error}`;
191
- this._hasError = true;
192
- reject(error);
193
- }
194
- };
195
- recorder.stop();
196
- this._isRecording = false;
197
- } else resolve({
198
- trimmedBlob: new Blob([], { type: this.mimeType }),
199
- encryptedVideo: ""
200
- });
201
- recorder?.stream?.getTracks().forEach((track) => track.stop());
202
- });
203
- }
204
- /**
205
- * Discards the in-progress recording without producing a result: detaches
206
- * the recorder's handlers, stops it, releases its cloned tracks and clears
207
- * the flags. Idempotent, and safe after `stopRecording` or when never
208
- * started. Mirrors `MultipartRecordingProvider.reset()` so an attempt that is
209
- * released before finalization cannot leave a live camera clone behind
210
- * (ENG-56648).
211
- */
212
- reset() {
213
- this.removeEventListeners();
214
- const recorder = this.mediaRecorder;
215
- if (recorder) {
216
- recorder.ondataavailable = null;
217
- recorder.onerror = null;
218
- recorder.onstop = null;
219
- if (recorder.state !== "inactive") try {
220
- recorder.stop();
221
- } catch {}
222
- recorder.stream?.getTracks().forEach((track) => track.stop());
223
- this.mediaRecorder = null;
224
- }
225
- this.stream = null;
226
- this._isRecording = false;
227
- this._error = null;
228
- this._hasError = false;
229
- }
230
- pauseRecording() {
231
- if (!this._isRecording) return;
232
- if (this.mediaRecorder?.state === "recording") try {
233
- this.mediaRecorder.pause();
234
- } catch {}
235
- }
236
- registerEventListeners() {
237
- document.addEventListener("visibilitychange", this.pauseRecordingBound);
238
- }
239
- removeEventListeners() {
240
- document.removeEventListener("visibilitychange", this.pauseRecordingBound);
241
- }
242
- };
243
- //#endregion
244
- //#region src/internal/recordings/recordingsRepository.ts
245
- async function uploadDeepsightVideo(encryptedVideo, token) {
246
- try {
247
- return (await api.post(endpoints.deepsightVideoImport, {
248
- video: encryptedVideo,
249
- type: "selfie"
250
- }, { headers: { "X-Incode-Hardware-Id": token } })).data.recordingId ?? "";
251
- } catch {
252
- return "";
253
- }
254
- }
255
- //#endregion
256
- //#region src/internal/faceCapture/recordingService.ts
257
- /**
258
- * Records on-device and uploads encrypted video for liveness.
259
- */
260
- var LocalRecordingService = class {
261
- constructor(wasmUtil, sessionToken) {
262
- this.recorder = new LocalRecordingProvider();
263
- this.sessionToken = sessionToken;
264
- this.wasmUtil = wasmUtil;
265
- }
266
- async start(stream) {
267
- this.recorder.startRecording(stream);
268
- this.wasmUtil.osv();
269
- }
270
- async stop() {
271
- if (!this.recorder.isRecording) return { recordingId: null };
272
- this.wasmUtil.oev();
273
- const result = await this.recorder.stopRecording(10, (base64) => this.wasmUtil.encryptImage(base64), (buffer) => this.wasmUtil.ckvcks(buffer));
274
- if (!this.sessionToken) return { recordingId: null };
275
- return { recordingId: await uploadDeepsightVideo(result.encryptedVideo, this.sessionToken) };
276
- }
277
- prepareUpload() {
278
- return this.stop();
279
- }
280
- async stopAndGetVideo() {
281
- if (!this.recorder.isRecording) return { videoBase64: void 0 };
282
- try {
283
- this.wasmUtil.oev();
284
- const videoBase64 = (await this.recorder.stopRecording(10, (base64) => base64, () => {})).encryptedVideo;
285
- return { videoBase64: videoBase64 ? videoBase64 : void 0 };
286
- } catch {
287
- return { videoBase64: void 0 };
288
- }
289
- }
290
- cleanup() {
291
- this.recorder.reset();
292
- }
293
- };
294
- /**
295
- * Records a regular Selfie capture locally and streams it through the scoped
296
- * video-selfie-service multipart protocol. The recording is associated with
297
- * the interview asynchronously by the backend's `selfie` scope consumer, so
298
- * its upload id must not be forwarded to `/omni/add/face` as a legacy
299
- * `recordingId`.
300
- *
301
- * The recording is scoped to the capture step (ENG-56648). The recorder
302
- * records a stable `CameraCompositor` stream instead of a raw camera clone, so
303
- * every attempt can end its own clone before PRC and POC run and the next
304
- * attempt swaps a fresh clone into the same multipart upload. The owning
305
- * controller completes the upload once the backend accepts a capture or the
306
- * step ends without a retry.
307
- */
308
- var MultipartFaceRecordingService = class {
309
- constructor() {
310
- this.recordingCompositor = createRecordingCompositor();
311
- this.service = new MultipartRecordingService("selfie", new WorkerEncoderRecordingProvider(this.recordingCompositor));
312
- this.audioSource = [];
313
- this.needsVideoSourceReplacement = false;
314
- this.pausedForAttempt = false;
315
- this.startInFlight = false;
316
- this.suspendRequested = false;
317
- this.stopping = false;
318
- }
319
- async start(stream) {
320
- if (this.stopping) throw new Error("Face recording already completed");
321
- if (this.compositor) {
322
- await this.resume(stream);
323
- return;
324
- }
325
- const recordingSource = stream.clone();
326
- const compositor = this.recordingCompositor;
327
- this.startInFlight = true;
328
- try {
329
- const composite = compositor.start(recordingSource);
330
- await this.service.start(composite);
331
- } catch (error) {
332
- compositor.stop();
333
- recordingSource.getTracks().forEach((track) => track.stop());
334
- this.service.cleanup();
335
- throw error;
336
- } finally {
337
- this.startInFlight = false;
338
- }
339
- if (this.stopping) {
340
- compositor.stop();
341
- recordingSource.getTracks().forEach((track) => track.stop());
342
- this.service.cleanup();
343
- return;
344
- }
345
- this.compositor = compositor;
346
- this.recordingSource = recordingSource;
347
- this.audioSource = recordingSource.getAudioTracks();
348
- if (this.suspendRequested) {
349
- this.suspendRequested = false;
350
- this.suspend();
351
- }
352
- }
353
- /**
354
- * Pauses the container and ends the camera clone on the calling thread. The
355
- * composite stream and the upload stay open for the next attempt.
356
- */
357
- suspend() {
358
- if (this.stopping) return;
359
- if (!this.compositor) {
360
- this.suspendRequested = this.startInFlight;
361
- return;
362
- }
363
- if (!this.pausedForAttempt) this.pausedForAttempt = this.service.pause();
364
- this.releaseCameraClone({ keepAudio: true });
365
- this.needsVideoSourceReplacement = true;
366
- }
367
- async prepareUpload() {
368
- this.suspend();
369
- return { recordingId: null };
370
- }
371
- async stop() {
372
- await this.complete();
373
- return { recordingId: null };
374
- }
375
- pauseForBackground() {
376
- this.suspend();
377
- }
378
- async resumeFromBackground(stream) {
379
- if (!this.compositor || this.stopping) return;
380
- await this.resume(stream);
381
- }
382
- async stopAndGetVideo() {
383
- await this.complete();
384
- return { videoBase64: void 0 };
385
- }
386
- cleanup() {
387
- this.suspendRequested = false;
388
- this.pausedForAttempt = false;
389
- this.needsVideoSourceReplacement = false;
390
- this.releaseCameraClone({ keepAudio: false });
391
- this.compositor?.stop();
392
- this.compositor = void 0;
393
- this.recordingSource = void 0;
394
- this.audioSource = [];
395
- this.service.cleanup();
396
- }
397
- /** Swaps this attempt's camera clone into the composite and resumes. */
398
- async resume(stream) {
399
- const compositor = this.compositor;
400
- if (!compositor) return;
401
- if (this.needsVideoSourceReplacement) {
402
- const recordingSource = stream.clone();
403
- recordingSource.getAudioTracks().forEach((track) => track.stop());
404
- compositor.switchVideo(recordingSource);
405
- this.needsVideoSourceReplacement = false;
406
- this.recordingSource = recordingSource;
407
- const result = await compositor.resume();
408
- if (result !== "resumed") throw new Error(`Face recording camera did not resume: ${result}`);
409
- }
410
- if (this.pausedForAttempt && !this.service.resume()) throw new Error("Face recording did not resume");
411
- this.pausedForAttempt = false;
412
- }
413
- /**
414
- * Completes the scoped upload. The camera clone ends synchronously before the
415
- * drain so a step that ends mid-attempt never pins the camera; the composite
416
- * stays alive until the recorder has emitted its final chunk.
417
- */
418
- async complete() {
419
- this.stopping = true;
420
- this.suspendRequested = false;
421
- this.releaseCameraClone({ keepAudio: false });
422
- try {
423
- await this.service.stop();
424
- } finally {
425
- this.compositor?.stop();
426
- this.compositor = void 0;
427
- this.recordingSource = void 0;
428
- this.audioSource = [];
429
- this.pausedForAttempt = false;
430
- this.needsVideoSourceReplacement = false;
431
- }
432
- }
433
- releaseCameraClone(options) {
434
- try {
435
- this.compositor?.pause();
436
- } catch {}
437
- const tracks = options.keepAudio ? this.recordingSource?.getVideoTracks() ?? [] : /* @__PURE__ */ new Set([...this.recordingSource?.getTracks() ?? [], ...this.audioSource]);
438
- for (const track of tracks) try {
439
- track.stop();
440
- } catch {}
441
- }
442
- };
74
+ //#region src/internal/faceCapture/protectedFaceAttempt.ts
75
+ const ON_DEVICE_MANUAL_CAPTURE_TIMEOUT_MS = 2147483647;
443
76
  /**
444
- * Creates the recording service for the current configuration.
445
- *
446
- * Order of precedence:
447
- * 1. `onDeviceFaceResultsSubmissionEnabled === true` → no recording. The
448
- * on-device workflow never uploads media, only the staged face-results
449
- * JSON via `WebApi.postFaceResults`. Mirrors V1's
450
- * `FaceFlowManager.setRecorders()` early return.
451
- * 2. `deepsightLiveness === 'VIDEOLIVENESS'` → local Deepsight recorder.
452
- * 3. `enableFaceRecording === true` → scoped multipart recorder.
453
- * 4. otherwise → no recording.
77
+ * Merged session recordings carry sound, as in SDK 1. Only for the uploaded
78
+ * session recording (`createRecordingService`'s multipart branch): local and
79
+ * liveness-clip recordings ({@link recordsLivenessClip}) stay video-only. The
80
+ * permission step reads it too, so camera and mic are asked in one prompt.
454
81
  */
455
- function createRecordingService(params) {
456
- if (params.config.onDeviceFaceResultsSubmissionEnabled === true) return;
457
- if (params.localDelivery === true) return params.config.enableFaceRecording === true || params.config.deepsightLiveness === "VIDEOLIVENESS" ? new LocalRecordingService(params.wasmUtil, null) : void 0;
458
- if (params.config.deepsightLiveness === "VIDEOLIVENESS") return new LocalRecordingService(params.wasmUtil, params.sessionToken);
459
- if (params.config.enableFaceRecording === true) return new MultipartFaceRecordingService();
82
+ function requestsFaceSessionAudio(config) {
83
+ return config.mergeSessionRecordings === true && config.enableFaceRecording === true && config.onDeviceFaceResultsSubmissionEnabled !== true && !recordsLivenessClip(config);
460
84
  }
461
- //#endregion
462
- //#region src/internal/faceCapture/protectedFaceAttempt.ts
463
- const ON_DEVICE_MANUAL_CAPTURE_TIMEOUT_MS = 2147483647;
464
85
  /**
465
86
  * Recorder hooks for one protected face attempt.
466
87
  *
@@ -476,7 +97,8 @@ var ProtectedFaceRecorderHooks = class {
476
97
  this.delivery = delivery;
477
98
  this.getRecordingService = getRecordingService;
478
99
  this.disposed = false;
479
- this.mode = config.onDeviceFaceResultsSubmissionEnabled === true || config.enableFaceRecording !== true && config.deepsightLiveness !== "VIDEOLIVENESS" ? "none" : "finalizeBeforePoc";
100
+ const recordsClip = delivery === "local" ? config.deepsightLiveness === "VIDEOLIVENESS" : recordsLivenessClip(config);
101
+ this.mode = config.onDeviceFaceResultsSubmissionEnabled === true || config.enableFaceRecording !== true && !recordsClip ? "none" : "finalizeBeforePoc";
480
102
  }
481
103
  async start(unprotectedStream) {
482
104
  if (this.mode === "none") return;
@@ -552,16 +174,14 @@ var ProtectedFaceRecorderHooks = class {
552
174
  let nextAttemptNumber = 1;
553
175
  /**
554
176
  * Private composition object for one still-face attempt. It owns provider
555
- * callbacks and raw-stream handoff outside XState; the machine sees only the
556
- * presentation stream/canvas and allowlisted semantic results.
177
+ * callbacks and the camera-step options outside XState; the machine sees only
178
+ * the presentation stream/canvas and allowlisted semantic results.
557
179
  */
558
180
  var ProtectedFaceAttemptRuntime = class ProtectedFaceAttemptRuntime {
559
181
  constructor(options) {
560
182
  this.options = options;
561
183
  this.attemptId = `face-${nextAttemptNumber++}`;
562
- this.acquiredUsingBackCamera = false;
563
- this.rawHandedOff = false;
564
- this.rawStreamReleased = false;
184
+ this.probedUsingBackCamera = false;
565
185
  this.released = false;
566
186
  this.recorderTransferred = false;
567
187
  this.pendingSignals = [];
@@ -572,7 +192,7 @@ var ProtectedFaceAttemptRuntime = class ProtectedFaceAttemptRuntime {
572
192
  /** Per-attempt fallback when no step owner supplies the recording service. */
573
193
  async createAttemptRecordingService() {
574
194
  const wasmUtil = await this.options.dependencies.getWasmUtil();
575
- return createRecordingService({
195
+ return (await import("./recordingService-DK3kjUby.esm.js")).createRecordingService({
576
196
  config: this.options.config,
577
197
  wasmUtil,
578
198
  sessionToken: getToken(),
@@ -583,14 +203,15 @@ var ProtectedFaceAttemptRuntime = class ProtectedFaceAttemptRuntime {
583
203
  return this.options.delivery;
584
204
  }
585
205
  get usingBackCamera() {
586
- return this.acquiredUsingBackCamera;
206
+ return this.probedUsingBackCamera;
587
207
  }
588
208
  setDeepsightService(service) {
589
209
  if (this.released || this.deepsightService) return;
590
210
  this.deepsightService = service;
591
211
  }
212
+ /** Tutorial-time preparation; the camera itself opens at attempt start. */
592
213
  async preAcquire() {
593
- await this.acquireRawStream();
214
+ await this.probe();
594
215
  }
595
216
  subscribeSignals(listener) {
596
217
  if (this.released) return () => void 0;
@@ -608,23 +229,29 @@ var ProtectedFaceAttemptRuntime = class ProtectedFaceAttemptRuntime {
608
229
  attemptId: this.attemptId,
609
230
  target: this.options.target,
610
231
  workflow: this.options.config.onDeviceFaceResultsSubmissionEnabled === true ? 5 : 4,
611
- streamSource: {
612
- kind: "acquire",
613
- acquire: async () => {
614
- const result = await this.acquireRawStream();
615
- this.rawHandedOff = true;
616
- return {
617
- stream: result.stream,
618
- constraints: result.constraints
619
- };
620
- }
232
+ cameraStep: async () => {
233
+ const { usingBackCamera } = await this.probe();
234
+ const facing = usingBackCamera ? "environment" : "user";
235
+ const resolution = usingBackCamera ? void 0 : this.options.config.cameraResolution;
236
+ const width = resolution?.width ?? 0;
237
+ const height = resolution?.height ?? 0;
238
+ const hasResolution = width > 0 && height > 0;
239
+ return {
240
+ vs: facing,
241
+ di: await electDesktopCameraDevice(facing),
242
+ ew: hasResolution ? width : 0,
243
+ eh: hasResolution ? height : 0,
244
+ i14: isIPhone14OrHigher(),
245
+ pa: false,
246
+ ...this.options.delivery === "protected" ? readIadCameraStepGates() : {}
247
+ };
621
248
  },
622
249
  cycle: this.options.cycle,
623
250
  cycleOwnership: this.cycleOwnership,
251
+ recordAudio: this.options.delivery === "protected" && requestsFaceSessionAudio(this.options.config),
624
252
  recorder: this.recorder,
625
- releaseUnadoptedStream: (stream) => stopStream(stream),
253
+ afterReady: this.options.delivery === "protected" ? (displayStream) => this.attachProtectedCameraMetadata(displayStream) : void 0,
626
254
  configureWorkflow: () => this.configureWorkflow(),
627
- runPrc: () => this.runPrc(),
628
255
  runPoc: () => this.runPoc(),
629
256
  onStartupTiming,
630
257
  faceResults: this.provider
@@ -704,16 +331,18 @@ var ProtectedFaceAttemptRuntime = class ProtectedFaceAttemptRuntime {
704
331
  Promise.resolve(this.provider.dispose()).catch(() => void 0);
705
332
  } catch {}
706
333
  this.cycleOwnership.releaseByController();
707
- if (!this.rawHandedOff) this.acquired?.then(({ stream }) => this.releaseRawStream(stream), () => void 0);
708
334
  }
709
- async acquireRawStream() {
710
- if (!this.acquired) this.acquired = this.options.acquireCamera(this.provider);
711
- const result = await this.acquired;
712
- this.acquiredUsingBackCamera = result.usingBackCamera;
713
- if (this.released) {
714
- this.releaseRawStream(result.stream);
715
- throw new Error("Protected face attempt was released");
716
- }
335
+ /**
336
+ * Runs the camera-free probe once per attempt, whether the tutorial
337
+ * pre-acquire or the camera step asks first. Every retry creates a fresh
338
+ * runtime, so the pipeline warm-up and the lens choice are re-checked per
339
+ * attempt.
340
+ */
341
+ async probe() {
342
+ this.probed ??= this.options.probeCamera();
343
+ const result = await this.probed;
344
+ this.probedUsingBackCamera = result.usingBackCamera;
345
+ if (this.released) throw new Error("Protected face attempt was released");
717
346
  return result;
718
347
  }
719
348
  async configureWorkflow() {
@@ -767,13 +396,6 @@ var ProtectedFaceAttemptRuntime = class ProtectedFaceAttemptRuntime {
767
396
  });
768
397
  this.emitDetection("detecting");
769
398
  }
770
- async runPrc() {
771
- if (this.options.delivery === "protected") await this.attachProtectedCameraMetadata();
772
- if (this.released) return;
773
- const wasmUtil = await this.options.dependencies.getWasmUtil();
774
- if (this.released) return;
775
- await wasmUtil.prc();
776
- }
777
399
  async runPoc() {
778
400
  if (this.options.delivery === "local") return;
779
401
  const deepsight = this.deepsightService;
@@ -797,12 +419,11 @@ var ProtectedFaceAttemptRuntime = class ProtectedFaceAttemptRuntime {
797
419
  const logs = deepsight.getPipelineState();
798
420
  this.options.dependencies.trackCaptureAttemptFinished?.({ logs });
799
421
  }
800
- async attachProtectedCameraMetadata() {
422
+ async attachProtectedCameraMetadata(displayStream) {
801
423
  const deepsight = this.deepsightService;
802
424
  if (!deepsight) return;
803
425
  try {
804
- const { stream } = await this.acquireRawStream();
805
- const [videoTrack] = stream.getVideoTracks();
426
+ const [videoTrack] = displayStream.getVideoTracks();
806
427
  if (videoTrack) await deepsight.checkVirtualCamera(videoTrack);
807
428
  } catch {
808
429
  trueSightLog("warning", "deepsight", "faceScan", "protected camera metadata attachment failed");
@@ -819,13 +440,6 @@ var ProtectedFaceAttemptRuntime = class ProtectedFaceAttemptRuntime {
819
440
  if (this.signalListener) this.signalListener(signal);
820
441
  else this.pendingSignals.push(signal);
821
442
  }
822
- releaseRawStream(stream) {
823
- if (this.rawHandedOff || this.rawStreamReleased) return;
824
- this.rawStreamReleased = true;
825
- try {
826
- stopStream(stream);
827
- } catch {}
828
- }
829
443
  };
830
444
  //#endregion
831
445
  //#region src/internal/faceCapture/protectedFaceController.ts
@@ -878,8 +492,9 @@ function createProtectedFaceControllerActor(options) {
878
492
  const input = getControllerInput();
879
493
  const pending = (async () => {
880
494
  const wasmUtil = await input.dependencies.getWasmUtil();
495
+ const recordingModule = await import("./recordingService-DK3kjUby.esm.js");
881
496
  if (!active) return;
882
- stepRecording ??= createRecordingService({
497
+ stepRecording ??= recordingModule.createRecordingService({
883
498
  config: input.config,
884
499
  wasmUtil,
885
500
  sessionToken: getToken(),
@@ -921,10 +536,7 @@ function createProtectedFaceControllerActor(options) {
921
536
  authHint: input.authHint,
922
537
  faceDetection: capabilities.faceDetection,
923
538
  cycle: capabilities.cycle,
924
- acquireCamera: (provider) => initializeCamera({
925
- config: input.config,
926
- provider
927
- }),
539
+ probeCamera: () => probeFaceCamera(input.config),
928
540
  getRecordingService: getStepRecordingService
929
541
  });
930
542
  if (deepsightService) runtime.setDeepsightService(deepsightService);
@@ -1068,7 +680,8 @@ function createProtectedFaceControllerActor(options) {
1068
680
  case "PROTECTED_ATTEMPT_FAILED":
1069
681
  logDiagnostic("attempt-failed", {
1070
682
  failureStage: event.failure.stage,
1071
- failureCode: event.failure.code
683
+ failureCode: event.failure.code,
684
+ errorName: event.failure.errorName
1072
685
  });
1073
686
  noteTrueSightCaptureActivity(false);
1074
687
  sendBack(event);
@@ -1204,6 +817,7 @@ function createDefaultProtectedFaceControllerActor(options) {
1204
817
  }
1205
818
  //#endregion
1206
819
  //#region src/internal/faceCapture/faceCaptureSetup.ts
820
+ const DEEPSIGHT_INITIALIZATION_FAILED_CODE = "DEEPSIGHT_INITIALIZATION_FAILED";
1207
821
  const getAttemptsFromConfig = (config) => {
1208
822
  return config.captureAttempts ?? config.numberOfAttempts ?? 3;
1209
823
  };
@@ -1241,6 +855,7 @@ const faceCaptureMachine = setup({
1241
855
  target: PROTECTED_CAPTURE_TARGET.selfie,
1242
856
  delivery: "protected"
1243
857
  }),
858
+ deepsightSignalConfig: deepsightSignalConfigActor,
1244
859
  runAvatar: fromCallback(({ input, sendBack }) => {
1245
860
  const { obfuscateWithAvatar, avatarVariant } = concealmentToAvatar(input.config.selfieConcealmentOption);
1246
861
  if (!obfuscateWithAvatar || !input.stream) return () => {};
@@ -1312,7 +927,9 @@ const faceCaptureMachine = setup({
1312
927
  processResponse: void 0,
1313
928
  attemptsRemaining: getAttemptsFromConfig(context.config),
1314
929
  uploadError: void 0,
930
+ userNotRecognized: void 0,
1315
931
  permissionResult: void 0,
932
+ retryDeniedMotionPermission: false,
1316
933
  deepsightReady: false,
1317
934
  manualCaptureTriggered: false,
1318
935
  retainManualMode: false,
@@ -1336,7 +953,7 @@ const faceCaptureMachine = setup({
1336
953
  setUploadErrorFromUploadValidation: assign({ uploadError: () => FACE_ERROR_CODES.SERVER }),
1337
954
  setTerminalError: assign({ error: () => "Authentication failed" }),
1338
955
  cleanup: () => void 0,
1339
- setPermissionResultFromEvent: assign({ permissionResult: ({ event }) => event.output }),
956
+ setPermissionResultFromEvent: assign({ permissionResult: ({ context, event }) => resolveStoredPermissionResult(event.output, context.permissionResult) }),
1340
957
  setPermissionDenied: assign({ permissionResult: () => "denied" }),
1341
958
  setPermissionPrompt: assign({ permissionResult: () => "prompt" }),
1342
959
  setPermissionRefresh: assign({ permissionResult: () => "refresh" }),
@@ -1470,10 +1087,13 @@ const faceCaptureMachine = setup({
1470
1087
  return false;
1471
1088
  },
1472
1089
  isReadyForCapture: ({ context, event }) => {
1473
- return isReadyForCaptureFromPermission(resolveStoredPermissionResult("output" in event ? event.output : void 0, context.permissionResult), context.config.ds);
1090
+ return isReadyForCaptureFromPermission(resolveStoredPermissionResult("output" in event ? event.output : void 0, context.permissionResult), wantsDeepsightMotion(context.config));
1474
1091
  },
1475
1092
  needsMotionPrimeOnly: ({ context, event }) => {
1476
- return needsMotionPrimeOnlyFromPermission(resolveStoredPermissionResult("output" in event ? event.output : void 0, context.permissionResult), context.config.ds);
1093
+ return needsMotionPrimeOnlyFromPermission(resolveStoredPermissionResult("output" in event ? event.output : void 0, context.permissionResult), wantsDeepsightMotion(context.config));
1094
+ },
1095
+ needsMotionPrimeWithoutGesture: ({ context, event }) => {
1096
+ return needsMotionPrimeOnlyFromPermission(resolveStoredPermissionResult("output" in event ? event.output : void 0, context.permissionResult), wantsDeepsightMotion(context.config)) && canPrimeMotionWithoutUserGesture();
1477
1097
  },
1478
1098
  isPermissionDeniedError: ({ event }) => {
1479
1099
  if ("error" in event) {
@@ -1485,11 +1105,16 @@ const faceCaptureMachine = setup({
1485
1105
  hasStream: ({ context }) => context.stream !== void 0,
1486
1106
  isCameraAndDeepsightReady: ({ context }) => context.stream !== void 0 && context.deepsightReady,
1487
1107
  hasAttemptsRemaining: ({ context }) => context.attemptsRemaining > 0,
1108
+ isOutOfAttempts: ({ context }) => context.attemptsRemaining <= 0 && context.attemptsRemaining < getAttemptsFromConfig(context.config),
1488
1109
  hasCapturedImage: ({ context }) => context.capturedImage !== void 0,
1489
1110
  isAutoCaptureAllowed: ({ context }) => !context.retainManualMode,
1490
1111
  canCommitProtectedManual: ({ context }) => context.manualCaptureTriggered && context.config.onDeviceFaceResultsSubmissionEnabled !== true,
1491
1112
  isProtectedManualRefusal: ({ event }) => event.failure.stage === "manualCommit",
1492
1113
  isProtectedUploadFailure: ({ event }) => event.failure.stage === "upload",
1114
+ isProtectedAcquireDenied: ({ event }) => {
1115
+ const { failure } = event;
1116
+ return failure.stage === "acquire" && isCameraDenialErrorName(failure.errorName);
1117
+ },
1493
1118
  hasUploadValidationError: () => false,
1494
1119
  isTerminalUploadError: () => false,
1495
1120
  isNoAttemptsTerminal: () => false
@@ -1498,35 +1123,47 @@ const faceCaptureMachine = setup({
1498
1123
  id: "faceCapture",
1499
1124
  initial: "idle",
1500
1125
  entry: "bindProtectedFaceController",
1501
- context: ({ input }) => ({
1502
- config: input.config,
1503
- dependencies: input.dependencies,
1504
- authHint: input.authHint,
1505
- stream: void 0,
1506
- usingBackCamera: false,
1507
- error: void 0,
1508
- detectionStatus: "idle",
1509
- capturedImage: void 0,
1510
- faceCoordinates: void 0,
1511
- uploadResponse: void 0,
1512
- processResponse: void 0,
1513
- attemptsRemaining: getAttemptsFromConfig(input.config),
1514
- uploadError: void 0,
1515
- permissionResult: void 0,
1516
- deepsightReady: false,
1517
- encryptedBase64Image: void 0,
1518
- uploadRecordingId: void 0,
1519
- manualCaptureTriggered: false,
1520
- retainManualMode: false,
1521
- captureOnlyResult: void 0,
1522
- avatarCanvas: void 0,
1523
- faceFeed: void 0,
1524
- protectedVisible: true
1525
- }),
1526
- invoke: {
1126
+ context: ({ input, self }) => {
1127
+ const carried = carryAttempts("faceCapture", self, (s) => ({
1128
+ attemptsRemaining: s.context.attemptsRemaining,
1129
+ userNotRecognized: s.context.userNotRecognized
1130
+ }));
1131
+ return {
1132
+ config: input.config,
1133
+ dependencies: input.dependencies,
1134
+ authHint: input.authHint,
1135
+ stream: void 0,
1136
+ usingBackCamera: false,
1137
+ error: void 0,
1138
+ detectionStatus: "idle",
1139
+ capturedImage: void 0,
1140
+ faceCoordinates: void 0,
1141
+ uploadResponse: void 0,
1142
+ processResponse: void 0,
1143
+ attemptsRemaining: carried.attemptsRemaining ?? getAttemptsFromConfig(input.config),
1144
+ uploadError: void 0,
1145
+ userNotRecognized: carried.userNotRecognized,
1146
+ permissionResult: void 0,
1147
+ retryDeniedMotionPermission: false,
1148
+ deepsightReady: false,
1149
+ encryptedBase64Image: void 0,
1150
+ uploadRecordingId: void 0,
1151
+ manualCaptureTriggered: false,
1152
+ retainManualMode: false,
1153
+ captureOnlyResult: void 0,
1154
+ avatarCanvas: void 0,
1155
+ faceFeed: void 0,
1156
+ protectedVisible: true
1157
+ };
1158
+ },
1159
+ invoke: [{
1527
1160
  id: "protectedFaceController",
1528
1161
  src: "protectedFaceController"
1529
- },
1162
+ }, {
1163
+ id: "deepsightSignalConfig",
1164
+ src: "deepsightSignalConfig",
1165
+ input: ({ context }) => context.config
1166
+ }],
1530
1167
  on: {
1531
1168
  QUIT: { target: "#faceCapture.closed" },
1532
1169
  PROTECTED_VISIBILITY: { actions: "setProtectedVisibility" },
@@ -1535,6 +1172,10 @@ const faceCaptureMachine = setup({
1535
1172
  },
1536
1173
  states: {
1537
1174
  idle: { on: { LOAD: [
1175
+ {
1176
+ target: "outOfAttempts",
1177
+ guard: "isOutOfAttempts"
1178
+ },
1538
1179
  {
1539
1180
  target: "tutorial",
1540
1181
  guard: "hasShowTutorial"
@@ -1726,6 +1367,11 @@ const faceCaptureMachine = setup({
1726
1367
  guard: ({ event }) => event.output === "denied",
1727
1368
  actions: "setPermissionResultFromEvent"
1728
1369
  },
1370
+ {
1371
+ target: "requesting",
1372
+ guard: "needsMotionPrimeWithoutGesture",
1373
+ actions: "setPermissionResultFromEvent"
1374
+ },
1729
1375
  {
1730
1376
  target: "motionOnly",
1731
1377
  guard: "needsMotionPrimeOnly",
@@ -1755,32 +1401,45 @@ const faceCaptureMachine = setup({
1755
1401
  BACK: "idle",
1756
1402
  REQUEST_PERMISSION: "requesting"
1757
1403
  } },
1758
- requesting: { invoke: {
1759
- id: "requestPermission",
1760
- src: "requestPermission",
1761
- input: ({ context }) => ({
1762
- permissionResult: context.permissionResult === "refresh" ? void 0 : context.permissionResult,
1763
- requestMotionPermission: context.config.ds === true
1764
- }),
1765
- onDone: [
1766
- {
1767
- target: "#faceCapture.capture",
1768
- guard: "isReadyForCapture",
1769
- actions: "setPermissionResultFromEvent"
1770
- },
1771
- {
1772
- target: "denied",
1773
- guard: ({ event }) => event.output === "denied",
1774
- actions: "setPermissionResultFromEvent"
1775
- },
1776
- {
1777
- target: "waitingForUser",
1778
- actions: "setPermissionResultFromEvent"
1779
- }
1780
- ],
1781
- onError: { target: "denied" }
1782
- } },
1783
- denied: { entry: "setPermissionRefresh" }
1404
+ requesting: {
1405
+ exit: assign({ retryDeniedMotionPermission: false }),
1406
+ invoke: {
1407
+ id: "requestPermission",
1408
+ src: "requestPermission",
1409
+ input: ({ context }) => ({
1410
+ permissionResult: context.permissionResult === "refresh" ? void 0 : context.permissionResult,
1411
+ requestMotionPermission: wantsDeepsightMotion(context.config),
1412
+ retryDeniedMotionPermission: context.retryDeniedMotionPermission,
1413
+ requestAudio: requestsFaceSessionAudio(context.config)
1414
+ }),
1415
+ onDone: [
1416
+ {
1417
+ target: "motionDenied",
1418
+ guard: ({ event }) => event.output === "motionDenied"
1419
+ },
1420
+ {
1421
+ target: "#faceCapture.capture",
1422
+ guard: "isReadyForCapture",
1423
+ actions: "setPermissionResultFromEvent"
1424
+ },
1425
+ {
1426
+ target: "denied",
1427
+ guard: ({ event }) => event.output === "denied",
1428
+ actions: "setPermissionResultFromEvent"
1429
+ },
1430
+ {
1431
+ target: "waitingForUser",
1432
+ actions: "setPermissionResultFromEvent"
1433
+ }
1434
+ ],
1435
+ onError: { target: "denied" }
1436
+ }
1437
+ },
1438
+ denied: { entry: "setPermissionRefresh" },
1439
+ motionDenied: { on: { REQUEST_PERMISSION: {
1440
+ target: "requesting",
1441
+ actions: assign({ retryDeniedMotionPermission: true })
1442
+ } } }
1784
1443
  }
1785
1444
  },
1786
1445
  capture: {
@@ -1809,6 +1468,11 @@ const faceCaptureMachine = setup({
1809
1468
  guard: "isProtectedUploadFailure",
1810
1469
  actions: "setUploadFailureAndDecrement"
1811
1470
  },
1471
+ {
1472
+ target: "#faceCapture.permissions.denied",
1473
+ guard: "isProtectedAcquireDenied",
1474
+ actions: "setPermissionDenied"
1475
+ },
1812
1476
  {
1813
1477
  target: "#faceCapture.error",
1814
1478
  actions: "setProtectedFailure"
@@ -1832,7 +1496,11 @@ const faceCaptureMachine = setup({
1832
1496
  target: "#faceCapture.error",
1833
1497
  actions: assign({
1834
1498
  deepsightReady: () => false,
1835
- error: () => "Deepsight initialization failed"
1499
+ error: () => ({
1500
+ type: DEEPSIGHT_INITIALIZATION_FAILED_CODE,
1501
+ message: "Deepsight initialization failed",
1502
+ moduleErrorCode: DEEPSIGHT_INITIALIZATION_FAILED_CODE
1503
+ })
1836
1504
  })
1837
1505
  }
1838
1506
  }
@@ -1952,6 +1620,14 @@ const faceCaptureMachine = setup({
1952
1620
  },
1953
1621
  onError: { target: "finished" }
1954
1622
  } },
1623
+ outOfAttempts: { always: [{
1624
+ target: "error",
1625
+ guard: "isNoAttemptsTerminal",
1626
+ actions: "setTerminalError"
1627
+ }, {
1628
+ target: "terminalProcessing",
1629
+ actions: "flagFaceManualReview"
1630
+ }] },
1955
1631
  terminalProcessing: {
1956
1632
  entry: ["completeProtectedRecording", "cleanup"],
1957
1633
  invoke: {