@scandit/web-datacapture-barcode 8.2.1 → 8.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/js/{BarcodeBatch-BEVGY-bY.d.ts → BarcodeBatch-E9nmjbAE.d.ts} +2 -2
- package/build/js/BarcodeBatch.d.ts +1 -1
- package/build/js/BarcodeBatchAdvancedOverlay.d.ts +2 -2
- package/build/js/BarcodeBatchBasicOverlay.d.ts +1 -1
- package/build/js/BarcodeCapture.d.ts +1 -1
- package/build/js/BarcodeCaptureOverlay.d.ts +1 -1
- package/build/js/PrivateBarcodeBatchAdvancedOverlayListener.d.ts +1 -1
- package/build/js/PrivateBarcodeBatchBasicOverlayListener.d.ts +1 -1
- package/build/js/{SparkScanView-DUcwRAxm.d.ts → SparkScanView-Cwz62wQh.d.ts} +1 -1
- package/build/js/SymbologyDescription.d.ts +1 -1
- package/build/js/ar/BarcodeAr.js +1 -1
- package/build/js/ar/BarcodeArFeedback.js +1 -1
- package/build/js/ar/BarcodeArPresenter.js +1 -1
- package/build/js/ar/BarcodeArView.js +1 -1
- package/build/js/ar/ui/atoms/private/BarcodeArInfoAnnotationHeaderFooterUtils.d.ts +1 -1
- package/build/js/chunks/{chunk-J4KUL4XN.js → chunk-27DZ2VG6.js} +1 -1
- package/build/js/chunks/chunk-4IGF5Q5F.js +1 -0
- package/build/js/chunks/{chunk-AC3ULD45.js → chunk-6AMPUMFL.js} +1 -1
- package/build/js/chunks/{chunk-FAYWVBAS.js → chunk-6CMIVFB4.js} +1 -1
- package/build/js/chunks/chunk-E2CSA33X.js +2 -0
- package/build/js/chunks/{chunk-R6AWN5DL.js → chunk-FFFNRYWI.js} +1 -1
- package/build/js/chunks/{chunk-SBAQY2WJ.js → chunk-H44PKJHU.js} +1 -1
- package/build/js/chunks/{chunk-7VVWXFDF.js → chunk-HKNJ33J2.js} +1 -1
- package/build/js/chunks/{chunk-QEA62LQD.js → chunk-L3JFVEX6.js} +1 -1
- package/build/js/chunks/{chunk-64CJPZJB.js → chunk-OV2B6MJ5.js} +1 -1
- package/build/js/chunks/chunk-PGXSKHUL.js +1 -1
- package/build/js/chunks/chunk-RLWDCJ7V.js +1 -0
- package/build/js/chunks/{chunk-P6XHJNAK.js → chunk-RYWX55SL.js} +1 -1
- package/build/js/chunks/{chunk-F4ZXJ2AL.js → chunk-TOJVFOMK.js} +1 -1
- package/build/js/chunks/{chunk-UN5Y2KA6.js → chunk-UDG4V7SV.js} +1 -1
- package/build/js/find/BarcodeFindView.js +1 -1
- package/build/js/find/index.js +1 -1
- package/build/js/global.d.d.ts +2 -0
- package/build/js/index.d.ts +2 -2
- package/build/js/index.js +1 -1
- package/build/js/moduleLoader.js +1 -1
- package/build/js/private/SmartScanSelectionOverlay.d.ts +1 -1
- package/build/js/spark/SparkScanOverlay.d.ts +1 -1
- package/build/js/spark/SparkScanSettings.d.ts +5 -1
- package/build/js/spark/SparkScanSettings.js +1 -1
- package/build/js/spark/index.d.ts +1 -1
- package/build/js/spark/index.js +1 -1
- package/build/js/spark/ui/SparkScanView.d.ts +1 -1
- package/build/js/spark/ui/SparkScanView.js +1 -1
- package/build/js/spark/ui/SparkScanViewMiniPreview.js +1 -1
- package/build/js/spark/ui/SparkScanViewPresenter.d.ts +1 -1
- package/build/js/spark/ui/SparkScanViewPresenter.js +1 -1
- package/build/js/spark/ui/SparkScanViewToolbar.js +1 -1
- package/build/js/spark/ui/SparkScanViewUiListener.d.ts +1 -1
- package/build/js/spark/ui/index.d.ts +1 -1
- package/build/js/spark/ui/index.js +1 -1
- package/build/js/worker/BarcodeArMode.d.ts +1 -1
- package/build/js/worker/BarcodeBatchMode.d.ts +1 -1
- package/build/js/worker/BarcodeCaptureMode.d.ts +1 -1
- package/build/js/worker/BarcodeCaptureWorkerManager.d.ts +1 -1
- package/build/js/worker/BarcodeCaptureWorkerManager.js +1 -1
- package/build/js/worker/BarcodeFindMode.d.ts +1 -1
- package/build/js/worker/SparkScanMode.d.ts +1 -1
- package/build/js/worker/WorkerMain.d.ts +1 -1
- package/build/js/worker/WorkerMain.js +1 -1
- package/build/js/worker/barcodeCapture.inlineWorker.js +1 -1
- package/build/js/worker/dataCaptureEngine.d.ts +1 -1
- package/build/js/worker/dataCaptureEngine.js +1 -1
- package/build/js/worker/dataCaptureWorkerRelated.d.ts +1 -1
- package/build/js/worker/index.d.ts +1 -1
- package/package.json +7 -5
- package/sdc-lib/resources/models/aus_mdl_keypoint_detection.17f1b2958a9e.model +0 -0
- package/sdc-lib/resources/models/barcode_classification_default.48685f5fe19b.model +0 -0
- package/sdc-lib/resources/models/barcode_keypoints_oned.6697cfdb9ce4.model +0 -0
- package/sdc-lib/resources/models/barcode_label_localization_mslc_model_s.616a59ec3a8d.model +0 -0
- package/sdc-lib/resources/models/barcode_localization_default.59f74a846b63.model +0 -0
- package/sdc-lib/resources/models/barcode_localization_dpm_default.7e4fe5631f81.model +0 -0
- package/sdc-lib/resources/models/barcode_localization_generic_postal_code_default.184ecbeb5b83.model +0 -0
- package/sdc-lib/resources/models/barcode_localization_oned_default.c547484132c1.model +0 -0
- package/sdc-lib/resources/models/barcode_localization_twod_default.4b64523bf755.model +0 -0
- package/sdc-lib/resources/models/barcode_ocr_fallback_ocr_default.5bc76b6823da.model +0 -0
- package/sdc-lib/resources/models/barcode_ocr_fallback_ocr_detector_default.d955dfe2835e.model +0 -0
- package/sdc-lib/resources/models/barcode_semantics_ocr_detector_default.d955dfe2835e.model +0 -0
- package/sdc-lib/resources/models/eu_dl_localization.c26fc357c7bd.model +0 -0
- package/sdc-lib/resources/models/id_ocr.a4a57703430a.model +0 -0
- package/sdc-lib/resources/models/id_outline_localization_model_kpts.b7f16ab1f44c.model +0 -0
- package/sdc-lib/resources/models/invalidated_id_classification_default.1cd0f5859941.model +0 -0
- package/sdc-lib/resources/models/mrz_line_localization.577844e2ebed.model +0 -0
- package/sdc-lib/resources/models/mrz_localization.77e331c44b52.model +0 -0
- package/sdc-lib/resources/models/ocr_barcode_semantics_default.adb845cfe44c.model +0 -0
- package/sdc-lib/resources/models/ocr_mrz_default.08761e1a9c3b.model +0 -0
- package/sdc-lib/resources/models/ocr_price_label_default.4ad5b33a61d3.model +0 -0
- package/sdc-lib/resources/models/price_label_localization.a8a9771e8fcc.model +0 -0
- package/sdc-lib/resources/models/price_localization_in_whole_label.555b33695325.model +0 -0
- package/sdc-lib/resources/models/text_semantics_ocr_detector.fb3a9fc4fb56.model +0 -0
- package/sdc-lib/resources/models/uk_dl_code_localization.c26fc357c7bd.model +0 -0
- package/sdc-lib/resources/models/via_id_template_database.578ae388d1d7.model +0 -0
- package/sdc-lib/resources/models/via_orientation_classification.19281ecdf9b6.model +0 -0
- package/sdc-lib/scandit-datacapture-sdk-barcode-pthreads.js +1 -1
- package/sdc-lib/scandit-datacapture-sdk-barcode-pthreads.wasm +0 -0
- package/sdc-lib/scandit-datacapture-sdk-barcode-simd-pthreads.js +1 -1
- package/sdc-lib/scandit-datacapture-sdk-barcode-simd-pthreads.wasm +0 -0
- package/sdc-lib/scandit-datacapture-sdk-barcode-simd.js +1 -1
- package/sdc-lib/scandit-datacapture-sdk-barcode-simd.wasm +0 -0
- package/sdc-lib/scandit-datacapture-sdk-barcode.js +1 -1
- package/sdc-lib/scandit-datacapture-sdk-barcode.wasm +0 -0
- package/build/js/chunks/chunk-6E42EK3T.js +0 -1
- package/build/js/chunks/chunk-FT7V66CF.js +0 -1
- package/build/js/chunks/chunk-IYVUSV45.js +0 -2
- package/sdc-lib/resources/models/barcode_classification_default.fde280355f0b.model +0 -0
- package/sdc-lib/resources/models/barcode_keypoints_oned.ef764d7717ba.model +0 -0
- package/sdc-lib/resources/models/barcode_label_localization_mslc_model_s.77afd87bb1ae.model +0 -0
- package/sdc-lib/resources/models/barcode_localization_default.ea245fd6454e.model +0 -0
- package/sdc-lib/resources/models/barcode_localization_dpm_default.313e68d94ae1.model +0 -0
- package/sdc-lib/resources/models/barcode_localization_generic_postal_code_default.42a9746ffe91.model +0 -0
- package/sdc-lib/resources/models/barcode_localization_oned_default.33db0e688e2c.model +0 -0
- package/sdc-lib/resources/models/barcode_localization_twod_default.547ff0613d2c.model +0 -0
- package/sdc-lib/resources/models/barcode_ocr_fallback_ocr_default.8c2870b758fd.model +0 -0
- package/sdc-lib/resources/models/barcode_ocr_fallback_ocr_detector_default.9e7b3e9f0b6c.model +0 -0
- package/sdc-lib/resources/models/barcode_semantics_ocr_detector_default.9e7b3e9f0b6c.model +0 -0
- package/sdc-lib/resources/models/eu_dl_localization.d02cb8506d3f.model +0 -0
- package/sdc-lib/resources/models/id_ocr.1740d002ffbf.model +0 -0
- package/sdc-lib/resources/models/invalidated_id_classification_default.655732a12364.model +0 -0
- package/sdc-lib/resources/models/mrz_line_localization.4573c5a05b53.model +0 -0
- package/sdc-lib/resources/models/mrz_localization.c6b469e57923.model +0 -0
- package/sdc-lib/resources/models/ocr_barcode_semantics_default.b60d72805695.model +0 -0
- package/sdc-lib/resources/models/ocr_mrz_default.8b80192212c2.model +0 -0
- package/sdc-lib/resources/models/ocr_price_label_default.1d18eb896da3.model +0 -0
- package/sdc-lib/resources/models/price_label_localization.b1f6616d5e10.model +0 -0
- package/sdc-lib/resources/models/price_localization_in_whole_label.614fcbe425d2.model +0 -0
- package/sdc-lib/resources/models/text_semantics_ocr_detector.290bf42945e3.model +0 -0
- package/sdc-lib/resources/models/uk_dl_code_localization.d02cb8506d3f.model +0 -0
- /package/build/js/chunks/{chunk-Z2LBBBJM.js → chunk-43YBURRI.js} +0 -0
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {b as b$1,a as a$2}from'./chunk-4PYZSS3H.js';import {h,i}from'./chunk-DVHTYKDX.js';import {a}from'./chunk-5Q3AHWJL.js';import {d,c,k,l,m,e,b}from'./chunk-4JEIREAU.js';import {a as a$1,c as c$1}from'./chunk-YBD5JYCX.js';import {ScanditHTMLElement,defineCustomElements,renderIf,html}from'@scandit/web-datacapture-core/build/js/private/utils/index.js';var S=class S extends ScanditHTMLElement{constructor(){super(...arguments);this.targetModeButtonTapListener=this.onTargetModeButtonTap.bind(this);this.scanningBehaviorButtonTapListener=this.onScanningBehaviorButtonTap.bind(this);this.barcodeFindButtonTapListener=this.onBarcodeFindButtonTap.bind(this);this.labelCaptureButtonTapListener=this.onLabelCaptureButtonTap.bind(this);this.cameraSwitchButtonTapListener=this.onCameraSwitchButtonTap.bind(this);this.computedStyle=getComputedStyle(this);}get[d](){return this.hasAttribute(d)}set[d](t){this.toggleAttribute(d,t);}get[c](){return this.hasAttribute(c)}set[c](t){this.toggleAttribute(c,t);}get[k](){return this.hasAttribute(k)}set[k](t){this.toggleAttribute(k,t);}get[l](){return this.hasAttribute(l)}set[l](t){this.toggleAttribute(l,t);}get[m](){return this.hasAttribute(m)}set[m](t){this.toggleAttribute(m,t);}get[e](){return this.hasAttribute(e)}set[e](t){this.toggleAttribute(e,t),this.targetModeButtonIcon&&(this.targetModeButtonIcon.fill=t?this.computedStyle.getPropertyValue(h):this.computedStyle.getPropertyValue(i));}get[b](){var t;return (t=this.getAttribute(b))!=null?t:"single"}set[b](t){this.setAttribute(b,t),this.scanningBehaviorButtonIcon&&(this.scanningBehaviorButtonIcon.fill=t==="continuous"?this.computedStyle.getPropertyValue(h):this.computedStyle.getPropertyValue(i));}get visibleButtonCount(){return [c,d,m].filter(t=>this[t]===true).length}get visibleModeButtonCount(){return [k,l].filter(t=>this[t]===true).length}get allVisibleButtonsCount(){return this.visibleButtonCount+this.visibleModeButtonCount}static create(){return defineCustomElements({[c$1]:S,[a$1]:a}),document.createElement(c$1)}enableCameraSwitchButton(t){this.cameraSwitchButtonIcon&&(this.cameraSwitchButtonIcon.fill=t?this.computedStyle.getPropertyValue(h):this.computedStyle.getPropertyValue(i));}render(){var T,w,y,C,E,f,k$1,L;let t=this[e]?this.computedStyle.getPropertyValue(h):this.computedStyle.getPropertyValue(i),p=this[b]==="continuous"?this.computedStyle.getPropertyValue(h):this.computedStyle.getPropertyValue(i),h$1=renderIf(this[k],html`<button id="barcodeFindButton" class="${c$1}__button ${c$1}__button--mode"><spark-scan-view-icon icon="find" fill="#3D4852" size="21.6"></spark-scan-view-icon></button>`),b$1=renderIf(this[l],html`<button id="labelCaptureButton" class="${c$1}__button ${c$1}__button--mode"><spark-scan-view-icon icon="label" fill="#3D4852" size="21.6"></spark-scan-view-icon></button>`),m$1=renderIf(this.visibleButtonCount>0&&this.visibleModeButtonCount>0,html`<div class="${c$1}__separator"></div>`),A=renderIf(this[d],html`<button id="targetModeButton" class="${c$1}__button"><spark-scan-view-icon icon="aimer" fill="${t}" size="18"></spark-scan-view-icon></button>`),I=renderIf(this[m],html`<button id="cameraSwitchButton" class="${c$1}__button"><spark-scan-view-icon icon="camera" fill="white" size="24.08"></spark-scan-view-icon></button>`),_=renderIf(this[c],html`<button id="scanningBehaviorButton" class="${c$1}__button"><spark-scan-view-icon icon="continuous" fill="${p}" size="24"></spark-scan-view-icon></button>`),x=this.visibleModeButtonCount===0&&this.allVisibleButtonsCount<=3?"center":"flex-start";this.innerHTML=html`<div class="container"><div class="${c$1}">${h$1} ${b$1} ${m$1} ${A} ${I} ${_}</div></div><style>.${c$1}{position:relative;display:flex;justify-content:${x};align-items:center;box-sizing:border-box;width:100%;height:48px;padding:6.75px 12px;gap:12px}${c$1} .container{border-bottom-left-radius:16px;border-bottom-right-radius:16px;overflow-x:scroll;-ms-overflow-style:none;scrollbar-width:none;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}.${c$1}::-webkit-scrollbar{display:none}.${c$1}__button{display:flex;justify-content:center;align-items:center;flex-shrink:0;width:40px;height:40px;border:none;background:0 0;cursor:pointer}.${c$1}__separator{width:1px;height:32px;flex-shrink:0;background:var(${i})}.${c$1}__button--mode{background:#f1f5f8;border-radius:50%}</style>`,this.targetModeButton=this.querySelector("#targetModeButton"),(T=this.targetModeButton)==null||T.addEventListener("pointerup",this.targetModeButtonTapListener),this.targetModeButtonIcon=(w=this.targetModeButton)==null?void 0:w.querySelector(a$1),this.scanningBehaviorButton=this.querySelector("#scanningBehaviorButton"),(y=this.scanningBehaviorButton)==null||y.addEventListener("pointerup",this.scanningBehaviorButtonTapListener),this.scanningBehaviorButtonIcon=(C=this.scanningBehaviorButton)==null?void 0:C.querySelector(a$1),this.barcodeFindButton=this.querySelector("#barcodeFindButton"),(E=this.barcodeFindButton)==null||E.addEventListener("pointerup",this.barcodeFindButtonTapListener),this.labelCaptureButton=this.querySelector("#labelCaptureButton"),(f=this.labelCaptureButton)==null||f.addEventListener("pointerup",this.labelCaptureButtonTapListener),this.cameraSwitchButton=this.querySelector("#cameraSwitchButton"),(k$1=this.cameraSwitchButton)==null||k$1.addEventListener("pointerup",this.cameraSwitchButtonTapListener),this.cameraSwitchButtonIcon=(L=this.cameraSwitchButton)==null?void 0:L.querySelector(a$1);}connectedCallback(){this[d]=true,this[m]=true,this.render();}disconnectedCallback(){var t,p,h,b,m;(t=this.targetModeButton)==null||t.removeEventListener("pointerup",this.targetModeButtonTapListener),(p=this.scanningBehaviorButton)==null||p.removeEventListener("pointerup",this.scanningBehaviorButtonTapListener),(h=this.barcodeFindButton)==null||h.removeEventListener("pointerup",this.barcodeFindButtonTapListener),(b=this.labelCaptureButton)==null||b.removeEventListener("pointerup",this.labelCaptureButtonTapListener),(m=this.cameraSwitchButton)==null||m.removeEventListener("pointerup",this.cameraSwitchButtonTapListener);}attributeChangedCallback(t,p,h){if(h!==p){this.render();let b=this.hidden;this.hidden=this.visibleModeButtonCount+this.allVisibleButtonsCount===0,this.hidden!==b&&this.dispatchEvent(new CustomEvent(b$1));}}onTargetModeButtonTap(t){t.stopPropagation(),this[e]=!this[e],this.dispatchEvent(new CustomEvent(a$2,{bubbles:true,detail:{tapped:"targetModeButton",enabled:this[e]}}));}onScanningBehaviorButtonTap(t){t.stopPropagation(),this[b]=this[b]==="continuous"?"single":"continuous",this.dispatchEvent(new CustomEvent(a$2,{bubbles:true,detail:{tapped:"scanningBehaviorButton",enabled:this[b]==="continuous"}}));}onBarcodeFindButtonTap(t){t.stopPropagation(),this.dispatchEvent(new CustomEvent(a$2,{bubbles:true,detail:{tapped:"barcodeFindButton"}}));}onLabelCaptureButtonTap(t){t.stopPropagation(),this.dispatchEvent(new CustomEvent(a$2,{bubbles:true,detail:{tapped:"labelCaptureButton"}}));}onCameraSwitchButtonTap(t){t.stopPropagation(),this.dispatchEvent(new CustomEvent(a$2,{bubbles:true,detail:{tapped:"cameraSwitchButton"}}));}};S.observedAttributes=[d,c,k,l,m];var $=S;export{$ as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {a}from'./chunk-HDODW33D.js';import {a as a$1}from'./chunk-LLMMR2TB.js';import {RadiusLocationSelection,NumberWithUnit}from'@scandit/web-datacapture-core';var c=class{constructor(){this.codeDuplicateFilter=a.SparkScanSettings.codeDuplicateFilter;this.scanIntention="manual";this.locationSelection=new RadiusLocationSelection(new NumberWithUnit(a.SparkScanSettings.locationSelection.radius,a.SparkScanSettings.locationSelection.unit));this.properties={};this.symbologies={};}get enabledSymbologies(){return Object.keys(this.symbologies).filter(t=>{var e;return (e=this.symbologies[t])==null?void 0:e.isEnabled})}settingsForSymbology(o){if(!this.symbologies[o]){let t=a$1.SymbologySettings[o];t._symbology=o,this.symbologies[o]=t;}return this.symbologies[o]}setProperty(o,t){this.properties[o]=t;}getProperty(o){return this.properties[o]}enableSymbologies(o){for(let t of o)this.enableSymbology(t,true);}enableSymbology(o,t){this.settingsForSymbology(o).isEnabled=t;}toJSONObject(){var e;let o={},t=Object.keys(this.symbologies);return {codeDuplicateFilter:this.codeDuplicateFilter,locationSelection:this.locationSelection.toJSONObject(),properties:{...this.properties},symbologies:t.reduce((n,s)=>{var r;let l=(r=this.symbologies[s])==null?void 0:r.toJSONObject();return l&&(n[s]=l),n},o),scanIntention:(e=this.scanIntention)!=null?e:null}}};export{c as a};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {DataCaptureLoader,Logger}from'@scandit/web-datacapture-core';function n(r){let s=URL.createObjectURL(new Blob(['"use strict";(()=>{var u={"scandit-datacapture-sdk-barcode-pthreads.wasm":{bytes:7955952},"scandit-datacapture-sdk-barcode-simd.wasm":{bytes:7739571},"scandit-datacapture-sdk-barcode.wasm":{bytes:7823559},"scandit-datacapture-sdk-barcode-simd-pthreads.wasm":{bytes:7872275}};function C(t){return typeof t=="object"&&t!=null}function k(t){if(typeof t=="string")return t;if(C(t)){if(typeof t.message=="string")return t.message}else if(typeof(t==null?void 0:t.toString)=="function")return t.toString();return"unknown error"}var d;(t=>{(l=>(l.Debug="debug",l.Info="info",l.Warn="warn",l.Error="error",l.Quiet="quiet"))(t.Level||(t.Level={}));let e=new Map([["debug",1],["info",2],["warn",3],["error",4],["quiet",5]]),r="debug";function a(l){r=l}t.setLevel=a;function i(l,...h){if(!(e.get(r)>e.get(l)))switch(l){case"debug":{console.debug(...h);break}case"info":{console.log(...h);break}case"warn":{console.warn(...h);break}case"error":{console.error(...h);break}}}t.log=i;function s(...l){i("warn",...l)}t.warn=s;function o(...l){i("debug",...l)}t.debug=o;function n(...l){i("info",...l)}t.info=n;function c(...l){i("error",...l)}t.error=c})(d||(d={}));var Re=class{constructor(t){if(typeof t!="function")throw new TypeError("FinalizationRegistry callback must be a function")}register(t,e,r){}unregister(t){return!1}};function ae(t){typeof t.FinalizationRegistry>"u"&&(t.FinalizationRegistry=Re)}function ie(t,e,r){let a=e*r,i=new Uint8ClampedArray(a*4),s=new Uint32Array(i.buffer);for(let o=0;o<a;o++){let n=t[o];s[o]=4278190080|n<<16|n<<8|n}return i}var x=class se extends Error{constructor(e){super(e.message),Object.setPrototypeOf(this,se.prototype),this.name=e.name}toString(){return`${this.name}: ${this.message}`}};var D=Promise.resolve(),q=!1,G=!1,A=!1,v,Y=1500,j="";async function ne(t){if(v==null)return;q=!0;let e;try{let r=new Promise((i,s)=>{e=setTimeout(()=>{d.debug(`IndexedDB database is blocked (timed out after ${Y}ms). If you are running a Debug wasm build, things are slower and the timeout can be configured via IndexedDBBlockedTimeoutMs in localStorage (requires page reload).`),s(new x({name:"BlockedIndexedDB",message:"IndexedDB database is blocked"}))},Y)}),a=new Promise((i,s)=>{v==null||v(t,o=>{o!=null?s(o):i()})});await Promise.race([a,r])}finally{e!==void 0&&clearTimeout(e),q=!1}}async function oe(t){return G?(A=t,D):(q?(G=!0,A=t,D=D.then(async()=>(G=!1,ne(A)))):(A=t,D=ne(t)),D)}function Ee(){FS.syncfs=((t,e)=>{oe(t).then(()=>e(),r=>e(r))})}async function de(t){if(j=t.writableDataPath,Y=t.indexedDBTimeoutMs,v=FS.syncfs,v==null)throw new Error("FS.syncfs is not available");Ee();try{FS.mkdir(j)}catch(e){if(e.code!=="EEXIST")throw v=void 0,e}try{FS.mount(IDBFS,{},j)}catch(e){throw v=void 0,e}return oe(!0)}var ce={};function Le(t){return[...new Uint8Array(t)].map(e=>{let r=e.toString(16);return r.length===1?`0${r}`:r}).join("")}async function*We(t){let e=t.getReader();try{for(;;){let{done:r,value:a}=await e.read();if(r)return;yield a}}finally{e.releaseLock()}}async function Ne(t){let e=[],r=0,a=0;for await(let s of We(t))e.push(s),r+=s.length;let i=new Uint8Array(r);for(let s of e)i.set(s,a),a+=s.length;return i.buffer}var He=(t=>(t.VALID="VALID",t.INVALID="INVALID",t.NOT_VERIFIABLE="NOT_VERIFIABLE",t))(He||{});async function _e(t,e,r){if(typeof crypto.subtle.digest!="function")return d.log(d.Level.Warn,`Insecure context (see https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts): The hash of the Scandit Data Capture library WASM file found at ${r} could not be verified`),"NOT_VERIFIABLE";try{let a=t instanceof Promise?await t:t,i=await crypto.subtle.digest("SHA-256",a),s=Le(i);return e==null?(d.log(d.Level.Warn,"The library hash is not defined or empty, cannot correctly verify integrity."),"NOT_VERIFIABLE"):s===e?(d.log(d.Level.Debug,`Data Capture library WASM integrity found at ${r} has been verified correctly.`),"VALID"):(d.log(d.Level.Warn,`The Scandit Data Capture library WASM file found at ${r} seems invalid: expected file hash doesn\'t match (received: ${s}, expected: ${e}). Please ensure the correct Scandit Data Capture file (with correct version) is retrieved.`),"INVALID")}catch(a){return d.log(d.Level.Warn,"Wasm response could not be verified",a),"NOT_VERIFIABLE"}}var X=new Map([["br",4.4],["gzip",2.9],["none",1]]);function ze(t){var e;let r="content-encoding";if(t==null||t.get(r)==null)return X.get("none");let a=new Set(((e=t.get(r))!=null?e:"").split(",").map(i=>i.trim()));for(let[i,s]of X)if(a.has(i))return s;return X.get("none")}function Ve(t){var e,r;if(t==null)return 0;let a=(e=ze(t))!=null?e:1,i=Number.parseInt((r=t.get("content-length"))!=null?r:"0",10);return Number.isNaN(i)?0:Math.floor(i*a*100)/100}function Je(t){let{pathname:e}=new URL(t);for(let[r,a]of Object.entries(ce))if(e.endsWith(r))return a.bytes;return 0}function le(t){ce=t}var Ue=(t,e)=>{let r=Ve(e);return r===0?Je(t):r};function $e(t,e,r,{onProgress:a,onError:i,onComplete:s}){if(!e.body)return[e];let o=Ue(t,e.headers),n=0,c=0;if(typeof TransformStream>"u")return d.warn("TransformStream is not supported in this environment. Progress tracking will be disabled."),[e];let[l,h]=r?e.body.tee():[e.body],m=l.pipeThrough(new TransformStream({async transform(g,f){try{n+=g.length,c=Number((n/o*100).toFixed(2)),o>0&&g.length>0&&c<100?a==null||a({percentage:c,loadedBytes:n,privateUri:t}):o===0&&g.length>0&&(a==null||a({percentage:null,loadedBytes:n,privateUri:t})),f.enqueue(g)}catch(b){f.error(b),i==null||i({error:b})}},flush(g){a==null||a({percentage:100,loadedBytes:n,privateUri:t}),s==null||s({percentage:100,loadedBytes:n,privateUri:t}),g.terminate()}}));return[new Response(m,{headers:new Headers(e.headers),status:e.status,statusText:e.statusText}),h]}async function K({wasmURI:t,expectedHash:e,verifyResponseHash:r,onProgress:a,onComplete:i,onError:s,referredOrigin:o}){let n=await fetch(t,{referrerPolicy:"origin",referrer:o!=null?o:""});if(!n.ok)throw new Error(`HTTP status code is not ok: ${n.status}, ${n.statusText}`);let[c,l]=$e(t,n,r,{onProgress:a,onError:s,onComplete:i});return l!=null&&_e(Ne(l),e,t),c}function ue({wasmURI:t,expectedHash:e,verifyResponseHash:r,progressCallback:a,successCallback:i,errorCallback:s,importObject:o,referredOrigin:n}){async function c(h){try{let m=await K({wasmURI:t,expectedHash:e,verifyResponseHash:r,onProgress:a,referredOrigin:n}),g=await(h!=null?h:m).arrayBuffer(),f=await self.WebAssembly.instantiate(g,o);i(f.instance,f.module)}catch(m){d.log(d.Level.Error,m),d.log(d.Level.Error,`Couldn\'t instantiate Scandit SDK DataCapture library at ${t}, did you configure the path for it correctly?`),s==null||s(m)}}async function l(){let h;try{h=await K({wasmURI:t,expectedHash:e,verifyResponseHash:r,onProgress:a,referredOrigin:n});let m=await self.WebAssembly.instantiateStreaming(h,o);i(m.instance,m.module)}catch(m){d.log(d.Level.Warn,m),d.log(d.Level.Warn,"WebAssembly streaming compile failed. Falling back to ArrayBuffer instantiation (this will make things slower)"),c((h==null?void 0:h.bodyUsed)===!0?void 0:h)}}typeof self.WebAssembly.instantiateStreaming=="function"?l():c()}async function Z(t,e,r,a){return new Promise((i,s)=>{t().then(i).catch(o=>{let n=e*2;if(n>r){s(o);return}a(o),self.setTimeout(()=>{Z(t,n,r,a).then(i).catch(s)},e)})})}function Q(t){var e,r;let a="unknown";if((e=t.href)!=null&&e.startsWith("blob:null/"))a="localhost";else{let i=((r=t.pathname)==null?void 0:r.length)>1&&!t.pathname.startsWith("/");a=new URL(i?t.pathname:t.origin).hostname}return a.startsWith("[")&&a.endsWith("]")?(a=a.slice(1,-1),a):(/^(\\d{1,3}\\.){3}\\d{1,3}$/.test(a)&&(a=a.split(".").map(i=>Number.parseInt(i,10).toString()).join(".")),a)}async function pe(t,e){async function r(){return importScripts(t)}try{await Z(r,250,4e3,i=>{d.log(d.Level.Warn,i),d.log(d.Level.Warn,`Couldn\'t retrieve Scandit Data Capture library at ${t}, retrying...`)}),self.Module.mainScriptUrlOrBlob=t;let a=self.SDC_WASM_JS_VERSION;return a!==e&&d.log(d.Level.Warn,`The Scandit Data Capture library JS file found at ${t} seems invalid: expected version doesn\'t match (received: ${a}, expected: ${e}). Please ensure the correct Scandit Data Capture file (with correct version) is retrieved.`),!0}catch(a){return d.log(d.Level.Error,a),!1}}var he=class{constructor(t){this.viewInfo=null,this.viewInfo=this.cloneViewInfo(t)}isSame(t){return this.viewInfo==null&&t==null?!0:this.viewInfo==null&&t!=null||this.viewInfo!=null&&t==null?!1:this.viewInfo.width===t.width&&this.viewInfo.height===t.height&&this.viewInfo.orientation===t.orientation&&this.viewInfo.viewFinderRect.origin.x===t.viewFinderRect.origin.x&&this.viewInfo.viewFinderRect.origin.y===t.viewFinderRect.origin.y&&this.viewInfo.viewFinderRect.size.width===t.viewFinderRect.size.width&&this.viewInfo.viewFinderRect.size.height===t.viewFinderRect.size.height}update(t){this.viewInfo=this.cloneViewInfo(t)}cloneViewInfo(t){return t?{...t,viewFinderRect:{origin:{...t.viewFinderRect.origin},size:{...t.viewFinderRect.size}}}:null}};var T=class{constructor(){this.promise=new Promise((t,e)=>{this.reject=e,this.resolve=t})}};var ee=class{constructor(t,e){this.workerFunctions=t,this.options=e,this.imageIdCounter=0,this.conversions=new Map}convertToJpeg(t,e){let r=this.imageIdCounter++,a=new T;this.conversions.set(r,a);let i=t.toBitmap();return this.workerFunctions.postMessage({type:"convertToJPEG",imageId:r,width:t.getWidth(),height:t.getHeight(),data:i,planes:t.getPlanes(),orientation:e,quality:this.options.quality},Array.from(new Set([i.buffer]))),a.promise}convertToBitmap(t){return{data:t.toBitmap(),byteOrder:1}}onConvertToJPEGResult(t,e){let r=this.conversions.get(t);r?(r.resolve(e),this.conversions.delete(t)):d.warn(`ImageConverterForwarder: Conversion for imageId ${t} not found in Map`)}};var O=class{constructor(t){this.options=t}get quality(){return this.options.quality}async convertToJpeg(t,e){try{let{width:r,height:a,planes:i}=this.validateAndExtractImageData(t);this.prepareCanvas(r,a);let s=this.processImageData(t,i,r,a);return await this.convertToJpegBytes(s,e)}catch(r){throw d.warn(`Failed to convert image to JPEG: ${r}`),r instanceof Error?r:new Error("Failed to convert image to JPEG")}}convertToBitmap(t){return{data:t.toBitmap(),byteOrder:1}}validateAndExtractImageData(t){let e=t.getWidth(),r=t.getHeight(),a=t.getPlanes();if(e<=0||r<=0)throw d.warn(`Invalid image dimensions: ${e}x${r}`),new Error(`Invalid image dimensions: ${e}x${r}`);if(!a||a.length===0)throw d.warn("ImageBuffer has no planes"),new Error("ImageBuffer has no planes");return{width:e,height:r,planes:a}}prepareCanvas(t,e){if(!this.ensureCanvas(t,e))throw new Error("Failed to create OffscreenCanvas");if(!this.canvas||!this.context)throw new Error("Canvas or context not properly initialized")}processImageData(t,e,r,a){let i=this.createImageDataFromBuffer(t,e,r,a);if(i===null)throw new Error("Failed to create ImageData");return this.validateImageData(i,r,a),i}validateImageData(t,e,r){var a;if(t.width!==e||t.height!==r)throw d.warn(`ImageData dimensions mismatch: expected ${e}x${r}, got ${t.width}x${t.height}`),new Error("ImageData dimensions mismatch");if(!t.data||t.data.length!==e*r*4)throw d.warn(`ImageData has invalid data length: expected ${e*r*4}, got ${((a=t.data)==null?void 0:a.length)||0}`),new Error("ImageData has invalid data length")}async convertToJpegBytes(t,e){if(!this.context||!this.canvas)throw new Error("Canvas or context not available");try{this.context.putImageData(t,0,0)}catch(s){throw d.warn(`Failed to put image data on canvas: ${s}`),new Error(`Failed to put image data on canvas: ${s}`)}let r=e!==0?this.applyRotation(this.canvas,e):this.canvas,a;try{a=await this.canvasToBlob(r)}catch(s){throw d.warn(`Failed to convert canvas to blob: ${s}`),new Error(`Failed to convert canvas to blob: ${s}`)}if(!a||a.size===0)throw d.warn("Canvas convertToBlob returned empty or null blob"),new Error("Failed to create JPEG blob");let i;try{i=await a.arrayBuffer()}catch(s){throw d.warn(`Failed to get array buffer from blob: ${s}`),new Error(`Failed to get array buffer from blob: ${s}`)}if(!i||i.byteLength===0)throw d.warn("Blob arrayBuffer returned empty or null buffer"),new Error("Failed to get array buffer from blob");return new Uint8Array(i)}ensureCanvas(t,e){try{return(!this.canvas||this.canvas.width!==t||this.canvas.height!==e)&&(this.canvas=this.getNewCanvas(t,e),this.context=this.canvas.getContext("2d")),this.context!==null}catch(r){return d.warn("Failed to create HTMLCanvasElement",r),!1}}createImageDataFromBuffer(t,e,r,a){let i=new Set(e.map(s=>s.channel));try{if(this.isYUVFormat(i)){let n=t.toBitmap();return!n||n.length!==r*a*4?(d.warn(`Invalid bitmap data from toBitmap(): expected ${r*a*4} bytes, got ${(n==null?void 0:n.length)||0}`),null):new ImageData(new Uint8ClampedArray(n),r,a)}if(this.isRGBAFormat(i))return this.createImageDataFromRGBAPlanes(e,r,a);if(this.isRGBFormat(i))return this.createImageDataFromRGBPlanes(e,r,a);if(this.isGrayscaleFormat(i))return this.createImageDataFromGrayscalePlanes(e,r,a);d.warn(`Unknown image format with channels: ${Array.from(i).join(", ")}, falling back to toBitmap()`);let s=t.toBitmap();if(!s||s.length===0)return d.warn("toBitmap() returned empty or null data"),null;let o=s.length/(r*a);return o===4?new ImageData(new Uint8ClampedArray(s),r,a):(d.warn(`Unsupported format: ${o} bytes per pixel`),null)}catch(s){return d.warn(`Failed to create ImageData: ${s}`),null}}isYUVFormat(t){return t.has(0)&&t.has(1)&&t.has(2)}isRGBAFormat(t){return t.has(3)&&t.has(4)&&t.has(5)&&t.has(6)}isRGBFormat(t){return t.has(3)&&t.has(4)&&t.has(5)&&!t.has(6)}isGrayscaleFormat(t){return t.has(0)&&!t.has(1)&&!t.has(2)}createImageDataFromRGBAPlanes(t,e,r){let a=t.find(c=>c.channel===3),i=t.find(c=>c.channel===4),s=t.find(c=>c.channel===5),o=t.find(c=>c.channel===6);if(!a||!i||!s||!o)return d.warn("Missing RGBA planes"),null;let n=new Uint8ClampedArray(e*r*4);for(let c=0;c<r;c++)for(let l=0;l<e;l++){let h=(c*e+l)*4;n[h]=this.getPixelFromPlane(a,l,c),n[h+1]=this.getPixelFromPlane(i,l,c),n[h+2]=this.getPixelFromPlane(s,l,c),n[h+3]=this.getPixelFromPlane(o,l,c)}return new ImageData(n,e,r)}createImageDataFromRGBPlanes(t,e,r){let a=t.find(n=>n.channel===3),i=t.find(n=>n.channel===4),s=t.find(n=>n.channel===5);if(!a||!i||!s)return d.warn("Missing RGB planes"),null;let o=new Uint8ClampedArray(e*r*4);for(let n=0;n<r;n++)for(let c=0;c<e;c++){let l=(n*e+c)*4;o[l]=this.getPixelFromPlane(a,c,n),o[l+1]=this.getPixelFromPlane(i,c,n),o[l+2]=this.getPixelFromPlane(s,c,n),o[l+3]=255}return new ImageData(o,e,r)}createImageDataFromGrayscalePlanes(t,e,r){let a=t.find(s=>s.channel===0);if(!a)return d.warn("Missing Y plane for grayscale"),null;let i=new Uint8ClampedArray(e*r*4);for(let s=0;s<r;s++)for(let o=0;o<e;o++){let n=(s*e+o)*4,c=this.getPixelFromPlane(a,o,s);i[n]=c,i[n+1]=c,i[n+2]=c,i[n+3]=255}return new ImageData(i,e,r)}getPixelFromPlane(t,e,r){let a=Math.floor(e/(t.subsamplingX||1)),i=Math.floor(r/(t.subsamplingY||1)),s=t.rowStride,o=t.pixelStride,n=i*s+a*o,c=t.data;return n<c.length?c[n]:0}applyRotation(t,e){let r=e*Math.PI/180,a=e===90||e===270||e===-90||e===-270,i=a?t.height:t.width,s=a?t.width:t.height,o=this.getNewCanvas(i,s),n=o.getContext("2d");if(!n)throw new Error("Failed to get 2D context for rotated canvas");return n.translate(i/2,s/2),n.rotate(r),n.translate(-t.width/2,-t.height/2),n.drawImage(t,0,0),o}};O.JPEG_IMAGE_MIME_TYPE="image/jpeg";var me=class extends O{getNewCanvas(t,e){return new OffscreenCanvas(t,e)}canvasToBlob(t){return t.convertToBlob({type:O.JPEG_IMAGE_MIME_TYPE,quality:this.options.quality})}};var R;(t=>{function e(){return"8.2.1"}t.sdkVersion=e})(R||(R={}));function Ge(t){return/^https?:\\/\\/(?:[^./]*\\.)*cdn.jsdelivr.net\\//.test(t)?{result:!0,cdnBaseURL:"https://cdn.jsdelivr.net/npm/"}:/^https?:\\/\\/(?:[^./]*\\.)*unpkg.com\\//.test(t)?{result:!0,cdnBaseURL:"https://unpkg.com/"}:{result:!1,cdnBaseURL:""}}function je(t){let e=/@scandit\\/web-datacapture-[a-z]+/i.exec(t);return e?e[0]:null}function ge(t,e,r){let a=e,i=Ge(a);if(i.result){let o=je(a);o!=null&&(a=`${i.cdnBaseURL}${o}@${t}/sdc-lib/`)}let s=r.replace(".wasm","");return i.result?{jsURI:`${a}${s}.js`,wasmURI:`${a}${s}.wasm`}:{jsURI:`${a}${s}.js?v=${t}`,wasmURI:`${a}${s}.wasm?v=${t}`}}var fe=class be{constructor(e,r){this.hintPresenterV2=null,this.MAX_NUMBER_OF_IMAGES_IN_FRAME_DATA_POOL=5,this.redrawInterval=1e3/30,this.redrawRequests=[],this._isDrawLoopRunning=!1,this.frameDataPool=new Map,this.lastFrameColorType="RGBA",this.lastFrameId=null,this.poorMansBenchmarkLogs=!1,this.writableDataPathStandard="/scandit_sync_folder",this.resourceFilesSubfolder="resources",this.performanceMetricsReporterTimer=void 0,this.lastMetricsReportTime=0,this.metricsReportInterval=1e3,this.performanceMetrics={frameDataPoolSize:0,cameraOutputFrames:0,redrawRequestsCount:0,actualRedrawsCount:0,frameProcessingStartedCount:0,frameProcessedCount:0,frameSkippedCount:0},this.frameProcessingStartedCount=0,this.frameProcessingFinishedCount=0,this.gestureListener=null,this.webPlatformHintPresenter=null,this.lastViewInfo=new he(null),this.lastFrameProcessingStartedCount=0,this.lastFrameProcessingFinishedCount=0,this.moduleHandler=e,this.workerFunctions=r,this._loadProgressCallback=this._loadProgressCallback.bind(this),le(this.getWasmMetadata())}get Module(){return this.moduleHandler.get()}set isDrawLoopRunning(e){this._isDrawLoopRunning=e,!e&&typeof this.loopTimeoutId=="number"&&(clearTimeout(this.loopTimeoutId),this.loopTimeoutId=void 0)}get isDrawLoopRunning(){return this._isDrawLoopRunning}prepareFrameForListener(e){let r=this.lastFrameId;if(this.frameDataPool.size>=this.MAX_NUMBER_OF_IMAGES_IN_FRAME_DATA_POOL){let o=this.frameDataPool.keys().next().value;o!=null&&this.frameDataPool.delete(o)}let a=e.getFrameData(),i=new Uint8ClampedArray(a);this.frameDataPool.set(r,{data:i,colorType:this.lastFrameColorType,frameId:r,width:e.getWidth(),height:e.getHeight()});let s=this.lastUsedModuleMirrorAxis==null?!1:this.lastUsedModuleMirrorAxis!==this.Module.Axis.None;return{frameId:r,width:e.getWidth(),height:e.getHeight(),isFrameSourceMirrored:s,colorType:this.lastFrameColorType}}createContext(e){var r,a,i,s,o;let n=this.getModeDeserializers(),c=Q(location);(c==="localhost"||c==="127.0.0.1")&&navigator.userAgent.includes("Electron")&&e.appName!=null&&(c+=`-${e.appName}`),this.parentDomain=e.parentDomain,this.contextDeserializer=new this.Module.DataCaptureContextDeserializer(this.writableDataPath,e.deviceId,e.context.deviceModelName,c,this.parentDomain,n,e.delayedRegistration,e.highEndBlurryRecognition,this.resourcePath);let l=this.contextDeserializer.contextFromJson(JSON.stringify(e.context));if(l==null){let p=this.contextDeserializer.getLastError();throw new Error(`Could not create the context: ${p}`)}let h=l.getView();this.context=l.getContext(),l.delete();let m=this.Module.DataCaptureContextListener.extend("DataCaptureContextListener",{didChangeStatus:(p,y)=>{this.contextDidChangeStatus(JSON.parse(y.toJson())),p.delete()},didStartObservingContext:p=>{this.didStartObservingContext(),p.delete()},didStopObservingContext:p=>{p.delete()}}),g=this.Module.DataCaptureContextFrameListener.extend("DataCaptureContextFrameListener",{onObservationStarted:p=>{p.delete()},onObservationStopped:p=>{p.delete()},onFrameProcessingStarted:(p,y)=>{this.workerFunctions.postMessage({type:"onFrameProcessingStarted"}),y.delete(),p.delete()},onFrameProcessingFinished:(p,y)=>{this.workerFunctions.postMessage({type:"onFrameProcessingFinished"}),y.delete(),p.delete()},onFrameSkipped:(p,y)=>{this.workerFunctions.postMessage({type:"onFrameSkipped"}),y.delete(),p.delete()}}),f=this.Module.GestureRecognizer.extend("GestureRecognizer",{setGestureListener:(p,y)=>{var F;(F=this.gestureListener)==null||F.delete(),this.gestureListener=p.clone(),p.delete()}});(r=this.gestureRecognizer)==null||r.delete(),this.gestureRecognizer=new f;let b=new m;this.context.addListener(b),b.delete();let P=new g;this.context.addFrameListener(P),P.delete(),this.setView(h),(a=this.view)==null||a.setGestureRecognizer(this.gestureRecognizer);let M=this.Module.PlatformHintPresenter.extend("PlatformHintPresenter",{setHintPresenter:p=>{p.delete()},showToast:p=>{this.workerFunctions.postMessage({type:"showToast",payload:JSON.parse(p)})},hideToast:p=>{this.workerFunctions.postMessage({type:"hideToast",payload:JSON.parse(p)})},showGuidance:p=>{this.workerFunctions.postMessage({type:"showGuidance",payload:JSON.parse(p)})},hideGuidance:p=>{this.workerFunctions.postMessage({type:"hideGuidance",payload:JSON.parse(p)})},startUpdateTimer:p=>{this.workerFunctions.postMessage({type:"startUpdateTimer",payload:{duration:{unit:"ms",value:p}}})},stopUpdateTimer:()=>{this.workerFunctions.postMessage({type:"stopUpdateTimer"})}});(i=this.hintPresenterV2)==null||i.delete(),this.hintPresenterV2=null,(s=this.webPlatformHintPresenter)==null||s.delete(),this.webPlatformHintPresenter=null,this.webPlatformHintPresenter=new M,this.view&&(this.hintPresenterV2=new this.Module.HintPresenterV2(this.webPlatformHintPresenter),(o=this.view)==null||o.setHintPresenterV2(this.hintPresenterV2)),this.webImageConverterInstance=this.getImageConverterInstance({quality:1}),this.Module.ImageConverter.setInstance(this.webImageConverterInstance)}convertToJPEGResult(e,r){this.webImageConverterInstance instanceof ee&&this.webImageConverterInstance.onConvertToJPEGResult(e,r)}getImageConverterInstance(e){return this.workerFunctions.getOffscreenCanvas()!=null?new me(e):new ee(this.workerFunctions,e)}onTap(e){var r;(r=this.gestureListener)==null||r.onTap(JSON.stringify(e))}hintPresenterV2Update(){var e;(e=this.hintPresenterV2)==null||e.update()}startReportingPerformanceMetrics(){this.performanceMetricsReporterTimer==null&&(this.lastMetricsReportTime=performance.now(),this.scheduleMetricsReporting())}scheduleMetricsReporting(){this.performanceMetricsReporterTimer=setTimeout(()=>{this.checkAndReportMetrics()},100)}checkAndReportMetrics(){let e=performance.now();e-this.lastMetricsReportTime>=this.metricsReportInterval&&(this.reportPerformanceMetrics(),this.performanceMetrics.cameraOutputFrames=0,this.performanceMetrics.redrawRequestsCount=0,this.performanceMetrics.actualRedrawsCount=0,this.lastMetricsReportTime=e),this._isDrawLoopRunning&&this.scheduleMetricsReporting()}async reportPerformanceMetrics(){let e=this.frameProcessingStartedCount-this.lastFrameProcessingStartedCount,r=this.frameProcessingFinishedCount-this.lastFrameProcessingFinishedCount;this.lastFrameProcessingStartedCount=this.frameProcessingStartedCount,this.lastFrameProcessingFinishedCount=this.frameProcessingFinishedCount;let a={cameraOutputFrames:this.performanceMetrics.cameraOutputFrames,redrawRequestsCount:this.performanceMetrics.redrawRequestsCount,actualRedrawsCount:this.performanceMetrics.actualRedrawsCount,frameDataPoolSize:this.performanceMetrics.frameDataPoolSize,frameProcessingStartedCount:e,frameProcessedCount:r,frameSkippedCount:this.performanceMetrics.frameSkippedCount};this.workerFunctions.postMessage({type:"performanceMetricsReport",payload:a})}deleteFrameData(e){this.frameDataPool.delete(e)}dispose(){var e,r,a,i;this.context.dispose(),this.frameDataPool.clear(),this.isDrawLoopRunning=!1,this.cleanupMetricsReporting(),(e=this.gestureRecognizer)==null||e.delete(),this.gestureRecognizer=null,(r=this.gestureListener)==null||r.delete(),this.gestureListener=null,(a=this.hintPresenterV2)==null||a.delete(),this.hintPresenterV2=null,(i=this.webPlatformHintPresenter)==null||i.delete(),this.webPlatformHintPresenter=null}cleanupMetricsReporting(){this.performanceMetricsReporterTimer!=null&&(typeof this.performanceMetricsReporterTimer=="number"?cancelAnimationFrame(this.performanceMetricsReporterTimer):clearTimeout(this.performanceMetricsReporterTimer),this.performanceMetricsReporterTimer=void 0)}flushAnalytics(){this.context.flushAnalytics()}extractCentaurusLicense(e){return{payload:{centaurus:{licenseKey:this.Module.LicenseUtils[be.get3dPartyLicenseKeyMethodName](e)}}}}getModeDeserializers(){return new this.Module.VectorDataCaptureModeDeserializer}loadLibrary(e){return this.libraryLoadingPromise!=null?this.libraryLoadingPromise:(this.libraryLoadingPromise=this.setup(e),this.libraryLoadingPromise)}processFrame(e){var r;if(this.context==null)return d.debug("[processFrame] Context is null, returning frame without processing"),{payload:e,transferables:[e.data.buffer]};this.lastFrameId=e.frameId;let a=e.data,i=e.colorType==="GRAYSCALE"?this.Module.ImageBufferFormat.Grayscale8:this.Module.ImageBufferFormat.Rgba8888;this.lastFrameColorType=e.colorType==="GRAYSCALE"?"GRAYSCALE":"RGBA";let s=this.Module.allocateUint8Array(a.byteLength);return this.Module.HEAPU8.set(a,s),(r=this.imageFrameSource)==null||r.outputFrame(s,e.width,e.height,i),{payload:e,transferables:[e.data.buffer]}}reportCameraProperties(e){this.context.setCameraProperties(e.deviceId,e.isFrontFacing,e.hasAutofocus)}requestFrameData(e){let r=this.frameDataPool.get(e);if(r==null)return{payload:{data:null,frameId:null,colorType:null}};if(r.data.buffer.byteLength===0)return this.frameDataPool.delete(e),{payload:{data:null,frameId:null,colorType:null}};let a=r.data;r.colorType==="GRAYSCALE"&&(a=ie(r.data,r.width,r.height));let i={payload:{data:a,frameId:r.frameId,colorType:r.colorType},transferables:[a.buffer]};return this.frameDataPool.delete(e),i}scheduleRedraw(e,r){this.addRedrawRequest(r),this.isDrawLoopRunning||this.startDrawLoop(e)}sendViewRefreshCommands(e){this.workerFunctions.postMessage({type:"draw",payload:e},[e.buffer])}setFrameSource(e,r){var a;this.lastUsedModuleMirrorAxis=this.mapMirrorAxisOnModule(e),(a=this.imageFrameSource)==null||a.delete(),this.imageFrameSource=new this.Module.ImageBufferFrameSource(this.lastUsedModuleMirrorAxis,r,0),this.context.setFrameSource(this.imageFrameSource)}startDrawLoop(e){this.isDrawLoopRunning=!0;let r=s=>this.redrawRequests.length>0&&this.redrawRequests[0]<=s,a=s=>{for(;this.redrawRequests.length>0&&this.redrawRequests[0]<=s;)this.redrawRequests.shift()},i=()=>{this.loopTimeoutId=setTimeout(()=>{if(!this.isDrawLoopRunning)return;let s=performance.now();if(r(s)){a(s),e.draw();let o=e.getDrawCommands();this.sendViewRefreshCommands(new Uint8Array(o))}i()},this.redrawInterval)};i()}updateContext(e){if(this.context!=null&&this.contextDeserializer!=null){e.view!=null&&!e.view.visible&&this.context.flushAnalytics();let r=this.onBeforeUpdateContextHook(e),a=this.contextDeserializer.updateContextFromJson(this.context,this.view,JSON.stringify(r.context));if(a==null){let s=this.contextDeserializer.getLastError();throw new Error(`Could not update the context: ${s}`)}this.context.delete(),this.context=a.getContext();let i=a.getView();a.delete(),i!=null&&r.view!=null&&(i.setViewSize(r.view.width,r.view.height,r.view.orientation),i.draw()),!this.hintPresenterV2&&this.webPlatformHintPresenter&&(this.hintPresenterV2=new this.Module.HintPresenterV2(this.webPlatformHintPresenter)),i!=null&&this.hintPresenterV2&&i.setHintPresenterV2(this.hintPresenterV2),this.gestureRecognizer!=null&&(i==null||i.setGestureRecognizer(this.gestureRecognizer)),this.setView(i),this.notifyMainThreadOnViewInfoChanged(i),d.debug("context updated",r)}}notifyMainThreadOnViewInfoChanged(e){let r=this.getViewInfo(e);this.lastViewInfo.isSame(r)||(this.lastViewInfo.update(r),this.workerFunctions.postMessage({type:"viewSizeChanged",payload:r}))}getViewInfo(e){if(e!=null)try{let r=JSON.parse(e.getViewInfo());if(r!=null){let a=this.getOrientationFromNumber(r.orientation);return{...r,orientation:a}}}catch(r){d.error("Failed to get view size",r)}return null}getOrientationFromNumber(e){switch(e){case 90:return"landscapeRight";case 180:return"portraitUpsideDown";case 270:return"landscapeLeft";default:return"portrait"}}onBeforeUpdateContextHook(e){return e}onDocumentVisibilityChange(e){e==="hidden"&&this.context.flushAnalytics()}isFeatureSupported(e){return{payload:{supported:this.context.isFeatureSupported(e)}}}getViewfinderInfo(){var e,r;return{payload:{isDisplayingViewfinder:(r=(e=this.view)==null?void 0:e.isDisplayingViewfinder())!=null?r:!1,rect:JSON.parse(this.view.getViewfinderRect())}}}getOpenSourceSoftwareLicenseInfo(){return{payload:{licenseText:this.Module.OpenSourceSoftwareLicenseInfo.getLicenseText()}}}getWasmDynamicLibraries(e){return this.getWasmSideModuleFileName()==null?[]:[`${e.replace(/\\/[^/]*$/,"/")}${this.getWasmSideModuleFileName()}`]}getWasmCoreExpectedHash(e,r){return r?e?"44eadcb5e36da3e39236c267d022d41b21155b628056947f2efd7b89ce2d3d4c":"a9ec86f920e77189b02053f014e21e3547323b1351599a6bdf8ac3acfc8fd9e3":e?"4226e9075d67fb4f8194a6296637f1ca8701d33a33990b54036df465ad172257":""}getWasmCoreFileName(e,r){return r?e?"scandit-datacapture-sdk-barcode-simd-pthreads.wasm":"scandit-datacapture-sdk-barcode-pthreads.wasm":e?"scandit-datacapture-sdk-barcode-simd.wasm":""}getWasmMetadata(){return u}getWasmSideModuleFileName(){return""}_loadProgressCallback(e){this.workerFunctions.postMessage({type:"loadLibraryProgress",payload:e})}addRedrawRequest(e){this.redrawRequests.push(Math.round(performance.now())+e),this.redrawRequests.sort((r,a)=>r-a)}contextDidChangeStatus(e){e.code===260?e.message=e.message.replace("domain name",`domain name (${Q(location)})`):e.code===265&&(e.message=e.message.replace("domain name",`domain name (${this.parentDomain})`)),this.workerFunctions.postMessage({type:"contextDidChangeStatus",payload:e})}didStartObservingContext(){this.workerFunctions.postMessage({type:"didStartObservingContext"})}mapMirrorAxisOnModule(e){switch(e){case"None":return this.Module.Axis.None;case"X":return this.Module.Axis.X;case"Y":return this.Module.Axis.Y;default:return this.Module.Axis.None}}setView(e){this.view=e,this.setViewRefreshHandler(e),e==null&&(this.isDrawLoopRunning=!1,this.sendViewRefreshCommands(new Uint8Array([])))}addNativeOverlay(e){d.warn("addNativeOverlay has not been implemented for this module",e)}removeNativeOverlay(e){d.warn("removeNativeOverlay has not been implemented for this module",e)}setViewRefreshHandler(e){if(e==null||e.isViewRefreshHandlerSet)return;let r=this.Module.NeedsRedrawDelegate.extend("NeedsRedrawDelegate",{setNeedsRedrawIn:this.scheduleRedraw.bind(this,e)}),a=new r;e.setNeedsRedrawDelegate(a),e.isViewRefreshHandlerSet=!0}setupDataDecoding(){let e=this.moduleHandler.get(),r=e.DataDecoding.extend("DataDecoding",{decode(a,i){try{let s=JSON.parse(i),o=[];for(let n of s){let c=new TextDecoder(n.ianaName,{fatal:!0});o.push(c.decode(a.slice(n.startIndex,n.endIndex)))}return o.join("")}catch{return""}}});e.setDataDecoding(new r)}start(e,r,a){e&&r&&(this.setupDataDecoding(),this.moduleHandler.get().callMain(),this.moduleHandler.get().__emscripten_proxy_main!==void 0||a())}getWritableDataPath(e){return e!=null?(d.debug(`IndexedDB database name override in use to recover from blocked standard database: ${e}`),e):this.writableDataPathStandard}numOfMBToPages(e){return Math.ceil(1024*e*1024/64/1024)}async setup({libraryLocation:e,locationPath:r,writableDataPathOverride:a,indexedDBTimeoutMs:i,verifyResponseHash:s,referredOrigin:o,fixedWasmMemory:n,simdSupport:c,threadsSupport:l}){var h;let m=!1,g=!1;this.writableDataPath=this.getWritableDataPath(a),this.resourcePath=`${e}${this.resourceFilesSubfolder}/`,self.path=r;let{resolve:f,reject:b,promise:P}=new T,M=R.sdkVersion();if(M==="")throw new x({name:"Invalid library version",message:"Library version is not defined or empty, cannot generate proper path to library files."});let p=this.getWasmCoreFileName(c,l),y=ge(M,e,p),{jsURI:F,wasmURI:re}=y,xe={instantiateWasm:(S,Ae)=>(ue({importObject:S,wasmURI:re,expectedHash:this.getWasmCoreExpectedHash(c,l),verifyResponseHash:s,successCallback:Ae,progressCallback:this._loadProgressCallback,errorCallback:Te=>{b(Te)},referredOrigin:o}),{})},B=n===null?null:new WebAssembly.Memory({initial:this.numOfMBToPages(n),maximum:this.numOfMBToPages(300),shared:l});return B!==null&&d.log(d.Level.Debug,"Fixed wasmMemory set",B),this.moduleHandler.set({...B?{wasmMemory:B}:{},mainScriptUrlOrBlob:F,canvas:(h=this.workerFunctions.getOffscreenCanvas())!=null?h:{getContext:()=>null},...xe,dynamicLibraries:this.getWasmDynamicLibraries(re),locateFile:S=>e+S,noInitialRun:!0,preRun:[async()=>{try{await de({writableDataPath:this.writableDataPath,indexedDBTimeoutMs:i})}catch(S){if(S.name==="BlockedIndexedDB"){b(S.toString());return}d.log(d.Level.Debug,"No IndexedDB support, some data will not be persisted:",S)}g=!0,this.start(g,m,f)}],onMainComplete:()=>{if([m,g].includes(!1)){d.log(d.Level.Warn,{runtimeLoaded:m,fileSystemSynced:g},"Both runtimeLoaded and fileSystemSynced should be true when calling onMainComplete"),b("onMainComplete has been called but runtime or file system was not ready.");return}f()},onRuntimeInitialized:()=>{m=!0,this.start(g,m,f)},print:S=>{d.info(S)}}),await pe(F,M)||b(`Couldn\'t retrieve Scandit Data Capture library at ${F}, did you configure the path for it correctly?`),P}};fe.get3dPartyLicenseKeyMethodName=atob("Z2V0QmxpbmtJZExpY2Vuc2VLZXk=");var I=fe;function ye(t){return typeof t=="object"&&t!=null&&t.document==null&&"addEventListener"in t&&typeof t.importScripts=="function"}function Se(t){console.warn("Reached unexpected case",t)}var te=class{constructor(t,e){this.onMessageListener=this.onMessage.bind(this),this.workerSelf=t,this.dataCaptureInstance=new I(e,{postMessage:this.postMessage.bind(this),getOffscreenCanvas:this.getOffscreenCanvas.bind(this)}),ye(t)&&(ae(t),this.listenToMessages())}listenToMessages(){this.workerSelf.addEventListener("message",this.onMessageListener),this.workerSelf.addEventListener("error",t=>{d.log(d.Level.Error,t)}),this.workerSelf.addEventListener("messageerror",t=>{d.log(d.Level.Error,t)})}postMessage(t,e){this.workerSelf.postMessage(t,e!=null?e:[])}getOffscreenCanvas(){if(this.isOffscreenCanvasSupported())return new this.workerSelf.OffscreenCanvas(32,32)}isOffscreenCanvasSupported(){return typeof this.workerSelf.OffscreenCanvas=="function"}hasPayload(t){return C(t)&&"payload"in t}hasTransferables(t){return C(t)&&Array.isArray(t.transferables)}async respondWith(t,e,r){let a=null,i;try{i=r(),i instanceof Promise&&(i=await i)}catch(o){i=void 0,a=k(o)}let s={type:"workerTaskId",command:t,id:e,payload:this.hasPayload(i)?i.payload:void 0};a!=null&&(s.error=a),this.postMessage(s,this.hasTransferables(i)?i.transferables:[])}onMessage(t){switch(t.data.command){case"loadLibrary":{{let{data:e}=t;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.loadLibrary({libraryLocation:e.libraryLocation,locationPath:e.locationPath,referredOrigin:e.referredOrigin,writableDataPathOverride:e.writableDataPathOverride,threadsSupport:e.threadsSupport,simdSupport:e.simdSupport,verifyResponseHash:e.verifyResponseHash,fixedWasmMemory:e.fixedWasmMemory,indexedDBTimeoutMs:e.indexedDBTimeoutMs}))}break}case"onTap":{{let{data:e}=t;this.respondWith(e.command,e.id,async()=>{this.dataCaptureInstance.onTap(e.point)})}break}case"hintPresenterV2update":{{let{data:e}=t;this.respondWith(e.command,e.id,async()=>{this.dataCaptureInstance.hintPresenterV2Update()})}break}case"createContext":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.createContext({context:e.context,deviceId:e.deviceId,delayedRegistration:e.delayedRegistration,highEndBlurryRecognition:e.highEndBlurryRecognition,appName:e.appName,parentDomain:e.parentDomain}))}break}case"setFrameSource":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.setFrameSource(e.mirrorAxis,e.isCameraFrameSource))}break}case"processFrame":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.processFrame({data:e.data,frameId:e.frameId,width:e.width,height:e.height,colorType:e.colorType}))}break}case"requestFrameData":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.requestFrameData(e.frameId))}break}case"deleteFrameData":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>{this.dataCaptureInstance.deleteFrameData(e.frameId)})}break}case"updateContext":{{let{data:e}=t;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.updateContext(e))}break}case"dispose":{this.respondWith(t.data.command,t.data.id,()=>this.dataCaptureInstance.dispose());break}case"flushAnalytics":{this.respondWith(t.data.command,t.data.id,()=>{this.dataCaptureInstance.flushAnalytics()});break}case"reportCameraProperties":{{let{data:e}=t;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.reportCameraProperties(e))}break}case"setLogLevel":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>{d.setLevel(e.level)})}break}case"extractCentaurusLicense":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.extractCentaurusLicense(e.licenseKey))}break}case"documentVisibility":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>{this.dataCaptureInstance.onDocumentVisibilityChange(e.state)})}break}case"isFeatureSupported":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.isFeatureSupported(e.feature))}break}case"getViewfinderInfo":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.getViewfinderInfo())}break}case"getOpenSourceSoftwareLicenseInfo":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.getOpenSourceSoftwareLicenseInfo())}break}case"addNativeOverlay":this.dataCaptureInstance.addNativeOverlay(t);break;case"removeNativeOverlay":this.dataCaptureInstance.removeNativeOverlay(t);break;case"convertToJPEGResult":{{let{data:e}=t;this.dataCaptureInstance.convertToJPEGResult(e.imageId,e.result)}break}default:return Se(t.data),!1}return!0}};var we=(t=>(t.Body="body",t.Footnote="footnote",t))(we||{}),E=(t=>(t.Start="start",t.Center="center",t.End="end",t))(E||{}),ve=(t=>(t.Normal="normal",t.Wider="wider",t.FitText="fitText",t))(ve||{}),Fe=(t=>(t.Normal="normal",t.Taller="taller",t))(Fe||{}),Me=(t=>(t.Square="square",t.Rounded="rounded",t))(Me||{}),L=(t=>(t.None="none",t.Check="check",t.ExclamationMark="exclamationMark",t))(L||{}),W=(t=>(t.Top="top",t.Center="center",t.AboveViewFinder="aboveViewFinder",t.BelowViewFinder="belowViewFinder",t))(W||{}),Ce=(t=>(t.AboveViewFinder="aboveViewFinder",t.BelowViewFinder="belowViewFinder",t))(Ce||{}),ke=(t=>(t.BlackOnWhite="blackOnWhite",t.WhiteOnBlack="whiteOnBlack",t.Transparent="transparent",t))(ke||{}),De=(t=>(t.Success="success",t.Error="error",t.Warning="warning",t.Info="info",t.Notification="notification",t))(De||{}),Ie=(t=>(t[t.Ocr=0]="Ocr",t[t.HideLogo=1]="HideLogo",t[t.ShowTestLicenseMessage=2]="ShowTestLicenseMessage",t[t.AugmentedReality=5]="AugmentedReality",t[t.ActivityPingStatsAddon=8]="ActivityPingStatsAddon",t[t.ActivityPing=9]="ActivityPing",t[t.Registration=10]="Registration",t[t.Parser=11]="Parser",t[t.BarcodeCapture=14]="BarcodeCapture",t[t.Analytics=17]="Analytics",t[t.AnalyticsBatchMode=18]="AnalyticsBatchMode",t[t.AnalyticsScanContent=19]="AnalyticsScanContent",t[t.AnalyticsOnlineVerification=20]="AnalyticsOnlineVerification",t[t.SparkScan=21]="SparkScan",t[t.AamvaIdBarcodeVerification=22]="AamvaIdBarcodeVerification",t[t.MappingForTracking=23]="MappingForTracking",t[t.BarcodeFind=24]="BarcodeFind",t[t.MandatoryRegistration=25]="MandatoryRegistration",t[t.FeatureTracking=26]="FeatureTracking",t[t.IdCaptureViz=27]="IdCaptureViz",t[t.IdCaptureMrz=28]="IdCaptureMrz",t[t.IdCaptureBarcode=29]="IdCaptureBarcode",t[t.BarcodeSelectionAimToScan=30]="BarcodeSelectionAimToScan",t[t.BarcodeSelectionTapToScan=31]="BarcodeSelectionTapToScan",t[t.BarcodeCount=32]="BarcodeCount",t[t.BarcodePick=33]="BarcodePick",t[t.IdVerificationDataComparison=34]="IdVerificationDataComparison",t[t.SmartLabelBarcode=35]="SmartLabelBarcode",t[t.SmartLabelText=36]="SmartLabelText",t[t.VoidedIdDetection=37]="VoidedIdDetection",t[t.BarcodeArFull=38]="BarcodeArFull",t[t.BarcodeSequence=39]="BarcodeSequence",t))(Ie||{});var N=class{constructor(e,r,a){this.barcodeAr=null;this.coreEngine=e,this.Module=r,this.workerFunctions=a}async forSettings(e){var a;(a=this.barcodeAr)==null||a.delete(),this.barcodeAr=new this.Module.BarcodeAr(this.coreEngine.context,JSON.stringify(e));let r=this.Module.BarcodeArListener.extend("BarcodeArListener",{didUpdateSession:(i,s,o)=>{let n=this.coreEngine.prepareFrameForListener(o);this.workerFunctions.postMessage({type:"barcodeArDidUpdateSession",payload:{session:JSON.parse(s.toJson()),frameData:n}}),i.delete(),s.delete(),o.delete()}});this.barcodeAr.addListener(new r,1),this.Module.addBarcodeArToContext(this.coreEngine.context,this.barcodeAr)}start(){var e;(e=this.barcodeAr)==null||e.start()}pause(){var e;(e=this.barcodeAr)==null||e.pause()}stop(){var e;(e=this.barcodeAr)==null||e.stop()}setEnabled(e){var r;(r=this.barcodeAr)==null||r.setEnabled(e)}async removeMode(){this.barcodeAr!=null&&this.Module.removeBarcodeArFromContext(this.coreEngine.context,this.barcodeAr)}applySettings(e){var r;(r=this.barcodeAr)==null||r.applySettings(JSON.stringify(e))}};var H=class{constructor(e,r,a){this.trackingListenerSet=!1;this.coreEngine=e,this.Module=r,this.workerFunctions=a,this.setup()}barcodeBatchDidUpdateSession(e){this.workerFunctions.postMessage({type:"barcodeBatchDidUpdateSession",payload:JSON.parse(e.toJson())})}getBatchDeserializer(){return this.barcodeBatchDeserializer}setup(){let e=this.Module.BarcodeBatchListener.extend("BarcodeTrackingListener",{didUpdateSession:(a,i,s)=>{this.barcodeBatchDidUpdateSession(i),a.delete(),i.delete(),s.delete()},onTrackedBarcodeTapped:(a,i)=>{this.onTrackedBarcodeTapped(i),a.delete(),i.delete()}}),r=this.Module.BarcodeBatchDeserializerListener.extend("BarcodeTrackingDeserializerListener",{onModeDeserializationFinished:(a,i,s)=>{this.trackingListenerSet||(i.addListener(new e,1),this.trackingListenerSet=!0),a.delete(),i.delete(),s.delete()},onModeDeserializationStarted(a,i,s){a.delete(),i.delete(),s.delete()},onSettingsDeserializationStarted(a,i,s){a.delete(),i.delete(),s.delete()},onSettingsDeserializationFinished(a,i,s){a.delete(),i.delete(),s.delete()}});this.barcodeBatchDeserializer=new this.Module.BarcodeBatchDeserializer,this.barcodeBatchDeserializer.setListener(new r)}onTrackedBarcodeTapped(e){this.workerFunctions.postMessage({type:"didTapTrackedBarcode",payload:JSON.parse(e.toJson())})}};var _=class{constructor(e,r,a){this.captureListenerSet=!1;this.coreEngine=e,this.Module=r,this.workerFunctions=a,this.setup()}barcodeCaptureDidUpdateSession(e){this.workerFunctions.postMessage({type:"barcodeCaptureDidUpdateSession",payload:JSON.parse(e.toJson())})}barcodeBatchDidUpdateSession(e){this.workerFunctions.postMessage({type:"barcodeBatchDidUpdateSession",payload:JSON.parse(e.toJson())})}getCaptureDeserializer(){return this.barcodeCaptureDeserializer}getTrackingDeserializer(){return this.barcodeBatchDeserializer}setup(){let e=this.Module.BarcodeCaptureListener.extend("BarcodeCaptureListener",{didScan:(o,n,c)=>{this.barcodeCaptureDidScan(n,c),o.delete(),c.delete(),n.delete()},didUpdateSession:(o,n,c)=>{this.barcodeCaptureDidUpdateSession(n),o.delete(),c.delete(),n.delete()}}),r=this.Module.Feedback.extend("Feedback",{emit:()=>{this.successFeedback()}}),a=new e,i=new r,s=this.Module.BarcodeCaptureDeserializerListener.extend("BarcodeCaptureDeserializerListener",{onModeDeserializationFinished:(o,n,c)=>{n.addListener(a,1),n.setSuccessFeedback(i),o.delete(),n.delete(),c.delete()},onModeDeserializationStarted(o,n,c){o.delete(),n.delete(),c.delete()},onSettingsDeserializationStarted(o,n,c){o.delete(),n.delete(),c.delete()},onSettingsDeserializationFinished(o,n,c){o.delete(),n.delete(),c.delete()}});this.barcodeCaptureDeserializer=new this.Module.BarcodeCaptureDeserializer,this.barcodeCaptureDeserializer.setListener(new s)}successFeedback(){this.workerFunctions.postMessage({type:"successFeedback"})}barcodeCaptureDidScan(e,r){let a=this.coreEngine.prepareFrameForListener(r);this.workerFunctions.postMessage({type:"barcodeCaptureDidScan",payload:{session:JSON.parse(e.toJson()),frameData:a}})}};function qe(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Pe(t){return t}var z=class{constructor(e,r,a){this.barcodeFind=null;this.basicOverlay=null;this.transparentGuidanceHintStyle={backgroundColor:"00000000",cornerRadius:4,fitToText:!1,isAnimatedToView:!1,textAlignment:E.Center,hintIcon:L.None,hintAnchor:W.Center,hintAnchorOffset:0,horizontalMargin:0,iconColor:"00000000",lineHeight:-1,maxLines:1,maxWidthFraction:.8,textColor:"ffffffff",textSize:15,textWeight:600};this.customerTransformation=Pe;this.coreEngine=e,this.Module=r,this.workerFunctions=a}async forSettings(e){var o;(o=this.barcodeFind)==null||o.delete(),this.barcodeFind=new this.Module.BarcodeFind(this.coreEngine.context,JSON.stringify(e));let r=this.Module.Feedback.extend("Feedback",{emit:()=>{this.listUpdatedFeedback()}}),a=this.Module.Feedback.extend("Feedback",{emit:()=>{this.barcodeFindFeedback()}}),i=this.Module.BarcodeFindTransformer.extend("BarcodeFindTransformer",{transformBarcodeData:n=>this.customerTransformation(n)}),s=this.Module.BarcodeFindListener.extend("BarcodeFindListener",{didUpdateSession:(n,c,l)=>{let h=this.coreEngine.prepareFrameForListener(l);this.workerFunctions.postMessage({type:"barcodeFindDidUpdateSession",payload:{session:JSON.parse(c.toJson()),frameData:h}}),n.delete(),c.delete(),l.delete()},onSearchPaused:n=>{let c=[];for(let l=0;l<n.size();l++)c.push(n.get(l));this.workerFunctions.postMessage({type:"barcodeFindSearchPaused",payload:{foundItems:c}})},onSearchStopped:n=>{let c=[];for(let l=0;l<n.size();l++)c.push(n.get(l));this.workerFunctions.postMessage({type:"barcodeFindSearchStopped",payload:{foundItems:c}})},onSearchStarted:()=>{this.workerFunctions.postMessage({type:"barcodeFindSearchStarted",payload:{}})}});this.barcodeFind.setBarcodeFindTransformer(new i),this.barcodeFind.addListener(new s,1),this.barcodeFind.setItemListUpdatedFeedback(new r),this.barcodeFind.setFeedback(new a),this.Module.addBarcodeFindToContext(this.coreEngine.context,this.barcodeFind)}barcodeFindFeedback(){this.workerFunctions.postMessage({type:"barcodeFindFeedback",payload:{}})}start(){var e;(e=this.barcodeFind)==null||e.start()}stop(){var e;(e=this.barcodeFind)==null||e.stop()}pause(){var e;(e=this.barcodeFind)==null||e.pause()}setEnabled(e){var r;(r=this.barcodeFind)==null||r.setEnabled(e)}setItemList(e){var r;(r=this.barcodeFind)==null||r.setItemList(JSON.stringify(e))}async removeMode(){this.barcodeFind!=null&&this.Module.removeBarcodeFindFromContext(this.coreEngine.context,this.barcodeFind)}addBasicOverlay(){var e;(e=this.basicOverlay)==null||e.delete(),this.basicOverlay=null,this.barcodeFind!=null&&(this.basicOverlay=new this.Module.BarcodeFindBasicOverlay(this.barcodeFind)),this.coreEngine.view!=null&&this.basicOverlay!=null&&(this.basicOverlay.setGuidanceHandler(this.createWebFindGuidanceHandler()),this.Module.addBarcodeFindBasicOverlayToView(this.coreEngine.view,this.basicOverlay))}removeBasicOverlay(){this.coreEngine.view!=null&&this.basicOverlay!=null&&this.Module.removeBarcodeFindBasicOverlayFromView(this.coreEngine.view,this.basicOverlay)}async applySettings(e){var r;(r=this.barcodeFind)==null||r.applySettings(JSON.stringify(e))}updateBasicOverlay(e){let r=Object.entries(e).filter(([a,i])=>a!=="type");for(let[a,i]of r){let s=`set${qe(a)}`;this.basicOverlay!=null&&typeof this.basicOverlay[s]=="function"&&i!=null&&this.basicOverlay[s](i)}}setTransformerFunction(e){this.customerTransformation=e!=null?e:Pe}successFeedback(){this.workerFunctions.postMessage({type:"successFeedback"})}listUpdatedFeedback(){this.workerFunctions.postMessage({type:"barcodeFindListUpdatedFeedback",payload:{}})}setToast(e,r){let a=this.coreEngine.hintPresenterV2;e?a==null||a.showToast(JSON.stringify(r)):a==null||a.hideToast(r.tag)}setGuidance(e,r,a){let i={tag:a,text:r,hintStyle:this.transparentGuidanceHintStyle};this.workerFunctions.postMessage({type:e?"showGuidance":"hideGuidance",payload:i})}createWebFindGuidanceHandler(){let e=this.Module.BarcodeFindGuidanceHandler.extend("BarcodeFindGuidanceHandler",{setInitialGuidance:(r,a)=>{this.setGuidance(r,a,"InitialGuidance")},setMoveCloserGuidance:(r,a)=>{this.setGuidance(!1,a,"InitialGuidance"),this.setGuidance(r,a,"MoveCloserGuidance")},setTapShutterToPause:(r,a)=>{this.setGuidance(!1,a,"InitialGuidance"),this.setGuidance(r,a,"TapShutterToPause")},setTapShutterToResume:(r,a)=>{this.setGuidance(!1,a,"InitialGuidance"),this.setGuidance(r,a,"TapShutterResume")}});return new e}};var w=class{constructor(e){this.subscribers=new Set;this.property={key:e,value:null}}addSubscriber(e){var r;this.subscribers.add(e),(r=e.onPropertyChanged)==null||r.call(e,this.property)}removeSubscriber(e){this.subscribers.delete(e)}setProperty(e){var r;if(this.property.value!==e.value){this.property={key:this.property.key,value:e.value};for(let a of this.subscribers)(r=a.onPropertyChanged)==null||r.call(a,this.property)}}};var Ye={torch_state:new w("torch_state"),scanning_mode:new w("scanning_mode"),sound_enabled:new w("sound_enabled"),haptic_enabled:new w("haptic_enabled"),session_stop_reason:new w("session_stop_reason"),camera_position:new w("camera_position")},V=class{getBehaviorSubject(e){return Ye[e]}};var J=class{constructor(e,r,a){this.captureListenerSet=!1;this.propertyPushSource=new V;this.coreEngine=e,this.Module=r,this.workerFunctions=a,this.setup()}sparkScanDidUpdateSession(e){this.workerFunctions.postMessage({type:"sparkScanDidUpdateSession",payload:JSON.parse(e.toJson())})}getSparkScanDeserializer(){return this.sparkScanDeserializer}setup(){let e=this.Module.SparkScanListener.extend("SparkScanListener",{didScan:(i,s,o)=>{this.sparkScanDidScan(s,o),i.delete(),s.delete(),o.delete()},didUpdateSession:(i,s,o)=>{this.sparkScanDidUpdateSession(s),i.delete(),s.delete(),o.delete()}}),r=this.Module.Feedback.extend("Feedback",{emit:()=>{this.successFeedback()}}),a=this.Module.SparkScanDeserializerListener.extend("SparkScanDeserializerListener",{onModeDeserializationFinished:(i,s,o)=>{if(!this.captureListenerSet){s.addListener(new e,1),s.setSuccessFeedback(new r),s.setPropertyPushSource(this.propertyPushSource);let n=this.Module.SparkScanViewHandlerDelegate.extend("SparkScanViewHandlerDelegate",{onSwitchedAwayFromSmartScanSelection:()=>{this.workerFunctions.postMessage({type:"sparkScanSwitchedAwayFromSmartScanSelection"})},onSwitchedToSmartScanSelection:()=>{this.workerFunctions.postMessage({type:"sparkScanSwitchedToSmartScanSelection"})},enableHapticWhenOverlapping:()=>{},onStateTransition:()=>{},resetAllTimers:()=>{}}),c=new n,l=s.getStateMachine();l.setViewHandlerDelegate(c),c.delete(),l.delete(),this.sparkScan=s.clone(),this.captureListenerSet=!0}i.delete(),o.delete(),s.delete()},onModeDeserializationStarted(i,s,o){i.delete(),s.delete(),o.delete()},onSettingsDeserializationStarted(i,s,o){i.delete(),s.delete(),o.delete()},onSettingsDeserializationFinished(i,s,o){i.delete(),s.delete(),o.delete()},onOverlayDeserializationStarted(i,s,o){i.delete(),s.delete(),o.delete()},onOverlayDeserializationFinished:(i,s,o)=>{var n;(n=this.sparkScanOverlay)==null||n.delete(),this.sparkScanOverlay=s,i.delete(),o.delete()}});this.sparkScanDeserializer=new this.Module.SparkScanDeserializer,this.sparkScanDeserializer.setListener(new a)}emitErrorFeedback(e){var r;(r=this.sparkScanOverlay)==null||r.onErrorFeedbackEmitted(e)}overlayReadyForDraw(){var e;(e=this.sparkScanOverlay)==null||e.onReadyForNewData()}analyticsManagerPropertyChanged(e){this.propertyPushSource.getBehaviorSubject(e.key).setProperty(e)}successFeedback(){this.workerFunctions.postMessage({type:"successFeedback"})}selectItemWithSmartScanSelection(){var e;(e=this.sparkScan)==null||e.selectItemWithSmartScanSelectionAsync()}async removeMode(){var e,r;this.captureListenerSet=!1,(e=this.sparkScan)==null||e.delete(),this.sparkScan=void 0,(r=this.sparkScanOverlay)==null||r.delete(),this.sparkScanOverlay=void 0}sparkScanDidScan(e,r){let a=this.coreEngine.prepareFrameForListener(r);this.workerFunctions.postMessage({type:"sparkScanDidScan",payload:{session:JSON.parse(e.toJson()),frameData:a}})}};var U=class extends I{constructor(e,r){super(e,r)}getModeDeserializers(){this.barcodeCaptureMode=new _(this,this.Module,this.workerFunctions),this.barcodeBatchMode=new H(this,this.Module,this.workerFunctions),this.sparkScanMode=new J(this,this.Module,this.workerFunctions),this.barcodeFindMode=new z(this,this.Module,this.workerFunctions),this.barcodeArMode=new N(this,this.Module,this.workerFunctions);let e=super.getModeDeserializers();return e.push_back(this.barcodeCaptureMode.getCaptureDeserializer()),e.push_back(this.barcodeBatchMode.getBatchDeserializer()),e.push_back(this.sparkScanMode.getSparkScanDeserializer()),e}getWasmSideModuleFileName(){return""}getWasmCoreFileName(e,r){return r?e?"scandit-datacapture-sdk-barcode-simd-pthreads.wasm":"scandit-datacapture-sdk-barcode-pthreads.wasm":e?"scandit-datacapture-sdk-barcode-simd.wasm":"scandit-datacapture-sdk-barcode.wasm"}getWasmCoreExpectedHash(e,r){return r?e?"44eadcb5e36da3e39236c267d022d41b21155b628056947f2efd7b89ce2d3d4c":"a9ec86f920e77189b02053f014e21e3547323b1351599a6bdf8ac3acfc8fd9e3":e?"4226e9075d67fb4f8194a6296637f1ca8701d33a33990b54036df465ad172257":"a0808725b47747c68979103ca9850b71ac36621a8438b27987a9816e5ba1058c"}getWasmMetadata(){return u}};function Xe(t){return(r=>/^[$A-Z_a-z][\\w$]*\\s*\\(.*\\)\\s*\\{/.test(r)&&!r.startsWith("function"))(t)?`function ${t}`:t}var Ke=["fetch","XMLHttpRequest","eval","Function","self","globalThis","Module","importScripts","this","console","window","document","import","Worker","ServiceWorker"];function Ze(t){return Ke.map(r=>new RegExp(`\\\\b${r}\\\\b`,"g")).some(r=>r.test(t))}function Be(t){if(t==null)return null;let e=Xe(t);if(Ze(e))throw new Error("Function should be pure. Shouldn\'t introduce side effects, or rely on global scope");let r=`\'use strict\';\n return (${e});`;try{return new Function(r)()}catch{return null}}var $=class extends te{constructor(e,r){super(e,r),this.dataCaptureInstance=new U(r,{postMessage:this.postMessage.bind(this),getOffscreenCanvas:this.getOffscreenCanvas.bind(this)})}async respondWith(e,r,a){let i=null,s;try{s=a(),s instanceof Promise&&(s=await s)}catch(n){s=void 0,i=k(n)}let o={type:"workerTaskId",command:e,id:r,payload:this.hasPayload(s)?s.payload:void 0};i!=null&&(o.error=i),this.postMessage(o,this.hasTransferables(s)?s.transferables:[])}onMessage(e){switch(e.data.command){case"sparkScanEmitErrorFeedback":{let{data:r}=e;return this.respondWith(r.command,r.id,()=>{this.dataCaptureInstance.sparkScanMode.emitErrorFeedback(r.shouldRemoveBrush)}),!0}case"sparkScanOverlayReadyForDraw":{let{data:r}=e;return this.respondWith(r.command,r.id,()=>{this.dataCaptureInstance.sparkScanMode.overlayReadyForDraw()}),!0}case"sparkScanAnalyticsManagerPropertyChanged":{let{data:r}=e;return this.respondWith(r.command,r.id,async()=>{this.dataCaptureInstance.sparkScanMode.analyticsManagerPropertyChanged(r.property)}),!0}case"sparkScanSelectItemWithSmartScanSelection":{let{data:r}=e;return this.respondWith(r.command,r.id,async()=>{this.dataCaptureInstance.sparkScanMode.selectItemWithSmartScanSelection()}),!0}case"sparkScanModeRemove":{let{data:r}=e;return this.respondWith(r.command,r.id,async()=>this.dataCaptureInstance.sparkScanMode.removeMode()),!0}case"barcodeFindForSettings":{let{data:r}=e;return this.respondWith(r.command,r.id,async()=>this.dataCaptureInstance.barcodeFindMode.forSettings(r.settings)),!0}case"barcodeFindModeRemove":{let{data:r}=e;return this.respondWith(r.command,r.id,async()=>this.dataCaptureInstance.barcodeFindMode.removeMode()),!0}case"barcodeFindSearchStart":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.start()}),!0;case"barcodeFindSearchPause":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.pause()}),!0;case"barcodeFindSearchStop":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.stop()}),!0;case"barcodeFindSetItemList":{let{data:r}=e;return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.setItemList(r.itemList)}),!0}case"barcodeFindSetEnabled":{let{data:r}=e;return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.setEnabled(r.enabled)}),!0}case"barcodeFindApplySettings":{let{data:r}=e;return this.respondWith(r.command,r.id,async()=>this.dataCaptureInstance.barcodeFindMode.applySettings(r.settings)),!0}case"barcodeFindAddBasicOverlay":{let{data:r}=e;return this.respondWith(r.command,r.id,async()=>{this.dataCaptureInstance.barcodeFindMode.addBasicOverlay()}),!0}case"barcodeFindRemoveBasicOverlay":{let{data:r}=e;return this.respondWith(r.command,r.id,async()=>{this.dataCaptureInstance.barcodeFindMode.removeBasicOverlay()}),!0}case"barcodeFindUpdateBasicOverlay":{let{data:r}=e;return this.respondWith(r.command,r.id,async()=>{this.dataCaptureInstance.barcodeFindMode.updateBasicOverlay(r.jsonOverlay)}),!0}case"barcodeFindSetTransformerFunction":{let{data:r}=e;return this.respondWith(r.command,r.id,async()=>{let a=Be(r.functionAsString);this.dataCaptureInstance.barcodeFindMode.setTransformerFunction(a)}),!0}case"barcodeArForSettings":{let{data:r}=e;return this.respondWith(r.command,r.id,async()=>this.dataCaptureInstance.barcodeArMode.forSettings(r.settings)),!0}case"barcodeArModeRemove":{let{data:r}=e;return this.respondWith(r.command,r.id,async()=>this.dataCaptureInstance.barcodeArMode.removeMode()),!0}case"barcodeArSearchStart":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeArMode.start()}),!0;case"barcodeArSearchPause":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeArMode.pause()}),!0;case"barcodeArSearchStop":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeArMode.stop()}),!0;case"barcodeArSetEnabled":{let{data:r}=e;return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeArMode.setEnabled(r.enabled)}),!0}case"barcodeArApplySettings":{let{data:r}=e;return this.respondWith(r.command,r.id,async()=>{this.dataCaptureInstance.barcodeArMode.applySettings(r.settings)}),!0}default:return super.onMessage(e)}}};var Sa=new $(self,{get:()=>self.Module,set:t=>{self.Module=t}});function wa(t){}})();\n'],{type:"application/javascript"})),e=new Worker(s,r);return URL.revokeObjectURL(s),e}var o=class r extends DataCaptureLoader{constructor(){super(...arguments);this._name="BarcodeCapture";}get dataCaptureWorker(){return (this._dataCaptureWorker)!=null||(this._dataCaptureWorker=n({name:this.name})),this._dataCaptureWorker}get name(){return this._name}static async create(e){var a;let t=new r(e);return await t.workerCommand("setLogLevel",{level:(a=e.logLevel)!=null?a:Logger.Level.Debug}),await t.load(),t}async workerCommand(e,t,a){return new Promise((d,l)=>{let i=this.workerCommandId++;this.workerTasks.set(i,{resolve:d,reject:l,command:e});let c={...t,command:e,id:i};this.dataCaptureWorker.postMessage(c,a);})}};
|
|
2
|
-
export{o as a};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/sdc-lib/resources/models/barcode_localization_generic_postal_code_default.42a9746ffe91.model
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/sdc-lib/resources/models/barcode_ocr_fallback_ocr_detector_default.9e7b3e9f0b6c.model
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|