@incodetech/core 2.0.1 → 2.1.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 (218) hide show
  1. package/dist/{BrowserStorageProvider-CuOW1Er2.esm.js → BrowserStorageProvider-BpJM-gIl.esm.js} +8 -1
  2. package/dist/{IpifyProvider-D7jx52AL.esm.js → IpifyProvider-D4LWD15E.esm.js} +28 -0
  3. package/dist/{MotionSensorProvider-4v7xkqAp.esm.js → MotionSensorProvider-Bx7Mpzt0.esm.js} +63 -13
  4. package/dist/{OpenViduRecordingProvider-CMu6XVdc.esm.js → OpenViduRecordingProvider-O4GjBseO.esm.js} +1 -1
  5. package/dist/StateMachine-BC_nGvrc.d.ts +2 -0
  6. package/dist/StreamCanvasCapture-ImiDQdVA.esm.js +118 -0
  7. package/dist/StreamCanvasCapture-yyl20qd9.d.ts +152 -0
  8. package/dist/{BaseWasmProvider-C_DLEI40.esm.js → WasmUtilProvider-BKWm8rSA.esm.js} +202 -11
  9. package/dist/{addressSearch-BpTbTWCa.esm.js → addressSearch-DvmWXKZg.esm.js} +63 -57
  10. package/dist/{ae-signature-DDDZmWXj.esm.js → ae-signature-BFZta3TZ.esm.js} +1 -1
  11. package/dist/ae-signature.d.ts +3 -3
  12. package/dist/ae-signature.esm.js +6 -5
  13. package/dist/antifraud.d.ts +5 -46
  14. package/dist/antifraud.esm.js +6 -43
  15. package/dist/antifraudManager-CkV4u-LE.esm.js +55 -0
  16. package/dist/antifraudManager-CznnhyvD.d.ts +63 -0
  17. package/dist/{antifraudStateMachine-O0TMf6yc.esm.js → antifraudStateMachine-Ccrb-Jxc.esm.js} +2 -2
  18. package/dist/apiError-B-j-gyDx.esm.js +51 -0
  19. package/dist/authentication.d.ts +13 -11
  20. package/dist/authentication.esm.js +26 -22
  21. package/dist/{authenticationManager-5M-fKzXx.esm.js → authenticationManager-BlR6mSaG.esm.js} +6 -6
  22. package/dist/{authenticationManager-C83GNIhl.d.ts → authenticationManager-CaiQbp-q.d.ts} +4 -4
  23. package/dist/{authenticationStateMachine-BMZqatiF.esm.js → authenticationStateMachine-DkcGUMw5.esm.js} +21 -9
  24. package/dist/{backCameraStream-DMdMeGk2.esm.js → backCameraStream-D7Wo4Nbx.esm.js} +95 -7
  25. package/dist/{session-CrkWAs-q.esm.js → browserSimulation-B1dWiXp7.esm.js} +61 -476
  26. package/dist/camera.d.ts +4 -3
  27. package/dist/camera.esm.js +4 -3
  28. package/dist/canvas-SKcRBxsk.esm.js +230 -0
  29. package/dist/consent.d.ts +4 -398
  30. package/dist/consent.esm.js +6 -77
  31. package/dist/consentManager-BYo9Nu1r.esm.js +90 -0
  32. package/dist/consentManager-Cg5Sk2tv.d.ts +419 -0
  33. package/dist/{consentStateMachine-CCT-B60O.esm.js → consentStateMachine-BG3yL8aC.esm.js} +9 -6
  34. package/dist/cpf-ocr.d.ts +4 -199
  35. package/dist/cpf-ocr.esm.js +8 -177
  36. package/dist/cpfOcrManager-Dg1s_TY5.d.ts +216 -0
  37. package/dist/cpfOcrManager-sSKegxox.esm.js +190 -0
  38. package/dist/cross-document-data-match.d.ts +1 -1
  39. package/dist/cross-document-data-match.esm.js +4 -4
  40. package/dist/curp-validation.d.ts +8 -158
  41. package/dist/curp-validation.esm.js +6 -108
  42. package/dist/curpValidationManager-CFem6zP9.esm.js +122 -0
  43. package/dist/curpValidationManager-RttixpIc.d.ts +184 -0
  44. package/dist/{curpValidationStateMachine-CitWLr2c.esm.js → curpValidationStateMachine-B7V_qp66.esm.js} +20 -13
  45. package/dist/custom-fields.d.ts +2 -2
  46. package/dist/custom-fields.esm.js +4 -4
  47. package/dist/custom-watchlist.d.ts +1 -1
  48. package/dist/custom-watchlist.esm.js +4 -41
  49. package/dist/customWatchlistStateMachine-HmFybXLX.esm.js +50 -0
  50. package/dist/{deepsightLoader-Cm4JIT_z.esm.js → deepsightLoader-8tnddNx-.esm.js} +19 -10
  51. package/dist/deepsightService-CrHmvx8X.esm.js +276 -0
  52. package/dist/{deepsightService-CEVxzehb.d.ts → deepsightService-Dh5P-hLf.d.ts} +13 -160
  53. package/dist/device.esm.js +4 -3
  54. package/dist/document-capture.d.ts +989 -80
  55. package/dist/document-capture.esm.js +34 -8
  56. package/dist/document-upload.d.ts +44 -44
  57. package/dist/document-upload.esm.js +7 -7
  58. package/dist/{documentCaptureStateMachine-BqzTDy9k.esm.js → documentCaptureStateMachine-CUTUzUw_.esm.js} +90 -6
  59. package/dist/dynamic-forms.d.ts +20 -5
  60. package/dist/dynamic-forms.esm.js +150 -61
  61. package/dist/ekyb.d.ts +32 -13
  62. package/dist/ekyb.esm.js +25 -15
  63. package/dist/{ekybStateMachine-CyMx_kg-.esm.js → ekybStateMachine-klc-AImJ.esm.js} +319 -207
  64. package/dist/ekyc.d.ts +10 -78
  65. package/dist/ekyc.esm.js +17 -12
  66. package/dist/{ekycStateMachine-oeO0Iekd.esm.js → ekycStateMachine-CXbpaJJn.esm.js} +201 -113
  67. package/dist/electronic-signature.d.ts +3 -3
  68. package/dist/electronic-signature.esm.js +5 -4
  69. package/dist/{electronicSignatureManager-D9OHzTpG.esm.js → electronicSignatureManager-BaECdJ1u.esm.js} +91 -23
  70. package/dist/email.d.ts +4 -3
  71. package/dist/email.esm.js +6 -5
  72. package/dist/{emailManager-wAV0LE-H.esm.js → emailManager--D5G3ChB.esm.js} +30 -7
  73. package/dist/{emailManager-DIfnS5g1.d.ts → emailManager-lAzDoQOs.d.ts} +66 -8
  74. package/dist/{emailStateMachine-DOf4j58N.esm.js → emailStateMachine-CxTOMAjC.esm.js} +46 -11
  75. package/dist/{endpoints-CnN3SyDa.esm.js → endpoints-BeTK0Mlt.esm.js} +6 -3
  76. package/dist/{events-D6-e4vok.esm.js → events-Dvvriq9l.esm.js} +3 -1
  77. package/dist/events.d.ts +2 -0
  78. package/dist/events.esm.js +1 -1
  79. package/dist/extensibility.d.ts +41 -16
  80. package/dist/extensibility.esm.js +55 -33
  81. package/dist/face-match.d.ts +21 -2
  82. package/dist/face-match.esm.js +5 -5
  83. package/dist/{faceCaptureManagerFactory-yqtpxjnN.d.ts → faceCaptureManagerFactory-CjdBUS6s.d.ts} +48 -17
  84. package/dist/{faceCaptureManagerFactory-Dh2PdGlF.esm.js → faceCaptureManagerFactory-ej2j1LMr.esm.js} +21 -5
  85. package/dist/{faceCaptureSetup-B3faSpYA.esm.js → faceCaptureSetup-B9t6bYze.esm.js} +68 -183
  86. package/dist/{faceMatchStateMachine-DNFrxTFS.esm.js → faceMatchStateMachine-DeXXzSuz.esm.js} +62 -6
  87. package/dist/field-comparison.d.ts +4 -0
  88. package/dist/field-comparison.esm.js +7 -0
  89. package/dist/fieldComparisonManager-Bu5TaSr3.d.ts +76 -0
  90. package/dist/fieldComparisonManager-COGI2ARD.esm.js +162 -0
  91. package/dist/fiscal-qr.d.ts +59 -0
  92. package/dist/fiscal-qr.esm.js +323 -0
  93. package/dist/flow-events.d.ts +6 -5
  94. package/dist/flow.d.ts +23 -15
  95. package/dist/flow.esm.js +56 -17
  96. package/dist/flowCompletionService-BdR2cGgB.d.ts +19 -0
  97. package/dist/flowCompletionService-DdGojV9K.esm.js +20 -0
  98. package/dist/{flowServices-PiNsxLfK.esm.js → flowServices-ChgTNggJ.esm.js} +10 -5
  99. package/dist/geolocation.d.ts +4 -4
  100. package/dist/geolocation.esm.js +6 -6
  101. package/dist/{geolocationStateMachine-asasuHY2.esm.js → geolocationStateMachine-Dvh7X0wF.esm.js} +5 -5
  102. package/dist/getBrowser-C8DP7oTB.esm.js +8 -0
  103. package/dist/{getBrowser-BSXUTWXw.esm.js → getDeviceClass-C0olyNFS.esm.js} +1 -8
  104. package/dist/{getDeviceClass-BSntT9_j.esm.js → getDeviceClass-C8Do2qYu.esm.js} +1 -1
  105. package/dist/government-validation.d.ts +28 -8
  106. package/dist/government-validation.esm.js +19 -8
  107. package/dist/{governmentValidationStateMachine-BDDYrJTo.esm.js → governmentValidationStateMachine-DcJ-BfsC.esm.js} +35 -77
  108. package/dist/home.d.ts +15 -14
  109. package/dist/home.esm.js +2 -2
  110. package/dist/http-Cai3IoLS.esm.js +0 -0
  111. package/dist/http.esm.js +1 -0
  112. package/dist/id-ocr.d.ts +54 -54
  113. package/dist/id-ocr.esm.js +5 -5
  114. package/dist/id-verification.d.ts +27 -27
  115. package/dist/id-verification.esm.js +4 -4
  116. package/dist/id.d.ts +12 -10
  117. package/dist/id.esm.js +70 -27
  118. package/dist/{idCaptureManager-Fyd0eam-.d.ts → idCaptureManager-ChCNmgBj.d.ts} +40 -20
  119. package/dist/{idCaptureManager-D0ktk7Hh.esm.js → idCaptureManager-D3pwWutw.esm.js} +22 -7
  120. package/dist/{idCaptureStateMachine-dwlBUjbC.esm.js → idCaptureStateMachine-B3AiDIsT.esm.js} +172 -123
  121. package/dist/{idOcrStateMachine-YbjjC_Gg.esm.js → idOcrStateMachine-CDQ5d_VM.esm.js} +4 -4
  122. package/dist/{idVerificationStateMachine-xbw9HP1Z.esm.js → idVerificationStateMachine-kRxwImzO.esm.js} +2 -2
  123. package/dist/identity-reuse.d.ts +4 -530
  124. package/dist/identity-reuse.esm.js +8 -274
  125. package/dist/identityReuseManager-C6n_97dw.esm.js +95 -0
  126. package/dist/identityReuseManager-Cww-NDtd.d.ts +428 -0
  127. package/dist/identityReuseStateMachine-BfE5YiEr.esm.js +148 -0
  128. package/dist/{index-BcRG8rtJ.d.ts → index-B5hPA0Bg.d.ts} +2 -2
  129. package/dist/{index-ChHWNH48.d.ts → index-B9NysVDB.d.ts} +469 -195
  130. package/dist/index.d.ts +2 -2
  131. package/dist/index.esm.js +10 -8
  132. package/dist/{invokeOnCaptureCallback-rc6kBHo5.esm.js → invokeOnCaptureCallback-ygByVdnn.esm.js} +1 -1
  133. package/dist/{lib-BB0B_qQX.esm.js → lib-BY67lgbq.esm.js} +1 -1
  134. package/dist/mandatory-consent.d.ts +8 -412
  135. package/dist/mandatory-consent.esm.js +6 -76
  136. package/dist/mandatoryConsentManager-Dq6WiOZh.d.ts +429 -0
  137. package/dist/mandatoryConsentManager-H6D18cZB.esm.js +89 -0
  138. package/dist/{mandatoryConsentStateMachine-Cnco1jvn.esm.js → mandatoryConsentStateMachine-DtQNW1ji.esm.js} +6 -6
  139. package/dist/openviduLazy-B8L--0oe.esm.js +3 -0
  140. package/dist/{openviduLazy-Cok70ZSg.esm.js → openviduLazy-Dh14JNJc.esm.js} +2 -2
  141. package/dist/otp-CGMdUzBC.esm.js +33 -0
  142. package/dist/otp-DF5A0sFx.d.ts +8 -0
  143. package/dist/permissionGuards-D0wGddy7.esm.js +23 -0
  144. package/dist/permissionServices-Doec4X5L.esm.js +130 -0
  145. package/dist/phone.d.ts +4 -3
  146. package/dist/phone.esm.js +6 -5
  147. package/dist/{phoneManager-DAJbGhlY.esm.js → phoneManager-BmF-0Ez4.esm.js} +30 -7
  148. package/dist/{phoneManager-B6M30hKE.d.ts → phoneManager-fPmIBYQK.d.ts} +65 -7
  149. package/dist/{phoneStateMachine-CuPARRaT.esm.js → phoneStateMachine-BiV0yoEx.esm.js} +46 -11
  150. package/dist/{qe-signature-DFo_Cc-I.esm.js → qe-signature-CUYPcHVo.esm.js} +1 -1
  151. package/dist/qe-signature.d.ts +3 -3
  152. package/dist/qe-signature.esm.js +6 -5
  153. package/dist/{recordingService-Ig2UgbLv.esm.js → recordingService-yRw7hfzU.esm.js} +197 -179
  154. package/dist/redirect-to-mobile.d.ts +6 -104
  155. package/dist/redirect-to-mobile.esm.js +6 -99
  156. package/dist/redirectToMobileManager-BNe3IzC_.d.ts +178 -0
  157. package/dist/redirectToMobileManager-Dy3t7o0C.esm.js +159 -0
  158. package/dist/{redirectToMobileStateMachine-BOEqe46A.esm.js → redirectToMobileStateMachine-DyAdRxfP.esm.js} +28 -19
  159. package/dist/{runChildModule-CqqwqAkW.esm.js → runChildModule-CuoHZ1cx.esm.js} +35 -3
  160. package/dist/selfie.d.ts +13 -11
  161. package/dist/selfie.esm.js +53 -24
  162. package/dist/{selfieManager-Duisl7qN.esm.js → selfieManager-BNuTIGAz.esm.js} +6 -6
  163. package/dist/{selfieManager-D0lSgd-J.d.ts → selfieManager-C2y_t6DG.d.ts} +4 -4
  164. package/dist/{selfieStateMachine-D76whWEf.esm.js → selfieStateMachine-Bv99bZJE.esm.js} +5 -3
  165. package/dist/session-DoVb-OcB.esm.js +152 -0
  166. package/dist/session.d.ts +37 -5
  167. package/dist/session.esm.js +12 -7
  168. package/dist/sessionInitializer-DRB-hgbV.esm.js +366 -0
  169. package/dist/{setup-C5AITV8m.d.ts → setup-BwCluiw3.d.ts} +86 -6
  170. package/dist/{setup-DPPAxmXf.esm.js → setup-CUO4mErT.esm.js} +175 -25
  171. package/dist/signature.d.ts +2 -2
  172. package/dist/signature.esm.js +4 -4
  173. package/dist/{signatureStateMachine-B5-QVUve.esm.js → signatureStateMachine-C5qqYLRz.esm.js} +3 -3
  174. package/dist/stats-BMNUG1AU.esm.js +41 -0
  175. package/dist/stats.d.ts +13 -2
  176. package/dist/stats.esm.js +3 -2
  177. package/dist/trust-graph.d.ts +33 -4
  178. package/dist/trust-graph.esm.js +21 -15
  179. package/dist/{types-CFV9G_7j.d.ts → types-Bj9hdFjU.d.ts} +1 -1
  180. package/dist/{types-BP1m8VRw.d.ts → types-DOUhndhT.d.ts} +14 -2
  181. package/dist/types-DsnEVMhr.esm.js +34 -0
  182. package/dist/types-DvGZI7BF.d.ts +131 -0
  183. package/dist/{types-B06Ypu2F.d.ts → types-NuT8ftBV.d.ts} +1 -1
  184. package/dist/types-ya0LN_MX.d.ts +5 -0
  185. package/dist/{warmup-CEcppFiS.d.ts → warmup-Dg8Lh-50.d.ts} +8 -0
  186. package/dist/wasm.d.ts +6 -4
  187. package/dist/wasm.esm.js +11 -9
  188. package/dist/watchlist-for-business.d.ts +1 -1
  189. package/dist/watchlist-for-business.esm.js +5 -73
  190. package/dist/watchlist.d.ts +1 -1
  191. package/dist/watchlist.esm.js +4 -41
  192. package/dist/watchlistForBusinessStateMachine-DMl8j2Ov.esm.js +74 -0
  193. package/dist/watchlistStateMachine-DmQlqI6L.esm.js +50 -0
  194. package/dist/workflow.d.ts +146 -100
  195. package/dist/workflow.esm.js +116 -66
  196. package/package.json +19 -1
  197. package/dist/StateMachine-BCQrZJhf.d.ts +0 -2
  198. package/dist/WasmUtilProvider-j98OJf-S.esm.js +0 -114
  199. package/dist/browserSimulation-gxD8cSpM.esm.js +0 -20
  200. package/dist/deepsightService-O74l4Y__.esm.js +0 -489
  201. package/dist/displayErrors-DqJ_IbsG.d.ts +0 -39
  202. package/dist/flowCompletionService-DhkT4SRY.d.ts +0 -10
  203. package/dist/flowCompletionService-P54yzGvA.esm.js +0 -13
  204. package/dist/openviduLazy-Cm0XFh_v.esm.js +0 -3
  205. package/dist/permissionServices-D_i6nzEw.esm.js +0 -50
  206. package/dist/stats-CIfiPzb1.esm.js +0 -16
  207. package/dist/types-CAD4va6a.d.ts +0 -5
  208. package/dist/watchlistServices-DMbUhkBX.esm.js +0 -12
  209. /package/dist/{Actor-CI32dTbG.d.ts → Actor-Y0_Fj-KL.d.ts} +0 -0
  210. /package/dist/{ITimerCapability-C67ZRskg.esm.js → ITimerCapability-CB0I1Uf2.esm.js} +0 -0
  211. /package/dist/{Manager-C8PrhBOx.d.ts → Manager-BHn8wH8K.d.ts} +0 -0
  212. /package/dist/{camera-PA2Ljri3.esm.js → camera-DJWm3V4g.esm.js} +0 -0
  213. /package/dist/{camera-DBSxa6ML.d.ts → camera-SRBpPq2X.d.ts} +0 -0
  214. /package/dist/{chunk-CRF6K_H_.esm.js → chunk-CMUKZ2uL.esm.js} +0 -0
  215. /package/dist/{cpf-PPz2Njto.esm.js → cpf-BRzggV8G.esm.js} +0 -0
  216. /package/dist/{dateUtils-UoN5xswP.esm.js → dateUtils-AksLQmgV.esm.js} +0 -0
  217. /package/dist/{platform-CfrjKhmi.esm.js → platform-SKvEfCBh.esm.js} +0 -0
  218. /package/dist/{xstate.esm-B70JrNqo.esm.js → xstate.esm-C9wncMQa.esm.js} +0 -0
