idmission-web-sdk 2.3.87 → 2.3.89
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/customer_flows/SignatureKYC.d.ts +6 -0
- package/dist/components/customer_flows/SignatureKYC.d.ts.map +1 -1
- package/dist/components/selfie_capture/SelfieCapture.d.ts +4 -0
- package/dist/components/selfie_capture/SelfieCapture.d.ts.map +1 -1
- package/dist/components/selfie_capture/SelfieGuidanceModelsProvider.d.ts +4 -1
- package/dist/components/selfie_capture/SelfieGuidanceModelsProvider.d.ts.map +1 -1
- package/dist/components/video_signature_capture/VideoSignatureWizard.d.ts +3 -0
- package/dist/components/video_signature_capture/VideoSignatureWizard.d.ts.map +1 -1
- package/dist/lib/locales/de.d.ts +1 -0
- package/dist/lib/locales/de.d.ts.map +1 -1
- package/dist/lib/locales/es.d.ts +1 -0
- package/dist/lib/locales/es.d.ts.map +1 -1
- package/dist/lib/locales/fr.d.ts +1 -0
- package/dist/lib/locales/fr.d.ts.map +1 -1
- package/dist/lib/locales/index.d.ts +8 -0
- package/dist/lib/locales/index.d.ts.map +1 -1
- package/dist/lib/locales/it.d.ts +1 -0
- package/dist/lib/locales/it.d.ts.map +1 -1
- package/dist/lib/locales/ja.d.ts +1 -0
- package/dist/lib/locales/ja.d.ts.map +1 -1
- package/dist/lib/locales/pt.d.ts +1 -0
- package/dist/lib/locales/pt.d.ts.map +1 -1
- package/dist/lib/locales/ru.d.ts +1 -0
- package/dist/lib/locales/ru.d.ts.map +1 -1
- package/dist/lib/locales/zh.d.ts +1 -0
- package/dist/lib/locales/zh.d.ts.map +1 -1
- package/dist/lib/models/FaceDetection.d.ts +9 -1
- package/dist/lib/models/FaceDetection.d.ts.map +1 -1
- package/dist/lib/utils/lighting.d.ts +19 -0
- package/dist/lib/utils/lighting.d.ts.map +1 -0
- package/dist/sdk2.cjs.development.js +167 -14
- 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 +167 -14
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +167 -14
- 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
|
@@ -205,7 +205,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
205
205
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
206
206
|
};
|
|
207
207
|
|
|
208
|
-
var webSdkVersion = '2.3.
|
|
208
|
+
var webSdkVersion = '2.3.89';
|
|
209
209
|
|
|
210
210
|
function getPlatform() {
|
|
211
211
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -2896,14 +2896,29 @@ function processFaceDetectorPrediction(_a) {
|
|
|
2896
2896
|
// we found that the bounding box ends at the brow and misses the forehead. this ratio represents how much we should extend the box to include the forehead.
|
|
2897
2897
|
_k = _a.noseTrackingThreshold,
|
|
2898
2898
|
// we found that the bounding box ends at the brow and misses the forehead. this ratio represents how much we should extend the box to include the forehead.
|
|
2899
|
-
noseTrackingThreshold = _k === void 0 ? 0.2 : _k
|
|
2899
|
+
noseTrackingThreshold = _k === void 0 ? 0.2 : _k,
|
|
2900
|
+
// this represents the maximum distance that the nose can be from the center of the face box -- 20% of the face box width or height
|
|
2901
|
+
minCaptureBrightnessThreshold = _a.minCaptureBrightnessThreshold,
|
|
2902
|
+
minCaptureRangeThreshold = _a.minCaptureRangeThreshold,
|
|
2903
|
+
minCaptureVarianceThreshold = _a.minCaptureVarianceThreshold,
|
|
2904
|
+
brightness = _a.brightness,
|
|
2905
|
+
range = _a.range,
|
|
2906
|
+
variance = _a.variance;
|
|
2900
2907
|
var face = faces[0];
|
|
2901
2908
|
var faceNotDetected = faces.length === 0;
|
|
2902
2909
|
var faceNotCentered = false,
|
|
2903
2910
|
faceLookingAway = false,
|
|
2904
2911
|
faceTooClose = false,
|
|
2905
|
-
faceTooFar = false
|
|
2906
|
-
|
|
2912
|
+
faceTooFar = false,
|
|
2913
|
+
faceVisibilityTooLow = false;
|
|
2914
|
+
var hasAnyThreshold = minCaptureBrightnessThreshold !== undefined || minCaptureRangeThreshold !== undefined || minCaptureVarianceThreshold !== undefined;
|
|
2915
|
+
if (hasAnyThreshold) {
|
|
2916
|
+
var tooDark = minCaptureBrightnessThreshold !== undefined && brightness !== undefined && brightness < minCaptureBrightnessThreshold;
|
|
2917
|
+
var tooLowRange = minCaptureRangeThreshold !== undefined && range !== undefined && range < minCaptureRangeThreshold;
|
|
2918
|
+
var tooLowVariance = minCaptureVarianceThreshold !== undefined && variance !== undefined && variance < minCaptureVarianceThreshold;
|
|
2919
|
+
faceVisibilityTooLow = !!(tooDark || tooLowRange || tooLowVariance);
|
|
2920
|
+
}
|
|
2921
|
+
if (face && !faceVisibilityTooLow) {
|
|
2907
2922
|
// calculate frame centroids
|
|
2908
2923
|
var frameCX = videoWidth / 2;
|
|
2909
2924
|
var frameCY = videoHeight / 2;
|
|
@@ -2942,7 +2957,7 @@ function processFaceDetectorPrediction(_a) {
|
|
|
2942
2957
|
}
|
|
2943
2958
|
var faceIsStable = false,
|
|
2944
2959
|
noseIsStable = false;
|
|
2945
|
-
if (faceInGuides) {
|
|
2960
|
+
if (faceInGuides && !faceVisibilityTooLow) {
|
|
2946
2961
|
var framesNeeded = Math.max(Math.ceil(average(framesNeededSamples$1)), 5);
|
|
2947
2962
|
trackFace(face, framesNeeded, videoWidth, videoHeight);
|
|
2948
2963
|
faceIsStable = lastNFaces.length >= framesNeeded && !lastNFacePairs.some(function (pair) {
|
|
@@ -2952,7 +2967,7 @@ function processFaceDetectorPrediction(_a) {
|
|
|
2952
2967
|
return pair.distance > noseDistanceThreshold;
|
|
2953
2968
|
});
|
|
2954
2969
|
}
|
|
2955
|
-
var faceReady = faceInGuides && faceIsStable && noseIsStable;
|
|
2970
|
+
var faceReady = faceInGuides && faceIsStable && noseIsStable && !faceVisibilityTooLow;
|
|
2956
2971
|
return {
|
|
2957
2972
|
face: face,
|
|
2958
2973
|
faceNotDetected: faceNotDetected,
|
|
@@ -2963,7 +2978,8 @@ function processFaceDetectorPrediction(_a) {
|
|
|
2963
2978
|
faceReady: faceReady,
|
|
2964
2979
|
faceReadyAt: faceReady ? new Date() : null,
|
|
2965
2980
|
faceIsStable: faceIsStable,
|
|
2966
|
-
noseIsStable: noseIsStable
|
|
2981
|
+
noseIsStable: noseIsStable,
|
|
2982
|
+
faceVisibilityTooLow: faceVisibilityTooLow
|
|
2967
2983
|
};
|
|
2968
2984
|
}
|
|
2969
2985
|
function testFaceDetectionAgainstKnownImage(detector) {
|
|
@@ -3840,6 +3856,7 @@ var es = {
|
|
|
3840
3856
|
'Move forward...': 'Hay que moverse hacia adelante...',
|
|
3841
3857
|
'Move to the center...': 'Hay que moverse hacia el centro...',
|
|
3842
3858
|
'Waiting for face to be detected...': 'Esperando que se detecte la cara...',
|
|
3859
|
+
'Improve lighting conditions...': 'Hay que buscar mejor iluminación...',
|
|
3843
3860
|
'Please remove your eye coverings (sunglasses eye patch etc.)...': 'Hay que quitarse lo que cubre los ojos (lentes, parche, etc.)...',
|
|
3844
3861
|
'Please remove your head coverings (hat scarf etc.)...': 'Hay que quitarse lo que cubre la cabeza (gorra, mascada, etc.)...',
|
|
3845
3862
|
'Please remove your mask...': 'Hay que quitarse el cubrebocas...',
|
|
@@ -3971,6 +3988,7 @@ var de = {
|
|
|
3971
3988
|
'Move forward...': 'Nach vorne bewegen...',
|
|
3972
3989
|
'Move to the center...': 'In die Mitte bewegen...',
|
|
3973
3990
|
'Waiting for face to be detected...': 'Warte auf die Gesichtserkennung...',
|
|
3991
|
+
'Improve lighting conditions...': 'Beleuchtungsbedingungen verbessern...',
|
|
3974
3992
|
'Please remove your eye coverings (sunglasses eye patch etc.)...': 'Bitte Augenbedeckung entfernen (Sonnenbrille, Augenklappe usw.)...',
|
|
3975
3993
|
'Please remove your head coverings (hat scarf etc.)...': 'Bitte Kopfbedeckung abnehmen (Mütze, Schal usw.)...',
|
|
3976
3994
|
'Please remove your mask...': 'Bitte Maske ablegen...',
|
|
@@ -4102,6 +4120,7 @@ var fr = {
|
|
|
4102
4120
|
'Move forward...': 'Avancez...',
|
|
4103
4121
|
'Move to the center...': 'Déplacez-vous vers le centre...',
|
|
4104
4122
|
'Waiting for face to be detected...': 'En attente de détection du visage...',
|
|
4123
|
+
'Improve lighting conditions...': "Améliorer les conditions d'éclairage...",
|
|
4105
4124
|
'Please remove your eye coverings (sunglasses eye patch etc.)...': 'Veuillez retirer ce qui recouvre vos yeux (lunettes de soleil, cache-œil, etc.)...',
|
|
4106
4125
|
'Please remove your head coverings (hat scarf etc.)...': 'Veuillez retirer vos couvre-chefs (chapeau, foulard, etc.)...',
|
|
4107
4126
|
'Please remove your mask...': 'Veuillez retirer votre masque...',
|
|
@@ -4233,6 +4252,7 @@ var it = {
|
|
|
4233
4252
|
'Move forward...': 'Spostarsi più vicino...',
|
|
4234
4253
|
'Move to the center...': 'Spostarsi al centro...',
|
|
4235
4254
|
'Waiting for face to be detected...': 'In attesa che venga rilevato il volto...',
|
|
4255
|
+
'Improve lighting conditions...': 'Migliorare le condizioni di illuminazione...',
|
|
4236
4256
|
'Please remove your eye coverings (sunglasses eye patch etc.)...': 'Rimuovere tutto ciò che copre gli occhi (occhiali da sole, bende, ecc.)...',
|
|
4237
4257
|
'Please remove your head coverings (hat scarf etc.)...': 'Rimuovere tutto ciò che ricopre il capo (cappello, sciarpa, ecc.)...',
|
|
4238
4258
|
'Please remove your mask...': 'Rimuovere la mascherina...',
|
|
@@ -4364,6 +4384,7 @@ var ja = {
|
|
|
4364
4384
|
'Move forward...': '近づいてください…',
|
|
4365
4385
|
'Move to the center...': '中央へ移動してください…',
|
|
4366
4386
|
'Waiting for face to be detected...': '顔が検出されるのを待っています…',
|
|
4387
|
+
'Improve lighting conditions...': '照明条件を改善してください…',
|
|
4367
4388
|
'Please remove your eye coverings (sunglasses eye patch etc.)...': '目を覆うもの(サングラスや眼帯など)を取り外してください…',
|
|
4368
4389
|
'Please remove your head coverings (hat scarf etc.)...': '頭を覆うもの(帽子やスカーフなど)を取り外してください…',
|
|
4369
4390
|
'Please remove your mask...': 'マスクを取り外してください…',
|
|
@@ -4495,6 +4516,7 @@ var pt = {
|
|
|
4495
4516
|
'Move forward...': 'Mover para frente...',
|
|
4496
4517
|
'Move to the center...': 'Mover para o centro...',
|
|
4497
4518
|
'Waiting for face to be detected...': 'Aguardando a detecção de rosto...',
|
|
4519
|
+
'Improve lighting conditions...': 'Melhore as condições de iluminação...',
|
|
4498
4520
|
'Please remove your eye coverings (sunglasses eye patch etc.)...': 'Por favor, remova as coberturas dos olhos (óculos de sol, tapa-olho, etc.)...',
|
|
4499
4521
|
'Please remove your head coverings (hat scarf etc.)...': 'Por favor, remova as coberturas da cabeça (chapéu, cachecol, etc.)...',
|
|
4500
4522
|
'Please remove your mask...': 'Por favor, remova sua máscara...',
|
|
@@ -4626,6 +4648,7 @@ var ru = {
|
|
|
4626
4648
|
'Move forward...': 'Подвиньтесь вперед…',
|
|
4627
4649
|
'Move to the center...': 'Переместите к центру…',
|
|
4628
4650
|
'Waiting for face to be detected...': 'Ожидание обнаружения лица…',
|
|
4651
|
+
'Improve lighting conditions...': 'Улучшите условия освещения…',
|
|
4629
4652
|
'Please remove your eye coverings (sunglasses eye patch etc.)...': 'Снимите предметы, закрывающие глаза (солнцезащитные очки, повязку и т.д.)…',
|
|
4630
4653
|
'Please remove your head coverings (hat scarf etc.)...': 'Снимите предметы, покрывающие голову (шапку, шарф и т.д.)…',
|
|
4631
4654
|
'Please remove your mask...': 'Снимите маску…',
|
|
@@ -4757,6 +4780,7 @@ var zh = {
|
|
|
4757
4780
|
'Move forward...': '請前進...',
|
|
4758
4781
|
'Move to the center...': '請移至中心...',
|
|
4759
4782
|
'Waiting for face to be detected...': '正在等待臉部辨識...',
|
|
4783
|
+
'Improve lighting conditions...': '改善照明條件...',
|
|
4760
4784
|
'Please remove your eye coverings (sunglasses eye patch etc.)...': '請取下眼睛遮蓋物(太陽眼鏡、眼罩等)...',
|
|
4761
4785
|
'Please remove your head coverings (hat scarf etc.)...': '請取下頭部遮蓋物(帽子、圍巾等)...',
|
|
4762
4786
|
'Please remove your mask...': '請脫下口罩...',
|
|
@@ -11636,6 +11660,110 @@ var FaceCaptureGuideOverlay = function FaceCaptureGuideOverlay(_a) {
|
|
|
11636
11660
|
};
|
|
11637
11661
|
var templateObject_1$n, templateObject_2$l;
|
|
11638
11662
|
|
|
11663
|
+
function detectBrightnessAndContrast(frame, brightnessAverager) {
|
|
11664
|
+
var ctx = frame.getContext('2d');
|
|
11665
|
+
if (!ctx || frame.width === 0 || frame.height === 0) return {};
|
|
11666
|
+
var imageData = ctx.getImageData(0, 0, frame.width, frame.height);
|
|
11667
|
+
var pixels = imageData.data; // This is already Uint8ClampedArray
|
|
11668
|
+
var width = frame.width;
|
|
11669
|
+
var sampleResolution = 10;
|
|
11670
|
+
var xStep = Math.max(1, Math.floor(width / sampleResolution));
|
|
11671
|
+
var yStep = Math.max(1, Math.floor(frame.height / sampleResolution));
|
|
11672
|
+
var brightness = 0;
|
|
11673
|
+
var brightnessForVariance = 0;
|
|
11674
|
+
var minBrightness = Infinity;
|
|
11675
|
+
var maxBrightness = -Infinity;
|
|
11676
|
+
var iterations = 0;
|
|
11677
|
+
for (var y = Math.floor(yStep / 2); y < frame.height; y += yStep) {
|
|
11678
|
+
for (var x = Math.floor(xStep / 2); x < width; x += xStep) {
|
|
11679
|
+
var pixelIndex = (y * width + x) * 4;
|
|
11680
|
+
var r = pixels[pixelIndex];
|
|
11681
|
+
var g = pixels[pixelIndex + 1];
|
|
11682
|
+
var b = pixels[pixelIndex + 2];
|
|
11683
|
+
// https://en.wikipedia.org/wiki/Relative_luminance
|
|
11684
|
+
// pixels are represented by 4 channels/bytes, thus a step of 4
|
|
11685
|
+
// the luminance formula is: 0.2126 * R + 0.7152 * G + 0.0722 * B (alpha is not used in this formula)
|
|
11686
|
+
var luminance = r * 0.2126 + g * 0.7152 + b * 0.0722;
|
|
11687
|
+
brightness += luminance;
|
|
11688
|
+
brightnessForVariance += luminance * luminance;
|
|
11689
|
+
minBrightness = Math.min(minBrightness, luminance);
|
|
11690
|
+
maxBrightness = Math.max(maxBrightness, luminance);
|
|
11691
|
+
iterations++;
|
|
11692
|
+
}
|
|
11693
|
+
}
|
|
11694
|
+
var _a = brightnessAverager(brightness / iterations),
|
|
11695
|
+
avg = _a.avg,
|
|
11696
|
+
isFull = _a.isFull;
|
|
11697
|
+
var range = maxBrightness - minBrightness;
|
|
11698
|
+
var variance = brightnessForVariance / iterations - Math.pow(brightness / iterations, 2);
|
|
11699
|
+
return {
|
|
11700
|
+
brightness: isFull ? avg : undefined,
|
|
11701
|
+
range: isFull ? range : undefined,
|
|
11702
|
+
variance: isFull ? variance : undefined
|
|
11703
|
+
};
|
|
11704
|
+
}
|
|
11705
|
+
function createRunningAvgFIFO(capacity) {
|
|
11706
|
+
var cap = capacity | 0;
|
|
11707
|
+
var buf = new Float64Array(cap);
|
|
11708
|
+
var head = 0; // next write index
|
|
11709
|
+
var count = 0; // how many valid items (<= cap)
|
|
11710
|
+
var sum = 0;
|
|
11711
|
+
return {
|
|
11712
|
+
add: function add(x) {
|
|
11713
|
+
if (count === cap) {
|
|
11714
|
+
sum -= buf[head];
|
|
11715
|
+
} else {
|
|
11716
|
+
count++;
|
|
11717
|
+
}
|
|
11718
|
+
buf[head] = x;
|
|
11719
|
+
sum += x;
|
|
11720
|
+
head = head + 1 === cap ? 0 : head + 1;
|
|
11721
|
+
return {
|
|
11722
|
+
avg: sum / count,
|
|
11723
|
+
isFull: count === cap
|
|
11724
|
+
};
|
|
11725
|
+
},
|
|
11726
|
+
avg: function avg() {
|
|
11727
|
+
return count ? sum / count : 0;
|
|
11728
|
+
},
|
|
11729
|
+
size: function size() {
|
|
11730
|
+
return count;
|
|
11731
|
+
},
|
|
11732
|
+
clear: function clear() {
|
|
11733
|
+
head = 0;
|
|
11734
|
+
count = 0;
|
|
11735
|
+
sum = 0;
|
|
11736
|
+
},
|
|
11737
|
+
isFull: function isFull() {
|
|
11738
|
+
return count === cap;
|
|
11739
|
+
}
|
|
11740
|
+
};
|
|
11741
|
+
}
|
|
11742
|
+
function useRunningAvg(capacity) {
|
|
11743
|
+
var fifoRef = useRef();
|
|
11744
|
+
if (!fifoRef.current) fifoRef.current = createRunningAvgFIFO(capacity);
|
|
11745
|
+
useEffect(function () {
|
|
11746
|
+
fifoRef.current = createRunningAvgFIFO(capacity);
|
|
11747
|
+
}, [capacity]);
|
|
11748
|
+
return {
|
|
11749
|
+
addToAverage: function addToAverage(x) {
|
|
11750
|
+
return fifoRef.current.add(x);
|
|
11751
|
+
},
|
|
11752
|
+
average: function average() {
|
|
11753
|
+
return fifoRef.current.avg();
|
|
11754
|
+
},
|
|
11755
|
+
size: function size() {
|
|
11756
|
+
return fifoRef.current.size();
|
|
11757
|
+
},
|
|
11758
|
+
isFull: function isFull() {
|
|
11759
|
+
return fifoRef.current.isFull();
|
|
11760
|
+
},
|
|
11761
|
+
clear: function clear() {
|
|
11762
|
+
return fifoRef.current.clear();
|
|
11763
|
+
}
|
|
11764
|
+
};
|
|
11765
|
+
}
|
|
11766
|
+
|
|
11639
11767
|
var SelfieGuidanceModelsContext = /*#__PURE__*/createContext({
|
|
11640
11768
|
start: function start() {
|
|
11641
11769
|
return null;
|
|
@@ -11665,7 +11793,10 @@ function SelfieGuidanceModelsProvider(_a) {
|
|
|
11665
11793
|
_c = _a.modelLoadTimeoutMs,
|
|
11666
11794
|
modelLoadTimeoutMs = _c === void 0 ? defaultSelfieCaptureModelLoadTimeoutMs : _c,
|
|
11667
11795
|
_d = _a.requireVerticalFaceCentering,
|
|
11668
|
-
requireVerticalFaceCentering = _d === void 0 ? true : _d
|
|
11796
|
+
requireVerticalFaceCentering = _d === void 0 ? true : _d,
|
|
11797
|
+
minCaptureBrightnessThreshold = _a.minCaptureBrightnessThreshold,
|
|
11798
|
+
minCaptureRangeThreshold = _a.minCaptureRangeThreshold,
|
|
11799
|
+
minCaptureVarianceThreshold = _a.minCaptureVarianceThreshold;
|
|
11669
11800
|
var _e = useCameraStore(useShallow(function (state) {
|
|
11670
11801
|
return {
|
|
11671
11802
|
videoRef: state.videoRef,
|
|
@@ -11678,6 +11809,7 @@ function SelfieGuidanceModelsProvider(_a) {
|
|
|
11678
11809
|
cameraReady = _e.cameraReady;
|
|
11679
11810
|
var canvasRef = useRef(null);
|
|
11680
11811
|
var onPredictionHandler = useRef();
|
|
11812
|
+
var addToAverage = useRunningAvg(5).addToAverage;
|
|
11681
11813
|
var _f = useLoadFaceDetector({
|
|
11682
11814
|
onModelError: onModelError,
|
|
11683
11815
|
modelLoadTimeoutMs: modelLoadTimeoutMs,
|
|
@@ -11690,7 +11822,7 @@ function SelfieGuidanceModelsProvider(_a) {
|
|
|
11690
11822
|
modelError = _f.modelError;
|
|
11691
11823
|
var _g = useFrameLoop(useCallback(function () {
|
|
11692
11824
|
return __awaiter(_this, void 0, void 0, function () {
|
|
11693
|
-
var vw, vh, ctx, prediction, processed, e_1;
|
|
11825
|
+
var vw, vh, ctx, thresholdsProvided, brightnessResults, brightness, range, variance, prediction, processed, e_1;
|
|
11694
11826
|
var _a, _b;
|
|
11695
11827
|
return __generator(this, function (_c) {
|
|
11696
11828
|
switch (_c.label) {
|
|
@@ -11708,12 +11840,23 @@ function SelfieGuidanceModelsProvider(_a) {
|
|
|
11708
11840
|
_c.label = 1;
|
|
11709
11841
|
case 1:
|
|
11710
11842
|
_c.trys.push([1, 3,, 4]);
|
|
11843
|
+
thresholdsProvided = minCaptureBrightnessThreshold !== undefined || minCaptureRangeThreshold !== undefined || minCaptureVarianceThreshold !== undefined;
|
|
11844
|
+
brightnessResults = thresholdsProvided ? detectBrightnessAndContrast(canvasRef.current, addToAverage) : undefined;
|
|
11845
|
+
brightness = brightnessResults === null || brightnessResults === void 0 ? void 0 : brightnessResults.brightness;
|
|
11846
|
+
range = brightnessResults === null || brightnessResults === void 0 ? void 0 : brightnessResults.range;
|
|
11847
|
+
variance = brightnessResults === null || brightnessResults === void 0 ? void 0 : brightnessResults.variance;
|
|
11711
11848
|
prediction = makeFaceDetectorPrediction(canvasRef.current);
|
|
11712
11849
|
processed = processFaceDetectorPrediction({
|
|
11713
11850
|
faces: (_a = prediction === null || prediction === void 0 ? void 0 : prediction.faces) !== null && _a !== void 0 ? _a : [],
|
|
11714
11851
|
videoWidth: vw,
|
|
11715
11852
|
videoHeight: vh,
|
|
11716
|
-
requireVerticalFaceCentering: requireVerticalFaceCentering
|
|
11853
|
+
requireVerticalFaceCentering: requireVerticalFaceCentering,
|
|
11854
|
+
minCaptureBrightnessThreshold: minCaptureBrightnessThreshold,
|
|
11855
|
+
minCaptureRangeThreshold: minCaptureRangeThreshold,
|
|
11856
|
+
minCaptureVarianceThreshold: minCaptureVarianceThreshold,
|
|
11857
|
+
brightness: brightness,
|
|
11858
|
+
range: range,
|
|
11859
|
+
variance: variance
|
|
11717
11860
|
});
|
|
11718
11861
|
setLastFaceDetectionAt(new Date().getTime());
|
|
11719
11862
|
// setLastPrediction(processed)
|
|
@@ -11731,7 +11874,7 @@ function SelfieGuidanceModelsProvider(_a) {
|
|
|
11731
11874
|
}
|
|
11732
11875
|
});
|
|
11733
11876
|
});
|
|
11734
|
-
}, [cameraReady, modelError, ready, requireVerticalFaceCentering, videoLoaded, videoRef]), {
|
|
11877
|
+
}, [cameraReady, modelError, ready, requireVerticalFaceCentering, videoLoaded, videoRef, addToAverage, minCaptureBrightnessThreshold, minCaptureRangeThreshold, minCaptureVarianceThreshold]), {
|
|
11735
11878
|
throttleMs: throttleMs,
|
|
11736
11879
|
autoStart: autoStart
|
|
11737
11880
|
}),
|
|
@@ -12104,6 +12247,7 @@ var SelfieCapture = function SelfieCapture(_a) {
|
|
|
12104
12247
|
guidanceMoveForwardText: 'Move forward...',
|
|
12105
12248
|
guidanceMoveToCenterText: 'Move to the center...',
|
|
12106
12249
|
guidanceNoFaceDetectedText: 'Waiting for face to be detected...',
|
|
12250
|
+
guidanceVisibilityTooLowText: 'Improve lighting conditions...',
|
|
12107
12251
|
guidanceNotStableText: 'Please hold still...',
|
|
12108
12252
|
guidanceManualCaptureText: 'Position your face in the circle and click to capture.',
|
|
12109
12253
|
manualCaptureBtnText: 'Capture'
|
|
@@ -12111,7 +12255,7 @@ var SelfieCapture = function SelfieCapture(_a) {
|
|
|
12111
12255
|
var allowManualCapture = !!guidanceError && allowManualSelfieCaptureOnLoadingError;
|
|
12112
12256
|
var satisfied = allowManualCapture || ((_b = prediction === null || prediction === void 0 ? void 0 : prediction.faceReady) !== null && _b !== void 0 ? _b : false);
|
|
12113
12257
|
if (typeof guidanceSatisfied === 'boolean') satisfied = guidanceSatisfied;
|
|
12114
|
-
guidanceMessage || (guidanceMessage = allowManualCapture ? verbiage.guidanceManualCaptureText : satisfied ? verbiage.guidanceHoldStillText : !prediction || (prediction === null || prediction === void 0 ? void 0 : prediction.faceNotDetected) ? verbiage.guidanceNoFaceDetectedText : (prediction === null || prediction === void 0 ? void 0 : prediction.faceNotCentered) ? verbiage.guidanceMoveToCenterText : (prediction === null || prediction === void 0 ? void 0 : prediction.faceLookingAway) ? verbiage.guidanceLookStraightText : (prediction === null || prediction === void 0 ? void 0 : prediction.faceTooClose) ? verbiage.guidanceMoveBackText : (prediction === null || prediction === void 0 ? void 0 : prediction.faceTooFar) ? verbiage.guidanceMoveForwardText : !(prediction === null || prediction === void 0 ? void 0 : prediction.faceIsStable) || !(prediction === null || prediction === void 0 ? void 0 : prediction.noseIsStable) ? verbiage.guidanceNotStableText : '');
|
|
12258
|
+
guidanceMessage || (guidanceMessage = allowManualCapture ? verbiage.guidanceManualCaptureText : satisfied ? verbiage.guidanceHoldStillText : (prediction === null || prediction === void 0 ? void 0 : prediction.faceVisibilityTooLow) ? verbiage.guidanceVisibilityTooLowText : !prediction || (prediction === null || prediction === void 0 ? void 0 : prediction.faceNotDetected) ? verbiage.guidanceNoFaceDetectedText : (prediction === null || prediction === void 0 ? void 0 : prediction.faceNotCentered) ? verbiage.guidanceMoveToCenterText : (prediction === null || prediction === void 0 ? void 0 : prediction.faceLookingAway) ? verbiage.guidanceLookStraightText : (prediction === null || prediction === void 0 ? void 0 : prediction.faceTooClose) ? verbiage.guidanceMoveBackText : (prediction === null || prediction === void 0 ? void 0 : prediction.faceTooFar) ? verbiage.guidanceMoveForwardText : !(prediction === null || prediction === void 0 ? void 0 : prediction.faceIsStable) || !(prediction === null || prediction === void 0 ? void 0 : prediction.noseIsStable) ? verbiage.guidanceNotStableText : '');
|
|
12115
12259
|
if (guidanceError && !allowManualSelfieCaptureOnLoadingError) {
|
|
12116
12260
|
return /*#__PURE__*/React__default.createElement(SelfieCaptureFallback, {
|
|
12117
12261
|
classNames: classNames.fallback
|
|
@@ -15011,7 +15155,10 @@ var VideoSignatureWizardWithProviders = function VideoSignatureWizardWithProvide
|
|
|
15011
15155
|
throttleMs: 250,
|
|
15012
15156
|
onModelError: props.onModelError,
|
|
15013
15157
|
modelLoadTimeoutMs: props.modelLoadTimeoutMs,
|
|
15014
|
-
requireVerticalFaceCentering: false
|
|
15158
|
+
requireVerticalFaceCentering: false,
|
|
15159
|
+
minCaptureBrightnessThreshold: props.minCaptureBrightnessThreshold,
|
|
15160
|
+
minCaptureRangeThreshold: props.minCaptureRangeThreshold,
|
|
15161
|
+
minCaptureVarianceThreshold: props.minCaptureVarianceThreshold
|
|
15015
15162
|
}, /*#__PURE__*/React__default.createElement(VideoSignatureWizard, _assign({}, props, {
|
|
15016
15163
|
onRetryClicked: onRetryClicked
|
|
15017
15164
|
}))));
|
|
@@ -18762,6 +18909,9 @@ var SignatureKYC = function SignatureKYC(_a) {
|
|
|
18762
18909
|
guidesComponent = _a.guidesComponent,
|
|
18763
18910
|
_q = _a.showFaceGuideThenSignaturePad,
|
|
18764
18911
|
showFaceGuideThenSignaturePad = _q === void 0 ? false : _q,
|
|
18912
|
+
minCaptureBrightnessThreshold = _a.minCaptureBrightnessThreshold,
|
|
18913
|
+
minCaptureRangeThreshold = _a.minCaptureRangeThreshold,
|
|
18914
|
+
minCaptureVarianceThreshold = _a.minCaptureVarianceThreshold,
|
|
18765
18915
|
_r = _a.theme,
|
|
18766
18916
|
theme = _r === void 0 ? 'default' : _r,
|
|
18767
18917
|
classNames = _a.classNames,
|
|
@@ -18832,6 +18982,9 @@ var SignatureKYC = function SignatureKYC(_a) {
|
|
|
18832
18982
|
allowManualSelfieCaptureOnLoadingError: allowManualSelfieCaptureOnLoadingError,
|
|
18833
18983
|
guidesComponent: guidesComponent,
|
|
18834
18984
|
showFaceGuideThenSignaturePad: showFaceGuideThenSignaturePad,
|
|
18985
|
+
minCaptureBrightnessThreshold: minCaptureBrightnessThreshold,
|
|
18986
|
+
minCaptureRangeThreshold: minCaptureRangeThreshold,
|
|
18987
|
+
minCaptureVarianceThreshold: minCaptureVarianceThreshold,
|
|
18835
18988
|
classNames: classNames,
|
|
18836
18989
|
colors: colors,
|
|
18837
18990
|
debugMode: debugMode,
|
|
@@ -18839,7 +18992,7 @@ var SignatureKYC = function SignatureKYC(_a) {
|
|
|
18839
18992
|
onModelError: onModelError,
|
|
18840
18993
|
onUserCancel: onUserCancel
|
|
18841
18994
|
};
|
|
18842
|
-
}, [onLoadingStarted, onLoadingProgress, onLoadingCompleted, onLoadingFailed, onSelfieCaptured, customOverlayContent, onLoadingOverlayDismissed, loadingOverlayMode, skipSuccessScreen, captureAudio, minSignaturePadPoints, headTrackingDisabled, headTrackingBoundaryPercentage, headTrackingBoundaryType, modelLoadTimeoutMs, faceLivenessProps, allowSignatureAfterLivenessCheckFailure, restartVideoOnSignaturePadCleared, skipLivenessValidation, allowManualSelfieCaptureOnLoadingError, guidesComponent, showFaceGuideThenSignaturePad, classNames, colors, debugMode, verbiage, onModelError, onUserCancel])
|
|
18995
|
+
}, [onLoadingStarted, onLoadingProgress, onLoadingCompleted, onLoadingFailed, onSelfieCaptured, customOverlayContent, onLoadingOverlayDismissed, loadingOverlayMode, skipSuccessScreen, captureAudio, minSignaturePadPoints, headTrackingDisabled, headTrackingBoundaryPercentage, headTrackingBoundaryType, modelLoadTimeoutMs, faceLivenessProps, allowSignatureAfterLivenessCheckFailure, restartVideoOnSignaturePadCleared, skipLivenessValidation, allowManualSelfieCaptureOnLoadingError, guidesComponent, showFaceGuideThenSignaturePad, minCaptureBrightnessThreshold, minCaptureRangeThreshold, minCaptureVarianceThreshold, classNames, colors, debugMode, verbiage, onModelError, onUserCancel])
|
|
18843
18996
|
})))));
|
|
18844
18997
|
};
|
|
18845
18998
|
|