idmission-web-sdk 2.2.150 → 2.2.152
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/CompositeWizard.d.ts.map +1 -1
- package/dist/components/customer_flows/SignatureKYC.d.ts +2 -0
- package/dist/components/customer_flows/SignatureKYC.d.ts.map +1 -1
- package/dist/components/video_signature_capture/VideoSignatureCapture.d.ts +2 -1
- package/dist/components/video_signature_capture/VideoSignatureCapture.d.ts.map +1 -1
- package/dist/components/video_signature_capture/VideoSignatureContext.d.ts +2 -0
- package/dist/components/video_signature_capture/VideoSignatureContext.d.ts.map +1 -1
- package/dist/components/video_signature_capture/VideoSignatureGuides.d.ts +2 -1
- package/dist/components/video_signature_capture/VideoSignatureGuides.d.ts.map +1 -1
- package/dist/components/video_signature_capture/VideoSignatureWizard.d.ts +7 -2
- package/dist/components/video_signature_capture/VideoSignatureWizard.d.ts.map +1 -1
- package/dist/lib/camera/useVideoRecorder.d.ts +1 -0
- package/dist/lib/camera/useVideoRecorder.d.ts.map +1 -1
- package/dist/sdk2.cjs.development.js +191 -135
- 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 +191 -135
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +191 -135
- 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
|
@@ -211,7 +211,7 @@
|
|
|
211
211
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
212
212
|
};
|
|
213
213
|
|
|
214
|
-
var webSdkVersion = '2.2.
|
|
214
|
+
var webSdkVersion = '2.2.152';
|
|
215
215
|
|
|
216
216
|
function getPlatform() {
|
|
217
217
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -9831,12 +9831,9 @@
|
|
|
9831
9831
|
}, [preferFrontFacingCamera, preferIphoneContinuityCamera]);
|
|
9832
9832
|
React.useEffect(function () {
|
|
9833
9833
|
var _a;
|
|
9834
|
-
if (
|
|
9835
|
-
|
|
9836
|
-
|
|
9837
|
-
var _a;
|
|
9838
|
-
return (_a = store.current) === null || _a === void 0 ? void 0 : _a.getState().releaseMicrophoneAccess();
|
|
9839
|
-
};
|
|
9834
|
+
if (requireMicrophoneAccess) {
|
|
9835
|
+
(_a = store.current) === null || _a === void 0 ? void 0 : _a.getState().requestMicrophoneAccess();
|
|
9836
|
+
}
|
|
9840
9837
|
}, [requireMicrophoneAccess]);
|
|
9841
9838
|
React.useEffect(function () {
|
|
9842
9839
|
return function () {
|
|
@@ -22940,18 +22937,25 @@
|
|
|
22940
22937
|
processAudio();
|
|
22941
22938
|
}
|
|
22942
22939
|
}, [audioRecordingIntentionallyStopped, audioRecordingStopped, processAudio]);
|
|
22943
|
-
|
|
22944
|
-
|
|
22945
|
-
|
|
22946
|
-
|
|
22947
|
-
|
|
22948
|
-
|
|
22949
|
-
|
|
22950
|
-
|
|
22951
|
-
|
|
22952
|
-
|
|
22953
|
-
|
|
22954
|
-
|
|
22940
|
+
var clearRecordedData = React.useCallback(function () {
|
|
22941
|
+
videoChunks.current = [];
|
|
22942
|
+
audioChunks.current = [];
|
|
22943
|
+
}, []);
|
|
22944
|
+
return React.useMemo(function () {
|
|
22945
|
+
return {
|
|
22946
|
+
isRecordingVideo: isRecordingVideo,
|
|
22947
|
+
isRecordingAudio: isRecordingAudio,
|
|
22948
|
+
startRecordingVideo: startRecordingVideo,
|
|
22949
|
+
startRecordingAudio: startRecordingAudio,
|
|
22950
|
+
stopRecordingVideo: stopRecordingVideo,
|
|
22951
|
+
stopRecordingAudio: stopRecordingAudio,
|
|
22952
|
+
clearRecordedData: clearRecordedData,
|
|
22953
|
+
videoRecordingUnintentionallyStopped: videoRecordingStopped && !videoRecordingIntentionallyStopped,
|
|
22954
|
+
audioRecordingUnintentionallyStopped: audioRecordingStopped && !audioRecordingIntentionallyStopped,
|
|
22955
|
+
videoUrl: videoUrl,
|
|
22956
|
+
audioUrl: audioUrl
|
|
22957
|
+
};
|
|
22958
|
+
}, [audioRecordingIntentionallyStopped, audioRecordingStopped, audioUrl, clearRecordedData, isRecordingAudio, isRecordingVideo, startRecordingAudio, startRecordingVideo, stopRecordingAudio, stopRecordingVideo, videoRecordingIntentionallyStopped, videoRecordingStopped, videoUrl]);
|
|
22955
22959
|
};
|
|
22956
22960
|
|
|
22957
22961
|
var videoSignatureInitialState = {
|
|
@@ -22961,6 +22965,10 @@
|
|
|
22961
22965
|
stopRecording: function stopRecording() {
|
|
22962
22966
|
return null;
|
|
22963
22967
|
},
|
|
22968
|
+
clearRecordedData: function clearRecordedData() {
|
|
22969
|
+
return null;
|
|
22970
|
+
},
|
|
22971
|
+
isRecording: false,
|
|
22964
22972
|
signatureData: null,
|
|
22965
22973
|
signatureDataUrl: null,
|
|
22966
22974
|
signatureVideoData: null,
|
|
@@ -23004,17 +23012,28 @@
|
|
|
23004
23012
|
startRecordingVideo = _k.startRecordingVideo,
|
|
23005
23013
|
stopRecordingVideo = _k.stopRecordingVideo,
|
|
23006
23014
|
startRecordingAudio = _k.startRecordingAudio,
|
|
23007
|
-
stopRecordingAudio = _k.stopRecordingAudio
|
|
23015
|
+
stopRecordingAudio = _k.stopRecordingAudio,
|
|
23016
|
+
clearRecordedVideoData = _k.clearRecordedData;
|
|
23008
23017
|
var outputCanvas = React.useRef(null);
|
|
23009
23018
|
var recordingLock = React.useRef(false);
|
|
23019
|
+
var onRecordingStopped = React.useRef(function () {});
|
|
23010
23020
|
var _l = React.useState(false),
|
|
23011
23021
|
isRecording = _l[0],
|
|
23012
23022
|
setIsRecording = _l[1];
|
|
23013
23023
|
var startRecording = React.useCallback(function () {
|
|
23014
|
-
setIsRecording(true);
|
|
23024
|
+
return setIsRecording(true);
|
|
23015
23025
|
}, []);
|
|
23016
23026
|
var stopRecording = React.useCallback(function () {
|
|
23027
|
+
return setIsRecording(false);
|
|
23028
|
+
}, []);
|
|
23029
|
+
var clearRecordedData = React.useCallback(function () {
|
|
23030
|
+
var _a;
|
|
23031
|
+
recordingLock.current = false;
|
|
23032
|
+
onRecordingStopped.current = function () {
|
|
23033
|
+
return setIsRecording(true);
|
|
23034
|
+
};
|
|
23017
23035
|
setIsRecording(false);
|
|
23036
|
+
(_a = signatureRecorder.current) === null || _a === void 0 ? void 0 : _a.stop();
|
|
23018
23037
|
}, []);
|
|
23019
23038
|
React.useEffect(function () {
|
|
23020
23039
|
if (!isRecording) return;
|
|
@@ -23040,6 +23059,8 @@
|
|
|
23040
23059
|
_b.sent();
|
|
23041
23060
|
_b.label = 2;
|
|
23042
23061
|
case 2:
|
|
23062
|
+
recordedChunks.current = [];
|
|
23063
|
+
clearRecordedVideoData();
|
|
23043
23064
|
startRecordingVideo();
|
|
23044
23065
|
if (captureAudio) startRecordingAudio();
|
|
23045
23066
|
stream = outputCanvas.current.captureStream(24 /* fps */);
|
|
@@ -23064,13 +23085,14 @@
|
|
|
23064
23085
|
});
|
|
23065
23086
|
setSignatureVideoData(blob);
|
|
23066
23087
|
setSignatureVideoUrl(URL.createObjectURL(blob));
|
|
23088
|
+
onRecordingStopped.current();
|
|
23067
23089
|
};
|
|
23068
23090
|
return [2 /*return*/];
|
|
23069
23091
|
}
|
|
23070
23092
|
});
|
|
23071
23093
|
});
|
|
23072
23094
|
})();
|
|
23073
|
-
}, [audioStream, captureAudio, isRecording, startRecordingAudio, startRecordingVideo]);
|
|
23095
|
+
}, [audioStream, captureAudio, clearRecordedVideoData, isRecording, startRecordingAudio, startRecordingVideo]);
|
|
23074
23096
|
var animationFrame = React.useRef(0);
|
|
23075
23097
|
React.useEffect(function () {
|
|
23076
23098
|
if (!signaturePad.current || !videoRef.current || !outputCanvas.current || !camera || !isRecording || !isRecordingVideo) return;
|
|
@@ -23127,8 +23149,10 @@
|
|
|
23127
23149
|
}, [stopRecordingAudio, stopRecordingVideo]);
|
|
23128
23150
|
var value = React.useMemo(function () {
|
|
23129
23151
|
return {
|
|
23152
|
+
isRecording: isRecording,
|
|
23130
23153
|
startRecording: startRecording,
|
|
23131
23154
|
stopRecording: stopRecording,
|
|
23155
|
+
clearRecordedData: clearRecordedData,
|
|
23132
23156
|
signaturePad: signaturePad,
|
|
23133
23157
|
signatureData: signatureData,
|
|
23134
23158
|
signatureDataUrl: signatureDataUrl,
|
|
@@ -23136,7 +23160,7 @@
|
|
|
23136
23160
|
signatureVideoUrl: signatureVideoUrl,
|
|
23137
23161
|
onAcceptClicked: onAcceptClicked
|
|
23138
23162
|
};
|
|
23139
|
-
}, [onAcceptClicked, signatureData, signatureDataUrl, signatureVideoData, signatureVideoUrl, startRecording, stopRecording]);
|
|
23163
|
+
}, [clearRecordedData, isRecording, onAcceptClicked, signatureData, signatureDataUrl, signatureVideoData, signatureVideoUrl, startRecording, stopRecording]);
|
|
23140
23164
|
return /*#__PURE__*/React.createElement(VideoSignatureContext.Provider, {
|
|
23141
23165
|
value: value
|
|
23142
23166
|
}, children, /*#__PURE__*/React.createElement(InvisibleCanvas, {
|
|
@@ -23152,24 +23176,27 @@
|
|
|
23152
23176
|
}
|
|
23153
23177
|
|
|
23154
23178
|
function VideoSignatureGuides(_a) {
|
|
23155
|
-
var _b
|
|
23156
|
-
|
|
23157
|
-
|
|
23158
|
-
|
|
23159
|
-
faceGuideStatus = _d === void 0 ? 'success' : _d,
|
|
23179
|
+
var _b = _a.requestedAction,
|
|
23180
|
+
requestedAction = _b === void 0 ? 'VERIFY_LIVENESS' : _b,
|
|
23181
|
+
_c = _a.faceGuideStatus,
|
|
23182
|
+
faceGuideStatus = _c === void 0 ? 'success' : _c,
|
|
23160
23183
|
faceGuideBorderWidth = _a.faceGuideBorderWidth,
|
|
23161
23184
|
faceGuideBorderColor = _a.faceGuideBorderColor,
|
|
23162
|
-
|
|
23163
|
-
|
|
23164
|
-
|
|
23165
|
-
|
|
23166
|
-
|
|
23167
|
-
|
|
23168
|
-
|
|
23169
|
-
|
|
23170
|
-
|
|
23171
|
-
|
|
23172
|
-
|
|
23185
|
+
onClearSignaturePadClicked = _a.onClearSignaturePadClicked,
|
|
23186
|
+
_d = _a.classNames,
|
|
23187
|
+
classNames = _d === void 0 ? {} : _d,
|
|
23188
|
+
_e = _a.verbiage,
|
|
23189
|
+
rawVerbiage = _e === void 0 ? {} : _e;
|
|
23190
|
+
var _f = useResizeObserver(),
|
|
23191
|
+
ref = _f.ref,
|
|
23192
|
+
width = _f.width,
|
|
23193
|
+
height = _f.height;
|
|
23194
|
+
var _g = useVideoSignatureContext(),
|
|
23195
|
+
signaturePad = _g.signaturePad,
|
|
23196
|
+
onAcceptClicked = _g.onAcceptClicked;
|
|
23197
|
+
var _h = React.useState(true),
|
|
23198
|
+
isSignaturePadEmpty = _h[0],
|
|
23199
|
+
setIsSignaturePadEmpty = _h[1];
|
|
23173
23200
|
var verbiage = useTranslations(rawVerbiage, {
|
|
23174
23201
|
clearSignatureBtnText: 'Clear',
|
|
23175
23202
|
acceptSignatureBtnText: 'Accept'
|
|
@@ -23203,19 +23230,28 @@
|
|
|
23203
23230
|
className: classNames.signatureCanvasInner
|
|
23204
23231
|
}, /*#__PURE__*/React.createElement(SignatureCanvas, {
|
|
23205
23232
|
ref: signaturePad,
|
|
23206
|
-
canvasProps: canvasProps
|
|
23233
|
+
canvasProps: canvasProps,
|
|
23234
|
+
onEnd: function onEnd() {
|
|
23235
|
+
var _a;
|
|
23236
|
+
setIsSignaturePadEmpty(!!((_a = signaturePad === null || signaturePad === void 0 ? void 0 : signaturePad.current) === null || _a === void 0 ? void 0 : _a.isEmpty()));
|
|
23237
|
+
}
|
|
23207
23238
|
})), /*#__PURE__*/React.createElement(SignatureButtonsContainer, {
|
|
23208
23239
|
className: classNames.signatureButtonsRow
|
|
23209
23240
|
}, /*#__PURE__*/React.createElement(LoaderButton, {
|
|
23210
23241
|
variant: "secondary",
|
|
23211
23242
|
className: classNames.clearSignatureBtn,
|
|
23212
|
-
onClick: (
|
|
23243
|
+
onClick: function onClick() {
|
|
23244
|
+
var _a, _b;
|
|
23245
|
+
(_a = signaturePad === null || signaturePad === void 0 ? void 0 : signaturePad.current) === null || _a === void 0 ? void 0 : _a.clear();
|
|
23246
|
+
setIsSignaturePadEmpty(!!((_b = signaturePad === null || signaturePad === void 0 ? void 0 : signaturePad.current) === null || _b === void 0 ? void 0 : _b.isEmpty()));
|
|
23247
|
+
onClearSignaturePadClicked === null || onClearSignaturePadClicked === void 0 ? void 0 : onClearSignaturePadClicked();
|
|
23248
|
+
},
|
|
23213
23249
|
disabled: requestedAction === 'VERIFY_LIVENESS',
|
|
23214
23250
|
finished: true
|
|
23215
23251
|
}, verbiage.clearSignatureBtnText), /*#__PURE__*/React.createElement(AcceptBtn, {
|
|
23216
23252
|
variant: "positive",
|
|
23217
23253
|
className: classNames.acceptSignatureBtn,
|
|
23218
|
-
disabled: requestedAction === 'VERIFY_LIVENESS',
|
|
23254
|
+
disabled: requestedAction === 'VERIFY_LIVENESS' || isSignaturePadEmpty,
|
|
23219
23255
|
onClick: onAcceptClicked,
|
|
23220
23256
|
finished: true
|
|
23221
23257
|
}, verbiage.acceptSignatureBtnText))))));
|
|
@@ -23239,30 +23275,32 @@
|
|
|
23239
23275
|
var onVideoCaptured = _a.onVideoCaptured,
|
|
23240
23276
|
onFaceNotDetected = _a.onFaceNotDetected,
|
|
23241
23277
|
onExit = _a.onExit,
|
|
23278
|
+
_c = _a.restartVideoOnSignaturePadCleared,
|
|
23279
|
+
restartVideoOnSignaturePadCleared = _c === void 0 ? true : _c,
|
|
23242
23280
|
guidesComponent = _a.guidesComponent,
|
|
23243
|
-
|
|
23244
|
-
classNames =
|
|
23245
|
-
|
|
23246
|
-
colors =
|
|
23247
|
-
|
|
23248
|
-
rawVerbiage =
|
|
23249
|
-
|
|
23250
|
-
debugMode =
|
|
23281
|
+
_d = _a.classNames,
|
|
23282
|
+
classNames = _d === void 0 ? {} : _d,
|
|
23283
|
+
_e = _a.colors,
|
|
23284
|
+
colors = _e === void 0 ? {} : _e,
|
|
23285
|
+
_f = _a.verbiage,
|
|
23286
|
+
rawVerbiage = _f === void 0 ? {} : _f,
|
|
23287
|
+
_g = _a.debugMode,
|
|
23288
|
+
debugMode = _g === void 0 ? false : _g;
|
|
23251
23289
|
var camera = useCameraStore(function (state) {
|
|
23252
23290
|
return state.camera;
|
|
23253
23291
|
});
|
|
23254
23292
|
var onPredictionMade = React.useContext(SelfieGuidanceModelsContext).onPredictionMade;
|
|
23255
|
-
var
|
|
23256
|
-
signatureData =
|
|
23257
|
-
signatureDataUrl =
|
|
23258
|
-
signatureVideoData =
|
|
23259
|
-
startRecording =
|
|
23260
|
-
stopRecording =
|
|
23293
|
+
var _h = useVideoSignatureContext(),
|
|
23294
|
+
signatureData = _h.signatureData,
|
|
23295
|
+
signatureDataUrl = _h.signatureDataUrl,
|
|
23296
|
+
signatureVideoData = _h.signatureVideoData,
|
|
23297
|
+
startRecording = _h.startRecording,
|
|
23298
|
+
stopRecording = _h.stopRecording,
|
|
23299
|
+
clearRecordedData = _h.clearRecordedData,
|
|
23300
|
+
isRecording = _h.isRecording;
|
|
23261
23301
|
React.useEffect(function () {
|
|
23262
23302
|
startRecording();
|
|
23263
|
-
return
|
|
23264
|
-
stopRecording();
|
|
23265
|
-
};
|
|
23303
|
+
return stopRecording;
|
|
23266
23304
|
}, [startRecording, stopRecording]);
|
|
23267
23305
|
colors.guidanceMessageBackgroundColor || (colors.guidanceMessageBackgroundColor = '#ccc');
|
|
23268
23306
|
colors.guidanceMessageTextColor || (colors.guidanceMessageTextColor = 'black');
|
|
@@ -23274,9 +23312,9 @@
|
|
|
23274
23312
|
onVideoCaptured === null || onVideoCaptured === void 0 ? void 0 : onVideoCaptured(signatureVideoData, signatureData, signatureDataUrl);
|
|
23275
23313
|
}
|
|
23276
23314
|
}, [onVideoCaptured, signatureData, signatureDataUrl, signatureVideoData]);
|
|
23277
|
-
var
|
|
23278
|
-
numFramesWithoutFaces =
|
|
23279
|
-
setNumFramesWithoutFaces =
|
|
23315
|
+
var _j = React.useState(0),
|
|
23316
|
+
numFramesWithoutFaces = _j[0],
|
|
23317
|
+
setNumFramesWithoutFaces = _j[1];
|
|
23280
23318
|
React.useEffect(function () {
|
|
23281
23319
|
onPredictionMade(function (_a) {
|
|
23282
23320
|
var face = _a.face;
|
|
@@ -23301,9 +23339,10 @@
|
|
|
23301
23339
|
"$background": colors.guidanceMessageBackgroundColor,
|
|
23302
23340
|
"$textColor": colors.guidanceMessageTextColor
|
|
23303
23341
|
}, verbiage.guidanceMessageText))), /*#__PURE__*/React.createElement(GuidesComponent, {
|
|
23342
|
+
status: "success",
|
|
23304
23343
|
classNames: classNames.videoSignatureGuidesClassNames,
|
|
23305
|
-
|
|
23306
|
-
}), debugMode && ( /*#__PURE__*/React.createElement(DebugStatsPane, null, "Video: ", camera === null || camera === void 0 ? void 0 : camera.width, "x", camera === null || camera === void 0 ? void 0 : camera.height)), /*#__PURE__*/React.createElement(ExitCaptureButton, {
|
|
23344
|
+
onClearSignaturePadClicked: restartVideoOnSignaturePadCleared ? clearRecordedData : undefined
|
|
23345
|
+
}), debugMode && ( /*#__PURE__*/React.createElement(DebugStatsPane, null, "Video: ", camera === null || camera === void 0 ? void 0 : camera.width, "x", camera === null || camera === void 0 ? void 0 : camera.height, /*#__PURE__*/React.createElement("br", null), "Recording: ", isRecording ? 'true' : 'false')), /*#__PURE__*/React.createElement(ExitCaptureButton, {
|
|
23307
23346
|
onClick: onExit,
|
|
23308
23347
|
className: classNames.exitCaptureBtn
|
|
23309
23348
|
}));
|
|
@@ -23382,37 +23421,30 @@
|
|
|
23382
23421
|
captureAudio = _e === void 0 ? false : _e,
|
|
23383
23422
|
_f = _a.allowSignatureAfterLivenessCheckFailure,
|
|
23384
23423
|
allowSignatureAfterLivenessCheckFailure = _f === void 0 ? false : _f,
|
|
23424
|
+
_g = _a.restartVideoOnSignaturePadCleared,
|
|
23425
|
+
restartVideoOnSignaturePadCleared = _g === void 0 ? true : _g,
|
|
23385
23426
|
faceLivenessProps = _a.faceLivenessProps,
|
|
23386
|
-
|
|
23387
|
-
assets =
|
|
23388
|
-
|
|
23389
|
-
classNames =
|
|
23390
|
-
|
|
23391
|
-
colors =
|
|
23392
|
-
|
|
23393
|
-
verbiage =
|
|
23394
|
-
|
|
23395
|
-
debugMode =
|
|
23396
|
-
var
|
|
23397
|
-
selfieImage =
|
|
23398
|
-
setSelfieImage =
|
|
23399
|
-
setSignatureData =
|
|
23400
|
-
setSignatureVideoUrl =
|
|
23401
|
-
logSelfieCaptureAttempt =
|
|
23402
|
-
var
|
|
23403
|
-
|
|
23404
|
-
|
|
23405
|
-
|
|
23406
|
-
|
|
23407
|
-
requestMicrophoneAccess: state.requestMicrophoneAccess,
|
|
23408
|
-
releaseMicrophoneAccess: state.releaseMicrophoneAccess
|
|
23409
|
-
};
|
|
23410
|
-
})),
|
|
23411
|
-
cameraAccessDenied = _o.cameraAccessDenied,
|
|
23412
|
-
requestCameraAccess = _o.requestCameraAccess,
|
|
23413
|
-
releaseCameraAccess = _o.releaseCameraAccess,
|
|
23414
|
-
requestMicrophoneAccess = _o.requestMicrophoneAccess,
|
|
23415
|
-
releaseMicrophoneAccess = _o.releaseMicrophoneAccess;
|
|
23427
|
+
_h = _a.assets,
|
|
23428
|
+
assets = _h === void 0 ? {} : _h,
|
|
23429
|
+
_j = _a.classNames,
|
|
23430
|
+
classNames = _j === void 0 ? {} : _j,
|
|
23431
|
+
_k = _a.colors,
|
|
23432
|
+
colors = _k === void 0 ? {} : _k,
|
|
23433
|
+
_l = _a.verbiage,
|
|
23434
|
+
verbiage = _l === void 0 ? {} : _l,
|
|
23435
|
+
_m = _a.debugMode,
|
|
23436
|
+
debugMode = _m === void 0 ? false : _m;
|
|
23437
|
+
var _o = React.useContext(SubmissionContext),
|
|
23438
|
+
selfieImage = _o.selfieImage,
|
|
23439
|
+
setSelfieImage = _o.setSelfieImage,
|
|
23440
|
+
setSignatureData = _o.setSignatureData,
|
|
23441
|
+
setSignatureVideoUrl = _o.setSignatureVideoUrl,
|
|
23442
|
+
logSelfieCaptureAttempt = _o.logSelfieCaptureAttempt;
|
|
23443
|
+
var cameraAccessDenied = useCameraStore(useShallow(function (state) {
|
|
23444
|
+
return {
|
|
23445
|
+
cameraAccessDenied: state.cameraAccessDenied
|
|
23446
|
+
};
|
|
23447
|
+
})).cameraAccessDenied;
|
|
23416
23448
|
var _p = React.useState('CHECKING_LIVENESS'),
|
|
23417
23449
|
captureState = _p[0],
|
|
23418
23450
|
setCaptureState = _p[1];
|
|
@@ -23473,21 +23505,13 @@
|
|
|
23473
23505
|
var _s = React.useState(0),
|
|
23474
23506
|
attempt = _s[0],
|
|
23475
23507
|
setAttempt = _s[1];
|
|
23476
|
-
var
|
|
23477
|
-
|
|
23478
|
-
releaseMicrophoneAccess();
|
|
23508
|
+
var onRetry = React.useCallback(function () {
|
|
23509
|
+
onRetryClicked === null || onRetryClicked === void 0 ? void 0 : onRetryClicked();
|
|
23479
23510
|
setAttempt(function (n) {
|
|
23480
23511
|
return n + 1;
|
|
23481
23512
|
});
|
|
23482
23513
|
setCaptureState('CHECKING_LIVENESS');
|
|
23483
|
-
|
|
23484
|
-
void requestCameraAccess();
|
|
23485
|
-
if (captureAudio) void requestMicrophoneAccess();
|
|
23486
|
-
}, [captureAudio, onExitCapture, releaseCameraAccess, releaseMicrophoneAccess, requestCameraAccess, requestMicrophoneAccess]);
|
|
23487
|
-
var onRetry = React.useCallback(function () {
|
|
23488
|
-
onRetryClicked === null || onRetryClicked === void 0 ? void 0 : onRetryClicked();
|
|
23489
|
-
onExit();
|
|
23490
|
-
}, [onExit, onRetryClicked]);
|
|
23514
|
+
}, [onRetryClicked]);
|
|
23491
23515
|
var showSuccessScreen = useShowSuccessScreen(skipSuccessScreen, captureState === 'SUCCESS', onComplete);
|
|
23492
23516
|
React.useEffect(function () {
|
|
23493
23517
|
if (cameraAccessDenied) {
|
|
@@ -23497,14 +23521,12 @@
|
|
|
23497
23521
|
setCaptureState('CHECKING_LIVENESS');
|
|
23498
23522
|
}
|
|
23499
23523
|
}, [cameraAccessDenied]);
|
|
23500
|
-
var guidesComponent = React.useCallback(function (
|
|
23501
|
-
|
|
23502
|
-
return /*#__PURE__*/React.createElement(VideoSignatureGuides, {
|
|
23524
|
+
var guidesComponent = React.useCallback(function (props) {
|
|
23525
|
+
return /*#__PURE__*/React.createElement(VideoSignatureWizardGuides, _assign({}, props, {
|
|
23503
23526
|
classNames: classNames === null || classNames === void 0 ? void 0 : classNames.videoSignatureGuidesClassNames,
|
|
23504
|
-
|
|
23505
|
-
|
|
23506
|
-
|
|
23507
|
-
}, [classNames === null || classNames === void 0 ? void 0 : classNames.videoSignatureGuidesClassNames]);
|
|
23527
|
+
restartVideoOnSignaturePadCleared: restartVideoOnSignaturePadCleared
|
|
23528
|
+
}));
|
|
23529
|
+
}, [classNames === null || classNames === void 0 ? void 0 : classNames.videoSignatureGuidesClassNames, restartVideoOnSignaturePadCleared]);
|
|
23508
23530
|
var onExitAfterFailureProp = faceLivenessProps === null || faceLivenessProps === void 0 ? void 0 : faceLivenessProps.onExitAfterFailure;
|
|
23509
23531
|
var onExitAfterFailure = React.useCallback(function (resp, req) {
|
|
23510
23532
|
onExitAfterFailureProp === null || onExitAfterFailureProp === void 0 ? void 0 : onExitAfterFailureProp(resp, req);
|
|
@@ -23530,7 +23552,7 @@
|
|
|
23530
23552
|
key: "face-liveness-".concat(attempt)
|
|
23531
23553
|
}, faceLivenessProps, {
|
|
23532
23554
|
onSuccess: onFaceCaptureSuccess,
|
|
23533
|
-
onExitCapture:
|
|
23555
|
+
onExitCapture: onExitCapture,
|
|
23534
23556
|
onUserCancel: onUserCancel,
|
|
23535
23557
|
onExitAfterFailure: onExitAfterFailure,
|
|
23536
23558
|
onLoadingOverlayDismissed: onLoadingOverlayDismissedCallback,
|
|
@@ -23542,14 +23564,14 @@
|
|
|
23542
23564
|
colors: colors.faceLiveness,
|
|
23543
23565
|
verbiage: verbiage.faceLiveness,
|
|
23544
23566
|
debugMode: debugMode,
|
|
23545
|
-
releaseCameraAccessOnExit: false,
|
|
23546
23567
|
renderCameraFeed: false
|
|
23547
23568
|
}));
|
|
23548
23569
|
case 'CAPTURING_SIGNATURE':
|
|
23549
23570
|
return /*#__PURE__*/React.createElement(VideoSignatureCapture, {
|
|
23550
23571
|
onVideoCaptured: onSignatureCaptureCompleted,
|
|
23551
23572
|
onFaceNotDetected: onSignatureCaptureFacesNotDetected,
|
|
23552
|
-
onExit:
|
|
23573
|
+
onExit: onExitCapture,
|
|
23574
|
+
restartVideoOnSignaturePadCleared: restartVideoOnSignaturePadCleared,
|
|
23553
23575
|
guidesComponent: guidesComponent,
|
|
23554
23576
|
classNames: classNames,
|
|
23555
23577
|
colors: colors,
|
|
@@ -23571,6 +23593,49 @@
|
|
|
23571
23593
|
}
|
|
23572
23594
|
}()));
|
|
23573
23595
|
};
|
|
23596
|
+
function VideoSignatureWizardGuides(_a) {
|
|
23597
|
+
var status = _a.status,
|
|
23598
|
+
classNames = _a.classNames,
|
|
23599
|
+
_b = _a.restartVideoOnSignaturePadCleared,
|
|
23600
|
+
restartVideoOnSignaturePadCleared = _b === void 0 ? true : _b;
|
|
23601
|
+
var clearRecordedData = useVideoSignatureContext().clearRecordedData;
|
|
23602
|
+
return /*#__PURE__*/React.createElement(VideoSignatureGuides, {
|
|
23603
|
+
classNames: classNames,
|
|
23604
|
+
faceGuideStatus: status,
|
|
23605
|
+
requestedAction: status === 'success' ? 'CAPTURE_SIGNATURE' : 'VERIFY_LIVENESS',
|
|
23606
|
+
onClearSignaturePadClicked: restartVideoOnSignaturePadCleared ? clearRecordedData : undefined
|
|
23607
|
+
});
|
|
23608
|
+
}
|
|
23609
|
+
var VideoSignatureWizardWithProviders = function VideoSignatureWizardWithProviders(props) {
|
|
23610
|
+
var _a = React.useState(0),
|
|
23611
|
+
attempts = _a[0],
|
|
23612
|
+
setAttempts = _a[1];
|
|
23613
|
+
var onRetryClickedProp = props.onRetryClicked;
|
|
23614
|
+
var onRetryClicked = React.useCallback(function () {
|
|
23615
|
+
setAttempts(function (n) {
|
|
23616
|
+
return n + 1;
|
|
23617
|
+
});
|
|
23618
|
+
onRetryClickedProp === null || onRetryClickedProp === void 0 ? void 0 : onRetryClickedProp();
|
|
23619
|
+
}, [onRetryClickedProp]);
|
|
23620
|
+
return /*#__PURE__*/React.createElement(CameraStoreProvider, {
|
|
23621
|
+
key: "camera-store-".concat(attempts),
|
|
23622
|
+
preferIphoneContinuityCamera: false,
|
|
23623
|
+
preferFrontFacingCamera: true,
|
|
23624
|
+
requireMicrophoneAccess: props.captureAudio,
|
|
23625
|
+
maxVideoWidth: 1280,
|
|
23626
|
+
maxFps: 30,
|
|
23627
|
+
onCameraAccessDenied: props.onCameraAccessDenied,
|
|
23628
|
+
onMicrophoneAccessDenied: props.onMicrophoneAccessDenied
|
|
23629
|
+
}, /*#__PURE__*/React.createElement(SelfieGuidanceModelsProvider, {
|
|
23630
|
+
autoStart: false,
|
|
23631
|
+
throttleMs: 250,
|
|
23632
|
+
onModelError: props.onModelError,
|
|
23633
|
+
modelLoadTimeoutMs: props.modelLoadTimeoutMs,
|
|
23634
|
+
requireVerticalFaceCentering: false
|
|
23635
|
+
}, /*#__PURE__*/React.createElement(VideoSignatureWizard, _assign({}, props, {
|
|
23636
|
+
onRetryClicked: onRetryClicked
|
|
23637
|
+
}))));
|
|
23638
|
+
};
|
|
23574
23639
|
|
|
23575
23640
|
var IdVideoCaptureGuides = function IdVideoCaptureGuides(_a) {
|
|
23576
23641
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
@@ -24844,23 +24909,11 @@
|
|
|
24844
24909
|
onAccept: onSignatureCaptureSuccess
|
|
24845
24910
|
}));
|
|
24846
24911
|
case 'VideoSignatureCapture':
|
|
24847
|
-
return /*#__PURE__*/React.createElement(
|
|
24848
|
-
|
|
24849
|
-
preferFrontFacingCamera: true,
|
|
24850
|
-
requireMicrophoneAccess: videoSignatureCaptureProps.captureAudio,
|
|
24851
|
-
maxVideoWidth: 1280,
|
|
24852
|
-
maxFps: 30,
|
|
24912
|
+
return /*#__PURE__*/React.createElement(VideoSignatureWizardWithProviders, _assign({}, videoSignatureCaptureProps, {
|
|
24913
|
+
onComplete: onVideoSignatureComplete,
|
|
24853
24914
|
onCameraAccessDenied: onCameraAccessDenied,
|
|
24854
24915
|
onMicrophoneAccessDenied: onMicrophoneAccessDenied
|
|
24855
|
-
}
|
|
24856
|
-
autoStart: false,
|
|
24857
|
-
throttleMs: 250,
|
|
24858
|
-
onModelError: videoSignatureCaptureProps.onModelError,
|
|
24859
|
-
modelLoadTimeoutMs: videoSignatureCaptureProps.modelLoadTimeoutMs,
|
|
24860
|
-
requireVerticalFaceCentering: false
|
|
24861
|
-
}, /*#__PURE__*/React.createElement(VideoSignatureWizard, _assign({}, videoSignatureCaptureProps, {
|
|
24862
|
-
onComplete: onVideoSignatureComplete
|
|
24863
|
-
}))));
|
|
24916
|
+
}));
|
|
24864
24917
|
case 'AdditionalDocumentCapture':
|
|
24865
24918
|
return /*#__PURE__*/React.createElement(AdditionalDocumentCaptureWizard, _assign({}, additionalDocumentCaptureProps, {
|
|
24866
24919
|
documents: documents,
|
|
@@ -27177,16 +27230,18 @@
|
|
|
27177
27230
|
modelLoadTimeoutMs = _f === void 0 ? defaultSelfieCaptureModelLoadTimeoutMs : _f,
|
|
27178
27231
|
_g = _a.allowSignatureAfterLivenessCheckFailure,
|
|
27179
27232
|
allowSignatureAfterLivenessCheckFailure = _g === void 0 ? false : _g,
|
|
27233
|
+
_h = _a.restartVideoOnSignaturePadCleared,
|
|
27234
|
+
restartVideoOnSignaturePadCleared = _h === void 0 ? true : _h,
|
|
27180
27235
|
faceLivenessProps = _a.faceLivenessProps,
|
|
27181
|
-
|
|
27182
|
-
theme =
|
|
27236
|
+
_j = _a.theme,
|
|
27237
|
+
theme = _j === void 0 ? 'default' : _j,
|
|
27183
27238
|
classNames = _a.classNames,
|
|
27184
27239
|
colors = _a.colors,
|
|
27185
27240
|
verbiage = _a.verbiage,
|
|
27186
27241
|
geolocationEnabled = _a.geolocationEnabled,
|
|
27187
27242
|
geolocationRequired = _a.geolocationRequired,
|
|
27188
|
-
|
|
27189
|
-
debugMode =
|
|
27243
|
+
_k = _a.debugMode,
|
|
27244
|
+
debugMode = _k === void 0 ? false : _k;
|
|
27190
27245
|
useLanguage(lang);
|
|
27191
27246
|
useDebugLogging(debugMode);
|
|
27192
27247
|
return /*#__PURE__*/React.createElement(AuthProvider, {
|
|
@@ -27230,6 +27285,7 @@
|
|
|
27230
27285
|
modelLoadTimeoutMs: modelLoadTimeoutMs,
|
|
27231
27286
|
faceLivenessProps: faceLivenessProps,
|
|
27232
27287
|
allowSignatureAfterLivenessCheckFailure: allowSignatureAfterLivenessCheckFailure,
|
|
27288
|
+
restartVideoOnSignaturePadCleared: restartVideoOnSignaturePadCleared,
|
|
27233
27289
|
classNames: classNames,
|
|
27234
27290
|
colors: colors,
|
|
27235
27291
|
debugMode: debugMode,
|
|
@@ -27237,7 +27293,7 @@
|
|
|
27237
27293
|
onModelError: onModelError,
|
|
27238
27294
|
onUserCancel: onUserCancel
|
|
27239
27295
|
};
|
|
27240
|
-
}, [customOverlayContent, onLoadingOverlayDismissed, loadingOverlayMode, skipSuccessScreen, captureAudio, modelLoadTimeoutMs, faceLivenessProps, allowSignatureAfterLivenessCheckFailure, classNames, colors, debugMode, verbiage, onModelError, onUserCancel])
|
|
27296
|
+
}, [customOverlayContent, onLoadingOverlayDismissed, loadingOverlayMode, skipSuccessScreen, captureAudio, modelLoadTimeoutMs, faceLivenessProps, allowSignatureAfterLivenessCheckFailure, restartVideoOnSignaturePadCleared, classNames, colors, debugMode, verbiage, onModelError, onUserCancel])
|
|
27241
27297
|
}))));
|
|
27242
27298
|
};
|
|
27243
27299
|
|