\n
Loading the Scandit SDK...
\n
\n
\n`,li=\"aria-valuenow\",ma=\"aria-valuemin\",pa=\"aria-valuemax\",Xe=class{constructor(){l(this,\"_mounted\",!1);l(this,\"_htmlRoot\",null);l(this,\"_progress\",null);l(this,\"_message\",null)}set value(e){var n,u,m,h,v,S;if(!this._mounted)return;if(e==null){(n=this._progress)==null||n.removeAttribute(li),(u=this._progress)==null||u.removeAttribute(\"style\");return}let t=Number((m=this._progress)==null?void 0:m.getAttribute(ma)),r=Number((h=this._progress)==null?void 0:h.getAttribute(pa));if(e>=t&&e<=r){let i=String(e);(v=this._progress)==null||v.setAttribute(li,i),(S=this._progress)==null||S.setAttribute(\"style\",`--aria-valuenow: ${i}`)}}get value(){var r;let e=(r=this._progress)==null?void 0:r.getAttribute(li);if(e===null)return null;let t=Number(e);return Number.isNaN(t)?null:t}set message(e){this._message&&(this._message.textContent=e)}get message(){var e,t;return(t=(e=this._message)==null?void 0:e.textContent)!=null?t:\"\"}mount(e){var r;if(this._mounted)return;if(!document.head.querySelector(`[data-component=${Xe.componentName}]`)){let n=document.createElement(\"style\");n.dataset.component=Xe.componentName,n.append(document.createTextNode(cr)),document.head.append(n)}let t=document.createElement(\"div\");t.classList.add(Z.PROGRESSBAR_CONTAINER),t.classList.add(Z.HIDE),t.innerHTML=da,(r=e.parentNode)==null||r.replaceChild(t,e),this._htmlRoot=t,this._progress=this._htmlRoot.querySelector(\"[role=progressbar]\"),this._message=this._htmlRoot.querySelector(`.${Z.MESSAGE}`),this._mounted=!0}unmount(){var e,t;!this._mounted||((e=this._htmlRoot)==null||e.remove(),(t=document.head.querySelector(`[data-component=${Xe.componentName}]`))==null||t.remove(),this._mounted=!1)}show(){this._mounted&&this._htmlRoot&&this._htmlRoot.classList.remove(Z.HIDE)}hide(){this._mounted&&this._htmlRoot&&this._htmlRoot.classList.add(Z.HIDE)}},bt=Xe;l(bt,\"componentName\",\"ProgressBarView\");var ur=bt;typeof window.ResizeObserver!=\"function\"&&(window.ResizeObserver=oi);var ha=(S=>(S.TopLeft=\"topLeft\",S.TopCenter=\"topCenter\",S.TopRight=\"topRight\",S.CenterLeft=\"centerLeft\",S.Center=\"center\",S.CenterRight=\"centerRight\",S.BottomLeft=\"bottomLeft\",S.BottomCenter=\"bottomCenter\",S.BottomRight=\"bottomRight\",S))(ha||{}),te=class{constructor(){l(this,\"_onInputFileChange\",null);l(this,\"_inputCheckFunction\",null);l(this,\"_scanAreaMargins\",D.DataCaptureView.scanAreaMargins);l(this,\"_pointOfInterest\",D.DataCaptureView.pointOfInterest);l(this,\"_logoStyle\",D.DataCaptureView.logoStyle);l(this,\"_logoAnchor\",D.DataCaptureView.logoAnchor);l(this,\"_logoOffset\",D.DataCaptureView.logoOffset);l(this,\"focusGesture\",D.DataCaptureView.focusGesture);l(this,\"zoomGesture\",D.DataCaptureView.zoomGesture);l(this,\"_cameraRecoveryText\",D.DataCaptureView.cameraRecoveryText);l(this,\"_context\",null);l(this,\"overlays\",[]);l(this,\"controls\",[]);l(this,\"controlWidgets\",new WeakMap);l(this,\"containerElement\");l(this,\"cameraPaintboardElement\");l(this,\"singleImageUploaderPaintboardElement\");l(this,\"videoElement\");l(this,\"visibilityListener\");l(this,\"videoPauseListener\");l(this,\"cameraRecoveryListener\");l(this,\"controlsElement\");l(this,\"cameraRecoveryElement\");l(this,\"errorElement\");l(this,\"canvasElement\");l(this,\"_canvasDrawer\");l(this,\"listeners\",[]);l(this,\"htmlElement\");l(this,\"htmlElementState\");l(this,\"lastHtmlElementState\");l(this,\"isVideoElementDetached\",!1);l(this,\"progressBarView\");l(this,\"lastFrameSourceState\");at.add(this),this.visibilityListener=this.checkAndRecoverPlayback.bind(this),this.cameraRecoveryListener=this.cameraRecovery.bind(this)}get scanAreaMargins(){return this._scanAreaMargins}set scanAreaMargins(e){var t;this._scanAreaMargins=e,(t=this.privateContext)==null||t.update()}get pointOfInterest(){return this._pointOfInterest}set pointOfInterest(e){var t;this._pointOfInterest=e,(t=this.privateContext)==null||t.update()}get logoStyle(){return this._logoStyle}set logoStyle(e){var t;this._logoStyle=e,(t=this.privateContext)==null||t.update()}get logoAnchor(){return this._logoAnchor}set logoAnchor(e){var t;this._logoAnchor=e,(t=this.privateContext)==null||t.update()}get logoOffset(){return this._logoOffset}set logoOffset(e){var t;this._logoOffset=e,(t=this.privateContext)==null||t.update()}get cameraRecoveryText(){return this._cameraRecoveryText}set cameraRecoveryText(e){this._cameraRecoveryText=e,this.cameraRecoveryElement.textContent=e}showProgressBar(){this.progressBarView.show()}hideProgressBar(){this.progressBarView.hide()}setProgressBarPercentage(e){this.progressBarView.value=e}setProgressBarMessage(e){this.progressBarView.message=e}get width(){return this.htmlElementState!=null?Math.round(this.htmlElementState.width):0}get height(){return this.htmlElementState!=null?Math.round(this.htmlElementState.height):0}get canvasDrawer(){return this._canvasDrawer||(this._canvasDrawer=new Ye(this.canvasElement)),this._canvasDrawer}get privateContext(){return this._context}static async forContext(e){let t=new te;return await t.setContext(e),t}getContext(){return this._context}async setContext(e){var t,r,n;if(this._context=e,e){if(this.overlays.length>0&&((t=this.privateContext)==null?void 0:t.modes.length)===0)throw new Error([\"Cannot assign this view to this context. This view has overlays but the context does not have any mode attached matching these overlays.\",\"Remove the overlays first before attaching the view to the context, or add the corresponding mode to the context before attaching this view.\"].join(\" \"));await e.setView(this),(r=this.privateContext)==null||r.subscribeToWorkerMessages(this.onWorkerMessage.bind(this)),(n=this._context)!=null&&n.frameSource&&await this.onFrameSourceChange(this._context.frameSource)}}connectToElement(e){this.setupHtmlElement(e),this.setupHtmlElementVisibility(),this.htmlElementDidChange()}async addOverlay(e){var t;this.overlays.includes(e)||(this.overlays.push(e),await((t=this.privateContext)==null?void 0:t.update([{type:\"addOverlay\",newValue:e}])))}async removeOverlay(e){var t;!this.overlays.includes(e)||(this.overlays.splice(this.overlays.indexOf(e),1),await((t=this.privateContext)==null?void 0:t.update([{type:\"removeOverlay\",newValue:e}])))}addListener(e){this.listeners.includes(e)||this.listeners.push(e)}removeListener(e){this.listeners.includes(e)&&this.listeners.splice(this.listeners.indexOf(e),1)}viewPointForFramePoint(e){var i,a,o,c,d,g,p,b;let t={width:(a=(i=this.htmlElementState)==null?void 0:i.width)!=null?a:0,height:(c=(o=this.htmlElementState)==null?void 0:o.height)!=null?c:0},r={width:(g=(d=this.videoElement)==null?void 0:d.videoWidth)!=null?g:0,height:(b=(p=this.videoElement)==null?void 0:p.videoHeight)!=null?b:0},n=t.width/t.height,u=r.width/r.height,m=n>u?t.width/r.width:t.height/r.height,h={x:e.x*m,y:e.y*m},v=(r.width*m-t.width)/2,S=(r.height*m-t.height)/2;return new de(h.x-v,h.y-S)}viewQuadrilateralForFrameQuadrilateral(e){let t=this.viewPointForFramePoint(e.topLeft),r=this.viewPointForFramePoint(e.topRight),n=this.viewPointForFramePoint(e.bottomLeft),u=this.viewPointForFramePoint(e.bottomRight);return new Ee(t,r,u,n)}addControl(e){var t;this.controls.includes(e)||(e.view=this,this.controls.push(e),this.controlsUpdated(),(t=this.privateContext)==null||t.update([{type:\"addControl\",newValue:e}]))}removeControl(e){var t;if(this.controls.includes(e)){e.view=null;let r=this.controls.splice(this.controls.indexOf(e),1);this.getControlWidget(r[0]).remove(!0),this.controlsUpdated(),(t=this.privateContext)==null||t.update([{type:\"removeControl\",newValue:e}])}}toJSONObject(){var e;return{scanAreaMargins:this.scanAreaMargins.toJSONObject(),pointOfInterest:this.pointOfInterest.toJSONObject(),logoAnchor:this.logoAnchor,logoOffset:this.logoOffset.toJSONObject(),logoHidden:(e=this.logoHidden)!=null?e:!1,logoStyle:this.logoStyle,overlays:this.overlays.map(t=>t.toJSONObject()),controls:this.controls.map(t=>t.toJSONObject()),focusGesture:this.focusGesture?this.focusGesture.toJSONObject():null,zoomGesture:this.zoomGesture?this.zoomGesture.toJSONObject():null}}isCameraRecoveryVisible(){return!this.cameraRecoveryElement.hidden}setCameraRecoveryVisible(e){this.cameraRecoveryElement.hidden=!e}setupHtmlElement(e){var u,m;this.createStyles(),this.htmlElement=e;let t=`\n