@incodetech/core 2.2.0 → 2.3.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (258) hide show
  1. package/THIRD_PARTY_NOTICES.txt +281 -0
  2. package/dist/BaseWasmProvider-Dyi6dKp1.d.ts +65 -0
  3. package/dist/{BrowserDiagnosticsCryptoProvider-B8vorxN5.esm.js → BrowserDiagnosticsCryptoProvider-CU6kBvqv.esm.js} +1 -1
  4. package/dist/{BrowserVisibilityObserverProvider-BX1BiLDK.esm.js → BrowserVisibilityObserverProvider-BrJN1B8A.esm.js} +2 -0
  5. package/dist/FaceDetectionProvider-BfhWkK90.esm.js +431 -0
  6. package/dist/FaceDetectionProvider-LdZ47bWy.d.ts +36 -0
  7. package/dist/{IIdCaptureCapability-DHTT3FC2.d.ts → IIdCaptureCapability-RNiFhvXR.d.ts} +7 -33
  8. package/dist/IWasmUtilCapability-CNWRl7jr.d.ts +117 -0
  9. package/dist/{MotionSensorProvider-DGiV77J_.esm.js → MotionSensorProvider-BgTYwg9L.esm.js} +1 -1
  10. package/dist/{StreamCanvasCapture-D2XcXCZ4.esm.js → StreamCanvasCapture-C9jtgBdT.esm.js} +2 -2
  11. package/dist/{deepsightService-DLVQS_RH.d.ts → StreamCanvasCapture-_8gdW5Lk.d.ts} +54 -41
  12. package/dist/StreamCanvasProcessingSession-CBnbTnOr.esm.js +42 -0
  13. package/dist/{addressSearch-D1XpBdUS.esm.js → addressSearch-DyHGgeX8.esm.js} +1 -1
  14. package/dist/advanceableErrors-CpF2cBy6.esm.js +21 -0
  15. package/dist/ae-signature.d.ts +4 -2
  16. package/dist/ae-signature.esm.js +1 -1
  17. package/dist/antifraud.esm.js +2 -2
  18. package/dist/{antifraudManager-CQFNgSPt.esm.js → antifraudManager-DNkw66oW.esm.js} +2 -2
  19. package/dist/{antifraudStateMachine-Bf_JVNwn.esm.js → antifraudStateMachine-DBeq47D2.esm.js} +1 -1
  20. package/dist/{apiError-BA1d_au0.esm.js → apiError-Budb6m6w.esm.js} +14 -2
  21. package/dist/authentication.d.ts +3 -3
  22. package/dist/authentication.esm.js +2 -2
  23. package/dist/{authenticationManager-BBMGTcwW.d.ts → authenticationManager-CjXBjC-c.d.ts} +7 -1
  24. package/dist/{authenticationManager-zh9TC62P.esm.js → authenticationManager-cMXhG70r.esm.js} +5 -5
  25. package/dist/{authenticationStateMachine-xzi-vnvE.esm.js → authenticationStateMachine-MOYz4HCf.esm.js} +6 -62
  26. package/dist/avatar.d.ts +1 -2
  27. package/dist/avatar.esm.js +1 -1
  28. package/dist/{backCameraStream-CUeYm5eu.esm.js → backCameraStream-BOtyQowf.esm.js} +83 -22
  29. package/dist/{camera-_2sXMXiF.esm.js → camera-sIa9ceW2.esm.js} +19 -1
  30. package/dist/camera.esm.js +1 -1
  31. package/dist/{canvas-E1zGkel4.esm.js → canvas-BxFzWTt-.esm.js} +19 -0
  32. package/dist/certificate-issuance.d.ts +2 -302
  33. package/dist/certificate-issuance.esm.js +3 -66
  34. package/dist/certificateIssuanceManager-C3-CI0_s.esm.js +69 -0
  35. package/dist/certificateIssuanceManager-DCgEidHz.d.ts +312 -0
  36. package/dist/{certificateIssuanceStateMachine-D_R92TYu.esm.js → certificateIssuanceStateMachine-CxqS_nD-.esm.js} +1 -1
  37. package/dist/consent.d.ts +1 -1
  38. package/dist/consent.esm.js +2 -2
  39. package/dist/{consentManager-BxjpLZAG.esm.js → consentManager-B6E1XJDw.esm.js} +2 -2
  40. package/dist/{consentManager-3Pbtj-RV.d.ts → consentManager-BhYFeKiG.d.ts} +4 -4
  41. package/dist/{consentStateMachine-D9D4ON8Z.esm.js → consentStateMachine-DTSfdGiW.esm.js} +1 -1
  42. package/dist/createCameraCycleOwnership-CX3hJGKc.esm.js +826 -0
  43. package/dist/{createFaceAvatar-DQKaRise.esm.js → createFaceAvatar-BNHdeFj8.esm.js} +2 -2
  44. package/dist/createFaceAvatar-BlcTYgJv.d.ts +497 -0
  45. package/dist/cross-document-data-match.esm.js +1 -1
  46. package/dist/{crossDocumentDataMatchManager-CGT0V6RV.esm.js → crossDocumentDataMatchManager-9XhFVZ5S.esm.js} +2 -2
  47. package/dist/curp-validation.d.ts +1 -1
  48. package/dist/curp-validation.esm.js +2 -2
  49. package/dist/{curpValidationManager-6Nmkn5u1.esm.js → curpValidationManager-DbIMYFcJ.esm.js} +2 -2
  50. package/dist/{curpValidationManager-DVGr7Fq7.d.ts → curpValidationManager-SSKNrm5Z.d.ts} +1 -1
  51. package/dist/{curpValidationStateMachine-Ds7KMacK.esm.js → curpValidationStateMachine-g5kMfuLj.esm.js} +1 -1
  52. package/dist/custom-fields.d.ts +2 -114
  53. package/dist/custom-fields.esm.js +2 -232
  54. package/dist/custom-watchlist.d.ts +2 -51
  55. package/dist/custom-watchlist.esm.js +3 -70
  56. package/dist/customFieldsManager-8-W2KY4n.d.ts +141 -0
  57. package/dist/customFieldsManager-CzWZTkW-.esm.js +264 -0
  58. package/dist/customWatchlistManager-DWTED5Ur.esm.js +73 -0
  59. package/dist/customWatchlistManager-PBWHr_oM.d.ts +64 -0
  60. package/dist/{customWatchlistStateMachine-YWSgKLbF.esm.js → customWatchlistStateMachine-DOQou6TW.esm.js} +1 -1
  61. package/dist/{deepsightLoader--wMKWECS.esm.js → deepsightLoader-DDv3vhXU.esm.js} +27 -71
  62. package/dist/device.d.ts +25 -2
  63. package/dist/device.esm.js +69 -7
  64. package/dist/document-capture.d.ts +2 -2
  65. package/dist/document-capture.esm.js +2 -2
  66. package/dist/{documentCaptureManager-DsQQhWry.esm.js → documentCaptureManager-CwAiM9WY.esm.js} +2 -2
  67. package/dist/{documentCaptureManager-B3t0ydtg.d.ts → documentCaptureManager-DensIj5F.d.ts} +83 -83
  68. package/dist/{documentCaptureStateMachine-BM4Ex_5x.esm.js → documentCaptureStateMachine-DfGOBapD.esm.js} +5 -5
  69. package/dist/dynamic-forms.d.ts +1 -1
  70. package/dist/dynamic-forms.esm.js +2 -2
  71. package/dist/{dynamicFormsManager-fFVIRBNv.esm.js → dynamicFormsManager-BbS-XMFc.esm.js} +16 -5
  72. package/dist/{dynamicFormsManager-fhK0yINk.d.ts → dynamicFormsManager-D5R_uxLQ.d.ts} +25 -3
  73. package/dist/{dynamicFormsStateMachine-D6D7oEYk.esm.js → dynamicFormsStateMachine-D8zHBCh4.esm.js} +35 -3
  74. package/dist/ekyb.d.ts +1 -1
  75. package/dist/ekyb.esm.js +3 -3
  76. package/dist/{ekybManager-Y3MkoXpC.esm.js → ekybManager-5aiac8wL.esm.js} +2 -2
  77. package/dist/{ekybStateMachine-3nlnqdlr.esm.js → ekybStateMachine-Bn2IE9rx.esm.js} +3 -3
  78. package/dist/ekyc.esm.js +2 -2
  79. package/dist/{ekycManager-DgT48ky6.esm.js → ekycManager-BlQ-Qj4E.esm.js} +2 -2
  80. package/dist/{ekycStateMachine-CQwqiR-R.esm.js → ekycStateMachine-CshSNJhh.esm.js} +2 -2
  81. package/dist/electronic-signature.d.ts +3 -3
  82. package/dist/electronic-signature.esm.js +2 -2
  83. package/dist/{electronicSignatureManager-DGbAJ00W.esm.js → electronicSignatureManager-BJJH0Tvi.esm.js} +357 -51
  84. package/dist/electronicSignatureManager-Ds-KEVTq.d.ts +2786 -0
  85. package/dist/email.esm.js +2 -2
  86. package/dist/{emailManager-BY0jeYwR.esm.js → emailManager-bR1N5rV_.esm.js} +2 -2
  87. package/dist/{emailStateMachine-Crw8QVmc.esm.js → emailStateMachine-Bc_6oIYw.esm.js} +1 -1
  88. package/dist/{endpoints-CCzL3XD_.esm.js → endpoints-B-3Q-LUw.esm.js} +24 -10
  89. package/dist/{events-DYiyoSlx.esm.js → events-ijlbX_Wx.esm.js} +2 -2
  90. package/dist/events.d.ts +1 -1
  91. package/dist/events.esm.js +1 -1
  92. package/dist/extensibility.d.ts +24 -64
  93. package/dist/extensibility.esm.js +35 -29
  94. package/dist/face-match.esm.js +2 -2
  95. package/dist/{faceCaptureManagerFactory-CVnZ0fa5.esm.js → faceCaptureManagerFactory-B7Ms6pSs.esm.js} +68 -7
  96. package/dist/{faceCaptureManagerFactory-BxWPpxyd.d.ts → faceCaptureManagerFactory-BeUl8fl1.d.ts} +86 -54
  97. package/dist/faceCaptureSetup-bkAlr5d8.esm.js +2067 -0
  98. package/dist/{faceMatchManager-Ri4UbNz0.esm.js → faceMatchManager-Bmv0HzuY.esm.js} +2 -2
  99. package/dist/{faceMatchStateMachine-20DdZ3jg.esm.js → faceMatchStateMachine-mRIHQ3dA.esm.js} +1 -1
  100. package/dist/{feature-management-CPQ4qv3F.esm.js → feature-management-E0mq0pMs.esm.js} +32 -7
  101. package/dist/feature-management.d.ts +1 -1
  102. package/dist/feature-management.esm.js +1 -1
  103. package/dist/field-comparison.esm.js +1 -1
  104. package/dist/{fieldComparisonManager-Cg6kPQQx.esm.js → fieldComparisonManager-CC-klG0h.esm.js} +2 -2
  105. package/dist/fiscal-qr.d.ts +2 -56
  106. package/dist/fiscal-qr.esm.js +2 -308
  107. package/dist/fiscalQrManager-B1STmT6z.d.ts +71 -0
  108. package/dist/fiscalQrManager-BunLVFbd.esm.js +34143 -0
  109. package/dist/flow-events.d.ts +1 -1
  110. package/dist/flow.d.ts +212 -185
  111. package/dist/flow.esm.js +119 -30
  112. package/dist/{flowCompletionService-tfeoGre9.esm.js → flowCompletionService-DJp1odGN.esm.js} +2 -2
  113. package/dist/{flowServices-f5Ruz7R9.esm.js → flowServices-DjPFGs_D.esm.js} +91 -26
  114. package/dist/geolocation.esm.js +2 -2
  115. package/dist/{geolocationManager-CH6RfqFH.esm.js → geolocationManager-D5906YXx.esm.js} +2 -2
  116. package/dist/{geolocationStateMachine-DmbWFely.esm.js → geolocationStateMachine-BVOduc3y.esm.js} +3 -3
  117. package/dist/getBrowser-CBiibsL-.esm.js +19 -0
  118. package/dist/{getBrowser-DNrQeL4T.esm.js → getBrowser-Cbe1C4Tn.esm.js} +2 -1
  119. package/dist/{getDeviceClass-9y-kbVDw.esm.js → getDeviceClass-5NYZg9s6.esm.js} +2 -2
  120. package/dist/getParsedUserAgent-B2iFDql1.esm.js +1278 -0
  121. package/dist/government-validation.d.ts +2 -85
  122. package/dist/government-validation.esm.js +3 -120
  123. package/dist/governmentValidationManager-CacFOtKO.esm.js +79 -0
  124. package/dist/governmentValidationManager-D02vT4yY.d.ts +63 -0
  125. package/dist/governmentValidationStateMachine-CoaZOSTP.esm.js +54 -0
  126. package/dist/home.d.ts +1 -1
  127. package/dist/home.esm.js +1 -1
  128. package/dist/id-ocr.d.ts +2 -2
  129. package/dist/id-ocr.esm.js +2 -2
  130. package/dist/id-selfie-flow.d.ts +3 -2
  131. package/dist/id-selfie-flow.esm.js +11 -10
  132. package/dist/id-verification.esm.js +2 -2
  133. package/dist/id.d.ts +29 -5
  134. package/dist/id.esm.js +48 -46
  135. package/dist/idCaptureDefaults-CbPA-Auz.esm.js +727 -0
  136. package/dist/{idCaptureManager-CqrqSjJV.d.ts → idCaptureManager-DKESug0R.d.ts} +230 -43
  137. package/dist/{idCaptureManager-BYwTZ2H8.esm.js → idCaptureManager-rfV9dIXy.esm.js} +259 -46
  138. package/dist/{idCaptureServices-44kwQItl.esm.js → idCaptureServices-i1KxugN7.esm.js} +285 -72
  139. package/dist/idCaptureStateMachine-Ne_PXth_.esm.js +5333 -0
  140. package/dist/{idOcrManager-DXc_xRN7.d.ts → idOcrManager-BF_cXZq8.d.ts} +1 -1
  141. package/dist/{idOcrManager-BIQYQXXj.esm.js → idOcrManager-r46XfZGE.esm.js} +2 -2
  142. package/dist/{idOcrStateMachine-cSxzHpHt.esm.js → idOcrStateMachine-ClDEP-VI.esm.js} +1 -1
  143. package/dist/{idVerificationManager-JpV_SAsl.esm.js → idVerificationManager-DT42c77H.esm.js} +2 -2
  144. package/dist/{idVerificationStateMachine-nPeUNyFq.esm.js → idVerificationStateMachine-DbDVIh9t.esm.js} +1 -1
  145. package/dist/identity-reuse.esm.js +2 -2
  146. package/dist/{identityReuseManager-kNCg9AbD.esm.js → identityReuseManager-yG3acUrQ.esm.js} +2 -2
  147. package/dist/{identityReuseStateMachine-DyulxDjP.esm.js → identityReuseStateMachine-BhAkuIra.esm.js} +1 -1
  148. package/dist/{index-CLMF0QLQ.d.ts → index-DLcJT5YP.d.ts} +1 -1
  149. package/dist/index.d.ts +1 -1
  150. package/dist/index.esm.js +1 -1
  151. package/dist/{invokeOnCaptureCallback-GpvMuz9o.esm.js → invokeOnCaptureCallback-BjzPjJ_p.esm.js} +1 -1
  152. package/dist/mandatory-consent.d.ts +2 -2
  153. package/dist/mandatory-consent.esm.js +2 -2
  154. package/dist/{mandatoryConsentManager-B4Niyg_u.esm.js → mandatoryConsentManager-7dI0D08q.esm.js} +2 -2
  155. package/dist/{mandatoryConsentManager-DyPzUmsZ.d.ts → mandatoryConsentManager-vhv1co_n.d.ts} +1 -1
  156. package/dist/{mandatoryConsentStateMachine-B4-1u-L8.esm.js → mandatoryConsentStateMachine-DC5Mo6M1.esm.js} +1 -1
  157. package/dist/multipartRecordingService-OEgIRvqC.esm.js +605 -0
  158. package/dist/{permissionGuards-KINpmKtI.esm.js → permissionGuards-uYZYFu4J.esm.js} +1 -1
  159. package/dist/{permissionServices-UvUcOSRb.esm.js → permissionServices-Bj_fyWtv.esm.js} +5 -5
  160. package/dist/personhood.d.ts +6 -5
  161. package/dist/personhood.esm.js +10 -10
  162. package/dist/phone.esm.js +2 -2
  163. package/dist/{phoneManager-FsJ0W2Ei.esm.js → phoneManager-IjhSv5XS.esm.js} +2 -2
  164. package/dist/{phoneStateMachine-Ba0wKHyX.esm.js → phoneStateMachine-CXdXufKg.esm.js} +1 -1
  165. package/dist/{platform-BJrm5nzZ.esm.js → platform-DkcRc9JV.esm.js} +29 -1
  166. package/dist/qe-signature.d.ts +5 -3
  167. package/dist/qe-signature.esm.js +2 -2
  168. package/dist/redirect-to-mobile.esm.js +2 -2
  169. package/dist/{redirectToMobileManager-y4VQB11M.esm.js → redirectToMobileManager-FLEWJtv8.esm.js} +2 -2
  170. package/dist/{redirectToMobileStateMachine-Cyv2x0PP.esm.js → redirectToMobileStateMachine-CSWWgUTO.esm.js} +1 -1
  171. package/dist/{rolldown-runtime-FZ4Itg2g.esm.js → rolldown-runtime-FDOR9p9I.esm.js} +1 -19
  172. package/dist/{runChildModule-Dukuw23X.esm.js → runChildModule-CI1gGWN1.esm.js} +3 -21
  173. package/dist/safeStorage-B-trhxg6.esm.js +423 -0
  174. package/dist/{sdkVersion-D1Bm59g6.esm.js → sdkVersion-BZh6dj53.esm.js} +1 -1
  175. package/dist/selfie.d.ts +5 -5
  176. package/dist/selfie.esm.js +14 -76
  177. package/dist/{selfieErrorUtils-C2PYBVsp.esm.js → selfieErrorUtils-UiQ46EBa.esm.js} +30 -4
  178. package/dist/{selfieManager-DwlCppg0.d.ts → selfieManager-4RRLi21P.d.ts} +8 -11
  179. package/dist/{selfieManager-Bj6B2ZVy.esm.js → selfieManager-B-2c1n_x.esm.js} +5 -5
  180. package/dist/selfieStateMachine-Bzx41R8d.esm.js +69 -0
  181. package/dist/{session-BFdLgN4i.esm.js → session-3LmvAU4S.esm.js} +4 -5
  182. package/dist/session.d.ts +21 -11
  183. package/dist/session.esm.js +5 -5
  184. package/dist/{sessionInitializer-dlfDehHk.esm.js → sessionInitializer-BFk33E67.esm.js} +187 -68
  185. package/dist/{setup-BIAtLa8k.esm.js → setup-BWG-hivt.esm.js} +226 -100
  186. package/dist/{setup-BgoWtvIS.d.ts → setup-Cv-JM9QC.d.ts} +63 -69
  187. package/dist/signature.esm.js +2 -2
  188. package/dist/{signatureManager-Ca43yhwk.esm.js → signatureManager-B72np4ZO.esm.js} +2 -2
  189. package/dist/{signatureStateMachine-K1LMRrxG.esm.js → signatureStateMachine-ce_XMA3l.esm.js} +1 -1
  190. package/dist/{src-0Jurt29N.esm.js → src-35ekGRzK.esm.js} +1 -1
  191. package/dist/{stats-B0nFKawG.esm.js → stats-CZcy2J53.esm.js} +1 -1
  192. package/dist/stats.esm.js +1 -1
  193. package/dist/{trueSightService---iW2KKJ.esm.js → trueSightService-BN-Hzw82.esm.js} +7 -7
  194. package/dist/trust-graph.esm.js +1 -1
  195. package/dist/{types-BX_XkMsQ2.d.ts → types-9_esGTPj.d.ts} +1 -1
  196. package/dist/types-BT_Oalip.d.ts +1 -0
  197. package/dist/{types-DelMqZLe.d.ts → types-BjSly8cp.d.ts} +1 -1
  198. package/dist/{types-Hmd7U0JA.d.ts → types-Bnl58jUQ.d.ts} +6 -85
  199. package/dist/types-ChAowIxT.d.ts +6 -0
  200. package/dist/{types-DVmXIdzW.d.ts → types-D0gekt4U.d.ts} +38 -5
  201. package/dist/types-DgDvvzg0.d.ts +10 -0
  202. package/dist/{types-KPvmag_B.d.ts → types-Do5rEXij.d.ts} +7 -4
  203. package/dist/{types-Bdf8_LYB2.d.ts → types-byBHOzCG2.d.ts} +305 -25
  204. package/dist/video-selfie.d.ts +59 -35
  205. package/dist/video-selfie.esm.js +510 -601
  206. package/dist/{videoSelfieCameraWarmer-NEhFZvWx.esm.js → videoSelfieCameraWarmer-B8PcYqmz.esm.js} +14 -153
  207. package/dist/videoSelfieFlowModuleMachine-BUe2uACW.esm.js +32 -0
  208. package/dist/{videoSelfieStepDetector-D3oo2ofo.d.ts → videoSelfieStepDetector-Co0Gu2k2.d.ts} +59 -13
  209. package/dist/virtualCameraCheck-Cjab7FTI.esm.js +48 -0
  210. package/dist/warmup-CUUnwYxe.esm.js +714 -0
  211. package/dist/warmup-Cis2p6O0.d.ts +128 -0
  212. package/dist/wasm.d.ts +30 -6
  213. package/dist/wasm.esm.js +36 -4
  214. package/dist/{wasmDsFlagSync-BqUCwLY8.esm.js → wasmDsFlagSync-B2e8p268.esm.js} +2 -2
  215. package/dist/{wasmWebClient-DM8lkb0z.esm.js → wasmWebClient-B7baE-Wf.esm.js} +358 -28
  216. package/dist/watchlist-for-business.d.ts +2 -78
  217. package/dist/watchlist-for-business.esm.js +3 -102
  218. package/dist/watchlist.esm.js +2 -2
  219. package/dist/watchlistForBusinessManager-CIMkpEhu.esm.js +107 -0
  220. package/dist/watchlistForBusinessManager-CsnJnG-C.d.ts +99 -0
  221. package/dist/{watchlistForBusinessStateMachine-CxFnlshm.esm.js → watchlistForBusinessStateMachine-CJ-MvUre.esm.js} +13 -6
  222. package/dist/{watchlistManager-LoNZH9qm.esm.js → watchlistManager-CixcLNDT.esm.js} +2 -2
  223. package/dist/{watchlistStateMachine-DIKQDoUT.esm.js → watchlistStateMachine-CBqk2w-h.esm.js} +1 -1
  224. package/dist/workflow.d.ts +12 -8
  225. package/dist/workflow.esm.js +48 -39
  226. package/package.json +4 -10
  227. package/dist/BrowserStorageProvider-k-FDkC4W.esm.js +0 -67
  228. package/dist/FaceDetectionProvider-Mh6q3EbA.d.ts +0 -349
  229. package/dist/IFaceAvatarCapability-BrL19G0s.d.ts +0 -23
  230. package/dist/IStorageCapability-ORkQfK3F.d.ts +0 -242
  231. package/dist/OpenViduRecordingProvider-Du98qevC.esm.js +0 -85
  232. package/dist/createFaceAvatar-BEj18KXi.d.ts +0 -50
  233. package/dist/document-upload.d.ts +0 -325
  234. package/dist/document-upload.esm.js +0 -197
  235. package/dist/electronicSignatureManager-CcUXQZS7.d.ts +0 -1300
  236. package/dist/faceCaptureSetup-Cd-04W_X.esm.js +0 -863
  237. package/dist/getBrowser-Cb8Zgrgp.esm.js +0 -7
  238. package/dist/getParsedUserAgent-pJjATANs.esm.js +0 -1622
  239. package/dist/governmentValidationStateMachine-CK9DrZXX.esm.js +0 -226
  240. package/dist/idCaptureDefaults-WeHbQM7W.esm.js +0 -225
  241. package/dist/idCaptureStateMachine-kZ5OpdfM.esm.js +0 -3342
  242. package/dist/lib-DAyUtOTj.esm.js +0 -12420
  243. package/dist/manualReviewService-D4IkipnN.esm.js +0 -15
  244. package/dist/mediaRecorderOptions-dALSV8af.esm.js +0 -40
  245. package/dist/onDeviceFaceResults-CUHwyZT4.esm.js +0 -646
  246. package/dist/openviduLazy-CCDpFWg1.esm.js +0 -10
  247. package/dist/recordingService-3NSENVwp.esm.js +0 -329
  248. package/dist/safeStorage-Ep56I-f_.esm.js +0 -982
  249. package/dist/selfieStateMachine-CHV_WNst.esm.js +0 -55
  250. package/dist/trueSight-B_icM8r2.esm.js +0 -1
  251. package/dist/types-EELWyWpd.d.ts +0 -6
  252. package/dist/types-Vb4P9ovf.d.ts +0 -22
  253. package/dist/warmup-Dv2alr2-.d.ts +0 -82
  254. package/dist/wasmDefaults-DTUrftxR.esm.js +0 -125
  255. package/dist/{Face2DProvider-UUQt_vRC.esm.js → Face2DProvider-BF48sz5c.esm.js} +1 -1
  256. package/dist/{PrivacyLensProvider-D8PS7AJa.esm.js → PrivacyLensProvider-EwnC_C5n.esm.js} +1 -1
  257. /package/dist/{types-BfgmV7s72.d.ts → types-BfgmV7s7.d.ts} +0 -0
  258. /package/dist/{types-CJ7Yl9K-2.d.ts → types-CJ7Yl9K-.d.ts} +0 -0
