idmission-web-sdk 2.2.101 → 2.2.103

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.
@@ -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.101';
214
+ var webSdkVersion = '2.2.103';
215
215
 
216
216
  function getPlatform() {
217
217
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -18342,6 +18342,8 @@
18342
18342
  }
18343
18343
  if (!isMobile() && documentToCapture || useFallback) {
18344
18344
  return /*#__PURE__*/React.createElement(DocumentCaptureWizard, {
18345
+ classNames: classNames === null || classNames === void 0 ? void 0 : classNames.documentCaptureClassNames,
18346
+ verbiage: rawVerbiage === null || rawVerbiage === void 0 ? void 0 : rawVerbiage.documentCaptureVerbiage,
18345
18347
  documents: [{
18346
18348
  title: documentToCapture
18347
18349
  }],
@@ -18558,6 +18560,7 @@
18558
18560
  }, /*#__PURE__*/React.createElement(XIcon, null)))));
18559
18561
  }
18560
18562
  function PassportUploadScreen(_a) {
18563
+ var _this = this;
18561
18564
  var _b = _a.classNames,
18562
18565
  classNames = _b === void 0 ? {} : _b,
18563
18566
  _c = _a.verbiage,
@@ -18565,7 +18568,6 @@
18565
18568
  var _d = React.useState(null),
18566
18569
  file = _d[0],
18567
18570
  setFile = _d[1];
18568
- var onCapturedManually = useOnCapturedManually();
18569
18571
  var verbiage = useTranslations(rawVerbiage, {
18570
18572
  uploadPassportText: 'Upload Passport',
18571
18573
  loadingText: 'Loading...',
@@ -18591,7 +18593,23 @@
18591
18593
  disabled: !file,
18592
18594
  colors: buttonColors,
18593
18595
  onClick: function onClick() {
18594
- return onCapturedManually(file);
18596
+ return __awaiter(_this, void 0, void 0, function () {
18597
+ var _a;
18598
+ var _b, _c;
18599
+ return __generator(this, function (_d) {
18600
+ switch (_d.label) {
18601
+ case 0:
18602
+ _a = dispatchIdCaptureAction;
18603
+ _b = {
18604
+ type: 'documentCaptured'
18605
+ };
18606
+ _c = {};
18607
+ return [4 /*yield*/, readFile(file)];
18608
+ case 1:
18609
+ return [2 /*return*/, _a.apply(void 0, [(_b.payload = (_c.imageData = _d.sent(), _c.documentType = 'passport', _c.width = 0, _c.height = 0, _c), _b)])];
18610
+ }
18611
+ });
18612
+ });
18595
18613
  }
18596
18614
  }, verbiage.continueText)));
18597
18615
  }
@@ -18648,41 +18666,33 @@
18648
18666
  colors: buttonColors,
18649
18667
  onClick: function onClick() {
18650
18668
  return __awaiter(_this, void 0, void 0, function () {
18651
- var _a, _b, _c, _d, _e;
18652
- var _f, _g, _h, _j, _k;
18653
- return __generator(this, function (_l) {
18654
- switch (_l.label) {
18669
+ var _a, _b, _c, _d;
18670
+ var _e, _f, _g, _h;
18671
+ return __generator(this, function (_j) {
18672
+ switch (_j.label) {
18655
18673
  case 0:
18656
- if (!(!idBackFile && state.allowSinglePageIdCapture)) return [3 /*break*/, 2];
18657
- state.dispatch({
18658
- type: 'setUploadingDocumentsType',
18659
- payload: 'singlePage'
18660
- });
18661
18674
  _b = (_a = state).dispatch;
18662
- _f = {
18663
- type: 'documentCaptured'
18675
+ _e = {
18676
+ type: 'documentsCaptured'
18664
18677
  };
18665
- _g = {};
18678
+ if (!(!idBackFile && state.allowSinglePageIdCapture)) return [3 /*break*/, 2];
18679
+ _f = {};
18666
18680
  return [4 /*yield*/, readFile(idFrontFile)];
18667
18681
  case 1:
18668
- _b.apply(_a, [(_f.payload = (_g.imageData = _l.sent(), _g.documentType = 'singlePage', _g.width = 0, _g.height = 0, _g), _f)]);
18682
+ _c = [(_f.imageData = _j.sent(), _f.documentType = 'singlePage', _f.width = 0, _f.height = 0, _f)];
18669
18683
  return [3 /*break*/, 5];
18670
18684
  case 2:
18671
- _d = (_c = state).dispatch;
18672
- _h = {
18673
- type: 'documentsCaptured'
18674
- };
18675
- _j = {};
18685
+ _g = {};
18676
18686
  return [4 /*yield*/, readFile(idFrontFile)];
18677
18687
  case 3:
18678
- _e = [(_j.imageData = _l.sent(), _j.documentType = 'idCardFront', _j.width = 0, _j.height = 0, _j)];
18679
- _k = {};
18688
+ _d = [(_g.imageData = _j.sent(), _g.documentType = 'idCardFront', _g.width = 0, _g.height = 0, _g)];
18689
+ _h = {};
18680
18690
  return [4 /*yield*/, readFile(idBackFile)];
18681
18691
  case 4:
18682
- _d.apply(_c, [(_h.payload = _e.concat([(_k.imageData = _l.sent(), _k.documentType = 'idCardBack', _k.width = 0, _k.height = 0, _k)]), _h)]);
18683
- _l.label = 5;
18692
+ _c = _d.concat([(_h.imageData = _j.sent(), _h.documentType = 'idCardBack', _h.width = 0, _h.height = 0, _h)]);
18693
+ _j.label = 5;
18684
18694
  case 5:
18685
- return [2 /*return*/];
18695
+ return [2 /*return*/, _b.apply(_a, [(_e.payload = _c, _e)])];
18686
18696
  }
18687
18697
  });
18688
18698
  });
@@ -18703,25 +18713,6 @@
18703
18713
  }
18704
18714
  }, children);
18705
18715
  }
18706
- function useOnCapturedManually() {
18707
- return React.useCallback(function () {
18708
- var files = [];
18709
- for (var _i = 0; _i < arguments.length; _i++) {
18710
- files[_i] = arguments[_i];
18711
- }
18712
- return Promise.all(files.filter(Boolean).map(readFile)).then(function (f) {
18713
- for (var _i = 0, f_1 = f; _i < f_1.length; _i++) {
18714
- var imageData = f_1[_i];
18715
- dispatchIdCaptureAction({
18716
- type: 'documentCapturedManually',
18717
- payload: {
18718
- imageData: imageData
18719
- }
18720
- });
18721
- }
18722
- });
18723
- }, []);
18724
- }
18725
18716
  function readFile(file) {
18726
18717
  return new Promise(function (resolve, reject) {
18727
18718
  if (!file) return reject(new Error('File is undefined'));
@@ -20294,6 +20285,8 @@
20294
20285
  if (usingDocumentCapture || silentFallback && !!invalidSelfie && !image && !isMobile() // desktop silent fallback - not a very realistic situation
20295
20286
  ) {
20296
20287
  return /*#__PURE__*/React.createElement(DocumentCaptureWizard, {
20288
+ classNames: classNames === null || classNames === void 0 ? void 0 : classNames.documentCaptureClassNames,
20289
+ verbiage: rawVerbiage === null || rawVerbiage === void 0 ? void 0 : rawVerbiage.documentCaptureVerbiage,
20297
20290
  documents: [{
20298
20291
  title: invalidSelfie ? verbiage.livenessFailedText : verbiage.descriptionText
20299
20292
  }],