UNPKG

@scandit/web-datacapture-id

Version:

Scandit Data Capture SDK for the Web

11 lines 147 kB
import{AdditionalLayerPosition as e,BrowserHelper as t,Brush as n,CameraSettings as r,Color as i,DataCaptureContext as a,DataCaptureError as o,DataCaptureLoader as s,Feedback as c,FocusGestureStrategy as l,INTERNAL_ACCESS as u,Localization as d,Logger as f,Point as p,Quadrilateral as m,Sound as h,VideoResolution as ee,assertUnreachable as te}from"@scandit/web-datacapture-core";import{SafeStorage as ne}from"@scandit/web-datacapture-core/build/js/private/utils/safeStorage.js";import{ScanditHTMLElement as re,css as ie,defineCustomElements as ae,html as oe}from"@scandit/web-datacapture-core/build/js/private/utils/index.js";let se=function(e){return e.Undefined=`Undefined`,e.RecoveredAfterFailure=`RecoveredAfterFailure`,e.InvalidLicenseKeyForVIZProcessing=`InvalidLicenseKeyForVIZProcessing`,e.InvalidSettingsForVIZProcessing=`InvalidSettingsForVIZProcessing`,e.InvalidLicenseKeyForParser=`InvalidLicenseKeyForParser`,e}({});var g=class e extends Error{constructor(...e){super(...e),this._type=`Undefined`,this._message=``}get type(){return this._type}get message(){return this._message}static create(t){let n=new e;return t&&(n.name=t.type,n._type=t.type,n._message=t.message),n}static fromJSON(t){let n=new e;return n._type=t.type,n._message=t.message,n}},ce=class{constructor(e){this.idCaptureWorkerManager=e}get workerCommand(){return this.idCaptureWorkerManager.workerCommand.bind(this.idCaptureWorkerManager)}async getLicenseText(){return(await this.workerCommand(`getIdOpenSourceSoftwareLicenseInfo`,{})).licenseText}};const le={"id.idCaptureOverlay.scanFrontSideHint":``,"id.idCaptureOverlay.scanBackSideHint":``,"id.idCaptureOverlay.moveCloseTextHint":``,"id.idCaptureOverlay.moveFurtherAwayTextHint":``,"id.idCaptureOverlay.tapShutterToScan":``,"id.idCaptureOverlay.lookingForDocument":``,"id.idCaptureOverlay.holdStill":``,"id.idCaptureOverlay.processingDocument":`Processing...`};var ue=`id-worker-8.5.0.js`;function de(e){try{var t=e.endsWith(`/`)?e:e+`/`;return new URL(ue,t).href}catch(t){var n=t instanceof Error?t.message:String(t);throw Error(`Invalid worker URL: `+e+`/`+ue+` (`+n+`)`)}}function fe(e){try{return new URL(e).origin===location.origin}catch(n){var t=n instanceof Error?n.message:String(n);return console.warn(`Could not determine origin for worker URL "`+e+`": `+t+`. Defaulting to cross-origin path.`),!1}}function pe(e,t){/javascript|ecmascript/i.test(e.type)||(e=new Blob([e],{type:`application/javascript`}));var n=URL.createObjectURL(e),r=new Worker(n,{name:t});return setTimeout(function(){URL.revokeObjectURL(n)},0),r}async function me(e){if(!e||!e.libraryLocation)throw Error(`ExternalWorker requires options.libraryLocation`);var t=de(e.libraryLocation);try{var n=await fetch(t,fe(t)?{}:{mode:`cors`});if(!n.ok)throw Error(`Failed to load worker script: `+t+` (status `+n.status+`)`);var r=await n.blob();return fe(t)?new Worker(t,{name:e.name}):pe(r,e.name)}catch(e){throw e instanceof Error&&e.message.startsWith(`Failed to load worker script:`)?e:Error(`Failed to load worker script: `+t+` (`+(e instanceof Error?e.message:e)+`)`)}}var he=class e extends s{constructor(...e){super(...e),this._name=`IdCapture`}get dataCaptureWorker(){if(!this._dataCaptureWorker)throw Error(`Worker not initialized. Use IdCaptureWorkerManager.create() to instantiate.`);return this._dataCaptureWorker}get name(){return this._name}get fixedWasmMemory(){return t.isIPhone()&&t.isSafari()?300:null}async createDataCaptureWorker(){return await me({name:this.name,libraryLocation:this.libraryLocation})}static async create(t){let n=new e(t);return n._dataCaptureWorker=await n.createDataCaptureWorker(),n.addWorkerMessageListener(),n.workerCommand(`setLogLevel`,{level:n.logLevel}),await n.load(),n}async workerCommand(...e){let[t,n,r]=e;return new Promise((e,i)=>{let a=this.workerCommandId++;this.workerTasks.set(a,{resolve:e,reject:i,command:t});let o={...n,command:t,id:a};this.dataCaptureWorker.postMessage(o,r)})}}; /** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: Apache-2.0 */ const ge=Symbol(`Comlink.proxy`),_e=Symbol(`Comlink.endpoint`),ve=Symbol(`Comlink.releaseProxy`),ye=Symbol(`Comlink.finalizer`),_=Symbol(`Comlink.thrown`),be=e=>typeof e==`object`&&!!e||typeof e==`function`,xe=new Map([[`proxy`,{canHandle:e=>be(e)&&e[ge],serialize(e){let{port1:t,port2:n}=new MessageChannel;return Ce(e,t),[n,[n]]},deserialize(e){return e.start(),Ee(e)}}],[`throw`,{canHandle:e=>be(e)&&_ in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){throw e.isError?Object.assign(Error(e.value.message),e.value):e.value}}]]);function Se(e,t){for(let n of e)if(t===n||n===`*`||n instanceof RegExp&&n.test(t))return!0;return!1}function Ce(e,t=globalThis,n=[`*`]){t.addEventListener(`message`,function r(i){if(!i||!i.data)return;if(!Se(n,i.origin)){console.warn(`Invalid origin '${i.origin}' for comlink proxy`);return}let{id:a,type:o,path:s}=Object.assign({path:[]},i.data),c=(i.data.argumentList||[]).map(C),l;try{let t=s.slice(0,-1).reduce((e,t)=>e[t],e),n=s.reduce((e,t)=>e[t],e);switch(o){case`GET`:l=n;break;case`SET`:t[s.slice(-1)[0]]=C(i.data.value),l=!0;break;case`APPLY`:l=n.apply(t,c);break;case`CONSTRUCT`:l=Pe(new n(...c));break;case`ENDPOINT`:{let{port1:t,port2:n}=new MessageChannel;Ce(e,n),l=Ne(t,[t])}break;case`RELEASE`:l=void 0;break;default:return}}catch(e){l={value:e,[_]:0}}Promise.resolve(l).catch(e=>({value:e,[_]:0})).then(n=>{let[i,s]=S(n);t.postMessage(Object.assign(Object.assign({},i),{id:a}),s),o===`RELEASE`&&(t.removeEventListener(`message`,r),Te(t),ye in e&&typeof e[ye]==`function`&&e[ye]())}).catch(e=>{let[n,r]=S({value:TypeError(`Unserializable return value`),[_]:0});t.postMessage(Object.assign(Object.assign({},n),{id:a}),r)})}),t.start&&t.start()}function we(e){return e.constructor.name===`MessagePort`}function Te(e){we(e)&&e.close()}function Ee(e,t){let n=new Map;return e.addEventListener(`message`,function(e){let{data:t}=e;if(!t||!t.id)return;let r=n.get(t.id);if(r)try{r(t)}finally{n.delete(t.id)}}),x(e,n,[],t)}function v(e){if(e)throw Error(`Proxy has been released and is not useable`)}function De(e){return w(e,new Map,{type:`RELEASE`}).then(()=>{Te(e)})}const y=new WeakMap,b=`FinalizationRegistry`in globalThis&&new FinalizationRegistry(e=>{let t=(y.get(e)||0)-1;y.set(e,t),t===0&&De(e)});function Oe(e,t){let n=(y.get(t)||0)+1;y.set(t,n),b&&b.register(e,t,e)}function ke(e){b&&b.unregister(e)}function x(e,t,n=[],r=function(){}){let i=!1,a=new Proxy(r,{get(r,o){if(v(i),o===ve)return()=>{ke(a),De(e),t.clear(),i=!0};if(o===`then`){if(n.length===0)return{then:()=>a};let r=w(e,t,{type:`GET`,path:n.map(e=>e.toString())}).then(C);return r.then.bind(r)}return x(e,t,[...n,o])},set(r,a,o){v(i);let[s,c]=S(o);return w(e,t,{type:`SET`,path:[...n,a].map(e=>e.toString()),value:s},c).then(C)},apply(r,a,o){v(i);let s=n[n.length-1];if(s===_e)return w(e,t,{type:`ENDPOINT`}).then(C);if(s===`bind`)return x(e,t,n.slice(0,-1));let[c,l]=je(o);return w(e,t,{type:`APPLY`,path:n.map(e=>e.toString()),argumentList:c},l).then(C)},construct(r,a){v(i);let[o,s]=je(a);return w(e,t,{type:`CONSTRUCT`,path:n.map(e=>e.toString()),argumentList:o},s).then(C)}});return Oe(a,e),a}function Ae(e){return Array.prototype.concat.apply([],e)}function je(e){let t=e.map(S);return[t.map(e=>e[0]),Ae(t.map(e=>e[1]))]}const Me=new WeakMap;function Ne(e,t){return Me.set(e,t),e}function Pe(e){return Object.assign(e,{[ge]:!0})}function S(e){for(let[t,n]of xe)if(n.canHandle(e)){let[r,i]=n.serialize(e);return[{type:`HANDLER`,name:t,value:r},i]}return[{type:`RAW`,value:e},Me.get(e)||[]]}function C(e){switch(e.type){case`HANDLER`:return xe.get(e.name).deserialize(e.value);case`RAW`:return e.value}}function w(e,t,n,r){return new Promise(i=>{let a=Fe();t.set(a,i),e.start&&e.start(),e.postMessage(Object.assign({id:a},n),r)})}function Fe(){return[,,,,].fill(0).map(()=>Math.floor(Math.random()*(2**53-1)).toString(16)).join(`-`)}var Ie=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),Le=Re([``,``],[``,``]);function Re(e,t){return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function ze(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}var T=function(){function e(){for(var t=this,n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return ze(this,e),this.tag=function(e){var n=[...arguments].slice(1);return typeof e==`function`?t.interimTag.bind(t,e):typeof e==`string`?t.transformEndResult(e):(e=e.map(t.transformString.bind(t)),t.transformEndResult(e.reduce(t.processSubstitutions.bind(t,n))))},r.length>0&&Array.isArray(r[0])&&(r=r[0]),this.transformers=r.map(function(e){return typeof e==`function`?e():e}),this.tag}return Ie(e,[{key:`interimTag`,value:function(e,t){var n=[...arguments].slice(2);return this.tag(Le,e.apply(void 0,[t].concat(n)))}},{key:`processSubstitutions`,value:function(e,t,n){return`${t}${this.transformSubstitution(e.shift(),t)}${n}`}},{key:`transformString`,value:function(e){return this.transformers.reduce(function(e,t){return t.onString?t.onString(e):e},e)}},{key:`transformSubstitution`,value:function(e,t){return this.transformers.reduce(function(e,n){return n.onSubstitution?n.onSubstitution(e,t):e},e)}},{key:`transformEndResult`,value:function(e){return this.transformers.reduce(function(e,t){return t.onEndResult?t.onEndResult(e):e},e)}}]),e}(),E=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:``;return{onEndResult:function(t){if(e===``)return t.trim();if(e=e.toLowerCase(),e===`start`||e===`left`)return t.replace(/^\s*/,``);if(e===`end`||e===`right`)return t.replace(/\s*$/,``);throw Error(`Side not supported: `+e)}}};function Be(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}else return Array.from(e)}var D=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:`initial`;return{onEndResult:function(t){if(e===`initial`){var n=t.match(/^[^\S\n]*(?=\S)/gm),r=n&&Math.min.apply(Math,Be(n.map(function(e){return e.length})));if(r){var i=RegExp(`^.{`+r+`}`,`gm`);return t.replace(i,``)}return t}if(e===`all`)return t.replace(/^[^\S\n]+/gm,``);throw Error(`Unknown type: `+e)}}},O=function(e,t){return{onEndResult:function(n){if(e==null||t==null)throw Error(`replaceResultTransformer requires at least 2 arguments.`);return n.replace(e,t)}}},k=function(e,t){return{onSubstitution:function(n,r){if(e==null||t==null)throw Error(`replaceSubstitutionTransformer requires at least 2 arguments.`);return n==null?n:n.toString().replace(e,t)}}},Ve={separator:``,conjunction:``,serial:!1},A=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ve;return{onSubstitution:function(t,n){if(Array.isArray(t)){var r=t.length,i=e.separator,a=e.conjunction,o=e.serial,s=n.match(/(\n?[^\S\n]+)$/);if(t=s?t.join(i+s[1]):t.join(i+` `),a&&r>1){var c=t.lastIndexOf(i);t=t.slice(0,c)+(o?i:``)+` `+a+t.slice(c+1)}}return t}}},He=function(e){return{onSubstitution:function(t,n){return typeof t==`string`&&t.includes(e)&&(t=t.split(e)),t}}},Ue=function(e){return e!=null&&!Number.isNaN(e)&&typeof e!=`boolean`};new T(A({separator:`,`}),D,E),new T(A({separator:`,`,conjunction:`and`}),D,E),new T(A({separator:`,`,conjunction:`or`}),D,E),new T(He(` `),function(){return{onSubstitution:function(e){return Array.isArray(e)?e.filter(Ue):Ue(e)?e:``}}},A,D,E),new T(He(` `),A,D,E,k(/&/g,`&amp;`),k(/</g,`&lt;`),k(/>/g,`&gt;`),k(/"/g,`&quot;`),k(/'/g,`&#x27;`),k(/`/g,`&#x60;`)),new T(O(/(?:\n(?:\s*))+/g,` `),E);var We=new T(O(/(?:\n\s*)/g,``),E);new T(A({separator:`,`}),O(/(?:\s+)/g,` `),E),new T(A({separator:`,`,conjunction:`or`}),O(/(?:\s+)/g,` `),E),new T(A({separator:`,`,conjunction:`and`}),O(/(?:\s+)/g,` `),E),new T(A,D,E),new T(A,O(/(?:\s+)/g,` `),E),new T(D,E),new T(D(`all`),E);const Ge=`application/javascript`,Ke=(e,t={})=>{let n={skipSameOrigin:!0,useBlob:!0,...t};if(n.skipSameOrigin&&new URL(e).origin===self.location.origin)return Promise.resolve(e);let r;try{let e=new AbortController;r=e.signal;let t=setTimeout(()=>{e.abort()},3e3);r.addEventListener(`abort`,()=>{clearTimeout(t),e.abort()})}catch{}return new Promise((t,i)=>void fetch(e,{signal:r}).then(e=>e.text()).then(e=>{let r=``;if(n.useBlob){let t=new Blob([e],{type:Ge});r=URL.createObjectURL(t)}else r=`data:${Ge},`+encodeURIComponent(e);t(r)}).catch(()=>{i(Error(`Failed to fetch worker from ${e}`))}))};var qe=class extends Error{constructor(e,t){super(e,t),this.name=`FrameTransferError`}};const Je=(e,t)=>{let n=t instanceof Error&&t.message?`: ${t.message}`:``;return t instanceof Error?new qe(`${e}${n}`,{cause:t}):new qe(`${e}${n}`)},Ye=e=>e.startsWith(`data:`),Xe=e=>e.startsWith(`blob:`),Ze=e=>!Ye(e)&&!Xe(e),Qe=async e=>{let t=await fetch(e,{method:`HEAD`}),n=t.headers.get(`content-type`),r=n==null?void 0:n.includes(`javascript`);if(n!=null&&n.includes(`html`))throw Error(We`${e} resolved to a resource with the content type ${n}. This is likely an issue with the server configuration redirecting to an index.html file. Check that your resources are properly hosted`);if(!r)throw Error(`Worker file is not a JavaScript file: ${n}`);if(!t.ok)throw Error(`Worker file not found or inaccessible: ${t.status} ${t.statusText}`)};async function $e(e,t){let n=await Ke(new URL(`resources/${t}`,e).toString());Ze(n)&&await Qe(n);let r=new Worker(n,{type:`module`}),i=Ee(r);return r.onerror=e=>{console.error(`Worker error:`,e),i[ve]()},new Proxy(i,{get(e,t,n){return t===`createScanningSession`?async(...t)=>{let n=await e.createScanningSession(...t);return new Proxy(n,{get(e,t,n){return t===`process`?t=>{let n={data:t.data,width:t.width,height:t.height,colorSpace:t.colorSpace??`srgb`},r;try{r=Ne(n,[t.data.buffer])}catch(e){throw Je(`Failed to transfer frame to worker`,e)}return e.process(r)}:Reflect.get(e,t,n)}})}:Reflect.get(e,t,n)}})}function et(){let e=navigator.userAgent;if(/iPad/.test(e)||/Macintosh/.test(e)&&navigator.maxTouchPoints>1)return`iPad`;if(/iPhone/.test(e))return`iPhone`;if(/Macintosh/.test(e))return`Mac`}const tt=[{name:`Facebook In-App`,regex:/FBAV\/([\d.]+)/,getVersion:e=>e[1]},{name:`Instagram In-App`,regex:/Instagram ([\d.]+)/,getVersion:e=>e[1]},{name:`TikTok In-App`,regex:/TikTok/,getVersion:()=>``},{name:`Edge`,regex:/Edg\/([\d.]+)/,getVersion:e=>e[1]},{name:`DuckDuckGo`,regex:/DuckDuckGo\/([\d.]+)/,getVersion:e=>e[1]},{name:`Vivaldi`,regex:/Vivaldi\/([\d.]+)/,getVersion:e=>e[1]},{name:`Opera`,regex:/OPR\/([\d.]+)/,getVersion:e=>e[1]},{name:`Samsung Browser`,regex:/SamsungBrowser\/([\d.]+)/,getVersion:e=>e[1]},{name:`Firefox`,regex:/FxiOS\/([\S]+)/,getVersion:e=>e[1]},{name:`Chrome`,regex:/CriOS\/([\S]+)/,getVersion:e=>e[1]},{name:`Android WebView`,regex:/; wv\)/,getVersion:(e,t)=>{var n;return((n=t.match(/Chrome\/([\d.]+)/))==null?void 0:n[1])??``}},{name:`Brave`,regex:/Brave/,getVersion:(e,t)=>{var n;return((n=t.match(/Chrome\/([\d.]+)/))==null?void 0:n[1])??``}},{name:`Chrome`,regex:/Chrome\/([\d.]+)/,getVersion:e=>e[1]},{name:`Firefox`,regex:/Firefox\/([\d.]+)/,getVersion:e=>e[1]},{name:`Safari`,regex:/Version\/([\d.]+).*Safari/,getVersion:e=>e[1]}];function nt(){var e;let t=navigator.userAgent;for(let e of tt){let n=t.match(e.regex);if(n)return{name:e.name,version:e.getVersion(n,t)}}if((e=window.webkit)!=null&&e.messageHandlers){let e=t.match(/OS ([\d_]+)/);return{name:`iOS WebView`,version:e?e[1].replace(/_/g,`.`):``}}return{name:`Unknown`,version:``}}function rt(e,t){if(!t.versionRegex)return``;let n=e.match(t.versionRegex);return n!=null&&n[1]?t.versionTransform?t.versionTransform(n[1]):n[1]:``}function it(){let e=navigator.userAgent,t={"10.0":`10 or 11`,6.3:`8.1`,6.2:`8`,6.1:`7`},n=[{os:`iPadOS`,condition:/Macintosh/.test(e)&&navigator.maxTouchPoints>1,versionRegex:/Mac OS X ([\d_]+)/,versionTransform:e=>e.replace(/_/g,`.`)},{os:`iOS`,condition:/iPhone/.test(e),versionRegex:/iPhone OS ([\d_]+)/,versionTransform:e=>e.replace(/_/g,`.`)},{os:`macOS`,condition:/Macintosh/.test(e),versionRegex:/Mac OS X ([\d_]+)/,versionTransform:e=>e.replace(/_/g,`.`)},{os:`Windows`,condition:/Win/.test(e),versionRegex:/Windows NT ([\d.]+)/,versionTransform:e=>t[e]||e},{os:`Android`,condition:/Android/.test(e),versionRegex:/Android ([\d.]+)/},{os:`Linux`,condition:/Linux/.test(e)}];for(let t of n)if(t.condition){let n=rt(e,t);return{os:t.os,version:n}}return{os:``,version:``}}function at(e,t){var n,r,i,a,o;let s=et(),c=``;if(t!=null&&t.model)c=t.model;else if(s)c=s;else{let t=e.match(/Android.*?; ([^)]+)\)/);t!=null&&t[1]&&(c=t[1])}let l=[`Desktop`];!(t==null||(n=t.formFactors)==null)&&n.length?l=t.formFactors:t!=null&&t.mobile?l=[`Mobile`]:s&&(s===`iPhone`?l=[`Mobile`]:s===`iPad`&&(l=[`Tablet`]));let u=``;u=t!=null&&t.platform?t.platform:it().os;let d=``,f=``;if(!(t==null||(r=t.brands)==null)&&r.length)d=((i=t.brands.find(e=>!/not.a.brand/i.test(e.brand)&&e.brand!==`Chromium`)??t.brands.find(e=>!/not.a.brand/i.test(e.brand)))==null?void 0:i.brand)??``,f=t.fullVersionList?((a=t.fullVersionList.find(e=>e.brand===d))==null?void 0:a.version)??``:((o=t.brands.find(e=>e.brand===d))==null?void 0:o.version)??``;else{let e=nt();d=e.name,f=e.version}return c===``&&u===`macOS`&&(c=`Mac`),{model:c,formFactors:l,platform:u,browser:{brand:d,version:f}}}function ot(){let e=document.createElement(`canvas`).getContext(`webgl`);if(e&&e instanceof WebGLRenderingContext){let t=e.getExtension(`WEBGL_debug_renderer_info`);return{renderer:t?e.getParameter(t.UNMASKED_RENDERER_WEBGL):e.getParameter(e.RENDERER),shadingLanguageVersion:e.getParameter(e.SHADING_LANGUAGE_VERSION),vendor:t?e.getParameter(t.UNMASKED_VENDOR_WEBGL):e.getParameter(e.VENDOR),version:e.getParameter(e.VERSION)}}}function st(){try{let e=`__storage_test__`;return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch{return!1}}async function ct(){let e;try{var t;e=await((t=navigator.userAgentData)==null?void 0:t.getHighEntropyValues([`brands`,`mobile`,`platform`,`architecture`,`bitness`,`formFactors`,`model`,`platformVersion`,`fullVersionList`,`wow64`]))}catch{}return e}async function lt(){let e=await ct();return{userAgentData:e,userAgent:navigator.userAgent,threads:navigator.hardwareConcurrency,memory:navigator.deviceMemory,gpu:ot(),screen:{screenWidth:window.screen.width,screenHeight:window.screen.height,devicePixelRatio:window.devicePixelRatio,physicalScreenWidth:window.screen.width*window.devicePixelRatio,physicalScreenHeight:window.screen.height*window.devicePixelRatio,maxTouchPoints:navigator.maxTouchPoints},browserStorageSupport:{cookieEnabled:navigator.cookieEnabled,localStorageEnabled:st()},derivedDeviceInfo:at(navigator.userAgent,e)}}let ut=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((e,t)=>(t&=63,t<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+=`-`:e+=`_`,e),``);function dt(e){if(!ft())return ut();let t=localStorage.getItem(e);if(t)return t;let n=ut();return localStorage.setItem(e,n),n}function ft(){try{return localStorage.setItem(`test`,`test`),localStorage.removeItem(`test`),!0}catch{return!1}}async function pt(){let e=await lt();if(e.derivedDeviceInfo.formFactors.some(e=>e===`Mobile`||e===`Tablet`)&&e.memory!==void 0)return e.memory<4}const mt={inputImageSource:`video`,scanningMode:`automatic`,scanningSettings:{allowUncertainFrontSideScan:!1,blurDetectionLevel:`mid`,glareDetectionLevel:`mid`,tiltDetectionLevel:`mid`,skipImagesWithBlur:!0,skipImagesWithGlare:!0,skipImagesOccludedByHand:!0,skipImagesWithInadequateLightingConditions:!0,combineResultsFromMultipleInputImages:!0,croppedImageSettings:{dotsPerInch:250,extensionFactor:0,returnDocumentImage:!1,returnFaceImage:!1,returnSignatureImage:!1},customDocumentAnonymizationSettings:[],customDocumentRules:[],enableBarcodeScanOnly:!1,enableCharacterValidation:!0,inputImageMargin:.02,maxAllowedMismatchesPerField:0,recognitionModeFilter:{enableBarcodeId:!0,enableFullDocumentRecognition:!0,enableMrzId:!0,enableMrzPassport:!0,enableMrzVisa:!0,enablePhotoId:!0},returnInputImages:!1,scanCroppedDocumentImage:!1,scanPassportDataPageOnly:!0,scanUnsupportedBack:!1,anonymizationMode:`full-result`}};async function ht(e,t){let n=await $e(e.resourcesLocation??window.location.href,`centaurus-worker.js`);e.userId||=dt(`centaurus-userid`),e.resourcesLocation||=window.location.href,e.useLightweightBuild===void 0&&(e.useLightweightBuild=await pt());let r=t?Pe(t):void 0;try{return await n[atob(`aW5pdEJsaW5rSWQ=`)](e,mt,r),n}catch(e){throw Error(`Failed to initialize Centaurus`,{cause:e})}}const gt=Symbol();globalThis.__CENTAURUS_CORE__||=gt,globalThis.__CENTAURUS_CORE__!==gt&&console.warn(`Detected multiple instances of Centaurus. This can lead to unexpected behavior.`);const j=(...e)=>void 0,M=j,_t=j,vt=j,yt=new Map;yt.set([77,105,99,114,111,98,108,105,110,107],`Scandit`),yt.set([66,108,105,110,107,73,68],`ID Capture`);var N=class e{static async load(t){let n=new e;try{await n.initCentaurus(t)}catch(e){throw n.createErrorFromCentaurusError(e)}return n}static unload(){var t;(t=e.wasmSDK)==null||t.terminate(),e.wasmSDK=void 0,M(`CentaurusLoader: unload complete`)}static replaceCentaurusMentions(e,t){return typeof e==`string`?[...t.entries()].reduce((e,[t,n])=>{let r=t.map(e=>String.fromCodePoint(e)).join(``);return e.replace(new RegExp(r,`gi`),n)},e):`(no message)`}createErrorFromCentaurusError(e){return e instanceof Error&&(e.cause instanceof Error?e.cause:e).name===`LicenseError`?new o({name:`IdCaptureLoadingError`,message:`Error 260: The Scandit SDK license validation failed. Your license key does not include support for this domain (Centaurus error).`}):new o({name:`IdCaptureLoadingError`,message:`Error while loading Centaurus library.`})}static async getWasmType(){let[e,n]=await Promise.all([t.hasSIMDSupport(),t.hasThreadsSupport()]);return e&&!t.isSIMDBroken()?n&&t.isDesktopDevice()?`advanced-threads`:`advanced`:`basic`}async initCentaurus(t){e.licenseKey=t.licenseKey;let n=new URL(`8.5.0/`,t.libraryLocation).toString();e.wasmSDK=await ht({licenseKey:t.licenseKey,initialMemory:500,resourcesLocation:n,useLightweightBuild:!0,wasmVariant:await e.getWasmType()},({progress:e})=>{var n;(n=t.loadProgressNotifier)==null||n.call(t,{percentage:e,privateUri:new URL(`Centaurus.wasm`,t.libraryLocation).toString()})})}};function bt(e){if(typeof e!=`function`)return;let t=Object.keys({"scandit-datacapture-sdk-id-simd-pthreads.wasm":{bytes:9133200},"scandit-datacapture-sdk-id-pthreads.wasm":{bytes:9177107},"scandit-datacapture-sdk-id.wasm":{bytes:9300918},"scandit-datacapture-sdk-id-simd.wasm":{bytes:9243489}});return function(n){if(n.percentage===null){e(n);return}let{pathname:r}=new URL(n.privateUri,document.baseURI),i={...n};t.some(e=>r.endsWith(e))?i.percentage=43*n.percentage/100:r.endsWith(`Centaurus.wasm`)&&(i.percentage=43+57*n.percentage/100),e(i)}}let xt=function(e){return e.Authentic=`authentic`,e.LikelyForged=`likelyForged`,e.Forged=`forged`,e}({});var St=class e{get allChecksPassed(){return this.status===`authentic`}get error(){var e;return((e=this.json)==null?void 0:e.error)??null}get status(){var e;return((e=this.json)==null?void 0:e.status)??null}static fromJSON(t){let n=new e;return n.json=t,n}},Ct=class e{constructor(e){this._useStagingEnv=!1,this._context=e}static async create(t){return new e(t)}async verify(e){var t;let n=await this._context.workerCommand(`idCaptureBarcodeVerifyAamvaCapture`,{capturedId:e.toJSONObject(),useStagingEnv:this._useStagingEnv});return((t=n.result)==null?void 0:t.error)!=null&&f.log(f.Level.Warn,`Error during Aamva verification:`,n.result.error),St.fromJSON(n.result)}},wt=class{constructor(e,t,n){this._days=e,this._months=t,this._years=n}get days(){return this._days}get months(){return this._months}get years(){return this._years}toJSONObject(){return{days:this.days,months:this.months,years:this.years}}};let Tt=function(e){return e.FrontOnly=`frontOnly`,e.FrontAndBack=`frontAndBack`,e}({}),Et=function(e){return e.Face=`face`,e.CroppedDocument=`croppedDocument`,e.Frame=`frame`,e}({}),Dt=function(e){return e.Front=`front`,e.Back=`back`,e}({}),Ot=function(e){return e.None=`none`,e.FieldsOnly=`fieldsOnly`,e.ImagesOnly=`imagesOnly`,e.FieldsAndImages=`fieldsAndImages`,e}({}),kt=function(e){return e.Auto=`auto`,e.ButtonTap=`buttonTap`,e}({}),At=function(e){return e.AdditionalAddressInformation=`additionalAddressInformation`,e.AdditionalNameInformation=`additionalNameInformation`,e.Address=`address`,e.Age=`age`,e.BarcodeDictionary=`barcodeDictionary`,e.BloodType=`bloodType`,e.DateOfBirth=`dateOfBirth`,e.DateOfExpiry=`dateOfExpiry`,e.DateOfIssue=`dateOfIssue`,e.DocumentAdditionalNumber=`documentAdditionalNumber`,e.DocumentNumber=`documentNumber`,e.Employer=`employer`,e.FathersName=`fathersName`,e.FirstName=`firstName`,e.FullName=`fullName`,e.IssuingAuthority=`issuingAuthority`,e.LastName=`lastName`,e.MaritalStatus=`maritalStatus`,e.MothersName=`mothersName`,e.MrzOptionalDataInLine1=`mrzOptionalDataInLine1`,e.MrzOptionalDataInLine2=`mrzOptionalDataInLine2`,e.Nationality=`nationality`,e.PersonalIdNumber=`personalIdNumber`,e.PlaceOfBirth=`placeOfBirth`,e.Profession=`profession`,e.Race=`race`,e.Religion=`religion`,e.ResidentialStatus=`residentialStatus`,e.Sex=`sex`,e}({}),jt=function(e){return e.Rounded=`rounded`,e.Square=`square`,e}({}),Mt=function(e){return e.Light=`light`,e.Bold=`bold`,e}({}),Nt=function(e){return e.NotAvailable=`notAvailable`,e.NotRealIdCompliant=`notRealIdCompliant`,e.RealIdCompliant=`realIdCompliant`,e}({}),Pt=function(e){return e.Female=`female`,e.Male=`male`,e.Unspecified=`unspecified`,e}({}),Ft=function(e){return e.Approved=`approved`,e.Granted=`granted`,e.Pending=`pending`,e.Denied=`denied`,e.Revoked=`revoked`,e.Expired=`expired`,e.Cancelled=`cancelled`,e.Other=`other`,e.Unknown=`unknown`,e}({});var It=class e{constructor(){this.idCaptured=c.defaultFeedback,this.idRejected=new c(null,null)}static get defaultFeedback(){return new e}static get defaultSuccessSound(){return h.defaultSound}static get defaultFailureSound(){return new h(`data:audio/mpeg;base64,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qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRk4Y/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRk4Y/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRk4Y/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRk4Y/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRk4Y/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRk4Y/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqo=`)}toJSONObject(){return{idCaptured:this.idCaptured.toJSONObject(),idRejected:this.idRejected.toJSONObject()}}};let Lt=function(e){return e.Passport=`passport`,e.IdCard=`idCard`,e.DriverLicense=`driverLicense`,e.VisaIcao=`visaIcao`,e.ResidencePermit=`residencePermit`,e.HealthInsuranceCard=`healthInsuranceCard`,e.RegionSpecific=`regionSpecific`,e.VisaLetter=`visaLetter`,e}({});var P=class{constructor(e){this._region=e}get region(){return this._region}isPassport(){return this.documentType===`passport`}isIdCard(){return this.documentType===`idCard`}isDriverLicense(){return this.documentType===`driverLicense`}isVisaIcao(){return this.documentType===`visaIcao`}isVisaLetter(){return this.documentType===`visaLetter`}isHealthInsuranceCard(){return this.documentType===`healthInsuranceCard`}isResidencePermit(){return this.documentType===`residencePermit`}isRegionSpecific(){return this.documentType===`regionSpecific`}},Rt=class e{constructor(){this.json={}}get errorCorrection(){return this.json.errorCorrection}get moduleCountX(){return this.json.moduleCountX}get moduleCountY(){return this.json.moduleCountY}static fromJSON(t){if(t==null)return null;let n=new e;return n.json=t,n}toJSONObject(){return{errorCorrection:this.errorCorrection,moduleCountX:this.moduleCountX,moduleCountY:this.moduleCountY}}},F=class e{constructor(){this.json={}}get day(){return this.json.day}get month(){return this.json.month}get year(){return this.json.year}get localDate(){return new Date(this.json.year,this.json.month?this.json.month-1:0,this.json.day||1)}get utcDate(){return new Date(Date.UTC(this.json.year,this.json.month?this.json.month-1:0,this.json.day||1))}static fromJSON(t){if(t==null)return null;let n=new e;return n.json=t,n}toJSONObject(){return{day:this.day,month:this.month,year:this.year}}},zt=class e{get dateOfExpiry(){return F.fromJSON(this.json.dateOfExpiry)??new F}get codes(){return this.json.codes}static fromJSON(t){if(t===null)return null;let n=new e;return n.json=t,n}toJSONObject(){return{codes:[...this.codes],dateOfExpiry:this.dateOfExpiry.toJSONObject()}}},Bt=class e{get vehicleCode(){return this.json.vehicleCode}get vehicleRestriction(){return this.json.vehicleRestriction}get dateOfIssue(){return F.fromJSON(this.json.dateOfIssue)??new F}static fromJSON(t){if(t===null)return null;let n=new e;return n.json=t,n}toJSONObject(){return{dateOfIssue:this.dateOfIssue.toJSONObject(),vehicleCode:this.vehicleCode,vehicleRestriction:this.vehicleRestriction}}},Vt=class e{get aamvaVersion(){return this.json.aamvaVersion}get aliasFamilyName(){return this.json.aliasFamilyName}get aliasGivenName(){return this.json.aliasGivenName}get aliasSuffixName(){return this.json.aliasSuffixName}get bloodType(){return this.json.bloodType}get branchOfService(){return this.json.branchOfService}get cardInstanceIdentifier(){return this.json.cardInstanceIdentifier}get cardRevisionDate(){return F.fromJSON(this.json.cardRevisionDate)}get categories(){return this.json.categories==null?[]:this.json.categories}get champusEffectiveDate(){return F.fromJSON(this.json.champusEffectiveDate)}get champusExpiryDate(){return F.fromJSON(this.json.champusExpiryDate)}get citizenshipStatus(){return this.json.citizenshipStatus}get civilianHealthCareFlagCode(){return this.json.civilianHealthCareFlagCode}get civilianHealthCareFlagDescription(){return this.json.civilianHealthCareFlagDescription}get commissaryFlagCode(){return this.json.commissaryFlagCode}get commissaryFlagDescription(){return this.json.commissaryFlagDescription}get countryOfBirth(){return this.json.countryOfBirth}get countryOfBirthIso(){return this.json.countryOfBirthIso}get deersDependentSuffixCode(){return this.json.deersDependentSuffixCode}get deersDependentSuffixDescription(){return this.json.deersDependentSuffixDescription}get directCareFlagCode(){return this.json.directCareFlagCode}get directCareFlagDescription(){return this.json.directCareFlagDescription}get documentCopy(){return this.json.documentCopy}get documentDiscriminatorNumber(){return this.json.documentDiscriminatorNumber}get driverNamePrefix(){return this.json.driverNamePrefix}get driverNameSuffix(){return this.json.driverNameSuffix}get driverRestrictionCodes(){return this.json.driverRestrictionCodes==null?[]:this.json.driverRestrictionCodes}get ediPersonIdentifier(){return this.json.ediPersonIdentifier}get endorsementsCode(){return this.json.endorsementsCode}get exchangeFlagCode(){return this.json.exchangeFlagCode}get exchangeFlagDescription(){return this.json.exchangeFlagDescription}get eyeColor(){return this.json.eyeColor}get familySequenceNumber(){return this.json.familySequenceNumber}get firstNameTruncation(){return this.json.firstNameTruncation}get firstNameWithoutMiddleName(){return this.json.firstNameWithoutMiddleName}get formNumber(){return this.json.formNumber}get genevaConventionCategory(){return this.json.genevaConventionCategory}get hairColor(){return this.json.hairColor}get heightCm(){return this.json.heightCm}get heightInch(){return this.json.heightInch}get IIN(){return this.json.iin}get identificationType(){return this.json.identificationType}get issuingJurisdiction(){return this.json.issuingJurisdiction}get issuingJurisdictionIso(){return this.json.issuingJurisdictionIso}get barcodeMetadata(){return Rt.fromJSON(this.json.barcodeMetadata)}get jpegData(){return this.json.jpegData}get jurisdictionVersion(){return this.json.jurisdictionVersion}get lastNameTruncation(){return this.json.lastNameTruncation}get licenseCountryOfIssue(){return this.json.licenseCountryOfIssue}get middleName(){return this.json.middleName}get middleNameTruncation(){return this.json.middleNameTruncation}get mwrFlagCode(){return this.json.mwrFlagCode}get mwrFlagDescription(){return this.json.mwrFlagDescription}get payGrade(){return this.json.payGrade}get payPlanCode(){return this.json.payPlanCode}get payPlanGradeCode(){return this.json.payPlanGradeCode}get personDesignatorDocument(){return this.json.personDesignatorDocument}get personDesignatorTypeCode(){return this.json.personDesignatorTypeCode}get personMiddleInitial(){return this.json.personMiddleInitial}get personalIdNumber(){return this.json.personalIdNumber}get personalIdNumberType(){return this.json.personalIdNumberType}get personnelCategoryCode(){return this.json.personnelCategoryCode}get personnelEntitlementConditionType(){return this.json.personnelEntitlementConditionType}get placeOfBirth(){return this.json.placeOfBirth}get professionalDrivingPermit(){return this.json.professionalDrivingPermit==null?null:zt.fromJSON(this.json.professionalDrivingPermit)}get race(){return this.json.race}get rank(){return this.json.rank}get rawData(){return this.json.rawData}get relationshipCode(){return this.json.relationshipCode}get relationshipDescription(){return this.json.relationshipDescription}get restrictionsCode(){return this.json.restrictionsCode}get securityCode(){return this.json.securityCode}get serviceCode(){return this.json.serviceCode}get sponsorFlag(){return this.json.sponsorFlag}get sponsorName(){return this.json.sponsorName}get sponsorPersonDesignatorIdentifier(){return this.json.sponsorPersonDesignatorIdentifier}get statusCode(){return this.json.statusCode}get statusCodeDescription(){return this.json.statusCodeDescription}get vehicleClass(){return this.json.vehicleClass}get vehicleRestrictions(){return this.json.vehicleRestrictions==null?[]:this.json.vehicleRestrictions.map(e=>Bt.fromJSON(e)).filter(e=>e!=null)}get version(){return this.json.version}get weightKg(){return this.json.weightKg}get weightLbs(){return this.json.weightLbs}get isRealId(){return this.json.isRealId}get firstName(){return this.json.firstName}get lastName(){return this.json.lastName}get fullName(){return this.json.fullName}get sex(){return this.json.sex}get dateOfBirth(){return F.fromJSON(this.json.dateOfBirth)}get nationality(){return this.json.nationality}get address(){return this.json.address}get documentNumber(){return this.json.documentNumber}get dateOfExpiry(){return F.fromJSON(this.json.dateOfExpiry)}get dateOfIssue(){return F.fromJSON(this.json.dateOfIssue)}get barcodeDataElements(){return this.json.dictionary}static fromJSON(t){let n=new e;return n.json=t,n}toJSONObject(){var e,t,n,r,i,a,o;return{aamvaVersion:this.aamvaVersion,address:this.address,aliasFamilyName:this.aliasFamilyName,aliasGivenName:this.aliasGivenName,aliasSuffixName:this.aliasSuffixName,barcodeMetadata:((e=this.barcodeMetadata)==null?void 0:e.toJSONObject())??null,bloodType:this.bloodType,branchOfService:this.branchOfService,cardInstanceIdentifier:this.cardInstanceIdentifier,cardRevisionDate:this.cardRevisionDate?this.cardRevisionDate.toJSONObject():null,categories:[...this.categories],champusEffectiveDate:((t=this.champusEffectiveDate)==null?void 0:t.toJSONObject())??null,champusExpiryDate:((n=this.champusExpiryDate)==null?void 0:n.toJSONObject())??null,citizenshipStatus:this.citizenshipStatus,civilianHealthCareFlagCode:this.civilianHealthCareFlagCode,civilianHealthCareFlagDescription:this.civilianHealthCareFlagDescription,commissaryFlagCode:this.commissaryFlagCode,commissaryFlagDescription:this.commissaryFlagDescription,countryOfBirth:this.countryOfBirth,countryOfBirthIso:this.countryOfBirthIso,dateOfBirth:((r=this.dateOfBirth)==null?void 0:r.toJSONObject())??null,dateOfExpiry:((i=this.dateOfExpiry)==null?void 0:i.toJSONObject())??null,dateOfIssue:((a=this.dateOfIssue)==null?void 0:a.toJSONObject())??null,deersDependentSuffixCode:this.deersDependentSuffixCode,deersDependentSuffixDescription:this.deersDependentSuffixDescription,dictionary:{...this.barcodeDataElements},directCareFlagCode:this.directCareFlagCode,directCareFlagDescription:this.directCareFlagDescription,documentAdditionalNumber:this.json.documentAdditionalNumber,documentCopy:this.documentCopy,documentDiscriminatorNumber:this.documentDiscriminatorNumber,documentNumber:this.documentNumber,documentSubtype:this.json.documentSubtype,documentType:this.json.documentType,driverNamePrefix:this.driverNamePrefix,driverNameSuffix:this.driverNameSuffix,driverRestrictionCodes:[...this.driverRestrictionCodes],ediPersonIdentifier:this.ediPersonIdentifier,endorsementsCode:this.endorsementsCode,exchangeFlagCode:this.exchangeFlagCode,exchangeFlagDescription:this.exchangeFlagDescription,eyeColor:this.eyeColor,familySequenceNumber:this.familySequenceNumber,firstName:this.firstName,firstNameTruncation:this.firstNameTruncation,firstNameWithoutMiddleName:this.firstNameWithoutMiddleName,formNumber:this.formNumber,fullName:this.fullName,genevaConventionCategory:this.genevaConventionCategory,hairColor:this.hairColor,heightCm:this.heightCm,heightInch:this.heightInch,iin:this.IIN,identificationType:this.identificationType,isRealId:this.isRealId,issuingCountry:this.json.issuingCountry,issuingCountryIso:this.json.issuingCountryIso,issuingJurisdiction:this.issuingJurisdiction,issuingJurisdictionIso:this.issuingJurisdictionIso,jpegData:this.jpegData,jurisdictionVersion:this.jurisdictionVersion,lastNameTruncation:this.lastNameTruncation,licenseCountryOfIssue:this.licenseCountryOfIssue,lastName:this.lastName,location:this.json.location??null,middleName:this.middleName,middleNameTruncation:this.middleNameTruncation,mwrFlagCode:this.mwrFlagCode,mwrFlagDescription:this.mwrFlagDescription,nationality:this.nationality,payGrade:this.payGrade,payPlanCode:this.payPlanCode,payPlanGradeCode:this.payPlanGradeCode,personDesignatorDocument:this.personDesignatorDocument,personDesignatorTypeCode:this.personDesignatorTypeCode,personMiddleInitial:this.personMiddleInitial,personalIdNumber:this.personalIdNumber,personalIdNumberType:this.personalIdNumberType,personnelCategoryCode:this.personnelCategoryCode,personnelEntitlementConditionType:this.personnelEntitlementConditionType,placeOfBirth:this.placeOfBirth,professionalDrivingPermit:((o=this.professionalDrivingPermit)==null?void 0:o.toJSONObject())??null,race:this.race,rank:this.rank,rawData:this.rawData==null?null:[...this.rawData],relationshipCode:this.relationshipCode,relationshipDescription:this.relationshipDescription,restrictionsCode:this.restrictionsCode,securityCode:this.securityCode,serviceCode:this.serviceCode,sex:this.sex,sexOriginal:this.json.sexOriginal,sponsorFlag:this.sponsorFlag,sponsorName:this.sponsorName,sponsorPersonDesignatorIdentifier:this.sponsorPersonDesignatorIdentifier,statusCode:this.statusCode,statusCodeDescription:this.statusCodeDescription,vehicleClass:this.vehicleClass,vehicleRestrictions:this.vehicleRestrictions.map(e=>e.toJSONObject()),version:this.version,weightKg:this.weightKg,weightLbs:this.weightLbs}}},Ht=class e{constructor(){this.json=null}get face(){var e;return((e=this.json)==null?void 0:e.front.face)??null}get frame(){var e,t;return((e=this.json)==null?void 0:e.front.frame)??((t=this.json)==null?void 0:t.back.frame)??null}static fromJSON(t){let n=new e;return t!=null&&(n.json=t),n}getFrame(e){switch(e){case`front`:var t;return((t=this.json)==null?void 0:t.front.frame)??null;case`back`:var n;return((n=this.json)==null?void 0:n.back.frame)??null}return null}getCroppedDocument(e){switch(e){case`front`:var t;return((t=this.json)==null?void 0:t.front.croppedDocument)??null;case`back`:var n;return((n=this.json)==null?void 0:n.back.croppedDocument)??null}return null}toJSONObject(){return{front:{face:this.face,croppedDocument:this.getCroppedDocument(`front`),frame:this.getFrame(`front`)},back:{face:null,croppedDocument:this.getCroppedDocument(`back`),frame:this.getFrame(`back`)}}}},Ut=class e{get documentCode(){return this.json.documentCode}get namesAreTruncated(){return this.json.namesAreTruncated}get optionalDataInLine1(){return this.json.optionalDataInLine1}get optionalDataInLine2(){return this.json.optionalDataInLine2}get capturedMrz(){return this.json.capturedMrz}get personalIdNumber(){return this.json.personalIdNumber}get renewalTimes(){return this.json.renewalTimes}get fullNameSimplifiedChinese(){return this.json.fullNameSimplifiedChinese}get omittedCharacterCountInGbkName(){return this.json.omittedCharacterCountInGbkName}get omittedNameCount(){return this.json.omittedNameCount}get issuingAuthorityCode(){return this.json.issuingAuthorityCode}get passportIssuerIso(){return this.json.passportIssuerIso}get passportNumber(){return this.json.passportNumber}get passportType(){return this.json.passportType===null?null:this.json.passportType}get passportDateOfExpiry(){return F.fromJSON(this.json.passportDateOfExpiry)}get firstName(){return this.json.firstName}get lastName(){return this.json.lastName}get fullName(){return this.json.fullName}get sex(){return this.json.sex}get dateOfBirth(){return F.fromJSON(this.json.dateOfBirth)}get nationality(){return this.json.nationality}get address(){return this.json.address}get documentNumber(){return this.json.documentNumber}get dateOfExpiry(){return F.fromJSON(this.json.dateOfExpiry)}get dateOfIssue(){return F.fromJSON(this.json.dateOfIssue)}static fromJSON(t){let n=new e;return n.json=t,n}toJSONObject(){var e,t;return{...this.json,documentCode:this.documentCode,namesAreTruncated:this.namesAreTruncated,optionalDataInLine1:this.optionalDataInLine1,optionalDataInLine2:this.optionalDataInLine2,capturedMrz:this.capturedMrz,personalIdNumber:this.personalIdNumber,renewalTimes:this.renewalTimes,fullNameSimplifiedChinese:this.fullNameSimplifiedChinese,omittedCharacterCountInGbkName:this.omittedCharacterCountInGbkName,omittedNameCount:this.omittedNameCount,issuingAuthorityCode:this.issuingAuthorityCode,passportIssuerIso:this.passportIssuerIso,passportNumber:this.passportNumber,passportType:this.passportType,passportDateOfExpiry:this.passportDateOfExpiry?this.passportDateOfExpiry.toJSONObject():null,firstName:this.firstName,lastName:this.lastName,fullName:this.fullName,sex:this.sex,dateOfBirth:this.dateOfBirth?this.dateOfBirth.toJSONObject():null,nationality:this.nationality,address:this.address,documentNumber:this.documentNumber,dateOfExpiry:((e=this.dateOfExpiry)==null?void 0:e.toJSONObject())??null,dateOfIssue:((t=this.dateOfIssue)==null?void 0:t.toJSONObject())??null}}},Wt=class e{constructor(){this.json={}}get code(){return this.json.code}get dateOfIssue(){return F.fromJSON(this.json.dateOfIssue)}get dateOfExpiry(){return F.fromJSON(this.json.dateOfExpiry)}static fromJSON(t){if(t==null)return null;let n=new e;return n.json=t,n}toJSONObject(){return{code:this.code,dateOfIssue:this.dateOfIssue?this.dateOfIssue.toJSONObject():null,dateOfExpiry:this.dateOfExpiry?this.dateOfExpiry.toJSONObject():null}}},I=class e{constructor(){this.json={}}get drivingLicenseCategories(){return this.json.drivingLicenseCategories.map(e=>Wt.fromJSON(e)).filter(e=>e!=null)}get restrictions(){return this.json.restrictions}get endorsements(){return this.json.endorsements}static fromJSON(t){if(t==null)return null;let n=new e;return n.json=t,n}toJSONObject(){return{drivingLicenseCategories:this.drivingLicenseCategories.map(e=>e.toJSONObject()),restrictions:this.restrictions,endorsements:this.endorsements}}},Gt=class e{get applicationStatus(){return Object.values(Ft).includes(this.json.applicationStatus)?this.json.applicationStatus:null}get durationInDays(){return this.json.durationInDays}get fullName(){return this.json.fullName}get geographicValidity(){return this.json.geographicValidity}get dateOfIssue(){return F.fromJSON(this.json.dateOfIssue)}get issuingCountryIso(){return this.json.issuingCountryIso}get issuingAuthority(){return this.json.issuingAuthority}get numberOfEntries(){return this.json.numberOfEntries}get multipleEntries(){return this.json.multipleEntries}get passportNumber(){return this.json.passportNumber}get visaNumber(){return this.json.visaNumber}get validFrom(){return F.fromJSON(this.json.validFrom)}get validUntil(){return F.fromJSON(this.json.validUntil)}get visaType(){return this.json.visaType}get foilNumber(){return this.json.foilNumber}toJSONObject(){var e,t,n;return{applicationStatus:this.applicationStatus,dateOfIssue:((e=this.dateOfIssue)==null?void 0:e.toJSONObject())??null,durationInDays:this.durationInDays,fullName:this.fullName,geographicValidity:this.geographicValidity,issuingCountryIso:this.issuingCountryIso,issuingAuthority:this.issuingAuthority,multipleEntries:this.multipleEntries,numberOfEntries:this.numberOfEntries,passportNumber:this.passportNumber,visaNumber:this.visaNumber,validFrom:((t=this.validFrom)==null?void 0:t.toJSONObject())??null,validUntil:((n=this.validUntil)==null?void 0:n.toJSONObject())??null,visaType:this.visaType??null,foilNumber:this.foilNumber}}static fromJSON(t){if(t==null)return null;let n=new e;return n.json=t,n}},Kt=class e{get firstName(){return this.json.firstName}get lastName(){return this.json.lastName}get fullName(){return this.json.fullName}get additionalAddressInformation(){return this.json.additionalAddressInformation}get additionalNameInformation(){return this.json.additionalNameInformation}get documentAdditionalNumber(){return this.json.documentAdditionalNumber}get employer(){return this.json.employer}get issuingAuthority(){return this.json.issuingAuthority}get issuingJurisdiction(){return this.json.issuingJurisdiction}get issuingJurisdictionIso(){return this.json.issuingJurisdictionIso}get maritalStatus(){return this.json.maritalStatus}get personalIdNumber(){return this.json.personalIdNumber}get placeOfBirth(){return this.json.placeOfBirth}get profession(){return this.json.profession}get race(){return this.json.race}get religion(){return this.json.religion}get residentialStatus(){return this.json.residentialStatus}get mothersName(){return this.json.mothersName}get fathersName(){return this.json.fathersName}get capturedSides(){return this.json.capturedSides}get isBackSideCaptureSupported(){return this.json.isBackSideCaptureSupported}get drivingLicenseDetails(){return I.fromJSON(this.json.drivingLicenseDetails)}get bloodType(){return this.json.bloodType}get sponsor(){return this.json.sponsor}get visaNumber(){return this.json.visaNumber}get passportNumber(){return this.json.passportNumber}get sex(){return this.json.sex}get dateOfBirth(){return F.fromJSON(this.json.dateOfBirth)}get nationality(){return this.json.nationality}get address(){return this.json.address}get documentNumber(){return this.json.documentNumber}get dateOfExpiry(){return F.fromJSON(this.json.dateOfExpiry)}get dateOfIssue(){return F.fromJSON(this.json.dateOfIssue)}get vehicleOwner(){return this.json.vehicleOwner}get visaDetails(){return Gt.fromJSON(this.json.visaDetails)}static fromJSON(t){if(t==null)return null;let n=new e;return n.json=t,n}toJSONObject(){var e,t,n,r