@scandit/web-datacapture-barcode 7.2.0-beta.2 → 7.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/js/BarcodeBatchAdvancedOverlay.d.ts +0 -1
- package/build/js/BarcodeBatchAdvancedOverlay.js +1 -1
- package/build/js/PrivateBarcodeBatchAdvancedOverlayListener.d.ts +0 -1
- package/build/js/TrackedBarcodeView.d.ts +0 -2
- package/build/js/TrackedBarcodeView.js +1 -1
- 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-644ETSOC.js +2 -0
- package/build/js/chunks/{chunk-Q75IAMGN.js → chunk-A2JYXIGU.js} +1 -1
- package/build/js/chunks/{chunk-GDK7SUKY.js → chunk-BTRDH2AV.js} +1 -1
- package/build/js/chunks/{chunk-MIZS6KM5.js → chunk-EEWERXCW.js} +1 -1
- package/build/js/chunks/{chunk-3RL3H42R.js → chunk-IQEPXI6U.js} +1 -1
- package/build/js/chunks/{chunk-YXSXALVA.js → chunk-LAWBMRSV.js} +1 -1
- package/build/js/chunks/{chunk-C53ZMSS3.js → chunk-PUMPP7D6.js} +1 -1
- package/build/js/chunks/chunk-QBMLA2J7.js +1 -0
- package/build/js/chunks/chunk-QGAFQZJW.js +2 -0
- package/build/js/chunks/chunk-S2PGFYJU.js +1 -0
- package/build/js/chunks/{chunk-JD32AETQ.js → chunk-TLDFT6RG.js} +1 -1
- package/build/js/find/BarcodeFindView.js +1 -1
- package/build/js/find/index.js +1 -1
- package/build/js/index.d.ts +0 -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-2FBL4IXV.js +0 -1
- package/build/js/chunks/chunk-EVBEQBF5.js +0 -2
- package/build/js/chunks/chunk-EYEU6COK.js +0 -2
- package/build/js/chunks/chunk-W4BE2J2I.js +0 -1
- /package/build/js/chunks/{chunk-PXBSCUOI.js → chunk-7PUNN73L.js} +0 -0
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {a}from'./chunk-EVBEQBF5.js';import {a as a$1}from'./chunk-C52THG7K.js';import {NumberWithUnit,MeasureUnit,PointWithUnit,Anchor}from'@scandit/web-datacapture-core';import {LicensedFeature}from'@scandit/web-datacapture-core/build/js/worker/index.js';import {stripImages}from'@scandit/web-datacapture-core/build/js/private/utils/symbols.js';var p=new NumberWithUnit(0,MeasureUnit.Pixel),b=new PointWithUnit(p,p),_=Anchor.Center,v=class u{constructor(){this.listener=null;this.type="barcodeTrackingAdvanced";this._shouldShowScanAreaGuides=!1;this._viewForBarcode=new Map;this._anchorForBarcode=new Map;this._offsetForBarcode=new Map;this._viewForBarcodeFromListener=new Map;this._anchorForBarcodeFromListener=new Map;this._offsetForBarcodeFromListener=new Map;this._anchorPositions=new Map;this._barcodeForId=new Map;}get shouldShowScanAreaGuides(){return this._shouldShowScanAreaGuides}set shouldShowScanAreaGuides(a){this._shouldShowScanAreaGuides=a,this.barcodeBatch.notifyContext();}static async withBarcodeBatchForView(a$2,r){if(a$2.context){let c=!await a$2.context.isFeatureSupported(LicensedFeature.BarcodeArFull);a[stripImages]=c;}let e=new u;return e.barcodeBatch=a$2,r&&(await r.addOverlay(e),e.view=r,e.privateListener=new a$1(e),a$2.addPrivateListener(e.privateListener),e.view.setDidTapCustomLocationsViewListener({didTapView:c=>{var t,d;let o=e.getTrackedBarcodeForIdentifier(c);o&&((d=(t=e.listener)==null?void 0:t.didTapViewForTrackedBarcode)==null||d.call(t,e,o));}})),e}async setViewForTrackedBarcode(a,r){if(a==null){this._viewForBarcode.set(r.identifier,null);return}let e=await a;e!=null&&this._viewForBarcode.set(r.identifier,e),this.barcodeBatch.isEnabled()||this.update();}setAnchorForTrackedBarcode(a,r){this._anchorForBarcode.set(r.identifier,a),this.barcodeBatch.isEnabled()||this.update();}setOffsetForTrackedBarcode(a,r){this._offsetForBarcode.set(r.identifier,a),this.barcodeBatch.isEnabled()||this.update();}clearTrackedBarcodeViews(){this._viewForBarcode.clear(),this.barcodeBatch.isEnabled()||this.update();}toJSONObject(){return {type:this.type,shouldShowScanAreaGuides:this._shouldShowScanAreaGuides}}getTrackedBarcodeForIdentifier(a){return this._barcodeForId.get(a)}async setViewForTrackedBarcodeFromListener(a,r){if(a==null){this._viewForBarcodeFromListener.set(r.identifier,null);return}let e=await a;e!=null&&this._viewForBarcodeFromListener.set(r.identifier,e);}processRemovedBarcodes(a){for(let r of a){let e=Number.parseInt(r,10);this._viewForBarcode.delete(e),this._anchorForBarcode.delete(e),this._offsetForBarcode.delete(e),this._anchorPositions.delete(e),this._viewForBarcodeFromListener.delete(e),this._anchorForBarcodeFromListener.delete(e),this._offsetForBarcodeFromListener.delete(e);}}processAddedBarcodes(a){var r,e,c,o,t,d,h;for(let i of a){if(this._anchorPositions.set(i.identifier,i.anchorPositions),this._barcodeForId.set(i.identifier,i),!this._viewForBarcodeFromListener.has(i.identifier)){let s=(c=(e=(r=this.listener)==null?void 0:r.viewForTrackedBarcode)==null?void 0:e.call(r,this,i))!=null?c:Promise.resolve(null);this.setViewForTrackedBarcodeFromListener(s,i);}if(!this._offsetForBarcodeFromListener.has(i.identifier)){let s=(t=(o=this.listener)==null?void 0:o.offsetForTrackedBarcode)==null?void 0:t.call(o,this,i);s!=null&&this._offsetForBarcodeFromListener.set(i.identifier,s);}if(!this._anchorForBarcodeFromListener.has(i.identifier)){let s=(h=(d=this.listener)==null?void 0:d.anchorForTrackedBarcode)==null?void 0:h.call(d,this,i);s!=null&&this._anchorForBarcodeFromListener.set(i.identifier,s);}}}processUpdatedTrackedBarcodes(a){for(let r of a)this._anchorPositions.set(r.identifier,r.anchorPositions),this._barcodeForId.set(r.identifier,r);}update(a){var c,o,t,d,h,i;a!=null&&(this.lastSession=a);let r=this.view;if(r===null)return;this.processRemovedBarcodes(this.lastSession.removedTrackedBarcodes),this.processAddedBarcodes(this.lastSession.addedTrackedBarcodes),this.processUpdatedTrackedBarcodes(this.lastSession.updatedTrackedBarcodes);let e={removedIds:this.lastSession.removedTrackedBarcodes,elements:[]};for(let s of Object.keys(this.lastSession.trackedBarcodes)){let n=Number.parseInt(s,10),B=(o=(c=this._viewForBarcode.get(n))!=null?c:this._viewForBarcodeFromListener.get(n))==null?void 0:o.toJSONObject();B!=null&&e.elements.push({view:B,identifier:n,anchor:(d=(t=this._anchorForBarcode.get(n))!=null?t:this._anchorForBarcodeFromListener.get(n))!=null?d:_,offset:(i=(h=this._offsetForBarcode.get(n))!=null?h:this._offsetForBarcodeFromListener.get(n))!=null?i:b,anchorPositions:this._anchorPositions.get(n)});}r.renderCustomLocationsView(e);}};export{v as a};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {Logger,Size}from'@scandit/web-datacapture-core';import {Deferred}from'@scandit/web-datacapture-core/build/js/private/utils/deferred.js';import {stripImagesFromViewAndWarnUser,svgToDataURL,placeholderImage}from'@scandit/web-datacapture-core/build/js/private/utils/replaceImagesInViewUtils.js';import {stripImages}from'@scandit/web-datacapture-core/build/js/private/utils/symbols.js';var m;m=stripImages;var s=class s{constructor(e,t){var a;this.options={scale:(a=t.scale)!=null?a:1,size:t.size},this.data=e;}static async withHTMLElement(e,t){let a=e.cloneNode(!0);return stripImagesFromViewAndWarnUser(s[stripImages],a),s.getEncodedImageData(a).then(({data:i,size:r})=>new s(i,{size:r,...t}))}static async withBase64EncodedData(e,t){let a=new Deferred,i=new Image;i.addEventListener("error",a.reject,{once:!0}),i.src=e,await i.decode();let r=s.getSize(i),o=s[stripImages]?placeholderImage:e;return s[stripImages]&&Logger.warn("Images are not allowed, please contact support@scandit.com if you have any questions."),a.resolve(new s(o,{size:r,...t})),a.promise}static async getEncodedImageData(e){let t=await s.getSVGDataForElement(e);return s.getBase64DataFromDataURL(t)}static getSize(e){let t=document.body.contains(e);t||document.body.append(e);let a=e.getBoundingClientRect();return t||e.remove(),new Size(a.width,a.height)}static async getSVGDataForElement(e){"customElements"in window&&customElements.get(e.tagName.toLowerCase())!==void 0&&await customElements.whenDefined(e.tagName.toLowerCase());let t=s.getSize(e),a="http://www.w3.org/2000/svg",i=document.createElementNS(a,"svg"),r=document.createElementNS(a,"foreignObject");return i.setAttribute("width",`${t.width}`),i.setAttribute("height",`${t.height}`),i.setAttribute("viewBox",`0 0 ${t.width} ${t.height}`),r.setAttribute("width","100%"),r.setAttribute("height","100%"),r.setAttribute("x","0"),r.setAttribute("y","0"),r.setAttribute("externalResourcesRequired","true"),i.append(r),r.append(e),{data:await svgToDataURL(i),size:t}}static getCanvasWithSize(e){let t=document.createElement("canvas");return t.width=e.width,t.height=e.height,t}static async getBase64DataFromDataURL(e){var r;let t=new Deferred,a=new Image;a.addEventListener("error",t.reject,{once:!0}),a.src=e.data,await a.decode();let i=s.getCanvasWithSize(e.size);return (r=i.getContext("2d"))==null||r.drawImage(a,0,0),t.resolve({data:i.toDataURL("image/png",1),size:e.size}),t.promise}toJSONObject(){return {data:this.data,options:{size:this.options.size.toJSONObject(),scale:this.options.scale}}}};s[m]=!0;var d=s;
|
|
2
|
-
export{d as a};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {DataCaptureLoader,Logger}from'@scandit/web-datacapture-core';function n(r){let s=URL.createObjectURL(new Blob(['"use strict";(()=>{var p={"scandit-datacapture-sdk-barcode-pthreads.wasm":{bytes:6909996},"scandit-datacapture-sdk-barcode-simd.wasm":{bytes:6705881},"scandit-datacapture-sdk-barcode-simd-pthreads.wasm":{bytes:6826262},"scandit-datacapture-sdk-barcode.wasm":{bytes:6790067}};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.0-beta.2"}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?"d860c7153ff0f0112e2c19bb5f1917e4ae47847495e553d1ee83152e1960f46d":"3540b150364372f4867c7efc3d294adc2792ecfa68f704daba678e27034b40c5":e?"3f39517245c5970e6dacf7bcddb0d54f3392d9358543575f4a2fd55cec7dbeab":""}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?"d860c7153ff0f0112e2c19bb5f1917e4ae47847495e553d1ee83152e1960f46d":"3540b150364372f4867c7efc3d294adc2792ecfa68f704daba678e27034b40c5":e?"3f39517245c5970e6dacf7bcddb0d54f3392d9358543575f4a2fd55cec7dbeab":"ca4f252049d7645f496937d17a127415941b2efe6012cfe34db66d55fdfff23d"}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
|
-
export{o as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var c={"scandit-datacapture-sdk-barcode-pthreads.wasm":{bytes:6909996},"scandit-datacapture-sdk-barcode-simd.wasm":{bytes:6705881},"scandit-datacapture-sdk-barcode-simd-pthreads.wasm":{bytes:6826262},"scandit-datacapture-sdk-barcode.wasm":{bytes:6790067}};export{c as a};
|
|
File without changes
|