idmission-web-sdk 2.2.74 → 2.2.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/CompositeWizard.d.ts.map +1 -1
- package/dist/components/customer_flows/CustomerIdAndBiometricsEnrollment.d.ts +2 -0
- package/dist/components/customer_flows/CustomerIdAndBiometricsEnrollment.d.ts.map +1 -1
- package/dist/components/customer_flows/IdAndFaceValidation.d.ts +2 -0
- package/dist/components/customer_flows/IdAndFaceValidation.d.ts.map +1 -1
- package/dist/components/customer_flows/IdValidation.d.ts +3 -1
- package/dist/components/customer_flows/IdValidation.d.ts.map +1 -1
- package/dist/components/fallback_flows/IdCapture.d.ts.map +1 -1
- package/dist/components/id_capture/CapturedDocuments.d.ts +1 -1
- package/dist/components/id_capture/CapturedDocuments.d.ts.map +1 -1
- package/dist/components/id_capture/IdCapture.d.ts +2 -2
- package/dist/components/id_capture/IdCapture.d.ts.map +1 -1
- package/dist/components/id_capture/IdCaptureModelsProvider.d.ts +2 -1
- package/dist/components/id_capture/IdCaptureModelsProvider.d.ts.map +1 -1
- package/dist/components/id_capture/IdCaptureRequirementOption.d.ts +7 -5
- package/dist/components/id_capture/IdCaptureRequirementOption.d.ts.map +1 -1
- package/dist/components/id_capture/IdCaptureStateProvider.d.ts +4 -0
- package/dist/components/id_capture/IdCaptureStateProvider.d.ts.map +1 -1
- package/dist/components/id_capture/IdCaptureSuccess.d.ts +0 -4
- package/dist/components/id_capture/IdCaptureSuccess.d.ts.map +1 -1
- package/dist/components/id_capture/IdCaptureWizard.d.ts +2 -1
- package/dist/components/id_capture/IdCaptureWizard.d.ts.map +1 -1
- package/dist/components/video_id/IdVideoCapture.d.ts +2 -0
- package/dist/components/video_id/IdVideoCapture.d.ts.map +1 -1
- package/dist/components/video_id/IdVideoCaptureWizard.d.ts.map +1 -1
- package/dist/lib/models/DocumentDetection.d.ts +6 -2
- package/dist/lib/models/DocumentDetection.d.ts.map +1 -1
- package/dist/lib/models/Focus.d.ts +4 -0
- package/dist/lib/models/Focus.d.ts.map +1 -1
- package/dist/lib/models/defaults/DocumentDetector.d.ts +1 -1
- package/dist/sdk2.cjs.development.js +463 -431
- 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 +463 -431
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +463 -431
- package/dist/sdk2.umd.development.js.map +1 -1
- package/dist/sdk2.umd.production.js +1 -1
- package/dist/sdk2.umd.production.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +3 -3
|
@@ -234,7 +234,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
234
234
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
235
235
|
};
|
|
236
236
|
|
|
237
|
-
var webSdkVersion = '2.2.
|
|
237
|
+
var webSdkVersion = '2.2.76';
|
|
238
238
|
|
|
239
239
|
function getPlatform() {
|
|
240
240
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -2297,7 +2297,7 @@ function average(arr) {
|
|
|
2297
2297
|
|
|
2298
2298
|
var DEFAULT_CDN_URL = 'https://websdk-cdn-dev.idmission.com/assets';
|
|
2299
2299
|
|
|
2300
|
-
var defaultDocumentDetectorModelPath = "".concat(DEFAULT_CDN_URL, "/models/DocumentDetector/DocumentDetector-
|
|
2300
|
+
var defaultDocumentDetectorModelPath = "".concat(DEFAULT_CDN_URL, "/models/DocumentDetector/DocumentDetector-20250111_090328.tflite");
|
|
2301
2301
|
|
|
2302
2302
|
var defaultFocusModelPath = "".concat(DEFAULT_CDN_URL, "/models/Focus/Focus-20241008_102708.tflite");
|
|
2303
2303
|
|
|
@@ -2316,6 +2316,10 @@ var defaultFocusThresholds = {
|
|
|
2316
2316
|
passport: {
|
|
2317
2317
|
desktop: 0,
|
|
2318
2318
|
mobile: 0.3
|
|
2319
|
+
},
|
|
2320
|
+
singlePage: {
|
|
2321
|
+
desktop: 0,
|
|
2322
|
+
mobile: 0.3
|
|
2319
2323
|
}
|
|
2320
2324
|
};
|
|
2321
2325
|
var classifier = null;
|
|
@@ -2941,16 +2945,19 @@ var defaultDocumentDetectionThresholds = {
|
|
|
2941
2945
|
idCardFront: 0.6,
|
|
2942
2946
|
idCardBack: 0.6,
|
|
2943
2947
|
passport: 0.4,
|
|
2948
|
+
singlePage: 0.4,
|
|
2944
2949
|
stability: {
|
|
2945
2950
|
idCardFront: 0.85,
|
|
2946
2951
|
idCardBack: 0.85,
|
|
2947
|
-
passport: 0.5
|
|
2952
|
+
passport: 0.5,
|
|
2953
|
+
singlePage: 0.5
|
|
2948
2954
|
}
|
|
2949
2955
|
};
|
|
2950
2956
|
var documentTypeDisplayNames = {
|
|
2951
2957
|
idCardFront: 'ID card front',
|
|
2952
2958
|
idCardBack: 'ID card back',
|
|
2953
2959
|
passport: 'Passport',
|
|
2960
|
+
singlePage: 'Single page',
|
|
2954
2961
|
none: 'None'
|
|
2955
2962
|
};
|
|
2956
2963
|
var detector = null;
|
|
@@ -3139,7 +3146,7 @@ var defaultDocumentDetectionBoundaries = {
|
|
|
3139
3146
|
right: 20
|
|
3140
3147
|
};
|
|
3141
3148
|
function processDocumentDetectorPrediction(prediction, thresholds, boundaries) {
|
|
3142
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
3149
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
3143
3150
|
if (boundaries === void 0) {
|
|
3144
3151
|
boundaries = defaultDocumentDetectionBoundaries;
|
|
3145
3152
|
}
|
|
@@ -3190,18 +3197,25 @@ function processDocumentDetectorPrediction(prediction, thresholds, boundaries) {
|
|
|
3190
3197
|
var bestPassportPage = detectedObjects.find(function (obj) {
|
|
3191
3198
|
return obj.label === 'Passport page';
|
|
3192
3199
|
});
|
|
3200
|
+
var bestSinglePage = detectedObjects.find(function (obj) {
|
|
3201
|
+
return obj.label === 'Single page';
|
|
3202
|
+
});
|
|
3193
3203
|
var idCardFrontDetectionScore = (_e = bestIdCardFront === null || bestIdCardFront === void 0 ? void 0 : bestIdCardFront.score) !== null && _e !== void 0 ? _e : 0;
|
|
3194
3204
|
var idCardBackDetectionScore = (_f = bestIdCardBack === null || bestIdCardBack === void 0 ? void 0 : bestIdCardBack.score) !== null && _f !== void 0 ? _f : 0;
|
|
3195
3205
|
var passportDetectionScore = (_g = bestPassportPage === null || bestPassportPage === void 0 ? void 0 : bestPassportPage.score) !== null && _g !== void 0 ? _g : 0;
|
|
3196
|
-
var
|
|
3197
|
-
var
|
|
3198
|
-
var
|
|
3199
|
-
var
|
|
3200
|
-
var
|
|
3201
|
-
var
|
|
3206
|
+
var singlePageDetectionScore = (_h = bestSinglePage === null || bestSinglePage === void 0 ? void 0 : bestSinglePage.score) !== null && _h !== void 0 ? _h : 0;
|
|
3207
|
+
var idCardFrontDetectionThresholdMet = idCardFrontDetectionScore >= ((_j = thresholds.idCardFront) !== null && _j !== void 0 ? _j : 0);
|
|
3208
|
+
var idCardBackDetectionThresholdMet = idCardBackDetectionScore >= ((_k = thresholds.idCardBack) !== null && _k !== void 0 ? _k : 0);
|
|
3209
|
+
var passportDetectionThresholdMet = passportDetectionScore >= ((_l = thresholds.passport) !== null && _l !== void 0 ? _l : 0);
|
|
3210
|
+
var singlePageDetectionThresholdMet = singlePageDetectionScore >= ((_m = thresholds.singlePage) !== null && _m !== void 0 ? _m : 0);
|
|
3211
|
+
var bestDocument = singlePageDetectionThresholdMet ? bestSinglePage : passportDetectionThresholdMet ? bestPassportPage : idCardBackDetectionThresholdMet ? bestIdCardBack : bestIdCardFront;
|
|
3212
|
+
var detectionThreshold = singlePageDetectionThresholdMet ? thresholds.singlePage : passportDetectionThresholdMet ? thresholds.passport : idCardBackDetectionThresholdMet ? thresholds.idCardBack : thresholds.idCardFront;
|
|
3213
|
+
var detectionScore = (_o = bestDocument === null || bestDocument === void 0 ? void 0 : bestDocument.score) !== null && _o !== void 0 ? _o : 0;
|
|
3202
3214
|
var detectionThresholdMet = detectionScore >= (detectionThreshold !== null && detectionThreshold !== void 0 ? detectionThreshold : 0);
|
|
3203
3215
|
var detectedDocumentType = 'none';
|
|
3204
|
-
if (
|
|
3216
|
+
if (singlePageDetectionThresholdMet) {
|
|
3217
|
+
detectedDocumentType = 'singlePage';
|
|
3218
|
+
} else if (passportDetectionThresholdMet) {
|
|
3205
3219
|
detectedDocumentType = 'passport';
|
|
3206
3220
|
} else if (idCardBackDetectionThresholdMet) {
|
|
3207
3221
|
detectedDocumentType = 'idCardBack';
|
|
@@ -3215,12 +3229,12 @@ function processDocumentDetectorPrediction(prediction, thresholds, boundaries) {
|
|
|
3215
3229
|
var documentIsStable = false;
|
|
3216
3230
|
var documentTooClose = false;
|
|
3217
3231
|
if (bestDocument) {
|
|
3218
|
-
var
|
|
3219
|
-
docWidth =
|
|
3220
|
-
docHeight =
|
|
3232
|
+
var _q = [bestDocument.box.width / frameWidth, bestDocument.box.height / frameHeight],
|
|
3233
|
+
docWidth = _q[0],
|
|
3234
|
+
docHeight = _q[1];
|
|
3221
3235
|
documentTooClose = docWidth > 0.85 || docHeight > 0.85;
|
|
3222
3236
|
if (detectionThresholdMet && documentInBounds && !documentTooClose) {
|
|
3223
|
-
var thresholdSet = (
|
|
3237
|
+
var thresholdSet = (_p = thresholds.stability) !== null && _p !== void 0 ? _p : defaultDocumentDetectionThresholds.stability;
|
|
3224
3238
|
var threshold_1 = thresholdSet[detectedDocumentType];
|
|
3225
3239
|
var framesNeeded = Math.ceil(average(framesNeededSamples));
|
|
3226
3240
|
trackBox(bestDocument.box, framesNeeded);
|
|
@@ -3242,6 +3256,8 @@ function processDocumentDetectorPrediction(prediction, thresholds, boundaries) {
|
|
|
3242
3256
|
idCardBackDetectionThresholdMet: idCardBackDetectionThresholdMet,
|
|
3243
3257
|
passportDetectionScore: passportDetectionScore,
|
|
3244
3258
|
passportDetectionThresholdMet: passportDetectionThresholdMet,
|
|
3259
|
+
singlePageDetectionScore: singlePageDetectionScore,
|
|
3260
|
+
singlePageDetectionThresholdMet: singlePageDetectionThresholdMet,
|
|
3245
3261
|
bestDocument: bestDocument,
|
|
3246
3262
|
documentInBounds: documentInBounds,
|
|
3247
3263
|
documentTooClose: documentTooClose,
|
|
@@ -4134,37 +4150,39 @@ var IdCaptureModelsContext = /*#__PURE__*/React.createContext({
|
|
|
4134
4150
|
});
|
|
4135
4151
|
function IdCaptureModelsProviderInner(_a) {
|
|
4136
4152
|
var children = _a.children,
|
|
4137
|
-
onModelError = _a.onModelError
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4153
|
+
onModelError = _a.onModelError,
|
|
4154
|
+
_b = _a.allowSinglePageIdCapture,
|
|
4155
|
+
allowSinglePageIdCapture = _b === void 0 ? false : _b;
|
|
4156
|
+
var _c = React.useContext(DocumentDetectionModelContext),
|
|
4157
|
+
documentDetectionModelReady = _c.documentDetectionModelReady,
|
|
4158
|
+
documentDetectionModelDownloadProgress = _c.documentDetectionModelDownloadProgress,
|
|
4159
|
+
startDocumentDetection = _c.startDocumentDetection,
|
|
4160
|
+
stopDocumentDetection = _c.stopDocumentDetection,
|
|
4161
|
+
lastPredictionCanvas = _c.documentDetectionLastPredictionCanvas,
|
|
4162
|
+
clearDocumentDetectionLastPredictionCanvas = _c.clearDocumentDetectionLastPredictionCanvas,
|
|
4163
|
+
onDocumentDetected = _c.onDocumentDetected,
|
|
4164
|
+
detectionTime = _c.detectionTime,
|
|
4165
|
+
documentDetectionThresholds = _c.documentDetectionThresholds,
|
|
4166
|
+
setDocumentDetectionThresholds = _c.setDocumentDetectionThresholds,
|
|
4167
|
+
documentDetectionBoundaries = _c.documentDetectionBoundaries,
|
|
4168
|
+
setDocumentDetectionBoundaries = _c.setDocumentDetectionBoundaries,
|
|
4169
|
+
documentDetectionModelError = _c.documentDetectionModelError;
|
|
4170
|
+
var _d = React.useContext(FocusModelContext),
|
|
4171
|
+
focusModelReady = _d.focusModelReady,
|
|
4172
|
+
focusModelDownloadProgress = _d.focusModelDownloadProgress,
|
|
4173
|
+
makeFocusPrediction = _d.makeFocusPrediction,
|
|
4174
|
+
focusThresholds = _d.focusThresholds,
|
|
4175
|
+
setFocusThresholds = _d.setFocusThresholds,
|
|
4176
|
+
focusPredictionTime = _d.focusPredictionTime,
|
|
4177
|
+
focusModelError = _d.focusModelError;
|
|
4160
4178
|
var onPredictionHandler = React.useRef();
|
|
4161
4179
|
var bestFrameDetails = React.useRef(null);
|
|
4162
4180
|
var bestPredictionCanvas = React.useRef(null);
|
|
4163
4181
|
var bestFocusScore = React.useRef(0);
|
|
4164
4182
|
var stopDetection = React.useRef(0);
|
|
4165
|
-
var
|
|
4166
|
-
requiredDocumentType =
|
|
4167
|
-
setRequiredDocumentType =
|
|
4183
|
+
var _e = React.useState('none'),
|
|
4184
|
+
requiredDocumentType = _e[0],
|
|
4185
|
+
setRequiredDocumentType = _e[1];
|
|
4168
4186
|
var thresholds = React.useMemo(function () {
|
|
4169
4187
|
return _assign(_assign({}, documentDetectionThresholds), {
|
|
4170
4188
|
focus: focusThresholds
|
|
@@ -4182,34 +4200,42 @@ function IdCaptureModelsProviderInner(_a) {
|
|
|
4182
4200
|
var _this = this;
|
|
4183
4201
|
onDocumentDetected(function (prediction) {
|
|
4184
4202
|
return __awaiter(_this, void 0, void 0, function () {
|
|
4185
|
-
var stopDetectionAtStart, focusPredictionTime, focusScore, focusThresholdMet, isRequiredDocumentType, focusPrediction, focusThresholdSet, focusThreshold;
|
|
4186
|
-
var _a, _b, _c, _d, _e, _f;
|
|
4187
|
-
return __generator(this, function (
|
|
4203
|
+
var stopDetectionAtStart, focusPredictionTime, focusScore, focusThresholdMet, isSinglePage, isRequiredDocumentType, focusPrediction, focusThresholdSet, focusThreshold;
|
|
4204
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
4205
|
+
return __generator(this, function (_h) {
|
|
4188
4206
|
if (!lastPredictionCanvas.current) return [2 /*return*/];
|
|
4189
4207
|
stopDetectionAtStart = stopDetection.current;
|
|
4190
4208
|
focusPredictionTime = 0, focusScore = 0, focusThresholdMet = false;
|
|
4191
|
-
|
|
4209
|
+
isSinglePage = prediction.detectedDocumentType === 'singlePage';
|
|
4210
|
+
if (!allowSinglePageIdCapture && isSinglePage) {
|
|
4211
|
+
prediction.detectedDocumentType = 'passport';
|
|
4212
|
+
prediction.passportDetectionScore = prediction.singlePageDetectionScore;
|
|
4213
|
+
prediction.passportDetectionThresholdMet = prediction.singlePageDetectionThresholdMet;
|
|
4214
|
+
prediction.singlePageDetectionScore = 0;
|
|
4215
|
+
prediction.singlePageDetectionThresholdMet = false;
|
|
4216
|
+
}
|
|
4217
|
+
isRequiredDocumentType = requiredDocumentType === 'none' || prediction.detectedDocumentType === requiredDocumentType || ((_a = requiredDocumentType.includes) === null || _a === void 0 ? void 0 : _a.call(requiredDocumentType, prediction.detectedDocumentType)) || allowSinglePageIdCapture && isSinglePage && ((_b = requiredDocumentType.includes) === null || _b === void 0 ? void 0 : _b.call(requiredDocumentType, 'idCardFront'));
|
|
4192
4218
|
if (isRequiredDocumentType && prediction.detectedDocumentType !== 'none' && prediction.detectionThresholdMet && prediction.documentInBounds && !prediction.documentTooClose && prediction.documentIsStable) {
|
|
4193
|
-
focusPrediction = makeFocusPrediction(lastPredictionCanvas.current, (
|
|
4219
|
+
focusPrediction = makeFocusPrediction(lastPredictionCanvas.current, (_c = prediction.bestDocument) === null || _c === void 0 ? void 0 : _c.box);
|
|
4194
4220
|
if (focusPrediction) {
|
|
4195
4221
|
focusScore = focusPrediction.score;
|
|
4196
4222
|
focusPredictionTime = focusPrediction.predictionTime;
|
|
4197
4223
|
}
|
|
4198
|
-
focusThresholdSet = (
|
|
4199
|
-
focusThreshold = (
|
|
4224
|
+
focusThresholdSet = (_d = thresholds.focus) === null || _d === void 0 ? void 0 : _d[prediction.detectedDocumentType];
|
|
4225
|
+
focusThreshold = (_e = onMobile ? focusThresholdSet === null || focusThresholdSet === void 0 ? void 0 : focusThresholdSet.mobile : focusThresholdSet === null || focusThresholdSet === void 0 ? void 0 : focusThresholdSet.desktop) !== null && _e !== void 0 ? _e : 0;
|
|
4200
4226
|
focusThresholdMet = focusScore >= focusThreshold;
|
|
4201
4227
|
if (bestFocusScore.current <= focusScore && stopDetectionAtStart === stopDetection.current) {
|
|
4202
4228
|
bestFocusScore.current = focusScore;
|
|
4203
4229
|
drawToCanvas(bestPredictionCanvas.current, lastPredictionCanvas.current);
|
|
4204
4230
|
bestFrameDetails.current = {
|
|
4205
|
-
boundingBox: (
|
|
4231
|
+
boundingBox: (_f = prediction.bestDocument) === null || _f === void 0 ? void 0 : _f.box,
|
|
4206
4232
|
documentType: prediction.detectedDocumentType,
|
|
4207
4233
|
detectionScore: prediction.detectionScore,
|
|
4208
4234
|
focusScore: focusScore
|
|
4209
4235
|
};
|
|
4210
4236
|
}
|
|
4211
4237
|
}
|
|
4212
|
-
(
|
|
4238
|
+
(_g = onPredictionHandler.current) === null || _g === void 0 ? void 0 : _g.call(onPredictionHandler, _assign(_assign({}, prediction), {
|
|
4213
4239
|
focusScore: focusScore,
|
|
4214
4240
|
focusPredictionTime: focusPredictionTime,
|
|
4215
4241
|
focusThresholdMet: focusThresholdMet
|
|
@@ -4218,7 +4244,7 @@ function IdCaptureModelsProviderInner(_a) {
|
|
|
4218
4244
|
});
|
|
4219
4245
|
});
|
|
4220
4246
|
});
|
|
4221
|
-
}, [lastPredictionCanvas, makeFocusPrediction, onDocumentDetected, requiredDocumentType, thresholds.focus]);
|
|
4247
|
+
}, [allowSinglePageIdCapture, lastPredictionCanvas, makeFocusPrediction, onDocumentDetected, requiredDocumentType, thresholds.focus]);
|
|
4222
4248
|
var modelError = documentDetectionModelError !== null && documentDetectionModelError !== void 0 ? documentDetectionModelError : focusModelError;
|
|
4223
4249
|
React.useEffect(function handleModelErrors() {
|
|
4224
4250
|
if (modelError) onModelError === null || onModelError === void 0 ? void 0 : onModelError(modelError);
|
|
@@ -4232,9 +4258,9 @@ function IdCaptureModelsProviderInner(_a) {
|
|
|
4232
4258
|
canvas: bestPredictionCanvas.current
|
|
4233
4259
|
});
|
|
4234
4260
|
}, []);
|
|
4235
|
-
var
|
|
4236
|
-
canvasKey =
|
|
4237
|
-
setCanvasKey =
|
|
4261
|
+
var _f = React.useState(0),
|
|
4262
|
+
canvasKey = _f[0],
|
|
4263
|
+
setCanvasKey = _f[1];
|
|
4238
4264
|
var resetBestFrame = React.useCallback(function () {
|
|
4239
4265
|
stopDetection.current += 1;
|
|
4240
4266
|
setCanvasKey(function (n) {
|
|
@@ -4281,9 +4307,9 @@ function IdCaptureModelsProvider(_a) {
|
|
|
4281
4307
|
return /*#__PURE__*/React__namespace.default.createElement(DocumentDetectionModelProvider, _assign({}, props), /*#__PURE__*/React__namespace.default.createElement(FocusModelProvider, _assign({}, props), /*#__PURE__*/React__namespace.default.createElement(IdCaptureModelsProviderInner, _assign({}, props), children)));
|
|
4282
4308
|
}
|
|
4283
4309
|
|
|
4284
|
-
var CapturedDocumentTypeValues = ['idCardFront', 'idCardBack', 'passport', 'selfie'];
|
|
4310
|
+
var CapturedDocumentTypeValues = ['idCardFront', 'idCardBack', 'passport', 'singlePage', 'selfie'];
|
|
4285
4311
|
|
|
4286
|
-
var
|
|
4312
|
+
var acceptedDocumentTypesForIdCaptureRequirementOption = {
|
|
4287
4313
|
idCardFront: ['idCardFront'],
|
|
4288
4314
|
idCardBack: ['idCardBack'],
|
|
4289
4315
|
passport: ['passport'],
|
|
@@ -4291,13 +4317,31 @@ var requiredDocumentsForOption = {
|
|
|
4291
4317
|
idCardAndPassport: ['idCardFront', 'idCardBack', 'passport'],
|
|
4292
4318
|
idCardOrPassport: ['idCardFront', 'idCardBack', 'passport'] // this one is so weird
|
|
4293
4319
|
};
|
|
4294
|
-
function
|
|
4320
|
+
function minImageCountForIdCaptureRequirementOption(idCaptureRequirement) {
|
|
4295
4321
|
if (idCaptureRequirement === 'idCardOrPassport') return 1;
|
|
4296
|
-
return
|
|
4322
|
+
return acceptedDocumentTypesForIdCaptureRequirementOption[idCaptureRequirement].length;
|
|
4297
4323
|
}
|
|
4298
|
-
function
|
|
4324
|
+
function maxImageCountForIdCaptureRequirementOption(idCaptureRequirement) {
|
|
4299
4325
|
if (idCaptureRequirement === 'idCardOrPassport') return 2;
|
|
4300
|
-
return
|
|
4326
|
+
return minImageCountForIdCaptureRequirementOption(idCaptureRequirement);
|
|
4327
|
+
}
|
|
4328
|
+
function remainingIdCaptureRequirements(captureRequirement, capturedDocuments, requestedDocumentType) {
|
|
4329
|
+
var isIdCardOrPassport = captureRequirement === 'idCardOrPassport';
|
|
4330
|
+
if (isIdCardOrPassport && requestedDocumentType === 'passport') return [];
|
|
4331
|
+
var acceptedTypes = acceptedDocumentTypesForIdCaptureRequirementOption[captureRequirement];
|
|
4332
|
+
if (captureRequirement.includes('idCard') && 'singlePage' in capturedDocuments) {
|
|
4333
|
+
acceptedTypes = acceptedTypes.filter(function (v) {
|
|
4334
|
+
return !v.includes('idCard');
|
|
4335
|
+
});
|
|
4336
|
+
}
|
|
4337
|
+
if (isIdCardOrPassport) {
|
|
4338
|
+
acceptedTypes = acceptedTypes.filter(function (v) {
|
|
4339
|
+
return v !== 'passport';
|
|
4340
|
+
});
|
|
4341
|
+
}
|
|
4342
|
+
return acceptedTypes.filter(function (v) {
|
|
4343
|
+
return !(v in capturedDocuments);
|
|
4344
|
+
});
|
|
4301
4345
|
}
|
|
4302
4346
|
|
|
4303
4347
|
var initialState$4 = {
|
|
@@ -4336,6 +4380,8 @@ var initialState$4 = {
|
|
|
4336
4380
|
idCardBackDetectionThresholdMet: false,
|
|
4337
4381
|
passportDetectionScore: 0,
|
|
4338
4382
|
passportDetectionThresholdMet: false,
|
|
4383
|
+
singlePageDetectionScore: 0,
|
|
4384
|
+
singlePageDetectionThresholdMet: false,
|
|
4339
4385
|
focusScore: 0,
|
|
4340
4386
|
focusThresholdMet: false,
|
|
4341
4387
|
isGoodFrame: false,
|
|
@@ -4351,6 +4397,7 @@ var initialState$4 = {
|
|
|
4351
4397
|
capturedDocuments: {},
|
|
4352
4398
|
captureRequirement: 'idCardOrPassport',
|
|
4353
4399
|
requestedDocumentType: 'idCardFront',
|
|
4400
|
+
allowSinglePageIdCapture: false,
|
|
4354
4401
|
allowIdCardBackToFrontCapture: false,
|
|
4355
4402
|
operationStartedAt: null,
|
|
4356
4403
|
captureStartedAt: null
|
|
@@ -4365,11 +4412,13 @@ var _reducer = function reducer(state, action) {
|
|
|
4365
4412
|
var _c = action.payload,
|
|
4366
4413
|
captureRequirement = _c.captureRequirement,
|
|
4367
4414
|
precapturedDocuments = _c.precapturedDocuments,
|
|
4415
|
+
allowSinglePageIdCapture = _c.allowSinglePageIdCapture,
|
|
4368
4416
|
allowIdCardBackToFrontCapture = _c.allowIdCardBackToFrontCapture,
|
|
4369
4417
|
enableOverrideWrongDocumentTypeDialog = _c.enableOverrideWrongDocumentTypeDialog,
|
|
4370
4418
|
allowOverrideWrongDocumentTypeAfterMs = _c.allowOverrideWrongDocumentTypeAfterMs;
|
|
4371
4419
|
var newState = _assign(_assign({}, state), {
|
|
4372
4420
|
captureRequirement: captureRequirement,
|
|
4421
|
+
allowSinglePageIdCapture: allowSinglePageIdCapture !== null && allowSinglePageIdCapture !== void 0 ? allowSinglePageIdCapture : false,
|
|
4373
4422
|
allowIdCardBackToFrontCapture: allowIdCardBackToFrontCapture !== null && allowIdCardBackToFrontCapture !== void 0 ? allowIdCardBackToFrontCapture : false,
|
|
4374
4423
|
enableOverrideWrongDocumentTypeDialog: enableOverrideWrongDocumentTypeDialog,
|
|
4375
4424
|
allowOverrideWrongDocumentTypeAfterMs: allowOverrideWrongDocumentTypeAfterMs
|
|
@@ -4437,6 +4486,8 @@ var _reducer = function reducer(state, action) {
|
|
|
4437
4486
|
idCardBackDetectionThresholdMet = _d.idCardBackDetectionThresholdMet,
|
|
4438
4487
|
passportDetectionScore = _d.passportDetectionScore,
|
|
4439
4488
|
passportDetectionThresholdMet = _d.passportDetectionThresholdMet,
|
|
4489
|
+
singlePageDetectionScore = _d.singlePageDetectionScore,
|
|
4490
|
+
singlePageDetectionThresholdMet = _d.singlePageDetectionThresholdMet,
|
|
4440
4491
|
bestDocument = _d.bestDocument,
|
|
4441
4492
|
documentInBounds = _d.documentInBounds,
|
|
4442
4493
|
documentTooClose = _d.documentTooClose,
|
|
@@ -4457,7 +4508,8 @@ var _reducer = function reducer(state, action) {
|
|
|
4457
4508
|
}
|
|
4458
4509
|
}
|
|
4459
4510
|
}
|
|
4460
|
-
var
|
|
4511
|
+
var idCardDetected = detectedDocumentType.includes('idCard') || detectedDocumentType === 'singlePage';
|
|
4512
|
+
var idCardDetectedButNotAllowed = idCardDetected && !state.captureRequirement.includes('idCard');
|
|
4461
4513
|
var passportNotAllowed = !state.captureRequirement.toLowerCase().includes('passport');
|
|
4462
4514
|
var idCardFrontWasCaptured = 'idCardFront' in state.capturedDocuments;
|
|
4463
4515
|
var idCardBackWasCaptured = 'idCardBack' in state.capturedDocuments;
|
|
@@ -4517,6 +4569,8 @@ var _reducer = function reducer(state, action) {
|
|
|
4517
4569
|
idCardBackDetectionThresholdMet: idCardBackDetectionThresholdMet,
|
|
4518
4570
|
passportDetectionScore: passportDetectionScore,
|
|
4519
4571
|
passportDetectionThresholdMet: passportDetectionThresholdMet,
|
|
4572
|
+
singlePageDetectionScore: singlePageDetectionScore,
|
|
4573
|
+
singlePageDetectionThresholdMet: singlePageDetectionThresholdMet,
|
|
4520
4574
|
focusScore: focusScore,
|
|
4521
4575
|
focusThresholdMet: focusThresholdMet,
|
|
4522
4576
|
isGoodFrame: isGoodFrame,
|
|
@@ -4554,7 +4608,7 @@ var _reducer = function reducer(state, action) {
|
|
|
4554
4608
|
});
|
|
4555
4609
|
case 'documentCaptured':
|
|
4556
4610
|
{
|
|
4557
|
-
var
|
|
4611
|
+
var newState = _assign(_assign({}, state), {
|
|
4558
4612
|
capturing: false,
|
|
4559
4613
|
captureFailed: false,
|
|
4560
4614
|
allowOverrideFlipRequirement: false,
|
|
@@ -4563,64 +4617,42 @@ var _reducer = function reducer(state, action) {
|
|
|
4563
4617
|
wrongDocumentTypePredictions: 0,
|
|
4564
4618
|
capturedDocuments: _assign(_assign({}, state.capturedDocuments), (_a = {}, _a[action.payload.documentType] = action.payload, _a))
|
|
4565
4619
|
});
|
|
4566
|
-
var remainingRequirements =
|
|
4567
|
-
return !(v in newState_1.capturedDocuments);
|
|
4568
|
-
});
|
|
4569
|
-
if (state.captureRequirement === 'idCardOrPassport') {
|
|
4570
|
-
if (state.requestedDocumentType === 'passport') {
|
|
4571
|
-
remainingRequirements = [];
|
|
4572
|
-
} else {
|
|
4573
|
-
remainingRequirements = remainingRequirements.filter(function (v) {
|
|
4574
|
-
return v !== 'passport';
|
|
4575
|
-
});
|
|
4576
|
-
}
|
|
4577
|
-
}
|
|
4620
|
+
var remainingRequirements = remainingIdCaptureRequirements(state.captureRequirement, newState.capturedDocuments, state.requestedDocumentType);
|
|
4578
4621
|
if (remainingRequirements.length === 0) {
|
|
4579
|
-
|
|
4622
|
+
newState.captureState = 'complete';
|
|
4580
4623
|
} else {
|
|
4581
|
-
|
|
4582
|
-
if (state.requestedDocumentType === 'idCardFront' &&
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
|
|
4624
|
+
newState.requestedDocumentType = remainingRequirements[0];
|
|
4625
|
+
if (state.requestedDocumentType === 'idCardFront' && newState.requestedDocumentType === 'idCardBack' || state.requestedDocumentType === 'idCardBack' && newState.requestedDocumentType === 'idCardFront') {
|
|
4626
|
+
newState.captureState = 'requestingFlip';
|
|
4627
|
+
newState.idCardFrontDetectionThresholdMet = false;
|
|
4628
|
+
newState.idCardBackDetectionThresholdMet = false;
|
|
4629
|
+
newState.passportDetectionThresholdMet = false;
|
|
4630
|
+
newState.wrongDocumentTypePredictions = 0;
|
|
4588
4631
|
}
|
|
4589
4632
|
}
|
|
4590
|
-
return
|
|
4633
|
+
return newState;
|
|
4591
4634
|
}
|
|
4592
4635
|
case 'documentCapturedManually':
|
|
4593
4636
|
{
|
|
4594
|
-
var
|
|
4637
|
+
var newState = _assign(_assign({}, state), {
|
|
4595
4638
|
capturedDocuments: _assign(_assign({}, state.capturedDocuments), (_b = {}, _b[state.requestedDocumentType] = _assign(_assign({}, action.payload), {
|
|
4596
4639
|
width: 0,
|
|
4597
4640
|
height: 0
|
|
4598
4641
|
}), _b))
|
|
4599
4642
|
});
|
|
4600
|
-
var remainingRequirements =
|
|
4601
|
-
return !(v in newState_2.capturedDocuments);
|
|
4602
|
-
});
|
|
4603
|
-
if (state.captureRequirement === 'idCardOrPassport') {
|
|
4604
|
-
if (state.requestedDocumentType === 'passport') {
|
|
4605
|
-
remainingRequirements = [];
|
|
4606
|
-
} else {
|
|
4607
|
-
remainingRequirements = remainingRequirements.filter(function (v) {
|
|
4608
|
-
return v !== 'passport';
|
|
4609
|
-
});
|
|
4610
|
-
}
|
|
4611
|
-
}
|
|
4643
|
+
var remainingRequirements = remainingIdCaptureRequirements(state.captureRequirement, newState.capturedDocuments, state.requestedDocumentType);
|
|
4612
4644
|
if (remainingRequirements.length === 0) {
|
|
4613
|
-
|
|
4645
|
+
newState.captureState = 'complete';
|
|
4614
4646
|
} else {
|
|
4615
|
-
|
|
4616
|
-
if (state.requestedDocumentType === 'idCardFront' &&
|
|
4617
|
-
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
|
|
4647
|
+
newState.requestedDocumentType = remainingRequirements[0];
|
|
4648
|
+
if (state.requestedDocumentType === 'idCardFront' && newState.requestedDocumentType === 'idCardBack' || state.requestedDocumentType === 'idCardBack' && newState.requestedDocumentType === 'idCardFront') {
|
|
4649
|
+
newState.captureState = 'requestingFlip';
|
|
4650
|
+
newState.idCardFrontDetectionThresholdMet = false;
|
|
4651
|
+
newState.idCardBackDetectionThresholdMet = false;
|
|
4652
|
+
newState.passportDetectionThresholdMet = false;
|
|
4621
4653
|
}
|
|
4622
4654
|
}
|
|
4623
|
-
return
|
|
4655
|
+
return newState;
|
|
4624
4656
|
}
|
|
4625
4657
|
case 'flipRequestCompleted':
|
|
4626
4658
|
return _assign(_assign({}, state), {
|
|
@@ -5221,7 +5253,7 @@ var IdCapture = function IdCapture(_a) {
|
|
|
5221
5253
|
imageUrl: imageUrl
|
|
5222
5254
|
}
|
|
5223
5255
|
});
|
|
5224
|
-
var capturedDocumentType = documentType
|
|
5256
|
+
var capturedDocumentType = documentType;
|
|
5225
5257
|
setTimeout(function () {
|
|
5226
5258
|
var _a;
|
|
5227
5259
|
var captureTime = new Date().getTime() - ((_a = state.captureStartedAt) !== null && _a !== void 0 ? _a : new Date()).getTime();
|
|
@@ -5288,7 +5320,7 @@ var IdCapture = function IdCapture(_a) {
|
|
|
5288
5320
|
scaling: debugScalingDetails,
|
|
5289
5321
|
flipX: !isRearFacing
|
|
5290
5322
|
});
|
|
5291
|
-
}))), debugMode && ( /*#__PURE__*/React__namespace.default.createElement(DebugStatsPane, null, camera ? ( /*#__PURE__*/React__namespace.default.createElement(React__namespace.default.Fragment, null, "\u2705 Camera: ", camera.label, " (", camera.width, "x", camera.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React__namespace.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__namespace.default.createElement("br", null), modelsReady ? ( /*#__PURE__*/React__namespace.default.createElement(React__namespace.default.Fragment, null, state.detectionThresholdMet ? '✅' : '❌', " Detected Document Type: ", state.detectedDocumentType, /*#__PURE__*/React__namespace.default.createElement("br", null), state.idCardFrontDetectionThresholdMet ? '✅' : '❌', " ID Card Front Score: ", state.idCardFrontDetectionScore.toFixed(3), /*#__PURE__*/React__namespace.default.createElement("br", null), state.idCardBackDetectionThresholdMet ? '✅' : '❌', " ID Card Back Score: ", state.idCardBackDetectionScore.toFixed(3), /*#__PURE__*/React__namespace.default.createElement("br", null), state.passportDetectionThresholdMet ? '✅' : '❌', " Passport Score: ", state.passportDetectionScore.toFixed(3), /*#__PURE__*/React__namespace.default.createElement("br", null), state.focusThresholdMet ? '✅' : '❌', " Focus Score:", ' ', state.focusScore.toFixed(3), /*#__PURE__*/React__namespace.default.createElement("br", null), state.documentInBounds ? '✅' : '❌', " Document In Bounds", /*#__PURE__*/React__namespace.default.createElement("br", null), state.documentIsStable ? '✅' : '❌', " Document Is Stable", /*#__PURE__*/React__namespace.default.createElement("br", null), state.goodFramesThresholdMet ? '✅' : '❌', " Good Frame Count:", ' ', state.goodFramesCount, "/", state.goodFramesThreshold)) : ( /*#__PURE__*/React__namespace.default.createElement(React__namespace.default.Fragment, null, "\u274C Models not ready")))));
|
|
5323
|
+
}))), debugMode && ( /*#__PURE__*/React__namespace.default.createElement(DebugStatsPane, null, camera ? ( /*#__PURE__*/React__namespace.default.createElement(React__namespace.default.Fragment, null, "\u2705 Camera: ", camera.label, " (", camera.width, "x", camera.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React__namespace.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__namespace.default.createElement("br", null), modelsReady ? ( /*#__PURE__*/React__namespace.default.createElement(React__namespace.default.Fragment, null, state.detectionThresholdMet ? '✅' : '❌', " Detected Document Type: ", state.detectedDocumentType, /*#__PURE__*/React__namespace.default.createElement("br", null), state.idCardFrontDetectionThresholdMet ? '✅' : '❌', " ID Card Front Score: ", state.idCardFrontDetectionScore.toFixed(3), /*#__PURE__*/React__namespace.default.createElement("br", null), state.idCardBackDetectionThresholdMet ? '✅' : '❌', " ID Card Back Score: ", state.idCardBackDetectionScore.toFixed(3), /*#__PURE__*/React__namespace.default.createElement("br", null), state.passportDetectionThresholdMet ? '✅' : '❌', " Passport Score: ", state.passportDetectionScore.toFixed(3), /*#__PURE__*/React__namespace.default.createElement("br", null), state.singlePageDetectionThresholdMet ? '✅' : '❌', " Single Page Score: ", state.singlePageDetectionScore.toFixed(3), /*#__PURE__*/React__namespace.default.createElement("br", null), state.focusThresholdMet ? '✅' : '❌', " Focus Score:", ' ', state.focusScore.toFixed(3), /*#__PURE__*/React__namespace.default.createElement("br", null), state.documentInBounds ? '✅' : '❌', " Document In Bounds", /*#__PURE__*/React__namespace.default.createElement("br", null), state.documentIsStable ? '✅' : '❌', " Document Is Stable", /*#__PURE__*/React__namespace.default.createElement("br", null), state.goodFramesThresholdMet ? '✅' : '❌', " Good Frame Count:", ' ', state.goodFramesCount, "/", state.goodFramesThreshold)) : ( /*#__PURE__*/React__namespace.default.createElement(React__namespace.default.Fragment, null, "\u274C Models not ready")))));
|
|
5292
5324
|
};
|
|
5293
5325
|
var timeSince = function timeSince(t) {
|
|
5294
5326
|
if (!t) return 0;
|
|
@@ -6327,15 +6359,8 @@ var IdCaptureSuccess = function IdCaptureSuccess(_a) {
|
|
|
6327
6359
|
_e = _a.debugMode,
|
|
6328
6360
|
debugMode = _e === void 0 ? false : _e;
|
|
6329
6361
|
var submissionStatus = React.useContext(SubmissionContext).submissionStatus;
|
|
6330
|
-
var idCardFront = capturedDocuments.idCardFront,
|
|
6331
|
-
idCardBack = capturedDocuments.idCardBack,
|
|
6332
|
-
passport = capturedDocuments.passport;
|
|
6333
6362
|
var verbiage = useTranslations(rawVerbiage, {
|
|
6334
6363
|
headingText: 'ID Capture Successful',
|
|
6335
|
-
idCardFrontText: 'ID Card Front',
|
|
6336
|
-
idCardBackText: 'ID Card Back',
|
|
6337
|
-
passportText: 'Passport',
|
|
6338
|
-
instructionText: 'Verify the entire ID was captured clearly with no glare.',
|
|
6339
6364
|
retryText: 'Retry',
|
|
6340
6365
|
submittingText: 'Submitting...',
|
|
6341
6366
|
submitText: 'Done'
|
|
@@ -6352,25 +6377,16 @@ var IdCaptureSuccess = function IdCaptureSuccess(_a) {
|
|
|
6352
6377
|
className: classNames.imageContainer
|
|
6353
6378
|
}, /*#__PURE__*/React__namespace.default.createElement(ImageRow, {
|
|
6354
6379
|
className: classNames.imageRow
|
|
6355
|
-
},
|
|
6356
|
-
|
|
6357
|
-
|
|
6358
|
-
|
|
6359
|
-
|
|
6360
|
-
|
|
6361
|
-
|
|
6362
|
-
|
|
6363
|
-
|
|
6364
|
-
|
|
6365
|
-
className: classNames.image,
|
|
6366
|
-
alt: verbiage.idCardBackText
|
|
6367
|
-
}), debugMode && ( /*#__PURE__*/React__namespace.default.createElement(DebugPre, null, "Detection Score: ".concat(idCardBack.detectionScore, "\nFocus Score: ").concat(idCardBack.focusScore, "\nBounding Box: ").concat(JSON.stringify(idCardBack.boundingBox)))))), passport && ( /*#__PURE__*/React__namespace.default.createElement(ImageCol$1, {
|
|
6368
|
-
className: classNames.imageCol
|
|
6369
|
-
}, /*#__PURE__*/React__namespace.default.createElement(StyledImage, {
|
|
6370
|
-
image: passport,
|
|
6371
|
-
className: classNames.image,
|
|
6372
|
-
alt: verbiage.passportText
|
|
6373
|
-
}), debugMode && ( /*#__PURE__*/React__namespace.default.createElement(DebugPre, null, "Detection Score: ".concat(passport.detectionScore, "\nFocus Score: ").concat(passport.focusScore, "\nBounding Box: ").concat(JSON.stringify(passport.boundingBox)))))))), /*#__PURE__*/React__namespace.default.createElement(ButtonsColumn, {
|
|
6380
|
+
}, Object.values(capturedDocuments).map(function (doc) {
|
|
6381
|
+
return /*#__PURE__*/React__namespace.default.createElement(ImageCol$1, {
|
|
6382
|
+
className: classNames.imageCol,
|
|
6383
|
+
key: doc.imageData
|
|
6384
|
+
}, /*#__PURE__*/React__namespace.default.createElement(StyledImage, {
|
|
6385
|
+
image: doc,
|
|
6386
|
+
className: classNames.image,
|
|
6387
|
+
alt: doc.documentType
|
|
6388
|
+
}), debugMode && ( /*#__PURE__*/React__namespace.default.createElement(DebugPre, null, "Document Type: ".concat(doc.documentType, "\nDetection Score: ").concat(doc.detectionScore, "\nFocus Score: ").concat(doc.focusScore, "\nBounding Box: ").concat(JSON.stringify(doc.boundingBox)))));
|
|
6389
|
+
}))), /*#__PURE__*/React__namespace.default.createElement(ButtonsColumn, {
|
|
6374
6390
|
className: classNames.buttonsRow
|
|
6375
6391
|
}, /*#__PURE__*/React__namespace.default.createElement(WideButton, {
|
|
6376
6392
|
className: classNames.submitBtn,
|
|
@@ -6389,7 +6405,7 @@ var IdCaptureSuccess = function IdCaptureSuccess(_a) {
|
|
|
6389
6405
|
};
|
|
6390
6406
|
var Heading$a = styled__default.default.h1(templateObject_1$v || (templateObject_1$v = __makeTemplateObject(["\n font-size: 1.5rem;\n margin-top: 0;\n margin-bottom: 1.5rem;\n"], ["\n font-size: 1.5rem;\n margin-top: 0;\n margin-bottom: 1.5rem;\n"])));
|
|
6391
6407
|
var ImagesContainer = styled__default.default(OverlayImageContainer)(templateObject_2$q || (templateObject_2$q = __makeTemplateObject(["\n flex-grow: 1;\n overflow-y: auto;\n padding-bottom: 0;\n max-width: 100%;\n"], ["\n flex-grow: 1;\n overflow-y: auto;\n padding-bottom: 0;\n max-width: 100%;\n"])));
|
|
6392
|
-
var ImageRow = styled__default.default(OverlayImageRow)(templateObject_3$k || (templateObject_3$k = __makeTemplateObject(["\n max-width: 100%;\n flex-direction: column;\n display: grid;\n grid-gap: 12px;\n
|
|
6408
|
+
var ImageRow = styled__default.default(OverlayImageRow)(templateObject_3$k || (templateObject_3$k = __makeTemplateObject(["\n max-width: 100%;\n flex-direction: column;\n display: grid;\n grid-gap: 12px;\n"], ["\n max-width: 100%;\n flex-direction: column;\n display: grid;\n grid-gap: 12px;\n"])));
|
|
6393
6409
|
var ImageCol$1 = styled__default.default.div(templateObject_4$e || (templateObject_4$e = __makeTemplateObject(["\n width: 100%;\n max-height: none !important;\n"], ["\n width: 100%;\n max-height: none !important;\n"])));
|
|
6394
6410
|
var StyledImage = styled__default.default(CapturedDocumentImg)(templateObject_5$9 || (templateObject_5$9 = __makeTemplateObject(["\n width: 100%;\n border-radius: 12px;\n"], ["\n width: 100%;\n border-radius: 12px;\n"])));
|
|
6395
6411
|
var DebugPre = styled__default.default.pre(templateObject_6$7 || (templateObject_6$7 = __makeTemplateObject(["\n text-align: left;\n max-width: min(450px, 100dvw - 100px);\n overflow-x: auto;\n"], ["\n text-align: left;\n max-width: min(450px, 100dvw - 100px);\n overflow-x: auto;\n"])));
|
|
@@ -8099,8 +8115,8 @@ var IdCaptureFallback = function IdCaptureFallback(_a) {
|
|
|
8099
8115
|
var _j = React.useState(silentFallback),
|
|
8100
8116
|
useFallback = _j[0],
|
|
8101
8117
|
setUseFallback = _j[1];
|
|
8102
|
-
var
|
|
8103
|
-
var
|
|
8118
|
+
var minImageCount = minImageCountForIdCaptureRequirementOption(idCaptureRequirement);
|
|
8119
|
+
var maxImageCount = maxImageCountForIdCaptureRequirementOption(idCaptureRequirement);
|
|
8104
8120
|
var _k = useFileState(),
|
|
8105
8121
|
rawFile = _k.rawFile,
|
|
8106
8122
|
fileInputOnChange = _k.fileInputOnChange;
|
|
@@ -8113,7 +8129,7 @@ var IdCaptureFallback = function IdCaptureFallback(_a) {
|
|
|
8113
8129
|
var whatToCapture = idCaptureRequirement === 'idCard' ? 'ID card' : idCaptureRequirement === 'passport' ? 'passport' : idCaptureRequirement === 'idCardOrPassport' ? 'ID card or passport' : 'ID card and passport';
|
|
8114
8130
|
var firstInstructionText = idCaptureRequirement === 'idCard' || idCaptureRequirement === 'idCardAndPassport' ? 'Please capture the front of your ID card.' : idCaptureRequirement === 'passport' ? 'Please capture the ID page of your passport.' : 'Please capture the front of your ID card, or the ID page of your passport.';
|
|
8115
8131
|
var secondInstructionText = idCaptureRequirement === 'idCardOrPassport' ? 'Please capture the back of your ID card, or click Done if submitting a passport.' : 'Please capture the back of your ID card.';
|
|
8116
|
-
var descriptionText = "On-device capture guidance failed, please capture ".concat(
|
|
8132
|
+
var descriptionText = "On-device capture guidance failed, please capture ".concat(minImageCount > 1 ? 'photos' : ' a photo', " of your ").concat(whatToCapture, " manually.");
|
|
8117
8133
|
var verbiage = useTranslations(rawVerbiage, {
|
|
8118
8134
|
headingText: "We're having some trouble.",
|
|
8119
8135
|
descriptionText: descriptionText,
|
|
@@ -8187,7 +8203,7 @@ var IdCaptureFallback = function IdCaptureFallback(_a) {
|
|
|
8187
8203
|
alt: "",
|
|
8188
8204
|
className: classNames.image
|
|
8189
8205
|
}));
|
|
8190
|
-
}))), images.length <
|
|
8206
|
+
}))), images.length < minImageCount && ( /*#__PURE__*/React__namespace.default.createElement(Instruction, {
|
|
8191
8207
|
className: classNames.instruction
|
|
8192
8208
|
}, instructionText)), /*#__PURE__*/React__namespace.default.createElement("input", {
|
|
8193
8209
|
ref: fileInput,
|
|
@@ -8198,7 +8214,7 @@ var IdCaptureFallback = function IdCaptureFallback(_a) {
|
|
|
8198
8214
|
hidden: true
|
|
8199
8215
|
}), /*#__PURE__*/React__namespace.default.createElement(StyledButtonsRow$8, {
|
|
8200
8216
|
className: classNames.buttonsRow
|
|
8201
|
-
}, images.length <
|
|
8217
|
+
}, images.length < maxImageCount && ( /*#__PURE__*/React__namespace.default.createElement(LoaderButton, {
|
|
8202
8218
|
variant: images.length > 0 ? 'secondary' : 'positive',
|
|
8203
8219
|
className: images.length > 0 ? classNames.captureMoreBtn : classNames.captureBtn,
|
|
8204
8220
|
colors: images.length > 0 ? colors.captureMoreBtn : colors.captureBtn,
|
|
@@ -8211,7 +8227,7 @@ var IdCaptureFallback = function IdCaptureFallback(_a) {
|
|
|
8211
8227
|
setDocumentToCapture(instructionText);
|
|
8212
8228
|
}
|
|
8213
8229
|
}
|
|
8214
|
-
}, images.length > 0 ? verbiage.captureMoreBtnText : verbiage.captureBtnText)), images.length >=
|
|
8230
|
+
}, images.length > 0 ? verbiage.captureMoreBtnText : verbiage.captureBtnText)), images.length >= minImageCount && ( /*#__PURE__*/React__namespace.default.createElement(LoaderButton, {
|
|
8215
8231
|
variant: "positive",
|
|
8216
8232
|
className: classNames.doneBtn,
|
|
8217
8233
|
colors: colors.doneBtn,
|
|
@@ -8258,79 +8274,82 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
8258
8274
|
precapturedDocuments = _a.precapturedDocuments,
|
|
8259
8275
|
_j = _a.captureRequirement,
|
|
8260
8276
|
captureRequirement = _j === void 0 ? 'idCardOrPassport' : _j,
|
|
8261
|
-
_k = _a.
|
|
8262
|
-
|
|
8263
|
-
_l = _a.
|
|
8264
|
-
|
|
8265
|
-
_m = _a.
|
|
8266
|
-
|
|
8277
|
+
_k = _a.allowSinglePageIdCapture,
|
|
8278
|
+
allowSinglePageIdCapture = _k === void 0 ? false : _k,
|
|
8279
|
+
_l = _a.separateIdCardCaptureSequence,
|
|
8280
|
+
separateIdCardCaptureSequence = _l === void 0 ? false : _l,
|
|
8281
|
+
_m = _a.thresholds,
|
|
8282
|
+
thresholds = _m === void 0 ? defaultIdCaptureThresholds : _m,
|
|
8283
|
+
_o = _a.skipSuccessScreen,
|
|
8284
|
+
skipSuccessScreen = _o === void 0 ? false : _o,
|
|
8267
8285
|
instructions = _a.instructions,
|
|
8268
|
-
|
|
8269
|
-
releaseCameraAccessOnExit =
|
|
8270
|
-
|
|
8271
|
-
guideType =
|
|
8272
|
-
|
|
8273
|
-
portraitGuidesOnMobile =
|
|
8274
|
-
|
|
8275
|
-
rotateLoadingOverlayImageWhenPortrait =
|
|
8276
|
-
|
|
8277
|
-
silentFallback =
|
|
8278
|
-
|
|
8279
|
-
forceFallbackMode =
|
|
8280
|
-
|
|
8281
|
-
allowIdCardBackToFrontCapture =
|
|
8282
|
-
|
|
8283
|
-
enableOverrideWrongDocumentTypeDialog =
|
|
8284
|
-
|
|
8285
|
-
allowOverrideWrongDocumentTypeAfterMs =
|
|
8286
|
-
|
|
8287
|
-
guideImages =
|
|
8288
|
-
|
|
8289
|
-
assets =
|
|
8290
|
-
|
|
8291
|
-
classNames =
|
|
8292
|
-
|
|
8293
|
-
colors =
|
|
8294
|
-
|
|
8295
|
-
verbiage =
|
|
8296
|
-
|
|
8297
|
-
debugMode =
|
|
8298
|
-
var
|
|
8299
|
-
state =
|
|
8300
|
-
dispatch =
|
|
8301
|
-
var
|
|
8302
|
-
cameraAccessDenied =
|
|
8303
|
-
requestCameraAccess =
|
|
8304
|
-
releaseCameraAccess =
|
|
8305
|
-
var
|
|
8306
|
-
overlayDismissed =
|
|
8307
|
-
setOverlayDismissed =
|
|
8308
|
-
var
|
|
8309
|
-
submissionStatus =
|
|
8310
|
-
setIdFrontImage =
|
|
8311
|
-
setIdBackImage =
|
|
8312
|
-
setPassportImage =
|
|
8313
|
-
logIdFrontCaptureAttempt =
|
|
8314
|
-
logIdBackCaptureAttempt =
|
|
8315
|
-
var
|
|
8316
|
-
start =
|
|
8317
|
-
stop =
|
|
8318
|
-
onPredictionMade =
|
|
8319
|
-
setRequiredDocumentType =
|
|
8320
|
-
modelError =
|
|
8321
|
-
resetBestFrame =
|
|
8286
|
+
_p = _a.releaseCameraAccessOnExit,
|
|
8287
|
+
releaseCameraAccessOnExit = _p === void 0 ? true : _p,
|
|
8288
|
+
_q = _a.guideType,
|
|
8289
|
+
guideType = _q === void 0 ? 'fit' : _q,
|
|
8290
|
+
_r = _a.portraitGuidesOnMobile,
|
|
8291
|
+
portraitGuidesOnMobile = _r === void 0 ? true : _r,
|
|
8292
|
+
_s = _a.rotateLoadingOverlayImageWhenPortrait,
|
|
8293
|
+
rotateLoadingOverlayImageWhenPortrait = _s === void 0 ? true : _s,
|
|
8294
|
+
_t = _a.silentFallback,
|
|
8295
|
+
silentFallback = _t === void 0 ? false : _t,
|
|
8296
|
+
_u = _a.forceFallbackMode,
|
|
8297
|
+
forceFallbackMode = _u === void 0 ? false : _u,
|
|
8298
|
+
_v = _a.allowIdCardBackToFrontCapture,
|
|
8299
|
+
allowIdCardBackToFrontCapture = _v === void 0 ? false : _v,
|
|
8300
|
+
_w = _a.enableOverrideWrongDocumentTypeDialog,
|
|
8301
|
+
enableOverrideWrongDocumentTypeDialog = _w === void 0 ? false : _w,
|
|
8302
|
+
_x = _a.allowOverrideWrongDocumentTypeAfterMs,
|
|
8303
|
+
allowOverrideWrongDocumentTypeAfterMs = _x === void 0 ? 8000 : _x,
|
|
8304
|
+
_y = _a.guideImages,
|
|
8305
|
+
guideImages = _y === void 0 ? defaultIdCaptureGuideImages : _y,
|
|
8306
|
+
_z = _a.assets,
|
|
8307
|
+
assets = _z === void 0 ? {} : _z,
|
|
8308
|
+
_0 = _a.classNames,
|
|
8309
|
+
classNames = _0 === void 0 ? {} : _0,
|
|
8310
|
+
_1 = _a.colors,
|
|
8311
|
+
colors = _1 === void 0 ? {} : _1,
|
|
8312
|
+
_2 = _a.verbiage,
|
|
8313
|
+
verbiage = _2 === void 0 ? {} : _2,
|
|
8314
|
+
_3 = _a.debugMode,
|
|
8315
|
+
debugMode = _3 === void 0 ? false : _3;
|
|
8316
|
+
var _4 = useIdCaptureState(),
|
|
8317
|
+
state = _4[0],
|
|
8318
|
+
dispatch = _4[1];
|
|
8319
|
+
var _5 = useCameraStore(),
|
|
8320
|
+
cameraAccessDenied = _5.cameraAccessDenied,
|
|
8321
|
+
requestCameraAccess = _5.requestCameraAccess,
|
|
8322
|
+
releaseCameraAccess = _5.releaseCameraAccess;
|
|
8323
|
+
var _6 = React.useState(false),
|
|
8324
|
+
overlayDismissed = _6[0],
|
|
8325
|
+
setOverlayDismissed = _6[1];
|
|
8326
|
+
var _7 = React.useContext(SubmissionContext),
|
|
8327
|
+
submissionStatus = _7.submissionStatus,
|
|
8328
|
+
setIdFrontImage = _7.setIdFrontImage,
|
|
8329
|
+
setIdBackImage = _7.setIdBackImage,
|
|
8330
|
+
setPassportImage = _7.setPassportImage,
|
|
8331
|
+
logIdFrontCaptureAttempt = _7.logIdFrontCaptureAttempt,
|
|
8332
|
+
logIdBackCaptureAttempt = _7.logIdBackCaptureAttempt;
|
|
8333
|
+
var _8 = React.useContext(IdCaptureModelsContext),
|
|
8334
|
+
start = _8.start,
|
|
8335
|
+
stop = _8.stop,
|
|
8336
|
+
onPredictionMade = _8.onPredictionMade,
|
|
8337
|
+
setRequiredDocumentType = _8.setRequiredDocumentType,
|
|
8338
|
+
modelError = _8.modelError,
|
|
8339
|
+
resetBestFrame = _8.resetBestFrame;
|
|
8322
8340
|
React.useEffect(function () {
|
|
8323
8341
|
dispatch({
|
|
8324
8342
|
type: 'configureWizard',
|
|
8325
8343
|
payload: {
|
|
8326
8344
|
captureRequirement: captureRequirement,
|
|
8327
8345
|
precapturedDocuments: precapturedDocuments,
|
|
8346
|
+
allowSinglePageIdCapture: allowSinglePageIdCapture,
|
|
8328
8347
|
allowIdCardBackToFrontCapture: allowIdCardBackToFrontCapture,
|
|
8329
8348
|
enableOverrideWrongDocumentTypeDialog: enableOverrideWrongDocumentTypeDialog,
|
|
8330
8349
|
allowOverrideWrongDocumentTypeAfterMs: allowOverrideWrongDocumentTypeAfterMs
|
|
8331
8350
|
}
|
|
8332
8351
|
});
|
|
8333
|
-
}, [allowIdCardBackToFrontCapture, allowOverrideWrongDocumentTypeAfterMs, captureRequirement, dispatch, enableOverrideWrongDocumentTypeDialog, precapturedDocuments]);
|
|
8352
|
+
}, [allowIdCardBackToFrontCapture, allowOverrideWrongDocumentTypeAfterMs, allowSinglePageIdCapture, captureRequirement, dispatch, enableOverrideWrongDocumentTypeDialog, precapturedDocuments]);
|
|
8334
8353
|
var documentCount = Object.keys(state.capturedDocuments).length;
|
|
8335
8354
|
React.useEffect(function () {
|
|
8336
8355
|
if (documentCount) resetBestFrame();
|
|
@@ -8392,13 +8411,16 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
8392
8411
|
var _a = state.capturedDocuments,
|
|
8393
8412
|
idCardFront = _a.idCardFront,
|
|
8394
8413
|
idCardBack = _a.idCardBack,
|
|
8395
|
-
passport = _a.passport
|
|
8414
|
+
passport = _a.passport,
|
|
8415
|
+
singlePage = _a.singlePage;
|
|
8396
8416
|
var idFrontImage = idCardFront && dataUrlToBase64Sync(idCardFront.imageData);
|
|
8397
8417
|
var idBackImage = idCardBack && dataUrlToBase64Sync(idCardBack.imageData);
|
|
8398
8418
|
var passportImage = passport && dataUrlToBase64Sync(passport.imageData);
|
|
8419
|
+
var singlePageImage = singlePage && dataUrlToBase64Sync(singlePage.imageData);
|
|
8399
8420
|
if (idFrontImage) setIdFrontImage(idFrontImage);
|
|
8400
8421
|
if (idBackImage) setIdBackImage(idBackImage);
|
|
8401
8422
|
if (passportImage) setPassportImage(passportImage);
|
|
8423
|
+
if (singlePageImage) setIdFrontImage(singlePageImage);
|
|
8402
8424
|
if (releaseCameraAccessOnExit) releaseCameraAccess();
|
|
8403
8425
|
setTimeout(function () {
|
|
8404
8426
|
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess({
|
|
@@ -8414,9 +8436,9 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
8414
8436
|
type: 'resetWizard'
|
|
8415
8437
|
});
|
|
8416
8438
|
}, [dispatch]);
|
|
8417
|
-
var
|
|
8418
|
-
attempt =
|
|
8419
|
-
setAttempt =
|
|
8439
|
+
var _9 = React.useState(0),
|
|
8440
|
+
attempt = _9[0],
|
|
8441
|
+
setAttempt = _9[1];
|
|
8420
8442
|
var onExit = React.useCallback(function () {
|
|
8421
8443
|
releaseCameraAccess();
|
|
8422
8444
|
setOverlayDismissed(false);
|
|
@@ -8507,9 +8529,9 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
8507
8529
|
});
|
|
8508
8530
|
});
|
|
8509
8531
|
}, [dispatch]);
|
|
8510
|
-
var
|
|
8511
|
-
progressStarted =
|
|
8512
|
-
setProgressStarted =
|
|
8532
|
+
var _10 = React.useState(false),
|
|
8533
|
+
progressStarted = _10[0],
|
|
8534
|
+
setProgressStarted = _10[1];
|
|
8513
8535
|
React.useEffect(function () {
|
|
8514
8536
|
if (state.captureState === 'capturing') {
|
|
8515
8537
|
setProgressStarted(false);
|
|
@@ -12041,7 +12063,8 @@ var defaultVideoIdCaptureThresholds = {
|
|
|
12041
12063
|
detection: {
|
|
12042
12064
|
idCardFront: 0.4,
|
|
12043
12065
|
idCardBack: 0.5,
|
|
12044
|
-
passport: 0.3
|
|
12066
|
+
passport: 0.3,
|
|
12067
|
+
singlePage: 0.3
|
|
12045
12068
|
},
|
|
12046
12069
|
focus: {
|
|
12047
12070
|
idCardFront: {
|
|
@@ -12055,12 +12078,17 @@ var defaultVideoIdCaptureThresholds = {
|
|
|
12055
12078
|
passport: {
|
|
12056
12079
|
desktop: 0,
|
|
12057
12080
|
mobile: 0
|
|
12081
|
+
},
|
|
12082
|
+
singlePage: {
|
|
12083
|
+
desktop: 0,
|
|
12084
|
+
mobile: 0
|
|
12058
12085
|
}
|
|
12059
12086
|
},
|
|
12060
12087
|
goodFrames: {
|
|
12061
12088
|
idCardFront: 1,
|
|
12062
12089
|
idCardBack: 1,
|
|
12063
|
-
passport: 1
|
|
12090
|
+
passport: 1,
|
|
12091
|
+
singlePage: 1
|
|
12064
12092
|
},
|
|
12065
12093
|
flipShortcutThreshold: 0.7
|
|
12066
12094
|
};
|
|
@@ -12132,6 +12160,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
12132
12160
|
stopIdModels = _18.stop,
|
|
12133
12161
|
onIdPredictionMade = _18.onPredictionMade,
|
|
12134
12162
|
setThresholds = _18.setThresholds,
|
|
12163
|
+
setRequiredDocumentType = _18.setRequiredDocumentType,
|
|
12135
12164
|
setDocumentDetectionBoundaries = _18.setDocumentDetectionBoundaries,
|
|
12136
12165
|
bestFrameDetails = _18.bestFrameDetails,
|
|
12137
12166
|
resetBestFrame = _18.resetBestFrame,
|
|
@@ -12210,6 +12239,9 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
12210
12239
|
React.useEffect(function () {
|
|
12211
12240
|
setThresholds(adjustedThresholds);
|
|
12212
12241
|
}, [requestedAction, setThresholds, adjustedThresholds]);
|
|
12242
|
+
React.useEffect(function () {
|
|
12243
|
+
setRequiredDocumentType(requestedAction === 'SHOW_PASSPORT' ? 'passport' : requestedAction === 'SHOW_ID_BACK' ? 'idCardBack' : 'idCardFront');
|
|
12244
|
+
}, [requestedAction, setRequiredDocumentType]);
|
|
12213
12245
|
React.useEffect(function () {
|
|
12214
12246
|
setDocumentDetectionBoundaries({
|
|
12215
12247
|
top: 20,
|
|
@@ -12232,6 +12264,9 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
12232
12264
|
setGoodFramesCount = _28[1];
|
|
12233
12265
|
var goodFramesThreshold = requestedAction === 'SHOW_PASSPORT' ? adjustedThresholds.goodFrames.passport : requestedAction === 'SHOW_ID_FRONT' ? adjustedThresholds.goodFrames.idCardFront : adjustedThresholds.goodFrames.idCardBack;
|
|
12234
12266
|
var goodFramesThresholdMet = goodFramesCount >= goodFramesThreshold;
|
|
12267
|
+
var _29 = React.useState(false),
|
|
12268
|
+
isSinglePage = _29[0],
|
|
12269
|
+
setIsSinglePage = _29[1];
|
|
12235
12270
|
React.useEffect(function () {
|
|
12236
12271
|
if (!idCaptureModelsEnabled || idModelError) return;
|
|
12237
12272
|
onIdPredictionMade(function (prediction) {
|
|
@@ -12239,7 +12274,8 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
12239
12274
|
setCurrentDetectionScore(prediction.detectionScore);
|
|
12240
12275
|
setCurrentDetectedDocumentType(prediction.detectedDocumentType);
|
|
12241
12276
|
setCurrentFocusScore(prediction.focusScore);
|
|
12242
|
-
|
|
12277
|
+
setIsSinglePage(prediction.singlePageDetectionThresholdMet);
|
|
12278
|
+
var detectionThresholdMet = requestedAction === 'SHOW_PASSPORT' ? prediction.passportDetectionThresholdMet : requestedAction === 'SHOW_ID_BACK' ? prediction.idCardBackDetectionThresholdMet : prediction.idCardFrontDetectionThresholdMet || prediction.singlePageDetectionThresholdMet;
|
|
12243
12279
|
var isGoodFrame = detectionThresholdMet && prediction.focusThresholdMet;
|
|
12244
12280
|
var shouldShortcutFlipAnimation = requestedAction === 'FLIP_ID' && isGoodFrame && prediction.idCardBackDetectionScore >= adjustedThresholds.flipShortcutThreshold;
|
|
12245
12281
|
if (shouldShortcutFlipAnimation) {
|
|
@@ -12250,9 +12286,9 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
12250
12286
|
} : 0);
|
|
12251
12287
|
});
|
|
12252
12288
|
}, [idCaptureModelsEnabled, onIdPredictionMade, idModelError, requestedAction, adjustedThresholds.flipShortcutThreshold]);
|
|
12253
|
-
var
|
|
12254
|
-
idFrontCaptureStartedAt =
|
|
12255
|
-
setFirstGoodFrameTime =
|
|
12289
|
+
var _30 = React.useState(null),
|
|
12290
|
+
idFrontCaptureStartedAt = _30[0],
|
|
12291
|
+
setFirstGoodFrameTime = _30[1];
|
|
12256
12292
|
React.useEffect(function () {
|
|
12257
12293
|
if (goodFramesCount === 1) setFirstGoodFrameTime(new Date().getTime());
|
|
12258
12294
|
}, [goodFramesCount]);
|
|
@@ -12273,80 +12309,60 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
12273
12309
|
var frameHeight = (_e = (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.videoHeight) !== null && _e !== void 0 ? _e : 0;
|
|
12274
12310
|
var faceBox = face === null || face === void 0 ? void 0 : face.box;
|
|
12275
12311
|
var faceCentered = !faceBox || !frameWidth || faceBox.xMin > frameWidth * edgeBoundary && faceBox.yMin > frameHeight * edgeBoundary && faceBox.xMax < frameWidth * (1 - edgeBoundary) && faceBox.yMax < frameHeight * (1 - edgeBoundary);
|
|
12276
|
-
var
|
|
12277
|
-
countdownStartedAt =
|
|
12278
|
-
setCountdownStartedAt =
|
|
12312
|
+
var _31 = React.useState(),
|
|
12313
|
+
countdownStartedAt = _31[0],
|
|
12314
|
+
setCountdownStartedAt = _31[1];
|
|
12279
12315
|
var photoCanvas = React.useRef(null);
|
|
12280
12316
|
var frameLock = React.useRef(false);
|
|
12281
12317
|
var captureFrame = React.useCallback(function () {
|
|
12282
12318
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
12283
|
-
var frameBase64
|
|
12284
|
-
return __generator(this, function (
|
|
12285
|
-
|
|
12286
|
-
|
|
12287
|
-
|
|
12288
|
-
|
|
12289
|
-
|
|
12290
|
-
|
|
12291
|
-
|
|
12292
|
-
|
|
12293
|
-
|
|
12294
|
-
|
|
12295
|
-
_b.label = 1;
|
|
12296
|
-
case 1:
|
|
12297
|
-
_b.trys.push([1,, 7, 8]);
|
|
12298
|
-
if (!(requestedAction == 'SHOW_ID_FRONT')) return [3 /*break*/, 5];
|
|
12319
|
+
var frameBase64;
|
|
12320
|
+
return __generator(this, function (_a) {
|
|
12321
|
+
if (frameLock.current) return [2 /*return*/];
|
|
12322
|
+
frameLock.current = true;
|
|
12323
|
+
drawToCanvas(photoCanvas.current, videoRef.current);
|
|
12324
|
+
frameBase64 = photoCanvas.current.toDataURL('image/jpeg');
|
|
12325
|
+
if (!frameBase64) {
|
|
12326
|
+
frameLock.current = false;
|
|
12327
|
+
return [2 /*return*/];
|
|
12328
|
+
}
|
|
12329
|
+
try {
|
|
12330
|
+
if (requestedAction == 'SHOW_ID_FRONT') {
|
|
12299
12331
|
if (onIdFrontImageCaptured) {
|
|
12300
12332
|
onIdFrontImageCaptured(frameBase64);
|
|
12301
12333
|
}
|
|
12302
|
-
if (
|
|
12303
|
-
_a = skipShowIdCardBack === true;
|
|
12304
|
-
if (_a) return [3 /*break*/, 3];
|
|
12305
|
-
return [4 /*yield*/, skipShowIdCardBack()];
|
|
12306
|
-
case 2:
|
|
12307
|
-
_a = _b.sent();
|
|
12308
|
-
_b.label = 3;
|
|
12309
|
-
case 3:
|
|
12310
|
-
if (_a) {
|
|
12334
|
+
if (isSinglePage || evaluateShouldSkip(skipShowIdCardBack)) {
|
|
12311
12335
|
return [2 /*return*/, onIdCaptureComplete()];
|
|
12312
12336
|
}
|
|
12313
|
-
_b.label = 4;
|
|
12314
|
-
case 4:
|
|
12315
12337
|
setRequestedAction('FLIP_ID');
|
|
12316
|
-
|
|
12317
|
-
|
|
12318
|
-
|
|
12319
|
-
if (onIdBackImageCaptured) {
|
|
12320
|
-
onIdBackImageCaptured(frameBase64);
|
|
12321
|
-
}
|
|
12322
|
-
onIdCaptureComplete();
|
|
12323
|
-
} else if (requestedAction == 'SHOW_PASSPORT') {
|
|
12324
|
-
if (onIdFrontImageCaptured) {
|
|
12325
|
-
onIdFrontImageCaptured(frameBase64);
|
|
12326
|
-
}
|
|
12327
|
-
onIdCaptureComplete();
|
|
12338
|
+
} else if (requestedAction == 'SHOW_ID_BACK') {
|
|
12339
|
+
if (onIdBackImageCaptured) {
|
|
12340
|
+
onIdBackImageCaptured(frameBase64);
|
|
12328
12341
|
}
|
|
12329
|
-
|
|
12330
|
-
|
|
12331
|
-
|
|
12332
|
-
|
|
12333
|
-
setDetectedObjects([]);
|
|
12334
|
-
setCurrentDetectionScore(0);
|
|
12335
|
-
setCurrentFocusScore(0);
|
|
12336
|
-
setGoodFramesCount(0);
|
|
12337
|
-
setCountdownStartedAt(undefined);
|
|
12338
|
-
resetBestFrame();
|
|
12339
|
-
frameLock.current = false;
|
|
12340
|
-
if (countdownTimeoutRef.current) {
|
|
12341
|
-
clearTimeout(countdownTimeoutRef.current);
|
|
12342
|
+
onIdCaptureComplete();
|
|
12343
|
+
} else if (requestedAction == 'SHOW_PASSPORT') {
|
|
12344
|
+
if (onIdFrontImageCaptured) {
|
|
12345
|
+
onIdFrontImageCaptured(frameBase64);
|
|
12342
12346
|
}
|
|
12343
|
-
|
|
12344
|
-
|
|
12345
|
-
|
|
12347
|
+
onIdCaptureComplete();
|
|
12348
|
+
}
|
|
12349
|
+
} finally {
|
|
12350
|
+
setDetectedObjects([]);
|
|
12351
|
+
setCurrentDetectionScore(0);
|
|
12352
|
+
setCurrentFocusScore(0);
|
|
12353
|
+
setGoodFramesCount(0);
|
|
12354
|
+
setCountdownStartedAt(undefined);
|
|
12355
|
+
setIsSinglePage(false);
|
|
12356
|
+
resetBestFrame();
|
|
12357
|
+
frameLock.current = false;
|
|
12358
|
+
if (countdownTimeoutRef.current) {
|
|
12359
|
+
clearTimeout(countdownTimeoutRef.current);
|
|
12360
|
+
}
|
|
12346
12361
|
}
|
|
12362
|
+
return [2 /*return*/];
|
|
12347
12363
|
});
|
|
12348
12364
|
});
|
|
12349
|
-
}, [
|
|
12365
|
+
}, [videoRef, requestedAction, onIdFrontImageCaptured, isSinglePage, skipShowIdCardBack, onIdCaptureComplete, onIdBackImageCaptured, resetBestFrame]);
|
|
12350
12366
|
var isFlipping = requestedAction === 'FLIP_ID';
|
|
12351
12367
|
React.useEffect(function () {
|
|
12352
12368
|
if (!isFlipping) return;
|
|
@@ -12405,9 +12421,9 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
12405
12421
|
stopSelfieGuidance();
|
|
12406
12422
|
};
|
|
12407
12423
|
}, [startSelfieGuidance, stopSelfieGuidance]);
|
|
12408
|
-
var
|
|
12409
|
-
numFramesWithoutFaces =
|
|
12410
|
-
setNumFramesWithoutFaces =
|
|
12424
|
+
var _32 = React.useState(0),
|
|
12425
|
+
numFramesWithoutFaces = _32[0],
|
|
12426
|
+
setNumFramesWithoutFaces = _32[1];
|
|
12411
12427
|
onSelfiePredictionMade(useDebounce.useThrottledCallback(React.useCallback(function (_a) {
|
|
12412
12428
|
var face = _a.face;
|
|
12413
12429
|
if (selfieModelError) return;
|
|
@@ -12423,12 +12439,12 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
12423
12439
|
}
|
|
12424
12440
|
}, [disableFaceDetectionWhileAudioCapture, disableFaceDetectionWhileAudioCaptureMsDelay, numFramesWithoutFaces, onFaceNotDetected, timeoutStartedAt]);
|
|
12425
12441
|
var theme = styled.useTheme();
|
|
12426
|
-
var
|
|
12442
|
+
var _33 = useTranslations(rawVerbiage, {
|
|
12427
12443
|
faceNotCenteredText: 'Please move your face to the center...',
|
|
12428
12444
|
captureBtnText: 'Capture'
|
|
12429
12445
|
}),
|
|
12430
|
-
captureBtnText =
|
|
12431
|
-
faceNotCenteredText =
|
|
12446
|
+
captureBtnText = _33.captureBtnText,
|
|
12447
|
+
faceNotCenteredText = _33.faceNotCenteredText;
|
|
12432
12448
|
var debugScalingDetails = useDebugScalingDetails({
|
|
12433
12449
|
enabled: debugMode,
|
|
12434
12450
|
pageWidth: width,
|
|
@@ -12503,6 +12519,11 @@ var CountdownContainer = styled__default.default.div(templateObject_1$5 || (temp
|
|
|
12503
12519
|
var Countdown = styled__default.default.div(templateObject_2$5 || (templateObject_2$5 = __makeTemplateObject(["\n color: white;\n font-size: 64px;\n font-weight: bold;\n margin: auto;\n"], ["\n color: white;\n font-size: 64px;\n font-weight: bold;\n margin: auto;\n"])));
|
|
12504
12520
|
var CaptureButtonContainer = styled__default.default.div(templateObject_3$5 || (templateObject_3$5 = __makeTemplateObject(["\n position: fixed;\n bottom: 0;\n width: 100dvw;\n display: flex;\n z-index: 100000;\n"], ["\n position: fixed;\n bottom: 0;\n width: 100dvw;\n display: flex;\n z-index: 100000;\n"])));
|
|
12505
12521
|
var CaptureButton = styled__default.default(LoaderButton)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n margin: 0 auto 25px;\n"], ["\n margin: 0 auto 25px;\n"])));
|
|
12522
|
+
function evaluateShouldSkip(value) {
|
|
12523
|
+
if (value === true) return true;
|
|
12524
|
+
if (typeof value === 'function') return value();
|
|
12525
|
+
return false;
|
|
12526
|
+
}
|
|
12506
12527
|
var templateObject_1$5, templateObject_2$5, templateObject_3$5, templateObject_4;
|
|
12507
12528
|
|
|
12508
12529
|
var IdVideoCaptureSuccess = function IdVideoCaptureSuccess(_a) {
|
|
@@ -12800,7 +12821,8 @@ var VideoIdWizard = function VideoIdWizard(_a) {
|
|
|
12800
12821
|
documentDetectionModelUrl: (_g = (_f = idCaptureProps.assets) === null || _f === void 0 ? void 0 : _f.documentDetectionModelUrl) !== null && _g !== void 0 ? _g : '',
|
|
12801
12822
|
focusModelUrl: (_j = (_h = idCaptureProps.assets) === null || _h === void 0 ? void 0 : _h.focusModelUrl) !== null && _j !== void 0 ? _j : '',
|
|
12802
12823
|
onModelError: onIdCaptureModelError,
|
|
12803
|
-
modelLoadTimeoutMs: idCaptureModelLoadTimeoutMs
|
|
12824
|
+
modelLoadTimeoutMs: idCaptureModelLoadTimeoutMs,
|
|
12825
|
+
allowSinglePageIdCapture: idCaptureProps.allowSinglePageIdCapture
|
|
12804
12826
|
}, /*#__PURE__*/React__namespace.default.createElement(SelfieGuidanceModelsProvider, {
|
|
12805
12827
|
autoStart: false,
|
|
12806
12828
|
onModelError: faceLivenessProps === null || faceLivenessProps === void 0 ? void 0 : faceLivenessProps.onModelError,
|
|
@@ -13050,7 +13072,8 @@ function CompositeWizard(_a) {
|
|
|
13050
13072
|
documentDetectionModelUrl: (_d = (_c = idCaptureProps.assets) === null || _c === void 0 ? void 0 : _c.documentDetectionModelUrl) !== null && _d !== void 0 ? _d : '',
|
|
13051
13073
|
focusModelUrl: (_f = (_e = idCaptureProps.assets) === null || _e === void 0 ? void 0 : _e.focusModelUrl) !== null && _f !== void 0 ? _f : '',
|
|
13052
13074
|
onModelError: idCaptureProps.onModelError,
|
|
13053
|
-
modelLoadTimeoutMs: idCaptureProps.modelLoadTimeoutMs
|
|
13075
|
+
modelLoadTimeoutMs: idCaptureProps.modelLoadTimeoutMs,
|
|
13076
|
+
allowSinglePageIdCapture: idCaptureProps.allowSinglePageIdCapture
|
|
13054
13077
|
}, /*#__PURE__*/React__namespace.default.createElement(IdCaptureStateProvider, null, /*#__PURE__*/React__namespace.default.createElement(GuideOrientationContextProvider, null, /*#__PURE__*/React__namespace.default.createElement(IdCaptureWizard, _assign({}, idCaptureProps, {
|
|
13055
13078
|
onSuccess: onIdCaptureSuccess
|
|
13056
13079
|
}))))));
|
|
@@ -13372,31 +13395,33 @@ var IdValidation = function IdValidation(_a) {
|
|
|
13372
13395
|
onLoadingOverlayDismissed = _a.onLoadingOverlayDismissed,
|
|
13373
13396
|
_d = _a.idCaptureRequirement,
|
|
13374
13397
|
idCaptureRequirement = _d === void 0 ? 'idCardOrPassport' : _d,
|
|
13375
|
-
_e = _a.
|
|
13376
|
-
|
|
13377
|
-
_f = _a.
|
|
13378
|
-
|
|
13379
|
-
_g = _a.
|
|
13380
|
-
|
|
13398
|
+
_e = _a.allowSinglePageIdCapture,
|
|
13399
|
+
allowSinglePageIdCapture = _e === void 0 ? false : _e,
|
|
13400
|
+
_f = _a.separateIdCardCaptureSequence,
|
|
13401
|
+
separateIdCardCaptureSequence = _f === void 0 ? false : _f,
|
|
13402
|
+
_g = _a.idCaptureThresholds,
|
|
13403
|
+
idCaptureThresholds = _g === void 0 ? defaultIdCaptureThresholds : _g,
|
|
13404
|
+
_h = _a.skipSuccessScreen,
|
|
13405
|
+
skipSuccessScreen = _h === void 0 ? false : _h,
|
|
13381
13406
|
instructions = _a.instructions,
|
|
13382
|
-
|
|
13383
|
-
guideType =
|
|
13384
|
-
|
|
13385
|
-
guideImages =
|
|
13386
|
-
|
|
13387
|
-
portraitGuidesOnMobile =
|
|
13388
|
-
|
|
13389
|
-
rotateLoadingOverlayImageWhenPortrait =
|
|
13390
|
-
|
|
13391
|
-
modelLoadTimeoutMs =
|
|
13392
|
-
|
|
13393
|
-
forceFallbackMode =
|
|
13394
|
-
|
|
13395
|
-
allowIdCardBackToFrontCapture =
|
|
13396
|
-
|
|
13397
|
-
enableOverrideWrongDocumentTypeDialog =
|
|
13398
|
-
|
|
13399
|
-
allowOverrideWrongDocumentTypeAfterMs =
|
|
13407
|
+
_j = _a.guideType,
|
|
13408
|
+
guideType = _j === void 0 ? 'fit' : _j,
|
|
13409
|
+
_k = _a.guideImages,
|
|
13410
|
+
guideImages = _k === void 0 ? defaultIdCaptureGuideImages : _k,
|
|
13411
|
+
_l = _a.portraitGuidesOnMobile,
|
|
13412
|
+
portraitGuidesOnMobile = _l === void 0 ? true : _l,
|
|
13413
|
+
_m = _a.rotateLoadingOverlayImageWhenPortrait,
|
|
13414
|
+
rotateLoadingOverlayImageWhenPortrait = _m === void 0 ? true : _m,
|
|
13415
|
+
_o = _a.modelLoadTimeoutMs,
|
|
13416
|
+
modelLoadTimeoutMs = _o === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _o,
|
|
13417
|
+
_p = _a.forceFallbackMode,
|
|
13418
|
+
forceFallbackMode = _p === void 0 ? false : _p,
|
|
13419
|
+
_q = _a.allowIdCardBackToFrontCapture,
|
|
13420
|
+
allowIdCardBackToFrontCapture = _q === void 0 ? false : _q,
|
|
13421
|
+
_r = _a.enableOverrideWrongDocumentTypeDialog,
|
|
13422
|
+
enableOverrideWrongDocumentTypeDialog = _r === void 0 ? false : _r,
|
|
13423
|
+
_s = _a.allowOverrideWrongDocumentTypeAfterMs,
|
|
13424
|
+
allowOverrideWrongDocumentTypeAfterMs = _s === void 0 ? 8000 : _s,
|
|
13400
13425
|
onBeforeSubmit = _a.onBeforeSubmit,
|
|
13401
13426
|
onBeforeDocumentUpload = _a.onBeforeDocumentUpload,
|
|
13402
13427
|
onDocumentUploadProgress = _a.onDocumentUploadProgress,
|
|
@@ -13410,28 +13435,28 @@ var IdValidation = function IdValidation(_a) {
|
|
|
13410
13435
|
onUserCancel = _a.onUserCancel,
|
|
13411
13436
|
onModelError = _a.onModelError,
|
|
13412
13437
|
onCameraAccessDenied = _a.onCameraAccessDenied,
|
|
13413
|
-
|
|
13414
|
-
theme =
|
|
13415
|
-
|
|
13416
|
-
assets =
|
|
13417
|
-
|
|
13418
|
-
classNames =
|
|
13419
|
-
|
|
13420
|
-
colors =
|
|
13421
|
-
|
|
13422
|
-
verbiage =
|
|
13423
|
-
|
|
13424
|
-
captureSignature =
|
|
13425
|
-
|
|
13426
|
-
captureSignatureVideo =
|
|
13427
|
-
|
|
13428
|
-
captureAdditionalDocuments =
|
|
13429
|
-
|
|
13430
|
-
geolocationEnabled =
|
|
13431
|
-
|
|
13432
|
-
geolocationRequired =
|
|
13433
|
-
|
|
13434
|
-
debugMode =
|
|
13438
|
+
_t = _a.theme,
|
|
13439
|
+
theme = _t === void 0 ? 'default' : _t,
|
|
13440
|
+
_u = _a.assets,
|
|
13441
|
+
assets = _u === void 0 ? {} : _u,
|
|
13442
|
+
_v = _a.classNames,
|
|
13443
|
+
classNames = _v === void 0 ? {} : _v,
|
|
13444
|
+
_w = _a.colors,
|
|
13445
|
+
colors = _w === void 0 ? {} : _w,
|
|
13446
|
+
_x = _a.verbiage,
|
|
13447
|
+
verbiage = _x === void 0 ? {} : _x,
|
|
13448
|
+
_y = _a.captureSignature,
|
|
13449
|
+
captureSignature = _y === void 0 ? false : _y,
|
|
13450
|
+
_z = _a.captureSignatureVideo,
|
|
13451
|
+
captureSignatureVideo = _z === void 0 ? false : _z,
|
|
13452
|
+
_0 = _a.captureAdditionalDocuments,
|
|
13453
|
+
captureAdditionalDocuments = _0 === void 0 ? [] : _0,
|
|
13454
|
+
_1 = _a.geolocationEnabled,
|
|
13455
|
+
geolocationEnabled = _1 === void 0 ? true : _1,
|
|
13456
|
+
_2 = _a.geolocationRequired,
|
|
13457
|
+
geolocationRequired = _2 === void 0 ? false : _2,
|
|
13458
|
+
_3 = _a.debugMode,
|
|
13459
|
+
debugMode = _3 === void 0 ? false : _3;
|
|
13435
13460
|
useLanguage(lang);
|
|
13436
13461
|
useDebugLogging(debugMode);
|
|
13437
13462
|
var idCaptureProps = React.useMemo(function () {
|
|
@@ -13441,6 +13466,7 @@ var IdValidation = function IdValidation(_a) {
|
|
|
13441
13466
|
onModelError: onModelError,
|
|
13442
13467
|
precapturedDocuments: precapturedDocuments,
|
|
13443
13468
|
captureRequirement: idCaptureRequirement,
|
|
13469
|
+
allowSinglePageIdCapture: allowSinglePageIdCapture,
|
|
13444
13470
|
separateIdCardCaptureSequence: separateIdCardCaptureSequence,
|
|
13445
13471
|
thresholds: idCaptureThresholds,
|
|
13446
13472
|
skipSuccessScreen: skipSuccessScreen,
|
|
@@ -13463,7 +13489,7 @@ var IdValidation = function IdValidation(_a) {
|
|
|
13463
13489
|
verbiage: verbiage,
|
|
13464
13490
|
debugMode: debugMode
|
|
13465
13491
|
};
|
|
13466
|
-
}, [onExitCapture, onUserCancel, onModelError, precapturedDocuments, idCaptureRequirement, separateIdCardCaptureSequence, idCaptureThresholds, skipSuccessScreen, loadingOverlayMode, customOverlayContent, onLoadingOverlayDismissed, forceFallbackMode, allowIdCardBackToFrontCapture, instructions, guideType, guideImages, portraitGuidesOnMobile, rotateLoadingOverlayImageWhenPortrait, modelLoadTimeoutMs, enableOverrideWrongDocumentTypeDialog, allowOverrideWrongDocumentTypeAfterMs, assets, classNames, colors, verbiage, debugMode]);
|
|
13492
|
+
}, [onExitCapture, onUserCancel, onModelError, precapturedDocuments, idCaptureRequirement, allowSinglePageIdCapture, separateIdCardCaptureSequence, idCaptureThresholds, skipSuccessScreen, loadingOverlayMode, customOverlayContent, onLoadingOverlayDismissed, forceFallbackMode, allowIdCardBackToFrontCapture, instructions, guideType, guideImages, portraitGuidesOnMobile, rotateLoadingOverlayImageWhenPortrait, modelLoadTimeoutMs, enableOverrideWrongDocumentTypeDialog, allowOverrideWrongDocumentTypeAfterMs, assets, classNames, colors, verbiage, debugMode]);
|
|
13467
13493
|
var additionalDocumentCaptureProps = React.useMemo(function () {
|
|
13468
13494
|
return {
|
|
13469
13495
|
documents: captureAdditionalDocuments,
|
|
@@ -13688,35 +13714,37 @@ var IdAndFaceValidation = function IdAndFaceValidation(_a) {
|
|
|
13688
13714
|
idCaptureLoadingOverlayMode = _c === void 0 ? 'default' : _c,
|
|
13689
13715
|
_d = _a.idCaptureRequirement,
|
|
13690
13716
|
idCaptureRequirement = _d === void 0 ? 'idCardOrPassport' : _d,
|
|
13691
|
-
_e = _a.
|
|
13692
|
-
|
|
13693
|
-
_f = _a.
|
|
13694
|
-
|
|
13695
|
-
_g = _a.
|
|
13696
|
-
|
|
13697
|
-
_h = _a.
|
|
13698
|
-
|
|
13717
|
+
_e = _a.allowSinglePageIdCapture,
|
|
13718
|
+
allowSinglePageIdCapture = _e === void 0 ? false : _e,
|
|
13719
|
+
_f = _a.idCaptureThresholds,
|
|
13720
|
+
idCaptureThresholds = _f === void 0 ? defaultIdCaptureThresholds : _f,
|
|
13721
|
+
_g = _a.faceLivenessLoadingOverlayMode,
|
|
13722
|
+
faceLivenessLoadingOverlayMode = _g === void 0 ? 'default' : _g,
|
|
13723
|
+
_h = _a.faceLivenessTimeoutDurationMs,
|
|
13724
|
+
faceLivenessTimeoutDurationMs = _h === void 0 ? 15000 : _h,
|
|
13725
|
+
_j = _a.skipSuccessScreen,
|
|
13726
|
+
skipSuccessScreen = _j === void 0 ? false : _j,
|
|
13699
13727
|
idCaptureInstructions = _a.idCaptureInstructions,
|
|
13700
|
-
|
|
13701
|
-
idCaptureGuideType =
|
|
13702
|
-
|
|
13703
|
-
idCaptureGuideImages =
|
|
13704
|
-
|
|
13705
|
-
idCapturePortraitGuidesOnMobile =
|
|
13706
|
-
|
|
13707
|
-
idCaptureRotateLoadingOverlayImageWhenPortrait =
|
|
13708
|
-
|
|
13709
|
-
idCaptureModelLoadTimeoutMs =
|
|
13710
|
-
|
|
13711
|
-
idCaptureForceFallbackMode =
|
|
13712
|
-
|
|
13713
|
-
selfieCaptureModelLoadTimeoutMs =
|
|
13714
|
-
|
|
13715
|
-
allowIdCardBackToFrontCapture =
|
|
13716
|
-
|
|
13717
|
-
enableOverrideWrongDocumentTypeDialog =
|
|
13718
|
-
|
|
13719
|
-
allowOverrideWrongDocumentTypeAfterMs =
|
|
13728
|
+
_k = _a.idCaptureGuideType,
|
|
13729
|
+
idCaptureGuideType = _k === void 0 ? 'fit' : _k,
|
|
13730
|
+
_l = _a.idCaptureGuideImages,
|
|
13731
|
+
idCaptureGuideImages = _l === void 0 ? defaultIdCaptureGuideImages : _l,
|
|
13732
|
+
_m = _a.idCapturePortraitGuidesOnMobile,
|
|
13733
|
+
idCapturePortraitGuidesOnMobile = _m === void 0 ? true : _m,
|
|
13734
|
+
_o = _a.idCaptureRotateLoadingOverlayImageWhenPortrait,
|
|
13735
|
+
idCaptureRotateLoadingOverlayImageWhenPortrait = _o === void 0 ? true : _o,
|
|
13736
|
+
_p = _a.idCaptureModelLoadTimeoutMs,
|
|
13737
|
+
idCaptureModelLoadTimeoutMs = _p === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _p,
|
|
13738
|
+
_q = _a.idCaptureForceFallbackMode,
|
|
13739
|
+
idCaptureForceFallbackMode = _q === void 0 ? false : _q,
|
|
13740
|
+
_r = _a.selfieCaptureModelLoadTimeoutMs,
|
|
13741
|
+
selfieCaptureModelLoadTimeoutMs = _r === void 0 ? defaultSelfieCaptureModelLoadTimeoutMs : _r,
|
|
13742
|
+
_s = _a.allowIdCardBackToFrontCapture,
|
|
13743
|
+
allowIdCardBackToFrontCapture = _s === void 0 ? false : _s,
|
|
13744
|
+
_t = _a.enableOverrideWrongDocumentTypeDialog,
|
|
13745
|
+
enableOverrideWrongDocumentTypeDialog = _t === void 0 ? false : _t,
|
|
13746
|
+
_u = _a.allowOverrideWrongDocumentTypeAfterMs,
|
|
13747
|
+
allowOverrideWrongDocumentTypeAfterMs = _u === void 0 ? 8000 : _u,
|
|
13720
13748
|
onBeforeDocumentUpload = _a.onBeforeDocumentUpload,
|
|
13721
13749
|
onDocumentUploaded = _a.onDocumentUploaded,
|
|
13722
13750
|
onDocumentUploadProgress = _a.onDocumentUploadProgress,
|
|
@@ -13733,28 +13761,28 @@ var IdAndFaceValidation = function IdAndFaceValidation(_a) {
|
|
|
13733
13761
|
onIdCaptureModelError = _a.onIdCaptureModelError,
|
|
13734
13762
|
onSelfieCaptureModelError = _a.onSelfieCaptureModelError,
|
|
13735
13763
|
onCameraAccessDenied = _a.onCameraAccessDenied,
|
|
13736
|
-
|
|
13737
|
-
captureSignature =
|
|
13738
|
-
|
|
13739
|
-
captureSignatureVideo =
|
|
13740
|
-
|
|
13741
|
-
captureAdditionalDocuments =
|
|
13742
|
-
|
|
13743
|
-
theme =
|
|
13744
|
-
|
|
13745
|
-
assets =
|
|
13746
|
-
|
|
13747
|
-
classNames =
|
|
13748
|
-
|
|
13749
|
-
colors =
|
|
13750
|
-
|
|
13751
|
-
verbiage =
|
|
13752
|
-
|
|
13753
|
-
geolocationEnabled =
|
|
13754
|
-
|
|
13755
|
-
geolocationRequired =
|
|
13756
|
-
|
|
13757
|
-
debugMode =
|
|
13764
|
+
_v = _a.captureSignature,
|
|
13765
|
+
captureSignature = _v === void 0 ? false : _v,
|
|
13766
|
+
_w = _a.captureSignatureVideo,
|
|
13767
|
+
captureSignatureVideo = _w === void 0 ? false : _w,
|
|
13768
|
+
_x = _a.captureAdditionalDocuments,
|
|
13769
|
+
captureAdditionalDocuments = _x === void 0 ? [] : _x,
|
|
13770
|
+
_y = _a.theme,
|
|
13771
|
+
theme = _y === void 0 ? 'default' : _y,
|
|
13772
|
+
_z = _a.assets,
|
|
13773
|
+
assets = _z === void 0 ? {} : _z,
|
|
13774
|
+
_0 = _a.classNames,
|
|
13775
|
+
classNames = _0 === void 0 ? {} : _0,
|
|
13776
|
+
_1 = _a.colors,
|
|
13777
|
+
colors = _1 === void 0 ? {} : _1,
|
|
13778
|
+
_2 = _a.verbiage,
|
|
13779
|
+
verbiage = _2 === void 0 ? {} : _2,
|
|
13780
|
+
_3 = _a.geolocationEnabled,
|
|
13781
|
+
geolocationEnabled = _3 === void 0 ? true : _3,
|
|
13782
|
+
_4 = _a.geolocationRequired,
|
|
13783
|
+
geolocationRequired = _4 === void 0 ? false : _4,
|
|
13784
|
+
_5 = _a.debugMode,
|
|
13785
|
+
debugMode = _5 === void 0 ? false : _5;
|
|
13758
13786
|
useLanguage(lang);
|
|
13759
13787
|
useDebugLogging(debugMode);
|
|
13760
13788
|
var idCaptureProps = React.useMemo(function () {
|
|
@@ -13768,6 +13796,7 @@ var IdAndFaceValidation = function IdAndFaceValidation(_a) {
|
|
|
13768
13796
|
verbiage: verbiage.idCapture,
|
|
13769
13797
|
precapturedDocuments: precapturedDocuments,
|
|
13770
13798
|
captureRequirement: idCaptureRequirement,
|
|
13799
|
+
allowSinglePageIdCapture: allowSinglePageIdCapture,
|
|
13771
13800
|
thresholds: idCaptureThresholds,
|
|
13772
13801
|
loadingOverlayMode: idCaptureLoadingOverlayMode,
|
|
13773
13802
|
instructions: idCaptureInstructions,
|
|
@@ -13783,7 +13812,7 @@ var IdAndFaceValidation = function IdAndFaceValidation(_a) {
|
|
|
13783
13812
|
skipSuccessScreen: skipSuccessScreen,
|
|
13784
13813
|
debugMode: debugMode
|
|
13785
13814
|
};
|
|
13786
|
-
}, [onExitCapture, onUserCancel, onIdCaptureModelError, assets.idCapture, classNames.idCapture, colors.idCapture, verbiage.idCapture, precapturedDocuments, idCaptureRequirement, idCaptureThresholds, idCaptureLoadingOverlayMode, idCaptureInstructions, idCaptureGuideType, idCaptureGuideImages, idCapturePortraitGuidesOnMobile, idCaptureRotateLoadingOverlayImageWhenPortrait, idCaptureModelLoadTimeoutMs, allowIdCardBackToFrontCapture, enableOverrideWrongDocumentTypeDialog, allowOverrideWrongDocumentTypeAfterMs, idCaptureForceFallbackMode, skipSuccessScreen, debugMode]);
|
|
13815
|
+
}, [onExitCapture, onUserCancel, onIdCaptureModelError, assets.idCapture, classNames.idCapture, colors.idCapture, verbiage.idCapture, precapturedDocuments, idCaptureRequirement, allowSinglePageIdCapture, idCaptureThresholds, idCaptureLoadingOverlayMode, idCaptureInstructions, idCaptureGuideType, idCaptureGuideImages, idCapturePortraitGuidesOnMobile, idCaptureRotateLoadingOverlayImageWhenPortrait, idCaptureModelLoadTimeoutMs, allowIdCardBackToFrontCapture, enableOverrideWrongDocumentTypeDialog, allowOverrideWrongDocumentTypeAfterMs, idCaptureForceFallbackMode, skipSuccessScreen, debugMode]);
|
|
13787
13816
|
var faceLivenessProps = React.useMemo(function () {
|
|
13788
13817
|
return {
|
|
13789
13818
|
loadingOverlayMode: faceLivenessLoadingOverlayMode,
|
|
@@ -13925,35 +13954,37 @@ var CustomerIdAndBiometricsEnrollment = function CustomerIdAndBiometricsEnrollme
|
|
|
13925
13954
|
idCaptureLoadingOverlayMode = _c === void 0 ? 'default' : _c,
|
|
13926
13955
|
_d = _a.idCaptureRequirement,
|
|
13927
13956
|
idCaptureRequirement = _d === void 0 ? 'idCardOrPassport' : _d,
|
|
13928
|
-
_e = _a.
|
|
13929
|
-
|
|
13930
|
-
_f = _a.
|
|
13931
|
-
|
|
13932
|
-
_g = _a.
|
|
13933
|
-
|
|
13934
|
-
_h = _a.
|
|
13935
|
-
|
|
13957
|
+
_e = _a.allowSinglePageIdCapture,
|
|
13958
|
+
allowSinglePageIdCapture = _e === void 0 ? false : _e,
|
|
13959
|
+
_f = _a.idCaptureThresholds,
|
|
13960
|
+
idCaptureThresholds = _f === void 0 ? defaultIdCaptureThresholds : _f,
|
|
13961
|
+
_g = _a.faceLivenessTimeoutDurationMs,
|
|
13962
|
+
faceLivenessTimeoutDurationMs = _g === void 0 ? 15000 : _g,
|
|
13963
|
+
_h = _a.faceLivenessLoadingOverlayMode,
|
|
13964
|
+
faceLivenessLoadingOverlayMode = _h === void 0 ? 'default' : _h,
|
|
13965
|
+
_j = _a.skipSuccessScreen,
|
|
13966
|
+
skipSuccessScreen = _j === void 0 ? false : _j,
|
|
13936
13967
|
idCaptureInstructions = _a.idCaptureInstructions,
|
|
13937
|
-
|
|
13938
|
-
idCaptureGuideType =
|
|
13939
|
-
|
|
13940
|
-
idCaptureGuideImages =
|
|
13941
|
-
|
|
13942
|
-
idCapturePortraitGuidesOnMobile =
|
|
13943
|
-
|
|
13944
|
-
idCaptureRotateLoadingOverlayImageWhenPortrait =
|
|
13945
|
-
|
|
13946
|
-
idCaptureModelLoadTimeoutMs =
|
|
13947
|
-
|
|
13948
|
-
idCaptureForceFallbackMode =
|
|
13949
|
-
|
|
13950
|
-
selfieCaptureModelLoadTimeoutMs =
|
|
13951
|
-
|
|
13952
|
-
allowIdCardBackToFrontCapture =
|
|
13953
|
-
|
|
13954
|
-
enableOverrideWrongDocumentTypeDialog =
|
|
13955
|
-
|
|
13956
|
-
allowOverrideWrongDocumentTypeAfterMs =
|
|
13968
|
+
_k = _a.idCaptureGuideType,
|
|
13969
|
+
idCaptureGuideType = _k === void 0 ? 'fit' : _k,
|
|
13970
|
+
_l = _a.idCaptureGuideImages,
|
|
13971
|
+
idCaptureGuideImages = _l === void 0 ? defaultIdCaptureGuideImages : _l,
|
|
13972
|
+
_m = _a.idCapturePortraitGuidesOnMobile,
|
|
13973
|
+
idCapturePortraitGuidesOnMobile = _m === void 0 ? true : _m,
|
|
13974
|
+
_o = _a.idCaptureRotateLoadingOverlayImageWhenPortrait,
|
|
13975
|
+
idCaptureRotateLoadingOverlayImageWhenPortrait = _o === void 0 ? true : _o,
|
|
13976
|
+
_p = _a.idCaptureModelLoadTimeoutMs,
|
|
13977
|
+
idCaptureModelLoadTimeoutMs = _p === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _p,
|
|
13978
|
+
_q = _a.idCaptureForceFallbackMode,
|
|
13979
|
+
idCaptureForceFallbackMode = _q === void 0 ? false : _q,
|
|
13980
|
+
_r = _a.selfieCaptureModelLoadTimeoutMs,
|
|
13981
|
+
selfieCaptureModelLoadTimeoutMs = _r === void 0 ? defaultSelfieCaptureModelLoadTimeoutMs : _r,
|
|
13982
|
+
_s = _a.allowIdCardBackToFrontCapture,
|
|
13983
|
+
allowIdCardBackToFrontCapture = _s === void 0 ? false : _s,
|
|
13984
|
+
_t = _a.enableOverrideWrongDocumentTypeDialog,
|
|
13985
|
+
enableOverrideWrongDocumentTypeDialog = _t === void 0 ? false : _t,
|
|
13986
|
+
_u = _a.allowOverrideWrongDocumentTypeAfterMs,
|
|
13987
|
+
allowOverrideWrongDocumentTypeAfterMs = _u === void 0 ? 8000 : _u,
|
|
13957
13988
|
onBeforeDocumentUpload = _a.onBeforeDocumentUpload,
|
|
13958
13989
|
onDocumentUploadProgress = _a.onDocumentUploadProgress,
|
|
13959
13990
|
onDocumentUploaded = _a.onDocumentUploaded,
|
|
@@ -13969,31 +14000,31 @@ var CustomerIdAndBiometricsEnrollment = function CustomerIdAndBiometricsEnrollme
|
|
|
13969
14000
|
onIdCaptureModelError = _a.onIdCaptureModelError,
|
|
13970
14001
|
onSelfieCaptureModelError = _a.onSelfieCaptureModelError,
|
|
13971
14002
|
onCameraAccessDenied = _a.onCameraAccessDenied,
|
|
13972
|
-
|
|
13973
|
-
captureSignature =
|
|
13974
|
-
|
|
13975
|
-
captureSignatureVideo =
|
|
13976
|
-
|
|
13977
|
-
captureAdditionalDocuments =
|
|
13978
|
-
|
|
13979
|
-
captureVideoId =
|
|
14003
|
+
_v = _a.captureSignature,
|
|
14004
|
+
captureSignature = _v === void 0 ? false : _v,
|
|
14005
|
+
_w = _a.captureSignatureVideo,
|
|
14006
|
+
captureSignatureVideo = _w === void 0 ? false : _w,
|
|
14007
|
+
_x = _a.captureAdditionalDocuments,
|
|
14008
|
+
captureAdditionalDocuments = _x === void 0 ? [] : _x,
|
|
14009
|
+
_y = _a.captureVideoId,
|
|
14010
|
+
captureVideoId = _y === void 0 ? false : _y,
|
|
13980
14011
|
captureVideoIdProps = _a.captureVideoIdProps,
|
|
13981
|
-
|
|
13982
|
-
theme =
|
|
13983
|
-
|
|
13984
|
-
assets =
|
|
13985
|
-
|
|
13986
|
-
classNames =
|
|
13987
|
-
|
|
13988
|
-
colors =
|
|
13989
|
-
|
|
13990
|
-
verbiage =
|
|
13991
|
-
|
|
13992
|
-
geolocationEnabled =
|
|
13993
|
-
|
|
13994
|
-
geolocationRequired =
|
|
13995
|
-
|
|
13996
|
-
debugMode =
|
|
14012
|
+
_z = _a.theme,
|
|
14013
|
+
theme = _z === void 0 ? 'default' : _z,
|
|
14014
|
+
_0 = _a.assets,
|
|
14015
|
+
assets = _0 === void 0 ? {} : _0,
|
|
14016
|
+
_1 = _a.classNames,
|
|
14017
|
+
classNames = _1 === void 0 ? {} : _1,
|
|
14018
|
+
_2 = _a.colors,
|
|
14019
|
+
colors = _2 === void 0 ? {} : _2,
|
|
14020
|
+
_3 = _a.verbiage,
|
|
14021
|
+
verbiage = _3 === void 0 ? {} : _3,
|
|
14022
|
+
_4 = _a.geolocationEnabled,
|
|
14023
|
+
geolocationEnabled = _4 === void 0 ? true : _4,
|
|
14024
|
+
_5 = _a.geolocationRequired,
|
|
14025
|
+
geolocationRequired = _5 === void 0 ? false : _5,
|
|
14026
|
+
_6 = _a.debugMode,
|
|
14027
|
+
debugMode = _6 === void 0 ? false : _6;
|
|
13997
14028
|
useLanguage(lang);
|
|
13998
14029
|
useDebugLogging(debugMode);
|
|
13999
14030
|
var idCaptureProps = React.useMemo(function () {
|
|
@@ -14003,6 +14034,7 @@ var CustomerIdAndBiometricsEnrollment = function CustomerIdAndBiometricsEnrollme
|
|
|
14003
14034
|
colors: colors.idCapture,
|
|
14004
14035
|
verbiage: verbiage.idCapture,
|
|
14005
14036
|
captureRequirement: idCaptureRequirement,
|
|
14037
|
+
allowSinglePageIdCapture: allowSinglePageIdCapture,
|
|
14006
14038
|
thresholds: idCaptureThresholds,
|
|
14007
14039
|
loadingOverlayMode: idCaptureLoadingOverlayMode,
|
|
14008
14040
|
instructions: idCaptureInstructions,
|
|
@@ -14021,7 +14053,7 @@ var CustomerIdAndBiometricsEnrollment = function CustomerIdAndBiometricsEnrollme
|
|
|
14021
14053
|
skipSuccessScreen: skipSuccessScreen,
|
|
14022
14054
|
debugMode: debugMode
|
|
14023
14055
|
};
|
|
14024
|
-
}, [assets.idCapture, classNames.idCapture, colors.idCapture, verbiage.idCapture, idCaptureRequirement, idCaptureThresholds, idCaptureLoadingOverlayMode, idCaptureInstructions, idCaptureGuideType, idCaptureGuideImages, idCapturePortraitGuidesOnMobile, idCaptureRotateLoadingOverlayImageWhenPortrait, idCaptureModelLoadTimeoutMs, allowIdCardBackToFrontCapture, idCaptureForceFallbackMode, enableOverrideWrongDocumentTypeDialog, allowOverrideWrongDocumentTypeAfterMs, onExitCapture, onUserCancel, onIdCaptureModelError, skipSuccessScreen, debugMode]);
|
|
14056
|
+
}, [assets.idCapture, classNames.idCapture, colors.idCapture, verbiage.idCapture, idCaptureRequirement, allowSinglePageIdCapture, idCaptureThresholds, idCaptureLoadingOverlayMode, idCaptureInstructions, idCaptureGuideType, idCaptureGuideImages, idCapturePortraitGuidesOnMobile, idCaptureRotateLoadingOverlayImageWhenPortrait, idCaptureModelLoadTimeoutMs, allowIdCardBackToFrontCapture, idCaptureForceFallbackMode, enableOverrideWrongDocumentTypeDialog, allowOverrideWrongDocumentTypeAfterMs, onExitCapture, onUserCancel, onIdCaptureModelError, skipSuccessScreen, debugMode]);
|
|
14025
14057
|
var faceLivenessProps = React.useMemo(function () {
|
|
14026
14058
|
return {
|
|
14027
14059
|
onExitCapture: onExitCapture,
|