idmission-web-sdk 2.1.112 → 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.
- package/dist/sdk2.cjs.development.js +23 -19
- package/dist/sdk2.cjs.development.js.map +1 -1
- package/dist/sdk2.cjs.production.js +1 -1
- package/dist/sdk2.cjs.production.js.map +1 -1
- package/dist/sdk2.esm.js +23 -19
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +23 -19
- package/dist/sdk2.umd.development.js.map +1 -1
- package/dist/sdk2.umd.production.js +1 -1
- package/dist/sdk2.umd.production.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -234,7 +234,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
234
234
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
235
235
|
};
|
|
236
236
|
|
|
237
|
-
var webSdkVersion = '2.1.
|
|
237
|
+
var webSdkVersion = '2.1.113';
|
|
238
238
|
|
|
239
239
|
function getPlatform() {
|
|
240
240
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -14231,12 +14231,15 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14231
14231
|
var _25 = React.useState(0),
|
|
14232
14232
|
currentDetectionScore = _25[0],
|
|
14233
14233
|
setCurrentDetectionScore = _25[1];
|
|
14234
|
-
var _26 = React.useState(
|
|
14235
|
-
|
|
14236
|
-
|
|
14234
|
+
var _26 = React.useState('none'),
|
|
14235
|
+
currentDetectedDocumentType = _26[0],
|
|
14236
|
+
setCurrentDetectedDocumentType = _26[1];
|
|
14237
14237
|
var _27 = React.useState(0),
|
|
14238
|
-
|
|
14239
|
-
|
|
14238
|
+
currentFocusScore = _27[0],
|
|
14239
|
+
setCurrentFocusScore = _27[1];
|
|
14240
|
+
var _28 = React.useState(0),
|
|
14241
|
+
goodFramesCount = _28[0],
|
|
14242
|
+
setGoodFramesCount = _28[1];
|
|
14240
14243
|
var goodFramesThreshold = requestedAction === 'SHOW_ID_FRONT' ? videoIdCaptureThresholds.goodFrames.idCardFront : videoIdCaptureThresholds.goodFrames.idCardBack;
|
|
14241
14244
|
var goodFramesThresholdMet = goodFramesCount >= goodFramesThreshold;
|
|
14242
14245
|
React.useEffect(function () {
|
|
@@ -14244,6 +14247,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14244
14247
|
onIdPredictionMade(function (prediction) {
|
|
14245
14248
|
setDetectedObjects(prediction.detectedObjects);
|
|
14246
14249
|
setCurrentDetectionScore(prediction.detectionScore);
|
|
14250
|
+
setCurrentDetectedDocumentType(prediction.detectedDocumentType);
|
|
14247
14251
|
setCurrentFocusScore(prediction.focusScore);
|
|
14248
14252
|
var detectionThresholdMet = requestedAction === 'SHOW_ID_FRONT' ? prediction.idCardFrontDetectionThresholdMet : prediction.idCardBackDetectionThresholdMet;
|
|
14249
14253
|
var isGoodFrame = detectionThresholdMet && prediction.focusThresholdMet;
|
|
@@ -14256,9 +14260,9 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14256
14260
|
} : 0);
|
|
14257
14261
|
});
|
|
14258
14262
|
}, [idCaptureModelsEnabled, onIdPredictionMade, idModelError, requestedAction, videoIdCaptureThresholds.flipShortcutThreshold]);
|
|
14259
|
-
var
|
|
14260
|
-
idFrontCaptureStartedAt =
|
|
14261
|
-
setFirstGoodFrameTime =
|
|
14263
|
+
var _29 = React.useState(null),
|
|
14264
|
+
idFrontCaptureStartedAt = _29[0],
|
|
14265
|
+
setFirstGoodFrameTime = _29[1];
|
|
14262
14266
|
React.useEffect(function () {
|
|
14263
14267
|
if (goodFramesCount === 1) setFirstGoodFrameTime(new Date().getTime());
|
|
14264
14268
|
}, [goodFramesCount]);
|
|
@@ -14279,9 +14283,9 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14279
14283
|
var frameHeight = (_e = (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.videoHeight) !== null && _e !== void 0 ? _e : 0;
|
|
14280
14284
|
var faceBox = face === null || face === void 0 ? void 0 : face.box;
|
|
14281
14285
|
var faceCentered = !faceBox || !frameWidth || faceBox.xMin > frameWidth * edgeBoundary && faceBox.yMin > frameHeight * edgeBoundary && faceBox.xMax < frameWidth * (1 - edgeBoundary) && faceBox.yMax < frameHeight * (1 - edgeBoundary);
|
|
14282
|
-
var
|
|
14283
|
-
countdownStartedAt =
|
|
14284
|
-
setCountdownStartedAt =
|
|
14286
|
+
var _30 = React.useState(),
|
|
14287
|
+
countdownStartedAt = _30[0],
|
|
14288
|
+
setCountdownStartedAt = _30[1];
|
|
14285
14289
|
var photoCanvas = React.useRef(null);
|
|
14286
14290
|
var frameLock = React.useRef(false);
|
|
14287
14291
|
var captureFrame = React.useCallback(function () {
|
|
@@ -14404,9 +14408,9 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14404
14408
|
stopSelfieGuidance();
|
|
14405
14409
|
};
|
|
14406
14410
|
}, [startSelfieGuidance, stopSelfieGuidance]);
|
|
14407
|
-
var
|
|
14408
|
-
numFramesWithoutFaces =
|
|
14409
|
-
setNumFramesWithoutFaces =
|
|
14411
|
+
var _31 = React.useState(0),
|
|
14412
|
+
numFramesWithoutFaces = _31[0],
|
|
14413
|
+
setNumFramesWithoutFaces = _31[1];
|
|
14410
14414
|
onSelfiePredictionMade(useDebounce.useThrottledCallback(React.useCallback(function (_a) {
|
|
14411
14415
|
var face = _a.face;
|
|
14412
14416
|
if (selfieModelError) return;
|
|
@@ -14422,12 +14426,12 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14422
14426
|
}
|
|
14423
14427
|
}, [disableFaceDetectionWhileAudioCapture, disableFaceDetectionWhileAudioCaptureMsDelay, numFramesWithoutFaces, onFaceNotDetected, timeoutStartedAt]);
|
|
14424
14428
|
var theme = styled.useTheme();
|
|
14425
|
-
var
|
|
14429
|
+
var _32 = useTranslations(rawVerbiage, {
|
|
14426
14430
|
faceNotCenteredText: 'Please move your face to the center...',
|
|
14427
14431
|
captureBtnText: 'Capture'
|
|
14428
14432
|
}),
|
|
14429
|
-
captureBtnText =
|
|
14430
|
-
faceNotCenteredText =
|
|
14433
|
+
captureBtnText = _32.captureBtnText,
|
|
14434
|
+
faceNotCenteredText = _32.faceNotCenteredText;
|
|
14431
14435
|
var debugScalingDetails = useDebugScalingDetails({
|
|
14432
14436
|
enabled: debugMode,
|
|
14433
14437
|
pageWidth: width,
|
|
@@ -14482,7 +14486,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14482
14486
|
className: classNames.guidanceMessage,
|
|
14483
14487
|
"$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',
|
|
14484
14488
|
"$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'
|
|
14485
|
-
}, guidanceText))), debugMode && ( /*#__PURE__*/React__namespace.default.createElement(DebugStatsPane, null, cameraRef.current ? ( /*#__PURE__*/React__namespace.default.createElement(React__namespace.default.Fragment, null, "\u2705 Camera: ", cameraRef.current.label, " (", cameraRef.current.width, "x", cameraRef.current.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React__namespace.default.createElement("br", null), isRecordingVideo ? '✅ Recording' : '❌ Not recording', /*#__PURE__*/React__namespace.default.createElement("br", null), goodFramesThresholdMet ? '✅' : '❌', " Good Frame Count:", ' ', goodFramesCount, "/", goodFramesThreshold, /*#__PURE__*/React__namespace.default.createElement("br", null), "Detection Score: ", currentDetectionScore, /*#__PURE__*/React__namespace.default.createElement("br", null), "Focus Score: ", currentFocusScore, /*#__PURE__*/React__namespace.default.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__namespace.default.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__namespace.default.createElement(CountdownContainer, {
|
|
14489
|
+
}, guidanceText))), debugMode && ( /*#__PURE__*/React__namespace.default.createElement(DebugStatsPane, null, cameraRef.current ? ( /*#__PURE__*/React__namespace.default.createElement(React__namespace.default.Fragment, null, "\u2705 Camera: ", cameraRef.current.label, " (", cameraRef.current.width, "x", cameraRef.current.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React__namespace.default.createElement("br", null), isRecordingVideo ? '✅ Recording' : '❌ Not recording', /*#__PURE__*/React__namespace.default.createElement("br", null), goodFramesThresholdMet ? '✅' : '❌', " Good Frame Count:", ' ', goodFramesCount, "/", goodFramesThreshold, /*#__PURE__*/React__namespace.default.createElement("br", null), "Document Type: ", currentDetectedDocumentType, /*#__PURE__*/React__namespace.default.createElement("br", null), "Detection Score: ", currentDetectionScore, /*#__PURE__*/React__namespace.default.createElement("br", null), "Focus Score: ", currentFocusScore, /*#__PURE__*/React__namespace.default.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__namespace.default.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__namespace.default.createElement(CountdownContainer, {
|
|
14486
14490
|
className: classNames.countdownContainer
|
|
14487
14491
|
}, /*#__PURE__*/React__namespace.default.createElement(Countdown, {
|
|
14488
14492
|
className: classNames.countdown
|