idmission-web-sdk 1.0.358 → 1.0.359

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -702,7 +702,8 @@ Render a fullscreen capture component that performs IDValidation and FaceValidat
702
702
  <tr><td><code>goodIdCardFrontFramesThreshold</code> (optional)</td><td>number of good frames of the ID card front that must be captured before moving on during video capture. Defaults to 3.</td></tr>
703
703
  <tr><td><code>showIdCardBackDurationMs</code> (optional)</td><td>the duration of time in milliseconds that the user is instructed to show the back of their ID card during video capture. Defaults to 5000ms.</td></tr>
704
704
  <tr><td><code>readTextPrompt</code> (optional)</td><td>an optional text prompt to display on screen for the user to read during video capture after the ID card has been shown. Leave blank to skip the read text screen.</td></tr>
705
- <tr><td><code>readTextTimeoutDurationMs</code> (optional)</td><td>the duration of time in milliseconds that the user is allowed to spend reading the <code>readTextPrompt</code>. Defaults to 15000ms.</td></tr>
705
+ <tr><td><code>readTextTimeoutDurationMs</code> (optional)</td><td>the duration of time in milliseconds that the user is allowed to spend reading the <code>readTextPrompt</code>. Defaults to 15000 (15 seconds).</td></tr>
706
+ <tr><td><code>readTextMinReadingMs</code> (optional)</td><td>the duration of time in milliseconds that the user is forced to spend reading the `readTextPrompt` before they can click the Done button. Defaults to 3000 (3 seconds).</td></tr>
706
707
  <tr><td><code>skipSuccessScreen</code> (optional)</td><td>boolean or async function to indicate whether to proceed automatically after capture guidance is satisfied. If an async function is supplied returning a boolean, it will be evaluated at the time of capture guidance satisfaction. Defaults to false.</td></tr>
707
708
  <tr><td><code>skipIdCapture</code> (optional)</td><td>boolean to indicate whether to skip the initial ID capture flow. Note that when this flag is set, submission to IDmission's servers will not be attempted; it should be used in tandem with onSubmit. Defaults to false.</td></tr>
708
709
  <tr><td><code>skipShowIdCardBack</code> (optional)</td><td>boolean or async function to indicate whether to instruct the user to show the back of their ID card during video capture. If an async function is supplied returning a boolean, it will be evaluated at the time of ID front video capture completion. Defaults to false.</td></tr>
