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
|
@@ -236,7 +236,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
236
236
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
237
237
|
};
|
|
238
238
|
|
|
239
|
-
var webSdkVersion = '2.3.
|
|
239
|
+
var webSdkVersion = '2.3.60';
|
|
240
240
|
|
|
241
241
|
function getPlatform() {
|
|
242
242
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -1596,6 +1596,9 @@ var SubmissionProvider = function SubmissionProvider(_a) {
|
|
|
1596
1596
|
if (clientRequestID) {
|
|
1597
1597
|
submissionRequest.additionalData.clientRequestID = clientRequestID;
|
|
1598
1598
|
}
|
|
1599
|
+
if (jobId) {
|
|
1600
|
+
submissionRequest.additionalData.jobID = jobId;
|
|
1601
|
+
}
|
|
1599
1602
|
if (documents.idFrontImage) {
|
|
1600
1603
|
submissionRequest.customerData.idData.idImageFront = documents.idFrontImage;
|
|
1601
1604
|
}
|
|
@@ -1693,7 +1696,7 @@ var SubmissionProvider = function SubmissionProvider(_a) {
|
|
|
1693
1696
|
}
|
|
1694
1697
|
});
|
|
1695
1698
|
});
|
|
1696
|
-
}, [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]);
|
|
1699
|
+
}, [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]);
|
|
1697
1700
|
var defaultOnSubmit = React.useCallback(function () {
|
|
1698
1701
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
1699
1702
|
var submissionResponse_1, payload, host, endpoint, response, statusMessage, submissionResponse_2, e_1, err;
|
|
@@ -1837,6 +1840,9 @@ var SubmissionProvider = function SubmissionProvider(_a) {
|
|
|
1837
1840
|
if (clientRequestID) {
|
|
1838
1841
|
request.additionalData.clientRequestID = clientRequestID;
|
|
1839
1842
|
}
|
|
1843
|
+
if (jobId) {
|
|
1844
|
+
request.additionalData.jobID = jobId;
|
|
1845
|
+
}
|
|
1840
1846
|
if (idCardForFaceMatch) {
|
|
1841
1847
|
request.customerData.idData = {
|
|
1842
1848
|
idImageFront: idCardForFaceMatch
|
|
@@ -1864,7 +1870,7 @@ var SubmissionProvider = function SubmissionProvider(_a) {
|
|
|
1864
1870
|
}
|
|
1865
1871
|
});
|
|
1866
1872
|
});
|
|
1867
|
-
}, [clientRequestID, documentServiceUrl, estimateAge, geolocationResult, idBackCaptureAttempts, idCardForFaceMatch, idFrontCaptureAttempts, predictGender, selfieCaptureAttempts, uploadDocument, useDocumentServiceForLivenessChecks, webhooksStripSpecialCharacters]);
|
|
1873
|
+
}, [clientRequestID, documentServiceUrl, estimateAge, geolocationResult, idBackCaptureAttempts, idCardForFaceMatch, idFrontCaptureAttempts, jobId, predictGender, selfieCaptureAttempts, uploadDocument, useDocumentServiceForLivenessChecks, webhooksStripSpecialCharacters]);
|
|
1868
1874
|
var checkLiveness = React.useCallback(function (imageDataUrl) {
|
|
1869
1875
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
1870
1876
|
var request, host, endpoint, response, statusMessage, submissionResponse_3, e_2, err;
|
|
@@ -3672,8 +3678,8 @@ function obtainCameraAccess(stream, deviceLabel, video) {
|
|
|
3672
3678
|
release: release
|
|
3673
3679
|
};
|
|
3674
3680
|
log('camera access granted');
|
|
3675
|
-
if (video) video.srcObject = stream
|
|
3676
|
-
log('video source initialized')
|
|
3681
|
+
// if (video) video.srcObject = stream
|
|
3682
|
+
// log('video source initialized')
|
|
3677
3683
|
return currentCamera;
|
|
3678
3684
|
}
|
|
3679
3685
|
function releaseCameraAccess() {
|
|
@@ -4806,24 +4812,24 @@ function useTranslations(verbiage, fallbacks) {
|
|
|
4806
4812
|
}, [fallbacks, i18n.language, t, verbiage]);
|
|
4807
4813
|
}
|
|
4808
4814
|
|
|
4815
|
+
var camera = null;
|
|
4816
|
+
var videoStream = null;
|
|
4817
|
+
var audioStream = null;
|
|
4809
4818
|
var initialState$6 = {
|
|
4810
4819
|
videoRef: {
|
|
4811
4820
|
current: null
|
|
4812
4821
|
},
|
|
4813
4822
|
videoLoaded: false,
|
|
4814
|
-
videoStream: null,
|
|
4815
4823
|
videoDevice: null,
|
|
4816
4824
|
videoWidth: 0,
|
|
4817
4825
|
videoHeight: 0,
|
|
4818
4826
|
isRearFacing: false,
|
|
4819
|
-
camera: null,
|
|
4820
4827
|
cameraReady: false,
|
|
4821
4828
|
cameraAccessDenied: false,
|
|
4822
4829
|
iphoneContinuityCameraAvailable: false,
|
|
4823
4830
|
iphoneContinuityCameraDenied: false,
|
|
4824
4831
|
preferIphoneContinuityCamera: true,
|
|
4825
4832
|
cameraTamperingDetected: false,
|
|
4826
|
-
audioStream: null,
|
|
4827
4833
|
microphoneReady: false,
|
|
4828
4834
|
microphoneAccessDenied: false
|
|
4829
4835
|
};
|
|
@@ -4837,8 +4843,7 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
4837
4843
|
return set(config);
|
|
4838
4844
|
},
|
|
4839
4845
|
onVideoMounted: function onVideoMounted(e) {
|
|
4840
|
-
var
|
|
4841
|
-
var selectedVideoStreamId = (_a = get().videoStream) === null || _a === void 0 ? void 0 : _a.id;
|
|
4846
|
+
var selectedVideoStreamId = videoStream === null || videoStream === void 0 ? void 0 : videoStream.id;
|
|
4842
4847
|
if (!selectedVideoStreamId) return;
|
|
4843
4848
|
var srcObject = e.currentTarget.srcObject;
|
|
4844
4849
|
if (srcObject.id === selectedVideoStreamId) {
|
|
@@ -4858,19 +4863,19 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
4858
4863
|
},
|
|
4859
4864
|
requestCameraAccess: function requestCameraAccess() {
|
|
4860
4865
|
return __awaiter(this, void 0, void 0, function () {
|
|
4861
|
-
var _a, videoRef, releaseCameraAccess, preferFrontFacingCamera, preferIphoneContinuityCamera, iphoneContinuityCameraDenied, availableCameras, selectedCamera, platform_1, iphoneContinuityCamera, constraints, stream_1, e_1, e_2, handleStreamEnded_1, videoTrack_1,
|
|
4862
|
-
var _b, _c, _d;
|
|
4863
|
-
return __generator(this, function (
|
|
4864
|
-
switch (
|
|
4866
|
+
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;
|
|
4867
|
+
var _b, _c, _d, _e;
|
|
4868
|
+
return __generator(this, function (_f) {
|
|
4869
|
+
switch (_f.label) {
|
|
4865
4870
|
case 0:
|
|
4866
4871
|
_a = get(), videoRef = _a.videoRef, releaseCameraAccess = _a.releaseCameraAccess, preferFrontFacingCamera = _a.preferFrontFacingCamera, preferIphoneContinuityCamera = _a.preferIphoneContinuityCamera, iphoneContinuityCameraDenied = _a.iphoneContinuityCameraDenied;
|
|
4867
4872
|
releaseCameraAccess();
|
|
4868
|
-
|
|
4873
|
+
_f.label = 1;
|
|
4869
4874
|
case 1:
|
|
4870
|
-
|
|
4875
|
+
_f.trys.push([1, 11,, 12]);
|
|
4871
4876
|
return [4 /*yield*/, listAvailableCameras()];
|
|
4872
4877
|
case 2:
|
|
4873
|
-
availableCameras =
|
|
4878
|
+
availableCameras = _f.sent();
|
|
4874
4879
|
selectedCamera = void 0;
|
|
4875
4880
|
debug('availableCameras', availableCameras);
|
|
4876
4881
|
platform_1 = getPlatform();
|
|
@@ -4940,16 +4945,16 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
4940
4945
|
};
|
|
4941
4946
|
}
|
|
4942
4947
|
stream_1 = null;
|
|
4943
|
-
|
|
4948
|
+
_f.label = 3;
|
|
4944
4949
|
case 3:
|
|
4945
|
-
|
|
4950
|
+
_f.trys.push([3, 5,, 6]);
|
|
4946
4951
|
debug('obtaining camera access with constraints', constraints);
|
|
4947
4952
|
return [4 /*yield*/, navigator.mediaDevices.getUserMedia(constraints)];
|
|
4948
4953
|
case 4:
|
|
4949
|
-
stream_1 =
|
|
4954
|
+
stream_1 = _f.sent();
|
|
4950
4955
|
return [3 /*break*/, 6];
|
|
4951
4956
|
case 5:
|
|
4952
|
-
e_1 =
|
|
4957
|
+
e_1 = _f.sent();
|
|
4953
4958
|
if (e_1.name === 'NotAllowedError') {
|
|
4954
4959
|
if (preferIphoneContinuityCamera) {
|
|
4955
4960
|
set({
|
|
@@ -4966,19 +4971,19 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
4966
4971
|
return [3 /*break*/, 6];
|
|
4967
4972
|
case 6:
|
|
4968
4973
|
if (!!stream_1) return [3 /*break*/, 10];
|
|
4969
|
-
|
|
4974
|
+
_f.label = 7;
|
|
4970
4975
|
case 7:
|
|
4971
|
-
|
|
4976
|
+
_f.trys.push([7, 9,, 10]);
|
|
4972
4977
|
return [4 /*yield*/, navigator.mediaDevices.getUserMedia({
|
|
4973
4978
|
audio: false,
|
|
4974
4979
|
video: true
|
|
4975
4980
|
})];
|
|
4976
4981
|
case 8:
|
|
4977
|
-
stream_1 =
|
|
4982
|
+
stream_1 = _f.sent();
|
|
4978
4983
|
debug('opened stream with no width and height constraints');
|
|
4979
4984
|
return [3 /*break*/, 10];
|
|
4980
4985
|
case 9:
|
|
4981
|
-
e_2 =
|
|
4986
|
+
e_2 = _f.sent();
|
|
4982
4987
|
debug('cannot open stream at all', e_2);
|
|
4983
4988
|
return [3 /*break*/, 10];
|
|
4984
4989
|
case 10:
|
|
@@ -4990,8 +4995,8 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
4990
4995
|
handleStreamEnded_1 = function handleStreamEnded_1() {
|
|
4991
4996
|
if (preferIphoneContinuityCamera && get().iphoneContinuityCameraAvailable) {
|
|
4992
4997
|
debug('someone unplugged the continuity camera');
|
|
4998
|
+
videoStream = null;
|
|
4993
4999
|
set({
|
|
4994
|
-
videoStream: null,
|
|
4995
5000
|
videoDevice: null,
|
|
4996
5001
|
cameraReady: false,
|
|
4997
5002
|
iphoneContinuityCameraAvailable: false,
|
|
@@ -5000,9 +5005,9 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
5000
5005
|
get().requestCameraAccess();
|
|
5001
5006
|
} else {
|
|
5002
5007
|
debug('someone unplugged the webcam');
|
|
5003
|
-
releaseCameraAccess();
|
|
5008
|
+
get().releaseCameraAccess();
|
|
5009
|
+
videoStream = null;
|
|
5004
5010
|
set({
|
|
5005
|
-
videoStream: null,
|
|
5006
5011
|
videoDevice: null,
|
|
5007
5012
|
videoLoaded: false,
|
|
5008
5013
|
cameraReady: false,
|
|
@@ -5013,25 +5018,26 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
5013
5018
|
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.addEventListener('ended', handleStreamEnded_1);
|
|
5014
5019
|
videoTrack_1 = stream_1.getVideoTracks()[0];
|
|
5015
5020
|
videoTrack_1.onended = handleStreamEnded_1;
|
|
5016
|
-
|
|
5021
|
+
camera = obtainCameraAccess(stream_1, selectedCamera.label, videoRef.current);
|
|
5017
5022
|
setTimeout(function () {
|
|
5023
|
+
var _a;
|
|
5018
5024
|
// iOS 17 has a strange behavior where the video track flickers between muted and unmuted
|
|
5019
5025
|
// when the camera access is being requested. This delay is a workaround for that.
|
|
5020
5026
|
videoTrack_1.onmute = function () {
|
|
5021
5027
|
if (videoTrack_1.readyState !== 'live') handleStreamEnded_1();
|
|
5022
5028
|
};
|
|
5029
|
+
videoStream = stream_1;
|
|
5030
|
+
var isRearFacing = (_a = camera === null || camera === void 0 ? void 0 : camera.isRearFacing) !== null && _a !== void 0 ? _a : false;
|
|
5023
5031
|
set({
|
|
5024
|
-
camera: camera_1,
|
|
5025
5032
|
cameraReady: true,
|
|
5026
5033
|
cameraAccessDenied: false,
|
|
5027
|
-
isRearFacing:
|
|
5028
|
-
videoStream: stream_1
|
|
5034
|
+
isRearFacing: isRearFacing
|
|
5029
5035
|
});
|
|
5030
5036
|
}, 500);
|
|
5031
5037
|
return [3 /*break*/, 12];
|
|
5032
5038
|
case 11:
|
|
5033
|
-
e_3 =
|
|
5034
|
-
if (e_3.name === 'NotAllowedError') {
|
|
5039
|
+
e_3 = _f.sent();
|
|
5040
|
+
if (e_3.name === 'NotAllowedError' || ((_e = e_3.message) === null || _e === void 0 ? void 0 : _e.includes('Could not start video source'))) {
|
|
5035
5041
|
error('camera access has been blocked by the user', e_3);
|
|
5036
5042
|
set({
|
|
5037
5043
|
cameraAccessDenied: true
|
|
@@ -5049,17 +5055,18 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
5049
5055
|
},
|
|
5050
5056
|
releaseCameraAccess: function releaseCameraAccess() {
|
|
5051
5057
|
return __awaiter(this, void 0, void 0, function () {
|
|
5052
|
-
var camera;
|
|
5053
5058
|
return __generator(this, function (_a) {
|
|
5054
|
-
camera = get().camera;
|
|
5055
5059
|
if (!camera) return [2 /*return*/];
|
|
5056
5060
|
camera.release();
|
|
5061
|
+
camera = null;
|
|
5062
|
+
videoStream === null || videoStream === void 0 ? void 0 : videoStream.getTracks().forEach(function (track) {
|
|
5063
|
+
track.stop();
|
|
5064
|
+
});
|
|
5065
|
+
videoStream = null;
|
|
5057
5066
|
set({
|
|
5058
|
-
camera: null,
|
|
5059
5067
|
cameraReady: false,
|
|
5060
5068
|
cameraAccessDenied: false,
|
|
5061
5069
|
videoDevice: null,
|
|
5062
|
-
videoStream: null,
|
|
5063
5070
|
videoLoaded: false
|
|
5064
5071
|
});
|
|
5065
5072
|
return [2 /*return*/];
|
|
@@ -5088,8 +5095,8 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
5088
5095
|
// iOS 17 has a strange behavior where the video track flickers between muted and unmuted
|
|
5089
5096
|
// when the camera access is being requested. This delay is a workaround for that.
|
|
5090
5097
|
setTimeout(function () {
|
|
5098
|
+
audioStream = stream_2;
|
|
5091
5099
|
set({
|
|
5092
|
-
audioStream: stream_2,
|
|
5093
5100
|
microphoneReady: true,
|
|
5094
5101
|
microphoneAccessDenied: false
|
|
5095
5102
|
});
|
|
@@ -5098,6 +5105,7 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
5098
5105
|
microphoneReady: false,
|
|
5099
5106
|
microphoneAccessDenied: true
|
|
5100
5107
|
});
|
|
5108
|
+
get().releaseMicrophoneAccess();
|
|
5101
5109
|
};
|
|
5102
5110
|
var track = stream_2.getAudioTracks()[0];
|
|
5103
5111
|
track.onended = handleStreamEnded;
|
|
@@ -5121,14 +5129,13 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
5121
5129
|
},
|
|
5122
5130
|
releaseMicrophoneAccess: function releaseMicrophoneAccess() {
|
|
5123
5131
|
var _a;
|
|
5124
|
-
var audioStream = get().audioStream;
|
|
5125
5132
|
(_a = audioStream === null || audioStream === void 0 ? void 0 : audioStream.stop) === null || _a === void 0 ? void 0 : _a.call(audioStream);
|
|
5126
5133
|
audioStream === null || audioStream === void 0 ? void 0 : audioStream.getAudioTracks().forEach(function (track) {
|
|
5127
5134
|
var _a;
|
|
5128
5135
|
(_a = track.stop) === null || _a === void 0 ? void 0 : _a.call(track);
|
|
5129
5136
|
});
|
|
5137
|
+
audioStream = null;
|
|
5130
5138
|
set({
|
|
5131
|
-
audioStream: null,
|
|
5132
5139
|
microphoneReady: false,
|
|
5133
5140
|
microphoneAccessDenied: false
|
|
5134
5141
|
});
|
|
@@ -6666,15 +6673,13 @@ var IdCapture = function IdCapture(_a) {
|
|
|
6666
6673
|
_q = _o.height,
|
|
6667
6674
|
height = _q === void 0 ? 1 : _q;
|
|
6668
6675
|
var state = useIdCaptureStore();
|
|
6669
|
-
var
|
|
6670
|
-
|
|
6671
|
-
|
|
6672
|
-
|
|
6673
|
-
|
|
6674
|
-
|
|
6675
|
-
|
|
6676
|
-
focusPredictionTime = _s.focusPredictionTime,
|
|
6677
|
-
getBestFrame = _s.getBestFrame;
|
|
6676
|
+
var isRearFacing = useCameraStore().isRearFacing;
|
|
6677
|
+
var _r = React.useContext(IdCaptureModelsContext),
|
|
6678
|
+
modelsReady = _r.ready,
|
|
6679
|
+
setThresholds = _r.setThresholds,
|
|
6680
|
+
detectionTime = _r.detectionTime,
|
|
6681
|
+
focusPredictionTime = _r.focusPredictionTime,
|
|
6682
|
+
getBestFrame = _r.getBestFrame;
|
|
6678
6683
|
React.useEffect(function () {
|
|
6679
6684
|
return dispatchIdCaptureAction({
|
|
6680
6685
|
type: 'captureInitialized'
|
|
@@ -9104,9 +9109,7 @@ var DocumentCaptureStateProvider = function DocumentCaptureStateProvider(_a) {
|
|
|
9104
9109
|
var _c = React.useReducer(documentCaptureStateReducer, documentCaptureInitialState),
|
|
9105
9110
|
state = _c[0],
|
|
9106
9111
|
dispatch = _c[1];
|
|
9107
|
-
var
|
|
9108
|
-
videoStream = _d.videoStream,
|
|
9109
|
-
videoRef = _d.videoRef;
|
|
9112
|
+
var videoRef = useCameraStore().videoRef;
|
|
9110
9113
|
var uploadDocument = React.useContext(SubmissionContext).uploadDocument;
|
|
9111
9114
|
var uploadCapturedDocument = React.useCallback(function (content, filetype) {
|
|
9112
9115
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -9200,7 +9203,7 @@ var DocumentCaptureStateProvider = function DocumentCaptureStateProvider(_a) {
|
|
|
9200
9203
|
}, [onResize]);
|
|
9201
9204
|
var videoTag = videoRef.current;
|
|
9202
9205
|
React.useEffect(function () {
|
|
9203
|
-
if (!state.capturing
|
|
9206
|
+
if (!state.capturing) return;
|
|
9204
9207
|
function onComplete(content) {
|
|
9205
9208
|
if (!content) return;
|
|
9206
9209
|
var contentUrl = URL.createObjectURL(content);
|
|
@@ -9217,7 +9220,7 @@ var DocumentCaptureStateProvider = function DocumentCaptureStateProvider(_a) {
|
|
|
9217
9220
|
drawToCanvas(canvas, videoTag);
|
|
9218
9221
|
canvas.toBlob(onComplete);
|
|
9219
9222
|
}
|
|
9220
|
-
}, [state.capturing,
|
|
9223
|
+
}, [state.capturing, videoTag]);
|
|
9221
9224
|
var stateWithActions = React.useMemo(function () {
|
|
9222
9225
|
return _assign(_assign({}, state), {
|
|
9223
9226
|
uploadCapturedDocument: uploadCapturedDocument
|
|
@@ -9346,29 +9349,28 @@ var templateObject_1$u;
|
|
|
9346
9349
|
var CameraVideoTag = function CameraVideoTag(props) {
|
|
9347
9350
|
var _a = useCameraStore(shallow.useShallow(function (store) {
|
|
9348
9351
|
return {
|
|
9352
|
+
cameraReady: store.cameraReady,
|
|
9349
9353
|
videoRef: store.videoRef,
|
|
9350
|
-
videoStream: store.videoStream,
|
|
9351
9354
|
onVideoMounted: store.onVideoMounted,
|
|
9352
9355
|
isRearFacing: store.isRearFacing
|
|
9353
9356
|
};
|
|
9354
9357
|
})),
|
|
9358
|
+
cameraReady = _a.cameraReady,
|
|
9355
9359
|
videoRef = _a.videoRef,
|
|
9356
|
-
videoStream = _a.videoStream,
|
|
9357
9360
|
onVideoMounted = _a.onVideoMounted,
|
|
9358
9361
|
isRearFacing = _a.isRearFacing;
|
|
9359
|
-
React.useEffect(function
|
|
9360
|
-
if (videoRef.current
|
|
9361
|
-
|
|
9362
|
-
|
|
9363
|
-
|
|
9364
|
-
|
|
9365
|
-
}, [videoStream, videoRef]);
|
|
9362
|
+
React.useEffect(function () {
|
|
9363
|
+
if (!cameraReady || !videoRef.current) return;
|
|
9364
|
+
debug('attaching camera stream to video tag');
|
|
9365
|
+
// eslint-disable-next-line react-compiler/react-compiler
|
|
9366
|
+
videoRef.current.srcObject = videoStream;
|
|
9367
|
+
}, [cameraReady, videoRef]);
|
|
9366
9368
|
return /*#__PURE__*/React__namespace.default.createElement(FullscreenVideoTag, _assign({
|
|
9367
9369
|
autoPlay: true,
|
|
9368
9370
|
playsInline: true,
|
|
9369
9371
|
muted: true,
|
|
9370
9372
|
ref: videoRef,
|
|
9371
|
-
|
|
9373
|
+
onCanPlay: onVideoMounted,
|
|
9372
9374
|
"$isRearFacing": isRearFacing
|
|
9373
9375
|
}, props));
|
|
9374
9376
|
};
|
|
@@ -9405,7 +9407,6 @@ var DocumentCaptureScreen = function DocumentCaptureScreen(_a) {
|
|
|
9405
9407
|
content = _k.content,
|
|
9406
9408
|
uploadState = _k.uploadState;
|
|
9407
9409
|
var _l = useCameraStore(),
|
|
9408
|
-
videoStream = _l.videoStream,
|
|
9409
9410
|
cameraReady = _l.cameraReady,
|
|
9410
9411
|
cameraAccessDenied = _l.cameraAccessDenied,
|
|
9411
9412
|
requestCameraAccess = _l.requestCameraAccess;
|
|
@@ -9420,7 +9421,7 @@ var DocumentCaptureScreen = function DocumentCaptureScreen(_a) {
|
|
|
9420
9421
|
// and the user hasn't passed a media blob for the current document...
|
|
9421
9422
|
!cameraAccessRequested &&
|
|
9422
9423
|
// and we haven't already tried to force a camera request...
|
|
9423
|
-
!
|
|
9424
|
+
!cameraReady; // and we don't already have camera access.
|
|
9424
9425
|
React.useEffect(function requestCameraAccessIfNeeded() {
|
|
9425
9426
|
if (!cameraAccessNeeded) return;
|
|
9426
9427
|
setCameraAccessRequested(true);
|
|
@@ -10845,6 +10846,30 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
10845
10846
|
debugMode: debugMode
|
|
10846
10847
|
})));
|
|
10847
10848
|
};
|
|
10849
|
+
function IdCaptureWizardWithProviders(_a) {
|
|
10850
|
+
var _b, _c, _d, _e, _f, _g;
|
|
10851
|
+
var onCameraAccessDenied = _a.onCameraAccessDenied,
|
|
10852
|
+
onCameraTamperingDetected = _a.onCameraTamperingDetected,
|
|
10853
|
+
onMicrophoneAccessDenied = _a.onMicrophoneAccessDenied,
|
|
10854
|
+
shouldLoadIdCaptureModels = _a.shouldLoadIdCaptureModels,
|
|
10855
|
+
idCaptureProps = __rest(_a, ["onCameraAccessDenied", "onCameraTamperingDetected", "onMicrophoneAccessDenied", "shouldLoadIdCaptureModels"]);
|
|
10856
|
+
return /*#__PURE__*/React__namespace.default.createElement(CameraStoreProvider, {
|
|
10857
|
+
onCameraAccessDenied: onCameraAccessDenied,
|
|
10858
|
+
onCameraTamperingDetected: onCameraTamperingDetected,
|
|
10859
|
+
onMicrophoneAccessDenied: onMicrophoneAccessDenied,
|
|
10860
|
+
requestAccessAutomatically: shouldLoadIdCaptureModels,
|
|
10861
|
+
classNames: (_b = idCaptureProps.classNames) === null || _b === void 0 ? void 0 : _b.cameraStoreProvider,
|
|
10862
|
+
verbiage: (_c = idCaptureProps.verbiage) === null || _c === void 0 ? void 0 : _c.cameraStoreProvider
|
|
10863
|
+
}, /*#__PURE__*/React__namespace.default.createElement(IdCaptureModelsProvider, {
|
|
10864
|
+
autoStart: false,
|
|
10865
|
+
shouldLoadModels: shouldLoadIdCaptureModels,
|
|
10866
|
+
documentDetectionModelUrl: (_e = (_d = idCaptureProps.assets) === null || _d === void 0 ? void 0 : _d.documentDetectionModelUrl) !== null && _e !== void 0 ? _e : '',
|
|
10867
|
+
focusModelUrl: (_g = (_f = idCaptureProps.assets) === null || _f === void 0 ? void 0 : _f.focusModelUrl) !== null && _g !== void 0 ? _g : '',
|
|
10868
|
+
onModelError: idCaptureProps.onModelError,
|
|
10869
|
+
modelLoadTimeoutMs: idCaptureProps.modelLoadTimeoutMs,
|
|
10870
|
+
allowSinglePageIdCapture: idCaptureProps.allowSinglePageIdCapture
|
|
10871
|
+
}, /*#__PURE__*/React__namespace.default.createElement(IdCaptureStateProvider, null, /*#__PURE__*/React__namespace.default.createElement(GuideOrientationContextProvider, null, /*#__PURE__*/React__namespace.default.createElement(IdCaptureWizard, _assign({}, idCaptureProps))))));
|
|
10872
|
+
}
|
|
10848
10873
|
|
|
10849
10874
|
function SelfieCaptureLoadingGraphic(_a) {
|
|
10850
10875
|
var _b, _c, _d;
|
|
@@ -11858,9 +11883,6 @@ var SelfieCapture = function SelfieCapture(_a) {
|
|
|
11858
11883
|
prediction = _o.prediction,
|
|
11859
11884
|
dispatch = _m[1];
|
|
11860
11885
|
var lastPredictionCanvas = React.useRef(null);
|
|
11861
|
-
var camera = useCameraStore(shallow.useShallow(function (state) {
|
|
11862
|
-
return state.camera;
|
|
11863
|
-
}));
|
|
11864
11886
|
var _p = React.useContext(SelfieGuidanceModelsContext),
|
|
11865
11887
|
onPredictionMade = _p.onPredictionMade,
|
|
11866
11888
|
canvasRef = _p.canvasRef,
|
|
@@ -13036,6 +13058,26 @@ var FaceLivenessWizard = function FaceLivenessWizard(_a) {
|
|
|
13036
13058
|
waitForIdCaptureModels: waitForIdCaptureModels
|
|
13037
13059
|
})));
|
|
13038
13060
|
};
|
|
13061
|
+
function FaceLivenessWizardWithProviders(_a) {
|
|
13062
|
+
var _b, _c;
|
|
13063
|
+
var onCameraAccessDenied = _a.onCameraAccessDenied,
|
|
13064
|
+
onCameraTamperingDetected = _a.onCameraTamperingDetected,
|
|
13065
|
+
onMicrophoneAccessDenied = _a.onMicrophoneAccessDenied,
|
|
13066
|
+
faceLivenessProps = __rest(_a, ["onCameraAccessDenied", "onCameraTamperingDetected", "onMicrophoneAccessDenied"]);
|
|
13067
|
+
return /*#__PURE__*/React__namespace.default.createElement(CameraStoreProvider, {
|
|
13068
|
+
preferFrontFacingCamera: true,
|
|
13069
|
+
preferIphoneContinuityCamera: false,
|
|
13070
|
+
onCameraAccessDenied: onCameraAccessDenied,
|
|
13071
|
+
onCameraTamperingDetected: onCameraTamperingDetected,
|
|
13072
|
+
onMicrophoneAccessDenied: onMicrophoneAccessDenied,
|
|
13073
|
+
classNames: (_b = faceLivenessProps.classNames) === null || _b === void 0 ? void 0 : _b.cameraStoreProvider,
|
|
13074
|
+
verbiage: (_c = faceLivenessProps.verbiage) === null || _c === void 0 ? void 0 : _c.cameraStoreProvider
|
|
13075
|
+
}, /*#__PURE__*/React__namespace.default.createElement(SelfieGuidanceModelsProvider, {
|
|
13076
|
+
autoStart: false,
|
|
13077
|
+
onModelError: faceLivenessProps.onModelError,
|
|
13078
|
+
modelLoadTimeoutMs: faceLivenessProps.modelLoadTimeoutMs
|
|
13079
|
+
}, /*#__PURE__*/React__namespace.default.createElement(FaceLivenessWizard, _assign({}, faceLivenessProps))));
|
|
13080
|
+
}
|
|
13039
13081
|
|
|
13040
13082
|
var SubmissionSuccess = function SubmissionSuccess() {
|
|
13041
13083
|
var _a = React.useContext(SubmissionContext),
|
|
@@ -13452,12 +13494,16 @@ var initialState$2 = {
|
|
|
13452
13494
|
};
|
|
13453
13495
|
var useVideoRecorderStore = zustand.create()(middleware.devtools(function (set, get) {
|
|
13454
13496
|
return _assign(_assign({}, initialState$2), {
|
|
13455
|
-
startRecordingVideo: function startRecordingVideo(
|
|
13497
|
+
startRecordingVideo: function startRecordingVideo(captureAudio) {
|
|
13456
13498
|
var _a, _b, _c;
|
|
13499
|
+
if (captureAudio === void 0) {
|
|
13500
|
+
captureAudio = false;
|
|
13501
|
+
}
|
|
13502
|
+
if (!camera) throw new Error('Camera not found');
|
|
13457
13503
|
var _d = get(),
|
|
13458
13504
|
mergeAVStreams = _d.mergeAVStreams,
|
|
13459
13505
|
startRecordingAudio = _d.startRecordingAudio;
|
|
13460
|
-
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;
|
|
13506
|
+
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;
|
|
13461
13507
|
if (!videoStream) return;
|
|
13462
13508
|
clearVideoChunks();
|
|
13463
13509
|
videoRecorder = null;
|
|
@@ -13485,8 +13531,8 @@ var useVideoRecorderStore = zustand.create()(middleware.devtools(function (set,
|
|
|
13485
13531
|
// TODO: figure out what to do here
|
|
13486
13532
|
}
|
|
13487
13533
|
}, 100);
|
|
13488
|
-
if (
|
|
13489
|
-
startRecordingAudio(
|
|
13534
|
+
if (captureAudio && !mergeAVStreams) {
|
|
13535
|
+
startRecordingAudio();
|
|
13490
13536
|
}
|
|
13491
13537
|
},
|
|
13492
13538
|
stopRecordingVideo: function stopRecordingVideo() {
|
|
@@ -13497,7 +13543,7 @@ var useVideoRecorderStore = zustand.create()(middleware.devtools(function (set,
|
|
|
13497
13543
|
videoRecorder === null || videoRecorder === void 0 ? void 0 : videoRecorder.stop(); // if you call this while state === 'inactive', an exception is thrown.
|
|
13498
13544
|
}
|
|
13499
13545
|
},
|
|
13500
|
-
startRecordingAudio: function startRecordingAudio(
|
|
13546
|
+
startRecordingAudio: function startRecordingAudio() {
|
|
13501
13547
|
if (get().mergeAVStreams) return;
|
|
13502
13548
|
if (!audioStream) return;
|
|
13503
13549
|
clearAudioChunks();
|
|
@@ -13631,18 +13677,19 @@ var videoSignatureInitialState = {
|
|
|
13631
13677
|
};
|
|
13632
13678
|
var useVideoSignatureStore = zustand.create()(middleware.devtools(function (set, get) {
|
|
13633
13679
|
return _assign(_assign({}, videoSignatureInitialState), {
|
|
13634
|
-
startRecording: function startRecording(
|
|
13680
|
+
startRecording: function startRecording(captureAudio) {
|
|
13635
13681
|
var _a;
|
|
13636
13682
|
if (captureAudio === void 0) {
|
|
13637
13683
|
captureAudio = false;
|
|
13638
13684
|
}
|
|
13685
|
+
if (!camera) throw new Error('Camera not found');
|
|
13639
13686
|
// set our flag and clear whatever we have recorded so far.
|
|
13640
13687
|
set({
|
|
13641
13688
|
isRecording: true
|
|
13642
13689
|
});
|
|
13643
13690
|
signatureChunks = [];
|
|
13644
13691
|
// start recording video and audio
|
|
13645
|
-
useVideoRecorderStore.getState().startRecordingVideo(
|
|
13692
|
+
useVideoRecorderStore.getState().startRecordingVideo(captureAudio);
|
|
13646
13693
|
// start recording from the output canvas to capture the signature
|
|
13647
13694
|
var videoStream = get().outputCanvas.current.captureStream(24); // fps
|
|
13648
13695
|
var tracks = [videoStream.getVideoTracks()[0]];
|
|
@@ -13936,14 +13983,10 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
|
|
|
13936
13983
|
debugMode = _l === void 0 ? false : _l;
|
|
13937
13984
|
var _m = useCameraStore(shallow.useShallow(function (state) {
|
|
13938
13985
|
return {
|
|
13939
|
-
camera: state.camera,
|
|
13940
|
-
audioStream: state.audioStream,
|
|
13941
13986
|
videoWidth: state.videoWidth,
|
|
13942
13987
|
videoHeight: state.videoHeight
|
|
13943
13988
|
};
|
|
13944
13989
|
})),
|
|
13945
|
-
camera = _m.camera,
|
|
13946
|
-
audioStream = _m.audioStream,
|
|
13947
13990
|
videoWidth = _m.videoWidth,
|
|
13948
13991
|
videoHeight = _m.videoHeight;
|
|
13949
13992
|
var _o = useSelfieGuidanceModelsContext(),
|
|
@@ -13951,8 +13994,6 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
|
|
|
13951
13994
|
startHeadTracking = _o.start,
|
|
13952
13995
|
stopHeadTracking = _o.stop;
|
|
13953
13996
|
var _p = useVideoSignatureStore(),
|
|
13954
|
-
startRecording = _p.startRecording,
|
|
13955
|
-
stopRecording = _p.stopRecording,
|
|
13956
13997
|
clearRecordedData = _p.clearRecordedData,
|
|
13957
13998
|
isRecording = _p.isRecording;
|
|
13958
13999
|
React.useEffect(function () {
|
|
@@ -13961,10 +14002,11 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
|
|
|
13961
14002
|
});
|
|
13962
14003
|
}, [onSignatureVideoCaptured]);
|
|
13963
14004
|
React.useEffect(function () {
|
|
13964
|
-
|
|
13965
|
-
|
|
13966
|
-
|
|
13967
|
-
|
|
14005
|
+
useVideoSignatureStore.getState().startRecording(captureAudio);
|
|
14006
|
+
return function () {
|
|
14007
|
+
return useVideoSignatureStore.getState().stopRecording();
|
|
14008
|
+
};
|
|
14009
|
+
}, [captureAudio]);
|
|
13968
14010
|
React.useEffect(function () {
|
|
13969
14011
|
setTimeout(startHeadTracking, 1);
|
|
13970
14012
|
return stopHeadTracking;
|
|
@@ -13985,7 +14027,7 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
|
|
|
13985
14027
|
setNumFramesWithoutFaces = _s[1];
|
|
13986
14028
|
onHeadTrackingPredictionMade(useDebounce.useThrottledCallback(React.useCallback(function (_a) {
|
|
13987
14029
|
var face = _a.face;
|
|
13988
|
-
if (
|
|
14030
|
+
if (headTrackingDisabled) return;
|
|
13989
14031
|
var leftEdge = videoWidth * headTrackingBoundaryPercentage;
|
|
13990
14032
|
var rightEdge = videoWidth * (1 - headTrackingBoundaryPercentage);
|
|
13991
14033
|
var topEdge = videoHeight * headTrackingBoundaryPercentage;
|
|
@@ -13996,7 +14038,7 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
|
|
|
13996
14038
|
setNumFramesWithoutFaces(face ? 0 : function (n) {
|
|
13997
14039
|
return n + 1;
|
|
13998
14040
|
});
|
|
13999
|
-
}, [
|
|
14041
|
+
}, [headTrackingBoundaryPercentage, headTrackingBoundaryType, headTrackingDisabled, videoHeight, videoWidth]), 16));
|
|
14000
14042
|
var _t = useResizeObserver(),
|
|
14001
14043
|
ref = _t.ref,
|
|
14002
14044
|
_u = _t.width,
|
|
@@ -14039,7 +14081,7 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
|
|
|
14039
14081
|
face: lastFace,
|
|
14040
14082
|
scaling: debugScalingDetails,
|
|
14041
14083
|
color: headTrackingSatisfied ? 'green' : 'red'
|
|
14042
|
-
}))), /*#__PURE__*/React__namespace.default.createElement(DebugStatsPane, null, "Video: ",
|
|
14084
|
+
}))), /*#__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, {
|
|
14043
14085
|
onClick: onExit,
|
|
14044
14086
|
className: classNames.exitCaptureBtn
|
|
14045
14087
|
}));
|
|
@@ -14545,9 +14587,6 @@ function VideoSignatureWizardGuides(_a) {
|
|
|
14545
14587
|
component = _a.component,
|
|
14546
14588
|
props = __rest(_a, ["status", "restartVideoOnSignaturePadCleared", "captureAudio", "component"]);
|
|
14547
14589
|
var Component = component !== null && component !== void 0 ? component : VideoSignatureGuides;
|
|
14548
|
-
var _d = useCameraStore(),
|
|
14549
|
-
camera = _d.camera,
|
|
14550
|
-
audioStream = _d.audioStream;
|
|
14551
14590
|
var onAcceptBtnClicked = React.useCallback(function () {
|
|
14552
14591
|
var signaturePad = useVideoSignatureStore.getState().signaturePad;
|
|
14553
14592
|
if (!signaturePad.current) throw new Error('Signature pad not found');
|
|
@@ -14569,11 +14608,11 @@ function VideoSignatureWizardGuides(_a) {
|
|
|
14569
14608
|
setTimeout(function () {
|
|
14570
14609
|
useVideoSignatureStore.getState().clearRecordedData();
|
|
14571
14610
|
setTimeout(function () {
|
|
14572
|
-
useVideoSignatureStore.getState().startRecording(
|
|
14611
|
+
useVideoSignatureStore.getState().startRecording(captureAudio);
|
|
14573
14612
|
}, 100);
|
|
14574
14613
|
}, 100);
|
|
14575
14614
|
}
|
|
14576
|
-
}, [
|
|
14615
|
+
}, [captureAudio, restartVideoOnSignaturePadCleared]);
|
|
14577
14616
|
return /*#__PURE__*/React__namespace.default.createElement(Component, _assign({}, props, {
|
|
14578
14617
|
faceGuideStatus: status,
|
|
14579
14618
|
onAcceptBtnClicked: onAcceptBtnClicked,
|
|
@@ -14927,12 +14966,10 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14927
14966
|
_9 = _7.height,
|
|
14928
14967
|
height = _9 === void 0 ? 1 : _9;
|
|
14929
14968
|
var _10 = useCameraStore(),
|
|
14930
|
-
camera = _10.camera,
|
|
14931
14969
|
videoRef = _10.videoRef,
|
|
14932
14970
|
videoLoaded = _10.videoLoaded,
|
|
14933
14971
|
cameraReady = _10.cameraReady,
|
|
14934
14972
|
microphoneReady = _10.microphoneReady,
|
|
14935
|
-
audioStream = _10.audioStream,
|
|
14936
14973
|
isRearFacing = _10.isRearFacing,
|
|
14937
14974
|
releaseCameraAccess = _10.releaseCameraAccess;
|
|
14938
14975
|
var _11 = React.useState([]),
|
|
@@ -14974,8 +15011,8 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14974
15011
|
countdownRemaining = _18[0],
|
|
14975
15012
|
setCountdownRemaining = _18[1];
|
|
14976
15013
|
React.useEffect(function () {
|
|
14977
|
-
if (
|
|
14978
|
-
useVideoRecorderStore.getState().startRecordingVideo(
|
|
15014
|
+
if (!isRecordingVideo && !videoUrl) {
|
|
15015
|
+
useVideoRecorderStore.getState().startRecordingVideo();
|
|
14979
15016
|
setVideoStartsAt(new Date());
|
|
14980
15017
|
}
|
|
14981
15018
|
// if the mergeAVStreams flag is present, the audio stream is on the video
|
|
@@ -14986,7 +15023,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14986
15023
|
releaseCameraAccess();
|
|
14987
15024
|
onComplete === null || onComplete === void 0 ? void 0 : onComplete(videoUrl, audioUrl);
|
|
14988
15025
|
}
|
|
14989
|
-
}, [
|
|
15026
|
+
}, [audioUrl, isRecordingVideo, mergeAVStreams, onComplete, readTextPrompt, releaseCameraAccess, videoUrl]);
|
|
14990
15027
|
React.useEffect(function () {
|
|
14991
15028
|
if (videoRecordingUnintentionallyStopped || audioRecordingUnintentionallyStopped || !!readTextPrompt && !microphoneReady) {
|
|
14992
15029
|
onRecordingFailed === null || onRecordingFailed === void 0 ? void 0 : onRecordingFailed();
|
|
@@ -15081,14 +15118,14 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
15081
15118
|
var _a;
|
|
15082
15119
|
if (translatedText) {
|
|
15083
15120
|
setRequestedAction('READ_TEXT');
|
|
15084
|
-
useVideoRecorderStore.getState().startRecordingAudio(
|
|
15121
|
+
useVideoRecorderStore.getState().startRecordingAudio();
|
|
15085
15122
|
setIdCaptureVideoAudioStartsAt(new Date().getTime() - ((_a = videoStartsAt === null || videoStartsAt === void 0 ? void 0 : videoStartsAt.getTime()) !== null && _a !== void 0 ? _a : 0));
|
|
15086
15123
|
var renderedTranslatedText = typeof translatedText === 'string' ? translatedText : server.renderToString(translatedText);
|
|
15087
15124
|
setExpectedAudioText(renderedTranslatedText);
|
|
15088
15125
|
} else {
|
|
15089
15126
|
useVideoRecorderStore.getState().stopRecordingVideo();
|
|
15090
15127
|
}
|
|
15091
|
-
}, [
|
|
15128
|
+
}, [setExpectedAudioText, setIdCaptureVideoAudioStartsAt, translatedText, videoStartsAt]);
|
|
15092
15129
|
var frameWidth = (_c = (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.videoWidth) !== null && _c !== void 0 ? _c : 0;
|
|
15093
15130
|
var frameHeight = (_e = (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.videoHeight) !== null && _e !== void 0 ? _e : 0;
|
|
15094
15131
|
var faceBox = face === null || face === void 0 ? void 0 : face.box;
|
|
@@ -15720,36 +15757,36 @@ var VideoIdWizard = function VideoIdWizard(_a) {
|
|
|
15720
15757
|
};
|
|
15721
15758
|
|
|
15722
15759
|
function CompositeWizard(_a) {
|
|
15723
|
-
var _b
|
|
15760
|
+
var _b;
|
|
15724
15761
|
var userChecks = _a.checks,
|
|
15725
|
-
|
|
15726
|
-
idCaptureProps =
|
|
15727
|
-
|
|
15728
|
-
faceLivenessProps =
|
|
15762
|
+
_c = _a.idCaptureProps,
|
|
15763
|
+
idCaptureProps = _c === void 0 ? {} : _c,
|
|
15764
|
+
_d = _a.faceLivenessProps,
|
|
15765
|
+
faceLivenessProps = _d === void 0 ? {} : _d,
|
|
15729
15766
|
additionalDocumentCaptureProps = _a.additionalDocumentCaptureProps,
|
|
15730
|
-
|
|
15731
|
-
signatureCaptureProps =
|
|
15732
|
-
|
|
15733
|
-
videoSignatureCaptureProps =
|
|
15734
|
-
|
|
15735
|
-
videoIdCaptureProps =
|
|
15736
|
-
|
|
15737
|
-
captureSignature =
|
|
15738
|
-
|
|
15739
|
-
captureSignatureVideo =
|
|
15767
|
+
_e = _a.signatureCaptureProps,
|
|
15768
|
+
signatureCaptureProps = _e === void 0 ? {} : _e,
|
|
15769
|
+
_f = _a.videoSignatureCaptureProps,
|
|
15770
|
+
videoSignatureCaptureProps = _f === void 0 ? {} : _f,
|
|
15771
|
+
_g = _a.videoIdCaptureProps,
|
|
15772
|
+
videoIdCaptureProps = _g === void 0 ? {} : _g,
|
|
15773
|
+
_h = _a.captureSignature,
|
|
15774
|
+
captureSignature = _h === void 0 ? false : _h,
|
|
15775
|
+
_j = _a.captureSignatureVideo,
|
|
15776
|
+
captureSignatureVideo = _j === void 0 ? false : _j,
|
|
15740
15777
|
onCameraAccessDenied = _a.onCameraAccessDenied,
|
|
15741
15778
|
onCameraTamperingDetected = _a.onCameraTamperingDetected,
|
|
15742
15779
|
onMicrophoneAccessDenied = _a.onMicrophoneAccessDenied,
|
|
15743
|
-
|
|
15744
|
-
debugMode =
|
|
15745
|
-
var
|
|
15746
|
-
submit =
|
|
15747
|
-
submissionStatus =
|
|
15748
|
-
setSignatureData =
|
|
15749
|
-
setAdditionalDocuments =
|
|
15750
|
-
var
|
|
15751
|
-
checkIndex =
|
|
15752
|
-
setCheckIndex =
|
|
15780
|
+
_k = _a.debugMode,
|
|
15781
|
+
debugMode = _k === void 0 ? false : _k;
|
|
15782
|
+
var _l = React.useContext(SubmissionContext),
|
|
15783
|
+
submit = _l.submit,
|
|
15784
|
+
submissionStatus = _l.submissionStatus,
|
|
15785
|
+
setSignatureData = _l.setSignatureData,
|
|
15786
|
+
setAdditionalDocuments = _l.setAdditionalDocuments;
|
|
15787
|
+
var _m = React.useState(0),
|
|
15788
|
+
checkIndex = _m[0],
|
|
15789
|
+
setCheckIndex = _m[1];
|
|
15753
15790
|
var checks = React.useMemo(function () {
|
|
15754
15791
|
var _a, _b;
|
|
15755
15792
|
var checks = __spreadArray([], userChecks, true);
|
|
@@ -15856,24 +15893,13 @@ function CompositeWizard(_a) {
|
|
|
15856
15893
|
var shouldLoadIdCaptureModels = !(idCaptureProps === null || idCaptureProps === void 0 ? void 0 : idCaptureProps.forceFallbackMode) && !(idCaptureProps === null || idCaptureProps === void 0 ? void 0 : idCaptureProps.allowUploadingDocumentsFromStorage);
|
|
15857
15894
|
switch (checks[checkIndex]) {
|
|
15858
15895
|
case 'IdCapture':
|
|
15859
|
-
return /*#__PURE__*/React__namespace.default.createElement(
|
|
15896
|
+
return /*#__PURE__*/React__namespace.default.createElement(IdCaptureWizardWithProviders, _assign({}, idCaptureProps, {
|
|
15860
15897
|
onCameraAccessDenied: onCameraAccessDenied,
|
|
15861
15898
|
onCameraTamperingDetected: onCameraTamperingDetected,
|
|
15862
15899
|
onMicrophoneAccessDenied: onMicrophoneAccessDenied,
|
|
15863
|
-
|
|
15864
|
-
classNames: (_c = idCaptureProps.classNames) === null || _c === void 0 ? void 0 : _c.cameraStoreProvider,
|
|
15865
|
-
verbiage: (_d = idCaptureProps.verbiage) === null || _d === void 0 ? void 0 : _d.cameraStoreProvider
|
|
15866
|
-
}, /*#__PURE__*/React__namespace.default.createElement(IdCaptureModelsProvider, {
|
|
15867
|
-
autoStart: false,
|
|
15868
|
-
shouldLoadModels: shouldLoadIdCaptureModels,
|
|
15869
|
-
documentDetectionModelUrl: (_f = (_e = idCaptureProps.assets) === null || _e === void 0 ? void 0 : _e.documentDetectionModelUrl) !== null && _f !== void 0 ? _f : '',
|
|
15870
|
-
focusModelUrl: (_h = (_g = idCaptureProps.assets) === null || _g === void 0 ? void 0 : _g.focusModelUrl) !== null && _h !== void 0 ? _h : '',
|
|
15871
|
-
onModelError: idCaptureProps.onModelError,
|
|
15872
|
-
modelLoadTimeoutMs: idCaptureProps.modelLoadTimeoutMs,
|
|
15873
|
-
allowSinglePageIdCapture: idCaptureProps.allowSinglePageIdCapture
|
|
15874
|
-
}, /*#__PURE__*/React__namespace.default.createElement(IdCaptureStateProvider, null, /*#__PURE__*/React__namespace.default.createElement(GuideOrientationContextProvider, null, /*#__PURE__*/React__namespace.default.createElement(IdCaptureWizard, _assign({}, idCaptureProps, {
|
|
15900
|
+
shouldLoadIdCaptureModels: shouldLoadIdCaptureModels,
|
|
15875
15901
|
onSuccess: onIdCaptureSuccess
|
|
15876
|
-
}))
|
|
15902
|
+
}));
|
|
15877
15903
|
case 'VideoIdCapture':
|
|
15878
15904
|
return /*#__PURE__*/React__namespace.default.createElement(VideoIdWizard, _assign({}, videoIdCaptureProps, {
|
|
15879
15905
|
onComplete: onVideoIdCaptureComplete,
|
|
@@ -15882,21 +15908,12 @@ function CompositeWizard(_a) {
|
|
|
15882
15908
|
onMicrophoneAccessDenied: onMicrophoneAccessDenied
|
|
15883
15909
|
}));
|
|
15884
15910
|
case 'FaceLiveness':
|
|
15885
|
-
return /*#__PURE__*/React__namespace.default.createElement(
|
|
15886
|
-
preferFrontFacingCamera: true,
|
|
15887
|
-
preferIphoneContinuityCamera: false,
|
|
15911
|
+
return /*#__PURE__*/React__namespace.default.createElement(FaceLivenessWizardWithProviders, _assign({}, faceLivenessProps, {
|
|
15888
15912
|
onCameraAccessDenied: onCameraAccessDenied,
|
|
15889
15913
|
onCameraTamperingDetected: onCameraTamperingDetected,
|
|
15890
15914
|
onMicrophoneAccessDenied: onMicrophoneAccessDenied,
|
|
15891
|
-
classNames: (_j = faceLivenessProps.classNames) === null || _j === void 0 ? void 0 : _j.cameraStoreProvider,
|
|
15892
|
-
verbiage: (_k = faceLivenessProps.verbiage) === null || _k === void 0 ? void 0 : _k.cameraStoreProvider
|
|
15893
|
-
}, /*#__PURE__*/React__namespace.default.createElement(SelfieGuidanceModelsProvider, {
|
|
15894
|
-
autoStart: false,
|
|
15895
|
-
onModelError: faceLivenessProps.onModelError,
|
|
15896
|
-
modelLoadTimeoutMs: faceLivenessProps.modelLoadTimeoutMs
|
|
15897
|
-
}, /*#__PURE__*/React__namespace.default.createElement(FaceLivenessWizard, _assign({}, faceLivenessProps, {
|
|
15898
15915
|
onComplete: onFaceLivenessComplete
|
|
15899
|
-
}))
|
|
15916
|
+
}));
|
|
15900
15917
|
case 'SignatureCapture':
|
|
15901
15918
|
return /*#__PURE__*/React__namespace.default.createElement(SignatureCapture, _assign({}, signatureCaptureProps, {
|
|
15902
15919
|
onAccept: onSignatureCaptureSuccess
|