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.
Files changed (42) hide show
  1. package/dist/components/CompositeWizard.d.ts.map +1 -1
  2. package/dist/components/customer_flows/CustomerIdAndBiometricsEnrollment.d.ts +2 -0
  3. package/dist/components/customer_flows/CustomerIdAndBiometricsEnrollment.d.ts.map +1 -1
  4. package/dist/components/customer_flows/IdAndFaceValidation.d.ts +2 -0
  5. package/dist/components/customer_flows/IdAndFaceValidation.d.ts.map +1 -1
  6. package/dist/components/customer_flows/IdValidation.d.ts +3 -1
  7. package/dist/components/customer_flows/IdValidation.d.ts.map +1 -1
  8. package/dist/components/fallback_flows/IdCapture.d.ts.map +1 -1
  9. package/dist/components/id_capture/CapturedDocuments.d.ts +1 -1
  10. package/dist/components/id_capture/CapturedDocuments.d.ts.map +1 -1
  11. package/dist/components/id_capture/IdCapture.d.ts +2 -2
  12. package/dist/components/id_capture/IdCapture.d.ts.map +1 -1
  13. package/dist/components/id_capture/IdCaptureModelsProvider.d.ts +2 -1
  14. package/dist/components/id_capture/IdCaptureModelsProvider.d.ts.map +1 -1
  15. package/dist/components/id_capture/IdCaptureRequirementOption.d.ts +7 -5
  16. package/dist/components/id_capture/IdCaptureRequirementOption.d.ts.map +1 -1
  17. package/dist/components/id_capture/IdCaptureStateProvider.d.ts +4 -0
  18. package/dist/components/id_capture/IdCaptureStateProvider.d.ts.map +1 -1
  19. package/dist/components/id_capture/IdCaptureSuccess.d.ts +0 -4
  20. package/dist/components/id_capture/IdCaptureSuccess.d.ts.map +1 -1
  21. package/dist/components/id_capture/IdCaptureWizard.d.ts +2 -1
  22. package/dist/components/id_capture/IdCaptureWizard.d.ts.map +1 -1
  23. package/dist/components/video_id/IdVideoCapture.d.ts +2 -0
  24. package/dist/components/video_id/IdVideoCapture.d.ts.map +1 -1
  25. package/dist/components/video_id/IdVideoCaptureWizard.d.ts.map +1 -1
  26. package/dist/lib/models/DocumentDetection.d.ts +6 -2
  27. package/dist/lib/models/DocumentDetection.d.ts.map +1 -1
  28. package/dist/lib/models/Focus.d.ts +4 -0
  29. package/dist/lib/models/Focus.d.ts.map +1 -1
  30. package/dist/lib/models/defaults/DocumentDetector.d.ts +1 -1
  31. package/dist/sdk2.cjs.development.js +463 -431
  32. package/dist/sdk2.cjs.development.js.map +1 -1
  33. package/dist/sdk2.cjs.production.js +1 -1
  34. package/dist/sdk2.cjs.production.js.map +1 -1
  35. package/dist/sdk2.esm.js +463 -431
  36. package/dist/sdk2.esm.js.map +1 -1
  37. package/dist/sdk2.umd.development.js +463 -431
  38. package/dist/sdk2.umd.development.js.map +1 -1
  39. package/dist/sdk2.umd.production.js +1 -1
  40. package/dist/sdk2.umd.production.js.map +1 -1
  41. package/dist/version.d.ts +1 -1
  42. package/package.json +3 -3
@@ -211,7 +211,7 @@
211
211
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
212
212
  };
213
213
 
214
- var webSdkVersion = '2.2.74';
214
+ var webSdkVersion = '2.2.76';
215
215
 
216
216
  function getPlatform() {
217
217
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -8339,7 +8339,7 @@
8339
8339
 
8340
8340
  var DEFAULT_CDN_URL = 'https://websdk-cdn-dev.idmission.com/assets';
8341
8341
 
8342
- var defaultDocumentDetectorModelPath = "".concat(DEFAULT_CDN_URL, "/models/DocumentDetector/DocumentDetector-20241018_093000.tflite");
8342
+ var defaultDocumentDetectorModelPath = "".concat(DEFAULT_CDN_URL, "/models/DocumentDetector/DocumentDetector-20250111_090328.tflite");
8343
8343
 
8344
8344
  var defaultFocusModelPath = "".concat(DEFAULT_CDN_URL, "/models/Focus/Focus-20241008_102708.tflite");
8345
8345
 
@@ -8358,6 +8358,10 @@
8358
8358
  passport: {
8359
8359
  desktop: 0,
8360
8360
  mobile: 0.3
8361
+ },
8362
+ singlePage: {
8363
+ desktop: 0,
8364
+ mobile: 0.3
8361
8365
  }
8362
8366
  };
8363
8367
  var classifier = null;
@@ -8983,16 +8987,19 @@
8983
8987
  idCardFront: 0.6,
8984
8988
  idCardBack: 0.6,
8985
8989
  passport: 0.4,
8990
+ singlePage: 0.4,
8986
8991
  stability: {
8987
8992
  idCardFront: 0.85,
8988
8993
  idCardBack: 0.85,
8989
- passport: 0.5
8994
+ passport: 0.5,
8995
+ singlePage: 0.5
8990
8996
  }
8991
8997
  };
8992
8998
  var documentTypeDisplayNames = {
8993
8999
  idCardFront: 'ID card front',
8994
9000
  idCardBack: 'ID card back',
8995
9001
  passport: 'Passport',
9002
+ singlePage: 'Single page',
8996
9003
  none: 'None'
8997
9004
  };
8998
9005
  var detector = null;
@@ -9181,7 +9188,7 @@
9181
9188
  right: 20
9182
9189
  };
