idmission-web-sdk 1.0.29 → 1.0.30
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/video_id/IdVideoCapture.d.ts +9 -9
- package/dist/components/video_id/IdVideoCaptureFlipIdPrompt.d.ts +3 -1
- package/dist/components/video_id/IdVideoCaptureGuides.d.ts +15 -4
- package/dist/sdk2.cjs.development.js +117 -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 +117 -89
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +117 -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
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
|
+
import { IdVideoCaptureGuidesAssets, IdVideoCaptureGuidesVerbiage } from './IdVideoCaptureGuides';
|
|
2
3
|
import { CustomerSuppliedVerbiage } from '../../lib/locales';
|
|
3
4
|
import { LoaderButtonColors } from '../common/LoaderButton';
|
|
4
|
-
export type Action = 'SHOW_ID_FRONT' | 'SHOW_ID_BACK' | 'READ_TEXT';
|
|
5
|
+
export type Action = 'SHOW_ID_FRONT' | 'FLIP_ID' | 'SHOW_ID_BACK' | 'READ_TEXT';
|
|
5
6
|
export type IdVideoCaptureAssets = {
|
|
6
|
-
|
|
7
|
-
idCardBackGuidesImageUrl?: string;
|
|
7
|
+
guides?: IdVideoCaptureGuidesAssets;
|
|
8
8
|
};
|
|
9
9
|
export type IdVideoCaptureColors = {
|
|
10
10
|
guidesSatisfiedColor?: string;
|
|
@@ -12,17 +12,17 @@ export type IdVideoCaptureColors = {
|
|
|
12
12
|
readTextDoneBtn?: LoaderButtonColors;
|
|
13
13
|
};
|
|
14
14
|
export type IdVideoCaptureVerbiage = {
|
|
15
|
-
|
|
16
|
-
idBackInstructionText?: CustomerSuppliedVerbiage;
|
|
15
|
+
guides?: IdVideoCaptureGuidesVerbiage;
|
|
17
16
|
readTextHeading?: CustomerSuppliedVerbiage;
|
|
18
17
|
readTextDoneBtnText?: CustomerSuppliedVerbiage;
|
|
19
18
|
};
|
|
20
19
|
export type IdVideoCaptureProps = {
|
|
21
20
|
onComplete?: (videoUrl: string) => void;
|
|
22
21
|
onFaceNotDetected?: () => void;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
idCardFrontDetectionThreshold?: number;
|
|
23
|
+
idCardFrontFocusThreshold?: number;
|
|
24
|
+
goodIdCardFrontFramesThreshold?: number;
|
|
25
|
+
showIdCardBackDurationMs?: number;
|
|
26
26
|
readTextPrompt?: CustomerSuppliedVerbiage;
|
|
27
27
|
readTextTimeoutDurationMs?: number;
|
|
28
28
|
assets?: IdVideoCaptureAssets;
|
|
@@ -30,4 +30,4 @@ export type IdVideoCaptureProps = {
|
|
|
30
30
|
verbiage?: IdVideoCaptureVerbiage;
|
|
31
31
|
debugMode?: boolean;
|
|
32
32
|
};
|
|
33
|
-
export declare const IdVideoCapture: ({ onComplete, onFaceNotDetected,
|
|
33
|
+
export declare const IdVideoCapture: ({ onComplete, onFaceNotDetected, idCardFrontDetectionThreshold, idCardFrontFocusThreshold, goodIdCardFrontFramesThreshold, showIdCardBackDurationMs, readTextPrompt, readTextTimeoutDurationMs, assets, colors, verbiage: rawVerbiage, debugMode, }: IdVideoCaptureProps) => ReactElement;
|
|
@@ -8,8 +8,10 @@ export type IdVideoCaptureFlipIdPromptVerbiage = {
|
|
|
8
8
|
instructionText?: CustomerSuppliedVerbiage;
|
|
9
9
|
};
|
|
10
10
|
export type IdVideoCaptureFlipIdPromptProps = {
|
|
11
|
+
imageWidth?: number;
|
|
12
|
+
imageHeight?: number;
|
|
11
13
|
style?: CSSProperties;
|
|
12
14
|
assets?: IdVideoCaptureFlipIdPromptAssets;
|
|
13
15
|
verbiage?: IdVideoCaptureFlipIdPromptVerbiage;
|
|
14
16
|
};
|
|
15
|
-
export declare const IdVideoCaptureFlipIdPrompt: ({ style, assets, verbiage, }: IdVideoCaptureFlipIdPromptProps) => ReactElement;
|
|
17
|
+
export declare const IdVideoCaptureFlipIdPrompt: ({ imageWidth, imageHeight, style, assets, verbiage, }: IdVideoCaptureFlipIdPromptProps) => ReactElement;
|
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
|
+
import { CustomerSuppliedVerbiage } from '../../lib/locales';
|
|
3
|
+
export type Action = 'SHOW_ID_FRONT' | 'FLIP_ID' | 'SHOW_ID_BACK' | 'READ_TEXT';
|
|
4
|
+
export type IdVideoCaptureGuidesAssets = {
|
|
5
|
+
frontImageUrl?: string;
|
|
6
|
+
backImageUrl?: string;
|
|
7
|
+
};
|
|
8
|
+
export type IdVideoCaptureGuidesVerbiage = {
|
|
9
|
+
idFrontInstructionText?: CustomerSuppliedVerbiage;
|
|
10
|
+
idBackInstructionText?: CustomerSuppliedVerbiage;
|
|
11
|
+
flipIdInstructionText?: CustomerSuppliedVerbiage;
|
|
12
|
+
};
|
|
2
13
|
export type IdVideoCaptureGuidesProps = {
|
|
3
|
-
instructionText?: string;
|
|
4
14
|
borderWidth?: number;
|
|
5
15
|
borderColor?: string;
|
|
6
|
-
|
|
7
|
-
|
|
16
|
+
requestedAction?: Action;
|
|
17
|
+
assets?: IdVideoCaptureGuidesAssets;
|
|
18
|
+
verbiage?: IdVideoCaptureGuidesVerbiage;
|
|
8
19
|
};
|
|
9
|
-
export declare const IdVideoCaptureGuides: ({
|
|
20
|
+
export declare const IdVideoCaptureGuides: ({ requestedAction, borderWidth, borderColor, assets, verbiage: rawVerbiage, }: IdVideoCaptureGuidesProps) => ReactElement;
|
|
@@ -50,7 +50,7 @@ var tf__namespace = /*#__PURE__*/_interopNamespace(tf);
|
|
|
50
50
|
var useResizeObserver__default = /*#__PURE__*/_interopDefaultLegacy(useResizeObserver);
|
|
51
51
|
var SignatureCanvas__default = /*#__PURE__*/_interopDefaultLegacy(SignatureCanvas);
|
|
52
52
|
|
|
53
|
-
var webSdkVersion = '1.0.
|
|
53
|
+
var webSdkVersion = '1.0.30';
|
|
54
54
|
|
|
55
55
|
function getPlatform() {
|
|
56
56
|
return window.platform;
|
|
@@ -14140,7 +14140,9 @@ var SignatureKYC = function SignatureKYC(_a) {
|
|
|
14140
14140
|
|
|
14141
14141
|
var IdVideoCaptureFlipIdPrompt = function IdVideoCaptureFlipIdPrompt(_a) {
|
|
14142
14142
|
var _b;
|
|
14143
|
-
var
|
|
14143
|
+
var imageWidth = _a.imageWidth,
|
|
14144
|
+
imageHeight = _a.imageHeight,
|
|
14145
|
+
_c = _a.style,
|
|
14144
14146
|
style = _c === void 0 ? {} : _c,
|
|
14145
14147
|
_d = _a.assets,
|
|
14146
14148
|
assets = _d === void 0 ? {} : _d,
|
|
@@ -14250,6 +14252,8 @@ var IdVideoCaptureFlipIdPrompt = function IdVideoCaptureFlipIdPrompt(_a) {
|
|
|
14250
14252
|
}, /*#__PURE__*/React__default['default'].createElement("img", {
|
|
14251
14253
|
src: assets.frontImageUrl,
|
|
14252
14254
|
alt: "",
|
|
14255
|
+
width: imageWidth,
|
|
14256
|
+
height: imageHeight,
|
|
14253
14257
|
onLoad: onImageLoaded,
|
|
14254
14258
|
style: tslib.__assign({
|
|
14255
14259
|
backfaceVisibility: 'hidden',
|
|
@@ -14303,15 +14307,30 @@ var IdVideoCaptureFlipIdPrompt = function IdVideoCaptureFlipIdPrompt(_a) {
|
|
|
14303
14307
|
};
|
|
14304
14308
|
|
|
14305
14309
|
var IdVideoCaptureGuides = function IdVideoCaptureGuides(_a) {
|
|
14306
|
-
var
|
|
14307
|
-
|
|
14308
|
-
|
|
14309
|
-
|
|
14310
|
-
|
|
14311
|
-
|
|
14312
|
-
|
|
14313
|
-
|
|
14314
|
-
|
|
14310
|
+
var _b = _a.requestedAction,
|
|
14311
|
+
requestedAction = _b === void 0 ? 'SHOW_ID_FRONT' : _b,
|
|
14312
|
+
_c = _a.borderWidth,
|
|
14313
|
+
borderWidth = _c === void 0 ? 3 : _c,
|
|
14314
|
+
_d = _a.borderColor,
|
|
14315
|
+
borderColor = _d === void 0 ? 'white' : _d,
|
|
14316
|
+
_e = _a.assets,
|
|
14317
|
+
assets = _e === void 0 ? {} : _e,
|
|
14318
|
+
_f = _a.verbiage,
|
|
14319
|
+
rawVerbiage = _f === void 0 ? {} : _f;
|
|
14320
|
+
var imageRef = React.useRef(null);
|
|
14321
|
+
var _g = React.useState(0),
|
|
14322
|
+
imageWidth = _g[0],
|
|
14323
|
+
setImageWidth = _g[1];
|
|
14324
|
+
var _h = React.useState(0),
|
|
14325
|
+
imageHeight = _h[0],
|
|
14326
|
+
setImageHeight = _h[1];
|
|
14327
|
+
assets.frontImageUrl || (assets.frontImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Landscape-2.svg"));
|
|
14328
|
+
assets.backImageUrl || (assets.backImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Back-SVG-Landscape-2.svg"));
|
|
14329
|
+
var verbiage = useTranslations(rawVerbiage, {
|
|
14330
|
+
idFrontInstructionText: 'Display the front of your ID card...',
|
|
14331
|
+
idBackInstructionText: 'Display the back of your ID card...'
|
|
14332
|
+
});
|
|
14333
|
+
var instructionText = requestedAction === 'SHOW_ID_FRONT' ? verbiage.idFrontInstructionText : verbiage.idBackInstructionText;
|
|
14315
14334
|
var idGuideWidth = window.innerWidth > window.innerHeight ? '30%' : '75%';
|
|
14316
14335
|
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
14317
14336
|
style: {
|
|
@@ -14332,7 +14351,13 @@ var IdVideoCaptureGuides = function IdVideoCaptureGuides(_a) {
|
|
|
14332
14351
|
height: '100%',
|
|
14333
14352
|
margin: '4% auto auto'
|
|
14334
14353
|
}
|
|
14335
|
-
}),
|
|
14354
|
+
}), requestedAction === 'FLIP_ID' ? /*#__PURE__*/React__default['default'].createElement(IdVideoCaptureFlipIdPrompt, {
|
|
14355
|
+
assets: assets,
|
|
14356
|
+
verbiage: {
|
|
14357
|
+
instructionText: verbiage.flipIdInstructionText
|
|
14358
|
+
},
|
|
14359
|
+
imageWidth: imageWidth,
|
|
14360
|
+
imageHeight: imageHeight,
|
|
14336
14361
|
style: {
|
|
14337
14362
|
width: idGuideWidth,
|
|
14338
14363
|
margin: '2% auto 2%'
|
|
@@ -14366,10 +14391,16 @@ var IdVideoCaptureGuides = function IdVideoCaptureGuides(_a) {
|
|
|
14366
14391
|
border: "4px solid ".concat(borderColor)
|
|
14367
14392
|
}
|
|
14368
14393
|
}, /*#__PURE__*/React__default['default'].createElement("img", {
|
|
14369
|
-
|
|
14394
|
+
ref: imageRef,
|
|
14395
|
+
src: requestedAction === 'SHOW_ID_BACK' ? assets.backImageUrl : assets.frontImageUrl,
|
|
14370
14396
|
alt: "",
|
|
14371
14397
|
style: {
|
|
14372
14398
|
width: '100%'
|
|
14399
|
+
},
|
|
14400
|
+
onLoad: function onLoad() {
|
|
14401
|
+
var _a, _b, _c, _d;
|
|
14402
|
+
if (!imageWidth) setImageWidth((_b = (_a = imageRef.current) === null || _a === void 0 ? void 0 : _a.width) !== null && _b !== void 0 ? _b : 0);
|
|
14403
|
+
if (!imageHeight) setImageHeight((_d = (_c = imageRef.current) === null || _c === void 0 ? void 0 : _c.height) !== null && _d !== void 0 ? _d : 0);
|
|
14373
14404
|
}
|
|
14374
14405
|
})), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
14375
14406
|
style: {
|
|
@@ -14396,52 +14427,54 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14396
14427
|
var _b, _c, _d, _e, _f, _g;
|
|
14397
14428
|
var onComplete = _a.onComplete,
|
|
14398
14429
|
onFaceNotDetected = _a.onFaceNotDetected,
|
|
14399
|
-
_h = _a.
|
|
14400
|
-
|
|
14401
|
-
_j = _a.
|
|
14402
|
-
|
|
14403
|
-
_k = _a.
|
|
14404
|
-
|
|
14430
|
+
_h = _a.idCardFrontDetectionThreshold,
|
|
14431
|
+
idCardFrontDetectionThreshold = _h === void 0 ? 0.48 : _h,
|
|
14432
|
+
_j = _a.idCardFrontFocusThreshold,
|
|
14433
|
+
idCardFrontFocusThreshold = _j === void 0 ? 0.15 : _j,
|
|
14434
|
+
_k = _a.goodIdCardFrontFramesThreshold,
|
|
14435
|
+
goodIdCardFrontFramesThreshold = _k === void 0 ? 3 : _k,
|
|
14436
|
+
_l = _a.showIdCardBackDurationMs,
|
|
14437
|
+
showIdCardBackDurationMs = _l === void 0 ? 3000 : _l,
|
|
14405
14438
|
readTextPrompt = _a.readTextPrompt,
|
|
14406
|
-
|
|
14407
|
-
readTextTimeoutDurationMs =
|
|
14408
|
-
|
|
14409
|
-
assets =
|
|
14410
|
-
|
|
14411
|
-
colors =
|
|
14412
|
-
|
|
14413
|
-
rawVerbiage =
|
|
14414
|
-
|
|
14415
|
-
debugMode =
|
|
14416
|
-
var
|
|
14417
|
-
ref =
|
|
14418
|
-
|
|
14419
|
-
width =
|
|
14420
|
-
|
|
14421
|
-
height =
|
|
14422
|
-
var
|
|
14423
|
-
cameraRef =
|
|
14424
|
-
videoRef =
|
|
14425
|
-
videoLoaded =
|
|
14426
|
-
cameraReady =
|
|
14427
|
-
var _v = React.useState([]),
|
|
14428
|
-
detectedObjects = _v[0],
|
|
14429
|
-
setDetectedObjects = _v[1];
|
|
14439
|
+
_m = _a.readTextTimeoutDurationMs,
|
|
14440
|
+
readTextTimeoutDurationMs = _m === void 0 ? 15000 : _m,
|
|
14441
|
+
_o = _a.assets,
|
|
14442
|
+
assets = _o === void 0 ? {} : _o,
|
|
14443
|
+
_p = _a.colors,
|
|
14444
|
+
colors = _p === void 0 ? {} : _p,
|
|
14445
|
+
_q = _a.verbiage,
|
|
14446
|
+
rawVerbiage = _q === void 0 ? {} : _q,
|
|
14447
|
+
_r = _a.debugMode,
|
|
14448
|
+
debugMode = _r === void 0 ? false : _r;
|
|
14449
|
+
var _s = useResizeObserver__default['default'](),
|
|
14450
|
+
ref = _s.ref,
|
|
14451
|
+
_t = _s.width,
|
|
14452
|
+
width = _t === void 0 ? 1 : _t,
|
|
14453
|
+
_u = _s.height,
|
|
14454
|
+
height = _u === void 0 ? 1 : _u;
|
|
14455
|
+
var _v = React.useContext(CameraStateContext),
|
|
14456
|
+
cameraRef = _v.cameraRef,
|
|
14457
|
+
videoRef = _v.videoRef,
|
|
14458
|
+
videoLoaded = _v.videoLoaded,
|
|
14459
|
+
cameraReady = _v.cameraReady;
|
|
14430
14460
|
var _w = React.useState([]),
|
|
14431
|
-
|
|
14432
|
-
|
|
14433
|
-
var _x = React.
|
|
14434
|
-
|
|
14435
|
-
|
|
14436
|
-
|
|
14437
|
-
|
|
14438
|
-
|
|
14461
|
+
detectedObjects = _w[0],
|
|
14462
|
+
setDetectedObjects = _w[1];
|
|
14463
|
+
var _x = React.useState([]),
|
|
14464
|
+
faces = _x[0],
|
|
14465
|
+
setFaces = _x[1];
|
|
14466
|
+
var _y = React.useContext(IdCaptureModelsContext),
|
|
14467
|
+
idModelsReady = _y.ready,
|
|
14468
|
+
idModelsWorking = _y.working,
|
|
14469
|
+
makeIdPrediction = _y.makePrediction,
|
|
14470
|
+
onIdPredictionMade = _y.onPredictionMade,
|
|
14471
|
+
setThresholds = _y.setThresholds;
|
|
14439
14472
|
var onSelfiePredictionMade = React.useContext(HighPerformanceSelfieGuidanceModelsContext).onPredictionMade;
|
|
14440
|
-
var
|
|
14441
|
-
isRecording =
|
|
14442
|
-
startRecording =
|
|
14443
|
-
stopRecording =
|
|
14444
|
-
videoUrl =
|
|
14473
|
+
var _z = useVideoRecorder(cameraRef.current),
|
|
14474
|
+
isRecording = _z.isRecording,
|
|
14475
|
+
startRecording = _z.startRecording,
|
|
14476
|
+
stopRecording = _z.stopRecording,
|
|
14477
|
+
videoUrl = _z.videoUrl;
|
|
14445
14478
|
React.useEffect(function () {
|
|
14446
14479
|
if (!isRecording && !videoUrl) startRecording();
|
|
14447
14480
|
if (videoUrl) onComplete === null || onComplete === void 0 ? void 0 : onComplete(videoUrl);
|
|
@@ -14451,11 +14484,11 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14451
14484
|
React.useEffect(function () {
|
|
14452
14485
|
shouldCaptureFrames.current = videoLoaded && cameraReady && idModelsReady;
|
|
14453
14486
|
}, [cameraReady, idModelsReady, videoLoaded]);
|
|
14454
|
-
var
|
|
14455
|
-
requestedAction =
|
|
14456
|
-
setRequestedAction =
|
|
14487
|
+
var _0 = React.useState('SHOW_ID_FRONT'),
|
|
14488
|
+
requestedAction = _0[0],
|
|
14489
|
+
setRequestedAction = _0[1];
|
|
14457
14490
|
React.useEffect(function () {
|
|
14458
|
-
if (requestedAction
|
|
14491
|
+
if (requestedAction !== 'SHOW_ID_FRONT') return;
|
|
14459
14492
|
if (!idModelsReady || !cameraReady || !videoLoaded) return;
|
|
14460
14493
|
animationFrame.current = requestAnimationFrame(function runFrame() {
|
|
14461
14494
|
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
@@ -14474,18 +14507,15 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14474
14507
|
}, [cameraReady, idModelsReady, idModelsWorking, makeIdPrediction, requestedAction, videoLoaded, videoRef]);
|
|
14475
14508
|
React.useEffect(function () {
|
|
14476
14509
|
setThresholds({
|
|
14477
|
-
document:
|
|
14510
|
+
document: idCardFrontDetectionThreshold,
|
|
14478
14511
|
passport: 1,
|
|
14479
|
-
focus:
|
|
14512
|
+
focus: idCardFrontFocusThreshold
|
|
14480
14513
|
});
|
|
14481
|
-
}, [
|
|
14482
|
-
var _0 = React.useState(false),
|
|
14483
|
-
flippingIdCard = _0[0],
|
|
14484
|
-
setFlippingIdCard = _0[1];
|
|
14514
|
+
}, [idCardFrontDetectionThreshold, idCardFrontFocusThreshold, setThresholds]);
|
|
14485
14515
|
var _1 = React.useState(0),
|
|
14486
|
-
|
|
14516
|
+
goodIdCardFrontFramesCount = _1[0],
|
|
14487
14517
|
setGoodFramesCount = _1[1];
|
|
14488
|
-
var goodFramesThresholdMet =
|
|
14518
|
+
var goodFramesThresholdMet = goodIdCardFrontFramesCount >= goodIdCardFrontFramesThreshold;
|
|
14489
14519
|
React.useEffect(function () {
|
|
14490
14520
|
onIdPredictionMade(function (prediction) {
|
|
14491
14521
|
setDetectedObjects(prediction.detectedObjects);
|
|
@@ -14497,24 +14527,25 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14497
14527
|
setGoodFramesCount(0);
|
|
14498
14528
|
}
|
|
14499
14529
|
});
|
|
14500
|
-
}, [
|
|
14530
|
+
}, [idCardFrontDetectionThreshold, onIdPredictionMade]);
|
|
14501
14531
|
React.useEffect(function () {
|
|
14502
14532
|
if (goodFramesThresholdMet) {
|
|
14503
14533
|
if (requestedAction == 'SHOW_ID_FRONT') {
|
|
14504
|
-
|
|
14534
|
+
setRequestedAction('FLIP_ID');
|
|
14505
14535
|
setTimeout(function () {
|
|
14506
|
-
setFlippingIdCard(false);
|
|
14507
14536
|
setRequestedAction('SHOW_ID_BACK');
|
|
14508
14537
|
}, 3500);
|
|
14509
|
-
} else if (requestedAction === 'SHOW_ID_BACK') {
|
|
14510
|
-
if (readTextPrompt) {
|
|
14511
|
-
setRequestedAction('READ_TEXT');
|
|
14512
|
-
} else {
|
|
14513
|
-
stopRecording();
|
|
14514
|
-
}
|
|
14515
14538
|
}
|
|
14516
14539
|
}
|
|
14517
|
-
}, [goodFramesThresholdMet,
|
|
14540
|
+
}, [goodFramesThresholdMet, requestedAction]);
|
|
14541
|
+
var onIdBackCaptureComplete = React.useCallback(function () {
|
|
14542
|
+
if (readTextPrompt) {
|
|
14543
|
+
setRequestedAction('READ_TEXT');
|
|
14544
|
+
} else {
|
|
14545
|
+
stopRecording();
|
|
14546
|
+
}
|
|
14547
|
+
}, [readTextPrompt, stopRecording]);
|
|
14548
|
+
useTimeout(showIdCardBackDurationMs, onIdBackCaptureComplete, requestedAction !== 'SHOW_ID_BACK', false, requestedAction === 'SHOW_ID_BACK');
|
|
14518
14549
|
var onReadTextTimeout = React.useCallback(function () {
|
|
14519
14550
|
stopRecording();
|
|
14520
14551
|
}, [stopRecording]);
|
|
@@ -14535,13 +14566,9 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14535
14566
|
onFaceNotDetected === null || onFaceNotDetected === void 0 ? void 0 : onFaceNotDetected();
|
|
14536
14567
|
}
|
|
14537
14568
|
}, [numFramesWithoutFaces, onFaceNotDetected]);
|
|
14538
|
-
assets.idCardFrontGuidesImageUrl || (assets.idCardFrontGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Landscape-2.svg"));
|
|
14539
|
-
assets.idCardBackGuidesImageUrl || (assets.idCardBackGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Back-SVG-Landscape-2.svg"));
|
|
14540
14569
|
colors.guidesSatisfiedColor || (colors.guidesSatisfiedColor = 'green');
|
|
14541
14570
|
colors.guidesUnsatisfiedColor || (colors.guidesUnsatisfiedColor = 'white');
|
|
14542
14571
|
var verbiage = useTranslations(rawVerbiage, {
|
|
14543
|
-
idFrontInstructionText: 'Display the front of your ID card...',
|
|
14544
|
-
idBackInstructionText: 'Display the back of your ID card...',
|
|
14545
14572
|
readTextHeading: 'Please read the following text aloud',
|
|
14546
14573
|
readTextDoneBtnText: 'Done'
|
|
14547
14574
|
});
|
|
@@ -14554,6 +14581,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14554
14581
|
videoHeight: (_e = (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.videoHeight) !== null && _e !== void 0 ? _e : 0
|
|
14555
14582
|
});
|
|
14556
14583
|
var timeRemaining = msToTime(Math.max(0, readTextTimeoutDurationMs - (new Date().getTime() - (timeoutStartedAt !== null && timeoutStartedAt !== void 0 ? timeoutStartedAt : new Date()).getTime())));
|
|
14584
|
+
var satisfied = requestedAction === 'SHOW_ID_BACK' || goodIdCardFrontFramesCount > 0;
|
|
14557
14585
|
return /*#__PURE__*/React__default['default'].createElement(PageContainer, {
|
|
14558
14586
|
ref: ref,
|
|
14559
14587
|
className: "flex"
|
|
@@ -14602,11 +14630,11 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14602
14630
|
onClick: stopRecording,
|
|
14603
14631
|
colors: colors.readTextDoneBtn
|
|
14604
14632
|
}, verbiage.readTextDoneBtnText))) : /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(IdVideoCaptureGuides, {
|
|
14605
|
-
|
|
14606
|
-
|
|
14607
|
-
|
|
14608
|
-
|
|
14609
|
-
}), debugMode &&
|
|
14633
|
+
assets: assets.guides,
|
|
14634
|
+
verbiage: rawVerbiage.guides,
|
|
14635
|
+
requestedAction: requestedAction,
|
|
14636
|
+
borderColor: satisfied ? colors.guidesSatisfiedColor : colors.guidesUnsatisfiedColor
|
|
14637
|
+
}), debugMode && requestedAction === 'SHOW_ID_FRONT' && /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(ObjectDetectionDebugOverlay, {
|
|
14610
14638
|
"$flipX": !((_f = cameraRef.current) === null || _f === void 0 ? void 0 : _f.isRearFacing)
|
|
14611
14639
|
}, detectedObjects.map(function (obj, i) {
|
|
14612
14640
|
var _a;
|
|
@@ -14617,7 +14645,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14617
14645
|
color: "blue",
|
|
14618
14646
|
flipX: !((_a = cameraRef.current) === null || _a === void 0 ? void 0 : _a.isRearFacing)
|
|
14619
14647
|
});
|
|
14620
|
-
})),
|
|
14648
|
+
})), /*#__PURE__*/React__default['default'].createElement(ObjectDetectionDebugOverlay, {
|
|
14621
14649
|
"$flipX": !((_g = cameraRef.current) === null || _g === void 0 ? void 0 : _g.isRearFacing)
|
|
14622
14650
|
}, faces.map(function (face, i) {
|
|
14623
14651
|
var _a;
|
|
@@ -14627,7 +14655,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14627
14655
|
scaling: debugScalingDetails,
|
|
14628
14656
|
flipX: !((_a = cameraRef.current) === null || _a === void 0 ? void 0 : _a.isRearFacing)
|
|
14629
14657
|
});
|
|
14630
|
-
}))), debugMode && /*#__PURE__*/React__default['default'].createElement(DebugStatsPane, null, cameraRef.current ? /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, "\u2705 Camera: ", cameraRef.current.label, " (", cameraRef.current.width, "x", cameraRef.current.height, ")") : '❌ Camera not ready', /*#__PURE__*/React__default['default'].createElement("br", null), isRecording ? '✅ Recording' : '❌ Not recording', /*#__PURE__*/React__default['default'].createElement("br", null), goodFramesThresholdMet ? '✅' : '❌', " Good Frame Count:", ' ',
|
|
14658
|
+
})))), debugMode && /*#__PURE__*/React__default['default'].createElement(DebugStatsPane, null, cameraRef.current ? /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, "\u2705 Camera: ", cameraRef.current.label, " (", cameraRef.current.width, "x", cameraRef.current.height, ")") : '❌ Camera not ready', /*#__PURE__*/React__default['default'].createElement("br", null), isRecording ? '✅ Recording' : '❌ Not recording', /*#__PURE__*/React__default['default'].createElement("br", null), goodFramesThresholdMet ? '✅' : '❌', " Good Frame Count:", ' ', goodIdCardFrontFramesCount, "/", goodIdCardFrontFramesThreshold));
|
|
14631
14659
|
};
|
|
14632
14660
|
function msToTime(s) {
|
|
14633
14661
|
var ms = s % 1000;
|