@idmission/websdk-ui 0.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 (500) hide show
  1. package/README.md +189 -0
  2. package/dist/DocumentCaptureView.d.ts +111 -0
  3. package/dist/DocumentCaptureView.d.ts.map +1 -0
  4. package/dist/DocumentCaptureView.js +225 -0
  5. package/dist/FaceLivenessView.d.ts +88 -0
  6. package/dist/FaceLivenessView.d.ts.map +1 -0
  7. package/dist/FaceLivenessView.js +298 -0
  8. package/dist/IdCaptureView.d.ts +271 -0
  9. package/dist/IdCaptureView.d.ts.map +1 -0
  10. package/dist/IdCaptureView.js +454 -0
  11. package/dist/SelfieCaptureView.d.ts +119 -0
  12. package/dist/SelfieCaptureView.d.ts.map +1 -0
  13. package/dist/SelfieCaptureView.js +168 -0
  14. package/dist/SignatureCaptureView.d.ts +136 -0
  15. package/dist/SignatureCaptureView.d.ts.map +1 -0
  16. package/dist/SignatureCaptureView.js +521 -0
  17. package/dist/VideoIdCaptureView.d.ts +104 -0
  18. package/dist/VideoIdCaptureView.d.ts.map +1 -0
  19. package/dist/VideoIdCaptureView.js +253 -0
  20. package/dist/bindings/useDocumentCapture.d.ts +3 -0
  21. package/dist/bindings/useDocumentCapture.d.ts.map +1 -0
  22. package/dist/bindings/useDocumentCapture.js +6 -0
  23. package/dist/bindings/useIdCapture.d.ts +5 -0
  24. package/dist/bindings/useIdCapture.d.ts.map +1 -0
  25. package/dist/bindings/useIdCapture.js +53 -0
  26. package/dist/bindings/useSelfieCapture.d.ts +5 -0
  27. package/dist/bindings/useSelfieCapture.d.ts.map +1 -0
  28. package/dist/bindings/useSelfieCapture.js +53 -0
  29. package/dist/bindings/useSignatureCapture.d.ts +3 -0
  30. package/dist/bindings/useSignatureCapture.d.ts.map +1 -0
  31. package/dist/bindings/useSignatureCapture.js +6 -0
  32. package/dist/bindings/useVideoIdCapture.d.ts +3 -0
  33. package/dist/bindings/useVideoIdCapture.d.ts.map +1 -0
  34. package/dist/bindings/useVideoIdCapture.js +6 -0
  35. package/dist/components/CameraFeed.d.ts +36 -0
  36. package/dist/components/CameraFeed.d.ts.map +1 -0
  37. package/dist/components/CameraFeed.js +74 -0
  38. package/dist/components/ExitCaptureButton.d.ts +6 -0
  39. package/dist/components/ExitCaptureButton.d.ts.map +1 -0
  40. package/dist/components/ExitCaptureButton.js +32 -0
  41. package/dist/components/GuidanceMessage.d.ts +25 -0
  42. package/dist/components/GuidanceMessage.d.ts.map +1 -0
  43. package/dist/components/GuidanceMessage.js +39 -0
  44. package/dist/components/OverrideWrongDocumentTypeDialog.d.ts +20 -0
  45. package/dist/components/OverrideWrongDocumentTypeDialog.d.ts.map +1 -0
  46. package/dist/components/OverrideWrongDocumentTypeDialog.js +55 -0
  47. package/dist/components/additional_documents/AdditionalDocumentCapture.d.ts +41 -0
  48. package/dist/components/additional_documents/AdditionalDocumentCapture.d.ts.map +1 -0
  49. package/dist/components/additional_documents/AdditionalDocumentCapture.js +118 -0
  50. package/dist/components/additional_documents/AdditionalDocumentCaptureWizard.d.ts +18 -0
  51. package/dist/components/additional_documents/AdditionalDocumentCaptureWizard.d.ts.map +1 -0
  52. package/dist/components/additional_documents/AdditionalDocumentCaptureWizard.js +93 -0
  53. package/dist/components/additional_documents/sequence.d.ts +10 -0
  54. package/dist/components/additional_documents/sequence.d.ts.map +1 -0
  55. package/dist/components/additional_documents/sequence.js +11 -0
  56. package/dist/components/additional_documents/types.d.ts +15 -0
  57. package/dist/components/additional_documents/types.d.ts.map +1 -0
  58. package/dist/components/additional_documents/types.js +1 -0
  59. package/dist/components/barcode/BarcodeGuideOverlay.d.ts +23 -0
  60. package/dist/components/barcode/BarcodeGuideOverlay.d.ts.map +1 -0
  61. package/dist/components/barcode/BarcodeGuideOverlay.js +157 -0
  62. package/dist/components/barcode/BarcodeSuccessOverlay.d.ts +7 -0
  63. package/dist/components/barcode/BarcodeSuccessOverlay.d.ts.map +1 -0
  64. package/dist/components/barcode/BarcodeSuccessOverlay.js +58 -0
  65. package/dist/components/common/ButtonsRow.d.ts +2 -0
  66. package/dist/components/common/ButtonsRow.d.ts.map +1 -0
  67. package/dist/components/common/ButtonsRow.js +7 -0
  68. package/dist/components/common/CapturedDocumentImg.d.ts +7 -0
  69. package/dist/components/common/CapturedDocumentImg.d.ts.map +1 -0
  70. package/dist/components/common/CapturedDocumentImg.js +31 -0
  71. package/dist/components/common/Card.d.ts +9 -0
  72. package/dist/components/common/Card.d.ts.map +1 -0
  73. package/dist/components/common/Card.js +16 -0
  74. package/dist/components/common/LoaderButton.d.ts +31 -0
  75. package/dist/components/common/LoaderButton.d.ts.map +1 -0
  76. package/dist/components/common/LoaderButton.js +444 -0
  77. package/dist/components/common/LoadingListItemIndicator.d.ts +5 -0
  78. package/dist/components/common/LoadingListItemIndicator.d.ts.map +1 -0
  79. package/dist/components/common/LoadingListItemIndicator.js +8 -0
  80. package/dist/components/common/animation.d.ts +5 -0
  81. package/dist/components/common/animation.d.ts.map +1 -0
  82. package/dist/components/common/animation.js +35 -0
  83. package/dist/components/common/downloadingLabel.d.ts +10 -0
  84. package/dist/components/common/downloadingLabel.d.ts.map +1 -0
  85. package/dist/components/common/downloadingLabel.js +15 -0
  86. package/dist/components/common/overlay.d.ts +142 -0
  87. package/dist/components/common/overlay.d.ts.map +1 -0
  88. package/dist/components/common/overlay.js +183 -0
  89. package/dist/components/customer_match/CustomerMatchFailure.d.ts +37 -0
  90. package/dist/components/customer_match/CustomerMatchFailure.d.ts.map +1 -0
  91. package/dist/components/customer_match/CustomerMatchFailure.js +38 -0
  92. package/dist/components/customer_match/CustomerMatchSuccess.d.ts +35 -0
  93. package/dist/components/customer_match/CustomerMatchSuccess.d.ts.map +1 -0
  94. package/dist/components/customer_match/CustomerMatchSuccess.js +44 -0
  95. package/dist/components/debug/debug.d.ts +91 -0
  96. package/dist/components/debug/debug.d.ts.map +1 -0
  97. package/dist/components/debug/debug.js +270 -0
  98. package/dist/components/document/DocumentCaptureGuideOverlay.d.ts +15 -0
  99. package/dist/components/document/DocumentCaptureGuideOverlay.d.ts.map +1 -0
  100. package/dist/components/document/DocumentCaptureGuideOverlay.js +148 -0
  101. package/dist/components/document/guideRect.d.ts +11 -0
  102. package/dist/components/document/guideRect.d.ts.map +1 -0
  103. package/dist/components/document/guideRect.js +25 -0
  104. package/dist/components/document/types.d.ts +25 -0
  105. package/dist/components/document/types.d.ts.map +1 -0
  106. package/dist/components/document/types.js +1 -0
  107. package/dist/components/error/CameraAccessDeniedOverlay.d.ts +31 -0
  108. package/dist/components/error/CameraAccessDeniedOverlay.d.ts.map +1 -0
  109. package/dist/components/error/CameraAccessDeniedOverlay.js +45 -0
  110. package/dist/components/error/ErrorScreen.d.ts +60 -0
  111. package/dist/components/error/ErrorScreen.d.ts.map +1 -0
  112. package/dist/components/error/ErrorScreen.js +150 -0
  113. package/dist/components/face_liveness/FaceLivenessFailure.d.ts +35 -0
  114. package/dist/components/face_liveness/FaceLivenessFailure.d.ts.map +1 -0
  115. package/dist/components/face_liveness/FaceLivenessFailure.js +30 -0
  116. package/dist/components/face_liveness/FaceLivenessSuccess.d.ts +31 -0
  117. package/dist/components/face_liveness/FaceLivenessSuccess.d.ts.map +1 -0
  118. package/dist/components/face_liveness/FaceLivenessSuccess.js +56 -0
  119. package/dist/components/fallback/IdCaptureFallback.d.ts +58 -0
  120. package/dist/components/fallback/IdCaptureFallback.d.ts.map +1 -0
  121. package/dist/components/fallback/IdCaptureFallback.js +128 -0
  122. package/dist/components/fallback/IdCaptureOrUploadScreen.d.ts +75 -0
  123. package/dist/components/fallback/IdCaptureOrUploadScreen.d.ts.map +1 -0
  124. package/dist/components/fallback/IdCaptureOrUploadScreen.js +205 -0
  125. package/dist/components/fallback/SelfieCaptureFallback.d.ts +54 -0
  126. package/dist/components/fallback/SelfieCaptureFallback.d.ts.map +1 -0
  127. package/dist/components/fallback/SelfieCaptureFallback.js +106 -0
  128. package/dist/components/fallback/fallbackInstructionStep.d.ts +5 -0
  129. package/dist/components/fallback/fallbackInstructionStep.d.ts.map +1 -0
  130. package/dist/components/fallback/fallbackInstructionStep.js +18 -0
  131. package/dist/components/fallback/readFile.d.ts +2 -0
  132. package/dist/components/fallback/readFile.d.ts.map +1 -0
  133. package/dist/components/fallback/readFile.js +14 -0
  134. package/dist/components/guide_images/backToFront.d.ts +3 -0
  135. package/dist/components/guide_images/backToFront.d.ts.map +1 -0
  136. package/dist/components/guide_images/backToFront.js +17 -0
  137. package/dist/components/guide_images/byUrl.d.ts +3 -0
  138. package/dist/components/guide_images/byUrl.d.ts.map +1 -0
  139. package/dist/components/guide_images/byUrl.js +6 -0
  140. package/dist/components/guide_images/defaults.d.ts +37 -0
  141. package/dist/components/guide_images/defaults.d.ts.map +1 -0
  142. package/dist/components/guide_images/defaults.js +37 -0
  143. package/dist/components/guide_images/index.d.ts +7 -0
  144. package/dist/components/guide_images/index.d.ts.map +1 -0
  145. package/dist/components/guide_images/index.js +5 -0
  146. package/dist/components/guide_images/orientation.d.ts +2 -0
  147. package/dist/components/guide_images/orientation.d.ts.map +1 -0
  148. package/dist/components/guide_images/orientation.js +5 -0
  149. package/dist/components/guide_images/types.d.ts +15 -0
  150. package/dist/components/guide_images/types.d.ts.map +1 -0
  151. package/dist/components/guide_images/types.js +1 -0
  152. package/dist/components/guide_images/useGuideImages.d.ts +3 -0
  153. package/dist/components/guide_images/useGuideImages.d.ts.map +1 -0
  154. package/dist/components/guide_images/useGuideImages.js +19 -0
  155. package/dist/components/guides/FlipIdPrompt.d.ts +28 -0
  156. package/dist/components/guides/FlipIdPrompt.d.ts.map +1 -0
  157. package/dist/components/guides/FlipIdPrompt.js +54 -0
  158. package/dist/components/guides/IdCaptureFitGuide.d.ts +51 -0
  159. package/dist/components/guides/IdCaptureFitGuide.d.ts.map +1 -0
  160. package/dist/components/guides/IdCaptureFitGuide.js +199 -0
  161. package/dist/components/guides/IdCaptureGuideOverlay.d.ts +100 -0
  162. package/dist/components/guides/IdCaptureGuideOverlay.d.ts.map +1 -0
  163. package/dist/components/guides/IdCaptureGuideOverlay.js +137 -0
  164. package/dist/components/guides/IdCaptureGuides.d.ts +47 -0
  165. package/dist/components/guides/IdCaptureGuides.d.ts.map +1 -0
  166. package/dist/components/guides/IdCaptureGuides.js +136 -0
  167. package/dist/components/guides/IdCaptureGuidesCommon.d.ts +136 -0
  168. package/dist/components/guides/IdCaptureGuidesCommon.d.ts.map +1 -0
  169. package/dist/components/guides/IdCaptureGuidesCommon.js +123 -0
  170. package/dist/components/loading/IdCaptureLoadingGraphic.d.ts +9 -0
  171. package/dist/components/loading/IdCaptureLoadingGraphic.d.ts.map +1 -0
  172. package/dist/components/loading/IdCaptureLoadingGraphic.js +76 -0
  173. package/dist/components/loading/IdCaptureLoadingOverlay.d.ts +134 -0
  174. package/dist/components/loading/IdCaptureLoadingOverlay.d.ts.map +1 -0
  175. package/dist/components/loading/IdCaptureLoadingOverlay.js +13 -0
  176. package/dist/components/loading/IdCaptureLoadingOverlayDefault.d.ts +3 -0
  177. package/dist/components/loading/IdCaptureLoadingOverlayDefault.d.ts.map +1 -0
  178. package/dist/components/loading/IdCaptureLoadingOverlayDefault.js +196 -0
  179. package/dist/components/loading/IdCaptureLoadingOverlayLegacy.d.ts +4 -0
  180. package/dist/components/loading/IdCaptureLoadingOverlayLegacy.d.ts.map +1 -0
  181. package/dist/components/loading/IdCaptureLoadingOverlayLegacy.js +69 -0
  182. package/dist/components/loading/IdCaptureLoadingOverlayRing.d.ts +3 -0
  183. package/dist/components/loading/IdCaptureLoadingOverlayRing.d.ts.map +1 -0
  184. package/dist/components/loading/IdCaptureLoadingOverlayRing.js +260 -0
  185. package/dist/components/loading/RingIntroScreen.d.ts +39 -0
  186. package/dist/components/loading/RingIntroScreen.d.ts.map +1 -0
  187. package/dist/components/loading/RingIntroScreen.js +216 -0
  188. package/dist/components/loading/RingProgress.d.ts +9 -0
  189. package/dist/components/loading/RingProgress.d.ts.map +1 -0
  190. package/dist/components/loading/RingProgress.js +24 -0
  191. package/dist/components/loading/RingStageTransition.d.ts +27 -0
  192. package/dist/components/loading/RingStageTransition.d.ts.map +1 -0
  193. package/dist/components/loading/RingStageTransition.js +145 -0
  194. package/dist/components/loading/customerSpinner.d.ts +58 -0
  195. package/dist/components/loading/customerSpinner.d.ts.map +1 -0
  196. package/dist/components/loading/customerSpinner.js +69 -0
  197. package/dist/components/loading/ringIntro.d.ts +15 -0
  198. package/dist/components/loading/ringIntro.d.ts.map +1 -0
  199. package/dist/components/loading/ringIntro.js +5 -0
  200. package/dist/components/loading/ringStatus.d.ts +8 -0
  201. package/dist/components/loading/ringStatus.d.ts.map +1 -0
  202. package/dist/components/loading/ringStatus.js +13 -0
  203. package/dist/components/loading/useAutoContinueWhenReady.d.ts +8 -0
  204. package/dist/components/loading/useAutoContinueWhenReady.d.ts.map +1 -0
  205. package/dist/components/loading/useAutoContinueWhenReady.js +25 -0
  206. package/dist/components/review/ReviewDiagnosticsPanel.d.ts +27 -0
  207. package/dist/components/review/ReviewDiagnosticsPanel.d.ts.map +1 -0
  208. package/dist/components/review/ReviewDiagnosticsPanel.js +475 -0
  209. package/dist/components/review/ReviewScreen.d.ts +34 -0
  210. package/dist/components/review/ReviewScreen.d.ts.map +1 -0
  211. package/dist/components/review/ReviewScreen.js +91 -0
  212. package/dist/components/ring/RingFailureScreen.d.ts +41 -0
  213. package/dist/components/ring/RingFailureScreen.d.ts.map +1 -0
  214. package/dist/components/ring/RingFailureScreen.js +384 -0
  215. package/dist/components/ring/RingFinishingScreen.d.ts +27 -0
  216. package/dist/components/ring/RingFinishingScreen.d.ts.map +1 -0
  217. package/dist/components/ring/RingFinishingScreen.js +184 -0
  218. package/dist/components/ring/RingSuccessScreen.d.ts +33 -0
  219. package/dist/components/ring/RingSuccessScreen.d.ts.map +1 -0
  220. package/dist/components/ring/RingSuccessScreen.js +185 -0
  221. package/dist/components/selfie/FaceCaptureGuideOverlay.d.ts +17 -0
  222. package/dist/components/selfie/FaceCaptureGuideOverlay.d.ts.map +1 -0
  223. package/dist/components/selfie/FaceCaptureGuideOverlay.js +39 -0
  224. package/dist/components/selfie/SelfieCameraFeed.d.ts +8 -0
  225. package/dist/components/selfie/SelfieCameraFeed.d.ts.map +1 -0
  226. package/dist/components/selfie/SelfieCameraFeed.js +16 -0
  227. package/dist/components/selfie/SelfieCaptureAnimatedMask.d.ts +15 -0
  228. package/dist/components/selfie/SelfieCaptureAnimatedMask.d.ts.map +1 -0
  229. package/dist/components/selfie/SelfieCaptureAnimatedMask.js +111 -0
  230. package/dist/components/selfie/SelfieCaptureLoadingGraphic.d.ts +4 -0
  231. package/dist/components/selfie/SelfieCaptureLoadingGraphic.d.ts.map +1 -0
  232. package/dist/components/selfie/SelfieCaptureLoadingGraphic.js +28 -0
  233. package/dist/components/selfie/SelfieCaptureSurface.d.ts +126 -0
  234. package/dist/components/selfie/SelfieCaptureSurface.d.ts.map +1 -0
  235. package/dist/components/selfie/SelfieCaptureSurface.js +248 -0
  236. package/dist/components/selfie_loading/SelfieCaptureLoadingOverlay.d.ts +136 -0
  237. package/dist/components/selfie_loading/SelfieCaptureLoadingOverlay.d.ts.map +1 -0
  238. package/dist/components/selfie_loading/SelfieCaptureLoadingOverlay.js +13 -0
  239. package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayDefault.d.ts +3 -0
  240. package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayDefault.d.ts.map +1 -0
  241. package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayDefault.js +181 -0
  242. package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayLegacy.d.ts +3 -0
  243. package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayLegacy.d.ts.map +1 -0
  244. package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayLegacy.js +67 -0
  245. package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayRing.d.ts +3 -0
  246. package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayRing.d.ts.map +1 -0
  247. package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayRing.js +265 -0
  248. package/dist/components/videoId/VideoIdCaptureGuides.d.ts +42 -0
  249. package/dist/components/videoId/VideoIdCaptureGuides.d.ts.map +1 -0
  250. package/dist/components/videoId/VideoIdCaptureGuides.js +173 -0
  251. package/dist/flows/AuthStateContext.d.ts +33 -0
  252. package/dist/flows/AuthStateContext.d.ts.map +1 -0
  253. package/dist/flows/AuthStateContext.js +47 -0
  254. package/dist/flows/CompositeWizard.d.ts +76 -0
  255. package/dist/flows/CompositeWizard.d.ts.map +1 -0
  256. package/dist/flows/CompositeWizard.js +200 -0
  257. package/dist/flows/CustomerBiometricsEnrollmentFlow.d.ts +28 -0
  258. package/dist/flows/CustomerBiometricsEnrollmentFlow.d.ts.map +1 -0
  259. package/dist/flows/CustomerBiometricsEnrollmentFlow.js +138 -0
  260. package/dist/flows/CustomerIdAndBiometricsEnrollmentFlow.d.ts +47 -0
  261. package/dist/flows/CustomerIdAndBiometricsEnrollmentFlow.d.ts.map +1 -0
  262. package/dist/flows/CustomerIdAndBiometricsEnrollmentFlow.js +231 -0
  263. package/dist/flows/CustomerIdentificationFlow.d.ts +4 -0
  264. package/dist/flows/CustomerIdentificationFlow.d.ts.map +1 -0
  265. package/dist/flows/CustomerIdentificationFlow.js +11 -0
  266. package/dist/flows/CustomerVerificationFlow.d.ts +9 -0
  267. package/dist/flows/CustomerVerificationFlow.d.ts.map +1 -0
  268. package/dist/flows/CustomerVerificationFlow.js +17 -0
  269. package/dist/flows/DocumentCaptureFlow.d.ts +23 -0
  270. package/dist/flows/DocumentCaptureFlow.d.ts.map +1 -0
  271. package/dist/flows/DocumentCaptureFlow.js +116 -0
  272. package/dist/flows/FaceValidationFlow.d.ts +12 -0
  273. package/dist/flows/FaceValidationFlow.d.ts.map +1 -0
  274. package/dist/flows/FaceValidationFlow.js +53 -0
  275. package/dist/flows/FlowChassis.d.ts +39 -0
  276. package/dist/flows/FlowChassis.d.ts.map +1 -0
  277. package/dist/flows/FlowChassis.js +69 -0
  278. package/dist/flows/IdAndFaceValidationFlow.d.ts +36 -0
  279. package/dist/flows/IdAndFaceValidationFlow.d.ts.map +1 -0
  280. package/dist/flows/IdAndFaceValidationFlow.js +168 -0
  281. package/dist/flows/IdValidationFlow.d.ts +29 -0
  282. package/dist/flows/IdValidationFlow.d.ts.map +1 -0
  283. package/dist/flows/IdValidationFlow.js +106 -0
  284. package/dist/flows/OrbStatusScreen.d.ts +14 -0
  285. package/dist/flows/OrbStatusScreen.d.ts.map +1 -0
  286. package/dist/flows/OrbStatusScreen.js +60 -0
  287. package/dist/flows/RemoteDiagnosticsMount.d.ts +6 -0
  288. package/dist/flows/RemoteDiagnosticsMount.d.ts.map +1 -0
  289. package/dist/flows/RemoteDiagnosticsMount.js +57 -0
  290. package/dist/flows/SignatureKYCFlow.d.ts +33 -0
  291. package/dist/flows/SignatureKYCFlow.d.ts.map +1 -0
  292. package/dist/flows/SignatureKYCFlow.js +228 -0
  293. package/dist/flows/SubmissionProvider.d.ts +40 -0
  294. package/dist/flows/SubmissionProvider.d.ts.map +1 -0
  295. package/dist/flows/SubmissionProvider.js +136 -0
  296. package/dist/flows/SubmissionSuccess.d.ts +48 -0
  297. package/dist/flows/SubmissionSuccess.d.ts.map +1 -0
  298. package/dist/flows/SubmissionSuccess.js +488 -0
  299. package/dist/flows/VideoIdValidationFlow.d.ts +61 -0
  300. package/dist/flows/VideoIdValidationFlow.d.ts.map +1 -0
  301. package/dist/flows/VideoIdValidationFlow.js +171 -0
  302. package/dist/flows/additionalDocuments.d.ts +5 -0
  303. package/dist/flows/additionalDocuments.d.ts.map +1 -0
  304. package/dist/flows/additionalDocuments.js +26 -0
  305. package/dist/flows/artifacts.d.ts +8 -0
  306. package/dist/flows/artifacts.d.ts.map +1 -0
  307. package/dist/flows/artifacts.js +80 -0
  308. package/dist/flows/customerMatch/CustomerMatchCapture.d.ts +53 -0
  309. package/dist/flows/customerMatch/CustomerMatchCapture.d.ts.map +1 -0
  310. package/dist/flows/customerMatch/CustomerMatchCapture.js +211 -0
  311. package/dist/flows/customerMatch/CustomerMatchFlow.d.ts +94 -0
  312. package/dist/flows/customerMatch/CustomerMatchFlow.d.ts.map +1 -0
  313. package/dist/flows/customerMatch/CustomerMatchFlow.js +209 -0
  314. package/dist/flows/customerMatch/adapters.d.ts +34 -0
  315. package/dist/flows/customerMatch/adapters.d.ts.map +1 -0
  316. package/dist/flows/customerMatch/adapters.js +63 -0
  317. package/dist/flows/customerMatch/identificationReducer.d.ts +34 -0
  318. package/dist/flows/customerMatch/identificationReducer.d.ts.map +1 -0
  319. package/dist/flows/customerMatch/identificationReducer.js +75 -0
  320. package/dist/flows/customerMatch/verificationReducer.d.ts +34 -0
  321. package/dist/flows/customerMatch/verificationReducer.d.ts.map +1 -0
  322. package/dist/flows/customerMatch/verificationReducer.js +77 -0
  323. package/dist/flows/documentCapture.d.ts +5 -0
  324. package/dist/flows/documentCapture.d.ts.map +1 -0
  325. package/dist/flows/documentCapture.js +8 -0
  326. package/dist/flows/jsonHighlight.d.ts +19 -0
  327. package/dist/flows/jsonHighlight.d.ts.map +1 -0
  328. package/dist/flows/jsonHighlight.js +90 -0
  329. package/dist/flows/overlays.d.ts +91 -0
  330. package/dist/flows/overlays.d.ts.map +1 -0
  331. package/dist/flows/overlays.js +150 -0
  332. package/dist/flows/ringIntroImplications.d.ts +30 -0
  333. package/dist/flows/ringIntroImplications.d.ts.map +1 -0
  334. package/dist/flows/ringIntroImplications.js +58 -0
  335. package/dist/flows/ringScreens.d.ts +27 -0
  336. package/dist/flows/ringScreens.d.ts.map +1 -0
  337. package/dist/flows/ringScreens.js +18 -0
  338. package/dist/flows/sequencer.d.ts +12 -0
  339. package/dist/flows/sequencer.d.ts.map +1 -0
  340. package/dist/flows/sequencer.js +18 -0
  341. package/dist/flows/sharedCamera.d.ts +23 -0
  342. package/dist/flows/sharedCamera.d.ts.map +1 -0
  343. package/dist/flows/sharedCamera.js +64 -0
  344. package/dist/flows/signatureStep.d.ts +25 -0
  345. package/dist/flows/signatureStep.d.ts.map +1 -0
  346. package/dist/flows/signatureStep.js +99 -0
  347. package/dist/flows/types.d.ts +106 -0
  348. package/dist/flows/types.d.ts.map +1 -0
  349. package/dist/flows/types.js +1 -0
  350. package/dist/flows/useGeolocation.d.ts +24 -0
  351. package/dist/flows/useGeolocation.d.ts.map +1 -0
  352. package/dist/flows/useGeolocation.js +82 -0
  353. package/dist/flows/useShowSuccessScreen.d.ts +3 -0
  354. package/dist/flows/useShowSuccessScreen.d.ts.map +1 -0
  355. package/dist/flows/useShowSuccessScreen.js +51 -0
  356. package/dist/flows/useTimeout.d.ts +7 -0
  357. package/dist/flows/useTimeout.d.ts.map +1 -0
  358. package/dist/flows/useTimeout.js +68 -0
  359. package/dist/flows/videoIdSteps.d.ts +33 -0
  360. package/dist/flows/videoIdSteps.d.ts.map +1 -0
  361. package/dist/flows/videoIdSteps.js +54 -0
  362. package/dist/guidance/selfieStrings.d.ts +18 -0
  363. package/dist/guidance/selfieStrings.d.ts.map +1 -0
  364. package/dist/guidance/selfieStrings.js +97 -0
  365. package/dist/guidance/strings.d.ts +4 -0
  366. package/dist/guidance/strings.d.ts.map +1 -0
  367. package/dist/guidance/strings.js +43 -0
  368. package/dist/guidance/videoIdStrings.d.ts +23 -0
  369. package/dist/guidance/videoIdStrings.d.ts.map +1 -0
  370. package/dist/guidance/videoIdStrings.js +23 -0
  371. package/dist/i18n/index.d.ts +1221 -0
  372. package/dist/i18n/index.d.ts.map +1 -0
  373. package/dist/i18n/index.js +92 -0
  374. package/dist/i18n/locales/de.d.ts +149 -0
  375. package/dist/i18n/locales/de.d.ts.map +1 -0
  376. package/dist/i18n/locales/de.js +147 -0
  377. package/dist/i18n/locales/en.d.ts +3 -0
  378. package/dist/i18n/locales/en.d.ts.map +1 -0
  379. package/dist/i18n/locales/en.js +1 -0
  380. package/dist/i18n/locales/es.d.ts +149 -0
  381. package/dist/i18n/locales/es.d.ts.map +1 -0
  382. package/dist/i18n/locales/es.js +147 -0
  383. package/dist/i18n/locales/fr.d.ts +149 -0
  384. package/dist/i18n/locales/fr.d.ts.map +1 -0
  385. package/dist/i18n/locales/fr.js +147 -0
  386. package/dist/i18n/locales/it.d.ts +149 -0
  387. package/dist/i18n/locales/it.d.ts.map +1 -0
  388. package/dist/i18n/locales/it.js +147 -0
  389. package/dist/i18n/locales/ja.d.ts +149 -0
  390. package/dist/i18n/locales/ja.d.ts.map +1 -0
  391. package/dist/i18n/locales/ja.js +147 -0
  392. package/dist/i18n/locales/pt.d.ts +149 -0
  393. package/dist/i18n/locales/pt.d.ts.map +1 -0
  394. package/dist/i18n/locales/pt.js +147 -0
  395. package/dist/i18n/locales/ru.d.ts +149 -0
  396. package/dist/i18n/locales/ru.d.ts.map +1 -0
  397. package/dist/i18n/locales/ru.js +147 -0
  398. package/dist/i18n/locales/zh.d.ts +149 -0
  399. package/dist/i18n/locales/zh.d.ts.map +1 -0
  400. package/dist/i18n/locales/zh.js +147 -0
  401. package/dist/i18n/render.d.ts +3 -0
  402. package/dist/i18n/render.d.ts.map +1 -0
  403. package/dist/i18n/render.js +7 -0
  404. package/dist/index.d.ts +157 -0
  405. package/dist/index.d.ts.map +1 -0
  406. package/dist/index.js +191 -0
  407. package/dist/layout/GuideLayoutContext.d.ts +24 -0
  408. package/dist/layout/GuideLayoutContext.d.ts.map +1 -0
  409. package/dist/layout/GuideLayoutContext.js +19 -0
  410. package/dist/layout/GuideOrientationContext.d.ts +16 -0
  411. package/dist/layout/GuideOrientationContext.d.ts.map +1 -0
  412. package/dist/layout/GuideOrientationContext.js +40 -0
  413. package/dist/layout/useResizeObserver.d.ts +11 -0
  414. package/dist/layout/useResizeObserver.d.ts.map +1 -0
  415. package/dist/layout/useResizeObserver.js +114 -0
  416. package/dist/testing/alignGlobals.d.ts +2 -0
  417. package/dist/testing/alignGlobals.d.ts.map +1 -0
  418. package/dist/testing/alignGlobals.js +25 -0
  419. package/dist/testing/buildDocumentState.d.ts +4 -0
  420. package/dist/testing/buildDocumentState.d.ts.map +1 -0
  421. package/dist/testing/buildDocumentState.js +19 -0
  422. package/dist/testing/buildSelfieState.d.ts +8 -0
  423. package/dist/testing/buildSelfieState.d.ts.map +1 -0
  424. package/dist/testing/buildSelfieState.js +84 -0
  425. package/dist/testing/buildSignatureState.d.ts +3 -0
  426. package/dist/testing/buildSignatureState.d.ts.map +1 -0
  427. package/dist/testing/buildSignatureState.js +12 -0
  428. package/dist/testing/buildState.d.ts +3 -0
  429. package/dist/testing/buildState.d.ts.map +1 -0
  430. package/dist/testing/buildState.js +34 -0
  431. package/dist/testing/buildVideoIdState.d.ts +3 -0
  432. package/dist/testing/buildVideoIdState.d.ts.map +1 -0
  433. package/dist/testing/buildVideoIdState.js +11 -0
  434. package/dist/testing/classNamesLeaves.d.ts +14 -0
  435. package/dist/testing/classNamesLeaves.d.ts.map +1 -0
  436. package/dist/testing/classNamesLeaves.js +144 -0
  437. package/dist/testing/fakeClient.d.ts +61 -0
  438. package/dist/testing/fakeClient.d.ts.map +1 -0
  439. package/dist/testing/fakeClient.js +142 -0
  440. package/dist/testing/fakeController.d.ts +18 -0
  441. package/dist/testing/fakeController.d.ts.map +1 -0
  442. package/dist/testing/fakeController.js +165 -0
  443. package/dist/testing/fakeDocumentController.d.ts +37 -0
  444. package/dist/testing/fakeDocumentController.d.ts.map +1 -0
  445. package/dist/testing/fakeDocumentController.js +104 -0
  446. package/dist/testing/fakeSelfieController.d.ts +15 -0
  447. package/dist/testing/fakeSelfieController.d.ts.map +1 -0
  448. package/dist/testing/fakeSelfieController.js +154 -0
  449. package/dist/testing/fakeSignatureController.d.ts +12 -0
  450. package/dist/testing/fakeSignatureController.d.ts.map +1 -0
  451. package/dist/testing/fakeSignatureController.js +58 -0
  452. package/dist/testing/fakeVideoIdController.d.ts +12 -0
  453. package/dist/testing/fakeVideoIdController.d.ts.map +1 -0
  454. package/dist/testing/fakeVideoIdController.js +50 -0
  455. package/dist/testing/index.d.ts +15 -0
  456. package/dist/testing/index.d.ts.map +1 -0
  457. package/dist/testing/index.js +18 -0
  458. package/dist/testing/stubSignatureCanvas.d.ts +2 -0
  459. package/dist/testing/stubSignatureCanvas.d.ts.map +1 -0
  460. package/dist/testing/stubSignatureCanvas.js +26 -0
  461. package/dist/testing/stubVideoCaptureDom.d.ts +2 -0
  462. package/dist/testing/stubVideoCaptureDom.d.ts.map +1 -0
  463. package/dist/testing/stubVideoCaptureDom.js +36 -0
  464. package/dist/theme/color.d.ts +14 -0
  465. package/dist/theme/color.d.ts.map +1 -0
  466. package/dist/theme/color.js +1 -0
  467. package/dist/theme/index.d.ts +405 -0
  468. package/dist/theme/index.d.ts.map +1 -0
  469. package/dist/theme/index.js +230 -0
  470. package/dist/utils/canvas.d.ts +3 -0
  471. package/dist/utils/canvas.d.ts.map +1 -0
  472. package/dist/utils/canvas.js +16 -0
  473. package/dist/utils/cdn.d.ts +2 -0
  474. package/dist/utils/cdn.d.ts.map +1 -0
  475. package/dist/utils/cdn.js +3 -0
  476. package/dist/utils/cropping.d.ts +4 -0
  477. package/dist/utils/cropping.d.ts.map +1 -0
  478. package/dist/utils/cropping.js +11 -0
  479. package/dist/utils/flowClock.d.ts +6 -0
  480. package/dist/utils/flowClock.d.ts.map +1 -0
  481. package/dist/utils/flowClock.js +22 -0
  482. package/dist/utils/isMobile.d.ts +3 -0
  483. package/dist/utils/isMobile.d.ts.map +1 -0
  484. package/dist/utils/isMobile.js +35 -0
  485. package/dist/utils/loadProgressHooks.d.ts +25 -0
  486. package/dist/utils/loadProgressHooks.d.ts.map +1 -0
  487. package/dist/utils/loadProgressHooks.js +79 -0
  488. package/dist/utils/logger.d.ts +18 -0
  489. package/dist/utils/logger.d.ts.map +1 -0
  490. package/dist/utils/logger.js +38 -0
  491. package/dist/utils/merge.d.ts +3 -0
  492. package/dist/utils/merge.d.ts.map +1 -0
  493. package/dist/utils/merge.js +23 -0
  494. package/dist/utils/signaturePadStrokeGuard.d.ts +16 -0
  495. package/dist/utils/signaturePadStrokeGuard.d.ts.map +1 -0
  496. package/dist/utils/signaturePadStrokeGuard.js +70 -0
  497. package/dist/version.d.ts +2 -0
  498. package/dist/version.d.ts.map +1 -0
  499. package/dist/version.js +3 -0
  500. package/package.json +71 -0
