idmission-web-sdk 2.3.57 → 2.3.59
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/dist/components/CompositeWizard.d.ts.map +1 -1
- package/dist/components/camera/CameraVideoTag.d.ts.map +1 -1
- package/dist/components/face_liveness/FaceLivenessWizard.d.ts +6 -1
- package/dist/components/face_liveness/FaceLivenessWizard.d.ts.map +1 -1
- package/dist/components/id_capture/IdCaptureStateProvider.d.ts +11 -2
- package/dist/components/id_capture/IdCaptureStateProvider.d.ts.map +1 -1
- package/dist/components/id_capture/IdCaptureWizard.d.ts +7 -1
- package/dist/components/id_capture/IdCaptureWizard.d.ts.map +1 -1
- package/dist/components/selfie_capture/SelfieCapture.d.ts.map +1 -1
- package/dist/components/video_id/IdVideoCapture.d.ts.map +1 -1
- package/dist/components/video_signature_capture/VideoSignatureCapture.d.ts.map +1 -1
- package/dist/components/video_signature_capture/VideoSignatureContext.d.ts +12 -4
- package/dist/components/video_signature_capture/VideoSignatureContext.d.ts.map +1 -1
- package/dist/components/video_signature_capture/VideoSignatureWizard.d.ts.map +1 -1
- package/dist/lib/camera/cameraStore.d.ts +3 -3
- package/dist/lib/camera/cameraStore.d.ts.map +1 -1
- package/dist/lib/camera/useVideoRecorder.d.ts +12 -4
- package/dist/lib/camera/useVideoRecorder.d.ts.map +1 -1
- package/dist/sdk2.cjs.development.js +165 -152
- package/dist/sdk2.cjs.development.js.map +1 -1
- package/dist/sdk2.cjs.production.js +1 -1
- package/dist/sdk2.cjs.production.js.map +1 -1
- package/dist/sdk2.esm.js +165 -152
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +234 -399
- package/dist/sdk2.umd.development.js.map +1 -1
- package/dist/sdk2.umd.production.js +1 -1
- package/dist/sdk2.umd.production.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +3 -3
|
@@ -17,6 +17,7 @@ var middleware = require('zustand/middleware');
|
|
|
17
17
|
var shallow = require('zustand/react/shallow');
|
|
18
18
|
var cn = require('clsx');
|
|
19
19
|
var SignatureCanvas = require('react-signature-canvas');
|
|
20
|
+
var server = require('react-dom/server');
|
|
20
21
|
|
|
21
22
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
22
23
|
|
|
@@ -235,7 +236,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
235
236
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
236
237
|
};
|
|
237
238
|
|
|
238
|
-
var webSdkVersion = '2.3.
|
|
239
|
+
var webSdkVersion = '2.3.59';
|
|
239
240
|
|
|
240
241
|
function getPlatform() {
|
|
241
242
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -3671,8 +3672,8 @@ function obtainCameraAccess(stream, deviceLabel, video) {
|
|
|
3671
3672
|
release: release
|
|
3672
3673
|
};
|
|
3673
3674
|
log('camera access granted');
|
|
3674
|
-
if (video) video.srcObject = stream
|
|
3675
|
-
log('video source initialized')
|
|
3675
|
+
// if (video) video.srcObject = stream
|
|
3676
|
+
// log('video source initialized')
|
|
3676
3677
|
return currentCamera;
|
|
3677
3678
|
}
|
|
3678
3679
|
function releaseCameraAccess() {
|
|
@@ -4805,24 +4806,24 @@ function useTranslations(verbiage, fallbacks) {
|
|
|
4805
4806
|
}, [fallbacks, i18n.language, t, verbiage]);
|
|
4806
4807
|
}
|
|
4807
4808
|
|
|
4809
|
+
var camera = null;
|
|
4810
|
+
var videoStream = null;
|
|
4811
|
+
var audioStream = null;
|
|
4808
4812
|
var initialState$6 = {
|
|
4809
4813
|
videoRef: {
|
|
4810
4814
|
current: null
|
|
4811
4815
|
},
|
|
4812
4816
|
videoLoaded: false,
|
|
4813
|
-
videoStream: null,
|
|
4814
4817
|
videoDevice: null,
|
|
4815
4818
|
videoWidth: 0,
|
|
4816
4819
|
videoHeight: 0,
|
|
4817
4820
|
isRearFacing: false,
|
|
4818
|
-
camera: null,
|
|
4819
4821
|
cameraReady: false,
|
|
4820
4822
|
cameraAccessDenied: false,
|
|
4821
4823
|
iphoneContinuityCameraAvailable: false,
|
|
4822
4824
|
iphoneContinuityCameraDenied: false,
|
|
4823
4825
|
preferIphoneContinuityCamera: true,
|
|
4824
4826
|
cameraTamperingDetected: false,
|
|
4825
|
-
audioStream: null,
|
|
4826
4827
|
microphoneReady: false,
|
|
4827
4828
|
microphoneAccessDenied: false
|
|
4828
4829
|
};
|
|
@@ -4836,8 +4837,7 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
4836
4837
|
return set(config);
|
|
4837
4838
|
},
|
|
4838
4839
|
onVideoMounted: function onVideoMounted(e) {
|
|
4839
|
-
var
|
|
4840
|
-
var selectedVideoStreamId = (_a = get().videoStream) === null || _a === void 0 ? void 0 : _a.id;
|
|
4840
|
+
var selectedVideoStreamId = videoStream === null || videoStream === void 0 ? void 0 : videoStream.id;
|
|
4841
4841
|
if (!selectedVideoStreamId) return;
|
|
4842
4842
|
var srcObject = e.currentTarget.srcObject;
|
|
4843
4843
|
if (srcObject.id === selectedVideoStreamId) {
|
|
@@ -4857,19 +4857,19 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
4857
4857
|
},
|
|
4858
4858
|
requestCameraAccess: function requestCameraAccess() {
|
|
4859
4859
|
return __awaiter(this, void 0, void 0, function () {
|
|
4860
|
-
var _a, videoRef, releaseCameraAccess, preferFrontFacingCamera, preferIphoneContinuityCamera, iphoneContinuityCameraDenied, availableCameras, selectedCamera, platform_1, iphoneContinuityCamera, constraints, stream_1, e_1, e_2, handleStreamEnded_1, videoTrack_1,
|
|
4861
|
-
var _b, _c, _d;
|
|
4862
|
-
return __generator(this, function (
|
|
4863
|
-
switch (
|
|
4860
|
+
var _a, videoRef, releaseCameraAccess, preferFrontFacingCamera, preferIphoneContinuityCamera, iphoneContinuityCameraDenied, availableCameras, selectedCamera, platform_1, iphoneContinuityCamera, constraints, stream_1, e_1, e_2, handleStreamEnded_1, videoTrack_1, e_3;
|
|
4861
|
+
var _b, _c, _d, _e;
|
|
4862
|
+
return __generator(this, function (_f) {
|
|
4863
|
+
switch (_f.label) {
|
|
4864
4864
|
case 0:
|
|
4865
4865
|
_a = get(), videoRef = _a.videoRef, releaseCameraAccess = _a.releaseCameraAccess, preferFrontFacingCamera = _a.preferFrontFacingCamera, preferIphoneContinuityCamera = _a.preferIphoneContinuityCamera, iphoneContinuityCameraDenied = _a.iphoneContinuityCameraDenied;
|
|
4866
4866
|
releaseCameraAccess();
|
|
4867
|
-
|
|
4867
|
+
_f.label = 1;
|
|
4868
4868
|
case 1:
|
|
4869
|
-
|
|
4869
|
+
_f.trys.push([1, 11,, 12]);
|
|
4870
4870
|
return [4 /*yield*/, listAvailableCameras()];
|
|
4871
4871
|
case 2:
|
|
4872
|
-
availableCameras =
|
|
4872
|
+
availableCameras = _f.sent();
|
|
4873
4873
|
selectedCamera = void 0;
|
|
4874
4874
|
debug('availableCameras', availableCameras);
|
|
4875
4875
|
platform_1 = getPlatform();
|
|
@@ -4939,16 +4939,16 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
4939
4939
|
};
|
|
4940
4940
|
}
|
|
4941
4941
|
stream_1 = null;
|
|
4942
|
-
|
|
4942
|
+
_f.label = 3;
|
|
4943
4943
|
case 3:
|
|
4944
|
-
|
|
4944
|
+
_f.trys.push([3, 5,, 6]);
|
|
4945
4945
|
debug('obtaining camera access with constraints', constraints);
|
|
4946
4946
|
return [4 /*yield*/, navigator.mediaDevices.getUserMedia(constraints)];
|
|
4947
4947
|
case 4:
|
|
4948
|
-
stream_1 =
|
|
4948
|
+
stream_1 = _f.sent();
|
|
4949
4949
|
return [3 /*break*/, 6];
|
|
4950
4950
|
case 5:
|
|
4951
|
-
e_1 =
|
|
4951
|
+
e_1 = _f.sent();
|
|
4952
4952
|
if (e_1.name === 'NotAllowedError') {
|
|
4953
4953
|
if (preferIphoneContinuityCamera) {
|
|
4954
4954
|
set({
|
|
@@ -4965,19 +4965,19 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
4965
4965
|
return [3 /*break*/, 6];
|
|
4966
4966
|
case 6:
|
|
4967
4967
|
if (!!stream_1) return [3 /*break*/, 10];
|
|
4968
|
-
|
|
4968
|
+
_f.label = 7;
|
|
4969
4969
|
case 7:
|
|
4970
|
-
|
|
4970
|
+
_f.trys.push([7, 9,, 10]);
|
|
4971
4971
|
return [4 /*yield*/, navigator.mediaDevices.getUserMedia({
|
|
4972
4972
|
audio: false,
|
|
4973
4973
|
video: true
|
|
4974
4974
|
})];
|
|
4975
4975
|
case 8:
|
|
4976
|
-
stream_1 =
|
|
4976
|
+
stream_1 = _f.sent();
|
|
4977
4977
|
debug('opened stream with no width and height constraints');
|
|
4978
4978
|
return [3 /*break*/, 10];
|
|
4979
4979
|
case 9:
|
|
4980
|
-
e_2 =
|
|
4980
|
+
e_2 = _f.sent();
|
|
4981
4981
|
debug('cannot open stream at all', e_2);
|
|
4982
4982
|
return [3 /*break*/, 10];
|
|
4983
4983
|
case 10:
|
|
@@ -4989,8 +4989,8 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
4989
4989
|
handleStreamEnded_1 = function handleStreamEnded_1() {
|
|
4990
4990
|
if (preferIphoneContinuityCamera && get().iphoneContinuityCameraAvailable) {
|
|
4991
4991
|
debug('someone unplugged the continuity camera');
|
|
4992
|
+
videoStream = null;
|
|
4992
4993
|
set({
|
|
4993
|
-
videoStream: null,
|
|
4994
4994
|
videoDevice: null,
|
|
4995
4995
|
cameraReady: false,
|
|
4996
4996
|
iphoneContinuityCameraAvailable: false,
|
|
@@ -4999,9 +4999,9 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
4999
4999
|
get().requestCameraAccess();
|
|
5000
5000
|
} else {
|
|
5001
5001
|
debug('someone unplugged the webcam');
|
|
5002
|
-
releaseCameraAccess();
|
|
5002
|
+
get().releaseCameraAccess();
|
|
5003
|
+
videoStream = null;
|
|
5003
5004
|
set({
|
|
5004
|
-
videoStream: null,
|
|
5005
5005
|
videoDevice: null,
|
|
5006
5006
|
videoLoaded: false,
|
|
5007
5007
|
cameraReady: false,
|
|
@@ -5012,25 +5012,26 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
5012
5012
|
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.addEventListener('ended', handleStreamEnded_1);
|
|
5013
5013
|
videoTrack_1 = stream_1.getVideoTracks()[0];
|
|
5014
5014
|
videoTrack_1.onended = handleStreamEnded_1;
|
|
5015
|
-
|
|
5015
|
+
camera = obtainCameraAccess(stream_1, selectedCamera.label, videoRef.current);
|
|
5016
5016
|
setTimeout(function () {
|
|
5017
|
+
var _a;
|
|
5017
5018
|
// iOS 17 has a strange behavior where the video track flickers between muted and unmuted
|
|
5018
5019
|
// when the camera access is being requested. This delay is a workaround for that.
|
|
5019
5020
|
videoTrack_1.onmute = function () {
|
|
5020
5021
|
if (videoTrack_1.readyState !== 'live') handleStreamEnded_1();
|
|
5021
5022
|
};
|
|
5023
|
+
videoStream = stream_1;
|
|
5024
|
+
var isRearFacing = (_a = camera === null || camera === void 0 ? void 0 : camera.isRearFacing) !== null && _a !== void 0 ? _a : false;
|
|
5022
5025
|
set({
|
|
5023
|
-
camera: camera_1,
|
|
5024
5026
|
cameraReady: true,
|
|
5025
5027
|
cameraAccessDenied: false,
|
|
5026
|
-
isRearFacing:
|
|
5027
|
-
videoStream: stream_1
|
|
5028
|
+
isRearFacing: isRearFacing
|
|
5028
5029
|
});
|
|
5029
5030
|
}, 500);
|
|
5030
5031
|
return [3 /*break*/, 12];
|
|
5031
5032
|
case 11:
|
|
5032
|
-
e_3 =
|
|
5033
|
-
if (e_3.name === 'NotAllowedError') {
|
|
5033
|
+
e_3 = _f.sent();
|
|
5034
|
+
if (e_3.name === 'NotAllowedError' || ((_e = e_3.message) === null || _e === void 0 ? void 0 : _e.includes('Could not start video source'))) {
|
|
5034
5035
|
error('camera access has been blocked by the user', e_3);
|
|
5035
5036
|
set({
|
|
5036
5037
|
cameraAccessDenied: true
|
|
@@ -5048,17 +5049,18 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
5048
5049
|
},
|
|
5049
5050
|
releaseCameraAccess: function releaseCameraAccess() {
|
|
5050
5051
|
return __awaiter(this, void 0, void 0, function () {
|
|
5051
|
-
var camera;
|
|
5052
5052
|
return __generator(this, function (_a) {
|
|
5053
|
-
camera = get().camera;
|
|
5054
5053
|
if (!camera) return [2 /*return*/];
|
|
5055
5054
|
camera.release();
|
|
5055
|
+
camera = null;
|
|
5056
|
+
videoStream === null || videoStream === void 0 ? void 0 : videoStream.getTracks().forEach(function (track) {
|
|
5057
|
+
track.stop();
|
|
5058
|
+
});
|
|
5059
|
+
videoStream = null;
|
|
5056
5060
|
set({
|
|
5057
|
-
camera: null,
|
|
5058
5061
|
cameraReady: false,
|
|
5059
5062
|
cameraAccessDenied: false,
|
|
5060
5063
|
videoDevice: null,
|
|
5061
|
-
videoStream: null,
|
|
5062
5064
|
videoLoaded: false
|
|
5063
5065
|
});
|
|
5064
5066
|
return [2 /*return*/];
|
|
@@ -5087,8 +5089,8 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
5087
5089
|
// iOS 17 has a strange behavior where the video track flickers between muted and unmuted
|
|
5088
5090
|
// when the camera access is being requested. This delay is a workaround for that.
|
|
5089
5091
|
setTimeout(function () {
|
|
5092
|
+
audioStream = stream_2;
|
|
5090
5093
|
set({
|
|
5091
|
-
audioStream: stream_2,
|
|
5092
5094
|
microphoneReady: true,
|
|
5093
5095
|
microphoneAccessDenied: false
|
|
5094
5096
|
});
|
|
@@ -5097,6 +5099,7 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
5097
5099
|
microphoneReady: false,
|
|
5098
5100
|
microphoneAccessDenied: true
|
|
5099
5101
|
});
|
|
5102
|
+
get().releaseMicrophoneAccess();
|
|
5100
5103
|
};
|
|
5101
5104
|
var track = stream_2.getAudioTracks()[0];
|
|
5102
5105
|
track.onended = handleStreamEnded;
|
|
@@ -5120,14 +5123,13 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
5120
5123
|
},
|
|
5121
5124
|
releaseMicrophoneAccess: function releaseMicrophoneAccess() {
|
|
5122
5125
|
var _a;
|
|
5123
|
-
var audioStream = get().audioStream;
|
|
5124
5126
|
(_a = audioStream === null || audioStream === void 0 ? void 0 : audioStream.stop) === null || _a === void 0 ? void 0 : _a.call(audioStream);
|
|
5125
5127
|
audioStream === null || audioStream === void 0 ? void 0 : audioStream.getAudioTracks().forEach(function (track) {
|
|
5126
5128
|
var _a;
|
|
5127
5129
|
(_a = track.stop) === null || _a === void 0 ? void 0 : _a.call(track);
|
|
5128
5130
|
});
|
|
5131
|
+
audioStream = null;
|
|
5129
5132
|
set({
|
|
5130
|
-
audioStream: null,
|
|
5131
5133
|
microphoneReady: false,
|
|
5132
5134
|
microphoneAccessDenied: false
|
|
5133
5135
|
});
|
|
@@ -6665,15 +6667,13 @@ var IdCapture = function IdCapture(_a) {
|
|
|
6665
6667
|
_q = _o.height,
|
|
6666
6668
|
height = _q === void 0 ? 1 : _q;
|
|
6667
6669
|
var state = useIdCaptureStore();
|
|
6668
|
-
var
|
|
6669
|
-
|
|
6670
|
-
|
|
6671
|
-
|
|
6672
|
-
|
|
6673
|
-
|
|
6674
|
-
|
|
6675
|
-
focusPredictionTime = _s.focusPredictionTime,
|
|
6676
|
-
getBestFrame = _s.getBestFrame;
|
|
6670
|
+
var isRearFacing = useCameraStore().isRearFacing;
|
|
6671
|
+
var _r = React.useContext(IdCaptureModelsContext),
|
|
6672
|
+
modelsReady = _r.ready,
|
|
6673
|
+
setThresholds = _r.setThresholds,
|
|
6674
|
+
detectionTime = _r.detectionTime,
|
|
6675
|
+
focusPredictionTime = _r.focusPredictionTime,
|
|
6676
|
+
getBestFrame = _r.getBestFrame;
|
|
6677
6677
|
React.useEffect(function () {
|
|
6678
6678
|
return dispatchIdCaptureAction({
|
|
6679
6679
|
type: 'captureInitialized'
|
|
@@ -9103,9 +9103,7 @@ var DocumentCaptureStateProvider = function DocumentCaptureStateProvider(_a) {
|
|
|
9103
9103
|
var _c = React.useReducer(documentCaptureStateReducer, documentCaptureInitialState),
|
|
9104
9104
|
state = _c[0],
|
|
9105
9105
|
dispatch = _c[1];
|
|
9106
|
-
var
|
|
9107
|
-
videoStream = _d.videoStream,
|
|
9108
|
-
videoRef = _d.videoRef;
|
|
9106
|
+
var videoRef = useCameraStore().videoRef;
|
|
9109
9107
|
var uploadDocument = React.useContext(SubmissionContext).uploadDocument;
|
|
9110
9108
|
var uploadCapturedDocument = React.useCallback(function (content, filetype) {
|
|
9111
9109
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -9199,7 +9197,7 @@ var DocumentCaptureStateProvider = function DocumentCaptureStateProvider(_a) {
|
|
|
9199
9197
|
}, [onResize]);
|
|
9200
9198
|
var videoTag = videoRef.current;
|
|
9201
9199
|
React.useEffect(function () {
|
|
9202
|
-
if (!state.capturing
|
|
9200
|
+
if (!state.capturing) return;
|
|
9203
9201
|
function onComplete(content) {
|
|
9204
9202
|
if (!content) return;
|
|
9205
9203
|
var contentUrl = URL.createObjectURL(content);
|
|
@@ -9216,7 +9214,7 @@ var DocumentCaptureStateProvider = function DocumentCaptureStateProvider(_a) {
|
|
|
9216
9214
|
drawToCanvas(canvas, videoTag);
|
|
9217
9215
|
canvas.toBlob(onComplete);
|
|
9218
9216
|
}
|
|
9219
|
-
}, [state.capturing,
|
|
9217
|
+
}, [state.capturing, videoTag]);
|
|
9220
9218
|
var stateWithActions = React.useMemo(function () {
|
|
9221
9219
|
return _assign(_assign({}, state), {
|
|
9222
9220
|
uploadCapturedDocument: uploadCapturedDocument
|
|
@@ -9345,29 +9343,28 @@ var templateObject_1$u;
|
|
|
9345
9343
|
var CameraVideoTag = function CameraVideoTag(props) {
|
|
9346
9344
|
var _a = useCameraStore(shallow.useShallow(function (store) {
|
|
9347
9345
|
return {
|
|
9346
|
+
cameraReady: store.cameraReady,
|
|
9348
9347
|
videoRef: store.videoRef,
|
|
9349
|
-
videoStream: store.videoStream,
|
|
9350
9348
|
onVideoMounted: store.onVideoMounted,
|
|
9351
9349
|
isRearFacing: store.isRearFacing
|
|
9352
9350
|
};
|
|
9353
9351
|
})),
|
|
9352
|
+
cameraReady = _a.cameraReady,
|
|
9354
9353
|
videoRef = _a.videoRef,
|
|
9355
|
-
videoStream = _a.videoStream,
|
|
9356
9354
|
onVideoMounted = _a.onVideoMounted,
|
|
9357
9355
|
isRearFacing = _a.isRearFacing;
|
|
9358
|
-
React.useEffect(function
|
|
9359
|
-
if (videoRef.current
|
|
9360
|
-
|
|
9361
|
-
|
|
9362
|
-
|
|
9363
|
-
|
|
9364
|
-
}, [videoStream, videoRef]);
|
|
9356
|
+
React.useEffect(function () {
|
|
9357
|
+
if (!cameraReady || !videoRef.current) return;
|
|
9358
|
+
debug('attaching camera stream to video tag');
|
|
9359
|
+
// eslint-disable-next-line react-compiler/react-compiler
|
|
9360
|
+
videoRef.current.srcObject = videoStream;
|
|
9361
|
+
}, [cameraReady, videoRef]);
|
|
9365
9362
|
return /*#__PURE__*/React__namespace.default.createElement(FullscreenVideoTag, _assign({
|
|
9366
9363
|
autoPlay: true,
|
|
9367
9364
|
playsInline: true,
|
|
9368
9365
|
muted: true,
|
|
9369
9366
|
ref: videoRef,
|
|
9370
|
-
|
|
9367
|
+
onCanPlay: onVideoMounted,
|
|
9371
9368
|
"$isRearFacing": isRearFacing
|
|
9372
9369
|
}, props));
|
|
9373
9370
|
};
|
|
@@ -9404,7 +9401,6 @@ var DocumentCaptureScreen = function DocumentCaptureScreen(_a) {
|
|
|
9404
9401
|
content = _k.content,
|
|
9405
9402
|
uploadState = _k.uploadState;
|
|
9406
9403
|
var _l = useCameraStore(),
|
|
9407
|
-
videoStream = _l.videoStream,
|
|
9408
9404
|
cameraReady = _l.cameraReady,
|
|
9409
9405
|
cameraAccessDenied = _l.cameraAccessDenied,
|
|
9410
9406
|
requestCameraAccess = _l.requestCameraAccess;
|
|
@@ -9419,7 +9415,7 @@ var DocumentCaptureScreen = function DocumentCaptureScreen(_a) {
|
|
|
9419
9415
|
// and the user hasn't passed a media blob for the current document...
|
|
9420
9416
|
!cameraAccessRequested &&
|
|
9421
9417
|
// and we haven't already tried to force a camera request...
|
|
9422
|
-
!
|
|
9418
|
+
!cameraReady; // and we don't already have camera access.
|
|
9423
9419
|
React.useEffect(function requestCameraAccessIfNeeded() {
|
|
9424
9420
|
if (!cameraAccessNeeded) return;
|
|
9425
9421
|
setCameraAccessRequested(true);
|
|
@@ -10618,7 +10614,7 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
10618
10614
|
focusScore: metadata.bestFocusScore
|
|
10619
10615
|
}
|
|
10620
10616
|
});
|
|
10621
|
-
}, [logCaptureMetadata]);
|
|
10617
|
+
}, [logCaptureMetadata, onDocumentCaptured]);
|
|
10622
10618
|
var onSubmitClick = React.useCallback(function () {
|
|
10623
10619
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
10624
10620
|
var docs = state.capturedDocuments;
|
|
@@ -10844,6 +10840,30 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
10844
10840
|
debugMode: debugMode
|
|
10845
10841
|
})));
|
|
10846
10842
|
};
|
|
10843
|
+
function IdCaptureWizardWithProviders(_a) {
|
|
10844
|
+
var _b, _c, _d, _e, _f, _g;
|
|
10845
|
+
var onCameraAccessDenied = _a.onCameraAccessDenied,
|
|
10846
|
+
onCameraTamperingDetected = _a.onCameraTamperingDetected,
|
|
10847
|
+
onMicrophoneAccessDenied = _a.onMicrophoneAccessDenied,
|
|
10848
|
+
shouldLoadIdCaptureModels = _a.shouldLoadIdCaptureModels,
|
|
10849
|
+
idCaptureProps = __rest(_a, ["onCameraAccessDenied", "onCameraTamperingDetected", "onMicrophoneAccessDenied", "shouldLoadIdCaptureModels"]);
|
|
10850
|
+
return /*#__PURE__*/React__namespace.default.createElement(CameraStoreProvider, {
|
|
10851
|
+
onCameraAccessDenied: onCameraAccessDenied,
|
|
10852
|
+
onCameraTamperingDetected: onCameraTamperingDetected,
|
|
10853
|
+
onMicrophoneAccessDenied: onMicrophoneAccessDenied,
|
|
10854
|
+
requestAccessAutomatically: shouldLoadIdCaptureModels,
|
|
10855
|
+
classNames: (_b = idCaptureProps.classNames) === null || _b === void 0 ? void 0 : _b.cameraStoreProvider,
|
|
10856
|
+
verbiage: (_c = idCaptureProps.verbiage) === null || _c === void 0 ? void 0 : _c.cameraStoreProvider
|
|
10857
|
+
}, /*#__PURE__*/React__namespace.default.createElement(IdCaptureModelsProvider, {
|
|
10858
|
+
autoStart: false,
|
|
10859
|
+
shouldLoadModels: shouldLoadIdCaptureModels,
|
|
10860
|
+
documentDetectionModelUrl: (_e = (_d = idCaptureProps.assets) === null || _d === void 0 ? void 0 : _d.documentDetectionModelUrl) !== null && _e !== void 0 ? _e : '',
|
|
10861
|
+
focusModelUrl: (_g = (_f = idCaptureProps.assets) === null || _f === void 0 ? void 0 : _f.focusModelUrl) !== null && _g !== void 0 ? _g : '',
|
|
10862
|
+
onModelError: idCaptureProps.onModelError,
|
|
10863
|
+
modelLoadTimeoutMs: idCaptureProps.modelLoadTimeoutMs,
|
|
10864
|
+
allowSinglePageIdCapture: idCaptureProps.allowSinglePageIdCapture
|
|
10865
|
+
}, /*#__PURE__*/React__namespace.default.createElement(IdCaptureStateProvider, null, /*#__PURE__*/React__namespace.default.createElement(GuideOrientationContextProvider, null, /*#__PURE__*/React__namespace.default.createElement(IdCaptureWizard, _assign({}, idCaptureProps))))));
|
|
10866
|
+
}
|
|
10847
10867
|
|
|
10848
10868
|
function SelfieCaptureLoadingGraphic(_a) {
|
|
10849
10869
|
var _b, _c, _d;
|
|
@@ -11857,9 +11877,6 @@ var SelfieCapture = function SelfieCapture(_a) {
|
|
|
11857
11877
|
prediction = _o.prediction,
|
|
11858
11878
|
dispatch = _m[1];
|
|
11859
11879
|
var lastPredictionCanvas = React.useRef(null);
|
|
11860
|
-
var camera = useCameraStore(shallow.useShallow(function (state) {
|
|
11861
|
-
return state.camera;
|
|
11862
|
-
}));
|
|
11863
11880
|
var _p = React.useContext(SelfieGuidanceModelsContext),
|
|
11864
11881
|
onPredictionMade = _p.onPredictionMade,
|
|
11865
11882
|
canvasRef = _p.canvasRef,
|
|
@@ -13035,6 +13052,26 @@ var FaceLivenessWizard = function FaceLivenessWizard(_a) {
|
|
|
13035
13052
|
waitForIdCaptureModels: waitForIdCaptureModels
|
|
13036
13053
|
})));
|
|
13037
13054
|
};
|
|
13055
|
+
function FaceLivenessWizardWithProviders(_a) {
|
|
13056
|
+
var _b, _c;
|
|
13057
|
+
var onCameraAccessDenied = _a.onCameraAccessDenied,
|
|
13058
|
+
onCameraTamperingDetected = _a.onCameraTamperingDetected,
|
|
13059
|
+
onMicrophoneAccessDenied = _a.onMicrophoneAccessDenied,
|
|
13060
|
+
faceLivenessProps = __rest(_a, ["onCameraAccessDenied", "onCameraTamperingDetected", "onMicrophoneAccessDenied"]);
|
|
13061
|
+
return /*#__PURE__*/React__namespace.default.createElement(CameraStoreProvider, {
|
|
13062
|
+
preferFrontFacingCamera: true,
|
|
13063
|
+
preferIphoneContinuityCamera: false,
|
|
13064
|
+
onCameraAccessDenied: onCameraAccessDenied,
|
|
13065
|
+
onCameraTamperingDetected: onCameraTamperingDetected,
|
|
13066
|
+
onMicrophoneAccessDenied: onMicrophoneAccessDenied,
|
|
13067
|
+
classNames: (_b = faceLivenessProps.classNames) === null || _b === void 0 ? void 0 : _b.cameraStoreProvider,
|
|
13068
|
+
verbiage: (_c = faceLivenessProps.verbiage) === null || _c === void 0 ? void 0 : _c.cameraStoreProvider
|
|
13069
|
+
}, /*#__PURE__*/React__namespace.default.createElement(SelfieGuidanceModelsProvider, {
|
|
13070
|
+
autoStart: false,
|
|
13071
|
+
onModelError: faceLivenessProps.onModelError,
|
|
13072
|
+
modelLoadTimeoutMs: faceLivenessProps.modelLoadTimeoutMs
|
|
13073
|
+
}, /*#__PURE__*/React__namespace.default.createElement(FaceLivenessWizard, _assign({}, faceLivenessProps))));
|
|
13074
|
+
}
|
|
13038
13075
|
|
|
13039
13076
|
var SubmissionSuccess = function SubmissionSuccess() {
|
|
13040
13077
|
var _a = React.useContext(SubmissionContext),
|
|
@@ -13451,12 +13488,16 @@ var initialState$2 = {
|
|
|
13451
13488
|
};
|
|
13452
13489
|
var useVideoRecorderStore = zustand.create()(middleware.devtools(function (set, get) {
|
|
13453
13490
|
return _assign(_assign({}, initialState$2), {
|
|
13454
|
-
startRecordingVideo: function startRecordingVideo(
|
|
13491
|
+
startRecordingVideo: function startRecordingVideo(captureAudio) {
|
|
13455
13492
|
var _a, _b, _c;
|
|
13493
|
+
if (captureAudio === void 0) {
|
|
13494
|
+
captureAudio = false;
|
|
13495
|
+
}
|
|
13496
|
+
if (!camera) throw new Error('Camera not found');
|
|
13456
13497
|
var _d = get(),
|
|
13457
13498
|
mergeAVStreams = _d.mergeAVStreams,
|
|
13458
13499
|
startRecordingAudio = _d.startRecordingAudio;
|
|
13459
|
-
var videoStream = mergeAVStreams ? new MediaStream(__spreadArray(__spreadArray([], (_b = (_a = camera === null || camera === void 0 ? void 0 : camera.stream) === null || _a === void 0 ? void 0 : _a.getTracks()) !== null && _b !== void 0 ? _b : [], true), (_c = audioStream === null || audioStream === void 0 ? void 0 : audioStream.getTracks()) !== null && _c !== void 0 ? _c : [], true)) : camera.stream;
|
|
13500
|
+
var videoStream = mergeAVStreams ? new MediaStream(__spreadArray(__spreadArray([], (_b = (_a = camera === null || camera === void 0 ? void 0 : camera.stream) === null || _a === void 0 ? void 0 : _a.getTracks()) !== null && _b !== void 0 ? _b : [], true), captureAudio ? (_c = audioStream === null || audioStream === void 0 ? void 0 : audioStream.getTracks()) !== null && _c !== void 0 ? _c : [] : [], true)) : camera.stream;
|
|
13460
13501
|
if (!videoStream) return;
|
|
13461
13502
|
clearVideoChunks();
|
|
13462
13503
|
videoRecorder = null;
|
|
@@ -13484,8 +13525,8 @@ var useVideoRecorderStore = zustand.create()(middleware.devtools(function (set,
|
|
|
13484
13525
|
// TODO: figure out what to do here
|
|
13485
13526
|
}
|
|
13486
13527
|
}, 100);
|
|
13487
|
-
if (
|
|
13488
|
-
startRecordingAudio(
|
|
13528
|
+
if (captureAudio && !mergeAVStreams) {
|
|
13529
|
+
startRecordingAudio();
|
|
13489
13530
|
}
|
|
13490
13531
|
},
|
|
13491
13532
|
stopRecordingVideo: function stopRecordingVideo() {
|
|
@@ -13496,7 +13537,7 @@ var useVideoRecorderStore = zustand.create()(middleware.devtools(function (set,
|
|
|
13496
13537
|
videoRecorder === null || videoRecorder === void 0 ? void 0 : videoRecorder.stop(); // if you call this while state === 'inactive', an exception is thrown.
|
|
13497
13538
|
}
|
|
13498
13539
|
},
|
|
13499
|
-
startRecordingAudio: function startRecordingAudio(
|
|
13540
|
+
startRecordingAudio: function startRecordingAudio() {
|
|
13500
13541
|
if (get().mergeAVStreams) return;
|
|
13501
13542
|
if (!audioStream) return;
|
|
13502
13543
|
clearAudioChunks();
|
|
@@ -13630,18 +13671,19 @@ var videoSignatureInitialState = {
|
|
|
13630
13671
|
};
|
|
13631
13672
|
var useVideoSignatureStore = zustand.create()(middleware.devtools(function (set, get) {
|
|
13632
13673
|
return _assign(_assign({}, videoSignatureInitialState), {
|
|
13633
|
-
startRecording: function startRecording(
|
|
13674
|
+
startRecording: function startRecording(captureAudio) {
|
|
13634
13675
|
var _a;
|
|
13635
13676
|
if (captureAudio === void 0) {
|
|
13636
13677
|
captureAudio = false;
|
|
13637
13678
|
}
|
|
13679
|
+
if (!camera) throw new Error('Camera not found');
|
|
13638
13680
|
// set our flag and clear whatever we have recorded so far.
|
|
13639
13681
|
set({
|
|
13640
13682
|
isRecording: true
|
|
13641
13683
|
});
|
|
13642
13684
|
signatureChunks = [];
|
|
13643
13685
|
// start recording video and audio
|
|
13644
|
-
useVideoRecorderStore.getState().startRecordingVideo(
|
|
13686
|
+
useVideoRecorderStore.getState().startRecordingVideo(captureAudio);
|
|
13645
13687
|
// start recording from the output canvas to capture the signature
|
|
13646
13688
|
var videoStream = get().outputCanvas.current.captureStream(24); // fps
|
|
13647
13689
|
var tracks = [videoStream.getVideoTracks()[0]];
|
|
@@ -13935,14 +13977,10 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
|
|
|
13935
13977
|
debugMode = _l === void 0 ? false : _l;
|
|
13936
13978
|
var _m = useCameraStore(shallow.useShallow(function (state) {
|
|
13937
13979
|
return {
|
|
13938
|
-
camera: state.camera,
|
|
13939
|
-
audioStream: state.audioStream,
|
|
13940
13980
|
videoWidth: state.videoWidth,
|
|
13941
13981
|
videoHeight: state.videoHeight
|
|
13942
13982
|
};
|
|
13943
13983
|
})),
|
|
13944
|
-
camera = _m.camera,
|
|
13945
|
-
audioStream = _m.audioStream,
|
|
13946
13984
|
videoWidth = _m.videoWidth,
|
|
13947
13985
|
videoHeight = _m.videoHeight;
|
|
13948
13986
|
var _o = useSelfieGuidanceModelsContext(),
|
|
@@ -13950,8 +13988,6 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
|
|
|
13950
13988
|
startHeadTracking = _o.start,
|
|
13951
13989
|
stopHeadTracking = _o.stop;
|
|
13952
13990
|
var _p = useVideoSignatureStore(),
|
|
13953
|
-
startRecording = _p.startRecording,
|
|
13954
|
-
stopRecording = _p.stopRecording,
|
|
13955
13991
|
clearRecordedData = _p.clearRecordedData,
|
|
13956
13992
|
isRecording = _p.isRecording;
|
|
13957
13993
|
React.useEffect(function () {
|
|
@@ -13960,10 +13996,11 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
|
|
|
13960
13996
|
});
|
|
13961
13997
|
}, [onSignatureVideoCaptured]);
|
|
13962
13998
|
React.useEffect(function () {
|
|
13963
|
-
|
|
13964
|
-
|
|
13965
|
-
|
|
13966
|
-
|
|
13999
|
+
useVideoSignatureStore.getState().startRecording(captureAudio);
|
|
14000
|
+
return function () {
|
|
14001
|
+
return useVideoSignatureStore.getState().stopRecording();
|
|
14002
|
+
};
|
|
14003
|
+
}, [captureAudio]);
|
|
13967
14004
|
React.useEffect(function () {
|
|
13968
14005
|
setTimeout(startHeadTracking, 1);
|
|
13969
14006
|
return stopHeadTracking;
|
|
@@ -13984,7 +14021,7 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
|
|
|
13984
14021
|
setNumFramesWithoutFaces = _s[1];
|
|
13985
14022
|
onHeadTrackingPredictionMade(useDebounce.useThrottledCallback(React.useCallback(function (_a) {
|
|
13986
14023
|
var face = _a.face;
|
|
13987
|
-
if (
|
|
14024
|
+
if (headTrackingDisabled) return;
|
|
13988
14025
|
var leftEdge = videoWidth * headTrackingBoundaryPercentage;
|
|
13989
14026
|
var rightEdge = videoWidth * (1 - headTrackingBoundaryPercentage);
|
|
13990
14027
|
var topEdge = videoHeight * headTrackingBoundaryPercentage;
|
|
@@ -13995,7 +14032,7 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
|
|
|
13995
14032
|
setNumFramesWithoutFaces(face ? 0 : function (n) {
|
|
13996
14033
|
return n + 1;
|
|
13997
14034
|
});
|
|
13998
|
-
}, [
|
|
14035
|
+
}, [headTrackingBoundaryPercentage, headTrackingBoundaryType, headTrackingDisabled, videoHeight, videoWidth]), 16));
|
|
13999
14036
|
var _t = useResizeObserver(),
|
|
14000
14037
|
ref = _t.ref,
|
|
14001
14038
|
_u = _t.width,
|
|
@@ -14038,7 +14075,7 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
|
|
|
14038
14075
|
face: lastFace,
|
|
14039
14076
|
scaling: debugScalingDetails,
|
|
14040
14077
|
color: headTrackingSatisfied ? 'green' : 'red'
|
|
14041
|
-
}))), /*#__PURE__*/React__namespace.default.createElement(DebugStatsPane, null, "Video: ",
|
|
14078
|
+
}))), /*#__PURE__*/React__namespace.default.createElement(DebugStatsPane, null, "Video: ", videoWidth, "x", videoHeight, /*#__PURE__*/React__namespace.default.createElement("br", null), "Recording: ", isRecording ? 'true' : 'false'))), /*#__PURE__*/React__namespace.default.createElement(ExitCaptureButton, {
|
|
14042
14079
|
onClick: onExit,
|
|
14043
14080
|
className: classNames.exitCaptureBtn
|
|
14044
14081
|
}));
|
|
@@ -14544,9 +14581,6 @@ function VideoSignatureWizardGuides(_a) {
|
|
|
14544
14581
|
component = _a.component,
|
|
14545
14582
|
props = __rest(_a, ["status", "restartVideoOnSignaturePadCleared", "captureAudio", "component"]);
|
|
14546
14583
|
var Component = component !== null && component !== void 0 ? component : VideoSignatureGuides;
|
|
14547
|
-
var _d = useCameraStore(),
|
|
14548
|
-
camera = _d.camera,
|
|
14549
|
-
audioStream = _d.audioStream;
|
|
14550
14584
|
var onAcceptBtnClicked = React.useCallback(function () {
|
|
14551
14585
|
var signaturePad = useVideoSignatureStore.getState().signaturePad;
|
|
14552
14586
|
if (!signaturePad.current) throw new Error('Signature pad not found');
|
|
@@ -14568,11 +14602,11 @@ function VideoSignatureWizardGuides(_a) {
|
|
|
14568
14602
|
setTimeout(function () {
|
|
14569
14603
|
useVideoSignatureStore.getState().clearRecordedData();
|
|
14570
14604
|
setTimeout(function () {
|
|
14571
|
-
useVideoSignatureStore.getState().startRecording(
|
|
14605
|
+
useVideoSignatureStore.getState().startRecording(captureAudio);
|
|
14572
14606
|
}, 100);
|
|
14573
14607
|
}, 100);
|
|
14574
14608
|
}
|
|
14575
|
-
}, [
|
|
14609
|
+
}, [captureAudio, restartVideoOnSignaturePadCleared]);
|
|
14576
14610
|
return /*#__PURE__*/React__namespace.default.createElement(Component, _assign({}, props, {
|
|
14577
14611
|
faceGuideStatus: status,
|
|
14578
14612
|
onAcceptBtnClicked: onAcceptBtnClicked,
|
|
@@ -14926,12 +14960,10 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14926
14960
|
_9 = _7.height,
|
|
14927
14961
|
height = _9 === void 0 ? 1 : _9;
|
|
14928
14962
|
var _10 = useCameraStore(),
|
|
14929
|
-
camera = _10.camera,
|
|
14930
14963
|
videoRef = _10.videoRef,
|
|
14931
14964
|
videoLoaded = _10.videoLoaded,
|
|
14932
14965
|
cameraReady = _10.cameraReady,
|
|
14933
14966
|
microphoneReady = _10.microphoneReady,
|
|
14934
|
-
audioStream = _10.audioStream,
|
|
14935
14967
|
isRearFacing = _10.isRearFacing,
|
|
14936
14968
|
releaseCameraAccess = _10.releaseCameraAccess;
|
|
14937
14969
|
var _11 = React.useState([]),
|
|
@@ -14973,8 +15005,8 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14973
15005
|
countdownRemaining = _18[0],
|
|
14974
15006
|
setCountdownRemaining = _18[1];
|
|
14975
15007
|
React.useEffect(function () {
|
|
14976
|
-
if (
|
|
14977
|
-
useVideoRecorderStore.getState().startRecordingVideo(
|
|
15008
|
+
if (!isRecordingVideo && !videoUrl) {
|
|
15009
|
+
useVideoRecorderStore.getState().startRecordingVideo();
|
|
14978
15010
|
setVideoStartsAt(new Date());
|
|
14979
15011
|
}
|
|
14980
15012
|
// if the mergeAVStreams flag is present, the audio stream is on the video
|
|
@@ -14985,7 +15017,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14985
15017
|
releaseCameraAccess();
|
|
14986
15018
|
onComplete === null || onComplete === void 0 ? void 0 : onComplete(videoUrl, audioUrl);
|
|
14987
15019
|
}
|
|
14988
|
-
}, [
|
|
15020
|
+
}, [audioUrl, isRecordingVideo, mergeAVStreams, onComplete, readTextPrompt, releaseCameraAccess, videoUrl]);
|
|
14989
15021
|
React.useEffect(function () {
|
|
14990
15022
|
if (videoRecordingUnintentionallyStopped || audioRecordingUnintentionallyStopped || !!readTextPrompt && !microphoneReady) {
|
|
14991
15023
|
onRecordingFailed === null || onRecordingFailed === void 0 ? void 0 : onRecordingFailed();
|
|
@@ -15080,13 +15112,14 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
15080
15112
|
var _a;
|
|
15081
15113
|
if (translatedText) {
|
|
15082
15114
|
setRequestedAction('READ_TEXT');
|
|
15083
|
-
useVideoRecorderStore.getState().startRecordingAudio(
|
|
15115
|
+
useVideoRecorderStore.getState().startRecordingAudio();
|
|
15084
15116
|
setIdCaptureVideoAudioStartsAt(new Date().getTime() - ((_a = videoStartsAt === null || videoStartsAt === void 0 ? void 0 : videoStartsAt.getTime()) !== null && _a !== void 0 ? _a : 0));
|
|
15085
|
-
|
|
15117
|
+
var renderedTranslatedText = typeof translatedText === 'string' ? translatedText : server.renderToString(translatedText);
|
|
15118
|
+
setExpectedAudioText(renderedTranslatedText);
|
|
15086
15119
|
} else {
|
|
15087
15120
|
useVideoRecorderStore.getState().stopRecordingVideo();
|
|
15088
15121
|
}
|
|
15089
|
-
}, [
|
|
15122
|
+
}, [setExpectedAudioText, setIdCaptureVideoAudioStartsAt, translatedText, videoStartsAt]);
|
|
15090
15123
|
var frameWidth = (_c = (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.videoWidth) !== null && _c !== void 0 ? _c : 0;
|
|
15091
15124
|
var frameHeight = (_e = (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.videoHeight) !== null && _e !== void 0 ? _e : 0;
|
|
15092
15125
|
var faceBox = face === null || face === void 0 ? void 0 : face.box;
|
|
@@ -15718,36 +15751,36 @@ var VideoIdWizard = function VideoIdWizard(_a) {
|
|
|
15718
15751
|
};
|
|
15719
15752
|
|
|
15720
15753
|
function CompositeWizard(_a) {
|
|
15721
|
-
var _b
|
|
15754
|
+
var _b;
|
|
15722
15755
|
var userChecks = _a.checks,
|
|
15723
|
-
|
|
15724
|
-
idCaptureProps =
|
|
15725
|
-
|
|
15726
|
-
faceLivenessProps =
|
|
15756
|
+
_c = _a.idCaptureProps,
|
|
15757
|
+
idCaptureProps = _c === void 0 ? {} : _c,
|
|
15758
|
+
_d = _a.faceLivenessProps,
|
|
15759
|
+
faceLivenessProps = _d === void 0 ? {} : _d,
|
|
15727
15760
|
additionalDocumentCaptureProps = _a.additionalDocumentCaptureProps,
|
|
15728
|
-
|
|
15729
|
-
signatureCaptureProps =
|
|
15730
|
-
|
|
15731
|
-
videoSignatureCaptureProps =
|
|
15732
|
-
|
|
15733
|
-
videoIdCaptureProps =
|
|
15734
|
-
|
|
15735
|
-
captureSignature =
|
|
15736
|
-
|
|
15737
|
-
captureSignatureVideo =
|
|
15761
|
+
_e = _a.signatureCaptureProps,
|
|
15762
|
+
signatureCaptureProps = _e === void 0 ? {} : _e,
|
|
15763
|
+
_f = _a.videoSignatureCaptureProps,
|
|
15764
|
+
videoSignatureCaptureProps = _f === void 0 ? {} : _f,
|
|
15765
|
+
_g = _a.videoIdCaptureProps,
|
|
15766
|
+
videoIdCaptureProps = _g === void 0 ? {} : _g,
|
|
15767
|
+
_h = _a.captureSignature,
|
|
15768
|
+
captureSignature = _h === void 0 ? false : _h,
|
|
15769
|
+
_j = _a.captureSignatureVideo,
|
|
15770
|
+
captureSignatureVideo = _j === void 0 ? false : _j,
|
|
15738
15771
|
onCameraAccessDenied = _a.onCameraAccessDenied,
|
|
15739
15772
|
onCameraTamperingDetected = _a.onCameraTamperingDetected,
|
|
15740
15773
|
onMicrophoneAccessDenied = _a.onMicrophoneAccessDenied,
|
|
15741
|
-
|
|
15742
|
-
debugMode =
|
|
15743
|
-
var
|
|
15744
|
-
submit =
|
|
15745
|
-
submissionStatus =
|
|
15746
|
-
setSignatureData =
|
|
15747
|
-
setAdditionalDocuments =
|
|
15748
|
-
var
|
|
15749
|
-
checkIndex =
|
|
15750
|
-
setCheckIndex =
|
|
15774
|
+
_k = _a.debugMode,
|
|
15775
|
+
debugMode = _k === void 0 ? false : _k;
|
|
15776
|
+
var _l = React.useContext(SubmissionContext),
|
|
15777
|
+
submit = _l.submit,
|
|
15778
|
+
submissionStatus = _l.submissionStatus,
|
|
15779
|
+
setSignatureData = _l.setSignatureData,
|
|
15780
|
+
setAdditionalDocuments = _l.setAdditionalDocuments;
|
|
15781
|
+
var _m = React.useState(0),
|
|
15782
|
+
checkIndex = _m[0],
|
|
15783
|
+
setCheckIndex = _m[1];
|
|
15751
15784
|
var checks = React.useMemo(function () {
|
|
15752
15785
|
var _a, _b;
|
|
15753
15786
|
var checks = __spreadArray([], userChecks, true);
|
|
@@ -15854,24 +15887,13 @@ function CompositeWizard(_a) {
|
|
|
15854
15887
|
var shouldLoadIdCaptureModels = !(idCaptureProps === null || idCaptureProps === void 0 ? void 0 : idCaptureProps.forceFallbackMode) && !(idCaptureProps === null || idCaptureProps === void 0 ? void 0 : idCaptureProps.allowUploadingDocumentsFromStorage);
|
|
15855
15888
|
switch (checks[checkIndex]) {
|
|
15856
15889
|
case 'IdCapture':
|
|
15857
|
-
return /*#__PURE__*/React__namespace.default.createElement(
|
|
15890
|
+
return /*#__PURE__*/React__namespace.default.createElement(IdCaptureWizardWithProviders, _assign({}, idCaptureProps, {
|
|
15858
15891
|
onCameraAccessDenied: onCameraAccessDenied,
|
|
15859
15892
|
onCameraTamperingDetected: onCameraTamperingDetected,
|
|
15860
15893
|
onMicrophoneAccessDenied: onMicrophoneAccessDenied,
|
|
15861
|
-
|
|
15862
|
-
classNames: (_c = idCaptureProps.classNames) === null || _c === void 0 ? void 0 : _c.cameraStoreProvider,
|
|
15863
|
-
verbiage: (_d = idCaptureProps.verbiage) === null || _d === void 0 ? void 0 : _d.cameraStoreProvider
|
|
15864
|
-
}, /*#__PURE__*/React__namespace.default.createElement(IdCaptureModelsProvider, {
|
|
15865
|
-
autoStart: false,
|
|
15866
|
-
shouldLoadModels: shouldLoadIdCaptureModels,
|
|
15867
|
-
documentDetectionModelUrl: (_f = (_e = idCaptureProps.assets) === null || _e === void 0 ? void 0 : _e.documentDetectionModelUrl) !== null && _f !== void 0 ? _f : '',
|
|
15868
|
-
focusModelUrl: (_h = (_g = idCaptureProps.assets) === null || _g === void 0 ? void 0 : _g.focusModelUrl) !== null && _h !== void 0 ? _h : '',
|
|
15869
|
-
onModelError: idCaptureProps.onModelError,
|
|
15870
|
-
modelLoadTimeoutMs: idCaptureProps.modelLoadTimeoutMs,
|
|
15871
|
-
allowSinglePageIdCapture: idCaptureProps.allowSinglePageIdCapture
|
|
15872
|
-
}, /*#__PURE__*/React__namespace.default.createElement(IdCaptureStateProvider, null, /*#__PURE__*/React__namespace.default.createElement(GuideOrientationContextProvider, null, /*#__PURE__*/React__namespace.default.createElement(IdCaptureWizard, _assign({}, idCaptureProps, {
|
|
15894
|
+
shouldLoadIdCaptureModels: shouldLoadIdCaptureModels,
|
|
15873
15895
|
onSuccess: onIdCaptureSuccess
|
|
15874
|
-
}))
|
|
15896
|
+
}));
|
|
15875
15897
|
case 'VideoIdCapture':
|
|
15876
15898
|
return /*#__PURE__*/React__namespace.default.createElement(VideoIdWizard, _assign({}, videoIdCaptureProps, {
|
|
15877
15899
|
onComplete: onVideoIdCaptureComplete,
|
|
@@ -15880,21 +15902,12 @@ function CompositeWizard(_a) {
|
|
|
15880
15902
|
onMicrophoneAccessDenied: onMicrophoneAccessDenied
|
|
15881
15903
|
}));
|
|
15882
15904
|
case 'FaceLiveness':
|
|
15883
|
-
return /*#__PURE__*/React__namespace.default.createElement(
|
|
15884
|
-
preferFrontFacingCamera: true,
|
|
15885
|
-
preferIphoneContinuityCamera: false,
|
|
15905
|
+
return /*#__PURE__*/React__namespace.default.createElement(FaceLivenessWizardWithProviders, _assign({}, faceLivenessProps, {
|
|
15886
15906
|
onCameraAccessDenied: onCameraAccessDenied,
|
|
15887
15907
|
onCameraTamperingDetected: onCameraTamperingDetected,
|
|
15888
15908
|
onMicrophoneAccessDenied: onMicrophoneAccessDenied,
|
|
15889
|
-
classNames: (_j = faceLivenessProps.classNames) === null || _j === void 0 ? void 0 : _j.cameraStoreProvider,
|
|
15890
|
-
verbiage: (_k = faceLivenessProps.verbiage) === null || _k === void 0 ? void 0 : _k.cameraStoreProvider
|
|
15891
|
-
}, /*#__PURE__*/React__namespace.default.createElement(SelfieGuidanceModelsProvider, {
|
|
15892
|
-
autoStart: false,
|
|
15893
|
-
onModelError: faceLivenessProps.onModelError,
|
|
15894
|
-
modelLoadTimeoutMs: faceLivenessProps.modelLoadTimeoutMs
|
|
15895
|
-
}, /*#__PURE__*/React__namespace.default.createElement(FaceLivenessWizard, _assign({}, faceLivenessProps, {
|
|
15896
15909
|
onComplete: onFaceLivenessComplete
|
|
15897
|
-
}))
|
|
15910
|
+
}));
|
|
15898
15911
|
case 'SignatureCapture':
|
|
15899
15912
|
return /*#__PURE__*/React__namespace.default.createElement(SignatureCapture, _assign({}, signatureCaptureProps, {
|
|
15900
15913
|
onAccept: onSignatureCaptureSuccess
|