idmission-web-sdk 2.1.111 → 2.1.113

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.
@@ -215,7 +215,7 @@
215
215
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
216
216
  };
217
217
 
218
- var webSdkVersion = '2.1.111';
218
+ var webSdkVersion = '2.1.113';
219
219
 
220
220
  function getPlatform() {
221
221
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -11235,7 +11235,7 @@
11235
11235
  _b = _a.requireVerticalFaceCentering,
11236
11236
  requireVerticalFaceCentering = _b === void 0 ? true : _b,
11237
11237
  _c = _a.stabilityThreshold,
11238
- stabilityThreshold = _c === void 0 ? 0.8 : _c;
11238
+ stabilityThreshold = _c === void 0 ? 0.85 : _c;
11239
11239
  var face = faces[0];
11240
11240
  var faceNotDetected = faces.length === 0;
11241
11241
  var faceNotCentered = requireVerticalFaceCentering,
@@ -11268,7 +11268,7 @@
11268
11268
  }
11269
11269
  var faceInGuides = !faceNotDetected && !faceNotCentered && !faceLookingAway && !faceTooClose && !faceTooFar;
11270
11270
  if (lastFaceDetectionTime > 0) {
11271
- trackFramesNeeded$1(1000 / lastFaceDetectionTime);
11271
+ trackFramesNeeded$1(500 / lastFaceDetectionTime);
11272
11272
  }
11273
11273
  var faceIsStable = false;
11274
11274
  if (faceInGuides) {
@@ -23833,12 +23833,15 @@
23833
23833
  var _25 = React.useState(0),
23834
23834
  currentDetectionScore = _25[0],
23835
23835
  setCurrentDetectionScore = _25[1];
23836
- var _26 = React.useState(0),
23837
- currentFocusScore = _26[0],
23838
- setCurrentFocusScore = _26[1];
23836
+ var _26 = React.useState('none'),
23837
+ currentDetectedDocumentType = _26[0],
23838
+ setCurrentDetectedDocumentType = _26[1];
23839
23839
  var _27 = React.useState(0),
23840
- goodFramesCount = _27[0],
23841
- setGoodFramesCount = _27[1];
23840
+ currentFocusScore = _27[0],
23841
+ setCurrentFocusScore = _27[1];
23842
+ var _28 = React.useState(0),
23843
+ goodFramesCount = _28[0],
23844
+ setGoodFramesCount = _28[1];
23842
23845
  var goodFramesThreshold = requestedAction === 'SHOW_ID_FRONT' ? videoIdCaptureThresholds.goodFrames.idCardFront : videoIdCaptureThresholds.goodFrames.idCardBack;
23843
23846
  var goodFramesThresholdMet = goodFramesCount >= goodFramesThreshold;
23844
23847
  React.useEffect(function () {
@@ -23846,6 +23849,7 @@
23846
23849
  onIdPredictionMade(function (prediction) {
23847
23850
  setDetectedObjects(prediction.detectedObjects);
23848
23851
  setCurrentDetectionScore(prediction.detectionScore);
23852
+ setCurrentDetectedDocumentType(prediction.detectedDocumentType);
23849
23853
  setCurrentFocusScore(prediction.focusScore);
23850
23854
  var detectionThresholdMet = requestedAction === 'SHOW_ID_FRONT' ? prediction.idCardFrontDetectionThresholdMet : prediction.idCardBackDetectionThresholdMet;
23851
23855
  var isGoodFrame = detectionThresholdMet && prediction.focusThresholdMet;
@@ -23858,9 +23862,9 @@
23858
23862
  } : 0);
23859
23863
  });
23860
23864
  }, [idCaptureModelsEnabled, onIdPredictionMade, idModelError, requestedAction, videoIdCaptureThresholds.flipShortcutThreshold]);
23861
- var _28 = React.useState(null),
23862
- idFrontCaptureStartedAt = _28[0],
23863
- setFirstGoodFrameTime = _28[1];
23865
+ var _29 = React.useState(null),
23866
+ idFrontCaptureStartedAt = _29[0],
23867
+ setFirstGoodFrameTime = _29[1];
23864
23868
  React.useEffect(function () {
23865
23869
  if (goodFramesCount === 1) setFirstGoodFrameTime(new Date().getTime());
23866
23870
  }, [goodFramesCount]);
@@ -23881,9 +23885,9 @@
23881
23885
  var frameHeight = (_e = (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.videoHeight) !== null && _e !== void 0 ? _e : 0;
23882
23886
  var faceBox = face === null || face === void 0 ? void 0 : face.box;
23883
23887
  var faceCentered = !faceBox || !frameWidth || faceBox.xMin > frameWidth * edgeBoundary && faceBox.yMin > frameHeight * edgeBoundary && faceBox.xMax < frameWidth * (1 - edgeBoundary) && faceBox.yMax < frameHeight * (1 - edgeBoundary);
23884
- var _29 = React.useState(),
23885
- countdownStartedAt = _29[0],
23886
- setCountdownStartedAt = _29[1];
23888
+ var _30 = React.useState(),
23889
+ countdownStartedAt = _30[0],
23890
+ setCountdownStartedAt = _30[1];
23887
23891
  var photoCanvas = React.useRef(null);
23888
23892
  var frameLock = React.useRef(false);
23889
23893
  var captureFrame = React.useCallback(function () {
@@ -24006,9 +24010,9 @@
24006
24010
  stopSelfieGuidance();
24007
24011
  };
24008
24012
  }, [startSelfieGuidance, stopSelfieGuidance]);
