@regulaforensics/idv-document 4.0.663-nightly → 4.0.665-nightly

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/main.iife.js CHANGED
@@ -57,7 +57,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
57
57
  width: 100%;
58
58
  height: 100%;
59
59
  }
60
- `;function Gz(e,t){if(typeof Reflect==`object`&&typeof Reflect.metadata==`function`)return Reflect.metadata(e,t)}function Kz(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var qz=class extends Ne{constructor(...e){super(...e),this._performType=sz.DATA,this.props=null,this._handleDocumentReader=e=>{var t,n,r,i;if((t=this.props)==null||(n=t.idvEventListener)==null||n.call(t,`IDV-DOCUMENT`,e.detail.action),e.detail.action===W.CAMERA_PROCESS_STARTED&&(r=this.props)!=null&&r.isProcessing&&this.props.isProcessing(!1),e.detail.action===W.PROCESS_FINISHED){var a,o,s,c,l;if(((a=e.detail.data)==null?void 0:a.status)===ip.ERROR){var u;let t={transactionId:``,cancel:!1,has_nfc:!1,errorCode:e.detail.data.reason};(u=this.props)==null||u.perform(t,this._performType)}let t=(o=e.detail.data)==null?void 0:o.status,n=t===ip.OK,r=t===ip.TIMEOUT;if(!(n||r)||!((s=e.detail.data)!=null&&s.response))return;(c=this.props)!=null&&c.isProcessing&&this.props.isProcessing(!0);let i=(l=this.props)==null||(l=l.moduleProps)==null?void 0:l.finalizePackageSettings;Nz(()=>window.RegulaDocumentSDK.finalizePackage(),i==null?void 0:i.retryCount,i==null?void 0:i.retryDelay).then(e=>{var t;let n={transactionId:(e==null?void 0:e.transactionId)||``,cancel:!1,has_nfc:!1,errorCode:``};(t=this.props)==null||t.perform(n,this._performType)}).catch(e=>{var t;console.log(`finalizePackage error: `,e),(t=this.props)==null||t.perform({transactionId:``,cancel:!0,has_nfc:!1,errorCode:``},this._performType)})}if(((i=e.detail)==null?void 0:i.action)===W.CLOSE||e.detail.action===W.CAMERA_PROCESS_CLOSED){var d;(d=this.props)==null||d.perform({transactionId:``,cancel:!0,has_nfc:!1,errorCode:``},this._performType)}}}_prepareCustomizationStyles(e,t,n){let r=[];if(e!=null&&e.fontFamily&&r.push(s`
60
+ `;function Gz(e,t){if(typeof Reflect==`object`&&typeof Reflect.metadata==`function`)return Reflect.metadata(e,t)}function Kz(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var qz=class extends Ne{constructor(...e){super(...e),this._performType=sz.DATA,this.props=null,this._handleDocumentReader=e=>{var t,n,r,i;if((t=this.props)==null||(n=t.idvEventListener)==null||n.call(t,`IDV-DOCUMENT`,e.detail.action),e.detail.action===W.CAMERA_PROCESS_STARTED&&(r=this.props)!=null&&r.isProcessing&&this.props.isProcessing(!1),e.detail.action===W.PROCESS_FINISHED){var a,o,s,c,l;if(((a=e.detail.data)==null?void 0:a.status)===ip.ERROR){var u;let t={transactionId:``,cancel:!1,has_nfc:!1,errorCode:e.detail.data.reason};(u=this.props)==null||u.perform(t,this._performType)}let t=(o=e.detail.data)==null?void 0:o.status,n=t===ip.OK,r=t===ip.TIMEOUT;if(!(n||r)||!((s=e.detail.data)!=null&&s.response))return;if((c=this.props)!=null&&c.isProcessing){var d,f;(d=this.props)==null||(f=d.idvEventListener)==null||f.call(d,`IDV-DOCUMENT`,`Success. Start to finalize package`,`DEBUG`),this.props.isProcessing(!0)}let i=(l=this.props)==null||(l=l.moduleProps)==null?void 0:l.finalizePackageSettings;Nz(()=>window.RegulaDocumentSDK.finalizePackage(),i==null?void 0:i.retryCount,i==null?void 0:i.retryDelay).then(e=>{var t;let n={transactionId:(e==null?void 0:e.transactionId)||``,cancel:!1,has_nfc:!1,errorCode:``};(t=this.props)==null||t.perform(n,this._performType)}).catch(e=>{var t;console.log(`finalizePackage error: `,e),(t=this.props)==null||t.perform({transactionId:``,cancel:!0,has_nfc:!1,errorCode:``},this._performType)})}if(((i=e.detail)==null?void 0:i.action)===W.CLOSE||e.detail.action===W.CAMERA_PROCESS_CLOSED){var p;(p=this.props)==null||p.perform({transactionId:``,cancel:!0,has_nfc:!1,errorCode:``},this._performType)}}}_prepareCustomizationStyles(e,t,n){let r=[];if(e!=null&&e.fontFamily&&r.push(s`
61
61
  document-reader::part(container) {
62
62
  font-family: ${o(e.fontFamily)};
63
63
  }
