UNPKG

dynamsoft-barcode-reader-bundle

Version:

Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR

11 lines 258 kB
/*! * Dynamsoft JavaScript Library * @product Dynamsoft Barcode Reader JS Edition Bundle * @website http://www.dynamsoft.com * @copyright Copyright 2026, Dynamsoft Corporation * @author Dynamsoft * @version 11.4.3000 * @fileoverview Dynamsoft JavaScript Library for Barcode Reader * More info on dbr JS: https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/ */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Dynamsoft=t.Dynamsoft||{})}(this,function(e){"use strict";function t(e,t,i,s){return new(i||(i=Promise))(function(n,r){function o(e){try{c(s.next(e))}catch(e){r(e)}}function a(e){try{c(s.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}c((s=s.apply(e,t||[])).next())})}function i(e,t,i,s){if("a"===i&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?s:"a"===i?s.call(e):s?s.value:t.get(e)}function s(e,t,i,s,n){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?n.call(e,i):n?n.value=i:t.set(e,i),i}var n,r;"function"==typeof SuppressedError&&SuppressedError,e.EnumScanMode=void 0,(n=e.EnumScanMode||(e.EnumScanMode={}))[n.SM_SINGLE=0]="SM_SINGLE",n[n.SM_MULTI_UNIQUE=1]="SM_MULTI_UNIQUE",e.EnumResultStatus=void 0,(r=e.EnumResultStatus||(e.EnumResultStatus={}))[r.RS_SUCCESS=0]="RS_SUCCESS",r[r.RS_CANCELLED=1]="RS_CANCELLED",r[r.RS_FAILED=2]="RS_FAILED";const o=e=>e&&"object"==typeof e&&"function"==typeof e.then,a=(async()=>{})().constructor;let c=class extends a{get status(){return this._s}get isPending(){return"pending"===this._s}get isFulfilled(){return"fulfilled"===this._s}get isRejected(){return"rejected"===this._s}get task(){return this._task}set task(e){let t;this._task=e,o(e)?t=e:"function"==typeof e&&(t=new a(e)),t&&(async()=>{try{const i=await t;e===this._task&&this.resolve(i)}catch(t){e===this._task&&this.reject(t)}})()}get isEmpty(){return null==this._task}constructor(e){let t,i;super((e,s)=>{t=e,i=s}),this._s="pending",this.resolve=e=>{this.isPending&&(o(e)?this.task=e:(this._s="fulfilled",t(e)))},this.reject=e=>{this.isPending&&(this._s="rejected",i(e))},this.task=e}};function l(e,t,i,s){if("a"===i&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?s:"a"===i?s.call(e):s?s.value:t.get(e)}function d(e,t,i,s,n){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?n.call(e,i):n?n.value=i:t.set(e,i),i}var u,h,_;"function"==typeof SuppressedError&&SuppressedError,function(e){e[e.BOPM_BLOCK=0]="BOPM_BLOCK",e[e.BOPM_UPDATE=1]="BOPM_UPDATE"}(u||(u={})),function(e){e[e.CCUT_AUTO=0]="CCUT_AUTO",e[e.CCUT_FULL_CHANNEL=1]="CCUT_FULL_CHANNEL",e[e.CCUT_Y_CHANNEL_ONLY=2]="CCUT_Y_CHANNEL_ONLY",e[e.CCUT_RGB_R_CHANNEL_ONLY=3]="CCUT_RGB_R_CHANNEL_ONLY",e[e.CCUT_RGB_G_CHANNEL_ONLY=4]="CCUT_RGB_G_CHANNEL_ONLY",e[e.CCUT_RGB_B_CHANNEL_ONLY=5]="CCUT_RGB_B_CHANNEL_ONLY"}(h||(h={})),function(e){e[e.IPF_BINARY=0]="IPF_BINARY",e[e.IPF_BINARYINVERTED=1]="IPF_BINARYINVERTED",e[e.IPF_GRAYSCALED=2]="IPF_GRAYSCALED",e[e.IPF_NV21=3]="IPF_NV21",e[e.IPF_RGB_565=4]="IPF_RGB_565",e[e.IPF_RGB_555=5]="IPF_RGB_555",e[e.IPF_RGB_888=6]="IPF_RGB_888",e[e.IPF_ARGB_8888=7]="IPF_ARGB_8888",e[e.IPF_RGB_161616=8]="IPF_RGB_161616",e[e.IPF_ARGB_16161616=9]="IPF_ARGB_16161616",e[e.IPF_ABGR_8888=10]="IPF_ABGR_8888",e[e.IPF_ABGR_16161616=11]="IPF_ABGR_16161616",e[e.IPF_BGR_888=12]="IPF_BGR_888",e[e.IPF_BINARY_8=13]="IPF_BINARY_8",e[e.IPF_NV12=14]="IPF_NV12",e[e.IPF_BINARY_8_INVERTED=15]="IPF_BINARY_8_INVERTED"}(_||(_={}));const m="undefined"==typeof self,g="function"==typeof importScripts,f=(()=>{if(!g){if(!m&&document.currentScript){let e=document.currentScript.src,t=e.indexOf("?");if(-1!=t)e=e.substring(0,t);else{let t=e.indexOf("#");-1!=t&&(e=e.substring(0,t))}return e.substring(0,e.lastIndexOf("/")+1)}return"./"}})(),p=e=>{if(null==e&&(e="./"),m||g);else{let t=document.createElement("a");t.href=e,e=t.href}return e.endsWith("/")||(e+="/"),e},E=e=>Object.prototype.toString.call(e),y=e=>Array.isArray?Array.isArray(e):"[object Array]"===E(e),I=e=>"number"==typeof e&&!Number.isNaN(e),v=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),R=e=>!(!v(e)||!I(e.width)||e.width<=0||!I(e.height)||e.height<=0||!I(e.stride)||e.stride<=0||!("format"in e)||"tag"in e&&!T(e.tag)),C=e=>!!R(e)&&e.bytes instanceof Uint8Array,T=e=>null===e||!!v(e)&&!!I(e.imageId)&&"type"in e,w=e=>!!v(e)&&!!I(e.x)&&!!I(e.y),S=async(e,t,i)=>await new Promise((s,n)=>{let r=new XMLHttpRequest;r.responseType=t,r.onloadstart=()=>{i&&i.loadstartCallback&&i.loadstartCallback()},r.onloadend=async e=>{i&&i.loadendCallback&&i.loadendCallback(),r.status<200||r.status>=300?n(r.status):s(r.response)},r.onprogress=e=>{i&&i.progressCallback&&i.progressCallback(e)},r.onerror=e=>{n(e)},r.open("GET",e,!0),r.send()}),A=e=>/^(https:\/\/www\.|http:\/\/www\.|https:\/\/|http:\/\/)|^[a-zA-Z0-9]{2,}(\.[a-zA-Z0-9]{2,})(\.[a-zA-Z0-9]{2,})?/.test(e),D=(e,t)=>{let i=e.split("."),s=t.split(".");for(let e=0;e<i.length&&e<s.length;++e){let t=i[e],n=s[e];if(t===n)continue;let r=parseInt(i[e]),o=parseInt(s[e]);return r===o||Number.isNaN(r)&&Number.isNaN(o)?t<n?-1:1:r<o||Number.isNaN(r)&&Number.isInteger(o)?-1:1}return i.length===s.length?0:i.length<s.length?-1:1},b=e=>{const t={};for(let i in e){if("rootDirectory"===i)continue;let s=i,n=e[s],r=n&&"object"==typeof n&&n.path?n.path:n,o=e.rootDirectory;if(o&&!o.endsWith("/")&&(o+="/"),"object"==typeof n&&n.isInternal)o&&(r=e[s].version?`${o}${P[s]}@${e[s].version}/${"dcvData"===s?"":"dist/"}${"ddv"===s?"engine":""}`:`${o}${P[s]}/${"dcvData"===s?"":"dist/"}${"ddv"===s?"engine":""}`);else{const i=/^@engineRootDirectory(\/?)/;if("string"==typeof r&&(r=r.replace(i,o||"")),"object"==typeof r&&"dwt"===s){const n=e[s].resourcesPath,r=e[s].serviceInstallerLocation;t[s]={resourcesPath:n.replace(i,o||""),serviceInstallerLocation:r.replace(i,o||"")};continue}}t[s]=p(r)}return t},L=async(e,t,i)=>await new Promise(async(s,n)=>{try{const n=t.split(".");let r=n[n.length-1];const o=await M(`image/${r}`,e);n.length<=1&&(r="png");const a=new File([o],t,{type:`image/${r}`});if(i){const e=URL.createObjectURL(a),i=document.createElement("a");i.href=e,i.download=t,i.click()}s(a)}catch(e){n()}}),O=e=>{C(e)&&(e=F(e));const t=document.createElement("canvas");return t.width=e.width,t.height=e.height,t.getContext("2d",{willReadFrequently:!0}).putImageData(e,0,0),t},N=(e,t)=>{C(t)&&(t=F(t));const i=O(t);let s=new Image,n=i.toDataURL(e);return s.src=n,s},M=async(e,t)=>{C(t)&&(t=F(t));const i=O(t);if("image/bmp"===e){const e=i.getContext("2d"),t=B(e.getImageData(0,0,i.width,i.height));return new Blob([t],{type:"image/bmp"})}return new Promise((t,s)=>{i.toBlob(e=>t(e),e)})},B=e=>{const t=e.width,i=e.height,s=e.data,n=4*Math.floor((24*t+31)/32),r=n*i,o=54+r,a=new ArrayBuffer(o),c=new DataView(a);c.setUint16(0,19778,!0),c.setUint32(2,o,!0),c.setUint16(6,0,!0),c.setUint16(8,0,!0),c.setUint32(10,54,!0),c.setUint32(14,40,!0),c.setInt32(18,t,!0),c.setInt32(22,-i,!0),c.setUint16(26,1,!0),c.setUint16(28,24,!0),c.setUint32(30,0,!0),c.setUint32(34,r,!0),c.setInt32(38,2835,!0),c.setInt32(42,2835,!0),c.setUint32(46,0,!0),c.setUint32(50,0,!0);let l=54;const d=n-3*t;for(let e=0;e<i;e++){for(let i=0;i<t;i++){const n=4*(e*t+i),r=s[n],o=s[n+1],a=s[n+2];c.setUint8(l++,a),c.setUint8(l++,o),c.setUint8(l++,r)}for(let e=0;e<d;e++)c.setUint8(l++,0)}return a},F=e=>{let t,i=e.bytes;if(!(i&&i instanceof Uint8Array))throw Error("Parameter type error");if(Number(e.format)===_.IPF_BGR_888){const e=i.length/3;t=new Uint8ClampedArray(4*e);for(let s=0;s<e;++s)t[4*s]=i[3*s],t[4*s+1]=i[3*s+1],t[4*s+2]=i[3*s+2],t[4*s+3]=255}else if(Number(e.format)===_.IPF_RGB_888){const e=i.length/3;t=new Uint8ClampedArray(4*e);for(let s=0;s<e;++s)t[4*s]=i[3*s+2],t[4*s+1]=i[3*s+1],t[4*s+2]=i[3*s],t[4*s+3]=255}else if(Number(e.format)===_.IPF_GRAYSCALED){const e=i.length;t=new Uint8ClampedArray(4*e);for(let s=0;s<e;s++)t[4*s]=t[4*s+1]=t[4*s+2]=i[s],t[4*s+3]=255}else if(Number(e.format)===_.IPF_BINARY_8||Number(e.format)===_.IPF_BINARY_8_INVERTED){const s=i.length,n=e.width,r=e.height,o=e.stride;t=new Uint8ClampedArray(n*r*4);for(let e=0;e<s;e++){let s=i[e],r=e%o,a=Math.floor(e/o);for(let e=0;e<8;e++){let i=r+e,o=4*(a*n+i);if(i>=n)break;t[o]=t[o+1]=t[o+2]=(128&s)/128*255,t[o+3]=255,s<<=1}}}else if(Number(e.format)===_.IPF_ABGR_8888){const e=i.length/4;t=new Uint8ClampedArray(i.length);for(let s=0;s<e;++s)t[4*s]=i[4*s],t[4*s+1]=i[4*s+1],t[4*s+2]=i[4*s+2],t[4*s+3]=i[4*s+3]}else if(Number(e.format)===_.IPF_ARGB_8888){const e=i.length/4;t=new Uint8ClampedArray(i.length);for(let s=0;s<e;++s)t[4*s]=i[4*s+2],t[4*s+1]=i[4*s+1],t[4*s+2]=i[4*s],t[4*s+3]=i[4*s+3]}else Number(e.format),_.IPF_BINARY_8_INVERTED;return new ImageData(t,e.width,e.height)},x=async e=>{let t=URL.createObjectURL(e);try{const e=await new Promise((e,i)=>{const s=new Image;s.onload=()=>e(s),s.onerror=i,s.src=t}),i=document.createElement("canvas"),s=i.getContext("2d");i.width=e.width,i.height=e.height,s.drawImage(e,0,0);return{bytes:Uint8Array.from(s.getImageData(0,0,i.width,i.height).data),width:i.width,height:i.height,stride:4*i.width,format:_.IPF_ABGR_8888}}finally{URL.revokeObjectURL(t)}},P={std:"dynamsoft-capture-vision-std",dip:"dynamsoft-image-processing",core:"dynamsoft-core",dnn:"dynamsoft-capture-vision-dnn",license:"dynamsoft-license",utility:"dynamsoft-utility",cvr:"dynamsoft-capture-vision-router",dbr:"dynamsoft-barcode-reader",dlr:"dynamsoft-label-recognizer",ddn:"dynamsoft-document-normalizer",dcp:"dynamsoft-code-parser",dcvData:"dynamsoft-capture-vision-data",dce:"dynamsoft-camera-enhancer",identityutility:"dynamsoft-identity-utility",ddv:"dynamsoft-document-viewer",dwt:"dwt",dbrBundle:"dynamsoft-barcode-reader-bundle",dcvBundle:"dynamsoft-capture-vision-bundle"};var k,U,V,G,W,j,Z,H;let q,Y,$,z,K,X=class e{get _isFetchingStarted(){return l(this,W,"f")}constructor(){k.add(this),U.set(this,[]),V.set(this,1),G.set(this,u.BOPM_BLOCK),W.set(this,!1),j.set(this,void 0),Z.set(this,h.CCUT_AUTO)}setErrorListener(e){}addImageToBuffer(e){var t;if(!C(e))throw new TypeError("Invalid 'image'.");if((null===(t=e.imageTag)||void 0===t?void 0:t.hasOwnProperty("imageId"))&&"number"==typeof e.imageTag.imageId&&this.hasImage(e.imageTag.imageId))throw new Error("Existed imageId.");if(l(this,U,"f").length>=l(this,V,"f"))switch(l(this,G,"f")){case u.BOPM_BLOCK:break;case u.BOPM_UPDATE:if(l(this,U,"f").push(e),v(l(this,j,"f"))&&I(l(this,j,"f").imageId)&&1==l(this,j,"f").keepInBuffer)for(;l(this,U,"f").length>l(this,V,"f");){const e=l(this,U,"f").findIndex(e=>{var t;return(null===(t=e.imageTag)||void 0===t?void 0:t.imageId)!==l(this,j,"f").imageId});l(this,U,"f").splice(e,1)}else l(this,U,"f").splice(0,l(this,U,"f").length-l(this,V,"f"))}else l(this,U,"f").push(e)}getImage(){if(0===l(this,U,"f").length)return null;let t;if(l(this,j,"f")&&I(l(this,j,"f").imageId)){const e=l(this,k,"m",H).call(this,l(this,j,"f").imageId);if(e<0)throw new Error(`Image with id ${l(this,j,"f").imageId} doesn't exist.`);t=l(this,U,"f").slice(e,e+1)[0]}else t=l(this,U,"f").pop();if([_.IPF_RGB_565,_.IPF_RGB_555,_.IPF_RGB_888,_.IPF_ARGB_8888,_.IPF_RGB_161616,_.IPF_ARGB_16161616,_.IPF_ABGR_8888,_.IPF_ABGR_16161616,_.IPF_BGR_888].includes(t.format)){if(l(this,Z,"f")===h.CCUT_RGB_R_CHANNEL_ONLY){e._onLog&&e._onLog("only get R channel data.");const i=new Uint8Array(t.width*t.height);for(let e=0;e<i.length;e++)switch(t.format){case _.IPF_RGB_565:case _.IPF_RGB_555:case _.IPF_RGB_888:case _.IPF_RGB_161616:i[e]=t.bytes[3*e+2];break;case _.IPF_ARGB_8888:case _.IPF_ARGB_16161616:i[e]=t.bytes[4*e+2];break;case _.IPF_BGR_888:i[e]=t.bytes[3*e];break;case _.IPF_ABGR_8888:case _.IPF_ABGR_16161616:i[e]=t.bytes[4*e]}t.bytes=i,t.stride=t.width,t.format=_.IPF_GRAYSCALED}else if(l(this,Z,"f")===h.CCUT_RGB_G_CHANNEL_ONLY){e._onLog&&e._onLog("only get G channel data.");const i=new Uint8Array(t.width*t.height);for(let e=0;e<i.length;e++)switch(t.format){case _.IPF_RGB_565:case _.IPF_RGB_555:case _.IPF_RGB_888:case _.IPF_RGB_161616:case _.IPF_BGR_888:i[e]=t.bytes[3*e+1];break;case _.IPF_ARGB_8888:case _.IPF_ARGB_16161616:case _.IPF_ABGR_8888:case _.IPF_ABGR_16161616:i[e]=t.bytes[4*e+1]}t.bytes=i,t.stride=t.width,t.format=_.IPF_GRAYSCALED}else if(l(this,Z,"f")===h.CCUT_RGB_B_CHANNEL_ONLY){e._onLog&&e._onLog("only get B channel data.");const i=new Uint8Array(t.width*t.height);for(let e=0;e<i.length;e++)switch(t.format){case _.IPF_RGB_565:case _.IPF_RGB_555:case _.IPF_RGB_888:case _.IPF_RGB_161616:i[e]=t.bytes[3*e];break;case _.IPF_ARGB_8888:case _.IPF_ARGB_16161616:i[e]=t.bytes[4*e];break;case _.IPF_BGR_888:i[e]=t.bytes[3*e+2];break;case _.IPF_ABGR_8888:case _.IPF_ABGR_16161616:i[e]=t.bytes[4*e+2]}t.bytes=i,t.stride=t.width,t.format=_.IPF_GRAYSCALED}}else[_.IPF_NV21,_.IPF_NV12].includes(t.format)&&e._onLog&&e._onLog("NV21 or NV12 is not supported.");return t}setNextImageToReturn(e,t){if(!((...e)=>0!==e.length&&e.every(e=>I(e)))(e))throw new TypeError("Invalid 'imageId'.");if(void 0!==t&&"[object Boolean]"!==E(t))throw new TypeError("Invalid 'keepInBuffer'.");d(this,j,{imageId:e,keepInBuffer:t},"f")}_resetNextReturnedImage(){d(this,j,null,"f")}hasImage(e){return l(this,k,"m",H).call(this,e)>=0}startFetching(){d(this,W,!0,"f")}stopFetching(){d(this,W,!1,"f")}setMaxImageCount(e){if("number"!=typeof e)throw new TypeError("Invalid 'count'.");if(e<1||Math.round(e)!==e)throw new Error("Invalid 'count'.");for(d(this,V,e,"f");l(this,U,"f")&&l(this,U,"f").length>e;)l(this,U,"f").shift()}getMaxImageCount(){return l(this,V,"f")}getImageCount(){return l(this,U,"f").length}clearBuffer(){l(this,U,"f").length=0}isBufferEmpty(){return 0===l(this,U,"f").length}setBufferOverflowProtectionMode(e){d(this,G,e,"f")}getBufferOverflowProtectionMode(){return l(this,G,"f")}setColourChannelUsageType(e){d(this,Z,e,"f")}getColourChannelUsageType(){return l(this,Z,"f")}};U=new WeakMap,V=new WeakMap,G=new WeakMap,W=new WeakMap,j=new WeakMap,Z=new WeakMap,k=new WeakSet,H=function(e){if("number"!=typeof e)throw new TypeError("Invalid 'imageId'.");return l(this,U,"f").findIndex(t=>{var i;return(null===(i=t.imageTag)||void 0===i?void 0:i.imageId)===e})},"undefined"!=typeof navigator&&(q=navigator,Y=q.userAgent,$=q.platform,z=q.mediaDevices),function(){if(!m){const e={Edge:{search:"Edg",verSearch:"Edg"},OPR:null,Chrome:null,Safari:{str:q.vendor,search:"Apple",verSearch:["Version","iPhone OS","CPU OS"]},Firefox:null,Explorer:{search:"MSIE",verSearch:"MSIE"}},t={HarmonyOS:null,Android:null,iPhone:null,iPad:null,Windows:{str:$,search:"Win"},Mac:{str:$},Linux:{str:$}};let i="unknownBrowser",s=0,n="unknownOS";for(let t in e){const n=e[t]||{};let r=n.str||Y,o=n.search||t,a=n.verStr||Y,c=n.verSearch||t;if(c instanceof Array||(c=[c]),-1!=r.indexOf(o)){i=t;for(let e of c){let t=a.indexOf(e);if(-1!=t){s=parseFloat(a.substring(t+e.length+1));break}}break}}for(let e in t){const i=t[e]||{};let s=i.str||Y,r=i.search||e;if(-1!=s.indexOf(r)){n=e;break}}"Linux"==n&&-1!=Y.indexOf("Windows NT")&&(n="HarmonyOS"),K={browser:i,version:s,OS:n}}m&&(K={browser:"ssr",version:0,OS:"ssr"})}();const Q="undefined"!=typeof WebAssembly&&Y&&!(/Safari/.test(Y)&&!/Chrome/.test(Y)&&/\(.+\s11_2_([2-6]).*\)/.test(Y)),J=!("undefined"==typeof Worker),ee=!(!z||!z.getUserMedia),te=async()=>{let e=!1;if(ee)try{(await z.getUserMedia({video:!0})).getTracks().forEach(e=>{e.stop()}),e=!0}catch(e){}return e};var ie,se,ne,re,oe,ae,ce,le,de;"Chrome"===K.browser&&K.version>66||"Safari"===K.browser&&K.version>13||"OPR"===K.browser&&K.version>43||"Edge"===K.browser&&K.version,function(e){e[e.CRIT_ORIGINAL_IMAGE=1]="CRIT_ORIGINAL_IMAGE",e[e.CRIT_BARCODE=2]="CRIT_BARCODE",e[e.CRIT_TEXT_LINE=4]="CRIT_TEXT_LINE",e[e.CRIT_DETECTED_QUAD=8]="CRIT_DETECTED_QUAD",e[e.CRIT_DESKEWED_IMAGE=16]="CRIT_DESKEWED_IMAGE",e[e.CRIT_PARSED_RESULT=32]="CRIT_PARSED_RESULT",e[e.CRIT_ENHANCED_IMAGE=64]="CRIT_ENHANCED_IMAGE"}(ie||(ie={})),function(e){e[e.CT_NORMAL_INTERSECTED=0]="CT_NORMAL_INTERSECTED",e[e.CT_T_INTERSECTED=1]="CT_T_INTERSECTED",e[e.CT_CROSS_INTERSECTED=2]="CT_CROSS_INTERSECTED",e[e.CT_NOT_INTERSECTED=3]="CT_NOT_INTERSECTED"}(se||(se={})),function(e){e[e.EC_OK=0]="EC_OK",e[e.EC_UNKNOWN=-1e4]="EC_UNKNOWN",e[e.EC_NO_MEMORY=-10001]="EC_NO_MEMORY",e[e.EC_NULL_POINTER=-10002]="EC_NULL_POINTER",e[e.EC_LICENSE_INVALID=-10003]="EC_LICENSE_INVALID",e[e.EC_LICENSE_EXPIRED=-10004]="EC_LICENSE_EXPIRED",e[e.EC_FILE_NOT_FOUND=-10005]="EC_FILE_NOT_FOUND",e[e.EC_FILE_TYPE_NOT_SUPPORTED=-10006]="EC_FILE_TYPE_NOT_SUPPORTED",e[e.EC_BPP_NOT_SUPPORTED=-10007]="EC_BPP_NOT_SUPPORTED",e[e.EC_INDEX_INVALID=-10008]="EC_INDEX_INVALID",e[e.EC_CUSTOM_REGION_INVALID=-10010]="EC_CUSTOM_REGION_INVALID",e[e.EC_IMAGE_READ_FAILED=-10012]="EC_IMAGE_READ_FAILED",e[e.EC_TIFF_READ_FAILED=-10013]="EC_TIFF_READ_FAILED",e[e.EC_DIB_BUFFER_INVALID=-10018]="EC_DIB_BUFFER_INVALID",e[e.EC_PDF_READ_FAILED=-10021]="EC_PDF_READ_FAILED",e[e.EC_PDF_DLL_MISSING=-10022]="EC_PDF_DLL_MISSING",e[e.EC_PAGE_NUMBER_INVALID=-10023]="EC_PAGE_NUMBER_INVALID",e[e.EC_CUSTOM_SIZE_INVALID=-10024]="EC_CUSTOM_SIZE_INVALID",e[e.EC_TIMEOUT=-10026]="EC_TIMEOUT",e[e.EC_JSON_PARSE_FAILED=-10030]="EC_JSON_PARSE_FAILED",e[e.EC_JSON_TYPE_INVALID=-10031]="EC_JSON_TYPE_INVALID",e[e.EC_JSON_KEY_INVALID=-10032]="EC_JSON_KEY_INVALID",e[e.EC_JSON_VALUE_INVALID=-10033]="EC_JSON_VALUE_INVALID",e[e.EC_JSON_NAME_KEY_MISSING=-10034]="EC_JSON_NAME_KEY_MISSING",e[e.EC_JSON_NAME_VALUE_DUPLICATED=-10035]="EC_JSON_NAME_VALUE_DUPLICATED",e[e.EC_TEMPLATE_NAME_INVALID=-10036]="EC_TEMPLATE_NAME_INVALID",e[e.EC_JSON_NAME_REFERENCE_INVALID=-10037]="EC_JSON_NAME_REFERENCE_INVALID",e[e.EC_PARAMETER_VALUE_INVALID=-10038]="EC_PARAMETER_VALUE_INVALID",e[e.EC_DOMAIN_NOT_MATCH=-10039]="EC_DOMAIN_NOT_MATCH",e[e.EC_LICENSE_KEY_NOT_MATCH=-10043]="EC_LICENSE_KEY_NOT_MATCH",e[e.EC_SET_MODE_ARGUMENT_ERROR=-10051]="EC_SET_MODE_ARGUMENT_ERROR",e[e.EC_GET_MODE_ARGUMENT_ERROR=-10055]="EC_GET_MODE_ARGUMENT_ERROR",e[e.EC_IRT_LICENSE_INVALID=-10056]="EC_IRT_LICENSE_INVALID",e[e.EC_FILE_SAVE_FAILED=-10058]="EC_FILE_SAVE_FAILED",e[e.EC_STAGE_TYPE_INVALID=-10059]="EC_STAGE_TYPE_INVALID",e[e.EC_IMAGE_ORIENTATION_INVALID=-10060]="EC_IMAGE_ORIENTATION_INVALID",e[e.EC_CONVERT_COMPLEX_TEMPLATE_ERROR=-10061]="EC_CONVERT_COMPLEX_TEMPLATE_ERROR",e[e.EC_CALL_REJECTED_WHEN_CAPTURING=-10062]="EC_CALL_REJECTED_WHEN_CAPTURING",e[e.EC_NO_IMAGE_SOURCE=-10063]="EC_NO_IMAGE_SOURCE",e[e.EC_READ_DIRECTORY_FAILED=-10064]="EC_READ_DIRECTORY_FAILED",e[e.EC_MODULE_NOT_FOUND=-10065]="EC_MODULE_NOT_FOUND",e[e.EC_MULTI_PAGES_NOT_SUPPORTED=-10066]="EC_MULTI_PAGES_NOT_SUPPORTED",e[e.EC_FILE_ALREADY_EXISTS=-10067]="EC_FILE_ALREADY_EXISTS",e[e.EC_CREATE_FILE_FAILED=-10068]="EC_CREATE_FILE_FAILED",e[e.EC_IMAGE_DATA_INVALID=-10069]="EC_IMAGE_DATA_INVALID",e[e.EC_IMAGE_SIZE_NOT_MATCH=-10070]="EC_IMAGE_SIZE_NOT_MATCH",e[e.EC_IMAGE_PIXEL_FORMAT_NOT_MATCH=-10071]="EC_IMAGE_PIXEL_FORMAT_NOT_MATCH",e[e.EC_SECTION_LEVEL_RESULT_IRREPLACEABLE=-10072]="EC_SECTION_LEVEL_RESULT_IRREPLACEABLE",e[e.EC_AXIS_DEFINITION_INCORRECT=-10073]="EC_AXIS_DEFINITION_INCORRECT",e[e.EC_RESULT_TYPE_MISMATCH_IRREPLACEABLE=-10074]="EC_RESULT_TYPE_MISMATCH_IRREPLACEABLE",e[e.EC_PDF_LIBRARY_LOAD_FAILED=-10075]="EC_PDF_LIBRARY_LOAD_FAILED",e[e.EC_UNSUPPORTED_JSON_KEY_WARNING=-10077]="EC_UNSUPPORTED_JSON_KEY_WARNING",e[e.EC_MODEL_FILE_NOT_FOUND=-10078]="EC_MODEL_FILE_NOT_FOUND",e[e.EC_PDF_LICENSE_NOT_FOUND=-10079]="EC_PDF_LICENSE_NOT_FOUND",e[e.EC_RECT_INVALID=-10080]="EC_RECT_INVALID",e[e.EC_TEMPLATE_VERSION_INCOMPATIBLE=-10081]="EC_TEMPLATE_VERSION_INCOMPATIBLE",e[e.EC_PORTRAIT_ZONE_NOT_FOUND=-10082]="EC_PORTRAIT_ZONE_NOT_FOUND",e[e.EC_NO_LICENSE=-2e4]="EC_NO_LICENSE",e[e.EC_LICENSE_BUFFER_FAILED=-20002]="EC_LICENSE_BUFFER_FAILED",e[e.EC_LICENSE_SYNC_FAILED=-20003]="EC_LICENSE_SYNC_FAILED",e[e.EC_DEVICE_NOT_MATCH=-20004]="EC_DEVICE_NOT_MATCH",e[e.EC_BIND_DEVICE_FAILED=-20005]="EC_BIND_DEVICE_FAILED",e[e.EC_INSTANCE_COUNT_OVER_LIMIT=-20008]="EC_INSTANCE_COUNT_OVER_LIMIT",e[e.EC_TRIAL_LICENSE=-20010]="EC_TRIAL_LICENSE",e[e.EC_LICENSE_VERSION_NOT_MATCH=-20011]="EC_LICENSE_VERSION_NOT_MATCH",e[e.EC_LICENSE_CACHE_USED=-20012]="EC_LICENSE_CACHE_USED",e[e.EC_LICENSE_AUTH_QUOTA_EXCEEDED=-20013]="EC_LICENSE_AUTH_QUOTA_EXCEEDED",e[e.EC_LICENSE_RESULTS_LIMIT_EXCEEDED=-20014]="EC_LICENSE_RESULTS_LIMIT_EXCEEDED",e[e.EC_BARCODE_FORMAT_INVALID=-30009]="EC_BARCODE_FORMAT_INVALID",e[e.EC_CUSTOM_MODULESIZE_INVALID=-30025]="EC_CUSTOM_MODULESIZE_INVALID",e[e.EC_TEXT_LINE_GROUP_LAYOUT_CONFLICT=-40101]="EC_TEXT_LINE_GROUP_LAYOUT_CONFLICT",e[e.EC_TEXT_LINE_GROUP_REGEX_CONFLICT=-40102]="EC_TEXT_LINE_GROUP_REGEX_CONFLICT",e[e.EC_QUADRILATERAL_INVALID=-50057]="EC_QUADRILATERAL_INVALID",e[e.EC_PANORAMA_LICENSE_INVALID=-70060]="EC_PANORAMA_LICENSE_INVALID",e[e.EC_RESOURCE_PATH_NOT_EXIST=-90001]="EC_RESOURCE_PATH_NOT_EXIST",e[e.EC_RESOURCE_LOAD_FAILED=-90002]="EC_RESOURCE_LOAD_FAILED",e[e.EC_CODE_SPECIFICATION_NOT_FOUND=-90003]="EC_CODE_SPECIFICATION_NOT_FOUND",e[e.EC_FULL_CODE_EMPTY=-90004]="EC_FULL_CODE_EMPTY",e[e.EC_FULL_CODE_PREPROCESS_FAILED=-90005]="EC_FULL_CODE_PREPROCESS_FAILED",e[e.EC_LICENSE_WARNING=-10076]="EC_LICENSE_WARNING",e[e.EC_BARCODE_READER_LICENSE_NOT_FOUND=-30063]="EC_BARCODE_READER_LICENSE_NOT_FOUND",e[e.EC_LABEL_RECOGNIZER_LICENSE_NOT_FOUND=-40103]="EC_LABEL_RECOGNIZER_LICENSE_NOT_FOUND",e[e.EC_DOCUMENT_NORMALIZER_LICENSE_NOT_FOUND=-50058]="EC_DOCUMENT_NORMALIZER_LICENSE_NOT_FOUND",e[e.EC_CODE_PARSER_LICENSE_NOT_FOUND=-90012]="EC_CODE_PARSER_LICENSE_NOT_FOUND"}(ne||(ne={})),function(e){e[e.GEM_SKIP=0]="GEM_SKIP",e[e.GEM_AUTO=1]="GEM_AUTO",e[e.GEM_GENERAL=2]="GEM_GENERAL",e[e.GEM_GRAY_EQUALIZE=4]="GEM_GRAY_EQUALIZE",e[e.GEM_GRAY_SMOOTH=8]="GEM_GRAY_SMOOTH",e[e.GEM_SHARPEN_SMOOTH=16]="GEM_SHARPEN_SMOOTH",e[e.GEM_REV=-2147483648]="GEM_REV",e[e.GEM_END=-1]="GEM_END"}(re||(re={})),function(e){e[e.GTM_SKIP=0]="GTM_SKIP",e[e.GTM_INVERTED=1]="GTM_INVERTED",e[e.GTM_ORIGINAL=2]="GTM_ORIGINAL",e[e.GTM_AUTO=4]="GTM_AUTO",e[e.GTM_REV=-2147483648]="GTM_REV",e[e.GTM_END=-1]="GTM_END"}(oe||(oe={})),function(e){e[e.ITT_FILE_IMAGE=0]="ITT_FILE_IMAGE",e[e.ITT_VIDEO_FRAME=1]="ITT_VIDEO_FRAME"}(ae||(ae={})),function(e){e[e.PDFRM_VECTOR=1]="PDFRM_VECTOR",e[e.PDFRM_RASTER=2]="PDFRM_RASTER",e[e.PDFRM_REV=-2147483648]="PDFRM_REV"}(ce||(ce={})),function(e){e[e.RDS_RASTERIZED_PAGES=0]="RDS_RASTERIZED_PAGES",e[e.RDS_EXTRACTED_IMAGES=1]="RDS_EXTRACTED_IMAGES"}(le||(le={})),function(e){e[e.CVS_NOT_VERIFIED=0]="CVS_NOT_VERIFIED",e[e.CVS_PASSED=1]="CVS_PASSED",e[e.CVS_FAILED=2]="CVS_FAILED"}(de||(de={}));const ue={IRUT_NULL:BigInt(0),IRUT_COLOUR_IMAGE:BigInt(1),IRUT_SCALED_COLOUR_IMAGE:BigInt(2),IRUT_GRAYSCALE_IMAGE:BigInt(4),IRUT_TRANSOFORMED_GRAYSCALE_IMAGE:BigInt(8),IRUT_ENHANCED_GRAYSCALE_IMAGE:BigInt(16),IRUT_PREDETECTED_REGIONS:BigInt(32),IRUT_BINARY_IMAGE:BigInt(64),IRUT_TEXTURE_DETECTION_RESULT:BigInt(128),IRUT_TEXTURE_REMOVED_GRAYSCALE_IMAGE:BigInt(256),IRUT_TEXTURE_REMOVED_BINARY_IMAGE:BigInt(512),IRUT_CONTOURS:BigInt(1024),IRUT_LINE_SEGMENTS:BigInt(2048),IRUT_TEXT_ZONES:BigInt(4096),IRUT_TEXT_REMOVED_BINARY_IMAGE:BigInt(8192),IRUT_CANDIDATE_BARCODE_ZONES:BigInt(16384),IRUT_LOCALIZED_BARCODES:BigInt(32768),IRUT_SCALED_BARCODE_IMAGE:BigInt(65536),IRUT_DEFORMATION_RESISTED_BARCODE_IMAGE:BigInt(1<<17),IRUT_COMPLEMENTED_BARCODE_IMAGE:BigInt(1<<18),IRUT_DECODED_BARCODES:BigInt(1<<19),IRUT_LONG_LINES:BigInt(1<<20),IRUT_CORNERS:BigInt(1<<21),IRUT_CANDIDATE_QUAD_EDGES:BigInt(1<<22),IRUT_DETECTED_QUADS:BigInt(1<<23),IRUT_LOCALIZED_TEXT_LINES:BigInt(1<<24),IRUT_RECOGNIZED_TEXT_LINES:BigInt(1<<25),IRUT_DESKEWED_IMAGE:BigInt(1<<26),IRUT_SHORT_LINES:BigInt(1<<27),IRUT_RAW_TEXT_LINES:BigInt(1<<28),IRUT_LOGIC_LINES:BigInt(1<<29),IRUT_ENHANCED_IMAGE:BigInt(Math.pow(2,30)),IRUT_ALL:BigInt("0xFFFFFFFFFFFFFFFF")};var he,_e,me,ge,fe;!function(e){e[e.ROET_PREDETECTED_REGION=0]="ROET_PREDETECTED_REGION",e[e.ROET_LOCALIZED_BARCODE=1]="ROET_LOCALIZED_BARCODE",e[e.ROET_DECODED_BARCODE=2]="ROET_DECODED_BARCODE",e[e.ROET_LOCALIZED_TEXT_LINE=3]="ROET_LOCALIZED_TEXT_LINE",e[e.ROET_RECOGNIZED_TEXT_LINE=4]="ROET_RECOGNIZED_TEXT_LINE",e[e.ROET_DETECTED_QUAD=5]="ROET_DETECTED_QUAD",e[e.ROET_DESKEWED_IMAGE=6]="ROET_DESKEWED_IMAGE",e[e.ROET_SOURCE_IMAGE=7]="ROET_SOURCE_IMAGE",e[e.ROET_TARGET_ROI=8]="ROET_TARGET_ROI",e[e.ROET_ENHANCED_IMAGE=9]="ROET_ENHANCED_IMAGE",e[e.ROET_AUXILIARY_REGION=10]="ROET_AUXILIARY_REGION"}(he||(he={})),function(e){e[e.ST_NULL=0]="ST_NULL",e[e.ST_REGION_PREDETECTION=1]="ST_REGION_PREDETECTION",e[e.ST_BARCODE_LOCALIZATION=2]="ST_BARCODE_LOCALIZATION",e[e.ST_BARCODE_DECODING=3]="ST_BARCODE_DECODING",e[e.ST_TEXT_LINE_LOCALIZATION=4]="ST_TEXT_LINE_LOCALIZATION",e[e.ST_TEXT_LINE_RECOGNITION=5]="ST_TEXT_LINE_RECOGNITION",e[e.ST_DOCUMENT_DETECTION=6]="ST_DOCUMENT_DETECTION",e[e.ST_DOCUMENT_DESKEWING=7]="ST_DOCUMENT_DESKEWING",e[e.ST_IMAGE_ENHANCEMENT=8]="ST_IMAGE_ENHANCEMENT"}(_e||(_e={})),function(e){e[e.IFF_JPEG=0]="IFF_JPEG",e[e.IFF_PNG=1]="IFF_PNG",e[e.IFF_BMP=2]="IFF_BMP",e[e.IFF_PDF=3]="IFF_PDF"}(me||(me={})),function(e){e[e.ICDM_NEAR=0]="ICDM_NEAR",e[e.ICDM_FAR=1]="ICDM_FAR"}(ge||(ge={})),function(e){e.MN_DYNAMSOFT_CAPTURE_VISION_ROUTER="cvr",e.MN_DYNAMSOFT_CORE="core",e.MN_DYNAMSOFT_LICENSE="license",e.MN_DYNAMSOFT_IMAGE_PROCESSING="dip",e.MN_DYNAMSOFT_UTILITY="utility",e.MN_DYNAMSOFT_BARCODE_READER="dbr",e.MN_DYNAMSOFT_DOCUMENT_NORMALIZER="ddn",e.MN_DYNAMSOFT_LABEL_RECOGNIZER="dlr",e.MN_DYNAMSOFT_CAPTURE_VISION_DATA="dcvData",e.MN_DYNAMSOFT_NEURAL_NETWORK="dnn",e.MN_DYNAMSOFT_CODE_PARSER="dcp",e.MN_DYNAMSOFT_CAMERA_ENHANCER="dce",e.MN_DYNAMSOFT_CAPTURE_VISION_STD="std"}(fe||(fe={}));const pe={},Ee=async e=>{let t="string"==typeof e?[e]:e,i=[];for(let e of t)i.push(pe[e]=pe[e]||new c);await Promise.all(i)},ye=async(e,t)=>{let i,s="string"==typeof e?[e]:e,n=[];for(let e of s){let s;n.push(s=pe[e]=pe[e]||new c(i=i||t())),s.isEmpty&&(s.task=i=i||t())}await Promise.all(n)};let Ie,ve=0;const Re=()=>ve++,Ce={};let Te;const we=e=>{Te=e,Ie&&Ie.postMessage({type:"setBLog",body:{value:!!e}})};let Se=!1;const Ae=e=>{Se=e,Ie&&Ie.postMessage({type:"setBDebug",body:{value:!!e}})},De={},be={},Le={dip:{wasm:!0}},Oe={std:{version:"2.0.0",path:p(f+"../../dynamsoft-capture-vision-std@2.0.0/dist/"),isInternal:!0},core:{version:"4.4.30-dev-20260629163026",path:f,isInternal:!0}};let Ne=5;"undefined"!=typeof navigator&&(Ne=navigator.hardwareConcurrency?navigator.hardwareConcurrency-1:5),Ce[-3]=async e=>{Me.onWasmLoadProgressChanged&&Me.onWasmLoadProgressChanged(e.resourcesPath,e.tag,{loaded:e.loaded,total:e.total})};class Me{static get engineResourcePaths(){return Oe}static set engineResourcePaths(e){Object.assign(Oe,e)}static get bSupportDce4Module(){return this._bSupportDce4Module}static get bSupportIRTModule(){return this._bSupportIRTModule}static get versions(){return this._versions}static get _onLog(){return Te}static set _onLog(e){we(e)}static get _bDebug(){return Se}static set _bDebug(e){Ae(e)}static get _workerName(){return`${Me._bundleEnv.toLowerCase()}.bundle.worker.js`}static get wasmLoadOptions(){return Me._wasmLoadOptions}static set wasmLoadOptions(e){Object.assign(Me._wasmLoadOptions,e)}static isModuleLoaded(e){return e=(e=e||"core").toLowerCase(),!!pe[e]&&pe[e].isFulfilled}static async loadWasm(){return await(async()=>{let e,t;e instanceof Array||(e=e?[e]:[]);let i=pe.core;t=!i||i.isEmpty,t||await Ee("core");let s=new Map;const n=e=>{if(e=e.toLowerCase(),fe.MN_DYNAMSOFT_CAPTURE_VISION_STD==e||fe.MN_DYNAMSOFT_CORE==e)return;let t=Le[e].deps;if(null==t?void 0:t.length)for(let e of t)n(e);let i=pe[e];s.has(e)||s.set(e,!i||i.isEmpty)};for(let t of e)n(t);let r=[];t&&r.push("core"),r.push(...s.keys());const o=[...s.entries()].filter(e=>!e[1]).map(e=>e[0]);await ye(r,async()=>{const e=[...s.entries()].filter(e=>e[1]).map(e=>e[0]);await Ee(o);const i=b(Oe),n={};for(let t of e)n[t]=Le[t];const r={engineResourcePaths:i,autoResources:n,names:e,_bundleEnv:Me._bundleEnv,wasmLoadOptions:Me.wasmLoadOptions};let a=new c;if(t){r.needLoadCore=!0;let e=i[`${Me._bundleEnv.toLowerCase()}Bundle`]+Me._workerName;e.startsWith(location.origin)||(e=await fetch(e).then(e=>e.blob()).then(e=>URL.createObjectURL(e))),Ie=new Worker(e),Ie.onerror=e=>{let t=new Error(e.message);a.reject(t)},Ie.addEventListener("message",e=>{let t=e.data?e.data:e,i=t.type,s=t.id,n=t.body;switch(i){case"log":Te&&Te(t.message);break;case"warning":console.warn(t.message);break;case"task":try{Ce[s]&&(Ce[s](n),delete Ce[s])}catch(e){throw delete Ce[s],e}break;case"event":try{Ce[s](n)}catch(e){throw e}break;default:console.log(e)}}),r.bLog=!!Te,r.bd=Se,r.dm=location.origin.startsWith("http")?location.origin:"https://localhost"}else await Ee("core");let l=ve++;Ce[l]=e=>{if(e.success)Object.assign(De,e.versions),"{}"!==JSON.stringify(e.versions)&&(Me._versions=e.versions),Me.loadedWasmType=e.loadedWasmType,a.resolve(void 0);else{const t=Error(e.message);e.stack&&(t.stack=e.stack),a.reject(t)}},Ie.postMessage({type:"loadWasm",id:l,body:r}),await a})})()}static async detectEnvironment(){return await(async()=>({wasm:Q,worker:J,getUserMedia:ee,camera:await te(),browser:K.browser,version:K.version,OS:K.OS}))()}static async getModuleVersion(){return await new Promise((e,t)=>{let i=Re();Ce[i]=async i=>{if(i.success)return e(i.versions);{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}},Ie.postMessage({type:"getModuleVersion",id:i})})}static getVersion(){return`4.4.30-dev-20260629163026(Worker: ${De.core&&De.core.worker||"Not Loaded"}, Wasm: ${De.core&&De.core.wasm||"Not Loaded"})`}static enableLogging(){X._onLog=console.log,Me._onLog=console.log}static disableLogging(){X._onLog=null,Me._onLog=null}static async cfd(e){return await new Promise((t,i)=>{let s=Re();Ce[s]=async e=>{if(e.success)return t();{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,i(t)}},Ie.postMessage({type:"cfd",id:s,body:{count:e}})})}}Me._bSupportDce4Module=-1,Me._bSupportIRTModule=-1,Me._versions=null,Me._bundleEnv="DCV",Me._wasmLoadOptions={wasmType:"auto",pthreadPoolSize:Ne},Me.loadedWasmType="ml-simd-pthread",Me.browserInfo=K;var Be=Object.freeze({__proto__:null,CoreModule:Me,get EnumBufferOverflowProtectionMode(){return u},get EnumCapturedResultItemType(){return ie},get EnumColourChannelUsageType(){return h},get EnumCornerType(){return se},get EnumCrossVerificationStatus(){return de},get EnumErrorCode(){return ne},get EnumGrayscaleEnhancementMode(){return re},get EnumGrayscaleTransformationMode(){return oe},get EnumImageCaptureDistanceMode(){return ge},get EnumImageFileFormat(){return me},get EnumImagePixelFormat(){return _},get EnumImageTagType(){return ae},EnumIntermediateResultUnitType:ue,get EnumModuleName(){return fe},get EnumPDFReadingMode(){return ce},get EnumRasterDataSource(){return le},get EnumRegionObjectElementType(){return he},get EnumSectionType(){return _e},ImageSourceAdapter:X,_saveToFile:L,_toBlob:M,_toCanvas:O,_toImage:N,get bDebug(){return Se},blobToDsImage:x,checkIsLink:A,compareVersion:D,createImageData:F,d:async(e,t)=>{const i=atob(e),s=new Uint8Array(i.length);for(let e=0;e<i.length;e++)s[e]=i.charCodeAt(e);const n=s.slice(0,12),r=s.slice(12),o=new TextEncoder,a=await crypto.subtle.importKey("raw",o.encode(t),"PBKDF2",!1,["deriveKey"]),c=await crypto.subtle.deriveKey({name:"PBKDF2",salt:o.encode("salt-for-key-derivation"),iterations:1e5,hash:"SHA-256"},a,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"]),l=await crypto.subtle.decrypt({name:"AES-GCM",iv:n,tagLength:128},c,r);return(new TextDecoder).decode(l)},doOrWaitAsyncDependency:ye,e:async(e,t)=>{const i=new TextEncoder,s=await crypto.subtle.importKey("raw",i.encode(t),"PBKDF2",!1,["deriveKey"]),n=await crypto.subtle.deriveKey({name:"PBKDF2",salt:i.encode("salt-for-key-derivation"),iterations:1e5,hash:"SHA-256"},s,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"]),r=crypto.getRandomValues(new Uint8Array(12)),o=await crypto.subtle.encrypt({name:"AES-GCM",iv:r,tagLength:128},n,i.encode(e)),a=new Uint8Array(r.length+o.byteLength);return a.set(r),a.set(new Uint8Array(o),r.length),btoa(String.fromCharCode.apply(null,a))},encodeBMP:B,getNextTaskID:Re,handleEngineResourcePaths:b,imagePtrToUint8Array:async e=>await new Promise((t,i)=>{let s=Re();Ce[s]=async e=>{if(e.success)return t(e.u8);{const t=Error(e.message);e.stack&&(t.stack=e.stack),i(t)}},Ie.postMessage({type:"imagePtrToUint8Array",id:s,body:{data:e}})}),innerVersions:De,isArc:e=>!(!v(e)||!I(e.x)||!I(e.y)||!I(e.radius)||e.radius<0||!I(e.startAngle)||!I(e.endAngle)),isContour:e=>!!v(e)&&!!y(e.points)&&0!=e.points.length&&!e.points.some(e=>!w(e)),isDSImageData:C,isDSRect:e=>!(!v(e)||!I(e.left)||e.left<0||!I(e.top)||e.top<0||!I(e.right)||e.right<0||!I(e.bottom)||e.bottom<0||e.left>=e.right||e.top>=e.bottom),isDsImageKeyValue:(e,t)=>"bytes"===e&&"object"==typeof t&&"number"==typeof t.ptr&&"number"==typeof t.length,isImageTag:T,isLineSegment:e=>!(!v(e)||!w(e.startPoint)||!w(e.endPoint)||e.startPoint.x==e.endPoint.x&&e.startPoint.y==e.endPoint.y),isObject:v,isOriginalDsImageData:e=>!(!R(e)||!I(e.bytes.length)&&!I(e.bytes.ptr)),isPoint:w,isPolygon:e=>!!v(e)&&!!y(e.points)&&0!=e.points.length&&!e.points.some(e=>!w(e)),isQuad:e=>!!v(e)&&!!y(e.points)&&0!=e.points.length&&4==e.points.length&&!e.points.some(e=>!w(e)),isRect:e=>!(!v(e)||!I(e.x)||!I(e.y)||!I(e.width)||e.width<0||!I(e.height)||e.height<0),isSimdSupported:()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])),mapAsyncDependency:pe,mapPackageRegister:be,mapTaskCallBack:Ce,get onLog(){return Te},productNameMap:P,requestResource:S,resolveDsImageData:async e=>await new Promise((t,i)=>{let s=Re();Ce[s]=async e=>{if(e.success)return t(e.result);{const t=Error(e.message);e.stack&&(t.stack=e.stack),i(t)}},Ie.postMessage({type:"resolveDsImageData",id:s,body:{point:e}})}),setBDebug:Ae,setOnLog:we,waitAsyncDependency:Ee,get worker(){return Ie},workerAutoResources:Le}),Fe={license:"",scanMode:e.EnumScanMode.SM_SINGLE,templateFilePath:void 0,utilizedTemplateNames:{single:"ReadBarcodes_SpeedFirst",multi_unique:"ReadBarcodes_SpeedFirst",image:"ReadBarcodes_ReadRateFirst"},engineResourcePaths:Me.engineResourcePaths,barcodeFormats:void 0,duplicateForgetTime:3e3,container:void 0,onUniqueBarcodeScanned:void 0,showResultView:void 0,showUploadImageButton:!1,showPoweredByDynamsoft:!0,autoStartCapturing:!0,uiPath:void 0,onInitPrepare:void 0,onInitReady:void 0,onCameraOpen:void 0,onCameraOpenFailed:void 0,onCaptureStart:void 0,scannerViewConfig:{container:void 0,showCloseButton:!0,mirrorFrontCamera:!0,cameraSwitchControl:"hidden",showFlashButton:!1},resultViewConfig:{container:void 0,toolbarButtonsConfig:{clear:{label:"Clear",className:"btn-clear",isHidden:!1},done:{label:"Done",className:"btn-done",isHidden:!1}}}};const xe=e=>e&&"object"==typeof e&&"function"==typeof e.then,Pe=(async()=>{})().constructor;class ke extends Pe{get status(){return this._s}get isPending(){return"pending"===this._s}get isFulfilled(){return"fulfilled"===this._s}get isRejected(){return"rejected"===this._s}get task(){return this._task}set task(e){let t;this._task=e,xe(e)?t=e:"function"==typeof e&&(t=new Pe(e)),t&&(async()=>{try{const i=await t;e===this._task&&this.resolve(i)}catch(t){e===this._task&&this.reject(t)}})()}get isEmpty(){return null==this._task}constructor(e){let t,i;super((e,s)=>{t=e,i=s}),this._s="pending",this.resolve=e=>{this.isPending&&(xe(e)?this.task=e:(this._s="fulfilled",t(e)))},this.reject=e=>{this.isPending&&(this._s="rejected",i(e))},this.task=e}}function Ue(e,t,i,s){if("a"===i&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?s:"a"===i?s.call(e):s?s.value:t.get(e)}function Ve(e,t,i,s,n){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?n.call(e,i):n?n.value=i:t.set(e,i),i}"function"==typeof SuppressedError&&SuppressedError;const Ge=e=>e&&"object"==typeof e&&"function"==typeof e.then,We=(async()=>{})().constructor;let je=class extends We{get status(){return this._s}get isPending(){return"pending"===this._s}get isFulfilled(){return"fulfilled"===this._s}get isRejected(){return"rejected"===this._s}get task(){return this._task}set task(e){let t;this._task=e,Ge(e)?t=e:"function"==typeof e&&(t=new We(e)),t&&(async()=>{try{const i=await t;e===this._task&&this.resolve(i)}catch(t){e===this._task&&this.reject(t)}})()}get isEmpty(){return null==this._task}constructor(e){let t,i;super((e,s)=>{t=e,i=s}),this._s="pending",this.resolve=e=>{this.isPending&&(Ge(e)?this.task=e:(this._s="fulfilled",t(e)))},this.reject=e=>{this.isPending&&(this._s="rejected",i(e))},this.task=e}},Ze=class{constructor(e){this._cvr=e}async getMaxBufferedItems(){return await new Promise((e,t)=>{let i=Re();Ce[i]=async i=>{if(i.success)return e(i.count);{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}},Ie.postMessage({type:"cvr_getMaxBufferedItems",id:i,instanceID:this._cvr._instanceID})})}async setMaxBufferedItems(e){return await new Promise((t,i)=>{let s=Re();Ce[s]=async e=>{if(e.success)return t();{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,i(t)}},Ie.postMessage({type:"cvr_setMaxBufferedItems",id:s,instanceID:this._cvr._instanceID,body:{count:e}})})}async getBufferedCharacterItemSet(){return await new Promise((e,t)=>{let i=Re();Ce[i]=async i=>{if(i.success)return e(i.itemSet);{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}},Ie.postMessage({type:"cvr_getBufferedCharacterItemSet",id:i,instanceID:this._cvr._instanceID})})}};var He={onTaskResultsReceived:!1,onTargetROIResultsReceived:!1,onTaskResultsReceivedForDce:!1,onPredetectedRegionsReceived:!1,onLocalizedBarcodesReceived:!1,onDecodedBarcodesReceived:!1,onLocalizedTextLinesReceived:!1,onRecognizedTextLinesReceived:!1,onDetectedQuadsReceived:!1,onDeskewedImageReceived:!1,onEnhancedImageReceived:!1,onColourImageUnitReceived:!1,onScaledColourImageUnitReceived:!1,onGrayscaleImageUnitReceived:!1,onTransformedGrayscaleImageUnitReceived:!1,onEnhancedGrayscaleImageUnitReceived:!1,onBinaryImageUnitReceived:!1,onTextureDetectionResultUnitReceived:!1,onTextureRemovedGrayscaleImageUnitReceived:!1,onTextureRemovedBinaryImageUnitReceived:!1,onContoursUnitReceived:!1,onLineSegmentsUnitReceived:!1,onTextZonesUnitReceived:!1,onTextRemovedBinaryImageUnitReceived:!1,onRawTextLinesUnitReceived:!1,onLongLinesUnitReceived:!1,onCornersUnitReceived:!1,onCandidateQuadEdgesUnitReceived:!1,onCandidateBarcodeZonesUnitReceived:!1,onScaledBarcodeImageUnitReceived:!1,onDeformationResistedBarcodeImageUnitReceived:!1,onComplementedBarcodeImageUnitReceived:!1,onShortLinesUnitReceived:!1,onLogicLinesUnitReceived:!1};const qe=e=>{for(let t in e._irrRegistryState)e._irrRegistryState[t]=!1;for(let t of e._intermediateResultReceiverSet)if(t.isDce||t.isFilter)e._irrRegistryState.onTaskResultsReceivedForDce=!0;else for(let i in t)e._irrRegistryState[i]||(e._irrRegistryState[i]=!!t[i])};let Ye=class{constructor(e){this._irrRegistryState=He,this._intermediateResultReceiverSet=new Set,this._cvr=e}async addResultReceiver(e){if("object"!=typeof e)throw new Error("Invalid receiver.");this._intermediateResultReceiverSet.add(e),qe(this);let t=-1,i={};if(!e.isDce&&!e.isFilter){if(!e._observedResultUnitTypes||!e._observedTaskMap)throw new Error("Invalid Intermediate Result Receiver.");t=e._observedResultUnitTypes,e._observedTaskMap.forEach((e,t)=>{i[t]=e}),e._observedTaskMap.clear()}return await new Promise((e,s)=>{let n=Re();Ce[n]=async t=>{if(t.success)return e();{let e=new Error(t.message);return e.stack=t.stack+"\n"+e.stack,s(e)}},Ie.postMessage({type:"cvr_setIrrRegistry",id:n,instanceID:this._cvr._instanceID,body:{receiverObj:this._irrRegistryState,observedResultUnitTypes:t.toString(),observedTaskMap:i}})})}async removeResultReceiver(e){return this._intermediateResultReceiverSet.delete(e),qe(this),await new Promise((e,t)=>{let i=Re();Ce[i]=async i=>{if(i.success)return e();{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}},Ie.postMessage({type:"cvr_setIrrRegistry",id:i,instanceID:this._cvr._instanceID,body:{receiverObj:this._irrRegistryState}})})}async removeAllResultReceivers(){for(const e of this._intermediateResultReceiverSet)e.hasOwnProperty("isFilter")||e.hasOwnProperty("isDce")||this._intermediateResultReceiverSet.delete(e);return qe(this),await new Promise((e,t)=>{let i=Re();Ce[i]=async i=>{if(i.success)return e();{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}},Ie.postMessage({type:"cvr_setIrrRegistry",id:i,instanceID:this._cvr._instanceID,body:{receiverObj:this._irrRegistryState}})})}getOriginalImage(){return this._cvr.provideDsImage}};const $e="undefined"==typeof self,ze="function"==typeof importScripts,Ke=(()=>{if(!ze){if(!$e&&document.currentScript){let e=document.currentScript.src,t=e.indexOf("?");if(-1!=t)e=e.substring(0,t);else{let t=e.indexOf("#");-1!=t&&(e=e.substring(0,t))}return e.substring(0,e.lastIndexOf("/")+1)}return"./"}})(),Xe=e=>{if(null==e&&(e="./"),$e||ze);else{let t=document.createElement("a");t.href=e,e=t.href}return e.endsWith("/")||(e+="/"),e};var Qe;Me.engineResourcePaths.cvr={version:"3.4.30-dev-20260629163033",path:Ke,isInternal:!0},Le.cvr={js:!0,wasm:!0,deps:[fe.MN_DYNAMSOFT_LICENSE,fe.MN_DYNAMSOFT_IMAGE_PROCESSING,fe.MN_DYNAMSOFT_NEURAL_NETWORK]},Le.dnn={wasm:!0,deps:[fe.MN_DYNAMSOFT_IMAGE_PROCESSING]},be.cvr={};const Je="2.0.0";"string"!=typeof Me.engineResourcePaths.std&&D(Me.engineResourcePaths.std.version,Je)<0&&(Me.engineResourcePaths.std={version:Je,path:Xe(Ke+`../../dynamsoft-capture-vision-std@${Je}/dist/`),isInternal:!0});const et="3.0.10";(!Me.engineResourcePaths.dip||"string"!=typeof Me.engineResourcePaths.dip&&D(Me.engineResourcePaths.dip.version,et)<0)&&(Me.engineResourcePaths.dip={version:et,path:Xe(Ke+`../../dynamsoft-image-processing@${et}/dist/`),isInternal:!0});const tt="2.0.10";(!Me.engineResourcePaths.dnn||"string"!=typeof Me.engineResourcePaths.dnn&&D(Me.engineResourcePaths.dnn.version,tt)<0)&&(Me.engineResourcePaths.dnn={version:tt,path:Xe(Ke+`../../dynamsoft-capture-vision-dnn@${tt}/dist/`),isInternal:!0});let it=class{static getVersion(){return this._version}};function st(e,t){if(e){if(e.sourceLocation){const i=e.sourceLocation.points;for(let e of i)e.x=e.x/t,e.y=e.y/t}if(e.location){const i=e.location.points;for(let e of i)e.x=e.x/t,e.y=e.y/t}st(e.referencedItem,t)}}function nt(e){if(e.disposed)throw new Error('"CaptureVisionRouter" instance has been disposed')}function rt(e){return{type:ie.CRIT_ORIGINAL_IMAGE,referenceItem:null,targetROIDefName:"",taskName:"",imageData:e,toCanvas:()=>O(e),toImage:t=>N(t,e),toBlob:t=>M(t,e)}}function ot(e){let t=!1;const i=[ne.EC_UNSUPPORTED_JSON_KEY_WARNING,ne.EC_LICENSE_AUTH_QUOTA_EXCEEDED,ne.EC_LICENSE_RESULTS_LIMIT_EXCEEDED];if(e.errorCode&&i.includes(e.errorCode))return void console.warn(e.message);let s=new Error(e.errorCode?`[${e.functionName}] [${e.errorCode}] ${e.message}`:`[${e.functionName}] ${e.message}`);if(s.stack&&(s.stack=e.stack),e.isShouldThrow)throw s;return e.rj&&e.rj(s),t=!0,true}function at(e,t,i){return(i.x-e.x)*(t.y-e.y)===(t.x-e.x)*(i.y-e.y)&&Math.min(e.x,t.x)<=i.x&&i.x<=Math.max(e.x,t.x)&&Math.min(e.y,t.y)<=i.y&&i.y<=Math.max(e.y,t.y)}function ct(e){return Math.abs(e)<1e-6?0:e<0?-1:1}function lt(e,t,i,s){let n=e[0]*(i[1]-t[1])+t[0]*(e[1]-i[1])+i[0]*(t[1]-e[1]),r=e[0]*(s[1]-t[1])+t[0]*(e[1]-s[1])+s[0]*(t[1]-e[1]);return!((n^r)>=0&&0!==n&&0!==r||(n=i[0]*(e[1]-s[1])+s[0]*(i[1]-e[1])+e[0]*(s[1]-i[1]),r=i[0]*(t[1]-s[1])+s[0]*(i[1]-t[1])+t[0]*(s[1]-i[1]),(n^r)>=0&&0!==n&&0!==r))}it._version=`3.4.30-dev-20260629163033(Worker: ${null===(Qe=De.cvr)||void 0===Qe?void 0:Qe.worker}, Wasm: loading...`,BigInt(0),BigInt("0xFFFFFFFEFFFFFFFF"),BigInt(4265345023);const dt=BigInt(3147775),ut=(BigInt(260096),BigInt(1),BigInt(2),BigInt(4),BigInt(8),BigInt(16),BigInt(32),BigInt(64),BigInt(128),BigInt(256),BigInt(512),BigInt(1024),BigInt(2048),BigInt(4096),BigInt(8192),BigInt(16384),BigInt(32768),BigInt(65536),BigInt(131072),BigInt(262144),BigInt(16777216),BigInt(33554432),BigInt(67108864)),ht=BigInt(134217728);BigInt(268435456),BigInt(536870912),BigInt(1073741824),BigInt(524288),BigInt(2147483648),BigInt(1048576),BigInt(2097152),BigInt(4194304),BigInt(8388608),BigInt(68719476736),BigInt(0x3f0000000000000),BigInt(4294967296),BigInt(4503599627370496),BigInt(9007199254740992),BigInt(0x40000000000000),BigInt(0x80000000000000),BigInt(72057594037927940),BigInt(0x200000000000000),BigInt(8589934592),BigInt(17179869184),BigInt(34359738368),BigInt(51539607552),BigInt(137438953472),BigInt(274877906944);let _t=class{constructor(e){this._autoZoomParameters={minValue:1,maxValue:999,autoFocusFrameArray:[],autoFocusFrameLimit:[5,3],autoZoomDetectionArea:.5,autoZoomTargetBorder:.9,autoZoomIdealArea:[0,.05],autoZoomInFrameArray:[],autoZoomInFrameLimit:[5,3],autoZoomInMaxTimes:5,autoZoomInMinStep:Math.pow(10,.2),autoZoomInIdealModuleSize:6,autoZoomOutFrameCount:0,autoZoomOutFrameLimit:3,autoZoomOutStepRate:1/3,autoZoomOutStepRate_2:.05,autoZoomOutMinStep:2,frameArrayInIdealZoom:[],frameLimitInIdealZoom:[5,3]},this.isSupportDCEModule=!0,this.onTaskResultsReceived=async e=>{if(!this.isSupportDCEModule)return;let t=this.cameraEnhancer;(4&t._dceEnhancedFeatures||16&t._dceEnhancedFeatures||64&t._dceEnhancedFeatures)&&(0!==Me.bSupportDce4Module?(this.isSupportDCEModule=!1,console.warn("Warning: The license required for Enhanced Features was not found.")):(!this.consumeTime||Date.now()-this.consumeTime>1e4)&&(Me.cfd(1),this.consumeTime=Date.now()));const i=e.intermediateResultUnits;if(!t.isOpen()||t.isPaused())return;const s=t.getVisibleAreaInVideoXY({isConsiderRegionBox:!0});if(isNaN(s.x)||isNaN(s.y)||isNaN(s.width)||isNaN(s.height))return;let n=!1,r=!1;for(let e of i){if(e.unitType===ue.IRUT_DECODED_BARCODES&&e.decodedBarcodes.length){n=!0;break}e.unitType===ue.IRUT_LOCALIZED_BARCODES&&e.localizedBarcodes.length&&(r=!0)}if(16&t._dceEnhancedFeatures||4&t._dceEnhancedFeatures)if(n)this._autoZoomParameters.autoZoomInFrameArray.length=0,this._autoZoomParameters.autoZoomOutFrameCount=0,this._autoZoomParameters.frameArrayInIdealZoom.length=0,this._autoZoomParameters.autoFocusFrameArray.length=0;else{const n=async e=>{await t.setZoom(e)},o=async e=>{await t.setFocus(e)};if(r){s.x,s.y;const r=s.width,a=s.height,c=s.width,l=s.height;let d;{let e,n,r,o,a;{const e=t.video.videoWidth*(1-this._autoZoomParameters.autoZoomDetectionArea)/2,i=t.video.videoWidth*(1+this._autoZoomParameters.autoZoomDetectionArea)/2,s=i,n=e,r=t.video.videoHeight*(1-this._autoZoomParameters.autoZoomDetectionArea)/2,o=r,c=t.video.videoHeight*(1+this._autoZoomParameters.autoZoomDetectionArea)/2;a=[{x:e,y:r},{x:i,y:o},{x:s,y:c},{x:n,y:c}]}const u=[];{const e=(e,t)=>{const i=(e,t)=>{if(!e&&!t)throw new Error("Invalid arguments.");return function(e,t,i){let s=!1;const n=e.length;if(n<=2)return!1;for(let r=0;r<n;r++){const o=e[r],a=e[(r+1)%n];if(at(o,a,{x:t,y:i}))return!0;ct(o.y-i)>0!=ct(a.y-i)>0&&ct(t-(i-o.y)*(o.x-a.x)/(o.y-a.y)-o.x)<0&&(s=!s)}return s}(t,e.x,e.y)},s=(e,t)=>!!(lt([e[0],e[1]],[e[2],e[3]],[t[0].x,t[0].y],[t[1].x,t[1].y])||lt([e[0],e[1]],[e[2],e[3]],[t[1].x,t[1].y],[t[2].x,t[2].y])||lt([e[0],e[1]],[e[2],e[3]],[t[2].x,t[2].y],[t[3].x,t[3].y])||lt([e[0],e[1]],[e[2],e[3]],[t[3].x,t[3].y],[t[0].x,t[0].y]));return!!(i({x:e[0].x,y:e[0].y},t)||i({x:e[1].x,y:e[1].y},t)||i({x:e[2].x,y:e[2].y},t)||i({x:e[3].x,y:e[3].y},t))||!!(i({x:t[0].x,y:t[0].y},e)||i({x:t[1].x,y:t[1].y},e)||i({x:t[2].x,y:t[2].y},e)||i({x:t[3].x,y:t[3].y},e))||!!(s([t[0].x,t[0].y,t[1].x,t[1].y],e)||s([t[1].x,t[1].y,t[2].x,t[2].y],e)||s([t[2].x,t[2].y,t[3].x,t[3].y],e)||s([t[3].x,t[3].y,t[0].x,t[0].y],e))};for(let t of i)if(t.unitType===ue.IRUT_LOCALIZED_BARCODES)for(let i of t.localizedBarcodes)i&&e(a,i.location.points.map(e=>({x:e.x+s.x,y:e.y+s.y})))&&u.push(i)}if(!u.length)return;let h;if(u.length){let e=u.filter(e=>e.possibleFormats==ut||e.possibleFormats==ht);if(e.length||(e=u.filter(e=>e.possibleFormats==dt),e.length||(e=u)),e.length){const t=e=>{const t=e.location.points,i=(t[0].x+t[1].x+t[2].x+t[3].x)/4,s=(t[0].y+t[1].y+t[2].y+t[3].y)/4;return(i-c/2)*(i-c/2)+(s-l/2)*(s-l/2)};h=e[0];let i=t(h);if(1!=e.length)for(let s=1;s<e.length;s++){const n=t(e[s]);(e[s].confidence>1.1*h.confidence||e[s].confidence>.9*h.confidence&&n<i)&&(h=e[s],i=n)}}}if(h){const t=h.location.points;e=Math.min(t[0].x,t[1].x,t[2].x,t[3].x),n=Math.max(t[0].x,t[1].x,t[2].x,t[3].x),r=Math.min(t[0].y,t[1].y,t[2].y,t[3].y),o=Math.max(t[0].y,t[1].y,t[2].y,t[3].y),d={points:[{x:e,y:r},{x:n,y:r},{x:n,y:o},{x:e,y:o}],result:h}}}if(!d)return;if(this._autoZoomParameters.autoZoomOutFrameCount=0,16&t._dceEnhancedFeatures){const i=this._autoZoomParameters.autoZoomIdealArea[1];let s=(1-this._autoZoomParameters.autoZoomTargetBorder)/2;const c=d.points[0].x/r,l=(r-d.points[2].x)/r,u=d.points[0].y/a,