@scandit/web-datacapture-core 8.1.1 → 8.2.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.
Files changed (273) hide show
  1. package/build/js/Camera.js +1 -1
  2. package/build/js/{DataCaptureContext-fzPdCXUX.d.ts → DataCaptureContext-Dvdr7st4.d.ts} +322 -214
  3. package/build/js/DataCaptureContext.d.ts +7 -7
  4. package/build/js/DataCaptureContext.js +1 -1
  5. package/build/js/DataCaptureContextRelated.d.ts +9 -9
  6. package/build/js/DataCaptureVersion.js +1 -1
  7. package/build/js/DataCaptureView.d.ts +7 -7
  8. package/build/js/DataCaptureView.js +1 -1
  9. package/build/js/Feedback.js +1 -1
  10. package/build/js/FrameData.d.ts +8 -8
  11. package/build/js/FrameData.js +1 -1
  12. package/build/js/ImageFrameSource.js +1 -1
  13. package/build/js/NotificationPresenter/index.d.ts +4 -4
  14. package/build/js/NotificationPresenter/private/ConcreteNotificationPresenter.d.ts +4 -4
  15. package/build/js/NotificationPresenter/private/presets.d.ts +8 -8
  16. package/build/js/ScanditIcon.d.ts +1 -1
  17. package/build/js/ScanditIcon.js +1 -1
  18. package/build/js/ScanditIconBuilder.d.ts +2 -1
  19. package/build/js/ScanditIconBuilder.js +1 -1
  20. package/build/js/Vibration.js +1 -1
  21. package/build/js/browserHelper.d.ts +27 -1
  22. package/build/js/browserHelper.js +1 -1
  23. package/build/js/chunks/chunk-24MGHMOY.js +1 -0
  24. package/build/js/chunks/chunk-3A7LM5JG.js +1 -0
  25. package/build/js/chunks/chunk-3MKSI2DV.js +1 -0
  26. package/build/js/chunks/{chunk-G2KEAB3J.js → chunk-4J3Y5IIL.js} +1 -1
  27. package/build/js/chunks/chunk-6EEMWSEO.js +1 -0
  28. package/build/js/chunks/{chunk-J6LCRGZO.js → chunk-7HYFN4JO.js} +1 -1
  29. package/build/js/chunks/{chunk-O7QIRKOP.js → chunk-7OFC24NE.js} +1 -1
  30. package/build/js/chunks/chunk-A225YZFY.js +2 -0
  31. package/build/js/chunks/chunk-AAEQZ45T.js +1 -0
  32. package/build/js/chunks/chunk-ACF5LYP7.js +1 -0
  33. package/build/js/chunks/chunk-BBOKPRKO.js +2 -0
  34. package/build/js/chunks/chunk-CAUB35PV.js +1 -0
  35. package/build/js/chunks/chunk-CX2R2XQK.js +1 -0
  36. package/build/js/chunks/chunk-DGIQ3GF7.js +1 -0
  37. package/build/js/chunks/chunk-DN32UPQC.js +1 -0
  38. package/build/js/chunks/chunk-DSFN65OM.js +1 -0
  39. package/build/js/chunks/{chunk-EC74ZSTB.js → chunk-DTREAYZQ.js} +1 -1
  40. package/build/js/chunks/chunk-DZKTI5AJ.js +1 -0
  41. package/build/js/chunks/chunk-ECPEKYII.js +1 -0
  42. package/build/js/chunks/chunk-EMLXDXWN.js +1 -0
  43. package/build/js/chunks/chunk-FQYVZGCE.js +1 -0
  44. package/build/js/chunks/chunk-GLSB4QTY.js +1 -0
  45. package/build/js/chunks/chunk-GQ7A6533.js +1 -0
  46. package/build/js/chunks/chunk-I4F6XB6S.js +1 -0
  47. package/build/js/chunks/chunk-JCP7NQPV.js +1 -0
  48. package/build/js/chunks/chunk-JIGCOX5J.js +1 -0
  49. package/build/js/chunks/{chunk-4F5JUHOJ.js → chunk-KSCFPJAW.js} +1 -1
  50. package/build/js/chunks/chunk-KXAJHLEO.js +1 -0
  51. package/build/js/chunks/{chunk-UN33F7AA.js → chunk-MX6NS4FA.js} +1 -1
  52. package/build/js/chunks/chunk-NT5WI2PS.js +1 -0
  53. package/build/js/chunks/{chunk-Q45KFJIS.js → chunk-NXAYIU7F.js} +1 -1
  54. package/build/js/chunks/{chunk-4FMQAH4G.js → chunk-NXW6JP4X.js} +1 -1
  55. package/build/js/chunks/{chunk-24IG7HUA.js → chunk-O4HDBWKK.js} +1 -1
  56. package/build/js/chunks/chunk-O7EM4VIM.js +1 -0
  57. package/build/js/chunks/chunk-OFNPZ4HM.js +6 -0
  58. package/build/js/chunks/chunk-PM5CNTBV.js +1 -0
  59. package/build/js/chunks/chunk-QFSNPY5Y.js +1 -0
  60. package/build/js/chunks/{chunk-3LVMEVOI.js → chunk-QIWPWOQG.js} +1 -1
  61. package/build/js/chunks/chunk-QPR2YHD4.js +1 -0
  62. package/build/js/chunks/chunk-QUBJJDLC.js +1 -0
  63. package/build/js/chunks/{chunk-BIJB4K7G.js → chunk-QUWP3ILW.js} +1 -1
  64. package/build/js/chunks/{chunk-D6JKW7G4.js → chunk-RP4YFAF2.js} +1 -1
  65. package/build/js/chunks/chunk-SFS4ELLN.js +1 -0
  66. package/build/js/chunks/chunk-SYGWA3T6.js +35 -0
  67. package/build/js/chunks/chunk-TTGJAMI2.js +1 -0
  68. package/build/js/chunks/{chunk-523EQN4Z.js → chunk-U7ETOWGJ.js} +1 -1
  69. package/build/js/chunks/{chunk-X2ZGBI4S.js → chunk-UERKPMRV.js} +1 -1
  70. package/build/js/chunks/{chunk-2OCDIZIS.js → chunk-UQVVJP5Z.js} +1 -1
  71. package/build/js/chunks/{chunk-RHMGLXJ3.js → chunk-V2OKMBZD.js} +1 -1
  72. package/build/js/chunks/{chunk-TXVFFRVY.js → chunk-VJ7ZYB4V.js} +1 -1
  73. package/build/js/chunks/chunk-VSROWPI6.js +1 -0
  74. package/build/js/chunks/chunk-W33RVR5M.js +1 -0
  75. package/build/js/chunks/{chunk-L7WVCDGR.js → chunk-WVVNJRUA.js} +1 -1
  76. package/build/js/chunks/chunk-XG6VNDVQ.js +1 -0
  77. package/build/js/chunks/{chunk-4JH6EEAE.js → chunk-XIAF6V7E.js} +1 -1
  78. package/build/js/chunks/{chunk-C657OBED.js → chunk-XYZYNUX3.js} +1 -1
  79. package/build/js/chunks/chunk-Y7V35LNT.js +1 -0
  80. package/build/js/chunks/{chunk-LORGLY2X.js → chunk-YE2GYNRP.js} +1 -1
  81. package/build/js/chunks/chunk-ZWO2PAO7.js +1 -0
  82. package/build/js/controls/CameraFOVSwitchControl.d.ts +8 -8
  83. package/build/js/controls/CameraFOVSwitchControl.js +1 -1
  84. package/build/js/controls/CameraSwitchControl.d.ts +8 -8
  85. package/build/js/controls/CameraSwitchControl.js +1 -1
  86. package/build/js/controls/TorchSwitchControl.d.ts +8 -8
  87. package/build/js/controls/TorchSwitchControl.js +1 -1
  88. package/build/js/controls/common.d.ts +8 -8
  89. package/build/js/controls/index.d.ts +8 -8
  90. package/build/js/controls/index.js +1 -1
  91. package/build/js/defaults/DefaultsCamera.d.ts +30 -0
  92. package/build/js/defaults/DefaultsDataCaptureView.js +1 -1
  93. package/build/js/index.d.ts +15 -15
  94. package/build/js/index.js +1 -1
  95. package/build/js/moduleLoader.d.ts +8 -8
  96. package/build/js/private/CameraAccess.js +1 -1
  97. package/build/js/private/CameraManager.d.ts +10 -10
  98. package/build/js/private/CameraManager.js +1 -1
  99. package/build/js/private/CameraPool.d.ts +7 -7
  100. package/build/js/private/CanvasDrawer.d.ts +1 -1
  101. package/build/js/private/CanvasDrawer.js +1 -1
  102. package/build/js/private/CanvasDrawerWithMetrics.d.ts +21 -13
  103. package/build/js/private/CanvasDrawerWithMetrics.js +1 -1
  104. package/build/js/private/CoreModuleLicenseTextProvider.d.ts +8 -8
  105. package/build/js/private/CoreModuleLicenseTextProvider.js +1 -1
  106. package/build/js/private/CustomLocationsView.js +1 -1
  107. package/build/js/private/DataCaptureContextRelated.d.ts +8 -8
  108. package/build/js/private/FrameReaders/FrameReader.d.ts +8 -8
  109. package/build/js/private/FrameReaders/FrameReader.js +1 -1
  110. package/build/js/private/FrameReaders/FrameReaderAbstract.d.ts +8 -8
  111. package/build/js/private/FrameReaders/GrayScaleFrameReader.d.ts +8 -8
  112. package/build/js/private/FrameReaders/GrayScaleFrameReader.js +1 -1
  113. package/build/js/private/FrameReaders/index.d.ts +8 -8
  114. package/build/js/private/FrameReaders/index.js +1 -1
  115. package/build/js/private/GestureRecognizer/GestureRecognizer.js +1 -1
  116. package/build/js/private/GestureRecognizer/PointerEventsDetector.d.ts +1 -1
  117. package/build/js/private/GestureRecognizer/PointerEventsDetector.js +1 -1
  118. package/build/js/private/GestureRecognizer/index.js +1 -1
  119. package/build/js/private/ImageConverterBase.d.ts +2 -1
  120. package/build/js/private/ImageConverterBase.js +1 -1
  121. package/build/js/private/ImageConverterMainThread.js +1 -1
  122. package/build/js/private/NormalizedModuleLoaderOptions.d.ts +8 -8
  123. package/build/js/private/OrientationObserver.js +1 -1
  124. package/build/js/private/SingleImageUploaderView.d.ts +35 -0
  125. package/build/js/private/SingleImageUploaderView.js +1 -1
  126. package/build/js/private/ViewControls+related.js +1 -1
  127. package/build/js/private/ViewControls_related.d.ts +8 -8
  128. package/build/js/private/ViewsRegistry.d.ts +8 -8
  129. package/build/js/private/djinni-types/index.d.ts +10 -1
  130. package/build/js/private/djinni-types/index.js +1 -1
  131. package/build/js/private/hybridDesktopPlatformHelpers.js +1 -1
  132. package/build/js/private/ui/atoms/AimerSvgIcon.js +1 -1
  133. package/build/js/private/ui/atoms/ArrowDownSvgIcon.js +1 -1
  134. package/build/js/private/ui/atoms/ArrowLeftSvgIcon.js +1 -1
  135. package/build/js/private/ui/atoms/ArrowRightSvgIcon.js +1 -1
  136. package/build/js/private/ui/atoms/ArrowUpSvgIcon.js +1 -1
  137. package/build/js/private/ui/atoms/ArrowsUp.js +1 -1
  138. package/build/js/private/ui/atoms/Backdrop.d.ts +1 -1
  139. package/build/js/private/ui/atoms/Backdrop.js +1 -1
  140. package/build/js/private/ui/atoms/CalendarExclamationMarkSvgIcon.js +1 -1
  141. package/build/js/private/ui/atoms/CameraFOVUltrawideSvgIcon.js +1 -1
  142. package/build/js/private/ui/atoms/CameraFOVWideSvgIcon.js +1 -1
  143. package/build/js/private/ui/atoms/CameraSwitchReverseSvgIcon.js +1 -1
  144. package/build/js/private/ui/atoms/CameraSwitchSvgIcon.js +1 -1
  145. package/build/js/private/ui/atoms/Card.js +1 -1
  146. package/build/js/private/ui/atoms/CardList.js +1 -1
  147. package/build/js/private/ui/atoms/CheckSvgIcon.js +1 -1
  148. package/build/js/private/ui/atoms/ChevronDownSvgIcon.js +1 -1
  149. package/build/js/private/ui/atoms/ChevronLeftSvgIcon.js +1 -1
  150. package/build/js/private/ui/atoms/ChevronRightSvgIcon.js +1 -1
  151. package/build/js/private/ui/atoms/ChevronUpSvgIcon.js +1 -1
  152. package/build/js/private/ui/atoms/CrossSvgIcon.js +1 -1
  153. package/build/js/private/ui/atoms/DeleteSvgIcon.js +1 -1
  154. package/build/js/private/ui/atoms/Dot5xSvgIcon.js +1 -1
  155. package/build/js/private/ui/atoms/ExclamationMarkSvgIcon.js +1 -1
  156. package/build/js/private/ui/atoms/GlassSvgIcon.d.ts +1 -1
  157. package/build/js/private/ui/atoms/GlassSvgIcon.js +1 -1
  158. package/build/js/private/ui/atoms/HandLensCheckSvgIcon.js +1 -1
  159. package/build/js/private/ui/atoms/KeyboardSvgIcon.js +1 -1
  160. package/build/js/private/ui/atoms/LowStockSvgIcon.js +1 -1
  161. package/build/js/private/ui/atoms/OnexSvgIcon.js +1 -1
  162. package/build/js/private/ui/atoms/PauseSvgIcon.d.ts +17 -0
  163. package/build/js/private/ui/atoms/PauseSvgIcon.js +1 -0
  164. package/build/js/private/ui/atoms/PrinterSvgIcon.js +1 -1
  165. package/build/js/private/ui/atoms/ProgressBar.js +1 -1
  166. package/build/js/private/ui/atoms/QuestionMarkSvgIcon.d.ts +1 -1
  167. package/build/js/private/ui/atoms/QuestionMarkSvgIcon.js +1 -1
  168. package/build/js/private/ui/atoms/RestartSvgIcon.js +1 -1
  169. package/build/js/private/ui/atoms/RoundedCheckSvgIcon.js +1 -1
  170. package/build/js/private/ui/atoms/RoundedCrossSvgIcon.js +1 -1
  171. package/build/js/private/ui/atoms/RoundedExclamationMarkSvgIcon.js +1 -1
  172. package/build/js/private/ui/atoms/ScanSvgIcon.d.ts +17 -0
  173. package/build/js/private/ui/atoms/ScanSvgIcon.js +1 -0
  174. package/build/js/private/ui/atoms/ShutterButton.js +1 -1
  175. package/build/js/private/ui/atoms/SlashSvgIcon.js +1 -1
  176. package/build/js/private/ui/atoms/StarFilledSvgIcon.js +1 -1
  177. package/build/js/private/ui/atoms/StarHalfFilledSvgIcon.js +1 -1
  178. package/build/js/private/ui/atoms/StarOutlinedSvgIcon.js +1 -1
  179. package/build/js/private/ui/atoms/SvgIcon.d.ts +1 -0
  180. package/build/js/private/ui/atoms/SvgIcon.js +1 -1
  181. package/build/js/private/ui/atoms/ToPickSvgIcon.js +1 -1
  182. package/build/js/private/ui/atoms/Toast.d.ts +11 -16
  183. package/build/js/private/ui/atoms/Toast.js +1 -1
  184. package/build/js/private/ui/atoms/TorchOffSvgIcon.js +1 -1
  185. package/build/js/private/ui/atoms/TorchOnSvgIcon.js +1 -1
  186. package/build/js/private/ui/atoms/TwoxSvgIcon.js +1 -1
  187. package/build/js/private/ui/atoms/WrongItemSvgIcon.js +1 -1
  188. package/build/js/private/ui/colors.d.ts +5 -1
  189. package/build/js/private/ui/colors.js +1 -1
  190. package/build/js/private/ui/molecules/CameraFOVSwitchButton.js +1 -1
  191. package/build/js/private/ui/molecules/CameraSwitchButton.js +1 -1
  192. package/build/js/private/ui/molecules/ControlsLayout.js +1 -1
  193. package/build/js/private/ui/molecules/HintPresenter.d.ts +7 -7
  194. package/build/js/private/ui/molecules/HintPresenter.js +1 -1
  195. package/build/js/private/ui/molecules/LoadingOverlay.js +1 -1
  196. package/build/js/private/ui/molecules/TorchSwitchIconButton.js +1 -1
  197. package/build/js/private/utils/cookieStore.d.ts +18 -0
  198. package/build/js/private/utils/cookieStore.js +1 -0
  199. package/build/js/private/utils/cookieStorePolyfill.d.ts +43 -0
  200. package/build/js/private/utils/cookieStorePolyfill.js +1 -0
  201. package/build/js/private/utils/fromGrayScaleToRgba.d.ts +12 -0
  202. package/build/js/private/utils/fromGrayScaleToRgba.js +1 -0
  203. package/build/js/private/utils/getTimestamp.d.ts +9 -0
  204. package/build/js/private/utils/getTimestamp.js +1 -0
  205. package/build/js/private/utils/globalThisPolyfill.d.ts +2 -2
  206. package/build/js/private/utils/globalThisPolyfill.js +1 -1
  207. package/build/js/private/utils/index.d.ts +1 -0
  208. package/build/js/private/utils/index.js +1 -1
  209. package/build/js/private/utils/polyfillLoader.d.ts +2 -0
  210. package/build/js/private/utils/polyfillLoader.js +1 -1
  211. package/build/js/private/utils/replaceImagesInViewUtils.d.ts +8 -8
  212. package/build/js/private/utils/safeRequestAnimationFrame.d.ts +23 -0
  213. package/build/js/private/utils/safeRequestAnimationFrame.js +1 -0
  214. package/build/js/private/utils/safeStorage.d.ts +4 -3
  215. package/build/js/private/utils/safeStorage.js +1 -1
  216. package/build/js/private/utils/warnMultithreadingUnavailable.js +1 -1
  217. package/build/js/worker/ImageConverterForwarder.d.ts +10 -9
  218. package/build/js/worker/ImageConverterForwarder.js +1 -1
  219. package/build/js/worker/ImageConverterWorker.js +1 -1
  220. package/build/js/worker/ViewInfoHelper.d.ts +47 -0
  221. package/build/js/worker/ViewInfoHelper.js +1 -0
  222. package/build/js/worker/WorkerMain.d.ts +8 -8
  223. package/build/js/worker/WorkerMain.js +1 -1
  224. package/build/js/worker/coreCapture.inlineWorker.d.ts +8 -8
  225. package/build/js/worker/coreCapture.inlineWorker.js +1 -1
  226. package/build/js/worker/dataCaptureEngine.d.ts +7 -7
  227. package/build/js/worker/dataCaptureEngine.js +1 -1
  228. package/build/js/worker/dataCaptureLoader.d.ts +9 -9
  229. package/build/js/worker/dataCaptureLoader.js +1 -1
  230. package/build/js/worker/dataCaptureWorkerRelated.d.ts +7 -7
  231. package/build/js/worker/dataCaptureWorkerRelated.js +1 -1
  232. package/build/js/worker/helperFs.d.ts +11 -1
  233. package/build/js/worker/helperFs.js +1 -1
  234. package/build/js/worker/index.d.ts +8 -8
  235. package/build/js/worker/index.js +1 -1
  236. package/package.json +4 -6
  237. package/build/js/chunks/chunk-457L5N2F.js +0 -1
  238. package/build/js/chunks/chunk-4GKVQAVF.js +0 -1
  239. package/build/js/chunks/chunk-4QDO6ZMC.js +0 -35
  240. package/build/js/chunks/chunk-4ZAHOKYN.js +0 -1
  241. package/build/js/chunks/chunk-56CY5YB3.js +0 -1
  242. package/build/js/chunks/chunk-5IGOKD23.js +0 -1
  243. package/build/js/chunks/chunk-5JAPQHXF.js +0 -1
  244. package/build/js/chunks/chunk-AFCJ24Y3.js +0 -1
  245. package/build/js/chunks/chunk-C3EY6I75.js +0 -2
  246. package/build/js/chunks/chunk-DMOXDUF6.js +0 -1
  247. package/build/js/chunks/chunk-DZKZ6RMW.js +0 -1
  248. package/build/js/chunks/chunk-F2IJCZAS.js +0 -1
  249. package/build/js/chunks/chunk-F6TT5US7.js +0 -1
  250. package/build/js/chunks/chunk-FPCUMIQC.js +0 -1
  251. package/build/js/chunks/chunk-GHDJPETZ.js +0 -1
  252. package/build/js/chunks/chunk-HMOFGW5O.js +0 -1
  253. package/build/js/chunks/chunk-JKKB2J3F.js +0 -1
  254. package/build/js/chunks/chunk-JVZGAWFX.js +0 -1
  255. package/build/js/chunks/chunk-MBL5Q2H2.js +0 -1
  256. package/build/js/chunks/chunk-MKTACV3Q.js +0 -1
  257. package/build/js/chunks/chunk-NDQQHCZN.js +0 -1
  258. package/build/js/chunks/chunk-PA2BMEFD.js +0 -1
  259. package/build/js/chunks/chunk-SOCEWYYO.js +0 -1
  260. package/build/js/chunks/chunk-SVJ6BU5X.js +0 -1
  261. package/build/js/chunks/chunk-TU44BW74.js +0 -1
  262. package/build/js/chunks/chunk-U273RPMS.js +0 -6
  263. package/build/js/chunks/chunk-V6RG452U.js +0 -1
  264. package/build/js/chunks/chunk-VBUDN72N.js +0 -2
  265. package/build/js/chunks/chunk-WL2XKPJD.js +0 -1
  266. package/build/js/chunks/chunk-XINFYUZW.js +0 -1
  267. package/build/js/chunks/chunk-XLRKXFUR.js +0 -0
  268. package/build/js/chunks/chunk-YPAFWBL4.js +0 -1
  269. package/build/js/chunks/chunk-YRQ34YNY.js +0 -1
  270. package/build/js/chunks/chunk-ZDSGG7SD.js +0 -1
  271. package/build/js/chunks/chunk-ZEBGTTCX.js +0 -1
  272. /package/build/js/chunks/{chunk-3CXYB36D.js → chunk-TU2LKPHV.js} +0 -0
  273. /package/build/js/chunks/{chunk-ATTDETQP.js → chunk-VFOSFLTM.js} +0 -0
