idmission-web-sdk 2.2.66 → 2.2.67

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 (38) hide show
  1. package/dist/components/CompositeWizard.d.ts.map +1 -1
  2. package/dist/components/customer_flows/IdValidation.d.ts +1 -3
  3. package/dist/components/customer_flows/IdValidation.d.ts.map +1 -1
  4. package/dist/components/fallback_flows/IdCapture.d.ts.map +1 -1
  5. package/dist/components/id_capture/CapturedDocuments.d.ts +1 -1
  6. package/dist/components/id_capture/CapturedDocuments.d.ts.map +1 -1
  7. package/dist/components/id_capture/IdCapture.d.ts +2 -2
  8. package/dist/components/id_capture/IdCapture.d.ts.map +1 -1
  9. package/dist/components/id_capture/IdCaptureModelsProvider.d.ts +1 -2
  10. package/dist/components/id_capture/IdCaptureModelsProvider.d.ts.map +1 -1
  11. package/dist/components/id_capture/IdCaptureRequirementOption.d.ts +5 -7
  12. package/dist/components/id_capture/IdCaptureRequirementOption.d.ts.map +1 -1
  13. package/dist/components/id_capture/IdCaptureStateProvider.d.ts +0 -4
  14. package/dist/components/id_capture/IdCaptureStateProvider.d.ts.map +1 -1
  15. package/dist/components/id_capture/IdCaptureSuccess.d.ts +4 -0
  16. package/dist/components/id_capture/IdCaptureSuccess.d.ts.map +1 -1
  17. package/dist/components/id_capture/IdCaptureWizard.d.ts +1 -2
  18. package/dist/components/id_capture/IdCaptureWizard.d.ts.map +1 -1
  19. package/dist/components/video_id/IdVideoCapture.d.ts +0 -2
  20. package/dist/components/video_id/IdVideoCapture.d.ts.map +1 -1
  21. package/dist/components/video_id/IdVideoCaptureWizard.d.ts.map +1 -1
  22. package/dist/lib/models/DocumentDetection.d.ts +2 -6
  23. package/dist/lib/models/DocumentDetection.d.ts.map +1 -1
  24. package/dist/lib/models/Focus.d.ts +0 -4
  25. package/dist/lib/models/Focus.d.ts.map +1 -1
  26. package/dist/lib/models/defaults/DocumentDetector.d.ts +1 -1
  27. package/dist/sdk2.cjs.development.js +327 -353
  28. package/dist/sdk2.cjs.development.js.map +1 -1
  29. package/dist/sdk2.cjs.production.js +1 -1
  30. package/dist/sdk2.cjs.production.js.map +1 -1
  31. package/dist/sdk2.esm.js +327 -353
  32. package/dist/sdk2.esm.js.map +1 -1
  33. package/dist/sdk2.umd.development.js +327 -353
  34. package/dist/sdk2.umd.development.js.map +1 -1
  35. package/dist/sdk2.umd.production.js +1 -1
  36. package/dist/sdk2.umd.production.js.map +1 -1
  37. package/dist/version.d.ts +1 -1
  38. package/package.json +1 -1
@@ -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.66';
214
+ var webSdkVersion = '2.2.67';
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-20241212_131026.tflite");
8342
+ var defaultDocumentDetectorModelPath = "".concat(DEFAULT_CDN_URL, "/models/DocumentDetector/DocumentDetector-20241018_093000.tflite");
8343
8343
 
8344
8344
  var defaultFocusModelPath = "".concat(DEFAULT_CDN_URL, "/models/Focus/Focus-20241008_102708.tflite");
8345
8345
 
@@ -8358,10 +8358,6 @@
8358
8358
  passport: {
8359
8359
  desktop: 0,
8360
8360
  mobile: 0.3
8361
- },
8362
- singlePage: {
8363
- desktop: 0,
8364
- mobile: 0.3
8365
8361
  }
8366
8362
  };
8367
8363
  var classifier = null;
@@ -8987,19 +8983,16 @@
8987
8983
  idCardFront: 0.6,
8988
8984
  idCardBack: 0.6,
8989
8985
  passport: 0.4,
8990
- singlePage: 0.4,
8991
8986
  stability: {
8992
8987
  idCardFront: 0.85,
8993
8988
  idCardBack: 0.85,
8994
- passport: 0.5,
8995
- singlePage: 0.5
8989
+ passport: 0.5
8996
8990
  }
8997
8991
  };
8998
8992
  var documentTypeDisplayNames = {
8999
8993
  idCardFront: 'ID card front',
9000
8994
  idCardBack: 'ID card back',
9001
8995
  passport: 'Passport',
9002
- singlePage: 'Single page',
9003
8996
  none: 'None'
9004
8997
  };
9005
8998
  var detector = null;
@@ -9188,7 +9181,7 @@
9188
9181
  right: 20
9189
9182
  };