@@ -1,7 +1,8 @@
1
- import { t as Manager } from "./Manager-C8PrhBOx.js";
2
- import "./Actor-CI32dTbG.js";
3
- import { t as CameraStream } from "./camera-DBSxa6ML.js";
4
- import * as xstate763 from "xstate";
1
+ import { t as Manager } from "./Manager-BHn8wH8K.js";
2
+ import "./Actor-Y0_Fj-KL.js";
3
+ import { t as CameraStream } from "./camera-SRBpPq2X.js";
4
+ import { n as PermissionStatus, t as PermissionResult } from "./types-ya0LN_MX.js";
5
+ import * as xstate358 from "xstate";
5
6
 
6
7
  //#region src/modules/document-capture/types.d.ts
7
8
  type DocumentType = 'addressStatement' | 'otherDocument1' | 'otherDocument2' | 'otherDocument3' | 'v5cMultiPageLogbook' | 'circulationCard' | 'financeSettlement' | 'carInvoice' | 'capture' | 'processPoaOcr' | 'processLoaOcr' | 'processAsylumSeekerVisaZaf' | 'processBankStatementOCR' | 'processBankCheck' | 'processV5CLogbook' | 'processCarInvoice' | 'processCirculationCard' | 'processFinanceSettlement';
@@ -71,6 +72,7 @@ type DocumentCaptureNextPageType = 'none' | 'required' | 'optional';
71
72
  type DocumentCaptureContext = {
72
73
  config: DocumentCaptureResolvedConfig;
73
74
  stream: CameraStream | undefined;
75
+ permissionResult: PermissionResult | 'refresh' | undefined;
74
76
  capturedDocument: CapturedDocument | undefined;
75
77
  captureMethod: 'camera' | 'file' | 'gallery' | undefined;
76
78
  progress: number;
@@ -84,7 +86,7 @@ type DocumentCaptureInput = {
84
86
  };
85
87
  //#endregion
86
88
  //#region src/modules/document-capture/documentCaptureStateMachine.d.ts
87
- declare const documentCaptureMachine: xstate763.StateMachine<DocumentCaptureContext, {
89
+ declare const documentCaptureMachine: xstate358.StateMachine<DocumentCaptureContext, {
88
90
  type: "CAPTURE";
89
91
  } | {
90
92
  type: "FILE_SELECTED";
@@ -110,112 +112,134 @@ declare const documentCaptureMachine: xstate763.StateMachine<DocumentCaptureCont
110
112
  type: "ALL_PAGES_CAPTURED";
111
113
  } | {
112
114
  type: "SKIP";
115
+ } | {
116
+ type: "REQUEST_PERMISSION";
117
+ } | {
118
+ type: "GO_TO_LEARN_MORE";
119
+ } | {
120
+ type: "BACK";
113
121
  } | {
114
122
  type: "CLOSE";
115
123
  }, {
116
- [x: string]: xstate763.ActorRefFromLogic<xstate763.PromiseActorLogic<MediaStream, void, xstate763.EventObject>> | xstate763.ActorRefFromLogic<xstate763.PromiseActorLogic<DocumentUploadResponse, {
124
+ [x: string]: xstate358.ActorRefFromLogic<xstate358.PromiseActorLogic<MediaStream, void, xstate358.EventObject>> | xstate358.ActorRefFromLogic<xstate358.PromiseActorLogic<DocumentUploadResponse, {
117
125
  capturedDocument: NonNullable<DocumentCaptureContext["capturedDocument"]>;
118
126
  processingType: string;
119
127
  onProgress: (progress: number) => void;
120
- }, xstate763.EventObject>> | xstate763.ActorRefFromLogic<xstate763.PromiseActorLogic<FinalizeDocumentResponse, {
128
+ }, xstate358.EventObject>> | xstate358.ActorRefFromLogic<xstate358.PromiseActorLogic<PermissionResult, {
129
+ permissionResult?: PermissionResult;
130
+ requestMotionPermission: boolean;
131
+ }, xstate358.EventObject>> | xstate358.ActorRefFromLogic<xstate358.PromiseActorLogic<PermissionResult, void, xstate358.EventObject>> | xstate358.ActorRefFromLogic<xstate358.PromiseActorLogic<FinalizeDocumentResponse, {
121
132
  processingType: string;
122
- }, xstate763.EventObject>> | undefined;
123
- }, xstate763.Values<{
133
+ }, xstate358.EventObject>> | undefined;
134
+ }, xstate358.Values<{
124
135
  uploadDocument: {
125
136
  src: "uploadDocument";
126
- logic: xstate763.PromiseActorLogic<DocumentUploadResponse, {
137
+ logic: xstate358.PromiseActorLogic<DocumentUploadResponse, {
127
138
  capturedDocument: NonNullable<DocumentCaptureContext["capturedDocument"]>;
128
139
  processingType: string;
129
140
  onProgress: (progress: number) => void;
130
- }, xstate763.EventObject>;
141
+ }, xstate358.EventObject>;
142
+ id: string | undefined;
143
+ };
144
+ requestPermission: {
145
+ src: "requestPermission";
146
+ logic: xstate358.PromiseActorLogic<PermissionResult, {
147
+ permissionResult?: PermissionResult;
148
+ requestMotionPermission: boolean;
149
+ }, xstate358.EventObject>;
131
150
  id: string | undefined;
132
151
  };
133
152
  initCamera: {
134
153
  src: "initCamera";
135
- logic: xstate763.PromiseActorLogic<MediaStream, void, xstate763.EventObject>;
154
+ logic: xstate358.PromiseActorLogic<MediaStream, void, xstate358.EventObject>;
155
+ id: string | undefined;
156
+ };
157
+ checkPermission: {
158
+ src: "checkPermission";
159
+ logic: xstate358.PromiseActorLogic<PermissionResult, void, xstate358.EventObject>;
136
160
  id: string | undefined;
137
161
  };
138
162
  finalizeDocumentRequest: {
139
163
  src: "finalizeDocumentRequest";
140
- logic: xstate763.PromiseActorLogic<FinalizeDocumentResponse, {
164
+ logic: xstate358.PromiseActorLogic<FinalizeDocumentResponse, {
141
165
  processingType: string;
142
- }, xstate763.EventObject>;
166
+ }, xstate358.EventObject>;
143
167
  id: string | undefined;
144
168
  };
145
- }>, xstate763.Values<{
169
+ }>, xstate358.Values<{
146
170
  clearError: {
147
171
  type: "clearError";
148
- params: xstate763.NonReducibleUnknown;
172
+ params: xstate358.NonReducibleUnknown;
149
173
  };
150
174
  setStream: {
151
175
  type: "setStream";
152
- params: xstate763.NonReducibleUnknown;
176
+ params: xstate358.NonReducibleUnknown;
153
177
  };
154
178
  setProgress: {
155
179
  type: "setProgress";
156
- params: xstate763.NonReducibleUnknown;
180
+ params: xstate358.NonReducibleUnknown;
157
181
  };
158
182
  stopStream: {
159
183
  type: "stopStream";
160
- params: xstate763.NonReducibleUnknown;
184
+ params: xstate358.NonReducibleUnknown;
161
185
  };
162
186
  setCapturedDocument: {
163
187
  type: "setCapturedDocument";
164
- params: xstate763.NonReducibleUnknown;
188
+ params: xstate358.NonReducibleUnknown;
165
189
  };
166
190
  setFileTooLargeError: {
167
191
  type: "setFileTooLargeError";
168
- params: xstate763.NonReducibleUnknown;
192
+ params: xstate358.NonReducibleUnknown;
169
193
  };
170
194
  setUploadError: {
171
195
  type: "setUploadError";
172
- params: xstate763.NonReducibleUnknown;
196
+ params: xstate358.NonReducibleUnknown;
173
197
  };
174
198
  setFinalizeError: {
175
199
  type: "setFinalizeError";
176
- params: xstate763.NonReducibleUnknown;
200
+ params: xstate358.NonReducibleUnknown;
177
201
  };
178
202
  decrementAttemptsRemaining: {
179
203
  type: "decrementAttemptsRemaining";
180
- params: xstate763.NonReducibleUnknown;
204
+ params: xstate358.NonReducibleUnknown;
181
205
  };
182
206
  setCaptureMethodFile: {
183
207
  type: "setCaptureMethodFile";
184
- params: xstate763.NonReducibleUnknown;
208
+ params: xstate358.NonReducibleUnknown;
185
209
  };
186
210
  setCaptureMethodCamera: {
187
211
  type: "setCaptureMethodCamera";
188
- params: xstate763.NonReducibleUnknown;
212
+ params: xstate358.NonReducibleUnknown;
189
213
  };
190
214
  setCaptureMethodGallery: {
191
215
  type: "setCaptureMethodGallery";
192
- params: xstate763.NonReducibleUnknown;
216
+ params: xstate358.NonReducibleUnknown;
193
217
  };
194
218
  clearCapturedDocument: {
195
219
  type: "clearCapturedDocument";
196
- params: xstate763.NonReducibleUnknown;
220
+ params: xstate358.NonReducibleUnknown;
197
221
  };
198
222
  resetPageNumber: {
199
223
  type: "resetPageNumber";
200
- params: xstate763.NonReducibleUnknown;
224
+ params: xstate358.NonReducibleUnknown;
201
225
  };
202
226
  clearCapturedDocumentGalleryRetake: {
203
227
  type: "clearCapturedDocumentGalleryRetake";
204
- params: xstate763.NonReducibleUnknown;
228
+ params: xstate358.NonReducibleUnknown;
205
229
  };
206
230
  setNextPageType: {
207
231
  type: "setNextPageType";
208
- params: xstate763.NonReducibleUnknown;
232
+ params: xstate358.NonReducibleUnknown;
209
233
  };
210
234
  clearForNextPage: {
211
235
  type: "clearForNextPage";
212
- params: xstate763.NonReducibleUnknown;
236
+ params: xstate358.NonReducibleUnknown;
213
237
  };
214
238
  resetProgress: {
215
239
  type: "resetProgress";
216
- params: xstate763.NonReducibleUnknown;
240
+ params: xstate358.NonReducibleUnknown;
217
241
  };
218
- }>, xstate763.Values<{
242
+ }>, xstate358.Values<{
219
243
  allowSkip: {
220
244
  type: "allowSkip";
221
245
  params: unknown;
@@ -236,6 +260,14 @@ declare const documentCaptureMachine: xstate763.StateMachine<DocumentCaptureCont
236
260
  type: "isCameraMode";
237
261
  params: unknown;
238
262
  };
263
+ isCameraPermissionGranted: {
264
+ type: "isCameraPermissionGranted";
265
+ params: unknown;
266
+ };
267
+ isCameraPermissionDenied: {
268
+ type: "isCameraPermissionDenied";
269
+ params: unknown;
270
+ };
239
271
  isCaptureMethodCamera: {
240
272
  type: "isCaptureMethodCamera";
241
273
  params: unknown;
@@ -268,102 +300,153 @@ declare const documentCaptureMachine: xstate763.StateMachine<DocumentCaptureCont
268
300
  type: "fileSizeOkForNonGallery";
269
301
  params: unknown;
270
302
  };
271
- }>, never, "uploading" | "closed" | "success" | "finished" | "initCamera" | "capturing" | "tutorial" | "preview" | "failure" | "nextPage" | "finalizing", string, DocumentCaptureInput, xstate763.NonReducibleUnknown, xstate763.EventObject, xstate763.MetaObject, {
303
+ }>, never, "uploading" | "closed" | "success" | "finished" | "initCamera" | "capturing" | "tutorial" | "preview" | "failure" | "nextPage" | "finalizing" | {
304
+ permissions: "idle" | "denied" | "waitingForUser" | "requesting" | "learnMore";
305
+ }, string, DocumentCaptureInput, xstate358.NonReducibleUnknown, xstate358.EventObject, xstate358.MetaObject, {
272
306
  readonly id: "documentCapture";
273
307
  readonly initial: "tutorial";
274
308
  readonly context: ({
275
309
  input
276
310
  }: {
277
311
  spawn: {
278
- <TSrc extends "uploadDocument" | "initCamera" | "finalizeDocumentRequest">(logic: TSrc, ...[options]: ({
312
+ <TSrc extends "uploadDocument" | "requestPermission" | "initCamera" | "checkPermission" | "finalizeDocumentRequest">(logic: TSrc, ...[options]: ({
279
313
  src: "uploadDocument";
280
- logic: xstate763.PromiseActorLogic<DocumentUploadResponse, {
314
+ logic: xstate358.PromiseActorLogic<DocumentUploadResponse, {
281
315
  capturedDocument: NonNullable<DocumentCaptureContext["capturedDocument"]>;
282
316
  processingType: string;
283
317
  onProgress: (progress: number) => void;
284
- }, xstate763.EventObject>;
318
+ }, xstate358.EventObject>;
285
319
  id: string | undefined;
286
320
  } extends infer T ? T extends {
287
321
  src: "uploadDocument";
288
- logic: xstate763.PromiseActorLogic<DocumentUploadResponse, {
322
+ logic: xstate358.PromiseActorLogic<DocumentUploadResponse, {
289
323
  capturedDocument: NonNullable<DocumentCaptureContext["capturedDocument"]>;
290
324
  processingType: string;
291
325
  onProgress: (progress: number) => void;
292
- }, xstate763.EventObject>;
326
+ }, xstate358.EventObject>;
293
327
  id: string | undefined;
294
328
  } ? T extends {
295
329
  src: TSrc;
296
- } ? xstate763.ConditionalRequired<[options?: ({
330
+ } ? xstate358.ConditionalRequired<[options?: ({
297
331
  id?: T["id"] | undefined;
298
332
  systemId?: string;
299
- input?: xstate763.InputFrom<T["logic"]> | undefined;
333
+ input?: xstate358.InputFrom<T["logic"]> | undefined;
300
334
  syncSnapshot?: boolean;
301
- } & { [K in xstate763.RequiredActorOptions<T>]: unknown }) | undefined], xstate763.IsNotNever<xstate763.RequiredActorOptions<T>>> : never : never : never) | ({
302
- src: "initCamera";
303
- logic: xstate763.PromiseActorLogic<MediaStream, void, xstate763.EventObject>;
335
+ } & { [K in xstate358.RequiredActorOptions<T>]: unknown }) | undefined], xstate358.IsNotNever<xstate358.RequiredActorOptions<T>>> : never : never : never) | ({
336
+ src: "requestPermission";
337
+ logic: xstate358.PromiseActorLogic<PermissionResult, {
338
+ permissionResult?: PermissionResult;
339
+ requestMotionPermission: boolean;
340
+ }, xstate358.EventObject>;
304
341
  id: string | undefined;
305
342
  } extends infer T_1 ? T_1 extends {
306
- src: "initCamera";
307
- logic: xstate763.PromiseActorLogic<MediaStream, void, xstate763.EventObject>;
343
+ src: "requestPermission";
344
+ logic: xstate358.PromiseActorLogic<PermissionResult, {
345
+ permissionResult?: PermissionResult;
346
+ requestMotionPermission: boolean;
347
+ }, xstate358.EventObject>;
308
348
  id: string | undefined;
309
349
  } ? T_1 extends {
310
350
  src: TSrc;
311
- } ? xstate763.ConditionalRequired<[options?: ({
351
+ } ? xstate358.ConditionalRequired<[options?: ({
312
352
  id?: T_1["id"] | undefined;
313
353
  systemId?: string;
314
- input?: xstate763.InputFrom<T_1["logic"]> | undefined;
354
+ input?: xstate358.InputFrom<T_1["logic"]> | undefined;
315
355
  syncSnapshot?: boolean;
316
- } & { [K_1 in xstate763.RequiredActorOptions<T_1>]: unknown }) | undefined], xstate763.IsNotNever<xstate763.RequiredActorOptions<T_1>>> : never : never : never) | ({
356
+ } & { [K_1 in xstate358.RequiredActorOptions<T_1>]: unknown }) | undefined], xstate358.IsNotNever<xstate358.RequiredActorOptions<T_1>>> : never : never : never) | ({
357
+ src: "initCamera";
358
+ logic: xstate358.PromiseActorLogic<MediaStream, void, xstate358.EventObject>;
359
+ id: string | undefined;
360
+ } extends infer T_2 ? T_2 extends {
361
+ src: "initCamera";
362
+ logic: xstate358.PromiseActorLogic<MediaStream, void, xstate358.EventObject>;
363
+ id: string | undefined;
364
+ } ? T_2 extends {
365
+ src: TSrc;
366
+ } ? xstate358.ConditionalRequired<[options?: ({
367
+ id?: T_2["id"] | undefined;
368
+ systemId?: string;
369
+ input?: xstate358.InputFrom<T_2["logic"]> | undefined;
370
+ syncSnapshot?: boolean;
371
+ } & { [K_2 in xstate358.RequiredActorOptions<T_2>]: unknown }) | undefined], xstate358.IsNotNever<xstate358.RequiredActorOptions<T_2>>> : never : never : never) | ({
372
+ src: "checkPermission";
373
+ logic: xstate358.PromiseActorLogic<PermissionResult, void, xstate358.EventObject>;
374
+ id: string | undefined;
375
+ } extends infer T_3 ? T_3 extends {
376
+ src: "checkPermission";
377
+ logic: xstate358.PromiseActorLogic<PermissionResult, void, xstate358.EventObject>;
378
+ id: string | undefined;
379
+ } ? T_3 extends {
380
+ src: TSrc;
381
+ } ? xstate358.ConditionalRequired<[options?: ({
382
+ id?: T_3["id"] | undefined;
383
+ systemId?: string;
384
+ input?: xstate358.InputFrom<T_3["logic"]> | undefined;
385
+ syncSnapshot?: boolean;
386
+ } & { [K_3 in xstate358.RequiredActorOptions<T_3>]: unknown }) | undefined], xstate358.IsNotNever<xstate358.RequiredActorOptions<T_3>>> : never : never : never) | ({
317
387
  src: "finalizeDocumentRequest";
318
- logic: xstate763.PromiseActorLogic<FinalizeDocumentResponse, {
388
+ logic: xstate358.PromiseActorLogic<FinalizeDocumentResponse, {
319
389
  processingType: string;
320
- }, xstate763.EventObject>;
390
+ }, xstate358.EventObject>;
321
391
  id: string | undefined;
322
- } extends infer T_2 ? T_2 extends {
392
+ } extends infer T_4 ? T_4 extends {
323
393
  src: "finalizeDocumentRequest";
324
- logic: xstate763.PromiseActorLogic<FinalizeDocumentResponse, {
394
+ logic: xstate358.PromiseActorLogic<FinalizeDocumentResponse, {
325
395
  processingType: string;
326
- }, xstate763.EventObject>;
396
+ }, xstate358.EventObject>;
327
397
  id: string | undefined;
328
- } ? T_2 extends {
398
+ } ? T_4 extends {
329
399
  src: TSrc;
330
- } ? xstate763.ConditionalRequired<[options?: ({
331
- id?: T_2["id"] | undefined;
400
+ } ? xstate358.ConditionalRequired<[options?: ({
401
+ id?: T_4["id"] | undefined;
332
402
  systemId?: string;
333
- input?: xstate763.InputFrom<T_2["logic"]> | undefined;
403
+ input?: xstate358.InputFrom<T_4["logic"]> | undefined;
334
404
  syncSnapshot?: boolean;
335
- } & { [K_2 in xstate763.RequiredActorOptions<T_2>]: unknown }) | undefined], xstate763.IsNotNever<xstate763.RequiredActorOptions<T_2>>> : never : never : never)): xstate763.ActorRefFromLogic<xstate763.GetConcreteByKey<xstate763.Values<{
405
+ } & { [K_4 in xstate358.RequiredActorOptions<T_4>]: unknown }) | undefined], xstate358.IsNotNever<xstate358.RequiredActorOptions<T_4>>> : never : never : never)): xstate358.ActorRefFromLogic<xstate358.GetConcreteByKey<xstate358.Values<{
336
406
  uploadDocument: {
337
407
  src: "uploadDocument";
338
- logic: xstate763.PromiseActorLogic<DocumentUploadResponse, {
408
+ logic: xstate358.PromiseActorLogic<DocumentUploadResponse, {
339
409
  capturedDocument: NonNullable<DocumentCaptureContext["capturedDocument"]>;
340
410
  processingType: string;
341
411
  onProgress: (progress: number) => void;
342
- }, xstate763.EventObject>;
412
+ }, xstate358.EventObject>;
413
+ id: string | undefined;
414
+ };
415
+ requestPermission: {
416
+ src: "requestPermission";
417
+ logic: xstate358.PromiseActorLogic<PermissionResult, {
418
+ permissionResult?: PermissionResult;
419
+ requestMotionPermission: boolean;
420
+ }, xstate358.EventObject>;
343
421
  id: string | undefined;
344
422
  };
345
423
  initCamera: {
346
424
  src: "initCamera";
347
- logic: xstate763.PromiseActorLogic<MediaStream, void, xstate763.EventObject>;
425
+ logic: xstate358.PromiseActorLogic<MediaStream, void, xstate358.EventObject>;
426
+ id: string | undefined;
427
+ };
428
+ checkPermission: {
429
+ src: "checkPermission";
430
+ logic: xstate358.PromiseActorLogic<PermissionResult, void, xstate358.EventObject>;
348
431
  id: string | undefined;
349
432
  };
350
433
  finalizeDocumentRequest: {
351
434
  src: "finalizeDocumentRequest";
352
- logic: xstate763.PromiseActorLogic<FinalizeDocumentResponse, {
435
+ logic: xstate358.PromiseActorLogic<FinalizeDocumentResponse, {
353
436
  processingType: string;
354
- }, xstate763.EventObject>;
437
+ }, xstate358.EventObject>;
355
438
  id: string | undefined;
356
439
  };
357
440
  }>, "src", TSrc>["logic"]>;
358
- <TLogic extends xstate763.AnyActorLogic>(src: TLogic, ...[options]: xstate763.ConditionalRequired<[options?: ({
441
+ <TLogic extends xstate358.AnyActorLogic>(src: TLogic, ...[options]: xstate358.ConditionalRequired<[options?: ({
359
442
  id?: never;
360
443
  systemId?: string;
361
- input?: xstate763.InputFrom<TLogic> | undefined;
444
+ input?: xstate358.InputFrom<TLogic> | undefined;
362
445
  syncSnapshot?: boolean;
363
- } & { [K in xstate763.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate763.IsNotNever<xstate763.RequiredLogicInput<TLogic>>>): xstate763.ActorRefFromLogic<TLogic>;
446
+ } & { [K in xstate358.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate358.IsNotNever<xstate358.RequiredLogicInput<TLogic>>>): xstate358.ActorRefFromLogic<TLogic>;
364
447
  };
365
448
  input: DocumentCaptureInput;
366
- self: xstate763.ActorRef<xstate763.MachineSnapshot<DocumentCaptureContext, {
449
+ self: xstate358.ActorRef<xstate358.MachineSnapshot<DocumentCaptureContext, {
367
450
  type: "CAPTURE";
368
451
  } | {
369
452
  type: "FILE_SELECTED";
@@ -389,9 +472,15 @@ declare const documentCaptureMachine: xstate763.StateMachine<DocumentCaptureCont
389
472
  type: "ALL_PAGES_CAPTURED";
390
473
  } | {
391
474
  type: "SKIP";
475
+ } | {
476
+ type: "REQUEST_PERMISSION";
477
+ } | {
478
+ type: "GO_TO_LEARN_MORE";
479
+ } | {
480
+ type: "BACK";
392
481
  } | {
393
482
  type: "CLOSE";
394
- }, Record<string, xstate763.AnyActorRef | undefined>, xstate763.StateValue, string, unknown, any, any>, {
483
+ }, Record<string, xstate358.AnyActorRef | undefined>, xstate358.StateValue, string, unknown, any, any>, {
395
484
  type: "CAPTURE";
396
485
  } | {
397
486
  type: "FILE_SELECTED";
@@ -417,9 +506,15 @@ declare const documentCaptureMachine: xstate763.StateMachine<DocumentCaptureCont
417
506
  type: "ALL_PAGES_CAPTURED";
418
507
  } | {
419
508
  type: "SKIP";
509
+ } | {
510
+ type: "REQUEST_PERMISSION";
511
+ } | {
512
+ type: "GO_TO_LEARN_MORE";
513
+ } | {
514
+ type: "BACK";
420
515
  } | {
421
516
  type: "CLOSE";
422
- }, xstate763.AnyEventObject>;
517
+ }, xstate358.AnyEventObject>;
423
518
  }) => {
424
519
  config: {
425
520
  processingType: DocumentType;
@@ -434,6 +529,7 @@ declare const documentCaptureMachine: xstate763.StateMachine<DocumentCaptureCont
434
529
  step2Text: string | undefined;
435
530
  };
436
531
  stream: undefined;
532
+ permissionResult: undefined;
437
533
  capturedDocument: undefined;
438
534
  captureMethod: undefined;
439
535
  progress: number;
@@ -446,7 +542,7 @@ declare const documentCaptureMachine: xstate763.StateMachine<DocumentCaptureCont
446
542
  readonly tutorial: {
447
543
  readonly on: {
448
544
  readonly CAPTURE: readonly [{
449
- readonly target: "initCamera";
545
+ readonly target: "permissions";
450
546
  readonly guard: "isCameraMode";
451
547
  }, {
452
548
  readonly target: "capturing";
@@ -468,6 +564,776 @@ declare const documentCaptureMachine: xstate763.StateMachine<DocumentCaptureCont
468
564
  };
469
565
  };
470
566
  };
567
+ readonly permissions: {
568
+ readonly initial: "idle";
569
+ readonly states: {
570
+ readonly idle: {
571
+ readonly invoke: {
572
+ readonly id: "checkPermissionIdle";
573
+ readonly src: "checkPermission";
574
+ readonly onDone: readonly [{
575
+ readonly target: "#documentCapture.initCamera";
576
+ readonly guard: "isCameraPermissionGranted";
577
+ readonly actions: xstate358.ActionFunction<DocumentCaptureContext, xstate358.DoneActorEvent<PermissionResult, string>, {
578
+ type: "CAPTURE";
579
+ } | {
580
+ type: "FILE_SELECTED";
581
+ file: File;
582
+ imageBase64: string;
583
+ fileType: string;
584
+ } | {
585
+ type: "ACCEPT";
586
+ } | {
587
+ type: "RETAKE";
588
+ } | {
589
+ type: "UPLOAD_PROGRESS";
590
+ progress: number;
591
+ } | {
592
+ type: "RETRY";
593
+ } | {
594
+ type: "CONTINUE";
595
+ } | {
596
+ type: "NEXT_PAGE_CAMERA";
597
+ } | {
598
+ type: "NEXT_PAGE_PHOTO_LIBRARY";
599
+ } | {
600
+ type: "ALL_PAGES_CAPTURED";
601
+ } | {
602
+ type: "SKIP";
603
+ } | {
604
+ type: "REQUEST_PERMISSION";
605
+ } | {
606
+ type: "GO_TO_LEARN_MORE";
607
+ } | {
608
+ type: "BACK";
609
+ } | {
610
+ type: "CLOSE";
611
+ }, undefined, xstate358.Values<{
612
+ uploadDocument: {
613
+ src: "uploadDocument";
614
+ logic: xstate358.PromiseActorLogic<DocumentUploadResponse, {
615
+ capturedDocument: NonNullable<DocumentCaptureContext["capturedDocument"]>;
616
+ processingType: string;
617
+ onProgress: (progress: number) => void;
618
+ }, xstate358.EventObject>;
619
+ id: string | undefined;
620
+ };
621
+ requestPermission: {
622
+ src: "requestPermission";
623
+ logic: xstate358.PromiseActorLogic<PermissionResult, {
624
+ permissionResult?: PermissionResult;
625
+ requestMotionPermission: boolean;
626
+ }, xstate358.EventObject>;
627
+ id: string | undefined;
628
+ };
629
+ initCamera: {
630
+ src: "initCamera";
631
+ logic: xstate358.PromiseActorLogic<MediaStream, void, xstate358.EventObject>;
632
+ id: string | undefined;
633
+ };
634
+ checkPermission: {
635
+ src: "checkPermission";
636
+ logic: xstate358.PromiseActorLogic<PermissionResult, void, xstate358.EventObject>;
637
+ id: string | undefined;
638
+ };
639
+ finalizeDocumentRequest: {
640
+ src: "finalizeDocumentRequest";
641
+ logic: xstate358.PromiseActorLogic<FinalizeDocumentResponse, {
642
+ processingType: string;
643
+ }, xstate358.EventObject>;
644
+ id: string | undefined;
645
+ };
646
+ }>, never, never, never, never>;
647
+ }, {
648
+ readonly target: "denied";
649
+ readonly guard: "isCameraPermissionDenied";
650
+ readonly actions: xstate358.ActionFunction<DocumentCaptureContext, xstate358.DoneActorEvent<PermissionResult, string>, {
651
+ type: "CAPTURE";
652
+ } | {
653
+ type: "FILE_SELECTED";
654
+ file: File;
655
+ imageBase64: string;
656
+ fileType: string;
657
+ } | {
658
+ type: "ACCEPT";
659
+ } | {
660
+ type: "RETAKE";
661
+ } | {
662
+ type: "UPLOAD_PROGRESS";
663
+ progress: number;
664
+ } | {
665
+ type: "RETRY";
666
+ } | {
667
+ type: "CONTINUE";
668
+ } | {
669
+ type: "NEXT_PAGE_CAMERA";
670
+ } | {
671
+ type: "NEXT_PAGE_PHOTO_LIBRARY";
672
+ } | {
673
+ type: "ALL_PAGES_CAPTURED";
674
+ } | {
675
+ type: "SKIP";
676
+ } | {
677
+ type: "REQUEST_PERMISSION";
678
+ } | {
679
+ type: "GO_TO_LEARN_MORE";
680
+ } | {
681
+ type: "BACK";
682
+ } | {
683
+ type: "CLOSE";
684
+ }, undefined, xstate358.Values<{
685
+ uploadDocument: {
686
+ src: "uploadDocument";
687
+ logic: xstate358.PromiseActorLogic<DocumentUploadResponse, {
688
+ capturedDocument: NonNullable<DocumentCaptureContext["capturedDocument"]>;
689
+ processingType: string;
690
+ onProgress: (progress: number) => void;
691
+ }, xstate358.EventObject>;
692
+ id: string | undefined;
693
+ };
694
+ requestPermission: {
695
+ src: "requestPermission";
696
+ logic: xstate358.PromiseActorLogic<PermissionResult, {
697
+ permissionResult?: PermissionResult;
698
+ requestMotionPermission: boolean;
699
+ }, xstate358.EventObject>;
700
+ id: string | undefined;
701
+ };
702
+ initCamera: {
703
+ src: "initCamera";
704
+ logic: xstate358.PromiseActorLogic<MediaStream, void, xstate358.EventObject>;
705
+ id: string | undefined;
706
+ };
707
+ checkPermission: {
708
+ src: "checkPermission";
709
+ logic: xstate358.PromiseActorLogic<PermissionResult, void, xstate358.EventObject>;
710
+ id: string | undefined;
711
+ };
712
+ finalizeDocumentRequest: {
713
+ src: "finalizeDocumentRequest";
714
+ logic: xstate358.PromiseActorLogic<FinalizeDocumentResponse, {
715
+ processingType: string;
716
+ }, xstate358.EventObject>;
717
+ id: string | undefined;
718
+ };
719
+ }>, never, never, never, never>;
720
+ }, {
721
+ readonly target: "waitingForUser";
722
+ readonly actions: xstate358.ActionFunction<DocumentCaptureContext, xstate358.DoneActorEvent<PermissionResult, string>, {
723
+ type: "CAPTURE";
724
+ } | {
725
+ type: "FILE_SELECTED";
726
+ file: File;
727
+ imageBase64: string;
728
+ fileType: string;
729
+ } | {
730
+ type: "ACCEPT";
731
+ } | {
732
+ type: "RETAKE";
733
+ } | {
734
+ type: "UPLOAD_PROGRESS";
735
+ progress: number;
736
+ } | {
737
+ type: "RETRY";
738
+ } | {
739
+ type: "CONTINUE";
740
+ } | {
741
+ type: "NEXT_PAGE_CAMERA";
742
+ } | {
743
+ type: "NEXT_PAGE_PHOTO_LIBRARY";
744
+ } | {
745
+ type: "ALL_PAGES_CAPTURED";
746
+ } | {
747
+ type: "SKIP";
748
+ } | {
749
+ type: "REQUEST_PERMISSION";
750
+ } | {
751
+ type: "GO_TO_LEARN_MORE";
752
+ } | {
753
+ type: "BACK";
754
+ } | {
755
+ type: "CLOSE";
756
+ }, undefined, xstate358.Values<{
757
+ uploadDocument: {
758
+ src: "uploadDocument";
759
+ logic: xstate358.PromiseActorLogic<DocumentUploadResponse, {
760
+ capturedDocument: NonNullable<DocumentCaptureContext["capturedDocument"]>;
761
+ processingType: string;
762
+ onProgress: (progress: number) => void;
763
+ }, xstate358.EventObject>;
764
+ id: string | undefined;
765
+ };
766
+ requestPermission: {
767
+ src: "requestPermission";
768
+ logic: xstate358.PromiseActorLogic<PermissionResult, {
769
+ permissionResult?: PermissionResult;
770
+ requestMotionPermission: boolean;
771
+ }, xstate358.EventObject>;
772
+ id: string | undefined;
773
+ };
774
+ initCamera: {
775
+ src: "initCamera";
776
+ logic: xstate358.PromiseActorLogic<MediaStream, void, xstate358.EventObject>;
777
+ id: string | undefined;
778
+ };
779
+ checkPermission: {
780
+ src: "checkPermission";
781
+ logic: xstate358.PromiseActorLogic<PermissionResult, void, xstate358.EventObject>;
782
+ id: string | undefined;
783
+ };
784
+ finalizeDocumentRequest: {
785
+ src: "finalizeDocumentRequest";
786
+ logic: xstate358.PromiseActorLogic<FinalizeDocumentResponse, {
787
+ processingType: string;
788
+ }, xstate358.EventObject>;
789
+ id: string | undefined;
790
+ };
791
+ }>, never, never, never, never>;
792
+ }];
793
+ readonly onError: {
794
+ readonly target: "waitingForUser";
795
+ readonly actions: xstate358.ActionFunction<DocumentCaptureContext, xstate358.ErrorActorEvent<unknown, string>, {
796
+ type: "CAPTURE";
797
+ } | {
798
+ type: "FILE_SELECTED";
799
+ file: File;
800
+ imageBase64: string;
801
+ fileType: string;
802
+ } | {
803
+ type: "ACCEPT";
804
+ } | {
805
+ type: "RETAKE";
806
+ } | {
807
+ type: "UPLOAD_PROGRESS";
808
+ progress: number;
809
+ } | {
810
+ type: "RETRY";
811
+ } | {
812
+ type: "CONTINUE";
813
+ } | {
814
+ type: "NEXT_PAGE_CAMERA";
815
+ } | {
816
+ type: "NEXT_PAGE_PHOTO_LIBRARY";
817
+ } | {
818
+ type: "ALL_PAGES_CAPTURED";
819
+ } | {
820
+ type: "SKIP";
821
+ } | {
822
+ type: "REQUEST_PERMISSION";
823
+ } | {
824
+ type: "GO_TO_LEARN_MORE";
825
+ } | {
826
+ type: "BACK";
827
+ } | {
828
+ type: "CLOSE";
829
+ }, undefined, xstate358.Values<{
830
+ uploadDocument: {
831
+ src: "uploadDocument";
832
+ logic: xstate358.PromiseActorLogic<DocumentUploadResponse, {
833
+ capturedDocument: NonNullable<DocumentCaptureContext["capturedDocument"]>;
834
+ processingType: string;
835
+ onProgress: (progress: number) => void;
836
+ }, xstate358.EventObject>;
837
+ id: string | undefined;
838
+ };
839
+ requestPermission: {
840
+ src: "requestPermission";
841
+ logic: xstate358.PromiseActorLogic<PermissionResult, {
842
+ permissionResult?: PermissionResult;
843
+ requestMotionPermission: boolean;
844
+ }, xstate358.EventObject>;
845
+ id: string | undefined;
846
+ };
847
+ initCamera: {
848
+ src: "initCamera";
849
+ logic: xstate358.PromiseActorLogic<MediaStream, void, xstate358.EventObject>;
850
+ id: string | undefined;
851
+ };
852
+ checkPermission: {
853
+ src: "checkPermission";
854
+ logic: xstate358.PromiseActorLogic<PermissionResult, void, xstate358.EventObject>;
855
+ id: string | undefined;
856
+ };
857
+ finalizeDocumentRequest: {
858
+ src: "finalizeDocumentRequest";
859
+ logic: xstate358.PromiseActorLogic<FinalizeDocumentResponse, {
860
+ processingType: string;
861
+ }, xstate358.EventObject>;
862
+ id: string | undefined;
863
+ };
864
+ }>, never, never, never, never>;
865
+ };
866
+ };
867
+ readonly on: {
868
+ readonly REQUEST_PERMISSION: "requesting";
869
+ readonly GO_TO_LEARN_MORE: "learnMore";
870
+ };
871
+ };
872
+ readonly waitingForUser: {
873
+ readonly on: {
874
+ readonly REQUEST_PERMISSION: "requesting";
875
+ readonly GO_TO_LEARN_MORE: "learnMore";
876
+ };
877
+ };
878
+ readonly learnMore: {
879
+ readonly on: {
880
+ readonly BACK: "idle";
881
+ readonly REQUEST_PERMISSION: "requesting";
882
+ };
883
+ };
884
+ readonly requesting: {
885
+ readonly invoke: {
886
+ readonly id: "requestPermission";
887
+ readonly src: "requestPermission";
888
+ readonly input: ({
889
+ context
890
+ }: {
891
+ context: DocumentCaptureContext;
892
+ event: {
893
+ type: "CAPTURE";
894
+ } | {
895
+ type: "FILE_SELECTED";
896
+ file: File;
897
+ imageBase64: string;
898
+ fileType: string;
899
+ } | {
900
+ type: "ACCEPT";
901
+ } | {
902
+ type: "RETAKE";
903
+ } | {
904
+ type: "UPLOAD_PROGRESS";
905
+ progress: number;
906
+ } | {
907
+ type: "RETRY";
908
+ } | {
909
+ type: "CONTINUE";
910
+ } | {
911
+ type: "NEXT_PAGE_CAMERA";
912
+ } | {
913
+ type: "NEXT_PAGE_PHOTO_LIBRARY";
914
+ } | {
915
+ type: "ALL_PAGES_CAPTURED";
916
+ } | {
917
+ type: "SKIP";
918
+ } | {
919
+ type: "REQUEST_PERMISSION";
920
+ } | {
921
+ type: "GO_TO_LEARN_MORE";
922
+ } | {
923
+ type: "BACK";
924
+ } | {
925
+ type: "CLOSE";
926
+ };
927
+ self: xstate358.ActorRef<xstate358.MachineSnapshot<DocumentCaptureContext, {
928
+ type: "CAPTURE";
929
+ } | {
930
+ type: "FILE_SELECTED";
931
+ file: File;
932
+ imageBase64: string;
933
+ fileType: string;
934
+ } | {
935
+ type: "ACCEPT";
936
+ } | {
937
+ type: "RETAKE";
938
+ } | {
939
+ type: "UPLOAD_PROGRESS";
940
+ progress: number;
941
+ } | {
942
+ type: "RETRY";
943
+ } | {
944
+ type: "CONTINUE";
945
+ } | {
946
+ type: "NEXT_PAGE_CAMERA";
947
+ } | {
948
+ type: "NEXT_PAGE_PHOTO_LIBRARY";
949
+ } | {
950
+ type: "ALL_PAGES_CAPTURED";
951
+ } | {
952
+ type: "SKIP";
953
+ } | {
954
+ type: "REQUEST_PERMISSION";
955
+ } | {
956
+ type: "GO_TO_LEARN_MORE";
957
+ } | {
958
+ type: "BACK";
959
+ } | {
960
+ type: "CLOSE";
961
+ }, Record<string, xstate358.AnyActorRef>, xstate358.StateValue, string, unknown, any, any>, {
962
+ type: "CAPTURE";
963
+ } | {
964
+ type: "FILE_SELECTED";
965
+ file: File;
966
+ imageBase64: string;
967
+ fileType: string;
968
+ } | {
969
+ type: "ACCEPT";
970
+ } | {
971
+ type: "RETAKE";
972
+ } | {
973
+ type: "UPLOAD_PROGRESS";
974
+ progress: number;
975
+ } | {
976
+ type: "RETRY";
977
+ } | {
978
+ type: "CONTINUE";
979
+ } | {
980
+ type: "NEXT_PAGE_CAMERA";
981
+ } | {
982
+ type: "NEXT_PAGE_PHOTO_LIBRARY";
983
+ } | {
984
+ type: "ALL_PAGES_CAPTURED";
985
+ } | {
986
+ type: "SKIP";
987
+ } | {
988
+ type: "REQUEST_PERMISSION";
989
+ } | {
990
+ type: "GO_TO_LEARN_MORE";
991
+ } | {
992
+ type: "BACK";
993
+ } | {
994
+ type: "CLOSE";
995
+ }, xstate358.AnyEventObject>;
996
+ }) => {
997
+ permissionResult: PermissionResult | undefined;
998
+ requestMotionPermission: false;
999
+ };
1000
+ readonly onDone: readonly [{
1001
+ readonly target: "#documentCapture.initCamera";
1002
+ readonly guard: "isCameraPermissionGranted";
1003
+ readonly actions: xstate358.ActionFunction<DocumentCaptureContext, xstate358.DoneActorEvent<PermissionResult, string>, {
1004
+ type: "CAPTURE";
1005
+ } | {
1006
+ type: "FILE_SELECTED";
1007
+ file: File;
1008
+ imageBase64: string;
1009
+ fileType: string;
1010
+ } | {
1011
+ type: "ACCEPT";
1012
+ } | {
1013
+ type: "RETAKE";
1014
+ } | {
1015
+ type: "UPLOAD_PROGRESS";
1016
+ progress: number;
1017
+ } | {
1018
+ type: "RETRY";
1019
+ } | {
1020
+ type: "CONTINUE";
1021
+ } | {
1022
+ type: "NEXT_PAGE_CAMERA";
1023
+ } | {
1024
+ type: "NEXT_PAGE_PHOTO_LIBRARY";
1025
+ } | {
1026
+ type: "ALL_PAGES_CAPTURED";
1027
+ } | {
1028
+ type: "SKIP";
1029
+ } | {
1030
+ type: "REQUEST_PERMISSION";
1031
+ } | {
1032
+ type: "GO_TO_LEARN_MORE";
1033
+ } | {
1034
+ type: "BACK";
1035
+ } | {
1036
+ type: "CLOSE";
1037
+ }, undefined, xstate358.Values<{
1038
+ uploadDocument: {
1039
+ src: "uploadDocument";
1040
+ logic: xstate358.PromiseActorLogic<DocumentUploadResponse, {
1041
+ capturedDocument: NonNullable<DocumentCaptureContext["capturedDocument"]>;
1042
+ processingType: string;
1043
+ onProgress: (progress: number) => void;
1044
+ }, xstate358.EventObject>;
1045
+ id: string | undefined;
1046
+ };
1047
+ requestPermission: {
1048
+ src: "requestPermission";
1049
+ logic: xstate358.PromiseActorLogic<PermissionResult, {
1050
+ permissionResult?: PermissionResult;
1051
+ requestMotionPermission: boolean;
1052
+ }, xstate358.EventObject>;
1053
+ id: string | undefined;
1054
+ };
1055
+ initCamera: {
1056
+ src: "initCamera";
1057
+ logic: xstate358.PromiseActorLogic<MediaStream, void, xstate358.EventObject>;
1058
+ id: string | undefined;
1059
+ };
1060
+ checkPermission: {
1061
+ src: "checkPermission";
1062
+ logic: xstate358.PromiseActorLogic<PermissionResult, void, xstate358.EventObject>;
1063
+ id: string | undefined;
1064
+ };
1065
+ finalizeDocumentRequest: {
1066
+ src: "finalizeDocumentRequest";
1067
+ logic: xstate358.PromiseActorLogic<FinalizeDocumentResponse, {
1068
+ processingType: string;
1069
+ }, xstate358.EventObject>;
1070
+ id: string | undefined;
1071
+ };
1072
+ }>, never, never, never, never>;
1073
+ }, {
1074
+ readonly target: "denied";
1075
+ readonly guard: "isCameraPermissionDenied";
1076
+ readonly actions: xstate358.ActionFunction<DocumentCaptureContext, xstate358.DoneActorEvent<PermissionResult, string>, {
1077
+ type: "CAPTURE";
1078
+ } | {
1079
+ type: "FILE_SELECTED";
1080
+ file: File;
1081
+ imageBase64: string;
1082
+ fileType: string;
1083
+ } | {
1084
+ type: "ACCEPT";
1085
+ } | {
1086
+ type: "RETAKE";
1087
+ } | {
1088
+ type: "UPLOAD_PROGRESS";
1089
+ progress: number;
1090
+ } | {
1091
+ type: "RETRY";
1092
+ } | {
1093
+ type: "CONTINUE";
1094
+ } | {
1095
+ type: "NEXT_PAGE_CAMERA";
1096
+ } | {
1097
+ type: "NEXT_PAGE_PHOTO_LIBRARY";
1098
+ } | {
1099
+ type: "ALL_PAGES_CAPTURED";
1100
+ } | {
1101
+ type: "SKIP";
1102
+ } | {
1103
+ type: "REQUEST_PERMISSION";
1104
+ } | {
1105
+ type: "GO_TO_LEARN_MORE";
1106
+ } | {
1107
+ type: "BACK";
1108
+ } | {
1109
+ type: "CLOSE";
1110
+ }, undefined, xstate358.Values<{
1111
+ uploadDocument: {
1112
+ src: "uploadDocument";
1113
+ logic: xstate358.PromiseActorLogic<DocumentUploadResponse, {
1114
+ capturedDocument: NonNullable<DocumentCaptureContext["capturedDocument"]>;
1115
+ processingType: string;
1116
+ onProgress: (progress: number) => void;
1117
+ }, xstate358.EventObject>;
1118
+ id: string | undefined;
1119
+ };
1120
+ requestPermission: {
1121
+ src: "requestPermission";
1122
+ logic: xstate358.PromiseActorLogic<PermissionResult, {
1123
+ permissionResult?: PermissionResult;
1124
+ requestMotionPermission: boolean;
1125
+ }, xstate358.EventObject>;
1126
+ id: string | undefined;
1127
+ };
1128
+ initCamera: {
1129
+ src: "initCamera";
1130
+ logic: xstate358.PromiseActorLogic<MediaStream, void, xstate358.EventObject>;
1131
+ id: string | undefined;
1132
+ };
1133
+ checkPermission: {
1134
+ src: "checkPermission";
1135
+ logic: xstate358.PromiseActorLogic<PermissionResult, void, xstate358.EventObject>;
1136
+ id: string | undefined;
1137
+ };
1138
+ finalizeDocumentRequest: {
1139
+ src: "finalizeDocumentRequest";
1140
+ logic: xstate358.PromiseActorLogic<FinalizeDocumentResponse, {
1141
+ processingType: string;
1142
+ }, xstate358.EventObject>;
1143
+ id: string | undefined;
1144
+ };
1145
+ }>, never, never, never, never>;
1146
+ }, {
1147
+ readonly target: "waitingForUser";
1148
+ readonly actions: xstate358.ActionFunction<DocumentCaptureContext, xstate358.DoneActorEvent<PermissionResult, string>, {
1149
+ type: "CAPTURE";
1150
+ } | {
1151
+ type: "FILE_SELECTED";
1152
+ file: File;
1153
+ imageBase64: string;
1154
+ fileType: string;
1155
+ } | {
1156
+ type: "ACCEPT";
1157
+ } | {
1158
+ type: "RETAKE";
1159
+ } | {
1160
+ type: "UPLOAD_PROGRESS";
1161
+ progress: number;
1162
+ } | {
1163
+ type: "RETRY";
1164
+ } | {
1165
+ type: "CONTINUE";
1166
+ } | {
1167
+ type: "NEXT_PAGE_CAMERA";
1168
+ } | {
1169
+ type: "NEXT_PAGE_PHOTO_LIBRARY";
1170
+ } | {
1171
+ type: "ALL_PAGES_CAPTURED";
1172
+ } | {
1173
+ type: "SKIP";
1174
+ } | {
1175
+ type: "REQUEST_PERMISSION";
1176
+ } | {
1177
+ type: "GO_TO_LEARN_MORE";
1178
+ } | {
1179
+ type: "BACK";
1180
+ } | {
1181
+ type: "CLOSE";
1182
+ }, undefined, xstate358.Values<{
1183
+ uploadDocument: {
1184
+ src: "uploadDocument";
1185
+ logic: xstate358.PromiseActorLogic<DocumentUploadResponse, {
1186
+ capturedDocument: NonNullable<DocumentCaptureContext["capturedDocument"]>;
1187
+ processingType: string;
1188
+ onProgress: (progress: number) => void;
1189
+ }, xstate358.EventObject>;
1190
+ id: string | undefined;
1191
+ };
1192
+ requestPermission: {
1193
+ src: "requestPermission";
1194
+ logic: xstate358.PromiseActorLogic<PermissionResult, {
1195
+ permissionResult?: PermissionResult;
1196
+ requestMotionPermission: boolean;
1197
+ }, xstate358.EventObject>;
1198
+ id: string | undefined;
1199
+ };
1200
+ initCamera: {
1201
+ src: "initCamera";
1202
+ logic: xstate358.PromiseActorLogic<MediaStream, void, xstate358.EventObject>;
1203
+ id: string | undefined;
1204
+ };
1205
+ checkPermission: {
1206
+ src: "checkPermission";
1207
+ logic: xstate358.PromiseActorLogic<PermissionResult, void, xstate358.EventObject>;
1208
+ id: string | undefined;
1209
+ };
1210
+ finalizeDocumentRequest: {
1211
+ src: "finalizeDocumentRequest";
1212
+ logic: xstate358.PromiseActorLogic<FinalizeDocumentResponse, {
1213
+ processingType: string;
1214
+ }, xstate358.EventObject>;
1215
+ id: string | undefined;
1216
+ };
1217
+ }>, never, never, never, never>;
1218
+ }];
1219
+ readonly onError: {
1220
+ readonly target: "denied";
1221
+ };
1222
+ };
1223
+ };
1224
+ readonly denied: {
1225
+ readonly entry: xstate358.ActionFunction<DocumentCaptureContext, {
1226
+ type: "CAPTURE";
1227
+ } | {
1228
+ type: "FILE_SELECTED";
1229
+ file: File;
1230
+ imageBase64: string;
1231
+ fileType: string;
1232
+ } | {
1233
+ type: "ACCEPT";
1234
+ } | {
1235
+ type: "RETAKE";
1236
+ } | {
1237
+ type: "UPLOAD_PROGRESS";
1238
+ progress: number;
1239
+ } | {
1240
+ type: "RETRY";
1241
+ } | {
1242
+ type: "CONTINUE";
1243
+ } | {
1244
+ type: "NEXT_PAGE_CAMERA";
1245
+ } | {
1246
+ type: "NEXT_PAGE_PHOTO_LIBRARY";
1247
+ } | {
1248
+ type: "ALL_PAGES_CAPTURED";
1249
+ } | {
1250
+ type: "SKIP";
1251
+ } | {
1252
+ type: "REQUEST_PERMISSION";
1253
+ } | {
1254
+ type: "GO_TO_LEARN_MORE";
1255
+ } | {
1256
+ type: "BACK";
1257
+ } | {
1258
+ type: "CLOSE";
1259
+ }, {
1260
+ type: "CAPTURE";
1261
+ } | {
1262
+ type: "FILE_SELECTED";
1263
+ file: File;
1264
+ imageBase64: string;
1265
+ fileType: string;
1266
+ } | {
1267
+ type: "ACCEPT";
1268
+ } | {
1269
+ type: "RETAKE";
1270
+ } | {
1271
+ type: "UPLOAD_PROGRESS";
1272
+ progress: number;
1273
+ } | {
1274
+ type: "RETRY";
1275
+ } | {
1276
+ type: "CONTINUE";
1277
+ } | {
1278
+ type: "NEXT_PAGE_CAMERA";
1279
+ } | {
1280
+ type: "NEXT_PAGE_PHOTO_LIBRARY";
1281
+ } | {
1282
+ type: "ALL_PAGES_CAPTURED";
1283
+ } | {
1284
+ type: "SKIP";
1285
+ } | {
1286
+ type: "REQUEST_PERMISSION";
1287
+ } | {
1288
+ type: "GO_TO_LEARN_MORE";
1289
+ } | {
1290
+ type: "BACK";
1291
+ } | {
1292
+ type: "CLOSE";
1293
+ }, undefined, xstate358.Values<{
1294
+ uploadDocument: {
1295
+ src: "uploadDocument";
1296
+ logic: xstate358.PromiseActorLogic<DocumentUploadResponse, {
1297
+ capturedDocument: NonNullable<DocumentCaptureContext["capturedDocument"]>;
1298
+ processingType: string;
1299
+ onProgress: (progress: number) => void;
1300
+ }, xstate358.EventObject>;
1301
+ id: string | undefined;
1302
+ };
1303
+ requestPermission: {
1304
+ src: "requestPermission";
1305
+ logic: xstate358.PromiseActorLogic<PermissionResult, {
1306
+ permissionResult?: PermissionResult;
1307
+ requestMotionPermission: boolean;
1308
+ }, xstate358.EventObject>;
1309
+ id: string | undefined;
1310
+ };
1311
+ initCamera: {
1312
+ src: "initCamera";
1313
+ logic: xstate358.PromiseActorLogic<MediaStream, void, xstate358.EventObject>;
1314
+ id: string | undefined;
1315
+ };
1316
+ checkPermission: {
1317
+ src: "checkPermission";
1318
+ logic: xstate358.PromiseActorLogic<PermissionResult, void, xstate358.EventObject>;
1319
+ id: string | undefined;
1320
+ };
1321
+ finalizeDocumentRequest: {
1322
+ src: "finalizeDocumentRequest";
1323
+ logic: xstate358.PromiseActorLogic<FinalizeDocumentResponse, {
1324
+ processingType: string;
1325
+ }, xstate358.EventObject>;
1326
+ id: string | undefined;
1327
+ };
1328
+ }>, never, never, never, never>;
1329
+ };
1330
+ };
1331
+ readonly on: {
1332
+ readonly CLOSE: {
1333
+ readonly target: "closed";
1334
+ };
1335
+ };
1336
+ };
471
1337
  readonly initCamera: {
472
1338
  readonly invoke: {
473
1339
  readonly id: "initCamera";
@@ -567,10 +1433,16 @@ declare const documentCaptureMachine: xstate763.StateMachine<DocumentCaptureCont
567
1433
  type: "ALL_PAGES_CAPTURED";
568
1434
  } | {
569
1435
  type: "SKIP";
1436
+ } | {
1437
+ type: "REQUEST_PERMISSION";
1438
+ } | {
1439
+ type: "GO_TO_LEARN_MORE";
1440
+ } | {
1441
+ type: "BACK";
570
1442
  } | {
571
1443
  type: "CLOSE";
572
1444
  };
573
- self: xstate763.ActorRef<xstate763.MachineSnapshot<DocumentCaptureContext, {
1445
+ self: xstate358.ActorRef<xstate358.MachineSnapshot<DocumentCaptureContext, {
574
1446
  type: "CAPTURE";
575
1447
  } | {
576
1448
  type: "FILE_SELECTED";
@@ -596,9 +1468,15 @@ declare const documentCaptureMachine: xstate763.StateMachine<DocumentCaptureCont
596
1468
  type: "ALL_PAGES_CAPTURED";
597
1469
  } | {
598
1470
  type: "SKIP";
1471
+ } | {
1472
+ type: "REQUEST_PERMISSION";
1473
+ } | {
1474
+ type: "GO_TO_LEARN_MORE";
1475
+ } | {
1476
+ type: "BACK";
599
1477
  } | {
600
1478
  type: "CLOSE";
601
- }, Record<string, xstate763.AnyActorRef>, xstate763.StateValue, string, unknown, any, any>, {
1479
+ }, Record<string, xstate358.AnyActorRef>, xstate358.StateValue, string, unknown, any, any>, {
602
1480
  type: "CAPTURE";
603
1481
  } | {
604
1482
  type: "FILE_SELECTED";
@@ -624,9 +1502,15 @@ declare const documentCaptureMachine: xstate763.StateMachine<DocumentCaptureCont
624
1502
  type: "ALL_PAGES_CAPTURED";
625
1503
  } | {
626
1504
  type: "SKIP";
1505
+ } | {
1506
+ type: "REQUEST_PERMISSION";
1507
+ } | {
1508
+ type: "GO_TO_LEARN_MORE";
1509
+ } | {
1510
+ type: "BACK";
627
1511
  } | {
628
1512
  type: "CLOSE";
629
- }, xstate763.AnyEventObject>;
1513
+ }, xstate358.AnyEventObject>;
630
1514
  }) => {
631
1515
  capturedDocument: CapturedDocument;
632
1516
  processingType: DocumentType;
@@ -666,7 +1550,7 @@ declare const documentCaptureMachine: xstate763.StateMachine<DocumentCaptureCont
666
1550
  readonly nextPage: {
667
1551
  readonly on: {
668
1552
  readonly NEXT_PAGE_CAMERA: {
669
- readonly target: "initCamera";
1553
+ readonly target: "permissions";
670
1554
  readonly actions: readonly ["clearForNextPage", "setCaptureMethodCamera"];
671
1555
  };
672
1556
  readonly NEXT_PAGE_PHOTO_LIBRARY: {
@@ -718,10 +1602,16 @@ declare const documentCaptureMachine: xstate763.StateMachine<DocumentCaptureCont
718
1602
  type: "ALL_PAGES_CAPTURED";
719
1603
  } | {
720
1604
  type: "SKIP";
1605
+ } | {
1606
+ type: "REQUEST_PERMISSION";
1607
+ } | {
1608
+ type: "GO_TO_LEARN_MORE";
1609
+ } | {
1610
+ type: "BACK";
721
1611
  } | {
722
1612
  type: "CLOSE";
723
1613
  };
724
- self: xstate763.ActorRef<xstate763.MachineSnapshot<DocumentCaptureContext, {
1614
+ self: xstate358.ActorRef<xstate358.MachineSnapshot<DocumentCaptureContext, {
725
1615
  type: "CAPTURE";
726
1616
  } | {
727
1617
  type: "FILE_SELECTED";
@@ -747,9 +1637,15 @@ declare const documentCaptureMachine: xstate763.StateMachine<DocumentCaptureCont
747
1637
  type: "ALL_PAGES_CAPTURED";
748
1638
  } | {
749
1639
  type: "SKIP";
1640
+ } | {
1641
+ type: "REQUEST_PERMISSION";
1642
+ } | {
1643
+ type: "GO_TO_LEARN_MORE";
1644
+ } | {
1645
+ type: "BACK";
750
1646
  } | {
751
1647
  type: "CLOSE";
752
- }, Record<string, xstate763.AnyActorRef>, xstate763.StateValue, string, unknown, any, any>, {
1648
+ }, Record<string, xstate358.AnyActorRef>, xstate358.StateValue, string, unknown, any, any>, {
753
1649
  type: "CAPTURE";
754
1650
  } | {
755
1651
  type: "FILE_SELECTED";
@@ -775,9 +1671,15 @@ declare const documentCaptureMachine: xstate763.StateMachine<DocumentCaptureCont
775
1671
  type: "ALL_PAGES_CAPTURED";
776
1672
  } | {
777
1673
  type: "SKIP";
1674
+ } | {
1675
+ type: "REQUEST_PERMISSION";
1676
+ } | {
1677
+ type: "GO_TO_LEARN_MORE";
1678
+ } | {
1679
+ type: "BACK";
778
1680
  } | {
779
1681
  type: "CLOSE";
780
- }, xstate763.AnyEventObject>;
1682
+ }, xstate358.AnyEventObject>;
781
1683
  }) => {
782
1684
  processingType: DocumentType;
783
1685
  };
@@ -832,6 +1734,10 @@ type DocumentCaptureTutorialState = {
832
1734
  error: DocumentCaptureErrorCode | undefined;
833
1735
  pageNumber: number;
834
1736
  };
1737
+ type DocumentCapturePermissionsState = {
1738
+ status: 'permissions';
1739
+ permissionStatus: PermissionStatus;
1740
+ };
835
1741
  type DocumentCaptureInitializingCameraState = {
836
1742
  status: 'initializingCamera';
837
1743
  };
@@ -887,7 +1793,7 @@ type DocumentCaptureNextPageState = {
887
1793
  type DocumentCaptureFinalizingState = {
888
1794
  status: 'finalizing';
889
1795
  };
890
- type DocumentCaptureState = DocumentCaptureTutorialState | DocumentCaptureInitializingCameraState | DocumentCaptureCapturingState | DocumentCapturePreviewState | DocumentCaptureUploadingState | DocumentCaptureSuccessState | DocumentCaptureFailureState | DocumentCaptureFinishedState | DocumentCaptureClosedState | DocumentCaptureNextPageState | DocumentCaptureFinalizingState;
1796
+ type DocumentCaptureState = DocumentCaptureTutorialState | DocumentCapturePermissionsState | DocumentCaptureInitializingCameraState | DocumentCaptureCapturingState | DocumentCapturePreviewState | DocumentCaptureUploadingState | DocumentCaptureSuccessState | DocumentCaptureFailureState | DocumentCaptureFinishedState | DocumentCaptureClosedState | DocumentCaptureNextPageState | DocumentCaptureFinalizingState;
891
1797
  declare function createDocumentCaptureManager(options: CreateDocumentCaptureActorOptions): Manager<DocumentCaptureState> & {
892
1798
  capture(): void;
893
1799
  setFile(file: File, imageBase64: string): void;
@@ -897,6 +1803,9 @@ declare function createDocumentCaptureManager(options: CreateDocumentCaptureActo
897
1803
  continue(): void;
898
1804
  skip(): void;
899
1805
  close(): void;
1806
+ requestPermission(): void;
1807
+ goToLearnMore(): void;
1808
+ back(): void;
900
1809
  captureNextPageFromCamera(): void;
901
1810
  captureNextPageFromFile(): void;
902
1811
  finishPageCapture(): void;