@scandit/web-datacapture-core 7.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +4 -0
- package/README.md +6 -0
- package/THIRD-PARTY.txt +73 -0
- package/build/electron/chunk-6RVAZ75N.js +1 -0
- package/build/electron/common.cjs +1 -0
- package/build/electron/common.js +0 -0
- package/build/electron/constants.cjs +1 -0
- package/build/electron/constants.js +1 -0
- package/build/electron/main.cjs +1 -0
- package/build/electron/main.d.cts +26 -0
- package/build/electron/main.d.ts +26 -0
- package/build/electron/main.js +1 -0
- package/build/electron/preload.cjs +1 -0
- package/build/electron/preload.d.cts +6 -0
- package/build/electron/preload.d.ts +6 -0
- package/build/electron/preload.js +1 -0
- package/build/js/AimerViewfinder.d.ts +15 -0
- package/build/js/AimerViewfinder.js +1 -0
- package/build/js/Brush.d.ts +27 -0
- package/build/js/Brush.js +1 -0
- package/build/js/Camera-Cxbduq94.d.ts +1700 -0
- package/build/js/Camera.d.ts +17 -0
- package/build/js/Camera.js +1 -0
- package/build/js/CameraAccess.d.ts +17 -0
- package/build/js/CameraAccess.js +1 -0
- package/build/js/CameraRelated.d.ts +17 -0
- package/build/js/CameraRelated.js +1 -0
- package/build/js/Common.d.ts +229 -0
- package/build/js/Common.js +1 -0
- package/build/js/DataCaptureContext.d.ts +17 -0
- package/build/js/DataCaptureContext.js +1 -0
- package/build/js/DataCaptureContextRelated.d.ts +17 -0
- package/build/js/DataCaptureContextRelated.js +1 -0
- package/build/js/DataCaptureContextSettings.d.ts +13 -0
- package/build/js/DataCaptureContextSettings.js +1 -0
- package/build/js/DataCaptureError.d.ts +13 -0
- package/build/js/DataCaptureError.js +1 -0
- package/build/js/DataCaptureVersion.d.ts +6 -0
- package/build/js/DataCaptureVersion.js +1 -0
- package/build/js/DataCaptureView.d.ts +17 -0
- package/build/js/DataCaptureView.js +1 -0
- package/build/js/DataCaptureViewPlusRelated.d.ts +25 -0
- package/build/js/DataCaptureViewPlusRelated.js +1 -0
- package/build/js/DefaultViewClassnames.d.ts +23 -0
- package/build/js/DefaultViewClassnames.js +1 -0
- package/build/js/Defaults.d.ts +143 -0
- package/build/js/Defaults.js +1 -0
- package/build/js/Feedback.d.ts +21 -0
- package/build/js/Feedback.js +1 -0
- package/build/js/FrameData.d.ts +17 -0
- package/build/js/FrameData.js +1 -0
- package/build/js/ImageFrameSource.d.ts +57 -0
- package/build/js/ImageFrameSource.js +1 -0
- package/build/js/LoadingStatus.d.ts +23 -0
- package/build/js/LoadingStatus.js +1 -0
- package/build/js/Localization.d.ts +44 -0
- package/build/js/Localization.js +1 -0
- package/build/js/LocationSelection.d.ts +39 -0
- package/build/js/LocationSelection.js +1 -0
- package/build/js/RectangularViewfinder.d.ts +33 -0
- package/build/js/RectangularViewfinder.js +1 -0
- package/build/js/SingleImageUploader.d.ts +58 -0
- package/build/js/SingleImageUploader.js +1 -0
- package/build/js/SingleImageUploaderSettings.d.ts +33 -0
- package/build/js/SingleImageUploaderSettings.js +1 -0
- package/build/js/Sound.d.ts +17 -0
- package/build/js/Sound.js +1 -0
- package/build/js/Vibration.d.ts +21 -0
- package/build/js/Vibration.js +1 -0
- package/build/js/ViewControls.d.ts +54 -0
- package/build/js/ViewControls.js +1 -0
- package/build/js/Viewfinder.d.ts +15 -0
- package/build/js/Viewfinder.js +1 -0
- package/build/js/ViewfinderPlusRelated.d.ts +58 -0
- package/build/js/ViewfinderPlusRelated.js +1 -0
- package/build/js/assets/beepSound.d.ts +4 -0
- package/build/js/assets/beepSound.js +1 -0
- package/build/js/assets/folderImage.d.ts +4 -0
- package/build/js/assets/folderImage.js +1 -0
- package/build/js/assets/index.d.d.ts +5 -0
- package/build/js/assets/index.d.js +1 -0
- package/build/js/assets/index.d.ts +5 -0
- package/build/js/assets/index.js +1 -0
- package/build/js/assets/scanningByScandit.d.ts +4 -0
- package/build/js/assets/scanningByScandit.js +1 -0
- package/build/js/assets/transparentPixelImage.d.ts +4 -0
- package/build/js/assets/transparentPixelImage.js +1 -0
- package/build/js/browserCompatibility.d.ts +83 -0
- package/build/js/browserCompatibility.js +1 -0
- package/build/js/browserHelper.d.ts +154 -0
- package/build/js/browserHelper.js +1 -0
- package/build/js/chunks/chunk-2DXPVHBJ.js +1 -0
- package/build/js/chunks/chunk-2NZR6P45.js +14 -0
- package/build/js/chunks/chunk-2Q5FZVGV.js +3 -0
- package/build/js/chunks/chunk-2WQHYCZC.js +6 -0
- package/build/js/chunks/chunk-3A4KLILV.js +3 -0
- package/build/js/chunks/chunk-3FDT22IX.js +3 -0
- package/build/js/chunks/chunk-44B7Z6ZZ.js +5 -0
- package/build/js/chunks/chunk-457L5N2F.js +6 -0
- package/build/js/chunks/chunk-4FJRDG6T.js +6 -0
- package/build/js/chunks/chunk-4ZMCJXZS.js +3 -0
- package/build/js/chunks/chunk-5IVFVUF4.js +21 -0
- package/build/js/chunks/chunk-5LIWL2C4.js +3 -0
- package/build/js/chunks/chunk-5RW5274G.js +1 -0
- package/build/js/chunks/chunk-5S537AFM.js +3 -0
- package/build/js/chunks/chunk-6H6FKGVE.js +3 -0
- package/build/js/chunks/chunk-6OQQP3SM.js +29 -0
- package/build/js/chunks/chunk-6W7FX6LD.js +3 -0
- package/build/js/chunks/chunk-6XT4BUUR.js +9 -0
- package/build/js/chunks/chunk-72DAONJI.js +5 -0
- package/build/js/chunks/chunk-76GU6PXK.js +3 -0
- package/build/js/chunks/chunk-7NUUZ7LP.js +5 -0
- package/build/js/chunks/chunk-7SW2PEHB.js +3 -0
- package/build/js/chunks/chunk-7XQ3GHYH.js +3 -0
- package/build/js/chunks/chunk-AIRWHLJH.js +5 -0
- package/build/js/chunks/chunk-BDLLVGRH.js +3 -0
- package/build/js/chunks/chunk-BKSPXD6N.js +8 -0
- package/build/js/chunks/chunk-CQ5KZRRX.js +17 -0
- package/build/js/chunks/chunk-CREAZBG7.js +5 -0
- package/build/js/chunks/chunk-D2EQRTOA.js +6 -0
- package/build/js/chunks/chunk-D4YDSS77.js +6 -0
- package/build/js/chunks/chunk-DEQ72K2Q.js +7 -0
- package/build/js/chunks/chunk-E2VUMNY4.js +16 -0
- package/build/js/chunks/chunk-EC4DRTKR.js +5 -0
- package/build/js/chunks/chunk-EK2IIDFY.js +3 -0
- package/build/js/chunks/chunk-EMHHC6NB.js +5 -0
- package/build/js/chunks/chunk-EP3GI7KA.js +3 -0
- package/build/js/chunks/chunk-EQRBQJYM.js +3 -0
- package/build/js/chunks/chunk-EV4OEANA.js +3 -0
- package/build/js/chunks/chunk-EYIDRFHC.js +6 -0
- package/build/js/chunks/chunk-FGCJ3ZLG.js +3 -0
- package/build/js/chunks/chunk-FGO2SSRS.js +3 -0
- package/build/js/chunks/chunk-FTD535WI.js +3 -0
- package/build/js/chunks/chunk-GE4CBD4E.js +3 -0
- package/build/js/chunks/chunk-GPJEB376.js +5 -0
- package/build/js/chunks/chunk-GSJH2EXJ.js +6 -0
- package/build/js/chunks/chunk-GWI2ZHMO.js +15 -0
- package/build/js/chunks/chunk-GX4YCYCH.js +3 -0
- package/build/js/chunks/chunk-H4TH4342.js +3 -0
- package/build/js/chunks/chunk-HNFNB37O.js +6 -0
- package/build/js/chunks/chunk-HRS63RFH.js +47 -0
- package/build/js/chunks/chunk-HZY2EBWP.js +8 -0
- package/build/js/chunks/chunk-IGJQFAQU.js +3 -0
- package/build/js/chunks/chunk-IH7SHTFM.js +5 -0
- package/build/js/chunks/chunk-IZLMNXTH.js +41 -0
- package/build/js/chunks/chunk-J25IZC7J.js +6 -0
- package/build/js/chunks/chunk-J2UL6U3I.js +3 -0
- package/build/js/chunks/chunk-JFRSUCMO.js +33 -0
- package/build/js/chunks/chunk-JKL2W65E.js +3 -0
- package/build/js/chunks/chunk-JS3T7K2Z.js +3 -0
- package/build/js/chunks/chunk-JXJQSWYG.js +3 -0
- package/build/js/chunks/chunk-KAZWF3JC.js +5 -0
- package/build/js/chunks/chunk-KW3YSGJX.js +5 -0
- package/build/js/chunks/chunk-KYNYQBNF.js +19 -0
- package/build/js/chunks/chunk-L2STPTEN.js +3 -0
- package/build/js/chunks/chunk-LA6TM76R.js +3 -0
- package/build/js/chunks/chunk-M46MIHI5.js +21 -0
- package/build/js/chunks/chunk-MAMZS5CH.js +7 -0
- package/build/js/chunks/chunk-MKHBE7BB.js +6 -0
- package/build/js/chunks/chunk-MSPQDVWJ.js +5 -0
- package/build/js/chunks/chunk-N4NOODAT.js +3 -0
- package/build/js/chunks/chunk-N5F43TUJ.js +5 -0
- package/build/js/chunks/chunk-N5YZEC56.js +3 -0
- package/build/js/chunks/chunk-NMX4VHW2.js +5 -0
- package/build/js/chunks/chunk-O7TZTIHO.js +3 -0
- package/build/js/chunks/chunk-OTI45AJG.js +12 -0
- package/build/js/chunks/chunk-PO2YU6JK.js +6 -0
- package/build/js/chunks/chunk-PXXUQXGB.js +7 -0
- package/build/js/chunks/chunk-Q7JWDX4U.js +3 -0
- package/build/js/chunks/chunk-QBDQQMQ5.js +5 -0
- package/build/js/chunks/chunk-QCRFVRSS.js +3 -0
- package/build/js/chunks/chunk-QCZSSQAQ.js +3 -0
- package/build/js/chunks/chunk-QR4TEDGM.js +6 -0
- package/build/js/chunks/chunk-R6E4CT22.js +3 -0
- package/build/js/chunks/chunk-RQQK6Z5F.js +3 -0
- package/build/js/chunks/chunk-SJE4IFCX.js +10 -0
- package/build/js/chunks/chunk-SP3HSP4K.js +3 -0
- package/build/js/chunks/chunk-SZ672BOB.js +5 -0
- package/build/js/chunks/chunk-T3AOBMAS.js +3 -0
- package/build/js/chunks/chunk-T5EUB6UG.js +6 -0
- package/build/js/chunks/chunk-T7URG4IQ.js +11 -0
- package/build/js/chunks/chunk-TBCW7RDM.js +21 -0
- package/build/js/chunks/chunk-TVDFY6ME.js +5 -0
- package/build/js/chunks/chunk-U6BTTEV6.js +3 -0
- package/build/js/chunks/chunk-UA3E3GGM.js +6 -0
- package/build/js/chunks/chunk-UHFABUTI.js +3 -0
- package/build/js/chunks/chunk-UPUPKPEP.js +8 -0
- package/build/js/chunks/chunk-UZWBB65W.js +3 -0
- package/build/js/chunks/chunk-VJB527QZ.js +3 -0
- package/build/js/chunks/chunk-VRVSELOR.js +6 -0
- package/build/js/chunks/chunk-W7LJM2QO.js +5 -0
- package/build/js/chunks/chunk-WSG6WSZN.js +6 -0
- package/build/js/chunks/chunk-WUHKODFA.js +3 -0
- package/build/js/chunks/chunk-XVLYCDJL.js +7 -0
- package/build/js/chunks/chunk-YRNH7TIR.js +1 -0
- package/build/js/chunks/chunk-YRSVOTNR.js +3 -0
- package/build/js/chunks/chunk-ZKROZLQ4.js +3 -0
- package/build/js/chunks/chunk-ZSYUKWWL.js +5 -0
- package/build/js/chunks/chunk-ZTM7LWVE.js +10 -0
- package/build/js/chunks/chunk-ZVBD3EW5.js +3 -0
- package/build/js/common-4FJYEFaM.d.ts +25 -0
- package/build/js/global.d.d.ts +42 -0
- package/build/js/global.d.js +1 -0
- package/build/js/index.d.ts +66 -0
- package/build/js/index.js +52 -0
- package/build/js/license/OpenSourceSoftwareLicenseInfo.d.ts +8 -0
- package/build/js/license/OpenSourceSoftwareLicenseInfo.js +1 -0
- package/build/js/logger.d.ts +26 -0
- package/build/js/logger.js +1 -0
- package/build/js/private/AnchorPositions.d.ts +28 -0
- package/build/js/private/AnchorPositions.js +1 -0
- package/build/js/private/CameraAccess.d.ts +17 -0
- package/build/js/private/CameraAccess.js +1 -0
- package/build/js/private/CameraManager.d.ts +17 -0
- package/build/js/private/CameraManager.js +1 -0
- package/build/js/private/CanvasDrawer.d.ts +36 -0
- package/build/js/private/CanvasDrawer.js +1 -0
- package/build/js/private/CanvasDrawerWithMetrics.d.ts +39 -0
- package/build/js/private/CanvasDrawerWithMetrics.js +1 -0
- package/build/js/private/CavansDrawerAbstract.d.ts +37 -0
- package/build/js/private/CavansDrawerAbstract.js +1 -0
- package/build/js/private/CoreModuleLicenseTextProvider.d.ts +29 -0
- package/build/js/private/CoreModuleLicenseTextProvider.js +1 -0
- package/build/js/private/CustomLocationsView.d.ts +47 -0
- package/build/js/private/CustomLocationsView.js +1 -0
- package/build/js/private/CustomLocationsViewStyles.d.ts +7 -0
- package/build/js/private/CustomLocationsViewStyles.js +1 -0
- package/build/js/private/DataCaptureContextRelated.d.ts +25 -0
- package/build/js/private/DataCaptureContextRelated.js +1 -0
- package/build/js/private/DrawCommandBuffer.d.ts +44 -0
- package/build/js/private/DrawCommandBuffer.js +1 -0
- package/build/js/private/EventManager.d.ts +9 -0
- package/build/js/private/EventManager.js +1 -0
- package/build/js/private/FrameReaders/FrameReader.d.ts +17 -0
- package/build/js/private/FrameReaders/FrameReader.js +1 -0
- package/build/js/private/FrameReaders/FrameReaderAbstract.d.ts +17 -0
- package/build/js/private/FrameReaders/FrameReaderAbstract.js +1 -0
- package/build/js/private/FrameReaders/GrayScaleFrameReader.d.ts +52 -0
- package/build/js/private/FrameReaders/GrayScaleFrameReader.js +1 -0
- package/build/js/private/FrameReaders/WatermarkStack.d.ts +41 -0
- package/build/js/private/FrameReaders/WatermarkStack.js +1 -0
- package/build/js/private/FrameReaders/index.d.ts +18 -0
- package/build/js/private/FrameReaders/index.js +2 -0
- package/build/js/private/FrameReaders/webglUtilities.d.ts +5 -0
- package/build/js/private/FrameReaders/webglUtilities.js +1 -0
- package/build/js/private/GestureRecognizer/GestureRecognizer.d.ts +22 -0
- package/build/js/private/GestureRecognizer/GestureRecognizer.js +1 -0
- package/build/js/private/GestureRecognizer/PointerEventsDetector.d.ts +19 -0
- package/build/js/private/GestureRecognizer/PointerEventsDetector.js +1 -0
- package/build/js/private/GestureRecognizer/index.d.ts +5 -0
- package/build/js/private/GestureRecognizer/index.js +1 -0
- package/build/js/private/Helper.d.ts +14 -0
- package/build/js/private/Helper.js +1 -0
- package/build/js/private/HtmlElementState.d.ts +35 -0
- package/build/js/private/HtmlElementState.js +1 -0
- package/build/js/private/ModuleLicenseTextProvider.d.ts +6 -0
- package/build/js/private/ModuleLicenseTextProvider.js +1 -0
- package/build/js/private/NormalizedConfigureOptions.d.ts +53 -0
- package/build/js/private/NormalizedConfigureOptions.js +1 -0
- package/build/js/private/OrientationObserver.d.ts +30 -0
- package/build/js/private/OrientationObserver.js +1 -0
- package/build/js/private/Serializable.d.ts +9 -0
- package/build/js/private/Serializable.js +1 -0
- package/build/js/private/SingleImageUploaderView.d.ts +55 -0
- package/build/js/private/SingleImageUploaderView.js +1 -0
- package/build/js/private/SingleImageUploaderViewStyles.d.ts +28 -0
- package/build/js/private/SingleImageUploaderViewStyles.js +1 -0
- package/build/js/private/View.d.ts +7 -0
- package/build/js/private/View.js +1 -0
- package/build/js/private/ViewClassNames.d.ts +23 -0
- package/build/js/private/ViewClassNames.js +1 -0
- package/build/js/private/ViewControls+related.js +1 -0
- package/build/js/private/ViewControls_related.d.ts +120 -0
- package/build/js/private/ViewStyles.d.ts +4 -0
- package/build/js/private/ViewStyles.js +1 -0
- package/build/js/private/ViewsRegistry.d.ts +21 -0
- package/build/js/private/ViewsRegistry.js +1 -0
- package/build/js/private/hybridDesktopPlatformHelpers.d.ts +23 -0
- package/build/js/private/hybridDesktopPlatformHelpers.js +1 -0
- package/build/js/private/multithreadSimdHelper.d.ts +31 -0
- package/build/js/private/multithreadSimdHelper.js +1 -0
- package/build/js/private/ui/atoms/ArrowsUp.d.ts +19 -0
- package/build/js/private/ui/atoms/ArrowsUp.js +1 -0
- package/build/js/private/ui/atoms/ProgressBar.d.ts +28 -0
- package/build/js/private/ui/atoms/ProgressBar.js +1 -0
- package/build/js/private/ui/atoms/RoundedCheckSvgIcon.d.ts +17 -0
- package/build/js/private/ui/atoms/RoundedCheckSvgIcon.js +1 -0
- package/build/js/private/ui/atoms/RoundedExclamationMarkSvgIcon.d.ts +17 -0
- package/build/js/private/ui/atoms/RoundedExclamationMarkSvgIcon.js +1 -0
- package/build/js/private/ui/atoms/ShutterButton.d.ts +39 -0
- package/build/js/private/ui/atoms/ShutterButton.js +29 -0
- package/build/js/private/ui/atoms/SvgIcon.d.ts +22 -0
- package/build/js/private/ui/atoms/SvgIcon.js +1 -0
- package/build/js/private/ui/atoms/Toast.d.ts +67 -0
- package/build/js/private/ui/atoms/Toast.js +1 -0
- package/build/js/private/ui/colors.d.ts +27 -0
- package/build/js/private/ui/colors.js +1 -0
- package/build/js/private/ui/molecules/HintPresenter.d.ts +58 -0
- package/build/js/private/ui/molecules/HintPresenter.js +1 -0
- package/build/js/private/ui/molecules/LoadingOverlay.d.ts +26 -0
- package/build/js/private/ui/molecules/LoadingOverlay.js +1 -0
- package/build/js/private/unsupportedBrowserError.d.ts +10 -0
- package/build/js/private/unsupportedBrowserError.js +1 -0
- package/build/js/private/utils/ScanditHTMLElement.d.ts +6 -0
- package/build/js/private/utils/ScanditHTMLElement.js +1 -0
- package/build/js/private/utils/clamp.d.ts +4 -0
- package/build/js/private/utils/clamp.js +1 -0
- package/build/js/private/utils/css.d.ts +4 -0
- package/build/js/private/utils/css.js +1 -0
- package/build/js/private/utils/debounce.d.ts +4 -0
- package/build/js/private/utils/debounce.js +1 -0
- package/build/js/private/utils/deferred.d.ts +9 -0
- package/build/js/private/utils/deferred.js +1 -0
- package/build/js/private/utils/defineCustomElements.d.ts +4 -0
- package/build/js/private/utils/defineCustomElements.js +1 -0
- package/build/js/private/utils/html.d.ts +4 -0
- package/build/js/private/utils/html.js +1 -0
- package/build/js/private/utils/index.d.ts +16 -0
- package/build/js/private/utils/index.js +15 -0
- package/build/js/private/utils/isObject.d.ts +4 -0
- package/build/js/private/utils/isObject.js +1 -0
- package/build/js/private/utils/isWorkerScope.d.ts +4 -0
- package/build/js/private/utils/isWorkerScope.js +1 -0
- package/build/js/private/utils/match.d.ts +11 -0
- package/build/js/private/utils/match.js +1 -0
- package/build/js/private/utils/throttle.d.ts +4 -0
- package/build/js/private/utils/throttle.js +1 -0
- package/build/js/private/utils/timeout.d.ts +14 -0
- package/build/js/private/utils/timeout.js +1 -0
- package/build/js/private/utils/unknownErrorToString.d.ts +4 -0
- package/build/js/private/utils/unknownErrorToString.js +1 -0
- package/build/js/private/utils/wait.d.ts +4 -0
- package/build/js/private/utils/wait.js +1 -0
- package/build/js/private/utils/waitTransitionEndForElement.d.ts +4 -0
- package/build/js/private/utils/waitTransitionEndForElement.js +1 -0
- package/build/js/sdk.d.ts +30 -0
- package/build/js/sdk.js +1 -0
- package/build/js/translations.d.ts +12 -0
- package/build/js/translations.js +1 -0
- package/build/js/tsHelper.d.ts +26 -0
- package/build/js/tsHelper.js +1 -0
- package/build/js/worker/OverrideState.d.ts +8 -0
- package/build/js/worker/OverrideState.js +1 -0
- package/build/js/worker/WorkerMain.d.ts +40 -0
- package/build/js/worker/WorkerMain.js +1 -0
- package/build/js/worker/dataCapture.inlineWorker.d.ts +24 -0
- package/build/js/worker/dataCapture.inlineWorker.js +1 -0
- package/build/js/worker/dataCaptureEngine.d.ts +17 -0
- package/build/js/worker/dataCaptureEngine.js +1 -0
- package/build/js/worker/dataCaptureLoader.d.ts +17 -0
- package/build/js/worker/dataCaptureLoader.js +1 -0
- package/build/js/worker/dataCaptureWorkerRelated.d.ts +17 -0
- package/build/js/worker/dataCaptureWorkerRelated.js +1 -0
- package/build/js/worker/helper.d.ts +16 -0
- package/build/js/worker/helper.js +1 -0
- package/build/js/worker/helperFetch.d.ts +33 -0
- package/build/js/worker/helperFetch.js +1 -0
- package/build/js/worker/helperFs.d.ts +9 -0
- package/build/js/worker/helperFs.js +1 -0
- package/build/js/worker/importWasmScript.d.ts +4 -0
- package/build/js/worker/importWasmScript.js +1 -0
- package/build/js/worker/index.d.ts +18 -0
- package/build/js/worker/index.js +4 -0
- package/build/js/worker/inlineWorker.d.d.ts +5 -0
- package/build/js/worker/inlineWorker.d.js +1 -0
- package/package.json +156 -0
- package/sdc-lib/.gitkeep +0 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { b, a as a$2 } from './chunk-SZ672BOB.js';
|
|
2
|
+
import { a } from './chunk-EK2IIDFY.js';
|
|
3
|
+
import { a as a$1 } from './chunk-76GU6PXK.js';
|
|
4
|
+
|
|
5
|
+
var m=`
|
|
6
|
+
attribute vec2 a_position;
|
|
7
|
+
varying vec2 v_texcoord;
|
|
8
|
+
|
|
9
|
+
void main() {
|
|
10
|
+
gl_Position = vec4(a_position, 0, 1);
|
|
11
|
+
v_texcoord = a_position * 0.5 + 0.5;
|
|
12
|
+
}
|
|
13
|
+
`,w=`
|
|
14
|
+
precision mediump float;
|
|
15
|
+
varying vec2 v_texcoord;
|
|
16
|
+
uniform sampler2D u_texture;
|
|
17
|
+
uniform float x_spacing; // Uniform for x-spacing between pixels
|
|
18
|
+
|
|
19
|
+
// Function to calculate grayscale
|
|
20
|
+
float toGray(vec4 color) {
|
|
21
|
+
return dot(color.rgb, vec3(0.299, 0.587, 0.114));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
void main() {
|
|
25
|
+
// Sample adjacent pixels with spacing of 1/width
|
|
26
|
+
vec4 a = texture2D(u_texture, v_texcoord + vec2(0.0 * x_spacing, 0.0));
|
|
27
|
+
vec4 b = texture2D(u_texture, v_texcoord + vec2(1.0 * x_spacing, 0.0));
|
|
28
|
+
vec4 c = texture2D(u_texture, v_texcoord + vec2(2.0 * x_spacing, 0.0));
|
|
29
|
+
vec4 d = texture2D(u_texture, v_texcoord + vec2(3.0 * x_spacing, 0.0));
|
|
30
|
+
|
|
31
|
+
// Calculate grayscale values
|
|
32
|
+
float grayscaleA = toGray(a);
|
|
33
|
+
float grayscaleB = toGray(b);
|
|
34
|
+
float grayscaleC = toGray(c);
|
|
35
|
+
float grayscaleD = toGray(d);
|
|
36
|
+
|
|
37
|
+
// Set the final color with grayscale values
|
|
38
|
+
gl_FragColor = vec4(grayscaleA, grayscaleB, grayscaleC, grayscaleD);
|
|
39
|
+
}`,x=class extends a{constructor(t,e){super(t,e);this.colorType="GRAYSCALE";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:!1}),!this._ctx)throw new Error("Cannot get WebGL context");this.setup();}return this._ctx}readFromSource(t){var _,h;this.updateCanvasSizeIfNeeded(),this.updateFrameSizeIfNeeded();let e=(_=t==null?void 0:t.videoWidth)!=null?_:this._contextWebGL.drawingBufferWidth,{drawingBufferWidth:r,drawingBufferHeight:i,TEXTURE_2D:f,RGBA:o,UNSIGNED_BYTE:s,TRIANGLES:d}=this._webglContext;this._webglContext.viewport(0,0,r,i);let u=this._webglContext.getUniformLocation(this._shaderProgram,"x_spacing"),p=1/e;this._webglContext.uniform1f(u,p),this._webglContext.texImage2D(f,0,o,o,s,t),this._webglContext.drawArrays(d,0,6);let a=(h=this._framePool)==null?void 0:h.pop();if(!a)throw new Error("Frame pool found empty!");this._webglContext.readPixels(0,0,r,i,o,s,a);let b=new Uint8ClampedArray(a.buffer,0,e*i);return {width:e,height:i,data:b,colorType:"GRAYSCALE"}}setup(){this.initShaderProgram(),this.initBuffers(),this.initTexture();}dispose(){var t;this._shaderProgram&&(this._webglContext.deleteProgram(this._shaderProgram),this._shaderProgram=null),this._positionBuffer&&(this._webglContext.deleteBuffer(this._positionBuffer),this._positionBuffer=null),this._texture&&(this._webglContext.deleteTexture(this._texture),this._texture=null),this._ctx=null,(t=this._framePool)==null||t.empty(),this._canvas=void 0;}updateCanvasSizeIfNeeded(){this._canvas&&(this._canvas.width!==this._contextWebGL.drawingBufferWidth/4||this._canvas.height!==this._contextWebGL.drawingBufferHeight)&&(this._canvas.width=this._contextWebGL.drawingBufferWidth/4,this._canvas.height=this._contextWebGL.drawingBufferHeight);}updateFrameSizeIfNeeded(){var i;let{drawingBufferWidth:t,drawingBufferHeight:e}=this._webglContext,r=t*e*4;this._frameSize!==r&&(this._frameSize=t*e*4,(i=this._framePool)==null||i.empty(),this._framePool=new a$1({capacity:this._maxPoolCapacity,lowWaterMark:this._minPoolCapacity,createItem:()=>new Uint8ClampedArray(this._frameSize)}));}initShaderProgram(){let t=b(this._webglContext,this._webglContext.VERTEX_SHADER,m),e=b(this._webglContext,this._webglContext.FRAGMENT_SHADER,w);if(!t||!e)throw new Error("Shaders cannot be created");this._shaderProgram=a$2(this._webglContext,t,e),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,!1,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);}};
|
|
40
|
+
|
|
41
|
+
export { x as a };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { a } from './chunk-SP3HSP4K.js';
|
|
2
|
+
import { e, d as d$1, c } from './chunk-2Q5FZVGV.js';
|
|
3
|
+
|
|
4
|
+
var b={};function T(e){return [...new Uint8Array(e)].map(r=>{let n=r.toString(16);return n.length===1?`0${n}`:n}).join("")}function I(e){return d$1(this,null,function*(){let r=e.getReader();try{for(;;){let{done:n,value:t}=yield new c(r.read());if(n)return;yield t;}}finally{r.releaseLock();}})}async function L(e$1){let r=[],n=0,t=0;try{for(var s=e(I(e$1)),f,o,l;f=!(o=await s.next()).done;f=!1){let c=o.value;r.push(c),n+=c.length;}}catch(o){l=[o];}finally{try{f&&(o=s.return)&&await o.call(s);}finally{if(l)throw l[0]}}let a=new Uint8Array(n);for(let c of r)a.set(c,t),t+=c.length;return a.buffer}var S=(t=>(t.VALID="VALID",t.INVALID="INVALID",t.NOT_VERIFIABLE="NOT_VERIFIABLE",t))(S||{});async function R(e,r,n){if(typeof crypto.subtle.digest!="function")return a.log(a.Level.Warn,`Insecure context (see https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts): The hash of the Scandit Data Capture library WASM file found at ${n} could not be verified`),"NOT_VERIFIABLE";try{let t=e instanceof Promise?await e:e,a$1=await crypto.subtle.digest("SHA-256",t),s=T(a$1);return r==null?(a.log(a.Level.Warn,"The library hash is not defined or empty, cannot correctly verify integrity."),"NOT_VERIFIABLE"):s===r?(a.log(a.Level.Debug,`Data Capture library WASM integrity found at ${n} has been verified correctly.`),"VALID"):(a.log(a.Level.Warn,`The Scandit Data Capture library WASM file found at ${n} seems invalid: expected file hash doesn't match (received: ${s}, expected: ${r}). Please ensure the correct Scandit Data Capture file (with correct version) is retrieved.`),"INVALID")}catch(t){return a.log(a.Level.Warn,"Wasm response could not be verified",t),"NOT_VERIFIABLE"}}var d=new Map([["br",4.4],["gzip",2.9],["none",1]]);function w(e){var t;let r="content-encoding";if(e==null||e.get(r)==null)return d.get("none");let n=new Set(((t=e.get(r))!=null?t:"").split(",").map(a=>a.trim()));for(let[a,s]of d)if(n.has(a))return s;return d.get("none")}function B(e){var t,a;if(e==null)return 0;let r=(t=w(e))!=null?t:1,n=Number.parseInt((a=e.get("content-length"))!=null?a:"0",10);return Number.isNaN(n)?0:Math.floor(n*r*100)/100}function x(e){let{pathname:r}=new URL(e);for(let[n,t]of Object.entries(b))if(r.endsWith(n))return t.bytes;return 0}function V(e){b=e;}var N=(e,r)=>{let n=B(r);return n===0?x(e):n};function W(e,r,n,{onProgress:t,onError:a,onComplete:s}){if(!r.body)return [r];let f=N(e,r.headers),o=0,l=0,[c,A]=n?r.body.tee():[r.body],v=c.pipeThrough(new TransformStream({async transform(u,y){try{o+=u.length,l=Number((o/f*100).toFixed(2)),f>0&&u.length>0&&l<100?t==null||t({percentage:l,loadedBytes:o,privateUri:e}):f===0&&u.length>0&&(t==null||t({percentage:null,loadedBytes:o,privateUri:e})),y.enqueue(u);}catch(m){y.error(m),a==null||a({error:m});}},flush(u){t==null||t({percentage:100,loadedBytes:o,privateUri:e}),s==null||s({percentage:100,loadedBytes:o,privateUri:e}),u.terminate();}}));return [new Response(v,{headers:new Headers(r.headers),status:r.status,statusText:r.statusText}),A]}async function D({wasmURI:e,expectedHash:r,verifyResponseHash:n,onProgress:t,onComplete:a,onError:s,referredOrigin:f}){let o=await fetch(e,{referrerPolicy:"origin",referrer:f!=null?f:""});if(!o.ok)throw new Error(`HTTP status code is not ok: ${o.status}, ${o.statusText}`);let[l,c]=W(e,o,n,{onProgress:t,onError:s,onComplete:a});return c!=null&&R(L(c),r,e),l}
|
|
5
|
+
|
|
6
|
+
export { S as a, R as b, V as c, N as d, W as e, D as f };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var t=(e=>(e.Rounded="rounded",e.Square="square",e))(t||{}),o=(e=>(e.Light="light",e.Bold="bold",e))(o||{}),n=class r{constructor(i){this._isLooping=!1;this._isLooping=i;}get isLooping(){return this._isLooping}static fromJSON(i){return i===null?null:new r(i.looping)}toJSONObject(){return {looping:this.isLooping}}};
|
|
2
|
+
|
|
3
|
+
export { t as a, o as b, n as c };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var e={SINGLE_IMAGE_UPLOADER_CONTAINER:"scandit-single-image-uploader-container"},t={SINGLE_IMAGE_UPLOADER_CONTAINER_STYLE:{backgroundColor:"#FFFFFF"},SINGLE_IMAGE_UPLOADER_ICON_STYLE:{fill:"#121619"},SINGLE_IMAGE_UPLOADER_INFORMATION_STYLE:{color:"#121619",marginBottom:"2em"},SINGLE_IMAGE_UPLOADER_BUTTON_STYLE:{color:"#FFFFFF",backgroundColor:"#121619",fontWeight:"bold",padding:"1.25em",width:"12em",textAlign:"center",textTransform:"uppercase"}},E=`
|
|
2
|
+
.${e.SINGLE_IMAGE_UPLOADER_CONTAINER} {
|
|
3
|
+
-webkit-tap-highlight-color: rgba(255, 255, 255, 0);
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
align-items: center;
|
|
8
|
+
width: 100%;
|
|
9
|
+
height: 100%;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.${e.SINGLE_IMAGE_UPLOADER_CONTAINER} label {
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
align-items: center;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.${e.SINGLE_IMAGE_UPLOADER_CONTAINER} label input[type="file"] {
|
|
20
|
+
position: absolute;
|
|
21
|
+
top: -9999px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.${e.SINGLE_IMAGE_UPLOADER_CONTAINER} label div {
|
|
25
|
+
user-select: none;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.${e.SINGLE_IMAGE_UPLOADER_CONTAINER} label input[type="file"]:disabled + div {
|
|
29
|
+
opacity: 0.5;
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
32
|
+
|
|
33
|
+
export { e as a, t as b, E as c };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var A={CONTAINER_CLASS_NAME:"scandit-container",PAINTBOARDS_CONTAINER_CLASS_NAME:"scandit-paintboards",PAINTBOARD_CLASS_NAME:"scandit-paintboard",PAINTBOARD_CLASS_NAME_STATE_ON:"scandit-paintboard--camera-on",CONTROLS_CLASS_NAME:"scandit-controls",CONTROL_WIDGET_CLASS_NAME:"scandit-control-widget",MIRRORED_CLASS_NAME:"scandit-mirrored",CAMERA_RECOVERY_CLASS_NAME:"scandit-camera-recovery",ERROR_CLASS_NAME:"scandit-error",HINT_CONTAINER_CLASS_NAME:"scandit-hint-container",HINT_CLASS_NAME:"scandit-hint",SINGLE_IMAGE_UPLOADER_CONTAINER_CLASS_NAME:"scandit-single-image-uploader-container",CANVAS_VIDEO_PREVIEW_CLASS_NAME:"scandit-canvas-video-preview",TORCH_SWITCH_CONTROL_CLASS_NAME:"torch",CAMERA_SWITCH_CONTROL_CLASS_NAME:"camera",CAMERA_FOV_SWITCH_CONTROL_CLASS_NAME:"camera-fov",SHUTTER_BUTTON_CONTROL_CLASS_NAME:"shutter",FROZEN_FRAME:"frozen-frame"};
|
|
2
|
+
|
|
3
|
+
export { A as a };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var A="data:audio/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQRChYECGFOAZwEAAAAAAAOWEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHWTbuMU6uEElTDZ1OsggFATbuMU6uEHFO7a1OsggOA7AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmsCrXsYMPQkBNgIxMYXZmNjEuMS4xMDBXQYxMYXZmNjEuMS4xMDBEiYhAd+AAAAAAABZUrmvlrgEAAAAAAABc14EBc8WIg08ub3qWhnCcgQAitZyDdW5kiIEAhoZBX09QVVNWqoNjLqBWu4QExLQAg4EC4ZGfgQK1iEDHcAAAAAAAYmSBIGOik09wdXNIZWFkAQI4AeAuAAAAAAASVMNn+3Nzn2PAgGfImUWjh0VOQ09ERVJEh4xMYXZmNjEuMS4xMDBzc9ZjwItjxYiDTy5vepaGcGfIoUWjh0VOQ09ERVJEh5RMYXZjNjEuMy4xMDAgbGlib3B1c2fIoUWjiERVUkFUSU9ORIeTMDA6MDA6MDAuMzgyMDAwMDAwAB9DtnVBuueBAKOugQAAgCiDbjuDzUwipkvAAbsncWC64YXA60en1ZoN8Z+MzFsMrkjZdE9+kzThwKOugQAVgCikmlGjqD/BMTx8UMHQQIkyzNa4+i/GF8qWxMmwp9/b52ziROwy8+vlu6OogQApgCif9PJP2TVhRpk9OiIKqY7SgqYyraCgntSwzRFSNDAu39ER0KO0gQA9gCi+D4hgiPOvYBIzXCNWGWyjS2R2d67BIFy+lpuz8g8lJ9B/wNMBXD6sTtm6R2FKYKObgQBRgCgjswJcBYTX6v+tXBR9jGkdsn9jRx/Io4uBAGWAKAfGs+Mf06OMgQB5gCgHxrMPn6Jko4yBAI2AKAfGsw+fomSjjIEAoYAoB8azD5+iZKOMgQC1gCgHxrMPn6Jko4yBAMmAKAfGsw+fomSjjIEA3YAoB8azD5+iZKOMgQDxgCgHxrMPn6Jko4yBAQWAKAfGsw+fomSjjIEBGYAoB8azD5+iZKOMgQEtgCgHxrMPn6Jko4yBAUGAKAfGsw+fomSjjIEBVYAoB8azD5+iZKOMgQFpgCgHxrMPn6JkoJWhjIEBfQAoB8azD5+iZHWihAEgpTscU7trkbuPs4EAt4r3gQHxggHA8IED";
|
|
2
|
+
|
|
3
|
+
export { A as a };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { d } from './chunk-UPUPKPEP.js';
|
|
2
|
+
|
|
3
|
+
var l=class i{constructor(e){this.iconElement=d.SingleImageUploader.Settings.iconElement;this.informationElement=d.SingleImageUploader.Settings.informationElement;this.buttonElement=d.SingleImageUploader.Settings.buttonElement;this.containerStyle=d.SingleImageUploader.Settings.containerStyle;this.iconStyle=d.SingleImageUploader.Settings.iconStyle;this.informationStyle=d.SingleImageUploader.Settings.informationStyle;this.buttonStyle=d.SingleImageUploader.Settings.buttonStyle;this.onlyCameraCapture=d.SingleImageUploader.Settings.onlyCameraCapture;e!=null&&(this.iconElement=e.iconElement,this.informationElement=e.informationElement,this.buttonElement=e.buttonElement,this.containerStyle=e.containerStyle,this.iconStyle=e.iconStyle,this.informationStyle=e.informationStyle,this.buttonStyle=e.buttonStyle,this.onlyCameraCapture=e.onlyCameraCapture);}static fromJSON(e){let t=new i(null);return t.iconElement=document.createRange().createContextualFragment(e.iconElement).firstElementChild,t.informationElement=document.createRange().createContextualFragment(e.informationElement).firstElementChild,t.buttonElement=document.createRange().createContextualFragment(e.buttonElement).firstElementChild,t.containerStyle=e.containerStyle,t.iconStyle=e.iconStyle,t.informationStyle=e.informationStyle,t.buttonStyle=e.buttonStyle,t.onlyCameraCapture=e.onlyCameraCapture,t}toJSONObject(){return {iconElement:this.iconElement.outerHTML,informationElement:this.informationElement.outerHTML,buttonElement:this.buttonElement.outerHTML,containerStyle:{...this.containerStyle},iconStyle:{...this.iconStyle},informationStyle:{...this.informationStyle},buttonStyle:{...this.buttonStyle},onlyCameraCapture:this.onlyCameraCapture}}};
|
|
4
|
+
|
|
5
|
+
export { l as a };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { l } from './chunk-N4NOODAT.js';
|
|
2
|
+
|
|
3
|
+
var s={type:"none"},o=class{constructor(t){this.type="radius";this._radius=t;}get radius(){return this._radius}toJSONObject(){return {type:this.type,radius:this.radius.toJSONObject()}}},a=class n{constructor(){this.type="rectangular";}get sizeWithUnitAndAspect(){return this._sizeWithUnitAndAspect}static withSize(t){let i=new n;return i._sizeWithUnitAndAspect=l.sizeWithWidthAndHeight(t),i}static withWidthAndAspectRatio(t,i){let e=new n;return e._sizeWithUnitAndAspect=l.sizeWithWidthAndAspectRatio(t,i),e}static withHeightAndAspectRatio(t,i){let e=new n;return e._sizeWithUnitAndAspect=l.sizeWithHeightAndAspectRatio(t,i),e}toJSONObject(){return {type:this.type,size:this.sizeWithUnitAndAspect.toJSONObject()}}};
|
|
4
|
+
|
|
5
|
+
export { s as a, o as b, a as c };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var e={CUSTOM_VIEW_CONTAINER:"scandit-custom-views"},t=`
|
|
2
|
+
.${e.CUSTOM_VIEW_CONTAINER} {
|
|
3
|
+
position: absolute;
|
|
4
|
+
width: 100%;
|
|
5
|
+
height: 100%;
|
|
6
|
+
top: 0;
|
|
7
|
+
left: 0;
|
|
8
|
+
}
|
|
9
|
+
.${e.CUSTOM_VIEW_CONTAINER} img {
|
|
10
|
+
position: absolute;
|
|
11
|
+
-webkit-tap-highlight-color: transparent;
|
|
12
|
+
-webkit-user-select: none;
|
|
13
|
+
-moz-user-select: none;
|
|
14
|
+
-ms-user-select: none;
|
|
15
|
+
user-select: none;
|
|
16
|
+
}
|
|
17
|
+
`,s=t;
|
|
18
|
+
|
|
19
|
+
export { e as a, s as b };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var h=(e=>(e[e.AddLine=0]="AddLine",e[e.AddArc=1]="AddArc",e[e.AddCircle=2]="AddCircle",e[e.AddRect=3]="AddRect",e[e.AddRoundedRect=4]="AddRoundedRect",e[e.BeginPath=5]="BeginPath",e[e.ClosePath=6]="ClosePath",e[e.Fill=7]="Fill",e[e.Stroke=8]="Stroke",e[e.Clear=9]="Clear",e[e.SetStrokeWidth=10]="SetStrokeWidth",e[e.SetFillColor=11]="SetFillColor",e[e.SetStrokeColor=12]="SetStrokeColor",e[e.MoveTo=13]="MoveTo",e[e.LineTo=14]="LineTo",e[e.SaveState=15]="SaveState",e[e.RestoreState=16]="RestoreState",e[e.Translate=17]="Translate",e[e.ScaleAroundPoint=18]="ScaleAroundPoint",e[e.BezierTo=19]="BezierTo",e[e.Transform=20]="Transform",e[e.Scale=21]="Scale",e[e.AddPathWinding=22]="AddPathWinding",e))(h||{}),i=class{constructor(t){this._index=0;this._view=new DataView(t.buffer),this._index=0;}extractCommandType(){let t=this._view.getUint8(this._index);return this._index+=1,t}extractFloat(){let t=this._view.getFloat32(this._index,!0);return this._index+=4,t}extractBoolean(){let t=this._view.getUint8(this._index);return this._index+=1,t!==0}extractColor(){let t=this._view.getUint8(this._index),s=this._view.getUint8(this._index+1),l=this._view.getUint8(this._index+2),c=this._view.getUint8(this._index+3)/256;return this._index+=4,{r:t,g:s,b:l,a:c}}isConsumed(){return this._index>=this._view.byteLength}};
|
|
2
|
+
|
|
3
|
+
export { h as a, i as b };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { a } from './chunk-MAMZS5CH.js';
|
|
2
|
+
import { a as a$1 } from './chunk-3A4KLILV.js';
|
|
3
|
+
import { a as a$2 } from './chunk-U6BTTEV6.js';
|
|
4
|
+
|
|
5
|
+
var e=class e extends a{static create(){return document.createElement(e.tag)}static register(){a$1({[e.tag]:e});}render(){return a$2`
|
|
6
|
+
<style>
|
|
7
|
+
${e.tag} {
|
|
8
|
+
display: flex;
|
|
9
|
+
}
|
|
10
|
+
</style>
|
|
11
|
+
<svg width="${this.size}" height="${this.heightForViewbox(24,24)}" viewBox="0 0 24 24" fill="none">
|
|
12
|
+
<path
|
|
13
|
+
fill-rule="evenodd"
|
|
14
|
+
clip-rule="evenodd"
|
|
15
|
+
d="M20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12ZM22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12ZM16.7337 10.4937C17.0888 10.152 17.0888 9.59799 16.7337 9.25628C16.3787 8.91457 15.8031 8.91457 15.4481 9.25628L10.6364 13.8876L8.55192 11.8813C8.19689 11.5396 7.62129 11.5396 7.26627 11.8813C6.91124 12.223 6.91124 12.777 7.26627 13.1187L9.99354 15.7437C10.3486 16.0854 10.9242 16.0854 11.2792 15.7437L16.7337 10.4937Z"
|
|
16
|
+
fill="${this.fill}"
|
|
17
|
+
/>
|
|
18
|
+
</svg>
|
|
19
|
+
`}};e.tag="scandit-rounded-check-icon";var t=e;t.register();
|
|
20
|
+
|
|
21
|
+
export { t as a };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { a as a$1 } from './chunk-3A4KLILV.js';
|
|
2
|
+
import { a as a$2 } from './chunk-U6BTTEV6.js';
|
|
3
|
+
import { a } from './chunk-EV4OEANA.js';
|
|
4
|
+
|
|
5
|
+
var r="inline-style",e=class e extends a{get fill(){var t;return (t=this.getAttribute("fill"))!=null?t:"black"}set fill(t){this.setAttribute("fill",t);}get size(){var t;return Number((t=this.getAttribute("size"))!=null?t:"32")}set size(t){this.setAttribute("size",t.toString());}get[r](){return this.getAttribute(r)}set[r](t){t==null?this.removeAttribute(r):this.setAttribute(r,t);}static create(){return a$1({[e.tag]:e}),document.createElement(e.tag)}render(){return a$2`<div></div>`}heightForViewbox(t,i){return this.size*this.aspectRatioForViewbox(t,i)}aspectRatioForViewbox(t,i){return i/t}connectedCallback(){this.innerHTML=this.render();}attributeChangedCallback(t,i,b){b!==i&&(this.innerHTML=this.render());}};e.tag="scandit-svg-icon",e.observedAttributes=["fill","size"];var u=e;
|
|
6
|
+
|
|
7
|
+
export { u as a };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { d } from './chunk-UPUPKPEP.js';
|
|
2
|
+
import { n } from './chunk-N4NOODAT.js';
|
|
3
|
+
|
|
4
|
+
var e=class i{constructor(o=d.Brush.fillColor,r=d.Brush.strokeColor,s=d.Brush.strokeWidth){this.fill={color:o},this.stroke={color:r,width:s};}static get transparent(){let o=n.fromRGBA(255,255,255,0);return new i(o,o,0)}get fillColor(){return this.fill.color}get strokeColor(){return this.stroke.color}get strokeWidth(){return this.stroke.width}static areEquals(o,r){return o==null||r==null?!1:n.areEquals(o.fill.color,r.fill.color)&&n.areEquals(o.stroke.color,r.stroke.color)&&o.stroke.width===r.stroke.width}toJSONObject(){return {fill:{color:this.fillColor.toJSON()},stroke:{width:this.strokeWidth,color:this.strokeColor.toJSON()}}}};
|
|
5
|
+
|
|
6
|
+
export { e as a };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { n as n$1 } from './chunk-N4NOODAT.js';
|
|
2
|
+
|
|
3
|
+
var e=n$1.fromRGBA(46,193,206,1),n=n$1.fromRGBA(98,209,218,1),t=n$1.fromRGBA(151,224,230,1),c=n$1.fromRGBA(203,240,243,1),a=n$1.fromRGBA(18,22,25,1),m=n$1.fromRGBA(218,225,231,1),p=n$1.fromRGBA(40,211,128,1),G=n$1.fromRGBA(83,220,153,1),R=n$1.fromRGBA(126,229,179,1),f=n$1.fromRGBA(169,237,204,1),s=n$1.fromRGBA(212,246,230,1),x=n$1.fromRGBA(251,192,44,1),y=n$1.fromRGBA(252,205,86,1),A=n$1.fromRGBA(253,217,128,1),B=n$1.fromRGBA(254,230,171,1),d=n$1.fromRGBA(254,242,213,1),S=n$1.fromRGBA(250,68,70,1),g=n$1.fromRGBA(251,105,107,1),i=n$1.fromRGBA(252,143,144,1),l=n$1.fromRGBA(253,180,181,1),O=n$1.fromRGBA(254,218,218,1);
|
|
4
|
+
|
|
5
|
+
export { e as a, n as b, t as c, c as d, a as e, m as f, p as g, G as h, R as i, f as j, s as k, x as l, y as m, A as n, B as o, d as p, S as q, g as r, i as s, l as t, O as u };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var a=class e{constructor(t,i){this._x=t,this._y=i;}get x(){return this._x}get y(){return this._y}static mirrorX(t,i){let r=t.x-i.width;return r*=-1,new e(r,t.y)}static fromJSON(t){return new e(t.x,t.y)}toJSONObject(){return {x:this.x,y:this.y}}},b=class e{constructor(t,i,r,o){this._topLeft=t,this._topRight=i,this._bottomRight=r,this._bottomLeft=o;}get topLeft(){return this._topLeft}get topRight(){return this._topRight}get bottomRight(){return this._bottomRight}get bottomLeft(){return this._bottomLeft}static fromJSON(t){return new e(a.fromJSON(t.topLeft),a.fromJSON(t.topRight),a.fromJSON(t.bottomRight),a.fromJSON(t.bottomLeft))}toJSONObject(){return {topLeft:this.topLeft.toJSONObject(),topRight:this.topRight.toJSONObject(),bottomLeft:this.bottomLeft.toJSONObject(),bottomRight:this.bottomRight.toJSONObject()}}},W=(i=>(i.Pixel="pixel",i.Fraction="fraction",i))(W||{}),n=class e{constructor(t,i){this._value=t,this._unit=i;}get value(){return this._value}get unit(){return this._unit}static fromJSON(t){return new e(t.value,t.unit)}toJSONObject(){return {unit:this.unit,value:this.value}}},S=class e{constructor(t,i){this._x=t,this._y=i;}static get zero(){return new e(new n(0,"pixel"),new n(0,"pixel"))}get x(){return this._x}get y(){return this._y}static fromJSON(t){return new e(n.fromJSON(t.x),n.fromJSON(t.y))}toJSONObject(){return {x:this.x.toJSONObject(),y:this.y.toJSONObject()}}},g=class{constructor(t,i){this._origin=t,this._size=i;}get origin(){return this._origin}get size(){return this._size}toJSONObject(){return {origin:this.origin.toJSONObject(),size:this.size.toJSONObject()}}},N=class{constructor(t,i){this._origin=t,this._size=i;}get origin(){return this._origin}get size(){return this._size}toJSONObject(){return {origin:this._origin.toJSONObject(),size:this._size.toJSONObject()}}},l=class e{constructor(t,i){this._width=t,this._height=i;}get width(){return this._width}get height(){return this._height}static fromJSON(t){return new e(n.fromJSON(t.width),n.fromJSON(t.height))}isSameAs(t){return JSON.stringify(this.toJSONObject())===JSON.stringify(t.toJSONObject())}toJSONObject(){return {width:this.width.toJSONObject(),height:this.height.toJSONObject()}}},d=class e{constructor(t,i){this._width=t,this._height=i;}get width(){return this._width}get height(){return this._height}static fromJSON(t){return new e(t.width,t.height)}toJSONObject(){return {height:this.height,width:this.width}}},p=class{constructor(t,i){this._size=t,this._aspect=i;}get size(){return this._size}get aspect(){return this._aspect}},f=(o=>(o.WidthAndHeight="widthAndHeight",o.WidthAndAspectRatio="widthAndAspectRatio",o.HeightAndAspectRatio="heightAndAspectRatio",o.ShorterDimensionAndAspectRatio="shorterDimensionAndAspectRatio",o))(f||{}),O=class e{constructor(){this._shorterDimensionAndAspectRatio=null;}get widthAndHeight(){return this._widthAndHeight}get widthAndAspectRatio(){return this._widthAndAspectRatio}get heightAndAspectRatio(){return this._heightAndAspectRatio}get shorterDimensionAndAspectRatio(){return this._shorterDimensionAndAspectRatio}get sizingMode(){return this.widthAndAspectRatio?"widthAndAspectRatio":this.heightAndAspectRatio?"heightAndAspectRatio":this.shorterDimensionAndAspectRatio?"shorterDimensionAndAspectRatio":"widthAndHeight"}static sizeWithWidthAndHeight(t){let i=new e;return i._widthAndHeight=t,i}static sizeWithWidthAndAspectRatio(t,i){let r=new e;return r._widthAndAspectRatio=new p(t,i),r}static sizeWithHeightAndAspectRatio(t,i){let r=new e;return r._heightAndAspectRatio=new p(t,i),r}static sizeWithShorterDimensionAndAspectRatio(t,i){let r=new e;return r._shorterDimensionAndAspectRatio=new p(t,i),r}static fromJSON(t){if(t.width&&t.height)return this.sizeWithWidthAndHeight(new l(n.fromJSON(t.width),n.fromJSON(t.height)));if(t.width&&typeof t.aspect=="number")return this.sizeWithWidthAndAspectRatio(n.fromJSON(t.width),t.aspect);if(t.height&&typeof t.aspect=="number")return this.sizeWithHeightAndAspectRatio(n.fromJSON(t.height),t.aspect);if(t.shorterDimension&&typeof t.aspect=="number")return this.sizeWithShorterDimensionAndAspectRatio(n.fromJSON(t.shorterDimension),t.aspect);throw new Error(`SizeWithUnitAndAspectJSON is malformed: ${JSON.stringify(t)}`)}toJSONObject(){var t,i,r,o,s,c,h,m;switch(this.sizingMode){case"widthAndAspectRatio":return {width:(t=this.widthAndAspectRatio)==null?void 0:t.size.toJSONObject(),aspect:(i=this.widthAndAspectRatio)==null?void 0:i.aspect};case"heightAndAspectRatio":return {height:(r=this.heightAndAspectRatio)==null?void 0:r.size.toJSONObject(),aspect:(o=this.heightAndAspectRatio)==null?void 0:o.aspect};case"shorterDimensionAndAspectRatio":return {shorterDimension:(s=this.shorterDimensionAndAspectRatio)==null?void 0:s.size.toJSONObject(),aspect:(c=this.shorterDimensionAndAspectRatio)==null?void 0:c.aspect};default:return {width:(h=this.widthAndHeight)==null?void 0:h.width.toJSONObject(),height:(m=this.widthAndHeight)==null?void 0:m.height.toJSONObject()}}}},J=class e{constructor(t,i,r,o){this._left=t,this._top=i,this._right=r,this._bottom=o;}static get zero(){return new e(new n(0,"pixel"),new n(0,"pixel"),new n(0,"pixel"),new n(0,"pixel"))}get left(){return this._left}get right(){return this._right}get top(){return this._top}get bottom(){return this._bottom}static fromJSON(t){return new e(n.fromJSON(t.left),n.fromJSON(t.top),n.fromJSON(t.right),n.fromJSON(t.bottom))}toJSONObject(){return {left:this.left.toJSONObject(),right:this.right.toJSONObject(),top:this.top.toJSONObject(),bottom:this.bottom.toJSONObject()}}},A=class e{constructor(t){this.hexadecimalString=t;}get redComponent(){return this.hexadecimalString.slice(0,2)}get greenComponent(){return this.hexadecimalString.slice(2,4)}get blueComponent(){return this.hexadecimalString.slice(4,6)}get alphaComponent(){return this.hexadecimalString.slice(6,8)}get red(){return e.hexToNumber(this.redComponent)}get green(){return e.hexToNumber(this.greenComponent)}get blue(){return e.hexToNumber(this.blueComponent)}get alpha(){return e.hexToNumber(this.alphaComponent)}static fromHex(t){return new e(e.normalizeHex(t))}static fromRGBA(t,i,r,o=1){let s=[t,i,r,this.normalizeAlpha(o)].reduce((c,h)=>c+this.numberToHex(h),"");return new e(s)}static areEquals(t,i){return t==null||i==null?!1:t.hexadecimalString===i.hexadecimalString}static hexToNumber(t){return Number.parseInt(t,16)}static fromJSON(t){return e.fromHex(t)}static numberToHex(t){let r=Math.round(t).toString(16);return r.length===1&&(r=`0${r}`),r.toUpperCase()}static normalizeHex(t){let i=t;return i.startsWith("#")&&(i=i.slice(1)),i.length<6&&(i=[...i].map(r=>r+r).join("")),i.length===6&&(i+="FF"),i.toUpperCase()}static normalizeAlpha(t){return t>0&&t<=1?255*t:t}withAlpha(t){let i=this.hexadecimalString.slice(0,6)+e.numberToHex(e.normalizeAlpha(t));return e.fromHex(i)}toJSON(){return this.hexadecimalString}},U=(s=>(s.Unknown="unknown",s.Portrait="portrait",s.PortraitUpsideDown="portraitUpsideDown",s.LandscapeRight="landscapeRight",s.LandscapeLeft="landscapeLeft",s))(U||{}),z=(h=>(h.None="none",h.Horizontal="horizontal",h.LeftToRight="leftToRight",h.RightToLeft="rightToLeft",h.Vertical="vertical",h.TopToBottom="topToBottom",h.BottomToTop="bottomToTop",h))(z||{}),x=(u=>(u.TopLeft="topLeft",u.TopCenter="topCenter",u.TopRight="topRight",u.CenterLeft="centerLeft",u.Center="center",u.CenterRight="centerRight",u.BottomLeft="bottomLeft",u.BottomCenter="bottomCenter",u.BottomRight="bottomRight",u))(x||{});
|
|
2
|
+
|
|
3
|
+
export { a, b, W as c, n as d, S as e, g as f, N as g, l as h, d as i, p as j, f as k, O as l, J as m, A as n, U as o, z as p, x as q };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { b, a } from './chunk-N4NOODAT.js';
|
|
2
|
+
|
|
3
|
+
var m=class h extends b{constructor(e,o,n,r,i,c,s,P,p){super(e,o,n,r),this._centerLeft=i,this._topCenter=c,this._centerRight=s,this._bottomCenter=P,this._center=p;}get centerRight(){return this._centerRight}get center(){return this._center}get centerLeft(){return this._centerLeft}get topCenter(){return this._topCenter}get bottomCenter(){return this._bottomCenter}static fromJSON(e){let{topLeft:o,topRight:n,bottomRight:r,bottomLeft:i,centerLeft:c,topCenter:s,centerRight:P,bottomCenter:p,center:S}=e,b=a.fromJSON(o),a$1=a.fromJSON(n),J=a.fromJSON(r),N=a.fromJSON(i),f=a.fromJSON(c),l=a.fromJSON(s),u=a.fromJSON(P),C=a.fromJSON(p),_=a.fromJSON(S);return new h(b,a$1,J,N,f,l,u,C,_)}toJSONObject(){return {...super.toJSONObject(),center:this._center.toJSONObject(),bottomCenter:this._bottomCenter.toJSONObject(),topCenter:this._topCenter.toJSONObject(),centerLeft:this._centerLeft.toJSONObject(),centerRight:this._centerRight.toJSONObject()}}};
|
|
4
|
+
|
|
5
|
+
export { m as a };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { a } from './chunk-JKL2W65E.js';
|
|
2
|
+
|
|
3
|
+
var S={CONTAINER_CLASS_NAME:a.CONTAINER_CLASS_NAME,PAINTBOARD_CLASS_NAME:a.PAINTBOARD_CLASS_NAME,PAINTBOARD_CLASS_NAME_STATE_ON:a.PAINTBOARD_CLASS_NAME_STATE_ON,CONTROLS_CLASS_NAME:a.CONTROLS_CLASS_NAME,CONTROL_WIDGET_CLASS_NAME:a.CONTROL_WIDGET_CLASS_NAME,MIRRORED_CLASS_NAME:a.MIRRORED_CLASS_NAME,CAMERA_RECOVERY_CLASS_NAME:a.CAMERA_RECOVERY_CLASS_NAME,ERROR_CLASS_NAME:a.ERROR_CLASS_NAME,HINT_CONTAINER_CLASS_NAME:a.HINT_CONTAINER_CLASS_NAME,HINT_CLASS_NAME:a.HINT_CLASS_NAME,PAINTBOARDS_CONTAINER_CLASS_NAME:a.PAINTBOARDS_CONTAINER_CLASS_NAME,SINGLE_IMAGE_UPLOADER_CONTAINER_CLASS_NAME:a.SINGLE_IMAGE_UPLOADER_CONTAINER_CLASS_NAME,CANVAS_VIDEO_PREVIEW_CLASS_NAME:a.CANVAS_VIDEO_PREVIEW_CLASS_NAME,TORCH_SWITCH_CONTROL_CLASS_NAME:a.TORCH_SWITCH_CONTROL_CLASS_NAME,CAMERA_SWITCH_CONTROL_CLASS_NAME:a.CAMERA_SWITCH_CONTROL_CLASS_NAME,CAMERA_FOV_SWITCH_CONTROL_CLASS_NAME:a.CAMERA_FOV_SWITCH_CONTROL_CLASS_NAME,SHUTTER_BUTTON_CONTROL_CLASS_NAME:a.SHUTTER_BUTTON_CONTROL_CLASS_NAME,FROZEN_FRAME:a.FROZEN_FRAME};
|
|
4
|
+
|
|
5
|
+
export { S as a };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { a as a$1 } from './chunk-R6E4CT22.js';
|
|
2
|
+
import { a as a$4 } from './chunk-IZLMNXTH.js';
|
|
3
|
+
import { b } from './chunk-DEQ72K2Q.js';
|
|
4
|
+
import { a } from './chunk-JKL2W65E.js';
|
|
5
|
+
import { d } from './chunk-BKSPXD6N.js';
|
|
6
|
+
import { a as a$3 } from './chunk-SP3HSP4K.js';
|
|
7
|
+
import { a as a$5 } from './chunk-QCZSSQAQ.js';
|
|
8
|
+
import { a as a$2 } from './chunk-4FJRDG6T.js';
|
|
9
|
+
|
|
10
|
+
var w=(r=>(r.CONTINUOUS="continuous",r.MANUAL="manual",r.NONE="none",r.SINGLE_SHOT="single-shot",r))(w||{}),y=(s=>(s[s.ULTRA_HD=0]="ULTRA_HD",s[s.FULL_HD=1]="FULL_HD",s[s.HD=2]="HD",s[s.SD=3]="SD",s[s.NONE=4]="NONE",s))(y||{}),L=(t=>(t.CAMERA_PROPERTIES="cameraProperties",t.CAMERA_ACCESS_ERROR="cameraAccessError",t))(L||{}),n=class n{constructor(){this.checkCameraVideoStreamAccessIfVisibleListener=this.checkCameraVideoStreamAccessIfVisible.bind(this);this.handleWebGLContextLostListener=this.handleWebGLContextLost.bind(this);this.listeners=new Map;this.mirrorImageOverrides=new Map;this.postStreamInitializationListener=this.postStreamInitialization.bind(this);this.triggerManualFocusListener=this.triggerManualFocus.bind(this);this.triggerZoomMoveListener=this.triggerZoomMove.bind(this);this.triggerZoomStartListener=this.triggerZoomStart.bind(this);this.videoResizeListener=a$1(this.handleVideoResize.bind(this),500);this.videoTrackEndedListener=this.videoTrackEndedRecovery.bind(this);this.videoTrackMuteListener=this.videoTrackMuteRecovery.bind(this);this._glFrameReaders={GRAYSCALE:null,RGBA:null,current:null};this._frameReaderType="RGBA";this.cameraPosition="worldFacing",this.gui={isCameraRecoveryVisible:()=>!1,setCameraRecoveryVisible:()=>{}},this.isWebGLSupported=!a$2.checkBrowserCompatibility().missingFeatures.includes("webGL"),this.videoElement=document.createElement("video"),this.canvas=document.createElement("canvas"),this.canvas.addEventListener("webglcontextlost",this.handleWebGLContextLostListener);}get mediaStream(){return this._mediaStream}set mediaStream(e){this._mediaStream=e,e&&(this.mediaTrackCapabilitiesPromise=new Promise(t=>{this.mediaTrackCapabilitiesPromiseResolver=t;}));}get canvas2dContext(){return this._canvas2dContext||(this._canvas2dContext=this.canvas.getContext("2d",{willReadFrequently:!0}),this._canvas2dContext==null&&a$3.log(a$3.Level.Warn,"Unable to get 2d canvas context"),this.handleVideoResize()),this._canvas2dContext}get canvasWebGLContext(){var e;if(!this._canvas2dContext&&!this._canvasWebGLContext){if(!this.isWebGLSupported){a$3.log(a$3.Level.Warn,"WebGL context not supported, falling back to 2d canvas context. This may impact the scanning performance.");return}let t=(e=this.canvas.getContext("webgl",{alpha:!1,antialias:!1}))!=null?e:this.canvas.getContext("experimental-webgl",{alpha:!1,antialias:!1});if(t!=null){this._canvasWebGLContext=t;let i=a$2.isDesktopDevice()?{maxPoolCapacity:2,minPoolCapacity:1}:{maxPoolCapacity:10,minPoolCapacity:3};this._glFrameReaders.GRAYSCALE=new a$4(t,i),this._glFrameReaders.RGBA=new b(t,i),this._glFrameReaders.current=this._glFrameReaders[this._frameReaderType],a$3.log(a$3.Level.Debug,`Frame will be sent in ${this._frameReaderType} mode`),this.handleVideoResize();}}return this._canvasWebGLContext}static instance(){return n._instance==null&&(n._instance=new n),n._instance}recycle(e){var t;(t=this._glFrameReaders.current)==null||t.recycle(e);}getCurrentFrame(){var e;return (e=this._glFrameReaders.RGBA)==null?void 0:e.readFromSource(this.videoElement)}requestVideoFrame(e){return "requestVideoFrameCallback"in HTMLVideoElement.prototype?this.videoElement.requestVideoFrameCallback(e):requestAnimationFrame(e)}cancelVideoFrame(e){if("cancelVideoFrameCallback"in HTMLVideoElement.prototype){this.videoElement.cancelVideoFrameCallback(e);return}cancelAnimationFrame(e);}addListener(e,t){var r;let i=(r=this.listeners.get(e))!=null?r:[];i.includes(t)||this.listeners.set(e,[...i,t]);}async applyCameraSettings(e){if(this.selectedCameraSettings=e,this.activeCamera==null)throw new a$5(n.noCameraErrorParameters);return this.initializeCameraWithSettings(this.activeCamera,e)}captureImage(){var e;if(((e=this.mediaStream)==null?void 0:e.active)!=null){if(this.canvasWebGLContext!=null)return this.captureImageForWebGLContext();if(this.canvas2dContext!=null)return this.captureImageFor2dContext()}return null}async initializeCameraWithSettings(e,t){if(this.cameraInitializationPromise&&await this.cameraInitializationPromise,e==null)throw new a$5(n.noCameraErrorParameters);return this.setSelectedCamera(e),this.selectedCameraSettings=t,this.activeCameraSettings=t,this.cameraInitializationPromise=this.initializeCameraAndCheckUpdatedSettings(e),this.cameraInitializationPromise}isMirrorImageEnabled(){if(this.selectedCamera&&this.activeCamera){let e=this.mirrorImageOverrides.get(this.activeCamera);return e!=null?e:this.activeCamera.position==="userFacing"}return !1}isPinchToZoomEnabled(){return this.pinchToZoomEnabled}isTapToFocusEnabled(){return this.tapToFocusEnabled}async isTorchAvailable(){var e;return this.mediaStream?(await this.waitForCapabilities(),((e=this.mediaTrackCapabilities)==null?void 0:e.torch)===!0):!1}async playVideo(){return new Promise(e=>{this._canvas2dContext&&this._canvas2dContext.clearRect(0,0,this.canvas.width,this.canvas.height);let t=this.videoElement.play();t==null?e():t.then(e).catch(()=>{e();});})}async reinitializeCamera(){if(this.activeCamera==null)a$3.log(a$3.Level.Debug,"Camera reinitialization delayed");else {a$3.log(a$3.Level.Debug,"Reinitialize camera:",this.activeCamera);try{let e=this.activeCamera;await this.stopStream(),await this.initializeCameraWithSettings(e,this.activeCameraSettings);}catch(e){throw a$3.log(a$3.Level.Warn,"Couldn't access camera:",this.activeCamera,e),this.emit("cameraAccessError",e),e}}}removeListener(e,t){var s;let r=((s=this.listeners.get(e))!=null?s:[]).filter(o=>o!==t);this.listeners.set(e,r);}async setCameraPosition(e){var i;this.setInitialCameraPosition(e);let t=d.getMainCameraForPosition(await d.getCameras(),e);if(t&&t.deviceId!==((i=this.selectedCamera)==null?void 0:i.deviceId))return this.initializeCameraWithSettings(t,this.selectedCameraSettings)}async setExposure(e){var r,s,o,m,d,l,v,p;let t=(s=(r=this.mediaStream)==null?void 0:r.getVideoTracks())!=null?s:[];if(t.length===0||typeof t[0].applyConstraints!="function")return;await this.waitForCapabilities();let i=e.time!=null&&e.time>0?"manual":"continuous";if(((m=(o=this.mediaTrackCapabilities)==null?void 0:o.exposureMode)==null?void 0:m.includes(i))===!0){if(await t[0].applyConstraints({advanced:[{exposureMode:i}]}),e.time!=null&&e.time>0&&this.mediaTrackCapabilities.exposureTime){let h=Math.max((d=this.mediaTrackCapabilities.exposureTime.min)!=null?d:.01,Math.min(e.time,(l=this.mediaTrackCapabilities.exposureTime.max)!=null?l:1e5));await t[0].applyConstraints({advanced:[{exposureTime:h}]});}else if(e.compensation!=null&&i==="continuous"&&this.mediaTrackCapabilities.exposureCompensation){let h=Math.max((v=this.mediaTrackCapabilities.exposureCompensation.min)!=null?v:-10,Math.min(e.compensation,(p=this.mediaTrackCapabilities.exposureCompensation.max)!=null?p:10));await t[0].applyConstraints({advanced:[{exposureCompensation:h}]});}}}async setFocus(e){var i,r,s,o,m;if(!this.mediaStream)return;let t=this.mediaStream.getVideoTracks();if(t.length>0&&typeof t[0].applyConstraints=="function"){await this.waitForCapabilities();let d=e>=0?"manual":"continuous";if(((r=(i=this.mediaTrackCapabilities)==null?void 0:i.focusMode)==null?void 0:r.includes(d))===!0&&(await t[0].applyConstraints({advanced:[{focusMode:d}]}),d==="manual"&&this.mediaTrackCapabilities.focusDistance)){let l=Math.max(0,Math.min(e,1))*(((s=this.mediaTrackCapabilities.focusDistance.max)!=null?s:1e3)-((o=this.mediaTrackCapabilities.focusDistance.min)!=null?o:.01))+((m=this.mediaTrackCapabilities.focusDistance.min)!=null?m:.01);await t[0].applyConstraints({advanced:[{focusDistance:l}]});}}}async setFrameRate(e){var t,i,r;if(this.mediaStream&&(await this.waitForCapabilities(),(t=this.mediaTrackCapabilities)!=null&&t.frameRate)){let s=this.mediaStream.getVideoTracks();if(s.length>0&&typeof s[0].applyConstraints=="function"){let o=Math.min((i=this.mediaTrackCapabilities.frameRate.max)!=null?i:240,(r=e.max)!=null?r:240);await s[0].applyConstraints({advanced:[{frameRate:o}]});}}}setInitialCameraPosition(e){this.cameraPosition=e;}setInteractionOptions(e,t,i){this.torchToggleEnabled=e,this.tapToFocusEnabled=t,this.pinchToZoomEnabled=i;}setMirrorImageEnabled(e,t){this.selectedCamera&&(e?(this.videoElement.classList.add(n.MIRRORED_CLASS_NAME),this.canvas.classList.add(n.MIRRORED_CLASS_NAME)):(this.videoElement.classList.remove(n.MIRRORED_CLASS_NAME),this.canvas.classList.remove(n.MIRRORED_CLASS_NAME)),t&&this.mirrorImageOverrides.set(this.selectedCamera,e));}setPinchToZoomEnabled(e){this.pinchToZoomEnabled=e,this.mediaStream&&(this.pinchToZoomEnabled?this.enablePinchToZoomListeners():this.disablePinchToZoomListeners());}setSelectedCamera(e){this.selectedCamera=e;}setSelectedCameraSettings(e){this.selectedCameraSettings=e;}setTapToFocusEnabled(e){this.tapToFocusEnabled=e,this.mediaStream&&(this.tapToFocusEnabled?this.enableTapToFocusListeners():this.disableTapToFocusListeners());}async setTorchEnabled(e){var t;if(this.mediaStream&&((t=this.mediaTrackCapabilities)==null?void 0:t.torch)===!0){this.torchEnabled=e;let i=this.mediaStream.getVideoTracks();i.length>0&&typeof i[0].applyConstraints=="function"&&await i[0].applyConstraints({advanced:[{torch:e}]});}}async setZoom(e){var t,i,r;if(this.mediaStream&&(await this.waitForCapabilities(),(t=this.mediaTrackCapabilities)!=null&&t.zoom)){let s=this.mediaStream.getVideoTracks();if(s.length>0&&typeof s[0].applyConstraints=="function"){let o=Math.max((i=this.mediaTrackCapabilities.zoom.min)!=null?i:1,Math.min(e,(r=this.mediaTrackCapabilities.zoom.max)!=null?r:16));await s[0].applyConstraints({advanced:[{zoom:o}]});}}}async setupCameras(){return this.cameraSetupPromise?this.cameraSetupPromise:(this.cameraSetupPromise=this.setupCamerasAndStream(),this.cameraSetupPromise)}pauseStream(){if(!this.mediaStream)return;let e=this.mediaStream.getVideoTracks()[0];e.enabled=!1,a$3.log(a$3.Level.Debug,"Pause camera video stream",this.mediaStream);}resumeStream(){if(!this.mediaStream)return;let e=this.mediaStream.getVideoTracks()[0];e.enabled=!0,a$3.log(a$3.Level.Debug,"Resume camera video stream",this.mediaStream);}async stopStream(e=!1){this.activeCamera&&(this.activeCamera.currentResolution=void 0),this.activeCamera=void 0,this.torchEnabled=!1,this.mediaStream&&(a$3.log(a$3.Level.Debug,`Stop camera video stream access${e?" (abort access detection)":""}:`,this.mediaStream),document.removeEventListener("visibilitychange",this.checkCameraVideoStreamAccessIfVisibleListener),window.clearTimeout(this.cameraAccessTimeout),window.clearInterval(this.videoMetadataCheckInterval),window.clearTimeout(this.getCapabilitiesTimeout),window.clearTimeout(this.manualFocusWaitTimeout),window.clearTimeout(this.manualToAutofocusResumeTimeout),window.clearInterval(this.autofocusInterval),this.videoElement.pause(),await new Promise(t=>{setTimeout(()=>{var i,r,s;for(let o of (r=(i=this.mediaStream)==null?void 0:i.getVideoTracks())!=null?r:[])o.removeEventListener("ended",this.videoTrackEndedListener),o.stop();this.videoElement.srcObject=null,this._canvas2dContext&&this._canvas2dContext.clearRect(0,0,this.canvas.width,this.canvas.height),this.mediaStream=void 0,this.mediaTrackCapabilities=void 0,this.mediaTrackCapabilitiesPromise=void 0,this.mediaTrackCapabilitiesPromiseResolver=void 0,e||(s=this.abortedCameraInitializationResolveCallback)==null||s.call(this),t();},0);}));}stopVideoTracks(){if(this.mediaStream!=null)for(let e of this.mediaStream.getVideoTracks())e.stop();}async toggleTorch(){this.torchEnabled=!this.torchEnabled,await this.setTorchEnabled(this.torchEnabled);}updateCanvasVideoImage(){this.canvas2dContext.drawImage(this.videoElement,0,0);}async waitForCapabilities(){var e;return (e=this.mediaTrackCapabilitiesPromise)!=null?e:Promise.resolve()}setFrameReaderType(e){this._frameReaderType=e,this._glFrameReaders.current=this._glFrameReaders[e],a$3.log(a$3.Level.Debug,`Change frame reader type. Frames will be sent in ${this._frameReaderType} mode`);}async allowPictureInPicture(e){e?(this.videoElement.disablePictureInPicture=!1,this.videoElement.removeAttribute("controlslist"),this.videoElement.removeAttribute("disablepictureinpicture")):(this.videoElement.disablePictureInPicture=!0,this.videoElement.setAttribute("controlslist","nodownload"),this.videoElement.setAttribute("disablepictureinpicture","true")),await this.reinitializeCamera();}async accessAutoselectedCamera(e){let t=d.sortCamerasForCameraPosition(e,this.cameraPosition),i=t.shift();for(;i;)try{await this.initializeCameraWithSettings(i,this.selectedCameraSettings);return}catch(r){if(this.setSelectedCamera(),t.length>0){a$3.log(a$3.Level.Warn,"Couldn't access camera:",i,r),i=t.shift();continue}throw r}throw new a$5(n.noCameraErrorParameters)}async accessInitialCamera(){let e={position:this.cameraPosition,deviceId:"",label:""};try{await this.initializeCameraWithSettings(e,this.selectedCameraSettings);}catch(t){}finally{this.setSelectedCamera();}return e}recreateCanvas(){this.canvas.removeEventListener("webglcontextlost",this.handleWebGLContextLostListener),this._canvasWebGLContext=void 0,this._canvas2dContext=void 0;for(let t of Object.values(this._glFrameReaders))t==null||t.dispose();let e=document.createElement("canvas");e.addEventListener("webglcontextlost",this.handleWebGLContextLostListener),e.width=this.canvas.width,e.height=this.canvas.height,e.className=this.canvas.className,this.canvas=e;}captureImageFor2dContext(){if(!this.isVideoAndContextStateValid())return null;let{width:e,height:t}=this.canvas;return {colorType:"RGBA",data:this.canvas2dContext.getImageData(0,0,e,t).data,width:e,height:t}}areVideoAndWebGLSizeMismatching(){return this.canvasWebGLContext?this.canvasWebGLContext.drawingBufferWidth!==this.videoElement.videoWidth||this.canvasWebGLContext.drawingBufferHeight!==this.videoElement.videoHeight:!0}captureImageForWebGLContext(){if(!this.isVideoAndContextStateValid()||!this.canvasWebGLContext||this.canvasWebGLContext.drawingBufferWidth<=2||this.canvasWebGLContext.drawingBufferHeight<=2||this.areVideoAndWebGLSizeMismatching()||this._glFrameReaders.current==null)return null;let e=this._glFrameReaders.current.readFromSource(this.videoElement);if(e.data[3]!==255&&e.colorType==="RGBA"){if(a$3.log(a$3.Level.Warn,"Detected incorrect GPU accelerated WebGL image processing, switching to canvas mode"),this.recreateCanvas(),this.canvas2dContext==null)throw new Error("Unable to get 2d canvas context");return this.captureImage()}return e}async checkCameraAccess(e){return new Promise((t,i)=>{this.cameraAccessRejectCallback=r=>{a$3.log(a$3.Level.Debug,"Camera video stream access failure (video data load timeout):",e),this.gui.setCameraRecoveryVisible(!0),i(r);},this.setCameraAccessTimeout();})}checkCameraVideoStreamAccessIfVisible(){document.visibilityState==="visible"&&(a$3.log(a$3.Level.Debug,"Page is visible again, waiting for camera video stream start..."),document.removeEventListener("visibilitychange",this.checkCameraVideoStreamAccessIfVisibleListener),this.setCameraAccessTimeout());}async checkVideoMetadata(e){return new Promise((t,i)=>{this.videoElement.onloadeddata=()=>{if(this.videoElement.onloadeddata=null,window.clearTimeout(this.cameraAccessTimeout),this.videoElement.videoWidth>2&&this.videoElement.videoHeight>2&&this.videoElement.currentTime>0){this.updateActiveCameraCurrentResolution(e),a$3.log(a$3.Level.Debug,"Camera video stream access success:",e),t();return}let r=performance.now();window.clearInterval(this.videoMetadataCheckInterval),this.videoMetadataCheckInterval=window.setInterval(async()=>{if(this.videoElement.videoWidth<=2||this.videoElement.videoHeight<=2||this.videoElement.currentTime===0){if(performance.now()-r>n.videoMetadataCheckTimeoutMs){a$3.log(a$3.Level.Warn,"Camera video stream access failure (valid video metadata timeout):",e),window.clearInterval(this.videoMetadataCheckInterval),await this.stopStream(!0),i(new a$5(n.notReadableErrorParameters));return}return}window.clearInterval(this.videoMetadataCheckInterval),this.updateActiveCameraCurrentResolution(e),a$3.log(a$3.Level.Debug,"Camera video stream access success:",e),t();},n.videoMetadataCheckIntervalMs);};})}disablePinchToZoomListeners(){this.videoElement.removeEventListener("touchstart",this.triggerZoomStartListener),this.videoElement.removeEventListener("touchmove",this.triggerZoomMoveListener);}disableTapToFocusListeners(){for(let e of ["touchend","mousedown"])this.videoElement.removeEventListener(e,this.triggerManualFocusListener);}emit(e,t){var r;let i=(r=this.listeners.get(e))!=null?r:[];for(let s of i)s(t);}enablePinchToZoomListeners(){this.videoElement.addEventListener("touchstart",this.triggerZoomStartListener),this.videoElement.addEventListener("touchmove",this.triggerZoomMoveListener);}enableTapToFocusListeners(){for(let e of ["touchend","mousedown"])this.videoElement.addEventListener(e,this.triggerManualFocusListener);}getActiveCamera(e,t,i){return e.length===1?e[0]:e.find(r=>r.deviceId===i||r.label!==""&&r.label===t)}getInitialCameraResolutionConstraint(e){var i;let t;switch((i=this.activeCameraSettings)==null?void 0:i.preferredResolution){case"uhd4k":{t=0;break}case"fullHd":{t=1;break}case"hd":default:{t=2;break}}return t}async handleCameraInitializationError(e,t,i){if(!["OverconstrainedError","NotReadableError"].includes(i.name)||i.name==="NotReadableError"&&t===4)throw a$3.log(a$3.Level.Debug,"Camera video stream access failure (unrecoverable error)",e,i),i.name!=="NotAllowedError"&&d.markCameraAsInaccessible(e),i;if(i.name==="OverconstrainedError"&&t===4){if(e.deviceId==="")throw a$3.log(a$3.Level.Warn,"Camera video stream access failure (no camera with such type error)",e,i),i;a$3.log(a$3.Level.Warn,"Detected non-existent deviceId error, attempt to find and reaccess updated camera",e,i);let r=e.deviceId;if(await d.getCameras(!0),r===e.deviceId)throw a$3.log(a$3.Level.Warn,"Camera video stream access failure (updated camera not found after non-existent deviceId error)",e,i),d.markCameraAsInaccessible(e),i;return a$3.log(a$3.Level.Warn,"Updated camera found (recovered from non-existent deviceId error), attempt to access it",e),this.initializeCameraForResolution(e)}return this.initializeCameraForResolution(e,t+1)}handleVideoResize(){if(!(this.videoElement.videoWidth<=2||this.videoElement.videoHeight<=2)){if(this.activeCamera&&this.updateActiveCameraCurrentResolution(this.activeCamera),this.canvasWebGLContext!=null){if(this.canvas.width===this.videoElement.videoWidth&&this.canvas.height===this.videoElement.videoHeight)return;this.canvas.width=this.videoElement.videoWidth,this.canvas.height=this.videoElement.videoHeight,this.canvasWebGLContext.viewport(0,0,this.canvasWebGLContext.drawingBufferWidth,this.canvasWebGLContext.drawingBufferHeight);}else if(this.canvas2dContext!=null){if(this.canvas.width===this.videoElement.videoWidth&&this.canvas.height===this.videoElement.videoHeight)return;this.canvas.width=this.videoElement.videoWidth,this.canvas.height=this.videoElement.videoHeight;}}}handleWebGLContextLost(){a$3.log(a$3.Level.Warn,"WebGL context has been lost, restoring..."),this._canvasWebGLContext=void 0,this.canvasWebGLContext?(this.handleVideoResize(),a$3.log(a$3.Level.Warn,"WebGL context restored")):a$3.log(a$3.Level.Error,"WebGL context restore failed");}async initializeCameraAndCheckUpdatedSettings(e){var t,i,r,s,o;try{if(await this.initializeCameraForResolution(e),this.selectedCameraSettings!==this.activeCameraSettings&&(this.selectedCameraSettings==null||this.activeCameraSettings==null||Object.keys(this.selectedCameraSettings).some(h=>{var g,b;return ((g=this.selectedCameraSettings)==null?void 0:g[h])!==((b=this.activeCameraSettings)==null?void 0:b[h])}))){this.activeCameraSettings=this.selectedCameraSettings,await this.initializeCameraAndCheckUpdatedSettings(e);return}this.activeCameraSettings&&this.activeCameraSettings.zoomFactor>1&&await this.setZoom(this.activeCameraSettings.zoomFactor);let m=(t=this.activeCameraSettings)==null?void 0:t.getProperty("minFrameRate"),d=(i=this.activeCameraSettings)==null?void 0:i.getProperty("maxFrameRate");(m!=null||d!=null)&&await this.setFrameRate({min:m,max:d});let l=(r=this.activeCameraSettings)==null?void 0:r.getProperty("manualLensPosition");l!=null&&await this.setFocus(l);let v=(s=this.activeCameraSettings)==null?void 0:s.getProperty("exposureTargetBias"),p=(o=this.activeCameraSettings)==null?void 0:o.getProperty("exposureDuration");(v!=null||p!=null)&&await this.setExposure({compensation:v,time:p});}finally{this.cameraInitializationPromise=void 0;}}async initializeCameraForResolution(e,t){var r;this.gui.setCameraRecoveryVisible(!1);let i=t!=null?t:this.getInitialCameraResolutionConstraint(e);this.mediaStream!=null&&e.deviceId!==""&&((r=this.activeCamera)==null?void 0:r.deviceId)===e.deviceId?await(a$2.isIPhone()?this.initializeStreamForResolution(e,i):this.updateStreamForResolution(e,i)):await this.initializeStreamForResolution(e,i);}async initializeStreamForResolution(e,t){var i;await this.stopStream();try{let r=(i=this.activeCameraSettings)==null?void 0:i.getProperty("preferredAspectRatio"),s=await d.accessCameraStream(e,t,r);if(a$3.log(a$3.Level.Debug,"Camera accessed, waiting for camera video stream start..."),typeof s.getVideoTracks()[0].getSettings=="function"){let o=s.getVideoTracks()[0].getSettings();if(o.width!=null&&o.height!=null&&(o.width===2||o.height===2)){if(a$3.log(a$3.Level.Debug,"Camera video stream access failure (invalid video metadata):",e),t===4)throw new a$5(n.notReadableErrorParameters);return await this.stopStream(),this.initializeStreamForResolution(e,t+1)}}this.mediaStream=s;for(let o of this.mediaStream.getVideoTracks())o.addEventListener("ended",this.videoTrackEndedListener),o.addEventListener("mute",this.videoTrackMuteListener),o.addEventListener("unmute",this.videoTrackMuteListener);try{await this.setupCameraStreamVideo(e,s);}catch(o){if(t===4)throw o;return this.initializeStreamForResolution(e,t+1)}}catch(r){return this.handleCameraInitializationError(e,t,r)}}isVideoAndContextStateValid(){return this.videoElement.readyState===4&&this.videoElement.videoWidth>2&&this.videoElement.videoHeight>2&&this.canvas.width>2&&this.canvas.height>2}postStreamInitialization(){window.clearTimeout(this.getCapabilitiesTimeout),this.getCapabilitiesTimeout=window.setTimeout(()=>{this.storeStreamCapabilities(),this.setupAutofocus();},n.getCapabilitiesTimeoutMs);}async recoverStreamIfNeeded(){var t,i;let e=(t=this.mediaStream)==null?void 0:t.getVideoTracks();((i=e==null?void 0:e[0])==null?void 0:i.readyState)==="ended"&&await this.reinitializeCamera();}reportCameraProperties(e,t,i=!0){this.emit("cameraProperties",{deviceId:e,isFrontFacing:t==="userFacing",hasAutofocus:i});}setCameraAccessTimeout(){window.clearTimeout(this.cameraAccessTimeout),this.cameraAccessTimeout=window.setTimeout(async()=>{var e;document.visibilityState==="visible"?(await this.stopStream(!0),(e=this.cameraAccessRejectCallback)==null||e.call(this,new a$5(n.notReadableErrorParameters))):(a$3.log(a$3.Level.Debug,"Page is currently not visible, delay camera video stream access detection"),document.addEventListener("visibilitychange",this.checkCameraVideoStreamAccessIfVisibleListener));},n.cameraAccessTimeoutMs);}setupAutofocus(){if(window.clearTimeout(this.manualFocusWaitTimeout),window.clearTimeout(this.manualToAutofocusResumeTimeout),this.mediaStream&&this.mediaTrackCapabilities){let e=this.mediaTrackCapabilities.focusMode;Array.isArray(e)&&!e.includes("continuous")&&e.includes("single-shot")&&(window.clearInterval(this.autofocusInterval),this.autofocusInterval=window.setInterval(this.triggerAutoFocus.bind(this),n.autofocusIntervalMs));}}async setupCameraStreamVideo(e,t){this.videoElement.addEventListener("loadedmetadata",this.postStreamInitializationListener),this.videoElement.addEventListener("resize",this.videoResizeListener),this.tapToFocusEnabled&&this.enableTapToFocusListeners(),this.pinchToZoomEnabled&&this.enablePinchToZoomListeners();let i=Promise.race([this.checkCameraAccess(e),this.checkVideoMetadata(e),new Promise(r=>{this.abortedCameraInitializationResolveCallback=r;})]);return this.videoElement.srcObject=t,this.videoElement.load(),await this.playVideo(),this.handleVideoResize(),this.reportCameraProperties(e.deviceId,e.position),i}async setupCamerasAndStream(){var e,t;try{let i;this.selectedCamera==null&&(i=await this.accessInitialCamera());let r=await d.getCameras(!1,!0),s=(t=(e=this.mediaStream)==null?void 0:e.getVideoTracks()[0])==null?void 0:t.getSettings().deviceId;if(this.mediaStream&&i){let o=this.getActiveCamera(r,i.label,s);if(o){if(d.adjustCameraFromMediaStream(this.mediaStream,o),a$2.isDesktopDevice()&&(d.setMainCameraForPositionOverridesOnDesktop(this.cameraPosition,o),d.setMainCameraForPositionOverridesOnDesktop(o.position,o)),r.length===1||d.getMainCameraForPosition(r,this.cameraPosition)===o){a$3.log(a$3.Level.Debug,"Initial camera access was correct (main camera), keep camera:",o),this.setSelectedCamera(o),this.updateActiveCameraCurrentResolution(o),await this.recoverStreamIfNeeded();return}a$3.log(a$3.Level.Debug,"Initial camera access was incorrect (not main camera), change camera",{...i,deviceId:s});}else a$3.log(a$3.Level.Debug,"Initial camera access was incorrect (unknown camera), change camera",{...i,deviceId:s});}if(this.selectedCamera==null){await this.accessAutoselectedCamera(r);return}await this.initializeCameraWithSettings(this.selectedCamera,this.selectedCameraSettings);}finally{this.cameraSetupPromise=void 0;}}storeStreamCapabilities(){var e;if(this.mediaStream){let t=this.mediaStream.getVideoTracks();t.length>0&&typeof t[0].getCapabilities=="function"&&(this.mediaTrackCapabilities=t[0].getCapabilities()),this.mediaTrackCapabilitiesPromiseResolver&&this.mediaTrackCapabilitiesPromiseResolver();}this.activeCamera&&this.reportCameraProperties(this.activeCamera.deviceId,this.activeCamera.position,((e=this.mediaTrackCapabilities)==null?void 0:e.focusMode)==null||this.mediaTrackCapabilities.focusMode.includes("continuous"));}async triggerAutoFocus(){await this.triggerFocusMode("single-shot");}async triggerFocusMode(e){if(this.mediaStream){let t=this.mediaStream.getVideoTracks();if(t.length>0&&typeof t[0].applyConstraints=="function")try{await t[0].applyConstraints({advanced:[{focusMode:e}]});}catch(i){}}}async triggerManualFocus(e){if(e){if(e.preventDefault(),e.type==="touchend"&&e.touches.length>0)return;if(this.pinchToZoomDistance!=null){this.pinchToZoomDistance=void 0;return}}if(window.clearTimeout(this.manualFocusWaitTimeout),window.clearTimeout(this.manualToAutofocusResumeTimeout),!this.mediaStream||!this.mediaTrackCapabilities)return;let t=this.mediaTrackCapabilities.focusMode;Array.isArray(t)&&t.includes("single-shot")&&(t.includes("continuous")&&t.includes("manual")?await this.triggerManualFocusForContinuous():t.includes("continuous")||await this.triggerManualFocusForSingleShot());}async triggerManualFocusForContinuous(){var i;if(!this.mediaStream)return;this.manualToAutofocusResumeTimeout=window.setTimeout(async()=>{await this.triggerFocusMode("continuous");},n.manualToAutofocusResumeTimeoutMs);let e=!0,t=this.mediaStream.getVideoTracks();t.length>0&&typeof t[0].getConstraints=="function"&&(e=((i=t[0].getConstraints().advanced)==null?void 0:i.some(r=>r.focusMode==="manual"))===!0),e?(await this.triggerFocusMode("continuous"),this.manualFocusWaitTimeout=window.setTimeout(async()=>{await this.triggerFocusMode("manual");},n.manualFocusWaitTimeoutMs)):await this.triggerFocusMode("manual");}async triggerManualFocusForSingleShot(){window.clearInterval(this.autofocusInterval),this.manualToAutofocusResumeTimeout=window.setTimeout(()=>{this.autofocusInterval=window.setInterval(this.triggerAutoFocus.bind(this),n.autofocusIntervalMs);},n.manualToAutofocusResumeTimeoutMs);try{await this.triggerFocusMode("single-shot");}catch(e){}}async triggerZoomMove(e){this.pinchToZoomDistance==null||(e==null?void 0:e.touches.length)!==2||e.preventDefault();}triggerZoomStart(e){var r,s,o,m;if((e==null?void 0:e.touches.length)!==2||(e.preventDefault(),this.pinchToZoomDistance=Math.hypot((e.touches[1].screenX-e.touches[0].screenX)/screen.width,(e.touches[1].screenY-e.touches[0].screenY)/screen.height),!this.mediaStream||!((r=this.mediaTrackCapabilities)!=null&&r.zoom)))return;let t=this.mediaStream.getVideoTracks();if(t.length===0||typeof t[0].getConstraints!="function")return;this.pinchToZoomInitialZoom=(s=this.mediaTrackCapabilities.zoom.min)!=null?s:1;let i=t[0].getConstraints();if(i.advanced){let d=(o=i.advanced.find(l=>"zoom"in l))==null?void 0:o.zoom;d!=null&&(this.pinchToZoomInitialZoom=typeof d=="number"?d:(m=d.ideal)!=null?m:1);}}updateActiveCameraCurrentResolution(e){this.videoElement.videoWidth>2&&this.videoElement.videoHeight>2&&(e.currentResolution={width:this.videoElement.videoWidth,height:this.videoElement.videoHeight}),e.deviceId!==""&&(this.activeCamera=e,this.setMirrorImageEnabled(this.isMirrorImageEnabled(),!1));}async updateStreamForResolution(e,t){var i;if(this.mediaStream==null)await this.initializeCameraForResolution(e,t);else try{let r=(i=this.activeCameraSettings)==null?void 0:i.getProperty("preferredAspectRatio");a$3.log(a$3.Level.Debug,"Setting new resolution for active camera video stream..."),await this.mediaStream.getVideoTracks()[0].applyConstraints(d.getUserMediaVideoParameters(t,r)),await new Promise(o=>{this.videoElement.addEventListener("timeupdate",()=>{o();},{once:!0});});let s=this.mediaStream.getVideoTracks()[0].getSettings();a$3.log(a$3.Level.Debug,"New active camera video stream resolution set",{width:s.width,height:s.height});}catch(r){if(t===4)throw r;await this.updateStreamForResolution(e,t+1);}}async videoTrackEndedRecovery(){if(document.visibilityState==="visible")try{a$3.log(a$3.Level.Debug,'Detected video track "ended" event, try to reinitialize camera'),await this.reinitializeCamera();}catch(e){}else a$3.log(a$3.Level.Debug,"Page is currently not visible, delay camera reinitialization until visible"),document.addEventListener("visibilitychange",this.checkCameraVideoStreamAccessIfVisibleListener);}videoTrackMuteRecovery(e){if(this.videoElement.onloadeddata!=null){a$3.log(a$3.Level.Debug,`Detected video track "${e.type}" event, delay camera video stream access detection`),this.setCameraAccessTimeout();return}let t=e.type==="mute";t!==this.gui.isCameraRecoveryVisible()&&(a$3.log(a$3.Level.Debug,`Detected video track "${e.type}" event, ${t?"enable":"disable"} camera recovery`),this.gui.setCameraRecoveryVisible(t));}};n.autofocusIntervalMs=1500,n.cameraAccessTimeoutMs=4e3,n.getCapabilitiesTimeoutMs=500,n.manualFocusWaitTimeoutMs=400,n.manualToAutofocusResumeTimeoutMs=5e3,n.noCameraErrorParameters={name:"NoCameraAvailableError",message:"No camera available"},n.notReadableErrorParameters={name:"NotReadableError",message:"Could not initialize camera correctly"},n.videoMetadataCheckIntervalMs=50,n.videoMetadataCheckTimeoutMs=4e3,n.MIRRORED_CLASS_NAME=a.MIRRORED_CLASS_NAME,n._instance=null;var M=n;
|
|
11
|
+
|
|
12
|
+
export { w as a, y as b, L as c, M as d };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { a as a$1 } from './chunk-GSJH2EXJ.js';
|
|
2
|
+
import { a } from './chunk-UA3E3GGM.js';
|
|
3
|
+
|
|
4
|
+
var o=class r{constructor(i,e){this._vibration=null;this._sound=null;this._vibration=i,this._sound=e;}static get defaultFeedback(){return new r(a.defaultVibration,a$1.defaultSound)}get vibration(){return this._vibration}get sound(){return this._sound}emit(){this.sound&&this.sound.play(),this.vibration&&this.vibration.vibrate();}toJSONObject(){let i={};return this.sound!==null&&(i.sound=this.sound.toJSONObject()),this.vibration!==null&&(i.vibration=this.vibration.toJSONObject()),i}};
|
|
5
|
+
|
|
6
|
+
export { o as a };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { a as a$1 } from './chunk-XVLYCDJL.js';
|
|
2
|
+
import { b as b$1, a } from './chunk-KYNYQBNF.js';
|
|
3
|
+
import { i, a as a$2 } from './chunk-N4NOODAT.js';
|
|
4
|
+
|
|
5
|
+
var b={bottomLeft:"bottomRight",bottomRight:"bottomLeft",topLeft:"topRight",topRight:"topLeft",centerLeft:"centerRight",centerRight:"centerLeft",center:"center",topCenter:"topCenter",bottomCenter:"bottomCenter"},s=class s{constructor(){this.listener=null;this._mounted=!1;this._mirrored=!1;this._cachedSize=new i(0,0);this.resizeObserver=null;this.mapViewAnchorPositionsForFramePoint=e=>e;}get size(){return this._cachedSize}setMirrored(e){this._mounted&&(this._mirrored=e);}mount(e){var o;if(this._mounted)return;if(!document.head.querySelector(`[data-component=${s.componentName}]`)){let t=document.createElement("style");t.dataset.component=s.componentName,t.append(document.createTextNode(b$1)),document.head.append(t);}let n=document.createElement("div");n.classList.add(a.CUSTOM_VIEW_CONTAINER),(o=e.parentNode)==null||o.replaceChild(n,e),this._htmlRoot=n,this.gestureRecognizer=new a$1(this._htmlRoot),this.gestureRecognizer.addListener({onTap:(t,r)=>{var l,i;let m=(l=r.target.dataset.identifier)!=null?l:"";m!==""&&((i=this.listener)==null||i.didTapView(Number.parseInt(m,10)));}}),this.resizeObserver=new ResizeObserver(([t])=>{this._cachedSize=new i(t.contentRect.width,t.contentRect.height);}),this.resizeObserver.observe(this._htmlRoot),this._cachedSize=new i(this._htmlRoot.clientWidth,this._htmlRoot.clientHeight),this._mounted=!0;}unmount(){var e,n,o,t;this._mounted&&(this.removeChildren(),(e=this.gestureRecognizer)==null||e.removeAllListeners(),(n=this.resizeObserver)==null||n.disconnect(),(o=this._htmlRoot)==null||o.remove(),this._htmlRoot=null,this.gestureRecognizer=null,(t=document.head.querySelector(`[data-component=${s.componentName}]`))==null||t.remove(),this.listener=null,this._mounted=!1);}render(e){var o,t,r,m,l;if(e.elements.length===0){this.removeChildren();return}for(let i of e.removedIds)(t=(o=this._htmlRoot)==null?void 0:o.querySelector(`#${s.elementSelectorPrefix}${i}`))==null||t.remove();let n=document.createDocumentFragment();for(let i of e.elements){let u=`${s.elementSelectorPrefix}${i.identifier}`,f=(r=this._htmlRoot)==null?void 0:r.querySelector(`#${u}`),a=f;if(f==null&&(a=new Image(i.view.options.size.width,i.view.options.size.height),a.id=u,a.dataset.identifier=String(i.identifier),n.append(a)),a){a.src=i.view.data;let d=this.mapViewAnchorPositionsForFramePoint(i.anchorPositions)[this._mirrored?b[i.anchor]:i.anchor];this._mirrored&&(d=a$2.mirrorX(d,this.size));let{x:S,y:w}=this.adjustCoordinatesWithOffset(d,{elementSize:i.view.options.size,offset:i.offset}),p=(m=i.view.options.scale)!=null?m:1;a.style.scale=`${p}`,a.style.transform=`translate3d(${S/p}px, ${w/p}px, 0px)`;}}(l=this._htmlRoot)==null||l.append(n);}removeChildren(){var e;for(;(e=this._htmlRoot)!=null&&e.firstChild;)this._htmlRoot.firstChild.remove();}adjustCoordinatesWithOffset(e,n){let o=e,{elementSize:t,offset:r}=n,m=e.x-t.width/2,l=e.y-t.height/2;return r.x.unit==="pixel"&&(o=new a$2(m+r.x.value,l+r.y.value)),r.x.unit==="fraction"&&(o=new a$2(m+t.width*r.x.value,l+t.height*r.y.value)),o}};s.componentName="CustomLocationsView",s.elementSelectorPrefix="scandit-view-";var R=s;
|
|
6
|
+
|
|
7
|
+
export { R as a };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var t=class t{constructor(i,e){this._running=!1;this.duration=i>t.maxDurationAllowedByJSEngines?t.maxDurationAllowedByJSEngines:i,this.callback=e;}get running(){return this._running}start(){this.stop(),this.timeout=setTimeout(()=>{this.callback(),this.stop();},this.duration),this._running=!0;}stop(){clearTimeout(this.timeout),this._running=!1;}};t.maxDurationAllowedByJSEngines=2147483647;var n=t;
|
|
2
|
+
|
|
3
|
+
export { n as a };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { b } from './chunk-FTD535WI.js';
|
|
2
|
+
|
|
3
|
+
var l=(e=>(e.Nonzero="nonzero",e.Evenodd="evenodd",e))(l||{}),c=class{constructor(){this.pathWinding="nonzero";}drawSingleCommand(t,e){switch(t){case 0:{this.addLine(e);break}case 1:{this.addArc(e);break}case 2:{this.addCircle(e);break}case 3:{this.addRectangle(e);break}case 4:{this.addRoundedRectangle(e);break}case 5:{this.beginPath(e);break}case 6:{this.closePath(e);break}case 7:{this.fill(e);break}case 8:{this.stroke(e);break}case 10:{this.setStrokeWidth(e);break}case 11:{this.setFillColor(e);break}case 12:{this.setStrokeColor(e);break}case 13:{this.moveTo(e);break}case 14:{this.lineTo(e);break}case 15:{this.saveState(e);break}case 16:{this.restoreState(e);break}case 17:{this.translate(e);break}case 19:{this.bezierTo(e);break}case 20:{this.transform(e);break}case 21:{this.scale(e);break}case 22:{this.addPathWinding(e);break}case 9:case 18:break;default:{b(t);break}}}beginPath(t){this.context.beginPath();}closePath(t){this.context.closePath();}setStrokeColor(t){let e=t.extractColor();this.context.strokeStyle=this.colorToRgbaString(e);}setFillColor(t){let e=t.extractColor();this.context.fillStyle=this.colorToRgbaString(e);}fill(t){this.context.fill(this.pathWinding);}stroke(t){this.context.stroke();}addLine(t){let e=t.extractFloat(),a=t.extractFloat();this.context.moveTo(e,a);let o=t.extractFloat(),r=t.extractFloat();this.context.lineTo(o,r);}lineTo(t){let e=t.extractFloat(),a=t.extractFloat();this.context.lineTo(e,a);}moveTo(t){let e=t.extractFloat(),a=t.extractFloat();this.context.moveTo(e,a);}addRectangle(t){let e=t.extractFloat(),a=t.extractFloat(),o=t.extractFloat(),r=t.extractFloat();this.context.rect(e,a,o,r);}addRoundedRectangle(t){let e=t.extractFloat(),a=t.extractFloat(),o=t.extractFloat(),r=t.extractFloat(),i=t.extractFloat();this.context.moveTo(e+i,a),this.context.lineTo(e+o-i,a),this.context.quadraticCurveTo(e+o,a,e+o,a+i),this.context.lineTo(e+o,a+r-i),this.context.quadraticCurveTo(e+o,a+r,e+o-i,a+r),this.context.lineTo(e+i,a+r),this.context.quadraticCurveTo(e,a+r,e,a+r-i),this.context.lineTo(e,a+i),this.context.quadraticCurveTo(e,a,e+i,a),this.context.closePath();}setStrokeWidth(t){this.context.lineWidth=t.extractFloat();}addArc(t){let e=t.extractFloat(),a=t.extractFloat(),o=t.extractFloat(),r=t.extractFloat(),i=t.extractFloat(),s=t.extractBoolean();this.context.arc(e,a,o,r,i,s);}addCircle(t){let e=t.extractFloat(),a=t.extractFloat(),o=t.extractFloat();this.context.arc(e,a,o,0,Math.PI*2);}bezierTo(t){let e=t.extractFloat(),a=t.extractFloat(),o=t.extractFloat(),r=t.extractFloat(),i=t.extractFloat(),s=t.extractFloat();this.context.bezierCurveTo(e,a,o,r,i,s);}saveState(t){this.context.save();}restoreState(t){this.context.restore();}translate(t){let e=t.extractFloat(),a=t.extractFloat();this.context.translate(e,a);}transform(t){let e=t.extractFloat(),a=t.extractFloat(),o=t.extractFloat(),r=t.extractFloat(),i=t.extractFloat(),s=t.extractFloat();this.context.transform(e,a,o,r,i,s);}scale(t){let e=t.extractFloat();this.context.scale(e,e);}addPathWinding(t){let e=t.extractBoolean();this.pathWinding=e?"nonzero":"evenodd";}colorToRgbaString(t){return `rgba(${t.r},${t.g},${t.b},${t.a})`}};
|
|
4
|
+
|
|
5
|
+
export { l as a, c as b };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { b } from './chunk-457L5N2F.js';
|
|
2
|
+
import { a } from './chunk-SP3HSP4K.js';
|
|
3
|
+
|
|
4
|
+
var d={processedFramesCount:{text:"Frames processed by engine",valueSuffix:"/sec"},frameDataPoolSize:{text:"Frame data pool size",valueSuffix:""},redrawRequestsCount:{text:"Engine redraw requests",valueSuffix:"/sec"},actualRedrawsCount:{text:"Actual redraws",valueSuffix:"/sec"},FPS:{text:"Overlay FPS ",valueSuffix:"/sec"}},p=class extends b{constructor(e){var r;super(e);this.drawPerformanceTimer=null;this.drawPerformanceFPSCounter=0;this.lastDrawPerformanceFPSCounter=0;this.performanceCanvasLayer=document.createElement("canvas"),(r=e.parentElement)==null||r.insertBefore(this.performanceCanvasLayer,e);}get performanceLayerContext(){if(!this._performanceLayerContext&&(this._performanceLayerContext=this.performanceCanvasLayer.getContext("2d"),!this._performanceLayerContext))throw new TypeError("CanvasRenderingContext cannot be retrieved.");return this._performanceLayerContext}setupPerformanceLayer(){}setPerformanceMetrics(e){this.performanceMetrics=e,this.drawPerformanceMetrics();}updateCanvasSizeAttributes(e,r,t=window.devicePixelRatio){super.updateCanvasSizeAttributes(e,r,t),this.performanceCanvasLayer.width=this.canvas.width,this.performanceCanvasLayer.height=this.canvas.height,this.performanceLayerContext.scale(t,t);}doDraw(){super.doDraw();}drawPerformanceMetrics(){this.drawPerformanceTimer==null&&(a.log(a.Level.Debug,"Drawing performance monitoring enabled, FPS will be drawn into canvas"),this.drawPerformanceTimer=setInterval(()=>{this.lastDrawPerformanceFPSCounter=this.drawPerformanceFPSCounter,this.drawPerformanceFPSCounter=0;},1e3)),this.drawPerformanceFPSCounter++,this.drawFullPerformanceMetrics();}drawFullPerformanceMetrics(){let e={...this.performanceMetrics,FPS:this.lastDrawPerformanceFPSCounter};this.performanceLayerContext.lineWidth=1,this.performanceLayerContext.fillStyle="white",this.performanceLayerContext.strokeStyle="black";let r=Math.min(Math.max(window.innerWidth/35,13),20),t=1.5*r,s=1.5;this.performanceLayerContext.font=`bold ${r}px sans-serif`;let l=0,n=0,i=[];for(let[a,u]of Object.entries(e)){let c=d[a],f=`${c.text}: ${u}${c.valueSuffix}`;n=Math.max(this.performanceLayerContext.measureText(f).width,n),i.push([f,t,t+r*s*l++]);}this.performanceLayerContext.clearRect(t,t-r,n,Object.values(e).length*r*s);for(let a of i)this.performanceLayerContext.fillText(...a),this.performanceLayerContext.strokeText(...a);}};
|
|
5
|
+
|
|
6
|
+
export { p as a };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
function p(t,e=location){return t+=t.endsWith("/")?"":"/",/^https?:\/\//.test(t)?t:(t=t.split("/").filter(n=>n.length>0).join("/"),t=t===""?"/":`/${t}/`,e.protocol==="file:"||e.origin==="null"?`${e.href.split("/").slice(0,-1).join("/")}${t}`:`${e.origin}${t}`)}function c(t){return /^https?:\/\/(?:[^./]*\.)*cdn.jsdelivr.net\//.test(t)?{result:!0,cdnBaseURL:"https://cdn.jsdelivr.net/npm/"}:/^https?:\/\/(?:[^./]*\.)*unpkg.com\//.test(t)?{result:!0,cdnBaseURL:"https://unpkg.com/"}:{result:!1,cdnBaseURL:""}}function l(t){let n=/@scandit\/web-datacapture-[a-z]+/i.exec(t);return n?n[0]:null}function $(t,e,n){let s=e,i=c(s);if(i.result){let u=l(s);u!=null&&(s=`${i.cdnBaseURL}${u}@${t}/sdc-lib/`);}let r=n.replace(".wasm","");return i.result?{jsURI:`${s}${r}.js`,wasmURI:`${s}${r}.wasm`}:{jsURI:`${s}${r}.js?v=${t}`,wasmURI:`${s}${r}.wasm?v=${t}`}}
|
|
2
|
+
|
|
3
|
+
export { p as a, c as b, l as c, $ as d };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { a as a$1 } from './chunk-7NUUZ7LP.js';
|
|
2
|
+
import { d } from './chunk-OTI45AJG.js';
|
|
3
|
+
import { a } from './chunk-SP3HSP4K.js';
|
|
4
|
+
import { a as a$2 } from './chunk-4FJRDG6T.js';
|
|
5
|
+
import { g as g$1 } from './chunk-W7LJM2QO.js';
|
|
6
|
+
import { d as d$1 } from './chunk-UPUPKPEP.js';
|
|
7
|
+
|
|
8
|
+
var g=class n{constructor(e){this.deviceId="";this.type="camera";this._currentState="off";this._settings=new g$1;this._desiredTorchState="off";this._desiredState="off";this.listeners=[];this._context=null;this.stateTransitionStrategyMap={off:{on:this.transitionFromStateOffToOn.bind(this),standby:this.transitionFromStateOffToStandby.bind(this)},on:{off:this.transitionFromStateOnToOff.bind(this),standby:this.transitionFromStateOnToStandby.bind(this)},standby:{off:this.transitionFromStateStandbyToOff.bind(this),on:this.transitionFromStateStandbyToOn.bind(this)}};this.cameraManager=e!=null?e:d.instance(),this.updateCanvasVideoImage=this.updateCanvasVideoImage.bind(this),this.captureAndSend=this.captureAndSend.bind(this);}static get default(){let e=new n;return e.position="worldFacing",e}get desiredState(){return this._desiredState}get settings(){return this._settings}get currentResolution(){var e;return (e=this._currentResolution)!=null?e:null}get context(){return this._context}set context(e){this._context=e,this._context&&this.currentState==="on"&&this.startSendingCapturesToWorker();}get currentState(){return this._currentState}static atPosition(e){if(d$1.Camera.availablePositions.includes(e)){let t=new n;return t.position=e,t}return a.log(a.Level.Warn,`invalid CameraPosition: "${e}"`),null}static fromDeviceCamera(e){let t=n.atPosition(e.position);return t.deviceId=e.deviceId,t.label=e.label,t}async switchToDesiredState(e){var t,i;return this.currentTransitionStrategyPromise&&await this.currentTransitionStrategyPromise,this.currentTransitionStrategyPromise=(i=(t=this.stateTransitionStrategyMap[this.currentState])==null?void 0:t[e])==null?void 0:i.call(t).catch(r=>{if(r instanceof DOMException&&r.message==="The associated Track is in an invalid state"){a.log(a.Level.Warn,r);return}throw r}),this.currentTransitionStrategyPromise}getDesiredTorchState(){return this._desiredTorchState}async setDesiredTorchState(e){this._desiredTorchState=e,await this.cameraManager.setTorchEnabled(this._desiredTorchState==="on"),await this.notifyContext({type:"torchState",newValue:this._desiredTorchState});}async isTorchAvailable(){return this.cameraManager.isTorchAvailable()}addListener(e){e!=null&&(this.listeners.includes(e)||this.listeners.push(e));}removeListener(e){e!=null&&this.listeners.includes(e)&&this.listeners.splice(this.listeners.indexOf(e),1);}async applySettings(e){var i;this._settings=new g$1(e);let t=this.settings.getProperty("grayScaleFrameReader");if(this.cameraManager.setFrameReaderType(t===!0?"GRAYSCALE":"RGBA"),this.currentState==="on"||this.currentState==="standby"){let r=this.cameraManager.activeCameraSettings;(r==null?void 0:r.preferredResolution)!==this.settings.preferredResolution&&(await this.cameraManager.applyCameraSettings(this.settings),(i=this.cameraManager.activeCamera)!=null&&i.currentResolution&&(this._currentResolution={width:this.cameraManager.activeCamera.currentResolution.width,height:this.cameraManager.activeCamera.currentResolution.height})),await this.cameraManager.setZoom(this.settings.zoomFactor);let o=this.settings.getProperty("minFrameRate"),c=this.settings.getProperty("maxFrameRate");(o!=null||c!=null)&&await this.cameraManager.setFrameRate({min:o,max:c});let m=this.settings.getProperty("manualLensPosition");m!=null&&await this.cameraManager.setFocus(m);let u=this.settings.getProperty("exposureTargetBias"),d=this.settings.getProperty("exposureDuration");(u!=null||d!=null)&&await this.cameraManager.setExposure({compensation:u,time:d});}return this.notifyContext({type:"cameraSettings",newValue:this.settings})}toJSONObject(){return {type:this.type,position:this.position,settings:this.settings.toJSONObject(),desiredState:this.desiredState,desiredTorchState:this._desiredTorchState}}getMirrorImageEnabled(){var e;return (e=this._desiredMirrorImageEnabled)!=null?e:this.cameraManager.isMirrorImageEnabled()}async setMirrorImageEnabled(e){this._desiredMirrorImageEnabled=e,this.cameraManager.setMirrorImageEnabled(e,!0),this.context&&await this.context.setFrameSource(this);}getCurrentState(){return this._currentState}async setCurrentState(e){if(e!==this._currentState){this._currentState=e,this.notifyListeners();try{await this.notifyContext({type:"frameSourceState",newValue:e}),e==="on"&&this.startSendingCapturesToWorker();}catch(t){a.log(a.Level.Warn,"Error while notifying context about new state of Camera");}}}async setupCamera(){if(this.cameraManager.setSelectedCameraSettings(this.settings),this.deviceId==="")this.cameraManager.setSelectedCamera(),this.cameraManager.setInitialCameraPosition(this.position);else {let t=(await a$1.getCameras()).find(i=>i.deviceId===this.deviceId);t&&(this.cameraManager.setInitialCameraPosition(t.position),this.cameraManager.setSelectedCamera(t));}await this.cameraManager.setupCameras(),typeof this._desiredMirrorImageEnabled=="boolean"?this.cameraManager.setMirrorImageEnabled(this._desiredMirrorImageEnabled,!0):this.cameraManager.setMirrorImageEnabled(this.cameraManager.isMirrorImageEnabled(),!1),this.context&&await this.context.setFrameSource(this),this.cameraManager.activeCamera&&(this.label=this.cameraManager.activeCamera.label,this.position=this.cameraManager.activeCamera.position,this.deviceId=this.cameraManager.activeCamera.deviceId,this._currentResolution=this.cameraManager.activeCamera.currentResolution);}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);}updateCanvasVideoImage(){this.currentState==="on"&&this.context&&(this.cameraManager.updateCanvasVideoImage(),this._lastCanvasVideoPreviewAnimationFrame=this.cameraManager.requestVideoFrame(this.updateCanvasVideoImage));}async captureAndSend(){if(this.currentState!=="on"||!this.context)return;if(!this.context.hasEnabledMode()){this._lastCaptureRequestAnimationFrame=this.cameraManager.requestVideoFrame(this.captureAndSend);return}let e=null;try{e=this.cameraManager.captureImage();}catch(t){a.log(a.Level.Warn,t.message);}finally{e!=null&&this.context.sendFrameToProcessor(e).then(t=>(this.cameraManager.recycle(t.data),null)).catch(t=>{a.log(a.Level.Warn,"error while recycle uint8array",t);}),this._lastCaptureRequestAnimationFrame=this.cameraManager.requestVideoFrame(this.captureAndSend);}}startSendingCapturesToWorker(){this.stopSendingCapturesToWorker(),this.captureAndSend();}stopSendingCapturesToWorker(){this._lastCanvasVideoPreviewAnimationFrame!=null&&this.cameraManager.cancelVideoFrame(this._lastCanvasVideoPreviewAnimationFrame),this._lastCaptureRequestAnimationFrame!=null&&this.cameraManager.cancelVideoFrame(this._lastCaptureRequestAnimationFrame);}async transitionFromStateOffToOn(){if(!(this.currentState==="on"||this.currentState==="starting"||this.currentState==="wakingUp")){this._desiredState="on",await this.setCurrentState("starting");try{await this.setupCamera(),await this.setCurrentState("on");}catch(e){throw a.log(a.Level.Error,e),await this.setCurrentState("off"),e}}}async transitionFromStateOffToStandby(){if(!(this.currentState==="standby"||this.currentState==="bootingUp"||this.currentState==="goingToSleep")){if(await this.isAndroidWebView()){a.log(a.Level.Warn,'Warning: "Standby" state does not work inside web views. Falling back to state "On".'),await this.transitionFromStateOffToOn();return}this._desiredState="standby",await this.setCurrentState("bootingUp");try{await this.setupCamera(),this.cameraManager.pauseStream(),await this.setCurrentState("standby");}catch(e){throw a.log(a.Level.Error,e),await this.setCurrentState("off"),e}await this.setCurrentState("standby"),await this.setDesiredTorchState("off");}}async transitionFromStateOnToOff(){this.currentState==="off"||this.currentState==="stopping"||(this._desiredState="off",await this.setCurrentState("stopping"),await this.cameraManager.stopStream(),await this.setCurrentState("off"),await this.setDesiredTorchState("off"));}async transitionFromStateOnToStandby(){if(!(this.currentState==="standby"||this.currentState==="bootingUp"||this.currentState==="goingToSleep")){if(await this.isAndroidWebView()){a.log(a.Level.Warn,'Warning: "Standby" state does not work inside web views. Falling back to state "Off".'),await this.transitionFromStateOnToOff();return}this._desiredState="standby",await this.setCurrentState("goingToSleep"),this.cameraManager.pauseStream(),await this.setCurrentState("standby"),await this.setDesiredTorchState("off");}}async transitionFromStateStandbyToOff(){this.currentState==="off"||this.currentState==="stopping"||(this._desiredState="off",await this.setCurrentState("shuttingDown"),await this.cameraManager.stopStream(),await this.setCurrentState("off"),await this.setDesiredTorchState("off"));}async transitionFromStateStandbyToOn(){this.currentState==="on"||this.currentState==="starting"||this.currentState==="wakingUp"||(this._desiredState="on",await this.setCurrentState("wakingUp"),this.cameraManager.resumeStream(),await this.setCurrentState("on"));}async isAndroidWebView(){return this._isAndroidWebView==null&&(this._isAndroidWebView=await a$2.isAndroidWebView()),this._isAndroidWebView}isZoomAvailable(){var e;return ((e=this.cameraManager.mediaTrackCapabilities)==null?void 0:e.zoom)!=null}};
|
|
9
|
+
|
|
10
|
+
export { g as a };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var t;(u=>{(e=>(e.Debug="debug",e.Info="info",e.Warn="warn",e.Error="error",e.Quiet="quiet"))(u.Level||(u.Level={}));let n=new Map([["debug",1],["info",2],["warn",3],["error",4],["quiet",5]]),l="debug";function a(r){l=r;}u.setLevel=a;function v(r,...o){if(!(n.get(l)>n.get(r)))switch(r){case"debug":console.debug(...o);break;case"info":console.log(...o);break;case"warn":console.warn(...o);break;case"error":console.error(...o);break;}}u.log=v;})(t||(t={}));
|
|
2
|
+
|
|
3
|
+
export { t as a };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { a } from './chunk-SP3HSP4K.js';
|
|
2
|
+
|
|
3
|
+
function d(r,o,t){let e=r.createProgram();if(!e)throw new Error("Cannot create webgl program");return r.attachShader(e,o),r.attachShader(e,t),r.linkProgram(e),r.getProgramParameter(e,r.LINK_STATUS)?e:(a.log(a.Level.Error,"Program linking error:",r.getProgramInfoLog(e)),r.deleteProgram(e),null)}function h(r,o,t){let e=r.createShader(o);if(!e)throw new Error("Cannot create a shader");return r.shaderSource(e,t),r.compileShader(e),r.getShaderParameter(e,r.COMPILE_STATUS)?e:(a.log(a.Level.Error,"Shader compilation error:",r.getShaderInfoLog(e)),r.deleteShader(e),null)}
|
|
4
|
+
|
|
5
|
+
export { d as a, h as b };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { j, h, i as i$1, f, g, d, e, b, c, a as a$2 } from './chunk-FGCJ3ZLG.js';
|
|
2
|
+
import { a as a$1 } from './chunk-NMX4VHW2.js';
|
|
3
|
+
|
|
4
|
+
var i=class{toJSONObject(){return {type:this.type}}},s=class extends i{constructor(){super(...arguments);this.type="torch";this.view=null;this.icon={on:{idle:j,pressed:h},off:{idle:i$1,pressed:f}};}get torchOffImage(){return this.icon.off.idle}set torchOffImage(t){var e;this.icon.off.idle=t,(e=this.view)==null||e.controlsUpdated();}get torchOffPressedImage(){return this.icon.off.pressed}set torchOffPressedImage(t){var e;this.icon.off.pressed=t,(e=this.view)==null||e.controlsUpdated();}get torchOnImage(){return this.icon.on.idle}set torchOnImage(t){var e;this.icon.on.idle=t,(e=this.view)==null||e.controlsUpdated();}get torchOnPressedImage(){return this.icon.on.pressed}set torchOnPressedImage(t){var e;this.icon.on.pressed=t,(e=this.view)==null||e.controlsUpdated();}};s.CLASS_NAME=a$1.TORCH_SWITCH_CONTROL_CLASS_NAME;var l=class extends i{constructor(){super(...arguments);this.type="camera";this.view=null;this.icon={idle:g,pressed:d};}get idleImage(){return this.icon.idle}set idleImage(t){var e;this.icon.idle=t,(e=this.view)==null||e.controlsUpdated();}get pressedImage(){return this.icon.pressed}set pressedImage(t){var e;this.icon.pressed=t,(e=this.view)==null||e.controlsUpdated();}};l.CLASS_NAME=a$1.CAMERA_SWITCH_CONTROL_CLASS_NAME;var a=class extends i{constructor(){super(...arguments);this.type="camera-fov";this.view=null;this.icon={wide:{idle:e,pressed:b},ultraWide:{idle:c,pressed:a$2}};}get cameraFOVUltraWideImage(){return this.icon.ultraWide.idle}set cameraFOVUltraWideImage(t){var e;this.icon.ultraWide.idle=t,(e=this.view)==null||e.controlsUpdated();}get cameraFOVUltraWidePressedImage(){return this.icon.ultraWide.pressed}set cameraFOVUltraWidePressedImage(t){var e;this.icon.ultraWide.pressed=t,(e=this.view)==null||e.controlsUpdated();}get cameraFOVWideImage(){return this.icon.wide.idle}set cameraFOVWideImage(t){var e;this.icon.wide.idle=t,(e=this.view)==null||e.controlsUpdated();}get cameraFOVWidePressedImage(){return this.icon.wide.pressed}set cameraFOVWidePressedImage(t){var e;this.icon.wide.pressed=t,(e=this.view)==null||e.controlsUpdated();}};a.CLASS_NAME=a$1.CAMERA_FOV_SWITCH_CONTROL_CLASS_NAME;
|
|
5
|
+
|
|
6
|
+
export { s as a, l as b, a as c };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { b, a as a$4, c, f as f$1 } from './chunk-MSPQDVWJ.js';
|
|
2
|
+
import { a as a$5 } from './chunk-3A4KLILV.js';
|
|
3
|
+
import { a as a$2 } from './chunk-U6BTTEV6.js';
|
|
4
|
+
import { a as a$1 } from './chunk-EV4OEANA.js';
|
|
5
|
+
import { a as a$3 } from './chunk-GE4CBD4E.js';
|
|
6
|
+
|
|
7
|
+
var h="scandit-progress-bar",n="aria-valuenow",f="aria-valuemin",w="aria-valuemax",a=class a extends a$1{constructor(){super();let e=this.attachShadow({mode:"open"});e.innerHTML=a$2`
|
|
8
|
+
<div id="scandit-progress" role="progressbar" aria-valuemin="0" aria-valuemax="100" />
|
|
9
|
+
`,e.append(a.createStyleElement().cloneNode(!0)),this.progress=e.querySelector("#scandit-progress");}static get observedAttributes(){return ["value","min","max"]}static createStyleElement(){return a$3`:host{display:inline-block;--indeterminate-bubble-width:35%;--accent-color:#${b.toJSON()};--start-gradient-color:#${a$4.toJSON()};--end-gradient-color:#${c.toJSON()};--secondary-color:#${f$1.toJSON()};width:100%}:host [role=progressbar]{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;height:.5rem;overflow:hidden;position:relative}:host [role=progressbar]:after,:host [role=progressbar]:before{background:var(--accent-color);border-radius:.5rem;content:" ";height:.5rem;left:0;position:absolute;top:0}:host([variant=gradient]) [role=progressbar]:after,:host([variant=gradient]) [role=progressbar]:before{background:linear-gradient(90deg,var(--start-gradient-color) 0,var(--end-gradient-color) 100%)}:host(:focus-visible){border-radius:.5rem;outline-color:var(--accent-color);outline-offset:5px}:host [role=progressbar]:not([aria-valuenow]):after{animation:indeterminate-progress-bar 2.5s ease infinite;width:var(--indeterminate-bubble-width);z-index:1}:host [role=progressbar][aria-valuenow]:after{animation:none;width:0}:host [role=progressbar][aria-valuenow]:before{background-color:var(--accent-color);border-radius:.5rem;transition:width .3s linear;width:calc(var(--aria-valuenow)*1%)}:host [role=progressbar]{background-color:var(--secondary-color);border-radius:.5rem}@keyframes indeterminate-progress-bar{0%{left:0}50%{left:calc(100% - var(--indeterminate-bubble-width))}}`}get min(){var r;let e=(r=this.getAttribute("min"))!=null?r:0;return Number(e)}get max(){var r;let e=(r=this.getAttribute("max"))!=null?r:1;return Number(e)}set max(e){e!==null&&this.setAttribute("max",String(e));}get value(){let e=this.getAttribute("value");return e==null||e===""?null:Number(e)}set value(e){if(e==null){this.removeAttribute("value");return}e>=this.min&&e<=this.max&&this.setAttribute("value",String(e));}static create(){return document.createElement(h)}static register(){a$5({[a.tag]:a});}attributeChangedCallback(){this.update();}connectedCallback(){this.update();}update(){let{min:e,max:r,value:i,progress:t}=this;if(t==null||t.setAttribute(f,e.toString()),t==null||t.setAttribute(w,r.toString()),i==null){t==null||t.removeAttribute(n),t==null||t.removeAttribute("style");return}if(i>=e&&i<=r){let v=(i-e)/(r-e)*100,l=String(v);t==null||t.setAttribute(n,l),t==null||t.setAttribute("style",`--${n}: ${l}`);}}};a.tag=h;var o=a;o.register();
|
|
10
|
+
|
|
11
|
+
export { o as a };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { a as a$3 } from './chunk-M46MIHI5.js';
|
|
2
|
+
import { a as a$2 } from './chunk-5IVFVUF4.js';
|
|
3
|
+
import { e as e$1 } from './chunk-MSPQDVWJ.js';
|
|
4
|
+
import { a as a$6 } from './chunk-3A4KLILV.js';
|
|
5
|
+
import { a as a$4 } from './chunk-U6BTTEV6.js';
|
|
6
|
+
import { a as a$1 } from './chunk-EV4OEANA.js';
|
|
7
|
+
import { a as a$5 } from './chunk-GE4CBD4E.js';
|
|
8
|
+
|
|
9
|
+
var b=(i=>(i.DidShow="didshow",i.DidHide="didhide",i.WillShow="willshow",i))(b||{}),o="--text-size",s="--text-color",n="--text-alignment",a="--text-weight",r="--line-height",l="--background-color",c="--corner-radius",h="--max-lines",x="ease-in-out",e=class e extends a$1{constructor(){super();this.toast=null;this._hintStyle=null;this.currentAnimation=null;this.animationDuration=250;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`
|
|
10
|
+
<div class="toast">
|
|
11
|
+
<slot name="first-child"></slot>
|
|
12
|
+
<div class="left">
|
|
13
|
+
<slot name="icon"></slot>
|
|
14
|
+
</div>
|
|
15
|
+
<p class="middle">
|
|
16
|
+
<slot></slot>
|
|
17
|
+
</p>
|
|
18
|
+
</div>
|
|
19
|
+
`,t.append(e.createStyleElement().cloneNode(!0)),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{${o}:1rem;${s}:#000;${a}:400;${n}:${"center"};${r}:1.5rem;${l}:#fff;${c}:.25rem;${h}:2;align-items:flex-start;background-color:var(${l});border-radius:var(${c});color:var(${s});display:flex;flex-direction:row;font-size:var(${o});font-weight:var(${a});gap:.625rem;justify-content:var(${n});line-height:var(${r});padding: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;margin:0;padding:0;text-align:var(${n});-webkit-line-clamp:var(${h});-webkit-box-orient:vertical;align-self:center;overflow:hidden;text-shadow:0 1px 2px #${e$1.withAlpha(.3).toJSON()}}p.middle{text-align:var(${n})}`}get hintStyle(){return this._hintStyle}set hintStyle(t){this._hintStyle=t,this.render();}get showAnimation(){return new Animation(new KeyframeEffect(this,[{opacity:0},{opacity:1}],{duration:this.animationDuration,fill:"both",easing:x}))}get hideAnimation(){return new Animation(new KeyframeEffect(this,[{opacity:1},{opacity:0}],{duration:this.animationDuration,fill:"both",easing:x}))}static create(){return document.createElement(e.tag)}static register(){a$6({[e.tag]:e});}async show(){return this.toggle(!0)}async hide(){return this.toggle(!1)}connectedCallback(){this.render();}async toggle(t){var i,m;if(this.currentAnimation==null){this.animationDuration=(m=(i=this.hintStyle)==null?void 0:i.isAnimatedToView)==null||m?250:0,this.currentAnimation=t?this.showAnimation:this.hideAnimation,t&&this.dispatchEvent(new CustomEvent("willshow",{bubbles:!0})),this.currentAnimation.play();try{await this.currentAnimation.finished,this.dispatchEvent(new CustomEvent(t?"didshow":"didhide",{bubbles:!0,detail:{target:this}}));}catch(E){}finally{this.currentAnimation=null;}}}render(){var t;!this.toast||!this.hintStyle||(this.toast.className="toast",this.toast.style.setProperty(o,`${this.hintStyle.textSize}px`),this.toast.style.setProperty(s,`#${this.hintStyle.textColor}`),this.toast.style.setProperty(a,this.hintStyle.textWeight.toString()),this.toast.style.setProperty(n,this.hintStyle.textAlignment),this.toast.style.setProperty(r,`${this.hintStyle.lineHeight/14}`),this.toast.style.setProperty(l,`#${this.hintStyle.backgroundColor}`),this.toast.style.setProperty(c,`${this.hintStyle.cornerRadius/10}rem`),this.toast.style.setProperty(h,this.hintStyle.maxLines.toString()),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)),(t=this.querySelector("[slot=icon]"))==null||t.setAttribute("fill",`#${this.hintStyle.iconColor}`));}};e.tag="scandit-toast-hint";var d=e;d.register();
|
|
20
|
+
|
|
21
|
+
export { b as a, d as b };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { d } from './chunk-UPUPKPEP.js';
|
|
2
|
+
|
|
3
|
+
var r=class{constructor(){this.frameColor=d.AimerViewfinder.frameColor;this.dotColor=d.AimerViewfinder.dotColor;this.type="aimer";}toJSONObject(){return {type:this.type,frameColor:this.frameColor.toJSON(),dotColor:this.dotColor.toJSON()}}};
|
|
4
|
+
|
|
5
|
+
export { r as a };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { a } from './chunk-4FJRDG6T.js';
|
|
2
|
+
import { d } from './chunk-UPUPKPEP.js';
|
|
3
|
+
|
|
4
|
+
var n=class e{constructor(t,o=d.Feedback.defaultVibrationPattern){this.type=t,this.pattern=o;let r=a.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)}};
|
|
5
|
+
|
|
6
|
+
export { n as a };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
async function m(e,r){let t=document.createElement("canvas");t.width=this.width,t.height=this.height;let a=t.getContext("2d");if(!a)throw new Error("Could not get 2d context from an HTMLCanvasElement");let n=await this.getData();return n==null?null:(a.putImageData(new ImageData(n,this.width,this.height),0,0),new Promise((i,l)=>{t.toBlob(o=>{if(t=null,a=null,o===null){l(new Error("Could not create Blob object from canvas"));return}i(o);},e,r);}))}function s(e,r){let t={width:e.width,height:e.height,isFrameSourceMirrored:e.isFrameSourceMirrored,getData:async()=>(await r.requestFrameData(e.frameId)).data};return t.toBlob=m.bind(t),t}
|
|
2
|
+
|
|
3
|
+
export { s as a };
|