idmission-web-sdk 2.3.58 → 2.3.60
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/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/submission/SubmissionProvider.d.ts.map +1 -1
- package/dist/components/submission/types.d.ts +2 -0
- package/dist/components/submission/types.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 +1 -2
- 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 +1 -2
- package/dist/lib/camera/useVideoRecorder.d.ts.map +1 -1
- package/dist/sdk2.cjs.development.js +169 -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 +169 -152
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +169 -152
- 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 +1 -1
package/dist/sdk2.esm.js
CHANGED
|
@@ -205,7 +205,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
205
205
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
206
206
|
};
|
|
207
207
|
|
|
208
|
-
var webSdkVersion = '2.3.
|
|
208
|
+
var webSdkVersion = '2.3.60';
|
|
209
209
|
|
|
210
210
|
function getPlatform() {
|
|
211
211
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -1565,6 +1565,9 @@ var SubmissionProvider = function SubmissionProvider(_a) {
|
|
|
1565
1565
|
if (clientRequestID) {
|
|
1566
1566
|
submissionRequest.additionalData.clientRequestID = clientRequestID;
|
|
1567
1567
|
}
|
|
1568
|
+
if (jobId) {
|
|
1569
|
+
submissionRequest.additionalData.jobID = jobId;
|
|
1570
|
+
}
|
|
1568
1571
|
if (documents.idFrontImage) {
|
|
1569
1572
|
submissionRequest.customerData.idData.idImageFront = documents.idFrontImage;
|
|
1570
1573
|
}
|
|
@@ -1662,7 +1665,7 @@ var SubmissionProvider = function SubmissionProvider(_a) {
|
|
|
1662
1665
|
}
|
|
1663
1666
|
});
|
|
1664
1667
|
});
|
|
1665
|
-
}, [additionalDocuments, bypassAgeValidation, bypassNameMatching, cardData, clientRequestID, companyId, customerDataMatchConfig, deduplicationEnabled, deduplicationSynchronous, documentServiceUrl, enrollmentId, expectedAudioText, geolocationResult, idBackCaptureAttempts, idBackImage, idBackImageRequired, idBackIrImage, idBackUvImage, idCaptureVideoAudioStartsAt, idCaptureVideoAudioUrl, idCaptureVideoIdBackImage, idCaptureVideoIdFrontImage, idCaptureVideoUrl, idCardForFaceMatch, idData, idFrontCaptureAttempts, idFrontImage, idFrontIrImage, idFrontUvImage, idImageResolutionCheck, manualReviewRequired, needImmediateResponse, passportImage, personalData, selfieCaptureAttempts, selfieImage, signatureData, signatureVideoUrl, uploadDocument, verifyIdWithExternalDatabases, webhooksClientTraceId, webhooksEnabled, webhooksFireOnReview, webhooksFireOnReviewURL, webhooksSendInputImages, webhooksSendProcessedImages, webhooksStripSpecialCharacters, webhooksURL]);
|
|
1668
|
+
}, [additionalDocuments, bypassAgeValidation, bypassNameMatching, cardData, clientRequestID, companyId, customerDataMatchConfig, deduplicationEnabled, deduplicationSynchronous, documentServiceUrl, enrollmentId, expectedAudioText, geolocationResult, idBackCaptureAttempts, idBackImage, idBackImageRequired, idBackIrImage, idBackUvImage, idCaptureVideoAudioStartsAt, idCaptureVideoAudioUrl, idCaptureVideoIdBackImage, idCaptureVideoIdFrontImage, idCaptureVideoUrl, idCardForFaceMatch, idData, idFrontCaptureAttempts, idFrontImage, idFrontIrImage, idFrontUvImage, idImageResolutionCheck, jobId, manualReviewRequired, needImmediateResponse, passportImage, personalData, selfieCaptureAttempts, selfieImage, signatureData, signatureVideoUrl, uploadDocument, verifyIdWithExternalDatabases, webhooksClientTraceId, webhooksEnabled, webhooksFireOnReview, webhooksFireOnReviewURL, webhooksSendInputImages, webhooksSendProcessedImages, webhooksStripSpecialCharacters, webhooksURL]);
|
|
1666
1669
|
var defaultOnSubmit = useCallback(function () {
|
|
1667
1670
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
1668
1671
|
var submissionResponse_1, payload, host, endpoint, response, statusMessage, submissionResponse_2, e_1, err;
|
|
@@ -1806,6 +1809,9 @@ var SubmissionProvider = function SubmissionProvider(_a) {
|
|
|
1806
1809
|
if (clientRequestID) {
|
|
1807
1810
|
request.additionalData.clientRequestID = clientRequestID;
|
|
1808
1811
|
}
|
|
1812
|
+
if (jobId) {
|
|
1813
|
+
request.additionalData.jobID = jobId;
|
|
1814
|
+
}
|
|
1809
1815
|
if (idCardForFaceMatch) {
|
|
1810
1816
|
request.customerData.idData = {
|
|
1811
1817
|
idImageFront: idCardForFaceMatch
|
|
@@ -1833,7 +1839,7 @@ var SubmissionProvider = function SubmissionProvider(_a) {
|
|
|
1833
1839
|
}
|
|
1834
1840
|
});
|
|
1835
1841
|
});
|
|
1836
|
-
}, [clientRequestID, documentServiceUrl, estimateAge, geolocationResult, idBackCaptureAttempts, idCardForFaceMatch, idFrontCaptureAttempts, predictGender, selfieCaptureAttempts, uploadDocument, useDocumentServiceForLivenessChecks, webhooksStripSpecialCharacters]);
|
|
1842
|
+
}, [clientRequestID, documentServiceUrl, estimateAge, geolocationResult, idBackCaptureAttempts, idCardForFaceMatch, idFrontCaptureAttempts, jobId, predictGender, selfieCaptureAttempts, uploadDocument, useDocumentServiceForLivenessChecks, webhooksStripSpecialCharacters]);
|
|
1837
1843
|
var checkLiveness = useCallback(function (imageDataUrl) {
|
|
1838
1844
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
1839
1845
|
var request, host, endpoint, response, statusMessage, submissionResponse_3, e_2, err;
|
|
@@ -3641,8 +3647,8 @@ function obtainCameraAccess(stream, deviceLabel, video) {
|
|
|
3641
3647
|
release: release
|
|
3642
3648
|
};
|
|
3643
3649
|
log('camera access granted');
|
|
3644
|
-
if (video) video.srcObject = stream
|
|
3645
|
-
log('video source initialized')
|
|
3650
|
+
// if (video) video.srcObject = stream
|
|
3651
|
+
// log('video source initialized')
|
|
3646
3652
|
return currentCamera;
|
|
3647
3653
|
}
|
|
3648
3654
|
function releaseCameraAccess() {
|
|
@@ -4775,24 +4781,24 @@ function useTranslations(verbiage, fallbacks) {
|
|
|
4775
4781
|
}, [fallbacks, i18n.language, t, verbiage]);
|
|
4776
4782
|
}
|
|
4777
4783
|
|
|
4784
|
+
var camera = null;
|
|
4785
|
+
var videoStream = null;
|
|
4786
|
+
var audioStream = null;
|
|
4778
4787
|
var initialState$6 = {
|
|
4779
4788
|
videoRef: {
|
|
4780
4789
|
current: null
|
|
4781
4790
|
},
|
|
4782
4791
|
videoLoaded: false,
|
|
4783
|
-
videoStream: null,
|
|
4784
4792
|
videoDevice: null,
|
|
4785
4793
|
videoWidth: 0,
|
|
4786
4794
|
videoHeight: 0,
|
|
4787
4795
|
isRearFacing: false,
|
|
4788
|
-
camera: null,
|
|
4789
4796
|
cameraReady: false,
|
|
4790
4797
|
cameraAccessDenied: false,
|
|
4791
4798
|
iphoneContinuityCameraAvailable: false,
|
|
4792
4799
|
iphoneContinuityCameraDenied: false,
|
|
4793
4800
|
preferIphoneContinuityCamera: true,
|
|
4794
4801
|
cameraTamperingDetected: false,
|
|
4795
|
-
audioStream: null,
|
|
4796
4802
|
microphoneReady: false,
|
|
4797
4803
|
microphoneAccessDenied: false
|
|
4798
4804
|
};
|
|
@@ -4806,8 +4812,7 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
4806
4812
|
return set(config);
|
|
4807
4813
|
},
|
|
4808
4814
|
onVideoMounted: function onVideoMounted(e) {
|
|
4809
|
-
var
|
|
4810
|
-
var selectedVideoStreamId = (_a = get().videoStream) === null || _a === void 0 ? void 0 : _a.id;
|
|
4815
|
+
var selectedVideoStreamId = videoStream === null || videoStream === void 0 ? void 0 : videoStream.id;
|
|
4811
4816
|
if (!selectedVideoStreamId) return;
|
|
4812
4817
|
var srcObject = e.currentTarget.srcObject;
|
|
4813
4818
|
if (srcObject.id === selectedVideoStreamId) {
|
|
@@ -4827,19 +4832,19 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
4827
4832
|
},
|
|
4828
4833
|
requestCameraAccess: function requestCameraAccess() {
|
|
4829
4834
|
return __awaiter(this, void 0, void 0, function () {
|
|
4830
|
-
var _a, videoRef, releaseCameraAccess, preferFrontFacingCamera, preferIphoneContinuityCamera, iphoneContinuityCameraDenied, availableCameras, selectedCamera, platform_1, iphoneContinuityCamera, constraints, stream_1, e_1, e_2, handleStreamEnded_1, videoTrack_1,
|
|
4831
|
-
var _b, _c, _d;
|
|
4832
|
-
return __generator(this, function (
|
|
4833
|
-
switch (
|
|
4835
|
+
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;
|
|
4836
|
+
var _b, _c, _d, _e;
|
|
4837
|
+
return __generator(this, function (_f) {
|
|
4838
|
+
switch (_f.label) {
|
|
4834
4839
|
case 0:
|
|
4835
4840
|
_a = get(), videoRef = _a.videoRef, releaseCameraAccess = _a.releaseCameraAccess, preferFrontFacingCamera = _a.preferFrontFacingCamera, preferIphoneContinuityCamera = _a.preferIphoneContinuityCamera, iphoneContinuityCameraDenied = _a.iphoneContinuityCameraDenied;
|
|
4836
4841
|
releaseCameraAccess();
|
|
4837
|
-
|
|
4842
|
+
_f.label = 1;
|
|
4838
4843
|
case 1:
|
|
4839
|
-
|
|
4844
|
+
_f.trys.push([1, 11,, 12]);
|
|
4840
4845
|
return [4 /*yield*/, listAvailableCameras()];
|
|
4841
4846
|
case 2:
|
|
4842
|
-
availableCameras =
|
|
4847
|
+
availableCameras = _f.sent();
|
|
4843
4848
|
selectedCamera = void 0;
|
|
4844
4849
|
debug('availableCameras', availableCameras);
|
|
4845
4850
|
platform_1 = getPlatform();
|
|
@@ -4909,16 +4914,16 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
4909
4914
|
};
|
|
4910
4915
|
}
|
|
4911
4916
|
stream_1 = null;
|
|
4912
|
-
|
|
4917
|
+
_f.label = 3;
|
|
4913
4918
|
case 3:
|
|
4914
|
-
|
|
4919
|
+
_f.trys.push([3, 5,, 6]);
|
|
4915
4920
|
debug('obtaining camera access with constraints', constraints);
|
|
4916
4921
|
return [4 /*yield*/, navigator.mediaDevices.getUserMedia(constraints)];
|
|
4917
4922
|
case 4:
|
|
4918
|
-
stream_1 =
|
|
4923
|
+
stream_1 = _f.sent();
|
|
4919
4924
|
return [3 /*break*/, 6];
|
|
4920
4925
|
case 5:
|
|
4921
|
-
e_1 =
|
|
4926
|
+
e_1 = _f.sent();
|
|
4922
4927
|
if (e_1.name === 'NotAllowedError') {
|
|
4923
4928
|
if (preferIphoneContinuityCamera) {
|
|
4924
4929
|
set({
|
|
@@ -4935,19 +4940,19 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
4935
4940
|
return [3 /*break*/, 6];
|
|
4936
4941
|
case 6:
|
|
4937
4942
|
if (!!stream_1) return [3 /*break*/, 10];
|
|
4938
|
-
|
|
4943
|
+
_f.label = 7;
|
|
4939
4944
|
case 7:
|
|
4940
|
-
|
|
4945
|
+
_f.trys.push([7, 9,, 10]);
|
|
4941
4946
|
return [4 /*yield*/, navigator.mediaDevices.getUserMedia({
|
|
4942
4947
|
audio: false,
|
|
4943
4948
|
video: true
|
|
4944
4949
|
})];
|
|
4945
4950
|
case 8:
|
|
4946
|
-
stream_1 =
|
|
4951
|
+
stream_1 = _f.sent();
|
|
4947
4952
|
debug('opened stream with no width and height constraints');
|
|
4948
4953
|
return [3 /*break*/, 10];
|
|
4949
4954
|
case 9:
|
|
4950
|
-
e_2 =
|
|
4955
|
+
e_2 = _f.sent();
|
|
4951
4956
|
debug('cannot open stream at all', e_2);
|
|
4952
4957
|
return [3 /*break*/, 10];
|
|
4953
4958
|
case 10:
|
|
@@ -4959,8 +4964,8 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
4959
4964
|
handleStreamEnded_1 = function handleStreamEnded_1() {
|
|
4960
4965
|
if (preferIphoneContinuityCamera && get().iphoneContinuityCameraAvailable) {
|
|
4961
4966
|
debug('someone unplugged the continuity camera');
|
|
4967
|
+
videoStream = null;
|
|
4962
4968
|
set({
|
|
4963
|
-
videoStream: null,
|
|
4964
4969
|
videoDevice: null,
|
|
4965
4970
|
cameraReady: false,
|
|
4966
4971
|
iphoneContinuityCameraAvailable: false,
|
|
@@ -4969,9 +4974,9 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
4969
4974
|
get().requestCameraAccess();
|
|
4970
4975
|
} else {
|
|
4971
4976
|
debug('someone unplugged the webcam');
|
|
4972
|
-
releaseCameraAccess();
|
|
4977
|
+
get().releaseCameraAccess();
|
|
4978
|
+
videoStream = null;
|
|
4973
4979
|
set({
|
|
4974
|
-
videoStream: null,
|
|
4975
4980
|
videoDevice: null,
|
|
4976
4981
|
videoLoaded: false,
|
|
4977
4982
|
cameraReady: false,
|
|
@@ -4982,25 +4987,26 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
4982
4987
|
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.addEventListener('ended', handleStreamEnded_1);
|
|
4983
4988
|
videoTrack_1 = stream_1.getVideoTracks()[0];
|
|
4984
4989
|
videoTrack_1.onended = handleStreamEnded_1;
|
|
4985
|
-
|
|
4990
|
+
camera = obtainCameraAccess(stream_1, selectedCamera.label, videoRef.current);
|
|
4986
4991
|
setTimeout(function () {
|
|
4992
|
+
var _a;
|
|
4987
4993
|
// iOS 17 has a strange behavior where the video track flickers between muted and unmuted
|
|
4988
4994
|
// when the camera access is being requested. This delay is a workaround for that.
|
|
4989
4995
|
videoTrack_1.onmute = function () {
|
|
4990
4996
|
if (videoTrack_1.readyState !== 'live') handleStreamEnded_1();
|
|
4991
4997
|
};
|
|
4998
|
+
videoStream = stream_1;
|
|
4999
|
+
var isRearFacing = (_a = camera === null || camera === void 0 ? void 0 : camera.isRearFacing) !== null && _a !== void 0 ? _a : false;
|
|
4992
5000
|
set({
|
|
4993
|
-
camera: camera_1,
|
|
4994
5001
|
cameraReady: true,
|
|
4995
5002
|
cameraAccessDenied: false,
|
|
4996
|
-
isRearFacing:
|
|
4997
|
-
videoStream: stream_1
|
|
5003
|
+
isRearFacing: isRearFacing
|
|
4998
5004
|
});
|
|
4999
5005
|
}, 500);
|
|
5000
5006
|
return [3 /*break*/, 12];
|
|
5001
5007
|
case 11:
|
|
5002
|
-
e_3 =
|
|
5003
|
-
if (e_3.name === 'NotAllowedError') {
|
|
5008
|
+
e_3 = _f.sent();
|
|
5009
|
+
if (e_3.name === 'NotAllowedError' || ((_e = e_3.message) === null || _e === void 0 ? void 0 : _e.includes('Could not start video source'))) {
|
|
5004
5010
|
error('camera access has been blocked by the user', e_3);
|
|
5005
5011
|
set({
|
|
5006
5012
|
cameraAccessDenied: true
|
|
@@ -5018,17 +5024,18 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
5018
5024
|
},
|
|
5019
5025
|
releaseCameraAccess: function releaseCameraAccess() {
|
|
5020
5026
|
return __awaiter(this, void 0, void 0, function () {
|
|
5021
|
-
var camera;
|
|
5022
5027
|
return __generator(this, function (_a) {
|
|
5023
|
-
camera = get().camera;
|
|
5024
5028
|
if (!camera) return [2 /*return*/];
|
|
5025
5029
|
camera.release();
|
|
5030
|
+
camera = null;
|
|
5031
|
+
videoStream === null || videoStream === void 0 ? void 0 : videoStream.getTracks().forEach(function (track) {
|
|
5032
|
+
track.stop();
|
|
5033
|
+
});
|
|
5034
|
+
videoStream = null;
|
|
5026
5035
|
set({
|
|
5027
|
-
camera: null,
|
|
5028
5036
|
cameraReady: false,
|
|
5029
5037
|
cameraAccessDenied: false,
|
|
5030
5038
|
videoDevice: null,
|
|
5031
|
-
videoStream: null,
|
|
5032
5039
|
videoLoaded: false
|
|
5033
5040
|
});
|
|
5034
5041
|
return [2 /*return*/];
|
|
@@ -5057,8 +5064,8 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
5057
5064
|
// iOS 17 has a strange behavior where the video track flickers between muted and unmuted
|
|
5058
5065
|
// when the camera access is being requested. This delay is a workaround for that.
|
|
5059
5066
|
setTimeout(function () {
|
|
5067
|
+
audioStream = stream_2;
|
|
5060
5068
|
set({
|
|
5061
|
-
audioStream: stream_2,
|
|
5062
5069
|
microphoneReady: true,
|
|
5063
5070
|
microphoneAccessDenied: false
|
|
5064
5071
|
});
|
|
@@ -5067,6 +5074,7 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
5067
5074
|
microphoneReady: false,
|
|
5068
5075
|
microphoneAccessDenied: true
|
|
5069
5076
|
});
|
|
5077
|
+
get().releaseMicrophoneAccess();
|
|
5070
5078
|
};
|
|
5071
5079
|
var track = stream_2.getAudioTracks()[0];
|
|
5072
5080
|
track.onended = handleStreamEnded;
|
|
@@ -5090,14 +5098,13 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
5090
5098
|
},
|
|
5091
5099
|
releaseMicrophoneAccess: function releaseMicrophoneAccess() {
|
|
5092
5100
|
var _a;
|
|
5093
|
-
var audioStream = get().audioStream;
|
|
5094
5101
|
(_a = audioStream === null || audioStream === void 0 ? void 0 : audioStream.stop) === null || _a === void 0 ? void 0 : _a.call(audioStream);
|
|
5095
5102
|
audioStream === null || audioStream === void 0 ? void 0 : audioStream.getAudioTracks().forEach(function (track) {
|
|
5096
5103
|
var _a;
|
|
5097
5104
|
(_a = track.stop) === null || _a === void 0 ? void 0 : _a.call(track);
|
|
5098
5105
|
});
|
|
5106
|
+
audioStream = null;
|
|
5099
5107
|
set({
|
|
5100
|
-
audioStream: null,
|
|
5101
5108
|
microphoneReady: false,
|
|
5102
5109
|
microphoneAccessDenied: false
|
|
5103
5110
|
});
|
|
@@ -6635,15 +6642,13 @@ var IdCapture = function IdCapture(_a) {
|
|
|
6635
6642
|
_q = _o.height,
|
|
6636
6643
|
height = _q === void 0 ? 1 : _q;
|
|
6637
6644
|
var state = useIdCaptureStore();
|
|
6638
|
-
var
|
|
6639
|
-
|
|
6640
|
-
|
|
6641
|
-
|
|
6642
|
-
|
|
6643
|
-
|
|
6644
|
-
|
|
6645
|
-
focusPredictionTime = _s.focusPredictionTime,
|
|
6646
|
-
getBestFrame = _s.getBestFrame;
|
|
6645
|
+
var isRearFacing = useCameraStore().isRearFacing;
|
|
6646
|
+
var _r = useContext(IdCaptureModelsContext),
|
|
6647
|
+
modelsReady = _r.ready,
|
|
6648
|
+
setThresholds = _r.setThresholds,
|
|
6649
|
+
detectionTime = _r.detectionTime,
|
|
6650
|
+
focusPredictionTime = _r.focusPredictionTime,
|
|
6651
|
+
getBestFrame = _r.getBestFrame;
|
|
6647
6652
|
useEffect(function () {
|
|
6648
6653
|
return dispatchIdCaptureAction({
|
|
6649
6654
|
type: 'captureInitialized'
|
|
@@ -9073,9 +9078,7 @@ var DocumentCaptureStateProvider = function DocumentCaptureStateProvider(_a) {
|
|
|
9073
9078
|
var _c = useReducer(documentCaptureStateReducer, documentCaptureInitialState),
|
|
9074
9079
|
state = _c[0],
|
|
9075
9080
|
dispatch = _c[1];
|
|
9076
|
-
var
|
|
9077
|
-
videoStream = _d.videoStream,
|
|
9078
|
-
videoRef = _d.videoRef;
|
|
9081
|
+
var videoRef = useCameraStore().videoRef;
|
|
9079
9082
|
var uploadDocument = useContext(SubmissionContext).uploadDocument;
|
|
9080
9083
|
var uploadCapturedDocument = useCallback(function (content, filetype) {
|
|
9081
9084
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -9169,7 +9172,7 @@ var DocumentCaptureStateProvider = function DocumentCaptureStateProvider(_a) {
|
|
|
9169
9172
|
}, [onResize]);
|
|
9170
9173
|
var videoTag = videoRef.current;
|
|
9171
9174
|
useEffect(function () {
|
|
9172
|
-
if (!state.capturing
|
|
9175
|
+
if (!state.capturing) return;
|
|
9173
9176
|
function onComplete(content) {
|
|
9174
9177
|
if (!content) return;
|
|
9175
9178
|
var contentUrl = URL.createObjectURL(content);
|
|
@@ -9186,7 +9189,7 @@ var DocumentCaptureStateProvider = function DocumentCaptureStateProvider(_a) {
|
|
|
9186
9189
|
drawToCanvas(canvas, videoTag);
|
|
9187
9190
|
canvas.toBlob(onComplete);
|
|
9188
9191
|
}
|
|
9189
|
-
}, [state.capturing,
|
|
9192
|
+
}, [state.capturing, videoTag]);
|
|
9190
9193
|
var stateWithActions = useMemo(function () {
|
|
9191
9194
|
return _assign(_assign({}, state), {
|
|
9192
9195
|
uploadCapturedDocument: uploadCapturedDocument
|
|
@@ -9315,29 +9318,28 @@ var templateObject_1$u;
|
|
|
9315
9318
|
var CameraVideoTag = function CameraVideoTag(props) {
|
|
9316
9319
|
var _a = useCameraStore(useShallow(function (store) {
|
|
9317
9320
|
return {
|
|
9321
|
+
cameraReady: store.cameraReady,
|
|
9318
9322
|
videoRef: store.videoRef,
|
|
9319
|
-
videoStream: store.videoStream,
|
|
9320
9323
|
onVideoMounted: store.onVideoMounted,
|
|
9321
9324
|
isRearFacing: store.isRearFacing
|
|
9322
9325
|
};
|
|
9323
9326
|
})),
|
|
9327
|
+
cameraReady = _a.cameraReady,
|
|
9324
9328
|
videoRef = _a.videoRef,
|
|
9325
|
-
videoStream = _a.videoStream,
|
|
9326
9329
|
onVideoMounted = _a.onVideoMounted,
|
|
9327
9330
|
isRearFacing = _a.isRearFacing;
|
|
9328
|
-
useEffect(function
|
|
9329
|
-
if (videoRef.current
|
|
9330
|
-
|
|
9331
|
-
|
|
9332
|
-
|
|
9333
|
-
|
|
9334
|
-
}, [videoStream, videoRef]);
|
|
9331
|
+
useEffect(function () {
|
|
9332
|
+
if (!cameraReady || !videoRef.current) return;
|
|
9333
|
+
debug('attaching camera stream to video tag');
|
|
9334
|
+
// eslint-disable-next-line react-compiler/react-compiler
|
|
9335
|
+
videoRef.current.srcObject = videoStream;
|
|
9336
|
+
}, [cameraReady, videoRef]);
|
|
9335
9337
|
return /*#__PURE__*/React__default.createElement(FullscreenVideoTag, _assign({
|
|
9336
9338
|
autoPlay: true,
|
|
9337
9339
|
playsInline: true,
|
|
9338
9340
|
muted: true,
|
|
9339
9341
|
ref: videoRef,
|
|
9340
|
-
|
|
9342
|
+
onCanPlay: onVideoMounted,
|
|
9341
9343
|
"$isRearFacing": isRearFacing
|
|
9342
9344
|
}, props));
|
|
9343
9345
|
};
|
|
@@ -9374,7 +9376,6 @@ var DocumentCaptureScreen = function DocumentCaptureScreen(_a) {
|
|
|
9374
9376
|
content = _k.content,
|
|
9375
9377
|
uploadState = _k.uploadState;
|
|
9376
9378
|
var _l = useCameraStore(),
|
|
9377
|
-
videoStream = _l.videoStream,
|
|
9378
9379
|
cameraReady = _l.cameraReady,
|
|
9379
9380
|
cameraAccessDenied = _l.cameraAccessDenied,
|
|
9380
9381
|
requestCameraAccess = _l.requestCameraAccess;
|
|
@@ -9389,7 +9390,7 @@ var DocumentCaptureScreen = function DocumentCaptureScreen(_a) {
|
|
|
9389
9390
|
// and the user hasn't passed a media blob for the current document...
|
|
9390
9391
|
!cameraAccessRequested &&
|
|
9391
9392
|
// and we haven't already tried to force a camera request...
|
|
9392
|
-
!
|
|
9393
|
+
!cameraReady; // and we don't already have camera access.
|
|
9393
9394
|
useEffect(function requestCameraAccessIfNeeded() {
|
|
9394
9395
|
if (!cameraAccessNeeded) return;
|
|
9395
9396
|
setCameraAccessRequested(true);
|
|
@@ -10814,6 +10815,30 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
10814
10815
|
debugMode: debugMode
|
|
10815
10816
|
})));
|
|
10816
10817
|
};
|
|
10818
|
+
function IdCaptureWizardWithProviders(_a) {
|
|
10819
|
+
var _b, _c, _d, _e, _f, _g;
|
|
10820
|
+
var onCameraAccessDenied = _a.onCameraAccessDenied,
|
|
10821
|
+
onCameraTamperingDetected = _a.onCameraTamperingDetected,
|
|
10822
|
+
onMicrophoneAccessDenied = _a.onMicrophoneAccessDenied,
|
|
10823
|
+
shouldLoadIdCaptureModels = _a.shouldLoadIdCaptureModels,
|
|
10824
|
+
idCaptureProps = __rest(_a, ["onCameraAccessDenied", "onCameraTamperingDetected", "onMicrophoneAccessDenied", "shouldLoadIdCaptureModels"]);
|
|
10825
|
+
return /*#__PURE__*/React__default.createElement(CameraStoreProvider, {
|
|
10826
|
+
onCameraAccessDenied: onCameraAccessDenied,
|
|
10827
|
+
onCameraTamperingDetected: onCameraTamperingDetected,
|
|
10828
|
+
onMicrophoneAccessDenied: onMicrophoneAccessDenied,
|
|
10829
|
+
requestAccessAutomatically: shouldLoadIdCaptureModels,
|
|
10830
|
+
classNames: (_b = idCaptureProps.classNames) === null || _b === void 0 ? void 0 : _b.cameraStoreProvider,
|
|
10831
|
+
verbiage: (_c = idCaptureProps.verbiage) === null || _c === void 0 ? void 0 : _c.cameraStoreProvider
|
|
10832
|
+
}, /*#__PURE__*/React__default.createElement(IdCaptureModelsProvider, {
|
|
10833
|
+
autoStart: false,
|
|
10834
|
+
shouldLoadModels: shouldLoadIdCaptureModels,
|
|
10835
|
+
documentDetectionModelUrl: (_e = (_d = idCaptureProps.assets) === null || _d === void 0 ? void 0 : _d.documentDetectionModelUrl) !== null && _e !== void 0 ? _e : '',
|
|
10836
|
+
focusModelUrl: (_g = (_f = idCaptureProps.assets) === null || _f === void 0 ? void 0 : _f.focusModelUrl) !== null && _g !== void 0 ? _g : '',
|
|
10837
|
+
onModelError: idCaptureProps.onModelError,
|
|
10838
|
+
modelLoadTimeoutMs: idCaptureProps.modelLoadTimeoutMs,
|
|
10839
|
+
allowSinglePageIdCapture: idCaptureProps.allowSinglePageIdCapture
|
|
10840
|
+
}, /*#__PURE__*/React__default.createElement(IdCaptureStateProvider, null, /*#__PURE__*/React__default.createElement(GuideOrientationContextProvider, null, /*#__PURE__*/React__default.createElement(IdCaptureWizard, _assign({}, idCaptureProps))))));
|
|
10841
|
+
}
|
|
10817
10842
|
|
|
10818
10843
|
function SelfieCaptureLoadingGraphic(_a) {
|
|
10819
10844
|
var _b, _c, _d;
|
|
@@ -11827,9 +11852,6 @@ var SelfieCapture = function SelfieCapture(_a) {
|
|
|
11827
11852
|
prediction = _o.prediction,
|
|
11828
11853
|
dispatch = _m[1];
|
|
11829
11854
|
var lastPredictionCanvas = useRef(null);
|
|
11830
|
-
var camera = useCameraStore(useShallow(function (state) {
|
|
11831
|
-
return state.camera;
|
|
11832
|
-
}));
|
|
11833
11855
|
var _p = useContext(SelfieGuidanceModelsContext),
|
|
11834
11856
|
onPredictionMade = _p.onPredictionMade,
|
|
11835
11857
|
canvasRef = _p.canvasRef,
|
|
@@ -13005,6 +13027,26 @@ var FaceLivenessWizard = function FaceLivenessWizard(_a) {
|
|
|
13005
13027
|
waitForIdCaptureModels: waitForIdCaptureModels
|
|
13006
13028
|
})));
|
|
13007
13029
|
};
|
|
13030
|
+
function FaceLivenessWizardWithProviders(_a) {
|
|
13031
|
+
var _b, _c;
|
|
13032
|
+
var onCameraAccessDenied = _a.onCameraAccessDenied,
|
|
13033
|
+
onCameraTamperingDetected = _a.onCameraTamperingDetected,
|
|
13034
|
+
onMicrophoneAccessDenied = _a.onMicrophoneAccessDenied,
|
|
13035
|
+
faceLivenessProps = __rest(_a, ["onCameraAccessDenied", "onCameraTamperingDetected", "onMicrophoneAccessDenied"]);
|
|
13036
|
+
return /*#__PURE__*/React__default.createElement(CameraStoreProvider, {
|
|
13037
|
+
preferFrontFacingCamera: true,
|
|
13038
|
+
preferIphoneContinuityCamera: false,
|
|
13039
|
+
onCameraAccessDenied: onCameraAccessDenied,
|
|
13040
|
+
onCameraTamperingDetected: onCameraTamperingDetected,
|
|
13041
|
+
onMicrophoneAccessDenied: onMicrophoneAccessDenied,
|
|
13042
|
+
classNames: (_b = faceLivenessProps.classNames) === null || _b === void 0 ? void 0 : _b.cameraStoreProvider,
|
|
13043
|
+
verbiage: (_c = faceLivenessProps.verbiage) === null || _c === void 0 ? void 0 : _c.cameraStoreProvider
|
|
13044
|
+
}, /*#__PURE__*/React__default.createElement(SelfieGuidanceModelsProvider, {
|
|
13045
|
+
autoStart: false,
|
|
13046
|
+
onModelError: faceLivenessProps.onModelError,
|
|
13047
|
+
modelLoadTimeoutMs: faceLivenessProps.modelLoadTimeoutMs
|
|
13048
|
+
}, /*#__PURE__*/React__default.createElement(FaceLivenessWizard, _assign({}, faceLivenessProps))));
|
|
13049
|
+
}
|
|
13008
13050
|
|
|
13009
13051
|
var SubmissionSuccess = function SubmissionSuccess() {
|
|
13010
13052
|
var _a = useContext(SubmissionContext),
|
|
@@ -13421,12 +13463,16 @@ var initialState$2 = {
|
|
|
13421
13463
|
};
|
|
13422
13464
|
var useVideoRecorderStore = create()(devtools(function (set, get) {
|
|
13423
13465
|
return _assign(_assign({}, initialState$2), {
|
|
13424
|
-
startRecordingVideo: function startRecordingVideo(
|
|
13466
|
+
startRecordingVideo: function startRecordingVideo(captureAudio) {
|
|
13425
13467
|
var _a, _b, _c;
|
|
13468
|
+
if (captureAudio === void 0) {
|
|
13469
|
+
captureAudio = false;
|
|
13470
|
+
}
|
|
13471
|
+
if (!camera) throw new Error('Camera not found');
|
|
13426
13472
|
var _d = get(),
|
|
13427
13473
|
mergeAVStreams = _d.mergeAVStreams,
|
|
13428
13474
|
startRecordingAudio = _d.startRecordingAudio;
|
|
13429
|
-
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;
|
|
13475
|
+
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;
|
|
13430
13476
|
if (!videoStream) return;
|
|
13431
13477
|
clearVideoChunks();
|
|
13432
13478
|
videoRecorder = null;
|
|
@@ -13454,8 +13500,8 @@ var useVideoRecorderStore = create()(devtools(function (set, get) {
|
|
|
13454
13500
|
// TODO: figure out what to do here
|
|
13455
13501
|
}
|
|
13456
13502
|
}, 100);
|
|
13457
|
-
if (
|
|
13458
|
-
startRecordingAudio(
|
|
13503
|
+
if (captureAudio && !mergeAVStreams) {
|
|
13504
|
+
startRecordingAudio();
|
|
13459
13505
|
}
|
|
13460
13506
|
},
|
|
13461
13507
|
stopRecordingVideo: function stopRecordingVideo() {
|
|
@@ -13466,7 +13512,7 @@ var useVideoRecorderStore = create()(devtools(function (set, get) {
|
|
|
13466
13512
|
videoRecorder === null || videoRecorder === void 0 ? void 0 : videoRecorder.stop(); // if you call this while state === 'inactive', an exception is thrown.
|
|
13467
13513
|
}
|
|
13468
13514
|
},
|
|
13469
|
-
startRecordingAudio: function startRecordingAudio(
|
|
13515
|
+
startRecordingAudio: function startRecordingAudio() {
|
|
13470
13516
|
if (get().mergeAVStreams) return;
|
|
13471
13517
|
if (!audioStream) return;
|
|
13472
13518
|
clearAudioChunks();
|
|
@@ -13600,18 +13646,19 @@ var videoSignatureInitialState = {
|
|
|
13600
13646
|
};
|
|
13601
13647
|
var useVideoSignatureStore = create()(devtools(function (set, get) {
|
|
13602
13648
|
return _assign(_assign({}, videoSignatureInitialState), {
|
|
13603
|
-
startRecording: function startRecording(
|
|
13649
|
+
startRecording: function startRecording(captureAudio) {
|
|
13604
13650
|
var _a;
|
|
13605
13651
|
if (captureAudio === void 0) {
|
|
13606
13652
|
captureAudio = false;
|
|
13607
13653
|
}
|
|
13654
|
+
if (!camera) throw new Error('Camera not found');
|
|
13608
13655
|
// set our flag and clear whatever we have recorded so far.
|
|
13609
13656
|
set({
|
|
13610
13657
|
isRecording: true
|
|
13611
13658
|
});
|
|
13612
13659
|
signatureChunks = [];
|
|
13613
13660
|
// start recording video and audio
|
|
13614
|
-
useVideoRecorderStore.getState().startRecordingVideo(
|
|
13661
|
+
useVideoRecorderStore.getState().startRecordingVideo(captureAudio);
|
|
13615
13662
|
// start recording from the output canvas to capture the signature
|
|
13616
13663
|
var videoStream = get().outputCanvas.current.captureStream(24); // fps
|
|
13617
13664
|
var tracks = [videoStream.getVideoTracks()[0]];
|
|
@@ -13905,14 +13952,10 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
|
|
|
13905
13952
|
debugMode = _l === void 0 ? false : _l;
|
|
13906
13953
|
var _m = useCameraStore(useShallow(function (state) {
|
|
13907
13954
|
return {
|
|
13908
|
-
camera: state.camera,
|
|
13909
|
-
audioStream: state.audioStream,
|
|
13910
13955
|
videoWidth: state.videoWidth,
|
|
13911
13956
|
videoHeight: state.videoHeight
|
|
13912
13957
|
};
|
|
13913
13958
|
})),
|
|
13914
|
-
camera = _m.camera,
|
|
13915
|
-
audioStream = _m.audioStream,
|
|
13916
13959
|
videoWidth = _m.videoWidth,
|
|
13917
13960
|
videoHeight = _m.videoHeight;
|
|
13918
13961
|
var _o = useSelfieGuidanceModelsContext(),
|
|
@@ -13920,8 +13963,6 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
|
|
|
13920
13963
|
startHeadTracking = _o.start,
|
|
13921
13964
|
stopHeadTracking = _o.stop;
|
|
13922
13965
|
var _p = useVideoSignatureStore(),
|
|
13923
|
-
startRecording = _p.startRecording,
|
|
13924
|
-
stopRecording = _p.stopRecording,
|
|
13925
13966
|
clearRecordedData = _p.clearRecordedData,
|
|
13926
13967
|
isRecording = _p.isRecording;
|
|
13927
13968
|
useEffect(function () {
|
|
@@ -13930,10 +13971,11 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
|
|
|
13930
13971
|
});
|
|
13931
13972
|
}, [onSignatureVideoCaptured]);
|
|
13932
13973
|
useEffect(function () {
|
|
13933
|
-
|
|
13934
|
-
|
|
13935
|
-
|
|
13936
|
-
|
|
13974
|
+
useVideoSignatureStore.getState().startRecording(captureAudio);
|
|
13975
|
+
return function () {
|
|
13976
|
+
return useVideoSignatureStore.getState().stopRecording();
|
|
13977
|
+
};
|
|
13978
|
+
}, [captureAudio]);
|
|
13937
13979
|
useEffect(function () {
|
|
13938
13980
|
setTimeout(startHeadTracking, 1);
|
|
13939
13981
|
return stopHeadTracking;
|
|
@@ -13954,7 +13996,7 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
|
|
|
13954
13996
|
setNumFramesWithoutFaces = _s[1];
|
|
13955
13997
|
onHeadTrackingPredictionMade(useThrottledCallback(useCallback(function (_a) {
|
|
13956
13998
|
var face = _a.face;
|
|
13957
|
-
if (
|
|
13999
|
+
if (headTrackingDisabled) return;
|
|
13958
14000
|
var leftEdge = videoWidth * headTrackingBoundaryPercentage;
|
|
13959
14001
|
var rightEdge = videoWidth * (1 - headTrackingBoundaryPercentage);
|
|
13960
14002
|
var topEdge = videoHeight * headTrackingBoundaryPercentage;
|
|
@@ -13965,7 +14007,7 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
|
|
|
13965
14007
|
setNumFramesWithoutFaces(face ? 0 : function (n) {
|
|
13966
14008
|
return n + 1;
|
|
13967
14009
|
});
|
|
13968
|
-
}, [
|
|
14010
|
+
}, [headTrackingBoundaryPercentage, headTrackingBoundaryType, headTrackingDisabled, videoHeight, videoWidth]), 16));
|
|
13969
14011
|
var _t = useResizeObserver(),
|
|
13970
14012
|
ref = _t.ref,
|
|
13971
14013
|
_u = _t.width,
|
|
@@ -14008,7 +14050,7 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
|
|
|
14008
14050
|
face: lastFace,
|
|
14009
14051
|
scaling: debugScalingDetails,
|
|
14010
14052
|
color: headTrackingSatisfied ? 'green' : 'red'
|
|
14011
|
-
}))), /*#__PURE__*/React__default.createElement(DebugStatsPane, null, "Video: ",
|
|
14053
|
+
}))), /*#__PURE__*/React__default.createElement(DebugStatsPane, null, "Video: ", videoWidth, "x", videoHeight, /*#__PURE__*/React__default.createElement("br", null), "Recording: ", isRecording ? 'true' : 'false'))), /*#__PURE__*/React__default.createElement(ExitCaptureButton, {
|
|
14012
14054
|
onClick: onExit,
|
|
14013
14055
|
className: classNames.exitCaptureBtn
|
|
14014
14056
|
}));
|
|
@@ -14514,9 +14556,6 @@ function VideoSignatureWizardGuides(_a) {
|
|
|
14514
14556
|
component = _a.component,
|
|
14515
14557
|
props = __rest(_a, ["status", "restartVideoOnSignaturePadCleared", "captureAudio", "component"]);
|
|
14516
14558
|
var Component = component !== null && component !== void 0 ? component : VideoSignatureGuides;
|
|
14517
|
-
var _d = useCameraStore(),
|
|
14518
|
-
camera = _d.camera,
|
|
14519
|
-
audioStream = _d.audioStream;
|
|
14520
14559
|
var onAcceptBtnClicked = useCallback(function () {
|
|
14521
14560
|
var signaturePad = useVideoSignatureStore.getState().signaturePad;
|
|
14522
14561
|
if (!signaturePad.current) throw new Error('Signature pad not found');
|
|
@@ -14538,11 +14577,11 @@ function VideoSignatureWizardGuides(_a) {
|
|
|
14538
14577
|
setTimeout(function () {
|
|
14539
14578
|
useVideoSignatureStore.getState().clearRecordedData();
|
|
14540
14579
|
setTimeout(function () {
|
|
14541
|
-
useVideoSignatureStore.getState().startRecording(
|
|
14580
|
+
useVideoSignatureStore.getState().startRecording(captureAudio);
|
|
14542
14581
|
}, 100);
|
|
14543
14582
|
}, 100);
|
|
14544
14583
|
}
|
|
14545
|
-
}, [
|
|
14584
|
+
}, [captureAudio, restartVideoOnSignaturePadCleared]);
|
|
14546
14585
|
return /*#__PURE__*/React__default.createElement(Component, _assign({}, props, {
|
|
14547
14586
|
faceGuideStatus: status,
|
|
14548
14587
|
onAcceptBtnClicked: onAcceptBtnClicked,
|
|
@@ -14896,12 +14935,10 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14896
14935
|
_9 = _7.height,
|
|
14897
14936
|
height = _9 === void 0 ? 1 : _9;
|
|
14898
14937
|
var _10 = useCameraStore(),
|
|
14899
|
-
camera = _10.camera,
|
|
14900
14938
|
videoRef = _10.videoRef,
|
|
14901
14939
|
videoLoaded = _10.videoLoaded,
|
|
14902
14940
|
cameraReady = _10.cameraReady,
|
|
14903
14941
|
microphoneReady = _10.microphoneReady,
|
|
14904
|
-
audioStream = _10.audioStream,
|
|
14905
14942
|
isRearFacing = _10.isRearFacing,
|
|
14906
14943
|
releaseCameraAccess = _10.releaseCameraAccess;
|
|
14907
14944
|
var _11 = useState([]),
|
|
@@ -14943,8 +14980,8 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14943
14980
|
countdownRemaining = _18[0],
|
|
14944
14981
|
setCountdownRemaining = _18[1];
|
|
14945
14982
|
useEffect(function () {
|
|
14946
|
-
if (
|
|
14947
|
-
useVideoRecorderStore.getState().startRecordingVideo(
|
|
14983
|
+
if (!isRecordingVideo && !videoUrl) {
|
|
14984
|
+
useVideoRecorderStore.getState().startRecordingVideo();
|
|
14948
14985
|
setVideoStartsAt(new Date());
|
|
14949
14986
|
}
|
|
14950
14987
|
// if the mergeAVStreams flag is present, the audio stream is on the video
|
|
@@ -14955,7 +14992,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14955
14992
|
releaseCameraAccess();
|
|
14956
14993
|
onComplete === null || onComplete === void 0 ? void 0 : onComplete(videoUrl, audioUrl);
|
|
14957
14994
|
}
|
|
14958
|
-
}, [
|
|
14995
|
+
}, [audioUrl, isRecordingVideo, mergeAVStreams, onComplete, readTextPrompt, releaseCameraAccess, videoUrl]);
|
|
14959
14996
|
useEffect(function () {
|
|
14960
14997
|
if (videoRecordingUnintentionallyStopped || audioRecordingUnintentionallyStopped || !!readTextPrompt && !microphoneReady) {
|
|
14961
14998
|
onRecordingFailed === null || onRecordingFailed === void 0 ? void 0 : onRecordingFailed();
|
|
@@ -15050,14 +15087,14 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
15050
15087
|
var _a;
|
|
15051
15088
|
if (translatedText) {
|
|
15052
15089
|
setRequestedAction('READ_TEXT');
|
|
15053
|
-
useVideoRecorderStore.getState().startRecordingAudio(
|
|
15090
|
+
useVideoRecorderStore.getState().startRecordingAudio();
|
|
15054
15091
|
setIdCaptureVideoAudioStartsAt(new Date().getTime() - ((_a = videoStartsAt === null || videoStartsAt === void 0 ? void 0 : videoStartsAt.getTime()) !== null && _a !== void 0 ? _a : 0));
|
|
15055
15092
|
var renderedTranslatedText = typeof translatedText === 'string' ? translatedText : renderToString(translatedText);
|
|
15056
15093
|
setExpectedAudioText(renderedTranslatedText);
|
|
15057
15094
|
} else {
|
|
15058
15095
|
useVideoRecorderStore.getState().stopRecordingVideo();
|
|
15059
15096
|
}
|
|
15060
|
-
}, [
|
|
15097
|
+
}, [setExpectedAudioText, setIdCaptureVideoAudioStartsAt, translatedText, videoStartsAt]);
|
|
15061
15098
|
var frameWidth = (_c = (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.videoWidth) !== null && _c !== void 0 ? _c : 0;
|
|
15062
15099
|
var frameHeight = (_e = (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.videoHeight) !== null && _e !== void 0 ? _e : 0;
|
|
15063
15100
|
var faceBox = face === null || face === void 0 ? void 0 : face.box;
|
|
@@ -15689,36 +15726,36 @@ var VideoIdWizard = function VideoIdWizard(_a) {
|
|
|
15689
15726
|
};
|
|
15690
15727
|
|
|
15691
15728
|
function CompositeWizard(_a) {
|
|
15692
|
-
var _b
|
|
15729
|
+
var _b;
|
|
15693
15730
|
var userChecks = _a.checks,
|
|
15694
|
-
|
|
15695
|
-
idCaptureProps =
|
|
15696
|
-
|
|
15697
|
-
faceLivenessProps =
|
|
15731
|
+
_c = _a.idCaptureProps,
|
|
15732
|
+
idCaptureProps = _c === void 0 ? {} : _c,
|
|
15733
|
+
_d = _a.faceLivenessProps,
|
|
15734
|
+
faceLivenessProps = _d === void 0 ? {} : _d,
|
|
15698
15735
|
additionalDocumentCaptureProps = _a.additionalDocumentCaptureProps,
|
|
15699
|
-
|
|
15700
|
-
signatureCaptureProps =
|
|
15701
|
-
|
|
15702
|
-
videoSignatureCaptureProps =
|
|
15703
|
-
|
|
15704
|
-
videoIdCaptureProps =
|
|
15705
|
-
|
|
15706
|
-
captureSignature =
|
|
15707
|
-
|
|
15708
|
-
captureSignatureVideo =
|
|
15736
|
+
_e = _a.signatureCaptureProps,
|
|
15737
|
+
signatureCaptureProps = _e === void 0 ? {} : _e,
|
|
15738
|
+
_f = _a.videoSignatureCaptureProps,
|
|
15739
|
+
videoSignatureCaptureProps = _f === void 0 ? {} : _f,
|
|
15740
|
+
_g = _a.videoIdCaptureProps,
|
|
15741
|
+
videoIdCaptureProps = _g === void 0 ? {} : _g,
|
|
15742
|
+
_h = _a.captureSignature,
|
|
15743
|
+
captureSignature = _h === void 0 ? false : _h,
|
|
15744
|
+
_j = _a.captureSignatureVideo,
|
|
15745
|
+
captureSignatureVideo = _j === void 0 ? false : _j,
|
|
15709
15746
|
onCameraAccessDenied = _a.onCameraAccessDenied,
|
|
15710
15747
|
onCameraTamperingDetected = _a.onCameraTamperingDetected,
|
|
15711
15748
|
onMicrophoneAccessDenied = _a.onMicrophoneAccessDenied,
|
|
15712
|
-
|
|
15713
|
-
debugMode =
|
|
15714
|
-
var
|
|
15715
|
-
submit =
|
|
15716
|
-
submissionStatus =
|
|
15717
|
-
setSignatureData =
|
|
15718
|
-
setAdditionalDocuments =
|
|
15719
|
-
var
|
|
15720
|
-
checkIndex =
|
|
15721
|
-
setCheckIndex =
|
|
15749
|
+
_k = _a.debugMode,
|
|
15750
|
+
debugMode = _k === void 0 ? false : _k;
|
|
15751
|
+
var _l = useContext(SubmissionContext),
|
|
15752
|
+
submit = _l.submit,
|
|
15753
|
+
submissionStatus = _l.submissionStatus,
|
|
15754
|
+
setSignatureData = _l.setSignatureData,
|
|
15755
|
+
setAdditionalDocuments = _l.setAdditionalDocuments;
|
|
15756
|
+
var _m = useState(0),
|
|
15757
|
+
checkIndex = _m[0],
|
|
15758
|
+
setCheckIndex = _m[1];
|
|
15722
15759
|
var checks = useMemo(function () {
|
|
15723
15760
|
var _a, _b;
|
|
15724
15761
|
var checks = __spreadArray([], userChecks, true);
|
|
@@ -15825,24 +15862,13 @@ function CompositeWizard(_a) {
|
|
|
15825
15862
|
var shouldLoadIdCaptureModels = !(idCaptureProps === null || idCaptureProps === void 0 ? void 0 : idCaptureProps.forceFallbackMode) && !(idCaptureProps === null || idCaptureProps === void 0 ? void 0 : idCaptureProps.allowUploadingDocumentsFromStorage);
|
|
15826
15863
|
switch (checks[checkIndex]) {
|
|
15827
15864
|
case 'IdCapture':
|
|
15828
|
-
return /*#__PURE__*/React__default.createElement(
|
|
15865
|
+
return /*#__PURE__*/React__default.createElement(IdCaptureWizardWithProviders, _assign({}, idCaptureProps, {
|
|
15829
15866
|
onCameraAccessDenied: onCameraAccessDenied,
|
|
15830
15867
|
onCameraTamperingDetected: onCameraTamperingDetected,
|
|
15831
15868
|
onMicrophoneAccessDenied: onMicrophoneAccessDenied,
|
|
15832
|
-
|
|
15833
|
-
classNames: (_c = idCaptureProps.classNames) === null || _c === void 0 ? void 0 : _c.cameraStoreProvider,
|
|
15834
|
-
verbiage: (_d = idCaptureProps.verbiage) === null || _d === void 0 ? void 0 : _d.cameraStoreProvider
|
|
15835
|
-
}, /*#__PURE__*/React__default.createElement(IdCaptureModelsProvider, {
|
|
15836
|
-
autoStart: false,
|
|
15837
|
-
shouldLoadModels: shouldLoadIdCaptureModels,
|
|
15838
|
-
documentDetectionModelUrl: (_f = (_e = idCaptureProps.assets) === null || _e === void 0 ? void 0 : _e.documentDetectionModelUrl) !== null && _f !== void 0 ? _f : '',
|
|
15839
|
-
focusModelUrl: (_h = (_g = idCaptureProps.assets) === null || _g === void 0 ? void 0 : _g.focusModelUrl) !== null && _h !== void 0 ? _h : '',
|
|
15840
|
-
onModelError: idCaptureProps.onModelError,
|
|
15841
|
-
modelLoadTimeoutMs: idCaptureProps.modelLoadTimeoutMs,
|
|
15842
|
-
allowSinglePageIdCapture: idCaptureProps.allowSinglePageIdCapture
|
|
15843
|
-
}, /*#__PURE__*/React__default.createElement(IdCaptureStateProvider, null, /*#__PURE__*/React__default.createElement(GuideOrientationContextProvider, null, /*#__PURE__*/React__default.createElement(IdCaptureWizard, _assign({}, idCaptureProps, {
|
|
15869
|
+
shouldLoadIdCaptureModels: shouldLoadIdCaptureModels,
|
|
15844
15870
|
onSuccess: onIdCaptureSuccess
|
|
15845
|
-
}))
|
|
15871
|
+
}));
|
|
15846
15872
|
case 'VideoIdCapture':
|
|
15847
15873
|
return /*#__PURE__*/React__default.createElement(VideoIdWizard, _assign({}, videoIdCaptureProps, {
|
|
15848
15874
|
onComplete: onVideoIdCaptureComplete,
|
|
@@ -15851,21 +15877,12 @@ function CompositeWizard(_a) {
|
|
|
15851
15877
|
onMicrophoneAccessDenied: onMicrophoneAccessDenied
|
|
15852
15878
|
}));
|
|
15853
15879
|
case 'FaceLiveness':
|
|
15854
|
-
return /*#__PURE__*/React__default.createElement(
|
|
15855
|
-
preferFrontFacingCamera: true,
|
|
15856
|
-
preferIphoneContinuityCamera: false,
|
|
15880
|
+
return /*#__PURE__*/React__default.createElement(FaceLivenessWizardWithProviders, _assign({}, faceLivenessProps, {
|
|
15857
15881
|
onCameraAccessDenied: onCameraAccessDenied,
|
|
15858
15882
|
onCameraTamperingDetected: onCameraTamperingDetected,
|
|
15859
15883
|
onMicrophoneAccessDenied: onMicrophoneAccessDenied,
|
|
15860
|
-
classNames: (_j = faceLivenessProps.classNames) === null || _j === void 0 ? void 0 : _j.cameraStoreProvider,
|
|
15861
|
-
verbiage: (_k = faceLivenessProps.verbiage) === null || _k === void 0 ? void 0 : _k.cameraStoreProvider
|
|
15862
|
-
}, /*#__PURE__*/React__default.createElement(SelfieGuidanceModelsProvider, {
|
|
15863
|
-
autoStart: false,
|
|
15864
|
-
onModelError: faceLivenessProps.onModelError,
|
|
15865
|
-
modelLoadTimeoutMs: faceLivenessProps.modelLoadTimeoutMs
|
|
15866
|
-
}, /*#__PURE__*/React__default.createElement(FaceLivenessWizard, _assign({}, faceLivenessProps, {
|
|
15867
15884
|
onComplete: onFaceLivenessComplete
|
|
15868
|
-
}))
|
|
15885
|
+
}));
|
|
15869
15886
|
case 'SignatureCapture':
|
|
15870
15887
|
return /*#__PURE__*/React__default.createElement(SignatureCapture, _assign({}, signatureCaptureProps, {
|
|
15871
15888
|
onAccept: onSignatureCaptureSuccess
|