@scandit/web-datacapture-core 8.2.1 → 8.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/js/{Camera-DhGjpcjv.d.ts → Camera-Cc__1Nc-.d.ts} +3 -1
- package/build/js/Camera.d.ts +1 -1
- package/build/js/Camera.js +1 -1
- package/build/js/CameraRelated.d.ts +1 -1
- package/build/js/{DataCaptureContext-Dvdr7st4.d.ts → DataCaptureContext-BcSpF9Dt.d.ts} +43 -4
- package/build/js/DataCaptureContext.d.ts +4 -2
- package/build/js/DataCaptureContext.js +1 -1
- package/build/js/DataCaptureContextRelated.d.ts +5 -3
- package/build/js/DataCaptureVersion.js +1 -1
- package/build/js/DataCaptureView.d.ts +5 -3
- package/build/js/DataCaptureView.js +1 -1
- package/build/js/Feedback.js +1 -1
- package/build/js/FrameData.d.ts +4 -2
- package/build/js/ImageFrameSource.d.ts +1 -1
- package/build/js/ImageFrameSource.js +1 -1
- package/build/js/NotificationPresenter/index.d.ts +4 -2
- package/build/js/NotificationPresenter/private/ConcreteNotificationPresenter.d.ts +4 -2
- package/build/js/NotificationPresenter/private/presets.d.ts +4 -2
- package/build/js/ScanditIcon.js +1 -1
- package/build/js/ScanditIconBuilder.js +1 -1
- package/build/js/SingleImageUploader.d.ts +1 -1
- package/build/js/Sound.d.ts +4 -0
- package/build/js/Sound.js +1 -1
- package/build/js/Vibration.js +1 -1
- package/build/js/browserHelper.d.ts +10 -0
- package/build/js/browserHelper.js +1 -1
- package/build/js/chunks/chunk-22UMTZI6.js +1 -0
- package/build/js/chunks/{chunk-6JHZVRXK.js → chunk-2MK5Y4IL.js} +1 -1
- package/build/js/chunks/{chunk-UQVVJP5Z.js → chunk-2OCDIZIS.js} +1 -1
- package/build/js/chunks/{chunk-QFSNPY5Y.js → chunk-2SGKGZ6F.js} +1 -1
- package/build/js/chunks/{chunk-O7EM4VIM.js → chunk-33ZWDLU7.js} +1 -1
- package/build/js/chunks/chunk-6AQGNP4S.js +1 -0
- package/build/js/chunks/chunk-6IHWEHG3.js +1 -0
- package/build/js/chunks/{chunk-3MKSI2DV.js → chunk-6IM6NGGI.js} +1 -1
- package/build/js/chunks/{chunk-7HYFN4JO.js → chunk-A3ZT7PJA.js} +1 -1
- package/build/js/chunks/chunk-A5G2NHT2.js +1 -0
- package/build/js/chunks/chunk-AAPD5YU3.js +1 -0
- package/build/js/chunks/chunk-AKGGJKCA.js +35 -0
- package/build/js/chunks/{chunk-DGIQ3GF7.js → chunk-ARODHCN7.js} +1 -1
- package/build/js/chunks/{chunk-QUWP3ILW.js → chunk-BSX3V75N.js} +1 -1
- package/build/js/chunks/chunk-DZE2EYSZ.js +1 -0
- package/build/js/chunks/chunk-EEWGHHL4.js +1 -0
- package/build/js/chunks/{chunk-GLSB4QTY.js → chunk-EIOVYBFS.js} +1 -1
- package/build/js/chunks/chunk-EYBP3672.js +1 -0
- package/build/js/chunks/chunk-F3Y2X52X.js +1 -0
- package/build/js/chunks/{chunk-VSROWPI6.js → chunk-FCXZZH3O.js} +1 -1
- package/build/js/chunks/{chunk-O4HDBWKK.js → chunk-FMOB7R2T.js} +1 -1
- package/build/js/chunks/{chunk-U7ETOWGJ.js → chunk-GS7VZDY5.js} +1 -1
- package/build/js/chunks/chunk-HHA4HDG5.js +6 -0
- package/build/js/chunks/{chunk-QUBJJDLC.js → chunk-HILZP6OW.js} +1 -1
- package/build/js/chunks/{chunk-NXAYIU7F.js → chunk-IASACVTH.js} +1 -1
- package/build/js/chunks/{chunk-DTREAYZQ.js → chunk-KVRNF3VA.js} +1 -1
- package/build/js/chunks/{chunk-UERKPMRV.js → chunk-L66S4DN2.js} +1 -1
- package/build/js/chunks/chunk-LV6LGCDC.js +1 -0
- package/build/js/chunks/{chunk-YE2GYNRP.js → chunk-NMXQDQYI.js} +1 -1
- package/build/js/chunks/chunk-NYYGU4ZV.js +1 -0
- package/build/js/chunks/{chunk-BBOKPRKO.js → chunk-O5D4KVS5.js} +1 -1
- package/build/js/chunks/{chunk-I4F6XB6S.js → chunk-PDJEYYPX.js} +1 -1
- package/build/js/chunks/chunk-QHBYNYWX.js +1 -0
- package/build/js/chunks/chunk-QHNV2CFJ.js +1 -0
- package/build/js/chunks/{chunk-WVVNJRUA.js → chunk-QMLTR5JH.js} +1 -1
- package/build/js/chunks/chunk-QWKATH4N.js +1 -0
- package/build/js/chunks/{chunk-XYZYNUX3.js → chunk-RXDVYEE5.js} +1 -1
- package/build/js/chunks/chunk-RY2EW3RR.js +1 -0
- package/build/js/chunks/chunk-S2GRD6GO.js +1 -0
- package/build/js/chunks/chunk-SJIN27Q5.js +1 -0
- package/build/js/chunks/{chunk-RP4YFAF2.js → chunk-SSTFVERQ.js} +1 -1
- package/build/js/chunks/{chunk-7OFC24NE.js → chunk-SX5ZLP2O.js} +1 -1
- package/build/js/chunks/{chunk-V2OKMBZD.js → chunk-UJYGOVXB.js} +1 -1
- package/build/js/chunks/{chunk-HQKKXJJY.js → chunk-VWEJFI2M.js} +1 -1
- package/build/js/chunks/chunk-W3X3ZRQZ.js +1 -0
- package/build/js/chunks/{chunk-JCP7NQPV.js → chunk-WFKB322J.js} +1 -1
- package/build/js/chunks/{chunk-VJ7ZYB4V.js → chunk-WJOT37ST.js} +1 -1
- package/build/js/chunks/{chunk-NY2HBST4.js → chunk-X653DLOR.js} +1 -1
- package/build/js/chunks/chunk-Y3TODCJD.js +1 -0
- package/build/js/chunks/{chunk-QPR2YHD4.js → chunk-YJNJGCAN.js} +1 -1
- package/build/js/chunks/chunk-YONR3EGV.js +2 -0
- package/build/js/chunks/{chunk-6EEMWSEO.js → chunk-YP53ND2Q.js} +1 -1
- package/build/js/chunks/{chunk-NT5WI2PS.js → chunk-YUZDO2PC.js} +1 -1
- package/build/js/chunks/chunk-ZAXZRQYF.js +1 -0
- package/build/js/chunks/{chunk-5OF76LWH.js → chunk-ZCEA7BEH.js} +1 -1
- package/build/js/controls/CameraFOVSwitchControl.d.ts +4 -2
- package/build/js/controls/CameraFOVSwitchControl.js +1 -1
- package/build/js/controls/CameraSwitchControl.d.ts +4 -2
- package/build/js/controls/CameraSwitchControl.js +1 -1
- package/build/js/controls/TorchSwitchControl.d.ts +4 -2
- package/build/js/controls/TorchSwitchControl.js +1 -1
- package/build/js/controls/common.d.ts +4 -2
- package/build/js/controls/index.d.ts +4 -2
- package/build/js/controls/index.js +1 -1
- package/build/js/defaults/DefaultsCamera.d.ts +4 -2
- package/build/js/defaults/DefaultsCameraSettings.d.ts +1 -1
- package/build/js/defaults/DefaultsDataCaptureView.js +1 -1
- package/build/js/global.d.d.ts +1 -0
- package/build/js/index.d.ts +5 -3
- package/build/js/index.js +1 -1
- package/build/js/moduleLoader.d.ts +4 -2
- package/build/js/private/AdditionalLayerPosition.d.ts +6 -0
- package/build/js/private/AdditionalLayerPosition.js +1 -0
- package/build/js/private/BatteryInterface.d.ts +81 -0
- package/build/js/private/BatteryInterface.js +1 -0
- package/build/js/private/CameraAccess.d.ts +1 -1
- package/build/js/private/CameraAccess.js +1 -1
- package/build/js/private/CameraManager.d.ts +5 -3
- package/build/js/private/CameraManager.js +1 -1
- package/build/js/private/CameraPool.d.ts +5 -2
- package/build/js/private/CameraPool.js +1 -1
- package/build/js/private/CanvasDrawerWithMetrics.d.ts +4 -2
- package/build/js/private/CoreModuleLicenseTextProvider.d.ts +4 -2
- package/build/js/private/CoreModuleLicenseTextProvider.js +1 -1
- package/build/js/private/CustomLocationsView.js +1 -1
- package/build/js/private/DataCaptureContextRelated.d.ts +4 -2
- package/build/js/private/FrameReaders/FrameReader.d.ts +4 -2
- package/build/js/private/FrameReaders/FrameReader.js +1 -1
- package/build/js/private/FrameReaders/FrameReaderAbstract.d.ts +4 -2
- package/build/js/private/FrameReaders/GrayScaleFrameReader.d.ts +4 -2
- package/build/js/private/FrameReaders/GrayScaleFrameReader.js +1 -1
- package/build/js/private/FrameReaders/index.d.ts +4 -2
- package/build/js/private/FrameReaders/index.js +1 -1
- package/build/js/private/NormalizedModuleLoaderOptions.d.ts +4 -2
- package/build/js/private/OrientationObserver.js +1 -1
- package/build/js/private/SingleImageUploaderView.d.ts +4 -2
- package/build/js/private/SingleImageUploaderView.js +1 -1
- package/build/js/private/ViewControls+related.js +1 -1
- package/build/js/private/ViewControls_related.d.ts +4 -2
- package/build/js/private/ViewStyles.js +1 -1
- package/build/js/private/ViewsRegistry.d.ts +4 -2
- package/build/js/private/customHowler/AudioCache.d.ts +37 -0
- package/build/js/private/customHowler/AudioCache.js +1 -0
- package/build/js/private/customHowler/Howl.d.ts +189 -0
- package/build/js/private/customHowler/Howl.js +1 -0
- package/build/js/private/customHowler/HowlRegistry.d.ts +18 -0
- package/build/js/private/customHowler/HowlRegistry.js +1 -0
- package/build/js/private/customHowler/Html5Sound.d.ts +52 -0
- package/build/js/private/customHowler/Html5Sound.js +1 -0
- package/build/js/private/customHowler/UnlockManager.d.ts +39 -0
- package/build/js/private/customHowler/UnlockManager.js +1 -0
- package/build/js/private/customHowler/WebAudioContextManager.d.ts +161 -0
- package/build/js/private/customHowler/WebAudioContextManager.js +1 -0
- package/build/js/private/customHowler/debug.d.ts +28 -0
- package/build/js/private/customHowler/debug.js +1 -0
- package/build/js/private/customHowler/index.d.ts +2 -0
- package/build/js/private/customHowler/index.js +1 -0
- package/build/js/private/customHowler/setup.d.ts +55 -0
- package/build/js/private/customHowler/setup.js +1 -0
- package/build/js/private/hybridDesktopPlatformHelpers.js +1 -1
- package/build/js/private/ui/atoms/AimerSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/ArrowDownSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/ArrowLeftSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/ArrowRightSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/ArrowUpSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/ArrowsUp.js +1 -1
- package/build/js/private/ui/atoms/Backdrop.js +1 -1
- package/build/js/private/ui/atoms/CalendarExclamationMarkSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/CameraFOVUltrawideSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/CameraFOVWideSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/CameraSwitchReverseSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/CameraSwitchSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/Card.js +1 -1
- package/build/js/private/ui/atoms/CardList.js +1 -1
- package/build/js/private/ui/atoms/CheckSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/ChevronDownSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/ChevronLeftSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/ChevronRightSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/ChevronUpSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/CrossSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/DeleteSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/Dot5xSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/ExclamationMarkSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/GlassSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/HandLensCheckSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/KeyboardSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/LowStockSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/OnexSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/PauseSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/PrinterSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/ProgressBar.js +1 -1
- package/build/js/private/ui/atoms/QuestionMarkSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/RestartSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/RoundedCheckSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/RoundedCrossSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/RoundedExclamationMarkSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/ScanSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/ShutterButton.js +1 -1
- package/build/js/private/ui/atoms/SlashSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/StarFilledSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/StarHalfFilledSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/StarOutlinedSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/SvgIcon.js +1 -1
- package/build/js/private/ui/atoms/ToPickSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/Toast.d.ts +4 -2
- package/build/js/private/ui/atoms/Toast.js +1 -1
- package/build/js/private/ui/atoms/TorchOffSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/TorchOnSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/TwoxSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/WrongItemSvgIcon.js +1 -1
- package/build/js/private/ui/molecules/CameraFOVSwitchButton.js +1 -1
- package/build/js/private/ui/molecules/CameraSwitchButton.js +1 -1
- package/build/js/private/ui/molecules/ControlsLayout.js +1 -1
- package/build/js/private/ui/molecules/HintPresenter.d.ts +4 -2
- package/build/js/private/ui/molecules/HintPresenter.js +1 -1
- package/build/js/private/ui/molecules/LoadingOverlay.js +1 -1
- package/build/js/private/ui/molecules/TorchSwitchIconButton.d.ts +1 -1
- package/build/js/private/ui/molecules/TorchSwitchIconButton.js +1 -1
- package/build/js/private/utils/index.js +1 -1
- package/build/js/private/utils/polyfillLoader.js +1 -1
- package/build/js/private/utils/replaceImagesInViewUtils.d.ts +4 -2
- package/build/js/private/utils/warnMultithreadingUnavailable.js +1 -1
- package/build/js/worker/ImageConverterForwarder.d.ts +4 -2
- package/build/js/worker/ViewInfoHelper.d.ts +4 -2
- package/build/js/worker/WorkerMain.d.ts +4 -2
- package/build/js/worker/WorkerMain.js +1 -1
- package/build/js/worker/coreCapture.inlineWorker.d.ts +4 -2
- package/build/js/worker/coreCapture.inlineWorker.js +1 -1
- package/build/js/worker/dataCaptureEngine.d.ts +4 -2
- package/build/js/worker/dataCaptureEngine.js +1 -1
- package/build/js/worker/dataCaptureLoader.d.ts +4 -2
- package/build/js/worker/dataCaptureLoader.js +1 -1
- package/build/js/worker/dataCaptureWorkerRelated.d.ts +4 -2
- package/build/js/worker/dataCaptureWorkerRelated.js +1 -1
- package/build/js/worker/index.d.ts +4 -2
- package/build/js/worker/index.js +1 -1
- package/package.json +6 -6
- package/build/js/chunks/chunk-4J3Y5IIL.js +0 -1
- package/build/js/chunks/chunk-A225YZFY.js +0 -2
- package/build/js/chunks/chunk-IBDUCVB4.js +0 -1
- package/build/js/chunks/chunk-LH2NI5UL.js +0 -2
- package/build/js/chunks/chunk-Q5WJX5JB.js +0 -1
- package/build/js/chunks/chunk-RVAHEVSC.js +0 -1
- package/build/js/chunks/chunk-SYGWA3T6.js +0 -35
- package/build/js/chunks/chunk-TR5HATUD.js +0 -1
- package/build/js/chunks/chunk-TTMLHWYT.js +0 -6
- package/build/js/chunks/chunk-UOQFOEG6.js +0 -1
- package/build/js/chunks/chunk-VQYVIA64.js +0 -1
- package/build/js/chunks/chunk-ZDROGZFO.js +0 -1
- /package/build/js/chunks/{chunk-TU2LKPHV.js → chunk-YRQQE3NR.js} +0 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {a as a$4}from'./chunk-3A7LM5JG.js';import {a}from'./chunk-NQF3GUK2.js';import {a as a$2}from'./chunk-QHBIT2WY.js';import {b,a as a$3}from'./chunk-SK6L34IF.js';import {d}from'./chunk-YUZDO2PC.js';import {b as b$2}from'./chunk-QHBYNYWX.js';import {a as a$6}from'./chunk-ZKROZLQ4.js';import {a as a$a}from'./chunk-KAFNKP6O.js';import {a as a$9}from'./chunk-E4XJ4GKD.js';import {a as a$b}from'./chunk-QOCHMKNY.js';import {b as b$4}from'./chunk-FTD535WI.js';import {a as a$5}from'./chunk-R6E4CT22.js';import {a as a$c}from'./chunk-4BP7D26M.js';import {b as b$1}from'./chunk-YONR3EGV.js';import {a as a$7,b as b$3}from'./chunk-CX2R2XQK.js';import {a as a$1}from'./chunk-XR65N6EG.js';import {a as a$8}from'./chunk-QCZSSQAQ.js';var O=`
|
|
2
|
+
attribute vec2 a_position;
|
|
3
|
+
varying vec2 v_texcoord;
|
|
4
|
+
|
|
5
|
+
void main() {
|
|
6
|
+
gl_Position = vec4(a_position, 0, 1);
|
|
7
|
+
v_texcoord = a_position * 0.5 + 0.5;
|
|
8
|
+
}
|
|
9
|
+
`,U=`
|
|
10
|
+
precision mediump float;
|
|
11
|
+
varying vec2 v_texcoord;
|
|
12
|
+
uniform sampler2D u_texture;
|
|
13
|
+
uniform float x_spacing; // Uniform for x-spacing between pixels
|
|
14
|
+
|
|
15
|
+
// Function to calculate grayscale
|
|
16
|
+
float toGray(vec4 color) {
|
|
17
|
+
return dot(color.rgb, vec3(0.299, 0.587, 0.114));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
void main() {
|
|
21
|
+
// Sample adjacent pixels with spacing of 1/width
|
|
22
|
+
vec4 a = texture2D(u_texture, v_texcoord + vec2(0.0 * x_spacing, 0.0));
|
|
23
|
+
vec4 b = texture2D(u_texture, v_texcoord + vec2(1.0 * x_spacing, 0.0));
|
|
24
|
+
vec4 c = texture2D(u_texture, v_texcoord + vec2(2.0 * x_spacing, 0.0));
|
|
25
|
+
vec4 d = texture2D(u_texture, v_texcoord + vec2(3.0 * x_spacing, 0.0));
|
|
26
|
+
|
|
27
|
+
// Calculate grayscale values
|
|
28
|
+
float grayscaleA = toGray(a);
|
|
29
|
+
float grayscaleB = toGray(b);
|
|
30
|
+
float grayscaleC = toGray(c);
|
|
31
|
+
float grayscaleD = toGray(d);
|
|
32
|
+
|
|
33
|
+
// Set the final color with grayscale values
|
|
34
|
+
gl_FragColor = vec4(grayscaleA, grayscaleB, grayscaleC, grayscaleD);
|
|
35
|
+
}`,T=class extends a{constructor(t,i){super(t,i);this.colorType="GRAYSCALE";this._useRgbaFallback=false;this._positions=new Float32Array([-1,-1,-1,1,1,-1,1,-1,-1,1,1,1]);this._canvas=document.createElement("canvas");}get _webglContext(){var t;if(!this._ctx){if(this._ctx=(t=this._canvas)==null?void 0:t.getContext("webgl",{antialias:false}),!this._ctx)throw new Error("Cannot get WebGL context");this.setup();}return this._ctx}readFromSource(t){var R,_;let i=(R=t==null?void 0:t.videoWidth)!=null?R:this._contextWebGL.drawingBufferWidth,a=i%4!==0;if(a!==this._useRgbaFallback&&(a?(a$1.debug("[GrayScaleFrameReader] Video width not divisible by 4, falling back to RGBA reader for better performance",{width:i}),this._rgbaFallbackReader||(this._rgbaFallbackReader=new v(this._contextWebGL,{minPoolCapacity:this._minPoolCapacity,maxPoolCapacity:this._maxPoolCapacity}),this._rgbaFallbackReader.setup())):a$1.log(a$1.Level.Info,"[GrayScaleFrameReader] Video width now divisible by 4, using optimized grayscale reader",{width:i}),this._useRgbaFallback=a),this._useRgbaFallback&&this._rgbaFallbackReader)return this._rgbaFallbackReader.readFromSource(t);this.updateCanvasSizeIfNeeded(),this.updateFrameSizeIfNeeded();let{drawingBufferWidth:s,drawingBufferHeight:o,TEXTURE_2D:c,RGBA:d,UNSIGNED_BYTE:l,TRIANGLES:p}=this._webglContext;this._webglContext.viewport(0,0,s,o);let b=this._webglContext.getUniformLocation(this._shaderProgram,"x_spacing"),u=1/i;this._webglContext.uniform1f(b,u),this._webglContext.texImage2D(c,0,d,d,l,t),this._webglContext.drawArrays(p,0,6);let h=(_=this._framePool)==null?void 0:_.pop();if(!h)throw new Error("Frame pool found empty!");let g=s*o*4;return h.length!==g&&(a$1.warn("[GrayScaleFrameReader] Buffer from pool has wrong size, allocating new one",{bufferLength:h.length,requiredSize:g}),h=new Uint8ClampedArray(g)),this._webglContext.readPixels(0,0,s,o,d,l,h),{width:i,height:o,data:new Uint8ClampedArray(h.buffer,0,i*o),frameId:E(),colorType:"GRAYSCALE"}}setup(){this.initShaderProgram(),this.initBuffers(),this.initTexture();}dispose(){var t;this._ctx&&(this._shaderProgram&&(this._ctx.deleteProgram(this._shaderProgram),this._shaderProgram=null),this._positionBuffer&&(this._ctx.deleteBuffer(this._positionBuffer),this._positionBuffer=null),this._texture&&(this._ctx.deleteTexture(this._texture),this._texture=null),this._ctx=null),this._rgbaFallbackReader&&(this._rgbaFallbackReader.dispose(),this._rgbaFallbackReader=null),(t=this._framePool)==null||t.empty(),this._canvas=void 0;}updateCanvasSizeIfNeeded(){if(!this._canvas)return;let t=Math.ceil(this._contextWebGL.drawingBufferWidth/4);(this._canvas.width!==t||this._canvas.height!==this._contextWebGL.drawingBufferHeight)&&(this._canvas.width=t,this._canvas.height=this._contextWebGL.drawingBufferHeight);}updateFrameSizeIfNeeded(){let{drawingBufferWidth:t,drawingBufferHeight:i}=this._webglContext,a=t*i*4;this._frameSize!==a&&(this._frameSize=a,this._framePool&&this._framePool.empty(),this._framePool=new a$2({capacity:this._maxPoolCapacity,lowWaterMark:this._minPoolCapacity,createItem:()=>new Uint8ClampedArray(this._frameSize)}));}initShaderProgram(){let t=b(this._webglContext,this._webglContext.VERTEX_SHADER,O),i=b(this._webglContext,this._webglContext.FRAGMENT_SHADER,U);if(!t||!i)throw new Error("Shaders cannot be created");this._shaderProgram=a$3(this._webglContext,t,i),this._webglContext.useProgram(this._shaderProgram);}initBuffers(){this._positionBuffer=this._webglContext.createBuffer(),this._webglContext.bindBuffer(this._webglContext.ARRAY_BUFFER,this._positionBuffer),this._webglContext.bufferData(this._webglContext.ARRAY_BUFFER,this._positions,this._webglContext.STATIC_DRAW);let t=this._webglContext.getAttribLocation(this._shaderProgram,"a_position");this._webglContext.enableVertexAttribArray(t),this._webglContext.bindBuffer(this._webglContext.ARRAY_BUFFER,this._positionBuffer),this._webglContext.vertexAttribPointer(t,2,this._webglContext.FLOAT,false,0,0);}initTexture(){this._texture=this._webglContext.createTexture(),this._webglContext.bindTexture(this._webglContext.TEXTURE_2D,this._texture),this._webglContext.texParameteri(this._webglContext.TEXTURE_2D,this._webglContext.TEXTURE_WRAP_S,this._webglContext.CLAMP_TO_EDGE),this._webglContext.texParameteri(this._webglContext.TEXTURE_2D,this._webglContext.TEXTURE_WRAP_T,this._webglContext.CLAMP_TO_EDGE),this._webglContext.texParameteri(this._webglContext.TEXTURE_2D,this._webglContext.TEXTURE_MIN_FILTER,this._webglContext.LINEAR),this._webglContext.texParameteri(this._webglContext.TEXTURE_2D,this._webglContext.TEXTURE_MAG_FILTER,this._webglContext.LINEAR);let t=this._webglContext.getUniformLocation(this._shaderProgram,"u_texture");this._webglContext.uniform1i(t,0);}};var H=(a=>(a.CONTINUOUS="continuous",a.MANUAL="manual",a.NONE="none",a.SINGLE_SHOT="single-shot",a))(H||{}),Z=(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))(Z||{});function E(){return a$4()}var X=(t=>(t.CAMERA_PROPERTIES="cameraProperties",t.CAMERA_ACCESS_ERROR="cameraAccessError",t))(X||{}),n=class n{constructor(){this.constraint=4;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$5(this.handleVideoResize.bind(this),500);this.videoTrackEndedListener=this.videoTrackEndedRecovery.bind(this);this.videoTrackMuteListener=this.videoTrackMuteRecovery.bind(this);this._synchronousFrameHandling=false;this._glFrameReaders={GRAYSCALE:null,RGBA:null};this._frameReaderType="RGBA";this.isVideoStreamPaused=false;this.handleVideoPauseHandler=this.handleVideoPause.bind(this);this.cameraPosition="worldFacing",this.gui={isCameraRecoveryVisible:()=>false,setCameraRecoveryVisible:()=>{}},this.isWebGLSupported=!b$1.checkBrowserCompatibility().missingFeatures.includes("webGL"),this.videoElement=document.createElement("video"),this.videoElement.autoplay=true,this.videoElement.playsInline=true,this.videoElement.muted=true,this.videoElement.style.opacity="0",this.videoElement.poster=a$6,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 synchronousFrameHandling(){return this._synchronousFrameHandling}get canvas2dContext(){return this._canvas2dContext||(this._canvas2dContext=this.canvas.getContext("2d",{willReadFrequently:true}),this._canvas2dContext==null&&a$1.warn("Unable to get 2d canvas context"),this.handleVideoResize()),this._canvas2dContext}get canvasWebGLContext(){var e;if(!this._canvas2dContext&&!this._canvasWebGLContext){if(!this.isWebGLSupported){a$1.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:false,antialias:false}))!=null?e:this.canvas.getContext("experimental-webgl",{alpha:false,antialias:false});t!=null&&(this._canvasWebGLContext=t,this.handleVideoResize());}return this._canvasWebGLContext}static instance(){return n._instance==null&&(n._instance=new n),n._instance}dispose(){b$2.clear(),n._instance=null;}recycle(e){var t;(t=this.getFrameReader())==null||t.recycle(e);}getCurrentFrame(){var e;return (e=this._glFrameReaders.RGBA)==null?void 0:e.readFromSource(this.videoElement)}requestVideoFrame(e,t=this.videoElement){return "requestVideoFrameCallback"in HTMLVideoElement.prototype?t.requestVideoFrameCallback(e):a$7(e)}cancelVideoFrame(e,t=this.videoElement){if("cancelVideoFrameCallback"in HTMLVideoElement.prototype){t.cancelVideoFrameCallback(e);return}b$3(e);}addListener(e,t){var a;let i=(a=this.listeners.get(e))!=null?a:[];i.includes(t)||this.listeners.set(e,[...i,t]);}async applyCameraSettings(e){if(this.selectedCameraSettings=e,this.activeCamera==null)throw new a$8(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$8(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 false}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)===true):false}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$1.debug("Camera reinitialization delayed");else {a$1.debug("Reinitialize camera:",this.activeCamera);try{let e=this.activeCamera;await this.stopStream(),await this.initializeCameraWithSettings(e,this.activeCameraSettings);}catch(e){throw a$1.warn("Couldn't access camera:",this.activeCamera,e),this.emit("cameraAccessError",e),e}}}removeListener(e,t){var s;let a=((s=this.listeners.get(e))!=null?s:[]).filter(o=>o!==t);this.listeners.set(e,a);}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 a,s,o,c,d,l,p,b;let t=(s=(a=this.mediaStream)==null?void 0:a.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(((c=(o=this.mediaTrackCapabilities)==null?void 0:o.exposureMode)==null?void 0:c.includes(i))===true){if(await t[0].applyConstraints({advanced:[{exposureMode:i}]}),e.time!=null&&e.time>0&&this.mediaTrackCapabilities.exposureTime){let u=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:u}]});}else if(e.compensation!=null&&i==="continuous"&&this.mediaTrackCapabilities.exposureCompensation){let u=Math.max((p=this.mediaTrackCapabilities.exposureCompensation.min)!=null?p:-10,Math.min(e.compensation,(b=this.mediaTrackCapabilities.exposureCompensation.max)!=null?b:10));await t[0].applyConstraints({advanced:[{exposureCompensation:u}]});}}}async setFocus(e){var i,a,s,o,c;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(((a=(i=this.mediaTrackCapabilities)==null?void 0:i.focusMode)==null?void 0:a.includes(d))===true&&(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))+((c=this.mediaTrackCapabilities.focusDistance.min)!=null?c:.01);await t[0].applyConstraints({advanced:[{focusDistance:l}]});}}}async setFrameRate(e){var t,i,a;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,(a=e.max)!=null?a: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)===true){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,a;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,(a=this.mediaTrackCapabilities.zoom.max)!=null?a:16));await s[0].applyConstraints({advanced:[{zoom:o}]});}}}async setupCameras(){if(this.cameraSetupPromise)return this.cameraSetupPromise;let e=this.isVideoStreamPaused;return this.cameraSetupPromise=this.setupCamerasAndStream(),this.cameraSetupPromise.then(()=>{e||(this.isVideoStreamPaused=false);})}pauseStream(){if(this.mediaStream){for(let e of this.mediaStream.getVideoTracks())e.enabled=false;this.isVideoStreamPaused=true,a$1.debug("Paused camera video stream",this.mediaStream);}}resumeStream(){if(this.mediaStream){for(let e of this.mediaStream.getVideoTracks())e.enabled=true;this.isVideoStreamPaused=false,a$1.debug("Resumed camera video stream",this.mediaStream);}}async stopStream(e=false){this.activeCamera&&(this.activeCamera.currentResolution=void 0),this.activeCamera=void 0,this.torchEnabled=false,this.isVideoStreamPaused=false,this.mediaStream&&(a$1.debug(`Stop camera video stream access${e?" (abort access detection)":""}:`,this.mediaStream),a$1.debug("Stopping camera video stream access",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,a,s;for(let o of (a=(i=this.mediaStream)==null?void 0:i.getVideoTracks())!=null?a:[])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){e!==this._frameReaderType&&(this._frameReaderType=e,a$1.log(a$1.Level.Debug,`Change frame reader type to ${this._frameReaderType} mode`));}async allowPictureInPicture(e){e?(this.videoElement.disablePictureInPicture=false,this.videoElement.removeAttribute("controlslist"),this.videoElement.removeAttribute("disablepictureinpicture")):(this.videoElement.disablePictureInPicture=true,this.videoElement.setAttribute("controlslist","nodownload"),this.videoElement.setAttribute("disablepictureinpicture","true")),await this.reinitializeCamera();}setFrameHandling(e){var t;this._synchronousFrameHandling=e,this._frameReaderOptions=this.getFrameReaderOptions(e),(t=this._glFrameReaders[this._frameReaderType])==null||t.dispose(),delete this._glFrameReaders[this._frameReaderType];}async setClipArea(e){if(this.activeCamera&&this.isVideoAndContextStateValid()){this.clipArea=e?this.frameRectFromViewRect(e):void 0,await this.initializeStreamForResolution(this.activeCamera,this.constraint,this.isVideoStreamPaused);return}this.clipArea=e;}frameRectFromViewRect(e){let t=this.videoElement.videoWidth/this.videoElement.clientWidth||1,i=this.videoElement.videoHeight/this.videoElement.clientHeight||1;return new a$9(new a$a(e.origin.x*t,e.origin.y*i),new a$b(e.size.width*t,e.size.height*i))}async accessAutoselectedCamera(e){let t=d.sortCamerasForCameraPosition(e,this.cameraPosition),i=t.shift();for(;i;)try{await this.initializeCameraWithSettings(i,this.selectedCameraSettings);return}catch(a){if(this.setSelectedCamera(),t.length>0){a$1.log(a$1.Level.Warn,"Couldn't access camera:",i,a),i=t.shift();continue}throw a}throw new a$8(n.noCameraErrorParameters)}getFrameReaderOptions(e){return e?{minPoolCapacity:0,maxPoolCapacity:1}:b$1.isDesktopDevice()?{maxPoolCapacity:2,minPoolCapacity:1}:{maxPoolCapacity:10,minPoolCapacity:3}}getFrameReader(){var t;if(this._glFrameReaders[this._frameReaderType])return this._glFrameReaders[this._frameReaderType];if(!this._canvasWebGLContext)return null;let e=(t=this._frameReaderOptions)!=null?t:this.getFrameReaderOptions(this._synchronousFrameHandling);switch(this._frameReaderType){case "GRAYSCALE":{this._glFrameReaders.GRAYSCALE=new T(this._canvasWebGLContext,e),this._glFrameReaders.RGBA=new v(this._canvasWebGLContext,{minPoolCapacity:1,maxPoolCapacity:2});break}case "RGBA":{this._glFrameReaders.RGBA=new v(this._canvasWebGLContext,e);break}default:b$4(this._frameReaderType);}return a$1.debug(`Created frame reader ${this._frameReaderType}`,e),this._glFrameReaders[this._frameReaderType]}async accessInitialCamera(){let e={position:this.cameraPosition,deviceId:"",label:""};try{await this.initializeCameraWithSettings(e,this.selectedCameraSettings);}catch{}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,i=E();return {colorType:"RGBA",data:this.canvas2dContext.getImageData(0,0,e,t).data,frameId:i,width:e,height:t}}areVideoAndWebGLSizeMismatching(){return this.canvasWebGLContext?this.canvasWebGLContext.drawingBufferWidth!==this.videoElement.videoWidth||this.canvasWebGLContext.drawingBufferHeight!==this.videoElement.videoHeight:true}captureImageForWebGLContext(){if(!this.isVideoAndContextStateValid()||!this.canvasWebGLContext||this.canvasWebGLContext.drawingBufferWidth<=2||this.canvasWebGLContext.drawingBufferHeight<=2||this.areVideoAndWebGLSizeMismatching()||this.getFrameReader()==null)return null;let e=this.getFrameReader().readFromSource(this.videoElement);if(e.data[3]!==255&&e.colorType==="RGBA"){if(a$1.log(a$1.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=a=>{a$1.log(a$1.Level.Debug,"Camera video stream access failure (video data load timeout):",e),this.gui.setCameraRecoveryVisible(true),i(a);},this.setCameraAccessTimeout();})}checkCameraVideoStreamAccessIfVisible(){document.visibilityState==="visible"&&(a$1.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$1.log(a$1.Level.Debug,"Camera video stream access success:",e),t();return}let a=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()-a>n.videoMetadataCheckTimeoutMs){a$1.log(a$1.Level.Warn,"Camera video stream access failure (valid video metadata timeout):",e),window.clearInterval(this.videoMetadataCheckInterval),await this.stopStream(true),i(new a$8(n.notReadableErrorParameters));return}return}window.clearInterval(this.videoMetadataCheckInterval),this.updateActiveCameraCurrentResolution(e),a$1.log(a$1.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 a;let i=(a=this.listeners.get(e))!=null?a:[];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(a=>a.deviceId===i||a.label!==""&&a.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}default:{t=2;break}}return t}async handleCameraInitializationError(e,t,i){if(!["OverconstrainedError","NotReadableError"].includes(i.name)||i.name==="NotReadableError"&&t===4)throw a$1.log(a$1.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$1.log(a$1.Level.Warn,"Camera video stream access failure (no camera with such type error)",e,i),i;a$1.log(a$1.Level.Warn,"Detected non-existent deviceId error, attempt to find and reaccess updated camera",e,i);let a=e.deviceId;if(await d.getCameras(true),a===e.deviceId)throw a$1.log(a$1.Level.Warn,"Camera video stream access failure (updated camera not found after non-existent deviceId error)",e,i),d.markCameraAsInaccessible(e),i;return a$1.log(a$1.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$1.log(a$1.Level.Warn,"WebGL context has been lost, restoring..."),this._canvasWebGLContext=void 0,this.canvasWebGLContext?(this.handleVideoResize(),a$1.log(a$1.Level.Warn,"WebGL context restored")):a$1.log(a$1.Level.Error,"WebGL context restore failed");}async initializeCameraAndCheckUpdatedSettings(e){var t,i,a,s,o;try{if(await this.initializeCameraForResolution(e),this.selectedCameraSettings!==this.activeCameraSettings&&(this.selectedCameraSettings==null||this.activeCameraSettings==null||Object.keys(this.selectedCameraSettings).some(u=>{var h,g;return ((h=this.selectedCameraSettings)==null?void 0:h[u])!==((g=this.activeCameraSettings)==null?void 0:g[u])}))){this.activeCameraSettings=this.selectedCameraSettings,await this.initializeCameraAndCheckUpdatedSettings(e);return}this.activeCameraSettings&&this.activeCameraSettings.zoomFactor>1&&await this.setZoom(this.activeCameraSettings.zoomFactor);let c=(t=this.activeCameraSettings)==null?void 0:t.getProperty("minFrameRate"),d=(i=this.activeCameraSettings)==null?void 0:i.getProperty("maxFrameRate");(c!=null||d!=null)&&await this.setFrameRate({min:c,max:d});let l=(a=this.activeCameraSettings)==null?void 0:a.getProperty("manualLensPosition");l!=null&&await this.setFocus(l);let p=(s=this.activeCameraSettings)==null?void 0:s.getProperty("exposureTargetBias"),b=(o=this.activeCameraSettings)==null?void 0:o.getProperty("exposureDuration");(p!=null||b!=null)&&await this.setExposure({compensation:p,time:b});}finally{this.cameraInitializationPromise=void 0;}}async initializeCameraForResolution(e,t){var i;this.gui.setCameraRecoveryVisible(false),this.constraint=t!=null?t:this.getInitialCameraResolutionConstraint(e),this.mediaStream!=null&&e.deviceId!==""&&((i=this.activeCamera)==null?void 0:i.deviceId)===e.deviceId?await(b$1.isIPhone()?this.initializeStreamForResolution(e,this.constraint):this.updateStreamForResolution(e,this.constraint)):await this.initializeStreamForResolution(e,this.constraint);}async initializeStreamForResolution(e,t,i=false){var a;await this.stopStream();try{let s=(a=this.activeCameraSettings)==null?void 0:a.getProperty("preferredAspectRatio"),o=await d.accessCameraStream(e,t,s),c=await this.clipMediaStreamIfNeeded(o);if(a$1.log(a$1.Level.Debug,"Camera accessed, waiting for camera video stream start..."),typeof c.getVideoTracks()[0].getSettings=="function"){let d=c.getVideoTracks()[0].getSettings();if(d.width!=null&&d.height!=null&&(d.width===2||d.height===2)){if(a$1.log(a$1.Level.Debug,"Camera video stream access failure (invalid video metadata):",e),t===4)throw new a$8(n.notReadableErrorParameters);return await this.stopStream(),this.initializeStreamForResolution(e,t+1)}}this.mediaStream=c,i&&this.pauseStream();for(let d of this.mediaStream.getVideoTracks())d.addEventListener("ended",this.videoTrackEndedListener),d.addEventListener("mute",this.videoTrackMuteListener),d.addEventListener("unmute",this.videoTrackMuteListener);try{await this.setupCameraStreamVideo(e,c);}catch(d){if(t===4)throw d;return this.initializeStreamForResolution(e,t+1)}}catch(s){return this.handleCameraInitializationError(e,t,s)}}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=true){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(true),(e=this.cameraAccessRejectCallback)==null||e.call(this,new a$8(n.notReadableErrorParameters))):(a$1.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(a=>{this.abortedCameraInitializationResolveCallback=a;})]);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 a=await d.getCameras(false,true),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(a,i.label,s);if(o){if(d.adjustCameraFromMediaStream(this.mediaStream,o),b$1.isDesktopDevice()&&(d.setMainCameraForPositionOverridesOnDesktop(this.cameraPosition,o),d.setMainCameraForPositionOverridesOnDesktop(o.position,o)),a.length===1||d.getMainCameraForPosition(a,this.cameraPosition)===o){a$1.debug("Initial camera access was correct (main camera), keep camera:",o),this.setSelectedCamera(o),this.updateActiveCameraCurrentResolution(o),await this.recoverStreamIfNeeded();return}a$1.debug("Initial camera access was incorrect (not main camera), change camera",{...i,deviceId:s});}else a$1.debug("Initial camera access was incorrect (unknown camera), change camera",{...i,deviceId:s});}if(this.selectedCamera==null){await this.accessAutoselectedCamera(a);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{}}}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=true,t=this.mediaStream.getVideoTracks();t.length>0&&typeof t[0].getConstraints=="function"&&(e=((i=t[0].getConstraints().advanced)==null?void 0:i.some(a=>a.focusMode==="manual"))===true),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{}}async triggerZoomMove(e){this.pinchToZoomDistance==null||(e==null?void 0:e.touches.length)!==2||e.preventDefault();}triggerZoomStart(e){var a,s,o,c;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||!((a=this.mediaTrackCapabilities)!=null&&a.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:(c=d.ideal)!=null?c: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(),false));}async updateStreamForResolution(e,t){var i;if(this.mediaStream==null)await this.initializeCameraForResolution(e,t);else try{let a=(i=this.activeCameraSettings)==null?void 0:i.getProperty("preferredAspectRatio");a$1.debug("Setting new resolution for active camera video stream..."),await this.mediaStream.getVideoTracks()[0].applyConstraints(d.getUserMediaVideoParameters(t,a)),await new Promise(o=>{this.videoElement.addEventListener("timeupdate",()=>{o();},{once:true});});let s=this.mediaStream.getVideoTracks()[0].getSettings();a$1.debug("New active camera video stream resolution set",{width:s.width,height:s.height});}catch(a){if(t===4)throw a;await this.updateStreamForResolution(e,t+1);}}async videoTrackEndedRecovery(){if(document.visibilityState==="visible")try{a$1.debug('Detected video track "ended" event, try to reinitialize camera'),await this.reinitializeCamera();}catch{}else a$1.debug("Page is currently not visible, delay camera reinitialization until visible"),document.addEventListener("visibilitychange",this.checkCameraVideoStreamAccessIfVisibleListener);}videoTrackMuteRecovery(e){if(this.videoElement.onloadeddata!=null){a$1.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$1.debug(`Detected video track "${e.type}" event, ${t?"enable":"disable"} camera recovery`),this.gui.setCameraRecoveryVisible(t));}async clipMediaStreamIfNeeded(e){if(!this.clipArea)return e;let t=this.videoElement.cloneNode();t.srcObject=e,t.load();let i=document.createElement("canvas");i.width=this.clipArea.size.width,i.height=this.clipArea.size.height;let a=i.getContext("2d",{alpha:false,willReadFrequently:false});return a?(t.addEventListener("play",this.drawClippedFrame.bind(this,this.clipArea,t,a),{once:true}),t.addEventListener("pause",this.cleanupClippedStream.bind(this,t),{once:true}),await t.play(),i.captureStream()):e}drawClippedFrame(e,t,i){i.drawImage(t,e.origin.x,e.origin.y,e.size.width,e.size.height,0,0,e.size.width,e.size.height),this.clippedFrameRequestID=this.requestVideoFrame(this.drawClippedFrame.bind(this,e,t,i),t);}cleanupClippedStream(e){this.clippedFrameRequestID&&(this.cancelVideoFrame(this.clippedFrameRequestID,e),this.clippedFrameRequestID=void 0);}connectedCallback(e){e.replaceWith(this.videoElement),this.canvas.addEventListener("webglcontextlost",this.handleWebGLContextLostListener),this.videoElement.addEventListener("pause",this.handleVideoPauseHandler),this.playVideo();}disconnectedCallback(){this.canvas.removeEventListener("webglcontextlost",this.handleWebGLContextLostListener),this.videoElement.removeEventListener("pause",this.handleVideoPauseHandler),this.videoElement.remove(),this.videoElement.removeAttribute("width"),this.videoElement.removeAttribute("height"),this.videoElement.style.removeProperty("visibility");}getVideoElement(){return this.videoElement}handleVideoPause(){this.playVideo();}};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$c.MIRRORED_CLASS_NAME,n._instance=null;var z=n;var v=class extends a{constructor(){super(...arguments);this.colorType="RGBA";}get _initialized(){return this._texture!=null&&this._framebuffer!=null}readFromSource(t){this._initialized||this.setup(),this.updateFrameSizeIfNeeded();let i=this._framePool.pop();return this._contextWebGL.texImage2D(this._contextWebGL.TEXTURE_2D,0,this._contextWebGL.RGBA,this._contextWebGL.RGBA,this._contextWebGL.UNSIGNED_BYTE,t),this._contextWebGL.readPixels(0,0,this._contextWebGL.drawingBufferWidth,this._contextWebGL.drawingBufferHeight,this._contextWebGL.RGBA,this._contextWebGL.UNSIGNED_BYTE,i),{width:this._contextWebGL.drawingBufferWidth,height:this._contextWebGL.drawingBufferHeight,data:i,frameId:E(),colorType:this.colorType}}setup(){this._texture=this._contextWebGL.createTexture(),this._texture==null&&a$1.warn("Could not create texture from WebGLRenderingContext"),this._contextWebGL.bindTexture(this._contextWebGL.TEXTURE_2D,this._texture),this._framebuffer=this._contextWebGL.createFramebuffer(),this._framebuffer==null&&a$1.warn("Could not create frameBuffer from WebGLRenderingContext"),this._contextWebGL.bindFramebuffer(this._contextWebGL.FRAMEBUFFER,this._framebuffer),this._contextWebGL.framebufferTexture2D(this._contextWebGL.FRAMEBUFFER,this._contextWebGL.COLOR_ATTACHMENT0,this._contextWebGL.TEXTURE_2D,this._texture,0),this._contextWebGL.texParameteri(this._contextWebGL.TEXTURE_2D,this._contextWebGL.TEXTURE_WRAP_S,this._contextWebGL.CLAMP_TO_EDGE),this._contextWebGL.texParameteri(this._contextWebGL.TEXTURE_2D,this._contextWebGL.TEXTURE_WRAP_T,this._contextWebGL.CLAMP_TO_EDGE),this._contextWebGL.texParameteri(this._contextWebGL.TEXTURE_2D,this._contextWebGL.TEXTURE_MIN_FILTER,this._contextWebGL.NEAREST),this._contextWebGL.texParameteri(this._contextWebGL.TEXTURE_2D,this._contextWebGL.TEXTURE_MAG_FILTER,this._contextWebGL.NEAREST);}dispose(){var t;this._texture!=null&&(this._contextWebGL.deleteTexture(this._texture),this._texture=null),this._framebuffer!=null&&(this._contextWebGL.deleteFramebuffer(this._framebuffer),this._framebuffer=null),(t=this._framePool)==null||t.empty();}updateFrameSizeIfNeeded(){var s;let{drawingBufferWidth:t,drawingBufferHeight:i}=this._contextWebGL,a=t*i*4;this._frameSize!==a&&(this._frameSize=a,(s=this._framePool)==null||s.empty(),this._framePool=new a$2({capacity:this._maxPoolCapacity,lowWaterMark:this._minPoolCapacity,createItem:()=>new Uint8ClampedArray(this._frameSize)}));}};export{v as a,T as b,H as c,Z as d,E as e,X as f,z as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$3}from'./chunk-
|
|
1
|
+
import {a as a$3}from'./chunk-UJYGOVXB.js';import {a as a$5}from'./chunk-GHTCNOQN.js';import {a as a$1}from'./chunk-UWBNF47P.js';import {a}from'./chunk-EV4OEANA.js';import {a as a$2}from'./chunk-3A4KLILV.js';import {a as a$4}from'./chunk-LSZZVJ6B.js';var c="scandit-loading-overlay",t=class t extends a{constructor(){super();this._progressBar=null;this._label=null;let e=this.attachShadow({mode:"open"});e.innerHTML=a$1`<div class="loading-overlay"><label for="scandit-progress" class="message">Loading...</label><scandit-progress-bar id="scandit-progress" min="0" max="100"></scandit-progress-bar></div>`,e.append(t.createStyleElement().cloneNode(true));}set progress(e){this._progressBar&&(this._progressBar.value=e);}set message(e){this._label&&(this._label.textContent=e);}get message(){var e,r;return (r=(e=this._label)==null?void 0:e.textContent)!=null?r:""}static create(){return t.register(),document.createElement(t.tag)}static register(){a$2({[c]:t,[a$3.tag]:a$3});}static createStyleElement(){return a$4`@media (prefers-color-scheme:dark){.loading-overlay{--foreground-color:#fff;--background-color:#000000e6}}@media (prefers-color-scheme:light){.loading-overlay{--foreground-color:#000;--background-color:#ffffffe6}}${a$3.tag}{max-width:15rem}.loading-overlay{align-items:center;background-color:var(--background-color);display:flex;flex-direction:column;height:100%;justify-content:center;position:absolute;width:100%;z-index:1}:host([hidden]){display:none}.loading-overlay .message{color:var(--foreground-color);font-family:Open Sans,sans-serif;margin-bottom:1rem;text-align:center}`}connectedCallback(){var e,r;this._progressBar=(e=this.shadowRoot)==null?void 0:e.querySelector(a$3.tag),this._label=(r=this.shadowRoot)==null?void 0:r.querySelector("label"),this.message=a$5.getInstance().get("core.view.loading");}show(){this.removeAttribute("hidden");}hide(){this.setAttribute("hidden","");}};t.tag=c;var d=t;export{d as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-33ZWDLU7.js';import {a as a$2}from'./chunk-UWBNF47P.js';import {a as a$1}from'./chunk-3A4KLILV.js';var e=class e extends a{static create(){return document.createElement(e.tag)}static register(){a$1({[e.tag]:e});}render(){return a$2`<style>${e.tag}{display:flex}</style><svg width="${this.size}" height="${this.heightForViewbox(32,32)}" viewBox="0 0 32 32" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M16.625 15C15.8656 15 15.25 15.6156 15.25 16.375C15.25 17.1344 15.8656 17.75 16.625 17.75C17.3844 17.75 18 17.1344 18 16.375C18 15.6156 17.3844 15 16.625 15ZM12.5 16.375C12.5 14.0968 14.3468 12.25 16.625 12.25C18.9032 12.25 20.75 14.0968 20.75 16.375C20.75 18.6532 18.9032 20.5 16.625 20.5C14.3468 20.5 12.5 18.6532 12.5 16.375Z" fill="${this.fill}"/><path fill-rule="evenodd" clip-rule="evenodd" d="M22.5277 13.2223C23.0647 13.7592 23.9353 13.7592 24.4723 13.2223C25.0092 12.6853 25.0092 11.8147 24.4723 11.2777L24.0695 10.875H24.875C25.6344 10.875 26.25 11.4906 26.25 12.25V21.875C26.25 22.6344 25.6344 23.25 24.875 23.25H16.625C15.8656 23.25 15.25 23.8656 15.25 24.625C15.25 25.3844 15.8656 26 16.625 26H24.875C27.1532 26 29 24.1532 29 21.875V12.25C29 9.97183 27.1532 8.125 24.875 8.125H24.0695L24.4723 7.72227C25.0092 7.1853 25.0092 6.3147 24.4723 5.77773C23.9353 5.24076 23.0647 5.24076 22.5277 5.77773L19.7777 8.52773C19.5199 8.78559 19.375 9.13533 19.375 9.5C19.375 9.86467 19.5199 10.2144 19.7777 10.4723L22.5277 13.2223Z" fill="${this.fill}"/><path fill-rule="evenodd" clip-rule="evenodd" d="M12.5 7.4375C12.5 7.0578 12.8078 6.75 13.1875 6.75H19.375C20.1344 6.75 20.75 6.13439 20.75 5.375C20.75 4.61561 20.1344 4 19.375 4H13.1875C11.289 4 9.75 5.53902 9.75 7.4375C9.75 7.8172 9.4422 8.125 9.0625 8.125H8.375C6.09683 8.125 4.25 9.97183 4.25 12.25V21.875C4.25 24.1532 6.09683 26 8.375 26H9.18046L8.77773 26.4027C8.24076 26.9397 8.24076 27.8103 8.77773 28.3473C9.3147 28.8842 10.1853 28.8842 10.7223 28.3473L13.4723 25.5973C14.0092 25.0603 14.0092 24.1897 13.4723 23.6527L10.7223 20.9027C10.1853 20.3658 9.3147 20.3658 8.77773 20.9027C8.24076 21.4397 8.24076 22.3103 8.77773 22.8473L9.18046 23.25H8.375C7.61561 23.25 7 22.6344 7 21.875V12.25C7 11.4906 7.61561 10.875 8.375 10.875H9.0625C10.961 10.875 12.5 9.33598 12.5 7.4375Z" fill="${this.fill}"/></svg>`}};e.tag="scandit-camera-switch-reverse-icon";var C=e;export{C as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=(o=>(o.AboveControls="above-controls",o))(e||{});export{e as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {d,a as a$2}from'./chunk-22UMTZI6.js';import {b as b$1}from'./chunk-Y3TODCJD.js';import {a as a$1,b as b$2}from'./chunk-ZAXZRQYF.js';import {a as a$3}from'./chunk-AAPD5YU3.js';import {a}from'./chunk-SJIN27Q5.js';import {b}from'./chunk-YONR3EGV.js';var A=class{constructor(t){this.audioBuffer=null;this.loadPromise=null;this.soundPool=[];this.soundPoolSize=25;this.inactiveSounds=new Set;var e;this.src=Array.isArray(t.src)?t.src[0]:t.src,t.html5!==void 0?this.html5=t.html5:this.html5=b.isIOS(),(e=a)==null||e(`\u{1F3B5} Howl created: using ${this.html5?"HTML5 <audio> (BLOCKING)":"Web Audio API (non-blocking)"}`),a$1(this),d();}async load(){if(this.loadPromise)return this.loadPromise;if(this.audioBuffer)return this.audioBuffer;let t=b$1().get(this.src);return t?(this.loadPromise=t,this.audioBuffer=await t,this.audioBuffer):(this.loadPromise=(async()=>{var e,i,s;try{let n=a$2().getContext(),a$1;if(this.src.startsWith("data:")){(e=a)==null||e("\u{1F50A} Decoding data URI directly (bypassing fetch)");let c=this.src.split(",")[1],r=atob(c),d=new Uint8Array(r.length);for(let l=0;l<r.length;l++)d[l]=r.charCodeAt(l);a$1=d.buffer;}else (i=a)==null||i(`\u{1F50A} Fetching audio from URL: ${this.src}`),a$1=await(await fetch(this.src)).arrayBuffer();let u=await n.decodeAudioData(a$1);return this.audioBuffer=u,u}catch(n){throw (s=a)==null||s(`Failed to load audio: ${n instanceof Error?n.message:String(n)}`),n}})(),b$1().set(this.src,this.loadPromise),this.loadPromise)}getSoundFromPool(){var e,i,s;if(this.inactiveSounds.size>0){let n=[...this.inactiveSounds][0];return this.inactiveSounds.delete(n),(e=a)==null||e(`\u{1F3B5} HTML5: Reusing sound from pool [${this.inactiveSounds.size} inactive, ${this.soundPool.length} total]`),n}if(this.soundPool.length<this.soundPoolSize){let n=new a$3(this.src,a=>{this.inactiveSounds.add(a);});return this.soundPool.push(n),(i=a)==null||i(`\u{1F3B5} HTML5: Created new sound, pool size: ${this.soundPool.length}/${this.soundPoolSize}`),n}(s=a)==null||s(`\u26A0\uFE0F HTML5: Sound pool exhausted (${this.soundPool.length}/${this.soundPoolSize}), force reusing first sound`);let t=this.soundPool[0];return this.inactiveSounds.delete(t),t}verifyAudioBuffer(t){if(!a)return;let e=t.getChannelData(0),i=0;for(let s=0;s<Math.min(1e3,e.length);s++)i=Math.max(i,Math.abs(e[s]));a(`\u{1F50A} Audio data check: max sample value = ${i.toFixed(4)} (first 1000 samples)`),i<.001&&a("\u274C WARNING: Audio appears to be SILENT - all samples near zero!");}handlePlaybackError(t){var e,i,s;t instanceof DOMException?t.name==="NotAllowedError"?(e=a)==null||e("\u274C Sound playback blocked by autoplay policy."):t.name!=="AbortError"&&((i=a)==null||i(`\u274C Sound playback failed: ${t.name} - ${t.message}`)):(s=a)==null||s(`\u274C Sound playback failed: ${t instanceof Error?t.message:String(t)}`);}async prepareAudioContext(t){var i,s,n,a$1;t.unlocked||((i=a)==null||i("\u26A0\uFE0F AudioContext not unlocked, attempting unlock..."),await t.unlock()),t.checkAndRecreateContextIfSampleRateChanged();let e=t.getContext();return (s=a)==null||s(`\u{1F50A} AudioContext state before play: ${e.state}`),e.state==="suspended"&&((n=a)==null||n("\u26A0\uFE0F AudioContext is suspended, resuming..."),await e.resume(),(a$1=a)==null||a$1(`\u{1F50A} AudioContext state after resume: ${e.state}`)),e}playHTML5(){var t,e;try{let i=this.getSoundFromPool();(t=a)==null||t(`\u{1F50A} HTML5: Playing [pool: ${this.soundPool.length}]`),i.play();}catch(i){(e=a)==null||e(`\u274C HTML5: Failed to setup playback: ${i instanceof Error?i.message:String(i)}`);}}play(){this.playAsync();}async playAsync(){var t,e,i,s,n,a$1;try{if(this.html5)return this.playHTML5();let u=a$2(),c=await this.prepareAudioContext(u),r=await this.load();this.verifyAudioBuffer(r);let d=c.createBufferSource();d.buffer=r,d.loop=false;let l=c.createGain();l.gain.value=1,(t=a)==null||t(`\u{1F50A} Setting gain to ${l.gain.value}`),d.connect(l);let b$1=u.getDestination();l.connect(b$1),(e=a)==null||e(`\u{1F50A} Connected to ${b.isIOS()?"MediaStreamDestination (iOS workaround)":"standard destination"}`),(i=a)==null||i(`\u{1F50A} Starting playback: ${r.duration}s, ${r.numberOfChannels}ch, ${r.sampleRate}Hz`),(s=a)==null||s(`\u{1F50A} Destination: ${c.destination.maxChannelCount}ch max, context SR: ${c.sampleRate}Hz`),(n=a)==null||n(`\u{1F50A} Gain value: ${l.gain.value}, Buffer length: ${r.length} samples`),d.onended=()=>{var m;d.disconnect(),(m=a)==null||m("\u{1F50A} Audio playback ended - source node disconnected");},d.start(0),(a$1=a)==null||a$1("\u2705 source.start(0) called successfully");}catch(u){this.handlePlaybackError(u);}}dispose(){var t;for(let e of this.soundPool)e.stop(),e.dispose();this.soundPool=[],this.inactiveSounds.clear(),(t=a)==null||t("\u{1F3B5} HTML5 sound pool cleared during Howl disposal"),b$2(this);}};export{A as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {e}from'./chunk-
|
|
1
|
+
import {e}from'./chunk-AKGGJKCA.js';import {a as a$1}from'./chunk-XR65N6EG.js';import {a}from'./chunk-QCZSSQAQ.js';var m=class i{constructor(){this.type="imageFrameSource";this._listeners=new Set;this._currentState="off";this._desiredState="off";this._context=null;this._imageData=null;}get desiredState(){return this._desiredState}get context(){return this._context}set context(e){this._context=e;}get currentState(){return this._currentState}static async fromFile(e){let r=URL.createObjectURL(e),t=new Image;t.src=r;try{await t.decode();}catch{throw new a({name:"InvalidImageError",message:"Submitted file is not an image"})}finally{URL.revokeObjectURL(r);}return i.fromImage(t)}static async fromImage(e){let r=new i;try{await e.decode();}catch{throw new a({name:"InvalidImageError",message:"Submitted image cannot be decoded"})}let t=r.getCanvasAndContext(e.width,e.height);return t.drawImage(e,0,0),r._imageData=t.getImageData(0,0,e.width,e.height,{colorSpace:"srgb"}),r}static async fromImageData(e){let r=new i,t=r.getCanvasAndContext(e.width,e.height);try{t.putImageData(e,0,0);}catch(n){throw new a({name:"InvalidImageError",message:`Submitted image data does not seem valid (details: ${n})`})}return r._imageData=e,r}async switchToDesiredState(e){if(e==="on"){if(this.currentState==="on")return}else if(this.currentState==="off")return;if(this._desiredState=e,e==="off"){await this.setCurrentState("off");return}return this._imageData==null?(a$1.log(a$1.Level.Warn,"No image data to process."),this.processSubmittedImage({data:new Uint8ClampedArray(0),width:0,height:0,colorSpace:"srgb"})):this.processSubmittedImage(this._imageData)}addListener(e){e!=null&&this._listeners.add(e);}removeListener(e){e!=null&&this._listeners.delete(e);}toJSONObject(){return {type:this.type}}getCurrentState(){return this._currentState}getCanvasAndContext(e,r){let t=document.createElement("canvas");t.width=e,t.height=r;let n=t.getContext("2d");if(n==null)throw new a({name:"ImageFrameSourceError",message:"Could not generate a canvas context to get image data"});return n}async setCurrentState(e){if(e!==this._currentState)return this._currentState=e,this.notifyListeners(),this.notifyContext({type:"frameSourceState",newValue:e})}async notifyContext(e){if(this._context)return this._context.update([e])}notifyListeners(){for(let e of this._listeners)e.didChangeState&&e.didChangeState(this,this.currentState);}async processSubmittedImage(e$1){var t;await this.setCurrentState("on");let r={data:e$1.data,width:e$1.width,height:e$1.height,frameId:e()};await((t=this._context)==null?void 0:t.sendFrameToProcessor(r)),await this.setCurrentState("off");}};export{m as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e;(o=>{function i(){let r="8.3.0";return r}o.sdkVersion=i;})(e||(e={}));export{e as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a as a$9}from'./chunk-GS7VZDY5.js';import {b as b$2}from'./chunk-HILZP6OW.js';import {a as a$a}from'./chunk-ARODHCN7.js';import {a as a$j}from'./chunk-A5G2NHT2.js';import {b,a as a$4}from'./chunk-RXDVYEE5.js';import {a as a$h}from'./chunk-S2GRD6GO.js';import {a as a$b}from'./chunk-TPHGDMKG.js';import {a as a$f}from'./chunk-GPPCTFZF.js';import {a as a$l}from'./chunk-Y7V35LNT.js';import {b as b$1}from'./chunk-24MGHMOY.js';import {a as a$e}from'./chunk-KVRNF3VA.js';import {a as a$g}from'./chunk-XIAF6V7E.js';import {a as a$c}from'./chunk-KYNYQBNF.js';import {a as a$7}from'./chunk-RSQRPDVQ.js';import {a}from'./chunk-2OCDIZIS.js';import {a as a$6}from'./chunk-IJQG3OU6.js';import {a as a$8}from'./chunk-I6SWF3FQ.js';import {a as a$3}from'./chunk-N5YZEC56.js';import {a as a$2}from'./chunk-VJB527QZ.js';import {a as a$1}from'./chunk-GHTCNOQN.js';import {a as a$d}from'./chunk-UWBNF47P.js';import {g}from'./chunk-AKGGJKCA.js';import {a as a$o}from'./chunk-LFJUGRQV.js';import {a as a$5}from'./chunk-KAFNKP6O.js';import {a as a$n}from'./chunk-E4XJ4GKD.js';import {a as a$k}from'./chunk-QOCHMKNY.js';import {a as a$i}from'./chunk-XR65N6EG.js';import {a as a$m}from'./chunk-WUHKODFA.js';var P="core.camera.recovery",K;K=a$o;var L=class L{constructor(){this.focusGesture=a.focusGesture;this.zoomGesture=a.zoomGesture;this._scanAreaMargins=a.scanAreaMargins;this._pointOfInterest=a.pointOfInterest;this._logoStyle=a.logoStyle;this._logoAnchor=a.logoAnchor;this._logoOffset=a.logoOffset;this._context=null;this.overlays=new Set;this.controls=new Set;this.frameSourceListener={didChangeState:this.onFrameSourceChange.bind(this)};this._previewCamera=null;this.isConnected=false;this.controlsElement=void 0;this.frozenFrameCanvas=document.createElement("canvas");this.listeners=[];this.isVideoElementDetached=false;this.orientation="portrait";this.hiddenProperties={stopVideoTracksOnVisibilityChange:true,freezeFrameWhenStoppingFrameSource:true};this.orientationObserver=new b;this.onOrientationChangeListener=this.onOrientationChange.bind(this);this.onHintPresenterUpdateHandler=this.onHintPresenterUpdate.bind(this);this.onViewFinderUpdateRequestedHandler=this.onViewFinderUpdateRequested.bind(this);this.onWorkerMessageHandler=this.onWorkerMessage.bind(this);this.htmlElementDidChangeHandler=this.htmlElementDidChange.bind(this);this.htmlElementDisconnectedHandler=this.htmlElementDisconnected.bind(this);this.notificationPresenter=null;this[K]={attachAdditionalLayer:this.attachAdditionalLayer.bind(this)};this.visibilityListener=this.onVisibilityChange.bind(this),this.cameraRecoveryListener=this.cameraRecovery.bind(this),a$1.getInstance().updateIfMissing(a$2);}get videoElement(){return g.instance().getVideoElement()}get scanAreaMargins(){return this._scanAreaMargins}set scanAreaMargins(e){var t;this._scanAreaMargins=e,(t=this.privateContext)==null||t.update();}get pointOfInterest(){return this._pointOfInterest}set pointOfInterest(e){var t;this._pointOfInterest=e,(t=this.privateContext)==null||t.update();}get logoStyle(){return this._logoStyle}set logoStyle(e){var t;this._logoStyle=e,(t=this.privateContext)==null||t.update();}get logoAnchor(){return this._logoAnchor}set logoAnchor(e){var t;this._logoAnchor=e,(t=this.privateContext)==null||t.update();}get logoOffset(){return this._logoOffset}set logoOffset(e){var t;this._logoOffset=e,(t=this.privateContext)==null||t.update();}get cameraRecoveryText(){return a$1.getInstance().get(P)}get width(){var e,t;return Math.round((t=(e=this.htmlElementState)==null?void 0:e.width)!=null?t:0)}get height(){var e,t;return Math.round((t=(e=this.htmlElementState)==null?void 0:e.height)!=null?t:0)}get canvasDrawer(){return !this._canvasDrawer&&this.canvasElement!=null&&(this._canvasDrawer=new b$1(this.canvasElement),this._canvasDrawer.startObservingCanvasResize()),this._canvasDrawer}get privateContext(){return this._context}static async forContext(e){let t=new L;return await t.setContext(e),t}showProgressBar(){var e;(e=this.loadingOverlay)==null||e.show();}hideProgressBar(){var e;(e=this.loadingOverlay)==null||e.hide();}setProgressBarPercentage(e){this.loadingOverlay&&(this.loadingOverlay.progress=e);}setProgressBarMessage(e){this.loadingOverlay&&(this.loadingOverlay.message=e);}getContext(){return this._context}async setContext(e){var t,i,a;if(this._context=e,e){if(this.overlays.size>0&&!((t=this.privateContext)!=null&&t.hasModes()))throw new Error(["Cannot assign this view to this context. This view has overlays but the context does not have any mode attached matching these overlays.","Remove the overlays first before attaching the view to the context, or add the corresponding mode to the context before attaching this view."].join(" "));await e.setView(this),(i=this.privateContext)==null||i.subscribeToWorkerMessages(this.onWorkerMessageHandler),(a=this._context)!=null&&a.frameSource&&await this.onFrameSourceChange(this._context.frameSource);}}connectToElement(e,t){var i,a,r,n;this.isConnected||(this.orientationObserver.register(),this.setupHtmlElement(e),(i=this.canvasDrawer)==null||i.startObservingCanvasResize(),this.htmlElementDidChange(),a$3.add(this),this.orientation=this.orientationObserver.orientation.value,this.orientationObserver.addEventListener(a$4,this.onOrientationChangeListener),(a=this.hintPresenter)==null||a.addEventListener("hintpresenterupdate",this.onHintPresenterUpdateHandler),(r=this.hintPresenter)==null||r.addEventListener("hintpresenterviewfinderupdaterequested",this.onViewFinderUpdateRequestedHandler),this.localizationSubscription=a$1.getInstance().subscribe(s=>{s[P]!=null&&(this.cameraRecoveryElement.textContent=s[P]);}),this._previewCamera=(n=t==null?void 0:t.camera)!=null?n:null,this._previewCamera&&(this._previewCamera.addListener(this.frameSourceListener),this.onFrameSourceChange(this._previewCamera)),this.updateControls(),this.isConnected=true);}detachFromElement(){var e,t,i,a,r,n,s,h;if(this.isConnected){(e=this.htmlElementState)==null||e.removeListeners(),this.removeStyles(),(t=this.canvasDrawer)==null||t.endObservingCanvasResize(),document.removeEventListener("visibilitychange",this.visibilityListener);for(let m of ["touchend","mousedown"])this.cameraRecoveryElement.removeEventListener(m,this.cameraRecoveryListener);(i=this.loadingOverlay)==null||i.remove(),(a=this.customLocationsView)==null||a.unmount(),this.notificationPresenter=null,this.htmlElementDidChange(),(r=this.gestureRecognizer)==null||r.removeAllListeners(),this.clearHtmlElementContent(),a$3.delete(this),this.orientationObserver.unregister(),this.orientationObserver.removeEventListener(a$4,this.onOrientationChangeListener),(n=this.hintPresenter)==null||n.removeEventListener("hintpresenterupdate",this.onHintPresenterUpdateHandler),(s=this.hintPresenter)==null||s.removeEventListener("hintpresenterviewfinderupdaterequested",this.onViewFinderUpdateRequestedHandler),(h=this.localizationSubscription)==null||h.cancel(),g.instance().disconnectedCallback(),this._previewCamera&&(this._previewCamera.removeListener(this.frameSourceListener),this._previewCamera=null);for(let m of this.controls)this.removeControl(m);this.isConnected=false;}}async addOverlay(e){var t;this.overlays.has(e)||(this.overlays.add(e),await((t=this.privateContext)==null?void 0:t.update([{type:"addOverlay",newValue:e,view:this}])));}async removeOverlay(e){var t;this.overlays.has(e)&&(await((t=this.privateContext)==null?void 0:t.update([{type:"removeOverlay",newValue:e,view:this}])),this.overlays.delete(e));}addListener(e){this.listeners.includes(e)||this.listeners.push(e);}removeListener(e){this.listeners.includes(e)&&this.listeners.splice(this.listeners.indexOf(e),1);}viewPointForFramePoint(e){var u,V,D,R,F,A,M,I;let t={width:(V=(u=this.htmlElementState)==null?void 0:u.width)!=null?V:0,height:(R=(D=this.htmlElementState)==null?void 0:D.height)!=null?R:0},i={width:(A=(F=this.videoElement)==null?void 0:F.videoWidth)!=null?A:0,height:(I=(M=this.videoElement)==null?void 0:M.videoHeight)!=null?I:0},a=t.width/t.height,r=i.width/i.height,n=a>r?t.width/i.width:t.height/i.height,s={x:e.x*n,y:e.y*n},h=(i.width*n-t.width)/2,m=(i.height*n-t.height)/2;return new a$5(s.x-h,s.y-m)}viewQuadrilateralForFrameQuadrilateral(e){let t=this.viewPointForFramePoint(e.topLeft),i=this.viewPointForFramePoint(e.topRight),a=this.viewPointForFramePoint(e.bottomLeft),r=this.viewPointForFramePoint(e.bottomRight);return new a$6(t,i,r,a)}addControl(e){this.controls.has(e)||(this.controls.add(e),e.install(this).then(t=>{var i;t&&((i=this.privateContext)==null||i.update([{type:"addControl",newValue:e}]));}));}removeControl(e){var t;this.controls.has(e)&&(e.remove(true),this.controls.delete(e),(t=this.privateContext)==null||t.update([{type:"removeControl",newValue:e}]));}toJSONObject(){var e;return {scanAreaMargins:this.scanAreaMargins.toJSONObject(),pointOfInterest:this.pointOfInterest.toJSONObject(),logoAnchor:this.logoAnchor,logoOffset:this.logoOffset.toJSONObject(),logoHidden:(e=this.logoHidden)!=null?e:false,logoStyle:this.logoStyle,overlays:[...this.overlays].map(t=>t.toJSONObject()),controls:[...this.controls].map(t=>t.toJSONObject()),focusGesture:this.focusGesture?this.focusGesture.toJSONObject():null,zoomGesture:this.zoomGesture?this.zoomGesture.toJSONObject():null}}isCameraRecoveryVisible(){return !this.cameraRecoveryElement.hidden}setCameraRecoveryVisible(e){this.cameraRecoveryElement.hidden=!e;}async allowPictureInPicture(e){await g.instance().allowPictureInPicture(e);}viewAnchorPositionsForFrameAnchorPositions(e){let t=this.viewPointForFramePoint(e.topLeft),i=this.viewPointForFramePoint(e.topRight),a=this.viewPointForFramePoint(e.bottomLeft),r=this.viewPointForFramePoint(e.bottomRight),n=this.viewPointForFramePoint(e.centerLeft),s=this.viewPointForFramePoint(e.centerRight),h=this.viewPointForFramePoint(e.topCenter),m=this.viewPointForFramePoint(e.bottomCenter),u=this.viewPointForFramePoint(e.center);return new a$7(t,i,r,a,n,h,s,m,u)}setDidTapCustomLocationsViewListener(e){this.customLocationsView&&this.customLocationsView.listener===null&&(this.customLocationsView.listener=e);}renderCustomLocationsView(e){this.customLocationsView!=null&&(this.customLocationsView.setMirrored(g.instance().isMirrorImageEnabled()),Object.keys(e).includes("removedIds")?this.customLocationsView.render(e):this.customLocationsView.renderDomView(e));}getNotificationPresenter(){var e;if(!this.notificationPresenter){let t=(e=this.htmlElement)==null?void 0:e.querySelector(b$2.tag);if(!t)throw new Error("Notification presenter cannot be found. Please ensure the DataCaptureView is connected.");this.notificationPresenter=new a$8(t);}return this.notificationPresenter}removeStyles(){for(let e of document.querySelectorAll("style[scandit]"))e.remove();}onHintPresenterUpdate(e){var t;(t=this.privateContext)==null||t.workerCommand("hintPresenterV2update",{});}async onViewFinderUpdateRequested(e){var i;let t=await((i=this.privateContext)==null?void 0:i.workerCommand("getViewfinderInfo",{}));t!=null&&this.updateHintPresenterViewFinderRect(t.rect);}clearHtmlElementContent(){var e;this.htmlElement&&((e=this.canvasDrawer)==null||e.endObservingCanvasResize(),this.htmlElement.innerHTML="",this.cameraPaintboardElement=void 0,this.singleImageUploaderPaintboardElement=void 0,this.htmlElement=void 0);}setupHtmlElement(e){var r,n,s;this.createStyles(),this.htmlElement=e,b$2.register(),a$9.register(),a$a.register();let t=a$d`<div class="${a$b.CONTAINER_CLASS_NAME}" role="main" aria-label="Data capture view"><div class="${a$b.PAINTBOARDS_CONTAINER_CLASS_NAME}"><div data-js-id="loading-overlay"></div><div class="${a$b.PAINTBOARD_CLASS_NAME}" data-js-id="camera-paintboard"><div data-js-id="video-container"></div><img class="${a$b.FROZEN_FRAME}" data-js-id="frozen-frame" alt="Last captured camera frame shown while camera is on standby" hidden /><canvas></canvas><div data-js-id="${a$c.CUSTOM_VIEW_CONTAINER}"></div><${b$2.tag}></${b$2.tag}><${a$9.tag}></${a$9.tag}><div class="${a$b.CAMERA_RECOVERY_CLASS_NAME}" role="alert" aria-live="polite" aria-atomic="true" hidden>${this.cameraRecoveryText}</div><div class="${a$b.ERROR_CLASS_NAME}" role="alert" aria-live="assertive" aria-atomic="true" hidden></div></div><div class="${a$b.PAINTBOARD_CLASS_NAME}" data-js-id="singleimage-paintboard"></div></div></div>`;this.htmlElement.innerHTML=t,g.instance().connectedCallback(this.htmlElement.querySelector('[data-js-id="video-container"]')),this.isVideoElementDetached=false,this.hintPresenter=this.htmlElement.querySelector(b$2.tag),this.notificationPresenter=this.hintPresenter?new a$8(this.hintPresenter):null,this.loadingOverlay&&this.loadingOverlay.remove(),this.loadingOverlay=a$a.create(),this.loadingOverlay.hide(),(r=this.htmlElement.querySelector('[data-js-id="loading-overlay"]'))==null||r.replaceWith(this.loadingOverlay),this.customLocationsView&&this.customLocationsView.unmount(),this.customLocationsView=new a$e,this.customLocationsView.mount(this.htmlElement.querySelector(`[data-js-id="${a$c.CUSTOM_VIEW_CONTAINER}"]`)),this.customLocationsView.mapViewAnchorPositionsForFramePoint=h=>this.viewAnchorPositionsForFrameAnchorPositions(h),this.containerElement=this.htmlElement.querySelector(`.${a$b.CONTAINER_CLASS_NAME}`),this.cameraPaintboardElement=this.containerElement.querySelector('[data-js-id="camera-paintboard"]'),this.singleImageUploaderPaintboardElement=this.containerElement.querySelector('[data-js-id="singleimage-paintboard"]');let i=this.cameraPaintboardElement.querySelector("canvas");this.canvasElement==null?this.canvasElement=i:i.replaceWith(this.canvasElement);let a=this.cameraPaintboardElement.querySelector('[data-js-id="frozen-frame"]');this.frozenFrame==null?this.frozenFrame=a:a.replaceWith(this.frozenFrame),this.controlsElement=this.cameraPaintboardElement.querySelector(a$9.tag),this.cameraRecoveryElement=this.cameraPaintboardElement.querySelector(`.${a$b.CAMERA_RECOVERY_CLASS_NAME}`),this.errorElement=this.cameraPaintboardElement.querySelector(`.${a$b.ERROR_CLASS_NAME}`),this.lastFrameSourceState!=null&&((s=(n=this._context)==null?void 0:n.frameSource)==null||s.switchToDesiredState(this.lastFrameSourceState)),document.addEventListener("visibilitychange",this.visibilityListener);for(let h of ["touchend","mousedown"])this.cameraRecoveryElement.addEventListener(h,this.cameraRecoveryListener);this.htmlElementState&&this.htmlElementState.removeListeners(),this.htmlElementState=new a$f(this.htmlElement),this.htmlElementState.onStateChanged(this.htmlElementDidChangeHandler),this.htmlElementState.onDisconnected(this.htmlElementDisconnectedHandler),this.gestureRecognizer=new a$g(this.htmlElement),this.gestureRecognizer.addListener({onTap:async h=>{var m;(m=this.privateContext)==null||m.workerCommand("onTap",{point:h.toJSONObject()});}});}setupHtmlElementSingleImageUploader(e){var i;if(this.singleImageUploaderPaintboardElement==null)return;this.singleImageUploaderView&&this.singleImageUploaderView.unmount(),this.singleImageUploaderView=new a$h(e),this.singleImageUploaderView.mount(this.containerElement.querySelector('[data-js-id="singleimage-paintboard"]'));let t=(i=this._context)==null?void 0:i.frameSource;this.singleImageUploaderView.onInputCheck(a=>{t.getCurrentState()!=="starting"&&a.preventDefault();}),this.singleImageUploaderView.onBeforeFileRead(()=>{t._context&&this.singleImageUploaderView&&(this.singleImageUploaderView.canUploadFile=t._context.hasEnabledMode());}),this.singleImageUploaderView.onImageLoadError(()=>{t.currentState="starting",a$i.log(a$i.Level.Error,"Could not load image from selected file");}),this.singleImageUploaderView.onFileReaderError(a=>{var n,s;let r=a.target;t.currentState="starting",a$i.log(a$i.Level.Error,`Error while reading the file: ${(s=(n=r.error)==null?void 0:n.toString())!=null?s:""}`);}),this.singleImageUploaderView.onCaptureReady(async a=>{await t.processUploadedFileCapture(a);}),this.singleImageUploaderView.setButtonState(t.getCurrentState()==="starting"?"enabled":"disabled"),t.addView(this.singleImageUploaderView);}setupHtmlElementVisibility(e){this.cameraPaintboardElement!=null&&(this.cameraPaintboardElement.hidden=e!=="camera"),this.singleImageUploaderPaintboardElement!=null&&(this.singleImageUploaderPaintboardElement.hidden=e!=="singleImageUploader");}createStyles(){if(document.querySelector("style[scandit]")===null){let e=a$j();for(let[t,i]of Object.entries(e))i.setAttribute("scandit",`data-capture-sdk-${t}`),document.head.append(i);}}async onOrientationChange(e){var t,i;this.orientation=e.detail.value,await((i=this.privateContext)==null?void 0:i.update([{type:"viewChange",newValue:{...(t=this.htmlElementState)==null?void 0:t.toJSONObject(),orientation:this.orientation}}]));}htmlElementDidChange(){var i,a;if(!this.htmlElementState)return;let e=this.htmlElementState,t=e.toJSONObject();if(!a$f.areEquivalentJSONStates(this.lastHtmlElementState,t)){this.orientation=this.orientationObserver.orientation.value,(i=this.privateContext)==null||i.update([{type:"viewChange",newValue:{...e.toJSONObject(),orientation:this.orientation}}]),this.lastHtmlElementState=t,(a=this.canvasDrawer)==null||a.updateCanvasSizeAttributes(this.width,this.height),this.handleVideoDisplay(t.visible);for(let r of this.listeners)typeof r.didChangeSize=="function"&&r.didChangeSize(this,new a$k(t.size.width.value,t.size.height.value),this.orientation);}}async htmlElementDisconnected(){var e,t,i,a,r,n;g.instance().disconnectedCallback(),this.lastFrameSourceState=(t=(e=this._context)==null?void 0:e.frameSource)==null?void 0:t.getCurrentState(),await((a=(i=this._context)==null?void 0:i.frameSource)==null?void 0:a.switchToDesiredState("off")),await((n=this.privateContext)==null?void 0:n.update([{type:"viewChange",newValue:{...(r=this.htmlElementState)==null?void 0:r.toJSONObject(),orientation:this.orientation}}])),this.isConnected=false;}attachAdditionalLayer(e,t){var i;t==="above-controls"&&((i=this.controlsElement)==null||i.insertAdjacentElement("afterend",e));}handleVideoDisplay(e){this.videoElement==null||this.cameraPaintboardElement==null||(!e&&!this.isVideoElementDetached?(this.videoElement.width=0,this.videoElement.height=0,this.videoElement.style.opacity="0",this.videoElement.style.visibility="hidden",document.body.append(this.videoElement),this.isVideoElementDetached=true):e&&this.isVideoElementDetached&&(this.cameraPaintboardElement.insertAdjacentElement("afterbegin",this.videoElement),this.isVideoElementDetached=false,this.videoElement.style.removeProperty("visibility"),this.videoElement.removeAttribute("width"),this.videoElement.removeAttribute("height"),this.videoElement.style.removeProperty("opacity")));}isCanvasDrawerWithMetrics(e){return e instanceof a$l}onWorkerMessage(e){var t,i;switch(e.type){case "draw":{this.drawEngineCommands(e.payload);break}case "performanceMetricsReport":{let a=this._canvasDrawer;a!=null&&this.isCanvasDrawerWithMetrics(a)&&a.setPerformanceMetrics(e.payload);break}case "contextDidChangeStatus":{let a=a$m.fromJSON(e.payload);(t=this.loadingOverlay)==null||t.hide(),a.isValid?(this.clearError(),this.setVideoElementOpacity("1")):this.displayError(a);break}case "viewSizeChanged":{let a=e.payload;if(a==null)return;this.onSDCViewSizeChangedCallback(a);break}default:{(i=this.hintPresenter)==null||i.handleMessage(e);break}}}onSDCViewSizeChangedCallback(e){this.updateHintPresenterViewFinderRect(e.viewFinderRect);}updateHintPresenterViewFinderRect(e){var t;(t=this.hintPresenter)==null||t.setViewFinderRect(new a$n(new a$5(e.origin.x,e.origin.y),new a$k(e.size.width,e.size.height)));}drawEngineCommands(e){var t;(t=this.canvasDrawer)==null||t.draw(e);}displayError(e){this.errorElement.textContent=`Error ${e.code}: ${e.message}`,this.errorElement.hidden=false;}clearError(){this.errorElement.textContent="",this.errorElement.hidden=true;}updateControls(){var e;for(let t of this.controls)(e=t.update)==null||e.call(t,this);}async onFrameSourceChange(e){let t=e==null?void 0:e.type;if(this.setupHtmlElementVisibility(t),t==="camera"){let i=e==null?void 0:e.getCurrentState();i!=null&&await this.onCameraStateChanged(i);}else t==="singleImageUploader"&&this.setupHtmlElementSingleImageUploader(e.settings);}async onCameraStateChanged(e){var t;switch((t=this.cameraPaintboardElement)==null||t.classList.toggle(a$b.PAINTBOARD_CLASS_NAME_STATE_ON,e==="on"),e){case "stopping":{this.hiddenProperties.freezeFrameWhenStoppingFrameSource&&this.freezeFrame(),this.setVideoElementOpacity("0");return}case "starting":case "bootingUp":case "wakingUp":{if(!this.htmlElement){a$i.error("cannot set frame source stream before connecting view to an HTML element");return}this.videoElement&&(g.instance().gui.isCameraRecoveryVisible=this.isCameraRecoveryVisible.bind(this),g.instance().gui.setCameraRecoveryVisible=this.setCameraRecoveryVisible.bind(this),this.setVideoElementOpacity("0"));return}case "off":{this.setVideoElementOpacity("0"),this.updateControls();return}case "on":{await g.instance().waitForCapabilities(),this.updateControls(),this.unfreezeFrame(),this.setVideoElementOpacity("1");break}case "goingToSleep":{this.freezeFrame();break}}}setVideoElementOpacity(e){this.videoElement&&(this.videoElement.style.opacity=e),this.canvasElement&&(this.canvasElement.style.opacity=e);}onSingleImageUploaderSettingsChange(e){this.setupHtmlElementSingleImageUploader(e);}setHiddenProperty(e,t){this.hiddenProperties[e]=t;}async onVisibilityChange(){var t,i;let e=(t=this.videoElement)==null?void 0:t.srcObject;if(this.hiddenProperties.stopVideoTracksOnVisibilityChange&&(document.visibilityState==="hidden"&&g.instance().stopVideoTracks(),document.visibilityState==="visible"&&g.instance().activeCamera!=null&&e!=null))if(!e.active||(i=e.getVideoTracks()[0])!=null&&i.muted)try{a$i.debug('Detected visibility change ("visible") event with inactive video source, try to reinitialize camera'),await g.instance().reinitializeCamera();}catch{}else a$i.debug('Detected visibility change ("visible") event with active video source, replay video'),g.instance().playVideo();}async cameraRecovery(e){e.preventDefault(),g.instance().activeCamera=g.instance().selectedCamera,await g.instance().reinitializeCamera();}freezeFrame(){var i;if(!this.frozenFrame)return;let e=g.instance().getCurrentFrame();if(!e)return;let t=new ImageData(e.data,e.width,e.height);this.frozenFrameCanvas.width=t.width,this.frozenFrameCanvas.height=t.height,this.frozenFrame.width=t.width,this.frozenFrame.height=t.height,(i=this.frozenFrameCanvas.getContext("2d"))==null||i.putImageData(t,0,0),this.frozenFrame.src=this.frozenFrameCanvas.toDataURL("image/jpeg",.4),this.frozenFrame.classList.toggle(a$b.MIRRORED_CLASS_NAME,g.instance().isMirrorImageEnabled()),this.frozenFrame.hidden=false;}unfreezeFrame(){this.frozenFrame&&(this.frozenFrame.src="",this.frozenFrame.hidden=true);}},B=L;export{B as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$2}from'./chunk-SGL5J2CI.js';import {a}from'./chunk-UWBNF47P.js';import {a as a$
|
|
1
|
+
import {a as a$2}from'./chunk-SGL5J2CI.js';import {a}from'./chunk-UWBNF47P.js';import {a as a$1}from'./chunk-EV4OEANA.js';import {a as a$3}from'./chunk-3A4KLILV.js';import {a as a$4}from'./chunk-LSZZVJ6B.js';var s=a`<div role="listitem"><slot></slot></div>`,r=class r extends a$1{constructor(){super();let o=this.attachShadow({mode:"open"});o.innerHTML=s,o.append(r.createStyleElement().cloneNode(true));}set haloGlow(o){this.toggleAttribute("halo-glow",o);}get haloGlow(){return this.hasAttribute("halo-glow")}set border(o){this.toggleAttribute("border",o);}get border(){return this.hasAttribute("border")}set backgroundColor(o){this.style.setProperty("--background-color",`#${o.toJSON()}`);}get backgroundColor(){return a$2.fromHex(this.style.getPropertyValue("--background-color"))}set borderColor(o){this.style.setProperty("--border-color",`#${o.toJSON()}`);}get borderColor(){return a$2.fromHex(this.style.getPropertyValue("--border-color"))}static create(){return r.register(),document.createElement(r.tag)}static register(){a$3({[r.tag]:r});}static createStyleElement(){return a$4`@keyframes gradientShift{0%{background-position-x:100%}50%{background-position-x:0}to{background-position-x:100%}}:host{--corner-radius:0.75rem;--background-color:#ffffffe6;--border-color:#0000;--glow-max-width:1rem;--glow-horizontal-edge:min(5%,var(--glow-max-width));--glow-vertical-edge:min(20%,var(--glow-max-width));--glow-horizontal-start:calc(100% - var(--glow-horizontal-edge));--glow-vertical-start:calc(100% - var(--glow-vertical-edge));--card-min-height:5rem;--card-max-height:100px;backdrop-filter:saturate(180%) blur(20px);background-color:var(--background-color);border:1px solid var(--border-color);border-radius:var(--corner-radius);box-shadow:0 2px 6px 0 #12161926;box-sizing:border-box;display:block;font-family:SF Pro Text,sans-serif;max-height:var(--card-max-height);min-height:var(--card-min-height);min-width:200px;overflow:hidden;position:relative}:host>div[role=listitem]{height:100%;max-height:var(--card-max-height);min-height:var(--card-min-height);position:relative}:host([halo-glow])>div:before{animation:gradientShift 8s ease-in-out .2s infinite;background:linear-gradient(90deg,#ffd89b,#ff6f91 20%,#a566ff 45%,#64f6ff 70%,#ffd89b);background-size:300% 300%;border-radius:var(--corner-radius);content:"";filter:blur(30px);inset:0;mask:linear-gradient(to right,#000 0,#0000 var(--glow-horizontal-edge),#0000 var(--glow-horizontal-start),#000 100%),linear-gradient(to bottom,#000 0,#0000 var(--glow-vertical-edge),#0000 var(--glow-vertical-start),#000 100%);mask-composite:intersect;-webkit-mask:linear-gradient(to right,#000 0,#0000 var(--glow-horizontal-edge),#0000 var(--glow-horizontal-start),#000 100%),linear-gradient(to bottom,#000 0,#0000 var(--glow-vertical-edge),#0000 var(--glow-vertical-start),#000 100%);-webkit-mask-composite:source-over;opacity:1;position:absolute;transition:opacity .3s ease;z-index:0}:host([halo-glow])>div:before{opacity:.75}:host([halo-glow][border])>div:before{opacity:.75!important}:host(:not([halo-glow]))>div:before{animation:none;mask:none;-webkit-mask:none;opacity:0}:host([border]){--border-color:#d92121}:host(:not([border])){--border-color:#0000}`}};r.tag="scandit-basic-card";var n=r;export{n as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {e}from'./chunk-TTGJAMI2.js';import {a as a$2}from'./chunk-SGL5J2CI.js';import {a as a$1}from'./chunk-UWBNF47P.js';import {a
|
|
1
|
+
import {e}from'./chunk-TTGJAMI2.js';import {a as a$2}from'./chunk-SGL5J2CI.js';import {a as a$1}from'./chunk-UWBNF47P.js';import {a}from'./chunk-EV4OEANA.js';import {a as a$3}from'./chunk-3A4KLILV.js';import {a as a$4}from'./chunk-LSZZVJ6B.js';var v=(e=>(e.Circle="circle",e.Square="square",e))(v||{}),c="--width",l="--height",h="--background-color",d="--stroke-color",p="--stroke-width",n=class n extends a{constructor(){super();this.onSlotChangeListener=this.onSlotChange.bind(this);let e=this.attachShadow({mode:"open"});e.innerHTML=a$1`<div class="container shape-none"><slot></div>`,this.containerElement=e.querySelector(".container"),this.setStylePropertyValue(c,"32px"),this.setStylePropertyValue(l,"32px"),this.setStylePropertyValue(h,"transparent"),this.setStylePropertyValue(d,"#fff"),this.setStylePropertyValue(p,"0px"),e.append(n.createStyleElement().cloneNode(true));}get iconColor(){var o,r;let e=(o=this.shadowRoot)==null?void 0:o.querySelector("slot"),t=(r=e==null?void 0:e.assignedElements())!=null?r:[];return a$2.fromHex(t[0].fill)}set iconColor(e){this.render({propChanged:"iconcolor",value:`#${e.toJSON()}`});}get backgroundColor(){return a$2.fromHex(this.getStylePropertyValue(h))}set backgroundColor(e){this.render({propChanged:"backgroundcolor",value:`#${e.toJSON()}`});}get backgroundStrokeColor(){return a$2.fromHex(this.getStylePropertyValue(d))}set backgroundStrokeColor(e){this.render({propChanged:"backgroundstrokecolor",value:`#${e.toJSON()}`});}get backgroundStrokeWidth(){let e=this.getStylePropertyValue(p);return Number.parseInt(e,10)}set backgroundStrokeWidth(e){this.render({propChanged:"backgroundstrokewidth",value:String(e)});}get backgroundShape(){var t;let e=(t=/shape-(.*)/.exec(this.containerElement.classList.value))==null?void 0:t[1];return e!=null&&e!=="none"?e:null}set backgroundShape(e){this.render({propChanged:"backgroundshape",value:e!=null?e:"none"});}set width(e){this.render({propChanged:"width",value:String(e)}),this.updateIconSizeProperty(e,this.height);}get width(){let e=this.getStylePropertyValue(c).replace("px","");return Number.parseInt(e,10)}set height(e){this.render({propChanged:"height",value:String(e)}),this.updateIconSizeProperty(this.width,e);}get height(){let e=this.getStylePropertyValue(l).replace("px","");return Number.parseInt(e,10)}static create(){return n.register(),document.createElement(n.tag)}static register(){a$3({[n.tag]:n});}static createStyleElement(){return a$4`:host{display:inline-block;--width:32px;--height:32px;--background-color:#0000;--stroke-color:#fff;--stroke-width:0px}:host([hidden]){display:none}.container{background-color:var(--background-color);box-shadow:0 1px 2px 0 #${e.withAlpha(.3).toJSON()};height:calc(var(--height) - var(--stroke-width));outline:var(--stroke-width) solid var(--stroke-color);position:relative;width:calc(var(--width) - var(--stroke-width))}.container.shape-${"circle"}{border-radius:50%}.container.shape-${"square"}{border-radius:0}.container.shape-none{box-shadow:unset}::slotted(*){left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}`}onSlotChange(){this.updateIconSizeProperty(this.width,this.height);}connectedCallback(){var t;let e=(t=this.shadowRoot)==null?void 0:t.querySelector("slot");e==null||e.addEventListener("slotchange",this.onSlotChangeListener);}disconnectedCallback(){var t;let e=(t=this.shadowRoot)==null?void 0:t.querySelector("slot");e==null||e.removeEventListener("slotchange",this.onSlotChangeListener);}render({propChanged:e,value:t}){switch(e){case "width":{this.setStylePropertyValue(c,`${t}px`);break}case "height":{this.setStylePropertyValue(l,`${t}px`);break}case "backgroundstrokewidth":{this.setStylePropertyValue(p,`${t}px`);break}case "backgroundstrokecolor":{this.setStylePropertyValue(d,t);break}case "backgroundcolor":{this.setStylePropertyValue(h,t);break}case "iconcolor":{this.updateFillIconColor(a$2.fromHex(t));break}case "backgroundshape":{let o=t;this.containerElement.classList.toggle("shape-circle",o==="circle"),this.containerElement.classList.toggle("shape-square",o==="square"),this.containerElement.classList.toggle("shape-none",o==="none");break}}}attributeChangedCallback(e,t,o){this.render({propChanged:e,value:o});}getStylePropertyValue(e){return this.containerElement.style.getPropertyValue(e)}setStylePropertyValue(e,t){this.containerElement.style.setProperty(e,t);}updateIconSizeProperty(e,t){var a,u;let o=(a=this.shadowRoot)==null?void 0:a.querySelector("slot"),r=(u=o==null?void 0:o.assignedElements())!=null?u:[],s=Math.min(e,t);for(let C of r)C.size=s/2;}setIconSize(e){var r,s;let t=(r=this.shadowRoot)==null?void 0:r.querySelector("slot"),o=(s=t==null?void 0:t.assignedElements())!=null?s:[];for(let a of o)a.size=e;}updateFillIconColor(e){var r,s;let t=(r=this.shadowRoot)==null?void 0:r.querySelector("slot"),o=(s=t==null?void 0:t.assignedElements())!=null?s:[];for(let a of o)a.fill=`#${e.toJSON()}`;}};n.tag="scandit-icon-container",n.observedAttributes=["width","height","backgroundstrokecolor","backgroundcolor","backgroundstrokewidth","iconcolor","backgroundshape"];var y=n;export{v as a,y as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-UWBNF47P.js';import {a
|
|
1
|
+
import {a as a$1}from'./chunk-UWBNF47P.js';import {a}from'./chunk-EV4OEANA.js';import {a as a$2}from'./chunk-3A4KLILV.js';import {a as a$3}from'./chunk-LSZZVJ6B.js';var t=class t extends a{constructor(){super();let e=this.attachShadow({mode:"open"});e.innerHTML=a$1`<div class="controls-grid"><div class="top-left"><slot name="topLeft"></slot></div><div class="top-center"><slot name="topCenter"></slot></div><div class="top-right"><slot name="topRight"></slot></div><div class="center-left"><slot name="centerLeft"></slot></div><div class="center"><slot name="center"></slot></div><div class="center-right"><slot name="centerRight"></slot></div><div class="bottom-left"><slot name="bottomLeft"></slot></div><div class="bottom-center"><slot name="bottomCenter"></slot></div><div class="bottom-right"><slot name="bottomRight"></slot></div><slot></slot></div>`,e.append(t.createStyleElement().cloneNode(true));}static create(){return document.createElement(t.tag)}static register(){a$2({[t.tag]:t});}static createStyleElement(){return a$3`:host{height:100%;inset:0;pointer-events:none;position:absolute;width:100%}.controls-grid{box-sizing:border-box;display:grid;gap:0;grid-template-columns:1fr auto 1fr;grid-template-rows:1fr auto 1fr;height:100%;inset:0;padding:0;position:relative;width:100%}.top-left{grid-column:1;justify-self:start;padding:24px 0 0 16px}.top-center,.top-left{align-self:start;display:flex;flex-direction:column;gap:16px;grid-row:1;pointer-events:auto}.top-center{grid-column:2;justify-self:center;padding:24px 0 0}.top-right{align-self:start;display:flex;flex-direction:column;gap:16px;grid-column:3;grid-row:1;justify-self:end;padding:24px 16px 0 0;pointer-events:auto}.center-left{grid-column:1;justify-self:start;padding:0 0 0 16px}.center,.center-left{align-self:center;display:flex;flex-direction:column;gap:16px;grid-row:2;pointer-events:auto}.center{grid-column:2;justify-self:center;padding:0}.center-right{align-self:center;display:flex;flex-direction:column;gap:16px;grid-column:3;grid-row:2;justify-self:end;padding:0 16px 0 0;pointer-events:auto}.bottom-left{grid-column:1;justify-self:start;padding:0 0 24px 16px}.bottom-center,.bottom-left{align-self:end;display:flex;flex-direction:column-reverse;gap:16px;grid-row:3;pointer-events:auto}.bottom-center{grid-column:2;justify-self:center;padding:0 0 24px}.bottom-right{align-self:end;display:flex;flex-direction:column-reverse;gap:16px;grid-column:3;grid-row:3;justify-self:end;padding:0 24px 24px 0;pointer-events:auto}`}};t.tag="scandit-controls-layout";var s=t;export{s as a};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import {a as a$7}from'./chunk-O5D4KVS5.js';import {a as a$4}from'./chunk-ACFJP5SR.js';import {a as a$a,c as c$3,b as b$3}from'./chunk-L66S4DN2.js';import {a as a$j}from'./chunk-BA3RP6L2.js';import {a as a$8}from'./chunk-AIC4H5KG.js';import {a as a$h}from'./chunk-KSCFPJAW.js';import {a as a$d}from'./chunk-JS3T7K2Z.js';import {a as a$f}from'./chunk-W3X3ZRQZ.js';import {b as b$2}from'./chunk-6H6FKGVE.js';import {a as a$c}from'./chunk-N5YZEC56.js';import {a as a$6}from'./chunk-VJB527QZ.js';import {a as a$5}from'./chunk-GHTCNOQN.js';import {a as a$1}from'./chunk-LXOZUOZU.js';import {a as a$g}from'./chunk-FGO2SSRS.js';import {c as c$1,a as a$e}from'./chunk-6AQGNP4S.js';import {g,e as e$1}from'./chunk-AKGGJKCA.js';import {a as a$9}from'./chunk-GPJEB376.js';import {b as b$1}from'./chunk-YONR3EGV.js';import {c as c$2,e}from'./chunk-SBC5K7IT.js';import {a as a$3}from'./chunk-XR65N6EG.js';import {f as f$1}from'./chunk-3D2HNEVH.js';import {a as a$i}from'./chunk-WUHKODFA.js';import {a as a$2}from'./chunk-7SW2PEHB.js';import {a as a$b}from'./chunk-QCZSSQAQ.js';import {c}from'./chunk-TR3NGINC.js';var Q=[{from:"unconfigured",to:"configuring"},{from:"configuring",to:"configured"},{from:"configuring",to:"unconfigured"},{from:"configured",to:"creating-context"},{from:"creating-context",to:"ready"},{from:"creating-context",to:"unconfigured"},{from:"ready",to:"unconfigured"},{from:"configured",to:"unconfigured"}];function v(C,e,t){let r=t.value;return t.value=function(...n){let i=f.stateMachine;return i.currentState==="ready"&&f.mainDataCaptureLoader!=null?r.apply(this,n):i.isInitializing||i.currentState==="configured"?i.waitForState("ready").then(()=>r.apply(this,n)):Promise.reject(new Error(`Please call DataCaptureContext.forLicenseKey() before calling ${String(e)}`))},t}function G(C){return C[a$j]!=null}function x(C){return "skipSerialization"in C||C[a$j]!=null}var q,Y,_,a=class a{constructor(){this._asyncImageConverterInstance=void 0;this.framework="web";this.runtimeEnvironment={deviceOS:(q=b$1.getUserAgentInfo().getOS().name)!=null?q:"",browser:(Y=b$1.getUserAgentInfo().getBrowser().name)!=null?Y:"",browserVersion:(_=b$1.getUserAgentInfo().getBrowser().version)!=null?_:"",get deviceModelName(){let{model:e,vendor:t}=b$1.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.batteryChangeListener=this.onBatteryChange.bind(this);this.pendingWorkerMessageListeners=new Set;this.delayedRegistration=false;this.highEndBlurryRecognition=false;this._frameHandlers=[];this._useSynchronousFrameFlow=false;}static get moduleLicenseTextProviders(){return [new b]}static get sharedInstance(){return a._sharedInstance==null&&(a._sharedInstance=new a),a._sharedInstance}static get currentState(){return a.stateMachine.currentState}static get isReady(){return a.stateMachine.currentState==="ready"}static get isInitializing(){return a.stateMachine.isInitializing}static addStateListener(e){a.stateMachine.addListener(e);}static removeStateListener(e){a.stateMachine.removeListener(e);}async initializeWithOptions(e){var t,r,n,i,s,o,u,c,l;a.deviceID===""&&(a.deviceID=await b$1.getDeviceId()),this.licenseKey=(r=(t=e.licenseKey)!=null?t:a.userLicenseKey)!=null?r:"",this.deviceName=(n=e.deviceName)!=null?n:"",this.dataCaptureInstance=(i=e.dataCaptureInstance)!=null?i:a.mainDataCaptureLoader,this.delayedRegistration=(s=e.delayedRegistration)!=null?s:false,e.settings!=null&&(this.settings=e.settings),this.highEndBlurryRecognition=(l=(c=(o=e.dataCaptureInstance)==null?void 0:o.highEndBlurryRecognition)!=null?c:(u=a.mainDataCaptureLoader)==null?void 0:u.highEndBlurryRecognition)!=null?l:false;for(let S of this.pendingWorkerMessageListeners)this.dataCaptureInstance.addWorkerListener(S);this.pendingWorkerMessageListeners.clear(),this.settings!=null&&await this.applySettings(this.settings),await this.createContext();}get frameSource(){return this._frameSource}get workerCommand(){if(this.dataCaptureInstance==null)throw new Error("Cannot call workerCommand before dataCaptureInstance is set");return this.dataCaptureInstance.workerCommand.bind(this.dataCaptureInstance)}static async forLicenseKey(e,t){return a$3.debug(`forLicenseKey called, current state: ${a.stateMachine.currentState}`),a.stateMachine.currentState==="ready"?(a$3.debug("DataCaptureContext is already ready, returning existing instance"),a.sharedInstance):a.stateMachine.isInitializing?(a$3.debug("DataCaptureContext is already initializing, waiting for completion"),await a.stateMachine.waitForState("ready"),a.sharedInstance):(a.stateMachine.currentState==="unconfigured"&&(a$3.debug("Starting initialization from unconfigured state"),await a.stateMachine.executeAsyncTransition({targetState:"configuring",action:async()=>{await a.internalConfigure(e,t);},onSuccess:"configured",onError:"unconfigured"}),await a.stateMachine.executeAsyncTransition({targetState:"creating-context",action:async()=>{await a.sharedInstance.initializeWithOptions({licenseKey:e,deviceName:t.deviceName,settings:t.settings});},onSuccess:"ready",onError:"unconfigured"})),a.sharedInstance)}static async internalConfigure(e$1,t){var S;a$4(),c$1(),a$5.getInstance().updateIfMissing(a$6);let{forceAllPolyfills:r,overrideThreadsSupport:n,overrideSimdSupport:i}=a.getOverridesFromQueryString(),[s,o,u]=await Promise.all([a$7({forceAllPolyfills:r}),c$2(),e()]);n!=="auto"&&(a$3.warn(`Threads support override: was ${u} is now ${n==="on"}`),u=n==="on"),i!=="auto"&&(a$3.warn(`SIMD support override: was ${o} is now ${i==="on"}`),o=i==="on"),a.capabilityInfo={simdSupport:o,threadsSupport:u},a$3.debug(`Capability info detected - SIMD: ${o}, Threads: ${u}`),await a.validateOptions({...t,licenseKey:e$1});let c={licenseKey:e$1,libraryLocation:a$8(t.libraryLocation),moduleLoaders:t.moduleLoaders,logLevel:(S=t.logLevel)!=null?S:a$3.Level.Debug,verifyResponseHash:true,loadProgressNotifier:b$2.notify.bind(b$2),simdSupport:o,threadsSupport:u};a$3.setLevel(c.logLevel),a.userLicenseKey=c.licenseKey,a.libraryLocation=c.libraryLocation,b$2.subscribe(a.updateViewsWithProgress);let l=b$1.checkBrowserCompatibility();if(!l.fullSupport&&!l.scannerSupport)throw new a$9(l);b$1.isSupportedIOSVersion()||a$3.warn(`Warning: Minimum supported iOS version is 14.6.
|
|
2
|
+
Please check the minimum system requirements here:
|
|
3
|
+
https://docs.scandit.com/system-requirements#browser-compatibility`),a.dataCaptureLoaders=await a.loadModules(c.moduleLoaders,c),a.mainDataCaptureLoader=[...a.dataCaptureLoaders.entries()][0][1],b$2.unsubscribe(a.updateViewsWithProgress);}static async forLicenseKeyInElectronPath(e,t){if(!a$a())throw new a$b({name:"MisconfigurationError",message:"forLicenseKeyInElectronPath can only be used in Electron applications"});let r=await c$3({licenseDataPath:e});if(r==null)throw new a$b({name:"NoLicenseKeyError",message:`Cannot retrieve license key for Electron app at ${e}`});return a.forLicenseKey(r.licenseKey,{...t})}static updateViewsWithProgress({percentage:e}){for(let t of a$c.values())t.setProgressBarPercentage(e);}static getOverridesFromQueryString(){var s,o,u;function e(c){return ["auto","off","on"].includes(c)}let t=new URLSearchParams(window.location.search),[r="auto",n="auto",i=false]=[(s=t.get("pthreads"))==null?void 0:s.toLowerCase(),(o=t.get("simd"))==null?void 0:o.toLowerCase(),((u=t.get("forceAllPolyfills"))==null?void 0:u.toLowerCase())==="true"];return {overrideThreadsSupport:e(r)?r:"auto",overrideSimdSupport:e(n)?n:"auto",forceAllPolyfills:i}}static async validateOptions(e){if(e.licenseKey==null||e.licenseKey.trim().length<64)throw new a$b({name:"NoLicenseKeyError",message:"No license key provided"});if(typeof e.libraryLocation!="string")throw new a$b({name:"MisconfigurationError",message:'Option "libraryLocation" was not provided'});if(!Array.isArray(e.moduleLoaders)||e.moduleLoaders.length===0)throw new a$b({name:"MisconfigurationError",message:'Option "moduleLoaders" is missing or empty'});let t=e.moduleLoaders.map(r=>r.moduleName);if(!["BarcodeCapture","IdCapture","LabelCapture"].includes(t[0]))throw new a$b({name:"MisconfigurationError",message:'Main modules must be loaded before side modules. For example "BarcodeCapture" must be loaded before "Parser".'})}static async loadModules(e,t){let r=new Map,n=new Map;for(let i of e)n.set(i.moduleName,i.load(t));await Promise.all(n.values());for(let[i,s]of n)r.set(i,await s);return r}static async getOpenSourceSoftwareLicenseInfo(){let e=[];for(let r of a.moduleLicenseTextProviders){let n=await r.getLicenseText();e.push(n);}let t=e.join(`
|
|
4
|
+
|
|
5
|
+
`);return new a$d(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$1(e)})),await this.update([{type:"frameSourceState",newValue:this.frameSource}]),t)for(let r of this.listeners)r.didChangeFrameSource&&r.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),this.updateCameraFrameFlow(),await this.update([],{updateContext:!x(e)});}async removeMode(e){this.modes.delete(e),await e.detachedFromContext(),this.updateCameraFrameFlow(),await this.update([],{updateContext:!x(e)});}async setMode(e){this.modes.has(e)||(this.modes.clear(),this.modes.add(e),await e.attachedToContext(this),this.updateCameraFrameFlow(),await this.update());}async removeCurrentMode(){for(let e of this.modes)await e.detachedFromContext();this.modes.clear(),await this.update();}async removeAllModes(){let e=Array.from(this.modes);for(let t of e)await this.removeMode(t);}async dispose(){if(a.stateMachine.currentState!=="unconfigured")try{await a.stateMachine.executeAsyncTransition({targetState:"unconfigured",action:async()=>{g.instance().removeListener("cameraProperties",this.cameraPropertiesReportListener),g.instance().removeListener("cameraAccessError",this.cameraAccessErrorListener),this.unsubscribeToVisibilityChange(this.onVisibilityChangeListener);for(let e of this.modes)await e.detachedFromContext();this._view&&(await this._view.setContext(null),this._view=null),this.dataCaptureInstance&&(await this.dataCaptureInstance.terminateDataCaptureWorker(true).catch(()=>{}),this.dataCaptureInstance=void 0),this.webBatteryInterface&&(this.webBatteryInterface.dispose(),this.webBatteryInterface=void 0),a.deviceID="";},onSuccess:"unconfigured",onError:"unconfigured"});}catch(e){if(a.stateMachine.currentState==="unconfigured")return;throw e}finally{this.modes.clear(),this.listeners=[],this.components.length=0,this.updateListeners.clear(),this.pendingWorkerMessageListeners.clear(),this.delayedRegistration=false,this.highEndBlurryRecognition=false,this._frameHandlers.length=0,this.frameSource&&(this.frameSource.context=null,this._frameSource=null),g.instance().dispose(),this.licenseKey="",this.deviceName="",a$e();}}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(r=>!x(r)).map(r=>r.toJSONObject()),components:this.components.map(r=>r.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$a()){let t=await b$3();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{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.endsWith("]")&&(e=e.slice(1,-1)),e}async createContext(){this.webBatteryInterface=await a$f.create();let e=this.webBatteryInterface.getBatteryInfo();await this.workerCommand("createContext",{context:this.toJSONObject(),deviceId:a.deviceID,delayedRegistration:this.delayedRegistration,highEndBlurryRecognition:this.highEndBlurryRecognition,appName:await this.getAppName(),parentDomain:this.getParentDomain(),isTablet:b$1.isTablet(),batteryInfo:e}),this.webBatteryInterface.addBatteryChangeListener(this.batteryChangeListener),this.subscribeToWorkerMessages(this.onWorkerMessageListener),this.subscribeToCameraManagerEvents(),this.subscribeToVisibilityChange(this.onVisibilityChangeListener),this._view!=null&&await this.setView(this._view),this.frameSource!=null&&await this.setFrameSource(this.frameSource);}subscribeToVisibilityChange(e){document.addEventListener("visibilitychange",e);}unsubscribeToVisibilityChange(e){document.removeEventListener("visibilitychange",e);}async requestFrameData(e){return this.workerCommand("requestFrameData",{frameId:e})}performanceMark(e){a$g(globalThis.performance)&&typeof globalThis.performance.mark=="function"&&performance.mark(e);}async sendFrameToProcessor(e){var n,i;let t=e instanceof ImageData?{data:e.data,width:e.width,height:e.height,frameId:(n=e.frameId)!=null?n:e$1(),colorType:(i=e.colorType)!=null?i:"RGBA"}:e,r=await this.sendFrameToHandlers(t);return t.data=r.capture.data,r.skip?r.capture:(this.performanceMark("processFrameBeforeSDC"),this.sendFrameToSDC(t))}async sendFrameToHandlers(e){for(let t of this._frameHandlers)if((await t(e)).action==="skip")return {skip:true,capture:e};return {skip:false,capture:e}}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);}onBatteryChange(e){this.workerCommand("updateBatteryInfo",{batteryInfo:e});}onVisibilityChange(){this.workerCommand("documentVisibility",{state:document.visibilityState});}getImageConverterInstance(e){return this._asyncImageConverterInstance==null&&(this._asyncImageConverterInstance=new a$h(e)),this._asyncImageConverterInstance}onWorkerMessage(e){if(e.type==="contextDidChangeStatus"){e.payload.isValid||a$3.error(e.payload);for(let t of this.listeners)t.didChangeStatus&&t.didChangeStatus(this,a$i.fromJSON(e.payload));}if(e.type==="didStartObservingContext")for(let t of this.listeners)t.didStartObservingContext&&t.didStartObservingContext(this);e.type==="onFrameProcessingFinished"&&this.performanceMark("processFrameAfterSDC"),e.type==="convertToJPEG"&&this.convertImageToJPEG(e);}async convertImageToJPEG(e){let{imageId:t,width:r,height:n,data:i,planes:s,orientation:o,quality:u}=e,c={getWidth:()=>r,getHeight:()=>n,getPlanes:()=>s,toBitmap:()=>i,getBitmapRepresentationFromYUV:()=>{throw new Error("Not implemented")},deepCopy:()=>{throw new Error("Not implemented")}},l=await this.getImageConverterInstance({quality:u}).convertToJpeg(c,o);return this.workerCommand("convertToJPEGResult",{imageId:t,result:l})}subscribeToCameraManagerEvents(){g.instance().addListener("cameraProperties",this.cameraPropertiesReportListener),g.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$i.fromJSON({code:33794,isValid:true,message:typeof(e==null?void 0:e.toString)=="function"?e.toString():"Unknown error"}));}async update(e=[],{updateContext:t=true}={}){var r,n;t&&await this.updateContext();for(let i of e){switch(i.type){case "frameSourceState":{await((r=this._view)==null?void 0:r.onFrameSourceChange(this.frameSource));break}case "singleImageModeUploaderSettings":{(n=this._view)==null||n.onSingleImageUploaderSettingsChange(i.newValue);break}case "addOverlay":{await this.addNativeOverlay(i.newValue);break}case "removeOverlay":{await this.removeNativeOverlay(i.newValue);break}}for(let s of this.updateListeners){let o=s(i);o instanceof Promise&&await o;}}}async updateContext(){await this.workerCommand("updateContext",{context:this.toJSONObject(),...this.getViewInfo()}).catch(e=>a$3.warn("Error while updating context:",e,this.toJSONObject()));}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$1(e)&&e.getMirrorImageEnabled()&&(t="Y"),t}async addComponent(e){if(!this.components.includes(e))return this.components.push(e),e._context=this,this.update()}async addNativeOverlay(e){if(G(e))return this.workerCommand("addNativeOverlay",{overlayHandle:e[a$j]})}async removeNativeOverlay(e){if(G(e))return this.workerCommand("removeNativeOverlay",{overlayHandle:e[a$j]})}subscribeToWorkerMessages(e){this.dataCaptureInstance?this.dataCaptureInstance.addWorkerListener(e):this.pendingWorkerMessageListeners.add(e);}unsubscribeToWorkerMessages(e){this.dataCaptureInstance&&this.dataCaptureInstance.removeWorkerListener(e),this.pendingWorkerMessageListeners.delete(e);}hasEnabledMode(){return [...this.modes].some(e=>e.isEnabled())}updateCameraFrameFlow(){let e=[...this.modes].some(t=>t._synchronousFrameFlow===true);g.instance().setFrameHandling(e);}async isFeatureSupported(e){return (await this.workerCommand("isFeatureSupported",{feature:e})).supported}};a.deviceID="",a.stateMachine=new a$1("unconfigured",Q),a.mainDataCaptureLoader=void 0,a.dataCaptureLoaders=new Map,a.libraryLocation=void 0,a.userLicenseKey=null,a.capabilityInfo=void 0,c([v],a.prototype,"setFrameSource",1),c([v],a.prototype,"addMode",1),c([v],a.prototype,"removeMode",1),c([v],a.prototype,"setMode",1),c([v],a.prototype,"removeCurrentMode",1),c([v],a.prototype,"isFeatureSupported",1);var f=a;var b=class{constructor(e=f,t=a$3,r=globalThis.fetch.bind(globalThis)){this.staticContext=f;this.staticContext=e,this.logger=t,this.fetch=r;}get workerCommand(){var e;return (e=this.staticContext.mainDataCaptureLoader)==null?void 0:e.workerCommand.bind(this.staticContext.mainDataCaptureLoader)}async getLicenseText(){var i,s;let e=this.staticContext.stateMachine.currentState;if(e==="unconfigured"||e==="configuring")return this.logger.warn('You must call "DataCaptureContext.forLicenseKey" before retrieving open source license text info.'),"";let t=new URL(`${((i=this.staticContext.libraryLocation)!=null?i:"").replace(/\/$/,"")}/license/web-core-license.txt`),[r,n]=await Promise.all([(s=this.workerCommand)==null?void 0:s.call(this,"getOpenSourceSoftwareLicenseInfo",{}),this.fetchWebLicenseText(t.toString())]);return [r==null?void 0:r.licenseText,n].filter(o=>o!=null).join(`
|
|
6
|
+
`)}async fetchWebLicenseText(e){return this.fetch(e,{mode:"cors",credentials:"include",headers:{"Content-Type":"text/plain"}}).then(async t=>{if(!t.ok)throw new Error(`${t.status} ${t.statusText}`);return t.text()}).catch(t=>(this.logger.warn(`Failed to fetch license from ${e}: ${t.toString()}`),null))}};export{b as a,f as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b as b$1}from'./chunk-
|
|
1
|
+
import {b as b$1}from'./chunk-PDJEYYPX.js';import {a as a$5}from'./chunk-2SGKGZ6F.js';import {a as a$6}from'./chunk-2LSO6JEZ.js';import {a as a$2}from'./chunk-UWBNF47P.js';import {a as a$1}from'./chunk-EV4OEANA.js';import {a as a$4}from'./chunk-3A4KLILV.js';import {a as a$3}from'./chunk-LSZZVJ6B.js';var s="--view-finder-top",d="--view-finder-bottom",c="--hint-anchor-offset",T="--max-width-fraction",w="--horizontal-margin",f="--max-width-ratio-adjust",b=(t=>(t.Update="hintpresenterupdate",t.ViewFinderUpdateRequested="hintpresenterviewfinderupdaterequested",t))(b||{});function S(l,h=100){return typeof l=="string"?l.slice(0,h):""}var a=class a extends a$1{constructor(){super();this.onDidToastHideHandler=this.onDidToastHide.bind(this);let t=this.attachShadow({mode:"open"});t.innerHTML=a$2`<div id="root"><slot></slot></div>`,t.append(a.createStyleElement().cloneNode(true)),this.root=t.querySelector("#root");}static createStyleElement(){return a$3`:host{pointer-events:none}:host #root{inset:0;position:absolute;width:100%;${s}:0;${d}:0;${f}:1;z-index:1}::slotted(${b$1.tag}){left:50%;max-width:calc(var(${T})*var(${f})*100% - var(${w}));position:absolute;transform:translate(-50%);width:100%}::slotted(${b$1.tag}.${"aboveViewFinder"}){transform:translate(-50%,calc(-100% + var(${s}) - var(${c})))}::slotted(${b$1.tag}.${"belowViewFinder"}){transform:translate(-50%,calc(var(${d}) + var(${c})))}::slotted(${b$1.tag}.${"top"}){top:calc(var(${c}))}::slotted(${b$1.tag}.${"center"}){top:50%;transform:translate(-50%,-50%)}::slotted(${b$1.tag}.fitToText){width:fit-content}`}static register(){a$4({[a.tag]:a});}static create(){return a.register(),document.createElement(a.tag)}connectedCallback(){this.addEventListener("didhide",this.onDidToastHideHandler),this._viewFinderRect==null&&(this.root.style.setProperty(s,`${this.root.clientHeight/2}px`),this.root.style.setProperty(d,`${this.root.clientHeight/2+1}px`));}disconnectedCallback(){this.removeEventListener("didhide",this.onDidToastHideHandler);}setViewFinderRect(t){if(t===null){this.root.style.removeProperty(s),this.root.style.removeProperty(d);return}this._viewFinderRect=t;let{origin:{y:e},size:{height:i}}=this._viewFinderRect;this.root.style.setProperty(s,`${e}px`),this.root.style.setProperty(d,`${e+i}px`);}async handleMessage(t){let{type:e}=t;switch(e){case "showToast":{await this.showToast(t.payload);break}case "hideToast":{await this.hideToast(t.payload);break}case "showGuidance":{await this.showGuidance(t.payload);break}case "hideGuidance":{await this.hideGuidance(t.payload);break}case "startUpdateTimer":{this.startUpdateTimer(t.payload.duration.value);break}case "stopUpdateTimer":{this.stopUpdateTimer();break}}}setHintStyleToToast(t,e){t.textContent=e.text,t.hintStyle=e.hintStyle,t.className="",t.style.setProperty(c,`${t.hintStyle.hintAnchorOffset/16}rem`),t.style.setProperty(T,e.hintStyle.maxWidthFraction.toString()),t.style.setProperty(w,`${e.hintStyle.horizontalMargin/16}rem`),t.classList.add(e.hintStyle.hintAnchor),t.classList.toggle("fitToText",e.hintStyle.fitToText);}onDidToastHide(t){t.stopPropagation(),t.detail.target.remove();}getToastElementFromIdOrTag({id:t,tag:e}){var i;return (i=this.querySelector(`[data-id="${t}"]`))!=null?i:this.querySelector(`[data-tag="${e}"]`)}async showToast(t){var r;this.ensureViewFinderRectIsSet();let e=this.idFromHint(t),i=this.getToastElementFromIdOrTag({id:e,tag:(r=t.tag)!=null?r:""});if(i||(i=b$1.create(),i.dataset.id=e,t.tag!==""&&(i.dataset.tag=t.tag),this.append(i)),this.setHintStyleToToast(i,t),t.tag==="MoveCloserGuidance"){let n=a$5.create();n.setAttribute("slot","first-child"),i.append(n),i.setAttribute("direction","column");}return i.show()}showToastWithCustomIcon(t,e){var n;let i=this.idFromHint(t),r=this.getToastElementFromIdOrTag({id:i,tag:(n=t.tag)!=null?n:""});return r||(r=b$1.create(),r.dataset.id=i,t.tag!==""&&(r.dataset.tag=t.tag),this.append(r)),r.customIcon=e,this.setHintStyleToToast(r,t),r.show()}async hideToast(t){var i;let e=this.getToastElementFromIdOrTag({id:this.idFromHint(t),tag:(i=t.tag)!=null?i:""});return e==null?void 0:e.hide()}async showGuidance(t){return this.showToast(t)}async hideGuidance(t){return this.hideToast(t)}startUpdateTimer(t){this.intervalId=setInterval(()=>{this.dispatchEvent(new CustomEvent("hintpresenterupdate"));},t);}stopUpdateTimer(){clearInterval(this.intervalId);}ensureViewFinderRectIsSet(){(this._viewFinderRect==null||this._viewFinderRect.origin.x===0&&this._viewFinderRect.origin.y===0)&&this.dispatchEvent(new CustomEvent("hintpresenterviewfinderupdaterequested"));}idFromHint(t){var e;return a$6([t.hintStyle.textColor,t.hintStyle.backgroundColor,t.hintStyle.hintAnchor,(e=t.tag)!=null?e:"",S(t.text,30),t.hintStyle.textAlignment],"hint")}};a.tag="scandit-hints";var H=a;export{b as a,H as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-R6SUMD5F.js';import {b}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-R6SUMD5F.js';import {b}from'./chunk-YONR3EGV.js';var n=class e{constructor(t,o=a.defaultVibrationPattern){this.type=t,this.pattern=o;let r=b.getSupportedVibrationMethod();r&&(this._vibrate=r.bind(navigator));}static get defaultVibration(){return new e("default")}static withPattern(t){return new e("default",t)}toJSONObject(){return {type:this.type}}vibrate(){var t;return (t=this._vibrate)==null?void 0:t.call(this,this.pattern)}};export{n as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$3}from'./chunk-XIAF6V7E.js';import {b,a as a$2}from'./chunk-KYNYQBNF.js';import {a as a$
|
|
1
|
+
import {a as a$3}from'./chunk-XIAF6V7E.js';import {b,a as a$2}from'./chunk-KYNYQBNF.js';import {a as a$4}from'./chunk-KAFNKP6O.js';import {a as a$1}from'./chunk-QOCHMKNY.js';var z={bottomLeft:"bottomRight",bottomRight:"bottomLeft",topLeft:"topRight",topRight:"topLeft",centerLeft:"centerRight",centerRight:"centerLeft",center:"center",topCenter:"topCenter",bottomCenter:"bottomCenter"},a=class a{constructor(){this.listener=null;this._mounted=false;this._mirrored=false;this._cachedSize=new a$1(0,0);this.resizeObserver=null;this.mapViewAnchorPositionsForFramePoint=t=>t;}get size(){return this._cachedSize}setMirrored(t){this._mounted&&(this._mirrored=t);}mount(t){var n;if(this._mounted)return;if(!document.head.querySelector(`[data-component=${a.componentName}]`)){let i=document.createElement("style");i.dataset.component=a.componentName,i.append(document.createTextNode(b)),document.head.append(i);}let r=document.createElement("div");r.classList.add(a$2.CUSTOM_VIEW_CONTAINER),(n=t.parentNode)==null||n.replaceChild(r,t),this._htmlRoot=r,this.gestureRecognizer=new a$3(this._htmlRoot),this.gestureRecognizer.addListener({onTap:(i,o)=>{var s,e;let m=(s=o.target.dataset.identifier)!=null?s:"";m!==""&&((e=this.listener)==null||e.didTapView(Number.parseInt(m,10)));}}),this.resizeObserver=new ResizeObserver(([i])=>{this._cachedSize=new a$1(i.contentRect.width,i.contentRect.height);}),this.resizeObserver.observe(this._htmlRoot),this._cachedSize=new a$1(this._htmlRoot.clientWidth,this._htmlRoot.clientHeight),this._mounted=true;}unmount(){var t,r,n,i;this._mounted&&(this.removeChildren(),(t=this.gestureRecognizer)==null||t.removeAllListeners(),(r=this.resizeObserver)==null||r.disconnect(),(n=this._htmlRoot)==null||n.remove(),this._htmlRoot=null,this.gestureRecognizer=null,(i=document.head.querySelector(`[data-component=${a.componentName}]`))==null||i.remove(),this.listener=null,this._mounted=false);}render(t){var n,i,o,m,s;if(t.elements.length===0){this.removeChildren();return}for(let e of t.removedIds)(i=(n=this._htmlRoot)==null?void 0:n.querySelector(`#${a.elementSelectorPrefix}${e}`))==null||i.remove();let r=document.createDocumentFragment();for(let e of t.elements){let c=`${a.elementSelectorPrefix}${e.identifier}`,p=(o=this._htmlRoot)==null?void 0:o.querySelector(`#${c}`),l=p;if(p==null&&(l=new Image(e.view.options.size.width,e.view.options.size.height),l.id=c,l.dataset.identifier=String(e.identifier),r.append(l)),l){l.src=e.view.data;let h=this.mapViewAnchorPositionsForFramePoint(e.anchorPositions)[this._mirrored?z[e.anchor]:e.anchor];this._mirrored&&(h=a$4.mirrorX(h,this.size));let{x:u,y:P}=this.adjustCoordinatesWithOffset(h,{elementSize:e.view.options.size,offset:e.offset}),v=(m=e.view.options.scale)!=null?m:1;l.style.scale=`${v}`,l.style.transform=`translate3d(${u/v}px, ${P/v}px, 0px)`;}}(s=this._htmlRoot)==null||s.append(r);}renderDomView(t){var n,i;if(t.elements.length===0){this.removeChildren();return}let r=document.createDocumentFragment();for(let o of t.elements){let m=`${a.elementSelectorPrefix}${o.identifier}`,s=(n=this._htmlRoot)==null?void 0:n.querySelector(`#${m}`),{view:e}=o;if(e!=null){e.id=m,s&&s!==e&&s.replaceWith(e);let c=this.mapViewAnchorPositionsForFramePoint(o.anchorPositions)[this._mirrored?z[o.anchor]:o.anchor];this._mirrored&&(c=a$4.mirrorX(c,this.size));let{width:p,height:l}=e.getBoundingClientRect(),{x:h,y:u}=this.adjustCoordinatesWithOffset(c,{elementSize:{width:p,height:l},offset:o.offset});e.style.position="absolute",e.style.transform=`translate3d(calc(${h}px - 50%), calc(${u}px - 50%), 0px)`,r.append(e);}}(i=this._htmlRoot)==null||i.append(r);}removeChildren(){var t;for(;(t=this._htmlRoot)!=null&&t.firstChild;)this._htmlRoot.firstChild.remove();}adjustCoordinatesWithOffset(t,r){let n=t,{elementSize:i,offset:o}=r,m=t.x-i.width/2,s=t.y-i.height/2;return o.x.unit==="pixel"&&(n=new a$4(m+o.x.value,s+o.y.value)),o.x.unit==="fraction"&&(n=new a$4(m+i.width*o.x.value,s+i.height*o.y.value)),n}};a.componentName="CustomLocationsView",a.elementSelectorPrefix="scandit-view-";var S=a;export{S as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-YONR3EGV.js';var p=[119,101,98,107,105,116,84,114,97,110,115,112,111,114,116,68,117,112,108,101,120,67,104,97,110,110,101,108],s=[53,65,41,124,75,47,108,120,50,48,115,62,66,60,107,57],c=[111,74,88,52,51,101,51,112,66,79,38,88,40,65,36,94],t=String.fromCodePoint,n=t.apply(String,p);t.apply(String,s);t.apply(String,c);function l(){return globalThis.location.hostname==="localhost"||globalThis.location.hostname==="127.0.0.1"||globalThis.location.hostname===""}function r(o){let e=o;if(e!=null&&typeof e.getAppInfo=="function"&&typeof e.getKey=="function")return e}function m(){let{name:o=""}=b.getUserAgentInfo().getBrowser();return o==="Electron"&&typeof r(window[n])=="object"&&l()}async function y(){var o;return (o=r(window[n]))==null?void 0:o.getAppInfo()}async function A(o){var e;return (e=r(window[n]))==null?void 0:e.getKey(o)}export{m as a,y as b,A as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-SJIN27Q5.js';var i=class{constructor(e){this.setupComplete=false;this.handler=null;this.events=["touchstart","touchend","click","keydown"];this.doc=e!=null?e:typeof document<"u"?document:void 0;}isSetupComplete(){return this.setupComplete}markSetupComplete(){this.setupComplete=true;}setup(e){this.handler=e;let n=this.doc;n&&this.events.forEach(t=>{var o;n.addEventListener(t,e,true),(o=a)==null||o(`\u{1F3A7} Added '${t}' listener for audio unlock`);});}reset(){var e;this.removeListeners(),this.handler=null,this.setupComplete=false,(e=a)==null||e("\u{1F3A7} UnlockManager reset");}removeListeners(){var e;this.handler&&this.doc&&(this.events.forEach(n=>{var t;(t=this.doc)==null||t.removeEventListener(n,this.handler,true);}),(e=a)==null||e("\u{1F3A7} Unlock event listeners removed"));}};export{i as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-33ZWDLU7.js';import {a as a$2}from'./chunk-UWBNF47P.js';import {a as a$1}from'./chunk-3A4KLILV.js';var t=class t extends a{static create(){return document.createElement(t.tag)}static register(){a$1({[t.tag]:t});}render(){return a$2`<style>${t.tag}{display:flex}${t.tag}[shadow] svg{filter:drop-shadow(0px 1px 2px rgba(18, 22, 25, .3))}</style><svg width="${this.size}" height="${this.heightForViewbox(32,32)}" viewBox="0 0 32 32" fill="none"><path d="M12.9997 28C12.8536 27.9995 12.7094 27.9669 12.5773 27.9046C12.4451 27.8422 12.3283 27.7517 12.235 27.6393C12.1416 27.5269 12.0741 27.3954 12.0371 27.2541C12.0002 27.1127 11.9947 26.965 12.021 26.8213L13.8077 16.9987H9.00765C8.85299 17.0003 8.70007 16.9659 8.56102 16.8981C8.42197 16.8304 8.3006 16.7312 8.20654 16.6084C8.11248 16.4856 8.0483 16.3426 8.01911 16.1907C7.98991 16.0388 7.99649 15.8822 8.03832 15.7333L9.61432 9.95733L7.29299 7.63733C7.10539 7.44974 7 7.1953 7 6.93C7 6.6647 7.10539 6.41026 7.29299 6.22267C7.48058 6.03507 7.73502 5.92968 8.00032 5.92968C8.26562 5.92968 8.52006 6.03507 8.70765 6.22267L24.2637 21.7773C24.3619 21.8689 24.4407 21.9793 24.4954 22.1019C24.55 22.2246 24.5794 22.357 24.5818 22.4913C24.5841 22.6256 24.5594 22.7589 24.5092 22.8835C24.4589 23.008 24.384 23.1211 24.289 23.2161C24.1941 23.311 24.081 23.3859 23.9565 23.4362C23.8319 23.4865 23.6986 23.5112 23.5643 23.5088C23.43 23.5064 23.2976 23.477 23.1749 23.4224C23.0523 23.3677 22.9419 23.2889 22.8503 23.1907L19.1863 19.528L13.8357 27.5533C13.7442 27.6912 13.6199 27.8042 13.474 27.8822C13.3281 27.9601 13.1651 28.0006 12.9997 28ZM21.4503 16.1333L10.829 5.512L11.041 4.73867C11.0984 4.5266 11.2241 4.33934 11.3985 4.20583C11.573 4.07232 11.7866 3.99998 12.0063 4H18.9997C19.1547 4.00132 19.3073 4.03804 19.446 4.10737C19.5846 4.17669 19.7056 4.27678 19.7997 4.4C19.893 4.52382 19.9564 4.66766 19.9846 4.82015C20.0128 4.97265 20.0052 5.12962 19.9623 5.27867L18.333 11H22.9997C23.1807 11.0003 23.3583 11.0496 23.5136 11.1427C23.6689 11.2357 23.7961 11.3691 23.8817 11.5287C23.9673 11.6883 24.0081 11.868 23.9998 12.0489C23.9914 12.2298 23.9342 12.405 23.8343 12.556L21.453 16.1333H21.4503Z" fill="${this.fill}"/></svg>`}};t.tag="scandit-torch-off-icon";var o=t;export{o as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-SJIN27Q5.js';var i=class{constructor(){this.cache=new Map;}get(e){return this.cache.get(e)}set(e,s){this.cache.set(e,s);}clear(){var e;this.cache.clear(),(e=a)==null||e("\u{1F3A7} Audio buffer cache cleared");}size(){return this.cache.size}};export{i as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {b}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-YONR3EGV.js';import {a}from'./chunk-XR65N6EG.js';async function c(l){if(!b.isAnimationApiSupported()||l)try{l?a.debug("Force loading animation polyfill as requested."):a.debug("Web Animation API not fully supported, you might need to add https://www.npmjs.com/package/web-animations-js polyfill to see some animations.");let{polyfill:o}=await import('../private/utils/AnimationSimplePolyfill.js');o();}catch(o){a.warn("Error importing AnimationSimplePolyfill.js, the Animation API will not be polyfilled. This is not a problem for most browsers, but it might be a problem for older browsers like Chrome 75<",o);}}async function d(l){if(typeof globalThis.structuredClone!="function"||l)try{l?a.debug("Force loading structuredClone polyfill as requested."):a.debug("structuredClone API not supported, loading polyfill for older browsers.");let{structuredClonePolyfill:o}=await import('../private/utils/structuredClonePolyfill.js');o();}catch(o){a.warn("Error importing structuredClonePolyfill.js, the structuredClone API will not be polyfilled. This might cause issues in older browsers.",o);}}async function u(l){if(!(typeof globalThis<"u"&&"cookieStore"in globalThis&&globalThis.cookieStore!=null&&!l))try{l?a.debug("Force loading CookieStore polyfill as requested."):a.debug("CookieStore API not supported, loading polyfill for older browsers.");let{installCookieStorePolyfill:o}=await import('../private/utils/cookieStorePolyfill.js');o();}catch(o){a.warn("Error importing cookieStorePolyfill.js, the CookieStore API will not be polyfilled. This might cause issues with cookie management in older browsers.",o);}}async function y(l={}){let{forceAnimationPolyfill:o=false,forceStructuredClonePolyfill:t=false,forceCookieStorePolyfill:n=false,forceAllPolyfills:i=false}=l,s=i||o,a=i||t,f=i||n;await Promise.all([c(s),d(a),u(f)]);}
|
|
2
2
|
export{y as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$
|
|
1
|
+
import {a as a$2}from'./chunk-6IM6NGGI.js';import {a as a$3}from'./chunk-YP53ND2Q.js';import {e as e$1}from'./chunk-TTGJAMI2.js';import {a as a$7,b}from'./chunk-EQ6V4W5K.js';import {a as a$4}from'./chunk-UWBNF47P.js';import {a as a$1}from'./chunk-EV4OEANA.js';import {a as a$6}from'./chunk-3A4KLILV.js';import {a as a$5}from'./chunk-LSZZVJ6B.js';var w=(t=>(t.DidShow="didshow",t.DidHide="didhide",t))(w||{}),s="--text-size",r="--text-color",i="--text-alignment",a="--text-weight",l="--line-height",c="--background-color",h="--corner-radius",o="--max-lines",A="ease-in-out",e=class e extends a$1{constructor(){super();this.toast=null;this._hintStyle=null;this._customIcon=null;this.currentAnimation=null;this.animationDuration=250;this._currentAnimationDirection=null;let t=this.attachShadow({mode:"open"});this._exclamationIcon=a$2.create(),this._checkIcon=a$3.create(),this._exclamationIcon.size=24,this._checkIcon.size=24,t.innerHTML=a$4`<div class="toast"><slot name="first-child"></slot><div class="left"><slot name="icon"></slot></div><p class="middle"><slot></slot></p></div>`,t.append(e.createStyleElement().cloneNode(true)),this.toast=t.querySelector(".toast");}static createStyleElement(){return a$5`:host{display:inline-block;font-family:SF Pro Display,sans-serif}:host([hidden]){display:none}.toast{${s}:1rem;${r}:#000;${a}:400;${i}:${"center"};${l}:1.5rem;${c}:#fff;${h}:.25rem;${o}:2;align-items:flex-start;background-color:var(${c});border-radius:var(${h});color:var(${r});display:flex;flex-direction:row;font-size:var(${s});font-weight:var(${a});gap:.625rem;justify-content:var(${i});line-height:var(${l});padding:.75rem 1rem}:host([direction=column]) .toast{align-items:center;flex-direction:column}:host([direction=row]) .toast{align-items:center;flex-direction:row}.toast .left{align-self:flex-start;display:flex}.toast.icon-${"none"} .left{display:none}.toast p.middle{display:inline-block;display:-webkit-box;line-clamp:var(${o});-webkit-line-clamp:var(${o});margin:0;padding:0;text-align:var(${i});-webkit-box-orient:vertical;align-self:center;overflow:hidden;text-shadow:0 1px 2px #${e$1.withAlpha(.3).toJSON()}}p.middle{text-align:var(${i})}`}get hintStyle(){return this._hintStyle}set hintStyle(t){this._hintStyle=t,this.render();}get customIcon(){return this._customIcon}set customIcon(t){this._customIcon=t,this.render();}get showAnimation(){return new Animation(new KeyframeEffect(this,[{opacity:0},{opacity:1}],{duration:this.animationDuration,fill:"both",easing:A}))}get hideAnimation(){return new Animation(new KeyframeEffect(this,[{opacity:1},{opacity:0}],{duration:this.animationDuration,fill:"both",easing:A}))}static create(){return e.register(),document.createElement(e.tag)}static register(){a$6({[e.tag]:e});}async show(){return this.toggle(true)}async hide(){return this.toggle(false)}connectedCallback(){this.render();}async toggle(t){var m,d;let n=t?"showing":"hiding";this.currentAnimation&&this._currentAnimationDirection===n&&this.currentAnimation.playState==="running"||(this.currentAnimation&&a$7(this.currentAnimation),this.animationDuration=(d=(m=this.hintStyle)==null?void 0:m.isAnimatedToView)==null||d?250:0,this._currentAnimationDirection=n,this.currentAnimation=t?this.showAnimation:this.hideAnimation,this.currentAnimation.play(),await b(this.currentAnimation),this.dispatchEvent(new CustomEvent(t?"didshow":"didhide",{bubbles:true,detail:{target:this}})),this.currentAnimation=null,this._currentAnimationDirection=null);}render(){var t;if(!(!this.toast||!this.hintStyle)){this.toast.className="toast",this.toast.style.setProperty(s,`${this.hintStyle.textSize}px`),this.toast.style.setProperty(r,`#${this.hintStyle.textColor}`),this.toast.style.setProperty(a,this.hintStyle.textWeight.toString()),this.toast.style.setProperty(i,this.hintStyle.textAlignment),this.toast.style.setProperty(l,`${this.hintStyle.lineHeight/14}`),this.toast.style.setProperty(c,`#${this.hintStyle.backgroundColor}`),this.toast.style.setProperty(h,`${this.hintStyle.cornerRadius/10}rem`),this.toast.style.setProperty(o,this.hintStyle.maxLines.toString());for(let n of this.querySelectorAll("[slot=icon]"))n.remove();this._customIcon?(this._customIcon.setAttribute("slot","icon"),this.append(this._customIcon),this.toast.classList.remove("icon-none")):(this.toast.classList.toggle("icon-none",this.hintStyle.hintIcon==="none"),this.hintStyle.hintIcon==="check"?(this._checkIcon.setAttribute("slot","icon"),this.append(this._checkIcon)):this.hintStyle.hintIcon==="exclamationMark"&&(this._exclamationIcon.setAttribute("slot","icon"),this.append(this._exclamationIcon)),this.hintStyle.iconColor&&((t=this.querySelector("[slot=icon]"))==null||t.setAttribute("fill",`#${this.hintStyle.iconColor}`)));}}};e.tag="scandit-toast-hint";var I=e;export{w as a,I as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-LFJUGRQV.js';import {a as a$1}from'./chunk-XR65N6EG.js';var p=class{constructor(){this.cameraPool=new Set;}getOrCreate(a$1){var e;let{position:l,deviceId:n,label:s}=a$1,c=(e=a$1._isBestGuess)!=null?e:false;if(this.cameraPool.size===0)return this.push(a$1);let o=this.allCamerasNoDeviceId(),i=Array.from(this.cameraPool);if(n){let t=i.find(d=>d.deviceId===n);if(t)return t;if(o){let d=i.find(h=>h.position===l);if(d)return d[a].setDeviceId(n),d[a].setLabel(s),d}}if(c){let t=i.find(d=>d._isBestGuess);if(t)return t}if(o&&!n){let t=i.find(d=>d.position===l);if(t)return t}return this.push(a$1)}integrateIncomingVideoDevices(a$2){let l=Array.from(this.cameraPool),n=new Set,s=[...a$2].reverse();for(let o=s.length-1;o>=0;o--){let i=s[o];if(!i.deviceId)continue;let e=l.find(t=>t.deviceId===i.deviceId&&!n.has(t));e&&(e[a].setLabel(i.label),e.position=i.position,e[a].resetUnmappedState(),n.add(e),s.splice(o,1),this.debugLog("Updated pool camera by deviceId",{deviceId:e.deviceId,label:e.label,position:e.position}));}for(let o=s.length-1;o>=0;o--){let i=s[o],e=l.find(t=>t.position===i.position&&!n.has(t));e&&(e[a].setDeviceId(i.deviceId),e[a].setLabel(i.label),e[a].resetUnmappedState(),n.add(e),s.splice(o,1),this.debugLog("Updated pool camera by position",{deviceId:e.deviceId,label:e.label,position:e.position}));}if(s.length>0){let o=l.filter(i=>!n.has(i));if(o.length>0){for(let i=0;i<Math.min(s.length,o.length);i++){let e=o[i],t=s[i];e[a].setDeviceId(t.deviceId),e[a].setLabel(t.label),e.position=t.position,e[a].resetUnmappedState(),n.add(e),this.debugLog("Force updated pool camera",{deviceId:e.deviceId,label:e.label,position:e.position});}s.splice(0,Math.min(s.length,o.length));}for(let i of s)this.cameraPool.add(i),this.debugLog("Added new camera to pool",{deviceId:i.deviceId,label:i.label,position:i.position});}let c=l.filter(o=>!n.has(o));if(c.length>0){a$1.warn("Some cameras were created but could not be mapped to cameras found on the device. This happens when you create more Cameras than it exists. These cameras will not be accessible.");for(let o of c)a$1.warn("Removing non-updated camera:",{deviceId:o.deviceId,label:o.label,position:o.position}),o[a].markAsUnmappedToDeviceCameras(),this.cameraPool.delete(o);}this.debugLog("Camera pool state after reconciliation:"),this.logPool();}allCamerasNoDeviceId(){return Array.from(this.cameraPool).every(a=>a.deviceId==="")}get(){return Array.from(this.cameraPool)}clear(){this.cameraPool.clear();}push(a){return this.debugLog("adding camera to pool",JSON.stringify({deviceId:a.deviceId,position:a.position,label:a.label})),this.cameraPool.add(a),a}debugLog(...a){}logPool(){}dumpAsSimpleObjects(){return [...this.cameraPool].map(a=>({deviceId:a.deviceId,label:a.label,position:a.position}))}},f={[a]:{CameraPool:p}};var u=new p;export{f as a,u as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a as a$4}from'./chunk-DN32UPQC.js';import {a as a$8}from'./chunk-DZKTI5AJ.js';import {a as a$9}from'./chunk-G2BRTVN7.js';import {c as c$1,a as a$a}from'./chunk-4W2T3TLN.js';import {c}from'./chunk-UWLAKRB2.js';import {a as a$1}from'./chunk-CAUB35PV.js';import {a as a$2}from'./chunk-QIWPWOQG.js';import {a}from'./chunk-GQ7A6533.js';import {a as a$6}from'./chunk-EYBP3672.js';import {d}from'./chunk-AIC4H5KG.js';import {a as a$5}from'./chunk-O7TZTIHO.js';import {a as a$3}from'./chunk-XR65N6EG.js';import {a as a$7}from'./chunk-QCZSSQAQ.js';var P=class P{constructor(e,t){this.hintPresenterV2=null;this.MAX_NUMBER_OF_IMAGES_IN_FRAME_DATA_POOL=5;this.redrawInterval=1e3/30;this.redrawRequests=[];this._isDrawLoopRunning=false;this.frameDataPool=new Map;this.lastFrameColorType="RGBA";this.lastFrameId=null;this.poorMansBenchmarkLogs=false;this.writableDataPathStandard="/scandit_sync_folder";this.resourceFilesSubfolder="resources";this.performanceMetricsReporterTimer=void 0;this.lastMetricsReportTime=0;this.metricsReportInterval=1e3;this.performanceMetrics={frameDataPoolSize:0,cameraOutputFrames:0,redrawRequestsCount:0,actualRedrawsCount:0,frameProcessingStartedCount:0,frameProcessedCount:0,frameSkippedCount:0};this.frameProcessingStartedCount=0;this.frameProcessingFinishedCount=0;this.gestureListener=null;this.webPlatformHintPresenter=null;this.deviceInstance=null;this.deviceInfo=null;this.lastViewInfo=new a(null);this.lastFrameProcessingStartedCount=0;this.lastFrameProcessingFinishedCount=0;this.moduleHandler=e,this.workerFunctions=t,this._loadProgressCallback=this._loadProgressCallback.bind(this),c(this.getWasmMetadata());}get Module(){return this.moduleHandler.get()}set isDrawLoopRunning(e){this._isDrawLoopRunning=e,!e&&typeof this.loopTimeoutId=="number"&&(clearTimeout(this.loopTimeoutId),this.loopTimeoutId=void 0);}get isDrawLoopRunning(){return this._isDrawLoopRunning}prepareFrameForListener(e){let t=this.lastFrameId;if(this.frameDataPool.size>=this.MAX_NUMBER_OF_IMAGES_IN_FRAME_DATA_POOL){let l=this.frameDataPool.keys().next().value;l!=null&&this.frameDataPool.delete(l);}let r=e.getFrameData(),i=new Uint8ClampedArray(r);this.frameDataPool.set(t,{data:i,colorType:this.lastFrameColorType,frameId:t,width:e.getWidth(),height:e.getHeight()});let n=this.lastUsedModuleMirrorAxis==null?false:this.lastUsedModuleMirrorAxis!==this.Module.Axis.None;return {frameId:t,width:e.getWidth(),height:e.getHeight(),isFrameSourceMirrored:n,colorType:this.lastFrameColorType}}createContext(e){var f,m,C,b,y;let t=this.getModeDeserializers(),r=c$1(location);(r==="localhost"||r==="127.0.0.1")&&navigator.userAgent.includes("Electron")&&e.appName!=null&&(r+=`-${e.appName}`),this.parentDomain=e.parentDomain,this.contextDeserializer=new this.Module.DataCaptureContextDeserializer(this.writableDataPath,e.deviceId,e.context.deviceModelName,r,this.parentDomain,t,e.delayedRegistration,e.highEndBlurryRecognition,this.resourcePath);let i=this.contextDeserializer.contextFromJson(JSON.stringify(e.context));if(i==null){let a=this.contextDeserializer.getLastError();throw new Error(`Could not create the context: ${a}`)}let n=i.getView();this.context=i.getContext(),i.delete(),this.setupDeviceInterface(e.isTablet,e.batteryInfo);let l=this.Module.DataCaptureContextListener.extend("DataCaptureContextListener",{didChangeStatus:(a,o)=>{this.contextDidChangeStatus(JSON.parse(o.toJson())),a.delete();},didStartObservingContext:a=>{this.didStartObservingContext(),a.delete();},didStopObservingContext:a=>{a.delete();}}),c=this.Module.DataCaptureContextFrameListener.extend("DataCaptureContextFrameListener",{onObservationStarted:a=>{a.delete();},onObservationStopped:a=>{a.delete();},onFrameProcessingStarted:(a,o)=>{this.workerFunctions.postMessage({type:"onFrameProcessingStarted"}),o.delete(),a.delete();},onFrameProcessingFinished:(a,o)=>{this.workerFunctions.postMessage({type:"onFrameProcessingFinished"}),o.delete(),a.delete();},onFrameSkipped:(a,o)=>{this.workerFunctions.postMessage({type:"onFrameSkipped"}),o.delete(),a.delete();}}),h=this.Module.GestureRecognizer.extend("GestureRecognizer",{setGestureListener:(a,o)=>{var w;(w=this.gestureListener)==null||w.delete(),this.gestureListener=a.clone(),a.delete();}});(f=this.gestureRecognizer)==null||f.delete(),this.gestureRecognizer=new h;let g=new l;this.context.addListener(g),g.delete();let u=new c;this.context.addFrameListener(u),u.delete(),this.setView(n),(m=this.view)==null||m.setGestureRecognizer(this.gestureRecognizer);let p=this.Module.PlatformHintPresenter.extend("PlatformHintPresenter",{setHintPresenter:a=>{a.delete();},showToast:a=>{this.workerFunctions.postMessage({type:"showToast",payload:JSON.parse(a)});},hideToast:a=>{this.workerFunctions.postMessage({type:"hideToast",payload:JSON.parse(a)});},showGuidance:a=>{this.workerFunctions.postMessage({type:"showGuidance",payload:JSON.parse(a)});},hideGuidance:a=>{this.workerFunctions.postMessage({type:"hideGuidance",payload:JSON.parse(a)});},startUpdateTimer:a=>{this.workerFunctions.postMessage({type:"startUpdateTimer",payload:{duration:{unit:"ms",value:a}}});},stopUpdateTimer:()=>{this.workerFunctions.postMessage({type:"stopUpdateTimer"});}});(C=this.hintPresenterV2)==null||C.delete(),this.hintPresenterV2=null,(b=this.webPlatformHintPresenter)==null||b.delete(),this.webPlatformHintPresenter=null,this.webPlatformHintPresenter=new p,this.view&&(this.hintPresenterV2=new this.Module.HintPresenterV2(this.webPlatformHintPresenter),(y=this.view)==null||y.setHintPresenterV2(this.hintPresenterV2)),this.webImageConverterInstance=this.getImageConverterInstance({quality:1}),this.Module.ImageConverter.setInstance(this.webImageConverterInstance);}convertToJPEGResult(e,t){this.webImageConverterInstance instanceof a$1&&this.webImageConverterInstance.onConvertToJPEGResult(e,t);}getImageConverterInstance(e){return this.workerFunctions.getOffscreenCanvas()!=null?new a$2(e):new a$1(this.workerFunctions,e)}onTap(e){var t;(t=this.gestureListener)==null||t.onTap(JSON.stringify(e));}hintPresenterV2Update(){var e;(e=this.hintPresenterV2)==null||e.update();}startReportingPerformanceMetrics(){this.performanceMetricsReporterTimer==null&&(this.lastMetricsReportTime=performance.now(),this.scheduleMetricsReporting());}scheduleMetricsReporting(){this.performanceMetricsReporterTimer=setTimeout(()=>{this.checkAndReportMetrics();},100);}checkAndReportMetrics(){let e=performance.now();e-this.lastMetricsReportTime>=this.metricsReportInterval&&(this.reportPerformanceMetrics(),this.performanceMetrics.cameraOutputFrames=0,this.performanceMetrics.redrawRequestsCount=0,this.performanceMetrics.actualRedrawsCount=0,this.lastMetricsReportTime=e),this._isDrawLoopRunning&&this.scheduleMetricsReporting();}async reportPerformanceMetrics(){let e=this.frameProcessingStartedCount-this.lastFrameProcessingStartedCount,r=this.frameProcessingFinishedCount-this.lastFrameProcessingFinishedCount;this.lastFrameProcessingStartedCount=this.frameProcessingStartedCount,this.lastFrameProcessingFinishedCount=this.frameProcessingFinishedCount;let i={cameraOutputFrames:this.performanceMetrics.cameraOutputFrames,redrawRequestsCount:this.performanceMetrics.redrawRequestsCount,actualRedrawsCount:this.performanceMetrics.actualRedrawsCount,frameDataPoolSize:this.performanceMetrics.frameDataPoolSize,frameProcessingStartedCount:e,frameProcessedCount:r,frameSkippedCount:this.performanceMetrics.frameSkippedCount};this.workerFunctions.postMessage({type:"performanceMetricsReport",payload:i});}deleteFrameData(e){this.frameDataPool.delete(e);}dispose(){var e,t,r,i,n;this.context.dispose(),this.frameDataPool.clear(),this.isDrawLoopRunning=false,this.cleanupMetricsReporting(),(e=this.gestureRecognizer)==null||e.delete(),this.gestureRecognizer=null,(t=this.gestureListener)==null||t.delete(),this.gestureListener=null,(r=this.hintPresenterV2)==null||r.delete(),this.hintPresenterV2=null,(i=this.webPlatformHintPresenter)==null||i.delete(),this.webPlatformHintPresenter=null,(n=this.deviceInstance)==null||n.delete(),this.deviceInstance=null,this.deviceInfo=null;}cleanupMetricsReporting(){this.performanceMetricsReporterTimer!=null&&(typeof this.performanceMetricsReporterTimer=="number"?cancelAnimationFrame(this.performanceMetricsReporterTimer):clearTimeout(this.performanceMetricsReporterTimer),this.performanceMetricsReporterTimer=void 0);}flushAnalytics(){this.context.flushAnalytics();}extractCentaurusLicense(e){return {payload:{centaurus:{licenseKey:this.Module.LicenseUtils[P.get3dPartyLicenseKeyMethodName](e)}}}}getModeDeserializers(){return new this.Module.VectorDataCaptureModeDeserializer}loadLibrary(e){return this.libraryLoadingPromise!=null?this.libraryLoadingPromise:(this.libraryLoadingPromise=this.setup(e),this.libraryLoadingPromise)}processFrame(e){var n;if(this.context==null)return a$3.debug("[processFrame] Context is null, returning frame without processing"),{payload:e,transferables:[e.data.buffer]};this.lastFrameId=e.frameId;let t=e.data,r=e.colorType==="GRAYSCALE"?this.Module.ImageBufferFormat.Grayscale8:this.Module.ImageBufferFormat.Rgba8888;this.lastFrameColorType=e.colorType==="GRAYSCALE"?"GRAYSCALE":"RGBA";let i=this.Module.allocateUint8Array(t.byteLength);return this.Module.HEAPU8.set(t,i),(n=this.imageFrameSource)==null||n.outputFrame(i,e.width,e.height,r),{payload:e,transferables:[e.data.buffer]}}reportCameraProperties(e){this.context.setCameraProperties(e.deviceId,e.isFrontFacing,e.hasAutofocus);}requestFrameData(e){let t=this.frameDataPool.get(e);if(t==null)return {payload:{data:null,frameId:null,colorType:null}};if(t.data.buffer.byteLength===0)return this.frameDataPool.delete(e),{payload:{data:null,frameId:null,colorType:null}};let r=t.data;t.colorType==="GRAYSCALE"&&(r=a$4(t.data,t.width,t.height));let i={payload:{data:r,frameId:t.frameId,colorType:t.colorType},transferables:[r.buffer]};return this.frameDataPool.delete(e),i}scheduleRedraw(e,t){this.addRedrawRequest(t),this.isDrawLoopRunning||this.startDrawLoop(e);}sendViewRefreshCommands(e){this.workerFunctions.postMessage({type:"draw",payload:e},[e.buffer]);}setFrameSource(e,t){var r;this.lastUsedModuleMirrorAxis=this.mapMirrorAxisOnModule(e),(r=this.imageFrameSource)==null||r.delete(),this.imageFrameSource=new this.Module.ImageBufferFrameSource(this.lastUsedModuleMirrorAxis,t,0),this.context.setFrameSource(this.imageFrameSource);}startDrawLoop(e){this.isDrawLoopRunning=true;let t=n=>this.redrawRequests.length>0&&this.redrawRequests[0]<=n,r=n=>{for(;this.redrawRequests.length>0&&this.redrawRequests[0]<=n;)this.redrawRequests.shift();},i=()=>{this.loopTimeoutId=setTimeout(()=>{if(!this.isDrawLoopRunning)return;let n=performance.now();if(t(n)){r(n),e.draw();let l=e.getDrawCommands();this.sendViewRefreshCommands(new Uint8Array(l));}i();},this.redrawInterval);};i();}updateContext(e){if(this.context!=null&&this.contextDeserializer!=null){e.view!=null&&!e.view.visible&&this.context.flushAnalytics();let t=this.onBeforeUpdateContextHook(e),r=this.contextDeserializer.updateContextFromJson(this.context,this.view,JSON.stringify(t.context));if(r==null){let n=this.contextDeserializer.getLastError();throw new Error(`Could not update the context: ${n}`)}this.context.delete(),this.context=r.getContext();let i=r.getView();r.delete(),i!=null&&t.view!=null&&(i.setViewSize(t.view.width,t.view.height,t.view.orientation),i.draw()),!this.hintPresenterV2&&this.webPlatformHintPresenter&&(this.hintPresenterV2=new this.Module.HintPresenterV2(this.webPlatformHintPresenter)),i!=null&&this.hintPresenterV2&&i.setHintPresenterV2(this.hintPresenterV2),this.gestureRecognizer!=null&&(i==null||i.setGestureRecognizer(this.gestureRecognizer)),this.setView(i),this.notifyMainThreadOnViewInfoChanged(i),a$3.debug("context updated",t);}}notifyMainThreadOnViewInfoChanged(e){let t=this.getViewInfo(e);this.lastViewInfo.isSame(t)||(this.lastViewInfo.update(t),this.workerFunctions.postMessage({type:"viewSizeChanged",payload:t}));}getViewInfo(e){if(e!=null)try{let t=JSON.parse(e.getViewInfo());if(t!=null){let r=this.getOrientationFromNumber(t.orientation);return {...t,orientation:r}}}catch(t){a$3.error("Failed to get view size",t);}return null}getOrientationFromNumber(e){switch(e){case 90:return "landscapeRight";case 180:return "portraitUpsideDown";case 270:return "landscapeLeft";default:return "portrait"}}onBeforeUpdateContextHook(e){return e}onDocumentVisibilityChange(e){e==="hidden"&&this.context.flushAnalytics();}isFeatureSupported(e){return {payload:{supported:this.context.isFeatureSupported(e)}}}getViewfinderInfo(){var e,t;return {payload:{isDisplayingViewfinder:(t=(e=this.view)==null?void 0:e.isDisplayingViewfinder())!=null?t:false,rect:JSON.parse(this.view.getViewfinderRect())}}}getOpenSourceSoftwareLicenseInfo(){return {payload:{licenseText:this.Module.OpenSourceSoftwareLicenseInfo.getLicenseText()}}}getWasmDynamicLibraries(e){return this.getWasmSideModuleFileName()==null?[]:[`${e.replace(/\/[^/]*$/,"/")}${this.getWasmSideModuleFileName()}`]}getWasmCoreExpectedHash(e,t){return t?e?globalThis.SDC_WASM_CORE_MT_SIMD_HASH:globalThis.SDC_WASM_CORE_MT_HASH:e?globalThis.SDC_WASM_CORE_SIMD_HASH:""}getWasmCoreFileName(e,t){return t?e?globalThis.SDC_WASM_CORE_MT_SIMD_FILE_NAME:globalThis.SDC_WASM_CORE_MT_FILE_NAME:e?globalThis.SDC_WASM_CORE_SIMD_FILE_NAME:""}getWasmMetadata(){return globalThis.WASM_METADATA}getWasmSideModuleFileName(){return ""}_loadProgressCallback(e){this.workerFunctions.postMessage({type:"loadLibraryProgress",payload:e});}addRedrawRequest(e){this.redrawRequests.push(Math.round(performance.now())+e),this.redrawRequests.sort((t,r)=>t-r);}contextDidChangeStatus(e){e.code===260?e.message=e.message.replace("domain name",`domain name (${c$1(location)})`):e.code===265&&(e.message=e.message.replace("domain name",`domain name (${this.parentDomain})`)),this.workerFunctions.postMessage({type:"contextDidChangeStatus",payload:e});}didStartObservingContext(){this.workerFunctions.postMessage({type:"didStartObservingContext"});}mapMirrorAxisOnModule(e){switch(e){case "None":return this.Module.Axis.None;case "X":return this.Module.Axis.X;case "Y":return this.Module.Axis.Y;default:return this.Module.Axis.None}}setView(e){this.view=e,this.setViewRefreshHandler(e),e==null&&(this.isDrawLoopRunning=false,this.sendViewRefreshCommands(new Uint8Array([])));}addNativeOverlay(e){a$3.warn("addNativeOverlay has not been implemented for this module",e);}removeNativeOverlay(e){a$3.warn("removeNativeOverlay has not been implemented for this module",e);}setViewRefreshHandler(e){if(e==null||e.isViewRefreshHandlerSet)return;let t=this.Module.NeedsRedrawDelegate.extend("NeedsRedrawDelegate",{setNeedsRedrawIn:this.scheduleRedraw.bind(this,e)}),r=new t;e.setNeedsRedrawDelegate(r),e.isViewRefreshHandlerSet=true;}setupDataDecoding(){let e=this.moduleHandler.get(),t=e.DataDecoding.extend("DataDecoding",{decode(r,i){try{let n=JSON.parse(i),l=[];for(let c of n){let h=new TextDecoder(c.ianaName,{fatal:true});l.push(h.decode(r.slice(c.startIndex,c.endIndex)));}return l.join("")}catch{return ""}}});e.setDataDecoding(new t);}getBatteryData(){var t,r;let e=(r=(t=this.deviceInfo)==null?void 0:t.batteryInfo)==null?void 0:r.percentage;if(e!=null)return {percentage:e}}isTablet(){var e,t;return (t=(e=this.deviceInfo)==null?void 0:e.isTablet)!=null?t:false}setupDeviceInterface(e,t){this.deviceInfo={isTablet:e,batteryInfo:t};let r=this.moduleHandler.get(),i=r.DeviceInterface.extend("DeviceInterface",{getBatteryData:this.getBatteryData.bind(this),isTablet:this.isTablet.bind(this)});this.deviceInstance=new i,r.DeviceHolder.setCurrentDevice(this.deviceInstance);}updateBatteryInfo(e){this.deviceInfo&&(this.deviceInfo.batteryInfo=e);}start(e,t,r){e&&t&&(this.setupDataDecoding(),this.moduleHandler.get().callMain(),this.moduleHandler.get().__emscripten_proxy_main!==void 0||r());}getWritableDataPath(e){return e!=null?(a$3.debug(`IndexedDB database name override in use to recover from blocked standard database: ${e}`),e):this.writableDataPathStandard}numOfMBToPages(e){return Math.ceil(1024*e*1024/64/1024)}async setup({libraryLocation:e,locationPath:t,writableDataPathOverride:r,indexedDBTimeoutMs:i,verifyResponseHash:n,referredOrigin:l,fixedWasmMemory:c,simdSupport:h,threadsSupport:g}){var v;let u=false,p=false;this.writableDataPath=this.getWritableDataPath(r),this.resourcePath=`${e}${this.resourceFilesSubfolder}/`,globalThis.path=t;let{resolve:f,reject:m,promise:C}=new a$5,b=a$6.sdkVersion();if(b==="")throw new a$7({name:"Invalid library version",message:"Library version is not defined or empty, cannot generate proper path to library files."});let y=this.getWasmCoreFileName(h,g),a=d(b,e,y),{jsURI:o,wasmURI:w}=a,W={instantiateWasm:(d,H)=>(a$a({importObject:d,wasmURI:w,expectedHash:this.getWasmCoreExpectedHash(h,g),verifyResponseHash:n,successCallback:H,progressCallback:this._loadProgressCallback,errorCallback:N=>{m(N);},referredOrigin:l}),{})},M=c===null?null:new WebAssembly.Memory({initial:this.numOfMBToPages(c),maximum:this.numOfMBToPages(300),shared:g});return M!==null&&a$3.log(a$3.Level.Debug,"Fixed wasmMemory set",M),this.moduleHandler.set({...M?{wasmMemory:M}:{},mainScriptUrlOrBlob:o,canvas:(v=this.workerFunctions.getOffscreenCanvas())!=null?v:{getContext:()=>null},...W,dynamicLibraries:this.getWasmDynamicLibraries(w),locateFile:d=>e+d,noInitialRun:true,preRun:[async()=>{try{await a$8({writableDataPath:this.writableDataPath,indexedDBTimeoutMs:i});}catch(d){if(d.name==="BlockedIndexedDB"){m(d.toString());return}a$3.log(a$3.Level.Debug,"No IndexedDB support, some data will not be persisted:",d);}p=true,this.start(p,u,f);}],onMainComplete:()=>{if([u,p].includes(false)){a$3.log(a$3.Level.Warn,{runtimeLoaded:u,fileSystemSynced:p},"Both runtimeLoaded and fileSystemSynced should be true when calling onMainComplete"),m("onMainComplete has been called but runtime or file system was not ready.");return}f();},onRuntimeInitialized:()=>{u=true,this.start(p,u,f);},print:d=>{a$3.info(d);}}),await a$9(o,b)||m(`Couldn't retrieve Scandit Data Capture library at ${o}, did you configure the path for it correctly?`),C}};P.get3dPartyLicenseKeyMethodName=atob("Z2V0QmxpbmtJZExpY2Vuc2VLZXk=");var V=P;export{V as a};
|