@regulaforensics/idv-document 3.10.598-nightly → 3.10.599-rc
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 +46 -8
- package/dist/main.iife.js +7 -11
- package/dist/main.js +13 -19
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { BaseModule } from '../../../../interfaces-idv/src';
|
|
2
|
-
import { FailedAssets } from '../../interfaces-idv/src';
|
|
3
|
-
import { IdvAsset } from '../../interfaces-idv/src';
|
|
4
|
-
import { IdvModuleProps } from '../../../../interfaces-idv/src';
|
|
5
1
|
import { InternalScenarios } from '@regulaforensics/vp-frontend-document-components';
|
|
6
2
|
import { LitElement } from 'lit';
|
|
7
3
|
import { MirrorType } from '@regulaforensics/vp-frontend-document-components';
|
|
8
4
|
import { ModuleType as ModuleType_2 } from '@regulaforensics/vp-frontend-document-components';
|
|
9
5
|
import { TemplateResult } from 'lit-html';
|
|
10
6
|
|
|
7
|
+
declare abstract class BaseModule<TModuleProps = unknown, TModulesConfig = unknown> extends HTMLElement {
|
|
8
|
+
abstract props: IdvModuleProps<TModuleProps, TModulesConfig> | null;
|
|
9
|
+
abstract setProps(config: IdvModuleProps<TModuleProps, TModulesConfig>): void;
|
|
10
|
+
}
|
|
11
|
+
|
|
11
12
|
declare type DocumentGalleryProps = {
|
|
12
13
|
processParam?: {
|
|
13
14
|
multipageProcessing?: boolean;
|
|
@@ -43,7 +44,6 @@ export declare class DocumentIdv extends LitElement implements BaseModule<Docume
|
|
|
43
44
|
static deinitialize(): void;
|
|
44
45
|
static getIdentifier(): string;
|
|
45
46
|
static displayName: string;
|
|
46
|
-
static cancel(): void;
|
|
47
47
|
render(): TemplateResult<1>;
|
|
48
48
|
}
|
|
49
49
|
|
|
@@ -102,7 +102,6 @@ declare type DocumentReaderProps = {
|
|
|
102
102
|
};
|
|
103
103
|
localizationKeys?: Record<string, string>;
|
|
104
104
|
customization?: {
|
|
105
|
-
fontFamily?: string;
|
|
106
105
|
cameraFrameWidthOffset?: number;
|
|
107
106
|
backgroundMaskAlpha?: number;
|
|
108
107
|
backgroundMaskColor?: string;
|
|
@@ -157,16 +156,55 @@ declare type DocumentReaderProps = {
|
|
|
157
156
|
preloadAssetsRequired?: boolean;
|
|
158
157
|
failedAssets?: FailedAssets;
|
|
159
158
|
finalizePackageSettings?: {
|
|
160
|
-
/** Number of retries. Default - 0 */
|
|
161
159
|
retryCount: number;
|
|
162
|
-
/** Seconds between retries. Default - 0. Example: 0.5 - 500ms */
|
|
163
160
|
retryDelay: number;
|
|
164
161
|
};
|
|
165
162
|
};
|
|
166
163
|
|
|
164
|
+
declare type FailedAssets = {
|
|
165
|
+
imageURL: Set<string>;
|
|
166
|
+
base64: Set<string>;
|
|
167
|
+
blockingAssets: Set<string>;
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
declare type IdvAsset = {
|
|
171
|
+
idvAsset: ImageLike;
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
declare type IdvModuleProps<TModuleProps, TModulesConfig> = {
|
|
175
|
+
isProcessing?: (isProcessing: boolean) => void;
|
|
176
|
+
moduleProps: TModuleProps;
|
|
177
|
+
modulesConfig?: TModulesConfig;
|
|
178
|
+
perform: (data: any, type?: PerformType) => void;
|
|
179
|
+
idvEventListener: (module: string, data: any) => void;
|
|
180
|
+
nonce?: string;
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
declare type ImageBase = {
|
|
184
|
+
imageURL?: string;
|
|
185
|
+
imageId?: string;
|
|
186
|
+
base64?: string;
|
|
187
|
+
prepareRequired?: boolean;
|
|
188
|
+
failurePolicy?: ImageFailurePolicy;
|
|
189
|
+
timeout?: number;
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
declare type ImageFailurePolicy = 'ignore' | 'placeholderImage' | 'error';
|
|
193
|
+
|
|
194
|
+
declare type ImageLike = ImageBase & {
|
|
195
|
+
placeholderImage?: ImageLike;
|
|
196
|
+
};
|
|
197
|
+
|
|
167
198
|
export declare enum ModuleType {
|
|
168
199
|
BarcodeMRZ = "BarcodeMRZ",
|
|
169
200
|
BoundsLite = "BoundsLite"
|
|
170
201
|
}
|
|
171
202
|
|
|
203
|
+
declare type PerformType = (typeof PerformTypes)[keyof typeof PerformTypes] | undefined;
|
|
204
|
+
|
|
205
|
+
declare const PerformTypes: {
|
|
206
|
+
readonly FORM: "form";
|
|
207
|
+
readonly DATA: "data";
|
|
208
|
+
};
|
|
209
|
+
|
|
172
210
|
export { }
|
package/dist/main.iife.js
CHANGED
|
@@ -32,7 +32,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
32
32
|
<slot />
|
|
33
33
|
`}},PL=function(e,t){return PL=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},PL(e,t)};function FL(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);PL(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function IL(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function LL(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o=Object.create((typeof Iterator==`function`?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(s){if(r)throw TypeError(`Generator is already executing.`);for(;o&&(o=0,s[0]&&(n=0)),n;)try{if(r=1,i&&(a=s[0]&2?i.return:s[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;switch(i=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,i=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1],a=s;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(s);break}a[2]&&n.ops.pop(),n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e],i=0}finally{r=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function RL(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function zL(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function BL(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}function VL(e){return this instanceof VL?(this.v=e,this):new VL(e)}function HL(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),s(`next`),s(`throw`),s(`return`,o),i[Symbol.asyncIterator]=function(){return this},i;function o(e){return function(t){return Promise.resolve(t).then(e,d)}}function s(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof VL?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}}function UL(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof RL==`function`?RL(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}}function WL(e){return typeof e==`function`}function GL(e){var t=e(function(e){Error.call(e),e.stack=Error().stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var KL=GL(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
|
|
34
34
|
`+t.map(function(e,t){return t+1+`) `+e.toString()}).join(`
|
|
35
|
-
`):``,this.name=`UnsubscriptionError`,this.errors=t}});function qL(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var JL=(function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,t,n,r,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var o=RL(a),s=o.next();!s.done;s=o.next())s.value.remove(this)}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}else a.remove(this);var c=this.initialTeardown;if(WL(c))try{c()}catch(e){i=e instanceof KL?e.errors:[e]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var u=RL(l),d=u.next();!d.done;d=u.next()){var f=d.value;try{ZL(f)}catch(e){i=i==null?[]:i,e instanceof KL?i=BL(BL([],zL(i)),zL(e.errors)):i.push(e)}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}if(i)throw new KL(i)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)ZL(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(n=this._finalizers)==null?[]:n).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&qL(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&qL(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})(),YL=JL.EMPTY;function XL(e){return e instanceof JL||e&&`closed`in e&&WL(e.remove)&&WL(e.add)&&WL(e.unsubscribe)}function ZL(e){WL(e)?e():e.unsubscribe()}var QL={Promise:void 0},$L={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,BL([e,t],zL(n)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function eR(e){$L.setTimeout(function(){throw e})}function tR(){}function nR(e){e()}var rR=(function(e){FL(t,e);function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,XL(t)&&t.add(n)):n.destination=cR,n}return t.create=function(e,t,n){return new aR(e,t,n)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(JL),iR=(function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){oR(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){oR(e)}else oR(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){oR(e)}},e})(),aR=(function(e){FL(t,e);function t(t,n,r){var i=e.call(this)||this,a;return a=WL(t)||!t?{next:t==null?void 0:t,error:n==null?void 0:n,complete:r==null?void 0:r}:t,i.destination=new iR(a),i}return t})(rR);function oR(e){eR(e)}function sR(e){throw e}var cR={closed:!0,next:tR,error:sR,complete:tR},lR=(function(){return typeof Symbol==`function`&&Symbol.observable||`@@observable`})();function uR(e){return e}function dR(e){return e.length===0?uR:e.length===1?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}}var fR=(function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this,i=hR(e)?e:new aR(e,t,n);return nR(function(){var e=r,t=e.operator,n=e.source;i.add(t?t.call(i,n):n?r._subscribe(i):r._trySubscribe(i))}),i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return t=pR(t),new t(function(t,r){var i=new aR({next:function(t){try{e(t)}catch(e){r(e),i.unsubscribe()}},error:r,complete:t});n.subscribe(i)})},e.prototype._subscribe=function(e){var t;return(t=this.source)==null?void 0:t.subscribe(e)},e.prototype[lR]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return dR(e)(this)},e.prototype.toPromise=function(e){var t=this;return e=pR(e),new e(function(e,n){var r;t.subscribe(function(e){return r=e},function(e){return n(e)},function(){return e(r)})})},e.create=function(t){return new e(t)},e})();function pR(e){var t;return(t=e==null?QL.Promise:e)==null?Promise:t}function mR(e){return e&&WL(e.next)&&WL(e.error)&&WL(e.complete)}function hR(e){return e&&e instanceof rR||mR(e)&&XL(e)}function gR(e){return WL(e==null?void 0:e.lift)}function _R(e){return function(t){if(gR(t))return t.lift(function(t){try{return e(t,this)}catch(e){this.error(e)}});throw TypeError(`Unable to lift unknown Observable type`)}}function vR(e,t,n,r,i){return new yR(e,t,n,r,i)}var yR=(function(e){FL(t,e);function t(t,n,r,i,a,o){var s=e.call(this,t)||this;return s.onFinalize=a,s.shouldUnsubscribe=o,s._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,s._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,s._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,s}return t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)==null||t.call(this))}},t})(rR),bR=GL(function(e){return function(){e(this),this.name=`ObjectUnsubscribedError`,this.message=`object unsubscribed`}}),xR=(function(e){FL(t,e);function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return t.prototype.lift=function(e){var t=new SR(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new bR},t.prototype.next=function(e){var t=this;nR(function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var i=RL(t.currentObservers),a=i.next();!a.done;a=i.next())a.value.next(e)}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}})},t.prototype.error=function(e){var t=this;nR(function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}})},t.prototype.complete=function(){var e=this;nR(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return((e=this.observers)==null?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,i=n.isStopped,a=n.observers;return r||i?YL:(this.currentObservers=null,a.push(e),new JL(function(){t.currentObservers=null,qL(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},t.prototype.asObservable=function(){var e=new fR;return e.source=this,e},t.create=function(e,t){return new SR(e,t)},t})(fR),SR=(function(e){FL(t,e);function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return t.prototype.next=function(e){var t,n;(n=(t=this.destination)==null?void 0:t.next)==null||n.call(t,e)},t.prototype.error=function(e){var t,n;(n=(t=this.destination)==null?void 0:t.error)==null||n.call(t,e)},t.prototype.complete=function(){var e,t;(t=(e=this.destination)==null?void 0:e.complete)==null||t.call(e)},t.prototype._subscribe=function(e){var t,n;return(n=(t=this.source)==null?void 0:t.subscribe(e))==null?YL:n},t})(xR),CR=(function(e){return e&&typeof e.length==`number`&&typeof e!=`function`});function wR(e){return WL(e==null?void 0:e.then)}function TR(e){return WL(e[lR])}function ER(e){return Symbol.asyncIterator&&WL(e==null?void 0:e[Symbol.asyncIterator])}function DR(e){return TypeError(`You provided `+(typeof e==`object`&&e?`an invalid object`:`'`+e+`'`)+` where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}function OR(){return typeof Symbol!=`function`||!Symbol.iterator?`@@iterator`:Symbol.iterator}var kR=OR();function AR(e){return WL(e==null?void 0:e[kR])}function jR(e){return HL(this,arguments,function(){var t,n,r,i;return LL(this,function(a){switch(a.label){case 0:t=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,VL(t.read())];case 3:return n=a.sent(),r=n.value,i=n.done,i?[4,VL(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,VL(r)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function MR(e){return WL(e==null?void 0:e.getReader)}function NR(e){if(e instanceof fR)return e;if(e!=null){if(TR(e))return PR(e);if(CR(e))return FR(e);if(wR(e))return IR(e);if(ER(e))return RR(e);if(AR(e))return LR(e);if(MR(e))return zR(e)}throw DR(e)}function PR(e){return new fR(function(t){var n=e[lR]();if(WL(n.subscribe))return n.subscribe(t);throw TypeError(`Provided object does not correctly implement Symbol.observable`)})}function FR(e){return new fR(function(t){for(var n=0;n<e.length&&!t.closed;n++)t.next(e[n]);t.complete()})}function IR(e){return new fR(function(t){e.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,eR)})}function LR(e){return new fR(function(t){var n,r;try{for(var i=RL(e),a=i.next();!a.done;a=i.next()){var o=a.value;if(t.next(o),t.closed)return}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}t.complete()})}function RR(e){return new fR(function(t){BR(e,t).catch(function(e){return t.error(e)})})}function zR(e){return RR(jR(e))}function BR(e,t){var n,r,i,a;return IL(this,void 0,void 0,function(){var o,s;return LL(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=UL(e),c.label=1;case 1:return[4,n.next()];case 2:if(r=c.sent(),r.done)return[3,4];if(o=r.value,t.next(o),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=c.sent(),i={error:s},[3,11];case 6:return c.trys.push([6,,9,10]),r&&!r.done&&(a=n.return)?[4,a.call(n)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function VR(e,t,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var a=t.schedule(function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(a),!i)return a}function HR(e,t){return t===void 0&&(t=0),_R(function(n,r){n.subscribe(vR(r,function(n){return VR(r,e,function(){return r.next(n)},t)},function(){return VR(r,e,function(){return r.complete()},t)},function(n){return VR(r,e,function(){return r.error(n)},t)}))})}function UR(e,t){return t===void 0&&(t=0),_R(function(n,r){r.add(e.schedule(function(){return n.subscribe(r)},t))})}function WR(e,t){return NR(e).pipe(UR(t),HR(t))}function GR(e,t){return NR(e).pipe(UR(t),HR(t))}function KR(e,t){return new fR(function(n){var r=0;return t.schedule(function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())})})}function qR(e,t){return new fR(function(n){var r;return VR(n,t,function(){r=e[kR](),VR(n,t,function(){var e,t,i;try{e=r.next(),t=e.value,i=e.done}catch(e){n.error(e);return}i?n.complete():n.next(t)},0,!0)}),function(){return WL(r==null?void 0:r.return)&&r.return()}})}function JR(e,t){if(!e)throw Error(`Iterable cannot be null`);return new fR(function(n){VR(n,t,function(){var r=e[Symbol.asyncIterator]();VR(n,t,function(){r.next().then(function(e){e.done?n.complete():n.next(e.value)})},0,!0)})})}function YR(e,t){return JR(jR(e),t)}function XR(e,t){if(e!=null){if(TR(e))return WR(e,t);if(CR(e))return KR(e,t);if(wR(e))return GR(e,t);if(ER(e))return JR(e,t);if(AR(e))return qR(e,t);if(MR(e))return YR(e,t)}throw DR(e)}function ZR(e,t){return t?XR(e,t):NR(e)}function QR(e,t){return _R(function(n,r){var i=0;n.subscribe(vR(r,function(n){r.next(e.call(t,n,i++))}))})}function $R(e,t,n,r,i,a,o,s){var c=[],l=0,u=0,d=!1,f=function(){d&&!c.length&&!l&&t.complete()},p=function(e){return l<r?m(e):c.push(e)},m=function(e){l++;var i=!1;NR(n(e,u++)).subscribe(vR(t,function(e){t.next(e)},function(){i=!0},void 0,function(){if(i)try{l--;for(var e=function(){var e=c.shift();o||m(e)};c.length&&l<r;)e();f()}catch(e){t.error(e)}}))};return e.subscribe(vR(t,p,function(){d=!0,f()})),function(){}}function ez(e,t,n){return n===void 0&&(n=1/0),WL(t)?ez(function(n,r){return QR(function(e,i){return t(n,e,r,i)})(NR(e(n,r)))},n):(typeof t==`number`&&(n=t),_R(function(t,r){return $R(t,r,e,n)}))}function tz(e){return _R(function(t,n){var r=null,i=!1,a;r=t.subscribe(vR(n,void 0,void 0,function(o){a=NR(e(o,tz(e)(t))),r?(r.unsubscribe(),r=null,a.subscribe(n)):i=!0})),i&&(r.unsubscribe(),r=null,a.subscribe(n))})}function nz(e,t){return WL(t)?ez(e,t,1):ez(e,1)}function rz(e,t,n){return(t=iz(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iz(e){var t=az(e,`string`);return typeof t==`symbol`?t:t+``}function az(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var oz=class{constructor(){rz(this,`taskSubject`,new xR),this.taskSubject.pipe(nz(e=>ZR(e()).pipe(tz(e=>ZR(Promise.reject(e)))))).subscribe()}addTask(e){return new Promise((t,n)=>{this.taskSubject.next(()=>V(this,null,function*(){try{t(yield e())}catch(e){n(e)}}))})}},sz=`text/plain`,cz=`us-ascii`,lz=`%(?:3A|2F|3F|23|5B|5D|40|21|24|26|27|28|29|2A|2B|2C|3B|3D)`,uz=`__normalize_url_encoded_reserved__`,dz=/__normalize_url_encoded_reserved__(\d+)__/g,fz=new RegExp(lz,`i`),pz=new RegExp(lz,`gi`),mz=(e,t)=>Array.isArray(t)&&t.some(t=>t instanceof RegExp?t.flags.includes(`g`)||t.flags.includes(`y`)?new RegExp(t.source,t.flags.replaceAll(/[gy]/g,``)).test(e):t.test(e):t===e),hz=new Set([`https:`,`http:`,`file:`]),gz=e=>{if(typeof e!=`string`)return;let t=e.trim().toLowerCase().replace(/:$/,``);return t===``?void 0:`${t}:`},_z=e=>{try{let{protocol:t}=new URL(e),n=e.slice(0,t.length+2).toLowerCase()===`${t}//`;if(t.endsWith(`:`)&&(!t.includes(`.`)||n)&&!hz.has(t))return t}catch(e){}},vz=e=>{try{return decodeURIComponent(e.replaceAll(`+`,`%20`))}catch(t){return new URLSearchParams(`${e}=`).keys().next().value}},yz=e=>{let t=new Set;if(!e)return t;for(let n of e.slice(1).split(`&`))n&&!n.includes(`=`)&&t.add(vz(n));return t},bz=e=>{let t=e;try{t=decodeURIComponent(e)}catch(n){t=new URLSearchParams(e).toString()}let n=e=>{let t=new Set;for(let n of e.matchAll(dz))t.add(Number.parseInt(n[1],10));return t},r=n(e);for(let e of n(t))r.add(e);let i=0;for(;r.has(i);)i++;return`${uz}${i}__`},xz=(e,t)=>{if(!t)return e.sort(),e.toString();let n=e=>e.replace(t,(e,t)=>String.fromCodePoint(Number.parseInt(t,16))),r=[...e.entries()];return r.sort(([e],[t])=>{let r=n(e),i=n(t);return r<i?-1:+(r>i)}),new URLSearchParams(r).toString()},Sz=(e,t)=>t?e.replace(t,(e,t)=>String.fromCodePoint(Number.parseInt(t,16))):e,Cz=(e,t,n)=>{let r=t===`always`,i=t===`never`,a=r||i?void 0:yz(n),o=e=>e.replaceAll(`+`,`%20`),s=e=>r?`${e}=`:i||a.has(vz(e))?e:`${e}=`,c=e=>{let t=e.indexOf(`=`);if(t===-1)return s(o(e));let n=e.slice(0,t),r=e.slice(t+1);return r===``?n===``?`=`:s(o(n)):`${o(n)}=${r}`},l=e.slice(1).split(`&`).filter(Boolean);return l.length===0?``:`?${l.map(e=>c(e)).join(`&`)}`},wz=(e,{stripHash:t})=>{let n=RegExp(`^data:(?<type>[^,]*?),(?<data>[^#]*?)(?:#(?<hash>.*))?$`).exec(e);if(!n)throw Error(`Invalid URL: ${e}`);let{type:r,data:i,hash:a}=n.groups,o=r.split(`;`),s=o.at(-1)===`base64`;s&&o.pop();let c=o.shift().toLowerCase(),l=[...o.map(e=>{let[t,n=``]=e.split(`=`).map(e=>e.trim());return t===`charset`&&(n=n.toLowerCase(),n===cz)?``:`${t}${n?`=${n}`:``}`}).filter(Boolean)];s&&l.push(`base64`),(l.length>0||c&&c!==sz)&&l.unshift(c);let u=t||!a?``:`#${a}`;return`data:${l.join(`;`)},${s?i.trim():i}${u}`};function Tz(e,t){if(t=B({defaultProtocol:`http`,normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripTextFragment:!0,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeSingleSlash:!0,removeDirectoryIndex:!1,removeExplicitPort:!1,sortQueryParameters:!0,removePath:!1,transformPath:!1,emptyQueryValue:`preserve`},t),typeof t.defaultProtocol==`string`&&!t.defaultProtocol.endsWith(`:`)&&(t.defaultProtocol=`${t.defaultProtocol}:`),e=e.trim(),/^data:/i.test(e))return wz(e,t);let n=Array.isArray(t.customProtocols)?t.customProtocols:[],r=new Set(n.map(e=>gz(e)).filter(Boolean)),i=_z(e);if(i&&!r.has(i))return e;let a=e.startsWith(`//`);!(!a&&/^\.*\//.test(e))&&!i&&(e=e.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,t.defaultProtocol));let o=new URL(e);if(t.forceHttp&&t.forceHttps)throw Error("The `forceHttp` and `forceHttps` options cannot be used together");if(t.forceHttp&&o.protocol===`https:`&&(o.protocol=`http:`),t.forceHttps&&o.protocol===`http:`&&(o.protocol=`https:`),t.stripAuthentication&&(o.username=``,o.password=``),t.stripHash?o.hash=``:t.stripTextFragment&&(o.hash=o.hash.replace(/#?:~:text.*?$/i,``)),o.pathname){let e=/\b[a-z][a-z\d+\-.]{1,50}:\/\//g,t=0,n=``;for(;;){let r=e.exec(o.pathname);if(!r)break;let i=r[0],a=r.index,s=o.pathname.slice(t,a);n+=s.replaceAll(/\/{2,}/g,`/`),n+=i,t=a+i.length}let r=o.pathname.slice(t);n+=r.replaceAll(/\/{2,}/g,`/`),o.pathname=n}if(o.pathname)try{o.pathname=decodeURI(o.pathname).replaceAll(`\\`,`%5C`)}catch(e){}if(t.removeDirectoryIndex===!0&&(t.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(t.removeDirectoryIndex)&&t.removeDirectoryIndex.length>0){let e=o.pathname.split(`/`).filter(Boolean),n=e.at(-1);n&&mz(n,t.removeDirectoryIndex)&&(e.pop(),o.pathname=e.length>0?`/${e.join(`/`)}/`:`/`)}if(t.removePath&&(o.pathname=`/`),t.transformPath&&typeof t.transformPath==`function`){let e=o.pathname.split(`/`).filter(Boolean),n=t.transformPath(e);o.pathname=(n==null?void 0:n.length)>0?`/${n.join(`/`)}`:`/`}o.hostname&&(o.hostname=o.hostname.replace(/\.$/,``),t.stripWWW&&/^www\.(?!www\.)[a-z\-\d]{1,63}\.[a-z.\-\d]{2,63}$/.test(o.hostname)&&(o.hostname=o.hostname.replace(/^www\./,``)));let s=o.search,c;if(t.sortQueryParameters&&fz.test(s)){let e=bz(s);o.search=s.replaceAll(pz,t=>`${e}${t.slice(1).toUpperCase()}`),c=RegExp(`${e}([0-9A-F]{2})`,`g`)}let l=Array.isArray(t.keepQueryParameters),{searchParams:u}=o;if(!l&&Array.isArray(t.removeQueryParameters)&&t.removeQueryParameters.length>0)for(let e of[...u.keys()])mz(Sz(e,c),t.removeQueryParameters)&&u.delete(e);if(!l&&t.removeQueryParameters===!0&&(o.search=``),l&&t.keepQueryParameters.length>0)for(let e of[...u.keys()])mz(Sz(e,c),t.keepQueryParameters)||u.delete(e);else l&&(o.search=``);t.sortQueryParameters&&(o.search=xz(o.searchParams,c),o.search=decodeURIComponent(o.search.replaceAll(/%(?:26|23|3f|25|2b)/gi,e=>`%25${e.slice(1)}`)),c&&(o.search=o.search.replace(c,`%$1`))),o.search=Cz(o.search,t.emptyQueryValue,s),t.removeTrailingSlash&&(o.pathname=o.pathname.replace(/\/$/,``)),t.removeExplicitPort&&o.port&&(o.port=``);let d=e;return e=o.toString(),!t.removeSingleSlash&&o.pathname===`/`&&!d.endsWith(`/`)&&o.hash===``&&(e=e.replace(/\/$/,``)),(t.removeTrailingSlash||o.pathname===`/`)&&o.hash===``&&t.removeSingleSlash&&(e=e.replace(/\/$/,``)),a&&!t.normalizeProtocol&&(e=e.replace(/^http:\/\//,`//`)),t.stripProtocol&&(e=e.replace(/^(?:https?:)?\/\//,``)),e}function Ez(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Dz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Ez(Object(n),!0).forEach(function(t){Oz(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ez(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Oz(e,t,n){return(t=kz(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kz(e){var t=Az(e,`string`);return typeof t==`symbol`?t:t+``}function Az(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var jz=S_.create(`wasm`),Mz=S_.create(`main`),Nz=class{constructor(){Oz(this,`_worker`,null),Oz(this,`_initializeListener`,null),Oz(this,`_processingListener`,null),Oz(this,`_queueService`,new oz),Oz(this,`_initProcess`,null),Oz(this,`version`,{component:`9.5.2892`}),Oz(this,`onFinalize`,null),Oz(this,`isPrepared`,!1),Oz(this,`isInitialized`,!1),Oz(this,`isProcessing`,!1),Oz(this,`initData`,null),Oz(this,`recognizerProcessParam`,{processParam:{}}),Oz(this,`imageProcessParam`,{processParam:{}}),Oz(this,`recognizeListener`,null),Oz(this,`workerPath`,`https://wasm.regulaforensics.com/document/release/9.5/barcodemrz/1f57dab0-9204d6578`)}get processingListener(){return this._processingListener}set processingListener(e){this._processingListener=e,e&&e({isProcessing:this.isProcessing})}get initializeListener(){return this._initializeListener}set initializeListener(e){this._initializeListener=e,e&&e({isInitialized:this.isInitialized})}createProcessImageRequest(e,t){let n=e.map((e,t)=>({data:e,light:6,pageIdx:t}));return Dz(Dz({},t),{},{imagesList:n})}prepareImageData(e){return e.map(e=>e instanceof ImageData?{width:e.width,height:e.height,data:e.data.buffer}:{data:e})}sendMessage(e){return this._queueService.addTask(()=>new Promise((t,n)=>{if(!this._worker)return Mz(`Worker is missing)`),n(`Worker is missing`);this._worker.onmessage=e=>{if(e.data.target===up.custom){let{method:r,response:i,code:a}=e.data.data,o=i&&`reject_message`in i?i.reject_message:``;if(a===xf.ok||a===xf.badLicense&&!o)Mz(`Method ${r}: { code: ${a} } `),t(i);else{let e=`Method ${r}: ${$f[a]||a}${o?` Reject message: ${o}`:``}`;Mz(e),n(e)}}e.data.target===up.stdout&&jz(JSON.stringify(e.data.content)),e.data.target===up.stderr&&(jz(JSON.stringify(e.data.content)),n(e.data.content))},this._worker.onerror=e=>{jz(JSON.stringify(e.message)),n(e)},Mz(`Send message to worker: { target: ${e.target}, method: ${e.method} }`),this._worker.postMessage(Dz(Dz({},e),{},{preMain:!0}),`data`in e&&e.data?e.data.map(e=>e.data):[])}))}prepare(e){return V(this,null,function*(){var t;Mz(`Preparing the service`);{let t=this.workerPath===`https://wasm.regulaforensics.com/document/release/9.5/barcodemrz/1f57dab0-9204d6578`,n=Tz(e&&t?aD(e,`PROD`):this.workerPath),r=yield(yield fetch(`${n}/${qf}`)).text();t||(r=iD(r,n));let i=new Blob([r],{type:`text/plain`}),a=URL.createObjectURL(i);this._worker=new Worker(a),URL.revokeObjectURL(a)}(t=this._worker)==null||t.postMessage({method:vf.prepare,target:up.gl,preMain:!0,op:`setPrefetched`}),yield this.sendMessage({method:vf.prepare,target:up.init,URL:document.URL}),this.isPrepared=!0,Mz(`Service prepared`)})}initialize(e){return V(this,null,function*(){return this._initProcess||(this._initProcess=this.doInitialize(e),this._initProcess.catch(()=>{this._initProcess=null})),this._initProcess})}doInitialize(e){return V(this,null,function*(){var t,n;this.isPrepared||(yield this.prepare(e==null?void 0:e.module)),Mz(`Initializing the service`);let{scenario:r,license:i}=yield this.sendMessage({target:up.custom,method:vf.initialize,request:{systemInfo:{userID:m_(Cp),hostName:(t=document.location)==null?void 0:t.origin,license:e==null?void 0:e.license},telemetry:yield v_({sdkVersion:`9.5.2892`}),processParam:this.recognizerProcessParam.processParam||this.imageProcessParam.processParam}});return this.initData={scenario:r,license:i},this.isInitialized=!0,(n=this._initializeListener)==null||n.call(this,{isInitialized:this.isInitialized}),Mz(`Service initialized: ${JSON.stringify({scenario:r,license:i})}`),this.initData})}doProcess(e,t,n){return V(this,null,function*(){var r,i;Mz(`Process method ${e} started`),this.isProcessing=!0,(r=this._processingListener)==null||r.call(this,{isProcessing:this.isProcessing});let a=yield this.sendMessage({target:up.custom,method:e,request:t,data:n});return this.isProcessing=!1,(i=this._processingListener)==null||i.call(this,{isProcessing:this.isProcessing}),Mz(`Process method ${e} finished`),new qE(a)})}processImageBase64(e,t){return V(this,null,function*(){return this.doProcess(vf.processImage,this.createProcessImageRequest(e,t))})}process(e,t){return V(this,null,function*(){var n;let r=this.prepareImageData(e),i=yield this.doProcess(vf.process,t||this.recognizerProcessParam,r);return(n=this.recognizeListener)==null||n.call(this,i),i})}processImage(e,t){return V(this,null,function*(){let n=this.prepareImageData(e);return this.doProcess(vf.processImage,t||this.imageProcessParam,n)})}startNewPage(){return V(this,null,function*(){Mz(`Starting new page`),yield this.sendMessage({target:up.custom,method:vf.startNewPage})})}startNewDocument(e,t){return V(this,null,function*(){return Mz(`Starting new document`),yield this.sendMessage({target:up.custom,method:vf.startNewDocument,request:Dz(Dz({},t||this.recognizerProcessParam),{},{metadata:e})})})}createBackendTransaction(e,t){return V(this,null,function*(){return Mz(`Create backend transaction`),yield this.sendMessage({target:up.custom,method:vf.createBackendTransaction,request:Dz(Dz({},t||this.recognizerProcessParam),{},{metadata:e})})})}finalizePackage(){return V(this,null,function*(){try{var e;Mz(`Finalize package`);let t=yield this.sendMessage({target:up.custom,method:vf.finalizePackage});return(e=this.onFinalize)==null||e.call(this,t),t}catch(e){var t;return(t=this.onFinalize)==null||t.call(this,{tag:``,transactionId:``}),Promise.reject(e)}})}addDataToPackage(e,t){return V(this,null,function*(){Mz(`Add data to package`),yield this.sendMessage({target:up.custom,method:vf.addDataToPackage,request:t,data:[{data:e.buffer}]}),Mz(`Data added to package`)})}shutdown(){Mz(`Shutdown service`),this._worker&&(this._worker.terminate(),Mz(`Worker terminated`)),this.isPrepared=!1,this.isInitialized=!1,this.isProcessing=!1,this._initProcess=null}};function Pz(){return V(this,null,function*(){let e=window.customElements.get(`document-reader`),t=window.customElements.get(`camera-snapshot`),n=window.customElements.get(`fullscreen-container`);e||window.customElements.define(`document-reader`,fL),t||window.customElements.define(`camera-snapshot`,kL),n||window.customElements.define(`fullscreen-container`,NL);let r=window.customElements.whenDefined(`document-reader`),i=window.customElements.whenDefined(`camera-snapshot`),a=window.customElements.whenDefined(`fullscreen-container`);yield Promise.all([r,i,a])})}var Fz={attribute:!0,type:String,converter:T,reflect:!1,hasChanged:E},Iz=(e=Fz,t,n)=>{let{kind:r,metadata:i}=n,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),r===`setter`&&((e=Object.create(e)).wrapped=!0),a.set(n.name,e),r===`accessor`){let{name:r}=n;return{set(n){let i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e,!0,n)},init(t){return t!==void 0&&this.C(r,void 0,e,t),t}}}if(r===`setter`){let{name:r}=n;return function(n){let i=this[r];t.call(this,n),this.requestUpdate(r,i,e,!0,n)}}throw Error(`Unsupported decorator location: `+r)};function Lz(e){return(t,n)=>typeof n==`object`?Iz(e,t,n):((e,t,n)=>{let r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}var Rz=(e,t,n)=>{for(let n of t)if(n[0]===e)return(0,n[1])();return n==null?void 0:n()};function zz(e){"@babel/helpers - typeof";return zz=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},zz(e)}function Bz(e,t){if(zz(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(zz(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Vz(e){var t=Bz(e,`string`);return zz(t)==`symbol`?t:t+``}function Hz(e,t,n){return(t=Vz(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Uz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Wz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Uz(Object(n),!0).forEach(function(t){Hz(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Uz(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Gz=class e{constructor({errorCode:e,errorCodeKey:t,message:n,underlyingError:r,underlyingBaseError:i,domain:a,module:o,errorEnumName:s,shortDomainCode:c}){this.errorCode=e,this.errorCodeKey=t,this.message=n,this.underlyingError=r,this.underlyingBaseError=i,this.module=o,this.domain=a,this.errorEnumName=s,this.shortDomainCode=c}static getErrorKey(e,t){let n=Object.keys(t).find(n=>t[n]===e);if(!n)throw Error(`Invalid errorCode: ${e} in enum`);return n}get lastUnderlyingError(){let t=this.underlyingBaseError;for(;(t==null?void 0:t.underlyingBaseError)instanceof e;)t=t.underlyingBaseError;return t==null?void 0:t.underlyingError}toObject(){let t={errorCode:this.errorCode,errorCodeKey:this.errorCodeKey,errorEnumName:this.errorEnumName,message:this.message,module:this.module,underlyingError:this.underlyingError,lastUnderlineError:this.lastUnderlyingError};return this.underlyingBaseError&&this.underlyingBaseError instanceof e&&(t.underlyingBaseError=this.underlyingBaseError.toObject()),t}get shortChain(){let t=`${this.shortDomainCode}:${this.errorCode}${this.underlyingError?`-`+this.underlyingError:``}`;return this.underlyingBaseError instanceof e&&(t+=`-${this.underlyingBaseError.shortChain}`),t}get fullChain(){let t=`${this.module}.${this.domain}:${this.errorCodeKey}${this.underlyingError?`-`+this.underlyingError:``}`;return this.underlyingBaseError instanceof e&&(t+=`-${this.underlyingBaseError.fullChain}`),t}};function Kz(e,t){if(t.displayName?console.log(`Register module: ${t.displayName}`):console.error(`Missed "displayName" when register module`),t.getSupportedTemplates&&typeof t.getSupportedTemplates==`function`){let e=t.getSupportedTemplates();console.log(`${t==null?void 0:t.displayName} supported templates: ${e.join(`, `)}`)}else console.error(`Missed "getSupportedTemplates" method when register module`);if(t.initialize&&typeof t.initialize==`function`||console.error(`${t==null?void 0:t.displayName} "initialize" method was not implemented`),t.deinitialize&&typeof t.deinitialize==`function`||console.error(`${t==null?void 0:t.displayName} "deinitialize" method was not implemented`),t.cancel&&typeof t.cancel==`function`||console.error(`${t==null?void 0:t.displayName} "cancel" method was not implemented`),t.isReady&&typeof t.isReady==`function`||console.error(`${t==null?void 0:t.displayName} "isReady" method was not implemented`),t.getIdentifier&&typeof t.getIdentifier==`function`){let e=t.getIdentifier();console.log(`Module id: ${e}`)}else console.error(`Missed "getIdentifier" when register module`);customElements.get(t.getIdentifier())?console.log(`Module ${e} has already registered`):customElements.define(e,t),console.log(`-------`)}function qz(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0))}var Jz={FORM:`form`,DATA:`data`},Yz=[`ar`,`he`],Xz=e=>{var t;let n=e?(t=e.substring(0,2))==null?void 0:t.toLowerCase():``;return Yz.includes(n)?`rtl`:`ltr`},Zz=(e,t)=>e.base64&&!(t!=null&&t.base64.has(e.base64))?e.base64:e.imageURL&&!(t!=null&&t.imageURL.has(e.imageURL))?e.imageURL:``,Qz=(e,t,n)=>{var r;if(!t)return;let i=(r=e==null?void 0:e.idvAsset)==null?null:r;for(;i;){let e=Zz(i,n);if(e)return e;i=i.failurePolicy===`placeholderImage`&&i.placeholderImage||null}},$z={DOC_READER:`DOC_READER`,DOC_READER_GALLERY:`DOC_READER_GALLERY`},eB=function(e){return e[e.NO_INITIALIZED=0]=`NO_INITIALIZED`,e[e.UNKNOWN_STEP=1]=`UNKNOWN_STEP`,e[e.SCAN_ERROR=2]=`SCAN_ERROR`,e[e.RFID_ERROR=3]=`RFID_ERROR`,e[e.IMAGE_LOADING_FAILED=4]=`IMAGE_LOADING_FAILED`,e}({}),tB=function(e){return e[e.CONFIGURATION_FAILED=0]=`CONFIGURATION_FAILED`,e[e.INTERNAL_ERROR=1]=`INTERNAL_ERROR`,e[e.PRESENTER_UNAVAILABLE=2]=`PRESENTER_UNAVAILABLE`,e}({}),nB=`idv-document`,rB={0:pf.auto,1:pf.captureVideo,2:pf.captureFrame},iB={0:yf.line,1:yf.corners},aB={0:!0,1:!0,2:!1,3:!0},oB=1920,sB=4e6,cB=5e7,lB=function(e){return e.BarcodeMRZ=`BarcodeMRZ`,e.BoundsLite=`BoundsLite`,e}({}),uB,dB,fB=class e extends Gz{constructor({errorCode:t,message:n,underlyingError:r,underlyingBaseError:i}){let a=Gz.getErrorKey(t,eB);super({errorCode:t,errorCodeKey:a,errorEnumName:e.ERROR_ENUM_NAME,module:e.MODULE,message:n,underlyingError:r,underlyingBaseError:i,domain:e.ERROR_ENUM_NAME,shortDomainCode:e.SHORT_CODE})}};uB=fB,uB.MODULE=nB,uB.ERROR_ENUM_NAME=`ReaderModuleError`,uB.SHORT_CODE=`RM`;var pB=class e extends Gz{constructor({errorCode:t,message:n,underlyingError:r,underlyingBaseError:i}){let a=Gz.getErrorKey(t,tB);super({errorCode:t,errorCodeKey:a,errorEnumName:e.ERROR_ENUM_NAME,module:e.MODULE,message:n,underlyingError:r,underlyingBaseError:i,domain:e.ERROR_ENUM_NAME,shortDomainCode:e.SHORT_CODE})}};dB=pB,dB.MODULE=nB,dB.ERROR_ENUM_NAME=`ScanError`,dB.SHORT_CODE=`RMS`;var mB=e=>(t,n)=>{n===void 0?customElements.define(e,t):n.addInitializer(()=>{customElements.define(e,t)})};function hB(e){return Lz(Wz(Wz({},e),{},{state:!0,attribute:!1}))}var gB=(e,t,n)=>(n.configurable=!0,n.enumerable=!0,Reflect.decorate&&typeof t!=`object`&&Object.defineProperty(e,t,n),n);function _B(e,t){return(n,r,i)=>{let a=t=>{var n,r;return(n=(r=t.renderRoot)==null?void 0:r.querySelector(e))==null?null:n};if(t){let{get:e,set:t}=typeof r==`object`?n:i==null?(()=>{let e=Symbol();return{get(){return this[e]},set(t){this[e]=t}}})():i;return gB(n,r,{get(){let n=e.call(this);return n===void 0&&(n=a(this),(n!==null||this.hasUpdated)&&t.call(this,n)),n}})}return gB(n,r,{get(){return a(this)}})}}function vB(e){return yB.apply(this,arguments)}function yB(){return yB=d(function*(e){return new Promise(t=>setTimeout(t,e))}),yB.apply(this,arguments)}function bB(e){return xB.apply(this,arguments)}function xB(){return xB=d(function*(e,t=0,n=0){let r=null,i=n*1e3;for(let n=0;n<=t;n++){try{let t=yield e();if(t!=null&&t.transactionId)return t;break}catch(e){r=e}n<t&&(yield vB(i))}throw r}),xB.apply(this,arguments)}var SB=e=>e?(e.internalScenario&&(e.scenario=e.internalScenario),delete e.internalScenario,e):{},CB=e=>{try{return new URL(e),!0}catch(e){return!1}};function wB(e,t,n,r,i){let a=e*t,o=a>i;return{width:e,height:t,isExtraLargeResolution:o,isDownscaleNeeded:(e>n||t>n||a>r)&&!o}}var TB=function(){var e=d(function*(e,t,n,r){let i=yield createImageBitmap(e),{width:a,height:o}=i;return i==null||i.close(),wB(a,o,t,n,r)});return function(t,n,r,i){return e.apply(this,arguments)}}();function EB({width:e,height:t,softSideLimit:n,softPixelLimit:r}){if(!(e>0&&t>0))return{width:1,height:1};let i=Math.max(e,t),a=e*t,o=i>n?n/i:1,s=a>r?Math.sqrt(r/a):1,c=Math.min(o,s,1);return{width:Math.max(1,Math.floor(e*c)),height:Math.max(1,Math.floor(t*c))}}function DB(e,t,n){return OB.apply(this,arguments)}function OB(){return OB=d(function*(e,t,n){return new Promise(r=>{if(!e||!e.size)return r({ok:!1});let i=document.createElement(`canvas`),a=i.getContext(`2d`),o=URL.createObjectURL(e),s=new Image,c=e=>{try{URL.revokeObjectURL(o)}catch(e){}try{i.width=0,i.height=0}catch(e){}s.onload=null,s.onerror=null,s.src=``,r(e)};s.onload=function(){let e=EB({width:s.width,height:s.height,softSideLimit:t,softPixelLimit:n});if(i.width=e.width,i.height=e.height,a)try{a.drawImage(s,0,0,e.width,e.height);let t=a.getImageData(0,0,e.width,e.height);return c(t?{ok:!0,imageData:t}:{ok:!1})}catch(e){return c({ok:!1})}return c({ok:!1})},s.onerror=()=>c({ok:!1}),s.src=o})}),OB.apply(this,arguments)}var kB=e=>{let{translationKeysData:t,translationKeysProps:n,locale:r}=e,i={},a=null;for(let e in t)i[t[e].key]=e;for(let e in n)i[e]&&n[e]&&(a?a[i[e]]=n[e]:a={[i[e]]:n[e]});return a?{[r]:a}:{}},AB={preparingCamera:{fallback:`Preparing the camera...`,key:`strPrepareCamera`},timeout:{fallback:`Timeout`,key:`strTimeout`},noFocus:{fallback:`No camera focus`,key:`strNoFocus`},somethingWentWrong:{fallback:`Something went wrong`,key:`messageUnknownError`},incorrectCameraId:{fallback:`No camera with the specified ID found.`,key:`InfoScreenIncorrectCameraIdTitle`},done:{fallback:`Done!`,key:`strDoneMessage`},cameraUnavailable:{fallback:`Camera unavailable!`,key:`statusCameraUnavailableTitle`},versionNotSupported:{fallback:`Your browser version is not supported`,key:`statusBrowserNotSupportedTitle`},httpNotSupported:{fallback:`HTTPS not used`,key:`statusBrowserHTTPNotSupportedSubtitle`},insecurePageContext:{fallback:`Insecure context`,key:`statusBrowserInsecurePageContextSubtitle`},badLicense:{fallback:`The license cannot be found or has expired`,key:`statusProcMgrBadLicenseSubtitle`},fileCorrupt:{fallback:`This file is corrupt or not supported`,key:`statusIncorrectDataTitle`},largeFile:{fallback:`This file is too large to be uploaded`,key:`statusLargeDataTitle`},placeDocumentIntoFrame:{fallback:`Fit the document into the frame`,key:`strPlaceDocumentInFrame`},holdDocumentStraight:{fallback:`Hold the document straight`,key:`strHoldDocumentStraight`},glaresOnDocument:{fallback:`Avoid glare on the document`,key:`strGlaresOnDocument`},tryAgain:{fallback:`Try again`,key:`faceLivenessScreenButton`},noCameraAvailable:{fallback:`No camera available`,key:`InfoScreenNoCameraTitle`},positionDocumentCenter:{fallback:`Position the document in the center`,key:`documentReaderDocumentReaderLayoutDocumentCenter`},uploadPhoto:{fallback:`Upload a photo`,key:`cameraCaptureCameraCaptureStartScreenTitle`},moveCloser:{fallback:`Move closer`,key:`hint.moveCloser`},keepDeviceStill:{fallback:`Hold the device still`,key:`strKeepDeviceStill`},camera:{fallback:`Camera`,key:`strCamera`},switchToMobile:{fallback:`Switch to mobile`,key:`switchToMobile`},openPhoneCamera:{fallback:`Open the camera on your mobile device, scan the QR code, and follow the link`,key:`openPhoneCamera`},pleaseWait:{fallback:`Please wait...`,key:`strPleaseWait`},mobileDevice:{fallback:`Mobile device`,key:`mobileDevice`},verifyYourIdentity:{fallback:`Identity document verification`,key:`verifyYourIdentity`},fromCameraFilesMobileDesktop:{fallback:`Capture a document using the computer’s camera, upload it from files, or scan it on a mobile device`,key:`fromCameraFilesMobileDesktop`},fromCameraFilesDesktop:{fallback:`Capture a document using the computer’s camera or upload it from files`,key:`fromCameraFilesDesktop`},fromCameraMobileDesktop:{fallback:`Capture a document using the computer’s camera or scan it on a mobile device`,key:`fromCameraMobileDesktop`},fromFilesMobileDesktop:{fallback:`Upload a document from files or scan it on a mobile device`,key:`fromFilesMobileDesktop`},fromCameraDesktop:{fallback:`Use the computer's camera to capture a document`,key:`fromCameraDesktop`},fromFilesDesktop:{fallback:`Pick a document from files and upload it`,key:`fromFilesDesktop`},fromMobileDesktop:{fallback:`Use your mobile camera to capture a document`,key:`fromMobileDesktop`},fromCameraGalleryMobile:{fallback:`Capture a document using the mobile's camera or upload it from gallery`,key:`fromCameraGalleryMobile`},fromGalleryMobile:{fallback:`Pick a document from the gallery and upload it`,key:`fromGalleryMobile`},gallery:{fallback:`Gallery`,key:`gallery`},files:{fallback:`Files`,key:`files`},returnToComputer:{fallback:`Return to the computer`,key:`returnToComputer`},documentCaptured:{fallback:`Your document has been captured`,key:`documentCaptured`},or:{fallback:`or`,key:`strOr`},continueInBrowser:{fallback:`Click here to continue in browser`,key:`continueInBrowser`},skip:{fallback:`Skip`,key:`strSkip`},flipTheDocument:{fallback:`Flip the document`,key:`documentReaderDocumentReaderLayoutFlipDocument`},tiltTheDocument:{fallback:`Tilt the document`,key:`strTiltDocument`}},jB=s`
|
|
35
|
+
`):``,this.name=`UnsubscriptionError`,this.errors=t}});function qL(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var JL=(function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,t,n,r,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var o=RL(a),s=o.next();!s.done;s=o.next())s.value.remove(this)}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}else a.remove(this);var c=this.initialTeardown;if(WL(c))try{c()}catch(e){i=e instanceof KL?e.errors:[e]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var u=RL(l),d=u.next();!d.done;d=u.next()){var f=d.value;try{ZL(f)}catch(e){i=i==null?[]:i,e instanceof KL?i=BL(BL([],zL(i)),zL(e.errors)):i.push(e)}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}if(i)throw new KL(i)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)ZL(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(n=this._finalizers)==null?[]:n).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&qL(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&qL(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})(),YL=JL.EMPTY;function XL(e){return e instanceof JL||e&&`closed`in e&&WL(e.remove)&&WL(e.add)&&WL(e.unsubscribe)}function ZL(e){WL(e)?e():e.unsubscribe()}var QL={Promise:void 0},$L={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,BL([e,t],zL(n)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function eR(e){$L.setTimeout(function(){throw e})}function tR(){}function nR(e){e()}var rR=(function(e){FL(t,e);function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,XL(t)&&t.add(n)):n.destination=cR,n}return t.create=function(e,t,n){return new aR(e,t,n)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(JL),iR=(function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){oR(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){oR(e)}else oR(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){oR(e)}},e})(),aR=(function(e){FL(t,e);function t(t,n,r){var i=e.call(this)||this,a;return a=WL(t)||!t?{next:t==null?void 0:t,error:n==null?void 0:n,complete:r==null?void 0:r}:t,i.destination=new iR(a),i}return t})(rR);function oR(e){eR(e)}function sR(e){throw e}var cR={closed:!0,next:tR,error:sR,complete:tR},lR=(function(){return typeof Symbol==`function`&&Symbol.observable||`@@observable`})();function uR(e){return e}function dR(e){return e.length===0?uR:e.length===1?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}}var fR=(function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this,i=hR(e)?e:new aR(e,t,n);return nR(function(){var e=r,t=e.operator,n=e.source;i.add(t?t.call(i,n):n?r._subscribe(i):r._trySubscribe(i))}),i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return t=pR(t),new t(function(t,r){var i=new aR({next:function(t){try{e(t)}catch(e){r(e),i.unsubscribe()}},error:r,complete:t});n.subscribe(i)})},e.prototype._subscribe=function(e){var t;return(t=this.source)==null?void 0:t.subscribe(e)},e.prototype[lR]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return dR(e)(this)},e.prototype.toPromise=function(e){var t=this;return e=pR(e),new e(function(e,n){var r;t.subscribe(function(e){return r=e},function(e){return n(e)},function(){return e(r)})})},e.create=function(t){return new e(t)},e})();function pR(e){var t;return(t=e==null?QL.Promise:e)==null?Promise:t}function mR(e){return e&&WL(e.next)&&WL(e.error)&&WL(e.complete)}function hR(e){return e&&e instanceof rR||mR(e)&&XL(e)}function gR(e){return WL(e==null?void 0:e.lift)}function _R(e){return function(t){if(gR(t))return t.lift(function(t){try{return e(t,this)}catch(e){this.error(e)}});throw TypeError(`Unable to lift unknown Observable type`)}}function vR(e,t,n,r,i){return new yR(e,t,n,r,i)}var yR=(function(e){FL(t,e);function t(t,n,r,i,a,o){var s=e.call(this,t)||this;return s.onFinalize=a,s.shouldUnsubscribe=o,s._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,s._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,s._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,s}return t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)==null||t.call(this))}},t})(rR),bR=GL(function(e){return function(){e(this),this.name=`ObjectUnsubscribedError`,this.message=`object unsubscribed`}}),xR=(function(e){FL(t,e);function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return t.prototype.lift=function(e){var t=new SR(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new bR},t.prototype.next=function(e){var t=this;nR(function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var i=RL(t.currentObservers),a=i.next();!a.done;a=i.next())a.value.next(e)}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}})},t.prototype.error=function(e){var t=this;nR(function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}})},t.prototype.complete=function(){var e=this;nR(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return((e=this.observers)==null?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,i=n.isStopped,a=n.observers;return r||i?YL:(this.currentObservers=null,a.push(e),new JL(function(){t.currentObservers=null,qL(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},t.prototype.asObservable=function(){var e=new fR;return e.source=this,e},t.create=function(e,t){return new SR(e,t)},t})(fR),SR=(function(e){FL(t,e);function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return t.prototype.next=function(e){var t,n;(n=(t=this.destination)==null?void 0:t.next)==null||n.call(t,e)},t.prototype.error=function(e){var t,n;(n=(t=this.destination)==null?void 0:t.error)==null||n.call(t,e)},t.prototype.complete=function(){var e,t;(t=(e=this.destination)==null?void 0:e.complete)==null||t.call(e)},t.prototype._subscribe=function(e){var t,n;return(n=(t=this.source)==null?void 0:t.subscribe(e))==null?YL:n},t})(xR),CR=(function(e){return e&&typeof e.length==`number`&&typeof e!=`function`});function wR(e){return WL(e==null?void 0:e.then)}function TR(e){return WL(e[lR])}function ER(e){return Symbol.asyncIterator&&WL(e==null?void 0:e[Symbol.asyncIterator])}function DR(e){return TypeError(`You provided `+(typeof e==`object`&&e?`an invalid object`:`'`+e+`'`)+` where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}function OR(){return typeof Symbol!=`function`||!Symbol.iterator?`@@iterator`:Symbol.iterator}var kR=OR();function AR(e){return WL(e==null?void 0:e[kR])}function jR(e){return HL(this,arguments,function(){var t,n,r,i;return LL(this,function(a){switch(a.label){case 0:t=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,VL(t.read())];case 3:return n=a.sent(),r=n.value,i=n.done,i?[4,VL(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,VL(r)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function MR(e){return WL(e==null?void 0:e.getReader)}function NR(e){if(e instanceof fR)return e;if(e!=null){if(TR(e))return PR(e);if(CR(e))return FR(e);if(wR(e))return IR(e);if(ER(e))return RR(e);if(AR(e))return LR(e);if(MR(e))return zR(e)}throw DR(e)}function PR(e){return new fR(function(t){var n=e[lR]();if(WL(n.subscribe))return n.subscribe(t);throw TypeError(`Provided object does not correctly implement Symbol.observable`)})}function FR(e){return new fR(function(t){for(var n=0;n<e.length&&!t.closed;n++)t.next(e[n]);t.complete()})}function IR(e){return new fR(function(t){e.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,eR)})}function LR(e){return new fR(function(t){var n,r;try{for(var i=RL(e),a=i.next();!a.done;a=i.next()){var o=a.value;if(t.next(o),t.closed)return}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}t.complete()})}function RR(e){return new fR(function(t){BR(e,t).catch(function(e){return t.error(e)})})}function zR(e){return RR(jR(e))}function BR(e,t){var n,r,i,a;return IL(this,void 0,void 0,function(){var o,s;return LL(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=UL(e),c.label=1;case 1:return[4,n.next()];case 2:if(r=c.sent(),r.done)return[3,4];if(o=r.value,t.next(o),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=c.sent(),i={error:s},[3,11];case 6:return c.trys.push([6,,9,10]),r&&!r.done&&(a=n.return)?[4,a.call(n)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function VR(e,t,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var a=t.schedule(function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(a),!i)return a}function HR(e,t){return t===void 0&&(t=0),_R(function(n,r){n.subscribe(vR(r,function(n){return VR(r,e,function(){return r.next(n)},t)},function(){return VR(r,e,function(){return r.complete()},t)},function(n){return VR(r,e,function(){return r.error(n)},t)}))})}function UR(e,t){return t===void 0&&(t=0),_R(function(n,r){r.add(e.schedule(function(){return n.subscribe(r)},t))})}function WR(e,t){return NR(e).pipe(UR(t),HR(t))}function GR(e,t){return NR(e).pipe(UR(t),HR(t))}function KR(e,t){return new fR(function(n){var r=0;return t.schedule(function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())})})}function qR(e,t){return new fR(function(n){var r;return VR(n,t,function(){r=e[kR](),VR(n,t,function(){var e,t,i;try{e=r.next(),t=e.value,i=e.done}catch(e){n.error(e);return}i?n.complete():n.next(t)},0,!0)}),function(){return WL(r==null?void 0:r.return)&&r.return()}})}function JR(e,t){if(!e)throw Error(`Iterable cannot be null`);return new fR(function(n){VR(n,t,function(){var r=e[Symbol.asyncIterator]();VR(n,t,function(){r.next().then(function(e){e.done?n.complete():n.next(e.value)})},0,!0)})})}function YR(e,t){return JR(jR(e),t)}function XR(e,t){if(e!=null){if(TR(e))return WR(e,t);if(CR(e))return KR(e,t);if(wR(e))return GR(e,t);if(ER(e))return JR(e,t);if(AR(e))return qR(e,t);if(MR(e))return YR(e,t)}throw DR(e)}function ZR(e,t){return t?XR(e,t):NR(e)}function QR(e,t){return _R(function(n,r){var i=0;n.subscribe(vR(r,function(n){r.next(e.call(t,n,i++))}))})}function $R(e,t,n,r,i,a,o,s){var c=[],l=0,u=0,d=!1,f=function(){d&&!c.length&&!l&&t.complete()},p=function(e){return l<r?m(e):c.push(e)},m=function(e){l++;var i=!1;NR(n(e,u++)).subscribe(vR(t,function(e){t.next(e)},function(){i=!0},void 0,function(){if(i)try{l--;for(var e=function(){var e=c.shift();o||m(e)};c.length&&l<r;)e();f()}catch(e){t.error(e)}}))};return e.subscribe(vR(t,p,function(){d=!0,f()})),function(){}}function ez(e,t,n){return n===void 0&&(n=1/0),WL(t)?ez(function(n,r){return QR(function(e,i){return t(n,e,r,i)})(NR(e(n,r)))},n):(typeof t==`number`&&(n=t),_R(function(t,r){return $R(t,r,e,n)}))}function tz(e){return _R(function(t,n){var r=null,i=!1,a;r=t.subscribe(vR(n,void 0,void 0,function(o){a=NR(e(o,tz(e)(t))),r?(r.unsubscribe(),r=null,a.subscribe(n)):i=!0})),i&&(r.unsubscribe(),r=null,a.subscribe(n))})}function nz(e,t){return WL(t)?ez(e,t,1):ez(e,1)}function rz(e,t,n){return(t=iz(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iz(e){var t=az(e,`string`);return typeof t==`symbol`?t:t+``}function az(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var oz=class{constructor(){rz(this,`taskSubject`,new xR),this.taskSubject.pipe(nz(e=>ZR(e()).pipe(tz(e=>ZR(Promise.reject(e)))))).subscribe()}addTask(e){return new Promise((t,n)=>{this.taskSubject.next(()=>V(this,null,function*(){try{t(yield e())}catch(e){n(e)}}))})}},sz=`text/plain`,cz=`us-ascii`,lz=`%(?:3A|2F|3F|23|5B|5D|40|21|24|26|27|28|29|2A|2B|2C|3B|3D)`,uz=`__normalize_url_encoded_reserved__`,dz=/__normalize_url_encoded_reserved__(\d+)__/g,fz=new RegExp(lz,`i`),pz=new RegExp(lz,`gi`),mz=(e,t)=>Array.isArray(t)&&t.some(t=>t instanceof RegExp?t.flags.includes(`g`)||t.flags.includes(`y`)?new RegExp(t.source,t.flags.replaceAll(/[gy]/g,``)).test(e):t.test(e):t===e),hz=new Set([`https:`,`http:`,`file:`]),gz=e=>{if(typeof e!=`string`)return;let t=e.trim().toLowerCase().replace(/:$/,``);return t===``?void 0:`${t}:`},_z=e=>{try{let{protocol:t}=new URL(e),n=e.slice(0,t.length+2).toLowerCase()===`${t}//`;if(t.endsWith(`:`)&&(!t.includes(`.`)||n)&&!hz.has(t))return t}catch(e){}},vz=e=>{try{return decodeURIComponent(e.replaceAll(`+`,`%20`))}catch(t){return new URLSearchParams(`${e}=`).keys().next().value}},yz=e=>{let t=new Set;if(!e)return t;for(let n of e.slice(1).split(`&`))n&&!n.includes(`=`)&&t.add(vz(n));return t},bz=e=>{let t=e;try{t=decodeURIComponent(e)}catch(n){t=new URLSearchParams(e).toString()}let n=e=>{let t=new Set;for(let n of e.matchAll(dz))t.add(Number.parseInt(n[1],10));return t},r=n(e);for(let e of n(t))r.add(e);let i=0;for(;r.has(i);)i++;return`${uz}${i}__`},xz=(e,t)=>{if(!t)return e.sort(),e.toString();let n=e=>e.replace(t,(e,t)=>String.fromCodePoint(Number.parseInt(t,16))),r=[...e.entries()];return r.sort(([e],[t])=>{let r=n(e),i=n(t);return r<i?-1:+(r>i)}),new URLSearchParams(r).toString()},Sz=(e,t)=>t?e.replace(t,(e,t)=>String.fromCodePoint(Number.parseInt(t,16))):e,Cz=(e,t,n)=>{let r=t===`always`,i=t===`never`,a=r||i?void 0:yz(n),o=e=>e.replaceAll(`+`,`%20`),s=e=>r?`${e}=`:i||a.has(vz(e))?e:`${e}=`,c=e=>{let t=e.indexOf(`=`);if(t===-1)return s(o(e));let n=e.slice(0,t),r=e.slice(t+1);return r===``?n===``?`=`:s(o(n)):`${o(n)}=${r}`},l=e.slice(1).split(`&`).filter(Boolean);return l.length===0?``:`?${l.map(e=>c(e)).join(`&`)}`},wz=(e,{stripHash:t})=>{let n=RegExp(`^data:(?<type>[^,]*?),(?<data>[^#]*?)(?:#(?<hash>.*))?$`).exec(e);if(!n)throw Error(`Invalid URL: ${e}`);let{type:r,data:i,hash:a}=n.groups,o=r.split(`;`),s=o.at(-1)===`base64`;s&&o.pop();let c=o.shift().toLowerCase(),l=[...o.map(e=>{let[t,n=``]=e.split(`=`).map(e=>e.trim());return t===`charset`&&(n=n.toLowerCase(),n===cz)?``:`${t}${n?`=${n}`:``}`}).filter(Boolean)];s&&l.push(`base64`),(l.length>0||c&&c!==sz)&&l.unshift(c);let u=t||!a?``:`#${a}`;return`data:${l.join(`;`)},${s?i.trim():i}${u}`};function Tz(e,t){if(t=B({defaultProtocol:`http`,normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripTextFragment:!0,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeSingleSlash:!0,removeDirectoryIndex:!1,removeExplicitPort:!1,sortQueryParameters:!0,removePath:!1,transformPath:!1,emptyQueryValue:`preserve`},t),typeof t.defaultProtocol==`string`&&!t.defaultProtocol.endsWith(`:`)&&(t.defaultProtocol=`${t.defaultProtocol}:`),e=e.trim(),/^data:/i.test(e))return wz(e,t);let n=Array.isArray(t.customProtocols)?t.customProtocols:[],r=new Set(n.map(e=>gz(e)).filter(Boolean)),i=_z(e);if(i&&!r.has(i))return e;let a=e.startsWith(`//`);!(!a&&/^\.*\//.test(e))&&!i&&(e=e.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,t.defaultProtocol));let o=new URL(e);if(t.forceHttp&&t.forceHttps)throw Error("The `forceHttp` and `forceHttps` options cannot be used together");if(t.forceHttp&&o.protocol===`https:`&&(o.protocol=`http:`),t.forceHttps&&o.protocol===`http:`&&(o.protocol=`https:`),t.stripAuthentication&&(o.username=``,o.password=``),t.stripHash?o.hash=``:t.stripTextFragment&&(o.hash=o.hash.replace(/#?:~:text.*?$/i,``)),o.pathname){let e=/\b[a-z][a-z\d+\-.]{1,50}:\/\//g,t=0,n=``;for(;;){let r=e.exec(o.pathname);if(!r)break;let i=r[0],a=r.index,s=o.pathname.slice(t,a);n+=s.replaceAll(/\/{2,}/g,`/`),n+=i,t=a+i.length}let r=o.pathname.slice(t);n+=r.replaceAll(/\/{2,}/g,`/`),o.pathname=n}if(o.pathname)try{o.pathname=decodeURI(o.pathname).replaceAll(`\\`,`%5C`)}catch(e){}if(t.removeDirectoryIndex===!0&&(t.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(t.removeDirectoryIndex)&&t.removeDirectoryIndex.length>0){let e=o.pathname.split(`/`).filter(Boolean),n=e.at(-1);n&&mz(n,t.removeDirectoryIndex)&&(e.pop(),o.pathname=e.length>0?`/${e.join(`/`)}/`:`/`)}if(t.removePath&&(o.pathname=`/`),t.transformPath&&typeof t.transformPath==`function`){let e=o.pathname.split(`/`).filter(Boolean),n=t.transformPath(e);o.pathname=(n==null?void 0:n.length)>0?`/${n.join(`/`)}`:`/`}o.hostname&&(o.hostname=o.hostname.replace(/\.$/,``),t.stripWWW&&/^www\.(?!www\.)[a-z\-\d]{1,63}\.[a-z.\-\d]{2,63}$/.test(o.hostname)&&(o.hostname=o.hostname.replace(/^www\./,``)));let s=o.search,c;if(t.sortQueryParameters&&fz.test(s)){let e=bz(s);o.search=s.replaceAll(pz,t=>`${e}${t.slice(1).toUpperCase()}`),c=RegExp(`${e}([0-9A-F]{2})`,`g`)}let l=Array.isArray(t.keepQueryParameters),{searchParams:u}=o;if(!l&&Array.isArray(t.removeQueryParameters)&&t.removeQueryParameters.length>0)for(let e of[...u.keys()])mz(Sz(e,c),t.removeQueryParameters)&&u.delete(e);if(!l&&t.removeQueryParameters===!0&&(o.search=``),l&&t.keepQueryParameters.length>0)for(let e of[...u.keys()])mz(Sz(e,c),t.keepQueryParameters)||u.delete(e);else l&&(o.search=``);t.sortQueryParameters&&(o.search=xz(o.searchParams,c),o.search=decodeURIComponent(o.search.replaceAll(/%(?:26|23|3f|25|2b)/gi,e=>`%25${e.slice(1)}`)),c&&(o.search=o.search.replace(c,`%$1`))),o.search=Cz(o.search,t.emptyQueryValue,s),t.removeTrailingSlash&&(o.pathname=o.pathname.replace(/\/$/,``)),t.removeExplicitPort&&o.port&&(o.port=``);let d=e;return e=o.toString(),!t.removeSingleSlash&&o.pathname===`/`&&!d.endsWith(`/`)&&o.hash===``&&(e=e.replace(/\/$/,``)),(t.removeTrailingSlash||o.pathname===`/`)&&o.hash===``&&t.removeSingleSlash&&(e=e.replace(/\/$/,``)),a&&!t.normalizeProtocol&&(e=e.replace(/^http:\/\//,`//`)),t.stripProtocol&&(e=e.replace(/^(?:https?:)?\/\//,``)),e}function Ez(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Dz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Ez(Object(n),!0).forEach(function(t){Oz(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ez(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Oz(e,t,n){return(t=kz(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kz(e){var t=Az(e,`string`);return typeof t==`symbol`?t:t+``}function Az(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var jz=S_.create(`wasm`),Mz=S_.create(`main`),Nz=class{constructor(){Oz(this,`_worker`,null),Oz(this,`_initializeListener`,null),Oz(this,`_processingListener`,null),Oz(this,`_queueService`,new oz),Oz(this,`_initProcess`,null),Oz(this,`version`,{component:`9.5.2892`}),Oz(this,`onFinalize`,null),Oz(this,`isPrepared`,!1),Oz(this,`isInitialized`,!1),Oz(this,`isProcessing`,!1),Oz(this,`initData`,null),Oz(this,`recognizerProcessParam`,{processParam:{}}),Oz(this,`imageProcessParam`,{processParam:{}}),Oz(this,`recognizeListener`,null),Oz(this,`workerPath`,`https://wasm.regulaforensics.com/document/release/9.5/barcodemrz/1f57dab0-9204d6578`)}get processingListener(){return this._processingListener}set processingListener(e){this._processingListener=e,e&&e({isProcessing:this.isProcessing})}get initializeListener(){return this._initializeListener}set initializeListener(e){this._initializeListener=e,e&&e({isInitialized:this.isInitialized})}createProcessImageRequest(e,t){let n=e.map((e,t)=>({data:e,light:6,pageIdx:t}));return Dz(Dz({},t),{},{imagesList:n})}prepareImageData(e){return e.map(e=>e instanceof ImageData?{width:e.width,height:e.height,data:e.data.buffer}:{data:e})}sendMessage(e){return this._queueService.addTask(()=>new Promise((t,n)=>{if(!this._worker)return Mz(`Worker is missing)`),n(`Worker is missing`);this._worker.onmessage=e=>{if(e.data.target===up.custom){let{method:r,response:i,code:a}=e.data.data,o=i&&`reject_message`in i?i.reject_message:``;if(a===xf.ok||a===xf.badLicense&&!o)Mz(`Method ${r}: { code: ${a} } `),t(i);else{let e=`Method ${r}: ${$f[a]||a}${o?` Reject message: ${o}`:``}`;Mz(e),n(e)}}e.data.target===up.stdout&&jz(JSON.stringify(e.data.content)),e.data.target===up.stderr&&(jz(JSON.stringify(e.data.content)),n(e.data.content))},this._worker.onerror=e=>{jz(JSON.stringify(e.message)),n(e)},Mz(`Send message to worker: { target: ${e.target}, method: ${e.method} }`),this._worker.postMessage(Dz(Dz({},e),{},{preMain:!0}),`data`in e&&e.data?e.data.map(e=>e.data):[])}))}prepare(e){return V(this,null,function*(){var t;Mz(`Preparing the service`);{let t=this.workerPath===`https://wasm.regulaforensics.com/document/release/9.5/barcodemrz/1f57dab0-9204d6578`,n=Tz(e&&t?aD(e,`PROD`):this.workerPath),r=yield(yield fetch(`${n}/${qf}`)).text();t||(r=iD(r,n));let i=new Blob([r],{type:`text/plain`}),a=URL.createObjectURL(i);this._worker=new Worker(a),URL.revokeObjectURL(a)}(t=this._worker)==null||t.postMessage({method:vf.prepare,target:up.gl,preMain:!0,op:`setPrefetched`}),yield this.sendMessage({method:vf.prepare,target:up.init,URL:document.URL}),this.isPrepared=!0,Mz(`Service prepared`)})}initialize(e){return V(this,null,function*(){return this._initProcess||(this._initProcess=this.doInitialize(e),this._initProcess.catch(()=>{this._initProcess=null})),this._initProcess})}doInitialize(e){return V(this,null,function*(){var t,n;this.isPrepared||(yield this.prepare(e==null?void 0:e.module)),Mz(`Initializing the service`);let{scenario:r,license:i}=yield this.sendMessage({target:up.custom,method:vf.initialize,request:{systemInfo:{userID:m_(Cp),hostName:(t=document.location)==null?void 0:t.origin,license:e==null?void 0:e.license},telemetry:yield v_({sdkVersion:`9.5.2892`}),processParam:this.recognizerProcessParam.processParam||this.imageProcessParam.processParam}});return this.initData={scenario:r,license:i},this.isInitialized=!0,(n=this._initializeListener)==null||n.call(this,{isInitialized:this.isInitialized}),Mz(`Service initialized: ${JSON.stringify({scenario:r,license:i})}`),this.initData})}doProcess(e,t,n){return V(this,null,function*(){var r,i;Mz(`Process method ${e} started`),this.isProcessing=!0,(r=this._processingListener)==null||r.call(this,{isProcessing:this.isProcessing});let a=yield this.sendMessage({target:up.custom,method:e,request:t,data:n});return this.isProcessing=!1,(i=this._processingListener)==null||i.call(this,{isProcessing:this.isProcessing}),Mz(`Process method ${e} finished`),new qE(a)})}processImageBase64(e,t){return V(this,null,function*(){return this.doProcess(vf.processImage,this.createProcessImageRequest(e,t))})}process(e,t){return V(this,null,function*(){var n;let r=this.prepareImageData(e),i=yield this.doProcess(vf.process,t||this.recognizerProcessParam,r);return(n=this.recognizeListener)==null||n.call(this,i),i})}processImage(e,t){return V(this,null,function*(){let n=this.prepareImageData(e);return this.doProcess(vf.processImage,t||this.imageProcessParam,n)})}startNewPage(){return V(this,null,function*(){Mz(`Starting new page`),yield this.sendMessage({target:up.custom,method:vf.startNewPage})})}startNewDocument(e,t){return V(this,null,function*(){return Mz(`Starting new document`),yield this.sendMessage({target:up.custom,method:vf.startNewDocument,request:Dz(Dz({},t||this.recognizerProcessParam),{},{metadata:e})})})}createBackendTransaction(e,t){return V(this,null,function*(){return Mz(`Create backend transaction`),yield this.sendMessage({target:up.custom,method:vf.createBackendTransaction,request:Dz(Dz({},t||this.recognizerProcessParam),{},{metadata:e})})})}finalizePackage(){return V(this,null,function*(){try{var e;Mz(`Finalize package`);let t=yield this.sendMessage({target:up.custom,method:vf.finalizePackage});return(e=this.onFinalize)==null||e.call(this,t),t}catch(e){var t;return(t=this.onFinalize)==null||t.call(this,{tag:``,transactionId:``}),Promise.reject(e)}})}addDataToPackage(e,t){return V(this,null,function*(){Mz(`Add data to package`),yield this.sendMessage({target:up.custom,method:vf.addDataToPackage,request:t,data:[{data:e.buffer}]}),Mz(`Data added to package`)})}shutdown(){Mz(`Shutdown service`),this._worker&&(this._worker.terminate(),Mz(`Worker terminated`)),this.isPrepared=!1,this.isInitialized=!1,this.isProcessing=!1,this._initProcess=null}};function Pz(){return V(this,null,function*(){let e=window.customElements.get(`document-reader`),t=window.customElements.get(`camera-snapshot`),n=window.customElements.get(`fullscreen-container`);e||window.customElements.define(`document-reader`,fL),t||window.customElements.define(`camera-snapshot`,kL),n||window.customElements.define(`fullscreen-container`,NL);let r=window.customElements.whenDefined(`document-reader`),i=window.customElements.whenDefined(`camera-snapshot`),a=window.customElements.whenDefined(`fullscreen-container`);yield Promise.all([r,i,a])})}var Fz={attribute:!0,type:String,converter:T,reflect:!1,hasChanged:E},Iz=(e=Fz,t,n)=>{let{kind:r,metadata:i}=n,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),r===`setter`&&((e=Object.create(e)).wrapped=!0),a.set(n.name,e),r===`accessor`){let{name:r}=n;return{set(n){let i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e,!0,n)},init(t){return t!==void 0&&this.C(r,void 0,e,t),t}}}if(r===`setter`){let{name:r}=n;return function(n){let i=this[r];t.call(this,n),this.requestUpdate(r,i,e,!0,n)}}throw Error(`Unsupported decorator location: `+r)};function Lz(e){return(t,n)=>typeof n==`object`?Iz(e,t,n):((e,t,n)=>{let r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}var Rz=(e,t,n)=>{for(let n of t)if(n[0]===e)return(0,n[1])();return n==null?void 0:n()};function zz(e){"@babel/helpers - typeof";return zz=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},zz(e)}function Bz(e,t){if(zz(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(zz(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Vz(e){var t=Bz(e,`string`);return zz(t)==`symbol`?t:t+``}function Hz(e,t,n){return(t=Vz(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Uz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Wz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Uz(Object(n),!0).forEach(function(t){Hz(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Uz(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Gz=class e{constructor({errorCode:e,errorCodeKey:t,message:n,underlyingError:r,underlyingBaseError:i,domain:a,module:o,errorEnumName:s,shortDomainCode:c}){this.errorCode=e,this.errorCodeKey=t,this.message=n,this.underlyingError=r,this.underlyingBaseError=i,this.module=o,this.domain=a,this.errorEnumName=s,this.shortDomainCode=c}static getErrorKey(e,t){let n=Object.keys(t).find(n=>t[n]===e);if(!n)throw Error(`Invalid errorCode: ${e} in enum`);return n}get lastUnderlyingError(){let t=this.underlyingBaseError;for(;(t==null?void 0:t.underlyingBaseError)instanceof e;)t=t.underlyingBaseError;return t==null?void 0:t.underlyingError}toObject(){let t={errorCode:this.errorCode,errorCodeKey:this.errorCodeKey,errorEnumName:this.errorEnumName,message:this.message,module:this.module,underlyingError:this.underlyingError,lastUnderlineError:this.lastUnderlyingError};return this.underlyingBaseError&&this.underlyingBaseError instanceof e&&(t.underlyingBaseError=this.underlyingBaseError.toObject()),t}get shortChain(){let t=`${this.shortDomainCode}:${this.errorCode}${this.underlyingError?`-`+this.underlyingError:``}`;return this.underlyingBaseError instanceof e&&(t+=`-${this.underlyingBaseError.shortChain}`),t}get fullChain(){let t=`${this.module}.${this.domain}:${this.errorCodeKey}${this.underlyingError?`-`+this.underlyingError:``}`;return this.underlyingBaseError instanceof e&&(t+=`-${this.underlyingBaseError.fullChain}`),t}};function Kz(e,t){if(t.displayName?console.log(`Register module: ${t.displayName}`):console.error(`Missed "displayName" when register module`),t.getSupportedTemplates&&typeof t.getSupportedTemplates==`function`){let e=t.getSupportedTemplates();console.log(`${t==null?void 0:t.displayName} supported templates: ${e.join(`, `)}`)}else console.error(`Missed "getSupportedTemplates" method when register module`);if(t.initialize&&typeof t.initialize==`function`||console.error(`${t==null?void 0:t.displayName} "initialize" method was not implemented`),t.deinitialize&&typeof t.deinitialize==`function`||console.error(`${t==null?void 0:t.displayName} "deinitialize" method was not implemented`),t.isReady&&typeof t.isReady==`function`||console.error(`${t==null?void 0:t.displayName} "isReady" method was not implemented`),t.getIdentifier&&typeof t.getIdentifier==`function`){let e=t.getIdentifier();console.log(`Module id: ${e}`)}else console.error(`Missed "getIdentifier" when register module`);customElements.get(t.getIdentifier())?console.log(`Module ${e} has already registered`):customElements.define(e,t),console.log(`-------`)}function qz(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0))}var Jz={FORM:`form`,DATA:`data`},Yz=[`ar`,`he`],Xz=e=>{var t;let n=e?(t=e.substring(0,2))==null?void 0:t.toLowerCase():``;return Yz.includes(n)?`rtl`:`ltr`},Zz=(e,t)=>e.base64&&!(t!=null&&t.base64.has(e.base64))?e.base64:e.imageURL&&!(t!=null&&t.imageURL.has(e.imageURL))?e.imageURL:``,Qz=(e,t,n)=>{var r;if(!t)return;let i=(r=e==null?void 0:e.idvAsset)==null?null:r;for(;i;){let e=Zz(i,n);if(e)return e;i=i.failurePolicy===`placeholderImage`&&i.placeholderImage||null}},$z={DOC_READER:`DOC_READER`,DOC_READER_GALLERY:`DOC_READER_GALLERY`},eB=function(e){return e[e.NO_INITIALIZED=0]=`NO_INITIALIZED`,e[e.UNKNOWN_STEP=1]=`UNKNOWN_STEP`,e[e.SCAN_ERROR=2]=`SCAN_ERROR`,e[e.RFID_ERROR=3]=`RFID_ERROR`,e[e.IMAGE_LOADING_FAILED=4]=`IMAGE_LOADING_FAILED`,e}({}),tB=function(e){return e[e.CONFIGURATION_FAILED=0]=`CONFIGURATION_FAILED`,e[e.INTERNAL_ERROR=1]=`INTERNAL_ERROR`,e[e.PRESENTER_UNAVAILABLE=2]=`PRESENTER_UNAVAILABLE`,e}({}),nB=`idv-document`,rB={0:pf.auto,1:pf.captureVideo,2:pf.captureFrame},iB={0:yf.line,1:yf.corners},aB={0:!0,1:!0,2:!1,3:!0},oB=1920,sB=4e6,cB=5e7,lB=function(e){return e.BarcodeMRZ=`BarcodeMRZ`,e.BoundsLite=`BoundsLite`,e}({}),uB,dB,fB=class e extends Gz{constructor({errorCode:t,message:n,underlyingError:r,underlyingBaseError:i}){let a=Gz.getErrorKey(t,eB);super({errorCode:t,errorCodeKey:a,errorEnumName:e.ERROR_ENUM_NAME,module:e.MODULE,message:n,underlyingError:r,underlyingBaseError:i,domain:e.ERROR_ENUM_NAME,shortDomainCode:e.SHORT_CODE})}};uB=fB,uB.MODULE=nB,uB.ERROR_ENUM_NAME=`ReaderModuleError`,uB.SHORT_CODE=`RM`;var pB=class e extends Gz{constructor({errorCode:t,message:n,underlyingError:r,underlyingBaseError:i}){let a=Gz.getErrorKey(t,tB);super({errorCode:t,errorCodeKey:a,errorEnumName:e.ERROR_ENUM_NAME,module:e.MODULE,message:n,underlyingError:r,underlyingBaseError:i,domain:e.ERROR_ENUM_NAME,shortDomainCode:e.SHORT_CODE})}};dB=pB,dB.MODULE=nB,dB.ERROR_ENUM_NAME=`ScanError`,dB.SHORT_CODE=`RMS`;var mB=e=>(t,n)=>{n===void 0?customElements.define(e,t):n.addInitializer(()=>{customElements.define(e,t)})};function hB(e){return Lz(Wz(Wz({},e),{},{state:!0,attribute:!1}))}var gB=(e,t,n)=>(n.configurable=!0,n.enumerable=!0,Reflect.decorate&&typeof t!=`object`&&Object.defineProperty(e,t,n),n);function _B(e,t){return(n,r,i)=>{let a=t=>{var n,r;return(n=(r=t.renderRoot)==null?void 0:r.querySelector(e))==null?null:n};if(t){let{get:e,set:t}=typeof r==`object`?n:i==null?(()=>{let e=Symbol();return{get(){return this[e]},set(t){this[e]=t}}})():i;return gB(n,r,{get(){let n=e.call(this);return n===void 0&&(n=a(this),(n!==null||this.hasUpdated)&&t.call(this,n)),n}})}return gB(n,r,{get(){return a(this)}})}}function vB(e){return yB.apply(this,arguments)}function yB(){return yB=d(function*(e){return new Promise(t=>setTimeout(t,e))}),yB.apply(this,arguments)}function bB(e){return xB.apply(this,arguments)}function xB(){return xB=d(function*(e,t=120,n=200){let r=null,i=0;for(;i<t;){try{let t=yield e();if(t!=null&&t.transactionId)return t}catch(e){r=e}i<t-1&&(yield vB(n)),i++}throw r}),xB.apply(this,arguments)}var SB=e=>e?(e.internalScenario&&(e.scenario=e.internalScenario),delete e.internalScenario,e):{},CB=e=>{try{return new URL(e),!0}catch(e){return!1}};function wB(e,t,n,r,i){let a=e*t,o=a>i;return{width:e,height:t,isExtraLargeResolution:o,isDownscaleNeeded:(e>n||t>n||a>r)&&!o}}var TB=function(){var e=d(function*(e,t,n,r){let i=yield createImageBitmap(e),{width:a,height:o}=i;return i==null||i.close(),wB(a,o,t,n,r)});return function(t,n,r,i){return e.apply(this,arguments)}}();function EB({width:e,height:t,softSideLimit:n,softPixelLimit:r}){if(!(e>0&&t>0))return{width:1,height:1};let i=Math.max(e,t),a=e*t,o=i>n?n/i:1,s=a>r?Math.sqrt(r/a):1,c=Math.min(o,s,1);return{width:Math.max(1,Math.floor(e*c)),height:Math.max(1,Math.floor(t*c))}}function DB(e,t,n){return OB.apply(this,arguments)}function OB(){return OB=d(function*(e,t,n){return new Promise(r=>{if(!e||!e.size)return r({ok:!1});let i=document.createElement(`canvas`),a=i.getContext(`2d`),o=URL.createObjectURL(e),s=new Image,c=e=>{try{URL.revokeObjectURL(o)}catch(e){}try{i.width=0,i.height=0}catch(e){}s.onload=null,s.onerror=null,s.src=``,r(e)};s.onload=function(){let e=EB({width:s.width,height:s.height,softSideLimit:t,softPixelLimit:n});if(i.width=e.width,i.height=e.height,a)try{a.drawImage(s,0,0,e.width,e.height);let t=a.getImageData(0,0,e.width,e.height);return c(t?{ok:!0,imageData:t}:{ok:!1})}catch(e){return c({ok:!1})}return c({ok:!1})},s.onerror=()=>c({ok:!1}),s.src=o})}),OB.apply(this,arguments)}var kB=e=>{let{translationKeysData:t,translationKeysProps:n,locale:r}=e,i={},a=null;for(let e in t)i[t[e].key]=e;for(let e in n)i[e]&&n[e]&&(a?a[i[e]]=n[e]:a={[i[e]]:n[e]});return a?{[r]:a}:{}},AB={preparingCamera:{fallback:`Preparing the camera...`,key:`strPrepareCamera`},timeout:{fallback:`Timeout`,key:`strTimeout`},noFocus:{fallback:`No camera focus`,key:`strNoFocus`},somethingWentWrong:{fallback:`Something went wrong`,key:`messageUnknownError`},incorrectCameraId:{fallback:`No camera with the specified ID found.`,key:`InfoScreenIncorrectCameraIdTitle`},done:{fallback:`Done!`,key:`strDoneMessage`},cameraUnavailable:{fallback:`Camera unavailable!`,key:`statusCameraUnavailableTitle`},versionNotSupported:{fallback:`Your browser version is not supported`,key:`statusBrowserNotSupportedTitle`},httpNotSupported:{fallback:`HTTPS not used`,key:`statusBrowserHTTPNotSupportedSubtitle`},insecurePageContext:{fallback:`Insecure context`,key:`statusBrowserInsecurePageContextSubtitle`},badLicense:{fallback:`The license cannot be found or has expired`,key:`statusProcMgrBadLicenseSubtitle`},fileCorrupt:{fallback:`This file is corrupt or not supported`,key:`statusIncorrectDataTitle`},largeFile:{fallback:`This file is too large to be uploaded`,key:`statusLargeDataTitle`},placeDocumentIntoFrame:{fallback:`Fit the document into the frame`,key:`strPlaceDocumentInFrame`},holdDocumentStraight:{fallback:`Hold the document straight`,key:`strHoldDocumentStraight`},glaresOnDocument:{fallback:`Avoid glare on the document`,key:`strGlaresOnDocument`},tryAgain:{fallback:`Try again`,key:`faceLivenessScreenButton`},noCameraAvailable:{fallback:`No camera available`,key:`InfoScreenNoCameraTitle`},positionDocumentCenter:{fallback:`Position the document in the center`,key:`documentReaderDocumentReaderLayoutDocumentCenter`},uploadPhoto:{fallback:`Upload a photo`,key:`cameraCaptureCameraCaptureStartScreenTitle`},moveCloser:{fallback:`Move closer`,key:`hint.moveCloser`},keepDeviceStill:{fallback:`Hold the device still`,key:`strKeepDeviceStill`},camera:{fallback:`Camera`,key:`strCamera`},switchToMobile:{fallback:`Switch to mobile`,key:`switchToMobile`},openPhoneCamera:{fallback:`Open the camera on your mobile device, scan the QR code, and follow the link`,key:`openPhoneCamera`},pleaseWait:{fallback:`Please wait...`,key:`strPleaseWait`},mobileDevice:{fallback:`Mobile device`,key:`mobileDevice`},verifyYourIdentity:{fallback:`Identity document verification`,key:`verifyYourIdentity`},fromCameraFilesMobileDesktop:{fallback:`Capture a document using the computer’s camera, upload it from files, or scan it on a mobile device`,key:`fromCameraFilesMobileDesktop`},fromCameraFilesDesktop:{fallback:`Capture a document using the computer’s camera or upload it from files`,key:`fromCameraFilesDesktop`},fromCameraMobileDesktop:{fallback:`Capture a document using the computer’s camera or scan it on a mobile device`,key:`fromCameraMobileDesktop`},fromFilesMobileDesktop:{fallback:`Upload a document from files or scan it on a mobile device`,key:`fromFilesMobileDesktop`},fromCameraDesktop:{fallback:`Use the computer's camera to capture a document`,key:`fromCameraDesktop`},fromFilesDesktop:{fallback:`Pick a document from files and upload it`,key:`fromFilesDesktop`},fromMobileDesktop:{fallback:`Use your mobile camera to capture a document`,key:`fromMobileDesktop`},fromCameraGalleryMobile:{fallback:`Capture a document using the mobile's camera or upload it from gallery`,key:`fromCameraGalleryMobile`},fromGalleryMobile:{fallback:`Pick a document from the gallery and upload it`,key:`fromGalleryMobile`},gallery:{fallback:`Gallery`,key:`gallery`},files:{fallback:`Files`,key:`files`},returnToComputer:{fallback:`Return to the computer`,key:`returnToComputer`},documentCaptured:{fallback:`Your document has been captured`,key:`documentCaptured`},or:{fallback:`or`,key:`strOr`},continueInBrowser:{fallback:`Click here to continue in browser`,key:`continueInBrowser`},skip:{fallback:`Skip`,key:`strSkip`},flipTheDocument:{fallback:`Flip the document`,key:`documentReaderDocumentReaderLayoutFlipDocument`},tiltTheDocument:{fallback:`Tilt the document`,key:`strTiltDocument`}},jB=s`
|
|
36
36
|
*,
|
|
37
37
|
::after,
|
|
38
38
|
::before {
|
|
@@ -57,11 +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 MB(e,t){if(typeof Reflect==`object`&&typeof Reflect.metadata==`function`)return Reflect.metadata(e,t)}function NB(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 PB,FB=(PB=class extends Ne{constructor(...e){super(...e),this._performType=Jz.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)===ap.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===ap.OK,r=t===ap.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;bB(()=>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.
|
|
61
|
-
document-reader::part(container) {
|
|
62
|
-
font-family: ${o(e.fontFamily)};
|
|
63
|
-
}
|
|
64
|
-
`),e!=null&&e.backgroundMaskColor&&r.push(s`
|
|
60
|
+
`;function MB(e,t){if(typeof Reflect==`object`&&typeof Reflect.metadata==`function`)return Reflect.metadata(e,t)}function NB(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 PB,FB=(PB=class extends Ne{constructor(...e){super(...e),this._performType=Jz.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)===ap.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===ap.OK,r=t===ap.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;bB(()=>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.backgroundMaskColor&&r.push(s`
|
|
65
61
|
document-reader::part(frame-external-background) {
|
|
66
62
|
fill: ${o(e.backgroundMaskColor)};
|
|
67
63
|
}
|
|
@@ -78,7 +74,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
78
74
|
background-color: ${o(e.statusBackgroundColor)};
|
|
79
75
|
}
|
|
80
76
|
`),e!=null&&e.resultStatusTextColor&&r.push(s`
|
|
81
|
-
document-reader::part(info-title) {
|
|
77
|
+
document-reader::part(info-msg-title) {
|
|
82
78
|
color: ${o(e.resultStatusTextColor)};
|
|
83
79
|
}
|
|
84
80
|
`),e!=null&&e.resultStatusBackgroundColor&&r.push(s`
|
|
@@ -102,11 +98,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
102
98
|
font-family: ${o(e.statusTextFontName)};
|
|
103
99
|
}
|
|
104
100
|
`),typeof(e==null?void 0:e.resultStatusTextSize)==`number`&&r.push(s`
|
|
105
|
-
document-reader::part(info-title) {
|
|
101
|
+
document-reader::part(info-msg-title) {
|
|
106
102
|
font-size: ${e.resultStatusTextSize}px;
|
|
107
103
|
}
|
|
108
104
|
`),e!=null&&e.resultStatusTextFontName&&r.push(s`
|
|
109
|
-
document-reader::part(info-title) {
|
|
105
|
+
document-reader::part(info-msg-title) {
|
|
110
106
|
font-family: ${o(e.resultStatusTextFontName)};
|
|
111
107
|
}
|
|
112
108
|
`),e!=null&&e.cameraPreviewBackgroundColor&&r.push(s`
|
|
@@ -277,7 +273,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
277
273
|
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
274
|
fill="#BD7DFF"
|
|
279
275
|
/>
|
|
280
|
-
</svg>`,VB,HB=(VB=class extends Ne{constructor(...e){var t;super(...e),t=this,this._performType=Jz.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 TB(e,oB,sB,cB),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 DB(e,oB,sB);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 bB(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
|
|
276
|
+
</svg>`,VB,HB=(VB=class extends Ne{constructor(...e){var t;super(...e),t=this,this._performType=Jz.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 TB(e,oB,sB,cB),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 DB(e,oB,sB);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,f;let e=yield bB(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),(f=t.props)!=null&&f.isProcessing&&t.props.isProcessing(!1)}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=SB(t),o=a==null||(e=a.backendProcessing)==null?void 0:e.serviceURL;if(!o||!CB(o)){let e=new pB({errorCode:tB.CONFIGURATION_FAILED,message:`serviceURL is not defined or is invalid.`}),t=new fB({errorCode:eB.SCAN_ERROR,underlyingBaseError:e});this.props.perform(t)}r&&a!=null&&a.backendProcessing&&(a.backendProcessing.httpHeaders={Authorization:`Connection ${r}`});let s={processParam:Wz({},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 de`<div
|
|
281
277
|
part="gallery-root"
|
|
282
278
|
class="gallery-root"
|
|
283
279
|
dir="${Xz(n)}"
|
|
@@ -298,4 +294,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
298
294
|
<div class="footer">
|
|
299
295
|
<a href>${BB} </a>
|
|
300
296
|
</div>
|
|
301
|
-
</div>`}},VB.styles=[LB],VB);NB([hB(),MB(`design:type`,Object)],HB.prototype,`props`,void 0),NB([_B(`#file-input`),MB(`design:type`,typeof HTMLInputElement>`u`?Object:HTMLInputElement)],HB.prototype,`_input`,void 0),HB=NB([mB(`document-reader-gallery`)],HB);var UB,WB=!1,GB=class e extends Ne{constructor(...e){super(...e),this.props=null,this.renderVersion=0}setProps(t){if(!e.getSupportedTemplates().includes(t.moduleProps.templateId)){var n;let e=new fB({errorCode:eB.UNKNOWN_STEP,message:`TemplateId ${t.moduleProps.templateId} is not supported`});(n=t.perform)==null||n.call(t,e)}let r=t.moduleProps.failedAssets;if(r&&r.blockingAssets.size>0){var i;let e=new fB({errorCode:eB.IMAGE_LOADING_FAILED,message:`Failed to load image asset${r.blockingAssets.size>1?`s`:``}: ${[...r.blockingAssets].join(`, `)}`});(i=t.perform)==null||i.call(t,e)}this.renderVersion++,this.props=t}static isReady(){return WB}static getSupportedTemplates(){return[$z.DOC_READER,$z.DOC_READER_GALLERY]}static initialize(e){var t,n;let r=e==null||(t=e.docreader)==null?void 0:t.devLicense,i=e==null||(n=e.docreader)==null?void 0:n.module;window.RegulaDocumentSDK=new Nz,console.info(`%cDocument Reader web component version: %s`,`color: #6e56b0;`,window.RegulaDocumentSDK.version.component),Pz().then(()=>{window.RegulaDocumentSDK.initialize({license:r,module:i}).then(()=>WB=!0)})}static deinitialize(){var e;WB=!1,(e=window.RegulaDocumentSDK)==null||e.shutdown()}static getIdentifier(){return nB}
|
|
297
|
+
</div>`}},VB.styles=[LB],VB);NB([hB(),MB(`design:type`,Object)],HB.prototype,`props`,void 0),NB([_B(`#file-input`),MB(`design:type`,typeof HTMLInputElement>`u`?Object:HTMLInputElement)],HB.prototype,`_input`,void 0),HB=NB([mB(`document-reader-gallery`)],HB);var UB,WB=!1,GB=class e extends Ne{constructor(...e){super(...e),this.props=null,this.renderVersion=0}setProps(t){if(!e.getSupportedTemplates().includes(t.moduleProps.templateId)){var n;let e=new fB({errorCode:eB.UNKNOWN_STEP,message:`TemplateId ${t.moduleProps.templateId} is not supported`});(n=t.perform)==null||n.call(t,e)}let r=t.moduleProps.failedAssets;if(r&&r.blockingAssets.size>0){var i;let e=new fB({errorCode:eB.IMAGE_LOADING_FAILED,message:`Failed to load image asset${r.blockingAssets.size>1?`s`:``}: ${[...r.blockingAssets].join(`, `)}`});(i=t.perform)==null||i.call(t,e)}this.renderVersion++,this.props=t}static isReady(){return WB}static getSupportedTemplates(){return[$z.DOC_READER,$z.DOC_READER_GALLERY]}static initialize(e){var t,n;let r=e==null||(t=e.docreader)==null?void 0:t.devLicense,i=e==null||(n=e.docreader)==null?void 0:n.module;window.RegulaDocumentSDK=new Nz,console.info(`%cDocument Reader web component version: %s`,`color: #6e56b0;`,window.RegulaDocumentSDK.version.component),Pz().then(()=>{window.RegulaDocumentSDK.initialize({license:r,module:i}).then(()=>WB=!0)})}static deinitialize(){var e;WB=!1,(e=window.RegulaDocumentSDK)==null||e.shutdown()}static getIdentifier(){return nB}render(){var e;return de`${Be(this.renderVersion,de`${Rz((e=this.props)==null||(e=e.moduleProps)==null?void 0:e.templateId,[[$z.DOC_READER,()=>de`<document-reader-camera .props=${this.props}></document-reader-camera>`],[$z.DOC_READER_GALLERY,()=>de`<document-reader-gallery .props=${this.props}></document-reader-gallery>`]])}`)}`}};return UB=GB,UB.displayName=nB,NB([Lz({attribute:!1}),MB(`design:type`,Object)],GB.prototype,`props`,void 0),NB([Lz({attribute:!1}),MB(`design:type`,Object)],GB.prototype,`renderVersion`,void 0),Kz(nB,GB),e.DocumentIdv=GB,e.ModuleType=lB,e})({});
|
package/dist/main.js
CHANGED
|
@@ -20782,7 +20782,7 @@ function Gz(e, t) {
|
|
|
20782
20782
|
let e = t.getSupportedTemplates();
|
|
20783
20783
|
console.log(`${t == null ? void 0 : t.displayName} supported templates: ${e.join(", ")}`);
|
|
20784
20784
|
} else console.error("Missed \"getSupportedTemplates\" method when register module");
|
|
20785
|
-
if (t.initialize && typeof t.initialize == "function" || console.error(`${t == null ? void 0 : t.displayName} "initialize" method was not implemented`), t.deinitialize && typeof t.deinitialize == "function" || console.error(`${t == null ? void 0 : t.displayName} "deinitialize" method was not implemented`), t.
|
|
20785
|
+
if (t.initialize && typeof t.initialize == "function" || console.error(`${t == null ? void 0 : t.displayName} "initialize" method was not implemented`), t.deinitialize && typeof t.deinitialize == "function" || console.error(`${t == null ? void 0 : t.displayName} "deinitialize" method was not implemented`), t.isReady && typeof t.isReady == "function" || console.error(`${t == null ? void 0 : t.displayName} "isReady" method was not implemented`), t.getIdentifier && typeof t.getIdentifier == "function") {
|
|
20786
20786
|
let e = t.getIdentifier();
|
|
20787
20787
|
console.log(`Module id: ${e}`);
|
|
20788
20788
|
} else console.error("Missed \"getIdentifier\" when register module");
|
|
@@ -20924,17 +20924,16 @@ function yB(e) {
|
|
|
20924
20924
|
return bB.apply(this, arguments);
|
|
20925
20925
|
}
|
|
20926
20926
|
function bB() {
|
|
20927
|
-
return bB = u(function* (e, t =
|
|
20928
|
-
let r = null, i =
|
|
20929
|
-
for (
|
|
20927
|
+
return bB = u(function* (e, t = 120, n = 200) {
|
|
20928
|
+
let r = null, i = 0;
|
|
20929
|
+
for (; i < t;) {
|
|
20930
20930
|
try {
|
|
20931
20931
|
let t = yield e();
|
|
20932
20932
|
if (t != null && t.transactionId) return t;
|
|
20933
|
-
break;
|
|
20934
20933
|
} catch (e) {
|
|
20935
20934
|
r = e;
|
|
20936
20935
|
}
|
|
20937
|
-
|
|
20936
|
+
i < t - 1 && (yield _B(n)), i++;
|
|
20938
20937
|
}
|
|
20939
20938
|
throw r;
|
|
20940
20939
|
}), bB.apply(this, arguments);
|
|
@@ -21296,11 +21295,7 @@ var NB, PB = (NB = class extends Me {
|
|
|
21296
21295
|
}
|
|
21297
21296
|
_prepareCustomizationStyles(e, t, n) {
|
|
21298
21297
|
let r = [];
|
|
21299
|
-
if (e != null && e.
|
|
21300
|
-
document-reader::part(container) {
|
|
21301
|
-
font-family: ${a(e.fontFamily)};
|
|
21302
|
-
}
|
|
21303
|
-
`), e != null && e.backgroundMaskColor && r.push(o`
|
|
21298
|
+
if (e != null && e.backgroundMaskColor && r.push(o`
|
|
21304
21299
|
document-reader::part(frame-external-background) {
|
|
21305
21300
|
fill: ${a(e.backgroundMaskColor)};
|
|
21306
21301
|
}
|
|
@@ -21317,7 +21312,7 @@ var NB, PB = (NB = class extends Me {
|
|
|
21317
21312
|
background-color: ${a(e.statusBackgroundColor)};
|
|
21318
21313
|
}
|
|
21319
21314
|
`), e != null && e.resultStatusTextColor && r.push(o`
|
|
21320
|
-
document-reader::part(info-title) {
|
|
21315
|
+
document-reader::part(info-msg-title) {
|
|
21321
21316
|
color: ${a(e.resultStatusTextColor)};
|
|
21322
21317
|
}
|
|
21323
21318
|
`), e != null && e.resultStatusBackgroundColor && r.push(o`
|
|
@@ -21341,11 +21336,11 @@ var NB, PB = (NB = class extends Me {
|
|
|
21341
21336
|
font-family: ${a(e.statusTextFontName)};
|
|
21342
21337
|
}
|
|
21343
21338
|
`), typeof (e == null ? void 0 : e.resultStatusTextSize) == "number" && r.push(o`
|
|
21344
|
-
document-reader::part(info-title) {
|
|
21339
|
+
document-reader::part(info-msg-title) {
|
|
21345
21340
|
font-size: ${e.resultStatusTextSize}px;
|
|
21346
21341
|
}
|
|
21347
21342
|
`), e != null && e.resultStatusTextFontName && r.push(o`
|
|
21348
|
-
document-reader::part(info-title) {
|
|
21343
|
+
document-reader::part(info-msg-title) {
|
|
21349
21344
|
font-family: ${a(e.resultStatusTextFontName)};
|
|
21350
21345
|
}
|
|
21351
21346
|
`), e != null && e.cameraPreviewBackgroundColor && r.push(o`
|
|
@@ -21687,7 +21682,7 @@ var FB = (e) => e == null ? z : e, IB = o`
|
|
|
21687
21682
|
}
|
|
21688
21683
|
let l = (i = t.props) == null || (i = i.moduleProps) == null ? void 0 : i.finalizePackageSettings;
|
|
21689
21684
|
try {
|
|
21690
|
-
var d;
|
|
21685
|
+
var d, f;
|
|
21691
21686
|
let e = yield yB(u(function* () {
|
|
21692
21687
|
return window.RegulaDocumentSDK.finalizePackage();
|
|
21693
21688
|
}), l == null ? void 0 : l.retryCount, l == null ? void 0 : l.retryDelay), n = {
|
|
@@ -21696,10 +21691,10 @@ var FB = (e) => e == null ? z : e, IB = o`
|
|
|
21696
21691
|
has_nfc: !1,
|
|
21697
21692
|
errorCode: ""
|
|
21698
21693
|
};
|
|
21699
|
-
(d = t.props) == null || d.perform(n, t._performType);
|
|
21694
|
+
(d = t.props) == null || d.perform(n, t._performType), (f = t.props) != null && f.isProcessing && t.props.isProcessing(!1);
|
|
21700
21695
|
} catch (e) {
|
|
21701
|
-
var
|
|
21702
|
-
console.log("finalizePackage error: ", e), (
|
|
21696
|
+
var p;
|
|
21697
|
+
console.log("finalizePackage error: ", e), (p = t.props) == null || p.perform({
|
|
21703
21698
|
transactionId: "",
|
|
21704
21699
|
cancel: !0,
|
|
21705
21700
|
has_nfc: !1,
|
|
@@ -21824,7 +21819,6 @@ var HB, UB = !1, WB = class e extends Me {
|
|
|
21824
21819
|
static getIdentifier() {
|
|
21825
21820
|
return tB;
|
|
21826
21821
|
}
|
|
21827
|
-
static cancel() {}
|
|
21828
21822
|
render() {
|
|
21829
21823
|
var e;
|
|
21830
21824
|
return de`${ze(this.renderVersion, de`${Lz((e = this.props) == null || (e = e.moduleProps) == null ? void 0 : e.templateId, [[Qz.DOC_READER, () => de`<document-reader-camera .props=${this.props}></document-reader-camera>`], [Qz.DOC_READER_GALLERY, () => de`<document-reader-gallery .props=${this.props}></document-reader-gallery>`]])}`)}`;
|
package/package.json
CHANGED