@idmission/websdk-ui 0.2.0 → 0.6.0
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.
- package/README.md +75 -4
- package/dist/DocumentCaptureView.d.ts +7 -5
- package/dist/DocumentCaptureView.d.ts.map +1 -1
- package/dist/DocumentCaptureView.js +30 -26
- package/dist/FaceLivenessView.d.ts +2 -2
- package/dist/FaceLivenessView.d.ts.map +1 -1
- package/dist/FaceLivenessView.js +47 -13
- package/dist/IdCaptureView.d.ts +27 -15
- package/dist/IdCaptureView.d.ts.map +1 -1
- package/dist/IdCaptureView.js +149 -26
- package/dist/SelfieCaptureView.d.ts +18 -1
- package/dist/SelfieCaptureView.d.ts.map +1 -1
- package/dist/SelfieCaptureView.js +13 -4
- package/dist/SignatureCaptureView.d.ts +18 -5
- package/dist/SignatureCaptureView.d.ts.map +1 -1
- package/dist/SignatureCaptureView.js +90 -15
- package/dist/VideoIdCaptureView.d.ts +14 -2
- package/dist/VideoIdCaptureView.d.ts.map +1 -1
- package/dist/VideoIdCaptureView.js +13 -6
- package/dist/bindings/useDocumentCapture.d.ts.map +1 -1
- package/dist/bindings/useDocumentCapture.js +2 -1
- package/dist/bindings/useIdCapture.d.ts.map +1 -1
- package/dist/bindings/useIdCapture.js +2 -1
- package/dist/bindings/useSelfieCapture.d.ts.map +1 -1
- package/dist/bindings/useSelfieCapture.js +2 -1
- package/dist/bindings/useSignatureCapture.d.ts.map +1 -1
- package/dist/bindings/useSignatureCapture.js +2 -1
- package/dist/bindings/useVideoIdCapture.d.ts.map +1 -1
- package/dist/bindings/useVideoIdCapture.js +2 -1
- package/dist/components/common/BrowserEdgeTint.d.ts +63 -0
- package/dist/components/common/BrowserEdgeTint.d.ts.map +1 -0
- package/dist/components/common/BrowserEdgeTint.js +111 -0
- package/dist/components/common/LoaderButton.d.ts +9 -0
- package/dist/components/common/LoaderButton.d.ts.map +1 -1
- package/dist/components/common/LoaderButton.js +44 -321
- package/dist/components/common/ScreenReaderStatus.d.ts +8 -0
- package/dist/components/common/ScreenReaderStatus.d.ts.map +1 -0
- package/dist/components/common/ScreenReaderStatus.js +18 -0
- package/dist/components/common/overlay.d.ts +6 -0
- package/dist/components/common/overlay.d.ts.map +1 -1
- package/dist/components/common/overlay.js +7 -1
- package/dist/components/debug/debug.d.ts +6 -0
- package/dist/components/debug/debug.d.ts.map +1 -1
- package/dist/components/debug/debug.js +5 -1
- package/dist/components/document/DocumentCaptureAutoCaptureDebugLayer.d.ts.map +1 -1
- package/dist/components/document/DocumentCaptureAutoCaptureDebugLayer.js +4 -5
- package/dist/components/document/DocumentCaptureAutoCaptureGuidance.d.ts.map +1 -1
- package/dist/components/document/DocumentCaptureAutoCaptureGuidance.js +40 -13
- package/dist/components/error/CameraAccessDeniedOverlay.d.ts +8 -1
- package/dist/components/error/CameraAccessDeniedOverlay.d.ts.map +1 -1
- package/dist/components/error/useCameraAccessDeniedReport.d.ts +12 -0
- package/dist/components/error/useCameraAccessDeniedReport.d.ts.map +1 -0
- package/dist/components/error/useCameraAccessDeniedReport.js +31 -0
- package/dist/components/face_liveness/FaceLivenessFailure.d.ts +4 -1
- package/dist/components/face_liveness/FaceLivenessFailure.d.ts.map +1 -1
- package/dist/components/face_liveness/FaceLivenessFailure.js +4 -2
- package/dist/components/face_liveness/FaceLivenessSuccess.d.ts +4 -1
- package/dist/components/face_liveness/FaceLivenessSuccess.d.ts.map +1 -1
- package/dist/components/face_liveness/FaceLivenessSuccess.js +6 -2
- package/dist/components/guides/IdCaptureFitGuide.d.ts +2 -0
- package/dist/components/guides/IdCaptureFitGuide.d.ts.map +1 -1
- package/dist/components/guides/IdCaptureFitGuide.js +4 -1
- package/dist/components/guides/IdCaptureGuideOverlay.d.ts +2 -0
- package/dist/components/guides/IdCaptureGuideOverlay.d.ts.map +1 -1
- package/dist/components/guides/IdCaptureGuideOverlay.js +3 -1
- package/dist/components/guides/IdCaptureGuides.d.ts +14 -0
- package/dist/components/guides/IdCaptureGuides.d.ts.map +1 -1
- package/dist/components/guides/IdCaptureGuides.js +22 -7
- package/dist/components/guides/IdCaptureGuidesCommon.d.ts.map +1 -1
- package/dist/components/guides/IdCaptureGuidesCommon.js +12 -7
- package/dist/components/loading/IdCaptureLoadingOverlayDefault.d.ts +9 -0
- package/dist/components/loading/IdCaptureLoadingOverlayDefault.d.ts.map +1 -1
- package/dist/components/loading/IdCaptureLoadingOverlayDefault.js +26 -4
- package/dist/components/loading/RingIntroScreen.d.ts.map +1 -1
- package/dist/components/loading/RingIntroScreen.js +4 -34
- package/dist/components/review/ReviewScreen.d.ts +10 -1
- package/dist/components/review/ReviewScreen.d.ts.map +1 -1
- package/dist/components/review/ReviewScreen.js +8 -8
- package/dist/components/review/SignatureCaptureDiagnostics.d.ts +5 -1
- package/dist/components/review/SignatureCaptureDiagnostics.d.ts.map +1 -1
- package/dist/components/review/SignatureCaptureDiagnostics.js +4 -2
- package/dist/components/selfie/FaceCaptureGuideOverlay.d.ts +9 -2
- package/dist/components/selfie/FaceCaptureGuideOverlay.d.ts.map +1 -1
- package/dist/components/selfie/FaceCaptureGuideOverlay.js +10 -4
- package/dist/components/selfie/SelfieCaptureAnimatedMask.d.ts +8 -1
- package/dist/components/selfie/SelfieCaptureAnimatedMask.d.ts.map +1 -1
- package/dist/components/selfie/SelfieCaptureAnimatedMask.js +55 -21
- package/dist/components/selfie/SelfieCaptureSurface.d.ts +9 -2
- package/dist/components/selfie/SelfieCaptureSurface.d.ts.map +1 -1
- package/dist/components/selfie/SelfieCaptureSurface.js +77 -16
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayDefault.d.ts +9 -0
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayDefault.d.ts.map +1 -1
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayDefault.js +26 -4
- package/dist/flows/AuthStateContext.d.ts.map +1 -1
- package/dist/flows/AuthStateContext.js +2 -1
- package/dist/flows/CaptureProgress.d.ts +14 -0
- package/dist/flows/CaptureProgress.d.ts.map +1 -0
- package/dist/flows/CaptureProgress.js +51 -0
- package/dist/flows/CompositeWizard.d.ts +7 -1
- package/dist/flows/CompositeWizard.d.ts.map +1 -1
- package/dist/flows/CompositeWizard.js +6 -2
- package/dist/flows/CustomerBiometricsEnrollmentFlow.d.ts +3 -3
- package/dist/flows/CustomerBiometricsEnrollmentFlow.d.ts.map +1 -1
- package/dist/flows/CustomerBiometricsEnrollmentFlow.js +26 -4
- package/dist/flows/CustomerIdAndBiometricsEnrollmentFlow.d.ts +3 -3
- package/dist/flows/CustomerIdAndBiometricsEnrollmentFlow.d.ts.map +1 -1
- package/dist/flows/CustomerIdAndBiometricsEnrollmentFlow.js +45 -9
- package/dist/flows/DocumentCaptureFlow.d.ts +4 -3
- package/dist/flows/DocumentCaptureFlow.d.ts.map +1 -1
- package/dist/flows/DocumentCaptureFlow.js +14 -8
- package/dist/flows/FaceValidationFlow.d.ts +2 -2
- package/dist/flows/FaceValidationFlow.d.ts.map +1 -1
- package/dist/flows/FaceValidationFlow.js +7 -2
- package/dist/flows/FlowChassis.d.ts +19 -1
- package/dist/flows/FlowChassis.d.ts.map +1 -1
- package/dist/flows/FlowChassis.js +40 -4
- package/dist/flows/IdAndFaceValidationFlow.d.ts +3 -3
- package/dist/flows/IdAndFaceValidationFlow.d.ts.map +1 -1
- package/dist/flows/IdAndFaceValidationFlow.js +33 -3
- package/dist/flows/IdValidationFlow.d.ts +10 -5
- package/dist/flows/IdValidationFlow.d.ts.map +1 -1
- package/dist/flows/IdValidationFlow.js +32 -5
- package/dist/flows/SignatureKYCFlow.d.ts +43 -7
- package/dist/flows/SignatureKYCFlow.d.ts.map +1 -1
- package/dist/flows/SignatureKYCFlow.js +154 -16
- package/dist/flows/SubmissionProvider.d.ts +12 -3
- package/dist/flows/SubmissionProvider.d.ts.map +1 -1
- package/dist/flows/SubmissionProvider.js +142 -16
- package/dist/flows/VideoIdValidationFlow.d.ts +3 -5
- package/dist/flows/VideoIdValidationFlow.d.ts.map +1 -1
- package/dist/flows/VideoIdValidationFlow.js +38 -4
- package/dist/flows/additionalDocuments.d.ts.map +1 -1
- package/dist/flows/additionalDocuments.js +3 -6
- package/dist/flows/approval.d.ts +1 -14
- package/dist/flows/approval.d.ts.map +1 -1
- package/dist/flows/approval.js +1 -19
- package/dist/flows/artifacts.d.ts +1 -1
- package/dist/flows/artifacts.d.ts.map +1 -1
- package/dist/flows/artifacts.js +29 -9
- package/dist/flows/customerMatch/CustomerMatchCapture.d.ts +3 -2
- package/dist/flows/customerMatch/CustomerMatchCapture.d.ts.map +1 -1
- package/dist/flows/customerMatch/CustomerMatchCapture.js +3 -2
- package/dist/flows/customerMatch/CustomerMatchFlow.d.ts +13 -4
- package/dist/flows/customerMatch/CustomerMatchFlow.d.ts.map +1 -1
- package/dist/flows/customerMatch/CustomerMatchFlow.js +17 -12
- package/dist/flows/flowSettings.d.ts +11 -0
- package/dist/flows/flowSettings.d.ts.map +1 -0
- package/dist/flows/flowSettings.js +20 -0
- package/dist/flows/ringScreens.d.ts +1 -0
- package/dist/flows/ringScreens.d.ts.map +1 -1
- package/dist/flows/ringScreens.js +17 -2
- package/dist/flows/signatureStep.d.ts +6 -1
- package/dist/flows/signatureStep.d.ts.map +1 -1
- package/dist/flows/types.d.ts +120 -10
- package/dist/flows/types.d.ts.map +1 -1
- package/dist/flows/videoIdSteps.d.ts +2 -2
- package/dist/flows/videoIdSteps.d.ts.map +1 -1
- package/dist/guidance/selfieStrings.d.ts.map +1 -1
- package/dist/guidance/selfieStrings.js +8 -4
- package/dist/guidance/strings.d.ts +34 -1
- package/dist/guidance/strings.d.ts.map +1 -1
- package/dist/guidance/strings.js +39 -0
- package/dist/i18n/index.d.ts +5 -1
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js +13 -2
- package/dist/i18n/locales/threeOh.d.ts.map +1 -1
- package/dist/i18n/locales/threeOh.js +56 -2
- package/dist/index.d.ts +9 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/testing/autoCaptureFrames.d.ts.map +1 -1
- package/dist/testing/autoCaptureFrames.js +10 -4
- package/dist/testing/buildSelfieState.d.ts.map +1 -1
- package/dist/testing/buildSelfieState.js +5 -0
- package/dist/testing/classNamesLeaves.js +1 -1
- package/dist/testing/fakeClient.d.ts +41 -2
- package/dist/testing/fakeClient.d.ts.map +1 -1
- package/dist/testing/fakeClient.js +71 -16
- package/dist/testing/fakeSelfieController.d.ts.map +1 -1
- package/dist/testing/fakeSelfieController.js +7 -0
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +1 -1
- package/dist/theme/index.d.ts +10 -0
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/useDocumentUpload.d.ts +63 -0
- package/dist/useDocumentUpload.d.ts.map +1 -0
- package/dist/useDocumentUpload.js +45 -0
- package/dist/useIdmissionClient.d.ts +24 -3
- package/dist/useIdmissionClient.d.ts.map +1 -1
- package/dist/useIdmissionClient.js +46 -0
- package/dist/utils/mountOnly.d.ts +25 -0
- package/dist/utils/mountOnly.d.ts.map +1 -0
- package/dist/utils/mountOnly.js +111 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +10 -9
- package/dist/flows/autoCaptureMountGuard.d.ts +0 -22
- package/dist/flows/autoCaptureMountGuard.d.ts.map +0 -1
- package/dist/flows/autoCaptureMountGuard.js +0 -61
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useCaptureProgressController, useDisplayedGuidance } from '../../flows/CaptureProgress';
|
|
2
3
|
// Internal shared render surface extracted from SelfieCaptureView (task-7)
|
|
3
4
|
// so FaceLivenessView (task-8) can compose the exact same
|
|
4
5
|
// feed/mask/pill/loading-overlay/error wiring without duplicating it. NOT
|
|
@@ -31,7 +32,8 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
31
32
|
// `state.capturedSelfie`/`state.liveness`.
|
|
32
33
|
import { useCallback, useEffect, useRef, useState, } from 'react';
|
|
33
34
|
import { styled } from 'styled-components';
|
|
34
|
-
import { FaceMessageCode } from '@idmission/websdk-core/selfieCapture';
|
|
35
|
+
import { EAR_CALIBRATION_MS, EYES_OPEN_WINDOW_MS, FaceMessageCode, } from '@idmission/websdk-core/selfieCapture';
|
|
36
|
+
import { BLINK_OPEN_FRACTION, computeEARPerEye, } from '@idmission/websdk-core/liveness';
|
|
35
37
|
import { SelfieCameraFeed } from './SelfieCameraFeed';
|
|
36
38
|
import { FaceCaptureGuideOverlay, } from './FaceCaptureGuideOverlay';
|
|
37
39
|
import { GuidanceMessage, GuidanceMessageContainer, } from '../GuidanceMessage';
|
|
@@ -39,9 +41,10 @@ import { ExitCaptureButton } from '../ExitCaptureButton';
|
|
|
39
41
|
import { LoaderButton } from '../common/LoaderButton';
|
|
40
42
|
import { SelfieCaptureLoadingOverlay, } from '../selfie_loading/SelfieCaptureLoadingOverlay';
|
|
41
43
|
import { ErrorScreen, } from '../error/ErrorScreen';
|
|
44
|
+
import { useCameraAccessDeniedReport } from '../error/useCameraAccessDeniedReport';
|
|
42
45
|
import { SelfieCaptureFallback, } from '../fallback/SelfieCaptureFallback';
|
|
43
|
-
import { DebugStatsPane, FaceDetectionKeypointMarker, ObjectDetectionDebugOverlayDiv, SelfieCaptureFaceDebugBox, useDebugScalingDetails, } from '../debug/debug';
|
|
44
|
-
export function SelfieCaptureSurface({ controller, state, loadingOverlayMode, sessionReady, autoContinueAfterLoading, showIntroScreen, transitionFromIdCapture, onExit, onLoadingStarted, onLoadingProgress, onLoadingCompleted, onLoadingFailed, onLoadingOverlayDismissed, onCameraAccessDenied, onModelError, onCameraTamperingDetected, onExitAfterTamperSealPopped, onUserCancel, customOverlayContent, allowManualSelfieCaptureOnLoadingError = false, fallbackCapture = true, silentFallback = false, manualCaptureText, manualCaptureButtonText, videoRef, renderCameraFeed = true, renderFaceGuide = true, showCaptureSurface, maskStatus, showGuidancePill, guidanceText, guidanceVariant, guidanceCode, debugMode = false, showFaceLandmarks = false, debugShowSamplePoints = true, verbiage = {}, classNames = {}, colors = {}, assets = {}, }) {
|
|
46
|
+
import { CameraDebugStatus, DebugStatsPane, FaceDetectionKeypointMarker, ObjectDetectionDebugOverlayDiv, SelfieCaptureFaceDebugBox, useDebugScalingDetails, } from '../debug/debug';
|
|
47
|
+
export function SelfieCaptureSurface({ controller, state, loadingOverlayMode, sessionReady, autoContinueAfterLoading, showIntroScreen, transitionFromIdCapture, onExit, onLoadingStarted, onLoadingProgress, onLoadingCompleted, onLoadingFailed, onLoadingOverlayDismissed, onCameraAccessDenied, onModelError, onCameraTamperingDetected, onExitAfterTamperSealPopped, onUserCancel, customOverlayContent, allowManualSelfieCaptureOnLoadingError = false, fallbackCapture = true, silentFallback = false, manualCaptureText, manualCaptureButtonText, recoveryCaptureText, recoveryCaptureButtonText, videoRef, renderCameraFeed = true, renderFaceGuide = true, faceGuideStyle, showCaptureSurface, maskStatus, showGuidancePill, guidanceText, guidanceVariant, guidanceCode, debugMode = false, showFaceLandmarks = false, debugShowSamplePoints = true, verbiage = {}, classNames = {}, colors = {}, assets = {}, }) {
|
|
45
48
|
// Same ref-callback + effect-keyed-only-on-[controller] pattern as
|
|
46
49
|
// IdCaptureView/SelfieCaptureView (see SelfieCaptureView.tsx's header
|
|
47
50
|
// comment for the full rationale).
|
|
@@ -123,6 +126,7 @@ export function SelfieCaptureSurface({ controller, state, loadingOverlayMode, se
|
|
|
123
126
|
videoWidth: videoDims.videoWidth,
|
|
124
127
|
videoHeight: videoDims.videoHeight,
|
|
125
128
|
});
|
|
129
|
+
useCaptureProgressController(controller);
|
|
126
130
|
const manualFallbackAvailable = allowManualSelfieCaptureOnLoadingError &&
|
|
127
131
|
state.error?.code === 'MODEL_LOAD_FAILED';
|
|
128
132
|
// The two halves of sdk2's fork are mutually exclusive: with the flag set
|
|
@@ -133,6 +137,8 @@ export function SelfieCaptureSurface({ controller, state, loadingOverlayMode, se
|
|
|
133
137
|
const manualCaptureEnabled = allowManualSelfieCaptureOnLoadingError &&
|
|
134
138
|
state.phase === 'capturing' &&
|
|
135
139
|
state.models.loadState === 'error';
|
|
140
|
+
const showCaptureRecovery = showCaptureSurface && state.phase === 'capturing' &&
|
|
141
|
+
state.captureRecovery?.manualCaptureAvailable && !manualCaptureEnabled;
|
|
136
142
|
const showLoadingOverlay = state.phase === 'initializing' ||
|
|
137
143
|
state.phase === 'loading' ||
|
|
138
144
|
manualFallbackAvailable;
|
|
@@ -150,8 +156,15 @@ export function SelfieCaptureSurface({ controller, state, loadingOverlayMode, se
|
|
|
150
156
|
},
|
|
151
157
|
}
|
|
152
158
|
: state;
|
|
159
|
+
const displayedCode = manualCaptureEnabled ? FaceMessageCode.MANUAL_CAPTURE : guidanceCode;
|
|
160
|
+
const displayedText = manualCaptureEnabled ? manualCaptureText : guidanceText;
|
|
161
|
+
const isFaceMessageCode = (code) => Object.values(FaceMessageCode).some(value => value === code);
|
|
162
|
+
useDisplayedGuidance((showGuidancePill || manualCaptureEnabled) && displayedText && displayedCode && displayedCode !== 'NONE'
|
|
163
|
+
? isFaceMessageCode(displayedCode)
|
|
164
|
+
? { kind: 'displayed', message: { family: 'face', code: displayedCode } }
|
|
165
|
+
: { kind: 'displayed', message: { family: 'selfie', code: displayedCode } }
|
|
166
|
+
: { kind: 'no-prompt' });
|
|
153
167
|
const reportedModelErrorRef = useRef(null);
|
|
154
|
-
const cameraDeniedReportedRef = useRef(false);
|
|
155
168
|
const tamperReportedRef = useRef(false);
|
|
156
169
|
useEffect(() => {
|
|
157
170
|
const modelError = state.models.error;
|
|
@@ -162,13 +175,6 @@ export function SelfieCaptureSurface({ controller, state, loadingOverlayMode, se
|
|
|
162
175
|
}
|
|
163
176
|
if (!modelError)
|
|
164
177
|
reportedModelErrorRef.current = null;
|
|
165
|
-
const cameraDenied = state.error?.code === 'CAMERA_PERMISSION_DENIED';
|
|
166
|
-
if (cameraDenied && !cameraDeniedReportedRef.current) {
|
|
167
|
-
cameraDeniedReportedRef.current = true;
|
|
168
|
-
onCameraAccessDenied?.();
|
|
169
|
-
}
|
|
170
|
-
if (!cameraDenied)
|
|
171
|
-
cameraDeniedReportedRef.current = false;
|
|
172
178
|
// Same one-shot latch as IdCaptureView's: the host counts detections, not
|
|
173
179
|
// renders, and a cleared-then-re-detected tamper is a second detection.
|
|
174
180
|
const tampered = state.error?.code === 'CAMERA_TAMPERING_SUSPECTED';
|
|
@@ -179,17 +185,24 @@ export function SelfieCaptureSurface({ controller, state, loadingOverlayMode, se
|
|
|
179
185
|
if (!tampered)
|
|
180
186
|
tamperReportedRef.current = false;
|
|
181
187
|
}, [
|
|
182
|
-
onCameraAccessDenied,
|
|
183
188
|
onCameraTamperingDetected,
|
|
184
189
|
onLoadingFailed,
|
|
185
190
|
onModelError,
|
|
186
191
|
state.error?.code,
|
|
187
192
|
state.models.error,
|
|
188
193
|
]);
|
|
194
|
+
useCameraAccessDeniedReport(controller, state.error?.code, onCameraAccessDenied);
|
|
189
195
|
const handleLoadingContinue = useCallback(() => {
|
|
190
196
|
void controller.actions.start();
|
|
191
197
|
onLoadingOverlayDismissed?.();
|
|
192
198
|
}, [controller, onLoadingOverlayDismissed]);
|
|
199
|
+
// Back to the instructions BEFORE telling the host, as sdk2 did
|
|
200
|
+
// (FaceLivenessWizard.tsx:394): handing `onExit` to the button raw left the
|
|
201
|
+
// capture running behind a host that expected the loading screen.
|
|
202
|
+
const handleExit = useCallback(() => {
|
|
203
|
+
controller.actions.exitCapture();
|
|
204
|
+
onExit?.();
|
|
205
|
+
}, [controller, onExit]);
|
|
193
206
|
// plan-3 ruling: camera-acquisition errors recover via requestCamera()
|
|
194
207
|
// (retry() explicitly excludes them, controller.ts), everything else via
|
|
195
208
|
// retry(). Applies unconditionally across every loadingOverlayMode.
|
|
@@ -202,9 +215,9 @@ export function SelfieCaptureSurface({ controller, state, loadingOverlayMode, se
|
|
|
202
215
|
controller.actions.retry();
|
|
203
216
|
}
|
|
204
217
|
}, [controller, state.error]);
|
|
205
|
-
return (_jsxs(_Fragment, { children: [renderCameraFeed ? (_jsx(SelfieCameraFeed, { videoRef: setVideoRef, isRearFacing: state.camera.isRearFacing, className: classNames.cameraFeed })) : null, renderFaceGuide && showCaptureSurface && (_jsx(FaceCaptureGuideOverlay, { status: maskStatus, classNames: classNames.guides })), (showGuidancePill || manualCaptureEnabled) && (_jsx(GuidanceMessageContainer, { "$top": "12px", className: classNames.guidanceMessageContainer, children: _jsx(GuidanceMessage, { "$variant": guidanceVariant, className: classNames.guidanceMessage, "data-guidance-code": manualCaptureEnabled
|
|
218
|
+
return (_jsxs(_Fragment, { children: [renderCameraFeed ? (_jsx(SelfieCameraFeed, { videoRef: setVideoRef, isRearFacing: state.camera.isRearFacing, className: classNames.cameraFeed })) : null, renderFaceGuide && showCaptureSurface && (_jsx(FaceCaptureGuideOverlay, { status: maskStatus, guideStyle: faceGuideStyle, classNames: classNames.guides })), (showGuidancePill || manualCaptureEnabled) && (_jsx(GuidanceMessageContainer, { "$top": "12px", className: classNames.guidanceMessageContainer, children: _jsx(GuidanceMessage, { "$variant": guidanceVariant, className: classNames.guidanceMessage, "data-guidance-code": manualCaptureEnabled
|
|
206
219
|
? FaceMessageCode.MANUAL_CAPTURE
|
|
207
|
-
: guidanceCode, children: manualCaptureEnabled ? manualCaptureText : guidanceText }) })), manualCaptureEnabled && (_jsx(ManualCaptureButtonContainer, { className: classNames.manualCaptureBtnContainer, children: _jsx(LoaderButton, { variant: "positive", finished: true, className: classNames.manualCaptureBtn, onClick: () => controller.actions.captureNow(), children: manualCaptureButtonText }) })), (debugMode || showFaceLandmarks) &&
|
|
220
|
+
: guidanceCode, children: manualCaptureEnabled ? manualCaptureText : guidanceText }) })), manualCaptureEnabled && (_jsx(ManualCaptureButtonContainer, { className: classNames.manualCaptureBtnContainer, children: _jsx(LoaderButton, { variant: "positive", finished: true, className: classNames.manualCaptureBtn, onClick: () => controller.actions.captureNow(), children: manualCaptureButtonText }) })), showCaptureRecovery && (_jsxs(CaptureRecoveryActions, { className: classNames.manualCaptureBtnContainer, children: [_jsx("p", { children: recoveryCaptureText }), _jsx(LoaderButton, { variant: "positive", finished: true, disabled: !state.captureRecovery?.manualCaptureReady, className: classNames.manualCaptureBtn, onClick: () => controller.actions.captureNow(), children: recoveryCaptureButtonText })] })), (debugMode || showFaceLandmarks) &&
|
|
208
221
|
showCaptureSurface &&
|
|
209
222
|
state.prediction?.face && (_jsxs(ObjectDetectionDebugOverlayDiv, { children: [_jsx(SelfieCaptureFaceDebugBox, { face: state.prediction.face, scaling: debugScaling, color: state.prediction.faceReady ? 'green' : 'red', showBoundingBox: debugMode, showLandmarks: debugMode || showFaceLandmarks }), debugMode &&
|
|
210
223
|
debugShowSamplePoints &&
|
|
@@ -219,14 +232,19 @@ export function SelfieCaptureSurface({ controller, state, loadingOverlayMode, se
|
|
|
219
232
|
? (pt.y / videoHeight) * pageHeight
|
|
220
233
|
: (pt.y / videoHeight) * scaledHeight - yOffset;
|
|
221
234
|
return (_jsx(FaceDetectionKeypointMarker, { style: { left: left - 2, top: top - 2 } }, i));
|
|
222
|
-
})] })), debugMode && showCaptureSurface && (_jsxs(DebugStatsPane, { children: [state.camera.ready
|
|
235
|
+
})] })), debugMode && showCaptureSurface && (_jsxs(DebugStatsPane, { children: [_jsx(CameraDebugStatus, { ready: state.camera.ready, width: videoDims.videoWidth, height: videoDims.videoHeight }), _jsx("br", {}), !state.prediction?.faceNotDetected ? '✅' : '❌', " Face Detected", _jsx("br", {}), !state.prediction?.faceNotCentered ? '✅' : '❌', " Face Centered", _jsx("br", {}), !state.prediction?.faceTooClose && !state.prediction?.faceTooFar
|
|
223
236
|
? '✅'
|
|
224
237
|
: '❌', ' ', "Face", ' ', state.prediction?.faceTooClose
|
|
225
238
|
? 'Too Close'
|
|
226
239
|
: state.prediction?.faceTooFar
|
|
227
240
|
? 'Too Far'
|
|
228
241
|
: 'Distance Correct', _jsx("br", {}), !state.prediction?.faceLookingAway ? '✅' : '❌', " Face Looking Forward", _jsx("br", {}), !state.prediction?.faceIsStable ? '✅' : '❌', " Face Is Stable", _jsx("br", {}), !state.prediction?.noseIsStable ? '✅' : '❌', " Nose Is Stable", _jsx("br", {}), state.prediction?.faceVisibilityTooLow ? '❌' : '✅', " Visibility", state.thresholds.minCaptureBrightnessThreshold !== undefined && (_jsxs(_Fragment, { children: [_jsx("br", {}), "\u00A0\u00A0Brightness:", ' ', state.prediction?.brightness?.toFixed(1) ?? '—', " (min:", ' ', state.thresholds.minCaptureBrightnessThreshold, ")"] })), state.thresholds.minCaptureRangeThreshold !== undefined && (_jsxs(_Fragment, { children: [_jsx("br", {}), "\u00A0\u00A0Range: ", state.prediction?.range?.toFixed(1) ??
|
|
229
|
-
'—', ' ', "(min: ", state.thresholds.minCaptureRangeThreshold, ")"] })), state.thresholds.minCaptureVarianceThreshold !== undefined && (_jsxs(_Fragment, { children: [_jsx("br", {}), "\u00A0\u00A0Variance:", ' ', state.prediction?.variance?.toFixed(1) ?? '—', " (min:", ' ', state.thresholds.minCaptureVarianceThreshold, ")"] }))
|
|
242
|
+
'—', ' ', "(min: ", state.thresholds.minCaptureRangeThreshold, ")"] })), state.thresholds.minCaptureVarianceThreshold !== undefined && (_jsxs(_Fragment, { children: [_jsx("br", {}), "\u00A0\u00A0Variance:", ' ', state.prediction?.variance?.toFixed(1) ?? '—', " (min:", ' ', state.thresholds.minCaptureVarianceThreshold, ")"] })), _jsx("br", {}), _jsx(EyesOpenDebugLines, { state: state }), state.handOverFace.status !== 'off' && (_jsxs(_Fragment, { children: [_jsx("br", {}), state.handOverFace.lastCheck
|
|
243
|
+
? state.handOverFace.lastCheck.handOverFace
|
|
244
|
+
? '❌'
|
|
245
|
+
: '✅'
|
|
246
|
+
: '➖', ' ', "Hand Off Face (", state.handOverFace.status, state.handOverFace.lastCheck &&
|
|
247
|
+
`, last check ${state.handOverFace.lastCheck.coverage.toFixed(2)} covered in ${Math.round(state.handOverFace.lastCheck.inferenceMs)} ms`, ")"] }))] })), onExit != null && (_jsx(ExitCaptureButton, { onClick: handleExit, className: classNames.exitBtn })), showLoadingOverlay && (_jsx(SelfieCaptureLoadingOverlay, { state: loadingOverlayState, mode: loadingOverlayMode, sessionReady: sessionReady, autoContinueAfterLoading: autoContinueAfterLoading, showIntroScreen: showIntroScreen, transitionFromIdCapture: transitionFromIdCapture, assets: assets.loadingOverlay, classNames: classNames.loadingOverlay, colors: colors.loadingOverlay, verbiage: verbiage.loadingOverlay, customOverlayContent: customOverlayContent, onContinue: handleLoadingContinue, onLoadingStarted: onLoadingStarted, onLoadingProgress: onLoadingProgress, onLoadingCompleted: onLoadingCompleted, onLoadingFailed: onLoadingFailed, onUserCancel: onUserCancel, onRequestCamera: () => controller.actions.requestCamera() })), showStockCameraFallback && (_jsx(SelfieCaptureFallback, { silentFallback: silentFallback, onFinished: (imageDataUrl) => controller.actions.captureManually(imageDataUrl), classNames: classNames.fallback, colors: colors.fallback, verbiage: verbiage.fallback })), state.phase === 'error' &&
|
|
230
248
|
state.error !== null &&
|
|
231
249
|
!manualFallbackAvailable &&
|
|
232
250
|
!showStockCameraFallback && (_jsx(ErrorScreen, { error: state.error, onRetry: handleRetry, onExit: state.error.code === 'CAMERA_TAMPERING_SUSPECTED'
|
|
@@ -242,6 +260,33 @@ export function SelfieCaptureSurface({ controller, state, loadingOverlayMode, se
|
|
|
242
260
|
verbiage: verbiage.loadingOverlay?.cameraAccessDenied,
|
|
243
261
|
} }))] }));
|
|
244
262
|
}
|
|
263
|
+
/**
|
|
264
|
+
* Debug readout for the eyes-open gate: each eye's EAR on this frame beside
|
|
265
|
+
* its calibrated open-eye baseline and the open threshold derived from it.
|
|
266
|
+
* Eyes are labelled by mesh landmark side, which is not necessarily the side
|
|
267
|
+
* of the screen they appear on.
|
|
268
|
+
*/
|
|
269
|
+
function EyesOpenDebugLines({ state, }) {
|
|
270
|
+
const ear = computeEARPerEye(state.prediction?.face?.meshLandmarks);
|
|
271
|
+
if (!ear)
|
|
272
|
+
return _jsx(_Fragment, { children: "\u2796 Eyes Open (no face mesh: gate off)" });
|
|
273
|
+
const { earBaseline, earCalibrationMs, eyeReadings } = state.tracking;
|
|
274
|
+
const calibration = (ms) => ms >= EAR_CALIBRATION_MS
|
|
275
|
+
? 'calibrated'
|
|
276
|
+
: `calibrating ${Math.round(ms)}/${EAR_CALIBRATION_MS} ms`;
|
|
277
|
+
const eye = (label, value, baseline, calibratedMs) => (_jsxs(_Fragment, { children: [_jsx("br", {}), "\u00A0\u00A0", label, ": ", value?.toFixed(3) ?? '—', ' ', baseline === null
|
|
278
|
+
? '(no baseline yet)'
|
|
279
|
+
: `(baseline ${baseline.toFixed(3)}, open > ${(baseline * BLINK_OPEN_FRACTION).toFixed(3)}, ${calibration(calibratedMs)})`] }));
|
|
280
|
+
const openReadings = eyeReadings.filter((r) => r.open).length;
|
|
281
|
+
const verdict = state.prediction?.eyesClosed
|
|
282
|
+
? '❌'
|
|
283
|
+
: state.prediction?.eyesCalibrating
|
|
284
|
+
? '⏳'
|
|
285
|
+
: '✅';
|
|
286
|
+
return (_jsxs(_Fragment, { children: [verdict, " Eyes Open", state.thresholds.requireEyesOpen
|
|
287
|
+
? ` (${openReadings}/${eyeReadings.length} frames open in the last ${EYES_OPEN_WINDOW_MS} ms)`
|
|
288
|
+
: ' (gate off)', eye('Mesh-left eye', ear.left, earBaseline.left, earCalibrationMs.left), eye('Mesh-right eye', ear.right, earBaseline.right, earCalibrationMs.right)] }));
|
|
289
|
+
}
|
|
245
290
|
const ManualCaptureButtonContainer = styled.div `
|
|
246
291
|
position: absolute;
|
|
247
292
|
z-index: 4;
|
|
@@ -249,3 +294,19 @@ const ManualCaptureButtonContainer = styled.div `
|
|
|
249
294
|
bottom: 24px;
|
|
250
295
|
transform: translateX(-50%);
|
|
251
296
|
`;
|
|
297
|
+
// A footer below the camera keeps the lighting guidance visible above it.
|
|
298
|
+
const CaptureRecoveryActions = styled.div `
|
|
299
|
+
position: absolute;
|
|
300
|
+
z-index: 10001;
|
|
301
|
+
inset: auto 0 0;
|
|
302
|
+
padding: 16px 24px max(16px, env(safe-area-inset-bottom));
|
|
303
|
+
background: white;
|
|
304
|
+
color: #333;
|
|
305
|
+
text-align: center;
|
|
306
|
+
display: grid;
|
|
307
|
+
justify-items: center;
|
|
308
|
+
gap: 12px;
|
|
309
|
+
|
|
310
|
+
p { margin: 0; font-size: 14px; line-height: 1.4; }
|
|
311
|
+
button { width: 100%; max-width: 320px; }
|
|
312
|
+
`;
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
import { type DefaultTheme } from 'styled-components';
|
|
1
2
|
import type { SelfieCaptureLoadingOverlayProps } from './SelfieCaptureLoadingOverlay';
|
|
2
3
|
export declare const SelfieCaptureLoadingOverlayDefault: ({ state, sessionReady, now, onContinue, onLoadingStarted, onLoadingProgress, onLoadingCompleted, onLoadingFailed, onUserCancel, customOverlayContent, autoContinueAfterLoading, assets, classNames, colors, verbiage: rawVerbiage, }: SelfieCaptureLoadingOverlayProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
/** The overlay's background when the theme does not set one. */
|
|
5
|
+
export declare const SELFIE_LOADING_OVERLAY_BACKGROUND_DEFAULT = "#ecedf3";
|
|
6
|
+
/**
|
|
7
|
+
* The colour this overlay paints along the viewport's bottom edge, for
|
|
8
|
+
* `BrowserEdgeTint`. That edge is the progress row, not the background, and the
|
|
9
|
+
* bar is full once the models are ready.
|
|
10
|
+
*/
|
|
11
|
+
export declare function selfieLoadingOverlayBottomEdgeColor(theme: DefaultTheme, modelsReady: boolean): string;
|
|
3
12
|
//# sourceMappingURL=SelfieCaptureLoadingOverlayDefault.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelfieCaptureLoadingOverlayDefault.d.ts","sourceRoot":"","sources":["../../../src/components/selfie_loading/SelfieCaptureLoadingOverlayDefault.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SelfieCaptureLoadingOverlayDefault.d.ts","sourceRoot":"","sources":["../../../src/components/selfie_loading/SelfieCaptureLoadingOverlayDefault.tsx"],"names":[],"mappings":"AA0CA,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAwBvE,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,+BAA+B,CAAA;AAuBrF,eAAO,MAAM,kCAAkC,GAAI,sOAgBhD,gCAAgC,4CA6LlC,CAAA;AAqED,gEAAgE;AAChE,eAAO,MAAM,yCAAyC,YAAY,CAAA;AAKlE;;;;GAIG;AACH,wBAAgB,mCAAmC,CACjD,KAAK,EAAE,YAAY,EACnB,WAAW,EAAE,OAAO,GACnB,MAAM,CAWR"}
|
|
@@ -45,6 +45,7 @@ import { styled, useTheme } from 'styled-components';
|
|
|
45
45
|
import { LoadingOverlayButtonsRow, LoadingOverlayContinueButtonContainer, LoadingOverlayCustomLoadingGraphic, LoadingOverlayGuidanceMessage, LoadingOverlayHeader, LoadingOverlayImageContainer, LoadingOverlayInner, LoadingOverlayLoadingList, LoadingOverlayLoadingListContainer, LoadingOverlayLoadingListItem, LoadingOverlayProgressBar, LoadingOverlayProgressBarBackground, LoadingOverlayProgressContainer, LoadingOverlayProgressIndicator, OverlayContainer, } from '../common/overlay';
|
|
46
46
|
import { DEFAULT_CDN_URL } from '../../utils/cdn';
|
|
47
47
|
import { LoaderButton } from '../common/LoaderButton';
|
|
48
|
+
import { progressRowEdgeColor } from '../common/BrowserEdgeTint';
|
|
48
49
|
import { downloadingLabel } from '../common/downloadingLabel';
|
|
49
50
|
import { useTranslations } from '../../i18n';
|
|
50
51
|
import { ExitCaptureButton } from '../ExitCaptureButton';
|
|
@@ -132,7 +133,8 @@ export const SelfieCaptureLoadingOverlayDefault = ({ state, sessionReady = true,
|
|
|
132
133
|
?.displayDisabledContinueBtn) && (_jsx(ContinueButton, { autoFocus: true, finished: ready, disabled: !ready, className: classNames.continueBtn, variant: "positive", colors: colors.continueBtn, onClick: handleContinue, children: ready ? verbiage.continueText : verbiage.pleaseWaitText })) })] })] }) }));
|
|
133
134
|
};
|
|
134
135
|
const OverlayInner = styled(LoadingOverlayInner) `
|
|
135
|
-
background: ${(props) => props.theme?.selfieCapture?.loadingOverlay?.backgroundColor ??
|
|
136
|
+
background: ${(props) => props.theme?.selfieCapture?.loadingOverlay?.backgroundColor ??
|
|
137
|
+
SELFIE_LOADING_OVERLAY_BACKGROUND_DEFAULT};
|
|
136
138
|
color: ${(props) => props.theme?.selfieCapture?.loadingOverlay?.textColor ?? 'black'};
|
|
137
139
|
`;
|
|
138
140
|
const ButtonsRow = styled(LoadingOverlayButtonsRow) `
|
|
@@ -144,13 +146,13 @@ const ButtonsRow = styled(LoadingOverlayButtonsRow) `
|
|
|
144
146
|
`;
|
|
145
147
|
const ProgressBarBackground = styled(LoadingOverlayProgressBarBackground) `
|
|
146
148
|
background: ${(props) => props.theme?.selfieCapture?.loadingOverlay?.progressBarBackgroundColor ??
|
|
147
|
-
|
|
149
|
+
PROGRESS_TRACK_DEFAULT};
|
|
148
150
|
opacity: ${(props) => props.theme?.selfieCapture?.loadingOverlay?.progressBarBackgroundOpacity ??
|
|
149
|
-
|
|
151
|
+
PROGRESS_TRACK_OPACITY_DEFAULT};
|
|
150
152
|
`;
|
|
151
153
|
const ProgressIndicator = styled(LoadingOverlayProgressIndicator) `
|
|
152
154
|
background: ${(props) => props.theme?.selfieCapture?.loadingOverlay?.progressBarIndicatorColor ??
|
|
153
|
-
|
|
155
|
+
PROGRESS_INDICATOR_DEFAULT};
|
|
154
156
|
`;
|
|
155
157
|
const ContinueButton = styled(LoaderButton) `
|
|
156
158
|
margin: auto;
|
|
@@ -179,3 +181,23 @@ const ContinueButton = styled(LoaderButton) `
|
|
|
179
181
|
box-shadow: none;
|
|
180
182
|
}
|
|
181
183
|
`;
|
|
184
|
+
/** The overlay's background when the theme does not set one. */
|
|
185
|
+
export const SELFIE_LOADING_OVERLAY_BACKGROUND_DEFAULT = '#ecedf3';
|
|
186
|
+
const PROGRESS_TRACK_DEFAULT = 'var(--idm-color-positive-600)';
|
|
187
|
+
const PROGRESS_TRACK_OPACITY_DEFAULT = 0.75;
|
|
188
|
+
const PROGRESS_INDICATOR_DEFAULT = 'var(--idm-color-positive-600)';
|
|
189
|
+
/**
|
|
190
|
+
* The colour this overlay paints along the viewport's bottom edge, for
|
|
191
|
+
* `BrowserEdgeTint`. That edge is the progress row, not the background, and the
|
|
192
|
+
* bar is full once the models are ready.
|
|
193
|
+
*/
|
|
194
|
+
export function selfieLoadingOverlayBottomEdgeColor(theme, modelsReady) {
|
|
195
|
+
const overlay = theme.selfieCapture?.loadingOverlay;
|
|
196
|
+
return progressRowEdgeColor({
|
|
197
|
+
full: modelsReady,
|
|
198
|
+
indicator: overlay?.progressBarIndicatorColor ?? PROGRESS_INDICATOR_DEFAULT,
|
|
199
|
+
track: overlay?.progressBarBackgroundColor ?? PROGRESS_TRACK_DEFAULT,
|
|
200
|
+
trackOpacity: overlay?.progressBarBackgroundOpacity ?? PROGRESS_TRACK_OPACITY_DEFAULT,
|
|
201
|
+
background: overlay?.backgroundColor ?? SELFIE_LOADING_OVERLAY_BACKGROUND_DEFAULT,
|
|
202
|
+
});
|
|
203
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthStateContext.d.ts","sourceRoot":"","sources":["../../src/flows/AuthStateContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"AuthStateContext.d.ts","sourceRoot":"","sources":["../../src/flows/AuthStateContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,SAAS,EAKf,MAAM,OAAO,CAAA;AAEd,OAAO,KAAK,EACV,WAAW,EACX,eAAe,EACf,iBAAiB,EAClB,MAAM,+BAA+B,CAAA;AAEtC,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,eAAe,CAAA;IACvB,KAAK,EAAE,WAAW,CAAA;IAClB,YAAY,EAAE,OAAO,CAAA;IACrB,KAAK,EAAE,MAAM,OAAO,CAAC,iBAAiB,CAAC,CAAA;CACxC,CAAA;AAID,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,eAAe,CAAA;IACvB,QAAQ,EAAE,SAAS,CAAA;IACnB,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB,CAAA;AAED,wBAAgB,YAAY,CAAC,EAC3B,MAAM,EACN,QAAQ,EACR,YAAmB,GACpB,EAAE,iBAAiB,2CA6BnB;AAED,wBAAgB,YAAY,IAAI,qBAAqB,CAMpD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAGzC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { createContext, useContext, useEffect, useMemo, useRef,
|
|
2
|
+
import { createContext, useContext, useEffect, useMemo, useRef, } from 'react';
|
|
3
|
+
import { useSyncExternalStore } from 'use-sync-external-store/shim';
|
|
3
4
|
const AuthStateContext = createContext(null);
|
|
4
5
|
export function AuthProvider({ client, children, autoValidate = true, }) {
|
|
5
6
|
const validatedClientRef = useRef(null);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { CaptureProgressTask } from "@idmission/websdk-core/captureProgress";
|
|
3
|
+
import { type CaptureObserver, type GuidanceExposure } from "@idmission/websdk-core/captureProgress/internal";
|
|
4
|
+
export declare function CaptureProgressProvider({ task, children, }: {
|
|
5
|
+
task?: CaptureProgressTask;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function useCaptureObserver(): CaptureObserver;
|
|
9
|
+
export declare function CaptureProgressCompletion({ completed, }: {
|
|
10
|
+
completed: boolean;
|
|
11
|
+
}): null;
|
|
12
|
+
export declare function useCaptureProgressController(controller: object): void;
|
|
13
|
+
export declare function useDisplayedGuidance(exposure: GuidanceExposure): void;
|
|
14
|
+
//# sourceMappingURL=CaptureProgress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CaptureProgress.d.ts","sourceRoot":"","sources":["../../src/flows/CaptureProgress.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAClF,OAAO,EAIL,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACtB,MAAM,iDAAiD,CAAC;AAGzD,wBAAgB,uBAAuB,CAAC,EACtC,IAAI,EACJ,QAAQ,GACT,EAAE;IACD,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAC3B,QAAQ,EAAE,SAAS,CAAC;CACrB,2CAsBA;AACD,wBAAgB,kBAAkB,oBAEjC;AACD,wBAAgB,yBAAyB,CAAC,EACxC,SAAS,GACV,EAAE;IACD,SAAS,EAAE,OAAO,CAAC;CACpB,QAMA;AACD,wBAAgB,4BAA4B,CAAC,UAAU,EAAE,MAAM,QAM9D;AACD,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,gBAAgB,QAc9D"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext, useEffect, useLayoutEffect, useMemo, useRef, } from "react";
|
|
3
|
+
import { bindCaptureController, inertObserver, openCaptureAttempt, } from "@idmission/websdk-core/captureProgress/internal";
|
|
4
|
+
const CaptureProgressContext = createContext(inertObserver);
|
|
5
|
+
export function CaptureProgressProvider({ task, children, }) {
|
|
6
|
+
const observer = useMemo(() => openCaptureAttempt(task), [task]);
|
|
7
|
+
const leases = useRef(new Map());
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
const activeLeases = leases.current;
|
|
10
|
+
const generation = (activeLeases.get(observer) ?? 0) + 1;
|
|
11
|
+
activeLeases.set(observer, generation);
|
|
12
|
+
return () => {
|
|
13
|
+
void Promise.resolve()
|
|
14
|
+
.then(() => {
|
|
15
|
+
if (activeLeases.get(observer) !== generation)
|
|
16
|
+
return;
|
|
17
|
+
observer.dispose();
|
|
18
|
+
activeLeases.delete(observer);
|
|
19
|
+
})
|
|
20
|
+
.catch(() => { });
|
|
21
|
+
};
|
|
22
|
+
}, [observer]);
|
|
23
|
+
return (_jsx(CaptureProgressContext.Provider, { value: observer, children: children }));
|
|
24
|
+
}
|
|
25
|
+
export function useCaptureObserver() {
|
|
26
|
+
return useContext(CaptureProgressContext);
|
|
27
|
+
}
|
|
28
|
+
export function CaptureProgressCompletion({ completed, }) {
|
|
29
|
+
const observer = useCaptureObserver();
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
if (completed)
|
|
32
|
+
observer.observe({ kind: "flow-completed" });
|
|
33
|
+
}, [completed, observer]);
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
export function useCaptureProgressController(controller) {
|
|
37
|
+
const observer = useCaptureObserver();
|
|
38
|
+
useLayoutEffect(() => bindCaptureController(controller, observer), [controller, observer]);
|
|
39
|
+
}
|
|
40
|
+
export function useDisplayedGuidance(exposure) {
|
|
41
|
+
const observer = useCaptureObserver();
|
|
42
|
+
useLayoutEffect(() => {
|
|
43
|
+
observer.observe({ kind: "displayed-guidance", exposure });
|
|
44
|
+
});
|
|
45
|
+
useLayoutEffect(() => () => {
|
|
46
|
+
observer.observe({
|
|
47
|
+
kind: "displayed-guidance",
|
|
48
|
+
exposure: { kind: "unobserved" },
|
|
49
|
+
});
|
|
50
|
+
}, [observer]);
|
|
51
|
+
}
|
|
@@ -37,6 +37,12 @@ export type CompositeWizardProps = {
|
|
|
37
37
|
sessionReady?: boolean;
|
|
38
38
|
initialArtifacts?: SubmissionArtifacts;
|
|
39
39
|
captureOnly?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Show `SubmissionSuccess` after a successful submission (non-ring mode).
|
|
42
|
+
* Default `false`.
|
|
43
|
+
*/
|
|
44
|
+
showResultScreen?: boolean;
|
|
45
|
+
/** @deprecated Renamed `showResultScreen`, which wins when both are set. */
|
|
40
46
|
showSuccessScreen?: boolean;
|
|
41
47
|
showDiagnostics?: boolean;
|
|
42
48
|
successClassNames?: SubmissionSuccessClassNames;
|
|
@@ -69,7 +75,7 @@ export type CompositeWizardProps = {
|
|
|
69
75
|
finishingScreen?: CompositeWizardFinishingScreenProps;
|
|
70
76
|
successScreen?: CompositeWizardSuccessScreenProps;
|
|
71
77
|
};
|
|
72
|
-
export declare function CompositeWizard({ steps, sessionReady: sessionReadyProp, initialArtifacts, captureOnly, showSuccessScreen, showDiagnostics, successClassNames, onArtifactsCollected, onSubmitted, onStepStarted, onStepCompleted, renderSubmitting, finishingScreen, successScreen, }: CompositeWizardProps): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
78
|
+
export declare function CompositeWizard({ steps, sessionReady: sessionReadyProp, initialArtifacts, captureOnly, showResultScreen, showSuccessScreen, showDiagnostics, successClassNames, onArtifactsCollected, onSubmitted, onStepStarted, onStepCompleted, renderSubmitting, finishingScreen, successScreen, }: CompositeWizardProps): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
73
79
|
/**
|
|
74
80
|
* The ring success screen's "what we captured" chips. Ports sdk2
|
|
75
81
|
* CompositeWizard.tsx:214-240, which derived the same list from its submission
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompositeWizard.d.ts","sourceRoot":"","sources":["../../src/flows/CompositeWiz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as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCaptureObserver } from './CaptureProgress';
|
|
2
3
|
import { useCallback, useEffect, useMemo, useRef, useState, } from 'react';
|
|
3
4
|
import { determineSubmissionEndpoint, SubmissionAction, SubmissionStatus, } from '@idmission/websdk-core/client';
|
|
4
5
|
import { mergeSubmissionArtifacts } from './artifacts';
|
|
@@ -12,7 +13,7 @@ import { useSessionReady } from './AuthStateContext';
|
|
|
12
13
|
import { RingFinishingScreen, } from '../components/ring/RingFinishingScreen';
|
|
13
14
|
import { RingSuccessScreen, } from '../components/ring/RingSuccessScreen';
|
|
14
15
|
import { markFlowStart, readFlowElapsedMs, resetFlowClock } from '../utils/flowClock';
|
|
15
|
-
export function CompositeWizard({ steps, sessionReady: sessionReadyProp, initialArtifacts = {}, captureOnly = false, showSuccessScreen
|
|
16
|
+
export function CompositeWizard({ steps, sessionReady: sessionReadyProp, initialArtifacts = {}, captureOnly = false, showResultScreen, showSuccessScreen, showDiagnostics = false, successClassNames, onArtifactsCollected, onSubmitted, onStepStarted, onStepCompleted, renderSubmitting, finishingScreen, successScreen, }) {
|
|
16
17
|
// sdk2 resets during render, not in an effect (CompositeWizard.tsx:200-205):
|
|
17
18
|
// auto-requesting stages fire their camera request synchronously while the
|
|
18
19
|
// child renders, and a mount effect would run after that and wipe the mark.
|
|
@@ -76,11 +77,13 @@ export function CompositeWizard({ steps, sessionReady: sessionReadyProp, initial
|
|
|
76
77
|
// until the session actually passes. An explicit prop still wins.
|
|
77
78
|
const sessionFromContext = useSessionReady();
|
|
78
79
|
const sessionReady = sessionReadyProp ?? sessionFromContext;
|
|
80
|
+
const captureProgress = useCaptureObserver();
|
|
79
81
|
useEffect(() => {
|
|
80
82
|
if (!complete || !sessionReady || submittedRef.current)
|
|
81
83
|
return;
|
|
82
84
|
submittedRef.current = true;
|
|
83
85
|
if (captureOnly) {
|
|
86
|
+
captureProgress.observe({ kind: 'flow-completed' });
|
|
84
87
|
onArtifactsCollected?.(artifactsRef.current);
|
|
85
88
|
return;
|
|
86
89
|
}
|
|
@@ -93,6 +96,7 @@ export function CompositeWizard({ steps, sessionReady: sessionReadyProp, initial
|
|
|
93
96
|
// this effect handled prevents an unhandled promise rejection.
|
|
94
97
|
});
|
|
95
98
|
}, [
|
|
99
|
+
captureProgress,
|
|
96
100
|
captureOnly,
|
|
97
101
|
complete,
|
|
98
102
|
onArtifactsCollected,
|
|
@@ -130,7 +134,7 @@ export function CompositeWizard({ steps, sessionReady: sessionReadyProp, initial
|
|
|
130
134
|
}
|
|
131
135
|
if (submissionStatus === SubmissionStatus.SUBMITTED &&
|
|
132
136
|
submissionResponse &&
|
|
133
|
-
showSuccessScreen) {
|
|
137
|
+
(showResultScreen ?? showSuccessScreen ?? false)) {
|
|
134
138
|
return (_jsx(SubmissionSuccess, { response: submissionResponse, request: lastSubmissionRequest, artifacts: artifactsRef.current, timings: lastSubmissionTimings, onResubmit: resubmit, classNames: successClassNames, showDiagnostics: showDiagnostics }));
|
|
135
139
|
}
|
|
136
140
|
return null;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type SelfieCaptureController } from '@idmission/websdk-core/selfieCapture';
|
|
2
2
|
import { type SignatureCaptureController, type SignatureCaptureControllerConfig } from '@idmission/websdk-core/signatureCapture';
|
|
3
3
|
import { type SignatureFlowViewProps, type SignatureStageDecision } from './signatureStep';
|
|
4
|
-
import type { CommonFlowProps, FaceLivenessFlowConfig, FaceLivenessFlowViewProps, FlowSubmissionConfig } from './types';
|
|
5
|
-
export type CustomerBiometricsEnrollmentFlowProps = Omit<CommonFlowProps, 'submission'> & {
|
|
4
|
+
import type { CommonFlowProps, FaceLivenessFlowConfig, FaceLivenessFlowViewProps, FlowSubmissionConfig, SubmitMode, SubmitModeProps } from './types';
|
|
5
|
+
export type CustomerBiometricsEnrollmentFlowProps = Omit<CommonFlowProps, 'submission'> & SubmitModeProps<Exclude<SubmitMode, 'capture'>> & {
|
|
6
6
|
submission: FlowSubmissionConfig & {
|
|
7
7
|
enrollmentId: string;
|
|
8
8
|
};
|
|
@@ -37,5 +37,5 @@ export type CustomerBiometricsEnrollmentFlowProps = Omit<CommonFlowProps, 'submi
|
|
|
37
37
|
allowVirtualCameras?: boolean;
|
|
38
38
|
onCaptureError?: (error: Error) => void;
|
|
39
39
|
};
|
|
40
|
-
export declare function CustomerBiometricsEnrollmentFlow({ client, submission, selfieController, signatureController, faceCapture, signatureCapture, faceView, signatureView, captureSignature, captureSignatureVideo, allowVirtualCameras, initialArtifacts, theme, className, showSuccessScreen, showDiagnostics, captureAdditionalDocuments, additionalDocumentClassNames, ringScreenClassNames, onSubmitted, onCaptureError, children, ...callbacks }: CustomerBiometricsEnrollmentFlowProps): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
export declare function CustomerBiometricsEnrollmentFlow({ client, submission, selfieController, signatureController, faceCapture, signatureCapture, faceView: faceViewProp, signatureView: signatureViewProp, captureSignature, captureSignatureVideo, allowVirtualCameras, initialArtifacts, theme, className, lang, debugMode, skipSuccessScreen, showResultScreen, showSuccessScreen, showDiagnostics, captureAdditionalDocuments, additionalDocumentClassNames, additionalDocumentVerbiage, ringScreenClassNames, ringScreenVerbiage, onSubmitted, onCaptureError, children, ...callbacks }: CustomerBiometricsEnrollmentFlowProps): import("react/jsx-runtime").JSX.Element;
|
|
41
41
|
//# sourceMappingURL=CustomerBiometricsEnrollmentFlow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomerBiometricsEnrollmentFlow.d.ts","sourceRoot":"","sources":["../../src/flows/CustomerBiometricsEnrollmentFlow.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,sCAAsC,CAAA;AAE7C,OAAO,EAEL,KAAK,0BAA0B,EAC/B,KAAK,gCAAgC,EACtC,MAAM,yCAAyC,CAAA;
|
|
1
|
+
{"version":3,"file":"CustomerBiometricsEnrollmentFlow.d.ts","sourceRoot":"","sources":["../../src/flows/C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Q,EAAE,YAA8B,EACxC,aAAa,EAAE,iBAAiB,EAChC,gBAAgB,EAChB,qBAAqB,EACrB,mBAAmB,EACnB,gBAAkC,EAClC,KAAK,EACL,SAAS,EACT,IAAI,EACJ,SAAS,EACT,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,eAAuB,EACvB,0BAA0B,EAC1B,4BAA4B,EAC5B,0BAA0B,EAC1B,oBAAoB,EACpB,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,QAAQ,EACR,GAAG,SAAS,EACb,EAAE,qCAAqC,2CAmNvC"}
|
|
@@ -22,6 +22,8 @@ import { buildAdditionalDocumentsStep } from './additionalDocuments';
|
|
|
22
22
|
import { buildSelfieArtifacts } from './artifacts';
|
|
23
23
|
import { FlowChassis } from './FlowChassis';
|
|
24
24
|
import { useLatestCallbacks } from './latestCallbacks';
|
|
25
|
+
import { FLOW_MOUNT_ONLY_REMEDY, useMountOnlyWarnings } from '../utils/mountOnly';
|
|
26
|
+
import { inheritFlowSettings } from './flowSettings';
|
|
25
27
|
import { buildRingScreenProps } from './ringScreens';
|
|
26
28
|
import { impliedAutoContinueAfterLoading, impliedSkipSuccessScreen, isRingIntroActive, } from './ringIntroImplications';
|
|
27
29
|
import { createSharedCameraAcquirer, withVirtualCameras, } from './sharedCamera';
|
|
@@ -30,8 +32,25 @@ const EMPTY_FACE_CAPTURE = {};
|
|
|
30
32
|
const EMPTY_SIGNATURE_CAPTURE = {};
|
|
31
33
|
const EMPTY_FACE_VIEW = {};
|
|
32
34
|
const EMPTY_ARTIFACTS = {};
|
|
33
|
-
export function CustomerBiometricsEnrollmentFlow({ client, submission, selfieController, signatureController, faceCapture = EMPTY_FACE_CAPTURE, signatureCapture = EMPTY_SIGNATURE_CAPTURE, faceView = EMPTY_FACE_VIEW, signatureView, captureSignature, captureSignatureVideo, allowVirtualCameras, initialArtifacts = EMPTY_ARTIFACTS, theme, className,
|
|
35
|
+
export function CustomerBiometricsEnrollmentFlow({ client, submission, selfieController, signatureController, faceCapture = EMPTY_FACE_CAPTURE, signatureCapture = EMPTY_SIGNATURE_CAPTURE, faceView: faceViewProp = EMPTY_FACE_VIEW, signatureView: signatureViewProp, captureSignature, captureSignatureVideo, allowVirtualCameras, initialArtifacts = EMPTY_ARTIFACTS, theme, className, lang, debugMode, skipSuccessScreen, showResultScreen, showSuccessScreen, showDiagnostics = false, captureAdditionalDocuments, additionalDocumentClassNames, additionalDocumentVerbiage, ringScreenClassNames, ringScreenVerbiage, onSubmitted, onCaptureError, children, ...callbacks }) {
|
|
36
|
+
// Flow-wide settings reach each step unless its own bag sets them.
|
|
37
|
+
const { faceView, signatureView } = useMemo(() => ({
|
|
38
|
+
faceView: inheritFlowSettings(faceViewProp, {
|
|
39
|
+
lang,
|
|
40
|
+
debugMode,
|
|
41
|
+
skipSuccessScreen,
|
|
42
|
+
}),
|
|
43
|
+
signatureView: inheritFlowSettings(signatureViewProp, {
|
|
44
|
+
lang,
|
|
45
|
+
showCaptureDiagnostics: debugMode,
|
|
46
|
+
skipSuccessScreen,
|
|
47
|
+
}),
|
|
48
|
+
}), [debugMode, faceViewProp, lang, signatureViewProp, skipSuccessScreen]);
|
|
34
49
|
const { checkLivenessOptions, ...selfieCaptureConfig } = faceCapture;
|
|
50
|
+
useMountOnlyWarnings('CustomerBiometricsEnrollmentFlow', FLOW_MOUNT_ONLY_REMEDY, {
|
|
51
|
+
faceCapture: selfieCaptureConfig,
|
|
52
|
+
signatureCapture,
|
|
53
|
+
});
|
|
35
54
|
// Config callbacks follow the latest render; see useLatestCallbacks.
|
|
36
55
|
const latestSelfieCapture = useLatestCallbacks(selfieCaptureConfig);
|
|
37
56
|
const latestSelfieLiveness = useLatestCallbacks(selfieCaptureConfig.liveness);
|
|
@@ -112,12 +131,13 @@ export function CustomerBiometricsEnrollmentFlow({ client, submission, selfieCon
|
|
|
112
131
|
if (signature)
|
|
113
132
|
result.push(signature);
|
|
114
133
|
}
|
|
115
|
-
const additionalDocuments = buildAdditionalDocumentsStep(captureAdditionalDocuments, additionalDocumentClassNames);
|
|
134
|
+
const additionalDocuments = buildAdditionalDocumentsStep(captureAdditionalDocuments, additionalDocumentClassNames, additionalDocumentVerbiage);
|
|
116
135
|
if (additionalDocuments)
|
|
117
136
|
result.push(additionalDocuments);
|
|
118
137
|
return result;
|
|
119
138
|
}, [
|
|
120
139
|
additionalDocumentClassNames,
|
|
140
|
+
additionalDocumentVerbiage,
|
|
121
141
|
captureAdditionalDocuments,
|
|
122
142
|
captureSignature,
|
|
123
143
|
captureSignatureVideo,
|
|
@@ -135,9 +155,11 @@ export function CustomerBiometricsEnrollmentFlow({ client, submission, selfieCon
|
|
|
135
155
|
const ringScreens = buildRingScreenProps({
|
|
136
156
|
finishingClassNames: ringScreenClassNames?.finishingScreen,
|
|
137
157
|
successClassNames: ringScreenClassNames?.successScreen,
|
|
158
|
+
finishingOverrides: ringScreenVerbiage?.finishingScreen,
|
|
159
|
+
successOverrides: ringScreenVerbiage?.successScreen,
|
|
138
160
|
ringMode: faceView.loadingOverlayMode === 'ring',
|
|
139
|
-
finishingVerbiage: { finishingStage1Text: 'Uploading your selfie', finishingStage2Text: 'Creating your secure profile' },
|
|
161
|
+
finishingVerbiage: { finishingStage1Text: 'Uploading your selfie', finishingStage2Text: 'Creating your secure profile', finishingStage3Text: '' },
|
|
140
162
|
successVerbiage: { successTitleText: "You're enrolled! 🎉", successSubtitleText: '', successIssuerValueText: '' },
|
|
141
163
|
});
|
|
142
|
-
return (_jsxs(FlowChassis, { client: client, action: SubmissionAction.ENROLL, submission: submission, theme: theme, className: className, ...callbacks, children: [_jsx(CompositeWizard, { ...ringScreens, steps: steps, initialArtifacts: initialArtifacts,
|
|
164
|
+
return (_jsxs(FlowChassis, { client: client, action: SubmissionAction.ENROLL, submission: submission, showEnrollmentId: showDiagnostics, theme: theme, className: className, lang: lang, ...callbacks, children: [_jsx(CompositeWizard, { ...ringScreens, steps: steps, initialArtifacts: initialArtifacts, showResultScreen: showResultScreen ?? showSuccessScreen, showDiagnostics: showDiagnostics, onSubmitted: onSubmitted }), children] }));
|
|
143
165
|
}
|
|
@@ -4,8 +4,8 @@ import { type SignatureCaptureController, type SignatureCaptureControllerConfig
|
|
|
4
4
|
import { type VideoIdCaptureController, type VideoIdCaptureControllerConfig } from '@idmission/websdk-core/videoIdCapture';
|
|
5
5
|
import { type SignatureFlowViewProps, type SignatureStageDecision } from './signatureStep';
|
|
6
6
|
import { type VideoIdFlowViewProps } from './videoIdSteps';
|
|
7
|
-
import type { CommonFlowProps, FaceLivenessFlowConfig, FaceLivenessFlowViewProps, FlowSubmissionConfig, IdCaptureFlowConfig, IdCaptureFlowViewProps } from './types';
|
|
8
|
-
export type CustomerIdAndBiometricsEnrollmentFlowProps = Omit<CommonFlowProps, 'submission'> & {
|
|
7
|
+
import type { CommonFlowProps, FaceLivenessFlowConfig, FaceLivenessFlowViewProps, FlowSubmissionConfig, IdCaptureFlowConfig, IdCaptureFlowViewProps, SubmitMode, SubmitModeProps } from './types';
|
|
8
|
+
export type CustomerIdAndBiometricsEnrollmentFlowProps = Omit<CommonFlowProps, 'submission'> & SubmitModeProps<Exclude<SubmitMode, 'capture'>> & {
|
|
9
9
|
submission: FlowSubmissionConfig & {
|
|
10
10
|
enrollmentId: string;
|
|
11
11
|
};
|
|
@@ -68,5 +68,5 @@ export type CustomerIdAndBiometricsEnrollmentFlowProps = Omit<CommonFlowProps, '
|
|
|
68
68
|
allowVirtualCameras?: boolean;
|
|
69
69
|
onCaptureError?: (error: Error) => void;
|
|
70
70
|
};
|
|
71
|
-
export declare function CustomerIdAndBiometricsEnrollmentFlow({ client, submission, idController, selfieController, signatureController, videoIdController, idCapture, faceCapture, signatureCapture, videoIdCapture, idView, faceView, signatureView, videoIdView, captureSignature, captureSignatureVideo, captureVideoId, allowVirtualCameras, initialArtifacts, theme, className, showSuccessScreen, showDiagnostics, captureAdditionalDocuments, additionalDocumentClassNames, ringScreenClassNames, onSubmitted, onCaptureError, children, ...callbacks }: CustomerIdAndBiometricsEnrollmentFlowProps): import("react/jsx-runtime").JSX.Element;
|
|
71
|
+
export declare function CustomerIdAndBiometricsEnrollmentFlow({ client, submission, idController, selfieController, signatureController, videoIdController, idCapture, faceCapture, signatureCapture, videoIdCapture, idView: idViewProp, faceView: faceViewProp, signatureView: signatureViewProp, videoIdView: videoIdViewProp, captureSignature, captureSignatureVideo, captureVideoId, allowVirtualCameras, initialArtifacts, theme, className, lang, debugMode, skipSuccessScreen, showResultScreen, showSuccessScreen, showDiagnostics, captureAdditionalDocuments, additionalDocumentClassNames, additionalDocumentVerbiage, ringScreenClassNames, ringScreenVerbiage, onSubmitted, onCaptureError, children, ...callbacks }: CustomerIdAndBiometricsEnrollmentFlowProps): import("react/jsx-runtime").JSX.Element;
|
|
72
72
|
//# sourceMappingURL=CustomerIdAndBiometricsEnrollmentFlow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomerIdAndBiometricsEnrollmentFlow.d.ts","sourceRoot":"","sources":["../../src/flows/CustomerIdAndBiometricsEnrollmentFlow.tsx"],"names":[],"mappings":"AAeA,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,kCAAkC,CAAA;AACzC,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,sCAAsC,CAAA;AAC7C,OAAO,EAEL,KAAK,0BAA0B,EAC/B,KAAK,gCAAgC,EACtC,MAAM,yCAAyC,CAAA;AAChD,OAAO,EAEL,KAAK,wBAAwB,EAC7B,KAAK,8BAA8B,EACpC,MAAM,uCAAuC,CAAA;
|
|
1
|
+
{"version":3,"file":"CustomerIdAndBiometricsEnrollmentFlow.d.ts","sourceRoot":"","sources":["../../src/flows/CustomerIdAndBiometricsEnrollmentFlow.tsx"],"names":[],"mappings":"AAeA,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,kCAAkC,CAAA;AACzC,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,sCAAsC,CAAA;AAC7C,OAAO,EA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