dynamsoft-core
Advanced tools
Comparing version 3.4.21 to 3.4.30-beta-202412032155
@@ -0,1 +1,126 @@ | ||
interface WorkerAutoResources { | ||
[key: string]: { | ||
js?: string[] | boolean; | ||
wasm?: string[] | boolean; | ||
deps?: string[]; | ||
}; | ||
} | ||
interface PostMessageBody { | ||
needLoadCore?: boolean; | ||
bLog?: boolean; | ||
bd?: boolean; | ||
dm?: string; | ||
value?: boolean; | ||
count?: number; | ||
engineResourcePaths?: EngineResourcePaths; | ||
autoResources?: WorkerAutoResources; | ||
names?: string[]; | ||
} | ||
type PathInfo = { | ||
version: string; | ||
path: string; | ||
isInternal?: boolean; | ||
}; | ||
type DwtInfo = { | ||
resourcesPath?: string; | ||
serviceInstallerLocation?: string; | ||
}; | ||
interface EngineResourcePaths { | ||
"rootDirectory"?: string; | ||
"std"?: string | PathInfo; | ||
"dip"?: string | PathInfo; | ||
"dnn"?: string | PathInfo; | ||
"core"?: string | PathInfo; | ||
"license"?: string | PathInfo; | ||
"cvr"?: string | PathInfo; | ||
"utility"?: string | PathInfo; | ||
"dbr"?: string | PathInfo; | ||
"dlr"?: string | PathInfo; | ||
"ddn"?: string | PathInfo; | ||
"dcp"?: string | PathInfo; | ||
"dce"?: string | PathInfo; | ||
"dlrData"?: string | PathInfo; | ||
"ddv"?: string | PathInfo; | ||
"dwt"?: string | DwtInfo; | ||
[moduleName: string]: string | PathInfo | DwtInfo; | ||
} | ||
interface InnerVersions { | ||
[key: string]: { | ||
worker?: string; | ||
wasm?: string; | ||
}; | ||
} | ||
interface WasmVersions { | ||
"DIP"?: string; | ||
"DNN"?: string; | ||
"CORE"?: string; | ||
"LICENSE"?: string; | ||
"CVR"?: string; | ||
"UTILITY"?: string; | ||
"DBR"?: string; | ||
"DLR"?: string; | ||
"DDN"?: string; | ||
"DCP"?: string; | ||
} | ||
interface MapController { | ||
[key: string]: ((body: any, taskID: number, instanceID?: number) => void); | ||
} | ||
type mimetype = "image/png" | "image/jpeg"; | ||
declare const mapAsyncDependency: { | ||
[key: string]: any; | ||
}; | ||
declare const waitAsyncDependency: (depName: string | string[]) => Promise<void>; | ||
declare const doOrWaitAsyncDependency: (depName: string | string[], asyncFunc: () => Promise<void>) => Promise<void>; | ||
declare let worker: Worker; | ||
declare const getNextTaskID: () => number; | ||
declare const mapTaskCallBack: { | ||
[key: string]: Function; | ||
}; | ||
declare let onLog: (message: string) => void | undefined; | ||
declare const setOnLog: (value: typeof onLog) => void; | ||
declare let bDebug: boolean; | ||
declare const setBDebug: (value: boolean) => void; | ||
declare const innerVersions: InnerVersions; | ||
declare const mapPackageRegister: { | ||
[key: string]: any; | ||
}; | ||
declare const workerAutoResources: WorkerAutoResources; | ||
declare const loadWasm: (names?: string[] | string) => Promise<void>; | ||
declare class CoreModule { | ||
static get engineResourcePaths(): EngineResourcePaths; | ||
static set engineResourcePaths(value: EngineResourcePaths); | ||
private static _bSupportDce4Module; | ||
static get bSupportDce4Module(): number; | ||
private static _bSupportIRTModule; | ||
static get bSupportIRTModule(): number; | ||
private static _versions; | ||
static get versions(): any; | ||
static get _onLog(): (message: string) => void; | ||
static set _onLog(value: (message: string) => void); | ||
static get _bDebug(): boolean; | ||
static set _bDebug(value: boolean); | ||
static _workerName: string; | ||
/** | ||
* Determine if the decoding module has been loaded successfully. | ||
* @category Initialize and Destroy | ||
*/ | ||
static isModuleLoaded(name?: string): boolean; | ||
static loadWasm(names: string[] | string): Promise<void>; | ||
/** | ||
* Detect environment and get a report. | ||
*/ | ||
static detectEnvironment(): Promise<any>; | ||
/** | ||
* modify from https://gist.github.com/2107/5529665 | ||
* @ignore | ||
*/ | ||
static browserInfo: any; | ||
static getModuleVersion(): Promise<WasmVersions>; | ||
static getVersion(): string; | ||
static enableLogging(): void; | ||
static disableLogging(): void; | ||
static cfd(count: number): Promise<void>; | ||
} | ||
declare enum EnumImageTagType { | ||
@@ -357,2 +482,11 @@ ITT_FILE_IMAGE = 0, | ||
declare enum EnumCrossVerificationStatus { | ||
/** The cross verification has not been performed yet. */ | ||
CVS_NOT_VERIFIED = 0, | ||
/** The cross verification has been passed successfully. */ | ||
CVS_PASSED = 1, | ||
/** The cross verification has failed. */ | ||
CVS_FAILED = 2 | ||
} | ||
declare const EnumIntermediateResultUnitType: { | ||
@@ -418,2 +552,4 @@ /** No intermediate result. */ | ||
IRUT_RAW_TEXT_LINES: bigint; | ||
/** Detected logic lines. */ | ||
IRUT_LOGIC_LINES: bigint; | ||
/** A mask to select all types of intermediate results. */ | ||
@@ -517,3 +653,3 @@ IRUT_ALL: bigint; | ||
points: [Point, Point, Point, Point]; | ||
area: number; | ||
area?: number; | ||
} | ||
@@ -799,230 +935,2 @@ | ||
interface WorkerAutoResources { | ||
[key: string]: { | ||
js?: string[] | boolean; | ||
wasm?: string[] | boolean; | ||
deps?: string[]; | ||
}; | ||
} | ||
interface PostMessageBody { | ||
needLoadCore?: boolean; | ||
bLog?: boolean; | ||
bd?: boolean; | ||
dm?: string; | ||
value?: boolean; | ||
count?: number; | ||
engineResourcePaths?: EngineResourcePaths; | ||
autoResources?: WorkerAutoResources; | ||
names?: string[]; | ||
} | ||
interface EngineResourcePaths { | ||
"rootDirectory"?: string; | ||
"std"?: string | { | ||
version: string; | ||
path: string; | ||
}; | ||
"dip"?: string | { | ||
version: string; | ||
path: string; | ||
}; | ||
"dnn"?: string | { | ||
version: string; | ||
path: string; | ||
}; | ||
"core"?: string | { | ||
version: string; | ||
path: string; | ||
}; | ||
"license"?: string | { | ||
version: string; | ||
path: string; | ||
}; | ||
"cvr"?: string | { | ||
version: string; | ||
path: string; | ||
}; | ||
"utility"?: string | { | ||
version: string; | ||
path: string; | ||
}; | ||
"dbr"?: string | { | ||
version: string; | ||
path: string; | ||
}; | ||
"dlr"?: string | { | ||
version: string; | ||
path: string; | ||
}; | ||
"ddn"?: string | { | ||
version: string; | ||
path: string; | ||
}; | ||
"dcp"?: string | { | ||
version: string; | ||
path: string; | ||
}; | ||
"dce"?: string | { | ||
version: string; | ||
path: string; | ||
}; | ||
"dlrData"?: string | { | ||
version: string; | ||
path: string; | ||
}; | ||
[moduleName: string]: string | { | ||
version: string; | ||
path: string; | ||
} | undefined; | ||
} | ||
interface AutoDiscoveryPaths { | ||
"std"?: { | ||
version: string; | ||
path: string; | ||
}; | ||
"dip"?: { | ||
version: string; | ||
path: string; | ||
}; | ||
"dnn"?: { | ||
version: string; | ||
path: string; | ||
}; | ||
"core"?: { | ||
version: string; | ||
path: string; | ||
}; | ||
"license"?: { | ||
version: string; | ||
path: string; | ||
}; | ||
"cvr"?: { | ||
version: string; | ||
path: string; | ||
}; | ||
"utility"?: { | ||
version: string; | ||
path: string; | ||
}; | ||
"dbr"?: { | ||
version: string; | ||
path: string; | ||
}; | ||
"dlr"?: { | ||
version: string; | ||
path: string; | ||
}; | ||
"ddn"?: { | ||
version: string; | ||
path: string; | ||
}; | ||
"dcp"?: { | ||
version: string; | ||
path: string; | ||
}; | ||
"dce"?: { | ||
version: string; | ||
path: string; | ||
}; | ||
"dlrData"?: { | ||
version: string; | ||
path: string; | ||
}; | ||
} | ||
interface ProxyEngineResourcePaths { | ||
"rootDirectory"?: string; | ||
"std"?: string; | ||
"dip"?: string; | ||
"dnn"?: string; | ||
"core"?: string; | ||
"license"?: string; | ||
"cvr"?: string; | ||
"utility"?: string; | ||
"dbr"?: string; | ||
"dlr"?: string; | ||
"ddn"?: string; | ||
"dcp"?: string; | ||
"dce"?: string; | ||
"dlrData"?: string; | ||
[moduleName: string]: string | undefined; | ||
} | ||
interface InnerVersions { | ||
[key: string]: { | ||
worker?: string; | ||
wasm?: string; | ||
}; | ||
} | ||
interface WasmVersions { | ||
"DIP"?: string; | ||
"DNN"?: string; | ||
"CORE"?: string; | ||
"LICENSE"?: string; | ||
"CVR"?: string; | ||
"UTILITY"?: string; | ||
"DBR"?: string; | ||
"DLR"?: string; | ||
"DDN"?: string; | ||
"DCP"?: string; | ||
} | ||
interface MapController { | ||
[key: string]: ((body: any, taskID: number, instanceID?: number) => void); | ||
} | ||
type mimetype = "image/png" | "image/jpeg"; | ||
declare const mapAsyncDependency: { | ||
[key: string]: any; | ||
}; | ||
declare const waitAsyncDependency: (depName: string | string[]) => Promise<void>; | ||
declare const doOrWaitAsyncDependency: (depName: string | string[], asyncFunc: () => Promise<void>) => Promise<void>; | ||
declare let worker: Worker; | ||
declare const getNextTaskID: () => number; | ||
declare const mapTaskCallBack: { | ||
[key: string]: Function; | ||
}; | ||
declare let onLog: (message: string) => void | undefined; | ||
declare const setOnLog: (value: typeof onLog) => void; | ||
declare let bDebug: boolean; | ||
declare const setBDebug: (value: boolean) => void; | ||
declare const innerVersions: InnerVersions; | ||
declare const mapPackageRegister: { | ||
[key: string]: any; | ||
}; | ||
declare const autoDiscoveryPaths: AutoDiscoveryPaths; | ||
declare const workerAutoResources: WorkerAutoResources; | ||
declare const loadWasm: (names?: string[] | string) => Promise<void>; | ||
declare class CoreModule { | ||
static get engineResourcePaths(): EngineResourcePaths; | ||
static set engineResourcePaths(value: EngineResourcePaths); | ||
private static _bSupportDce4Module; | ||
static get bSupportDce4Module(): number; | ||
private static _bSupportIRTModule; | ||
static get bSupportIRTModule(): number; | ||
private static _versions; | ||
static get versions(): any; | ||
static get _onLog(): (message: string) => void; | ||
static set _onLog(value: (message: string) => void); | ||
static get _bDebug(): boolean; | ||
static set _bDebug(value: boolean); | ||
static _workerName: string; | ||
/** | ||
* Determine if the decoding module has been loaded successfully. | ||
* @category Initialize and Destroy | ||
*/ | ||
static isModuleLoaded(name?: string): boolean; | ||
static loadWasm(names: string[] | string): Promise<void>; | ||
/** | ||
* Detect environment and get a report. | ||
*/ | ||
static detectEnvironment(): Promise<any>; | ||
/** | ||
* modify from https://gist.github.com/2107/5529665 | ||
* @ignore | ||
*/ | ||
static browserInfo: any; | ||
static getModuleVersion(): Promise<WasmVersions>; | ||
static getVersion(): string; | ||
static enableLogging(): void; | ||
static disableLogging(): void; | ||
static cfd(count: number): Promise<void>; | ||
} | ||
/** | ||
@@ -1048,2 +956,3 @@ * Judge if the input is an object(exclude array and function). If `null` or `undefined`, return `false`. | ||
declare const isContour: (value: any) => value is Contour; | ||
declare const isOriginalDsImageData: (value: any) => boolean; | ||
/** | ||
@@ -1106,6 +1015,6 @@ * Judge is the input is a {@link DSImageData} object. | ||
declare function requestResource(url: string, type: "text" | "blob" | "arraybuffer"): Promise<any>; | ||
declare function checkIsLink(str: string): boolean; | ||
declare const requestResource: (url: string, type: "text" | "blob" | "arraybuffer") => Promise<any>; | ||
declare const checkIsLink: (str: string) => boolean; | ||
declare const compareVersion: (strV1: string, strV2: string) => number; | ||
declare const handleEngineResourcePaths: (engineResourcePaths: EngineResourcePaths, autoDiscoveryPaths: AutoDiscoveryPaths) => EngineResourcePaths; | ||
declare const handleEngineResourcePaths: (engineResourcePaths: EngineResourcePaths) => EngineResourcePaths; | ||
declare const _saveToFile: (imageData: ImageData, name: string, download?: boolean) => Promise<File>; | ||
@@ -1117,2 +1026,2 @@ declare const _toCanvas: (imageData: ImageData | DSImageData) => HTMLCanvasElement; | ||
export { Arc, AutoDiscoveryPaths, BinaryImageUnit, CapturedResultItem, ColourImageUnit, Contour, ContoursUnit, CoreModule, Corner, DSFile, DSImageData, DSRect, Edge, EngineResourcePaths, EnhancedGrayscaleImageUnit, EnumBufferOverflowProtectionMode, EnumCapturedResultItemType, EnumColourChannelUsageType, EnumCornerType, EnumErrorCode, EnumGrayscaleEnhancementMode, EnumGrayscaleTransformationMode, EnumImagePixelFormat, EnumImageTagType, EnumIntermediateResultUnitType, EnumPDFReadingMode, EnumRasterDataSource, EnumRegionObjectElementType, EnumSectionType, FileImageTag, GrayscaleImageUnit, ImageSourceAdapter, ImageSourceErrorListener, ImageTag, InnerVersions, IntermediateResult, IntermediateResultExtraInfo, IntermediateResultUnit, LineSegment, LineSegmentsUnit, MapController, ObservationParameters, OriginalImageResultItem, PDFReadingParameter, Point, Polygon, PostMessageBody, PredetectedRegionElement, PredetectedRegionsUnit, ProxyEngineResourcePaths, Quadrilateral, Rect, RegionObjectElement, ScaledDownColourImageUnit, ShortLinesUnit, TextRemovedBinaryImageUnit, TextZonesUnit, TextureDetectionResultUnit, TextureRemovedBinaryImageUnit, TextureRemovedGrayscaleImageUnit, TransformedGrayscaleImageUnit, Warning, WasmVersions, WorkerAutoResources, _getNorImageData, isArc as _isArc, isContour as _isContour, isDSImageData as _isDSImageData, isDSRect as _isDSRect, isImageTag as _isImageTag, isLineSegment as _isLineSegment, isPoint as _isPoint, isPolygon as _isPolygon, isQuad as _isQuad, isRect as _isRect, _saveToFile, _toBlob, _toCanvas, _toImage, autoDiscoveryPaths, bDebug, checkIsLink, compareVersion, doOrWaitAsyncDependency, getNextTaskID, handleEngineResourcePaths, innerVersions, isArc, isContour, isDSImageData, isDSRect, isImageTag, isLineSegment, isObject, isPoint, isPolygon, isQuad, isRect, loadWasm, mapAsyncDependency, mapPackageRegister, mapTaskCallBack, mimetype, onLog, requestResource, setBDebug, setOnLog, waitAsyncDependency, worker, workerAutoResources }; | ||
export { Arc, BinaryImageUnit, CapturedResultItem, ColourImageUnit, Contour, ContoursUnit, CoreModule, Corner, DSFile, DSImageData, DSRect, DwtInfo, Edge, EngineResourcePaths, EnhancedGrayscaleImageUnit, EnumBufferOverflowProtectionMode, EnumCapturedResultItemType, EnumColourChannelUsageType, EnumCornerType, EnumCrossVerificationStatus, EnumErrorCode, EnumGrayscaleEnhancementMode, EnumGrayscaleTransformationMode, EnumImagePixelFormat, EnumImageTagType, EnumIntermediateResultUnitType, EnumPDFReadingMode, EnumRasterDataSource, EnumRegionObjectElementType, EnumSectionType, FileImageTag, GrayscaleImageUnit, ImageSourceAdapter, ImageSourceErrorListener, ImageTag, InnerVersions, IntermediateResult, IntermediateResultExtraInfo, IntermediateResultUnit, LineSegment, LineSegmentsUnit, MapController, ObservationParameters, OriginalImageResultItem, PDFReadingParameter, PathInfo, Point, Polygon, PostMessageBody, PredetectedRegionElement, PredetectedRegionsUnit, Quadrilateral, Rect, RegionObjectElement, ScaledDownColourImageUnit, ShortLinesUnit, TextRemovedBinaryImageUnit, TextZonesUnit, TextureDetectionResultUnit, TextureRemovedBinaryImageUnit, TextureRemovedGrayscaleImageUnit, TransformedGrayscaleImageUnit, Warning, WasmVersions, WorkerAutoResources, _getNorImageData, _saveToFile, _toBlob, _toCanvas, _toImage, bDebug, checkIsLink, compareVersion, doOrWaitAsyncDependency, getNextTaskID, handleEngineResourcePaths, innerVersions, isArc, isContour, isDSImageData, isDSRect, isImageTag, isLineSegment, isObject, isOriginalDsImageData, isPoint, isPolygon, isQuad, isRect, loadWasm, mapAsyncDependency, mapPackageRegister, mapTaskCallBack, mimetype, onLog, requestResource, setBDebug, setOnLog, waitAsyncDependency, worker, workerAutoResources }; |
@@ -7,6 +7,6 @@ /*! | ||
* @author Dynamsoft | ||
* @version 3.4.21 | ||
* @version 3.4.30 | ||
* @fileoverview Dynamsoft JavaScript Library for Core | ||
* More info on Dynamsoft Core JS: https://www.dynamsoft.com/capture-vision/docs/web/programming/javascript/api-reference/core/core-module.html | ||
*/ | ||
function _(_,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 E(_,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 e,t,I;"function"==typeof SuppressedError&&SuppressedError,function(_){_[_.BOPM_BLOCK=0]="BOPM_BLOCK",_[_.BOPM_UPDATE=1]="BOPM_UPDATE"}(e||(e={})),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"}(t||(t={})),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"}(I||(I={}));const r="undefined"==typeof self,s=(()=>{if(!r&&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"./"})(),n=_=>{if(null==_&&(_="./"),r);else{let E=document.createElement("a");E.href=_,_=E.href}return _.endsWith("/")||(_+="/"),_},C=_=>Object.prototype.toString.call(_),i=_=>Array.isArray?Array.isArray(_):"[object Array]"===C(_),o=_=>"[object Boolean]"===C(_),A=_=>"number"==typeof _&&!Number.isNaN(_),N=_=>null!==_&&"object"==typeof _&&!Array.isArray(_),a=_=>!!N(_)&&(!!A(_.x)&&(!!A(_.y)&&(!!A(_.radius)&&(!(_.radius<0)&&(!!A(_.startAngle)&&!!A(_.endAngle)))))),T=_=>!!N(_)&&(!!i(_.points)&&(0!=_.points.length&&!_.points.some((_=>!c(_))))),R=_=>!!N(_)&&(_.bytes instanceof Uint8Array&&(!!A(_.width)&&(!(_.width<=0)&&(!!A(_.height)&&(!(_.height<=0)&&(!!A(_.stride)&&(!(_.stride<=0)&&("format"in _&&!("tag"in _&&!D(_.tag)))))))))),L=_=>!!N(_)&&(!!A(_.left)&&(!(_.left<0)&&(!!A(_.top)&&(!(_.top<0)&&(!!A(_.right)&&(!(_.right<0)&&(!!A(_.bottom)&&(!(_.bottom<0)&&(!(_.left>=_.right)&&(!(_.top>=_.bottom)&&!!o(_.isMeasuredInPercentage))))))))))),D=_=>!!N(_)&&(!!A(_.imageId)&&"type"in _),O=_=>!!N(_)&&(!!c(_.startPoint)&&(!!c(_.endPoint)&&(_.startPoint.x!=_.endPoint.x||_.startPoint.y!=_.endPoint.y))),c=_=>!!N(_)&&(!!A(_.x)&&!!A(_.y)),S=_=>!!N(_)&&(!!i(_.points)&&(0!=_.points.length&&!_.points.some((_=>!c(_))))),l=_=>!!N(_)&&(!!i(_.points)&&(0!=_.points.length&&4==_.points.length&&!_.points.some((_=>!c(_))))),f=_=>!!N(_)&&(!!A(_.x)&&(!!A(_.y)&&(!!A(_.width)&&(!(_.width<0)&&(!!A(_.height)&&(!(_.height<0)&&!("isMeasuredInPercentage"in _&&!o(_.isMeasuredInPercentage))))))));async function h(_,E){return 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(_+" "+I.status):e(I.response)},I.onerror=()=>{t(new Error("Network Error: "+I.statusText))}}))}function d(_){return/^(https:\/\/www\.|http:\/\/www\.|https:\/\/|http:\/\/)|^[a-zA-Z0-9]{2,}(\.[a-zA-Z0-9]{2,})(\.[a-zA-Z0-9]{2,})?/.test(_)}const P=(_,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},g=(_,E)=>{const e={};for(let t in E){const I=t;let r=_[I];r&&"string"!=typeof r&&r.path&&(r=r.path),_.rootDirectory&&!_.rootDirectory.endsWith("/")&&(_.rootDirectory=_.rootDirectory+"/"),void 0===r?_.rootDirectory?r=`${_.rootDirectory}${M[I]}@${E[I].version}/dist/`:(r=E[I].path,r||(r=E[I])):r.startsWith("@engineRootDirectory/")&&(r=r.replace("@engineRootDirectory/",_.rootDirectory)),e[I]=n(r)}return e},M={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"},u=async(_,E,e)=>await new Promise((async(t,I)=>{try{const I=E.split(".");let r=I[I.length-1];const s=await U(`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()}})),F=_=>{R(_)&&(_=B(_));const E=document.createElement("canvas");E.width=_.width,E.height=_.height;return E.getContext("2d",{willReadFrequently:!0}).putImageData(_,0,0),E},G=(_,E)=>{R(E)&&(E=B(E));const e=F(E);let t=new Image,I=e.toDataURL(_);return t.src=I,t},U=async(_,E)=>{R(E)&&(E=B(E));const e=F(E);return new Promise(((E,t)=>{e.toBlob((_=>E(_)),_)}))},B=_=>{let E,e=_.bytes;if(!(e&&e instanceof Uint8Array))throw Error("Parameter type error");if(Number(_.format)===I.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)===I.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)===I.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)===I.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)===I.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)===I.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]}return new ImageData(E,_.width,_.height)};var p,m,y,w,V,b,v,Y;class H{get _isFetchingStarted(){return _(this,V,"f")}constructor(){p.add(this),m.set(this,[]),y.set(this,1),w.set(this,e.BOPM_BLOCK),V.set(this,!1),b.set(this,void 0),v.set(this,t.CCUT_AUTO)}setErrorListener(_){}addImageToBuffer(E){var t;if(!R(E))throw new TypeError("Invalid 'image'.");if((null===(t=E.tag)||void 0===t?void 0:t.hasOwnProperty("imageId"))&&"number"==typeof E.tag.imageId&&this.hasImage(E.tag.imageId))throw new Error("Existed imageId.");if(_(this,m,"f").length>=_(this,y,"f"))switch(_(this,w,"f")){case e.BOPM_BLOCK:break;case e.BOPM_UPDATE:if(_(this,m,"f").push(E),N(_(this,b,"f"))&&A(_(this,b,"f").imageId)&&1==_(this,b,"f").keepInBuffer)for(;_(this,m,"f").length>_(this,y,"f");){const E=_(this,m,"f").findIndex((E=>{var e;return(null===(e=E.tag)||void 0===e?void 0:e.imageId)!==_(this,b,"f").imageId}));_(this,m,"f").splice(E,1)}else _(this,m,"f").splice(0,_(this,m,"f").length-_(this,y,"f"))}else _(this,m,"f").push(E)}getImage(){if(0===_(this,m,"f").length)return null;let E;if(_(this,b,"f")&&A(_(this,b,"f").imageId)){const e=_(this,p,"m",Y).call(this,_(this,b,"f").imageId);if(e<0)throw new Error(`Image with id ${_(this,b,"f").imageId} doesn't exist.`);E=_(this,m,"f").slice(e,e+1)[0]}else E=_(this,m,"f").pop();if([I.IPF_RGB_565,I.IPF_RGB_555,I.IPF_RGB_888,I.IPF_ARGB_8888,I.IPF_RGB_161616,I.IPF_ARGB_16161616,I.IPF_ABGR_8888,I.IPF_ABGR_16161616,I.IPF_BGR_888].includes(E.format)){if(_(this,v,"f")===t.CCUT_RGB_R_CHANNEL_ONLY){H._onLog&&H._onLog("only get R channel data.");const _=new Uint8Array(E.width*E.height);for(let e=0;e<_.length;e++)switch(E.format){case I.IPF_RGB_565:case I.IPF_RGB_555:case I.IPF_RGB_888:case I.IPF_RGB_161616:_[e]=E.bytes[3*e+2];break;case I.IPF_ARGB_8888:case I.IPF_ARGB_16161616:_[e]=E.bytes[4*e+2];break;case I.IPF_BGR_888:_[e]=E.bytes[3*e];break;case I.IPF_ABGR_8888:case I.IPF_ABGR_16161616:_[e]=E.bytes[4*e]}E.bytes=_,E.stride=E.width,E.format=I.IPF_GRAYSCALED}else if(_(this,v,"f")===t.CCUT_RGB_G_CHANNEL_ONLY){H._onLog&&H._onLog("only get G channel data.");const _=new Uint8Array(E.width*E.height);for(let e=0;e<_.length;e++)switch(E.format){case I.IPF_RGB_565:case I.IPF_RGB_555:case I.IPF_RGB_888:case I.IPF_RGB_161616:case I.IPF_BGR_888:_[e]=E.bytes[3*e+1];break;case I.IPF_ARGB_8888:case I.IPF_ARGB_16161616:case I.IPF_ABGR_8888:case I.IPF_ABGR_16161616:_[e]=E.bytes[4*e+1]}E.bytes=_,E.stride=E.width,E.format=I.IPF_GRAYSCALED}else if(_(this,v,"f")===t.CCUT_RGB_B_CHANNEL_ONLY){H._onLog&&H._onLog("only get B channel data.");const _=new Uint8Array(E.width*E.height);for(let e=0;e<_.length;e++)switch(E.format){case I.IPF_RGB_565:case I.IPF_RGB_555:case I.IPF_RGB_888:case I.IPF_RGB_161616:_[e]=E.bytes[3*e];break;case I.IPF_ARGB_8888:case I.IPF_ARGB_16161616:_[e]=E.bytes[4*e];break;case I.IPF_BGR_888:_[e]=E.bytes[3*e+2];break;case I.IPF_ABGR_8888:case I.IPF_ABGR_16161616:_[e]=E.bytes[4*e+2]}E.bytes=_,E.stride=E.width,E.format=I.IPF_GRAYSCALED}}else[I.IPF_NV21,I.IPF_NV12].includes(E.format)&&H._onLog&&H._onLog("NV21 or NV12 is not supported.");return E}setNextImageToReturn(_,e){if(!((..._)=>0!==_.length&&_.every((_=>A(_))))(_))throw new TypeError("Invalid 'imageId'.");if(void 0!==e&&!o(e))throw new TypeError("Invalid 'keepInBuffer'.");E(this,b,{imageId:_,keepInBuffer:e},"f")}_resetNextReturnedImage(){E(this,b,null,"f")}hasImage(E){return _(this,p,"m",Y).call(this,E)>=0}startFetching(){E(this,V,!0,"f")}stopFetching(){E(this,V,!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(E(this,y,e,"f");_(this,m,"f")&&_(this,m,"f").length>e;)_(this,m,"f").shift()}getMaxImageCount(){return _(this,y,"f")}getImageCount(){return _(this,m,"f").length}clearBuffer(){_(this,m,"f").length=0}isBufferEmpty(){return 0===_(this,m,"f").length}setBufferOverflowProtectionMode(_){E(this,w,_,"f")}getBufferOverflowProtectionMode(){return _(this,w,"f")}setColourChannelUsageType(_){E(this,v,_,"f")}getColourChannelUsageType(){return _(this,v,"f")}}m=new WeakMap,y=new WeakMap,w=new WeakMap,V=new WeakMap,b=new WeakMap,v=new WeakMap,p=new WeakSet,Y=function(E){if("number"!=typeof E)throw new TypeError("Invalid 'imageId'.");return _(this,m,"f").findIndex((_=>{var e;return(null===(e=_.tag)||void 0===e?void 0:e.imageId)===E}))};const k=_=>_&&"object"==typeof _&&"function"==typeof _.then;class X 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(_){let E;this._task=_,k(_)?E=_:"function"==typeof _&&(E=new Promise(_)),E&&(async()=>{try{const e=await E;_===this._task&&this.resolve(e)}catch(E){_===this._task&&this.reject(E)}})()}get isEmpty(){return null==this._task}constructor(_){let E,e;super(((_,t)=>{E=_,e=t})),this._s="pending",this.resolve=_=>{this.isPending&&(k(_)?this.task=_:(this._s="fulfilled",E(_)))},this.reject=_=>{this.isPending&&(this._s="rejected",e(_))},this.task=_}}let Z,W,x,K,j;"undefined"!=typeof navigator&&(Z=navigator,W=Z.userAgent,x=Z.platform,K=Z.mediaDevices),function(){if(!r){const _={Edge:{search:"Edg",verSearch:"Edg"},OPR:null,Chrome:null,Safari:{str:Z.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:x,search:"Win"},Mac:{str:x},Linux:{str:x}};let e="unknownBrowser",t=0,I="unknownOS";for(let E in _){const I=_[E]||{};let r=I.str||W,s=I.search||E,n=I.verStr||W,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||W,r=e.search||_;if(-1!=t.indexOf(r)){I=_;break}}"Linux"==I&&-1!=W.indexOf("Windows NT")&&(I="HarmonyOS"),j={browser:e,version:t,OS:I}}r&&(j={browser:"ssr",version:0,OS:"ssr"})}();const J="undefined"!=typeof WebAssembly&&W&&!(/Safari/.test(W)&&!/Chrome/.test(W)&&/\(.+\s11_2_([2-6]).*\)/.test(W)),Q=!("undefined"==typeof Worker),$=!(!K||!K.getUserMedia),z=async()=>{let _=!1;if($)try{(await K.getUserMedia({video:!0})).getTracks().forEach((_=>{_.stop()})),_=!0}catch(_){}return _};"Chrome"===j.browser&&j.version>66||"Safari"===j.browser&&j.version>13||"OPR"===j.browser&&j.version>43||"Edge"===j.browser&&j.version;const q={},__=async _=>{let E="string"==typeof _?[_]:_,e=[];for(let _ of E)e.push(q[_]=q[_]||new X);await Promise.all(e)},E_=async(_,E)=>{let e,t="string"==typeof _?[_]:_,I=[];for(let _ of t){let t;I.push(t=q[_]=q[_]||new X(e=e||E())),t.isEmpty&&(t.task=e=e||E())}await Promise.all(I)};let e_,t_=0;const I_=()=>t_++,r_={};let s_;const n_=_=>{s_=_,e_&&e_.postMessage({type:"setBLog",body:{value:!!_}})};let C_=!1;const i_=_=>{C_=_,e_&&e_.postMessage({type:"setBDebug",body:{value:!!_}})},o_={},A_={},N_={std:{version:"1.4.10",path:n(s+"../../dynamsoft-capture-vision-std@1.4.10/dist/")},core:{version:"3.4.21",path:s}},a_={dip:{wasm:!0}},T_={},R_=async _=>{let E;_ instanceof Array||(_=_?[_]:[]);let e=q.core;E=!e||e.isEmpty;let t=new Map;const I=_=>{if("std"==(_=_.toLowerCase())||"core"==_)return;if(!a_[_])throw Error("The '"+_+"' module cannot be found.");let E=a_[_].deps;if(null==E?void 0:E.length)for(let _ of E)I(_);let e=q[_];t.has(_)||t.set(_,!e||e.isEmpty)};for(let E of _)I(E);let r=[];E&&r.push("core"),r.push(...t.keys());const s=[...t.entries()].filter((_=>!_[1])).map((_=>_[0]));await E_(r,(async()=>{const _=[...t.entries()].filter((_=>_[1])).map((_=>_[0]));await __(s);const e=g(T_,N_),I={};for(let E of _)I[E]=a_[E];const r={engineResourcePaths:e,autoResources:I,names:_};let n=new X;if(E){r.needLoadCore=!0;let _=e.core+L_._workerName;_.startsWith(location.origin)||(_=await fetch(_).then((_=>_.blob())).then((_=>URL.createObjectURL(_)))),e_=new Worker(_),e_.onerror=_=>{let E=new Error(_.message);n.reject(E)},e_.addEventListener("message",(_=>{let E=_.data?_.data:_,e=E.type,t=E.id,I=E.body;switch(e){case"log":s_&&s_(E.message);break;case"task":try{r_[t](I),delete r_[t]}catch(_){throw delete r_[t],_}break;case"event":try{r_[t](I)}catch(_){throw _}break;default:console.log(_)}})),r.bLog=!!s_,r.bd=C_,r.dm=location.origin.startsWith("http")?location.origin:"https://localhost"}else await __("core");let C=t_++;r_[C]=_=>{if(_.success)Object.assign(o_,_.versions),"{}"!==JSON.stringify(_.versions)&&(L_._versions=_.versions),n.resolve(void 0);else{const E=Error(_.message);_.stack&&(E.stack=_.stack),n.reject(E)}},e_.postMessage({type:"loadWasm",body:r,id:C}),await n}))};class L_{static get engineResourcePaths(){return T_}static set engineResourcePaths(_){Object.assign(T_,_)}static get bSupportDce4Module(){return this._bSupportDce4Module}static get bSupportIRTModule(){return this._bSupportIRTModule}static get versions(){return this._versions}static get _onLog(){return s_}static set _onLog(_){n_(_)}static get _bDebug(){return C_}static set _bDebug(_){i_(_)}static isModuleLoaded(_){return _=(_=_||"core").toLowerCase(),!!q[_]&&q[_].isFulfilled}static async loadWasm(_){return await R_(_)}static async detectEnvironment(){return await(async()=>({wasm:J,worker:Q,getUserMedia:$,camera:await z(),browser:j.browser,version:j.version,OS:j.OS}))()}static async getModuleVersion(){return await new Promise(((_,E)=>{let e=I_();r_[e]=async e=>{if(e.success)return _(e.versions);{let _=new Error(e.message);return _.stack=e.stack+"\n"+_.stack,E(_)}},e_.postMessage({type:"getModuleVersion",id:e})}))}static getVersion(){const _=o_.core&&o_.core.worker,E=o_.core&&o_.core.wasm;return`3.4.21(Worker: ${_||"Not Loaded"}, Wasm: ${E||"Not Loaded"})`}static enableLogging(){H._onLog=console.log,L_._onLog=console.log}static disableLogging(){H._onLog=null,L_._onLog=null}static async cfd(_){return await new Promise(((E,e)=>{let t=I_();r_[t]=async _=>{if(_.success)return E();{let E=new Error(_.message);return E.stack=_.stack+"\n"+E.stack,e(E)}},e_.postMessage({type:"cfd",id:t,body:{count:_}})}))}}var D_,O_,c_,S_,l_,f_,h_,d_;L_._bSupportDce4Module=-1,L_._bSupportIRTModule=-1,L_._versions=null,L_._workerName="core.worker.js",L_.browserInfo=j,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"}(D_||(D_={})),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"}(O_||(O_={})),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"}(c_||(c_={})),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"}(S_||(S_={})),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"}(l_||(l_={})),function(_){_[_.ITT_FILE_IMAGE=0]="ITT_FILE_IMAGE",_[_.ITT_VIDEO_FRAME=1]="ITT_VIDEO_FRAME"}(f_||(f_={})),function(_){_[_.PDFRM_VECTOR=1]="PDFRM_VECTOR",_[_.PDFRM_RASTER=2]="PDFRM_RASTER",_[_.PDFRM_REV=-2147483648]="PDFRM_REV"}(h_||(h_={})),function(_){_[_.RDS_RASTERIZED_PAGES=0]="RDS_RASTERIZED_PAGES",_[_.RDS_EXTRACTED_IMAGES=1]="RDS_EXTRACTED_IMAGES"}(d_||(d_={}));const P_={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_ALL:BigInt("0xFFFFFFFFFFFFFFFF")};var g_,M_;!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"}(g_||(g_={})),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"}(M_||(M_={}));export{L_ as CoreModule,e as EnumBufferOverflowProtectionMode,D_ as EnumCapturedResultItemType,t as EnumColourChannelUsageType,O_ as EnumCornerType,c_ as EnumErrorCode,S_ as EnumGrayscaleEnhancementMode,l_ as EnumGrayscaleTransformationMode,I as EnumImagePixelFormat,f_ as EnumImageTagType,P_ as EnumIntermediateResultUnitType,h_ as EnumPDFReadingMode,d_ as EnumRasterDataSource,g_ as EnumRegionObjectElementType,M_ as EnumSectionType,H as ImageSourceAdapter,B as _getNorImageData,a as _isArc,T as _isContour,R as _isDSImageData,L as _isDSRect,D as _isImageTag,O as _isLineSegment,c as _isPoint,S as _isPolygon,l as _isQuad,f as _isRect,u as _saveToFile,U as _toBlob,F as _toCanvas,G as _toImage,N_ as autoDiscoveryPaths,C_ as bDebug,d as checkIsLink,P as compareVersion,E_ as doOrWaitAsyncDependency,I_ as getNextTaskID,g as handleEngineResourcePaths,o_ as innerVersions,a as isArc,T as isContour,R as isDSImageData,L as isDSRect,D as isImageTag,O as isLineSegment,N as isObject,c as isPoint,S as isPolygon,l as isQuad,f as isRect,R_ as loadWasm,q as mapAsyncDependency,A_ as mapPackageRegister,r_ as mapTaskCallBack,s_ as onLog,h as requestResource,i_ as setBDebug,n_ as setOnLog,__ as waitAsyncDependency,e_ as worker,a_ 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&&"object"==typeof I&&I.path?I.path:I,s=_.rootDirectory;if(s&&!s.endsWith("/")&&(s+="/"),"object"==typeof I&&I.isInternal)s&&(r=_[t].version?`${s}${e[t]}@${_[t].version}/dist/${"ddv"===t?"engine":""}`:`${s}${e[t]}/dist/${"ddv"===t?"engine":""}`);else{const e=/^@engineRootDirectory(\/?)/;if("string"==typeof r&&(r=r.replace(e,s||"")),"object"==typeof r&&"dwt"===t){const I=_[t].resourcesPath,r=_[t].serviceInstallerLocation;E[t]={resourcesPath:I.replace(e,s||""),serviceInstallerLocation:r.replace(e,s||"")};continue}}E[t]=A(r)}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-202412032155",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-202412032155(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}; |
@@ -7,6 +7,6 @@ /*! | ||
* @author Dynamsoft | ||
* @version 3.4.21 | ||
* @version 3.4.30 | ||
* @fileoverview Dynamsoft JavaScript Library for Core | ||
* More info on Dynamsoft Core JS: https://www.dynamsoft.com/capture-vision/docs/web/programming/javascript/api-reference/core/core-module.html | ||
*/ | ||
!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";function E(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 _(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 t,I,r;"function"==typeof SuppressedError&&SuppressedError,e.EnumBufferOverflowProtectionMode=void 0,(t=e.EnumBufferOverflowProtectionMode||(e.EnumBufferOverflowProtectionMode={}))[t.BOPM_BLOCK=0]="BOPM_BLOCK",t[t.BOPM_UPDATE=1]="BOPM_UPDATE",e.EnumColourChannelUsageType=void 0,(I=e.EnumColourChannelUsageType||(e.EnumColourChannelUsageType={}))[I.CCUT_AUTO=0]="CCUT_AUTO",I[I.CCUT_FULL_CHANNEL=1]="CCUT_FULL_CHANNEL",I[I.CCUT_Y_CHANNEL_ONLY=2]="CCUT_Y_CHANNEL_ONLY",I[I.CCUT_RGB_R_CHANNEL_ONLY=3]="CCUT_RGB_R_CHANNEL_ONLY",I[I.CCUT_RGB_G_CHANNEL_ONLY=4]="CCUT_RGB_G_CHANNEL_ONLY",I[I.CCUT_RGB_B_CHANNEL_ONLY=5]="CCUT_RGB_B_CHANNEL_ONLY",e.EnumImagePixelFormat=void 0,(r=e.EnumImagePixelFormat||(e.EnumImagePixelFormat={}))[r.IPF_BINARY=0]="IPF_BINARY",r[r.IPF_BINARYINVERTED=1]="IPF_BINARYINVERTED",r[r.IPF_GRAYSCALED=2]="IPF_GRAYSCALED",r[r.IPF_NV21=3]="IPF_NV21",r[r.IPF_RGB_565=4]="IPF_RGB_565",r[r.IPF_RGB_555=5]="IPF_RGB_555",r[r.IPF_RGB_888=6]="IPF_RGB_888",r[r.IPF_ARGB_8888=7]="IPF_ARGB_8888",r[r.IPF_RGB_161616=8]="IPF_RGB_161616",r[r.IPF_ARGB_16161616=9]="IPF_ARGB_16161616",r[r.IPF_ABGR_8888=10]="IPF_ABGR_8888",r[r.IPF_ABGR_16161616=11]="IPF_ABGR_16161616",r[r.IPF_BGR_888=12]="IPF_BGR_888",r[r.IPF_BINARY_8=13]="IPF_BINARY_8",r[r.IPF_NV12=14]="IPF_NV12",r[r.IPF_BINARY_8_INVERTED=15]="IPF_BINARY_8_INVERTED";const n="undefined"==typeof self,o=(()=>{if(!n&&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"./"})(),a=e=>{if(null==e&&(e="./"),n);else{let E=document.createElement("a");E.href=e,e=E.href}return e.endsWith("/")||(e+="/"),e},s=e=>Object.prototype.toString.call(e),i=e=>Array.isArray?Array.isArray(e):"[object Array]"===s(e),C=e=>"[object Boolean]"===s(e),A=e=>"number"==typeof e&&!Number.isNaN(e),T=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),N=e=>!!T(e)&&(!!A(e.x)&&(!!A(e.y)&&(!!A(e.radius)&&(!(e.radius<0)&&(!!A(e.startAngle)&&!!A(e.endAngle)))))),R=e=>!!T(e)&&(!!i(e.points)&&(0!=e.points.length&&!e.points.some((e=>!m(e))))),L=e=>!!T(e)&&(e.bytes instanceof Uint8Array&&(!!A(e.width)&&(!(e.width<=0)&&(!!A(e.height)&&(!(e.height<=0)&&(!!A(e.stride)&&(!(e.stride<=0)&&("format"in e&&!("tag"in e&&!O(e.tag)))))))))),D=e=>!!T(e)&&(!!A(e.left)&&(!(e.left<0)&&(!!A(e.top)&&(!(e.top<0)&&(!!A(e.right)&&(!(e.right<0)&&(!!A(e.bottom)&&(!(e.bottom<0)&&(!(e.left>=e.right)&&(!(e.top>=e.bottom)&&!!C(e.isMeasuredInPercentage))))))))))),O=e=>!!T(e)&&(!!A(e.imageId)&&"type"in e),l=e=>!!T(e)&&(!!m(e.startPoint)&&(!!m(e.endPoint)&&(e.startPoint.x!=e.endPoint.x||e.startPoint.y!=e.endPoint.y))),m=e=>!!T(e)&&(!!A(e.x)&&!!A(e.y)),c=e=>!!T(e)&&(!!i(e.points)&&(0!=e.points.length&&!e.points.some((e=>!m(e))))),u=e=>!!T(e)&&(!!i(e.points)&&(0!=e.points.length&&4==e.points.length&&!e.points.some((e=>!m(e))))),g=e=>!!T(e)&&(!!A(e.x)&&(!!A(e.y)&&(!!A(e.width)&&(!(e.width<0)&&(!!A(e.height)&&(!(e.height<0)&&!("isMeasuredInPercentage"in e&&!C(e.isMeasuredInPercentage))))))));const S=(e,E)=>{const _={};for(let t in E){const I=t;let r=e[I];r&&"string"!=typeof r&&r.path&&(r=r.path),e.rootDirectory&&!e.rootDirectory.endsWith("/")&&(e.rootDirectory=e.rootDirectory+"/"),void 0===r?e.rootDirectory?r=`${e.rootDirectory}${P[I]}@${E[I].version}/dist/`:(r=E[I].path,r||(r=E[I])):r.startsWith("@engineRootDirectory/")&&(r=r.replace("@engineRootDirectory/",e.rootDirectory)),_[I]=a(r)}return _},P={std:"dynamsoft-capture-vision-std",dip:"dynamsoft-image-processing",core:"dynamsoft-core",dnn:"dynamsoft-capture-vision-dnn",license:"dynamsoft-license",utility:"dynamsoft-utility",cvr:"dynamsoft-capture-vision-router",dbr:"dynamsoft-barcode-reader",dlr:"dynamsoft-label-recognizer",ddn:"dynamsoft-document-normalizer",dcp:"dynamsoft-code-parser",dcpd:"dynamsoft-code-parser",dlrData:"dynamsoft-label-recognizer-data",dce:"dynamsoft-camera-enhancer"},d=e=>{L(e)&&(e=F(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},f=async(e,E)=>{L(E)&&(E=F(E));const _=d(E);return new Promise(((E,t)=>{_.toBlob((e=>E(e)),e)}))},F=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]}return new ImageData(_,E.width,E.height)};var h,M,G,U,p,y,B,w;class V{get _isFetchingStarted(){return E(this,p,"f")}constructor(){h.add(this),M.set(this,[]),G.set(this,1),U.set(this,e.EnumBufferOverflowProtectionMode.BOPM_BLOCK),p.set(this,!1),y.set(this,void 0),B.set(this,e.EnumColourChannelUsageType.CCUT_AUTO)}setErrorListener(e){}addImageToBuffer(_){var t;if(!L(_))throw new TypeError("Invalid 'image'.");if((null===(t=_.tag)||void 0===t?void 0:t.hasOwnProperty("imageId"))&&"number"==typeof _.tag.imageId&&this.hasImage(_.tag.imageId))throw new Error("Existed imageId.");if(E(this,M,"f").length>=E(this,G,"f"))switch(E(this,U,"f")){case e.EnumBufferOverflowProtectionMode.BOPM_BLOCK:break;case e.EnumBufferOverflowProtectionMode.BOPM_UPDATE:if(E(this,M,"f").push(_),T(E(this,y,"f"))&&A(E(this,y,"f").imageId)&&1==E(this,y,"f").keepInBuffer)for(;E(this,M,"f").length>E(this,G,"f");){const e=E(this,M,"f").findIndex((e=>{var _;return(null===(_=e.tag)||void 0===_?void 0:_.imageId)!==E(this,y,"f").imageId}));E(this,M,"f").splice(e,1)}else E(this,M,"f").splice(0,E(this,M,"f").length-E(this,G,"f"))}else E(this,M,"f").push(_)}getImage(){if(0===E(this,M,"f").length)return null;let _;if(E(this,y,"f")&&A(E(this,y,"f").imageId)){const e=E(this,h,"m",w).call(this,E(this,y,"f").imageId);if(e<0)throw new Error(`Image with id ${E(this,y,"f").imageId} doesn't exist.`);_=E(this,M,"f").slice(e,e+1)[0]}else _=E(this,M,"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(_.format)){if(E(this,B,"f")===e.EnumColourChannelUsageType.CCUT_RGB_R_CHANNEL_ONLY){V._onLog&&V._onLog("only get R channel data.");const E=new Uint8Array(_.width*_.height);for(let t=0;t<E.length;t++)switch(_.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:E[t]=_.bytes[3*t+2];break;case e.EnumImagePixelFormat.IPF_ARGB_8888:case e.EnumImagePixelFormat.IPF_ARGB_16161616:E[t]=_.bytes[4*t+2];break;case e.EnumImagePixelFormat.IPF_BGR_888:E[t]=_.bytes[3*t];break;case e.EnumImagePixelFormat.IPF_ABGR_8888:case e.EnumImagePixelFormat.IPF_ABGR_16161616:E[t]=_.bytes[4*t]}_.bytes=E,_.stride=_.width,_.format=e.EnumImagePixelFormat.IPF_GRAYSCALED}else if(E(this,B,"f")===e.EnumColourChannelUsageType.CCUT_RGB_G_CHANNEL_ONLY){V._onLog&&V._onLog("only get G channel data.");const E=new Uint8Array(_.width*_.height);for(let t=0;t<E.length;t++)switch(_.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:E[t]=_.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:E[t]=_.bytes[4*t+1]}_.bytes=E,_.stride=_.width,_.format=e.EnumImagePixelFormat.IPF_GRAYSCALED}else if(E(this,B,"f")===e.EnumColourChannelUsageType.CCUT_RGB_B_CHANNEL_ONLY){V._onLog&&V._onLog("only get B channel data.");const E=new Uint8Array(_.width*_.height);for(let t=0;t<E.length;t++)switch(_.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:E[t]=_.bytes[3*t];break;case e.EnumImagePixelFormat.IPF_ARGB_8888:case e.EnumImagePixelFormat.IPF_ARGB_16161616:E[t]=_.bytes[4*t];break;case e.EnumImagePixelFormat.IPF_BGR_888:E[t]=_.bytes[3*t+2];break;case e.EnumImagePixelFormat.IPF_ABGR_8888:case e.EnumImagePixelFormat.IPF_ABGR_16161616:E[t]=_.bytes[4*t+2]}_.bytes=E,_.stride=_.width,_.format=e.EnumImagePixelFormat.IPF_GRAYSCALED}}else[e.EnumImagePixelFormat.IPF_NV21,e.EnumImagePixelFormat.IPF_NV12].includes(_.format)&&V._onLog&&V._onLog("NV21 or NV12 is not supported.");return _}setNextImageToReturn(e,E){if(!((...e)=>0!==e.length&&e.every((e=>A(e))))(e))throw new TypeError("Invalid 'imageId'.");if(void 0!==E&&!C(E))throw new TypeError("Invalid 'keepInBuffer'.");_(this,y,{imageId:e,keepInBuffer:E},"f")}_resetNextReturnedImage(){_(this,y,null,"f")}hasImage(e){return E(this,h,"m",w).call(this,e)>=0}startFetching(){_(this,p,!0,"f")}stopFetching(){_(this,p,!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(_(this,G,e,"f");E(this,M,"f")&&E(this,M,"f").length>e;)E(this,M,"f").shift()}getMaxImageCount(){return E(this,G,"f")}getImageCount(){return E(this,M,"f").length}clearBuffer(){E(this,M,"f").length=0}isBufferEmpty(){return 0===E(this,M,"f").length}setBufferOverflowProtectionMode(e){_(this,U,e,"f")}getBufferOverflowProtectionMode(){return E(this,U,"f")}setColourChannelUsageType(e){_(this,B,e,"f")}getColourChannelUsageType(){return E(this,B,"f")}}M=new WeakMap,G=new WeakMap,U=new WeakMap,p=new WeakMap,y=new WeakMap,B=new WeakMap,h=new WeakSet,w=function(e){if("number"!=typeof e)throw new TypeError("Invalid 'imageId'.");return E(this,M,"f").findIndex((E=>{var _;return(null===(_=E.tag)||void 0===_?void 0:_.imageId)===e}))};const b=e=>e&&"object"==typeof e&&"function"==typeof e.then;class v 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,b(e)?E=e:"function"==typeof e&&(E=new Promise(e)),E&&(async()=>{try{const _=await E;e===this._task&&this.resolve(_)}catch(E){e===this._task&&this.reject(E)}})()}get isEmpty(){return null==this._task}constructor(e){let E,_;super(((e,t)=>{E=e,_=t})),this._s="pending",this.resolve=e=>{this.isPending&&(b(e)?this.task=e:(this._s="fulfilled",E(e)))},this.reject=e=>{this.isPending&&(this._s="rejected",_(e))},this.task=e}}let x,k,Y,H,X;"undefined"!=typeof navigator&&(x=navigator,k=x.userAgent,Y=x.platform,H=x.mediaDevices),function(){if(!n){const e={Edge:{search:"Edg",verSearch:"Edg"},OPR:null,Chrome:null,Safari:{str:x.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:Y,search:"Win"},Mac:{str:Y},Linux:{str:Y}};let _="unknownBrowser",t=0,I="unknownOS";for(let E in e){const I=e[E]||{};let r=I.str||k,n=I.search||E,o=I.verStr||k,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||k,r=_.search||e;if(-1!=t.indexOf(r)){I=e;break}}"Linux"==I&&-1!=k.indexOf("Windows NT")&&(I="HarmonyOS"),X={browser:_,version:t,OS:I}}n&&(X={browser:"ssr",version:0,OS:"ssr"})}();const Z="undefined"!=typeof WebAssembly&&k&&!(/Safari/.test(k)&&!/Chrome/.test(k)&&/\(.+\s11_2_([2-6]).*\)/.test(k)),W=!("undefined"==typeof Worker),j=!(!H||!H.getUserMedia),K=async()=>{let e=!1;if(j)try{(await H.getUserMedia({video:!0})).getTracks().forEach((e=>{e.stop()})),e=!0}catch(e){}return e};"Chrome"===X.browser&&X.version>66||"Safari"===X.browser&&X.version>13||"OPR"===X.browser&&X.version>43||"Edge"===X.browser&&X.version;const Q={},J=async e=>{let E="string"==typeof e?[e]:e,_=[];for(let e of E)_.push(Q[e]=Q[e]||new v);await Promise.all(_)},$=async(e,E)=>{let _,t="string"==typeof e?[e]:e,I=[];for(let e of t){let t;I.push(t=Q[e]=Q[e]||new v(_=_||E())),t.isEmpty&&(t.task=_=_||E())}await Promise.all(I)};e.worker=void 0;let z=0;const q=()=>z++,ee={};e.onLog=void 0;const Ee=E=>{e.onLog=E,e.worker&&e.worker.postMessage({type:"setBLog",body:{value:!!E}})};e.bDebug=!1;const _e=E=>{e.bDebug=E,e.worker&&e.worker.postMessage({type:"setBDebug",body:{value:!!E}})},te={},Ie={std:{version:"1.4.10",path:a(o+"../../dynamsoft-capture-vision-std@1.4.10/dist/")},core:{version:"3.4.21",path:o}},re={dip:{wasm:!0}},ne={},oe=async E=>{let _;E instanceof Array||(E=E?[E]:[]);let t=Q.core;_=!t||t.isEmpty;let I=new Map;const r=e=>{if("std"==(e=e.toLowerCase())||"core"==e)return;if(!re[e])throw Error("The '"+e+"' module cannot be found.");let E=re[e].deps;if(null==E?void 0:E.length)for(let e of E)r(e);let _=Q[e];I.has(e)||I.set(e,!_||_.isEmpty)};for(let e of E)r(e);let n=[];_&&n.push("core"),n.push(...I.keys());const o=[...I.entries()].filter((e=>!e[1])).map((e=>e[0]));await $(n,(async()=>{const E=[...I.entries()].filter((e=>e[1])).map((e=>e[0]));await J(o);const t=S(ne,Ie),r={};for(let e of E)r[e]=re[e];const n={engineResourcePaths:t,autoResources:r,names:E};let a=new v;if(_){n.needLoadCore=!0;let E=t.core+ae._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);a.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{ee[I](r),delete ee[I]}catch(e){throw delete ee[I],e}break;case"event":try{ee[I](r)}catch(e){throw e}break;default:console.log(E)}})),n.bLog=!!e.onLog,n.bd=e.bDebug,n.dm=location.origin.startsWith("http")?location.origin:"https://localhost"}else await J("core");let s=z++;ee[s]=e=>{if(e.success)Object.assign(te,e.versions),"{}"!==JSON.stringify(e.versions)&&(ae._versions=e.versions),a.resolve(void 0);else{const E=Error(e.message);e.stack&&(E.stack=e.stack),a.reject(E)}},e.worker.postMessage({type:"loadWasm",body:n,id:s}),await a}))};class ae{static get engineResourcePaths(){return ne}static set engineResourcePaths(e){Object.assign(ne,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){Ee(e)}static get _bDebug(){return e.bDebug}static set _bDebug(e){_e(e)}static isModuleLoaded(e){return e=(e=e||"core").toLowerCase(),!!Q[e]&&Q[e].isFulfilled}static async loadWasm(e){return await oe(e)}static async detectEnvironment(){return await(async()=>({wasm:Z,worker:W,getUserMedia:j,camera:await K(),browser:X.browser,version:X.version,OS:X.OS}))()}static async getModuleVersion(){return await new Promise(((E,_)=>{let t=q();ee[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=te.core&&te.core.worker,E=te.core&&te.core.wasm;return`3.4.21(Worker: ${e||"Not Loaded"}, Wasm: ${E||"Not Loaded"})`}static enableLogging(){V._onLog=console.log,ae._onLog=console.log}static disableLogging(){V._onLog=null,ae._onLog=null}static async cfd(E){return await new Promise(((_,t)=>{let I=q();ee[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 se,ie,Ce,Ae,Te,Ne,Re,Le;ae._bSupportDce4Module=-1,ae._bSupportIRTModule=-1,ae._versions=null,ae._workerName="core.worker.js",ae.browserInfo=X,e.EnumCapturedResultItemType=void 0,(se=e.EnumCapturedResultItemType||(e.EnumCapturedResultItemType={}))[se.CRIT_ORIGINAL_IMAGE=1]="CRIT_ORIGINAL_IMAGE",se[se.CRIT_BARCODE=2]="CRIT_BARCODE",se[se.CRIT_TEXT_LINE=4]="CRIT_TEXT_LINE",se[se.CRIT_DETECTED_QUAD=8]="CRIT_DETECTED_QUAD",se[se.CRIT_NORMALIZED_IMAGE=16]="CRIT_NORMALIZED_IMAGE",se[se.CRIT_PARSED_RESULT=32]="CRIT_PARSED_RESULT",e.EnumCornerType=void 0,(ie=e.EnumCornerType||(e.EnumCornerType={}))[ie.CT_NORMAL_INTERSECTED=0]="CT_NORMAL_INTERSECTED",ie[ie.CT_T_INTERSECTED=1]="CT_T_INTERSECTED",ie[ie.CT_CROSS_INTERSECTED=2]="CT_CROSS_INTERSECTED",ie[ie.CT_NOT_INTERSECTED=3]="CT_NOT_INTERSECTED",e.EnumErrorCode=void 0,(Ce=e.EnumErrorCode||(e.EnumErrorCode={}))[Ce.EC_OK=0]="EC_OK",Ce[Ce.EC_UNKNOWN=-1e4]="EC_UNKNOWN",Ce[Ce.EC_NO_MEMORY=-10001]="EC_NO_MEMORY",Ce[Ce.EC_NULL_POINTER=-10002]="EC_NULL_POINTER",Ce[Ce.EC_LICENSE_INVALID=-10003]="EC_LICENSE_INVALID",Ce[Ce.EC_LICENSE_EXPIRED=-10004]="EC_LICENSE_EXPIRED",Ce[Ce.EC_FILE_NOT_FOUND=-10005]="EC_FILE_NOT_FOUND",Ce[Ce.EC_FILE_TYPE_NOT_SUPPORTED=-10006]="EC_FILE_TYPE_NOT_SUPPORTED",Ce[Ce.EC_BPP_NOT_SUPPORTED=-10007]="EC_BPP_NOT_SUPPORTED",Ce[Ce.EC_INDEX_INVALID=-10008]="EC_INDEX_INVALID",Ce[Ce.EC_CUSTOM_REGION_INVALID=-10010]="EC_CUSTOM_REGION_INVALID",Ce[Ce.EC_IMAGE_READ_FAILED=-10012]="EC_IMAGE_READ_FAILED",Ce[Ce.EC_TIFF_READ_FAILED=-10013]="EC_TIFF_READ_FAILED",Ce[Ce.EC_DIB_BUFFER_INVALID=-10018]="EC_DIB_BUFFER_INVALID",Ce[Ce.EC_PDF_READ_FAILED=-10021]="EC_PDF_READ_FAILED",Ce[Ce.EC_PDF_DLL_MISSING=-10022]="EC_PDF_DLL_MISSING",Ce[Ce.EC_PAGE_NUMBER_INVALID=-10023]="EC_PAGE_NUMBER_INVALID",Ce[Ce.EC_CUSTOM_SIZE_INVALID=-10024]="EC_CUSTOM_SIZE_INVALID",Ce[Ce.EC_TIMEOUT=-10026]="EC_TIMEOUT",Ce[Ce.EC_JSON_PARSE_FAILED=-10030]="EC_JSON_PARSE_FAILED",Ce[Ce.EC_JSON_TYPE_INVALID=-10031]="EC_JSON_TYPE_INVALID",Ce[Ce.EC_JSON_KEY_INVALID=-10032]="EC_JSON_KEY_INVALID",Ce[Ce.EC_JSON_VALUE_INVALID=-10033]="EC_JSON_VALUE_INVALID",Ce[Ce.EC_JSON_NAME_KEY_MISSING=-10034]="EC_JSON_NAME_KEY_MISSING",Ce[Ce.EC_JSON_NAME_VALUE_DUPLICATED=-10035]="EC_JSON_NAME_VALUE_DUPLICATED",Ce[Ce.EC_TEMPLATE_NAME_INVALID=-10036]="EC_TEMPLATE_NAME_INVALID",Ce[Ce.EC_JSON_NAME_REFERENCE_INVALID=-10037]="EC_JSON_NAME_REFERENCE_INVALID",Ce[Ce.EC_PARAMETER_VALUE_INVALID=-10038]="EC_PARAMETER_VALUE_INVALID",Ce[Ce.EC_DOMAIN_NOT_MATCH=-10039]="EC_DOMAIN_NOT_MATCH",Ce[Ce.EC_RESERVED_INFO_NOT_MATCH=-10040]="EC_RESERVED_INFO_NOT_MATCH",Ce[Ce.EC_LICENSE_KEY_NOT_MATCH=-10043]="EC_LICENSE_KEY_NOT_MATCH",Ce[Ce.EC_REQUEST_FAILED=-10044]="EC_REQUEST_FAILED",Ce[Ce.EC_LICENSE_INIT_FAILED=-10045]="EC_LICENSE_INIT_FAILED",Ce[Ce.EC_SET_MODE_ARGUMENT_ERROR=-10051]="EC_SET_MODE_ARGUMENT_ERROR",Ce[Ce.EC_LICENSE_CONTENT_INVALID=-10052]="EC_LICENSE_CONTENT_INVALID",Ce[Ce.EC_LICENSE_KEY_INVALID=-10053]="EC_LICENSE_KEY_INVALID",Ce[Ce.EC_LICENSE_DEVICE_RUNS_OUT=-10054]="EC_LICENSE_DEVICE_RUNS_OUT",Ce[Ce.EC_GET_MODE_ARGUMENT_ERROR=-10055]="EC_GET_MODE_ARGUMENT_ERROR",Ce[Ce.EC_IRT_LICENSE_INVALID=-10056]="EC_IRT_LICENSE_INVALID",Ce[Ce.EC_FILE_SAVE_FAILED=-10058]="EC_FILE_SAVE_FAILED",Ce[Ce.EC_STAGE_TYPE_INVALID=-10059]="EC_STAGE_TYPE_INVALID",Ce[Ce.EC_IMAGE_ORIENTATION_INVALID=-10060]="EC_IMAGE_ORIENTATION_INVALID",Ce[Ce.EC_CONVERT_COMPLEX_TEMPLATE_ERROR=-10061]="EC_CONVERT_COMPLEX_TEMPLATE_ERROR",Ce[Ce.EC_CALL_REJECTED_WHEN_CAPTURING=-10062]="EC_CALL_REJECTED_WHEN_CAPTURING",Ce[Ce.EC_NO_IMAGE_SOURCE=-10063]="EC_NO_IMAGE_SOURCE",Ce[Ce.EC_READ_DIRECTORY_FAILED=-10064]="EC_READ_DIRECTORY_FAILED",Ce[Ce.EC_MODULE_NOT_FOUND=-10065]="EC_MODULE_NOT_FOUND",Ce[Ce.EC_MULTI_PAGES_NOT_SUPPORTED=-10066]="EC_MULTI_PAGES_NOT_SUPPORTED",Ce[Ce.EC_FILE_ALREADY_EXISTS=-10067]="EC_FILE_ALREADY_EXISTS",Ce[Ce.EC_CREATE_FILE_FAILED=-10068]="EC_CREATE_FILE_FAILED",Ce[Ce.EC_IMGAE_DATA_INVALID=-10069]="EC_IMGAE_DATA_INVALID",Ce[Ce.EC_IMAGE_SIZE_NOT_MATCH=-10070]="EC_IMAGE_SIZE_NOT_MATCH",Ce[Ce.EC_IMAGE_PIXEL_FORMAT_NOT_MATCH=-10071]="EC_IMAGE_PIXEL_FORMAT_NOT_MATCH",Ce[Ce.EC_SECTION_LEVEL_RESULT_IRREPLACEABLE=-10072]="EC_SECTION_LEVEL_RESULT_IRREPLACEABLE",Ce[Ce.EC_AXIS_DEFINITION_INCORRECT=-10073]="EC_AXIS_DEFINITION_INCORRECT",Ce[Ce.EC_RESULT_TYPE_MISMATCH_IRREPLACEABLE=-10074]="EC_RESULT_TYPE_MISMATCH_IRREPLACEABLE",Ce[Ce.EC_PDF_LIBRARY_LOAD_FAILED=-10075]="EC_PDF_LIBRARY_LOAD_FAILED",Ce[Ce.EC_NO_LICENSE=-2e4]="EC_NO_LICENSE",Ce[Ce.EC_HANDSHAKE_CODE_INVALID=-20001]="EC_HANDSHAKE_CODE_INVALID",Ce[Ce.EC_LICENSE_BUFFER_FAILED=-20002]="EC_LICENSE_BUFFER_FAILED",Ce[Ce.EC_LICENSE_SYNC_FAILED=-20003]="EC_LICENSE_SYNC_FAILED",Ce[Ce.EC_DEVICE_NOT_MATCH=-20004]="EC_DEVICE_NOT_MATCH",Ce[Ce.EC_BIND_DEVICE_FAILED=-20005]="EC_BIND_DEVICE_FAILED",Ce[Ce.EC_INSTANCE_COUNT_OVER_LIMIT=-20008]="EC_INSTANCE_COUNT_OVER_LIMIT",Ce[Ce.EC_LICENSE_INIT_SEQUENCE_FAILED=-20009]="EC_LICENSE_INIT_SEQUENCE_FAILED",Ce[Ce.EC_TRIAL_LICENSE=-20010]="EC_TRIAL_LICENSE",Ce[Ce.EC_FAILED_TO_REACH_DLS=-20200]="EC_FAILED_TO_REACH_DLS",Ce[Ce.EC_LICENSE_CACHE_USED=-20012]="EC_LICENSE_CACHE_USED",Ce[Ce.EC_BARCODE_FORMAT_INVALID=-30009]="EC_BARCODE_FORMAT_INVALID",Ce[Ce.EC_QR_LICENSE_INVALID=-30016]="EC_QR_LICENSE_INVALID",Ce[Ce.EC_1D_LICENSE_INVALID=-30017]="EC_1D_LICENSE_INVALID",Ce[Ce.EC_PDF417_LICENSE_INVALID=-30019]="EC_PDF417_LICENSE_INVALID",Ce[Ce.EC_DATAMATRIX_LICENSE_INVALID=-30020]="EC_DATAMATRIX_LICENSE_INVALID",Ce[Ce.EC_CUSTOM_MODULESIZE_INVALID=-30025]="EC_CUSTOM_MODULESIZE_INVALID",Ce[Ce.EC_AZTEC_LICENSE_INVALID=-30041]="EC_AZTEC_LICENSE_INVALID",Ce[Ce.EC_PATCHCODE_LICENSE_INVALID=-30046]="EC_PATCHCODE_LICENSE_INVALID",Ce[Ce.EC_POSTALCODE_LICENSE_INVALID=-30047]="EC_POSTALCODE_LICENSE_INVALID",Ce[Ce.EC_DPM_LICENSE_INVALID=-30048]="EC_DPM_LICENSE_INVALID",Ce[Ce.EC_FRAME_DECODING_THREAD_EXISTS=-30049]="EC_FRAME_DECODING_THREAD_EXISTS",Ce[Ce.EC_STOP_DECODING_THREAD_FAILED=-30050]="EC_STOP_DECODING_THREAD_FAILED",Ce[Ce.EC_MAXICODE_LICENSE_INVALID=-30057]="EC_MAXICODE_LICENSE_INVALID",Ce[Ce.EC_GS1_DATABAR_LICENSE_INVALID=-30058]="EC_GS1_DATABAR_LICENSE_INVALID",Ce[Ce.EC_GS1_COMPOSITE_LICENSE_INVALID=-30059]="EC_GS1_COMPOSITE_LICENSE_INVALID",Ce[Ce.EC_DOTCODE_LICENSE_INVALID=-30061]="EC_DOTCODE_LICENSE_INVALID",Ce[Ce.EC_PHARMACODE_LICENSE_INVALID=-30062]="EC_PHARMACODE_LICENSE_INVALID",Ce[Ce.EC_CHARACTER_MODEL_FILE_NOT_FOUND=-40100]="EC_CHARACTER_MODEL_FILE_NOT_FOUND",Ce[Ce.EC_TEXT_LINE_GROUP_LAYOUT_CONFLICT=-40101]="EC_TEXT_LINE_GROUP_LAYOUT_CONFLICT",Ce[Ce.EC_TEXT_LINE_GROUP_REGEX_CONFLICT=-40102]="EC_TEXT_LINE_GROUP_REGEX_CONFLICT",Ce[Ce.EC_QUADRILATERAL_INVALID=-50057]="EC_QUADRILATERAL_INVALID",Ce[Ce.EC_PANORAMA_LICENSE_INVALID=-70060]="EC_PANORAMA_LICENSE_INVALID",Ce[Ce.EC_RESOURCE_PATH_NOT_EXIST=-90001]="EC_RESOURCE_PATH_NOT_EXIST",Ce[Ce.EC_RESOURCE_LOAD_FAILED=-90002]="EC_RESOURCE_LOAD_FAILED",Ce[Ce.EC_CODE_SPECIFICATION_NOT_FOUND=-90003]="EC_CODE_SPECIFICATION_NOT_FOUND",Ce[Ce.EC_FULL_CODE_EMPTY=-90004]="EC_FULL_CODE_EMPTY",Ce[Ce.EC_FULL_CODE_PREPROCESS_FAILED=-90005]="EC_FULL_CODE_PREPROCESS_FAILED",Ce[Ce.EC_ZA_DL_LICENSE_INVALID=-90006]="EC_ZA_DL_LICENSE_INVALID",Ce[Ce.EC_AAMVA_DL_ID_LICENSE_INVALID=-90007]="EC_AAMVA_DL_ID_LICENSE_INVALID",Ce[Ce.EC_AADHAAR_LICENSE_INVALID=-90008]="EC_AADHAAR_LICENSE_INVALID",Ce[Ce.EC_MRTD_LICENSE_INVALID=-90009]="EC_MRTD_LICENSE_INVALID",Ce[Ce.EC_VIN_LICENSE_INVALID=-90010]="EC_VIN_LICENSE_INVALID",Ce[Ce.EC_CUSTOMIZED_CODE_TYPE_LICENSE_INVALID=-90011]="EC_CUSTOMIZED_CODE_TYPE_LICENSE_INVALID",Ce[Ce.EC_LICENSE_WARNING=-10076]="EC_LICENSE_WARNING",Ce[Ce.EC_BARCODE_READER_LICENSE_NOT_FOUND=-30063]="EC_BARCODE_READER_LICENSE_NOT_FOUND",Ce[Ce.EC_LABEL_RECOGNIZER_LICENSE_NOT_FOUND=-40103]="EC_LABEL_RECOGNIZER_LICENSE_NOT_FOUND",Ce[Ce.EC_DOCUMENT_NORMALIZER_LICENSE_NOT_FOUND=-50058]="EC_DOCUMENT_NORMALIZER_LICENSE_NOT_FOUND",Ce[Ce.EC_CODE_PARSER_LICENSE_NOT_FOUND=-90012]="EC_CODE_PARSER_LICENSE_NOT_FOUND",e.EnumGrayscaleEnhancementMode=void 0,(Ae=e.EnumGrayscaleEnhancementMode||(e.EnumGrayscaleEnhancementMode={}))[Ae.GEM_SKIP=0]="GEM_SKIP",Ae[Ae.GEM_AUTO=1]="GEM_AUTO",Ae[Ae.GEM_GENERAL=2]="GEM_GENERAL",Ae[Ae.GEM_GRAY_EQUALIZE=4]="GEM_GRAY_EQUALIZE",Ae[Ae.GEM_GRAY_SMOOTH=8]="GEM_GRAY_SMOOTH",Ae[Ae.GEM_SHARPEN_SMOOTH=16]="GEM_SHARPEN_SMOOTH",Ae[Ae.GEM_REV=-2147483648]="GEM_REV",e.EnumGrayscaleTransformationMode=void 0,(Te=e.EnumGrayscaleTransformationMode||(e.EnumGrayscaleTransformationMode={}))[Te.GTM_SKIP=0]="GTM_SKIP",Te[Te.GTM_INVERTED=1]="GTM_INVERTED",Te[Te.GTM_ORIGINAL=2]="GTM_ORIGINAL",Te[Te.GTM_AUTO=4]="GTM_AUTO",Te[Te.GTM_REV=-2147483648]="GTM_REV",e.EnumImageTagType=void 0,(Ne=e.EnumImageTagType||(e.EnumImageTagType={}))[Ne.ITT_FILE_IMAGE=0]="ITT_FILE_IMAGE",Ne[Ne.ITT_VIDEO_FRAME=1]="ITT_VIDEO_FRAME",e.EnumPDFReadingMode=void 0,(Re=e.EnumPDFReadingMode||(e.EnumPDFReadingMode={}))[Re.PDFRM_VECTOR=1]="PDFRM_VECTOR",Re[Re.PDFRM_RASTER=2]="PDFRM_RASTER",Re[Re.PDFRM_REV=-2147483648]="PDFRM_REV",e.EnumRasterDataSource=void 0,(Le=e.EnumRasterDataSource||(e.EnumRasterDataSource={}))[Le.RDS_RASTERIZED_PAGES=0]="RDS_RASTERIZED_PAGES",Le[Le.RDS_EXTRACTED_IMAGES=1]="RDS_EXTRACTED_IMAGES";const De={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_ALL:BigInt("0xFFFFFFFFFFFFFFFF")};var Oe,le;e.EnumRegionObjectElementType=void 0,(Oe=e.EnumRegionObjectElementType||(e.EnumRegionObjectElementType={}))[Oe.ROET_PREDETECTED_REGION=0]="ROET_PREDETECTED_REGION",Oe[Oe.ROET_LOCALIZED_BARCODE=1]="ROET_LOCALIZED_BARCODE",Oe[Oe.ROET_DECODED_BARCODE=2]="ROET_DECODED_BARCODE",Oe[Oe.ROET_LOCALIZED_TEXT_LINE=3]="ROET_LOCALIZED_TEXT_LINE",Oe[Oe.ROET_RECOGNIZED_TEXT_LINE=4]="ROET_RECOGNIZED_TEXT_LINE",Oe[Oe.ROET_DETECTED_QUAD=5]="ROET_DETECTED_QUAD",Oe[Oe.ROET_NORMALIZED_IMAGE=6]="ROET_NORMALIZED_IMAGE",Oe[Oe.ROET_SOURCE_IMAGE=7]="ROET_SOURCE_IMAGE",Oe[Oe.ROET_TARGET_ROI=8]="ROET_TARGET_ROI",e.EnumSectionType=void 0,(le=e.EnumSectionType||(e.EnumSectionType={}))[le.ST_NULL=0]="ST_NULL",le[le.ST_REGION_PREDETECTION=1]="ST_REGION_PREDETECTION",le[le.ST_BARCODE_LOCALIZATION=2]="ST_BARCODE_LOCALIZATION",le[le.ST_BARCODE_DECODING=3]="ST_BARCODE_DECODING",le[le.ST_TEXT_LINE_LOCALIZATION=4]="ST_TEXT_LINE_LOCALIZATION",le[le.ST_TEXT_LINE_RECOGNITION=5]="ST_TEXT_LINE_RECOGNITION",le[le.ST_DOCUMENT_DETECTION=6]="ST_DOCUMENT_DETECTION",le[le.ST_DOCUMENT_NORMALIZATION=7]="ST_DOCUMENT_NORMALIZATION",e.CoreModule=ae,e.EnumIntermediateResultUnitType=De,e.ImageSourceAdapter=V,e._getNorImageData=F,e._isArc=N,e._isContour=R,e._isDSImageData=L,e._isDSRect=D,e._isImageTag=O,e._isLineSegment=l,e._isPoint=m,e._isPolygon=c,e._isQuad=u,e._isRect=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 f(`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=f,e._toCanvas=d,e._toImage=(e,E)=>{L(E)&&(E=F(E));const _=d(E);let t=new Image,I=_.toDataURL(e);return t.src=I,t},e.autoDiscoveryPaths=Ie,e.checkIsLink=function(e){return/^(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=$,e.getNextTaskID=q,e.handleEngineResourcePaths=S,e.innerVersions=te,e.isArc=N,e.isContour=R,e.isDSImageData=L,e.isDSRect=D,e.isImageTag=O,e.isLineSegment=l,e.isObject=T,e.isPoint=m,e.isPolygon=c,e.isQuad=u,e.isRect=g,e.loadWasm=oe,e.mapAsyncDependency=Q,e.mapPackageRegister={},e.mapTaskCallBack=ee,e.requestResource=async function(e,E){return 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(e+" "+I.status):_(I.response)},I.onerror=()=>{t(new Error("Network Error: "+I.statusText))}}))},e.setBDebug=_e,e.setOnLog=Ee,e.waitAsyncDependency=J,e.workerAutoResources=re})); | ||
!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=e[t],r=I&&"object"==typeof I&&I.path?I.path:I,n=e.rootDirectory;if(n&&!n.endsWith("/")&&(n+="/"),"object"==typeof I&&I.isInternal)n&&(r=e[t].version?`${n}${_[t]}@${e[t].version}/dist/${"ddv"===t?"engine":""}`:`${n}${_[t]}/dist/${"ddv"===t?"engine":""}`);else{const _=/^@engineRootDirectory(\/?)/;if("string"==typeof r&&(r=r.replace(_,n||"")),"object"==typeof r&&"dwt"===t){const I=e[t].resourcesPath,r=e[t].serviceInstallerLocation;E[t]={resourcesPath:I.replace(_,n||""),serviceInstallerLocation:r.replace(_,n||"")};continue}}E[t]=C(r)}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-202412032155",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-202412032155(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})); |
@@ -7,6 +7,6 @@ /*! | ||
* @author Dynamsoft | ||
* @version 3.4.21 | ||
* @version 3.4.30 | ||
* @fileoverview Dynamsoft JavaScript Library for Core | ||
* More info on Dynamsoft Core JS: https://www.dynamsoft.com/capture-vision/docs/web/programming/javascript/api-reference/core/core-module.html | ||
*/ | ||
!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.21",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)||t,stack:s.bDebug&&(null==t?void 0:t.stack)||t}})},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-beta-202412032155",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})}}(); |
{ | ||
"name": "dynamsoft-core", | ||
"version": "3.4.21", | ||
"version": "3.4.30-beta-202412032155", | ||
"description": "The Dynamsoft Core module builds the foundation upon which Dynamsoft SDKs implement their functionality.", | ||
"homepage": "https://dynamsoft.com/capture-vision/docs/web/programming/javascript/?ver=latest", | ||
"main": "dist/core.js", | ||
@@ -22,3 +21,3 @@ "module": "dist/core.esm.js", | ||
"registry": "https://registry.npmjs.org/", | ||
"tag": "latest" | ||
"tag": "beta" | ||
}, | ||
@@ -35,6 +34,2 @@ "author": { | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/Dynamsoft/core-javascript.git" | ||
}, | ||
"files": [ | ||
@@ -85,3 +80,3 @@ "/dist/*.js", | ||
"@scannerproxy/browser-info": "^2.0.8", | ||
"@scannerproxy/curscript-path": "^2.0.4", | ||
"@scannerproxy/curscript-path": "^2.0.6", | ||
"@types/node": "^20.4.2", | ||
@@ -88,0 +83,0 @@ "detect-browser-node-ssr": "^3.0.2", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
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
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
526498
1374
3
1