9190
9183
  function processDocumentDetectorPrediction(prediction, thresholds, boundaries) {
9191
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
9184
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
9192
9185
  if (boundaries === void 0) {
9193
9186
  boundaries = defaultDocumentDetectionBoundaries;
9194
9187
  }
@@ -9239,25 +9232,18 @@
9239
9232
  var bestPassportPage = detectedObjects.find(function (obj) {
9240
9233
  return obj.label === 'Passport page';
9241
9234
  });
9242
- var bestSinglePage = detectedObjects.find(function (obj) {
9243
- return obj.label === 'Single page';
9244
- });
9245
9235
  var idCardFrontDetectionScore = (_e = bestIdCardFront === null || bestIdCardFront === void 0 ? void 0 : bestIdCardFront.score) !== null && _e !== void 0 ? _e : 0;
9246
9236
  var idCardBackDetectionScore = (_f = bestIdCardBack === null || bestIdCardBack === void 0 ? void 0 : bestIdCardBack.score) !== null && _f !== void 0 ? _f : 0;
9247
9237
  var passportDetectionScore = (_g = bestPassportPage === null || bestPassportPage === void 0 ? void 0 : bestPassportPage.score) !== null && _g !== void 0 ? _g : 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;
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;
9256
9244
  var detectionThresholdMet = detectionScore >= (detectionThreshold !== null && detectionThreshold !== void 0 ? detectionThreshold : 0);
9257
9245
  var detectedDocumentType = 'none';
9258
- if (singlePageDetectionThresholdMet) {
9259
- detectedDocumentType = 'singlePage';
9260
- } else if (passportDetectionThresholdMet) {
9246
+ if (passportDetectionThresholdMet) {
9261
9247
  detectedDocumentType = 'passport';
9262
9248
  } else if (idCardBackDetectionThresholdMet) {
9263
9249
  detectedDocumentType = 'idCardBack';
@@ -9271,12 +9257,12 @@
9271
9257
  var documentIsStable = false;
9272
9258
  var documentTooClose = false;
9273
9259
  if (bestDocument) {
9274
- var _q = [bestDocument.box.width / frameWidth, bestDocument.box.height / frameHeight],
9275
- docWidth = _q[0],
9276
- docHeight = _q[1];
9260
+ var _o = [bestDocument.box.width / frameWidth, bestDocument.box.height / frameHeight],
9261
+ docWidth = _o[0],
9262
+ docHeight = _o[1];
9277
9263
  documentTooClose = docWidth > 0.85 || docHeight > 0.85;
9278
9264
  if (detectionThresholdMet && documentInBounds && !documentTooClose) {
9279
- var thresholdSet = (_p = thresholds.stability) !== null && _p !== void 0 ? _p : defaultDocumentDetectionThresholds.stability;
9265
+ var thresholdSet = (_m = thresholds.stability) !== null && _m !== void 0 ? _m : defaultDocumentDetectionThresholds.stability;
9280
9266
  var threshold_1 = thresholdSet[detectedDocumentType];
9281
9267
  var framesNeeded = Math.ceil(average(framesNeededSamples));
9282
9268
  trackBox(bestDocument.box, framesNeeded);
@@ -9298,8 +9284,6 @@
9298
9284
  idCardBackDetectionThresholdMet: idCardBackDetectionThresholdMet,
9299
9285
  passportDetectionScore: passportDetectionScore,
9300
9286
  passportDetectionThresholdMet: passportDetectionThresholdMet,
9301
- singlePageDetectionScore: singlePageDetectionScore,
9302
- singlePageDetectionThresholdMet: singlePageDetectionThresholdMet,
9303
9287
  bestDocument: bestDocument,
9304
9288
  documentInBounds: documentInBounds,
9305
9289
  documentTooClose: documentTooClose,
@@ -10246,39 +10230,37 @@
10246
10230
  });
10247
10231
  function IdCaptureModelsProviderInner(_a) {
10248
10232
  var children = _a.children,
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;
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;
10274
10256
  var onPredictionHandler = React.useRef();
10275
10257
  var bestFrameDetails = React.useRef(null);
10276
10258
  var bestPredictionCanvas = React.useRef(null);
10277
10259
  var bestFocusScore = React.useRef(0);
10278
10260
  var stopDetection = React.useRef(0);
10279
- var _e = React.useState('none'),
10280
- requiredDocumentType = _e[0],
10281
- setRequiredDocumentType = _e[1];
10261
+ var _d = React.useState('none'),
10262
+ requiredDocumentType = _d[0],
10263
+ setRequiredDocumentType = _d[1];
10282
10264
  var thresholds = React.useMemo(function () {
10283
10265
  return _assign(_assign({}, documentDetectionThresholds), {
10284
10266
  focus: focusThresholds
@@ -10296,42 +10278,34 @@
10296
10278
  var _this = this;
10297
10279
  onDocumentDetected(function (prediction) {
10298
10280
  return __awaiter(_this, void 0, void 0, function () {
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) {
10281
+ var stopDetectionAtStart, focusPredictionTime, focusScore, focusThresholdMet, isRequiredDocumentType, focusPrediction, focusThresholdSet, focusThreshold;
10282
+ var _a, _b, _c, _d, _e, _f;
10283
+ return __generator(this, function (_g) {
10302
10284
  if (!lastPredictionCanvas.current) return [2 /*return*/];
10303
10285
  stopDetectionAtStart = stopDetection.current;
10304
10286
  focusPredictionTime = 0, focusScore = 0, focusThresholdMet = false;
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'));
10287
+ isRequiredDocumentType = requiredDocumentType === 'none' || prediction.detectedDocumentType === requiredDocumentType || ((_a = requiredDocumentType.includes) === null || _a === void 0 ? void 0 : _a.call(requiredDocumentType, prediction.detectedDocumentType));
10314
10288
  if (isRequiredDocumentType && prediction.detectedDocumentType !== 'none' && prediction.detectionThresholdMet && prediction.documentInBounds && !prediction.documentTooClose && prediction.documentIsStable) {
10315
- focusPrediction = makeFocusPrediction(lastPredictionCanvas.current, (_c = prediction.bestDocument) === null || _c === void 0 ? void 0 : _c.box);
10289
+ focusPrediction = makeFocusPrediction(lastPredictionCanvas.current, (_b = prediction.bestDocument) === null || _b === void 0 ? void 0 : _b.box);
10316
10290
  if (focusPrediction) {
10317
10291
  focusScore = focusPrediction.score;
10318
10292
  focusPredictionTime = focusPrediction.predictionTime;
10319
10293
  }
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;
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;
10322
10296
  focusThresholdMet = focusScore >= focusThreshold;
10323
10297
  if (bestFocusScore.current <= focusScore && stopDetectionAtStart === stopDetection.current) {
10324
10298
  bestFocusScore.current = focusScore;
10325
10299
  drawToCanvas(bestPredictionCanvas.current, lastPredictionCanvas.current);
10326
10300
  bestFrameDetails.current = {
10327
- boundingBox: (_f = prediction.bestDocument) === null || _f === void 0 ? void 0 : _f.box,
10301
+ boundingBox: (_e = prediction.bestDocument) === null || _e === void 0 ? void 0 : _e.box,
10328
10302
  documentType: prediction.detectedDocumentType,
10329
10303
  detectionScore: prediction.detectionScore,
10330
10304
  focusScore: focusScore
10331
10305
  };
10332
10306
  }
10333
10307
  }
10334
- (_g = onPredictionHandler.current) === null || _g === void 0 ? void 0 : _g.call(onPredictionHandler, _assign(_assign({}, prediction), {
10308
+ (_f = onPredictionHandler.current) === null || _f === void 0 ? void 0 : _f.call(onPredictionHandler, _assign(_assign({}, prediction), {
10335
10309
  focusScore: focusScore,
10336
10310
  focusPredictionTime: focusPredictionTime,
10337
10311
  focusThresholdMet: focusThresholdMet
@@ -10340,7 +10314,7 @@
10340
10314
  });
10341
10315
  });
10342
10316
  });
10343
- }, [allowSinglePageIdCapture, lastPredictionCanvas, makeFocusPrediction, onDocumentDetected, requiredDocumentType, thresholds.focus]);
10317
+ }, [lastPredictionCanvas, makeFocusPrediction, onDocumentDetected, requiredDocumentType, thresholds.focus]);
10344
10318
  var modelError = documentDetectionModelError !== null && documentDetectionModelError !== void 0 ? documentDetectionModelError : focusModelError;
10345
10319
  React.useEffect(function handleModelErrors() {
10346
10320
  if (modelError) onModelError === null || onModelError === void 0 ? void 0 : onModelError(modelError);
@@ -10354,9 +10328,9 @@
10354
10328
  canvas: bestPredictionCanvas.current
10355
10329
  });
10356
10330
  }, []);
10357
- var _f = React.useState(0),
10358
- canvasKey = _f[0],
10359
- setCanvasKey = _f[1];
10331
+ var _e = React.useState(0),
10332
+ canvasKey = _e[0],
10333
+ setCanvasKey = _e[1];
10360
10334
  var resetBestFrame = React.useCallback(function () {
10361
10335
  stopDetection.current += 1;
10362
10336
  setCanvasKey(function (n) {
@@ -10486,9 +10460,9 @@
10486
10460
  });
10487
10461
  }
10488
10462
 
10489
- var CapturedDocumentTypeValues = ['idCardFront', 'idCardBack', 'passport', 'singlePage', 'selfie'];
10463
+ var CapturedDocumentTypeValues = ['idCardFront', 'idCardBack', 'passport', 'selfie'];
10490
10464
 
10491
- var acceptedDocumentTypesForIdCaptureRequirementOption = {
10465
+ var requiredDocumentsForOption = {
10492
10466
  idCardFront: ['idCardFront'],
10493
10467
  idCardBack: ['idCardBack'],
10494
10468
  passport: ['passport'],
@@ -10496,31 +10470,13 @@
10496
10470
  idCardAndPassport: ['idCardFront', 'idCardBack', 'passport'],
10497
10471
  idCardOrPassport: ['idCardFront', 'idCardBack', 'passport'] // this one is so weird
10498
10472
  };
10499
- function minImageCountForIdCaptureRequirementOption(idCaptureRequirement) {
10473
+ function requiredImageCountForOption(idCaptureRequirement) {
10500
10474
  if (idCaptureRequirement === 'idCardOrPassport') return 1;
10501
- return acceptedDocumentTypesForIdCaptureRequirementOption[idCaptureRequirement].length;
10475
+ return requiredDocumentsForOption[idCaptureRequirement].length;
10502
10476
  }
10503
- function maxImageCountForIdCaptureRequirementOption(idCaptureRequirement) {
10477
+ function allowedImageCountForOption(idCaptureRequirement) {
10504
10478
  if (idCaptureRequirement === 'idCardOrPassport') return 2;
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
- });
10479
+ return requiredImageCountForOption(idCaptureRequirement);
10524
10480
  }
10525
10481
 
10526
10482
  var initialState$4 = {
@@ -10559,8 +10515,6 @@
10559
10515
  idCardBackDetectionThresholdMet: false,
10560
10516
  passportDetectionScore: 0,
10561
10517
  passportDetectionThresholdMet: false,
10562
- singlePageDetectionScore: 0,
10563
- singlePageDetectionThresholdMet: false,
10564
10518
  focusScore: 0,
10565
10519
  focusThresholdMet: false,
10566
10520
  isGoodFrame: false,
@@ -10576,7 +10530,6 @@
10576
10530
  capturedDocuments: {},
10577
10531
  captureRequirement: 'idCardOrPassport',
10578
10532
  requestedDocumentType: 'idCardFront',
10579
- allowSinglePageIdCapture: false,
10580
10533
  allowIdCardBackToFrontCapture: false,
10581
10534
  operationStartedAt: null,
10582
10535
  captureStartedAt: null
@@ -10591,13 +10544,11 @@
10591
10544
  var _c = action.payload,
10592
10545
  captureRequirement = _c.captureRequirement,
10593
10546
  precapturedDocuments = _c.precapturedDocuments,
10594
- allowSinglePageIdCapture = _c.allowSinglePageIdCapture,
10595
10547
  allowIdCardBackToFrontCapture = _c.allowIdCardBackToFrontCapture,
10596
10548
  enableOverrideWrongDocumentTypeDialog = _c.enableOverrideWrongDocumentTypeDialog,
10597
10549
  allowOverrideWrongDocumentTypeAfterMs = _c.allowOverrideWrongDocumentTypeAfterMs;
10598
10550
  var newState = _assign(_assign({}, state), {
10599
10551
  captureRequirement: captureRequirement,
10600
- allowSinglePageIdCapture: allowSinglePageIdCapture !== null && allowSinglePageIdCapture !== void 0 ? allowSinglePageIdCapture : false,
10601
10552
  allowIdCardBackToFrontCapture: allowIdCardBackToFrontCapture !== null && allowIdCardBackToFrontCapture !== void 0 ? allowIdCardBackToFrontCapture : false,
10602
10553
  enableOverrideWrongDocumentTypeDialog: enableOverrideWrongDocumentTypeDialog,
10603
10554
  allowOverrideWrongDocumentTypeAfterMs: allowOverrideWrongDocumentTypeAfterMs
@@ -10665,8 +10616,6 @@
10665
10616
  idCardBackDetectionThresholdMet = _d.idCardBackDetectionThresholdMet,
10666
10617
  passportDetectionScore = _d.passportDetectionScore,
10667
10618
  passportDetectionThresholdMet = _d.passportDetectionThresholdMet,
10668
- singlePageDetectionScore = _d.singlePageDetectionScore,
10669
- singlePageDetectionThresholdMet = _d.singlePageDetectionThresholdMet,
10670
10619
  bestDocument = _d.bestDocument,
10671
10620
  documentInBounds = _d.documentInBounds,
10672
10621
  documentTooClose = _d.documentTooClose,
@@ -10687,8 +10636,7 @@
10687
10636
  }
10688
10637
  }
10689
10638
  }
10690
- var idCardDetected = detectedDocumentType.includes('idCard') || detectedDocumentType === 'singlePage';
10691
- var idCardDetectedButNotAllowed = idCardDetected && !state.captureRequirement.includes('idCard');
10639
+ var idCardDetectedButNotAllowed = detectedDocumentType.includes('idCard') && !state.captureRequirement.includes('idCard');
10692
10640
  var passportNotAllowed = !state.captureRequirement.toLowerCase().includes('passport');
10693
10641
  var idCardFrontWasCaptured = 'idCardFront' in state.capturedDocuments;
10694
10642
  var idCardBackWasCaptured = 'idCardBack' in state.capturedDocuments;
@@ -10748,8 +10696,6 @@
10748
10696
  idCardBackDetectionThresholdMet: idCardBackDetectionThresholdMet,
10749
10697
  passportDetectionScore: passportDetectionScore,
10750
10698
  passportDetectionThresholdMet: passportDetectionThresholdMet,
10751
- singlePageDetectionScore: singlePageDetectionScore,
10752
- singlePageDetectionThresholdMet: singlePageDetectionThresholdMet,
10753
10699
  focusScore: focusScore,
10754
10700
  focusThresholdMet: focusThresholdMet,
10755
10701
  isGoodFrame: isGoodFrame,
@@ -10787,7 +10733,7 @@
10787
10733
  });
10788
10734
  case 'documentCaptured':
10789
10735
  {
10790
- var newState = _assign(_assign({}, state), {
10736
+ var newState_1 = _assign(_assign({}, state), {
10791
10737
  capturing: false,
10792
10738
  captureFailed: false,
10793
10739
  allowOverrideFlipRequirement: false,
@@ -10796,42 +10742,64 @@
10796
10742
  wrongDocumentTypePredictions: 0,
10797
10743
  capturedDocuments: _assign(_assign({}, state.capturedDocuments), (_a = {}, _a[action.payload.documentType] = action.payload, _a))
10798
10744
  });
10799
- var remainingRequirements = remainingIdCaptureRequirements(state.captureRequirement, newState.capturedDocuments, state.requestedDocumentType);
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
+ }
10800
10757
  if (remainingRequirements.length === 0) {
10801
- newState.captureState = 'complete';
10758
+ newState_1.captureState = 'complete';
10802
10759
  } else {
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;
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;
10810
10767
  }
10811
10768
  }
10812
- return newState;
10769
+ return newState_1;
10813
10770
  }
10814
10771
  case 'documentCapturedManually':
10815
10772
  {
10816
- var newState = _assign(_assign({}, state), {
10773
+ var newState_2 = _assign(_assign({}, state), {
10817
10774
  capturedDocuments: _assign(_assign({}, state.capturedDocuments), (_b = {}, _b[state.requestedDocumentType] = _assign(_assign({}, action.payload), {
10818
10775
  width: 0,
10819
10776
  height: 0
10820
10777
  }), _b))
10821
10778
  });
10822
- var remainingRequirements = remainingIdCaptureRequirements(state.captureRequirement, newState.capturedDocuments, state.requestedDocumentType);
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
+ }
10823
10791
  if (remainingRequirements.length === 0) {
10824
- newState.captureState = 'complete';
10792
+ newState_2.captureState = 'complete';
10825
10793
  } else {
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;
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;
10832
10800
  }
10833
10801
  }
10834
- return newState;
10802
+ return newState_2;
10835
10803
  }
10836
10804
  case 'flipRequestCompleted':
10837
10805
  return _assign(_assign({}, state), {
@@ -14222,7 +14190,7 @@
14222
14190
  imageUrl: imageUrl
14223
14191
  }
14224
14192
  });
14225
- var capturedDocumentType = documentType;
14193
+ var capturedDocumentType = documentType === 'passport' ? 'passport' : state.requestedDocumentType;
14226
14194
  setTimeout(function () {
14227
14195
  var _a;
14228
14196
  var captureTime = new Date().getTime() - ((_a = state.captureStartedAt) !== null && _a !== void 0 ? _a : new Date()).getTime();
@@ -14289,7 +14257,7 @@
14289
14257
  scaling: debugScalingDetails,
14290
14258
  flipX: !isRearFacing
14291
14259
  });
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")))));
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")))));
14293
14261
  };
14294
14262
  var timeSince = function timeSince(t) {
14295
14263
  if (!t) return 0;
@@ -15402,8 +15370,15 @@
15402
15370
  _e = _a.debugMode,
15403
15371
  debugMode = _e === void 0 ? false : _e;
15404
15372
  var submissionStatus = React.useContext(SubmissionContext).submissionStatus;
15373
+ var idCardFront = capturedDocuments.idCardFront,
15374
+ idCardBack = capturedDocuments.idCardBack,
15375
+ passport = capturedDocuments.passport;
15405
15376
  var verbiage = useTranslations(rawVerbiage, {
15406
15377
  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.',
15407
15382
  retryText: 'Retry',
15408
15383
  submittingText: 'Submitting...',
15409
15384
  submitText: 'Done'
@@ -15420,16 +15395,25 @@
15420
15395
  className: classNames.imageContainer
15421
15396
  }, /*#__PURE__*/React.createElement(ImageRow, {
15422
15397
  className: classNames.imageRow
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, {
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, {
15433
15417
  className: classNames.buttonsRow
15434
15418
  }, /*#__PURE__*/React.createElement(WideButton, {
15435
15419
  className: classNames.submitBtn,
@@ -15448,7 +15432,7 @@
15448
15432
  };
15449
15433
  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"])));
15450
15434
  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"])));
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"])));
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"])));
15452
15436
  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"])));
15453
15437
  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"])));
15454
15438
  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"])));
@@ -17158,8 +17142,8 @@
17158
17142
  var _j = React.useState(silentFallback),
17159
17143
  useFallback = _j[0],
17160
17144
  setUseFallback = _j[1];
17161
- var minImageCount = minImageCountForIdCaptureRequirementOption(idCaptureRequirement);
17162
- var maxImageCount = maxImageCountForIdCaptureRequirementOption(idCaptureRequirement);
17145
+ var allowedImageCount = allowedImageCountForOption(idCaptureRequirement);
17146
+ var requiredImageCount = requiredImageCountForOption(idCaptureRequirement);
17163
17147
  var _k = useFileState(),
17164
17148
  rawFile = _k.rawFile,
17165
17149
  fileInputOnChange = _k.fileInputOnChange;
@@ -17172,7 +17156,7 @@
17172
17156
  var whatToCapture = idCaptureRequirement === 'idCard' ? 'ID card' : idCaptureRequirement === 'passport' ? 'passport' : idCaptureRequirement === 'idCardOrPassport' ? 'ID card or passport' : 'ID card and passport';
17173
17157
  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.';
17174
17158
  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.';
17175
- var descriptionText = "On-device capture guidance failed, please capture ".concat(minImageCount > 1 ? 'photos' : ' a photo', " of your ").concat(whatToCapture, " manually.");
17159
+ var descriptionText = "On-device capture guidance failed, please capture ".concat(requiredImageCount > 1 ? 'photos' : ' a photo', " of your ").concat(whatToCapture, " manually.");
17176
17160
  var verbiage = useTranslations(rawVerbiage, {
17177
17161
  headingText: "We're having some trouble.",
17178
17162
  descriptionText: descriptionText,
@@ -17246,7 +17230,7 @@
17246
17230
  alt: "",
17247
17231
  className: classNames.image
17248
17232
  }));
17249
- }))), images.length < minImageCount && ( /*#__PURE__*/React.createElement(Instruction, {
17233
+ }))), images.length < requiredImageCount && ( /*#__PURE__*/React.createElement(Instruction, {
17250
17234
  className: classNames.instruction
17251
17235
  }, instructionText)), /*#__PURE__*/React.createElement("input", {
17252
17236
  ref: fileInput,
@@ -17257,7 +17241,7 @@
17257
17241
  hidden: true
17258
17242
  }), /*#__PURE__*/React.createElement(StyledButtonsRow$8, {
17259
17243
  className: classNames.buttonsRow
17260
- }, images.length < maxImageCount && ( /*#__PURE__*/React.createElement(LoaderButton, {
17244
+ }, images.length < allowedImageCount && ( /*#__PURE__*/React.createElement(LoaderButton, {
17261
17245
  variant: images.length > 0 ? 'secondary' : 'positive',
17262
17246
  className: images.length > 0 ? classNames.captureMoreBtn : classNames.captureBtn,
17263
17247
  colors: images.length > 0 ? colors.captureMoreBtn : colors.captureBtn,
@@ -17270,7 +17254,7 @@
17270
17254
  setDocumentToCapture(instructionText);
17271
17255
  }
17272
17256
  }
17273
- }, images.length > 0 ? verbiage.captureMoreBtnText : verbiage.captureBtnText)), images.length >= minImageCount && ( /*#__PURE__*/React.createElement(LoaderButton, {
17257
+ }, images.length > 0 ? verbiage.captureMoreBtnText : verbiage.captureBtnText)), images.length >= requiredImageCount && ( /*#__PURE__*/React.createElement(LoaderButton, {
17274
17258
  variant: "positive",
17275
17259
  className: classNames.doneBtn,
17276
17260
  colors: colors.doneBtn,
@@ -17317,82 +17301,79 @@
17317
17301
  precapturedDocuments = _a.precapturedDocuments,
17318
17302
  _j = _a.captureRequirement,
17319
17303
  captureRequirement = _j === void 0 ? 'idCardOrPassport' : _j,
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,
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,
17328
17310
  instructions = _a.instructions,
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;
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;
17383
17365
  React.useEffect(function () {
17384
17366
  dispatch({
17385
17367
  type: 'configureWizard',
17386
17368
  payload: {
17387
17369
  captureRequirement: captureRequirement,
17388
17370
  precapturedDocuments: precapturedDocuments,
17389
- allowSinglePageIdCapture: allowSinglePageIdCapture,
17390
17371
  allowIdCardBackToFrontCapture: allowIdCardBackToFrontCapture,
17391
17372
  enableOverrideWrongDocumentTypeDialog: enableOverrideWrongDocumentTypeDialog,
17392
17373
  allowOverrideWrongDocumentTypeAfterMs: allowOverrideWrongDocumentTypeAfterMs
17393
17374
  }
17394
17375
  });
17395
- }, [allowIdCardBackToFrontCapture, allowOverrideWrongDocumentTypeAfterMs, allowSinglePageIdCapture, captureRequirement, dispatch, enableOverrideWrongDocumentTypeDialog, precapturedDocuments]);
17376
+ }, [allowIdCardBackToFrontCapture, allowOverrideWrongDocumentTypeAfterMs, captureRequirement, dispatch, enableOverrideWrongDocumentTypeDialog, precapturedDocuments]);
17396
17377
  var documentCount = Object.keys(state.capturedDocuments).length;
17397
17378
  React.useEffect(function () {
17398
17379
  if (documentCount) resetBestFrame();
@@ -17454,16 +17435,13 @@
17454
17435
  var _a = state.capturedDocuments,
17455
17436
  idCardFront = _a.idCardFront,
17456
17437
  idCardBack = _a.idCardBack,
17457
- passport = _a.passport,
17458
- singlePage = _a.singlePage;
17438
+ passport = _a.passport;
17459
17439
  var idFrontImage = idCardFront && dataUrlToBase64Sync(idCardFront.imageData);
17460
17440
  var idBackImage = idCardBack && dataUrlToBase64Sync(idCardBack.imageData);
17461
17441
  var passportImage = passport && dataUrlToBase64Sync(passport.imageData);
17462
- var singlePageImage = singlePage && dataUrlToBase64Sync(singlePage.imageData);
17463
17442
  if (idFrontImage) setIdFrontImage(idFrontImage);
17464
17443
  if (idBackImage) setIdBackImage(idBackImage);
17465
17444
  if (passportImage) setPassportImage(passportImage);
17466
- if (singlePageImage) setIdFrontImage(singlePageImage);
17467
17445
  if (releaseCameraAccessOnExit) releaseCameraAccess();
17468
17446
  setTimeout(function () {
17469
17447
  onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess({
@@ -17479,9 +17457,9 @@
17479
17457
  type: 'resetWizard'
17480
17458
  });
17481
17459
  }, [dispatch]);
17482
- var _9 = React.useState(0),
17483
- attempt = _9[0],
17484
- setAttempt = _9[1];
17460
+ var _8 = React.useState(0),
17461
+ attempt = _8[0],
17462
+ setAttempt = _8[1];
17485
17463
  var onExit = React.useCallback(function () {
17486
17464
  releaseCameraAccess();
17487
17465
  setOverlayDismissed(false);
@@ -17572,9 +17550,9 @@
17572
17550
  });
17573
17551
  });
17574
17552
  }, [dispatch]);
17575
- var _10 = React.useState(false),
17576
- progressStarted = _10[0],
17577
- setProgressStarted = _10[1];
17553
+ var _9 = React.useState(false),
17554
+ progressStarted = _9[0],
17555
+ setProgressStarted = _9[1];
17578
17556
  React.useEffect(function () {
17579
17557
  if (state.captureState === 'capturing') {
17580
17558
  setProgressStarted(false);
@@ -21874,8 +21852,7 @@
21874
21852
  detection: {
21875
21853
  idCardFront: 0.4,
21876
21854
  idCardBack: 0.5,
21877
- passport: 0.3,
21878
- singlePage: 0.3
21855
+ passport: 0.3
21879
21856
  },
21880
21857
  focus: {
21881
21858
  idCardFront: {
@@ -21889,17 +21866,12 @@
21889
21866
  passport: {
21890
21867
  desktop: 0,
21891
21868
  mobile: 0
21892
- },
21893
- singlePage: {
21894
- desktop: 0,
21895
- mobile: 0
21896
21869
  }
21897
21870
  },
21898
21871
  goodFrames: {
21899
21872
  idCardFront: 1,
21900
21873
  idCardBack: 1,
21901
- passport: 1,
21902
- singlePage: 1
21874
+ passport: 1
21903
21875
  },
21904
21876
  flipShortcutThreshold: 0.7
21905
21877
  };
@@ -21971,7 +21943,6 @@
21971
21943
  stopIdModels = _18.stop,
21972
21944
  onIdPredictionMade = _18.onPredictionMade,
21973
21945
  setThresholds = _18.setThresholds,
21974
- setRequiredDocumentType = _18.setRequiredDocumentType,
21975
21946
  setDocumentDetectionBoundaries = _18.setDocumentDetectionBoundaries,
21976
21947
  bestFrameDetails = _18.bestFrameDetails,
21977
21948
  resetBestFrame = _18.resetBestFrame,
@@ -22050,9 +22021,6 @@
22050
22021
  React.useEffect(function () {
22051
22022
  setThresholds(adjustedThresholds);
22052
22023
  }, [requestedAction, setThresholds, adjustedThresholds]);
22053
- React.useEffect(function () {
22054
- setRequiredDocumentType(requestedAction === 'SHOW_PASSPORT' ? 'passport' : requestedAction === 'SHOW_ID_BACK' ? 'idCardBack' : 'idCardFront');
22055
- }, [requestedAction, setRequiredDocumentType]);
22056
22024
  React.useEffect(function () {
22057
22025
  setDocumentDetectionBoundaries({
22058
22026
  top: 20,
@@ -22075,9 +22043,6 @@
22075
22043
  setGoodFramesCount = _28[1];
22076
22044
  var goodFramesThreshold = requestedAction === 'SHOW_PASSPORT' ? adjustedThresholds.goodFrames.passport : requestedAction === 'SHOW_ID_FRONT' ? adjustedThresholds.goodFrames.idCardFront : adjustedThresholds.goodFrames.idCardBack;
22077
22045
  var goodFramesThresholdMet = goodFramesCount >= goodFramesThreshold;
22078
- var _29 = React.useState(false),
22079
- isSinglePage = _29[0],
22080
- setIsSinglePage = _29[1];
22081
22046
  React.useEffect(function () {
22082
22047
  if (!idCaptureModelsEnabled || idModelError) return;
22083
22048
  onIdPredictionMade(function (prediction) {
@@ -22085,8 +22050,7 @@
22085
22050
  setCurrentDetectionScore(prediction.detectionScore);
22086
22051
  setCurrentDetectedDocumentType(prediction.detectedDocumentType);
22087
22052
  setCurrentFocusScore(prediction.focusScore);
22088
- setIsSinglePage(prediction.singlePageDetectionThresholdMet);
22089
- var detectionThresholdMet = requestedAction === 'SHOW_PASSPORT' ? prediction.passportDetectionThresholdMet : requestedAction === 'SHOW_ID_BACK' ? prediction.idCardBackDetectionThresholdMet : prediction.idCardFrontDetectionThresholdMet || prediction.singlePageDetectionThresholdMet;
22053
+ var detectionThresholdMet = requestedAction === 'SHOW_PASSPORT' ? prediction.passportDetectionThresholdMet : requestedAction === 'SHOW_ID_FRONT' ? prediction.idCardFrontDetectionThresholdMet : prediction.idCardBackDetectionThresholdMet;
22090
22054
  var isGoodFrame = detectionThresholdMet && prediction.focusThresholdMet;
22091
22055
  var shouldShortcutFlipAnimation = requestedAction === 'FLIP_ID' && isGoodFrame && prediction.idCardBackDetectionScore >= adjustedThresholds.flipShortcutThreshold;
22092
22056
  if (shouldShortcutFlipAnimation) {
@@ -22097,9 +22061,9 @@
22097
22061
  } : 0);
22098
22062
  });
22099
22063
  }, [idCaptureModelsEnabled, onIdPredictionMade, idModelError, requestedAction, adjustedThresholds.flipShortcutThreshold]);
22100
- var _30 = React.useState(null),
22101
- idFrontCaptureStartedAt = _30[0],
22102
- setFirstGoodFrameTime = _30[1];
22064
+ var _29 = React.useState(null),
22065
+ idFrontCaptureStartedAt = _29[0],
22066
+ setFirstGoodFrameTime = _29[1];
22103
22067
  React.useEffect(function () {
22104
22068
  if (goodFramesCount === 1) setFirstGoodFrameTime(new Date().getTime());
22105
22069
  }, [goodFramesCount]);
@@ -22120,60 +22084,80 @@
22120
22084
  var frameHeight = (_e = (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.videoHeight) !== null && _e !== void 0 ? _e : 0;
22121
22085
  var faceBox = face === null || face === void 0 ? void 0 : face.box;
22122
22086
  var faceCentered = !faceBox || !frameWidth || faceBox.xMin > frameWidth * edgeBoundary && faceBox.yMin > frameHeight * edgeBoundary && faceBox.xMax < frameWidth * (1 - edgeBoundary) && faceBox.yMax < frameHeight * (1 - edgeBoundary);
22123
- var _31 = React.useState(),
22124
- countdownStartedAt = _31[0],
22125
- setCountdownStartedAt = _31[1];
22087
+ var _30 = React.useState(),
22088
+ countdownStartedAt = _30[0],
22089
+ setCountdownStartedAt = _30[1];
22126
22090
  var photoCanvas = React.useRef(null);
22127
22091
  var frameLock = React.useRef(false);
22128
22092
  var captureFrame = React.useCallback(function () {
22129
22093
  return __awaiter(void 0, void 0, void 0, function () {
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') {
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];
22142
22110
  if (onIdFrontImageCaptured) {
22143
22111
  onIdFrontImageCaptured(frameBase64);
22144
22112
  }
22145
- if (isSinglePage || evaluateShouldSkip(skipShowIdCardBack)) {
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) {
22146
22122
  return [2 /*return*/, onIdCaptureComplete()];
22147
22123
  }
22124
+ _b.label = 4;
22125
+ case 4:
22148
22126
  setRequestedAction('FLIP_ID');
22149
- } else if (requestedAction == 'SHOW_ID_BACK') {
22150
- if (onIdBackImageCaptured) {
22151
- onIdBackImageCaptured(frameBase64);
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();
22152
22139
  }
22153
- onIdCaptureComplete();
22154
- } else if (requestedAction == 'SHOW_PASSPORT') {
22155
- if (onIdFrontImageCaptured) {
22156
- onIdFrontImageCaptured(frameBase64);
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);
22157
22153
  }
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
- }
22154
+ return [7 /*endfinally*/];
22155
+ case 8:
22156
+ return [2 /*return*/];
22172
22157
  }
22173
- return [2 /*return*/];
22174
22158
  });
22175
22159
  });
22176
- }, [videoRef, requestedAction, onIdFrontImageCaptured, isSinglePage, skipShowIdCardBack, onIdCaptureComplete, onIdBackImageCaptured, resetBestFrame]);
22160
+ }, [onIdCaptureComplete, onIdBackImageCaptured, onIdFrontImageCaptured, requestedAction, resetBestFrame, skipShowIdCardBack, videoRef]);
22177
22161
  var isFlipping = requestedAction === 'FLIP_ID';
22178
22162
  React.useEffect(function () {
22179
22163
  if (!isFlipping) return;
@@ -22232,9 +22216,9 @@
22232
22216
  stopSelfieGuidance();
22233
22217
  };
22234
22218
  }, [startSelfieGuidance, stopSelfieGuidance]);
22235
- var _32 = React.useState(0),
22236
- numFramesWithoutFaces = _32[0],
22237
- setNumFramesWithoutFaces = _32[1];
22219
+ var _31 = React.useState(0),
22220
+ numFramesWithoutFaces = _31[0],
22221
+ setNumFramesWithoutFaces = _31[1];
22238
22222
  onSelfiePredictionMade(f(React.useCallback(function (_a) {
22239
22223
  var face = _a.face;
22240
22224
  if (selfieModelError) return;
@@ -22250,12 +22234,12 @@
22250
22234
  }
22251
22235
  }, [disableFaceDetectionWhileAudioCapture, disableFaceDetectionWhileAudioCaptureMsDelay, numFramesWithoutFaces, onFaceNotDetected, timeoutStartedAt]);
22252
22236
  var theme = styled.useTheme();
22253
- var _33 = useTranslations(rawVerbiage, {
22237
+ var _32 = useTranslations(rawVerbiage, {
22254
22238
  faceNotCenteredText: 'Please move your face to the center...',
22255
22239
  captureBtnText: 'Capture'
22256
22240
  }),
22257
- captureBtnText = _33.captureBtnText,
22258
- faceNotCenteredText = _33.faceNotCenteredText;
22241
+ captureBtnText = _32.captureBtnText,
22242
+ faceNotCenteredText = _32.faceNotCenteredText;
22259
22243
  var debugScalingDetails = useDebugScalingDetails({
22260
22244
  enabled: debugMode,
22261
22245
  pageWidth: width,
@@ -22330,11 +22314,6 @@
22330
22314
  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"])));
22331
22315
  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"])));
22332
22316
  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
- }
22338
22317
  var templateObject_1$5, templateObject_2$5, templateObject_3$5, templateObject_4;
22339
22318
 
22340
22319
  var IdVideoCaptureSuccess = function IdVideoCaptureSuccess(_a) {
@@ -22628,8 +22607,7 @@
22628
22607
  documentDetectionModelUrl: (_g = (_f = idCaptureProps.assets) === null || _f === void 0 ? void 0 : _f.documentDetectionModelUrl) !== null && _g !== void 0 ? _g : '',
22629
22608
  focusModelUrl: (_j = (_h = idCaptureProps.assets) === null || _h === void 0 ? void 0 : _h.focusModelUrl) !== null && _j !== void 0 ? _j : '',
22630
22609
  onModelError: onIdCaptureModelError,
22631
- modelLoadTimeoutMs: idCaptureModelLoadTimeoutMs,
22632
- allowSinglePageIdCapture: idCaptureProps.allowSinglePageIdCapture
22610
+ modelLoadTimeoutMs: idCaptureModelLoadTimeoutMs
22633
22611
  }, /*#__PURE__*/React.createElement(SelfieGuidanceModelsProvider, {
22634
22612
  autoStart: false,
22635
22613
  onModelError: faceLivenessProps === null || faceLivenessProps === void 0 ? void 0 : faceLivenessProps.onModelError,
@@ -22879,8 +22857,7 @@
22879
22857
  documentDetectionModelUrl: (_d = (_c = idCaptureProps.assets) === null || _c === void 0 ? void 0 : _c.documentDetectionModelUrl) !== null && _d !== void 0 ? _d : '',
22880
22858
  focusModelUrl: (_f = (_e = idCaptureProps.assets) === null || _e === void 0 ? void 0 : _e.focusModelUrl) !== null && _f !== void 0 ? _f : '',
22881
22859
  onModelError: idCaptureProps.onModelError,
22882
- modelLoadTimeoutMs: idCaptureProps.modelLoadTimeoutMs,
22883
- allowSinglePageIdCapture: idCaptureProps.allowSinglePageIdCapture
22860
+ modelLoadTimeoutMs: idCaptureProps.modelLoadTimeoutMs
22884
22861
  }, /*#__PURE__*/React.createElement(IdCaptureStateProvider, null, /*#__PURE__*/React.createElement(GuideOrientationContextProvider, null, /*#__PURE__*/React.createElement(IdCaptureWizard, _assign({}, idCaptureProps, {
22885
22862
  onSuccess: onIdCaptureSuccess
22886
22863
  }))))));
@@ -23202,33 +23179,31 @@
23202
23179
  onLoadingOverlayDismissed = _a.onLoadingOverlayDismissed,
23203
23180
  _d = _a.idCaptureRequirement,
23204
23181
  idCaptureRequirement = _d === void 0 ? 'idCardOrPassport' : _d,
23205
- _e = _a.allowSinglePageIdCapture,
23206
- allowSinglePageIdCapture = _e === void 0 ? false : _e,
23207
- _f = _a.separateIdCardCaptureSequence,
23208
- separateIdCardCaptureSequence = _f === void 0 ? false : _f,
23209
- _g = _a.idCaptureThresholds,
23210
- idCaptureThresholds = _g === void 0 ? defaultIdCaptureThresholds : _g,
23211
- _h = _a.skipSuccessScreen,
23212
- skipSuccessScreen = _h === void 0 ? false : _h,
23182
+ _e = _a.separateIdCardCaptureSequence,
23183
+ separateIdCardCaptureSequence = _e === void 0 ? false : _e,
23184
+ _f = _a.idCaptureThresholds,
23185
+ idCaptureThresholds = _f === void 0 ? defaultIdCaptureThresholds : _f,
23186
+ _g = _a.skipSuccessScreen,
23187
+ skipSuccessScreen = _g === void 0 ? false : _g,
23213
23188
  instructions = _a.instructions,
23214
- _j = _a.guideType,
23215
- guideType = _j === void 0 ? 'fit' : _j,
23216
- _k = _a.guideImages,
23217
- guideImages = _k === void 0 ? defaultIdCaptureGuideImages : _k,
23218
- _l = _a.portraitGuidesOnMobile,
23219
- portraitGuidesOnMobile = _l === void 0 ? true : _l,
23220
- _m = _a.rotateLoadingOverlayImageWhenPortrait,
23221
- rotateLoadingOverlayImageWhenPortrait = _m === void 0 ? true : _m,
23222
- _o = _a.modelLoadTimeoutMs,
23223
- modelLoadTimeoutMs = _o === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _o,
23224
- _p = _a.forceFallbackMode,
23225
- forceFallbackMode = _p === void 0 ? false : _p,
23226
- _q = _a.allowIdCardBackToFrontCapture,
23227
- allowIdCardBackToFrontCapture = _q === void 0 ? false : _q,
23228
- _r = _a.enableOverrideWrongDocumentTypeDialog,
23229
- enableOverrideWrongDocumentTypeDialog = _r === void 0 ? false : _r,
23230
- _s = _a.allowOverrideWrongDocumentTypeAfterMs,
23231
- allowOverrideWrongDocumentTypeAfterMs = _s === void 0 ? 8000 : _s,
23189
+ _h = _a.guideType,
23190
+ guideType = _h === void 0 ? 'fit' : _h,
23191
+ _j = _a.guideImages,
23192
+ guideImages = _j === void 0 ? defaultIdCaptureGuideImages : _j,
23193
+ _k = _a.portraitGuidesOnMobile,
23194
+ portraitGuidesOnMobile = _k === void 0 ? true : _k,
23195
+ _l = _a.rotateLoadingOverlayImageWhenPortrait,
23196
+ rotateLoadingOverlayImageWhenPortrait = _l === void 0 ? true : _l,
23197
+ _m = _a.modelLoadTimeoutMs,
23198
+ modelLoadTimeoutMs = _m === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _m,
23199
+ _o = _a.forceFallbackMode,
23200
+ forceFallbackMode = _o === void 0 ? false : _o,
23201
+ _p = _a.allowIdCardBackToFrontCapture,
23202
+ allowIdCardBackToFrontCapture = _p === void 0 ? false : _p,
23203
+ _q = _a.enableOverrideWrongDocumentTypeDialog,
23204
+ enableOverrideWrongDocumentTypeDialog = _q === void 0 ? false : _q,
23205
+ _r = _a.allowOverrideWrongDocumentTypeAfterMs,
23206
+ allowOverrideWrongDocumentTypeAfterMs = _r === void 0 ? 8000 : _r,
23232
23207
  onBeforeSubmit = _a.onBeforeSubmit,
23233
23208
  onBeforeDocumentUpload = _a.onBeforeDocumentUpload,
23234
23209
  onDocumentUploadProgress = _a.onDocumentUploadProgress,
@@ -23242,28 +23217,28 @@
23242
23217
  onUserCancel = _a.onUserCancel,
23243
23218
  onModelError = _a.onModelError,
23244
23219
  onCameraAccessDenied = _a.onCameraAccessDenied,
23245
- _t = _a.theme,
23246
- theme = _t === void 0 ? 'default' : _t,
23247
- _u = _a.assets,
23248
- assets = _u === void 0 ? {} : _u,
23249
- _v = _a.classNames,
23250
- classNames = _v === void 0 ? {} : _v,
23251
- _w = _a.colors,
23252
- colors = _w === void 0 ? {} : _w,
23253
- _x = _a.verbiage,
23254
- verbiage = _x === void 0 ? {} : _x,
23255
- _y = _a.captureSignature,
23256
- captureSignature = _y === void 0 ? false : _y,
23257
- _z = _a.captureSignatureVideo,
23258
- captureSignatureVideo = _z === void 0 ? false : _z,
23259
- _0 = _a.captureAdditionalDocuments,
23260
- captureAdditionalDocuments = _0 === void 0 ? [] : _0,
23261
- _1 = _a.geolocationEnabled,
23262
- geolocationEnabled = _1 === void 0 ? true : _1,
23263
- _2 = _a.geolocationRequired,
23264
- geolocationRequired = _2 === void 0 ? false : _2,
23265
- _3 = _a.debugMode,
23266
- debugMode = _3 === void 0 ? false : _3;
23220
+ _s = _a.theme,
23221
+ theme = _s === void 0 ? 'default' : _s,
23222
+ _t = _a.assets,
23223
+ assets = _t === void 0 ? {} : _t,
23224
+ _u = _a.classNames,
23225
+ classNames = _u === void 0 ? {} : _u,
23226
+ _v = _a.colors,
23227
+ colors = _v === void 0 ? {} : _v,
23228
+ _w = _a.verbiage,
23229
+ verbiage = _w === void 0 ? {} : _w,
23230
+ _x = _a.captureSignature,
23231
+ captureSignature = _x === void 0 ? false : _x,
23232
+ _y = _a.captureSignatureVideo,
23233
+ captureSignatureVideo = _y === void 0 ? false : _y,
23234
+ _z = _a.captureAdditionalDocuments,
23235
+ captureAdditionalDocuments = _z === void 0 ? [] : _z,
23236
+ _0 = _a.geolocationEnabled,
23237
+ geolocationEnabled = _0 === void 0 ? true : _0,
23238
+ _1 = _a.geolocationRequired,
23239
+ geolocationRequired = _1 === void 0 ? false : _1,
23240
+ _2 = _a.debugMode,
23241
+ debugMode = _2 === void 0 ? false : _2;
23267
23242
  useLanguage(lang);
23268
23243
  useDebugLogging(debugMode);
23269
23244
  var idCaptureProps = React.useMemo(function () {
@@ -23273,7 +23248,6 @@
23273
23248
  onModelError: onModelError,
23274
23249
  precapturedDocuments: precapturedDocuments,
23275
23250
  captureRequirement: idCaptureRequirement,
23276
- allowSinglePageIdCapture: allowSinglePageIdCapture,
23277
23251
  separateIdCardCaptureSequence: separateIdCardCaptureSequence,
23278
23252
  thresholds: idCaptureThresholds,
23279
23253
  skipSuccessScreen: skipSuccessScreen,
@@ -23296,7 +23270,7 @@
23296
23270
  verbiage: verbiage,
23297
23271
  debugMode: debugMode
23298
23272
  };
23299
- }, [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]);
23273
+ }, [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]);
23300
23274
  var additionalDocumentCaptureProps = React.useMemo(function () {
23301
23275
  return {
23302
23276
  documents: captureAdditionalDocuments,