@@ -277,7 +277,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
277
277
  d="M93.1547 5.85404C92.7965 5.24412 91.9727 4.77991 90.8981 4.77991C89.0174 4.77991 87.459 6.35794 87.459 8.38431C87.459 10.3925 89.0174 11.9336 90.8981 11.9336C91.9191 11.9336 92.5637 11.6287 93.0651 10.9996V11.6455C93.0651 13.0442 92.08 13.5462 91.1308 13.5462C90.1816 13.5462 89.4292 13.0792 89.286 12.0578H87.7099C87.7818 13.8512 89.2142 15 91.1308 15C93.0474 15 94.6758 13.9063 94.6758 11.539V4.83175H93.1547V5.85404ZM91.0772 10.3911C89.9307 10.3911 89.1069 9.54811 89.1069 8.38291C89.1069 7.21772 89.9307 6.32058 91.0772 6.32058C92.2237 6.32058 93.0651 7.21725 93.0651 8.38291C93.0651 9.54858 92.2232 10.3911 91.0772 10.3911Z"
278
278
  fill="#BD7DFF"
279
279
  />
280
- </svg>`,eB=class extends Ne{constructor(...e){var t;super(...e),t=this,this._performType=sz.DATA,this.props=null,this._handleInputChange=function(){var e=d(function*(e){var n,r,i;let a=[...(n=e.target.files)==null?[]:n];if(!a.length)return;(r=t.props)!=null&&r.isProcessing&&t.props.isProcessing(!0),yield window.RegulaDocumentSDK.createBackendTransaction({},window.RegulaDocumentSDK.recognizerProcessParam);for(let e of a){let{isExtraLargeResolution:n,isDownscaleNeeded:r}=yield Rz(e,yz,bz,xz),i=e.type.startsWith(`image/webp`);if(n){var o;(o=t.props)==null||o.perform({transactionId:``,cancel:!1,has_nfc:!1,errorCode:`IMAGE_RESOLUTION_EXCEEDS_LIMIT`},t._performType);return}let a;if(r||i){let n=yield Bz(e,yz,bz);if(!n.ok){var s;let e={transactionId:``,cancel:!1,has_nfc:!1,errorCode:r?`IMAGE_DOWNSCALING_ERROR`:`IMAGE_PROCESSING_ERROR`};(s=t.props)==null||s.perform(e,t._performType);return}a=[n.imageData]}else a=[yield e.arrayBuffer()];try{yield window.RegulaDocumentSDK.processImage(a)}catch(e){var c;(c=t.props)==null||c.perform({transactionId:``,cancel:!1,has_nfc:!1,errorCode:`IMAGE_PROCESSING_ERROR`},t._performType)}}let l=(i=t.props)==null||(i=i.moduleProps)==null?void 0:i.finalizePackageSettings;try{var u;let e=yield Nz(d(function*(){return window.RegulaDocumentSDK.finalizePackage()}),l==null?void 0:l.retryCount,l==null?void 0:l.retryDelay),n={transactionId:e==null?void 0:e.transactionId,cancel:!1,has_nfc:!1,errorCode:``};(u=t.props)==null||u.perform(n,t._performType)}catch(e){var f;console.log(`finalizePackage error: `,e),(f=t.props)==null||f.perform({transactionId:``,cancel:!0,has_nfc:!1,errorCode:``},t._performType)}});return function(t){return e.apply(this,arguments)}}()}_handleUploadClick(){this._input.click()}_handleCloseClick(){var e;(e=this.props)==null||e.perform({transactionId:``,cancel:!0,has_nfc:!1,errorCode:``},this._performType)}_setDocReaderGalleryProps(){var e;if(!this.props)return;let{processParam:t,sessionId:n,serviceToken:r,selectionLimit:i}=this.props.moduleProps;this._input.multiple=typeof i==`number`&&(i===0||i>1);let a=Fz(t),o=a==null||(e=a.backendProcessing)==null?void 0:e.serviceURL;if(!o||!Iz(o)){let e=new Ez({errorCode:mz.CONFIGURATION_FAILED,message:`serviceURL is not defined or is invalid.`}),t=new Tz({errorCode:pz.SCAN_ERROR,underlyingBaseError:e});this.props.perform(t)}r&&a!=null&&a.backendProcessing&&(a.backendProcessing.httpHeaders={Authorization:`Connection ${r}`});let s={processParam:rz({},a)};n&&(s.tag=n),window.RegulaDocumentSDK.recognizerProcessParam=s,window.RegulaDocumentSDK.imageProcessParam={processParam:{scenario:_f.MrzAndLocate}}}updated(e){e.has(`props`)&&this._setDocReaderGalleryProps()}render(){var e,t;let n=(e=this.props)==null?void 0:e.moduleProps.locale;return fe`<div
280
+ </svg>`,eB=class extends Ne{constructor(...e){var t;super(...e),t=this,this._performType=sz.DATA,this.props=null,this._handleInputChange=function(){var e=d(function*(e){var n,r,i;let a=[...(n=e.target.files)==null?[]:n];if(!a.length)return;(r=t.props)!=null&&r.isProcessing&&t.props.isProcessing(!0),yield window.RegulaDocumentSDK.createBackendTransaction({},window.RegulaDocumentSDK.recognizerProcessParam);let o=[];for(let e of a){let{isExtraLargeResolution:n,isDownscaleNeeded:r}=yield Rz(e,yz,bz,xz),i=e.type.startsWith(`image/webp`);if(n){var s;(s=t.props)==null||s.perform({transactionId:``,cancel:!1,has_nfc:!1,errorCode:`IMAGE_RESOLUTION_EXCEEDS_LIMIT`},t._performType);return}if(r||i){let n=yield Bz(e,yz,bz);if(!n.ok){var c;let e={transactionId:``,cancel:!1,has_nfc:!1,errorCode:r?`IMAGE_DOWNSCALING_ERROR`:`IMAGE_PROCESSING_ERROR`};(c=t.props)==null||c.perform(e,t._performType);return}o.push(n.imageData)}else o.push(yield e.arrayBuffer())}try{yield window.RegulaDocumentSDK.processImage(o)}catch(e){var l;(l=t.props)==null||l.perform({transactionId:``,cancel:!1,has_nfc:!1,errorCode:`IMAGE_PROCESSING_ERROR`},t._performType);return}let u=(i=t.props)==null||(i=i.moduleProps)==null?void 0:i.finalizePackageSettings;try{var f;let e=yield Nz(d(function*(){return window.RegulaDocumentSDK.finalizePackage()}),u==null?void 0:u.retryCount,u==null?void 0:u.retryDelay),n={transactionId:e==null?void 0:e.transactionId,cancel:!1,has_nfc:!1,errorCode:``};(f=t.props)==null||f.perform(n,t._performType)}catch(e){var p;console.log(`finalizePackage error: `,e),(p=t.props)==null||p.perform({transactionId:``,cancel:!0,has_nfc:!1,errorCode:``},t._performType)}});return function(t){return e.apply(this,arguments)}}()}_handleUploadClick(){this._input.click()}_handleCloseClick(){var e;(e=this.props)==null||e.perform({transactionId:``,cancel:!0,has_nfc:!1,errorCode:``},this._performType)}_setDocReaderGalleryProps(){var e;if(!this.props)return;let{processParam:t,sessionId:n,serviceToken:r,selectionLimit:i}=this.props.moduleProps;this._input.multiple=typeof i==`number`&&(i===0||i>1);let a=Fz(t),o=a==null||(e=a.backendProcessing)==null?void 0:e.serviceURL;if(!o||!Iz(o)){let e=new Ez({errorCode:mz.CONFIGURATION_FAILED,message:`serviceURL is not defined or is invalid.`}),t=new Tz({errorCode:pz.SCAN_ERROR,underlyingBaseError:e});this.props.perform(t)}r&&a!=null&&a.backendProcessing&&(a.backendProcessing.httpHeaders={Authorization:`Connection ${r}`});let s={processParam:rz({},a)};n&&(s.tag=n),window.RegulaDocumentSDK.recognizerProcessParam=s,window.RegulaDocumentSDK.imageProcessParam={processParam:{scenario:_f.MrzAndLocate}}}updated(e){e.has(`props`)&&this._setDocReaderGalleryProps()}render(){var e,t;let n=(e=this.props)==null?void 0:e.moduleProps.locale;return fe`<div
281
281
  part="gallery-root"
