idmission-web-sdk 2.1.16 → 2.1.18
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/customer_flows/IdValidation.d.ts +4 -0
- package/dist/components/id_capture/IdCaptureGuides.d.ts +2 -1
- package/dist/components/id_capture/IdCaptureStateProvider.d.ts +2 -0
- package/dist/components/id_capture/IdCaptureWizard.d.ts +3 -1
- package/dist/lib/locales/es/translation.d.ts +1 -0
- package/dist/lib/locales/index.d.ts +1 -0
- package/dist/sdk2.esm.js +124 -92
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +124 -92
- 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
|
@@ -96,6 +96,10 @@ export interface IdValidationProps extends PropsWithChildren {
|
|
|
96
96
|
rotateLoadingOverlayImageWhenPortrait?: boolean;
|
|
97
97
|
/** Number of milliseconds indicating the maximum amount of time that should be spent trying to load the guided capture experience before giving up and resorting to the stock camera instead. Defaults to 45000 (45 seconds). */
|
|
98
98
|
modelLoadTimeoutMs?: number;
|
|
99
|
+
/** Boolean to indicate whether to force the fallback mode even if the ID capture models are available. Defaults to `false`. */
|
|
100
|
+
forceFallbackMode?: boolean;
|
|
101
|
+
/** Boolean to indicate whether to allow the user to capture the back of the ID card before capturing the front. Defaults to `false`. */
|
|
102
|
+
allowIdCardBackToFrontCapture?: boolean;
|
|
99
103
|
/** Object to allow documents that have been previously captured to be submitted. Valid keys: `idCardFront`, `idCardBack`, `passport`.*/
|
|
100
104
|
precapturedDocuments?: CapturedDocuments;
|
|
101
105
|
/** Callback function that fires immediately prior to each document upload, giving the client application an opportunity to specify custom asynchronous logic that captures the document contents before it is exchanged for a document token. The document content and metadata are passed in as parameters and a promise resolving to void or false should be returned. If the returned promise resolves to false, the document will not be uploaded. */
|
|
@@ -3,10 +3,11 @@ import React from 'react';
|
|
|
3
3
|
import { IdCaptureAssets, IdCaptureColors, IdCaptureVerbiage } from './IdCapture';
|
|
4
4
|
import { FlipIdPromptAssets } from './FlipIdPrompt';
|
|
5
5
|
export type IdCaptureGuideType = 'fit' | 'overlay';
|
|
6
|
-
export declare function IdCaptureGuides({ guideType, portraitGuidesOnMobile, requestingFlip, flipIdPromptAssets, classNames, assets, colors, verbiage: rawVerbiage, }: {
|
|
6
|
+
export declare function IdCaptureGuides({ guideType, portraitGuidesOnMobile, requestingFlip, isBackToFront, flipIdPromptAssets, classNames, assets, colors, verbiage: rawVerbiage, }: {
|
|
7
7
|
guideType?: IdCaptureGuideType;
|
|
8
8
|
portraitGuidesOnMobile?: boolean;
|
|
9
9
|
requestingFlip?: boolean;
|
|
10
|
+
isBackToFront?: boolean;
|
|
10
11
|
flipIdPromptAssets?: FlipIdPromptAssets;
|
|
11
12
|
classNames?: IdCaptureFitGuideClassNames;
|
|
12
13
|
assets?: IdCaptureAssets;
|
|
@@ -48,6 +48,7 @@ export type IdCaptureState = {
|
|
|
48
48
|
capturedDocuments: CapturedDocuments;
|
|
49
49
|
captureRequirement: IdCaptureRequirementOption;
|
|
50
50
|
requestedDocumentType: CapturedDocumentType;
|
|
51
|
+
allowIdCardBackToFrontCapture: boolean;
|
|
51
52
|
operationStartedAt: Date | null;
|
|
52
53
|
captureStartedAt: Date | null;
|
|
53
54
|
};
|
|
@@ -56,6 +57,7 @@ export type IdCaptureAction = {
|
|
|
56
57
|
payload: {
|
|
57
58
|
captureRequirement: IdCaptureRequirementOption;
|
|
58
59
|
precapturedDocuments?: CapturedDocuments;
|
|
60
|
+
allowIdCardBackToFrontCapture?: boolean;
|
|
59
61
|
};
|
|
60
62
|
} | {
|
|
61
63
|
type: 'setRequiredDocumentType';
|
|
@@ -63,10 +63,12 @@ export type IdCaptureWizardProps = {
|
|
|
63
63
|
portraitGuidesOnMobile?: boolean;
|
|
64
64
|
rotateLoadingOverlayImageWhenPortrait?: boolean;
|
|
65
65
|
silentFallback?: boolean;
|
|
66
|
+
forceFallbackMode?: boolean;
|
|
67
|
+
allowIdCardBackToFrontCapture?: boolean;
|
|
66
68
|
assets?: IdCaptureWizardAssets;
|
|
67
69
|
classNames?: IdCaptureWizardClassNames;
|
|
68
70
|
colors?: IdCaptureWizardColors;
|
|
69
71
|
verbiage?: IdCaptureWizardVerbiage;
|
|
70
72
|
debugMode?: boolean;
|
|
71
73
|
};
|
|
72
|
-
export declare const IdCaptureWizard: ({ onSuccess, onExitCapture, onUserCancel, loadingOverlayMode, precapturedDocuments, captureRequirement, separateIdCardCaptureSequence, thresholds, skipSuccessScreen, instructions, releaseCameraAccessOnExit, guideType, portraitGuidesOnMobile, rotateLoadingOverlayImageWhenPortrait, silentFallback, assets, classNames, colors, verbiage, debugMode, }: IdCaptureWizardProps) => ReactElement;
|
|
74
|
+
export declare const IdCaptureWizard: ({ onSuccess, onExitCapture, onUserCancel, loadingOverlayMode, precapturedDocuments, captureRequirement, separateIdCardCaptureSequence, thresholds, skipSuccessScreen, instructions, releaseCameraAccessOnExit, guideType, portraitGuidesOnMobile, rotateLoadingOverlayImageWhenPortrait, silentFallback, forceFallbackMode, allowIdCardBackToFrontCapture, assets, classNames, colors, verbiage, debugMode, }: IdCaptureWizardProps) => ReactElement;
|
|
@@ -34,6 +34,7 @@ declare const _default: {
|
|
|
34
34
|
'Capture failed!': string;
|
|
35
35
|
'Please flip your ID card...': string;
|
|
36
36
|
'ID card front captured.': string;
|
|
37
|
+
'ID card back captured.': string;
|
|
37
38
|
'ID Capture Successful': string;
|
|
38
39
|
'Verify the entire ID was captured clearly with no glare.': string;
|
|
39
40
|
Submit: string;
|
|
@@ -42,6 +42,7 @@ export declare const resources: {
|
|
|
42
42
|
'Capture failed!': string;
|
|
43
43
|
'Please flip your ID card...': string;
|
|
44
44
|
'ID card front captured.': string;
|
|
45
|
+
'ID card back captured.': string;
|
|
45
46
|
'ID Capture Successful': string;
|
|
46
47
|
'Verify the entire ID was captured clearly with no glare.': string;
|
|
47
48
|
Submit: string;
|
package/dist/sdk2.esm.js
CHANGED
|
@@ -204,7 +204,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
204
204
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
205
205
|
};
|
|
206
206
|
|
|
207
|
-
var webSdkVersion = '2.1.
|
|
207
|
+
var webSdkVersion = '2.1.18';
|
|
208
208
|
|
|
209
209
|
function getPlatform() {
|
|
210
210
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -6131,6 +6131,7 @@ var initialState$4 = {
|
|
|
6131
6131
|
capturedDocuments: {},
|
|
6132
6132
|
captureRequirement: 'idCardOrPassport',
|
|
6133
6133
|
requestedDocumentType: 'idCardFront',
|
|
6134
|
+
allowIdCardBackToFrontCapture: false,
|
|
6134
6135
|
operationStartedAt: null,
|
|
6135
6136
|
captureStartedAt: null
|
|
6136
6137
|
};
|
|
@@ -6143,9 +6144,11 @@ var _reducer = function reducer(state, action) {
|
|
|
6143
6144
|
{
|
|
6144
6145
|
var _c = action.payload,
|
|
6145
6146
|
captureRequirement = _c.captureRequirement,
|
|
6146
|
-
precapturedDocuments = _c.precapturedDocuments
|
|
6147
|
+
precapturedDocuments = _c.precapturedDocuments,
|
|
6148
|
+
allowIdCardBackToFrontCapture = _c.allowIdCardBackToFrontCapture;
|
|
6147
6149
|
var newState = _assign(_assign({}, state), {
|
|
6148
|
-
captureRequirement: captureRequirement
|
|
6150
|
+
captureRequirement: captureRequirement,
|
|
6151
|
+
allowIdCardBackToFrontCapture: allowIdCardBackToFrontCapture !== null && allowIdCardBackToFrontCapture !== void 0 ? allowIdCardBackToFrontCapture : false
|
|
6149
6152
|
});
|
|
6150
6153
|
if (captureRequirement === 'idCardBack') newState.requestedDocumentType = 'idCardBack';
|
|
6151
6154
|
if (captureRequirement === 'passport') newState.requestedDocumentType = 'passport';
|
|
@@ -6225,8 +6228,8 @@ var _reducer = function reducer(state, action) {
|
|
|
6225
6228
|
goodFramesThreshold = Math.ceil(3 * frameCaptureRate);
|
|
6226
6229
|
}
|
|
6227
6230
|
}
|
|
6228
|
-
var flipRequired = state.requestedDocumentType === 'idCardBack' && detectedDocumentType === 'idCardFront';
|
|
6229
|
-
var backDetectedFirst = state.requestedDocumentType.includes('idCardFront') && detectedDocumentType === 'idCardBack';
|
|
6231
|
+
var flipRequired = !state.allowIdCardBackToFrontCapture && state.requestedDocumentType === 'idCardBack' && detectedDocumentType === 'idCardFront';
|
|
6232
|
+
var backDetectedFirst = state.allowIdCardBackToFrontCapture ? 'idCardBack' in state.capturedDocuments && detectedDocumentType === 'idCardBack' : state.requestedDocumentType.includes('idCardFront') && detectedDocumentType === 'idCardBack';
|
|
6230
6233
|
var isGoodFrame = detectionThresholdMet && documentInBounds && !documentTooClose && !flipRequired && !backDetectedFirst && focusThresholdMet;
|
|
6231
6234
|
var goodFramesCount = state.goodFramesCount;
|
|
6232
6235
|
if (isGoodFrame) {
|
|
@@ -6234,6 +6237,13 @@ var _reducer = function reducer(state, action) {
|
|
|
6234
6237
|
}
|
|
6235
6238
|
var goodFramesThresholdMet = goodFramesCount >= goodFramesThreshold;
|
|
6236
6239
|
var requestedDocumentType = state.requestedDocumentType;
|
|
6240
|
+
if (state.captureRequirement.includes('idCard') && state.allowIdCardBackToFrontCapture) {
|
|
6241
|
+
if (detectedDocumentType === 'idCardFront' && state.requestedDocumentType !== 'idCardFront' && !('idCardFront' in state.capturedDocuments)) {
|
|
6242
|
+
requestedDocumentType = 'idCardFront';
|
|
6243
|
+
} else if (detectedDocumentType === 'idCardBack' && state.requestedDocumentType !== 'idCardBack' && !('idCardBack' in state.capturedDocuments)) {
|
|
6244
|
+
requestedDocumentType = 'idCardBack';
|
|
6245
|
+
}
|
|
6246
|
+
}
|
|
6237
6247
|
if (state.captureRequirement === 'idCardOrPassport') {
|
|
6238
6248
|
if (detectedDocumentType === 'passport' && state.requestedDocumentType !== 'passport') {
|
|
6239
6249
|
requestedDocumentType = 'passport';
|
|
@@ -6318,7 +6328,7 @@ var _reducer = function reducer(state, action) {
|
|
|
6318
6328
|
newState_1.captureState = 'complete';
|
|
6319
6329
|
} else {
|
|
6320
6330
|
newState_1.requestedDocumentType = remainingRequirements[0];
|
|
6321
|
-
if (state.requestedDocumentType === 'idCardFront' && newState_1.requestedDocumentType === 'idCardBack') {
|
|
6331
|
+
if (state.requestedDocumentType === 'idCardFront' && newState_1.requestedDocumentType === 'idCardBack' || state.requestedDocumentType === 'idCardBack' && newState_1.requestedDocumentType === 'idCardFront') {
|
|
6322
6332
|
newState_1.captureState = 'requestingFlip';
|
|
6323
6333
|
newState_1.idCardFrontDetectionThresholdMet = false;
|
|
6324
6334
|
newState_1.idCardBackDetectionThresholdMet = false;
|
|
@@ -6351,7 +6361,7 @@ var _reducer = function reducer(state, action) {
|
|
|
6351
6361
|
newState_2.captureState = 'complete';
|
|
6352
6362
|
} else {
|
|
6353
6363
|
newState_2.requestedDocumentType = remainingRequirements[0];
|
|
6354
|
-
if (state.requestedDocumentType === 'idCardFront' && newState_2.requestedDocumentType === 'idCardBack') {
|
|
6364
|
+
if (state.requestedDocumentType === 'idCardFront' && newState_2.requestedDocumentType === 'idCardBack' || state.requestedDocumentType === 'idCardBack' && newState_2.requestedDocumentType === 'idCardFront') {
|
|
6355
6365
|
newState_2.captureState = 'requestingFlip';
|
|
6356
6366
|
newState_2.idCardFrontDetectionThresholdMet = false;
|
|
6357
6367
|
newState_2.idCardBackDetectionThresholdMet = false;
|
|
@@ -6365,7 +6375,10 @@ var _reducer = function reducer(state, action) {
|
|
|
6365
6375
|
captureState: 'capturing'
|
|
6366
6376
|
});
|
|
6367
6377
|
case 'resetWizard':
|
|
6368
|
-
return _assign({}, initialState$4)
|
|
6378
|
+
return _assign(_assign({}, initialState$4), {
|
|
6379
|
+
captureRequirement: state.captureRequirement,
|
|
6380
|
+
allowIdCardBackToFrontCapture: state.allowIdCardBackToFrontCapture
|
|
6381
|
+
});
|
|
6369
6382
|
default:
|
|
6370
6383
|
return state;
|
|
6371
6384
|
}
|
|
@@ -6653,6 +6666,7 @@ var esTranslation = {
|
|
|
6653
6666
|
'Capture failed!': 'Falló la captura',
|
|
6654
6667
|
'Please flip your ID card...': 'Por favor voltea la identificación...',
|
|
6655
6668
|
'ID card front captured.': 'Se ha capturado el frente de la identificación.',
|
|
6669
|
+
'ID card back captured.': 'Se ha capturado el reverso de la identificación.',
|
|
6656
6670
|
'ID Capture Successful': 'Captura Exitosa de ID',
|
|
6657
6671
|
'Verify the entire ID was captured clearly with no glare.': 'Hay que verificar que toda la ID se vea completa y sin reflejos.',
|
|
6658
6672
|
Submit: 'Enviar',
|
|
@@ -8561,16 +8575,18 @@ function IdCaptureGuides(_a) {
|
|
|
8561
8575
|
portraitGuidesOnMobile = _e === void 0 ? true : _e,
|
|
8562
8576
|
_f = _a.requestingFlip,
|
|
8563
8577
|
requestingFlip = _f === void 0 ? false : _f,
|
|
8564
|
-
_g = _a.
|
|
8565
|
-
|
|
8566
|
-
_h = _a.
|
|
8567
|
-
|
|
8568
|
-
_j = _a.
|
|
8569
|
-
|
|
8570
|
-
_k = _a.
|
|
8571
|
-
|
|
8572
|
-
_l = _a.
|
|
8573
|
-
|
|
8578
|
+
_g = _a.isBackToFront,
|
|
8579
|
+
isBackToFront = _g === void 0 ? false : _g,
|
|
8580
|
+
_h = _a.flipIdPromptAssets,
|
|
8581
|
+
flipIdPromptAssets = _h === void 0 ? {} : _h,
|
|
8582
|
+
_j = _a.classNames,
|
|
8583
|
+
classNames = _j === void 0 ? {} : _j,
|
|
8584
|
+
_k = _a.assets,
|
|
8585
|
+
assets = _k === void 0 ? {} : _k,
|
|
8586
|
+
_l = _a.colors,
|
|
8587
|
+
colors = _l === void 0 ? {} : _l,
|
|
8588
|
+
_m = _a.verbiage,
|
|
8589
|
+
rawVerbiage = _m === void 0 ? {} : _m;
|
|
8574
8590
|
var state = useIdCaptureState()[0];
|
|
8575
8591
|
var cameraRef = useContext(CameraStateContext).cameraRef;
|
|
8576
8592
|
var verbiage = useTranslations(rawVerbiage, {
|
|
@@ -8581,6 +8597,11 @@ function IdCaptureGuides(_a) {
|
|
|
8581
8597
|
var isMobile = window.innerWidth < window.innerHeight;
|
|
8582
8598
|
var frontImageUrl = portraitGuidesOnMobile && isMobile ? flipIdPromptAssets === null || flipIdPromptAssets === void 0 ? void 0 : flipIdPromptAssets.frontPortraitGuidesImageUrl : flipIdPromptAssets === null || flipIdPromptAssets === void 0 ? void 0 : flipIdPromptAssets.frontLandscapeGuidesImageUrl;
|
|
8583
8599
|
var backImageUrl = portraitGuidesOnMobile && isMobile ? flipIdPromptAssets === null || flipIdPromptAssets === void 0 ? void 0 : flipIdPromptAssets.backPortraitGuidesImageUrl : flipIdPromptAssets === null || flipIdPromptAssets === void 0 ? void 0 : flipIdPromptAssets.backLandscapeGuidesImageUrl;
|
|
8600
|
+
if (isBackToFront) {
|
|
8601
|
+
var temp = frontImageUrl;
|
|
8602
|
+
frontImageUrl = backImageUrl;
|
|
8603
|
+
backImageUrl = temp;
|
|
8604
|
+
}
|
|
8584
8605
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, guideType === 'overlay' && ( /*#__PURE__*/React__default.createElement(IdCaptureGuideOverlay, {
|
|
8585
8606
|
classNames: classNames,
|
|
8586
8607
|
width: state.pageWidth,
|
|
@@ -9522,49 +9543,54 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
9522
9543
|
rotateLoadingOverlayImageWhenPortrait = _1 === void 0 ? true : _1,
|
|
9523
9544
|
_2 = _a.silentFallback,
|
|
9524
9545
|
silentFallback = _2 === void 0 ? false : _2,
|
|
9525
|
-
_3 = _a.
|
|
9526
|
-
|
|
9527
|
-
_4 = _a.
|
|
9528
|
-
|
|
9529
|
-
_5 = _a.
|
|
9530
|
-
|
|
9531
|
-
_6 = _a.
|
|
9532
|
-
|
|
9533
|
-
_7 = _a.
|
|
9534
|
-
|
|
9535
|
-
|
|
9536
|
-
|
|
9537
|
-
|
|
9538
|
-
|
|
9539
|
-
|
|
9540
|
-
|
|
9541
|
-
|
|
9542
|
-
var
|
|
9543
|
-
|
|
9544
|
-
|
|
9545
|
-
|
|
9546
|
-
|
|
9547
|
-
|
|
9548
|
-
|
|
9549
|
-
|
|
9550
|
-
|
|
9551
|
-
|
|
9552
|
-
|
|
9553
|
-
|
|
9554
|
-
|
|
9555
|
-
|
|
9556
|
-
|
|
9557
|
-
|
|
9558
|
-
|
|
9546
|
+
_3 = _a.forceFallbackMode,
|
|
9547
|
+
forceFallbackMode = _3 === void 0 ? false : _3,
|
|
9548
|
+
_4 = _a.allowIdCardBackToFrontCapture,
|
|
9549
|
+
allowIdCardBackToFrontCapture = _4 === void 0 ? false : _4,
|
|
9550
|
+
_5 = _a.assets,
|
|
9551
|
+
assets = _5 === void 0 ? {} : _5,
|
|
9552
|
+
_6 = _a.classNames,
|
|
9553
|
+
classNames = _6 === void 0 ? {} : _6,
|
|
9554
|
+
_7 = _a.colors,
|
|
9555
|
+
colors = _7 === void 0 ? {} : _7,
|
|
9556
|
+
_8 = _a.verbiage,
|
|
9557
|
+
verbiage = _8 === void 0 ? {} : _8,
|
|
9558
|
+
_9 = _a.debugMode,
|
|
9559
|
+
debugMode = _9 === void 0 ? false : _9;
|
|
9560
|
+
var _10 = useIdCaptureState(),
|
|
9561
|
+
state = _10[0],
|
|
9562
|
+
dispatch = _10[1];
|
|
9563
|
+
var _11 = useContext(CameraStateContext),
|
|
9564
|
+
cameraAccessDenied = _11.cameraAccessDenied,
|
|
9565
|
+
requestCameraAccess = _11.requestCameraAccess,
|
|
9566
|
+
releaseCameraAccess = _11.releaseCameraAccess;
|
|
9567
|
+
var _12 = useState(false),
|
|
9568
|
+
overlayDismissed = _12[0],
|
|
9569
|
+
setOverlayDismissed = _12[1];
|
|
9570
|
+
var _13 = useContext(SubmissionContext),
|
|
9571
|
+
submissionStatus = _13.submissionStatus,
|
|
9572
|
+
setIdFrontImage = _13.setIdFrontImage,
|
|
9573
|
+
setIdBackImage = _13.setIdBackImage,
|
|
9574
|
+
setPassportImage = _13.setPassportImage,
|
|
9575
|
+
logIdFrontCaptureAttempt = _13.logIdFrontCaptureAttempt,
|
|
9576
|
+
logIdBackCaptureAttempt = _13.logIdBackCaptureAttempt;
|
|
9577
|
+
var _14 = useContext(IdCaptureModelsContext),
|
|
9578
|
+
start = _14.start,
|
|
9579
|
+
stop = _14.stop,
|
|
9580
|
+
onPredictionMade = _14.onPredictionMade,
|
|
9581
|
+
setRequiredDocumentType = _14.setRequiredDocumentType,
|
|
9582
|
+
modelError = _14.modelError,
|
|
9583
|
+
resetBestFrame = _14.resetBestFrame;
|
|
9559
9584
|
useEffect(function () {
|
|
9560
9585
|
dispatch({
|
|
9561
9586
|
type: 'configureWizard',
|
|
9562
9587
|
payload: {
|
|
9563
9588
|
captureRequirement: captureRequirement,
|
|
9564
|
-
precapturedDocuments: precapturedDocuments
|
|
9589
|
+
precapturedDocuments: precapturedDocuments,
|
|
9590
|
+
allowIdCardBackToFrontCapture: allowIdCardBackToFrontCapture
|
|
9565
9591
|
}
|
|
9566
9592
|
});
|
|
9567
|
-
}, [captureRequirement, dispatch, precapturedDocuments]);
|
|
9593
|
+
}, [allowIdCardBackToFrontCapture, captureRequirement, dispatch, precapturedDocuments]);
|
|
9568
9594
|
var documentCount = Object.keys(state.capturedDocuments).length;
|
|
9569
9595
|
useEffect(function () {
|
|
9570
9596
|
documentCount && resetBestFrame();
|
|
@@ -9591,7 +9617,7 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
9591
9617
|
}
|
|
9592
9618
|
});
|
|
9593
9619
|
} else if (state.captureState === 'requestingFlip') {
|
|
9594
|
-
if (prediction.
|
|
9620
|
+
if (state.requestedDocumentType !== 'selfie' && prediction["".concat(state.requestedDocumentType, "DetectionThresholdMet")]) {
|
|
9595
9621
|
resetBestFrame();
|
|
9596
9622
|
dispatch({
|
|
9597
9623
|
type: 'flipRequestCompleted'
|
|
@@ -9599,7 +9625,7 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
9599
9625
|
}
|
|
9600
9626
|
}
|
|
9601
9627
|
});
|
|
9602
|
-
}, [dispatch, onPredictionMade, resetBestFrame, state.captureState]);
|
|
9628
|
+
}, [dispatch, onPredictionMade, resetBestFrame, state.captureState, state.requestedDocumentType]);
|
|
9603
9629
|
useEffect(function () {
|
|
9604
9630
|
if (state.captureState === 'complete') stop();
|
|
9605
9631
|
}, [state.captureState, stop]);
|
|
@@ -9644,9 +9670,9 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
9644
9670
|
type: 'resetWizard'
|
|
9645
9671
|
});
|
|
9646
9672
|
}, [dispatch]);
|
|
9647
|
-
var
|
|
9648
|
-
attempt =
|
|
9649
|
-
setAttempt =
|
|
9673
|
+
var _15 = useState(0),
|
|
9674
|
+
attempt = _15[0],
|
|
9675
|
+
setAttempt = _15[1];
|
|
9650
9676
|
var onExit = useCallback(function () {
|
|
9651
9677
|
releaseCameraAccess();
|
|
9652
9678
|
setOverlayDismissed(false);
|
|
@@ -9689,7 +9715,7 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
9689
9715
|
var idCaptureVerbiages = {
|
|
9690
9716
|
idCardFront: useTranslations(verbiage.idCardFront, {
|
|
9691
9717
|
instructionText: 'Scan the front of ID',
|
|
9692
|
-
processingIdCardText:
|
|
9718
|
+
processingIdCardText: "ID card ".concat('idCardFront' in state.capturedDocuments ? 'front' : 'back', " captured.")
|
|
9693
9719
|
}),
|
|
9694
9720
|
idCardBack: useTranslations(verbiage.idCardBack, {
|
|
9695
9721
|
instructionText: 'Scan the back of ID'
|
|
@@ -9699,12 +9725,12 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
9699
9725
|
})
|
|
9700
9726
|
};
|
|
9701
9727
|
var theme = useTheme();
|
|
9702
|
-
var
|
|
9703
|
-
guideRectX =
|
|
9704
|
-
guideRectY =
|
|
9705
|
-
guideRectWidth =
|
|
9706
|
-
guideRectHeight =
|
|
9707
|
-
imageUrl =
|
|
9728
|
+
var _16 = useIdCaptureState()[0],
|
|
9729
|
+
guideRectX = _16.guideRectX,
|
|
9730
|
+
guideRectY = _16.guideRectY,
|
|
9731
|
+
guideRectWidth = _16.guideRectWidth,
|
|
9732
|
+
guideRectHeight = _16.guideRectHeight,
|
|
9733
|
+
imageUrl = _16.imageUrl;
|
|
9708
9734
|
var idCaptureAssets = assets[state.requestedDocumentType];
|
|
9709
9735
|
var idCaptureVerbiage = idCaptureVerbiages[state.requestedDocumentType];
|
|
9710
9736
|
useEffect(function () {
|
|
@@ -9758,8 +9784,7 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
9758
9784
|
});
|
|
9759
9785
|
});
|
|
9760
9786
|
}, [dispatch]);
|
|
9761
|
-
|
|
9762
|
-
if (modelError) {
|
|
9787
|
+
if (forceFallbackMode || modelError) {
|
|
9763
9788
|
return /*#__PURE__*/React__default.createElement(IdCaptureFallback, {
|
|
9764
9789
|
idCaptureRequirement: captureRequirement,
|
|
9765
9790
|
onFinished: onSubmitClick,
|
|
@@ -9797,7 +9822,8 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
9797
9822
|
classNames: classNames,
|
|
9798
9823
|
assets: idCaptureAssets,
|
|
9799
9824
|
colors: colors,
|
|
9800
|
-
verbiage: idCaptureVerbiage
|
|
9825
|
+
verbiage: idCaptureVerbiage,
|
|
9826
|
+
isBackToFront: state.allowIdCardBackToFrontCapture && 'idCardBack' in state.capturedDocuments
|
|
9801
9827
|
}), !((_d = (_c = theme.idCapture) === null || _c === void 0 ? void 0 : _c.capturePreview) === null || _d === void 0 ? void 0 : _d.disabled) && state.captureState === 'requestingFlip' && !separateIdCardCaptureSequence && imageUrl && ( /*#__PURE__*/React__default.createElement(IdCaptureImagePreview, {
|
|
9802
9828
|
classNames: (_e = classNames.capture) === null || _e === void 0 ? void 0 : _e.imagePreview,
|
|
9803
9829
|
text: (_f = idCaptureVerbiages === null || idCaptureVerbiages === void 0 ? void 0 : idCaptureVerbiages.idCardFront) === null || _f === void 0 ? void 0 : _f.processingIdCardText,
|
|
@@ -13939,6 +13965,10 @@ var IdValidation = function IdValidation(_a) {
|
|
|
13939
13965
|
rotateLoadingOverlayImageWhenPortrait = _k === void 0 ? true : _k,
|
|
13940
13966
|
_l = _a.modelLoadTimeoutMs,
|
|
13941
13967
|
modelLoadTimeoutMs = _l === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _l,
|
|
13968
|
+
_m = _a.forceFallbackMode,
|
|
13969
|
+
forceFallbackMode = _m === void 0 ? false : _m,
|
|
13970
|
+
_o = _a.allowIdCardBackToFrontCapture,
|
|
13971
|
+
allowIdCardBackToFrontCapture = _o === void 0 ? false : _o,
|
|
13942
13972
|
onBeforeSubmit = _a.onBeforeSubmit,
|
|
13943
13973
|
onBeforeDocumentUpload = _a.onBeforeDocumentUpload,
|
|
13944
13974
|
onDocumentUploadProgress = _a.onDocumentUploadProgress,
|
|
@@ -13952,28 +13982,28 @@ var IdValidation = function IdValidation(_a) {
|
|
|
13952
13982
|
onUserCancel = _a.onUserCancel,
|
|
13953
13983
|
onModelError = _a.onModelError,
|
|
13954
13984
|
onCameraAccessDenied = _a.onCameraAccessDenied,
|
|
13955
|
-
|
|
13956
|
-
theme =
|
|
13957
|
-
|
|
13958
|
-
assets =
|
|
13959
|
-
|
|
13960
|
-
classNames =
|
|
13961
|
-
|
|
13962
|
-
colors =
|
|
13963
|
-
|
|
13964
|
-
verbiage =
|
|
13965
|
-
|
|
13966
|
-
captureSignature =
|
|
13967
|
-
|
|
13968
|
-
captureSignatureVideo =
|
|
13969
|
-
|
|
13970
|
-
captureAdditionalDocuments =
|
|
13971
|
-
|
|
13972
|
-
geolocationEnabled =
|
|
13973
|
-
|
|
13974
|
-
geolocationRequired =
|
|
13975
|
-
|
|
13976
|
-
debugMode =
|
|
13985
|
+
_p = _a.theme,
|
|
13986
|
+
theme = _p === void 0 ? 'default' : _p,
|
|
13987
|
+
_q = _a.assets,
|
|
13988
|
+
assets = _q === void 0 ? {} : _q,
|
|
13989
|
+
_r = _a.classNames,
|
|
13990
|
+
classNames = _r === void 0 ? {} : _r,
|
|
13991
|
+
_s = _a.colors,
|
|
13992
|
+
colors = _s === void 0 ? {} : _s,
|
|
13993
|
+
_t = _a.verbiage,
|
|
13994
|
+
verbiage = _t === void 0 ? {} : _t,
|
|
13995
|
+
_u = _a.captureSignature,
|
|
13996
|
+
captureSignature = _u === void 0 ? false : _u,
|
|
13997
|
+
_v = _a.captureSignatureVideo,
|
|
13998
|
+
captureSignatureVideo = _v === void 0 ? false : _v,
|
|
13999
|
+
_w = _a.captureAdditionalDocuments,
|
|
14000
|
+
captureAdditionalDocuments = _w === void 0 ? [] : _w,
|
|
14001
|
+
_x = _a.geolocationEnabled,
|
|
14002
|
+
geolocationEnabled = _x === void 0 ? true : _x,
|
|
14003
|
+
_y = _a.geolocationRequired,
|
|
14004
|
+
geolocationRequired = _y === void 0 ? false : _y,
|
|
14005
|
+
_z = _a.debugMode,
|
|
14006
|
+
debugMode = _z === void 0 ? false : _z;
|
|
13977
14007
|
useLanguage(lang);
|
|
13978
14008
|
useDebugLogging(debugMode);
|
|
13979
14009
|
var idCaptureProps = useMemo(function () {
|
|
@@ -13987,6 +14017,8 @@ var IdValidation = function IdValidation(_a) {
|
|
|
13987
14017
|
thresholds: idCaptureThresholds,
|
|
13988
14018
|
skipSuccessScreen: skipSuccessScreen,
|
|
13989
14019
|
loadingOverlayMode: loadingOverlayMode,
|
|
14020
|
+
forceFallbackMode: forceFallbackMode,
|
|
14021
|
+
allowIdCardBackToFrontCapture: allowIdCardBackToFrontCapture,
|
|
13990
14022
|
instructions: instructions,
|
|
13991
14023
|
guideType: guideType,
|
|
13992
14024
|
portraitGuidesOnMobile: portraitGuidesOnMobile,
|
|
@@ -13998,7 +14030,7 @@ var IdValidation = function IdValidation(_a) {
|
|
|
13998
14030
|
verbiage: verbiage,
|
|
13999
14031
|
debugMode: debugMode
|
|
14000
14032
|
};
|
|
14001
|
-
}, [onExitCapture, onUserCancel, onModelError, precapturedDocuments, idCaptureRequirement, separateIdCardCaptureSequence, idCaptureThresholds, skipSuccessScreen, loadingOverlayMode, instructions, guideType, portraitGuidesOnMobile, rotateLoadingOverlayImageWhenPortrait, modelLoadTimeoutMs, assets, classNames, colors, verbiage, debugMode]);
|
|
14033
|
+
}, [onExitCapture, onUserCancel, onModelError, precapturedDocuments, idCaptureRequirement, separateIdCardCaptureSequence, idCaptureThresholds, skipSuccessScreen, loadingOverlayMode, forceFallbackMode, allowIdCardBackToFrontCapture, instructions, guideType, portraitGuidesOnMobile, rotateLoadingOverlayImageWhenPortrait, modelLoadTimeoutMs, assets, classNames, colors, verbiage, debugMode]);
|
|
14002
14034
|
var additionalDocumentCaptureProps = useMemo(function () {
|
|
14003
14035
|
return {
|
|
14004
14036
|
documents: captureAdditionalDocuments,
|