idmission-web-sdk 2.3.81 → 2.3.83
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/submission/SubmissionProvider.d.ts +2 -0
- package/dist/components/submission/SubmissionProvider.d.ts.map +1 -1
- package/dist/components/submission/types.d.ts +2 -0
- package/dist/components/submission/types.d.ts.map +1 -1
- package/dist/components/video_signature_capture/VideoSignatureCapture.d.ts.map +1 -1
- package/dist/components/video_signature_capture/VideoSignatureContext.d.ts +7 -2
- package/dist/components/video_signature_capture/VideoSignatureContext.d.ts.map +1 -1
- package/dist/components/video_signature_capture/VideoSignatureGuides.d.ts.map +1 -1
- package/dist/components/video_signature_capture/VideoSignaturePad.d.ts.map +1 -1
- package/dist/components/video_signature_capture/VideoSignatureWizard.d.ts +1 -1
- package/dist/components/video_signature_capture/VideoSignatureWizard.d.ts.map +1 -1
- package/dist/lib/camera/useVideoRecorder.d.ts.map +1 -1
- package/dist/lib/utils/blobs.d.ts +3 -0
- package/dist/lib/utils/blobs.d.ts.map +1 -0
- package/dist/sdk2.cjs.development.js +182 -62
- 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 +182 -62
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +182 -62
- 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.83';
|
|
209
209
|
|
|
210
210
|
function getPlatform() {
|
|
211
211
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -1145,6 +1145,12 @@ var SubmissionContext = /*#__PURE__*/createContext({
|
|
|
1145
1145
|
setIdCaptureVideoUrl: function setIdCaptureVideoUrl() {
|
|
1146
1146
|
return null;
|
|
1147
1147
|
},
|
|
1148
|
+
setSignatureStartTimestamp: function setSignatureStartTimestamp() {
|
|
1149
|
+
return null;
|
|
1150
|
+
},
|
|
1151
|
+
setSignatureEndTimestamp: function setSignatureEndTimestamp() {
|
|
1152
|
+
return null;
|
|
1153
|
+
},
|
|
1148
1154
|
setIdCaptureVideoIdFrontImage: function setIdCaptureVideoIdFrontImage() {
|
|
1149
1155
|
return null;
|
|
1150
1156
|
},
|
|
@@ -1309,44 +1315,50 @@ var SubmissionProvider = function SubmissionProvider(_a) {
|
|
|
1309
1315
|
signatureVideoUrl = _16[0],
|
|
1310
1316
|
setSignatureVideoUrl = _16[1];
|
|
1311
1317
|
var _17 = useState(null),
|
|
1312
|
-
|
|
1313
|
-
|
|
1318
|
+
signatureStartTimestamp = _17[0],
|
|
1319
|
+
setSignatureStartTimestamp = _17[1];
|
|
1314
1320
|
var _18 = useState(null),
|
|
1315
|
-
|
|
1316
|
-
|
|
1321
|
+
signatureEndTimestamp = _18[0],
|
|
1322
|
+
setSignatureEndTimestamp = _18[1];
|
|
1317
1323
|
var _19 = useState(null),
|
|
1318
|
-
|
|
1319
|
-
|
|
1324
|
+
idCaptureVideoUrl = _19[0],
|
|
1325
|
+
setIdCaptureVideoUrl = _19[1];
|
|
1320
1326
|
var _20 = useState(null),
|
|
1321
|
-
|
|
1322
|
-
|
|
1327
|
+
idCaptureVideoIdFrontImage = _20[0],
|
|
1328
|
+
setIdCaptureVideoIdFrontImage = _20[1];
|
|
1323
1329
|
var _21 = useState(null),
|
|
1324
|
-
|
|
1325
|
-
|
|
1330
|
+
idCaptureVideoIdBackImage = _21[0],
|
|
1331
|
+
setIdCaptureVideoIdBackImage = _21[1];
|
|
1326
1332
|
var _22 = useState(null),
|
|
1327
|
-
|
|
1328
|
-
|
|
1333
|
+
idCaptureVideoAudioUrl = _22[0],
|
|
1334
|
+
setIdCaptureVideoAudioUrl = _22[1];
|
|
1329
1335
|
var _23 = useState(null),
|
|
1330
|
-
|
|
1331
|
-
|
|
1336
|
+
idCaptureVideoAudioStartsAt = _23[0],
|
|
1337
|
+
setIdCaptureVideoAudioStartsAt = _23[1];
|
|
1332
1338
|
var _24 = useState(null),
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
var _25 = useState(
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
var _26 = useState(
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
var _27 = useState(
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
var _28 = useState(
|
|
1345
|
-
|
|
1346
|
-
|
|
1339
|
+
expectedAudioText = _24[0],
|
|
1340
|
+
setExpectedAudioText = _24[1];
|
|
1341
|
+
var _25 = useState(null),
|
|
1342
|
+
additionalDocuments = _25[0],
|
|
1343
|
+
setAdditionalDocuments = _25[1];
|
|
1344
|
+
var _26 = useState(null),
|
|
1345
|
+
geolocationResult = _26[0],
|
|
1346
|
+
setGeolocationResult = _26[1];
|
|
1347
|
+
var _27 = useState(0),
|
|
1348
|
+
geolocationAttempts = _27[0],
|
|
1349
|
+
setGeolocationAttempts = _27[1];
|
|
1350
|
+
var _28 = useState(false),
|
|
1351
|
+
geolocationBlocked = _28[0],
|
|
1352
|
+
setGeolocationBlocked = _28[1];
|
|
1347
1353
|
var _29 = useState([]),
|
|
1348
|
-
|
|
1349
|
-
|
|
1354
|
+
idFrontCaptureAttempts = _29[0],
|
|
1355
|
+
setIdFrontCaptureAttempts = _29[1];
|
|
1356
|
+
var _30 = useState([]),
|
|
1357
|
+
idBackCaptureAttempts = _30[0],
|
|
1358
|
+
setIdBackCaptureAttempts = _30[1];
|
|
1359
|
+
var _31 = useState([]),
|
|
1360
|
+
selfieCaptureAttempts = _31[0],
|
|
1361
|
+
setSelfieCaptureAttempts = _31[1];
|
|
1350
1362
|
var logIdFrontCaptureAttempt = useCallback(function (attempt) {
|
|
1351
1363
|
setIdFrontCaptureAttempts(function (attempts) {
|
|
1352
1364
|
return __spreadArray(__spreadArray([], attempts, true), [attempt], false);
|
|
@@ -1623,6 +1635,12 @@ var SubmissionProvider = function SubmissionProvider(_a) {
|
|
|
1623
1635
|
submissionRequest.customerData.signatureData.signatureVideo = documents.signatureVideo;
|
|
1624
1636
|
}
|
|
1625
1637
|
}
|
|
1638
|
+
if (signatureStartTimestamp) {
|
|
1639
|
+
submissionRequest.customerData.signatureStartTimestamp = signatureStartTimestamp;
|
|
1640
|
+
}
|
|
1641
|
+
if (signatureEndTimestamp) {
|
|
1642
|
+
submissionRequest.customerData.signatureEndTimestamp = signatureEndTimestamp;
|
|
1643
|
+
}
|
|
1626
1644
|
if (additionalDocuments) {
|
|
1627
1645
|
submissionRequest.customerData.additionalDocuments = additionalDocuments.map(function (d) {
|
|
1628
1646
|
return _assign(_assign({}, d), {
|
|
@@ -1665,7 +1683,7 @@ var SubmissionProvider = function SubmissionProvider(_a) {
|
|
|
1665
1683
|
}
|
|
1666
1684
|
});
|
|
1667
1685
|
});
|
|
1668
|
-
}, [additionalDocuments, bypassAgeValidation, bypassNameMatching, cardData, clientRequestID, companyId, customerDataMatchConfig, deduplicationEnabled, deduplicationSynchronous, documentServiceUrl, enrollmentId, expectedAudioText, geolocationResult, idBackCaptureAttempts, idBackImage, idBackImageRequired, idBackIrImage, idBackUvImage, idCaptureVideoAudioStartsAt, idCaptureVideoAudioUrl, idCaptureVideoIdBackImage, idCaptureVideoIdFrontImage, idCaptureVideoUrl, idCardForFaceMatch, idData, idFrontCaptureAttempts, idFrontImage, idFrontIrImage, idFrontUvImage, idImageResolutionCheck, jobId, manualReviewRequired, needImmediateResponse, passportImage, personalData, selfieCaptureAttempts, selfieImage, signatureData, signatureVideoUrl, uploadDocument, verifyIdWithExternalDatabases, webhooksClientTraceId, webhooksEnabled, webhooksFireOnReview, webhooksFireOnReviewURL, webhooksSendInputImages, webhooksSendProcessedImages, webhooksStripSpecialCharacters, webhooksURL]);
|
|
1686
|
+
}, [additionalDocuments, bypassAgeValidation, bypassNameMatching, cardData, clientRequestID, companyId, customerDataMatchConfig, deduplicationEnabled, deduplicationSynchronous, documentServiceUrl, enrollmentId, expectedAudioText, geolocationResult, idBackCaptureAttempts, idBackImage, idBackImageRequired, idBackIrImage, idBackUvImage, idCaptureVideoAudioStartsAt, idCaptureVideoAudioUrl, idCaptureVideoIdBackImage, idCaptureVideoIdFrontImage, idCaptureVideoUrl, idCardForFaceMatch, idData, idFrontCaptureAttempts, idFrontImage, idFrontIrImage, idFrontUvImage, idImageResolutionCheck, jobId, manualReviewRequired, needImmediateResponse, passportImage, personalData, selfieCaptureAttempts, selfieImage, signatureData, signatureEndTimestamp, signatureStartTimestamp, signatureVideoUrl, uploadDocument, verifyIdWithExternalDatabases, webhooksClientTraceId, webhooksEnabled, webhooksFireOnReview, webhooksFireOnReviewURL, webhooksSendInputImages, webhooksSendProcessedImages, webhooksStripSpecialCharacters, webhooksURL]);
|
|
1669
1687
|
var defaultOnSubmit = useCallback(function () {
|
|
1670
1688
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
1671
1689
|
var submissionResponse_1, payload, host, endpoint, response, statusMessage, submissionResponse_2, e_1, err;
|
|
@@ -1962,6 +1980,8 @@ var SubmissionProvider = function SubmissionProvider(_a) {
|
|
|
1962
1980
|
setSelfieImage: setSelfieImage,
|
|
1963
1981
|
setSignatureData: setSignatureData,
|
|
1964
1982
|
setSignatureVideoUrl: setSignatureVideoUrl,
|
|
1983
|
+
setSignatureStartTimestamp: setSignatureStartTimestamp,
|
|
1984
|
+
setSignatureEndTimestamp: setSignatureEndTimestamp,
|
|
1965
1985
|
setIdCaptureVideoUrl: setIdCaptureVideoUrl,
|
|
1966
1986
|
setIdCaptureVideoIdFrontImage: setIdCaptureVideoIdFrontImage,
|
|
1967
1987
|
setIdCaptureVideoIdBackImage: setIdCaptureVideoIdBackImage,
|
|
@@ -13641,6 +13661,13 @@ var Container$4 = styled.div(templateObject_1$c || (templateObject_1$c = __makeT
|
|
|
13641
13661
|
var AcceptBtn$1 = styled(LoaderButton)(templateObject_2$b || (templateObject_2$b = __makeTemplateObject(["\n margin-left: auto;\n"], ["\n margin-left: auto;\n"])));
|
|
13642
13662
|
var templateObject_1$c, templateObject_2$b;
|
|
13643
13663
|
|
|
13664
|
+
function isBlob(blobPart) {
|
|
13665
|
+
return typeof blobPart === 'object' && 'type' in blobPart;
|
|
13666
|
+
}
|
|
13667
|
+
function inferBlobType(blobPart) {
|
|
13668
|
+
return isBlob(blobPart) ? blobPart.type : undefined;
|
|
13669
|
+
}
|
|
13670
|
+
|
|
13644
13671
|
var videoRecorder = null;
|
|
13645
13672
|
var audioRecorder = null;
|
|
13646
13673
|
var videoChunks = [];
|
|
@@ -13774,8 +13801,10 @@ var useVideoRecorder = function useVideoRecorder(mergeAVStreams) {
|
|
|
13774
13801
|
useVideoRecorderStore.getState().clearRecordedData();
|
|
13775
13802
|
}, []);
|
|
13776
13803
|
var processVideo = useCallback(function () {
|
|
13804
|
+
var _a;
|
|
13805
|
+
var inferredType = (_a = inferBlobType(videoChunks[0])) !== null && _a !== void 0 ? _a : 'video/mp4';
|
|
13777
13806
|
var videoBlob = new Blob(videoChunks, {
|
|
13778
|
-
type:
|
|
13807
|
+
type: inferredType
|
|
13779
13808
|
});
|
|
13780
13809
|
useVideoRecorderStore.setState({
|
|
13781
13810
|
videoUrl: URL.createObjectURL(videoBlob),
|
|
@@ -13838,7 +13867,6 @@ var videoSignatureInitialState = {
|
|
|
13838
13867
|
clearRecordedData: function clearRecordedData() {
|
|
13839
13868
|
return null;
|
|
13840
13869
|
},
|
|
13841
|
-
isRecording: false,
|
|
13842
13870
|
signaturePad: {
|
|
13843
13871
|
current: null
|
|
13844
13872
|
},
|
|
@@ -13861,7 +13889,7 @@ var useVideoSignatureStore = create()(devtools(function (set, get) {
|
|
|
13861
13889
|
if (!camera) throw new Error('Camera not found');
|
|
13862
13890
|
// set our flag and clear whatever we have recorded so far.
|
|
13863
13891
|
set({
|
|
13864
|
-
|
|
13892
|
+
recordingStartedAt: performance.now()
|
|
13865
13893
|
});
|
|
13866
13894
|
signatureChunks = [];
|
|
13867
13895
|
// start recording video and audio
|
|
@@ -13875,27 +13903,53 @@ var useVideoSignatureStore = create()(devtools(function (set, get) {
|
|
|
13875
13903
|
videoBitsPerSecond: 270000,
|
|
13876
13904
|
audioBitsPerSecond: 32000
|
|
13877
13905
|
});
|
|
13906
|
+
var hasFirstChunk = false;
|
|
13878
13907
|
signatureRecorder.ondataavailable = function (event) {
|
|
13879
13908
|
signatureChunks.push(event.data);
|
|
13909
|
+
if (!hasFirstChunk) {
|
|
13910
|
+
hasFirstChunk = true;
|
|
13911
|
+
set({
|
|
13912
|
+
firstChunkReceivedAt: performance.now(),
|
|
13913
|
+
lastChunkReceivedAt: performance.now()
|
|
13914
|
+
});
|
|
13915
|
+
} else {
|
|
13916
|
+
set({
|
|
13917
|
+
lastChunkReceivedAt: performance.now()
|
|
13918
|
+
});
|
|
13919
|
+
}
|
|
13880
13920
|
};
|
|
13881
13921
|
signatureRecorder.start(100);
|
|
13882
13922
|
},
|
|
13883
13923
|
stopRecording: function stopRecording(signatureData, imageUrl) {
|
|
13884
13924
|
set({
|
|
13885
|
-
|
|
13925
|
+
firstChunkReceivedAt: undefined,
|
|
13926
|
+
recordingStoppedAt: performance.now()
|
|
13927
|
+
});
|
|
13928
|
+
waitForOneMoreChunk().then(function () {
|
|
13929
|
+
if (!signatureRecorder) return;
|
|
13930
|
+
signatureRecorder.stop();
|
|
13931
|
+
signatureRecorder.onstop = function () {
|
|
13932
|
+
var _a;
|
|
13933
|
+
var inferredType = (_a = inferBlobType(signatureChunks[0])) !== null && _a !== void 0 ? _a : 'video/mp4';
|
|
13934
|
+
var blob = new Blob(signatureChunks, {
|
|
13935
|
+
type: inferredType
|
|
13936
|
+
});
|
|
13937
|
+
signatureChunks = [];
|
|
13938
|
+
signatureRecorder = null;
|
|
13939
|
+
if (!signatureData) return;
|
|
13940
|
+
var _b = get(),
|
|
13941
|
+
onSignatureVideoCaptured = _b.onSignatureVideoCaptured,
|
|
13942
|
+
recordingStartedAt = _b.recordingStartedAt,
|
|
13943
|
+
signatureStartedAt = _b.signatureStartedAt,
|
|
13944
|
+
signatureEndedAt = _b.signatureEndedAt,
|
|
13945
|
+
lastChunkReceivedAt = _b.lastChunkReceivedAt;
|
|
13946
|
+
var endMs = Math.min(signatureEndedAt !== null && signatureEndedAt !== void 0 ? signatureEndedAt : Infinity, lastChunkReceivedAt !== null && lastChunkReceivedAt !== void 0 ? lastChunkReceivedAt : Infinity);
|
|
13947
|
+
var signatureStartTimestamp = signatureStartedAt && recordingStartedAt ? formatTimestamp(Math.max(0, signatureStartedAt - recordingStartedAt - 500)) : undefined;
|
|
13948
|
+
var signatureEndTimestamp = endMs !== Infinity && recordingStartedAt ? formatTimestamp(Math.min(endMs - recordingStartedAt + 500, lastChunkReceivedAt !== null && lastChunkReceivedAt !== void 0 ? lastChunkReceivedAt : Infinity)) : undefined;
|
|
13949
|
+
onSignatureVideoCaptured(blob, signatureData, imageUrl !== null && imageUrl !== void 0 ? imageUrl : null, signatureStartTimestamp, signatureEndTimestamp);
|
|
13950
|
+
};
|
|
13951
|
+
useVideoRecorderStore.getState().stopRecording();
|
|
13886
13952
|
});
|
|
13887
|
-
if (!signatureRecorder) return;
|
|
13888
|
-
signatureRecorder.stop();
|
|
13889
|
-
signatureRecorder.onstop = function () {
|
|
13890
|
-
var blob = new Blob(signatureChunks, {
|
|
13891
|
-
type: 'video/mp4'
|
|
13892
|
-
});
|
|
13893
|
-
signatureChunks = [];
|
|
13894
|
-
signatureRecorder = null;
|
|
13895
|
-
if (!signatureData) return;
|
|
13896
|
-
get().onSignatureVideoCaptured(blob, signatureData, imageUrl !== null && imageUrl !== void 0 ? imageUrl : null);
|
|
13897
|
-
};
|
|
13898
|
-
useVideoRecorderStore.getState().stopRecording();
|
|
13899
13953
|
},
|
|
13900
13954
|
clearRecordedData: function clearRecordedData() {
|
|
13901
13955
|
signatureChunks = [];
|
|
@@ -13904,13 +13958,42 @@ var useVideoSignatureStore = create()(devtools(function (set, get) {
|
|
|
13904
13958
|
signatureRecorder === null || signatureRecorder === void 0 ? void 0 : signatureRecorder.stop();
|
|
13905
13959
|
signatureRecorder = null;
|
|
13906
13960
|
set({
|
|
13907
|
-
|
|
13961
|
+
recordingStartedAt: undefined,
|
|
13962
|
+
recordingStoppedAt: undefined,
|
|
13963
|
+
firstChunkReceivedAt: undefined,
|
|
13964
|
+
lastChunkReceivedAt: undefined,
|
|
13908
13965
|
signaturePadEmpty: true,
|
|
13909
|
-
signatureValid: false
|
|
13966
|
+
signatureValid: false,
|
|
13967
|
+
signatureStartedAt: undefined,
|
|
13968
|
+
signatureEndedAt: undefined
|
|
13910
13969
|
});
|
|
13911
13970
|
}
|
|
13912
13971
|
});
|
|
13913
13972
|
}));
|
|
13973
|
+
function waitForOneMoreChunk(timeoutMs) {
|
|
13974
|
+
if (timeoutMs === void 0) {
|
|
13975
|
+
timeoutMs = 3000;
|
|
13976
|
+
}
|
|
13977
|
+
var start = performance.now();
|
|
13978
|
+
return new Promise(function (resolve) {
|
|
13979
|
+
var initialLastChunkReceivedAt = useVideoSignatureStore.getState().lastChunkReceivedAt;
|
|
13980
|
+
if (!initialLastChunkReceivedAt) return resolve();
|
|
13981
|
+
function gotAChunk() {
|
|
13982
|
+
var lastChunkReceivedAt = useVideoSignatureStore.getState().lastChunkReceivedAt;
|
|
13983
|
+
return performance.now() - start > timeoutMs || !lastChunkReceivedAt || !initialLastChunkReceivedAt || lastChunkReceivedAt > initialLastChunkReceivedAt;
|
|
13984
|
+
}
|
|
13985
|
+
setTimeout(function () {
|
|
13986
|
+
if (gotAChunk()) return resolve(); // check immediately
|
|
13987
|
+
// otherwise, check every 100ms
|
|
13988
|
+
var interval = setInterval(function () {
|
|
13989
|
+
if (gotAChunk()) {
|
|
13990
|
+
clearInterval(interval);
|
|
13991
|
+
resolve();
|
|
13992
|
+
}
|
|
13993
|
+
}, 100);
|
|
13994
|
+
}, 0);
|
|
13995
|
+
});
|
|
13996
|
+
}
|
|
13914
13997
|
function VideoSignatureContextProvider(_a) {
|
|
13915
13998
|
var _this = this;
|
|
13916
13999
|
var _b, _c;
|
|
@@ -13929,7 +14012,14 @@ function VideoSignatureContextProvider(_a) {
|
|
|
13929
14012
|
// clear recorded data when the component is mounted
|
|
13930
14013
|
useVideoSignatureStore.getState().clearRecordedData();
|
|
13931
14014
|
}, []);
|
|
13932
|
-
var
|
|
14015
|
+
var _e = useVideoSignatureStore(useShallow(function (state) {
|
|
14016
|
+
return {
|
|
14017
|
+
recordingStartedAt: state.recordingStartedAt,
|
|
14018
|
+
recordingStoppedAt: state.recordingStoppedAt
|
|
14019
|
+
};
|
|
14020
|
+
})),
|
|
14021
|
+
recordingStartedAt = _e.recordingStartedAt,
|
|
14022
|
+
recordingStoppedAt = _e.recordingStoppedAt;
|
|
13933
14023
|
useFrameLoop(useCallback(function () {
|
|
13934
14024
|
return __awaiter(_this, void 0, void 0, function () {
|
|
13935
14025
|
var signaturePad, ctx, _a, w, h, isPortrait, rect;
|
|
@@ -13956,7 +14046,7 @@ function VideoSignatureContextProvider(_a) {
|
|
|
13956
14046
|
});
|
|
13957
14047
|
});
|
|
13958
14048
|
}, [videoRef]), {
|
|
13959
|
-
autoStart:
|
|
14049
|
+
autoStart: !!recordingStartedAt && !recordingStoppedAt,
|
|
13960
14050
|
throttleMs: 1000 / 24
|
|
13961
14051
|
});
|
|
13962
14052
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, children, /*#__PURE__*/React__default.createElement(InvisibleCanvas, {
|
|
@@ -13965,6 +14055,17 @@ function VideoSignatureContextProvider(_a) {
|
|
|
13965
14055
|
height: (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.videoHeight
|
|
13966
14056
|
}));
|
|
13967
14057
|
}
|
|
14058
|
+
function formatTimestamp(durationMs) {
|
|
14059
|
+
// should be in the format of 00:00:00:00 (hh:mm:ss:cs)
|
|
14060
|
+
var hours = Math.floor(durationMs / 3600000);
|
|
14061
|
+
var minutes = Math.floor(durationMs % 3600000 / 60000);
|
|
14062
|
+
var seconds = Math.floor(durationMs % 60000 / 1000);
|
|
14063
|
+
var milliseconds = durationMs % 1000;
|
|
14064
|
+
// Convert milliseconds to centiseconds (1/100th of a second)
|
|
14065
|
+
var centiseconds = Math.floor(milliseconds / 10);
|
|
14066
|
+
var csString = centiseconds.toString().padStart(2, '0');
|
|
14067
|
+
return "".concat(hours.toString().padStart(2, '0'), ":") + "".concat(minutes.toString().padStart(2, '0'), ":") + "".concat(seconds.toString().padStart(2, '0'), ":") + "".concat(csString);
|
|
14068
|
+
}
|
|
13968
14069
|
|
|
13969
14070
|
function VideoSignaturePad(_a) {
|
|
13970
14071
|
var onAcceptBtnClicked = _a.onAcceptBtnClicked,
|
|
@@ -14026,8 +14127,11 @@ function VideoSignaturePad(_a) {
|
|
|
14026
14127
|
ref: signaturePad,
|
|
14027
14128
|
canvasProps: canvasProps,
|
|
14028
14129
|
onBegin: function onBegin() {
|
|
14029
|
-
return useVideoSignatureStore.setState({
|
|
14030
|
-
|
|
14130
|
+
return useVideoSignatureStore.setState(function (s) {
|
|
14131
|
+
return {
|
|
14132
|
+
signaturePadEmpty: false,
|
|
14133
|
+
signatureStartedAt: s.signatureStartedAt || performance.now()
|
|
14134
|
+
};
|
|
14031
14135
|
});
|
|
14032
14136
|
},
|
|
14033
14137
|
onEnd: function onEnd() {
|
|
@@ -14037,7 +14141,8 @@ function VideoSignaturePad(_a) {
|
|
|
14037
14141
|
return point;
|
|
14038
14142
|
});
|
|
14039
14143
|
useVideoSignatureStore.setState({
|
|
14040
|
-
signatureValid: points.length >= minSignaturePadPoints
|
|
14144
|
+
signatureValid: points.length >= minSignaturePadPoints,
|
|
14145
|
+
signatureEndedAt: performance.now()
|
|
14041
14146
|
});
|
|
14042
14147
|
}
|
|
14043
14148
|
}), !headTrackingSatisfied && !!verbiage.headTrackingUnsatisfiedText ? ( /*#__PURE__*/React__default.createElement(SignaturePadContentContainer, {
|
|
@@ -14104,6 +14209,12 @@ function VideoSignatureGuides(_a) {
|
|
|
14104
14209
|
useEffect(function () {
|
|
14105
14210
|
if (guideToDisplay) setMode(guideToDisplay);
|
|
14106
14211
|
}, [guideToDisplay]);
|
|
14212
|
+
var firstChunkReceivedAt = useVideoSignatureStore(useShallow(function (state) {
|
|
14213
|
+
return {
|
|
14214
|
+
firstChunkReceivedAt: state.firstChunkReceivedAt
|
|
14215
|
+
};
|
|
14216
|
+
})).firstChunkReceivedAt;
|
|
14217
|
+
var signaturePadDisabled = requestedAction !== 'CAPTURE_SIGNATURE' || !firstChunkReceivedAt;
|
|
14107
14218
|
return /*#__PURE__*/React__default.createElement(Container$3, {
|
|
14108
14219
|
className: classNames.container
|
|
14109
14220
|
}, /*#__PURE__*/React__default.createElement(Inner$1, {
|
|
@@ -14127,7 +14238,7 @@ function VideoSignatureGuides(_a) {
|
|
|
14127
14238
|
}, /*#__PURE__*/React__default.createElement(VideoSignaturePad, {
|
|
14128
14239
|
onAcceptBtnClicked: onAcceptBtnClicked,
|
|
14129
14240
|
onClearBtnClicked: onClearBtnClicked,
|
|
14130
|
-
disabled:
|
|
14241
|
+
disabled: signaturePadDisabled,
|
|
14131
14242
|
headTrackingSatisfied: headTrackingSatisfied,
|
|
14132
14243
|
minSignaturePadPoints: minSignaturePadPoints,
|
|
14133
14244
|
classNames: classNames,
|
|
@@ -14184,9 +14295,14 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
|
|
|
14184
14295
|
onHeadTrackingPredictionMade = _o.onPredictionMade,
|
|
14185
14296
|
startHeadTracking = _o.start,
|
|
14186
14297
|
stopHeadTracking = _o.stop;
|
|
14187
|
-
var _p = useVideoSignatureStore()
|
|
14298
|
+
var _p = useVideoSignatureStore(useShallow(function (state) {
|
|
14299
|
+
return {
|
|
14300
|
+
clearRecordedData: state.clearRecordedData,
|
|
14301
|
+
firstChunkReceivedAt: state.firstChunkReceivedAt
|
|
14302
|
+
};
|
|
14303
|
+
})),
|
|
14188
14304
|
clearRecordedData = _p.clearRecordedData,
|
|
14189
|
-
|
|
14305
|
+
firstChunkReceivedAt = _p.firstChunkReceivedAt;
|
|
14190
14306
|
useEffect(function () {
|
|
14191
14307
|
useVideoSignatureStore.setState({
|
|
14192
14308
|
onSignatureVideoCaptured: onSignatureVideoCaptured
|
|
@@ -14270,7 +14386,7 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
|
|
|
14270
14386
|
face: lastFace,
|
|
14271
14387
|
scaling: debugScalingDetails,
|
|
14272
14388
|
color: headTrackingSatisfied ? 'green' : 'red'
|
|
14273
|
-
}))), /*#__PURE__*/React__default.createElement(DebugStatsPane, null, "Video: ", videoWidth, "x", videoHeight, /*#__PURE__*/React__default.createElement("br", null), "Recording: ",
|
|
14389
|
+
}))), /*#__PURE__*/React__default.createElement(DebugStatsPane, null, "Video: ", videoWidth, "x", videoHeight, /*#__PURE__*/React__default.createElement("br", null), "Recording: ", firstChunkReceivedAt ? 'true' : 'false'))), /*#__PURE__*/React__default.createElement(ExitCaptureButton, {
|
|
14274
14390
|
onClick: onExit,
|
|
14275
14391
|
className: classNames.exitCaptureBtn
|
|
14276
14392
|
}));
|
|
@@ -14601,6 +14717,8 @@ var VideoSignatureWizard = function VideoSignatureWizard(_a) {
|
|
|
14601
14717
|
setSelfieImage = _u.setSelfieImage,
|
|
14602
14718
|
setSignatureData = _u.setSignatureData,
|
|
14603
14719
|
setSignatureVideoUrl = _u.setSignatureVideoUrl,
|
|
14720
|
+
setSignatureStartTimestamp = _u.setSignatureStartTimestamp,
|
|
14721
|
+
setSignatureEndTimestamp = _u.setSignatureEndTimestamp,
|
|
14604
14722
|
logSelfieCaptureAttempt = _u.logSelfieCaptureAttempt,
|
|
14605
14723
|
uploadDocument = _u.uploadDocument;
|
|
14606
14724
|
var cameraAccessDenied = useCameraStore(useShallow(function (state) {
|
|
@@ -14660,12 +14778,14 @@ var VideoSignatureWizard = function VideoSignatureWizard(_a) {
|
|
|
14660
14778
|
filetype: 'image/jpeg'
|
|
14661
14779
|
}).then(onSelfieCaptured);
|
|
14662
14780
|
}, [logCaptureMetadata, onSelfieCaptured, setSelfieImage, uploadDocument]);
|
|
14663
|
-
var onSignatureCaptureCompleted = useCallback(function (videoData, signatureData, signatureImageData) {
|
|
14781
|
+
var onSignatureCaptureCompleted = useCallback(function (videoData, signatureData, signatureImageData, signatureStartTimestamp, signatureEndTimestamp) {
|
|
14664
14782
|
setSignatureData(signatureData);
|
|
14665
14783
|
setSignatureVideoUrl(URL.createObjectURL(videoData));
|
|
14784
|
+
if (signatureStartTimestamp) setSignatureStartTimestamp(signatureStartTimestamp);
|
|
14785
|
+
if (signatureEndTimestamp) setSignatureEndTimestamp(signatureEndTimestamp);
|
|
14666
14786
|
setCaptureState('SUCCESS');
|
|
14667
|
-
onVideoCaptured === null || onVideoCaptured === void 0 ? void 0 : onVideoCaptured(videoData, signatureData, signatureImageData);
|
|
14668
|
-
}, [onVideoCaptured, setSignatureData, setSignatureVideoUrl]);
|
|
14787
|
+
onVideoCaptured === null || onVideoCaptured === void 0 ? void 0 : onVideoCaptured(videoData, signatureData, signatureImageData, signatureStartTimestamp, signatureEndTimestamp);
|
|
14788
|
+
}, [onVideoCaptured, setSignatureData, setSignatureEndTimestamp, setSignatureStartTimestamp, setSignatureVideoUrl]);
|
|
14669
14789
|
var _x = useState(true),
|
|
14670
14790
|
showLoadingOverlay = _x[0],
|
|
14671
14791
|
setShowLoadingOverlay = _x[1];
|