idmission-web-sdk 2.6.3-changeset-release-develop-eac763c → 2.6.3-changeset-release-develop-776f131
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/index.d.ts +1 -1
- package/dist/props.json +1 -1
- package/dist/sdk2.cjs.development.js +935 -386
- 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 +935 -386
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +935 -386
- 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/package.json +1 -1
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
// Extracted from the barrel so modules inside this package can read the
|
|
27
27
|
// version without importing index.ts (which would be circular).
|
|
28
|
-
var webSdkUiVersion = '0.
|
|
28
|
+
var webSdkUiVersion = '0.6.0';
|
|
29
29
|
|
|
30
30
|
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
31
31
|
try {
|
|
@@ -491,7 +491,7 @@
|
|
|
491
491
|
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray$C(r) || _nonIterableSpread();
|
|
492
492
|
}
|
|
493
493
|
|
|
494
|
-
var webSdkCoreVersion = '0.
|
|
494
|
+
var webSdkCoreVersion = '0.6.0';
|
|
495
495
|
|
|
496
496
|
var maxTime = 86400000;
|
|
497
497
|
var maxCount = 1000000;
|
|
@@ -5559,6 +5559,21 @@
|
|
|
5559
5559
|
if (taskID) merged.taskid = taskID;
|
|
5560
5560
|
return merged;
|
|
5561
5561
|
}
|
|
5562
|
+
/**
|
|
5563
|
+
* Runs a customer callback whose failure must not change an outcome that is
|
|
5564
|
+
* already settled: a throw or a rejected promise is logged, never rethrown.
|
|
5565
|
+
*/
|
|
5566
|
+
function notifySafely$1(name, notify) {
|
|
5567
|
+
try {
|
|
5568
|
+
// `Promise.resolve`, not `instanceof Promise`: a promise from another
|
|
5569
|
+
// realm (an iframe) fails that check, and its rejection would go unhandled.
|
|
5570
|
+
Promise.resolve(notify())["catch"](function (e) {
|
|
5571
|
+
return warn$2(name + " rejected", e);
|
|
5572
|
+
});
|
|
5573
|
+
} catch (e) {
|
|
5574
|
+
warn$2(name + " threw", e);
|
|
5575
|
+
}
|
|
5576
|
+
}
|
|
5562
5577
|
/**
|
|
5563
5578
|
* How long an async `sessionId` resolver may take. It typically mints the
|
|
5564
5579
|
* session through the host's own backend (an OAuth token, then
|
|
@@ -5581,6 +5596,10 @@
|
|
|
5581
5596
|
return clearTimeout(timer);
|
|
5582
5597
|
});
|
|
5583
5598
|
}
|
|
5599
|
+
/**
|
|
5600
|
+
* Creates a client. Its type is `Required<IdmissionClient>`: unlike a
|
|
5601
|
+
* hand-written `IdmissionClient`, it always has `post()` and `handoff()`.
|
|
5602
|
+
*/
|
|
5584
5603
|
function createIdmissionClient(config) {
|
|
5585
5604
|
var _config$fetch, _config$now;
|
|
5586
5605
|
// `let`: when config.sessionId is an async resolver, the session URN (and
|
|
@@ -5631,7 +5650,10 @@
|
|
|
5631
5650
|
var livenessToken;
|
|
5632
5651
|
function timedFetch(_x, _x2) {
|
|
5633
5652
|
return _timedFetch.apply(this, arguments);
|
|
5634
|
-
}
|
|
5653
|
+
} // The attestation nonce THIS client's session was validated with. The
|
|
5654
|
+
// holders are module-level, so another client validating later replaces
|
|
5655
|
+
// them; comparing against this, not against whatever the holder says at
|
|
5656
|
+
// submit time, is what keeps that client's nonce off this client's request.
|
|
5635
5657
|
function _timedFetch() {
|
|
5636
5658
|
_timedFetch = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(url, init) {
|
|
5637
5659
|
var controller, timer;
|
|
@@ -5667,10 +5689,35 @@
|
|
|
5667
5689
|
}));
|
|
5668
5690
|
return _timedFetch.apply(this, arguments);
|
|
5669
5691
|
}
|
|
5670
|
-
|
|
5671
|
-
|
|
5672
|
-
|
|
5692
|
+
var validatedSessionNonce = null;
|
|
5693
|
+
function currentRoute() {
|
|
5694
|
+
return {
|
|
5673
5695
|
sessionId: store.getState().session.sessionId,
|
|
5696
|
+
submissionUrl: urls.submissionUrl,
|
|
5697
|
+
documentServiceUrl: urls.documentServiceUrl,
|
|
5698
|
+
sessionNonce: validatedSessionNonce
|
|
5699
|
+
};
|
|
5700
|
+
}
|
|
5701
|
+
// The attestation holders are module-level and follow the newest
|
|
5702
|
+
// ValidateSession, from any client. If they no longer hold this operation's
|
|
5703
|
+
// session nonce, the nonce and OS token belong to someone else: omit the
|
|
5704
|
+
// envelope (throwing here is
|
|
5705
|
+
// attachMetadataToRequest's fail-open path, which reports
|
|
5706
|
+
// `attestationAttached: false`) rather than attach a stranger's.
|
|
5707
|
+
function routeBoundCollectors(route) {
|
|
5708
|
+
return {
|
|
5709
|
+
collectAttestation: function collectAttestation(web, versions) {
|
|
5710
|
+
if (getLastSessionNonce() !== route.sessionNonce) {
|
|
5711
|
+
throw new Error('session changed during submission; attestation omitted');
|
|
5712
|
+
}
|
|
5713
|
+
return collectClientAttestation(web, versions);
|
|
5714
|
+
}
|
|
5715
|
+
};
|
|
5716
|
+
}
|
|
5717
|
+
function performUpload(blob, metadata, route) {
|
|
5718
|
+
return uploadDocument(blob, metadata, {
|
|
5719
|
+
documentServiceUrl: route.documentServiceUrl,
|
|
5720
|
+
sessionId: route.sessionId,
|
|
5674
5721
|
Upload: config.tusUpload,
|
|
5675
5722
|
delay: config.delay,
|
|
5676
5723
|
calculateMd5: config.calculateMd5,
|
|
@@ -5722,7 +5769,7 @@
|
|
|
5722
5769
|
}
|
|
5723
5770
|
function _runSessionValidation() {
|
|
5724
5771
|
_runSessionValidation = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(epoch) {
|
|
5725
|
-
var authUrl, adoptSessionUrls, resolvedSessionId, err, valid, finalState, _err, _t, _t2;
|
|
5772
|
+
var authUrl, adoptSessionUrls, resolvedSessionId, err, responseNonce, valid, finalState, _err, _t, _t2;
|
|
5726
5773
|
return _regeneratorRuntime.wrap(function (_context3) {
|
|
5727
5774
|
while (1) switch (_context3.prev = _context3.next) {
|
|
5728
5775
|
case 0:
|
|
@@ -5817,14 +5864,22 @@
|
|
|
5817
5864
|
payload: 'RUNNING'
|
|
5818
5865
|
});
|
|
5819
5866
|
_context3.prev = 8;
|
|
5867
|
+
// The nonce THIS response carried, taken as it is ingested: reading
|
|
5868
|
+
// the shared holder after the await could pick up another client's.
|
|
5869
|
+
responseNonce = null;
|
|
5820
5870
|
_context3.next = 9;
|
|
5821
5871
|
return validateSession(authUrl, resolvedSessionId, {
|
|
5822
5872
|
fetch: config.fetch,
|
|
5823
|
-
delay: config.delay
|
|
5873
|
+
delay: config.delay,
|
|
5874
|
+
ingestNonce: function ingestNonce(nonce) {
|
|
5875
|
+
responseNonce = typeof nonce === 'string' && nonce ? nonce : null;
|
|
5876
|
+
ingestSessionAttestation(nonce);
|
|
5877
|
+
}
|
|
5824
5878
|
});
|
|
5825
5879
|
case 9:
|
|
5826
5880
|
valid = _context3.sent;
|
|
5827
5881
|
finalState = valid ? 'PASSED' : 'FAILED';
|
|
5882
|
+
if (epoch === sessionRunEpoch) validatedSessionNonce = responseNonce;
|
|
5828
5883
|
dispatchSessionIfCurrent(epoch, {
|
|
5829
5884
|
type: 'setCheckState',
|
|
5830
5885
|
payload: finalState
|
|
@@ -5894,23 +5949,28 @@
|
|
|
5894
5949
|
}));
|
|
5895
5950
|
return _retrySession.apply(this, arguments);
|
|
5896
5951
|
}
|
|
5897
|
-
function
|
|
5898
|
-
return
|
|
5952
|
+
function runPipeline(_x6, _x7, _x8) {
|
|
5953
|
+
return _runPipeline.apply(this, arguments);
|
|
5899
5954
|
}
|
|
5900
|
-
function
|
|
5901
|
-
|
|
5902
|
-
var _options$onBeforeSubm;
|
|
5903
|
-
var progress, uploadsInFlight, beforeSubmit, startedAt, payloadBuildStart, payloadBuildEnd, uploadMeasurements, apiCallStart, apiCallEnd, responseParseStart, responseParseEnd, failedAt, _artifacts$id, _artifacts$id2, _artifacts$id3, _artifacts$face,
|
|
5955
|
+
function _runPipeline() {
|
|
5956
|
+
_runPipeline = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(artifacts, options, kind) {
|
|
5957
|
+
var _artifacts$meta$liven, _artifacts$meta, _options$onBeforeSubm;
|
|
5958
|
+
var handsOff, route, claimedLivenessToken, progress, uploadsInFlight, beforeSubmit, startedAt, payloadBuildStart, payloadBuildEnd, uploadMeasurements, apiCallStart, apiCallEnd, responseParseStart, responseParseEnd, failedAt, built, timings, payloadResult, request, _artifacts$id, _artifacts$id2, _artifacts$id3, _artifacts$face, endpoint, submissionResponse, response, _response$statusText, statusMessage, err, endedAt, _built, _response, _request, _t4, _t5, _t6, _t7, _t8, _t9, _t0;
|
|
5904
5959
|
return _regeneratorRuntime.wrap(function (_context7) {
|
|
5905
5960
|
while (1) switch (_context7.prev = _context7.next) {
|
|
5906
5961
|
case 0:
|
|
5907
|
-
|
|
5962
|
+
handsOff = kind === 'handoff' || kind === 'submit' && config.onSubmit !== undefined; // sdk2 short-circuits action NONE to a synthetic success before any
|
|
5963
|
+
// network activity (SubmissionProvider.tsx:1203-1225). This client does
|
|
5964
|
+
// not fabricate that response, but it keeps the "NONE does no network
|
|
5965
|
+
// work" guarantee by rejecting here, before any upload — unless the
|
|
5966
|
+
// request is being handed off, which is the one thing NONE can do.
|
|
5967
|
+
if (!(options.action === SubmissionAction.NONE && !handsOff)) {
|
|
5908
5968
|
_context7.next = 1;
|
|
5909
5969
|
break;
|
|
5910
5970
|
}
|
|
5911
5971
|
throw new SubmissionError({
|
|
5912
5972
|
statusCode: 'UNSUPPORTED_ACTION',
|
|
5913
|
-
statusMessage: "
|
|
5973
|
+
statusMessage: "action 'NONE' has no endpoint to post to; use handoff() to build the request without posting it"
|
|
5914
5974
|
});
|
|
5915
5975
|
case 1:
|
|
5916
5976
|
if (!(store.getState().session.sessionCheckState !== 'PASSED')) {
|
|
@@ -5919,6 +5979,11 @@
|
|
|
5919
5979
|
}
|
|
5920
5980
|
throw new AuthenticationError(401, 'session not validated');
|
|
5921
5981
|
case 2:
|
|
5982
|
+
route = currentRoute(); // Claimed, not read: an overlapping operation must not reuse it, and a
|
|
5983
|
+
// `checkLiveness()` that lands mid-operation keeps its own token for the
|
|
5984
|
+
// next one (SubmissionProvider.tsx:1350 cleared it after the submit).
|
|
5985
|
+
claimedLivenessToken = (_artifacts$meta$liven = (_artifacts$meta = artifacts.meta) == null ? void 0 : _artifacts$meta.livenessToken) != null ? _artifacts$meta$liven : livenessToken;
|
|
5986
|
+
livenessToken = undefined;
|
|
5922
5987
|
store.setState({
|
|
5923
5988
|
submissionStatus: SubmissionStatus.SUBMITTING,
|
|
5924
5989
|
submissionError: undefined
|
|
@@ -5935,7 +6000,7 @@
|
|
|
5935
6000
|
_context7.next = 5;
|
|
5936
6001
|
return buildSubmissionPayload(_extends$1({}, artifacts, {
|
|
5937
6002
|
meta: _extends$1({}, artifacts.meta, {
|
|
5938
|
-
livenessToken:
|
|
6003
|
+
livenessToken: claimedLivenessToken
|
|
5939
6004
|
})
|
|
5940
6005
|
}), _extends$1({}, options, {
|
|
5941
6006
|
onBeforeSubmit: beforeSubmit ? function (request) {
|
|
@@ -5951,7 +6016,7 @@
|
|
|
5951
6016
|
// withJobTaskMetadata (see its own comment above): only present
|
|
5952
6017
|
// when options.jobID/taskID are present.
|
|
5953
6018
|
uploadDocument: documentServiceEnabled ? (/*#__PURE__*/function () {
|
|
5954
|
-
var
|
|
6019
|
+
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(blob, metadata) {
|
|
5955
6020
|
var result, _t3;
|
|
5956
6021
|
return _regeneratorRuntime.wrap(function (_context6) {
|
|
5957
6022
|
while (1) switch (_context6.prev = _context6.next) {
|
|
@@ -5968,7 +6033,7 @@
|
|
|
5968
6033
|
});
|
|
5969
6034
|
_context6.prev = 1;
|
|
5970
6035
|
_context6.next = 2;
|
|
5971
|
-
return performUpload(blob, withJobTaskMetadata(metadata, options.jobID, options.taskID));
|
|
6036
|
+
return performUpload(blob, withJobTaskMetadata(metadata, options.jobID, options.taskID), route);
|
|
5972
6037
|
case 2:
|
|
5973
6038
|
result = _context6.sent;
|
|
5974
6039
|
progress.observe({
|
|
@@ -5998,12 +6063,13 @@
|
|
|
5998
6063
|
}
|
|
5999
6064
|
}, _callee6, null, [[1, 3, 4, 5]]);
|
|
6000
6065
|
}));
|
|
6001
|
-
return function (
|
|
6002
|
-
return
|
|
6066
|
+
return function (_x13, _x14) {
|
|
6067
|
+
return _ref3.apply(this, arguments);
|
|
6003
6068
|
};
|
|
6004
6069
|
}()) : undefined,
|
|
6005
6070
|
now: config.now,
|
|
6006
|
-
sdkVersions: config.sdkVersions
|
|
6071
|
+
sdkVersions: config.sdkVersions,
|
|
6072
|
+
collectors: routeBoundCollectors(route)
|
|
6007
6073
|
});
|
|
6008
6074
|
case 5:
|
|
6009
6075
|
payloadResult = _context7.sent;
|
|
@@ -6017,40 +6083,41 @@
|
|
|
6017
6083
|
case 7:
|
|
6018
6084
|
payloadBuildEnd = payloadResult.uploadTimings.payloadBuildEnd;
|
|
6019
6085
|
uploadMeasurements = payloadResult.uploadTimings.uploads;
|
|
6020
|
-
request = payloadResult.request; // Stashed
|
|
6021
|
-
//
|
|
6022
|
-
// the same setState as the timings would leave `onSubmit` customers
|
|
6023
|
-
// with a timings block and no request to go with it.
|
|
6086
|
+
request = payloadResult.request; // Stashed before the hand-off returns, so hand-off callers get the
|
|
6087
|
+
// request alongside the timings the `finally` records.
|
|
6024
6088
|
store.setState({
|
|
6025
6089
|
attestationAttached: payloadResult.attestationAttached,
|
|
6026
6090
|
lastSubmissionRequest: request
|
|
6027
6091
|
});
|
|
6028
|
-
|
|
6029
|
-
// (SubmissionProvider.tsx:1374-1377, `return onSubmit.current(request)`
|
|
6030
|
-
// before `defaultOnSubmit`), so everything above this line runs and
|
|
6031
|
-
// nothing below it does.
|
|
6032
|
-
//
|
|
6033
|
-
// The status goes to SUBMITTED, where sdk2 leaves it at READY. That is a
|
|
6034
|
-
// deliberate divergence in INTERNAL state to preserve the VISIBLE
|
|
6035
|
-
// behaviour: sdk2's wizard renders an empty fragment for READY via its
|
|
6036
|
-
// switch `default`, whereas this codebase renders the submitting screen
|
|
6037
|
-
// for READY — so inheriting READY would park the user on a spinner
|
|
6038
|
-
// forever. SUBMITTED with no response falls through every terminal
|
|
6039
|
-
// branch to `return null`, which is sdk2's empty fragment.
|
|
6040
|
-
if (!config.onSubmit) {
|
|
6092
|
+
if (!handsOff) {
|
|
6041
6093
|
_context7.next = 8;
|
|
6042
6094
|
break;
|
|
6043
6095
|
}
|
|
6096
|
+
// sdk2 short-circuits at the equivalent point
|
|
6097
|
+
// (SubmissionProvider.tsx:1374-1377), so everything above runs and
|
|
6098
|
+
// nothing below does.
|
|
6099
|
+
//
|
|
6100
|
+
// The status goes to SUBMITTED, where sdk2 leaves it at READY. That is
|
|
6101
|
+
// a deliberate divergence in INTERNAL state to preserve the VISIBLE
|
|
6102
|
+
// behaviour: sdk2's wizard renders an empty fragment for READY via its
|
|
6103
|
+
// switch `default`, whereas this codebase renders the submitting
|
|
6104
|
+
// screen for READY — so inheriting READY would park the user on a
|
|
6105
|
+
// spinner forever. SUBMITTED with no response falls through every
|
|
6106
|
+
// terminal branch to `return null`, which is sdk2's empty fragment.
|
|
6044
6107
|
store.setState({
|
|
6045
6108
|
submissionStatus: SubmissionStatus.SUBMITTED
|
|
6046
6109
|
});
|
|
6047
|
-
config.onSubmit(request);
|
|
6110
|
+
if (kind === 'submit') config.onSubmit == null || config.onSubmit(request);
|
|
6048
6111
|
progress.observe({
|
|
6049
6112
|
kind: 'flow-completed'
|
|
6050
6113
|
});
|
|
6051
|
-
|
|
6114
|
+
built = {
|
|
6115
|
+
request: request,
|
|
6116
|
+
response: null
|
|
6117
|
+
};
|
|
6118
|
+
_context7.next = 23;
|
|
6119
|
+
break;
|
|
6052
6120
|
case 8:
|
|
6053
|
-
sessionId = store.getState().session.sessionId;
|
|
6054
6121
|
endpoint = determineSubmissionEndpoint(options.action, !!((_artifacts$id = artifacts.id) != null && _artifacts$id.frontImage || (_artifacts$id2 = artifacts.id) != null && _artifacts$id2.backImage || (_artifacts$id3 = artifacts.id) != null && _artifacts$id3.passportImage), !!((_artifacts$face = artifacts.face) != null && _artifacts$face.selfieImage));
|
|
6055
6122
|
progress.observe({
|
|
6056
6123
|
kind: 'phase',
|
|
@@ -6065,9 +6132,9 @@
|
|
|
6065
6132
|
_context7.prev = 9;
|
|
6066
6133
|
_context7.prev = 10;
|
|
6067
6134
|
_context7.next = 11;
|
|
6068
|
-
return timedFetch(
|
|
6135
|
+
return timedFetch(route.submissionUrl + endpoint, {
|
|
6069
6136
|
method: 'POST',
|
|
6070
|
-
headers: apiHeaders(sessionId, options.sendBase64DocumentsInSwaggerProxy),
|
|
6137
|
+
headers: apiHeaders(route.sessionId, options.sendBase64DocumentsInSwaggerProxy),
|
|
6071
6138
|
body: JSON.stringify(request)
|
|
6072
6139
|
});
|
|
6073
6140
|
case 11:
|
|
@@ -6157,10 +6224,21 @@
|
|
|
6157
6224
|
progress.observe({
|
|
6158
6225
|
kind: 'flow-completed'
|
|
6159
6226
|
});
|
|
6160
|
-
|
|
6161
|
-
|
|
6227
|
+
// Legacy `submit()` keeps a throwing `onResponseReceived` inside the
|
|
6228
|
+
// failure path, as it always has; `post()` notifies after the outcome
|
|
6229
|
+
// is settled (below).
|
|
6230
|
+
if (kind === 'submit') {
|
|
6231
|
+
config.onResponseReceived == null || config.onResponseReceived(submissionResponse, request);
|
|
6232
|
+
}
|
|
6233
|
+
built = {
|
|
6234
|
+
request: request,
|
|
6235
|
+
response: submissionResponse
|
|
6236
|
+
};
|
|
6162
6237
|
case 23:
|
|
6163
|
-
_context7.
|
|
6238
|
+
_context7.next = 25;
|
|
6239
|
+
break;
|
|
6240
|
+
case 24:
|
|
6241
|
+
_context7.prev = 24;
|
|
6164
6242
|
_t0 = _context7["catch"](3);
|
|
6165
6243
|
if (failedAt === undefined) failedAt = 'submission';
|
|
6166
6244
|
err = _t0;
|
|
@@ -6172,72 +6250,116 @@
|
|
|
6172
6250
|
// UNLIKE sdk2 (`if (throwErrorsOnFailure) throw err`) there is no
|
|
6173
6251
|
// catch-swallow path: rejection always propagates.
|
|
6174
6252
|
throw err;
|
|
6175
|
-
case
|
|
6176
|
-
_context7.prev =
|
|
6177
|
-
// Liveness tokens are single-use: clear after each submit so a stale
|
|
6178
|
-
// token isn't reapplied on a retry (SubmissionProvider.tsx:1350).
|
|
6179
|
-
livenessToken = undefined;
|
|
6253
|
+
case 25:
|
|
6254
|
+
_context7.prev = 25;
|
|
6180
6255
|
endedAt = nowImpl();
|
|
6256
|
+
timings = buildSubmissionTimings({
|
|
6257
|
+
startedAt: startedAt,
|
|
6258
|
+
endedAt: endedAt,
|
|
6259
|
+
payloadBuildStart: payloadBuildStart,
|
|
6260
|
+
payloadBuildEnd: payloadBuildEnd,
|
|
6261
|
+
uploads: uploadMeasurements,
|
|
6262
|
+
apiCallStart: apiCallStart,
|
|
6263
|
+
apiCallEnd: apiCallEnd,
|
|
6264
|
+
responseParseStart: responseParseStart,
|
|
6265
|
+
responseParseEnd: responseParseEnd,
|
|
6266
|
+
failedAt: failedAt
|
|
6267
|
+
});
|
|
6181
6268
|
store.setState({
|
|
6182
|
-
lastSubmissionTimings:
|
|
6183
|
-
startedAt: startedAt,
|
|
6184
|
-
endedAt: endedAt,
|
|
6185
|
-
payloadBuildStart: payloadBuildStart,
|
|
6186
|
-
payloadBuildEnd: payloadBuildEnd,
|
|
6187
|
-
uploads: uploadMeasurements,
|
|
6188
|
-
apiCallStart: apiCallStart,
|
|
6189
|
-
apiCallEnd: apiCallEnd,
|
|
6190
|
-
responseParseStart: responseParseStart,
|
|
6191
|
-
responseParseEnd: responseParseEnd,
|
|
6192
|
-
failedAt: failedAt
|
|
6193
|
-
})
|
|
6269
|
+
lastSubmissionTimings: timings
|
|
6194
6270
|
});
|
|
6195
|
-
return _context7.finish(
|
|
6196
|
-
case
|
|
6271
|
+
return _context7.finish(25);
|
|
6272
|
+
case 26:
|
|
6273
|
+
if (kind === 'post' && built.response) {
|
|
6274
|
+
_built = built, _response = _built.response, _request = _built.request;
|
|
6275
|
+
notifySafely$1('onResponseReceived', function () {
|
|
6276
|
+
return config.onResponseReceived == null ? void 0 : config.onResponseReceived(_response, _request);
|
|
6277
|
+
});
|
|
6278
|
+
}
|
|
6279
|
+
return _context7.abrupt("return", _extends$1({}, built, {
|
|
6280
|
+
timings: timings
|
|
6281
|
+
}));
|
|
6282
|
+
case 27:
|
|
6197
6283
|
case "end":
|
|
6198
6284
|
return _context7.stop();
|
|
6199
6285
|
}
|
|
6200
|
-
}, _callee7, null, [[3,
|
|
6286
|
+
}, _callee7, null, [[3, 24, 25, 26], [4, 6], [9, 20], [10, 12]]);
|
|
6201
6287
|
}));
|
|
6202
|
-
return
|
|
6288
|
+
return _runPipeline.apply(this, arguments);
|
|
6289
|
+
}
|
|
6290
|
+
function submit(artifacts, options) {
|
|
6291
|
+
return runPipeline(artifacts, options, 'submit').then(function (_ref2) {
|
|
6292
|
+
var response = _ref2.response;
|
|
6293
|
+
return response;
|
|
6294
|
+
});
|
|
6295
|
+
}
|
|
6296
|
+
function post(artifacts, options) {
|
|
6297
|
+
return runPipeline(artifacts, options, 'post');
|
|
6203
6298
|
}
|
|
6204
|
-
function
|
|
6299
|
+
function handoff(_x9, _x0) {
|
|
6300
|
+
return _handoff.apply(this, arguments);
|
|
6301
|
+
}
|
|
6302
|
+
function _handoff() {
|
|
6303
|
+
_handoff = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(artifacts, options) {
|
|
6304
|
+
var _yield$runPipeline, request, timings;
|
|
6305
|
+
return _regeneratorRuntime.wrap(function (_context8) {
|
|
6306
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
6307
|
+
case 0:
|
|
6308
|
+
_context8.next = 1;
|
|
6309
|
+
return runPipeline(artifacts, options, 'handoff');
|
|
6310
|
+
case 1:
|
|
6311
|
+
_yield$runPipeline = _context8.sent;
|
|
6312
|
+
request = _yield$runPipeline.request;
|
|
6313
|
+
timings = _yield$runPipeline.timings;
|
|
6314
|
+
return _context8.abrupt("return", {
|
|
6315
|
+
request: request,
|
|
6316
|
+
timings: timings
|
|
6317
|
+
});
|
|
6318
|
+
case 2:
|
|
6319
|
+
case "end":
|
|
6320
|
+
return _context8.stop();
|
|
6321
|
+
}
|
|
6322
|
+
}, _callee8);
|
|
6323
|
+
}));
|
|
6324
|
+
return _handoff.apply(this, arguments);
|
|
6325
|
+
}
|
|
6326
|
+
function checkLiveness(_x1, _x10) {
|
|
6205
6327
|
return _checkLiveness.apply(this, arguments);
|
|
6206
6328
|
}
|
|
6207
6329
|
function _checkLiveness() {
|
|
6208
|
-
_checkLiveness = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
6330
|
+
_checkLiveness = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9(imageDataUrl, options) {
|
|
6209
6331
|
var _options$metadata$sel, _options$metadata, _options$metadata$idF, _options$metadata2, _options$metadata$idB, _options$metadata3, _options$metadata$bar, _options$metadata4, _options$metadata5, _options$metadata$geo, _options$metadata6, _livenessResponse$res, _livenessResponse$res2, selfie, request, _attachMetadataToRequ, attestationAttached, result, endpoint, sessionId, response, statusMessage, livenessResponse, _livenessResponse$res3, _livenessResponse$res4, err, _t1, _t10, _t11, _t12, _t13, _t14;
|
|
6210
|
-
return _regeneratorRuntime.wrap(function (
|
|
6211
|
-
while (1) switch (
|
|
6332
|
+
return _regeneratorRuntime.wrap(function (_context9) {
|
|
6333
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
6212
6334
|
case 0:
|
|
6213
6335
|
if (options === void 0) {
|
|
6214
6336
|
options = {};
|
|
6215
6337
|
}
|
|
6216
|
-
|
|
6338
|
+
_context9.prev = 1;
|
|
6217
6339
|
selfie = imageDataUrl;
|
|
6218
6340
|
if (!(options.useDocumentServiceForLivenessChecks && documentServiceEnabled)) {
|
|
6219
|
-
|
|
6341
|
+
_context9.next = 6;
|
|
6220
6342
|
break;
|
|
6221
6343
|
}
|
|
6222
6344
|
if (!selfie.startsWith('data:')) {
|
|
6223
6345
|
selfie = "data:image/jpeg;base64," + selfie;
|
|
6224
6346
|
}
|
|
6225
|
-
|
|
6226
|
-
|
|
6347
|
+
_context9.prev = 2;
|
|
6348
|
+
_context9.next = 3;
|
|
6227
6349
|
return performUpload(dataUrlToBlob(selfie), withJobTaskMetadata({
|
|
6228
6350
|
filename: 'liveness',
|
|
6229
6351
|
filetype: 'image/jpeg'
|
|
6230
|
-
}, options.jobID, options.taskID));
|
|
6352
|
+
}, options.jobID, options.taskID), currentRoute());
|
|
6231
6353
|
case 3:
|
|
6232
|
-
selfie =
|
|
6233
|
-
|
|
6354
|
+
selfie = _context9.sent;
|
|
6355
|
+
_context9.next = 5;
|
|
6234
6356
|
break;
|
|
6235
6357
|
case 4:
|
|
6236
|
-
|
|
6237
|
-
_t1 =
|
|
6358
|
+
_context9.prev = 4;
|
|
6359
|
+
_t1 = _context9["catch"](2);
|
|
6238
6360
|
throw new NetworkError(_t1 instanceof Error ? _t1.message : String(_t1));
|
|
6239
6361
|
case 5:
|
|
6240
|
-
|
|
6362
|
+
_context9.next = 7;
|
|
6241
6363
|
break;
|
|
6242
6364
|
case 6:
|
|
6243
6365
|
selfie = dataUrlToBase64Sync$1(selfie);
|
|
@@ -6305,19 +6427,19 @@
|
|
|
6305
6427
|
attestationAttached: attestationAttached
|
|
6306
6428
|
});
|
|
6307
6429
|
if (!config.onBeforeLivenessCheck) {
|
|
6308
|
-
|
|
6430
|
+
_context9.next = 9;
|
|
6309
6431
|
break;
|
|
6310
6432
|
}
|
|
6311
|
-
|
|
6433
|
+
_context9.next = 8;
|
|
6312
6434
|
return config.onBeforeLivenessCheck(request);
|
|
6313
6435
|
case 8:
|
|
6314
|
-
result =
|
|
6436
|
+
result = _context9.sent;
|
|
6315
6437
|
if (result) request = result;
|
|
6316
6438
|
case 9:
|
|
6317
6439
|
endpoint = liveCheckEndpoint(!!options.idCardForFaceMatch);
|
|
6318
6440
|
sessionId = store.getState().session.sessionId;
|
|
6319
|
-
|
|
6320
|
-
|
|
6441
|
+
_context9.prev = 10;
|
|
6442
|
+
_context9.next = 11;
|
|
6321
6443
|
return timedFetch(urls.submissionUrl + endpoint, {
|
|
6322
6444
|
method: 'POST',
|
|
6323
6445
|
// SubmissionProvider.tsx:1447 — sourced from the same
|
|
@@ -6328,36 +6450,36 @@
|
|
|
6328
6450
|
body: JSON.stringify(request)
|
|
6329
6451
|
});
|
|
6330
6452
|
case 11:
|
|
6331
|
-
response =
|
|
6332
|
-
|
|
6453
|
+
response = _context9.sent;
|
|
6454
|
+
_context9.next = 13;
|
|
6333
6455
|
break;
|
|
6334
6456
|
case 12:
|
|
6335
|
-
|
|
6336
|
-
_t10 =
|
|
6457
|
+
_context9.prev = 12;
|
|
6458
|
+
_t10 = _context9["catch"](10);
|
|
6337
6459
|
throw new NetworkError(_t10 instanceof Error ? _t10.message : String(_t10));
|
|
6338
6460
|
case 13:
|
|
6339
6461
|
if (response.ok) {
|
|
6340
|
-
|
|
6462
|
+
_context9.next = 18;
|
|
6341
6463
|
break;
|
|
6342
6464
|
}
|
|
6343
6465
|
if (!(response.status === 401 || response.status === 403)) {
|
|
6344
|
-
|
|
6466
|
+
_context9.next = 15;
|
|
6345
6467
|
break;
|
|
6346
6468
|
}
|
|
6347
6469
|
_t11 = AuthenticationError;
|
|
6348
6470
|
_t12 = response.status;
|
|
6349
|
-
|
|
6471
|
+
_context9.next = 14;
|
|
6350
6472
|
return response.text();
|
|
6351
6473
|
case 14:
|
|
6352
|
-
_t13 =
|
|
6474
|
+
_t13 = _context9.sent;
|
|
6353
6475
|
throw new _t11(_t12, _t13);
|
|
6354
6476
|
case 15:
|
|
6355
|
-
|
|
6477
|
+
_context9.next = 16;
|
|
6356
6478
|
return response.text();
|
|
6357
6479
|
case 16:
|
|
6358
|
-
statusMessage =
|
|
6480
|
+
statusMessage = _context9.sent;
|
|
6359
6481
|
if (!(!statusMessage || statusMessage === 'Load failed')) {
|
|
6360
|
-
|
|
6482
|
+
_context9.next = 17;
|
|
6361
6483
|
break;
|
|
6362
6484
|
}
|
|
6363
6485
|
throw new NetworkError(statusMessage);
|
|
@@ -6367,12 +6489,12 @@
|
|
|
6367
6489
|
statusMessage: statusMessage
|
|
6368
6490
|
});
|
|
6369
6491
|
case 18:
|
|
6370
|
-
|
|
6492
|
+
_context9.next = 19;
|
|
6371
6493
|
return response.json();
|
|
6372
6494
|
case 19:
|
|
6373
|
-
livenessResponse =
|
|
6495
|
+
livenessResponse = _context9.sent;
|
|
6374
6496
|
if (!(livenessResponse.status.statusCode !== '000')) {
|
|
6375
|
-
|
|
6497
|
+
_context9.next = 20;
|
|
6376
6498
|
break;
|
|
6377
6499
|
}
|
|
6378
6500
|
throw new SubmissionError(livenessResponse.status);
|
|
@@ -6385,7 +6507,7 @@
|
|
|
6385
6507
|
// unconditional here — a deliberate scope narrowing, not a silent drop.
|
|
6386
6508
|
livenessToken = (_livenessResponse$res = livenessResponse.resultData) == null ? void 0 : _livenessResponse$res.livenessToken;
|
|
6387
6509
|
if (!(options.softFail && !isLiveFaceConfirmed((_livenessResponse$res2 = livenessResponse.resultData) == null ? void 0 : _livenessResponse$res2.verificationResult))) {
|
|
6388
|
-
|
|
6510
|
+
_context9.next = 21;
|
|
6389
6511
|
break;
|
|
6390
6512
|
}
|
|
6391
6513
|
// Current sdk2 (SubmissionProvider.tsx checkLiveness): softFail also
|
|
@@ -6394,21 +6516,21 @@
|
|
|
6394
6516
|
// non-live capture) and hand back a typed failure that still carries
|
|
6395
6517
|
// the response so callers can read the detection flags.
|
|
6396
6518
|
livenessToken = undefined;
|
|
6397
|
-
return
|
|
6519
|
+
return _context9.abrupt("return", {
|
|
6398
6520
|
ok: false,
|
|
6399
6521
|
error: new Error("Liveness not confirmed: " + ((_livenessResponse$res3 = (_livenessResponse$res4 = livenessResponse.resultData) == null ? void 0 : _livenessResponse$res4.verificationResult) != null ? _livenessResponse$res3 : 'no verificationResult')),
|
|
6400
6522
|
response: livenessResponse
|
|
6401
6523
|
});
|
|
6402
6524
|
case 21:
|
|
6403
|
-
return
|
|
6525
|
+
return _context9.abrupt("return", {
|
|
6404
6526
|
ok: true,
|
|
6405
6527
|
response: livenessResponse
|
|
6406
6528
|
});
|
|
6407
6529
|
case 22:
|
|
6408
|
-
|
|
6409
|
-
_t14 =
|
|
6530
|
+
_context9.prev = 22;
|
|
6531
|
+
_t14 = _context9["catch"](1);
|
|
6410
6532
|
if (!options.softFail) {
|
|
6411
|
-
|
|
6533
|
+
_context9.next = 23;
|
|
6412
6534
|
break;
|
|
6413
6535
|
}
|
|
6414
6536
|
// Caller is treating this as a best-effort check. Don't surface the
|
|
@@ -6416,7 +6538,7 @@
|
|
|
6416
6538
|
// typed failure result instead of sdk2's silent `undefined` (deliberate
|
|
6417
6539
|
// divergence #3).
|
|
6418
6540
|
livenessToken = undefined;
|
|
6419
|
-
return
|
|
6541
|
+
return _context9.abrupt("return", {
|
|
6420
6542
|
ok: false,
|
|
6421
6543
|
error: _t14
|
|
6422
6544
|
});
|
|
@@ -6430,32 +6552,32 @@
|
|
|
6430
6552
|
throw err;
|
|
6431
6553
|
case 24:
|
|
6432
6554
|
case "end":
|
|
6433
|
-
return
|
|
6555
|
+
return _context9.stop();
|
|
6434
6556
|
}
|
|
6435
|
-
},
|
|
6557
|
+
}, _callee9, null, [[1, 22], [2, 4], [10, 12]]);
|
|
6436
6558
|
}));
|
|
6437
6559
|
return _checkLiveness.apply(this, arguments);
|
|
6438
6560
|
}
|
|
6439
|
-
function clientUploadDocument(
|
|
6561
|
+
function clientUploadDocument(_x11, _x12) {
|
|
6440
6562
|
return _clientUploadDocument.apply(this, arguments);
|
|
6441
6563
|
}
|
|
6442
6564
|
function _clientUploadDocument() {
|
|
6443
|
-
_clientUploadDocument = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
6444
|
-
return _regeneratorRuntime.wrap(function (
|
|
6445
|
-
while (1) switch (
|
|
6565
|
+
_clientUploadDocument = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee0(blob, metadata) {
|
|
6566
|
+
return _regeneratorRuntime.wrap(function (_context0) {
|
|
6567
|
+
while (1) switch (_context0.prev = _context0.next) {
|
|
6446
6568
|
case 0:
|
|
6447
6569
|
if (documentServiceEnabled) {
|
|
6448
|
-
|
|
6570
|
+
_context0.next = 1;
|
|
6449
6571
|
break;
|
|
6450
6572
|
}
|
|
6451
6573
|
throw new Error('document upload is disabled: no documentServiceUrl configured');
|
|
6452
6574
|
case 1:
|
|
6453
|
-
return
|
|
6575
|
+
return _context0.abrupt("return", performUpload(blob, metadata != null ? metadata : {}, currentRoute()));
|
|
6454
6576
|
case 2:
|
|
6455
6577
|
case "end":
|
|
6456
|
-
return
|
|
6578
|
+
return _context0.stop();
|
|
6457
6579
|
}
|
|
6458
|
-
},
|
|
6580
|
+
}, _callee0);
|
|
6459
6581
|
}));
|
|
6460
6582
|
return _clientUploadDocument.apply(this, arguments);
|
|
6461
6583
|
}
|
|
@@ -6471,6 +6593,8 @@
|
|
|
6471
6593
|
validateSession: validateSessionMethod,
|
|
6472
6594
|
retrySession: retrySession,
|
|
6473
6595
|
submit: submit,
|
|
6596
|
+
post: post,
|
|
6597
|
+
handoff: handoff,
|
|
6474
6598
|
checkLiveness: checkLiveness,
|
|
6475
6599
|
uploadDocument: clientUploadDocument
|
|
6476
6600
|
};
|
|
@@ -12289,12 +12413,17 @@
|
|
|
12289
12413
|
* Binds one rendered SDK tree to its requested language. A fixed translator
|
|
12290
12414
|
* avoids waiting for a post-render changeLanguage() effect and keeps SSR and
|
|
12291
12415
|
* concurrently mounted SDK views independent of the shared detector instance.
|
|
12416
|
+
*
|
|
12417
|
+
* An unset `lang` keeps whatever scope encloses it (or none), so a caller can
|
|
12418
|
+
* render the provider unconditionally: toggling `lang` between unset and set
|
|
12419
|
+
* then never changes the element tree, and never remounts the subtree.
|
|
12292
12420
|
*/
|
|
12293
12421
|
function SdkLanguageProvider(_ref) {
|
|
12294
12422
|
var children = _ref.children,
|
|
12295
12423
|
lang = _ref.lang;
|
|
12424
|
+
var inherited = React.useContext(SdkLanguageContext);
|
|
12296
12425
|
return /*#__PURE__*/React.createElement(SdkLanguageContext.Provider, {
|
|
12297
|
-
value: lang === 'auto' ? detectedLanguage : lang
|
|
12426
|
+
value: lang === undefined ? inherited : lang === 'auto' ? detectedLanguage : lang
|
|
12298
12427
|
}, children);
|
|
12299
12428
|
}
|
|
12300
12429
|
/**
|
|
@@ -43968,7 +44097,9 @@
|
|
|
43968
44097
|
onComplete = _ref.onComplete,
|
|
43969
44098
|
onApproved = _ref.onApproved,
|
|
43970
44099
|
onDenied = _ref.onDenied,
|
|
43971
|
-
|
|
44100
|
+
onSubmissionFailure = _ref.onSubmissionFailure,
|
|
44101
|
+
onRequestFailure = _ref.onRequestFailure,
|
|
44102
|
+
mode = _ref.mode;
|
|
43972
44103
|
var progress = useCaptureObserver();
|
|
43973
44104
|
var clientState = shimExports.useSyncExternalStore(client.subscribe, client.getState, client.getState);
|
|
43974
44105
|
var _useAuthState = useAuthState(),
|
|
@@ -43981,10 +44112,22 @@
|
|
|
43981
44112
|
_useState4 = _slicedToArray$1(_useState3, 2),
|
|
43982
44113
|
localError = _useState4[0],
|
|
43983
44114
|
setLocalError = _useState4[1];
|
|
43984
|
-
var _useState5 = React.useState(
|
|
44115
|
+
var _useState5 = React.useState(IDLE_ATTEMPT),
|
|
43985
44116
|
_useState6 = _slicedToArray$1(_useState5, 2),
|
|
43986
|
-
|
|
43987
|
-
|
|
44117
|
+
attempt = _useState6[0],
|
|
44118
|
+
setAttempt = _useState6[1];
|
|
44119
|
+
// Which path the latest submission took. State is read from that path even
|
|
44120
|
+
// if `mode` changes while it is in flight; before any submission, `mode`
|
|
44121
|
+
// decides.
|
|
44122
|
+
var _useState7 = React.useState(null),
|
|
44123
|
+
_useState8 = _slicedToArray$1(_useState7, 2),
|
|
44124
|
+
startedExplicit = _useState8[0],
|
|
44125
|
+
setStartedExplicit = _useState8[1];
|
|
44126
|
+
var reportFailure = onSubmissionFailure != null ? onSubmissionFailure : onRequestFailure;
|
|
44127
|
+
var _useState9 = React.useState(false),
|
|
44128
|
+
_useState0 = _slicedToArray$1(_useState9, 2),
|
|
44129
|
+
resubmitting = _useState0[0],
|
|
44130
|
+
setResubmitting = _useState0[1];
|
|
43988
44131
|
var lastArtifactsRef = React.useRef(null);
|
|
43989
44132
|
var submitInFlightRef = React.useRef(null);
|
|
43990
44133
|
var resubmitInFlightRef = React.useRef(null);
|
|
@@ -44002,6 +44145,71 @@
|
|
|
44002
44145
|
}) : incoming;
|
|
44003
44146
|
// Store the merged artifacts so a resubmit carries location too.
|
|
44004
44147
|
lastArtifactsRef.current = artifacts;
|
|
44148
|
+
setStartedExplicit(mode !== undefined);
|
|
44149
|
+
if (mode !== undefined) {
|
|
44150
|
+
// Registered before anything customer-supplied runs, so a throw from
|
|
44151
|
+
// a notification can never leave the flow without a status.
|
|
44152
|
+
setAttempt(_extends$1({}, IDLE_ATTEMPT, {
|
|
44153
|
+
status: SubmissionStatus.SUBMITTING
|
|
44154
|
+
}));
|
|
44155
|
+
var _unbindProgress = bindSubmissionObserver(artifacts, progress);
|
|
44156
|
+
// The client call waits one microtask so the in-flight promise is
|
|
44157
|
+
// registered first: an `onSubmissionStarted` that calls `submit()`
|
|
44158
|
+
// gets this attempt back instead of starting a second one.
|
|
44159
|
+
var _promise = Promise.resolve().then(function () {
|
|
44160
|
+
return runAttempt(client, mode, artifacts, _extends$1({}, options, {
|
|
44161
|
+
action: action
|
|
44162
|
+
}));
|
|
44163
|
+
}).then(function (outcome) {
|
|
44164
|
+
setAttempt(_extends$1({}, outcome, {
|
|
44165
|
+
status: SubmissionStatus.SUBMITTED,
|
|
44166
|
+
error: null
|
|
44167
|
+
}));
|
|
44168
|
+
var response = outcome.response,
|
|
44169
|
+
request = outcome.request;
|
|
44170
|
+
if (response === null) {
|
|
44171
|
+
// Terminal once called; the handler is never awaited.
|
|
44172
|
+
if (typeof mode === 'object') {
|
|
44173
|
+
notifySafely('submitMode.handoff', function () {
|
|
44174
|
+
return mode.handoff(request);
|
|
44175
|
+
});
|
|
44176
|
+
}
|
|
44177
|
+
return null;
|
|
44178
|
+
}
|
|
44179
|
+
notifySafely('onComplete', function () {
|
|
44180
|
+
return onComplete == null ? void 0 : onComplete(response);
|
|
44181
|
+
});
|
|
44182
|
+
if (isApprovedResponse(action, response)) {
|
|
44183
|
+
notifySafely('onApproved', function () {
|
|
44184
|
+
return onApproved == null ? void 0 : onApproved(response);
|
|
44185
|
+
});
|
|
44186
|
+
} else {
|
|
44187
|
+
notifySafely('onDenied', function () {
|
|
44188
|
+
return onDenied == null ? void 0 : onDenied(response);
|
|
44189
|
+
});
|
|
44190
|
+
}
|
|
44191
|
+
return response;
|
|
44192
|
+
}, function (cause) {
|
|
44193
|
+
var error = cause instanceof Error ? cause : new Error(String(cause));
|
|
44194
|
+
setAttempt(_extends$1({}, IDLE_ATTEMPT, {
|
|
44195
|
+
status: SubmissionStatus.FAILED,
|
|
44196
|
+
error: error
|
|
44197
|
+
}));
|
|
44198
|
+
notifySafely('onSubmissionFailure', function () {
|
|
44199
|
+
return reportFailure == null ? void 0 : reportFailure(error);
|
|
44200
|
+
});
|
|
44201
|
+
throw error;
|
|
44202
|
+
})["finally"](function () {
|
|
44203
|
+
_unbindProgress();
|
|
44204
|
+
submitInFlightRef.current = null;
|
|
44205
|
+
setResubmitting(false);
|
|
44206
|
+
});
|
|
44207
|
+
submitInFlightRef.current = _promise;
|
|
44208
|
+
notifySafely('onSubmissionStarted', function () {
|
|
44209
|
+
return onSubmissionStarted == null ? void 0 : onSubmissionStarted(artifacts);
|
|
44210
|
+
});
|
|
44211
|
+
return _promise;
|
|
44212
|
+
}
|
|
44005
44213
|
setSubmissionResponse(null);
|
|
44006
44214
|
setLocalError(null);
|
|
44007
44215
|
onSubmissionStarted == null || onSubmissionStarted(artifacts);
|
|
@@ -44022,7 +44230,7 @@
|
|
|
44022
44230
|
})["catch"](function (cause) {
|
|
44023
44231
|
var error = cause instanceof Error ? cause : new Error(String(cause));
|
|
44024
44232
|
setLocalError(error);
|
|
44025
|
-
|
|
44233
|
+
reportFailure == null || reportFailure(error);
|
|
44026
44234
|
throw error;
|
|
44027
44235
|
})["finally"](function () {
|
|
44028
44236
|
unbindProgress();
|
|
@@ -44031,7 +44239,7 @@
|
|
|
44031
44239
|
});
|
|
44032
44240
|
submitInFlightRef.current = promise;
|
|
44033
44241
|
return promise;
|
|
44034
|
-
}, [action, client, geolocation, onApproved, onComplete, onDenied,
|
|
44242
|
+
}, [action, client, geolocation, onApproved, onComplete, onDenied, reportFailure, onSubmissionStarted, options, progress, mode]);
|
|
44035
44243
|
var resubmit = React.useMemo(function () {
|
|
44036
44244
|
if (!authState.session.canRefreshSession) return null;
|
|
44037
44245
|
return function () {
|
|
@@ -44076,22 +44284,120 @@
|
|
|
44076
44284
|
}, [authState.session.canRefreshSession, client, submit]);
|
|
44077
44285
|
var value = React.useMemo(function () {
|
|
44078
44286
|
var _ref3, _clientState$lastSubm, _clientState$lastSubm2;
|
|
44287
|
+
if (startedExplicit != null ? startedExplicit : mode !== undefined) {
|
|
44288
|
+
return {
|
|
44289
|
+
action: action,
|
|
44290
|
+
submit: submit,
|
|
44291
|
+
submissionStatus: resubmitting ? SubmissionStatus.SUBMITTING : attempt.status,
|
|
44292
|
+
submissionResponse: attempt.response,
|
|
44293
|
+
submissionError: attempt.error,
|
|
44294
|
+
lastSubmissionTimings: attempt.timings,
|
|
44295
|
+
lastSubmissionRequest: attempt.request,
|
|
44296
|
+
resubmit: resubmit
|
|
44297
|
+
};
|
|
44298
|
+
}
|
|
44079
44299
|
return {
|
|
44080
44300
|
action: action,
|
|
44081
44301
|
submit: submit,
|
|
44082
|
-
|
|
44302
|
+
// A rejection before the client records anything (an unsupported
|
|
44303
|
+
// action, an unvalidated session) leaves the client at READY, which the
|
|
44304
|
+
// wizard renders as its submitting screen; the local error is the
|
|
44305
|
+
// failure it would otherwise never show.
|
|
44306
|
+
submissionStatus: resubmitting ? SubmissionStatus.SUBMITTING : localError && clientState.submissionStatus === SubmissionStatus.READY ? SubmissionStatus.FAILED : clientState.submissionStatus,
|
|
44083
44307
|
submissionResponse: submissionResponse,
|
|
44084
44308
|
submissionError: (_ref3 = localError != null ? localError : clientState.submissionError) != null ? _ref3 : null,
|
|
44085
44309
|
lastSubmissionTimings: (_clientState$lastSubm = clientState.lastSubmissionTimings) != null ? _clientState$lastSubm : null,
|
|
44086
44310
|
lastSubmissionRequest: (_clientState$lastSubm2 = clientState.lastSubmissionRequest) != null ? _clientState$lastSubm2 : null,
|
|
44087
44311
|
resubmit: resubmit
|
|
44088
44312
|
};
|
|
44089
|
-
}, [action, clientState.lastSubmissionRequest, clientState.lastSubmissionTimings, clientState.submissionError, clientState.submissionStatus, localError, resubmit, resubmitting, submissionResponse, submit]);
|
|
44313
|
+
}, [action, attempt, clientState.lastSubmissionRequest, clientState.lastSubmissionTimings, clientState.submissionError, clientState.submissionStatus, localError, mode, resubmit, resubmitting, startedExplicit, submissionResponse, submit]);
|
|
44090
44314
|
return jsx(SubmissionContext.Provider, {
|
|
44091
44315
|
value: value,
|
|
44092
44316
|
children: children
|
|
44093
44317
|
});
|
|
44094
44318
|
}
|
|
44319
|
+
var IDLE_ATTEMPT = {
|
|
44320
|
+
status: SubmissionStatus.READY,
|
|
44321
|
+
response: null,
|
|
44322
|
+
request: null,
|
|
44323
|
+
timings: null,
|
|
44324
|
+
error: null
|
|
44325
|
+
};
|
|
44326
|
+
/**
|
|
44327
|
+
* One explicit-mode attempt through the client's `post()` or `handoff()`.
|
|
44328
|
+
* Never falls back to `submit()`: that would let the deprecated
|
|
44329
|
+
* `config.onSubmit` decide what an explicit mode already decided.
|
|
44330
|
+
*/
|
|
44331
|
+
function runAttempt(_x, _x2, _x3, _x4) {
|
|
44332
|
+
return _runAttempt.apply(this, arguments);
|
|
44333
|
+
}
|
|
44334
|
+
function _runAttempt() {
|
|
44335
|
+
_runAttempt = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(client, mode, artifacts, options) {
|
|
44336
|
+
var _yield$client$handoff, request, timings;
|
|
44337
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
44338
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
44339
|
+
case 0:
|
|
44340
|
+
if (!(mode === 'capture')) {
|
|
44341
|
+
_context2.next = 1;
|
|
44342
|
+
break;
|
|
44343
|
+
}
|
|
44344
|
+
throw new Error("submitMode 'capture' does not submit; the flow reports onCaptured instead");
|
|
44345
|
+
case 1:
|
|
44346
|
+
if (!(mode === 'post')) {
|
|
44347
|
+
_context2.next = 3;
|
|
44348
|
+
break;
|
|
44349
|
+
}
|
|
44350
|
+
if (client.post) {
|
|
44351
|
+
_context2.next = 2;
|
|
44352
|
+
break;
|
|
44353
|
+
}
|
|
44354
|
+
throw missingMethod('post', "submitMode 'post'");
|
|
44355
|
+
case 2:
|
|
44356
|
+
return _context2.abrupt("return", client.post(artifacts, options));
|
|
44357
|
+
case 3:
|
|
44358
|
+
if (client.handoff) {
|
|
44359
|
+
_context2.next = 4;
|
|
44360
|
+
break;
|
|
44361
|
+
}
|
|
44362
|
+
throw missingMethod('handoff', 'submitMode { handoff }');
|
|
44363
|
+
case 4:
|
|
44364
|
+
_context2.next = 5;
|
|
44365
|
+
return client.handoff(artifacts, options);
|
|
44366
|
+
case 5:
|
|
44367
|
+
_yield$client$handoff = _context2.sent;
|
|
44368
|
+
request = _yield$client$handoff.request;
|
|
44369
|
+
timings = _yield$client$handoff.timings;
|
|
44370
|
+
return _context2.abrupt("return", {
|
|
44371
|
+
request: request,
|
|
44372
|
+
timings: timings,
|
|
44373
|
+
response: null
|
|
44374
|
+
});
|
|
44375
|
+
case 6:
|
|
44376
|
+
case "end":
|
|
44377
|
+
return _context2.stop();
|
|
44378
|
+
}
|
|
44379
|
+
}, _callee2);
|
|
44380
|
+
}));
|
|
44381
|
+
return _runAttempt.apply(this, arguments);
|
|
44382
|
+
}
|
|
44383
|
+
function missingMethod(method, needs) {
|
|
44384
|
+
return new Error(needs + " needs client." + method + "(), which this client does not have. " + 'Create the client with createIdmissionClient or useIdmissionClient.');
|
|
44385
|
+
}
|
|
44386
|
+
/**
|
|
44387
|
+
* Runs a customer callback whose failure must not change an outcome that is
|
|
44388
|
+
* already settled: a throw or a rejected promise is logged, never rethrown.
|
|
44389
|
+
*/
|
|
44390
|
+
function notifySafely(name, notify) {
|
|
44391
|
+
try {
|
|
44392
|
+
// `Promise.resolve`, not `instanceof Promise`: a promise from another
|
|
44393
|
+
// realm (an iframe) fails that check, and its rejection would go unhandled.
|
|
44394
|
+
Promise.resolve(notify())["catch"](function (e) {
|
|
44395
|
+
return warn$1(name + " rejected", e);
|
|
44396
|
+
});
|
|
44397
|
+
} catch (e) {
|
|
44398
|
+
warn$1(name + " threw", e);
|
|
44399
|
+
}
|
|
44400
|
+
}
|
|
44095
44401
|
function useSubmission() {
|
|
44096
44402
|
var context = React.useContext(SubmissionContext);
|
|
44097
44403
|
if (!context) {
|
|
@@ -45842,15 +46148,15 @@
|
|
|
45842
46148
|
var Label = styled.span(_templateObject2$3 || (_templateObject2$3 = _taggedTemplateLiteralLoose(["\n max-width: 32rem;\n text-align: center;\n text-wrap: pretty;\n font-size: 14px;\n font-weight: 600;\n letter-spacing: 0.01em;\n"])));
|
|
45843
46149
|
|
|
45844
46150
|
function CompositeWizard(_ref) {
|
|
45845
|
-
var _successScreen$isAppr;
|
|
46151
|
+
var _successScreen$isAppr, _ref2;
|
|
45846
46152
|
var steps = _ref.steps,
|
|
45847
46153
|
sessionReadyProp = _ref.sessionReady,
|
|
45848
46154
|
_ref$initialArtifacts = _ref.initialArtifacts,
|
|
45849
46155
|
initialArtifacts = _ref$initialArtifacts === void 0 ? {} : _ref$initialArtifacts,
|
|
45850
46156
|
_ref$captureOnly = _ref.captureOnly,
|
|
45851
46157
|
captureOnly = _ref$captureOnly === void 0 ? false : _ref$captureOnly,
|
|
45852
|
-
|
|
45853
|
-
showSuccessScreen = _ref
|
|
46158
|
+
showResultScreen = _ref.showResultScreen,
|
|
46159
|
+
showSuccessScreen = _ref.showSuccessScreen,
|
|
45854
46160
|
_ref$showDiagnostics = _ref.showDiagnostics,
|
|
45855
46161
|
showDiagnostics = _ref$showDiagnostics === void 0 ? false : _ref$showDiagnostics,
|
|
45856
46162
|
successClassNames = _ref.successClassNames,
|
|
@@ -46000,7 +46306,7 @@
|
|
|
46000
46306
|
classNames: successScreen.classNames
|
|
46001
46307
|
});
|
|
46002
46308
|
}
|
|
46003
|
-
if (submissionStatus === SubmissionStatus.SUBMITTED && submissionResponse && showSuccessScreen) {
|
|
46309
|
+
if (submissionStatus === SubmissionStatus.SUBMITTED && submissionResponse && ((_ref2 = showResultScreen != null ? showResultScreen : showSuccessScreen) != null ? _ref2 : false)) {
|
|
46004
46310
|
return jsx(SubmissionSuccess, {
|
|
46005
46311
|
response: submissionResponse,
|
|
46006
46312
|
request: lastSubmissionRequest,
|
|
@@ -46037,8 +46343,8 @@
|
|
|
46037
46343
|
});
|
|
46038
46344
|
return labels;
|
|
46039
46345
|
}
|
|
46040
|
-
function SubmittingScreen(
|
|
46041
|
-
var text =
|
|
46346
|
+
function SubmittingScreen(_ref3) {
|
|
46347
|
+
var text = _ref3.text;
|
|
46042
46348
|
return jsx(OrbStatusScreen, {
|
|
46043
46349
|
state: "working",
|
|
46044
46350
|
text: text,
|
|
@@ -46797,11 +47103,12 @@
|
|
|
46797
47103
|
}
|
|
46798
47104
|
|
|
46799
47105
|
var _templateObject$2, _templateObject2$2, _templateObject3$1, _templateObject4$1;
|
|
46800
|
-
var _excluded$9 = ["client", "action", "submission", "theme", "className", "geolocationEnabled", "geolocationRequired", "captureProgress", "remoteDiagnostics", "loadingSpinner", "showEnrollmentId", "children"];
|
|
47106
|
+
var _excluded$9 = ["client", "action", "submission", "submitMode", "theme", "className", "geolocationEnabled", "geolocationRequired", "captureProgress", "remoteDiagnostics", "loadingSpinner", "showEnrollmentId", "lang", "children"];
|
|
46801
47107
|
function FlowChassis(_ref) {
|
|
46802
47108
|
var client = _ref.client,
|
|
46803
47109
|
action = _ref.action,
|
|
46804
47110
|
submission = _ref.submission,
|
|
47111
|
+
submitMode = _ref.submitMode,
|
|
46805
47112
|
_ref$theme = _ref.theme,
|
|
46806
47113
|
theme = _ref$theme === void 0 ? 'default' : _ref$theme,
|
|
46807
47114
|
className = _ref.className,
|
|
@@ -46814,6 +47121,7 @@
|
|
|
46814
47121
|
loadingSpinner = _ref.loadingSpinner,
|
|
46815
47122
|
_ref$showEnrollmentId = _ref.showEnrollmentId,
|
|
46816
47123
|
showEnrollmentId = _ref$showEnrollmentId === void 0 ? false : _ref$showEnrollmentId,
|
|
47124
|
+
lang = _ref.lang,
|
|
46817
47125
|
children = _ref.children,
|
|
46818
47126
|
callbacks = _objectWithoutPropertiesLoose(_ref, _excluded$9);
|
|
46819
47127
|
var geolocation = useGeolocation(geolocationEnabled);
|
|
@@ -46823,26 +47131,30 @@
|
|
|
46823
47131
|
client: client,
|
|
46824
47132
|
children: [jsx(RemoteDiagnosticsMount, {
|
|
46825
47133
|
remoteDiagnostics: remoteDiagnostics
|
|
46826
|
-
}), jsx(
|
|
46827
|
-
|
|
46828
|
-
children: jsx(
|
|
46829
|
-
|
|
46830
|
-
children: jsx(
|
|
46831
|
-
|
|
46832
|
-
|
|
46833
|
-
|
|
46834
|
-
|
|
46835
|
-
|
|
46836
|
-
|
|
46837
|
-
|
|
46838
|
-
|
|
46839
|
-
children: jsx(
|
|
46840
|
-
|
|
46841
|
-
|
|
46842
|
-
|
|
47134
|
+
}), jsx(SdkLanguageProvider, {
|
|
47135
|
+
lang: lang,
|
|
47136
|
+
children: jsx(ThemeProvider, {
|
|
47137
|
+
theme: theme,
|
|
47138
|
+
children: jsx(LoadingSpinnerProvider, {
|
|
47139
|
+
spinner: loadingSpinner,
|
|
47140
|
+
children: jsx(SubmissionProvider, _extends$1({
|
|
47141
|
+
client: client,
|
|
47142
|
+
action: action,
|
|
47143
|
+
options: submission,
|
|
47144
|
+
mode: submitMode,
|
|
47145
|
+
geolocation: geolocation.position
|
|
47146
|
+
}, callbacks, {
|
|
47147
|
+
children: jsx(FlowPage, {
|
|
47148
|
+
className: className,
|
|
47149
|
+
enrollmentId: showEnrollmentId ? submission == null ? void 0 : submission.enrollmentId : undefined,
|
|
47150
|
+
children: jsx(AuthGate, {
|
|
47151
|
+
children: geolocationRequired && geolocation.blocked ? jsx(GeolocationAccessDeniedOverlay, {
|
|
47152
|
+
onRetry: geolocation.retry
|
|
47153
|
+
}) : children
|
|
47154
|
+
})
|
|
46843
47155
|
})
|
|
46844
|
-
})
|
|
46845
|
-
})
|
|
47156
|
+
}))
|
|
47157
|
+
})
|
|
46846
47158
|
})
|
|
46847
47159
|
})]
|
|
46848
47160
|
})
|
|
@@ -47002,6 +47314,26 @@
|
|
|
47002
47314
|
return explicit != null ? explicit : introActive;
|
|
47003
47315
|
}
|
|
47004
47316
|
|
|
47317
|
+
/**
|
|
47318
|
+
* A step bag with the flow's settings filled in wherever the step leaves them
|
|
47319
|
+
* unset: `step ?? flow`, key by key. The step's own value always wins, an
|
|
47320
|
+
* explicit `false` included, so a flow-wide setting never overrides a step.
|
|
47321
|
+
*
|
|
47322
|
+
* `flow` is typed against the step bag, so a setting the step has no prop for
|
|
47323
|
+
* (`debugMode` on the signature step, say) fails to compile instead of being
|
|
47324
|
+
* forwarded to a component that ignores it.
|
|
47325
|
+
*/
|
|
47326
|
+
function inheritFlowSettings(step, flow) {
|
|
47327
|
+
var inherited = {};
|
|
47328
|
+
for (var key in flow) {
|
|
47329
|
+
if (!Object.prototype.hasOwnProperty.call(flow, key)) continue;
|
|
47330
|
+
if ((step == null ? void 0 : step[key]) === undefined && flow[key] !== undefined) {
|
|
47331
|
+
inherited[key] = flow[key];
|
|
47332
|
+
}
|
|
47333
|
+
}
|
|
47334
|
+
return _extends$1({}, step, inherited);
|
|
47335
|
+
}
|
|
47336
|
+
|
|
47005
47337
|
function buildRingScreenProps(_ref) {
|
|
47006
47338
|
var ringMode = _ref.ringMode,
|
|
47007
47339
|
finishingVerbiage = _ref.finishingVerbiage,
|
|
@@ -47130,7 +47462,7 @@
|
|
|
47130
47462
|
return base;
|
|
47131
47463
|
}
|
|
47132
47464
|
|
|
47133
|
-
var _excluded$8 = ["client", "controller", "capture", "view", "submission", "initialArtifacts", "captureOnly", "signatureController", "signatureCapture", "signatureView", "captureSignature", "captureSignatureVideo", "allowVirtualCameras", "theme", "className", "showSuccessScreen", "showDiagnostics", "captureAdditionalDocuments", "additionalDocumentClassNames", "additionalDocumentVerbiage", "ringScreenClassNames", "ringScreenVerbiage", "onCaptured", "onSubmitted", "children"];
|
|
47465
|
+
var _excluded$8 = ["client", "controller", "capture", "view", "submission", "initialArtifacts", "submitMode", "captureOnly", "signatureController", "signatureCapture", "signatureView", "captureSignature", "captureSignatureVideo", "allowVirtualCameras", "theme", "className", "lang", "debugMode", "skipSuccessScreen", "showResultScreen", "showSuccessScreen", "showDiagnostics", "captureAdditionalDocuments", "additionalDocumentClassNames", "additionalDocumentVerbiage", "ringScreenClassNames", "ringScreenVerbiage", "onCaptured", "onSubmitted", "children"];
|
|
47134
47466
|
var EMPTY_ID_CAPTURE$3 = {};
|
|
47135
47467
|
var EMPTY_SIGNATURE_CAPTURE$5 = {};
|
|
47136
47468
|
var EMPTY_ID_VIEW$3 = {};
|
|
@@ -47142,24 +47474,27 @@
|
|
|
47142
47474
|
_ref$capture = _ref.capture,
|
|
47143
47475
|
capture = _ref$capture === void 0 ? EMPTY_ID_CAPTURE$3 : _ref$capture,
|
|
47144
47476
|
_ref$view = _ref.view,
|
|
47145
|
-
|
|
47477
|
+
viewProp = _ref$view === void 0 ? EMPTY_ID_VIEW$3 : _ref$view,
|
|
47146
47478
|
_ref$submission = _ref.submission,
|
|
47147
47479
|
submission = _ref$submission === void 0 ? EMPTY_SUBMISSION$6 : _ref$submission,
|
|
47148
47480
|
_ref$initialArtifacts = _ref.initialArtifacts,
|
|
47149
47481
|
initialArtifacts = _ref$initialArtifacts === void 0 ? EMPTY_ARTIFACTS$9 : _ref$initialArtifacts,
|
|
47150
|
-
|
|
47151
|
-
captureOnly = _ref
|
|
47482
|
+
submitMode = _ref.submitMode,
|
|
47483
|
+
captureOnly = _ref.captureOnly,
|
|
47152
47484
|
signatureController = _ref.signatureController,
|
|
47153
47485
|
_ref$signatureCapture = _ref.signatureCapture,
|
|
47154
47486
|
signatureCapture = _ref$signatureCapture === void 0 ? EMPTY_SIGNATURE_CAPTURE$5 : _ref$signatureCapture,
|
|
47155
|
-
|
|
47487
|
+
signatureViewProp = _ref.signatureView,
|
|
47156
47488
|
captureSignature = _ref.captureSignature,
|
|
47157
47489
|
captureSignatureVideo = _ref.captureSignatureVideo,
|
|
47158
47490
|
allowVirtualCameras = _ref.allowVirtualCameras,
|
|
47159
47491
|
theme = _ref.theme,
|
|
47160
47492
|
className = _ref.className,
|
|
47161
|
-
|
|
47162
|
-
|
|
47493
|
+
lang = _ref.lang,
|
|
47494
|
+
debugMode = _ref.debugMode,
|
|
47495
|
+
skipSuccessScreen = _ref.skipSuccessScreen,
|
|
47496
|
+
showResultScreen = _ref.showResultScreen,
|
|
47497
|
+
showSuccessScreen = _ref.showSuccessScreen,
|
|
47163
47498
|
_ref$showDiagnostics = _ref.showDiagnostics,
|
|
47164
47499
|
showDiagnostics = _ref$showDiagnostics === void 0 ? false : _ref$showDiagnostics,
|
|
47165
47500
|
captureAdditionalDocuments = _ref.captureAdditionalDocuments,
|
|
@@ -47171,6 +47506,23 @@
|
|
|
47171
47506
|
onSubmitted = _ref.onSubmitted,
|
|
47172
47507
|
children = _ref.children,
|
|
47173
47508
|
callbacks = _objectWithoutPropertiesLoose(_ref, _excluded$8);
|
|
47509
|
+
// Flow-wide settings reach each step unless its own bag sets them.
|
|
47510
|
+
var _useMemo = React.useMemo(function () {
|
|
47511
|
+
return {
|
|
47512
|
+
view: inheritFlowSettings(viewProp, {
|
|
47513
|
+
lang: lang,
|
|
47514
|
+
debugMode: debugMode,
|
|
47515
|
+
skipSuccessScreen: skipSuccessScreen
|
|
47516
|
+
}),
|
|
47517
|
+
signatureView: inheritFlowSettings(signatureViewProp, {
|
|
47518
|
+
lang: lang,
|
|
47519
|
+
showCaptureDiagnostics: debugMode,
|
|
47520
|
+
skipSuccessScreen: skipSuccessScreen
|
|
47521
|
+
})
|
|
47522
|
+
};
|
|
47523
|
+
}, [debugMode, lang, signatureViewProp, skipSuccessScreen, viewProp]),
|
|
47524
|
+
view = _useMemo.view,
|
|
47525
|
+
signatureView = _useMemo.signatureView;
|
|
47174
47526
|
useMountOnlyWarnings('IdValidationFlow', FLOW_MOUNT_ONLY_REMEDY, {
|
|
47175
47527
|
capture: capture,
|
|
47176
47528
|
signatureCapture: signatureCapture
|
|
@@ -47287,18 +47639,21 @@
|
|
|
47287
47639
|
successIssuerCaptionText: 'confirmed'
|
|
47288
47640
|
}
|
|
47289
47641
|
});
|
|
47642
|
+
var mode = submitMode != null ? submitMode : captureOnly ? 'capture' : undefined;
|
|
47290
47643
|
return jsxs(FlowChassis, _extends$1({
|
|
47291
47644
|
client: client,
|
|
47292
47645
|
action: SubmissionAction.VALIDATE,
|
|
47293
47646
|
submission: submission,
|
|
47647
|
+
submitMode: mode,
|
|
47294
47648
|
theme: theme,
|
|
47295
|
-
className: className
|
|
47649
|
+
className: className,
|
|
47650
|
+
lang: lang
|
|
47296
47651
|
}, callbacks, {
|
|
47297
47652
|
children: [jsx(CompositeWizard, _extends$1({}, ringScreens, {
|
|
47298
47653
|
steps: steps,
|
|
47299
47654
|
initialArtifacts: initialArtifacts,
|
|
47300
|
-
captureOnly:
|
|
47301
|
-
|
|
47655
|
+
captureOnly: mode === 'capture',
|
|
47656
|
+
showResultScreen: showResultScreen != null ? showResultScreen : showSuccessScreen,
|
|
47302
47657
|
showDiagnostics: showDiagnostics,
|
|
47303
47658
|
onArtifactsCollected: onCaptured,
|
|
47304
47659
|
onSubmitted: onSubmitted
|
|
@@ -47317,13 +47672,16 @@
|
|
|
47317
47672
|
_ref$capture = _ref.capture,
|
|
47318
47673
|
capture = _ref$capture === void 0 ? EMPTY_FACE_CAPTURE$5 : _ref$capture,
|
|
47319
47674
|
_ref$view = _ref.view,
|
|
47320
|
-
|
|
47675
|
+
viewProp = _ref$view === void 0 ? EMPTY_FACE_VIEW$5 : _ref$view,
|
|
47321
47676
|
_ref$submission = _ref.submission,
|
|
47322
47677
|
submission = _ref$submission === void 0 ? EMPTY_SUBMISSION$5 : _ref$submission,
|
|
47323
47678
|
_ref$initialArtifacts = _ref.initialArtifacts,
|
|
47324
47679
|
initialArtifacts = _ref$initialArtifacts === void 0 ? EMPTY_ARTIFACTS$8 : _ref$initialArtifacts,
|
|
47325
47680
|
theme = _ref.theme,
|
|
47326
47681
|
className = _ref.className,
|
|
47682
|
+
lang = _ref.lang,
|
|
47683
|
+
debugMode = _ref.debugMode,
|
|
47684
|
+
skipSuccessScreen = _ref.skipSuccessScreen,
|
|
47327
47685
|
geolocationEnabled = _ref.geolocationEnabled,
|
|
47328
47686
|
geolocationRequired = _ref.geolocationRequired,
|
|
47329
47687
|
captureProgress = _ref.captureProgress,
|
|
@@ -47332,6 +47690,14 @@
|
|
|
47332
47690
|
onCaptured = _ref.onCaptured,
|
|
47333
47691
|
onCaptureError = _ref.onCaptureError,
|
|
47334
47692
|
children = _ref.children;
|
|
47693
|
+
// Flow-wide settings reach the step unless its own bag sets them.
|
|
47694
|
+
var view = React.useMemo(function () {
|
|
47695
|
+
return inheritFlowSettings(viewProp, {
|
|
47696
|
+
lang: lang,
|
|
47697
|
+
debugMode: debugMode,
|
|
47698
|
+
skipSuccessScreen: skipSuccessScreen
|
|
47699
|
+
});
|
|
47700
|
+
}, [debugMode, lang, skipSuccessScreen, viewProp]);
|
|
47335
47701
|
var checkLivenessOptions = capture.checkLivenessOptions,
|
|
47336
47702
|
controllerCapture = _objectWithoutPropertiesLoose(capture, _excluded$7);
|
|
47337
47703
|
useMountOnlyWarnings('FaceValidationFlow', FLOW_MOUNT_ONLY_REMEDY, {
|
|
@@ -47392,6 +47758,7 @@
|
|
|
47392
47758
|
submission: submission,
|
|
47393
47759
|
theme: theme,
|
|
47394
47760
|
className: className,
|
|
47761
|
+
lang: lang,
|
|
47395
47762
|
geolocationEnabled: geolocationEnabled,
|
|
47396
47763
|
geolocationRequired: geolocationRequired,
|
|
47397
47764
|
captureProgress: captureProgress,
|
|
@@ -47406,7 +47773,7 @@
|
|
|
47406
47773
|
});
|
|
47407
47774
|
}
|
|
47408
47775
|
|
|
47409
|
-
var _excluded$6 = ["client", "idController", "selfieController", "signatureController", "idCapture", "faceCapture", "signatureCapture", "idView", "faceView", "signatureView", "captureSignature", "captureSignatureVideo", "allowVirtualCameras", "submission", "initialArtifacts", "theme", "className", "showSuccessScreen", "showDiagnostics", "captureAdditionalDocuments", "additionalDocumentClassNames", "additionalDocumentVerbiage", "ringScreenClassNames", "ringScreenVerbiage", "onSubmitted", "onCaptureError", "onStepStarted", "onStepCompleted", "children"],
|
|
47776
|
+
var _excluded$6 = ["client", "idController", "selfieController", "signatureController", "idCapture", "faceCapture", "signatureCapture", "idView", "faceView", "signatureView", "captureSignature", "captureSignatureVideo", "allowVirtualCameras", "submission", "initialArtifacts", "theme", "className", "lang", "debugMode", "skipSuccessScreen", "showResultScreen", "showSuccessScreen", "showDiagnostics", "captureAdditionalDocuments", "additionalDocumentClassNames", "additionalDocumentVerbiage", "ringScreenClassNames", "ringScreenVerbiage", "onSubmitted", "onCaptureError", "onStepStarted", "onStepCompleted", "children"],
|
|
47410
47777
|
_excluded2$3 = ["checkLivenessOptions"];
|
|
47411
47778
|
var EMPTY_ID_CAPTURE$2 = {};
|
|
47412
47779
|
var EMPTY_FACE_CAPTURE$4 = {};
|
|
@@ -47428,10 +47795,10 @@
|
|
|
47428
47795
|
_ref$signatureCapture = _ref.signatureCapture,
|
|
47429
47796
|
signatureCapture = _ref$signatureCapture === void 0 ? EMPTY_SIGNATURE_CAPTURE$4 : _ref$signatureCapture,
|
|
47430
47797
|
_ref$idView = _ref.idView,
|
|
47431
|
-
|
|
47798
|
+
idViewProp = _ref$idView === void 0 ? EMPTY_ID_VIEW$2 : _ref$idView,
|
|
47432
47799
|
_ref$faceView = _ref.faceView,
|
|
47433
|
-
|
|
47434
|
-
|
|
47800
|
+
faceViewProp = _ref$faceView === void 0 ? EMPTY_FACE_VIEW$4 : _ref$faceView,
|
|
47801
|
+
signatureViewProp = _ref.signatureView,
|
|
47435
47802
|
captureSignature = _ref.captureSignature,
|
|
47436
47803
|
captureSignatureVideo = _ref.captureSignatureVideo,
|
|
47437
47804
|
allowVirtualCameras = _ref.allowVirtualCameras,
|
|
@@ -47441,8 +47808,11 @@
|
|
|
47441
47808
|
initialArtifacts = _ref$initialArtifacts === void 0 ? EMPTY_ARTIFACTS$7 : _ref$initialArtifacts,
|
|
47442
47809
|
theme = _ref.theme,
|
|
47443
47810
|
className = _ref.className,
|
|
47444
|
-
|
|
47445
|
-
|
|
47811
|
+
lang = _ref.lang,
|
|
47812
|
+
debugMode = _ref.debugMode,
|
|
47813
|
+
skipSuccessScreen = _ref.skipSuccessScreen,
|
|
47814
|
+
showResultScreen = _ref.showResultScreen,
|
|
47815
|
+
showSuccessScreen = _ref.showSuccessScreen,
|
|
47446
47816
|
_ref$showDiagnostics = _ref.showDiagnostics,
|
|
47447
47817
|
showDiagnostics = _ref$showDiagnostics === void 0 ? false : _ref$showDiagnostics,
|
|
47448
47818
|
captureAdditionalDocuments = _ref.captureAdditionalDocuments,
|
|
@@ -47456,6 +47826,26 @@
|
|
|
47456
47826
|
onStepCompleted = _ref.onStepCompleted,
|
|
47457
47827
|
children = _ref.children,
|
|
47458
47828
|
callbacks = _objectWithoutPropertiesLoose(_ref, _excluded$6);
|
|
47829
|
+
// Flow-wide settings reach each step unless its own bag sets them.
|
|
47830
|
+
var _useMemo = React.useMemo(function () {
|
|
47831
|
+
var settings = {
|
|
47832
|
+
lang: lang,
|
|
47833
|
+
debugMode: debugMode,
|
|
47834
|
+
skipSuccessScreen: skipSuccessScreen
|
|
47835
|
+
};
|
|
47836
|
+
return {
|
|
47837
|
+
idView: inheritFlowSettings(idViewProp, settings),
|
|
47838
|
+
faceView: inheritFlowSettings(faceViewProp, settings),
|
|
47839
|
+
signatureView: inheritFlowSettings(signatureViewProp, {
|
|
47840
|
+
lang: lang,
|
|
47841
|
+
showCaptureDiagnostics: debugMode,
|
|
47842
|
+
skipSuccessScreen: skipSuccessScreen
|
|
47843
|
+
})
|
|
47844
|
+
};
|
|
47845
|
+
}, [debugMode, faceViewProp, idViewProp, lang, signatureViewProp, skipSuccessScreen]),
|
|
47846
|
+
idView = _useMemo.idView,
|
|
47847
|
+
faceView = _useMemo.faceView,
|
|
47848
|
+
signatureView = _useMemo.signatureView;
|
|
47459
47849
|
var checkLivenessOptions = faceCapture.checkLivenessOptions,
|
|
47460
47850
|
selfieCaptureConfig = _objectWithoutPropertiesLoose(faceCapture, _excluded2$3);
|
|
47461
47851
|
useMountOnlyWarnings('IdAndFaceValidationFlow', FLOW_MOUNT_ONLY_REMEDY, {
|
|
@@ -47626,12 +48016,13 @@
|
|
|
47626
48016
|
action: SubmissionAction.VALIDATE,
|
|
47627
48017
|
submission: submission,
|
|
47628
48018
|
theme: theme,
|
|
47629
|
-
className: className
|
|
48019
|
+
className: className,
|
|
48020
|
+
lang: lang
|
|
47630
48021
|
}, callbacks, {
|
|
47631
48022
|
children: [jsx(CompositeWizard, _extends$1({}, ringScreens, {
|
|
47632
48023
|
steps: steps,
|
|
47633
48024
|
initialArtifacts: initialArtifacts,
|
|
47634
|
-
|
|
48025
|
+
showResultScreen: showResultScreen != null ? showResultScreen : showSuccessScreen,
|
|
47635
48026
|
showDiagnostics: showDiagnostics,
|
|
47636
48027
|
onSubmitted: onSubmitted,
|
|
47637
48028
|
onStepStarted: onStepStarted,
|
|
@@ -47686,9 +48077,9 @@
|
|
|
47686
48077
|
_ref$signatureCapture = _ref.signatureCapture,
|
|
47687
48078
|
signatureCapture = _ref$signatureCapture === void 0 ? EMPTY_SIGNATURE_CAPTURE$3 : _ref$signatureCapture,
|
|
47688
48079
|
_ref$faceView = _ref.faceView,
|
|
47689
|
-
|
|
48080
|
+
faceViewProp = _ref$faceView === void 0 ? EMPTY_FACE_VIEW$3 : _ref$faceView,
|
|
47690
48081
|
_ref$signatureView = _ref.signatureView,
|
|
47691
|
-
|
|
48082
|
+
signatureViewProp = _ref$signatureView === void 0 ? EMPTY_SIGNATURE_VIEW : _ref$signatureView,
|
|
47692
48083
|
challengeResponse = _ref.challengeResponse,
|
|
47693
48084
|
allowVirtualCameras = _ref.allowVirtualCameras,
|
|
47694
48085
|
_ref$allowHigherCamer = _ref.allowHigherCameraResolutions,
|
|
@@ -47714,13 +48105,35 @@
|
|
|
47714
48105
|
initialArtifacts = _ref$initialArtifacts === void 0 ? EMPTY_ARTIFACTS$6 : _ref$initialArtifacts,
|
|
47715
48106
|
theme = _ref.theme,
|
|
47716
48107
|
className = _ref.className,
|
|
48108
|
+
lang = _ref.lang,
|
|
48109
|
+
debugMode = _ref.debugMode,
|
|
47717
48110
|
geolocationEnabled = _ref.geolocationEnabled,
|
|
47718
48111
|
geolocationRequired = _ref.geolocationRequired,
|
|
47719
48112
|
captureProgress = _ref.captureProgress,
|
|
47720
48113
|
remoteDiagnostics = _ref.remoteDiagnostics,
|
|
47721
48114
|
loadingSpinner = _ref.loadingSpinner,
|
|
48115
|
+
_ref$submitMode = _ref.submitMode,
|
|
48116
|
+
submitMode = _ref$submitMode === void 0 ? 'capture' : _ref$submitMode,
|
|
48117
|
+
onSubmissionStarted = _ref.onSubmissionStarted,
|
|
48118
|
+
onSubmissionFailure = _ref.onSubmissionFailure,
|
|
47722
48119
|
onCaptured = _ref.onCaptured,
|
|
47723
48120
|
onCaptureError = _ref.onCaptureError;
|
|
48121
|
+
// Flow-wide settings reach each step unless its own bag sets them.
|
|
48122
|
+
var _useMemo = React.useMemo(function () {
|
|
48123
|
+
return {
|
|
48124
|
+
faceView: inheritFlowSettings(faceViewProp, {
|
|
48125
|
+
lang: lang,
|
|
48126
|
+
debugMode: debugMode
|
|
48127
|
+
}),
|
|
48128
|
+
signatureView: inheritFlowSettings(signatureViewProp, {
|
|
48129
|
+
lang: lang,
|
|
48130
|
+
showCaptureDiagnostics: debugMode,
|
|
48131
|
+
skipSuccessScreen: skipSuccessScreen
|
|
48132
|
+
})
|
|
48133
|
+
};
|
|
48134
|
+
}, [debugMode, faceViewProp, lang, signatureViewProp, skipSuccessScreen]),
|
|
48135
|
+
faceView = _useMemo.faceView,
|
|
48136
|
+
signatureView = _useMemo.signatureView;
|
|
47724
48137
|
var checkLivenessOptions = faceCapture.checkLivenessOptions,
|
|
47725
48138
|
selfieCaptureConfig = _objectWithoutPropertiesLoose(faceCapture, _excluded$5);
|
|
47726
48139
|
useMountOnlyWarnings('SignatureKYCFlow', FLOW_MOUNT_ONLY_REMEDY, {
|
|
@@ -47731,7 +48144,7 @@
|
|
|
47731
48144
|
var latestSelfieCapture = useLatestCallbacks(selfieCaptureConfig);
|
|
47732
48145
|
var latestSelfieLiveness = useLatestCallbacks(selfieCaptureConfig.liveness);
|
|
47733
48146
|
var latestSignatureCapture = useLatestCallbacks(signatureCapture);
|
|
47734
|
-
var legacyVideoLayout = (_signatureView$legacy = signatureView
|
|
48147
|
+
var legacyVideoLayout = (_signatureView$legacy = signatureView.legacyVideoLayout) != null ? _signatureView$legacy : false;
|
|
47735
48148
|
var onExitAfterLivenessFailure = faceView.onExitAfterFailure;
|
|
47736
48149
|
var sharedVideoRef = React.useRef(null);
|
|
47737
48150
|
var _useState = React.useState(null),
|
|
@@ -47898,13 +48311,21 @@
|
|
|
47898
48311
|
resolvedSelfieController.actions.retry();
|
|
47899
48312
|
setStage('face-liveness');
|
|
47900
48313
|
}, [resolvedSelfieController]);
|
|
48314
|
+
// Lives here, above the chassis's session gate: a session error unmounts
|
|
48315
|
+
// and remounts `SignatureHandoff`, and must not start the hand-off again.
|
|
48316
|
+
var handoffStartedRef = React.useRef(false);
|
|
48317
|
+
var claimHandoffStart = React.useCallback(function () {
|
|
48318
|
+
if (handoffStartedRef.current) return false;
|
|
48319
|
+
handoffStartedRef.current = true;
|
|
48320
|
+
return true;
|
|
48321
|
+
}, []);
|
|
47901
48322
|
var handleSignatureCompleted = React.useCallback(function (artifacts) {
|
|
47902
48323
|
if (completedRef.current) return;
|
|
47903
48324
|
completedRef.current = true;
|
|
47904
48325
|
artifactsRef.current = mergeSubmissionArtifacts(artifactsRef.current, artifacts);
|
|
47905
48326
|
setStage('complete');
|
|
47906
|
-
onCaptured == null || onCaptured(artifactsRef.current);
|
|
47907
|
-
}, [onCaptured]);
|
|
48327
|
+
if (submitMode === 'capture') onCaptured == null || onCaptured(artifactsRef.current);
|
|
48328
|
+
}, [onCaptured, submitMode]);
|
|
47908
48329
|
var handleLivenessFailureExit = React.useCallback(function () {
|
|
47909
48330
|
onExitAfterLivenessFailure == null || onExitAfterLivenessFailure();
|
|
47910
48331
|
if (allowSignatureAfterLivenessCheckFailure) handleLivenessDone();
|
|
@@ -47913,18 +48334,25 @@
|
|
|
47913
48334
|
client: client,
|
|
47914
48335
|
action: SubmissionAction.NONE,
|
|
47915
48336
|
submission: submission,
|
|
48337
|
+
submitMode: submitMode,
|
|
48338
|
+
onSubmissionStarted: onSubmissionStarted,
|
|
48339
|
+
onSubmissionFailure: onSubmissionFailure,
|
|
47916
48340
|
theme: theme,
|
|
47917
48341
|
className: className,
|
|
48342
|
+
lang: lang,
|
|
47918
48343
|
geolocationEnabled: geolocationEnabled,
|
|
47919
48344
|
geolocationRequired: geolocationRequired,
|
|
47920
48345
|
captureProgress: captureProgress,
|
|
47921
48346
|
remoteDiagnostics: remoteDiagnostics,
|
|
47922
48347
|
loadingSpinner: loadingSpinner,
|
|
47923
48348
|
children: [jsx(CaptureProgressCompletion, {
|
|
47924
|
-
completed: stage === 'complete'
|
|
47925
|
-
}), stage
|
|
48349
|
+
completed: stage === 'complete' && submitMode === 'capture'
|
|
48350
|
+
}), stage === 'complete' && submitMode !== 'capture' ? jsx(SignatureHandoff, {
|
|
48351
|
+
artifacts: artifactsRef.current,
|
|
48352
|
+
claimStart: claimHandoffStart
|
|
48353
|
+
}) : null, stage !== 'complete' ? jsxs(HandoffRoot, {
|
|
47926
48354
|
children: [jsx(SignatureCaptureView, _extends$1({}, signatureView, {
|
|
47927
|
-
skipSuccessScreen: impliedSkipSuccessScreen(
|
|
48355
|
+
skipSuccessScreen: impliedSkipSuccessScreen(signatureView.skipSuccessScreen, isRingIntroActive(faceView)),
|
|
47928
48356
|
controller: resolvedSignatureController,
|
|
47929
48357
|
sessionReady: renderedStage === 'signature-capture',
|
|
47930
48358
|
videoRef: sharedVideoRef,
|
|
@@ -47972,6 +48400,43 @@
|
|
|
47972
48400
|
}) : null]
|
|
47973
48401
|
});
|
|
47974
48402
|
}
|
|
48403
|
+
/**
|
|
48404
|
+
* Hands the finished capture off once the session has passed: a finishing
|
|
48405
|
+
* screen while the request is built, a retry screen if that fails, and
|
|
48406
|
+
* nothing once it has been handed off.
|
|
48407
|
+
*/
|
|
48408
|
+
function SignatureHandoff(_ref3) {
|
|
48409
|
+
var artifacts = _ref3.artifacts,
|
|
48410
|
+
claimStart = _ref3.claimStart;
|
|
48411
|
+
var _useSubmission = useSubmission(),
|
|
48412
|
+
action = _useSubmission.action,
|
|
48413
|
+
submit = _useSubmission.submit,
|
|
48414
|
+
submissionStatus = _useSubmission.submissionStatus,
|
|
48415
|
+
submissionError = _useSubmission.submissionError;
|
|
48416
|
+
var sessionReady = useSessionReady();
|
|
48417
|
+
// The provider reports a failure itself; these catches only keep the
|
|
48418
|
+
// rejection from going unhandled.
|
|
48419
|
+
React.useEffect(function () {
|
|
48420
|
+
if (!sessionReady || !claimStart()) return;
|
|
48421
|
+
submit(artifacts)["catch"](function () {});
|
|
48422
|
+
}, [artifacts, claimStart, sessionReady, submit]);
|
|
48423
|
+
if (submissionStatus === SubmissionStatus.SUBMITTED) return null;
|
|
48424
|
+
if (submissionStatus === SubmissionStatus.FAILED) {
|
|
48425
|
+
return jsx(SubmissionErrorOverlay, {
|
|
48426
|
+
error: submissionError,
|
|
48427
|
+
onRetry: function onRetry() {
|
|
48428
|
+
submit(artifacts)["catch"](function () {});
|
|
48429
|
+
}
|
|
48430
|
+
});
|
|
48431
|
+
}
|
|
48432
|
+
var text = submissionStatusText(action, artifacts);
|
|
48433
|
+
return jsx(OrbStatusScreen, {
|
|
48434
|
+
state: "working",
|
|
48435
|
+
text: text,
|
|
48436
|
+
accessibleLabel: text,
|
|
48437
|
+
loadingStage: "submission"
|
|
48438
|
+
});
|
|
48439
|
+
}
|
|
47975
48440
|
/**
|
|
47976
48441
|
* Black, so iOS Safari's bars read as letterboxing around the camera feed
|
|
47977
48442
|
* rather than as one more colour a theme has to choose.
|
|
@@ -47989,10 +48454,10 @@
|
|
|
47989
48454
|
* no flat strip can sit on its bottom edge unseen: that one is drawn invisibly,
|
|
47990
48455
|
* as on ID capture's overlay. Opaque, it covered the bottom 12px of the bar.
|
|
47991
48456
|
*/
|
|
47992
|
-
function FlowEdgeTint(
|
|
48457
|
+
function FlowEdgeTint(_ref4) {
|
|
47993
48458
|
var _theme$selfieCapture$, _theme$selfieCapture, _theme$background;
|
|
47994
|
-
var surface =
|
|
47995
|
-
modelsReady =
|
|
48459
|
+
var surface = _ref4.surface,
|
|
48460
|
+
modelsReady = _ref4.modelsReady;
|
|
47996
48461
|
var theme = useTheme();
|
|
47997
48462
|
if (theme.isFullscreen === false || surface === null) return null;
|
|
47998
48463
|
var color = opaqueColor(surface === 'camera' ? CAMERA_EDGE_COLOR : surface === 'overlay' ? (_theme$selfieCapture$ = (_theme$selfieCapture = theme.selfieCapture) == null || (_theme$selfieCapture = _theme$selfieCapture.loadingOverlay) == null ? void 0 : _theme$selfieCapture.backgroundColor) != null ? _theme$selfieCapture$ : SELFIE_LOADING_OVERLAY_BACKGROUND_DEFAULT : (_theme$background = theme.background) != null ? _theme$background : '#fff');
|
|
@@ -48002,9 +48467,9 @@
|
|
|
48002
48467
|
hiddenBottomColor: surface === 'overlay' ? selfieLoadingOverlayBottomEdgeColor(theme, modelsReady) : undefined
|
|
48003
48468
|
});
|
|
48004
48469
|
}
|
|
48005
|
-
function SelfieTrackerAttachment(
|
|
48006
|
-
var controller =
|
|
48007
|
-
video =
|
|
48470
|
+
function SelfieTrackerAttachment(_ref5) {
|
|
48471
|
+
var controller = _ref5.controller,
|
|
48472
|
+
video = _ref5.video;
|
|
48008
48473
|
React.useEffect(function () {
|
|
48009
48474
|
if (!video) return;
|
|
48010
48475
|
void controller.attach(video)["catch"](function () {
|
|
@@ -48022,7 +48487,7 @@
|
|
|
48022
48487
|
return props.$visible ? 'block' : 'none';
|
|
48023
48488
|
});
|
|
48024
48489
|
|
|
48025
|
-
var _excluded$4 = ["client", "idController", "selfieController", "controller", "idCapture", "faceCapture", "capture", "idView", "faceView", "view", "submission", "initialArtifacts", "captureOnly", "signatureController", "signatureCapture", "signatureView", "captureSignature", "captureSignatureVideo", "allowVirtualCameras", "skipIdCapture", "matchOnly", "readTextPrompt", "onMicrophoneAccessDenied", "theme", "className", "showSuccessScreen", "showDiagnostics", "captureAdditionalDocuments", "additionalDocumentClassNames", "additionalDocumentVerbiage", "ringScreenClassNames", "ringScreenVerbiage", "onCaptured", "onSubmitted", "onCaptureError", "children"],
|
|
48490
|
+
var _excluded$4 = ["client", "idController", "selfieController", "controller", "idCapture", "faceCapture", "capture", "idView", "faceView", "view", "submission", "initialArtifacts", "submitMode", "captureOnly", "signatureController", "signatureCapture", "signatureView", "captureSignature", "captureSignatureVideo", "allowVirtualCameras", "skipIdCapture", "matchOnly", "readTextPrompt", "onMicrophoneAccessDenied", "theme", "className", "lang", "debugMode", "skipSuccessScreen", "showResultScreen", "showSuccessScreen", "showDiagnostics", "captureAdditionalDocuments", "additionalDocumentClassNames", "additionalDocumentVerbiage", "ringScreenClassNames", "ringScreenVerbiage", "onCaptured", "onSubmitted", "onCaptureError", "children"],
|
|
48026
48491
|
_excluded2$2 = ["checkLivenessOptions"];
|
|
48027
48492
|
var EMPTY_ID_CAPTURE$1 = {};
|
|
48028
48493
|
var EMPTY_FACE_CAPTURE$2 = {};
|
|
@@ -48046,21 +48511,21 @@
|
|
|
48046
48511
|
_ref$capture = _ref.capture,
|
|
48047
48512
|
capture = _ref$capture === void 0 ? EMPTY_VIDEO_CAPTURE : _ref$capture,
|
|
48048
48513
|
_ref$idView = _ref.idView,
|
|
48049
|
-
|
|
48514
|
+
idViewProp = _ref$idView === void 0 ? EMPTY_ID_VIEW$1 : _ref$idView,
|
|
48050
48515
|
_ref$faceView = _ref.faceView,
|
|
48051
|
-
|
|
48516
|
+
faceViewProp = _ref$faceView === void 0 ? EMPTY_FACE_VIEW$2 : _ref$faceView,
|
|
48052
48517
|
_ref$view = _ref.view,
|
|
48053
|
-
|
|
48518
|
+
viewProp = _ref$view === void 0 ? EMPTY_VIDEO_VIEW : _ref$view,
|
|
48054
48519
|
_ref$submission = _ref.submission,
|
|
48055
48520
|
submission = _ref$submission === void 0 ? EMPTY_SUBMISSION$2 : _ref$submission,
|
|
48056
48521
|
_ref$initialArtifacts = _ref.initialArtifacts,
|
|
48057
48522
|
initialArtifacts = _ref$initialArtifacts === void 0 ? EMPTY_ARTIFACTS$5 : _ref$initialArtifacts,
|
|
48058
|
-
|
|
48059
|
-
captureOnly = _ref
|
|
48523
|
+
submitMode = _ref.submitMode,
|
|
48524
|
+
captureOnly = _ref.captureOnly,
|
|
48060
48525
|
signatureController = _ref.signatureController,
|
|
48061
48526
|
_ref$signatureCapture = _ref.signatureCapture,
|
|
48062
48527
|
signatureCapture = _ref$signatureCapture === void 0 ? EMPTY_SIGNATURE_CAPTURE$2 : _ref$signatureCapture,
|
|
48063
|
-
|
|
48528
|
+
signatureViewProp = _ref.signatureView,
|
|
48064
48529
|
captureSignature = _ref.captureSignature,
|
|
48065
48530
|
captureSignatureVideo = _ref.captureSignatureVideo,
|
|
48066
48531
|
allowVirtualCameras = _ref.allowVirtualCameras,
|
|
@@ -48072,8 +48537,11 @@
|
|
|
48072
48537
|
onMicrophoneAccessDenied = _ref.onMicrophoneAccessDenied,
|
|
48073
48538
|
theme = _ref.theme,
|
|
48074
48539
|
className = _ref.className,
|
|
48075
|
-
|
|
48076
|
-
|
|
48540
|
+
lang = _ref.lang,
|
|
48541
|
+
debugMode = _ref.debugMode,
|
|
48542
|
+
skipSuccessScreen = _ref.skipSuccessScreen,
|
|
48543
|
+
showResultScreen = _ref.showResultScreen,
|
|
48544
|
+
showSuccessScreen = _ref.showSuccessScreen,
|
|
48077
48545
|
_ref$showDiagnostics = _ref.showDiagnostics,
|
|
48078
48546
|
showDiagnostics = _ref$showDiagnostics === void 0 ? false : _ref$showDiagnostics,
|
|
48079
48547
|
captureAdditionalDocuments = _ref.captureAdditionalDocuments,
|
|
@@ -48086,6 +48554,31 @@
|
|
|
48086
48554
|
onCaptureError = _ref.onCaptureError,
|
|
48087
48555
|
children = _ref.children,
|
|
48088
48556
|
callbacks = _objectWithoutPropertiesLoose(_ref, _excluded$4);
|
|
48557
|
+
// Flow-wide settings reach each step unless its own bag sets them.
|
|
48558
|
+
var _useMemo = React.useMemo(function () {
|
|
48559
|
+
var settings = {
|
|
48560
|
+
lang: lang,
|
|
48561
|
+
debugMode: debugMode,
|
|
48562
|
+
skipSuccessScreen: skipSuccessScreen
|
|
48563
|
+
};
|
|
48564
|
+
return {
|
|
48565
|
+
idView: inheritFlowSettings(idViewProp, settings),
|
|
48566
|
+
faceView: inheritFlowSettings(faceViewProp, settings),
|
|
48567
|
+
view: inheritFlowSettings(viewProp, {
|
|
48568
|
+
lang: lang,
|
|
48569
|
+
debugMode: debugMode
|
|
48570
|
+
}),
|
|
48571
|
+
signatureView: inheritFlowSettings(signatureViewProp, {
|
|
48572
|
+
lang: lang,
|
|
48573
|
+
showCaptureDiagnostics: debugMode,
|
|
48574
|
+
skipSuccessScreen: skipSuccessScreen
|
|
48575
|
+
})
|
|
48576
|
+
};
|
|
48577
|
+
}, [debugMode, faceViewProp, idViewProp, lang, signatureViewProp, skipSuccessScreen, viewProp]),
|
|
48578
|
+
idView = _useMemo.idView,
|
|
48579
|
+
faceView = _useMemo.faceView,
|
|
48580
|
+
view = _useMemo.view,
|
|
48581
|
+
signatureView = _useMemo.signatureView;
|
|
48089
48582
|
var checkLivenessOptions = faceCapture.checkLivenessOptions,
|
|
48090
48583
|
selfieCaptureConfig = _objectWithoutPropertiesLoose(faceCapture, _excluded2$2);
|
|
48091
48584
|
useMountOnlyWarnings('VideoIdValidationFlow', FLOW_MOUNT_ONLY_REMEDY, {
|
|
@@ -48246,18 +48739,21 @@
|
|
|
48246
48739
|
successIssuerCaptionText: 'confirmed'
|
|
48247
48740
|
}
|
|
48248
48741
|
});
|
|
48742
|
+
var mode = submitMode != null ? submitMode : captureOnly ? 'capture' : undefined;
|
|
48249
48743
|
return jsxs(FlowChassis, _extends$1({
|
|
48250
48744
|
client: client,
|
|
48251
48745
|
action: action,
|
|
48252
48746
|
submission: submission,
|
|
48747
|
+
submitMode: mode,
|
|
48253
48748
|
theme: theme,
|
|
48254
|
-
className: className
|
|
48749
|
+
className: className,
|
|
48750
|
+
lang: lang
|
|
48255
48751
|
}, callbacks, {
|
|
48256
48752
|
children: [jsx(CompositeWizard, _extends$1({}, ringScreens, {
|
|
48257
48753
|
steps: steps,
|
|
48258
48754
|
initialArtifacts: initialArtifacts,
|
|
48259
|
-
captureOnly:
|
|
48260
|
-
|
|
48755
|
+
captureOnly: mode === 'capture',
|
|
48756
|
+
showResultScreen: showResultScreen != null ? showResultScreen : showSuccessScreen,
|
|
48261
48757
|
showDiagnostics: showDiagnostics,
|
|
48262
48758
|
onArtifactsCollected: onCaptured,
|
|
48263
48759
|
onSubmitted: onSubmitted
|
|
@@ -51100,7 +51596,7 @@
|
|
|
51100
51596
|
};
|
|
51101
51597
|
}
|
|
51102
51598
|
|
|
51103
|
-
var _excluded$3 = ["client", "controller", "capture", "view", "documents", "submission", "initialArtifacts", "theme", "className", "onDocumentCaptured", "onDocumentUploaded", "onComplete", "children"];
|
|
51599
|
+
var _excluded$3 = ["client", "controller", "capture", "view", "documents", "submission", "initialArtifacts", "theme", "className", "lang", "debugMode", "onDocumentCaptured", "onDocumentUploaded", "onComplete", "children"];
|
|
51104
51600
|
var EMPTY_DOCUMENTS = [];
|
|
51105
51601
|
var EMPTY_CAPTURE$1 = {};
|
|
51106
51602
|
var EMPTY_VIEW$2 = {};
|
|
@@ -51121,6 +51617,8 @@
|
|
|
51121
51617
|
initialArtifacts = _ref$initialArtifacts === void 0 ? EMPTY_ARTIFACTS$4 : _ref$initialArtifacts,
|
|
51122
51618
|
theme = _ref.theme,
|
|
51123
51619
|
className = _ref.className,
|
|
51620
|
+
lang = _ref.lang,
|
|
51621
|
+
debugMode = _ref.debugMode,
|
|
51124
51622
|
onDocumentCaptured = _ref.onDocumentCaptured,
|
|
51125
51623
|
onDocumentUploaded = _ref.onDocumentUploaded,
|
|
51126
51624
|
onComplete = _ref.onComplete,
|
|
@@ -51217,8 +51715,11 @@
|
|
|
51217
51715
|
var steps = React.useMemo(function () {
|
|
51218
51716
|
return [buildDocumentCaptureStep(resolvedController, _extends$1({
|
|
51219
51717
|
documents: documents
|
|
51220
|
-
}, view
|
|
51221
|
-
|
|
51718
|
+
}, inheritFlowSettings(view, {
|
|
51719
|
+
lang: lang,
|
|
51720
|
+
debugMode: debugMode
|
|
51721
|
+
})))];
|
|
51722
|
+
}, [debugMode, documents, lang, resolvedController, view]);
|
|
51222
51723
|
var onArtifactsCollected = React.useCallback(function () {
|
|
51223
51724
|
// captureOnly hands the (empty) artifacts back here; completion is reported
|
|
51224
51725
|
// through onComplete with the documents instead.
|
|
@@ -51228,7 +51729,8 @@
|
|
|
51228
51729
|
action: SubmissionAction.NONE,
|
|
51229
51730
|
submission: submission,
|
|
51230
51731
|
theme: theme,
|
|
51231
|
-
className: className
|
|
51732
|
+
className: className,
|
|
51733
|
+
lang: lang
|
|
51232
51734
|
}, callbacks, {
|
|
51233
51735
|
children: [jsx(CompositeWizard, {
|
|
51234
51736
|
steps: steps,
|
|
@@ -51239,7 +51741,7 @@
|
|
|
51239
51741
|
}));
|
|
51240
51742
|
}
|
|
51241
51743
|
|
|
51242
|
-
var _excluded$2 = ["client", "submission", "selfieController", "signatureController", "faceCapture", "signatureCapture", "faceView", "signatureView", "captureSignature", "captureSignatureVideo", "allowVirtualCameras", "initialArtifacts", "theme", "className", "showSuccessScreen", "showDiagnostics", "captureAdditionalDocuments", "additionalDocumentClassNames", "additionalDocumentVerbiage", "ringScreenClassNames", "ringScreenVerbiage", "onSubmitted", "onCaptureError", "children"],
|
|
51744
|
+
var _excluded$2 = ["client", "submission", "selfieController", "signatureController", "faceCapture", "signatureCapture", "faceView", "signatureView", "captureSignature", "captureSignatureVideo", "allowVirtualCameras", "initialArtifacts", "theme", "className", "lang", "debugMode", "skipSuccessScreen", "showResultScreen", "showSuccessScreen", "showDiagnostics", "captureAdditionalDocuments", "additionalDocumentClassNames", "additionalDocumentVerbiage", "ringScreenClassNames", "ringScreenVerbiage", "onSubmitted", "onCaptureError", "children"],
|
|
51243
51745
|
_excluded2$1 = ["checkLivenessOptions"];
|
|
51244
51746
|
var EMPTY_FACE_CAPTURE$1 = {};
|
|
51245
51747
|
var EMPTY_SIGNATURE_CAPTURE$1 = {};
|
|
@@ -51256,8 +51758,8 @@
|
|
|
51256
51758
|
_ref$signatureCapture = _ref.signatureCapture,
|
|
51257
51759
|
signatureCapture = _ref$signatureCapture === void 0 ? EMPTY_SIGNATURE_CAPTURE$1 : _ref$signatureCapture,
|
|
51258
51760
|
_ref$faceView = _ref.faceView,
|
|
51259
|
-
|
|
51260
|
-
|
|
51761
|
+
faceViewProp = _ref$faceView === void 0 ? EMPTY_FACE_VIEW$1 : _ref$faceView,
|
|
51762
|
+
signatureViewProp = _ref.signatureView,
|
|
51261
51763
|
captureSignature = _ref.captureSignature,
|
|
51262
51764
|
captureSignatureVideo = _ref.captureSignatureVideo,
|
|
51263
51765
|
allowVirtualCameras = _ref.allowVirtualCameras,
|
|
@@ -51265,8 +51767,11 @@
|
|
|
51265
51767
|
initialArtifacts = _ref$initialArtifacts === void 0 ? EMPTY_ARTIFACTS$3 : _ref$initialArtifacts,
|
|
51266
51768
|
theme = _ref.theme,
|
|
51267
51769
|
className = _ref.className,
|
|
51268
|
-
|
|
51269
|
-
|
|
51770
|
+
lang = _ref.lang,
|
|
51771
|
+
debugMode = _ref.debugMode,
|
|
51772
|
+
skipSuccessScreen = _ref.skipSuccessScreen,
|
|
51773
|
+
showResultScreen = _ref.showResultScreen,
|
|
51774
|
+
showSuccessScreen = _ref.showSuccessScreen,
|
|
51270
51775
|
_ref$showDiagnostics = _ref.showDiagnostics,
|
|
51271
51776
|
showDiagnostics = _ref$showDiagnostics === void 0 ? false : _ref$showDiagnostics,
|
|
51272
51777
|
captureAdditionalDocuments = _ref.captureAdditionalDocuments,
|
|
@@ -51278,6 +51783,23 @@
|
|
|
51278
51783
|
onCaptureError = _ref.onCaptureError,
|
|
51279
51784
|
children = _ref.children,
|
|
51280
51785
|
callbacks = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
51786
|
+
// Flow-wide settings reach each step unless its own bag sets them.
|
|
51787
|
+
var _useMemo = React.useMemo(function () {
|
|
51788
|
+
return {
|
|
51789
|
+
faceView: inheritFlowSettings(faceViewProp, {
|
|
51790
|
+
lang: lang,
|
|
51791
|
+
debugMode: debugMode,
|
|
51792
|
+
skipSuccessScreen: skipSuccessScreen
|
|
51793
|
+
}),
|
|
51794
|
+
signatureView: inheritFlowSettings(signatureViewProp, {
|
|
51795
|
+
lang: lang,
|
|
51796
|
+
showCaptureDiagnostics: debugMode,
|
|
51797
|
+
skipSuccessScreen: skipSuccessScreen
|
|
51798
|
+
})
|
|
51799
|
+
};
|
|
51800
|
+
}, [debugMode, faceViewProp, lang, signatureViewProp, skipSuccessScreen]),
|
|
51801
|
+
faceView = _useMemo.faceView,
|
|
51802
|
+
signatureView = _useMemo.signatureView;
|
|
51281
51803
|
var checkLivenessOptions = faceCapture.checkLivenessOptions,
|
|
51282
51804
|
selfieCaptureConfig = _objectWithoutPropertiesLoose(faceCapture, _excluded2$1);
|
|
51283
51805
|
useMountOnlyWarnings('CustomerBiometricsEnrollmentFlow', FLOW_MOUNT_ONLY_REMEDY, {
|
|
@@ -51409,19 +51931,20 @@
|
|
|
51409
51931
|
submission: submission,
|
|
51410
51932
|
showEnrollmentId: showDiagnostics,
|
|
51411
51933
|
theme: theme,
|
|
51412
|
-
className: className
|
|
51934
|
+
className: className,
|
|
51935
|
+
lang: lang
|
|
51413
51936
|
}, callbacks, {
|
|
51414
51937
|
children: [jsx(CompositeWizard, _extends$1({}, ringScreens, {
|
|
51415
51938
|
steps: steps,
|
|
51416
51939
|
initialArtifacts: initialArtifacts,
|
|
51417
|
-
|
|
51940
|
+
showResultScreen: showResultScreen != null ? showResultScreen : showSuccessScreen,
|
|
51418
51941
|
showDiagnostics: showDiagnostics,
|
|
51419
51942
|
onSubmitted: onSubmitted
|
|
51420
51943
|
})), children]
|
|
51421
51944
|
}));
|
|
51422
51945
|
}
|
|
51423
51946
|
|
|
51424
|
-
var _excluded$1 = ["client", "submission", "idController", "selfieController", "signatureController", "videoIdController", "idCapture", "faceCapture", "signatureCapture", "videoIdCapture", "idView", "faceView", "signatureView", "videoIdView", "captureSignature", "captureSignatureVideo", "captureVideoId", "allowVirtualCameras", "initialArtifacts", "theme", "className", "showSuccessScreen", "showDiagnostics", "captureAdditionalDocuments", "additionalDocumentClassNames", "additionalDocumentVerbiage", "ringScreenClassNames", "ringScreenVerbiage", "onSubmitted", "onCaptureError", "children"],
|
|
51947
|
+
var _excluded$1 = ["client", "submission", "idController", "selfieController", "signatureController", "videoIdController", "idCapture", "faceCapture", "signatureCapture", "videoIdCapture", "idView", "faceView", "signatureView", "videoIdView", "captureSignature", "captureSignatureVideo", "captureVideoId", "allowVirtualCameras", "initialArtifacts", "theme", "className", "lang", "debugMode", "skipSuccessScreen", "showResultScreen", "showSuccessScreen", "showDiagnostics", "captureAdditionalDocuments", "additionalDocumentClassNames", "additionalDocumentVerbiage", "ringScreenClassNames", "ringScreenVerbiage", "onSubmitted", "onCaptureError", "children"],
|
|
51425
51948
|
_excluded2 = ["checkLivenessOptions"];
|
|
51426
51949
|
var EMPTY_ID_CAPTURE = {};
|
|
51427
51950
|
var EMPTY_FACE_CAPTURE = {};
|
|
@@ -51454,11 +51977,11 @@
|
|
|
51454
51977
|
_ref$videoIdCapture = _ref.videoIdCapture,
|
|
51455
51978
|
videoIdCapture = _ref$videoIdCapture === void 0 ? EMPTY_VIDEO_ID_CAPTURE : _ref$videoIdCapture,
|
|
51456
51979
|
_ref$idView = _ref.idView,
|
|
51457
|
-
|
|
51980
|
+
idViewProp = _ref$idView === void 0 ? EMPTY_ID_VIEW : _ref$idView,
|
|
51458
51981
|
_ref$faceView = _ref.faceView,
|
|
51459
|
-
|
|
51460
|
-
|
|
51461
|
-
|
|
51982
|
+
faceViewProp = _ref$faceView === void 0 ? EMPTY_FACE_VIEW : _ref$faceView,
|
|
51983
|
+
signatureViewProp = _ref.signatureView,
|
|
51984
|
+
videoIdViewProp = _ref.videoIdView,
|
|
51462
51985
|
captureSignature = _ref.captureSignature,
|
|
51463
51986
|
captureSignatureVideo = _ref.captureSignatureVideo,
|
|
51464
51987
|
_ref$captureVideoId = _ref.captureVideoId,
|
|
@@ -51468,8 +51991,11 @@
|
|
|
51468
51991
|
initialArtifacts = _ref$initialArtifacts === void 0 ? EMPTY_ARTIFACTS$2 : _ref$initialArtifacts,
|
|
51469
51992
|
theme = _ref.theme,
|
|
51470
51993
|
className = _ref.className,
|
|
51471
|
-
|
|
51472
|
-
|
|
51994
|
+
lang = _ref.lang,
|
|
51995
|
+
debugMode = _ref.debugMode,
|
|
51996
|
+
skipSuccessScreen = _ref.skipSuccessScreen,
|
|
51997
|
+
showResultScreen = _ref.showResultScreen,
|
|
51998
|
+
showSuccessScreen = _ref.showSuccessScreen,
|
|
51473
51999
|
_ref$showDiagnostics = _ref.showDiagnostics,
|
|
51474
52000
|
showDiagnostics = _ref$showDiagnostics === void 0 ? false : _ref$showDiagnostics,
|
|
51475
52001
|
captureAdditionalDocuments = _ref.captureAdditionalDocuments,
|
|
@@ -51481,7 +52007,31 @@
|
|
|
51481
52007
|
onCaptureError = _ref.onCaptureError,
|
|
51482
52008
|
children = _ref.children,
|
|
51483
52009
|
callbacks = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
51484
|
-
|
|
52010
|
+
// Flow-wide settings reach each step unless its own bag sets them.
|
|
52011
|
+
var _useMemo = React.useMemo(function () {
|
|
52012
|
+
var settings = {
|
|
52013
|
+
lang: lang,
|
|
52014
|
+
debugMode: debugMode,
|
|
52015
|
+
skipSuccessScreen: skipSuccessScreen
|
|
52016
|
+
};
|
|
52017
|
+
return {
|
|
52018
|
+
idView: inheritFlowSettings(idViewProp, settings),
|
|
52019
|
+
faceView: inheritFlowSettings(faceViewProp, settings),
|
|
52020
|
+
signatureView: inheritFlowSettings(signatureViewProp, {
|
|
52021
|
+
lang: lang,
|
|
52022
|
+
showCaptureDiagnostics: debugMode,
|
|
52023
|
+
skipSuccessScreen: skipSuccessScreen
|
|
52024
|
+
}),
|
|
52025
|
+
videoIdView: inheritFlowSettings(videoIdViewProp, {
|
|
52026
|
+
lang: lang,
|
|
52027
|
+
debugMode: debugMode
|
|
52028
|
+
})
|
|
52029
|
+
};
|
|
52030
|
+
}, [debugMode, faceViewProp, idViewProp, lang, signatureViewProp, skipSuccessScreen, videoIdViewProp]),
|
|
52031
|
+
idView = _useMemo.idView,
|
|
52032
|
+
faceView = _useMemo.faceView,
|
|
52033
|
+
signatureView = _useMemo.signatureView,
|
|
52034
|
+
videoIdView = _useMemo.videoIdView;
|
|
51485
52035
|
var checkLivenessOptions = faceCapture.checkLivenessOptions,
|
|
51486
52036
|
selfieCaptureConfig = _objectWithoutPropertiesLoose(faceCapture, _excluded2);
|
|
51487
52037
|
useMountOnlyWarnings('CustomerIdAndBiometricsEnrollmentFlow', FLOW_MOUNT_ONLY_REMEDY, {
|
|
@@ -51697,26 +52247,31 @@
|
|
|
51697
52247
|
submission: submission,
|
|
51698
52248
|
showEnrollmentId: showDiagnostics,
|
|
51699
52249
|
theme: theme,
|
|
51700
|
-
className: className
|
|
52250
|
+
className: className,
|
|
52251
|
+
lang: lang
|
|
51701
52252
|
}, callbacks, {
|
|
51702
52253
|
children: [steps ? jsx(CompositeWizard, _extends$1({}, ringScreens, {
|
|
51703
52254
|
steps: steps,
|
|
51704
52255
|
initialArtifacts: initialArtifacts,
|
|
51705
|
-
|
|
52256
|
+
showResultScreen: showResultScreen != null ? showResultScreen : showSuccessScreen,
|
|
51706
52257
|
showDiagnostics: showDiagnostics,
|
|
51707
52258
|
onSubmitted: onSubmitted
|
|
51708
|
-
})) :
|
|
51709
|
-
// `loadingStage` is what enables the customer's `loadingSpinner`:
|
|
51710
|
-
// without it OrbStatusScreen hard-renders the orb, so this was the one
|
|
51711
|
-
// loading surface in the SDK that ignored a supplied component
|
|
51712
|
-
// outright — in the flow whose double-loader prompted the fix.
|
|
51713
|
-
jsx(OrbStatusScreen, {
|
|
51714
|
-
state: "solving",
|
|
51715
|
-
text: preparing.preparingText,
|
|
51716
|
-
loadingStage: "preparing"
|
|
51717
|
-
}), children]
|
|
52259
|
+
})) : jsx(PreparingScreen, {}), children]
|
|
51718
52260
|
}));
|
|
51719
52261
|
}
|
|
52262
|
+
/** Translated inside the chassis, so the flow's `lang` reaches it. */
|
|
52263
|
+
function PreparingScreen() {
|
|
52264
|
+
var preparing = useTranslations(undefined, PREPARING_FALLBACKS);
|
|
52265
|
+
// `loadingStage` is what enables the customer's `loadingSpinner`: without it
|
|
52266
|
+
// OrbStatusScreen hard-renders the orb, so this was the one loading surface
|
|
52267
|
+
// in the SDK that ignored a supplied component outright — in the flow whose
|
|
52268
|
+
// double-loader prompted the fix.
|
|
52269
|
+
return jsx(OrbStatusScreen, {
|
|
52270
|
+
state: "solving",
|
|
52271
|
+
text: preparing.preparingText,
|
|
52272
|
+
loadingStage: "preparing"
|
|
52273
|
+
});
|
|
52274
|
+
}
|
|
51720
52275
|
|
|
51721
52276
|
var ALLOWED_MISMATCH_RETRIES$1 = 0;
|
|
51722
52277
|
var MAX_LIVENESS_ATTEMPTS$1 = 3;
|
|
@@ -52384,6 +52939,8 @@
|
|
|
52384
52939
|
view = _ref$view === void 0 ? EMPTY_VIEW : _ref$view,
|
|
52385
52940
|
theme = _ref.theme,
|
|
52386
52941
|
className = _ref.className,
|
|
52942
|
+
lang = _ref.lang,
|
|
52943
|
+
debugMode = _ref.debugMode,
|
|
52387
52944
|
geolocationEnabled = _ref.geolocationEnabled,
|
|
52388
52945
|
geolocationRequired = _ref.geolocationRequired,
|
|
52389
52946
|
remoteDiagnostics = _ref.remoteDiagnostics,
|
|
@@ -52406,7 +52963,9 @@
|
|
|
52406
52963
|
onComplete = _ref.onComplete,
|
|
52407
52964
|
onCustomerMatched = _ref.onCustomerMatched,
|
|
52408
52965
|
onCustomerNotMatched = _ref.onCustomerNotMatched,
|
|
52966
|
+
onSubmissionFailure = _ref.onSubmissionFailure,
|
|
52409
52967
|
onRequestFailure = _ref.onRequestFailure,
|
|
52968
|
+
submitMode = _ref.submitMode,
|
|
52410
52969
|
onCaptureGuidanceTimeout = _ref.onCaptureGuidanceTimeout,
|
|
52411
52970
|
onExitCapture = _ref.onExitCapture,
|
|
52412
52971
|
onExitAfterFailure = _ref.onExitAfterFailure;
|
|
@@ -52446,7 +53005,10 @@
|
|
|
52446
53005
|
// Only the auto-continue half applies here: the plain SelfieCaptureView has
|
|
52447
53006
|
// no capture review screen to skip (that is FaceLivenessView's), and this
|
|
52448
53007
|
// flow's own terminal screens are governed by `skipSuccessScreen` below.
|
|
52449
|
-
var resolvedView = _extends$1({}, view, {
|
|
53008
|
+
var resolvedView = _extends$1({}, inheritFlowSettings(view, {
|
|
53009
|
+
lang: lang,
|
|
53010
|
+
debugMode: debugMode
|
|
53011
|
+
}), {
|
|
52450
53012
|
autoContinueAfterLoading: impliedAutoContinueAfterLoading(view.autoContinueAfterLoading, introActive)
|
|
52451
53013
|
});
|
|
52452
53014
|
// Reset during render, not in an effect: an auto-requesting capture stage
|
|
@@ -52490,15 +53052,19 @@
|
|
|
52490
53052
|
setOutcome('notMatched');
|
|
52491
53053
|
onCustomerNotMatched == null || onCustomerNotMatched(response);
|
|
52492
53054
|
}, [onCustomerNotMatched]);
|
|
53055
|
+
var reportFailure = onSubmissionFailure != null ? onSubmissionFailure : onRequestFailure;
|
|
52493
53056
|
var handleLivenessCheckFailed = React.useCallback(function (error) {
|
|
52494
53057
|
setOutcome('failed');
|
|
52495
|
-
|
|
52496
|
-
}, [
|
|
53058
|
+
reportFailure == null || reportFailure(error);
|
|
53059
|
+
}, [reportFailure]);
|
|
52497
53060
|
var handleRequestError = React.useCallback(function (error) {
|
|
52498
53061
|
errorRef.current = error;
|
|
52499
53062
|
setOutcome('error');
|
|
52500
|
-
|
|
52501
|
-
}, [
|
|
53063
|
+
reportFailure == null || reportFailure(error);
|
|
53064
|
+
}, [reportFailure]);
|
|
53065
|
+
var handleHandedOff = React.useCallback(function () {
|
|
53066
|
+
return setOutcome('handedOff');
|
|
53067
|
+
}, []);
|
|
52502
53068
|
var handleCaptureGuidanceTimeout = React.useCallback(function () {
|
|
52503
53069
|
setOutcome('failed');
|
|
52504
53070
|
onCaptureGuidanceTimeout == null || onCaptureGuidanceTimeout();
|
|
@@ -52539,8 +53105,10 @@
|
|
|
52539
53105
|
client: client,
|
|
52540
53106
|
action: action,
|
|
52541
53107
|
submission: submission,
|
|
53108
|
+
submitMode: submitMode,
|
|
52542
53109
|
theme: theme,
|
|
52543
53110
|
className: className,
|
|
53111
|
+
lang: lang,
|
|
52544
53112
|
geolocationEnabled: geolocationEnabled,
|
|
52545
53113
|
geolocationRequired: geolocationRequired,
|
|
52546
53114
|
remoteDiagnostics: remoteDiagnostics,
|
|
@@ -52562,6 +53130,7 @@
|
|
|
52562
53130
|
onNotMatched: handleNotMatched,
|
|
52563
53131
|
onLivenessCheckFailed: handleLivenessCheckFailed,
|
|
52564
53132
|
onRequestError: handleRequestError,
|
|
53133
|
+
onSubmissionIntercepted: handleHandedOff,
|
|
52565
53134
|
onCaptureGuidanceTimeout: handleCaptureGuidanceTimeout,
|
|
52566
53135
|
onExitCapture: onExitCapture,
|
|
52567
53136
|
finishingScreen: {
|
|
@@ -52697,6 +53266,84 @@
|
|
|
52697
53266
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
52698
53267
|
};
|
|
52699
53268
|
|
|
53269
|
+
function createIdAndFaceValidationJourneyEvent(event, now) {
|
|
53270
|
+
if (now === void 0) {
|
|
53271
|
+
now = function now() {
|
|
53272
|
+
return new Date();
|
|
53273
|
+
};
|
|
53274
|
+
}
|
|
53275
|
+
return _assign(_assign({}, event), {
|
|
53276
|
+
version: 1,
|
|
53277
|
+
flow: 'id-and-face-validation',
|
|
53278
|
+
timestamp: now().toISOString()
|
|
53279
|
+
});
|
|
53280
|
+
}
|
|
53281
|
+
/**
|
|
53282
|
+
* websdk-ui `CompositeWizardStep.id` -> journey stage.
|
|
53283
|
+
*
|
|
53284
|
+
* Four of the five stage names ARE step ids already; only the additional-
|
|
53285
|
+
* documents step differs, because sdk2's stage vocabulary says
|
|
53286
|
+
* `additional-document-capture` (singular "document") while websdk-ui's step
|
|
53287
|
+
* is `additional-documents`. Unknown ids return undefined so a step this
|
|
53288
|
+
* vocabulary has no name for is silently skipped rather than emitted with a
|
|
53289
|
+
* bogus stage — the same shape as sdk2's partial lookup record.
|
|
53290
|
+
*/
|
|
53291
|
+
function journeyStageForStepId(stepId) {
|
|
53292
|
+
switch (stepId) {
|
|
53293
|
+
case 'id-capture':
|
|
53294
|
+
case 'face-liveness':
|
|
53295
|
+
case 'signature-capture':
|
|
53296
|
+
case 'video-signature-capture':
|
|
53297
|
+
return stepId;
|
|
53298
|
+
case 'additional-documents':
|
|
53299
|
+
return 'additional-document-capture';
|
|
53300
|
+
default:
|
|
53301
|
+
return undefined;
|
|
53302
|
+
}
|
|
53303
|
+
}
|
|
53304
|
+
/**
|
|
53305
|
+
* The document types sdk2 reports as `document.captured`. sdk2 filters the
|
|
53306
|
+
* wizard's `onDocumentStored` through this set (`primaryIdDocumentTypes`) so
|
|
53307
|
+
* that a document type outside the journey vocabulary cannot widen the event.
|
|
53308
|
+
* Kept as a predicate rather than a Set: the ES5 UMD bundle target makes
|
|
53309
|
+
* `for..of` over a Set a downlevel hazard, and a switch needs no iteration.
|
|
53310
|
+
*/
|
|
53311
|
+
function isJourneyDocumentType(documentType) {
|
|
53312
|
+
return documentType === 'idCardFront' || documentType === 'idCardBack' || documentType === 'passport' || documentType === 'singlePage';
|
|
53313
|
+
}
|
|
53314
|
+
/**
|
|
53315
|
+
* The lazy `flow.started` rule, lifted out of sdk2's `emitJourneyEvent`
|
|
53316
|
+
* closure (IdAndFaceValidation.tsx:521-537) so it can be tested without a
|
|
53317
|
+
* React tree.
|
|
53318
|
+
*
|
|
53319
|
+
* sdk2 does NOT simply emit `flow.started` from a mount effect: it emits it
|
|
53320
|
+
* before the FIRST event of any kind, whatever that event is, and then
|
|
53321
|
+
* suppresses the explicit mount emit. The mount effect and the lazy guard
|
|
53322
|
+
* together mean `flow.started` is always the first event a customer sees,
|
|
53323
|
+
* even if some other event races the effect. That ordering guarantee is the
|
|
53324
|
+
* contract, not the effect.
|
|
53325
|
+
*/
|
|
53326
|
+
function createJourneyEmitter(callback, now) {
|
|
53327
|
+
var flowStartedEmitted = false;
|
|
53328
|
+
return function emit(event) {
|
|
53329
|
+
if (!callback) return;
|
|
53330
|
+
if (!flowStartedEmitted) {
|
|
53331
|
+
flowStartedEmitted = true;
|
|
53332
|
+
emitWith(callback, {
|
|
53333
|
+
name: 'flow.started'
|
|
53334
|
+
}, now);
|
|
53335
|
+
}
|
|
53336
|
+
if (event.name !== 'flow.started') emitWith(callback, event, now);
|
|
53337
|
+
};
|
|
53338
|
+
}
|
|
53339
|
+
function emitWith(callback, event, now) {
|
|
53340
|
+
try {
|
|
53341
|
+
callback(createIdAndFaceValidationJourneyEvent(event, now));
|
|
53342
|
+
} catch (error) {
|
|
53343
|
+
warn$2('[IdAndFaceValidation] onJourneyEvent callback failed', error);
|
|
53344
|
+
}
|
|
53345
|
+
}
|
|
53346
|
+
|
|
52700
53347
|
/**
|
|
52701
53348
|
* sdk2 exports this as a mutable `string[]`
|
|
52702
53349
|
* (contexts/AuthStateContext.tsx:25), not a readonly tuple — copied rather
|
|
@@ -52869,12 +53516,9 @@
|
|
|
52869
53516
|
documentServiceUrl: (_b = props.documentServiceUrl) !== null && _b !== void 0 ? _b : apiBase ? apiBase + '/files/' : override === null || override === void 0 ? void 0 : override.documentServiceUrl,
|
|
52870
53517
|
onBeforeSubmit: props.onBeforeSubmit,
|
|
52871
53518
|
onBeforeLivenessCheck: props.onBeforeLivenessCheck,
|
|
52872
|
-
//
|
|
52873
|
-
// (
|
|
52874
|
-
//
|
|
52875
|
-
// machine — submits through this one client, so none of them can post
|
|
52876
|
-
// behind an integrator who supplied `onSubmit`.
|
|
52877
|
-
onSubmit: props.onSubmit,
|
|
53519
|
+
// 2.x's `onSubmit` is not a client option here: each flow maps it to its
|
|
53520
|
+
// own `submitMode: { handoff }` (see ./props.ts), which follows the prop
|
|
53521
|
+
// live where a client option would be fixed at mount.
|
|
52878
53522
|
onBeforeDocumentUpload: props.onBeforeDocumentUpload,
|
|
52879
53523
|
onDocumentUploadProgress: props.onDocumentUploadProgress,
|
|
52880
53524
|
onDocumentUploaded: props.onDocumentUploaded,
|
|
@@ -53884,84 +54528,6 @@
|
|
|
53884
54528
|
};
|
|
53885
54529
|
}
|
|
53886
54530
|
|
|
53887
|
-
function createIdAndFaceValidationJourneyEvent(event, now) {
|
|
53888
|
-
if (now === void 0) {
|
|
53889
|
-
now = function now() {
|
|
53890
|
-
return new Date();
|
|
53891
|
-
};
|
|
53892
|
-
}
|
|
53893
|
-
return _assign(_assign({}, event), {
|
|
53894
|
-
version: 1,
|
|
53895
|
-
flow: 'id-and-face-validation',
|
|
53896
|
-
timestamp: now().toISOString()
|
|
53897
|
-
});
|
|
53898
|
-
}
|
|
53899
|
-
/**
|
|
53900
|
-
* websdk-ui `CompositeWizardStep.id` -> journey stage.
|
|
53901
|
-
*
|
|
53902
|
-
* Four of the five stage names ARE step ids already; only the additional-
|
|
53903
|
-
* documents step differs, because sdk2's stage vocabulary says
|
|
53904
|
-
* `additional-document-capture` (singular "document") while websdk-ui's step
|
|
53905
|
-
* is `additional-documents`. Unknown ids return undefined so a step this
|
|
53906
|
-
* vocabulary has no name for is silently skipped rather than emitted with a
|
|
53907
|
-
* bogus stage — the same shape as sdk2's partial lookup record.
|
|
53908
|
-
*/
|
|
53909
|
-
function journeyStageForStepId(stepId) {
|
|
53910
|
-
switch (stepId) {
|
|
53911
|
-
case 'id-capture':
|
|
53912
|
-
case 'face-liveness':
|
|
53913
|
-
case 'signature-capture':
|
|
53914
|
-
case 'video-signature-capture':
|
|
53915
|
-
return stepId;
|
|
53916
|
-
case 'additional-documents':
|
|
53917
|
-
return 'additional-document-capture';
|
|
53918
|
-
default:
|
|
53919
|
-
return undefined;
|
|
53920
|
-
}
|
|
53921
|
-
}
|
|
53922
|
-
/**
|
|
53923
|
-
* The document types sdk2 reports as `document.captured`. sdk2 filters the
|
|
53924
|
-
* wizard's `onDocumentStored` through this set (`primaryIdDocumentTypes`) so
|
|
53925
|
-
* that a document type outside the journey vocabulary cannot widen the event.
|
|
53926
|
-
* Kept as a predicate rather than a Set: the ES5 UMD bundle target makes
|
|
53927
|
-
* `for..of` over a Set a downlevel hazard, and a switch needs no iteration.
|
|
53928
|
-
*/
|
|
53929
|
-
function isJourneyDocumentType(documentType) {
|
|
53930
|
-
return documentType === 'idCardFront' || documentType === 'idCardBack' || documentType === 'passport' || documentType === 'singlePage';
|
|
53931
|
-
}
|
|
53932
|
-
/**
|
|
53933
|
-
* The lazy `flow.started` rule, lifted out of sdk2's `emitJourneyEvent`
|
|
53934
|
-
* closure (IdAndFaceValidation.tsx:521-537) so it can be tested without a
|
|
53935
|
-
* React tree.
|
|
53936
|
-
*
|
|
53937
|
-
* sdk2 does NOT simply emit `flow.started` from a mount effect: it emits it
|
|
53938
|
-
* before the FIRST event of any kind, whatever that event is, and then
|
|
53939
|
-
* suppresses the explicit mount emit. The mount effect and the lazy guard
|
|
53940
|
-
* together mean `flow.started` is always the first event a customer sees,
|
|
53941
|
-
* even if some other event races the effect. That ordering guarantee is the
|
|
53942
|
-
* contract, not the effect.
|
|
53943
|
-
*/
|
|
53944
|
-
function createJourneyEmitter(callback, now) {
|
|
53945
|
-
var flowStartedEmitted = false;
|
|
53946
|
-
return function emit(event) {
|
|
53947
|
-
if (!callback) return;
|
|
53948
|
-
if (!flowStartedEmitted) {
|
|
53949
|
-
flowStartedEmitted = true;
|
|
53950
|
-
emitWith(callback, {
|
|
53951
|
-
name: 'flow.started'
|
|
53952
|
-
}, now);
|
|
53953
|
-
}
|
|
53954
|
-
if (event.name !== 'flow.started') emitWith(callback, event, now);
|
|
53955
|
-
};
|
|
53956
|
-
}
|
|
53957
|
-
function emitWith(callback, event, now) {
|
|
53958
|
-
try {
|
|
53959
|
-
callback(createIdAndFaceValidationJourneyEvent(event, now));
|
|
53960
|
-
} catch (error) {
|
|
53961
|
-
warn$2('[IdAndFaceValidation] onJourneyEvent callback failed', error);
|
|
53962
|
-
}
|
|
53963
|
-
}
|
|
53964
|
-
|
|
53965
54531
|
/**
|
|
53966
54532
|
* Recursively drops keys whose value is exactly `undefined`.
|
|
53967
54533
|
*
|
|
@@ -54144,6 +54710,16 @@
|
|
|
54144
54710
|
return mergeThemes(mapped, overrides);
|
|
54145
54711
|
}
|
|
54146
54712
|
|
|
54713
|
+
/**
|
|
54714
|
+
* 2.x's `onSubmit` as the flow's hand-off. sdk2 read it on every submission,
|
|
54715
|
+
* so this maps on every render: adding or removing it takes effect from the
|
|
54716
|
+
* next submission. Without it the flow posts.
|
|
54717
|
+
*/
|
|
54718
|
+
function mapHandoff(onSubmit) {
|
|
54719
|
+
return onSubmit ? {
|
|
54720
|
+
handoff: onSubmit
|
|
54721
|
+
} : undefined;
|
|
54722
|
+
}
|
|
54147
54723
|
var EMPTY_CONTEXT = {};
|
|
54148
54724
|
/** Adapts a 3.0 `(response)` callback back to 2.x's `(response, request)`. */
|
|
54149
54725
|
function withSubmissionRequest(callback, ctx) {
|
|
@@ -54235,13 +54811,13 @@
|
|
|
54235
54811
|
}
|
|
54236
54812
|
// --- 1. IdValidation ------------------------------------------------------
|
|
54237
54813
|
function mapIdValidationProps(props, ctx) {
|
|
54238
|
-
var _a;
|
|
54814
|
+
var _a, _b;
|
|
54239
54815
|
if (ctx === void 0) {
|
|
54240
54816
|
ctx = EMPTY_CONTEXT;
|
|
54241
54817
|
}
|
|
54242
|
-
var
|
|
54243
|
-
capture =
|
|
54244
|
-
view =
|
|
54818
|
+
var _c = mapIdCapture(props),
|
|
54819
|
+
capture = _c.capture,
|
|
54820
|
+
view = _c.view;
|
|
54245
54821
|
return compact({
|
|
54246
54822
|
capture: capture,
|
|
54247
54823
|
view: view,
|
|
@@ -54267,9 +54843,8 @@
|
|
|
54267
54843
|
// `onSubmit` WINS over capture-only, matching sdk2's ordering: its
|
|
54268
54844
|
// `submit()` checks `onSubmit` before the `action === NONE` branch
|
|
54269
54845
|
// (SubmissionProvider.tsx:1374 vs :1237), so a capture-only flow still
|
|
54270
|
-
// owes the callback its built request.
|
|
54271
|
-
|
|
54272
|
-
captureOnly: props.onSubmit ? undefined : props.captureOnly,
|
|
54846
|
+
// owes the callback its built request.
|
|
54847
|
+
submitMode: (_b = mapHandoff(props.onSubmit)) !== null && _b !== void 0 ? _b : props.captureOnly ? 'capture' : undefined,
|
|
54273
54848
|
captureAdditionalDocuments: props.captureAdditionalDocuments,
|
|
54274
54849
|
geolocationEnabled: props.geolocationEnabled,
|
|
54275
54850
|
geolocationRequired: props.geolocationRequired,
|
|
@@ -54280,7 +54855,7 @@
|
|
|
54280
54855
|
// post-submission diagnostics page on this one flag
|
|
54281
54856
|
// (CompositeWizard.tsx:381, `if (debugMode) return <SubmissionSuccess />`);
|
|
54282
54857
|
// here the capture-surface overlays live on `view.debugMode` (mapIdCapture)
|
|
54283
|
-
// while the terminal page needs `
|
|
54858
|
+
// while the terminal page needs `showResultScreen` to render at all and
|
|
54284
54859
|
// `showDiagnostics` to include the request/response bodies. Mapping only
|
|
54285
54860
|
// the first left `debugMode` customers on a blank screen after submitting,
|
|
54286
54861
|
// because CompositeWizard falls through to `return null`.
|
|
@@ -54288,15 +54863,12 @@
|
|
|
54288
54863
|
// Both take the same flag: sdk2's page showed the response body (behind a
|
|
54289
54864
|
// toggle) whenever debugMode was on, so gating diagnostics separately here
|
|
54290
54865
|
// would be a NEW restriction, not parity.
|
|
54291
|
-
|
|
54866
|
+
showResultScreen: props.debugMode,
|
|
54292
54867
|
showDiagnostics: props.debugMode,
|
|
54293
|
-
// `onSubmit` is NOT mapped to a flow prop: it goes to the client config
|
|
54294
|
-
// (see mapClientConfig), which is the layer sdk2 put it at and the only
|
|
54295
|
-
// one that can suppress the POST for every flow at once.
|
|
54296
54868
|
onComplete: withSubmissionRequest(props.onComplete, ctx),
|
|
54297
54869
|
onApproved: withSubmissionRequest(props.onApproved, ctx),
|
|
54298
54870
|
onDenied: withSubmissionRequest(props.onDenied, ctx),
|
|
54299
|
-
|
|
54871
|
+
onSubmissionFailure: props.onRequestFailure
|
|
54300
54872
|
});
|
|
54301
54873
|
}
|
|
54302
54874
|
// --- 2. FaceValidation ----------------------------------------------------
|
|
@@ -54469,7 +55041,7 @@
|
|
|
54469
55041
|
remoteDiagnostics: props.remoteDiagnostics,
|
|
54470
55042
|
loadingSpinner: props.loadingSpinner,
|
|
54471
55043
|
// See mapIdValidationProps for why `debugMode` feeds both.
|
|
54472
|
-
|
|
55044
|
+
showResultScreen: props.debugMode,
|
|
54473
55045
|
showDiagnostics: props.debugMode,
|
|
54474
55046
|
onStepStarted: emit ? function (stepId) {
|
|
54475
55047
|
var stage = journeyStageForStepId(stepId);
|
|
@@ -54488,7 +55060,8 @@
|
|
|
54488
55060
|
onComplete: withSubmissionRequest(props.onComplete, ctx),
|
|
54489
55061
|
onApproved: withSubmissionRequest(props.onApproved, ctx),
|
|
54490
55062
|
onDenied: withSubmissionRequest(props.onDenied, ctx),
|
|
54491
|
-
|
|
55063
|
+
submitMode: mapHandoff(props.onSubmit),
|
|
55064
|
+
onSubmissionFailure: props.onRequestFailure,
|
|
54492
55065
|
onCaptureError: props.onRequestFailure
|
|
54493
55066
|
});
|
|
54494
55067
|
}
|
|
@@ -54591,7 +55164,7 @@
|
|
|
54591
55164
|
// both the boolean and async callback forms at the flow-level seam.
|
|
54592
55165
|
//
|
|
54593
55166
|
// `debugMode` forces it back on, completing the fold mapIdValidationProps
|
|
54594
|
-
// does with `
|
|
55167
|
+
// does with `showResultScreen`/`showDiagnostics`: the capture readout
|
|
54595
55168
|
// renders INSIDE the review, so a consumer who skips the review and turns
|
|
54596
55169
|
// debugMode on would otherwise get the switch with nowhere for it to show
|
|
54597
55170
|
// — silently, in the one configuration it exists for.
|
|
@@ -54643,10 +55216,11 @@
|
|
|
54643
55216
|
captureProgress: props.captureProgress,
|
|
54644
55217
|
remoteDiagnostics: props.remoteDiagnostics,
|
|
54645
55218
|
loadingSpinner: props.loadingSpinner,
|
|
54646
|
-
//
|
|
54647
|
-
//
|
|
54648
|
-
//
|
|
54649
|
-
//
|
|
55219
|
+
// 2.x builds this flow's request and hands it to `onSubmit`
|
|
55220
|
+
// (SubmissionProvider.tsx:1374, ahead of its NONE branch). Unset, the
|
|
55221
|
+
// flow captures and posts nothing, as 2.x's NONE did. A failed hand-off
|
|
55222
|
+
// is not reported to `onRequestFailure`, which 2.x never did either.
|
|
55223
|
+
submitMode: mapHandoff(props.onSubmit),
|
|
54650
55224
|
onCaptureError: props.onRequestFailure
|
|
54651
55225
|
});
|
|
54652
55226
|
}
|
|
@@ -54672,7 +55246,7 @@
|
|
|
54672
55246
|
return map(nested);
|
|
54673
55247
|
}
|
|
54674
55248
|
function mapVideoIdValidationProps(props, ctx) {
|
|
54675
|
-
var _a, _b, _c;
|
|
55249
|
+
var _a, _b, _c, _d;
|
|
54676
55250
|
if (ctx === void 0) {
|
|
54677
55251
|
ctx = EMPTY_CONTEXT;
|
|
54678
55252
|
}
|
|
@@ -54762,10 +55336,14 @@
|
|
|
54762
55336
|
remoteDiagnostics: props.remoteDiagnostics,
|
|
54763
55337
|
loadingSpinner: props.loadingSpinner,
|
|
54764
55338
|
// See mapIdValidationProps for why `debugMode` feeds both.
|
|
54765
|
-
|
|
55339
|
+
showResultScreen: props.debugMode,
|
|
54766
55340
|
showDiagnostics: props.debugMode,
|
|
54767
55341
|
onComplete: withSubmissionRequest(props.onComplete, ctx),
|
|
54768
|
-
|
|
55342
|
+
// No ID captured and none supplied resolves the action to NONE, which
|
|
55343
|
+
// has nothing to post. 2.x answered with a synthetic success and no
|
|
55344
|
+
// request; capture mode is that without the fabricated response.
|
|
55345
|
+
submitMode: (_d = mapHandoff(props.onSubmit)) !== null && _d !== void 0 ? _d : props.skipIdCapture && !props.idCardForFaceMatch ? 'capture' : undefined,
|
|
55346
|
+
onSubmissionFailure: props.onRequestFailure,
|
|
54769
55347
|
onCaptureError: props.onRequestFailure
|
|
54770
55348
|
});
|
|
54771
55349
|
}
|
|
@@ -54930,7 +55508,8 @@
|
|
|
54930
55508
|
onComplete: withSubmissionRequest(props.onComplete, ctx),
|
|
54931
55509
|
onCustomerMatched: withSubmissionRequest(props.onCustomerMatched, ctx),
|
|
54932
55510
|
onCustomerNotMatched: withSubmissionRequest(props.onCustomerNotMatched, ctx),
|
|
54933
|
-
|
|
55511
|
+
submitMode: mapHandoff(props.onSubmit),
|
|
55512
|
+
onSubmissionFailure: props.onRequestFailure,
|
|
54934
55513
|
onExitCapture: props.onExitCapture,
|
|
54935
55514
|
onExitAfterFailure: props.onExitAfterFailure
|
|
54936
55515
|
});
|
|
@@ -54993,13 +55572,14 @@
|
|
|
54993
55572
|
remoteDiagnostics: props.remoteDiagnostics,
|
|
54994
55573
|
loadingSpinner: props.loadingSpinner,
|
|
54995
55574
|
// See mapIdValidationProps for why `debugMode` feeds both.
|
|
54996
|
-
|
|
55575
|
+
showResultScreen: props.debugMode,
|
|
54997
55576
|
showDiagnostics: props.debugMode,
|
|
54998
55577
|
onComplete: withSubmissionRequest(props.onComplete, ctx),
|
|
54999
55578
|
// sdk2's enrollment twin of `onApproved`.
|
|
55000
55579
|
onApproved: withSubmissionRequest(props.onEnrolled, ctx),
|
|
55001
55580
|
onDenied: withSubmissionRequest(props.onDenied, ctx),
|
|
55002
|
-
|
|
55581
|
+
submitMode: mapHandoff(props.onSubmit),
|
|
55582
|
+
onSubmissionFailure: props.onRequestFailure,
|
|
55003
55583
|
onCaptureError: props.onRequestFailure
|
|
55004
55584
|
});
|
|
55005
55585
|
}
|
|
@@ -55086,17 +55666,18 @@
|
|
|
55086
55666
|
remoteDiagnostics: props.remoteDiagnostics,
|
|
55087
55667
|
loadingSpinner: props.loadingSpinner,
|
|
55088
55668
|
// See mapIdValidationProps for why `debugMode` feeds both.
|
|
55089
|
-
|
|
55669
|
+
showResultScreen: props.debugMode,
|
|
55090
55670
|
showDiagnostics: props.debugMode,
|
|
55091
55671
|
onComplete: withSubmissionRequest(props.onComplete, ctx),
|
|
55092
55672
|
onApproved: withSubmissionRequest(props.onEnrolled, ctx),
|
|
55093
55673
|
onDenied: withSubmissionRequest(props.onDenied, ctx),
|
|
55094
|
-
|
|
55674
|
+
submitMode: mapHandoff(props.onSubmit),
|
|
55675
|
+
onSubmissionFailure: props.onRequestFailure,
|
|
55095
55676
|
onCaptureError: props.onRequestFailure
|
|
55096
55677
|
});
|
|
55097
55678
|
}
|
|
55098
55679
|
|
|
55099
|
-
var webSdkVersion = '2.6.3-changeset-release-develop-
|
|
55680
|
+
var webSdkVersion = '2.6.3-changeset-release-develop-776f131';
|
|
55100
55681
|
|
|
55101
55682
|
// GENERATED by scripts/styleBagTypes.mjs from
|
|
55102
55683
|
// src/__fixtures__/sdk2StyleBags.json and the mapper sweep — do not
|
|
@@ -57153,23 +57734,17 @@
|
|
|
57153
57734
|
var SUBMIT_CALLBACKS = {
|
|
57154
57735
|
onBeforeSubmit: MAPPED,
|
|
57155
57736
|
/**
|
|
57156
|
-
* Mapped to the
|
|
57157
|
-
*
|
|
57158
|
-
*
|
|
57159
|
-
*
|
|
57160
|
-
*
|
|
57161
|
-
* suppression is uniform.
|
|
57737
|
+
* Mapped to the flow's `submitMode: { handoff }`. The flow builds the
|
|
57738
|
+
* request, hands it over, and does NOT post, so `onComplete`/`onApproved`/
|
|
57739
|
+
* `onDenied` never fire, exactly as 2.x documents. Mapped on every render,
|
|
57740
|
+
* so adding or removing it takes effect from the next submission, as sdk2's
|
|
57741
|
+
* ref-held `onSubmit` did.
|
|
57162
57742
|
*
|
|
57163
57743
|
* What the flow SHOWS afterwards is a 3.0 call rather than a 2.x
|
|
57164
57744
|
* reproduction: every family now ends quietly, because the integrator owns
|
|
57165
57745
|
* the outcome once they have the request. 2.x's match flows showed a failure
|
|
57166
57746
|
* screen there, but only because their `submit()` could not distinguish an
|
|
57167
57747
|
* intercepted submission from a broken one.
|
|
57168
|
-
*
|
|
57169
|
-
* `SignatureKYC` reaches the same place by a different route: its 3.0
|
|
57170
|
-
* counterpart never enters `client.submit()`, so the façade component makes
|
|
57171
|
-
* that call itself from `onCaptured`. `action: NONE` is accepted there
|
|
57172
|
-
* precisely because `onSubmit` is bound.
|
|
57173
57748
|
*/
|
|
57174
57749
|
onSubmit: MAPPED,
|
|
57175
57750
|
onComplete: MAPPED,
|
|
@@ -57267,7 +57842,7 @@
|
|
|
57267
57842
|
// `SubmissionAction.NONE` and wires `onComplete` to the provider's
|
|
57268
57843
|
// `onResponseReceived` (SignatureKYC.tsx:434,449), which never fires because
|
|
57269
57844
|
// nothing is ever posted. `onSubmit` is the real completion seam and IS
|
|
57270
|
-
// mapped, to the flow's `
|
|
57845
|
+
// mapped, to the flow's `submitMode: { handoff }`.
|
|
57271
57846
|
onComplete: NOOP,
|
|
57272
57847
|
onSubmit: MAPPED,
|
|
57273
57848
|
onRequestFailure: MAPPED,
|
|
@@ -57758,10 +58333,6 @@
|
|
|
57758
58333
|
_lastLivenessRequest.current = request;
|
|
57759
58334
|
return propsRef.current.onBeforeLivenessCheck ? propsRef.current.onBeforeLivenessCheck(request) : Promise.resolve(request);
|
|
57760
58335
|
},
|
|
57761
|
-
onSubmit: propsRef.current.onSubmit ? function (request) {
|
|
57762
|
-
var _a, _b;
|
|
57763
|
-
return (_b = (_a = propsRef.current).onSubmit) === null || _b === void 0 ? void 0 : _b.call(_a, request);
|
|
57764
|
-
} : undefined,
|
|
57765
58336
|
onResponseReceived: function onResponseReceived(_response, request) {
|
|
57766
58337
|
_lastSubmissionRequest.current = request;
|
|
57767
58338
|
},
|
|
@@ -57932,34 +58503,12 @@
|
|
|
57932
58503
|
client = _a.client,
|
|
57933
58504
|
ctx = _a.ctx;
|
|
57934
58505
|
useDroppedPropReport('SignatureKYC', props);
|
|
57935
|
-
// The one flow whose 3.0 counterpart never enters `client.submit()`: it runs
|
|
57936
|
-
// its own stage machine and reports completion through `onCaptured` instead.
|
|
57937
|
-
// 2.x DOES submit here — its CompositeWizard calls `submit()`, which hands
|
|
57938
|
-
// the built request to `onSubmit` before reaching the capture-only branch —
|
|
57939
|
-
// so the façade makes that call itself to produce the same request. The
|
|
57940
|
-
// client suppresses the POST, and `action: NONE` is accepted precisely
|
|
57941
|
-
// because `onSubmit` is bound.
|
|
57942
|
-
//
|
|
57943
|
-
// Only when bound: without `onSubmit` the client rejects NONE by design, and
|
|
57944
|
-
// this flow has nothing to submit anyway.
|
|
57945
|
-
var onSubmit = props.onSubmit;
|
|
57946
|
-
var submission = mapSubmission(props);
|
|
57947
|
-
var handOff = onSubmit ? function (artifacts) {
|
|
57948
|
-
void client.submit(artifacts, _assign(_assign({}, submission), {
|
|
57949
|
-
action: SubmissionAction.NONE
|
|
57950
|
-
}))["catch"](function () {
|
|
57951
|
-
// The failure already reached `onRequestFailure` through the
|
|
57952
|
-
// client's own hook, which is where 2.x reported it too.
|
|
57953
|
-
});
|
|
57954
|
-
} : undefined;
|
|
57955
58506
|
// No `children`: SignatureKYCFlow omits it from its props (it runs its own
|
|
57956
58507
|
// stage machine rather than CompositeWizard), so passing it would not
|
|
57957
58508
|
// compile — and 2.x rendered it nowhere either.
|
|
57958
58509
|
return /*#__PURE__*/React.createElement(SignatureKYCFlow, _assign({
|
|
57959
58510
|
client: client
|
|
57960
|
-
}, mapSignatureKYCProps(props, ctx)
|
|
57961
|
-
onCaptured: handOff
|
|
57962
|
-
}));
|
|
58511
|
+
}, mapSignatureKYCProps(props, ctx)));
|
|
57963
58512
|
};
|
|
57964
58513
|
/**
|
|
57965
58514
|
* Render a fullscreen capture component that performs ID and face validation,
|