9183
9190
  function processDocumentDetectorPrediction(prediction, thresholds, boundaries) {
9184
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
9191
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
9185
9192
  if (boundaries === void 0) {
9186
9193
  boundaries = defaultDocumentDetectionBoundaries;
9187
9194
  }
@@ -9232,18 +9239,25 @@
9232
9239
  var bestPassportPage = detectedObjects.find(function (obj) {
9233
9240
  return obj.label === 'Passport page';
9234
9241
  });
9242
+ var bestSinglePage = detectedObjects.find(function (obj) {
9243
+ return obj.label === 'Single page';
9244
+ });
9235
9245
  var idCardFrontDetectionScore = (_e = bestIdCardFront === null || bestIdCardFront === void 0 ? void 0 : bestIdCardFront.score) !== null && _e !== void 0 ? _e : 0;
9236
9246
  var idCardBackDetectionScore = (_f = bestIdCardBack === null || bestIdCardBack === void 0 ? void 0 : bestIdCardBack.score) !== null && _f !== void 0 ? _f : 0;
9237
9247
  var passportDetectionScore = (_g = bestPassportPage === null || bestPassportPage === void 0 ? void 0 : bestPassportPage.score) !== null && _g !== void 0 ? _g : 0;
9238
- var idCardFrontDetectionThresholdMet = idCardFrontDetectionScore >= ((_h = thresholds.idCardFront) !== null && _h !== void 0 ? _h : 0);
9239
- var idCardBackDetectionThresholdMet = idCardBackDetectionScore >= ((_j = thresholds.idCardBack) !== null && _j !== void 0 ? _j : 0);
9240
- var passportDetectionThresholdMet = passportDetectionScore >= ((_k = thresholds.passport) !== null && _k !== void 0 ? _k : 0);
9241
- var bestDocument = passportDetectionThresholdMet ? bestPassportPage : idCardBackDetectionThresholdMet ? bestIdCardBack : bestIdCardFront;
9242
- var detectionThreshold = passportDetectionThresholdMet ? thresholds.passport : idCardBackDetectionThresholdMet ? thresholds.idCardBack : thresholds.idCardFront;
9243
- var detectionScore = (_l = bestDocument === null || bestDocument === void 0 ? void 0 : bestDocument.score) !== null && _l !== void 0 ? _l : 0;
9248
+ var singlePageDetectionScore = (_h = bestSinglePage === null || bestSinglePage === void 0 ? void 0 : bestSinglePage.score) !== null && _h !== void 0 ? _h : 0;
9249
+ var idCardFrontDetectionThresholdMet = idCardFrontDetectionScore >= ((_j = thresholds.idCardFront) !== null && _j !== void 0 ? _j : 0);
9250
+ var idCardBackDetectionThresholdMet = idCardBackDetectionScore >= ((_k = thresholds.idCardBack) !== null && _k !== void 0 ? _k : 0);
9251
+ var passportDetectionThresholdMet = passportDetectionScore >= ((_l = thresholds.passport) !== null && _l !== void 0 ? _l : 0);
9252
+ var singlePageDetectionThresholdMet = singlePageDetectionScore >= ((_m = thresholds.singlePage) !== null && _m !== void 0 ? _m : 0);
9253
+ var bestDocument = singlePageDetectionThresholdMet ? bestSinglePage : passportDetectionThresholdMet ? bestPassportPage : idCardBackDetectionThresholdMet ? bestIdCardBack : bestIdCardFront;
9254
+ var detectionThreshold = singlePageDetectionThresholdMet ? thresholds.singlePage : passportDetectionThresholdMet ? thresholds.passport : idCardBackDetectionThresholdMet ? thresholds.idCardBack : thresholds.idCardFront;
9255
+ var detectionScore = (_o = bestDocument === null || bestDocument === void 0 ? void 0 : bestDocument.score) !== null && _o !== void 0 ? _o : 0;
9244
9256
  var detectionThresholdMet = detectionScore >= (detectionThreshold !== null && detectionThreshold !== void 0 ? detectionThreshold : 0);
9245
9257
  var detectedDocumentType = 'none';
9246
- if (passportDetectionThresholdMet) {
9258
+ if (singlePageDetectionThresholdMet) {
9259
+ detectedDocumentType = 'singlePage';
9260
+ } else if (passportDetectionThresholdMet) {
9247
9261
  detectedDocumentType = 'passport';
9248
9262
  } else if (idCardBackDetectionThresholdMet) {
9249
9263
  detectedDocumentType = 'idCardBack';
@@ -9257,12 +9271,12 @@
9257
9271
  var documentIsStable = false;
9258
9272
  var documentTooClose = false;
9259
9273
  if (bestDocument) {
9260
- var _o = [bestDocument.box.width / frameWidth, bestDocument.box.height / frameHeight],
9261
- docWidth = _o[0],
9262
- docHeight = _o[1];
9274
+ var _q = [bestDocument.box.width / frameWidth, bestDocument.box.height / frameHeight],
9275
+ docWidth = _q[0],
9276
+ docHeight = _q[1];
9263
9277
  documentTooClose = docWidth > 0.85 || docHeight > 0.85;
9264
9278
  if (detectionThresholdMet && documentInBounds && !documentTooClose) {
9265
- var thresholdSet = (_m = thresholds.stability) !== null && _m !== void 0 ? _m : defaultDocumentDetectionThresholds.stability;
9279
+ var thresholdSet = (_p = thresholds.stability) !== null && _p !== void 0 ? _p : defaultDocumentDetectionThresholds.stability;
9266
9280
  var threshold_1 = thresholdSet[detectedDocumentType];
9267
9281
  var framesNeeded = Math.ceil(average(framesNeededSamples));
9268
9282
  trackBox(bestDocument.box, framesNeeded);
@@ -9284,6 +9298,8 @@
9284
9298
  idCardBackDetectionThresholdMet: idCardBackDetectionThresholdMet,
9285
9299
  passportDetectionScore: passportDetectionScore,
9286
9300
  passportDetectionThresholdMet: passportDetectionThresholdMet,
9301
+ singlePageDetectionScore: singlePageDetectionScore,
9302
+ singlePageDetectionThresholdMet: singlePageDetectionThresholdMet,
9287
9303
  bestDocument: bestDocument,
9288
9304
  documentInBounds: documentInBounds,
9289
9305
  documentTooClose: documentTooClose,
@@ -10230,37 +10246,39 @@
10230
10246
  });
10231
10247
  function IdCaptureModelsProviderInner(_a) {
10232
10248
  var children = _a.children,
10233
- onModelError = _a.onModelError;
10234
- var _b = React.useContext(DocumentDetectionModelContext),
10235
- documentDetectionModelReady = _b.documentDetectionModelReady,
10236
- documentDetectionModelDownloadProgress = _b.documentDetectionModelDownloadProgress,
10237
- startDocumentDetection = _b.startDocumentDetection,
10238
- stopDocumentDetection = _b.stopDocumentDetection,
10239
- lastPredictionCanvas = _b.documentDetectionLastPredictionCanvas,
10240
- clearDocumentDetectionLastPredictionCanvas = _b.clearDocumentDetectionLastPredictionCanvas,
10241
- onDocumentDetected = _b.onDocumentDetected,
10242
- detectionTime = _b.detectionTime,
10243
- documentDetectionThresholds = _b.documentDetectionThresholds,
10244
- setDocumentDetectionThresholds = _b.setDocumentDetectionThresholds,
10245
- documentDetectionBoundaries = _b.documentDetectionBoundaries,
10246
- setDocumentDetectionBoundaries = _b.setDocumentDetectionBoundaries,
10247
- documentDetectionModelError = _b.documentDetectionModelError;
10248
- var _c = React.useContext(FocusModelContext),
10249
- focusModelReady = _c.focusModelReady,
10250
- focusModelDownloadProgress = _c.focusModelDownloadProgress,
10251
- makeFocusPrediction = _c.makeFocusPrediction,
10252
- focusThresholds = _c.focusThresholds,
10253
- setFocusThresholds = _c.setFocusThresholds,
10254
- focusPredictionTime = _c.focusPredictionTime,
10255
- focusModelError = _c.focusModelError;
10249
+ onModelError = _a.onModelError,
10250
+ _b = _a.allowSinglePageIdCapture,
10251
+ allowSinglePageIdCapture = _b === void 0 ? false : _b;
10252
+ var _c = React.useContext(DocumentDetectionModelContext),
10253
+ documentDetectionModelReady = _c.documentDetectionModelReady,
10254
+ documentDetectionModelDownloadProgress = _c.documentDetectionModelDownloadProgress,
10255
+ startDocumentDetection = _c.startDocumentDetection,
10256
+ stopDocumentDetection = _c.stopDocumentDetection,
10257
+ lastPredictionCanvas = _c.documentDetectionLastPredictionCanvas,
10258
+ clearDocumentDetectionLastPredictionCanvas = _c.clearDocumentDetectionLastPredictionCanvas,
10259
+ onDocumentDetected = _c.onDocumentDetected,
10260
+ detectionTime = _c.detectionTime,
10261
+ documentDetectionThresholds = _c.documentDetectionThresholds,
10262
+ setDocumentDetectionThresholds = _c.setDocumentDetectionThresholds,
10263
+ documentDetectionBoundaries = _c.documentDetectionBoundaries,
10264
+ setDocumentDetectionBoundaries = _c.setDocumentDetectionBoundaries,
10265
+ documentDetectionModelError = _c.documentDetectionModelError;
10266
+ var _d = React.useContext(FocusModelContext),
10267
+ focusModelReady = _d.focusModelReady,
10268
+ focusModelDownloadProgress = _d.focusModelDownloadProgress,
10269
+ makeFocusPrediction = _d.makeFocusPrediction,
10270
+ focusThresholds = _d.focusThresholds,
10271
+ setFocusThresholds = _d.setFocusThresholds,
10272
+ focusPredictionTime = _d.focusPredictionTime,
10273
+ focusModelError = _d.focusModelError;
10256
10274
  var onPredictionHandler = React.useRef();
10257
10275
  var bestFrameDetails = React.useRef(null);
10258
10276
  var bestPredictionCanvas = React.useRef(null);
10259
10277
  var bestFocusScore = React.useRef(0);
10260
10278
  var stopDetection = React.useRef(0);
10261
- var _d = React.useState('none'),
10262
- requiredDocumentType = _d[0],
10263
- setRequiredDocumentType = _d[1];
10279
+ var _e = React.useState('none'),
10280
+ requiredDocumentType = _e[0],
10281
+ setRequiredDocumentType = _e[1];
10264
10282
  var thresholds = React.useMemo(function () {
10265
10283
  return _assign(_assign({}, documentDetectionThresholds), {
10266
10284
  focus: focusThresholds
@@ -10278,34 +10296,42 @@
10278
10296
  var _this = this;
10279
10297
  onDocumentDetected(function (prediction) {
10280
10298
  return __awaiter(_this, void 0, void 0, function () {
10281
- var stopDetectionAtStart, focusPredictionTime, focusScore, focusThresholdMet, isRequiredDocumentType, focusPrediction, focusThresholdSet, focusThreshold;
10282
- var _a, _b, _c, _d, _e, _f;
10283
- return __generator(this, function (_g) {
10299
+ var stopDetectionAtStart, focusPredictionTime, focusScore, focusThresholdMet, isSinglePage, isRequiredDocumentType, focusPrediction, focusThresholdSet, focusThreshold;
10300
+ var _a, _b, _c, _d, _e, _f, _g;
10301
+ return __generator(this, function (_h) {
10284
10302
  if (!lastPredictionCanvas.current) return [2 /*return*/];
10285
10303
  stopDetectionAtStart = stopDetection.current;
10286
10304
  focusPredictionTime = 0, focusScore = 0, focusThresholdMet = false;
10287
- isRequiredDocumentType = requiredDocumentType === 'none' || prediction.detectedDocumentType === requiredDocumentType || ((_a = requiredDocumentType.includes) === null || _a === void 0 ? void 0 : _a.call(requiredDocumentType, prediction.detectedDocumentType));
10305
+ isSinglePage = prediction.detectedDocumentType === 'singlePage';
10306
+ if (!allowSinglePageIdCapture && isSinglePage) {
10307
+ prediction.detectedDocumentType = 'passport';
10308
+ prediction.passportDetectionScore = prediction.singlePageDetectionScore;
10309
+ prediction.passportDetectionThresholdMet = prediction.singlePageDetectionThresholdMet;
10310
+ prediction.singlePageDetectionScore = 0;
10311
+ prediction.singlePageDetectionThresholdMet = false;
10312
+ }
10313
+ 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'));
10288
10314
  if (isRequiredDocumentType && prediction.detectedDocumentType !== 'none' && prediction.detectionThresholdMet && prediction.documentInBounds && !prediction.documentTooClose && prediction.documentIsStable) {
10289
- focusPrediction = makeFocusPrediction(lastPredictionCanvas.current, (_b = prediction.bestDocument) === null || _b === void 0 ? void 0 : _b.box);
10315
+ focusPrediction = makeFocusPrediction(lastPredictionCanvas.current, (_c = prediction.bestDocument) === null || _c === void 0 ? void 0 : _c.box);
10290
10316
  if (focusPrediction) {
10291
10317
  focusScore = focusPrediction.score;
10292
10318
  focusPredictionTime = focusPrediction.predictionTime;
10293
10319
  }
10294
- focusThresholdSet = (_c = thresholds.focus) === null || _c === void 0 ? void 0 : _c[prediction.detectedDocumentType];
10295
- 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;
10320
+ focusThresholdSet = (_d = thresholds.focus) === null || _d === void 0 ? void 0 : _d[prediction.detectedDocumentType];
10321
+ 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;
10296
10322
  focusThresholdMet = focusScore >= focusThreshold;
10297
10323
  if (bestFocusScore.current <= focusScore && stopDetectionAtStart === stopDetection.current) {
10298
10324
  bestFocusScore.current = focusScore;
10299
10325
  drawToCanvas(bestPredictionCanvas.current, lastPredictionCanvas.current);
10300
10326
  bestFrameDetails.current = {
10301
- boundingBox: (_e = prediction.bestDocument) === null || _e === void 0 ? void 0 : _e.box,
10327
+ boundingBox: (_f = prediction.bestDocument) === null || _f === void 0 ? void 0 : _f.box,
10302
10328
  documentType: prediction.detectedDocumentType,
10303
10329
  detectionScore: prediction.detectionScore,
10304
10330
  focusScore: focusScore
10305
10331
  };
10306
10332
  }
10307
10333
  }
10308
- (_f = onPredictionHandler.current) === null || _f === void 0 ? void 0 : _f.call(onPredictionHandler, _assign(_assign({}, prediction), {
10334
+ (_g = onPredictionHandler.current) === null || _g === void 0 ? void 0 : _g.call(onPredictionHandler, _assign(_assign({}, prediction), {
10309
10335
  focusScore: focusScore,
10310
10336
  focusPredictionTime: focusPredictionTime,
10311
10337
  focusThresholdMet: focusThresholdMet
@@ -10314,7 +10340,7 @@
10314
10340
  });
10315
10341
  });
10316
10342
  });
10317
- }, [lastPredictionCanvas, makeFocusPrediction, onDocumentDetected, requiredDocumentType, thresholds.focus]);
10343
+ }, [allowSinglePageIdCapture, lastPredictionCanvas, makeFocusPrediction, onDocumentDetected, requiredDocumentType, thresholds.focus]);
10318
10344
  var modelError = documentDetectionModelError !== null && documentDetectionModelError !== void 0 ? documentDetectionModelError : focusModelError;
10319
10345
  React.useEffect(function handleModelErrors() {
10320
10346
  if (modelError) onModelError === null || onModelError === void 0 ? void 0 : onModelError(modelError);
@@ -10328,9 +10354,9 @@
10328
10354
  canvas: bestPredictionCanvas.current
10329
10355
  });
10330
10356
  }, []);
10331
- var _e = React.useState(0),
10332
- canvasKey = _e[0],
10333
- setCanvasKey = _e[1];
10357
+ var _f = React.useState(0),
10358
+ canvasKey = _f[0],
10359
+ setCanvasKey = _f[1];
10334
10360
  var resetBestFrame = React.useCallback(function () {
10335
10361
  stopDetection.current += 1;
10336
10362
  setCanvasKey(function (n) {
@@ -10460,9 +10486,9 @@
10460
10486
  });
10461
10487
  }
10462
10488
 
10463
- var CapturedDocumentTypeValues = ['idCardFront', 'idCardBack', 'passport', 'selfie'];
10489
+ var CapturedDocumentTypeValues = ['idCardFront', 'idCardBack', 'passport', 'singlePage', 'selfie'];
10464
10490
 
10465
- var requiredDocumentsForOption = {
10491
+ var acceptedDocumentTypesForIdCaptureRequirementOption = {
10466
10492
  idCardFront: ['idCardFront'],
10467
10493
  idCardBack: ['idCardBack'],
10468
10494
  passport: ['passport'],
@@ -10470,13 +10496,31 @@
10470
10496
  idCardAndPassport: ['idCardFront', 'idCardBack', 'passport'],
10471
10497
  idCardOrPassport: ['idCardFront', 'idCardBack', 'passport'] // this one is so weird
10472
10498
  };
10473
- function requiredImageCountForOption(idCaptureRequirement) {
10499
+ function minImageCountForIdCaptureRequirementOption(idCaptureRequirement) {
10474
10500
  if (idCaptureRequirement === 'idCardOrPassport') return 1;
10475
- return requiredDocumentsForOption[idCaptureRequirement].length;
10501
+ return acceptedDocumentTypesForIdCaptureRequirementOption[idCaptureRequirement].length;
10476
10502
  }
10477
- function allowedImageCountForOption(idCaptureRequirement) {
10503
+ function maxImageCountForIdCaptureRequirementOption(idCaptureRequirement) {
10478
10504
  if (idCaptureRequirement === 'idCardOrPassport') return 2;
10479
- return requiredImageCountForOption(idCaptureRequirement);
10505
+ return minImageCountForIdCaptureRequirementOption(idCaptureRequirement);
10506
+ }
10507
+ function remainingIdCaptureRequirements(captureRequirement, capturedDocuments, requestedDocumentType) {
10508
+ var isIdCardOrPassport = captureRequirement === 'idCardOrPassport';
10509
+ if (isIdCardOrPassport && requestedDocumentType === 'passport') return [];
10510
+ var acceptedTypes = acceptedDocumentTypesForIdCaptureRequirementOption[captureRequirement];
10511
+ if (captureRequirement.includes('idCard') && 'singlePage' in capturedDocuments) {
10512
+ acceptedTypes = acceptedTypes.filter(function (v) {
10513
+ return !v.includes('idCard');
10514
+ });
10515
+ }
10516
+ if (isIdCardOrPassport) {
10517
+ acceptedTypes = acceptedTypes.filter(function (v) {
10518
+ return v !== 'passport';
10519
+ });
10520
+ }
10521
+ return acceptedTypes.filter(function (v) {
10522
+ return !(v in capturedDocuments);
10523
+ });
10480
10524
  }
10481
10525
 
10482
10526
  var initialState$4 = {
@@ -10515,6 +10559,8 @@
10515
10559
  idCardBackDetectionThresholdMet: false,
10516
10560
  passportDetectionScore: 0,
10517
10561
  passportDetectionThresholdMet: false,
10562
+ singlePageDetectionScore: 0,
10563
+ singlePageDetectionThresholdMet: false,
10518
10564
  focusScore: 0,
10519
10565
  focusThresholdMet: false,
10520
10566
  isGoodFrame: false,
@@ -10530,6 +10576,7 @@
10530
10576
  capturedDocuments: {},
10531
10577
  captureRequirement: 'idCardOrPassport',
10532
10578
  requestedDocumentType: 'idCardFront',
10579
+ allowSinglePageIdCapture: false,
10533
10580
  allowIdCardBackToFrontCapture: false,
10534
10581
  operationStartedAt: null,
10535
10582
  captureStartedAt: null
@@ -10544,11 +10591,13 @@
10544
10591
  var _c = action.payload,
10545
10592
  captureRequirement = _c.captureRequirement,
10546
10593
  precapturedDocuments = _c.precapturedDocuments,
10594
+ allowSinglePageIdCapture = _c.allowSinglePageIdCapture,
10547
10595
  allowIdCardBackToFrontCapture = _c.allowIdCardBackToFrontCapture,
10548
10596
  enableOverrideWrongDocumentTypeDialog = _c.enableOverrideWrongDocumentTypeDialog,
10549
10597
  allowOverrideWrongDocumentTypeAfterMs = _c.allowOverrideWrongDocumentTypeAfterMs;
10550
10598
  var newState = _assign(_assign({}, state), {
10551
10599
  captureRequirement: captureRequirement,
10600
+ allowSinglePageIdCapture: allowSinglePageIdCapture !== null && allowSinglePageIdCapture !== void 0 ? allowSinglePageIdCapture : false,
10552
10601
  allowIdCardBackToFrontCapture: allowIdCardBackToFrontCapture !== null && allowIdCardBackToFrontCapture !== void 0 ? allowIdCardBackToFrontCapture : false,
10553
10602
  enableOverrideWrongDocumentTypeDialog: enableOverrideWrongDocumentTypeDialog,
10554
10603
  allowOverrideWrongDocumentTypeAfterMs: allowOverrideWrongDocumentTypeAfterMs
@@ -10616,6 +10665,8 @@
10616
10665
  idCardBackDetectionThresholdMet = _d.idCardBackDetectionThresholdMet,
10617
10666
  passportDetectionScore = _d.passportDetectionScore,
10618
10667
  passportDetectionThresholdMet = _d.passportDetectionThresholdMet,
10668
+ singlePageDetectionScore = _d.singlePageDetectionScore,
10669
+ singlePageDetectionThresholdMet = _d.singlePageDetectionThresholdMet,
10619
10670
  bestDocument = _d.bestDocument,
10620
10671
  documentInBounds = _d.documentInBounds,
10621
10672
  documentTooClose = _d.documentTooClose,
@@ -10636,7 +10687,8 @@
10636
10687
  }
10637
10688
  }
10638
10689
  }
10639
- var idCardDetectedButNotAllowed = detectedDocumentType.includes('idCard') && !state.captureRequirement.includes('idCard');
10690
+ var idCardDetected = detectedDocumentType.includes('idCard') || detectedDocumentType === 'singlePage';
10691
+ var idCardDetectedButNotAllowed = idCardDetected && !state.captureRequirement.includes('idCard');
10640
10692
  var passportNotAllowed = !state.captureRequirement.toLowerCase().includes('passport');
10641
10693
  var idCardFrontWasCaptured = 'idCardFront' in state.capturedDocuments;
10642
10694
  var idCardBackWasCaptured = 'idCardBack' in state.capturedDocuments;
@@ -10696,6 +10748,8 @@
10696
10748
  idCardBackDetectionThresholdMet: idCardBackDetectionThresholdMet,
10697
10749
  passportDetectionScore: passportDetectionScore,
10698
10750
  passportDetectionThresholdMet: passportDetectionThresholdMet,
10751
+ singlePageDetectionScore: singlePageDetectionScore,
10752
+ singlePageDetectionThresholdMet: singlePageDetectionThresholdMet,
10699
10753
  focusScore: focusScore,
10700
10754
  focusThresholdMet: focusThresholdMet,
10701
10755
  isGoodFrame: isGoodFrame,
@@ -10733,7 +10787,7 @@
10733
10787
  });
10734
10788
  case 'documentCaptured':
10735
10789
  {
10736
- var newState_1 = _assign(_assign({}, state), {
10790
+ var newState = _assign(_assign({}, state), {
10737
10791
  capturing: false,
10738
10792
  captureFailed: false,
10739
10793
  allowOverrideFlipRequirement: false,
@@ -10742,64 +10796,42 @@
10742
10796
  wrongDocumentTypePredictions: 0,
10743
10797
  capturedDocuments: _assign(_assign({}, state.capturedDocuments), (_a = {}, _a[action.payload.documentType] = action.payload, _a))
10744
10798
  });
10745
- var remainingRequirements = requiredDocumentsForOption[state.captureRequirement].filter(function (v) {
10746
- return !(v in newState_1.capturedDocuments);
10747
- });
10748
- if (state.captureRequirement === 'idCardOrPassport') {
10749
- if (state.requestedDocumentType === 'passport') {
10750
- remainingRequirements = [];
10751
- } else {
10752
- remainingRequirements = remainingRequirements.filter(function (v) {
10753
- return v !== 'passport';
10754
- });
10755
- }
10756
- }
10799
+ var remainingRequirements = remainingIdCaptureRequirements(state.captureRequirement, newState.capturedDocuments, state.requestedDocumentType);
10757
10800
  if (remainingRequirements.length === 0) {
10758
- newState_1.captureState = 'complete';
10801
+ newState.captureState = 'complete';
10759
10802
  } else {
10760
- newState_1.requestedDocumentType = remainingRequirements[0];
10761
- if (state.requestedDocumentType === 'idCardFront' && newState_1.requestedDocumentType === 'idCardBack' || state.requestedDocumentType === 'idCardBack' && newState_1.requestedDocumentType === 'idCardFront') {
10762
- newState_1.captureState = 'requestingFlip';
10763
- newState_1.idCardFrontDetectionThresholdMet = false;
10764
- newState_1.idCardBackDetectionThresholdMet = false;
10765
- newState_1.passportDetectionThresholdMet = false;
10766
- newState_1.wrongDocumentTypePredictions = 0;
10803
+ newState.requestedDocumentType = remainingRequirements[0];
10804
+ if (state.requestedDocumentType === 'idCardFront' && newState.requestedDocumentType === 'idCardBack' || state.requestedDocumentType === 'idCardBack' && newState.requestedDocumentType === 'idCardFront') {
10805
+ newState.captureState = 'requestingFlip';
10806
+ newState.idCardFrontDetectionThresholdMet = false;
10807
+ newState.idCardBackDetectionThresholdMet = false;
10808
+ newState.passportDetectionThresholdMet = false;
10809
+ newState.wrongDocumentTypePredictions = 0;
10767
10810
  }
10768
10811
  }
10769
- return newState_1;
10812
+ return newState;
10770
10813
  }
10771
10814
  case 'documentCapturedManually':
10772
10815
  {
10773
- var newState_2 = _assign(_assign({}, state), {
10816
+ var newState = _assign(_assign({}, state), {
10774
10817
  capturedDocuments: _assign(_assign({}, state.capturedDocuments), (_b = {}, _b[state.requestedDocumentType] = _assign(_assign({}, action.payload), {
10775
10818
  width: 0,
10776
10819
  height: 0
10777
10820
  }), _b))
10778
10821
  });
10779
- var remainingRequirements = requiredDocumentsForOption[state.captureRequirement].filter(function (v) {
10780
- return !(v in newState_2.capturedDocuments);
10781
- });
10782
- if (state.captureRequirement === 'idCardOrPassport') {
10783
- if (state.requestedDocumentType === 'passport') {
10784
- remainingRequirements = [];
10785
- } else {
10786
- remainingRequirements = remainingRequirements.filter(function (v) {
10787
- return v !== 'passport';
10788
- });
10789
- }
10790
- }
10822
+ var remainingRequirements = remainingIdCaptureRequirements(state.captureRequirement, newState.capturedDocuments, state.requestedDocumentType);
10791
10823
  if (remainingRequirements.length === 0) {
10792
- newState_2.captureState = 'complete';
10824
+ newState.captureState = 'complete';
10793
10825
  } else {
10794
- newState_2.requestedDocumentType = remainingRequirements[0];
10795
- if (state.requestedDocumentType === 'idCardFront' && newState_2.requestedDocumentType === 'idCardBack' || state.requestedDocumentType === 'idCardBack' && newState_2.requestedDocumentType === 'idCardFront') {
10796
- newState_2.captureState = 'requestingFlip';
10797
- newState_2.idCardFrontDetectionThresholdMet = false;
10798
- newState_2.idCardBackDetectionThresholdMet = false;
10799
- newState_2.passportDetectionThresholdMet = false;
10826
+ newState.requestedDocumentType = remainingRequirements[0];
10827
+ if (state.requestedDocumentType === 'idCardFront' && newState.requestedDocumentType === 'idCardBack' || state.requestedDocumentType === 'idCardBack' && newState.requestedDocumentType === 'idCardFront') {
10828
+ newState.captureState = 'requestingFlip';
10829
+ newState.idCardFrontDetectionThresholdMet = false;
10830
+ newState.idCardBackDetectionThresholdMet = false;
10831
+ newState.passportDetectionThresholdMet = false;
10800
10832
  }
10801
10833
  }
10802
- return newState_2;
10834
+ return newState;
10803
10835
  }
10804
10836
  case 'flipRequestCompleted':
10805
10837
  return _assign(_assign({}, state), {
@@ -14190,7 +14222,7 @@
14190
14222
  imageUrl: imageUrl
14191
14223
  }
14192
14224
  });
14193
- var capturedDocumentType = documentType === 'passport' ? 'passport' : state.requestedDocumentType;
14225
+ var capturedDocumentType = documentType;
14194
14226
  setTimeout(function () {
14195
14227
  var _a;
14196
14228
  var captureTime = new Date().getTime() - ((_a = state.captureStartedAt) !== null && _a !== void 0 ? _a : new Date()).getTime();
@@ -14257,7 +14289,7 @@
14257
14289
  scaling: debugScalingDetails,
14258
14290
  flipX: !isRearFacing
14259
14291
  });
14260
- }))), debugMode && ( /*#__PURE__*/React.createElement(DebugStatsPane, null, camera ? ( /*#__PURE__*/React.createElement(React.Fragment, null, "\u2705 Camera: ", camera.label, " (", camera.width, "x", camera.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React.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.createElement("br", null), modelsReady ? ( /*#__PURE__*/React.createElement(React.Fragment, null, state.detectionThresholdMet ? '✅' : '❌', " Detected Document Type: ", state.detectedDocumentType, /*#__PURE__*/React.createElement("br", null), state.idCardFrontDetectionThresholdMet ? '✅' : '❌', " ID Card Front Score: ", state.idCardFrontDetectionScore.toFixed(3), /*#__PURE__*/React.createElement("br", null), state.idCardBackDetectionThresholdMet ? '✅' : '❌', " ID Card Back Score: ", state.idCardBackDetectionScore.toFixed(3), /*#__PURE__*/React.createElement("br", null), state.passportDetectionThresholdMet ? '✅' : '❌', " Passport Score: ", state.passportDetectionScore.toFixed(3), /*#__PURE__*/React.createElement("br", null), state.focusThresholdMet ? '✅' : '❌', " Focus Score:", ' ', state.focusScore.toFixed(3), /*#__PURE__*/React.createElement("br", null), state.documentInBounds ? '✅' : '❌', " Document In Bounds", /*#__PURE__*/React.createElement("br", null), state.documentIsStable ? '✅' : '❌', " Document Is Stable", /*#__PURE__*/React.createElement("br", null), state.goodFramesThresholdMet ? '✅' : '❌', " Good Frame Count:", ' ', state.goodFramesCount, "/", state.goodFramesThreshold)) : ( /*#__PURE__*/React.createElement(React.Fragment, null, "\u274C Models not ready")))));
14292
+ }))), debugMode && ( /*#__PURE__*/React.createElement(DebugStatsPane, null, camera ? ( /*#__PURE__*/React.createElement(React.Fragment, null, "\u2705 Camera: ", camera.label, " (", camera.width, "x", camera.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React.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.createElement("br", null), modelsReady ? ( /*#__PURE__*/React.createElement(React.Fragment, null, state.detectionThresholdMet ? '✅' : '❌', " Detected Document Type: ", state.detectedDocumentType, /*#__PURE__*/React.createElement("br", null), state.idCardFrontDetectionThresholdMet ? '✅' : '❌', " ID Card Front Score: ", state.idCardFrontDetectionScore.toFixed(3), /*#__PURE__*/React.createElement("br", null), state.idCardBackDetectionThresholdMet ? '✅' : '❌', " ID Card Back Score: ", state.idCardBackDetectionScore.toFixed(3), /*#__PURE__*/React.createElement("br", null), state.passportDetectionThresholdMet ? '✅' : '❌', " Passport Score: ", state.passportDetectionScore.toFixed(3), /*#__PURE__*/React.createElement("br", null), state.singlePageDetectionThresholdMet ? '✅' : '❌', " Single Page Score: ", state.singlePageDetectionScore.toFixed(3), /*#__PURE__*/React.createElement("br", null), state.focusThresholdMet ? '✅' : '❌', " Focus Score:", ' ', state.focusScore.toFixed(3), /*#__PURE__*/React.createElement("br", null), state.documentInBounds ? '✅' : '❌', " Document In Bounds", /*#__PURE__*/React.createElement("br", null), state.documentIsStable ? '✅' : '❌', " Document Is Stable", /*#__PURE__*/React.createElement("br", null), state.goodFramesThresholdMet ? '✅' : '❌', " Good Frame Count:", ' ', state.goodFramesCount, "/", state.goodFramesThreshold)) : ( /*#__PURE__*/React.createElement(React.Fragment, null, "\u274C Models not ready")))));
14261
14293
  };
14262
14294
  var timeSince = function timeSince(t) {
14263
14295
  if (!t) return 0;
@@ -15370,15 +15402,8 @@
15370
15402
  _e = _a.debugMode,
15371
15403
  debugMode = _e === void 0 ? false : _e;
15372
15404
  var submissionStatus = React.useContext(SubmissionContext).submissionStatus;
15373
- var idCardFront = capturedDocuments.idCardFront,
15374
- idCardBack = capturedDocuments.idCardBack,
15375
- passport = capturedDocuments.passport;
15376
15405
  var verbiage = useTranslations(rawVerbiage, {
15377
15406
  headingText: 'ID Capture Successful',
15378
- idCardFrontText: 'ID Card Front',
15379
- idCardBackText: 'ID Card Back',
15380
- passportText: 'Passport',
15381
- instructionText: 'Verify the entire ID was captured clearly with no glare.',
15382
15407
  retryText: 'Retry',
15383
15408
  submittingText: 'Submitting...',
15384
15409
  submitText: 'Done'
@@ -15395,25 +15420,16 @@
15395
15420
  className: classNames.imageContainer
15396
15421
  }, /*#__PURE__*/React.createElement(ImageRow, {
15397
15422
  className: classNames.imageRow
15398
- }, idCardFront && ( /*#__PURE__*/React.createElement(ImageCol$1, {
15399
- className: classNames.imageCol
15400
- }, /*#__PURE__*/React.createElement(StyledImage, {
15401
- image: idCardFront,
15402
- className: classNames.image,
15403
- alt: verbiage.idCardFrontText
15404
- }), debugMode && ( /*#__PURE__*/React.createElement(DebugPre, null, "Detection Score: ".concat(idCardFront.detectionScore, "\nFocus Score: ").concat(idCardFront.focusScore, "\nBounding Box: ").concat(JSON.stringify(idCardFront.boundingBox)))))), idCardBack && ( /*#__PURE__*/React.createElement(ImageCol$1, {
15405
- className: classNames.imageCol
15406
- }, /*#__PURE__*/React.createElement(StyledImage, {
15407
- image: idCardBack,
15408
- className: classNames.image,
15409
- alt: verbiage.idCardBackText
15410
- }), debugMode && ( /*#__PURE__*/React.createElement(DebugPre, null, "Detection Score: ".concat(idCardBack.detectionScore, "\nFocus Score: ").concat(idCardBack.focusScore, "\nBounding Box: ").concat(JSON.stringify(idCardBack.boundingBox)))))), passport && ( /*#__PURE__*/React.createElement(ImageCol$1, {
15411
- className: classNames.imageCol
15412
- }, /*#__PURE__*/React.createElement(StyledImage, {
15413
- image: passport,
15414
- className: classNames.image,
15415
- alt: verbiage.passportText
15416
- }), debugMode && ( /*#__PURE__*/React.createElement(DebugPre, null, "Detection Score: ".concat(passport.detectionScore, "\nFocus Score: ").concat(passport.focusScore, "\nBounding Box: ").concat(JSON.stringify(passport.boundingBox)))))))), /*#__PURE__*/React.createElement(ButtonsColumn, {
15423
+ }, Object.values(capturedDocuments).map(function (doc) {
15424
+ return /*#__PURE__*/React.createElement(ImageCol$1, {
15425
+ className: classNames.imageCol,
15426
+ key: doc.imageData
15427
+ }, /*#__PURE__*/React.createElement(StyledImage, {
15428
+ image: doc,
15429
+ className: classNames.image,
15430
+ alt: doc.documentType
15431
+ }), debugMode && ( /*#__PURE__*/React.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)))));
15432
+ }))), /*#__PURE__*/React.createElement(ButtonsColumn, {
15417
15433
  className: classNames.buttonsRow
15418
15434
  }, /*#__PURE__*/React.createElement(WideButton, {
15419
15435
  className: classNames.submitBtn,
@@ -15432,7 +15448,7 @@
15432
15448
  };
15433
15449
  var Heading$a = styled.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"])));
15434
15450
  var ImagesContainer = styled(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"])));
15435
- var ImageRow = styled(OverlayImageRow)(templateObject_3$k || (templateObject_3$k = __makeTemplateObject(["\n max-width: 100%;\n flex-direction: column;\n display: grid;\n grid-gap: 12px;\n //grid-template-columns: 1fr 1fr;\n"], ["\n max-width: 100%;\n flex-direction: column;\n display: grid;\n grid-gap: 12px;\n //grid-template-columns: 1fr 1fr;\n"])));
15451
+ var ImageRow = styled(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"])));
15436
15452
  var ImageCol$1 = styled.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"])));
15437
15453
  var StyledImage = styled(CapturedDocumentImg)(templateObject_5$9 || (templateObject_5$9 = __makeTemplateObject(["\n width: 100%;\n border-radius: 12px;\n"], ["\n width: 100%;\n border-radius: 12px;\n"])));
15438
15454
  var DebugPre = styled.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"])));
@@ -17142,8 +17158,8 @@
17142
17158
  var _j = React.useState(silentFallback),
17143
17159
  useFallback = _j[0],
17144
17160
  setUseFallback = _j[1];
17145
- var allowedImageCount = allowedImageCountForOption(idCaptureRequirement);
17146
- var requiredImageCount = requiredImageCountForOption(idCaptureRequirement);
17161
+ var minImageCount = minImageCountForIdCaptureRequirementOption(idCaptureRequirement);
17162
+ var maxImageCount = maxImageCountForIdCaptureRequirementOption(idCaptureRequirement);
17147
17163
  var _k = useFileState(),
17148
17164
  rawFile = _k.rawFile,
17149
17165
  fileInputOnChange = _k.fileInputOnChange;
@@ -17156,7 +17172,7 @@
17156
17172
  var whatToCapture = idCaptureRequirement === 'idCard' ? 'ID card' : idCaptureRequirement === 'passport' ? 'passport' : idCaptureRequirement === 'idCardOrPassport' ? 'ID card or passport' : 'ID card and passport';
17157
17173
  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.';
17158
17174
  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.';
17159
- var descriptionText = "On-device capture guidance failed, please capture ".concat(requiredImageCount > 1 ? 'photos' : ' a photo', " of your ").concat(whatToCapture, " manually.");
17175
+ var descriptionText = "On-device capture guidance failed, please capture ".concat(minImageCount > 1 ? 'photos' : ' a photo', " of your ").concat(whatToCapture, " manually.");
17160
17176
  var verbiage = useTranslations(rawVerbiage, {
17161
17177
  headingText: "We're having some trouble.",
17162
17178
  descriptionText: descriptionText,
@@ -17230,7 +17246,7 @@
17230
17246
  alt: "",
17231
17247
  className: classNames.image
17232
17248
  }));
17233
- }))), images.length < requiredImageCount && ( /*#__PURE__*/React.createElement(Instruction, {
17249
+ }))), images.length < minImageCount && ( /*#__PURE__*/React.createElement(Instruction, {
17234
17250
  className: classNames.instruction
17235
17251
  }, instructionText)), /*#__PURE__*/React.createElement("input", {
17236
17252
  ref: fileInput,
@@ -17241,7 +17257,7 @@
17241
17257
  hidden: true
17242
17258
  }), /*#__PURE__*/React.createElement(StyledButtonsRow$8, {
17243
17259
  className: classNames.buttonsRow
17244
- }, images.length < allowedImageCount && ( /*#__PURE__*/React.createElement(LoaderButton, {
17260
+ }, images.length < maxImageCount && ( /*#__PURE__*/React.createElement(LoaderButton, {
17245
17261
  variant: images.length > 0 ? 'secondary' : 'positive',
17246
17262
  className: images.length > 0 ? classNames.captureMoreBtn : classNames.captureBtn,
17247
17263
  colors: images.length > 0 ? colors.captureMoreBtn : colors.captureBtn,
@@ -17254,7 +17270,7 @@
17254
17270
  setDocumentToCapture(instructionText);
17255
17271
  }
17256
17272
  }
17257
- }, images.length > 0 ? verbiage.captureMoreBtnText : verbiage.captureBtnText)), images.length >= requiredImageCount && ( /*#__PURE__*/React.createElement(LoaderButton, {
17273
+ }, images.length > 0 ? verbiage.captureMoreBtnText : verbiage.captureBtnText)), images.length >= minImageCount && ( /*#__PURE__*/React.createElement(LoaderButton, {
17258
17274
  variant: "positive",
17259
17275
  className: classNames.doneBtn,
17260
17276
  colors: colors.doneBtn,
@@ -17301,79 +17317,82 @@
17301
17317
  precapturedDocuments = _a.precapturedDocuments,
17302
17318
  _j = _a.captureRequirement,
17303
17319
  captureRequirement = _j === void 0 ? 'idCardOrPassport' : _j,
17304
- _k = _a.separateIdCardCaptureSequence,
17305
- separateIdCardCaptureSequence = _k === void 0 ? false : _k,
17306
- _l = _a.thresholds,
17307
- thresholds = _l === void 0 ? defaultIdCaptureThresholds : _l,
17308
- _m = _a.skipSuccessScreen,
17309
- skipSuccessScreen = _m === void 0 ? false : _m,
17320
+ _k = _a.allowSinglePageIdCapture,
17321
+ allowSinglePageIdCapture = _k === void 0 ? false : _k,
17322
+ _l = _a.separateIdCardCaptureSequence,
17323
+ separateIdCardCaptureSequence = _l === void 0 ? false : _l,
17324
+ _m = _a.thresholds,
17325
+ thresholds = _m === void 0 ? defaultIdCaptureThresholds : _m,
17326
+ _o = _a.skipSuccessScreen,
17327
+ skipSuccessScreen = _o === void 0 ? false : _o,
17310
17328
  instructions = _a.instructions,
17311
- _o = _a.releaseCameraAccessOnExit,
17312
- releaseCameraAccessOnExit = _o === void 0 ? true : _o,
17313
- _p = _a.guideType,
17314
- guideType = _p === void 0 ? 'fit' : _p,
17315
- _q = _a.portraitGuidesOnMobile,
17316
- portraitGuidesOnMobile = _q === void 0 ? true : _q,
17317
- _r = _a.rotateLoadingOverlayImageWhenPortrait,
17318
- rotateLoadingOverlayImageWhenPortrait = _r === void 0 ? true : _r,
17319
- _s = _a.silentFallback,
17320
- silentFallback = _s === void 0 ? false : _s,
17321
- _t = _a.forceFallbackMode,
17322
- forceFallbackMode = _t === void 0 ? false : _t,
17323
- _u = _a.allowIdCardBackToFrontCapture,
17324
- allowIdCardBackToFrontCapture = _u === void 0 ? false : _u,
17325
- _v = _a.enableOverrideWrongDocumentTypeDialog,
17326
- enableOverrideWrongDocumentTypeDialog = _v === void 0 ? false : _v,
17327
- _w = _a.allowOverrideWrongDocumentTypeAfterMs,
17328
- allowOverrideWrongDocumentTypeAfterMs = _w === void 0 ? 8000 : _w,
17329
- _x = _a.guideImages,
17330
- guideImages = _x === void 0 ? defaultIdCaptureGuideImages : _x,
17331
- _y = _a.assets,
17332
- assets = _y === void 0 ? {} : _y,
17333
- _z = _a.classNames,
17334
- classNames = _z === void 0 ? {} : _z,
17335
- _0 = _a.colors,
17336
- colors = _0 === void 0 ? {} : _0,
17337
- _1 = _a.verbiage,
17338
- verbiage = _1 === void 0 ? {} : _1,
17339
- _2 = _a.debugMode,
17340
- debugMode = _2 === void 0 ? false : _2;
17341
- var _3 = useIdCaptureState(),
17342
- state = _3[0],
17343
- dispatch = _3[1];
17344
- var _4 = useCameraStore(),
17345
- cameraAccessDenied = _4.cameraAccessDenied,
17346
- requestCameraAccess = _4.requestCameraAccess,
17347
- releaseCameraAccess = _4.releaseCameraAccess;
17348
- var _5 = React.useState(false),
17349
- overlayDismissed = _5[0],
17350
- setOverlayDismissed = _5[1];
17351
- var _6 = React.useContext(SubmissionContext),
17352
- submissionStatus = _6.submissionStatus,
17353
- setIdFrontImage = _6.setIdFrontImage,
17354
- setIdBackImage = _6.setIdBackImage,
17355
- setPassportImage = _6.setPassportImage,
17356
- logIdFrontCaptureAttempt = _6.logIdFrontCaptureAttempt,
17357
- logIdBackCaptureAttempt = _6.logIdBackCaptureAttempt;
17358
- var _7 = React.useContext(IdCaptureModelsContext),
17359
- start = _7.start,
17360
- stop = _7.stop,
17361
- onPredictionMade = _7.onPredictionMade,
17362
- setRequiredDocumentType = _7.setRequiredDocumentType,
17363
- modelError = _7.modelError,
17364
- resetBestFrame = _7.resetBestFrame;
17329
+ _p = _a.releaseCameraAccessOnExit,
17330
+ releaseCameraAccessOnExit = _p === void 0 ? true : _p,
17331
+ _q = _a.guideType,
17332
+ guideType = _q === void 0 ? 'fit' : _q,
17333
+ _r = _a.portraitGuidesOnMobile,
17334
+ portraitGuidesOnMobile = _r === void 0 ? true : _r,
17335
+ _s = _a.rotateLoadingOverlayImageWhenPortrait,
17336
+ rotateLoadingOverlayImageWhenPortrait = _s === void 0 ? true : _s,
17337
+ _t = _a.silentFallback,
17338
+ silentFallback = _t === void 0 ? false : _t,
17339
+ _u = _a.forceFallbackMode,
17340
+ forceFallbackMode = _u === void 0 ? false : _u,
17341
+ _v = _a.allowIdCardBackToFrontCapture,
17342
+ allowIdCardBackToFrontCapture = _v === void 0 ? false : _v,
17343
+ _w = _a.enableOverrideWrongDocumentTypeDialog,
17344
+ enableOverrideWrongDocumentTypeDialog = _w === void 0 ? false : _w,
17345
+ _x = _a.allowOverrideWrongDocumentTypeAfterMs,
17346
+ allowOverrideWrongDocumentTypeAfterMs = _x === void 0 ? 8000 : _x,
17347
+ _y = _a.guideImages,
17348
+ guideImages = _y === void 0 ? defaultIdCaptureGuideImages : _y,
17349
+ _z = _a.assets,
17350
+ assets = _z === void 0 ? {} : _z,
17351
+ _0 = _a.classNames,
17352
+ classNames = _0 === void 0 ? {} : _0,
17353
+ _1 = _a.colors,
17354
+ colors = _1 === void 0 ? {} : _1,
17355
+ _2 = _a.verbiage,
17356
+ verbiage = _2 === void 0 ? {} : _2,
17357
+ _3 = _a.debugMode,
17358
+ debugMode = _3 === void 0 ? false : _3;
17359
+ var _4 = useIdCaptureState(),
17360
+ state = _4[0],
17361
+ dispatch = _4[1];
17362
+ var _5 = useCameraStore(),
17363
+ cameraAccessDenied = _5.cameraAccessDenied,
17364
+ requestCameraAccess = _5.requestCameraAccess,
17365
+ releaseCameraAccess = _5.releaseCameraAccess;
17366
+ var _6 = React.useState(false),
17367
+ overlayDismissed = _6[0],
17368
+ setOverlayDismissed = _6[1];
17369
+ var _7 = React.useContext(SubmissionContext),
17370
+ submissionStatus = _7.submissionStatus,
17371
+ setIdFrontImage = _7.setIdFrontImage,
17372
+ setIdBackImage = _7.setIdBackImage,
17373
+ setPassportImage = _7.setPassportImage,
17374
+ logIdFrontCaptureAttempt = _7.logIdFrontCaptureAttempt,
17375
+ logIdBackCaptureAttempt = _7.logIdBackCaptureAttempt;
17376
+ var _8 = React.useContext(IdCaptureModelsContext),
17377
+ start = _8.start,
17378
+ stop = _8.stop,
17379
+ onPredictionMade = _8.onPredictionMade,
17380
+ setRequiredDocumentType = _8.setRequiredDocumentType,
17381
+ modelError = _8.modelError,
17382
+ resetBestFrame = _8.resetBestFrame;
17365
17383
  React.useEffect(function () {
17366
17384
  dispatch({
17367
17385
  type: 'configureWizard',
17368
17386
  payload: {
17369
17387
  captureRequirement: captureRequirement,
17370
17388
  precapturedDocuments: precapturedDocuments,
17389
+ allowSinglePageIdCapture: allowSinglePageIdCapture,
17371
17390
  allowIdCardBackToFrontCapture: allowIdCardBackToFrontCapture,
17372
17391
  enableOverrideWrongDocumentTypeDialog: enableOverrideWrongDocumentTypeDialog,
17373
17392
  allowOverrideWrongDocumentTypeAfterMs: allowOverrideWrongDocumentTypeAfterMs
17374
17393
  }
17375
17394
  });
17376
- }, [allowIdCardBackToFrontCapture, allowOverrideWrongDocumentTypeAfterMs, captureRequirement, dispatch, enableOverrideWrongDocumentTypeDialog, precapturedDocuments]);
17395
+ }, [allowIdCardBackToFrontCapture, allowOverrideWrongDocumentTypeAfterMs, allowSinglePageIdCapture, captureRequirement, dispatch, enableOverrideWrongDocumentTypeDialog, precapturedDocuments]);
17377
17396
  var documentCount = Object.keys(state.capturedDocuments).length;
17378
17397
  React.useEffect(function () {
17379
17398
  if (documentCount) resetBestFrame();
@@ -17435,13 +17454,16 @@
17435
17454
  var _a = state.capturedDocuments,
17436
17455
  idCardFront = _a.idCardFront,
17437
17456
  idCardBack = _a.idCardBack,
17438
- passport = _a.passport;
17457
+ passport = _a.passport,
17458
+ singlePage = _a.singlePage;
17439
17459
  var idFrontImage = idCardFront && dataUrlToBase64Sync(idCardFront.imageData);
17440
17460
  var idBackImage = idCardBack && dataUrlToBase64Sync(idCardBack.imageData);
17441
17461
  var passportImage = passport && dataUrlToBase64Sync(passport.imageData);
17462
+ var singlePageImage = singlePage && dataUrlToBase64Sync(singlePage.imageData);
17442
17463
  if (idFrontImage) setIdFrontImage(idFrontImage);
17443
17464
  if (idBackImage) setIdBackImage(idBackImage);
17444
17465
  if (passportImage) setPassportImage(passportImage);
17466
+ if (singlePageImage) setIdFrontImage(singlePageImage);
17445
17467
  if (releaseCameraAccessOnExit) releaseCameraAccess();
17446
17468
  setTimeout(function () {
17447
17469
  onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess({
@@ -17457,9 +17479,9 @@
17457
17479
  type: 'resetWizard'
17458
17480
  });
17459
17481
  }, [dispatch]);
17460
- var _8 = React.useState(0),
17461
- attempt = _8[0],
17462
- setAttempt = _8[1];
17482
+ var _9 = React.useState(0),
17483
+ attempt = _9[0],
17484
+ setAttempt = _9[1];
17463
17485
  var onExit = React.useCallback(function () {
17464
17486
  releaseCameraAccess();
17465
17487
  setOverlayDismissed(false);
@@ -17550,9 +17572,9 @@
17550
17572
  });
17551
17573
  });
17552
17574
  }, [dispatch]);
17553
- var _9 = React.useState(false),
17554
- progressStarted = _9[0],
17555
- setProgressStarted = _9[1];
17575
+ var _10 = React.useState(false),
17576
+ progressStarted = _10[0],
17577
+ setProgressStarted = _10[1];
17556
17578
  React.useEffect(function () {
17557
17579
  if (state.captureState === 'capturing') {
17558
17580
  setProgressStarted(false);
@@ -21852,7 +21874,8 @@
21852
21874
  detection: {
21853
21875
  idCardFront: 0.4,
21854
21876
  idCardBack: 0.5,
21855
- passport: 0.3
21877
+ passport: 0.3,
21878
+ singlePage: 0.3
21856
21879
  },
21857
21880
  focus: {
21858
21881
  idCardFront: {
@@ -21866,12 +21889,17 @@
21866
21889
  passport: {
21867
21890
  desktop: 0,
21868
21891
  mobile: 0
21892
+ },
21893
+ singlePage: {
21894
+ desktop: 0,
21895
+ mobile: 0
21869
21896
  }
21870
21897
  },
21871
21898
  goodFrames: {
21872
21899
  idCardFront: 1,
21873
21900
  idCardBack: 1,
21874
- passport: 1
21901
+ passport: 1,
21902
+ singlePage: 1
21875
21903
  },
21876
21904
  flipShortcutThreshold: 0.7
21877
21905
  };
@@ -21943,6 +21971,7 @@
21943
21971
  stopIdModels = _18.stop,
21944
21972
  onIdPredictionMade = _18.onPredictionMade,
21945
21973
  setThresholds = _18.setThresholds,
21974
+ setRequiredDocumentType = _18.setRequiredDocumentType,
21946
21975
  setDocumentDetectionBoundaries = _18.setDocumentDetectionBoundaries,
21947
21976
  bestFrameDetails = _18.bestFrameDetails,
21948
21977
  resetBestFrame = _18.resetBestFrame,
@@ -22021,6 +22050,9 @@
22021
22050
  React.useEffect(function () {
22022
22051
  setThresholds(adjustedThresholds);
22023
22052
  }, [requestedAction, setThresholds, adjustedThresholds]);
22053
+ React.useEffect(function () {
22054
+ setRequiredDocumentType(requestedAction === 'SHOW_PASSPORT' ? 'passport' : requestedAction === 'SHOW_ID_BACK' ? 'idCardBack' : 'idCardFront');
22055
+ }, [requestedAction, setRequiredDocumentType]);
22024
22056
  React.useEffect(function () {
22025
22057
  setDocumentDetectionBoundaries({
22026
22058
  top: 20,
@@ -22043,6 +22075,9 @@
22043
22075
  setGoodFramesCount = _28[1];
22044
22076
  var goodFramesThreshold = requestedAction === 'SHOW_PASSPORT' ? adjustedThresholds.goodFrames.passport : requestedAction === 'SHOW_ID_FRONT' ? adjustedThresholds.goodFrames.idCardFront : adjustedThresholds.goodFrames.idCardBack;
22045
22077
  var goodFramesThresholdMet = goodFramesCount >= goodFramesThreshold;
22078
+ var _29 = React.useState(false),
22079
+ isSinglePage = _29[0],
22080
+ setIsSinglePage = _29[1];
22046
22081
  React.useEffect(function () {
22047
22082
  if (!idCaptureModelsEnabled || idModelError) return;
22048
22083
  onIdPredictionMade(function (prediction) {
@@ -22050,7 +22085,8 @@
22050
22085
  setCurrentDetectionScore(prediction.detectionScore);
22051
22086
  setCurrentDetectedDocumentType(prediction.detectedDocumentType);
22052
22087
  setCurrentFocusScore(prediction.focusScore);
22053
- var detectionThresholdMet = requestedAction === 'SHOW_PASSPORT' ? prediction.passportDetectionThresholdMet : requestedAction === 'SHOW_ID_FRONT' ? prediction.idCardFrontDetectionThresholdMet : prediction.idCardBackDetectionThresholdMet;
22088
+ setIsSinglePage(prediction.singlePageDetectionThresholdMet);
22089
+ var detectionThresholdMet = requestedAction === 'SHOW_PASSPORT' ? prediction.passportDetectionThresholdMet : requestedAction === 'SHOW_ID_BACK' ? prediction.idCardBackDetectionThresholdMet : prediction.idCardFrontDetectionThresholdMet || prediction.singlePageDetectionThresholdMet;
22054
22090
  var isGoodFrame = detectionThresholdMet && prediction.focusThresholdMet;
22055
22091
  var shouldShortcutFlipAnimation = requestedAction === 'FLIP_ID' && isGoodFrame && prediction.idCardBackDetectionScore >= adjustedThresholds.flipShortcutThreshold;
22056
22092
  if (shouldShortcutFlipAnimation) {
@@ -22061,9 +22097,9 @@
22061
22097
  } : 0);
22062
22098
  });
22063
22099
  }, [idCaptureModelsEnabled, onIdPredictionMade, idModelError, requestedAction, adjustedThresholds.flipShortcutThreshold]);
22064
- var _29 = React.useState(null),
22065
- idFrontCaptureStartedAt = _29[0],
22066
- setFirstGoodFrameTime = _29[1];
22100
+ var _30 = React.useState(null),
22101
+ idFrontCaptureStartedAt = _30[0],
22102
+ setFirstGoodFrameTime = _30[1];
22067
22103
  React.useEffect(function () {
22068
22104
  if (goodFramesCount === 1) setFirstGoodFrameTime(new Date().getTime());
22069
22105
  }, [goodFramesCount]);
@@ -22084,80 +22120,60 @@
22084
22120
  var frameHeight = (_e = (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.videoHeight) !== null && _e !== void 0 ? _e : 0;
22085
22121
  var faceBox = face === null || face === void 0 ? void 0 : face.box;
22086
22122
  var faceCentered = !faceBox || !frameWidth || faceBox.xMin > frameWidth * edgeBoundary && faceBox.yMin > frameHeight * edgeBoundary && faceBox.xMax < frameWidth * (1 - edgeBoundary) && faceBox.yMax < frameHeight * (1 - edgeBoundary);
22087
- var _30 = React.useState(),
22088
- countdownStartedAt = _30[0],
22089
- setCountdownStartedAt = _30[1];
22123
+ var _31 = React.useState(),
22124
+ countdownStartedAt = _31[0],
22125
+ setCountdownStartedAt = _31[1];
22090
22126
  var photoCanvas = React.useRef(null);
22091
22127
  var frameLock = React.useRef(false);
22092
22128
  var captureFrame = React.useCallback(function () {
22093
22129
  return __awaiter(void 0, void 0, void 0, function () {
22094
- var frameBase64, _a;
22095
- return __generator(this, function (_b) {
22096
- switch (_b.label) {
22097
- case 0:
22098
- if (frameLock.current) return [2 /*return*/];
22099
- frameLock.current = true;
22100
- drawToCanvas(photoCanvas.current, videoRef.current);
22101
- frameBase64 = photoCanvas.current.toDataURL('image/jpeg');
22102
- if (!frameBase64) {
22103
- frameLock.current = false;
22104
- return [2 /*return*/];
22105
- }
22106
- _b.label = 1;
22107
- case 1:
22108
- _b.trys.push([1,, 7, 8]);
22109
- if (!(requestedAction == 'SHOW_ID_FRONT')) return [3 /*break*/, 5];
22130
+ var frameBase64;
22131
+ return __generator(this, function (_a) {
22132
+ if (frameLock.current) return [2 /*return*/];
22133
+ frameLock.current = true;
22134
+ drawToCanvas(photoCanvas.current, videoRef.current);
22135
+ frameBase64 = photoCanvas.current.toDataURL('image/jpeg');
22136
+ if (!frameBase64) {
22137
+ frameLock.current = false;
22138
+ return [2 /*return*/];
22139
+ }
22140
+ try {
22141
+ if (requestedAction == 'SHOW_ID_FRONT') {
22110
22142
  if (onIdFrontImageCaptured) {
22111
22143
  onIdFrontImageCaptured(frameBase64);
22112
22144
  }
22113
- if (!skipShowIdCardBack) return [3 /*break*/, 4];
22114
- _a = skipShowIdCardBack === true;
22115
- if (_a) return [3 /*break*/, 3];
22116
- return [4 /*yield*/, skipShowIdCardBack()];
22117
- case 2:
22118
- _a = _b.sent();
22119
- _b.label = 3;
22120
- case 3:
22121
- if (_a) {
22145
+ if (isSinglePage || evaluateShouldSkip(skipShowIdCardBack)) {
22122
22146
  return [2 /*return*/, onIdCaptureComplete()];
22123
22147
  }
22124
- _b.label = 4;
22125
- case 4:
22126
22148
  setRequestedAction('FLIP_ID');
22127
- return [3 /*break*/, 6];
22128
- case 5:
22129
- if (requestedAction == 'SHOW_ID_BACK') {
22130
- if (onIdBackImageCaptured) {
22131
- onIdBackImageCaptured(frameBase64);
22132
- }
22133
- onIdCaptureComplete();
22134
- } else if (requestedAction == 'SHOW_PASSPORT') {
22135
- if (onIdFrontImageCaptured) {
22136
- onIdFrontImageCaptured(frameBase64);
22137
- }
22138
- onIdCaptureComplete();
22149
+ } else if (requestedAction == 'SHOW_ID_BACK') {
22150
+ if (onIdBackImageCaptured) {
22151
+ onIdBackImageCaptured(frameBase64);
22139
22152
  }
22140
- _b.label = 6;
22141
- case 6:
22142
- return [3 /*break*/, 8];
22143
- case 7:
22144
- setDetectedObjects([]);
22145
- setCurrentDetectionScore(0);
22146
- setCurrentFocusScore(0);
22147
- setGoodFramesCount(0);
22148
- setCountdownStartedAt(undefined);
22149
- resetBestFrame();
22150
- frameLock.current = false;
22151
- if (countdownTimeoutRef.current) {
22152
- clearTimeout(countdownTimeoutRef.current);
22153
+ onIdCaptureComplete();
22154
+ } else if (requestedAction == 'SHOW_PASSPORT') {
22155
+ if (onIdFrontImageCaptured) {
22156
+ onIdFrontImageCaptured(frameBase64);
22153
22157
  }
22154
- return [7 /*endfinally*/];
22155
- case 8:
22156
- return [2 /*return*/];
22158
+ onIdCaptureComplete();
22159
+ }
22160
+ } finally {
22161
+ setDetectedObjects([]);
22162
+ setCurrentDetectionScore(0);
22163
+ setCurrentFocusScore(0);
22164
+ setGoodFramesCount(0);
22165
+ setCountdownStartedAt(undefined);
22166
+ setIsSinglePage(false);
22167
+ resetBestFrame();
22168
+ frameLock.current = false;
22169
+ if (countdownTimeoutRef.current) {
22170
+ clearTimeout(countdownTimeoutRef.current);
22171
+ }
22157
22172
  }
22173
+ return [2 /*return*/];
22158
22174
  });
22159
22175
  });
22160
- }, [onIdCaptureComplete, onIdBackImageCaptured, onIdFrontImageCaptured, requestedAction, resetBestFrame, skipShowIdCardBack, videoRef]);
22176
+ }, [videoRef, requestedAction, onIdFrontImageCaptured, isSinglePage, skipShowIdCardBack, onIdCaptureComplete, onIdBackImageCaptured, resetBestFrame]);
22161
22177
  var isFlipping = requestedAction === 'FLIP_ID';
22162
22178
  React.useEffect(function () {
22163
22179
  if (!isFlipping) return;
@@ -22216,9 +22232,9 @@
22216
22232
  stopSelfieGuidance();
22217
22233
  };
22218
22234
  }, [startSelfieGuidance, stopSelfieGuidance]);
22219
- var _31 = React.useState(0),
22220
- numFramesWithoutFaces = _31[0],
22221
- setNumFramesWithoutFaces = _31[1];
22235
+ var _32 = React.useState(0),
22236
+ numFramesWithoutFaces = _32[0],
22237
+ setNumFramesWithoutFaces = _32[1];
22222
22238
  onSelfiePredictionMade(f(React.useCallback(function (_a) {
22223
22239
  var face = _a.face;
22224
22240
  if (selfieModelError) return;
@@ -22234,12 +22250,12 @@
22234
22250
  }
22235
22251
  }, [disableFaceDetectionWhileAudioCapture, disableFaceDetectionWhileAudioCaptureMsDelay, numFramesWithoutFaces, onFaceNotDetected, timeoutStartedAt]);
22236
22252
  var theme = styled.useTheme();
22237
- var _32 = useTranslations(rawVerbiage, {
22253
+ var _33 = useTranslations(rawVerbiage, {
22238
22254
  faceNotCenteredText: 'Please move your face to the center...',
22239
22255
  captureBtnText: 'Capture'
22240
22256
  }),
22241
- captureBtnText = _32.captureBtnText,
22242
- faceNotCenteredText = _32.faceNotCenteredText;
22257
+ captureBtnText = _33.captureBtnText,
22258
+ faceNotCenteredText = _33.faceNotCenteredText;
22243
22259
  var debugScalingDetails = useDebugScalingDetails({
22244
22260
  enabled: debugMode,
22245
22261
  pageWidth: width,
@@ -22314,6 +22330,11 @@
22314
22330
  var Countdown = styled.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"])));
22315
22331
  var CaptureButtonContainer = styled.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"])));
22316
22332
  var CaptureButton = styled(LoaderButton)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n margin: 0 auto 25px;\n"], ["\n margin: 0 auto 25px;\n"])));
22333
+ function evaluateShouldSkip(value) {
22334
+ if (value === true) return true;
22335
+ if (typeof value === 'function') return value();
22336
+ return false;
22337
+ }
22317
22338
  var templateObject_1$5, templateObject_2$5, templateObject_3$5, templateObject_4;
22318
22339
 
22319
22340
  var IdVideoCaptureSuccess = function IdVideoCaptureSuccess(_a) {
@@ -22611,7 +22632,8 @@
22611
22632
  documentDetectionModelUrl: (_g = (_f = idCaptureProps.assets) === null || _f === void 0 ? void 0 : _f.documentDetectionModelUrl) !== null && _g !== void 0 ? _g : '',
22612
22633
  focusModelUrl: (_j = (_h = idCaptureProps.assets) === null || _h === void 0 ? void 0 : _h.focusModelUrl) !== null && _j !== void 0 ? _j : '',
22613
22634
  onModelError: onIdCaptureModelError,
22614
- modelLoadTimeoutMs: idCaptureModelLoadTimeoutMs
22635
+ modelLoadTimeoutMs: idCaptureModelLoadTimeoutMs,
22636
+ allowSinglePageIdCapture: idCaptureProps.allowSinglePageIdCapture
22615
22637
  }, /*#__PURE__*/React.createElement(SelfieGuidanceModelsProvider, {
22616
22638
  autoStart: false,
22617
22639
  onModelError: faceLivenessProps === null || faceLivenessProps === void 0 ? void 0 : faceLivenessProps.onModelError,
@@ -22861,7 +22883,8 @@
22861
22883
  documentDetectionModelUrl: (_d = (_c = idCaptureProps.assets) === null || _c === void 0 ? void 0 : _c.documentDetectionModelUrl) !== null && _d !== void 0 ? _d : '',
22862
22884
  focusModelUrl: (_f = (_e = idCaptureProps.assets) === null || _e === void 0 ? void 0 : _e.focusModelUrl) !== null && _f !== void 0 ? _f : '',
22863
22885
  onModelError: idCaptureProps.onModelError,
22864
- modelLoadTimeoutMs: idCaptureProps.modelLoadTimeoutMs
22886
+ modelLoadTimeoutMs: idCaptureProps.modelLoadTimeoutMs,
22887
+ allowSinglePageIdCapture: idCaptureProps.allowSinglePageIdCapture
22865
22888
  }, /*#__PURE__*/React.createElement(IdCaptureStateProvider, null, /*#__PURE__*/React.createElement(GuideOrientationContextProvider, null, /*#__PURE__*/React.createElement(IdCaptureWizard, _assign({}, idCaptureProps, {
22866
22889
  onSuccess: onIdCaptureSuccess
22867
22890
  }))))));
@@ -23183,31 +23206,33 @@
23183
23206
  onLoadingOverlayDismissed = _a.onLoadingOverlayDismissed,
23184
23207
  _d = _a.idCaptureRequirement,
23185
23208
  idCaptureRequirement = _d === void 0 ? 'idCardOrPassport' : _d,
23186
- _e = _a.separateIdCardCaptureSequence,
23187
- separateIdCardCaptureSequence = _e === void 0 ? false : _e,
23188
- _f = _a.idCaptureThresholds,
23189
- idCaptureThresholds = _f === void 0 ? defaultIdCaptureThresholds : _f,
23190
- _g = _a.skipSuccessScreen,
23191
- skipSuccessScreen = _g === void 0 ? false : _g,
23209
+ _e = _a.allowSinglePageIdCapture,
23210
+ allowSinglePageIdCapture = _e === void 0 ? false : _e,
23211
+ _f = _a.separateIdCardCaptureSequence,
23212
+ separateIdCardCaptureSequence = _f === void 0 ? false : _f,
23213
+ _g = _a.idCaptureThresholds,
23214
+ idCaptureThresholds = _g === void 0 ? defaultIdCaptureThresholds : _g,
23215
+ _h = _a.skipSuccessScreen,
23216
+ skipSuccessScreen = _h === void 0 ? false : _h,
23192
23217
  instructions = _a.instructions,
23193
- _h = _a.guideType,
23194
- guideType = _h === void 0 ? 'fit' : _h,
23195
- _j = _a.guideImages,
23196
- guideImages = _j === void 0 ? defaultIdCaptureGuideImages : _j,
23197
- _k = _a.portraitGuidesOnMobile,
23198
- portraitGuidesOnMobile = _k === void 0 ? true : _k,
23199
- _l = _a.rotateLoadingOverlayImageWhenPortrait,
23200
- rotateLoadingOverlayImageWhenPortrait = _l === void 0 ? true : _l,
23201
- _m = _a.modelLoadTimeoutMs,
23202
- modelLoadTimeoutMs = _m === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _m,
23203
- _o = _a.forceFallbackMode,
23204
- forceFallbackMode = _o === void 0 ? false : _o,
23205
- _p = _a.allowIdCardBackToFrontCapture,
23206
- allowIdCardBackToFrontCapture = _p === void 0 ? false : _p,
23207
- _q = _a.enableOverrideWrongDocumentTypeDialog,
23208
- enableOverrideWrongDocumentTypeDialog = _q === void 0 ? false : _q,
23209
- _r = _a.allowOverrideWrongDocumentTypeAfterMs,
23210
- allowOverrideWrongDocumentTypeAfterMs = _r === void 0 ? 8000 : _r,
23218
+ _j = _a.guideType,
23219
+ guideType = _j === void 0 ? 'fit' : _j,
23220
+ _k = _a.guideImages,
23221
+ guideImages = _k === void 0 ? defaultIdCaptureGuideImages : _k,
23222
+ _l = _a.portraitGuidesOnMobile,
23223
+ portraitGuidesOnMobile = _l === void 0 ? true : _l,
23224
+ _m = _a.rotateLoadingOverlayImageWhenPortrait,
23225
+ rotateLoadingOverlayImageWhenPortrait = _m === void 0 ? true : _m,
23226
+ _o = _a.modelLoadTimeoutMs,
23227
+ modelLoadTimeoutMs = _o === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _o,
23228
+ _p = _a.forceFallbackMode,
23229
+ forceFallbackMode = _p === void 0 ? false : _p,
23230
+ _q = _a.allowIdCardBackToFrontCapture,
23231
+ allowIdCardBackToFrontCapture = _q === void 0 ? false : _q,
23232
+ _r = _a.enableOverrideWrongDocumentTypeDialog,
23233
+ enableOverrideWrongDocumentTypeDialog = _r === void 0 ? false : _r,
23234
+ _s = _a.allowOverrideWrongDocumentTypeAfterMs,
23235
+ allowOverrideWrongDocumentTypeAfterMs = _s === void 0 ? 8000 : _s,
23211
23236
  onBeforeSubmit = _a.onBeforeSubmit,
23212
23237
  onBeforeDocumentUpload = _a.onBeforeDocumentUpload,
23213
23238
  onDocumentUploadProgress = _a.onDocumentUploadProgress,
@@ -23221,28 +23246,28 @@
23221
23246
  onUserCancel = _a.onUserCancel,
23222
23247
  onModelError = _a.onModelError,
23223
23248
  onCameraAccessDenied = _a.onCameraAccessDenied,
23224
- _s = _a.theme,
23225
- theme = _s === void 0 ? 'default' : _s,
23226
- _t = _a.assets,
23227
- assets = _t === void 0 ? {} : _t,
23228
- _u = _a.classNames,
23229
- classNames = _u === void 0 ? {} : _u,
23230
- _v = _a.colors,
23231
- colors = _v === void 0 ? {} : _v,
23232
- _w = _a.verbiage,
23233
- verbiage = _w === void 0 ? {} : _w,
23234
- _x = _a.captureSignature,
23235
- captureSignature = _x === void 0 ? false : _x,
23236
- _y = _a.captureSignatureVideo,
23237
- captureSignatureVideo = _y === void 0 ? false : _y,
23238
- _z = _a.captureAdditionalDocuments,
23239
- captureAdditionalDocuments = _z === void 0 ? [] : _z,
23240
- _0 = _a.geolocationEnabled,
23241
- geolocationEnabled = _0 === void 0 ? true : _0,
23242
- _1 = _a.geolocationRequired,
23243
- geolocationRequired = _1 === void 0 ? false : _1,
23244
- _2 = _a.debugMode,
23245
- debugMode = _2 === void 0 ? false : _2;
23249
+ _t = _a.theme,
23250
+ theme = _t === void 0 ? 'default' : _t,
23251
+ _u = _a.assets,
23252
+ assets = _u === void 0 ? {} : _u,
23253
+ _v = _a.classNames,
23254
+ classNames = _v === void 0 ? {} : _v,
23255
+ _w = _a.colors,
23256
+ colors = _w === void 0 ? {} : _w,
23257
+ _x = _a.verbiage,
23258
+ verbiage = _x === void 0 ? {} : _x,
23259
+ _y = _a.captureSignature,
23260
+ captureSignature = _y === void 0 ? false : _y,
23261
+ _z = _a.captureSignatureVideo,
23262
+ captureSignatureVideo = _z === void 0 ? false : _z,
23263
+ _0 = _a.captureAdditionalDocuments,
23264
+ captureAdditionalDocuments = _0 === void 0 ? [] : _0,
23265
+ _1 = _a.geolocationEnabled,
23266
+ geolocationEnabled = _1 === void 0 ? true : _1,
23267
+ _2 = _a.geolocationRequired,
23268
+ geolocationRequired = _2 === void 0 ? false : _2,
23269
+ _3 = _a.debugMode,
23270
+ debugMode = _3 === void 0 ? false : _3;
23246
23271
  useLanguage(lang);
23247
23272
  useDebugLogging(debugMode);
23248
23273
  var idCaptureProps = React.useMemo(function () {
@@ -23252,6 +23277,7 @@
23252
23277
  onModelError: onModelError,
23253
23278
  precapturedDocuments: precapturedDocuments,
23254
23279
  captureRequirement: idCaptureRequirement,
23280
+ allowSinglePageIdCapture: allowSinglePageIdCapture,
23255
23281
  separateIdCardCaptureSequence: separateIdCardCaptureSequence,
23256
23282
  thresholds: idCaptureThresholds,
23257
23283
  skipSuccessScreen: skipSuccessScreen,
@@ -23274,7 +23300,7 @@
23274
23300
  verbiage: verbiage,
23275
23301
  debugMode: debugMode
23276
23302
  };
23277
- }, [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]);
23303
+ }, [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]);
23278
23304
  var additionalDocumentCaptureProps = React.useMemo(function () {
23279
23305
  return {
23280
23306
  documents: captureAdditionalDocuments,
@@ -23499,35 +23525,37 @@
23499
23525
  idCaptureLoadingOverlayMode = _c === void 0 ? 'default' : _c,
23500
23526
  _d = _a.idCaptureRequirement,
23501
23527
  idCaptureRequirement = _d === void 0 ? 'idCardOrPassport' : _d,
23502
- _e = _a.idCaptureThresholds,
23503
- idCaptureThresholds = _e === void 0 ? defaultIdCaptureThresholds : _e,
23504
- _f = _a.faceLivenessLoadingOverlayMode,
23505
- faceLivenessLoadingOverlayMode = _f === void 0 ? 'default' : _f,
23506
- _g = _a.faceLivenessTimeoutDurationMs,
23507
- faceLivenessTimeoutDurationMs = _g === void 0 ? 15000 : _g,
23508
- _h = _a.skipSuccessScreen,
23509
- skipSuccessScreen = _h === void 0 ? false : _h,
23528
+ _e = _a.allowSinglePageIdCapture,
23529
+ allowSinglePageIdCapture = _e === void 0 ? false : _e,
23530
+ _f = _a.idCaptureThresholds,
23531
+ idCaptureThresholds = _f === void 0 ? defaultIdCaptureThresholds : _f,
23532
+ _g = _a.faceLivenessLoadingOverlayMode,
23533
+ faceLivenessLoadingOverlayMode = _g === void 0 ? 'default' : _g,
23534
+ _h = _a.faceLivenessTimeoutDurationMs,
23535
+ faceLivenessTimeoutDurationMs = _h === void 0 ? 15000 : _h,
23536
+ _j = _a.skipSuccessScreen,
23537
+ skipSuccessScreen = _j === void 0 ? false : _j,
23510
23538
  idCaptureInstructions = _a.idCaptureInstructions,
23511
- _j = _a.idCaptureGuideType,
23512
- idCaptureGuideType = _j === void 0 ? 'fit' : _j,
23513
- _k = _a.idCaptureGuideImages,
23514
- idCaptureGuideImages = _k === void 0 ? defaultIdCaptureGuideImages : _k,
23515
- _l = _a.idCapturePortraitGuidesOnMobile,
23516
- idCapturePortraitGuidesOnMobile = _l === void 0 ? true : _l,
23517
- _m = _a.idCaptureRotateLoadingOverlayImageWhenPortrait,
23518
- idCaptureRotateLoadingOverlayImageWhenPortrait = _m === void 0 ? true : _m,
23519
- _o = _a.idCaptureModelLoadTimeoutMs,
23520
- idCaptureModelLoadTimeoutMs = _o === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _o,
23521
- _p = _a.idCaptureForceFallbackMode,
23522
- idCaptureForceFallbackMode = _p === void 0 ? false : _p,
23523
- _q = _a.selfieCaptureModelLoadTimeoutMs,
23524
- selfieCaptureModelLoadTimeoutMs = _q === void 0 ? defaultSelfieCaptureModelLoadTimeoutMs : _q,
23525
- _r = _a.allowIdCardBackToFrontCapture,
23526
- allowIdCardBackToFrontCapture = _r === void 0 ? false : _r,
23527
- _s = _a.enableOverrideWrongDocumentTypeDialog,
23528
- enableOverrideWrongDocumentTypeDialog = _s === void 0 ? false : _s,
23529
- _t = _a.allowOverrideWrongDocumentTypeAfterMs,
23530
- allowOverrideWrongDocumentTypeAfterMs = _t === void 0 ? 8000 : _t,
23539
+ _k = _a.idCaptureGuideType,
23540
+ idCaptureGuideType = _k === void 0 ? 'fit' : _k,
23541
+ _l = _a.idCaptureGuideImages,
23542
+ idCaptureGuideImages = _l === void 0 ? defaultIdCaptureGuideImages : _l,
23543
+ _m = _a.idCapturePortraitGuidesOnMobile,
23544
+ idCapturePortraitGuidesOnMobile = _m === void 0 ? true : _m,
23545
+ _o = _a.idCaptureRotateLoadingOverlayImageWhenPortrait,
23546
+ idCaptureRotateLoadingOverlayImageWhenPortrait = _o === void 0 ? true : _o,
23547
+ _p = _a.idCaptureModelLoadTimeoutMs,
23548
+ idCaptureModelLoadTimeoutMs = _p === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _p,
23549
+ _q = _a.idCaptureForceFallbackMode,
23550
+ idCaptureForceFallbackMode = _q === void 0 ? false : _q,
23551
+ _r = _a.selfieCaptureModelLoadTimeoutMs,
23552
+ selfieCaptureModelLoadTimeoutMs = _r === void 0 ? defaultSelfieCaptureModelLoadTimeoutMs : _r,
23553
+ _s = _a.allowIdCardBackToFrontCapture,
23554
+ allowIdCardBackToFrontCapture = _s === void 0 ? false : _s,
23555
+ _t = _a.enableOverrideWrongDocumentTypeDialog,
23556
+ enableOverrideWrongDocumentTypeDialog = _t === void 0 ? false : _t,
23557
+ _u = _a.allowOverrideWrongDocumentTypeAfterMs,
23558
+ allowOverrideWrongDocumentTypeAfterMs = _u === void 0 ? 8000 : _u,
23531
23559
  onBeforeDocumentUpload = _a.onBeforeDocumentUpload,
23532
23560
  onDocumentUploaded = _a.onDocumentUploaded,
23533
23561
  onDocumentUploadProgress = _a.onDocumentUploadProgress,
@@ -23544,28 +23572,28 @@
23544
23572
  onIdCaptureModelError = _a.onIdCaptureModelError,
23545
23573
  onSelfieCaptureModelError = _a.onSelfieCaptureModelError,
23546
23574
  onCameraAccessDenied = _a.onCameraAccessDenied,
23547
- _u = _a.captureSignature,
23548
- captureSignature = _u === void 0 ? false : _u,
23549
- _v = _a.captureSignatureVideo,
23550
- captureSignatureVideo = _v === void 0 ? false : _v,
23551
- _w = _a.captureAdditionalDocuments,
23552
- captureAdditionalDocuments = _w === void 0 ? [] : _w,
23553
- _x = _a.theme,
23554
- theme = _x === void 0 ? 'default' : _x,
23555
- _y = _a.assets,
23556
- assets = _y === void 0 ? {} : _y,
23557
- _z = _a.classNames,
23558
- classNames = _z === void 0 ? {} : _z,
23559
- _0 = _a.colors,
23560
- colors = _0 === void 0 ? {} : _0,
23561
- _1 = _a.verbiage,
23562
- verbiage = _1 === void 0 ? {} : _1,
23563
- _2 = _a.geolocationEnabled,
23564
- geolocationEnabled = _2 === void 0 ? true : _2,
23565
- _3 = _a.geolocationRequired,
23566
- geolocationRequired = _3 === void 0 ? false : _3,
23567
- _4 = _a.debugMode,
23568
- debugMode = _4 === void 0 ? false : _4;
23575
+ _v = _a.captureSignature,
23576
+ captureSignature = _v === void 0 ? false : _v,
23577
+ _w = _a.captureSignatureVideo,
23578
+ captureSignatureVideo = _w === void 0 ? false : _w,
23579
+ _x = _a.captureAdditionalDocuments,
23580
+ captureAdditionalDocuments = _x === void 0 ? [] : _x,
23581
+ _y = _a.theme,
23582
+ theme = _y === void 0 ? 'default' : _y,
23583
+ _z = _a.assets,
23584
+ assets = _z === void 0 ? {} : _z,
23585
+ _0 = _a.classNames,
23586
+ classNames = _0 === void 0 ? {} : _0,
23587
+ _1 = _a.colors,
23588
+ colors = _1 === void 0 ? {} : _1,
23589
+ _2 = _a.verbiage,
23590
+ verbiage = _2 === void 0 ? {} : _2,
23591
+ _3 = _a.geolocationEnabled,
23592
+ geolocationEnabled = _3 === void 0 ? true : _3,
23593
+ _4 = _a.geolocationRequired,
23594
+ geolocationRequired = _4 === void 0 ? false : _4,
23595
+ _5 = _a.debugMode,
23596
+ debugMode = _5 === void 0 ? false : _5;
23569
23597
  useLanguage(lang);
23570
23598
  useDebugLogging(debugMode);
23571
23599
  var idCaptureProps = React.useMemo(function () {
@@ -23579,6 +23607,7 @@
23579
23607
  verbiage: verbiage.idCapture,
23580
23608
  precapturedDocuments: precapturedDocuments,
23581
23609
  captureRequirement: idCaptureRequirement,
23610
+ allowSinglePageIdCapture: allowSinglePageIdCapture,
23582
23611
  thresholds: idCaptureThresholds,
23583
23612
  loadingOverlayMode: idCaptureLoadingOverlayMode,
23584
23613
  instructions: idCaptureInstructions,
@@ -23594,7 +23623,7 @@
23594
23623
  skipSuccessScreen: skipSuccessScreen,
23595
23624
  debugMode: debugMode
23596
23625
  };
23597
- }, [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]);
23626
+ }, [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]);
23598
23627
  var faceLivenessProps = React.useMemo(function () {
23599
23628
  return {
23600
23629
  loadingOverlayMode: faceLivenessLoadingOverlayMode,
@@ -23736,35 +23765,37 @@
23736
23765
  idCaptureLoadingOverlayMode = _c === void 0 ? 'default' : _c,
23737
23766
  _d = _a.idCaptureRequirement,
23738
23767
  idCaptureRequirement = _d === void 0 ? 'idCardOrPassport' : _d,
23739
- _e = _a.idCaptureThresholds,
23740
- idCaptureThresholds = _e === void 0 ? defaultIdCaptureThresholds : _e,
23741
- _f = _a.faceLivenessTimeoutDurationMs,
23742
- faceLivenessTimeoutDurationMs = _f === void 0 ? 15000 : _f,
23743
- _g = _a.faceLivenessLoadingOverlayMode,
23744
- faceLivenessLoadingOverlayMode = _g === void 0 ? 'default' : _g,
23745
- _h = _a.skipSuccessScreen,
23746
- skipSuccessScreen = _h === void 0 ? false : _h,
23768
+ _e = _a.allowSinglePageIdCapture,
23769
+ allowSinglePageIdCapture = _e === void 0 ? false : _e,
23770
+ _f = _a.idCaptureThresholds,
23771
+ idCaptureThresholds = _f === void 0 ? defaultIdCaptureThresholds : _f,
23772
+ _g = _a.faceLivenessTimeoutDurationMs,
23773
+ faceLivenessTimeoutDurationMs = _g === void 0 ? 15000 : _g,
23774
+ _h = _a.faceLivenessLoadingOverlayMode,
23775
+ faceLivenessLoadingOverlayMode = _h === void 0 ? 'default' : _h,
23776
+ _j = _a.skipSuccessScreen,
23777
+ skipSuccessScreen = _j === void 0 ? false : _j,
23747
23778
  idCaptureInstructions = _a.idCaptureInstructions,
23748
- _j = _a.idCaptureGuideType,
23749
- idCaptureGuideType = _j === void 0 ? 'fit' : _j,
23750
- _k = _a.idCaptureGuideImages,
23751
- idCaptureGuideImages = _k === void 0 ? defaultIdCaptureGuideImages : _k,
23752
- _l = _a.idCapturePortraitGuidesOnMobile,
23753
- idCapturePortraitGuidesOnMobile = _l === void 0 ? true : _l,
23754
- _m = _a.idCaptureRotateLoadingOverlayImageWhenPortrait,
23755
- idCaptureRotateLoadingOverlayImageWhenPortrait = _m === void 0 ? true : _m,
23756
- _o = _a.idCaptureModelLoadTimeoutMs,
23757
- idCaptureModelLoadTimeoutMs = _o === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _o,
23758
- _p = _a.idCaptureForceFallbackMode,
23759
- idCaptureForceFallbackMode = _p === void 0 ? false : _p,
23760
- _q = _a.selfieCaptureModelLoadTimeoutMs,
23761
- selfieCaptureModelLoadTimeoutMs = _q === void 0 ? defaultSelfieCaptureModelLoadTimeoutMs : _q,
23762
- _r = _a.allowIdCardBackToFrontCapture,
23763
- allowIdCardBackToFrontCapture = _r === void 0 ? false : _r,
23764
- _s = _a.enableOverrideWrongDocumentTypeDialog,
23765
- enableOverrideWrongDocumentTypeDialog = _s === void 0 ? false : _s,
23766
- _t = _a.allowOverrideWrongDocumentTypeAfterMs,
23767
- allowOverrideWrongDocumentTypeAfterMs = _t === void 0 ? 8000 : _t,
23779
+ _k = _a.idCaptureGuideType,
23780
+ idCaptureGuideType = _k === void 0 ? 'fit' : _k,
23781
+ _l = _a.idCaptureGuideImages,
23782
+ idCaptureGuideImages = _l === void 0 ? defaultIdCaptureGuideImages : _l,
23783
+ _m = _a.idCapturePortraitGuidesOnMobile,
23784
+ idCapturePortraitGuidesOnMobile = _m === void 0 ? true : _m,
23785
+ _o = _a.idCaptureRotateLoadingOverlayImageWhenPortrait,
23786
+ idCaptureRotateLoadingOverlayImageWhenPortrait = _o === void 0 ? true : _o,
23787
+ _p = _a.idCaptureModelLoadTimeoutMs,
23788
+ idCaptureModelLoadTimeoutMs = _p === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _p,
23789
+ _q = _a.idCaptureForceFallbackMode,
23790
+ idCaptureForceFallbackMode = _q === void 0 ? false : _q,
23791
+ _r = _a.selfieCaptureModelLoadTimeoutMs,
23792
+ selfieCaptureModelLoadTimeoutMs = _r === void 0 ? defaultSelfieCaptureModelLoadTimeoutMs : _r,
23793
+ _s = _a.allowIdCardBackToFrontCapture,
23794
+ allowIdCardBackToFrontCapture = _s === void 0 ? false : _s,
23795
+ _t = _a.enableOverrideWrongDocumentTypeDialog,
23796
+ enableOverrideWrongDocumentTypeDialog = _t === void 0 ? false : _t,
23797
+ _u = _a.allowOverrideWrongDocumentTypeAfterMs,
23798
+ allowOverrideWrongDocumentTypeAfterMs = _u === void 0 ? 8000 : _u,
23768
23799
  onBeforeDocumentUpload = _a.onBeforeDocumentUpload,
23769
23800
  onDocumentUploadProgress = _a.onDocumentUploadProgress,
23770
23801
  onDocumentUploaded = _a.onDocumentUploaded,
@@ -23780,31 +23811,31 @@
23780
23811
  onIdCaptureModelError = _a.onIdCaptureModelError,
23781
23812
  onSelfieCaptureModelError = _a.onSelfieCaptureModelError,
23782
23813
  onCameraAccessDenied = _a.onCameraAccessDenied,
23783
- _u = _a.captureSignature,
23784
- captureSignature = _u === void 0 ? false : _u,
23785
- _v = _a.captureSignatureVideo,
23786
- captureSignatureVideo = _v === void 0 ? false : _v,
23787
- _w = _a.captureAdditionalDocuments,
23788
- captureAdditionalDocuments = _w === void 0 ? [] : _w,
23789
- _x = _a.captureVideoId,
23790
- captureVideoId = _x === void 0 ? false : _x,
23814
+ _v = _a.captureSignature,
23815
+ captureSignature = _v === void 0 ? false : _v,
23816
+ _w = _a.captureSignatureVideo,
23817
+ captureSignatureVideo = _w === void 0 ? false : _w,
23818
+ _x = _a.captureAdditionalDocuments,
23819
+ captureAdditionalDocuments = _x === void 0 ? [] : _x,
23820
+ _y = _a.captureVideoId,
23821
+ captureVideoId = _y === void 0 ? false : _y,
23791
23822
  captureVideoIdProps = _a.captureVideoIdProps,
23792
- _y = _a.theme,
23793
- theme = _y === void 0 ? 'default' : _y,
23794
- _z = _a.assets,
23795
- assets = _z === void 0 ? {} : _z,
23796
- _0 = _a.classNames,
23797
- classNames = _0 === void 0 ? {} : _0,
23798
- _1 = _a.colors,
23799
- colors = _1 === void 0 ? {} : _1,
23800
- _2 = _a.verbiage,
23801
- verbiage = _2 === void 0 ? {} : _2,
23802
- _3 = _a.geolocationEnabled,
23803
- geolocationEnabled = _3 === void 0 ? true : _3,
23804
- _4 = _a.geolocationRequired,
23805
- geolocationRequired = _4 === void 0 ? false : _4,
23806
- _5 = _a.debugMode,
23807
- debugMode = _5 === void 0 ? false : _5;
23823
+ _z = _a.theme,
23824
+ theme = _z === void 0 ? 'default' : _z,
23825
+ _0 = _a.assets,
23826
+ assets = _0 === void 0 ? {} : _0,
23827
+ _1 = _a.classNames,
23828
+ classNames = _1 === void 0 ? {} : _1,
23829
+ _2 = _a.colors,
23830
+ colors = _2 === void 0 ? {} : _2,
23831
+ _3 = _a.verbiage,
23832
+ verbiage = _3 === void 0 ? {} : _3,
23833
+ _4 = _a.geolocationEnabled,
23834
+ geolocationEnabled = _4 === void 0 ? true : _4,
23835
+ _5 = _a.geolocationRequired,
23836
+ geolocationRequired = _5 === void 0 ? false : _5,
23837
+ _6 = _a.debugMode,
23838
+ debugMode = _6 === void 0 ? false : _6;
23808
23839
  useLanguage(lang);
23809
23840
  useDebugLogging(debugMode);
23810
23841
  var idCaptureProps = React.useMemo(function () {
@@ -23814,6 +23845,7 @@
23814
23845
  colors: colors.idCapture,
23815
23846
  verbiage: verbiage.idCapture,
23816
23847
  captureRequirement: idCaptureRequirement,
23848
+ allowSinglePageIdCapture: allowSinglePageIdCapture,
23817
23849
  thresholds: idCaptureThresholds,
23818
23850
  loadingOverlayMode: idCaptureLoadingOverlayMode,
23819
23851
  instructions: idCaptureInstructions,
@@ -23832,7 +23864,7 @@
23832
23864
  skipSuccessScreen: skipSuccessScreen,
23833
23865
  debugMode: debugMode
23834
23866
  };
23835
- }, [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]);
23867
+ }, [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]);
23836
23868
  var faceLivenessProps = React.useMemo(function () {
23837
23869
  return {
23838
23870
  onExitCapture: onExitCapture,