idmission-web-sdk 2.1.17 → 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 +2 -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 +2 -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 +118 -90
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +118 -90
- 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
|
@@ -98,6 +98,8 @@ export interface IdValidationProps extends PropsWithChildren {
|
|
|
98
98
|
modelLoadTimeoutMs?: number;
|
|
99
99
|
/** Boolean to indicate whether to force the fallback mode even if the ID capture models are available. Defaults to `false`. */
|
|
100
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;
|
|
101
103
|
/** Object to allow documents that have been previously captured to be submitted. Valid keys: `idCardFront`, `idCardBack`, `passport`.*/
|
|
102
104
|
precapturedDocuments?: CapturedDocuments;
|
|
103
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';
|
|
@@ -64,10 +64,11 @@ export type IdCaptureWizardProps = {
|
|
|
64
64
|
rotateLoadingOverlayImageWhenPortrait?: boolean;
|
|
65
65
|
silentFallback?: boolean;
|
|
66
66
|
forceFallbackMode?: boolean;
|
|
67
|
+
allowIdCardBackToFrontCapture?: boolean;
|
|
67
68
|
assets?: IdCaptureWizardAssets;
|
|
68
69
|
classNames?: IdCaptureWizardClassNames;
|
|
69
70
|
colors?: IdCaptureWizardColors;
|
|
70
71
|
verbiage?: IdCaptureWizardVerbiage;
|
|
71
72
|
debugMode?: boolean;
|
|
72
73
|
};
|
|
73
|
-
export declare const IdCaptureWizard: ({ onSuccess, onExitCapture, onUserCancel, loadingOverlayMode, precapturedDocuments, captureRequirement, separateIdCardCaptureSequence, thresholds, skipSuccessScreen, instructions, releaseCameraAccessOnExit, guideType, portraitGuidesOnMobile, rotateLoadingOverlayImageWhenPortrait, silentFallback, forceFallbackMode, 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,
|
|
@@ -9524,49 +9545,52 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
9524
9545
|
silentFallback = _2 === void 0 ? false : _2,
|
|
9525
9546
|
_3 = _a.forceFallbackMode,
|
|
9526
9547
|
forceFallbackMode = _3 === void 0 ? false : _3,
|
|
9527
|
-
_4 = _a.
|
|
9528
|
-
|
|
9529
|
-
_5 = _a.
|
|
9530
|
-
|
|
9531
|
-
_6 = _a.
|
|
9532
|
-
|
|
9533
|
-
_7 = _a.
|
|
9534
|
-
|
|
9535
|
-
_8 = _a.
|
|
9536
|
-
|
|
9537
|
-
|
|
9538
|
-
|
|
9539
|
-
|
|
9540
|
-
|
|
9541
|
-
|
|
9542
|
-
|
|
9543
|
-
|
|
9544
|
-
|
|
9545
|
-
|
|
9546
|
-
|
|
9547
|
-
|
|
9548
|
-
|
|
9549
|
-
|
|
9550
|
-
|
|
9551
|
-
|
|
9552
|
-
|
|
9553
|
-
|
|
9554
|
-
|
|
9555
|
-
|
|
9556
|
-
|
|
9557
|
-
|
|
9558
|
-
|
|
9559
|
-
|
|
9560
|
-
|
|
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;
|
|
9561
9584
|
useEffect(function () {
|
|
9562
9585
|
dispatch({
|
|
9563
9586
|
type: 'configureWizard',
|
|
9564
9587
|
payload: {
|
|
9565
9588
|
captureRequirement: captureRequirement,
|
|
9566
|
-
precapturedDocuments: precapturedDocuments
|
|
9589
|
+
precapturedDocuments: precapturedDocuments,
|
|
9590
|
+
allowIdCardBackToFrontCapture: allowIdCardBackToFrontCapture
|
|
9567
9591
|
}
|
|
9568
9592
|
});
|
|
9569
|
-
}, [captureRequirement, dispatch, precapturedDocuments]);
|
|
9593
|
+
}, [allowIdCardBackToFrontCapture, captureRequirement, dispatch, precapturedDocuments]);
|
|
9570
9594
|
var documentCount = Object.keys(state.capturedDocuments).length;
|
|
9571
9595
|
useEffect(function () {
|
|
9572
9596
|
documentCount && resetBestFrame();
|
|
@@ -9593,7 +9617,7 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
9593
9617
|
}
|
|
9594
9618
|
});
|
|
9595
9619
|
} else if (state.captureState === 'requestingFlip') {
|
|
9596
|
-
if (prediction.
|
|
9620
|
+
if (state.requestedDocumentType !== 'selfie' && prediction["".concat(state.requestedDocumentType, "DetectionThresholdMet")]) {
|
|
9597
9621
|
resetBestFrame();
|
|
9598
9622
|
dispatch({
|
|
9599
9623
|
type: 'flipRequestCompleted'
|
|
@@ -9601,7 +9625,7 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
9601
9625
|
}
|
|
9602
9626
|
}
|
|
9603
9627
|
});
|
|
9604
|
-
}, [dispatch, onPredictionMade, resetBestFrame, state.captureState]);
|
|
9628
|
+
}, [dispatch, onPredictionMade, resetBestFrame, state.captureState, state.requestedDocumentType]);
|
|
9605
9629
|
useEffect(function () {
|
|
9606
9630
|
if (state.captureState === 'complete') stop();
|
|
9607
9631
|
}, [state.captureState, stop]);
|
|
@@ -9646,9 +9670,9 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
9646
9670
|
type: 'resetWizard'
|
|
9647
9671
|
});
|
|
9648
9672
|
}, [dispatch]);
|
|
9649
|
-
var
|
|
9650
|
-
attempt =
|
|
9651
|
-
setAttempt =
|
|
9673
|
+
var _15 = useState(0),
|
|
9674
|
+
attempt = _15[0],
|
|
9675
|
+
setAttempt = _15[1];
|
|
9652
9676
|
var onExit = useCallback(function () {
|
|
9653
9677
|
releaseCameraAccess();
|
|
9654
9678
|
setOverlayDismissed(false);
|
|
@@ -9691,7 +9715,7 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
9691
9715
|
var idCaptureVerbiages = {
|
|
9692
9716
|
idCardFront: useTranslations(verbiage.idCardFront, {
|
|
9693
9717
|
instructionText: 'Scan the front of ID',
|
|
9694
|
-
processingIdCardText:
|
|
9718
|
+
processingIdCardText: "ID card ".concat('idCardFront' in state.capturedDocuments ? 'front' : 'back', " captured.")
|
|
9695
9719
|
}),
|
|
9696
9720
|
idCardBack: useTranslations(verbiage.idCardBack, {
|
|
9697
9721
|
instructionText: 'Scan the back of ID'
|
|
@@ -9701,12 +9725,12 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
9701
9725
|
})
|
|
9702
9726
|
};
|
|
9703
9727
|
var theme = useTheme();
|
|
9704
|
-
var
|
|
9705
|
-
guideRectX =
|
|
9706
|
-
guideRectY =
|
|
9707
|
-
guideRectWidth =
|
|
9708
|
-
guideRectHeight =
|
|
9709
|
-
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;
|
|
9710
9734
|
var idCaptureAssets = assets[state.requestedDocumentType];
|
|
9711
9735
|
var idCaptureVerbiage = idCaptureVerbiages[state.requestedDocumentType];
|
|
9712
9736
|
useEffect(function () {
|
|
@@ -9798,7 +9822,8 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
9798
9822
|
classNames: classNames,
|
|
9799
9823
|
assets: idCaptureAssets,
|
|
9800
9824
|
colors: colors,
|
|
9801
|
-
verbiage: idCaptureVerbiage
|
|
9825
|
+
verbiage: idCaptureVerbiage,
|
|
9826
|
+
isBackToFront: state.allowIdCardBackToFrontCapture && 'idCardBack' in state.capturedDocuments
|
|
9802
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, {
|
|
9803
9828
|
classNames: (_e = classNames.capture) === null || _e === void 0 ? void 0 : _e.imagePreview,
|
|
9804
9829
|
text: (_f = idCaptureVerbiages === null || idCaptureVerbiages === void 0 ? void 0 : idCaptureVerbiages.idCardFront) === null || _f === void 0 ? void 0 : _f.processingIdCardText,
|
|
@@ -13942,6 +13967,8 @@ var IdValidation = function IdValidation(_a) {
|
|
|
13942
13967
|
modelLoadTimeoutMs = _l === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _l,
|
|
13943
13968
|
_m = _a.forceFallbackMode,
|
|
13944
13969
|
forceFallbackMode = _m === void 0 ? false : _m,
|
|
13970
|
+
_o = _a.allowIdCardBackToFrontCapture,
|
|
13971
|
+
allowIdCardBackToFrontCapture = _o === void 0 ? false : _o,
|
|
13945
13972
|
onBeforeSubmit = _a.onBeforeSubmit,
|
|
13946
13973
|
onBeforeDocumentUpload = _a.onBeforeDocumentUpload,
|
|
13947
13974
|
onDocumentUploadProgress = _a.onDocumentUploadProgress,
|
|
@@ -13955,28 +13982,28 @@ var IdValidation = function IdValidation(_a) {
|
|
|
13955
13982
|
onUserCancel = _a.onUserCancel,
|
|
13956
13983
|
onModelError = _a.onModelError,
|
|
13957
13984
|
onCameraAccessDenied = _a.onCameraAccessDenied,
|
|
13958
|
-
|
|
13959
|
-
theme =
|
|
13960
|
-
|
|
13961
|
-
assets =
|
|
13962
|
-
|
|
13963
|
-
classNames =
|
|
13964
|
-
|
|
13965
|
-
colors =
|
|
13966
|
-
|
|
13967
|
-
verbiage =
|
|
13968
|
-
|
|
13969
|
-
captureSignature =
|
|
13970
|
-
|
|
13971
|
-
captureSignatureVideo =
|
|
13972
|
-
|
|
13973
|
-
captureAdditionalDocuments =
|
|
13974
|
-
|
|
13975
|
-
geolocationEnabled =
|
|
13976
|
-
|
|
13977
|
-
geolocationRequired =
|
|
13978
|
-
|
|
13979
|
-
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;
|
|
13980
14007
|
useLanguage(lang);
|
|
13981
14008
|
useDebugLogging(debugMode);
|
|
13982
14009
|
var idCaptureProps = useMemo(function () {
|
|
@@ -13991,6 +14018,7 @@ var IdValidation = function IdValidation(_a) {
|
|
|
13991
14018
|
skipSuccessScreen: skipSuccessScreen,
|
|
13992
14019
|
loadingOverlayMode: loadingOverlayMode,
|
|
13993
14020
|
forceFallbackMode: forceFallbackMode,
|
|
14021
|
+
allowIdCardBackToFrontCapture: allowIdCardBackToFrontCapture,
|
|
13994
14022
|
instructions: instructions,
|
|
13995
14023
|
guideType: guideType,
|
|
13996
14024
|
portraitGuidesOnMobile: portraitGuidesOnMobile,
|
|
@@ -14002,7 +14030,7 @@ var IdValidation = function IdValidation(_a) {
|
|
|
14002
14030
|
verbiage: verbiage,
|
|
14003
14031
|
debugMode: debugMode
|
|
14004
14032
|
};
|
|
14005
|
-
}, [onExitCapture, onUserCancel, onModelError, precapturedDocuments, idCaptureRequirement, separateIdCardCaptureSequence, idCaptureThresholds, skipSuccessScreen, loadingOverlayMode, forceFallbackMode, 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]);
|
|
14006
14034
|
var additionalDocumentCaptureProps = useMemo(function () {
|
|
14007
14035
|
return {
|
|
14008
14036
|
documents: captureAdditionalDocuments,
|