@@ -1 +0,0 @@
1
- import {a as a$1}from'./chunk-3A4KLILV.js';import {a as a$2}from'./chunk-UWBNF47P.js';import {a}from'./chunk-EV4OEANA.js';var r="inline-style",e=class e extends a{get fill(){var t;return (t=this.getAttribute("fill"))!=null?t:"black"}set fill(t){this.setAttribute("fill",t);}get size(){var t;return Number((t=this.getAttribute("size"))!=null?t:"32")}set size(t){this.setAttribute("size",t.toString());}get[r](){return this.getAttribute(r)}set[r](t){t==null?this.removeAttribute(r):this.setAttribute(r,t);}static create(){return a$1({[e.tag]:e}),document.createElement(e.tag)}render(){return a$2`<div></div>`}heightForViewbox(t,i){return this.size*this.aspectRatioForViewbox(t,i)}aspectRatioForViewbox(t,i){return i/t}connectedCallback(){this.innerHTML=this.render();}attributeChangedCallback(t,i,b){b!==i&&(this.innerHTML=this.render());}};e.tag="scandit-svg-icon",e.observedAttributes=["fill","size"];var u=e;export{u as a};
@@ -1 +0,0 @@
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};
@@ -1,2 +0,0 @@
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};
@@ -1 +0,0 @@
1
- import {b}from'./chunk-457L5N2F.js';import {a}from'./chunk-XR65N6EG.js';var d={processedFramesCount:{text:"Frames processed by engine",valueSuffix:"/sec"},frameDataPoolSize:{text:"Frame data pool size",valueSuffix:""},redrawRequestsCount:{text:"Engine redraw requests",valueSuffix:"/sec"},actualRedrawsCount:{text:"Actual redraws",valueSuffix:"/sec"},FPS:{text:"Overlay FPS ",valueSuffix:"/sec"}},p=class extends b{constructor(e){var r;super(e);this.drawPerformanceTimer=null;this.drawPerformanceFPSCounter=0;this.lastDrawPerformanceFPSCounter=0;this.performanceCanvasLayer=document.createElement("canvas"),(r=e.parentElement)==null||r.insertBefore(this.performanceCanvasLayer,e);}get performanceLayerContext(){if(!this._performanceLayerContext&&(this._performanceLayerContext=this.performanceCanvasLayer.getContext("2d"),!this._performanceLayerContext))throw new TypeError("CanvasRenderingContext cannot be retrieved.");return this._performanceLayerContext}setupPerformanceLayer(){}setPerformanceMetrics(e){this.performanceMetrics=e,this.drawPerformanceMetrics();}updateCanvasSizeAttributes(e,r,t=window.devicePixelRatio){super.updateCanvasSizeAttributes(e,r,t),this.performanceCanvasLayer.width=this.canvas.width,this.performanceCanvasLayer.height=this.canvas.height,this.performanceLayerContext.scale(t,t);}doDraw(){super.doDraw();}drawPerformanceMetrics(){this.drawPerformanceTimer==null&&(a.log(a.Level.Debug,"Drawing performance monitoring enabled, FPS will be drawn into canvas"),this.drawPerformanceTimer=setInterval(()=>{this.lastDrawPerformanceFPSCounter=this.drawPerformanceFPSCounter,this.drawPerformanceFPSCounter=0;},1e3)),this.drawPerformanceFPSCounter++,this.drawFullPerformanceMetrics();}drawFullPerformanceMetrics(){let e={...this.performanceMetrics,FPS:this.lastDrawPerformanceFPSCounter};this.performanceLayerContext.lineWidth=1,this.performanceLayerContext.fillStyle="white",this.performanceLayerContext.strokeStyle="black";let r=Math.min(Math.max(window.innerWidth/35,13),20),t=1.5*r,s=1.5;this.performanceLayerContext.font=`bold ${r}px sans-serif`;let l=0,n=0,i=[];for(let[a,u]of Object.entries(e)){let c=d[a],f=`${c.text}: ${u}${c.valueSuffix}`;n=Math.max(this.performanceLayerContext.measureText(f).width,n),i.push([f,t,t+r*s*l++]);}this.performanceLayerContext.clearRect(t,t-r,n,Object.values(e).length*r*s);for(let a of i)this.performanceLayerContext.fillText(...a),this.performanceLayerContext.strokeText(...a);}};export{p as a};
@@ -1 +0,0 @@
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};
@@ -1 +0,0 @@
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 +0,0 @@
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};
@@ -1 +0,0 @@
1
- import {a}from'./chunk-YPAFWBL4.js';var t=new a(globalThis,{get:()=>globalThis.Module,set:e=>{globalThis.Module=e;}});function l(e){}export{t as a,l as b};
@@ -1 +0,0 @@
1
- import {a}from'./chunk-XR65N6EG.js';var g=class{constructor(a){this.options=a;}get quality(){return this.options.quality}async convertToJpeg(a$1,e){try{let{width:t,height:r,planes:s}=this.validateAndExtractImageData(a$1);this.prepareCanvas(t,r);let o=this.processImageData(a$1,s,t,r);return await this.convertToJpegBytes(o,e)}catch(t){throw a.warn(`Failed to convert image to JPEG: ${t}`),t instanceof Error?t:new Error("Failed to convert image to JPEG")}}validateAndExtractImageData(a$1){let e=a$1.getWidth(),t=a$1.getHeight(),r=a$1.getPlanes();if(e<=0||t<=0)throw a.warn(`Invalid image dimensions: ${e}x${t}`),new Error(`Invalid image dimensions: ${e}x${t}`);if(!r||r.length===0)throw a.warn("ImageBuffer has no planes"),new Error("ImageBuffer has no planes");return {width:e,height:t,planes:r}}prepareCanvas(a,e){if(!this.ensureCanvas(a,e))throw new Error("Failed to create OffscreenCanvas");if(!this.canvas||!this.context)throw new Error("Canvas or context not properly initialized")}processImageData(a,e,t,r){let s=this.createImageDataFromBuffer(a,e,t,r);if(s===null)throw new Error("Failed to create ImageData");return this.validateImageData(s,t,r),s}validateImageData(a$1,e,t){var r;if(a$1.width!==e||a$1.height!==t)throw a.warn(`ImageData dimensions mismatch: expected ${e}x${t}, got ${a$1.width}x${a$1.height}`),new Error("ImageData dimensions mismatch");if(!a$1.data||a$1.data.length!==e*t*4)throw a.warn(`ImageData has invalid data length: expected ${e*t*4}, got ${((r=a$1.data)==null?void 0:r.length)||0}`),new Error("ImageData has invalid data length")}async convertToJpegBytes(a$1,e){if(!this.context||!this.canvas)throw new Error("Canvas or context not available");try{this.context.putImageData(a$1,0,0);}catch(o){throw a.warn(`Failed to put image data on canvas: ${o}`),new Error(`Failed to put image data on canvas: ${o}`)}let t=e!==0?this.applyRotation(this.canvas,e):this.canvas,r;try{r=await this.canvasToBlob(t);}catch(o){throw a.warn(`Failed to convert canvas to blob: ${o}`),new Error(`Failed to convert canvas to blob: ${o}`)}if(!r||r.size===0)throw a.warn("Canvas convertToBlob returned empty or null blob"),new Error("Failed to create JPEG blob");let s;try{s=await r.arrayBuffer();}catch(o){throw a.warn(`Failed to get array buffer from blob: ${o}`),new Error(`Failed to get array buffer from blob: ${o}`)}if(!s||s.byteLength===0)throw a.warn("Blob arrayBuffer returned empty or null buffer"),new Error("Failed to get array buffer from blob");return new Uint8Array(s)}ensureCanvas(a$1,e){try{return (!this.canvas||this.canvas.width!==a$1||this.canvas.height!==e)&&(this.canvas=this.getNewCanvas(a$1,e),this.context=this.canvas.getContext("2d")),this.context!==null}catch(t){return a.warn("Failed to create HTMLCanvasElement",t),false}}createImageDataFromBuffer(a$1,e,t,r){let s=new Set(e.map(o=>o.channel));try{if(this.isYUVFormat(s)){let n=a$1.toBitmap();return !n||n.length!==t*r*4?(a.warn(`Invalid bitmap data from toBitmap(): expected ${t*r*4} bytes, got ${(n==null?void 0:n.length)||0}`),null):new ImageData(new Uint8ClampedArray(n),t,r)}if(this.isRGBAFormat(s))return this.createImageDataFromRGBAPlanes(e,t,r);if(this.isRGBFormat(s))return this.createImageDataFromRGBPlanes(e,t,r);if(this.isGrayscaleFormat(s))return this.createImageDataFromGrayscalePlanes(e,t,r);a.warn(`Unknown image format with channels: ${Array.from(s).join(", ")}, falling back to toBitmap()`);let o=a$1.toBitmap();if(!o||o.length===0)return a.warn("toBitmap() returned empty or null data"),null;let l=o.length/(t*r);return l===4?new ImageData(new Uint8ClampedArray(o),t,r):(a.warn(`Unsupported format: ${l} bytes per pixel`),null)}catch(o){return a.warn(`Failed to create ImageData: ${o}`),null}}isYUVFormat(a){return a.has(0)&&a.has(1)&&a.has(2)}isRGBAFormat(a){return a.has(3)&&a.has(4)&&a.has(5)&&a.has(6)}isRGBFormat(a){return a.has(3)&&a.has(4)&&a.has(5)&&!a.has(6)}isGrayscaleFormat(a){return a.has(0)&&!a.has(1)&&!a.has(2)}createImageDataFromRGBAPlanes(a$1,e,t){let r=a$1.find(i=>i.channel===3),s=a$1.find(i=>i.channel===4),o=a$1.find(i=>i.channel===5),l=a$1.find(i=>i.channel===6);if(!r||!s||!o||!l)return a.warn("Missing RGBA planes"),null;let n=new Uint8ClampedArray(e*t*4);for(let i=0;i<t;i++)for(let c=0;c<e;c++){let u=(i*e+c)*4;n[u]=this.getPixelFromPlane(r,c,i),n[u+1]=this.getPixelFromPlane(s,c,i),n[u+2]=this.getPixelFromPlane(o,c,i),n[u+3]=this.getPixelFromPlane(l,c,i);}return new ImageData(n,e,t)}createImageDataFromRGBPlanes(a$1,e,t){let r=a$1.find(n=>n.channel===3),s=a$1.find(n=>n.channel===4),o=a$1.find(n=>n.channel===5);if(!r||!s||!o)return a.warn("Missing RGB planes"),null;let l=new Uint8ClampedArray(e*t*4);for(let n=0;n<t;n++)for(let i=0;i<e;i++){let c=(n*e+i)*4;l[c]=this.getPixelFromPlane(r,i,n),l[c+1]=this.getPixelFromPlane(s,i,n),l[c+2]=this.getPixelFromPlane(o,i,n),l[c+3]=255;}return new ImageData(l,e,t)}createImageDataFromGrayscalePlanes(a$1,e,t){let r=a$1.find(o=>o.channel===0);if(!r)return a.warn("Missing Y plane for grayscale"),null;let s=new Uint8ClampedArray(e*t*4);for(let o=0;o<t;o++)for(let l=0;l<e;l++){let n=(o*e+l)*4,i=this.getPixelFromPlane(r,l,o);s[n]=i,s[n+1]=i,s[n+2]=i,s[n+3]=255;}return new ImageData(s,e,t)}getPixelFromPlane(a,e,t){let r=Math.floor(e/(a.subsamplingX||1)),s=Math.floor(t/(a.subsamplingY||1)),o=a.rowStride,l=a.pixelStride,n=s*o+r*l,i=a.data;return n<i.length?i[n]:0}applyRotation(a,e){let t=e*Math.PI/180,r=e===90||e===270||e===-90||e===-270,s=r?a.height:a.width,o=r?a.width:a.height,l=this.getNewCanvas(s,o),n=l.getContext("2d");if(!n)throw new Error("Failed to get 2D context for rotated canvas");return n.translate(s/2,o/2),n.rotate(t),n.translate(-a.width/2,-a.height/2),n.drawImage(a,0,0),l}};g.JPEG_IMAGE_MIME_TYPE="image/jpeg";export{g as a};
@@ -1 +0,0 @@
1
- import {a as a$8}from'./chunk-4QDO6ZMC.js';import {a as a$7}from'./chunk-DZKZ6RMW.js';import {d}from'./chunk-AFCJ24Y3.js';import {a as a$5}from'./chunk-KAFNKP6O.js';import {a as a$4}from'./chunk-E4XJ4GKD.js';import {a as a$6}from'./chunk-QOCHMKNY.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};
@@ -1 +0,0 @@
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-JVZGAWFX.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};
@@ -1 +0,0 @@
1
- var e;(o=>{function i(){let r="8.1.1";return r}o.sdkVersion=i;})(e||(e={}));export{e as a};
@@ -1 +0,0 @@
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 +0,0 @@
1
- import {a}from'./chunk-XR65N6EG.js';var s=class o{constructor(e){this.memoryFallback=new Map;o.isStorageTypeSupported(e)?(this.storage=e==="localStorage"?globalThis.localStorage:globalThis.sessionStorage,this.isSupported=true):(this.isSupported=false,a.debug(`Failed to access ${e}. Fallback to memory storage.`));}get length(){return this.storage?this.storage.length:this.memoryFallback.size}static isStorageTypeSupported(e){try{return e==="localStorage"?globalThis.localStorage.setItem("test","test"):globalThis.sessionStorage.setItem("test","test"),e==="localStorage"?globalThis.localStorage.removeItem("test"):globalThis.sessionStorage.removeItem("test"),true}catch{return false}}key(e){return this.storage?this.storage.key(e):Array.from(this.memoryFallback.keys())[e]}getItem(e){var t;return this.storage?this.storage.getItem(e):(t=this.memoryFallback.get(e))!=null?t:null}setItem(e,t){this.storage?this.storage.setItem(e,t):this.memoryFallback.set(e,t);}removeItem(e){this.storage?this.storage.removeItem(e):this.memoryFallback.delete(e);}clear(){this.storage?this.storage.clear():this.memoryFallback.clear();}},l=new s("localStorage"),i=new s("sessionStorage");export{s as a,l as b,i as c};
@@ -1 +0,0 @@
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};
@@ -1 +0,0 @@
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};
@@ -1 +0,0 @@
1
- import {a as a$1}from'./chunk-SGL5J2CI.js';var e=a$1.fromRGBA(46,193,206,1),n=a$1.fromRGBA(98,209,218,1),t=a$1.fromRGBA(151,224,230,1),c=a$1.fromRGBA(203,240,243,1),a=a$1.fromRGBA(18,22,25,1),m=a$1.fromRGBA(218,225,231,1),p=a$1.fromRGBA(40,211,128,1),G=a$1.fromRGBA(83,220,153,1),R=a$1.fromRGBA(126,229,179,1),B=a$1.fromRGBA(169,237,204,1),f=a$1.fromRGBA(212,246,230,1),s=a$1.fromRGBA(251,192,44,1),x=a$1.fromRGBA(252,205,86,1),y=a$1.fromRGBA(253,217,128,1),A=a$1.fromRGBA(254,230,171,1),d=a$1.fromRGBA(254,242,213,1),S=a$1.fromRGBA(250,68,70,1),l=a$1.fromRGBA(251,105,107,1),g=a$1.fromRGBA(252,143,144,1),i=a$1.fromRGBA(253,180,181,1),O=a$1.fromRGBA(254,218,218,1),T=a$1.fromRGBA(10,51,144,1),u=a$1.fromRGBA(22,96,217,1),C=a$1.fromRGBA(217,231,255,1);export{e as a,n as b,t as c,c as d,a as e,m as f,p as g,G as h,R as i,B as j,f as k,s as l,x as m,y as n,A as o,d as p,S as q,l as r,g as s,i as t,O as u,T as v,u as w,C as x};
@@ -1 +0,0 @@
1
- async function u(e,l){let t=document.createElement("canvas");t.width=this.width,t.height=this.height;let o=t.getContext("2d");if(!o)throw new Error("Could not get 2d context from an HTMLCanvasElement");let s=await this.getData();if(s==null)return null;let m;if(this.colorType==="GRAYSCALE"){let n=this.width*this.height,a=new Uint8ClampedArray(n*4);for(let r=0;r<n;r++){let h=s[r],i=r*4;a[i]=h,a[i+1]=h,a[i+2]=h,a[i+3]=255;}m=new ImageData(a,this.width,this.height);}else m=new ImageData(s,this.width,this.height);return o.putImageData(m,0,0),new Promise((n,a)=>{t.toBlob(r=>{if(t=null,o=null,r===null){a(new Error("Could not create Blob object from canvas"));return}n(r);},e,l);})}function c(e,l){let t={width:e.width,height:e.height,isFrameSourceMirrored:e.isFrameSourceMirrored,colorType:e.colorType,getData:async()=>(await l.requestFrameData(e.frameId)).data};return t.toBlob=u.bind(t),t}export{c as a};
@@ -1 +0,0 @@
1
- import {b}from'./chunk-24IG7HUA.js';import {a as a$1}from'./chunk-SGL5J2CI.js';var h=(t=>(t.ArrowDown="arrowDown",t.ArrowLeft="arrowLeft",t.ArrowRight="arrowRight",t.ArrowUp="arrowUp",t.CameraSwitch="cameraSwitch",t.Checkmark="checkMark",t.ChevronDown="chevronDown",t.ChevronLeft="chevronLeft",t.ChevronRight="chevronRight",t.ChevronUp="chevronUp",t.Delete="delete",t.DotFiveX="dotFiveX",t.ExclamationMark="exclamationMark",t.ExpiredItem="expiredItem",t.FragileItem="fragileItem",t.InspectItem="inspectItem",t.Keyboard="keyboard",t.LowStock="lowStock",t.OneX="oneX",t.Print="print",t.QuestionMark="questionMark",t.Restart="restart",t.Slash="slash",t.StarFilled="starFilled",t.StarHalfFilled="starHalfFilled",t.StarOutlined="starOutlined",t.ToPick="toPick",t.TwoX="twoX",t.WrongItem="wrongItem",t.XMark="xMark",t))(h||{}),l={arrowDown:import('../private/ui/atoms/ArrowDownSvgIcon.js').then(o=>o.ArrowDownSvgIcon),arrowLeft:import('../private/ui/atoms/ArrowLeftSvgIcon.js').then(o=>o.ArrowLeftSvgIcon),arrowRight:import('../private/ui/atoms/ArrowRightSvgIcon.js').then(o=>o.ArrowRightSvgIcon),arrowUp:import('../private/ui/atoms/ArrowUpSvgIcon.js').then(o=>o.ArrowUpSvgIcon),cameraSwitch:import('../private/ui/atoms/CameraSwitchSvgIcon.js').then(o=>o.CameraSwitchSvgIcon),checkMark:import('../private/ui/atoms/CheckSvgIcon.js').then(o=>o.CheckSvgIcon),chevronDown:import('../private/ui/atoms/ChevronDownSvgIcon.js').then(o=>o.ChevronDownSvgIcon),chevronLeft:import('../private/ui/atoms/ChevronLeftSvgIcon.js').then(o=>o.ChevronLeftSvgIcon),chevronRight:import('../private/ui/atoms/ChevronRightSvgIcon.js').then(o=>o.ChevronRightSvgIcon),chevronUp:import('../private/ui/atoms/ChevronUpSvgIcon.js').then(o=>o.ChevronUpSvgIcon),delete:import('../private/ui/atoms/DeleteSvgIcon.js').then(o=>o.DeleteSvgIcon),dotFiveX:import('../private/ui/atoms/Dot5xSvgIcon.js').then(o=>o.Dot5xSvgIcon),exclamationMark:import('../private/ui/atoms/ExclamationMarkSvgIcon.js').then(o=>o.ExclamationMarkSvgIcon),expiredItem:import('../private/ui/atoms/CalendarExclamationMarkSvgIcon.js').then(o=>o.CalendarExclamationMarkSvgIcon),fragileItem:import('../private/ui/atoms/GlassSvgIcon.js').then(o=>o.GlassSvgIcon),inspectItem:import('../private/ui/atoms/HandLensCheckSvgIcon.js').then(o=>o.HandLensCheckSvgIcon),keyboard:import('../private/ui/atoms/KeyboardSvgIcon.js').then(o=>o.KeyboardSvgIcon),lowStock:import('../private/ui/atoms/LowStockSvgIcon.js').then(o=>o.LowStockSvgIcon),oneX:import('../private/ui/atoms/OnexSvgIcon.js').then(o=>o.OnexSvgIcon),print:import('../private/ui/atoms/PrinterSvgIcon.js').then(o=>o.PrinterSvgIcon),questionMark:import('../private/ui/atoms/QuestionMarkSvgIcon.js').then(o=>o.QuestionMarkSvgIcon),restart:import('../private/ui/atoms/RestartSvgIcon.js').then(o=>o.RestartSvgIcon),slash:import('../private/ui/atoms/SlashSvgIcon.js').then(o=>o.SlashSvgIcon),starFilled:import('../private/ui/atoms/StarFilledSvgIcon.js').then(o=>o.StarFilledSvgIcon),starHalfFilled:import('../private/ui/atoms/StarHalfFilledSvgIcon.js').then(o=>o.StarHalfFilledSvgIcon),starOutlined:import('../private/ui/atoms/StarOutlinedSvgIcon.js').then(o=>o.StarOutlinedSvgIcon),toPick:import('../private/ui/atoms/ToPickSvgIcon.js').then(o=>o.ToPickSvgIcon),twoX:import('../private/ui/atoms/TwoxSvgIcon.js').then(o=>o.TwoxSvgIcon),wrongItem:import('../private/ui/atoms/WrongItemSvgIcon.js').then(o=>o.WrongItemSvgIcon),xMark:import('../private/ui/atoms/CrossSvgIcon.js').then(o=>o.CrossSvgIcon)},a=class{constructor(){this.iconName=null;this.backgroundShape=null;this.iconColor=a$1.fromHex("#fff");this.backgroundStrokeWidth=0;this.width=32;this.height=32;this.iconSize=null;}withIcon(r){return this.iconName=r,this}withBackgroundShape(r){return this.backgroundShape=r,this}withIconColor(r){return this.iconColor=r,this}withBackgroundColor(r){return this.backgroundColor=r,this}withBackgroundStrokeColor(r){return this.backgroundStrokeColor=r,this}withBackgroundStrokeWidth(r){return this.backgroundStrokeWidth=r,this}async build(){let r=b.create();r.backgroundStrokeWidth=this.backgroundStrokeWidth,r.backgroundShape=this.backgroundShape,this.backgroundColor!=null&&(r.backgroundColor=this.backgroundColor),this.backgroundStrokeColor!=null&&(r.backgroundStrokeColor=this.backgroundStrokeColor);let n=null;if(this.iconName!=null){let e=await l[this.iconName];e.register(),n=e.create(),r.append(n);}return r.width=this.width,r.height=this.height,r.iconColor=this.iconColor,n!=null&&this.iconSize!=null&&(n.size=this.iconSize),r}withIconSize(r){return this.iconSize=r,this}withWidth(r){return this.width=r,this}withHeight(r){return this.height=r,this}};export{h as a,l as b,a as c};
@@ -1,6 +0,0 @@
1
- import {a as a$6}from'./chunk-C3EY6I75.js';import {a as a$9,c as c$2,b as b$3}from'./chunk-X2ZGBI4S.js';import {a as a$g}from'./chunk-BA3RP6L2.js';import {a as a$7}from'./chunk-AIC4H5KG.js';import {a as a$e}from'./chunk-4F5JUHOJ.js';import {a as a$c}from'./chunk-JS3T7K2Z.js';import {b as b$2}from'./chunk-6H6FKGVE.js';import {a as a$b}from'./chunk-N5YZEC56.js';import {a as a$5}from'./chunk-VJB527QZ.js';import {a as a$4}from'./chunk-GHTCNOQN.js';import {a as a$1}from'./chunk-LXOZUOZU.js';import {a as a$d}from'./chunk-FGO2SSRS.js';import {d}from'./chunk-HMOFGW5O.js';import {a as a$8}from'./chunk-GPJEB376.js';import {b as b$1}from'./chunk-VBUDN72N.js';import {c as c$1,e}from'./chunk-SBC5K7IT.js';import {a as a$3}from'./chunk-XR65N6EG.js';import {f as f$1}from'./chunk-3D2HNEVH.js';import {a as a$f}from'./chunk-WUHKODFA.js';import {a as a$2}from'./chunk-7SW2PEHB.js';import {a as a$a}from'./chunk-QCZSSQAQ.js';import {c}from'./chunk-TR3NGINC.js';var $=[{from:"unconfigured",to:"configuring"},{from:"configuring",to:"configured"},{from:"configuring",to:"unconfigured"},{from:"configured",to:"creating-context"},{from:"creating-context",to:"ready"},{from:"creating-context",to:"unconfigured"},{from:"ready",to:"unconfigured"},{from:"configured",to:"unconfigured"}];function f(C,e,t){let r=t.value;return t.value=function(...n){let i=g.stateMachine;return i.currentState==="ready"&&g.mainDataCaptureLoader!=null?r.apply(this,n):i.isInitializing||i.currentState==="configured"?i.waitForState("ready").then(()=>r.apply(this,n)):Promise.reject(new Error(`Please call DataCaptureContext.forLicenseKey() before calling ${String(e)}`))},t}function j(C){return C[a$g]!=null}function P(C){return "skipSerialization"in C||C[a$g]!=null}var z,B,U,a=class a{constructor(){this._asyncImageConverterInstance=void 0;this.framework="web";this.runtimeEnvironment={deviceOS:(z=b$1.getUserAgentInfo().getOS().name)!=null?z:"",browser:(B=b$1.getUserAgentInfo().getBrowser().name)!=null?B:"",browserVersion:(U=b$1.getUserAgentInfo().getBrowser().version)!=null?U:"",get deviceModelName(){let{model:e,vendor:t}=b$1.getUserAgentInfo().getDevice();return (t==null||t==="")&&(t="Unknown"),(e==null||e==="")&&(e="Unknown"),[t,e].join(" ")}};this.settings=new a$2;this._frameSource=null;this._view=null;this.modes=new Set;this.components=[];this.listeners=[];this.updateListeners=new Set;this.cameraPropertiesReportListener=this.reportCameraProperties.bind(this);this.cameraAccessErrorListener=this.onCameraAccessError.bind(this);this.onWorkerMessageListener=this.onWorkerMessage.bind(this);this.onVisibilityChangeListener=this.onVisibilityChange.bind(this);this.pendingWorkerMessageListeners=new Set;this.delayedRegistration=false;this.highEndBlurryRecognition=false;this._frameHandlers=[];this._useSynchronousFrameFlow=false;}static get moduleLicenseTextProviders(){return [new b]}static get sharedInstance(){return a._sharedInstance==null&&(a._sharedInstance=new a),a._sharedInstance}static get currentState(){return a.stateMachine.currentState}static get isReady(){return a.stateMachine.currentState==="ready"}static get isInitializing(){return a.stateMachine.isInitializing}static addStateListener(e){a.stateMachine.addListener(e);}static removeStateListener(e){a.stateMachine.removeListener(e);}async initializeWithOptions(e){var t,r,n,i,o,s,u,p,c;this.licenseKey=(r=(t=e.licenseKey)!=null?t:a.userLicenseKey)!=null?r:"",this.deviceName=(n=e.deviceName)!=null?n:"",this.dataCaptureInstance=(i=e.dataCaptureInstance)!=null?i:a.mainDataCaptureLoader,this.delayedRegistration=(o=e.delayedRegistration)!=null?o:false,e.settings!=null&&(this.settings=e.settings),this.highEndBlurryRecognition=(c=(p=(s=e.dataCaptureInstance)==null?void 0:s.highEndBlurryRecognition)!=null?p:(u=a.mainDataCaptureLoader)==null?void 0:u.highEndBlurryRecognition)!=null?c:false;for(let S of this.pendingWorkerMessageListeners)this.dataCaptureInstance.addWorkerListener(S);this.pendingWorkerMessageListeners.clear(),this.settings!=null&&await this.applySettings(this.settings),await this.createContext();}get frameSource(){return this._frameSource}get workerCommand(){if(this.dataCaptureInstance==null)throw new Error("Cannot call workerCommand before dataCaptureInstance is set");return this.dataCaptureInstance.workerCommand.bind(this.dataCaptureInstance)}static async forLicenseKey(e,t){return a$3.debug(`forLicenseKey called, current state: ${a.stateMachine.currentState}`),a.stateMachine.currentState==="ready"?(a$3.debug("DataCaptureContext is already ready, returning existing instance"),a.sharedInstance):a.stateMachine.isInitializing?(a$3.debug("DataCaptureContext is already initializing, waiting for completion"),await a.stateMachine.waitForState("ready"),a.sharedInstance):(a.stateMachine.currentState==="unconfigured"&&(a$3.debug("Starting initialization from unconfigured state"),await a.stateMachine.executeAsyncTransition({targetState:"configuring",action:async()=>{await a.internalConfigure(e,t);},onSuccess:"configured",onError:"unconfigured"}),await a.stateMachine.executeAsyncTransition({targetState:"creating-context",action:async()=>{await a.sharedInstance.initializeWithOptions({licenseKey:e,deviceName:t.deviceName,settings:t.settings});},onSuccess:"ready",onError:"unconfigured"})),a.sharedInstance)}static async internalConfigure(e$1,t){var S;a$4.getInstance().updateIfMissing(a$5);let{forceAllPolyfills:r,overrideThreadsSupport:n,overrideSimdSupport:i}=a.getOverridesFromQueryString(),[o,s,u]=await Promise.all([a$6({forceAllPolyfills:r}),c$1(),e()]);n!=="auto"&&(a$3.warn(`Threads support override: was ${u} is now ${n==="on"}`),u=n==="on"),i!=="auto"&&(a$3.warn(`SIMD support override: was ${s} is now ${i==="on"}`),s=i==="on"),a.capabilityInfo={simdSupport:s,threadsSupport:u},a$3.debug(`Capability info detected - SIMD: ${s}, Threads: ${u}`),await a.validateOptions({...t,licenseKey:e$1});let p={licenseKey:e$1,libraryLocation:a$7(t.libraryLocation),moduleLoaders:t.moduleLoaders,logLevel:(S=t.logLevel)!=null?S:a$3.Level.Debug,verifyResponseHash:true,loadProgressNotifier:b$2.notify.bind(b$2),simdSupport:s,threadsSupport:u};a$3.setLevel(p.logLevel),a.userLicenseKey=p.licenseKey,a.libraryLocation=p.libraryLocation,b$2.subscribe(a.updateViewsWithProgress);let c=b$1.checkBrowserCompatibility();if(!c.fullSupport&&!c.scannerSupport)throw new a$8(c);b$1.isSupportedIOSVersion()||a$3.warn(`Warning: Minimum supported iOS version is 14.6.
2
- Please check the minimum system requirements here:
3
- https://docs.scandit.com/system-requirements#browser-compatibility`),a.dataCaptureLoaders=await a.loadModules(p.moduleLoaders,p),a.mainDataCaptureLoader=[...a.dataCaptureLoaders.entries()][0][1],b$2.unsubscribe(a.updateViewsWithProgress);}static async forLicenseKeyInElectronPath(e,t){if(!a$9())throw new a$a({name:"MisconfigurationError",message:"forLicenseKeyInElectronPath can only be used in Electron applications"});let r=await c$2({licenseDataPath:e});if(r==null)throw new a$a({name:"NoLicenseKeyError",message:`Cannot retrieve license key for Electron app at ${e}`});return a.forLicenseKey(r.licenseKey,{...t})}static updateViewsWithProgress({percentage:e}){for(let t of a$b.values())t.setProgressBarPercentage(e);}static getOverridesFromQueryString(){var o,s,u;function e(p){return ["auto","off","on"].includes(p)}let t=new URLSearchParams(window.location.search),[r="auto",n="auto",i=false]=[(o=t.get("pthreads"))==null?void 0:o.toLowerCase(),(s=t.get("simd"))==null?void 0:s.toLowerCase(),((u=t.get("forceAllPolyfills"))==null?void 0:u.toLowerCase())==="true"];return {overrideThreadsSupport:e(r)?r:"auto",overrideSimdSupport:e(n)?n:"auto",forceAllPolyfills:i}}static async validateOptions(e){if(e.licenseKey==null||e.licenseKey.trim().length<64)throw new a$a({name:"NoLicenseKeyError",message:"No license key provided"});if(typeof e.libraryLocation!="string")throw new a$a({name:"MisconfigurationError",message:'Option "libraryLocation" was not provided'});if(!Array.isArray(e.moduleLoaders)||e.moduleLoaders.length===0)throw new a$a({name:"MisconfigurationError",message:'Option "moduleLoaders" is missing or empty'});let t=e.moduleLoaders.map(r=>r.moduleName);if(!["BarcodeCapture","IdCapture","LabelCapture"].includes(t[0]))throw new a$a({name:"MisconfigurationError",message:'Main modules must be loaded before side modules. For example "BarcodeCapture" must be loaded before "Parser".'})}static async loadModules(e,t){let r=new Map,n=new Map;for(let i of e)n.set(i.moduleName,i.load(t));await Promise.all(n.values());for(let[i,o]of n)r.set(i,await o);return r}static async getOpenSourceSoftwareLicenseInfo(){let e=[];for(let r of a.moduleLicenseTextProviders){let n=await r.getLicenseText();e.push(n);}let t=e.join(`
4
-
5
- `);return new a$c(t)}async setFrameSource(e){let t=e!==this._frameSource;if(this._frameSource!==null&&(this._frameSource.context=null),this._frameSource=e!=null?e:null,e&&(e.context=this,await this.workerCommand("setFrameSource",{mirrorAxis:this.getMirrorAxisForFrameSource(e),isCameraFrameSource:f$1(e)})),await this.update([{type:"frameSourceState",newValue:this.frameSource}]),t)for(let r of this.listeners)r.didChangeFrameSource&&r.didChangeFrameSource(this,this._frameSource);}addListener(e){this.listeners.includes(e)||this.listeners.push(e);}async flushAnalytics(){await this.workerCommand("flushAnalytics",{});}removeListener(e){this.listeners.includes(e)&&this.listeners.splice(this.listeners.indexOf(e),1);}async addMode(e){this.modes.add(e),await e.attachedToContext(this),this.updateCameraFrameFlow(),await this.update([],{updateContext:!P(e)});}async removeMode(e){this.modes.delete(e),await e.detachedFromContext(),this.updateCameraFrameFlow(),await this.update([],{updateContext:!P(e)});}async setMode(e){this.modes.has(e)||(this.modes.clear(),this.modes.add(e),await e.attachedToContext(this),this.updateCameraFrameFlow(),await this.update());}async removeCurrentMode(){for(let e of this.modes)await e.detachedFromContext();this.modes.clear(),await this.update();}async removeAllModes(){let e=Array.from(this.modes);for(let t of e)await this.removeMode(t);}async dispose(){if(a.stateMachine.currentState!=="unconfigured")try{await a.stateMachine.executeAsyncTransition({targetState:"unconfigured",action:async()=>{d.instance().removeListener("cameraProperties",this.cameraPropertiesReportListener),d.instance().removeListener("cameraAccessError",this.cameraAccessErrorListener),this.unsubscribeToVisibilityChange(this.onVisibilityChangeListener);for(let e of this.modes)await e.detachedFromContext();this._view&&(await this._view.setContext(null),this._view=null),this.dataCaptureInstance&&(await this.dataCaptureInstance.terminateDataCaptureWorker(true).catch(()=>{}),this.dataCaptureInstance=void 0);},onSuccess:"unconfigured",onError:"unconfigured"});}catch(e){if(a.stateMachine.currentState==="unconfigured")return;throw e}finally{this.modes.clear(),this.listeners=[],this.components.length=0,this.updateListeners.clear(),this.pendingWorkerMessageListeners.clear(),this.delayedRegistration=false,this.highEndBlurryRecognition=false,this._frameHandlers.length=0,this.frameSource&&(this.frameSource.context=null,this._frameSource=null),this.licenseKey="",this.deviceName="";}}async applySettings(e){this.settings=e,await this.update();}toJSONObject(){var e,t;return {licenseKey:this.licenseKey,framework:this.framework,deviceName:this.deviceName,...this.runtimeEnvironment,modes:[...this.modes].filter(r=>!P(r)).map(r=>r.toJSONObject()),components:this.components.map(r=>r.toJSONObject()),frameSource:this.frameSource?this.frameSource.toJSONObject():null,settings:this.settings.toJSONObject(),view:(t=(e=this._view)==null?void 0:e.toJSONObject())!=null?t:null}}getView(){return this._view}async setView(e){return this._view=e,this.update([{type:"viewSet",newValue:e}])}async getAppName(){let e=null;if(a$9()){let t=await b$3();if((t==null?void 0:t.appName)==null||t.appName==="")throw new Error("Cannot retrieve electron appName. Did you set it up in package.json? https://www.electronjs.org/docs/latest/api/app#appgetname");e=t.appName;}return e}urlToHostname(e){try{return new URL(e!=null?e:"").hostname}catch{return ""}}getParentDomain(){var t;let e="";return parent!==window&&(e||(e=this.urlToHostname((t=location.ancestorOrigins)==null?void 0:t[0])),e||(e=this.urlToHostname(document.referrer)),e||(e="")),e.startsWith("[")&&e.endsWith("]")&&(e=e.slice(1,-1)),e}async createContext(){await this.workerCommand("createContext",{context:this.toJSONObject(),deviceId:a.deviceID,delayedRegistration:this.delayedRegistration,highEndBlurryRecognition:this.highEndBlurryRecognition,appName:await this.getAppName(),parentDomain:this.getParentDomain()}),this.subscribeToWorkerMessages(this.onWorkerMessageListener),this.subscribeToCameraManagerEvents(),this.subscribeToVisibilityChange(this.onVisibilityChangeListener),this._view!=null&&await this.setView(this._view),this.frameSource!=null&&await this.setFrameSource(this.frameSource);}subscribeToVisibilityChange(e){document.addEventListener("visibilitychange",e);}unsubscribeToVisibilityChange(e){document.removeEventListener("visibilitychange",e);}async requestFrameData(e){return this.workerCommand("requestFrameData",{frameId:e})}performanceMark(e){a$d(globalThis.performance)&&typeof globalThis.performance.mark=="function"&&performance.mark(e);}async sendFrameToProcessor(e){let t=e instanceof ImageData?{data:e.data,width:e.width,height:e.height}:e,r=await this.sendFrameToHandlers(t);return t.data=r.capture.data,r.skip?r.capture:(this.performanceMark("processFrameBeforeSDC"),this.sendFrameToSDC(t))}async sendFrameToHandlers(e){for(let t of this._frameHandlers)if((await t(e)).action==="skip")return {skip:true,capture:e};return {skip:false,capture:e}}async sendFrameToSDC(e){return this.workerCommand("processFrame",e,[e.data.buffer])}registerFrameHandler(e){this._frameHandlers.includes(e)||this._frameHandlers.push(e);}unregisterFrameHandler(e){this._frameHandlers.includes(e)&&this._frameHandlers.splice(this._frameHandlers.indexOf(e),1);}onVisibilityChange(){this.workerCommand("documentVisibility",{state:document.visibilityState});}getImageConverterInstance(e){return this._asyncImageConverterInstance==null&&(this._asyncImageConverterInstance=new a$e(e)),this._asyncImageConverterInstance}onWorkerMessage(e){if(e.type==="contextDidChangeStatus"){e.payload.isValid||a$3.error(e.payload);for(let t of this.listeners)t.didChangeStatus&&t.didChangeStatus(this,a$f.fromJSON(e.payload));}if(e.type==="didStartObservingContext")for(let t of this.listeners)t.didStartObservingContext&&t.didStartObservingContext(this);e.type==="onFrameProcessingFinished"&&this.performanceMark("processFrameAfterSDC"),e.type==="convertToJPEG"&&this.convertImageToJPEG(e);}async convertImageToJPEG(e){let{imageId:t,width:r,height:n,data:i,planes:o,orientation:s,quality:u}=e,p={getWidth:()=>r,getHeight:()=>n,getPlanes:()=>o,toBitmap:()=>i,getBitmapRepresentationFromYUV:()=>{throw new Error("Not implemented")},deepCopy:()=>{throw new Error("Not implemented")}},c=await this.getImageConverterInstance({quality:u}).convertToJpeg(p,s);return this.workerCommand("convertToJPEGResult",{imageId:t,result:c})}subscribeToCameraManagerEvents(){d.instance().addListener("cameraProperties",this.cameraPropertiesReportListener),d.instance().addListener("cameraAccessError",this.cameraAccessErrorListener);}async reportCameraProperties(e){return this.workerCommand("reportCameraProperties",e)}onCameraAccessError(e){for(let t of this.listeners)t.didChangeStatus&&t.didChangeStatus(this,a$f.fromJSON({code:33794,isValid:true,message:typeof(e==null?void 0:e.toString)=="function"?e.toString():"Unknown error"}));}async update(e=[],{updateContext:t=true}={}){var r,n;t&&await this.updateContext();for(let i of e){switch(i.type){case "frameSourceState":{await((r=this._view)==null?void 0:r.onFrameSourceChange(this.frameSource));break}case "singleImageModeUploaderSettings":{(n=this._view)==null||n.onSingleImageUploaderSettingsChange(i.newValue);break}case "addOverlay":{await this.addNativeOverlay(i.newValue);break}case "removeOverlay":{await this.removeNativeOverlay(i.newValue);break}}for(let o of this.updateListeners)o(i);}}async updateContext(){await this.workerCommand("updateContext",{context:this.toJSONObject(),...this.getViewInfo()}).catch(e=>a$3.warn("Error while updating context:",e,this.toJSONObject()));}getViewInfo(){return this._view!=null?{view:{width:this._view.width,height:this._view.height,visible:this._view.width>0&&this._view.height>0,orientation:this._view.orientation}}:{view:null}}getMirrorAxisForFrameSource(e){let t="None";return f$1(e)&&e.getMirrorImageEnabled()&&(t="Y"),t}async addComponent(e){if(!this.components.includes(e))return this.components.push(e),e._context=this,this.update()}async addNativeOverlay(e){if(j(e))return this.workerCommand("addNativeOverlay",{overlayHandle:e[a$g]})}async removeNativeOverlay(e){if(j(e))return this.workerCommand("removeNativeOverlay",{overlayHandle:e[a$g]})}subscribeToWorkerMessages(e){this.dataCaptureInstance?this.dataCaptureInstance.addWorkerListener(e):this.pendingWorkerMessageListeners.add(e);}unsubscribeToWorkerMessages(e){this.dataCaptureInstance&&this.dataCaptureInstance.removeWorkerListener(e),this.pendingWorkerMessageListeners.delete(e);}hasEnabledMode(){return [...this.modes].some(e=>e.isEnabled())}updateCameraFrameFlow(){let e=[...this.modes].some(t=>t._synchronousFrameFlow===true);d.instance().setFrameHandling(e);}async isFeatureSupported(e){return (await this.workerCommand("isFeatureSupported",{feature:e})).supported}};a.deviceID=b$1.getDeviceId(),a.stateMachine=new a$1("unconfigured",$),a.mainDataCaptureLoader=void 0,a.dataCaptureLoaders=new Map,a.libraryLocation=void 0,a.userLicenseKey=null,a.capabilityInfo=void 0,c([f],a.prototype,"setFrameSource",1),c([f],a.prototype,"addMode",1),c([f],a.prototype,"removeMode",1),c([f],a.prototype,"setMode",1),c([f],a.prototype,"removeCurrentMode",1),c([f],a.prototype,"isFeatureSupported",1);var g=a;var b=class{constructor(e=g,t=a$3,r=globalThis.fetch.bind(globalThis)){this.staticContext=g;this.staticContext=e,this.logger=t,this.fetch=r;}get workerCommand(){var e;return (e=this.staticContext.mainDataCaptureLoader)==null?void 0:e.workerCommand.bind(this.staticContext.mainDataCaptureLoader)}async getLicenseText(){var i,o;let e=this.staticContext.stateMachine.currentState;if(e==="unconfigured"||e==="configuring")return this.logger.warn('You must call "DataCaptureContext.forLicenseKey" before retrieving open source license text info.'),"";let t=new URL(`${((i=this.staticContext.libraryLocation)!=null?i:"").replace(/\/$/,"")}/license/web-core-license.txt`),[r,n]=await Promise.all([(o=this.workerCommand)==null?void 0:o.call(this,"getOpenSourceSoftwareLicenseInfo",{}),this.fetchWebLicenseText(t.toString())]);return [r==null?void 0:r.licenseText,n].filter(s=>s!=null).join(`
6
- `)}async fetchWebLicenseText(e){return this.fetch(e,{mode:"cors",credentials:"include",headers:{"Content-Type":"text/plain"}}).then(async t=>{if(!t.ok)throw new Error(`${t.status} ${t.statusText}`);return t.text()}).catch(t=>(this.logger.warn(`Failed to fetch license from ${e}: ${t.toString()}`),null))}};export{b as a,g as b};
@@ -1 +0,0 @@
1
- import {c,a as a$1,b}from'./chunk-JFRSUCMO.js';import {a as a$3}from'./chunk-EQRBQJYM.js';import {a as a$2}from'./chunk-GHTCNOQN.js';import {a as a$4}from'./chunk-XR65N6EG.js';var a=class a{constructor(e){this.canUploadFile=false;this._mounted=false;this._loading=false;this._htmlRoot=void 0;this._canvas=void 0;this._onInputCheck=void 0;this._onBeforeFileRead=void 0;this._onImageLoadError=void 0;this._onFileReaderError=void 0;this._onCaptureReady=void 0;this._resizedImageSizeLimit=1440;this._inputElement=void 0;this._buttonElement=void 0;this._informationElement=void 0;this._chooseImageText="";this._localizationSubscription=void 0;this._onLocalizationUpdated=this.onLocalizationUpdated.bind(this);this._settings=e;}get canvas(){return this._canvas||(this._canvas=document.createElement("canvas")),this._canvas}get canvasContext(){return this._canvasContext||(this._canvasContext=this.canvas.getContext("2d",{willReadFrequently:true})),this._canvasContext}mount(e){var g;if(this._mounted)return;if(!document.head.querySelector(`[data-component=${a.componentName}]`)){let s=document.createElement("style");s.dataset.component=a.componentName,s.textContent=c,document.head.append(s);}let t=document.createElement("div");t.className=a$1.SINGLE_IMAGE_UPLOADER_CONTAINER,Object.assign(t.style,b.SINGLE_IMAGE_UPLOADER_CONTAINER_STYLE,this._settings.containerStyle),e.append(t);let{iconElement:n,iconStyle:r,informationElement:i,informationStyle:l,buttonElement:d,buttonStyle:h,onlyCameraCapture:p}=this._settings;Object.assign(n.style,b.SINGLE_IMAGE_UPLOADER_ICON_STYLE,r,{maxWidth:"100px",maxHeight:"100px"}),t.append(n),i.hasAttribute(a.DEFAULT_DOM_ATTRIBUTE)&&(Object.assign(i.style,b.SINGLE_IMAGE_UPLOADER_INFORMATION_STYLE,l),i.textContent=a$2.getInstance().get("core.singleImageUploader.title")),t.append(i);let o=document.createElement("input");o.type="file",o.accept="image/*",p&&(o.capture="environment",o.dataset.onlyCaptureOnMobile="environment"),o.addEventListener("change",s=>{this.onFileUpload(s);}),o.addEventListener("click",s=>{var m;(m=this._onInputCheck)==null||m.call(this,s);}),o.addEventListener("keydown",s=>{var m;(m=this._onInputCheck)==null||m.call(this,s);});let v=document.createElement("label");v.append(o),d.hasAttribute(a.DEFAULT_DOM_ATTRIBUTE)&&Object.assign(d.style,b.SINGLE_IMAGE_UPLOADER_BUTTON_STYLE,h),v.append(d),t.append(v);let E=document.createRange().createContextualFragment(atob(a$3)).firstElementChild;Object.assign(E.style,{position:"absolute",bottom:"1em",right:"1em",width:"10em"}),t.append(E),this._htmlRoot=t,this._mounted=true,this._inputElement=o,this._buttonElement=d,this._chooseImageText=(g=d.textContent)!=null?g:"",this._informationElement=i,this._localizationSubscription=a$2.getInstance().subscribe(this._onLocalizationUpdated);}unmount(){var e,t,n;this._mounted&&((e=this._htmlRoot)==null||e.remove(),(t=document.head.querySelector(`[data-component=${a.componentName}]`))==null||t.remove(),(n=this._localizationSubscription)==null||n.cancel(),this._mounted=false);}setButtonState(e){this._inputElement&&(this._inputElement.disabled=e==="disabled");}getButtonState(){return this._inputElement?this._inputElement.disabled?"disabled":"enabled":"disabled"}onInputCheck(e){this._onInputCheck=e;}onBeforeFileRead(e){this._onBeforeFileRead=e;}onImageLoadError(e){this._onImageLoadError=e;}onFileReaderError(e){this._onFileReaderError=e;}onCaptureReady(e){this._onCaptureReady=e;}onAfterImageProcessed(){this.setLoading(false);}onLocalizationUpdated(){var e,t;(e=this._buttonElement)!=null&&e.hasAttribute(a.DEFAULT_DOM_ATTRIBUTE)&&(this._buttonElement.textContent=a$2.getInstance().get("core.singleImageUploader.button")),(t=this._informationElement)!=null&&t.hasAttribute(a.DEFAULT_DOM_ATTRIBUTE)&&(this._informationElement.textContent=a$2.getInstance().get("core.singleImageUploader.title"));}setLoading(e){this._buttonElement&&(this.setButtonState(e?"disabled":"enabled"),this._buttonElement.textContent=e?"...":this._chooseImageText,this._loading=e);}getResizedImageDimensions(e,t){return e<=this._resizedImageSizeLimit&&t<=this._resizedImageSizeLimit?{width:e,height:t}:e>t?{width:this._resizedImageSizeLimit,height:Math.round(t/e*this._resizedImageSizeLimit)}:{width:Math.round(e/t*this._resizedImageSizeLimit),height:this._resizedImageSizeLimit}}onImageLoad(e){var i;let{height:t,width:n}=this.getResizedImageDimensions(e.naturalWidth,e.naturalHeight);this.canvasContext.canvas.width=n,this.canvasContext.canvas.height=t,this.canvasContext.drawImage(e,0,0,n,t);let r={data:this.canvasContext.getImageData(0,0,n,t).data,width:n,height:t};(i=this._onCaptureReady)==null||i.call(this,r);}onFileReaderLoad(e,t,n){e.value="",t.result!=null&&(n.addEventListener("load",()=>{this.onImageLoad(n);},{once:true}),n.addEventListener("error",r=>{var i;(i=this._onImageLoadError)==null||i.call(this,r),this.setLoading(false);},{once:true}),n.src=t.result);}async onFileUpload(e){var d;this.setLoading(true);let t=e.currentTarget,{files:n}=t;if(n==null||n.length===0){this.setLoading(false);return}let r=(d=this._onBeforeFileRead)==null?void 0:d.call(this,e);if(r instanceof Promise&&await r,!this.canUploadFile){t.value="",a$4.warn("Can't upload file, no capture mode enabled."),this.setLoading(false);return}let i=new Image,l=new FileReader;l.addEventListener("load",()=>{this.onFileReaderLoad(t,l,i);}),l.addEventListener("error",h=>{var p;(p=this._onFileReaderError)==null||p.call(this,h),this.setLoading(false);}),l.readAsDataURL(n[0]);}};a.componentName="SingleImageUploaderView",a.DEFAULT_DOM_ATTRIBUTE="data-scandit-default";var I=a;export{I as a};
@@ -1,2 +0,0 @@
1
- import {b as b$2}from'./chunk-MKTACV3Q.js';import {c,d,b as b$1,a as a$1,e}from'./chunk-SBC5K7IT.js';import {a,b}from'./chunk-TR3NGINC.js';var Ae=a((Y,ie)=>{(function(m,u){var I="1.0.40",U="",x="?",E="function",g="undefined",C="object",O="string",y="major",e="model",n="name",i="type",o="vendor",r="version",T="architecture",N="console",l="mobile",w="tablet",S="smarttv",_="wearable",q="embedded",X=500,W="Amazon",L="Apple",oe="ASUS",j="BlackBerry",a="Browser",t="Chrome",b="Edge",h="Firefox",k="Google",F="Huawei",P="LG",ne="Microsoft",be="Motorola",V="Opera",G="Samsung",ce="Sharp",$="Sony",re="Xiaomi",te="Zebra",ue="Facebook",we="Chromium OS",de="Mac OS",pe=" Browser",Te=function(d,p){var c={};for(var v in d)p[v]&&p[v].length%2===0?c[v]=p[v].concat(d[v]):c[v]=d[v];return c},K=function(d){for(var p={},c=0;c<d.length;c++)p[d[c].toUpperCase()]=d[c];return p},fe=function(d,p){return typeof d===O?D(p).indexOf(D(d))!==-1:false},D=function(d){return d.toLowerCase()},_e=function(d){return typeof d===O?d.replace(/[^\d\.]/g,U).split(".")[0]:u},ae=function(d,p){if(typeof d===O)return d=d.replace(/^\s\s*/,U),typeof p===g?d:d.substring(0,X)},H=function(d,p){for(var c=0,v,B,R,f,s,M;c<p.length&&!s;){var se=p[c],ve=p[c+1];for(v=B=0;v<se.length&&!s&&se[v];)if(s=se[v++].exec(d),s)for(R=0;R<ve.length;R++)M=s[++B],f=ve[R],typeof f===C&&f.length>0?f.length===2?typeof f[1]==E?this[f[0]]=f[1].call(this,M):this[f[0]]=f[1]:f.length===3?typeof f[1]===E&&!(f[1].exec&&f[1].test)?this[f[0]]=M?f[1].call(this,M,f[2]):u:this[f[0]]=M?M.replace(f[1],f[2]):u:f.length===4&&(this[f[0]]=M?f[3].call(this,M.replace(f[1],f[2])):u):this[f]=M||u;c+=2;}},Z=function(d,p){for(var c in p)if(typeof p[c]===C&&p[c].length>0){for(var v=0;v<p[c].length;v++)if(fe(p[c][v],d))return c===x?u:c}else if(fe(p[c],d))return c===x?u:c;return p.hasOwnProperty("*")?p["*"]:d},Ue={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},me={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},ge={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[r,[n,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[r,[n,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[n,r],[/opios[\/ ]+([\w\.]+)/i],[r,[n,V+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[r,[n,V+" GX"]],[/\bopr\/([\w\.]+)/i],[r,[n,V]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[r,[n,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[r,[n,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[n,r],[/quark(?:pc)?\/([-\w\.]+)/i],[r,[n,"Quark"]],[/\bddg\/([\w\.]+)/i],[r,[n,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[r,[n,"UC"+a]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[r,[n,"WeChat"]],[/konqueror\/([\w\.]+)/i],[r,[n,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[r,[n,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[r,[n,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[r,[n,"Smart Lenovo "+a]],[/(avast|avg)\/([\w\.]+)/i],[[n,/(.+)/,"$1 Secure "+a],r],[/\bfocus\/([\w\.]+)/i],[r,[n,h+" Focus"]],[/\bopt\/([\w\.]+)/i],[r,[n,V+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[r,[n,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[r,[n,"Dolphin"]],[/coast\/([\w\.]+)/i],[r,[n,V+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[r,[n,"MIUI"+pe]],[/fxios\/([\w\.-]+)/i],[r,[n,h]],[/\bqihoobrowser\/?([\w\.]*)/i],[r,[n,"360"]],[/\b(qq)\/([\w\.]+)/i],[[n,/(.+)/,"$1Browser"],r],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[n,/(.+)/,"$1"+pe],r],[/samsungbrowser\/([\w\.]+)/i],[r,[n,G+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[r,[n,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[n,"Sogou Mobile"],r],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[n,r],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[n],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[r,n],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[n,ue],r],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[n,r],[/\bgsa\/([\w\.]+) .*safari\//i],[r,[n,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[r,[n,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[r,[n,t+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[n,t+" WebView"],r],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[r,[n,"Android "+a]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[n,r],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[r,[n,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[r,n],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[n,[r,Z,Ue]],[/(webkit|khtml)\/([\w\.]+)/i],[n,r],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[n,"Netscape"],r],[/(wolvic|librewolf)\/([\w\.]+)/i],[n,r],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[r,[n,h+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[n,[r,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[n,[r,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[T,"amd64"]],[/(ia32(?=;))/i],[[T,D]],[/((?:i[346]|x)86)[;\)]/i],[[T,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[T,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[T,"armhf"]],[/windows (ce|mobile); ppc;/i],[[T,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[T,/ower/,U,D]],[/(sun4\w)[;\)]/i],[[T,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[T,D]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[e,[o,G],[i,w]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[e,[o,G],[i,l]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[e,[o,L],[i,l]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[e,[o,L],[i,w]],[/(macintosh);/i],[e,[o,L]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[e,[o,ce],[i,l]],[/(?:honor)([-\w ]+)[;\)]/i],[e,[o,"Honor"],[i,l]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[e,[o,F],[i,w]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[e,[o,F],[i,l]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[e,/_/g," "],[o,re],[i,l]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[e,/_/g," "],[o,re],[i,w]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[e,[o,"OPPO"],[i,l]],[/\b(opd2\d{3}a?) bui/i],[e,[o,"OPPO"],[i,w]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[e,[o,"Vivo"],[i,l]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[e,[o,"Realme"],[i,l]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[e,[o,be],[i,l]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[e,[o,be],[i,w]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[e,[o,P],[i,w]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[e,[o,P],[i,l]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[e,[o,"Lenovo"],[i,w]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[e,/_/g," "],[o,"Nokia"],[i,l]],[/(pixel c)\b/i],[e,[o,k],[i,w]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[e,[o,k],[i,l]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[e,[o,$],[i,l]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[e,"Xperia Tablet"],[o,$],[i,w]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[e,[o,"OnePlus"],[i,l]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[e,[o,W],[i,w]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[e,/(.+)/g,"Fire Phone $1"],[o,W],[i,l]],[/(playbook);[-\w\),; ]+(rim)/i],[e,o,[i,w]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[e,[o,j],[i,l]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[e,[o,oe],[i,w]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[e,[o,oe],[i,l]],[/(nexus 9)/i],[e,[o,"HTC"],[i,w]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[o,[e,/_/g," "],[i,l]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[e,[o,"TCL"],[i,w]],[/(itel) ((\w+))/i],[[o,D],e,[i,Z,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[e,[o,"Acer"],[i,w]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[e,[o,"Meizu"],[i,l]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[e,[o,"Ulefone"],[i,l]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[e,[o,"Energizer"],[i,l]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[e,[o,"Cat"],[i,l]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[e,[o,"Smartfren"],[i,l]],[/droid.+; (a(?:015|06[35]|142p?))/i],[e,[o,"Nothing"],[i,l]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (imo) ((?!tab)[\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[o,e,[i,l]],[/(imo) (tab \w+)/i,/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[o,e,[i,w]],[/(surface duo)/i],[e,[o,ne],[i,w]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[e,[o,"Fairphone"],[i,l]],[/(u304aa)/i],[e,[o,"AT&T"],[i,l]],[/\bsie-(\w*)/i],[e,[o,"Siemens"],[i,l]],[/\b(rct\w+) b/i],[e,[o,"RCA"],[i,w]],[/\b(venue[\d ]{2,7}) b/i],[e,[o,"Dell"],[i,w]],[/\b(q(?:mv|ta)\w+) b/i],[e,[o,"Verizon"],[i,w]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[e,[o,"Barnes & Noble"],[i,w]],[/\b(tm\d{3}\w+) b/i],[e,[o,"NuVision"],[i,w]],[/\b(k88) b/i],[e,[o,"ZTE"],[i,w]],[/\b(nx\d{3}j) b/i],[e,[o,"ZTE"],[i,l]],[/\b(gen\d{3}) b.+49h/i],[e,[o,"Swiss"],[i,l]],[/\b(zur\d{3}) b/i],[e,[o,"Swiss"],[i,w]],[/\b((zeki)?tb.*\b) b/i],[e,[o,"Zeki"],[i,w]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[o,"Dragon Touch"],e,[i,w]],[/\b(ns-?\w{0,9}) b/i],[e,[o,"Insignia"],[i,w]],[/\b((nxa|next)-?\w{0,9}) b/i],[e,[o,"NextBook"],[i,w]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[o,"Voice"],e,[i,l]],[/\b(lvtel\-)?(v1[12]) b/i],[[o,"LvTel"],e,[i,l]],[/\b(ph-1) /i],[e,[o,"Essential"],[i,l]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[e,[o,"Envizen"],[i,w]],[/\b(trio[-\w\. ]+) b/i],[e,[o,"MachSpeed"],[i,w]],[/\btu_(1491) b/i],[e,[o,"Rotor"],[i,w]],[/(shield[\w ]+) b/i],[e,[o,"Nvidia"],[i,w]],[/(sprint) (\w+)/i],[o,e,[i,l]],[/(kin\.[onetw]{3})/i],[[e,/\./g," "],[o,ne],[i,l]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[e,[o,te],[i,w]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[e,[o,te],[i,l]],[/smart-tv.+(samsung)/i],[o,[i,S]],[/hbbtv.+maple;(\d+)/i],[[e,/^/,"SmartTV"],[o,G],[i,S]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[o,P],[i,S]],[/(apple) ?tv/i],[o,[e,L+" TV"],[i,S]],[/crkey/i],[[e,t+"cast"],[o,k],[i,S]],[/droid.+aft(\w+)( bui|\))/i],[e,[o,W],[i,S]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[e,[o,ce],[i,S]],[/(bravia[\w ]+)( bui|\))/i],[e,[o,$],[i,S]],[/(mitv-\w{5}) bui/i],[e,[o,re],[i,S]],[/Hbbtv.*(technisat) (.*);/i],[o,e,[i,S]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[o,ae],[e,ae],[i,S]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[i,S]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[o,e,[i,N]],[/droid.+; (shield) bui/i],[e,[o,"Nvidia"],[i,N]],[/(playstation [345portablevi]+)/i],[e,[o,$],[i,N]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[e,[o,ne],[i,N]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[e,[o,G],[i,_]],[/((pebble))app/i],[o,e,[i,_]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[e,[o,L],[i,_]],[/droid.+; (glass) \d/i],[e,[o,k],[i,_]],[/droid.+; (wt63?0{2,3})\)/i],[e,[o,te],[i,_]],[/droid.+; (glass) \d/i],[e,[o,k],[i,_]],[/(pico) (4|neo3(?: link|pro)?)/i],[o,e,[i,_]],[/; (quest( \d| pro)?)/i],[e,[o,ue],[i,_]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[o,[i,q]],[/(aeobc)\b/i],[e,[o,W],[i,q]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[e,[i,l]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[e,[i,w]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[i,w]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[i,l]],[/(android[-\w\. ]{0,9});.+buil/i],[e,[o,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[r,[n,b+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[n,r],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[r,[n,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[n,r],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[r,n]],os:[[/microsoft (windows) (vista|xp)/i],[n,r],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[n,[r,Z,me]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[r,Z,me],[n,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[r,/_/g,"."],[n,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[n,de],[r,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[r,n],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[n,r],[/\(bb(10);/i],[r,[n,j]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[r,[n,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[r,[n,h+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[r,[n,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[r,[n,"watchOS"]],[/crkey\/([\d\.]+)/i],[r,[n,t+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[n,we],r],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[n,r],[/(sunos) ?([\w\.\d]*)/i],[[n,"Solaris"],r],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[n,r]]},A=function(d,p){if(typeof d===C&&(p=d,d=u),!(this instanceof A))return new A(d,p).getResult();var c=typeof m!==g&&m.navigator?m.navigator:u,v=d||(c&&c.userAgent?c.userAgent:U),B=c&&c.userAgentData?c.userAgentData:u,R=p?Te(ge,p):ge,f=c&&c.userAgent==v;return this.getBrowser=function(){var s={};return s[n]=u,s[r]=u,H.call(s,v,R.browser),s[y]=_e(s[r]),f&&c&&c.brave&&typeof c.brave.isBrave==E&&(s[n]="Brave"),s},this.getCPU=function(){var s={};return s[T]=u,H.call(s,v,R.cpu),s},this.getDevice=function(){var s={};return s[o]=u,s[e]=u,s[i]=u,H.call(s,v,R.device),f&&!s[i]&&B&&B.mobile&&(s[i]=l),f&&s[e]=="Macintosh"&&c&&typeof c.standalone!==g&&c.maxTouchPoints&&c.maxTouchPoints>2&&(s[e]="iPad",s[i]=w),s},this.getEngine=function(){var s={};return s[n]=u,s[r]=u,H.call(s,v,R.engine),s},this.getOS=function(){var s={};return s[n]=u,s[r]=u,H.call(s,v,R.os),f&&!s[n]&&B&&B.platform&&B.platform!="Unknown"&&(s[n]=B.platform.replace(/chrome os/i,we).replace(/macos/i,de)),s},this.getResult=function(){return {ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return v},this.setUA=function(s){return v=typeof s===O&&s.length>X?ae(s,X):s,this},this.setUA(v),this};A.VERSION=I,A.BROWSER=K([n,r,y]),A.CPU=K([T]),A.DEVICE=K([e,o,i,N,l,S,w,_,q]),A.ENGINE=A.OS=K([n,r]),typeof Y!==g?(typeof ie!==g&&ie.exports&&(Y=ie.exports=A),Y.UAParser=A):typeof define===E&&define.amd?define(function(){return A}):typeof m!==g&&(m.UAParser=A);var z=typeof m!==g&&(m.jQuery||m.Zepto);if(z&&!z.ua){var J=new A;z.ua=J.getResult(),z.ua.get=function(){return J.getUA()},z.ua.set=function(d){J.setUA(d);var p=J.getResult();for(var c in p)z.ua[c]=p[c];};}})(typeof window=="object"?window:Y);});function ee(m){for(var u=1;u<arguments.length;u++){var I=arguments[u];for(var U in I)m[U]=I[U];}return m}var Ie={read:function(m){return m[0]==='"'&&(m=m.slice(1,-1)),m.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(m){return encodeURIComponent(m).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function le(m,u){function I(x,E,g){if(!(typeof document>"u")){g=ee({},u,g),typeof g.expires=="number"&&(g.expires=new Date(Date.now()+g.expires*864e5)),g.expires&&(g.expires=g.expires.toUTCString()),x=encodeURIComponent(x).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var C="";for(var O in g)g[O]&&(C+="; "+O,g[O]!==true&&(C+="="+g[O].split(";")[0]));return document.cookie=x+"="+m.write(E,x)+C}}function U(x){if(!(typeof document>"u"||arguments.length&&!x)){for(var E=document.cookie?document.cookie.split("; "):[],g={},C=0;C<E.length;C++){var O=E[C].split("="),y=O.slice(1).join("=");try{var e=decodeURIComponent(O[0]);if(g[e]=m.read(y,e),x===e)break}catch{}}return x?g[x]:g}}return Object.create({set:I,get:U,remove:function(x,E){I(x,"",ee({},E,{expires:-1}));},withAttributes:function(x){return le(this.converter,ee({},this.attributes,x))},withConverter:function(x){return le(ee({},this.converter,x),this.attributes)}},{attributes:{value:Object.freeze(u)},converter:{value:Object.freeze(m)}})}var Oe=le(Ie,{path:"/"});var Ce=b(Ae(),1);var Be=(x=>(x.Standalone="standalone",x.Fullscreen="fullscreen",x.MinimalUI="minimal-ui",x.Browser="browser",x))(Be||{}),Ee;(j=>{let m;function u(){return m==null&&(m=new Ce.default(navigator.userAgent)),m}j.getUserAgentInfo=u;function I(){var b;if("orientation"in window)return false;let a="(any-pointer: coarse)",t=(b=window.matchMedia)==null?void 0:b.call(window,a);return navigator.maxTouchPoints===0||(t==null?void 0:t.media)===a&&!(t!=null&&t.matches)}j.isDesktopDevice=I;function U(){return u().getDevice().model==="iPhone"}j.isIPhone=U;function x(){let a=u().getOS();return a.name==="iOS"&&a.version!=null&&a.version.localeCompare("16.3",void 0,{numeric:true})>=0}j.isIOSDeviceWithExtendedCameraAccess=x;function E(){return "document"in window?window.document.createElement("canvas"):null}j.getCanvas=E;function g(a){return a.name==="iOS"&&a.version!=null&&["11.2.2","11.2.5","11.2.6"].includes(a.version)}async function C(){return c()}j.hasSIMDSupport=C;async function O(){return d()}j.hasThreadsSupport=O;function y(a,t,b){let h=a[t[0]];return h==null?false:t.length===1?typeof h===b:(typeof h=="function"||typeof h=="object")&&y(h,t.slice(1),b)}function e$1(){var F;let a=true,t=null,b=null,h=null,k=null;try{if(t=j.getCanvas(),b=j.getCanvas(),h=t==null?void 0:t.getContext("webgl"),k=b==null?void 0:b.getContext("experimental-webgl"),!y(window,["WebGLRenderingContext"],"function")||h==null&&k==null)throw new Error("WebGLRenderingContext is not supported")}catch{a=false;}finally{for(let P of [h,k])typeof(P==null?void 0:P.getExtension)=="function"&&((F=P.getExtension("WEBGL_lose_context"))==null||F.loseContext());h=null,k=null,t=null,b=null;}return a}function n(){let a=true,t=true,b=new Set;location.protocol.startsWith("http")||b.add("httpProtocol"),y(window,["isSecureContext"],"boolean")&&!window.isSecureContext&&b.add("secureContext"),!y(navigator,["mediaDevices","getUserMedia"],"function")&&!y(navigator,["enumerateDevices"],"function")&&!y(window,["MediaStreamTrack","getSources"],"function")&&(b.add("mediaDevices"),a=false),y(window,["Worker"],"function")||(b.add("webWorkers"),a=false,t=false),y(window,["WebAssembly"],"object")||(b.add("webAssembly"),a=false,t=false),y(window,["Blob"],"function")||(b.add("blob"),a=false,t=false),y(window,["URL","createObjectURL"],"function")||(b.add("urlObject"),a=false,t=false),y(window,["OffscreenCanvas"],"function")||b.add("offscreenCanvas"),e$1()||b.add("webGL");let h=u().getOS();return g(h)&&(b.add("webAssemblyErrorFree"),a=false,t=false),b$1()||b.add("sharedArrayBuffer"),a$1()||b.add("crossOriginIsolated"),L()||b.add("animationApi"),{fullSupport:a,scannerSupport:t,missingFeatures:[...b]}}j.checkBrowserCompatibility=n;async function i(){return e()}j.checkMultithreadingSupport=i;function o(){let a="scandit-device-id",t=b$2.getItem(a);if(t!=null&&t!=="")return t;if(t=Oe.get(a),t!=null&&t!=="")return b$2.setItem(a,t),t;let b=new Uint8Array(20);return crypto.getRandomValues(b),t=[...b].map(h=>{let k=h.toString(16);return k.length===1?`0${k}`:k}).join(""),b$2.setItem(a,t),t}j.getDeviceId=o;function r(a){return a instanceof HTMLElement||a!=null&&typeof a=="object"&&typeof a.tagName=="string"}j.isValidHTMLElement=r;function T(){var h,k;let a=u().getOS();if(a.name!=="iOS")return true;let[t,b]=(k=(h=a.version)==null?void 0:h.split(".").map(Number))!=null?k:[];return t>14||t===14&&b>=6}j.isSupportedIOSVersion=T;function N(){var a,t;return (t=(a=u().getBrowser().name)==null?void 0:a.toLowerCase().includes("safari"))!=null?t:false}j.isSafari=N;function l(){var t,b;return /iphone|ipod|ipad/.test((b=(t=u().getDevice().model)==null?void 0:t.toLowerCase())!=null?b:"")&&!N()}j.isIosWebView=l;async function w(){var t;return ((t=u().getOS().name)==null?void 0:t.toLowerCase())!=="android"?false:u().getUA().includes("wv")?true:[...(await fetch(document.location.toString(),{method:"HEAD"})).headers].some(([b])=>b.toLowerCase()==="x-requested-with")}j.isAndroidWebView=w;function S(){return u().getOS().name==="Windows"}j.isWindows=S;function _(){return u().getBrowser().name==="Firefox"}j.isFirefox=_;function q(){if("navigator"in globalThis){for(let a of ["vibrate","webkitVibrate","msVibrate","mozVibrate"])if(typeof navigator[a]=="function")return navigator[a]}}j.getSupportedVibrationMethod=q;function X(){return q()!=null&&!I()&&!S()&&!_()}j.isVibrationAvailable=X;function W(){return u().getOS().name==="iOS"}j.isIOS=W;function L(){return typeof globalThis.Animation<"u"&&typeof globalThis.KeyframeEffect<"u"&&typeof globalThis.Element.prototype.animate<"u"}j.isAnimationApiSupported=L;function oe(a){var h;let t=`(display-mode: ${a})`,b=(h=globalThis.matchMedia)==null?void 0:h.call(globalThis,t);return (b==null?void 0:b.matches)===true?true:a==="standalone"&&typeof navigator=="object"&&"standalone"in navigator&&typeof navigator.standalone=="boolean"?navigator.standalone===true:false}j.isPwaDisplayMode=oe;})(Ee||(Ee={}));
2
- export{Be as a,Ee as b};
@@ -1 +0,0 @@
1
- import {a as a$1}from'./chunk-XR65N6EG.js';import {a}from'./chunk-QCZSSQAQ.js';var s=class i{constructor(){this.type="imageFrameSource";this._listeners=new Set;this._currentState="off";this._desiredState="off";this._context=null;this._imageData=null;}get desiredState(){return this._desiredState}get context(){return this._context}set context(e){this._context=e;}get currentState(){return this._currentState}static async fromFile(e){let t=URL.createObjectURL(e),r=new Image;r.src=t;try{await r.decode();}catch{throw new a({name:"InvalidImageError",message:"Submitted file is not an image"})}finally{URL.revokeObjectURL(t);}return i.fromImage(r)}static async fromImage(e){let t=new i;try{await e.decode();}catch{throw new a({name:"InvalidImageError",message:"Submitted image cannot be decoded"})}let r=t.getCanvasAndContext(e.width,e.height);return r.drawImage(e,0,0),t._imageData=r.getImageData(0,0,e.width,e.height,{colorSpace:"srgb"}),t}static async fromImageData(e){let t=new i,r=t.getCanvasAndContext(e.width,e.height);try{r.putImageData(e,0,0);}catch(n){throw new a({name:"InvalidImageError",message:`Submitted image data does not seem valid (details: ${n})`})}return t._imageData=e,t}async switchToDesiredState(e){if(e==="on"){if(this.currentState==="on")return}else if(this.currentState==="off")return;if(this._desiredState=e,e==="off"){await this.setCurrentState("off");return}return this._imageData==null?(a$1.log(a$1.Level.Warn,"No image data to process."),this.processSubmittedImage({data:new Uint8ClampedArray(0),width:0,height:0,colorSpace:"srgb"})):this.processSubmittedImage(this._imageData)}addListener(e){e!=null&&this._listeners.add(e);}removeListener(e){e!=null&&this._listeners.delete(e);}toJSONObject(){return {type:this.type}}getCurrentState(){return this._currentState}getCanvasAndContext(e,t){let r=document.createElement("canvas");r.width=e,r.height=t;let n=r.getContext("2d");if(n==null)throw new a({name:"ImageFrameSourceError",message:"Could not generate a canvas context to get image data"});return n}async setCurrentState(e){if(e!==this._currentState)return this._currentState=e,this.notifyListeners(),this.notifyContext({type:"frameSourceState",newValue:e})}async notifyContext(e){if(this._context)return this._context.update([e])}notifyListeners(){for(let e of this._listeners)e.didChangeState&&e.didChangeState(this,this.currentState);}async processSubmittedImage(e){var t;await this.setCurrentState("on"),await((t=this._context)==null?void 0:t.sendFrameToProcessor(e)),await this.setCurrentState("off");}};export{s as a};
@@ -1 +0,0 @@
1
- import {a as a$3}from'./chunk-4GKVQAVF.js';import {a as a$2}from'./chunk-F2IJCZAS.js';import {e}from'./chunk-SOCEWYYO.js';import {a as a$7,b}from'./chunk-EQ6V4W5K.js';import {a as a$6}from'./chunk-3A4KLILV.js';import {a as a$4}from'./chunk-UWBNF47P.js';import {a as a$1}from'./chunk-EV4OEANA.js';import {a as a$5}from'./chunk-LSZZVJ6B.js';var E=(e=>(e.DidShow="didshow",e.DidHide="didhide",e.WillShow="willshow",e))(E||{}),o="--text-size",s="--text-color",n="--text-alignment",r="--text-weight",a="--line-height",l="--background-color",c="--corner-radius",h="--max-lines",w="ease-in-out",i=class i extends a$1{constructor(){super();this.toast=null;this._hintStyle=null;this._customIcon=null;this.currentAnimation=null;this.animationDuration=250;this._currentAnimationDirection=null;let t=this.attachShadow({mode:"open"});this._exclamationIcon=a$2.create(),this._checkIcon=a$3.create(),this._exclamationIcon.size=24,this._checkIcon.size=24,t.innerHTML=a$4`<div class="toast"><slot name="first-child"></slot><div class="left"><slot name="icon"></slot></div><p class="middle"><slot></slot></p></div>`,t.append(i.createStyleElement().cloneNode(true)),this.toast=t.querySelector(".toast");}static createStyleElement(){return a$5`:host{display:inline-block;font-family:SF Pro Display,sans-serif}:host([hidden]){display:none}.toast{${o}:1rem;${s}:#000;${r}:400;${n}:${"center"};${a}:1.5rem;${l}:#fff;${c}:.25rem;${h}:2;align-items:flex-start;background-color:var(${l});border-radius:var(${c});color:var(${s});display:flex;flex-direction:row;font-size:var(${o});font-weight:var(${r});gap:.625rem;justify-content:var(${n});line-height:var(${a});padding:.75rem 1rem}:host([direction=column]) .toast{align-items:center;flex-direction:column}:host([direction=row]) .toast{align-items:center;flex-direction:row}.toast .left{align-self:flex-start;display:flex}.toast.icon-${"none"} .left{display:none}.toast p.middle{display:inline-block;display:-webkit-box;margin:0;padding:0;text-align:var(${n});-webkit-line-clamp:var(${h});-webkit-box-orient:vertical;align-self:center;overflow:hidden;text-shadow:0 1px 2px #${e.withAlpha(.3).toJSON()}}p.middle{text-align:var(${n})}`}get hintStyle(){return this._hintStyle}set hintStyle(t){this._hintStyle=t,this.render();}get customIcon(){return this._customIcon}set customIcon(t){this._customIcon=t,this.render();}get showAnimation(){return new Animation(new KeyframeEffect(this,[{opacity:0},{opacity:1}],{duration:this.animationDuration,fill:"both",easing:w}))}get hideAnimation(){return new Animation(new KeyframeEffect(this,[{opacity:1},{opacity:0}],{duration:this.animationDuration,fill:"both",easing:w}))}static create(){return i.register(),document.createElement(i.tag)}static register(){a$6({[i.tag]:i});}async show(){return this.toggle(true)}async hide(){return this.toggle(false)}connectedCallback(){this.render();}async toggle(t){var m,d;let e=t?"showing":"hiding";this.currentAnimation&&this._currentAnimationDirection===e&&this.currentAnimation.playState==="running"||(this.currentAnimation&&a$7(this.currentAnimation),this.animationDuration=(d=(m=this.hintStyle)==null?void 0:m.isAnimatedToView)==null||d?250:0,this._currentAnimationDirection=e,this.currentAnimation=t?this.showAnimation:this.hideAnimation,t&&this.dispatchEvent(new CustomEvent("willshow",{bubbles:true})),this.currentAnimation.play(),await b(this.currentAnimation),this.dispatchEvent(new CustomEvent(t?"didshow":"didhide",{bubbles:true,detail:{target:this}})),this.currentAnimation=null,this._currentAnimationDirection=null);}render(){var t;if(!(!this.toast||!this.hintStyle)){this.toast.className="toast",this.toast.style.setProperty(o,`${this.hintStyle.textSize}px`),this.toast.style.setProperty(s,`#${this.hintStyle.textColor}`),this.toast.style.setProperty(r,this.hintStyle.textWeight.toString()),this.toast.style.setProperty(n,this.hintStyle.textAlignment),this.toast.style.setProperty(a,`${this.hintStyle.lineHeight/14}`),this.toast.style.setProperty(l,`#${this.hintStyle.backgroundColor}`),this.toast.style.setProperty(c,`${this.hintStyle.cornerRadius/10}rem`),this.toast.style.setProperty(h,this.hintStyle.maxLines.toString());for(let e of this.querySelectorAll("[slot=icon]"))e.remove();this._customIcon?(this._customIcon.setAttribute("slot","icon"),this.append(this._customIcon),this.toast.classList.remove("icon-none")):(this.toast.classList.toggle("icon-none",this.hintStyle.hintIcon==="none"),this.hintStyle.hintIcon==="check"?(this._checkIcon.setAttribute("slot","icon"),this.append(this._checkIcon)):this.hintStyle.hintIcon==="exclamationMark"&&(this._exclamationIcon.setAttribute("slot","icon"),this.append(this._exclamationIcon)),this.hintStyle.iconColor&&((t=this.querySelector("[slot=icon]"))==null||t.setAttribute("fill",`#${this.hintStyle.iconColor}`)));}}};i.tag="scandit-toast-hint";var A=i;export{E as a,A as b};
File without changes
@@ -1 +0,0 @@
1
- import {a as a$2}from'./chunk-SEAVQZN6.js';import {a}from'./chunk-JKKB2J3F.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};
@@ -1 +0,0 @@
1
- var t=class t{constructor(){this.hasApi=false;this.hasTouch=false;this.requiresPrefix=false;}detect(){var e;try{"PointerEvent"in window?this.hasApi=true:"msPointerEnabled"in navigator&&(this.hasApi=true,this.requiresPrefix=true);let o=(e=navigator.msMaxTouchPoints)!=null?e:navigator.maxTouchPoints;this.hasTouch=o>0;}catch{}}prefixIfNeeded(e){return this.requiresPrefix?t.prefixEventMap[e]:e}};t.prefixEventMap={pointerdown:"MSPointerDown",pointerup:"MSPointerUp",pointercancel:"MSPointerCancel",pointermove:"MSPointerMove",pointerover:"MSPointerOver",pointerout:"MSPointerOut",pointerenter:"MSPointerEnter",pointerleave:"MSPointerLeave",gotpointercapture:"MSGotPointerCapture",lostpointercapture:"MSLostPointerCapture"};var n=t,i=new n;export{i as a};
@@ -1 +0,0 @@
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-EC74ZSTB.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 as a$6}from'./chunk-IJQG3OU6.js';import {a}from'./chunk-2OCDIZIS.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-HMOFGW5O.js';import {a as a$5}from'./chunk-KAFNKP6O.js';import {a as a$n}from'./chunk-E4XJ4GKD.js';import {a as a$k}from'./chunk-QOCHMKNY.js';import {a as a$i}from'./chunk-XR65N6EG.js';import {a as a$m}from'./chunk-WUHKODFA.js';var 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};
@@ -1 +0,0 @@
1
- import {a as a$2}from'./chunk-3A4KLILV.js';import {a as a$3}from'./chunk-UWBNF47P.js';import {a}from'./chunk-EV4OEANA.js';import {a as a$1}from'./chunk-LSZZVJ6B.js';var l="scandit-arrows-up",t=class t extends a{constructor(){super();let a=this.attachShadow({mode:"open"});a.innerHTML=this.render(),a.prepend(t.createStyleElement().cloneNode(true));}static createStyleElement(){return a$1`${t.tag}{display:flex}${t.tag}[hidden]{display:none}.arrow{animation:blink 1.5s infinite;animation-duration:2s}.arrow-1{animation-delay:0s}.arrow-2{animation-delay:.5s}.arrow-3{animation-delay:1s}@keyframes blink{0%,to{opacity:0}50%{opacity:1}}`}static create(){return document.createElement(t.tag)}static register(){a$2({[t.tag]:t});}render(){return a$3`<svg width="120" height="45" viewBox="0 0 120 45" fill="none"><path class="arrow arrow-1" opacity="0.8" d="M105.561 45C108.718 45 109.586 40.6607 106.672 39.4467L61.1539 20.4808C60.4154 20.1731 59.5846 20.1731 58.8462 20.4808L13.328 39.4467C10.4143 40.6607 11.2822 45 14.4387 45C14.8094 45 15.1767 44.9286 15.5205 44.7897L58.8762 27.2723C59.5971 26.981 60.4029 26.981 61.1239 27.2723L104.48 44.7897C104.823 44.9286 105.191 45 105.561 45Z" fill="white"></path><path class="arrow arrow-2" opacity="0.6" d="M94.6148 26C96.8169 26 97.4022 22.9609 95.3576 22.143L60.7428 8.29711C60.266 8.10638 59.734 8.10638 59.2572 8.29711L24.6424 22.143C22.5978 22.9609 23.1831 26 25.3852 26H25.6254C25.873 26 26.1184 25.954 26.3492 25.8644L59.2762 13.081C59.7418 12.9002 60.2582 12.9002 60.7238 13.081L93.6508 25.8644C93.8816 25.954 94.127 26 94.3746 26H94.6148Z" fill="white"></path><path class="arrow arrow-3" opacity="0.4" d="M81.2078 10C82.8264 10 83.1945 7.7315 81.659 7.21967L60.6325 0.210819C60.2219 0.073974 59.7781 0.0739735 59.3675 0.210818L38.341 7.21967C36.8055 7.73149 37.1736 10 38.7922 10C38.93 10 39.0671 9.98003 39.1992 9.94072L59.4295 3.91979C59.8018 3.809 60.1982 3.809 60.5705 3.91979L80.8008 9.94072C80.9329 9.98003 81.07 10 81.2078 10Z" fill="white"></path></svg>`}};t.tag=l;var e=t;e.register();export{e as a};