idmission-web-sdk 2.0.4 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -28
- package/dist/components/customer_flows/CustomerIdAndBiometricsEnrollment.d.ts +3 -12
- package/dist/components/customer_flows/IdAndFaceValidation.d.ts +3 -12
- package/dist/components/customer_flows/IdValidation.d.ts +3 -12
- package/dist/components/customer_flows/VideoIdValidation.d.ts +3 -12
- package/dist/components/id_capture/CapturedDocuments.d.ts +2 -0
- package/dist/components/id_capture/FocusModelProvider.d.ts +2 -1
- package/dist/components/id_capture/IdCapture.d.ts +5 -14
- package/dist/components/id_capture/IdCaptureModelsProvider.d.ts +7 -22
- package/dist/components/id_capture/IdCaptureStateProvider.d.ts +12 -38
- package/dist/components/id_capture/IdCaptureSuccess.d.ts +2 -3
- package/dist/components/id_capture/IdCaptureWizard.d.ts +3 -9
- package/dist/components/video_id/IdVideoCapture.d.ts +12 -7
- package/dist/components/video_id/IdVideoCaptureWizard.d.ts +3 -8
- package/dist/lib/models/DocumentDetection.d.ts +15 -12
- package/dist/lib/models/Focus.d.ts +6 -2
- package/dist/sdk2.cjs.development.js +774 -926
- 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 +774 -926
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +774 -926
- 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/stories/Components/IdCapture/LicenseBackCapture.stories.d.ts +0 -48
- package/dist/stories/Components/IdCapture/LicenseFrontCapture.stories.d.ts +0 -45
- package/dist/stories/Components/IdCapture/PassportCapture.stories.d.ts +0 -47
- package/dist/stories/Components/IdCapture/Wizard.stories.d.ts +1 -77
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -49,7 +49,7 @@ var LanguageDetector__default = /*#__PURE__*/_interopDefaultLegacy(LanguageDetec
|
|
|
49
49
|
var i18n__default = /*#__PURE__*/_interopDefaultLegacy(i18n);
|
|
50
50
|
var SignatureCanvas__default = /*#__PURE__*/_interopDefaultLegacy(SignatureCanvas);
|
|
51
51
|
|
|
52
|
-
var webSdkVersion = '2.
|
|
52
|
+
var webSdkVersion = '2.1.1';
|
|
53
53
|
|
|
54
54
|
function getPlatform() {
|
|
55
55
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -1634,10 +1634,6 @@ function convertBase64ToBlob(base64Image) {
|
|
|
1634
1634
|
});
|
|
1635
1635
|
}
|
|
1636
1636
|
|
|
1637
|
-
function supportsNativeBarcodeScanning() {
|
|
1638
|
-
return 'BarcodeDetector' in window;
|
|
1639
|
-
}
|
|
1640
|
-
|
|
1641
1637
|
function getFrameDimensions(frame) {
|
|
1642
1638
|
var frameWidth = frame.width,
|
|
1643
1639
|
frameHeight = frame.height;
|
|
@@ -2509,10 +2505,14 @@ function waitForVideoReady(videoRef, checkEveryMs) {
|
|
|
2509
2505
|
});
|
|
2510
2506
|
}
|
|
2511
2507
|
|
|
2512
|
-
var defaultFocusModelPath = "https://websdk-cdn-dev.idmission.com/assets/models/
|
|
2508
|
+
var defaultFocusModelPath = "https://websdk-cdn-dev.idmission.com/assets/models/focusmp20240619/model_fp16.tflite";
|
|
2513
2509
|
var defaultFocusModelLoadTimeoutMs = 45000;
|
|
2514
2510
|
var defaultFocusThresholds = {
|
|
2515
|
-
|
|
2511
|
+
idCardFront: {
|
|
2512
|
+
desktop: 0,
|
|
2513
|
+
mobile: 0.3
|
|
2514
|
+
},
|
|
2515
|
+
idCardBack: {
|
|
2516
2516
|
desktop: 0,
|
|
2517
2517
|
mobile: 0.3
|
|
2518
2518
|
},
|
|
@@ -3135,14 +3135,19 @@ function sumUpProgressForDependencies(dependencies) {
|
|
|
3135
3135
|
});
|
|
3136
3136
|
}
|
|
3137
3137
|
|
|
3138
|
-
var defaultDocumentDetectorModelPath = "https://websdk-cdn-dev.idmission.com/assets/models/
|
|
3138
|
+
var defaultDocumentDetectorModelPath = "https://websdk-cdn-dev.idmission.com/assets/models/docdetectmp20240614/model_fp16.tflite";
|
|
3139
3139
|
var defaultDocumentDetectionScoreThreshold = 0.1;
|
|
3140
3140
|
var defaultDocumentDetectionModelLoadTimeoutMs = 45000;
|
|
3141
3141
|
var defaultDocumentDetectionThresholds = {
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3142
|
+
idCardFront: 0.8,
|
|
3143
|
+
idCardBack: 0.8,
|
|
3144
|
+
passport: 0.5
|
|
3145
|
+
};
|
|
3146
|
+
var documentTypeDisplayNames = {
|
|
3147
|
+
idCardFront: 'ID card front',
|
|
3148
|
+
idCardBack: 'ID card back',
|
|
3149
|
+
passport: 'Passport',
|
|
3150
|
+
none: 'None'
|
|
3146
3151
|
};
|
|
3147
3152
|
var detectors = {};
|
|
3148
3153
|
function loadDocumentDetector(modelAssetPath, scoreThreshold) {
|
|
@@ -3297,34 +3302,33 @@ function processDocumentDetectorPrediction(prediction, thresholds) {
|
|
|
3297
3302
|
return n > 0;
|
|
3298
3303
|
});
|
|
3299
3304
|
});
|
|
3300
|
-
var
|
|
3305
|
+
var bestIdCardFront = detectedObjects.find(function (obj) {
|
|
3301
3306
|
return obj.label === 'Document';
|
|
3302
3307
|
});
|
|
3308
|
+
var bestIdCardBack = detectedObjects.find(function (obj) {
|
|
3309
|
+
return obj.label === 'Document back';
|
|
3310
|
+
});
|
|
3303
3311
|
var bestPassportPage = detectedObjects.find(function (obj) {
|
|
3304
3312
|
return obj.label === 'Passport page';
|
|
3305
3313
|
});
|
|
3306
|
-
var
|
|
3307
|
-
var
|
|
3308
|
-
var
|
|
3309
|
-
var
|
|
3310
|
-
var
|
|
3314
|
+
var idCardFrontDetectionScore = (_a = bestIdCardFront === null || bestIdCardFront === void 0 ? void 0 : bestIdCardFront.score) !== null && _a !== void 0 ? _a : 0;
|
|
3315
|
+
var idCardBackDetectionScore = (_b = bestIdCardBack === null || bestIdCardBack === void 0 ? void 0 : bestIdCardBack.score) !== null && _b !== void 0 ? _b : 0;
|
|
3316
|
+
var passportDetectionScore = (_c = bestPassportPage === null || bestPassportPage === void 0 ? void 0 : bestPassportPage.score) !== null && _c !== void 0 ? _c : 0;
|
|
3317
|
+
var idCardFrontDetectionThresholdMet = idCardFrontDetectionScore >= ((_d = thresholds.idCardFront) !== null && _d !== void 0 ? _d : 0);
|
|
3318
|
+
var idCardBackDetectionThresholdMet = idCardBackDetectionScore >= ((_e = thresholds.idCardBack) !== null && _e !== void 0 ? _e : 0);
|
|
3319
|
+
var passportDetectionThresholdMet = passportDetectionScore >= ((_f = thresholds.passport) !== null && _f !== void 0 ? _f : 0);
|
|
3320
|
+
var bestDocument = passportDetectionThresholdMet ? bestPassportPage : idCardBackDetectionThresholdMet ? bestIdCardBack : bestIdCardFront;
|
|
3321
|
+
var detectionThreshold = passportDetectionThresholdMet ? thresholds.passport : idCardBackDetectionThresholdMet ? thresholds.idCardBack : thresholds.idCardFront;
|
|
3322
|
+
var detectionScore = (_g = bestDocument === null || bestDocument === void 0 ? void 0 : bestDocument.score) !== null && _g !== void 0 ? _g : 0;
|
|
3311
3323
|
var detectionThresholdMet = detectionScore >= (detectionThreshold !== null && detectionThreshold !== void 0 ? detectionThreshold : 0);
|
|
3312
3324
|
var detectedDocumentType = 'none';
|
|
3313
3325
|
if (passportDetectionThresholdMet) {
|
|
3314
3326
|
detectedDocumentType = 'passport';
|
|
3327
|
+
} else if (idCardBackDetectionThresholdMet) {
|
|
3328
|
+
detectedDocumentType = 'idCardBack';
|
|
3315
3329
|
} else if (detectionThresholdMet) {
|
|
3316
|
-
detectedDocumentType = '
|
|
3330
|
+
detectedDocumentType = 'idCardFront';
|
|
3317
3331
|
}
|
|
3318
|
-
var bestMrz = detectedObjects.find(function (obj) {
|
|
3319
|
-
return obj.label === 'MRZ';
|
|
3320
|
-
});
|
|
3321
|
-
var mrzDetectionScore = (_d = bestMrz === null || bestMrz === void 0 ? void 0 : bestMrz.score) !== null && _d !== void 0 ? _d : 0;
|
|
3322
|
-
var mrzDetectionThresholdMet = mrzDetectionScore >= ((_e = thresholds.mrz) !== null && _e !== void 0 ? _e : 0);
|
|
3323
|
-
var bestPdf417 = detectedObjects.find(function (obj) {
|
|
3324
|
-
return obj.label === 'PDF417';
|
|
3325
|
-
});
|
|
3326
|
-
var pdf417DetectionScore = (_f = bestPdf417 === null || bestPdf417 === void 0 ? void 0 : bestPdf417.score) !== null && _f !== void 0 ? _f : 0;
|
|
3327
|
-
var pdf417DetectionThresholdMet = pdf417DetectionScore >= ((_g = thresholds.pdf417) !== null && _g !== void 0 ? _g : 0);
|
|
3328
3332
|
var documentInBounds = false;
|
|
3329
3333
|
if (bestDocument) {
|
|
3330
3334
|
var boundaryPx = 20;
|
|
@@ -3354,15 +3358,13 @@ function processDocumentDetectorPrediction(prediction, thresholds) {
|
|
|
3354
3358
|
detectionTime: time,
|
|
3355
3359
|
detectionThresholdMet: detectionThresholdMet,
|
|
3356
3360
|
detectedDocumentType: detectedDocumentType,
|
|
3361
|
+
idCardFrontDetectionScore: idCardFrontDetectionScore,
|
|
3362
|
+
idCardFrontDetectionThresholdMet: idCardFrontDetectionThresholdMet,
|
|
3363
|
+
idCardBackDetectionScore: idCardBackDetectionScore,
|
|
3364
|
+
idCardBackDetectionThresholdMet: idCardBackDetectionThresholdMet,
|
|
3357
3365
|
passportDetectionScore: passportDetectionScore,
|
|
3358
3366
|
passportDetectionThresholdMet: passportDetectionThresholdMet,
|
|
3359
|
-
mrzDetectionScore: mrzDetectionScore,
|
|
3360
|
-
mrzDetectionThresholdMet: mrzDetectionThresholdMet,
|
|
3361
|
-
pdf417DetectionScore: pdf417DetectionScore,
|
|
3362
|
-
pdf417DetectionThresholdMet: pdf417DetectionThresholdMet,
|
|
3363
3367
|
bestDocument: bestDocument,
|
|
3364
|
-
bestMrz: bestMrz,
|
|
3365
|
-
bestPdf417: bestPdf417,
|
|
3366
3368
|
documentInBounds: documentInBounds,
|
|
3367
3369
|
documentTooClose: documentTooClose,
|
|
3368
3370
|
frameWidth: frameWidth,
|
|
@@ -3610,24 +3612,26 @@ function FocusModelProvider(_a) {
|
|
|
3610
3612
|
focusModelPath = _b === void 0 ? defaultFocusModelPath : _b,
|
|
3611
3613
|
_c = _a.focusModelLoadTimeoutMs,
|
|
3612
3614
|
focusModelLoadTimeoutMs = _c === void 0 ? defaultFocusModelLoadTimeoutMs : _c,
|
|
3613
|
-
onFocusModelError = _a.onFocusModelError
|
|
3615
|
+
onFocusModelError = _a.onFocusModelError,
|
|
3616
|
+
_d = _a.showCanvases,
|
|
3617
|
+
showCanvases = _d === void 0 ? false : _d;
|
|
3614
3618
|
var cropCanvas = React.useRef(null);
|
|
3615
3619
|
var rotateCanvas = React.useRef(null);
|
|
3616
|
-
var
|
|
3617
|
-
focusThresholds =
|
|
3618
|
-
setFocusThresholds =
|
|
3619
|
-
var
|
|
3620
|
-
focusPredictionTime =
|
|
3621
|
-
setFocusPredictionTime =
|
|
3622
|
-
var
|
|
3620
|
+
var _e = React.useState({}),
|
|
3621
|
+
focusThresholds = _e[0],
|
|
3622
|
+
setFocusThresholds = _e[1];
|
|
3623
|
+
var _f = React.useState(0),
|
|
3624
|
+
focusPredictionTime = _f[0],
|
|
3625
|
+
setFocusPredictionTime = _f[1];
|
|
3626
|
+
var _g = useLoadFocusModel({
|
|
3623
3627
|
modelPath: focusModelPath,
|
|
3624
3628
|
modelLoadTimeoutMs: focusModelLoadTimeoutMs,
|
|
3625
3629
|
onModelError: onFocusModelError
|
|
3626
3630
|
}),
|
|
3627
|
-
model =
|
|
3628
|
-
ready =
|
|
3629
|
-
modelDownloadProgress =
|
|
3630
|
-
modelError =
|
|
3631
|
+
model = _g.model,
|
|
3632
|
+
ready = _g.ready,
|
|
3633
|
+
modelDownloadProgress = _g.modelDownloadProgress,
|
|
3634
|
+
modelError = _g.modelError;
|
|
3631
3635
|
var makeFocusPrediction = React.useCallback(function (imageData, box) {
|
|
3632
3636
|
if (!model.current) return null;
|
|
3633
3637
|
var prediction = makeFocusModelPrediction(model.current, imageData, cropCanvas.current, rotateCanvas.current, box);
|
|
@@ -3648,13 +3652,23 @@ function FocusModelProvider(_a) {
|
|
|
3648
3652
|
return /*#__PURE__*/React__default['default'].createElement(FocusModelContext.Provider, {
|
|
3649
3653
|
value: value
|
|
3650
3654
|
}, /*#__PURE__*/React__default['default'].createElement(InvisibleCanvas, {
|
|
3651
|
-
ref: rotateCanvas
|
|
3655
|
+
ref: rotateCanvas,
|
|
3656
|
+
style: showCanvases ? {
|
|
3657
|
+
display: 'block'
|
|
3658
|
+
} : undefined
|
|
3652
3659
|
}), /*#__PURE__*/React__default['default'].createElement(InvisibleCanvas, {
|
|
3653
|
-
ref: cropCanvas
|
|
3660
|
+
ref: cropCanvas,
|
|
3661
|
+
style: showCanvases ? {
|
|
3662
|
+
display: 'block'
|
|
3663
|
+
} : undefined
|
|
3654
3664
|
}), children);
|
|
3655
3665
|
}
|
|
3656
3666
|
|
|
3657
3667
|
var onMobile = isMobile();
|
|
3668
|
+
var defaultIdCaptureThresholds = {
|
|
3669
|
+
detection: defaultDocumentDetectionThresholds,
|
|
3670
|
+
focus: defaultFocusThresholds
|
|
3671
|
+
};
|
|
3658
3672
|
var IdCaptureModelsContext = /*#__PURE__*/React.createContext({
|
|
3659
3673
|
ready: false,
|
|
3660
3674
|
start: function start() {
|
|
@@ -3665,7 +3679,7 @@ var IdCaptureModelsContext = /*#__PURE__*/React.createContext({
|
|
|
3665
3679
|
},
|
|
3666
3680
|
modelDownloadProgress: 0,
|
|
3667
3681
|
modelError: null,
|
|
3668
|
-
thresholds:
|
|
3682
|
+
thresholds: defaultIdCaptureThresholds,
|
|
3669
3683
|
setThresholds: function setThresholds() {
|
|
3670
3684
|
return null;
|
|
3671
3685
|
},
|
|
@@ -3680,6 +3694,10 @@ var IdCaptureModelsContext = /*#__PURE__*/React.createContext({
|
|
|
3680
3694
|
},
|
|
3681
3695
|
resetBestFrame: function resetBestFrame() {
|
|
3682
3696
|
return null;
|
|
3697
|
+
},
|
|
3698
|
+
requiredDocumentType: 'none',
|
|
3699
|
+
setRequiredDocumentType: function setRequiredDocumentType() {
|
|
3700
|
+
return null;
|
|
3683
3701
|
}
|
|
3684
3702
|
});
|
|
3685
3703
|
function IdCaptureModelsProviderInner(_a) {
|
|
@@ -3712,46 +3730,54 @@ function IdCaptureModelsProviderInner(_a) {
|
|
|
3712
3730
|
var bestPredictionCanvas = React.useRef(null);
|
|
3713
3731
|
var bestFocusScore = React.useRef(0);
|
|
3714
3732
|
var stopDetection = React.useRef(0);
|
|
3733
|
+
var _e = React.useState('none'),
|
|
3734
|
+
requiredDocumentType = _e[0],
|
|
3735
|
+
setRequiredDocumentType = _e[1];
|
|
3715
3736
|
var thresholds = React.useMemo(function () {
|
|
3716
3737
|
return tslib.__assign(tslib.__assign({}, documentDetectionThresholds), {
|
|
3717
3738
|
focus: focusThresholds
|
|
3718
3739
|
});
|
|
3719
3740
|
}, [documentDetectionThresholds, focusThresholds]);
|
|
3720
3741
|
var setThresholds = React.useCallback(function (thresholds) {
|
|
3721
|
-
|
|
3722
|
-
|
|
3742
|
+
if (thresholds.detection) {
|
|
3743
|
+
setDocumentDetectionThresholds(thresholds.detection);
|
|
3744
|
+
}
|
|
3745
|
+
if (thresholds.focus) {
|
|
3746
|
+
setFocusThresholds(thresholds.focus);
|
|
3747
|
+
}
|
|
3723
3748
|
}, [setDocumentDetectionThresholds, setFocusThresholds]);
|
|
3724
3749
|
React.useEffect(function handleDetections() {
|
|
3725
3750
|
var _this = this;
|
|
3726
3751
|
onDocumentDetected(function (prediction) {
|
|
3727
3752
|
return tslib.__awaiter(_this, void 0, void 0, function () {
|
|
3728
|
-
var stopDetectionAtStart, focusPredictionTime, focusScore, focusThresholdMet, focusPrediction, focusThresholdSet, focusThreshold;
|
|
3729
|
-
var _a, _b, _c, _d, _e;
|
|
3730
|
-
return tslib.__generator(this, function (
|
|
3753
|
+
var stopDetectionAtStart, focusPredictionTime, focusScore, focusThresholdMet, isRequiredDocumentType, focusPrediction, focusThresholdSet, focusThreshold;
|
|
3754
|
+
var _a, _b, _c, _d, _e, _f;
|
|
3755
|
+
return tslib.__generator(this, function (_g) {
|
|
3731
3756
|
if (!lastPredictionCanvas.current) return [2 /*return*/];
|
|
3732
3757
|
stopDetectionAtStart = stopDetection.current;
|
|
3733
3758
|
focusPredictionTime = 0, focusScore = 0, focusThresholdMet = false;
|
|
3734
|
-
|
|
3735
|
-
|
|
3759
|
+
isRequiredDocumentType = requiredDocumentType === 'none' || prediction.detectedDocumentType === requiredDocumentType || ((_a = requiredDocumentType.includes) === null || _a === void 0 ? void 0 : _a.call(requiredDocumentType, prediction.detectedDocumentType));
|
|
3760
|
+
if (isRequiredDocumentType && prediction.detectedDocumentType !== 'none' && prediction.detectionThresholdMet && prediction.documentInBounds && !prediction.documentTooClose) {
|
|
3761
|
+
focusPrediction = makeFocusPrediction(lastPredictionCanvas.current, (_b = prediction.bestDocument) === null || _b === void 0 ? void 0 : _b.box);
|
|
3736
3762
|
if (focusPrediction) {
|
|
3737
3763
|
focusScore = focusPrediction.score;
|
|
3738
3764
|
focusPredictionTime = focusPrediction.predictionTime;
|
|
3739
3765
|
}
|
|
3740
|
-
focusThresholdSet = (
|
|
3741
|
-
focusThreshold = (
|
|
3766
|
+
focusThresholdSet = (_c = thresholds.focus) === null || _c === void 0 ? void 0 : _c[prediction.detectedDocumentType];
|
|
3767
|
+
focusThreshold = (_d = onMobile ? focusThresholdSet === null || focusThresholdSet === void 0 ? void 0 : focusThresholdSet.mobile : focusThresholdSet === null || focusThresholdSet === void 0 ? void 0 : focusThresholdSet.desktop) !== null && _d !== void 0 ? _d : 0;
|
|
3742
3768
|
focusThresholdMet = focusScore >= focusThreshold;
|
|
3743
3769
|
if (bestFocusScore.current <= focusScore && stopDetectionAtStart === stopDetection.current) {
|
|
3744
3770
|
bestFocusScore.current = focusScore;
|
|
3745
3771
|
drawToCanvas(bestPredictionCanvas.current, lastPredictionCanvas.current);
|
|
3746
3772
|
setBestFrameDetails({
|
|
3747
|
-
boundingBox: (
|
|
3773
|
+
boundingBox: (_e = prediction.bestDocument) === null || _e === void 0 ? void 0 : _e.box,
|
|
3748
3774
|
documentType: prediction.detectedDocumentType,
|
|
3749
3775
|
detectionScore: prediction.detectionScore,
|
|
3750
3776
|
focusScore: focusScore
|
|
3751
3777
|
});
|
|
3752
3778
|
}
|
|
3753
3779
|
}
|
|
3754
|
-
(
|
|
3780
|
+
(_f = onPredictionHandler.current) === null || _f === void 0 ? void 0 : _f.call(onPredictionHandler, tslib.__assign(tslib.__assign({}, prediction), {
|
|
3755
3781
|
focusScore: focusScore,
|
|
3756
3782
|
focusPredictionTime: focusPredictionTime,
|
|
3757
3783
|
focusThresholdMet: focusThresholdMet
|
|
@@ -3760,7 +3786,7 @@ function IdCaptureModelsProviderInner(_a) {
|
|
|
3760
3786
|
});
|
|
3761
3787
|
});
|
|
3762
3788
|
});
|
|
3763
|
-
}, [lastPredictionCanvas, makeFocusPrediction, onDocumentDetected, thresholds.focus]);
|
|
3789
|
+
}, [lastPredictionCanvas, makeFocusPrediction, onDocumentDetected, requiredDocumentType, thresholds.focus]);
|
|
3764
3790
|
var modelError = documentDetectionModelError !== null && documentDetectionModelError !== void 0 ? documentDetectionModelError : focusModelError;
|
|
3765
3791
|
React.useEffect(function handleModelErrors() {
|
|
3766
3792
|
modelError && (onModelError === null || onModelError === void 0 ? void 0 : onModelError(modelError));
|
|
@@ -3774,9 +3800,9 @@ function IdCaptureModelsProviderInner(_a) {
|
|
|
3774
3800
|
canvas: bestPredictionCanvas.current
|
|
3775
3801
|
});
|
|
3776
3802
|
}, [bestFrameDetails]);
|
|
3777
|
-
var
|
|
3778
|
-
canvasKey =
|
|
3779
|
-
setCanvasKey =
|
|
3803
|
+
var _f = React.useState(0),
|
|
3804
|
+
canvasKey = _f[0],
|
|
3805
|
+
setCanvasKey = _f[1];
|
|
3780
3806
|
var resetBestFrame = React.useCallback(function () {
|
|
3781
3807
|
stopDetection.current += 1;
|
|
3782
3808
|
setCanvasKey(function (n) {
|
|
@@ -3786,6 +3812,9 @@ function IdCaptureModelsProviderInner(_a) {
|
|
|
3786
3812
|
setBestFrameDetails(null);
|
|
3787
3813
|
bestFocusScore.current = 0;
|
|
3788
3814
|
}, [clearDocumentDetectionLastPredictionCanvas]);
|
|
3815
|
+
React.useEffect(function () {
|
|
3816
|
+
requiredDocumentType && resetBestFrame();
|
|
3817
|
+
}, [requiredDocumentType, resetBestFrame]);
|
|
3789
3818
|
var value = React.useMemo(function () {
|
|
3790
3819
|
return {
|
|
3791
3820
|
ready: documentDetectionModelReady && focusModelReady,
|
|
@@ -3800,9 +3829,11 @@ function IdCaptureModelsProviderInner(_a) {
|
|
|
3800
3829
|
focusPredictionTime: focusPredictionTime,
|
|
3801
3830
|
getBestFrame: getBestFrame,
|
|
3802
3831
|
resetBestFrame: resetBestFrame,
|
|
3803
|
-
bestFrameDetails: bestFrameDetails
|
|
3832
|
+
bestFrameDetails: bestFrameDetails,
|
|
3833
|
+
requiredDocumentType: requiredDocumentType,
|
|
3834
|
+
setRequiredDocumentType: setRequiredDocumentType
|
|
3804
3835
|
};
|
|
3805
|
-
}, [bestFrameDetails, detectionTime, documentDetectionModelDownloadProgress, documentDetectionModelReady, focusModelDownloadProgress, focusModelReady, focusPredictionTime, getBestFrame, modelError, onPredictionMade, resetBestFrame, setThresholds, startDocumentDetection, stopDocumentDetection, thresholds]);
|
|
3836
|
+
}, [bestFrameDetails, detectionTime, documentDetectionModelDownloadProgress, documentDetectionModelReady, focusModelDownloadProgress, focusModelReady, focusPredictionTime, getBestFrame, modelError, onPredictionMade, requiredDocumentType, resetBestFrame, setThresholds, startDocumentDetection, stopDocumentDetection, thresholds]);
|
|
3806
3837
|
return /*#__PURE__*/React__default['default'].createElement(IdCaptureModelsContext.Provider, {
|
|
3807
3838
|
value: value
|
|
3808
3839
|
}, /*#__PURE__*/React__default['default'].createElement(InvisibleCanvas, {
|
|
@@ -3851,28 +3882,20 @@ var initialState$4 = {
|
|
|
3851
3882
|
videoHeight: 0,
|
|
3852
3883
|
detectedObjects: [],
|
|
3853
3884
|
bestDocument: undefined,
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
documentType: 'none',
|
|
3885
|
+
detectedDocumentType: 'none',
|
|
3886
|
+
detectionThresholdMet: false,
|
|
3857
3887
|
documentInBounds: false,
|
|
3858
3888
|
documentTooClose: false,
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3889
|
+
flipRequired: false,
|
|
3890
|
+
backDetectedFirst: false,
|
|
3891
|
+
idCardFrontDetectionScore: 0,
|
|
3892
|
+
idCardFrontDetectionThresholdMet: false,
|
|
3893
|
+
idCardBackDetectionScore: 0,
|
|
3894
|
+
idCardBackDetectionThresholdMet: false,
|
|
3895
|
+
passportDetectionScore: 0,
|
|
3896
|
+
passportDetectionThresholdMet: false,
|
|
3867
3897
|
focusScore: 0,
|
|
3868
3898
|
focusThresholdMet: false,
|
|
3869
|
-
barcodeScanningEnabled: false,
|
|
3870
|
-
barcodeResult: null,
|
|
3871
|
-
waitingForBarcodeScan: false,
|
|
3872
|
-
shouldScanBarcode: false,
|
|
3873
|
-
autoCaptureBarcodeRequired: 'mobile',
|
|
3874
|
-
barcodeScanFailedAttempts: 0,
|
|
3875
|
-
maxBarcodeScanAttempts: 10,
|
|
3876
3899
|
isGoodFrame: false,
|
|
3877
3900
|
goodFramesCount: 0,
|
|
3878
3901
|
goodFramesThreshold: 3,
|
|
@@ -3886,8 +3909,6 @@ var initialState$4 = {
|
|
|
3886
3909
|
capturedDocuments: {},
|
|
3887
3910
|
captureRequirement: 'idCardOrPassport',
|
|
3888
3911
|
requestedDocumentType: 'idCardFront',
|
|
3889
|
-
detectedDocumentType: 'none',
|
|
3890
|
-
differentDocumentTypeDetections: 0,
|
|
3891
3912
|
operationStartedAt: null,
|
|
3892
3913
|
captureStartedAt: null
|
|
3893
3914
|
};
|
|
@@ -3922,11 +3943,6 @@ var reducer$4 = function reducer(state, action) {
|
|
|
3922
3943
|
newState.operationStartedAt = new Date();
|
|
3923
3944
|
return newState;
|
|
3924
3945
|
}
|
|
3925
|
-
case 'configureCapture':
|
|
3926
|
-
return tslib.__assign(tslib.__assign(tslib.__assign({}, state), action.payload), {
|
|
3927
|
-
capturing: false,
|
|
3928
|
-
captureFailed: false
|
|
3929
|
-
});
|
|
3930
3946
|
case 'setRequiredDocumentType':
|
|
3931
3947
|
return tslib.__assign(tslib.__assign({}, state), {
|
|
3932
3948
|
requiredDocumentType: action.payload
|
|
@@ -3963,18 +3979,15 @@ var reducer$4 = function reducer(state, action) {
|
|
|
3963
3979
|
case 'objectsDetected':
|
|
3964
3980
|
var _d = action.payload.prediction,
|
|
3965
3981
|
detectedObjects = _d.detectedObjects,
|
|
3966
|
-
detectionScore = _d.detectionScore,
|
|
3967
3982
|
detectionThresholdMet = _d.detectionThresholdMet,
|
|
3968
3983
|
detectedDocumentType = _d.detectedDocumentType,
|
|
3984
|
+
idCardFrontDetectionScore = _d.idCardFrontDetectionScore,
|
|
3985
|
+
idCardFrontDetectionThresholdMet = _d.idCardFrontDetectionThresholdMet,
|
|
3986
|
+
idCardBackDetectionScore = _d.idCardBackDetectionScore,
|
|
3987
|
+
idCardBackDetectionThresholdMet = _d.idCardBackDetectionThresholdMet,
|
|
3969
3988
|
passportDetectionScore = _d.passportDetectionScore,
|
|
3970
3989
|
passportDetectionThresholdMet = _d.passportDetectionThresholdMet,
|
|
3971
|
-
mrzDetectionScore = _d.mrzDetectionScore,
|
|
3972
|
-
mrzDetectionThresholdMet = _d.mrzDetectionThresholdMet,
|
|
3973
|
-
pdf417DetectionScore = _d.pdf417DetectionScore,
|
|
3974
|
-
pdf417DetectionThresholdMet = _d.pdf417DetectionThresholdMet,
|
|
3975
3990
|
bestDocument = _d.bestDocument,
|
|
3976
|
-
bestMrz = _d.bestMrz,
|
|
3977
|
-
bestPdf417 = _d.bestPdf417,
|
|
3978
3991
|
documentInBounds = _d.documentInBounds,
|
|
3979
3992
|
documentTooClose = _d.documentTooClose,
|
|
3980
3993
|
focusScore = _d.focusScore,
|
|
@@ -3990,84 +4003,50 @@ var reducer$4 = function reducer(state, action) {
|
|
|
3990
4003
|
goodFramesThreshold = Math.ceil(3 * frameCaptureRate);
|
|
3991
4004
|
}
|
|
3992
4005
|
}
|
|
3993
|
-
var
|
|
3994
|
-
var
|
|
3995
|
-
var
|
|
3996
|
-
var isGoodFrame = detectionThresholdMet && documentInBounds && !documentTooClose && focusThresholdMet;
|
|
4006
|
+
var flipRequired = state.requestedDocumentType === 'idCardBack' && detectedDocumentType === 'idCardFront';
|
|
4007
|
+
var backDetectedFirst = state.requestedDocumentType.includes('idCardFront') && detectedDocumentType === 'idCardBack';
|
|
4008
|
+
var isGoodFrame = detectionThresholdMet && documentInBounds && !documentTooClose && !flipRequired && !backDetectedFirst && focusThresholdMet;
|
|
3997
4009
|
var goodFramesCount = state.goodFramesCount;
|
|
3998
4010
|
if (isGoodFrame) {
|
|
3999
4011
|
goodFramesCount += 1;
|
|
4000
4012
|
}
|
|
4013
|
+
var goodFramesThresholdMet = goodFramesCount >= goodFramesThreshold;
|
|
4014
|
+
var requestedDocumentType = state.requestedDocumentType;
|
|
4015
|
+
if (state.captureRequirement === 'idCardOrPassport') {
|
|
4016
|
+
if (detectedDocumentType === 'passport' && state.requestedDocumentType !== 'passport') {
|
|
4017
|
+
requestedDocumentType = 'passport';
|
|
4018
|
+
}
|
|
4019
|
+
if (requestedDocumentType === 'passport' && passportDetectionScore < 0.3) {
|
|
4020
|
+
requestedDocumentType = 'idCardFront' in state.capturedDocuments ? 'idCardBack' : 'idCardFront';
|
|
4021
|
+
}
|
|
4022
|
+
}
|
|
4001
4023
|
return tslib.__assign(tslib.__assign({}, state), {
|
|
4002
4024
|
videoWidth: frameWidth,
|
|
4003
4025
|
videoHeight: frameHeight,
|
|
4004
4026
|
detectedObjects: detectedObjects,
|
|
4005
4027
|
bestDocument: bestDocument,
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4028
|
+
requestedDocumentType: requestedDocumentType,
|
|
4029
|
+
detectedDocumentType: detectedDocumentType,
|
|
4030
|
+
detectionThresholdMet: detectionThresholdMet,
|
|
4009
4031
|
documentInBounds: documentInBounds,
|
|
4010
4032
|
documentTooClose: documentTooClose,
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4033
|
+
flipRequired: flipRequired,
|
|
4034
|
+
backDetectedFirst: backDetectedFirst,
|
|
4035
|
+
idCardFrontDetectionScore: idCardFrontDetectionScore,
|
|
4036
|
+
idCardFrontDetectionThresholdMet: idCardFrontDetectionThresholdMet,
|
|
4037
|
+
idCardBackDetectionScore: idCardBackDetectionScore,
|
|
4038
|
+
idCardBackDetectionThresholdMet: idCardBackDetectionThresholdMet,
|
|
4039
|
+
passportDetectionScore: passportDetectionScore,
|
|
4040
|
+
passportDetectionThresholdMet: passportDetectionThresholdMet,
|
|
4019
4041
|
focusScore: focusScore,
|
|
4020
4042
|
focusThresholdMet: focusThresholdMet,
|
|
4021
|
-
shouldScanBarcode: shouldScanBarcode,
|
|
4022
|
-
waitingForBarcodeScan: waitingForBarcodeScan,
|
|
4023
4043
|
isGoodFrame: isGoodFrame,
|
|
4024
4044
|
goodFramesCount: goodFramesCount,
|
|
4025
4045
|
goodFramesThreshold: goodFramesThreshold,
|
|
4026
|
-
goodFramesThresholdMet:
|
|
4046
|
+
goodFramesThresholdMet: goodFramesThresholdMet,
|
|
4027
4047
|
lastFrameCapturedAt: frameCapturedAt,
|
|
4028
4048
|
frameCaptureRate: frameCaptureRate
|
|
4029
4049
|
});
|
|
4030
|
-
case 'predictionMade':
|
|
4031
|
-
{
|
|
4032
|
-
var _e = action.payload,
|
|
4033
|
-
detectedDocumentType_1 = _e.detectedDocumentType,
|
|
4034
|
-
passportDetectionScore_1 = _e.passportDetectionScore;
|
|
4035
|
-
var requestedDocumentType = state.requestedDocumentType;
|
|
4036
|
-
var newState = tslib.__assign(tslib.__assign({}, state), {
|
|
4037
|
-
detectedDocumentType: detectedDocumentType_1
|
|
4038
|
-
});
|
|
4039
|
-
if (state.captureRequirement === 'idCardOrPassport') {
|
|
4040
|
-
var predictionIsRequestedType = requestedDocumentType.startsWith(detectedDocumentType_1);
|
|
4041
|
-
if (predictionIsRequestedType) {
|
|
4042
|
-
newState.differentDocumentTypeDetections = 0;
|
|
4043
|
-
}
|
|
4044
|
-
if (detectedDocumentType_1 === 'passport' && requestedDocumentType !== 'passport') {
|
|
4045
|
-
newState.requestedDocumentType = 'passport';
|
|
4046
|
-
}
|
|
4047
|
-
if (requestedDocumentType === 'passport' && passportDetectionScore_1 < 0.3) {
|
|
4048
|
-
newState.requestedDocumentType = 'idCardFront' in state.capturedDocuments ? 'idCardBack' : 'idCardFront';
|
|
4049
|
-
}
|
|
4050
|
-
}
|
|
4051
|
-
return newState;
|
|
4052
|
-
}
|
|
4053
|
-
case 'barcodeScanned':
|
|
4054
|
-
return tslib.__assign(tslib.__assign({}, state), {
|
|
4055
|
-
barcodeResult: action.payload.result,
|
|
4056
|
-
waitingForBarcodeScan: false,
|
|
4057
|
-
autoCaptureBarcodeRequired: false
|
|
4058
|
-
});
|
|
4059
|
-
case 'barcodeScanFailed':
|
|
4060
|
-
{
|
|
4061
|
-
var newState = tslib.__assign(tslib.__assign({}, state), {
|
|
4062
|
-
barcodeScanFailedAttempts: state.barcodeScanFailedAttempts + 1
|
|
4063
|
-
});
|
|
4064
|
-
if (newState.barcodeScanFailedAttempts >= newState.maxBarcodeScanAttempts) {
|
|
4065
|
-
newState.autoCaptureBarcodeRequired = false;
|
|
4066
|
-
newState.shouldScanBarcode = false;
|
|
4067
|
-
newState.waitingForBarcodeScan = false;
|
|
4068
|
-
}
|
|
4069
|
-
return newState;
|
|
4070
|
-
}
|
|
4071
4050
|
case 'captureStarted':
|
|
4072
4051
|
return tslib.__assign(tslib.__assign({}, state), {
|
|
4073
4052
|
captureStartedAt: new Date(),
|
|
@@ -4119,8 +4098,9 @@ var reducer$4 = function reducer(state, action) {
|
|
|
4119
4098
|
newState_1.requestedDocumentType = remainingRequirements[0];
|
|
4120
4099
|
if (state.requestedDocumentType === 'idCardFront' && newState_1.requestedDocumentType === 'idCardBack') {
|
|
4121
4100
|
newState_1.captureState = 'requestingFlip';
|
|
4122
|
-
newState_1.
|
|
4123
|
-
newState_1.
|
|
4101
|
+
newState_1.idCardFrontDetectionThresholdMet = false;
|
|
4102
|
+
newState_1.idCardBackDetectionThresholdMet = false;
|
|
4103
|
+
newState_1.passportDetectionThresholdMet = false;
|
|
4124
4104
|
}
|
|
4125
4105
|
}
|
|
4126
4106
|
return newState_1;
|
|
@@ -4151,8 +4131,9 @@ var reducer$4 = function reducer(state, action) {
|
|
|
4151
4131
|
newState_2.requestedDocumentType = remainingRequirements[0];
|
|
4152
4132
|
if (state.requestedDocumentType === 'idCardFront' && newState_2.requestedDocumentType === 'idCardBack') {
|
|
4153
4133
|
newState_2.captureState = 'requestingFlip';
|
|
4154
|
-
newState_2.
|
|
4155
|
-
newState_2.
|
|
4134
|
+
newState_2.idCardFrontDetectionThresholdMet = false;
|
|
4135
|
+
newState_2.idCardBackDetectionThresholdMet = false;
|
|
4136
|
+
newState_2.passportDetectionThresholdMet = false;
|
|
4156
4137
|
}
|
|
4157
4138
|
}
|
|
4158
4139
|
return newState_2;
|
|
@@ -4597,85 +4578,42 @@ var templateObject_1$A, templateObject_2$p;
|
|
|
4597
4578
|
var DEFAULT_CDN_URL = 'https://websdk-cdn-dev.idmission.com/assets';
|
|
4598
4579
|
|
|
4599
4580
|
var IdCapture = function IdCapture(_a) {
|
|
4600
|
-
var _b, _c, _d, _e, _f, _g, _h, _j
|
|
4581
|
+
var _b, _c, _d, _e, _f, _g, _h, _j;
|
|
4601
4582
|
var requiredDocumentType = _a.requiredDocumentType,
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
_o = _a.autoCaptureBarcodeRequired,
|
|
4605
|
-
autoCaptureBarcodeRequired = _o === void 0 ? 'mobile' : _o,
|
|
4606
|
-
_p = _a.idCardDetectionThreshold,
|
|
4607
|
-
idCardDetectionThreshold = _p === void 0 ? defaultDocumentDetectionThresholds.idCard : _p,
|
|
4608
|
-
_q = _a.passportDetectionThreshold,
|
|
4609
|
-
passportDetectionThreshold = _q === void 0 ? defaultDocumentDetectionThresholds.passport : _q,
|
|
4610
|
-
_r = _a.mrzDetectionScoreThreshold,
|
|
4611
|
-
mrzDetectionScoreThreshold = _r === void 0 ? defaultDocumentDetectionThresholds.mrz : _r,
|
|
4612
|
-
_s = _a.pdf417DetectionThreshold,
|
|
4613
|
-
pdf417DetectionThreshold = _s === void 0 ? defaultDocumentDetectionThresholds.pdf417 : _s,
|
|
4614
|
-
_t = _a.idCardFocusScoreThreshold,
|
|
4615
|
-
idCardFocusScoreThreshold = _t === void 0 ? (_b = defaultFocusThresholds.idCard) === null || _b === void 0 ? void 0 : _b.mobile : _t,
|
|
4616
|
-
_u = _a.passportFocusScoreThreshold,
|
|
4617
|
-
passportFocusScoreThreshold = _u === void 0 ? (_c = defaultFocusThresholds.passport) === null || _c === void 0 ? void 0 : _c.mobile : _u,
|
|
4618
|
-
_v = _a.barcodeScanningEnabled,
|
|
4619
|
-
barcodeScanningEnabled = _v === void 0 ? true : _v,
|
|
4620
|
-
_w = _a.maxBarcodeScanAttempts,
|
|
4621
|
-
maxBarcodeScanAttempts = _w === void 0 ? 10 : _w,
|
|
4583
|
+
_k = _a.thresholds,
|
|
4584
|
+
thresholds = _k === void 0 ? defaultIdCaptureThresholds : _k,
|
|
4622
4585
|
guidanceMessage = _a.guidanceMessage,
|
|
4623
4586
|
guidanceSatisfied = _a.guidanceSatisfied,
|
|
4624
|
-
onPrediction = _a.onPrediction,
|
|
4625
4587
|
onCapture = _a.onCapture,
|
|
4626
|
-
|
|
4627
|
-
assets =
|
|
4628
|
-
|
|
4629
|
-
classNames =
|
|
4630
|
-
|
|
4631
|
-
colors =
|
|
4632
|
-
|
|
4633
|
-
rawVerbiage =
|
|
4634
|
-
|
|
4635
|
-
debugMode =
|
|
4636
|
-
var
|
|
4637
|
-
ref =
|
|
4638
|
-
|
|
4639
|
-
width =
|
|
4640
|
-
|
|
4641
|
-
height =
|
|
4642
|
-
var
|
|
4643
|
-
state =
|
|
4644
|
-
dispatch =
|
|
4588
|
+
_l = _a.assets,
|
|
4589
|
+
assets = _l === void 0 ? {} : _l,
|
|
4590
|
+
_m = _a.classNames,
|
|
4591
|
+
classNames = _m === void 0 ? {} : _m,
|
|
4592
|
+
_o = _a.colors,
|
|
4593
|
+
colors = _o === void 0 ? {} : _o,
|
|
4594
|
+
_p = _a.verbiage,
|
|
4595
|
+
rawVerbiage = _p === void 0 ? {} : _p,
|
|
4596
|
+
_q = _a.debugMode,
|
|
4597
|
+
debugMode = _q === void 0 ? false : _q;
|
|
4598
|
+
var _r = useResizeObserver__default['default'](),
|
|
4599
|
+
ref = _r.ref,
|
|
4600
|
+
_s = _r.width,
|
|
4601
|
+
width = _s === void 0 ? 1 : _s,
|
|
4602
|
+
_t = _r.height,
|
|
4603
|
+
height = _t === void 0 ? 1 : _t;
|
|
4604
|
+
var _u = useIdCaptureState(),
|
|
4605
|
+
state = _u[0],
|
|
4606
|
+
dispatch = _u[1];
|
|
4645
4607
|
var cameraRef = React.useContext(CameraStateContext).cameraRef;
|
|
4646
|
-
var
|
|
4647
|
-
modelsReady =
|
|
4648
|
-
setThresholds =
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
getBestFrame = _6.getBestFrame;
|
|
4608
|
+
var _v = React.useContext(IdCaptureModelsContext),
|
|
4609
|
+
modelsReady = _v.ready,
|
|
4610
|
+
setThresholds = _v.setThresholds,
|
|
4611
|
+
detectionTime = _v.detectionTime,
|
|
4612
|
+
focusPredictionTime = _v.focusPredictionTime,
|
|
4613
|
+
getBestFrame = _v.getBestFrame;
|
|
4653
4614
|
React.useEffect(function () {
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
payload: {
|
|
4657
|
-
autoCaptureBarcodeRequired: autoCaptureBarcodeRequired,
|
|
4658
|
-
barcodeScanningEnabled: barcodeScanningEnabled,
|
|
4659
|
-
maxBarcodeScanAttempts: maxBarcodeScanAttempts
|
|
4660
|
-
}
|
|
4661
|
-
});
|
|
4662
|
-
}, [autoCaptureBarcodeRequired, barcodeScanningEnabled, dispatch, maxBarcodeScanAttempts]);
|
|
4663
|
-
React.useEffect(function () {
|
|
4664
|
-
setThresholds({
|
|
4665
|
-
idCard: idCardDetectionThreshold,
|
|
4666
|
-
passport: passportDetectionThreshold,
|
|
4667
|
-
mrz: mrzDetectionScoreThreshold,
|
|
4668
|
-
pdf417: pdf417DetectionThreshold,
|
|
4669
|
-
focus: {
|
|
4670
|
-
idCard: {
|
|
4671
|
-
mobile: idCardFocusScoreThreshold
|
|
4672
|
-
},
|
|
4673
|
-
passport: {
|
|
4674
|
-
mobile: passportFocusScoreThreshold
|
|
4675
|
-
}
|
|
4676
|
-
}
|
|
4677
|
-
});
|
|
4678
|
-
}, [idCardDetectionThreshold, idCardFocusScoreThreshold, mrzDetectionScoreThreshold, passportDetectionThreshold, passportFocusScoreThreshold, pdf417DetectionThreshold, setThresholds]);
|
|
4615
|
+
setThresholds(thresholds);
|
|
4616
|
+
}, [thresholds, setThresholds]);
|
|
4679
4617
|
React.useEffect(function () {
|
|
4680
4618
|
if (!requiredDocumentType) return;
|
|
4681
4619
|
dispatch({
|
|
@@ -4692,18 +4630,7 @@ var IdCapture = function IdCapture(_a) {
|
|
|
4692
4630
|
}
|
|
4693
4631
|
});
|
|
4694
4632
|
}, [dispatch, height, width]);
|
|
4695
|
-
|
|
4696
|
-
onPredictionMade(function (prediction) {
|
|
4697
|
-
dispatch({
|
|
4698
|
-
type: 'objectsDetected',
|
|
4699
|
-
payload: {
|
|
4700
|
-
prediction: prediction
|
|
4701
|
-
}
|
|
4702
|
-
});
|
|
4703
|
-
onPrediction === null || onPrediction === void 0 ? void 0 : onPrediction(prediction);
|
|
4704
|
-
});
|
|
4705
|
-
}, [dispatch, onPrediction, onPredictionMade]);
|
|
4706
|
-
var shouldCapture = autoCaptureEnabled && state.goodFramesThresholdMet && !state.capturing && !state.waitingForBarcodeScan && timeSince(state.captureStartedAt) >= 3000;
|
|
4633
|
+
var shouldCapture = state.goodFramesThresholdMet && !state.capturing && timeSince(state.captureStartedAt) >= 3000;
|
|
4707
4634
|
React.useEffect(function () {
|
|
4708
4635
|
if (!shouldCapture) return;
|
|
4709
4636
|
dispatch({
|
|
@@ -4717,29 +4644,13 @@ var IdCapture = function IdCapture(_a) {
|
|
|
4717
4644
|
});
|
|
4718
4645
|
return;
|
|
4719
4646
|
}
|
|
4720
|
-
var
|
|
4647
|
+
var canvas = bestFrame.canvas,
|
|
4721
4648
|
documentType = bestFrame.documentType,
|
|
4722
4649
|
boundingBox = bestFrame.boundingBox,
|
|
4723
4650
|
detectionScore = bestFrame.detectionScore,
|
|
4724
4651
|
focusScore = bestFrame.focusScore;
|
|
4725
|
-
var width =
|
|
4726
|
-
height =
|
|
4727
|
-
var canvas = originalCanvas;
|
|
4728
|
-
// resize image to 2k max if barcode is read
|
|
4729
|
-
var isGreaterThan2k = width > 1920 && height > 1080 || width > 1080 && height > 1920;
|
|
4730
|
-
if (isGreaterThan2k && !!state.barcodeResult) {
|
|
4731
|
-
canvas = document.createElement('canvas');
|
|
4732
|
-
if (width > height) {
|
|
4733
|
-
canvas.width = 1920;
|
|
4734
|
-
canvas.height = height * (1920 / width);
|
|
4735
|
-
} else {
|
|
4736
|
-
canvas.height = 1920;
|
|
4737
|
-
canvas.width = width * (1920 / height);
|
|
4738
|
-
}
|
|
4739
|
-
var ctx2d = canvas.getContext('2d');
|
|
4740
|
-
if (!ctx2d) return;
|
|
4741
|
-
ctx2d.drawImage(originalCanvas, 0, 0, canvas.width, canvas.height);
|
|
4742
|
-
}
|
|
4652
|
+
var width = canvas.width,
|
|
4653
|
+
height = canvas.height;
|
|
4743
4654
|
var imageUrl = canvas.toDataURL('image/jpeg', 0.95);
|
|
4744
4655
|
dispatch({
|
|
4745
4656
|
type: 'frameCaptured',
|
|
@@ -4763,18 +4674,18 @@ var IdCapture = function IdCapture(_a) {
|
|
|
4763
4674
|
type: 'captured'
|
|
4764
4675
|
});
|
|
4765
4676
|
}, 0);
|
|
4766
|
-
}, [dispatch, getBestFrame, onCapture, shouldCapture, state.
|
|
4677
|
+
}, [dispatch, getBestFrame, onCapture, shouldCapture, state.captureStartedAt, state.requestedDocumentType]);
|
|
4767
4678
|
assets.portraitGuidesImageUrl || (assets.portraitGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Portrait-2.svg"));
|
|
4768
4679
|
assets.landscapeGuidesImageUrl || (assets.landscapeGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Landscape-2.svg"));
|
|
4769
4680
|
var theme = styled.useTheme();
|
|
4770
|
-
colors.guideBoxUnsatisfiedColor || (colors.guideBoxUnsatisfiedColor = (
|
|
4771
|
-
colors.guideBoxSatisfiedColor || (colors.guideBoxSatisfiedColor = (
|
|
4681
|
+
colors.guideBoxUnsatisfiedColor || (colors.guideBoxUnsatisfiedColor = (_d = (_c = (_b = theme.idCapture) === null || _b === void 0 ? void 0 : _b.guideBox) === null || _c === void 0 ? void 0 : _c.unsatisfiedColor) !== null && _d !== void 0 ? _d : 'white');
|
|
4682
|
+
colors.guideBoxSatisfiedColor || (colors.guideBoxSatisfiedColor = (_g = (_f = (_e = theme.idCapture) === null || _e === void 0 ? void 0 : _e.guideBox) === null || _f === void 0 ? void 0 : _f.satisfiedColor) !== null && _g !== void 0 ? _g : 'green');
|
|
4772
4683
|
var verbiage = useTranslations(rawVerbiage, {
|
|
4773
4684
|
instructionText: 'Scan the front of ID',
|
|
4774
4685
|
processingIdCardText: 'ID card front captured.',
|
|
4775
|
-
|
|
4776
|
-
|
|
4777
|
-
|
|
4686
|
+
guidanceSatisfiedText: "".concat(documentTypeDisplayNames[state.detectedDocumentType], " detected, hold still..."),
|
|
4687
|
+
guidancePleaseFlipText: 'ID card front detected - please flip your ID card',
|
|
4688
|
+
guidanceBackDetectedFirstText: 'ID card back detected - please flip your ID card',
|
|
4778
4689
|
guidanceTooBlurryText: 'Document out of focus – try improving the lighting',
|
|
4779
4690
|
guidanceNotCenteredText: 'Document is not centered',
|
|
4780
4691
|
guidanceTooCloseText: 'Document too close, please back up',
|
|
@@ -4789,10 +4700,10 @@ var IdCapture = function IdCapture(_a) {
|
|
|
4789
4700
|
});
|
|
4790
4701
|
var satisfied = state.isGoodFrame;
|
|
4791
4702
|
if (typeof guidanceSatisfied === 'boolean') satisfied = guidanceSatisfied;
|
|
4792
|
-
guidanceMessage || (guidanceMessage = satisfied ? verbiage.guidanceSatisfiedText : !state.
|
|
4703
|
+
guidanceMessage || (guidanceMessage = satisfied ? verbiage.guidanceSatisfiedText : !state.detectionThresholdMet ? verbiage.guidanceNotDetectedText : state.backDetectedFirst ? verbiage.guidanceBackDetectedFirstText : state.flipRequired ? verbiage.guidancePleaseFlipText : !state.documentInBounds ? verbiage.guidanceNotCenteredText : state.documentTooClose ? verbiage.guidanceTooCloseText : !state.focusThresholdMet ? verbiage.guidanceTooBlurryText : '');
|
|
4793
4704
|
return /*#__PURE__*/React__default['default'].createElement(PageContainer, {
|
|
4794
4705
|
ref: ref,
|
|
4795
|
-
className: "flex ".concat((
|
|
4706
|
+
className: "flex ".concat((_h = classNames.container) !== null && _h !== void 0 ? _h : '')
|
|
4796
4707
|
}, guidanceMessage !== '' && ( /*#__PURE__*/React__default['default'].createElement(GuidanceMessageContainer, {
|
|
4797
4708
|
"$top": "",
|
|
4798
4709
|
"$bottom": "12.5dvh",
|
|
@@ -4801,7 +4712,7 @@ var IdCapture = function IdCapture(_a) {
|
|
|
4801
4712
|
"$variant": satisfied ? 'positive' : 'default',
|
|
4802
4713
|
className: classNames.guidanceMessage
|
|
4803
4714
|
}, guidanceMessage))), debugMode && ( /*#__PURE__*/React__default['default'].createElement(DebugBoundingBoxOverlay, {
|
|
4804
|
-
"$flipX": !((
|
|
4715
|
+
"$flipX": !((_j = cameraRef.current) === null || _j === void 0 ? void 0 : _j.isRearFacing),
|
|
4805
4716
|
scaling: debugScalingDetails
|
|
4806
4717
|
}, state.detectedObjects.map(function (obj, i) {
|
|
4807
4718
|
var _a;
|
|
@@ -4811,7 +4722,7 @@ var IdCapture = function IdCapture(_a) {
|
|
|
4811
4722
|
scaling: debugScalingDetails,
|
|
4812
4723
|
flipX: !((_a = cameraRef.current) === null || _a === void 0 ? void 0 : _a.isRearFacing)
|
|
4813
4724
|
});
|
|
4814
|
-
}))), debugMode && ( /*#__PURE__*/React__default['default'].createElement(DebugStatsPane, null, cameraRef.current ? ( /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, "\u2705 Camera: ", cameraRef.current.label, " (", cameraRef.current.width, "x", cameraRef.current.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React__default['default'].createElement("br", null), state.frameCaptureRate > 0.75 ? '✅' : '👎', " Frame Rate:", ' ', Math.round((state.frameCaptureRate + Number.EPSILON) * 1000) / 1000, ' ', "fps (", detectionTime, "ms doc detect, ", focusPredictionTime, "ms focus)", /*#__PURE__*/React__default['default'].createElement("br", null), modelsReady ? ( /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, state.
|
|
4725
|
+
}))), debugMode && ( /*#__PURE__*/React__default['default'].createElement(DebugStatsPane, null, cameraRef.current ? ( /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, "\u2705 Camera: ", cameraRef.current.label, " (", cameraRef.current.width, "x", cameraRef.current.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React__default['default'].createElement("br", null), state.frameCaptureRate > 0.75 ? '✅' : '👎', " Frame Rate:", ' ', Math.round((state.frameCaptureRate + Number.EPSILON) * 1000) / 1000, ' ', "fps (", detectionTime, "ms doc detect, ", focusPredictionTime, "ms focus)", /*#__PURE__*/React__default['default'].createElement("br", null), modelsReady ? ( /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, state.detectionThresholdMet ? '✅' : '❌', " Detected Document Type: ", state.detectedDocumentType, /*#__PURE__*/React__default['default'].createElement("br", null), state.idCardFrontDetectionThresholdMet ? '✅' : '❌', " ID Card Front Score: ", state.idCardFrontDetectionScore.toFixed(3), /*#__PURE__*/React__default['default'].createElement("br", null), state.idCardBackDetectionThresholdMet ? '✅' : '❌', " ID Card Back Score: ", state.idCardBackDetectionScore.toFixed(3), /*#__PURE__*/React__default['default'].createElement("br", null), state.passportDetectionThresholdMet ? '✅' : '❌', " Passport Score: ", state.passportDetectionScore.toFixed(3), /*#__PURE__*/React__default['default'].createElement("br", null), state.focusThresholdMet ? '✅' : '❌', " Focus Score:", ' ', state.focusScore.toFixed(3), /*#__PURE__*/React__default['default'].createElement("br", null), state.documentInBounds ? '✅' : '❌', " Document In Bounds", /*#__PURE__*/React__default['default'].createElement("br", null), state.goodFramesThresholdMet ? '✅' : '❌', " Good Frame Count:", ' ', state.goodFramesCount, "/", state.goodFramesThreshold)) : ( /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, "\u274C Models not ready")))));
|
|
4815
4726
|
};
|
|
4816
4727
|
var timeSince = function timeSince(t) {
|
|
4817
4728
|
if (!t) return 0;
|
|
@@ -5745,11 +5656,7 @@ var CapturedDocumentImg = function CapturedDocumentImg(_a) {
|
|
|
5745
5656
|
setUrl(cropToDetectedObjectBox(imgRef.current, bbox).toDataURL('image/jpeg', 0.95));
|
|
5746
5657
|
}, 100);
|
|
5747
5658
|
}
|
|
5748
|
-
return /*#__PURE__*/React__default['default'].createElement("
|
|
5749
|
-
style: {
|
|
5750
|
-
position: 'relative'
|
|
5751
|
-
}
|
|
5752
|
-
}, /*#__PURE__*/React__default['default'].createElement("img", {
|
|
5659
|
+
return /*#__PURE__*/React__default['default'].createElement("img", {
|
|
5753
5660
|
ref: imgRef,
|
|
5754
5661
|
alt: alt,
|
|
5755
5662
|
className: className,
|
|
@@ -5769,13 +5676,12 @@ var CapturedDocumentImg = function CapturedDocumentImg(_a) {
|
|
|
5769
5676
|
(_a = link.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(link);
|
|
5770
5677
|
});
|
|
5771
5678
|
}
|
|
5772
|
-
})
|
|
5679
|
+
});
|
|
5773
5680
|
};
|
|
5774
5681
|
|
|
5775
5682
|
var OverlayInstruction = styled__default['default'].p(templateObject_1$u || (templateObject_1$u = tslib.__makeTemplateObject(["\n font-size: 18px;\n margin: 30px 0;\n"], ["\n font-size: 18px;\n margin: 30px 0;\n"])));
|
|
5776
5683
|
var IdCaptureSuccess = function IdCaptureSuccess(_a) {
|
|
5777
5684
|
var capturedDocuments = _a.capturedDocuments,
|
|
5778
|
-
// barcodeResult,
|
|
5779
5685
|
onSubmitClick = _a.onSubmitClick,
|
|
5780
5686
|
onRetryClick = _a.onRetryClick,
|
|
5781
5687
|
_b = _a.classNames,
|
|
@@ -5783,7 +5689,9 @@ var IdCaptureSuccess = function IdCaptureSuccess(_a) {
|
|
|
5783
5689
|
_c = _a.colors,
|
|
5784
5690
|
colors = _c === void 0 ? {} : _c,
|
|
5785
5691
|
_d = _a.verbiage,
|
|
5786
|
-
rawVerbiage = _d === void 0 ? {} : _d
|
|
5692
|
+
rawVerbiage = _d === void 0 ? {} : _d,
|
|
5693
|
+
_e = _a.debugMode,
|
|
5694
|
+
debugMode = _e === void 0 ? false : _e;
|
|
5787
5695
|
var submissionStatus = React.useContext(SubmissionContext).submissionStatus;
|
|
5788
5696
|
var idCardFront = capturedDocuments.idCardFront,
|
|
5789
5697
|
idCardBack = capturedDocuments.idCardBack,
|
|
@@ -5818,7 +5726,7 @@ var IdCaptureSuccess = function IdCaptureSuccess(_a) {
|
|
|
5818
5726
|
image: idCardFront,
|
|
5819
5727
|
className: classNames.image,
|
|
5820
5728
|
alt: verbiage.idCardFrontText
|
|
5821
|
-
})))), idCardBack && ( /*#__PURE__*/React__default['default'].createElement(ImageCol$1, {
|
|
5729
|
+
})), debugMode && ( /*#__PURE__*/React__default['default'].createElement("pre", null, "Detection Score: ".concat(idCardFront.detectionScore, "\nFocus Score: ").concat(idCardFront.focusScore, "\nBounding Box: ").concat(JSON.stringify(idCardFront.boundingBox)))))), idCardBack && ( /*#__PURE__*/React__default['default'].createElement(ImageCol$1, {
|
|
5822
5730
|
className: classNames.imageCol
|
|
5823
5731
|
}, /*#__PURE__*/React__default['default'].createElement(ImageHeading, {
|
|
5824
5732
|
className: classNames.imageHeading
|
|
@@ -5828,7 +5736,7 @@ var IdCaptureSuccess = function IdCaptureSuccess(_a) {
|
|
|
5828
5736
|
image: idCardBack,
|
|
5829
5737
|
className: classNames.image,
|
|
5830
5738
|
alt: verbiage.idCardBackText
|
|
5831
|
-
})))), passport && ( /*#__PURE__*/React__default['default'].createElement(ImageCol$1, {
|
|
5739
|
+
})), debugMode && ( /*#__PURE__*/React__default['default'].createElement("pre", null, "Detection Score: ".concat(idCardBack.detectionScore, "\nFocus Score: ").concat(idCardBack.focusScore, "\nBounding Box: ").concat(JSON.stringify(idCardBack.boundingBox)))))), passport && ( /*#__PURE__*/React__default['default'].createElement(ImageCol$1, {
|
|
5832
5740
|
className: classNames.imageCol
|
|
5833
5741
|
}, /*#__PURE__*/React__default['default'].createElement(ImageHeading, {
|
|
5834
5742
|
className: classNames.imageHeading
|
|
@@ -5838,7 +5746,7 @@ var IdCaptureSuccess = function IdCaptureSuccess(_a) {
|
|
|
5838
5746
|
image: passport,
|
|
5839
5747
|
className: classNames.image,
|
|
5840
5748
|
alt: verbiage.passportText
|
|
5841
|
-
})))))), /*#__PURE__*/React__default['default'].createElement(OverlayInstruction, {
|
|
5749
|
+
})), debugMode && ( /*#__PURE__*/React__default['default'].createElement("pre", null, "Detection Score: ".concat(passport.detectionScore, "\nFocus Score: ").concat(passport.focusScore, "\nBounding Box: ").concat(JSON.stringify(passport.boundingBox)))))))), /*#__PURE__*/React__default['default'].createElement(OverlayInstruction, {
|
|
5842
5750
|
className: classNames.instruction
|
|
5843
5751
|
}, verbiage.instructionText), /*#__PURE__*/React__default['default'].createElement(ButtonsRow, {
|
|
5844
5752
|
className: classNames.buttonsRow
|
|
@@ -6440,13 +6348,8 @@ function IdCaptureGuides(_a) {
|
|
|
6440
6348
|
var cameraRef = React.useContext(CameraStateContext).cameraRef;
|
|
6441
6349
|
var verbiage = useTranslations(rawVerbiage, {
|
|
6442
6350
|
instructionText: 'Scan the front of ID',
|
|
6443
|
-
processingIdCardText: 'ID card front captured.',
|
|
6444
6351
|
capturingText: 'Capturing...',
|
|
6445
|
-
captureFailedText: 'Capture failed!'
|
|
6446
|
-
guidanceSatisfiedText: 'Document detected, hold still...',
|
|
6447
|
-
guidanceTooBlurryText: 'Document out of focus – try improving the lighting',
|
|
6448
|
-
guidanceNotCenteredText: 'Document is not centered',
|
|
6449
|
-
guidanceNotDetectedText: 'Document not detected'
|
|
6352
|
+
captureFailedText: 'Capture failed!'
|
|
6450
6353
|
});
|
|
6451
6354
|
var isMobile = window.innerWidth < window.innerHeight;
|
|
6452
6355
|
var frontImageUrl = portraitGuidesOnMobile && isMobile ? flipIdPromptAssets === null || flipIdPromptAssets === void 0 ? void 0 : flipIdPromptAssets.frontPortraitGuidesImageUrl : flipIdPromptAssets === null || flipIdPromptAssets === void 0 ? void 0 : flipIdPromptAssets.frontLandscapeGuidesImageUrl;
|
|
@@ -6460,7 +6363,7 @@ function IdCaptureGuides(_a) {
|
|
|
6460
6363
|
landscapeGuidesImageUrl: assets.landscapeGuidesImageUrl,
|
|
6461
6364
|
isMirrored: !((_b = cameraRef.current) === null || _b === void 0 ? void 0 : _b.isRearFacing),
|
|
6462
6365
|
borderColor: state.isGoodFrame ? colors.guideBoxSatisfiedColor : colors.guideBoxUnsatisfiedColor,
|
|
6463
|
-
imageVisible: requestingFlip || !state.
|
|
6366
|
+
imageVisible: requestingFlip || !state.idCardFrontDetectionThresholdMet || !state.documentInBounds || state.documentTooClose
|
|
6464
6367
|
})), guideType === 'fit' && ( /*#__PURE__*/React__default['default'].createElement(IdCaptureFitGuide, {
|
|
6465
6368
|
classNames: classNames,
|
|
6466
6369
|
requestingFlip: requestingFlip,
|
|
@@ -6470,7 +6373,7 @@ function IdCaptureGuides(_a) {
|
|
|
6470
6373
|
backImageUrl: backImageUrl,
|
|
6471
6374
|
isMirrored: !((_c = cameraRef.current) === null || _c === void 0 ? void 0 : _c.isRearFacing),
|
|
6472
6375
|
borderColor: state.isGoodFrame ? colors.guideBoxSatisfiedColor : colors.guideBoxUnsatisfiedColor,
|
|
6473
|
-
imageVisible: requestingFlip || !state.
|
|
6376
|
+
imageVisible: requestingFlip || !state.detectionThresholdMet || !state.documentInBounds || state.documentTooClose || state.flipRequired
|
|
6474
6377
|
})));
|
|
6475
6378
|
}
|
|
6476
6379
|
|
|
@@ -7365,78 +7268,66 @@ var StyledButtonsRow$8 = styled__default['default'](ButtonsRow)(templateObject_6
|
|
|
7365
7268
|
var templateObject_1$l, templateObject_2$f, templateObject_3$d, templateObject_4$8, templateObject_5$4, templateObject_6$3;
|
|
7366
7269
|
|
|
7367
7270
|
var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
7368
|
-
var _b, _c, _d, _e, _f, _g
|
|
7369
|
-
var _k, _l, _m, _o, _p, _q, _r, _s
|
|
7271
|
+
var _b, _c, _d, _e, _f, _g;
|
|
7272
|
+
var _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
7370
7273
|
var onSuccess = _a.onSuccess,
|
|
7371
7274
|
onExitCapture = _a.onExitCapture,
|
|
7372
7275
|
onUserCancel = _a.onUserCancel,
|
|
7373
|
-
|
|
7374
|
-
loadingOverlayMode =
|
|
7276
|
+
_t = _a.loadingOverlayMode,
|
|
7277
|
+
loadingOverlayMode = _t === void 0 ? 'default' : _t,
|
|
7375
7278
|
precapturedDocuments = _a.precapturedDocuments,
|
|
7376
|
-
|
|
7377
|
-
captureRequirement =
|
|
7378
|
-
|
|
7379
|
-
separateIdCardCaptureSequence =
|
|
7380
|
-
|
|
7381
|
-
|
|
7382
|
-
|
|
7383
|
-
|
|
7384
|
-
_0 = _a.barcodeScanningEnabled,
|
|
7385
|
-
barcodeScanningEnabled = _0 === void 0 ? false : _0,
|
|
7386
|
-
_1 = _a.idCardAutoCaptureScoreThreshold,
|
|
7387
|
-
idCardAutoCaptureScoreThreshold = _1 === void 0 ? defaultDocumentDetectionThresholds.idCard : _1,
|
|
7388
|
-
_2 = _a.passportAutoCaptureScoreThreshold,
|
|
7389
|
-
passportAutoCaptureScoreThreshold = _2 === void 0 ? defaultDocumentDetectionThresholds.passport : _2,
|
|
7390
|
-
_3 = _a.mrzDetectionScoreThreshold,
|
|
7391
|
-
mrzDetectionScoreThreshold = _3 === void 0 ? defaultDocumentDetectionThresholds.mrz : _3,
|
|
7392
|
-
_4 = _a.idCardFocusScoreThreshold,
|
|
7393
|
-
idCardFocusScoreThreshold = _4 === void 0 ? (_b = defaultFocusThresholds.idCard) === null || _b === void 0 ? void 0 : _b.mobile : _4,
|
|
7394
|
-
_5 = _a.passportFocusScoreThreshold,
|
|
7395
|
-
passportFocusScoreThreshold = _5 === void 0 ? (_c = defaultFocusThresholds.passport) === null || _c === void 0 ? void 0 : _c.mobile : _5,
|
|
7396
|
-
_6 = _a.skipSuccessScreen,
|
|
7397
|
-
skipSuccessScreen = _6 === void 0 ? false : _6,
|
|
7279
|
+
_u = _a.captureRequirement,
|
|
7280
|
+
captureRequirement = _u === void 0 ? 'idCardOrPassport' : _u,
|
|
7281
|
+
_v = _a.separateIdCardCaptureSequence,
|
|
7282
|
+
separateIdCardCaptureSequence = _v === void 0 ? false : _v,
|
|
7283
|
+
_w = _a.thresholds,
|
|
7284
|
+
thresholds = _w === void 0 ? defaultIdCaptureThresholds : _w,
|
|
7285
|
+
_x = _a.skipSuccessScreen,
|
|
7286
|
+
skipSuccessScreen = _x === void 0 ? false : _x,
|
|
7398
7287
|
instructions = _a.instructions,
|
|
7399
|
-
|
|
7400
|
-
releaseCameraAccessOnExit =
|
|
7401
|
-
|
|
7402
|
-
guideType =
|
|
7403
|
-
|
|
7404
|
-
portraitGuidesOnMobile =
|
|
7405
|
-
|
|
7406
|
-
rotateLoadingOverlayImageWhenPortrait =
|
|
7407
|
-
|
|
7408
|
-
silentFallback =
|
|
7409
|
-
|
|
7410
|
-
assets =
|
|
7411
|
-
|
|
7412
|
-
classNames =
|
|
7413
|
-
|
|
7414
|
-
colors =
|
|
7415
|
-
|
|
7416
|
-
verbiage =
|
|
7417
|
-
|
|
7418
|
-
debugMode =
|
|
7419
|
-
var
|
|
7420
|
-
state =
|
|
7421
|
-
dispatch =
|
|
7422
|
-
var
|
|
7423
|
-
cameraAccessDenied =
|
|
7424
|
-
releaseCameraAccess =
|
|
7425
|
-
var
|
|
7426
|
-
overlayDismissed =
|
|
7427
|
-
setOverlayDismissed =
|
|
7428
|
-
var
|
|
7429
|
-
submissionStatus =
|
|
7430
|
-
setIdFrontImage =
|
|
7431
|
-
setIdBackImage =
|
|
7432
|
-
setPassportImage =
|
|
7433
|
-
logIdFrontCaptureAttempt =
|
|
7434
|
-
logIdBackCaptureAttempt =
|
|
7435
|
-
var
|
|
7436
|
-
start =
|
|
7437
|
-
stop =
|
|
7438
|
-
|
|
7439
|
-
|
|
7288
|
+
_y = _a.releaseCameraAccessOnExit,
|
|
7289
|
+
releaseCameraAccessOnExit = _y === void 0 ? true : _y,
|
|
7290
|
+
_z = _a.guideType,
|
|
7291
|
+
guideType = _z === void 0 ? 'fit' : _z,
|
|
7292
|
+
_0 = _a.portraitGuidesOnMobile,
|
|
7293
|
+
portraitGuidesOnMobile = _0 === void 0 ? false : _0,
|
|
7294
|
+
_1 = _a.rotateLoadingOverlayImageWhenPortrait,
|
|
7295
|
+
rotateLoadingOverlayImageWhenPortrait = _1 === void 0 ? true : _1,
|
|
7296
|
+
_2 = _a.silentFallback,
|
|
7297
|
+
silentFallback = _2 === void 0 ? false : _2,
|
|
7298
|
+
_3 = _a.assets,
|
|
7299
|
+
assets = _3 === void 0 ? {} : _3,
|
|
7300
|
+
_4 = _a.classNames,
|
|
7301
|
+
classNames = _4 === void 0 ? {} : _4,
|
|
7302
|
+
_5 = _a.colors,
|
|
7303
|
+
colors = _5 === void 0 ? {} : _5,
|
|
7304
|
+
_6 = _a.verbiage,
|
|
7305
|
+
verbiage = _6 === void 0 ? {} : _6,
|
|
7306
|
+
_7 = _a.debugMode,
|
|
7307
|
+
debugMode = _7 === void 0 ? false : _7;
|
|
7308
|
+
var _8 = useIdCaptureState(),
|
|
7309
|
+
state = _8[0],
|
|
7310
|
+
dispatch = _8[1];
|
|
7311
|
+
var _9 = React.useContext(CameraStateContext),
|
|
7312
|
+
cameraAccessDenied = _9.cameraAccessDenied,
|
|
7313
|
+
releaseCameraAccess = _9.releaseCameraAccess;
|
|
7314
|
+
var _10 = React.useState(false),
|
|
7315
|
+
overlayDismissed = _10[0],
|
|
7316
|
+
setOverlayDismissed = _10[1];
|
|
7317
|
+
var _11 = React.useContext(SubmissionContext),
|
|
7318
|
+
submissionStatus = _11.submissionStatus,
|
|
7319
|
+
setIdFrontImage = _11.setIdFrontImage,
|
|
7320
|
+
setIdBackImage = _11.setIdBackImage,
|
|
7321
|
+
setPassportImage = _11.setPassportImage,
|
|
7322
|
+
logIdFrontCaptureAttempt = _11.logIdFrontCaptureAttempt,
|
|
7323
|
+
logIdBackCaptureAttempt = _11.logIdBackCaptureAttempt;
|
|
7324
|
+
var _12 = React.useContext(IdCaptureModelsContext),
|
|
7325
|
+
start = _12.start,
|
|
7326
|
+
stop = _12.stop,
|
|
7327
|
+
onPredictionMade = _12.onPredictionMade,
|
|
7328
|
+
setRequiredDocumentType = _12.setRequiredDocumentType,
|
|
7329
|
+
modelError = _12.modelError,
|
|
7330
|
+
resetBestFrame = _12.resetBestFrame;
|
|
7440
7331
|
React.useEffect(function () {
|
|
7441
7332
|
dispatch({
|
|
7442
7333
|
type: 'configureWizard',
|
|
@@ -7461,16 +7352,29 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
7461
7352
|
type: 'captureStarted'
|
|
7462
7353
|
});
|
|
7463
7354
|
start();
|
|
7464
|
-
|
|
7465
|
-
|
|
7466
|
-
|
|
7467
|
-
|
|
7468
|
-
|
|
7469
|
-
|
|
7470
|
-
|
|
7471
|
-
|
|
7355
|
+
}, [dispatch, overlayDismissed, start, state.captureState]);
|
|
7356
|
+
React.useEffect(function () {
|
|
7357
|
+
onPredictionMade(function (prediction) {
|
|
7358
|
+
if (state.captureState === 'capturing') {
|
|
7359
|
+
dispatch({
|
|
7360
|
+
type: 'objectsDetected',
|
|
7361
|
+
payload: {
|
|
7362
|
+
prediction: prediction
|
|
7363
|
+
}
|
|
7364
|
+
});
|
|
7365
|
+
} else if (state.captureState === 'requestingFlip') {
|
|
7366
|
+
if (prediction.idCardBackDetectionThresholdMet) {
|
|
7367
|
+
resetBestFrame();
|
|
7368
|
+
dispatch({
|
|
7369
|
+
type: 'flipRequestCompleted'
|
|
7370
|
+
});
|
|
7371
|
+
}
|
|
7372
|
+
}
|
|
7472
7373
|
});
|
|
7473
|
-
}, [dispatch]);
|
|
7374
|
+
}, [dispatch, onPredictionMade, resetBestFrame, state.captureState]);
|
|
7375
|
+
React.useEffect(function () {
|
|
7376
|
+
if (state.captureState === 'complete') stop();
|
|
7377
|
+
}, [state.captureState, stop]);
|
|
7474
7378
|
var onCapture = React.useCallback(function (imageData, width, height, documentType, metadata) {
|
|
7475
7379
|
logCaptureMetadata(metadata);
|
|
7476
7380
|
dispatch({
|
|
@@ -7480,7 +7384,9 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
7480
7384
|
width: width,
|
|
7481
7385
|
height: height,
|
|
7482
7386
|
documentType: documentType,
|
|
7483
|
-
boundingBox: metadata.boundingBox
|
|
7387
|
+
boundingBox: metadata.boundingBox,
|
|
7388
|
+
detectionScore: metadata.bestDetectionScore,
|
|
7389
|
+
focusScore: metadata.bestFocusScore
|
|
7484
7390
|
}
|
|
7485
7391
|
});
|
|
7486
7392
|
}, [dispatch, logCaptureMetadata]);
|
|
@@ -7510,9 +7416,9 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
7510
7416
|
type: 'resetWizard'
|
|
7511
7417
|
});
|
|
7512
7418
|
}, [dispatch]);
|
|
7513
|
-
var
|
|
7514
|
-
attempt =
|
|
7515
|
-
setAttempt =
|
|
7419
|
+
var _13 = React.useState(0),
|
|
7420
|
+
attempt = _13[0],
|
|
7421
|
+
setAttempt = _13[1];
|
|
7516
7422
|
var onExit = React.useCallback(function () {
|
|
7517
7423
|
setOverlayDismissed(false);
|
|
7518
7424
|
setAttempt(function (n) {
|
|
@@ -7537,19 +7443,19 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
7537
7443
|
}
|
|
7538
7444
|
}, [cameraAccessDenied]);
|
|
7539
7445
|
assets.idCardFront || (assets.idCardFront = {});
|
|
7540
|
-
(
|
|
7541
|
-
(
|
|
7446
|
+
(_h = assets.idCardFront).portraitGuidesImageUrl || (_h.portraitGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Portrait-2.svg"));
|
|
7447
|
+
(_j = assets.idCardFront).landscapeGuidesImageUrl || (_j.landscapeGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Landscape-2.svg"));
|
|
7542
7448
|
assets.idCardBack || (assets.idCardBack = {});
|
|
7543
|
-
(
|
|
7544
|
-
(
|
|
7449
|
+
(_k = assets.idCardBack).portraitGuidesImageUrl || (_k.portraitGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Back-SVG-Portrait-2.svg"));
|
|
7450
|
+
(_l = assets.idCardBack).landscapeGuidesImageUrl || (_l.landscapeGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Back-SVG-Landscape-2.svg"));
|
|
7545
7451
|
assets.passport || (assets.passport = {});
|
|
7546
|
-
(
|
|
7547
|
-
(
|
|
7452
|
+
(_m = assets.passport).portraitGuidesImageUrl || (_m.portraitGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-Passport-Front-SVG-Portrait-2.svg"));
|
|
7453
|
+
(_o = assets.passport).landscapeGuidesImageUrl || (_o.landscapeGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-Passport-Front-SVG-Landscape-2.svg"));
|
|
7548
7454
|
assets.flipIdPrompt || (assets.flipIdPrompt = {});
|
|
7549
|
-
(
|
|
7550
|
-
(
|
|
7551
|
-
(
|
|
7552
|
-
(
|
|
7455
|
+
(_p = assets.flipIdPrompt).frontPortraitGuidesImageUrl || (_p.frontPortraitGuidesImageUrl = assets.idCardFront.portraitGuidesImageUrl);
|
|
7456
|
+
(_q = assets.flipIdPrompt).frontLandscapeGuidesImageUrl || (_q.frontLandscapeGuidesImageUrl = assets.idCardFront.landscapeGuidesImageUrl);
|
|
7457
|
+
(_r = assets.flipIdPrompt).backPortraitGuidesImageUrl || (_r.backPortraitGuidesImageUrl = assets.idCardBack.portraitGuidesImageUrl);
|
|
7458
|
+
(_s = assets.flipIdPrompt).backLandscapeGuidesImageUrl || (_s.backLandscapeGuidesImageUrl = assets.idCardBack.landscapeGuidesImageUrl);
|
|
7553
7459
|
var idCaptureVerbiages = {
|
|
7554
7460
|
idCardFront: useTranslations(verbiage.idCardFront, {
|
|
7555
7461
|
instructionText: 'Scan the front of ID',
|
|
@@ -7563,24 +7469,45 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
7563
7469
|
})
|
|
7564
7470
|
};
|
|
7565
7471
|
var theme = styled.useTheme();
|
|
7566
|
-
var
|
|
7567
|
-
guideRectX =
|
|
7568
|
-
guideRectY =
|
|
7569
|
-
guideRectWidth =
|
|
7570
|
-
guideRectHeight =
|
|
7571
|
-
imageUrl =
|
|
7472
|
+
var _14 = useIdCaptureState()[0],
|
|
7473
|
+
guideRectX = _14.guideRectX,
|
|
7474
|
+
guideRectY = _14.guideRectY,
|
|
7475
|
+
guideRectWidth = _14.guideRectWidth,
|
|
7476
|
+
guideRectHeight = _14.guideRectHeight,
|
|
7477
|
+
imageUrl = _14.imageUrl;
|
|
7572
7478
|
var idCaptureAssets = assets[state.requestedDocumentType];
|
|
7573
7479
|
var idCaptureVerbiage = idCaptureVerbiages[state.requestedDocumentType];
|
|
7574
7480
|
React.useEffect(function () {
|
|
7575
7481
|
if (separateIdCardCaptureSequence) return;
|
|
7576
|
-
if (state.captureState
|
|
7577
|
-
|
|
7578
|
-
|
|
7579
|
-
|
|
7580
|
-
|
|
7581
|
-
}
|
|
7482
|
+
if (state.captureState !== 'requestingFlip') return;
|
|
7483
|
+
var t = setTimeout(function () {
|
|
7484
|
+
resetBestFrame();
|
|
7485
|
+
dispatch({
|
|
7486
|
+
type: 'flipRequestCompleted'
|
|
7487
|
+
});
|
|
7488
|
+
}, 6000);
|
|
7489
|
+
return function () {
|
|
7490
|
+
clearTimeout(t);
|
|
7491
|
+
};
|
|
7492
|
+
}, [dispatch, resetBestFrame, separateIdCardCaptureSequence, state.captureState]);
|
|
7493
|
+
React.useEffect(function () {
|
|
7494
|
+
if (state.requestedDocumentType === 'idCardFront') {
|
|
7495
|
+
if (captureRequirement === 'idCardOrPassport') {
|
|
7496
|
+
setRequiredDocumentType(['idCardFront', 'passport']);
|
|
7497
|
+
} else {
|
|
7498
|
+
setRequiredDocumentType('idCardFront');
|
|
7499
|
+
}
|
|
7582
7500
|
}
|
|
7583
|
-
|
|
7501
|
+
if (state.requestedDocumentType === 'idCardBack') {
|
|
7502
|
+
setRequiredDocumentType('idCardBack');
|
|
7503
|
+
}
|
|
7504
|
+
if (state.requestedDocumentType === 'passport') {
|
|
7505
|
+
setRequiredDocumentType('passport');
|
|
7506
|
+
}
|
|
7507
|
+
return function () {
|
|
7508
|
+
setRequiredDocumentType('none');
|
|
7509
|
+
};
|
|
7510
|
+
}, [captureRequirement, setRequiredDocumentType, state.requestedDocumentType]);
|
|
7584
7511
|
var handleCapture = React.useCallback(function (imageData) {
|
|
7585
7512
|
return tslib.__awaiter(void 0, void 0, void 0, function () {
|
|
7586
7513
|
var base64ImageData;
|
|
@@ -7614,7 +7541,7 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
7614
7541
|
});
|
|
7615
7542
|
}
|
|
7616
7543
|
return /*#__PURE__*/React__default['default'].createElement(PageContainer, {
|
|
7617
|
-
className: "flex ".concat((
|
|
7544
|
+
className: "flex ".concat((_b = classNames === null || classNames === void 0 ? void 0 : classNames.container) !== null && _b !== void 0 ? _b : '')
|
|
7618
7545
|
}, state.captureState !== 'complete' && ( /*#__PURE__*/React__default['default'].createElement(CameraFeedWrapper, {
|
|
7619
7546
|
"$x": guideRectX,
|
|
7620
7547
|
"$y": guideRectY,
|
|
@@ -7625,15 +7552,7 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
7625
7552
|
className: classNames === null || classNames === void 0 ? void 0 : classNames.cameraFeed
|
|
7626
7553
|
}))), overlayDismissed && state.captureState === 'capturing' && ( /*#__PURE__*/React__default['default'].createElement(IdCapture, {
|
|
7627
7554
|
requiredDocumentType: state.requestedDocumentType,
|
|
7628
|
-
|
|
7629
|
-
idCardDetectionThreshold: idCardAutoCaptureScoreThreshold,
|
|
7630
|
-
passportDetectionThreshold: passportAutoCaptureScoreThreshold,
|
|
7631
|
-
idCardFocusScoreThreshold: idCardFocusScoreThreshold,
|
|
7632
|
-
passportFocusScoreThreshold: passportFocusScoreThreshold,
|
|
7633
|
-
mrzDetectionScoreThreshold: mrzDetectionScoreThreshold,
|
|
7634
|
-
autoCaptureBarcodeRequired: autoCaptureBarcodeRequired,
|
|
7635
|
-
barcodeScanningEnabled: barcodeScanningEnabled && state.requestedDocumentType === 'idCardBack',
|
|
7636
|
-
onPrediction: onPrediction,
|
|
7555
|
+
thresholds: thresholds,
|
|
7637
7556
|
onCapture: onCapture,
|
|
7638
7557
|
assets: idCaptureAssets,
|
|
7639
7558
|
classNames: classNames === null || classNames === void 0 ? void 0 : classNames.capture,
|
|
@@ -7649,15 +7568,15 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
7649
7568
|
assets: idCaptureAssets,
|
|
7650
7569
|
colors: colors,
|
|
7651
7570
|
verbiage: idCaptureVerbiage
|
|
7652
|
-
}), !((
|
|
7653
|
-
classNames: (
|
|
7654
|
-
text: (
|
|
7571
|
+
}), !((_d = (_c = theme.idCapture) === null || _c === void 0 ? void 0 : _c.capturePreview) === null || _d === void 0 ? void 0 : _d.disabled) && state.captureState === 'requestingFlip' && !separateIdCardCaptureSequence && imageUrl && ( /*#__PURE__*/React__default['default'].createElement(IdCaptureImagePreview, {
|
|
7572
|
+
classNames: (_e = classNames.capture) === null || _e === void 0 ? void 0 : _e.imagePreview,
|
|
7573
|
+
text: (_f = idCaptureVerbiages === null || idCaptureVerbiages === void 0 ? void 0 : idCaptureVerbiages.idCardFront) === null || _f === void 0 ? void 0 : _f.processingIdCardText,
|
|
7655
7574
|
imageUrl: imageUrl
|
|
7656
7575
|
})), state.captureState !== 'complete' && ( /*#__PURE__*/React__default['default'].createElement("div", {
|
|
7657
7576
|
id: "idmission-above-guides-content"
|
|
7658
7577
|
})), /*#__PURE__*/React__default['default'].createElement(ExitCaptureButton, {
|
|
7659
7578
|
onClick: onExit,
|
|
7660
|
-
className: (
|
|
7579
|
+
className: (_g = classNames.capture) === null || _g === void 0 ? void 0 : _g.exitCaptureBtn
|
|
7661
7580
|
}), !overlayDismissed && ( /*#__PURE__*/React__default['default'].createElement(IdCaptureLoadingOverlay, {
|
|
7662
7581
|
key: attempt,
|
|
7663
7582
|
mode: loadingOverlayMode,
|
|
@@ -7684,12 +7603,12 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
7684
7603
|
verbiage: verbiage.success
|
|
7685
7604
|
})), state.captureState === 'complete' && showSuccessScreen && ( /*#__PURE__*/React__default['default'].createElement(IdCaptureSuccess, {
|
|
7686
7605
|
capturedDocuments: state.capturedDocuments,
|
|
7687
|
-
barcodeResult: state.barcodeResult,
|
|
7688
7606
|
classNames: classNames.success,
|
|
7689
7607
|
onSubmitClick: onSubmitClick,
|
|
7690
7608
|
onRetryClick: onRetryClick,
|
|
7691
7609
|
colors: colors.success,
|
|
7692
|
-
verbiage: verbiage.success
|
|
7610
|
+
verbiage: verbiage.success,
|
|
7611
|
+
debugMode: debugMode
|
|
7693
7612
|
})));
|
|
7694
7613
|
};
|
|
7695
7614
|
|
|
@@ -10550,6 +10469,31 @@ var DoneButton = styled__default['default'](LoaderButton)(templateObject_6 || (t
|
|
|
10550
10469
|
var templateObject_1$6, templateObject_2$6, templateObject_3$6, templateObject_4$1, templateObject_5, templateObject_6;
|
|
10551
10470
|
|
|
10552
10471
|
var edgeBoundary = 0.05;
|
|
10472
|
+
var defaultVideoIdCaptureThresholds = {
|
|
10473
|
+
detection: {
|
|
10474
|
+
idCardFront: 0.6,
|
|
10475
|
+
idCardBack: 0.6,
|
|
10476
|
+
passport: 1
|
|
10477
|
+
},
|
|
10478
|
+
focus: {
|
|
10479
|
+
idCardFront: {
|
|
10480
|
+
desktop: 0,
|
|
10481
|
+
mobile: 0
|
|
10482
|
+
},
|
|
10483
|
+
idCardBack: {
|
|
10484
|
+
desktop: 0,
|
|
10485
|
+
mobile: 0
|
|
10486
|
+
},
|
|
10487
|
+
passport: {
|
|
10488
|
+
desktop: 0,
|
|
10489
|
+
mobile: 0
|
|
10490
|
+
}
|
|
10491
|
+
},
|
|
10492
|
+
goodFrames: {
|
|
10493
|
+
idCardFront: 1,
|
|
10494
|
+
idCardBack: 1
|
|
10495
|
+
}
|
|
10496
|
+
};
|
|
10553
10497
|
var IdVideoCapture = function IdVideoCapture(_a) {
|
|
10554
10498
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
10555
10499
|
var onComplete = _a.onComplete,
|
|
@@ -10561,96 +10505,85 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10561
10505
|
idCaptureModelsEnabled = _w === void 0 ? true : _w,
|
|
10562
10506
|
_x = _a.idCardFrontDelay,
|
|
10563
10507
|
idCardFrontDelay = _x === void 0 ? 1000 : _x,
|
|
10564
|
-
_y = _a.
|
|
10565
|
-
|
|
10566
|
-
_z = _a.
|
|
10567
|
-
|
|
10568
|
-
_0 = _a.
|
|
10569
|
-
|
|
10570
|
-
_1 = _a.idCardBackDetectionThreshold,
|
|
10571
|
-
idCardBackDetectionThreshold = _1 === void 0 ? 0.6 : _1,
|
|
10572
|
-
_2 = _a.idCardBackFocusThreshold,
|
|
10573
|
-
idCardBackFocusThreshold = _2 === void 0 ? 0 : _2,
|
|
10574
|
-
_3 = _a.goodIdCardBackFramesThreshold,
|
|
10575
|
-
goodIdCardBackFramesThreshold = _3 === void 0 ? 1 : _3,
|
|
10576
|
-
_4 = _a.skipShowIdCardBack,
|
|
10577
|
-
skipShowIdCardBack = _4 === void 0 ? false : _4,
|
|
10578
|
-
_5 = _a.captureCountdownSeconds,
|
|
10579
|
-
captureCountdownSeconds = _5 === void 0 ? 3 : _5,
|
|
10508
|
+
_y = _a.videoIdCaptureThresholds,
|
|
10509
|
+
videoIdCaptureThresholds = _y === void 0 ? defaultVideoIdCaptureThresholds : _y,
|
|
10510
|
+
_z = _a.skipShowIdCardBack,
|
|
10511
|
+
skipShowIdCardBack = _z === void 0 ? false : _z,
|
|
10512
|
+
_0 = _a.captureCountdownSeconds,
|
|
10513
|
+
captureCountdownSeconds = _0 === void 0 ? 3 : _0,
|
|
10580
10514
|
readTextPrompt = _a.readTextPrompt,
|
|
10581
|
-
|
|
10582
|
-
readTextTimeoutDurationMs =
|
|
10583
|
-
|
|
10584
|
-
readTextMinReadingMs =
|
|
10585
|
-
|
|
10586
|
-
disableFaceDetectionWhileAudioCapture =
|
|
10587
|
-
|
|
10588
|
-
disableFaceDetectionWhileAudioCaptureMsDelay =
|
|
10589
|
-
|
|
10590
|
-
mergeAVStreams =
|
|
10591
|
-
|
|
10592
|
-
assets =
|
|
10593
|
-
|
|
10594
|
-
classNames =
|
|
10595
|
-
|
|
10596
|
-
colors =
|
|
10597
|
-
|
|
10598
|
-
rawVerbiage =
|
|
10599
|
-
|
|
10600
|
-
debugMode =
|
|
10601
|
-
var
|
|
10602
|
-
ref =
|
|
10603
|
-
|
|
10604
|
-
width =
|
|
10605
|
-
|
|
10606
|
-
height =
|
|
10607
|
-
var
|
|
10608
|
-
cameraRef =
|
|
10609
|
-
videoRef =
|
|
10610
|
-
videoLoaded =
|
|
10611
|
-
cameraReady =
|
|
10612
|
-
microphoneReady =
|
|
10613
|
-
audioStream =
|
|
10614
|
-
setVideoLoaded =
|
|
10615
|
-
|
|
10616
|
-
|
|
10617
|
-
|
|
10618
|
-
|
|
10619
|
-
|
|
10620
|
-
|
|
10621
|
-
|
|
10622
|
-
|
|
10623
|
-
|
|
10624
|
-
|
|
10625
|
-
|
|
10626
|
-
|
|
10627
|
-
|
|
10628
|
-
|
|
10629
|
-
|
|
10630
|
-
|
|
10631
|
-
|
|
10632
|
-
|
|
10633
|
-
|
|
10634
|
-
|
|
10635
|
-
|
|
10636
|
-
|
|
10637
|
-
|
|
10638
|
-
|
|
10639
|
-
|
|
10640
|
-
|
|
10641
|
-
|
|
10642
|
-
|
|
10643
|
-
|
|
10644
|
-
|
|
10645
|
-
|
|
10646
|
-
|
|
10647
|
-
|
|
10648
|
-
|
|
10649
|
-
audioUrl = _26.audioUrl;
|
|
10515
|
+
_1 = _a.readTextTimeoutDurationMs,
|
|
10516
|
+
readTextTimeoutDurationMs = _1 === void 0 ? 15000 : _1,
|
|
10517
|
+
_2 = _a.readTextMinReadingMs,
|
|
10518
|
+
readTextMinReadingMs = _2 === void 0 ? 10000 : _2,
|
|
10519
|
+
_3 = _a.disableFaceDetectionWhileAudioCapture,
|
|
10520
|
+
disableFaceDetectionWhileAudioCapture = _3 === void 0 ? false : _3,
|
|
10521
|
+
_4 = _a.disableFaceDetectionWhileAudioCaptureMsDelay,
|
|
10522
|
+
disableFaceDetectionWhileAudioCaptureMsDelay = _4 === void 0 ? 2000 : _4,
|
|
10523
|
+
_5 = _a.mergeAVStreams,
|
|
10524
|
+
mergeAVStreams = _5 === void 0 ? false : _5,
|
|
10525
|
+
_6 = _a.assets,
|
|
10526
|
+
assets = _6 === void 0 ? {} : _6,
|
|
10527
|
+
_7 = _a.classNames,
|
|
10528
|
+
classNames = _7 === void 0 ? {} : _7,
|
|
10529
|
+
_8 = _a.colors,
|
|
10530
|
+
colors = _8 === void 0 ? {} : _8,
|
|
10531
|
+
_9 = _a.verbiage,
|
|
10532
|
+
rawVerbiage = _9 === void 0 ? {} : _9,
|
|
10533
|
+
_10 = _a.debugMode,
|
|
10534
|
+
debugMode = _10 === void 0 ? false : _10;
|
|
10535
|
+
var _11 = useResizeObserver__default['default'](),
|
|
10536
|
+
ref = _11.ref,
|
|
10537
|
+
_12 = _11.width,
|
|
10538
|
+
width = _12 === void 0 ? 1 : _12,
|
|
10539
|
+
_13 = _11.height,
|
|
10540
|
+
height = _13 === void 0 ? 1 : _13;
|
|
10541
|
+
var _14 = React.useContext(CameraStateContext),
|
|
10542
|
+
cameraRef = _14.cameraRef,
|
|
10543
|
+
videoRef = _14.videoRef,
|
|
10544
|
+
videoLoaded = _14.videoLoaded,
|
|
10545
|
+
cameraReady = _14.cameraReady,
|
|
10546
|
+
microphoneReady = _14.microphoneReady,
|
|
10547
|
+
audioStream = _14.audioStream,
|
|
10548
|
+
setVideoLoaded = _14.setVideoLoaded;
|
|
10549
|
+
var _15 = React.useState([]),
|
|
10550
|
+
detectedObjects = _15[0],
|
|
10551
|
+
setDetectedObjects = _15[1];
|
|
10552
|
+
var _16 = React.useState([]),
|
|
10553
|
+
faces = _16[0],
|
|
10554
|
+
setFaces = _16[1];
|
|
10555
|
+
var _17 = React.useContext(IdCaptureModelsContext),
|
|
10556
|
+
idModelsReady = _17.ready,
|
|
10557
|
+
startIdModels = _17.start,
|
|
10558
|
+
stopIdModels = _17.stop,
|
|
10559
|
+
onIdPredictionMade = _17.onPredictionMade,
|
|
10560
|
+
setThresholds = _17.setThresholds,
|
|
10561
|
+
bestFrameDetails = _17.bestFrameDetails,
|
|
10562
|
+
resetBestFrame = _17.resetBestFrame,
|
|
10563
|
+
idModelError = _17.modelError;
|
|
10564
|
+
var _18 = React.useState(null),
|
|
10565
|
+
videoStartsAt = _18[0],
|
|
10566
|
+
setVideoStartsAt = _18[1];
|
|
10567
|
+
var _19 = React.useContext(SubmissionContext),
|
|
10568
|
+
setIdCaptureVideoAudioStartsAt = _19.setIdCaptureVideoAudioStartsAt,
|
|
10569
|
+
setExpectedAudioText = _19.setExpectedAudioText;
|
|
10570
|
+
var _20 = React.useContext(SelfieGuidanceModelsContext),
|
|
10571
|
+
onSelfiePredictionMade = _20.onPredictionMade,
|
|
10572
|
+
selfieModelError = _20.error;
|
|
10573
|
+
var _21 = useVideoRecorder(cameraRef.current, audioStream, mergeAVStreams),
|
|
10574
|
+
isRecordingVideo = _21.isRecordingVideo,
|
|
10575
|
+
startRecordingVideo = _21.startRecordingVideo,
|
|
10576
|
+
startRecordingAudio = _21.startRecordingAudio,
|
|
10577
|
+
stopRecordingVideo = _21.stopRecordingVideo,
|
|
10578
|
+
stopRecordingAudio = _21.stopRecordingAudio,
|
|
10579
|
+
videoRecordingUnintentionallyStopped = _21.videoRecordingUnintentionallyStopped,
|
|
10580
|
+
audioRecordingUnintentionallyStopped = _21.audioRecordingUnintentionallyStopped,
|
|
10581
|
+
videoUrl = _21.videoUrl,
|
|
10582
|
+
audioUrl = _21.audioUrl;
|
|
10650
10583
|
var countdownTimeoutRef = React.useRef(undefined);
|
|
10651
|
-
var
|
|
10652
|
-
countdownRemaining =
|
|
10653
|
-
setCountdownRemaining =
|
|
10584
|
+
var _22 = React.useState(-1),
|
|
10585
|
+
countdownRemaining = _22[0],
|
|
10586
|
+
setCountdownRemaining = _22[1];
|
|
10654
10587
|
React.useEffect(function () {
|
|
10655
10588
|
if (!isRecordingVideo && !videoUrl) {
|
|
10656
10589
|
startRecordingVideo();
|
|
@@ -10670,41 +10603,30 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10670
10603
|
onRecordingFailed === null || onRecordingFailed === void 0 ? void 0 : onRecordingFailed();
|
|
10671
10604
|
}
|
|
10672
10605
|
}, [audioRecordingUnintentionallyStopped, onRecordingFailed, videoRecordingUnintentionallyStopped]);
|
|
10673
|
-
var
|
|
10674
|
-
|
|
10675
|
-
|
|
10676
|
-
|
|
10677
|
-
var _28 = React.useState('SHOW_ID_FRONT'),
|
|
10678
|
-
requestedAction = _28[0],
|
|
10679
|
-
setRequestedAction = _28[1];
|
|
10606
|
+
var _23 = React.useState('SHOW_ID_FRONT'),
|
|
10607
|
+
requestedAction = _23[0],
|
|
10608
|
+
setRequestedAction = _23[1];
|
|
10609
|
+
var shouldRunIdModels = idCaptureModelsEnabled && videoLoaded && cameraReady && idModelsReady && !idModelError && requestedAction !== 'READ_TEXT' && (!readTextPrompt || microphoneReady);
|
|
10680
10610
|
React.useEffect(function startModelsWhenCapturing() {
|
|
10681
|
-
if (!
|
|
10611
|
+
if (!shouldRunIdModels) return;
|
|
10682
10612
|
startIdModels();
|
|
10683
10613
|
return function () {
|
|
10684
10614
|
stopIdModels();
|
|
10685
10615
|
};
|
|
10686
|
-
}, [
|
|
10616
|
+
}, [shouldRunIdModels, startIdModels, stopIdModels]);
|
|
10687
10617
|
React.useEffect(function () {
|
|
10688
|
-
setThresholds(
|
|
10689
|
-
|
|
10690
|
-
|
|
10691
|
-
|
|
10692
|
-
|
|
10693
|
-
|
|
10694
|
-
|
|
10695
|
-
|
|
10696
|
-
|
|
10697
|
-
|
|
10698
|
-
|
|
10699
|
-
|
|
10700
|
-
setCurrentDetectionScore = _29[1];
|
|
10701
|
-
var _30 = React.useState(0),
|
|
10702
|
-
currentFocusScore = _30[0],
|
|
10703
|
-
setCurrentFocusScore = _30[1];
|
|
10704
|
-
var _31 = React.useState(0),
|
|
10705
|
-
goodFramesCount = _31[0],
|
|
10706
|
-
setGoodFramesCount = _31[1];
|
|
10707
|
-
var goodFramesThreshold = requestedAction === 'SHOW_ID_FRONT' ? goodIdCardFrontFramesThreshold : goodIdCardBackFramesThreshold;
|
|
10618
|
+
setThresholds(videoIdCaptureThresholds);
|
|
10619
|
+
}, [requestedAction, setThresholds, videoIdCaptureThresholds]);
|
|
10620
|
+
var _24 = React.useState(0),
|
|
10621
|
+
currentDetectionScore = _24[0],
|
|
10622
|
+
setCurrentDetectionScore = _24[1];
|
|
10623
|
+
var _25 = React.useState(0),
|
|
10624
|
+
currentFocusScore = _25[0],
|
|
10625
|
+
setCurrentFocusScore = _25[1];
|
|
10626
|
+
var _26 = React.useState(0),
|
|
10627
|
+
goodFramesCount = _26[0],
|
|
10628
|
+
setGoodFramesCount = _26[1];
|
|
10629
|
+
var goodFramesThreshold = requestedAction === 'SHOW_ID_FRONT' ? videoIdCaptureThresholds.goodFrames.idCardFront : videoIdCaptureThresholds.goodFrames.idCardBack;
|
|
10708
10630
|
var goodFramesThresholdMet = goodFramesCount >= goodFramesThreshold;
|
|
10709
10631
|
React.useEffect(function () {
|
|
10710
10632
|
if (!idCaptureModelsEnabled || idModelError) return;
|
|
@@ -10712,18 +10634,19 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10712
10634
|
setDetectedObjects(prediction.detectedObjects);
|
|
10713
10635
|
setCurrentDetectionScore(prediction.detectionScore);
|
|
10714
10636
|
setCurrentFocusScore(prediction.focusScore);
|
|
10715
|
-
|
|
10716
|
-
|
|
10717
|
-
|
|
10718
|
-
|
|
10719
|
-
} else {
|
|
10720
|
-
setGoodFramesCount(0);
|
|
10637
|
+
var detectionThresholdMet = requestedAction === 'SHOW_ID_FRONT' ? prediction.idCardFrontDetectionThresholdMet : prediction.idCardBackDetectionThresholdMet;
|
|
10638
|
+
var isGoodFrame = detectionThresholdMet && prediction.focusThresholdMet;
|
|
10639
|
+
if (requestedAction === 'FLIP_ID' && isGoodFrame) {
|
|
10640
|
+
return setRequestedAction('SHOW_ID_BACK');
|
|
10721
10641
|
}
|
|
10642
|
+
setGoodFramesCount(isGoodFrame ? function (n) {
|
|
10643
|
+
return n + 1;
|
|
10644
|
+
} : 0);
|
|
10722
10645
|
});
|
|
10723
|
-
}, [idCaptureModelsEnabled,
|
|
10724
|
-
var
|
|
10725
|
-
idFrontCaptureStartedAt =
|
|
10726
|
-
setFirstGoodFrameTime =
|
|
10646
|
+
}, [idCaptureModelsEnabled, onIdPredictionMade, idModelError, requestedAction]);
|
|
10647
|
+
var _27 = React.useState(null),
|
|
10648
|
+
idFrontCaptureStartedAt = _27[0],
|
|
10649
|
+
setFirstGoodFrameTime = _27[1];
|
|
10727
10650
|
React.useEffect(function () {
|
|
10728
10651
|
if (goodFramesCount === 1) setFirstGoodFrameTime(new Date().getTime());
|
|
10729
10652
|
}, [goodFramesCount]);
|
|
@@ -10744,73 +10667,56 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10744
10667
|
var frameHeight = (_e = (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.videoHeight) !== null && _e !== void 0 ? _e : 0;
|
|
10745
10668
|
var faceBox = (_f = faces === null || faces === void 0 ? void 0 : faces[0]) === null || _f === void 0 ? void 0 : _f.box;
|
|
10746
10669
|
var faceCentered = !faceBox || !frameWidth || faceBox.xMin > frameWidth * edgeBoundary && faceBox.yMin > frameHeight * edgeBoundary && faceBox.xMax < frameWidth * (1 - edgeBoundary) && faceBox.yMax < frameHeight * (1 - edgeBoundary);
|
|
10747
|
-
var
|
|
10748
|
-
countdownStartedAt =
|
|
10749
|
-
setCountdownStartedAt =
|
|
10670
|
+
var _28 = React.useState(),
|
|
10671
|
+
countdownStartedAt = _28[0],
|
|
10672
|
+
setCountdownStartedAt = _28[1];
|
|
10673
|
+
var photoCanvas = React.useRef(null);
|
|
10750
10674
|
var frameLock = React.useRef(false);
|
|
10751
10675
|
var captureFrame = React.useCallback(function () {
|
|
10752
10676
|
return tslib.__awaiter(void 0, void 0, void 0, function () {
|
|
10753
|
-
var
|
|
10754
|
-
return tslib.__generator(this, function (
|
|
10755
|
-
switch (
|
|
10677
|
+
var frameBase64;
|
|
10678
|
+
return tslib.__generator(this, function (_a) {
|
|
10679
|
+
switch (_a.label) {
|
|
10756
10680
|
case 0:
|
|
10757
10681
|
if (frameLock.current) return [2 /*return*/];
|
|
10758
10682
|
frameLock.current = true;
|
|
10759
|
-
|
|
10760
|
-
|
|
10761
|
-
|
|
10762
|
-
if (!frame) {
|
|
10683
|
+
drawToCanvas(photoCanvas.current, videoRef.current);
|
|
10684
|
+
frameBase64 = photoCanvas.current.toDataURL('image/jpeg');
|
|
10685
|
+
if (!frameBase64) {
|
|
10763
10686
|
frameLock.current = false;
|
|
10764
10687
|
return [2 /*return*/];
|
|
10765
10688
|
}
|
|
10766
|
-
|
|
10767
|
-
case
|
|
10768
|
-
|
|
10769
|
-
|
|
10770
|
-
if (!_a) return [3 /*break*/, 4];
|
|
10771
|
-
return [4 /*yield*/, new Promise(function (resolve) {
|
|
10772
|
-
var reader = new FileReader();
|
|
10773
|
-
reader.onloadend = function () {
|
|
10774
|
-
return resolve(reader.result);
|
|
10775
|
-
};
|
|
10776
|
-
reader.readAsDataURL(frame);
|
|
10777
|
-
})];
|
|
10778
|
-
case 3:
|
|
10779
|
-
_a = _b.sent();
|
|
10780
|
-
_b.label = 4;
|
|
10781
|
-
case 4:
|
|
10782
|
-
frameBase64 = _a;
|
|
10783
|
-
if (!(requestedAction == 'SHOW_ID_FRONT')) return [3 /*break*/, 8];
|
|
10689
|
+
_a.label = 1;
|
|
10690
|
+
case 1:
|
|
10691
|
+
_a.trys.push([1,, 7, 8]);
|
|
10692
|
+
if (!(requestedAction == 'SHOW_ID_FRONT')) return [3 /*break*/, 5];
|
|
10784
10693
|
if (onIdFrontImageCaptured) {
|
|
10785
|
-
|
|
10694
|
+
onIdFrontImageCaptured(frameBase64);
|
|
10786
10695
|
}
|
|
10787
|
-
if (!skipShowIdCardBack) return [3 /*break*/,
|
|
10788
|
-
if (!(skipShowIdCardBack === true)) return [3 /*break*/,
|
|
10696
|
+
if (!skipShowIdCardBack) return [3 /*break*/, 4];
|
|
10697
|
+
if (!(skipShowIdCardBack === true)) return [3 /*break*/, 2];
|
|
10789
10698
|
return [2 /*return*/, onIdBackCaptureComplete()];
|
|
10790
|
-
case
|
|
10699
|
+
case 2:
|
|
10791
10700
|
return [4 /*yield*/, skipShowIdCardBack()];
|
|
10792
|
-
case
|
|
10793
|
-
if (
|
|
10701
|
+
case 3:
|
|
10702
|
+
if (_a.sent()) {
|
|
10794
10703
|
return [2 /*return*/, onIdBackCaptureComplete()];
|
|
10795
10704
|
}
|
|
10796
|
-
|
|
10797
|
-
case
|
|
10705
|
+
_a.label = 4;
|
|
10706
|
+
case 4:
|
|
10798
10707
|
setRequestedAction('FLIP_ID');
|
|
10799
|
-
|
|
10800
|
-
|
|
10801
|
-
}, 6000);
|
|
10802
|
-
return [3 /*break*/, 9];
|
|
10803
|
-
case 8:
|
|
10708
|
+
return [3 /*break*/, 6];
|
|
10709
|
+
case 5:
|
|
10804
10710
|
if (requestedAction == 'SHOW_ID_BACK') {
|
|
10805
10711
|
if (onIdBackImageCaptured) {
|
|
10806
|
-
|
|
10712
|
+
onIdBackImageCaptured(frameBase64);
|
|
10807
10713
|
}
|
|
10808
10714
|
onIdBackCaptureComplete();
|
|
10809
10715
|
}
|
|
10810
|
-
|
|
10811
|
-
case
|
|
10812
|
-
return [3 /*break*/,
|
|
10813
|
-
case
|
|
10716
|
+
_a.label = 6;
|
|
10717
|
+
case 6:
|
|
10718
|
+
return [3 /*break*/, 8];
|
|
10719
|
+
case 7:
|
|
10814
10720
|
setDetectedObjects([]);
|
|
10815
10721
|
setCurrentDetectionScore(0);
|
|
10816
10722
|
setCurrentFocusScore(0);
|
|
@@ -10822,17 +10728,27 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10822
10728
|
clearTimeout(countdownTimeoutRef.current);
|
|
10823
10729
|
}
|
|
10824
10730
|
return [7 /*endfinally*/];
|
|
10825
|
-
case
|
|
10731
|
+
case 8:
|
|
10826
10732
|
return [2 /*return*/];
|
|
10827
10733
|
}
|
|
10828
10734
|
});
|
|
10829
10735
|
});
|
|
10830
|
-
}, [onIdBackCaptureComplete, onIdBackImageCaptured, onIdFrontImageCaptured, requestedAction, resetBestFrame, skipShowIdCardBack,
|
|
10736
|
+
}, [onIdBackCaptureComplete, onIdBackImageCaptured, onIdFrontImageCaptured, requestedAction, resetBestFrame, skipShowIdCardBack, videoRef]);
|
|
10737
|
+
var isFlipping = requestedAction === 'FLIP_ID';
|
|
10738
|
+
React.useEffect(function () {
|
|
10739
|
+
if (!isFlipping) return;
|
|
10740
|
+
var t = setTimeout(function () {
|
|
10741
|
+
setRequestedAction('SHOW_ID_BACK');
|
|
10742
|
+
}, 6000);
|
|
10743
|
+
return function () {
|
|
10744
|
+
clearTimeout(t);
|
|
10745
|
+
};
|
|
10746
|
+
}, [isFlipping]);
|
|
10831
10747
|
var stopRecording = React.useCallback(function () {
|
|
10832
10748
|
stopRecordingVideo();
|
|
10833
10749
|
stopRecordingAudio();
|
|
10834
10750
|
}, [stopRecordingAudio, stopRecordingVideo]);
|
|
10835
|
-
var satisfied = goodFramesThresholdMet && faceCentered && delaySatisfied;
|
|
10751
|
+
var satisfied = !isFlipping && goodFramesThresholdMet && faceCentered && delaySatisfied;
|
|
10836
10752
|
React.useEffect(function () {
|
|
10837
10753
|
if (satisfied && !countdownStartedAt) {
|
|
10838
10754
|
setCountdownStartedAt(new Date());
|
|
@@ -10852,10 +10768,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10852
10768
|
}, 1000);
|
|
10853
10769
|
return;
|
|
10854
10770
|
}
|
|
10855
|
-
|
|
10856
|
-
captureFrame();
|
|
10857
|
-
}
|
|
10858
|
-
}, [captureFrame, countdownStartedAt, countdownTimeoutRef]);
|
|
10771
|
+
}, [countdownTimeoutRef]);
|
|
10859
10772
|
React.useEffect(function () {
|
|
10860
10773
|
if (!countdownStartedAt) return;
|
|
10861
10774
|
setCountdownRemaining(captureCountdownSeconds);
|
|
@@ -10865,11 +10778,17 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10865
10778
|
return function () {
|
|
10866
10779
|
clearTimeout(countdownTimeoutRef.current);
|
|
10867
10780
|
};
|
|
10868
|
-
}, [captureCountdownSeconds,
|
|
10781
|
+
}, [captureCountdownSeconds, countdownStartedAt, manualCountdown]);
|
|
10782
|
+
React.useEffect(function () {
|
|
10783
|
+
if (countdownRemaining === 0) {
|
|
10784
|
+
setCountdownRemaining(-1);
|
|
10785
|
+
captureFrame().then();
|
|
10786
|
+
}
|
|
10787
|
+
}, [captureFrame, countdownRemaining]);
|
|
10869
10788
|
var timeoutStartedAt = useTimeout(readTextTimeoutDurationMs, stopRecording, requestedAction !== 'READ_TEXT', false, requestedAction === 'READ_TEXT').timeoutStartedAt;
|
|
10870
|
-
var
|
|
10871
|
-
numFramesWithoutFaces =
|
|
10872
|
-
setNumFramesWithoutFaces =
|
|
10789
|
+
var _29 = React.useState(0),
|
|
10790
|
+
numFramesWithoutFaces = _29[0],
|
|
10791
|
+
setNumFramesWithoutFaces = _29[1];
|
|
10873
10792
|
React.useEffect(function () {
|
|
10874
10793
|
if (!selfieModelError) {
|
|
10875
10794
|
onSelfiePredictionMade(function (faces) {
|
|
@@ -10887,14 +10806,14 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10887
10806
|
}
|
|
10888
10807
|
}, [disableFaceDetectionWhileAudioCapture, disableFaceDetectionWhileAudioCaptureMsDelay, numFramesWithoutFaces, onFaceNotDetected, timeoutStartedAt]);
|
|
10889
10808
|
var theme = styled.useTheme();
|
|
10890
|
-
var
|
|
10809
|
+
var _30 = useTranslations(rawVerbiage, {
|
|
10891
10810
|
faceNotCenteredText: 'Please move your face to the center...',
|
|
10892
10811
|
searchingForIdCardText: 'Searching for ID card...',
|
|
10893
10812
|
captureBtnText: 'Capture'
|
|
10894
10813
|
}),
|
|
10895
|
-
captureBtnText =
|
|
10896
|
-
faceNotCenteredText =
|
|
10897
|
-
searchingForIdCardText =
|
|
10814
|
+
captureBtnText = _30.captureBtnText,
|
|
10815
|
+
faceNotCenteredText = _30.faceNotCenteredText,
|
|
10816
|
+
searchingForIdCardText = _30.searchingForIdCardText;
|
|
10898
10817
|
var debugScalingDetails = useDebugScalingDetails({
|
|
10899
10818
|
enabled: debugMode,
|
|
10900
10819
|
pageWidth: width,
|
|
@@ -10908,7 +10827,9 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10908
10827
|
return /*#__PURE__*/React__default['default'].createElement(PageContainer, {
|
|
10909
10828
|
ref: ref,
|
|
10910
10829
|
className: "flex ".concat((_l = classNames.container) !== null && _l !== void 0 ? _l : '')
|
|
10911
|
-
},
|
|
10830
|
+
}, /*#__PURE__*/React__default['default'].createElement(InvisibleCanvas, {
|
|
10831
|
+
ref: photoCanvas
|
|
10832
|
+
}), requestedAction === 'READ_TEXT' ? ( /*#__PURE__*/React__default['default'].createElement(ReadTextPrompt, {
|
|
10912
10833
|
text: readTextPrompt,
|
|
10913
10834
|
startedAt: timeoutStartedAt || undefined,
|
|
10914
10835
|
durationMs: readTextTimeoutDurationMs,
|
|
@@ -10947,7 +10868,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10947
10868
|
className: classNames.guidanceMessage,
|
|
10948
10869
|
"$background": (_q = (_p = (_o = theme.guidanceMessages) === null || _o === void 0 ? void 0 : _o.negative) === null || _p === void 0 ? void 0 : _p.backgroundColor) !== null && _q !== void 0 ? _q : 'red',
|
|
10949
10870
|
"$textColor": (_t = (_s = (_r = theme.guidanceMessages) === null || _r === void 0 ? void 0 : _r.negative) === null || _s === void 0 ? void 0 : _s.textColor) !== null && _t !== void 0 ? _t : 'white'
|
|
10950
|
-
}, guidanceText))), debugMode && ( /*#__PURE__*/React__default['default'].createElement(DebugStatsPane, null, cameraRef.current ? ( /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, "\u2705 Camera: ", cameraRef.current.label, " (", cameraRef.current.width, "x", cameraRef.current.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React__default['default'].createElement("br", null), isRecordingVideo ? '✅ Recording' : '❌ Not recording', /*#__PURE__*/React__default['default'].createElement("br", null), goodFramesThresholdMet ? '✅' : '❌', " Good Frame Count:", ' ', goodFramesCount, "/", goodFramesThreshold, /*#__PURE__*/React__default['default'].createElement("br", null), "Detection Score: ", currentDetectionScore, /*#__PURE__*/React__default['default'].createElement("br", null), "Focus Score: ", currentFocusScore, /*#__PURE__*/React__default['default'].createElement("br", null), "Best Frame Detection Score: ", (_u = bestFrameDetails === null || bestFrameDetails === void 0 ? void 0 : bestFrameDetails.detectionScore) !== null && _u !== void 0 ? _u : 0, /*#__PURE__*/React__default['default'].createElement("br", null), "Best Frame Focus Score: ", (_v = bestFrameDetails === null || bestFrameDetails === void 0 ? void 0 : bestFrameDetails.focusScore) !== null && _v !== void 0 ? _v : 0)),
|
|
10871
|
+
}, guidanceText))), debugMode && ( /*#__PURE__*/React__default['default'].createElement(DebugStatsPane, null, cameraRef.current ? ( /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, "\u2705 Camera: ", cameraRef.current.label, " (", cameraRef.current.width, "x", cameraRef.current.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React__default['default'].createElement("br", null), isRecordingVideo ? '✅ Recording' : '❌ Not recording', /*#__PURE__*/React__default['default'].createElement("br", null), goodFramesThresholdMet ? '✅' : '❌', " Good Frame Count:", ' ', goodFramesCount, "/", goodFramesThreshold, /*#__PURE__*/React__default['default'].createElement("br", null), "Detection Score: ", currentDetectionScore, /*#__PURE__*/React__default['default'].createElement("br", null), "Focus Score: ", currentFocusScore, /*#__PURE__*/React__default['default'].createElement("br", null), "Best Frame Detection Score: ", (_u = bestFrameDetails === null || bestFrameDetails === void 0 ? void 0 : bestFrameDetails.detectionScore) !== null && _u !== void 0 ? _u : 0, /*#__PURE__*/React__default['default'].createElement("br", null), "Best Frame Focus Score: ", (_v = bestFrameDetails === null || bestFrameDetails === void 0 ? void 0 : bestFrameDetails.focusScore) !== null && _v !== void 0 ? _v : 0)), countdownRemaining > 0 && capturingId && ( /*#__PURE__*/React__default['default'].createElement(CountdownContainer, {
|
|
10951
10872
|
className: classNames.countdownContainer
|
|
10952
10873
|
}, /*#__PURE__*/React__default['default'].createElement(Countdown, {
|
|
10953
10874
|
className: classNames.countdown
|
|
@@ -11102,64 +11023,60 @@ var VideoIdWizard = function VideoIdWizard(_a) {
|
|
|
11102
11023
|
faceLivenessProps = _h === void 0 ? {} : _h,
|
|
11103
11024
|
_j = _a.idCaptureModelsEnabled,
|
|
11104
11025
|
idCaptureModelsEnabled = _j === void 0 ? true : _j,
|
|
11105
|
-
|
|
11106
|
-
|
|
11107
|
-
idCardFrontFocusThreshold = _a.idCardFrontFocusThreshold,
|
|
11108
|
-
idCardBackFocusThreshold = _a.idCardBackFocusThreshold,
|
|
11109
|
-
goodIdCardFrontFramesThreshold = _a.goodIdCardFrontFramesThreshold,
|
|
11110
|
-
goodIdCardBackFramesThreshold = _a.goodIdCardBackFramesThreshold,
|
|
11026
|
+
_k = _a.videoIdCaptureThresholds,
|
|
11027
|
+
videoIdCaptureThresholds = _k === void 0 ? defaultVideoIdCaptureThresholds : _k,
|
|
11111
11028
|
readTextPrompt = _a.readTextPrompt,
|
|
11112
11029
|
readTextTimeoutDurationMs = _a.readTextTimeoutDurationMs,
|
|
11113
11030
|
readTextMinReadingMs = _a.readTextMinReadingMs,
|
|
11114
|
-
|
|
11115
|
-
skipIdCapture =
|
|
11116
|
-
|
|
11117
|
-
skipShowIdCardBack =
|
|
11118
|
-
|
|
11119
|
-
skipSuccessScreen =
|
|
11120
|
-
|
|
11121
|
-
idCaptureLoadingOverlayMode =
|
|
11122
|
-
|
|
11123
|
-
idCaptureGuideType =
|
|
11124
|
-
|
|
11125
|
-
idCapturePortraitGuidesOnMobile =
|
|
11126
|
-
|
|
11127
|
-
idCaptureRotateLoadingOverlayImageWhenPortrait =
|
|
11128
|
-
|
|
11129
|
-
idCaptureModelLoadTimeoutMs =
|
|
11130
|
-
|
|
11131
|
-
faceLivenessLoadingOverlayMode =
|
|
11132
|
-
|
|
11133
|
-
disableFaceDetectionWhileAudioCapture =
|
|
11134
|
-
|
|
11135
|
-
disableFaceDetectionWhileAudioCaptureMsDelay =
|
|
11136
|
-
|
|
11137
|
-
silentFallback =
|
|
11138
|
-
|
|
11139
|
-
mergeAVStreams =
|
|
11140
|
-
|
|
11141
|
-
assets =
|
|
11142
|
-
|
|
11143
|
-
classNames =
|
|
11144
|
-
|
|
11145
|
-
colors =
|
|
11146
|
-
|
|
11147
|
-
verbiage =
|
|
11148
|
-
|
|
11149
|
-
debugMode =
|
|
11150
|
-
var
|
|
11151
|
-
submissionStatus =
|
|
11152
|
-
idCaptureVideoUrl =
|
|
11153
|
-
idCaptureVideoAudioUrl =
|
|
11154
|
-
idCaptureVideoIdFrontImage =
|
|
11155
|
-
idCaptureVideoIdBackImage =
|
|
11156
|
-
setIdCaptureVideoUrl =
|
|
11157
|
-
setIdCaptureVideoIdFrontImage =
|
|
11158
|
-
setIdCaptureVideoIdBackImage =
|
|
11159
|
-
setIdCaptureVideoAudioUrl =
|
|
11160
|
-
var
|
|
11161
|
-
captureState =
|
|
11162
|
-
setCaptureState =
|
|
11031
|
+
_l = _a.skipIdCapture,
|
|
11032
|
+
skipIdCapture = _l === void 0 ? false : _l,
|
|
11033
|
+
_m = _a.skipShowIdCardBack,
|
|
11034
|
+
skipShowIdCardBack = _m === void 0 ? false : _m,
|
|
11035
|
+
_o = _a.skipSuccessScreen,
|
|
11036
|
+
skipSuccessScreen = _o === void 0 ? false : _o,
|
|
11037
|
+
_p = _a.idCaptureLoadingOverlayMode,
|
|
11038
|
+
idCaptureLoadingOverlayMode = _p === void 0 ? 'default' : _p,
|
|
11039
|
+
_q = _a.idCaptureGuideType,
|
|
11040
|
+
idCaptureGuideType = _q === void 0 ? 'fit' : _q,
|
|
11041
|
+
_r = _a.idCapturePortraitGuidesOnMobile,
|
|
11042
|
+
idCapturePortraitGuidesOnMobile = _r === void 0 ? false : _r,
|
|
11043
|
+
_s = _a.idCaptureRotateLoadingOverlayImageWhenPortrait,
|
|
11044
|
+
idCaptureRotateLoadingOverlayImageWhenPortrait = _s === void 0 ? true : _s,
|
|
11045
|
+
_t = _a.idCaptureModelLoadTimeoutMs,
|
|
11046
|
+
idCaptureModelLoadTimeoutMs = _t === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _t,
|
|
11047
|
+
_u = _a.faceLivenessLoadingOverlayMode,
|
|
11048
|
+
faceLivenessLoadingOverlayMode = _u === void 0 ? 'default' : _u,
|
|
11049
|
+
_v = _a.disableFaceDetectionWhileAudioCapture,
|
|
11050
|
+
disableFaceDetectionWhileAudioCapture = _v === void 0 ? true : _v,
|
|
11051
|
+
_w = _a.disableFaceDetectionWhileAudioCaptureMsDelay,
|
|
11052
|
+
disableFaceDetectionWhileAudioCaptureMsDelay = _w === void 0 ? 2000 : _w,
|
|
11053
|
+
_x = _a.silentFallback,
|
|
11054
|
+
silentFallback = _x === void 0 ? false : _x,
|
|
11055
|
+
_y = _a.mergeAVStreams,
|
|
11056
|
+
mergeAVStreams = _y === void 0 ? false : _y,
|
|
11057
|
+
_z = _a.assets,
|
|
11058
|
+
assets = _z === void 0 ? {} : _z,
|
|
11059
|
+
_0 = _a.classNames,
|
|
11060
|
+
classNames = _0 === void 0 ? {} : _0,
|
|
11061
|
+
_1 = _a.colors,
|
|
11062
|
+
colors = _1 === void 0 ? {} : _1,
|
|
11063
|
+
_2 = _a.verbiage,
|
|
11064
|
+
verbiage = _2 === void 0 ? {} : _2,
|
|
11065
|
+
_3 = _a.debugMode,
|
|
11066
|
+
debugMode = _3 === void 0 ? false : _3;
|
|
11067
|
+
var _4 = React.useContext(SubmissionContext),
|
|
11068
|
+
submissionStatus = _4.submissionStatus,
|
|
11069
|
+
idCaptureVideoUrl = _4.idCaptureVideoUrl,
|
|
11070
|
+
idCaptureVideoAudioUrl = _4.idCaptureVideoAudioUrl,
|
|
11071
|
+
idCaptureVideoIdFrontImage = _4.idCaptureVideoIdFrontImage,
|
|
11072
|
+
idCaptureVideoIdBackImage = _4.idCaptureVideoIdBackImage,
|
|
11073
|
+
setIdCaptureVideoUrl = _4.setIdCaptureVideoUrl,
|
|
11074
|
+
setIdCaptureVideoIdFrontImage = _4.setIdCaptureVideoIdFrontImage,
|
|
11075
|
+
setIdCaptureVideoIdBackImage = _4.setIdCaptureVideoIdBackImage,
|
|
11076
|
+
setIdCaptureVideoAudioUrl = _4.setIdCaptureVideoAudioUrl;
|
|
11077
|
+
var _5 = React.useState('CAPTURING_ID'),
|
|
11078
|
+
captureState = _5[0],
|
|
11079
|
+
setCaptureState = _5[1];
|
|
11163
11080
|
React.useEffect(function () {
|
|
11164
11081
|
if (skipIdCapture && captureState === 'CAPTURING_ID') setCaptureState('CHECKING_LIVENESS');
|
|
11165
11082
|
}, [captureState, skipIdCapture]);
|
|
@@ -11190,9 +11107,9 @@ var VideoIdWizard = function VideoIdWizard(_a) {
|
|
|
11190
11107
|
var onVideoCaptureFaceNotDetected = React.useCallback(function () {
|
|
11191
11108
|
setCaptureState('CHECKING_LIVENESS');
|
|
11192
11109
|
}, []);
|
|
11193
|
-
var
|
|
11194
|
-
attempt =
|
|
11195
|
-
setAttempt =
|
|
11110
|
+
var _6 = React.useState(0),
|
|
11111
|
+
attempt = _6[0],
|
|
11112
|
+
setAttempt = _6[1];
|
|
11196
11113
|
var userSuppliedExitAfterFailure = onExitAfterFailure !== null && onExitAfterFailure !== void 0 ? onExitAfterFailure : faceLivenessProps.onExitAfterFailure;
|
|
11197
11114
|
var onFaceCaptureExitAfterFailure = React.useCallback(function (resp, req) {
|
|
11198
11115
|
userSuppliedExitAfterFailure === null || userSuppliedExitAfterFailure === void 0 ? void 0 : userSuppliedExitAfterFailure(resp, req);
|
|
@@ -11296,12 +11213,7 @@ var VideoIdWizard = function VideoIdWizard(_a) {
|
|
|
11296
11213
|
onFaceNotDetected: onVideoCaptureFaceNotDetected,
|
|
11297
11214
|
onRecordingFailed: onRecordingFailed,
|
|
11298
11215
|
idCaptureModelsEnabled: idCaptureModelsEnabled,
|
|
11299
|
-
|
|
11300
|
-
idCardBackDetectionThreshold: idCardBackDetectionThreshold,
|
|
11301
|
-
idCardFrontFocusThreshold: idCardFrontFocusThreshold,
|
|
11302
|
-
idCardBackFocusThreshold: idCardBackFocusThreshold,
|
|
11303
|
-
goodIdCardFrontFramesThreshold: goodIdCardFrontFramesThreshold,
|
|
11304
|
-
goodIdCardBackFramesThreshold: goodIdCardBackFramesThreshold,
|
|
11216
|
+
videoIdCaptureThresholds: videoIdCaptureThresholds,
|
|
11305
11217
|
skipShowIdCardBack: skipShowIdCardBack,
|
|
11306
11218
|
disableFaceDetectionWhileAudioCapture: disableFaceDetectionWhileAudioCapture,
|
|
11307
11219
|
disableFaceDetectionWhileAudioCaptureMsDelay: disableFaceDetectionWhileAudioCaptureMsDelay,
|
|
@@ -11762,9 +11674,8 @@ var ThemeProvider = function ThemeProvider(_a) {
|
|
|
11762
11674
|
* Render a fullscreen ID capture component that instructs the user to photograph both sides of their ID card, or full page of their passport.
|
|
11763
11675
|
*/
|
|
11764
11676
|
var IdValidation = function IdValidation(_a) {
|
|
11765
|
-
var _b,
|
|
11766
|
-
|
|
11767
|
-
lang = _d === void 0 ? 'auto' : _d,
|
|
11677
|
+
var _b = _a.lang,
|
|
11678
|
+
lang = _b === void 0 ? 'auto' : _b,
|
|
11768
11679
|
sessionId = _a.sessionId,
|
|
11769
11680
|
clientRequestID = _a.clientRequestID,
|
|
11770
11681
|
submissionUrl = _a.submissionUrl,
|
|
@@ -11787,35 +11698,25 @@ var IdValidation = function IdValidation(_a) {
|
|
|
11787
11698
|
webhooksFireOnReview = _a.webhooksFireOnReview,
|
|
11788
11699
|
sendBase64DocumentsInSwaggerProxy = _a.sendBase64DocumentsInSwaggerProxy,
|
|
11789
11700
|
precapturedDocuments = _a.precapturedDocuments,
|
|
11790
|
-
|
|
11791
|
-
loadingOverlayMode =
|
|
11792
|
-
|
|
11793
|
-
idCaptureRequirement =
|
|
11794
|
-
|
|
11795
|
-
separateIdCardCaptureSequence =
|
|
11796
|
-
|
|
11797
|
-
|
|
11798
|
-
|
|
11799
|
-
|
|
11800
|
-
_k = _a.passportAutoCaptureScoreThreshold,
|
|
11801
|
-
passportAutoCaptureScoreThreshold = _k === void 0 ? defaultDocumentDetectionThresholds.passport : _k,
|
|
11802
|
-
_l = _a.mrzDetectionScoreThreshold,
|
|
11803
|
-
mrzDetectionScoreThreshold = _l === void 0 ? defaultDocumentDetectionThresholds.mrz : _l,
|
|
11804
|
-
_m = _a.idCardFocusScoreThreshold,
|
|
11805
|
-
idCardFocusScoreThreshold = _m === void 0 ? (_b = defaultFocusThresholds.idCard) === null || _b === void 0 ? void 0 : _b.mobile : _m,
|
|
11806
|
-
_o = _a.passportFocusScoreThreshold,
|
|
11807
|
-
passportFocusScoreThreshold = _o === void 0 ? (_c = defaultFocusThresholds.passport) === null || _c === void 0 ? void 0 : _c.mobile : _o,
|
|
11808
|
-
_p = _a.skipSuccessScreen,
|
|
11809
|
-
skipSuccessScreen = _p === void 0 ? false : _p,
|
|
11701
|
+
_c = _a.loadingOverlayMode,
|
|
11702
|
+
loadingOverlayMode = _c === void 0 ? 'default' : _c,
|
|
11703
|
+
_d = _a.idCaptureRequirement,
|
|
11704
|
+
idCaptureRequirement = _d === void 0 ? 'idCardOrPassport' : _d,
|
|
11705
|
+
_e = _a.separateIdCardCaptureSequence,
|
|
11706
|
+
separateIdCardCaptureSequence = _e === void 0 ? false : _e,
|
|
11707
|
+
_f = _a.idCaptureThresholds,
|
|
11708
|
+
idCaptureThresholds = _f === void 0 ? defaultIdCaptureThresholds : _f,
|
|
11709
|
+
_g = _a.skipSuccessScreen,
|
|
11710
|
+
skipSuccessScreen = _g === void 0 ? false : _g,
|
|
11810
11711
|
instructions = _a.instructions,
|
|
11811
|
-
|
|
11812
|
-
guideType =
|
|
11813
|
-
|
|
11814
|
-
portraitGuidesOnMobile =
|
|
11815
|
-
|
|
11816
|
-
rotateLoadingOverlayImageWhenPortrait =
|
|
11817
|
-
|
|
11818
|
-
modelLoadTimeoutMs =
|
|
11712
|
+
_h = _a.guideType,
|
|
11713
|
+
guideType = _h === void 0 ? 'fit' : _h,
|
|
11714
|
+
_j = _a.portraitGuidesOnMobile,
|
|
11715
|
+
portraitGuidesOnMobile = _j === void 0 ? false : _j,
|
|
11716
|
+
_k = _a.rotateLoadingOverlayImageWhenPortrait,
|
|
11717
|
+
rotateLoadingOverlayImageWhenPortrait = _k === void 0 ? true : _k,
|
|
11718
|
+
_l = _a.modelLoadTimeoutMs,
|
|
11719
|
+
modelLoadTimeoutMs = _l === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _l,
|
|
11819
11720
|
onBeforeSubmit = _a.onBeforeSubmit,
|
|
11820
11721
|
onBeforeDocumentUpload = _a.onBeforeDocumentUpload,
|
|
11821
11722
|
onDocumentUploadProgress = _a.onDocumentUploadProgress,
|
|
@@ -11829,28 +11730,28 @@ var IdValidation = function IdValidation(_a) {
|
|
|
11829
11730
|
onUserCancel = _a.onUserCancel,
|
|
11830
11731
|
onModelError = _a.onModelError,
|
|
11831
11732
|
onCameraAccessDenied = _a.onCameraAccessDenied,
|
|
11832
|
-
|
|
11833
|
-
theme =
|
|
11834
|
-
|
|
11835
|
-
assets =
|
|
11836
|
-
|
|
11837
|
-
classNames =
|
|
11838
|
-
|
|
11839
|
-
colors =
|
|
11840
|
-
|
|
11841
|
-
verbiage =
|
|
11842
|
-
|
|
11843
|
-
captureSignature =
|
|
11844
|
-
|
|
11845
|
-
captureSignatureVideo =
|
|
11846
|
-
|
|
11847
|
-
captureAdditionalDocuments =
|
|
11848
|
-
|
|
11849
|
-
geolocationEnabled =
|
|
11850
|
-
|
|
11851
|
-
geolocationRequired =
|
|
11852
|
-
|
|
11853
|
-
debugMode =
|
|
11733
|
+
_m = _a.theme,
|
|
11734
|
+
theme = _m === void 0 ? 'default' : _m,
|
|
11735
|
+
_o = _a.assets,
|
|
11736
|
+
assets = _o === void 0 ? {} : _o,
|
|
11737
|
+
_p = _a.classNames,
|
|
11738
|
+
classNames = _p === void 0 ? {} : _p,
|
|
11739
|
+
_q = _a.colors,
|
|
11740
|
+
colors = _q === void 0 ? {} : _q,
|
|
11741
|
+
_r = _a.verbiage,
|
|
11742
|
+
verbiage = _r === void 0 ? {} : _r,
|
|
11743
|
+
_s = _a.captureSignature,
|
|
11744
|
+
captureSignature = _s === void 0 ? false : _s,
|
|
11745
|
+
_t = _a.captureSignatureVideo,
|
|
11746
|
+
captureSignatureVideo = _t === void 0 ? false : _t,
|
|
11747
|
+
_u = _a.captureAdditionalDocuments,
|
|
11748
|
+
captureAdditionalDocuments = _u === void 0 ? [] : _u,
|
|
11749
|
+
_v = _a.geolocationEnabled,
|
|
11750
|
+
geolocationEnabled = _v === void 0 ? true : _v,
|
|
11751
|
+
_w = _a.geolocationRequired,
|
|
11752
|
+
geolocationRequired = _w === void 0 ? false : _w,
|
|
11753
|
+
_x = _a.debugMode,
|
|
11754
|
+
debugMode = _x === void 0 ? false : _x;
|
|
11854
11755
|
useLanguage(lang);
|
|
11855
11756
|
useDebugLogging(debugMode);
|
|
11856
11757
|
var idCaptureProps = React.useMemo(function () {
|
|
@@ -11861,13 +11762,7 @@ var IdValidation = function IdValidation(_a) {
|
|
|
11861
11762
|
precapturedDocuments: precapturedDocuments,
|
|
11862
11763
|
captureRequirement: idCaptureRequirement,
|
|
11863
11764
|
separateIdCardCaptureSequence: separateIdCardCaptureSequence,
|
|
11864
|
-
|
|
11865
|
-
idCardAutoCaptureScoreThreshold: idCardAutoCaptureScoreThreshold,
|
|
11866
|
-
passportAutoCaptureScoreThreshold: passportAutoCaptureScoreThreshold,
|
|
11867
|
-
mrzDetectionScoreThreshold: mrzDetectionScoreThreshold,
|
|
11868
|
-
idCardFocusScoreThreshold: idCardFocusScoreThreshold,
|
|
11869
|
-
passportFocusScoreThreshold: passportFocusScoreThreshold,
|
|
11870
|
-
barcodeScanningEnabled: false,
|
|
11765
|
+
thresholds: idCaptureThresholds,
|
|
11871
11766
|
skipSuccessScreen: skipSuccessScreen,
|
|
11872
11767
|
loadingOverlayMode: loadingOverlayMode,
|
|
11873
11768
|
instructions: instructions,
|
|
@@ -11881,7 +11776,7 @@ var IdValidation = function IdValidation(_a) {
|
|
|
11881
11776
|
verbiage: verbiage,
|
|
11882
11777
|
debugMode: debugMode
|
|
11883
11778
|
};
|
|
11884
|
-
}, [onExitCapture, onUserCancel, onModelError, precapturedDocuments, idCaptureRequirement, separateIdCardCaptureSequence,
|
|
11779
|
+
}, [onExitCapture, onUserCancel, onModelError, precapturedDocuments, idCaptureRequirement, separateIdCardCaptureSequence, idCaptureThresholds, skipSuccessScreen, loadingOverlayMode, instructions, guideType, portraitGuidesOnMobile, rotateLoadingOverlayImageWhenPortrait, modelLoadTimeoutMs, assets, classNames, colors, verbiage, debugMode]);
|
|
11885
11780
|
var additionalDocumentCaptureProps = React.useMemo(function () {
|
|
11886
11781
|
return {
|
|
11887
11782
|
documents: captureAdditionalDocuments,
|
|
@@ -12075,9 +11970,8 @@ var FaceValidation = function FaceValidation(_a) {
|
|
|
12075
11970
|
* Render a fullscreen capture component that performs `IDValidation` and `FaceValidation` sequentially.
|
|
12076
11971
|
* */
|
|
12077
11972
|
var IdAndFaceValidation = function IdAndFaceValidation(_a) {
|
|
12078
|
-
var _b,
|
|
12079
|
-
|
|
12080
|
-
lang = _d === void 0 ? 'auto' : _d,
|
|
11973
|
+
var _b = _a.lang,
|
|
11974
|
+
lang = _b === void 0 ? 'auto' : _b,
|
|
12081
11975
|
sessionId = _a.sessionId,
|
|
12082
11976
|
authUrl = _a.authUrl,
|
|
12083
11977
|
submissionUrl = _a.submissionUrl,
|
|
@@ -12099,39 +11993,29 @@ var IdAndFaceValidation = function IdAndFaceValidation(_a) {
|
|
|
12099
11993
|
webhooksFireOnReview = _a.webhooksFireOnReview,
|
|
12100
11994
|
sendBase64DocumentsInSwaggerProxy = _a.sendBase64DocumentsInSwaggerProxy,
|
|
12101
11995
|
precapturedDocuments = _a.precapturedDocuments,
|
|
12102
|
-
|
|
12103
|
-
idCaptureLoadingOverlayMode =
|
|
12104
|
-
|
|
12105
|
-
idCaptureRequirement =
|
|
12106
|
-
|
|
12107
|
-
|
|
12108
|
-
|
|
12109
|
-
|
|
12110
|
-
|
|
12111
|
-
|
|
12112
|
-
|
|
12113
|
-
|
|
12114
|
-
_l = _a.idCardFocusScoreThreshold,
|
|
12115
|
-
idCardFocusScoreThreshold = _l === void 0 ? (_b = defaultFocusThresholds.idCard) === null || _b === void 0 ? void 0 : _b.mobile : _l,
|
|
12116
|
-
_m = _a.passportFocusScoreThreshold,
|
|
12117
|
-
passportFocusScoreThreshold = _m === void 0 ? (_c = defaultFocusThresholds.passport) === null || _c === void 0 ? void 0 : _c.mobile : _m,
|
|
12118
|
-
_o = _a.faceLivenessLoadingOverlayMode,
|
|
12119
|
-
faceLivenessLoadingOverlayMode = _o === void 0 ? 'default' : _o,
|
|
12120
|
-
_p = _a.faceLivenessTimeoutDurationMs,
|
|
12121
|
-
faceLivenessTimeoutDurationMs = _p === void 0 ? 15000 : _p,
|
|
12122
|
-
_q = _a.skipSuccessScreen,
|
|
12123
|
-
skipSuccessScreen = _q === void 0 ? false : _q,
|
|
11996
|
+
_c = _a.idCaptureLoadingOverlayMode,
|
|
11997
|
+
idCaptureLoadingOverlayMode = _c === void 0 ? 'default' : _c,
|
|
11998
|
+
_d = _a.idCaptureRequirement,
|
|
11999
|
+
idCaptureRequirement = _d === void 0 ? 'idCardOrPassport' : _d,
|
|
12000
|
+
_e = _a.idCaptureThresholds,
|
|
12001
|
+
idCaptureThresholds = _e === void 0 ? defaultIdCaptureThresholds : _e,
|
|
12002
|
+
_f = _a.faceLivenessLoadingOverlayMode,
|
|
12003
|
+
faceLivenessLoadingOverlayMode = _f === void 0 ? 'default' : _f,
|
|
12004
|
+
_g = _a.faceLivenessTimeoutDurationMs,
|
|
12005
|
+
faceLivenessTimeoutDurationMs = _g === void 0 ? 15000 : _g,
|
|
12006
|
+
_h = _a.skipSuccessScreen,
|
|
12007
|
+
skipSuccessScreen = _h === void 0 ? false : _h,
|
|
12124
12008
|
idCaptureInstructions = _a.idCaptureInstructions,
|
|
12125
|
-
|
|
12126
|
-
idCaptureGuideType =
|
|
12127
|
-
|
|
12128
|
-
idCapturePortraitGuidesOnMobile =
|
|
12129
|
-
|
|
12130
|
-
idCaptureRotateLoadingOverlayImageWhenPortrait =
|
|
12131
|
-
|
|
12132
|
-
idCaptureModelLoadTimeoutMs =
|
|
12133
|
-
|
|
12134
|
-
selfieCaptureModelLoadTimeoutMs =
|
|
12009
|
+
_j = _a.idCaptureGuideType,
|
|
12010
|
+
idCaptureGuideType = _j === void 0 ? 'fit' : _j,
|
|
12011
|
+
_k = _a.idCapturePortraitGuidesOnMobile,
|
|
12012
|
+
idCapturePortraitGuidesOnMobile = _k === void 0 ? false : _k,
|
|
12013
|
+
_l = _a.idCaptureRotateLoadingOverlayImageWhenPortrait,
|
|
12014
|
+
idCaptureRotateLoadingOverlayImageWhenPortrait = _l === void 0 ? true : _l,
|
|
12015
|
+
_m = _a.idCaptureModelLoadTimeoutMs,
|
|
12016
|
+
idCaptureModelLoadTimeoutMs = _m === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _m,
|
|
12017
|
+
_o = _a.selfieCaptureModelLoadTimeoutMs,
|
|
12018
|
+
selfieCaptureModelLoadTimeoutMs = _o === void 0 ? defaultSelfieCaptureModelLoadTimeoutMs : _o,
|
|
12135
12019
|
onBeforeDocumentUpload = _a.onBeforeDocumentUpload,
|
|
12136
12020
|
onDocumentUploaded = _a.onDocumentUploaded,
|
|
12137
12021
|
onDocumentUploadProgress = _a.onDocumentUploadProgress,
|
|
@@ -12148,28 +12032,28 @@ var IdAndFaceValidation = function IdAndFaceValidation(_a) {
|
|
|
12148
12032
|
onIdCaptureModelError = _a.onIdCaptureModelError,
|
|
12149
12033
|
onSelfieCaptureModelError = _a.onSelfieCaptureModelError,
|
|
12150
12034
|
onCameraAccessDenied = _a.onCameraAccessDenied,
|
|
12151
|
-
|
|
12152
|
-
captureSignature =
|
|
12153
|
-
|
|
12154
|
-
captureSignatureVideo =
|
|
12155
|
-
|
|
12156
|
-
captureAdditionalDocuments =
|
|
12157
|
-
|
|
12158
|
-
theme =
|
|
12159
|
-
|
|
12160
|
-
assets =
|
|
12161
|
-
|
|
12162
|
-
classNames =
|
|
12163
|
-
|
|
12164
|
-
colors =
|
|
12165
|
-
|
|
12166
|
-
verbiage =
|
|
12167
|
-
|
|
12168
|
-
geolocationEnabled =
|
|
12169
|
-
|
|
12170
|
-
geolocationRequired =
|
|
12171
|
-
|
|
12172
|
-
debugMode =
|
|
12035
|
+
_p = _a.captureSignature,
|
|
12036
|
+
captureSignature = _p === void 0 ? false : _p,
|
|
12037
|
+
_q = _a.captureSignatureVideo,
|
|
12038
|
+
captureSignatureVideo = _q === void 0 ? false : _q,
|
|
12039
|
+
_r = _a.captureAdditionalDocuments,
|
|
12040
|
+
captureAdditionalDocuments = _r === void 0 ? [] : _r,
|
|
12041
|
+
_s = _a.theme,
|
|
12042
|
+
theme = _s === void 0 ? 'default' : _s,
|
|
12043
|
+
_t = _a.assets,
|
|
12044
|
+
assets = _t === void 0 ? {} : _t,
|
|
12045
|
+
_u = _a.classNames,
|
|
12046
|
+
classNames = _u === void 0 ? {} : _u,
|
|
12047
|
+
_v = _a.colors,
|
|
12048
|
+
colors = _v === void 0 ? {} : _v,
|
|
12049
|
+
_w = _a.verbiage,
|
|
12050
|
+
verbiage = _w === void 0 ? {} : _w,
|
|
12051
|
+
_x = _a.geolocationEnabled,
|
|
12052
|
+
geolocationEnabled = _x === void 0 ? true : _x,
|
|
12053
|
+
_y = _a.geolocationRequired,
|
|
12054
|
+
geolocationRequired = _y === void 0 ? false : _y,
|
|
12055
|
+
_z = _a.debugMode,
|
|
12056
|
+
debugMode = _z === void 0 ? false : _z;
|
|
12173
12057
|
useLanguage(lang);
|
|
12174
12058
|
useDebugLogging(debugMode);
|
|
12175
12059
|
var idCaptureProps = React.useMemo(function () {
|
|
@@ -12183,12 +12067,7 @@ var IdAndFaceValidation = function IdAndFaceValidation(_a) {
|
|
|
12183
12067
|
verbiage: verbiage.idCapture,
|
|
12184
12068
|
precapturedDocuments: precapturedDocuments,
|
|
12185
12069
|
captureRequirement: idCaptureRequirement,
|
|
12186
|
-
|
|
12187
|
-
idCardAutoCaptureScoreThreshold: idCardAutoCaptureScoreThreshold,
|
|
12188
|
-
passportAutoCaptureScoreThreshold: passportAutoCaptureScoreThreshold,
|
|
12189
|
-
mrzDetectionScoreThreshold: mrzDetectionScoreThreshold,
|
|
12190
|
-
idCardFocusScoreThreshold: idCardFocusScoreThreshold,
|
|
12191
|
-
passportFocusScoreThreshold: passportFocusScoreThreshold,
|
|
12070
|
+
thresholds: idCaptureThresholds,
|
|
12192
12071
|
loadingOverlayMode: idCaptureLoadingOverlayMode,
|
|
12193
12072
|
instructions: idCaptureInstructions,
|
|
12194
12073
|
guideType: idCaptureGuideType,
|
|
@@ -12198,7 +12077,7 @@ var IdAndFaceValidation = function IdAndFaceValidation(_a) {
|
|
|
12198
12077
|
skipSuccessScreen: skipSuccessScreen,
|
|
12199
12078
|
debugMode: debugMode
|
|
12200
12079
|
};
|
|
12201
|
-
}, [assets.idCapture, classNames.idCapture, colors.idCapture,
|
|
12080
|
+
}, [onExitCapture, onUserCancel, onIdCaptureModelError, assets.idCapture, classNames.idCapture, colors.idCapture, verbiage.idCapture, precapturedDocuments, idCaptureRequirement, idCaptureThresholds, idCaptureLoadingOverlayMode, idCaptureInstructions, idCaptureGuideType, idCapturePortraitGuidesOnMobile, idCaptureRotateLoadingOverlayImageWhenPortrait, idCaptureModelLoadTimeoutMs, skipSuccessScreen, debugMode]);
|
|
12202
12081
|
var faceLivenessProps = React.useMemo(function () {
|
|
12203
12082
|
return {
|
|
12204
12083
|
loadingOverlayMode: faceLivenessLoadingOverlayMode,
|
|
@@ -12306,10 +12185,9 @@ var IdAndFaceValidation = function IdAndFaceValidation(_a) {
|
|
|
12306
12185
|
* Render a fullscreen capture component that performs IDValidation and FaceValidation sequentially, and then stores the results in IDmission's customer database using the supplied `enrollmentId` for later verification or 1:N matching.
|
|
12307
12186
|
*/
|
|
12308
12187
|
var CustomerIdAndBiometricsEnrollment = function CustomerIdAndBiometricsEnrollment(_a) {
|
|
12309
|
-
var _b, _c;
|
|
12310
12188
|
var enrollmentId = _a.enrollmentId,
|
|
12311
|
-
|
|
12312
|
-
lang =
|
|
12189
|
+
_b = _a.lang,
|
|
12190
|
+
lang = _b === void 0 ? 'auto' : _b,
|
|
12313
12191
|
sessionId = _a.sessionId,
|
|
12314
12192
|
authUrl = _a.authUrl,
|
|
12315
12193
|
submissionUrl = _a.submissionUrl,
|
|
@@ -12333,39 +12211,29 @@ var CustomerIdAndBiometricsEnrollment = function CustomerIdAndBiometricsEnrollme
|
|
|
12333
12211
|
webhooksSendProcessedImages = _a.webhooksSendProcessedImages,
|
|
12334
12212
|
webhooksFireOnReview = _a.webhooksFireOnReview,
|
|
12335
12213
|
sendBase64DocumentsInSwaggerProxy = _a.sendBase64DocumentsInSwaggerProxy,
|
|
12336
|
-
|
|
12337
|
-
idCaptureLoadingOverlayMode =
|
|
12338
|
-
|
|
12339
|
-
idCaptureRequirement =
|
|
12340
|
-
|
|
12341
|
-
|
|
12342
|
-
|
|
12343
|
-
|
|
12344
|
-
|
|
12345
|
-
|
|
12346
|
-
|
|
12347
|
-
|
|
12348
|
-
_l = _a.idCardFocusScoreThreshold,
|
|
12349
|
-
idCardFocusScoreThreshold = _l === void 0 ? (_b = defaultFocusThresholds.idCard) === null || _b === void 0 ? void 0 : _b.mobile : _l,
|
|
12350
|
-
_m = _a.passportFocusScoreThreshold,
|
|
12351
|
-
passportFocusScoreThreshold = _m === void 0 ? (_c = defaultFocusThresholds.passport) === null || _c === void 0 ? void 0 : _c.mobile : _m,
|
|
12352
|
-
_o = _a.faceLivenessTimeoutDurationMs,
|
|
12353
|
-
faceLivenessTimeoutDurationMs = _o === void 0 ? 15000 : _o,
|
|
12354
|
-
_p = _a.faceLivenessLoadingOverlayMode,
|
|
12355
|
-
faceLivenessLoadingOverlayMode = _p === void 0 ? 'default' : _p,
|
|
12356
|
-
_q = _a.skipSuccessScreen,
|
|
12357
|
-
skipSuccessScreen = _q === void 0 ? false : _q,
|
|
12214
|
+
_c = _a.idCaptureLoadingOverlayMode,
|
|
12215
|
+
idCaptureLoadingOverlayMode = _c === void 0 ? 'default' : _c,
|
|
12216
|
+
_d = _a.idCaptureRequirement,
|
|
12217
|
+
idCaptureRequirement = _d === void 0 ? 'idCardOrPassport' : _d,
|
|
12218
|
+
_e = _a.idCaptureThresholds,
|
|
12219
|
+
idCaptureThresholds = _e === void 0 ? defaultIdCaptureThresholds : _e,
|
|
12220
|
+
_f = _a.faceLivenessTimeoutDurationMs,
|
|
12221
|
+
faceLivenessTimeoutDurationMs = _f === void 0 ? 15000 : _f,
|
|
12222
|
+
_g = _a.faceLivenessLoadingOverlayMode,
|
|
12223
|
+
faceLivenessLoadingOverlayMode = _g === void 0 ? 'default' : _g,
|
|
12224
|
+
_h = _a.skipSuccessScreen,
|
|
12225
|
+
skipSuccessScreen = _h === void 0 ? false : _h,
|
|
12358
12226
|
idCaptureInstructions = _a.idCaptureInstructions,
|
|
12359
|
-
|
|
12360
|
-
idCaptureGuideType =
|
|
12361
|
-
|
|
12362
|
-
idCapturePortraitGuidesOnMobile =
|
|
12363
|
-
|
|
12364
|
-
idCaptureRotateLoadingOverlayImageWhenPortrait =
|
|
12365
|
-
|
|
12366
|
-
idCaptureModelLoadTimeoutMs =
|
|
12367
|
-
|
|
12368
|
-
selfieCaptureModelLoadTimeoutMs =
|
|
12227
|
+
_j = _a.idCaptureGuideType,
|
|
12228
|
+
idCaptureGuideType = _j === void 0 ? 'fit' : _j,
|
|
12229
|
+
_k = _a.idCapturePortraitGuidesOnMobile,
|
|
12230
|
+
idCapturePortraitGuidesOnMobile = _k === void 0 ? false : _k,
|
|
12231
|
+
_l = _a.idCaptureRotateLoadingOverlayImageWhenPortrait,
|
|
12232
|
+
idCaptureRotateLoadingOverlayImageWhenPortrait = _l === void 0 ? true : _l,
|
|
12233
|
+
_m = _a.idCaptureModelLoadTimeoutMs,
|
|
12234
|
+
idCaptureModelLoadTimeoutMs = _m === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _m,
|
|
12235
|
+
_o = _a.selfieCaptureModelLoadTimeoutMs,
|
|
12236
|
+
selfieCaptureModelLoadTimeoutMs = _o === void 0 ? defaultSelfieCaptureModelLoadTimeoutMs : _o,
|
|
12369
12237
|
onBeforeDocumentUpload = _a.onBeforeDocumentUpload,
|
|
12370
12238
|
onDocumentUploadProgress = _a.onDocumentUploadProgress,
|
|
12371
12239
|
onDocumentUploaded = _a.onDocumentUploaded,
|
|
@@ -12381,28 +12249,28 @@ var CustomerIdAndBiometricsEnrollment = function CustomerIdAndBiometricsEnrollme
|
|
|
12381
12249
|
onIdCaptureModelError = _a.onIdCaptureModelError,
|
|
12382
12250
|
onSelfieCaptureModelError = _a.onSelfieCaptureModelError,
|
|
12383
12251
|
onCameraAccessDenied = _a.onCameraAccessDenied,
|
|
12384
|
-
|
|
12385
|
-
captureSignature =
|
|
12386
|
-
|
|
12387
|
-
captureSignatureVideo =
|
|
12388
|
-
|
|
12389
|
-
captureAdditionalDocuments =
|
|
12390
|
-
|
|
12391
|
-
theme =
|
|
12392
|
-
|
|
12393
|
-
assets =
|
|
12394
|
-
|
|
12395
|
-
classNames =
|
|
12396
|
-
|
|
12397
|
-
colors =
|
|
12398
|
-
|
|
12399
|
-
verbiage =
|
|
12400
|
-
|
|
12401
|
-
geolocationEnabled =
|
|
12402
|
-
|
|
12403
|
-
geolocationRequired =
|
|
12404
|
-
|
|
12405
|
-
debugMode =
|
|
12252
|
+
_p = _a.captureSignature,
|
|
12253
|
+
captureSignature = _p === void 0 ? false : _p,
|
|
12254
|
+
_q = _a.captureSignatureVideo,
|
|
12255
|
+
captureSignatureVideo = _q === void 0 ? false : _q,
|
|
12256
|
+
_r = _a.captureAdditionalDocuments,
|
|
12257
|
+
captureAdditionalDocuments = _r === void 0 ? [] : _r,
|
|
12258
|
+
_s = _a.theme,
|
|
12259
|
+
theme = _s === void 0 ? 'default' : _s,
|
|
12260
|
+
_t = _a.assets,
|
|
12261
|
+
assets = _t === void 0 ? {} : _t,
|
|
12262
|
+
_u = _a.classNames,
|
|
12263
|
+
classNames = _u === void 0 ? {} : _u,
|
|
12264
|
+
_v = _a.colors,
|
|
12265
|
+
colors = _v === void 0 ? {} : _v,
|
|
12266
|
+
_w = _a.verbiage,
|
|
12267
|
+
verbiage = _w === void 0 ? {} : _w,
|
|
12268
|
+
_x = _a.geolocationEnabled,
|
|
12269
|
+
geolocationEnabled = _x === void 0 ? true : _x,
|
|
12270
|
+
_y = _a.geolocationRequired,
|
|
12271
|
+
geolocationRequired = _y === void 0 ? false : _y,
|
|
12272
|
+
_z = _a.debugMode,
|
|
12273
|
+
debugMode = _z === void 0 ? false : _z;
|
|
12406
12274
|
useLanguage(lang);
|
|
12407
12275
|
useDebugLogging(debugMode);
|
|
12408
12276
|
var idCaptureProps = React.useMemo(function () {
|
|
@@ -12412,12 +12280,7 @@ var CustomerIdAndBiometricsEnrollment = function CustomerIdAndBiometricsEnrollme
|
|
|
12412
12280
|
colors: colors.idCapture,
|
|
12413
12281
|
verbiage: verbiage.idCapture,
|
|
12414
12282
|
captureRequirement: idCaptureRequirement,
|
|
12415
|
-
|
|
12416
|
-
idCardAutoCaptureScoreThreshold: idCardAutoCaptureScoreThreshold,
|
|
12417
|
-
passportAutoCaptureScoreThreshold: passportAutoCaptureScoreThreshold,
|
|
12418
|
-
mrzDetectionScoreThreshold: mrzDetectionScoreThreshold,
|
|
12419
|
-
idCardFocusScoreThreshold: idCardFocusScoreThreshold,
|
|
12420
|
-
passportFocusScoreThreshold: passportFocusScoreThreshold,
|
|
12283
|
+
thresholds: idCaptureThresholds,
|
|
12421
12284
|
loadingOverlayMode: idCaptureLoadingOverlayMode,
|
|
12422
12285
|
instructions: idCaptureInstructions,
|
|
12423
12286
|
guideType: idCaptureGuideType,
|
|
@@ -12430,7 +12293,7 @@ var CustomerIdAndBiometricsEnrollment = function CustomerIdAndBiometricsEnrollme
|
|
|
12430
12293
|
skipSuccessScreen: skipSuccessScreen,
|
|
12431
12294
|
debugMode: debugMode
|
|
12432
12295
|
};
|
|
12433
|
-
}, [assets.idCapture, classNames.idCapture, colors.idCapture,
|
|
12296
|
+
}, [assets.idCapture, classNames.idCapture, colors.idCapture, verbiage.idCapture, idCaptureRequirement, idCaptureThresholds, idCaptureLoadingOverlayMode, idCaptureInstructions, idCaptureGuideType, idCapturePortraitGuidesOnMobile, idCaptureRotateLoadingOverlayImageWhenPortrait, idCaptureModelLoadTimeoutMs, onExitCapture, onUserCancel, onIdCaptureModelError, skipSuccessScreen, debugMode]);
|
|
12434
12297
|
var faceLivenessProps = React.useMemo(function () {
|
|
12435
12298
|
return {
|
|
12436
12299
|
onExitCapture: onExitCapture,
|
|
@@ -13768,70 +13631,60 @@ var VideoIdValidation = function VideoIdValidation(_a) {
|
|
|
13768
13631
|
faceLivenessProps = _a.faceLivenessProps,
|
|
13769
13632
|
_c = _a.idCaptureModelsEnabled,
|
|
13770
13633
|
idCaptureModelsEnabled = _c === void 0 ? true : _c,
|
|
13771
|
-
_d = _a.
|
|
13772
|
-
|
|
13773
|
-
_e = _a.idCardFrontFocusThreshold,
|
|
13774
|
-
idCardFrontFocusThreshold = _e === void 0 ? 0 : _e,
|
|
13775
|
-
_f = _a.goodIdCardFrontFramesThreshold,
|
|
13776
|
-
goodIdCardFrontFramesThreshold = _f === void 0 ? 1 : _f,
|
|
13777
|
-
_g = _a.idCardBackDetectionThreshold,
|
|
13778
|
-
idCardBackDetectionThreshold = _g === void 0 ? 0.6 : _g,
|
|
13779
|
-
_h = _a.idCardBackFocusThreshold,
|
|
13780
|
-
idCardBackFocusThreshold = _h === void 0 ? 0 : _h,
|
|
13781
|
-
_j = _a.goodIdCardBackFramesThreshold,
|
|
13782
|
-
goodIdCardBackFramesThreshold = _j === void 0 ? 1 : _j,
|
|
13634
|
+
_d = _a.videoIdCaptureThresholds,
|
|
13635
|
+
videoIdCaptureThresholds = _d === void 0 ? defaultVideoIdCaptureThresholds : _d,
|
|
13783
13636
|
readTextPrompt = _a.readTextPrompt,
|
|
13784
|
-
|
|
13785
|
-
readTextTimeoutDurationMs =
|
|
13786
|
-
|
|
13787
|
-
readTextMinReadingMs =
|
|
13788
|
-
|
|
13789
|
-
skipSuccessScreen =
|
|
13790
|
-
|
|
13791
|
-
skipIdCapture =
|
|
13792
|
-
|
|
13793
|
-
skipShowIdCardBack =
|
|
13794
|
-
|
|
13795
|
-
idCaptureLoadingOverlayMode =
|
|
13796
|
-
|
|
13797
|
-
idCaptureGuideType =
|
|
13798
|
-
|
|
13799
|
-
idCapturePortraitGuidesOnMobile =
|
|
13800
|
-
|
|
13801
|
-
idCaptureRotateLoadingOverlayImageWhenPortrait =
|
|
13637
|
+
_e = _a.readTextTimeoutDurationMs,
|
|
13638
|
+
readTextTimeoutDurationMs = _e === void 0 ? 15000 : _e,
|
|
13639
|
+
_f = _a.readTextMinReadingMs,
|
|
13640
|
+
readTextMinReadingMs = _f === void 0 ? 10000 : _f,
|
|
13641
|
+
_g = _a.skipSuccessScreen,
|
|
13642
|
+
skipSuccessScreen = _g === void 0 ? false : _g,
|
|
13643
|
+
_h = _a.skipIdCapture,
|
|
13644
|
+
skipIdCapture = _h === void 0 ? false : _h,
|
|
13645
|
+
_j = _a.skipShowIdCardBack,
|
|
13646
|
+
skipShowIdCardBack = _j === void 0 ? false : _j,
|
|
13647
|
+
_k = _a.idCaptureLoadingOverlayMode,
|
|
13648
|
+
idCaptureLoadingOverlayMode = _k === void 0 ? 'default' : _k,
|
|
13649
|
+
_l = _a.idCaptureGuideType,
|
|
13650
|
+
idCaptureGuideType = _l === void 0 ? 'fit' : _l,
|
|
13651
|
+
_m = _a.idCapturePortraitGuidesOnMobile,
|
|
13652
|
+
idCapturePortraitGuidesOnMobile = _m === void 0 ? false : _m,
|
|
13653
|
+
_o = _a.idCaptureRotateLoadingOverlayImageWhenPortrait,
|
|
13654
|
+
idCaptureRotateLoadingOverlayImageWhenPortrait = _o === void 0 ? true : _o,
|
|
13802
13655
|
idCardForFaceMatch = _a.idCardForFaceMatch,
|
|
13803
|
-
|
|
13804
|
-
faceLivenessLoadingOverlayMode =
|
|
13805
|
-
|
|
13806
|
-
disableFaceDetectionWhileAudioCapture =
|
|
13807
|
-
|
|
13808
|
-
disableFaceDetectionWhileAudioCaptureMsDelay =
|
|
13809
|
-
|
|
13810
|
-
silentFallback =
|
|
13811
|
-
|
|
13812
|
-
mergeAVStreams =
|
|
13813
|
-
|
|
13814
|
-
theme =
|
|
13815
|
-
|
|
13816
|
-
assets =
|
|
13817
|
-
|
|
13818
|
-
classNames =
|
|
13819
|
-
|
|
13820
|
-
colors =
|
|
13821
|
-
|
|
13822
|
-
verbiage =
|
|
13823
|
-
|
|
13824
|
-
captureSignature =
|
|
13825
|
-
|
|
13826
|
-
captureSignatureVideo =
|
|
13827
|
-
|
|
13828
|
-
captureAdditionalDocuments =
|
|
13829
|
-
|
|
13830
|
-
geolocationEnabled =
|
|
13831
|
-
|
|
13832
|
-
geolocationRequired =
|
|
13833
|
-
|
|
13834
|
-
debugMode =
|
|
13656
|
+
_p = _a.faceLivenessLoadingOverlayMode,
|
|
13657
|
+
faceLivenessLoadingOverlayMode = _p === void 0 ? 'default' : _p,
|
|
13658
|
+
_q = _a.disableFaceDetectionWhileAudioCapture,
|
|
13659
|
+
disableFaceDetectionWhileAudioCapture = _q === void 0 ? false : _q,
|
|
13660
|
+
_r = _a.disableFaceDetectionWhileAudioCaptureMsDelay,
|
|
13661
|
+
disableFaceDetectionWhileAudioCaptureMsDelay = _r === void 0 ? 2000 : _r,
|
|
13662
|
+
_s = _a.silentFallback,
|
|
13663
|
+
silentFallback = _s === void 0 ? false : _s,
|
|
13664
|
+
_t = _a.mergeAVStreams,
|
|
13665
|
+
mergeAVStreams = _t === void 0 ? false : _t,
|
|
13666
|
+
_u = _a.theme,
|
|
13667
|
+
theme = _u === void 0 ? 'default' : _u,
|
|
13668
|
+
_v = _a.assets,
|
|
13669
|
+
assets = _v === void 0 ? {} : _v,
|
|
13670
|
+
_w = _a.classNames,
|
|
13671
|
+
classNames = _w === void 0 ? {} : _w,
|
|
13672
|
+
_x = _a.colors,
|
|
13673
|
+
colors = _x === void 0 ? {} : _x,
|
|
13674
|
+
_y = _a.verbiage,
|
|
13675
|
+
verbiage = _y === void 0 ? {} : _y,
|
|
13676
|
+
_z = _a.captureSignature,
|
|
13677
|
+
captureSignature = _z === void 0 ? false : _z,
|
|
13678
|
+
_0 = _a.captureSignatureVideo,
|
|
13679
|
+
captureSignatureVideo = _0 === void 0 ? false : _0,
|
|
13680
|
+
_1 = _a.captureAdditionalDocuments,
|
|
13681
|
+
captureAdditionalDocuments = _1 === void 0 ? [] : _1,
|
|
13682
|
+
_2 = _a.geolocationEnabled,
|
|
13683
|
+
geolocationEnabled = _2 === void 0 ? true : _2,
|
|
13684
|
+
_3 = _a.geolocationRequired,
|
|
13685
|
+
geolocationRequired = _3 === void 0 ? false : _3,
|
|
13686
|
+
_4 = _a.debugMode,
|
|
13687
|
+
debugMode = _4 === void 0 ? false : _4;
|
|
13835
13688
|
useLanguage(lang);
|
|
13836
13689
|
useDebugLogging(debugMode);
|
|
13837
13690
|
var videoIdCaptureProps = React.useMemo(function () {
|
|
@@ -13839,12 +13692,7 @@ var VideoIdValidation = function VideoIdValidation(_a) {
|
|
|
13839
13692
|
idCaptureProps: idCaptureProps,
|
|
13840
13693
|
faceLivenessProps: faceLivenessProps,
|
|
13841
13694
|
idCaptureModelsEnabled: idCaptureModelsEnabled,
|
|
13842
|
-
|
|
13843
|
-
idCardFrontFocusThreshold: idCardFrontFocusThreshold,
|
|
13844
|
-
goodIdCardFrontFramesThreshold: goodIdCardFrontFramesThreshold,
|
|
13845
|
-
idCardBackDetectionThreshold: idCardBackDetectionThreshold,
|
|
13846
|
-
idCardBackFocusThreshold: idCardBackFocusThreshold,
|
|
13847
|
-
goodIdCardBackFramesThreshold: goodIdCardBackFramesThreshold,
|
|
13695
|
+
videoIdCaptureThresholds: videoIdCaptureThresholds,
|
|
13848
13696
|
readTextPrompt: readTextPrompt,
|
|
13849
13697
|
readTextTimeoutDurationMs: readTextTimeoutDurationMs,
|
|
13850
13698
|
readTextMinReadingMs: readTextMinReadingMs,
|
|
@@ -13869,7 +13717,7 @@ var VideoIdValidation = function VideoIdValidation(_a) {
|
|
|
13869
13717
|
verbiage: verbiage,
|
|
13870
13718
|
debugMode: debugMode
|
|
13871
13719
|
};
|
|
13872
|
-
}, [idCaptureProps, faceLivenessProps, idCaptureModelsEnabled,
|
|
13720
|
+
}, [idCaptureProps, faceLivenessProps, idCaptureModelsEnabled, videoIdCaptureThresholds, readTextPrompt, readTextTimeoutDurationMs, readTextMinReadingMs, onExitCapture, onExitAfterFailure, onUserCancel, skipSuccessScreen, skipIdCapture, skipShowIdCardBack, idCaptureLoadingOverlayMode, idCaptureGuideType, idCapturePortraitGuidesOnMobile, idCaptureRotateLoadingOverlayImageWhenPortrait, faceLivenessLoadingOverlayMode, disableFaceDetectionWhileAudioCapture, disableFaceDetectionWhileAudioCaptureMsDelay, silentFallback, mergeAVStreams, assets, classNames, colors, verbiage, debugMode]);
|
|
13873
13721
|
var additionalDocumentCaptureProps = React.useMemo(function () {
|
|
13874
13722
|
return {
|
|
13875
13723
|
documents: captureAdditionalDocuments,
|