282
282
  class="gallery-root"
283
283
  dir="${lz(n)}"
package/dist/main.js CHANGED
@@ -21237,7 +21237,10 @@ var Kz = class extends Me {
21237
21237
  }
21238
21238
  let t = (o = e.detail.data) == null ? void 0 : o.status, n = t === rp.OK, r = t === rp.TIMEOUT;
21239
21239
  if (!(n || r) || !((s = e.detail.data) != null && s.response)) return;
21240
- (c = this.props) != null && c.isProcessing && this.props.isProcessing(!0);
21240
+ if ((c = this.props) != null && c.isProcessing) {
21241
+ var d, f;
21242
+ (d = this.props) == null || (f = d.idvEventListener) == null || f.call(d, "IDV-DOCUMENT", "Success. Start to finalize package", "DEBUG"), this.props.isProcessing(!0);
21243
+ }
21241
21244
  let i = (l = this.props) == null || (l = l.moduleProps) == null ? void 0 : l.finalizePackageSettings;
21242
21245
  Mz(() => window.RegulaDocumentSDK.finalizePackage(), i == null ? void 0 : i.retryCount, i == null ? void 0 : i.retryDelay).then((e) => {
21243
21246
  var t;
@@ -21259,8 +21262,8 @@ var Kz = class extends Me {
21259
21262
  });
21260
21263
  }
