idmission-web-sdk 2.1.71 → 2.1.73
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/components/id_capture/IdCapture.d.ts +0 -1
- package/dist/components/id_capture/IdCaptureStateProvider.d.ts +0 -1
- package/dist/lib/locales/es/translation.d.ts +0 -1
- package/dist/lib/locales/index.d.ts +0 -1
- package/dist/lib/models/DocumentDetection.d.ts +0 -5
- package/dist/sdk2.cjs.development.js +41 -89
- 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 +41 -89
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +41 -89
- 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
package/dist/sdk2.esm.js
CHANGED
|
@@ -204,7 +204,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
204
204
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
205
205
|
};
|
|
206
206
|
|
|
207
|
-
var webSdkVersion = '2.1.
|
|
207
|
+
var webSdkVersion = '2.1.73';
|
|
208
208
|
|
|
209
209
|
function getPlatform() {
|
|
210
210
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -5409,8 +5409,7 @@ var defaultDocumentDetectionModelLoadTimeoutMs = 45000;
|
|
|
5409
5409
|
var defaultDocumentDetectionThresholds = {
|
|
5410
5410
|
idCardFront: 0.6,
|
|
5411
5411
|
idCardBack: 0.6,
|
|
5412
|
-
passport: 0.4
|
|
5413
|
-
stability: 0.7
|
|
5412
|
+
passport: 0.4
|
|
5414
5413
|
};
|
|
5415
5414
|
var documentTypeDisplayNames = {
|
|
5416
5415
|
idCardFront: 'ID card front',
|
|
@@ -5552,13 +5551,6 @@ function makeDocumentDetectorPrediction(detector, frame) {
|
|
|
5552
5551
|
});
|
|
5553
5552
|
});
|
|
5554
5553
|
}
|
|
5555
|
-
var lastNBoxes = [];
|
|
5556
|
-
var lastDetectionAt = 0;
|
|
5557
|
-
var lastDetectionTime = 0;
|
|
5558
|
-
function setLastDetectionAt(time) {
|
|
5559
|
-
lastDetectionTime = time - lastDetectionAt;
|
|
5560
|
-
lastDetectionAt = time;
|
|
5561
|
-
}
|
|
5562
5554
|
var defaultDocumentDetectionBoundaries = {
|
|
5563
5555
|
top: 20,
|
|
5564
5556
|
bottom: 20,
|
|
@@ -5566,7 +5558,7 @@ var defaultDocumentDetectionBoundaries = {
|
|
|
5566
5558
|
right: 20
|
|
5567
5559
|
};
|
|
5568
5560
|
function processDocumentDetectorPrediction(prediction, thresholds, boundaries) {
|
|
5569
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l
|
|
5561
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
5570
5562
|
if (boundaries === void 0) {
|
|
5571
5563
|
boundaries = defaultDocumentDetectionBoundaries;
|
|
5572
5564
|
}
|
|
@@ -5622,11 +5614,11 @@ function processDocumentDetectorPrediction(prediction, thresholds, boundaries) {
|
|
|
5622
5614
|
var boundaryLeft = (_j = boundaries.left) !== null && _j !== void 0 ? _j : 20;
|
|
5623
5615
|
var boundaryRight = (_k = boundaries.right) !== null && _k !== void 0 ? _k : 20;
|
|
5624
5616
|
var boundaryBottom = (_l = boundaries.bottom) !== null && _l !== void 0 ? _l : 20;
|
|
5625
|
-
var
|
|
5626
|
-
xMin =
|
|
5627
|
-
yMin =
|
|
5628
|
-
width =
|
|
5629
|
-
height =
|
|
5617
|
+
var _m = bestDocument.box,
|
|
5618
|
+
xMin = _m.xMin,
|
|
5619
|
+
yMin = _m.yMin,
|
|
5620
|
+
width = _m.width,
|
|
5621
|
+
height = _m.height;
|
|
5630
5622
|
documentInBounds = yMin > boundaryTop &&
|
|
5631
5623
|
// Is it valid top edge of ID detected?
|
|
5632
5624
|
yMin + height + boundaryBottom < frameHeight && (
|
|
@@ -5635,23 +5627,12 @@ function processDocumentDetectorPrediction(prediction, thresholds, boundaries) {
|
|
|
5635
5627
|
// If either the left side visible or if not, right edge of ID should be more than 80% of width.
|
|
5636
5628
|
xMin + width + boundaryRight < frameWidth; // Valid right edge if it's less than video width.
|
|
5637
5629
|
}
|
|
5638
|
-
var documentIsStable = false;
|
|
5639
5630
|
var documentTooClose = false;
|
|
5640
5631
|
if (bestDocument) {
|
|
5641
|
-
var
|
|
5642
|
-
docWidth =
|
|
5643
|
-
docHeight =
|
|
5632
|
+
var _o = [bestDocument.box.width / frameWidth, bestDocument.box.height / frameHeight],
|
|
5633
|
+
docWidth = _o[0],
|
|
5634
|
+
docHeight = _o[1];
|
|
5644
5635
|
documentTooClose = docWidth > 0.85 || docHeight > 0.85;
|
|
5645
|
-
if (detectionThresholdMet) {
|
|
5646
|
-
var threshold_1 = (_m = thresholds.stability) !== null && _m !== void 0 ? _m : defaultDocumentDetectionThresholds.stability;
|
|
5647
|
-
var framesNeeded = Math.min(1000 / lastDetectionTime, 12);
|
|
5648
|
-
lastNBoxes = __spreadArray([bestDocument.box], lastNBoxes, true).slice(0, framesNeeded);
|
|
5649
|
-
documentIsStable = lastNBoxes.length >= framesNeeded && !createPairs(lastNBoxes).some(function (_a) {
|
|
5650
|
-
var a = _a[0],
|
|
5651
|
-
b = _a[1];
|
|
5652
|
-
return calculateIoU(a, b) < threshold_1;
|
|
5653
|
-
});
|
|
5654
|
-
}
|
|
5655
5636
|
}
|
|
5656
5637
|
return {
|
|
5657
5638
|
detectedObjects: detectedObjects,
|
|
@@ -5668,7 +5649,6 @@ function processDocumentDetectorPrediction(prediction, thresholds, boundaries) {
|
|
|
5668
5649
|
bestDocument: bestDocument,
|
|
5669
5650
|
documentInBounds: documentInBounds,
|
|
5670
5651
|
documentTooClose: documentTooClose,
|
|
5671
|
-
documentIsStable: documentIsStable,
|
|
5672
5652
|
frameWidth: frameWidth,
|
|
5673
5653
|
frameHeight: frameHeight,
|
|
5674
5654
|
allZero: allZero
|
|
@@ -5688,27 +5668,6 @@ function applyNonMaxSuppression(detectedObjects) {
|
|
|
5688
5668
|
return !!obj;
|
|
5689
5669
|
});
|
|
5690
5670
|
}
|
|
5691
|
-
function createPairs(arr) {
|
|
5692
|
-
var pairs = [];
|
|
5693
|
-
for (var i = 0; i < arr.length - 1; i++) {
|
|
5694
|
-
pairs.push([arr[i], arr[i + 1]]);
|
|
5695
|
-
}
|
|
5696
|
-
return pairs;
|
|
5697
|
-
}
|
|
5698
|
-
function calculateIoU(boxA, boxB) {
|
|
5699
|
-
var xA = Math.max(boxA.xMin, boxB.xMin);
|
|
5700
|
-
var yA = Math.max(boxA.yMin, boxB.yMin);
|
|
5701
|
-
var xB = Math.min(boxA.xMax, boxB.xMax);
|
|
5702
|
-
var yB = Math.min(boxA.yMax, boxB.yMax);
|
|
5703
|
-
var intersectWidth = Math.max(0, xB - xA);
|
|
5704
|
-
var intersectHeight = Math.max(0, yB - yA);
|
|
5705
|
-
var intersectionArea = intersectWidth * intersectHeight;
|
|
5706
|
-
var boxAArea = (boxA.xMax - boxA.xMin) * (boxA.yMax - boxA.yMin);
|
|
5707
|
-
var boxBArea = (boxB.xMax - boxB.xMin) * (boxB.yMax - boxB.yMin);
|
|
5708
|
-
var unionArea = boxAArea + boxBArea - intersectionArea;
|
|
5709
|
-
if (unionArea === 0) return 0;
|
|
5710
|
-
return intersectionArea / unionArea;
|
|
5711
|
-
}
|
|
5712
5671
|
|
|
5713
5672
|
function useFrameLoop(fn, _a) {
|
|
5714
5673
|
var _b = _a.throttleMs,
|
|
@@ -5726,20 +5685,16 @@ function useFrameLoop(fn, _a) {
|
|
|
5726
5685
|
var currentLoopId = loopId.current;
|
|
5727
5686
|
function renderPrediction() {
|
|
5728
5687
|
return __awaiter(this, void 0, void 0, function () {
|
|
5729
|
-
var start, took, amountToThrottle;
|
|
5730
5688
|
return __generator(this, function (_a) {
|
|
5731
5689
|
switch (_a.label) {
|
|
5732
5690
|
case 0:
|
|
5733
5691
|
if (currentLoopId !== loopId.current) return [2 /*return*/];
|
|
5734
|
-
start = new Date().getTime();
|
|
5735
5692
|
return [4 /*yield*/, fn(frameId.current)];
|
|
5736
5693
|
case 1:
|
|
5737
5694
|
_a.sent();
|
|
5738
|
-
took = new Date().getTime() - start;
|
|
5739
|
-
amountToThrottle = Math.max((throttleMs !== null && throttleMs !== void 0 ? throttleMs : 0) - took, 0);
|
|
5740
5695
|
timer = setTimeout(function () {
|
|
5741
5696
|
frameId.current = requestAnimationFrame(renderPrediction);
|
|
5742
|
-
},
|
|
5697
|
+
}, throttleMs !== null && throttleMs !== void 0 ? throttleMs : 0);
|
|
5743
5698
|
return [2 /*return*/];
|
|
5744
5699
|
}
|
|
5745
5700
|
});
|
|
@@ -5805,27 +5760,29 @@ function DocumentDetectionModelProvider(_a) {
|
|
|
5805
5760
|
var _b = _a.autoStart,
|
|
5806
5761
|
autoStart = _b === void 0 ? true : _b,
|
|
5807
5762
|
children = _a.children,
|
|
5808
|
-
|
|
5809
|
-
|
|
5810
|
-
|
|
5811
|
-
|
|
5812
|
-
|
|
5813
|
-
|
|
5814
|
-
|
|
5815
|
-
documentDetectionModelLoadTimeoutMs = _f === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _f,
|
|
5763
|
+
throttleMs = _a.throttleMs,
|
|
5764
|
+
_c = _a.documentDetectionModelPath,
|
|
5765
|
+
documentDetectionModelPath = _c === void 0 ? defaultDocumentDetectorModelPath : _c,
|
|
5766
|
+
_d = _a.documentDetectionModelScoreThreshold,
|
|
5767
|
+
documentDetectionModelScoreThreshold = _d === void 0 ? defaultDocumentDetectionScoreThreshold : _d,
|
|
5768
|
+
_e = _a.documentDetectionModelLoadTimeoutMs,
|
|
5769
|
+
documentDetectionModelLoadTimeoutMs = _e === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _e,
|
|
5816
5770
|
onDocumentDetectionModelError = _a.onDocumentDetectionModelError;
|
|
5817
|
-
var
|
|
5818
|
-
videoRef =
|
|
5819
|
-
videoLoaded =
|
|
5820
|
-
cameraReady =
|
|
5771
|
+
var _f = useContext(CameraStateContext),
|
|
5772
|
+
videoRef = _f.videoRef,
|
|
5773
|
+
videoLoaded = _f.videoLoaded,
|
|
5774
|
+
cameraReady = _f.cameraReady;
|
|
5821
5775
|
var lastPredictionCanvas = useRef(null);
|
|
5822
5776
|
var onPredictionHandler = useRef();
|
|
5823
|
-
var
|
|
5824
|
-
documentDetectionThresholds =
|
|
5825
|
-
setDocumentDetectionThresholds =
|
|
5826
|
-
var
|
|
5827
|
-
documentDetectionBoundaries =
|
|
5828
|
-
setDocumentDetectionBoundaries =
|
|
5777
|
+
var _g = useState({}),
|
|
5778
|
+
documentDetectionThresholds = _g[0],
|
|
5779
|
+
setDocumentDetectionThresholds = _g[1];
|
|
5780
|
+
var _h = useState(defaultDocumentDetectionBoundaries),
|
|
5781
|
+
documentDetectionBoundaries = _h[0],
|
|
5782
|
+
setDocumentDetectionBoundaries = _h[1];
|
|
5783
|
+
var _j = useState(0),
|
|
5784
|
+
detectionTime = _j[0],
|
|
5785
|
+
setDetectionTime = _j[1];
|
|
5829
5786
|
var _k = useState(0),
|
|
5830
5787
|
timesAllZero = _k[0],
|
|
5831
5788
|
setTimesAllZero = _k[1];
|
|
@@ -5867,7 +5824,7 @@ function DocumentDetectionModelProvider(_a) {
|
|
|
5867
5824
|
if (!prediction) return [3 /*break*/, 3];
|
|
5868
5825
|
processedPrediction = processDocumentDetectorPrediction(prediction, documentDetectionThresholds, documentDetectionBoundaries);
|
|
5869
5826
|
processedPrediction.frameId = frameId;
|
|
5870
|
-
|
|
5827
|
+
setDetectionTime(prediction.time);
|
|
5871
5828
|
debug(processedPrediction);
|
|
5872
5829
|
if (processedPrediction.allZero) setTimesAllZero(function (n) {
|
|
5873
5830
|
return n + 1;
|
|
@@ -5910,7 +5867,7 @@ function DocumentDetectionModelProvider(_a) {
|
|
|
5910
5867
|
documentDetectionModelError: modelError,
|
|
5911
5868
|
documentDetectionModelDownloadProgress: modelDownloadProgress,
|
|
5912
5869
|
onDocumentDetected: onDocumentDetected,
|
|
5913
|
-
detectionTime:
|
|
5870
|
+
detectionTime: detectionTime,
|
|
5914
5871
|
documentDetectionThresholds: documentDetectionThresholds,
|
|
5915
5872
|
setDocumentDetectionThresholds: setDocumentDetectionThresholds,
|
|
5916
5873
|
documentDetectionBoundaries: documentDetectionBoundaries,
|
|
@@ -5918,7 +5875,7 @@ function DocumentDetectionModelProvider(_a) {
|
|
|
5918
5875
|
documentDetectionLastPredictionCanvas: lastPredictionCanvas,
|
|
5919
5876
|
clearDocumentDetectionLastPredictionCanvas: clearDocumentDetectionLastPredictionCanvas
|
|
5920
5877
|
};
|
|
5921
|
-
}, [start, stop, ready, modelError, modelDownloadProgress, onDocumentDetected, documentDetectionThresholds, documentDetectionBoundaries, clearDocumentDetectionLastPredictionCanvas]);
|
|
5878
|
+
}, [start, stop, ready, modelError, modelDownloadProgress, onDocumentDetected, detectionTime, documentDetectionThresholds, documentDetectionBoundaries, clearDocumentDetectionLastPredictionCanvas]);
|
|
5922
5879
|
return /*#__PURE__*/React.createElement(DocumentDetectionModelContext.Provider, {
|
|
5923
5880
|
value: value
|
|
5924
5881
|
}, /*#__PURE__*/React.createElement(InvisibleCanvas, {
|
|
@@ -6256,7 +6213,6 @@ var initialState$4 = {
|
|
|
6256
6213
|
detectionThresholdMet: false,
|
|
6257
6214
|
documentInBounds: false,
|
|
6258
6215
|
documentTooClose: false,
|
|
6259
|
-
documentIsStable: false,
|
|
6260
6216
|
flipRequired: false,
|
|
6261
6217
|
backDetectedFirst: false,
|
|
6262
6218
|
idCardDetectedButNotAllowed: false,
|
|
@@ -6375,7 +6331,6 @@ var _reducer = function reducer(state, action) {
|
|
|
6375
6331
|
bestDocument = _d.bestDocument,
|
|
6376
6332
|
documentInBounds = _d.documentInBounds,
|
|
6377
6333
|
documentTooClose = _d.documentTooClose,
|
|
6378
|
-
documentIsStable = _d.documentIsStable,
|
|
6379
6334
|
focusScore = _d.focusScore,
|
|
6380
6335
|
focusThresholdMet = _d.focusThresholdMet,
|
|
6381
6336
|
frameWidth = _d.frameWidth,
|
|
@@ -6397,7 +6352,7 @@ var _reducer = function reducer(state, action) {
|
|
|
6397
6352
|
if (state.captureState === 'capturing' && (flipRequired || backDetectedFirst)) {
|
|
6398
6353
|
wrongDocumentTypePredictions += 1;
|
|
6399
6354
|
}
|
|
6400
|
-
var isGoodFrame = detectionThresholdMet && documentInBounds && !documentTooClose && !flipRequired && !backDetectedFirst && focusThresholdMet
|
|
6355
|
+
var isGoodFrame = detectionThresholdMet && documentInBounds && !documentTooClose && !flipRequired && !backDetectedFirst && focusThresholdMet;
|
|
6401
6356
|
var goodFramesCount = state.goodFramesCount;
|
|
6402
6357
|
if (isGoodFrame) {
|
|
6403
6358
|
goodFramesCount += 1;
|
|
@@ -6432,7 +6387,6 @@ var _reducer = function reducer(state, action) {
|
|
|
6432
6387
|
detectionThresholdMet: detectionThresholdMet,
|
|
6433
6388
|
documentInBounds: documentInBounds,
|
|
6434
6389
|
documentTooClose: documentTooClose,
|
|
6435
|
-
documentIsStable: documentIsStable,
|
|
6436
6390
|
flipRequired: flipRequired,
|
|
6437
6391
|
backDetectedFirst: backDetectedFirst,
|
|
6438
6392
|
idCardDetectedButNotAllowed: idCardDetectedButNotAllowed,
|
|
@@ -6852,7 +6806,6 @@ var esTranslation = {
|
|
|
6852
6806
|
'Document not detected': 'No se ha detectado el documento',
|
|
6853
6807
|
'Document is not centered': 'Documento no centrado',
|
|
6854
6808
|
'Document too close, please back up': 'Documento muy cerca, favor de alejarse',
|
|
6855
|
-
'Please hold your ID document steady': 'Por favor, mantenga firme su documento de identidad',
|
|
6856
6809
|
'Document out of focus – try improving the lighting': 'Documento no enfocado - hay que tratar de mejorar la iluminación',
|
|
6857
6810
|
'ID card front detected - please flip your ID card': 'Anverso de ID detectado, por favor voltea tu identificación',
|
|
6858
6811
|
'ID card back detected - please flip your ID card': 'Reverso de ID detectado, por favor voltea tu identificación',
|
|
@@ -7174,8 +7127,7 @@ var IdCapture = function IdCapture(_a) {
|
|
|
7174
7127
|
guidanceTooCloseText: 'Document too close, please back up',
|
|
7175
7128
|
guidanceNotDetectedText: 'Document not detected',
|
|
7176
7129
|
guidanceIdCardNotAllowedText: 'ID card detected, please scan a passport instead',
|
|
7177
|
-
guidancePassportNotAllowedText: 'Passport detected, please scan an ID card instead'
|
|
7178
|
-
guidanceNotStableText: 'Please hold your ID document steady'
|
|
7130
|
+
guidancePassportNotAllowedText: 'Passport detected, please scan an ID card instead'
|
|
7179
7131
|
});
|
|
7180
7132
|
var debugScalingDetails = useDebugScalingDetails({
|
|
7181
7133
|
enabled: debugMode,
|
|
@@ -7186,7 +7138,7 @@ var IdCapture = function IdCapture(_a) {
|
|
|
7186
7138
|
});
|
|
7187
7139
|
var satisfied = state.isGoodFrame;
|
|
7188
7140
|
if (typeof guidanceSatisfied === 'boolean') satisfied = guidanceSatisfied;
|
|
7189
|
-
guidanceMessage || (guidanceMessage = satisfied ? verbiage.guidanceSatisfiedText : !state.detectionThresholdMet ? verbiage.guidanceNotDetectedText : state.backDetectedFirst ? verbiage.guidanceBackDetectedFirstText : state.flipRequired ? verbiage.guidancePleaseFlipText : state.idCardDetectedButNotAllowed ? verbiage.guidanceIdCardNotAllowedText : state.passportDetectedButNotAllowed ? verbiage.guidancePassportNotAllowedText : !state.documentInBounds ? verbiage.guidanceNotCenteredText : state.documentTooClose ? verbiage.guidanceTooCloseText : !state.focusThresholdMet ? verbiage.guidanceTooBlurryText :
|
|
7141
|
+
guidanceMessage || (guidanceMessage = satisfied ? verbiage.guidanceSatisfiedText : !state.detectionThresholdMet ? verbiage.guidanceNotDetectedText : state.backDetectedFirst ? verbiage.guidanceBackDetectedFirstText : state.flipRequired ? verbiage.guidancePleaseFlipText : state.idCardDetectedButNotAllowed ? verbiage.guidanceIdCardNotAllowedText : state.passportDetectedButNotAllowed ? verbiage.guidancePassportNotAllowedText : !state.documentInBounds ? verbiage.guidanceNotCenteredText : state.documentTooClose ? verbiage.guidanceTooCloseText : !state.focusThresholdMet ? verbiage.guidanceTooBlurryText : '');
|
|
7190
7142
|
return /*#__PURE__*/React__default.createElement(PageContainer, {
|
|
7191
7143
|
ref: ref,
|
|
7192
7144
|
className: "flex ".concat((_h = classNames.container) !== null && _h !== void 0 ? _h : '')
|
|
@@ -7211,7 +7163,7 @@ var IdCapture = function IdCapture(_a) {
|
|
|
7211
7163
|
scaling: debugScalingDetails,
|
|
7212
7164
|
flipX: !((_a = cameraRef.current) === null || _a === void 0 ? void 0 : _a.isRearFacing)
|
|
7213
7165
|
});
|
|
7214
|
-
}))), debugMode && ( /*#__PURE__*/React__default.createElement(DebugStatsPane, null, cameraRef.current ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, "\u2705 Camera: ", cameraRef.current.label, " (", cameraRef.current.width, "x", cameraRef.current.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React__default.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__default.createElement("br", null), modelsReady ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, state.detectionThresholdMet ? '✅' : '❌', " Detected Document Type: ", state.detectedDocumentType, /*#__PURE__*/React__default.createElement("br", null), state.idCardFrontDetectionThresholdMet ? '✅' : '❌', " ID Card Front Score: ", state.idCardFrontDetectionScore.toFixed(3), /*#__PURE__*/React__default.createElement("br", null), state.idCardBackDetectionThresholdMet ? '✅' : '❌', " ID Card Back Score: ", state.idCardBackDetectionScore.toFixed(3), /*#__PURE__*/React__default.createElement("br", null), state.passportDetectionThresholdMet ? '✅' : '❌', " Passport Score: ", state.passportDetectionScore.toFixed(3), /*#__PURE__*/React__default.createElement("br", null), state.focusThresholdMet ? '✅' : '❌', " Focus Score:", ' ', state.focusScore.toFixed(3), /*#__PURE__*/React__default.createElement("br", null), state.documentInBounds ? '✅' : '❌', " Document In Bounds", /*#__PURE__*/React__default.createElement("br", null), state.
|
|
7166
|
+
}))), debugMode && ( /*#__PURE__*/React__default.createElement(DebugStatsPane, null, cameraRef.current ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, "\u2705 Camera: ", cameraRef.current.label, " (", cameraRef.current.width, "x", cameraRef.current.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React__default.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__default.createElement("br", null), modelsReady ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, state.detectionThresholdMet ? '✅' : '❌', " Detected Document Type: ", state.detectedDocumentType, /*#__PURE__*/React__default.createElement("br", null), state.idCardFrontDetectionThresholdMet ? '✅' : '❌', " ID Card Front Score: ", state.idCardFrontDetectionScore.toFixed(3), /*#__PURE__*/React__default.createElement("br", null), state.idCardBackDetectionThresholdMet ? '✅' : '❌', " ID Card Back Score: ", state.idCardBackDetectionScore.toFixed(3), /*#__PURE__*/React__default.createElement("br", null), state.passportDetectionThresholdMet ? '✅' : '❌', " Passport Score: ", state.passportDetectionScore.toFixed(3), /*#__PURE__*/React__default.createElement("br", null), state.focusThresholdMet ? '✅' : '❌', " Focus Score:", ' ', state.focusScore.toFixed(3), /*#__PURE__*/React__default.createElement("br", null), state.documentInBounds ? '✅' : '❌', " Document In Bounds", /*#__PURE__*/React__default.createElement("br", null), state.goodFramesThresholdMet ? '✅' : '❌', " Good Frame Count:", ' ', state.goodFramesCount, "/", state.goodFramesThreshold)) : ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, "\u274C Models not ready")))));
|
|
7215
7167
|
};
|
|
7216
7168
|
var timeSince = function timeSince(t) {
|
|
7217
7169
|
if (!t) return 0;
|
|
@@ -7984,7 +7936,7 @@ var ProgressBarBackground$1 = styled.div(templateObject_13$1 || (templateObject_
|
|
|
7984
7936
|
var _a, _b, _c, _d;
|
|
7985
7937
|
return (_d = (_c = (_b = (_a = props.theme) === null || _a === void 0 ? void 0 : _a.idCapture) === null || _b === void 0 ? void 0 : _b.loadingOverlay) === null || _c === void 0 ? void 0 : _c.progressBarBackgroundOpacity) !== null && _d !== void 0 ? _d : 0.75;
|
|
7986
7938
|
});
|
|
7987
|
-
var ProgressBar$1 = styled.span(templateObject_14$1 || (templateObject_14$1 = __makeTemplateObject(["\n display: block;\n width: ", "%;\n height: 100%;\n"], ["\n display: block;\n width: ", "%;\n height: 100%;\n"])), function (props) {
|
|
7939
|
+
var ProgressBar$1 = styled.span(templateObject_14$1 || (templateObject_14$1 = __makeTemplateObject(["\n display: block;\n width: ", "%;\n height: 100%;\n left: 0;\n position: absolute;\n"], ["\n display: block;\n width: ", "%;\n height: 100%;\n left: 0;\n position: absolute;\n"])), function (props) {
|
|
7988
7940
|
return props.$progress;
|
|
7989
7941
|
});
|
|
7990
7942
|
var ProgressIndicator$1 = styled.span(templateObject_15$1 || (templateObject_15$1 = __makeTemplateObject(["\n display: block;\n height: 100%;\n background: ", ";\n animation: progressBar 3s ease-in-out;\n animation-fill-mode: both;\n\n @keyframes progressBar {\n 0% {\n width: 0;\n }\n 100% {\n width: 100%;\n }\n }\n"], ["\n display: block;\n height: 100%;\n background: ", ";\n animation: progressBar 3s ease-in-out;\n animation-fill-mode: both;\n\n @keyframes progressBar {\n 0% {\n width: 0;\n }\n 100% {\n width: 100%;\n }\n }\n"])), function (props) {
|
|
@@ -12345,7 +12297,7 @@ var ProgressBarBackground = styled.div(templateObject_10 || (templateObject_10 =
|
|
|
12345
12297
|
var _a, _b, _c, _d;
|
|
12346
12298
|
return (_d = (_c = (_b = (_a = props.theme) === null || _a === void 0 ? void 0 : _a.selfieCapture) === null || _b === void 0 ? void 0 : _b.loadingOverlay) === null || _c === void 0 ? void 0 : _c.progressBarBackgroundOpacity) !== null && _d !== void 0 ? _d : 0.75;
|
|
12347
12299
|
});
|
|
12348
|
-
var ProgressBar = styled.span(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n display: block;\n width: ", "%;\n height: 100%;\n"], ["\n display: block;\n width: ", "%;\n height: 100%;\n"])), function (props) {
|
|
12300
|
+
var ProgressBar = styled.span(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n display: block;\n width: ", "%;\n height: 100%;\n left: 0;\n position: absolute;\n"], ["\n display: block;\n width: ", "%;\n height: 100%;\n left: 0;\n position: absolute;\n"])), function (props) {
|
|
12349
12301
|
return props.$progress;
|
|
12350
12302
|
});
|
|
12351
12303
|
var ProgressIndicator = styled.span(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n display: block;\n height: 100%;\n background: ", ";\n animation: progressBar 3s ease-in-out;\n animation-fill-mode: both;\n\n @keyframes progressBar {\n 0% {\n width: 0;\n }\n 100% {\n width: 100%;\n }\n }\n"], ["\n display: block;\n height: 100%;\n background: ", ";\n animation: progressBar 3s ease-in-out;\n animation-fill-mode: both;\n\n @keyframes progressBar {\n 0% {\n width: 0;\n }\n 100% {\n width: 100%;\n }\n }\n"])), function (props) {
|