dynamsoft-core
Advanced tools
Comparing version 3.4.30-beta-202412040036 to 3.4.30
@@ -11,2 +11,2 @@ /*! | ||
*/ | ||
const _=_=>_&&"object"==typeof _&&"function"==typeof _.then;class E extends Promise{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 e;this._task=E,_(E)?e=E:"function"==typeof E&&(e=new Promise(E)),e&&(async()=>{try{const _=await e;E===this._task&&this.resolve(_)}catch(_){E===this._task&&this.reject(_)}})()}get isEmpty(){return null==this._task}constructor(E){let e,t;super(((_,E)=>{e=_,t=E})),this._s="pending",this.resolve=E=>{this.isPending&&(_(E)?this.task=E:(this._s="fulfilled",e(E)))},this.reject=_=>{this.isPending&&(this._s="rejected",t(_))},this.task=E}}function e(_,E,e,t){if("a"===e&&!t)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof E?_!==E||!t:!E.has(_))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===e?t:"a"===e?t.call(_):t?t.value:E.get(_)}function t(_,E,e,t,I){if("m"===t)throw new TypeError("Private method is not writable");if("a"===t&&!I)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof E?_!==E||!I:!E.has(_))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===t?I.call(_,e):I?I.value=e:E.set(_,e),e}var I,r,s;"function"==typeof SuppressedError&&SuppressedError,function(_){_[_.BOPM_BLOCK=0]="BOPM_BLOCK",_[_.BOPM_UPDATE=1]="BOPM_UPDATE"}(I||(I={})),function(_){_[_.CCUT_AUTO=0]="CCUT_AUTO",_[_.CCUT_FULL_CHANNEL=1]="CCUT_FULL_CHANNEL",_[_.CCUT_Y_CHANNEL_ONLY=2]="CCUT_Y_CHANNEL_ONLY",_[_.CCUT_RGB_R_CHANNEL_ONLY=3]="CCUT_RGB_R_CHANNEL_ONLY",_[_.CCUT_RGB_G_CHANNEL_ONLY=4]="CCUT_RGB_G_CHANNEL_ONLY",_[_.CCUT_RGB_B_CHANNEL_ONLY=5]="CCUT_RGB_B_CHANNEL_ONLY"}(r||(r={})),function(_){_[_.IPF_BINARY=0]="IPF_BINARY",_[_.IPF_BINARYINVERTED=1]="IPF_BINARYINVERTED",_[_.IPF_GRAYSCALED=2]="IPF_GRAYSCALED",_[_.IPF_NV21=3]="IPF_NV21",_[_.IPF_RGB_565=4]="IPF_RGB_565",_[_.IPF_RGB_555=5]="IPF_RGB_555",_[_.IPF_RGB_888=6]="IPF_RGB_888",_[_.IPF_ARGB_8888=7]="IPF_ARGB_8888",_[_.IPF_RGB_161616=8]="IPF_RGB_161616",_[_.IPF_ARGB_16161616=9]="IPF_ARGB_16161616",_[_.IPF_ABGR_8888=10]="IPF_ABGR_8888",_[_.IPF_ABGR_16161616=11]="IPF_ABGR_16161616",_[_.IPF_BGR_888=12]="IPF_BGR_888",_[_.IPF_BINARY_8=13]="IPF_BINARY_8",_[_.IPF_NV12=14]="IPF_NV12",_[_.IPF_BINARY_8_INVERTED=15]="IPF_BINARY_8_INVERTED"}(s||(s={}));const n="undefined"==typeof self,C="function"==typeof importScripts,i=(()=>{if(!C){if(!n&&document.currentScript){let _=document.currentScript.src,E=_.indexOf("?");if(-1!=E)_=_.substring(0,E);else{let E=_.indexOf("#");-1!=E&&(_=_.substring(0,E))}return _.substring(0,_.lastIndexOf("/")+1)}return"./"}})(),A=_=>{if(null==_&&(_="./"),n||C);else{let E=document.createElement("a");E.href=_,_=E.href}return _.endsWith("/")||(_+="/"),_},o=_=>Object.prototype.toString.call(_),N=_=>Array.isArray?Array.isArray(_):"[object Array]"===o(_),a=_=>"[object Boolean]"===o(_),T=_=>"number"==typeof _&&!Number.isNaN(_),R=_=>null!==_&&"object"==typeof _&&!Array.isArray(_),L=_=>!!R(_)&&(!!T(_.x)&&(!!T(_.y)&&(!!T(_.radius)&&(!(_.radius<0)&&(!!T(_.startAngle)&&!!T(_.endAngle)))))),D=_=>!!R(_)&&(!!N(_.points)&&(0!=_.points.length&&!_.points.some((_=>!d(_))))),O=_=>!!R(_)&&(!!T(_.width)&&(!(_.width<=0)&&(!!T(_.height)&&(!(_.height<=0)&&(!!T(_.stride)&&(!(_.stride<=0)&&("format"in _&&!("tag"in _&&!f(_.tag))))))))),c=_=>!!O(_)&&!(!T(_.bytes.length)&&!T(_.bytes.ptr)),S=_=>!!O(_)&&_.bytes instanceof Uint8Array,l=_=>!!R(_)&&(!!T(_.left)&&(!(_.left<0)&&(!!T(_.top)&&(!(_.top<0)&&(!!T(_.right)&&(!(_.right<0)&&(!!T(_.bottom)&&(!(_.bottom<0)&&(!(_.left>=_.right)&&(!(_.top>=_.bottom)&&!!a(_.isMeasuredInPercentage))))))))))),f=_=>null===_||!!R(_)&&(!!T(_.imageId)&&"type"in _),h=_=>!!R(_)&&(!!d(_.startPoint)&&(!!d(_.endPoint)&&(_.startPoint.x!=_.endPoint.x||_.startPoint.y!=_.endPoint.y))),d=_=>!!R(_)&&(!!T(_.x)&&!!T(_.y)),P=_=>!!R(_)&&(!!N(_.points)&&(0!=_.points.length&&!_.points.some((_=>!d(_))))),g=_=>!!R(_)&&(!!N(_.points)&&(0!=_.points.length&&4==_.points.length&&!_.points.some((_=>!d(_))))),M=_=>!!R(_)&&(!!T(_.x)&&(!!T(_.y)&&(!!T(_.width)&&(!(_.width<0)&&(!!T(_.height)&&(!(_.height<0)&&!("isMeasuredInPercentage"in _&&!a(_.isMeasuredInPercentage)))))))),u=async(_,E)=>await new Promise(((e,t)=>{let I=new XMLHttpRequest;I.open("GET",_,!0),I.responseType=E,I.send(),I.onloadend=async()=>{I.status<200||I.status>=300?t(new Error(_+" "+I.status)):e(I.response)},I.onerror=()=>{t(new Error("Network Error: "+I.statusText))}})),F=_=>/^(https:\/\/www\.|http:\/\/www\.|https:\/\/|http:\/\/)|^[a-zA-Z0-9]{2,}(\.[a-zA-Z0-9]{2,})(\.[a-zA-Z0-9]{2,})?/.test(_),G=(_,E)=>{let e=_.split("."),t=E.split(".");for(let _=0;_<e.length&&_<t.length;++_){let E=e[_],I=t[_];if(E===I)continue;let r=parseInt(e[_]),s=parseInt(t[_]);return r===s||Number.isNaN(r)&&Number.isNaN(s)?E<I?-1:1:r<s||Number.isNaN(r)&&Number.isInteger(s)?-1:1}return e.length===t.length?0:e.length<t.length?-1:1},U=_=>{const E={},e={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",dcpd:"dynamsoft-code-parser",dlrData:"dynamsoft-label-recognizer-data",dce:"dynamsoft-camera-enhancer",ddv:"dynamsoft-document-viewer"};for(let t in _){if("rootDirectory"===t)continue;let I=t,r=_[I],s=r&&"object"==typeof r&&r.path?r.path:r,n=_.rootDirectory;if(n&&!n.endsWith("/")&&(n+="/"),"object"==typeof r&&r.isInternal)n&&(s=_[I].version?`${n}${e[I]}@${_[I].version}/dist/${"ddv"===I?"engine":""}`:`${n}${e[I]}/dist/${"ddv"===I?"engine":""}`);else{const e=/^@engineRootDirectory(\/?)/;if("string"==typeof s&&(s=s.replace(e,n||"")),"object"==typeof s&&"dwt"===I){const t=_[I].resourcesPath,r=_[I].serviceInstallerLocation;E[I]={resourcesPath:t.replace(e,n||""),serviceInstallerLocation:r.replace(e,n||"")};continue}}E[I]=A(s)}return E},B=async(_,E,e)=>await new Promise((async(t,I)=>{try{const I=E.split(".");let r=I[I.length-1];const s=await y(`image/${r}`,_);I.length<=1&&(r="png");const n=new File([s],E,{type:`image/${r}`});if(e){const _=URL.createObjectURL(n),e=document.createElement("a");e.href=_,e.download=E,e.click()}return t(n)}catch(_){return I()}})),p=_=>{S(_)&&(_=w(_));const E=document.createElement("canvas");E.width=_.width,E.height=_.height;return E.getContext("2d",{willReadFrequently:!0}).putImageData(_,0,0),E},m=(_,E)=>{S(E)&&(E=w(E));const e=p(E);let t=new Image,I=e.toDataURL(_);return t.src=I,t},y=async(_,E)=>{S(E)&&(E=w(E));const e=p(E);return new Promise(((E,t)=>{e.toBlob((_=>E(_)),_)}))},w=_=>{let E,e=_.bytes;if(!(e&&e instanceof Uint8Array))throw Error("Parameter type error");if(Number(_.format)===s.IPF_BGR_888){const _=e.length/3;E=new Uint8ClampedArray(4*_);for(let t=0;t<_;++t)E[4*t]=e[3*t],E[4*t+1]=e[3*t+1],E[4*t+2]=e[3*t+2],E[4*t+3]=255}else if(Number(_.format)===s.IPF_RGB_888){const _=e.length/3;E=new Uint8ClampedArray(4*_);for(let t=0;t<_;++t)E[4*t]=e[3*t+2],E[4*t+1]=e[3*t+1],E[4*t+2]=e[3*t],E[4*t+3]=255}else if(Number(_.format)===s.IPF_GRAYSCALED){const _=e.length;E=new Uint8ClampedArray(4*_);for(let t=0;t<_;t++)E[4*t]=E[4*t+1]=E[4*t+2]=e[t],E[4*t+3]=255}else if(Number(_.format)===s.IPF_BINARY_8){const t=e.length,I=_.width,r=_.height,s=_.stride;E=new Uint8ClampedArray(I*r*4);for(let _=0;_<t;_++){let t=e[_],r=_%s,n=Math.floor(_/s);for(let _=0;_<8;_++){let e=r+_,s=4*(n*I+e);if(e>=I)break;E[s]=E[s+1]=E[s+2]=(128&t)/128*255,E[s+3]=255,t<<=1}}}else if(Number(_.format)===s.IPF_ABGR_8888){const _=e.length/4;E=new Uint8ClampedArray(e.length);for(let t=0;t<_;++t)E[4*t]=e[4*t],E[4*t+1]=e[4*t+1],E[4*t+2]=e[4*t+2],E[4*t+3]=e[4*t+3]}else if(Number(_.format)===s.IPF_ARGB_8888){const _=e.length/4;E=new Uint8ClampedArray(e.length);for(let t=0;t<_;++t)E[4*t]=e[4*t+2],E[4*t+1]=e[4*t+1],E[4*t+2]=e[4*t],E[4*t+3]=e[4*t+3]}else if(Number(_.format)===s.IPF_BINARY_8_INVERTED){const t=e.length,I=_.width,r=_.height,s=_.stride;E=new Uint8ClampedArray(I*r*4);for(let _=0;_<t;_++){let t=e[_],r=_%s,n=Math.floor(_/s);for(let _=0;_<8;_++){let e=r+_,s=4*(n*I+e);if(e>=I)break;E[s]=E[s+1]=E[s+2]=128&t?0:255,E[s+3]=255,t<<=1}}}return new ImageData(E,_.width,_.height)};var V,b,v,Y,H,k,X,Z;class x{get _isFetchingStarted(){return e(this,H,"f")}constructor(){V.add(this),b.set(this,[]),v.set(this,1),Y.set(this,I.BOPM_BLOCK),H.set(this,!1),k.set(this,void 0),X.set(this,r.CCUT_AUTO)}setErrorListener(_){}addImageToBuffer(_){var E;if(!S(_))throw new TypeError("Invalid 'image'.");if((null===(E=_.tag)||void 0===E?void 0:E.hasOwnProperty("imageId"))&&"number"==typeof _.tag.imageId&&this.hasImage(_.tag.imageId))throw new Error("Existed imageId.");if(e(this,b,"f").length>=e(this,v,"f"))switch(e(this,Y,"f")){case I.BOPM_BLOCK:break;case I.BOPM_UPDATE:if(e(this,b,"f").push(_),R(e(this,k,"f"))&&T(e(this,k,"f").imageId)&&1==e(this,k,"f").keepInBuffer)for(;e(this,b,"f").length>e(this,v,"f");){const _=e(this,b,"f").findIndex((_=>{var E;return(null===(E=_.tag)||void 0===E?void 0:E.imageId)!==e(this,k,"f").imageId}));e(this,b,"f").splice(_,1)}else e(this,b,"f").splice(0,e(this,b,"f").length-e(this,v,"f"))}else e(this,b,"f").push(_)}getImage(){if(0===e(this,b,"f").length)return null;let _;if(e(this,k,"f")&&T(e(this,k,"f").imageId)){const E=e(this,V,"m",Z).call(this,e(this,k,"f").imageId);if(E<0)throw new Error(`Image with id ${e(this,k,"f").imageId} doesn't exist.`);_=e(this,b,"f").slice(E,E+1)[0]}else _=e(this,b,"f").pop();if([s.IPF_RGB_565,s.IPF_RGB_555,s.IPF_RGB_888,s.IPF_ARGB_8888,s.IPF_RGB_161616,s.IPF_ARGB_16161616,s.IPF_ABGR_8888,s.IPF_ABGR_16161616,s.IPF_BGR_888].includes(_.format)){if(e(this,X,"f")===r.CCUT_RGB_R_CHANNEL_ONLY){x._onLog&&x._onLog("only get R channel data.");const E=new Uint8Array(_.width*_.height);for(let e=0;e<E.length;e++)switch(_.format){case s.IPF_RGB_565:case s.IPF_RGB_555:case s.IPF_RGB_888:case s.IPF_RGB_161616:E[e]=_.bytes[3*e+2];break;case s.IPF_ARGB_8888:case s.IPF_ARGB_16161616:E[e]=_.bytes[4*e+2];break;case s.IPF_BGR_888:E[e]=_.bytes[3*e];break;case s.IPF_ABGR_8888:case s.IPF_ABGR_16161616:E[e]=_.bytes[4*e]}_.bytes=E,_.stride=_.width,_.format=s.IPF_GRAYSCALED}else if(e(this,X,"f")===r.CCUT_RGB_G_CHANNEL_ONLY){x._onLog&&x._onLog("only get G channel data.");const E=new Uint8Array(_.width*_.height);for(let e=0;e<E.length;e++)switch(_.format){case s.IPF_RGB_565:case s.IPF_RGB_555:case s.IPF_RGB_888:case s.IPF_RGB_161616:case s.IPF_BGR_888:E[e]=_.bytes[3*e+1];break;case s.IPF_ARGB_8888:case s.IPF_ARGB_16161616:case s.IPF_ABGR_8888:case s.IPF_ABGR_16161616:E[e]=_.bytes[4*e+1]}_.bytes=E,_.stride=_.width,_.format=s.IPF_GRAYSCALED}else if(e(this,X,"f")===r.CCUT_RGB_B_CHANNEL_ONLY){x._onLog&&x._onLog("only get B channel data.");const E=new Uint8Array(_.width*_.height);for(let e=0;e<E.length;e++)switch(_.format){case s.IPF_RGB_565:case s.IPF_RGB_555:case s.IPF_RGB_888:case s.IPF_RGB_161616:E[e]=_.bytes[3*e];break;case s.IPF_ARGB_8888:case s.IPF_ARGB_16161616:E[e]=_.bytes[4*e];break;case s.IPF_BGR_888:E[e]=_.bytes[3*e+2];break;case s.IPF_ABGR_8888:case s.IPF_ABGR_16161616:E[e]=_.bytes[4*e+2]}_.bytes=E,_.stride=_.width,_.format=s.IPF_GRAYSCALED}}else[s.IPF_NV21,s.IPF_NV12].includes(_.format)&&x._onLog&&x._onLog("NV21 or NV12 is not supported.");return _}setNextImageToReturn(_,E){if(!((..._)=>0!==_.length&&_.every((_=>T(_))))(_))throw new TypeError("Invalid 'imageId'.");if(void 0!==E&&!a(E))throw new TypeError("Invalid 'keepInBuffer'.");t(this,k,{imageId:_,keepInBuffer:E},"f")}_resetNextReturnedImage(){t(this,k,null,"f")}hasImage(_){return e(this,V,"m",Z).call(this,_)>=0}startFetching(){t(this,H,!0,"f")}stopFetching(){t(this,H,!1,"f")}setMaxImageCount(_){if("number"!=typeof _)throw new TypeError("Invalid 'count'.");if(_<1||Math.round(_)!==_)throw new Error("Invalid 'count'.");for(t(this,v,_,"f");e(this,b,"f")&&e(this,b,"f").length>_;)e(this,b,"f").shift()}getMaxImageCount(){return e(this,v,"f")}getImageCount(){return e(this,b,"f").length}clearBuffer(){e(this,b,"f").length=0}isBufferEmpty(){return 0===e(this,b,"f").length}setBufferOverflowProtectionMode(_){t(this,Y,_,"f")}getBufferOverflowProtectionMode(){return e(this,Y,"f")}setColourChannelUsageType(_){t(this,X,_,"f")}getColourChannelUsageType(){return e(this,X,"f")}}let W,j,K,J,Q;b=new WeakMap,v=new WeakMap,Y=new WeakMap,H=new WeakMap,k=new WeakMap,X=new WeakMap,V=new WeakSet,Z=function(_){if("number"!=typeof _)throw new TypeError("Invalid 'imageId'.");return e(this,b,"f").findIndex((E=>{var e;return(null===(e=E.tag)||void 0===e?void 0:e.imageId)===_}))},"undefined"!=typeof navigator&&(W=navigator,j=W.userAgent,K=W.platform,J=W.mediaDevices),function(){if(!n){const _={Edge:{search:"Edg",verSearch:"Edg"},OPR:null,Chrome:null,Safari:{str:W.vendor,search:"Apple",verSearch:["Version","iPhone OS","CPU OS"]},Firefox:null,Explorer:{search:"MSIE",verSearch:"MSIE"}},E={HarmonyOS:null,Android:null,iPhone:null,iPad:null,Windows:{str:K,search:"Win"},Mac:{str:K},Linux:{str:K}};let e="unknownBrowser",t=0,I="unknownOS";for(let E in _){const I=_[E]||{};let r=I.str||j,s=I.search||E,n=I.verStr||j,C=I.verSearch||E;if(C instanceof Array||(C=[C]),-1!=r.indexOf(s)){e=E;for(let _ of C){let E=n.indexOf(_);if(-1!=E){t=parseFloat(n.substring(E+_.length+1));break}}break}}for(let _ in E){const e=E[_]||{};let t=e.str||j,r=e.search||_;if(-1!=t.indexOf(r)){I=_;break}}"Linux"==I&&-1!=j.indexOf("Windows NT")&&(I="HarmonyOS"),Q={browser:e,version:t,OS:I}}n&&(Q={browser:"ssr",version:0,OS:"ssr"})}();const $="undefined"!=typeof WebAssembly&&j&&!(/Safari/.test(j)&&!/Chrome/.test(j)&&/\(.+\s11_2_([2-6]).*\)/.test(j)),z=!("undefined"==typeof Worker),q=!(!J||!J.getUserMedia),__=async()=>{let _=!1;if(q)try{(await J.getUserMedia({video:!0})).getTracks().forEach((_=>{_.stop()})),_=!0}catch(_){}return _};"Chrome"===Q.browser&&Q.version>66||"Safari"===Q.browser&&Q.version>13||"OPR"===Q.browser&&Q.version>43||"Edge"===Q.browser&&Q.version;const E_={},e_=async _=>{let e="string"==typeof _?[_]:_,t=[];for(let _ of e)t.push(E_[_]=E_[_]||new E);await Promise.all(t)},t_=async(_,e)=>{let t,I="string"==typeof _?[_]:_,r=[];for(let _ of I){let I;r.push(I=E_[_]=E_[_]||new E(t=t||e())),I.isEmpty&&(I.task=t=t||e())}await Promise.all(r)};let I_,r_=0;const s_=()=>r_++,n_={};let C_;const i_=_=>{C_=_,I_&&I_.postMessage({type:"setBLog",body:{value:!!_}})};let A_=!1;const o_=_=>{A_=_,I_&&I_.postMessage({type:"setBDebug",body:{value:!!_}})},N_={},a_={},T_={dip:{wasm:!0}},R_={std:{version:"1.4.20",path:A(i+"../../dynamsoft-capture-vision-std@1.4.20/dist/"),isInternal:!0},core:{version:"3.4.30-beta-202412040036",path:i,isInternal:!0}},L_=async _=>{let e;_ instanceof Array||(_=_?[_]:[]);let t=E_.core;e=!t||t.isEmpty;let I=new Map;const r=_=>{if("std"==(_=_.toLowerCase())||"core"==_)return;if(!T_[_])throw Error("The '"+_+"' module cannot be found.");let E=T_[_].deps;if(null==E?void 0:E.length)for(let _ of E)r(_);let e=E_[_];I.has(_)||I.set(_,!e||e.isEmpty)};for(let E of _)r(E);let s=[];e&&s.push("core"),s.push(...I.keys());const n=[...I.entries()].filter((_=>!_[1])).map((_=>_[0]));await t_(s,(async()=>{const _=[...I.entries()].filter((_=>_[1])).map((_=>_[0]));await e_(n);const t=U(R_),r={};for(let E of _)r[E]=T_[E];const s={engineResourcePaths:t,autoResources:r,names:_};let C=new E;if(e){s.needLoadCore=!0;let _=t.core+D_._workerName;_.startsWith(location.origin)||(_=await fetch(_).then((_=>_.blob())).then((_=>URL.createObjectURL(_)))),I_=new Worker(_),I_.onerror=_=>{let E=new Error(_.message);C.reject(E)},I_.addEventListener("message",(_=>{let E=_.data?_.data:_,e=E.type,t=E.id,I=E.body;switch(e){case"log":C_&&C_(E.message);break;case"task":try{n_[t](I),delete n_[t]}catch(_){throw delete n_[t],_}break;case"event":try{n_[t](I)}catch(_){throw _}break;default:console.log(_)}})),s.bLog=!!C_,s.bd=A_,s.dm=location.origin.startsWith("http")?location.origin:"https://localhost"}else await e_("core");let i=r_++;n_[i]=_=>{if(_.success)Object.assign(N_,_.versions),"{}"!==JSON.stringify(_.versions)&&(D_._versions=_.versions),C.resolve(void 0);else{const E=Error(_.message);_.stack&&(E.stack=_.stack),C.reject(E)}},I_.postMessage({type:"loadWasm",body:s,id:i}),await C}))};class D_{static get engineResourcePaths(){return R_}static set engineResourcePaths(_){Object.assign(R_,_)}static get bSupportDce4Module(){return this._bSupportDce4Module}static get bSupportIRTModule(){return this._bSupportIRTModule}static get versions(){return this._versions}static get _onLog(){return C_}static set _onLog(_){i_(_)}static get _bDebug(){return A_}static set _bDebug(_){o_(_)}static isModuleLoaded(_){return _=(_=_||"core").toLowerCase(),!!E_[_]&&E_[_].isFulfilled}static async loadWasm(_){return await L_(_)}static async detectEnvironment(){return await(async()=>({wasm:$,worker:z,getUserMedia:q,camera:await __(),browser:Q.browser,version:Q.version,OS:Q.OS}))()}static async getModuleVersion(){return await new Promise(((_,E)=>{let e=s_();n_[e]=async e=>{if(e.success)return _(e.versions);{let _=new Error(e.message);return _.stack=e.stack+"\n"+_.stack,E(_)}},I_.postMessage({type:"getModuleVersion",id:e})}))}static getVersion(){const _=N_.core&&N_.core.worker,E=N_.core&&N_.core.wasm;return`3.4.30-beta-202412040036(Worker: ${_||"Not Loaded"}, Wasm: ${E||"Not Loaded"})`}static enableLogging(){x._onLog=console.log,D_._onLog=console.log}static disableLogging(){x._onLog=null,D_._onLog=null}static async cfd(_){return await new Promise(((E,e)=>{let t=s_();n_[t]=async _=>{if(_.success)return E();{let E=new Error(_.message);return E.stack=_.stack+"\n"+E.stack,e(E)}},I_.postMessage({type:"cfd",id:t,body:{count:_}})}))}}var O_,c_,S_,l_,f_,h_,d_,P_,g_;D_._bSupportDce4Module=-1,D_._bSupportIRTModule=-1,D_._versions=null,D_._workerName="core.worker.js",D_.browserInfo=Q,function(_){_[_.CRIT_ORIGINAL_IMAGE=1]="CRIT_ORIGINAL_IMAGE",_[_.CRIT_BARCODE=2]="CRIT_BARCODE",_[_.CRIT_TEXT_LINE=4]="CRIT_TEXT_LINE",_[_.CRIT_DETECTED_QUAD=8]="CRIT_DETECTED_QUAD",_[_.CRIT_NORMALIZED_IMAGE=16]="CRIT_NORMALIZED_IMAGE",_[_.CRIT_PARSED_RESULT=32]="CRIT_PARSED_RESULT"}(O_||(O_={})),function(_){_[_.CT_NORMAL_INTERSECTED=0]="CT_NORMAL_INTERSECTED",_[_.CT_T_INTERSECTED=1]="CT_T_INTERSECTED",_[_.CT_CROSS_INTERSECTED=2]="CT_CROSS_INTERSECTED",_[_.CT_NOT_INTERSECTED=3]="CT_NOT_INTERSECTED"}(c_||(c_={})),function(_){_[_.EC_OK=0]="EC_OK",_[_.EC_UNKNOWN=-1e4]="EC_UNKNOWN",_[_.EC_NO_MEMORY=-10001]="EC_NO_MEMORY",_[_.EC_NULL_POINTER=-10002]="EC_NULL_POINTER",_[_.EC_LICENSE_INVALID=-10003]="EC_LICENSE_INVALID",_[_.EC_LICENSE_EXPIRED=-10004]="EC_LICENSE_EXPIRED",_[_.EC_FILE_NOT_FOUND=-10005]="EC_FILE_NOT_FOUND",_[_.EC_FILE_TYPE_NOT_SUPPORTED=-10006]="EC_FILE_TYPE_NOT_SUPPORTED",_[_.EC_BPP_NOT_SUPPORTED=-10007]="EC_BPP_NOT_SUPPORTED",_[_.EC_INDEX_INVALID=-10008]="EC_INDEX_INVALID",_[_.EC_CUSTOM_REGION_INVALID=-10010]="EC_CUSTOM_REGION_INVALID",_[_.EC_IMAGE_READ_FAILED=-10012]="EC_IMAGE_READ_FAILED",_[_.EC_TIFF_READ_FAILED=-10013]="EC_TIFF_READ_FAILED",_[_.EC_DIB_BUFFER_INVALID=-10018]="EC_DIB_BUFFER_INVALID",_[_.EC_PDF_READ_FAILED=-10021]="EC_PDF_READ_FAILED",_[_.EC_PDF_DLL_MISSING=-10022]="EC_PDF_DLL_MISSING",_[_.EC_PAGE_NUMBER_INVALID=-10023]="EC_PAGE_NUMBER_INVALID",_[_.EC_CUSTOM_SIZE_INVALID=-10024]="EC_CUSTOM_SIZE_INVALID",_[_.EC_TIMEOUT=-10026]="EC_TIMEOUT",_[_.EC_JSON_PARSE_FAILED=-10030]="EC_JSON_PARSE_FAILED",_[_.EC_JSON_TYPE_INVALID=-10031]="EC_JSON_TYPE_INVALID",_[_.EC_JSON_KEY_INVALID=-10032]="EC_JSON_KEY_INVALID",_[_.EC_JSON_VALUE_INVALID=-10033]="EC_JSON_VALUE_INVALID",_[_.EC_JSON_NAME_KEY_MISSING=-10034]="EC_JSON_NAME_KEY_MISSING",_[_.EC_JSON_NAME_VALUE_DUPLICATED=-10035]="EC_JSON_NAME_VALUE_DUPLICATED",_[_.EC_TEMPLATE_NAME_INVALID=-10036]="EC_TEMPLATE_NAME_INVALID",_[_.EC_JSON_NAME_REFERENCE_INVALID=-10037]="EC_JSON_NAME_REFERENCE_INVALID",_[_.EC_PARAMETER_VALUE_INVALID=-10038]="EC_PARAMETER_VALUE_INVALID",_[_.EC_DOMAIN_NOT_MATCH=-10039]="EC_DOMAIN_NOT_MATCH",_[_.EC_RESERVED_INFO_NOT_MATCH=-10040]="EC_RESERVED_INFO_NOT_MATCH",_[_.EC_LICENSE_KEY_NOT_MATCH=-10043]="EC_LICENSE_KEY_NOT_MATCH",_[_.EC_REQUEST_FAILED=-10044]="EC_REQUEST_FAILED",_[_.EC_LICENSE_INIT_FAILED=-10045]="EC_LICENSE_INIT_FAILED",_[_.EC_SET_MODE_ARGUMENT_ERROR=-10051]="EC_SET_MODE_ARGUMENT_ERROR",_[_.EC_LICENSE_CONTENT_INVALID=-10052]="EC_LICENSE_CONTENT_INVALID",_[_.EC_LICENSE_KEY_INVALID=-10053]="EC_LICENSE_KEY_INVALID",_[_.EC_LICENSE_DEVICE_RUNS_OUT=-10054]="EC_LICENSE_DEVICE_RUNS_OUT",_[_.EC_GET_MODE_ARGUMENT_ERROR=-10055]="EC_GET_MODE_ARGUMENT_ERROR",_[_.EC_IRT_LICENSE_INVALID=-10056]="EC_IRT_LICENSE_INVALID",_[_.EC_FILE_SAVE_FAILED=-10058]="EC_FILE_SAVE_FAILED",_[_.EC_STAGE_TYPE_INVALID=-10059]="EC_STAGE_TYPE_INVALID",_[_.EC_IMAGE_ORIENTATION_INVALID=-10060]="EC_IMAGE_ORIENTATION_INVALID",_[_.EC_CONVERT_COMPLEX_TEMPLATE_ERROR=-10061]="EC_CONVERT_COMPLEX_TEMPLATE_ERROR",_[_.EC_CALL_REJECTED_WHEN_CAPTURING=-10062]="EC_CALL_REJECTED_WHEN_CAPTURING",_[_.EC_NO_IMAGE_SOURCE=-10063]="EC_NO_IMAGE_SOURCE",_[_.EC_READ_DIRECTORY_FAILED=-10064]="EC_READ_DIRECTORY_FAILED",_[_.EC_MODULE_NOT_FOUND=-10065]="EC_MODULE_NOT_FOUND",_[_.EC_MULTI_PAGES_NOT_SUPPORTED=-10066]="EC_MULTI_PAGES_NOT_SUPPORTED",_[_.EC_FILE_ALREADY_EXISTS=-10067]="EC_FILE_ALREADY_EXISTS",_[_.EC_CREATE_FILE_FAILED=-10068]="EC_CREATE_FILE_FAILED",_[_.EC_IMGAE_DATA_INVALID=-10069]="EC_IMGAE_DATA_INVALID",_[_.EC_IMAGE_SIZE_NOT_MATCH=-10070]="EC_IMAGE_SIZE_NOT_MATCH",_[_.EC_IMAGE_PIXEL_FORMAT_NOT_MATCH=-10071]="EC_IMAGE_PIXEL_FORMAT_NOT_MATCH",_[_.EC_SECTION_LEVEL_RESULT_IRREPLACEABLE=-10072]="EC_SECTION_LEVEL_RESULT_IRREPLACEABLE",_[_.EC_AXIS_DEFINITION_INCORRECT=-10073]="EC_AXIS_DEFINITION_INCORRECT",_[_.EC_RESULT_TYPE_MISMATCH_IRREPLACEABLE=-10074]="EC_RESULT_TYPE_MISMATCH_IRREPLACEABLE",_[_.EC_PDF_LIBRARY_LOAD_FAILED=-10075]="EC_PDF_LIBRARY_LOAD_FAILED",_[_.EC_NO_LICENSE=-2e4]="EC_NO_LICENSE",_[_.EC_HANDSHAKE_CODE_INVALID=-20001]="EC_HANDSHAKE_CODE_INVALID",_[_.EC_LICENSE_BUFFER_FAILED=-20002]="EC_LICENSE_BUFFER_FAILED",_[_.EC_LICENSE_SYNC_FAILED=-20003]="EC_LICENSE_SYNC_FAILED",_[_.EC_DEVICE_NOT_MATCH=-20004]="EC_DEVICE_NOT_MATCH",_[_.EC_BIND_DEVICE_FAILED=-20005]="EC_BIND_DEVICE_FAILED",_[_.EC_INSTANCE_COUNT_OVER_LIMIT=-20008]="EC_INSTANCE_COUNT_OVER_LIMIT",_[_.EC_LICENSE_INIT_SEQUENCE_FAILED=-20009]="EC_LICENSE_INIT_SEQUENCE_FAILED",_[_.EC_TRIAL_LICENSE=-20010]="EC_TRIAL_LICENSE",_[_.EC_FAILED_TO_REACH_DLS=-20200]="EC_FAILED_TO_REACH_DLS",_[_.EC_LICENSE_CACHE_USED=-20012]="EC_LICENSE_CACHE_USED",_[_.EC_BARCODE_FORMAT_INVALID=-30009]="EC_BARCODE_FORMAT_INVALID",_[_.EC_QR_LICENSE_INVALID=-30016]="EC_QR_LICENSE_INVALID",_[_.EC_1D_LICENSE_INVALID=-30017]="EC_1D_LICENSE_INVALID",_[_.EC_PDF417_LICENSE_INVALID=-30019]="EC_PDF417_LICENSE_INVALID",_[_.EC_DATAMATRIX_LICENSE_INVALID=-30020]="EC_DATAMATRIX_LICENSE_INVALID",_[_.EC_CUSTOM_MODULESIZE_INVALID=-30025]="EC_CUSTOM_MODULESIZE_INVALID",_[_.EC_AZTEC_LICENSE_INVALID=-30041]="EC_AZTEC_LICENSE_INVALID",_[_.EC_PATCHCODE_LICENSE_INVALID=-30046]="EC_PATCHCODE_LICENSE_INVALID",_[_.EC_POSTALCODE_LICENSE_INVALID=-30047]="EC_POSTALCODE_LICENSE_INVALID",_[_.EC_DPM_LICENSE_INVALID=-30048]="EC_DPM_LICENSE_INVALID",_[_.EC_FRAME_DECODING_THREAD_EXISTS=-30049]="EC_FRAME_DECODING_THREAD_EXISTS",_[_.EC_STOP_DECODING_THREAD_FAILED=-30050]="EC_STOP_DECODING_THREAD_FAILED",_[_.EC_MAXICODE_LICENSE_INVALID=-30057]="EC_MAXICODE_LICENSE_INVALID",_[_.EC_GS1_DATABAR_LICENSE_INVALID=-30058]="EC_GS1_DATABAR_LICENSE_INVALID",_[_.EC_GS1_COMPOSITE_LICENSE_INVALID=-30059]="EC_GS1_COMPOSITE_LICENSE_INVALID",_[_.EC_DOTCODE_LICENSE_INVALID=-30061]="EC_DOTCODE_LICENSE_INVALID",_[_.EC_PHARMACODE_LICENSE_INVALID=-30062]="EC_PHARMACODE_LICENSE_INVALID",_[_.EC_CHARACTER_MODEL_FILE_NOT_FOUND=-40100]="EC_CHARACTER_MODEL_FILE_NOT_FOUND",_[_.EC_TEXT_LINE_GROUP_LAYOUT_CONFLICT=-40101]="EC_TEXT_LINE_GROUP_LAYOUT_CONFLICT",_[_.EC_TEXT_LINE_GROUP_REGEX_CONFLICT=-40102]="EC_TEXT_LINE_GROUP_REGEX_CONFLICT",_[_.EC_QUADRILATERAL_INVALID=-50057]="EC_QUADRILATERAL_INVALID",_[_.EC_PANORAMA_LICENSE_INVALID=-70060]="EC_PANORAMA_LICENSE_INVALID",_[_.EC_RESOURCE_PATH_NOT_EXIST=-90001]="EC_RESOURCE_PATH_NOT_EXIST",_[_.EC_RESOURCE_LOAD_FAILED=-90002]="EC_RESOURCE_LOAD_FAILED",_[_.EC_CODE_SPECIFICATION_NOT_FOUND=-90003]="EC_CODE_SPECIFICATION_NOT_FOUND",_[_.EC_FULL_CODE_EMPTY=-90004]="EC_FULL_CODE_EMPTY",_[_.EC_FULL_CODE_PREPROCESS_FAILED=-90005]="EC_FULL_CODE_PREPROCESS_FAILED",_[_.EC_ZA_DL_LICENSE_INVALID=-90006]="EC_ZA_DL_LICENSE_INVALID",_[_.EC_AAMVA_DL_ID_LICENSE_INVALID=-90007]="EC_AAMVA_DL_ID_LICENSE_INVALID",_[_.EC_AADHAAR_LICENSE_INVALID=-90008]="EC_AADHAAR_LICENSE_INVALID",_[_.EC_MRTD_LICENSE_INVALID=-90009]="EC_MRTD_LICENSE_INVALID",_[_.EC_VIN_LICENSE_INVALID=-90010]="EC_VIN_LICENSE_INVALID",_[_.EC_CUSTOMIZED_CODE_TYPE_LICENSE_INVALID=-90011]="EC_CUSTOMIZED_CODE_TYPE_LICENSE_INVALID",_[_.EC_LICENSE_WARNING=-10076]="EC_LICENSE_WARNING",_[_.EC_BARCODE_READER_LICENSE_NOT_FOUND=-30063]="EC_BARCODE_READER_LICENSE_NOT_FOUND",_[_.EC_LABEL_RECOGNIZER_LICENSE_NOT_FOUND=-40103]="EC_LABEL_RECOGNIZER_LICENSE_NOT_FOUND",_[_.EC_DOCUMENT_NORMALIZER_LICENSE_NOT_FOUND=-50058]="EC_DOCUMENT_NORMALIZER_LICENSE_NOT_FOUND",_[_.EC_CODE_PARSER_LICENSE_NOT_FOUND=-90012]="EC_CODE_PARSER_LICENSE_NOT_FOUND"}(S_||(S_={})),function(_){_[_.GEM_SKIP=0]="GEM_SKIP",_[_.GEM_AUTO=1]="GEM_AUTO",_[_.GEM_GENERAL=2]="GEM_GENERAL",_[_.GEM_GRAY_EQUALIZE=4]="GEM_GRAY_EQUALIZE",_[_.GEM_GRAY_SMOOTH=8]="GEM_GRAY_SMOOTH",_[_.GEM_SHARPEN_SMOOTH=16]="GEM_SHARPEN_SMOOTH",_[_.GEM_REV=-2147483648]="GEM_REV"}(l_||(l_={})),function(_){_[_.GTM_SKIP=0]="GTM_SKIP",_[_.GTM_INVERTED=1]="GTM_INVERTED",_[_.GTM_ORIGINAL=2]="GTM_ORIGINAL",_[_.GTM_AUTO=4]="GTM_AUTO",_[_.GTM_REV=-2147483648]="GTM_REV"}(f_||(f_={})),function(_){_[_.ITT_FILE_IMAGE=0]="ITT_FILE_IMAGE",_[_.ITT_VIDEO_FRAME=1]="ITT_VIDEO_FRAME"}(h_||(h_={})),function(_){_[_.PDFRM_VECTOR=1]="PDFRM_VECTOR",_[_.PDFRM_RASTER=2]="PDFRM_RASTER",_[_.PDFRM_REV=-2147483648]="PDFRM_REV"}(d_||(d_={})),function(_){_[_.RDS_RASTERIZED_PAGES=0]="RDS_RASTERIZED_PAGES",_[_.RDS_EXTRACTED_IMAGES=1]="RDS_EXTRACTED_IMAGES"}(P_||(P_={})),function(_){_[_.CVS_NOT_VERIFIED=0]="CVS_NOT_VERIFIED",_[_.CVS_PASSED=1]="CVS_PASSED",_[_.CVS_FAILED=2]="CVS_FAILED"}(g_||(g_={}));const M_={IRUT_NULL:BigInt(0),IRUT_COLOUR_IMAGE:BigInt(1),IRUT_SCALED_DOWN_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_UP_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_NORMALIZED_IMAGES:BigInt(1<<26),IRUT_SHORT_LINES:BigInt(1<<27),IRUT_RAW_TEXT_LINES:BigInt(1<<28),IRUT_LOGIC_LINES:BigInt(1<<29),IRUT_ALL:BigInt("0xFFFFFFFFFFFFFFFF")};var u_,F_;!function(_){_[_.ROET_PREDETECTED_REGION=0]="ROET_PREDETECTED_REGION",_[_.ROET_LOCALIZED_BARCODE=1]="ROET_LOCALIZED_BARCODE",_[_.ROET_DECODED_BARCODE=2]="ROET_DECODED_BARCODE",_[_.ROET_LOCALIZED_TEXT_LINE=3]="ROET_LOCALIZED_TEXT_LINE",_[_.ROET_RECOGNIZED_TEXT_LINE=4]="ROET_RECOGNIZED_TEXT_LINE",_[_.ROET_DETECTED_QUAD=5]="ROET_DETECTED_QUAD",_[_.ROET_NORMALIZED_IMAGE=6]="ROET_NORMALIZED_IMAGE",_[_.ROET_SOURCE_IMAGE=7]="ROET_SOURCE_IMAGE",_[_.ROET_TARGET_ROI=8]="ROET_TARGET_ROI"}(u_||(u_={})),function(_){_[_.ST_NULL=0]="ST_NULL",_[_.ST_REGION_PREDETECTION=1]="ST_REGION_PREDETECTION",_[_.ST_BARCODE_LOCALIZATION=2]="ST_BARCODE_LOCALIZATION",_[_.ST_BARCODE_DECODING=3]="ST_BARCODE_DECODING",_[_.ST_TEXT_LINE_LOCALIZATION=4]="ST_TEXT_LINE_LOCALIZATION",_[_.ST_TEXT_LINE_RECOGNITION=5]="ST_TEXT_LINE_RECOGNITION",_[_.ST_DOCUMENT_DETECTION=6]="ST_DOCUMENT_DETECTION",_[_.ST_DOCUMENT_NORMALIZATION=7]="ST_DOCUMENT_NORMALIZATION"}(F_||(F_={}));export{D_ as CoreModule,I as EnumBufferOverflowProtectionMode,O_ as EnumCapturedResultItemType,r as EnumColourChannelUsageType,c_ as EnumCornerType,g_ as EnumCrossVerificationStatus,S_ as EnumErrorCode,l_ as EnumGrayscaleEnhancementMode,f_ as EnumGrayscaleTransformationMode,s as EnumImagePixelFormat,h_ as EnumImageTagType,M_ as EnumIntermediateResultUnitType,d_ as EnumPDFReadingMode,P_ as EnumRasterDataSource,u_ as EnumRegionObjectElementType,F_ as EnumSectionType,x as ImageSourceAdapter,w as _getNorImageData,B as _saveToFile,y as _toBlob,p as _toCanvas,m as _toImage,A_ as bDebug,F as checkIsLink,G as compareVersion,t_ as doOrWaitAsyncDependency,s_ as getNextTaskID,U as handleEngineResourcePaths,N_ as innerVersions,L as isArc,D as isContour,S as isDSImageData,l as isDSRect,f as isImageTag,h as isLineSegment,R as isObject,c as isOriginalDsImageData,d as isPoint,P as isPolygon,g as isQuad,M as isRect,L_ as loadWasm,E_ as mapAsyncDependency,a_ as mapPackageRegister,n_ as mapTaskCallBack,C_ as onLog,u as requestResource,o_ as setBDebug,i_ as setOnLog,e_ as waitAsyncDependency,I_ as worker,T_ as workerAutoResources}; | ||
const _=_=>_&&"object"==typeof _&&"function"==typeof _.then;class E extends Promise{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 e;this._task=E,_(E)?e=E:"function"==typeof E&&(e=new Promise(E)),e&&(async()=>{try{const _=await e;E===this._task&&this.resolve(_)}catch(_){E===this._task&&this.reject(_)}})()}get isEmpty(){return null==this._task}constructor(E){let e,t;super(((_,E)=>{e=_,t=E})),this._s="pending",this.resolve=E=>{this.isPending&&(_(E)?this.task=E:(this._s="fulfilled",e(E)))},this.reject=_=>{this.isPending&&(this._s="rejected",t(_))},this.task=E}}function e(_,E,e,t){if("a"===e&&!t)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof E?_!==E||!t:!E.has(_))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===e?t:"a"===e?t.call(_):t?t.value:E.get(_)}function t(_,E,e,t,I){if("m"===t)throw new TypeError("Private method is not writable");if("a"===t&&!I)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof E?_!==E||!I:!E.has(_))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===t?I.call(_,e):I?I.value=e:E.set(_,e),e}var I,r,s;"function"==typeof SuppressedError&&SuppressedError,function(_){_[_.BOPM_BLOCK=0]="BOPM_BLOCK",_[_.BOPM_UPDATE=1]="BOPM_UPDATE"}(I||(I={})),function(_){_[_.CCUT_AUTO=0]="CCUT_AUTO",_[_.CCUT_FULL_CHANNEL=1]="CCUT_FULL_CHANNEL",_[_.CCUT_Y_CHANNEL_ONLY=2]="CCUT_Y_CHANNEL_ONLY",_[_.CCUT_RGB_R_CHANNEL_ONLY=3]="CCUT_RGB_R_CHANNEL_ONLY",_[_.CCUT_RGB_G_CHANNEL_ONLY=4]="CCUT_RGB_G_CHANNEL_ONLY",_[_.CCUT_RGB_B_CHANNEL_ONLY=5]="CCUT_RGB_B_CHANNEL_ONLY"}(r||(r={})),function(_){_[_.IPF_BINARY=0]="IPF_BINARY",_[_.IPF_BINARYINVERTED=1]="IPF_BINARYINVERTED",_[_.IPF_GRAYSCALED=2]="IPF_GRAYSCALED",_[_.IPF_NV21=3]="IPF_NV21",_[_.IPF_RGB_565=4]="IPF_RGB_565",_[_.IPF_RGB_555=5]="IPF_RGB_555",_[_.IPF_RGB_888=6]="IPF_RGB_888",_[_.IPF_ARGB_8888=7]="IPF_ARGB_8888",_[_.IPF_RGB_161616=8]="IPF_RGB_161616",_[_.IPF_ARGB_16161616=9]="IPF_ARGB_16161616",_[_.IPF_ABGR_8888=10]="IPF_ABGR_8888",_[_.IPF_ABGR_16161616=11]="IPF_ABGR_16161616",_[_.IPF_BGR_888=12]="IPF_BGR_888",_[_.IPF_BINARY_8=13]="IPF_BINARY_8",_[_.IPF_NV12=14]="IPF_NV12",_[_.IPF_BINARY_8_INVERTED=15]="IPF_BINARY_8_INVERTED"}(s||(s={}));const n="undefined"==typeof self,C="function"==typeof importScripts,i=(()=>{if(!C){if(!n&&document.currentScript){let _=document.currentScript.src,E=_.indexOf("?");if(-1!=E)_=_.substring(0,E);else{let E=_.indexOf("#");-1!=E&&(_=_.substring(0,E))}return _.substring(0,_.lastIndexOf("/")+1)}return"./"}})(),A=_=>{if(null==_&&(_="./"),n||C);else{let E=document.createElement("a");E.href=_,_=E.href}return _.endsWith("/")||(_+="/"),_},o=_=>Object.prototype.toString.call(_),N=_=>Array.isArray?Array.isArray(_):"[object Array]"===o(_),a=_=>"[object Boolean]"===o(_),T=_=>"number"==typeof _&&!Number.isNaN(_),R=_=>null!==_&&"object"==typeof _&&!Array.isArray(_),L=_=>!!R(_)&&(!!T(_.x)&&(!!T(_.y)&&(!!T(_.radius)&&(!(_.radius<0)&&(!!T(_.startAngle)&&!!T(_.endAngle)))))),D=_=>!!R(_)&&(!!N(_.points)&&(0!=_.points.length&&!_.points.some((_=>!d(_))))),O=_=>!!R(_)&&(!!T(_.width)&&(!(_.width<=0)&&(!!T(_.height)&&(!(_.height<=0)&&(!!T(_.stride)&&(!(_.stride<=0)&&("format"in _&&!("tag"in _&&!f(_.tag))))))))),c=_=>!!O(_)&&!(!T(_.bytes.length)&&!T(_.bytes.ptr)),S=_=>!!O(_)&&_.bytes instanceof Uint8Array,l=_=>!!R(_)&&(!!T(_.left)&&(!(_.left<0)&&(!!T(_.top)&&(!(_.top<0)&&(!!T(_.right)&&(!(_.right<0)&&(!!T(_.bottom)&&(!(_.bottom<0)&&(!(_.left>=_.right)&&(!(_.top>=_.bottom)&&!!a(_.isMeasuredInPercentage))))))))))),f=_=>null===_||!!R(_)&&(!!T(_.imageId)&&"type"in _),h=_=>!!R(_)&&(!!d(_.startPoint)&&(!!d(_.endPoint)&&(_.startPoint.x!=_.endPoint.x||_.startPoint.y!=_.endPoint.y))),d=_=>!!R(_)&&(!!T(_.x)&&!!T(_.y)),P=_=>!!R(_)&&(!!N(_.points)&&(0!=_.points.length&&!_.points.some((_=>!d(_))))),g=_=>!!R(_)&&(!!N(_.points)&&(0!=_.points.length&&4==_.points.length&&!_.points.some((_=>!d(_))))),M=_=>!!R(_)&&(!!T(_.x)&&(!!T(_.y)&&(!!T(_.width)&&(!(_.width<0)&&(!!T(_.height)&&(!(_.height<0)&&!("isMeasuredInPercentage"in _&&!a(_.isMeasuredInPercentage)))))))),u=async(_,E)=>await new Promise(((e,t)=>{let I=new XMLHttpRequest;I.open("GET",_,!0),I.responseType=E,I.send(),I.onloadend=async()=>{I.status<200||I.status>=300?t(new Error(_+" "+I.status)):e(I.response)},I.onerror=()=>{t(new Error("Network Error: "+I.statusText))}})),F=_=>/^(https:\/\/www\.|http:\/\/www\.|https:\/\/|http:\/\/)|^[a-zA-Z0-9]{2,}(\.[a-zA-Z0-9]{2,})(\.[a-zA-Z0-9]{2,})?/.test(_),G=(_,E)=>{let e=_.split("."),t=E.split(".");for(let _=0;_<e.length&&_<t.length;++_){let E=e[_],I=t[_];if(E===I)continue;let r=parseInt(e[_]),s=parseInt(t[_]);return r===s||Number.isNaN(r)&&Number.isNaN(s)?E<I?-1:1:r<s||Number.isNaN(r)&&Number.isInteger(s)?-1:1}return e.length===t.length?0:e.length<t.length?-1:1},U=_=>{const E={},e={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",dcpd:"dynamsoft-code-parser",dlrData:"dynamsoft-label-recognizer-data",dce:"dynamsoft-camera-enhancer",ddv:"dynamsoft-document-viewer"};for(let t in _){if("rootDirectory"===t)continue;let I=t,r=_[I],s=r&&"object"==typeof r&&r.path?r.path:r,n=_.rootDirectory;if(n&&!n.endsWith("/")&&(n+="/"),"object"==typeof r&&r.isInternal)n&&(s=_[I].version?`${n}${e[I]}@${_[I].version}/dist/${"ddv"===I?"engine":""}`:`${n}${e[I]}/dist/${"ddv"===I?"engine":""}`);else{const e=/^@engineRootDirectory(\/?)/;if("string"==typeof s&&(s=s.replace(e,n||"")),"object"==typeof s&&"dwt"===I){const t=_[I].resourcesPath,r=_[I].serviceInstallerLocation;E[I]={resourcesPath:t.replace(e,n||""),serviceInstallerLocation:r.replace(e,n||"")};continue}}E[I]=A(s)}return E},B=async(_,E,e)=>await new Promise((async(t,I)=>{try{const I=E.split(".");let r=I[I.length-1];const s=await y(`image/${r}`,_);I.length<=1&&(r="png");const n=new File([s],E,{type:`image/${r}`});if(e){const _=URL.createObjectURL(n),e=document.createElement("a");e.href=_,e.download=E,e.click()}return t(n)}catch(_){return I()}})),p=_=>{S(_)&&(_=w(_));const E=document.createElement("canvas");E.width=_.width,E.height=_.height;return E.getContext("2d",{willReadFrequently:!0}).putImageData(_,0,0),E},m=(_,E)=>{S(E)&&(E=w(E));const e=p(E);let t=new Image,I=e.toDataURL(_);return t.src=I,t},y=async(_,E)=>{S(E)&&(E=w(E));const e=p(E);return new Promise(((E,t)=>{e.toBlob((_=>E(_)),_)}))},w=_=>{let E,e=_.bytes;if(!(e&&e instanceof Uint8Array))throw Error("Parameter type error");if(Number(_.format)===s.IPF_BGR_888){const _=e.length/3;E=new Uint8ClampedArray(4*_);for(let t=0;t<_;++t)E[4*t]=e[3*t],E[4*t+1]=e[3*t+1],E[4*t+2]=e[3*t+2],E[4*t+3]=255}else if(Number(_.format)===s.IPF_RGB_888){const _=e.length/3;E=new Uint8ClampedArray(4*_);for(let t=0;t<_;++t)E[4*t]=e[3*t+2],E[4*t+1]=e[3*t+1],E[4*t+2]=e[3*t],E[4*t+3]=255}else if(Number(_.format)===s.IPF_GRAYSCALED){const _=e.length;E=new Uint8ClampedArray(4*_);for(let t=0;t<_;t++)E[4*t]=E[4*t+1]=E[4*t+2]=e[t],E[4*t+3]=255}else if(Number(_.format)===s.IPF_BINARY_8){const t=e.length,I=_.width,r=_.height,s=_.stride;E=new Uint8ClampedArray(I*r*4);for(let _=0;_<t;_++){let t=e[_],r=_%s,n=Math.floor(_/s);for(let _=0;_<8;_++){let e=r+_,s=4*(n*I+e);if(e>=I)break;E[s]=E[s+1]=E[s+2]=(128&t)/128*255,E[s+3]=255,t<<=1}}}else if(Number(_.format)===s.IPF_ABGR_8888){const _=e.length/4;E=new Uint8ClampedArray(e.length);for(let t=0;t<_;++t)E[4*t]=e[4*t],E[4*t+1]=e[4*t+1],E[4*t+2]=e[4*t+2],E[4*t+3]=e[4*t+3]}else if(Number(_.format)===s.IPF_ARGB_8888){const _=e.length/4;E=new Uint8ClampedArray(e.length);for(let t=0;t<_;++t)E[4*t]=e[4*t+2],E[4*t+1]=e[4*t+1],E[4*t+2]=e[4*t],E[4*t+3]=e[4*t+3]}else if(Number(_.format)===s.IPF_BINARY_8_INVERTED){const t=e.length,I=_.width,r=_.height,s=_.stride;E=new Uint8ClampedArray(I*r*4);for(let _=0;_<t;_++){let t=e[_],r=_%s,n=Math.floor(_/s);for(let _=0;_<8;_++){let e=r+_,s=4*(n*I+e);if(e>=I)break;E[s]=E[s+1]=E[s+2]=128&t?0:255,E[s+3]=255,t<<=1}}}return new ImageData(E,_.width,_.height)};var V,b,v,Y,H,k,X,Z;class x{get _isFetchingStarted(){return e(this,H,"f")}constructor(){V.add(this),b.set(this,[]),v.set(this,1),Y.set(this,I.BOPM_BLOCK),H.set(this,!1),k.set(this,void 0),X.set(this,r.CCUT_AUTO)}setErrorListener(_){}addImageToBuffer(_){var E;if(!S(_))throw new TypeError("Invalid 'image'.");if((null===(E=_.tag)||void 0===E?void 0:E.hasOwnProperty("imageId"))&&"number"==typeof _.tag.imageId&&this.hasImage(_.tag.imageId))throw new Error("Existed imageId.");if(e(this,b,"f").length>=e(this,v,"f"))switch(e(this,Y,"f")){case I.BOPM_BLOCK:break;case I.BOPM_UPDATE:if(e(this,b,"f").push(_),R(e(this,k,"f"))&&T(e(this,k,"f").imageId)&&1==e(this,k,"f").keepInBuffer)for(;e(this,b,"f").length>e(this,v,"f");){const _=e(this,b,"f").findIndex((_=>{var E;return(null===(E=_.tag)||void 0===E?void 0:E.imageId)!==e(this,k,"f").imageId}));e(this,b,"f").splice(_,1)}else e(this,b,"f").splice(0,e(this,b,"f").length-e(this,v,"f"))}else e(this,b,"f").push(_)}getImage(){if(0===e(this,b,"f").length)return null;let _;if(e(this,k,"f")&&T(e(this,k,"f").imageId)){const E=e(this,V,"m",Z).call(this,e(this,k,"f").imageId);if(E<0)throw new Error(`Image with id ${e(this,k,"f").imageId} doesn't exist.`);_=e(this,b,"f").slice(E,E+1)[0]}else _=e(this,b,"f").pop();if([s.IPF_RGB_565,s.IPF_RGB_555,s.IPF_RGB_888,s.IPF_ARGB_8888,s.IPF_RGB_161616,s.IPF_ARGB_16161616,s.IPF_ABGR_8888,s.IPF_ABGR_16161616,s.IPF_BGR_888].includes(_.format)){if(e(this,X,"f")===r.CCUT_RGB_R_CHANNEL_ONLY){x._onLog&&x._onLog("only get R channel data.");const E=new Uint8Array(_.width*_.height);for(let e=0;e<E.length;e++)switch(_.format){case s.IPF_RGB_565:case s.IPF_RGB_555:case s.IPF_RGB_888:case s.IPF_RGB_161616:E[e]=_.bytes[3*e+2];break;case s.IPF_ARGB_8888:case s.IPF_ARGB_16161616:E[e]=_.bytes[4*e+2];break;case s.IPF_BGR_888:E[e]=_.bytes[3*e];break;case s.IPF_ABGR_8888:case s.IPF_ABGR_16161616:E[e]=_.bytes[4*e]}_.bytes=E,_.stride=_.width,_.format=s.IPF_GRAYSCALED}else if(e(this,X,"f")===r.CCUT_RGB_G_CHANNEL_ONLY){x._onLog&&x._onLog("only get G channel data.");const E=new Uint8Array(_.width*_.height);for(let e=0;e<E.length;e++)switch(_.format){case s.IPF_RGB_565:case s.IPF_RGB_555:case s.IPF_RGB_888:case s.IPF_RGB_161616:case s.IPF_BGR_888:E[e]=_.bytes[3*e+1];break;case s.IPF_ARGB_8888:case s.IPF_ARGB_16161616:case s.IPF_ABGR_8888:case s.IPF_ABGR_16161616:E[e]=_.bytes[4*e+1]}_.bytes=E,_.stride=_.width,_.format=s.IPF_GRAYSCALED}else if(e(this,X,"f")===r.CCUT_RGB_B_CHANNEL_ONLY){x._onLog&&x._onLog("only get B channel data.");const E=new Uint8Array(_.width*_.height);for(let e=0;e<E.length;e++)switch(_.format){case s.IPF_RGB_565:case s.IPF_RGB_555:case s.IPF_RGB_888:case s.IPF_RGB_161616:E[e]=_.bytes[3*e];break;case s.IPF_ARGB_8888:case s.IPF_ARGB_16161616:E[e]=_.bytes[4*e];break;case s.IPF_BGR_888:E[e]=_.bytes[3*e+2];break;case s.IPF_ABGR_8888:case s.IPF_ABGR_16161616:E[e]=_.bytes[4*e+2]}_.bytes=E,_.stride=_.width,_.format=s.IPF_GRAYSCALED}}else[s.IPF_NV21,s.IPF_NV12].includes(_.format)&&x._onLog&&x._onLog("NV21 or NV12 is not supported.");return _}setNextImageToReturn(_,E){if(!((..._)=>0!==_.length&&_.every((_=>T(_))))(_))throw new TypeError("Invalid 'imageId'.");if(void 0!==E&&!a(E))throw new TypeError("Invalid 'keepInBuffer'.");t(this,k,{imageId:_,keepInBuffer:E},"f")}_resetNextReturnedImage(){t(this,k,null,"f")}hasImage(_){return e(this,V,"m",Z).call(this,_)>=0}startFetching(){t(this,H,!0,"f")}stopFetching(){t(this,H,!1,"f")}setMaxImageCount(_){if("number"!=typeof _)throw new TypeError("Invalid 'count'.");if(_<1||Math.round(_)!==_)throw new Error("Invalid 'count'.");for(t(this,v,_,"f");e(this,b,"f")&&e(this,b,"f").length>_;)e(this,b,"f").shift()}getMaxImageCount(){return e(this,v,"f")}getImageCount(){return e(this,b,"f").length}clearBuffer(){e(this,b,"f").length=0}isBufferEmpty(){return 0===e(this,b,"f").length}setBufferOverflowProtectionMode(_){t(this,Y,_,"f")}getBufferOverflowProtectionMode(){return e(this,Y,"f")}setColourChannelUsageType(_){t(this,X,_,"f")}getColourChannelUsageType(){return e(this,X,"f")}}let W,j,K,J,Q;b=new WeakMap,v=new WeakMap,Y=new WeakMap,H=new WeakMap,k=new WeakMap,X=new WeakMap,V=new WeakSet,Z=function(_){if("number"!=typeof _)throw new TypeError("Invalid 'imageId'.");return e(this,b,"f").findIndex((E=>{var e;return(null===(e=E.tag)||void 0===e?void 0:e.imageId)===_}))},"undefined"!=typeof navigator&&(W=navigator,j=W.userAgent,K=W.platform,J=W.mediaDevices),function(){if(!n){const _={Edge:{search:"Edg",verSearch:"Edg"},OPR:null,Chrome:null,Safari:{str:W.vendor,search:"Apple",verSearch:["Version","iPhone OS","CPU OS"]},Firefox:null,Explorer:{search:"MSIE",verSearch:"MSIE"}},E={HarmonyOS:null,Android:null,iPhone:null,iPad:null,Windows:{str:K,search:"Win"},Mac:{str:K},Linux:{str:K}};let e="unknownBrowser",t=0,I="unknownOS";for(let E in _){const I=_[E]||{};let r=I.str||j,s=I.search||E,n=I.verStr||j,C=I.verSearch||E;if(C instanceof Array||(C=[C]),-1!=r.indexOf(s)){e=E;for(let _ of C){let E=n.indexOf(_);if(-1!=E){t=parseFloat(n.substring(E+_.length+1));break}}break}}for(let _ in E){const e=E[_]||{};let t=e.str||j,r=e.search||_;if(-1!=t.indexOf(r)){I=_;break}}"Linux"==I&&-1!=j.indexOf("Windows NT")&&(I="HarmonyOS"),Q={browser:e,version:t,OS:I}}n&&(Q={browser:"ssr",version:0,OS:"ssr"})}();const $="undefined"!=typeof WebAssembly&&j&&!(/Safari/.test(j)&&!/Chrome/.test(j)&&/\(.+\s11_2_([2-6]).*\)/.test(j)),z=!("undefined"==typeof Worker),q=!(!J||!J.getUserMedia),__=async()=>{let _=!1;if(q)try{(await J.getUserMedia({video:!0})).getTracks().forEach((_=>{_.stop()})),_=!0}catch(_){}return _};"Chrome"===Q.browser&&Q.version>66||"Safari"===Q.browser&&Q.version>13||"OPR"===Q.browser&&Q.version>43||"Edge"===Q.browser&&Q.version;const E_={},e_=async _=>{let e="string"==typeof _?[_]:_,t=[];for(let _ of e)t.push(E_[_]=E_[_]||new E);await Promise.all(t)},t_=async(_,e)=>{let t,I="string"==typeof _?[_]:_,r=[];for(let _ of I){let I;r.push(I=E_[_]=E_[_]||new E(t=t||e())),I.isEmpty&&(I.task=t=t||e())}await Promise.all(r)};let I_,r_=0;const s_=()=>r_++,n_={};let C_;const i_=_=>{C_=_,I_&&I_.postMessage({type:"setBLog",body:{value:!!_}})};let A_=!1;const o_=_=>{A_=_,I_&&I_.postMessage({type:"setBDebug",body:{value:!!_}})},N_={},a_={},T_={dip:{wasm:!0}},R_={std:{version:"1.4.20",path:A(i+"../../dynamsoft-capture-vision-std@1.4.20/dist/"),isInternal:!0},core:{version:"3.4.30",path:i,isInternal:!0}},L_=async _=>{let e;_ instanceof Array||(_=_?[_]:[]);let t=E_.core;e=!t||t.isEmpty;let I=new Map;const r=_=>{if("std"==(_=_.toLowerCase())||"core"==_)return;if(!T_[_])throw Error("The '"+_+"' module cannot be found.");let E=T_[_].deps;if(null==E?void 0:E.length)for(let _ of E)r(_);let e=E_[_];I.has(_)||I.set(_,!e||e.isEmpty)};for(let E of _)r(E);let s=[];e&&s.push("core"),s.push(...I.keys());const n=[...I.entries()].filter((_=>!_[1])).map((_=>_[0]));await t_(s,(async()=>{const _=[...I.entries()].filter((_=>_[1])).map((_=>_[0]));await e_(n);const t=U(R_),r={};for(let E of _)r[E]=T_[E];const s={engineResourcePaths:t,autoResources:r,names:_};let C=new E;if(e){s.needLoadCore=!0;let _=t.core+D_._workerName;_.startsWith(location.origin)||(_=await fetch(_).then((_=>_.blob())).then((_=>URL.createObjectURL(_)))),I_=new Worker(_),I_.onerror=_=>{let E=new Error(_.message);C.reject(E)},I_.addEventListener("message",(_=>{let E=_.data?_.data:_,e=E.type,t=E.id,I=E.body;switch(e){case"log":C_&&C_(E.message);break;case"task":try{n_[t](I),delete n_[t]}catch(_){throw delete n_[t],_}break;case"event":try{n_[t](I)}catch(_){throw _}break;default:console.log(_)}})),s.bLog=!!C_,s.bd=A_,s.dm=location.origin.startsWith("http")?location.origin:"https://localhost"}else await e_("core");let i=r_++;n_[i]=_=>{if(_.success)Object.assign(N_,_.versions),"{}"!==JSON.stringify(_.versions)&&(D_._versions=_.versions),C.resolve(void 0);else{const E=Error(_.message);_.stack&&(E.stack=_.stack),C.reject(E)}},I_.postMessage({type:"loadWasm",body:s,id:i}),await C}))};class D_{static get engineResourcePaths(){return R_}static set engineResourcePaths(_){Object.assign(R_,_)}static get bSupportDce4Module(){return this._bSupportDce4Module}static get bSupportIRTModule(){return this._bSupportIRTModule}static get versions(){return this._versions}static get _onLog(){return C_}static set _onLog(_){i_(_)}static get _bDebug(){return A_}static set _bDebug(_){o_(_)}static isModuleLoaded(_){return _=(_=_||"core").toLowerCase(),!!E_[_]&&E_[_].isFulfilled}static async loadWasm(_){return await L_(_)}static async detectEnvironment(){return await(async()=>({wasm:$,worker:z,getUserMedia:q,camera:await __(),browser:Q.browser,version:Q.version,OS:Q.OS}))()}static async getModuleVersion(){return await new Promise(((_,E)=>{let e=s_();n_[e]=async e=>{if(e.success)return _(e.versions);{let _=new Error(e.message);return _.stack=e.stack+"\n"+_.stack,E(_)}},I_.postMessage({type:"getModuleVersion",id:e})}))}static getVersion(){const _=N_.core&&N_.core.worker,E=N_.core&&N_.core.wasm;return`3.4.30(Worker: ${_||"Not Loaded"}, Wasm: ${E||"Not Loaded"})`}static enableLogging(){x._onLog=console.log,D_._onLog=console.log}static disableLogging(){x._onLog=null,D_._onLog=null}static async cfd(_){return await new Promise(((E,e)=>{let t=s_();n_[t]=async _=>{if(_.success)return E();{let E=new Error(_.message);return E.stack=_.stack+"\n"+E.stack,e(E)}},I_.postMessage({type:"cfd",id:t,body:{count:_}})}))}}var O_,c_,S_,l_,f_,h_,d_,P_,g_;D_._bSupportDce4Module=-1,D_._bSupportIRTModule=-1,D_._versions=null,D_._workerName="core.worker.js",D_.browserInfo=Q,function(_){_[_.CRIT_ORIGINAL_IMAGE=1]="CRIT_ORIGINAL_IMAGE",_[_.CRIT_BARCODE=2]="CRIT_BARCODE",_[_.CRIT_TEXT_LINE=4]="CRIT_TEXT_LINE",_[_.CRIT_DETECTED_QUAD=8]="CRIT_DETECTED_QUAD",_[_.CRIT_NORMALIZED_IMAGE=16]="CRIT_NORMALIZED_IMAGE",_[_.CRIT_PARSED_RESULT=32]="CRIT_PARSED_RESULT"}(O_||(O_={})),function(_){_[_.CT_NORMAL_INTERSECTED=0]="CT_NORMAL_INTERSECTED",_[_.CT_T_INTERSECTED=1]="CT_T_INTERSECTED",_[_.CT_CROSS_INTERSECTED=2]="CT_CROSS_INTERSECTED",_[_.CT_NOT_INTERSECTED=3]="CT_NOT_INTERSECTED"}(c_||(c_={})),function(_){_[_.EC_OK=0]="EC_OK",_[_.EC_UNKNOWN=-1e4]="EC_UNKNOWN",_[_.EC_NO_MEMORY=-10001]="EC_NO_MEMORY",_[_.EC_NULL_POINTER=-10002]="EC_NULL_POINTER",_[_.EC_LICENSE_INVALID=-10003]="EC_LICENSE_INVALID",_[_.EC_LICENSE_EXPIRED=-10004]="EC_LICENSE_EXPIRED",_[_.EC_FILE_NOT_FOUND=-10005]="EC_FILE_NOT_FOUND",_[_.EC_FILE_TYPE_NOT_SUPPORTED=-10006]="EC_FILE_TYPE_NOT_SUPPORTED",_[_.EC_BPP_NOT_SUPPORTED=-10007]="EC_BPP_NOT_SUPPORTED",_[_.EC_INDEX_INVALID=-10008]="EC_INDEX_INVALID",_[_.EC_CUSTOM_REGION_INVALID=-10010]="EC_CUSTOM_REGION_INVALID",_[_.EC_IMAGE_READ_FAILED=-10012]="EC_IMAGE_READ_FAILED",_[_.EC_TIFF_READ_FAILED=-10013]="EC_TIFF_READ_FAILED",_[_.EC_DIB_BUFFER_INVALID=-10018]="EC_DIB_BUFFER_INVALID",_[_.EC_PDF_READ_FAILED=-10021]="EC_PDF_READ_FAILED",_[_.EC_PDF_DLL_MISSING=-10022]="EC_PDF_DLL_MISSING",_[_.EC_PAGE_NUMBER_INVALID=-10023]="EC_PAGE_NUMBER_INVALID",_[_.EC_CUSTOM_SIZE_INVALID=-10024]="EC_CUSTOM_SIZE_INVALID",_[_.EC_TIMEOUT=-10026]="EC_TIMEOUT",_[_.EC_JSON_PARSE_FAILED=-10030]="EC_JSON_PARSE_FAILED",_[_.EC_JSON_TYPE_INVALID=-10031]="EC_JSON_TYPE_INVALID",_[_.EC_JSON_KEY_INVALID=-10032]="EC_JSON_KEY_INVALID",_[_.EC_JSON_VALUE_INVALID=-10033]="EC_JSON_VALUE_INVALID",_[_.EC_JSON_NAME_KEY_MISSING=-10034]="EC_JSON_NAME_KEY_MISSING",_[_.EC_JSON_NAME_VALUE_DUPLICATED=-10035]="EC_JSON_NAME_VALUE_DUPLICATED",_[_.EC_TEMPLATE_NAME_INVALID=-10036]="EC_TEMPLATE_NAME_INVALID",_[_.EC_JSON_NAME_REFERENCE_INVALID=-10037]="EC_JSON_NAME_REFERENCE_INVALID",_[_.EC_PARAMETER_VALUE_INVALID=-10038]="EC_PARAMETER_VALUE_INVALID",_[_.EC_DOMAIN_NOT_MATCH=-10039]="EC_DOMAIN_NOT_MATCH",_[_.EC_RESERVED_INFO_NOT_MATCH=-10040]="EC_RESERVED_INFO_NOT_MATCH",_[_.EC_LICENSE_KEY_NOT_MATCH=-10043]="EC_LICENSE_KEY_NOT_MATCH",_[_.EC_REQUEST_FAILED=-10044]="EC_REQUEST_FAILED",_[_.EC_LICENSE_INIT_FAILED=-10045]="EC_LICENSE_INIT_FAILED",_[_.EC_SET_MODE_ARGUMENT_ERROR=-10051]="EC_SET_MODE_ARGUMENT_ERROR",_[_.EC_LICENSE_CONTENT_INVALID=-10052]="EC_LICENSE_CONTENT_INVALID",_[_.EC_LICENSE_KEY_INVALID=-10053]="EC_LICENSE_KEY_INVALID",_[_.EC_LICENSE_DEVICE_RUNS_OUT=-10054]="EC_LICENSE_DEVICE_RUNS_OUT",_[_.EC_GET_MODE_ARGUMENT_ERROR=-10055]="EC_GET_MODE_ARGUMENT_ERROR",_[_.EC_IRT_LICENSE_INVALID=-10056]="EC_IRT_LICENSE_INVALID",_[_.EC_FILE_SAVE_FAILED=-10058]="EC_FILE_SAVE_FAILED",_[_.EC_STAGE_TYPE_INVALID=-10059]="EC_STAGE_TYPE_INVALID",_[_.EC_IMAGE_ORIENTATION_INVALID=-10060]="EC_IMAGE_ORIENTATION_INVALID",_[_.EC_CONVERT_COMPLEX_TEMPLATE_ERROR=-10061]="EC_CONVERT_COMPLEX_TEMPLATE_ERROR",_[_.EC_CALL_REJECTED_WHEN_CAPTURING=-10062]="EC_CALL_REJECTED_WHEN_CAPTURING",_[_.EC_NO_IMAGE_SOURCE=-10063]="EC_NO_IMAGE_SOURCE",_[_.EC_READ_DIRECTORY_FAILED=-10064]="EC_READ_DIRECTORY_FAILED",_[_.EC_MODULE_NOT_FOUND=-10065]="EC_MODULE_NOT_FOUND",_[_.EC_MULTI_PAGES_NOT_SUPPORTED=-10066]="EC_MULTI_PAGES_NOT_SUPPORTED",_[_.EC_FILE_ALREADY_EXISTS=-10067]="EC_FILE_ALREADY_EXISTS",_[_.EC_CREATE_FILE_FAILED=-10068]="EC_CREATE_FILE_FAILED",_[_.EC_IMGAE_DATA_INVALID=-10069]="EC_IMGAE_DATA_INVALID",_[_.EC_IMAGE_SIZE_NOT_MATCH=-10070]="EC_IMAGE_SIZE_NOT_MATCH",_[_.EC_IMAGE_PIXEL_FORMAT_NOT_MATCH=-10071]="EC_IMAGE_PIXEL_FORMAT_NOT_MATCH",_[_.EC_SECTION_LEVEL_RESULT_IRREPLACEABLE=-10072]="EC_SECTION_LEVEL_RESULT_IRREPLACEABLE",_[_.EC_AXIS_DEFINITION_INCORRECT=-10073]="EC_AXIS_DEFINITION_INCORRECT",_[_.EC_RESULT_TYPE_MISMATCH_IRREPLACEABLE=-10074]="EC_RESULT_TYPE_MISMATCH_IRREPLACEABLE",_[_.EC_PDF_LIBRARY_LOAD_FAILED=-10075]="EC_PDF_LIBRARY_LOAD_FAILED",_[_.EC_NO_LICENSE=-2e4]="EC_NO_LICENSE",_[_.EC_HANDSHAKE_CODE_INVALID=-20001]="EC_HANDSHAKE_CODE_INVALID",_[_.EC_LICENSE_BUFFER_FAILED=-20002]="EC_LICENSE_BUFFER_FAILED",_[_.EC_LICENSE_SYNC_FAILED=-20003]="EC_LICENSE_SYNC_FAILED",_[_.EC_DEVICE_NOT_MATCH=-20004]="EC_DEVICE_NOT_MATCH",_[_.EC_BIND_DEVICE_FAILED=-20005]="EC_BIND_DEVICE_FAILED",_[_.EC_INSTANCE_COUNT_OVER_LIMIT=-20008]="EC_INSTANCE_COUNT_OVER_LIMIT",_[_.EC_LICENSE_INIT_SEQUENCE_FAILED=-20009]="EC_LICENSE_INIT_SEQUENCE_FAILED",_[_.EC_TRIAL_LICENSE=-20010]="EC_TRIAL_LICENSE",_[_.EC_FAILED_TO_REACH_DLS=-20200]="EC_FAILED_TO_REACH_DLS",_[_.EC_LICENSE_CACHE_USED=-20012]="EC_LICENSE_CACHE_USED",_[_.EC_BARCODE_FORMAT_INVALID=-30009]="EC_BARCODE_FORMAT_INVALID",_[_.EC_QR_LICENSE_INVALID=-30016]="EC_QR_LICENSE_INVALID",_[_.EC_1D_LICENSE_INVALID=-30017]="EC_1D_LICENSE_INVALID",_[_.EC_PDF417_LICENSE_INVALID=-30019]="EC_PDF417_LICENSE_INVALID",_[_.EC_DATAMATRIX_LICENSE_INVALID=-30020]="EC_DATAMATRIX_LICENSE_INVALID",_[_.EC_CUSTOM_MODULESIZE_INVALID=-30025]="EC_CUSTOM_MODULESIZE_INVALID",_[_.EC_AZTEC_LICENSE_INVALID=-30041]="EC_AZTEC_LICENSE_INVALID",_[_.EC_PATCHCODE_LICENSE_INVALID=-30046]="EC_PATCHCODE_LICENSE_INVALID",_[_.EC_POSTALCODE_LICENSE_INVALID=-30047]="EC_POSTALCODE_LICENSE_INVALID",_[_.EC_DPM_LICENSE_INVALID=-30048]="EC_DPM_LICENSE_INVALID",_[_.EC_FRAME_DECODING_THREAD_EXISTS=-30049]="EC_FRAME_DECODING_THREAD_EXISTS",_[_.EC_STOP_DECODING_THREAD_FAILED=-30050]="EC_STOP_DECODING_THREAD_FAILED",_[_.EC_MAXICODE_LICENSE_INVALID=-30057]="EC_MAXICODE_LICENSE_INVALID",_[_.EC_GS1_DATABAR_LICENSE_INVALID=-30058]="EC_GS1_DATABAR_LICENSE_INVALID",_[_.EC_GS1_COMPOSITE_LICENSE_INVALID=-30059]="EC_GS1_COMPOSITE_LICENSE_INVALID",_[_.EC_DOTCODE_LICENSE_INVALID=-30061]="EC_DOTCODE_LICENSE_INVALID",_[_.EC_PHARMACODE_LICENSE_INVALID=-30062]="EC_PHARMACODE_LICENSE_INVALID",_[_.EC_CHARACTER_MODEL_FILE_NOT_FOUND=-40100]="EC_CHARACTER_MODEL_FILE_NOT_FOUND",_[_.EC_TEXT_LINE_GROUP_LAYOUT_CONFLICT=-40101]="EC_TEXT_LINE_GROUP_LAYOUT_CONFLICT",_[_.EC_TEXT_LINE_GROUP_REGEX_CONFLICT=-40102]="EC_TEXT_LINE_GROUP_REGEX_CONFLICT",_[_.EC_QUADRILATERAL_INVALID=-50057]="EC_QUADRILATERAL_INVALID",_[_.EC_PANORAMA_LICENSE_INVALID=-70060]="EC_PANORAMA_LICENSE_INVALID",_[_.EC_RESOURCE_PATH_NOT_EXIST=-90001]="EC_RESOURCE_PATH_NOT_EXIST",_[_.EC_RESOURCE_LOAD_FAILED=-90002]="EC_RESOURCE_LOAD_FAILED",_[_.EC_CODE_SPECIFICATION_NOT_FOUND=-90003]="EC_CODE_SPECIFICATION_NOT_FOUND",_[_.EC_FULL_CODE_EMPTY=-90004]="EC_FULL_CODE_EMPTY",_[_.EC_FULL_CODE_PREPROCESS_FAILED=-90005]="EC_FULL_CODE_PREPROCESS_FAILED",_[_.EC_ZA_DL_LICENSE_INVALID=-90006]="EC_ZA_DL_LICENSE_INVALID",_[_.EC_AAMVA_DL_ID_LICENSE_INVALID=-90007]="EC_AAMVA_DL_ID_LICENSE_INVALID",_[_.EC_AADHAAR_LICENSE_INVALID=-90008]="EC_AADHAAR_LICENSE_INVALID",_[_.EC_MRTD_LICENSE_INVALID=-90009]="EC_MRTD_LICENSE_INVALID",_[_.EC_VIN_LICENSE_INVALID=-90010]="EC_VIN_LICENSE_INVALID",_[_.EC_CUSTOMIZED_CODE_TYPE_LICENSE_INVALID=-90011]="EC_CUSTOMIZED_CODE_TYPE_LICENSE_INVALID",_[_.EC_LICENSE_WARNING=-10076]="EC_LICENSE_WARNING",_[_.EC_BARCODE_READER_LICENSE_NOT_FOUND=-30063]="EC_BARCODE_READER_LICENSE_NOT_FOUND",_[_.EC_LABEL_RECOGNIZER_LICENSE_NOT_FOUND=-40103]="EC_LABEL_RECOGNIZER_LICENSE_NOT_FOUND",_[_.EC_DOCUMENT_NORMALIZER_LICENSE_NOT_FOUND=-50058]="EC_DOCUMENT_NORMALIZER_LICENSE_NOT_FOUND",_[_.EC_CODE_PARSER_LICENSE_NOT_FOUND=-90012]="EC_CODE_PARSER_LICENSE_NOT_FOUND"}(S_||(S_={})),function(_){_[_.GEM_SKIP=0]="GEM_SKIP",_[_.GEM_AUTO=1]="GEM_AUTO",_[_.GEM_GENERAL=2]="GEM_GENERAL",_[_.GEM_GRAY_EQUALIZE=4]="GEM_GRAY_EQUALIZE",_[_.GEM_GRAY_SMOOTH=8]="GEM_GRAY_SMOOTH",_[_.GEM_SHARPEN_SMOOTH=16]="GEM_SHARPEN_SMOOTH",_[_.GEM_REV=-2147483648]="GEM_REV"}(l_||(l_={})),function(_){_[_.GTM_SKIP=0]="GTM_SKIP",_[_.GTM_INVERTED=1]="GTM_INVERTED",_[_.GTM_ORIGINAL=2]="GTM_ORIGINAL",_[_.GTM_AUTO=4]="GTM_AUTO",_[_.GTM_REV=-2147483648]="GTM_REV"}(f_||(f_={})),function(_){_[_.ITT_FILE_IMAGE=0]="ITT_FILE_IMAGE",_[_.ITT_VIDEO_FRAME=1]="ITT_VIDEO_FRAME"}(h_||(h_={})),function(_){_[_.PDFRM_VECTOR=1]="PDFRM_VECTOR",_[_.PDFRM_RASTER=2]="PDFRM_RASTER",_[_.PDFRM_REV=-2147483648]="PDFRM_REV"}(d_||(d_={})),function(_){_[_.RDS_RASTERIZED_PAGES=0]="RDS_RASTERIZED_PAGES",_[_.RDS_EXTRACTED_IMAGES=1]="RDS_EXTRACTED_IMAGES"}(P_||(P_={})),function(_){_[_.CVS_NOT_VERIFIED=0]="CVS_NOT_VERIFIED",_[_.CVS_PASSED=1]="CVS_PASSED",_[_.CVS_FAILED=2]="CVS_FAILED"}(g_||(g_={}));const M_={IRUT_NULL:BigInt(0),IRUT_COLOUR_IMAGE:BigInt(1),IRUT_SCALED_DOWN_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_UP_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_NORMALIZED_IMAGES:BigInt(1<<26),IRUT_SHORT_LINES:BigInt(1<<27),IRUT_RAW_TEXT_LINES:BigInt(1<<28),IRUT_LOGIC_LINES:BigInt(1<<29),IRUT_ALL:BigInt("0xFFFFFFFFFFFFFFFF")};var u_,F_;!function(_){_[_.ROET_PREDETECTED_REGION=0]="ROET_PREDETECTED_REGION",_[_.ROET_LOCALIZED_BARCODE=1]="ROET_LOCALIZED_BARCODE",_[_.ROET_DECODED_BARCODE=2]="ROET_DECODED_BARCODE",_[_.ROET_LOCALIZED_TEXT_LINE=3]="ROET_LOCALIZED_TEXT_LINE",_[_.ROET_RECOGNIZED_TEXT_LINE=4]="ROET_RECOGNIZED_TEXT_LINE",_[_.ROET_DETECTED_QUAD=5]="ROET_DETECTED_QUAD",_[_.ROET_NORMALIZED_IMAGE=6]="ROET_NORMALIZED_IMAGE",_[_.ROET_SOURCE_IMAGE=7]="ROET_SOURCE_IMAGE",_[_.ROET_TARGET_ROI=8]="ROET_TARGET_ROI"}(u_||(u_={})),function(_){_[_.ST_NULL=0]="ST_NULL",_[_.ST_REGION_PREDETECTION=1]="ST_REGION_PREDETECTION",_[_.ST_BARCODE_LOCALIZATION=2]="ST_BARCODE_LOCALIZATION",_[_.ST_BARCODE_DECODING=3]="ST_BARCODE_DECODING",_[_.ST_TEXT_LINE_LOCALIZATION=4]="ST_TEXT_LINE_LOCALIZATION",_[_.ST_TEXT_LINE_RECOGNITION=5]="ST_TEXT_LINE_RECOGNITION",_[_.ST_DOCUMENT_DETECTION=6]="ST_DOCUMENT_DETECTION",_[_.ST_DOCUMENT_NORMALIZATION=7]="ST_DOCUMENT_NORMALIZATION"}(F_||(F_={}));export{D_ as CoreModule,I as EnumBufferOverflowProtectionMode,O_ as EnumCapturedResultItemType,r as EnumColourChannelUsageType,c_ as EnumCornerType,g_ as EnumCrossVerificationStatus,S_ as EnumErrorCode,l_ as EnumGrayscaleEnhancementMode,f_ as EnumGrayscaleTransformationMode,s as EnumImagePixelFormat,h_ as EnumImageTagType,M_ as EnumIntermediateResultUnitType,d_ as EnumPDFReadingMode,P_ as EnumRasterDataSource,u_ as EnumRegionObjectElementType,F_ as EnumSectionType,x as ImageSourceAdapter,w as _getNorImageData,B as _saveToFile,y as _toBlob,p as _toCanvas,m as _toImage,A_ as bDebug,F as checkIsLink,G as compareVersion,t_ as doOrWaitAsyncDependency,s_ as getNextTaskID,U as handleEngineResourcePaths,N_ as innerVersions,L as isArc,D as isContour,S as isDSImageData,l as isDSRect,f as isImageTag,h as isLineSegment,R as isObject,c as isOriginalDsImageData,d as isPoint,P as isPolygon,g as isQuad,M as isRect,L_ as loadWasm,E_ as mapAsyncDependency,a_ as mapPackageRegister,n_ as mapTaskCallBack,C_ as onLog,u as requestResource,o_ as setBDebug,i_ as setOnLog,e_ as waitAsyncDependency,I_ as worker,T_ as workerAutoResources}; |
@@ -11,2 +11,2 @@ /*! | ||
*/ | ||
!function(e,E){"object"==typeof exports&&"undefined"!=typeof module?E(exports):"function"==typeof define&&define.amd?define(["exports"],E):E(((e="undefined"!=typeof globalThis?globalThis:e||self).Dynamsoft=e.Dynamsoft||{},e.Dynamsoft.Core={}))}(this,(function(e){"use strict";const E=e=>e&&"object"==typeof e&&"function"==typeof e.then;class _ extends Promise{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 _;this._task=e,E(e)?_=e:"function"==typeof e&&(_=new Promise(e)),_&&(async()=>{try{const E=await _;e===this._task&&this.resolve(E)}catch(E){e===this._task&&this.reject(E)}})()}get isEmpty(){return null==this._task}constructor(e){let _,t;super(((e,E)=>{_=e,t=E})),this._s="pending",this.resolve=e=>{this.isPending&&(E(e)?this.task=e:(this._s="fulfilled",_(e)))},this.reject=e=>{this.isPending&&(this._s="rejected",t(e))},this.task=e}}function t(e,E,_,t){if("a"===_&&!t)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof E?e!==E||!t:!E.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===_?t:"a"===_?t.call(e):t?t.value:E.get(e)}function I(e,E,_,t,I){if("m"===t)throw new TypeError("Private method is not writable");if("a"===t&&!I)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof E?e!==E||!I:!E.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===t?I.call(e,_):I?I.value=_:E.set(e,_),_}var r,n,o;"function"==typeof SuppressedError&&SuppressedError,e.EnumBufferOverflowProtectionMode=void 0,(r=e.EnumBufferOverflowProtectionMode||(e.EnumBufferOverflowProtectionMode={}))[r.BOPM_BLOCK=0]="BOPM_BLOCK",r[r.BOPM_UPDATE=1]="BOPM_UPDATE",e.EnumColourChannelUsageType=void 0,(n=e.EnumColourChannelUsageType||(e.EnumColourChannelUsageType={}))[n.CCUT_AUTO=0]="CCUT_AUTO",n[n.CCUT_FULL_CHANNEL=1]="CCUT_FULL_CHANNEL",n[n.CCUT_Y_CHANNEL_ONLY=2]="CCUT_Y_CHANNEL_ONLY",n[n.CCUT_RGB_R_CHANNEL_ONLY=3]="CCUT_RGB_R_CHANNEL_ONLY",n[n.CCUT_RGB_G_CHANNEL_ONLY=4]="CCUT_RGB_G_CHANNEL_ONLY",n[n.CCUT_RGB_B_CHANNEL_ONLY=5]="CCUT_RGB_B_CHANNEL_ONLY",e.EnumImagePixelFormat=void 0,(o=e.EnumImagePixelFormat||(e.EnumImagePixelFormat={}))[o.IPF_BINARY=0]="IPF_BINARY",o[o.IPF_BINARYINVERTED=1]="IPF_BINARYINVERTED",o[o.IPF_GRAYSCALED=2]="IPF_GRAYSCALED",o[o.IPF_NV21=3]="IPF_NV21",o[o.IPF_RGB_565=4]="IPF_RGB_565",o[o.IPF_RGB_555=5]="IPF_RGB_555",o[o.IPF_RGB_888=6]="IPF_RGB_888",o[o.IPF_ARGB_8888=7]="IPF_ARGB_8888",o[o.IPF_RGB_161616=8]="IPF_RGB_161616",o[o.IPF_ARGB_16161616=9]="IPF_ARGB_16161616",o[o.IPF_ABGR_8888=10]="IPF_ABGR_8888",o[o.IPF_ABGR_16161616=11]="IPF_ABGR_16161616",o[o.IPF_BGR_888=12]="IPF_BGR_888",o[o.IPF_BINARY_8=13]="IPF_BINARY_8",o[o.IPF_NV12=14]="IPF_NV12",o[o.IPF_BINARY_8_INVERTED=15]="IPF_BINARY_8_INVERTED";const a="undefined"==typeof self,s="function"==typeof importScripts,i=(()=>{if(!s){if(!a&&document.currentScript){let e=document.currentScript.src,E=e.indexOf("?");if(-1!=E)e=e.substring(0,E);else{let E=e.indexOf("#");-1!=E&&(e=e.substring(0,E))}return e.substring(0,e.lastIndexOf("/")+1)}return"./"}})(),C=e=>{if(null==e&&(e="./"),a||s);else{let E=document.createElement("a");E.href=e,e=E.href}return e.endsWith("/")||(e+="/"),e},A=e=>Object.prototype.toString.call(e),T=e=>Array.isArray?Array.isArray(e):"[object Array]"===A(e),N=e=>"[object Boolean]"===A(e),R=e=>"number"==typeof e&&!Number.isNaN(e),L=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),D=e=>!!L(e)&&(!!R(e.width)&&(!(e.width<=0)&&(!!R(e.height)&&(!(e.height<=0)&&(!!R(e.stride)&&(!(e.stride<=0)&&("format"in e&&!("tag"in e&&!l(e.tag))))))))),O=e=>!!D(e)&&e.bytes instanceof Uint8Array,l=e=>null===e||!!L(e)&&(!!R(e.imageId)&&"type"in e),m=e=>!!L(e)&&(!!R(e.x)&&!!R(e.y)),c=e=>{const E={},_={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",dcpd:"dynamsoft-code-parser",dlrData:"dynamsoft-label-recognizer-data",dce:"dynamsoft-camera-enhancer",ddv:"dynamsoft-document-viewer"};for(let t in e){if("rootDirectory"===t)continue;let I=t,r=e[I],n=r&&"object"==typeof r&&r.path?r.path:r,o=e.rootDirectory;if(o&&!o.endsWith("/")&&(o+="/"),"object"==typeof r&&r.isInternal)o&&(n=e[I].version?`${o}${_[I]}@${e[I].version}/dist/${"ddv"===I?"engine":""}`:`${o}${_[I]}/dist/${"ddv"===I?"engine":""}`);else{const _=/^@engineRootDirectory(\/?)/;if("string"==typeof n&&(n=n.replace(_,o||"")),"object"==typeof n&&"dwt"===I){const t=e[I].resourcesPath,r=e[I].serviceInstallerLocation;E[I]={resourcesPath:t.replace(_,o||""),serviceInstallerLocation:r.replace(_,o||"")};continue}}E[I]=C(n)}return E},u=e=>{O(e)&&(e=g(e));const E=document.createElement("canvas");E.width=e.width,E.height=e.height;return E.getContext("2d",{willReadFrequently:!0}).putImageData(e,0,0),E},S=async(e,E)=>{O(E)&&(E=g(E));const _=u(E);return new Promise(((E,t)=>{_.toBlob((e=>E(e)),e)}))},g=E=>{let _,t=E.bytes;if(!(t&&t instanceof Uint8Array))throw Error("Parameter type error");if(Number(E.format)===e.EnumImagePixelFormat.IPF_BGR_888){const e=t.length/3;_=new Uint8ClampedArray(4*e);for(let E=0;E<e;++E)_[4*E]=t[3*E],_[4*E+1]=t[3*E+1],_[4*E+2]=t[3*E+2],_[4*E+3]=255}else if(Number(E.format)===e.EnumImagePixelFormat.IPF_RGB_888){const e=t.length/3;_=new Uint8ClampedArray(4*e);for(let E=0;E<e;++E)_[4*E]=t[3*E+2],_[4*E+1]=t[3*E+1],_[4*E+2]=t[3*E],_[4*E+3]=255}else if(Number(E.format)===e.EnumImagePixelFormat.IPF_GRAYSCALED){const e=t.length;_=new Uint8ClampedArray(4*e);for(let E=0;E<e;E++)_[4*E]=_[4*E+1]=_[4*E+2]=t[E],_[4*E+3]=255}else if(Number(E.format)===e.EnumImagePixelFormat.IPF_BINARY_8){const e=t.length,I=E.width,r=E.height,n=E.stride;_=new Uint8ClampedArray(I*r*4);for(let E=0;E<e;E++){let e=t[E],r=E%n,o=Math.floor(E/n);for(let E=0;E<8;E++){let t=r+E,n=4*(o*I+t);if(t>=I)break;_[n]=_[n+1]=_[n+2]=(128&e)/128*255,_[n+3]=255,e<<=1}}}else if(Number(E.format)===e.EnumImagePixelFormat.IPF_ABGR_8888){const e=t.length/4;_=new Uint8ClampedArray(t.length);for(let E=0;E<e;++E)_[4*E]=t[4*E],_[4*E+1]=t[4*E+1],_[4*E+2]=t[4*E+2],_[4*E+3]=t[4*E+3]}else if(Number(E.format)===e.EnumImagePixelFormat.IPF_ARGB_8888){const e=t.length/4;_=new Uint8ClampedArray(t.length);for(let E=0;E<e;++E)_[4*E]=t[4*E+2],_[4*E+1]=t[4*E+1],_[4*E+2]=t[4*E],_[4*E+3]=t[4*E+3]}else if(Number(E.format)===e.EnumImagePixelFormat.IPF_BINARY_8_INVERTED){const e=t.length,I=E.width,r=E.height,n=E.stride;_=new Uint8ClampedArray(I*r*4);for(let E=0;E<e;E++){let e=t[E],r=E%n,o=Math.floor(E/n);for(let E=0;E<8;E++){let t=r+E,n=4*(o*I+t);if(t>=I)break;_[n]=_[n+1]=_[n+2]=128&e?0:255,_[n+3]=255,e<<=1}}}return new ImageData(_,E.width,E.height)};var d,P,f,F,h,M,G,U;class p{get _isFetchingStarted(){return t(this,h,"f")}constructor(){d.add(this),P.set(this,[]),f.set(this,1),F.set(this,e.EnumBufferOverflowProtectionMode.BOPM_BLOCK),h.set(this,!1),M.set(this,void 0),G.set(this,e.EnumColourChannelUsageType.CCUT_AUTO)}setErrorListener(e){}addImageToBuffer(E){var _;if(!O(E))throw new TypeError("Invalid 'image'.");if((null===(_=E.tag)||void 0===_?void 0:_.hasOwnProperty("imageId"))&&"number"==typeof E.tag.imageId&&this.hasImage(E.tag.imageId))throw new Error("Existed imageId.");if(t(this,P,"f").length>=t(this,f,"f"))switch(t(this,F,"f")){case e.EnumBufferOverflowProtectionMode.BOPM_BLOCK:break;case e.EnumBufferOverflowProtectionMode.BOPM_UPDATE:if(t(this,P,"f").push(E),L(t(this,M,"f"))&&R(t(this,M,"f").imageId)&&1==t(this,M,"f").keepInBuffer)for(;t(this,P,"f").length>t(this,f,"f");){const e=t(this,P,"f").findIndex((e=>{var E;return(null===(E=e.tag)||void 0===E?void 0:E.imageId)!==t(this,M,"f").imageId}));t(this,P,"f").splice(e,1)}else t(this,P,"f").splice(0,t(this,P,"f").length-t(this,f,"f"))}else t(this,P,"f").push(E)}getImage(){if(0===t(this,P,"f").length)return null;let E;if(t(this,M,"f")&&R(t(this,M,"f").imageId)){const e=t(this,d,"m",U).call(this,t(this,M,"f").imageId);if(e<0)throw new Error(`Image with id ${t(this,M,"f").imageId} doesn't exist.`);E=t(this,P,"f").slice(e,e+1)[0]}else E=t(this,P,"f").pop();if([e.EnumImagePixelFormat.IPF_RGB_565,e.EnumImagePixelFormat.IPF_RGB_555,e.EnumImagePixelFormat.IPF_RGB_888,e.EnumImagePixelFormat.IPF_ARGB_8888,e.EnumImagePixelFormat.IPF_RGB_161616,e.EnumImagePixelFormat.IPF_ARGB_16161616,e.EnumImagePixelFormat.IPF_ABGR_8888,e.EnumImagePixelFormat.IPF_ABGR_16161616,e.EnumImagePixelFormat.IPF_BGR_888].includes(E.format)){if(t(this,G,"f")===e.EnumColourChannelUsageType.CCUT_RGB_R_CHANNEL_ONLY){p._onLog&&p._onLog("only get R channel data.");const _=new Uint8Array(E.width*E.height);for(let t=0;t<_.length;t++)switch(E.format){case e.EnumImagePixelFormat.IPF_RGB_565:case e.EnumImagePixelFormat.IPF_RGB_555:case e.EnumImagePixelFormat.IPF_RGB_888:case e.EnumImagePixelFormat.IPF_RGB_161616:_[t]=E.bytes[3*t+2];break;case e.EnumImagePixelFormat.IPF_ARGB_8888:case e.EnumImagePixelFormat.IPF_ARGB_16161616:_[t]=E.bytes[4*t+2];break;case e.EnumImagePixelFormat.IPF_BGR_888:_[t]=E.bytes[3*t];break;case e.EnumImagePixelFormat.IPF_ABGR_8888:case e.EnumImagePixelFormat.IPF_ABGR_16161616:_[t]=E.bytes[4*t]}E.bytes=_,E.stride=E.width,E.format=e.EnumImagePixelFormat.IPF_GRAYSCALED}else if(t(this,G,"f")===e.EnumColourChannelUsageType.CCUT_RGB_G_CHANNEL_ONLY){p._onLog&&p._onLog("only get G channel data.");const _=new Uint8Array(E.width*E.height);for(let t=0;t<_.length;t++)switch(E.format){case e.EnumImagePixelFormat.IPF_RGB_565:case e.EnumImagePixelFormat.IPF_RGB_555:case e.EnumImagePixelFormat.IPF_RGB_888:case e.EnumImagePixelFormat.IPF_RGB_161616:case e.EnumImagePixelFormat.IPF_BGR_888:_[t]=E.bytes[3*t+1];break;case e.EnumImagePixelFormat.IPF_ARGB_8888:case e.EnumImagePixelFormat.IPF_ARGB_16161616:case e.EnumImagePixelFormat.IPF_ABGR_8888:case e.EnumImagePixelFormat.IPF_ABGR_16161616:_[t]=E.bytes[4*t+1]}E.bytes=_,E.stride=E.width,E.format=e.EnumImagePixelFormat.IPF_GRAYSCALED}else if(t(this,G,"f")===e.EnumColourChannelUsageType.CCUT_RGB_B_CHANNEL_ONLY){p._onLog&&p._onLog("only get B channel data.");const _=new Uint8Array(E.width*E.height);for(let t=0;t<_.length;t++)switch(E.format){case e.EnumImagePixelFormat.IPF_RGB_565:case e.EnumImagePixelFormat.IPF_RGB_555:case e.EnumImagePixelFormat.IPF_RGB_888:case e.EnumImagePixelFormat.IPF_RGB_161616:_[t]=E.bytes[3*t];break;case e.EnumImagePixelFormat.IPF_ARGB_8888:case e.EnumImagePixelFormat.IPF_ARGB_16161616:_[t]=E.bytes[4*t];break;case e.EnumImagePixelFormat.IPF_BGR_888:_[t]=E.bytes[3*t+2];break;case e.EnumImagePixelFormat.IPF_ABGR_8888:case e.EnumImagePixelFormat.IPF_ABGR_16161616:_[t]=E.bytes[4*t+2]}E.bytes=_,E.stride=E.width,E.format=e.EnumImagePixelFormat.IPF_GRAYSCALED}}else[e.EnumImagePixelFormat.IPF_NV21,e.EnumImagePixelFormat.IPF_NV12].includes(E.format)&&p._onLog&&p._onLog("NV21 or NV12 is not supported.");return E}setNextImageToReturn(e,E){if(!((...e)=>0!==e.length&&e.every((e=>R(e))))(e))throw new TypeError("Invalid 'imageId'.");if(void 0!==E&&!N(E))throw new TypeError("Invalid 'keepInBuffer'.");I(this,M,{imageId:e,keepInBuffer:E},"f")}_resetNextReturnedImage(){I(this,M,null,"f")}hasImage(e){return t(this,d,"m",U).call(this,e)>=0}startFetching(){I(this,h,!0,"f")}stopFetching(){I(this,h,!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(I(this,f,e,"f");t(this,P,"f")&&t(this,P,"f").length>e;)t(this,P,"f").shift()}getMaxImageCount(){return t(this,f,"f")}getImageCount(){return t(this,P,"f").length}clearBuffer(){t(this,P,"f").length=0}isBufferEmpty(){return 0===t(this,P,"f").length}setBufferOverflowProtectionMode(e){I(this,F,e,"f")}getBufferOverflowProtectionMode(){return t(this,F,"f")}setColourChannelUsageType(e){I(this,G,e,"f")}getColourChannelUsageType(){return t(this,G,"f")}}let y,B,w,V,b;P=new WeakMap,f=new WeakMap,F=new WeakMap,h=new WeakMap,M=new WeakMap,G=new WeakMap,d=new WeakSet,U=function(e){if("number"!=typeof e)throw new TypeError("Invalid 'imageId'.");return t(this,P,"f").findIndex((E=>{var _;return(null===(_=E.tag)||void 0===_?void 0:_.imageId)===e}))},"undefined"!=typeof navigator&&(y=navigator,B=y.userAgent,w=y.platform,V=y.mediaDevices),function(){if(!a){const e={Edge:{search:"Edg",verSearch:"Edg"},OPR:null,Chrome:null,Safari:{str:y.vendor,search:"Apple",verSearch:["Version","iPhone OS","CPU OS"]},Firefox:null,Explorer:{search:"MSIE",verSearch:"MSIE"}},E={HarmonyOS:null,Android:null,iPhone:null,iPad:null,Windows:{str:w,search:"Win"},Mac:{str:w},Linux:{str:w}};let _="unknownBrowser",t=0,I="unknownOS";for(let E in e){const I=e[E]||{};let r=I.str||B,n=I.search||E,o=I.verStr||B,a=I.verSearch||E;if(a instanceof Array||(a=[a]),-1!=r.indexOf(n)){_=E;for(let e of a){let E=o.indexOf(e);if(-1!=E){t=parseFloat(o.substring(E+e.length+1));break}}break}}for(let e in E){const _=E[e]||{};let t=_.str||B,r=_.search||e;if(-1!=t.indexOf(r)){I=e;break}}"Linux"==I&&-1!=B.indexOf("Windows NT")&&(I="HarmonyOS"),b={browser:_,version:t,OS:I}}a&&(b={browser:"ssr",version:0,OS:"ssr"})}();const v="undefined"!=typeof WebAssembly&&B&&!(/Safari/.test(B)&&!/Chrome/.test(B)&&/\(.+\s11_2_([2-6]).*\)/.test(B)),x=!("undefined"==typeof Worker),k=!(!V||!V.getUserMedia),Y=async()=>{let e=!1;if(k)try{(await V.getUserMedia({video:!0})).getTracks().forEach((e=>{e.stop()})),e=!0}catch(e){}return e};"Chrome"===b.browser&&b.version>66||"Safari"===b.browser&&b.version>13||"OPR"===b.browser&&b.version>43||"Edge"===b.browser&&b.version;const H={},X=async e=>{let E="string"==typeof e?[e]:e,t=[];for(let e of E)t.push(H[e]=H[e]||new _);await Promise.all(t)},Z=async(e,E)=>{let t,I="string"==typeof e?[e]:e,r=[];for(let e of I){let I;r.push(I=H[e]=H[e]||new _(t=t||E())),I.isEmpty&&(I.task=t=t||E())}await Promise.all(r)};e.worker=void 0;let W=0;const j=()=>W++,K={};e.onLog=void 0;const J=E=>{e.onLog=E,e.worker&&e.worker.postMessage({type:"setBLog",body:{value:!!E}})};e.bDebug=!1;const Q=E=>{e.bDebug=E,e.worker&&e.worker.postMessage({type:"setBDebug",body:{value:!!E}})},$={},z={dip:{wasm:!0}},q={std:{version:"1.4.20",path:C(i+"../../dynamsoft-capture-vision-std@1.4.20/dist/"),isInternal:!0},core:{version:"3.4.30-beta-202412040036",path:i,isInternal:!0}},ee=async E=>{let t;E instanceof Array||(E=E?[E]:[]);let I=H.core;t=!I||I.isEmpty;let r=new Map;const n=e=>{if("std"==(e=e.toLowerCase())||"core"==e)return;if(!z[e])throw Error("The '"+e+"' module cannot be found.");let E=z[e].deps;if(null==E?void 0:E.length)for(let e of E)n(e);let _=H[e];r.has(e)||r.set(e,!_||_.isEmpty)};for(let e of E)n(e);let o=[];t&&o.push("core"),o.push(...r.keys());const a=[...r.entries()].filter((e=>!e[1])).map((e=>e[0]));await Z(o,(async()=>{const E=[...r.entries()].filter((e=>e[1])).map((e=>e[0]));await X(a);const I=c(q),n={};for(let e of E)n[e]=z[e];const o={engineResourcePaths:I,autoResources:n,names:E};let s=new _;if(t){o.needLoadCore=!0;let E=I.core+Ee._workerName;E.startsWith(location.origin)||(E=await fetch(E).then((e=>e.blob())).then((e=>URL.createObjectURL(e)))),e.worker=new Worker(E),e.worker.onerror=e=>{let E=new Error(e.message);s.reject(E)},e.worker.addEventListener("message",(E=>{let _=E.data?E.data:E,t=_.type,I=_.id,r=_.body;switch(t){case"log":e.onLog&&e.onLog(_.message);break;case"task":try{K[I](r),delete K[I]}catch(e){throw delete K[I],e}break;case"event":try{K[I](r)}catch(e){throw e}break;default:console.log(E)}})),o.bLog=!!e.onLog,o.bd=e.bDebug,o.dm=location.origin.startsWith("http")?location.origin:"https://localhost"}else await X("core");let i=W++;K[i]=e=>{if(e.success)Object.assign($,e.versions),"{}"!==JSON.stringify(e.versions)&&(Ee._versions=e.versions),s.resolve(void 0);else{const E=Error(e.message);e.stack&&(E.stack=e.stack),s.reject(E)}},e.worker.postMessage({type:"loadWasm",body:o,id:i}),await s}))};class Ee{static get engineResourcePaths(){return q}static set engineResourcePaths(e){Object.assign(q,e)}static get bSupportDce4Module(){return this._bSupportDce4Module}static get bSupportIRTModule(){return this._bSupportIRTModule}static get versions(){return this._versions}static get _onLog(){return e.onLog}static set _onLog(e){J(e)}static get _bDebug(){return e.bDebug}static set _bDebug(e){Q(e)}static isModuleLoaded(e){return e=(e=e||"core").toLowerCase(),!!H[e]&&H[e].isFulfilled}static async loadWasm(e){return await ee(e)}static async detectEnvironment(){return await(async()=>({wasm:v,worker:x,getUserMedia:k,camera:await Y(),browser:b.browser,version:b.version,OS:b.OS}))()}static async getModuleVersion(){return await new Promise(((E,_)=>{let t=j();K[t]=async e=>{if(e.success)return E(e.versions);{let E=new Error(e.message);return E.stack=e.stack+"\n"+E.stack,_(E)}},e.worker.postMessage({type:"getModuleVersion",id:t})}))}static getVersion(){const e=$.core&&$.core.worker,E=$.core&&$.core.wasm;return`3.4.30-beta-202412040036(Worker: ${e||"Not Loaded"}, Wasm: ${E||"Not Loaded"})`}static enableLogging(){p._onLog=console.log,Ee._onLog=console.log}static disableLogging(){p._onLog=null,Ee._onLog=null}static async cfd(E){return await new Promise(((_,t)=>{let I=j();K[I]=async e=>{if(e.success)return _();{let E=new Error(e.message);return E.stack=e.stack+"\n"+E.stack,t(E)}},e.worker.postMessage({type:"cfd",id:I,body:{count:E}})}))}}var _e,te,Ie,re,ne,oe,ae,se,ie;Ee._bSupportDce4Module=-1,Ee._bSupportIRTModule=-1,Ee._versions=null,Ee._workerName="core.worker.js",Ee.browserInfo=b,e.EnumCapturedResultItemType=void 0,(_e=e.EnumCapturedResultItemType||(e.EnumCapturedResultItemType={}))[_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_NORMALIZED_IMAGE=16]="CRIT_NORMALIZED_IMAGE",_e[_e.CRIT_PARSED_RESULT=32]="CRIT_PARSED_RESULT",e.EnumCornerType=void 0,(te=e.EnumCornerType||(e.EnumCornerType={}))[te.CT_NORMAL_INTERSECTED=0]="CT_NORMAL_INTERSECTED",te[te.CT_T_INTERSECTED=1]="CT_T_INTERSECTED",te[te.CT_CROSS_INTERSECTED=2]="CT_CROSS_INTERSECTED",te[te.CT_NOT_INTERSECTED=3]="CT_NOT_INTERSECTED",e.EnumErrorCode=void 0,(Ie=e.EnumErrorCode||(e.EnumErrorCode={}))[Ie.EC_OK=0]="EC_OK",Ie[Ie.EC_UNKNOWN=-1e4]="EC_UNKNOWN",Ie[Ie.EC_NO_MEMORY=-10001]="EC_NO_MEMORY",Ie[Ie.EC_NULL_POINTER=-10002]="EC_NULL_POINTER",Ie[Ie.EC_LICENSE_INVALID=-10003]="EC_LICENSE_INVALID",Ie[Ie.EC_LICENSE_EXPIRED=-10004]="EC_LICENSE_EXPIRED",Ie[Ie.EC_FILE_NOT_FOUND=-10005]="EC_FILE_NOT_FOUND",Ie[Ie.EC_FILE_TYPE_NOT_SUPPORTED=-10006]="EC_FILE_TYPE_NOT_SUPPORTED",Ie[Ie.EC_BPP_NOT_SUPPORTED=-10007]="EC_BPP_NOT_SUPPORTED",Ie[Ie.EC_INDEX_INVALID=-10008]="EC_INDEX_INVALID",Ie[Ie.EC_CUSTOM_REGION_INVALID=-10010]="EC_CUSTOM_REGION_INVALID",Ie[Ie.EC_IMAGE_READ_FAILED=-10012]="EC_IMAGE_READ_FAILED",Ie[Ie.EC_TIFF_READ_FAILED=-10013]="EC_TIFF_READ_FAILED",Ie[Ie.EC_DIB_BUFFER_INVALID=-10018]="EC_DIB_BUFFER_INVALID",Ie[Ie.EC_PDF_READ_FAILED=-10021]="EC_PDF_READ_FAILED",Ie[Ie.EC_PDF_DLL_MISSING=-10022]="EC_PDF_DLL_MISSING",Ie[Ie.EC_PAGE_NUMBER_INVALID=-10023]="EC_PAGE_NUMBER_INVALID",Ie[Ie.EC_CUSTOM_SIZE_INVALID=-10024]="EC_CUSTOM_SIZE_INVALID",Ie[Ie.EC_TIMEOUT=-10026]="EC_TIMEOUT",Ie[Ie.EC_JSON_PARSE_FAILED=-10030]="EC_JSON_PARSE_FAILED",Ie[Ie.EC_JSON_TYPE_INVALID=-10031]="EC_JSON_TYPE_INVALID",Ie[Ie.EC_JSON_KEY_INVALID=-10032]="EC_JSON_KEY_INVALID",Ie[Ie.EC_JSON_VALUE_INVALID=-10033]="EC_JSON_VALUE_INVALID",Ie[Ie.EC_JSON_NAME_KEY_MISSING=-10034]="EC_JSON_NAME_KEY_MISSING",Ie[Ie.EC_JSON_NAME_VALUE_DUPLICATED=-10035]="EC_JSON_NAME_VALUE_DUPLICATED",Ie[Ie.EC_TEMPLATE_NAME_INVALID=-10036]="EC_TEMPLATE_NAME_INVALID",Ie[Ie.EC_JSON_NAME_REFERENCE_INVALID=-10037]="EC_JSON_NAME_REFERENCE_INVALID",Ie[Ie.EC_PARAMETER_VALUE_INVALID=-10038]="EC_PARAMETER_VALUE_INVALID",Ie[Ie.EC_DOMAIN_NOT_MATCH=-10039]="EC_DOMAIN_NOT_MATCH",Ie[Ie.EC_RESERVED_INFO_NOT_MATCH=-10040]="EC_RESERVED_INFO_NOT_MATCH",Ie[Ie.EC_LICENSE_KEY_NOT_MATCH=-10043]="EC_LICENSE_KEY_NOT_MATCH",Ie[Ie.EC_REQUEST_FAILED=-10044]="EC_REQUEST_FAILED",Ie[Ie.EC_LICENSE_INIT_FAILED=-10045]="EC_LICENSE_INIT_FAILED",Ie[Ie.EC_SET_MODE_ARGUMENT_ERROR=-10051]="EC_SET_MODE_ARGUMENT_ERROR",Ie[Ie.EC_LICENSE_CONTENT_INVALID=-10052]="EC_LICENSE_CONTENT_INVALID",Ie[Ie.EC_LICENSE_KEY_INVALID=-10053]="EC_LICENSE_KEY_INVALID",Ie[Ie.EC_LICENSE_DEVICE_RUNS_OUT=-10054]="EC_LICENSE_DEVICE_RUNS_OUT",Ie[Ie.EC_GET_MODE_ARGUMENT_ERROR=-10055]="EC_GET_MODE_ARGUMENT_ERROR",Ie[Ie.EC_IRT_LICENSE_INVALID=-10056]="EC_IRT_LICENSE_INVALID",Ie[Ie.EC_FILE_SAVE_FAILED=-10058]="EC_FILE_SAVE_FAILED",Ie[Ie.EC_STAGE_TYPE_INVALID=-10059]="EC_STAGE_TYPE_INVALID",Ie[Ie.EC_IMAGE_ORIENTATION_INVALID=-10060]="EC_IMAGE_ORIENTATION_INVALID",Ie[Ie.EC_CONVERT_COMPLEX_TEMPLATE_ERROR=-10061]="EC_CONVERT_COMPLEX_TEMPLATE_ERROR",Ie[Ie.EC_CALL_REJECTED_WHEN_CAPTURING=-10062]="EC_CALL_REJECTED_WHEN_CAPTURING",Ie[Ie.EC_NO_IMAGE_SOURCE=-10063]="EC_NO_IMAGE_SOURCE",Ie[Ie.EC_READ_DIRECTORY_FAILED=-10064]="EC_READ_DIRECTORY_FAILED",Ie[Ie.EC_MODULE_NOT_FOUND=-10065]="EC_MODULE_NOT_FOUND",Ie[Ie.EC_MULTI_PAGES_NOT_SUPPORTED=-10066]="EC_MULTI_PAGES_NOT_SUPPORTED",Ie[Ie.EC_FILE_ALREADY_EXISTS=-10067]="EC_FILE_ALREADY_EXISTS",Ie[Ie.EC_CREATE_FILE_FAILED=-10068]="EC_CREATE_FILE_FAILED",Ie[Ie.EC_IMGAE_DATA_INVALID=-10069]="EC_IMGAE_DATA_INVALID",Ie[Ie.EC_IMAGE_SIZE_NOT_MATCH=-10070]="EC_IMAGE_SIZE_NOT_MATCH",Ie[Ie.EC_IMAGE_PIXEL_FORMAT_NOT_MATCH=-10071]="EC_IMAGE_PIXEL_FORMAT_NOT_MATCH",Ie[Ie.EC_SECTION_LEVEL_RESULT_IRREPLACEABLE=-10072]="EC_SECTION_LEVEL_RESULT_IRREPLACEABLE",Ie[Ie.EC_AXIS_DEFINITION_INCORRECT=-10073]="EC_AXIS_DEFINITION_INCORRECT",Ie[Ie.EC_RESULT_TYPE_MISMATCH_IRREPLACEABLE=-10074]="EC_RESULT_TYPE_MISMATCH_IRREPLACEABLE",Ie[Ie.EC_PDF_LIBRARY_LOAD_FAILED=-10075]="EC_PDF_LIBRARY_LOAD_FAILED",Ie[Ie.EC_NO_LICENSE=-2e4]="EC_NO_LICENSE",Ie[Ie.EC_HANDSHAKE_CODE_INVALID=-20001]="EC_HANDSHAKE_CODE_INVALID",Ie[Ie.EC_LICENSE_BUFFER_FAILED=-20002]="EC_LICENSE_BUFFER_FAILED",Ie[Ie.EC_LICENSE_SYNC_FAILED=-20003]="EC_LICENSE_SYNC_FAILED",Ie[Ie.EC_DEVICE_NOT_MATCH=-20004]="EC_DEVICE_NOT_MATCH",Ie[Ie.EC_BIND_DEVICE_FAILED=-20005]="EC_BIND_DEVICE_FAILED",Ie[Ie.EC_INSTANCE_COUNT_OVER_LIMIT=-20008]="EC_INSTANCE_COUNT_OVER_LIMIT",Ie[Ie.EC_LICENSE_INIT_SEQUENCE_FAILED=-20009]="EC_LICENSE_INIT_SEQUENCE_FAILED",Ie[Ie.EC_TRIAL_LICENSE=-20010]="EC_TRIAL_LICENSE",Ie[Ie.EC_FAILED_TO_REACH_DLS=-20200]="EC_FAILED_TO_REACH_DLS",Ie[Ie.EC_LICENSE_CACHE_USED=-20012]="EC_LICENSE_CACHE_USED",Ie[Ie.EC_BARCODE_FORMAT_INVALID=-30009]="EC_BARCODE_FORMAT_INVALID",Ie[Ie.EC_QR_LICENSE_INVALID=-30016]="EC_QR_LICENSE_INVALID",Ie[Ie.EC_1D_LICENSE_INVALID=-30017]="EC_1D_LICENSE_INVALID",Ie[Ie.EC_PDF417_LICENSE_INVALID=-30019]="EC_PDF417_LICENSE_INVALID",Ie[Ie.EC_DATAMATRIX_LICENSE_INVALID=-30020]="EC_DATAMATRIX_LICENSE_INVALID",Ie[Ie.EC_CUSTOM_MODULESIZE_INVALID=-30025]="EC_CUSTOM_MODULESIZE_INVALID",Ie[Ie.EC_AZTEC_LICENSE_INVALID=-30041]="EC_AZTEC_LICENSE_INVALID",Ie[Ie.EC_PATCHCODE_LICENSE_INVALID=-30046]="EC_PATCHCODE_LICENSE_INVALID",Ie[Ie.EC_POSTALCODE_LICENSE_INVALID=-30047]="EC_POSTALCODE_LICENSE_INVALID",Ie[Ie.EC_DPM_LICENSE_INVALID=-30048]="EC_DPM_LICENSE_INVALID",Ie[Ie.EC_FRAME_DECODING_THREAD_EXISTS=-30049]="EC_FRAME_DECODING_THREAD_EXISTS",Ie[Ie.EC_STOP_DECODING_THREAD_FAILED=-30050]="EC_STOP_DECODING_THREAD_FAILED",Ie[Ie.EC_MAXICODE_LICENSE_INVALID=-30057]="EC_MAXICODE_LICENSE_INVALID",Ie[Ie.EC_GS1_DATABAR_LICENSE_INVALID=-30058]="EC_GS1_DATABAR_LICENSE_INVALID",Ie[Ie.EC_GS1_COMPOSITE_LICENSE_INVALID=-30059]="EC_GS1_COMPOSITE_LICENSE_INVALID",Ie[Ie.EC_DOTCODE_LICENSE_INVALID=-30061]="EC_DOTCODE_LICENSE_INVALID",Ie[Ie.EC_PHARMACODE_LICENSE_INVALID=-30062]="EC_PHARMACODE_LICENSE_INVALID",Ie[Ie.EC_CHARACTER_MODEL_FILE_NOT_FOUND=-40100]="EC_CHARACTER_MODEL_FILE_NOT_FOUND",Ie[Ie.EC_TEXT_LINE_GROUP_LAYOUT_CONFLICT=-40101]="EC_TEXT_LINE_GROUP_LAYOUT_CONFLICT",Ie[Ie.EC_TEXT_LINE_GROUP_REGEX_CONFLICT=-40102]="EC_TEXT_LINE_GROUP_REGEX_CONFLICT",Ie[Ie.EC_QUADRILATERAL_INVALID=-50057]="EC_QUADRILATERAL_INVALID",Ie[Ie.EC_PANORAMA_LICENSE_INVALID=-70060]="EC_PANORAMA_LICENSE_INVALID",Ie[Ie.EC_RESOURCE_PATH_NOT_EXIST=-90001]="EC_RESOURCE_PATH_NOT_EXIST",Ie[Ie.EC_RESOURCE_LOAD_FAILED=-90002]="EC_RESOURCE_LOAD_FAILED",Ie[Ie.EC_CODE_SPECIFICATION_NOT_FOUND=-90003]="EC_CODE_SPECIFICATION_NOT_FOUND",Ie[Ie.EC_FULL_CODE_EMPTY=-90004]="EC_FULL_CODE_EMPTY",Ie[Ie.EC_FULL_CODE_PREPROCESS_FAILED=-90005]="EC_FULL_CODE_PREPROCESS_FAILED",Ie[Ie.EC_ZA_DL_LICENSE_INVALID=-90006]="EC_ZA_DL_LICENSE_INVALID",Ie[Ie.EC_AAMVA_DL_ID_LICENSE_INVALID=-90007]="EC_AAMVA_DL_ID_LICENSE_INVALID",Ie[Ie.EC_AADHAAR_LICENSE_INVALID=-90008]="EC_AADHAAR_LICENSE_INVALID",Ie[Ie.EC_MRTD_LICENSE_INVALID=-90009]="EC_MRTD_LICENSE_INVALID",Ie[Ie.EC_VIN_LICENSE_INVALID=-90010]="EC_VIN_LICENSE_INVALID",Ie[Ie.EC_CUSTOMIZED_CODE_TYPE_LICENSE_INVALID=-90011]="EC_CUSTOMIZED_CODE_TYPE_LICENSE_INVALID",Ie[Ie.EC_LICENSE_WARNING=-10076]="EC_LICENSE_WARNING",Ie[Ie.EC_BARCODE_READER_LICENSE_NOT_FOUND=-30063]="EC_BARCODE_READER_LICENSE_NOT_FOUND",Ie[Ie.EC_LABEL_RECOGNIZER_LICENSE_NOT_FOUND=-40103]="EC_LABEL_RECOGNIZER_LICENSE_NOT_FOUND",Ie[Ie.EC_DOCUMENT_NORMALIZER_LICENSE_NOT_FOUND=-50058]="EC_DOCUMENT_NORMALIZER_LICENSE_NOT_FOUND",Ie[Ie.EC_CODE_PARSER_LICENSE_NOT_FOUND=-90012]="EC_CODE_PARSER_LICENSE_NOT_FOUND",e.EnumGrayscaleEnhancementMode=void 0,(re=e.EnumGrayscaleEnhancementMode||(e.EnumGrayscaleEnhancementMode={}))[re.GEM_SKIP=0]="GEM_SKIP",re[re.GEM_AUTO=1]="GEM_AUTO",re[re.GEM_GENERAL=2]="GEM_GENERAL",re[re.GEM_GRAY_EQUALIZE=4]="GEM_GRAY_EQUALIZE",re[re.GEM_GRAY_SMOOTH=8]="GEM_GRAY_SMOOTH",re[re.GEM_SHARPEN_SMOOTH=16]="GEM_SHARPEN_SMOOTH",re[re.GEM_REV=-2147483648]="GEM_REV",e.EnumGrayscaleTransformationMode=void 0,(ne=e.EnumGrayscaleTransformationMode||(e.EnumGrayscaleTransformationMode={}))[ne.GTM_SKIP=0]="GTM_SKIP",ne[ne.GTM_INVERTED=1]="GTM_INVERTED",ne[ne.GTM_ORIGINAL=2]="GTM_ORIGINAL",ne[ne.GTM_AUTO=4]="GTM_AUTO",ne[ne.GTM_REV=-2147483648]="GTM_REV",e.EnumImageTagType=void 0,(oe=e.EnumImageTagType||(e.EnumImageTagType={}))[oe.ITT_FILE_IMAGE=0]="ITT_FILE_IMAGE",oe[oe.ITT_VIDEO_FRAME=1]="ITT_VIDEO_FRAME",e.EnumPDFReadingMode=void 0,(ae=e.EnumPDFReadingMode||(e.EnumPDFReadingMode={}))[ae.PDFRM_VECTOR=1]="PDFRM_VECTOR",ae[ae.PDFRM_RASTER=2]="PDFRM_RASTER",ae[ae.PDFRM_REV=-2147483648]="PDFRM_REV",e.EnumRasterDataSource=void 0,(se=e.EnumRasterDataSource||(e.EnumRasterDataSource={}))[se.RDS_RASTERIZED_PAGES=0]="RDS_RASTERIZED_PAGES",se[se.RDS_EXTRACTED_IMAGES=1]="RDS_EXTRACTED_IMAGES",e.EnumCrossVerificationStatus=void 0,(ie=e.EnumCrossVerificationStatus||(e.EnumCrossVerificationStatus={}))[ie.CVS_NOT_VERIFIED=0]="CVS_NOT_VERIFIED",ie[ie.CVS_PASSED=1]="CVS_PASSED",ie[ie.CVS_FAILED=2]="CVS_FAILED";const Ce={IRUT_NULL:BigInt(0),IRUT_COLOUR_IMAGE:BigInt(1),IRUT_SCALED_DOWN_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_UP_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_NORMALIZED_IMAGES:BigInt(1<<26),IRUT_SHORT_LINES:BigInt(1<<27),IRUT_RAW_TEXT_LINES:BigInt(1<<28),IRUT_LOGIC_LINES:BigInt(1<<29),IRUT_ALL:BigInt("0xFFFFFFFFFFFFFFFF")};var Ae,Te;e.EnumRegionObjectElementType=void 0,(Ae=e.EnumRegionObjectElementType||(e.EnumRegionObjectElementType={}))[Ae.ROET_PREDETECTED_REGION=0]="ROET_PREDETECTED_REGION",Ae[Ae.ROET_LOCALIZED_BARCODE=1]="ROET_LOCALIZED_BARCODE",Ae[Ae.ROET_DECODED_BARCODE=2]="ROET_DECODED_BARCODE",Ae[Ae.ROET_LOCALIZED_TEXT_LINE=3]="ROET_LOCALIZED_TEXT_LINE",Ae[Ae.ROET_RECOGNIZED_TEXT_LINE=4]="ROET_RECOGNIZED_TEXT_LINE",Ae[Ae.ROET_DETECTED_QUAD=5]="ROET_DETECTED_QUAD",Ae[Ae.ROET_NORMALIZED_IMAGE=6]="ROET_NORMALIZED_IMAGE",Ae[Ae.ROET_SOURCE_IMAGE=7]="ROET_SOURCE_IMAGE",Ae[Ae.ROET_TARGET_ROI=8]="ROET_TARGET_ROI",e.EnumSectionType=void 0,(Te=e.EnumSectionType||(e.EnumSectionType={}))[Te.ST_NULL=0]="ST_NULL",Te[Te.ST_REGION_PREDETECTION=1]="ST_REGION_PREDETECTION",Te[Te.ST_BARCODE_LOCALIZATION=2]="ST_BARCODE_LOCALIZATION",Te[Te.ST_BARCODE_DECODING=3]="ST_BARCODE_DECODING",Te[Te.ST_TEXT_LINE_LOCALIZATION=4]="ST_TEXT_LINE_LOCALIZATION",Te[Te.ST_TEXT_LINE_RECOGNITION=5]="ST_TEXT_LINE_RECOGNITION",Te[Te.ST_DOCUMENT_DETECTION=6]="ST_DOCUMENT_DETECTION",Te[Te.ST_DOCUMENT_NORMALIZATION=7]="ST_DOCUMENT_NORMALIZATION",e.CoreModule=Ee,e.EnumIntermediateResultUnitType=Ce,e.ImageSourceAdapter=p,e._getNorImageData=g,e._saveToFile=async(e,E,_)=>await new Promise((async(t,I)=>{try{const I=E.split(".");let r=I[I.length-1];const n=await S(`image/${r}`,e);I.length<=1&&(r="png");const o=new File([n],E,{type:`image/${r}`});if(_){const e=URL.createObjectURL(o),_=document.createElement("a");_.href=e,_.download=E,_.click()}return t(o)}catch(e){return I()}})),e._toBlob=S,e._toCanvas=u,e._toImage=(e,E)=>{O(E)&&(E=g(E));const _=u(E);let t=new Image,I=_.toDataURL(e);return t.src=I,t},e.checkIsLink=e=>/^(https:\/\/www\.|http:\/\/www\.|https:\/\/|http:\/\/)|^[a-zA-Z0-9]{2,}(\.[a-zA-Z0-9]{2,})(\.[a-zA-Z0-9]{2,})?/.test(e),e.compareVersion=(e,E)=>{let _=e.split("."),t=E.split(".");for(let e=0;e<_.length&&e<t.length;++e){let E=_[e],I=t[e];if(E===I)continue;let r=parseInt(_[e]),n=parseInt(t[e]);return r===n||Number.isNaN(r)&&Number.isNaN(n)?E<I?-1:1:r<n||Number.isNaN(r)&&Number.isInteger(n)?-1:1}return _.length===t.length?0:_.length<t.length?-1:1},e.doOrWaitAsyncDependency=Z,e.getNextTaskID=j,e.handleEngineResourcePaths=c,e.innerVersions=$,e.isArc=e=>!!L(e)&&(!!R(e.x)&&(!!R(e.y)&&(!!R(e.radius)&&(!(e.radius<0)&&(!!R(e.startAngle)&&!!R(e.endAngle)))))),e.isContour=e=>!!L(e)&&(!!T(e.points)&&(0!=e.points.length&&!e.points.some((e=>!m(e))))),e.isDSImageData=O,e.isDSRect=e=>!!L(e)&&(!!R(e.left)&&(!(e.left<0)&&(!!R(e.top)&&(!(e.top<0)&&(!!R(e.right)&&(!(e.right<0)&&(!!R(e.bottom)&&(!(e.bottom<0)&&(!(e.left>=e.right)&&(!(e.top>=e.bottom)&&!!N(e.isMeasuredInPercentage))))))))))),e.isImageTag=l,e.isLineSegment=e=>!!L(e)&&(!!m(e.startPoint)&&(!!m(e.endPoint)&&(e.startPoint.x!=e.endPoint.x||e.startPoint.y!=e.endPoint.y))),e.isObject=L,e.isOriginalDsImageData=e=>!!D(e)&&!(!R(e.bytes.length)&&!R(e.bytes.ptr)),e.isPoint=m,e.isPolygon=e=>!!L(e)&&(!!T(e.points)&&(0!=e.points.length&&!e.points.some((e=>!m(e))))),e.isQuad=e=>!!L(e)&&(!!T(e.points)&&(0!=e.points.length&&4==e.points.length&&!e.points.some((e=>!m(e))))),e.isRect=e=>!!L(e)&&(!!R(e.x)&&(!!R(e.y)&&(!!R(e.width)&&(!(e.width<0)&&(!!R(e.height)&&(!(e.height<0)&&!("isMeasuredInPercentage"in e&&!N(e.isMeasuredInPercentage)))))))),e.loadWasm=ee,e.mapAsyncDependency=H,e.mapPackageRegister={},e.mapTaskCallBack=K,e.requestResource=async(e,E)=>await new Promise(((_,t)=>{let I=new XMLHttpRequest;I.open("GET",e,!0),I.responseType=E,I.send(),I.onloadend=async()=>{I.status<200||I.status>=300?t(new Error(e+" "+I.status)):_(I.response)},I.onerror=()=>{t(new Error("Network Error: "+I.statusText))}})),e.setBDebug=Q,e.setOnLog=J,e.waitAsyncDependency=X,e.workerAutoResources=z})); | ||
!function(e,E){"object"==typeof exports&&"undefined"!=typeof module?E(exports):"function"==typeof define&&define.amd?define(["exports"],E):E(((e="undefined"!=typeof globalThis?globalThis:e||self).Dynamsoft=e.Dynamsoft||{},e.Dynamsoft.Core={}))}(this,(function(e){"use strict";const E=e=>e&&"object"==typeof e&&"function"==typeof e.then;class _ extends Promise{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 _;this._task=e,E(e)?_=e:"function"==typeof e&&(_=new Promise(e)),_&&(async()=>{try{const E=await _;e===this._task&&this.resolve(E)}catch(E){e===this._task&&this.reject(E)}})()}get isEmpty(){return null==this._task}constructor(e){let _,t;super(((e,E)=>{_=e,t=E})),this._s="pending",this.resolve=e=>{this.isPending&&(E(e)?this.task=e:(this._s="fulfilled",_(e)))},this.reject=e=>{this.isPending&&(this._s="rejected",t(e))},this.task=e}}function t(e,E,_,t){if("a"===_&&!t)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof E?e!==E||!t:!E.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===_?t:"a"===_?t.call(e):t?t.value:E.get(e)}function I(e,E,_,t,I){if("m"===t)throw new TypeError("Private method is not writable");if("a"===t&&!I)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof E?e!==E||!I:!E.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===t?I.call(e,_):I?I.value=_:E.set(e,_),_}var r,n,o;"function"==typeof SuppressedError&&SuppressedError,e.EnumBufferOverflowProtectionMode=void 0,(r=e.EnumBufferOverflowProtectionMode||(e.EnumBufferOverflowProtectionMode={}))[r.BOPM_BLOCK=0]="BOPM_BLOCK",r[r.BOPM_UPDATE=1]="BOPM_UPDATE",e.EnumColourChannelUsageType=void 0,(n=e.EnumColourChannelUsageType||(e.EnumColourChannelUsageType={}))[n.CCUT_AUTO=0]="CCUT_AUTO",n[n.CCUT_FULL_CHANNEL=1]="CCUT_FULL_CHANNEL",n[n.CCUT_Y_CHANNEL_ONLY=2]="CCUT_Y_CHANNEL_ONLY",n[n.CCUT_RGB_R_CHANNEL_ONLY=3]="CCUT_RGB_R_CHANNEL_ONLY",n[n.CCUT_RGB_G_CHANNEL_ONLY=4]="CCUT_RGB_G_CHANNEL_ONLY",n[n.CCUT_RGB_B_CHANNEL_ONLY=5]="CCUT_RGB_B_CHANNEL_ONLY",e.EnumImagePixelFormat=void 0,(o=e.EnumImagePixelFormat||(e.EnumImagePixelFormat={}))[o.IPF_BINARY=0]="IPF_BINARY",o[o.IPF_BINARYINVERTED=1]="IPF_BINARYINVERTED",o[o.IPF_GRAYSCALED=2]="IPF_GRAYSCALED",o[o.IPF_NV21=3]="IPF_NV21",o[o.IPF_RGB_565=4]="IPF_RGB_565",o[o.IPF_RGB_555=5]="IPF_RGB_555",o[o.IPF_RGB_888=6]="IPF_RGB_888",o[o.IPF_ARGB_8888=7]="IPF_ARGB_8888",o[o.IPF_RGB_161616=8]="IPF_RGB_161616",o[o.IPF_ARGB_16161616=9]="IPF_ARGB_16161616",o[o.IPF_ABGR_8888=10]="IPF_ABGR_8888",o[o.IPF_ABGR_16161616=11]="IPF_ABGR_16161616",o[o.IPF_BGR_888=12]="IPF_BGR_888",o[o.IPF_BINARY_8=13]="IPF_BINARY_8",o[o.IPF_NV12=14]="IPF_NV12",o[o.IPF_BINARY_8_INVERTED=15]="IPF_BINARY_8_INVERTED";const a="undefined"==typeof self,s="function"==typeof importScripts,i=(()=>{if(!s){if(!a&&document.currentScript){let e=document.currentScript.src,E=e.indexOf("?");if(-1!=E)e=e.substring(0,E);else{let E=e.indexOf("#");-1!=E&&(e=e.substring(0,E))}return e.substring(0,e.lastIndexOf("/")+1)}return"./"}})(),C=e=>{if(null==e&&(e="./"),a||s);else{let E=document.createElement("a");E.href=e,e=E.href}return e.endsWith("/")||(e+="/"),e},A=e=>Object.prototype.toString.call(e),T=e=>Array.isArray?Array.isArray(e):"[object Array]"===A(e),N=e=>"[object Boolean]"===A(e),R=e=>"number"==typeof e&&!Number.isNaN(e),L=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),D=e=>!!L(e)&&(!!R(e.width)&&(!(e.width<=0)&&(!!R(e.height)&&(!(e.height<=0)&&(!!R(e.stride)&&(!(e.stride<=0)&&("format"in e&&!("tag"in e&&!l(e.tag))))))))),O=e=>!!D(e)&&e.bytes instanceof Uint8Array,l=e=>null===e||!!L(e)&&(!!R(e.imageId)&&"type"in e),m=e=>!!L(e)&&(!!R(e.x)&&!!R(e.y)),c=e=>{const E={},_={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",dcpd:"dynamsoft-code-parser",dlrData:"dynamsoft-label-recognizer-data",dce:"dynamsoft-camera-enhancer",ddv:"dynamsoft-document-viewer"};for(let t in e){if("rootDirectory"===t)continue;let I=t,r=e[I],n=r&&"object"==typeof r&&r.path?r.path:r,o=e.rootDirectory;if(o&&!o.endsWith("/")&&(o+="/"),"object"==typeof r&&r.isInternal)o&&(n=e[I].version?`${o}${_[I]}@${e[I].version}/dist/${"ddv"===I?"engine":""}`:`${o}${_[I]}/dist/${"ddv"===I?"engine":""}`);else{const _=/^@engineRootDirectory(\/?)/;if("string"==typeof n&&(n=n.replace(_,o||"")),"object"==typeof n&&"dwt"===I){const t=e[I].resourcesPath,r=e[I].serviceInstallerLocation;E[I]={resourcesPath:t.replace(_,o||""),serviceInstallerLocation:r.replace(_,o||"")};continue}}E[I]=C(n)}return E},u=e=>{O(e)&&(e=g(e));const E=document.createElement("canvas");E.width=e.width,E.height=e.height;return E.getContext("2d",{willReadFrequently:!0}).putImageData(e,0,0),E},S=async(e,E)=>{O(E)&&(E=g(E));const _=u(E);return new Promise(((E,t)=>{_.toBlob((e=>E(e)),e)}))},g=E=>{let _,t=E.bytes;if(!(t&&t instanceof Uint8Array))throw Error("Parameter type error");if(Number(E.format)===e.EnumImagePixelFormat.IPF_BGR_888){const e=t.length/3;_=new Uint8ClampedArray(4*e);for(let E=0;E<e;++E)_[4*E]=t[3*E],_[4*E+1]=t[3*E+1],_[4*E+2]=t[3*E+2],_[4*E+3]=255}else if(Number(E.format)===e.EnumImagePixelFormat.IPF_RGB_888){const e=t.length/3;_=new Uint8ClampedArray(4*e);for(let E=0;E<e;++E)_[4*E]=t[3*E+2],_[4*E+1]=t[3*E+1],_[4*E+2]=t[3*E],_[4*E+3]=255}else if(Number(E.format)===e.EnumImagePixelFormat.IPF_GRAYSCALED){const e=t.length;_=new Uint8ClampedArray(4*e);for(let E=0;E<e;E++)_[4*E]=_[4*E+1]=_[4*E+2]=t[E],_[4*E+3]=255}else if(Number(E.format)===e.EnumImagePixelFormat.IPF_BINARY_8){const e=t.length,I=E.width,r=E.height,n=E.stride;_=new Uint8ClampedArray(I*r*4);for(let E=0;E<e;E++){let e=t[E],r=E%n,o=Math.floor(E/n);for(let E=0;E<8;E++){let t=r+E,n=4*(o*I+t);if(t>=I)break;_[n]=_[n+1]=_[n+2]=(128&e)/128*255,_[n+3]=255,e<<=1}}}else if(Number(E.format)===e.EnumImagePixelFormat.IPF_ABGR_8888){const e=t.length/4;_=new Uint8ClampedArray(t.length);for(let E=0;E<e;++E)_[4*E]=t[4*E],_[4*E+1]=t[4*E+1],_[4*E+2]=t[4*E+2],_[4*E+3]=t[4*E+3]}else if(Number(E.format)===e.EnumImagePixelFormat.IPF_ARGB_8888){const e=t.length/4;_=new Uint8ClampedArray(t.length);for(let E=0;E<e;++E)_[4*E]=t[4*E+2],_[4*E+1]=t[4*E+1],_[4*E+2]=t[4*E],_[4*E+3]=t[4*E+3]}else if(Number(E.format)===e.EnumImagePixelFormat.IPF_BINARY_8_INVERTED){const e=t.length,I=E.width,r=E.height,n=E.stride;_=new Uint8ClampedArray(I*r*4);for(let E=0;E<e;E++){let e=t[E],r=E%n,o=Math.floor(E/n);for(let E=0;E<8;E++){let t=r+E,n=4*(o*I+t);if(t>=I)break;_[n]=_[n+1]=_[n+2]=128&e?0:255,_[n+3]=255,e<<=1}}}return new ImageData(_,E.width,E.height)};var d,P,f,F,h,M,G,U;class p{get _isFetchingStarted(){return t(this,h,"f")}constructor(){d.add(this),P.set(this,[]),f.set(this,1),F.set(this,e.EnumBufferOverflowProtectionMode.BOPM_BLOCK),h.set(this,!1),M.set(this,void 0),G.set(this,e.EnumColourChannelUsageType.CCUT_AUTO)}setErrorListener(e){}addImageToBuffer(E){var _;if(!O(E))throw new TypeError("Invalid 'image'.");if((null===(_=E.tag)||void 0===_?void 0:_.hasOwnProperty("imageId"))&&"number"==typeof E.tag.imageId&&this.hasImage(E.tag.imageId))throw new Error("Existed imageId.");if(t(this,P,"f").length>=t(this,f,"f"))switch(t(this,F,"f")){case e.EnumBufferOverflowProtectionMode.BOPM_BLOCK:break;case e.EnumBufferOverflowProtectionMode.BOPM_UPDATE:if(t(this,P,"f").push(E),L(t(this,M,"f"))&&R(t(this,M,"f").imageId)&&1==t(this,M,"f").keepInBuffer)for(;t(this,P,"f").length>t(this,f,"f");){const e=t(this,P,"f").findIndex((e=>{var E;return(null===(E=e.tag)||void 0===E?void 0:E.imageId)!==t(this,M,"f").imageId}));t(this,P,"f").splice(e,1)}else t(this,P,"f").splice(0,t(this,P,"f").length-t(this,f,"f"))}else t(this,P,"f").push(E)}getImage(){if(0===t(this,P,"f").length)return null;let E;if(t(this,M,"f")&&R(t(this,M,"f").imageId)){const e=t(this,d,"m",U).call(this,t(this,M,"f").imageId);if(e<0)throw new Error(`Image with id ${t(this,M,"f").imageId} doesn't exist.`);E=t(this,P,"f").slice(e,e+1)[0]}else E=t(this,P,"f").pop();if([e.EnumImagePixelFormat.IPF_RGB_565,e.EnumImagePixelFormat.IPF_RGB_555,e.EnumImagePixelFormat.IPF_RGB_888,e.EnumImagePixelFormat.IPF_ARGB_8888,e.EnumImagePixelFormat.IPF_RGB_161616,e.EnumImagePixelFormat.IPF_ARGB_16161616,e.EnumImagePixelFormat.IPF_ABGR_8888,e.EnumImagePixelFormat.IPF_ABGR_16161616,e.EnumImagePixelFormat.IPF_BGR_888].includes(E.format)){if(t(this,G,"f")===e.EnumColourChannelUsageType.CCUT_RGB_R_CHANNEL_ONLY){p._onLog&&p._onLog("only get R channel data.");const _=new Uint8Array(E.width*E.height);for(let t=0;t<_.length;t++)switch(E.format){case e.EnumImagePixelFormat.IPF_RGB_565:case e.EnumImagePixelFormat.IPF_RGB_555:case e.EnumImagePixelFormat.IPF_RGB_888:case e.EnumImagePixelFormat.IPF_RGB_161616:_[t]=E.bytes[3*t+2];break;case e.EnumImagePixelFormat.IPF_ARGB_8888:case e.EnumImagePixelFormat.IPF_ARGB_16161616:_[t]=E.bytes[4*t+2];break;case e.EnumImagePixelFormat.IPF_BGR_888:_[t]=E.bytes[3*t];break;case e.EnumImagePixelFormat.IPF_ABGR_8888:case e.EnumImagePixelFormat.IPF_ABGR_16161616:_[t]=E.bytes[4*t]}E.bytes=_,E.stride=E.width,E.format=e.EnumImagePixelFormat.IPF_GRAYSCALED}else if(t(this,G,"f")===e.EnumColourChannelUsageType.CCUT_RGB_G_CHANNEL_ONLY){p._onLog&&p._onLog("only get G channel data.");const _=new Uint8Array(E.width*E.height);for(let t=0;t<_.length;t++)switch(E.format){case e.EnumImagePixelFormat.IPF_RGB_565:case e.EnumImagePixelFormat.IPF_RGB_555:case e.EnumImagePixelFormat.IPF_RGB_888:case e.EnumImagePixelFormat.IPF_RGB_161616:case e.EnumImagePixelFormat.IPF_BGR_888:_[t]=E.bytes[3*t+1];break;case e.EnumImagePixelFormat.IPF_ARGB_8888:case e.EnumImagePixelFormat.IPF_ARGB_16161616:case e.EnumImagePixelFormat.IPF_ABGR_8888:case e.EnumImagePixelFormat.IPF_ABGR_16161616:_[t]=E.bytes[4*t+1]}E.bytes=_,E.stride=E.width,E.format=e.EnumImagePixelFormat.IPF_GRAYSCALED}else if(t(this,G,"f")===e.EnumColourChannelUsageType.CCUT_RGB_B_CHANNEL_ONLY){p._onLog&&p._onLog("only get B channel data.");const _=new Uint8Array(E.width*E.height);for(let t=0;t<_.length;t++)switch(E.format){case e.EnumImagePixelFormat.IPF_RGB_565:case e.EnumImagePixelFormat.IPF_RGB_555:case e.EnumImagePixelFormat.IPF_RGB_888:case e.EnumImagePixelFormat.IPF_RGB_161616:_[t]=E.bytes[3*t];break;case e.EnumImagePixelFormat.IPF_ARGB_8888:case e.EnumImagePixelFormat.IPF_ARGB_16161616:_[t]=E.bytes[4*t];break;case e.EnumImagePixelFormat.IPF_BGR_888:_[t]=E.bytes[3*t+2];break;case e.EnumImagePixelFormat.IPF_ABGR_8888:case e.EnumImagePixelFormat.IPF_ABGR_16161616:_[t]=E.bytes[4*t+2]}E.bytes=_,E.stride=E.width,E.format=e.EnumImagePixelFormat.IPF_GRAYSCALED}}else[e.EnumImagePixelFormat.IPF_NV21,e.EnumImagePixelFormat.IPF_NV12].includes(E.format)&&p._onLog&&p._onLog("NV21 or NV12 is not supported.");return E}setNextImageToReturn(e,E){if(!((...e)=>0!==e.length&&e.every((e=>R(e))))(e))throw new TypeError("Invalid 'imageId'.");if(void 0!==E&&!N(E))throw new TypeError("Invalid 'keepInBuffer'.");I(this,M,{imageId:e,keepInBuffer:E},"f")}_resetNextReturnedImage(){I(this,M,null,"f")}hasImage(e){return t(this,d,"m",U).call(this,e)>=0}startFetching(){I(this,h,!0,"f")}stopFetching(){I(this,h,!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(I(this,f,e,"f");t(this,P,"f")&&t(this,P,"f").length>e;)t(this,P,"f").shift()}getMaxImageCount(){return t(this,f,"f")}getImageCount(){return t(this,P,"f").length}clearBuffer(){t(this,P,"f").length=0}isBufferEmpty(){return 0===t(this,P,"f").length}setBufferOverflowProtectionMode(e){I(this,F,e,"f")}getBufferOverflowProtectionMode(){return t(this,F,"f")}setColourChannelUsageType(e){I(this,G,e,"f")}getColourChannelUsageType(){return t(this,G,"f")}}let y,B,w,V,b;P=new WeakMap,f=new WeakMap,F=new WeakMap,h=new WeakMap,M=new WeakMap,G=new WeakMap,d=new WeakSet,U=function(e){if("number"!=typeof e)throw new TypeError("Invalid 'imageId'.");return t(this,P,"f").findIndex((E=>{var _;return(null===(_=E.tag)||void 0===_?void 0:_.imageId)===e}))},"undefined"!=typeof navigator&&(y=navigator,B=y.userAgent,w=y.platform,V=y.mediaDevices),function(){if(!a){const e={Edge:{search:"Edg",verSearch:"Edg"},OPR:null,Chrome:null,Safari:{str:y.vendor,search:"Apple",verSearch:["Version","iPhone OS","CPU OS"]},Firefox:null,Explorer:{search:"MSIE",verSearch:"MSIE"}},E={HarmonyOS:null,Android:null,iPhone:null,iPad:null,Windows:{str:w,search:"Win"},Mac:{str:w},Linux:{str:w}};let _="unknownBrowser",t=0,I="unknownOS";for(let E in e){const I=e[E]||{};let r=I.str||B,n=I.search||E,o=I.verStr||B,a=I.verSearch||E;if(a instanceof Array||(a=[a]),-1!=r.indexOf(n)){_=E;for(let e of a){let E=o.indexOf(e);if(-1!=E){t=parseFloat(o.substring(E+e.length+1));break}}break}}for(let e in E){const _=E[e]||{};let t=_.str||B,r=_.search||e;if(-1!=t.indexOf(r)){I=e;break}}"Linux"==I&&-1!=B.indexOf("Windows NT")&&(I="HarmonyOS"),b={browser:_,version:t,OS:I}}a&&(b={browser:"ssr",version:0,OS:"ssr"})}();const v="undefined"!=typeof WebAssembly&&B&&!(/Safari/.test(B)&&!/Chrome/.test(B)&&/\(.+\s11_2_([2-6]).*\)/.test(B)),x=!("undefined"==typeof Worker),k=!(!V||!V.getUserMedia),Y=async()=>{let e=!1;if(k)try{(await V.getUserMedia({video:!0})).getTracks().forEach((e=>{e.stop()})),e=!0}catch(e){}return e};"Chrome"===b.browser&&b.version>66||"Safari"===b.browser&&b.version>13||"OPR"===b.browser&&b.version>43||"Edge"===b.browser&&b.version;const H={},X=async e=>{let E="string"==typeof e?[e]:e,t=[];for(let e of E)t.push(H[e]=H[e]||new _);await Promise.all(t)},Z=async(e,E)=>{let t,I="string"==typeof e?[e]:e,r=[];for(let e of I){let I;r.push(I=H[e]=H[e]||new _(t=t||E())),I.isEmpty&&(I.task=t=t||E())}await Promise.all(r)};e.worker=void 0;let W=0;const j=()=>W++,K={};e.onLog=void 0;const J=E=>{e.onLog=E,e.worker&&e.worker.postMessage({type:"setBLog",body:{value:!!E}})};e.bDebug=!1;const Q=E=>{e.bDebug=E,e.worker&&e.worker.postMessage({type:"setBDebug",body:{value:!!E}})},$={},z={dip:{wasm:!0}},q={std:{version:"1.4.20",path:C(i+"../../dynamsoft-capture-vision-std@1.4.20/dist/"),isInternal:!0},core:{version:"3.4.30",path:i,isInternal:!0}},ee=async E=>{let t;E instanceof Array||(E=E?[E]:[]);let I=H.core;t=!I||I.isEmpty;let r=new Map;const n=e=>{if("std"==(e=e.toLowerCase())||"core"==e)return;if(!z[e])throw Error("The '"+e+"' module cannot be found.");let E=z[e].deps;if(null==E?void 0:E.length)for(let e of E)n(e);let _=H[e];r.has(e)||r.set(e,!_||_.isEmpty)};for(let e of E)n(e);let o=[];t&&o.push("core"),o.push(...r.keys());const a=[...r.entries()].filter((e=>!e[1])).map((e=>e[0]));await Z(o,(async()=>{const E=[...r.entries()].filter((e=>e[1])).map((e=>e[0]));await X(a);const I=c(q),n={};for(let e of E)n[e]=z[e];const o={engineResourcePaths:I,autoResources:n,names:E};let s=new _;if(t){o.needLoadCore=!0;let E=I.core+Ee._workerName;E.startsWith(location.origin)||(E=await fetch(E).then((e=>e.blob())).then((e=>URL.createObjectURL(e)))),e.worker=new Worker(E),e.worker.onerror=e=>{let E=new Error(e.message);s.reject(E)},e.worker.addEventListener("message",(E=>{let _=E.data?E.data:E,t=_.type,I=_.id,r=_.body;switch(t){case"log":e.onLog&&e.onLog(_.message);break;case"task":try{K[I](r),delete K[I]}catch(e){throw delete K[I],e}break;case"event":try{K[I](r)}catch(e){throw e}break;default:console.log(E)}})),o.bLog=!!e.onLog,o.bd=e.bDebug,o.dm=location.origin.startsWith("http")?location.origin:"https://localhost"}else await X("core");let i=W++;K[i]=e=>{if(e.success)Object.assign($,e.versions),"{}"!==JSON.stringify(e.versions)&&(Ee._versions=e.versions),s.resolve(void 0);else{const E=Error(e.message);e.stack&&(E.stack=e.stack),s.reject(E)}},e.worker.postMessage({type:"loadWasm",body:o,id:i}),await s}))};class Ee{static get engineResourcePaths(){return q}static set engineResourcePaths(e){Object.assign(q,e)}static get bSupportDce4Module(){return this._bSupportDce4Module}static get bSupportIRTModule(){return this._bSupportIRTModule}static get versions(){return this._versions}static get _onLog(){return e.onLog}static set _onLog(e){J(e)}static get _bDebug(){return e.bDebug}static set _bDebug(e){Q(e)}static isModuleLoaded(e){return e=(e=e||"core").toLowerCase(),!!H[e]&&H[e].isFulfilled}static async loadWasm(e){return await ee(e)}static async detectEnvironment(){return await(async()=>({wasm:v,worker:x,getUserMedia:k,camera:await Y(),browser:b.browser,version:b.version,OS:b.OS}))()}static async getModuleVersion(){return await new Promise(((E,_)=>{let t=j();K[t]=async e=>{if(e.success)return E(e.versions);{let E=new Error(e.message);return E.stack=e.stack+"\n"+E.stack,_(E)}},e.worker.postMessage({type:"getModuleVersion",id:t})}))}static getVersion(){const e=$.core&&$.core.worker,E=$.core&&$.core.wasm;return`3.4.30(Worker: ${e||"Not Loaded"}, Wasm: ${E||"Not Loaded"})`}static enableLogging(){p._onLog=console.log,Ee._onLog=console.log}static disableLogging(){p._onLog=null,Ee._onLog=null}static async cfd(E){return await new Promise(((_,t)=>{let I=j();K[I]=async e=>{if(e.success)return _();{let E=new Error(e.message);return E.stack=e.stack+"\n"+E.stack,t(E)}},e.worker.postMessage({type:"cfd",id:I,body:{count:E}})}))}}var _e,te,Ie,re,ne,oe,ae,se,ie;Ee._bSupportDce4Module=-1,Ee._bSupportIRTModule=-1,Ee._versions=null,Ee._workerName="core.worker.js",Ee.browserInfo=b,e.EnumCapturedResultItemType=void 0,(_e=e.EnumCapturedResultItemType||(e.EnumCapturedResultItemType={}))[_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_NORMALIZED_IMAGE=16]="CRIT_NORMALIZED_IMAGE",_e[_e.CRIT_PARSED_RESULT=32]="CRIT_PARSED_RESULT",e.EnumCornerType=void 0,(te=e.EnumCornerType||(e.EnumCornerType={}))[te.CT_NORMAL_INTERSECTED=0]="CT_NORMAL_INTERSECTED",te[te.CT_T_INTERSECTED=1]="CT_T_INTERSECTED",te[te.CT_CROSS_INTERSECTED=2]="CT_CROSS_INTERSECTED",te[te.CT_NOT_INTERSECTED=3]="CT_NOT_INTERSECTED",e.EnumErrorCode=void 0,(Ie=e.EnumErrorCode||(e.EnumErrorCode={}))[Ie.EC_OK=0]="EC_OK",Ie[Ie.EC_UNKNOWN=-1e4]="EC_UNKNOWN",Ie[Ie.EC_NO_MEMORY=-10001]="EC_NO_MEMORY",Ie[Ie.EC_NULL_POINTER=-10002]="EC_NULL_POINTER",Ie[Ie.EC_LICENSE_INVALID=-10003]="EC_LICENSE_INVALID",Ie[Ie.EC_LICENSE_EXPIRED=-10004]="EC_LICENSE_EXPIRED",Ie[Ie.EC_FILE_NOT_FOUND=-10005]="EC_FILE_NOT_FOUND",Ie[Ie.EC_FILE_TYPE_NOT_SUPPORTED=-10006]="EC_FILE_TYPE_NOT_SUPPORTED",Ie[Ie.EC_BPP_NOT_SUPPORTED=-10007]="EC_BPP_NOT_SUPPORTED",Ie[Ie.EC_INDEX_INVALID=-10008]="EC_INDEX_INVALID",Ie[Ie.EC_CUSTOM_REGION_INVALID=-10010]="EC_CUSTOM_REGION_INVALID",Ie[Ie.EC_IMAGE_READ_FAILED=-10012]="EC_IMAGE_READ_FAILED",Ie[Ie.EC_TIFF_READ_FAILED=-10013]="EC_TIFF_READ_FAILED",Ie[Ie.EC_DIB_BUFFER_INVALID=-10018]="EC_DIB_BUFFER_INVALID",Ie[Ie.EC_PDF_READ_FAILED=-10021]="EC_PDF_READ_FAILED",Ie[Ie.EC_PDF_DLL_MISSING=-10022]="EC_PDF_DLL_MISSING",Ie[Ie.EC_PAGE_NUMBER_INVALID=-10023]="EC_PAGE_NUMBER_INVALID",Ie[Ie.EC_CUSTOM_SIZE_INVALID=-10024]="EC_CUSTOM_SIZE_INVALID",Ie[Ie.EC_TIMEOUT=-10026]="EC_TIMEOUT",Ie[Ie.EC_JSON_PARSE_FAILED=-10030]="EC_JSON_PARSE_FAILED",Ie[Ie.EC_JSON_TYPE_INVALID=-10031]="EC_JSON_TYPE_INVALID",Ie[Ie.EC_JSON_KEY_INVALID=-10032]="EC_JSON_KEY_INVALID",Ie[Ie.EC_JSON_VALUE_INVALID=-10033]="EC_JSON_VALUE_INVALID",Ie[Ie.EC_JSON_NAME_KEY_MISSING=-10034]="EC_JSON_NAME_KEY_MISSING",Ie[Ie.EC_JSON_NAME_VALUE_DUPLICATED=-10035]="EC_JSON_NAME_VALUE_DUPLICATED",Ie[Ie.EC_TEMPLATE_NAME_INVALID=-10036]="EC_TEMPLATE_NAME_INVALID",Ie[Ie.EC_JSON_NAME_REFERENCE_INVALID=-10037]="EC_JSON_NAME_REFERENCE_INVALID",Ie[Ie.EC_PARAMETER_VALUE_INVALID=-10038]="EC_PARAMETER_VALUE_INVALID",Ie[Ie.EC_DOMAIN_NOT_MATCH=-10039]="EC_DOMAIN_NOT_MATCH",Ie[Ie.EC_RESERVED_INFO_NOT_MATCH=-10040]="EC_RESERVED_INFO_NOT_MATCH",Ie[Ie.EC_LICENSE_KEY_NOT_MATCH=-10043]="EC_LICENSE_KEY_NOT_MATCH",Ie[Ie.EC_REQUEST_FAILED=-10044]="EC_REQUEST_FAILED",Ie[Ie.EC_LICENSE_INIT_FAILED=-10045]="EC_LICENSE_INIT_FAILED",Ie[Ie.EC_SET_MODE_ARGUMENT_ERROR=-10051]="EC_SET_MODE_ARGUMENT_ERROR",Ie[Ie.EC_LICENSE_CONTENT_INVALID=-10052]="EC_LICENSE_CONTENT_INVALID",Ie[Ie.EC_LICENSE_KEY_INVALID=-10053]="EC_LICENSE_KEY_INVALID",Ie[Ie.EC_LICENSE_DEVICE_RUNS_OUT=-10054]="EC_LICENSE_DEVICE_RUNS_OUT",Ie[Ie.EC_GET_MODE_ARGUMENT_ERROR=-10055]="EC_GET_MODE_ARGUMENT_ERROR",Ie[Ie.EC_IRT_LICENSE_INVALID=-10056]="EC_IRT_LICENSE_INVALID",Ie[Ie.EC_FILE_SAVE_FAILED=-10058]="EC_FILE_SAVE_FAILED",Ie[Ie.EC_STAGE_TYPE_INVALID=-10059]="EC_STAGE_TYPE_INVALID",Ie[Ie.EC_IMAGE_ORIENTATION_INVALID=-10060]="EC_IMAGE_ORIENTATION_INVALID",Ie[Ie.EC_CONVERT_COMPLEX_TEMPLATE_ERROR=-10061]="EC_CONVERT_COMPLEX_TEMPLATE_ERROR",Ie[Ie.EC_CALL_REJECTED_WHEN_CAPTURING=-10062]="EC_CALL_REJECTED_WHEN_CAPTURING",Ie[Ie.EC_NO_IMAGE_SOURCE=-10063]="EC_NO_IMAGE_SOURCE",Ie[Ie.EC_READ_DIRECTORY_FAILED=-10064]="EC_READ_DIRECTORY_FAILED",Ie[Ie.EC_MODULE_NOT_FOUND=-10065]="EC_MODULE_NOT_FOUND",Ie[Ie.EC_MULTI_PAGES_NOT_SUPPORTED=-10066]="EC_MULTI_PAGES_NOT_SUPPORTED",Ie[Ie.EC_FILE_ALREADY_EXISTS=-10067]="EC_FILE_ALREADY_EXISTS",Ie[Ie.EC_CREATE_FILE_FAILED=-10068]="EC_CREATE_FILE_FAILED",Ie[Ie.EC_IMGAE_DATA_INVALID=-10069]="EC_IMGAE_DATA_INVALID",Ie[Ie.EC_IMAGE_SIZE_NOT_MATCH=-10070]="EC_IMAGE_SIZE_NOT_MATCH",Ie[Ie.EC_IMAGE_PIXEL_FORMAT_NOT_MATCH=-10071]="EC_IMAGE_PIXEL_FORMAT_NOT_MATCH",Ie[Ie.EC_SECTION_LEVEL_RESULT_IRREPLACEABLE=-10072]="EC_SECTION_LEVEL_RESULT_IRREPLACEABLE",Ie[Ie.EC_AXIS_DEFINITION_INCORRECT=-10073]="EC_AXIS_DEFINITION_INCORRECT",Ie[Ie.EC_RESULT_TYPE_MISMATCH_IRREPLACEABLE=-10074]="EC_RESULT_TYPE_MISMATCH_IRREPLACEABLE",Ie[Ie.EC_PDF_LIBRARY_LOAD_FAILED=-10075]="EC_PDF_LIBRARY_LOAD_FAILED",Ie[Ie.EC_NO_LICENSE=-2e4]="EC_NO_LICENSE",Ie[Ie.EC_HANDSHAKE_CODE_INVALID=-20001]="EC_HANDSHAKE_CODE_INVALID",Ie[Ie.EC_LICENSE_BUFFER_FAILED=-20002]="EC_LICENSE_BUFFER_FAILED",Ie[Ie.EC_LICENSE_SYNC_FAILED=-20003]="EC_LICENSE_SYNC_FAILED",Ie[Ie.EC_DEVICE_NOT_MATCH=-20004]="EC_DEVICE_NOT_MATCH",Ie[Ie.EC_BIND_DEVICE_FAILED=-20005]="EC_BIND_DEVICE_FAILED",Ie[Ie.EC_INSTANCE_COUNT_OVER_LIMIT=-20008]="EC_INSTANCE_COUNT_OVER_LIMIT",Ie[Ie.EC_LICENSE_INIT_SEQUENCE_FAILED=-20009]="EC_LICENSE_INIT_SEQUENCE_FAILED",Ie[Ie.EC_TRIAL_LICENSE=-20010]="EC_TRIAL_LICENSE",Ie[Ie.EC_FAILED_TO_REACH_DLS=-20200]="EC_FAILED_TO_REACH_DLS",Ie[Ie.EC_LICENSE_CACHE_USED=-20012]="EC_LICENSE_CACHE_USED",Ie[Ie.EC_BARCODE_FORMAT_INVALID=-30009]="EC_BARCODE_FORMAT_INVALID",Ie[Ie.EC_QR_LICENSE_INVALID=-30016]="EC_QR_LICENSE_INVALID",Ie[Ie.EC_1D_LICENSE_INVALID=-30017]="EC_1D_LICENSE_INVALID",Ie[Ie.EC_PDF417_LICENSE_INVALID=-30019]="EC_PDF417_LICENSE_INVALID",Ie[Ie.EC_DATAMATRIX_LICENSE_INVALID=-30020]="EC_DATAMATRIX_LICENSE_INVALID",Ie[Ie.EC_CUSTOM_MODULESIZE_INVALID=-30025]="EC_CUSTOM_MODULESIZE_INVALID",Ie[Ie.EC_AZTEC_LICENSE_INVALID=-30041]="EC_AZTEC_LICENSE_INVALID",Ie[Ie.EC_PATCHCODE_LICENSE_INVALID=-30046]="EC_PATCHCODE_LICENSE_INVALID",Ie[Ie.EC_POSTALCODE_LICENSE_INVALID=-30047]="EC_POSTALCODE_LICENSE_INVALID",Ie[Ie.EC_DPM_LICENSE_INVALID=-30048]="EC_DPM_LICENSE_INVALID",Ie[Ie.EC_FRAME_DECODING_THREAD_EXISTS=-30049]="EC_FRAME_DECODING_THREAD_EXISTS",Ie[Ie.EC_STOP_DECODING_THREAD_FAILED=-30050]="EC_STOP_DECODING_THREAD_FAILED",Ie[Ie.EC_MAXICODE_LICENSE_INVALID=-30057]="EC_MAXICODE_LICENSE_INVALID",Ie[Ie.EC_GS1_DATABAR_LICENSE_INVALID=-30058]="EC_GS1_DATABAR_LICENSE_INVALID",Ie[Ie.EC_GS1_COMPOSITE_LICENSE_INVALID=-30059]="EC_GS1_COMPOSITE_LICENSE_INVALID",Ie[Ie.EC_DOTCODE_LICENSE_INVALID=-30061]="EC_DOTCODE_LICENSE_INVALID",Ie[Ie.EC_PHARMACODE_LICENSE_INVALID=-30062]="EC_PHARMACODE_LICENSE_INVALID",Ie[Ie.EC_CHARACTER_MODEL_FILE_NOT_FOUND=-40100]="EC_CHARACTER_MODEL_FILE_NOT_FOUND",Ie[Ie.EC_TEXT_LINE_GROUP_LAYOUT_CONFLICT=-40101]="EC_TEXT_LINE_GROUP_LAYOUT_CONFLICT",Ie[Ie.EC_TEXT_LINE_GROUP_REGEX_CONFLICT=-40102]="EC_TEXT_LINE_GROUP_REGEX_CONFLICT",Ie[Ie.EC_QUADRILATERAL_INVALID=-50057]="EC_QUADRILATERAL_INVALID",Ie[Ie.EC_PANORAMA_LICENSE_INVALID=-70060]="EC_PANORAMA_LICENSE_INVALID",Ie[Ie.EC_RESOURCE_PATH_NOT_EXIST=-90001]="EC_RESOURCE_PATH_NOT_EXIST",Ie[Ie.EC_RESOURCE_LOAD_FAILED=-90002]="EC_RESOURCE_LOAD_FAILED",Ie[Ie.EC_CODE_SPECIFICATION_NOT_FOUND=-90003]="EC_CODE_SPECIFICATION_NOT_FOUND",Ie[Ie.EC_FULL_CODE_EMPTY=-90004]="EC_FULL_CODE_EMPTY",Ie[Ie.EC_FULL_CODE_PREPROCESS_FAILED=-90005]="EC_FULL_CODE_PREPROCESS_FAILED",Ie[Ie.EC_ZA_DL_LICENSE_INVALID=-90006]="EC_ZA_DL_LICENSE_INVALID",Ie[Ie.EC_AAMVA_DL_ID_LICENSE_INVALID=-90007]="EC_AAMVA_DL_ID_LICENSE_INVALID",Ie[Ie.EC_AADHAAR_LICENSE_INVALID=-90008]="EC_AADHAAR_LICENSE_INVALID",Ie[Ie.EC_MRTD_LICENSE_INVALID=-90009]="EC_MRTD_LICENSE_INVALID",Ie[Ie.EC_VIN_LICENSE_INVALID=-90010]="EC_VIN_LICENSE_INVALID",Ie[Ie.EC_CUSTOMIZED_CODE_TYPE_LICENSE_INVALID=-90011]="EC_CUSTOMIZED_CODE_TYPE_LICENSE_INVALID",Ie[Ie.EC_LICENSE_WARNING=-10076]="EC_LICENSE_WARNING",Ie[Ie.EC_BARCODE_READER_LICENSE_NOT_FOUND=-30063]="EC_BARCODE_READER_LICENSE_NOT_FOUND",Ie[Ie.EC_LABEL_RECOGNIZER_LICENSE_NOT_FOUND=-40103]="EC_LABEL_RECOGNIZER_LICENSE_NOT_FOUND",Ie[Ie.EC_DOCUMENT_NORMALIZER_LICENSE_NOT_FOUND=-50058]="EC_DOCUMENT_NORMALIZER_LICENSE_NOT_FOUND",Ie[Ie.EC_CODE_PARSER_LICENSE_NOT_FOUND=-90012]="EC_CODE_PARSER_LICENSE_NOT_FOUND",e.EnumGrayscaleEnhancementMode=void 0,(re=e.EnumGrayscaleEnhancementMode||(e.EnumGrayscaleEnhancementMode={}))[re.GEM_SKIP=0]="GEM_SKIP",re[re.GEM_AUTO=1]="GEM_AUTO",re[re.GEM_GENERAL=2]="GEM_GENERAL",re[re.GEM_GRAY_EQUALIZE=4]="GEM_GRAY_EQUALIZE",re[re.GEM_GRAY_SMOOTH=8]="GEM_GRAY_SMOOTH",re[re.GEM_SHARPEN_SMOOTH=16]="GEM_SHARPEN_SMOOTH",re[re.GEM_REV=-2147483648]="GEM_REV",e.EnumGrayscaleTransformationMode=void 0,(ne=e.EnumGrayscaleTransformationMode||(e.EnumGrayscaleTransformationMode={}))[ne.GTM_SKIP=0]="GTM_SKIP",ne[ne.GTM_INVERTED=1]="GTM_INVERTED",ne[ne.GTM_ORIGINAL=2]="GTM_ORIGINAL",ne[ne.GTM_AUTO=4]="GTM_AUTO",ne[ne.GTM_REV=-2147483648]="GTM_REV",e.EnumImageTagType=void 0,(oe=e.EnumImageTagType||(e.EnumImageTagType={}))[oe.ITT_FILE_IMAGE=0]="ITT_FILE_IMAGE",oe[oe.ITT_VIDEO_FRAME=1]="ITT_VIDEO_FRAME",e.EnumPDFReadingMode=void 0,(ae=e.EnumPDFReadingMode||(e.EnumPDFReadingMode={}))[ae.PDFRM_VECTOR=1]="PDFRM_VECTOR",ae[ae.PDFRM_RASTER=2]="PDFRM_RASTER",ae[ae.PDFRM_REV=-2147483648]="PDFRM_REV",e.EnumRasterDataSource=void 0,(se=e.EnumRasterDataSource||(e.EnumRasterDataSource={}))[se.RDS_RASTERIZED_PAGES=0]="RDS_RASTERIZED_PAGES",se[se.RDS_EXTRACTED_IMAGES=1]="RDS_EXTRACTED_IMAGES",e.EnumCrossVerificationStatus=void 0,(ie=e.EnumCrossVerificationStatus||(e.EnumCrossVerificationStatus={}))[ie.CVS_NOT_VERIFIED=0]="CVS_NOT_VERIFIED",ie[ie.CVS_PASSED=1]="CVS_PASSED",ie[ie.CVS_FAILED=2]="CVS_FAILED";const Ce={IRUT_NULL:BigInt(0),IRUT_COLOUR_IMAGE:BigInt(1),IRUT_SCALED_DOWN_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_UP_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_NORMALIZED_IMAGES:BigInt(1<<26),IRUT_SHORT_LINES:BigInt(1<<27),IRUT_RAW_TEXT_LINES:BigInt(1<<28),IRUT_LOGIC_LINES:BigInt(1<<29),IRUT_ALL:BigInt("0xFFFFFFFFFFFFFFFF")};var Ae,Te;e.EnumRegionObjectElementType=void 0,(Ae=e.EnumRegionObjectElementType||(e.EnumRegionObjectElementType={}))[Ae.ROET_PREDETECTED_REGION=0]="ROET_PREDETECTED_REGION",Ae[Ae.ROET_LOCALIZED_BARCODE=1]="ROET_LOCALIZED_BARCODE",Ae[Ae.ROET_DECODED_BARCODE=2]="ROET_DECODED_BARCODE",Ae[Ae.ROET_LOCALIZED_TEXT_LINE=3]="ROET_LOCALIZED_TEXT_LINE",Ae[Ae.ROET_RECOGNIZED_TEXT_LINE=4]="ROET_RECOGNIZED_TEXT_LINE",Ae[Ae.ROET_DETECTED_QUAD=5]="ROET_DETECTED_QUAD",Ae[Ae.ROET_NORMALIZED_IMAGE=6]="ROET_NORMALIZED_IMAGE",Ae[Ae.ROET_SOURCE_IMAGE=7]="ROET_SOURCE_IMAGE",Ae[Ae.ROET_TARGET_ROI=8]="ROET_TARGET_ROI",e.EnumSectionType=void 0,(Te=e.EnumSectionType||(e.EnumSectionType={}))[Te.ST_NULL=0]="ST_NULL",Te[Te.ST_REGION_PREDETECTION=1]="ST_REGION_PREDETECTION",Te[Te.ST_BARCODE_LOCALIZATION=2]="ST_BARCODE_LOCALIZATION",Te[Te.ST_BARCODE_DECODING=3]="ST_BARCODE_DECODING",Te[Te.ST_TEXT_LINE_LOCALIZATION=4]="ST_TEXT_LINE_LOCALIZATION",Te[Te.ST_TEXT_LINE_RECOGNITION=5]="ST_TEXT_LINE_RECOGNITION",Te[Te.ST_DOCUMENT_DETECTION=6]="ST_DOCUMENT_DETECTION",Te[Te.ST_DOCUMENT_NORMALIZATION=7]="ST_DOCUMENT_NORMALIZATION",e.CoreModule=Ee,e.EnumIntermediateResultUnitType=Ce,e.ImageSourceAdapter=p,e._getNorImageData=g,e._saveToFile=async(e,E,_)=>await new Promise((async(t,I)=>{try{const I=E.split(".");let r=I[I.length-1];const n=await S(`image/${r}`,e);I.length<=1&&(r="png");const o=new File([n],E,{type:`image/${r}`});if(_){const e=URL.createObjectURL(o),_=document.createElement("a");_.href=e,_.download=E,_.click()}return t(o)}catch(e){return I()}})),e._toBlob=S,e._toCanvas=u,e._toImage=(e,E)=>{O(E)&&(E=g(E));const _=u(E);let t=new Image,I=_.toDataURL(e);return t.src=I,t},e.checkIsLink=e=>/^(https:\/\/www\.|http:\/\/www\.|https:\/\/|http:\/\/)|^[a-zA-Z0-9]{2,}(\.[a-zA-Z0-9]{2,})(\.[a-zA-Z0-9]{2,})?/.test(e),e.compareVersion=(e,E)=>{let _=e.split("."),t=E.split(".");for(let e=0;e<_.length&&e<t.length;++e){let E=_[e],I=t[e];if(E===I)continue;let r=parseInt(_[e]),n=parseInt(t[e]);return r===n||Number.isNaN(r)&&Number.isNaN(n)?E<I?-1:1:r<n||Number.isNaN(r)&&Number.isInteger(n)?-1:1}return _.length===t.length?0:_.length<t.length?-1:1},e.doOrWaitAsyncDependency=Z,e.getNextTaskID=j,e.handleEngineResourcePaths=c,e.innerVersions=$,e.isArc=e=>!!L(e)&&(!!R(e.x)&&(!!R(e.y)&&(!!R(e.radius)&&(!(e.radius<0)&&(!!R(e.startAngle)&&!!R(e.endAngle)))))),e.isContour=e=>!!L(e)&&(!!T(e.points)&&(0!=e.points.length&&!e.points.some((e=>!m(e))))),e.isDSImageData=O,e.isDSRect=e=>!!L(e)&&(!!R(e.left)&&(!(e.left<0)&&(!!R(e.top)&&(!(e.top<0)&&(!!R(e.right)&&(!(e.right<0)&&(!!R(e.bottom)&&(!(e.bottom<0)&&(!(e.left>=e.right)&&(!(e.top>=e.bottom)&&!!N(e.isMeasuredInPercentage))))))))))),e.isImageTag=l,e.isLineSegment=e=>!!L(e)&&(!!m(e.startPoint)&&(!!m(e.endPoint)&&(e.startPoint.x!=e.endPoint.x||e.startPoint.y!=e.endPoint.y))),e.isObject=L,e.isOriginalDsImageData=e=>!!D(e)&&!(!R(e.bytes.length)&&!R(e.bytes.ptr)),e.isPoint=m,e.isPolygon=e=>!!L(e)&&(!!T(e.points)&&(0!=e.points.length&&!e.points.some((e=>!m(e))))),e.isQuad=e=>!!L(e)&&(!!T(e.points)&&(0!=e.points.length&&4==e.points.length&&!e.points.some((e=>!m(e))))),e.isRect=e=>!!L(e)&&(!!R(e.x)&&(!!R(e.y)&&(!!R(e.width)&&(!(e.width<0)&&(!!R(e.height)&&(!(e.height<0)&&!("isMeasuredInPercentage"in e&&!N(e.isMeasuredInPercentage)))))))),e.loadWasm=ee,e.mapAsyncDependency=H,e.mapPackageRegister={},e.mapTaskCallBack=K,e.requestResource=async(e,E)=>await new Promise(((_,t)=>{let I=new XMLHttpRequest;I.open("GET",e,!0),I.responseType=E,I.send(),I.onloadend=async()=>{I.status<200||I.status>=300?t(new Error(e+" "+I.status)):_(I.response)},I.onerror=()=>{t(new Error("Network Error: "+I.statusText))}})),e.setBDebug=Q,e.setOnLog=J,e.waitAsyncDependency=X,e.workerAutoResources=z})); |
@@ -11,2 +11,2 @@ /*! | ||
*/ | ||
!function(){"use strict";const e=e=>e&&"object"==typeof e&&"function"==typeof e.then;class t extends Promise{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(t){let s;this._task=t,e(t)?s=t:"function"==typeof t&&(s=new Promise(t)),s&&(async()=>{try{const e=await s;t===this._task&&this.resolve(e)}catch(e){t===this._task&&this.reject(e)}})()}get isEmpty(){return null==this._task}constructor(t){let s,r;super(((e,t)=>{s=e,r=t})),this._s="pending",this.resolve=t=>{this.isPending&&(e(t)?this.task=t:(this._s="fulfilled",s(t)))},this.reject=e=>{this.isPending&&(this._s="rejected",r(e))},this.task=t}}const s=self,r={};s.coreWorkerVersion="3.4.30-beta-202412040036",s.versions=r;const o={},a=s.waitAsyncDependency=async e=>{let s="string"==typeof e?[e]:e,r=[];for(let e of s)r.push(o[e]=o[e]||new t);await Promise.all(r)},i=async(e,s)=>{let r,a="string"==typeof e?[e]:e,i=[];for(let e of a){let a;i.push(a=o[e]=o[e]||new t(r=r||s())),a.isEmpty&&(a.task=r=r||s())}await Promise.all(i)},n=[];s.setBufferIntoWasm=(e,t=0,s=0,r=0)=>{s&&(e=r?e.subarray(s,r):e.subarray(s));let o=n[t]=n[t]||{ptr:0,size:0,maxSize:0};return e.length>o.maxSize&&(o.ptr&&p._free(o.ptr),o.ptr=p._malloc(e.length),o.maxSize=e.length),p.HEAPU8.set(e,o.ptr),o.size=e.length,o.ptr};const l={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(l.needed){for(let e=0;e<l.temps.length;e++)p._free(l.temps[e]);l.temps.length=0,p._free(l.buffer),l.buffer=0,l.size+=l.needed,l.needed=0}l.buffer||(l.size+=128,l.buffer=p._malloc(l.size),assert(l.buffer)),l.pos=0},alloc:function(e,t){assert(l.buffer);let s,r=t.BYTES_PER_ELEMENT,o=e.length*r;return o=o+7&-8,l.pos+o>=l.size?(assert(o>0),l.needed+=o,s=p._malloc(o),l.temps.push(s)):(s=l.buffer+l.pos,l.pos+=o),s},copy:function(e,t,s){switch(s>>>=0,t.BYTES_PER_ELEMENT){case 2:s>>>=1;break;case 4:s>>>=2;break;case 8:s>>>=3}for(let r=0;r<e.length;r++)t[s+r]=e[r]}},c=s.ep=l.prepare;s.bDebug=!1,s.bLog=!1,s.strDomain=void 0;const d=s.es=e=>{let t=intArrayFromString(e),s=l.alloc(t,p.HEAP8);return l.copy(t,p.HEAP8,s),s},p=s.Module={print:e=>{s.bLog&&h(e)},printErr:e=>{s.bLog&&h(e)},locateFile:(e,t)=>{if(["std.wasm","core.wasm"].includes(e)){return m[e.split(".")[0]]+e}return e}},m=s.engineResourcePaths={},u=s.loadCore=async()=>{const e="core";await i(e,(async()=>{let t=s.bLog&&(h(e+" loading..."),Date.now())||0,r=new Promise((r=>{p.onRuntimeInitialized=()=>{s.bLog&&h(e+" initialized, cost "+(Date.now()-t)+" ms"),r(void 0)}})),o=m.std+"std.js";importScripts(o),await r}))},f=s.loadSideModule=async(e,{js:t,wasm:o})=>{await i(e,(async()=>{await a("core");let i=s.bLog&&(h(e+" loading..."),Date.now())||0;if(t instanceof Array)for(let s of t){let t=m[e]+s;importScripts(t)}else if(t){let t=m[e]+e+".worker.js";importScripts(t)}if(o instanceof Array)for(let t of o){let s=m[e]+t;try{await loadDynamicLibrary(s,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})}catch(e){throw e}}else if(o){let t=m[e]+e+".wasm";try{await loadDynamicLibrary(t,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})}catch(e){throw e}}wasmImports.emscripten_bind_CoreWasm_PreSetModuleExist&&(c(),wasmImports.emscripten_bind_CoreWasm_PreSetModuleExist(d(e.toUpperCase()))),wasmImports.emscripten_bind_CvrWasm_SetModuleExist&&(c(),wasmImports.emscripten_bind_CvrWasm_SetModuleExist(d(e.toUpperCase())));const n=JSON.parse(UTF8ToString(wasmImports.emscripten_bind_CoreWasm_GetModuleVersion_0())),l=s[`${e}WorkerVersion`];r[e]={worker:`${l||"No Worker"}`,wasm:n[e.toUpperCase()]},s.bLog&&h(e+" initialized, cost "+(Date.now()-i)+" ms")}))},g=s.mapController={loadWasm:async(e,t)=>{try{Object.assign(m,e.engineResourcePaths),e.needLoadCore&&(e.bLog&&(s.bLog=!0),e.dm&&(s.strDomain=e.dm),e.bd&&(s.bDebug=!0),await u());for(let t of e.names)await f(t,e.autoResources[t]);if(e.needLoadCore){const e=JSON.parse(UTF8ToString(wasmImports.emscripten_bind_CoreWasm_GetModuleVersion_0()));r.core={worker:s.coreWorkerVersion,wasm:e.CORE}}b(t,{versions:r})}catch(e){console.log(e),_(t,e)}},setBLog:e=>{s.bLog=e.value},setBDebug:e=>{s.bDebug=e.value},getModuleVersion:async(e,t)=>{try{let e=UTF8ToString(wasmImports.emscripten_bind_CoreWasm_GetModuleVersion_0());b(t,{versions:JSON.parse(e)})}catch(e){_(t,e)}},cfd:async(e,t)=>{try{wasmImports.emscripten_bind_CoreWasm_static_CFD_1(e.count),b(t,{})}catch(e){_(t,e)}}};addEventListener("message",(e=>{const t=e.data?e.data:e,s=t.body,r=t.id,o=t.instanceID,a=g[t.type];if(!a)throw new Error("Unmatched task: "+t.type);a(s,r,o)}));const b=s.handleTaskRes=(e,t)=>{postMessage({type:"task",id:e,body:Object.assign({success:!0},t)})},_=s.handleTaskErr=(e,t)=>{postMessage({type:"task",id:e,body:{success:!1,message:(null==t?void 0:t.message)||"No have error message.",stack:s.bDebug&&(null==t?void 0:t.stack)||"No have stack."}})},h=s.log=e=>{postMessage({type:"log",message:e})}}(); | ||
!function(){"use strict";const e=e=>e&&"object"==typeof e&&"function"==typeof e.then;class t extends Promise{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(t){let s;this._task=t,e(t)?s=t:"function"==typeof t&&(s=new Promise(t)),s&&(async()=>{try{const e=await s;t===this._task&&this.resolve(e)}catch(e){t===this._task&&this.reject(e)}})()}get isEmpty(){return null==this._task}constructor(t){let s,r;super(((e,t)=>{s=e,r=t})),this._s="pending",this.resolve=t=>{this.isPending&&(e(t)?this.task=t:(this._s="fulfilled",s(t)))},this.reject=e=>{this.isPending&&(this._s="rejected",r(e))},this.task=t}}const s=self,r={};s.coreWorkerVersion="3.4.30",s.versions=r;const o={},a=s.waitAsyncDependency=async e=>{let s="string"==typeof e?[e]:e,r=[];for(let e of s)r.push(o[e]=o[e]||new t);await Promise.all(r)},i=async(e,s)=>{let r,a="string"==typeof e?[e]:e,i=[];for(let e of a){let a;i.push(a=o[e]=o[e]||new t(r=r||s())),a.isEmpty&&(a.task=r=r||s())}await Promise.all(i)},n=[];s.setBufferIntoWasm=(e,t=0,s=0,r=0)=>{s&&(e=r?e.subarray(s,r):e.subarray(s));let o=n[t]=n[t]||{ptr:0,size:0,maxSize:0};return e.length>o.maxSize&&(o.ptr&&p._free(o.ptr),o.ptr=p._malloc(e.length),o.maxSize=e.length),p.HEAPU8.set(e,o.ptr),o.size=e.length,o.ptr};const l={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(l.needed){for(let e=0;e<l.temps.length;e++)p._free(l.temps[e]);l.temps.length=0,p._free(l.buffer),l.buffer=0,l.size+=l.needed,l.needed=0}l.buffer||(l.size+=128,l.buffer=p._malloc(l.size),assert(l.buffer)),l.pos=0},alloc:function(e,t){assert(l.buffer);let s,r=t.BYTES_PER_ELEMENT,o=e.length*r;return o=o+7&-8,l.pos+o>=l.size?(assert(o>0),l.needed+=o,s=p._malloc(o),l.temps.push(s)):(s=l.buffer+l.pos,l.pos+=o),s},copy:function(e,t,s){switch(s>>>=0,t.BYTES_PER_ELEMENT){case 2:s>>>=1;break;case 4:s>>>=2;break;case 8:s>>>=3}for(let r=0;r<e.length;r++)t[s+r]=e[r]}},c=s.ep=l.prepare;s.bDebug=!1,s.bLog=!1,s.strDomain=void 0;const d=s.es=e=>{let t=intArrayFromString(e),s=l.alloc(t,p.HEAP8);return l.copy(t,p.HEAP8,s),s},p=s.Module={print:e=>{s.bLog&&h(e)},printErr:e=>{s.bLog&&h(e)},locateFile:(e,t)=>{if(["std.wasm","core.wasm"].includes(e)){return m[e.split(".")[0]]+e}return e}},m=s.engineResourcePaths={},u=s.loadCore=async()=>{const e="core";await i(e,(async()=>{let t=s.bLog&&(h(e+" loading..."),Date.now())||0,r=new Promise((r=>{p.onRuntimeInitialized=()=>{s.bLog&&h(e+" initialized, cost "+(Date.now()-t)+" ms"),r(void 0)}})),o=m.std+"std.js";importScripts(o),await r}))},f=s.loadSideModule=async(e,{js:t,wasm:o})=>{await i(e,(async()=>{await a("core");let i=s.bLog&&(h(e+" loading..."),Date.now())||0;if(t instanceof Array)for(let s of t){let t=m[e]+s;importScripts(t)}else if(t){let t=m[e]+e+".worker.js";importScripts(t)}if(o instanceof Array)for(let t of o){let s=m[e]+t;try{await loadDynamicLibrary(s,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})}catch(e){throw e}}else if(o){let t=m[e]+e+".wasm";try{await loadDynamicLibrary(t,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})}catch(e){throw e}}wasmImports.emscripten_bind_CoreWasm_PreSetModuleExist&&(c(),wasmImports.emscripten_bind_CoreWasm_PreSetModuleExist(d(e.toUpperCase()))),wasmImports.emscripten_bind_CvrWasm_SetModuleExist&&(c(),wasmImports.emscripten_bind_CvrWasm_SetModuleExist(d(e.toUpperCase())));const n=JSON.parse(UTF8ToString(wasmImports.emscripten_bind_CoreWasm_GetModuleVersion_0())),l=s[`${e}WorkerVersion`];r[e]={worker:`${l||"No Worker"}`,wasm:n[e.toUpperCase()]},s.bLog&&h(e+" initialized, cost "+(Date.now()-i)+" ms")}))},g=s.mapController={loadWasm:async(e,t)=>{try{Object.assign(m,e.engineResourcePaths),e.needLoadCore&&(e.bLog&&(s.bLog=!0),e.dm&&(s.strDomain=e.dm),e.bd&&(s.bDebug=!0),await u());for(let t of e.names)await f(t,e.autoResources[t]);if(e.needLoadCore){const e=JSON.parse(UTF8ToString(wasmImports.emscripten_bind_CoreWasm_GetModuleVersion_0()));r.core={worker:s.coreWorkerVersion,wasm:e.CORE}}_(t,{versions:r})}catch(e){console.log(e),b(t,e)}},setBLog:e=>{s.bLog=e.value},setBDebug:e=>{s.bDebug=e.value},getModuleVersion:async(e,t)=>{try{let e=UTF8ToString(wasmImports.emscripten_bind_CoreWasm_GetModuleVersion_0());_(t,{versions:JSON.parse(e)})}catch(e){b(t,e)}},cfd:async(e,t)=>{try{wasmImports.emscripten_bind_CoreWasm_static_CFD_1(e.count),_(t,{})}catch(e){b(t,e)}}};addEventListener("message",(e=>{const t=e.data?e.data:e,s=t.body,r=t.id,o=t.instanceID,a=g[t.type];if(!a)throw new Error("Unmatched task: "+t.type);a(s,r,o)}));const _=s.handleTaskRes=(e,t)=>{postMessage({type:"task",id:e,body:Object.assign({success:!0},t)})},b=s.handleTaskErr=(e,t)=>{postMessage({type:"task",id:e,body:{success:!1,message:(null==t?void 0:t.message)||"No have error message.",stack:s.bDebug&&(null==t?void 0:t.stack)||"No have stack."}})},h=s.log=e=>{postMessage({type:"log",message:e})}}(); |
{ | ||
"name": "dynamsoft-core", | ||
"version": "3.4.30-beta-202412040036", | ||
"version": "3.4.30", | ||
"description": "The Dynamsoft Core module builds the foundation upon which Dynamsoft SDKs implement their functionality.", | ||
@@ -21,3 +21,3 @@ "main": "dist/core.js", | ||
"registry": "https://registry.npmjs.org/", | ||
"tag": "beta" | ||
"tag": "latest" | ||
}, | ||
@@ -24,0 +24,0 @@ "author": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
2
526312
1371