21261
21264
  if (((i = e.detail) == null ? void 0 : i.action) === W.CLOSE || e.detail.action === W.CAMERA_PROCESS_CLOSED) {
21262
- var d;
21263
- (d = this.props) == null || d.perform({
21265
+ var p;
21266
+ (p = this.props) == null || p.perform({
21264
21267
  transactionId: "",
21265
21268
  cancel: !0,
21266
21269
  has_nfc: !1,
@@ -21620,11 +21623,12 @@ var Jz = (e) => e == null ? z : e, Yz = o`
21620
21623
  let a = [...(n = e.target.files) == null ? [] : n];
21621
21624
  if (!a.length) return;
21622
21625
  (r = t.props) != null && r.isProcessing && t.props.isProcessing(!0), yield window.RegulaDocumentSDK.createBackendTransaction({}, window.RegulaDocumentSDK.recognizerProcessParam);
21626
+ let o = [];
21623
21627
  for (let e of a) {
21624
21628
  let { isExtraLargeResolution: n, isDownscaleNeeded: r } = yield Lz(e, vz, yz, bz), i = e.type.startsWith("image/webp");
21625
21629
  if (n) {
21626
- var o;
21627
- (o = t.props) == null || o.perform({
21630
+ var s;
21631
+ (s = t.props) == null || s.perform({
21628
21632
  transactionId: "",
21629
21633
  cancel: !1,
21630
21634
  has_nfc: !1,
@@ -21632,49 +21636,49 @@ var Jz = (e) => e == null ? z : e, Yz = o`
21632
21636
  }, t._performType);
21633
21637
  return;
21634
21638
  }
21635
- let a;
21636
21639
  if (r || i) {
21637
21640
  let n = yield zz(e, vz, yz);
21638
21641
  if (!n.ok) {
21639
- var s;
21642
+ var c;
21640
21643
  let e = {
21641
21644
  transactionId: "",
21642
21645
  cancel: !1,
21643
21646
  has_nfc: !1,
21644
21647
  errorCode: r ? "IMAGE_DOWNSCALING_ERROR" : "IMAGE_PROCESSING_ERROR"
21645
21648
  };
21646
- (s = t.props) == null || s.perform(e, t._performType);
21649
+ (c = t.props) == null || c.perform(e, t._performType);
21647
21650
  return;
21648
21651
  }
21649
- a = [n.imageData];
21650
- } else a = [yield e.arrayBuffer()];
21651
- try {
21652
- yield window.RegulaDocumentSDK.processImage(a);
21653
- } catch (e) {
21654
- var c;
21655
- (c = t.props) == null || c.perform({
21656
- transactionId: "",
21657
- cancel: !1,
21658
- has_nfc: !1,
21659
- errorCode: "IMAGE_PROCESSING_ERROR"
21660
- }, t._performType);
21661
- }
21652
+ o.push(n.imageData);
21653
+ } else o.push(yield e.arrayBuffer());
21654
+ }
21655
+ try {
21656
+ yield window.RegulaDocumentSDK.processImage(o);
21657
+ } catch (e) {
21658
+ var l;
21659
+ (l = t.props) == null || l.perform({
21660
+ transactionId: "",
21661
+ cancel: !1,
21662
+ has_nfc: !1,
21663
+ errorCode: "IMAGE_PROCESSING_ERROR"
21664
+ }, t._performType);
21665
+ return;
21662
21666
  }
