@scandit/web-datacapture-core 8.0.0 → 8.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY.txt +331 -70
- package/build/js/AimerViewfinder.d.ts +8 -2
- package/build/js/AimerViewfinder.js +1 -1
- package/build/js/Brush.d.ts +5 -1
- package/build/js/Brush.js +1 -1
- package/build/js/Camera-DhGjpcjv.d.ts +394 -0
- package/build/js/Camera.d.ts +5 -3
- package/build/js/Camera.js +1 -1
- package/build/js/CameraRelated.d.ts +4 -2
- package/build/js/CameraRelated.js +1 -1
- package/build/js/{DataCaptureContext-8EuyQSL7.d.ts → DataCaptureContext-fzPdCXUX.d.ts} +69 -79
- package/build/js/DataCaptureContext.d.ts +16 -7
- package/build/js/DataCaptureContext.js +1 -1
- package/build/js/DataCaptureContextRelated.d.ts +19 -10
- package/build/js/DataCaptureContextSettings.d.ts +1 -1
- package/build/js/DataCaptureVersion.js +1 -1
- package/build/js/DataCaptureView.d.ts +17 -8
- package/build/js/DataCaptureView.js +1 -1
- package/build/js/DefaultViewClassnames.d.ts +0 -6
- package/build/js/DefaultViewClassnames.js +1 -1
- package/build/js/Feedback.js +1 -1
- package/build/js/FrameData.d.ts +17 -8
- package/build/js/FrameData.js +1 -1
- package/build/js/ImageFrameSource.d.ts +4 -2
- package/build/js/ImageFrameSource.js +1 -1
- package/build/js/LaserlineViewfinder.d.ts +7 -1
- package/build/js/LaserlineViewfinder.js +1 -1
- package/build/js/LocationSelection.d.ts +6 -1
- package/build/js/LocationSelection.js +1 -1
- package/build/js/NotificationPresenter/NotificationBuilder.d.ts +1 -1
- package/build/js/NotificationPresenter/NotificationBuilder.js +1 -1
- package/build/js/NotificationPresenter/NotificationConfiguration.d.ts +1 -1
- package/build/js/NotificationPresenter/NotificationConfiguration.js +1 -1
- package/build/js/NotificationPresenter/NotificationPresenter.d.ts +1 -1
- package/build/js/NotificationPresenter/index.d.ts +17 -8
- package/build/js/NotificationPresenter/index.js +1 -1
- package/build/js/NotificationPresenter/private/ConcreteNotificationPresenter.d.ts +17 -8
- package/build/js/NotificationPresenter/private/ConcreteNotificationPresenter.js +1 -1
- package/build/js/NotificationPresenter/private/presets.d.ts +17 -8
- package/build/js/NotificationPresenter/private/presets.js +1 -1
- package/build/js/RectangularViewfinder.d.ts +7 -1
- package/build/js/RectangularViewfinder.js +1 -1
- package/build/js/ScanditIcon.d.ts +1 -1
- package/build/js/ScanditIcon.js +1 -1
- package/build/js/ScanditIconBuilder.d.ts +22 -20
- package/build/js/ScanditIconBuilder.js +1 -1
- package/build/js/SingleImageUploader.d.ts +4 -2
- package/build/js/SingleImageUploader.js +1 -1
- package/build/js/SingleImageUploaderSettings.js +1 -1
- package/build/js/Vibration.js +1 -1
- package/build/js/Viewfinder.d.ts +7 -1
- package/build/js/ViewfinderPlusRelated.d.ts +7 -1
- package/build/js/browserHelper.d.ts +23 -1
- package/build/js/browserHelper.js +1 -1
- package/build/js/chunks/{chunk-2EY4FBA3.js → chunk-24IG7HUA.js} +1 -1
- package/build/js/chunks/chunk-2AX7TBDI.js +1 -0
- package/build/js/chunks/chunk-2JIATMSD.js +1 -0
- package/build/js/chunks/chunk-3CXYB36D.js +1 -0
- package/build/js/chunks/chunk-3D2HNEVH.js +1 -0
- package/build/js/chunks/chunk-3KKUZY2T.js +1 -0
- package/build/js/chunks/{chunk-5YXBE5P2.js → chunk-3LVMEVOI.js} +1 -1
- package/build/js/chunks/chunk-4BP7D26M.js +1 -0
- package/build/js/chunks/{chunk-A5WVN3T4.js → chunk-4F5JUHOJ.js} +1 -1
- package/build/js/chunks/{chunk-T4QDTXZN.js → chunk-4GKVQAVF.js} +1 -1
- package/build/js/chunks/chunk-4JH6EEAE.js +1 -0
- package/build/js/chunks/chunk-523EQN4Z.js +1 -0
- package/build/js/chunks/chunk-5C4OO6CX.js +35 -0
- package/build/js/chunks/{chunk-TDOKACT7.js → chunk-5IGOKD23.js} +1 -1
- package/build/js/chunks/{chunk-UBDDFAOX.js → chunk-5JAPQHXF.js} +1 -1
- package/build/js/chunks/chunk-5LXHD7FZ.js +1 -0
- package/build/js/chunks/chunk-5RCWM6NI.js +1 -0
- package/build/js/chunks/chunk-6LHGFWQI.js +1 -0
- package/build/js/chunks/chunk-74GO72VC.js +1 -0
- package/build/js/chunks/chunk-ADFFBLII.js +1 -0
- package/build/js/chunks/chunk-AFCJ24Y3.js +1 -0
- package/build/js/chunks/chunk-AWPUSRYW.js +1 -0
- package/build/js/chunks/chunk-AZWFNBVA.js +1 -0
- package/build/js/chunks/chunk-BDGRWHLY.js +1 -0
- package/build/js/chunks/chunk-BFLBICOJ.js +1 -0
- package/build/js/chunks/chunk-BG2MAWWN.js +1 -0
- package/build/js/chunks/chunk-BGUY24J4.js +1 -0
- package/build/js/chunks/chunk-BIJB4K7G.js +1 -0
- package/build/js/chunks/chunk-BZAQMYII.js +1 -0
- package/build/js/chunks/chunk-C3EY6I75.js +2 -0
- package/build/js/chunks/chunk-C657OBED.js +1 -0
- package/build/js/chunks/chunk-CAHJ3YOV.js +1 -0
- package/build/js/chunks/{chunk-GGMX65YP.js → chunk-CD2BU66N.js} +1 -1
- package/build/js/chunks/chunk-CRUOVJHW.js +1 -0
- package/build/js/chunks/chunk-D6JKW7G4.js +1 -0
- package/build/js/chunks/chunk-DQ2IFWM5.js +1 -0
- package/build/js/chunks/chunk-DZKZ6RMW.js +1 -0
- package/build/js/chunks/chunk-E4XJ4GKD.js +1 -0
- package/build/js/chunks/chunk-ENYHCJGH.js +1 -0
- package/build/js/chunks/{chunk-LOV5GR63.js → chunk-EQP4U5U2.js} +1 -1
- package/build/js/chunks/chunk-F2GMW4LP.js +1 -0
- package/build/js/chunks/{chunk-IU22MD7N.js → chunk-F2IJCZAS.js} +1 -1
- package/build/js/chunks/{chunk-3HOGSYPB.js → chunk-F6TT5US7.js} +1 -1
- package/build/js/chunks/chunk-FR24G4R7.js +1 -0
- package/build/js/chunks/chunk-GJBUPJIM.js +1 -0
- package/build/js/chunks/chunk-GPPCTFZF.js +1 -0
- package/build/js/chunks/chunk-GPUTPXQM.js +1 -0
- package/build/js/chunks/{chunk-3MEGNPVU.js → chunk-I6SWF3FQ.js} +1 -1
- package/build/js/chunks/chunk-IJQG3OU6.js +1 -0
- package/build/js/chunks/chunk-IMXMNDKM.js +1 -0
- package/build/js/chunks/chunk-J6LCRGZO.js +1 -0
- package/build/js/chunks/chunk-KAFNKP6O.js +1 -0
- package/build/js/chunks/{chunk-5MUFGMII.js → chunk-L7WVCDGR.js} +1 -1
- package/build/js/chunks/chunk-LORGLY2X.js +1 -0
- package/build/js/chunks/chunk-MA6UDVDJ.js +1 -0
- package/build/js/chunks/chunk-MBL5Q2H2.js +1 -0
- package/build/js/chunks/{chunk-HDY35RKY.js → chunk-NDQQHCZN.js} +1 -1
- package/build/js/chunks/chunk-O7QIRKOP.js +1 -0
- package/build/js/chunks/chunk-ORP45GHJ.js +1 -0
- package/build/js/chunks/chunk-PA2BMEFD.js +1 -0
- package/build/js/chunks/chunk-Q45KFJIS.js +1 -0
- package/build/js/chunks/chunk-QG3MRQMP.js +1 -0
- package/build/js/chunks/chunk-QOCHMKNY.js +1 -0
- package/build/js/chunks/chunk-QQEY536Q.js +1 -0
- package/build/js/chunks/chunk-R4KME2DS.js +6 -0
- package/build/js/chunks/chunk-R6SUMD5F.js +1 -0
- package/build/js/chunks/{chunk-CF2DKFX2.js → chunk-RHMGLXJ3.js} +1 -1
- package/build/js/chunks/chunk-RL4LGOQS.js +1 -0
- package/build/js/chunks/chunk-RSQRPDVQ.js +1 -0
- package/build/js/chunks/chunk-RXPPTQAB.js +1 -0
- package/build/js/chunks/chunk-SBC5K7IT.js +1 -0
- package/build/js/chunks/chunk-SGL5J2CI.js +1 -0
- package/build/js/chunks/chunk-SOCEWYYO.js +1 -0
- package/build/js/chunks/chunk-SVJ6BU5X.js +1 -0
- package/build/js/chunks/chunk-TKO5JMMS.js +1 -0
- package/build/js/chunks/chunk-TPHGDMKG.js +1 -0
- package/build/js/chunks/chunk-TU44BW74.js +1 -0
- package/build/js/chunks/chunk-TXVFFRVY.js +1 -0
- package/build/js/chunks/chunk-UOQFOEG6.js +1 -0
- package/build/js/chunks/chunk-UQVVJP5Z.js +1 -0
- package/build/js/chunks/chunk-V6RG452U.js +1 -0
- package/build/js/chunks/chunk-VBUDN72N.js +2 -0
- package/build/js/chunks/chunk-W6HSMZGZ.js +1 -0
- package/build/js/chunks/chunk-WARGMW7Z.js +1 -0
- package/build/js/chunks/{chunk-BRS5WVNO.js → chunk-WL2XKPJD.js} +1 -1
- package/build/js/chunks/{chunk-RETAUGCJ.js → chunk-X2ZGBI4S.js} +1 -1
- package/build/js/chunks/chunk-X4LJRWLI.js +1 -0
- package/build/js/chunks/{chunk-WAJ5PI3A.js → chunk-XINFYUZW.js} +1 -1
- package/build/js/chunks/chunk-Y7ZNLVR2.js +1 -0
- package/build/js/chunks/chunk-YOTQPBO6.js +1 -0
- package/build/js/chunks/{chunk-2BBQRPKY.js → chunk-ZEBGTTCX.js} +1 -1
- package/build/js/commons/Anchor.d.ts +14 -0
- package/build/js/commons/Anchor.js +1 -0
- package/build/js/commons/Color.d.ts +28 -0
- package/build/js/commons/Color.js +1 -0
- package/build/js/commons/Direction.d.ts +12 -0
- package/build/js/commons/Direction.js +1 -0
- package/build/js/commons/JSONType.d.ts +6 -0
- package/build/js/commons/JSONType.js +0 -0
- package/build/js/commons/MarginsWithUnit.d.ts +39 -0
- package/build/js/commons/MarginsWithUnit.js +1 -0
- package/build/js/commons/MeasureUnit.d.ts +7 -0
- package/build/js/commons/MeasureUnit.js +1 -0
- package/build/js/commons/NumberWithUnit.d.ts +19 -0
- package/build/js/commons/NumberWithUnit.js +1 -0
- package/build/js/commons/Orientation.d.ts +10 -0
- package/build/js/commons/Orientation.js +1 -0
- package/build/js/commons/Point.d.ts +20 -0
- package/build/js/commons/Point.js +1 -0
- package/build/js/commons/PointWithUnit.d.ts +27 -0
- package/build/js/commons/PointWithUnit.js +1 -0
- package/build/js/commons/Quadrilateral.d.ts +25 -0
- package/build/js/commons/Quadrilateral.js +1 -0
- package/build/js/commons/Rect.d.ts +19 -0
- package/build/js/commons/Rect.js +1 -0
- package/build/js/commons/RectWithUnit.d.ts +21 -0
- package/build/js/commons/RectWithUnit.js +1 -0
- package/build/js/commons/Size.d.ts +18 -0
- package/build/js/commons/Size.js +1 -0
- package/build/js/commons/SizeMode.d.ts +9 -0
- package/build/js/commons/SizeMode.js +1 -0
- package/build/js/commons/SizeWithAspect.d.ts +14 -0
- package/build/js/commons/SizeWithAspect.js +1 -0
- package/build/js/commons/SizeWithUnit.d.ts +27 -0
- package/build/js/commons/SizeWithUnit.js +1 -0
- package/build/js/commons/SizeWithUnitAndAspect.d.ts +42 -0
- package/build/js/commons/SizeWithUnitAndAspect.js +1 -0
- package/build/js/controls/CameraFOVSwitchControl.d.ts +71 -0
- package/build/js/controls/CameraFOVSwitchControl.js +1 -0
- package/build/js/controls/CameraSwitchControl.d.ts +64 -0
- package/build/js/controls/CameraSwitchControl.js +1 -0
- package/build/js/controls/TorchSwitchControl.d.ts +65 -0
- package/build/js/controls/TorchSwitchControl.js +1 -0
- package/build/js/controls/common.d.ts +37 -0
- package/build/js/controls/common.js +0 -0
- package/build/js/controls/index.d.ts +40 -0
- package/build/js/controls/index.js +1 -0
- package/build/js/defaults/DefaultsBrush.d.ts +9 -0
- package/build/js/defaults/DefaultsBrush.js +1 -0
- package/build/js/defaults/DefaultsCamera.d.ts +21 -0
- package/build/js/defaults/DefaultsCamera.js +1 -0
- package/build/js/defaults/DefaultsCameraSettings.d.ts +17 -0
- package/build/js/defaults/DefaultsCameraSettings.js +1 -0
- package/build/js/defaults/DefaultsDataCaptureView.d.ts +22 -0
- package/build/js/defaults/DefaultsDataCaptureView.js +1 -0
- package/build/js/defaults/DefaultsDeserializers.d.ts +12 -0
- package/build/js/defaults/DefaultsDeserializers.js +1 -0
- package/build/js/defaults/DefaultsFeedback.d.ts +7 -0
- package/build/js/defaults/DefaultsFeedback.js +1 -0
- package/build/js/defaults/DefaultsSingleImageUploader.d.ts +19 -0
- package/build/js/defaults/DefaultsSingleImageUploader.js +1 -0
- package/build/js/defaults/DefaultsViewfinders.d.ts +46 -0
- package/build/js/defaults/DefaultsViewfinders.js +1 -0
- package/build/js/index.d.ts +26 -8
- package/build/js/index.js +1 -1
- package/build/js/moduleLoader.d.ts +17 -8
- package/build/js/private/AnchorPositions.d.ts +2 -1
- package/build/js/private/AnchorPositions.js +1 -1
- package/build/js/private/CameraAccess.d.ts +4 -166
- package/build/js/private/CameraAccess.js +1 -1
- package/build/js/private/CameraManager.d.ts +17 -8
- package/build/js/private/CameraManager.js +1 -1
- package/build/js/private/CameraPool.d.ts +17 -8
- package/build/js/private/CanvasDrawerWithMetrics.d.ts +17 -8
- package/build/js/private/CoreModuleLicenseTextProvider.d.ts +17 -8
- package/build/js/private/CoreModuleLicenseTextProvider.js +1 -1
- package/build/js/private/CustomLocationsView.d.ts +7 -1
- package/build/js/private/CustomLocationsView.js +1 -1
- package/build/js/private/DataCaptureContextRelated.d.ts +17 -8
- package/build/js/private/FrameReaders/ColorType.d.ts +7 -0
- package/build/js/private/FrameReaders/ColorType.js +1 -0
- package/build/js/private/FrameReaders/FrameReader.d.ts +32 -8
- package/build/js/private/FrameReaders/FrameReader.js +1 -1
- package/build/js/private/FrameReaders/FrameReaderAbstract.d.ts +47 -8
- package/build/js/private/FrameReaders/GrayScaleFrameReader.d.ts +17 -6
- package/build/js/private/FrameReaders/GrayScaleFrameReader.js +1 -1
- package/build/js/private/FrameReaders/index.d.ts +20 -8
- package/build/js/private/FrameReaders/index.js +1 -1
- package/build/js/private/GestureRecognizer/GestureRecognizer.d.ts +22 -2
- package/build/js/private/GestureRecognizer/GestureRecognizer.js +1 -1
- package/build/js/private/GestureRecognizer/index.d.ts +1 -1
- package/build/js/private/GestureRecognizer/index.js +1 -1
- package/build/js/private/HtmlElementState.d.ts +3 -1
- package/build/js/private/HtmlElementState.js +1 -1
- package/build/js/private/{AsyncImageConverterBase.d.ts → ImageConverterBase.d.ts} +3 -3
- package/build/js/private/ImageConverterBase.js +1 -0
- package/build/js/private/{AsyncImageConverterMainThread.d.ts → ImageConverterMainThread.d.ts} +3 -3
- package/build/js/private/ImageConverterMainThread.js +1 -0
- package/build/js/private/NormalizedModuleLoaderOptions.d.ts +19 -10
- package/build/js/private/OrientationObserver.d.ts +8 -3
- package/build/js/private/OrientationObserver.js +1 -1
- package/build/js/private/SingleImageUploaderView.d.ts +4 -0
- package/build/js/private/SingleImageUploaderView.js +1 -1
- package/build/js/private/ViewClassNames.d.ts +0 -6
- package/build/js/private/ViewClassNames.js +1 -1
- package/build/js/private/ViewControls+related.js +1 -1
- package/build/js/private/ViewControls_related.d.ts +20 -8
- package/build/js/private/ViewStyles.js +1 -1
- package/build/js/private/ViewsRegistry.d.ts +17 -8
- package/build/js/private/djinni-types/index.d.ts +3 -3
- package/build/js/private/hybridDesktopPlatformHelpers.js +1 -1
- package/build/js/private/multithreadSimdHelper.d.ts +9 -4
- package/build/js/private/multithreadSimdHelper.js +1 -1
- package/build/js/private/ui/atoms/AimerSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/ArrowDownSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/ArrowLeftSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/ArrowRightSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/ArrowUpSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/ArrowsUp.js +1 -1
- package/build/js/private/ui/atoms/Backdrop.js +1 -1
- package/build/js/private/ui/atoms/CalendarExclamationMarkSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/CameraFOVUltrawideSvgIcon.d.ts +17 -0
- package/build/js/private/ui/atoms/CameraFOVUltrawideSvgIcon.js +1 -0
- package/build/js/private/ui/atoms/CameraFOVWideSvgIcon.d.ts +17 -0
- package/build/js/private/ui/atoms/CameraFOVWideSvgIcon.js +1 -0
- package/build/js/private/ui/atoms/CameraSwitchReverseSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/CameraSwitchSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/Card.d.ts +1 -1
- package/build/js/private/ui/atoms/Card.js +1 -1
- package/build/js/private/ui/atoms/CardList.d.ts +1 -1
- package/build/js/private/ui/atoms/CardList.js +1 -1
- package/build/js/private/ui/atoms/CheckSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/ChevronDownSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/ChevronLeftSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/ChevronRightSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/ChevronUpSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/CrossSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/DeleteSvgIcon.d.ts +17 -0
- package/build/js/private/ui/atoms/DeleteSvgIcon.js +1 -0
- package/build/js/private/ui/atoms/Dot5xSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/ExclamationMarkSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/GlassSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/HandLensCheckSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/KeyboardSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/LowStockSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/OnexSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/PrinterSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/ProgressBar.js +1 -1
- package/build/js/private/ui/atoms/QuestionMarkSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/RestartSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/RoundedCheckSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/RoundedCrossSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/RoundedExclamationMarkSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/ShutterButton.js +1 -1
- package/build/js/private/ui/atoms/SlashSvgIcon.d.ts +17 -0
- package/build/js/private/ui/atoms/SlashSvgIcon.js +1 -0
- package/build/js/private/ui/atoms/StarFilledSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/StarHalfFilledSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/StarOutlinedSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/SvgIcon.js +1 -1
- package/build/js/private/ui/atoms/ToPickSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/Toast.d.ts +17 -8
- package/build/js/private/ui/atoms/Toast.js +1 -1
- package/build/js/private/ui/atoms/TorchOffSvgIcon.d.ts +17 -0
- package/build/js/private/ui/atoms/TorchOffSvgIcon.js +1 -0
- package/build/js/private/ui/atoms/TorchOnSvgIcon.d.ts +17 -0
- package/build/js/private/ui/atoms/TorchOnSvgIcon.js +1 -0
- package/build/js/private/ui/atoms/TwoxSvgIcon.js +1 -1
- package/build/js/private/ui/atoms/WrongItemSvgIcon.js +1 -1
- package/build/js/private/ui/colors.d.ts +1 -1
- package/build/js/private/ui/colors.js +1 -1
- package/build/js/private/ui/molecules/ButtonEvents.d.ts +31 -0
- package/build/js/private/ui/molecules/ButtonEvents.js +1 -0
- package/build/js/private/ui/molecules/CameraFOVSwitchButton.d.ts +66 -0
- package/build/js/private/ui/molecules/CameraFOVSwitchButton.js +1 -0
- package/build/js/private/ui/molecules/CameraSwitchButton.d.ts +59 -0
- package/build/js/private/ui/molecules/CameraSwitchButton.js +1 -0
- package/build/js/private/ui/molecules/ControlsLayout.d.ts +22 -0
- package/build/js/private/ui/molecules/ControlsLayout.js +1 -0
- package/build/js/private/ui/molecules/HintPresenter.d.ts +17 -8
- package/build/js/private/ui/molecules/HintPresenter.js +1 -1
- package/build/js/private/ui/molecules/LoadingOverlay.js +1 -1
- package/build/js/private/ui/molecules/TorchSwitchIconButton.d.ts +68 -0
- package/build/js/private/ui/molecules/TorchSwitchIconButton.js +1 -0
- package/build/js/private/utils/index.js +1 -1
- package/build/js/private/utils/polyfillLoader.js +1 -1
- package/build/js/private/utils/quadrilateralUtils.d.ts +2 -1
- package/build/js/private/utils/quadrilateralUtils.js +1 -1
- package/build/js/private/utils/replaceImagesInViewUtils.d.ts +16 -7
- package/build/js/private/utils/warnMultithreadingUnavailable.js +1 -1
- package/build/js/worker/{AsyncImageConverterForwarder.d.ts → ImageConverterForwarder.d.ts} +20 -11
- package/build/js/worker/ImageConverterForwarder.js +1 -0
- package/build/js/worker/{AsyncImageConverterWorker.d.ts → ImageConverterWorker.d.ts} +3 -3
- package/build/js/worker/ImageConverterWorker.js +1 -0
- package/build/js/worker/WorkerMain.d.ts +17 -8
- package/build/js/worker/WorkerMain.js +1 -1
- package/build/js/worker/coreCapture.inlineWorker.d.ts +17 -8
- package/build/js/worker/coreCapture.inlineWorker.js +1 -1
- package/build/js/worker/dataCaptureEngine.d.ts +17 -8
- package/build/js/worker/dataCaptureEngine.js +1 -1
- package/build/js/worker/dataCaptureLoader.d.ts +17 -8
- package/build/js/worker/dataCaptureLoader.js +1 -1
- package/build/js/worker/dataCaptureWorkerRelated.d.ts +17 -8
- package/build/js/worker/index.d.ts +17 -8
- package/build/js/worker/index.js +1 -1
- package/package.json +4 -4
- package/build/js/Camera-CZ0Hl7v2.d.ts +0 -213
- package/build/js/Common.d.ts +0 -231
- package/build/js/Common.js +0 -1
- package/build/js/Defaults.d.ts +0 -139
- package/build/js/Defaults.js +0 -1
- package/build/js/ViewControls.d.ts +0 -54
- package/build/js/ViewControls.js +0 -1
- package/build/js/assets/index.d.d.ts +0 -5
- package/build/js/assets/index.d.ts +0 -5
- package/build/js/assets/index.js +0 -1
- package/build/js/chunks/chunk-25EQ6RFI.js +0 -1
- package/build/js/chunks/chunk-2VNXD4FC.js +0 -1
- package/build/js/chunks/chunk-36CF5U7R.js +0 -1
- package/build/js/chunks/chunk-4GP73VVU.js +0 -97
- package/build/js/chunks/chunk-4Y7Q64OZ.js +0 -1
- package/build/js/chunks/chunk-5N4CQMMU.js +0 -1
- package/build/js/chunks/chunk-5S537AFM.js +0 -1
- package/build/js/chunks/chunk-5TW3OTHU.js +0 -1
- package/build/js/chunks/chunk-7RMPOOYQ.js +0 -1
- package/build/js/chunks/chunk-AKDTQZ73.js +0 -1
- package/build/js/chunks/chunk-AL6GJUID.js +0 -1
- package/build/js/chunks/chunk-B2I3SBRI.js +0 -1
- package/build/js/chunks/chunk-EFFUWK5Z.js +0 -1
- package/build/js/chunks/chunk-EKOWJS3E.js +0 -1
- package/build/js/chunks/chunk-ELQAIHEQ.js +0 -1
- package/build/js/chunks/chunk-FGCJ3ZLG.js +0 -2
- package/build/js/chunks/chunk-FS52JIW4.js +0 -1
- package/build/js/chunks/chunk-GQVOVLRR.js +0 -1
- package/build/js/chunks/chunk-GYSREBEJ.js +0 -1
- package/build/js/chunks/chunk-HLJPVZHK.js +0 -1
- package/build/js/chunks/chunk-HTQSOUB3.js +0 -6
- package/build/js/chunks/chunk-I3U43DWH.js +0 -1
- package/build/js/chunks/chunk-K5B6J4SK.js +0 -1
- package/build/js/chunks/chunk-K7MUTJWB.js +0 -1
- package/build/js/chunks/chunk-KUVVZN66.js +0 -1
- package/build/js/chunks/chunk-MQ6H2ORR.js +0 -1
- package/build/js/chunks/chunk-MTNFYUSF.js +0 -2
- package/build/js/chunks/chunk-PAPLDTB7.js +0 -1
- package/build/js/chunks/chunk-PXPLMVCF.js +0 -1
- package/build/js/chunks/chunk-QDZ6UZHF.js +0 -1
- package/build/js/chunks/chunk-T3DJYPIP.js +0 -18
- package/build/js/chunks/chunk-TB4UKDDI.js +0 -1
- package/build/js/chunks/chunk-TOR7V7M7.js +0 -1
- package/build/js/chunks/chunk-TPQTY3KB.js +0 -1
- package/build/js/chunks/chunk-TQ6K3P2B.js +0 -1
- package/build/js/chunks/chunk-TZ6TWPJD.js +0 -1
- package/build/js/chunks/chunk-UHFABUTI.js +0 -1
- package/build/js/chunks/chunk-UMHCVFPN.js +0 -2
- package/build/js/chunks/chunk-UUD3OXOZ.js +0 -1
- package/build/js/chunks/chunk-VBRTZG3W.js +0 -1
- package/build/js/chunks/chunk-VQ7LLVHQ.js +0 -1
- package/build/js/chunks/chunk-WNFUUIF3.js +0 -1
- package/build/js/chunks/chunk-XVVC3E6G.js +0 -35
- package/build/js/private/AsyncImageConverterBase.js +0 -1
- package/build/js/private/AsyncImageConverterMainThread.js +0 -1
- package/build/js/worker/AsyncImageConverterForwarder.js +0 -1
- package/build/js/worker/AsyncImageConverterWorker.js +0 -1
- /package/build/js/{assets/index.d.js → chunks/chunk-ATTDETQP.js} +0 -0
- /package/build/js/chunks/{chunk-5RW5274G.js → chunk-BUKZPAC5.js} +0 -0
- /package/build/js/chunks/{chunk-GZMB3TRK.js → chunk-GHDJPETZ.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a as a$8}from'./chunk-5C4OO6CX.js';import {a as a$7}from'./chunk-DZKZ6RMW.js';import {d}from'./chunk-AFCJ24Y3.js';import {a as a$4}from'./chunk-E4XJ4GKD.js';import {a as a$6}from'./chunk-QOCHMKNY.js';import {a as a$5}from'./chunk-KAFNKP6O.js';import {a as a$1}from'./chunk-ZKROZLQ4.js';import {b as b$1}from'./chunk-FTD535WI.js';import {a}from'./chunk-R6E4CT22.js';import {a as a$9}from'./chunk-4BP7D26M.js';import {b}from'./chunk-VBUDN72N.js';import {a as a$2}from'./chunk-XR65N6EG.js';import {a as a$3}from'./chunk-QCZSSQAQ.js';var P=(a=>(a.CONTINUOUS="continuous",a.MANUAL="manual",a.NONE="none",a.SINGLE_SHOT="single-shot",a))(P||{}),F=(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))(F||{}),x=(t=>(t.CAMERA_PROPERTIES="cameraProperties",t.CAMERA_ACCESS_ERROR="cameraAccessError",t))(x||{}),o=class o{constructor(){this.constraint=4;this.checkCameraVideoStreamAccessIfVisibleListener=this.checkCameraVideoStreamAccessIfVisible.bind(this);this.handleWebGLContextLostListener=this.handleWebGLContextLost.bind(this);this.listeners=new Map;this.mirrorImageOverrides=new Map;this.postStreamInitializationListener=this.postStreamInitialization.bind(this);this.triggerManualFocusListener=this.triggerManualFocus.bind(this);this.triggerZoomMoveListener=this.triggerZoomMove.bind(this);this.triggerZoomStartListener=this.triggerZoomStart.bind(this);this.videoResizeListener=a(this.handleVideoResize.bind(this),500);this.videoTrackEndedListener=this.videoTrackEndedRecovery.bind(this);this.videoTrackMuteListener=this.videoTrackMuteRecovery.bind(this);this._synchronousFrameHandling=false;this._glFrameReaders={GRAYSCALE:null,RGBA:null};this._frameReaderType="RGBA";this.isVideoStreamPaused=false;this.handleVideoPauseHandler=this.handleVideoPause.bind(this);this.cameraPosition="worldFacing",this.gui={isCameraRecoveryVisible:()=>false,setCameraRecoveryVisible:()=>{}},this.isWebGLSupported=!b.checkBrowserCompatibility().missingFeatures.includes("webGL"),this.videoElement=document.createElement("video"),this.videoElement.autoplay=true,this.videoElement.playsInline=true,this.videoElement.muted=true,this.videoElement.style.opacity="0",this.videoElement.poster=a$1,this.canvas=document.createElement("canvas"),this.canvas.addEventListener("webglcontextlost",this.handleWebGLContextLostListener);}get mediaStream(){return this._mediaStream}set mediaStream(e){this._mediaStream=e,e&&(this.mediaTrackCapabilitiesPromise=new Promise(t=>{this.mediaTrackCapabilitiesPromiseResolver=t;}));}get synchronousFrameHandling(){return this._synchronousFrameHandling}get canvas2dContext(){return this._canvas2dContext||(this._canvas2dContext=this.canvas.getContext("2d",{willReadFrequently:true}),this._canvas2dContext==null&&a$2.warn("Unable to get 2d canvas context"),this.handleVideoResize()),this._canvas2dContext}get canvasWebGLContext(){var e;if(!this._canvas2dContext&&!this._canvasWebGLContext){if(!this.isWebGLSupported){a$2.warn("WebGL context not supported, falling back to 2d canvas context. This may impact the scanning performance.");return}let t=(e=this.canvas.getContext("webgl",{alpha:false,antialias:false}))!=null?e:this.canvas.getContext("experimental-webgl",{alpha:false,antialias:false});t!=null&&(this._canvasWebGLContext=t,this.handleVideoResize());}return this._canvasWebGLContext}static instance(){return o._instance==null&&(o._instance=new o),o._instance}recycle(e){var t;(t=this.getFrameReader())==null||t.recycle(e);}getCurrentFrame(){var e;return (e=this._glFrameReaders.RGBA)==null?void 0:e.readFromSource(this.videoElement)}requestVideoFrame(e,t=this.videoElement){return "requestVideoFrameCallback"in HTMLVideoElement.prototype?t.requestVideoFrameCallback(e):requestAnimationFrame(e)}cancelVideoFrame(e,t=this.videoElement){if("cancelVideoFrameCallback"in HTMLVideoElement.prototype){t.cancelVideoFrameCallback(e);return}cancelAnimationFrame(e);}addListener(e,t){var a;let i=(a=this.listeners.get(e))!=null?a:[];i.includes(t)||this.listeners.set(e,[...i,t]);}async applyCameraSettings(e){if(this.selectedCameraSettings=e,this.activeCamera==null)throw new a$3(o.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$3(o.noCameraErrorParameters);return this.setSelectedCamera(e),this.selectedCameraSettings=t,this.activeCameraSettings=t,this.cameraInitializationPromise=this.initializeCameraAndCheckUpdatedSettings(e),this.cameraInitializationPromise}isMirrorImageEnabled(){if(this.selectedCamera&&this.activeCamera){let e=this.mirrorImageOverrides.get(this.activeCamera);return e!=null?e:this.activeCamera.position==="userFacing"}return false}isPinchToZoomEnabled(){return this.pinchToZoomEnabled}isTapToFocusEnabled(){return this.tapToFocusEnabled}async isTorchAvailable(){var e;return this.mediaStream?(await this.waitForCapabilities(),((e=this.mediaTrackCapabilities)==null?void 0:e.torch)===true):false}async playVideo(){return new Promise(e=>{this._canvas2dContext&&this._canvas2dContext.clearRect(0,0,this.canvas.width,this.canvas.height);let t=this.videoElement.play();t==null?e():t.then(e).catch(()=>{e();});})}async reinitializeCamera(){if(this.activeCamera==null)a$2.debug("Camera reinitialization delayed");else {a$2.debug("Reinitialize camera:",this.activeCamera);try{let e=this.activeCamera;await this.stopStream(),await this.initializeCameraWithSettings(e,this.activeCameraSettings);}catch(e){throw a$2.warn("Couldn't access camera:",this.activeCamera,e),this.emit("cameraAccessError",e),e}}}removeListener(e,t){var s;let a=((s=this.listeners.get(e))!=null?s:[]).filter(n=>n!==t);this.listeners.set(e,a);}async setCameraPosition(e){var i;this.setInitialCameraPosition(e);let t=d.getMainCameraForPosition(await d.getCameras(),e);if(t&&t.deviceId!==((i=this.selectedCamera)==null?void 0:i.deviceId))return this.initializeCameraWithSettings(t,this.selectedCameraSettings)}async setExposure(e){var a,s,n,c,d,l,v,p;let t=(s=(a=this.mediaStream)==null?void 0:a.getVideoTracks())!=null?s:[];if(t.length===0||typeof t[0].applyConstraints!="function")return;await this.waitForCapabilities();let i=e.time!=null&&e.time>0?"manual":"continuous";if(((c=(n=this.mediaTrackCapabilities)==null?void 0:n.exposureMode)==null?void 0:c.includes(i))===true){if(await t[0].applyConstraints({advanced:[{exposureMode:i}]}),e.time!=null&&e.time>0&&this.mediaTrackCapabilities.exposureTime){let u=Math.max((d=this.mediaTrackCapabilities.exposureTime.min)!=null?d:.01,Math.min(e.time,(l=this.mediaTrackCapabilities.exposureTime.max)!=null?l:1e5));await t[0].applyConstraints({advanced:[{exposureTime:u}]});}else if(e.compensation!=null&&i==="continuous"&&this.mediaTrackCapabilities.exposureCompensation){let u=Math.max((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:u}]});}}}async setFocus(e){var i,a,s,n,c;if(!this.mediaStream)return;let t=this.mediaStream.getVideoTracks();if(t.length>0&&typeof t[0].applyConstraints=="function"){await this.waitForCapabilities();let d=e>=0?"manual":"continuous";if(((a=(i=this.mediaTrackCapabilities)==null?void 0:i.focusMode)==null?void 0:a.includes(d))===true&&(await t[0].applyConstraints({advanced:[{focusMode:d}]}),d==="manual"&&this.mediaTrackCapabilities.focusDistance)){let l=Math.max(0,Math.min(e,1))*(((s=this.mediaTrackCapabilities.focusDistance.max)!=null?s:1e3)-((n=this.mediaTrackCapabilities.focusDistance.min)!=null?n:.01))+((c=this.mediaTrackCapabilities.focusDistance.min)!=null?c:.01);await t[0].applyConstraints({advanced:[{focusDistance:l}]});}}}async setFrameRate(e){var t,i,a;if(this.mediaStream&&(await this.waitForCapabilities(),(t=this.mediaTrackCapabilities)!=null&&t.frameRate)){let s=this.mediaStream.getVideoTracks();if(s.length>0&&typeof s[0].applyConstraints=="function"){let n=Math.min((i=this.mediaTrackCapabilities.frameRate.max)!=null?i:240,(a=e.max)!=null?a:240);await s[0].applyConstraints({advanced:[{frameRate:n}]});}}}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(o.MIRRORED_CLASS_NAME),this.canvas.classList.add(o.MIRRORED_CLASS_NAME)):(this.videoElement.classList.remove(o.MIRRORED_CLASS_NAME),this.canvas.classList.remove(o.MIRRORED_CLASS_NAME)),t&&this.mirrorImageOverrides.set(this.selectedCamera,e));}setPinchToZoomEnabled(e){this.pinchToZoomEnabled=e,this.mediaStream&&(this.pinchToZoomEnabled?this.enablePinchToZoomListeners():this.disablePinchToZoomListeners());}setSelectedCamera(e){this.selectedCamera=e;}setSelectedCameraSettings(e){this.selectedCameraSettings=e;}setTapToFocusEnabled(e){this.tapToFocusEnabled=e,this.mediaStream&&(this.tapToFocusEnabled?this.enableTapToFocusListeners():this.disableTapToFocusListeners());}async setTorchEnabled(e){var t;if(this.mediaStream&&((t=this.mediaTrackCapabilities)==null?void 0:t.torch)===true){this.torchEnabled=e;let i=this.mediaStream.getVideoTracks();i.length>0&&typeof i[0].applyConstraints=="function"&&await i[0].applyConstraints({advanced:[{torch:e}]});}}async setZoom(e){var t,i,a;if(this.mediaStream&&(await this.waitForCapabilities(),(t=this.mediaTrackCapabilities)!=null&&t.zoom)){let s=this.mediaStream.getVideoTracks();if(s.length>0&&typeof s[0].applyConstraints=="function"){let n=Math.max((i=this.mediaTrackCapabilities.zoom.min)!=null?i:1,Math.min(e,(a=this.mediaTrackCapabilities.zoom.max)!=null?a:16));await s[0].applyConstraints({advanced:[{zoom:n}]});}}}async setupCameras(){if(this.cameraSetupPromise)return this.cameraSetupPromise;let e=this.isVideoStreamPaused;return this.cameraSetupPromise=this.setupCamerasAndStream(),this.cameraSetupPromise.then(()=>{e||(this.isVideoStreamPaused=false);})}pauseStream(){if(this.mediaStream){for(let e of this.mediaStream.getVideoTracks())e.enabled=false;this.isVideoStreamPaused=true,a$2.debug("Paused camera video stream",this.mediaStream);}}resumeStream(){if(this.mediaStream){for(let e of this.mediaStream.getVideoTracks())e.enabled=true;this.isVideoStreamPaused=false,a$2.debug("Resumed camera video stream",this.mediaStream);}}async stopStream(e=false){this.activeCamera&&(this.activeCamera.currentResolution=void 0),this.activeCamera=void 0,this.torchEnabled=false,this.isVideoStreamPaused=false,this.mediaStream&&(a$2.debug(`Stop camera video stream access${e?" (abort access detection)":""}:`,this.mediaStream),a$2.debug("Stopping camera video stream access",this.mediaStream),document.removeEventListener("visibilitychange",this.checkCameraVideoStreamAccessIfVisibleListener),window.clearTimeout(this.cameraAccessTimeout),window.clearInterval(this.videoMetadataCheckInterval),window.clearTimeout(this.getCapabilitiesTimeout),window.clearTimeout(this.manualFocusWaitTimeout),window.clearTimeout(this.manualToAutofocusResumeTimeout),window.clearInterval(this.autofocusInterval),this.videoElement.pause(),await new Promise(t=>{setTimeout(()=>{var i,a,s;for(let n of (a=(i=this.mediaStream)==null?void 0:i.getVideoTracks())!=null?a:[])n.removeEventListener("ended",this.videoTrackEndedListener),n.stop();this.videoElement.srcObject=null,this._canvas2dContext&&this._canvas2dContext.clearRect(0,0,this.canvas.width,this.canvas.height),this.mediaStream=void 0,this.mediaTrackCapabilities=void 0,this.mediaTrackCapabilitiesPromise=void 0,this.mediaTrackCapabilitiesPromiseResolver=void 0,e||(s=this.abortedCameraInitializationResolveCallback)==null||s.call(this),t();},0);}));}stopVideoTracks(){if(this.mediaStream!=null)for(let e of this.mediaStream.getVideoTracks())e.stop();}async toggleTorch(){this.torchEnabled=!this.torchEnabled,await this.setTorchEnabled(this.torchEnabled);}updateCanvasVideoImage(){this.canvas2dContext.drawImage(this.videoElement,0,0);}async waitForCapabilities(){var e;return (e=this.mediaTrackCapabilitiesPromise)!=null?e:Promise.resolve()}setFrameReaderType(e){e!==this._frameReaderType&&(this._frameReaderType=e,a$2.log(a$2.Level.Debug,`Change frame reader type to ${this._frameReaderType} mode`));}async allowPictureInPicture(e){e?(this.videoElement.disablePictureInPicture=false,this.videoElement.removeAttribute("controlslist"),this.videoElement.removeAttribute("disablepictureinpicture")):(this.videoElement.disablePictureInPicture=true,this.videoElement.setAttribute("controlslist","nodownload"),this.videoElement.setAttribute("disablepictureinpicture","true")),await this.reinitializeCamera();}setFrameHandling(e){var t;this._synchronousFrameHandling=e,this._frameReaderOptions=this.getFrameReaderOptions(e),(t=this._glFrameReaders[this._frameReaderType])==null||t.dispose(),delete this._glFrameReaders[this._frameReaderType];}async setClipArea(e){if(this.activeCamera&&this.isVideoAndContextStateValid()){this.clipArea=e?this.frameRectFromViewRect(e):void 0,await this.initializeStreamForResolution(this.activeCamera,this.constraint,this.isVideoStreamPaused);return}this.clipArea=e;}frameRectFromViewRect(e){let t=this.videoElement.videoWidth/this.videoElement.clientWidth||1,i=this.videoElement.videoHeight/this.videoElement.clientHeight||1;return new a$4(new a$5(e.origin.x*t,e.origin.y*i),new a$6(e.size.width*t,e.size.height*i))}async accessAutoselectedCamera(e){let t=d.sortCamerasForCameraPosition(e,this.cameraPosition),i=t.shift();for(;i;)try{await this.initializeCameraWithSettings(i,this.selectedCameraSettings);return}catch(a){if(this.setSelectedCamera(),t.length>0){a$2.log(a$2.Level.Warn,"Couldn't access camera:",i,a),i=t.shift();continue}throw a}throw new a$3(o.noCameraErrorParameters)}getFrameReaderOptions(e){return e?{minPoolCapacity:0,maxPoolCapacity:1}:b.isDesktopDevice()?{maxPoolCapacity:2,minPoolCapacity:1}:{maxPoolCapacity:10,minPoolCapacity:3}}getFrameReader(){var t;if(this._glFrameReaders[this._frameReaderType])return this._glFrameReaders[this._frameReaderType];if(!this._canvasWebGLContext)return null;let e=(t=this._frameReaderOptions)!=null?t:this.getFrameReaderOptions(this._synchronousFrameHandling);switch(this._frameReaderType){case "GRAYSCALE":{this._glFrameReaders.GRAYSCALE=new a$8(this._canvasWebGLContext,e),this._glFrameReaders.RGBA=new a$7(this._canvasWebGLContext,{minPoolCapacity:1,maxPoolCapacity:2});break}case "RGBA":{this._glFrameReaders.RGBA=new a$7(this._canvasWebGLContext,e);break}default:b$1(this._frameReaderType);}return a$2.debug(`Created frame reader ${this._frameReaderType}`,e),this._glFrameReaders[this._frameReaderType]}async accessInitialCamera(){let e={position:this.cameraPosition,deviceId:"",label:""};try{await this.initializeCameraWithSettings(e,this.selectedCameraSettings);}catch{}finally{this.setSelectedCamera();}return e}recreateCanvas(){this.canvas.removeEventListener("webglcontextlost",this.handleWebGLContextLostListener),this._canvasWebGLContext=void 0,this._canvas2dContext=void 0;for(let t of Object.values(this._glFrameReaders))t==null||t.dispose();let e=document.createElement("canvas");e.addEventListener("webglcontextlost",this.handleWebGLContextLostListener),e.width=this.canvas.width,e.height=this.canvas.height,e.className=this.canvas.className,this.canvas=e;}captureImageFor2dContext(){if(!this.isVideoAndContextStateValid())return null;let{width:e,height:t}=this.canvas;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:true}captureImageForWebGLContext(){if(!this.isVideoAndContextStateValid()||!this.canvasWebGLContext||this.canvasWebGLContext.drawingBufferWidth<=2||this.canvasWebGLContext.drawingBufferHeight<=2||this.areVideoAndWebGLSizeMismatching()||this.getFrameReader()==null)return null;let e=this.getFrameReader().readFromSource(this.videoElement);if(e.data[3]!==255&&e.colorType==="RGBA"){if(a$2.log(a$2.Level.Warn,"Detected incorrect GPU accelerated WebGL image processing, switching to canvas mode"),this.recreateCanvas(),this.canvas2dContext==null)throw new Error("Unable to get 2d canvas context");return this.captureImage()}return e}async checkCameraAccess(e){return new Promise((t,i)=>{this.cameraAccessRejectCallback=a=>{a$2.log(a$2.Level.Debug,"Camera video stream access failure (video data load timeout):",e),this.gui.setCameraRecoveryVisible(true),i(a);},this.setCameraAccessTimeout();})}checkCameraVideoStreamAccessIfVisible(){document.visibilityState==="visible"&&(a$2.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$2.log(a$2.Level.Debug,"Camera video stream access success:",e),t();return}let a=performance.now();window.clearInterval(this.videoMetadataCheckInterval),this.videoMetadataCheckInterval=window.setInterval(async()=>{if(this.videoElement.videoWidth<=2||this.videoElement.videoHeight<=2||this.videoElement.currentTime===0){if(performance.now()-a>o.videoMetadataCheckTimeoutMs){a$2.log(a$2.Level.Warn,"Camera video stream access failure (valid video metadata timeout):",e),window.clearInterval(this.videoMetadataCheckInterval),await this.stopStream(true),i(new a$3(o.notReadableErrorParameters));return}return}window.clearInterval(this.videoMetadataCheckInterval),this.updateActiveCameraCurrentResolution(e),a$2.log(a$2.Level.Debug,"Camera video stream access success:",e),t();},o.videoMetadataCheckIntervalMs);};})}disablePinchToZoomListeners(){this.videoElement.removeEventListener("touchstart",this.triggerZoomStartListener),this.videoElement.removeEventListener("touchmove",this.triggerZoomMoveListener);}disableTapToFocusListeners(){for(let e of ["touchend","mousedown"])this.videoElement.removeEventListener(e,this.triggerManualFocusListener);}emit(e,t){var a;let i=(a=this.listeners.get(e))!=null?a:[];for(let s of i)s(t);}enablePinchToZoomListeners(){this.videoElement.addEventListener("touchstart",this.triggerZoomStartListener),this.videoElement.addEventListener("touchmove",this.triggerZoomMoveListener);}enableTapToFocusListeners(){for(let e of ["touchend","mousedown"])this.videoElement.addEventListener(e,this.triggerManualFocusListener);}getActiveCamera(e,t,i){return e.length===1?e[0]:e.find(a=>a.deviceId===i||a.label!==""&&a.label===t)}getInitialCameraResolutionConstraint(e){var i;let t;switch((i=this.activeCameraSettings)==null?void 0:i.preferredResolution){case "uhd4k":{t=0;break}case "fullHd":{t=1;break}default:{t=2;break}}return t}async handleCameraInitializationError(e,t,i){if(!["OverconstrainedError","NotReadableError"].includes(i.name)||i.name==="NotReadableError"&&t===4)throw a$2.log(a$2.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$2.log(a$2.Level.Warn,"Camera video stream access failure (no camera with such type error)",e,i),i;a$2.log(a$2.Level.Warn,"Detected non-existent deviceId error, attempt to find and reaccess updated camera",e,i);let a=e.deviceId;if(await d.getCameras(true),a===e.deviceId)throw a$2.log(a$2.Level.Warn,"Camera video stream access failure (updated camera not found after non-existent deviceId error)",e,i),d.markCameraAsInaccessible(e),i;return a$2.log(a$2.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$2.log(a$2.Level.Warn,"WebGL context has been lost, restoring..."),this._canvasWebGLContext=void 0,this.canvasWebGLContext?(this.handleVideoResize(),a$2.log(a$2.Level.Warn,"WebGL context restored")):a$2.log(a$2.Level.Error,"WebGL context restore failed");}async initializeCameraAndCheckUpdatedSettings(e){var t,i,a,s,n;try{if(await this.initializeCameraForResolution(e),this.selectedCameraSettings!==this.activeCameraSettings&&(this.selectedCameraSettings==null||this.activeCameraSettings==null||Object.keys(this.selectedCameraSettings).some(u=>{var b,f;return ((b=this.selectedCameraSettings)==null?void 0:b[u])!==((f=this.activeCameraSettings)==null?void 0:f[u])}))){this.activeCameraSettings=this.selectedCameraSettings,await this.initializeCameraAndCheckUpdatedSettings(e);return}this.activeCameraSettings&&this.activeCameraSettings.zoomFactor>1&&await this.setZoom(this.activeCameraSettings.zoomFactor);let c=(t=this.activeCameraSettings)==null?void 0:t.getProperty("minFrameRate"),d=(i=this.activeCameraSettings)==null?void 0:i.getProperty("maxFrameRate");(c!=null||d!=null)&&await this.setFrameRate({min:c,max:d});let l=(a=this.activeCameraSettings)==null?void 0:a.getProperty("manualLensPosition");l!=null&&await this.setFocus(l);let v=(s=this.activeCameraSettings)==null?void 0:s.getProperty("exposureTargetBias"),p=(n=this.activeCameraSettings)==null?void 0:n.getProperty("exposureDuration");(v!=null||p!=null)&&await this.setExposure({compensation:v,time:p});}finally{this.cameraInitializationPromise=void 0;}}async initializeCameraForResolution(e,t){var i;this.gui.setCameraRecoveryVisible(false),this.constraint=t!=null?t:this.getInitialCameraResolutionConstraint(e),this.mediaStream!=null&&e.deviceId!==""&&((i=this.activeCamera)==null?void 0:i.deviceId)===e.deviceId?await(b.isIPhone()?this.initializeStreamForResolution(e,this.constraint):this.updateStreamForResolution(e,this.constraint)):await this.initializeStreamForResolution(e,this.constraint);}async initializeStreamForResolution(e,t,i=false){var a;await this.stopStream();try{let s=(a=this.activeCameraSettings)==null?void 0:a.getProperty("preferredAspectRatio"),n=await d.accessCameraStream(e,t,s),c=await this.clipMediaStreamIfNeeded(n);if(a$2.log(a$2.Level.Debug,"Camera accessed, waiting for camera video stream start..."),typeof c.getVideoTracks()[0].getSettings=="function"){let d=c.getVideoTracks()[0].getSettings();if(d.width!=null&&d.height!=null&&(d.width===2||d.height===2)){if(a$2.log(a$2.Level.Debug,"Camera video stream access failure (invalid video metadata):",e),t===4)throw new a$3(o.notReadableErrorParameters);return await this.stopStream(),this.initializeStreamForResolution(e,t+1)}}this.mediaStream=c,i&&this.pauseStream();for(let d of this.mediaStream.getVideoTracks())d.addEventListener("ended",this.videoTrackEndedListener),d.addEventListener("mute",this.videoTrackMuteListener),d.addEventListener("unmute",this.videoTrackMuteListener);try{await this.setupCameraStreamVideo(e,c);}catch(d){if(t===4)throw d;return this.initializeStreamForResolution(e,t+1)}}catch(s){return this.handleCameraInitializationError(e,t,s)}}isVideoAndContextStateValid(){return this.videoElement.readyState===4&&this.videoElement.videoWidth>2&&this.videoElement.videoHeight>2&&this.canvas.width>2&&this.canvas.height>2}postStreamInitialization(){window.clearTimeout(this.getCapabilitiesTimeout),this.getCapabilitiesTimeout=window.setTimeout(()=>{this.storeStreamCapabilities(),this.setupAutofocus();},o.getCapabilitiesTimeoutMs);}async recoverStreamIfNeeded(){var t,i;let e=(t=this.mediaStream)==null?void 0:t.getVideoTracks();((i=e==null?void 0:e[0])==null?void 0:i.readyState)==="ended"&&await this.reinitializeCamera();}reportCameraProperties(e,t,i=true){this.emit("cameraProperties",{deviceId:e,isFrontFacing:t==="userFacing",hasAutofocus:i});}setCameraAccessTimeout(){window.clearTimeout(this.cameraAccessTimeout),this.cameraAccessTimeout=window.setTimeout(async()=>{var e;document.visibilityState==="visible"?(await this.stopStream(true),(e=this.cameraAccessRejectCallback)==null||e.call(this,new a$3(o.notReadableErrorParameters))):(a$2.debug("Page is currently not visible, delay camera video stream access detection"),document.addEventListener("visibilitychange",this.checkCameraVideoStreamAccessIfVisibleListener));},o.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),o.autofocusIntervalMs));}}async setupCameraStreamVideo(e,t){this.videoElement.addEventListener("loadedmetadata",this.postStreamInitializationListener),this.videoElement.addEventListener("resize",this.videoResizeListener),this.tapToFocusEnabled&&this.enableTapToFocusListeners(),this.pinchToZoomEnabled&&this.enablePinchToZoomListeners();let i=Promise.race([this.checkCameraAccess(e),this.checkVideoMetadata(e),new Promise(a=>{this.abortedCameraInitializationResolveCallback=a;})]);return this.videoElement.srcObject=t,this.videoElement.load(),await this.playVideo(),this.handleVideoResize(),this.reportCameraProperties(e.deviceId,e.position),i}async setupCamerasAndStream(){var e,t;try{let i;this.selectedCamera==null&&(i=await this.accessInitialCamera());let a=await d.getCameras(false,true),s=(t=(e=this.mediaStream)==null?void 0:e.getVideoTracks()[0])==null?void 0:t.getSettings().deviceId;if(this.mediaStream&&i){let n=this.getActiveCamera(a,i.label,s);if(n){if(d.adjustCameraFromMediaStream(this.mediaStream,n),b.isDesktopDevice()&&(d.setMainCameraForPositionOverridesOnDesktop(this.cameraPosition,n),d.setMainCameraForPositionOverridesOnDesktop(n.position,n)),a.length===1||d.getMainCameraForPosition(a,this.cameraPosition)===n){a$2.debug("Initial camera access was correct (main camera), keep camera:",n),this.setSelectedCamera(n),this.updateActiveCameraCurrentResolution(n),await this.recoverStreamIfNeeded();return}a$2.debug("Initial camera access was incorrect (not main camera), change camera",{...i,deviceId:s});}else a$2.debug("Initial camera access was incorrect (unknown camera), change camera",{...i,deviceId:s});}if(this.selectedCamera==null){await this.accessAutoselectedCamera(a);return}await this.initializeCameraWithSettings(this.selectedCamera,this.selectedCameraSettings);}finally{this.cameraSetupPromise=void 0;}}storeStreamCapabilities(){var e;if(this.mediaStream){let t=this.mediaStream.getVideoTracks();t.length>0&&typeof t[0].getCapabilities=="function"&&(this.mediaTrackCapabilities=t[0].getCapabilities()),this.mediaTrackCapabilitiesPromiseResolver&&this.mediaTrackCapabilitiesPromiseResolver();}this.activeCamera&&this.reportCameraProperties(this.activeCamera.deviceId,this.activeCamera.position,((e=this.mediaTrackCapabilities)==null?void 0:e.focusMode)==null||this.mediaTrackCapabilities.focusMode.includes("continuous"));}async triggerAutoFocus(){await this.triggerFocusMode("single-shot");}async triggerFocusMode(e){if(this.mediaStream){let t=this.mediaStream.getVideoTracks();if(t.length>0&&typeof t[0].applyConstraints=="function")try{await t[0].applyConstraints({advanced:[{focusMode:e}]});}catch{}}}async triggerManualFocus(e){if(e){if(e.preventDefault(),e.type==="touchend"&&e.touches.length>0)return;if(this.pinchToZoomDistance!=null){this.pinchToZoomDistance=void 0;return}}if(window.clearTimeout(this.manualFocusWaitTimeout),window.clearTimeout(this.manualToAutofocusResumeTimeout),!this.mediaStream||!this.mediaTrackCapabilities)return;let t=this.mediaTrackCapabilities.focusMode;Array.isArray(t)&&t.includes("single-shot")&&(t.includes("continuous")&&t.includes("manual")?await this.triggerManualFocusForContinuous():t.includes("continuous")||await this.triggerManualFocusForSingleShot());}async triggerManualFocusForContinuous(){var i;if(!this.mediaStream)return;this.manualToAutofocusResumeTimeout=window.setTimeout(async()=>{await this.triggerFocusMode("continuous");},o.manualToAutofocusResumeTimeoutMs);let e=true,t=this.mediaStream.getVideoTracks();t.length>0&&typeof t[0].getConstraints=="function"&&(e=((i=t[0].getConstraints().advanced)==null?void 0:i.some(a=>a.focusMode==="manual"))===true),e?(await this.triggerFocusMode("continuous"),this.manualFocusWaitTimeout=window.setTimeout(async()=>{await this.triggerFocusMode("manual");},o.manualFocusWaitTimeoutMs)):await this.triggerFocusMode("manual");}async triggerManualFocusForSingleShot(){window.clearInterval(this.autofocusInterval),this.manualToAutofocusResumeTimeout=window.setTimeout(()=>{this.autofocusInterval=window.setInterval(this.triggerAutoFocus.bind(this),o.autofocusIntervalMs);},o.manualToAutofocusResumeTimeoutMs);try{await this.triggerFocusMode("single-shot");}catch{}}async triggerZoomMove(e){this.pinchToZoomDistance==null||(e==null?void 0:e.touches.length)!==2||e.preventDefault();}triggerZoomStart(e){var a,s,n,c;if((e==null?void 0:e.touches.length)!==2||(e.preventDefault(),this.pinchToZoomDistance=Math.hypot((e.touches[1].screenX-e.touches[0].screenX)/screen.width,(e.touches[1].screenY-e.touches[0].screenY)/screen.height),!this.mediaStream||!((a=this.mediaTrackCapabilities)!=null&&a.zoom)))return;let t=this.mediaStream.getVideoTracks();if(t.length===0||typeof t[0].getConstraints!="function")return;this.pinchToZoomInitialZoom=(s=this.mediaTrackCapabilities.zoom.min)!=null?s:1;let i=t[0].getConstraints();if(i.advanced){let d=(n=i.advanced.find(l=>"zoom"in l))==null?void 0:n.zoom;d!=null&&(this.pinchToZoomInitialZoom=typeof d=="number"?d:(c=d.ideal)!=null?c:1);}}updateActiveCameraCurrentResolution(e){this.videoElement.videoWidth>2&&this.videoElement.videoHeight>2&&(e.currentResolution={width:this.videoElement.videoWidth,height:this.videoElement.videoHeight}),e.deviceId!==""&&(this.activeCamera=e,this.setMirrorImageEnabled(this.isMirrorImageEnabled(),false));}async updateStreamForResolution(e,t){var i;if(this.mediaStream==null)await this.initializeCameraForResolution(e,t);else try{let a=(i=this.activeCameraSettings)==null?void 0:i.getProperty("preferredAspectRatio");a$2.debug("Setting new resolution for active camera video stream..."),await this.mediaStream.getVideoTracks()[0].applyConstraints(d.getUserMediaVideoParameters(t,a)),await new Promise(n=>{this.videoElement.addEventListener("timeupdate",()=>{n();},{once:true});});let s=this.mediaStream.getVideoTracks()[0].getSettings();a$2.debug("New active camera video stream resolution set",{width:s.width,height:s.height});}catch(a){if(t===4)throw a;await this.updateStreamForResolution(e,t+1);}}async videoTrackEndedRecovery(){if(document.visibilityState==="visible")try{a$2.debug('Detected video track "ended" event, try to reinitialize camera'),await this.reinitializeCamera();}catch{}else a$2.debug("Page is currently not visible, delay camera reinitialization until visible"),document.addEventListener("visibilitychange",this.checkCameraVideoStreamAccessIfVisibleListener);}videoTrackMuteRecovery(e){if(this.videoElement.onloadeddata!=null){a$2.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$2.debug(`Detected video track "${e.type}" event, ${t?"enable":"disable"} camera recovery`),this.gui.setCameraRecoveryVisible(t));}async clipMediaStreamIfNeeded(e){if(!this.clipArea)return e;let t=this.videoElement.cloneNode();t.srcObject=e,t.load();let i=document.createElement("canvas");i.width=this.clipArea.size.width,i.height=this.clipArea.size.height;let a=i.getContext("2d",{alpha:false,willReadFrequently:false});return a?(t.addEventListener("play",this.drawClippedFrame.bind(this,this.clipArea,t,a),{once:true}),t.addEventListener("pause",this.cleanupClippedStream.bind(this,t),{once:true}),await t.play(),i.captureStream()):e}drawClippedFrame(e,t,i){i.drawImage(t,e.origin.x,e.origin.y,e.size.width,e.size.height,0,0,e.size.width,e.size.height),this.clippedFrameRequestID=this.requestVideoFrame(this.drawClippedFrame.bind(this,e,t,i),t);}cleanupClippedStream(e){this.clippedFrameRequestID&&(this.cancelVideoFrame(this.clippedFrameRequestID,e),this.clippedFrameRequestID=void 0);}connectedCallback(e){e.replaceWith(this.videoElement),this.canvas.addEventListener("webglcontextlost",this.handleWebGLContextLostListener),this.videoElement.addEventListener("pause",this.handleVideoPauseHandler),this.playVideo();}disconnectedCallback(){this.canvas.removeEventListener("webglcontextlost",this.handleWebGLContextLostListener),this.videoElement.removeEventListener("pause",this.handleVideoPauseHandler),this.videoElement.remove(),this.videoElement.removeAttribute("width"),this.videoElement.removeAttribute("height"),this.videoElement.style.removeProperty("visibility");}getVideoElement(){return this.videoElement}handleVideoPause(){this.playVideo();}};o.autofocusIntervalMs=1500,o.cameraAccessTimeoutMs=4e3,o.getCapabilitiesTimeoutMs=500,o.manualFocusWaitTimeoutMs=400,o.manualToAutofocusResumeTimeoutMs=5e3,o.noCameraErrorParameters={name:"NoCameraAvailableError",message:"No camera available"},o.notReadableErrorParameters={name:"NotReadableError",message:"Could not initialize camera correctly"},o.videoMetadataCheckIntervalMs=50,o.videoMetadataCheckTimeoutMs=4e3,o.MIRRORED_CLASS_NAME=a$9.MIRRORED_CLASS_NAME,o._instance=null;var k=o;export{P as a,F as b,x as c,k as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-GPJEB376.js';import {b}from'./chunk-VBUDN72N.js';import {a as a$1}from'./chunk-XR65N6EG.js';import {a as a$2}from'./chunk-QCZSSQAQ.js';var J=(C=>(C.WorldFacing="worldFacing",C.UserFacing="userFacing",C))(J||{}),Q=(c=>(c[c.ULTRA_HD=0]="ULTRA_HD",c[c.FULL_HD=1]="FULL_HD",c[c.HD=2]="HD",c[c.SD=3]="SD",c[c.NONE=4]="NONE",c))(Q||{}),ee=(v=>(v.AUTO="auto",v.FOUR_TO_THREE="fourToThree",v.SIXTEEN_TO_NINE="sixteenToNine",v))(ee||{}),T;(s=>{let P=new Map([["DeviceCaptureError","AbortError"],["NotSupportedError","AbortError"],["ScreenCaptureError","AbortError"],["TabCaptureError","AbortError"],["TypeError","AbortError"],["InvalidStateError","NotAllowedError"],["MediaDeviceFailedDueToShutdown","NotAllowedError"],["MediaDeviceKillSwitchOn","NotAllowedError"],["PermissionDeniedError","NotAllowedError"],["PermissionDismissedError","NotAllowedError"],["DevicesNotFoundError","NotFoundError"],["SourceUnavailableError","NotReadableError"],["TrackStartError","NotReadableError"],["ConstraintNotSatisfiedError","OverconstrainedError"]]),x=["rear","back","r\xFCck","arri\xE8re","trasera","tr\xE1s","traseira","posteriore","\u540E\u9762","\u5F8C\u9762","\u80CC\u9762","\u540E\u7F6E","\u5F8C\u7F6E","\u80CC\u7F6E","\u0437\u0430\u0434\u043D\u0435\u0439","\u0627\u0644\u062E\u0644\u0641\u064A\u0629","\uD6C4","arka","achterzijde","\u0E2B\u0E25\u0E31\u0E07","baksidan","bagside","sau","bak","tylny","takakamera","belakang","\u05D0\u05D7\u05D5\u05E8\u05D9\u05EA","\u03C0\u03AF\u03C3\u03C9","spate","h\xE1ts\xF3","zadn\xED","darrere","posterior","zadn\xE1","\u0437\u0430\u0434\u043D\u044F","stra\u017Enja","belakang","\u092C\u0948\u0915"],C=new Set(["Desk View Camera","Schreibtischansicht-Kamera","Cam\xE9ra Desk\xA0View","C\xE1mara de Vista Cenital","C\xE2mara da Vista de Secret\xE1ria","Fotocamera di Panoramica Scrivania","\u684C\u4E0A\u89C6\u89D2\u76F8\u673A","\u30C7\u30B9\u30AF\u30D3\u30E5\u30FC\u30AB\u30E1\u30E9","\u041A\u0430\u043C\u0435\u0440\u0430 \u041E\u0431\u0437\u043E\u0440\u0430 \u0441\u0442\u043E\u043B\u0430","Masa G\xF6r\xFCnt\xFCs\xFC Kameras\u0131","Bureauweergave-camera","\u0643\u0627\u0645\u064A\u0631\u0627 \u0627\u0644\u0639\u0631\u0636 \u0627\u0644\u0631\u0623\u0633\u064A","\u0E01\u0E25\u0E49\u0E2D\u0E07\u0E14\u0E39\u0E14\u0E49\u0E32\u0E19\u0E2B\u0E19\u0E49\u0E32\u0E42\u0E15\u0E4A\u0E30","Bordsvisningskamera","Kamera til Visning af skrivebord","Camera Desk View","Bordvisning-kamera","Kamera w\xA0aplikacji Widok blatu","Ty\xF6p\xF6yt\xE4n\xE4kym\xE4n kamera","Kamera Tampilan Meja","\u05DE\u05E6\u05DC\u05DE\u05EA \u05F4\u05EA\u05E6\u05D5\u05D2\u05EA \u05E9\u05D5\u05DC\u05D7\u05DF\u05F4","\u039A\u03AC\u03BC\u03B5\u03C1\u03B1 \u03C4\u03B7\u03C2 \u03A0\u03C1\u03BF\u03B2\u03BF\u03BB\u03AE\u03C2 \u03B3\u03C1\u03B1\u03C6\u03B5\u03AF\u03BF\u03C5","Camer\u0103 Vizualizare birou","\xCDr\xF3asztal n\xE9zet kamer\xE1ja","Stoln\xED kamera","C\xE0mera de l\u2019app Vista de l\u2019Escriptori"]),v=new Set(["Front Camera","Frontkamera","Appareil photo avant","C\xE1mara frontal","C\xE2mera Frontal","C\xE2mara frontal","Fotocamera (anteriore)","\u524D\u7F6E\u76F8\u673A","\u524D\u7F6E\u76F8\u6A5F","\u524D\u9762\u30AB\u30E1\u30E9","\u041A\u0430\u043C\u0435\u0440\u0430 \u043D\u0430 \u043F\u0435\u0440\u0435\u0434\u043D\u0435\u0439 \u043F\u0430\u043D\u0435\u043B\u0438","\xD6n Kamera","Camera aan voorzijde","\u0627\u0644\u0643\u0627\u0645\u064A\u0631\u0627 \u0627\u0644\u0623\u0645\u0627\u0645\u064A\u0629","\u0E01\u0E25\u0E49\u0E2D\u0E07\u0E14\u0E49\u0E32\u0E19\u0E2B\u0E19\u0E49\u0E32","Kamera p\xE5 framsidan","Forsidekamera","Camera m\u1EB7t tr\u01B0\u1EDBc","Kamera foran","Przedni aparat","Etukamera","Kamera Depan","\u05DE\u05E6\u05DC\u05DE\u05D4 \u05E7\u05D3\u05DE\u05D9\u05EA","\u039C\u03C0\u03C1\u03BF\u03C3\u03C4\u03B9\u03BD\u03AE \u03BA\u03AC\u03BC\u03B5\u03C1\u03B1","Camer\u0103 fa\u021B\u0103","El\xFCls\u0151 kamera","P\u0159edn\xED fotoapar\xE1t","C\xE0mera frontal","Predn\xE1 kamera","\u041F\u0435\u0440\u0435\u0434\u043D\u044F \u043A\u0430\u043C\u0435\u0440\u0430","Prednja kamera","Kamera Depan","\u092B\u093C\u094D\u0930\u0902\u091F \u0915\u0948\u092E\u0930\u093E"]),O=new Set(["Back Camera","R\xFCckkamera","Cam\xE9ra arri\xE8re","C\xE1mara trasera","C\xE2mera Traseira","C\xE2mara traseira","Fotocamera (posteriore)","\u540E\u7F6E\u76F8\u673A","\u5F8C\u7F6E\u76F8\u6A5F","\u80CC\u9762\u30AB\u30E1\u30E9","\u041A\u0430\u043C\u0435\u0440\u0430 \u043D\u0430 \u0437\u0430\u0434\u043D\u0435\u0439 \u043F\u0430\u043D\u0435\u043B\u0438","Arka Kamera","Camera aan achterzijde","\u0627\u0644\u0643\u0627\u0645\u064A\u0631\u0627 \u0627\u0644\u062E\u0644\u0641\u064A\u0629","\u0E01\u0E25\u0E49\u0E2D\u0E07\u0E14\u0E49\u0E32\u0E19\u0E2B\u0E25\u0E31\u0E07","Kamera p\xE5 baksidan","Bagsidekamera","Camera m\u1EB7t sau","Kamera bak","Tylny aparat","Takakamera","Kamera Belakang","\u05DE\u05E6\u05DC\u05DE\u05D4 \u05D0\u05D7\u05D5\u05E8\u05D9\u05EA","\u03A0\u03AF\u03C3\u03C9 \u03BA\u03AC\u03BC\u03B5\u03C1\u03B1","Camer\u0103 spate","H\xE1ts\xF3 kamera","Zadn\xED fotoapar\xE1t","C\xE0mera posterior","Zadn\xE1 kamera","\u0417\u0430\u0434\u043D\u044F \u043A\u0430\u043C\u0435\u0440\u0430","Stra\u017Enja kamera","Kamera Belakang","\u092C\u0948\u0915 \u0915\u0948\u092E\u0930\u093E"]),c=new Set(["Back Dual Wide Camera","R\xFCckseitige Dual-Weitwinkelkamera","Double appareil photo grand angle arri\xE8re","C\xE1mara trasera dual con gran angular","C\xE2mera Dupla Grande-Angular Traseira","C\xE2mara grande angular dupla traseira","Fotocamera doppia con grandangolo (posteriore)","\u540E\u7F6E\u53CC\u5E7F\u89D2\u955C\u5934","\u5F8C\u7F6E\u96D9\u5EE3\u89D2\u76F8\u6A5F","\u80CC\u9762\u30C7\u30E5\u30A2\u30EB\u5E83\u89D2\u30AB\u30E1\u30E9","\u0417\u0430\u0434\u043D\u044F\u044F \u0434\u0432\u043E\u0439\u043D\u0430\u044F \u0448\u0438\u0440\u043E\u043A\u043E\u0443\u0433\u043E\u043B\u044C\u043D\u0430\u044F \u043A\u0430\u043C\u0435\u0440\u0430","\xC7ift Geni\u015F Kamera Arka Y\xFCz\xFC","\u0643\u0627\u0645\u064A\u0631\u0627 \u062E\u0644\u0641\u064A\u0629 \u0645\u0632\u062F\u0648\u062C\u0629 \u0639\u0631\u064A\u0636\u0629","\u0E01\u0E25\u0E49\u0E2D\u0E07\u0E04\u0E39\u0E48\u0E14\u0E49\u0E32\u0E19\u0E2B\u0E25\u0E31\u0E07\u0E21\u0E38\u0E21\u0E01\u0E27\u0E49\u0E32\u0E07","Dubbel vidvinkelkamera p\xE5 baksidan","Camera k\xE9p r\u1ED9ng m\u1EB7t sau","Dobbelt vidvinkelkamera bak","Tylny dwuobiektywowy aparat szerokok\u0105tny","Laajakulmainen kaksoistakakamera","Kamera Lebar Belakang Ganda","\u05DE\u05E6\u05DC\u05DE\u05D4 \u05DB\u05E4\u05D5\u05DC\u05D4 \u05E8\u05D7\u05D1\u05D4 \u05D0\u05D7\u05D5\u05E8\u05D9\u05EA","\u03A0\u03AF\u03C3\u03C9 \u03B4\u03B9\u03C0\u03BB\u03AE \u03B5\u03C5\u03C1\u03B5\u03AF\u03B1 \u03BA\u03AC\u03BC\u03B5\u03C1\u03B1","Camer\u0103 dubl\u0103 cu obiectiv superangular spate","H\xE1ts\xF3, kett\u0151s, sz\xE9les l\xE1t\xF3sz\xF6g\u0171 kamera","Zadn\xED du\xE1ln\xED \u0161iroko\xFAhl\xFD fotoapar\xE1t","C\xE0mera dual posterior amb gran angular","Zadn\xE1 du\xE1lna \u0161irokouhl\xE1 kamera","\u0417\u0430\u0434\u043D\u044F \u0437\u0434\u0432\u043E\u0454\u043D\u0430 \u0448\u0438\u0440\u043E\u043A\u043E\u043A\u0443\u0442\u043D\u0430 \u043A\u0430\u043C\u0435\u0440\u0430","Stra\u017Enja dvostruka \u0161iroka kamera","Dwikamera Lebar Belakang","\u092C\u0948\u0915 \u0921\u094D\u092F\u0941\u0905\u0932 \u0935\u093E\u0907\u0921 \u0915\u0948\u092E\u0930\u093E"]),N=new Set(["Back Ultra Wide Camera","R\xFCckseitige Ultra-Weitwinkelkamera","Appareil photo ultra grand angle arri\xE8re","C\xE1mara trasera con ultra gran angular","C\xE2mera Ultra-Angular Traseira","C\xE2mara ultra grande angular traseira","Fotocamera con ultra-grandangolo (posteriore)","\u540E\u7F6E\u8D85\u5E7F\u89D2\u76F8\u673A","\u5F8C\u7F6E\u8D85\u5EE3\u89D2\u76F8\u6A5F","\u80CC\u9762\u8D85\u5E83\u89D2\u30AB\u30E1\u30E9","\u0417\u0430\u0434\u043D\u044F\u044F \u0441\u0432\u0435\u0440\u0445\u0448\u0438\u0440\u043E\u043A\u043E\u0443\u0433\u043E\u043B\u044C\u043D\u0430\u044F \u043A\u0430\u043C\u0435\u0440\u0430","Ultra Geni\u015F Kamera Arka Y\xFCz\xFC","Ultrabrede camera aan achterzijde","\u0643\u0627\u0645\u064A\u0631\u0627 \u062E\u0644\u0641\u064A\u0629 \u0639\u0631\u064A\u0636\u0629 \u062C\u062F\u064B\u0627","\u0E01\u0E25\u0E49\u0E2D\u0E07\u0E14\u0E49\u0E32\u0E19\u0E2B\u0E25\u0E31\u0E07\u0E21\u0E38\u0E21\u0E01\u0E27\u0E49\u0E32\u0E07\u0E2D\u0E31\u0E25\u0E15\u0E23\u0E49\u0E32","Ultravidvinkelkamera p\xE5 baksidan","Ultravidvinkelkameraet p\xE5 bagsiden","Camera c\u1EF1c r\u1ED9ng m\u1EB7t sau","Ultravidvinkelkamera bak","Tylny aparat ultraszerokok\u0105tny","Ultralaajakulmainen takakamera","Kamera Ultra Lebar Belakang","\u05DE\u05E6\u05DC\u05DE\u05D4 \u05D0\u05D5\u05DC\u05D8\u05E8\u05D4 \u05E8\u05D7\u05D1\u05D4 \u05D0\u05D7\u05D5\u05E8\u05D9\u05EA","\u03A0\u03AF\u03C3\u03C9 \u03C5\u03C0\u03B5\u03C1\u03B5\u03C5\u03C1\u03B5\u03AF\u03B1 \u03BA\u03AC\u03BC\u03B5\u03C1\u03B1","Camer\u0103 cu obiectiv ultra\u2011superangular spate","H\xE1ts\xF3, ultrasz\xE9les l\xE1t\xF3sz\xF6g\u0171 kamera","Zadn\xED ultra \u0161iroko\xFAhl\xFD fotoapar\xE1t","C\xE0mera posterior amb ultra gran angular","Zadn\xE1 ultra\u0161irokouhl\xE1 kamera","\u0417\u0430\u0434\u043D\u044F \u043D\u0430\u0434\u0448\u0438\u0440\u043E\u043A\u043E\u043A\u0443\u0442\u043D\u0430 \u043A\u0430\u043C\u0435\u0440\u0430","Stra\u017Enja ultra \u0161iroka kamera","Kamera Ultralebar Belakang","\u092C\u0948\u0915 \u0905\u0932\u094D\u091F\u094D\u0930\u093E \u0935\u093E\u0907\u0921 \u0915\u0948\u092E\u0930\u093E"]),d,D=false;s.mainCameraForPositionOverridesOnDesktop=new Map,s.deviceIdToCameraObjects=new Map,s.inaccessibleDeviceIds=new Set;let F=new Set;function ae(e){F.add(e);}s.addVideoDevicesListener=ae;function re(e,i){s.mainCameraForPositionOverridesOnDesktop.set(e,i);}s.setMainCameraForPositionOverridesOnDesktop=re;function ie(){s.mainCameraForPositionOverridesOnDesktop.clear();}s.clearMainCameraForPositionOverridesOnDesktop=ie;function S(){return navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices)}function B(){if(typeof navigator.enumerateDevices=="function")return navigator.enumerateDevices.bind(navigator);if(typeof navigator.mediaDevices=="object"&&typeof navigator.mediaDevices.enumerateDevices=="function")return navigator.mediaDevices.enumerateDevices.bind(navigator.mediaDevices)}function w(){D=true;}function W(e){let i=e.toLowerCase();return x.some(a=>i.includes(a))}function E(e){return v.has(e)}s.isIOSFrontCameraLabel=E;function M(e){return O.has(e)}s.isIOSBackCameraLabel=M;function I(e){return c.has(e)}s.isIOSBackDualWideCameraLabel=I;function K(e){return N.has(e)}s.isIOSUltraWideBackCameraLabel=K;function y(e){var a;let i=e.message==="Invalid constraint"?"OverconstrainedError":(a=P.get(e.name))!=null?a:e.name;Object.defineProperty(e,"name",{value:i});}function R(e){if(e.length===0)return {areSomeCameraLabelsFilled:false,areAllCameraLabelsFilled:false,areAllCameraLabelsUnfilled:false};let i=e.every(r=>r.label!==""),a=e.every(r=>r.label==="");return {areSomeCameraLabelsFilled:!a&&!i,areAllCameraLabelsFilled:i,areAllCameraLabelsUnfilled:a}}function j(e,i){var a;return (a=s.mainCameraForPositionOverridesOnDesktop.get(i))!=null?a:e.find(n=>n.position===i)}function z(e,i){if(i==="worldFacing"){let a=e.find(r=>I(r.label));if(a!=null)return a;let n=e.find(r=>M(r.label));if(n!=null)return n}else {let a=e.find(n=>E(n.label));if(a!=null)return a}}function V(e,i){let{areSomeCameraLabelsFilled:a,areAllCameraLabelsUnfilled:n}=R(e);if(n)return e[i==="userFacing"?0:e.length-1];if(a){let r=e.filter(t=>t.position===i);return r.length===1?r[0]:r[i==="userFacing"?0:r.length-1]}if(b.getUserAgentInfo().getOS().name==="iOS"){let r=z(e,i);if(r)return r}return e.filter(r=>r.position===i).sort((r,t)=>r.label.localeCompare(t.label))[0]}function te(e,i){return b.isDesktopDevice()?j(e,i):V(e,i)}s.getMainCameraForPosition=te;function k(e,i){return e.unshift(e.splice(i,1)[0])}function ne(e,i){function a(t,o){let l=s.mainCameraForPositionOverridesOnDesktop.get(o);return l!=null&&t.includes(l)&&(t=t.filter(f=>f!==l),t.unshift(l)),t}let n=e.filter(t=>t.position==="userFacing"),r=e.filter(t=>t.position==="worldFacing");return b.isDesktopDevice()?(n=a(n,"userFacing"),r=a(r,"worldFacing")):e.every(t=>t.label==="")?r.reverse():(n.sort((t,o)=>t.label.localeCompare(o.label)),r.sort((t,o)=>t.label.localeCompare(o.label)),b.getUserAgentInfo().getOS().name==="iOS"&&(n.some((t,o)=>E(t.label)&&k(n,o)>=0),r.some((t,o)=>K(t.label)&&k(r,o)>=0),r.some((t,o)=>I(t.label)&&k(r,o)>=0)||r.some((t,o)=>M(t.label)&&k(r,o)>=0))),i==="userFacing"?[...n,...r]:[...r,...n]}s.sortCamerasForCameraPosition=ne;function _(e,i){let a=e.getVideoTracks();if(a.length>0){let n=a[0],r;typeof n.getSettings=="function"&&(r=n.getSettings(),r.facingMode!=null&&r.facingMode.length>0&&(i.position=r.facingMode==="environment"?"worldFacing":"userFacing"));let{label:t=""}=n;t.length>0&&(i.label=t);}}s.adjustCameraFromMediaStream=_;function H(e,i,a){if(s.deviceIdToCameraObjects.has(e.deviceId))return s.deviceIdToCameraObjects.get(e.deviceId);let{label:n="",deviceId:r}=e,t;return !b.isDesktopDevice()&&a.every(o=>o.label===""&&!s.deviceIdToCameraObjects.has(o.deviceId))?t=a.length===1||i+1<=Math.floor(a.length/2)?"userFacing":"worldFacing":t=W(n)?"worldFacing":"userFacing",{position:t,label:n,deviceId:r}}function A(e){let i=e.map((a,n,r)=>H(a,n,r)).map(a=>(a.deviceId!==""&&s.deviceIdToCameraObjects.set(a.deviceId,a),a)).filter(a=>!/\b(?:ir|infrared)\b/i.test(a.label)||/^IR UVC WebCam$/i.test(a.label.toUpperCase())).filter(a=>!C.has(a.label)).filter(a=>!s.inaccessibleDeviceIds.has(a.deviceId));if(!b.isDesktopDevice()&&i.length>1&&!i.some(a=>a.position==="worldFacing")){let a=i.length-1,n=i.map(r=>{let t=/\b(\d+)mp?\b/i.exec(r.label);return t!=null?Number.parseInt(t[1],10):Number.NaN});n.some(r=>Number.isNaN(r))||(a=n.lastIndexOf(Math.max(...n))),i[a].position="worldFacing";}return i}async function G(){if(d!=null&&d.length>0&&d.every(e=>e.label===""&&!s.deviceIdToCameraObjects.has(e.deviceId)))try{return await S()({video:true,audio:false})}catch{}}function Z(e,i){var a,n;if(i.length>0&&e.length===i.length&&!i.every((r,t)=>e[t].deviceId===r.deviceId)){let r={};for(let[t,o]of e.entries()){let l=s.deviceIdToCameraObjects.get(o.deviceId);if(l==null||l.label!==((n=(a=i[t])==null?void 0:a.label)!=null?n:""))continue;let f=i[t].deviceId;r[l.deviceId]=f,s.inaccessibleDeviceIds.has(l.deviceId)&&s.inaccessibleDeviceIds.add(f),l.deviceId=f,s.deviceIdToCameraObjects.set(f,l);}a$1.log(a$1.Level.Debug,"Detected updated camera deviceId information and updated it accordingly",r);}}function Y(){typeof navigator.mediaDevices.addEventListener=="function"?navigator.mediaDevices.addEventListener("devicechange",w):navigator.mediaDevices.ondevicechange=w;}async function L(){let e,i=B();if(i)e=await i();else throw new a({fullSupport:false,scannerSupport:true,missingFeatures:["mediaDevices"]});return e.filter(a=>a.kind==="videoinput")}async function oe(e=false,i=false){var r;let a$2=b.checkBrowserCompatibility();if(!a$2.fullSupport)throw new a(a$2);if(Y(),d==null||e||D){D=false;let t,o=d!=null?d:[];d=[];try{d=await L(),i||(t=await G(),t!=null&&(d=await L())),a$1.debug("Camera list (devices):",...d),d.length>0&&d.every(l=>l.deviceId==="")&&a$1.log(a$1.Level.Debug,"Incomplete camera information listed due to user permission denial, cameras will not be accessible"),Z(o,d);}catch(l){throw y(l),l}finally{for(let l of (r=t==null?void 0:t.getVideoTracks())!=null?r:[])l.stop();}}let n=A(d);a$1.log(a$1.Level.Debug,"Camera list (cameras): ",...n);for(let t of F)t([...n]);return [...n]}s.getCameras=oe;async function X(e){return a$1.debug("Attempt to access camera (parameters):",e.video),new Promise((i,a)=>{setTimeout(async()=>{try{let n=await S()(e);if(n==null){a(new a$2({name:"AbortError",message:"Cannot get stream from getUserMedia function."}));return}i(n);}catch(n){a(n);}},0);})}function $(e,i){let a={resizeMode:"none"};switch(e){case 0:return {...a,width:{min:2880,ideal:i==="fourToThree"?2880:3840,max:4096},height:{min:1800,ideal:2160,max:2400}};case 1:return {...a,width:{min:1440,ideal:i==="fourToThree"?1440:1920,max:2160},height:{min:900,ideal:1080,max:1440}};case 2:return {...a,width:{min:960,ideal:i==="fourToThree"?960:1280,max:1440},height:{min:480,ideal:720,max:960}};case 3:return {...a,width:{min:640,ideal:640,max:800},height:{min:360,ideal:i==="fourToThree"?480:360,max:640}};default:return {}}}s.getUserMediaVideoParameters=$;function q(e){e.deviceId!==""&&(a$1.log(a$1.Level.Debug,"Camera marked to be inaccessible:",e),s.inaccessibleDeviceIds.add(e.deviceId));}s.markCameraAsInaccessible=q;async function se(e,i,a){a$1.log(a$1.Level.Debug,"Attempt to access camera (camera):",e);let n={audio:false,video:$(i,a)};e.deviceId===""?n.video.facingMode={ideal:e.position==="worldFacing"?"environment":"user"}:n.video.deviceId={exact:e.deviceId};try{let r=await X(n);return _(r,e),r}catch(r){throw y(r),["OverconstrainedError","NotReadableError","NotAllowedError"].includes(r.name)||q(e),r}}s.accessCameraStream=se;})(T||(T={}));export{J as a,Q as b,ee as c,T as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-BGUY24J4.js';var t=new a(globalThis,{get:()=>globalThis.Module,set:e=>{globalThis.Module=e;}});function l(e){}export{t as a,l as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a as a$1}from'./chunk-FR24G4R7.js';import {a as a$2}from'./chunk-F2GMW4LP.js';import {a as a$3}from'./chunk-ENYHCJGH.js';var a=class n{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 n;return i._widthAndHeight=t,i}static sizeWithWidthAndAspectRatio(t,i){let e=new n;return e._widthAndAspectRatio=new a$1(t,i),e}static sizeWithHeightAndAspectRatio(t,i){let e=new n;return e._heightAndAspectRatio=new a$1(t,i),e}static sizeWithShorterDimensionAndAspectRatio(t,i){let e=new n;return e._shorterDimensionAndAspectRatio=new a$1(t,i),e}static fromJSON(t){if(t.width&&t.height)return n.sizeWithWidthAndHeight(new a$2(a$3.fromJSON(t.width),a$3.fromJSON(t.height)));if(t.width&&typeof t.aspect=="number")return n.sizeWithWidthAndAspectRatio(a$3.fromJSON(t.width),t.aspect);if(t.height&&typeof t.aspect=="number")return n.sizeWithHeightAndAspectRatio(a$3.fromJSON(t.height),t.aspect);if(t.shorterDimension&&typeof t.aspect=="number")return n.sizeWithShorterDimensionAndAspectRatio(a$3.fromJSON(t.shorterDimension),t.aspect);throw new Error(`SizeWithUnitAndAspectJSON is malformed: ${JSON.stringify(t)}`)}toJSONObject(){var t,i,e,r,A,p,c,d;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:(e=this.heightAndAspectRatio)==null?void 0:e.size.toJSONObject(),aspect:(r=this.heightAndAspectRatio)==null?void 0:r.aspect};case "shorterDimensionAndAspectRatio":return {shorterDimension:(A=this.shorterDimensionAndAspectRatio)==null?void 0:A.size.toJSONObject(),aspect:(p=this.shorterDimensionAndAspectRatio)==null?void 0:p.aspect};default:return {width:(c=this.widthAndHeight)==null?void 0:c.width.toJSONObject(),height:(d=this.widthAndHeight)==null?void 0:d.height.toJSONObject()}}}};export{a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-ENYHCJGH.js';var r=class e{constructor(i,n){this._x=i,this._y=n;}static get zero(){return new e(new a(0,"pixel"),new a(0,"pixel"))}get x(){return this._x}get y(){return this._y}static fromJSON(i){return new e(a.fromJSON(i.x),a.fromJSON(i.y))}toJSONObject(){return {x:this.x.toJSONObject(),y:this.y.toJSONObject()}}};export{r as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-GJBUPJIM.js';import {d}from'./chunk-AFCJ24Y3.js';import {b}from'./chunk-VBUDN72N.js';import {f,g}from'./chunk-3D2HNEVH.js';var c=class{constructor(){this.type="camera-fov";this.customIcons={wide:{idle:"",pressed:""},ultraWide:{idle:"",pressed:""}};this.fovSwitchButton=void 0;this.CameraFOVSwitchButtonClass=void 0;this.currentFrameSource=null;this.view=void 0;this.onCameraFOVChanged=this.handleCameraFOVChanged.bind(this);this.isTransitioning=false;}get cameraFOVWideImage(){return this.customIcons.wide.idle}set cameraFOVWideImage(e){this.customIcons.wide.idle=e,this.applyCustomImagesToButton();}get cameraFOVWidePressedImage(){return this.customIcons.wide.pressed}set cameraFOVWidePressedImage(e){this.customIcons.wide.pressed=e,this.applyCustomImagesToButton();}get cameraFOVUltraWideImage(){return this.customIcons.ultraWide.idle}set cameraFOVUltraWideImage(e){this.customIcons.ultraWide.idle=e,this.applyCustomImagesToButton();}get cameraFOVUltraWidePressedImage(){return this.customIcons.ultraWide.pressed}set cameraFOVUltraWidePressedImage(e){this.customIcons.ultraWide.pressed=e,this.applyCustomImagesToButton();}toJSONObject(){return {type:this.type}}async install(e){var a,r,n;this.CameraFOVSwitchButtonClass||(this.CameraFOVSwitchButtonClass=await import('../private/ui/molecules/CameraFOVSwitchButton.js').then(d=>d.CameraFOVSwitchButton),(a=this.CameraFOVSwitchButtonClass)==null||a.register()),this.view=e,this.currentFrameSource=(n=(r=e.getContext())==null?void 0:r.frameSource)!=null?n:null,this.fovSwitchButton=this.CameraFOVSwitchButtonClass.create(),this.fovSwitchButton.slot="bottomRight",this.fovSwitchButton.hidden=true,this.updateButtonMode(),this.fovSwitchButton.addEventListener("camera-fov-changed",this.onCameraFOVChanged);let t=e.controlsElement;return t&&t.append(this.fovSwitchButton),this.applyCustomImagesToButton(),await this.canShow()&&(await this.setInitialWideCamera(),this.updateButtonVisibility(true)),true}remove(e){e&&this.fovSwitchButton&&(this.fovSwitchButton.removeEventListener("camera-fov-changed",this.onCameraFOVChanged),this.fovSwitchButton.remove(),this.fovSwitchButton=null,this.currentFrameSource=null,this.view=void 0);}async update(e){var i,a;this.currentFrameSource=(a=(i=e.getContext())==null?void 0:i.frameSource)!=null?a:null,this.view=e,this.updateButtonMode();let t=await this.canShow();this.updateButtonVisibility(t);}updateButtonMode(){if(!this.fovSwitchButton)return;let t=this.isUltraWideBackCamera()?"0.5x":"1.0x";this.fovSwitchButton.mode=t;}applyCustomImagesToButton(){if(!this.fovSwitchButton)return;this.customIcons.wide.idle||this.customIcons.wide.pressed||this.customIcons.ultraWide.idle||this.customIcons.ultraWide.pressed?this.fovSwitchButton.setCustomImages(this.customIcons):this.fovSwitchButton.useCustomImages=false;}updateButtonVisibility(e){this.fovSwitchButton&&(this.fovSwitchButton.hidden=!e);}async canShow(){if(!b.isIOSDeviceWithExtendedCameraAccess())return false;let e=this.currentFrameSource;return e===null||!f(e)?false:d.isIOSBackDualWideCameraLabel(e.label)||d.isIOSBackCameraLabel(e.label)||d.isIOSUltraWideBackCameraLabel(e.label)}isUltraWideBackCamera(){let e=this.currentFrameSource;return f(e)?d.isIOSUltraWideBackCameraLabel(e.label):false}async handleCameraFOVChanged(e){await this.handleCameraFOVSwitch(),this.updateButtonMode();}async setInitialWideCamera(){var e,t;if(!this.isTransitioning&&!d.isIOSBackCameraLabel((t=(e=this.currentFrameSource)==null?void 0:e.label)!=null?t:"")){let a$1=(await a.getAll()).find(r=>d.isIOSBackCameraLabel(r.label));a$1&&await this.switchCameras(a$1);}}async handleCameraFOVSwitch(){if(this.isTransitioning)return false;let e=await this.getAlternativeCamera();return e?(await this.switchCameras(e),true):false}async getAlternativeCamera(){return (await a.getAll()).find(t=>this.isUltraWideBackCamera()?d.isIOSBackCameraLabel(t.label):d.isIOSUltraWideBackCameraLabel(t.label))}async switchCameras(e){var n;this.isTransitioning=true;let t=(n=this.view)==null?void 0:n.getContext(),i=t==null?void 0:t.frameSource,a,r;i!=null&&(a=new g(i.settings),r=i.desiredState),await(i==null?void 0:i.switchToDesiredState("off")),a!=null&&await e.applySettings(a),await(t==null?void 0:t.setFrameSource(e)),await(t==null?void 0:t.frameSource).switchToDesiredState(r!=null?r:"on"),this.isTransitioning=false;}};export{c as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a as a$9}from'./chunk-523EQN4Z.js';import {b as b$2}from'./chunk-5IGOKD23.js';import {a as a$d}from'./chunk-NDQQHCZN.js';import {b,a as a$4}from'./chunk-C657OBED.js';import {a as a$h}from'./chunk-V6RG452U.js';import {a as a$j}from'./chunk-UOQFOEG6.js';import {a as a$a}from'./chunk-TPHGDMKG.js';import {a as a$f}from'./chunk-GPPCTFZF.js';import {a as a$l}from'./chunk-DMOXDUF6.js';import {b as b$1}from'./chunk-457L5N2F.js';import {a as a$e}from'./chunk-W6HSMZGZ.js';import {a as a$g}from'./chunk-4JH6EEAE.js';import {a as a$b}from'./chunk-KYNYQBNF.js';import {a as a$7}from'./chunk-RSQRPDVQ.js';import {a}from'./chunk-UQVVJP5Z.js';import {a as a$6}from'./chunk-IJQG3OU6.js';import {a as a$8}from'./chunk-I6SWF3FQ.js';import {a as a$3}from'./chunk-N5YZEC56.js';import {a as a$2}from'./chunk-VJB527QZ.js';import {a as a$1}from'./chunk-GHTCNOQN.js';import {a as a$c}from'./chunk-UWBNF47P.js';import {d}from'./chunk-ADFFBLII.js';import {a as a$n}from'./chunk-E4XJ4GKD.js';import {a as a$k}from'./chunk-QOCHMKNY.js';import {a as a$5}from'./chunk-KAFNKP6O.js';import {a as a$i}from'./chunk-XR65N6EG.js';import {a as a$m}from'./chunk-WUHKODFA.js';var O="core.camera.recovery",$=class B{constructor(){this.focusGesture=a.focusGesture;this.zoomGesture=a.zoomGesture;this._scanAreaMargins=a.scanAreaMargins;this._pointOfInterest=a.pointOfInterest;this._logoStyle=a.logoStyle;this._logoAnchor=a.logoAnchor;this._logoOffset=a.logoOffset;this._context=null;this.overlays=new Set;this.controls=new Set;this.frameSourceListener={didChangeState:this.onFrameSourceChange.bind(this)};this._previewCamera=null;this.controlsElement=void 0;this.frozenFrameCanvas=document.createElement("canvas");this.listeners=[];this.isVideoElementDetached=false;this.orientation="portrait";this.hiddenProperties={stopVideoTracksOnVisibilityChange:true,freezeFrameWhenStoppingFrameSource:true};this.orientationObserver=new b;this.onOrientationChangeListener=this.onOrientationChange.bind(this);this.onHintPresenterUpdateHandler=this.onHintPresenterUpdate.bind(this);this.onBeforeShowToastsHandler=this.onBeforeShowToasts.bind(this);this.onWorkerMessageHandler=this.onWorkerMessage.bind(this);this.htmlElementDidChangeHandler=this.htmlElementDidChange.bind(this);this.htmlElementDisconnectedHandler=this.htmlElementDisconnected.bind(this);this.notificationPresenter=null;this.visibilityListener=this.onVisibilityChange.bind(this),this.cameraRecoveryListener=this.cameraRecovery.bind(this),a$1.getInstance().updateIfMissing(a$2);}get videoElement(){return d.instance().getVideoElement()}get scanAreaMargins(){return this._scanAreaMargins}set scanAreaMargins(e){var t;this._scanAreaMargins=e,(t=this.privateContext)==null||t.update();}get pointOfInterest(){return this._pointOfInterest}set pointOfInterest(e){var t;this._pointOfInterest=e,(t=this.privateContext)==null||t.update();}get logoStyle(){return this._logoStyle}set logoStyle(e){var t;this._logoStyle=e,(t=this.privateContext)==null||t.update();}get logoAnchor(){return this._logoAnchor}set logoAnchor(e){var t;this._logoAnchor=e,(t=this.privateContext)==null||t.update();}get logoOffset(){return this._logoOffset}set logoOffset(e){var t;this._logoOffset=e,(t=this.privateContext)==null||t.update();}get cameraRecoveryText(){return a$1.getInstance().get(O)}get width(){var e,t;return Math.round((t=(e=this.htmlElementState)==null?void 0:e.width)!=null?t:0)}get height(){var e,t;return Math.round((t=(e=this.htmlElementState)==null?void 0:e.height)!=null?t:0)}get canvasDrawer(){return !this._canvasDrawer&&this.canvasElement!=null&&(this._canvasDrawer=new b$1(this.canvasElement),this._canvasDrawer.startObservingCanvasResize()),this._canvasDrawer}get privateContext(){return this._context}static async forContext(e){let t=new B;return await t.setContext(e),t}showProgressBar(){var e;(e=this.loadingOverlay)==null||e.show();}hideProgressBar(){var e;(e=this.loadingOverlay)==null||e.hide();}setProgressBarPercentage(e){this.loadingOverlay&&(this.loadingOverlay.progress=e);}setProgressBarMessage(e){this.loadingOverlay&&(this.loadingOverlay.message=e);}getContext(){return this._context}async setContext(e){var t,i,r;if(this._context=e,e){if(this.overlays.size>0&&!((t=this.privateContext)!=null&&t.hasModes()))throw new Error(["Cannot assign this view to this context. This view has overlays but the context does not have any mode attached matching these overlays.","Remove the overlays first before attaching the view to the context, or add the corresponding mode to the context before attaching this view."].join(" "));await e.setView(this),(i=this.privateContext)==null||i.subscribeToWorkerMessages(this.onWorkerMessageHandler),(r=this._context)!=null&&r.frameSource&&await this.onFrameSourceChange(this._context.frameSource);}}connectToElement(e,t){var i,r,a,n;this.orientationObserver.register(),this.setupHtmlElement(e),(i=this.canvasDrawer)==null||i.startObservingCanvasResize(),this.htmlElementDidChange(),a$3.add(this),this.orientation=this.orientationObserver.orientation.value,this.orientationObserver.addEventListener(a$4,this.onOrientationChangeListener),(r=this.hintPresenter)==null||r.addEventListener("hintpresenterupdate",this.onHintPresenterUpdateHandler),(a=this.hintPresenter)==null||a.addEventListener("willshow",this.onBeforeShowToastsHandler),this.localizationSubscription=a$1.getInstance().subscribe(s=>{s[O]!=null&&(this.cameraRecoveryElement.textContent=s[O]);}),this._previewCamera=(n=t==null?void 0:t.camera)!=null?n:null,this._previewCamera&&(this._previewCamera.addListener(this.frameSourceListener),this.onFrameSourceChange(this._previewCamera)),this.updateControls();}detachFromElement(){var e,t,i,r,a,n,s,h;(e=this.htmlElementState)==null||e.removeListeners(),this.removeStyles(),(t=this.canvasDrawer)==null||t.endObservingCanvasResize(),document.removeEventListener("visibilitychange",this.visibilityListener);for(let m of ["touchend","mousedown"])this.cameraRecoveryElement.removeEventListener(m,this.cameraRecoveryListener);(i=this.loadingOverlay)==null||i.remove(),(r=this.customLocationsView)==null||r.unmount(),this.notificationPresenter=null,this.htmlElementDidChange(),(a=this.gestureRecognizer)==null||a.removeAllListeners(),this.clearHtmlElementContent(),a$3.delete(this),this.orientationObserver.unregister(),this.orientationObserver.removeEventListener(a$4,this.onOrientationChangeListener),(n=this.hintPresenter)==null||n.removeEventListener("hintpresenterupdate",this.onHintPresenterUpdateHandler),(s=this.hintPresenter)==null||s.removeEventListener("willshow",this.onBeforeShowToastsHandler),(h=this.localizationSubscription)==null||h.cancel(),d.instance().disconnectedCallback(),this._previewCamera&&(this._previewCamera.removeListener(this.frameSourceListener),this._previewCamera=null);for(let m of this.controls)this.removeControl(m);}async addOverlay(e){var t;this.overlays.has(e)||(this.overlays.add(e),await((t=this.privateContext)==null?void 0:t.update([{type:"addOverlay",newValue:e,view:this}])));}async removeOverlay(e){var t;this.overlays.has(e)&&(await((t=this.privateContext)==null?void 0:t.update([{type:"removeOverlay",newValue:e,view:this}])),this.overlays.delete(e));}addListener(e){this.listeners.includes(e)||this.listeners.push(e);}removeListener(e){this.listeners.includes(e)&&this.listeners.splice(this.listeners.indexOf(e),1);}viewPointForFramePoint(e){var u,P,L,D,V,F,R,M;let t={width:(P=(u=this.htmlElementState)==null?void 0:u.width)!=null?P:0,height:(D=(L=this.htmlElementState)==null?void 0:L.height)!=null?D:0},i={width:(F=(V=this.videoElement)==null?void 0:V.videoWidth)!=null?F:0,height:(M=(R=this.videoElement)==null?void 0:R.videoHeight)!=null?M:0},r=t.width/t.height,a=i.width/i.height,n=r>a?t.width/i.width:t.height/i.height,s={x:e.x*n,y:e.y*n},h=(i.width*n-t.width)/2,m=(i.height*n-t.height)/2;return new a$5(s.x-h,s.y-m)}viewQuadrilateralForFrameQuadrilateral(e){let t=this.viewPointForFramePoint(e.topLeft),i=this.viewPointForFramePoint(e.topRight),r=this.viewPointForFramePoint(e.bottomLeft),a=this.viewPointForFramePoint(e.bottomRight);return new a$6(t,i,a,r)}addControl(e){this.controls.has(e)||(this.controls.add(e),e.install(this).then(t=>{var i;t&&((i=this.privateContext)==null||i.update([{type:"addControl",newValue:e}]));}));}removeControl(e){var t;this.controls.has(e)&&(e.remove(true),this.controls.delete(e),(t=this.privateContext)==null||t.update([{type:"removeControl",newValue:e}]));}toJSONObject(){var e;return {scanAreaMargins:this.scanAreaMargins.toJSONObject(),pointOfInterest:this.pointOfInterest.toJSONObject(),logoAnchor:this.logoAnchor,logoOffset:this.logoOffset.toJSONObject(),logoHidden:(e=this.logoHidden)!=null?e:false,logoStyle:this.logoStyle,overlays:[...this.overlays].map(t=>t.toJSONObject()),controls:[...this.controls].map(t=>t.toJSONObject()),focusGesture:this.focusGesture?this.focusGesture.toJSONObject():null,zoomGesture:this.zoomGesture?this.zoomGesture.toJSONObject():null}}isCameraRecoveryVisible(){return !this.cameraRecoveryElement.hidden}setCameraRecoveryVisible(e){this.cameraRecoveryElement.hidden=!e;}async allowPictureInPicture(e){await d.instance().allowPictureInPicture(e);}viewAnchorPositionsForFrameAnchorPositions(e){let t=this.viewPointForFramePoint(e.topLeft),i=this.viewPointForFramePoint(e.topRight),r=this.viewPointForFramePoint(e.bottomLeft),a=this.viewPointForFramePoint(e.bottomRight),n=this.viewPointForFramePoint(e.centerLeft),s=this.viewPointForFramePoint(e.centerRight),h=this.viewPointForFramePoint(e.topCenter),m=this.viewPointForFramePoint(e.bottomCenter),u=this.viewPointForFramePoint(e.center);return new a$7(t,i,a,r,n,h,s,m,u)}setDidTapCustomLocationsViewListener(e){this.customLocationsView&&this.customLocationsView.listener===null&&(this.customLocationsView.listener=e);}renderCustomLocationsView(e){this.customLocationsView!=null&&(this.customLocationsView.setMirrored(d.instance().isMirrorImageEnabled()),Object.keys(e).includes("removedIds")?this.customLocationsView.render(e):this.customLocationsView.renderDomView(e));}getNotificationPresenter(){var e;if(!this.notificationPresenter){let t=(e=this.htmlElement)==null?void 0:e.querySelector(b$2.tag);if(!t)throw new Error("Notification presenter cannot be found. Please ensure the DataCaptureView is connected.");this.notificationPresenter=new a$8(t);}return this.notificationPresenter}removeStyles(){for(let e of document.querySelectorAll("style[scandit]"))e.remove();}onHintPresenterUpdate(e){var t;(t=this.privateContext)==null||t.workerCommand("hintPresenterV2update",{});}clearHtmlElementContent(){var e;this.htmlElement&&((e=this.canvasDrawer)==null||e.endObservingCanvasResize(),this.htmlElement.innerHTML="",this.cameraPaintboardElement=void 0,this.singleImageUploaderPaintboardElement=void 0,this.htmlElement=void 0);}setupHtmlElement(e){var a,n,s;this.createStyles(),this.htmlElement=e,b$2.register(),a$9.register();let t=a$c`<div class="${a$a.CONTAINER_CLASS_NAME}"><div class="${a$a.PAINTBOARDS_CONTAINER_CLASS_NAME}"><div data-js-id="loading-overlay"></div><div class="${a$a.PAINTBOARD_CLASS_NAME}" data-js-id="camera-paintboard"><div data-js-id="video-container"></div><img class="${a$a.FROZEN_FRAME}" data-js-id="frozen-frame" alt="frozen-frame" hidden /><canvas></canvas><div data-js-id="${a$b.CUSTOM_VIEW_CONTAINER}"></div><${b$2.tag}></${b$2.tag}><${a$9.tag}></${a$9.tag}><div class="${a$a.CAMERA_RECOVERY_CLASS_NAME}" hidden>${this.cameraRecoveryText}</div><div class="${a$a.ERROR_CLASS_NAME}" hidden></div></div><div class="${a$a.PAINTBOARD_CLASS_NAME}" data-js-id="singleimage-paintboard"></div></div></div>`;this.htmlElement.innerHTML=t,d.instance().connectedCallback(this.htmlElement.querySelector('[data-js-id="video-container"]')),this.hintPresenter=this.htmlElement.querySelector(b$2.tag),this.notificationPresenter=this.hintPresenter?new a$8(this.hintPresenter):null,this.loadingOverlay&&this.loadingOverlay.remove(),this.loadingOverlay=a$d.create(),this.loadingOverlay.hide(),(a=this.htmlElement.querySelector('[data-js-id="loading-overlay"]'))==null||a.replaceWith(this.loadingOverlay),this.customLocationsView&&this.customLocationsView.unmount(),this.customLocationsView=new a$e,this.customLocationsView.mount(this.htmlElement.querySelector(`[data-js-id="${a$b.CUSTOM_VIEW_CONTAINER}"]`)),this.customLocationsView.mapViewAnchorPositionsForFramePoint=h=>this.viewAnchorPositionsForFrameAnchorPositions(h),this.containerElement=this.htmlElement.querySelector(`.${a$a.CONTAINER_CLASS_NAME}`),this.cameraPaintboardElement=this.containerElement.querySelector('[data-js-id="camera-paintboard"]'),this.singleImageUploaderPaintboardElement=this.containerElement.querySelector('[data-js-id="singleimage-paintboard"]');let i=this.cameraPaintboardElement.querySelector("canvas");this.canvasElement==null?this.canvasElement=i:i.replaceWith(this.canvasElement);let r=this.cameraPaintboardElement.querySelector('[data-js-id="frozen-frame"]');this.frozenFrame==null?this.frozenFrame=r:r.replaceWith(this.frozenFrame),this.controlsElement=this.cameraPaintboardElement.querySelector(a$9.tag),this.cameraRecoveryElement=this.cameraPaintboardElement.querySelector(`.${a$a.CAMERA_RECOVERY_CLASS_NAME}`),this.errorElement=this.cameraPaintboardElement.querySelector(`.${a$a.ERROR_CLASS_NAME}`),this.lastFrameSourceState!=null&&((s=(n=this._context)==null?void 0:n.frameSource)==null||s.switchToDesiredState(this.lastFrameSourceState)),document.addEventListener("visibilitychange",this.visibilityListener);for(let h of ["touchend","mousedown"])this.cameraRecoveryElement.addEventListener(h,this.cameraRecoveryListener);this.htmlElementState&&this.htmlElementState.removeListeners(),this.htmlElementState=new a$f(this.htmlElement),this.htmlElementState.onStateChanged(this.htmlElementDidChangeHandler),this.htmlElementState.onDisconnected(this.htmlElementDisconnectedHandler),this.gestureRecognizer=new a$g(this.htmlElement),this.gestureRecognizer.addListener({onTap:async h=>{var m;(m=this.privateContext)==null||m.workerCommand("onTap",{point:h.toJSONObject()});}});}setupHtmlElementSingleImageUploader(e){var i;if(this.singleImageUploaderPaintboardElement==null)return;this.singleImageUploaderView&&this.singleImageUploaderView.unmount(),this.singleImageUploaderView=new a$h(e),this.singleImageUploaderView.mount(this.containerElement.querySelector('[data-js-id="singleimage-paintboard"]'));let t=(i=this._context)==null?void 0:i.frameSource;this.singleImageUploaderView.onInputCheck(r=>{t.getCurrentState()!=="starting"&&r.preventDefault();}),this.singleImageUploaderView.onBeforeFileRead(()=>{t._context&&this.singleImageUploaderView&&(this.singleImageUploaderView.canUploadFile=t._context.hasEnabledMode());}),this.singleImageUploaderView.onImageLoadError(()=>{t.currentState="starting",a$i.log(a$i.Level.Error,"Could not load image from selected file");}),this.singleImageUploaderView.onFileReaderError(r=>{var n,s;let a=r.target;t.currentState="starting",a$i.log(a$i.Level.Error,`Error while reading the file: ${(s=(n=a.error)==null?void 0:n.toString())!=null?s:""}`);}),this.singleImageUploaderView.onCaptureReady(async r=>{await t.processUploadedFileCapture(r);}),this.singleImageUploaderView.setButtonState(t.getCurrentState()==="starting"?"enabled":"disabled"),t.addView(this.singleImageUploaderView);}setupHtmlElementVisibility(e){this.cameraPaintboardElement!=null&&(this.cameraPaintboardElement.hidden=e!=="camera"),this.singleImageUploaderPaintboardElement!=null&&(this.singleImageUploaderPaintboardElement.hidden=e!=="singleImageUploader");}createStyles(){if(document.querySelector("style[scandit]")===null){let e=a$j();for(let[t,i]of Object.entries(e))i.setAttribute("scandit",`data-capture-sdk-${t}`),document.head.append(i);}}async onOrientationChange(e){var t,i;this.orientation=e.detail.value,await((i=this.privateContext)==null?void 0:i.update([{type:"viewChange",newValue:{...(t=this.htmlElementState)==null?void 0:t.toJSONObject(),orientation:this.orientation}}]));}htmlElementDidChange(){var i,r;if(!this.htmlElementState)return;let e=this.htmlElementState,t=e.toJSONObject();if(!a$f.areEquivalentJSONStates(this.lastHtmlElementState,t)){this.orientation=this.orientationObserver.orientation.value,(i=this.privateContext)==null||i.update([{type:"viewChange",newValue:{...e.toJSONObject(),orientation:this.orientation}}]),this.lastHtmlElementState=t,(r=this.canvasDrawer)==null||r.updateCanvasSizeAttributes(this.width,this.height),this.handleVideoDisplay(t.visible);for(let a of this.listeners)typeof a.didChangeSize=="function"&&a.didChangeSize(this,new a$k(t.size.width.value,t.size.height.value),this.orientation);}}async htmlElementDisconnected(){var e,t,i,r,a,n;this.isVideoElementDetached=false,d.instance().disconnectedCallback(),this.lastFrameSourceState=(t=(e=this._context)==null?void 0:e.frameSource)==null?void 0:t.getCurrentState(),await((r=(i=this._context)==null?void 0:i.frameSource)==null?void 0:r.switchToDesiredState("off")),await((n=this.privateContext)==null?void 0:n.update([{type:"viewChange",newValue:{...(a=this.htmlElementState)==null?void 0:a.toJSONObject(),orientation:this.orientation}}]));}handleVideoDisplay(e){this.videoElement==null||this.cameraPaintboardElement==null||(!e&&!this.isVideoElementDetached?(this.videoElement.width=0,this.videoElement.height=0,this.videoElement.style.opacity="0",this.videoElement.style.visibility="hidden",document.body.append(this.videoElement),this.isVideoElementDetached=true):e&&this.isVideoElementDetached&&(this.cameraPaintboardElement.insertAdjacentElement("afterbegin",this.videoElement),this.isVideoElementDetached=false,this.videoElement.style.removeProperty("visibility"),this.videoElement.removeAttribute("width"),this.videoElement.removeAttribute("height"),this.videoElement.style.removeProperty("opacity")));}isCanvasDrawerWithMetrics(e){return e instanceof a$l}onWorkerMessage(e){var t,i;switch(e.type){case "draw":{this.drawEngineCommands(e.payload);break}case "performanceMetricsReport":{let r=this._canvasDrawer;r!=null&&this.isCanvasDrawerWithMetrics(r)&&r.setPerformanceMetrics(e.payload);break}case "contextDidChangeStatus":{let r=a$m.fromJSON(e.payload);(t=this.loadingOverlay)==null||t.hide(),r.isValid?(this.clearError(),this.setVideoElementOpacity("1")):this.displayError(r);break}default:{(i=this.hintPresenter)==null||i.handleMessage(e);break}}}async onBeforeShowToasts(){var t,i;let e=await((t=this._context)==null?void 0:t.workerCommand("getViewfinderInfo",{}));if((e==null?void 0:e.rect)!=null){if(e.rect.origin.x===0&&e.rect.origin.y===0&&e.rect.size.width===0&&e.rect.size.height===0)return;(i=this.hintPresenter)==null||i.setViewFinderRect(new a$n(new a$5(e.rect.origin.x,e.rect.origin.y),new a$k(e.rect.size.width,e.rect.size.height)));}}drawEngineCommands(e){var t;(t=this.canvasDrawer)==null||t.draw(e);}displayError(e){this.errorElement.textContent=`Error ${e.code}: ${e.message}`,this.errorElement.hidden=false;}clearError(){this.errorElement.textContent="",this.errorElement.hidden=true;}updateControls(){var e;for(let t of this.controls)(e=t.update)==null||e.call(t,this);}async onFrameSourceChange(e){let t=e==null?void 0:e.type;if(this.setupHtmlElementVisibility(t),t==="camera"){let i=e==null?void 0:e.getCurrentState();i!=null&&await this.onCameraStateChanged(i);}else t==="singleImageUploader"&&this.setupHtmlElementSingleImageUploader(e.settings);}async onCameraStateChanged(e){var t;switch((t=this.cameraPaintboardElement)==null||t.classList.toggle(a$a.PAINTBOARD_CLASS_NAME_STATE_ON,e==="on"),e){case "stopping":{this.hiddenProperties.freezeFrameWhenStoppingFrameSource&&this.freezeFrame(),this.setVideoElementOpacity("0");return}case "starting":case "bootingUp":case "wakingUp":{if(!this.htmlElement){a$i.error("cannot set frame source stream before connecting view to an HTML element");return}this.videoElement&&(d.instance().gui.isCameraRecoveryVisible=this.isCameraRecoveryVisible.bind(this),d.instance().gui.setCameraRecoveryVisible=this.setCameraRecoveryVisible.bind(this),this.setVideoElementOpacity("0"));return}case "off":{this.setVideoElementOpacity("0"),this.updateControls();return}case "on":{await d.instance().waitForCapabilities(),this.updateControls(),this.unfreezeFrame(),this.setVideoElementOpacity("1");break}case "goingToSleep":{this.freezeFrame();break}}}setVideoElementOpacity(e){this.videoElement&&(this.videoElement.style.opacity=e),this.canvasElement&&(this.canvasElement.style.opacity=e);}onSingleImageUploaderSettingsChange(e){this.setupHtmlElementSingleImageUploader(e);}setHiddenProperty(e,t){this.hiddenProperties[e]=t;}async onVisibilityChange(){var t,i;let e=(t=this.videoElement)==null?void 0:t.srcObject;if(this.hiddenProperties.stopVideoTracksOnVisibilityChange&&(document.visibilityState==="hidden"&&d.instance().stopVideoTracks(),document.visibilityState==="visible"&&d.instance().activeCamera!=null&&e!=null))if(!e.active||(i=e.getVideoTracks()[0])!=null&&i.muted)try{a$i.debug('Detected visibility change ("visible") event with inactive video source, try to reinitialize camera'),await d.instance().reinitializeCamera();}catch{}else a$i.debug('Detected visibility change ("visible") event with active video source, replay video'),d.instance().playVideo();}async cameraRecovery(e){e.preventDefault(),d.instance().activeCamera=d.instance().selectedCamera,await d.instance().reinitializeCamera();}freezeFrame(){var i;if(!this.frozenFrame)return;let e=d.instance().getCurrentFrame();if(!e)return;let t=new ImageData(e.data,e.width,e.height);this.frozenFrameCanvas.width=t.width,this.frozenFrameCanvas.height=t.height,this.frozenFrame.width=t.width,this.frozenFrame.height=t.height,(i=this.frozenFrameCanvas.getContext("2d"))==null||i.putImageData(t,0,0),this.frozenFrame.src=this.frozenFrameCanvas.toDataURL("image/jpeg",.4),this.frozenFrame.classList.toggle(a$a.MIRRORED_CLASS_NAME,d.instance().isMirrorImageEnabled()),this.frozenFrame.hidden=false;}unfreezeFrame(){this.frozenFrame&&(this.frozenFrame.src="",this.frozenFrame.hidden=true);}};export{$ as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a as a$2}from'./chunk-SEAVQZN6.js';import {a}from'./chunk-DQ2IFWM5.js';import {a as a$5}from'./chunk-AIRWHLJH.js';import {a as a$4}from'./chunk-FGO2SSRS.js';import {a as a$1}from'./chunk-QCRFVRSS.js';import {b}from'./chunk-FTD535WI.js';import {a as a$3}from'./chunk-XR65N6EG.js';var h=class{constructor(a$3,e){this.onMessageListener=this.onMessage.bind(this);this.workerSelf=a$3,this.dataCaptureInstance=new a(e,{postMessage:this.postMessage.bind(this),getOffscreenCanvas:this.getOffscreenCanvas.bind(this)}),a$1(a$3)&&(a$2(a$3),this.listenToMessages());}listenToMessages(){this.workerSelf.addEventListener("message",this.onMessageListener),this.workerSelf.addEventListener("error",a=>{a$3.log(a$3.Level.Error,a);}),this.workerSelf.addEventListener("messageerror",a=>{a$3.log(a$3.Level.Error,a);});}postMessage(a,e){this.workerSelf.postMessage(a,e!=null?e:[]);}getOffscreenCanvas(){if(this.isOffscreenCanvasSupported())return new this.workerSelf.OffscreenCanvas(32,32)}isOffscreenCanvasSupported(){return typeof this.workerSelf.OffscreenCanvas=="function"}hasPayload(a){return a$4(a)&&"payload"in a}hasTransferables(a){return a$4(a)&&Array.isArray(a.transferables)}async respondWith(a,e,l){let r=null,t;try{t=l(),t instanceof Promise&&(t=await t);}catch(m){t=void 0,r=a$5(m);}let i={type:"workerTaskId",command:a,id:e,payload:this.hasPayload(t)?t.payload:void 0};r!=null&&(i.error=r),this.postMessage(i,this.hasTransferables(t)?t.transferables:[]);}onMessage(a){switch(a.data.command){case "loadLibrary":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.loadLibrary({libraryLocation:e.libraryLocation,locationPath:e.locationPath,referredOrigin:e.referredOrigin,writableDataPathOverride:e.writableDataPathOverride,threadsSupport:e.threadsSupport,simdSupport:e.simdSupport,verifyResponseHash:e.verifyResponseHash,fixedWasmMemory:e.fixedWasmMemory}));}break}case "onTap":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>{this.dataCaptureInstance.onTap(e.point);});}break}case "hintPresenterV2update":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>{this.dataCaptureInstance.hintPresenterV2Update();});}break}case "createContext":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.createContext({context:e.context,deviceId:e.deviceId,delayedRegistration:e.delayedRegistration,highEndBlurryRecognition:e.highEndBlurryRecognition,appName:e.appName,parentDomain:e.parentDomain}));}break}case "setFrameSource":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.setFrameSource(e.mirrorAxis,e.isCameraFrameSource));}break}case "processFrame":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.processFrame({data:e.data,width:e.width,height:e.height,colorType:e.colorType}));}break}case "requestFrameData":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.requestFrameData(e.frameId));}break}case "deleteFrameData":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>{this.dataCaptureInstance.deleteFrameData(e.frameId);});}break}case "updateContext":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.updateContext(e));}break}case "dispose":{this.respondWith(a.data.command,a.data.id,()=>this.dataCaptureInstance.dispose());break}case "flushAnalytics":{this.respondWith(a.data.command,a.data.id,()=>{this.dataCaptureInstance.flushAnalytics();});break}case "reportCameraProperties":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.reportCameraProperties(e));}break}case "setLogLevel":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>{a$3.setLevel(e.level);});}break}case "extractCentaurusLicense":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.extractCentaurusLicense(e.licenseKey));}break}case "documentVisibility":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>{this.dataCaptureInstance.onDocumentVisibilityChange(e.state);});}break}case "isFeatureSupported":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.isFeatureSupported(e.feature));}break}case "getViewfinderInfo":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.getViewfinderInfo());}break}case "getOpenSourceSoftwareLicenseInfo":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.getOpenSourceSoftwareLicenseInfo());}break}case "addNativeOverlay":this.dataCaptureInstance.addNativeOverlay(a);break;case "removeNativeOverlay":this.dataCaptureInstance.removeNativeOverlay(a);break;case "convertToJPEGResult":{{let{data:e}=a;this.dataCaptureInstance.convertToJPEGResult(e.imageId,e.result);}break}default:return b(a.data),false}return true}};export{h as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-5JAPQHXF.js';import {a as a$1}from'./chunk-3A4KLILV.js';import {a as a$2}from'./chunk-UWBNF47P.js';var e=class e extends a{static create(){return document.createElement(e.tag)}static register(){a$1({[e.tag]:e});}render(){return a$2`<style>${e.tag}{display:flex}</style><svg width="${this.size}" height="${this.heightForViewbox(32,32)}" viewBox="0 0 32 32" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M16.625 15C15.8656 15 15.25 15.6156 15.25 16.375C15.25 17.1344 15.8656 17.75 16.625 17.75C17.3844 17.75 18 17.1344 18 16.375C18 15.6156 17.3844 15 16.625 15ZM12.5 16.375C12.5 14.0968 14.3468 12.25 16.625 12.25C18.9032 12.25 20.75 14.0968 20.75 16.375C20.75 18.6532 18.9032 20.5 16.625 20.5C14.3468 20.5 12.5 18.6532 12.5 16.375Z" fill="${this.fill}"/><path fill-rule="evenodd" clip-rule="evenodd" d="M22.5277 13.2223C23.0647 13.7592 23.9353 13.7592 24.4723 13.2223C25.0092 12.6853 25.0092 11.8147 24.4723 11.2777L24.0695 10.875H24.875C25.6344 10.875 26.25 11.4906 26.25 12.25V21.875C26.25 22.6344 25.6344 23.25 24.875 23.25H16.625C15.8656 23.25 15.25 23.8656 15.25 24.625C15.25 25.3844 15.8656 26 16.625 26H24.875C27.1532 26 29 24.1532 29 21.875V12.25C29 9.97183 27.1532 8.125 24.875 8.125H24.0695L24.4723 7.72227C25.0092 7.1853 25.0092 6.3147 24.4723 5.77773C23.9353 5.24076 23.0647 5.24076 22.5277 5.77773L19.7777 8.52773C19.5199 8.78559 19.375 9.13533 19.375 9.5C19.375 9.86467 19.5199 10.2144 19.7777 10.4723L22.5277 13.2223Z" fill="${this.fill}"/><path fill-rule="evenodd" clip-rule="evenodd" d="M12.5 7.4375C12.5 7.0578 12.8078 6.75 13.1875 6.75H19.375C20.1344 6.75 20.75 6.13439 20.75 5.375C20.75 4.61561 20.1344 4 19.375 4H13.1875C11.289 4 9.75 5.53902 9.75 7.4375C9.75 7.8172 9.4422 8.125 9.0625 8.125H8.375C6.09683 8.125 4.25 9.97183 4.25 12.25V21.875C4.25 24.1532 6.09683 26 8.375 26H9.18046L8.77773 26.4027C8.24076 26.9397 8.24076 27.8103 8.77773 28.3473C9.3147 28.8842 10.1853 28.8842 10.7223 28.3473L13.4723 25.5973C14.0092 25.0603 14.0092 24.1897 13.4723 23.6527L10.7223 20.9027C10.1853 20.3658 9.3147 20.3658 8.77773 20.9027C8.24076 21.4397 8.24076 22.3103 8.77773 22.8473L9.18046 23.25H8.375C7.61561 23.25 7 22.6344 7 21.875V12.25C7 11.4906 7.61561 10.875 8.375 10.875H9.0625C10.961 10.875 12.5 9.33598 12.5 7.4375Z" fill="${this.fill}"/></svg>`}};e.tag="scandit-camera-switch-reverse-icon";var C=e;export{C as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-BDLLVGRH.js';function t(a){let e="document"in globalThis?globalThis.document:void 0,n=e==null?void 0:e.createRange().createContextualFragment(a);if(n)return n.firstElementChild}var r={Settings:{iconElement:t(atob(a)),informationElement:t("<p data-scandit-default>(This text is updated from translations)</p>"),buttonElement:t("<div data-scandit-default>(This text is updated from translations)</div>"),containerStyle:{backgroundColor:"#FFFFFF"},iconStyle:{fill:"#121619"},informationStyle:{color:"#121619",marginBottom:"2em"},buttonStyle:{color:"#FFFFFF",backgroundColor:"#121619",fontWeight:"bold",padding:"1.25em",width:"12em",textAlign:"center",textTransform:"uppercase"},onlyCameraCapture:false}};export{r as a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {b}from'./chunk-VBUDN72N.js';import {a as a$1}from'./chunk-XR65N6EG.js';async function a(l){if(!b.isAnimationApiSupported()||l)try{l?a$1.debug("Force loading animation polyfill as requested."):a$1.debug("Web Animation API not fully supported, you might need to add https://www.npmjs.com/package/web-animations-js polyfill to see some animations.");let{polyfill:o}=await import('../private/utils/AnimationSimplePolyfill.js');o();}catch(o){a$1.warn("Error importing AnimationSimplePolyfill.js, the Animation API will not be polyfilled. This is not a problem for most browsers, but it might be a problem for older browsers like Chrome 75<",o);}}async function f(l){if(typeof globalThis.structuredClone!="function"||l)try{l?a$1.debug("Force loading structuredClone polyfill as requested."):a$1.debug("structuredClone API not supported, loading polyfill for older browsers.");let{structuredClonePolyfill:o}=await import('../private/utils/structuredClonePolyfill.js');o();}catch(o){a$1.warn("Error importing structuredClonePolyfill.js, the structuredClone API will not be polyfilled. This might cause issues in older browsers.",o);}}async function d(l={}){let{forceAnimationPolyfill:o=false,forceStructuredClonePolyfill:t=false,forceAllPolyfills:i=false}=l,n=i||o,s=i||t;await Promise.all([a(n),f(s)]);}
|
|
2
|
+
export{d as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-R6E4CT22.js';import {b}from'./chunk-VBUDN72N.js';import {a as a$1}from'./chunk-XR65N6EG.js';var d="orientationchange",n={"portrait-primary":{type:"portrait-primary",angle:0,value:"portrait"},"portrait-secondary":{type:"portrait-secondary",angle:180,value:"portraitUpsideDown"},"landscape-primary":{type:"landscape-primary",angle:90,value:"landscapeLeft"},"landscape-secondary":{type:"landscape-secondary",angle:270,value:"landscapeRight"}},l=class extends EventTarget{constructor(){super(...arguments);this.orientation={value:"portrait",type:"portrait-primary",angle:0};this._landscapeOrientationMediaQuery=null;this.screenOrientationChangeListener=this.onScreenOrientationChange.bind(this);this.landscapeOrientationMediaQueryChangeListener=this.onLandscapeOrientationMediaQueryChange.bind(this);this.windowResizeListener=a(this.handleWindowResize.bind(this),700);this.lastWidth=null;this.lastHeight=null;}get landscapeOrientationMediaQuery(){return this._landscapeOrientationMediaQuery===null&&(this._landscapeOrientationMediaQuery=globalThis.matchMedia("(orientation: landscape)")),this._landscapeOrientationMediaQuery}get isIosPwaMode(){return b.isIOS()&&(b.isPwaDisplayMode("standalone")||b.isPwaDisplayMode("fullscreen")||b.isPwaDisplayMode("minimal-ui"))}register(){var e,i;this.isScreenOrientationApiSupported()&&!this.isIosPwaMode?(screen.orientation.addEventListener("change",this.screenOrientationChangeListener),this.onScreenOrientationChange()):this.isIosPwaMode?((e=globalThis.addEventListener)==null||e.call(globalThis,"resize",this.windowResizeListener),this.handleWindowResize()):((i=this.landscapeOrientationMediaQuery)==null||i.addEventListener("change",this.landscapeOrientationMediaQueryChangeListener),this.onLandscapeOrientationMediaQueryChange(new MediaQueryListEvent("change",{matches:this.landscapeOrientationMediaQuery.matches})));}unregister(){globalThis.removeEventListener("resize",this.windowResizeListener),this.isScreenOrientationApiSupported()&&screen.orientation.removeEventListener("change",this.screenOrientationChangeListener),this.landscapeOrientationMediaQuery.removeEventListener("change",this.landscapeOrientationMediaQueryChangeListener);}isScreenOrientationApiSupported(){return "screen"in globalThis&&"orientation"in screen&&typeof screen.orientation.addEventListener=="function"}dispatchOrientationChangeEvent(e){this.dispatchEvent(new CustomEvent(d,{detail:e}));}onScreenOrientationChange(){this.orientation=n[screen.orientation.type],this.dispatchOrientationChangeEvent(this.orientation);}onLandscapeOrientationMediaQueryChange(e){let i=e;this.orientation=i.matches?n["landscape-primary"]:n["portrait-primary"],this.dispatchOrientationChangeEvent(this.orientation);}handleWindowResize(){let e=globalThis.innerWidth,i=globalThis.innerHeight,r=this.lastWidth===null||this.lastHeight===null;if(!r&&e===this.lastWidth&&i===this.lastHeight)return;let a=e>i?n["landscape-primary"]:n["portrait-primary"];(r||this.orientation.value!==a.value)&&(a$1.debug("OrientationObserver: dispatching orientation change event",{newOrientation:a,currentOrientation:this.orientation}),this.orientation=a,this.dispatchOrientationChangeEvent(this.orientation)),this.lastWidth=e,this.lastHeight=i;}};export{d as a,l as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a as a$1}from'./chunk-AZWFNBVA.js';var s={type:"none"},c=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=a$1.sizeWithWidthAndHeight(t),i}static withWidthAndAspectRatio(t,i){let e=new n;return e._sizeWithUnitAndAspect=a$1.sizeWithWidthAndAspectRatio(t,i),e}static withHeightAndAspectRatio(t,i){let e=new n;return e._sizeWithUnitAndAspect=a$1.sizeWithHeightAndAspectRatio(t,i),e}toJSONObject(){return {type:this.type,size:this.sizeWithUnitAndAspect.toJSONObject()}}};export{s as a,c as b,a as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-CRUOVJHW.js';function i(t){var f,c,a,s,l,x;let u=t.style,m={cornerRadius:4,fitToText:false,hintAnchor:"top",hintAnchorOffset:16,horizontalMargin:16,isAnimatedToView:true,lineHeight:24,maxLines:2,maxWidthFraction:1,textAlignment:"start",textSize:14,textWeight:700},n,o,e;switch(u){case "success":n="check",o="28d37fcc",e="ffffffff";break;case "error":n="exclamationMark",o="f94444cc",e="ffffffff";break;case "warning":n="exclamationMark",o="f9bf2bcc",e="111619ff";break;case "info":n="exclamationMark",o="111619cc",e="ffffffff";break;default:n="none",o="111619cc",e="ffffffff";break}return t.icon&&(n="none"),{hintStyle:{...m,hintIcon:n,backgroundColor:(c=(f=t.backgroundColor)==null?void 0:f.toJSON())!=null?c:o,textColor:(s=(a=t.textColor)==null?void 0:a.toJSON())!=null?s:e,iconColor:(x=(l=t.textColor)==null?void 0:l.toJSON())!=null?x:e},tag:t.tag,text:t.message}}var h=i(new a("Error","an-error","error")),k=i(new a("Success","a-success","success")),C=i(new a("Warning","a-warning","warning")),H=i(new a("Info","an-info","info"));export{i as a,h as b,k as c,C as d,H as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t=class{constructor(o,r,i,e,l,s){this._message=o,this._tag=r,this._style=i,this._icon=e,this._textColor=l,this._backgroundColor=s;}get tag(){return this._tag}get message(){return this._message}get style(){return this._style||null}get icon(){return this._icon||null}get textColor(){return this._textColor}get backgroundColor(){return this._backgroundColor}};export{t as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-5JAPQHXF.js';import {a as a$1}from'./chunk-3A4KLILV.js';import {a as a$2}from'./chunk-UWBNF47P.js';var e=class e extends a{static create(){return document.createElement(e.tag)}static register(){a$1({[e.tag]:e});}render(){return a$2`<style>${e.tag}{display:flex}</style><svg width="${this.size}" height="${this.heightForViewbox(32,32)}" viewBox="0 0 32 32" fill="none"><rect opacity="0.5" width="32" height="32" rx="16" fill="white"/><path d="M12.2881 21.1436C12.8965 21.1436 13.3066 20.7334 13.3066 20.1113V12.1406C13.3066 11.4297 12.8691 10.9854 12.1377 10.9854C11.7139 10.9854 11.3857 11.0469 10.9072 11.375L8.95215 12.7285C8.63086 12.9541 8.50781 13.1865 8.50781 13.501C8.50781 13.9385 8.81543 14.2393 9.23242 14.2393C9.44434 14.2393 9.58789 14.1914 9.7793 14.0547L11.2217 13.0498H11.2627V20.1113C11.2627 20.7334 11.6797 21.1436 12.2881 21.1436ZM16.9023 20.3164C17.2441 20.3164 17.4014 20.1865 17.6816 19.9131L19.3633 18.2451L21.0381 19.9062C21.3184 20.1865 21.4824 20.3164 21.8174 20.3164C22.2617 20.3164 22.6377 19.9746 22.6377 19.5234C22.6377 19.2158 22.4873 19.0176 22.2549 18.7852L20.5254 17.0488L22.2549 15.3057C22.4873 15.0732 22.6377 14.875 22.6377 14.5674C22.6377 14.1162 22.2617 13.7744 21.8174 13.7744C21.4824 13.7744 21.3184 13.9043 21.0381 14.1846L19.3633 15.8457L17.6885 14.1846C17.4082 13.9043 17.251 13.7744 16.9092 13.7744C16.4648 13.7744 16.0889 14.1162 16.0889 14.5674C16.0889 14.8818 16.2393 15.0732 16.4717 15.3057L18.1943 17.0488L16.4717 18.7852C16.2324 19.0244 16.0889 19.2158 16.0889 19.5234C16.0889 19.9814 16.458 20.3164 16.9023 20.3164Z" fill="white"/></svg>`}};e.tag="scandit-camera-fov-wide-icon";var r=e;export{r as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a as a$6}from'./chunk-4ZAHOKYN.js';import {a as a$7}from'./chunk-G2BRTVN7.js';import {c as c$1,a as a$8}from'./chunk-4W2T3TLN.js';import {c}from'./chunk-UWLAKRB2.js';import {a}from'./chunk-F6TT5US7.js';import {a as a$1}from'./chunk-3LVMEVOI.js';import {a as a$4}from'./chunk-X4LJRWLI.js';import {d}from'./chunk-AIC4H5KG.js';import {a as a$3}from'./chunk-O7TZTIHO.js';import {a as a$2}from'./chunk-XR65N6EG.js';import {a as a$5}from'./chunk-QCZSSQAQ.js';var D=class D{constructor(e,t){this.hintPresenterV2=null;this.MAX_NUMBER_OF_IMAGES_IN_FRAME_DATA_POOL=10;this.redrawInterval=1e3/30;this.redrawRequests=[];this._isDrawLoopRunning=false;this.frameDataPool=new Map;this.lastFrameColorType="RGBA";this.lastFrameCounter=-1;this.poorMansBenchmarkLogs=false;this.writableDataPathStandard="/scandit_sync_folder";this.resourceFilesSubfolder="resources";this.performanceMetricsReporterTimer=void 0;this.performanceMetrics={frameDataPoolSize:0,processedFramesCount:0,redrawRequestsCount:0,actualRedrawsCount:0};this.gestureListener=null;this.webPlatformHintPresenter=null;this.moduleHandler=e,this.workerFunctions=t,this._loadProgressCallback=this._loadProgressCallback.bind(this),c(this.getWasmMetadata());}get Module(){return this.moduleHandler.get()}set isDrawLoopRunning(e){this._isDrawLoopRunning=e,!e&&typeof this.loopTimeoutId=="number"&&(clearTimeout(this.loopTimeoutId),this.loopTimeoutId=void 0);}get isDrawLoopRunning(){return this._isDrawLoopRunning}convertToLoadableFrameData(e){let t=this.getNextFrameId();this.frameDataPool.set(t,{data:new Uint8ClampedArray(e.getFrameData()),colorType:this.lastFrameColorType});let s=this.lastUsedModuleMirrorAxis==null?false:this.lastUsedModuleMirrorAxis!==this.Module.Axis.None;return {frameId:t,width:e.getWidth(),height:e.getHeight(),isFrameSourceMirrored:s,colorType:this.lastFrameColorType}}createContext(e){var h,b,g,w,C;let t=this.getModeDeserializers(),s=c$1(location);(s==="localhost"||s==="127.0.0.1")&&navigator.userAgent.includes("Electron")&&e.appName!=null&&(s+=`-${e.appName}`),this.parentDomain=e.parentDomain,this.contextDeserializer=new this.Module.DataCaptureContextDeserializer(this.writableDataPath,e.deviceId,e.context.deviceModelName,s,this.parentDomain,t,e.delayedRegistration,e.highEndBlurryRecognition,this.resourcePath);let a=this.contextDeserializer.contextFromJson(JSON.stringify(e.context));if(a==null){let r=this.contextDeserializer.getLastError();throw new Error(`Could not create the context: ${r}`)}let n=a.getView();this.context=a.getContext(),a.delete();let l=this.Module.DataCaptureContextListener.extend("DataCaptureContextListener",{didChangeStatus:(r,o)=>{this.contextDidChangeStatus(JSON.parse(o.toJson())),r.delete();},didStartObservingContext:r=>{this.didStartObservingContext(),r.delete();},didStopObservingContext:r=>{r.delete();}}),u=this.Module.DataCaptureContextFrameListener.extend("DataCaptureContextFrameListener",{onObservationStarted:r=>{r.delete();},onObservationStopped:r=>{r.delete();},onFrameProcessingStarted:(r,o)=>{this.workerFunctions.postMessage({type:"onFrameProcessingStarted"}),o.delete(),r.delete();},onFrameProcessingFinished:(r,o)=>{this.workerFunctions.postMessage({type:"onFrameProcessingFinished"}),o.delete(),r.delete();},onFrameSkipped:(r,o)=>{this.workerFunctions.postMessage({type:"onFrameSkipped"}),o.delete(),r.delete();}}),m=this.Module.GestureRecognizer.extend("GestureRecognizer",{setGestureListener:(r,o)=>{var y;(y=this.gestureListener)==null||y.delete(),this.gestureListener=r.clone(),r.delete();}});(h=this.gestureRecognizer)==null||h.delete(),this.gestureRecognizer=new m;let c=new l;this.context.addListener(c),c.delete();let p=new u;this.context.addFrameListener(p),p.delete(),this.setView(n),(b=this.view)==null||b.setGestureRecognizer(this.gestureRecognizer);let f=this.Module.PlatformHintPresenter.extend("PlatformHintPresenter",{setHintPresenter:r=>{r.delete();},showToast:r=>{this.workerFunctions.postMessage({type:"showToast",payload:JSON.parse(r)});},hideToast:r=>{this.workerFunctions.postMessage({type:"hideToast",payload:JSON.parse(r)});},showGuidance:r=>{this.workerFunctions.postMessage({type:"showGuidance",payload:JSON.parse(r)});},hideGuidance:r=>{this.workerFunctions.postMessage({type:"hideGuidance",payload:JSON.parse(r)});},startUpdateTimer:r=>{this.workerFunctions.postMessage({type:"startUpdateTimer",payload:{duration:{unit:"ms",value:r}}});},stopUpdateTimer:()=>{this.workerFunctions.postMessage({type:"stopUpdateTimer"});}});(g=this.hintPresenterV2)==null||g.delete(),this.hintPresenterV2=null,(w=this.webPlatformHintPresenter)==null||w.delete(),this.webPlatformHintPresenter=null,this.webPlatformHintPresenter=new f,this.view&&(this.hintPresenterV2=new this.Module.HintPresenterV2(this.webPlatformHintPresenter),(C=this.view)==null||C.setHintPresenterV2(this.hintPresenterV2)),this.webImageConverterInstance=this.getImageConverterInstance({quality:1}),this.Module.ImageConverter.setInstance(this.webImageConverterInstance);}convertToJPEGResult(e,t){this.webImageConverterInstance instanceof a&&this.webImageConverterInstance.onConvertToJPEGResult(e,t);}getImageConverterInstance(e){return this.workerFunctions.getOffscreenCanvas()!=null?new a$1(e):new a(this.workerFunctions,e)}onTap(e){var t;(t=this.gestureListener)==null||t.onTap(JSON.stringify(e));}hintPresenterV2Update(){var e;(e=this.hintPresenterV2)==null||e.update();}startReportingPerformanceMetrics(){this.performanceMetricsReporterTimer==null&&(this.performanceMetricsReporterTimer=setInterval(()=>{this.reportPerformanceMetrics();for(let e of Object.keys(this.performanceMetrics))this.performanceMetrics[e]=0;},1e3));}async reportPerformanceMetrics(){this.workerFunctions.postMessage({type:"performanceMetricsReport",payload:{...this.performanceMetrics}});}deleteFrameData(e){this.frameDataPool.delete(e);}dispose(){var e,t,s,a;this.context.dispose(),this.frameDataPool.clear(),this.isDrawLoopRunning=false,this.lastFrameCounter=-1,(e=this.gestureRecognizer)==null||e.delete(),this.gestureRecognizer=null,(t=this.gestureListener)==null||t.delete(),this.gestureListener=null,(s=this.hintPresenterV2)==null||s.delete(),this.hintPresenterV2=null,(a=this.webPlatformHintPresenter)==null||a.delete(),this.webPlatformHintPresenter=null;}flushAnalytics(){this.context.flushAnalytics();}extractCentaurusLicense(e){return {payload:{centaurus:{licenseKey:this.Module.LicenseUtils[D.get3dPartyLicenseKeyMethodName](e)}}}}getModeDeserializers(){return new this.Module.VectorDataCaptureModeDeserializer}loadLibrary(e){return this.libraryLoadingPromise!=null?this.libraryLoadingPromise:(this.libraryLoadingPromise=this.setup(e),this.libraryLoadingPromise)}processFrame(e){var n;if(this.context==null)return {payload:e,transferables:[e.data.buffer]};let t=e.data,s=e.colorType==="GRAYSCALE"?this.Module.ImageBufferFormat.Grayscale8:this.Module.ImageBufferFormat.Rgba8888;this.lastFrameColorType=e.colorType==="GRAYSCALE"?"GRAYSCALE":"RGBA";let a=this.Module.allocateUint8Array(t.byteLength);return this.Module.HEAPU8.set(t,a),(n=this.imageFrameSource)==null||n.outputFrame(a,e.width,e.height,s),{payload:e,transferables:[e.data.buffer]}}reportCameraProperties(e){this.context.setCameraProperties(e.deviceId,e.isFrontFacing,e.hasAutofocus);}requestFrameData(e){var a;let{data:t,colorType:s}=(a=this.frameDataPool.get(e))!=null?a:{data:null,colorType:null};return t==null?{payload:{data:null,colorType:null}}:{payload:{data:t,colorType:s},transferables:[t.buffer]}}scheduleRedraw(e,t){this.addRedrawRequest(t),this.isDrawLoopRunning||this.startDrawLoop(e);}sendViewRefreshCommands(e){this.workerFunctions.postMessage({type:"draw",payload:e},[e.buffer]);}setFrameSource(e,t){var s;this.lastUsedModuleMirrorAxis=this.mapMirrorAxisOnModule(e),(s=this.imageFrameSource)==null||s.delete(),this.imageFrameSource=new this.Module.ImageBufferFrameSource(this.lastUsedModuleMirrorAxis,t,0),this.context.setFrameSource(this.imageFrameSource);}startDrawLoop(e){this.isDrawLoopRunning=true;let t=n=>this.redrawRequests.length>0&&this.redrawRequests[0]<=n,s=n=>{for(;this.redrawRequests.length>0&&this.redrawRequests[0]<=n;)this.redrawRequests.shift();},a=()=>{this.loopTimeoutId=setTimeout(()=>{if(!this.isDrawLoopRunning)return;let n=performance.now();if(t(n)){s(n),e.draw();let l=e.getDrawCommands();this.sendViewRefreshCommands(new Uint8Array(l));}a();},this.redrawInterval);};a();}updateContext(e){if(this.context!=null&&this.contextDeserializer!=null){e.view!=null&&!e.view.visible&&this.context.flushAnalytics();let t=this.onBeforeUpdateContextHook(e),s=this.contextDeserializer.updateContextFromJson(this.context,this.view,JSON.stringify(t.context));if(s==null){let n=this.contextDeserializer.getLastError();throw new Error(`Could not update the context: ${n}`)}this.context.delete(),this.context=s.getContext();let a=s.getView();s.delete(),a!=null&&t.view!=null&&a.setViewSize(t.view.width,t.view.height,t.view.orientation),!this.hintPresenterV2&&this.webPlatformHintPresenter&&(this.hintPresenterV2=new this.Module.HintPresenterV2(this.webPlatformHintPresenter)),a!=null&&this.hintPresenterV2&&a.setHintPresenterV2(this.hintPresenterV2),this.gestureRecognizer!=null&&(a==null||a.setGestureRecognizer(this.gestureRecognizer)),this.setView(a),a$2.debug("context updated",t);}}onBeforeUpdateContextHook(e){return e}onDocumentVisibilityChange(e){e==="hidden"&&this.context.flushAnalytics();}isFeatureSupported(e){return {payload:{supported:this.context.isFeatureSupported(e)}}}getViewfinderInfo(){var e,t;return {payload:{isDisplayingViewfinder:(t=(e=this.view)==null?void 0:e.isDisplayingViewfinder())!=null?t:false,rect:JSON.parse(this.view.getViewfinderRect())}}}getOpenSourceSoftwareLicenseInfo(){return {payload:{licenseText:this.Module.OpenSourceSoftwareLicenseInfo.getLicenseText()}}}getNextFrameId(){return this.lastFrameCounter++,this.lastFrameCounter>=this.MAX_NUMBER_OF_IMAGES_IN_FRAME_DATA_POOL&&(this.lastFrameCounter=0),this.lastFrameCounter}getWasmDynamicLibraries(e){return this.getWasmSideModuleFileName()==null?[]:[`${e.replace(/\/[^/]*$/,"/")}${this.getWasmSideModuleFileName()}`]}getWasmCoreExpectedHash(e,t){return t?e?globalThis.SDC_WASM_CORE_MT_SIMD_HASH:globalThis.SDC_WASM_CORE_MT_HASH:e?globalThis.SDC_WASM_CORE_SIMD_HASH:""}getWasmCoreFileName(e,t){return t?e?globalThis.SDC_WASM_CORE_MT_SIMD_FILE_NAME:globalThis.SDC_WASM_CORE_MT_FILE_NAME:e?globalThis.SDC_WASM_CORE_SIMD_FILE_NAME:""}getWasmMetadata(){return globalThis.WASM_METADATA}getWasmSideModuleFileName(){return ""}_loadProgressCallback(e){this.workerFunctions.postMessage({type:"loadLibraryProgress",payload:e});}addRedrawRequest(e){this.redrawRequests.push(Math.round(performance.now())+e),this.redrawRequests.sort((t,s)=>t-s);}contextDidChangeStatus(e){e.code===260?e.message=e.message.replace("domain name",`domain name (${c$1(location)})`):e.code===265&&(e.message=e.message.replace("domain name",`domain name (${this.parentDomain})`)),this.workerFunctions.postMessage({type:"contextDidChangeStatus",payload:e});}didStartObservingContext(){this.workerFunctions.postMessage({type:"didStartObservingContext"});}mapMirrorAxisOnModule(e){switch(e){case "None":return this.Module.Axis.None;case "X":return this.Module.Axis.X;case "Y":return this.Module.Axis.Y;default:return this.Module.Axis.None}}setView(e){this.view=e,this.setViewRefreshHandler(e),e==null&&(this.isDrawLoopRunning=false,this.sendViewRefreshCommands(new Uint8Array([])));}addNativeOverlay(e){a$2.warn("addNativeOverlay has not been implemented for this module",e);}removeNativeOverlay(e){a$2.warn("removeNativeOverlay has not been implemented for this module",e);}setViewRefreshHandler(e){if(e==null||e.isViewRefreshHandlerSet)return;let t=this.Module.NeedsRedrawDelegate.extend("NeedsRedrawDelegate",{setNeedsRedrawIn:this.scheduleRedraw.bind(this,e)}),s=new t;e.setNeedsRedrawDelegate(s),e.isViewRefreshHandlerSet=true;}setupDataDecoding(){let e=this.moduleHandler.get(),t=e.DataDecoding.extend("DataDecoding",{decode(s,a){try{let n=JSON.parse(a),l=[];for(let u of n){let m=new TextDecoder(u.ianaName,{fatal:true});l.push(m.decode(s.slice(u.startIndex,u.endIndex)));}return l.join("")}catch{return ""}}});e.setDataDecoding(new t);}start(e,t,s){e&&t&&(this.setupDataDecoding(),this.moduleHandler.get().callMain(),this.moduleHandler.get().__emscripten_proxy_main!==void 0||s());}getWritableDataPath(e){return e!=null?(a$2.debug(`IndexedDB database name override in use to recover from blocked standard database: ${e}`),e):this.writableDataPathStandard}numOfMBToPages(e){return Math.ceil(1024*e*1024/64/1024)}async setup({libraryLocation:e,locationPath:t,writableDataPathOverride:s,verifyResponseHash:a,referredOrigin:n,fixedWasmMemory:l,simdSupport:u,threadsSupport:m}){var v;let c=false,p=false;this.writableDataPath=this.getWritableDataPath(s),this.resourcePath=`${e}${this.resourceFilesSubfolder}/`,globalThis.path=t;let{resolve:f,reject:h,promise:b}=new a$3,g=a$4.sdkVersion();if(g==="")throw new a$5({name:"Invalid library version",message:"Library version is not defined or empty, cannot generate proper path to library files."});let w=this.getWasmCoreFileName(u,m),C=d(g,e,w),{jsURI:r,wasmURI:o}=C,y={instantiateWasm:(d,O)=>(a$8({importObject:d,wasmURI:o,expectedHash:this.getWasmCoreExpectedHash(u,m),verifyResponseHash:a,successCallback:O,progressCallback:this._loadProgressCallback,errorCallback:W=>{h(W);},referredOrigin:n}),{})},M=l===null?null:new WebAssembly.Memory({initial:this.numOfMBToPages(l),maximum:this.numOfMBToPages(300),shared:m});return M!==null&&a$2.log(a$2.Level.Debug,"Fixed wasmMemory set",M),this.moduleHandler.set({...M?{wasmMemory:M}:{},mainScriptUrlOrBlob:r,canvas:(v=this.workerFunctions.getOffscreenCanvas())!=null?v:{getContext:()=>null},...y,dynamicLibraries:this.getWasmDynamicLibraries(o),locateFile:d=>e+d,noInitialRun:true,preRun:[async()=>{try{await a$6({writableDataPath:this.writableDataPath});}catch(d){if(d.name==="BlockedIndexedDB"){h(d.toString());return}a$2.log(a$2.Level.Debug,"No IndexedDB support, some data will not be persisted:",d);}p=true,this.start(p,c,f);}],onMainComplete:()=>{if([c,p].includes(false)){a$2.log(a$2.Level.Warn,{runtimeLoaded:c,fileSystemSynced:p},"Both runtimeLoaded and fileSystemSynced should be true when calling onMainComplete"),h("onMainComplete has been called but runtime or file system was not ready.");return}f();},onRuntimeInitialized:()=>{c=true,this.start(p,c,f);},print:d=>{a$2.log(a$2.Level.Info,d);}}),await a$7(r,g)||h(`Couldn't retrieve Scandit Data Capture library at ${r}, did you configure the path for it correctly?`),b}};D.get3dPartyLicenseKeyMethodName=atob("Z2V0QmxpbmtJZExpY2Vuc2VLZXk=");var k=D;export{k as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-NQF3GUK2.js';import {a as a$2}from'./chunk-QHBIT2WY.js';import {a as a$1}from'./chunk-XR65N6EG.js';var n=class extends a{constructor(){super(...arguments);this.colorType="RGBA";}get _initialized(){return this._texture!=null&&this._framebuffer!=null}readFromSource(e){this._initialized||this.setup(),this.updateFrameSizeIfNeeded();let i=this._framePool.pop();return this._contextWebGL.texImage2D(this._contextWebGL.TEXTURE_2D,0,this._contextWebGL.RGBA,this._contextWebGL.RGBA,this._contextWebGL.UNSIGNED_BYTE,e),this._contextWebGL.readPixels(0,0,this._contextWebGL.drawingBufferWidth,this._contextWebGL.drawingBufferHeight,this._contextWebGL.RGBA,this._contextWebGL.UNSIGNED_BYTE,i),{width:this._contextWebGL.drawingBufferWidth,height:this._contextWebGL.drawingBufferHeight,data:i,colorType:this.colorType}}setup(){this._texture=this._contextWebGL.createTexture(),this._texture==null&&a$1.log(a$1.Level.Warn,"Could not create texture from WebGLRenderingContext"),this._contextWebGL.bindTexture(this._contextWebGL.TEXTURE_2D,this._texture),this._framebuffer=this._contextWebGL.createFramebuffer(),this._framebuffer==null&&a$1.log(a$1.Level.Warn,"Could not create frameBuffer from WebGLRenderingContext"),this._contextWebGL.bindFramebuffer(this._contextWebGL.FRAMEBUFFER,this._framebuffer),this._contextWebGL.framebufferTexture2D(this._contextWebGL.FRAMEBUFFER,this._contextWebGL.COLOR_ATTACHMENT0,this._contextWebGL.TEXTURE_2D,this._texture,0),this._contextWebGL.texParameteri(this._contextWebGL.TEXTURE_2D,this._contextWebGL.TEXTURE_WRAP_S,this._contextWebGL.CLAMP_TO_EDGE),this._contextWebGL.texParameteri(this._contextWebGL.TEXTURE_2D,this._contextWebGL.TEXTURE_WRAP_T,this._contextWebGL.CLAMP_TO_EDGE),this._contextWebGL.texParameteri(this._contextWebGL.TEXTURE_2D,this._contextWebGL.TEXTURE_MIN_FILTER,this._contextWebGL.NEAREST),this._contextWebGL.texParameteri(this._contextWebGL.TEXTURE_2D,this._contextWebGL.TEXTURE_MAG_FILTER,this._contextWebGL.NEAREST);}dispose(){var e;this._texture!=null&&(this._contextWebGL.deleteTexture(this._texture),this._texture=null),this._framebuffer!=null&&(this._contextWebGL.deleteFramebuffer(this._framebuffer),this._framebuffer=null),(e=this._framePool)==null||e.empty();}updateFrameSizeIfNeeded(){var o;let{drawingBufferWidth:e,drawingBufferHeight:i}=this._contextWebGL,r=e*i*4;this._frameSize!==r&&(this._frameSize=r,(o=this._framePool)==null||o.empty(),this._framePool=new a$2({capacity:this._maxPoolCapacity,lowWaterMark:this._minPoolCapacity,createItem:()=>new Uint8ClampedArray(this._frameSize)}));}};export{n as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var i=class{constructor(e,t){this._origin=e,this._size=t;}get origin(){return this._origin}get size(){return this._size}toJSONObject(){return {origin:this.origin.toJSONObject(),size:this.size.toJSONObject()}}};export{i as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t=class i{constructor(e,r){this._value=e,this._unit=r;}get value(){return this._value}get unit(){return this._unit}static fromJSON(e){return new i(e.value,e.unit)}toJSONObject(){return {unit:this.unit,value:this.value}}};export{t as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-
|
|
1
|
+
import {a as a$1}from'./chunk-IMXMNDKM.js';var a=class n{constructor(){this.type="singleImageUploader";this._settings=new a$1(null);this._desiredState="off";this.listeners=[];this._context=null;this._view=void 0;}static get default(){return new n}get desiredState(){return this._desiredState}get settings(){return this._settings}get context(){return this._context}set context(e){this._context=e;}set currentState(e){e!==this._currentState&&(this._currentState=e,this.notifyListeners(),this.notifyContext({type:"frameSourceState",newValue:e}));}get currentState(){return this._currentState}async switchToDesiredState(e){if(e==="on"){if(this.currentState==="on"||this.currentState==="starting")return}else if(this.currentState==="off"||this.currentState==="stopping")return;return this._desiredState=e,this.setCurrentState(e==="on"?"starting":"off")}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){return this._settings=e,this.notifyContext({type:"singleImageModeUploaderSettings",newValue:this._settings})}toJSONObject(){return {type:this.type,settings:this.settings.toJSONObject(),desiredState:this.desiredState}}getCurrentState(){return this._currentState}async setCurrentState(e){if(e!==this._currentState)return this._currentState=e,this.notifyListeners(),this.notifyContext({type:"frameSourceState",newValue:e})}async notifyContext(e){if(this._context)return this._context.update([e])}notifyListeners(){for(let e of this.listeners)e.didChangeState&&e.didChangeState(this,this.currentState);}async processUploadedFileCapture(e){var t,r;await((t=this._context)==null?void 0:t.sendFrameToProcessor(e)),this.currentState="starting",(r=this._view)==null||r.onAfterImageProcessed();}addView(e){this._view=e;}};export{a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-ENYHCJGH.js';var e=class r{constructor(t,h){this._width=t,this._height=h;}get width(){return this._width}get height(){return this._height}static fromJSON(t){return new r(a.fromJSON(t.width),a.fromJSON(t.height))}isSameAs(t){return JSON.stringify(this.toJSONObject())===JSON.stringify(t.toJSONObject())}toJSONObject(){return {width:this.width.toJSONObject(),height:this.height.toJSONObject()}}};export{e as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-5JAPQHXF.js';import {a as a$1}from'./chunk-3A4KLILV.js';import {a as a$2}from'./chunk-UWBNF47P.js';var e=class e extends a{static create(){return document.createElement(e.tag)}static register(){a$1({[e.tag]:e});}render(){return a$2`<style>${e.tag}{display:flex}</style><svg width="${this.size}" height="${this.heightForViewbox(24,24)}" viewBox="0 0 24 24" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" 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 12ZM12 7C11.4477 7 11 7.44772 11 8V13C11 13.5523 11.4477 14 12 14C12.5523 14 13 13.5523 13 13V8C13 7.44772 12.5523 7 12 7ZM12 17C12.5523 17 13 16.5523 13 16C13 15.4477 12.5523 15 12 15C11.4477 15 11 15.4477 11 16C11 16.5523 11.4477 17 12 17Z" fill="${this.fill}"/></svg>`}};e.tag="scandit-rounded-exclamation-mark-icon";var t=e;t.register();export{t as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-O7TZTIHO.js';import {a as a$2}from'./chunk-XR65N6EG.js';var a=class{constructor(e,t){this.workerFunctions=e;this.options=t;this.imageIdCounter=0;this.conversions=new Map;}convertToJpeg(e,t){let r=this.imageIdCounter++,n=new a$1;this.conversions.set(r,n);let o=e.toBitmap();return this.workerFunctions.postMessage({type:"convertToJPEG",imageId:r,width:e.getWidth(),height:e.getHeight(),data:o,planes:e.getPlanes(),orientation:t,quality:this.options.quality},Array.from(new Set([o.buffer]))),n.promise}onConvertToJPEGResult(e,t){let r=this.conversions.get(e);r?(r.resolve(t),this.conversions.delete(e)):a$2.warn(`
|
|
1
|
+
import {a as a$1}from'./chunk-O7TZTIHO.js';import {a as a$2}from'./chunk-XR65N6EG.js';var a=class{constructor(e,t){this.workerFunctions=e;this.options=t;this.imageIdCounter=0;this.conversions=new Map;}convertToJpeg(e,t){let r=this.imageIdCounter++,n=new a$1;this.conversions.set(r,n);let o=e.toBitmap();return this.workerFunctions.postMessage({type:"convertToJPEG",imageId:r,width:e.getWidth(),height:e.getHeight(),data:o,planes:e.getPlanes(),orientation:t,quality:this.options.quality},Array.from(new Set([o.buffer]))),n.promise}onConvertToJPEGResult(e,t){let r=this.conversions.get(e);r?(r.resolve(t),this.conversions.delete(e)):a$2.warn(`ImageConverterForwarder: Conversion for imageId ${e} not found in Map`);}};export{a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t=class{constructor(e,i){this._size=e,this._aspect=i;}get size(){return this._size}get aspect(){return this._aspect}};export{t as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {b}from'./chunk-IBDUCVB4.js';import {a as a$1}from'./chunk-LFJUGRQV.js';import {d as d$2}from'./chunk-ADFFBLII.js';import {d as d$1}from'./chunk-AFCJ24Y3.js';import {b as b$1}from'./chunk-VBUDN72N.js';import {a as a$3}from'./chunk-XR65N6EG.js';import {g}from'./chunk-3D2HNEVH.js';import {a}from'./chunk-6LHGFWQI.js';import {a as a$2}from'./chunk-QCZSSQAQ.js';d$1.addVideoDevicesListener(w=>{b.integrateIncomingVideoDevices(w.map(e=>d.fromDeviceCamera(e)));});var C;C=a$1;var s=class s{constructor(e){this._label="";this._deviceId="";this._notFoundOnDevice=false;this._isBestGuess=false;this.type="camera";this._currentState="off";this._settings=new g;this._desiredTorchState="off";this._desiredState="off";this.listeners=[];this._context=null;this[C]={markAsUnmappedToDeviceCameras:this.markAsUnmappedToDeviceCameras.bind(this),setDeviceId:this.setDeviceId.bind(this),setLabel:this.setLabel.bind(this),markAsBestGuess:this.markAsBestGuess.bind(this)};this._captureAndSendBound=this.captureAndSend.bind(this);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$2.instance();}static pickBestGuess(){return s.getOrCreate({position:"worldFacing",bestGuess:true})}static pickBestGuessForPosition(e){if(!a.availablePositions.includes(e))throw new Error(`Invalid camera position: "${e}"`);return s.getOrCreate({position:e})}static forDeviceId(e){return s.getOrCreate({deviceId:e})}static async getAll(e,t){return await d$1.getCameras(e!=null?e:false,t!=null?t:false),[...b.get()]}static getOrCreate(e){let{deviceId:t,position:r,bestGuess:i}=e,n=new s;return n._deviceId=t!=null?t:"",n.position=r!=null?r:"worldFacing",i&&n[a$1].markAsBestGuess(),b.getOrCreate(n)}static fromDeviceCamera(e){let t=new s;return t.position=e.position,t._deviceId=e.deviceId,t._label=e.label,t}get deviceId(){return this._deviceId}get label(){return this._label}get desiredState(){return this._desiredState}get settings(){return this._settings}get currentResolution(){var e;return (e=this._currentResolution)!=null?e:null}setDeviceId(e){this._deviceId=e;}setLabel(e){this._label=e;}get context(){return this._context}set context(e){this._context=e,this._context&&this.currentState==="on"&&this.startSendingCapturesToWorker();}get currentState(){return this._currentState}async switchToDesiredState(e){var t,r;if(this.currentTransitionStrategyPromise&&await this.currentTransitionStrategyPromise,this._notFoundOnDevice&&(e==="on"||e==="standby"))throw new a$2({message:`Cannot switch state to ${e}. This camera could not be mapped to a detected camera on the device. Please use another camera and delete this one.`,name:"Unmapped Camera"});return this.currentTransitionStrategyPromise=(r=(t=this.stateTransitionStrategyMap[this.currentState])==null?void 0:t[e])==null?void 0:r.call(t).catch(i=>{if(i instanceof DOMException&&i.message==="The associated Track is in an invalid state"){a$3.log(a$3.Level.Warn,i);return}throw i}),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 r;this._settings=new g(e);let t=this.settings.getProperty("grayScaleFrameReader");if(this.cameraManager.setFrameReaderType(t===true?"GRAYSCALE":"RGBA"),this.currentState==="on"||this.currentState==="standby"){let i=this.cameraManager.activeCameraSettings;(i==null?void 0:i.preferredResolution)!==this.settings.preferredResolution&&(await this.cameraManager.applyCameraSettings(this.settings),(r=this.cameraManager.activeCamera)!=null&&r.currentResolution&&(this._currentResolution={width:this.cameraManager.activeCamera.currentResolution.width,height:this.cameraManager.activeCamera.currentResolution.height})),await this.cameraManager.setZoom(this.settings.zoomFactor);let n=this.settings.getProperty("minFrameRate"),h=this.settings.getProperty("maxFrameRate");(n!=null||h!=null)&&await this.cameraManager.setFrameRate({min:n,max:h});let l=this.settings.getProperty("manualLensPosition");l!=null&&await this.cameraManager.setFocus(l);let p=this.settings.getProperty("exposureTargetBias"),S=this.settings.getProperty("exposureDuration");(p!=null||S!=null)&&await this.cameraManager.setExposure({compensation:p,time:S});}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,true),this.context&&await this.context.setFrameSource(this);}getCurrentState(){return this._currentState}async setClipArea(e){await this.cameraManager.setClipArea(e);}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{a$3.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 d$1.getCameras()).find(r=>r.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,true):this.cameraManager.setMirrorImageEnabled(this.cameraManager.isMirrorImageEnabled(),false),this.context&&await this.context.setFrameSource(this),this.cameraManager.activeCamera&&(this._deviceId=this.cameraManager.activeCamera.deviceId,this._label=this.cameraManager.activeCamera.label,this.position=this.cameraManager.activeCamera.position,this._currentResolution=this.cameraManager.activeCamera.currentResolution);}markAsUnmappedToDeviceCameras(){this._notFoundOnDevice=true;}markAsBestGuess(){this._isBestGuess=true;}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.bind(this)));}async captureAndSend(){if(this.currentState!=="on"||!this.context)return;if(!this.context.hasEnabledMode()){this._lastCaptureRequestAnimationFrame=this.cameraManager.requestVideoFrame(this._captureAndSendBound);return}let e=null;try{e=this.cameraManager.captureImage();}catch(t){a$3.warn("Camera: error while capturing image.",t);}finally{if(e!=null)if(this.cameraManager.synchronousFrameHandling){let t=await this.context.sendFrameToProcessor(e);this.cameraManager.recycle(t.data);}else this.context.sendFrameToProcessor(e).then(t=>(this.cameraManager.recycle(t.data),null)).catch(t=>{a$3.warn("error while recycling uint8array",t);});this._lastCaptureRequestAnimationFrame=this.cameraManager.requestVideoFrame(this._captureAndSendBound);}}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$3.log(a$3.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$3.log(a$3.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$3.log(a$3.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$3.log(a$3.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 b$1.isAndroidWebView()),this._isAndroidWebView}isZoomAvailable(){var e;return ((e=this.cameraManager.mediaTrackCapabilities)==null?void 0:e.zoom)!=null}},d=s;export{d as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-F2GMW4LP.js';import {a as a$1}from'./chunk-ENYHCJGH.js';var o=class c{constructor(e){this.element=e,this.setupListeners(),this.cacheDOMRect();}get width(){return this.cachedDOMRect.width}get height(){return this.cachedDOMRect.height}static areEquivalentJSONStates(e,t){return !e||!t?false:e.size.isSameAs(t.size)&&e.visible===t.visible}onStateChanged(e){this.onStateChangedListener=e;}onDisconnected(e){this.onDisconnectedListener=e;}toJSONObject(){return {size:new a(new a$1(this.width,"pixel"),new a$1(this.height,"pixel")),visible:this.isVisible()}}isSameAs(e){return c.areEquivalentJSONStates(this.toJSONObject(),e.toJSONObject())}removeListeners(){this.resizeObserver.disconnect(),this.mutationObserver.disconnect();}isVisible(){return this.width>0&&this.height>0||this.element.getClientRects().length>0}setupListeners(){this.resizeObserver=new ResizeObserver(this.onSizeChange.bind(this)),this.resizeObserver.observe(this.element),this.mutationObserver=new MutationObserver(this.onMutation.bind(this)),this.element.parentElement&&this.mutationObserver.observe(this.element.parentElement,{childList:true});}onSizeChange(e){var t;this.cacheDOMRect(e),document.contains(this.element)&&((t=this.onStateChangedListener)==null||t.call(this));}onMutation(e){var s;let t=e.find(({type:i})=>i==="childList");if(t){for(let i of t.removedNodes)if(i===this.element&&!document.contains(this.element)){(s=this.onDisconnectedListener)==null||s.call(this);return}}}cacheDOMRect(e){let t;Array.isArray(e)&&e.length>0&&(t=e[0].contentRect),t==null&&(t=this.element.getBoundingClientRect()),this.cachedDOMRect=t;}};export{o as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a as a$1}from'./chunk-QG3MRQMP.js';import {a as a$2}from'./chunk-AZWFNBVA.js';import {a as a$3}from'./chunk-ENYHCJGH.js';import {a}from'./chunk-SGL5J2CI.js';var s=class{constructor(i,e){this.type="rectangular";this._disabledColor=a.fromRGBA(0,0,0,0);let n=i!=null?i:a$1.RectangularViewfinder.defaultStyle;this._style=a$1.RectangularViewfinder.styles[n].style,this._lineStyle=a$1.RectangularViewfinder.styles[n].lineStyle,this._dimming=a$1.RectangularViewfinder.styles[n].dimming,this._animation=a$1.RectangularViewfinder.styles[n].animation,this.color=a$1.RectangularViewfinder.styles[n].color,this._sizeWithUnitAndAspect=a$1.RectangularViewfinder.styles[n].size,e!==void 0&&(this._lineStyle=e);}get animation(){return this._animation}set animation(i){this._animation=i;}get dimming(){return this._dimming}set dimming(i){this._dimming=i;}get lineStyle(){return this._lineStyle}get sizeWithUnitAndAspect(){return this._sizeWithUnitAndAspect}get style(){return this._style}get disabledColor(){return this._disabledColor}set disabledColor(i){this._disabledColor=i;}setHeightAndAspectRatio(i,e){this._sizeWithUnitAndAspect=a$2.sizeWithHeightAndAspectRatio(i,e);}setShorterDimensionAndAspectRatio(i,e){this._sizeWithUnitAndAspect=a$2.sizeWithShorterDimensionAndAspectRatio(new a$3(i,"fraction"),e);}setSize(i){this._sizeWithUnitAndAspect=a$2.sizeWithWidthAndHeight(i);}setWidthAndAspectRatio(i,e){this._sizeWithUnitAndAspect=a$2.sizeWithWidthAndAspectRatio(i,e);}toJSONObject(){return {type:this.type,color:this.color.toJSON(),style:this.style,lineStyle:this.lineStyle,dimming:this.dimming,animation:this.animation?this.animation.toJSONObject():null,size:this.sizeWithUnitAndAspect.toJSONObject(),disabledColor:this._disabledColor.toJSON()}}};export{s as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-CD2BU66N.js';var r=class{constructor(t){this._hintPresenter=t;}async showNotification(t){let e=a(t);return t.icon?this._hintPresenter.showToastWithCustomIcon(e,t.icon):this._hintPresenter.showToast(e)}async hideNotification(t){return this._hintPresenter.hideToast(a(t))}};export{r as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-KAFNKP6O.js';var i=class e{constructor(t,r,p,a){this._topLeft=t,this._topRight=r,this._bottomRight=p,this._bottomLeft=a;}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()}}};export{i as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-BZAQMYII.js';var i=class l{constructor(t){this.iconElement=a.Settings.iconElement;this.informationElement=a.Settings.informationElement;this.buttonElement=a.Settings.buttonElement;this.containerStyle=a.Settings.containerStyle;this.iconStyle=a.Settings.iconStyle;this.informationStyle=a.Settings.informationStyle;this.buttonStyle=a.Settings.buttonStyle;this.onlyCameraCapture=a.Settings.onlyCameraCapture;t!=null&&(this.iconElement=t.iconElement,this.informationElement=t.informationElement,this.buttonElement=t.buttonElement,this.containerStyle=t.containerStyle,this.iconStyle=t.iconStyle,this.informationStyle=t.informationStyle,this.buttonStyle=t.buttonStyle,this.onlyCameraCapture=t.onlyCameraCapture);}static fromJSON(t){let e=new l(null);return e.iconElement=document.createRange().createContextualFragment(t.iconElement).firstElementChild,e.informationElement=document.createRange().createContextualFragment(t.informationElement).firstElementChild,e.buttonElement=document.createRange().createContextualFragment(t.buttonElement).firstElementChild,e.containerStyle=t.containerStyle,e.iconStyle=t.iconStyle,e.informationStyle=t.informationStyle,e.buttonStyle=t.buttonStyle,e.onlyCameraCapture=t.onlyCameraCapture,e}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}}};export{i as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-5JAPQHXF.js';import {a as a$1}from'./chunk-3A4KLILV.js';import {a as a$2}from'./chunk-UWBNF47P.js';var e=class e extends a{static create(){return document.createElement(e.tag)}static register(){a$1({[e.tag]:e});}render(){return a$2`<style>${e.tag}{display:flex}</style><svg width="${this.size}" height="${this.heightForViewbox(32,32)}" viewBox="0 0 32 32" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M16.625 15C17.3844 15 18 15.6156 18 16.375C18 17.1344 17.3844 17.75 16.625 17.75C15.8656 17.75 15.25 17.1344 15.25 16.375C15.25 15.6156 15.8656 15 16.625 15ZM20.75 16.375C20.75 14.0968 18.9032 12.25 16.625 12.25C14.3468 12.25 12.5 14.0968 12.5 16.375C12.5 18.6532 14.3468 20.5 16.625 20.5C18.9032 20.5 20.75 18.6532 20.75 16.375Z" fill="${this.fill}"/><path fill-rule="evenodd" clip-rule="evenodd" d="M10.7223 13.2223C10.1853 13.7592 9.3147 13.7592 8.77773 13.2223C8.24076 12.6853 8.24076 11.8147 8.77773 11.2777L9.18046 10.875H8.375C7.61561 10.875 7 11.4906 7 12.25V21.875C7 22.6344 7.61561 23.25 8.375 23.25H16.625C17.3844 23.25 18 23.8656 18 24.625C18 25.3844 17.3844 26 16.625 26H8.375C6.09683 26 4.25 24.1532 4.25 21.875V12.25C4.25 9.97183 6.09683 8.125 8.375 8.125H9.18046L8.77773 7.72227C8.24076 7.1853 8.24076 6.3147 8.77773 5.77773C9.3147 5.24076 10.1853 5.24076 10.7223 5.77773L13.4723 8.52773C13.7301 8.78559 13.875 9.13533 13.875 9.5C13.875 9.86467 13.7301 10.2144 13.4723 10.4723L10.7223 13.2223Z" fill="${this.fill}"/><path fill-rule="evenodd" clip-rule="evenodd" d="M20.75 7.4375C20.75 7.0578 20.4422 6.75 20.0625 6.75H13.875C13.1156 6.75 12.5 6.13439 12.5 5.375C12.5 4.61561 13.1156 4 13.875 4H20.0625C21.961 4 23.5 5.53902 23.5 7.4375C23.5 7.8172 23.8078 8.125 24.1875 8.125H24.875C27.1532 8.125 29 9.97183 29 12.25V21.875C29 24.1532 27.1532 26 24.875 26H24.0695L24.4723 26.4027C25.0092 26.9397 25.0092 27.8103 24.4723 28.3473C23.9353 28.8842 23.0647 28.8842 22.5277 28.3473L19.7777 25.5973C19.2408 25.0603 19.2408 24.1897 19.7777 23.6527L22.5277 20.9027C23.0647 20.3658 23.9353 20.3658 24.4723 20.9027C25.0092 21.4397 25.0092 22.3103 24.4723 22.8473L24.0695 23.25H24.875C25.6344 23.25 26.25 22.6344 26.25 21.875V12.25C26.25 11.4906 25.6344 10.875 24.875 10.875H24.1875C22.289 10.875 20.75 9.33598 20.75 7.4375Z" fill="${this.fill}"/></svg>`}};e.tag="scandit-camera-switch-icon";var C=e;export{C as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var n=class r{constructor(e,t){this._x=e,this._y=t;}get x(){return this._x}get y(){return this._y}static mirrorX(e,t){let i=e.x-t.width;return i*=-1,new r(i,e.y)}static fromJSON(e){return new r(e.x,e.y)}toJSONObject(){return {x:this.x,y:this.y}}static areEquals(e,t){return e.x===t.x&&e.y===t.y}equals(e){return this.x===e.x&&this.y===e.y}};export{n as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-LH2NI5UL.js';import {a}from'./chunk-
|
|
1
|
+
import {a as a$1}from'./chunk-LH2NI5UL.js';import {a}from'./chunk-Q45KFJIS.js';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}};export{o as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-5JAPQHXF.js';import {a as a$1}from'./chunk-3A4KLILV.js';import {a as a$2}from'./chunk-UWBNF47P.js';var t=class t extends a{static create(){return document.createElement(t.tag)}static register(){a$1({[t.tag]:t});}render(){return a$2`<style>${t.tag}{display:flex}${t.tag}[shadow] svg{filter:drop-shadow(0px 1px 2px rgba(18, 22, 25, .3))}</style><svg width="${this.size}" height="${this.heightForViewbox(32,32)}" viewBox="0 0 32 32" fill="none"><path d="M12.9997 28C12.8536 27.9995 12.7094 27.9669 12.5773 27.9046C12.4451 27.8422 12.3283 27.7517 12.235 27.6393C12.1416 27.5269 12.0741 27.3954 12.0371 27.2541C12.0002 27.1127 11.9947 26.965 12.021 26.8213L13.8077 16.9987H9.00765C8.85299 17.0003 8.70007 16.9659 8.56102 16.8981C8.42197 16.8304 8.3006 16.7312 8.20654 16.6084C8.11248 16.4856 8.0483 16.3426 8.01911 16.1907C7.98991 16.0388 7.99649 15.8822 8.03832 15.7333L9.61432 9.95733L7.29299 7.63733C7.10539 7.44974 7 7.1953 7 6.93C7 6.6647 7.10539 6.41026 7.29299 6.22267C7.48058 6.03507 7.73502 5.92968 8.00032 5.92968C8.26562 5.92968 8.52006 6.03507 8.70765 6.22267L24.2637 21.7773C24.3619 21.8689 24.4407 21.9793 24.4954 22.1019C24.55 22.2246 24.5794 22.357 24.5818 22.4913C24.5841 22.6256 24.5594 22.7589 24.5092 22.8835C24.4589 23.008 24.384 23.1211 24.289 23.2161C24.1941 23.311 24.081 23.3859 23.9565 23.4362C23.8319 23.4865 23.6986 23.5112 23.5643 23.5088C23.43 23.5064 23.2976 23.477 23.1749 23.4224C23.0523 23.3677 22.9419 23.2889 22.8503 23.1907L19.1863 19.528L13.8357 27.5533C13.7442 27.6912 13.6199 27.8042 13.474 27.8822C13.3281 27.9601 13.1651 28.0006 12.9997 28ZM21.4503 16.1333L10.829 5.512L11.041 4.73867C11.0984 4.5266 11.2241 4.33934 11.3985 4.20583C11.573 4.07232 11.7866 3.99998 12.0063 4H18.9997C19.1547 4.00132 19.3073 4.03804 19.446 4.10737C19.5846 4.17669 19.7056 4.27678 19.7997 4.4C19.893 4.52382 19.9564 4.66766 19.9846 4.82015C20.0128 4.97265 20.0052 5.12962 19.9623 5.27867L18.333 11H22.9997C23.1807 11.0003 23.3583 11.0496 23.5136 11.1427C23.6689 11.2357 23.7961 11.3691 23.8817 11.5287C23.9673 11.6883 24.0081 11.868 23.9998 12.0489C23.9914 12.2298 23.9342 12.405 23.8343 12.556L21.453 16.1333H21.4503Z" fill="${this.fill}"/></svg>`}};t.tag="scandit-torch-off-icon";var o=t;export{o as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-ENYHCJGH.js';var r=class e{constructor(i,n,o,u){this._left=i,this._top=n,this._right=o,this._bottom=u;}static get zero(){return new e(new a(0,"pixel"),new a(0,"pixel"),new a(0,"pixel"),new a(0,"pixel"))}get left(){return this._left}get right(){return this._right}get top(){return this._top}get bottom(){return this._bottom}static fromJSON(i){return new e(a.fromJSON(i.left),a.fromJSON(i.top),a.fromJSON(i.right),a.fromJSON(i.bottom))}toJSONObject(){return {left:this.left.toJSONObject(),right:this.right.toJSONObject(),top:this.top.toJSONObject(),bottom:this.bottom.toJSONObject()}}};export{r as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {b}from'./chunk-MKTACV3Q.js';import {a}from'./chunk-XR65N6EG.js';var d=class p{constructor(e){this.workerCommandId=1;this.workerTasks=new Map;this.workerListeners=[];var r;this.libraryLocation=e.libraryLocation,this.workerMessageListener=this.onWorkerMessage.bind(this),this.dataCaptureWorker.addEventListener("message",this.workerMessageListener),this.verifyResponseHash=e.verifyResponseHash,this.highEndBlurryRecognition=(r=e.highEndBlurryRecognition)!=null?r:false,this.simdSupport=e.simdSupport,this.threadsSupport=e.threadsSupport,typeof e.loadProgressNotifier=="function"&&this.addWorkerListener(a=>{var o;a.type==="loadLibraryProgress"&&((o=e.loadProgressNotifier)==null||o.call(e,a.payload));});}get dataCaptureWorker(){return (this._dataCaptureWorker)!=null||(this._dataCaptureWorker=(void 0)),this._dataCaptureWorker}get name(){return "CoreLoader"}get fixedWasmMemory(){return null}static async create(e){var a$1;let r=new p(e);return await r.workerCommand("setLogLevel",{level:(a$1=e.logLevel)!=null?a$1:a.Level.Debug}),await r.load(),r}async load(){var e;try{await this.workerCommand("loadLibrary",{libraryLocation:this.libraryLocation,locationPath:window.location.pathname,referredOrigin:window.location.origin,writableDataPathOverride:(e=b.getItem("scanditWritableDataPathOverride"))!=null?e:void 0,verifyResponseHash:this.verifyResponseHash,fixedWasmMemory:this.fixedWasmMemory,simdSupport:this.simdSupport,threadsSupport:this.threadsSupport});}catch(r){if(r!=null&&typeof r=="object"&&typeof r.error=="string"&&r.error.includes("BlockedIndexedDB"))return await this.terminateDataCaptureWorker(false),this.dataCaptureWorker.addEventListener("message",this.workerMessageListener),b.setItem("scanditWritableDataPathOverride",`/scandit_sync_folder_${[...crypto.getRandomValues(new Uint32Array(2))].map(a=>a.toString(32)).join("")}`),this.load();throw r}}async workerCommand(e,r,a){return new Promise((o,s)=>{let t=this.workerCommandId++;this.workerTasks.set(t,{resolve:o,reject:s,command:e});let l={...r,command:e,id:t};this.dataCaptureWorker.postMessage(l,a);})}async terminateDataCaptureWorker(e=true){var r,a;e&&await this.workerCommand("dispose",{}),(r=this._dataCaptureWorker)==null||r.removeEventListener("message",this.workerMessageListener),(a=this._dataCaptureWorker)==null||a.terminate(),this._dataCaptureWorker=void 0;}addWorkerListener(e){this.workerListeners.push(e);}removeWorkerListener(e){this.workerListeners.includes(e)&&this.workerListeners.splice(this.workerListeners.indexOf(e),1);}getOptions(){return {libraryLocation:this.libraryLocation,simdSupport:this.simdSupport,threadsSupport:this.threadsSupport,verifyResponseHash:this.verifyResponseHash}}onWorkerMessage(e){let r=e.data;if(r.type==="workerTaskId"&&typeof r.id=="number"){let{id:a,error:o,payload:s}=r,t=this.workerTasks.get(a);o==null?t==null||t.resolve(s):t==null||t.reject(r),this.workerTasks.delete(a);}else for(let a of this.workerListeners)a(r);}};export{d as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$4}from'./chunk-
|
|
1
|
+
import {a as a$4}from'./chunk-RHMGLXJ3.js';import {a as a$6}from'./chunk-GHTCNOQN.js';import {a as a$3}from'./chunk-3A4KLILV.js';import {a as a$2}from'./chunk-UWBNF47P.js';import {a as a$1}from'./chunk-EV4OEANA.js';import {a as a$5}from'./chunk-LSZZVJ6B.js';var d="scandit-loading-overlay",t=class t extends a$1{constructor(){super();this._progressBar=null;this._label=null;let e=this.attachShadow({mode:"open"});e.innerHTML=a$2`<div class="loading-overlay"><label for="scandit-progress" class="message">Loading...</label><scandit-progress-bar id="scandit-progress" min="0" max="100"></scandit-progress-bar></div>`,e.append(t.createStyleElement().cloneNode(true));}set progress(e){this._progressBar&&(this._progressBar.value=e);}set message(e){this._label&&(this._label.textContent=e);}get message(){var e,r;return (r=(e=this._label)==null?void 0:e.textContent)!=null?r:""}static create(){return document.createElement(t.tag)}static register(){a$3({[d]:t});}static createStyleElement(){return a$5`@media (prefers-color-scheme:dark){.loading-overlay{--foreground-color:#fff;--background-color:#000000e6}}@media (prefers-color-scheme:light){.loading-overlay{--foreground-color:#000;--background-color:#ffffffe6}}${a$4.tag}{max-width:15rem}.loading-overlay{align-items:center;background-color:var(--background-color);display:flex;flex-direction:column;height:100%;justify-content:center;position:absolute;width:100%;z-index:1}:host([hidden]){display:none}.loading-overlay .message{color:var(--foreground-color);font-family:Open Sans,sans-serif;margin-bottom:1rem;text-align:center}`}connectedCallback(){var e,r;this._progressBar=(e=this.shadowRoot)==null?void 0:e.querySelector(a$4.tag),this._label=(r=this.shadowRoot)==null?void 0:r.querySelector("label"),this.message=a$6.getInstance().get("core.view.loading");}show(){this.removeAttribute("hidden");}hide(){this.setAttribute("hidden","");}};t.tag=d;var a=t;a.register();export{a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-5JAPQHXF.js';import {a as a$1}from'./chunk-3A4KLILV.js';import {a as a$2}from'./chunk-UWBNF47P.js';var t=class t extends a{static create(){return document.createElement(t.tag)}static register(){a$1({[t.tag]:t});}render(){return a$2`<style>${t.tag}{display:flex}${t.tag}[shadow] svg{filter:drop-shadow(0px 1px 2px rgba(18, 22, 25, .3))}</style><svg width="${this.size}" height="${this.heightForViewbox(32,32)}" viewBox="0 0 32 32" fill="none"><path d="M23.0072 11.0026H18.3321L19.9687 5.27515C20.0113 5.12618 20.0187 4.96936 19.9903 4.81705C19.9619 4.66475 19.8985 4.52112 19.8051 4.39748C19.7118 4.27385 19.5909 4.17359 19.4522 4.10462C19.3135 4.03564 19.1606 3.99983 19.0057 4H12.0031C11.7834 3.9999 11.5699 4.07207 11.3954 4.20538C11.2209 4.33868 11.095 4.52571 11.0374 4.73761L8.03623 15.7378C7.99509 15.8864 7.98889 16.0426 8.01812 16.1941C8.04735 16.3456 8.11122 16.4882 8.20472 16.6109C8.29823 16.7336 8.41884 16.833 8.55714 16.9014C8.69543 16.9697 8.84766 17.0052 9.00192 17.0049H13.8037L12.0191 26.83C11.9767 27.0569 12.0142 27.2915 12.1251 27.494C12.236 27.6964 12.4135 27.8543 12.6276 27.9408C12.8416 28.0273 13.0789 28.0372 13.2994 27.9687C13.5198 27.9002 13.7098 27.7575 13.8371 27.5649L23.8409 12.5592C23.9417 12.4085 23.9997 12.2331 24.0085 12.052C24.0174 11.8708 23.9769 11.6906 23.8912 11.5307C23.8056 11.3708 23.6781 11.2372 23.5224 11.1442C23.3667 11.0512 23.1886 11.0023 23.0072 11.0026Z" fill="${this.fill}"/></svg>`}};t.tag="scandit-torch-on-icon";var r=t;export{r as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var G=(A=>(A.RGBA="RGBA",A.GRAYSCALE="GRAYSCALE",A))(G||{});export{G as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a as a$2}from'./chunk-SGL5J2CI.js';import {a as a$3}from'./chunk-3A4KLILV.js';import {a}from'./chunk-UWBNF47P.js';import {a as a$1}from'./chunk-EV4OEANA.js';import {a as a$4}from'./chunk-LSZZVJ6B.js';var s=a`<div role="listitem"><slot></slot></div>`,r=class r extends a$1{constructor(){super();let o=this.attachShadow({mode:"open"});o.innerHTML=s,o.append(r.createStyleElement().cloneNode(true));}set haloGlow(o){this.toggleAttribute("halo-glow",o);}get haloGlow(){return this.hasAttribute("halo-glow")}set border(o){this.toggleAttribute("border",o);}get border(){return this.hasAttribute("border")}set backgroundColor(o){this.style.setProperty("--background-color",`#${o.toJSON()}`);}get backgroundColor(){return a$2.fromHex(this.style.getPropertyValue("--background-color"))}set borderColor(o){this.style.setProperty("--border-color",`#${o.toJSON()}`);}get borderColor(){return a$2.fromHex(this.style.getPropertyValue("--border-color"))}static create(){return document.createElement(r.tag)}static register(){a$3({[r.tag]:r});}static createStyleElement(){return a$4`@keyframes gradientShift{0%{background-position-x:100%}50%{background-position-x:0}to{background-position-x:100%}}:host{--corner-radius:0.75rem;--background-color:#ffffffe6;--border-color:#0000;--glow-max-width:1rem;--glow-horizontal-edge:min(5%,var(--glow-max-width));--glow-vertical-edge:min(20%,var(--glow-max-width));--glow-horizontal-start:calc(100% - var(--glow-horizontal-edge));--glow-vertical-start:calc(100% - var(--glow-vertical-edge));--card-min-height:5rem;--card-max-height:100px;backdrop-filter:saturate(180%) blur(20px);background-color:var(--background-color);border:1px solid var(--border-color);border-radius:var(--corner-radius);box-shadow:0 2px 6px 0 #12161926;box-sizing:border-box;display:block;font-family:SF Pro Text,sans-serif;max-height:var(--card-max-height);min-height:var(--card-min-height);min-width:200px;overflow:hidden;position:relative}:host>div[role=listitem]{height:100%;max-height:var(--card-max-height);min-height:var(--card-min-height);position:relative}:host([halo-glow])>div:before{animation:gradientShift 8s ease-in-out .2s infinite;background:linear-gradient(90deg,#ffd89b,#ff6f91 20%,#a566ff 45%,#64f6ff 70%,#ffd89b);background-size:300% 300%;border-radius:var(--corner-radius);content:"";filter:blur(30px);inset:0;mask:linear-gradient(to right,#000 0,#0000 var(--glow-horizontal-edge),#0000 var(--glow-horizontal-start),#000 100%),linear-gradient(to bottom,#000 0,#0000 var(--glow-vertical-edge),#0000 var(--glow-vertical-start),#000 100%);mask-composite:intersect;-webkit-mask:linear-gradient(to right,#000 0,#0000 var(--glow-horizontal-edge),#0000 var(--glow-horizontal-start),#000 100%),linear-gradient(to bottom,#000 0,#0000 var(--glow-vertical-edge),#0000 var(--glow-vertical-start),#000 100%);-webkit-mask-composite:source-over;opacity:1;position:absolute;transition:opacity .3s ease;z-index:0}:host([halo-glow])>div:before{opacity:.75}:host([halo-glow][border])>div:before{opacity:.75!important}:host(:not([halo-glow]))>div:before{animation:none;mask:none;-webkit-mask:none;opacity:0}:host([border]){--border-color:#d92121}:host(:not([border])){--border-color:#0000}`}};r.tag="scandit-basic-card";var e=r;e.register();export{e as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-R6SUMD5F.js';import {b}from'./chunk-VBUDN72N.js';var n=class e{constructor(t,o=a.defaultVibrationPattern){this.type=t,this.pattern=o;let r=b.getSupportedVibrationMethod();r&&(this._vibrate=r.bind(navigator));}static get defaultVibration(){return new e("default")}static withPattern(t){return new e("default",t)}toJSONObject(){return {type:this.type}}vibrate(){var t;return (t=this._vibrate)==null?void 0:t.call(this,this.pattern)}};export{n as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {c}from'./chunk-WGLHZXRT.js';import {a as a$1}from'./chunk-AZWFNBVA.js';import {a as a$2}from'./chunk-ENYHCJGH.js';import {a}from'./chunk-SGL5J2CI.js';var f={LaserlineViewfinder:{width:a$2.fromJSON({unit:"fraction",value:.8}),enabledColor:a.fromJSON("#FFFFFFFF"),disabledColor:a.fromJSON("#00000000")},RectangularViewfinder:{defaultStyle:"rounded",styles:{rounded:{size:a$1.fromJSON({aspect:1,shorterDimension:{unit:"fraction",value:.75}}),color:a.fromJSON("#FFFFFFFF"),style:"rounded",lineStyle:"light",dimming:0,animation:c.fromJSON({looping:true})},square:{size:a$1.fromJSON({aspect:1,shorterDimension:{unit:"fraction",value:.75}}),color:a.fromJSON("#FFFFFFFF"),style:"square",lineStyle:"light",dimming:0,animation:c.fromJSON({looping:true})}}},AimerViewfinder:{frameColor:a.fromJSON("#FFFFFFFF"),dotColor:a.fromJSON("#FFFFFFCC")}};export{f as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var i=class t{constructor(e,r){this._width=e,this._height=r;}get width(){return this._width}get height(){return this._height}static fromJSON(e){return new t(e.width,e.height)}toJSONObject(){return {height:this.height,width:this.width}}};export{i as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var x=(o=>(o.Pixel="pixel",o.Fraction="fraction",o))(x||{});export{x as a};
|