idmission-web-sdk 2.2.126 → 2.2.128

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/sdk2.esm.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { forwardRef, useState, useEffect, useRef, useContext, createContext, useReducer, useCallback, useMemo, useLayoutEffect } from 'react';
3
+ import * as ReactDOM from 'react-dom/client';
3
4
  import platform from 'platform';
4
5
  import styled, { keyframes, useTheme, ThemeProvider as ThemeProvider$1 } from 'styled-components';
5
6
  import { useTranslation, initReactI18next } from 'react-i18next';
@@ -202,7 +203,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
202
203
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
203
204
  };
204
205
 
205
- var webSdkVersion = '2.2.126';
206
+ var webSdkVersion = '2.2.128';
206
207
 
207
208
  function getPlatform() {
208
209
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -15530,14 +15531,16 @@ var IdAndFaceValidation = function IdAndFaceValidation(_a) {
15530
15531
  idCaptureForceFallbackMode = _q === void 0 ? false : _q,
15531
15532
  _r = _a.idCaptureAllowUploadingDocumentsFromStorage,
15532
15533
  idCaptureAllowUploadingDocumentsFromStorage = _r === void 0 ? false : _r,
15533
- _s = _a.selfieCaptureModelLoadTimeoutMs,
15534
- selfieCaptureModelLoadTimeoutMs = _s === void 0 ? defaultSelfieCaptureModelLoadTimeoutMs : _s,
15535
- _t = _a.allowIdCardBackToFrontCapture,
15536
- allowIdCardBackToFrontCapture = _t === void 0 ? false : _t,
15537
- _u = _a.enableOverrideWrongDocumentTypeDialog,
15538
- enableOverrideWrongDocumentTypeDialog = _u === void 0 ? false : _u,
15539
- _v = _a.allowOverrideWrongDocumentTypeAfterMs,
15540
- allowOverrideWrongDocumentTypeAfterMs = _v === void 0 ? 8000 : _v,
15534
+ _s = _a.separateIdCardCaptureSequence,
15535
+ separateIdCardCaptureSequence = _s === void 0 ? false : _s,
15536
+ _t = _a.selfieCaptureModelLoadTimeoutMs,
15537
+ selfieCaptureModelLoadTimeoutMs = _t === void 0 ? defaultSelfieCaptureModelLoadTimeoutMs : _t,
15538
+ _u = _a.allowIdCardBackToFrontCapture,
15539
+ allowIdCardBackToFrontCapture = _u === void 0 ? false : _u,
15540
+ _v = _a.enableOverrideWrongDocumentTypeDialog,
15541
+ enableOverrideWrongDocumentTypeDialog = _v === void 0 ? false : _v,
15542
+ _w = _a.allowOverrideWrongDocumentTypeAfterMs,
15543
+ allowOverrideWrongDocumentTypeAfterMs = _w === void 0 ? 8000 : _w,
15541
15544
  onBeforeDocumentUpload = _a.onBeforeDocumentUpload,
15542
15545
  onDocumentUploaded = _a.onDocumentUploaded,
15543
15546
  onDocumentUploadProgress = _a.onDocumentUploadProgress,
@@ -15554,28 +15557,28 @@ var IdAndFaceValidation = function IdAndFaceValidation(_a) {
15554
15557
  onIdCaptureModelError = _a.onIdCaptureModelError,
15555
15558
  onSelfieCaptureModelError = _a.onSelfieCaptureModelError,
15556
15559
  onCameraAccessDenied = _a.onCameraAccessDenied,
15557
- _w = _a.captureSignature,
15558
- captureSignature = _w === void 0 ? false : _w,
15559
- _x = _a.captureSignatureVideo,
15560
- captureSignatureVideo = _x === void 0 ? false : _x,
15561
- _y = _a.captureAdditionalDocuments,
15562
- captureAdditionalDocuments = _y === void 0 ? [] : _y,
15563
- _z = _a.theme,
15564
- theme = _z === void 0 ? 'default' : _z,
15565
- _0 = _a.assets,
15566
- assets = _0 === void 0 ? {} : _0,
15567
- _1 = _a.classNames,
15568
- classNames = _1 === void 0 ? {} : _1,
15569
- _2 = _a.colors,
15570
- colors = _2 === void 0 ? {} : _2,
15571
- _3 = _a.verbiage,
15572
- verbiage = _3 === void 0 ? {} : _3,
15573
- _4 = _a.geolocationEnabled,
15574
- geolocationEnabled = _4 === void 0 ? true : _4,
15575
- _5 = _a.geolocationRequired,
15576
- geolocationRequired = _5 === void 0 ? false : _5,
15577
- _6 = _a.debugMode,
15578
- debugMode = _6 === void 0 ? false : _6;
15560
+ _x = _a.captureSignature,
15561
+ captureSignature = _x === void 0 ? false : _x,
15562
+ _y = _a.captureSignatureVideo,
15563
+ captureSignatureVideo = _y === void 0 ? false : _y,
15564
+ _z = _a.captureAdditionalDocuments,
15565
+ captureAdditionalDocuments = _z === void 0 ? [] : _z,
15566
+ _0 = _a.theme,
15567
+ theme = _0 === void 0 ? 'default' : _0,
15568
+ _1 = _a.assets,
15569
+ assets = _1 === void 0 ? {} : _1,
15570
+ _2 = _a.classNames,
15571
+ classNames = _2 === void 0 ? {} : _2,
15572
+ _3 = _a.colors,
15573
+ colors = _3 === void 0 ? {} : _3,
15574
+ _4 = _a.verbiage,
15575
+ verbiage = _4 === void 0 ? {} : _4,
15576
+ _5 = _a.geolocationEnabled,
15577
+ geolocationEnabled = _5 === void 0 ? true : _5,
15578
+ _6 = _a.geolocationRequired,
15579
+ geolocationRequired = _6 === void 0 ? false : _6,
15580
+ _7 = _a.debugMode,
15581
+ debugMode = _7 === void 0 ? false : _7;
15579
15582
  useLanguage(lang);
15580
15583
  useDebugLogging(debugMode);
15581
15584
  var idCaptureProps = useMemo(function () {
@@ -15603,10 +15606,11 @@ var IdAndFaceValidation = function IdAndFaceValidation(_a) {
15603
15606
  enableOverrideWrongDocumentTypeDialog: enableOverrideWrongDocumentTypeDialog,
15604
15607
  allowOverrideWrongDocumentTypeAfterMs: allowOverrideWrongDocumentTypeAfterMs,
15605
15608
  forceFallbackMode: idCaptureForceFallbackMode,
15609
+ separateIdCardCaptureSequence: separateIdCardCaptureSequence,
15606
15610
  skipSuccessScreen: skipSuccessScreen,
15607
15611
  debugMode: debugMode
15608
15612
  };
15609
- }, [onExitCapture, onUserCancel, onIdCaptureModelError, assets.idCapture, classNames.idCapture, colors.idCapture, verbiage.idCapture, precapturedDocuments, idCaptureRequirement, allowSinglePageIdCapture, idCaptureThresholds, idCaptureLoadingOverlayMode, idCaptureInstructions, idCaptureGuideType, idCaptureGuideImages, idCapturePortraitGuidesOnMobile, idCaptureRotateLoadingOverlayImageWhenPortrait, idCaptureModelLoadTimeoutMs, allowIdCardBackToFrontCapture, idCaptureAllowUploadingDocumentsFromStorage, enableOverrideWrongDocumentTypeDialog, allowOverrideWrongDocumentTypeAfterMs, idCaptureForceFallbackMode, skipSuccessScreen, debugMode]);
15613
+ }, [onExitCapture, onUserCancel, onIdCaptureModelError, assets.idCapture, classNames.idCapture, colors.idCapture, verbiage.idCapture, precapturedDocuments, idCaptureRequirement, allowSinglePageIdCapture, idCaptureThresholds, idCaptureLoadingOverlayMode, idCaptureInstructions, idCaptureGuideType, idCaptureGuideImages, idCapturePortraitGuidesOnMobile, idCaptureRotateLoadingOverlayImageWhenPortrait, idCaptureModelLoadTimeoutMs, allowIdCardBackToFrontCapture, idCaptureAllowUploadingDocumentsFromStorage, enableOverrideWrongDocumentTypeDialog, allowOverrideWrongDocumentTypeAfterMs, idCaptureForceFallbackMode, separateIdCardCaptureSequence, skipSuccessScreen, debugMode]);
15610
15614
  var faceLivenessProps = useMemo(function () {
15611
15615
  return {
15612
15616
  loadingOverlayMode: faceLivenessLoadingOverlayMode,
@@ -15787,6 +15791,8 @@ var CustomerIdAndBiometricsEnrollment = function CustomerIdAndBiometricsEnrollme
15787
15791
  allowOverrideWrongDocumentTypeAfterMs = _u === void 0 ? 8000 : _u,
15788
15792
  _v = _a.allowUploadingDocumentsFromStorage,
15789
15793
  allowUploadingDocumentsFromStorage = _v === void 0 ? false : _v,
15794
+ _w = _a.separateIdCardCaptureSequence,
15795
+ separateIdCardCaptureSequence = _w === void 0 ? false : _w,
15790
15796
  onBeforeDocumentUpload = _a.onBeforeDocumentUpload,
15791
15797
  onDocumentUploadProgress = _a.onDocumentUploadProgress,
15792
15798
  onDocumentUploaded = _a.onDocumentUploaded,
@@ -15802,31 +15808,31 @@ var CustomerIdAndBiometricsEnrollment = function CustomerIdAndBiometricsEnrollme
15802
15808
  onIdCaptureModelError = _a.onIdCaptureModelError,
15803
15809
  onSelfieCaptureModelError = _a.onSelfieCaptureModelError,
15804
15810
  onCameraAccessDenied = _a.onCameraAccessDenied,
15805
- _w = _a.captureSignature,
15806
- captureSignature = _w === void 0 ? false : _w,
15807
- _x = _a.captureSignatureVideo,
15808
- captureSignatureVideo = _x === void 0 ? false : _x,
15809
- _y = _a.captureAdditionalDocuments,
15810
- captureAdditionalDocuments = _y === void 0 ? [] : _y,
15811
- _z = _a.captureVideoId,
15812
- captureVideoId = _z === void 0 ? false : _z,
15811
+ _x = _a.captureSignature,
15812
+ captureSignature = _x === void 0 ? false : _x,
15813
+ _y = _a.captureSignatureVideo,
15814
+ captureSignatureVideo = _y === void 0 ? false : _y,
15815
+ _z = _a.captureAdditionalDocuments,
15816
+ captureAdditionalDocuments = _z === void 0 ? [] : _z,
15817
+ _0 = _a.captureVideoId,
15818
+ captureVideoId = _0 === void 0 ? false : _0,
15813
15819
  captureVideoIdProps = _a.captureVideoIdProps,
15814
- _0 = _a.theme,
15815
- theme = _0 === void 0 ? 'default' : _0,
15816
- _1 = _a.assets,
15817
- assets = _1 === void 0 ? {} : _1,
15818
- _2 = _a.classNames,
15819
- classNames = _2 === void 0 ? {} : _2,
15820
- _3 = _a.colors,
15821
- colors = _3 === void 0 ? {} : _3,
15822
- _4 = _a.verbiage,
15823
- verbiage = _4 === void 0 ? {} : _4,
15824
- _5 = _a.geolocationEnabled,
15825
- geolocationEnabled = _5 === void 0 ? true : _5,
15826
- _6 = _a.geolocationRequired,
15827
- geolocationRequired = _6 === void 0 ? false : _6,
15828
- _7 = _a.debugMode,
15829
- debugMode = _7 === void 0 ? false : _7;
15820
+ _1 = _a.theme,
15821
+ theme = _1 === void 0 ? 'default' : _1,
15822
+ _2 = _a.assets,
15823
+ assets = _2 === void 0 ? {} : _2,
15824
+ _3 = _a.classNames,
15825
+ classNames = _3 === void 0 ? {} : _3,
15826
+ _4 = _a.colors,
15827
+ colors = _4 === void 0 ? {} : _4,
15828
+ _5 = _a.verbiage,
15829
+ verbiage = _5 === void 0 ? {} : _5,
15830
+ _6 = _a.geolocationEnabled,
15831
+ geolocationEnabled = _6 === void 0 ? true : _6,
15832
+ _7 = _a.geolocationRequired,
15833
+ geolocationRequired = _7 === void 0 ? false : _7,
15834
+ _8 = _a.debugMode,
15835
+ debugMode = _8 === void 0 ? false : _8;
15830
15836
  useLanguage(lang);
15831
15837
  useDebugLogging(debugMode);
15832
15838
  var idCaptureProps = useMemo(function () {
@@ -15850,13 +15856,14 @@ var CustomerIdAndBiometricsEnrollment = function CustomerIdAndBiometricsEnrollme
15850
15856
  enableOverrideWrongDocumentTypeDialog: enableOverrideWrongDocumentTypeDialog,
15851
15857
  allowOverrideWrongDocumentTypeAfterMs: allowOverrideWrongDocumentTypeAfterMs,
15852
15858
  allowUploadingDocumentsFromStorage: allowUploadingDocumentsFromStorage,
15859
+ separateIdCardCaptureSequence: separateIdCardCaptureSequence,
15853
15860
  onExitCapture: onExitCapture,
15854
15861
  onUserCancel: onUserCancel,
15855
15862
  onModelError: onIdCaptureModelError,
15856
15863
  skipSuccessScreen: skipSuccessScreen,
15857
15864
  debugMode: debugMode
15858
15865
  };
15859
- }, [assets.idCapture, classNames.idCapture, colors.idCapture, verbiage.idCapture, idCaptureRequirement, allowSinglePageIdCapture, idCaptureThresholds, idCaptureLoadingOverlayMode, idCaptureInstructions, idCaptureGuideType, idCaptureGuideImages, idCapturePortraitGuidesOnMobile, idCaptureRotateLoadingOverlayImageWhenPortrait, idCaptureModelLoadTimeoutMs, allowIdCardBackToFrontCapture, idCaptureForceFallbackMode, enableOverrideWrongDocumentTypeDialog, allowOverrideWrongDocumentTypeAfterMs, allowUploadingDocumentsFromStorage, onExitCapture, onUserCancel, onIdCaptureModelError, skipSuccessScreen, debugMode]);
15866
+ }, [assets.idCapture, classNames.idCapture, colors.idCapture, verbiage.idCapture, idCaptureRequirement, allowSinglePageIdCapture, idCaptureThresholds, idCaptureLoadingOverlayMode, idCaptureInstructions, idCaptureGuideType, idCaptureGuideImages, idCapturePortraitGuidesOnMobile, idCaptureRotateLoadingOverlayImageWhenPortrait, idCaptureModelLoadTimeoutMs, allowIdCardBackToFrontCapture, idCaptureForceFallbackMode, enableOverrideWrongDocumentTypeDialog, allowOverrideWrongDocumentTypeAfterMs, allowUploadingDocumentsFromStorage, separateIdCardCaptureSequence, onExitCapture, onUserCancel, onIdCaptureModelError, skipSuccessScreen, debugMode]);
15860
15867
  var faceLivenessProps = useMemo(function () {
15861
15868
  return {
15862
15869
  onExitCapture: onExitCapture,
@@ -17669,7 +17676,78 @@ var DocumentCapture = function DocumentCapture(_a) {
17669
17676
  };
17670
17677
 
17671
17678
  initializeI18n();
17679
+ function renderElement(component, targetElement) {
17680
+ if (typeof targetElement === 'string') {
17681
+ var result = document.querySelector(targetElement);
17682
+ if (!result) throw new Error("targetElement ".concat(targetElement, " not found"));
17683
+ targetElement = result;
17684
+ } else if (!targetElement) {
17685
+ targetElement = document.createElement('div');
17686
+ document.body.append(targetElement);
17687
+ }
17688
+ var root = ReactDOM.createRoot(targetElement);
17689
+ root.render( /*#__PURE__*/React__default.createElement(OverlayContainer, null, component));
17690
+ if ('remove' in targetElement) {
17691
+ var originalRemove_1 = targetElement.remove;
17692
+ targetElement.remove = function () {
17693
+ try {
17694
+ root.unmount();
17695
+ originalRemove_1();
17696
+ } catch (e) {
17697
+ debug('failed to unmount', e);
17698
+ }
17699
+ };
17700
+ }
17701
+ return targetElement;
17702
+ }
17703
+ function renderComponent(Component, targetElement, options) {
17704
+ if (!options) {
17705
+ options = targetElement;
17706
+ targetElement = undefined;
17707
+ }
17708
+ return renderElement( /*#__PURE__*/React__default.createElement(Component, _assign({}, options)), targetElement);
17709
+ }
17710
+ var renderIdValidation = function renderIdValidation(optionsOrTargetElement, options) {
17711
+ return renderComponent(IdValidation, optionsOrTargetElement, options);
17712
+ };
17713
+ var renderFaceValidation = function renderFaceValidation(optionsOrTargetElement, options) {
17714
+ return renderComponent(FaceValidation, optionsOrTargetElement, options);
17715
+ };
17716
+ var renderIdAndFaceValidation = function renderIdAndFaceValidation(optionsOrTargetElement, options) {
17717
+ return renderComponent(IdAndFaceValidation, optionsOrTargetElement, options);
17718
+ };
17719
+ var renderCustomerIdAndBiometricsEnrollment = function renderCustomerIdAndBiometricsEnrollment(optionsOrTargetElement, options) {
17720
+ return renderComponent(CustomerIdAndBiometricsEnrollment, optionsOrTargetElement, options);
17721
+ };
17722
+ var renderCustomerBiometricsEnrollment = function renderCustomerBiometricsEnrollment(optionsOrTargetElement, options) {
17723
+ return renderComponent(CustomerBiometricsEnrollment, optionsOrTargetElement, options);
17724
+ };
17725
+ var renderCustomerVerification = function renderCustomerVerification(optionsOrTargetElement, options) {
17726
+ return renderComponent(CustomerVerification, optionsOrTargetElement, options);
17727
+ };
17728
+ var renderCustomerIdentification = function renderCustomerIdentification(optionsOrTargetElement, options) {
17729
+ return renderComponent(CustomerIdentification, optionsOrTargetElement, options);
17730
+ };
17731
+ var renderSignatureKYC = function renderSignatureKYC(optionsOrTargetElement, options) {
17732
+ return renderComponent(SignatureKYC, optionsOrTargetElement, options);
17733
+ };
17734
+ var renderVideoIdValidation = function renderVideoIdValidation(optionsOrTargetElement, options) {
17735
+ return renderComponent(VideoIdValidation, optionsOrTargetElement, options);
17736
+ };
17737
+ var renderDocumentCapture = function renderDocumentCapture(optionsOrTargetElement, options) {
17738
+ return renderComponent(DocumentCapture, optionsOrTargetElement, options);
17739
+ };
17672
17740
  globalThis.IDmissionSDK = {
17741
+ renderIdValidation: renderIdValidation,
17742
+ renderFaceValidation: renderFaceValidation,
17743
+ renderIdAndFaceValidation: renderIdAndFaceValidation,
17744
+ renderCustomerIdAndBiometricsEnrollment: renderCustomerIdAndBiometricsEnrollment,
17745
+ renderCustomerBiometricsEnrollment: renderCustomerBiometricsEnrollment,
17746
+ renderCustomerVerification: renderCustomerVerification,
17747
+ renderCustomerIdentification: renderCustomerIdentification,
17748
+ renderSignatureKYC: renderSignatureKYC,
17749
+ renderVideoIdValidation: renderVideoIdValidation,
17750
+ renderDocumentCapture: renderDocumentCapture,
17673
17751
  preloadModels: preloadModels,
17674
17752
  themes: themes,
17675
17753
  version: webSdkVersion,
@@ -17681,5 +17759,5 @@ globalThis.IDmissionSDK = {
17681
17759
  setServerUrl: setServerUrl
17682
17760
  };
17683
17761
 
17684
- export { CapturedDocumentImg, CustomerBiometricsEnrollment, CustomerIdAndBiometricsEnrollment, CustomerIdentification, CustomerVerification, DocumentCapture, FaceValidation, IdAndFaceValidation, IdValidation, SignatureKYC, VideoIdValidation, allowedAuthUrls, defaultAuthUrl, defaultSubmissionUrl, isObject, preloadModels, setServerUrl, themes };
17762
+ export { CapturedDocumentImg, CustomerBiometricsEnrollment, CustomerIdAndBiometricsEnrollment, CustomerIdentification, CustomerVerification, DocumentCapture, FaceValidation, IdAndFaceValidation, IdValidation, SignatureKYC, VideoIdValidation, allowedAuthUrls, defaultAuthUrl, defaultSubmissionUrl, isObject, preloadModels, renderCustomerBiometricsEnrollment, renderCustomerIdAndBiometricsEnrollment, renderCustomerIdentification, renderCustomerVerification, renderDocumentCapture, renderFaceValidation, renderIdAndFaceValidation, renderIdValidation, renderSignatureKYC, renderVideoIdValidation, setServerUrl, themes };
17685
17763
  //# sourceMappingURL=sdk2.esm.js.map