@scandit/web-datacapture-barcode 7.2.5 → 7.2.6
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/check/BarcodeCheck.js +1 -1
- package/build/js/check/BarcodeCheckFeedback.js +1 -1
- package/build/js/check/BarcodeCheckPresenter.js +1 -1
- package/build/js/check/BarcodeCheckView.js +1 -1
- package/build/js/chunks/{chunk-HIC77DUB.js → chunk-3PZKMJ4V.js} +1 -1
- package/build/js/chunks/{chunk-Q7QUKTKB.js → chunk-4Y54R3BL.js} +1 -1
- package/build/js/chunks/{chunk-SX5JYNR2.js → chunk-6W2E6DWG.js} +1 -1
- package/build/js/chunks/{chunk-FEUWJW56.js → chunk-73GO3R7F.js} +1 -1
- package/build/js/chunks/{chunk-SKVTXXL7.js → chunk-CGV3Y5KD.js} +1 -1
- package/build/js/chunks/{chunk-6JRMVWQC.js → chunk-HFCXXVMI.js} +1 -1
- package/build/js/chunks/{chunk-LC4U5HBD.js → chunk-ITIDIB2F.js} +1 -1
- package/build/js/chunks/{chunk-FDGBQDIL.js → chunk-LXF4ZLVS.js} +1 -1
- package/build/js/chunks/chunk-SNSRRGM7.js +1 -0
- package/build/js/find/BarcodeFindView.js +1 -1
- package/build/js/find/index.js +1 -1
- package/build/js/index.js +1 -1
- package/build/js/moduleLoader.js +1 -1
- package/build/js/worker/BarcodeCaptureWorkerManager.js +1 -1
- package/build/js/worker/WorkerMain.js +1 -1
- package/build/js/worker/dataCapture.inlineWorker.js +1 -1
- package/build/js/worker/dataCaptureEngine.js +1 -1
- package/package.json +2 -2
- 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-3XEYPF6I.js +0 -1
- /package/build/js/chunks/{chunk-ACAMCR7W.js → chunk-GTYLBEUS.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as BarcodeCheck}from'../chunks/chunk-
|
|
1
|
+
export{a as BarcodeCheck}from'../chunks/chunk-6W2E6DWG.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as BarcodeCheckFeedback}from'../chunks/chunk-
|
|
1
|
+
export{a as BarcodeCheckFeedback}from'../chunks/chunk-GTYLBEUS.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as BarcodeCheckPresenter}from'../chunks/chunk-
|
|
1
|
+
export{a as BarcodeCheckPresenter}from'../chunks/chunk-HFCXXVMI.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as BarcodeCheckView}from'../chunks/chunk-
|
|
1
|
+
export{a as BarcodeCheckView}from'../chunks/chunk-CGV3Y5KD.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$2}from'./chunk-LTNZJEG4.js';import {a as a$1}from'./chunk-2ZSOWJ2F.js';import {a}from'./chunk-WVIC3JWX.js';import {a as a$4}from'./chunk-7JOXKPVL.js';import {a as a$3}from'./chunk-7O2NHA3I.js';import {a as a$5}from'./chunk-
|
|
1
|
+
import {a as a$2}from'./chunk-LTNZJEG4.js';import {a as a$1}from'./chunk-2ZSOWJ2F.js';import {a}from'./chunk-WVIC3JWX.js';import {a as a$4}from'./chunk-7JOXKPVL.js';import {a as a$3}from'./chunk-7O2NHA3I.js';import {a as a$5}from'./chunk-SNSRRGM7.js';import {DataCaptureEngine}from'@scandit/web-datacapture-core/build/js/worker/index.js';var c=class extends DataCaptureEngine{constructor(e,r){super(e,r);}getModeDeserializers(){this.barcodeCaptureMode=new a(this,this.Module,this.workerFunctions),this.barcodeBatchMode=new a$1(this,this.Module,this.workerFunctions),this.sparkScanMode=new a$2(this,this.Module,this.workerFunctions),this.barcodeFindMode=new a$3(this,this.Module,this.workerFunctions),this.barcodeCheckMode=new a$4(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?"d9fc493a206cced3bc03706b4edf1b92336c07122ae9f42e74b1dc0b08d2feea":"9f4d07fc0c721fbc43689f313304da12ba1ef7db53f1cfeffd221d1e30ff350f":e?"20f7dcc41a4d3c552bad686cd9a7d08e630888afc4dc47ea22693e74ea7e1634":"9329a510cba0ee0f79466fca599ef5d67e24b0154cdafdf204a5c249daf1bee5"}getWasmMetadata(){return a$5}};export{c as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-3PZKMJ4V.js';import {a as a$1}from'./chunk-KQ3LRAYO.js';import {unknownErrorToString}from'@scandit/web-datacapture-core/build/js/private/utils/unknownErrorToString.js';import {WorkerMain}from'@scandit/web-datacapture-core/build/js/worker/index.js';var i=class extends WorkerMain{constructor(e,a$1){super(e,a$1),this.dataCaptureInstance=new a(a$1,{postMessage:this.postMessage.bind(this),getOffscreenCanvas:this.getOffscreenCanvas.bind(this)});}async respondWith(e,a,r){let d=null,t;try{t=r(),t instanceof Promise&&(t=await t);}catch(c){t=void 0,d=unknownErrorToString(c);}let s={type:"workerTaskId",command:e,id:a,payload:this.hasPayload(t)?t.payload:void 0};d!=null&&(s.error=d),this.postMessage(s,this.hasTransferables(t)?t.transferables:[]);}onMessage(e){switch(e.data.command){case"sparkScanEmitErrorFeedback":{let{data:a}=e;return this.respondWith(a.command,a.id,()=>{this.dataCaptureInstance.sparkScanMode.emitErrorFeedback(a.shouldRemoveBrush);}),!0}case"sparkScanOverlayReadyForDraw":{let{data:a}=e;return this.respondWith(a.command,a.id,()=>{this.dataCaptureInstance.sparkScanMode.overlayReadyForDraw();}),!0}case"sparkScanAnalyticsManagerPropertyChanged":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.sparkScanMode.analyticsManagerPropertyChanged(a.property);}),!0}case"barcodeFindForSettings":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeFindMode.forSettings(a.settings)),!0}case"barcodeFindModeRemove":{let{data:a}=e;return this.respondWith(a.command,a.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:a}=e;return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.setItemList(a.itemList);}),!0}case"barcodeFindSetEnabled":{let{data:a}=e;return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.setEnabled(a.enabled);}),!0}case"barcodeFindApplySettings":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeFindMode.applySettings(a.settings)),!0}case"barcodeFindAddBasicOverlay":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.barcodeFindMode.addBasicOverlay();}),!0}case"barcodeFindRemoveBasicOverlay":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.barcodeFindMode.removeBasicOverlay();}),!0}case"barcodeFindUpdateBasicOverlay":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.barcodeFindMode.updateBasicOverlay(a.jsonOverlay);}),!0}case"barcodeFindSetTransformerFunction":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>{let r=a$1(a.functionAsString);this.dataCaptureInstance.barcodeFindMode.setTransformerFunction(r);}),!0}case"barcodeCheckForSettings":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeCheckMode.forSettings(a.settings)),!0}case"barcodeCheckModeRemove":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeCheckMode.removeMode()),!0}case"barcodeCheckSearchStart":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeCheckMode.start();}),!0;case"barcodeCheckSearchPause":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeCheckMode.pause();}),!0;case"barcodeCheckSearchStop":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeCheckMode.stop();}),!0;case"barcodeCheckSetEnabled":{let{data:a}=e;return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeCheckMode.setEnabled(a.enabled);}),!0}case"barcodeCheckApplySettings":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.barcodeCheckMode.applySettings(a.settings);}),!0}default:return super.onMessage(e)}}};export{i as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-VIFEECK7.js';import {b}from'./chunk-43WBSXOM.js';import {a}from'./chunk-
|
|
1
|
+
import {a as a$1}from'./chunk-VIFEECK7.js';import {b}from'./chunk-43WBSXOM.js';import {a}from'./chunk-GTYLBEUS.js';import {CameraSettings,convertToPublicFrameData}from'@scandit/web-datacapture-core';import {warnMultithreadingUnavailable}from'@scandit/web-datacapture-core/build/js/private/utils/warnMultithreadingUnavailable.js';var o=class c{constructor(){this.skipSerialization=!0;this.type="barcodeCheck";this._isEnabled=!0;this._context=null;this.listeners=new Set;this.privateListeners=new Set;this.workerMessageListener=this.onWorkerMessage.bind(this);}get context(){return this._context}static createRecommendedCameraSettings(){let e=new CameraSettings(b);return e.setProperty("grayScaleFrameReader",!0),e}set context(e){this._context=e;}get allListeners(){return [...this.privateListeners,...this.listeners]}static async forContext(e,a$1){warnMultithreadingUnavailable();let t=new c;return t.feedback=await a.createDefaultBarcodeCheckFeedback(),t.settings=a$1,await(e==null?void 0:e.addMode(t)),t}isEnabled(){return this._isEnabled}addListener(e){this.listeners.add(e);}removeListener(e){this.listeners.delete(e);}set feedback(e){this._feedback=e;}get feedback(){return this._feedback}async setEnabled(e){this._isEnabled=e,await this.workerCommand("barcodeCheckSetEnabled",{enabled:e});}async applySettings(e){this.settings=e,await this.workerCommand("barcodeCheckApplySettings",{settings:e.toJSONObject()});}toJSONObject(){return {type:this.type,enabled:this._isEnabled,settings:this.settings.toJSONObject()}}async attachedToContext(e){this._context=e,this._context.subscribeToWorkerMessages(this.workerMessageListener),await this.workerCommand("barcodeCheckForSettings",{settings:this.settings.toJSONObject()});}async detachedFromContext(){var e;await this.workerCommand("barcodeCheckModeRemove",{}),(e=this._context)==null||e.unsubscribeToWorkerMessages(this.workerMessageListener),this._context=null;}async start(){return this.workerCommand("barcodeCheckSearchStart",{})}async stop(){return this.workerCommand("barcodeCheckSearchStop",{})}async pause(){return this.workerCommand("barcodeCheckSearchPause",{})}async workerCommand(e,a){this.context!=null&&await this.context.workerCommand(e,a);}addPrivateListener(e){this.privateListeners.add(e);}removePrivateListener(e){this.privateListeners.delete(e);}async onWorkerMessage(e){var a;switch(e.type){case"barcodeCheckDidUpdateSession":{if(!this._isEnabled||!this._context)return;for(let t of this.allListeners)(a=t.didUpdateSession)==null||a.call(t,this,a$1.fromJSON(e.payload.session),convertToPublicFrameData(e.payload.frameData,this._context));break}}}};export{o as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {DataCaptureLoader,Logger}from'@scandit/web-datacapture-core';function n(r){let s=URL.createObjectURL(new Blob(['"use strict";(()=>{var p={"scandit-datacapture-sdk-barcode-pthreads.wasm":{bytes:6915146},"scandit-datacapture-sdk-barcode-simd-pthreads.wasm":{bytes:6827317},"scandit-datacapture-sdk-barcode-simd.wasm":{bytes:6707828},"scandit-datacapture-sdk-barcode.wasm":{bytes:6796133}};function M(t){return typeof t=="object"&&t!=null}function F(t){if(typeof t=="string")return t;if(M(t)){if(typeof t.message=="string")return t.message}else if(typeof t?.toString=="function")return t.toString();return"unknown error"}var l;(t=>{(d=>(d.Debug="debug",d.Info="info",d.Warn="warn",d.Error="error",d.Quiet="quiet"))(t.Level||(t.Level={}));let e=new Map([["debug",1],["info",2],["warn",3],["error",4],["quiet",5]]),a="debug";function r(d){a=d}t.setLevel=r;function i(d,...h){if(!(e.get(a)>e.get(d)))switch(d){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(...d){i("warn",...d)}t.warn=s;function n(...d){i("debug",...d)}t.debug=n;function o(...d){i("info",...d)}t.info=o;function c(...d){i("error",...d)}t.error=c})(l||(l={}));function Le(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 Te(t){let e=/@scandit\\/web-datacapture-[a-z]+/i.exec(t);return e?e[0]:null}function ae(t,e,a){let r=e,i=Le(r);if(i.result){let n=Te(r);n!=null&&(r=`${i.cdnBaseURL}${n}@${t}/sdc-lib/`)}let s=a.replace(".wasm","");return i.result?{jsURI:`${r}${s}.js`,wasmURI:`${r}${s}.wasm`}:{jsURI:`${r}${s}.js?v=${t}`,wasmURI:`${r}${s}.wasm?v=${t}`}}var P=class re extends Error{constructor(e){super(e.message),Object.setPrototypeOf(this,re.prototype),this.name=e.name}toString(){return`${this.name}: ${this.message}`}};var I=Promise.resolve(),G=!1,$=!1,k,j={writableDataPath:""};async function ie(t){if(k==null)return;G=!0;let e=new Promise((a,r)=>{setTimeout(()=>{r(new P({name:"BlockedIndexedDB",message:"IndexedDB database is blocked"}))},1500)});try{await Promise.race([new Promise((a,r)=>{k?.(t,i=>{if(i!=null){r(i);return}a()})}),e])}finally{G=!1}}async function se(t){return $||(G?($=!0,I=I.then(async()=>($=!1,ie(t)))):I=ie(t)),I}async function ne(t){j=t,k=FS.syncfs,FS.syncfs=(e,a)=>{let r=a,i=()=>{r()},s=n=>{r(n)};se(e).then(i).catch(s)};try{FS.mkdir(j.writableDataPath)}catch(e){if(e.code!=="EEXIST")throw k=void 0,e}return FS.mount(IDBFS,{},j.writableDataPath),se(!0)}var q=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t);var K=function(t,e){this[0]=t,this[1]=e},oe=(t,e,a)=>{var r=(n,o,c,d)=>{try{var h=a[n](o),g=(o=h.value)instanceof K,m=h.done;Promise.resolve(g?o[0]:o).then(b=>g?r(n==="return"?n:"next",o[1]?{done:b.done,value:b.value}:b,c,d):c({value:b,done:m})).catch(b=>r("throw",b,c,d))}catch(b){d(b)}},i=n=>s[n]=o=>new Promise((c,d)=>r(n,o,c,d)),s={};return a=a.apply(t,e),s[q("asyncIterator")]=()=>s,i("next"),i("throw"),i("return"),s},de=(t,e,a)=>(e=t[q("asyncIterator")])?e.call(t):(t=t[q("iterator")](),e={},a=(r,i)=>(i=t[r])&&(e[r]=s=>new Promise((n,o,c)=>(s=i.call(t,s),c=s.done,Promise.resolve(s.value).then(d=>n({value:d,done:c}),o)))),a("next"),a("return"),e);var ce={};function We(t){return[...new Uint8Array(t)].map(e=>{let a=e.toString(16);return a.length===1?`0${a}`:a}).join("")}function Ee(t){return oe(this,null,function*(){let e=t.getReader();try{for(;;){let{done:a,value:r}=yield new K(e.read());if(a)return;yield r}}finally{e.releaseLock()}})}async function Ae(t){let e=[],a=0,r=0;try{for(var i=de(Ee(t)),s,n,o;s=!(n=await i.next()).done;s=!1){let d=n.value;e.push(d),a+=d.length}}catch(d){o=[d]}finally{try{s&&(n=i.return)&&await n.call(i)}finally{if(o)throw o[0]}}let c=new Uint8Array(a);for(let d of e)c.set(d,r),r+=d.length;return c.buffer}var Re=(t=>(t.VALID="VALID",t.INVALID="INVALID",t.NOT_VERIFIABLE="NOT_VERIFIABLE",t))(Re||{});async function Ne(t,e,a){if(typeof crypto.subtle.digest!="function")return l.log(l.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 ${a} could not be verified`),"NOT_VERIFIABLE";try{let r=t instanceof Promise?await t:t,i=await crypto.subtle.digest("SHA-256",r),s=We(i);return e==null?(l.log(l.Level.Warn,"The library hash is not defined or empty, cannot correctly verify integrity."),"NOT_VERIFIABLE"):s===e?(l.log(l.Level.Debug,`Data Capture library WASM integrity found at ${a} has been verified correctly.`),"VALID"):(l.log(l.Level.Warn,`The Scandit Data Capture library WASM file found at ${a} 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(r){return l.log(l.Level.Warn,"Wasm response could not be verified",r),"NOT_VERIFIABLE"}}var X=new Map([["br",4.4],["gzip",2.9],["none",1]]);function He(t){var e;let a="content-encoding";if(t==null||t.get(a)==null)return X.get("none");let r=new Set(((e=t.get(a))!=null?e:"").split(",").map(i=>i.trim()));for(let[i,s]of X)if(r.has(i))return s;return X.get("none")}function _e(t){var e,a;if(t==null)return 0;let r=(e=He(t))!=null?e:1,i=Number.parseInt((a=t.get("content-length"))!=null?a:"0",10);return Number.isNaN(i)?0:Math.floor(i*r*100)/100}function ze(t){let{pathname:e}=new URL(t);for(let[a,r]of Object.entries(ce))if(e.endsWith(a))return r.bytes;return 0}function le(t){ce=t}var Ve=(t,e)=>{let a=_e(e);return a===0?ze(t):a};function Je(t,e,a,{onProgress:r,onError:i,onComplete:s}){if(!e.body)return[e];let n=Ve(t,e.headers),o=0,c=0,[d,h]=a?e.body.tee():[e.body],g=d.pipeThrough(new TransformStream({async transform(m,b){try{o+=m.length,c=Number((o/n*100).toFixed(2)),n>0&&m.length>0&&c<100?r?.({percentage:c,loadedBytes:o,privateUri:t}):n===0&&m.length>0&&r?.({percentage:null,loadedBytes:o,privateUri:t}),b.enqueue(m)}catch(v){b.error(v),i?.({error:v})}},flush(m){r?.({percentage:100,loadedBytes:o,privateUri:t}),s?.({percentage:100,loadedBytes:o,privateUri:t}),m.terminate()}}));return[new Response(g,{headers:new Headers(e.headers),status:e.status,statusText:e.statusText}),h]}async function Y({wasmURI:t,expectedHash:e,verifyResponseHash:a,onProgress:r,onComplete:i,onError:s,referredOrigin:n}){let o=await fetch(t,{referrerPolicy:"origin",referrer:n??""});if(!o.ok)throw new Error(`HTTP status code is not ok: ${o.status}, ${o.statusText}`);let[c,d]=Je(t,o,a,{onProgress:r,onError:s,onComplete:i});return d!=null&&Ne(Ae(d),e,t),c}function ue({wasmURI:t,expectedHash:e,verifyResponseHash:a,progressCallback:r,successCallback:i,importObject:s,referredOrigin:n}){async function o(d){try{let h=await Y({wasmURI:t,expectedHash:e,verifyResponseHash:a,onProgress:r,referredOrigin:n}),g=await(d??h).arrayBuffer(),m=await globalThis.WebAssembly.instantiate(g,s);i(m.instance,m.module)}catch(h){l.log(l.Level.Error,h),l.log(l.Level.Error,`Couldn\'t instantiate Scandit SDK DataCapture library at ${t}, did you configure the path for it correctly?`)}}async function c(){let d;try{d=await Y({wasmURI:t,expectedHash:e,verifyResponseHash:a,onProgress:r,referredOrigin:n});let h=await globalThis.WebAssembly.instantiateStreaming(d,s);i(h.instance,h.module)}catch(h){l.log(l.Level.Warn,h),l.log(l.Level.Warn,"WebAssembly streaming compile failed. Falling back to ArrayBuffer instantiation (this will make things slower)"),o(d?.bodyUsed===!0?void 0:d)}}typeof globalThis.WebAssembly.instantiateStreaming=="function"?c():o()}async function Z(t,e,a,r){return new Promise((i,s)=>{t().then(i).catch(n=>{let o=e*2;if(o>a){s(n);return}r(n),globalThis.setTimeout(()=>{Z(t,o,a,r).then(i).catch(s)},e)})})}function Q(t){var e,a;let r="";if((e=t.href)!=null&&e.startsWith("blob:null/"))r="localhost";else{let i=((a=t.pathname)==null?void 0:a.length)>1&&!t.pathname.startsWith("/");r=new URL(i?t.pathname:t.origin).hostname}return r.startsWith("[")&&r.endsWith("]")&&(r=r.slice(1,-1)),r}async function pe(t,e){async function a(){return importScripts(t)}try{await Z(a,250,4e3,i=>{l.log(l.Level.Warn,i),l.log(l.Level.Warn,`Couldn\'t retrieve Scandit Data Capture library at ${t}, retrying...`)}),self.Module.mainScriptUrlOrBlob=t;let r=globalThis.SDC_WASM_JS_VERSION;return r!==e&&l.log(l.Level.Warn,`The Scandit Data Capture library JS file found at ${t} seems invalid: expected version doesn\'t match (received: ${r}, expected: ${e}). Please ensure the correct Scandit Data Capture file (with correct version) is retrieved.`),!0}catch(r){return l.log(l.Level.Error,r),!1}}var L;(t=>{function e(){return"7.2.5"}t.sdkVersion=e})(L||(L={}));var he=class{constructor(){this.promise=new Promise((t,e)=>{this.reject=e,this.resolve=t})}};var Ue=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])),$e=()=>(async t=>{try{return typeof MessageChannel<"u"&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(t)}catch{return!1}})(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]));function je(){return typeof crossOriginIsolated>"u"?!1:crossOriginIsolated}function Ge(){try{return new WebAssembly.Memory({initial:1,maximum:1,shared:!0}).buffer.constructor.name==="SharedArrayBuffer"}catch{return!1}}async function me(){return Ue()}async function qe(){if(!await $e())return!1;let t=null;try{t=new Worker(URL.createObjectURL(new Blob([\'postMessage("Worker" in self);\'],{type:"text/javascript"})),{name:"nestedWorkerTest"})}catch{return!1}return new Promise(e=>{if(t==null){e(!1);return}t.onmessage=a=>{t?.terminate(),e(a.data)}})}async function be(){let t=await qe();return je()&&Ge()&&t}var ge=class fe{constructor(e,a){this.hintPresenterV2=null,this.MAX_NUMBER_OF_IMAGES_IN_FRAME_DATA_POOL=10,this.redrawInterval=1e3/30,this.redrawRequests=[],this._isDrawLoopRunning=!1,this.frameDataPool=new Map,this.lastFrameCounter=-1,this.poorMansBenchmarkLogs=!1,this.writableDataPathStandard="/scandit_sync_folder",this.resourceFilesSubfolder="resources",this.performanceMetricsReporterTimer=void 0,this.performanceMetrics={frameDataPoolSize:0,processedFramesCount:0,redrawRequestsCount:0,actualRedrawsCount:0},this.gestureListener=null,this.webPlatformHintPresenter=null,this.moduleHandler=e,this.workerFunctions=a,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}convertToLoadableFrameData(e){let a=this.getNextFrameId();this.frameDataPool.set(a,new Uint8ClampedArray(e.getFrameData()));let r=this.lastUsedModuleMirrorAxis==null?!1:this.lastUsedModuleMirrorAxis!==this.Module.Axis.None;return{frameId:a,width:e.getWidth(),height:e.getHeight(),isFrameSourceMirrored:r}}createContext(e){var a,r,i,s,n;let o=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,o,e.delayedRegistration,e.highEndBlurryRecognition,this.resourcePath);let d=this.contextDeserializer.contextFromJson(JSON.stringify(e.context));if(d==null){let u=this.contextDeserializer.getLastError();throw new Error(`Could not create the context: ${u}`)}let h=d.getView();this.context=d.getContext(),d.delete();let g=this.Module.DataCaptureContextListener.extend("DataCaptureContextListener",{didChangeStatus:(u,f)=>{this.contextDidChangeStatus(JSON.parse(f.toJson())),u.delete()},didStartObservingContext:u=>{this.didStartObservingContext(),u.delete()},didStopObservingContext:u=>{u.delete()}}),m=this.Module.DataCaptureContextFrameListener.extend("DataCaptureContextFrameListener",{onObservationStarted:u=>{u.delete()},onObservationStopped:u=>{u.delete()},onFrameProcessingStarted:(u,f)=>{this.workerFunctions.postMessage({type:"onFrameProcessingStarted"}),f.delete(),u.delete()},onFrameProcessingFinished:(u,f)=>{this.workerFunctions.postMessage({type:"onFrameProcessingFinished"}),f.delete(),u.delete()},onFrameSkipped:(u,f)=>{this.workerFunctions.postMessage({type:"onFrameSkipped"}),f.delete(),u.delete()}}),b=this.Module.GestureRecognizer.extend("GestureRecognizer",{setGestureListener:(u,f)=>{var O;(O=this.gestureListener)==null||O.delete(),this.gestureListener=u.clone(),u.delete()}});(a=this.gestureRecognizer)==null||a.delete(),this.gestureRecognizer=new b;let v=new g;this.context.addListener(v),v.delete();let w=new m;this.context.addFrameListener(w),w.delete(),this.setView(h),(r=this.view)==null||r.setGestureRecognizer(this.gestureRecognizer);let C=this.Module.PlatformHintPresenter.extend("PlatformHintPresenter",{setHintPresenter:u=>{u.delete()},showToast:u=>{this.workerFunctions.postMessage({type:"showToast",payload:JSON.parse(u)})},hideToast:u=>{this.workerFunctions.postMessage({type:"hideToast",payload:JSON.parse(u)})},showGuidance:u=>{this.workerFunctions.postMessage({type:"showGuidance",payload:JSON.parse(u)})},hideGuidance:u=>{this.workerFunctions.postMessage({type:"hideGuidance",payload:JSON.parse(u)})},startUpdateTimer:u=>{this.workerFunctions.postMessage({type:"startUpdateTimer",payload:{duration:{unit:"ms",value:u}}})},stopUpdateTimer:()=>{this.workerFunctions.postMessage({type:"stopUpdateTimer"})}});(i=this.hintPresenterV2)==null||i.delete(),(s=this.webPlatformHintPresenter)==null||s.delete(),this.webPlatformHintPresenter=new C,this.hintPresenterV2=new this.Module.HintPresenterV2(this.webPlatformHintPresenter),(n=this.view)==null||n.setHintPresenterV2(this.hintPresenterV2)}onTap(e){var a;(a=this.gestureListener)==null||a.onTap(JSON.stringify(e))}hintPresenterV2Update(){var e;(e=this.hintPresenterV2)==null||e.update()}startReportingPerformanceMetrics(){this.performanceMetricsReporterTimer==null&&(this.performanceMetricsReporterTimer=setInterval(()=>{this.reportPerformanceMetrics();for(let e of Object.keys(this.performanceMetrics))this.performanceMetrics[e]=0},1e3))}async reportPerformanceMetrics(){this.workerFunctions.postMessage({type:"performanceMetricsReport",payload:{...this.performanceMetrics}})}deleteFrameData(e){this.frameDataPool.delete(e)}dispose(){var e,a;this.context.dispose(),this.frameDataPool.clear(),this.isDrawLoopRunning=!1,this.lastFrameCounter=-1,(e=this.gestureRecognizer)==null||e.delete(),this.gestureRecognizer=null,(a=this.gestureListener)==null||a.delete(),this.gestureListener=null}flushAnalytics(){this.context.flushAnalytics()}extractCentaurusLicense(e){return{payload:{centaurus:{licenseKey:this.Module.LicenseUtils[fe.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 a;if(this.context==null)return{payload:e,transferables:[e.data.buffer]};let r=e.data,i=e.colorType==="GRAYSCALE"?this.Module.ImageBufferFormat.Grayscale8:this.Module.ImageBufferFormat.Rgba8888,s=this.Module.allocateUint8Array(r.byteLength);return this.Module.HEAPU8.set(r,s),(a=this.imageFrameSource)==null||a.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 a=this.frameDataPool.get(e);return a==null?{payload:{data:null}}:{payload:{data:a},transferables:[a.buffer]}}scheduleRedraw(e,a){this.addRedrawRequest(a),this.isDrawLoopRunning||this.startDrawLoop(e)}sendViewRefreshCommands(e){this.workerFunctions.postMessage({type:"draw",payload:e},[e.buffer])}setFrameSource(e,a){var r;this.lastUsedModuleMirrorAxis=this.mapMirrorAxisOnModule(e),(r=this.imageFrameSource)==null||r.delete(),this.imageFrameSource=new this.Module.ImageBufferFrameSource(this.lastUsedModuleMirrorAxis,a,0),this.context.setFrameSource(this.imageFrameSource)}startDrawLoop(e){this.isDrawLoopRunning=!0;let a=s=>this.redrawRequests.length>0&&this.redrawRequests[0]<=s,r=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(a(s)){r(s),e.draw();let n=e.getDrawCommands();this.sendViewRefreshCommands(new Uint8Array(n))}i()},this.redrawInterval)};i()}updateContext(e){if(this.context!=null&&this.contextDeserializer!=null){e.view!=null&&!e.view.visible&&this.context.flushAnalytics();let a=this.onBeforeUpdateContextHook(e),r=this.contextDeserializer.updateContextFromJson(this.context,this.view,JSON.stringify(a.context));if(r==null){let s=this.contextDeserializer.getLastError();throw new Error(`Could not update the context: ${s}`)}this.context.delete(),this.context=r.getContext();let i=r.getView();r.delete(),i!=null&&a.view!=null&&i.setViewSize(a.view.width,a.view.height,a.view.orientation),this.hintPresenterV2!=null&&i?.setHintPresenterV2(this.hintPresenterV2),this.gestureRecognizer!=null&&i?.setGestureRecognizer(this.gestureRecognizer),this.setView(i),l.debug("context updated",a)}}onBeforeUpdateContextHook(e){return e}onDocumentVisibilityChange(e){e==="hidden"&&this.context.flushAnalytics()}isFeatureSupported(e){return{payload:{supported:this.context.isFeatureSupported(e)}}}getViewfinderInfo(){var e,a;return{payload:{isDisplayingViewfinder:(a=(e=this.view)==null?void 0:e.isDisplayingViewfinder())!=null?a:!1,rect:JSON.parse(this.view.getViewfinderRect())}}}getOpenSourceSoftwareLicenseInfo(){return{payload:{licenseText:this.Module.OpenSourceSoftwareLicenseInfo.getLicenseText()}}}getNextFrameId(){return this.lastFrameCounter++,this.lastFrameCounter>=this.MAX_NUMBER_OF_IMAGES_IN_FRAME_DATA_POOL&&(this.lastFrameCounter=0),this.lastFrameCounter}getWasmDynamicLibraries(e){return this.getWasmSideModuleFileName()==null?[]:[`${e.replace(/\\/[^/]*$/,"/")}${this.getWasmSideModuleFileName()}`]}getWasmCoreExpectedHash(e,a){return a?e?"4d3fb5f8b729f5fae58a4c988cf6d5035ad76a84134ba3474540793676e7dac8":"e37126471a883ac69dbc4dceb07ee9ff0809ec66d23eb7b6a6560acbc2145c2c":e?"99446c22ecee954017ccc69ab9ee3aed89d32b2a8294b4bf9262a68216cec1f6":""}getWasmCoreFileName(e,a){return a?e?"scandit-datacapture-sdk-barcode-simd-pthreads.wasm":"scandit-datacapture-sdk-barcode-pthreads.wasm":e?"scandit-datacapture-sdk-barcode-simd.wasm":""}getWasmMetadata(){return p}getWasmSideModuleFileName(){return""}_loadProgressCallback(e){this.workerFunctions.postMessage({type:"loadLibraryProgress",payload:e})}addRedrawRequest(e){this.redrawRequests.push(Math.round(performance.now())+e),this.redrawRequests.sort((a,r)=>a-r)}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){l.warn("addNativeOverlay has not been implemented for this module",e)}removeNativeOverlay(e){l.warn("removeNativeOverlay has not been implemented for this module",e)}setViewRefreshHandler(e){if(e==null||e.isViewRefreshHandlerSet)return;let a=this.Module.NeedsRedrawDelegate.extend("NeedsRedrawDelegate",{setNeedsRedrawIn:this.scheduleRedraw.bind(this,e)}),r=new a;e.setNeedsRedrawDelegate(r),e.isViewRefreshHandlerSet=!0}setupDataDecoding(){let e=this.moduleHandler.get(),a=e.DataDecoding.extend("DataDecoding",{decode(r,i){try{let s=JSON.parse(i),n=[];for(let o of s){let c=new TextDecoder(o.ianaName,{fatal:!0});n.push(c.decode(r.slice(o.startIndex,o.endIndex)))}return n.join("")}catch{return""}}});e.setDataDecoding(new a)}start(e,a,r){e&&a&&(this.setupDataDecoding(),this.moduleHandler.get().callMain(),this.moduleHandler.get().__emscripten_proxy_main!==void 0||r())}getWritableDataPath(e){return e!=null?(l.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:a,writableDataPathOverride:r,overrideThreadsSupport:i,overrideSimdSupport:s,verifyResponseHash:n,referredOrigin:o,fixedWasmMemory:c}){var d;let h=!1,g=!1;this.writableDataPath=this.getWritableDataPath(r),this.resourcePath=`${e}${this.resourceFilesSubfolder}/`,globalThis.path=a;let{resolve:m,reject:b,promise:v}=new he,w=L.sdkVersion();if(w==="")throw new P({name:"Invalid library version",message:"Library version is not defined or empty, cannot generate proper path to library files."});let[C,u]=await Promise.all([me(),be()]);i!=="auto"&&(u=i==="on"),s!=="auto"&&(C=s==="on");let f=this.getWasmCoreFileName(C,u),O=ae(w,e,f),{jsURI:U,wasmURI:te}=O,Be={instantiateWasm:(S,Pe)=>(ue({importObject:S,wasmURI:te,expectedHash:this.getWasmCoreExpectedHash(C,u),verifyResponseHash:n,successCallback:Pe,progressCallback:this._loadProgressCallback,referredOrigin:o}),{})},B=c===null?null:new WebAssembly.Memory({initial:this.numOfMBToPages(c),maximum:this.numOfMBToPages(300),shared:u});return B!==null&&l.log(l.Level.Debug,"Fixed wasmMemory set",B),this.moduleHandler.set({...B?{wasmMemory:B}:{},mainScriptUrlOrBlob:U,canvas:(d=this.workerFunctions.getOffscreenCanvas())!=null?d:{getContext:()=>null},...Be,dynamicLibraries:this.getWasmDynamicLibraries(te),locateFile:S=>e+S,noInitialRun:!0,preRun:[async()=>{try{await ne({writableDataPath:this.writableDataPath})}catch(S){if(S.name==="BlockedIndexedDB"){b(S.toString());return}l.log(l.Level.Debug,"No IndexedDB support, some data will not be persisted:",S)}g=!0,this.start(g,h,m)}],onMainComplete:()=>{if([h,g].includes(!1)){l.log(l.Level.Warn,{runtimeLoaded:h,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}m()},onRuntimeInitialized:()=>{h=!0,this.start(g,h,m)},print:S=>{l.log(l.Level.Info,S)}}),await pe(U,w)||b(`Couldn\'t retrieve Scandit Data Capture library at ${U}, did you configure the path for it correctly?`),v}};ge.get3dPartyLicenseKeyMethodName=atob("Z2V0QmxpbmtJZExpY2Vuc2VLZXk=");var D=ge;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 ee=class{constructor(t,e){this.onMessageListener=this.onMessage.bind(this),this.workerSelf=t,this.dataCaptureInstance=new D(e,{postMessage:this.postMessage.bind(this),getOffscreenCanvas:this.getOffscreenCanvas.bind(this)}),ye(t)&&this.listenToMessages()}listenToMessages(){this.workerSelf.addEventListener("message",this.onMessageListener),this.workerSelf.addEventListener("error",t=>{l.log(l.Level.Error,t)}),this.workerSelf.addEventListener("messageerror",t=>{l.log(l.Level.Error,t)})}postMessage(t,e){this.workerSelf.postMessage(t,e??[])}getOffscreenCanvas(){if(typeof this.workerSelf.OffscreenCanvas=="function")return new this.workerSelf.OffscreenCanvas(32,32)}hasPayload(t){return M(t)&&"payload"in t}hasTransferables(t){return M(t)&&Array.isArray(t.transferables)}async respondWith(t,e,a){let r=null,i;try{i=a(),i instanceof Promise&&(i=await i)}catch(n){i=void 0,r=F(n)}let s={type:"workerTaskId",command:t,id:e,payload:this.hasPayload(i)?i.payload:void 0};r!=null&&(s.error=r),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,overrideThreadsSupport:e.overrideThreadsSupport,overrideSimdSupport:e.overrideSimdSupport,verifyResponseHash:e.verifyResponseHash,fixedWasmMemory:e.fixedWasmMemory}))}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,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,()=>{l.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;default:return Se(t.data),!1}return!0}};var ve=(t=>(t.Body="body",t.Footnote="footnote",t))(ve||{}),T=(t=>(t.Start="start",t.Center="center",t.End="end",t))(T||{}),we=(t=>(t.Normal="normal",t.Wider="wider",t.FitText="fitText",t))(we||{}),Ce=(t=>(t.Normal="normal",t.Taller="taller",t))(Ce||{}),Me=(t=>(t.Square="square",t.Rounded="rounded",t))(Me||{}),W=(t=>(t.None="none",t.Check="check",t.ExclamationMark="exclamationMark",t))(W||{}),E=(t=>(t.Top="top",t.AboveViewFinder="aboveViewFinder",t.BelowViewFinder="belowViewFinder",t))(E||{}),Fe=(t=>(t.AboveViewFinder="aboveViewFinder",t.BelowViewFinder="belowViewFinder",t))(Fe||{}),ke=(t=>(t.BlackOnWhite="blackOnWhite",t.WhiteOnBlack="whiteOnBlack",t.Transparent="transparent",t))(ke||{}),x=(t=>(t.Success="success",t.Error="error",t.Warning="warning",t.Info="info",t.Notification="notification",t))(x||{}),De=(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))(De||{});var A=class{constructor(e,a,r){this.trackingListenerSet=!1;this.coreEngine=e,this.Module=a,this.workerFunctions=r,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:(r,i,s)=>{this.barcodeBatchDidUpdateSession(i),r.delete(),i.delete(),s.delete()},onTrackedBarcodeTapped:(r,i)=>{this.onTrackedBarcodeTapped(i),r.delete(),i.delete()}}),a=this.Module.BarcodeBatchDeserializerListener.extend("BarcodeTrackingDeserializerListener",{onModeDeserializationFinished:(r,i,s)=>{this.trackingListenerSet||(i.addListener(new e,1),this.trackingListenerSet=!0),r.delete(),i.delete(),s.delete()},onModeDeserializationStarted(r,i,s){r.delete(),i.delete(),s.delete()},onSettingsDeserializationStarted(r,i,s){r.delete(),i.delete(),s.delete()},onSettingsDeserializationFinished(r,i,s){r.delete(),i.delete(),s.delete()}});this.barcodeBatchDeserializer=new this.Module.BarcodeBatchDeserializer,this.barcodeBatchDeserializer.setListener(new a)}onTrackedBarcodeTapped(e){this.workerFunctions.postMessage({type:"didTapTrackedBarcode",payload:JSON.parse(e.toJson())})}};var R=class{constructor(e,a,r){this.captureListenerSet=!1;this.coreEngine=e,this.Module=a,this.workerFunctions=r,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:(n,o,c)=>{this.barcodeCaptureDidScan(o,c),n.delete(),c.delete(),o.delete()},didUpdateSession:(n,o,c)=>{this.barcodeCaptureDidUpdateSession(o),n.delete(),c.delete(),o.delete()}}),a=this.Module.Feedback.extend("Feedback",{emit:()=>{this.successFeedback()}}),r=new e,i=new a,s=this.Module.BarcodeCaptureDeserializerListener.extend("BarcodeCaptureDeserializerListener",{onModeDeserializationFinished:(n,o,c)=>{o.addListener(r,1),o.setSuccessFeedback(i),n.delete(),o.delete(),c.delete()},onModeDeserializationStarted(n,o,c){n.delete(),o.delete(),c.delete()},onSettingsDeserializationStarted(n,o,c){n.delete(),o.delete(),c.delete()},onSettingsDeserializationFinished(n,o,c){n.delete(),o.delete(),c.delete()}});this.barcodeCaptureDeserializer=new this.Module.BarcodeCaptureDeserializer,this.barcodeCaptureDeserializer.setListener(new s)}successFeedback(){this.workerFunctions.postMessage({type:"successFeedback"})}barcodeCaptureDidScan(e,a){let r=this.coreEngine.convertToLoadableFrameData(a);this.workerFunctions.postMessage({type:"barcodeCaptureDidScan",payload:{session:JSON.parse(e.toJson()),frameData:r}})}};var N=class{constructor(e,a,r){this.barcodeCheck=null;this.coreEngine=e,this.Module=a,this.workerFunctions=r}async forSettings(e){this.barcodeCheck?.delete(),this.barcodeCheck=new this.Module.BarcodeCheck(this.coreEngine.context,JSON.stringify(e));let a=this.Module.BarcodeCheckListener.extend("BarcodeCheckListener",{didUpdateSession:(r,i,s)=>{let n=this.coreEngine.convertToLoadableFrameData(s);this.workerFunctions.postMessage({type:"barcodeCheckDidUpdateSession",payload:{session:JSON.parse(i.toJson()),frameData:n}}),r.delete(),i.delete(),s.delete()}});this.barcodeCheck.addListener(new a,1),this.Module.addBarcodeCheckToContext(this.coreEngine.context,this.barcodeCheck)}start(){this.barcodeCheck?.start()}pause(){this.barcodeCheck?.pause()}stop(){this.barcodeCheck?.stop()}setEnabled(e){this.barcodeCheck?.setEnabled(e)}async removeMode(){this.barcodeCheck!=null&&this.Module.removeBarcodeCheckFromContext(this.coreEngine.context,this.barcodeCheck)}applySettings(e){this.barcodeCheck?.applySettings(JSON.stringify(e))}};function Ke(t){return t.charAt(0).toUpperCase()+t.slice(1)}function xe(t){return t}var H=class{constructor(e,a,r){this.barcodeFind=null;this.basicOverlay=null;this.transparentGuidanceHintStyle={backgroundColor:"00000000",cornerRadius:4,fitToText:!1,isAnimatedToView:!1,textAlignment:T.Center,hintIcon:W.None,hintAnchor:E.AboveViewFinder,hintAnchorOffset:-12,horizontalMargin:0,iconColor:"00000000",lineHeight:-1,maxLines:1,maxWidthFraction:.8,textColor:"ffffffff",textSize:15,textWeight:600};this.customerTransformation=xe;this.coreEngine=e,this.Module=a,this.workerFunctions=r}async forSettings(e){this.barcodeFind?.delete(),this.barcodeFind=new this.Module.BarcodeFind(this.coreEngine.context,JSON.stringify(e));let a=this.Module.Feedback.extend("Feedback",{emit:()=>{this.listUpdatedFeedback()}}),r=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,o,c)=>{let d=this.coreEngine.convertToLoadableFrameData(c);this.workerFunctions.postMessage({type:"barcodeFindDidUpdateSession",payload:{session:JSON.parse(o.toJson()),frameData:d}}),n.delete(),o.delete(),c.delete()},onSearchPaused:n=>{let o=[];for(let c=0;c<n.size();c++)o.push(n.get(c));this.workerFunctions.postMessage({type:"barcodeFindSearchPaused",payload:{foundItems:o}})},onSearchStopped:n=>{let o=[];for(let c=0;c<n.size();c++)o.push(n.get(c));this.workerFunctions.postMessage({type:"barcodeFindSearchStopped",payload:{foundItems:o}})},onSearchStarted:()=>{this.workerFunctions.postMessage({type:"barcodeFindSearchStarted",payload:{}})}});this.barcodeFind.setBarcodeFindTransformer(new i),this.barcodeFind.addListener(new s,1),this.barcodeFind.setItemListUpdatedFeedback(new a),this.barcodeFind.setFeedback(new r),this.Module.addBarcodeFindToContext(this.coreEngine.context,this.barcodeFind)}barcodeFindFeedback(){this.workerFunctions.postMessage({type:"barcodeFindFeedback",payload:{}})}start(){this.barcodeFind?.start()}stop(){this.barcodeFind?.stop()}pause(){this.barcodeFind?.pause()}setEnabled(e){this.barcodeFind?.setEnabled(e)}setItemList(e){this.barcodeFind?.setItemList(JSON.stringify(e))}async removeMode(){this.barcodeFind!=null&&this.Module.removeBarcodeFindFromContext(this.coreEngine.context,this.barcodeFind)}addBasicOverlay(){this.basicOverlay?.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){this.barcodeFind?.applySettings(JSON.stringify(e))}updateBasicOverlay(e){let a=Object.entries(e).filter(([r,i])=>r!=="type");for(let[r,i]of a){let s=`set${Ke(r)}`;this.basicOverlay!=null&&typeof this.basicOverlay[s]=="function"&&i!=null&&this.basicOverlay[s](i)}}setTransformerFunction(e){this.customerTransformation=e??xe}successFeedback(){this.workerFunctions.postMessage({type:"successFeedback"})}listUpdatedFeedback(){this.workerFunctions.postMessage({type:"barcodeFindListUpdatedFeedback",payload:{}})}setToast(e,a){let r=this.coreEngine.hintPresenterV2;e?r?.showToast(JSON.stringify(a)):r?.hideToast(a.tag)}setGuidance(e,a,r){let i={tag:r,text:a,hintStyle:this.transparentGuidanceHintStyle};this.workerFunctions.postMessage({type:e?"showGuidance":"hideGuidance",payload:i})}createWebFindGuidanceHandler(){let e=this.Module.BarcodeFindGuidanceHandler.extend("BarcodeFindGuidanceHandler",{setInitialGuidance:(a,r)=>{this.setGuidance(a,r,"InitialGuidance")},setMoveCloserGuidance:(a,r)=>{this.setGuidance(!1,r,"InitialGuidance"),this.setGuidance(a,r,"MoveCloserGuidance")},setAllItemsFound:(a,r)=>{let i={text:r,toastHintStyle:x.Success,tag:"AllItemsFound"};this.setToast(a,i)},setTapShutterToPause:(a,r)=>{this.setGuidance(!1,r,"InitialGuidance"),this.setGuidance(a,r,"TapShutterToPause")},setTapShutterToResume:(a,r)=>{this.setGuidance(!1,r,"InitialGuidance"),this.setGuidance(a,r,"TapShutterResume")},setItemListUpdated:(a,r)=>{let i={text:r,toastHintStyle:x.Info,tag:"ItemListUpdated"};this.setToast(a,i)}});return new e}};var y=class{constructor(e){this.subscribers=new Set;this.property={key:e,value:null}}addSubscriber(e){this.subscribers.add(e),e.onPropertyChanged?.(this.property)}removeSubscriber(e){this.subscribers.delete(e)}setProperty(e){if(this.property.value!==e.value){this.property={key:this.property.key,value:e.value};for(let a of this.subscribers)a.onPropertyChanged?.(this.property)}}};var Xe={torch_state:new y("torch_state"),scanning_mode:new y("scanning_mode"),sound_enabled:new y("sound_enabled"),haptic_enabled:new y("haptic_enabled"),hand_mode:new y("hand_mode"),session_stop_reason:new y("session_stop_reason"),camera_position:new y("camera_position")},_=class{getBehaviorSubject(e){return Xe[e]}};var z=class{constructor(e,a,r){this.captureListenerSet=!1;this.propertyPushSource=new _;this.coreEngine=e,this.Module=a,this.workerFunctions=r,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,n)=>{this.sparkScanDidScan(s,n),i.delete(),s.delete(),n.delete()},didUpdateSession:(i,s,n)=>{this.sparkScanDidUpdateSession(s),i.delete(),s.delete(),n.delete()}}),a=this.Module.Feedback.extend("Feedback",{emit:()=>{this.successFeedback()}}),r=this.Module.SparkScanDeserializerListener.extend("SparkScanDeserializerListener",{onModeDeserializationFinished:(i,s,n)=>{this.captureListenerSet||(s.addListener(new e,1),s.setSuccessFeedback(new a),s.setPropertyPushSource(this.propertyPushSource),this.captureListenerSet=!0),i.delete(),s.delete(),n.delete()},onModeDeserializationStarted(i,s,n){i.delete(),s.delete(),n.delete()},onSettingsDeserializationStarted(i,s,n){i.delete(),s.delete(),n.delete()},onSettingsDeserializationFinished(i,s,n){i.delete(),s.delete(),n.delete()},onOverlayDeserializationStarted(i,s,n){i.delete(),s.delete(),n.delete()},onOverlayDeserializationFinished:(i,s,n)=>{this.sparkScanOverlay?.delete(),this.sparkScanOverlay=s,i.delete(),n.delete()}});this.sparkScanDeserializer=new this.Module.SparkScanDeserializer,this.sparkScanDeserializer.setListener(new r)}emitErrorFeedback(e){this.sparkScanOverlay?.onErrorFeedbackEmitted(e)}overlayReadyForDraw(){this.sparkScanOverlay?.onReadyForNewData()}analyticsManagerPropertyChanged(e){this.propertyPushSource.getBehaviorSubject(e.key).setProperty(e)}successFeedback(){this.workerFunctions.postMessage({type:"successFeedback"})}sparkScanDidScan(e,a){let r=this.coreEngine.convertToLoadableFrameData(a);this.workerFunctions.postMessage({type:"sparkScanDidScan",payload:{session:JSON.parse(e.toJson()),frameData:r}})}};var V=class extends D{constructor(e,a){super(e,a)}getModeDeserializers(){this.barcodeCaptureMode=new R(this,this.Module,this.workerFunctions),this.barcodeBatchMode=new A(this,this.Module,this.workerFunctions),this.sparkScanMode=new z(this,this.Module,this.workerFunctions),this.barcodeFindMode=new H(this,this.Module,this.workerFunctions),this.barcodeCheckMode=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,a){return a?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,a){return a?e?"4d3fb5f8b729f5fae58a4c988cf6d5035ad76a84134ba3474540793676e7dac8":"e37126471a883ac69dbc4dceb07ee9ff0809ec66d23eb7b6a6560acbc2145c2c":e?"99446c22ecee954017ccc69ab9ee3aed89d32b2a8294b4bf9262a68216cec1f6":"d30ed166d9218c7104c77a709980da4e3b114f4644abe07c2e1a4adb7770a153"}getWasmMetadata(){return p}};function Ye(t){return(a=>/^[$A-Z_a-z][\\w$]*\\s*\\(.*\\)\\s*\\{/.test(a)&&!a.startsWith("function"))(t)?`function ${t}`:t}var Ze=["fetch","XMLHttpRequest","eval","Function","self","globalThis","Module","importScripts","this","console","window","document","import","Worker","ServiceWorker"];function Qe(t){return Ze.map(a=>new RegExp(`\\\\b${a}\\\\b`,"g")).some(a=>a.test(t))}function Oe(t){if(t==null)return null;let e=Ye(t);if(Qe(e))throw new Error("Function should be pure. Shouldn\'t introduce side effects, or rely on global scope");let a=`\'use strict\';\n return (${e});`;try{return new Function(a)()}catch{return null}}var J=class extends ee{constructor(e,a){super(e,a),this.dataCaptureInstance=new V(a,{postMessage:this.postMessage.bind(this),getOffscreenCanvas:this.getOffscreenCanvas.bind(this)})}async respondWith(e,a,r){let i=null,s;try{s=r(),s instanceof Promise&&(s=await s)}catch(o){s=void 0,i=F(o)}let n={type:"workerTaskId",command:e,id:a,payload:this.hasPayload(s)?s.payload:void 0};i!=null&&(n.error=i),this.postMessage(n,this.hasTransferables(s)?s.transferables:[])}onMessage(e){switch(e.data.command){case"sparkScanEmitErrorFeedback":{let{data:a}=e;return this.respondWith(a.command,a.id,()=>{this.dataCaptureInstance.sparkScanMode.emitErrorFeedback(a.shouldRemoveBrush)}),!0}case"sparkScanOverlayReadyForDraw":{let{data:a}=e;return this.respondWith(a.command,a.id,()=>{this.dataCaptureInstance.sparkScanMode.overlayReadyForDraw()}),!0}case"sparkScanAnalyticsManagerPropertyChanged":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.sparkScanMode.analyticsManagerPropertyChanged(a.property)}),!0}case"barcodeFindForSettings":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeFindMode.forSettings(a.settings)),!0}case"barcodeFindModeRemove":{let{data:a}=e;return this.respondWith(a.command,a.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:a}=e;return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.setItemList(a.itemList)}),!0}case"barcodeFindSetEnabled":{let{data:a}=e;return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.setEnabled(a.enabled)}),!0}case"barcodeFindApplySettings":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeFindMode.applySettings(a.settings)),!0}case"barcodeFindAddBasicOverlay":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.barcodeFindMode.addBasicOverlay()}),!0}case"barcodeFindRemoveBasicOverlay":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.barcodeFindMode.removeBasicOverlay()}),!0}case"barcodeFindUpdateBasicOverlay":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.barcodeFindMode.updateBasicOverlay(a.jsonOverlay)}),!0}case"barcodeFindSetTransformerFunction":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>{let r=Oe(a.functionAsString);this.dataCaptureInstance.barcodeFindMode.setTransformerFunction(r)}),!0}case"barcodeCheckForSettings":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeCheckMode.forSettings(a.settings)),!0}case"barcodeCheckModeRemove":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeCheckMode.removeMode()),!0}case"barcodeCheckSearchStart":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeCheckMode.start()}),!0;case"barcodeCheckSearchPause":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeCheckMode.pause()}),!0;case"barcodeCheckSearchStop":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeCheckMode.stop()}),!0;case"barcodeCheckSetEnabled":{let{data:a}=e;return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeCheckMode.setEnabled(a.enabled)}),!0}case"barcodeCheckApplySettings":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.barcodeCheckMode.applySettings(a.settings)}),!0}default:return super.onMessage(e)}}};var Qa=new J(globalThis,{get:()=>globalThis.Module,set:t=>{globalThis.Module=t}});function er(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,c)=>{let i=this.workerCommandId++;this.workerTasks.set(i,{resolve:d,reject:c,command:e});let l={...t,command:e,id:i};this.dataCaptureWorker.postMessage(l,a);})}};
|
|
1
|
+
import {DataCaptureLoader,Logger}from'@scandit/web-datacapture-core';function n(r){let s=URL.createObjectURL(new Blob(['"use strict";(()=>{var p={"scandit-datacapture-sdk-barcode-pthreads.wasm":{bytes:6915719},"scandit-datacapture-sdk-barcode-simd-pthreads.wasm":{bytes:6827890},"scandit-datacapture-sdk-barcode-simd.wasm":{bytes:6708410},"scandit-datacapture-sdk-barcode.wasm":{bytes:6796715}};function M(t){return typeof t=="object"&&t!=null}function F(t){if(typeof t=="string")return t;if(M(t)){if(typeof t.message=="string")return t.message}else if(typeof t?.toString=="function")return t.toString();return"unknown error"}var l;(t=>{(d=>(d.Debug="debug",d.Info="info",d.Warn="warn",d.Error="error",d.Quiet="quiet"))(t.Level||(t.Level={}));let e=new Map([["debug",1],["info",2],["warn",3],["error",4],["quiet",5]]),a="debug";function r(d){a=d}t.setLevel=r;function i(d,...h){if(!(e.get(a)>e.get(d)))switch(d){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(...d){i("warn",...d)}t.warn=s;function n(...d){i("debug",...d)}t.debug=n;function o(...d){i("info",...d)}t.info=o;function c(...d){i("error",...d)}t.error=c})(l||(l={}));var P=class ae extends Error{constructor(e){super(e.message),Object.setPrototypeOf(this,ae.prototype),this.name=e.name}toString(){return`${this.name}: ${this.message}`}};var I=Promise.resolve(),G=!1,$=!1,k,j={writableDataPath:""};async function re(t){if(k==null)return;G=!0;let e=new Promise((a,r)=>{setTimeout(()=>{r(new P({name:"BlockedIndexedDB",message:"IndexedDB database is blocked"}))},1500)});try{await Promise.race([new Promise((a,r)=>{k?.(t,i=>{if(i!=null){r(i);return}a()})}),e])}finally{G=!1}}async function ie(t){return $||(G?($=!0,I=I.then(async()=>($=!1,re(t)))):I=re(t)),I}async function se(t){j=t,k=FS.syncfs,FS.syncfs=(e,a)=>{let r=a,i=()=>{r()},s=n=>{r(n)};ie(e).then(i).catch(s)};try{FS.mkdir(j.writableDataPath)}catch(e){if(e.code!=="EEXIST")throw k=void 0,e}return FS.mount(IDBFS,{},j.writableDataPath),ie(!0)}var q=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t);var K=function(t,e){this[0]=t,this[1]=e},ne=(t,e,a)=>{var r=(n,o,c,d)=>{try{var h=a[n](o),g=(o=h.value)instanceof K,m=h.done;Promise.resolve(g?o[0]:o).then(b=>g?r(n==="return"?n:"next",o[1]?{done:b.done,value:b.value}:b,c,d):c({value:b,done:m})).catch(b=>r("throw",b,c,d))}catch(b){d(b)}},i=n=>s[n]=o=>new Promise((c,d)=>r(n,o,c,d)),s={};return a=a.apply(t,e),s[q("asyncIterator")]=()=>s,i("next"),i("throw"),i("return"),s},oe=(t,e,a)=>(e=t[q("asyncIterator")])?e.call(t):(t=t[q("iterator")](),e={},a=(r,i)=>(i=t[r])&&(e[r]=s=>new Promise((n,o,c)=>(s=i.call(t,s),c=s.done,Promise.resolve(s.value).then(d=>n({value:d,done:c}),o)))),a("next"),a("return"),e);var de={};function Le(t){return[...new Uint8Array(t)].map(e=>{let a=e.toString(16);return a.length===1?`0${a}`:a}).join("")}function Te(t){return ne(this,null,function*(){let e=t.getReader();try{for(;;){let{done:a,value:r}=yield new K(e.read());if(a)return;yield r}}finally{e.releaseLock()}})}async function We(t){let e=[],a=0,r=0;try{for(var i=oe(Te(t)),s,n,o;s=!(n=await i.next()).done;s=!1){let d=n.value;e.push(d),a+=d.length}}catch(d){o=[d]}finally{try{s&&(n=i.return)&&await n.call(i)}finally{if(o)throw o[0]}}let c=new Uint8Array(a);for(let d of e)c.set(d,r),r+=d.length;return c.buffer}var Ee=(t=>(t.VALID="VALID",t.INVALID="INVALID",t.NOT_VERIFIABLE="NOT_VERIFIABLE",t))(Ee||{});async function Ae(t,e,a){if(typeof crypto.subtle.digest!="function")return l.log(l.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 ${a} could not be verified`),"NOT_VERIFIABLE";try{let r=t instanceof Promise?await t:t,i=await crypto.subtle.digest("SHA-256",r),s=Le(i);return e==null?(l.log(l.Level.Warn,"The library hash is not defined or empty, cannot correctly verify integrity."),"NOT_VERIFIABLE"):s===e?(l.log(l.Level.Debug,`Data Capture library WASM integrity found at ${a} has been verified correctly.`),"VALID"):(l.log(l.Level.Warn,`The Scandit Data Capture library WASM file found at ${a} 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(r){return l.log(l.Level.Warn,"Wasm response could not be verified",r),"NOT_VERIFIABLE"}}var X=new Map([["br",4.4],["gzip",2.9],["none",1]]);function Re(t){var e;let a="content-encoding";if(t==null||t.get(a)==null)return X.get("none");let r=new Set(((e=t.get(a))!=null?e:"").split(",").map(i=>i.trim()));for(let[i,s]of X)if(r.has(i))return s;return X.get("none")}function Ne(t){var e,a;if(t==null)return 0;let r=(e=Re(t))!=null?e:1,i=Number.parseInt((a=t.get("content-length"))!=null?a:"0",10);return Number.isNaN(i)?0:Math.floor(i*r*100)/100}function He(t){let{pathname:e}=new URL(t);for(let[a,r]of Object.entries(de))if(e.endsWith(a))return r.bytes;return 0}function ce(t){de=t}var _e=(t,e)=>{let a=Ne(e);return a===0?He(t):a};function ze(t,e,a,{onProgress:r,onError:i,onComplete:s}){if(!e.body)return[e];let n=_e(t,e.headers),o=0,c=0,[d,h]=a?e.body.tee():[e.body],g=d.pipeThrough(new TransformStream({async transform(m,b){try{o+=m.length,c=Number((o/n*100).toFixed(2)),n>0&&m.length>0&&c<100?r?.({percentage:c,loadedBytes:o,privateUri:t}):n===0&&m.length>0&&r?.({percentage:null,loadedBytes:o,privateUri:t}),b.enqueue(m)}catch(v){b.error(v),i?.({error:v})}},flush(m){r?.({percentage:100,loadedBytes:o,privateUri:t}),s?.({percentage:100,loadedBytes:o,privateUri:t}),m.terminate()}}));return[new Response(g,{headers:new Headers(e.headers),status:e.status,statusText:e.statusText}),h]}async function Y({wasmURI:t,expectedHash:e,verifyResponseHash:a,onProgress:r,onComplete:i,onError:s,referredOrigin:n}){let o=await fetch(t,{referrerPolicy:"origin",referrer:n??""});if(!o.ok)throw new Error(`HTTP status code is not ok: ${o.status}, ${o.statusText}`);let[c,d]=ze(t,o,a,{onProgress:r,onError:s,onComplete:i});return d!=null&&Ae(We(d),e,t),c}function le({wasmURI:t,expectedHash:e,verifyResponseHash:a,progressCallback:r,successCallback:i,importObject:s,referredOrigin:n}){async function o(d){try{let h=await Y({wasmURI:t,expectedHash:e,verifyResponseHash:a,onProgress:r,referredOrigin:n}),g=await(d??h).arrayBuffer(),m=await globalThis.WebAssembly.instantiate(g,s);i(m.instance,m.module)}catch(h){l.log(l.Level.Error,h),l.log(l.Level.Error,`Couldn\'t instantiate Scandit SDK DataCapture library at ${t}, did you configure the path for it correctly?`)}}async function c(){let d;try{d=await Y({wasmURI:t,expectedHash:e,verifyResponseHash:a,onProgress:r,referredOrigin:n});let h=await globalThis.WebAssembly.instantiateStreaming(d,s);i(h.instance,h.module)}catch(h){l.log(l.Level.Warn,h),l.log(l.Level.Warn,"WebAssembly streaming compile failed. Falling back to ArrayBuffer instantiation (this will make things slower)"),o(d?.bodyUsed===!0?void 0:d)}}typeof globalThis.WebAssembly.instantiateStreaming=="function"?c():o()}async function Z(t,e,a,r){return new Promise((i,s)=>{t().then(i).catch(n=>{let o=e*2;if(o>a){s(n);return}r(n),globalThis.setTimeout(()=>{Z(t,o,a,r).then(i).catch(s)},e)})})}function Q(t){var e,a;let r="";if((e=t.href)!=null&&e.startsWith("blob:null/"))r="localhost";else{let i=((a=t.pathname)==null?void 0:a.length)>1&&!t.pathname.startsWith("/");r=new URL(i?t.pathname:t.origin).hostname}return r.startsWith("[")&&r.endsWith("]")&&(r=r.slice(1,-1)),r}async function ue(t,e){async function a(){return importScripts(t)}try{await Z(a,250,4e3,i=>{l.log(l.Level.Warn,i),l.log(l.Level.Warn,`Couldn\'t retrieve Scandit Data Capture library at ${t}, retrying...`)}),self.Module.mainScriptUrlOrBlob=t;let r=globalThis.SDC_WASM_JS_VERSION;return r!==e&&l.log(l.Level.Warn,`The Scandit Data Capture library JS file found at ${t} seems invalid: expected version doesn\'t match (received: ${r}, expected: ${e}). Please ensure the correct Scandit Data Capture file (with correct version) is retrieved.`),!0}catch(r){return l.log(l.Level.Error,r),!1}}function Ve(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 pe(t,e,a){let r=e,i=Ve(r);if(i.result){let n=Je(r);n!=null&&(r=`${i.cdnBaseURL}${n}@${t}/sdc-lib/`)}let s=a.replace(".wasm","");return i.result?{jsURI:`${r}${s}.js`,wasmURI:`${r}${s}.wasm`}:{jsURI:`${r}${s}.js?v=${t}`,wasmURI:`${r}${s}.wasm?v=${t}`}}var L;(t=>{function e(){return"7.2.6"}t.sdkVersion=e})(L||(L={}));var he=class{constructor(){this.promise=new Promise((t,e)=>{this.reject=e,this.resolve=t})}};var Ue=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])),$e=()=>(async t=>{try{return typeof MessageChannel<"u"&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(t)}catch{return!1}})(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]));function je(){return typeof crossOriginIsolated>"u"?!1:crossOriginIsolated}function Ge(){try{return new WebAssembly.Memory({initial:1,maximum:1,shared:!0}).buffer.constructor.name==="SharedArrayBuffer"}catch{return!1}}async function me(){return Ue()}async function qe(){if(!await $e())return!1;let t=null;try{t=new Worker(URL.createObjectURL(new Blob([\'postMessage("Worker" in self);\'],{type:"text/javascript"})),{name:"nestedWorkerTest"})}catch{return!1}return new Promise(e=>{if(t==null){e(!1);return}t.onmessage=a=>{t?.terminate(),e(a.data)}})}async function be(){let t=await qe();return je()&&Ge()&&t}var ge=class fe{constructor(e,a){this.hintPresenterV2=null,this.MAX_NUMBER_OF_IMAGES_IN_FRAME_DATA_POOL=10,this.redrawInterval=1e3/30,this.redrawRequests=[],this._isDrawLoopRunning=!1,this.frameDataPool=new Map,this.lastFrameCounter=-1,this.poorMansBenchmarkLogs=!1,this.writableDataPathStandard="/scandit_sync_folder",this.resourceFilesSubfolder="resources",this.performanceMetricsReporterTimer=void 0,this.performanceMetrics={frameDataPoolSize:0,processedFramesCount:0,redrawRequestsCount:0,actualRedrawsCount:0},this.gestureListener=null,this.webPlatformHintPresenter=null,this.moduleHandler=e,this.workerFunctions=a,this._loadProgressCallback=this._loadProgressCallback.bind(this),ce(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}convertToLoadableFrameData(e){let a=this.getNextFrameId();this.frameDataPool.set(a,new Uint8ClampedArray(e.getFrameData()));let r=this.lastUsedModuleMirrorAxis==null?!1:this.lastUsedModuleMirrorAxis!==this.Module.Axis.None;return{frameId:a,width:e.getWidth(),height:e.getHeight(),isFrameSourceMirrored:r}}createContext(e){var a,r,i,s,n;let o=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,o,e.delayedRegistration,e.highEndBlurryRecognition,this.resourcePath);let d=this.contextDeserializer.contextFromJson(JSON.stringify(e.context));if(d==null){let u=this.contextDeserializer.getLastError();throw new Error(`Could not create the context: ${u}`)}let h=d.getView();this.context=d.getContext(),d.delete();let g=this.Module.DataCaptureContextListener.extend("DataCaptureContextListener",{didChangeStatus:(u,f)=>{this.contextDidChangeStatus(JSON.parse(f.toJson())),u.delete()},didStartObservingContext:u=>{this.didStartObservingContext(),u.delete()},didStopObservingContext:u=>{u.delete()}}),m=this.Module.DataCaptureContextFrameListener.extend("DataCaptureContextFrameListener",{onObservationStarted:u=>{u.delete()},onObservationStopped:u=>{u.delete()},onFrameProcessingStarted:(u,f)=>{this.workerFunctions.postMessage({type:"onFrameProcessingStarted"}),f.delete(),u.delete()},onFrameProcessingFinished:(u,f)=>{this.workerFunctions.postMessage({type:"onFrameProcessingFinished"}),f.delete(),u.delete()},onFrameSkipped:(u,f)=>{this.workerFunctions.postMessage({type:"onFrameSkipped"}),f.delete(),u.delete()}}),b=this.Module.GestureRecognizer.extend("GestureRecognizer",{setGestureListener:(u,f)=>{var O;(O=this.gestureListener)==null||O.delete(),this.gestureListener=u.clone(),u.delete()}});(a=this.gestureRecognizer)==null||a.delete(),this.gestureRecognizer=new b;let v=new g;this.context.addListener(v),v.delete();let w=new m;this.context.addFrameListener(w),w.delete(),this.setView(h),(r=this.view)==null||r.setGestureRecognizer(this.gestureRecognizer);let C=this.Module.PlatformHintPresenter.extend("PlatformHintPresenter",{setHintPresenter:u=>{u.delete()},showToast:u=>{this.workerFunctions.postMessage({type:"showToast",payload:JSON.parse(u)})},hideToast:u=>{this.workerFunctions.postMessage({type:"hideToast",payload:JSON.parse(u)})},showGuidance:u=>{this.workerFunctions.postMessage({type:"showGuidance",payload:JSON.parse(u)})},hideGuidance:u=>{this.workerFunctions.postMessage({type:"hideGuidance",payload:JSON.parse(u)})},startUpdateTimer:u=>{this.workerFunctions.postMessage({type:"startUpdateTimer",payload:{duration:{unit:"ms",value:u}}})},stopUpdateTimer:()=>{this.workerFunctions.postMessage({type:"stopUpdateTimer"})}});(i=this.hintPresenterV2)==null||i.delete(),(s=this.webPlatformHintPresenter)==null||s.delete(),this.webPlatformHintPresenter=new C,this.hintPresenterV2=new this.Module.HintPresenterV2(this.webPlatformHintPresenter),(n=this.view)==null||n.setHintPresenterV2(this.hintPresenterV2)}onTap(e){var a;(a=this.gestureListener)==null||a.onTap(JSON.stringify(e))}hintPresenterV2Update(){var e;(e=this.hintPresenterV2)==null||e.update()}startReportingPerformanceMetrics(){this.performanceMetricsReporterTimer==null&&(this.performanceMetricsReporterTimer=setInterval(()=>{this.reportPerformanceMetrics();for(let e of Object.keys(this.performanceMetrics))this.performanceMetrics[e]=0},1e3))}async reportPerformanceMetrics(){this.workerFunctions.postMessage({type:"performanceMetricsReport",payload:{...this.performanceMetrics}})}deleteFrameData(e){this.frameDataPool.delete(e)}dispose(){var e,a;this.context.dispose(),this.frameDataPool.clear(),this.isDrawLoopRunning=!1,this.lastFrameCounter=-1,(e=this.gestureRecognizer)==null||e.delete(),this.gestureRecognizer=null,(a=this.gestureListener)==null||a.delete(),this.gestureListener=null}flushAnalytics(){this.context.flushAnalytics()}extractCentaurusLicense(e){return{payload:{centaurus:{licenseKey:this.Module.LicenseUtils[fe.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 a;if(this.context==null)return{payload:e,transferables:[e.data.buffer]};let r=e.data,i=e.colorType==="GRAYSCALE"?this.Module.ImageBufferFormat.Grayscale8:this.Module.ImageBufferFormat.Rgba8888,s=this.Module.allocateUint8Array(r.byteLength);return this.Module.HEAPU8.set(r,s),(a=this.imageFrameSource)==null||a.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 a=this.frameDataPool.get(e);return a==null?{payload:{data:null}}:{payload:{data:a},transferables:[a.buffer]}}scheduleRedraw(e,a){this.addRedrawRequest(a),this.isDrawLoopRunning||this.startDrawLoop(e)}sendViewRefreshCommands(e){this.workerFunctions.postMessage({type:"draw",payload:e},[e.buffer])}setFrameSource(e,a){var r;this.lastUsedModuleMirrorAxis=this.mapMirrorAxisOnModule(e),(r=this.imageFrameSource)==null||r.delete(),this.imageFrameSource=new this.Module.ImageBufferFrameSource(this.lastUsedModuleMirrorAxis,a,0),this.context.setFrameSource(this.imageFrameSource)}startDrawLoop(e){this.isDrawLoopRunning=!0;let a=s=>this.redrawRequests.length>0&&this.redrawRequests[0]<=s,r=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(a(s)){r(s),e.draw();let n=e.getDrawCommands();this.sendViewRefreshCommands(new Uint8Array(n))}i()},this.redrawInterval)};i()}updateContext(e){if(this.context!=null&&this.contextDeserializer!=null){e.view!=null&&!e.view.visible&&this.context.flushAnalytics();let a=this.onBeforeUpdateContextHook(e),r=this.contextDeserializer.updateContextFromJson(this.context,this.view,JSON.stringify(a.context));if(r==null){let s=this.contextDeserializer.getLastError();throw new Error(`Could not update the context: ${s}`)}this.context.delete(),this.context=r.getContext();let i=r.getView();r.delete(),i!=null&&a.view!=null&&i.setViewSize(a.view.width,a.view.height,a.view.orientation),this.hintPresenterV2!=null&&i?.setHintPresenterV2(this.hintPresenterV2),this.gestureRecognizer!=null&&i?.setGestureRecognizer(this.gestureRecognizer),this.setView(i),l.debug("context updated",a)}}onBeforeUpdateContextHook(e){return e}onDocumentVisibilityChange(e){e==="hidden"&&this.context.flushAnalytics()}isFeatureSupported(e){return{payload:{supported:this.context.isFeatureSupported(e)}}}getViewfinderInfo(){var e,a;return{payload:{isDisplayingViewfinder:(a=(e=this.view)==null?void 0:e.isDisplayingViewfinder())!=null?a:!1,rect:JSON.parse(this.view.getViewfinderRect())}}}getOpenSourceSoftwareLicenseInfo(){return{payload:{licenseText:this.Module.OpenSourceSoftwareLicenseInfo.getLicenseText()}}}getNextFrameId(){return this.lastFrameCounter++,this.lastFrameCounter>=this.MAX_NUMBER_OF_IMAGES_IN_FRAME_DATA_POOL&&(this.lastFrameCounter=0),this.lastFrameCounter}getWasmDynamicLibraries(e){return this.getWasmSideModuleFileName()==null?[]:[`${e.replace(/\\/[^/]*$/,"/")}${this.getWasmSideModuleFileName()}`]}getWasmCoreExpectedHash(e,a){return a?e?"d9fc493a206cced3bc03706b4edf1b92336c07122ae9f42e74b1dc0b08d2feea":"9f4d07fc0c721fbc43689f313304da12ba1ef7db53f1cfeffd221d1e30ff350f":e?"20f7dcc41a4d3c552bad686cd9a7d08e630888afc4dc47ea22693e74ea7e1634":""}getWasmCoreFileName(e,a){return a?e?"scandit-datacapture-sdk-barcode-simd-pthreads.wasm":"scandit-datacapture-sdk-barcode-pthreads.wasm":e?"scandit-datacapture-sdk-barcode-simd.wasm":""}getWasmMetadata(){return p}getWasmSideModuleFileName(){return""}_loadProgressCallback(e){this.workerFunctions.postMessage({type:"loadLibraryProgress",payload:e})}addRedrawRequest(e){this.redrawRequests.push(Math.round(performance.now())+e),this.redrawRequests.sort((a,r)=>a-r)}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){l.warn("addNativeOverlay has not been implemented for this module",e)}removeNativeOverlay(e){l.warn("removeNativeOverlay has not been implemented for this module",e)}setViewRefreshHandler(e){if(e==null||e.isViewRefreshHandlerSet)return;let a=this.Module.NeedsRedrawDelegate.extend("NeedsRedrawDelegate",{setNeedsRedrawIn:this.scheduleRedraw.bind(this,e)}),r=new a;e.setNeedsRedrawDelegate(r),e.isViewRefreshHandlerSet=!0}setupDataDecoding(){let e=this.moduleHandler.get(),a=e.DataDecoding.extend("DataDecoding",{decode(r,i){try{let s=JSON.parse(i),n=[];for(let o of s){let c=new TextDecoder(o.ianaName,{fatal:!0});n.push(c.decode(r.slice(o.startIndex,o.endIndex)))}return n.join("")}catch{return""}}});e.setDataDecoding(new a)}start(e,a,r){e&&a&&(this.setupDataDecoding(),this.moduleHandler.get().callMain(),this.moduleHandler.get().__emscripten_proxy_main!==void 0||r())}getWritableDataPath(e){return e!=null?(l.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:a,writableDataPathOverride:r,overrideThreadsSupport:i,overrideSimdSupport:s,verifyResponseHash:n,referredOrigin:o,fixedWasmMemory:c}){var d;let h=!1,g=!1;this.writableDataPath=this.getWritableDataPath(r),this.resourcePath=`${e}${this.resourceFilesSubfolder}/`,globalThis.path=a;let{resolve:m,reject:b,promise:v}=new he,w=L.sdkVersion();if(w==="")throw new P({name:"Invalid library version",message:"Library version is not defined or empty, cannot generate proper path to library files."});let[C,u]=await Promise.all([me(),be()]);i!=="auto"&&(u=i==="on"),s!=="auto"&&(C=s==="on");let f=this.getWasmCoreFileName(C,u),O=pe(w,e,f),{jsURI:U,wasmURI:te}=O,Be={instantiateWasm:(S,Pe)=>(le({importObject:S,wasmURI:te,expectedHash:this.getWasmCoreExpectedHash(C,u),verifyResponseHash:n,successCallback:Pe,progressCallback:this._loadProgressCallback,referredOrigin:o}),{})},B=c===null?null:new WebAssembly.Memory({initial:this.numOfMBToPages(c),maximum:this.numOfMBToPages(300),shared:u});return B!==null&&l.log(l.Level.Debug,"Fixed wasmMemory set",B),this.moduleHandler.set({...B?{wasmMemory:B}:{},mainScriptUrlOrBlob:U,canvas:(d=this.workerFunctions.getOffscreenCanvas())!=null?d:{getContext:()=>null},...Be,dynamicLibraries:this.getWasmDynamicLibraries(te),locateFile:S=>e+S,noInitialRun:!0,preRun:[async()=>{try{await se({writableDataPath:this.writableDataPath})}catch(S){if(S.name==="BlockedIndexedDB"){b(S.toString());return}l.log(l.Level.Debug,"No IndexedDB support, some data will not be persisted:",S)}g=!0,this.start(g,h,m)}],onMainComplete:()=>{if([h,g].includes(!1)){l.log(l.Level.Warn,{runtimeLoaded:h,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}m()},onRuntimeInitialized:()=>{h=!0,this.start(g,h,m)},print:S=>{l.log(l.Level.Info,S)}}),await ue(U,w)||b(`Couldn\'t retrieve Scandit Data Capture library at ${U}, did you configure the path for it correctly?`),v}};ge.get3dPartyLicenseKeyMethodName=atob("Z2V0QmxpbmtJZExpY2Vuc2VLZXk=");var D=ge;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 ee=class{constructor(t,e){this.onMessageListener=this.onMessage.bind(this),this.workerSelf=t,this.dataCaptureInstance=new D(e,{postMessage:this.postMessage.bind(this),getOffscreenCanvas:this.getOffscreenCanvas.bind(this)}),ye(t)&&this.listenToMessages()}listenToMessages(){this.workerSelf.addEventListener("message",this.onMessageListener),this.workerSelf.addEventListener("error",t=>{l.log(l.Level.Error,t)}),this.workerSelf.addEventListener("messageerror",t=>{l.log(l.Level.Error,t)})}postMessage(t,e){this.workerSelf.postMessage(t,e??[])}getOffscreenCanvas(){if(typeof this.workerSelf.OffscreenCanvas=="function")return new this.workerSelf.OffscreenCanvas(32,32)}hasPayload(t){return M(t)&&"payload"in t}hasTransferables(t){return M(t)&&Array.isArray(t.transferables)}async respondWith(t,e,a){let r=null,i;try{i=a(),i instanceof Promise&&(i=await i)}catch(n){i=void 0,r=F(n)}let s={type:"workerTaskId",command:t,id:e,payload:this.hasPayload(i)?i.payload:void 0};r!=null&&(s.error=r),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,overrideThreadsSupport:e.overrideThreadsSupport,overrideSimdSupport:e.overrideSimdSupport,verifyResponseHash:e.verifyResponseHash,fixedWasmMemory:e.fixedWasmMemory}))}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,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,()=>{l.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;default:return Se(t.data),!1}return!0}};var ve=(t=>(t.Body="body",t.Footnote="footnote",t))(ve||{}),T=(t=>(t.Start="start",t.Center="center",t.End="end",t))(T||{}),we=(t=>(t.Normal="normal",t.Wider="wider",t.FitText="fitText",t))(we||{}),Ce=(t=>(t.Normal="normal",t.Taller="taller",t))(Ce||{}),Me=(t=>(t.Square="square",t.Rounded="rounded",t))(Me||{}),W=(t=>(t.None="none",t.Check="check",t.ExclamationMark="exclamationMark",t))(W||{}),E=(t=>(t.Top="top",t.AboveViewFinder="aboveViewFinder",t.BelowViewFinder="belowViewFinder",t))(E||{}),Fe=(t=>(t.AboveViewFinder="aboveViewFinder",t.BelowViewFinder="belowViewFinder",t))(Fe||{}),ke=(t=>(t.BlackOnWhite="blackOnWhite",t.WhiteOnBlack="whiteOnBlack",t.Transparent="transparent",t))(ke||{}),x=(t=>(t.Success="success",t.Error="error",t.Warning="warning",t.Info="info",t.Notification="notification",t))(x||{}),De=(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))(De||{});var A=class{constructor(e,a,r){this.trackingListenerSet=!1;this.coreEngine=e,this.Module=a,this.workerFunctions=r,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:(r,i,s)=>{this.barcodeBatchDidUpdateSession(i),r.delete(),i.delete(),s.delete()},onTrackedBarcodeTapped:(r,i)=>{this.onTrackedBarcodeTapped(i),r.delete(),i.delete()}}),a=this.Module.BarcodeBatchDeserializerListener.extend("BarcodeTrackingDeserializerListener",{onModeDeserializationFinished:(r,i,s)=>{this.trackingListenerSet||(i.addListener(new e,1),this.trackingListenerSet=!0),r.delete(),i.delete(),s.delete()},onModeDeserializationStarted(r,i,s){r.delete(),i.delete(),s.delete()},onSettingsDeserializationStarted(r,i,s){r.delete(),i.delete(),s.delete()},onSettingsDeserializationFinished(r,i,s){r.delete(),i.delete(),s.delete()}});this.barcodeBatchDeserializer=new this.Module.BarcodeBatchDeserializer,this.barcodeBatchDeserializer.setListener(new a)}onTrackedBarcodeTapped(e){this.workerFunctions.postMessage({type:"didTapTrackedBarcode",payload:JSON.parse(e.toJson())})}};var R=class{constructor(e,a,r){this.captureListenerSet=!1;this.coreEngine=e,this.Module=a,this.workerFunctions=r,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:(n,o,c)=>{this.barcodeCaptureDidScan(o,c),n.delete(),c.delete(),o.delete()},didUpdateSession:(n,o,c)=>{this.barcodeCaptureDidUpdateSession(o),n.delete(),c.delete(),o.delete()}}),a=this.Module.Feedback.extend("Feedback",{emit:()=>{this.successFeedback()}}),r=new e,i=new a,s=this.Module.BarcodeCaptureDeserializerListener.extend("BarcodeCaptureDeserializerListener",{onModeDeserializationFinished:(n,o,c)=>{o.addListener(r,1),o.setSuccessFeedback(i),n.delete(),o.delete(),c.delete()},onModeDeserializationStarted(n,o,c){n.delete(),o.delete(),c.delete()},onSettingsDeserializationStarted(n,o,c){n.delete(),o.delete(),c.delete()},onSettingsDeserializationFinished(n,o,c){n.delete(),o.delete(),c.delete()}});this.barcodeCaptureDeserializer=new this.Module.BarcodeCaptureDeserializer,this.barcodeCaptureDeserializer.setListener(new s)}successFeedback(){this.workerFunctions.postMessage({type:"successFeedback"})}barcodeCaptureDidScan(e,a){let r=this.coreEngine.convertToLoadableFrameData(a);this.workerFunctions.postMessage({type:"barcodeCaptureDidScan",payload:{session:JSON.parse(e.toJson()),frameData:r}})}};var N=class{constructor(e,a,r){this.barcodeCheck=null;this.coreEngine=e,this.Module=a,this.workerFunctions=r}async forSettings(e){this.barcodeCheck?.delete(),this.barcodeCheck=new this.Module.BarcodeCheck(this.coreEngine.context,JSON.stringify(e));let a=this.Module.BarcodeCheckListener.extend("BarcodeCheckListener",{didUpdateSession:(r,i,s)=>{let n=this.coreEngine.convertToLoadableFrameData(s);this.workerFunctions.postMessage({type:"barcodeCheckDidUpdateSession",payload:{session:JSON.parse(i.toJson()),frameData:n}}),r.delete(),i.delete(),s.delete()}});this.barcodeCheck.addListener(new a,1),this.Module.addBarcodeCheckToContext(this.coreEngine.context,this.barcodeCheck)}start(){this.barcodeCheck?.start()}pause(){this.barcodeCheck?.pause()}stop(){this.barcodeCheck?.stop()}setEnabled(e){this.barcodeCheck?.setEnabled(e)}async removeMode(){this.barcodeCheck!=null&&this.Module.removeBarcodeCheckFromContext(this.coreEngine.context,this.barcodeCheck)}applySettings(e){this.barcodeCheck?.applySettings(JSON.stringify(e))}};function Ke(t){return t.charAt(0).toUpperCase()+t.slice(1)}function xe(t){return t}var H=class{constructor(e,a,r){this.barcodeFind=null;this.basicOverlay=null;this.transparentGuidanceHintStyle={backgroundColor:"00000000",cornerRadius:4,fitToText:!1,isAnimatedToView:!1,textAlignment:T.Center,hintIcon:W.None,hintAnchor:E.AboveViewFinder,hintAnchorOffset:-12,horizontalMargin:0,iconColor:"00000000",lineHeight:-1,maxLines:1,maxWidthFraction:.8,textColor:"ffffffff",textSize:15,textWeight:600};this.customerTransformation=xe;this.coreEngine=e,this.Module=a,this.workerFunctions=r}async forSettings(e){this.barcodeFind?.delete(),this.barcodeFind=new this.Module.BarcodeFind(this.coreEngine.context,JSON.stringify(e));let a=this.Module.Feedback.extend("Feedback",{emit:()=>{this.listUpdatedFeedback()}}),r=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,o,c)=>{let d=this.coreEngine.convertToLoadableFrameData(c);this.workerFunctions.postMessage({type:"barcodeFindDidUpdateSession",payload:{session:JSON.parse(o.toJson()),frameData:d}}),n.delete(),o.delete(),c.delete()},onSearchPaused:n=>{let o=[];for(let c=0;c<n.size();c++)o.push(n.get(c));this.workerFunctions.postMessage({type:"barcodeFindSearchPaused",payload:{foundItems:o}})},onSearchStopped:n=>{let o=[];for(let c=0;c<n.size();c++)o.push(n.get(c));this.workerFunctions.postMessage({type:"barcodeFindSearchStopped",payload:{foundItems:o}})},onSearchStarted:()=>{this.workerFunctions.postMessage({type:"barcodeFindSearchStarted",payload:{}})}});this.barcodeFind.setBarcodeFindTransformer(new i),this.barcodeFind.addListener(new s,1),this.barcodeFind.setItemListUpdatedFeedback(new a),this.barcodeFind.setFeedback(new r),this.Module.addBarcodeFindToContext(this.coreEngine.context,this.barcodeFind)}barcodeFindFeedback(){this.workerFunctions.postMessage({type:"barcodeFindFeedback",payload:{}})}start(){this.barcodeFind?.start()}stop(){this.barcodeFind?.stop()}pause(){this.barcodeFind?.pause()}setEnabled(e){this.barcodeFind?.setEnabled(e)}setItemList(e){this.barcodeFind?.setItemList(JSON.stringify(e))}async removeMode(){this.barcodeFind!=null&&this.Module.removeBarcodeFindFromContext(this.coreEngine.context,this.barcodeFind)}addBasicOverlay(){this.basicOverlay?.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){this.barcodeFind?.applySettings(JSON.stringify(e))}updateBasicOverlay(e){let a=Object.entries(e).filter(([r,i])=>r!=="type");for(let[r,i]of a){let s=`set${Ke(r)}`;this.basicOverlay!=null&&typeof this.basicOverlay[s]=="function"&&i!=null&&this.basicOverlay[s](i)}}setTransformerFunction(e){this.customerTransformation=e??xe}successFeedback(){this.workerFunctions.postMessage({type:"successFeedback"})}listUpdatedFeedback(){this.workerFunctions.postMessage({type:"barcodeFindListUpdatedFeedback",payload:{}})}setToast(e,a){let r=this.coreEngine.hintPresenterV2;e?r?.showToast(JSON.stringify(a)):r?.hideToast(a.tag)}setGuidance(e,a,r){let i={tag:r,text:a,hintStyle:this.transparentGuidanceHintStyle};this.workerFunctions.postMessage({type:e?"showGuidance":"hideGuidance",payload:i})}createWebFindGuidanceHandler(){let e=this.Module.BarcodeFindGuidanceHandler.extend("BarcodeFindGuidanceHandler",{setInitialGuidance:(a,r)=>{this.setGuidance(a,r,"InitialGuidance")},setMoveCloserGuidance:(a,r)=>{this.setGuidance(!1,r,"InitialGuidance"),this.setGuidance(a,r,"MoveCloserGuidance")},setAllItemsFound:(a,r)=>{let i={text:r,toastHintStyle:x.Success,tag:"AllItemsFound"};this.setToast(a,i)},setTapShutterToPause:(a,r)=>{this.setGuidance(!1,r,"InitialGuidance"),this.setGuidance(a,r,"TapShutterToPause")},setTapShutterToResume:(a,r)=>{this.setGuidance(!1,r,"InitialGuidance"),this.setGuidance(a,r,"TapShutterResume")},setItemListUpdated:(a,r)=>{let i={text:r,toastHintStyle:x.Info,tag:"ItemListUpdated"};this.setToast(a,i)}});return new e}};var y=class{constructor(e){this.subscribers=new Set;this.property={key:e,value:null}}addSubscriber(e){this.subscribers.add(e),e.onPropertyChanged?.(this.property)}removeSubscriber(e){this.subscribers.delete(e)}setProperty(e){if(this.property.value!==e.value){this.property={key:this.property.key,value:e.value};for(let a of this.subscribers)a.onPropertyChanged?.(this.property)}}};var Xe={torch_state:new y("torch_state"),scanning_mode:new y("scanning_mode"),sound_enabled:new y("sound_enabled"),haptic_enabled:new y("haptic_enabled"),hand_mode:new y("hand_mode"),session_stop_reason:new y("session_stop_reason"),camera_position:new y("camera_position")},_=class{getBehaviorSubject(e){return Xe[e]}};var z=class{constructor(e,a,r){this.captureListenerSet=!1;this.propertyPushSource=new _;this.coreEngine=e,this.Module=a,this.workerFunctions=r,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,n)=>{this.sparkScanDidScan(s,n),i.delete(),s.delete(),n.delete()},didUpdateSession:(i,s,n)=>{this.sparkScanDidUpdateSession(s),i.delete(),s.delete(),n.delete()}}),a=this.Module.Feedback.extend("Feedback",{emit:()=>{this.successFeedback()}}),r=this.Module.SparkScanDeserializerListener.extend("SparkScanDeserializerListener",{onModeDeserializationFinished:(i,s,n)=>{this.captureListenerSet||(s.addListener(new e,1),s.setSuccessFeedback(new a),s.setPropertyPushSource(this.propertyPushSource),this.captureListenerSet=!0),i.delete(),s.delete(),n.delete()},onModeDeserializationStarted(i,s,n){i.delete(),s.delete(),n.delete()},onSettingsDeserializationStarted(i,s,n){i.delete(),s.delete(),n.delete()},onSettingsDeserializationFinished(i,s,n){i.delete(),s.delete(),n.delete()},onOverlayDeserializationStarted(i,s,n){i.delete(),s.delete(),n.delete()},onOverlayDeserializationFinished:(i,s,n)=>{this.sparkScanOverlay?.delete(),this.sparkScanOverlay=s,i.delete(),n.delete()}});this.sparkScanDeserializer=new this.Module.SparkScanDeserializer,this.sparkScanDeserializer.setListener(new r)}emitErrorFeedback(e){this.sparkScanOverlay?.onErrorFeedbackEmitted(e)}overlayReadyForDraw(){this.sparkScanOverlay?.onReadyForNewData()}analyticsManagerPropertyChanged(e){this.propertyPushSource.getBehaviorSubject(e.key).setProperty(e)}successFeedback(){this.workerFunctions.postMessage({type:"successFeedback"})}sparkScanDidScan(e,a){let r=this.coreEngine.convertToLoadableFrameData(a);this.workerFunctions.postMessage({type:"sparkScanDidScan",payload:{session:JSON.parse(e.toJson()),frameData:r}})}};var V=class extends D{constructor(e,a){super(e,a)}getModeDeserializers(){this.barcodeCaptureMode=new R(this,this.Module,this.workerFunctions),this.barcodeBatchMode=new A(this,this.Module,this.workerFunctions),this.sparkScanMode=new z(this,this.Module,this.workerFunctions),this.barcodeFindMode=new H(this,this.Module,this.workerFunctions),this.barcodeCheckMode=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,a){return a?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,a){return a?e?"d9fc493a206cced3bc03706b4edf1b92336c07122ae9f42e74b1dc0b08d2feea":"9f4d07fc0c721fbc43689f313304da12ba1ef7db53f1cfeffd221d1e30ff350f":e?"20f7dcc41a4d3c552bad686cd9a7d08e630888afc4dc47ea22693e74ea7e1634":"9329a510cba0ee0f79466fca599ef5d67e24b0154cdafdf204a5c249daf1bee5"}getWasmMetadata(){return p}};function Ye(t){return(a=>/^[$A-Z_a-z][\\w$]*\\s*\\(.*\\)\\s*\\{/.test(a)&&!a.startsWith("function"))(t)?`function ${t}`:t}var Ze=["fetch","XMLHttpRequest","eval","Function","self","globalThis","Module","importScripts","this","console","window","document","import","Worker","ServiceWorker"];function Qe(t){return Ze.map(a=>new RegExp(`\\\\b${a}\\\\b`,"g")).some(a=>a.test(t))}function Oe(t){if(t==null)return null;let e=Ye(t);if(Qe(e))throw new Error("Function should be pure. Shouldn\'t introduce side effects, or rely on global scope");let a=`\'use strict\';\n return (${e});`;try{return new Function(a)()}catch{return null}}var J=class extends ee{constructor(e,a){super(e,a),this.dataCaptureInstance=new V(a,{postMessage:this.postMessage.bind(this),getOffscreenCanvas:this.getOffscreenCanvas.bind(this)})}async respondWith(e,a,r){let i=null,s;try{s=r(),s instanceof Promise&&(s=await s)}catch(o){s=void 0,i=F(o)}let n={type:"workerTaskId",command:e,id:a,payload:this.hasPayload(s)?s.payload:void 0};i!=null&&(n.error=i),this.postMessage(n,this.hasTransferables(s)?s.transferables:[])}onMessage(e){switch(e.data.command){case"sparkScanEmitErrorFeedback":{let{data:a}=e;return this.respondWith(a.command,a.id,()=>{this.dataCaptureInstance.sparkScanMode.emitErrorFeedback(a.shouldRemoveBrush)}),!0}case"sparkScanOverlayReadyForDraw":{let{data:a}=e;return this.respondWith(a.command,a.id,()=>{this.dataCaptureInstance.sparkScanMode.overlayReadyForDraw()}),!0}case"sparkScanAnalyticsManagerPropertyChanged":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.sparkScanMode.analyticsManagerPropertyChanged(a.property)}),!0}case"barcodeFindForSettings":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeFindMode.forSettings(a.settings)),!0}case"barcodeFindModeRemove":{let{data:a}=e;return this.respondWith(a.command,a.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:a}=e;return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.setItemList(a.itemList)}),!0}case"barcodeFindSetEnabled":{let{data:a}=e;return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.setEnabled(a.enabled)}),!0}case"barcodeFindApplySettings":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeFindMode.applySettings(a.settings)),!0}case"barcodeFindAddBasicOverlay":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.barcodeFindMode.addBasicOverlay()}),!0}case"barcodeFindRemoveBasicOverlay":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.barcodeFindMode.removeBasicOverlay()}),!0}case"barcodeFindUpdateBasicOverlay":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.barcodeFindMode.updateBasicOverlay(a.jsonOverlay)}),!0}case"barcodeFindSetTransformerFunction":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>{let r=Oe(a.functionAsString);this.dataCaptureInstance.barcodeFindMode.setTransformerFunction(r)}),!0}case"barcodeCheckForSettings":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeCheckMode.forSettings(a.settings)),!0}case"barcodeCheckModeRemove":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeCheckMode.removeMode()),!0}case"barcodeCheckSearchStart":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeCheckMode.start()}),!0;case"barcodeCheckSearchPause":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeCheckMode.pause()}),!0;case"barcodeCheckSearchStop":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeCheckMode.stop()}),!0;case"barcodeCheckSetEnabled":{let{data:a}=e;return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeCheckMode.setEnabled(a.enabled)}),!0}case"barcodeCheckApplySettings":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.barcodeCheckMode.applySettings(a.settings)}),!0}default:return super.onMessage(e)}}};var Qa=new J(globalThis,{get:()=>globalThis.Module,set:t=>{globalThis.Module=t}});function er(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,c)=>{let i=this.workerCommandId++;this.workerTasks.set(i,{resolve:d,reject:c,command:e});let l={...t,command:e,id:i};this.dataCaptureWorker.postMessage(l,a);})}};
|
|
2
2
|
export{o as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$8}from'./chunk-CONYPETL.js';import {c as c$1,b,a as a$9,d}from'./chunk-A2FMQ67Y.js';import {a}from'./chunk-UHJ3O2ZT.js';import {a as a$5}from'./chunk-BBJPGTUG.js';import {a as a$6}from'./chunk-WL3PKWFT.js';import {a as a$a}from'./chunk-5N7ZBGWC.js';import {a as a$c}from'./chunk-Y2XISTOT.js';import {a as a$7}from'./chunk-JKO4EZPZ.js';import {a as a$1}from'./chunk-I53W7VSB.js';import {a as a$2}from'./chunk-6JRMVWQC.js';import {a as a$4}from'./chunk-4XFE7YMP.js';import {a as a$b}from'./chunk-PWPSTL4C.js';import {a as a$3}from'./chunk-SX5JYNR2.js';import {Anchor,DataCaptureView,Point,Size}from'@scandit/web-datacapture-core';import {ScanditHTMLElement}from'@scandit/web-datacapture-core/build/js/private/utils/ScanditHTMLElement.js';import {css}from'@scandit/web-datacapture-core/build/js/private/utils/css.js';import {defineCustomElements}from'@scandit/web-datacapture-core/build/js/private/utils/defineCustomElements.js';import {calculateWidth,calculateHeight}from'@scandit/web-datacapture-core/build/js/private/utils/quadrilateralUtils.js';import {Timeout}from'@scandit/web-datacapture-core/build/js/private/utils/timeout.js';var M={async highlightForBarcode(L,A){let t=a$c.create(L);A(t);}},c=class c extends ScanditHTMLElement{constructor(){super(...arguments);this.torchIconButton=null;this.cameraSwitchButton=null;this.zoomButton=null;this.onTorchButtonClickHandler=this.onTorchButtonClick.bind(this);this.onCameraSwitchButtonHandler=this.onCameraSwitchButtonClick.bind(this);this.onZoomButtonHandler=this.onZoomButtonClick.bind(this);this.onLayoutPointerDownHandler=this.onLayoutPointerDown.bind(this);this.onInfoAnnotationTapHandler=this.onInfoAnnotationTap.bind(this);this.onEdgesIntersectionObserverHandler=this.onEdgesIntersectionObserver.bind(this);this.pendingDeletionTimeout=null;}set shouldShowZoomControl(t){this.zoomButton&&(this.zoomButton.hidden=!t);}get shouldShowZoomControl(){return this.zoomButton===null?!1:!this.zoomButton.hidden}set shouldShowCameraSwitchControl(t){this.cameraSwitchButton&&(this.cameraSwitchButton.hidden=!t);}get shouldShowCameraSwitchControl(){return this.cameraSwitchButton===null?!1:!this.cameraSwitchButton.hidden}set shouldShowTorchControl(t){this.torchIconButton!==null&&(this.torchIconButton.hidden=!t);}get shouldShowTorchControl(){return this.torchIconButton===null?!1:!this.torchIconButton.hidden}set torchControlPosition(t){var e;(e=this.torchIconButton)==null||e.setAttribute("slot",`controls-${t===Anchor.Center?Anchor.TopLeft:t}`);}get torchControlPosition(){var e,o;let t=(o=(e=this.torchIconButton)==null?void 0:e.getAttribute("slot"))!=null?o:"";return t===""?Anchor.TopLeft:t.replace("controls-","")}set zoomControlPosition(t){var e;(e=this.zoomButton)==null||e.setAttribute("slot",`controls-${t===Anchor.Center?Anchor.BottomRight:t}`);}get zoomControlPosition(){var e,o;let t=(o=(e=this.zoomButton)==null?void 0:e.getAttribute("slot"))!=null?o:"";return t===""?Anchor.BottomRight:t.replace("controls-","")}set cameraSwitchControlPosition(t){var e;(e=this.cameraSwitchButton)==null||e.setAttribute("slot",`controls-${t===Anchor.Center?Anchor.TopRight:t}`);}get cameraSwitchControlPosition(){var e,o;let t=(o=(e=this.zoomButton)==null?void 0:e.getAttribute("slot"))!=null?o:"";return t===""?Anchor.TopRight:t.replace("controls-","")}static async createWithSettings(t,e,o,i,n){c.register();let r=document.createElement(c.tag);return r.barcodeCheckViewSettings=i,r.layout=a.create(),r.append(r.layout),a$1(t)?(r.dataCaptureView=t,r.dataCaptureView.containerElement.prepend(r),await t.setContext(e)):(r.dataCaptureView=await DataCaptureView.forContext(e),r.dataCaptureView.connectToElement(t),r.dataCaptureView.containerElement.prepend(r)),r.presenter=new a$2(r,e,o,i,n!=null?n:a$3.createRecommendedCameraSettings()),await r.presenter.prepare(),r}static async create(t,e,o){return c.createWithSettings(t,e,o,new a$4)}static register(){defineCustomElements({[a.tag]:a,[a$5.tag]:a$5,[a$6.tag]:a$6,[a$7.tag]:a$7,[c.tag]:c,[a$8.tag]:a$8});}static createStyleElement(){return css`[data-could-be-deleted=true]{display:none!important}[data-on-foreground=true]{z-index:3}${c.tag}{inset:0;position:absolute;z-index:1}`}async start(){return this.presenter.startSearching()}async stop(){return this.presenter.stopSearching()}async pause(){return this.presenter.pauseSearching()}reset(){this.deletePendingViews(),this.deleteAllViews();}toggleTorchIcon(t){this.torchIconButton!==null&&(this.torchIconButton.state=t);}onTorchButtonClick(){this.presenter.onTorchButtonClicked();}onCameraSwitchButtonClick(){this.presenter.onCameraSwitchButtonClicked();}onZoomButtonClick(){this.presenter.onZoomButtonClicked();}changeZoomButtonIcon(t){this.zoomButton&&(this.zoomButton.zoom=`${t}x`);}isValidIntersectionEntry(t){return t.rootBounds!=null&&!t.target.hidden}edgeObserverLandscapeLogic(t,e){t.direction="horizontal",(!t.anchor||c$1(t.anchor))&&(t.anchor=e.left?"left-center":"right-center"),e.left?t.anchor="left-center":e.right&&(t.anchor="right-center");}edgeObserverPortraitLogic(t,e){let o=e.bottom||e.top,i=e.left||e.right;o?(t.direction="vertical",t.anchor=e.bottom?"bottom-center":"top-center"):i&&(t.anchor!=null&&b(t.direction)&&c$1(t.anchor)?(t.anchor=e.left?"left-center":"right-center",t.direction="horizontal"):t.anchor!=null&&a$9(t.direction)&&d(t.anchor)&&(e.left&&t.anchor==="left-center"||e.right&&t.anchor==="right-center"||(t.anchor="top-center",t.direction="vertical")));}onEdgesIntersectionObserver(t){for(let e of t){let o=e.target;if(!this.isPopoverAnnotation(o)||!this.isValidIntersectionEntry(e))continue;let{boundingClientRect:i,rootBounds:n}=e,r=this.getTouchedEdges(i,n);!!(n!=null&&n.width&&(n!=null&&n.height)&&(n==null?void 0:n.width)>(n==null?void 0:n.height))?this.edgeObserverLandscapeLogic(o,r):this.edgeObserverPortraitLogic(o,r);}}connectedCallback(){this.torchIconButton=a$7.create(),this.torchIconButton.slot=`controls-${this.torchControlPosition}`,this.torchIconButton.hidden=!0,this.torchIconButton.addEventListener("pointerdown",this.onTorchButtonClickHandler),this.cameraSwitchButton=a$5.create(),this.cameraSwitchButton.slot=`controls-${this.cameraSwitchControlPosition}`,this.cameraSwitchButton.hidden=!0,this.cameraSwitchButton.addEventListener("pointerdown",this.onCameraSwitchButtonHandler),this.zoomButton=a$6.create(),this.zoomButton.slot=`controls-${this.zoomControlPosition}`,this.zoomButton.hidden=!0,this.zoomButton.addEventListener("pointerdown",this.onZoomButtonHandler),this.layout.append(this.torchIconButton,this.cameraSwitchButton,this.zoomButton),this.layout.addEventListener("pointerdown",this.onLayoutPointerDownHandler),this.layout.addEventListener("BarcodeCheckInfoAnnotationEventTap",this.onInfoAnnotationTapHandler),this.backdrop=a$8.create(),this.layout.append(this.backdrop),this.edgesObserver=new IntersectionObserver(this.onEdgesIntersectionObserverHandler,{root:this,threshold:[1,.75,.5,.25,0],rootMargin:"0px"}),this.pendingDeletionTimeout=new Timeout(1e3,()=>{this.deletePendingViews();}),this.prepend(c.createStyleElement());}disconnectedCallback(){var t,e,o;this.deleteAllViews(),(t=this.torchIconButton)==null||t.removeEventListener("pointerdown",this.onTorchButtonClickHandler),(e=this.cameraSwitchButton)==null||e.removeEventListener("pointerdown",this.onCameraSwitchButtonHandler),(o=this.zoomButton)==null||o.removeEventListener("pointerdown",this.onZoomButtonHandler),this.layout.removeEventListener("pointerdown",this.onLayoutPointerDownHandler),this.layout.removeEventListener("BarcodeCheckInfoAnnotationEventTap",this.onInfoAnnotationTapHandler),this.edgesObserver.disconnect();}isPopoverAnnotation(t){return t instanceof a$a}areMultiplePopoverAllowed(){for(let t of this.layout.querySelectorAll(`${a$a.tag}`))if(t&&this.isPopoverAnnotation(t)&&t.annotationTrigger==="highlightAndBarcodeScan")return !0;return !1}async onLayoutPointerDown(t){let e=t.target,o=e==null?void 0:e.closest("[data-identifier$='-highlight']"),i=e==null?void 0:e.closest(a$a.tag);if((o==null?void 0:o.dataset.id)!=null){await this.handleHighlightClick(o);return}if((i==null?void 0:i.dataset.id)!=null){await this.handleAnnotationClick(i);return}await this.handleClickOutside();}async handleHighlightClick(t){this.presenter.emitTappedFeedback();let e=this.queryAnnotationByDataIdentifier(t.dataset.identifier.replace("-highlight",""));e&&(e instanceof a$a?await this.handlePopoverHighlightClick(e,t):e.hidden=!e.hidden);}async handlePopoverHighlightClick(t,e){var o;if(!this.areMultiplePopoverAllowed()){let i=this.layout.querySelector(`${a$a.tag}[data-on-foreground="true"]`),n=(o=i==null?void 0:i.dataset.identifier)==null?void 0:o.replace("-annotation","-highlight"),r=this.layout.querySelector(`[data-identifier="${n}"]`);i!=null&&r!=null&&await this.hideBarcodeCheckPopover(i,r,!1);}await this.toggleBarcodeCheckPopover(t,e),this.edgesObserver.unobserve(t),this.edgesObserver.observe(t);}async handleAnnotationClick(t){var i;let e=(i=t.dataset.identifier)==null?void 0:i.replace("-annotation","-highlight"),o=this.layout.querySelector(`[data-identifier="${e}"]`);o&&await this.toggleBarcodeCheckPopover(t,o);}async handleClickOutside(){var i;if(this.areMultiplePopoverAllowed())return;let t=this.layout.querySelector(`${a$a.tag}[data-on-foreground="true"]`);if(!t)return;let e=(i=t.dataset.identifier)==null?void 0:i.replace("-annotation","-highlight"),o=this.layout.querySelector(`[data-identifier="${e}"]`);o&&await this.hideBarcodeCheckPopover(t,o);}onInfoAnnotationTap(){this.presenter.emitTappedFeedback();}async showBarcodeCheckPopover(t,e){t.dataset.onForeground="true",t.hidden=!1,e.dataset.onForeground="true",this.backdrop.open=!0;}async hideBarcodeCheckPopover(t,e,o=!0){t.dataset.onForeground="false",t.hidden=!0,e&&(e.dataset.onForeground="false"),o&&this.hideBackdropIfNoPopovers();}hideBackdropIfNoPopovers(){[...this.layout.querySelectorAll(`${a$a.tag}`)].every(e=>e.hidden)&&(this.backdrop.open=!1);}async toggleBarcodeCheckPopover(t,e){t.hidden?await this.showBarcodeCheckPopover(t,e):await this.hideBarcodeCheckPopover(t,e);}deleteAllViews(){for(let t of this.layout.querySelectorAll("[data-identifier]"))this.edgesObserver.unobserve(t),t.remove();}deletePendingViews(){for(let t of this.layout.querySelectorAll("[data-could-be-deleted='true']"))t.remove();this.hideBackdropIfNoPopovers();}identifierForHighlight(t){return `${t}-highlight`}identifierForAnnotation(t){return `${t}-annotation`}async onHighlightsOrAnnotationForTrackedBarcode(t){var e,o,i;await((o=(e=this.highlightProvider)!=null?e:M)==null?void 0:o.highlightForBarcode(t.barcode,async n=>this.onHighlight(t,n))),await((i=this.annotationProvider)==null?void 0:i.annotationForBarcode(t.barcode,async n=>this.onAnnotation(t,n)));}async onAnnotation(t,e){let o=e,i=a$b(t),n=this.queryAnnotationByDataId(i);if(n)n.dataset.couldBeDeleted="false";else {if(o.dataset.id=i,o.dataset.identifier=this.identifierForAnnotation(t.identifier),o.hidden=!0,this.layout.append(o),this.isPopoverAnnotation(o)){if(o.direction="vertical",o.anchor="top-center",this.edgesObserver.observe(o),this.areMultiplePopoverAllowed()||o.annotationTrigger==="highlightAndBarcodeScan"){let r=this.queryHighlightByDataId(i);if(!r)return;this.showBarcodeCheckPopover(o,r);}}else {let r=o;r.hidden=r.annotationTrigger==="highlightTap";}this.updateAnnotationPosition(t,o);}}async onHighlight(t,e){let o=a$b(t),i=this.queryHighlightByDataId(o);i?i.dataset.couldBeDeleted="false":(e.dataset.id=o,e.dataset.identifier=this.identifierForHighlight(t.identifier),this.updateHighlightPosition(t,e),this.layout.append(e));}queryHighlightByDataIdentifier(t){return this.layout.querySelector(`[data-identifier$="${t}-highlight"]`)}queryAnnotationByDataIdentifier(t){return this.layout.querySelector(`[data-identifier$="${t}-annotation"]`)}queryHighlightByDataId(t){return this.layout.querySelector(`[data-identifier$="-highlight"][data-id="${t}"]`)}queryAnnotationByDataId(t){return this.layout.querySelector(`[data-identifier$="-annotation"][data-id="${t}"]`)}updateRemovedTrackedBarcodes(t){var i,n,r,p,u;let e=this.querySelectorAll("[data-identifier]");if(Object.keys(t.allTrackedBarcodes).length===0){for(let l of e)l.dataset.couldBeDeleted="true";(i=this.pendingDeletionTimeout)!=null&&i.running||(n=this.pendingDeletionTimeout)==null||n.start();return}let o=new Set(t.removedTrackedBarcodes);for(let l of e){let a=(r=l.dataset.identifier)==null?void 0:r.replace("-highlight","").replace("-annotation","");a!=null&&o.has(a)&&(l.dataset.couldBeDeleted="true");}(p=this.pendingDeletionTimeout)!=null&&p.running||(u=this.pendingDeletionTimeout)==null||u.start();}render(t){for(let[e,o]of Object.entries(t.allTrackedBarcodes)){t.addedTrackedBarcodes[e]!=null&&this.onHighlightsOrAnnotationForTrackedBarcode(o);let i=a$b(o),n=this.queryAnnotationByDataId(i),r=this.queryHighlightByDataId(i);r&&(r.type==="rectangle"&&this.updateBrushSize(r,o),this.updateHighlightPosition(o,r)),n&&r&&this.updateAnnotationPosition(o,n,r);}this.updateRemovedTrackedBarcodes(t);}updateHighlightPosition(t,e,o="center"){if(e.hidden)return;let i=this.dataCaptureView.viewAnchorPositionsForFrameAnchorPositions(t.anchorPositions),n=this.normalizedViewPointFromFrameAnchorPositions(i,o);this.setPosition(e,n,{x:-50,y:-50},this.calculateRotationAngle(i.topLeft,i.topRight));}updateBrushSize(t,e){let o=this.dataCaptureView.viewAnchorPositionsForFrameAnchorPositions(e.anchorPositions),i=Math.round(calculateWidth(o)),n=Math.round(calculateHeight(o));t.type==="rectangle"&&(t.width!==i&&(t.width=i),t.height!==n&&(t.height=n));}getTransformOrigin(t){return {"top-center":{x:-50,y:0},"bottom-center":{x:-50,y:-100},"left-center":{x:0,y:-50},"right-center":{x:-100,y:-50}}[t]}calculateAnnotationPosition(t,e,o){var l;let n=t.orderVerticesByPosition(),r=this.normalizedViewPointFromFrameAnchorPositions(t,"center"),u={"bottom-center":()=>{let a=this.normalizedViewPointFromFrameAnchorPositions(n,"topCenter");return new Point(a.x,a.y-7)},"top-center":()=>{let a=this.normalizedViewPointFromFrameAnchorPositions(n,"bottomCenter");return new Point(a.x,a.y+7)},"right-center":()=>{let a=this.normalizedViewPointFromFrameAnchorPositions(n,"centerLeft");return new Point(a.x-7,a.y)},"left-center":()=>{let a=this.normalizedViewPointFromFrameAnchorPositions(n,"centerRight");return new Point(a.x+7,a.y)}}[e]();return (o==null?void 0:o.type)==="circle"&&(l={"bottom-center":new Point(r.x,r.y-7-o.clientHeight/2),"top-center":new Point(r.x,r.y+7+o.clientHeight/2),"right-center":new Point(r.x-7-o.clientWidth/2,r.y),"left-center":new Point(r.x+7+o.clientWidth/2,r.y)}[e])!=null?l:u}updateAnnotationPosition(t,e,o){if(e.hidden)return;let i=this.dataCaptureView.viewAnchorPositionsForFrameAnchorPositions(t.anchorPositions);e.anchor||(e.anchor="top-center");let n=this.getTransformOrigin(e.anchor),r=this.calculateAnnotationPosition(i,e.anchor,o);this.setPosition(e,r,n);}setPosition(t,e,o,i=0){t.style.position="absolute",t.style.willChange="transform",t.style.transform=`translate3d(calc(${Math.round(e.x)}px + ${o.x}%), calc(${Math.round(e.y)}px + ${o.y}%), 0px) rotate(${i}deg)`;}getTouchedEdges(t,e){let o=t.top<=e.top,i=t.bottom>=e.bottom,n=t.left<=e.left,r=t.right>=e.right;return {top:o,bottom:i,left:n,right:r}}normalizedViewPointFromFrameAnchorPositions(t,e="center"){let o=this.presenter.currentCamera.getMirrorImageEnabled(),i=new Size(this.dataCaptureView.width,this.dataCaptureView.height);if(o){let r=t[{centerLeft:"centerRight",centerRight:"centerLeft",center:"center",topCenter:"topCenter",bottomCenter:"bottomCenter"}[e]];return Point.mirrorX(r,i)}return t[e]}calculateRotationAngle(t,e){let o=e.x-t.x,i=-(e.y-t.y),n=Math.atan2(i,o);return Math.round(n*(180/Math.PI))}};c.tag="scandit-barcode-check-view";var E=c;export{E as a};
|
|
1
|
+
import {a as a$5}from'./chunk-BBJPGTUG.js';import {a as a$6}from'./chunk-WL3PKWFT.js';import {c as c$1,b,a as a$9,d}from'./chunk-A2FMQ67Y.js';import {a}from'./chunk-UHJ3O2ZT.js';import {a as a$8}from'./chunk-CONYPETL.js';import {a as a$a}from'./chunk-5N7ZBGWC.js';import {a as a$c}from'./chunk-Y2XISTOT.js';import {a as a$7}from'./chunk-JKO4EZPZ.js';import {a as a$1}from'./chunk-I53W7VSB.js';import {a as a$2}from'./chunk-HFCXXVMI.js';import {a as a$4}from'./chunk-4XFE7YMP.js';import {a as a$b}from'./chunk-PWPSTL4C.js';import {a as a$3}from'./chunk-6W2E6DWG.js';import {Anchor,DataCaptureView,Point,Size}from'@scandit/web-datacapture-core';import {ScanditHTMLElement}from'@scandit/web-datacapture-core/build/js/private/utils/ScanditHTMLElement.js';import {css}from'@scandit/web-datacapture-core/build/js/private/utils/css.js';import {defineCustomElements}from'@scandit/web-datacapture-core/build/js/private/utils/defineCustomElements.js';import {calculateWidth,calculateHeight}from'@scandit/web-datacapture-core/build/js/private/utils/quadrilateralUtils.js';import {Timeout}from'@scandit/web-datacapture-core/build/js/private/utils/timeout.js';var M={async highlightForBarcode(L,A){let t=a$c.create(L);A(t);}},c=class c extends ScanditHTMLElement{constructor(){super(...arguments);this.torchIconButton=null;this.cameraSwitchButton=null;this.zoomButton=null;this.onTorchButtonClickHandler=this.onTorchButtonClick.bind(this);this.onCameraSwitchButtonHandler=this.onCameraSwitchButtonClick.bind(this);this.onZoomButtonHandler=this.onZoomButtonClick.bind(this);this.onLayoutPointerDownHandler=this.onLayoutPointerDown.bind(this);this.onInfoAnnotationTapHandler=this.onInfoAnnotationTap.bind(this);this.onEdgesIntersectionObserverHandler=this.onEdgesIntersectionObserver.bind(this);this.pendingDeletionTimeout=null;}set shouldShowZoomControl(t){this.zoomButton&&(this.zoomButton.hidden=!t);}get shouldShowZoomControl(){return this.zoomButton===null?!1:!this.zoomButton.hidden}set shouldShowCameraSwitchControl(t){this.cameraSwitchButton&&(this.cameraSwitchButton.hidden=!t);}get shouldShowCameraSwitchControl(){return this.cameraSwitchButton===null?!1:!this.cameraSwitchButton.hidden}set shouldShowTorchControl(t){this.torchIconButton!==null&&(this.torchIconButton.hidden=!t);}get shouldShowTorchControl(){return this.torchIconButton===null?!1:!this.torchIconButton.hidden}set torchControlPosition(t){var e;(e=this.torchIconButton)==null||e.setAttribute("slot",`controls-${t===Anchor.Center?Anchor.TopLeft:t}`);}get torchControlPosition(){var e,o;let t=(o=(e=this.torchIconButton)==null?void 0:e.getAttribute("slot"))!=null?o:"";return t===""?Anchor.TopLeft:t.replace("controls-","")}set zoomControlPosition(t){var e;(e=this.zoomButton)==null||e.setAttribute("slot",`controls-${t===Anchor.Center?Anchor.BottomRight:t}`);}get zoomControlPosition(){var e,o;let t=(o=(e=this.zoomButton)==null?void 0:e.getAttribute("slot"))!=null?o:"";return t===""?Anchor.BottomRight:t.replace("controls-","")}set cameraSwitchControlPosition(t){var e;(e=this.cameraSwitchButton)==null||e.setAttribute("slot",`controls-${t===Anchor.Center?Anchor.TopRight:t}`);}get cameraSwitchControlPosition(){var e,o;let t=(o=(e=this.zoomButton)==null?void 0:e.getAttribute("slot"))!=null?o:"";return t===""?Anchor.TopRight:t.replace("controls-","")}static async createWithSettings(t,e,o,i,n){c.register();let r=document.createElement(c.tag);return r.barcodeCheckViewSettings=i,r.layout=a.create(),r.append(r.layout),a$1(t)?(r.dataCaptureView=t,r.dataCaptureView.containerElement.prepend(r),await t.setContext(e)):(r.dataCaptureView=await DataCaptureView.forContext(e),r.dataCaptureView.connectToElement(t),r.dataCaptureView.containerElement.prepend(r)),r.presenter=new a$2(r,e,o,i,n!=null?n:a$3.createRecommendedCameraSettings()),await r.presenter.prepare(),r}static async create(t,e,o){return c.createWithSettings(t,e,o,new a$4)}static register(){defineCustomElements({[a.tag]:a,[a$5.tag]:a$5,[a$6.tag]:a$6,[a$7.tag]:a$7,[c.tag]:c,[a$8.tag]:a$8});}static createStyleElement(){return css`[data-could-be-deleted=true]{display:none!important}[data-on-foreground=true]{z-index:3}${c.tag}{inset:0;position:absolute;z-index:1}`}async start(){return this.presenter.startSearching()}async stop(){return this.presenter.stopSearching()}async pause(){return this.presenter.pauseSearching()}reset(){this.deletePendingViews(),this.deleteAllViews();}toggleTorchIcon(t){this.torchIconButton!==null&&(this.torchIconButton.state=t);}onTorchButtonClick(){this.presenter.onTorchButtonClicked();}onCameraSwitchButtonClick(){this.presenter.onCameraSwitchButtonClicked();}onZoomButtonClick(){this.presenter.onZoomButtonClicked();}changeZoomButtonIcon(t){this.zoomButton&&(this.zoomButton.zoom=`${t}x`);}isValidIntersectionEntry(t){return t.rootBounds!=null&&!t.target.hidden}edgeObserverLandscapeLogic(t,e){t.direction="horizontal",(!t.anchor||c$1(t.anchor))&&(t.anchor=e.left?"left-center":"right-center"),e.left?t.anchor="left-center":e.right&&(t.anchor="right-center");}edgeObserverPortraitLogic(t,e){let o=e.bottom||e.top,i=e.left||e.right;o?(t.direction="vertical",t.anchor=e.bottom?"bottom-center":"top-center"):i&&(t.anchor!=null&&b(t.direction)&&c$1(t.anchor)?(t.anchor=e.left?"left-center":"right-center",t.direction="horizontal"):t.anchor!=null&&a$9(t.direction)&&d(t.anchor)&&(e.left&&t.anchor==="left-center"||e.right&&t.anchor==="right-center"||(t.anchor="top-center",t.direction="vertical")));}onEdgesIntersectionObserver(t){for(let e of t){let o=e.target;if(!this.isPopoverAnnotation(o)||!this.isValidIntersectionEntry(e))continue;let{boundingClientRect:i,rootBounds:n}=e,r=this.getTouchedEdges(i,n);!!(n!=null&&n.width&&(n!=null&&n.height)&&(n==null?void 0:n.width)>(n==null?void 0:n.height))?this.edgeObserverLandscapeLogic(o,r):this.edgeObserverPortraitLogic(o,r);}}connectedCallback(){this.torchIconButton=a$7.create(),this.torchIconButton.slot=`controls-${this.torchControlPosition}`,this.torchIconButton.hidden=!0,this.torchIconButton.addEventListener("pointerdown",this.onTorchButtonClickHandler),this.cameraSwitchButton=a$5.create(),this.cameraSwitchButton.slot=`controls-${this.cameraSwitchControlPosition}`,this.cameraSwitchButton.hidden=!0,this.cameraSwitchButton.addEventListener("pointerdown",this.onCameraSwitchButtonHandler),this.zoomButton=a$6.create(),this.zoomButton.slot=`controls-${this.zoomControlPosition}`,this.zoomButton.hidden=!0,this.zoomButton.addEventListener("pointerdown",this.onZoomButtonHandler),this.layout.append(this.torchIconButton,this.cameraSwitchButton,this.zoomButton),this.layout.addEventListener("pointerdown",this.onLayoutPointerDownHandler),this.layout.addEventListener("BarcodeCheckInfoAnnotationEventTap",this.onInfoAnnotationTapHandler),this.backdrop=a$8.create(),this.layout.append(this.backdrop),this.edgesObserver=new IntersectionObserver(this.onEdgesIntersectionObserverHandler,{root:this,threshold:[1,.75,.5,.25,0],rootMargin:"0px"}),this.pendingDeletionTimeout=new Timeout(1e3,()=>{this.deletePendingViews();}),this.prepend(c.createStyleElement());}disconnectedCallback(){var t,e,o;this.deleteAllViews(),(t=this.torchIconButton)==null||t.removeEventListener("pointerdown",this.onTorchButtonClickHandler),(e=this.cameraSwitchButton)==null||e.removeEventListener("pointerdown",this.onCameraSwitchButtonHandler),(o=this.zoomButton)==null||o.removeEventListener("pointerdown",this.onZoomButtonHandler),this.layout.removeEventListener("pointerdown",this.onLayoutPointerDownHandler),this.layout.removeEventListener("BarcodeCheckInfoAnnotationEventTap",this.onInfoAnnotationTapHandler),this.edgesObserver.disconnect();}isPopoverAnnotation(t){return t instanceof a$a}areMultiplePopoverAllowed(){for(let t of this.layout.querySelectorAll(`${a$a.tag}`))if(t&&this.isPopoverAnnotation(t)&&t.annotationTrigger==="highlightAndBarcodeScan")return !0;return !1}async onLayoutPointerDown(t){let e=t.target,o=e==null?void 0:e.closest("[data-identifier$='-highlight']"),i=e==null?void 0:e.closest(a$a.tag);if((o==null?void 0:o.dataset.id)!=null){await this.handleHighlightClick(o);return}if((i==null?void 0:i.dataset.id)!=null){await this.handleAnnotationClick(i);return}await this.handleClickOutside();}async handleHighlightClick(t){this.presenter.emitTappedFeedback();let e=this.queryAnnotationByDataIdentifier(t.dataset.identifier.replace("-highlight",""));e&&(e instanceof a$a?await this.handlePopoverHighlightClick(e,t):e.hidden=!e.hidden);}async handlePopoverHighlightClick(t,e){var o;if(!this.areMultiplePopoverAllowed()){let i=this.layout.querySelector(`${a$a.tag}[data-on-foreground="true"]`),n=(o=i==null?void 0:i.dataset.identifier)==null?void 0:o.replace("-annotation","-highlight"),r=this.layout.querySelector(`[data-identifier="${n}"]`);i!=null&&r!=null&&await this.hideBarcodeCheckPopover(i,r,!1);}await this.toggleBarcodeCheckPopover(t,e),this.edgesObserver.unobserve(t),this.edgesObserver.observe(t);}async handleAnnotationClick(t){var i;let e=(i=t.dataset.identifier)==null?void 0:i.replace("-annotation","-highlight"),o=this.layout.querySelector(`[data-identifier="${e}"]`);o&&await this.toggleBarcodeCheckPopover(t,o);}async handleClickOutside(){var i;if(this.areMultiplePopoverAllowed())return;let t=this.layout.querySelector(`${a$a.tag}[data-on-foreground="true"]`);if(!t)return;let e=(i=t.dataset.identifier)==null?void 0:i.replace("-annotation","-highlight"),o=this.layout.querySelector(`[data-identifier="${e}"]`);o&&await this.hideBarcodeCheckPopover(t,o);}onInfoAnnotationTap(){this.presenter.emitTappedFeedback();}async showBarcodeCheckPopover(t,e){t.dataset.onForeground="true",t.hidden=!1,e.dataset.onForeground="true",this.backdrop.open=!0;}async hideBarcodeCheckPopover(t,e,o=!0){t.dataset.onForeground="false",t.hidden=!0,e&&(e.dataset.onForeground="false"),o&&this.hideBackdropIfNoPopovers();}hideBackdropIfNoPopovers(){[...this.layout.querySelectorAll(`${a$a.tag}`)].every(e=>e.hidden)&&(this.backdrop.open=!1);}async toggleBarcodeCheckPopover(t,e){t.hidden?await this.showBarcodeCheckPopover(t,e):await this.hideBarcodeCheckPopover(t,e);}deleteAllViews(){for(let t of this.layout.querySelectorAll("[data-identifier]"))this.edgesObserver.unobserve(t),t.remove();}deletePendingViews(){for(let t of this.layout.querySelectorAll("[data-could-be-deleted='true']"))t.remove();this.hideBackdropIfNoPopovers();}identifierForHighlight(t){return `${t}-highlight`}identifierForAnnotation(t){return `${t}-annotation`}async onHighlightsOrAnnotationForTrackedBarcode(t){var e,o,i;await((o=(e=this.highlightProvider)!=null?e:M)==null?void 0:o.highlightForBarcode(t.barcode,async n=>this.onHighlight(t,n))),await((i=this.annotationProvider)==null?void 0:i.annotationForBarcode(t.barcode,async n=>this.onAnnotation(t,n)));}async onAnnotation(t,e){let o=e,i=a$b(t),n=this.queryAnnotationByDataId(i);if(n)n.dataset.couldBeDeleted="false";else {if(o.dataset.id=i,o.dataset.identifier=this.identifierForAnnotation(t.identifier),o.hidden=!0,this.layout.append(o),this.isPopoverAnnotation(o)){if(o.direction="vertical",o.anchor="top-center",this.edgesObserver.observe(o),this.areMultiplePopoverAllowed()||o.annotationTrigger==="highlightAndBarcodeScan"){let r=this.queryHighlightByDataId(i);if(!r)return;this.showBarcodeCheckPopover(o,r);}}else {let r=o;r.hidden=r.annotationTrigger==="highlightTap";}this.updateAnnotationPosition(t,o);}}async onHighlight(t,e){let o=a$b(t),i=this.queryHighlightByDataId(o);i?i.dataset.couldBeDeleted="false":(e.dataset.id=o,e.dataset.identifier=this.identifierForHighlight(t.identifier),this.updateHighlightPosition(t,e),this.layout.append(e));}queryHighlightByDataIdentifier(t){return this.layout.querySelector(`[data-identifier$="${t}-highlight"]`)}queryAnnotationByDataIdentifier(t){return this.layout.querySelector(`[data-identifier$="${t}-annotation"]`)}queryHighlightByDataId(t){return this.layout.querySelector(`[data-identifier$="-highlight"][data-id="${t}"]`)}queryAnnotationByDataId(t){return this.layout.querySelector(`[data-identifier$="-annotation"][data-id="${t}"]`)}updateRemovedTrackedBarcodes(t){var i,n,r,p,u;let e=this.querySelectorAll("[data-identifier]");if(Object.keys(t.allTrackedBarcodes).length===0){for(let l of e)l.dataset.couldBeDeleted="true";(i=this.pendingDeletionTimeout)!=null&&i.running||(n=this.pendingDeletionTimeout)==null||n.start();return}let o=new Set(t.removedTrackedBarcodes);for(let l of e){let a=(r=l.dataset.identifier)==null?void 0:r.replace("-highlight","").replace("-annotation","");a!=null&&o.has(a)&&(l.dataset.couldBeDeleted="true");}(p=this.pendingDeletionTimeout)!=null&&p.running||(u=this.pendingDeletionTimeout)==null||u.start();}render(t){for(let[e,o]of Object.entries(t.allTrackedBarcodes)){t.addedTrackedBarcodes[e]!=null&&this.onHighlightsOrAnnotationForTrackedBarcode(o);let i=a$b(o),n=this.queryAnnotationByDataId(i),r=this.queryHighlightByDataId(i);r&&(r.type==="rectangle"&&this.updateBrushSize(r,o),this.updateHighlightPosition(o,r)),n&&r&&this.updateAnnotationPosition(o,n,r);}this.updateRemovedTrackedBarcodes(t);}updateHighlightPosition(t,e,o="center"){if(e.hidden)return;let i=this.dataCaptureView.viewAnchorPositionsForFrameAnchorPositions(t.anchorPositions),n=this.normalizedViewPointFromFrameAnchorPositions(i,o);this.setPosition(e,n,{x:-50,y:-50},this.calculateRotationAngle(i.topLeft,i.topRight));}updateBrushSize(t,e){let o=this.dataCaptureView.viewAnchorPositionsForFrameAnchorPositions(e.anchorPositions),i=Math.round(calculateWidth(o)),n=Math.round(calculateHeight(o));t.type==="rectangle"&&(t.width!==i&&(t.width=i),t.height!==n&&(t.height=n));}getTransformOrigin(t){return {"top-center":{x:-50,y:0},"bottom-center":{x:-50,y:-100},"left-center":{x:0,y:-50},"right-center":{x:-100,y:-50}}[t]}calculateAnnotationPosition(t,e,o){var l;let n=t.orderVerticesByPosition(),r=this.normalizedViewPointFromFrameAnchorPositions(t,"center"),u={"bottom-center":()=>{let a=this.normalizedViewPointFromFrameAnchorPositions(n,"topCenter");return new Point(a.x,a.y-7)},"top-center":()=>{let a=this.normalizedViewPointFromFrameAnchorPositions(n,"bottomCenter");return new Point(a.x,a.y+7)},"right-center":()=>{let a=this.normalizedViewPointFromFrameAnchorPositions(n,"centerLeft");return new Point(a.x-7,a.y)},"left-center":()=>{let a=this.normalizedViewPointFromFrameAnchorPositions(n,"centerRight");return new Point(a.x+7,a.y)}}[e]();return (o==null?void 0:o.type)==="circle"&&(l={"bottom-center":new Point(r.x,r.y-7-o.clientHeight/2),"top-center":new Point(r.x,r.y+7+o.clientHeight/2),"right-center":new Point(r.x-7-o.clientWidth/2,r.y),"left-center":new Point(r.x+7+o.clientWidth/2,r.y)}[e])!=null?l:u}updateAnnotationPosition(t,e,o){if(e.hidden)return;let i=this.dataCaptureView.viewAnchorPositionsForFrameAnchorPositions(t.anchorPositions);e.anchor||(e.anchor="top-center");let n=this.getTransformOrigin(e.anchor),r=this.calculateAnnotationPosition(i,e.anchor,o);this.setPosition(e,r,n);}setPosition(t,e,o,i=0){t.style.position="absolute",t.style.willChange="transform",t.style.transform=`translate3d(calc(${Math.round(e.x)}px + ${o.x}%), calc(${Math.round(e.y)}px + ${o.y}%), 0px) rotate(${i}deg)`;}getTouchedEdges(t,e){let o=t.top<=e.top,i=t.bottom>=e.bottom,n=t.left<=e.left,r=t.right>=e.right;return {top:o,bottom:i,left:n,right:r}}normalizedViewPointFromFrameAnchorPositions(t,e="center"){let o=this.presenter.currentCamera.getMirrorImageEnabled(),i=new Size(this.dataCaptureView.width,this.dataCaptureView.height);if(o){let r=t[{centerLeft:"centerRight",centerRight:"centerLeft",center:"center",topCenter:"topCenter",bottomCenter:"bottomCenter"}[e]];return Point.mirrorX(r,i)}return t[e]}calculateRotationAngle(t,e){let o=e.x-t.x,i=-(e.y-t.y),n=Math.atan2(i,o);return Math.round(n*(180/Math.PI))}};c.tag="scandit-barcode-check-view";var E=c;export{E as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-GTYLBEUS.js';import {TorchState,isCameraFrameSource,Camera,FrameSourceState,CameraPosition}from'@scandit/web-datacapture-core';var h=class{constructor(e,t,c,n,d){this.torchState=TorchState.Off;this.cameraSupportMap=new Map;this.zoomFactor=1;this.view=e,this.context=t,this.barcodeCheck=c,this.viewSettings=n,this.cameraSettings=d;}get currentCamera(){if(isCameraFrameSource(this.context.frameSource))return this.context.frameSource;throw new Error("The current frame source is not a Camera")}async prepare(){await this.barcodeCheck.setEnabled(!1),this.barcodeCheck.feedback=await a.createWithOptions(!0,!0),this.barcodeCheck.addPrivateListener(this);let e=Camera.atPosition(this.viewSettings.defaultCameraPosition);await this.context.setFrameSource(e),await this.currentCamera.applySettings(this.cameraSettings),await this.currentCamera.switchToDesiredState(FrameSourceState.Standby),this.zoomFactor=this.currentCamera.settings.zoomFactor,this.view.changeZoomButtonIcon(this.zoomFactor);}async dispose(){var e;this.view.deleteAllViews(),await this.context.removeMode(this.barcodeCheck),this.barcodeCheck.removePrivateListener(this),await((e=this.context.frameSource)==null?void 0:e.switchToDesiredState(FrameSourceState.Off));}async startSearching(){var e;this.view.deleteAllViews(),await((e=this.context.frameSource)==null?void 0:e.switchToDesiredState(FrameSourceState.On)),await this.barcodeCheck.setEnabled(!0),await this.barcodeCheck.start();}async stopSearching(){var e;this.view.deleteAllViews(),await((e=this.context.frameSource)==null?void 0:e.switchToDesiredState(FrameSourceState.Off)),await this.barcodeCheck.setEnabled(!1),await this.barcodeCheck.stop();}async pauseSearching(){var e;this.view.deletePendingViews(),await((e=this.context.frameSource)==null?void 0:e.switchToDesiredState(FrameSourceState.Standby)),await this.barcodeCheck.setEnabled(!1),await this.barcodeCheck.pause();}emitTappedFeedback(){this.barcodeCheck.feedback.tapped.emit();}didUpdateSession(e,t){Object.keys(t.addedTrackedBarcodes).length>0&&this.barcodeCheck.feedback.scanned.emit(),this.view.render(t);}async onTorchButtonClicked(){var e,t;this.cameraSupportMap.get(this.currentCamera.label)||this.cameraSupportMap.set(this.currentCamera.label,{torch:await this.currentCamera.isTorchAvailable()}),(t=(e=this.cameraSupportMap.get(this.currentCamera.label))==null?void 0:e.torch)!=null&&t&&(await this.currentCamera.setDesiredTorchState(this.torchState===TorchState.Off?TorchState.On:TorchState.Off),this.torchState=this.torchState===TorchState.Off?TorchState.On:TorchState.Off,this.view.toggleTorchIcon(this.torchState));}async onZoomButtonClicked(){var t;if(!this.currentCamera.isZoomAvailable())return;let e=(t={1:2,2:1}[this.zoomFactor])!=null?t:1;this.currentCamera.settings.zoomFactor=e,await this.currentCamera.applySettings(this.currentCamera.settings),this.zoomFactor=e,this.view.changeZoomButtonIcon(e);}async onCameraSwitchButtonClicked(){let e=this.currentCamera.getCurrentState(),t=Camera.atPosition(this.currentCamera.position===CameraPosition.UserFacing?CameraPosition.WorldFacing:CameraPosition.UserFacing);await this.context.setFrameSource(t),await this.currentCamera.switchToDesiredState(e);}};export{h as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-
|
|
1
|
+
import {a as a$1}from'./chunk-73GO3R7F.js';import {a}from'./chunk-LKZBVQXD.js';import {Localization}from'@scandit/web-datacapture-core';import {normalizeLibraryLocation}from'@scandit/web-datacapture-core/build/js/private/Helper.js';function b(r){return Localization.getInstance().updateIfMissing({...a}),r!=null&&r.libraryLocation&&(r.libraryLocation=normalizeLibraryLocation(r.libraryLocation)),{moduleName:"BarcodeCapture",load:async n=>{var e,o;let a=n;return await a$1.create({...a,libraryLocation:(e=r==null?void 0:r.libraryLocation)!=null?e:a.libraryLocation,highEndBlurryRecognition:(o=r==null?void 0:r.highEndBlurryRecognition)!=null?o:!1})}}}export{b as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {a as a$2}from'./chunk-YH5IBNOK.js';import {a as a$7}from'./chunk-5GGUCEGU.js';import {b as b$1}from'./chunk-DFIOIHPG.js';import {a}from'./chunk-WRTJHOS5.js';import {b}from'./chunk-XY65BTLP.js';import {a as a$6}from'./chunk-QJOHE5A3.js';import {a as a$8}from'./chunk-7J6MRLL2.js';import {a as a$5}from'./chunk-POONUNDO.js';import {b as b$2}from'./chunk-IC4MKVBG.js';import {a as a$1}from'./chunk-JKO4EZPZ.js';import {a as a$3}from'./chunk-I53W7VSB.js';import {a as a$4}from'./chunk-5KVH2XIO.js';import {b as b$3}from'./chunk-2RKBANN2.js';import {Anchor,Localization,DataCaptureView,Size,Point}from'@scandit/web-datacapture-core';import {ShutterButton}from'@scandit/web-datacapture-core/build/js/private/ui/atoms/ShutterButton.js';import {ScanditHTMLElement}from'@scandit/web-datacapture-core/build/js/private/utils/ScanditHTMLElement.js';import {defineCustomElements}from'@scandit/web-datacapture-core/build/js/private/utils/defineCustomElements.js';import {html}from'@scandit/web-datacapture-core/build/js/private/utils/html.js';var d={FinishButton:a$2.tag,ShutterButton:ShutterButton.tag,ProgressBarWithLabel:a.tag,CardListContainer:b$1.tag,TorchIconButton:a$1.tag},c=class c extends ScanditHTMLElement{constructor(){super(...arguments);this.shouldShowCarousel=!0;this.shouldShowPauseButton=!0;this.shouldShowFinishButton=!0;this.shouldShowProgressBar=!0;this.shouldShowTorchControl=!1;this.torchControlPosition=Anchor.TopLeft;this.textForItemListUpdatedWhenPausedHint=null;this.textForItemListUpdatedHint=null;this.textForTapShutterToResumeSearchHint=null;this.textForTapShutterToPauseScreenHint=null;this.textForMoveCloserToBarcodesHint=null;this.textForPointAtBarcodesToSearchHint=null;this.textForAllItemsFoundSuccessfullyHint=null;this.textForCollapseCardsButton=Localization.getInstance().get("barcode.find.view.textForCollapseCardsButton");this.barcodeFindViewUiListener=null;this.shutterButton=null;this.finishButton=null;this.progressBar=null;this.cardList=null;this.onShutterButtonClickedHandler=this.onShutterButtonClicked.bind(this);this.onFinishButtonClickedHandler=this.onFinishButtonClicked.bind(this);this.onTorchButtonClickedHandler=this.onTorchButtonClicked.bind(this);this.torchIconButton=null;this.onDotClickHandler=this.onDotClick.bind(this);}get camera(){return this.presenter.context.frameSource}static async createWithSettings(t,o,i,s,r){let e=document.createElement(c.tag);return e.barcodeFindViewSettings=s,e.layout=b.create(),e.layout.innerHTML=html`
|
|
2
2
|
<${a.tag} slot="progress" value="0" max="1" ${e.shouldShowProgressBar?"":"hidden"}></${a.tag}>
|
|
3
3
|
<${a$1.tag} slot="top-controls-left" ${e.shouldShowTorchControl?"":"hidden"}></${a$1.tag}>
|
|
4
4
|
<${b$1.tag} slot="card-list" hidden text-for-collapse-cards-button=${e.textForCollapseCardsButton}></${b$1.tag}>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var c={"scandit-datacapture-sdk-barcode-pthreads.wasm":{bytes:6915719},"scandit-datacapture-sdk-barcode-simd-pthreads.wasm":{bytes:6827890},"scandit-datacapture-sdk-barcode-simd.wasm":{bytes:6708410},"scandit-datacapture-sdk-barcode.wasm":{bytes:6796715}};export{c as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as BarcodeFindView}from'../chunks/chunk-
|
|
1
|
+
export{a as BarcodeFindView}from'../chunks/chunk-LXF4ZLVS.js';
|
package/build/js/find/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as BarcodeFindSettings}from'../chunks/chunk-TYVQVFM4.js';export{a as BarcodeFindView}from'../chunks/chunk-
|
|
1
|
+
export{a as BarcodeFindSettings}from'../chunks/chunk-TYVQVFM4.js';export{a as BarcodeFindView}from'../chunks/chunk-LXF4ZLVS.js';export{a as BarcodeFind}from'../chunks/chunk-5KVH2XIO.js';export{a as BarcodeFindItem,c as BarcodeFindItemContent,b as BarcodeFindItemSearchOptions}from'../chunks/chunk-HTKUJZG2.js';export{a as BarcodeFindViewSettings}from'../chunks/chunk-4PTIOBXM.js';
|
package/build/js/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{b as BarcodeCheckCircleHighlight,a as BarcodeCheckCircleHighlightPreset}from'./chunks/chunk-L6RFD252.js';export{a as BarcodeCheckStatusIconAnnotation}from'./chunks/chunk-3V5ISRFO.js';export{a as BarcodeStatusIconContainer}from'./chunks/chunk-BDRKVLLV.js';export{a as SparkScanView}from'./chunks/chunk-UC3AH6LP.js';export{a as SparkScanViewSettings}from'./chunks/chunk-BPHHLTR2.js';export{a as SparkScanViewState}from'./chunks/chunk-L6IZLBEM.js';export{a as SparkScanToastSettings}from'./chunks/chunk-BRRT6GC7.js';export{a as SparkScanPreviewBehavior}from'./chunks/chunk-DFK7AQTK.js';export{a as SparkScanScanningBehavior}from'./chunks/chunk-IMYBB4ZA.js';export{a as SparkScanScanningMode,b as SparkScanScanningModeDefault,c as SparkScanScanningModeTarget}from'./chunks/chunk-SZUPDKV5.js';export{a as SparkScanSettings}from'./chunks/chunk-2ZPG257B.js';export{a as SparkScan}from'./chunks/chunk-KYQRFAWX.js';export{a as SparkScanSession}from'./chunks/chunk-QHNNJFNX.js';export{b as SparkScanBarcodeErrorFeedback,a as SparkScanBarcodeFeedback,c as SparkScanBarcodeSuccessFeedback}from'./chunks/chunk-HKWMKBIV.js';export{a as BarcodeFindSettings}from'./chunks/chunk-TYVQVFM4.js';export{a as BarcodeFindView}from'./chunks/chunk-
|
|
1
|
+
export{b as BarcodeCheckCircleHighlight,a as BarcodeCheckCircleHighlightPreset}from'./chunks/chunk-L6RFD252.js';export{a as BarcodeCheckStatusIconAnnotation}from'./chunks/chunk-3V5ISRFO.js';export{a as BarcodeStatusIconContainer}from'./chunks/chunk-BDRKVLLV.js';export{a as SparkScanView}from'./chunks/chunk-UC3AH6LP.js';export{a as SparkScanViewSettings}from'./chunks/chunk-BPHHLTR2.js';export{a as SparkScanViewState}from'./chunks/chunk-L6IZLBEM.js';export{a as SparkScanToastSettings}from'./chunks/chunk-BRRT6GC7.js';export{a as SparkScanPreviewBehavior}from'./chunks/chunk-DFK7AQTK.js';export{a as SparkScanScanningBehavior}from'./chunks/chunk-IMYBB4ZA.js';export{a as SparkScanScanningMode,b as SparkScanScanningModeDefault,c as SparkScanScanningModeTarget}from'./chunks/chunk-SZUPDKV5.js';export{a as SparkScanSettings}from'./chunks/chunk-2ZPG257B.js';export{a as SparkScan}from'./chunks/chunk-KYQRFAWX.js';export{a as SparkScanSession}from'./chunks/chunk-QHNNJFNX.js';export{b as SparkScanBarcodeErrorFeedback,a as SparkScanBarcodeFeedback,c as SparkScanBarcodeSuccessFeedback}from'./chunks/chunk-HKWMKBIV.js';export{a as BarcodeFindSettings}from'./chunks/chunk-TYVQVFM4.js';export{a as BarcodeFindView}from'./chunks/chunk-LXF4ZLVS.js';export{a as BarcodeCheckSettings}from'./chunks/chunk-EISL6ITI.js';export{a as BarcodeCheckView}from'./chunks/chunk-CGV3Y5KD.js';export{a as BarcodeCheckPopoverAnnotation}from'./chunks/chunk-5N7ZBGWC.js';export{a as BarcodeCheckPopoverAnnotationButton}from'./chunks/chunk-65DU26S5.js';export{a as BarcodeCheckRectangleHighlight}from'./chunks/chunk-Y2XISTOT.js';export{d as BarcodeCheckInfoAnnotation,a as BarcodeCheckInfoAnnotationAnchor}from'./chunks/chunk-SN5VMVMZ.js';export{a as BarcodeCheckAnnotationTrigger}from'./chunks/chunk-ILGTNFTI.js';export{a as BarcodeCheckInfoAnnotationBodyComponent}from'./chunks/chunk-HFF47NXN.js';export{a as BarcodeCheckInfoAnnotationFooter}from'./chunks/chunk-5DXIU4KL.js';export{a as BarcodeCheckInfoAnnotationHeader}from'./chunks/chunk-DQW2EMPB.js';export{a as BarcodeCheckViewSettings}from'./chunks/chunk-4XFE7YMP.js';export{a as BarcodeFind}from'./chunks/chunk-5KVH2XIO.js';export{a as BarcodeFindItem,c as BarcodeFindItemContent,b as BarcodeFindItemSearchOptions}from'./chunks/chunk-HTKUJZG2.js';export{a as barcodeCaptureLoader}from'./chunks/chunk-ITIDIB2F.js';export{a as BarcodeCheck}from'./chunks/chunk-6W2E6DWG.js';export{a as BarcodeCheckSession}from'./chunks/chunk-VIFEECK7.js';export{a as BarcodeCheckFeedback}from'./chunks/chunk-GTYLBEUS.js';export{a as TrackedBarcodeView}from'./chunks/chunk-644ETSOC.js';export{b as BarcodeCaptureOverlay,a as BarcodeCaptureOverlayStyle}from'./chunks/chunk-SNJABJAZ.js';export{a as BarcodeCaptureSettings}from'./chunks/chunk-NNMXFRC2.js';export{a as ScanIntention}from'./chunks/chunk-NH3EDXZZ.js';export{a as BarcodeBatch}from'./chunks/chunk-OMY3KC7L.js';export{a as BarcodeBatchAdvancedOverlay}from'./chunks/chunk-QBMLA2J7.js';export{b as BarcodeBatchBasicOverlay,a as BarcodeBatchBasicOverlayStyle}from'./chunks/chunk-R5ROT3AK.js';export{a as BarcodeBatchSession}from'./chunks/chunk-H5VEANGI.js';export{a as TrackedBarcode}from'./chunks/chunk-DORFGC2X.js';export{a as BarcodeBatchSettings}from'./chunks/chunk-I22E7AYH.js';export{a as BarcodeCapture}from'./chunks/chunk-J3I6TRKT.js';export{a as BarcodeCaptureSession}from'./chunks/chunk-FPZJIOQH.js';export{a as LocalizedOnlyBarcode}from'./chunks/chunk-MUX2WWWH.js';export{e as Barcode,c as Checksum,d as CompositeFlag,b as CompositeType,a as Symbology}from'./chunks/chunk-PE6EDL2S.js';export{a as StructuredAppendData}from'./chunks/chunk-IEE5MKEA.js';export{a as EncodingRange}from'./chunks/chunk-J4VFWBJ7.js';export{a as SparkScanMiniPreviewSize}from'./chunks/chunk-MVDPXLVX.js';export{a as BarcodeFindViewSettings}from'./chunks/chunk-4PTIOBXM.js';export{a as SymbologyDescription}from'./chunks/chunk-OEYNGWOX.js';export{a as Range}from'./chunks/chunk-7SWSAHI5.js';export{a as SymbologySettings}from'./chunks/chunk-LBAL6OCN.js';export{a as BarcodeCaptureFeedback}from'./chunks/chunk-WPSMXGDG.js';
|
package/build/js/moduleLoader.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as barcodeCaptureLoader}from'./chunks/chunk-
|
|
1
|
+
export{a as barcodeCaptureLoader}from'./chunks/chunk-ITIDIB2F.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as BarcodeCaptureWorkerManager}from'../chunks/chunk-
|
|
1
|
+
export{a as BarcodeCaptureWorkerManager}from'../chunks/chunk-73GO3R7F.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as WorkerMain}from'../chunks/chunk-
|
|
1
|
+
export{a as WorkerMain}from'../chunks/chunk-4Y54R3BL.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'../chunks/chunk-
|
|
1
|
+
import {a}from'../chunks/chunk-4Y54R3BL.js';new a(globalThis,{get:()=>globalThis.Module,set:e=>{globalThis.Module=e;}});function n(e){}export{n as InlineWorker};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as DataCaptureEngine}from'../chunks/chunk-
|
|
1
|
+
export{a as DataCaptureEngine}from'../chunks/chunk-3PZKMJ4V.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scandit/web-datacapture-barcode",
|
|
3
|
-
"version": "7.2.
|
|
3
|
+
"version": "7.2.6",
|
|
4
4
|
"description": "Scandit Data Capture SDK for the Web",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"test-ci-coverage": "jest --ci --coverage"
|
|
94
94
|
},
|
|
95
95
|
"peerDependencies": {
|
|
96
|
-
"@scandit/web-datacapture-core": "7.2.
|
|
96
|
+
"@scandit/web-datacapture-core": "7.2.6"
|
|
97
97
|
},
|
|
98
98
|
"dependencies": {
|
|
99
99
|
"@types/emscripten": "^1.39.13"
|