@@ -0,0 +1,605 @@
1
+ import { t as BrowserTimerProvider } from "./BrowserTimerProvider-BXhgNxLt.esm.js";
2
+ import { t as api } from "./api-Bx3gKW_y.esm.js";
3
+ import { t as endpoints } from "./endpoints-B-3Q-LUw.esm.js";
4
+ import { a as isIOS, t as isAndroid } from "./platform-DkcRc9JV.esm.js";
5
+ //#region ../infra/src/media/mediaRecorderOptions.ts
6
+ /**
7
+ * Picks a `MediaRecorder` mime type the current browser actually supports.
8
+ * WebM avoids Safari's fragmented-MP4 unknown-duration metadata on versions
9
+ * that can record it; older Safari versions fall back to MP4. Returns '' when
10
+ * none match.
11
+ */
12
+ function getSupportedMediaRecorderMimeType() {
13
+ for (const type of [
14
+ "video/webm",
15
+ "video/webm;codecs=vp9",
16
+ "video/webm;codecs=vp8",
17
+ "video/mp4"
18
+ ]) if (MediaRecorder.isTypeSupported(type)) return type;
19
+ return "";
20
+ }
21
+ /**
22
+ * Mime type for the multipart (video-selfie-service) recorder. Android
23
+ * Chromium gets hardware H.264 in fragmented MP4 first — the fragment shape
24
+ * the service already ingests from Safari. Measured on a Galaxy S21 under ID
25
+ * detection load (ENG-55397): 720p VP8 dropped 16% of frames, H.264 dropped
26
+ * none. Everything else keeps the WebM-first order.
27
+ */
28
+ function getMultipartRecorderMimeType() {
29
+ if (isAndroid() && MediaRecorder.isTypeSupported("video/mp4;codecs=avc1")) return "video/mp4;codecs=avc1";
30
+ return getSupportedMediaRecorderMimeType();
31
+ }
32
+ /**
33
+ * `MediaRecorder` options tuned per platform — a higher bitrate on iOS, lower
34
+ * elsewhere — paired with the supported mime type.
35
+ */
36
+ function getAdaptiveMediaRecorderOptions() {
37
+ const mimeType = getSupportedMediaRecorderMimeType();
38
+ if (isIOS()) return {
39
+ mimeType,
40
+ videoBitsPerSecond: 1e6,
41
+ bitsPerSecond: 1e6
42
+ };
43
+ return {
44
+ mimeType,
45
+ videoBitsPerSecond: 5e5,
46
+ bitsPerSecond: 5e5
47
+ };
48
+ }
49
+ //#endregion
50
+ //#region ../infra/src/providers/browser/MultipartRecordingProvider.ts
51
+ /**
52
+ * How often `MediaRecorder` hands us buffered data (incremental blobs).
53
+ * 500 ms keeps each blob — and therefore each upload chunk — small: less
54
+ * tail lost when a session is interrupted, and a smaller first blob (init
55
+ * header + keyframe), which is the largest and most timeout-prone chunk.
56
+ * Not lower: request rate doubles per halving, and browsers stop honoring
57
+ * very small timeslices reliably.
58
+ */
59
+ const TIMESLICE_MS = 500;
60
+ /**
61
+ * Encoder target for the full video-selfie session. Higher than the
62
+ * short-clip liveness path (0.5–1 Mbps) so a multi-minute session keeps
63
+ * usable quality. It's a ceiling — a still scene still encodes well below it.
64
+ */
65
+ const VIDEO_BITS_PER_SECOND = 25e5;
66
+ /**
67
+ * Records a stream and emits every `MediaRecorder` timeslice blob as its own
68
+ * part, in order. Each blob is a whole container fragment (WebM cluster /
69
+ * fMP4 `moof`+`mdat`), which is the property the video-selfie-service's
70
+ * gap-splicing depends on — parts must never cut a fragment at a byte
71
+ * offset. The service stages sub-5 MiB chunks and combines them server-side,
72
+ * so emitting the smallest whole-fragment unit (~0.5 s of video) maximizes
73
+ * what an interrupted session can salvage.
74
+ *
75
+ * Page-lifecycle orchestration lives in Core: it pauses this recorder before a
76
+ * backgrounded camera can stall, restores the camera/compositor, and only then
77
+ * resumes this same media container.
78
+ */
79
+ var MultipartRecordingProvider = class {
80
+ constructor() {
81
+ this.mediaRecorder = null;
82
+ this._isRecording = false;
83
+ this._hasError = false;
84
+ this._error = null;
85
+ this.mimeType = "";
86
+ this.partNumber = 0;
87
+ this.onPart = null;
88
+ }
89
+ get isRecording() {
90
+ return this._isRecording;
91
+ }
92
+ get hasError() {
93
+ return this._hasError;
94
+ }
95
+ get error() {
96
+ return this._error;
97
+ }
98
+ startRecording(stream, onPart) {
99
+ this.reset();
100
+ this.partNumber = 0;
101
+ this.onPart = onPart;
102
+ try {
103
+ this.mimeType = getMultipartRecorderMimeType();
104
+ const recorder = new MediaRecorder(stream.clone(), {
105
+ mimeType: this.mimeType,
106
+ videoBitsPerSecond: VIDEO_BITS_PER_SECOND
107
+ });
108
+ recorder.ondataavailable = (event) => {
109
+ if (event.data.size > 0 && this.onPart) {
110
+ this.partNumber += 1;
111
+ this.onPart({
112
+ chunk: event.data,
113
+ partNumber: this.partNumber
114
+ });
115
+ }
116
+ };
117
+ recorder.onerror = (event) => {
118
+ const detail = event instanceof ErrorEvent && event.error instanceof Error ? event.error.message : event.type;
119
+ this._error = `Recording error: ${detail}`;
120
+ this._isRecording = false;
121
+ this._hasError = true;
122
+ };
123
+ recorder.start(TIMESLICE_MS);
124
+ this.mediaRecorder = recorder;
125
+ this._isRecording = true;
126
+ this._error = null;
127
+ this._hasError = false;
128
+ } catch (err) {
129
+ const detail = err instanceof Error ? err.message : String(err);
130
+ this._error = `Failed to start recording: ${detail}`;
131
+ this._hasError = true;
132
+ }
133
+ }
134
+ pauseRecording() {
135
+ const recorder = this.mediaRecorder;
136
+ if (!recorder || !this._isRecording || this._hasError) return false;
137
+ if (recorder.state === "paused") return true;
138
+ if (recorder.state !== "recording") return false;
139
+ try {
140
+ recorder.pause();
141
+ return true;
142
+ } catch (err) {
143
+ const detail = err instanceof Error ? err.message : String(err);
144
+ this._error = `Failed to pause recording: ${detail}`;
145
+ this._hasError = true;
146
+ return false;
147
+ }
148
+ }
149
+ resumeRecording() {
150
+ const recorder = this.mediaRecorder;
151
+ if (!recorder || !this._isRecording || this._hasError) return false;
152
+ if (recorder.state === "recording") return true;
153
+ if (recorder.state !== "paused") return false;
154
+ try {
155
+ recorder.resume();
156
+ return true;
157
+ } catch (err) {
158
+ const detail = err instanceof Error ? err.message : String(err);
159
+ this._error = `Failed to resume recording: ${detail}`;
160
+ this._hasError = true;
161
+ return false;
162
+ }
163
+ }
164
+ stopRecording() {
165
+ const recorder = this.mediaRecorder;
166
+ return new Promise((resolve) => {
167
+ if (recorder && this._isRecording) {
168
+ recorder.onstop = () => {
169
+ resolve();
170
+ };
171
+ recorder.stop();
172
+ this._isRecording = false;
173
+ } else resolve();
174
+ recorder?.stream?.getTracks().forEach((track) => track.stop());
175
+ });
176
+ }
177
+ reset() {
178
+ const recorder = this.mediaRecorder;
179
+ if (recorder) {
180
+ recorder.ondataavailable = null;
181
+ recorder.onerror = null;
182
+ recorder.onstop = null;
183
+ if (recorder.state !== "inactive") recorder.stop();
184
+ recorder.stream.getTracks().forEach((track) => track.stop());
185
+ this.mediaRecorder = null;
186
+ }
187
+ this.onPart = null;
188
+ this._isRecording = false;
189
+ this._error = null;
190
+ this._hasError = false;
191
+ }
192
+ };
193
+ //#endregion
194
+ //#region ../infra/src/providers/browser/BrowserNetworkStatusProvider.ts
195
+ var BrowserNetworkStatusProvider = class {
196
+ onOnline(listener) {
197
+ if (typeof window === "undefined" || typeof window.addEventListener !== "function") return () => {};
198
+ window.addEventListener("online", listener);
199
+ return () => {
200
+ window.removeEventListener("online", listener);
201
+ };
202
+ }
203
+ };
204
+ //#endregion
205
+ //#region src/internal/recordings/videoSelfieUploadService.ts
206
+ /**
207
+ * Opens a scoped multipart video upload session. Idempotent server-side: if
208
+ * an upload is already in progress for the `(session, scope)` pair, the same `uploadId`
209
+ * comes back along with the parts already stored (`parts` non-empty) — but
210
+ * always with a fresh `epoch` that locks out whoever held the previous one.
211
+ */
212
+ async function initiateVideoSelfieUpload(scope = "videoselfie") {
213
+ const response = await api.post(endpoints.videoSelfieUploadInitiate, void 0, { query: { scope } });
214
+ return {
215
+ uploadId: response.data.uploadId,
216
+ epoch: response.data.epoch,
217
+ scope,
218
+ parts: response.data.parts ?? []
219
+ };
220
+ }
221
+ /**
222
+ * Uploads a single chunk as a multipart part. The body is the raw video bytes
223
+ * (no base64, no client-side encryption — encryption at rest is server-side
224
+ * S3 SSE). Every part except the last must be >= 5 MiB (enforced
225
+ * server-side). Returns the part number + `etag` needed to complete the
226
+ * upload. Rejects with a `409` status when a newer initiate fenced this
227
+ * session out.
228
+ */
229
+ async function uploadVideoSelfiePart(session, partNumber, chunk) {
230
+ const response = await api.post(endpoints.videoSelfieUploadPart, chunk, {
231
+ query: {
232
+ uploadId: session.uploadId,
233
+ epoch: session.epoch,
234
+ partNumber,
235
+ scope: session.scope
236
+ },
237
+ headers: { "Content-Type": "application/octet-stream" }
238
+ });
239
+ return {
240
+ partNumber: response.data.partNumber,
241
+ etag: response.data.etag
242
+ };
243
+ }
244
+ /**
245
+ * Finalizes the upload. The service assembles from the parts it stored; the
246
+ * optional `parts` list is deliberately NOT sent — chunks staged below the
247
+ * S3 minimum are combined and renumbered server-side, so a client-side list
248
+ * could contradict the authoritative one. Safe to repeat if the response
249
+ * was lost. Returns the server-reported status. Rejects with `400` naming a
250
+ * missing part when the sequence has a hole.
251
+ */
252
+ async function completeVideoSelfieUpload(session) {
253
+ return (await api.post(endpoints.videoSelfieUploadComplete, {
254
+ uploadId: session.uploadId,
255
+ epoch: session.epoch
256
+ }, { query: { scope: session.scope } })).data.status;
257
+ }
258
+ /**
259
+ * Discards an in-progress upload and everything already sent for it, so the
260
+ * backend fails the upload straight away instead of waiting for its expiry.
261
+ * Call when a recording is abandoned or its upload can no longer complete.
262
+ */
263
+ async function abortVideoSelfieUpload(session) {
264
+ return (await api.post(endpoints.videoSelfieUploadAbort, {
265
+ uploadId: session.uploadId,
266
+ epoch: session.epoch
267
+ }, { query: { scope: session.scope } })).data.status;
268
+ }
269
+ //#endregion
270
+ //#region src/internal/recordings/videoSelfieChunkUploader.ts
271
+ /**
272
+ * How many part uploads run concurrently. The service allows 10 rps with a
273
+ * burst of 30 per session; a real recorder emits ~2 chunks/s, so this cap
274
+ * only matters when a backlog is draining after a network stall.
275
+ */
276
+ const MAX_IN_FLIGHT = 3;
277
+ /** Attempts per chunk in the live round (first try + retries). */
278
+ const MAX_ATTEMPTS = 4;
279
+ /** Extra attempts per parked chunk during the final drain() round. */
280
+ const DRAIN_ATTEMPTS = 2;
281
+ const BACKOFF_BASE_MS = 500;
282
+ const BACKOFF_CAP_MS = 8e3;
283
+ /** Upper bound honored for a server-sent `Retry-After` (seconds). */
284
+ const RETRY_AFTER_CAP_MS = 3e4;
285
+ /**
286
+ * Ceiling on un-acknowledged chunk bytes held in memory. On a network slower
287
+ * than the encoder the backlog grows without bound; past this the upload
288
+ * cannot realistically catch up, so the uploader fails instead of eating
289
+ * memory on a low-end device. ~48 MiB ≈ 2.5 minutes of video at our bitrate.
290
+ */
291
+ const MAX_BUFFERED_BYTES = 48 * 1024 * 1024;
292
+ function httpStatusOf$1(error) {
293
+ if (typeof error === "object" && error !== null && "status" in error && typeof error.status === "number") return error.status;
294
+ return null;
295
+ }
296
+ function retryAfterMsOf(error) {
297
+ if (typeof error === "object" && error !== null && "headers" in error && typeof error.headers === "object") {
298
+ const headers = error.headers;
299
+ const seconds = Number(headers?.["retry-after"]);
300
+ if (Number.isFinite(seconds) && seconds >= 0) return Math.min(seconds * 1e3, RETRY_AFTER_CAP_MS);
301
+ }
302
+ return null;
303
+ }
304
+ /**
305
+ * Uploads video-selfie chunks with the client-side half of the service's
306
+ * resilience contract (`video-selfie-service` README, "What a client can
307
+ * rely on"):
308
+ *
309
+ * - **Keep-until-ack** — every chunk is held in memory until its upload
310
+ * returns 200 (a hole in the sequence can only be filled by that exact
311
+ * data). Acked bytes are durable in S3 (stored as a part or staged), so
312
+ * the blob is released the moment the ack lands.
313
+ * - **Retry with backoff** — transient failures (network error/timeout,
314
+ * 408, 429, 5xx) retry the same bytes under the same partNumber with
315
+ * exponential backoff + full jitter; 429 honors the server's
316
+ * `Retry-After`. Chunks may land out of order — the service stages them.
317
+ * - **Park, then drain** — a chunk that exhausts its live retries is parked
318
+ * (blob kept) without failing the recording; {@link drain} gives every
319
+ * parked chunk a final round once recording stops, so a mid-recording
320
+ * network outage only fails the upload if it persists to the end. A
321
+ * browser `online` event un-parks early: parked chunks get a fresh live
322
+ * round as soon as connectivity returns instead of waiting for stop.
323
+ * - **409 is fatal** — a newer initiate fenced this session out ("latest
324
+ * initiate wins"); no retry can succeed, so the uploader stops.
325
+ * - **Bounded memory** — when un-acked bytes exceed the ceiling the
326
+ * uploader fails rather than buffering a runaway backlog.
327
+ */
328
+ var VideoSelfieChunkUploader = class {
329
+ constructor(session, dependencies = {}) {
330
+ this.queue = [];
331
+ this.parked = [];
332
+ this.inFlight = 0;
333
+ this.bufferedBytes = 0;
334
+ this.fatal = false;
335
+ this.disposed = false;
336
+ this.tasks = [];
337
+ this.session = session;
338
+ this.timer = dependencies.timer ?? BrowserTimerProvider.getInstance();
339
+ this.jitter = dependencies.jitter ?? Math.random;
340
+ const networkStatus = dependencies.networkStatus ?? new BrowserNetworkStatusProvider();
341
+ this.unsubscribeOnline = networkStatus.onOnline(() => this.unparkEarly());
342
+ }
343
+ /** True once the upload cannot complete (fenced out or over the memory cap). */
344
+ get failed() {
345
+ return this.fatal;
346
+ }
347
+ /**
348
+ * Accepts the next chunk for upload. Non-blocking: the upload (and any
349
+ * retries) run in the background; failures surface through {@link failed}
350
+ * and {@link drain}.
351
+ */
352
+ enqueue(partNumber, chunk) {
353
+ if (this.fatal || this.disposed) return;
354
+ this.bufferedBytes += chunk.size;
355
+ if (this.bufferedBytes > MAX_BUFFERED_BYTES) {
356
+ this.fatal = true;
357
+ return;
358
+ }
359
+ this.queue.push({
360
+ partNumber,
361
+ chunk,
362
+ attempts: 0
363
+ });
364
+ this.pump();
365
+ }
366
+ /**
367
+ * Waits for every accepted chunk to be acknowledged, giving parked chunks
368
+ * one final retry round. Returns `true` when all chunks landed and the
369
+ * upload can be completed.
370
+ */
371
+ async drain() {
372
+ this.unsubscribeOnline();
373
+ await this.settleLiveRound();
374
+ while (!this.fatal && this.parked.length > 0) {
375
+ const chunk = this.parked.shift();
376
+ chunk.attempts = MAX_ATTEMPTS - DRAIN_ATTEMPTS;
377
+ this.queue.push(chunk);
378
+ this.pump();
379
+ await this.settleLiveRound();
380
+ if (this.parked.some((p) => p.partNumber === chunk.partNumber)) return false;
381
+ }
382
+ return !this.disposed && !this.fatal && this.parked.length === 0;
383
+ }
384
+ /** Cancels all pending work; held blobs are released. */
385
+ dispose() {
386
+ this.disposed = true;
387
+ this.queue = [];
388
+ this.parked = [];
389
+ this.unsubscribeOnline();
390
+ }
391
+ /**
392
+ * Connectivity is back (browser `online` event) — give parked chunks a
393
+ * fresh live round right away instead of holding them until {@link drain}.
394
+ * The event is only a hint: chunks that still fail simply park again.
395
+ */
396
+ unparkEarly() {
397
+ if (this.fatal || this.disposed || this.parked.length === 0) return;
398
+ for (const chunk of this.parked.splice(0)) {
399
+ chunk.attempts = 0;
400
+ this.queue.push(chunk);
401
+ }
402
+ this.pump();
403
+ }
404
+ async settleLiveRound() {
405
+ while (this.tasks.length > 0) {
406
+ const snapshot = [...this.tasks];
407
+ await Promise.all(snapshot);
408
+ this.tasks = this.tasks.filter((task) => !snapshot.includes(task));
409
+ }
410
+ }
411
+ pump() {
412
+ while (!this.fatal && !this.disposed && this.inFlight < MAX_IN_FLIGHT && this.queue.length > 0) {
413
+ const chunk = this.queue.shift();
414
+ this.inFlight += 1;
415
+ const task = this.uploadWithRetry(chunk).finally(() => {
416
+ this.inFlight -= 1;
417
+ this.pump();
418
+ });
419
+ this.tasks.push(task);
420
+ }
421
+ }
422
+ async uploadWithRetry(pending) {
423
+ while (!this.disposed) {
424
+ pending.attempts += 1;
425
+ try {
426
+ await uploadVideoSelfiePart(this.session, pending.partNumber, pending.chunk);
427
+ this.bufferedBytes -= pending.chunk.size;
428
+ return;
429
+ } catch (error) {
430
+ const status = httpStatusOf$1(error);
431
+ if (status === 409) {
432
+ this.fatal = true;
433
+ return;
434
+ }
435
+ if (status !== null && status >= 400 && status < 500 && status !== 408 && status !== 429 || pending.attempts >= MAX_ATTEMPTS) {
436
+ this.parked.push(pending);
437
+ return;
438
+ }
439
+ await this.delayBeforeRetry(pending.attempts, error);
440
+ }
441
+ }
442
+ }
443
+ delayBeforeRetry(attempt, error) {
444
+ const retryAfterMs = retryAfterMsOf(error);
445
+ const backoffCeiling = Math.min(BACKOFF_BASE_MS * 2 ** (attempt - 1), BACKOFF_CAP_MS);
446
+ const waitMs = retryAfterMs ?? backoffCeiling / 2 + this.jitter() * (backoffCeiling / 2);
447
+ return new Promise((resolve) => {
448
+ this.timer.setTimeout(resolve, waitMs);
449
+ });
450
+ }
451
+ };
452
+ //#endregion
453
+ //#region src/internal/recordings/multipartRecordingService.ts
454
+ /** Attempts for `complete` — documented safe to repeat if the response was lost. */
455
+ const COMPLETE_ATTEMPTS = 3;
456
+ const COMPLETE_BACKOFF_MS = 500;
457
+ function httpStatusOf(error) {
458
+ if (typeof error === "object" && error !== null && "status" in error && typeof error.status === "number") return error.status;
459
+ return null;
460
+ }
461
+ /**
462
+ * Records the camera on-device and streams it to the backend as it is
463
+ * captured, using the video-selfie-service multipart upload protocol
464
+ * (`/v1/video-upload/*`).
465
+ *
466
+ * This is the client-side recorder for Video Selfie and for scoped regular
467
+ * Selfie and ID recordings. It replaces the former server-side recording path.
468
+ *
469
+ * Every ~0.5 s recorder blob uploads as its own chunk, concurrently with
470
+ * recording, through {@link VideoSelfieChunkUploader} (keep-until-ack +
471
+ * retry with backoff — see its doc for the full policy). The service stages
472
+ * sub-5 MiB chunks and combines them server-side, so `stop()` only drains
473
+ * the stragglers and finalizes; client memory holds un-acked chunks only.
474
+ * No client-side encryption: video is encrypted at rest server-side
475
+ * (S3 SSE-AES-256).
476
+ */
477
+ var MultipartRecordingService = class {
478
+ constructor(scope = "videoselfie") {
479
+ this.scope = scope;
480
+ this.recorder = new MultipartRecordingProvider();
481
+ this.timer = BrowserTimerProvider.getInstance();
482
+ this.session = null;
483
+ this.uploader = null;
484
+ this.chunksEmitted = 0;
485
+ this.stopPromise = null;
486
+ this.abandonRequested = false;
487
+ }
488
+ get isRecording() {
489
+ return this.recorder.isRecording;
490
+ }
491
+ async start(stream) {
492
+ if (this.recorder.isRecording) return;
493
+ let initiated = await initiateVideoSelfieUpload(this.scope);
494
+ if (initiated.parts.length > 0) {
495
+ await abortVideoSelfieUpload(initiated).catch(() => {});
496
+ initiated = await initiateVideoSelfieUpload(this.scope);
497
+ }
498
+ this.session = {
499
+ uploadId: initiated.uploadId,
500
+ epoch: initiated.epoch,
501
+ scope: this.scope
502
+ };
503
+ this.uploader = new VideoSelfieChunkUploader(this.session);
504
+ this.chunksEmitted = 0;
505
+ this.abandonRequested = false;
506
+ this.recorder.startRecording(stream, ({ chunk, partNumber }) => {
507
+ this.chunksEmitted += 1;
508
+ this.uploader?.enqueue(partNumber, chunk);
509
+ });
510
+ }
511
+ /** Pause the current media container without finalizing its upload. */
512
+ pause() {
513
+ return this.recorder.pauseRecording?.() ?? false;
514
+ }
515
+ /** Resume the same media container after its video source has recovered. */
516
+ resume() {
517
+ return this.recorder.resumeRecording?.() ?? false;
518
+ }
519
+ stop() {
520
+ if (this.stopPromise) return this.stopPromise;
521
+ const stopPromise = this.finalizeRecording();
522
+ this.stopPromise = stopPromise;
523
+ const clearStopPromise = () => {
524
+ if (this.stopPromise === stopPromise) {
525
+ this.stopPromise = null;
526
+ this.abandonRequested = false;
527
+ }
528
+ };
529
+ stopPromise.then(clearStopPromise, clearStopPromise);
530
+ return stopPromise;
531
+ }
532
+ async finalizeRecording() {
533
+ const session = this.session;
534
+ const uploader = this.uploader;
535
+ if (!this.recorder.isRecording || !session || !uploader) return { recordingId: null };
536
+ try {
537
+ await this.recorder.stopRecording();
538
+ if (this.abandonRequested) {
539
+ this.abandonUpload(session);
540
+ return { recordingId: null };
541
+ }
542
+ const delivered = await uploader.drain();
543
+ if (this.abandonRequested || !delivered || uploader.failed || this.chunksEmitted === 0) {
544
+ this.abandonUpload(session);
545
+ return { recordingId: null };
546
+ }
547
+ } catch (error) {
548
+ this.abandonUpload(session);
549
+ throw error;
550
+ }
551
+ try {
552
+ await this.completeWithRetry(session);
553
+ this.session = null;
554
+ this.uploader = null;
555
+ return { recordingId: session.uploadId };
556
+ } catch {
557
+ this.abandonUpload(session);
558
+ return { recordingId: null };
559
+ }
560
+ }
561
+ cleanup() {
562
+ if (this.session) if (this.stopPromise) {
563
+ this.abandonRequested = true;
564
+ this.uploader?.dispose();
565
+ } else this.abandonUpload(this.session);
566
+ this.recorder.reset();
567
+ }
568
+ /**
569
+ * `complete` is idempotent server-side ("safe to repeat if the response
570
+ * was lost"), so transient failures — network errors, 5xx, 429 — retry a
571
+ * couple of times before the recording is declared failed. A 4xx (e.g.
572
+ * `400` naming a missing part) is permanent: after a clean drain every
573
+ * chunk was acked, so a reported hole cannot be filled from here.
574
+ */
575
+ async completeWithRetry(session) {
576
+ for (let attempt = 1;; attempt += 1) {
577
+ if (this.abandonRequested) throw new Error("Video upload abandoned");
578
+ try {
579
+ await completeVideoSelfieUpload(session);
580
+ return;
581
+ } catch (error) {
582
+ const status = httpStatusOf(error);
583
+ if (status !== null && status >= 400 && status < 500 && status !== 408 && status !== 429 || attempt >= COMPLETE_ATTEMPTS) throw error;
584
+ await new Promise((resolve) => {
585
+ this.timer.setTimeout(resolve, COMPLETE_BACKOFF_MS * attempt);
586
+ });
587
+ }
588
+ }
589
+ }
590
+ /**
591
+ * Fire-and-forget abort: the upload can no longer complete, so tell the
592
+ * backend to fail it immediately rather than at its expiry. Best-effort —
593
+ * an abort that doesn't land (including a 409 from a newer epoch having
594
+ * taken over) just means the server falls back to expiry or salvage.
595
+ */
596
+ abandonUpload(session) {
597
+ if (this.session !== session) return;
598
+ this.session = null;
599
+ this.uploader?.dispose();
600
+ this.uploader = null;
601
+ abortVideoSelfieUpload(session).catch(() => {});
602
+ }
603
+ };
604
+ //#endregion
605
+ export { getAdaptiveMediaRecorderOptions as n, MultipartRecordingService as t };
@@ -1,4 +1,4 @@
1
- import { a as isWasmMotionPrimedForModule } from "./permissionServices-UvUcOSRb.esm.js";
1
+ import { a as isWasmMotionPrimedForModule } from "./permissionServices-Bj_fyWtv.esm.js";
2
2
  //#region src/internal/permissions/permissionGuards.ts
