UNPKG

local-id-scan-journey

Version:

A React component for GBG ID verification and document scanning with bundled SDK

3 lines 69.5 kB
/*! For license information please see idscan-jcs-d91a9049.194314e02268c234efac.js.LICENSE.txt */
"use strict";(this.webpackChunkGBG_Idscan=this.webpackChunkGBG_Idscan||[]).push([[0],{192:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TemplateService=void 0;const s=i(346),a=i(4635),r=i(6871),n=i(7676),o=i(7993),c=i(1216),h=i(7338);class l{constructor(){this._mustache=new s.Writer,this.updateTemplates=e=>(this._templates=Object.assign(Object.assign({},this._templates),e),this),this.renderToContainer=(e,t=a.Templates.None,i={})=>new Promise(((s,a)=>e instanceof HTMLElement?(e.innerHTML="",this.getTemplate(t).then((t=>this.processTemplate(e,t,i))).then(s)):a())),this.getElements=(e,t={})=>new Promise(((i,s)=>e instanceof HTMLElement?i(Object.keys(t).reduce(((i,s)=>Object.assign(Object.assign({},i),{[s]:e.querySelectorAll(t[s])[0]})),{})):s(new o.ExceptionManager.TemplateException(r.TranslationKey.EXCEPTION_TEMPLATE_SOURCE_ELEMENT_MISSING)))),this.getTemplate=e=>new Promise(((t,i)=>{const s=(this._templates||{})[e],{type:a=n.TemplateType.Null}=s;switch(a){case n.TemplateType.Promise:{const{provider:e,processor:i}=s;return e.then((e=>t({type:a,processor:i,template:e})))}case n.TemplateType.Function:{const{provider:i,processor:r}=s;return t({processor:r,template:i(e),type:a})}case n.TemplateType.Url:{const{provider:e,processor:i}=s;return h.default.getFile(e).then((e=>t({type:a,processor:i,template:e})))}case n.TemplateType.String:{const{provider:e,processor:i}=s;return t({type:a,processor:i,template:e})}case n.TemplateType.Null:default:return i(o.ExceptionManager.process(new o.ExceptionManager.TemplateException(r.TranslationKey.EXCEPTION_TEMPLATE_MISSING)))}})),this.processTemplate=(e,{processor:t,template:i},s={})=>new Promise((a=>{switch(t){case n.PreProcessor.Mustache:return e.innerHTML=this._mustache.render(i,Object.assign(Object.assign({},c.default.dictionary),s),{}),a(e);case n.PreProcessor.None:default:return e.innerHTML=i,a(e)}}))}get templates(){return Object.assign({},this._templates)}}t.TemplateService=l,t.default=new l},195:(e,t,i)=>{e.exports=i.p+"797c950abd06126b6fc5.svg"},414:(e,t,i)=>{var s=i(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.SecretService=void 0;const a=i(4545),r=i(6871),n=i(7993);class o{}t.SecretService=o,o.encrypt=e=>{try{return s.from(JSON.stringify(a.encrypt(o.secret,JSON.stringify(e)))).toString("base64")}catch(e){throw n.ExceptionManager.process(new n.ExceptionManager.InvalidParameterException(r.TranslationKey.EXCEPTION_INVALID_PARAMETER_VALUE_NOT_VALID))}},o.decrypt=(e="")=>{let t;try{try{t=JSON.parse(s.from(e,"base64").toString())}catch(i){t=JSON.parse(atob(e))}return JSON.parse(a.decrypt(o.secret,t))}catch(e){throw n.ExceptionManager.process(new n.ExceptionManager.InvalidParameterException(r.TranslationKey.EXCEPTION_INVALID_PARAMETER_VALUE_DAMAGED))}},o.secret="IDS_FEVER"},577:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SocketService=t.SocketEvents=void 0;const s=i(7007),a=i(4173),r=i(1329),n=i(7918),o=i(7497),c=i(6489),h=i(1431),l=i(7121);var d,u,p;!function(e){e.RESULT="result",e.UPDATE="update"}(d||(t.SocketEvents=d={})),function(e){e.TERMINAL_STATUS_UPDATED="terminalStatusUpdated",e.BATCH_SCAN_WORKFLOW_SCAN_STARTED="batchScanWorkflowScanStarted",e.BATCH_SCAN_WORKFLOW_SCAN_FINISHED="batchScanWorkflowScanFinished",e.BATCH_SCAN_WORKFLOW_PROCESSING_FINISHED="batchScanWorkflowProcessingFinished",e.IMAGE_SOURCE_BUSY="imageSourceBusy",e.IMAGE_SOURCE_CONNECTED="imageSourceConnected",e.IMAGE_SOURCE_DISCONNECTED="imageSourceDisconnected"}(u||(u={})),function(e){e.RELEASE_TERMINAL="releaseTerminal",e.REGISTER_AND_OCCUPY_SCANNER="registerAndOccupyScanner",e.RESET="reset",e.SET_SCANNER_TRIGGER_MODE="setScannerTriggerMode"}(p||(p={}));class g extends s.EventEmitter{constructor(){super(...arguments),this._state=0,this._journeyDefinitionId="",this._scannerState={connected:!1,error:void 0,scanProcess:n.ScanProcess.EMPTY,state:void 0},this._oldScannerState={connected:!1,error:void 0,scanProcess:n.ScanProcess.EMPTY,state:void 0},this.configure=(e=this._socketUrl,t=!1)=>new Promise((i=>(this._socketUrl=e||this._socketUrl,this._logging=t,i()))),this.initialise=()=>new Promise((e=>(this.removeAllListeners(),this.clearListeners(),this._connection=(0,a.hubConnection)(this._socketUrl,{logging:this._logging,useDefaultPath:!1}),this._connection.qs=`Authorization=${o.default.get(r.STORAGE_KEYS.defaultToken)}`,this._hub=this._connection.createHubProxy("signalRMethodCallHub"),this.setListeners(),e()))),this.release=()=>new Promise((e=>this._hub&&1===this._state?this._hub.invoke(p.RELEASE_TERMINAL).then((()=>{this._scannerState={connected:!1,error:n.ScannerError.IS_RELEASED,scanProcess:n.ScanProcess.EMPTY,state:void 0}})).then(this.pushState).then(e):e())),this.stateChanged=e=>{this._state=e.newState},this.start=(e,t)=>new Promise(((i,s)=>this._connection?(this._journeyDefinitionId=e,this._journeyId=t,this._connection.start().done((()=>{this.tryRegistering().then((()=>i(this._scannerState)))})).fail((()=>s({connected:!1,error:"Cannot reach the server",scanProcess:n.ScanProcess.EMPTY,state:void 0})))):s())),this.clearListeners=()=>{const{_hub:e}=this;e&&(e.off(u.TERMINAL_STATUS_UPDATED),e.off(u.BATCH_SCAN_WORKFLOW_SCAN_STARTED),e.off(u.BATCH_SCAN_WORKFLOW_SCAN_FINISHED),e.off(u.BATCH_SCAN_WORKFLOW_PROCESSING_FINISHED),e.off(u.IMAGE_SOURCE_BUSY),e.off(u.IMAGE_SOURCE_CONNECTED),e.off(u.IMAGE_SOURCE_DISCONNECTED))},this.setListeners=()=>{const{_connection:e,_hub:t}=this;e&&(e.stateChanged(this.stateChanged),e.error((e=>{this.setSourceState(n.ScannerState.DISCONNECTED)}))),t&&(t.on(u.TERMINAL_STATUS_UPDATED,this.setState),t.on(u.BATCH_SCAN_WORKFLOW_SCAN_STARTED,(()=>{this.setScanProcess(n.ScanProcess.SCANNING)})),t.on(u.BATCH_SCAN_WORKFLOW_SCAN_FINISHED,(()=>{this.setScanProcess(n.ScanProcess.PROCESSING)})),t.on(u.BATCH_SCAN_WORKFLOW_PROCESSING_FINISHED,(e=>{this.setScanProcess(n.ScanProcess.EMPTY).then(this.turnOffAutoTriggerMode).then((()=>this.emit(d.RESULT,e)))})),t.on(u.IMAGE_SOURCE_BUSY,(()=>{this.setSourceState(n.ScannerState.BUSY)})),t.on(u.IMAGE_SOURCE_CONNECTED,(()=>{this.setSourceState(n.ScannerState.CONNECTED)})),t.on(u.IMAGE_SOURCE_DISCONNECTED,(()=>{this.setSourceState(n.ScannerState.DISCONNECTED)})))},this.stop=()=>new Promise((e=>{this.release().then((()=>this._connection?this._connection.stop():void 0)).then((()=>e(!0)))})),this.tryRegistering=(e=this._journeyDefinitionId,t=this._journeyId)=>new Promise(((i,s)=>{let a=[];return h.default.mode===l.Mode.WEB?a=[{name:"Channel",value:"Web",step:"GENERAL",type:"Simple"},{name:"Web Sdk Version",value:"21.0.0",step:"GENERAL",type:"Simple"},{name:"Platform",value:c.osName,step:"GENERAL",type:"Simple"},{name:"Platform Version",value:c.osVersion,step:"GENERAL",type:"Simple"},{name:"Browser",value:c.browserName,step:"GENERAL",type:"Simple"},{name:"Browser Version",value:c.fullBrowserVersion,step:"GENERAL",type:"Simple"}]:h.default.mode===l.Mode.CAPTURESTUDIO&&(a=[{name:"Platform",value:c.osName,step:"GENERAL",type:"Simple"},{name:"Platform Version",value:c.osVersion,step:"GENERAL",type:"Simple"},{name:"Browser",value:c.browserName,step:"GENERAL",type:"Simple"},{name:"Browser Version",value:c.fullBrowserVersion,step:"GENERAL",type:"Simple"}]),this._hub?this._hub.invoke(p.REGISTER_AND_OCCUPY_SCANNER,{platform:e,deviceId:"0",metaData:a,journeyId:t}).then(this.setState).then(i):s()})),this.setScannerTriggerMode=e=>new Promise(((t,i)=>this._hub?this._hub.invoke(p.SET_SCANNER_TRIGGER_MODE,"trigger",e).then(t):i())),this.resetTerminal=()=>new Promise(((e,t)=>this._hub&&4!==this._state?this._hub.invoke(p.RESET).then(e):t())),this.setScanProcess=e=>(this._scannerState.scanProcess=e,this.pushState()),this.setSourceState=e=>{this._scannerState.state=e,this.pushState()},this.setState=e=>{this._scannerState.state=this._scannerState.state,this._scannerState.error=e.failReason&&"None"!==e.failReason?e.failReason:void 0,this._scannerState.connected=e.isOccupiedSuccessfully&&e.scannerInfo.isConnected,void 0===this._scannerState.state&&void 0===this._scannerState.error&&!0===this._scannerState.connected&&(this._scannerState.state=n.ScannerState.CONNECTED),this.pushState()},this.pushState=()=>new Promise((e=>(JSON.stringify(this._scannerState)!==JSON.stringify(this._oldScannerState)&&this.emit(d.UPDATE,this._scannerState),this._oldScannerState=Object.assign({},this._scannerState),e()))),this.turnOffAutoTriggerMode=()=>new Promise(((e,t)=>4!==this._state?this.setScannerTriggerMode("false").then((()=>e())):t()))}get state(){return this._state}}t.SocketService=g,t.default=new g},689:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.retryOperationWithTimeout=t.retryOperation=t.wait=void 0;t.wait=e=>new Promise((t=>setTimeout(t,e)));t.retryOperation=(e,i,s)=>new Promise(((a,r)=>e().then(a).catch((n=>!1===n?r(n):s-1>0?(0,t.wait)(i).then(t.retryOperation.bind(null,e,i,s-1)).then(a).catch(r):r(n)))));t.retryOperationWithTimeout=(e,i,s,a)=>new Promise(((r,n)=>{if(!a.isCancelled)return e().then(r).catch((o=>{const c=new Date;return!1===o?n(o):c<s?(0,t.wait)(i).then(t.retryOperationWithTimeout.bind(null,e,i,s,a)).then(r).catch(n):n(o)}));n(a.reason)}))},867:(e,t,i)=>{e.exports=i.p+"e7178f5b283b73562187.svg"},885:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ImageService=void 0;const s=i(6871),a=i(7993);class r{static convert(e){return new Promise(((t,i)=>{const r=new FileReader;r.readAsDataURL(e),r.onerror=e=>{throw a.ExceptionManager.process(new a.ExceptionManager.PlatformException(s.TranslationKey.EXCEPTION_PLATFORM_UNSUPPORTED))},r.onload=()=>{t(r.result)}}))}static resolveImageFormat(e){const[,t]=e.split("/");return t}static getBase64Components(e){const[t="",i=""]=e.split(";"),[,s]=t.split(":"),[,a]=i.split(",");return{type:r.resolveImageFormat(s),data:a}}static remapNames({data:e,type:t}){return{data:e,imageFormat:t}}}t.ImageService=r},946:(e,t,i)=>{e.exports=i.p+"d9e66393d2753d187b04.svg"},997:(e,t,i)=>{e.exports=i.p+"ce862946cb7664646eda.svg"},1e3:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Croppy=void 0;const i={imageSrc:"",magnifierCanvasId:"",selection:{coordsTextColor:"#005EA5",highlightColor:"#f00",lineColor:"#000"},showCornersAlways:!0,targetCanvasId:"",padding:0};class s{constructor(e){this.workspace={height:0,heightFactor:0,width:0,widthFactor:0},this.rotationDegrees=0,this.off=10,this.zs=10,this.magSZ=this.off*this.zs,this.mouseDragging=!1,this.isInTouchMode=!1,this.cursorDraggingIcon="grabbing",this.cursorIcon="grab",this.init=(e,t)=>{this.image=new Image,this.image.onload=()=>{this.setWorkspace(),e=e&&e.length>0?e:null,this.setSelectionAreaValues(e,t),this.drawScene()},this.image.src=this.options.imageSrc,this.setCursor(!1),this.setEvents()},this.crop=e=>{const t=document.createElement("canvas");t.width=this.$targetCanvas.width,t.height=this.$targetCanvas.height,this.drawScene(!0);const i=t.getContext("2d");this.drawPath(i),i.clip(),i.drawImage(this.$targetCanvas,0,0),i.restore(),this.drawScene();const s=document.getElementById(e);Array.from(s.children).forEach((e=>s.removeChild(e))),s.append(t)},this.getOriginalSelectionAreaPoints=()=>{let e,t;for(let i=0;i<this.selectionArea.points.length;i++)e=this.selectionArea.points[i][0],t=this.selectionArea.points[i][1],e/=this.workspace.widthFactor,t/=this.workspace.heightFactor,e=s.getFloat(e),t=s.getFloat(t);return{points:[],rotation:s.getFloat(this.rotationDegrees)}},this.getSelectionAreaPoints=()=>[this.selectionArea.points,this.rotationDegrees],this.rotate=e=>{this.rotationDegrees=e,this.rotateCanvas(this.targetCanvasContext),this.drawSelectionArea()},this.setWorkspace=()=>{if(!this.image)return;if(this.$targetCanvas.getAttribute("width")?this.workspace.width=parseInt(this.$targetCanvas.getAttribute("width"),10):this.workspace.width=this.image.width,this.$targetCanvas.getAttribute("height"))this.workspace.height=parseInt(this.$targetCanvas.getAttribute("height"),10);else{const e=this.image.width/this.image.height;this.workspace.height=this.workspace.width/e}const e=this.workspace.width,t=this.workspace.height;this.workspace.widthFactor=this.workspace.width/this.image.width,this.workspace.heightFactor=this.workspace.height/this.image.height,this.$targetCanvas.setAttribute("width",e.toString()),this.$targetCanvas.setAttribute("height",t.toString()),this.$magnifier&&(this.$magnifier.setAttribute("width",this.magSZ.toString()),this.$magnifier.setAttribute("height",this.magSZ.toString()))},this.setSelectionAreaValues=(e,t)=>{this.selectionArea=new a(e?{pts:e,areOriginalCoords:t,options:this.options,workspace:this.workspace,targetCanvas:this.$targetCanvas}:{pts:this.initSelectAreaPoints(this.workspace.width,this.workspace.height),areOriginalCoords:!1,options:this.options,workspace:this.workspace,targetCanvas:this.$targetCanvas})},this.onTouchStart=e=>{this.pointerDownFunc(e)&&(e.preventDefault(),this.isInTouchMode=!0,this.$targetCanvas.addEventListener("touchmove",this.onMove,{passive:!0}),this.$targetCanvas.addEventListener("touchend",this.onTouchEnd,{passive:!0}),this.$targetCanvas.addEventListener("touchcancel",this.onTouchEnd,{passive:!0}))},this.onTouchEnd=e=>{this.pointerUpFunc(e),this.$targetCanvas.removeEventListener("touchmove",this.onMove),this.$targetCanvas.removeEventListener("touchend",this.onTouchEnd),this.$targetCanvas.removeEventListener("touchcancel",this.onTouchEnd)},this.onMouseDown=e=>{this.pointerDownFunc(e)&&(e.preventDefault(),this.isInTouchMode=!1,this.$targetCanvas.addEventListener("mousemove",this.onMove,{passive:!0}),this.$targetCanvas.addEventListener("mouseup",this.onMouseUp,{passive:!0}),this.$targetCanvas.addEventListener("mouseout",this.onMouseUp,{passive:!0}))},this.onMouseUp=e=>{this.pointerUpFunc(e),this.$targetCanvas.removeEventListener("mousemove",this.onMove),this.$targetCanvas.removeEventListener("mouseup",this.onMouseUp),this.$targetCanvas.removeEventListener("mouseout",this.onMouseUp)},this.onMove=e=>{const t=e.target,{clientX:i,clientY:a}=this.getPointerLocation(e),{x:r,y:n}=this.getRelativeTouchPosition(t,i,a);return this.moveCubes(s.normalize(r,0,t.width),s.normalize(n,0,t.height))},this.getRelativeTouchPosition=(e,t,i)=>{let s=e.getClientRects()[0];null==s&&(s=new DOMRect);const a=this.getTargetActualSize(!0,s.width,s.height,e.width,e.height),r=this.getTargetScale();return{x:(t-s.left-a.x)*r.scaleX,y:(i-s.top-a.y)*r.scaleY}},this.setEvents=()=>{this.$targetCanvas.addEventListener("touchstart",this.onTouchStart),this.$targetCanvas.addEventListener("mousedown",this.onMouseDown),"function"==typeof window.ResizeObserver&&new window.ResizeObserver((()=>this.drawScene())).observe(this.$targetCanvas)},this.getPointerLocation=e=>{if(e instanceof TouchEvent){const{clientX:t,clientY:i}=e.touches[0];return{clientX:t,clientY:i}}if(e instanceof MouseEvent){const{clientX:t,clientY:i}=e;return{clientX:t,clientY:i}}return{clientX:0,clientY:0}},this.pointerDownFunc=e=>{const{clientX:t,clientY:i}=this.getPointerLocation(e),s=e.target,{x:a,y:r}=this.getRelativeTouchPosition(s,t,i),n=this.getPointUnderCursor(a,r);return!!n&&(this.selectionArea.hovering[n.index]=!0,this.selectionArea.dragging[n.index]=!0,this.mouseDragging=!0,this.drawScene(),!0)},this.pointerUpFunc=e=>{for(let e=0;e<this.selectionArea.points.length;e++)this.mouseDragging=!1,this.selectionArea.dragging[e]=!1,this.selectionArea.hovering[e]=!1;this.magnifierContext&&this.magnifierContext.clearRect(0,0,this.magSZ,this.magSZ),this.drawScene()},this.getPointUnderCursor=(e,t)=>{const i=s.normalize(Math.floor(e),0,this.workspace.width),a=s.normalize(Math.floor(t),0,this.workspace.height);if(this.selectionArea){const e=this.getTargetScale();for(let t=0;t<this.selectionArea.points.length;t++){const r=this.selectionArea.points[t][0],n=this.selectionArea.points[t][1],o=this.selectionArea.cSizeH*e.scaleX,c=this.selectionArea.cSizeH*e.scaleY;if(s.between(i,r-o,r+o)&&s.between(a,n-c,n+c))return{index:t,x:r,y:n}}}},this.moveCubes=(e,t)=>{const i=this.selectionArea.dragging.indexOf(!0);i>=0&&(this.selectionArea.hovering[i]&&(this.selectionArea.dragging[i]=this.selectionArea.hovering[i]),this.selectionArea.dragging[i]&&(this.selectionArea.points[i][0]=e,this.selectionArea.points[i][1]=t),this.drawScene())},this.setCursor=e=>{this.$targetCanvas.style.cursor=e?this.cursorDraggingIcon:this.cursorIcon},this.drawPath=e=>{e.beginPath();for(let t=0;t<this.selectionArea.points.length;t++){const i=parseInt(String(this.selectionArea.points[t][0]).trim(),10),s=parseInt(String(this.selectionArea.points[t][1]).trim(),10);0===t?e.moveTo(i,s):e.lineTo(i,s)}e.closePath()},this.rotateCanvas=e=>{const t=e.canvas;e.clearRect(0,0,t.width,t.height),e.save();const i=t.width/2,s=t.height/2;e.translate(i,s),e.rotate(this.rotationDegrees*Math.PI/180),e.drawImage(this.image,-i,-s,this.workspace.width,this.workspace.height),e.restore()},this.initSelectAreaPoints=(e,t)=>[[0,0],[0,t],[e,t],[e,0]],this.drawSelectionArea=()=>{if(!this.selectionArea)return;this.setDynamicLineWidth();const e=this.getTargetScale(),t=this.selectionArea.cSize*e.scaleX,i=this.selectionArea.cSize*e.scaleY;let s=!1,a=!this.mouseDragging;for(let e=0;e<this.selectionArea.points.length;e++){this.targetCanvasContext.fillStyle=this.selectionArea.dragging[e]?this.selectionArea.highlight:this.selectionArea.textColor;const r=this.selectionArea.points[e][0],n=this.selectionArea.points[e][1];this.selectionArea.dragging[e]?(a=!0,this.drawMagnifier(r,n),s||(this.drawLineBetweenCubes(),s=!0),this.targetCanvasContext.strokeStyle=this.selectionArea.highlight,this.isInTouchMode?(this.targetCanvasContext.beginPath(),this.targetCanvasContext.ellipse(r,n,3*t,3*i,0,0*Math.PI,2*Math.PI),this.targetCanvasContext.closePath(),this.targetCanvasContext.stroke()):this.targetCanvasContext.strokeRect(r-2*t/2,n-2*i/2,2*t,2*i),this.targetCanvasContext.strokeStyle=this.selectionArea.lineColor):(a&&!s&&(this.drawLineBetweenCubes(),s=!0),this.selectionArea.hovering[e]?this.targetCanvasContext.fillRect(r-2*t/2,n-2*i/2,2*t,2*i):this.targetCanvasContext.fillRect(r-t/2,n-i/2,t,i))}},this.drawMagnifier=(e,t)=>{if(this.$magnifier&&this.magnifierContext){this.magnifierContext.clearRect(0,0,this.magSZ,this.magSZ);const i=e<this.off?0:e-this.off,s=t<this.off?0:t-this.off,a=this.$targetCanvas.width-e,r=this.$targetCanvas.height-t,n=a<=this.off?this.off+a-1:2*this.off,o=r<=this.off?this.off+r-1:2*this.off,c=1/(2*this.off);this.magnifierContext.drawImage(this.$targetCanvas,i,s,n,o,(i-(e-this.off))*this.zs/2,(s-(t-this.off))*this.zs/2,Math.floor(n*c*this.magSZ),Math.floor(o*c*this.magSZ)),this.magnifierContext.beginPath(),this.magnifierContext.moveTo(this.magSZ/2,0),this.magnifierContext.lineTo(this.magSZ/2,this.magSZ),this.magnifierContext.closePath(),this.magnifierContext.stroke(),this.magnifierContext.beginPath(),this.magnifierContext.moveTo(0,this.magSZ/2),this.magnifierContext.lineTo(this.magSZ,this.magSZ/2),this.magnifierContext.closePath(),this.magnifierContext.stroke()}},this.drawLineBetweenCubes=()=>{this.targetCanvasContext.strokeStyle=this.selectionArea.lineColor,this.setDynamicLineWidth(),this.targetCanvasContext.beginPath(),this.targetCanvasContext.moveTo(this.selectionArea.points[0][0],this.selectionArea.points[0][1]);for(let e=1;e<this.selectionArea.points.length;e++)this.targetCanvasContext.lineTo(this.selectionArea.points[e][0],this.selectionArea.points[e][1]);this.targetCanvasContext.lineTo(this.selectionArea.points[0][0],this.selectionArea.points[0][1]),this.targetCanvasContext.closePath(),this.targetCanvasContext.stroke()},this.drawScene=(e=!1)=>{this.rotateCanvas(this.targetCanvasContext),e||this.drawSelectionArea()},this.getTargetActualSize=(e,t,i,s,a)=>{const r=s/a,n=t/i;let o=0,c=0;return(e?r>n:r<n)?(o=t,c=o/r):(c=i,o=c*r),{height:c,width:o,x:(t-o)/2,y:(i-c)/2}},this.getTargetScale=()=>{let e=this.$targetCanvas.getClientRects()[0];null==e&&(e=new DOMRect);const t=this.getTargetActualSize(!0,e.width,e.height,this.$targetCanvas.width,this.$targetCanvas.height);return t?{scaleX:this.$targetCanvas.width/t.width,scaleY:this.$targetCanvas.height/t.height}:{scaleX:1,scaleY:1}},this.setDynamicLineWidth=()=>{const e=this.getTargetScale();this.targetCanvasContext.lineWidth=(e.scaleX+e.scaleY)/2*2},this.options=Object.assign({},i,e),this.$targetCanvas=document.getElementById(this.options.targetCanvasId),this.targetCanvasContext=this.$targetCanvas.getContext("2d"),this.$magnifier=document.getElementById(this.options.magnifierCanvasId),this.magnifierContext=this.$magnifier?this.$magnifier.getContext("2d"):null}}t.Croppy=s,s.getFloat=e=>parseFloat(e.toFixed(3)),s.getOffset=e=>{const t=e.getBoundingClientRect();return{left:t.left+document.body.scrollLeft,top:t.top+document.body.scrollTop}},s.normalize=(e,t,i)=>Math.min(i,Math.max(t,e)),s.between=(e,t,i)=>e>=t&&e<=i;class a{constructor({pts:e,areOriginalCoords:t,options:i,workspace:a,targetCanvas:r}){if(this.hovering=[!1,!1,!1,!1],this.dragging=[!1,!1,!1,!1],this.cSize=10,this.cSizeH=20,t)for(let t=0;t<e.length;t++)e[t][0]=s.getFloat(e[t][0]*a.widthFactor),e[t][0]=e[t][0]<a.width?e[t][0]>0?e[t][0]:0:a.width,e[t][1]=s.getFloat(e[t][1]*a.heightFactor),e[t][1]=e[t][1]<a.height?e[t][1]>0?e[t][1]:0:a.height;this.points=e,this.highlight=i.selection.highlightColor,this.lineColor=i.selection.lineColor,this.textColor=i.selection.coordsTextColor;const n=s.getOffset(r);this.initCanvasLeft=n.left,this.initCanvasTop=n.top}}},1096:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},1215:(e,t,i)=>{e.exports=i.p+"27091d3a210a8ea5c6d1.svg"},1216:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LanguageService=void 0;const s=i(8515);class a{constructor(){this._language="en_GB",this._dictionary=s.DefaultTranslations,this._translator=this.defaultTranslator,this.setLanguage=e=>this._language=e||this._language,this.setTranslator=e=>this._translator=e||this._translator,this.setDictionary=e=>this._dictionary=Object.assign(Object.assign({},this._dictionary),e),this.getTranslation=(e,t={})=>{const i=this._translator(e,this._language,t);return void 0!==i?i:"__NO_TRANSLATION__"}}get dictionary(){return Object.assign({},this._dictionary)}defaultTranslator(e,t=this._language,i={}){return this.dictionary[e]}}t.LanguageService=a,t.default=new a},1644:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},2072:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IdesMicroHost=void 0;const s=i(7461),a=i(2538),r=i(6339);class n{constructor(){this.isWorkerSupported=()=>"undefined"!=typeof Worker,this.createWorker=(e,t,i,n)=>new Promise(((o,c)=>{if(this.idesMicroWorker)return this.makeRequest(s.IdesMicroWorkerMessages.Initialise,{asmScriptUrl:t,timeout:i,timeLogsEnabled:n}).then(o).catch(c);a.default.publish(r.JourneyEvent.TRANSFER_STARTED,{name:"ides",status:"started",percentage:0}).then((()=>this.idesMicroWorker=this.createCrossDomainWorker(e))).then((()=>this.makeRequest(s.IdesMicroWorkerMessages.Initialise,{asmScriptUrl:t,timeout:i,timeLogsEnabled:n}))).then((()=>a.default.publish(r.JourneyEvent.TRANSFER_COMPLETE,{name:"ides",status:"complete",percentage:100}))).then(o).catch(c)})),this.createNewWorker=(e,t,i,s)=>this.destroyWorker().then((()=>this.createWorker(e,t,i,s))),this.destroyWorker=()=>new Promise((e=>{if(this.idesMicroWorker)return this.makeRequest(s.IdesMicroWorkerMessages.Terminate,{}).then((()=>this.idesMicroWorker.terminate())).then((()=>this.idesMicroWorker=void 0)).then(e);e()})),this.checkImage=e=>this.generateFile(e).then((e=>this.makeRequest(s.IdesMicroWorkerMessages.PerformQualityCheck,{image:e}))),this.makeRequest=(e,t,i=(new Date).getTime().toString())=>new Promise(((a,r)=>{if(this.idesMicroWorker){const n=({data:e})=>{if(e.id===i)return this.idesMicroWorker.removeEventListener("message",n),this.idesMicroWorker.removeEventListener("error",o),e.message===s.IdesMicroWorkerMessages.Error?r():a(e.data)},o=e=>(this.idesMicroWorker.removeEventListener("message",n),this.idesMicroWorker.removeEventListener("error",o),r(e));this.idesMicroWorker.addEventListener("message",n),this.idesMicroWorker.addEventListener("error",o),this.idesMicroWorker.postMessage({id:i,message:e,data:t})}else r()})),this.generateFile=e=>new Promise(((t,i)=>{const s=new FileReader;s.addEventListener("load",(e=>{t(new Uint8Array(e.target.result))})),s.addEventListener("error",i),s.readAsArrayBuffer(e)}))}createCrossDomainWorker(e){var t;try{this.testSameOrigin(e)?(t=new Worker(e)).onerror=i=>{i.preventDefault(),t=this.createWorkerFallback(e)}:t=this.createWorkerFallback(e)}catch(i){t=this.createWorkerFallback(e)}return t}createWorkerFallback(e){try{var t;try{t=new Blob(["importScripts('"+e+"');"],{type:"text/javascript"})}catch(s){var i=new(window&&window.BlobBuilder||window&&window.WebKitBlobBuilder||window&&window.MozBlobBuilder);i.append("importScripts('"+e+"');"),t=i.getBlob("text/javascript")}var s=(window&&window.URL||window&&window.webkitURL).createObjectURL(t);return new Worker(s)}catch(e){}}testSameOrigin(e){var t=window.location,i=document.createElement("a");return i.href=e,i.hostname===t.hostname&&i.port===t.port&&i.protocol===t.protocol}}t.IdesMicroHost=n,t.default=new n},2315:(e,t,i)=>{e.exports=i.p+"6bc391888aefac53c4f1.svg"},2538:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EventService=void 0;const s=i(4145),a=i(6871),r=i(7993);class n{constructor(){this._topics={},this.publish=(e,t)=>new Promise((i=>{(this._topics[e]||[]).forEach((e=>{e.fn(Object.assign({timestamp:(new Date).getTime()},t))})),i()})),this.terminate=()=>new Promise((e=>{s.default.getDataStore(s.DataStoreType.ID_SCAN).reset(),this.unsubscribeAll().then(e)})),this.unsubscribeAll=()=>new Promise((e=>(Object.keys(this._topics).forEach((e=>{this._topics[e].forEach((t=>this.unsubscribe(e,t)))})),e())))}subscribe(e,t,i){this.assertStringEvent(e),this.assertValidFunction(t),this.assertValidPriority(i);const s={fn:t,priority:i};return this._topics[e]||(this._topics[e]=[]),this._topics[e].push(s),this.sort(e),{unsubscribe:()=>{this.unsubscribe(e,s)}}}unsubscribeTopic(e){var t=this._topics[e];t&&t.forEach((t=>this.unsubscribe(e,t)))}unsubscribe(e,t){this._topics[e]&&(this._topics[e]=this._topics[e].filter((e=>t.fn!==e.fn)))}sort(e){this._topics[e]&&this._topics[e].sort(((e,t)=>void 0!==e.priority&&void 0!==t.priority?e.priority>t.priority?1:t.priority>e.priority?-1:0:void 0===e.priority&&void 0===t.priority?0:void 0===e.priority?1:-1))}assertStringEvent(e){if("string"!=typeof e)throw r.ExceptionManager.process(new r.ExceptionManager.InvalidParameterException(a.TranslationKey.EXCEPTION_INVALID_PARAMETER_NAME_MUST_BE_STRING))}assertValidFunction(e){if(e instanceof Function==!1)throw r.ExceptionManager.process(new r.ExceptionManager.InvalidParameterException(a.TranslationKey.EXCEPTION_INVALID_PARAMETER_CALLBACK_MUST_BE_FUNCTION))}assertValidPriority(e){if(void 0!==e){if("number"!=typeof e)throw r.ExceptionManager.process(new r.ExceptionManager.InvalidParameterException(a.TranslationKey.EXCEPTION_INVALID_PARAMETER_PRIORITY_MUST_BE_NUMBER));if(e<0)throw r.ExceptionManager.process(new r.ExceptionManager.InvalidParameterException(a.TranslationKey.EXCEPTION_INVALID_PARAMETER_PRIORITY_MUST_BE_POSITIVE_NUMBER))}}}t.EventService=n,t.default=new n},2745:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.removeNullOrUndefined=function e(t={}){const i=s({},t);return Object.keys(i).forEach((t=>{const s=i[t];"object"==typeof s&&null!==s?s instanceof Date||s instanceof RegExp||(i[t].value=e(s)):null==s&&delete i[t]})),i};const s=i(3012)},2828:(e,t,i)=>{e.exports=i.p+"a7fdbf30585e1a4f55c7.svg"},2930:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.HttpService=void 0;const s=i(2505),a=i(6178),r=i(642),n=i(5005),o=i(6871),c=i(5458),h=i(2538),l=i(7993),d=i(5982),u=i(7497),p=i(5217),g=i(1329);class m{constructor(){this.configure=e=>new Promise((t=>(this._httpConfig=e,t(this)))),this.initialize=()=>new Promise((e=>(this._caseDictionaryService=new c.CaseDictionaryService(a.dictionary),this.setDefaults(),e(this)))),this.post=(e,t,i,s="")=>(h.default.publish(r.JourneyEvent.TRANSFER_STARTED,{name:s,status:"started",percentage:0}),this._axios.post(e,t,Object.assign({onDownloadProgress:this.onDownloadProgress(s),onUploadProgress:this.onUploadProgress(s)},i)).then(this.onPostSuccess(s)).catch(this.onPostFailure(s))),this.onPostSuccess=e=>t=>{var i,s=u.default.get(g.STORAGE_KEYS.journeyId);return t.journeyId==s||(null===(i=null==t?void 0:t.Workflow)||void 0===i?void 0:i.PersonEntryId)==s?h.default.publish(r.JourneyEvent.TRANSFER_COMPLETE,{name:e,status:"complete",percentage:100,JourneyId:u.default.get(g.STORAGE_KEYS.journeyId)}).then((()=>t)):e?void 0:t},this.onPostFailure=e=>t=>{throw h.default.publish(r.JourneyEvent.TRANSFER_FAILED,{name:e,status:"failed"}),t},this.get=(e,t,i="")=>(h.default.publish(r.JourneyEvent.TRANSFER_STARTED,{name:i,status:"started",percentage:0}),this._axios.get(e,Object.assign({onDownloadProgress:this.onDownloadProgress(i),onUploadProgress:this.onUploadProgress(i)},t)).then((e=>h.default.publish(r.JourneyEvent.TRANSFER_COMPLETE,{name:i,status:"complete",percentage:100}).then((()=>e)))).catch((e=>{throw h.default.publish(r.JourneyEvent.TRANSFER_FAILED,{name:i,status:"failed"}),e}))),this.injectToken=e=>{this.removeToken(),this.writeToken(e),this.setToken(e)},this.debug=()=>this._axios.defaults,this.getToken=()=>{try{return this.tokenName?u.default.get(this.tokenName):void 0}catch(e){return}},this.getUrlString=(e="",t=this._httpConfig.backendUrl)=>{try{return new URL(e,t).pathname}catch(e){return}},this.setDefaults=()=>new Promise((e=>(this._axios=s.default.create({adapter:i(5592),baseURL:this._httpConfig.backendUrl,headers:{Accept:"application/json","Content-Type":"application/json"},onDownloadProgress:this.onDownloadProgress,onUploadProgress:this.onUploadProgress,timeout:0}),this.isAuthEnabled()&&this.setToken(this.getToken()),this.setHttpResponse(),this.setCaseDictionaryInterceptors(),this.setTransformationInterception(),this.setTokenInterceptor(),this.setCatchInterception(),this.setResponseFormattingInterception(),e(this)))),this.onUploadProgress=e=>t=>{const i=Math.floor(50*(t.loaded||1)/(t.total||1));h.default.publish(r.JourneyEvent.TRANSFER_PROGRESS,{name:e,status:i<50?"uploading":"processing",percentage:i,journeyId:u.default.get(g.STORAGE_KEYS.journeyId)})},this.onDownloadProgress=e=>t=>{const i=Math.floor(50*(t.loaded||1)/(t.total||1));h.default.publish(r.JourneyEvent.TRANSFER_PROGRESS,{name:e,status:"downloading",percentage:50+i})},this.setToken=e=>{e?(this._axios.defaults.headers.common.Authorization=e,h.default.publish(r.JourneyEvent.AUTH_CHANGE,{authorized:!0})):(delete this._axios.defaults.headers.common.Authorization,h.default.publish(r.JourneyEvent.AUTH_CHANGE,{authorized:!1}))},this.writeToken=e=>{this.tokenName&&this.tokenTTL&&u.default.set(this.tokenName,e,this.tokenTTL)},this.removeToken=()=>{this.tokenName&&u.default.remove(this.tokenName)},this.setHttpResponse=()=>{this._axios.interceptors.response.use((e=>new d.HttpResponse(e)))},this.setCaseDictionaryInterceptors=()=>{this._axios.interceptors.request.use((e=>(e.data=this._caseDictionaryService.convert(e.data,"uglify"),e))),this._axios.interceptors.response.use((e=>(e.data=this._caseDictionaryService.convert(e.data,"beautify"),e)))},this.setTransformationInterception=()=>{this._axios.interceptors.response.use((e=>{let t=e;return e.config.url&&(e.config.url.match(/\/journey\/get/)||e.config.url.match(this._httpConfig.endpoints.upload)&&e.data.entryData&&(t=p.TransformationService.convert("journey-upload",e))),t}))},this.setTokenInterceptor=()=>{this._axios.interceptors.response.use((e=>(e.config.url.match(this._httpConfig.endpoints.login)&&void 0!==e.data.access_token?(this.setToken(e.data.access_token),this.writeToken(e.data.access_token)):e.config.url.match(this._httpConfig.endpoints.logout)&&(u.default.clear(),this.removeToken(),this.setToken()),e)))},this.setCatchInterception=()=>{this._axios.interceptors.response.use((e=>e),(e=>{throw"NetworkError"===e.name?l.ExceptionManager.process(new l.ExceptionManager.NetworkException(o.TranslationKey.EXCEPTION_NETWORK,e.response)):e.response&&400===e.response.status?l.ExceptionManager.process(new l.ExceptionManager.BadRequestException(o.TranslationKey.EXCEPTION_BAD_REQUEST,e.response)):e.response&&401===e.response.status?(this.getToken()&&(this.removeToken(),this.setToken()),l.ExceptionManager.process(new l.ExceptionManager.AuthorizationException(o.TranslationKey.EXCEPTION_AUTHORIZATION,e.response))):e.response&&500===e.response.status?l.ExceptionManager.process(new l.ExceptionManager.ServerException(o.TranslationKey.EXCEPTION_SERVER,e.response)):e}))},this.setResponseFormattingInterception=()=>{this._axios.interceptors.response.use((e=>this._httpConfig.responseType===n.ResponseType.RAW?e:e.data))},this.isAuthEnabled=()=>!1!==this._httpConfig.authSettings}get auth(){return!!this._axios.defaults.headers.common.Authorization}get authSettings(){return this._httpConfig.authSettings}get endpoints(){return this._httpConfig.endpoints}get tokenName(){return this._httpConfig.authSettings&&this._httpConfig.authSettings.persistence.tokenName?this._httpConfig.authSettings.persistence.tokenName:void 0}get tokenTTL(){return this._httpConfig.authSettings&&this._httpConfig.authSettings.persistence.expire?this._httpConfig.authSettings.persistence.expire:void 0}}t.HttpService=m,t.default=new m},3123:function(e,t,i){var s=this&&this.__awaiter||function(e,t,i,s){return new(i||(i=Promise))((function(a,r){function n(e){try{c(s.next(e))}catch(e){r(e)}}function o(e){try{c(s.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(n,o)}c((s=s.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.CameraService=t.CameraFacingMode=t.CameraPermissionState=void 0;const a=i(3012),r=i(8137),n=i(642),o=i(6871),c=i(689),h=i(2538),l=i(7993),d=i(6489);var u,p;!function(e){e.UNKNOWN="unknown",e.PROMPT="prompt",e.GRANTED="granted",e.DENIED="denied"}(u||(t.CameraPermissionState=u={})),function(e){e.FRONT="FRONT",e.BACK="BACK",e.ENVIRONMENT="ENVIRONMENT"}(p||(t.CameraFacingMode=p={}));const g={overlay:{documentReticle:{path:(e,t,i=50,s=5,a=(e>t?600:700))=>`\n\tM${i},${i} L${i+s+a},${i} L${i+s+a},${i+s} L${i+s},${i+s} L${i+s},${i+s+a} L${i},${i+s+a} L${i},${i} Z\n\tM${e-i-a-s},${i} L${e-i},${i} L${e-i},${i+s+a} L${e-i-s},${i+s+a} L${e-i-s},${i+s} L${e-i-a-s},${i+s} L${e-i-a-s},${i} Z\n\tM${e-i-s},${t-i-s-a} L${e-i},${t-i-s-a} L${e-i},${t-i} L${e-i-s-a},${t-i} L${e-i-s-a},${t-i-s} L${e-i-s},${t-i-s} L${e-i-s},${t-i-s-a} Z\n\tM${i},${t-i-s-a} L${i+s},${t-i-s-a} L${i+s},${t-i-s} L${i+s+a},${t-i-s} L${i+s+a},${t-i} L${i},${t-i} L${i},${t-i-s-a} Z\n`},portraitReticle:{path:(e,t)=>{const i=(e>t?576:360)/e,s=(e>t?360:576)/t,a=295/s;return`M 0 0 m ${e/2} ${(t-a)/2+a} c ${50/i} ${0/s} ${110/i} -${70/s} ${110/i} -${155/s} c ${0/i} -${90/s} -${50/i} -${140/s} -${110/i} -${140/s} c -${65/i} ${0/s} -${110/i} ${50/s} -${110/i} ${140/s} c ${0/i} ${85/s} ${50/i} ${155/s} ${110/i} ${155/s}`}}},cameraOptions:{resolutions:{ideal:{horizontal:1440,vertical:900},minimum:{horizontal:1280,vertical:720}}}};class m{constructor(){this._availableCameras=[],this._observedDeviceCapabilities={cameras:{}},this.doDeviceProbe=()=>this.getAllDeviceCapabilities().then((e=>this.observedDeviceCapabilities={cameras:e.reduce(((e,t)=>Object.assign(Object.assign({},e),t)),{})})),this.getStream=(e=this._lastActiveDeviceId,t=void 0,i=this._configuration.cameraOptions.resolutions.minimum,s=this._configuration.cameraOptions.resolutions.ideal)=>this.stopStreaming().then((()=>this.getVideoCameras().then((a=>{if(void 0!==t){let i;i=t===p.BACK?a.filter((e=>this.isBackCameraLabel(e.label))):t===p.ENVIRONMENT?a.filter((e=>this.isBackDualWideCameraLabel(e.label))):a.filter((e=>!this.isBackCameraLabel(e.label))),i.sort(((e,t)=>e.label.localeCompare(t.label))),e=i.length>0?i[0].deviceId:e}return this.getUserMedia({video:Object.assign({width:{min:i.horizontal,ideal:s.horizontal},height:{min:i.vertical,ideal:s.vertical}},e?{deviceId:{exact:e}}:{})})})))).then((e=>this._stream=e)).then(this.reconcileDevice).then((e=>(this._lastActiveDeviceId=e?e.deviceId:void 0,this._currentDeviceId=e?e.deviceId:void 0,e))).then((e=>this.getDeviceCapabilities(this._stream,e))).then((e=>{this.observedDeviceCapabilities={cameras:Object.assign({},e)}})).then((()=>h.default.publish(n.JourneyEvent.CAMERA_READY,{camera:this._currentDeviceId}))).then((()=>this._stream)),this.stopStreaming=()=>new Promise((e=>(cancelAnimationFrame(this._animationHandle),this._stream?(this._stream.getVideoTracks().forEach((e=>e.stop())),this._stream=void 0,h.default.publish(n.JourneyEvent.CAMERA_STOP,{camera:this._lastActiveDeviceId}).then((()=>e()))):e()))),this.getVideoCameras=()=>navigator.mediaDevices&&0===this._availableCameras.length?navigator.mediaDevices.enumerateDevices().then((e=>e.filter((({kind:e})=>"videoinput"===e)))).then((e=>(e.some((e=>""!==e.label))&&(this._availableCameras=e),d.isFirefox&&this.getVideoCameras(),e))):Promise.resolve(this._availableCameras),this.getCameraPermission=()=>new Promise((e=>d.isFirefox?e(this.decideCameraPermission()):navigator.permissions?void navigator.permissions.query({name:"camera"}).then((({state:t})=>t===u.PROMPT?e(this.decideCameraPermission()):e(t))).catch((()=>{e(u.UNKNOWN)})):e(this.decideCameraPermission()))),this.decideCameraPermission=()=>new Promise((e=>{if(null!==this._lastCameraPermissionState&&void 0!==this._lastCameraPermissionState)return e(this._lastCameraPermissionState);var t=u.UNKNOWN;return this.getVideoCameras().then((e=>this.getUserMedia({video:{width:1920,height:1080,facingMode:{ideal:"environment"}},audio:!1}).then((e=>(t=u.GRANTED,e.getVideoTracks().forEach((e=>e.stop())),t))).catch((e=>t=u.DENIED)))).then((t=>(this._lastCameraPermissionState=t,e(t))))})),this.hasActiveStream=()=>!!this._stream&&this._stream.getTracks().length>0,this.getImageFromCurrentStream=(e={})=>this.resizeCanvas(this._videoContext,document.createElement("canvas")).then((e=>e.getContext("2d"))).then((t=>this.renderFrameToContext(t,e).canvas.toDataURL("image/jpeg"))),this.getBlobFromCurrentStream=(e={})=>new Promise((t=>this.resizeCanvas(this._videoContext,document.createElement("canvas")).then((e=>e.getContext("2d"))).then((i=>this.renderFrameToContext(i,e).canvas.toBlob((e=>t(e)),"image/jpeg"))))),this.getLivenessBlobFromCurrentStream=(e={})=>new Promise((t=>this.resizeLivenessCanvas(this._videoContext,document.createElement("canvas")).then((e=>e.getContext("2d"))).then((i=>this.renderLivenessFrameToContext(i,e).canvas.toBlob((e=>t(e)),"image/jpeg"))))),this.renderStreamToElement=(e=this._stream,t,i={})=>{if(e&&t){const{reticleType:s=r.ReticleType.NONE,hintType:a=r.HintType.NONE}=i;return this._videoContext=document.createElement("video"),this._videoContext.setAttribute("autoplay","true"),this._videoContext.setAttribute("loop","true"),this._videoContext.setAttribute("muted","true"),this._videoContext.setAttribute("playsinline","true"),this._videoContext.srcObject=e,this._videoContext.play().then((()=>{const e=this.resizeCanvas(this._videoContext,t);return h.default.publish(n.JourneyEvent.CAMERA_CANVAS_RESIZE,{isPortrait:this._videoContext.videoHeight>this._videoContext.videoWidth}),e})).then((e=>this.setReticlePath(s,e.width,e.height))).then((()=>{this._videoContext.addEventListener("resize",(()=>setTimeout((()=>{this.resizeCanvas(this._videoContext,t).then((e=>this.setReticlePath(s,e.width,e.height)))}),250)))})).then((()=>{cancelAnimationFrame(this._animationHandle),this._animationHandle=this.doFrameCycle(t.getContext("2d"),i)}))}return Promise.resolve()},this.setConfiguration=({overlay:e={},cameraOptions:t={}})=>{this._configuration=a(g,{overlay:e,cameraOptions:t})},this.clearCanvas=e=>{if(e instanceof HTMLCanvasElement){const t=e.getContext("2d");t.globalCompositeOperation="source-over",t.fillStyle="black",t.fillRect(0,0,e.width,e.height)}},this.doFrameCycle=(e,t)=>requestAnimationFrame((()=>{const{reticleType:i,watermark:s=!0,hintType:a=r.HintType.NONE}=t;this.renderFrameToContext(e,t),i&&this.renderReticles(e),this.renderHintType(e,a),s&&this.renderWatermark(e),this._animationHandle=this.doFrameCycle(e,t)})),this.renderReticles=e=>{this._reticlePath&&(this._reticleType?(e.fillStyle="rgba(0, 0, 0, 0)",e.fill(new Path2D(this._reticlePath)),e.strokeStyle="white",e.lineWidth=10,e.stroke(this._reticlePath)):(e.fillStyle="rgba(255, 255, 255, 0.75)",e.globalCompositeOperation="difference",e.fill(this._reticlePath)),e.globalCompositeOperation="source-over")},this.renderHintType=(e,t)=>{switch(e.fillStyle="rgba(255, 255, 255, 0.75)",t){case r.HintType.AUTOCAPTUREOFF:e.fill(new Path2D(((e,t,i=273.16,s=18)=>`\n\tM${e/2-i/2},${t-s} m 3.4805 0 l 1.4854 -4.4385 l 6.7676 0 l 1.4941 4.4385 h 3.4805 l -6.3457 -17.9999 l -4.0254 0 l -6.3369 17.9999 h 3.4805 z m 2.3643 -7.0576 l 2.4346 -7.2509 h 0.1406 l 2.4346 7.251 l -5.0098 -0 z m 25.0757 -10.9423 l 0 11.4873 c 0 2.2588 -1.5733 3.876 -4.0429 3.876 c -2.4785 0 -4.0429 -1.6172 -4.0429 -3.876 l 0 -11.4873 h -3.2608 l 0 11.7597 c 0 3.8672 2.9005 6.5127 7.3037 6.5127 c 4.3857 0 7.3037 -2.6455 7.3037 -6.5127 v -11.7597 h -3.2608 z m 6.509 2.7334 l 5.5634 0 l 0 15.2666 h 3.2344 l 0 -15.2666 l 5.5634 0 v -2.7334 l -14.3611 0 v 2.7334 z m 32.9353 6.2666 c 0 -5.8183 -3.5508 -9.2461 -8.2706 -9.2461 c -4.7285 0 -8.2704 3.4277 -8.2704 9.2461 c 0 5.8096 3.5419 9.2461 8.2704 9.2461 c 4.7198 0 8.2706 -3.4277 8.2706 -9.2461 z m -3.2783 0 c 0 4.0957 -2.0567 6.3193 -4.9923 6.3193 c -2.9267 0 -4.9921 -2.2236 -4.9921 -6.3193 c 0 -4.0957 2.0654 -6.3193 4.9921 -6.3193 c 2.9355 0 4.9923 2.2236 4.9923 6.3193 z m 28.8974 -2.9267 c -0.5538 -3.999 -3.63 -6.3193 -7.6201 -6.3193 c -4.7023 0 -8.2442 3.4277 -8.2442 9.2461 c 0 5.8096 3.498 9.2461 8.2442 9.2461 c 4.2801 0 7.1191 -2.7685 7.6201 -6.2051 l -3.2872 -0.0176 c -0.4131 2.1094 -2.1357 3.2959 -4.289 3.2959 c -2.918 0 -5.0098 -2.1885 -5.0098 -6.3193 c 0 -4.0605 2.0742 -6.3193 5.0185 -6.3193 c 2.1885 0 3.9024 1.2393 4.2803 3.3926 l 3.2872 0 z m 5.5749 11.9267 l 1.4854 -4.4385 h 6.7675 l 1.4943 4.4385 h 3.4805 l -6.3457 -17.9999 h -4.0254 l -6.337 17.9999 l 3.4805 0 z m 2.3642 -7.0576 l 2.4346 -7.251 h 0.1407 l 2.4346 7.251 h -5.0098 z m 13.7292 7.0576 h 3.2606 v -6.082 l 3.4454 0 c 4.1572 0 6.3896 -2.4961 6.3896 -5.959 c 0 -3.4365 -2.206 -5.959 -6.3457 -5.959 l -6.7499 0 v 17.9999 z m 3.2606 -8.7627 v -6.5127 h 2.9883 c 2.4434 0 3.5244 1.3183 3.5244 3.2344 c 0 1.916 -1.081 3.2783 -3.5069 3.2783 h -3.0059 z m 12.3712 -6.5039 h 5.5636 v 15.2666 h 3.2342 v -15.2666 h 5.5636 v -2.7334 l -14.3613 0 v 2.7334 z m 28.9714 -2.7334 v 11.4873 c 0 2.2588 -1.5731 3.876 -4.0429 3.876 c -2.4785 0 -4.0429 -1.6172 -4.0429 -3.876 v -11.4873 h -3.2608 v 11.7597 c 0 3.8672 2.9005 6.5127 7.3037 6.5127 c 4.3857 0 7.3037 -2.6455 7.3037 -6.5127 v -11.7597 h -3.2608 z m 7.3 17.9999 l 3.2608 0 v -6.5918 h 3.3223 l 3.5331 6.5918 h 3.6387 l -3.8936 -7.1367 c 2.1182 -0.8525 3.2344 -2.6631 3.2344 -5.1064 c 0 -3.4365 -2.2147 -5.7568 -6.3457 -5.7568 l -6.7499 0 v 17.9999 z m 3.2608 -9.2988 v -5.9765 l 2.9881 0 c 2.4346 0 3.5244 1.1162 3.5244 3.0322 c 0 1.916 -1.0898 2.9443 -3.5069 2.9443 l -3.0057 0 z m 13.3313 9.2988 l 11.7773 0 v -2.7334 l -8.5167 0 v -4.9131 l 7.84 0 v -2.7334 h -7.84 v -4.8867 h 8.4463 v -2.7334 l -11.7069 0 v 17.9999 z m 30.2042 -10.3095 l -8.1035 0 v 2.6191 l 8.1035 0 v -2.6191 z m 26.701 1.3096 c 0 -5.8183 -3.5516 -9.2461 -8.2706 -9.2461 c -4.7293 0 -8.2706 3.4277 -8.2706 9.2461 c 0 5.8096 3.5413 9.2461 8.2706 9.2461 c 4.719 0 8.2706 -3.4277 8.2706 -9.2461 z m -3.2794 0 c 0 4.0957 -2.0563 6.3193 -4.9912 6.3193 c -2.9267 0 -4.9933 -2.2236 -4.9933 -6.3193 c 0 -4.0957 2.0666 -6.3193 4.9933 -6.3193 c 2.9349 0 4.9912 2.2236 4.9912 6.3193 z m 6.8557 9 h 3.2608 v -7.6465 h 7.4807 v -2.7334 l -7.4807 0 v -4.8867 l 8.2706 0 v -2.7334 l -11.5314 0 v 17.9999 z m 14.9985 0 h 3.2608 v -7.6465 h 7.4786 v -2.7334 l -7.4786 0 v -4.8867 l 8.2706 0 v -2.7334 l -11.5314 0 v 17.9999 z\n`)(e.canvas.width,e.canvas.height)));break;case r.HintType.AUTOCAPTUREON:e.fill(new Path2D(((e,t,i=261.61,s=18)=>`\n\tM${e/2-i/2},${t-s} m 3.4828 0 l 1.4865 -4.4417 l 6.7726 0 l 1.4952 4.4417 h 3.483 l -6.3503 -18.0131 l -4.0283 0 l -6.3414 18.0131 h 3.483 z m 2.366 -7.0628 l 2.4363 -7.2562 h 0.1408 l 2.4363 7.2562 l -5.0135 0 z m 25.0941 -10.9503 l 0 11.4957 c 0 2.2605 -1.5744 3.8789 -4.0459 3.8789 c -2.4803 0 -4.0459 -1.6184 -4.0459 -3.8789 l 0 -11.4957 h -3.2632 l 0 11.7683 c 0 3.87 2.9024 6.5175 7.309 6.5175 c 4.3889 0 7.309 -2.6475 7.309 -6.5175 v -11.7683 h -3.2632 z m 6.5136 2.7354 l 5.5676 0 l 0 15.2777 h 3.2368 l 0 -15.2777 l 5.5674 0 v -2.7354 l -14.3718 0 v 2.7354 z m 32.9594 6.2713 c 0 -5.8225 -3.5534 -9.2529 -8.2764 -9.2529 c -4.7319 0 -8.2764 3.4302 -8.2764 9.2529 c 0 5.8139 3.5445 9.2529 8.2764 9.2529 c 4.7231 0 8.2764 -3.4302 8.2764 -9.2529 z m -3.2805 0 c 0 4.0987 -2.0582 6.3239 -4.9959 6.3239 c -2.9288 0 -4.9959 -2.2252 -4.9959 -6.3239 c 0 -4.0987 2.0671 -6.3239 4.9959 -6.3239 c 2.9377 0 4.9959 2.2252 4.9959 6.3239 z m 28.9183 -2.9288 c -0.554 -4.0019 -3.6324 -6.3239 -7.6257 -6.3239 c -4.7055 0 -8.25 3.4302 -8.25 9.2529 c 0 5.8139 3.5005 9.2529 8.25 9.2529 c 4.2834 0 7.1243 -2.7705 7.6257 -6.2095 l -3.2894 -0.0175 c -0.4134 2.1109 -2.1373 3.2983 -4.2921 3.2983 c -2.9201 0 -5.0135 -2.1901 -5.0135 -6.3239 c 0 -4.0636 2.0758 -6.3239 5.0221 -6.3239 c 2.1901 0 3.9053 1.2403 4.2834 3.3951 h 3.2894 z m 5.5792 11.9355 l 1.4865 -4.4417 h 6.7724 l 1.4954 4.4417 h 3.483 l -6.3503 -18.0131 l -4.0283 0 l -6.3416 18.0131 h 3.483 z m 2.366 -7.0628 l 2.4363 -7.2562 h 0.1408 l 2.4363 7.2562 h -5.0135 z m 13.7392 7.0628 h 3.263 v -6.0865 h 3.4479 c 4.1602 0 6.3943 -2.4979 6.3943 -5.9633 c 0 -3.439 -2.2077 -5.9633 -6.3503 -5.9633 l -6.7549 0 v 18.0131 z m 3.263 -8.7691 v -6.5175 h 2.9905 c 2.4452 0 3.527 1.3193 3.527 3.2368 c 0 1.9175 -1.0817 3.2807 -3.5094 3.2807 h -3.0081 z m 12.3803 -6.5086 h 5.5674 v 15.2777 h 3.2368 v -15.2777 h 5.5676 v -2.7354 l -14.3718 0 v 2.7354 z m 28.9926 -2.7354 v 11.4957 c 0 2.2605 -1.5744 3.8789 -4.0459 3.8789 c -2.4803 0 -4.0459 -1.6184 -4.0459 -3.8789 v -11.4957 h -3.2632 v 11.7683 c 0 3.87 2.9026 6.5175 7.309 6.5175 c 4.3889 0 7.309 -2.6475 7.309 -6.5175 v -11.7683 h -3.2632 z m 7.3053 18.0131 l 3.263 0 v -6.5965 h 3.3247 l 3.5358 6.5965 h 3.6413 l -3.8964 -7.1419 c 2.1197 -0.8531 3.2368 -2.665 3.2368 -5.1103 c 0 -3.439 -2.2163 -5.761 -6.3503 -5.761 l -6.7549 0 v 18.0131 z m 3.263 -9.3055 v -5.9809 h 2.9905 c 2.4363 0 3.527 1.117 3.527 3.0345 c 0 1.9175 -1.0906 2.9466 -3.5094 2.9466 h -3.0081 z m 13.3413 9.3055 l 11.7859 0 v -2.7354 l -8.5229 0 v -4.9167 l 7.8457 0 v -2.7354 h -7.8457 v -4.8902 h 8.4525 v -2.7354 l -11.7155 0 v 18.0131 z m 30.2262 -10.3171 l -8.1095 0 v 2.6211 l 8.1095 0 v -2.6211 z m 26.7205 1.3104 c 0 -5.8225 -3.5542 -9.2529 -8.2766 -9.2529 c -4.7328 0 -8.2766 3.4302 -8.2766 9.2529 c 0 5.8139 3.5439 9.2529 8.2766 9.2529 c 4.7224 0 8.2766 -3.4302 8.2766 -9.2529 z m -3.2818 0 c 0 4.0987 -2.0578 6.3239 -4.9949 6.3239 c -2.9288 0 -4.9969 -2.2252 -4.9969 -6.3239 c 0 -4.0987 2.0681 -6.3239 4.9969 -6.3239 c 2.9371 0 4.9949 2.2252 4.9949 6.3239 z m 21.6637 -9.0065 l -3.2446 0 v 12.2785 h -0.1589 l -8.4789 -12.2785 l -2.9206 0 v 18.0131 h 3.2632 v -12.2697 h 0.1507 l 8.4872 12.2697 l 2.902 0 v -18.0131 z\n`)(e.canvas.width,e.canvas.height)))}},this.renderWatermark=e=>{e.fillStyle="rgba(255, 255, 255, 0.75)",e.fill(new Path2D(((e,t,i=160,s=31)=>`\n\tM${e/2-i/2},${s} m22.03-12.583l-10.9664 0l-.9078 2.9528l8.6788 0c-.2796 1.7674-1.1798 3.3848-2.5464 4.575c-1.3666 1.19-3.1146 1.8788-4.9442 1.9482c-1.8296.0692-3.627-.4852-5.0838-1.5682c-1.457-1.0832-2.4828-2.6276-2.9016-4.3686c-.4188-1.741-.2048-3.57.6058-5.1736c.8104-1.6036 2.1668-2.882 3.8364-3.6158c1.6698-.734 3.5488-.8778 5.3152-.4068c1.7664.471 3.31 1.5274 4.3662 2.9882h3.6948c-1.1234-2.4514-3.1362-4.4098-5.6504-5.4976c-2.5142-1.0878-5.3516-1.2282-7.9654-.3938c-2.6138.8342-4.8188 2.5842-6.19 4.9122c-1.3712 2.328-1.8116 5.0694-1.2362 7.6958c.5754 2.6264 2.1258 4.9516 4.3524 6.5276c2.2266 1.576 4.9718 2.2912 7.7062 2.0076c2.7344-.2836 5.2646-1.5458 7.1026-3.5434c1.8382-1.9976 2.854-4.589 2.852-7.2748c-.0022-.5938-.0508-1.1868-.1452-1.7734zm11.1572-8.9288c1.1604-.0356 2.3026.2884 3.2632.9256c.9604.637 1.6898 1.5546 2.084 2.6212c.9078 2.1192.599 4.9566-1.607 6.4906c1.037.3658 1.928 1.0438 2.5448 1.9362c.6168.8924.9274 1.9532.8868 3.0294c0 3.2186-2.1696 6.4728-6.3548 6.4728h-9.9678l0-21.4758l9.1508 0zm-6.0006 18.4258h6.7904c.4462-.0072.886-.1034 1.2924-.283c.4066-.1794.7712-.4382 1.0714-.7606c.3002-.3222.5298-.7012.6744-1.1134c.1446-.4122.2012-.849.1664-1.2834c.0256-.4128-.0408-.826-.1944-1.2114c-.1536-.3854-.3906-.7336-.6952-1.021c-.3046-.2874-.669-.5068-1.0688-.6434c-.3996-.1366-.8246-.187-1.2462-.1478h-6.7904l0 6.464zm0-9.541l5.9372 0c3.4588 0 3.5222-5.9674.0634-5.9674l-6.0006 0v5.9674zm36.4944.0442l-10.9664 0l-.9078 2.9528l8.7422 0c-.2794 1.7674-1.1798 3.3848-2.5464 4.575c-1.3666 1.19-3.1146 1.8788-4.9442 1.9482c-1.8296.0694-3.627-.4852-5.0838-1.5682c-1.457-1.0832-2.4828-2.6276-2.9018-4.3686c-.4188-1.741-.2048-3.57.6058-5.1736c.8104-1.6036 2.1668-2.882 3.8364-3.6158c1.6698-.734 3.5488-.8778 5.3152-.4068c1.7664.471 3.31 1.5274 4.3662 2.9882h3.6948c-1.1274-2.4444-3.1412-4.3948-5.6532-5.4752c-2.5122-1.0804-5.3448-1.2144-7.9522-.3762c-2.6072.8382-4.8046 2.5894-6.1686 4.916c-1.364 2.3266-1.798 5.064-1.2184 7.6846c.5794 2.6206 2.1316 4.939 4.357 6.5082c2.2256 1.5694 4.967 2.2784 7.6962 1.991c2.729-.2876 5.2524-1.5518 7.084-3.5486c1.8318-1.9968 2.8418-4.5852 2.8356-7.2662c-.0006-.5944-.0522-1.1876-.1542-1.7734zm8.425-13.442v30.4404h1.2v-30.4404h-1.2zm9.0852 5.205l3.2046 0v20.9528h-3.2046v-20.9528zm7.7074.1948c2.038-.3326 4.0982-.5194 6.164-.5586c7.072 0 10.3764 3.4226 10.3764 10.8532c0 7.4306-3.268 10.7912-10.6032 10.7912c-1.9854-.011-3.9682-.1414-5.9372-.3902v-20.6954zm5.8646 18.2748c5.2744 0 7.3714-2.1192 7.3714-7.9182c0-5.799-2.097-8.14-7.1718-8.14c-.9592.0134-1.9168.0784-2.8686.195v15.7388c.9712.0976 1.9698.1242 2.669.1242zm12.7186-.3546c1.4916.3236 3.0116.5078 4.539.5498c1.9064 0 3.3046-.4878 3.3046-1.8532c0-1.3656-1.271-1.5962-3.5314-2.3144c-2.542-.8158-4.7026-1.7734-4.7026-4.4334c0-2.66 2.2968-4.4334 6.1642-4.4334c1.46.0122 2.9146.1756 4.3394.4876l-.3996 2.5802c-1.3172-.2728-2.6574-.427-4.0034-.461c-2.0064 0-3.005.6206-3.005 1.667c0 1.3034 1.507 1.5252 3.7676 2.2788c2.7234.8866 4.4754 1.8532 4.4754 4.4956c0 2.9614-2.1696 4.655-6.5362 4.655c-1.6286-.011-3.251-.1954-4.8388-.5496l.4268-2.669zm12.3736-4.762c0-4.7526 1.8974-7.7852 7.2626-7.7852c1.37.0142 2.7342.1778 4.067.4876l-.3178 2.5094c-1.197-.229-2.4118-.3596-3.6312-.3902c-3.1048 0-4.2668 1.4986-4.2668 5.2492c0 3.1568.8352 5.2138 3.9308 5.2138c1.4338-.0596 2.8464-.3594 4.176-.8866l.8262 2.4472c-1.6252.6814-3.37 1.0488-5.1384 1.0818c-4.775 0-6.9084-2.8728-6.9084-7.927zm19.5178-1.463c.9476.0022 1.894.0674 2.8326.195v-1.0374c0-2.1546-1.0714-2.873-3.1684-2.873c-1.501.0484-2.9908.2686-4.4392.6562l-.5356-2.5094c1.6862-.4596 3.4244-.7128 5.1746-.7538c3.6312 0 6.0006 1.472 6.0006 5.1518v10.2326h-2.2332l-.3358-1.2768c-1.2772 1.0312-2.8822 1.5956-4.5392 1.596c-2.8688 0-5.2744-1.596-5.2744-4.6906c0-3.0946 2.442-4.6906 6.518-4.6906zm-.699 6.943c1.2762-.0134 2.5142-.4268 3.5316-1.1794v-3.4138c-.908-.0974-2.1334-.1684-2.8052-.1684c-2.0972 0-3.4316.7182-3.4316 2.4118c0 1.6936 1.0984 2.3498 2.7052 2.3498zm10.2038-12.937h2.2696l.236 1.3034c1.4438-1.0304 3.178-1.6004 4.9658-1.6316c3.2682 0 5.0022 1.9242 5.0022 5.0542v10.33h-3.0322v-9.9754c0-1.8886-.9078-2.802-2.6326-2.802c-1.3446.0542-2.6492.4616-3.7766 1.1794v11.598h-3.0322v-15.0562z\n`)(e.canvas.width,e.canvas.height))),e.globalCompositeOperation="source-over"},this.resizeCanvas=(e,t)=>new Promise((i=>{t.width=e.videoWidth,t.height=e.videoHeight,i(t)})),this.resizeLivenessCanvas=(e,t)=>new Promise((i=>{t.width=e.videoWidth/3,t.height=e.videoHeight/3,i(t)})),this.renderFrameToContext=(e,t={})=>(this._videoContext&&(t.grayscale&&(e.globalCompositeOperation="luminosity"),e.globalCompositeOperation="source-over",t.mirror?(e.setTransform(-1,0,0,1,e.canvas.width,0),e.drawImage(this._videoContext,0,0,this._videoContext.videoWidth,this._videoContext.videoHeight,0,0,this._videoContext.videoWidth,this._videoContext.videoHeight),e.setTransform(1,0,0,1,0,0)):e.drawImage(this._videoContext,0,0,this._videoContext.videoWidth,this._videoContext.videoHeight,0,0,this._videoContext.videoWidth,this._videoContext.videoHeight),e.globalCompositeOperation="source-over"),e),this.renderLivenessFrameToContext=(e,t={})=>(this._videoContext&&(e.fillStyle="rgba(255, 255, 255, 1)",e.fillRect(0,0,e.canvas.width,e.canvas.height),e.drawImage(this._videoContext,0,0,this._videoContext.videoWidth,this._videoContext.videoHeight,0,0,this._videoContext.videoWidth/3,this._videoContext.videoHeight/3),e.globalCompositeOperation="source-over"),e),this.getAllDeviceCapabilities=()=>this.getVideoCameras().then((e=>this.getCameraCapabilitiesSequentially(e))).catch((e=>[])),this.getUserMedia=e=>new Promise(((t,i)=>(0,c.retryOperation)((()=>(0,c.wait)(200).then((()=>s(this,void 0,void 0,(function*(){return yield navigator.mediaDevices.getUserMedia(e)}))))),1e3,3).then(t).catch((e=>{switch(e.name){case"NotAllowedError":case"PermissionDismissedError":return i(l.ExceptionManager.process(new l.ExceptionManager.PlatformException(o.TranslationKey.EXCEPTION_PLATFORM_CAMERA_PERMISSION_DENIED,e)));case"NotReadableError":return i(l.ExceptionManager.process(new l.ExceptionManager.PlatformException(o.TranslationKey.EXCEPTION_PLATFORM_CAMERA_NOT_READABLE,e)));case"OverconstrainedError":return i(l.ExceptionManager.process(new l.ExceptionManager.PlatformException(o.TranslationKey.EXCEPTION_PLATFORM_CAMERA_NONE_SUITABLE,e)));default:return i(l.ExceptionManager.process(new l.ExceptionManager.Exception(o.TranslationKey.EXCEPTION,void 0,e)))}})))),this.reconcileDevice=e=>this.getVideoCameras().then((t=>Array.from(new Set(e.getVideoTracks().map((e=>t.find((t=>t.deviceId===e.getSettings().deviceId||t.label===e.label))))))[0])),this.setReticlePath=(e,t,i)=>{const{documentReticle:s,portraitReticle:a}=this._configuration.overlay;switch(e){case r.ReticleType.DOCUMENT:this._reticlePath=new Path2D(s.path(t,i)),this._reticleType=!1;break;case r.ReticleType.PORTRAIT:this._reticlePath=new Path2D(a.path(t,i)),this._reticleType=!0;break;case r.ReticleType.NONE:this._reticlePath=void 0;default:return}},this.getDeviceCapabilities=(e,{deviceId:t,label:i,groupId:s}={label:"",deviceId:"",groupId:""})=>e.getVideoTracks().map((e=>{const{aspectRatio:a={min:0,max:0},frameRate:r={min:0,max:0},width:n={min:0,max:0},height:o={min:0,max:0}}="function"!=typeof e.getCapabilities?this.GetCurrentTrackSettings(e):e.getCapabilities(),{facingMode:c=""}=e.getSettings();return{aspectRatio:{minimum:a.min,maximum:a.max},deviceId:t,deviceName:i,facingMode:c,frameRate:{minimum:r.min,maximum:r.max},groupId:s,resolutions:{minimum:{horizontal:n.min,vertical:o.min},maximum:{horizontal:n.max,vertical:o.max}}}})).reduce(((e,t)=>a(e,{[t.deviceId]:t})),{})}get observedDeviceCapabilities(){return a({},this._observedDeviceCapabilities)}set observedDeviceCapabilities(e){this._observedDeviceCapabilities=a(this._observedDeviceCapabilities,e),h.default.publish(n.JourneyEvent.CAMERA_CAPABILITIES_UPDATED,{capabilities:this._observedDeviceCapabilities})}get stream(){return this._stream}get currentDeviceId(){return this._currentDeviceId}hasDeviceCapableOfResolution({horizontal:e,vertical:t}=this._configuration.cameraOptions.resolutions.minimum){return!!d.isFirefox||Object.keys(this.observedDeviceCapabilities.cameras).some((i=>{const s=this.observedDeviceCapabilities.cameras[i].resolutions.maximum;return s.horizontal>=e&&s.vertical>=t}))}isBackCameraLabel(e){const t=/[a-z]/i.test(e);return["rear","back","rück","arrière","trasera","trás","traseira","posteriore","后面","後面","背面","задней","الخلفية","후","arka","achterzijde","หลัง","baksidan","bagside","sau","bak","tylny","takakamera","belakang","אחורית","πίσω","spate","hátsó","zadní","darrere","zadná","задня","stražnja","belakang","बैक"].some((i=>t?e.toLowerCase().includes(i.toLowerCase()):e.includes(i)))}isBackDualWideCameraLabel(e){const t=/[a-z]/i.test(e);return["Fotocamera doppia con grandangolo (posteriore)","Cámara trasera dual con gran angular","Rückseitige Dual-Weitwinkelkamera","Double appareil photo grand angle arrière","Back Dual Wide Camera","Tylny dwuobiektywowy aparat szerokokątny","Cameră dublă cu obiectiv superangular spate","Zadná duálna širokouhlá kamera","Zadní duální širokoúhlý fotoaparát","Dubbel vidvinkelkamera på baksidan","Çift Geniş Kamera Arka Yüzü","Dubbele groothoekcamera aan de achterkant","كاميرا خلفية مزدوجة عريضة"].some((i=>t?e.toLowerCase().includes(i.toLowerCase()):e.includes(i)))}getCameraCapabilitiesSequentially(e){return s(this,void 0,void 0,(function*(){let t,i=[];t=e.map((e=>()=>new Promise((t=>t(this.getCameraCapabilities(e))))));for(let e of t)try{var s=yield e();i.push(s)}catch(e){}return i}))}getCameraCapabilities(e){return this.getUserMedia({video:Object.assign({},e.deviceId?{deviceId:{exact:e.deviceId}}:{})}).then((t=>{t.getVideoTracks().forEach((e=>e.stop()));return this.getDeviceCapabilities(t,e)}))}GetCurrentTrackSettings(e){return{aspectRatio:{min:e.getSettings().aspectRatio,max:e.getSettings().aspectRatio},frameRate:{min:e.getSettings().frameRate,max:e.getSettings().frameRate},width:{min:e.getSettings().width,max:e.getSettings().width},height:{min:e.getSettings().height,max:e.getSettings().height}}}}t.CameraService=m,t.default=new m},3272:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.removeItems=function(e,t){const i=Array.isArray(t)?t:[t];return e.filter((e=>i.indexOf(e)<0))},t.allowItems=function(e,t){const i=Array.isArray(t)?t:[t];return e.filter((e=>i.indexOf(e)>=0))},t.containsItems=function(e,t){const i=Array.isArray(t)?t:[t];return e.some((e=>i.indexOf(e)>=0))}},3279:(e,t,i)=>{e.exports=i.p+"40809c361d3642a1e2ec.svg"},4062:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},4424:(e,t,i)=>{e.exports=i.p+"a39de283cf9d2bb2927b.svg"},4927:(e,t,i)=>{e.exports=i.p+"4d6c3a480d0c9ffc2bbc.svg"},5217:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TransformationService=void 0;class i{static coordinates(e){let t=[];if(e instanceof Array&&4===e.length)if("x"in e[0]){const i=[];e.map((e=>{"x"in e&&"y"in e&&i.push([e.x,e.y])})),t=i}else{const i=[];e.map((e=>{2===e.length&&i.push({x:e[0],y:e[1]})})),t=i}return t}}t.TransformationService=i,i.convert=(e,t)=>{let s;switch(e){case"coordinates":s=i.coordinates(t);break;case"journey-retrieval":s=i.journeyRetrievalObject(t);break;case"journey-upload":s=i.journeyUploadObject(t)}return s},i.journeyRetrievalObject=e=>"sample",i.journeyUploadObject=e=>{if(e.data&&e.data.entryData){const t=e.data.entryData,i={documents:[],holder:{address:{city:t["ExtractedFields.AddressCity"]?t["ExtractedFields.AddressCity"]:void 0,full:t["ExtractedFields.AddressFull"]?t["ExtractedFields.AddressFull"]:void 0,postCode:t["ExtractedFields.AddressPostCode"]?t["ExtractedFields.AddressPostCode"]:void 0},birthDate:t["ExtractedFields.BirthDate"]?t["ExtractedFields.BirthDate"]:void 0,birthPlace:t["ExtractedFields.BirthPlace"]?t["ExtractedFields.BirthPlace"]:void 0,firstName:t["ExtractedFields.FirstName"]?t["ExtractedFields.FirstName"]:void 0,fullName:t["ExtractedFields.FullName"]?t["ExtractedFields.FullName"]:void 0,gender:t["ExtractedFields.Sex"]?t["ExtractedFields.Sex"]:void 0,lastName:t["ExtractedFields.LastName"]?t["ExtractedFields.LastName"]:void 0,middleName:t["ExtractedFields.MiddleName"]?t["ExtractedFields.MiddleName"]:void 0},scanReference:t.ScanReference?t.ScanReference:void 0,scannerIp:t.ScannerIp?t.ScannerIp:void 0,glareCheck:t["QualityChecks.GlareCheck"]?t["QualityChecks.GlareCheck"]:void 0,blurCheck:t["QualityChecks.BlurCheck"]?t["QualityChecks.BlurCheck"]:void 0,lowResolutionCheck:t["QualityChecks.LowResolutionCheck"]?t["QualityChecks.LowResolutionCheck"]:void 0,fullDocumentInViewCheck:t["QualityChecks.FullDocumentInViewCheck"]?t["QualityChecks.FullDocumentInViewCheck"]:void 0,tripleScanReason:t.TripleScanReason?t.TripleScanReason:void 0},s={expirationDate:t["ExtractedFields.ExpiryDate"]?t["ExtractedFields.ExpiryDate"]:void 0,issueDate:t["ExtractedFields.IssueDate"]?t["ExtractedFields.IssueDate"]:void 0,issueNumber:t["ExtractedFields.IssueNumber"]?t["ExtractedFields.IssueNumber"]:void 0,number:t["ExtractedFields.DocumentNumber"]?t["ExtractedFields.DocumentNumber"]:void 0,covid:t["ExtractedFields.COVIDPASSCROSSCHECKRESULT"]?t["ExtractedFields.COVIDPASSCROSSCHECKRESULT"]:void 0,type:t.documentType?t.documentType:void 0};i.documents.push(s),e.data.entryData=i}return e}},5396:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},5455:()=>{HTMLCanvasElement.prototype.toBlob||Object.defineProperty(HTMLCanvasElement.prototype,"toBlob",{value(e,t,i){const s=this.toDataURL(t,i).split(",")[1];setTimeout((()=>{const i=atob(s),a=i.length,r=new Uint8Array(a);for(let e=0;e<a;e++)r[e]=i.charCodeAt(e);e(new Blob([r],{type:t||"image/png"}))}))}})},5458:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CaseDictionaryService=void 0;t.CaseDictionaryService=class{constructor(e){this.pascals=[],this.camels=[],this.types=[],this._dictionary=e,Object.keys(e).map((t=>{this.types.push(e[t].type),this.pascals.push(e[t].server),this.camels.push(e[t].client)}))}convert(e={},t){const i="beautify"===t?"client":"server";return"object"!=typeof e?e:Object.keys(e).reduce(((s,a)=>{const r=this._dictionary[Object.keys(this._dictionary).find((e=>this._dictionary[e]["client"===i?"server":"client"]===a))],n=!r||r.type!==t&&"both"!==r.type?a:r[i];return Object.assign(Object.assign({},s),{[n]:e[a]instanceof Array?e[a].map((e=>this.convert(e,t))):e[a]})}),{})}}},5880:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DataStore=t.DataStoreEvents=void 0;const s=i(3012),a=i(7007),r=i(2017);var n;!function(e){e.CHANGE="CHANGE",e.RESET="RESET"}(n||(t.DataStoreEvents=n={}));class o extends a.EventEmitter{constructor(e){super(),this.on=(e,t)=>super.on(e,t),this.getState=()=>s({},this._state),this.update=e=>{const t=this._state,i=s(this._state,e);return this._state=i,r(t,i)||this.emit(n.CHANGE,this.getState()),this},this.reset=()=>(this._state=s({},this._default),this.emit(n.RESET,this.getState()),this),this._default=s({},e),this._state=s({},this._default)}}t.DataStore=o},5982:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.HttpResponse=void 0;t.HttpResponse=class{constructor(e){this.data=e.data,this.status=e.status,this.statusText=e.statusText,this.headers=e.headers,this.config=e.config}}},6068:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},6227:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},6287:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},6297:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ReductionService=void 0;const s=i(5982);t.ReductionService=class{static reduce(e,t){const i=e instanceof s.HttpResponse,a=i?e.data:e;return Object.keys(t).map((e=>{!1===t[e]&&a[e]&&delete a[e]})),i?e.data=a:e=a,e}}},7091:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getPlatform=function(){return"object"==typeof process&&"object"==typeof process.versions&&void 0!==process.versions.node?"object"==typeof window?"JEST":"NODE":"BROWSER"}},7289:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},7338:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RenderingService=void 0;const s=i(6871),a=i(7091),r=i(7993);class n{constructor(){if(this.getElement=e=>{e=e.startsWith("#")?e.substr(1):e;const t=document.getElementById(e);return t||void 0},this.getElementBySelector=e=>Array.from(document.querySelectorAll(e))[0],this.getFile=e=>new Promise(((t,i)=>{if("undefined"!=typeof XMLHttpRequest){const s=new XMLHttpRequest;s.open("GET",e),s.onreadystatechange=()=>{200===s.status&&4===s.readyState&&t(s.response)},s.onerror=e=>i(e),s.send()}else i(r.ExceptionManager.process(new r.ExceptionManager.PlatformException(s.TranslationKey.EXCEPTION_PLATFORM_BROWSER_ONLY)))})),this.hideObject=(e,t="none")=>(e&&(e.style.display=t),e),this.showObject=(e,t="")=>(e&&(e.style.display=t),e),this.addClass=(e,t=[])=>(e&&e.classList.add(...t instanceof Array?t:[t]),e),this.removeClass=(e,t=[])=>(e&&e.classList.remove(...t instanceof Array?t:[t]),e),this.markSelected=(e,t="")=>(e&&(e.value=t),e),this.updateSelect=(e,t=[])=>(e&&(e.options.length=0,t.forEach((({name:t,value:i,selected:s=!1,disabled:a=!1},r)=>{const n=new Option(t,i,0===r,s);n.disabled=a,e.options.add(n)}))),this.markSelected(e,(t.find((e=>Boolean(e.selected)))||{value:void 0}).value)),this.supportsDragDrop=()=>"files"in DataTransfer.prototype,this.setText=(e,t="")=>(e&&(e.innerText=t,this.showObject(e)),e),this.setValue=(e,t="")=>(e&&(e.value=t,this.showObject(e)),e),this.setEnabled=(e,t=!0)=>(e&&(t?e.removeAttribute("disabled"):e.setAttribute("disabled","disabled")),e),this.setDataAttributeValue=(e,t="",i="")=>(e&&e.setAttribute(`data-${t}`,i.toString()),e),"NODE"===(0,a.getPlatform)())throw new Error("This feature cannot be used outside of a browser")}}t.RenderingService=n,t.default=new n},7461:(e,t)=>{var i;Object.defineProperty(t,"__esModule",{value:!0}),t.IdesMicroWorkerMessages=void 0,function(e){e.CheckComplete="CheckComplete",e.CheckFailed="CheckFailed",e.Initialise="Initialise",e.Terminate="Terminate",e.LoadingResources="LoadingResources",e.PerformQualityCheck="PerformQualityCheck",e.ReadyToProcess="ReadyToProcess",e.Error="Error"}(i||(t.IdesMicroWorkerMessages=i={}))},7497:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0});const s=i(7091),a=i(414);t.default=new class{constructor(){this._mockStorage={},this.set=(e,t,i)=>{const s=a.SecretService.encrypt({key:e,value:t,expiration:i,timestamp:Date.now()});this._storage.setItem(e,s)},this.get=e=>{if(this._storage.getItem(e))try{const t=this._storage.getItem(e),i=a.SecretService.decrypt(t||void 0);return this.isValid(i)?i.value:void 0}catch(t){throw this._storage.removeItem(e),t}},this.remove=e=>{this._storage.removeItem(e)},this.clear=()=>{this._storage.clear()},this.isValid=({timestamp:e,expiration:t}={})=>!(!e||!t)&&60*t*60*1e3>Date.now()-e,this.setMockStorage=()=>{let e={};return{clear:()=>e={},getItem:t=>e[t]?e[t]:void 0,removeItem:t=>delete e[t],setItem:(t,i)=>e[t]=i}},"BROWSER"===(0,s.getPlatform)()?this._storage=sessionStorage:this._storage=this.setMockStorage()}}},7645:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},7676:(e,t)=>{var i,s;Object.defineProperty(t,"__esModule",{value:!0}),t.PreProcessor=t.TemplateType=void 0,function(e){e.Function="function",e.Null="null",e.Promise="promise",e.String="string",e.Url="url"}(i||(t.TemplateType=i={})),function(e){e.None="none",e.Mustache="mustache"}(s||(t.PreProcessor=s={}))},7711:(e,t)=>{var i;Object.defineProperty(t,"__esModule",{value:!0}),t.SmartCaptureFailingReasons=void 0,function(e){e.CameraChanged="Camera Changed",e.ManualInputProviderChange="Manual Input Provider Change",e.Unknown="Unknown"}(i||(t.SmartCaptureFailingReasons=i={}))},7841:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},7892:(e,t,i)=>{e.exports=i.p+"6e542ce32cd5d44e2564.svg"},7993:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExceptionManager=void 0;const s=i(642),a=i(2538);var r;!function(e){e.process=function(e){return a.default.publish(s.JourneyEvent.ERROR,{exception:e}),e};class t extends Error{constructor(e,t="Exception",i){super(e),this.name=t,this.response=i,this.timestamp=Date.now()}}e.Exception=t;e.NetworkException=class extends t{constructor(e,t){super(e,"NetworkException",t)}};e.ServerException=class extends t{constructor(e,t){super(e,"ServerException",t)}};e.BadRequestException=class extends t{constructor(e,t){super(e,"BadRequestException",t)}};e.AuthorizationException=class extends t{constructor(e,t){super(e,"AuthorizationException",t)}};e.MissingParameterException=class extends t{constructor(e,t){super(e,"MissingParameterException",t)}};e.PlatformException=class extends t{constructor(e,t){super(e,"PlatformException",t)}};e.NotFoundException=class extends t{constructor(e,t){super(e,"NotFoundException",t)}};e.FlowStateException=class extends t{constructor(e,t){super(e,"FlowStateException",t)}};e.InvalidParameterException=class extends t{constructor(e,t){super(e,"InvalidParameterException",t)}};e.UnavailableInputProviderException=class extends t{constructor(e,t){super(e,"UnavailableInputProviderException",t)}};e.WebSocketException=class extends t{constructor(e,t){super(e,"WebSocketException",t)}};e.TemplateException=class extends t{constructor(e,t){super(e,"TemplateException",t)}}}(r||(t.ExceptionManager=r={}))},8737:(e,t,i)=>{e.exports=i.p+"3cee80a9b50c29621d40.svg"},8740:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AnimationService=void 0;const s=i(9891);t.AnimationService=class{static CreateAnimation(e,t,i,a,r){return s.loadAnimation({renderer:"svg",container:e,loop:i,autoplay:a,path:t,rendererSettings:r})}}},8916:(e,t,i)=>{e.exports=i.p+"6b4e545576ffc830a180.svg"},9342:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},9378:(e,t,i)=>{e.exports=i.p+"fc35d6a0ce9f9125169a.svg"},9613:(e,t,i)=>{e.exports=i.p+"0b9b632a196e2eddb651.svg"}}]);
//# sourceMappingURL=idscan-jcs-d91a9049.194314e02268c234efac.js.map