@scandit/web-datacapture-core 7.0.0 → 7.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/build/js/{Camera-Cxbduq94.d.ts → Camera-ZV7WBiWy.d.ts} +29 -5
- package/build/js/Camera.d.ts +1 -1
- package/build/js/Camera.js +1 -1
- package/build/js/CameraAccess.d.ts +1 -1
- package/build/js/CameraAccess.js +1 -1
- package/build/js/CameraRelated.d.ts +1 -1
- package/build/js/DataCaptureContext.d.ts +1 -1
- package/build/js/DataCaptureContext.js +1 -1
- package/build/js/DataCaptureContextRelated.d.ts +1 -1
- package/build/js/DataCaptureVersion.js +1 -1
- package/build/js/DataCaptureView.d.ts +1 -1
- package/build/js/DataCaptureView.js +1 -1
- package/build/js/Defaults.d.ts +1 -1
- package/build/js/Feedback.js +1 -1
- package/build/js/FrameData.d.ts +1 -1
- package/build/js/ImageFrameSource.d.ts +1 -1
- package/build/js/SingleImageUploader.d.ts +1 -1
- package/build/js/Vibration.js +1 -1
- package/build/js/browserHelper.d.ts +6 -0
- package/build/js/browserHelper.js +1 -1
- package/build/js/chunks/{chunk-KWL7KLMR.js → chunk-3V7ZD6JQ.js} +5 -5
- package/build/js/chunks/{chunk-MM6VVG46.js → chunk-5TKCHVG2.js} +1 -1
- package/build/js/chunks/{chunk-PO2YU6JK.js → chunk-6O3B7VJJ.js} +1 -1
- package/build/js/chunks/chunk-ABRFVD7T.js +5 -0
- package/build/js/chunks/chunk-ARJASUTK.js +17 -0
- package/build/js/chunks/{chunk-SXOL25UA.js → chunk-BIGR7VVJ.js} +1 -1
- package/build/js/chunks/chunk-EFJGQ4BT.js +3 -0
- package/build/js/chunks/{chunk-IH7SHTFM.js → chunk-EHMSDFH7.js} +1 -1
- package/build/js/chunks/{chunk-UA3E3GGM.js → chunk-HNMM5VR6.js} +1 -1
- package/build/js/chunks/{chunk-ERQILEGU.js → chunk-J6Q5HITP.js} +7 -7
- package/build/js/chunks/{chunk-4MKLNRV3.js → chunk-MOKCZFZV.js} +4 -4
- package/build/js/chunks/chunk-MU4VAJIM.js +6 -0
- package/build/js/chunks/chunk-MW5PTAU7.js +3 -0
- package/build/js/chunks/chunk-NNLX5HO4.js +10 -0
- package/build/js/chunks/chunk-QHBIT2WY.js +3 -0
- package/build/js/chunks/chunk-SKRKDAFC.js +13 -0
- package/build/js/chunks/{chunk-YGNHN5OT.js → chunk-TCJPGGHY.js} +3 -3
- package/build/js/chunks/{chunk-XM4ZH4L3.js → chunk-TWBD6OC5.js} +3 -3
- package/build/js/chunks/{chunk-MOF3P7VK.js → chunk-ULRY4SXF.js} +2 -2
- package/build/js/chunks/{chunk-EQEB3JUS.js → chunk-V76YCTVB.js} +1 -1
- package/build/js/index.d.ts +2 -2
- package/build/js/index.js +14 -14
- package/build/js/private/CameraAccess.d.ts +1 -1
- package/build/js/private/CameraAccess.js +1 -1
- package/build/js/private/CameraManager.d.ts +1 -1
- package/build/js/private/CameraManager.js +1 -1
- package/build/js/private/CanvasDrawerWithMetrics.d.ts +1 -1
- package/build/js/private/CoreModuleLicenseTextProvider.d.ts +1 -1
- package/build/js/private/DataCaptureContextRelated.d.ts +1 -1
- package/build/js/private/FrameReaders/FrameReader.d.ts +1 -1
- package/build/js/private/FrameReaders/FrameReader.js +1 -1
- package/build/js/private/FrameReaders/FrameReaderAbstract.d.ts +1 -1
- package/build/js/private/FrameReaders/FrameReaderAbstract.js +1 -1
- package/build/js/private/FrameReaders/GrayScaleFrameReader.d.ts +2 -5
- package/build/js/private/FrameReaders/GrayScaleFrameReader.js +1 -1
- package/build/js/private/FrameReaders/WatermarkStack.js +1 -1
- package/build/js/private/FrameReaders/index.d.ts +1 -1
- package/build/js/private/FrameReaders/index.js +2 -2
- package/build/js/private/NormalizedConfigureOptions.d.ts +1 -1
- package/build/js/private/ViewControls+related.js +1 -1
- package/build/js/private/ViewControls_related.d.ts +1 -1
- package/build/js/private/ViewsRegistry.d.ts +1 -1
- package/build/js/private/hybridDesktopPlatformHelpers.js +1 -1
- package/build/js/private/ui/atoms/Toast.d.ts +1 -1
- package/build/js/private/ui/molecules/HintPresenter.d.ts +1 -1
- package/build/js/private/utils/index.js +1 -1
- package/build/js/sdk.d.ts +1 -1
- package/build/js/worker/WorkerMain.d.ts +1 -1
- package/build/js/worker/WorkerMain.js +1 -1
- package/build/js/worker/dataCapture.inlineWorker.d.ts +1 -1
- package/build/js/worker/dataCapture.inlineWorker.js +1 -1
- package/build/js/worker/dataCaptureEngine.d.ts +1 -1
- package/build/js/worker/dataCaptureEngine.js +1 -1
- package/build/js/worker/dataCaptureLoader.d.ts +1 -1
- package/build/js/worker/dataCaptureLoader.js +1 -1
- package/build/js/worker/dataCaptureWorkerRelated.d.ts +1 -1
- package/build/js/worker/index.d.ts +1 -1
- package/build/js/worker/index.js +3 -3
- package/package.json +1 -1
- package/build/js/chunks/chunk-3TNNUKVW.js +0 -5
- package/build/js/chunks/chunk-4FJRDG6T.js +0 -6
- package/build/js/chunks/chunk-76GU6PXK.js +0 -3
- package/build/js/chunks/chunk-DWX2KHSS.js +0 -3
- package/build/js/chunks/chunk-EK2IIDFY.js +0 -3
- package/build/js/chunks/chunk-HEBLZ3EE.js +0 -10
- package/build/js/chunks/chunk-YXQ44PG2.js +0 -17
- package/build/js/chunks/chunk-ZR62555L.js +0 -12
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="emscripten" />
|
|
2
|
-
export { bb as CreateContextParameters,
|
|
2
|
+
export { bb as CreateContextParameters, S as DataCaptureEngine, ba as LoadLibraryParameters, be as ProcessFrameParameters, bf as ReportCameraPropertiesParameters, bd as SetFrameSourceParameters, bc as UpdateContextParameters, bg as WorkerFunctions } from '../Camera-ZV7WBiWy.js';
|
|
3
3
|
import './OverrideState.js';
|
|
4
4
|
import '../LoadingStatus.js';
|
|
5
5
|
import '../Common.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { a as DataCaptureEngine } from '../chunks/chunk-
|
|
1
|
+
export { a as DataCaptureEngine } from '../chunks/chunk-3V7ZD6JQ.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="emscripten" />
|
|
2
2
|
import './OverrideState.js';
|
|
3
|
-
export { D as DataCaptureLoader, R as DataCaptureLoaderOptions } from '../Camera-
|
|
3
|
+
export { D as DataCaptureLoader, R as DataCaptureLoaderOptions } from '../Camera-ZV7WBiWy.js';
|
|
4
4
|
import '../logger.js';
|
|
5
5
|
import '../LoadingStatus.js';
|
|
6
6
|
import '../private/Serializable.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { a as DataCaptureLoader } from '../chunks/chunk-
|
|
1
|
+
export { a as DataCaptureLoader } from '../chunks/chunk-ABRFVD7T.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="emscripten" />
|
|
2
2
|
import '../Common.js';
|
|
3
|
-
export { Z as AnyDataCaptureActionMessage, _ as AugmentedWorker, aS as CaptureModeDeserializerInstance, a9 as CreateContextDataCaptureAction, a0 as DataCaptureActionMessageKey, Y as DataCaptureCallbackMessage, aq as DataCaptureCallbackMessageKeys, aK as DataCaptureContext, aR as DataCaptureContextDeserializer, aQ as DataCaptureContextDeserializerResult, aL as DataCaptureImageBufferFrameSource, aO as DataCaptureView, aI as DataCaptureWorker, ad as DeleteFrameDataDataCaptureAction, ax as DidTapTrackedBarcode, ah as DisposeDataCaptureAction, aJ as EmscriptenClassHandle, a1 as EngineWorkerResponse, al as ExtractCentaurusLicenseDataCaptureAction, a2 as ExtractCentaurusLicenseResponse, ai as FlushAnalyticsDataCaptureAction, X as GenericHint, aM as GestureListener, aN as GestureRecognizer, ap as GetOpenSourceSoftwareLicenseInfoAction, a6 as GetOpenSourceSoftwareLicenseInfoResponse, a5 as GetViewfinderInfo, ao as GetViewfinderInfoAction, b4 as GuidanceHint, b2 as GuidanceHintAnchor, b3 as GuidanceHintStyle, aE as HideGuidanceMessage, av as HideHintWorkerMessage, aC as HideToastMessage, b0 as HintAnchor, a_ as HintCornerStyle, aW as HintFont, aZ as HintHeight, a$ as HintIcon, b8 as HintPresenterV2, an as HintPresenterV2updateAction, b1 as HintStyle, aX as HintTextAlignment, aY as HintWidth, af as IsFeatureSupportedAction, au as IsFeatureSupportedMessage, a4 as IsFeatureSupportedResponse, aP as JSONParseable, b7 as LicensedFeature, a8 as LoadLibraryDataCaptureAction,
|
|
3
|
+
export { Z as AnyDataCaptureActionMessage, _ as AugmentedWorker, aS as CaptureModeDeserializerInstance, a9 as CreateContextDataCaptureAction, a0 as DataCaptureActionMessageKey, Y as DataCaptureCallbackMessage, aq as DataCaptureCallbackMessageKeys, aK as DataCaptureContext, aR as DataCaptureContextDeserializer, aQ as DataCaptureContextDeserializerResult, aL as DataCaptureImageBufferFrameSource, aO as DataCaptureView, aI as DataCaptureWorker, ad as DeleteFrameDataDataCaptureAction, ax as DidTapTrackedBarcode, ah as DisposeDataCaptureAction, aJ as EmscriptenClassHandle, a1 as EngineWorkerResponse, al as ExtractCentaurusLicenseDataCaptureAction, a2 as ExtractCentaurusLicenseResponse, ai as FlushAnalyticsDataCaptureAction, X as GenericHint, aM as GestureListener, aN as GestureRecognizer, ap as GetOpenSourceSoftwareLicenseInfoAction, a6 as GetOpenSourceSoftwareLicenseInfoResponse, a5 as GetViewfinderInfo, ao as GetViewfinderInfoAction, b4 as GuidanceHint, b2 as GuidanceHintAnchor, b3 as GuidanceHintStyle, aE as HideGuidanceMessage, av as HideHintWorkerMessage, aC as HideToastMessage, b0 as HintAnchor, a_ as HintCornerStyle, aW as HintFont, aZ as HintHeight, a$ as HintIcon, b8 as HintPresenterV2, an as HintPresenterV2updateAction, b1 as HintStyle, aX as HintTextAlignment, aY as HintWidth, af as IsFeatureSupportedAction, au as IsFeatureSupportedMessage, a4 as IsFeatureSupportedResponse, aP as JSONParseable, b7 as LicensedFeature, a8 as LoadLibraryDataCaptureAction, U as Module, $ as ModuleHandler, aT as ModuleMirrorAxis, az as OnFrameProcessingFinishedMessage, ay as OnFrameProcessingStartedMessage, aA as OnFrameSkippedMessage, am as OnTapAction, aH as PayloadForCommand, W as PerformanceMetrics, aw as PerformanceMetricsReportMessage, b9 as PlatformHintPresenter, ab as ProcessFrameDataCaptureAction, aj as ReportCameraPropertiesDataCaptureAction, ac as RequestFrameDataDataCaptureAction, a3 as RequestFrameDataResponse, aa as SetFrameSourceDataCaptureAction, ak as SetLogLevelDataCaptureAction, aD as ShowGuidanceMessage, as as ShowHintWorkerMessage, aB as ShowToastMessage, aF as StartUpdateTimerMessage, aG as StopUpdateTimerMessage, ar as SuccessFeedbackWorkerMessage, b6 as ToastHint, b5 as ToastHintStyle, ag as UpdateContextDataCaptureAction, at as UpdateHintWorkerMessage, aU as Vector, ae as VisibilityChangeAction, aV as WasmFrameData, a7 as WorkerResponse } from '../Camera-ZV7WBiWy.js';
|
|
4
4
|
import '../LoadingStatus.js';
|
|
5
5
|
import '../logger.js';
|
|
6
6
|
import '../private/Serializable.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="emscripten" />
|
|
2
2
|
export { WorkerMain } from './WorkerMain.js';
|
|
3
|
-
export { Z as AnyDataCaptureActionMessage, _ as AugmentedWorker, aS as CaptureModeDeserializerInstance, a9 as CreateContextDataCaptureAction, bb as CreateContextParameters, a0 as DataCaptureActionMessageKey, Y as DataCaptureCallbackMessage, aq as DataCaptureCallbackMessageKeys, aK as DataCaptureContext, aR as DataCaptureContextDeserializer, aQ as DataCaptureContextDeserializerResult,
|
|
3
|
+
export { Z as AnyDataCaptureActionMessage, _ as AugmentedWorker, aS as CaptureModeDeserializerInstance, a9 as CreateContextDataCaptureAction, bb as CreateContextParameters, a0 as DataCaptureActionMessageKey, Y as DataCaptureCallbackMessage, aq as DataCaptureCallbackMessageKeys, aK as DataCaptureContext, aR as DataCaptureContextDeserializer, aQ as DataCaptureContextDeserializerResult, S as DataCaptureEngine, aL as DataCaptureImageBufferFrameSource, D as DataCaptureLoader, R as DataCaptureLoaderOptions, aO as DataCaptureView, aI as DataCaptureWorker, ad as DeleteFrameDataDataCaptureAction, ax as DidTapTrackedBarcode, ah as DisposeDataCaptureAction, aJ as EmscriptenClassHandle, a1 as EngineWorkerResponse, al as ExtractCentaurusLicenseDataCaptureAction, a2 as ExtractCentaurusLicenseResponse, ai as FlushAnalyticsDataCaptureAction, X as GenericHint, aM as GestureListener, aN as GestureRecognizer, ap as GetOpenSourceSoftwareLicenseInfoAction, a6 as GetOpenSourceSoftwareLicenseInfoResponse, a5 as GetViewfinderInfo, ao as GetViewfinderInfoAction, b4 as GuidanceHint, b2 as GuidanceHintAnchor, b3 as GuidanceHintStyle, aE as HideGuidanceMessage, av as HideHintWorkerMessage, aC as HideToastMessage, b0 as HintAnchor, a_ as HintCornerStyle, aW as HintFont, aZ as HintHeight, a$ as HintIcon, b8 as HintPresenterV2, an as HintPresenterV2updateAction, b1 as HintStyle, aX as HintTextAlignment, aY as HintWidth, af as IsFeatureSupportedAction, au as IsFeatureSupportedMessage, a4 as IsFeatureSupportedResponse, aP as JSONParseable, b7 as LicensedFeature, a8 as LoadLibraryDataCaptureAction, ba as LoadLibraryParameters, U as Module, $ as ModuleHandler, aT as ModuleMirrorAxis, az as OnFrameProcessingFinishedMessage, ay as OnFrameProcessingStartedMessage, aA as OnFrameSkippedMessage, am as OnTapAction, aH as PayloadForCommand, W as PerformanceMetrics, aw as PerformanceMetricsReportMessage, b9 as PlatformHintPresenter, ab as ProcessFrameDataCaptureAction, be as ProcessFrameParameters, aj as ReportCameraPropertiesDataCaptureAction, bf as ReportCameraPropertiesParameters, ac as RequestFrameDataDataCaptureAction, a3 as RequestFrameDataResponse, aa as SetFrameSourceDataCaptureAction, bd as SetFrameSourceParameters, ak as SetLogLevelDataCaptureAction, aD as ShowGuidanceMessage, as as ShowHintWorkerMessage, aB as ShowToastMessage, aF as StartUpdateTimerMessage, aG as StopUpdateTimerMessage, ar as SuccessFeedbackWorkerMessage, b6 as ToastHint, b5 as ToastHintStyle, ag as UpdateContextDataCaptureAction, bc as UpdateContextParameters, at as UpdateHintWorkerMessage, aU as Vector, ae as VisibilityChangeAction, aV as WasmFrameData, bg as WorkerFunctions, a7 as WorkerResponse } from '../Camera-ZV7WBiWy.js';
|
|
4
4
|
import '../private/Serializable.js';
|
|
5
5
|
import '../private/FrameReaders/WatermarkStack.js';
|
|
6
6
|
import '../tsHelper.js';
|
package/build/js/worker/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { a as DataCaptureLoader } from '../chunks/chunk-
|
|
2
|
-
export { a as WorkerMain } from '../chunks/chunk-
|
|
3
|
-
export { a as DataCaptureEngine } from '../chunks/chunk-
|
|
1
|
+
export { a as DataCaptureLoader } from '../chunks/chunk-ABRFVD7T.js';
|
|
2
|
+
export { a as WorkerMain } from '../chunks/chunk-NNLX5HO4.js';
|
|
3
|
+
export { a as DataCaptureEngine } from '../chunks/chunk-3V7ZD6JQ.js';
|
|
4
4
|
export { h as GuidanceHintAnchor, i as GuidanceHintStyle, g as HintAnchor, e as HintCornerStyle, a as HintFont, d as HintHeight, f as HintIcon, b as HintTextAlignment, c as HintWidth, k as LicensedFeature, j as ToastHintStyle } from '../chunks/chunk-3FDT22IX.js';
|
package/package.json
CHANGED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { a } from './chunk-XR65N6EG.js';
|
|
2
|
-
|
|
3
|
-
var n=class{constructor(e){this.overrideThreadsSupport="auto";this.overrideSimdSupport="auto";this.workerCommandId=1;this.workerTasks=new Map;this.workerListeners=[];var r,a;this.libraryLocation=e.libraryLocation,this.isPreloadEngine=(r=e.preloadEngine)!=null?r:!1,this.workerMessageListener=this.onWorkerMessage.bind(this),this.dataCaptureWorker.addEventListener("message",this.workerMessageListener),this.overrideThreadsSupport=e.overrideThreadsSupport,this.overrideSimdSupport=e.overrideSimdSupport,this.verifyResponseHash=e.verifyResponseHash,this.highEndBlurryRecognition=(a=e.highEndBlurryRecognition)!=null?a:!1,typeof e.loadProgressNotifier=="function"&&this.addWorkerListener(o=>{var i;o.type==="loadLibraryProgress"&&((i=e.loadProgressNotifier)==null||i.call(e,o.payload));});}get dataCaptureWorker(){return (this._dataCaptureWorker)!=null||(this._dataCaptureWorker=(void 0)),this._dataCaptureWorker}get name(){return "CoreLoader"}static async create(e){var a$1;let r=new this(e);return await r.workerCommand("setLogLevel",{level:(a$1=e.logLevel)!=null?a$1:a.Level.Debug}),await r.load(),r}async load(){var e;try{await this.workerCommand("loadLibrary",{libraryLocation:this.libraryLocation,locationPath:window.location.pathname,referredOrigin:window.location.origin,preloadEngine:this.isPreloadEngine,writableDataPathOverride:(e=localStorage.getItem("scanditWritableDataPathOverride"))!=null?e:void 0,overrideThreadsSupport:this.overrideThreadsSupport,overrideSimdSupport:this.overrideSimdSupport,verifyResponseHash:this.verifyResponseHash});}catch(r){if(r!=null&&typeof r=="object"&&typeof r.error=="string"&&r.error.includes("BlockedIndexedDB"))return await this.terminateDataCaptureWorker(!1),this.dataCaptureWorker.addEventListener("message",this.workerMessageListener),localStorage.setItem("scanditWritableDataPathOverride",`/scandit_sync_folder_${[...crypto.getRandomValues(new Uint32Array(2))].map(a=>a.toString(32)).join("")}`),this.load();throw r}}async workerCommand(e,r,a){return new Promise((o,i)=>{let t=this.workerCommandId++;this.workerTasks.set(t,{resolve:o,reject:i,command:e});let d={...r,command:e,id:t};this.dataCaptureWorker.postMessage(d,a);})}async terminateDataCaptureWorker(e=!0){var r,a;e&&await this.workerCommand("dispose",{}),(r=this._dataCaptureWorker)==null||r.removeEventListener("message",this.workerMessageListener),(a=this._dataCaptureWorker)==null||a.terminate(),this._dataCaptureWorker=void 0;}addWorkerListener(e){this.workerListeners.push(e);}removeWorkerListener(e){this.workerListeners.includes(e)&&this.workerListeners.splice(this.workerListeners.indexOf(e),1);}getOptions(){return {libraryLocation:this.libraryLocation,overrideThreadsSupport:this.overrideThreadsSupport,overrideSimdSupport:this.overrideSimdSupport,verifyResponseHash:this.verifyResponseHash}}onWorkerMessage(e){let r=e.data;if(r.type==="workerTaskId"&&typeof r.id=="number"){let{id:a,error:o,payload:i}=r,t=this.workerTasks.get(a);o==null?t==null||t.resolve(i):t==null||t.reject(r),this.workerTasks.delete(a);}else for(let a of this.workerListeners)a(r);}};
|
|
4
|
-
|
|
5
|
-
export { n as a };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { c, d, b as b$1, a as a$1, e } from './chunk-H4TH4342.js';
|
|
2
|
-
import { a, b } from './chunk-2Q5FZVGV.js';
|
|
3
|
-
|
|
4
|
-
var Oe=a((ke,ye)=>{(function(h){var c;if(typeof define=="function"&&define.amd&&(define(h),c=!0),typeof ke=="object"&&(ye.exports=h(),c=!0),!c){var P=window.Cookies,x=window.Cookies=h();x.noConflict=function(){return window.Cookies=P,x};}})(function(){function h(){for(var x=0,O={};x<arguments.length;x++){var _=arguments[x];for(var C in _)O[C]=_[C];}return O}function c(x){return x.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}function P(x){function O(){}function _(S,k,f){if(!(typeof document>"u")){f=h({path:"/"},O.defaults,f),typeof f.expires=="number"&&(f.expires=new Date(new Date*1+f.expires*864e5)),f.expires=f.expires?f.expires.toUTCString():"";try{var o=JSON.stringify(k);/^[\{\[]/.test(o)&&(k=o);}catch(i){}k=x.write?x.write(k,S):encodeURIComponent(String(k)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),S=encodeURIComponent(String(S)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var n="";for(var e in f)f[e]&&(n+="; "+e,f[e]!==!0&&(n+="="+f[e].split(";")[0]));return document.cookie=S+"="+k+n}}function C(S,k){if(!(typeof document>"u")){for(var f={},o=document.cookie?document.cookie.split("; "):[],n=0;n<o.length;n++){var e=o[n].split("="),i=e.slice(1).join("=");!k&&i.charAt(0)==='"'&&(i=i.slice(1,-1));try{var t=c(e[0]);if(i=(x.read||x)(i,t)||c(i),k)try{i=JSON.parse(i);}catch(E){}if(f[t]=i,S===t)break}catch(E){}}return S?f[S]:f}}return O.set=_,O.get=function(S){return C(S,!1)},O.getJSON=function(S){return C(S,!0)},O.remove=function(S,k){_(S,"",h(k,{expires:-1}));},O.defaults={},O.withConverter=P,O}return P(function(){})});});var Ce=a((j,$)=>{(function(h,c){var P="1.0.38",x="",O="?",_="function",C="undefined",S="object",k="string",f="major",o="model",n="name",e="type",i="vendor",t="version",E="architecture",L="console",d="mobile",u="tablet",A="smarttv",N="wearable",G="embedded",F=500,D="Amazon",r="Apple",b="ASUS",a="BlackBerry",m="Browser",y="Chrome",M="Edge",U="Firefox",H="Google",re="Huawei",J="LG",Q="Microsoft",ae="Motorola",q="Opera",Y="Samsung",se="Sharp",Z="Sony",ee="Xiaomi",ie="Zebra",le="Facebook",ce="Chromium OS",ue="Mac OS",_e=function(w,g){var l={};for(var v in w)g[v]&&g[v].length%2===0?l[v]=g[v].concat(w[v]):l[v]=w[v];return l},X=function(w){for(var g={},l=0;l<w.length;l++)g[w[l].toUpperCase()]=w[l];return g},be=function(w,g){return typeof w===k?z(g).indexOf(z(w))!==-1:!1},z=function(w){return w.toLowerCase()},Me=function(w){return typeof w===k?w.replace(/[^\d\.]/g,x).split(".")[0]:c},oe=function(w,g){if(typeof w===k)return w=w.replace(/^\s\s*/,x),typeof g===C?w:w.substring(0,F)},V=function(w,g){for(var l=0,v,B,R,p,s,I;l<g.length&&!s;){var te=g[l],fe=g[l+1];for(v=B=0;v<te.length&&!s&&te[v];)if(s=te[v++].exec(w),s)for(R=0;R<fe.length;R++)I=s[++B],p=fe[R],typeof p===S&&p.length>0?p.length===2?typeof p[1]==_?this[p[0]]=p[1].call(this,I):this[p[0]]=p[1]:p.length===3?typeof p[1]===_&&!(p[1].exec&&p[1].test)?this[p[0]]=I?p[1].call(this,I,p[2]):c:this[p[0]]=I?I.replace(p[1],p[2]):c:p.length===4&&(this[p[0]]=I?p[3].call(this,I.replace(p[1],p[2])):c):this[p]=I||c;l+=2;}},ne=function(w,g){for(var l in g)if(typeof g[l]===S&&g[l].length>0){for(var v=0;v<g[l].length;v++)if(be(g[l][v],w))return l===O?c:l}else if(be(g[l],w))return l===O?c:l;return w},Ue={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},de={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},we={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[t,[n,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[t,[n,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[n,t],[/opios[\/ ]+([\w\.]+)/i],[t,[n,q+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[t,[n,q+" GX"]],[/\bopr\/([\w\.]+)/i],[t,[n,q]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[t,[n,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[n,t],[/\bddg\/([\w\.]+)/i],[t,[n,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[t,[n,"UC"+m]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[t,[n,"WeChat"]],[/konqueror\/([\w\.]+)/i],[t,[n,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[t,[n,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[t,[n,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[t,[n,"Smart Lenovo "+m]],[/(avast|avg)\/([\w\.]+)/i],[[n,/(.+)/,"$1 Secure "+m],t],[/\bfocus\/([\w\.]+)/i],[t,[n,U+" Focus"]],[/\bopt\/([\w\.]+)/i],[t,[n,q+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[t,[n,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[t,[n,"Dolphin"]],[/coast\/([\w\.]+)/i],[t,[n,q+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[t,[n,"MIUI "+m]],[/fxios\/([-\w\.]+)/i],[t,[n,U]],[/\bqihu|(qi?ho?o?|360)browser/i],[[n,"360 "+m]],[/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i],[[n,/(.+)/,"$1 "+m],t],[/samsungbrowser\/([\w\.]+)/i],[t,[n,Y+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[n,/_/g," "],t],[/metasr[\/ ]?([\d\.]+)/i],[t,[n,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[n,"Sogou Mobile"],t],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[n,t],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[n],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[n,le],t],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[n,t],[/\bgsa\/([\w\.]+) .*safari\//i],[t,[n,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[t,[n,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[t,[n,y+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[n,y+" WebView"],t],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[t,[n,"Android "+m]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[n,t],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[t,[n,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[t,n],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[n,[t,ne,Ue]],[/(webkit|khtml)\/([\w\.]+)/i],[n,t],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[n,"Netscape"],t],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[t,[n,U+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[n,t],[/(cobalt)\/([\w\.]+)/i],[n,[t,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[E,"amd64"]],[/(ia32(?=;))/i],[[E,z]],[/((?:i[346]|x)86)[;\)]/i],[[E,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[E,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[E,"armhf"]],[/windows (ce|mobile); ppc;/i],[[E,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[E,/ower/,x,z]],[/(sun4\w)[;\)]/i],[[E,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[E,z]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[o,[i,Y],[e,u]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[o,[i,Y],[e,d]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[o,[i,r],[e,d]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[o,[i,r],[e,u]],[/(macintosh);/i],[o,[i,r]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[o,[i,se],[e,d]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[o,[i,re],[e,u]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[o,[i,re],[e,d]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[o,/_/g," "],[i,ee],[e,d]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[o,/_/g," "],[i,ee],[e,u]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[o,[i,"OPPO"],[e,d]],[/\b(opd2\d{3}a?) bui/i],[o,[i,"OPPO"],[e,u]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[o,[i,"Vivo"],[e,d]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[o,[i,"Realme"],[e,d]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[o,[i,ae],[e,d]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[o,[i,ae],[e,u]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[o,[i,J],[e,u]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[o,[i,J],[e,d]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[o,[i,"Lenovo"],[e,u]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[o,/_/g," "],[i,"Nokia"],[e,d]],[/(pixel c)\b/i],[o,[i,H],[e,u]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[o,[i,H],[e,d]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[o,[i,Z],[e,d]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[o,"Xperia Tablet"],[i,Z],[e,u]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[o,[i,"OnePlus"],[e,d]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[o,[i,D],[e,u]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[o,/(.+)/g,"Fire Phone $1"],[i,D],[e,d]],[/(playbook);[-\w\),; ]+(rim)/i],[o,i,[e,u]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[o,[i,a],[e,d]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[o,[i,b],[e,u]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[o,[i,b],[e,d]],[/(nexus 9)/i],[o,[i,"HTC"],[e,u]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[i,[o,/_/g," "],[e,d]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[o,[i,"Acer"],[e,u]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[o,[i,"Meizu"],[e,d]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[o,[i,"Ulefone"],[e,d]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[i,o,[e,d]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[i,o,[e,u]],[/(surface duo)/i],[o,[i,Q],[e,u]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[o,[i,"Fairphone"],[e,d]],[/(u304aa)/i],[o,[i,"AT&T"],[e,d]],[/\bsie-(\w*)/i],[o,[i,"Siemens"],[e,d]],[/\b(rct\w+) b/i],[o,[i,"RCA"],[e,u]],[/\b(venue[\d ]{2,7}) b/i],[o,[i,"Dell"],[e,u]],[/\b(q(?:mv|ta)\w+) b/i],[o,[i,"Verizon"],[e,u]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[o,[i,"Barnes & Noble"],[e,u]],[/\b(tm\d{3}\w+) b/i],[o,[i,"NuVision"],[e,u]],[/\b(k88) b/i],[o,[i,"ZTE"],[e,u]],[/\b(nx\d{3}j) b/i],[o,[i,"ZTE"],[e,d]],[/\b(gen\d{3}) b.+49h/i],[o,[i,"Swiss"],[e,d]],[/\b(zur\d{3}) b/i],[o,[i,"Swiss"],[e,u]],[/\b((zeki)?tb.*\b) b/i],[o,[i,"Zeki"],[e,u]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[i,"Dragon Touch"],o,[e,u]],[/\b(ns-?\w{0,9}) b/i],[o,[i,"Insignia"],[e,u]],[/\b((nxa|next)-?\w{0,9}) b/i],[o,[i,"NextBook"],[e,u]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[i,"Voice"],o,[e,d]],[/\b(lvtel\-)?(v1[12]) b/i],[[i,"LvTel"],o,[e,d]],[/\b(ph-1) /i],[o,[i,"Essential"],[e,d]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[o,[i,"Envizen"],[e,u]],[/\b(trio[-\w\. ]+) b/i],[o,[i,"MachSpeed"],[e,u]],[/\btu_(1491) b/i],[o,[i,"Rotor"],[e,u]],[/(shield[\w ]+) b/i],[o,[i,"Nvidia"],[e,u]],[/(sprint) (\w+)/i],[i,o,[e,d]],[/(kin\.[onetw]{3})/i],[[o,/\./g," "],[i,Q],[e,d]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[o,[i,ie],[e,u]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[o,[i,ie],[e,d]],[/smart-tv.+(samsung)/i],[i,[e,A]],[/hbbtv.+maple;(\d+)/i],[[o,/^/,"SmartTV"],[i,Y],[e,A]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[i,J],[e,A]],[/(apple) ?tv/i],[i,[o,r+" TV"],[e,A]],[/crkey/i],[[o,y+"cast"],[i,H],[e,A]],[/droid.+aft(\w+)( bui|\))/i],[o,[i,D],[e,A]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[o,[i,se],[e,A]],[/(bravia[\w ]+)( bui|\))/i],[o,[i,Z],[e,A]],[/(mitv-\w{5}) bui/i],[o,[i,ee],[e,A]],[/Hbbtv.*(technisat) (.*);/i],[i,o,[e,A]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[i,oe],[o,oe],[e,A]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[e,A]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[i,o,[e,L]],[/droid.+; (shield) bui/i],[o,[i,"Nvidia"],[e,L]],[/(playstation [345portablevi]+)/i],[o,[i,Z],[e,L]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[o,[i,Q],[e,L]],[/((pebble))app/i],[i,o,[e,N]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[o,[i,r],[e,N]],[/droid.+; (glass) \d/i],[o,[i,H],[e,N]],[/droid.+; (wt63?0{2,3})\)/i],[o,[i,ie],[e,N]],[/(quest( \d| pro)?)/i],[o,[i,le],[e,N]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[i,[e,G]],[/(aeobc)\b/i],[o,[i,D],[e,G]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[o,[e,d]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[o,[e,u]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[e,u]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[e,d]],[/(android[-\w\. ]{0,9});.+buil/i],[o,[i,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[t,[n,M+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[t,[n,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[n,t],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[t,n]],os:[[/microsoft (windows) (vista|xp)/i],[n,t],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[n,[t,ne,de]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[t,ne,de],[n,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[t,/_/g,"."],[n,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[n,ue],[t,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[t,n],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[n,t],[/\(bb(10);/i],[t,[n,a]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[t,[n,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[t,[n,U+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[t,[n,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[t,[n,"watchOS"]],[/crkey\/([\d\.]+)/i],[t,[n,y+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[n,ce],t],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[n,t],[/(sunos) ?([\w\.\d]*)/i],[[n,"Solaris"],t],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[n,t]]},T=function(w,g){if(typeof w===S&&(g=w,w=c),!(this instanceof T))return new T(w,g).getResult();var l=typeof h!==C&&h.navigator?h.navigator:c,v=w||(l&&l.userAgent?l.userAgent:x),B=l&&l.userAgentData?l.userAgentData:c,R=g?_e(we,g):we,p=l&&l.userAgent==v;return this.getBrowser=function(){var s={};return s[n]=c,s[t]=c,V.call(s,v,R.browser),s[f]=Me(s[t]),p&&l&&l.brave&&typeof l.brave.isBrave==_&&(s[n]="Brave"),s},this.getCPU=function(){var s={};return s[E]=c,V.call(s,v,R.cpu),s},this.getDevice=function(){var s={};return s[i]=c,s[o]=c,s[e]=c,V.call(s,v,R.device),p&&!s[e]&&B&&B.mobile&&(s[e]=d),p&&s[o]=="Macintosh"&&l&&typeof l.standalone!==C&&l.maxTouchPoints&&l.maxTouchPoints>2&&(s[o]="iPad",s[e]=u),s},this.getEngine=function(){var s={};return s[n]=c,s[t]=c,V.call(s,v,R.engine),s},this.getOS=function(){var s={};return s[n]=c,s[t]=c,V.call(s,v,R.os),p&&!s[n]&&B&&B.platform&&B.platform!="Unknown"&&(s[n]=B.platform.replace(/chrome os/i,ce).replace(/macos/i,ue)),s},this.getResult=function(){return {ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return v},this.setUA=function(s){return v=typeof s===k&&s.length>F?oe(s,F):s,this},this.setUA(v),this};T.VERSION=P,T.BROWSER=X([n,t,f]),T.CPU=X([E]),T.DEVICE=X([o,i,e,L,d,A,u,N,G]),T.ENGINE=T.OS=X([n,t]),typeof j!==C?(typeof $!==C&&$.exports&&(j=$.exports=T),j.UAParser=T):typeof define===_&&define.amd?define(function(){return T}):typeof h!==C&&(h.UAParser=T);var W=typeof h!==C&&(h.jQuery||h.Zepto);if(W&&!W.ua){var K=new T;W.ua=K.getResult(),W.ua.get=function(){return K.getUA()},W.ua.set=function(w){K.setUA(w);var g=K.getResult();for(var l in g)W.ua[l]=g[l];};}})(typeof window=="object"?window:j);});var Ee=b(Oe(),1),Te=b(Ce(),1);var Ae;(D=>{let h;function c$1(){return h==null&&(h=new Te.default(navigator.userAgent)),h}D.getUserAgentInfo=c$1;function P(){var a;if("orientation"in window)return !1;let r="(any-pointer: coarse)",b=(a=window.matchMedia)==null?void 0:a.call(window,r);return navigator.maxTouchPoints===0||(b==null?void 0:b.media)===r&&!(b!=null&&b.matches)}D.isDesktopDevice=P;function x(){return c$1().getDevice().model==="iPhone"}D.isIPhone=x;function O(){let r=c$1().getOS();return r.name==="iOS"&&r.version!=null&&r.version.localeCompare("16.3",void 0,{numeric:!0})>=0}D.isIOSDeviceWithExtendedCameraAccess=O;function _(){return "document"in window?window.document.createElement("canvas"):null}D.getCanvas=_;function C(r){return r.name==="iOS"&&r.version!=null&&["11.2.2","11.2.5","11.2.6"].includes(r.version)}async function S(){return c()}D.hasSIMDSupport=S;async function k(){return d()}D.hasThreadsSupport=k;function f(r,b,a){let m=r[b[0]];return m==null?!1:b.length===1?typeof m===a:(typeof m=="function"||typeof m=="object")&&f(m,b.slice(1),a)}function o(){var M;let r=!0,b=null,a=null,m=null,y=null;try{if(b=D.getCanvas(),a=D.getCanvas(),m=b==null?void 0:b.getContext("webgl"),y=a==null?void 0:a.getContext("experimental-webgl"),!f(window,["WebGLRenderingContext"],"function")||m==null&&y==null)throw new Error("WebGLRenderingContext is not supported")}catch(U){r=!1;}finally{for(let U of [m,y])typeof(U==null?void 0:U.getExtension)=="function"&&((M=U.getExtension("WEBGL_lose_context"))==null||M.loseContext());m=null,y=null,b=null,a=null;}return r}function n(){let r=!0,b=!0,a=new Set;location.protocol.startsWith("http")||a.add("httpProtocol"),f(window,["isSecureContext"],"boolean")&&!window.isSecureContext&&a.add("secureContext"),!f(navigator,["mediaDevices","getUserMedia"],"function")&&!f(navigator,["enumerateDevices"],"function")&&!f(window,["MediaStreamTrack","getSources"],"function")&&(a.add("mediaDevices"),r=!1),f(window,["Worker"],"function")||(a.add("webWorkers"),r=!1,b=!1),f(window,["WebAssembly"],"object")||(a.add("webAssembly"),r=!1,b=!1),f(window,["Blob"],"function")||(a.add("blob"),r=!1,b=!1),f(window,["URL","createObjectURL"],"function")||(a.add("urlObject"),r=!1,b=!1),f(window,["OffscreenCanvas"],"function")||a.add("offscreenCanvas"),o()||a.add("webGL");let m=c$1().getOS();return C(m)&&(a.add("webAssemblyErrorFree"),r=!1,b=!1),b$1()||a.add("sharedArrayBuffer"),a$1()||a.add("crossOriginIsolated"),{fullSupport:r,scannerSupport:b,missingFeatures:[...a]}}D.checkBrowserCompatibility=n;async function e$1(){return e()}D.checkMultithreadingSupport=e$1;function i(){let r="scandit-device-id",b="localStorage"in globalThis?globalThis.localStorage:void 0;if(!b)return "";let a=b.getItem(r);if(a!=null&&a!=="")return a;if(a=(0, Ee.get)(r),a!=null&&a!=="")return b.setItem(r,a),a;let m=new Uint8Array(20);return crypto.getRandomValues(m),a=[...m].map(y=>{let M=y.toString(16);return M.length===1?`0${M}`:M}).join(""),b.setItem(r,a),a}D.getDeviceId=i;function t(r){return r instanceof HTMLElement||r!=null&&typeof r=="object"&&typeof r.tagName=="string"}D.isValidHTMLElement=t;function E(){var m,y;let r=c$1().getOS();if(r.name!=="iOS")return !0;let[b,a]=(y=(m=r.version)==null?void 0:m.split(".").map(Number))!=null?y:[];return b>14||b===14&&a>=6}D.isSupportedIOSVersion=E;function L(){var a,m,y,M;let r=/iphone|ipod|ipad/.test((m=(a=c$1().getDevice().model)==null?void 0:a.toLowerCase())!=null?m:""),b=(M=(y=c$1().getBrowser().name)==null?void 0:y.toLowerCase().includes("safari"))!=null?M:!1;return r&&!b}D.isIosWebView=L;async function d$1(){var b;return ((b=c$1().getOS().name)==null?void 0:b.toLowerCase())!=="android"?!1:c$1().getUA().includes("wv")?!0:[...(await fetch(document.location.toString(),{method:"HEAD"})).headers].some(([a])=>a.toLowerCase()==="x-requested-with")}D.isAndroidWebView=d$1;function u(){return c$1().getOS().name==="Windows"}D.isWindows=u;function A(){return c$1().getBrowser().name==="Firefox"}D.isFirefox=A;function N(){if("navigator"in globalThis){for(let r of ["vibrate","webkitVibrate","msVibrate","mozVibrate"])if(typeof navigator[r]=="function")return navigator[r]}}D.getSupportedVibrationMethod=N;function G(){return N()!=null&&!P()&&!u()&&!A()}D.isVibrationAvailable=G;function F(){return c$1().getOS().name==="iOS"}D.isIOS=F;})(Ae||(Ae={}));
|
|
5
|
-
|
|
6
|
-
export { Ae as a };
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
var i=class{constructor(e){this.items=[];this.capacity=e.capacity,this.lowWaterMark=e.lowWaterMark,this.createItem=e.createItem;for(let t=0;t<this.capacity;t++)this.items.push(this.createItem());}get length(){return this.items.length}pop(){for(;this.isBelowOrEqualWaterMark();)this.items.unshift(this.createItem());return this.items.pop()}push(e){if(this.items.length<this.capacity)return this.items.push(e)}empty(){this.items.length=0;}isBelowOrEqualWaterMark(){return this.items.length<=this.lowWaterMark}};
|
|
2
|
-
|
|
3
|
-
export { i as a };
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
var o=class{constructor(r,e){var a,t;this._contextWebGL=r,this._maxPoolCapacity=(a=e==null?void 0:e.maxPoolCapacity)!=null?a:2,this._minPoolCapacity=(t=e==null?void 0:e.minPoolCapacity)!=null?t:1;}recycle(r){var e;(e=this._framePool)==null||e.push(r);}};
|
|
2
|
-
|
|
3
|
-
export { o as a };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { a } from './chunk-KWL7KLMR.js';
|
|
2
|
-
import { b } from './chunk-FTD535WI.js';
|
|
3
|
-
import { a as a$4 } from './chunk-AIRWHLJH.js';
|
|
4
|
-
import { a as a$3 } from './chunk-FGO2SSRS.js';
|
|
5
|
-
import { a as a$1 } from './chunk-QCRFVRSS.js';
|
|
6
|
-
import { a as a$2 } from './chunk-XR65N6EG.js';
|
|
7
|
-
|
|
8
|
-
var h=class{constructor(a$2,e){this.onMessageListener=this.onMessage.bind(this);this.workerSelf=a$2,this.dataCaptureInstance=new a(e,{postMessage:this.postMessage.bind(this),getOffscreenCanvas:this.getOffscreenCanvas.bind(this)}),a$1(a$2)&&this.listenToMessages();}listenToMessages(){this.workerSelf.addEventListener("message",this.onMessageListener),this.workerSelf.addEventListener("error",a=>{a$2.log(a$2.Level.Error,a);}),this.workerSelf.addEventListener("messageerror",a=>{a$2.log(a$2.Level.Error,a);});}postMessage(a,e){this.workerSelf.postMessage(a,e!=null?e:[]);}getOffscreenCanvas(){if(typeof this.workerSelf.OffscreenCanvas=="function")return new this.workerSelf.OffscreenCanvas(32,32)}hasPayload(a){return a$3(a)&&"payload"in a}hasTransferables(a){return a$3(a)&&Array.isArray(a.transferables)}async respondWith(a,e,u){let r=null,t;try{t=u(),t instanceof Promise&&(t=await t);}catch(l){t=void 0,r=a$4(l);}let i={type:"workerTaskId",command:a,id:e,payload:this.hasPayload(t)?t.payload:void 0};r!=null&&(i.error=r),this.postMessage(i,this.hasTransferables(t)?t.transferables:[]);}onMessage(a){switch(a.data.command){case"loadLibrary":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.loadLibrary({libraryLocation:e.libraryLocation,locationPath:e.locationPath,referredOrigin:e.referredOrigin,preloadEngine:e.preloadEngine,writableDataPathOverride:e.writableDataPathOverride,overrideThreadsSupport:e.overrideThreadsSupport,overrideSimdSupport:e.overrideSimdSupport,verifyResponseHash:e.verifyResponseHash}));}break}case"onTap":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>{this.dataCaptureInstance.onTap(e.point);});}break}case"hintPresenterV2update":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>{this.dataCaptureInstance.hintPresenterV2Update();});}break}case"createContext":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.createContext({context:e.context,deviceId:e.deviceId,delayedRegistration:e.delayedRegistration,highEndBlurryRecognition:e.highEndBlurryRecognition,appName:e.appName,parentDomain:e.parentDomain}));}break}case"setFrameSource":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.setFrameSource(e.mirrorAxis,e.isCameraFrameSource));}break}case"processFrame":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.processFrame({data:e.data,width:e.width,height:e.height,colorType:e.colorType}));}break}case"requestFrameData":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.requestFrameData(e.frameId));}break}case"deleteFrameData":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>{this.dataCaptureInstance.deleteFrameData(e.frameId);});}break}case"updateContext":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.updateContext(e));}break}case"dispose":{this.respondWith(a.data.command,a.data.id,()=>this.dataCaptureInstance.dispose());break}case"flushAnalytics":{this.respondWith(a.data.command,a.data.id,()=>{this.dataCaptureInstance.flushAnalytics();});break}case"reportCameraProperties":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.reportCameraProperties(e));}break}case"setLogLevel":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>{a$2.setLevel(e.level);});}break}case"extractCentaurusLicense":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.extractCentaurusLicense(e.licenseKey));}break}case"documentVisibility":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>{this.dataCaptureInstance.onDocumentVisibilityChange(e.state);});}break}case"isFeatureSupported":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.isFeatureSupported(e.feature));}break}case"getViewfinderInfo":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.getViewfinderInfo());}break}case"getOpenSourceSoftwareLicenseInfo":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.getOpenSourceSoftwareLicenseInfo());}break}default:return b(a.data),!1}return !0}};
|
|
9
|
-
|
|
10
|
-
export { h as a };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { a as a$4 } from './chunk-JS3T7K2Z.js';
|
|
2
|
-
import { a as a$5, b as b$1 } from './chunk-IH7SHTFM.js';
|
|
3
|
-
import { a as a$1 } from './chunk-KCNXUTBL.js';
|
|
4
|
-
import { a as a$3 } from './chunk-NMROJLGQ.js';
|
|
5
|
-
import { a as a$2 } from './chunk-7SW2PEHB.js';
|
|
6
|
-
import { a as a$6 } from './chunk-FGO2SSRS.js';
|
|
7
|
-
import { d } from './chunk-ZR62555L.js';
|
|
8
|
-
import { a as a$7 } from './chunk-XR65N6EG.js';
|
|
9
|
-
import { a } from './chunk-4FJRDG6T.js';
|
|
10
|
-
import { f } from './chunk-W7LJM2QO.js';
|
|
11
|
-
import { a as a$8 } from './chunk-WUHKODFA.js';
|
|
12
|
-
|
|
13
|
-
var b,D,x,i=class i{constructor(e,t){this.framework="web";this.runtimeEnvironment={deviceOS:(b=a.getUserAgentInfo().getOS().name)!=null?b:"",browser:(D=a.getUserAgentInfo().getBrowser().name)!=null?D:"",browserVersion:(x=a.getUserAgentInfo().getBrowser().version)!=null?x:"",get deviceModelName(){let{model:e,vendor:t}=a.getUserAgentInfo().getDevice();return (t==null||t==="")&&(t="Unknown"),(e==null||e==="")&&(e="Unknown"),[t,e].join(" ")}};this.settings=new a$2;this._frameSource=null;this._view=null;this.modes=new Set;this.components=[];this.listeners=[];this.updateListeners=new Set;this.cameraPropertiesReportListener=this.reportCameraProperties.bind(this);this.cameraAccessErrorListener=this.onCameraAccessError.bind(this);this.onWorkerMessageListener=this.onWorkerMessage.bind(this);this.onVisibilityChangeListener=this.onVisibilityChange.bind(this);this._frameHandlers=[];var a$1,r,p,l,c,C;this.licenseKey=e,this.deviceName=(a$1=t.deviceName)!=null?a$1:"",this.dataCaptureInstance=(r=t.dataCaptureInstance)!=null?r:a$3.mainDataCaptureLoader,this.delayedRegistration=(p=t.delayedRegistration)!=null?p:!1,this.highEndBlurryRecognition=(C=(c=(l=t.dataCaptureInstance)==null?void 0:l.highEndBlurryRecognition)!=null?c:a$3.mainDataCaptureLoader.highEndBlurryRecognition)!=null?C:!1;}get frameSource(){return this._frameSource}get workerCommand(){return this.dataCaptureInstance.workerCommand.bind(this.dataCaptureInstance)}static async create(){return i.createWithOptions({})}static async createWithOptions(e){var a;let t=new i((a=e.licenseKey)!=null?a:a$3.userLicenseKey,{deviceName:e.deviceName});return e.settings!=null&&await t.applySettings(e.settings),await t.initialize(),t}static async getOpenSourceSoftwareLicenseInfo(){let e=[];for(let a of i.moduleLicenseTextProviders){let r=await a.getLicenseText();e.push(r);}let t=e.join(`
|
|
14
|
-
|
|
15
|
-
`);return new a$4(t)}async setFrameSource(e){let t=e!==this._frameSource;if(this._frameSource!==null&&(this._frameSource.context=null),this._frameSource=e!=null?e:null,e&&(e.context=this,await this.workerCommand("setFrameSource",{mirrorAxis:this.getMirrorAxisForFrameSource(e),isCameraFrameSource:f(e)})),await this.update([{type:"frameSourceState",newValue:this.frameSource}]),t)for(let a of this.listeners)a.didChangeFrameSource&&a.didChangeFrameSource(this,this._frameSource);}addListener(e){this.listeners.includes(e)||this.listeners.push(e);}async flushAnalytics(){await this.workerCommand("flushAnalytics",{});}removeListener(e){this.listeners.includes(e)&&this.listeners.splice(this.listeners.indexOf(e),1);}async addMode(e){this.modes.add(e),await e.attachedToContext(this),await this.update();}async removeMode(e){this.modes.delete(e),await e.detachedFromContext(),await this.update();}async removeAllModes(){for(let e of this.modes)await this.removeMode(e);}async dispose(){d.instance().removeListener("cameraProperties",this.cameraPropertiesReportListener),d.instance().removeListener("cameraAccessError",this.cameraAccessErrorListener),this.unsubscribeToVisibilityChange(this.onVisibilityChangeListener),await this.workerCommand("dispose",{});}async applySettings(e){this.settings=e,await this.update();}toJSONObject(){var e,t;return {licenseKey:this.licenseKey,framework:this.framework,deviceName:this.deviceName,...this.runtimeEnvironment,modes:[...this.modes].filter(a=>!a.skipSerialization).map(a=>a.toJSONObject()),components:this.components.map(a=>a.toJSONObject()),frameSource:this.frameSource?this.frameSource.toJSONObject():null,settings:this.settings.toJSONObject(),view:(t=(e=this._view)==null?void 0:e.toJSONObject())!=null?t:null}}getView(){return this._view}async setView(e){return this._view=e,this.update([{type:"viewSet",newValue:e}])}async getAppName(){let e=null;if(a$5()){let t=await b$1();if((t==null?void 0:t.appName)==null||t.appName==="")throw new Error("Cannot retrieve electron appName. Did you set it up in package.json? https://www.electronjs.org/docs/latest/api/app#appgetname");e=t.appName;}return e}urlToHostname(e){try{return new URL(e!=null?e:"").hostname}catch(t){return ""}}getParentDomain(){var t;let e="";return parent!==window&&(e||(e=this.urlToHostname((t=location.ancestorOrigins)==null?void 0:t[0])),e||(e=this.urlToHostname(document.referrer)),e||(e="")),e.startsWith("[")&&e.at(-1)==="]"&&(e=e.slice(1,-1)),e}async initialize(e=!0){await this.workerCommand("createContext",{context:this.toJSONObject(),deviceId:i.deviceID,delayedRegistration:this.delayedRegistration,highEndBlurryRecognition:this.highEndBlurryRecognition,appName:await this.getAppName(),parentDomain:this.getParentDomain()}),this.subscribeToWorkerMessages(this.onWorkerMessageListener),e&&(this.subscribeToCameraManagerEvents(),this.subscribeToVisibilityChange(this.onVisibilityChangeListener));}subscribeToVisibilityChange(e){document.addEventListener("visibilitychange",e);}unsubscribeToVisibilityChange(e){document.removeEventListener("visibilitychange",e);}async requestFrameData(e){return this.workerCommand("requestFrameData",{frameId:e})}performanceMark(e){a$6(globalThis.performance)&&typeof globalThis.performance.mark=="function"&&performance.mark(e);}async sendFrameToProcessor(e){let t=e instanceof ImageData?{data:e.data,width:e.width,height:e.height}:e;return await this.sendFrameToHandlers(t)?(this.performanceMark("processFrameBeforeSDC"),this.sendFrameToSDC(t)):e}async sendFrameToHandlers(e){for(let t of this._frameHandlers)if(await t(e)==="skip")return !1;return !0}async sendFrameToSDC(e){return this.workerCommand("processFrame",e,[e.data.buffer])}registerFrameHandler(e){this._frameHandlers.includes(e)||this._frameHandlers.push(e);}unregisterFrameHandler(e){this._frameHandlers.includes(e)&&this._frameHandlers.splice(this._frameHandlers.indexOf(e),1);}onVisibilityChange(){this.workerCommand("documentVisibility",{state:document.visibilityState});}onWorkerMessage(e){if(e.type==="contextDidChangeStatus"){e.payload.isValid||a$7.log(a$7.Level.Error,e.payload);for(let t of this.listeners)t.didChangeStatus&&t.didChangeStatus(this,a$8.fromJSON(e.payload));}if(e.type==="didStartObservingContext")for(let t of this.listeners)t.didStartObservingContext&&t.didStartObservingContext(this);e.type==="onFrameProcessingFinished"&&this.performanceMark("processFrameAfterSDC");}subscribeToCameraManagerEvents(){d.instance().addListener("cameraProperties",this.cameraPropertiesReportListener),d.instance().addListener("cameraAccessError",this.cameraAccessErrorListener);}async reportCameraProperties(e){return this.workerCommand("reportCameraProperties",e)}onCameraAccessError(e){for(let t of this.listeners)t.didChangeStatus&&t.didChangeStatus(this,a$8.fromJSON({code:33794,isValid:!0,message:e.toString()}));}async update(e=[]){var t,a;await this.updateContext();for(let r of e){switch(r.type){case"frameSourceState":{await((t=this._view)==null?void 0:t.onFrameSourceChange(this.frameSource));break}case"singleImageModeUploaderSettings":{(a=this._view)==null||a.onSingleImageUploaderSettingsChange(r.newValue);break}}for(let p of this.updateListeners)p(r);}}async updateContext(){await this.workerCommand("updateContext",{context:this.toJSONObject(),...this.getViewInfo()}).catch(e=>{a$7.log(a$7.Level.Warn,"Error while updating context:",e);});}getViewInfo(){return this._view!=null?{view:{width:this._view.width,height:this._view.height,visible:this._view.width>0&&this._view.height>0,orientation:this._view.orientation}}:{view:null}}getMirrorAxisForFrameSource(e){let t="None";return f(e)&&e.getMirrorImageEnabled()&&(t="Y"),t}async addComponent(e){if(!this.components.includes(e))return this.components.push(e),e._context=this,this.update()}subscribeToWorkerMessages(e){this.dataCaptureInstance.addWorkerListener(e);}unsubscribeToWorkerMessages(e){this.dataCaptureInstance.removeWorkerListener(e);}hasEnabledMode(){return [...this.modes].some(e=>e.isEnabled())}async isFeatureSupported(e){return (await this.workerCommand("isFeatureSupported",{feature:e})).supported}};i.deviceID=a.getDeviceId(),i.moduleLicenseTextProviders=[new a$1];var w=i;
|
|
16
|
-
|
|
17
|
-
export { w as a };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { a as a$1 } from './chunk-R6E4CT22.js';
|
|
2
|
-
import { a as a$4 } from './chunk-YGNHN5OT.js';
|
|
3
|
-
import { b } from './chunk-MOF3P7VK.js';
|
|
4
|
-
import { a } from './chunk-JKL2W65E.js';
|
|
5
|
-
import { d } from './chunk-SXOL25UA.js';
|
|
6
|
-
import { a as a$3 } from './chunk-XR65N6EG.js';
|
|
7
|
-
import { a as a$5 } from './chunk-QCZSSQAQ.js';
|
|
8
|
-
import { a as a$2 } from './chunk-4FJRDG6T.js';
|
|
9
|
-
|
|
10
|
-
var w=(r=>(r.CONTINUOUS="continuous",r.MANUAL="manual",r.NONE="none",r.SINGLE_SHOT="single-shot",r))(w||{}),y=(s=>(s[s.ULTRA_HD=0]="ULTRA_HD",s[s.FULL_HD=1]="FULL_HD",s[s.HD=2]="HD",s[s.SD=3]="SD",s[s.NONE=4]="NONE",s))(y||{}),L=(t=>(t.CAMERA_PROPERTIES="cameraProperties",t.CAMERA_ACCESS_ERROR="cameraAccessError",t))(L||{}),n=class n{constructor(){this.checkCameraVideoStreamAccessIfVisibleListener=this.checkCameraVideoStreamAccessIfVisible.bind(this);this.handleWebGLContextLostListener=this.handleWebGLContextLost.bind(this);this.listeners=new Map;this.mirrorImageOverrides=new Map;this.postStreamInitializationListener=this.postStreamInitialization.bind(this);this.triggerManualFocusListener=this.triggerManualFocus.bind(this);this.triggerZoomMoveListener=this.triggerZoomMove.bind(this);this.triggerZoomStartListener=this.triggerZoomStart.bind(this);this.videoResizeListener=a$1(this.handleVideoResize.bind(this),500);this.videoTrackEndedListener=this.videoTrackEndedRecovery.bind(this);this.videoTrackMuteListener=this.videoTrackMuteRecovery.bind(this);this._glFrameReaders={GRAYSCALE:null,RGBA:null,current:null};this._frameReaderType="RGBA";this.cameraPosition="worldFacing",this.gui={isCameraRecoveryVisible:()=>!1,setCameraRecoveryVisible:()=>{}},this.isWebGLSupported=!a$2.checkBrowserCompatibility().missingFeatures.includes("webGL"),this.videoElement=document.createElement("video"),this.canvas=document.createElement("canvas"),this.canvas.addEventListener("webglcontextlost",this.handleWebGLContextLostListener);}get mediaStream(){return this._mediaStream}set mediaStream(e){this._mediaStream=e,e&&(this.mediaTrackCapabilitiesPromise=new Promise(t=>{this.mediaTrackCapabilitiesPromiseResolver=t;}));}get canvas2dContext(){return this._canvas2dContext||(this._canvas2dContext=this.canvas.getContext("2d",{willReadFrequently:!0}),this._canvas2dContext==null&&a$3.log(a$3.Level.Warn,"Unable to get 2d canvas context"),this.handleVideoResize()),this._canvas2dContext}get canvasWebGLContext(){var e;if(!this._canvas2dContext&&!this._canvasWebGLContext){if(!this.isWebGLSupported){a$3.log(a$3.Level.Warn,"WebGL context not supported, falling back to 2d canvas context. This may impact the scanning performance.");return}let t=(e=this.canvas.getContext("webgl",{alpha:!1,antialias:!1}))!=null?e:this.canvas.getContext("experimental-webgl",{alpha:!1,antialias:!1});if(t!=null){this._canvasWebGLContext=t;let i=a$2.isDesktopDevice()?{maxPoolCapacity:2,minPoolCapacity:1}:{maxPoolCapacity:10,minPoolCapacity:3};this._glFrameReaders.GRAYSCALE=new a$4(t,i),this._glFrameReaders.RGBA=new b(t,i),this._glFrameReaders.current=this._glFrameReaders[this._frameReaderType],a$3.log(a$3.Level.Debug,`Frame will be sent in ${this._frameReaderType} mode`),this.handleVideoResize();}}return this._canvasWebGLContext}static instance(){return n._instance==null&&(n._instance=new n),n._instance}recycle(e){var t;(t=this._glFrameReaders.current)==null||t.recycle(e);}getCurrentFrame(){var e;return (e=this._glFrameReaders.RGBA)==null?void 0:e.readFromSource(this.videoElement)}requestVideoFrame(e){return "requestVideoFrameCallback"in HTMLVideoElement.prototype?this.videoElement.requestVideoFrameCallback(e):requestAnimationFrame(e)}cancelVideoFrame(e){if("cancelVideoFrameCallback"in HTMLVideoElement.prototype){this.videoElement.cancelVideoFrameCallback(e);return}cancelAnimationFrame(e);}addListener(e,t){var r;let i=(r=this.listeners.get(e))!=null?r:[];i.includes(t)||this.listeners.set(e,[...i,t]);}async applyCameraSettings(e){if(this.selectedCameraSettings=e,this.activeCamera==null)throw new a$5(n.noCameraErrorParameters);return this.initializeCameraWithSettings(this.activeCamera,e)}captureImage(){var e;if(((e=this.mediaStream)==null?void 0:e.active)!=null){if(this.canvasWebGLContext!=null)return this.captureImageForWebGLContext();if(this.canvas2dContext!=null)return this.captureImageFor2dContext()}return null}async initializeCameraWithSettings(e,t){if(this.cameraInitializationPromise&&await this.cameraInitializationPromise,e==null)throw new a$5(n.noCameraErrorParameters);return this.setSelectedCamera(e),this.selectedCameraSettings=t,this.activeCameraSettings=t,this.cameraInitializationPromise=this.initializeCameraAndCheckUpdatedSettings(e),this.cameraInitializationPromise}isMirrorImageEnabled(){if(this.selectedCamera&&this.activeCamera){let e=this.mirrorImageOverrides.get(this.activeCamera);return e!=null?e:this.activeCamera.position==="userFacing"}return !1}isPinchToZoomEnabled(){return this.pinchToZoomEnabled}isTapToFocusEnabled(){return this.tapToFocusEnabled}async isTorchAvailable(){var e;return this.mediaStream?(await this.waitForCapabilities(),((e=this.mediaTrackCapabilities)==null?void 0:e.torch)===!0):!1}async playVideo(){return new Promise(e=>{this._canvas2dContext&&this._canvas2dContext.clearRect(0,0,this.canvas.width,this.canvas.height);let t=this.videoElement.play();t==null?e():t.then(e).catch(()=>{e();});})}async reinitializeCamera(){if(this.activeCamera==null)a$3.log(a$3.Level.Debug,"Camera reinitialization delayed");else {a$3.log(a$3.Level.Debug,"Reinitialize camera:",this.activeCamera);try{let e=this.activeCamera;await this.stopStream(),await this.initializeCameraWithSettings(e,this.activeCameraSettings);}catch(e){throw a$3.log(a$3.Level.Warn,"Couldn't access camera:",this.activeCamera,e),this.emit("cameraAccessError",e),e}}}removeListener(e,t){var s;let r=((s=this.listeners.get(e))!=null?s:[]).filter(o=>o!==t);this.listeners.set(e,r);}async setCameraPosition(e){var i;this.setInitialCameraPosition(e);let t=d.getMainCameraForPosition(await d.getCameras(),e);if(t&&t.deviceId!==((i=this.selectedCamera)==null?void 0:i.deviceId))return this.initializeCameraWithSettings(t,this.selectedCameraSettings)}async setExposure(e){var r,s,o,m,d,l,v,p;let t=(s=(r=this.mediaStream)==null?void 0:r.getVideoTracks())!=null?s:[];if(t.length===0||typeof t[0].applyConstraints!="function")return;await this.waitForCapabilities();let i=e.time!=null&&e.time>0?"manual":"continuous";if(((m=(o=this.mediaTrackCapabilities)==null?void 0:o.exposureMode)==null?void 0:m.includes(i))===!0){if(await t[0].applyConstraints({advanced:[{exposureMode:i}]}),e.time!=null&&e.time>0&&this.mediaTrackCapabilities.exposureTime){let h=Math.max((d=this.mediaTrackCapabilities.exposureTime.min)!=null?d:.01,Math.min(e.time,(l=this.mediaTrackCapabilities.exposureTime.max)!=null?l:1e5));await t[0].applyConstraints({advanced:[{exposureTime:h}]});}else if(e.compensation!=null&&i==="continuous"&&this.mediaTrackCapabilities.exposureCompensation){let h=Math.max((v=this.mediaTrackCapabilities.exposureCompensation.min)!=null?v:-10,Math.min(e.compensation,(p=this.mediaTrackCapabilities.exposureCompensation.max)!=null?p:10));await t[0].applyConstraints({advanced:[{exposureCompensation:h}]});}}}async setFocus(e){var i,r,s,o,m;if(!this.mediaStream)return;let t=this.mediaStream.getVideoTracks();if(t.length>0&&typeof t[0].applyConstraints=="function"){await this.waitForCapabilities();let d=e>=0?"manual":"continuous";if(((r=(i=this.mediaTrackCapabilities)==null?void 0:i.focusMode)==null?void 0:r.includes(d))===!0&&(await t[0].applyConstraints({advanced:[{focusMode:d}]}),d==="manual"&&this.mediaTrackCapabilities.focusDistance)){let l=Math.max(0,Math.min(e,1))*(((s=this.mediaTrackCapabilities.focusDistance.max)!=null?s:1e3)-((o=this.mediaTrackCapabilities.focusDistance.min)!=null?o:.01))+((m=this.mediaTrackCapabilities.focusDistance.min)!=null?m:.01);await t[0].applyConstraints({advanced:[{focusDistance:l}]});}}}async setFrameRate(e){var t,i,r;if(this.mediaStream&&(await this.waitForCapabilities(),(t=this.mediaTrackCapabilities)!=null&&t.frameRate)){let s=this.mediaStream.getVideoTracks();if(s.length>0&&typeof s[0].applyConstraints=="function"){let o=Math.min((i=this.mediaTrackCapabilities.frameRate.max)!=null?i:240,(r=e.max)!=null?r:240);await s[0].applyConstraints({advanced:[{frameRate:o}]});}}}setInitialCameraPosition(e){this.cameraPosition=e;}setInteractionOptions(e,t,i){this.torchToggleEnabled=e,this.tapToFocusEnabled=t,this.pinchToZoomEnabled=i;}setMirrorImageEnabled(e,t){this.selectedCamera&&(e?(this.videoElement.classList.add(n.MIRRORED_CLASS_NAME),this.canvas.classList.add(n.MIRRORED_CLASS_NAME)):(this.videoElement.classList.remove(n.MIRRORED_CLASS_NAME),this.canvas.classList.remove(n.MIRRORED_CLASS_NAME)),t&&this.mirrorImageOverrides.set(this.selectedCamera,e));}setPinchToZoomEnabled(e){this.pinchToZoomEnabled=e,this.mediaStream&&(this.pinchToZoomEnabled?this.enablePinchToZoomListeners():this.disablePinchToZoomListeners());}setSelectedCamera(e){this.selectedCamera=e;}setSelectedCameraSettings(e){this.selectedCameraSettings=e;}setTapToFocusEnabled(e){this.tapToFocusEnabled=e,this.mediaStream&&(this.tapToFocusEnabled?this.enableTapToFocusListeners():this.disableTapToFocusListeners());}async setTorchEnabled(e){var t;if(this.mediaStream&&((t=this.mediaTrackCapabilities)==null?void 0:t.torch)===!0){this.torchEnabled=e;let i=this.mediaStream.getVideoTracks();i.length>0&&typeof i[0].applyConstraints=="function"&&await i[0].applyConstraints({advanced:[{torch:e}]});}}async setZoom(e){var t,i,r;if(this.mediaStream&&(await this.waitForCapabilities(),(t=this.mediaTrackCapabilities)!=null&&t.zoom)){let s=this.mediaStream.getVideoTracks();if(s.length>0&&typeof s[0].applyConstraints=="function"){let o=Math.max((i=this.mediaTrackCapabilities.zoom.min)!=null?i:1,Math.min(e,(r=this.mediaTrackCapabilities.zoom.max)!=null?r:16));await s[0].applyConstraints({advanced:[{zoom:o}]});}}}async setupCameras(){return this.cameraSetupPromise?this.cameraSetupPromise:(this.cameraSetupPromise=this.setupCamerasAndStream(),this.cameraSetupPromise)}pauseStream(){if(!this.mediaStream)return;let e=this.mediaStream.getVideoTracks()[0];e.enabled=!1,a$3.log(a$3.Level.Debug,"Pause camera video stream",this.mediaStream);}resumeStream(){if(!this.mediaStream)return;let e=this.mediaStream.getVideoTracks()[0];e.enabled=!0,a$3.log(a$3.Level.Debug,"Resume camera video stream",this.mediaStream);}async stopStream(e=!1){this.activeCamera&&(this.activeCamera.currentResolution=void 0),this.activeCamera=void 0,this.torchEnabled=!1,this.mediaStream&&(a$3.log(a$3.Level.Debug,`Stop camera video stream access${e?" (abort access detection)":""}:`,this.mediaStream),document.removeEventListener("visibilitychange",this.checkCameraVideoStreamAccessIfVisibleListener),window.clearTimeout(this.cameraAccessTimeout),window.clearInterval(this.videoMetadataCheckInterval),window.clearTimeout(this.getCapabilitiesTimeout),window.clearTimeout(this.manualFocusWaitTimeout),window.clearTimeout(this.manualToAutofocusResumeTimeout),window.clearInterval(this.autofocusInterval),this.videoElement.pause(),await new Promise(t=>{setTimeout(()=>{var i,r,s;for(let o of (r=(i=this.mediaStream)==null?void 0:i.getVideoTracks())!=null?r:[])o.removeEventListener("ended",this.videoTrackEndedListener),o.stop();this.videoElement.srcObject=null,this._canvas2dContext&&this._canvas2dContext.clearRect(0,0,this.canvas.width,this.canvas.height),this.mediaStream=void 0,this.mediaTrackCapabilities=void 0,this.mediaTrackCapabilitiesPromise=void 0,this.mediaTrackCapabilitiesPromiseResolver=void 0,e||(s=this.abortedCameraInitializationResolveCallback)==null||s.call(this),t();},0);}));}stopVideoTracks(){if(this.mediaStream!=null)for(let e of this.mediaStream.getVideoTracks())e.stop();}async toggleTorch(){this.torchEnabled=!this.torchEnabled,await this.setTorchEnabled(this.torchEnabled);}updateCanvasVideoImage(){this.canvas2dContext.drawImage(this.videoElement,0,0);}async waitForCapabilities(){var e;return (e=this.mediaTrackCapabilitiesPromise)!=null?e:Promise.resolve()}setFrameReaderType(e){this._frameReaderType=e,this._glFrameReaders.current=this._glFrameReaders[e],a$3.log(a$3.Level.Debug,`Change frame reader type. Frames will be sent in ${this._frameReaderType} mode`);}async allowPictureInPicture(e){e?(this.videoElement.disablePictureInPicture=!1,this.videoElement.removeAttribute("controlslist"),this.videoElement.removeAttribute("disablepictureinpicture")):(this.videoElement.disablePictureInPicture=!0,this.videoElement.setAttribute("controlslist","nodownload"),this.videoElement.setAttribute("disablepictureinpicture","true")),await this.reinitializeCamera();}async accessAutoselectedCamera(e){let t=d.sortCamerasForCameraPosition(e,this.cameraPosition),i=t.shift();for(;i;)try{await this.initializeCameraWithSettings(i,this.selectedCameraSettings);return}catch(r){if(this.setSelectedCamera(),t.length>0){a$3.log(a$3.Level.Warn,"Couldn't access camera:",i,r),i=t.shift();continue}throw r}throw new a$5(n.noCameraErrorParameters)}async accessInitialCamera(){let e={position:this.cameraPosition,deviceId:"",label:""};try{await this.initializeCameraWithSettings(e,this.selectedCameraSettings);}catch(t){}finally{this.setSelectedCamera();}return e}recreateCanvas(){this.canvas.removeEventListener("webglcontextlost",this.handleWebGLContextLostListener),this._canvasWebGLContext=void 0,this._canvas2dContext=void 0;for(let t of Object.values(this._glFrameReaders))t==null||t.dispose();let e=document.createElement("canvas");e.addEventListener("webglcontextlost",this.handleWebGLContextLostListener),e.width=this.canvas.width,e.height=this.canvas.height,e.className=this.canvas.className,this.canvas=e;}captureImageFor2dContext(){if(!this.isVideoAndContextStateValid())return null;let{width:e,height:t}=this.canvas;return {colorType:"RGBA",data:this.canvas2dContext.getImageData(0,0,e,t).data,width:e,height:t}}areVideoAndWebGLSizeMismatching(){return this.canvasWebGLContext?this.canvasWebGLContext.drawingBufferWidth!==this.videoElement.videoWidth||this.canvasWebGLContext.drawingBufferHeight!==this.videoElement.videoHeight:!0}captureImageForWebGLContext(){if(!this.isVideoAndContextStateValid()||!this.canvasWebGLContext||this.canvasWebGLContext.drawingBufferWidth<=2||this.canvasWebGLContext.drawingBufferHeight<=2||this.areVideoAndWebGLSizeMismatching()||this._glFrameReaders.current==null)return null;let e=this._glFrameReaders.current.readFromSource(this.videoElement);if(e.data[3]!==255&&e.colorType==="RGBA"){if(a$3.log(a$3.Level.Warn,"Detected incorrect GPU accelerated WebGL image processing, switching to canvas mode"),this.recreateCanvas(),this.canvas2dContext==null)throw new Error("Unable to get 2d canvas context");return this.captureImage()}return e}async checkCameraAccess(e){return new Promise((t,i)=>{this.cameraAccessRejectCallback=r=>{a$3.log(a$3.Level.Debug,"Camera video stream access failure (video data load timeout):",e),this.gui.setCameraRecoveryVisible(!0),i(r);},this.setCameraAccessTimeout();})}checkCameraVideoStreamAccessIfVisible(){document.visibilityState==="visible"&&(a$3.log(a$3.Level.Debug,"Page is visible again, waiting for camera video stream start..."),document.removeEventListener("visibilitychange",this.checkCameraVideoStreamAccessIfVisibleListener),this.setCameraAccessTimeout());}async checkVideoMetadata(e){return new Promise((t,i)=>{this.videoElement.onloadeddata=()=>{if(this.videoElement.onloadeddata=null,window.clearTimeout(this.cameraAccessTimeout),this.videoElement.videoWidth>2&&this.videoElement.videoHeight>2&&this.videoElement.currentTime>0){this.updateActiveCameraCurrentResolution(e),a$3.log(a$3.Level.Debug,"Camera video stream access success:",e),t();return}let r=performance.now();window.clearInterval(this.videoMetadataCheckInterval),this.videoMetadataCheckInterval=window.setInterval(async()=>{if(this.videoElement.videoWidth<=2||this.videoElement.videoHeight<=2||this.videoElement.currentTime===0){if(performance.now()-r>n.videoMetadataCheckTimeoutMs){a$3.log(a$3.Level.Warn,"Camera video stream access failure (valid video metadata timeout):",e),window.clearInterval(this.videoMetadataCheckInterval),await this.stopStream(!0),i(new a$5(n.notReadableErrorParameters));return}return}window.clearInterval(this.videoMetadataCheckInterval),this.updateActiveCameraCurrentResolution(e),a$3.log(a$3.Level.Debug,"Camera video stream access success:",e),t();},n.videoMetadataCheckIntervalMs);};})}disablePinchToZoomListeners(){this.videoElement.removeEventListener("touchstart",this.triggerZoomStartListener),this.videoElement.removeEventListener("touchmove",this.triggerZoomMoveListener);}disableTapToFocusListeners(){for(let e of ["touchend","mousedown"])this.videoElement.removeEventListener(e,this.triggerManualFocusListener);}emit(e,t){var r;let i=(r=this.listeners.get(e))!=null?r:[];for(let s of i)s(t);}enablePinchToZoomListeners(){this.videoElement.addEventListener("touchstart",this.triggerZoomStartListener),this.videoElement.addEventListener("touchmove",this.triggerZoomMoveListener);}enableTapToFocusListeners(){for(let e of ["touchend","mousedown"])this.videoElement.addEventListener(e,this.triggerManualFocusListener);}getActiveCamera(e,t,i){return e.length===1?e[0]:e.find(r=>r.deviceId===i||r.label!==""&&r.label===t)}getInitialCameraResolutionConstraint(e){var i;let t;switch((i=this.activeCameraSettings)==null?void 0:i.preferredResolution){case"uhd4k":{t=0;break}case"fullHd":{t=1;break}case"hd":default:{t=2;break}}return t}async handleCameraInitializationError(e,t,i){if(!["OverconstrainedError","NotReadableError"].includes(i.name)||i.name==="NotReadableError"&&t===4)throw a$3.log(a$3.Level.Debug,"Camera video stream access failure (unrecoverable error)",e,i),i.name!=="NotAllowedError"&&d.markCameraAsInaccessible(e),i;if(i.name==="OverconstrainedError"&&t===4){if(e.deviceId==="")throw a$3.log(a$3.Level.Warn,"Camera video stream access failure (no camera with such type error)",e,i),i;a$3.log(a$3.Level.Warn,"Detected non-existent deviceId error, attempt to find and reaccess updated camera",e,i);let r=e.deviceId;if(await d.getCameras(!0),r===e.deviceId)throw a$3.log(a$3.Level.Warn,"Camera video stream access failure (updated camera not found after non-existent deviceId error)",e,i),d.markCameraAsInaccessible(e),i;return a$3.log(a$3.Level.Warn,"Updated camera found (recovered from non-existent deviceId error), attempt to access it",e),this.initializeCameraForResolution(e)}return this.initializeCameraForResolution(e,t+1)}handleVideoResize(){if(!(this.videoElement.videoWidth<=2||this.videoElement.videoHeight<=2)){if(this.activeCamera&&this.updateActiveCameraCurrentResolution(this.activeCamera),this.canvasWebGLContext!=null){if(this.canvas.width===this.videoElement.videoWidth&&this.canvas.height===this.videoElement.videoHeight)return;this.canvas.width=this.videoElement.videoWidth,this.canvas.height=this.videoElement.videoHeight,this.canvasWebGLContext.viewport(0,0,this.canvasWebGLContext.drawingBufferWidth,this.canvasWebGLContext.drawingBufferHeight);}else if(this.canvas2dContext!=null){if(this.canvas.width===this.videoElement.videoWidth&&this.canvas.height===this.videoElement.videoHeight)return;this.canvas.width=this.videoElement.videoWidth,this.canvas.height=this.videoElement.videoHeight;}}}handleWebGLContextLost(){a$3.log(a$3.Level.Warn,"WebGL context has been lost, restoring..."),this._canvasWebGLContext=void 0,this.canvasWebGLContext?(this.handleVideoResize(),a$3.log(a$3.Level.Warn,"WebGL context restored")):a$3.log(a$3.Level.Error,"WebGL context restore failed");}async initializeCameraAndCheckUpdatedSettings(e){var t,i,r,s,o;try{if(await this.initializeCameraForResolution(e),this.selectedCameraSettings!==this.activeCameraSettings&&(this.selectedCameraSettings==null||this.activeCameraSettings==null||Object.keys(this.selectedCameraSettings).some(h=>{var g,b;return ((g=this.selectedCameraSettings)==null?void 0:g[h])!==((b=this.activeCameraSettings)==null?void 0:b[h])}))){this.activeCameraSettings=this.selectedCameraSettings,await this.initializeCameraAndCheckUpdatedSettings(e);return}this.activeCameraSettings&&this.activeCameraSettings.zoomFactor>1&&await this.setZoom(this.activeCameraSettings.zoomFactor);let m=(t=this.activeCameraSettings)==null?void 0:t.getProperty("minFrameRate"),d=(i=this.activeCameraSettings)==null?void 0:i.getProperty("maxFrameRate");(m!=null||d!=null)&&await this.setFrameRate({min:m,max:d});let l=(r=this.activeCameraSettings)==null?void 0:r.getProperty("manualLensPosition");l!=null&&await this.setFocus(l);let v=(s=this.activeCameraSettings)==null?void 0:s.getProperty("exposureTargetBias"),p=(o=this.activeCameraSettings)==null?void 0:o.getProperty("exposureDuration");(v!=null||p!=null)&&await this.setExposure({compensation:v,time:p});}finally{this.cameraInitializationPromise=void 0;}}async initializeCameraForResolution(e,t){var r;this.gui.setCameraRecoveryVisible(!1);let i=t!=null?t:this.getInitialCameraResolutionConstraint(e);this.mediaStream!=null&&e.deviceId!==""&&((r=this.activeCamera)==null?void 0:r.deviceId)===e.deviceId?await(a$2.isIPhone()?this.initializeStreamForResolution(e,i):this.updateStreamForResolution(e,i)):await this.initializeStreamForResolution(e,i);}async initializeStreamForResolution(e,t){var i;await this.stopStream();try{let r=(i=this.activeCameraSettings)==null?void 0:i.getProperty("preferredAspectRatio"),s=await d.accessCameraStream(e,t,r);if(a$3.log(a$3.Level.Debug,"Camera accessed, waiting for camera video stream start..."),typeof s.getVideoTracks()[0].getSettings=="function"){let o=s.getVideoTracks()[0].getSettings();if(o.width!=null&&o.height!=null&&(o.width===2||o.height===2)){if(a$3.log(a$3.Level.Debug,"Camera video stream access failure (invalid video metadata):",e),t===4)throw new a$5(n.notReadableErrorParameters);return await this.stopStream(),this.initializeStreamForResolution(e,t+1)}}this.mediaStream=s;for(let o of this.mediaStream.getVideoTracks())o.addEventListener("ended",this.videoTrackEndedListener),o.addEventListener("mute",this.videoTrackMuteListener),o.addEventListener("unmute",this.videoTrackMuteListener);try{await this.setupCameraStreamVideo(e,s);}catch(o){if(t===4)throw o;return this.initializeStreamForResolution(e,t+1)}}catch(r){return this.handleCameraInitializationError(e,t,r)}}isVideoAndContextStateValid(){return this.videoElement.readyState===4&&this.videoElement.videoWidth>2&&this.videoElement.videoHeight>2&&this.canvas.width>2&&this.canvas.height>2}postStreamInitialization(){window.clearTimeout(this.getCapabilitiesTimeout),this.getCapabilitiesTimeout=window.setTimeout(()=>{this.storeStreamCapabilities(),this.setupAutofocus();},n.getCapabilitiesTimeoutMs);}async recoverStreamIfNeeded(){var t,i;let e=(t=this.mediaStream)==null?void 0:t.getVideoTracks();((i=e==null?void 0:e[0])==null?void 0:i.readyState)==="ended"&&await this.reinitializeCamera();}reportCameraProperties(e,t,i=!0){this.emit("cameraProperties",{deviceId:e,isFrontFacing:t==="userFacing",hasAutofocus:i});}setCameraAccessTimeout(){window.clearTimeout(this.cameraAccessTimeout),this.cameraAccessTimeout=window.setTimeout(async()=>{var e;document.visibilityState==="visible"?(await this.stopStream(!0),(e=this.cameraAccessRejectCallback)==null||e.call(this,new a$5(n.notReadableErrorParameters))):(a$3.log(a$3.Level.Debug,"Page is currently not visible, delay camera video stream access detection"),document.addEventListener("visibilitychange",this.checkCameraVideoStreamAccessIfVisibleListener));},n.cameraAccessTimeoutMs);}setupAutofocus(){if(window.clearTimeout(this.manualFocusWaitTimeout),window.clearTimeout(this.manualToAutofocusResumeTimeout),this.mediaStream&&this.mediaTrackCapabilities){let e=this.mediaTrackCapabilities.focusMode;Array.isArray(e)&&!e.includes("continuous")&&e.includes("single-shot")&&(window.clearInterval(this.autofocusInterval),this.autofocusInterval=window.setInterval(this.triggerAutoFocus.bind(this),n.autofocusIntervalMs));}}async setupCameraStreamVideo(e,t){this.videoElement.addEventListener("loadedmetadata",this.postStreamInitializationListener),this.videoElement.addEventListener("resize",this.videoResizeListener),this.tapToFocusEnabled&&this.enableTapToFocusListeners(),this.pinchToZoomEnabled&&this.enablePinchToZoomListeners();let i=Promise.race([this.checkCameraAccess(e),this.checkVideoMetadata(e),new Promise(r=>{this.abortedCameraInitializationResolveCallback=r;})]);return this.videoElement.srcObject=t,this.videoElement.load(),await this.playVideo(),this.handleVideoResize(),this.reportCameraProperties(e.deviceId,e.position),i}async setupCamerasAndStream(){var e,t;try{let i;this.selectedCamera==null&&(i=await this.accessInitialCamera());let r=await d.getCameras(!1,!0),s=(t=(e=this.mediaStream)==null?void 0:e.getVideoTracks()[0])==null?void 0:t.getSettings().deviceId;if(this.mediaStream&&i){let o=this.getActiveCamera(r,i.label,s);if(o){if(d.adjustCameraFromMediaStream(this.mediaStream,o),a$2.isDesktopDevice()&&(d.setMainCameraForPositionOverridesOnDesktop(this.cameraPosition,o),d.setMainCameraForPositionOverridesOnDesktop(o.position,o)),r.length===1||d.getMainCameraForPosition(r,this.cameraPosition)===o){a$3.log(a$3.Level.Debug,"Initial camera access was correct (main camera), keep camera:",o),this.setSelectedCamera(o),this.updateActiveCameraCurrentResolution(o),await this.recoverStreamIfNeeded();return}a$3.log(a$3.Level.Debug,"Initial camera access was incorrect (not main camera), change camera",{...i,deviceId:s});}else a$3.log(a$3.Level.Debug,"Initial camera access was incorrect (unknown camera), change camera",{...i,deviceId:s});}if(this.selectedCamera==null){await this.accessAutoselectedCamera(r);return}await this.initializeCameraWithSettings(this.selectedCamera,this.selectedCameraSettings);}finally{this.cameraSetupPromise=void 0;}}storeStreamCapabilities(){var e;if(this.mediaStream){let t=this.mediaStream.getVideoTracks();t.length>0&&typeof t[0].getCapabilities=="function"&&(this.mediaTrackCapabilities=t[0].getCapabilities()),this.mediaTrackCapabilitiesPromiseResolver&&this.mediaTrackCapabilitiesPromiseResolver();}this.activeCamera&&this.reportCameraProperties(this.activeCamera.deviceId,this.activeCamera.position,((e=this.mediaTrackCapabilities)==null?void 0:e.focusMode)==null||this.mediaTrackCapabilities.focusMode.includes("continuous"));}async triggerAutoFocus(){await this.triggerFocusMode("single-shot");}async triggerFocusMode(e){if(this.mediaStream){let t=this.mediaStream.getVideoTracks();if(t.length>0&&typeof t[0].applyConstraints=="function")try{await t[0].applyConstraints({advanced:[{focusMode:e}]});}catch(i){}}}async triggerManualFocus(e){if(e){if(e.preventDefault(),e.type==="touchend"&&e.touches.length>0)return;if(this.pinchToZoomDistance!=null){this.pinchToZoomDistance=void 0;return}}if(window.clearTimeout(this.manualFocusWaitTimeout),window.clearTimeout(this.manualToAutofocusResumeTimeout),!this.mediaStream||!this.mediaTrackCapabilities)return;let t=this.mediaTrackCapabilities.focusMode;Array.isArray(t)&&t.includes("single-shot")&&(t.includes("continuous")&&t.includes("manual")?await this.triggerManualFocusForContinuous():t.includes("continuous")||await this.triggerManualFocusForSingleShot());}async triggerManualFocusForContinuous(){var i;if(!this.mediaStream)return;this.manualToAutofocusResumeTimeout=window.setTimeout(async()=>{await this.triggerFocusMode("continuous");},n.manualToAutofocusResumeTimeoutMs);let e=!0,t=this.mediaStream.getVideoTracks();t.length>0&&typeof t[0].getConstraints=="function"&&(e=((i=t[0].getConstraints().advanced)==null?void 0:i.some(r=>r.focusMode==="manual"))===!0),e?(await this.triggerFocusMode("continuous"),this.manualFocusWaitTimeout=window.setTimeout(async()=>{await this.triggerFocusMode("manual");},n.manualFocusWaitTimeoutMs)):await this.triggerFocusMode("manual");}async triggerManualFocusForSingleShot(){window.clearInterval(this.autofocusInterval),this.manualToAutofocusResumeTimeout=window.setTimeout(()=>{this.autofocusInterval=window.setInterval(this.triggerAutoFocus.bind(this),n.autofocusIntervalMs);},n.manualToAutofocusResumeTimeoutMs);try{await this.triggerFocusMode("single-shot");}catch(e){}}async triggerZoomMove(e){this.pinchToZoomDistance==null||(e==null?void 0:e.touches.length)!==2||e.preventDefault();}triggerZoomStart(e){var r,s,o,m;if((e==null?void 0:e.touches.length)!==2||(e.preventDefault(),this.pinchToZoomDistance=Math.hypot((e.touches[1].screenX-e.touches[0].screenX)/screen.width,(e.touches[1].screenY-e.touches[0].screenY)/screen.height),!this.mediaStream||!((r=this.mediaTrackCapabilities)!=null&&r.zoom)))return;let t=this.mediaStream.getVideoTracks();if(t.length===0||typeof t[0].getConstraints!="function")return;this.pinchToZoomInitialZoom=(s=this.mediaTrackCapabilities.zoom.min)!=null?s:1;let i=t[0].getConstraints();if(i.advanced){let d=(o=i.advanced.find(l=>"zoom"in l))==null?void 0:o.zoom;d!=null&&(this.pinchToZoomInitialZoom=typeof d=="number"?d:(m=d.ideal)!=null?m:1);}}updateActiveCameraCurrentResolution(e){this.videoElement.videoWidth>2&&this.videoElement.videoHeight>2&&(e.currentResolution={width:this.videoElement.videoWidth,height:this.videoElement.videoHeight}),e.deviceId!==""&&(this.activeCamera=e,this.setMirrorImageEnabled(this.isMirrorImageEnabled(),!1));}async updateStreamForResolution(e,t){var i;if(this.mediaStream==null)await this.initializeCameraForResolution(e,t);else try{let r=(i=this.activeCameraSettings)==null?void 0:i.getProperty("preferredAspectRatio");a$3.log(a$3.Level.Debug,"Setting new resolution for active camera video stream..."),await this.mediaStream.getVideoTracks()[0].applyConstraints(d.getUserMediaVideoParameters(t,r)),await new Promise(o=>{this.videoElement.addEventListener("timeupdate",()=>{o();},{once:!0});});let s=this.mediaStream.getVideoTracks()[0].getSettings();a$3.log(a$3.Level.Debug,"New active camera video stream resolution set",{width:s.width,height:s.height});}catch(r){if(t===4)throw r;await this.updateStreamForResolution(e,t+1);}}async videoTrackEndedRecovery(){if(document.visibilityState==="visible")try{a$3.log(a$3.Level.Debug,'Detected video track "ended" event, try to reinitialize camera'),await this.reinitializeCamera();}catch(e){}else a$3.log(a$3.Level.Debug,"Page is currently not visible, delay camera reinitialization until visible"),document.addEventListener("visibilitychange",this.checkCameraVideoStreamAccessIfVisibleListener);}videoTrackMuteRecovery(e){if(this.videoElement.onloadeddata!=null){a$3.log(a$3.Level.Debug,`Detected video track "${e.type}" event, delay camera video stream access detection`),this.setCameraAccessTimeout();return}let t=e.type==="mute";t!==this.gui.isCameraRecoveryVisible()&&(a$3.log(a$3.Level.Debug,`Detected video track "${e.type}" event, ${t?"enable":"disable"} camera recovery`),this.gui.setCameraRecoveryVisible(t));}};n.autofocusIntervalMs=1500,n.cameraAccessTimeoutMs=4e3,n.getCapabilitiesTimeoutMs=500,n.manualFocusWaitTimeoutMs=400,n.manualToAutofocusResumeTimeoutMs=5e3,n.noCameraErrorParameters={name:"NoCameraAvailableError",message:"No camera available"},n.notReadableErrorParameters={name:"NotReadableError",message:"Could not initialize camera correctly"},n.videoMetadataCheckIntervalMs=50,n.videoMetadataCheckTimeoutMs=4e3,n.MIRRORED_CLASS_NAME=a.MIRRORED_CLASS_NAME,n._instance=null;var M=n;
|
|
11
|
-
|
|
12
|
-
export { w as a, y as b, L as c, M as d };
|