@scandit/web-datacapture-barcode 8.1.1 → 8.1.2
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/ar/BarcodeAr.js +1 -1
- package/build/js/ar/BarcodeArFeedback.js +1 -1
- package/build/js/ar/BarcodeArPresenter.js +1 -1
- package/build/js/ar/BarcodeArView.js +1 -1
- package/build/js/chunks/{chunk-O7VOH3NR.js → chunk-25EMNC65.js} +1 -1
- package/build/js/chunks/{chunk-2OIPG3Z2.js → chunk-2DQ53VCG.js} +1 -1
- package/build/js/chunks/{chunk-KTUEXDD4.js → chunk-ANOP6H73.js} +1 -1
- package/build/js/chunks/{chunk-AJT34L5B.js → chunk-JKXR4NRT.js} +1 -1
- package/build/js/chunks/{chunk-DSAATLKK.js → chunk-KHTSIZ5U.js} +1 -1
- package/build/js/chunks/{chunk-K5PP2E7G.js → chunk-P4XRHNJD.js} +1 -1
- package/build/js/chunks/{chunk-WGXK65I5.js → chunk-PCEKTEBC.js} +1 -1
- package/build/js/chunks/{chunk-C5S6DRA7.js → chunk-QE5OQVRZ.js} +1 -1
- package/build/js/chunks/chunk-QHD4BMNO.js +1 -0
- package/build/js/chunks/{chunk-2PM6DH45.js → chunk-R3MQ2GAV.js} +1 -1
- package/build/js/chunks/{chunk-ZAEKVXRS.js → chunk-RY5EAOW4.js} +1 -1
- package/build/js/chunks/chunk-SG4Z3A7N.js +1 -0
- package/build/js/chunks/{chunk-6627JL5I.js → chunk-T23H6QBZ.js} +1 -1
- package/build/js/chunks/{chunk-273C5UAE.js → chunk-WTX344JI.js} +1 -1
- package/build/js/defaults/Defaults.js +1 -1
- package/build/js/find/BarcodeFind.js +1 -1
- 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/spark/index.js +1 -1
- package/build/js/spark/ui/SparkScanView.js +1 -1
- package/build/js/spark/ui/SparkScanViewMiniPreview.js +1 -1
- package/build/js/spark/ui/SparkScanViewPresenter.d.ts +0 -1
- package/build/js/spark/ui/SparkScanViewPresenter.js +1 -1
- package/build/js/spark/ui/SparkScanViewTriggerButton.js +1 -1
- package/build/js/spark/ui/index.js +1 -1
- package/build/js/worker/BarcodeCaptureWorkerManager.js +1 -1
- package/build/js/worker/WorkerMain.js +1 -1
- package/build/js/worker/barcodeCapture.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-KXWJQ7RS.js +0 -1
- package/build/js/chunks/chunk-NA3MFO4C.js +0 -1
- /package/build/js/chunks/{chunk-CPKZVW3K.js → chunk-JQT2V5S5.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {DataCaptureLoader,Logger}from'@scandit/web-datacapture-core';function i(r){let s=URL.createObjectURL(new Blob(['"use strict";(()=>{var u={"scandit-datacapture-sdk-barcode-simd.wasm":{bytes:7573271},"scandit-datacapture-sdk-barcode-simd-pthreads.wasm":{bytes:7703694},"scandit-datacapture-sdk-barcode-pthreads.wasm":{bytes:7771852},"scandit-datacapture-sdk-barcode.wasm":{bytes:7641767}};function M(t){return typeof t=="object"&&t!=null}function C(t){if(typeof t=="string")return t;if(M(t)){if(typeof t.message=="string")return t.message}else if(typeof(t==null?void 0:t.toString)=="function")return t.toString();return"unknown error"}var c;(t=>{(l=>(l.Debug="debug",l.Info="info",l.Warn="warn",l.Error="error",l.Quiet="quiet"))(t.Level||(t.Level={}));let e=new Map([["debug",1],["info",2],["warn",3],["error",4],["quiet",5]]),a="debug";function r(l){a=l}t.setLevel=r;function i(l,...h){if(!(e.get(a)>e.get(l)))switch(l){case"debug":{console.debug(...h);break}case"info":{console.log(...h);break}case"warn":{console.warn(...h);break}case"error":{console.error(...h);break}}}t.log=i;function s(...l){i("warn",...l)}t.warn=s;function o(...l){i("debug",...l)}t.debug=o;function n(...l){i("info",...l)}t.info=n;function d(...l){i("error",...l)}t.error=d})(c||(c={}));var xe=class{constructor(t){if(typeof t!="function")throw new TypeError("FinalizationRegistry callback must be a function")}register(t,e,a){}unregister(t){return!1}};function ee(t){typeof t.FinalizationRegistry>"u"&&(t.FinalizationRegistry=xe)}var B=class te extends Error{constructor(e){super(e.message),Object.setPrototypeOf(this,te.prototype),this.name=e.name}toString(){return`${this.name}: ${this.message}`}};var x=Promise.resolve(),j=!1,$=!1,k,G={writableDataPath:""};async function ae(t){if(k==null)return;j=!0;let e=new Promise((a,r)=>{setTimeout(()=>{r(new B({name:"BlockedIndexedDB",message:"IndexedDB database is blocked"}))},1500)});try{await Promise.race([new Promise((a,r)=>{k==null||k(t,i=>{if(i!=null){r(i);return}a()})}),e])}finally{j=!1}}async function re(t){return $||(j?($=!0,x=x.then(async()=>($=!1,ae(t)))):x=ae(t)),x}async function ie(t){G=t,k=FS.syncfs,FS.syncfs=((e,a)=>{let r=a,i=()=>{r()},s=o=>{r(o)};re(e).then(i).catch(s)});try{FS.mkdir(G.writableDataPath)}catch(e){if(e.code!=="EEXIST")throw k=void 0,e}return FS.mount(IDBFS,{},G.writableDataPath),re(!0)}var se={};function Pe(t){return[...new Uint8Array(t)].map(e=>{let a=e.toString(16);return a.length===1?`0${a}`:a}).join("")}async function*Ae(t){let e=t.getReader();try{for(;;){let{done:a,value:r}=await e.read();if(a)return;yield r}}finally{e.releaseLock()}}async function Te(t){let e=[],a=0,r=0;for await(let s of Ae(t))e.push(s),a+=s.length;let i=new Uint8Array(a);for(let s of e)i.set(s,r),r+=s.length;return i.buffer}var Oe=(t=>(t.VALID="VALID",t.INVALID="INVALID",t.NOT_VERIFIABLE="NOT_VERIFIABLE",t))(Oe||{});async function Ee(t,e,a){if(typeof crypto.subtle.digest!="function")return c.log(c.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=Pe(i);return e==null?(c.log(c.Level.Warn,"The library hash is not defined or empty, cannot correctly verify integrity."),"NOT_VERIFIABLE"):s===e?(c.log(c.Level.Debug,`Data Capture library WASM integrity found at ${a} has been verified correctly.`),"VALID"):(c.log(c.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 c.log(c.Level.Warn,"Wasm response could not be verified",r),"NOT_VERIFIABLE"}}var q=new Map([["br",4.4],["gzip",2.9],["none",1]]);function Le(t){var e;let a="content-encoding";if(t==null||t.get(a)==null)return q.get("none");let r=new Set(((e=t.get(a))!=null?e:"").split(",").map(i=>i.trim()));for(let[i,s]of q)if(r.has(i))return s;return q.get("none")}function We(t){var e,a;if(t==null)return 0;let r=(e=Le(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 Re(t){let{pathname:e}=new URL(t);for(let[a,r]of Object.entries(se))if(e.endsWith(a))return r.bytes;return 0}function ne(t){se=t}var Ne=(t,e)=>{let a=We(e);return a===0?Re(t):a};function He(t,e,a,{onProgress:r,onError:i,onComplete:s}){if(!e.body)return[e];let o=Ne(t,e.headers),n=0,d=0;if(typeof TransformStream>"u")return c.warn("TransformStream is not supported in this environment. Progress tracking will be disabled."),[e];let[l,h]=a?e.body.tee():[e.body],m=l.pipeThrough(new TransformStream({async transform(g,b){try{n+=g.length,d=Number((n/o*100).toFixed(2)),o>0&&g.length>0&&d<100?r==null||r({percentage:d,loadedBytes:n,privateUri:t}):o===0&&g.length>0&&(r==null||r({percentage:null,loadedBytes:n,privateUri:t})),b.enqueue(g)}catch(w){b.error(w),i==null||i({error:w})}},flush(g){r==null||r({percentage:100,loadedBytes:n,privateUri:t}),s==null||s({percentage:100,loadedBytes:n,privateUri:t}),g.terminate()}}));return[new Response(m,{headers:new Headers(e.headers),status:e.status,statusText:e.statusText}),h]}async function Y({wasmURI:t,expectedHash:e,verifyResponseHash:a,onProgress:r,onComplete:i,onError:s,referredOrigin:o}){let n=await fetch(t,{referrerPolicy:"origin",referrer:o!=null?o:""});if(!n.ok)throw new Error(`HTTP status code is not ok: ${n.status}, ${n.statusText}`);let[d,l]=He(t,n,a,{onProgress:r,onError:s,onComplete:i});return l!=null&&Ee(Te(l),e,t),d}function oe({wasmURI:t,expectedHash:e,verifyResponseHash:a,progressCallback:r,successCallback:i,errorCallback:s,importObject:o,referredOrigin:n}){async function d(h){try{let m=await Y({wasmURI:t,expectedHash:e,verifyResponseHash:a,onProgress:r,referredOrigin:n}),g=await(h!=null?h:m).arrayBuffer(),b=await self.WebAssembly.instantiate(g,o);i(b.instance,b.module)}catch(m){c.log(c.Level.Error,m),c.log(c.Level.Error,`Couldn\'t instantiate Scandit SDK DataCapture library at ${t}, did you configure the path for it correctly?`),s==null||s(m)}}async function l(){let h;try{h=await Y({wasmURI:t,expectedHash:e,verifyResponseHash:a,onProgress:r,referredOrigin:n});let m=await self.WebAssembly.instantiateStreaming(h,o);i(m.instance,m.module)}catch(m){c.log(c.Level.Warn,m),c.log(c.Level.Warn,"WebAssembly streaming compile failed. Falling back to ArrayBuffer instantiation (this will make things slower)"),d((h==null?void 0:h.bodyUsed)===!0?void 0:h)}}typeof self.WebAssembly.instantiateStreaming=="function"?l():d()}async function X(t,e,a,r){return new Promise((i,s)=>{t().then(i).catch(o=>{let n=e*2;if(n>a){s(o);return}r(o),self.setTimeout(()=>{X(t,n,a,r).then(i).catch(s)},e)})})}function K(t){var e,a;let r="unknown";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):(/^(\\d{1,3}\\.){3}\\d{1,3}$/.test(r)&&(r=r.split(".").map(i=>Number.parseInt(i,10).toString()).join(".")),r)}async function de(t,e){async function a(){return importScripts(t)}try{await X(a,250,4e3,i=>{c.log(c.Level.Warn,i),c.log(c.Level.Warn,`Couldn\'t retrieve Scandit Data Capture library at ${t}, retrying...`)}),self.Module.mainScriptUrlOrBlob=t;let r=self.SDC_WASM_JS_VERSION;return r!==e&&c.log(c.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 c.log(c.Level.Error,r),!1}}var P=class{constructor(){this.promise=new Promise((t,e)=>{this.reject=e,this.resolve=t})}};var Z=class{constructor(t,e){this.workerFunctions=t,this.options=e,this.imageIdCounter=0,this.conversions=new Map}convertToJpeg(t,e){let a=this.imageIdCounter++,r=new P;this.conversions.set(a,r);let i=t.toBitmap();return this.workerFunctions.postMessage({type:"convertToJPEG",imageId:a,width:t.getWidth(),height:t.getHeight(),data:i,planes:t.getPlanes(),orientation:e,quality:this.options.quality},Array.from(new Set([i.buffer]))),r.promise}onConvertToJPEGResult(t,e){let a=this.conversions.get(t);a?(a.resolve(e),this.conversions.delete(t)):c.warn(`ImageConverterForwarder: Conversion for imageId ${t} not found in Map`)}};var A=class{constructor(t){this.options=t}get quality(){return this.options.quality}async convertToJpeg(t,e){try{let{width:a,height:r,planes:i}=this.validateAndExtractImageData(t);this.prepareCanvas(a,r);let s=this.processImageData(t,i,a,r);return await this.convertToJpegBytes(s,e)}catch(a){throw c.warn(`Failed to convert image to JPEG: ${a}`),a instanceof Error?a:new Error("Failed to convert image to JPEG")}}validateAndExtractImageData(t){let e=t.getWidth(),a=t.getHeight(),r=t.getPlanes();if(e<=0||a<=0)throw c.warn(`Invalid image dimensions: ${e}x${a}`),new Error(`Invalid image dimensions: ${e}x${a}`);if(!r||r.length===0)throw c.warn("ImageBuffer has no planes"),new Error("ImageBuffer has no planes");return{width:e,height:a,planes:r}}prepareCanvas(t,e){if(!this.ensureCanvas(t,e))throw new Error("Failed to create OffscreenCanvas");if(!this.canvas||!this.context)throw new Error("Canvas or context not properly initialized")}processImageData(t,e,a,r){let i=this.createImageDataFromBuffer(t,e,a,r);if(i===null)throw new Error("Failed to create ImageData");return this.validateImageData(i,a,r),i}validateImageData(t,e,a){var r;if(t.width!==e||t.height!==a)throw c.warn(`ImageData dimensions mismatch: expected ${e}x${a}, got ${t.width}x${t.height}`),new Error("ImageData dimensions mismatch");if(!t.data||t.data.length!==e*a*4)throw c.warn(`ImageData has invalid data length: expected ${e*a*4}, got ${((r=t.data)==null?void 0:r.length)||0}`),new Error("ImageData has invalid data length")}async convertToJpegBytes(t,e){if(!this.context||!this.canvas)throw new Error("Canvas or context not available");try{this.context.putImageData(t,0,0)}catch(s){throw c.warn(`Failed to put image data on canvas: ${s}`),new Error(`Failed to put image data on canvas: ${s}`)}let a=e!==0?this.applyRotation(this.canvas,e):this.canvas,r;try{r=await this.canvasToBlob(a)}catch(s){throw c.warn(`Failed to convert canvas to blob: ${s}`),new Error(`Failed to convert canvas to blob: ${s}`)}if(!r||r.size===0)throw c.warn("Canvas convertToBlob returned empty or null blob"),new Error("Failed to create JPEG blob");let i;try{i=await r.arrayBuffer()}catch(s){throw c.warn(`Failed to get array buffer from blob: ${s}`),new Error(`Failed to get array buffer from blob: ${s}`)}if(!i||i.byteLength===0)throw c.warn("Blob arrayBuffer returned empty or null buffer"),new Error("Failed to get array buffer from blob");return new Uint8Array(i)}ensureCanvas(t,e){try{return(!this.canvas||this.canvas.width!==t||this.canvas.height!==e)&&(this.canvas=this.getNewCanvas(t,e),this.context=this.canvas.getContext("2d")),this.context!==null}catch(a){return c.warn("Failed to create HTMLCanvasElement",a),!1}}createImageDataFromBuffer(t,e,a,r){let i=new Set(e.map(s=>s.channel));try{if(this.isYUVFormat(i)){let n=t.toBitmap();return!n||n.length!==a*r*4?(c.warn(`Invalid bitmap data from toBitmap(): expected ${a*r*4} bytes, got ${(n==null?void 0:n.length)||0}`),null):new ImageData(new Uint8ClampedArray(n),a,r)}if(this.isRGBAFormat(i))return this.createImageDataFromRGBAPlanes(e,a,r);if(this.isRGBFormat(i))return this.createImageDataFromRGBPlanes(e,a,r);if(this.isGrayscaleFormat(i))return this.createImageDataFromGrayscalePlanes(e,a,r);c.warn(`Unknown image format with channels: ${Array.from(i).join(", ")}, falling back to toBitmap()`);let s=t.toBitmap();if(!s||s.length===0)return c.warn("toBitmap() returned empty or null data"),null;let o=s.length/(a*r);return o===4?new ImageData(new Uint8ClampedArray(s),a,r):(c.warn(`Unsupported format: ${o} bytes per pixel`),null)}catch(s){return c.warn(`Failed to create ImageData: ${s}`),null}}isYUVFormat(t){return t.has(0)&&t.has(1)&&t.has(2)}isRGBAFormat(t){return t.has(3)&&t.has(4)&&t.has(5)&&t.has(6)}isRGBFormat(t){return t.has(3)&&t.has(4)&&t.has(5)&&!t.has(6)}isGrayscaleFormat(t){return t.has(0)&&!t.has(1)&&!t.has(2)}createImageDataFromRGBAPlanes(t,e,a){let r=t.find(d=>d.channel===3),i=t.find(d=>d.channel===4),s=t.find(d=>d.channel===5),o=t.find(d=>d.channel===6);if(!r||!i||!s||!o)return c.warn("Missing RGBA planes"),null;let n=new Uint8ClampedArray(e*a*4);for(let d=0;d<a;d++)for(let l=0;l<e;l++){let h=(d*e+l)*4;n[h]=this.getPixelFromPlane(r,l,d),n[h+1]=this.getPixelFromPlane(i,l,d),n[h+2]=this.getPixelFromPlane(s,l,d),n[h+3]=this.getPixelFromPlane(o,l,d)}return new ImageData(n,e,a)}createImageDataFromRGBPlanes(t,e,a){let r=t.find(n=>n.channel===3),i=t.find(n=>n.channel===4),s=t.find(n=>n.channel===5);if(!r||!i||!s)return c.warn("Missing RGB planes"),null;let o=new Uint8ClampedArray(e*a*4);for(let n=0;n<a;n++)for(let d=0;d<e;d++){let l=(n*e+d)*4;o[l]=this.getPixelFromPlane(r,d,n),o[l+1]=this.getPixelFromPlane(i,d,n),o[l+2]=this.getPixelFromPlane(s,d,n),o[l+3]=255}return new ImageData(o,e,a)}createImageDataFromGrayscalePlanes(t,e,a){let r=t.find(s=>s.channel===0);if(!r)return c.warn("Missing Y plane for grayscale"),null;let i=new Uint8ClampedArray(e*a*4);for(let s=0;s<a;s++)for(let o=0;o<e;o++){let n=(s*e+o)*4,d=this.getPixelFromPlane(r,o,s);i[n]=d,i[n+1]=d,i[n+2]=d,i[n+3]=255}return new ImageData(i,e,a)}getPixelFromPlane(t,e,a){let r=Math.floor(e/(t.subsamplingX||1)),i=Math.floor(a/(t.subsamplingY||1)),s=t.rowStride,o=t.pixelStride,n=i*s+r*o,d=t.data;return n<d.length?d[n]:0}applyRotation(t,e){let a=e*Math.PI/180,r=e===90||e===270||e===-90||e===-270,i=r?t.height:t.width,s=r?t.width:t.height,o=this.getNewCanvas(i,s),n=o.getContext("2d");if(!n)throw new Error("Failed to get 2D context for rotated canvas");return n.translate(i/2,s/2),n.rotate(a),n.translate(-t.width/2,-t.height/2),n.drawImage(t,0,0),o}};A.JPEG_IMAGE_MIME_TYPE="image/jpeg";var ce=class extends A{getNewCanvas(t,e){return new OffscreenCanvas(t,e)}canvasToBlob(t){return t.convertToBlob({type:A.JPEG_IMAGE_MIME_TYPE,quality:this.options.quality})}};var T;(t=>{function e(){return"8.1.1"}t.sdkVersion=e})(T||(T={}));function _e(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 ze(t){let e=/@scandit\\/web-datacapture-[a-z]+/i.exec(t);return e?e[0]:null}function le(t,e,a){let r=e,i=_e(r);if(i.result){let o=ze(r);o!=null&&(r=`${i.cdnBaseURL}${o}@${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 ue=class pe{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.lastFrameColorType="RGBA",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),ne(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,{data:new Uint8ClampedArray(e.getFrameData()),colorType:this.lastFrameColorType});let r=this.lastUsedModuleMirrorAxis==null?!1:this.lastUsedModuleMirrorAxis!==this.Module.Axis.None;return{frameId:a,width:e.getWidth(),height:e.getHeight(),isFrameSourceMirrored:r,colorType:this.lastFrameColorType}}createContext(e){var a,r,i,s,o;let n=this.getModeDeserializers(),d=K(location);(d==="localhost"||d==="127.0.0.1")&&navigator.userAgent.includes("Electron")&&e.appName!=null&&(d+=`-${e.appName}`),this.parentDomain=e.parentDomain,this.contextDeserializer=new this.Module.DataCaptureContextDeserializer(this.writableDataPath,e.deviceId,e.context.deviceModelName,d,this.parentDomain,n,e.delayedRegistration,e.highEndBlurryRecognition,this.resourcePath);let l=this.contextDeserializer.contextFromJson(JSON.stringify(e.context));if(l==null){let p=this.contextDeserializer.getLastError();throw new Error(`Could not create the context: ${p}`)}let h=l.getView();this.context=l.getContext(),l.delete();let m=this.Module.DataCaptureContextListener.extend("DataCaptureContextListener",{didChangeStatus:(p,f)=>{this.contextDidChangeStatus(JSON.parse(f.toJson())),p.delete()},didStartObservingContext:p=>{this.didStartObservingContext(),p.delete()},didStopObservingContext:p=>{p.delete()}}),g=this.Module.DataCaptureContextFrameListener.extend("DataCaptureContextFrameListener",{onObservationStarted:p=>{p.delete()},onObservationStopped:p=>{p.delete()},onFrameProcessingStarted:(p,f)=>{this.workerFunctions.postMessage({type:"onFrameProcessingStarted"}),f.delete(),p.delete()},onFrameProcessingFinished:(p,f)=>{this.workerFunctions.postMessage({type:"onFrameProcessingFinished"}),f.delete(),p.delete()},onFrameSkipped:(p,f)=>{this.workerFunctions.postMessage({type:"onFrameSkipped"}),f.delete(),p.delete()}}),b=this.Module.GestureRecognizer.extend("GestureRecognizer",{setGestureListener:(p,f)=>{var F;(F=this.gestureListener)==null||F.delete(),this.gestureListener=p.clone(),p.delete()}});(a=this.gestureRecognizer)==null||a.delete(),this.gestureRecognizer=new b;let w=new m;this.context.addListener(w),w.delete();let v=new g;this.context.addFrameListener(v),v.delete(),this.setView(h),(r=this.view)==null||r.setGestureRecognizer(this.gestureRecognizer);let U=this.Module.PlatformHintPresenter.extend("PlatformHintPresenter",{setHintPresenter:p=>{p.delete()},showToast:p=>{this.workerFunctions.postMessage({type:"showToast",payload:JSON.parse(p)})},hideToast:p=>{this.workerFunctions.postMessage({type:"hideToast",payload:JSON.parse(p)})},showGuidance:p=>{this.workerFunctions.postMessage({type:"showGuidance",payload:JSON.parse(p)})},hideGuidance:p=>{this.workerFunctions.postMessage({type:"hideGuidance",payload:JSON.parse(p)})},startUpdateTimer:p=>{this.workerFunctions.postMessage({type:"startUpdateTimer",payload:{duration:{unit:"ms",value:p}}})},stopUpdateTimer:()=>{this.workerFunctions.postMessage({type:"stopUpdateTimer"})}});(i=this.hintPresenterV2)==null||i.delete(),this.hintPresenterV2=null,(s=this.webPlatformHintPresenter)==null||s.delete(),this.webPlatformHintPresenter=null,this.webPlatformHintPresenter=new U,this.view&&(this.hintPresenterV2=new this.Module.HintPresenterV2(this.webPlatformHintPresenter),(o=this.view)==null||o.setHintPresenterV2(this.hintPresenterV2)),this.webImageConverterInstance=this.getImageConverterInstance({quality:1}),this.Module.ImageConverter.setInstance(this.webImageConverterInstance)}convertToJPEGResult(e,a){this.webImageConverterInstance instanceof Z&&this.webImageConverterInstance.onConvertToJPEGResult(e,a)}getImageConverterInstance(e){return this.workerFunctions.getOffscreenCanvas()!=null?new ce(e):new Z(this.workerFunctions,e)}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,r,i;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,(r=this.hintPresenterV2)==null||r.delete(),this.hintPresenterV2=null,(i=this.webPlatformHintPresenter)==null||i.delete(),this.webPlatformHintPresenter=null}flushAnalytics(){this.context.flushAnalytics()}extractCentaurusLicense(e){return{payload:{centaurus:{licenseKey:this.Module.LicenseUtils[pe.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;this.lastFrameColorType=e.colorType==="GRAYSCALE"?"GRAYSCALE":"RGBA";let 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){var a;let{data:r,colorType:i}=(a=this.frameDataPool.get(e))!=null?a:{data:null,colorType:null};return r==null?{payload:{data:null,colorType:null}}:{payload:{data:r,colorType:i},transferables:[r.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 o=e.getDrawCommands();this.sendViewRefreshCommands(new Uint8Array(o))}i()},this.redrawInterval)};i()}updateContext(e){if(this.context!=null&&this.contextDeserializer!=null){e.view!=null&&!e.view.visible&&this.context.flushAnalytics();let 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&&this.webPlatformHintPresenter&&(this.hintPresenterV2=new this.Module.HintPresenterV2(this.webPlatformHintPresenter)),i!=null&&this.hintPresenterV2&&i.setHintPresenterV2(this.hintPresenterV2),this.gestureRecognizer!=null&&(i==null||i.setGestureRecognizer(this.gestureRecognizer)),this.setView(i),c.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?"830dc2a432f9ed0e9633d2e85adea48784e2c9c65caf2f69111b15efa678467f":"4d2a9d39f458a2fe8850dd0cbfb2b63cf0be5248ea087ee0dfab7fba2925bfc3":e?"bdb001f777adb1eee19cc360422de40f1f6914ccf5ae4eb0c194096a3c8df72a":""}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 u}getWasmSideModuleFileName(){return""}_loadProgressCallback(e){this.workerFunctions.postMessage({type:"loadLibraryProgress",payload:e})}addRedrawRequest(e){this.redrawRequests.push(Math.round(performance.now())+e),this.redrawRequests.sort((a,r)=>a-r)}contextDidChangeStatus(e){e.code===260?e.message=e.message.replace("domain name",`domain name (${K(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){c.warn("addNativeOverlay has not been implemented for this module",e)}removeNativeOverlay(e){c.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),o=[];for(let n of s){let d=new TextDecoder(n.ianaName,{fatal:!0});o.push(d.decode(r.slice(n.startIndex,n.endIndex)))}return o.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?(c.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,verifyResponseHash:i,referredOrigin:s,fixedWasmMemory:o,simdSupport:n,threadsSupport:d}){var l;let h=!1,m=!1;this.writableDataPath=this.getWritableDataPath(r),this.resourcePath=`${e}${this.resourceFilesSubfolder}/`,self.path=a;let{resolve:g,reject:b,promise:w}=new P,v=T.sdkVersion();if(v==="")throw new B({name:"Invalid library version",message:"Library version is not defined or empty, cannot generate proper path to library files."});let U=this.getWasmCoreFileName(n,d),p=le(v,e,U),{jsURI:f,wasmURI:F}=p,ke={instantiateWasm:(y,De)=>(oe({importObject:y,wasmURI:F,expectedHash:this.getWasmCoreExpectedHash(n,d),verifyResponseHash:i,successCallback:De,progressCallback:this._loadProgressCallback,errorCallback:Ie=>{b(Ie)},referredOrigin:s}),{})},I=o===null?null:new WebAssembly.Memory({initial:this.numOfMBToPages(o),maximum:this.numOfMBToPages(300),shared:d});return I!==null&&c.log(c.Level.Debug,"Fixed wasmMemory set",I),this.moduleHandler.set({...I?{wasmMemory:I}:{},mainScriptUrlOrBlob:f,canvas:(l=this.workerFunctions.getOffscreenCanvas())!=null?l:{getContext:()=>null},...ke,dynamicLibraries:this.getWasmDynamicLibraries(F),locateFile:y=>e+y,noInitialRun:!0,preRun:[async()=>{try{await ie({writableDataPath:this.writableDataPath})}catch(y){if(y.name==="BlockedIndexedDB"){b(y.toString());return}c.log(c.Level.Debug,"No IndexedDB support, some data will not be persisted:",y)}m=!0,this.start(m,h,g)}],onMainComplete:()=>{if([h,m].includes(!1)){c.log(c.Level.Warn,{runtimeLoaded:h,fileSystemSynced:m},"Both runtimeLoaded and fileSystemSynced should be true when calling onMainComplete"),b("onMainComplete has been called but runtime or file system was not ready.");return}g()},onRuntimeInitialized:()=>{h=!0,this.start(m,h,g)},print:y=>{c.log(c.Level.Info,y)}}),await de(f,v)||b(`Couldn\'t retrieve Scandit Data Capture library at ${f}, did you configure the path for it correctly?`),w}};ue.get3dPartyLicenseKeyMethodName=atob("Z2V0QmxpbmtJZExpY2Vuc2VLZXk=");var D=ue;function he(t){return typeof t=="object"&&t!=null&&t.document==null&&"addEventListener"in t&&typeof t.importScripts=="function"}function me(t){console.warn("Reached unexpected case",t)}var Q=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)}),he(t)&&(ee(t),this.listenToMessages())}listenToMessages(){this.workerSelf.addEventListener("message",this.onMessageListener),this.workerSelf.addEventListener("error",t=>{c.log(c.Level.Error,t)}),this.workerSelf.addEventListener("messageerror",t=>{c.log(c.Level.Error,t)})}postMessage(t,e){this.workerSelf.postMessage(t,e!=null?e:[])}getOffscreenCanvas(){if(this.isOffscreenCanvasSupported())return new this.workerSelf.OffscreenCanvas(32,32)}isOffscreenCanvasSupported(){return typeof this.workerSelf.OffscreenCanvas=="function"}hasPayload(t){return 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(o){i=void 0,r=C(o)}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,threadsSupport:e.threadsSupport,simdSupport:e.simdSupport,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,()=>{c.setLevel(e.level)})}break}case"extractCentaurusLicense":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.extractCentaurusLicense(e.licenseKey))}break}case"documentVisibility":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>{this.dataCaptureInstance.onDocumentVisibilityChange(e.state)})}break}case"isFeatureSupported":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.isFeatureSupported(e.feature))}break}case"getViewfinderInfo":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.getViewfinderInfo())}break}case"getOpenSourceSoftwareLicenseInfo":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.getOpenSourceSoftwareLicenseInfo())}break}case"addNativeOverlay":this.dataCaptureInstance.addNativeOverlay(t);break;case"removeNativeOverlay":this.dataCaptureInstance.removeNativeOverlay(t);break;case"convertToJPEGResult":{{let{data:e}=t;this.dataCaptureInstance.convertToJPEGResult(e.imageId,e.result)}break}default:return me(t.data),!1}return!0}};var ge=(t=>(t.Body="body",t.Footnote="footnote",t))(ge||{}),O=(t=>(t.Start="start",t.Center="center",t.End="end",t))(O||{}),be=(t=>(t.Normal="normal",t.Wider="wider",t.FitText="fitText",t))(be||{}),fe=(t=>(t.Normal="normal",t.Taller="taller",t))(fe||{}),ye=(t=>(t.Square="square",t.Rounded="rounded",t))(ye||{}),E=(t=>(t.None="none",t.Check="check",t.ExclamationMark="exclamationMark",t))(E||{}),L=(t=>(t.Top="top",t.AboveViewFinder="aboveViewFinder",t.BelowViewFinder="belowViewFinder",t))(L||{}),Se=(t=>(t.AboveViewFinder="aboveViewFinder",t.BelowViewFinder="belowViewFinder",t))(Se||{}),we=(t=>(t.BlackOnWhite="blackOnWhite",t.WhiteOnBlack="whiteOnBlack",t.Transparent="transparent",t))(we||{}),ve=(t=>(t.Success="success",t.Error="error",t.Warning="warning",t.Info="info",t.Notification="notification",t))(ve||{}),Fe=(t=>(t[t.Ocr=0]="Ocr",t[t.HideLogo=1]="HideLogo",t[t.ShowTestLicenseMessage=2]="ShowTestLicenseMessage",t[t.AugmentedReality=5]="AugmentedReality",t[t.ActivityPingStatsAddon=8]="ActivityPingStatsAddon",t[t.ActivityPing=9]="ActivityPing",t[t.Registration=10]="Registration",t[t.Parser=11]="Parser",t[t.BarcodeCapture=14]="BarcodeCapture",t[t.Analytics=17]="Analytics",t[t.AnalyticsBatchMode=18]="AnalyticsBatchMode",t[t.AnalyticsScanContent=19]="AnalyticsScanContent",t[t.AnalyticsOnlineVerification=20]="AnalyticsOnlineVerification",t[t.SparkScan=21]="SparkScan",t[t.AamvaIdBarcodeVerification=22]="AamvaIdBarcodeVerification",t[t.MappingForTracking=23]="MappingForTracking",t[t.BarcodeFind=24]="BarcodeFind",t[t.MandatoryRegistration=25]="MandatoryRegistration",t[t.FeatureTracking=26]="FeatureTracking",t[t.IdCaptureViz=27]="IdCaptureViz",t[t.IdCaptureMrz=28]="IdCaptureMrz",t[t.IdCaptureBarcode=29]="IdCaptureBarcode",t[t.BarcodeSelectionAimToScan=30]="BarcodeSelectionAimToScan",t[t.BarcodeSelectionTapToScan=31]="BarcodeSelectionTapToScan",t[t.BarcodeCount=32]="BarcodeCount",t[t.BarcodePick=33]="BarcodePick",t[t.IdVerificationDataComparison=34]="IdVerificationDataComparison",t[t.SmartLabelBarcode=35]="SmartLabelBarcode",t[t.SmartLabelText=36]="SmartLabelText",t[t.VoidedIdDetection=37]="VoidedIdDetection",t[t.BarcodeArFull=38]="BarcodeArFull",t[t.BarcodeSequence=39]="BarcodeSequence",t))(Fe||{});var W=class{constructor(e,a,r){this.barcodeAr=null;this.coreEngine=e,this.Module=a,this.workerFunctions=r}async forSettings(e){var r;(r=this.barcodeAr)==null||r.delete(),this.barcodeAr=new this.Module.BarcodeAr(this.coreEngine.context,JSON.stringify(e));let a=this.Module.BarcodeArListener.extend("BarcodeArListener",{didUpdateSession:(i,s,o)=>{let n=this.coreEngine.convertToLoadableFrameData(o);this.workerFunctions.postMessage({type:"barcodeArDidUpdateSession",payload:{session:JSON.parse(s.toJson()),frameData:n}}),i.delete(),s.delete(),o.delete()}});this.barcodeAr.addListener(new a,1),this.Module.addBarcodeArToContext(this.coreEngine.context,this.barcodeAr)}start(){var e;(e=this.barcodeAr)==null||e.start()}pause(){var e;(e=this.barcodeAr)==null||e.pause()}stop(){var e;(e=this.barcodeAr)==null||e.stop()}setEnabled(e){var a;(a=this.barcodeAr)==null||a.setEnabled(e)}async removeMode(){this.barcodeAr!=null&&this.Module.removeBarcodeArFromContext(this.coreEngine.context,this.barcodeAr)}applySettings(e){var a;(a=this.barcodeAr)==null||a.applySettings(JSON.stringify(e))}};var R=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 N=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:(o,n,d)=>{this.barcodeCaptureDidScan(n,d),o.delete(),d.delete(),n.delete()},didUpdateSession:(o,n,d)=>{this.barcodeCaptureDidUpdateSession(n),o.delete(),d.delete(),n.delete()}}),a=this.Module.Feedback.extend("Feedback",{emit:()=>{this.successFeedback()}}),r=new e,i=new a,s=this.Module.BarcodeCaptureDeserializerListener.extend("BarcodeCaptureDeserializerListener",{onModeDeserializationFinished:(o,n,d)=>{n.addListener(r,1),n.setSuccessFeedback(i),o.delete(),n.delete(),d.delete()},onModeDeserializationStarted(o,n,d){o.delete(),n.delete(),d.delete()},onSettingsDeserializationStarted(o,n,d){o.delete(),n.delete(),d.delete()},onSettingsDeserializationFinished(o,n,d){o.delete(),n.delete(),d.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}})}};function Je(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Me(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:O.Center,hintIcon:E.None,hintAnchor:L.AboveViewFinder,hintAnchorOffset:-12,horizontalMargin:0,iconColor:"00000000",lineHeight:-1,maxLines:1,maxWidthFraction:.8,textColor:"ffffffff",textSize:15,textWeight:600};this.customerTransformation=Me;this.coreEngine=e,this.Module=a,this.workerFunctions=r}async forSettings(e){var o;(o=this.barcodeFind)==null||o.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,d,l)=>{let h=this.coreEngine.convertToLoadableFrameData(l);this.workerFunctions.postMessage({type:"barcodeFindDidUpdateSession",payload:{session:JSON.parse(d.toJson()),frameData:h}}),n.delete(),d.delete(),l.delete()},onSearchPaused:n=>{let d=[];for(let l=0;l<n.size();l++)d.push(n.get(l));this.workerFunctions.postMessage({type:"barcodeFindSearchPaused",payload:{foundItems:d}})},onSearchStopped:n=>{let d=[];for(let l=0;l<n.size();l++)d.push(n.get(l));this.workerFunctions.postMessage({type:"barcodeFindSearchStopped",payload:{foundItems:d}})},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(){var e;(e=this.barcodeFind)==null||e.start()}stop(){var e;(e=this.barcodeFind)==null||e.stop()}pause(){var e;(e=this.barcodeFind)==null||e.pause()}setEnabled(e){var a;(a=this.barcodeFind)==null||a.setEnabled(e)}setItemList(e){var a;(a=this.barcodeFind)==null||a.setItemList(JSON.stringify(e))}async removeMode(){this.barcodeFind!=null&&this.Module.removeBarcodeFindFromContext(this.coreEngine.context,this.barcodeFind)}addBasicOverlay(){var e;(e=this.basicOverlay)==null||e.delete(),this.basicOverlay=null,this.barcodeFind!=null&&(this.basicOverlay=new this.Module.BarcodeFindBasicOverlay(this.barcodeFind)),this.coreEngine.view!=null&&this.basicOverlay!=null&&(this.basicOverlay.setGuidanceHandler(this.createWebFindGuidanceHandler()),this.Module.addBarcodeFindBasicOverlayToView(this.coreEngine.view,this.basicOverlay))}removeBasicOverlay(){this.coreEngine.view!=null&&this.basicOverlay!=null&&this.Module.removeBarcodeFindBasicOverlayFromView(this.coreEngine.view,this.basicOverlay)}async applySettings(e){var a;(a=this.barcodeFind)==null||a.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${Je(r)}`;this.basicOverlay!=null&&typeof this.basicOverlay[s]=="function"&&i!=null&&this.basicOverlay[s](i)}}setTransformerFunction(e){this.customerTransformation=e!=null?e:Me}successFeedback(){this.workerFunctions.postMessage({type:"successFeedback"})}listUpdatedFeedback(){this.workerFunctions.postMessage({type:"barcodeFindListUpdatedFeedback",payload:{}})}setToast(e,a){let r=this.coreEngine.hintPresenterV2;e?r==null||r.showToast(JSON.stringify(a)):r==null||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")},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")}});return new e}};var S=class{constructor(e){this.subscribers=new Set;this.property={key:e,value:null}}addSubscriber(e){var a;this.subscribers.add(e),(a=e.onPropertyChanged)==null||a.call(e,this.property)}removeSubscriber(e){this.subscribers.delete(e)}setProperty(e){var a;if(this.property.value!==e.value){this.property={key:this.property.key,value:e.value};for(let r of this.subscribers)(a=r.onPropertyChanged)==null||a.call(r,this.property)}}};var Ve={torch_state:new S("torch_state"),scanning_mode:new S("scanning_mode"),sound_enabled:new S("sound_enabled"),haptic_enabled:new S("haptic_enabled"),session_stop_reason:new S("session_stop_reason"),camera_position:new S("camera_position")},_=class{getBehaviorSubject(e){return Ve[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,o)=>{this.sparkScanDidScan(s,o),i.delete(),s.delete(),o.delete()},didUpdateSession:(i,s,o)=>{this.sparkScanDidUpdateSession(s),i.delete(),s.delete(),o.delete()}}),a=this.Module.Feedback.extend("Feedback",{emit:()=>{this.successFeedback()}}),r=this.Module.SparkScanDeserializerListener.extend("SparkScanDeserializerListener",{onModeDeserializationFinished:(i,s,o)=>{if(!this.captureListenerSet){s.addListener(new e,1),s.setSuccessFeedback(new a),s.setPropertyPushSource(this.propertyPushSource);let n=this.Module.SparkScanViewHandlerDelegate.extend("SparkScanViewHandlerDelegate",{onSwitchedAwayFromSmartScanSelection:()=>{this.workerFunctions.postMessage({type:"sparkScanSwitchedAwayFromSmartScanSelection"})},onSwitchedToSmartScanSelection:()=>{this.workerFunctions.postMessage({type:"sparkScanSwitchedToSmartScanSelection"})},enableHapticWhenOverlapping:()=>{},onStateTransition:()=>{},resetAllTimers:()=>{}}),d=new n,l=s.getStateMachine();l.setViewHandlerDelegate(d),d.delete(),l.delete(),this.sparkScan=s.clone(),this.captureListenerSet=!0}i.delete(),o.delete(),s.delete()},onModeDeserializationStarted(i,s,o){i.delete(),s.delete(),o.delete()},onSettingsDeserializationStarted(i,s,o){i.delete(),s.delete(),o.delete()},onSettingsDeserializationFinished(i,s,o){i.delete(),s.delete(),o.delete()},onOverlayDeserializationStarted(i,s,o){i.delete(),s.delete(),o.delete()},onOverlayDeserializationFinished:(i,s,o)=>{var n;(n=this.sparkScanOverlay)==null||n.delete(),this.sparkScanOverlay=s,i.delete(),o.delete()}});this.sparkScanDeserializer=new this.Module.SparkScanDeserializer,this.sparkScanDeserializer.setListener(new r)}emitErrorFeedback(e){var a;(a=this.sparkScanOverlay)==null||a.onErrorFeedbackEmitted(e)}overlayReadyForDraw(){var e;(e=this.sparkScanOverlay)==null||e.onReadyForNewData()}analyticsManagerPropertyChanged(e){this.propertyPushSource.getBehaviorSubject(e.key).setProperty(e)}successFeedback(){this.workerFunctions.postMessage({type:"successFeedback"})}selectItemWithSmartScanSelection(){var e;(e=this.sparkScan)==null||e.selectItemWithSmartScanSelectionAsync()}async removeMode(){var e,a;this.captureListenerSet=!1,(e=this.sparkScan)==null||e.delete(),this.sparkScan=void 0,(a=this.sparkScanOverlay)==null||a.delete(),this.sparkScanOverlay=void 0}sparkScanDidScan(e,a){let r=this.coreEngine.convertToLoadableFrameData(a);this.workerFunctions.postMessage({type:"sparkScanDidScan",payload:{session:JSON.parse(e.toJson()),frameData:r}})}};var J=class extends D{constructor(e,a){super(e,a)}getModeDeserializers(){this.barcodeCaptureMode=new N(this,this.Module,this.workerFunctions),this.barcodeBatchMode=new R(this,this.Module,this.workerFunctions),this.sparkScanMode=new z(this,this.Module,this.workerFunctions),this.barcodeFindMode=new H(this,this.Module,this.workerFunctions),this.barcodeArMode=new W(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?"830dc2a432f9ed0e9633d2e85adea48784e2c9c65caf2f69111b15efa678467f":"4d2a9d39f458a2fe8850dd0cbfb2b63cf0be5248ea087ee0dfab7fba2925bfc3":e?"bdb001f777adb1eee19cc360422de40f1f6914ccf5ae4eb0c194096a3c8df72a":"a66559151262635deaca61d5679683235473ca36ce8bdc573b6d1b67bc323476"}getWasmMetadata(){return u}};function Ue(t){return(a=>/^[$A-Z_a-z][\\w$]*\\s*\\(.*\\)\\s*\\{/.test(a)&&!a.startsWith("function"))(t)?`function ${t}`:t}var $e=["fetch","XMLHttpRequest","eval","Function","self","globalThis","Module","importScripts","this","console","window","document","import","Worker","ServiceWorker"];function Ge(t){return $e.map(a=>new RegExp(`\\\\b${a}\\\\b`,"g")).some(a=>a.test(t))}function Ce(t){if(t==null)return null;let e=Ue(t);if(Ge(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 V=class extends Q{constructor(e,a){super(e,a),this.dataCaptureInstance=new J(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(n){s=void 0,i=C(n)}let o={type:"workerTaskId",command:e,id:a,payload:this.hasPayload(s)?s.payload:void 0};i!=null&&(o.error=i),this.postMessage(o,this.hasTransferables(s)?s.transferables:[])}onMessage(e){switch(e.data.command){case"sparkScanEmitErrorFeedback":{let{data: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"sparkScanSelectItemWithSmartScanSelection":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.sparkScanMode.selectItemWithSmartScanSelection()}),!0}case"sparkScanModeRemove":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.sparkScanMode.removeMode()),!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=Ce(a.functionAsString);this.dataCaptureInstance.barcodeFindMode.setTransformerFunction(r)}),!0}case"barcodeArForSettings":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeArMode.forSettings(a.settings)),!0}case"barcodeArModeRemove":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeArMode.removeMode()),!0}case"barcodeArSearchStart":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeArMode.start()}),!0;case"barcodeArSearchPause":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeArMode.pause()}),!0;case"barcodeArSearchStop":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeArMode.stop()}),!0;case"barcodeArSetEnabled":{let{data:a}=e;return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeArMode.setEnabled(a.enabled)}),!0}case"barcodeArApplySettings":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.barcodeArMode.applySettings(a.settings)}),!0}default:return super.onMessage(e)}}};var nr=new V(self,{get:()=>self.Module,set:t=>{self.Module=t}});function or(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=i({name:this.name})),this._dataCaptureWorker}get name(){return this._name}static async create(e){var a;let t=new r(e);return await t.workerCommand("setLogLevel",{level:(a=e.logLevel)!=null?a:Logger.Level.Debug}),await t.load(),t}async workerCommand(e,t,a){return new Promise((d,l)=>{let n=this.workerCommandId++;this.workerTasks.set(n,{resolve:d,reject:l,command:e});let c={...t,command:e,id:n};this.dataCaptureWorker.postMessage(c,a);})}};
|
|
1
|
+
import {DataCaptureLoader,Logger}from'@scandit/web-datacapture-core';function i(r){let s=URL.createObjectURL(new Blob(['"use strict";(()=>{var u={"scandit-datacapture-sdk-barcode-pthreads.wasm":{bytes:7771195},"scandit-datacapture-sdk-barcode-simd-pthreads.wasm":{bytes:7702952},"scandit-datacapture-sdk-barcode-simd.wasm":{bytes:7572545},"scandit-datacapture-sdk-barcode.wasm":{bytes:7641137}};function M(t){return typeof t=="object"&&t!=null}function C(t){if(typeof t=="string")return t;if(M(t)){if(typeof t.message=="string")return t.message}else if(typeof(t==null?void 0:t.toString)=="function")return t.toString();return"unknown error"}var c;(t=>{(l=>(l.Debug="debug",l.Info="info",l.Warn="warn",l.Error="error",l.Quiet="quiet"))(t.Level||(t.Level={}));let e=new Map([["debug",1],["info",2],["warn",3],["error",4],["quiet",5]]),a="debug";function r(l){a=l}t.setLevel=r;function i(l,...h){if(!(e.get(a)>e.get(l)))switch(l){case"debug":{console.debug(...h);break}case"info":{console.log(...h);break}case"warn":{console.warn(...h);break}case"error":{console.error(...h);break}}}t.log=i;function s(...l){i("warn",...l)}t.warn=s;function o(...l){i("debug",...l)}t.debug=o;function n(...l){i("info",...l)}t.info=n;function d(...l){i("error",...l)}t.error=d})(c||(c={}));var xe=class{constructor(t){if(typeof t!="function")throw new TypeError("FinalizationRegistry callback must be a function")}register(t,e,a){}unregister(t){return!1}};function ee(t){typeof t.FinalizationRegistry>"u"&&(t.FinalizationRegistry=xe)}var B=class te extends Error{constructor(e){super(e.message),Object.setPrototypeOf(this,te.prototype),this.name=e.name}toString(){return`${this.name}: ${this.message}`}};var x=Promise.resolve(),j=!1,$=!1,k,G={writableDataPath:""};async function ae(t){if(k==null)return;j=!0;let e=new Promise((a,r)=>{setTimeout(()=>{r(new B({name:"BlockedIndexedDB",message:"IndexedDB database is blocked"}))},1500)});try{await Promise.race([new Promise((a,r)=>{k==null||k(t,i=>{if(i!=null){r(i);return}a()})}),e])}finally{j=!1}}async function re(t){return $||(j?($=!0,x=x.then(async()=>($=!1,ae(t)))):x=ae(t)),x}async function ie(t){G=t,k=FS.syncfs,FS.syncfs=((e,a)=>{let r=a,i=()=>{r()},s=o=>{r(o)};re(e).then(i).catch(s)});try{FS.mkdir(G.writableDataPath)}catch(e){if(e.code!=="EEXIST")throw k=void 0,e}return FS.mount(IDBFS,{},G.writableDataPath),re(!0)}var se={};function Pe(t){return[...new Uint8Array(t)].map(e=>{let a=e.toString(16);return a.length===1?`0${a}`:a}).join("")}async function*Ae(t){let e=t.getReader();try{for(;;){let{done:a,value:r}=await e.read();if(a)return;yield r}}finally{e.releaseLock()}}async function Te(t){let e=[],a=0,r=0;for await(let s of Ae(t))e.push(s),a+=s.length;let i=new Uint8Array(a);for(let s of e)i.set(s,r),r+=s.length;return i.buffer}var Oe=(t=>(t.VALID="VALID",t.INVALID="INVALID",t.NOT_VERIFIABLE="NOT_VERIFIABLE",t))(Oe||{});async function Ee(t,e,a){if(typeof crypto.subtle.digest!="function")return c.log(c.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=Pe(i);return e==null?(c.log(c.Level.Warn,"The library hash is not defined or empty, cannot correctly verify integrity."),"NOT_VERIFIABLE"):s===e?(c.log(c.Level.Debug,`Data Capture library WASM integrity found at ${a} has been verified correctly.`),"VALID"):(c.log(c.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 c.log(c.Level.Warn,"Wasm response could not be verified",r),"NOT_VERIFIABLE"}}var q=new Map([["br",4.4],["gzip",2.9],["none",1]]);function Le(t){var e;let a="content-encoding";if(t==null||t.get(a)==null)return q.get("none");let r=new Set(((e=t.get(a))!=null?e:"").split(",").map(i=>i.trim()));for(let[i,s]of q)if(r.has(i))return s;return q.get("none")}function We(t){var e,a;if(t==null)return 0;let r=(e=Le(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 Re(t){let{pathname:e}=new URL(t);for(let[a,r]of Object.entries(se))if(e.endsWith(a))return r.bytes;return 0}function ne(t){se=t}var Ne=(t,e)=>{let a=We(e);return a===0?Re(t):a};function He(t,e,a,{onProgress:r,onError:i,onComplete:s}){if(!e.body)return[e];let o=Ne(t,e.headers),n=0,d=0;if(typeof TransformStream>"u")return c.warn("TransformStream is not supported in this environment. Progress tracking will be disabled."),[e];let[l,h]=a?e.body.tee():[e.body],m=l.pipeThrough(new TransformStream({async transform(g,b){try{n+=g.length,d=Number((n/o*100).toFixed(2)),o>0&&g.length>0&&d<100?r==null||r({percentage:d,loadedBytes:n,privateUri:t}):o===0&&g.length>0&&(r==null||r({percentage:null,loadedBytes:n,privateUri:t})),b.enqueue(g)}catch(w){b.error(w),i==null||i({error:w})}},flush(g){r==null||r({percentage:100,loadedBytes:n,privateUri:t}),s==null||s({percentage:100,loadedBytes:n,privateUri:t}),g.terminate()}}));return[new Response(m,{headers:new Headers(e.headers),status:e.status,statusText:e.statusText}),h]}async function Y({wasmURI:t,expectedHash:e,verifyResponseHash:a,onProgress:r,onComplete:i,onError:s,referredOrigin:o}){let n=await fetch(t,{referrerPolicy:"origin",referrer:o!=null?o:""});if(!n.ok)throw new Error(`HTTP status code is not ok: ${n.status}, ${n.statusText}`);let[d,l]=He(t,n,a,{onProgress:r,onError:s,onComplete:i});return l!=null&&Ee(Te(l),e,t),d}function oe({wasmURI:t,expectedHash:e,verifyResponseHash:a,progressCallback:r,successCallback:i,errorCallback:s,importObject:o,referredOrigin:n}){async function d(h){try{let m=await Y({wasmURI:t,expectedHash:e,verifyResponseHash:a,onProgress:r,referredOrigin:n}),g=await(h!=null?h:m).arrayBuffer(),b=await self.WebAssembly.instantiate(g,o);i(b.instance,b.module)}catch(m){c.log(c.Level.Error,m),c.log(c.Level.Error,`Couldn\'t instantiate Scandit SDK DataCapture library at ${t}, did you configure the path for it correctly?`),s==null||s(m)}}async function l(){let h;try{h=await Y({wasmURI:t,expectedHash:e,verifyResponseHash:a,onProgress:r,referredOrigin:n});let m=await self.WebAssembly.instantiateStreaming(h,o);i(m.instance,m.module)}catch(m){c.log(c.Level.Warn,m),c.log(c.Level.Warn,"WebAssembly streaming compile failed. Falling back to ArrayBuffer instantiation (this will make things slower)"),d((h==null?void 0:h.bodyUsed)===!0?void 0:h)}}typeof self.WebAssembly.instantiateStreaming=="function"?l():d()}async function X(t,e,a,r){return new Promise((i,s)=>{t().then(i).catch(o=>{let n=e*2;if(n>a){s(o);return}r(o),self.setTimeout(()=>{X(t,n,a,r).then(i).catch(s)},e)})})}function K(t){var e,a;let r="unknown";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):(/^(\\d{1,3}\\.){3}\\d{1,3}$/.test(r)&&(r=r.split(".").map(i=>Number.parseInt(i,10).toString()).join(".")),r)}async function de(t,e){async function a(){return importScripts(t)}try{await X(a,250,4e3,i=>{c.log(c.Level.Warn,i),c.log(c.Level.Warn,`Couldn\'t retrieve Scandit Data Capture library at ${t}, retrying...`)}),self.Module.mainScriptUrlOrBlob=t;let r=self.SDC_WASM_JS_VERSION;return r!==e&&c.log(c.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 c.log(c.Level.Error,r),!1}}var P=class{constructor(){this.promise=new Promise((t,e)=>{this.reject=e,this.resolve=t})}};var Z=class{constructor(t,e){this.workerFunctions=t,this.options=e,this.imageIdCounter=0,this.conversions=new Map}convertToJpeg(t,e){let a=this.imageIdCounter++,r=new P;this.conversions.set(a,r);let i=t.toBitmap();return this.workerFunctions.postMessage({type:"convertToJPEG",imageId:a,width:t.getWidth(),height:t.getHeight(),data:i,planes:t.getPlanes(),orientation:e,quality:this.options.quality},Array.from(new Set([i.buffer]))),r.promise}onConvertToJPEGResult(t,e){let a=this.conversions.get(t);a?(a.resolve(e),this.conversions.delete(t)):c.warn(`ImageConverterForwarder: Conversion for imageId ${t} not found in Map`)}};var A=class{constructor(t){this.options=t}get quality(){return this.options.quality}async convertToJpeg(t,e){try{let{width:a,height:r,planes:i}=this.validateAndExtractImageData(t);this.prepareCanvas(a,r);let s=this.processImageData(t,i,a,r);return await this.convertToJpegBytes(s,e)}catch(a){throw c.warn(`Failed to convert image to JPEG: ${a}`),a instanceof Error?a:new Error("Failed to convert image to JPEG")}}validateAndExtractImageData(t){let e=t.getWidth(),a=t.getHeight(),r=t.getPlanes();if(e<=0||a<=0)throw c.warn(`Invalid image dimensions: ${e}x${a}`),new Error(`Invalid image dimensions: ${e}x${a}`);if(!r||r.length===0)throw c.warn("ImageBuffer has no planes"),new Error("ImageBuffer has no planes");return{width:e,height:a,planes:r}}prepareCanvas(t,e){if(!this.ensureCanvas(t,e))throw new Error("Failed to create OffscreenCanvas");if(!this.canvas||!this.context)throw new Error("Canvas or context not properly initialized")}processImageData(t,e,a,r){let i=this.createImageDataFromBuffer(t,e,a,r);if(i===null)throw new Error("Failed to create ImageData");return this.validateImageData(i,a,r),i}validateImageData(t,e,a){var r;if(t.width!==e||t.height!==a)throw c.warn(`ImageData dimensions mismatch: expected ${e}x${a}, got ${t.width}x${t.height}`),new Error("ImageData dimensions mismatch");if(!t.data||t.data.length!==e*a*4)throw c.warn(`ImageData has invalid data length: expected ${e*a*4}, got ${((r=t.data)==null?void 0:r.length)||0}`),new Error("ImageData has invalid data length")}async convertToJpegBytes(t,e){if(!this.context||!this.canvas)throw new Error("Canvas or context not available");try{this.context.putImageData(t,0,0)}catch(s){throw c.warn(`Failed to put image data on canvas: ${s}`),new Error(`Failed to put image data on canvas: ${s}`)}let a=e!==0?this.applyRotation(this.canvas,e):this.canvas,r;try{r=await this.canvasToBlob(a)}catch(s){throw c.warn(`Failed to convert canvas to blob: ${s}`),new Error(`Failed to convert canvas to blob: ${s}`)}if(!r||r.size===0)throw c.warn("Canvas convertToBlob returned empty or null blob"),new Error("Failed to create JPEG blob");let i;try{i=await r.arrayBuffer()}catch(s){throw c.warn(`Failed to get array buffer from blob: ${s}`),new Error(`Failed to get array buffer from blob: ${s}`)}if(!i||i.byteLength===0)throw c.warn("Blob arrayBuffer returned empty or null buffer"),new Error("Failed to get array buffer from blob");return new Uint8Array(i)}ensureCanvas(t,e){try{return(!this.canvas||this.canvas.width!==t||this.canvas.height!==e)&&(this.canvas=this.getNewCanvas(t,e),this.context=this.canvas.getContext("2d")),this.context!==null}catch(a){return c.warn("Failed to create HTMLCanvasElement",a),!1}}createImageDataFromBuffer(t,e,a,r){let i=new Set(e.map(s=>s.channel));try{if(this.isYUVFormat(i)){let n=t.toBitmap();return!n||n.length!==a*r*4?(c.warn(`Invalid bitmap data from toBitmap(): expected ${a*r*4} bytes, got ${(n==null?void 0:n.length)||0}`),null):new ImageData(new Uint8ClampedArray(n),a,r)}if(this.isRGBAFormat(i))return this.createImageDataFromRGBAPlanes(e,a,r);if(this.isRGBFormat(i))return this.createImageDataFromRGBPlanes(e,a,r);if(this.isGrayscaleFormat(i))return this.createImageDataFromGrayscalePlanes(e,a,r);c.warn(`Unknown image format with channels: ${Array.from(i).join(", ")}, falling back to toBitmap()`);let s=t.toBitmap();if(!s||s.length===0)return c.warn("toBitmap() returned empty or null data"),null;let o=s.length/(a*r);return o===4?new ImageData(new Uint8ClampedArray(s),a,r):(c.warn(`Unsupported format: ${o} bytes per pixel`),null)}catch(s){return c.warn(`Failed to create ImageData: ${s}`),null}}isYUVFormat(t){return t.has(0)&&t.has(1)&&t.has(2)}isRGBAFormat(t){return t.has(3)&&t.has(4)&&t.has(5)&&t.has(6)}isRGBFormat(t){return t.has(3)&&t.has(4)&&t.has(5)&&!t.has(6)}isGrayscaleFormat(t){return t.has(0)&&!t.has(1)&&!t.has(2)}createImageDataFromRGBAPlanes(t,e,a){let r=t.find(d=>d.channel===3),i=t.find(d=>d.channel===4),s=t.find(d=>d.channel===5),o=t.find(d=>d.channel===6);if(!r||!i||!s||!o)return c.warn("Missing RGBA planes"),null;let n=new Uint8ClampedArray(e*a*4);for(let d=0;d<a;d++)for(let l=0;l<e;l++){let h=(d*e+l)*4;n[h]=this.getPixelFromPlane(r,l,d),n[h+1]=this.getPixelFromPlane(i,l,d),n[h+2]=this.getPixelFromPlane(s,l,d),n[h+3]=this.getPixelFromPlane(o,l,d)}return new ImageData(n,e,a)}createImageDataFromRGBPlanes(t,e,a){let r=t.find(n=>n.channel===3),i=t.find(n=>n.channel===4),s=t.find(n=>n.channel===5);if(!r||!i||!s)return c.warn("Missing RGB planes"),null;let o=new Uint8ClampedArray(e*a*4);for(let n=0;n<a;n++)for(let d=0;d<e;d++){let l=(n*e+d)*4;o[l]=this.getPixelFromPlane(r,d,n),o[l+1]=this.getPixelFromPlane(i,d,n),o[l+2]=this.getPixelFromPlane(s,d,n),o[l+3]=255}return new ImageData(o,e,a)}createImageDataFromGrayscalePlanes(t,e,a){let r=t.find(s=>s.channel===0);if(!r)return c.warn("Missing Y plane for grayscale"),null;let i=new Uint8ClampedArray(e*a*4);for(let s=0;s<a;s++)for(let o=0;o<e;o++){let n=(s*e+o)*4,d=this.getPixelFromPlane(r,o,s);i[n]=d,i[n+1]=d,i[n+2]=d,i[n+3]=255}return new ImageData(i,e,a)}getPixelFromPlane(t,e,a){let r=Math.floor(e/(t.subsamplingX||1)),i=Math.floor(a/(t.subsamplingY||1)),s=t.rowStride,o=t.pixelStride,n=i*s+r*o,d=t.data;return n<d.length?d[n]:0}applyRotation(t,e){let a=e*Math.PI/180,r=e===90||e===270||e===-90||e===-270,i=r?t.height:t.width,s=r?t.width:t.height,o=this.getNewCanvas(i,s),n=o.getContext("2d");if(!n)throw new Error("Failed to get 2D context for rotated canvas");return n.translate(i/2,s/2),n.rotate(a),n.translate(-t.width/2,-t.height/2),n.drawImage(t,0,0),o}};A.JPEG_IMAGE_MIME_TYPE="image/jpeg";var ce=class extends A{getNewCanvas(t,e){return new OffscreenCanvas(t,e)}canvasToBlob(t){return t.convertToBlob({type:A.JPEG_IMAGE_MIME_TYPE,quality:this.options.quality})}};var T;(t=>{function e(){return"8.1.2"}t.sdkVersion=e})(T||(T={}));function _e(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 ze(t){let e=/@scandit\\/web-datacapture-[a-z]+/i.exec(t);return e?e[0]:null}function le(t,e,a){let r=e,i=_e(r);if(i.result){let o=ze(r);o!=null&&(r=`${i.cdnBaseURL}${o}@${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 ue=class pe{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.lastFrameColorType="RGBA",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),ne(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,{data:new Uint8ClampedArray(e.getFrameData()),colorType:this.lastFrameColorType});let r=this.lastUsedModuleMirrorAxis==null?!1:this.lastUsedModuleMirrorAxis!==this.Module.Axis.None;return{frameId:a,width:e.getWidth(),height:e.getHeight(),isFrameSourceMirrored:r,colorType:this.lastFrameColorType}}createContext(e){var a,r,i,s,o;let n=this.getModeDeserializers(),d=K(location);(d==="localhost"||d==="127.0.0.1")&&navigator.userAgent.includes("Electron")&&e.appName!=null&&(d+=`-${e.appName}`),this.parentDomain=e.parentDomain,this.contextDeserializer=new this.Module.DataCaptureContextDeserializer(this.writableDataPath,e.deviceId,e.context.deviceModelName,d,this.parentDomain,n,e.delayedRegistration,e.highEndBlurryRecognition,this.resourcePath);let l=this.contextDeserializer.contextFromJson(JSON.stringify(e.context));if(l==null){let p=this.contextDeserializer.getLastError();throw new Error(`Could not create the context: ${p}`)}let h=l.getView();this.context=l.getContext(),l.delete();let m=this.Module.DataCaptureContextListener.extend("DataCaptureContextListener",{didChangeStatus:(p,f)=>{this.contextDidChangeStatus(JSON.parse(f.toJson())),p.delete()},didStartObservingContext:p=>{this.didStartObservingContext(),p.delete()},didStopObservingContext:p=>{p.delete()}}),g=this.Module.DataCaptureContextFrameListener.extend("DataCaptureContextFrameListener",{onObservationStarted:p=>{p.delete()},onObservationStopped:p=>{p.delete()},onFrameProcessingStarted:(p,f)=>{this.workerFunctions.postMessage({type:"onFrameProcessingStarted"}),f.delete(),p.delete()},onFrameProcessingFinished:(p,f)=>{this.workerFunctions.postMessage({type:"onFrameProcessingFinished"}),f.delete(),p.delete()},onFrameSkipped:(p,f)=>{this.workerFunctions.postMessage({type:"onFrameSkipped"}),f.delete(),p.delete()}}),b=this.Module.GestureRecognizer.extend("GestureRecognizer",{setGestureListener:(p,f)=>{var F;(F=this.gestureListener)==null||F.delete(),this.gestureListener=p.clone(),p.delete()}});(a=this.gestureRecognizer)==null||a.delete(),this.gestureRecognizer=new b;let w=new m;this.context.addListener(w),w.delete();let v=new g;this.context.addFrameListener(v),v.delete(),this.setView(h),(r=this.view)==null||r.setGestureRecognizer(this.gestureRecognizer);let U=this.Module.PlatformHintPresenter.extend("PlatformHintPresenter",{setHintPresenter:p=>{p.delete()},showToast:p=>{this.workerFunctions.postMessage({type:"showToast",payload:JSON.parse(p)})},hideToast:p=>{this.workerFunctions.postMessage({type:"hideToast",payload:JSON.parse(p)})},showGuidance:p=>{this.workerFunctions.postMessage({type:"showGuidance",payload:JSON.parse(p)})},hideGuidance:p=>{this.workerFunctions.postMessage({type:"hideGuidance",payload:JSON.parse(p)})},startUpdateTimer:p=>{this.workerFunctions.postMessage({type:"startUpdateTimer",payload:{duration:{unit:"ms",value:p}}})},stopUpdateTimer:()=>{this.workerFunctions.postMessage({type:"stopUpdateTimer"})}});(i=this.hintPresenterV2)==null||i.delete(),this.hintPresenterV2=null,(s=this.webPlatformHintPresenter)==null||s.delete(),this.webPlatformHintPresenter=null,this.webPlatformHintPresenter=new U,this.view&&(this.hintPresenterV2=new this.Module.HintPresenterV2(this.webPlatformHintPresenter),(o=this.view)==null||o.setHintPresenterV2(this.hintPresenterV2)),this.webImageConverterInstance=this.getImageConverterInstance({quality:1}),this.Module.ImageConverter.setInstance(this.webImageConverterInstance)}convertToJPEGResult(e,a){this.webImageConverterInstance instanceof Z&&this.webImageConverterInstance.onConvertToJPEGResult(e,a)}getImageConverterInstance(e){return this.workerFunctions.getOffscreenCanvas()!=null?new ce(e):new Z(this.workerFunctions,e)}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,r,i;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,(r=this.hintPresenterV2)==null||r.delete(),this.hintPresenterV2=null,(i=this.webPlatformHintPresenter)==null||i.delete(),this.webPlatformHintPresenter=null}flushAnalytics(){this.context.flushAnalytics()}extractCentaurusLicense(e){return{payload:{centaurus:{licenseKey:this.Module.LicenseUtils[pe.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;this.lastFrameColorType=e.colorType==="GRAYSCALE"?"GRAYSCALE":"RGBA";let 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){var a;let{data:r,colorType:i}=(a=this.frameDataPool.get(e))!=null?a:{data:null,colorType:null};return r==null?{payload:{data:null,colorType:null}}:{payload:{data:r,colorType:i},transferables:[r.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 o=e.getDrawCommands();this.sendViewRefreshCommands(new Uint8Array(o))}i()},this.redrawInterval)};i()}updateContext(e){if(this.context!=null&&this.contextDeserializer!=null){e.view!=null&&!e.view.visible&&this.context.flushAnalytics();let 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&&this.webPlatformHintPresenter&&(this.hintPresenterV2=new this.Module.HintPresenterV2(this.webPlatformHintPresenter)),i!=null&&this.hintPresenterV2&&i.setHintPresenterV2(this.hintPresenterV2),this.gestureRecognizer!=null&&(i==null||i.setGestureRecognizer(this.gestureRecognizer)),this.setView(i),c.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?"22f1ca468ca9c82fa2a45be9ba7ff0c281e4655d52985e0e808fb21eb1047ba5":"64a53eb290ac71c4a2c0b31cee4e7ae99aa1bad58f653ee1e8535bb68d0a59be":e?"b59e53cfa4d085d2f24e2c6d8a93b05ed58ff8538bb49576d543908c7470827e":""}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 u}getWasmSideModuleFileName(){return""}_loadProgressCallback(e){this.workerFunctions.postMessage({type:"loadLibraryProgress",payload:e})}addRedrawRequest(e){this.redrawRequests.push(Math.round(performance.now())+e),this.redrawRequests.sort((a,r)=>a-r)}contextDidChangeStatus(e){e.code===260?e.message=e.message.replace("domain name",`domain name (${K(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){c.warn("addNativeOverlay has not been implemented for this module",e)}removeNativeOverlay(e){c.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),o=[];for(let n of s){let d=new TextDecoder(n.ianaName,{fatal:!0});o.push(d.decode(r.slice(n.startIndex,n.endIndex)))}return o.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?(c.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,verifyResponseHash:i,referredOrigin:s,fixedWasmMemory:o,simdSupport:n,threadsSupport:d}){var l;let h=!1,m=!1;this.writableDataPath=this.getWritableDataPath(r),this.resourcePath=`${e}${this.resourceFilesSubfolder}/`,self.path=a;let{resolve:g,reject:b,promise:w}=new P,v=T.sdkVersion();if(v==="")throw new B({name:"Invalid library version",message:"Library version is not defined or empty, cannot generate proper path to library files."});let U=this.getWasmCoreFileName(n,d),p=le(v,e,U),{jsURI:f,wasmURI:F}=p,ke={instantiateWasm:(y,De)=>(oe({importObject:y,wasmURI:F,expectedHash:this.getWasmCoreExpectedHash(n,d),verifyResponseHash:i,successCallback:De,progressCallback:this._loadProgressCallback,errorCallback:Ie=>{b(Ie)},referredOrigin:s}),{})},I=o===null?null:new WebAssembly.Memory({initial:this.numOfMBToPages(o),maximum:this.numOfMBToPages(300),shared:d});return I!==null&&c.log(c.Level.Debug,"Fixed wasmMemory set",I),this.moduleHandler.set({...I?{wasmMemory:I}:{},mainScriptUrlOrBlob:f,canvas:(l=this.workerFunctions.getOffscreenCanvas())!=null?l:{getContext:()=>null},...ke,dynamicLibraries:this.getWasmDynamicLibraries(F),locateFile:y=>e+y,noInitialRun:!0,preRun:[async()=>{try{await ie({writableDataPath:this.writableDataPath})}catch(y){if(y.name==="BlockedIndexedDB"){b(y.toString());return}c.log(c.Level.Debug,"No IndexedDB support, some data will not be persisted:",y)}m=!0,this.start(m,h,g)}],onMainComplete:()=>{if([h,m].includes(!1)){c.log(c.Level.Warn,{runtimeLoaded:h,fileSystemSynced:m},"Both runtimeLoaded and fileSystemSynced should be true when calling onMainComplete"),b("onMainComplete has been called but runtime or file system was not ready.");return}g()},onRuntimeInitialized:()=>{h=!0,this.start(m,h,g)},print:y=>{c.log(c.Level.Info,y)}}),await de(f,v)||b(`Couldn\'t retrieve Scandit Data Capture library at ${f}, did you configure the path for it correctly?`),w}};ue.get3dPartyLicenseKeyMethodName=atob("Z2V0QmxpbmtJZExpY2Vuc2VLZXk=");var D=ue;function he(t){return typeof t=="object"&&t!=null&&t.document==null&&"addEventListener"in t&&typeof t.importScripts=="function"}function me(t){console.warn("Reached unexpected case",t)}var Q=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)}),he(t)&&(ee(t),this.listenToMessages())}listenToMessages(){this.workerSelf.addEventListener("message",this.onMessageListener),this.workerSelf.addEventListener("error",t=>{c.log(c.Level.Error,t)}),this.workerSelf.addEventListener("messageerror",t=>{c.log(c.Level.Error,t)})}postMessage(t,e){this.workerSelf.postMessage(t,e!=null?e:[])}getOffscreenCanvas(){if(this.isOffscreenCanvasSupported())return new this.workerSelf.OffscreenCanvas(32,32)}isOffscreenCanvasSupported(){return typeof this.workerSelf.OffscreenCanvas=="function"}hasPayload(t){return 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(o){i=void 0,r=C(o)}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,threadsSupport:e.threadsSupport,simdSupport:e.simdSupport,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,()=>{c.setLevel(e.level)})}break}case"extractCentaurusLicense":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.extractCentaurusLicense(e.licenseKey))}break}case"documentVisibility":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>{this.dataCaptureInstance.onDocumentVisibilityChange(e.state)})}break}case"isFeatureSupported":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.isFeatureSupported(e.feature))}break}case"getViewfinderInfo":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.getViewfinderInfo())}break}case"getOpenSourceSoftwareLicenseInfo":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.getOpenSourceSoftwareLicenseInfo())}break}case"addNativeOverlay":this.dataCaptureInstance.addNativeOverlay(t);break;case"removeNativeOverlay":this.dataCaptureInstance.removeNativeOverlay(t);break;case"convertToJPEGResult":{{let{data:e}=t;this.dataCaptureInstance.convertToJPEGResult(e.imageId,e.result)}break}default:return me(t.data),!1}return!0}};var ge=(t=>(t.Body="body",t.Footnote="footnote",t))(ge||{}),O=(t=>(t.Start="start",t.Center="center",t.End="end",t))(O||{}),be=(t=>(t.Normal="normal",t.Wider="wider",t.FitText="fitText",t))(be||{}),fe=(t=>(t.Normal="normal",t.Taller="taller",t))(fe||{}),ye=(t=>(t.Square="square",t.Rounded="rounded",t))(ye||{}),E=(t=>(t.None="none",t.Check="check",t.ExclamationMark="exclamationMark",t))(E||{}),L=(t=>(t.Top="top",t.AboveViewFinder="aboveViewFinder",t.BelowViewFinder="belowViewFinder",t))(L||{}),Se=(t=>(t.AboveViewFinder="aboveViewFinder",t.BelowViewFinder="belowViewFinder",t))(Se||{}),we=(t=>(t.BlackOnWhite="blackOnWhite",t.WhiteOnBlack="whiteOnBlack",t.Transparent="transparent",t))(we||{}),ve=(t=>(t.Success="success",t.Error="error",t.Warning="warning",t.Info="info",t.Notification="notification",t))(ve||{}),Fe=(t=>(t[t.Ocr=0]="Ocr",t[t.HideLogo=1]="HideLogo",t[t.ShowTestLicenseMessage=2]="ShowTestLicenseMessage",t[t.AugmentedReality=5]="AugmentedReality",t[t.ActivityPingStatsAddon=8]="ActivityPingStatsAddon",t[t.ActivityPing=9]="ActivityPing",t[t.Registration=10]="Registration",t[t.Parser=11]="Parser",t[t.BarcodeCapture=14]="BarcodeCapture",t[t.Analytics=17]="Analytics",t[t.AnalyticsBatchMode=18]="AnalyticsBatchMode",t[t.AnalyticsScanContent=19]="AnalyticsScanContent",t[t.AnalyticsOnlineVerification=20]="AnalyticsOnlineVerification",t[t.SparkScan=21]="SparkScan",t[t.AamvaIdBarcodeVerification=22]="AamvaIdBarcodeVerification",t[t.MappingForTracking=23]="MappingForTracking",t[t.BarcodeFind=24]="BarcodeFind",t[t.MandatoryRegistration=25]="MandatoryRegistration",t[t.FeatureTracking=26]="FeatureTracking",t[t.IdCaptureViz=27]="IdCaptureViz",t[t.IdCaptureMrz=28]="IdCaptureMrz",t[t.IdCaptureBarcode=29]="IdCaptureBarcode",t[t.BarcodeSelectionAimToScan=30]="BarcodeSelectionAimToScan",t[t.BarcodeSelectionTapToScan=31]="BarcodeSelectionTapToScan",t[t.BarcodeCount=32]="BarcodeCount",t[t.BarcodePick=33]="BarcodePick",t[t.IdVerificationDataComparison=34]="IdVerificationDataComparison",t[t.SmartLabelBarcode=35]="SmartLabelBarcode",t[t.SmartLabelText=36]="SmartLabelText",t[t.VoidedIdDetection=37]="VoidedIdDetection",t[t.BarcodeArFull=38]="BarcodeArFull",t[t.BarcodeSequence=39]="BarcodeSequence",t))(Fe||{});var W=class{constructor(e,a,r){this.barcodeAr=null;this.coreEngine=e,this.Module=a,this.workerFunctions=r}async forSettings(e){var r;(r=this.barcodeAr)==null||r.delete(),this.barcodeAr=new this.Module.BarcodeAr(this.coreEngine.context,JSON.stringify(e));let a=this.Module.BarcodeArListener.extend("BarcodeArListener",{didUpdateSession:(i,s,o)=>{let n=this.coreEngine.convertToLoadableFrameData(o);this.workerFunctions.postMessage({type:"barcodeArDidUpdateSession",payload:{session:JSON.parse(s.toJson()),frameData:n}}),i.delete(),s.delete(),o.delete()}});this.barcodeAr.addListener(new a,1),this.Module.addBarcodeArToContext(this.coreEngine.context,this.barcodeAr)}start(){var e;(e=this.barcodeAr)==null||e.start()}pause(){var e;(e=this.barcodeAr)==null||e.pause()}stop(){var e;(e=this.barcodeAr)==null||e.stop()}setEnabled(e){var a;(a=this.barcodeAr)==null||a.setEnabled(e)}async removeMode(){this.barcodeAr!=null&&this.Module.removeBarcodeArFromContext(this.coreEngine.context,this.barcodeAr)}applySettings(e){var a;(a=this.barcodeAr)==null||a.applySettings(JSON.stringify(e))}};var R=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 N=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:(o,n,d)=>{this.barcodeCaptureDidScan(n,d),o.delete(),d.delete(),n.delete()},didUpdateSession:(o,n,d)=>{this.barcodeCaptureDidUpdateSession(n),o.delete(),d.delete(),n.delete()}}),a=this.Module.Feedback.extend("Feedback",{emit:()=>{this.successFeedback()}}),r=new e,i=new a,s=this.Module.BarcodeCaptureDeserializerListener.extend("BarcodeCaptureDeserializerListener",{onModeDeserializationFinished:(o,n,d)=>{n.addListener(r,1),n.setSuccessFeedback(i),o.delete(),n.delete(),d.delete()},onModeDeserializationStarted(o,n,d){o.delete(),n.delete(),d.delete()},onSettingsDeserializationStarted(o,n,d){o.delete(),n.delete(),d.delete()},onSettingsDeserializationFinished(o,n,d){o.delete(),n.delete(),d.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}})}};function Je(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Me(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:O.Center,hintIcon:E.None,hintAnchor:L.AboveViewFinder,hintAnchorOffset:-12,horizontalMargin:0,iconColor:"00000000",lineHeight:-1,maxLines:1,maxWidthFraction:.8,textColor:"ffffffff",textSize:15,textWeight:600};this.customerTransformation=Me;this.coreEngine=e,this.Module=a,this.workerFunctions=r}async forSettings(e){var o;(o=this.barcodeFind)==null||o.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,d,l)=>{let h=this.coreEngine.convertToLoadableFrameData(l);this.workerFunctions.postMessage({type:"barcodeFindDidUpdateSession",payload:{session:JSON.parse(d.toJson()),frameData:h}}),n.delete(),d.delete(),l.delete()},onSearchPaused:n=>{let d=[];for(let l=0;l<n.size();l++)d.push(n.get(l));this.workerFunctions.postMessage({type:"barcodeFindSearchPaused",payload:{foundItems:d}})},onSearchStopped:n=>{let d=[];for(let l=0;l<n.size();l++)d.push(n.get(l));this.workerFunctions.postMessage({type:"barcodeFindSearchStopped",payload:{foundItems:d}})},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(){var e;(e=this.barcodeFind)==null||e.start()}stop(){var e;(e=this.barcodeFind)==null||e.stop()}pause(){var e;(e=this.barcodeFind)==null||e.pause()}setEnabled(e){var a;(a=this.barcodeFind)==null||a.setEnabled(e)}setItemList(e){var a;(a=this.barcodeFind)==null||a.setItemList(JSON.stringify(e))}async removeMode(){this.barcodeFind!=null&&this.Module.removeBarcodeFindFromContext(this.coreEngine.context,this.barcodeFind)}addBasicOverlay(){var e;(e=this.basicOverlay)==null||e.delete(),this.basicOverlay=null,this.barcodeFind!=null&&(this.basicOverlay=new this.Module.BarcodeFindBasicOverlay(this.barcodeFind)),this.coreEngine.view!=null&&this.basicOverlay!=null&&(this.basicOverlay.setGuidanceHandler(this.createWebFindGuidanceHandler()),this.Module.addBarcodeFindBasicOverlayToView(this.coreEngine.view,this.basicOverlay))}removeBasicOverlay(){this.coreEngine.view!=null&&this.basicOverlay!=null&&this.Module.removeBarcodeFindBasicOverlayFromView(this.coreEngine.view,this.basicOverlay)}async applySettings(e){var a;(a=this.barcodeFind)==null||a.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${Je(r)}`;this.basicOverlay!=null&&typeof this.basicOverlay[s]=="function"&&i!=null&&this.basicOverlay[s](i)}}setTransformerFunction(e){this.customerTransformation=e!=null?e:Me}successFeedback(){this.workerFunctions.postMessage({type:"successFeedback"})}listUpdatedFeedback(){this.workerFunctions.postMessage({type:"barcodeFindListUpdatedFeedback",payload:{}})}setToast(e,a){let r=this.coreEngine.hintPresenterV2;e?r==null||r.showToast(JSON.stringify(a)):r==null||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")},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")}});return new e}};var S=class{constructor(e){this.subscribers=new Set;this.property={key:e,value:null}}addSubscriber(e){var a;this.subscribers.add(e),(a=e.onPropertyChanged)==null||a.call(e,this.property)}removeSubscriber(e){this.subscribers.delete(e)}setProperty(e){var a;if(this.property.value!==e.value){this.property={key:this.property.key,value:e.value};for(let r of this.subscribers)(a=r.onPropertyChanged)==null||a.call(r,this.property)}}};var Ve={torch_state:new S("torch_state"),scanning_mode:new S("scanning_mode"),sound_enabled:new S("sound_enabled"),haptic_enabled:new S("haptic_enabled"),session_stop_reason:new S("session_stop_reason"),camera_position:new S("camera_position")},_=class{getBehaviorSubject(e){return Ve[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,o)=>{this.sparkScanDidScan(s,o),i.delete(),s.delete(),o.delete()},didUpdateSession:(i,s,o)=>{this.sparkScanDidUpdateSession(s),i.delete(),s.delete(),o.delete()}}),a=this.Module.Feedback.extend("Feedback",{emit:()=>{this.successFeedback()}}),r=this.Module.SparkScanDeserializerListener.extend("SparkScanDeserializerListener",{onModeDeserializationFinished:(i,s,o)=>{if(!this.captureListenerSet){s.addListener(new e,1),s.setSuccessFeedback(new a),s.setPropertyPushSource(this.propertyPushSource);let n=this.Module.SparkScanViewHandlerDelegate.extend("SparkScanViewHandlerDelegate",{onSwitchedAwayFromSmartScanSelection:()=>{this.workerFunctions.postMessage({type:"sparkScanSwitchedAwayFromSmartScanSelection"})},onSwitchedToSmartScanSelection:()=>{this.workerFunctions.postMessage({type:"sparkScanSwitchedToSmartScanSelection"})},enableHapticWhenOverlapping:()=>{},onStateTransition:()=>{},resetAllTimers:()=>{}}),d=new n,l=s.getStateMachine();l.setViewHandlerDelegate(d),d.delete(),l.delete(),this.sparkScan=s.clone(),this.captureListenerSet=!0}i.delete(),o.delete(),s.delete()},onModeDeserializationStarted(i,s,o){i.delete(),s.delete(),o.delete()},onSettingsDeserializationStarted(i,s,o){i.delete(),s.delete(),o.delete()},onSettingsDeserializationFinished(i,s,o){i.delete(),s.delete(),o.delete()},onOverlayDeserializationStarted(i,s,o){i.delete(),s.delete(),o.delete()},onOverlayDeserializationFinished:(i,s,o)=>{var n;(n=this.sparkScanOverlay)==null||n.delete(),this.sparkScanOverlay=s,i.delete(),o.delete()}});this.sparkScanDeserializer=new this.Module.SparkScanDeserializer,this.sparkScanDeserializer.setListener(new r)}emitErrorFeedback(e){var a;(a=this.sparkScanOverlay)==null||a.onErrorFeedbackEmitted(e)}overlayReadyForDraw(){var e;(e=this.sparkScanOverlay)==null||e.onReadyForNewData()}analyticsManagerPropertyChanged(e){this.propertyPushSource.getBehaviorSubject(e.key).setProperty(e)}successFeedback(){this.workerFunctions.postMessage({type:"successFeedback"})}selectItemWithSmartScanSelection(){var e;(e=this.sparkScan)==null||e.selectItemWithSmartScanSelectionAsync()}async removeMode(){var e,a;this.captureListenerSet=!1,(e=this.sparkScan)==null||e.delete(),this.sparkScan=void 0,(a=this.sparkScanOverlay)==null||a.delete(),this.sparkScanOverlay=void 0}sparkScanDidScan(e,a){let r=this.coreEngine.convertToLoadableFrameData(a);this.workerFunctions.postMessage({type:"sparkScanDidScan",payload:{session:JSON.parse(e.toJson()),frameData:r}})}};var J=class extends D{constructor(e,a){super(e,a)}getModeDeserializers(){this.barcodeCaptureMode=new N(this,this.Module,this.workerFunctions),this.barcodeBatchMode=new R(this,this.Module,this.workerFunctions),this.sparkScanMode=new z(this,this.Module,this.workerFunctions),this.barcodeFindMode=new H(this,this.Module,this.workerFunctions),this.barcodeArMode=new W(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?"22f1ca468ca9c82fa2a45be9ba7ff0c281e4655d52985e0e808fb21eb1047ba5":"64a53eb290ac71c4a2c0b31cee4e7ae99aa1bad58f653ee1e8535bb68d0a59be":e?"b59e53cfa4d085d2f24e2c6d8a93b05ed58ff8538bb49576d543908c7470827e":"632d034289e209d4e0b9342223be93a762713b6dee274875b445ec731dce3f94"}getWasmMetadata(){return u}};function Ue(t){return(a=>/^[$A-Z_a-z][\\w$]*\\s*\\(.*\\)\\s*\\{/.test(a)&&!a.startsWith("function"))(t)?`function ${t}`:t}var $e=["fetch","XMLHttpRequest","eval","Function","self","globalThis","Module","importScripts","this","console","window","document","import","Worker","ServiceWorker"];function Ge(t){return $e.map(a=>new RegExp(`\\\\b${a}\\\\b`,"g")).some(a=>a.test(t))}function Ce(t){if(t==null)return null;let e=Ue(t);if(Ge(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 V=class extends Q{constructor(e,a){super(e,a),this.dataCaptureInstance=new J(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(n){s=void 0,i=C(n)}let o={type:"workerTaskId",command:e,id:a,payload:this.hasPayload(s)?s.payload:void 0};i!=null&&(o.error=i),this.postMessage(o,this.hasTransferables(s)?s.transferables:[])}onMessage(e){switch(e.data.command){case"sparkScanEmitErrorFeedback":{let{data: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"sparkScanSelectItemWithSmartScanSelection":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.sparkScanMode.selectItemWithSmartScanSelection()}),!0}case"sparkScanModeRemove":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.sparkScanMode.removeMode()),!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=Ce(a.functionAsString);this.dataCaptureInstance.barcodeFindMode.setTransformerFunction(r)}),!0}case"barcodeArForSettings":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeArMode.forSettings(a.settings)),!0}case"barcodeArModeRemove":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeArMode.removeMode()),!0}case"barcodeArSearchStart":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeArMode.start()}),!0;case"barcodeArSearchPause":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeArMode.pause()}),!0;case"barcodeArSearchStop":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeArMode.stop()}),!0;case"barcodeArSetEnabled":{let{data:a}=e;return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeArMode.setEnabled(a.enabled)}),!0}case"barcodeArApplySettings":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.barcodeArMode.applySettings(a.settings)}),!0}default:return super.onMessage(e)}}};var nr=new V(self,{get:()=>self.Module,set:t=>{self.Module=t}});function or(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=i({name:this.name})),this._dataCaptureWorker}get name(){return this._name}static async create(e){var a;let t=new r(e);return await t.workerCommand("setLogLevel",{level:(a=e.logLevel)!=null?a:Logger.Level.Debug}),await t.load(),t}async workerCommand(e,t,a){return new Promise((d,l)=>{let n=this.workerCommandId++;this.workerTasks.set(n,{resolve:d,reject:l,command:e});let c={...t,command:e,id:n};this.dataCaptureWorker.postMessage(c,a);})}};
|
|
2
2
|
export{o as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as defaultSparkCapture}from'../chunks/chunk-J3R5M6PN.js';export{a as
|
|
1
|
+
export{a as defaultSparkCapture}from'../chunks/chunk-J3R5M6PN.js';export{a as defaultBarcodeFind}from'../chunks/chunk-DHKABHFE.js';export{a as defaultSparkScan}from'../chunks/chunk-HDODW33D.js';export{a as defaultSymbologies}from'../chunks/chunk-LLMMR2TB.js';export{a as defaultBarcodeCapture}from'../chunks/chunk-3YNK2VJA.js';export{a as defaultBarcodeBatch}from'../chunks/chunk-CHU6GKFW.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as BarcodeFind}from'../chunks/chunk-
|
|
1
|
+
export{a as BarcodeFind}from'../chunks/chunk-R3MQ2GAV.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as BarcodeFindView}from'../chunks/chunk-
|
|
1
|
+
export{a as BarcodeFindView}from'../chunks/chunk-25EMNC65.js';
|
package/build/js/find/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as BarcodeFindView}from'../chunks/chunk-
|
|
1
|
+
export{a as BarcodeFindView}from'../chunks/chunk-25EMNC65.js';export{a as BarcodeFind}from'../chunks/chunk-R3MQ2GAV.js';export{a as BarcodeFindItem,c as BarcodeFindItemContent,b as BarcodeFindItemSearchOptions}from'../chunks/chunk-HTKUJZG2.js';export{a as BarcodeFindSettings}from'../chunks/chunk-7L2BXR3E.js';export{a as BarcodeFindViewSettings}from'../chunks/chunk-4PTIOBXM.js';
|
package/build/js/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{b as BarcodeArStatusIconAnnotation,a as BarcodeArStatusIconAnnotationAnchor}from'./chunks/chunk-HQNY4HRW.js';export{a as BarcodeStatusIconContainer}from'./chunks/chunk-SDQOQ2G3.js';export{a as SparkScanView}from'./chunks/chunk-
|
|
1
|
+
export{b as BarcodeArStatusIconAnnotation,a as BarcodeArStatusIconAnnotationAnchor}from'./chunks/chunk-HQNY4HRW.js';export{a as BarcodeStatusIconContainer}from'./chunks/chunk-SDQOQ2G3.js';export{a as SparkScanView}from'./chunks/chunk-JKXR4NRT.js';export{a as SparkScanViewState}from'./chunks/chunk-L6IZLBEM.js';export{a as SparkScanViewSettings}from'./chunks/chunk-AYZEMPSP.js';export{a as SparkScanToastSettings}from'./chunks/chunk-BRRT6GC7.js';export{a as SparkScanScanningMode,b as SparkScanScanningModeDefault,c as SparkScanScanningModeTarget}from'./chunks/chunk-SZUPDKV5.js';export{a as SparkScanSettings}from'./chunks/chunk-FT7V66CF.js';export{a as SparkScan}from'./chunks/chunk-74NQM2AV.js';export{a as SparkScanSession}from'./chunks/chunk-KEN6J62X.js';export{b as SparkScanBarcodeErrorFeedback,a as SparkScanBarcodeFeedback,c as SparkScanBarcodeSuccessFeedback}from'./chunks/chunk-PMTVYYAY.js';export{a as SparkScanPreviewBehavior}from'./chunks/chunk-DFK7AQTK.js';export{a as SparkScanScanningBehavior}from'./chunks/chunk-IMYBB4ZA.js';export{a as BarcodeFindView}from'./chunks/chunk-25EMNC65.js';export{a as BarcodeFind}from'./chunks/chunk-R3MQ2GAV.js';export{a as BarcodeFindItem,c as BarcodeFindItemContent,b as BarcodeFindItemSearchOptions}from'./chunks/chunk-HTKUJZG2.js';export{a as BarcodeFindSettings}from'./chunks/chunk-7L2BXR3E.js';export{a as BarcodeArSettings}from'./chunks/chunk-7I2Q5FJG.js';export{a as BarcodeArView}from'./chunks/chunk-PCEKTEBC.js';export{a as BarcodeArRectangleHighlight}from'./chunks/chunk-KMEGIFKL.js';export{a as BarcodeArResponsiveAnnotation}from'./chunks/chunk-QRG4J3CL.js';export{b as BarcodeArCircleHighlight,a as BarcodeArCircleHighlightPreset}from'./chunks/chunk-33EFB3RJ.js';export{d as BarcodeArInfoAnnotation,a as BarcodeArInfoAnnotationAnchor,b as BarcodeArInfoAnnotationWidthPreset}from'./chunks/chunk-I6NAW3SE.js';export{a as BarcodeArInfoAnnotationBodyComponent}from'./chunks/chunk-KELYPKGG.js';export{a as BarcodeArInfoAnnotationFooter}from'./chunks/chunk-FD4QVJDW.js';export{a as BarcodeArInfoAnnotationHeader}from'./chunks/chunk-MHRGFVAW.js';export{b as BarcodeArPopoverAnnotation,a as BarcodeArPopoverAnnotationAnchor}from'./chunks/chunk-OH47PSIL.js';export{a as BarcodeArPopoverAnnotationButton}from'./chunks/chunk-MVLSFC5H.js';export{a as BarcodeArAnnotationTrigger}from'./chunks/chunk-I6GJ7OYJ.js';export{a as BarcodeArViewSettings}from'./chunks/chunk-I3PK5YW4.js';export{a as BarcodeAr}from'./chunks/chunk-2DQ53VCG.js';export{a as BarcodeArSession}from'./chunks/chunk-SNPWBV7Y.js';export{a as BarcodeArFeedback}from'./chunks/chunk-JQT2V5S5.js';export{a as TrackedBarcodeView}from'./chunks/chunk-644ETSOC.js';export{a as barcodeCaptureLoader}from'./chunks/chunk-RY5EAOW4.js';export{a as BarcodeFindViewSettings}from'./chunks/chunk-4PTIOBXM.js';export{a as SparkScanMiniPreviewSize}from'./chunks/chunk-MVDPXLVX.js';export{a as BarcodeBatchSettings}from'./chunks/chunk-X244ZABK.js';export{a as BarcodeCapture}from'./chunks/chunk-UMB3USWQ.js';export{a as BarcodeCaptureFeedback}from'./chunks/chunk-WPSMXGDG.js';export{a as BarcodeCaptureOverlay}from'./chunks/chunk-J4OLO2BK.js';export{a as BarcodeCaptureSession}from'./chunks/chunk-CLT5UZMK.js';export{a as BarcodeCaptureSettings}from'./chunks/chunk-NCP2TCSC.js';export{a as SymbologyDescription}from'./chunks/chunk-4WOPZNZG.js';export{a as Range}from'./chunks/chunk-KVYPMF3V.js';export{a as SymbologySettings}from'./chunks/chunk-HD6YAO6W.js';export{a as ScanIntention}from'./chunks/chunk-JSVET3HU.js';export{a as LocalizedOnlyBarcode}from'./chunks/chunk-MUX2WWWH.js';export{a as ArucoDictionary}from'./chunks/chunk-DCUKY2F4.js';export{a as ArucoDictionaryPreset}from'./chunks/chunk-S5FTF2QC.js';export{a as ArucoMarker}from'./chunks/chunk-SSODGMFG.js';export{a as BarcodeBatch}from'./chunks/chunk-TZXO4VYP.js';export{a as BarcodeBatchAdvancedOverlay}from'./chunks/chunk-QBMLA2J7.js';export{b as BarcodeBatchBasicOverlay,a as BarcodeBatchBasicOverlayStyle}from'./chunks/chunk-HY32MAAC.js';export{a as BarcodeBatchSession}from'./chunks/chunk-JAFW53OO.js';export{a as TrackedBarcode}from'./chunks/chunk-3KF7PG5K.js';export{e as Barcode,c as Checksum,d as CompositeFlag,b as CompositeType,a as Symbology}from'./chunks/chunk-2BGFR4WR.js';export{a as StructuredAppendData}from'./chunks/chunk-IEE5MKEA.js';export{a as EncodingRange}from'./chunks/chunk-J4VFWBJ7.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-RY5EAOW4.js';
|
package/build/js/spark/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as SparkScanView}from'../chunks/chunk-
|
|
1
|
+
export{a as SparkScanView}from'../chunks/chunk-JKXR4NRT.js';export{a as SparkScanViewState}from'../chunks/chunk-L6IZLBEM.js';export{a as SparkScanViewSettings}from'../chunks/chunk-AYZEMPSP.js';export{a as SparkScanToastSettings}from'../chunks/chunk-BRRT6GC7.js';export{a as SparkScanScanningMode,b as SparkScanScanningModeDefault,c as SparkScanScanningModeTarget}from'../chunks/chunk-SZUPDKV5.js';export{a as SparkScanSettings}from'../chunks/chunk-FT7V66CF.js';export{a as SparkScan}from'../chunks/chunk-74NQM2AV.js';export{a as SparkScanSession}from'../chunks/chunk-KEN6J62X.js';export{b as SparkScanBarcodeErrorFeedback,a as SparkScanBarcodeFeedback,c as SparkScanBarcodeSuccessFeedback}from'../chunks/chunk-PMTVYYAY.js';export{a as SparkScanPreviewBehavior}from'../chunks/chunk-DFK7AQTK.js';export{a as SparkScanScanningBehavior}from'../chunks/chunk-IMYBB4ZA.js';export{a as SparkScanMiniPreviewSize}from'../chunks/chunk-MVDPXLVX.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as SparkScanView}from'../../chunks/chunk-
|
|
1
|
+
export{a as SparkScanView}from'../../chunks/chunk-JKXR4NRT.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{b as SparkScanViewMiniPreview,a as SparkScanViewMiniPreviewButtonType}from'../../chunks/chunk-
|
|
1
|
+
export{b as SparkScanViewMiniPreview,a as SparkScanViewMiniPreviewButtonType}from'../../chunks/chunk-QE5OQVRZ.js';
|
|
@@ -29,7 +29,6 @@ declare class SparkScanViewPresenter implements SparkScanListener, SparkScanDele
|
|
|
29
29
|
protected _stopScanningPromise: Promise<void> | null;
|
|
30
30
|
protected _dataCaptureView: DataCaptureView | null;
|
|
31
31
|
sparkScanViewSettings: SparkScanViewSettings;
|
|
32
|
-
private cameras;
|
|
33
32
|
private get camera();
|
|
34
33
|
private sparkScanOverlay?;
|
|
35
34
|
private smartScanSelectionOverlay?;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as SparkScanViewPresenter}from'../../chunks/chunk-
|
|
1
|
+
export{a as SparkScanViewPresenter}from'../../chunks/chunk-SG4Z3A7N.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as SparkScanViewTriggerButton}from'../../chunks/chunk-
|
|
1
|
+
export{a as SparkScanViewTriggerButton}from'../../chunks/chunk-P4XRHNJD.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as SparkScanView}from'../../chunks/chunk-
|
|
1
|
+
export{a as SparkScanView}from'../../chunks/chunk-JKXR4NRT.js';export{a as SparkScanViewTriggerButton}from'../../chunks/chunk-P4XRHNJD.js';export{a as SparkScanViewVisualFeedback}from'../../chunks/chunk-6KWMOMD7.js';export{b as SparkScanViewMiniPreview,a as SparkScanViewMiniPreviewButtonType}from'../../chunks/chunk-QE5OQVRZ.js';export{a as SparkScanViewToast}from'../../chunks/chunk-LWUFGA5M.js';export{a as SparkScanViewToolbar}from'../../chunks/chunk-6E42EK3T.js';export{a as SparkScanViewIcon}from'../../chunks/chunk-5Q3AHWJL.js';export{a as SparkScanViewPresenter}from'../../chunks/chunk-SG4Z3A7N.js';export{a as SparkScanViewStateManager}from'../../chunks/chunk-3OCPZ3OV.js';export{a as SparkScanViewState}from'../../chunks/chunk-L6IZLBEM.js';export{a as SparkScanViewFeedbackManager}from'../../chunks/chunk-L6BUOAGT.js';export{a as SparkScanViewPreferenceManager}from'../../chunks/chunk-QCD3RIT4.js';export{a as SparkScanViewSettings}from'../../chunks/chunk-AYZEMPSP.js';export{a as SparkScanToastSettings}from'../../chunks/chunk-BRRT6GC7.js';export{a as SparkScanMiniPreviewSize}from'../../chunks/chunk-MVDPXLVX.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as BarcodeCaptureWorkerManager}from'../chunks/chunk-
|
|
1
|
+
export{a as BarcodeCaptureWorkerManager}from'../chunks/chunk-WTX344JI.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as WorkerMain}from'../chunks/chunk-
|
|
1
|
+
export{a as WorkerMain}from'../chunks/chunk-T23H6QBZ.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'../chunks/chunk-
|
|
1
|
+
import {a}from'../chunks/chunk-T23H6QBZ.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-KHTSIZ5U.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scandit/web-datacapture-barcode",
|
|
3
|
-
"version": "8.1.
|
|
3
|
+
"version": "8.1.2",
|
|
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 --silent"
|
|
94
94
|
},
|
|
95
95
|
"peerDependencies": {
|
|
96
|
-
"@scandit/web-datacapture-core": "8.1.
|
|
96
|
+
"@scandit/web-datacapture-core": "8.1.2"
|
|
97
97
|
},
|
|
98
98
|
"dependencies": {
|
|
99
99
|
"@types/emscripten": "1.40.1"
|