@@ -101,8 +101,10 @@ export interface VideoIdValidationProps extends PropsWithChildren {
101
101
  goodIdCardBackFramesThreshold?: number;
102
102
  /** An optional text prompt to display on screen for the user to read during video capture after the ID card has been shown. */
103
103
  readTextPrompt?: CustomerSuppliedVerbiage;
104
- /** The duration of time in milliseconds that the user is allowed to spend reading the `readTextPrompt`. */
104
+ /** The duration of time in milliseconds that the user is allowed to spend reading the `readTextPrompt`. Defaults to 15000 (15 seconds). */
105
105
  readTextTimeoutDurationMs?: number;
106
+ /** The duration of time in milliseconds that the user is forced to spend reading the `readTextPrompt` before they can click the Done button. Defaults to 3000 (3 seconds). */
107
+ readTextMinReadingMs?: number;
106
108
  /** Boolean or async function to indicate whether to proceed automatically after capture guidance is satisfied. If an async function is supplied returning a boolean, it will be evaluated at the time of capture guidance satisfaction. Defaults to `false`. */
107
109
  skipSuccessScreen?: boolean | (() => Promise<boolean>);
108
110
  /** Boolean to indicate whether to skip the initial ID capture flow. Note that when this flag is set, submission to IDmission's servers will not be attempted; it should be used in tandem with `onSubmit`. Defaults to `false`. */
@@ -17,7 +17,8 @@ export type ReadTextPromptProps = {
17
17
  onComplete?: () => void;
18
18
  startedAt?: Date;
19
19
  durationMs?: number;
20
+ minReadingMs?: number;
20
21
  classNames?: ReadTextPromptClassNames;
21
22
  verbiage?: ReadTextPromptVerbiage;
22
23
  };
23
- export declare const ReadTextPrompt: ({ text, onComplete, durationMs, classNames, verbiage: rawVerbiage, }: ReadTextPromptProps) => React.JSX.Element;
24
+ export declare const ReadTextPrompt: ({ text, onComplete, durationMs, minReadingMs, classNames, verbiage: rawVerbiage, }: ReadTextPromptProps) => React.JSX.Element;
@@ -48,6 +48,7 @@ export type IdVideoCaptureProps = {
48
48
  captureCountdownSeconds?: number;
49
49
  readTextPrompt?: CustomerSuppliedVerbiage;
50
50
  readTextTimeoutDurationMs?: number;
51
+ readTextMinReadingMs?: number;
51
52
  disableFaceDetectionWhileAudioCapture: boolean;
52
53
  disableFaceDetectionWhileAudioCaptureMsDelay: number;
53
54
  assets?: IdVideoCaptureAssets;
@@ -56,4 +57,4 @@ export type IdVideoCaptureProps = {
56
57
  verbiage?: IdVideoCaptureVerbiage;
57
58
  debugMode?: boolean;
58
59
  };
59
- export declare const IdVideoCapture: ({ onComplete, onIdFrontImageCaptured, onIdBackImageCaptured, onFaceNotDetected, idCaptureModelsEnabled, idCardFrontDelay, idCardFrontDetectionThreshold, idCardFrontFocusThreshold, goodIdCardFrontFramesThreshold, idCardBackDetectionThreshold, idCardBackFocusThreshold, goodIdCardBackFramesThreshold, skipShowIdCardBack, captureCountdownSeconds, readTextPrompt, readTextTimeoutDurationMs, disableFaceDetectionWhileAudioCapture, disableFaceDetectionWhileAudioCaptureMsDelay, assets, classNames, colors, verbiage: rawVerbiage, debugMode, }: IdVideoCaptureProps) => ReactElement;
60
+ export declare const IdVideoCapture: ({ onComplete, onIdFrontImageCaptured, onIdBackImageCaptured, onFaceNotDetected, idCaptureModelsEnabled, idCardFrontDelay, idCardFrontDetectionThreshold, idCardFrontFocusThreshold, goodIdCardFrontFramesThreshold, idCardBackDetectionThreshold, idCardBackFocusThreshold, goodIdCardBackFramesThreshold, skipShowIdCardBack, captureCountdownSeconds, readTextPrompt, readTextTimeoutDurationMs, readTextMinReadingMs, disableFaceDetectionWhileAudioCapture, disableFaceDetectionWhileAudioCaptureMsDelay, assets, classNames, colors, verbiage: rawVerbiage, debugMode, }: IdVideoCaptureProps) => ReactElement;
@@ -50,6 +50,7 @@ export type VideoIdWizardProps = {
50
50
  goodIdCardBackFramesThreshold?: number;
51
51
  readTextPrompt?: CustomerSuppliedVerbiage;
52
52
  readTextTimeoutDurationMs?: number;
53
+ readTextMinReadingMs?: number;
53
54
  skipSuccessScreen?: boolean | (() => Promise<boolean>);
54
55
  skipIdCapture?: boolean;
55
56
  skipShowIdCardBack?: boolean | (() => Promise<boolean>);
@@ -68,4 +69,4 @@ export type VideoIdWizardProps = {
68
69
  verbiage?: VideoIdWizardVerbiage;
69
70
  debugMode?: boolean;
70
71
  };
71
- export declare const VideoIdWizard: ({ onComplete, onExitCapture, onExitAfterFailure, onUserCancel, onIdCaptureModelError, idCaptureProps, faceLivenessProps, idCaptureModelsEnabled, idCardFrontDetectionThreshold, idCardBackDetectionThreshold, idCardFrontFocusThreshold, idCardBackFocusThreshold, goodIdCardFrontFramesThreshold, goodIdCardBackFramesThreshold, readTextPrompt, readTextTimeoutDurationMs, skipIdCapture, skipShowIdCardBack, skipSuccessScreen, idCaptureLoadingOverlayMode, idCaptureGuideType, idCapturePortraitGuidesOnMobile, idCaptureRotateLoadingOverlayImageWhenPortrait, idCaptureModelLoadTimeoutMs, faceLivenessLoadingOverlayMode, disableFaceDetectionWhileAudioCapture, disableFaceDetectionWhileAudioCaptureMsDelay, silentFallback, assets, classNames, colors, verbiage, debugMode, }: VideoIdWizardProps) => ReactElement;
72
+ export declare const VideoIdWizard: ({ onComplete, onExitCapture, onExitAfterFailure, onUserCancel, onIdCaptureModelError, idCaptureProps, faceLivenessProps, idCaptureModelsEnabled, idCardFrontDetectionThreshold, idCardBackDetectionThreshold, idCardFrontFocusThreshold, idCardBackFocusThreshold, goodIdCardFrontFramesThreshold, goodIdCardBackFramesThreshold, readTextPrompt, readTextTimeoutDurationMs, readTextMinReadingMs, skipIdCapture, skipShowIdCardBack, skipSuccessScreen, idCaptureLoadingOverlayMode, idCaptureGuideType, idCapturePortraitGuidesOnMobile, idCaptureRotateLoadingOverlayImageWhenPortrait, idCaptureModelLoadTimeoutMs, faceLivenessLoadingOverlayMode, disableFaceDetectionWhileAudioCapture, disableFaceDetectionWhileAudioCaptureMsDelay, silentFallback, assets, classNames, colors, verbiage, debugMode, }: VideoIdWizardProps) => ReactElement;
@@ -50,7 +50,7 @@ var LanguageDetector__default = /*#__PURE__*/_interopDefaultLegacy(LanguageDetec
50
50
  var i18n__default = /*#__PURE__*/_interopDefaultLegacy(i18n);
51
51
  var SignatureCanvas__default = /*#__PURE__*/_interopDefaultLegacy(SignatureCanvas);
52
52
 
53
- var webSdkVersion = '1.0.358';
53
+ var webSdkVersion = '1.0.359';
54
54
 
55
55
  function getPlatform() {
56
56
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -16401,20 +16401,22 @@ var ReadTextPrompt = function ReadTextPrompt(_a) {
16401
16401
  onComplete = _a.onComplete,
16402
16402
  _b = _a.durationMs,
16403
16403
  durationMs = _b === void 0 ? 15000 : _b,
16404
- _c = _a.classNames,
16405
- classNames = _c === void 0 ? {} : _c,
16406
- _d = _a.verbiage,
16407
- rawVerbiage = _d === void 0 ? {} : _d;
16404
+ _c = _a.minReadingMs,
16405
+ minReadingMs = _c === void 0 ? 3000 : _c,
16406
+ _d = _a.classNames,
16407
+ classNames = _d === void 0 ? {} : _d,
16408
+ _e = _a.verbiage,
16409
+ rawVerbiage = _e === void 0 ? {} : _e;
16408
16410
  text = useVerbiage(text, '');
16409
16411
  var countdownTimeoutRef = React.useRef(undefined);
16410
- var _e = React.useState(durationMs / 1000),
16411
- countdownRemaining = _e[0],
16412
- setCountdownRemaining = _e[1];
16412
+ var _f = React.useState(durationMs / 1000),
16413
+ countdownRemaining = _f[0],
16414
+ setCountdownRemaining = _f[1];
16413
16415
  var verbiage = useTranslations(rawVerbiage, {
16414
16416
  headingText: 'Please read the following text aloud',
16415
16417
  doneBtnText: 'Done'
16416
16418
  });
16417
- var manualCountdown = function manualCountdown(remainingTime) {
16419
+ var manualCountdown = React.useCallback(function (remainingTime) {
16418
16420
  if (remainingTime > 0) {
16419
16421
  var nextCycle_1 = remainingTime - 1;
16420
16422
  setCountdownRemaining(nextCycle_1);
@@ -16422,7 +16424,7 @@ var ReadTextPrompt = function ReadTextPrompt(_a) {
16422
16424
  return manualCountdown(nextCycle_1);
16423
16425
  }, 1000);
16424
16426
  }
16425
- };
16427
+ }, []);
16426
16428
  React.useEffect(function () {
16427
16429
  setCountdownRemaining(countdownRemaining);
16428
16430
  countdownTimeoutRef.current = setTimeout(function () {
@@ -16431,7 +16433,18 @@ var ReadTextPrompt = function ReadTextPrompt(_a) {
16431
16433
  return function () {
16432
16434
  clearTimeout(countdownTimeoutRef.current);
16433
16435
  };
16434
- }, []);
16436
+ }, [countdownRemaining, manualCountdown]);
16437
+ var _g = React.useState(false),
16438
+ minReadingTimeElapsed = _g[0],
16439
+ setMinReadingTimeElapsed = _g[1];
16440
+ React.useEffect(function trackReadingTime() {
16441
+ var timeout = setTimeout(function () {
16442
+ setMinReadingTimeElapsed(true);
16443
+ }, minReadingMs);
16444
+ return function () {
16445
+ clearTimeout(timeout);
16446
+ };
16447
+ }, [minReadingMs]);
16435
16448
  return /*#__PURE__*/React__default['default'].createElement(ReadTextPromptContainer, {
16436
16449
  className: classNames.container
16437
16450
  }, /*#__PURE__*/React__default['default'].createElement(ReadTextPromptHeading, {
@@ -16446,7 +16459,8 @@ var ReadTextPrompt = function ReadTextPrompt(_a) {
16446
16459
  variant: "positive",
16447
16460
  className: classNames.doneBtn,
16448
16461
  onClick: onComplete,
16449
- finished: true
16462
+ disabled: !minReadingTimeElapsed,
16463
+ finished: minReadingTimeElapsed
16450
16464
  }, verbiage.doneBtnText)));
16451
16465
  };
16452
16466
  var ReadTextPromptContainer = styled__default['default'].div(templateObject_1$6 || (templateObject_1$6 = tslib.__makeTemplateObject(["\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n display: flex;\n flex-direction: column;\n"], ["\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n display: flex;\n flex-direction: column;\n"])));
@@ -16514,72 +16528,74 @@ var IdVideoCapture = function IdVideoCapture(_a) {
16514
16528
  readTextPrompt = _a.readTextPrompt,
16515
16529
  _4 = _a.readTextTimeoutDurationMs,
16516
16530
  readTextTimeoutDurationMs = _4 === void 0 ? 15000 : _4,
16517
- _5 = _a.disableFaceDetectionWhileAudioCapture,
16518
- disableFaceDetectionWhileAudioCapture = _5 === void 0 ? false : _5,
16519
- _6 = _a.disableFaceDetectionWhileAudioCaptureMsDelay,
16520
- disableFaceDetectionWhileAudioCaptureMsDelay = _6 === void 0 ? 2000 : _6,
16521
- _7 = _a.assets,
16522
- assets = _7 === void 0 ? {} : _7,
16523
- _8 = _a.classNames,
16524
- classNames = _8 === void 0 ? {} : _8,
16525
- _9 = _a.colors,
16526
- colors = _9 === void 0 ? {} : _9,
16527
- _10 = _a.verbiage,
16528
- rawVerbiage = _10 === void 0 ? {} : _10,
16529
- _11 = _a.debugMode,
16530
- debugMode = _11 === void 0 ? false : _11;
16531
- var _12 = useResizeObserver__default['default'](),
16532
- ref = _12.ref,
16533
- _13 = _12.width,
16534
- width = _13 === void 0 ? 1 : _13,
16535
- _14 = _12.height,
16536
- height = _14 === void 0 ? 1 : _14;
16537
- var _15 = React.useContext(CameraStateContext),
16538
- cameraRef = _15.cameraRef,
16539
- videoRef = _15.videoRef,
16540
- videoLoaded = _15.videoLoaded,
16541
- cameraReady = _15.cameraReady,
16542
- microphoneReady = _15.microphoneReady,
16543
- audioStream = _15.audioStream,
16544
- setVideoLoaded = _15.setVideoLoaded,
16545
- takePhoto = _15.takePhoto;
16546
- var _16 = React.useState([]),
16547
- detectedObjects = _16[0],
16548
- setDetectedObjects = _16[1];
16531
+ _5 = _a.readTextMinReadingMs,
16532
+ readTextMinReadingMs = _5 === void 0 ? 3000 : _5,
16533
+ _6 = _a.disableFaceDetectionWhileAudioCapture,
16534
+ disableFaceDetectionWhileAudioCapture = _6 === void 0 ? false : _6,
16535
+ _7 = _a.disableFaceDetectionWhileAudioCaptureMsDelay,
16536
+ disableFaceDetectionWhileAudioCaptureMsDelay = _7 === void 0 ? 2000 : _7,
16537
+ _8 = _a.assets,
16538
+ assets = _8 === void 0 ? {} : _8,
16539
+ _9 = _a.classNames,
16540
+ classNames = _9 === void 0 ? {} : _9,
16541
+ _10 = _a.colors,
16542
+ colors = _10 === void 0 ? {} : _10,
16543
+ _11 = _a.verbiage,
16544
+ rawVerbiage = _11 === void 0 ? {} : _11,
16545
+ _12 = _a.debugMode,
16546
+ debugMode = _12 === void 0 ? false : _12;
16547
+ var _13 = useResizeObserver__default['default'](),
16548
+ ref = _13.ref,
16549
+ _14 = _13.width,
16550
+ width = _14 === void 0 ? 1 : _14,
16551
+ _15 = _13.height,
16552
+ height = _15 === void 0 ? 1 : _15;
16553
+ var _16 = React.useContext(CameraStateContext),
16554
+ cameraRef = _16.cameraRef,
16555
+ videoRef = _16.videoRef,
16556
+ videoLoaded = _16.videoLoaded,
16557
+ cameraReady = _16.cameraReady,
16558
+ microphoneReady = _16.microphoneReady,
16559
+ audioStream = _16.audioStream,
16560
+ setVideoLoaded = _16.setVideoLoaded,
16561
+ takePhoto = _16.takePhoto;
16549
16562
  var _17 = React.useState([]),
16550
- faces = _17[0],
16551
- setFaces = _17[1];
16552
- var _18 = React.useContext(IdCaptureModelsContext),
16553
- idModelsReady = _18.ready,
16554
- idModelsWorking = _18.working,
16555
- makeIdPrediction = _18.makePrediction,
16556
- onIdPredictionMade = _18.onPredictionMade,
16557
- setThresholds = _18.setThresholds,
16558
- bestFrameDetectionScore = _18.bestFrameDetectionScore,
16559
- bestFrameFocusScore = _18.bestFrameFocusScore,
16560
- resetBestFrame = _18.resetBestFrame,
16561
- idModelError = _18.idModelError;
16562
- var _19 = React.useState(null),
16563
- videoStartsAt = _19[0],
16564
- setVideoStartsAt = _19[1];
16565
- var _20 = React.useContext(SubmissionContext),
16566
- setIdCaptureVideoAudioStartsAt = _20.setIdCaptureVideoAudioStartsAt,
16567
- setExpectedAudioText = _20.setExpectedAudioText;
16568
- var _21 = React.useContext(HighPerformanceSelfieGuidanceModelsContext),
16569
- onSelfiePredictionMade = _21.onPredictionMade,
16570
- selfieModelError = _21.error;
16571
- var _22 = useVideoRecorder(cameraRef.current, audioStream),
16572
- isRecordingVideo = _22.isRecordingVideo,
16573
- startRecordingVideo = _22.startRecordingVideo,
16574
- startRecordingAudio = _22.startRecordingAudio,
16575
- stopRecordingVideo = _22.stopRecordingVideo,
16576
- stopRecordingAudio = _22.stopRecordingAudio,
16577
- videoUrl = _22.videoUrl,
16578
- audioUrl = _22.audioUrl;
16563
+ detectedObjects = _17[0],
16564
+ setDetectedObjects = _17[1];
16565
+ var _18 = React.useState([]),
16566
+ faces = _18[0],
16567
+ setFaces = _18[1];
16568
+ var _19 = React.useContext(IdCaptureModelsContext),
16569
+ idModelsReady = _19.ready,
16570
+ idModelsWorking = _19.working,
16571
+ makeIdPrediction = _19.makePrediction,
16572
+ onIdPredictionMade = _19.onPredictionMade,
16573
+ setThresholds = _19.setThresholds,
16574
+ bestFrameDetectionScore = _19.bestFrameDetectionScore,
16575
+ bestFrameFocusScore = _19.bestFrameFocusScore,
16576
+ resetBestFrame = _19.resetBestFrame,
16577
+ idModelError = _19.idModelError;
16578
+ var _20 = React.useState(null),
16579
+ videoStartsAt = _20[0],
16580
+ setVideoStartsAt = _20[1];
16581
+ var _21 = React.useContext(SubmissionContext),
16582
+ setIdCaptureVideoAudioStartsAt = _21.setIdCaptureVideoAudioStartsAt,
16583
+ setExpectedAudioText = _21.setExpectedAudioText;
16584
+ var _22 = React.useContext(HighPerformanceSelfieGuidanceModelsContext),
16585
+ onSelfiePredictionMade = _22.onPredictionMade,
16586
+ selfieModelError = _22.error;
16587
+ var _23 = useVideoRecorder(cameraRef.current, audioStream),
16588
+ isRecordingVideo = _23.isRecordingVideo,
16589
+ startRecordingVideo = _23.startRecordingVideo,
16590
+ startRecordingAudio = _23.startRecordingAudio,
16591
+ stopRecordingVideo = _23.stopRecordingVideo,
16592
+ stopRecordingAudio = _23.stopRecordingAudio,
16593
+ videoUrl = _23.videoUrl,
16594
+ audioUrl = _23.audioUrl;
16579
16595
  var countdownTimeoutRef = React.useRef(undefined);
16580
- var _23 = React.useState(0),
16581
- countdownRemaining = _23[0],
16582
- setCountdownRemaining = _23[1];
16596
+ var _24 = React.useState(0),
16597
+ countdownRemaining = _24[0],
16598
+ setCountdownRemaining = _24[1];
16583
16599
  React.useEffect(function () {
16584
16600
  if (!isRecordingVideo && !videoUrl) {
16585
16601
  startRecordingVideo();
@@ -16595,9 +16611,9 @@ var IdVideoCapture = function IdVideoCapture(_a) {
16595
16611
  React.useEffect(function () {
16596
16612
  shouldCaptureFrames.current = videoLoaded && cameraReady && idModelsReady && !idModelError && (!readTextPrompt || microphoneReady);
16597
16613
  }, [cameraReady, idModelError, idModelsReady, microphoneReady, readTextPrompt, videoLoaded]);
16598
- var _24 = React.useState('SHOW_ID_FRONT'),
16599
- requestedAction = _24[0],
16600
- setRequestedAction = _24[1];
16614
+ var _25 = React.useState('SHOW_ID_FRONT'),
16615
+ requestedAction = _25[0],
16616
+ setRequestedAction = _25[1];
16601
16617
  React.useEffect(function () {
16602
16618
  if (requestedAction !== 'SHOW_ID_FRONT' && requestedAction !== 'SHOW_ID_BACK') return;
16603
16619
  if (!idCaptureModelsEnabled || !idModelsReady || !cameraReady || !videoLoaded || idModelError) return;
@@ -16625,15 +16641,15 @@ var IdVideoCapture = function IdVideoCapture(_a) {
16625
16641
  }
16626
16642
  });
16627
16643
  }, [idCardBackDetectionThreshold, idCardBackFocusThreshold, idCardFrontDetectionThreshold, idCardFrontFocusThreshold, requestedAction, setThresholds]);
16628
- var _25 = React.useState(0),
16629
- currentDetectionScore = _25[0],
16630
- setCurrentDetectionScore = _25[1];
16631
16644
  var _26 = React.useState(0),
16632
- currentFocusScore = _26[0],
16633
- setCurrentFocusScore = _26[1];
16645
+ currentDetectionScore = _26[0],
16646
+ setCurrentDetectionScore = _26[1];
16634
16647
  var _27 = React.useState(0),
16635
- goodFramesCount = _27[0],
16636
- setGoodFramesCount = _27[1];
16648
+ currentFocusScore = _27[0],
16649
+ setCurrentFocusScore = _27[1];
16650
+ var _28 = React.useState(0),
16651
+ goodFramesCount = _28[0],
16652
+ setGoodFramesCount = _28[1];
16637
16653
  var goodFramesThreshold = requestedAction === 'SHOW_ID_FRONT' ? goodIdCardFrontFramesThreshold : goodIdCardBackFramesThreshold;
16638
16654
  var goodFramesThresholdMet = goodFramesCount >= goodFramesThreshold;
16639
16655
  React.useEffect(function () {
@@ -16651,9 +16667,9 @@ var IdVideoCapture = function IdVideoCapture(_a) {
16651
16667
  }
16652
16668
  });
16653
16669
  }, [idCaptureModelsEnabled, idCardFrontDetectionThreshold, onIdPredictionMade, idModelError]);
16654
- var _28 = React.useState(null),
16655
- idFrontCaptureStartedAt = _28[0],
16656
- setFirstGoodFrameTime = _28[1];
16670
+ var _29 = React.useState(null),
16671
+ idFrontCaptureStartedAt = _29[0],
16672
+ setFirstGoodFrameTime = _29[1];
16657
16673
  React.useEffect(function () {
16658
16674
  if (goodFramesCount === 1) setFirstGoodFrameTime(new Date().getTime());
16659
16675
  }, [goodFramesCount]);
@@ -16674,9 +16690,9 @@ var IdVideoCapture = function IdVideoCapture(_a) {
16674
16690
  var frameHeight = (_e = (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.videoHeight) !== null && _e !== void 0 ? _e : 0;
16675
16691
  var faceBox = (_f = faces === null || faces === void 0 ? void 0 : faces[0]) === null || _f === void 0 ? void 0 : _f.box;
16676
16692
  var faceCentered = !faceBox || !frameWidth || faceBox.xMin > frameWidth * edgeBoundary && faceBox.yMin > frameHeight * edgeBoundary && faceBox.xMax < frameWidth * (1 - edgeBoundary) && faceBox.yMax < frameHeight * (1 - edgeBoundary);
16677
- var _29 = React.useState(),
16678
- countdownStartedAt = _29[0],
16679
- setCountdownStartedAt = _29[1];
16693
+ var _30 = React.useState(),
16694
+ countdownStartedAt = _30[0],
16695
+ setCountdownStartedAt = _30[1];
16680
16696
  var frameLock = React.useRef(false);
16681
16697
  var captureFrame = React.useCallback(function () {
16682
16698
  return tslib.__awaiter(void 0, void 0, void 0, function () {
@@ -16797,9 +16813,9 @@ var IdVideoCapture = function IdVideoCapture(_a) {
16797
16813
  };
16798
16814
  }, [captureCountdownSeconds, captureFrame, countdownStartedAt, manualCountdown]);
16799
16815
  var timeoutStartedAt = useTimeout(readTextTimeoutDurationMs, stopRecording, requestedAction !== 'READ_TEXT', false, requestedAction === 'READ_TEXT').timeoutStartedAt;
16800
- var _30 = React.useState(0),
16801
- numFramesWithoutFaces = _30[0],
16802
- setNumFramesWithoutFaces = _30[1];
16816
+ var _31 = React.useState(0),
16817
+ numFramesWithoutFaces = _31[0],
16818
+ setNumFramesWithoutFaces = _31[1];
16803
16819
  React.useEffect(function () {
16804
16820
  if (!selfieModelError) {
16805
16821
  onSelfiePredictionMade(function (faces) {
@@ -16817,14 +16833,14 @@ var IdVideoCapture = function IdVideoCapture(_a) {
16817
16833
  }
16818
16834
  }, [disableFaceDetectionWhileAudioCapture, disableFaceDetectionWhileAudioCaptureMsDelay, numFramesWithoutFaces, onFaceNotDetected, timeoutStartedAt]);
16819
16835
  var theme = styled.useTheme();
16820
- var _31 = useTranslations(rawVerbiage, {
16836
+ var _32 = useTranslations(rawVerbiage, {
16821
16837
  faceNotCenteredText: 'Please move your face to the center...',
16822
16838
  searchingForIdCardText: 'Searching for ID card...',
16823
16839
  captureBtnText: 'Capture'
16824
16840
  }),
16825
- captureBtnText = _31.captureBtnText,
16826
- faceNotCenteredText = _31.faceNotCenteredText,
16827
- searchingForIdCardText = _31.searchingForIdCardText;
16841
+ captureBtnText = _32.captureBtnText,
16842
+ faceNotCenteredText = _32.faceNotCenteredText,
16843
+ searchingForIdCardText = _32.searchingForIdCardText;
16828
16844
  var debugScalingDetails = useDebugScalingDetails({
16829
16845
  enabled: debugMode,
16830
16846
  pageWidth: width,
@@ -16842,6 +16858,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
16842
16858
  text: readTextPrompt,
16843
16859
  startedAt: timeoutStartedAt || undefined,
16844
16860
  durationMs: readTextTimeoutDurationMs,
16861
+ minReadingMs: readTextMinReadingMs,
16845
16862
  classNames: classNames.readTextPrompt,
16846
16863
  verbiage: rawVerbiage.readTextPrompt,
16847
16864
  onComplete: stopRecording
@@ -17037,6 +17054,7 @@ var VideoIdWizard = function VideoIdWizard(_a) {
17037
17054
  goodIdCardBackFramesThreshold = _a.goodIdCardBackFramesThreshold,
17038
17055
  readTextPrompt = _a.readTextPrompt,
17039
17056
  readTextTimeoutDurationMs = _a.readTextTimeoutDurationMs,
17057
+ readTextMinReadingMs = _a.readTextMinReadingMs,
17040
17058
  _k = _a.skipIdCapture,
17041
17059
  skipIdCapture = _k === void 0 ? false : _k,
17042
17060
  _l = _a.skipShowIdCardBack,
@@ -17221,6 +17239,7 @@ var VideoIdWizard = function VideoIdWizard(_a) {
17221
17239
  disableFaceDetectionWhileAudioCaptureMsDelay: disableFaceDetectionWhileAudioCaptureMsDelay,
17222
17240
  readTextPrompt: readTextPrompt,
17223
17241
  readTextTimeoutDurationMs: readTextTimeoutDurationMs,
17242
+ readTextMinReadingMs: readTextMinReadingMs,
17224
17243
  assets: assets.idVideoCapture,
17225
17244
  classNames: classNames.idVideoCapture,
17226
17245
  colors: colors.idVideoCapture,
@@ -19492,50 +19511,52 @@ var VideoIdValidation = function VideoIdValidation(_a) {
19492
19511
  readTextPrompt = _a.readTextPrompt,
19493
19512
  _k = _a.readTextTimeoutDurationMs,
19494
19513
  readTextTimeoutDurationMs = _k === void 0 ? 15000 : _k,
19495
- _l = _a.skipSuccessScreen,
19496
- skipSuccessScreen = _l === void 0 ? false : _l,
19497
- _m = _a.skipIdCapture,
19498
- skipIdCapture = _m === void 0 ? false : _m,
19499
- _o = _a.skipShowIdCardBack,
19500
- skipShowIdCardBack = _o === void 0 ? false : _o,
19501
- _p = _a.idCaptureLoadingOverlayMode,
19502
- idCaptureLoadingOverlayMode = _p === void 0 ? 'default' : _p,
19503
- _q = _a.idCaptureGuideType,
19504
- idCaptureGuideType = _q === void 0 ? 'fit' : _q,
19505
- _r = _a.idCapturePortraitGuidesOnMobile,
19506
- idCapturePortraitGuidesOnMobile = _r === void 0 ? false : _r,
19507
- _s = _a.idCaptureRotateLoadingOverlayImageWhenPortrait,
19508
- idCaptureRotateLoadingOverlayImageWhenPortrait = _s === void 0 ? true : _s,
19509
- _t = _a.faceLivenessLoadingOverlayMode,
19510
- faceLivenessLoadingOverlayMode = _t === void 0 ? 'default' : _t,
19511
- _u = _a.disableFaceDetectionWhileAudioCapture,
19512
- disableFaceDetectionWhileAudioCapture = _u === void 0 ? false : _u,
19513
- _v = _a.disableFaceDetectionWhileAudioCaptureMsDelay,
19514
- disableFaceDetectionWhileAudioCaptureMsDelay = _v === void 0 ? 2000 : _v,
19515
- _w = _a.silentFallback,
19516
- silentFallback = _w === void 0 ? false : _w,
19517
- _x = _a.theme,
19518
- theme = _x === void 0 ? 'default' : _x,
19519
- _y = _a.assets,
19520
- assets = _y === void 0 ? {} : _y,
19521
- _z = _a.classNames,
19522
- classNames = _z === void 0 ? {} : _z,
19523
- _0 = _a.colors,
19524
- colors = _0 === void 0 ? {} : _0,
19525
- _1 = _a.verbiage,
19526
- verbiage = _1 === void 0 ? {} : _1,
19527
- _2 = _a.captureSignature,
19528
- captureSignature = _2 === void 0 ? false : _2,
19529
- _3 = _a.captureSignatureVideo,
19530
- captureSignatureVideo = _3 === void 0 ? false : _3,
19531
- _4 = _a.captureAdditionalDocuments,
19532
- captureAdditionalDocuments = _4 === void 0 ? [] : _4,
19533
- _5 = _a.geolocationEnabled,
19534
- geolocationEnabled = _5 === void 0 ? true : _5,
19535
- _6 = _a.geolocationRequired,
19536
- geolocationRequired = _6 === void 0 ? false : _6,
19537
- _7 = _a.debugMode,
19538
- debugMode = _7 === void 0 ? false : _7;
19514
+ _l = _a.readTextMinReadingMs,
19515
+ readTextMinReadingMs = _l === void 0 ? 3000 : _l,
19516
+ _m = _a.skipSuccessScreen,
19517
+ skipSuccessScreen = _m === void 0 ? false : _m,
19518
+ _o = _a.skipIdCapture,
19519
+ skipIdCapture = _o === void 0 ? false : _o,
19520
+ _p = _a.skipShowIdCardBack,
19521
+ skipShowIdCardBack = _p === void 0 ? false : _p,
19522
+ _q = _a.idCaptureLoadingOverlayMode,
19523
+ idCaptureLoadingOverlayMode = _q === void 0 ? 'default' : _q,
19524
+ _r = _a.idCaptureGuideType,
19525
+ idCaptureGuideType = _r === void 0 ? 'fit' : _r,
19526
+ _s = _a.idCapturePortraitGuidesOnMobile,
19527
+ idCapturePortraitGuidesOnMobile = _s === void 0 ? false : _s,
19528
+ _t = _a.idCaptureRotateLoadingOverlayImageWhenPortrait,
19529
+ idCaptureRotateLoadingOverlayImageWhenPortrait = _t === void 0 ? true : _t,
19530
+ _u = _a.faceLivenessLoadingOverlayMode,
19531
+ faceLivenessLoadingOverlayMode = _u === void 0 ? 'default' : _u,
19532
+ _v = _a.disableFaceDetectionWhileAudioCapture,
19533
+ disableFaceDetectionWhileAudioCapture = _v === void 0 ? false : _v,
19534
+ _w = _a.disableFaceDetectionWhileAudioCaptureMsDelay,
19535
+ disableFaceDetectionWhileAudioCaptureMsDelay = _w === void 0 ? 2000 : _w,
19536
+ _x = _a.silentFallback,
19537
+ silentFallback = _x === void 0 ? false : _x,
19538
+ _y = _a.theme,
19539
+ theme = _y === void 0 ? 'default' : _y,
19540
+ _z = _a.assets,
19541
+ assets = _z === void 0 ? {} : _z,
19542
+ _0 = _a.classNames,
19543
+ classNames = _0 === void 0 ? {} : _0,
19544
+ _1 = _a.colors,
19545
+ colors = _1 === void 0 ? {} : _1,
19546
+ _2 = _a.verbiage,
19547
+ verbiage = _2 === void 0 ? {} : _2,
19548
+ _3 = _a.captureSignature,
19549
+ captureSignature = _3 === void 0 ? false : _3,
19550
+ _4 = _a.captureSignatureVideo,
19551
+ captureSignatureVideo = _4 === void 0 ? false : _4,
19552
+ _5 = _a.captureAdditionalDocuments,
19553
+ captureAdditionalDocuments = _5 === void 0 ? [] : _5,
19554
+ _6 = _a.geolocationEnabled,
19555
+ geolocationEnabled = _6 === void 0 ? true : _6,
19556
+ _7 = _a.geolocationRequired,
19557
+ geolocationRequired = _7 === void 0 ? false : _7,
19558
+ _8 = _a.debugMode,
19559
+ debugMode = _8 === void 0 ? false : _8;
19539
19560
  useLanguage(lang);
19540
19561
  useDebugLogging(debugMode);
19541
19562
  var videoIdCaptureProps = React.useMemo(function () {
@@ -19551,6 +19572,7 @@ var VideoIdValidation = function VideoIdValidation(_a) {
19551
19572
  goodIdCardBackFramesThreshold: goodIdCardBackFramesThreshold,
19552
19573
  readTextPrompt: readTextPrompt,
19553
19574
  readTextTimeoutDurationMs: readTextTimeoutDurationMs,
19575
+ readTextMinReadingMs: readTextMinReadingMs,
19554
19576
  onExitCapture: onExitCapture,
19555
19577
  onExitAfterFailure: onExitAfterFailure,
19556
19578
  onUserCancel: onUserCancel,
@@ -19571,7 +19593,7 @@ var VideoIdValidation = function VideoIdValidation(_a) {
19571
19593
  verbiage: verbiage,
19572
19594
  debugMode: debugMode
19573
19595
  };
19574
- }, [assets, classNames, colors, debugMode, faceLivenessLoadingOverlayMode, faceLivenessProps, goodIdCardBackFramesThreshold, goodIdCardFrontFramesThreshold, idCaptureGuideType, idCaptureLoadingOverlayMode, idCaptureModelsEnabled, idCapturePortraitGuidesOnMobile, idCaptureProps, idCaptureRotateLoadingOverlayImageWhenPortrait, disableFaceDetectionWhileAudioCapture, disableFaceDetectionWhileAudioCaptureMsDelay, silentFallback, idCardBackDetectionThreshold, idCardBackFocusThreshold, idCardFrontDetectionThreshold, idCardFrontFocusThreshold, onExitAfterFailure, onExitCapture, onUserCancel, readTextPrompt, readTextTimeoutDurationMs, skipIdCapture, skipShowIdCardBack, skipSuccessScreen, verbiage]);
19596
+ }, [idCaptureProps, faceLivenessProps, idCaptureModelsEnabled, idCardFrontDetectionThreshold, idCardFrontFocusThreshold, goodIdCardFrontFramesThreshold, idCardBackDetectionThreshold, idCardBackFocusThreshold, goodIdCardBackFramesThreshold, readTextPrompt, readTextTimeoutDurationMs, readTextMinReadingMs, onExitCapture, onExitAfterFailure, onUserCancel, skipSuccessScreen, skipIdCapture, skipShowIdCardBack, idCaptureLoadingOverlayMode, idCaptureGuideType, idCapturePortraitGuidesOnMobile, idCaptureRotateLoadingOverlayImageWhenPortrait, faceLivenessLoadingOverlayMode, disableFaceDetectionWhileAudioCapture, disableFaceDetectionWhileAudioCaptureMsDelay, silentFallback, assets, classNames, colors, verbiage, debugMode]);
19575
19597
  var additionalDocumentCaptureProps = React.useMemo(function () {
19576
19598
  return {
19577
19599
  documents: captureAdditionalDocuments,