@@ -0,0 +1,454 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ // Task 12: the phase-switched assembly. Everything Tasks 2-11 built (the
3
+ // headless controller + bindings, layout contexts, camera feed, guidance
4
+ // pills, guide router, loading overlay family, review/error screens) is
5
+ // composed here into one component — the UI-package analog of sdk2's
6
+ // IdCaptureWizard.tsx (assembly order below mirrors :1452-1596, see
7
+ // task-12-report.md for the line-by-line comparison).
8
+ //
9
+ // Divergence from a literal wizard port (documented, not accidental):
10
+ // - sdk2's wizard has no unified "phase" — it branches on captureState +
11
+ // submissionStatus + a scatter of boolean flags across ~150 lines.
12
+ // Core's `CapturePhase` (idCapture/phase.ts) already collapses that into
13
+ // one union; this view switches on it directly instead of re-deriving
14
+ // the same branches sdk2's wizard hand-rolled.
15
+ // - The single guidance pill (sdk2 PR #254: one held code drives the
16
+ // pill's text AND background, IdCapture.tsx:279-330) only renders during
17
+ // phase 'capturing'. sdk2 gates it on `overlayDismissed && captureState
18
+ // === 'capturing'` (the pill lives inside sdk2's `<IdCapture>`, wizard
19
+ // :1456-1468) OR 'requestingBetterBarcode' — but the barcode branch's
20
+ // "recapture message" is a DIFFERENT standalone live element in sdk2
21
+ // (wizard :1470-1490), and this package's IdCaptureGuides router already
22
+ // folds that exact message into BarcodeGuideOverlay's own
23
+ // `instructionText` for 'requestingBetterBarcode' (see
24
+ // IdCaptureGuides.tsx's divergence-6 comment) — showing the held pill
25
+ // too during that phase would be a second, redundant "recapture
26
+ // message". 'requestingFlip' shows neither (no live detection guidance
27
+ // while flip art is up, matching sdk2: IdCapture never mounts during
28
+ // requestingFlip either).
29
+ // - sdk2's `customOverlayContent` and loading lifecycle callbacks are
30
+ // explicit view seams because hosts use them to coordinate loading chrome
31
+ // outside the SDK. `separateIdCardCaptureSequence` is represented by the
32
+ // `flipReview` prop instead of a controller-level auto-timer setting
33
+ // (core's own `flipConfirmation: 'manual'` config knob is the
34
+ // controller-side equivalent — see controller.ts). ExitCaptureButton only
35
+ // renders when the host passes `onExit`; an inert X button would be worse
36
+ // than none.
37
+ import { useCallback, useEffect, useRef, useState, } from 'react';
38
+ import { styled } from 'styled-components';
39
+ import { useTranslation } from 'react-i18next';
40
+ import { useIdCapture } from './bindings/useIdCapture';
41
+ import { useLanguage } from './i18n';
42
+ import { GuideLayoutProvider, useGuideLayout } from './layout/GuideLayoutContext';
43
+ import GuideOrientationContextProvider from './layout/GuideOrientationContext';
44
+ import { ScalingCameraFeed } from './components/CameraFeed';
45
+ import { DebugBoundingBoxOverlay, DebugStatsPane, IdCaptureDetectedObjectDebugBox, useDebugScalingDetails, } from './components/debug/debug';
46
+ import { IdCaptureGuides, } from './components/guides/IdCaptureGuides';
47
+ import { GuidanceMessage, GuidanceMessageContainer } from './components/GuidanceMessage';
48
+ import { guidanceMessageKey } from './guidance/strings';
49
+ import { ExitCaptureButton } from './components/ExitCaptureButton';
50
+ import { OverrideWrongDocumentTypeDialog, } from './components/OverrideWrongDocumentTypeDialog';
51
+ import { IdCaptureLoadingOverlay, } from './components/loading/IdCaptureLoadingOverlay';
52
+ import { ReviewScreen, } from './components/review/ReviewScreen';
53
+ import { ErrorScreen, } from './components/error/ErrorScreen';
54
+ import { IdCaptureFallback, } from './components/fallback/IdCaptureFallback';
55
+ import { IdCaptureOrUploadScreen, } from './components/fallback/IdCaptureOrUploadScreen';
56
+ import { useShowSuccessScreen, } from './flows/useShowSuccessScreen';
57
+ import { useSessionReady } from './flows/AuthStateContext';
58
+ // Unlike SelfieCaptureView/FaceLivenessView, this view has no root
59
+ // container of its own -- ScalingCameraFeed/IdCaptureGuides/etc. render as
60
+ // siblings relying on whatever positioned ancestor the host page provides.
61
+ // sdk2 applied theme.fontFamily at the flow-level SdkPage wrapper
62
+ // (SdkPage.tsx:59, `font-family: ${props.theme.fontFamily}` when set) --
63
+ // SdkPage itself is flow-level and was never ported to this package. This
64
+ // minimal wrapper carries the same conditional font-family without adding a
65
+ // layout box of its own: `display: contents` makes it invisible to layout/
66
+ // positioning (absolutely positioned descendants still resolve their
67
+ // containing block against whatever ancestor the host provides, exactly as
68
+ // before this wrapper existed) while font-family -- an inherited CSS
69
+ // property -- still cascades to every descendant.
70
+ const FontCarrier = styled.div `
71
+ display: contents;
72
+ ${(props) => (props.theme?.fontFamily ? `font-family: ${props.theme.fontFamily};` : '')}
73
+ `;
74
+ // Phases where IdCaptureGuides (the visual guide box / barcode overlay
75
+ // router) renders. 'requestingFlip' is excluded when `flipReview` swaps it
76
+ // for the ReviewScreen interstitial instead (see render below).
77
+ const GUIDE_PHASES = new Set([
78
+ 'capturing',
79
+ 'requestingBetterBarcode',
80
+ 'requestingFlip',
81
+ ]);
82
+ // Phases where ReviewScreen renders (the flip interstitial, when enabled,
83
+ // joins this set below via `isFlipInterstitial`).
84
+ const REVIEW_PHASES = new Set([
85
+ 'reviewing',
86
+ 'uploading',
87
+ 'complete',
88
+ ]);
89
+ export function IdCaptureView({ controller, guideType = 'fit', loadingOverlayMode = 'default', cameraFeedMode = 'snapToGuides', guideBoxDisabled = false, forceFallbackMode = false, silentFallback = false, allowUploadingDocumentsFromStorage = false, portraitGuidesOnMobile = true, rotateLoadingOverlayImageWhenPortrait = true, guideBoxFollowsMask = false, flipReview = false, sessionReady: sessionReadyProp, skipSuccessScreen = false, lang = 'auto', autoContinueAfterLoading = false, showIntroScreen = false, debugMode = false, onExit, onUserCancel, onLoadingStarted, onLoadingProgress, onLoadingCompleted, onLoadingFailed, onLoadingOverlayDismissed, customOverlayContent, instructions, onCameraTamperingDetected, onCameraAccessDenied, onModelError, onExitAfterTamperSealPopped, onDocumentStored, onRetry, onSubmitted, onCollected, verbiage = {}, classNames = {}, colors = {}, assets = {}, }) {
90
+ // Omitted means "follow the session": mounted inside a flow this view now
91
+ // renders during session validation, so its own loading overlay is the one
92
+ // loading surface (2.x behaviour — see useSessionReady). An explicit prop
93
+ // still wins, which is what Storybook and the headless demo pass.
94
+ const sessionFromContext = useSessionReady();
95
+ const sessionReady = sessionReadyProp ?? sessionFromContext;
96
+ useLanguage(lang);
97
+ const { t } = useTranslation();
98
+ const state = useIdCapture(controller);
99
+ // Ref-callback + an effect keyed only on [controller]: the ref callback
100
+ // (fired during React's commit phase, before effects) populates
101
+ // `videoElRef` synchronously; by the time this effect body runs the video
102
+ // element already exists for every phase this view mounts it in (see
103
+ // ScalingCameraFeed below — CameraFeed.test.tsx confirms it renders in
104
+ // every phase except reviewing/uploading/complete, and controller state
105
+ // starts 'initializing'). `.catch(() => {})` the attach promise: the
106
+ // dual-truth contract (controller.ts:1454-1466, mirrored by the fake)
107
+ // already lands the SAME error on `state.error`/`state.phase === 'error'`,
108
+ // so there is nothing further for the view to do with the rejection
109
+ // itself — letting it go unhandled would fail StrictMode/production alike
110
+ // with an unhandledrejection. Capture start is deferred so this view's
111
+ // loading/consent overlay remains a hard boundary around frame processing.
112
+ const videoElRef = useRef(null);
113
+ const setVideoRef = useCallback((node) => {
114
+ videoElRef.current = node;
115
+ }, []);
116
+ useEffect(() => {
117
+ const el = videoElRef.current;
118
+ if (!el)
119
+ return;
120
+ controller.attach(el, { deferCaptureStart: true }).catch(() => { });
121
+ return () => {
122
+ controller.detach();
123
+ };
124
+ }, [controller]);
125
+ // sdk2 wizard pattern (:1446-1450, :1527-1552): the loading overlay is
126
+ // view-local state, not derived from controller phase — it stays up until
127
+ // BOTH models+camera are ready (IdCaptureLoadingOverlay's own `ready`
128
+ // gate, which controls whether its Continue button even renders) AND the
129
+ // user clicks that Continue button (`onDismissed`). A fresh controller
130
+ // means a fresh session, so this resets alongside the attach effect above.
131
+ const [overlayDismissed, setOverlayDismissed] = useState(false);
132
+ useEffect(() => {
133
+ setOverlayDismissed(false);
134
+ }, [controller]);
135
+ const handleLoadingOverlayDismissed = useCallback(() => {
136
+ setOverlayDismissed(true);
137
+ controller.actions.start();
138
+ onLoadingOverlayDismissed?.();
139
+ }, [controller, onLoadingOverlayDismissed]);
140
+ // Per-document progress, ported from sdk2's onDocumentStored effect
141
+ // (IdCaptureWizard.tsx:342-372). Diffs capturedDocuments against what has
142
+ // already been announced, comparing by IDENTITY rather than presence: a
143
+ // recapture replaces the same key with a different object and must report
144
+ // again.
145
+ //
146
+ // Documents the controller seeded from `precapturedDocuments` are skipped.
147
+ // Seeding replays them through the ordinary `documentCaptured` action, so
148
+ // state alone cannot tell them apart — core records which types were seeded
149
+ // for exactly this reason. Each seeded type is skipped ONCE: a later
150
+ // recapture of that same document is a real capture and is reported.
151
+ const reportedDocumentsRef = useRef({});
152
+ const pendingPrecapturedRef = useRef(new Set());
153
+ const seenPrecapturedRef = useRef(new Set());
154
+ const tamperReportedRef = useRef(false);
155
+ const cameraDeniedReportedRef = useRef(false);
156
+ const reportedModelErrorRef = useRef(null);
157
+ // A new controller is a new session, so every notification latch below has
158
+ // to start over — the same reasoning as the attach and overlay-dismissal
159
+ // effects above. Declared BEFORE the two reporting effects so React runs it
160
+ // first in the same commit, clearing the latches before the new
161
+ // controller's state is processed.
162
+ //
163
+ // Without this, a swapped-in controller's PRECAPTURED documents would be
164
+ // announced as fresh captures (their types are already in `seen`, so they
165
+ // never reach the pending-exclusion set), and a new controller that is also
166
+ // tampered would report nothing at all (the latch is still spent from the
167
+ // old one).
168
+ useEffect(() => {
169
+ reportedDocumentsRef.current = {};
170
+ pendingPrecapturedRef.current = new Set();
171
+ seenPrecapturedRef.current = new Set();
172
+ tamperReportedRef.current = false;
173
+ cameraDeniedReportedRef.current = false;
174
+ reportedModelErrorRef.current = null;
175
+ }, [controller]);
176
+ useEffect(() => {
177
+ // `precapturedDocumentTypes` lands in the SAME state update as the seeded
178
+ // documents (both come from configureWizard, which runs at attach — long
179
+ // after this effect first runs with an empty state). Folding it in here,
180
+ // rather than seeding once on mount, is what makes the skip actually
181
+ // apply. `seen` keeps a consumed exclusion from being re-armed.
182
+ for (const documentType of state.precapturedDocumentTypes) {
183
+ if (seenPrecapturedRef.current.has(documentType))
184
+ continue;
185
+ seenPrecapturedRef.current.add(documentType);
186
+ pendingPrecapturedRef.current.add(documentType);
187
+ }
188
+ for (const key of Object.keys(state.capturedDocuments)) {
189
+ const documentType = key;
190
+ const document = state.capturedDocuments[documentType];
191
+ if (!document)
192
+ continue;
193
+ if (reportedDocumentsRef.current[documentType] === document)
194
+ continue;
195
+ reportedDocumentsRef.current[documentType] = document;
196
+ if (pendingPrecapturedRef.current.delete(documentType))
197
+ continue;
198
+ onDocumentStored?.(documentType);
199
+ }
200
+ // `controller` is a dependency so a swap re-runs this against the new
201
+ // controller's documents even if the state objects happened to be equal.
202
+ }, [
203
+ controller,
204
+ state.capturedDocuments,
205
+ state.precapturedDocumentTypes,
206
+ onDocumentStored,
207
+ ]);
208
+ // sdk2's `onCameraTamperingDetected` is a one-shot notification, not a
209
+ // per-render signal. Latched on a ref rather than fired from the render
210
+ // path so StrictMode's double-invoke and any unrelated re-render (guidance
211
+ // ticking, a resize) cannot double-report a single detection. The latch
212
+ // clears when the error goes away, so a retry that re-detects tampering
213
+ // reports again — the host is counting detections, not screens.
214
+ const tampered = state.error?.code === 'CAMERA_TAMPERING_SUSPECTED';
215
+ useEffect(() => {
216
+ if (!tampered) {
217
+ tamperReportedRef.current = false;
218
+ return;
219
+ }
220
+ if (tamperReportedRef.current)
221
+ return;
222
+ tamperReportedRef.current = true;
223
+ onCameraTamperingDetected?.();
224
+ // `controller` is a dependency because `tampered` alone does not change
225
+ // when one tampered controller replaces another — without it, the new
226
+ // controller's detection would go unreported.
227
+ }, [controller, tampered, onCameraTamperingDetected]);
228
+ // Same one-shot latch shape as the tamper notification above, for the two
229
+ // sdk2 side-channel callbacks the ID stage had been dropping. Both read the
230
+ // controller's typed error, which is where core lands a denied camera and a
231
+ // failed model load alike (dual-truth contract: the same failure is already
232
+ // on screen, so these are notifications, not the error UI).
233
+ const cameraDenied = state.error?.code === 'CAMERA_PERMISSION_DENIED';
234
+ useEffect(() => {
235
+ if (!cameraDenied) {
236
+ cameraDeniedReportedRef.current = false;
237
+ return;
238
+ }
239
+ if (cameraDeniedReportedRef.current)
240
+ return;
241
+ cameraDeniedReportedRef.current = true;
242
+ onCameraAccessDenied?.();
243
+ }, [controller, cameraDenied, onCameraAccessDenied]);
244
+ // Keyed on the ERROR OBJECT's identity, not on its cause: a MODEL_LOAD_FAILED
245
+ // with no cause attached is still a model failure the host asked to hear
246
+ // about, and keying on the cause skipped those entirely. A second, different
247
+ // failure after a retry is a new object and reports again, while any
248
+ // re-render carrying the same one does not.
249
+ //
250
+ // The cause is typed `unknown` on `CaptureError`, so it is normalised to an
251
+ // Error at the callback boundary only — normalising earlier would mint a new
252
+ // object per render and defeat the latch.
253
+ const modelError = state.error?.code === 'MODEL_LOAD_FAILED' ? state.error : null;
254
+ useEffect(() => {
255
+ if (!modelError) {
256
+ reportedModelErrorRef.current = null;
257
+ return;
258
+ }
259
+ if (reportedModelErrorRef.current === modelError)
260
+ return;
261
+ reportedModelErrorRef.current = modelError;
262
+ const cause = modelError.cause;
263
+ onModelError?.(cause instanceof Error
264
+ ? cause
265
+ : new Error(cause == null
266
+ ? `Model ${modelError.model} failed to load`
267
+ : String(cause)));
268
+ }, [controller, modelError, onModelError]);
269
+ // sdk2 IdCaptureWizard.tsx:1645-1648 verbatim, including the AND with
270
+ // `portraitGuidesOnMobile`: the overlay image only ever rotates to match
271
+ // guides that are themselves standing the card up. Read at render time (no
272
+ // resize listener) exactly as sdk2 read it — an orientation change
273
+ // re-renders this view through the guide layout's own resize observer.
274
+ const rotateOverlayImage = rotateLoadingOverlayImageWhenPortrait &&
275
+ portraitGuidesOnMobile &&
276
+ typeof window !== 'undefined' &&
277
+ window.innerWidth < window.innerHeight;
278
+ const isFlipInterstitial = state.phase === 'requestingFlip' && flipReview;
279
+ // sdk2 IdCaptureWizard.tsx:535 — the fallback owns the screen when the
280
+ // integrator asked for it OR the models failed. `fallbackFinished` is what
281
+ // lets the user out of it: once they are done supplying images the
282
+ // controller is holding them, so the normal render resumes and lands on the
283
+ // review screen (sdk2 submitted straight from the fallback; the review step
284
+ // is 3.0's own, and `skipSuccessScreen` still applies to it).
285
+ const [fallbackFinished, setFallbackFinished] = useState(false);
286
+ useEffect(() => {
287
+ setFallbackFinished(false);
288
+ }, [controller]);
289
+ const inFallbackMode = !fallbackFinished &&
290
+ (forceFallbackMode || state.error?.code === 'MODEL_LOAD_FAILED');
291
+ // The upload choice comes BEFORE capture, so it is gated on the phase where
292
+ // nothing has been captured yet — sdk2 gates on
293
+ // `['initializing', 'uploading'].includes(captureState)`.
294
+ const [uploadChoiceMade, setUploadChoiceMade] = useState(false);
295
+ const showUploadChoice = allowUploadingDocumentsFromStorage &&
296
+ !uploadChoiceMade &&
297
+ !inFallbackMode &&
298
+ state.phase === 'initializing';
299
+ // While either screen owns the surface, the ordinary capture chrome is
300
+ // suppressed — guides, loading overlay, review and error screens would all
301
+ // be stacked underneath it otherwise, and the error screen in particular
302
+ // would show through as soon as a model failure put us in fallback mode.
303
+ const screenTakeover = inFallbackMode || showUploadChoice;
304
+ const showGuides = !screenTakeover && GUIDE_PHASES.has(state.phase) && !isFlipInterstitial;
305
+ // sdk2 IdCapture.tsx:311-330: the pill is hidden when the resolved text is
306
+ // '' (guidanceMessageKey maps the held NONE code to ''). Text and variant
307
+ // both read the same held event, so the pill's background always describes
308
+ // the message it is showing.
309
+ const guidanceKey = guidanceMessageKey(state.guidance);
310
+ const showGuidancePill = overlayDismissed && state.phase === 'capturing' && guidanceKey !== '';
311
+ // The overlay stacks on top of the capture/guide screen exactly like
312
+ // sdk2's wizard (never simultaneously with review/error) — plus phase
313
+ // 'initializing' forces it regardless (nothing to dismiss into yet).
314
+ const showLoadingOverlay = !screenTakeover &&
315
+ (state.phase === 'initializing' || (!overlayDismissed && showGuides));
316
+ const handleSubmit = useCallback(() => {
317
+ // Collect-don't-submit seam (onCollected doc above): when a host is
318
+ // composing this view with another stage into one combined submission,
319
+ // it takes over entirely — collectArtifacts() is a pure, synchronous
320
+ // read that cannot reject, so there is no error path to wire here (unlike
321
+ // the submit path below).
322
+ if (onCollected) {
323
+ onCollected(controller.collectArtifacts());
324
+ return;
325
+ }
326
+ controller.actions.submit().then(
327
+ // `onSubmitted` reports a RESPONSE; the hand-off path resolves null.
328
+ (response) => {
329
+ if (response)
330
+ onSubmitted?.(response);
331
+ }, () => {
332
+ // Dual-truth contract: the same error already landed on state.error
333
+ // (phase 'error') — nothing further to do here.
334
+ });
335
+ }, [controller, onSubmitted, onCollected]);
336
+ const showSuccessScreen = useShowSuccessScreen(skipSuccessScreen, state.phase === 'reviewing', handleSubmit);
337
+ const showReview = !screenTakeover &&
338
+ (isFlipInterstitial ||
339
+ (REVIEW_PHASES.has(state.phase) && showSuccessScreen));
340
+ const handleConfirmFlip = useCallback(() => {
341
+ controller.actions.confirmFlip();
342
+ }, [controller]);
343
+ // Shared by ReviewScreen's Retry and ErrorScreen's Retry, so `onRetry`
344
+ // reports both deliberate redos and recoverable-error restarts.
345
+ //
346
+ // Notify BEFORE resetting, matching sdk2's onRetryClick
347
+ // (IdCaptureWizard.tsx:1124-1127): the host sees the retry against the state
348
+ // that prompted it, not against the freshly-cleared one.
349
+ const handleRetry = useCallback(() => {
350
+ onRetry?.();
351
+ void controller.actions.retry();
352
+ }, [controller, onRetry]);
353
+ const handleOverride = useCallback(() => {
354
+ controller.actions.overrideWrongDocumentType();
355
+ }, [controller]);
356
+ const reviewFlipVerbiage = {
357
+ submitText: 'Continue',
358
+ ...verbiage.reviewFlip,
359
+ };
360
+ const handleManualImages = useCallback((captureMode) => (imageDataUrl) => {
361
+ void controller.actions
362
+ .captureManually(imageDataUrl, { captureMode })
363
+ .catch(() => { });
364
+ }, [controller]);
365
+ return (_jsx(FontCarrier, { children: _jsx(GuideOrientationContextProvider, { children: _jsxs(GuideLayoutProvider, { children: [_jsx(ScalingCameraFeed, { videoRef: setVideoRef, phase: state.phase, isRearFacing: state.camera.isRearFacing, cameraFeedMode: cameraFeedMode, className: classNames.cameraFeed }), inFallbackMode && (_jsx(IdCaptureFallback, { captureRequirement: state.captureRequirement, idCardBackCaptureRequired: state.idCardBackCaptureRequired, silentFallback: silentFallback, onCapture: handleManualImages('Manual'), onFinished: () => setFallbackFinished(true), classNames: classNames.fallback, colors: colors.fallback, verbiage: verbiage.fallback })), showUploadChoice && (_jsx(IdCaptureOrUploadScreen, { captureRequirement: state.captureRequirement, idCardBackCaptureRequired: state.idCardBackCaptureRequired, onCaptureWithCamera: () => {
366
+ setUploadChoiceMade(true);
367
+ void controller.actions.requestCamera().catch(() => { });
368
+ }, onUpload: handleManualImages('Upload'), onFinished: () => setUploadChoiceMade(true), classNames: classNames.uploadOrCaptureScreen, colors: colors.uploadOrCaptureScreen, verbiage: verbiage.uploadOrCaptureScreen })), showGuides && (_jsx(IdCaptureGuides, { state: state, isRearFacing: state.camera.isRearFacing, guideType: guideType, guideBoxDisabled: guideBoxDisabled, portraitGuidesOnMobile: portraitGuidesOnMobile, guideBoxFollowsMask: guideBoxFollowsMask, cameraFeedMode: cameraFeedMode, images: assets.guideImages, classNames: classNames.guides, verbiage: verbiage.guides, status: !overlayDismissed ? 'disabled' : undefined })), showGuidancePill && (_jsx(GuidanceMessageContainer, { "$top": "", "$bottom": "12.5%", className: classNames.guidanceMessageContainer, children: _jsx(GuidanceMessage, { "$variant": state.guidance.satisfied ? 'positive' : 'default', className: classNames.guidanceMessage, children: t(guidanceKey) }) })), state.phase !== 'complete' && _jsx("div", { id: "idmission-above-guides-content" }), debugMode && overlayDismissed && showGuides && (_jsx(IdCaptureDebugLayer, { state: state })), onExit != null && (_jsx(ExitCaptureButton, { onClick: onExit, className: classNames.exitBtn })), showLoadingOverlay && (_jsx(IdCaptureLoadingOverlay, { state: state, mode: loadingOverlayMode, sessionReady: sessionReady, autoContinueAfterLoading: autoContinueAfterLoading, showIntroScreen: showIntroScreen, assets: assets.loadingOverlay, classNames: classNames.loadingOverlay, colors: colors.loadingOverlay, verbiage: verbiage.loadingOverlay, rotateImage: rotateOverlayImage, onUserCancel: onUserCancel, onLoadingStarted: onLoadingStarted, onLoadingProgress: onLoadingProgress, onLoadingCompleted: onLoadingCompleted, onLoadingFailed: onLoadingFailed, onDismissed: handleLoadingOverlayDismissed, customOverlayContent: customOverlayContent, instructions: instructions, onRequestCamera: () => controller.actions.requestCamera() })), _jsx(OverrideWrongDocumentTypeDialog, { visible: state.allowOverrideWrongDocumentTypeGuidance, onOverride: handleOverride, classNames: classNames.overrideWrongDocumentType, verbiage: verbiage.overrideWrongDocumentType }), showReview && (_jsx(ReviewScreen, { capturedDocuments: state.capturedDocuments, submission: isFlipInterstitial ? 'idle' : state.submission, sessionReady: sessionReady, diagnostics: debugMode && !isFlipInterstitial
369
+ ? {
370
+ initialBarcodeScore: state.recaptureBarcodeScore !== null
371
+ ? state.initialBarcodeScore
372
+ : undefined,
373
+ recaptureBarcodeScore: state.recaptureBarcodeScore,
374
+ initialCaptureBarcodeImage: state.initialCaptureBarcodeImage,
375
+ recaptureBarcodeImage: state.recaptureBarcodeImage,
376
+ nativeBarcodeDecodeResult: state.nativeBarcodeDecodeResult,
377
+ nativeBarcodeDecodeAttempted: state.nativeBarcodeDecodeAttempted,
378
+ nativeBarcodeDecodeDetails: state.nativeBarcodeDecodeDetails,
379
+ pdf417DetectionCount: state.pdf417DetectionCount,
380
+ pdf417LowScoreCount: state.pdf417LowScoreCount,
381
+ zxingParseAttemptCount: state.zxingParseAttemptCount,
382
+ }
383
+ : undefined, onSubmit: isFlipInterstitial ? handleConfirmFlip : handleSubmit, onRetry: handleRetry, verbiage: isFlipInterstitial ? reviewFlipVerbiage : verbiage.review, classNames: classNames.review })), !screenTakeover && state.phase === 'error' && state.error !== null && (_jsx(ErrorScreen, { error: state.error, onRetry: handleRetry, onExit: state.error.code === 'CAMERA_TAMPERING_SUSPECTED'
384
+ ? onExitAfterTamperSealPopped
385
+ : undefined, verbiage: verbiage.error, classNames: classNames.error,
386
+ // 2.x styled/translated the camera-denied screen through the
387
+ // loading overlay's `cameraAccessDenied` bag; denial rendering
388
+ // moved to ErrorScreen, so route that bag to its new home.
389
+ cameraAccessDenied: {
390
+ assets: assets.loadingOverlay?.cameraAccessDenied,
391
+ classNames: classNames.loadingOverlay?.cameraAccessDenied,
392
+ colors: colors.loadingOverlay?.cameraAccessDenied,
393
+ verbiage: verbiage.loadingOverlay?.cameraAccessDenied,
394
+ } }))] }) }) }));
395
+ }
396
+ // Debug overlay + stats pane, sourced from sdk2 IdCapture.tsx:333-353
397
+ // (per-detected-object boxes, anchored to the guide rect via
398
+ // DebugBoundingBoxOverlay) and :386-467 (the DebugStatsPane score readout).
399
+ // Split into its own component (rather than inlined above) so it can call
400
+ // useGuideLayout() as a DESCENDANT of GuideLayoutProvider -- IdCaptureView
401
+ // itself renders that provider and can't consume its own context.
402
+ //
403
+ // Field-for-field adaptation from sdk2's stats pane: every line below reads
404
+ // straight off IdCaptureControllerState, so any sdk2 line with no public
405
+ // state equivalent is dropped rather than faked --
406
+ // - "Camera: <label> (WxH)" -> camera label isn't on controller state;
407
+ // kept the ready/not-ready check plus state.videoWidth/videoHeight (the
408
+ // camera's actual decoded resolution, which IS on state).
409
+ // - the frame-rate line's "(Xms doc detect, Yms focus)" suffix -> per-model
410
+ // timings live only inside the core pipeline's internal FrameLoop, never
411
+ // surfaced publicly; dropped.
412
+ // - "Best Barcode Score" -> getBestBarcode() is a controller-internal
413
+ // pipeline accessor with no public read; dropped.
414
+ // Every other line (detection scores/thresholds, occlusion, barcode/booklet
415
+ // state, good-frame count) has a direct, same-named field on
416
+ // IdCaptureControllerState and is ported verbatim, sdk2 quirks (e.g. the
417
+ // exact ✅/❌ ternaries) included.
418
+ function IdCaptureDebugLayer({ state, }) {
419
+ const { guideRect } = useGuideLayout();
420
+ const isRearFacing = state.camera.isRearFacing;
421
+ const scaling = useDebugScalingDetails({
422
+ enabled: true,
423
+ pageWidth: guideRect?.width || 1,
424
+ pageHeight: guideRect?.height || 1,
425
+ videoWidth: state.videoWidth,
426
+ videoHeight: state.videoHeight,
427
+ });
428
+ return (_jsxs(_Fragment, { children: [_jsx(DebugBoundingBoxOverlay, { "$flipX": !isRearFacing, scaling: scaling, guideRect: guideRect, children: state.detectedObjects.map((obj, i) => {
429
+ // During barcode recapture, render PDF417 barcodes with green color
430
+ // (sdk2 IdCapture.tsx:342-345).
431
+ const isBarcodeRecapture = state.captureState === 'requestingBetterBarcode';
432
+ const isBarcode = obj.label === 'PDF417';
433
+ const color = isBarcodeRecapture && isBarcode ? 'green' : undefined;
434
+ return (_jsx(IdCaptureDetectedObjectDebugBox, { obj: obj, scaling: scaling, flipX: !isRearFacing, color: color }, i));
435
+ }) }), _jsxs(DebugStatsPane, { children: [state.camera.ready ? (_jsxs(_Fragment, { children: ["\u2705 Camera ready (", state.videoWidth, "x", state.videoHeight, ")"] })) : ('❌ Camera not ready'), _jsx("br", {}), state.frameCaptureRate > 0.75 ? '✅' : '👎', " Frame Rate:", ' ', Math.round((state.frameCaptureRate + Number.EPSILON) * 1000) / 1000, " fps", _jsx("br", {}), state.models.ready ? (_jsxs(_Fragment, { children: [state.detectionThresholdMet ? '✅' : '❌', " Detected Document Type:", ' ', state.detectedDocumentType, _jsx("br", {}), state.idCardFrontDetectionThresholdMet ? '✅' : '❌', " ID Card Front Score: ", state.idCardFrontDetectionScore.toFixed(3), _jsx("br", {}), state.idCardBackDetectionThresholdMet ? '✅' : '❌', " ID Card Back Score: ", state.idCardBackDetectionScore.toFixed(3), _jsx("br", {}), state.passportDetectionThresholdMet ? '✅' : '❌', " Passport Score:", ' ', state.passportDetectionScore.toFixed(3), _jsx("br", {}), state.singlePageDetectionThresholdMet ? '✅' : '❌', " Single Page Score: ", state.singlePageDetectionScore.toFixed(3), _jsx("br", {}), state.focusThresholdMet ? '✅' : '❌', " Focus Score:", ' ', state.focusScore.toFixed(3), _jsx("br", {}), state.enableFingerOcclusionGuidance && (_jsxs(_Fragment, { children: [state.fingersOccludingDocument ? '❌' : '✅', " Max Finger Score:", ' ', Math.max(0, ...state.detectedObjects
436
+ .filter((o) => o.label === 'Finger')
437
+ .map((o) => o.score)).toFixed(3), _jsx("br", {})] })), state.enableGlareOcclusionGuidance && (_jsxs(_Fragment, { children: [state.glareOccludingDocument ? '❌' : '✅', " Max Glare Score:", ' ', Math.max(0, ...state.detectedObjects
438
+ .filter((o) => o.label === 'Glare')
439
+ .map((o) => o.score)).toFixed(3), _jsx("br", {})] })), state.enableHologramOcclusionGuidance && (_jsxs(_Fragment, { children: [state.hologramOccludingDocument ? '❌' : '✅', " Max Hologram Score:", ' ', Math.max(0, ...state.detectedObjects
440
+ .filter((o) => o.label === 'Hologram')
441
+ .map((o) => o.score)).toFixed(3), _jsx("br", {})] })), state.pdf417PredictionThresholdMet ? '✅' : '❌', " Current Barcode Score: ", state.pdf417PredictionScore.toFixed(3), _jsx("br", {}), state.aggressiveModeDecodeComplete ? '✅' : '⏳', " Aggressive Decode:", ' ', state.aggressiveModeDecodeComplete && state.aggressiveModeDecodeResult
442
+ ? `SUCCESS via ${state.aggressiveModeDecodeResult.method}`
443
+ : 'Pending', _jsx("br", {}), state.documentInBounds ? '✅' : '❌', " Document In Bounds", _jsx("br", {}), state.documentIsStable ? '✅' : '❌', " Document Is Stable", _jsx("br", {}), state.requireFullPassportBooklet && (_jsxs(_Fragment, { children: [state.bookletVerdict?.isFullBooklet &&
444
+ state.bookletVerdict.framing === 'ok'
445
+ ? '✅'
446
+ : '❌', ' ', "Booklet:", ' ', state.bookletVerdict
447
+ ? `${state.bookletVerdict.orientation}/${state.bookletVerdict.framing}` +
448
+ (state.bookletVerdict.metrics
449
+ ? ` leaf ${state.bookletVerdict.metrics.leafRatio.toFixed(2)}` +
450
+ ` aspect ${state.bookletVerdict.metrics.aspectRatio.toFixed(2)}` +
451
+ ` cont ${state.bookletVerdict.metrics.mrzInPage.toFixed(2)}/${state.bookletVerdict.metrics.pageInDocument.toFixed(2)}`
452
+ : ' (boxes missing)')
453
+ : 'N/A', _jsx("br", {})] })), state.goodFramesThresholdMet ? '✅' : '❌', " Good Frame Count:", ' ', state.goodFramesCount, "/", state.goodFramesThreshold] })) : (_jsx(_Fragment, { children: "\u274C Models not ready" }))] })] }));
454
+ }
@@ -0,0 +1,119 @@
1
+ import { ReactElement, type ReactNode, type RefObject } from 'react';
2
+ import { SelfieGuidanceCode, type SelfieCaptureController } from '@idmission/websdk-core/selfieCapture';
3
+ import { type CustomerSuppliedVerbiage, type LangOption } from './i18n';
4
+ import { type SelfieCaptureSurfaceColors } from './components/selfie/SelfieCaptureSurface';
5
+ import { type FaceCaptureGuideOverlayClassNames } from './components/selfie/FaceCaptureGuideOverlay';
6
+ import { type SelfieCaptureLoadingOverlayAssets, type SelfieCaptureLoadingOverlayClassNames, type SelfieCaptureLoadingOverlayMode, type SelfieCaptureLoadingOverlayVerbiage } from './components/selfie_loading/SelfieCaptureLoadingOverlay';
7
+ import { type ErrorScreenClassNames, type ErrorScreenVerbiage } from './components/error/ErrorScreen';
8
+ export type SelfieGuidanceVerbiage = {
9
+ guidanceHoldStillText?: CustomerSuppliedVerbiage;
10
+ guidanceLookStraightText?: CustomerSuppliedVerbiage;
11
+ guidanceMoveBackText?: CustomerSuppliedVerbiage;
12
+ guidanceMoveForwardText?: CustomerSuppliedVerbiage;
13
+ guidanceMoveToCenterText?: CustomerSuppliedVerbiage;
14
+ guidanceNoFaceDetectedText?: CustomerSuppliedVerbiage;
15
+ guidanceVisibilityTooLowText?: CustomerSuppliedVerbiage;
16
+ guidanceNotStableText?: CustomerSuppliedVerbiage;
17
+ guidanceManualCaptureText?: CustomerSuppliedVerbiage;
18
+ manualCaptureBtnText?: CustomerSuppliedVerbiage;
19
+ };
20
+ export declare const GUIDANCE_VERBIAGE_FIELD: Record<Exclude<SelfieGuidanceCode, 'NONE'>, keyof SelfieGuidanceVerbiage>;
21
+ export type SelfieCaptureViewVerbiage = {
22
+ guidance?: SelfieGuidanceVerbiage;
23
+ loadingOverlay?: SelfieCaptureLoadingOverlayVerbiage;
24
+ error?: ErrorScreenVerbiage;
25
+ };
26
+ export type SelfieCaptureViewClassNames = {
27
+ container?: string;
28
+ cameraFeed?: string;
29
+ guides?: FaceCaptureGuideOverlayClassNames;
30
+ guidanceMessageContainer?: string;
31
+ guidanceMessage?: string;
32
+ loadingOverlay?: SelfieCaptureLoadingOverlayClassNames;
33
+ error?: ErrorScreenClassNames;
34
+ exitBtn?: string;
35
+ manualCaptureBtnContainer?: string;
36
+ manualCaptureBtn?: string;
37
+ };
38
+ export type SelfieCaptureViewColors = SelfieCaptureSurfaceColors;
39
+ export type SelfieCaptureViewAssets = {
40
+ loadingOverlay?: SelfieCaptureLoadingOverlayAssets;
41
+ };
42
+ export type SelfieCaptureViewProps = {
43
+ controller: SelfieCaptureController;
44
+ /** Which loading overlay variant renders. Defaults to 'default'. */
45
+ loadingOverlayMode?: SelfieCaptureLoadingOverlayMode;
46
+ /** Default true. Gates the loading overlay's session-checking line — same
47
+ * seam IdCaptureView exposes for its own loading overlay. */
48
+ sessionReady?: boolean;
49
+ lang?: LangOption;
50
+ /** When true, the loading overlay auto-dismisses ~400ms after
51
+ * models/camera are ready instead of waiting for the continue button.
52
+ * Default false. */
53
+ autoContinueAfterLoading?: boolean;
54
+ /** Ring mode only (`loadingOverlayMode: 'ring'`): shows a priming intro
55
+ * page first and defers the camera permission request to its "Enable
56
+ * camera & start" button instead of the ring rendering immediately.
57
+ * Default false. Meaningful only when `controller` was created with
58
+ * `deferCameraAcquisition: true` — otherwise `attach()` acquires the
59
+ * camera eagerly and `state.camera.accessRequested` latches before the
60
+ * intro ever gets a chance to render, so the overlay goes straight to the
61
+ * ring regardless of this flag (same caveat as IdCaptureView's own
62
+ * `showIntroScreen`). */
63
+ showIntroScreen?: boolean;
64
+ /** Ring mode only: opens the overlay with an animated ID→selfie handoff
65
+ * instead of the plain ring — the flow-level "you just finished ID
66
+ * capture, now do a selfie" transition. Default false. */
67
+ transitionFromIdCapture?: boolean;
68
+ /** Renders sdk2's face-detection debug overlay + DebugStatsPane readout
69
+ * (SelfieCaptureSurface's own `debugMode` doc has the full rundown).
70
+ * Default false; dev/QA tooling only, never enabled by a customer-facing
71
+ * story. */
72
+ debugMode?: boolean;
73
+ /** Shows face landmarks without enabling the full diagnostics pane. */
74
+ showFaceLandmarks?: boolean;
75
+ /** sdk2's third debug gate: sample points need this AND `debugMode`. */
76
+ debugShowSamplePoints?: boolean;
77
+ onLoadingStarted?: () => void;
78
+ onLoadingProgress?: (progress: number) => void;
79
+ onLoadingCompleted?: () => void;
80
+ onLoadingFailed?: (error?: Error) => void;
81
+ onLoadingOverlayDismissed?: () => void;
82
+ onCameraAccessDenied?: () => void;
83
+ /** sdk2's `onModelError` / `onSelfieCaptureModelError`: fires once with the
84
+ * Error when a selfie model fails to load or times out. */
85
+ onModelError?: (error: Error) => void;
86
+ /** sdk2's `onCameraTamperingDetected`: fires once per detection. */
87
+ onCameraTamperingDetected?: () => void;
88
+ /** sdk2's `onExitAfterTamperSealPopped`: renders an exit button on the
89
+ * tampering screen, which is otherwise a dead end. Bind-gated. */
90
+ onExitAfterTamperSealPopped?: () => void;
91
+ onUserCancel?: () => void;
92
+ customOverlayContent?: ReactNode;
93
+ allowManualSelfieCaptureOnLoadingError?: boolean;
94
+ /**
95
+ * sdk2's stock-camera fallback on a model failure: with in-camera manual
96
+ * capture NOT enabled, the user still finishes through the device picker
97
+ * rather than dead-ending at "Retry". Defaults to true, matching 2.x.
98
+ */
99
+ fallbackCapture?: boolean;
100
+ /** Reads as a normal capture step rather than an apology. sdk2's prop. */
101
+ silentFallback?: boolean;
102
+ /** Reuses a video element owned by a parent multi-stage flow. */
103
+ videoRef?: RefObject<HTMLVideoElement | null>;
104
+ /** False when a parent multi-stage flow renders the shared camera feed. */
105
+ renderCameraFeed?: boolean;
106
+ /** False when a parent multi-stage flow renders the shared face guide. */
107
+ renderFaceGuide?: boolean;
108
+ onExit?: () => void;
109
+ /** Fires once per new `state.capturedSelfie` (compared by `capturedAt`),
110
+ * passing its `dataUrl`. The selfie controller has no submit() action —
111
+ * this is the plain flow's sole "a selfie landed" signal. */
112
+ onCaptured?: (dataUrl: string) => void;
113
+ verbiage?: SelfieCaptureViewVerbiage;
114
+ classNames?: SelfieCaptureViewClassNames;
115
+ colors?: SelfieCaptureViewColors;
116
+ assets?: SelfieCaptureViewAssets;
117
+ };
118
+ export declare function SelfieCaptureView({ controller, loadingOverlayMode, sessionReady: sessionReadyProp, lang, autoContinueAfterLoading, showIntroScreen, transitionFromIdCapture, debugMode, showFaceLandmarks, debugShowSamplePoints, onLoadingStarted, onLoadingProgress, onLoadingCompleted, onLoadingFailed, onLoadingOverlayDismissed, onCameraAccessDenied, onModelError, onCameraTamperingDetected, onExitAfterTamperSealPopped, onUserCancel, customOverlayContent, allowManualSelfieCaptureOnLoadingError, fallbackCapture, silentFallback, videoRef, renderCameraFeed, renderFaceGuide, onExit, onCaptured, verbiage, classNames, colors, assets, }: SelfieCaptureViewProps): ReactElement;
119
+ //# sourceMappingURL=SelfieCaptureView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SelfieCaptureView.d.ts","sourceRoot":"","sources":["../src/SelfieCaptureView.tsx"],"names":[],"mappings":"AAgDA,OAAO,EACL,YAAY,EACZ,KAAK,SAAS,EACd,KAAK,SAAS,EAGf,MAAM,OAAO,CAAA;AAEd,OAAO,EACL,kBAAkB,EAClB,KAAK,uBAAuB,EAE7B,MAAM,sCAAsC,CAAA;AAE7C,OAAO,EAGL,KAAK,wBAAwB,EAC7B,KAAK,UAAU,EAChB,MAAM,QAAQ,CAAA;AACf,OAAO,EAEL,KAAK,0BAA0B,EAChC,MAAM,0CAA0C,CAAA;AACjD,OAAO,EACL,KAAK,iCAAiC,EAEvC,MAAM,6CAA6C,CAAA;AAKpD,OAAO,EACL,KAAK,iCAAiC,EACtC,KAAK,qCAAqC,EAC1C,KAAK,+BAA+B,EACpC,KAAK,mCAAmC,EACzC,MAAM,yDAAyD,CAAA;AAChE,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACzB,MAAM,gCAAgC,CAAA;AAOvC,MAAM,MAAM,sBAAsB,GAAG;IACnC,qBAAqB,CAAC,EAAE,wBAAwB,CAAA;IAChD,wBAAwB,CAAC,EAAE,wBAAwB,CAAA;IACnD,oBAAoB,CAAC,EAAE,wBAAwB,CAAA;IAC/C,uBAAuB,CAAC,EAAE,wBAAwB,CAAA;IAClD,wBAAwB,CAAC,EAAE,wBAAwB,CAAA;IACnD,0BAA0B,CAAC,EAAE,wBAAwB,CAAA;IACrD,4BAA4B,CAAC,EAAE,wBAAwB,CAAA;IACvD,qBAAqB,CAAC,EAAE,wBAAwB,CAAA;IAChD,yBAAyB,CAAC,EAAE,wBAAwB,CAAA;IACpD,oBAAoB,CAAC,EAAE,wBAAwB,CAAA;CAChD,CAAA;AAQD,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAC1C,OAAO,CAAC,kBAAkB,EAAE,MAAM,CAAC,EACnC,MAAM,sBAAsB,CAU7B,CAAA;AAoBD,MAAM,MAAM,yBAAyB,GAAG;IACtC,QAAQ,CAAC,EAAE,sBAAsB,CAAA;IACjC,cAAc,CAAC,EAAE,mCAAmC,CAAA;IACpD,KAAK,CAAC,EAAE,mBAAmB,CAAA;CAC5B,CAAA;AAED,MAAM,MAAM,2BAA2B,GAAG;IACxC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,MAAM,CAAC,EAAE,iCAAiC,CAAA;IAC1C,wBAAwB,CAAC,EAAE,MAAM,CAAA;IACjC,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,cAAc,CAAC,EAAE,qCAAqC,CAAA;IACtD,KAAK,CAAC,EAAE,qBAAqB,CAAA;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,yBAAyB,CAAC,EAAE,MAAM,CAAA;IAClC,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG,0BAA0B,CAAA;AAEhE,MAAM,MAAM,uBAAuB,GAAG;IACpC,cAAc,CAAC,EAAE,iCAAiC,CAAA;CACnD,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,UAAU,EAAE,uBAAuB,CAAA;IACnC,oEAAoE;IACpE,kBAAkB,CAAC,EAAE,+BAA+B,CAAA;IACpD;iEAC6D;IAC7D,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB;;wBAEoB;IACpB,wBAAwB,CAAC,EAAE,OAAO,CAAA;IAClC;;;;;;;;6BAQyB;IACzB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;8DAE0D;IAC1D,uBAAuB,CAAC,EAAE,OAAO,CAAA;IACjC;;;gBAGY;IACZ,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,uEAAuE;IACvE,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,wEAAwE;IACxE,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAA;IAC7B,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IAC9C,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAA;IAC/B,eAAe,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,KAAK,IAAI,CAAA;IACzC,yBAAyB,CAAC,EAAE,MAAM,IAAI,CAAA;IACtC,oBAAoB,CAAC,EAAE,MAAM,IAAI,CAAA;IACjC;+DAC2D;IAC3D,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAA;IACrC,oEAAoE;IACpE,yBAAyB,CAAC,EAAE,MAAM,IAAI,CAAA;IACtC;sEACkE;IAClE,2BAA2B,CAAC,EAAE,MAAM,IAAI,CAAA;IACxC,YAAY,CAAC,EAAE,MAAM,IAAI,CAAA;IACzB,oBAAoB,CAAC,EAAE,SAAS,CAAA;IAChC,sCAAsC,CAAC,EAAE,OAAO,CAAA;IAChD;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,0EAA0E;IAC1E,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,iEAAiE;IACjE,QAAQ,CAAC,EAAE,SAAS,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAA;IAC7C,2EAA2E;IAC3E,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,0EAA0E;IAC1E,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;IACnB;;iEAE6D;IAC7D,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IACtC,QAAQ,CAAC,EAAE,yBAAyB,CAAA;IACpC,UAAU,CAAC,EAAE,2BAA2B,CAAA;IACxC,MAAM,CAAC,EAAE,uBAAuB,CAAA;IAChC,MAAM,CAAC,EAAE,uBAAuB,CAAA;CACjC,CAAA;AAeD,wBAAgB,iBAAiB,CAAC,EAChC,UAAU,EACV,kBAA8B,EAC9B,YAAY,EAAE,gBAAgB,EAC9B,IAAa,EACb,wBAAgC,EAChC,eAAuB,EACvB,uBAA+B,EAC/B,SAAiB,EACjB,iBAAyB,EACzB,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,yBAAyB,EACzB,oBAAoB,EACpB,YAAY,EACZ,yBAAyB,EACzB,2BAA2B,EAC3B,YAAY,EACZ,oBAAoB,EACpB,sCAA8C,EAC9C,eAAsB,EACtB,cAAsB,EACtB,QAAQ,EACR,gBAAuB,EACvB,eAAsB,EACtB,MAAM,EACN,UAAU,EACV,QAAa,EACb,UAAe,EACf,MAAW,EACX,MAAW,GACZ,EAAE,sBAAsB,GAAG,YAAY,CA6HvC"}