idmission-web-sdk 2.2.139 → 2.2.141
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/customer_flows/FaceValidation.d.ts +1 -1
- package/dist/components/customer_flows/FaceValidation.d.ts.map +1 -1
- package/dist/components/face_liveness/FaceLivenessCapture.d.ts.map +1 -1
- package/dist/components/face_liveness/FaceLivenessWizard.d.ts +1 -1
- package/dist/components/face_liveness/FaceLivenessWizard.d.ts.map +1 -1
- package/dist/components/selfie_capture/SelfieCapture.d.ts.map +1 -1
- package/dist/components/video_signature_capture/VideoSignatureWizard.d.ts.map +1 -1
- package/dist/sdk2.cjs.development.js +52 -45
- 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 +52 -45
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +295 -303
- package/dist/sdk2.umd.development.js.map +1 -1
- package/dist/sdk2.umd.production.js +1 -1
- package/dist/sdk2.umd.production.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +4 -4
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('react-dom/client'), require('platform'), require('styled-components'), require('tus-js-client'), require('react-dom'), require('prop-types')) :
|
|
3
3
|
typeof define === 'function' && define.amd ? define(['exports', 'react', 'react-dom/client', 'platform', 'styled-components', 'tus-js-client', 'react-dom', 'prop-types'], factory) :
|
|
4
4
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Sdk2 = {}, global.React, global.ReactDOM, global.platform, global.styled, global.tusJsClient, global.ReactDOM, global.PropTypes));
|
|
5
|
-
})(this, (function (exports, React, ReactDOM, platform, styled, tusJsClient, reactDom,
|
|
5
|
+
})(this, (function (exports, React, ReactDOM, platform, styled, tusJsClient, reactDom, PropTypes) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopNamespaceDefault(e) {
|
|
8
8
|
var n = Object.create(null);
|
|
@@ -211,7 +211,7 @@
|
|
|
211
211
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
212
212
|
};
|
|
213
213
|
|
|
214
|
-
var webSdkVersion = '2.2.
|
|
214
|
+
var webSdkVersion = '2.2.141';
|
|
215
215
|
|
|
216
216
|
function getPlatform() {
|
|
217
217
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -529,31 +529,6 @@
|
|
|
529
529
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
530
530
|
}
|
|
531
531
|
|
|
532
|
-
function getAugmentedNamespace(n) {
|
|
533
|
-
if (n.__esModule) return n;
|
|
534
|
-
var f = n.default;
|
|
535
|
-
if (typeof f == "function") {
|
|
536
|
-
var a = function a () {
|
|
537
|
-
if (this instanceof a) {
|
|
538
|
-
return Reflect.construct(f, arguments, this.constructor);
|
|
539
|
-
}
|
|
540
|
-
return f.apply(this, arguments);
|
|
541
|
-
};
|
|
542
|
-
a.prototype = f.prototype;
|
|
543
|
-
} else a = {};
|
|
544
|
-
Object.defineProperty(a, '__esModule', {value: true});
|
|
545
|
-
Object.keys(n).forEach(function (k) {
|
|
546
|
-
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
547
|
-
Object.defineProperty(a, k, d.get ? d : {
|
|
548
|
-
enumerable: true,
|
|
549
|
-
get: function () {
|
|
550
|
-
return n[k];
|
|
551
|
-
}
|
|
552
|
-
});
|
|
553
|
-
});
|
|
554
|
-
return a;
|
|
555
|
-
}
|
|
556
|
-
|
|
557
532
|
function warn$1() {
|
|
558
533
|
if (console && console.warn) {
|
|
559
534
|
var _console;
|
|
@@ -10435,7 +10410,7 @@
|
|
|
10435
10410
|
});
|
|
10436
10411
|
}
|
|
10437
10412
|
|
|
10438
|
-
var _excluded = ["enabled", "anonymousActionType", "store"],
|
|
10413
|
+
var _excluded$1 = ["enabled", "anonymousActionType", "store"],
|
|
10439
10414
|
_excluded2 = ["connection"];
|
|
10440
10415
|
var trackedConnections = /* @__PURE__ */new Map();
|
|
10441
10416
|
var getTrackedConnectionState = function getTrackedConnectionState(name) {
|
|
@@ -10480,7 +10455,7 @@
|
|
|
10480
10455
|
enabled = _devtoolsOptions.enabled,
|
|
10481
10456
|
anonymousActionType = _devtoolsOptions.anonymousActionType,
|
|
10482
10457
|
store = _devtoolsOptions.store,
|
|
10483
|
-
options = _objectWithoutPropertiesLoose(_devtoolsOptions, _excluded);
|
|
10458
|
+
options = _objectWithoutPropertiesLoose(_devtoolsOptions, _excluded$1);
|
|
10484
10459
|
var extensionConnector;
|
|
10485
10460
|
try {
|
|
10486
10461
|
extensionConnector = (enabled != null ? enabled : (undefined ? undefined.MODE : void 0) !== "production") && window.__REDUX_DEVTOOLS_EXTENSION__;
|
|
@@ -20599,7 +20574,7 @@
|
|
|
20599
20574
|
face: prediction.face,
|
|
20600
20575
|
scaling: debugScalingDetails,
|
|
20601
20576
|
color: satisfied ? 'green' : 'red'
|
|
20602
|
-
}))), debugMode && ( /*#__PURE__*/React.createElement(DebugStatsPane, null, camera ? ( /*#__PURE__*/React.createElement(React.Fragment, null, "\u2705 Camera: ", camera.label, " (", camera.width, "x", camera.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React.createElement("br", null), !(prediction === null || prediction === void 0 ? void 0 : prediction.faceNotCentered) ? '✅' : '❌', " Face Centered", /*#__PURE__*/React.createElement("br", null), !(prediction === null || prediction === void 0 ? void 0 : prediction.faceTooClose) && !(prediction === null || prediction === void 0 ? void 0 : prediction.faceTooFar) ? '✅' : '❌', ' ', "Face", ' ', (prediction === null || prediction === void 0 ? void 0 : prediction.faceTooClose) ? 'Too Close' : (prediction === null || prediction === void 0 ? void 0 : prediction.faceTooFar) ? 'Too Far' : 'Distance Correct', /*#__PURE__*/React.createElement("br", null), !(prediction === null || prediction === void 0 ? void 0 : prediction.faceLookingAway) ? '✅' : '❌', " Face Looking Forward", /*#__PURE__*/React.createElement("br", null), !(prediction === null || prediction === void 0 ? void 0 : prediction.faceIsStable) ? '✅' : '❌', " Face Is Stable", /*#__PURE__*/React.createElement("br", null), !timedOut ? '✅' : '❌', " Time Remaining:", ' ', Math.max(0, timeoutDurationMs - (new Date().getTime() - (timeoutStartedAt !== null && timeoutStartedAt !== void 0 ? timeoutStartedAt : new Date()).getTime())), "ms")), /*#__PURE__*/React.createElement(ExitCaptureButton, {
|
|
20577
|
+
}))), debugMode && ( /*#__PURE__*/React.createElement(DebugStatsPane, null, camera ? ( /*#__PURE__*/React.createElement(React.Fragment, null, "\u2705 Camera: ", camera.label, " (", camera.width, "x", camera.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React.createElement("br", null), !(prediction === null || prediction === void 0 ? void 0 : prediction.faceNotDetected) ? '✅' : '❌', " Face Detected", /*#__PURE__*/React.createElement("br", null), !(prediction === null || prediction === void 0 ? void 0 : prediction.faceNotCentered) ? '✅' : '❌', " Face Centered", /*#__PURE__*/React.createElement("br", null), !(prediction === null || prediction === void 0 ? void 0 : prediction.faceTooClose) && !(prediction === null || prediction === void 0 ? void 0 : prediction.faceTooFar) ? '✅' : '❌', ' ', "Face", ' ', (prediction === null || prediction === void 0 ? void 0 : prediction.faceTooClose) ? 'Too Close' : (prediction === null || prediction === void 0 ? void 0 : prediction.faceTooFar) ? 'Too Far' : 'Distance Correct', /*#__PURE__*/React.createElement("br", null), !(prediction === null || prediction === void 0 ? void 0 : prediction.faceLookingAway) ? '✅' : '❌', " Face Looking Forward", /*#__PURE__*/React.createElement("br", null), !(prediction === null || prediction === void 0 ? void 0 : prediction.faceIsStable) ? '✅' : '❌', " Face Is Stable", /*#__PURE__*/React.createElement("br", null), !timedOut ? '✅' : '❌', " Time Remaining:", ' ', Math.max(0, timeoutDurationMs - (new Date().getTime() - (timeoutStartedAt !== null && timeoutStartedAt !== void 0 ? timeoutStartedAt : new Date()).getTime())), "ms")), /*#__PURE__*/React.createElement(ExitCaptureButton, {
|
|
20603
20578
|
onClick: onExit,
|
|
20604
20579
|
className: classNames.exitCaptureBtn
|
|
20605
20580
|
}));
|
|
@@ -20767,19 +20742,16 @@
|
|
|
20767
20742
|
});
|
|
20768
20743
|
(function () {
|
|
20769
20744
|
return __awaiter(_this, void 0, void 0, function () {
|
|
20770
|
-
var imageUrl_1, response,
|
|
20771
|
-
return __generator(this, function (
|
|
20772
|
-
switch (
|
|
20745
|
+
var imageUrl_1, response, e_1;
|
|
20746
|
+
return __generator(this, function (_a) {
|
|
20747
|
+
switch (_a.label) {
|
|
20773
20748
|
case 0:
|
|
20774
|
-
|
|
20749
|
+
_a.trys.push([0, 2,, 3]);
|
|
20775
20750
|
imageUrl_1 = cropToShoulders(rawCanvas.current, cropCanvas.current, resizeCanvas.current, frame, face, 0.92, 600);
|
|
20776
20751
|
setImageUrl(imageUrl_1);
|
|
20777
|
-
|
|
20778
|
-
return [4 /*yield*/, dataUrlToBase64(imageUrl_1)];
|
|
20752
|
+
return [4 /*yield*/, checkLiveness(dataUrlToBase64Sync(imageUrl_1))];
|
|
20779
20753
|
case 1:
|
|
20780
|
-
|
|
20781
|
-
case 2:
|
|
20782
|
-
response = _b.sent();
|
|
20754
|
+
response = _a.sent();
|
|
20783
20755
|
onLivenessChecked === null || onLivenessChecked === void 0 ? void 0 : onLivenessChecked(response);
|
|
20784
20756
|
dispatch({
|
|
20785
20757
|
type: 'livenessChecked',
|
|
@@ -20790,17 +20762,17 @@
|
|
|
20790
20762
|
response: response
|
|
20791
20763
|
}
|
|
20792
20764
|
});
|
|
20793
|
-
return [3 /*break*/,
|
|
20794
|
-
case
|
|
20795
|
-
e_1 =
|
|
20765
|
+
return [3 /*break*/, 3];
|
|
20766
|
+
case 2:
|
|
20767
|
+
e_1 = _a.sent();
|
|
20796
20768
|
dispatch({
|
|
20797
20769
|
type: 'livenessCheckFailed',
|
|
20798
20770
|
payload: {
|
|
20799
20771
|
error: e_1
|
|
20800
20772
|
}
|
|
20801
20773
|
});
|
|
20802
|
-
return [3 /*break*/,
|
|
20803
|
-
case
|
|
20774
|
+
return [3 /*break*/, 3];
|
|
20775
|
+
case 3:
|
|
20804
20776
|
return [2 /*return*/];
|
|
20805
20777
|
}
|
|
20806
20778
|
});
|
|
@@ -20809,7 +20781,7 @@
|
|
|
20809
20781
|
}, [checkLiveness, face, frame, isReady, onLivenessChecked, submissionError]);
|
|
20810
20782
|
var onFallbackImageCaptured = React.useCallback(function (imageUrl) {
|
|
20811
20783
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
20812
|
-
var
|
|
20784
|
+
var response, e_2;
|
|
20813
20785
|
var _a;
|
|
20814
20786
|
return __generator(this, function (_b) {
|
|
20815
20787
|
switch (_b.label) {
|
|
@@ -20819,12 +20791,9 @@
|
|
|
20819
20791
|
});
|
|
20820
20792
|
_b.label = 1;
|
|
20821
20793
|
case 1:
|
|
20822
|
-
_b.trys.push([1,
|
|
20823
|
-
return [4 /*yield*/,
|
|
20794
|
+
_b.trys.push([1, 3,, 4]);
|
|
20795
|
+
return [4 /*yield*/, checkLiveness(dataUrlToBase64Sync(imageUrl))];
|
|
20824
20796
|
case 2:
|
|
20825
|
-
imageData = _b.sent();
|
|
20826
|
-
return [4 /*yield*/, checkLiveness(imageData)];
|
|
20827
|
-
case 3:
|
|
20828
20797
|
response = _b.sent();
|
|
20829
20798
|
if (((_a = response === null || response === void 0 ? void 0 : response.resultData) === null || _a === void 0 ? void 0 : _a.verificationResult) !== 'Live Face Detected') {
|
|
20830
20799
|
onFailure === null || onFailure === void 0 ? void 0 : onFailure();
|
|
@@ -20837,8 +20806,8 @@
|
|
|
20837
20806
|
response: response
|
|
20838
20807
|
}
|
|
20839
20808
|
});
|
|
20840
|
-
return [3 /*break*/,
|
|
20841
|
-
case
|
|
20809
|
+
return [3 /*break*/, 4];
|
|
20810
|
+
case 3:
|
|
20842
20811
|
e_2 = _b.sent();
|
|
20843
20812
|
dispatch({
|
|
20844
20813
|
type: 'livenessCheckFailed',
|
|
@@ -20846,8 +20815,8 @@
|
|
|
20846
20815
|
error: e_2
|
|
20847
20816
|
}
|
|
20848
20817
|
});
|
|
20849
|
-
return [3 /*break*/,
|
|
20850
|
-
case
|
|
20818
|
+
return [3 /*break*/, 4];
|
|
20819
|
+
case 4:
|
|
20851
20820
|
return [2 /*return*/];
|
|
20852
20821
|
}
|
|
20853
20822
|
});
|
|
@@ -21491,20 +21460,13 @@
|
|
|
21491
21460
|
}, [logCaptureMetadata]);
|
|
21492
21461
|
var onSuccessCallback = React.useCallback(function (faceCropImageUrl) {
|
|
21493
21462
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
21494
|
-
|
|
21495
|
-
|
|
21496
|
-
|
|
21497
|
-
|
|
21498
|
-
|
|
21499
|
-
|
|
21500
|
-
|
|
21501
|
-
_a = setSelfieImage;
|
|
21502
|
-
return [4 /*yield*/, dataUrlToBase64(faceCropImageUrl)];
|
|
21503
|
-
case 1:
|
|
21504
|
-
_a.apply(void 0, [_b.sent()]);
|
|
21505
|
-
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(submissionResponse, livenessCheckRequest);
|
|
21506
|
-
return [2 /*return*/];
|
|
21507
|
-
}
|
|
21463
|
+
return __generator(this, function (_a) {
|
|
21464
|
+
if (!livenessCheckRequest || !submissionResponse) return [2 /*return*/];
|
|
21465
|
+
setCaptureState('SUCCESS');
|
|
21466
|
+
setFaceCropImageUrl(faceCropImageUrl);
|
|
21467
|
+
setSelfieImage(dataUrlToBase64Sync(faceCropImageUrl));
|
|
21468
|
+
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(submissionResponse, livenessCheckRequest);
|
|
21469
|
+
return [2 /*return*/];
|
|
21508
21470
|
});
|
|
21509
21471
|
});
|
|
21510
21472
|
}, [onSuccess, setSelfieImage, livenessCheckRequest, submissionResponse]);
|
|
@@ -21519,7 +21481,25 @@
|
|
|
21519
21481
|
return [2 /*return*/];
|
|
21520
21482
|
});
|
|
21521
21483
|
});
|
|
21522
|
-
}, [livenessCheckRequest, onFailure, submissionResponse]);
|
|
21484
|
+
}, [allowLivenessFailure, livenessCheckRequest, onFailure, onSuccess, submissionResponse]);
|
|
21485
|
+
var selfieGuidanceCanvasRef = React.useContext(SelfieGuidanceModelsContext).canvasRef;
|
|
21486
|
+
var resizeCanvas = React.useRef(null);
|
|
21487
|
+
var onTimeoutCallback = React.useCallback(function () {
|
|
21488
|
+
if (allowLivenessFailure) {
|
|
21489
|
+
setCaptureState('SUCCESS');
|
|
21490
|
+
if (selfieGuidanceCanvasRef.current && resizeCanvas.current) {
|
|
21491
|
+
var srcCanvas = selfieGuidanceCanvasRef.current;
|
|
21492
|
+
resizeCanvas.current.height = 600;
|
|
21493
|
+
resizeCanvas.current.width = srcCanvas.width * (resizeCanvas.current.height / srcCanvas.height);
|
|
21494
|
+
var resizeCtx = resizeCanvas.current.getContext('2d');
|
|
21495
|
+
resizeCtx.drawImage(srcCanvas, 0, 0, resizeCanvas.current.width, 600);
|
|
21496
|
+
var dataURL = resizeCanvas.current.toDataURL('image/jpeg', 0.92);
|
|
21497
|
+
setSelfieImage(dataUrlToBase64Sync(dataURL));
|
|
21498
|
+
}
|
|
21499
|
+
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(submissionResponse, livenessCheckRequest);
|
|
21500
|
+
}
|
|
21501
|
+
onTimeout === null || onTimeout === void 0 ? void 0 : onTimeout();
|
|
21502
|
+
}, [allowLivenessFailure, livenessCheckRequest, onSuccess, onTimeout, selfieGuidanceCanvasRef, setSelfieImage, submissionResponse]);
|
|
21523
21503
|
var onDeniedCallback = React.useCallback(function () {
|
|
21524
21504
|
if (!allowLivenessFailure) {
|
|
21525
21505
|
setCaptureState('FAILED');
|
|
@@ -21527,7 +21507,7 @@
|
|
|
21527
21507
|
setCaptureState('SUCCESS');
|
|
21528
21508
|
}
|
|
21529
21509
|
onDenied === null || onDenied === void 0 ? void 0 : onDenied(submissionResponse, livenessCheckRequest);
|
|
21530
|
-
}, [onDenied, submissionResponse, livenessCheckRequest]);
|
|
21510
|
+
}, [allowLivenessFailure, onDenied, submissionResponse, livenessCheckRequest]);
|
|
21531
21511
|
var _1 = React.useState(0),
|
|
21532
21512
|
attempt = _1[0],
|
|
21533
21513
|
setAttempt = _1[1];
|
|
@@ -21576,7 +21556,9 @@
|
|
|
21576
21556
|
onExitAfterFailure === null || onExitAfterFailure === void 0 ? void 0 : onExitAfterFailure(submissionResponse, livenessCheckRequest);
|
|
21577
21557
|
}, 0);
|
|
21578
21558
|
}, [livenessCheckRequest, onExitAfterFailure, releaseCameraAccess, releaseCameraAccessOnExit, submissionResponse]);
|
|
21579
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(
|
|
21559
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(InvisibleCanvas, {
|
|
21560
|
+
ref: resizeCanvas
|
|
21561
|
+
}), /*#__PURE__*/React.createElement(PageContainer, {
|
|
21580
21562
|
className: "flex ".concat((_c = (_b = classNames.capture) === null || _b === void 0 ? void 0 : _b.container) !== null && _c !== void 0 ? _c : '')
|
|
21581
21563
|
}, renderCameraFeed && ( /*#__PURE__*/React.createElement(CameraVideoTag, {
|
|
21582
21564
|
className: (_d = classNames.capture) === null || _d === void 0 ? void 0 : _d.cameraFeed
|
|
@@ -21590,7 +21572,7 @@
|
|
|
21590
21572
|
onLivenessChecked: onLivenessChecked,
|
|
21591
21573
|
onSuccess: onSuccessCallback,
|
|
21592
21574
|
onFailure: onFailureCallback,
|
|
21593
|
-
onTimeout:
|
|
21575
|
+
onTimeout: onTimeoutCallback,
|
|
21594
21576
|
onDenied: onDeniedCallback,
|
|
21595
21577
|
onExit: onExitCallback,
|
|
21596
21578
|
initialCaptureDelayMs: initialCaptureDelayMs,
|
|
@@ -21817,7 +21799,49 @@
|
|
|
21817
21799
|
});
|
|
21818
21800
|
};
|
|
21819
21801
|
|
|
21820
|
-
|
|
21802
|
+
function _objectWithoutProperties(e, t) {
|
|
21803
|
+
if (null == e) return {};
|
|
21804
|
+
var o,
|
|
21805
|
+
r,
|
|
21806
|
+
i = _objectWithoutPropertiesLoose(e, t);
|
|
21807
|
+
if (Object.getOwnPropertySymbols) {
|
|
21808
|
+
var s = Object.getOwnPropertySymbols(e);
|
|
21809
|
+
for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
21810
|
+
}
|
|
21811
|
+
return i;
|
|
21812
|
+
}
|
|
21813
|
+
|
|
21814
|
+
function _inherits(t, e) {
|
|
21815
|
+
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
|
21816
|
+
t.prototype = Object.create(e && e.prototype, {
|
|
21817
|
+
constructor: {
|
|
21818
|
+
value: t,
|
|
21819
|
+
writable: !0,
|
|
21820
|
+
configurable: !0
|
|
21821
|
+
}
|
|
21822
|
+
}), Object.defineProperty(t, "prototype", {
|
|
21823
|
+
writable: !1
|
|
21824
|
+
}), e && _setPrototypeOf(t, e);
|
|
21825
|
+
}
|
|
21826
|
+
|
|
21827
|
+
function _possibleConstructorReturn(t, e) {
|
|
21828
|
+
if (e && ("object" == _typeof$1(e) || "function" == typeof e)) return e;
|
|
21829
|
+
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
21830
|
+
return _assertThisInitialized(t);
|
|
21831
|
+
}
|
|
21832
|
+
|
|
21833
|
+
function _createSuper(t) {
|
|
21834
|
+
var r = _isNativeReflectConstruct();
|
|
21835
|
+
return function () {
|
|
21836
|
+
var e,
|
|
21837
|
+
o = _getPrototypeOf(t);
|
|
21838
|
+
if (r) {
|
|
21839
|
+
var s = _getPrototypeOf(this).constructor;
|
|
21840
|
+
e = Reflect.construct(o, arguments, s);
|
|
21841
|
+
} else e = o.apply(this, arguments);
|
|
21842
|
+
return _possibleConstructorReturn(this, e);
|
|
21843
|
+
};
|
|
21844
|
+
}
|
|
21821
21845
|
|
|
21822
21846
|
/*!
|
|
21823
21847
|
* Signature Pad v2.3.2
|
|
@@ -22335,255 +22359,223 @@
|
|
|
22335
22359
|
return this._data;
|
|
22336
22360
|
};
|
|
22337
22361
|
|
|
22338
|
-
var signature_pad = /*#__PURE__*/Object.freeze({
|
|
22339
|
-
__proto__: null,
|
|
22340
|
-
default: SignaturePad$1
|
|
22341
|
-
});
|
|
22342
|
-
|
|
22343
|
-
var require$$2 = /*@__PURE__*/getAugmentedNamespace(signature_pad);
|
|
22344
|
-
|
|
22345
22362
|
var build = {exports: {}};
|
|
22346
22363
|
|
|
22347
|
-
var hasRequiredBuild;
|
|
22348
|
-
function requireBuild() {
|
|
22349
|
-
if (hasRequiredBuild) return build.exports;
|
|
22350
|
-
hasRequiredBuild = 1;
|
|
22351
|
-
(function (module, exports) {
|
|
22352
|
-
!function (e, t) {
|
|
22353
|
-
module.exports = t() ;
|
|
22354
|
-
}(commonjsGlobal, function () {
|
|
22355
|
-
return function (e) {
|
|
22356
|
-
function t(n) {
|
|
22357
|
-
if (r[n]) return r[n].exports;
|
|
22358
|
-
var o = r[n] = {
|
|
22359
|
-
exports: {},
|
|
22360
|
-
id: n,
|
|
22361
|
-
loaded: !1
|
|
22362
|
-
};
|
|
22363
|
-
return e[n].call(o.exports, o, o.exports, t), o.loaded = !0, o.exports;
|
|
22364
|
-
}
|
|
22365
|
-
var r = {};
|
|
22366
|
-
return t.m = e, t.c = r, t.p = "", t(0);
|
|
22367
|
-
}([function (e, t) {
|
|
22368
|
-
|
|
22369
|
-
function r(e) {
|
|
22370
|
-
var t = e.getContext("2d"),
|
|
22371
|
-
r = e.width,
|
|
22372
|
-
n = e.height,
|
|
22373
|
-
o = t.getImageData(0, 0, r, n).data,
|
|
22374
|
-
f = a(!0, r, n, o),
|
|
22375
|
-
i = a(!1, r, n, o),
|
|
22376
|
-
c = u(!0, r, n, o),
|
|
22377
|
-
d = u(!1, r, n, o),
|
|
22378
|
-
p = d - c + 1,
|
|
22379
|
-
l = i - f + 1,
|
|
22380
|
-
s = t.getImageData(c, f, p, l);
|
|
22381
|
-
return e.width = p, e.height = l, t.clearRect(0, 0, p, l), t.putImageData(s, 0, 0), e;
|
|
22382
|
-
}
|
|
22383
|
-
function n(e, t, r, n) {
|
|
22384
|
-
return {
|
|
22385
|
-
red: n[4 * (r * t + e)],
|
|
22386
|
-
green: n[4 * (r * t + e) + 1],
|
|
22387
|
-
blue: n[4 * (r * t + e) + 2],
|
|
22388
|
-
alpha: n[4 * (r * t + e) + 3]
|
|
22389
|
-
};
|
|
22390
|
-
}
|
|
22391
|
-
function o(e, t, r, o) {
|
|
22392
|
-
return n(e, t, r, o).alpha;
|
|
22393
|
-
}
|
|
22394
|
-
function a(e, t, r, n) {
|
|
22395
|
-
for (var a = e ? 1 : -1, u = e ? 0 : r - 1, f = u; e ? f < r : f > -1; f += a) for (var i = 0; i < t; i++) if (o(i, f, t, n)) return f;
|
|
22396
|
-
return null;
|
|
22397
|
-
}
|
|
22398
|
-
function u(e, t, r, n) {
|
|
22399
|
-
for (var a = e ? 1 : -1, u = e ? 0 : t - 1, f = u; e ? f < t : f > -1; f += a) for (var i = 0; i < r; i++) if (o(f, i, t, n)) return f;
|
|
22400
|
-
return null;
|
|
22401
|
-
}
|
|
22402
|
-
Object.defineProperty(t, "__esModule", {
|
|
22403
|
-
value: !0
|
|
22404
|
-
}), t["default"] = r;
|
|
22405
|
-
}]);
|
|
22406
|
-
});
|
|
22407
|
-
})(build);
|
|
22408
|
-
return build.exports;
|
|
22409
|
-
}
|
|
22410
|
-
|
|
22411
22364
|
(function (module, exports) {
|
|
22412
22365
|
!function (e, t) {
|
|
22413
|
-
module.exports = t(
|
|
22414
|
-
}(commonjsGlobal, function (
|
|
22366
|
+
module.exports = t() ;
|
|
22367
|
+
}(commonjsGlobal, function () {
|
|
22415
22368
|
return function (e) {
|
|
22416
|
-
function t(
|
|
22417
|
-
if (n
|
|
22418
|
-
var
|
|
22369
|
+
function t(n) {
|
|
22370
|
+
if (r[n]) return r[n].exports;
|
|
22371
|
+
var o = r[n] = {
|
|
22419
22372
|
exports: {},
|
|
22420
|
-
id:
|
|
22373
|
+
id: n,
|
|
22421
22374
|
loaded: !1
|
|
22422
22375
|
};
|
|
22423
|
-
return e[
|
|
22376
|
+
return e[n].call(o.exports, o, o.exports, t), o.loaded = !0, o.exports;
|
|
22424
22377
|
}
|
|
22425
|
-
var
|
|
22426
|
-
return t.m = e, t.c =
|
|
22427
|
-
}([function (e, t
|
|
22378
|
+
var r = {};
|
|
22379
|
+
return t.m = e, t.c = r, t.p = "", t(0);
|
|
22380
|
+
}([function (e, t) {
|
|
22428
22381
|
|
|
22429
22382
|
function r(e) {
|
|
22430
|
-
|
|
22431
|
-
|
|
22432
|
-
|
|
22383
|
+
var t = e.getContext("2d"),
|
|
22384
|
+
r = e.width,
|
|
22385
|
+
n = e.height,
|
|
22386
|
+
o = t.getImageData(0, 0, r, n).data,
|
|
22387
|
+
f = a(!0, r, n, o),
|
|
22388
|
+
i = a(!1, r, n, o),
|
|
22389
|
+
c = u(!0, r, n, o),
|
|
22390
|
+
d = u(!1, r, n, o),
|
|
22391
|
+
p = d - c + 1,
|
|
22392
|
+
l = i - f + 1,
|
|
22393
|
+
s = t.getImageData(c, f, p, l);
|
|
22394
|
+
return e.width = p, e.height = l, t.clearRect(0, 0, p, l), t.putImageData(s, 0, 0), e;
|
|
22433
22395
|
}
|
|
22434
|
-
function
|
|
22435
|
-
|
|
22436
|
-
|
|
22437
|
-
|
|
22396
|
+
function n(e, t, r, n) {
|
|
22397
|
+
return {
|
|
22398
|
+
red: n[4 * (r * t + e)],
|
|
22399
|
+
green: n[4 * (r * t + e) + 1],
|
|
22400
|
+
blue: n[4 * (r * t + e) + 2],
|
|
22401
|
+
alpha: n[4 * (r * t + e) + 3]
|
|
22402
|
+
};
|
|
22438
22403
|
}
|
|
22439
|
-
function o(e, t) {
|
|
22440
|
-
|
|
22404
|
+
function o(e, t, r, o) {
|
|
22405
|
+
return n(e, t, r, o).alpha;
|
|
22441
22406
|
}
|
|
22442
|
-
function
|
|
22443
|
-
|
|
22444
|
-
return
|
|
22407
|
+
function a(e, t, r, n) {
|
|
22408
|
+
for (var a = e ? 1 : -1, u = e ? 0 : r - 1, f = u; e ? f < r : f > -1; f += a) for (var i = 0; i < t; i++) if (o(i, f, t, n)) return f;
|
|
22409
|
+
return null;
|
|
22445
22410
|
}
|
|
22446
|
-
function u(e, t) {
|
|
22447
|
-
|
|
22448
|
-
|
|
22449
|
-
constructor: {
|
|
22450
|
-
value: e,
|
|
22451
|
-
enumerable: !1,
|
|
22452
|
-
writable: !0,
|
|
22453
|
-
configurable: !0
|
|
22454
|
-
}
|
|
22455
|
-
}), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t);
|
|
22411
|
+
function u(e, t, r, n) {
|
|
22412
|
+
for (var a = e ? 1 : -1, u = e ? 0 : t - 1, f = u; e ? f < t : f > -1; f += a) for (var i = 0; i < r; i++) if (o(f, i, t, n)) return f;
|
|
22413
|
+
return null;
|
|
22456
22414
|
}
|
|
22457
22415
|
Object.defineProperty(t, "__esModule", {
|
|
22458
22416
|
value: !0
|
|
22459
|
-
});
|
|
22460
|
-
var s = Object.assign || function (e) {
|
|
22461
|
-
for (var t = 1; t < arguments.length; t++) {
|
|
22462
|
-
var n = arguments[t];
|
|
22463
|
-
for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
|
|
22464
|
-
}
|
|
22465
|
-
return e;
|
|
22466
|
-
},
|
|
22467
|
-
c = function () {
|
|
22468
|
-
function e(e, t) {
|
|
22469
|
-
for (var n = 0; n < t.length; n++) {
|
|
22470
|
-
var r = t[n];
|
|
22471
|
-
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r);
|
|
22472
|
-
}
|
|
22473
|
-
}
|
|
22474
|
-
return function (t, n, r) {
|
|
22475
|
-
return n && e(t.prototype, n), r && e(t, r), t;
|
|
22476
|
-
};
|
|
22477
|
-
}(),
|
|
22478
|
-
f = n(1),
|
|
22479
|
-
p = r(f),
|
|
22480
|
-
l = n(2),
|
|
22481
|
-
d = r(l),
|
|
22482
|
-
v = n(3),
|
|
22483
|
-
h = r(v),
|
|
22484
|
-
_ = n(4),
|
|
22485
|
-
g = r(_),
|
|
22486
|
-
m = function (e) {
|
|
22487
|
-
function t() {
|
|
22488
|
-
var e, n, r, u;
|
|
22489
|
-
o(this, t);
|
|
22490
|
-
for (var s = arguments.length, c = Array(s), f = 0; f < s; f++) c[f] = arguments[f];
|
|
22491
|
-
return n = r = i(this, (e = t.__proto__ || Object.getPrototypeOf(t)).call.apply(e, [this].concat(c))), r._sigPad = null, r._excludeOurProps = function () {
|
|
22492
|
-
var e = r.props,
|
|
22493
|
-
t = (e.canvasProps, e.clearOnResize, a(e, ["canvasProps", "clearOnResize"]));
|
|
22494
|
-
return t;
|
|
22495
|
-
}, r.getCanvas = function () {
|
|
22496
|
-
return r._canvas;
|
|
22497
|
-
}, r.getTrimmedCanvas = function () {
|
|
22498
|
-
var e = document.createElement("canvas");
|
|
22499
|
-
return e.width = r._canvas.width, e.height = r._canvas.height, e.getContext("2d").drawImage(r._canvas, 0, 0), (0, g["default"])(e);
|
|
22500
|
-
}, r.getSignaturePad = function () {
|
|
22501
|
-
return r._sigPad;
|
|
22502
|
-
}, r._checkClearOnResize = function () {
|
|
22503
|
-
r.props.clearOnResize && r._resizeCanvas();
|
|
22504
|
-
}, r._resizeCanvas = function () {
|
|
22505
|
-
var e = r.props.canvasProps || {},
|
|
22506
|
-
t = e.width,
|
|
22507
|
-
n = e.height;
|
|
22508
|
-
if (!t || !n) {
|
|
22509
|
-
var a = r._canvas,
|
|
22510
|
-
o = Math.max(window.devicePixelRatio || 1, 1);
|
|
22511
|
-
t || (a.width = a.offsetWidth * o), n || (a.height = a.offsetHeight * o), a.getContext("2d").scale(o, o), r.clear();
|
|
22512
|
-
}
|
|
22513
|
-
}, r.on = function () {
|
|
22514
|
-
return window.addEventListener("resize", r._checkClearOnResize), r._sigPad.on();
|
|
22515
|
-
}, r.off = function () {
|
|
22516
|
-
return window.removeEventListener("resize", r._checkClearOnResize), r._sigPad.off();
|
|
22517
|
-
}, r.clear = function () {
|
|
22518
|
-
return r._sigPad.clear();
|
|
22519
|
-
}, r.isEmpty = function () {
|
|
22520
|
-
return r._sigPad.isEmpty();
|
|
22521
|
-
}, r.fromDataURL = function (e, t) {
|
|
22522
|
-
return r._sigPad.fromDataURL(e, t);
|
|
22523
|
-
}, r.toDataURL = function (e, t) {
|
|
22524
|
-
return r._sigPad.toDataURL(e, t);
|
|
22525
|
-
}, r.fromData = function (e) {
|
|
22526
|
-
return r._sigPad.fromData(e);
|
|
22527
|
-
}, r.toData = function () {
|
|
22528
|
-
return r._sigPad.toData();
|
|
22529
|
-
}, u = n, i(r, u);
|
|
22530
|
-
}
|
|
22531
|
-
return u(t, e), c(t, [{
|
|
22532
|
-
key: "componentDidMount",
|
|
22533
|
-
value: function value() {
|
|
22534
|
-
this._sigPad = new h["default"](this._canvas, this._excludeOurProps()), this._resizeCanvas(), this.on();
|
|
22535
|
-
}
|
|
22536
|
-
}, {
|
|
22537
|
-
key: "componentWillUnmount",
|
|
22538
|
-
value: function value() {
|
|
22539
|
-
this.off();
|
|
22540
|
-
}
|
|
22541
|
-
}, {
|
|
22542
|
-
key: "componentDidUpdate",
|
|
22543
|
-
value: function value() {
|
|
22544
|
-
Object.assign(this._sigPad, this._excludeOurProps());
|
|
22545
|
-
}
|
|
22546
|
-
}, {
|
|
22547
|
-
key: "render",
|
|
22548
|
-
value: function value() {
|
|
22549
|
-
var e = this,
|
|
22550
|
-
t = this.props.canvasProps;
|
|
22551
|
-
return d["default"].createElement("canvas", s({
|
|
22552
|
-
ref: function ref(t) {
|
|
22553
|
-
e._canvas = t;
|
|
22554
|
-
}
|
|
22555
|
-
}, t));
|
|
22556
|
-
}
|
|
22557
|
-
}]), t;
|
|
22558
|
-
}(l.Component);
|
|
22559
|
-
m.propTypes = {
|
|
22560
|
-
velocityFilterWeight: p["default"].number,
|
|
22561
|
-
minWidth: p["default"].number,
|
|
22562
|
-
maxWidth: p["default"].number,
|
|
22563
|
-
minDistance: p["default"].number,
|
|
22564
|
-
dotSize: p["default"].oneOfType([p["default"].number, p["default"].func]),
|
|
22565
|
-
penColor: p["default"].string,
|
|
22566
|
-
throttle: p["default"].number,
|
|
22567
|
-
onEnd: p["default"].func,
|
|
22568
|
-
onBegin: p["default"].func,
|
|
22569
|
-
canvasProps: p["default"].object,
|
|
22570
|
-
clearOnResize: p["default"].bool
|
|
22571
|
-
}, m.defaultProps = {
|
|
22572
|
-
clearOnResize: !0
|
|
22573
|
-
}, t["default"] = m;
|
|
22574
|
-
}, function (t, n) {
|
|
22575
|
-
t.exports = e;
|
|
22576
|
-
}, function (e, n) {
|
|
22577
|
-
e.exports = t;
|
|
22578
|
-
}, function (e, t) {
|
|
22579
|
-
e.exports = n;
|
|
22580
|
-
}, function (e, t) {
|
|
22581
|
-
e.exports = r;
|
|
22417
|
+
}), t["default"] = r;
|
|
22582
22418
|
}]);
|
|
22583
22419
|
});
|
|
22584
|
-
})(build
|
|
22585
|
-
var buildExports = build
|
|
22586
|
-
var
|
|
22420
|
+
})(build);
|
|
22421
|
+
var buildExports = build.exports;
|
|
22422
|
+
var trimCanvas = /*@__PURE__*/getDefaultExportFromCjs(buildExports);
|
|
22423
|
+
|
|
22424
|
+
var _excluded = ["canvasProps", "clearOnResize"];
|
|
22425
|
+
var SignatureCanvas = /*#__PURE__*/function (_Component) {
|
|
22426
|
+
_inherits(SignatureCanvas, _Component);
|
|
22427
|
+
var _super = _createSuper(SignatureCanvas);
|
|
22428
|
+
function SignatureCanvas() {
|
|
22429
|
+
var _this;
|
|
22430
|
+
_classCallCheck(this, SignatureCanvas);
|
|
22431
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
22432
|
+
args[_key] = arguments[_key];
|
|
22433
|
+
}
|
|
22434
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
22435
|
+
_this.staticThis = _this.constructor;
|
|
22436
|
+
_this._sigPad = null;
|
|
22437
|
+
_this._canvas = null;
|
|
22438
|
+
_this.setRef = function (ref) {
|
|
22439
|
+
_this._canvas = ref;
|
|
22440
|
+
// if component is unmounted, set internal references to null
|
|
22441
|
+
if (_this._canvas === null) {
|
|
22442
|
+
_this._sigPad = null;
|
|
22443
|
+
}
|
|
22444
|
+
};
|
|
22445
|
+
_this._excludeOurProps = function () {
|
|
22446
|
+
var _this$props = _this.props;
|
|
22447
|
+
_this$props.canvasProps;
|
|
22448
|
+
_this$props.clearOnResize;
|
|
22449
|
+
var sigPadProps = _objectWithoutProperties(_this$props, _excluded);
|
|
22450
|
+
return sigPadProps;
|
|
22451
|
+
};
|
|
22452
|
+
_this.componentDidMount = function () {
|
|
22453
|
+
var canvas = _this.getCanvas();
|
|
22454
|
+
_this._sigPad = new SignaturePad$1(canvas, _this._excludeOurProps());
|
|
22455
|
+
_this._resizeCanvas();
|
|
22456
|
+
_this.on();
|
|
22457
|
+
};
|
|
22458
|
+
_this.componentWillUnmount = function () {
|
|
22459
|
+
_this.off();
|
|
22460
|
+
};
|
|
22461
|
+
_this.componentDidUpdate = function () {
|
|
22462
|
+
Object.assign(_this._sigPad, _this._excludeOurProps());
|
|
22463
|
+
};
|
|
22464
|
+
_this.getCanvas = function () {
|
|
22465
|
+
if (_this._canvas === null) {
|
|
22466
|
+
throw _this.staticThis.refNullError;
|
|
22467
|
+
}
|
|
22468
|
+
return _this._canvas;
|
|
22469
|
+
};
|
|
22470
|
+
_this.getTrimmedCanvas = function () {
|
|
22471
|
+
// copy the canvas
|
|
22472
|
+
var canvas = _this.getCanvas();
|
|
22473
|
+
var copy = document.createElement('canvas');
|
|
22474
|
+
copy.width = canvas.width;
|
|
22475
|
+
copy.height = canvas.height;
|
|
22476
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
22477
|
+
copy.getContext('2d').drawImage(canvas, 0, 0);
|
|
22478
|
+
// then trim it
|
|
22479
|
+
return trimCanvas(copy);
|
|
22480
|
+
};
|
|
22481
|
+
_this.getSignaturePad = function () {
|
|
22482
|
+
if (_this._sigPad === null) {
|
|
22483
|
+
throw _this.staticThis.refNullError;
|
|
22484
|
+
}
|
|
22485
|
+
return _this._sigPad;
|
|
22486
|
+
};
|
|
22487
|
+
_this._checkClearOnResize = function () {
|
|
22488
|
+
if (!_this.props.clearOnResize) {
|
|
22489
|
+
// eslint-disable-line @typescript-eslint/strict-boolean-expressions -- this is backward compatible with the previous behavior, where null was treated as falsey
|
|
22490
|
+
return;
|
|
22491
|
+
}
|
|
22492
|
+
_this._resizeCanvas();
|
|
22493
|
+
};
|
|
22494
|
+
_this._resizeCanvas = function () {
|
|
22495
|
+
var _this$props$canvasPro, _window$devicePixelRa;
|
|
22496
|
+
var canvasProps = (_this$props$canvasPro = _this.props.canvasProps) !== null && _this$props$canvasPro !== void 0 ? _this$props$canvasPro : {};
|
|
22497
|
+
var width = canvasProps.width,
|
|
22498
|
+
height = canvasProps.height;
|
|
22499
|
+
// don't resize if the canvas has fixed width and height
|
|
22500
|
+
if (typeof width !== 'undefined' && typeof height !== 'undefined') {
|
|
22501
|
+
return;
|
|
22502
|
+
}
|
|
22503
|
+
var canvas = _this.getCanvas();
|
|
22504
|
+
/* When zoomed out to less than 100%, for some very strange reason,
|
|
22505
|
+
some browsers report devicePixelRatio as less than 1
|
|
22506
|
+
and only part of the canvas is cleared then. */
|
|
22507
|
+
var ratio = Math.max((_window$devicePixelRa = window.devicePixelRatio) !== null && _window$devicePixelRa !== void 0 ? _window$devicePixelRa : 1, 1);
|
|
22508
|
+
if (typeof width === 'undefined') {
|
|
22509
|
+
canvas.width = canvas.offsetWidth * ratio;
|
|
22510
|
+
}
|
|
22511
|
+
if (typeof height === 'undefined') {
|
|
22512
|
+
canvas.height = canvas.offsetHeight * ratio;
|
|
22513
|
+
}
|
|
22514
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
22515
|
+
canvas.getContext('2d').scale(ratio, ratio);
|
|
22516
|
+
_this.clear();
|
|
22517
|
+
};
|
|
22518
|
+
_this.render = function () {
|
|
22519
|
+
var canvasProps = _this.props.canvasProps;
|
|
22520
|
+
return /*#__PURE__*/React.createElement("canvas", _extends({
|
|
22521
|
+
ref: _this.setRef
|
|
22522
|
+
}, canvasProps));
|
|
22523
|
+
};
|
|
22524
|
+
_this.on = function () {
|
|
22525
|
+
window.addEventListener('resize', _this._checkClearOnResize);
|
|
22526
|
+
return _this.getSignaturePad().on();
|
|
22527
|
+
};
|
|
22528
|
+
_this.off = function () {
|
|
22529
|
+
window.removeEventListener('resize', _this._checkClearOnResize);
|
|
22530
|
+
return _this.getSignaturePad().off();
|
|
22531
|
+
};
|
|
22532
|
+
_this.clear = function () {
|
|
22533
|
+
return _this.getSignaturePad().clear();
|
|
22534
|
+
};
|
|
22535
|
+
_this.isEmpty = function () {
|
|
22536
|
+
return _this.getSignaturePad().isEmpty();
|
|
22537
|
+
};
|
|
22538
|
+
_this.fromDataURL = function (dataURL, options) {
|
|
22539
|
+
return _this.getSignaturePad().fromDataURL(dataURL, options);
|
|
22540
|
+
};
|
|
22541
|
+
_this.toDataURL = function (type, encoderOptions) {
|
|
22542
|
+
return _this.getSignaturePad().toDataURL(type, encoderOptions);
|
|
22543
|
+
};
|
|
22544
|
+
_this.fromData = function (pointGroups) {
|
|
22545
|
+
return _this.getSignaturePad().fromData(pointGroups);
|
|
22546
|
+
};
|
|
22547
|
+
_this.toData = function () {
|
|
22548
|
+
return _this.getSignaturePad().toData();
|
|
22549
|
+
};
|
|
22550
|
+
return _this;
|
|
22551
|
+
} // shortcut reference (https://stackoverflow.com/a/29244254/3431180)
|
|
22552
|
+
// propagate prop updates to SignaturePad
|
|
22553
|
+
// return the canvas ref for operations like toDataURL
|
|
22554
|
+
// return a trimmed copy of the canvas
|
|
22555
|
+
// return the internal SignaturePad reference
|
|
22556
|
+
// all wrapper functions below render
|
|
22557
|
+
//
|
|
22558
|
+
return _createClass(SignatureCanvas);
|
|
22559
|
+
}(React.Component);
|
|
22560
|
+
SignatureCanvas.propTypes = {
|
|
22561
|
+
// signature_pad's props
|
|
22562
|
+
velocityFilterWeight: PropTypes.number,
|
|
22563
|
+
minWidth: PropTypes.number,
|
|
22564
|
+
maxWidth: PropTypes.number,
|
|
22565
|
+
minDistance: PropTypes.number,
|
|
22566
|
+
dotSize: PropTypes.oneOfType([PropTypes.number, PropTypes.func]),
|
|
22567
|
+
penColor: PropTypes.string,
|
|
22568
|
+
throttle: PropTypes.number,
|
|
22569
|
+
onEnd: PropTypes.func,
|
|
22570
|
+
onBegin: PropTypes.func,
|
|
22571
|
+
// props specific to the React wrapper
|
|
22572
|
+
canvasProps: PropTypes.object,
|
|
22573
|
+
clearOnResize: PropTypes.bool
|
|
22574
|
+
};
|
|
22575
|
+
SignatureCanvas.defaultProps = {
|
|
22576
|
+
clearOnResize: true
|
|
22577
|
+
};
|
|
22578
|
+
SignatureCanvas.refNullError = new Error('react-signature-canvas is currently ' + 'mounting or unmounting: React refs are null during this phase.');
|
|
22587
22579
|
|
|
22588
22580
|
function signatureDataToIdmissionFormat(signatureCanvas, imageUrl) {
|
|
22589
22581
|
imageUrl || (imageUrl = signatureCanvas.toDataURL());
|
|
@@ -23405,7 +23397,7 @@
|
|
|
23405
23397
|
onFaceLivenessSuccessProp === null || onFaceLivenessSuccessProp === void 0 ? void 0 : onFaceLivenessSuccessProp(response, request);
|
|
23406
23398
|
setCaptureState('CAPTURING_SIGNATURE');
|
|
23407
23399
|
logCaptureMetadata();
|
|
23408
|
-
var selfieFromRequest = (_b = (_a = request.customerData) === null || _a === void 0 ? void 0 : _a.biometricData) === null || _b === void 0 ? void 0 : _b.selfie;
|
|
23400
|
+
var selfieFromRequest = (_b = (_a = request === null || request === void 0 ? void 0 : request.customerData) === null || _a === void 0 ? void 0 : _a.biometricData) === null || _b === void 0 ? void 0 : _b.selfie;
|
|
23409
23401
|
if (!selfieImage && selfieFromRequest) {
|
|
23410
23402
|
setSelfieImage(selfieFromRequest);
|
|
23411
23403
|
}
|