idmission-web-sdk 1.0.339 → 1.0.341
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/sdk2.cjs.development.js +69 -10
- 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 +69 -10
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +69 -10
- 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/stories/CustomerFlows/VideoIdValidation.stories.d.ts +8 -0
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -50,7 +50,7 @@ var LanguageDetector__default = /*#__PURE__*/_interopDefaultLegacy(LanguageDetec
|
|
|
50
50
|
var i18n__default = /*#__PURE__*/_interopDefaultLegacy(i18n);
|
|
51
51
|
var SignatureCanvas__default = /*#__PURE__*/_interopDefaultLegacy(SignatureCanvas);
|
|
52
52
|
|
|
53
|
-
var webSdkVersion = '1.0.
|
|
53
|
+
var webSdkVersion = '1.0.341';
|
|
54
54
|
|
|
55
55
|
function getPlatform() {
|
|
56
56
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -8888,7 +8888,7 @@ var HighPerformanceSelfieGuidanceModelsProvider = function HighPerformanceSelfie
|
|
|
8888
8888
|
modelLoadTimeout = setTimeout(function () {
|
|
8889
8889
|
setModelError(new Error('Model loading time limit exceeded.'));
|
|
8890
8890
|
persistentError = new Error('Model loading time limit exceeded.');
|
|
8891
|
-
},
|
|
8891
|
+
}, 1);
|
|
8892
8892
|
_b.label = 1;
|
|
8893
8893
|
case 1:
|
|
8894
8894
|
_b.trys.push([1, 3, 4, 5]);
|
|
@@ -9327,7 +9327,7 @@ var IdCaptureModelsProvider = function IdCaptureModelsProvider(_a) {
|
|
|
9327
9327
|
}
|
|
9328
9328
|
var modelLoadTimeout = setTimeout(function () {
|
|
9329
9329
|
setModelError(new Error('Model loading time limit exceeded.'));
|
|
9330
|
-
},
|
|
9330
|
+
}, 1);
|
|
9331
9331
|
loadModels().then(function () {
|
|
9332
9332
|
setModelDownloadProgress(100);
|
|
9333
9333
|
setReady(true);
|
|
@@ -11863,6 +11863,7 @@ var CameraVideoTag = function CameraVideoTag(_a) {
|
|
|
11863
11863
|
var onLoadedData = React.useCallback(function () {
|
|
11864
11864
|
setVideoLoaded(true);
|
|
11865
11865
|
}, [setVideoLoaded]);
|
|
11866
|
+
console.log('WUDebug - rendering full screen video');
|
|
11866
11867
|
return /*#__PURE__*/React__default['default'].createElement(FullscreenVideoTag, {
|
|
11867
11868
|
className: className,
|
|
11868
11869
|
autoPlay: true,
|
|
@@ -13149,13 +13150,14 @@ var IdCaptureFallback = function IdCaptureFallback(_a) {
|
|
|
13149
13150
|
onCapture === null || onCapture === void 0 ? void 0 : onCapture(imageData);
|
|
13150
13151
|
});
|
|
13151
13152
|
reader.readAsDataURL(file);
|
|
13153
|
+
setDocumentToCapture(undefined);
|
|
13152
13154
|
}
|
|
13153
13155
|
var instructionText = images.length === 0 ? verbiage.firstInstructionText : images.length === 1 ? verbiage.secondInstructionText : verbiage.thirdInstructionText;
|
|
13154
13156
|
if (useFallback) {
|
|
13155
13157
|
setUseFallback(false);
|
|
13156
13158
|
setDocumentToCapture(instructionText);
|
|
13157
13159
|
}
|
|
13158
|
-
if (documentToCapture || useFallback) {
|
|
13160
|
+
if (!isMobile() && documentToCapture || useFallback) {
|
|
13159
13161
|
return /*#__PURE__*/React__default['default'].createElement(DocumentCaptureWizard, {
|
|
13160
13162
|
documents: [{
|
|
13161
13163
|
title: documentToCapture
|
|
@@ -13664,9 +13666,23 @@ var SelfieCaptureFallback = function SelfieCaptureFallback(_a) {
|
|
|
13664
13666
|
doneBtnText: 'Done',
|
|
13665
13667
|
doneBtnLoadingText: 'Verifying...'
|
|
13666
13668
|
});
|
|
13667
|
-
function
|
|
13669
|
+
React.useEffect(function () {
|
|
13670
|
+
var fallbackTimeout;
|
|
13671
|
+
if (useFallback) {
|
|
13672
|
+
fallbackTimeout = setTimeout(function () {
|
|
13673
|
+
var _a;
|
|
13674
|
+
(_a = fileInput.current) === null || _a === void 0 ? void 0 : _a.click();
|
|
13675
|
+
}, 250);
|
|
13676
|
+
}
|
|
13677
|
+
return function () {
|
|
13678
|
+
clearTimeout(fallbackTimeout);
|
|
13679
|
+
};
|
|
13680
|
+
}, [useFallback]);
|
|
13681
|
+
var onFileSelected = function onFileSelected(e) {
|
|
13668
13682
|
var _a;
|
|
13683
|
+
console.log('WUDebug - file selected');
|
|
13669
13684
|
var file = (_a = e.target.files) === null || _a === void 0 ? void 0 : _a[0];
|
|
13685
|
+
console.log('WUDebug - file: ', file);
|
|
13670
13686
|
if (!file) return;
|
|
13671
13687
|
var reader = new FileReader();
|
|
13672
13688
|
reader.addEventListener('load', function (e) {
|
|
@@ -13676,8 +13692,8 @@ var SelfieCaptureFallback = function SelfieCaptureFallback(_a) {
|
|
|
13676
13692
|
onCapture === null || onCapture === void 0 ? void 0 : onCapture(imageData);
|
|
13677
13693
|
});
|
|
13678
13694
|
reader.readAsDataURL(file);
|
|
13679
|
-
}
|
|
13680
|
-
if (usingDocumentCapture
|
|
13695
|
+
};
|
|
13696
|
+
if (usingDocumentCapture) {
|
|
13681
13697
|
return /*#__PURE__*/React__default['default'].createElement(DocumentCaptureWizard, {
|
|
13682
13698
|
documents: [{
|
|
13683
13699
|
title: verbiage.descriptionText
|
|
@@ -13691,15 +13707,31 @@ var SelfieCaptureFallback = function SelfieCaptureFallback(_a) {
|
|
|
13691
13707
|
}
|
|
13692
13708
|
});
|
|
13693
13709
|
}
|
|
13710
|
+
if (useFallback && !image) {
|
|
13711
|
+
console.log('WUDebug - in fallback render', image);
|
|
13712
|
+
return /*#__PURE__*/React__default['default'].createElement(OverlayContainer, {
|
|
13713
|
+
className: classNames.container
|
|
13714
|
+
}, /*#__PURE__*/React__default['default'].createElement(StyledOverlayInner, {
|
|
13715
|
+
className: classNames.inner
|
|
13716
|
+
}, /*#__PURE__*/React__default['default'].createElement("input", {
|
|
13717
|
+
ref: fileInput,
|
|
13718
|
+
type: "file",
|
|
13719
|
+
accept: "image/*",
|
|
13720
|
+
capture: "user",
|
|
13721
|
+
onChange: onFileSelected,
|
|
13722
|
+
hidden: true
|
|
13723
|
+
})));
|
|
13724
|
+
}
|
|
13725
|
+
console.log('WUDebug - main render');
|
|
13694
13726
|
return /*#__PURE__*/React__default['default'].createElement(OverlayContainer, {
|
|
13695
13727
|
className: classNames.container
|
|
13696
13728
|
}, /*#__PURE__*/React__default['default'].createElement(StyledOverlayInner, {
|
|
13697
13729
|
className: classNames.inner
|
|
13698
|
-
}, /*#__PURE__*/React__default['default'].createElement(Heading$6, {
|
|
13730
|
+
}, !useFallback && ( /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(Heading$6, {
|
|
13699
13731
|
className: classNames.heading
|
|
13700
13732
|
}, verbiage.headingText), /*#__PURE__*/React__default['default'].createElement(Description$1, {
|
|
13701
13733
|
className: classNames.description
|
|
13702
|
-
}, verbiage.descriptionText), image && ( /*#__PURE__*/React__default['default'].createElement(ImageContainer$5, {
|
|
13734
|
+
}, verbiage.descriptionText))), image && ( /*#__PURE__*/React__default['default'].createElement(ImageContainer$5, {
|
|
13703
13735
|
className: classNames.imageContainer
|
|
13704
13736
|
}, /*#__PURE__*/React__default['default'].createElement("img", {
|
|
13705
13737
|
src: image,
|
|
@@ -14954,6 +14986,7 @@ var FaceLivenessWizard = function FaceLivenessWizard(_a) {
|
|
|
14954
14986
|
}, 0);
|
|
14955
14987
|
}, [logCaptureMetadata, onComplete, releaseCameraAccess, releaseCameraAccessOnExit, livenessCheckRequest, submissionResponse]);
|
|
14956
14988
|
var showSuccessScreen = useShowSuccessScreen(skipSuccessScreen, captureState === 'SUCCESS', onDoneCallback);
|
|
14989
|
+
console.log('WUDebug - renderCameraFeed', renderCameraFeed);
|
|
14957
14990
|
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(PageContainer, {
|
|
14958
14991
|
className: "flex ".concat((_c = (_b = classNames.capture) === null || _b === void 0 ? void 0 : _b.container) !== null && _c !== void 0 ? _c : '')
|
|
14959
14992
|
}, renderCameraFeed && ( /*#__PURE__*/React__default['default'].createElement(CameraVideoTag, {
|
|
@@ -16170,8 +16203,10 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
16170
16203
|
requestedAction = _24[0],
|
|
16171
16204
|
setRequestedAction = _24[1];
|
|
16172
16205
|
React.useEffect(function () {
|
|
16206
|
+
console.log('WUDebug - idCaptureModelsEnabled, idModelsReady, cameraReady, videoLoaded, idModelError', idCaptureModelsEnabled, idModelsReady, cameraReady, videoLoaded, idModelError);
|
|
16173
16207
|
if (requestedAction !== 'SHOW_ID_FRONT' && requestedAction !== 'SHOW_ID_BACK') return;
|
|
16174
16208
|
if (!idCaptureModelsEnabled || !idModelsReady || !cameraReady || !videoLoaded || idModelError) return;
|
|
16209
|
+
console.log('WUDebug - SHOULD NOT BE HIT');
|
|
16175
16210
|
animationFrame.current = requestAnimationFrame(function runFrame() {
|
|
16176
16211
|
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
16177
16212
|
return tslib.__generator(this, function (_a) {
|
|
@@ -16209,6 +16244,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
16209
16244
|
var goodFramesThresholdMet = goodFramesCount >= goodFramesThreshold;
|
|
16210
16245
|
React.useEffect(function () {
|
|
16211
16246
|
if (!idCaptureModelsEnabled || idModelError) return;
|
|
16247
|
+
console.log('WUDebug - should not get here - onIdPredictionMade', idCaptureModelsEnabled, idCardFrontDetectionThreshold, onIdPredictionMade, idModelError);
|
|
16212
16248
|
onIdPredictionMade(function (prediction) {
|
|
16213
16249
|
setDetectedObjects(prediction.detectedObjects);
|
|
16214
16250
|
setCurrentDetectionScore(prediction.detectionScore);
|
|
@@ -16254,12 +16290,15 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
16254
16290
|
return tslib.__generator(this, function (_b) {
|
|
16255
16291
|
switch (_b.label) {
|
|
16256
16292
|
case 0:
|
|
16293
|
+
console.log('WUDebug - captureFrame');
|
|
16257
16294
|
if (frameLock.current) return [2 /*return*/];
|
|
16258
16295
|
frameLock.current = true;
|
|
16259
16296
|
return [4 /*yield*/, takePhoto()];
|
|
16260
16297
|
case 1:
|
|
16261
16298
|
frame = _b.sent();
|
|
16299
|
+
console.log('WUDebug - frame captured');
|
|
16262
16300
|
if (!frame) {
|
|
16301
|
+
console.log('WUDebug - frame capture FAILED');
|
|
16263
16302
|
frameLock.current = false;
|
|
16264
16303
|
return [2 /*return*/];
|
|
16265
16304
|
}
|
|
@@ -16280,10 +16319,14 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
16280
16319
|
_b.label = 4;
|
|
16281
16320
|
case 4:
|
|
16282
16321
|
frameBase64 = _a;
|
|
16322
|
+
console.log('WUDebug - converted to base64');
|
|
16283
16323
|
if (!(requestedAction == 'SHOW_ID_FRONT')) return [3 /*break*/, 8];
|
|
16284
16324
|
if (onIdFrontImageCaptured) {
|
|
16325
|
+
console.log('WUDebug - onIdFrontImageCaptured exists');
|
|
16285
16326
|
frameBase64 && onIdFrontImageCaptured(frameBase64);
|
|
16327
|
+
console.log('WUDebug - onIdFrontImageCaptured completed');
|
|
16286
16328
|
}
|
|
16329
|
+
console.log('WUDebug - skipShowIdCardBack, onIdBackCaptureComplete', skipShowIdCardBack, onIdBackCaptureComplete);
|
|
16287
16330
|
if (!skipShowIdCardBack) return [3 /*break*/, 7];
|
|
16288
16331
|
if (!(skipShowIdCardBack === true)) return [3 /*break*/, 5];
|
|
16289
16332
|
return [2 /*return*/, onIdBackCaptureComplete()];
|
|
@@ -16297,15 +16340,21 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
16297
16340
|
case 7:
|
|
16298
16341
|
setRequestedAction('FLIP_ID');
|
|
16299
16342
|
setTimeout(function () {
|
|
16343
|
+
console.log('WUDebug - requesting to show back');
|
|
16300
16344
|
setRequestedAction('SHOW_ID_BACK');
|
|
16301
16345
|
}, 6000);
|
|
16302
16346
|
return [3 /*break*/, 9];
|
|
16303
16347
|
case 8:
|
|
16304
16348
|
if (requestedAction == 'SHOW_ID_BACK') {
|
|
16349
|
+
console.log('WUDebug - capturing the back');
|
|
16305
16350
|
if (onIdBackImageCaptured) {
|
|
16351
|
+
console.log('WUDebug - onIdBackImageCaptured exists');
|
|
16306
16352
|
frameBase64 && onIdBackImageCaptured(frameBase64);
|
|
16353
|
+
console.log('WUDebug - onIdBackImageCaptured completed');
|
|
16307
16354
|
}
|
|
16355
|
+
console.log('WUDebug - onIdBackCaptureComplete exists');
|
|
16308
16356
|
onIdBackCaptureComplete();
|
|
16357
|
+
console.log('WUDebug - onIdBackCaptureComplete completed');
|
|
16309
16358
|
}
|
|
16310
16359
|
_b.label = 9;
|
|
16311
16360
|
case 9:
|
|
@@ -16318,6 +16367,9 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
16318
16367
|
setCountdownStartedAt(undefined);
|
|
16319
16368
|
resetBestFrame();
|
|
16320
16369
|
frameLock.current = false;
|
|
16370
|
+
if (countdownTimeoutRef.current) {
|
|
16371
|
+
clearTimeout(countdownTimeoutRef.current);
|
|
16372
|
+
}
|
|
16321
16373
|
return [7 /*endfinally*/];
|
|
16322
16374
|
case 11:
|
|
16323
16375
|
return [2 /*return*/];
|
|
@@ -16327,6 +16379,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
16327
16379
|
}, [onIdBackCaptureComplete, onIdBackImageCaptured, onIdFrontImageCaptured, requestedAction, resetBestFrame, skipShowIdCardBack, takePhoto]);
|
|
16328
16380
|
var satisfied = goodFramesThresholdMet && faceCentered && delaySatisfied;
|
|
16329
16381
|
React.useEffect(function () {
|
|
16382
|
+
console.log('WUDebug - [countdownStartedAt, satisfied]', satisfied, countdownStartedAt);
|
|
16330
16383
|
if (satisfied && !countdownStartedAt) {
|
|
16331
16384
|
setCountdownStartedAt(new Date());
|
|
16332
16385
|
}
|
|
@@ -16337,8 +16390,11 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
16337
16390
|
};
|
|
16338
16391
|
}, []);
|
|
16339
16392
|
var manualCountdown = React.useCallback(function (remainingTime) {
|
|
16393
|
+
console.log('WUDebug - [captureFrame, countdownStartedAt, countdownTimeoutRef]', captureFrame, countdownStartedAt, countdownTimeoutRef);
|
|
16394
|
+
console.log('WUDebug - remainingTime', remainingTime);
|
|
16340
16395
|
if (remainingTime > 0) {
|
|
16341
16396
|
var nextCycle_1 = remainingTime - 1;
|
|
16397
|
+
console.log('WUDebug - decrementing countdown', nextCycle_1);
|
|
16342
16398
|
setCountdownRemaining(nextCycle_1);
|
|
16343
16399
|
countdownTimeoutRef.current = setTimeout(function () {
|
|
16344
16400
|
return manualCountdown(nextCycle_1);
|
|
@@ -16346,6 +16402,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
16346
16402
|
return;
|
|
16347
16403
|
}
|
|
16348
16404
|
if (countdownStartedAt) {
|
|
16405
|
+
console.log('WUDebug - calling captureFrame');
|
|
16349
16406
|
captureFrame();
|
|
16350
16407
|
}
|
|
16351
16408
|
}, [captureFrame, countdownStartedAt, countdownTimeoutRef]);
|
|
@@ -16448,7 +16505,8 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
16448
16505
|
}, /*#__PURE__*/React__default['default'].createElement(CaptureButton, {
|
|
16449
16506
|
finished: true,
|
|
16450
16507
|
onClick: function onClick() {
|
|
16451
|
-
|
|
16508
|
+
console.log('WUDebug - capture button clicked');
|
|
16509
|
+
setCountdownStartedAt(new Date());
|
|
16452
16510
|
},
|
|
16453
16511
|
disabled: !!countdownStartedAt || frameLock.current,
|
|
16454
16512
|
className: classNames.captureBtn
|
|
@@ -16683,6 +16741,7 @@ var VideoIdWizard = function VideoIdWizard(_a) {
|
|
|
16683
16741
|
className: "flex"
|
|
16684
16742
|
}, /*#__PURE__*/React__default['default'].createElement(Spinner, null));
|
|
16685
16743
|
}
|
|
16744
|
+
console.log('WUDebug - captureState', captureState);
|
|
16686
16745
|
return /*#__PURE__*/React__default['default'].createElement(IdCaptureModelsProvider, {
|
|
16687
16746
|
documentDetectionModelUrl: (_c = (_b = idCaptureProps.assets) === null || _b === void 0 ? void 0 : _b.documentDetectionModelUrl) !== null && _c !== void 0 ? _c : '',
|
|
16688
16747
|
focusModelUrl: (_e = (_d = idCaptureProps.assets) === null || _d === void 0 ? void 0 : _d.focusModelUrl) !== null && _e !== void 0 ? _e : '',
|