24009
- var _30 = React.useState(0),
24010
- numFramesWithoutFaces = _30[0],
24011
- setNumFramesWithoutFaces = _30[1];
24013
+ var _31 = React.useState(0),
24014
+ numFramesWithoutFaces = _31[0],
24015
+ setNumFramesWithoutFaces = _31[1];
24012
24016
  onSelfiePredictionMade(f(React.useCallback(function (_a) {
24013
24017
  var face = _a.face;
24014
24018
  if (selfieModelError) return;
@@ -24024,12 +24028,12 @@
24024
24028
  }
24025
24029
  }, [disableFaceDetectionWhileAudioCapture, disableFaceDetectionWhileAudioCaptureMsDelay, numFramesWithoutFaces, onFaceNotDetected, timeoutStartedAt]);
24026
24030
  var theme = styled.useTheme();
24027
- var _31 = useTranslations(rawVerbiage, {
24031
+ var _32 = useTranslations(rawVerbiage, {
24028
24032
  faceNotCenteredText: 'Please move your face to the center...',
24029
24033
  captureBtnText: 'Capture'
24030
24034
  }),
24031
- captureBtnText = _31.captureBtnText,
24032
- faceNotCenteredText = _31.faceNotCenteredText;
24035
+ captureBtnText = _32.captureBtnText,
24036
+ faceNotCenteredText = _32.faceNotCenteredText;
24033
24037
  var debugScalingDetails = useDebugScalingDetails({
24034
24038
  enabled: debugMode,
24035
24039
  pageWidth: width,
@@ -24084,7 +24088,7 @@
24084
24088
  className: classNames.guidanceMessage,
24085
24089
  "$background": (_p = (_o = (_m = theme.guidanceMessages) === null || _m === void 0 ? void 0 : _m.negative) === null || _o === void 0 ? void 0 : _o.backgroundColor) !== null && _p !== void 0 ? _p : 'red',
24086
24090
  "$textColor": (_s = (_r = (_q = theme.guidanceMessages) === null || _q === void 0 ? void 0 : _q.negative) === null || _r === void 0 ? void 0 : _r.textColor) !== null && _s !== void 0 ? _s : 'white'
24087
- }, guidanceText))), debugMode && ( /*#__PURE__*/React.createElement(DebugStatsPane, null, cameraRef.current ? ( /*#__PURE__*/React.createElement(React.Fragment, null, "\u2705 Camera: ", cameraRef.current.label, " (", cameraRef.current.width, "x", cameraRef.current.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React.createElement("br", null), isRecordingVideo ? '✅ Recording' : '❌ Not recording', /*#__PURE__*/React.createElement("br", null), goodFramesThresholdMet ? '✅' : '❌', " Good Frame Count:", ' ', goodFramesCount, "/", goodFramesThreshold, /*#__PURE__*/React.createElement("br", null), "Detection Score: ", currentDetectionScore, /*#__PURE__*/React.createElement("br", null), "Focus Score: ", currentFocusScore, /*#__PURE__*/React.createElement("br", null), "Best Frame Detection Score:", ' ', (_u = (_t = bestFrameDetails.current) === null || _t === void 0 ? void 0 : _t.detectionScore) !== null && _u !== void 0 ? _u : 0, /*#__PURE__*/React.createElement("br", null), "Best Frame Focus Score: ", (_w = (_v = bestFrameDetails.current) === null || _v === void 0 ? void 0 : _v.focusScore) !== null && _w !== void 0 ? _w : 0)), countdownRemaining > 0 && capturingId && ( /*#__PURE__*/React.createElement(CountdownContainer, {
24091
+ }, guidanceText))), debugMode && ( /*#__PURE__*/React.createElement(DebugStatsPane, null, cameraRef.current ? ( /*#__PURE__*/React.createElement(React.Fragment, null, "\u2705 Camera: ", cameraRef.current.label, " (", cameraRef.current.width, "x", cameraRef.current.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React.createElement("br", null), isRecordingVideo ? '✅ Recording' : '❌ Not recording', /*#__PURE__*/React.createElement("br", null), goodFramesThresholdMet ? '✅' : '❌', " Good Frame Count:", ' ', goodFramesCount, "/", goodFramesThreshold, /*#__PURE__*/React.createElement("br", null), "Document Type: ", currentDetectedDocumentType, /*#__PURE__*/React.createElement("br", null), "Detection Score: ", currentDetectionScore, /*#__PURE__*/React.createElement("br", null), "Focus Score: ", currentFocusScore, /*#__PURE__*/React.createElement("br", null), "Best Frame Detection Score:", ' ', (_u = (_t = bestFrameDetails.current) === null || _t === void 0 ? void 0 : _t.detectionScore) !== null && _u !== void 0 ? _u : 0, /*#__PURE__*/React.createElement("br", null), "Best Frame Focus Score: ", (_w = (_v = bestFrameDetails.current) === null || _v === void 0 ? void 0 : _v.focusScore) !== null && _w !== void 0 ? _w : 0)), countdownRemaining > 0 && capturingId && ( /*#__PURE__*/React.createElement(CountdownContainer, {
24088
24092
  className: classNames.countdownContainer
24089
24093
  }, /*#__PURE__*/React.createElement(Countdown, {
24090
24094
  className: classNames.countdown