21663
- let l = (i = t.props) == null || (i = i.moduleProps) == null ? void 0 : i.finalizePackageSettings;
21667
+ let d = (i = t.props) == null || (i = i.moduleProps) == null ? void 0 : i.finalizePackageSettings;
21664
21668
  try {
21665
- var d;
21669
+ var f;
21666
21670
  let e = yield Mz(u(function* () {
21667
21671
  return window.RegulaDocumentSDK.finalizePackage();
21668
- }), l == null ? void 0 : l.retryCount, l == null ? void 0 : l.retryDelay), n = {
21672
+ }), d == null ? void 0 : d.retryCount, d == null ? void 0 : d.retryDelay), n = {
21669
21673
  transactionId: e == null ? void 0 : e.transactionId,
21670
21674
  cancel: !1,
21671
21675
  has_nfc: !1,
21672
21676
  errorCode: ""
21673
21677
  };
21674
- (d = t.props) == null || d.perform(n, t._performType);
21678
+ (f = t.props) == null || f.perform(n, t._performType);
21675
21679
  } catch (e) {
21676
- var f;
21677
- console.log("finalizePackage error: ", e), (f = t.props) == null || f.perform({
21680
+ var p;
21681
+ console.log("finalizePackage error: ", e), (p = t.props) == null || p.perform({
21678
21682
  transactionId: "",
21679
21683
  cancel: !0,
21680
21684
  has_nfc: !1,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@regulaforensics/idv-document",
3
- "version": "4.0.663-nightly",
3
+ "version": "4.0.665-nightly",
4
4
  "description": "Regula framework agnostic web components to work with document idv",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/main.iife.js",