3
3
  function resolveStoredPermissionResult(fromEvent, fromContext) {
4
4
  if (fromEvent === "granted" || fromEvent === "denied" || fromEvent === "prompt" || fromEvent === "refresh") return fromEvent;
@@ -1,7 +1,7 @@
1
- import { r as WasmUtilProvider } from "./safeStorage-Ep56I-f_.esm.js";
2
- import { n as isAndroidWebView } from "./platform-BJrm5nzZ.esm.js";
3
- import { t as MotionSensorProvider } from "./MotionSensorProvider-DGiV77J_.esm.js";
4
- import { a as stopCameraStream, o as clearCameraGrantedInDocument, r as requestCameraAccess, s as isCameraGrantedInDocument } from "./camera-_2sXMXiF.esm.js";
1
+ import { r as WasmUtilProvider } from "./safeStorage-B-trhxg6.esm.js";
2
+ import { n as isAndroidWebView } from "./platform-DkcRc9JV.esm.js";
3
+ import { t as MotionSensorProvider } from "./MotionSensorProvider-BgTYwg9L.esm.js";
4
+ import { c as isCameraGrantedInDocument, i as requestCameraAccess, o as stopCameraStream, s as clearCameraGrantedInDocument } from "./camera-sIa9ceW2.esm.js";
5
5
  //#region ../infra/src/media/permissions.ts
6
6
  async function queryPermission(name) {
7
7
  try {
@@ -139,4 +139,4 @@ async function invokeRequestPermissionActor(input) {
139
139
  return requestPermission({ requestMotion: true });
140
140
  }
141
141
  //#endregion
142
- export { isWasmMotionPrimedForModule as a, requestPermission as i, invokeRequestPermissionActor as n, resetWasmMotionPrimedForModule as o, primeMotionFromUserGestureIfNeeded as r, checkPermission as t };
142
+ export { isWasmMotionPrimedForModule as a, requestPermission as i, invokeRequestPermissionActor as n, resetWasmMotionPrimedForModule as o, primeMotionFromUserGestureIfNeeded as r, queryCameraPermission as s, checkPermission as t };
@@ -2,12 +2,13 @@ import { A as StateMachine, i as ActorRefFrom, l as AnyStateMachine } from "./sp
2
2
  import "./StateMachine-EDpYWy0i.js";
3
3
  import { t as Manager } from "./Manager-CQQ99QOI.js";
4
4
  import "./Actor-iTq7YY48.js";
5
- import { t as CameraStream } from "./camera-9wWD-pwg.js";
6
- import { o as IncodeCanvas, t as IStorageCapability } from "./IStorageCapability-ORkQfK3F.js";
7
- import { t as FaceDetectionProvider } from "./FaceDetectionProvider-Mh6q3EbA.js";
8
- import { n as DetectionStatus, s as IWasmUtilCapability } from "./types-Hmd7U0JA.js";
5
+ import { y as IncodeCanvas } from "./createFaceAvatar-BlcTYgJv.js";
6
+ import { i as IStorageCapability, t as IWasmUtilCapability } from "./IWasmUtilCapability-CNWRl7jr.js";
9
7
  import { n as PermissionStatus, t as PermissionResult } from "./types-BEwVKkLJ.js";
10
- import { n as StreamCanvasCapture, t as DeepsightService } from "./deepsightService-DLVQS_RH.js";
8
+ import { n as DetectionStatus } from "./types-Bnl58jUQ.js";
9
+ import { n as DeepsightService, t as StreamCanvasCapture } from "./StreamCanvasCapture-_8gdW5Lk.js";
10
+ import { t as FaceDetectionProvider } from "./FaceDetectionProvider-LdZ47bWy.js";
11
+ import { t as CameraStream } from "./camera-9wWD-pwg.js";
11
12
  //#region src/modules/personhood/types.d.ts
12
13
  /**
13
14
  * Head pose (degrees) computed per-frame from the WASM face detector.
@@ -1,18 +1,18 @@
1
- import { r as WasmUtilProvider } from "./safeStorage-Ep56I-f_.esm.js";
2
- import { t as BrowserStorageProvider } from "./BrowserStorageProvider-k-FDkC4W.esm.js";
1
+ import { l as BrowserStorageProvider } from "./setup-BWG-hivt.esm.js";
2
+ import { r as WasmUtilProvider } from "./safeStorage-B-trhxg6.esm.js";
3
3
  import { t as BrowserTimerProvider } from "./BrowserTimerProvider-BXhgNxLt.esm.js";
4
4
  import { t as api } from "./api-Bx3gKW_y.esm.js";
5
- import { C as createApi$1, v as randomUUID, y as getStoredHttpConfig } from "./trueSightService---iW2KKJ.esm.js";
6
- import { n as eventModuleNames } from "./events-DYiyoSlx.esm.js";
7
- import { _ as getDeviceFingerprintInfo, g as getThumbmarkId, n as getFingerprintEnabled, p as isBrowserSimulation, v as BrowserEnvironmentProvider } from "./sessionInitializer-dlfDehHk.esm.js";
8
- import { t as endpoints } from "./endpoints-CCzL3XD_.esm.js";
5
+ import { b as getStoredHttpConfig, w as createApi$1, y as randomUUID } from "./trueSightService-BN-Hzw82.esm.js";
6
+ import { n as eventModuleNames } from "./events-ijlbX_Wx.esm.js";
7
+ import { b as BrowserEnvironmentProvider, h as isBrowserSimulation, n as getFingerprintEnabled, v as getThumbmarkId, y as getDeviceFingerprintInfo } from "./sessionInitializer-BFk33E67.esm.js";
8
+ import { t as endpoints } from "./endpoints-B-3Q-LUw.esm.js";
9
9
  import { i as assign, s as createActor, t as setup, u as createManager } from "./xstate.esm-BuFLFuzz.esm.js";
10
10
  import { n as fromPromise, t as fromCallback } from "./xstate-actors.esm-BXeQ-Ucz.esm.js";
11
- import { a as stopCameraStream, r as requestCameraAccess } from "./camera-_2sXMXiF.esm.js";
12
- import { i as requestPermission, t as checkPermission } from "./permissionServices-UvUcOSRb.esm.js";
13
- import { f as stopStream, l as startDetection, s as initializeDeepsightSession, v as FaceDetectionProvider } from "./onDeviceFaceResults-CUHwyZT4.esm.js";
11
+ import { i as requestCameraAccess, o as stopCameraStream } from "./camera-sIa9ceW2.esm.js";
12
+ import { i as requestPermission, t as checkPermission } from "./permissionServices-Bj_fyWtv.esm.js";
13
+ import { i as initializeDeepsightSession, o as startDetection, s as stopStream, t as FaceDetectionProvider } from "./FaceDetectionProvider-BfhWkK90.esm.js";
14
14
  import { t as sleep } from "./ITimerCapability-DgdDzp8G.esm.js";
15
- import { t as StreamCanvasCapture } from "./StreamCanvasCapture-D2XcXCZ4.esm.js";
15
+ import { t as StreamCanvasCapture } from "./StreamCanvasCapture-C9jtgBdT.esm.js";
16
16
  //#region src/modules/personhood/personhoodServices.ts
17
17
  /**
18
18
  * Config used for the passive liveness pass. Deliberately stripped down from
package/dist/phone.esm.js CHANGED
@@ -1,3 +1,3 @@
1
- import { t as phoneMachine } from "./phoneStateMachine-Ba0wKHyX.esm.js";
2
- import { t as createPhoneManager } from "./phoneManager-FsJ0W2Ei.esm.js";
1
+ import { t as phoneMachine } from "./phoneStateMachine-CXdXufKg.esm.js";
2
+ import { t as createPhoneManager } from "./phoneManager-IjhSv5XS.esm.js";
3
3
  export { createPhoneManager, phoneMachine };