idmission-web-sdk 0.0.51 → 0.0.52
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/common/SelfieProgressPreview.d.ts +4 -0
- package/dist/components/face_liveness/FaceLivenessCapture.d.ts +0 -3
- package/dist/lib/utils/useTimeout.d.ts +4 -0
- package/dist/sdk2.cjs.development.js +98 -109
- 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 +98 -109
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +98 -109
- 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/package.json +1 -1
|
@@ -17,6 +17,3 @@ export type FaceLivenessCaptureProps = {
|
|
|
17
17
|
debugMode?: boolean;
|
|
18
18
|
};
|
|
19
19
|
export declare const FaceLivenessCapture: ({ onCapture, onSuccess, onTimeout, onExit, timeoutDurationMs, colors, verbiage, debugMode, }: FaceLivenessCaptureProps) => ReactElement;
|
|
20
|
-
export declare const SelfieProgressPreview: ({ imageUrl }: {
|
|
21
|
-
imageUrl: string;
|
|
22
|
-
}) => JSX.Element;
|
|
@@ -9934,6 +9934,42 @@ var GuidanceMessage = styled__default['default'].div(templateObject_2$2 || (temp
|
|
|
9934
9934
|
});
|
|
9935
9935
|
var templateObject_1$4, templateObject_2$2;
|
|
9936
9936
|
|
|
9937
|
+
var useTimeout = function useTimeout(durationMs, onTimeout, timeoutAverted, shouldWaitLonger) {
|
|
9938
|
+
var _a = React.useState(false),
|
|
9939
|
+
timedOut = _a[0],
|
|
9940
|
+
setTimedOut = _a[1];
|
|
9941
|
+
var _b = React.useState(),
|
|
9942
|
+
timeoutStartedAt = _b[0],
|
|
9943
|
+
setTimeoutStartedAt = _b[1];
|
|
9944
|
+
React.useEffect(function () {
|
|
9945
|
+
if (!durationMs) return;
|
|
9946
|
+
setTimeoutStartedAt(new Date());
|
|
9947
|
+
var timer = setTimeout(function () {
|
|
9948
|
+
setTimedOut(true);
|
|
9949
|
+
}, durationMs);
|
|
9950
|
+
return function () {
|
|
9951
|
+
if (timer) clearTimeout(timer);
|
|
9952
|
+
};
|
|
9953
|
+
}, [durationMs]);
|
|
9954
|
+
React.useEffect(function () {
|
|
9955
|
+
if (!timedOut || timeoutAverted) return;
|
|
9956
|
+
if (!shouldWaitLonger) {
|
|
9957
|
+
onTimeout === null || onTimeout === void 0 ? void 0 : onTimeout();
|
|
9958
|
+
return;
|
|
9959
|
+
}
|
|
9960
|
+
var t = setTimeout(function () {
|
|
9961
|
+
onTimeout === null || onTimeout === void 0 ? void 0 : onTimeout();
|
|
9962
|
+
}, 10000);
|
|
9963
|
+
return function () {
|
|
9964
|
+
clearTimeout(t);
|
|
9965
|
+
};
|
|
9966
|
+
}, [onTimeout, shouldWaitLonger, timedOut, timeoutAverted]);
|
|
9967
|
+
return {
|
|
9968
|
+
timedOut: timedOut,
|
|
9969
|
+
timeoutStartedAt: timeoutStartedAt
|
|
9970
|
+
};
|
|
9971
|
+
};
|
|
9972
|
+
|
|
9937
9973
|
var initialState$3 = {
|
|
9938
9974
|
videoWidth: 0,
|
|
9939
9975
|
videoHeight: 0,
|
|
@@ -10125,25 +10161,9 @@ var SelfieCapture = function SelfieCapture(_a) {
|
|
|
10125
10161
|
});
|
|
10126
10162
|
})();
|
|
10127
10163
|
}, [captureReady, onSelfieCaptured, state.faces, takePhoto]);
|
|
10128
|
-
var _p =
|
|
10129
|
-
|
|
10130
|
-
|
|
10131
|
-
var _q = React.useState(false),
|
|
10132
|
-
timedOut = _q[0],
|
|
10133
|
-
setTimedOut = _q[1];
|
|
10134
|
-
React.useEffect(function () {
|
|
10135
|
-
if (!timeoutDurationMs) return;
|
|
10136
|
-
setTimeoutStartedAt(new Date());
|
|
10137
|
-
var timer = setTimeout(function () {
|
|
10138
|
-
setTimedOut(true);
|
|
10139
|
-
}, timeoutDurationMs);
|
|
10140
|
-
return function () {
|
|
10141
|
-
if (timer) clearTimeout(timer);
|
|
10142
|
-
};
|
|
10143
|
-
}, [timeoutDurationMs]);
|
|
10144
|
-
React.useEffect(function () {
|
|
10145
|
-
if (timedOut) onTimeout === null || onTimeout === void 0 ? void 0 : onTimeout();
|
|
10146
|
-
}, [onTimeout, timedOut]);
|
|
10164
|
+
var _p = useTimeout(timeoutDurationMs, onTimeout),
|
|
10165
|
+
timedOut = _p.timedOut,
|
|
10166
|
+
timeoutStartedAt = _p.timeoutStartedAt;
|
|
10147
10167
|
var debugScalingDetails = useDebugScalingDetails({
|
|
10148
10168
|
enabled: debugMode,
|
|
10149
10169
|
pageWidth: width,
|
|
@@ -10216,6 +10236,28 @@ var Spinner = styled__default['default'].div(templateObject_1$3 || (templateObje
|
|
|
10216
10236
|
});
|
|
10217
10237
|
var templateObject_1$3;
|
|
10218
10238
|
|
|
10239
|
+
var SelfieProgressPreview = function SelfieProgressPreview(_a) {
|
|
10240
|
+
var imageUrl = _a.imageUrl;
|
|
10241
|
+
return /*#__PURE__*/React__default['default'].createElement(SelfieProgressPreviewWrapper, null, /*#__PURE__*/React__default['default'].createElement(SelfieProgressText, null, /*#__PURE__*/React__default['default'].createElement(Spinner, {
|
|
10242
|
+
"$size": 24,
|
|
10243
|
+
"$color": "white",
|
|
10244
|
+
"$thickness": 3,
|
|
10245
|
+
style: {
|
|
10246
|
+
position: 'relative',
|
|
10247
|
+
top: 4,
|
|
10248
|
+
left: -3,
|
|
10249
|
+
margin: '0 3px 0 -12px'
|
|
10250
|
+
}
|
|
10251
|
+
}), "Processing..."), /*#__PURE__*/React__default['default'].createElement(SelfiePreviewImageWrapper, null, /*#__PURE__*/React__default['default'].createElement("img", {
|
|
10252
|
+
src: imageUrl,
|
|
10253
|
+
alt: ""
|
|
10254
|
+
})));
|
|
10255
|
+
};
|
|
10256
|
+
var SelfieProgressPreviewWrapper = styled__default['default'].div(templateObject_1$2 || (templateObject_1$2 = tslib.__makeTemplateObject(["\n position: absolute;\n display: flex;\n flex-direction: column;\n height: 33%;\n bottom: 12px;\n right: 12px;\n"], ["\n position: absolute;\n display: flex;\n flex-direction: column;\n height: 33%;\n bottom: 12px;\n right: 12px;\n"])));
|
|
10257
|
+
var SelfieProgressText = styled__default['default'].div(templateObject_2$1 || (templateObject_2$1 = tslib.__makeTemplateObject(["\n display: block;\n position: absolute;\n top: -32px;\n font:\n 14px -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n Helvetica,\n Arial,\n sans-serif,\n 'Apple Color Emoji',\n 'Segoe UI Emoji',\n 'Segoe UI Symbol';\n color: white;\n text-align: center;\n margin: 0 auto;\n width: 100%;\n"], ["\n display: block;\n position: absolute;\n top: -32px;\n font:\n 14px -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n Helvetica,\n Arial,\n sans-serif,\n 'Apple Color Emoji',\n 'Segoe UI Emoji',\n 'Segoe UI Symbol';\n color: white;\n text-align: center;\n margin: 0 auto;\n width: 100%;\n"])));
|
|
10258
|
+
var SelfiePreviewImageWrapper = styled__default['default'].div(templateObject_3$1 || (templateObject_3$1 = tslib.__makeTemplateObject(["\n position: relative;\n height: calc(100% - 8px);\n padding: 4px;\n border-radius: 4px;\n background: white;\n\n & > img {\n border-radius: 4px;\n width: auto;\n max-height: 100%;\n }\n"], ["\n position: relative;\n height: calc(100% - 8px);\n padding: 4px;\n border-radius: 4px;\n background: white;\n\n & > img {\n border-radius: 4px;\n width: auto;\n max-height: 100%;\n }\n"])));
|
|
10259
|
+
var templateObject_1$2, templateObject_2$1, templateObject_3$1;
|
|
10260
|
+
|
|
10219
10261
|
var initialState$2 = {
|
|
10220
10262
|
frame: null,
|
|
10221
10263
|
face: null,
|
|
@@ -10385,31 +10427,7 @@ var FaceLivenessCapture = function FaceLivenessCapture(_a) {
|
|
|
10385
10427
|
onTimeout === null || onTimeout === void 0 ? void 0 : onTimeout();
|
|
10386
10428
|
}
|
|
10387
10429
|
}, [onTimeout, state.timesLivenessCheckFailed]);
|
|
10388
|
-
|
|
10389
|
-
timedOut = _g[0],
|
|
10390
|
-
setTimedOut = _g[1];
|
|
10391
|
-
React.useEffect(function () {
|
|
10392
|
-
if (!timeoutDurationMs) return;
|
|
10393
|
-
var timer = setTimeout(function () {
|
|
10394
|
-
setTimedOut(true);
|
|
10395
|
-
}, timeoutDurationMs);
|
|
10396
|
-
return function () {
|
|
10397
|
-
if (timer) clearTimeout(timer);
|
|
10398
|
-
};
|
|
10399
|
-
}, [timeoutDurationMs]);
|
|
10400
|
-
React.useEffect(function () {
|
|
10401
|
-
if (!timedOut || state.requestState === 'PASSED') return;
|
|
10402
|
-
if (state.requestState !== 'IN_PROGRESS') {
|
|
10403
|
-
onTimeout === null || onTimeout === void 0 ? void 0 : onTimeout();
|
|
10404
|
-
return;
|
|
10405
|
-
}
|
|
10406
|
-
var t = setTimeout(function () {
|
|
10407
|
-
onTimeout === null || onTimeout === void 0 ? void 0 : onTimeout();
|
|
10408
|
-
}, 10000);
|
|
10409
|
-
return function () {
|
|
10410
|
-
clearTimeout(t);
|
|
10411
|
-
};
|
|
10412
|
-
}, [onTimeout, state.requestState, timedOut]);
|
|
10430
|
+
useTimeout(timeoutDurationMs, onTimeout, state.requestState === 'PASSED', state.requestState === 'IN_PROGRESS');
|
|
10413
10431
|
verbiage.guidanceRemoveEyeCoveringsText || (verbiage.guidanceRemoveEyeCoveringsText = t('Please remove your eye coverings (sunglasses, eye patch, etc.)...'));
|
|
10414
10432
|
verbiage.guidanceRemoveHeadCoveringsText || (verbiage.guidanceRemoveHeadCoveringsText = t('Please remove your head coverings (hat, scarf, etc.)...'));
|
|
10415
10433
|
verbiage.guidanceRemoveMaskText || (verbiage.guidanceRemoveMaskText = t('Please remove your mask...'));
|
|
@@ -10426,27 +10444,6 @@ var FaceLivenessCapture = function FaceLivenessCapture(_a) {
|
|
|
10426
10444
|
imageUrl: imageUrl
|
|
10427
10445
|
}));
|
|
10428
10446
|
};
|
|
10429
|
-
var SelfieProgressPreview = function SelfieProgressPreview(_a) {
|
|
10430
|
-
var imageUrl = _a.imageUrl;
|
|
10431
|
-
return /*#__PURE__*/React__default['default'].createElement(SelfieProgressPreviewWrapper, null, /*#__PURE__*/React__default['default'].createElement(SelfieProgressText, null, /*#__PURE__*/React__default['default'].createElement(Spinner, {
|
|
10432
|
-
"$size": 24,
|
|
10433
|
-
"$color": "white",
|
|
10434
|
-
"$thickness": 3,
|
|
10435
|
-
style: {
|
|
10436
|
-
position: 'relative',
|
|
10437
|
-
top: 4,
|
|
10438
|
-
left: -3,
|
|
10439
|
-
margin: '0 3px 0 -12px'
|
|
10440
|
-
}
|
|
10441
|
-
}), "Processing..."), /*#__PURE__*/React__default['default'].createElement(SelfiePreviewImageWrapper, null, /*#__PURE__*/React__default['default'].createElement("img", {
|
|
10442
|
-
src: imageUrl,
|
|
10443
|
-
alt: ""
|
|
10444
|
-
})));
|
|
10445
|
-
};
|
|
10446
|
-
var SelfieProgressPreviewWrapper = styled__default['default'].div(templateObject_1$2 || (templateObject_1$2 = tslib.__makeTemplateObject(["\n position: absolute;\n display: flex;\n flex-direction: column;\n height: 33%;\n bottom: 12px;\n right: 12px;\n"], ["\n position: absolute;\n display: flex;\n flex-direction: column;\n height: 33%;\n bottom: 12px;\n right: 12px;\n"])));
|
|
10447
|
-
var SelfieProgressText = styled__default['default'].div(templateObject_2$1 || (templateObject_2$1 = tslib.__makeTemplateObject(["\n display: block;\n position: absolute;\n top: -32px;\n font:\n 14px -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n Helvetica,\n Arial,\n sans-serif,\n 'Apple Color Emoji',\n 'Segoe UI Emoji',\n 'Segoe UI Symbol';\n color: white;\n text-align: center;\n margin: 0 auto;\n width: 100%;\n"], ["\n display: block;\n position: absolute;\n top: -32px;\n font:\n 14px -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n Helvetica,\n Arial,\n sans-serif,\n 'Apple Color Emoji',\n 'Segoe UI Emoji',\n 'Segoe UI Symbol';\n color: white;\n text-align: center;\n margin: 0 auto;\n width: 100%;\n"])));
|
|
10448
|
-
var SelfiePreviewImageWrapper = styled__default['default'].div(templateObject_3$1 || (templateObject_3$1 = tslib.__makeTemplateObject(["\n position: relative;\n height: calc(100% - 8px);\n padding: 4px;\n border-radius: 4px;\n background: white;\n\n & > img {\n border-radius: 4px;\n width: auto;\n max-height: 100%;\n }\n"], ["\n position: relative;\n height: calc(100% - 8px);\n padding: 4px;\n border-radius: 4px;\n background: white;\n\n & > img {\n border-radius: 4px;\n width: auto;\n max-height: 100%;\n }\n"])));
|
|
10449
|
-
var templateObject_1$2, templateObject_2$1, templateObject_3$1;
|
|
10450
10447
|
|
|
10451
10448
|
var SelfieCaptureLoadingOverlay = function SelfieCaptureLoadingOverlay(_a) {
|
|
10452
10449
|
var headingText = _a.headingText,
|
|
@@ -12658,6 +12655,9 @@ var CustomerVerificationCapture = function CustomerVerificationCapture(_a) {
|
|
|
12658
12655
|
submissionResponse = _f.submissionResponse,
|
|
12659
12656
|
selfieImage = _f.selfieImage,
|
|
12660
12657
|
setSelfieImage = _f.setSelfieImage;
|
|
12658
|
+
var _g = React.useState(null),
|
|
12659
|
+
imageUrl = _g[0],
|
|
12660
|
+
setImageUrl = _g[1];
|
|
12661
12661
|
var onSelfieCaptured = React.useCallback(function (frame, face) {
|
|
12662
12662
|
dispatch({
|
|
12663
12663
|
type: 'verificationReady',
|
|
@@ -12670,8 +12670,9 @@ var CustomerVerificationCapture = function CustomerVerificationCapture(_a) {
|
|
|
12670
12670
|
var isReady = state.requestState === 'READY';
|
|
12671
12671
|
React.useEffect(function () {
|
|
12672
12672
|
if (!frame || !face) return;
|
|
12673
|
-
|
|
12674
|
-
|
|
12673
|
+
var imageUrl = cropToShoulders(frame, face);
|
|
12674
|
+
setImageUrl(imageUrl);
|
|
12675
|
+
dataUrlToBase64(imageUrl).then(function (img) {
|
|
12675
12676
|
setSelfieImage(img);
|
|
12676
12677
|
});
|
|
12677
12678
|
}, [face, frame, setSelfieImage]);
|
|
@@ -12725,15 +12726,17 @@ var CustomerVerificationCapture = function CustomerVerificationCapture(_a) {
|
|
|
12725
12726
|
onCustomerNotMatched === null || onCustomerNotMatched === void 0 ? void 0 : onCustomerNotMatched(submissionResponse);
|
|
12726
12727
|
}
|
|
12727
12728
|
}, [onCustomerMatched, onCustomerNotMatched, state.requestState, submissionResponse]);
|
|
12728
|
-
|
|
12729
|
+
useTimeout(captureGuidanceTimeoutDurationMs, onCaptureGuidanceTimeout, ['FOUND', 'NOT_FOUND'].includes(state.requestState), state.requestState === 'IN_PROGRESS');
|
|
12730
|
+
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(SelfieCapture, {
|
|
12729
12731
|
onSelfieCaptured: onSelfieCaptured,
|
|
12730
|
-
onTimeout: onCaptureGuidanceTimeout,
|
|
12731
12732
|
onExit: onExit,
|
|
12732
12733
|
timeoutDurationMs: captureGuidanceTimeoutDurationMs,
|
|
12733
12734
|
colors: colors,
|
|
12734
12735
|
verbiage: verbiage,
|
|
12735
12736
|
debugMode: debugMode
|
|
12736
|
-
})
|
|
12737
|
+
}), imageUrl && /*#__PURE__*/React__default['default'].createElement(SelfieProgressPreview, {
|
|
12738
|
+
imageUrl: imageUrl
|
|
12739
|
+
}));
|
|
12737
12740
|
};
|
|
12738
12741
|
|
|
12739
12742
|
var CustomerVerificationSuccess = function CustomerVerificationSuccess(_a) {
|
|
@@ -12850,7 +12853,6 @@ var CustomerVerificationWizard = function CustomerVerificationWizard(_a) {
|
|
|
12850
12853
|
var _f = React.useContext(SubmissionContext),
|
|
12851
12854
|
submissionResponse = _f.submissionResponse,
|
|
12852
12855
|
selfieImage = _f.selfieImage;
|
|
12853
|
-
var releaseCameraAccess = React.useContext(CameraStateContext).releaseCameraAccess;
|
|
12854
12856
|
var _g = React.useState('LOADING'),
|
|
12855
12857
|
captureState = _g[0],
|
|
12856
12858
|
setCaptureState = _g[1];
|
|
@@ -12858,33 +12860,24 @@ var CustomerVerificationWizard = function CustomerVerificationWizard(_a) {
|
|
|
12858
12860
|
return tslib.__awaiter(void 0, void 0, void 0, function () {
|
|
12859
12861
|
return tslib.__generator(this, function (_a) {
|
|
12860
12862
|
setCaptureState('MATCHED');
|
|
12861
|
-
|
|
12862
|
-
setTimeout(function () {
|
|
12863
|
-
onCustomerMatched === null || onCustomerMatched === void 0 ? void 0 : onCustomerMatched(response);
|
|
12864
|
-
}, 0);
|
|
12863
|
+
onCustomerMatched === null || onCustomerMatched === void 0 ? void 0 : onCustomerMatched(response);
|
|
12865
12864
|
return [2];
|
|
12866
12865
|
});
|
|
12867
12866
|
});
|
|
12868
|
-
}, [onCustomerMatched
|
|
12867
|
+
}, [onCustomerMatched]);
|
|
12869
12868
|
var onCustomerNotMatchedCallback = React.useCallback(function (response) {
|
|
12870
12869
|
return tslib.__awaiter(void 0, void 0, void 0, function () {
|
|
12871
12870
|
return tslib.__generator(this, function (_a) {
|
|
12872
12871
|
setCaptureState('NOT_MATCHED');
|
|
12873
|
-
|
|
12874
|
-
setTimeout(function () {
|
|
12875
|
-
onCustomerNotMatched === null || onCustomerNotMatched === void 0 ? void 0 : onCustomerNotMatched(response);
|
|
12876
|
-
}, 0);
|
|
12872
|
+
onCustomerNotMatched === null || onCustomerNotMatched === void 0 ? void 0 : onCustomerNotMatched(response);
|
|
12877
12873
|
return [2];
|
|
12878
12874
|
});
|
|
12879
12875
|
});
|
|
12880
|
-
}, [onCustomerNotMatched
|
|
12876
|
+
}, [onCustomerNotMatched]);
|
|
12881
12877
|
var onCaptureGuidanceTimeoutCallback = React.useCallback(function () {
|
|
12882
12878
|
setCaptureState('FAILED');
|
|
12883
|
-
|
|
12884
|
-
|
|
12885
|
-
onCaptureGuidanceTimeout === null || onCaptureGuidanceTimeout === void 0 ? void 0 : onCaptureGuidanceTimeout();
|
|
12886
|
-
}, 0);
|
|
12887
|
-
}, [onCaptureGuidanceTimeout, releaseCameraAccess]);
|
|
12879
|
+
onCaptureGuidanceTimeout === null || onCaptureGuidanceTimeout === void 0 ? void 0 : onCaptureGuidanceTimeout();
|
|
12880
|
+
}, [onCaptureGuidanceTimeout]);
|
|
12888
12881
|
var _h = React.useState(0),
|
|
12889
12882
|
attempt = _h[0],
|
|
12890
12883
|
setAttempt = _h[1];
|
|
@@ -12989,9 +12982,9 @@ var CustomerVerification = function CustomerVerification(_a) {
|
|
|
12989
12982
|
onBeforeSubmit: onBeforeSubmit,
|
|
12990
12983
|
geolocationEnabled: geolocationEnabled,
|
|
12991
12984
|
geolocationRequired: geolocationRequired
|
|
12992
|
-
}, /*#__PURE__*/React__default['default'].createElement(
|
|
12985
|
+
}, /*#__PURE__*/React__default['default'].createElement(CameraProvider, {
|
|
12993
12986
|
preferFrontFacingCamera: true
|
|
12994
|
-
}, /*#__PURE__*/React__default['default'].createElement(CustomerVerificationWizard, {
|
|
12987
|
+
}, /*#__PURE__*/React__default['default'].createElement(HighPerformanceSelfieGuidanceModelsProvider, null, /*#__PURE__*/React__default['default'].createElement(CustomerVerificationWizard, {
|
|
12995
12988
|
onComplete: onComplete,
|
|
12996
12989
|
onCustomerMatched: onCustomerMatched,
|
|
12997
12990
|
onCustomerNotMatched: onCustomerNotMatched,
|
|
@@ -13091,6 +13084,9 @@ var CustomerIdentificationCapture = function CustomerIdentificationCapture(_a) {
|
|
|
13091
13084
|
submissionResponse = _f.submissionResponse,
|
|
13092
13085
|
selfieImage = _f.selfieImage,
|
|
13093
13086
|
setSelfieImage = _f.setSelfieImage;
|
|
13087
|
+
var _g = React.useState(null),
|
|
13088
|
+
imageUrl = _g[0],
|
|
13089
|
+
setImageUrl = _g[1];
|
|
13094
13090
|
var onSelfieCaptured = React.useCallback(function (frame, face) {
|
|
13095
13091
|
dispatch({
|
|
13096
13092
|
type: 'identificationReady',
|
|
@@ -13105,8 +13101,9 @@ var CustomerIdentificationCapture = function CustomerIdentificationCapture(_a) {
|
|
|
13105
13101
|
var isReady = state.requestState === 'READY';
|
|
13106
13102
|
React.useEffect(function () {
|
|
13107
13103
|
if (!frame || !face) return;
|
|
13108
|
-
|
|
13109
|
-
|
|
13104
|
+
var imageUrl = cropToShoulders(frame, face);
|
|
13105
|
+
setImageUrl(imageUrl);
|
|
13106
|
+
dataUrlToBase64(imageUrl).then(function (img) {
|
|
13110
13107
|
setSelfieImage(img);
|
|
13111
13108
|
});
|
|
13112
13109
|
}, [face, frame, setSelfieImage]);
|
|
@@ -13160,15 +13157,17 @@ var CustomerIdentificationCapture = function CustomerIdentificationCapture(_a) {
|
|
|
13160
13157
|
onCustomerNotMatched === null || onCustomerNotMatched === void 0 ? void 0 : onCustomerNotMatched(submissionResponse);
|
|
13161
13158
|
}
|
|
13162
13159
|
}, [onCustomerMatched, onCustomerNotMatched, state.requestState, submissionResponse]);
|
|
13163
|
-
|
|
13160
|
+
useTimeout(captureGuidanceTimeoutDurationMs, onCaptureGuidanceTimeout, ['FOUND', 'NOT_FOUND'].includes(state.requestState), state.requestState === 'IN_PROGRESS');
|
|
13161
|
+
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(SelfieCapture, {
|
|
13164
13162
|
onSelfieCaptured: onSelfieCaptured,
|
|
13165
|
-
onTimeout: onCaptureGuidanceTimeout,
|
|
13166
13163
|
onExit: onExit,
|
|
13167
13164
|
timeoutDurationMs: captureGuidanceTimeoutDurationMs,
|
|
13168
13165
|
colors: colors,
|
|
13169
13166
|
verbiage: verbiage,
|
|
13170
13167
|
debugMode: debugMode
|
|
13171
|
-
})
|
|
13168
|
+
}), imageUrl && /*#__PURE__*/React__default['default'].createElement(SelfieProgressPreview, {
|
|
13169
|
+
imageUrl: imageUrl
|
|
13170
|
+
}));
|
|
13172
13171
|
};
|
|
13173
13172
|
|
|
13174
13173
|
var CustomerIdentificationSuccess = function CustomerIdentificationSuccess(_a) {
|
|
@@ -13285,7 +13284,6 @@ var CustomerIdentificationWizard = function CustomerIdentificationWizard(_a) {
|
|
|
13285
13284
|
var _f = React.useContext(SubmissionContext),
|
|
13286
13285
|
submissionResponse = _f.submissionResponse,
|
|
13287
13286
|
selfieImage = _f.selfieImage;
|
|
13288
|
-
var releaseCameraAccess = React.useContext(CameraStateContext).releaseCameraAccess;
|
|
13289
13287
|
var _g = React.useState('LOADING'),
|
|
13290
13288
|
captureState = _g[0],
|
|
13291
13289
|
setCaptureState = _g[1];
|
|
@@ -13293,33 +13291,24 @@ var CustomerIdentificationWizard = function CustomerIdentificationWizard(_a) {
|
|
|
13293
13291
|
return tslib.__awaiter(void 0, void 0, void 0, function () {
|
|
13294
13292
|
return tslib.__generator(this, function (_a) {
|
|
13295
13293
|
setCaptureState('FOUND');
|
|
13296
|
-
|
|
13297
|
-
setTimeout(function () {
|
|
13298
|
-
onCustomerMatched === null || onCustomerMatched === void 0 ? void 0 : onCustomerMatched(response);
|
|
13299
|
-
}, 0);
|
|
13294
|
+
onCustomerMatched === null || onCustomerMatched === void 0 ? void 0 : onCustomerMatched(response);
|
|
13300
13295
|
return [2];
|
|
13301
13296
|
});
|
|
13302
13297
|
});
|
|
13303
|
-
}, [onCustomerMatched
|
|
13298
|
+
}, [onCustomerMatched]);
|
|
13304
13299
|
var onCustomerNotMatchedCallback = React.useCallback(function (response) {
|
|
13305
13300
|
return tslib.__awaiter(void 0, void 0, void 0, function () {
|
|
13306
13301
|
return tslib.__generator(this, function (_a) {
|
|
13307
13302
|
setCaptureState('NOT_FOUND');
|
|
13308
|
-
|
|
13309
|
-
setTimeout(function () {
|
|
13310
|
-
onCustomerNotMatched === null || onCustomerNotMatched === void 0 ? void 0 : onCustomerNotMatched(response);
|
|
13311
|
-
}, 0);
|
|
13303
|
+
onCustomerNotMatched === null || onCustomerNotMatched === void 0 ? void 0 : onCustomerNotMatched(response);
|
|
13312
13304
|
return [2];
|
|
13313
13305
|
});
|
|
13314
13306
|
});
|
|
13315
|
-
}, [onCustomerNotMatched
|
|
13307
|
+
}, [onCustomerNotMatched]);
|
|
13316
13308
|
var onCaptureGuidanceTimeoutCallback = React.useCallback(function () {
|
|
13317
13309
|
setCaptureState('FAILED');
|
|
13318
|
-
|
|
13319
|
-
|
|
13320
|
-
onCaptureGuidanceTimeout === null || onCaptureGuidanceTimeout === void 0 ? void 0 : onCaptureGuidanceTimeout();
|
|
13321
|
-
}, 0);
|
|
13322
|
-
}, [onCaptureGuidanceTimeout, releaseCameraAccess]);
|
|
13310
|
+
onCaptureGuidanceTimeout === null || onCaptureGuidanceTimeout === void 0 ? void 0 : onCaptureGuidanceTimeout();
|
|
13311
|
+
}, [onCaptureGuidanceTimeout]);
|
|
13323
13312
|
var _h = React.useState(0),
|
|
13324
13313
|
attempt = _h[0],
|
|
13325
13314
|
setAttempt = _h[1];
|