@scandit/web-datacapture-core 8.2.1 → 8.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (236) hide show
  1. package/build/js/{Camera-DhGjpcjv.d.ts → Camera-Cc__1Nc-.d.ts} +3 -1
  2. package/build/js/Camera.d.ts +1 -1
  3. package/build/js/Camera.js +1 -1
  4. package/build/js/CameraRelated.d.ts +1 -1
  5. package/build/js/{DataCaptureContext-Dvdr7st4.d.ts → DataCaptureContext-BcSpF9Dt.d.ts} +43 -4
  6. package/build/js/DataCaptureContext.d.ts +4 -2
  7. package/build/js/DataCaptureContext.js +1 -1
  8. package/build/js/DataCaptureContextRelated.d.ts +5 -3
  9. package/build/js/DataCaptureVersion.js +1 -1
  10. package/build/js/DataCaptureView.d.ts +5 -3
  11. package/build/js/DataCaptureView.js +1 -1
  12. package/build/js/Feedback.js +1 -1
  13. package/build/js/FrameData.d.ts +4 -2
  14. package/build/js/ImageFrameSource.d.ts +1 -1
  15. package/build/js/ImageFrameSource.js +1 -1
  16. package/build/js/NotificationPresenter/index.d.ts +4 -2
  17. package/build/js/NotificationPresenter/private/ConcreteNotificationPresenter.d.ts +4 -2
  18. package/build/js/NotificationPresenter/private/presets.d.ts +4 -2
  19. package/build/js/ScanditIcon.js +1 -1
  20. package/build/js/ScanditIconBuilder.js +1 -1
  21. package/build/js/SingleImageUploader.d.ts +1 -1
  22. package/build/js/Sound.d.ts +4 -0
  23. package/build/js/Sound.js +1 -1
  24. package/build/js/Vibration.js +1 -1
  25. package/build/js/browserHelper.d.ts +10 -0
  26. package/build/js/browserHelper.js +1 -1
  27. package/build/js/chunks/chunk-22UMTZI6.js +1 -0
  28. package/build/js/chunks/{chunk-6JHZVRXK.js → chunk-2MK5Y4IL.js} +1 -1
  29. package/build/js/chunks/{chunk-UQVVJP5Z.js → chunk-2OCDIZIS.js} +1 -1
  30. package/build/js/chunks/{chunk-QFSNPY5Y.js → chunk-2SGKGZ6F.js} +1 -1
  31. package/build/js/chunks/{chunk-O7EM4VIM.js → chunk-33ZWDLU7.js} +1 -1
  32. package/build/js/chunks/chunk-6AQGNP4S.js +1 -0
  33. package/build/js/chunks/chunk-6IHWEHG3.js +1 -0
  34. package/build/js/chunks/{chunk-3MKSI2DV.js → chunk-6IM6NGGI.js} +1 -1
  35. package/build/js/chunks/{chunk-7HYFN4JO.js → chunk-A3ZT7PJA.js} +1 -1
  36. package/build/js/chunks/chunk-A5G2NHT2.js +1 -0
  37. package/build/js/chunks/chunk-AAPD5YU3.js +1 -0
  38. package/build/js/chunks/chunk-AKGGJKCA.js +35 -0
  39. package/build/js/chunks/{chunk-DGIQ3GF7.js → chunk-ARODHCN7.js} +1 -1
  40. package/build/js/chunks/{chunk-QUWP3ILW.js → chunk-BSX3V75N.js} +1 -1
  41. package/build/js/chunks/chunk-DZE2EYSZ.js +1 -0
  42. package/build/js/chunks/chunk-EEWGHHL4.js +1 -0
  43. package/build/js/chunks/{chunk-GLSB4QTY.js → chunk-EIOVYBFS.js} +1 -1
  44. package/build/js/chunks/chunk-EYBP3672.js +1 -0
  45. package/build/js/chunks/chunk-F3Y2X52X.js +1 -0
  46. package/build/js/chunks/{chunk-VSROWPI6.js → chunk-FCXZZH3O.js} +1 -1
  47. package/build/js/chunks/{chunk-O4HDBWKK.js → chunk-FMOB7R2T.js} +1 -1
  48. package/build/js/chunks/{chunk-U7ETOWGJ.js → chunk-GS7VZDY5.js} +1 -1
  49. package/build/js/chunks/chunk-HHA4HDG5.js +6 -0
  50. package/build/js/chunks/{chunk-QUBJJDLC.js → chunk-HILZP6OW.js} +1 -1
  51. package/build/js/chunks/{chunk-NXAYIU7F.js → chunk-IASACVTH.js} +1 -1
  52. package/build/js/chunks/{chunk-DTREAYZQ.js → chunk-KVRNF3VA.js} +1 -1
  53. package/build/js/chunks/{chunk-UERKPMRV.js → chunk-L66S4DN2.js} +1 -1
  54. package/build/js/chunks/chunk-LV6LGCDC.js +1 -0
  55. package/build/js/chunks/{chunk-YE2GYNRP.js → chunk-NMXQDQYI.js} +1 -1
  56. package/build/js/chunks/chunk-NYYGU4ZV.js +1 -0
  57. package/build/js/chunks/{chunk-BBOKPRKO.js → chunk-O5D4KVS5.js} +1 -1
  58. package/build/js/chunks/{chunk-I4F6XB6S.js → chunk-PDJEYYPX.js} +1 -1
  59. package/build/js/chunks/chunk-QHBYNYWX.js +1 -0
  60. package/build/js/chunks/chunk-QHNV2CFJ.js +1 -0
  61. package/build/js/chunks/{chunk-WVVNJRUA.js → chunk-QMLTR5JH.js} +1 -1
  62. package/build/js/chunks/chunk-QWKATH4N.js +1 -0
  63. package/build/js/chunks/{chunk-XYZYNUX3.js → chunk-RXDVYEE5.js} +1 -1
  64. package/build/js/chunks/chunk-RY2EW3RR.js +1 -0
  65. package/build/js/chunks/chunk-S2GRD6GO.js +1 -0
  66. package/build/js/chunks/chunk-SJIN27Q5.js +1 -0
  67. package/build/js/chunks/{chunk-RP4YFAF2.js → chunk-SSTFVERQ.js} +1 -1
  68. package/build/js/chunks/{chunk-7OFC24NE.js → chunk-SX5ZLP2O.js} +1 -1
  69. package/build/js/chunks/{chunk-V2OKMBZD.js → chunk-UJYGOVXB.js} +1 -1
  70. package/build/js/chunks/{chunk-HQKKXJJY.js → chunk-VWEJFI2M.js} +1 -1
  71. package/build/js/chunks/chunk-W3X3ZRQZ.js +1 -0
  72. package/build/js/chunks/{chunk-JCP7NQPV.js → chunk-WFKB322J.js} +1 -1
  73. package/build/js/chunks/{chunk-VJ7ZYB4V.js → chunk-WJOT37ST.js} +1 -1
  74. package/build/js/chunks/{chunk-NY2HBST4.js → chunk-X653DLOR.js} +1 -1
  75. package/build/js/chunks/chunk-Y3TODCJD.js +1 -0
  76. package/build/js/chunks/{chunk-QPR2YHD4.js → chunk-YJNJGCAN.js} +1 -1
  77. package/build/js/chunks/chunk-YONR3EGV.js +2 -0
  78. package/build/js/chunks/{chunk-6EEMWSEO.js → chunk-YP53ND2Q.js} +1 -1
  79. package/build/js/chunks/{chunk-NT5WI2PS.js → chunk-YUZDO2PC.js} +1 -1
  80. package/build/js/chunks/chunk-ZAXZRQYF.js +1 -0
  81. package/build/js/chunks/{chunk-5OF76LWH.js → chunk-ZCEA7BEH.js} +1 -1
  82. package/build/js/controls/CameraFOVSwitchControl.d.ts +4 -2
  83. package/build/js/controls/CameraFOVSwitchControl.js +1 -1
  84. package/build/js/controls/CameraSwitchControl.d.ts +4 -2
  85. package/build/js/controls/CameraSwitchControl.js +1 -1
  86. package/build/js/controls/TorchSwitchControl.d.ts +4 -2
  87. package/build/js/controls/TorchSwitchControl.js +1 -1
  88. package/build/js/controls/common.d.ts +4 -2
  89. package/build/js/controls/index.d.ts +4 -2
  90. package/build/js/controls/index.js +1 -1
  91. package/build/js/defaults/DefaultsCamera.d.ts +4 -2
  92. package/build/js/defaults/DefaultsCameraSettings.d.ts +1 -1
  93. package/build/js/defaults/DefaultsDataCaptureView.js +1 -1
  94. package/build/js/global.d.d.ts +1 -0
  95. package/build/js/index.d.ts +5 -3
  96. package/build/js/index.js +1 -1
  97. package/build/js/moduleLoader.d.ts +4 -2
  98. package/build/js/private/AdditionalLayerPosition.d.ts +6 -0
  99. package/build/js/private/AdditionalLayerPosition.js +1 -0
  100. package/build/js/private/BatteryInterface.d.ts +81 -0
  101. package/build/js/private/BatteryInterface.js +1 -0
  102. package/build/js/private/CameraAccess.d.ts +1 -1
  103. package/build/js/private/CameraAccess.js +1 -1
  104. package/build/js/private/CameraManager.d.ts +5 -3
  105. package/build/js/private/CameraManager.js +1 -1
  106. package/build/js/private/CameraPool.d.ts +5 -2
  107. package/build/js/private/CameraPool.js +1 -1
  108. package/build/js/private/CanvasDrawerWithMetrics.d.ts +4 -2
  109. package/build/js/private/CoreModuleLicenseTextProvider.d.ts +4 -2
  110. package/build/js/private/CoreModuleLicenseTextProvider.js +1 -1
  111. package/build/js/private/CustomLocationsView.js +1 -1
  112. package/build/js/private/DataCaptureContextRelated.d.ts +4 -2
  113. package/build/js/private/FrameReaders/FrameReader.d.ts +4 -2
  114. package/build/js/private/FrameReaders/FrameReader.js +1 -1
  115. package/build/js/private/FrameReaders/FrameReaderAbstract.d.ts +4 -2
  116. package/build/js/private/FrameReaders/GrayScaleFrameReader.d.ts +4 -2
  117. package/build/js/private/FrameReaders/GrayScaleFrameReader.js +1 -1
  118. package/build/js/private/FrameReaders/index.d.ts +4 -2
  119. package/build/js/private/FrameReaders/index.js +1 -1
  120. package/build/js/private/NormalizedModuleLoaderOptions.d.ts +4 -2
  121. package/build/js/private/OrientationObserver.js +1 -1
  122. package/build/js/private/SingleImageUploaderView.d.ts +4 -2
  123. package/build/js/private/SingleImageUploaderView.js +1 -1
  124. package/build/js/private/ViewControls+related.js +1 -1
  125. package/build/js/private/ViewControls_related.d.ts +4 -2
  126. package/build/js/private/ViewStyles.js +1 -1
  127. package/build/js/private/ViewsRegistry.d.ts +4 -2
  128. package/build/js/private/customHowler/AudioCache.d.ts +37 -0
  129. package/build/js/private/customHowler/AudioCache.js +1 -0
  130. package/build/js/private/customHowler/Howl.d.ts +189 -0
  131. package/build/js/private/customHowler/Howl.js +1 -0
  132. package/build/js/private/customHowler/HowlRegistry.d.ts +18 -0
  133. package/build/js/private/customHowler/HowlRegistry.js +1 -0
  134. package/build/js/private/customHowler/Html5Sound.d.ts +52 -0
  135. package/build/js/private/customHowler/Html5Sound.js +1 -0
  136. package/build/js/private/customHowler/UnlockManager.d.ts +39 -0
  137. package/build/js/private/customHowler/UnlockManager.js +1 -0
  138. package/build/js/private/customHowler/WebAudioContextManager.d.ts +161 -0
  139. package/build/js/private/customHowler/WebAudioContextManager.js +1 -0
  140. package/build/js/private/customHowler/debug.d.ts +28 -0
  141. package/build/js/private/customHowler/debug.js +1 -0
  142. package/build/js/private/customHowler/index.d.ts +2 -0
  143. package/build/js/private/customHowler/index.js +1 -0
  144. package/build/js/private/customHowler/setup.d.ts +55 -0
  145. package/build/js/private/customHowler/setup.js +1 -0
  146. package/build/js/private/hybridDesktopPlatformHelpers.js +1 -1
  147. package/build/js/private/ui/atoms/AimerSvgIcon.js +1 -1
  148. package/build/js/private/ui/atoms/ArrowDownSvgIcon.js +1 -1
  149. package/build/js/private/ui/atoms/ArrowLeftSvgIcon.js +1 -1
  150. package/build/js/private/ui/atoms/ArrowRightSvgIcon.js +1 -1
  151. package/build/js/private/ui/atoms/ArrowUpSvgIcon.js +1 -1
  152. package/build/js/private/ui/atoms/ArrowsUp.js +1 -1
  153. package/build/js/private/ui/atoms/Backdrop.js +1 -1
  154. package/build/js/private/ui/atoms/CalendarExclamationMarkSvgIcon.js +1 -1
  155. package/build/js/private/ui/atoms/CameraFOVUltrawideSvgIcon.js +1 -1
  156. package/build/js/private/ui/atoms/CameraFOVWideSvgIcon.js +1 -1
  157. package/build/js/private/ui/atoms/CameraSwitchReverseSvgIcon.js +1 -1
  158. package/build/js/private/ui/atoms/CameraSwitchSvgIcon.js +1 -1
  159. package/build/js/private/ui/atoms/Card.js +1 -1
  160. package/build/js/private/ui/atoms/CardList.js +1 -1
  161. package/build/js/private/ui/atoms/CheckSvgIcon.js +1 -1
  162. package/build/js/private/ui/atoms/ChevronDownSvgIcon.js +1 -1
  163. package/build/js/private/ui/atoms/ChevronLeftSvgIcon.js +1 -1
  164. package/build/js/private/ui/atoms/ChevronRightSvgIcon.js +1 -1
  165. package/build/js/private/ui/atoms/ChevronUpSvgIcon.js +1 -1
  166. package/build/js/private/ui/atoms/CrossSvgIcon.js +1 -1
  167. package/build/js/private/ui/atoms/DeleteSvgIcon.js +1 -1
  168. package/build/js/private/ui/atoms/Dot5xSvgIcon.js +1 -1
  169. package/build/js/private/ui/atoms/ExclamationMarkSvgIcon.js +1 -1
  170. package/build/js/private/ui/atoms/GlassSvgIcon.js +1 -1
  171. package/build/js/private/ui/atoms/HandLensCheckSvgIcon.js +1 -1
  172. package/build/js/private/ui/atoms/KeyboardSvgIcon.js +1 -1
  173. package/build/js/private/ui/atoms/LowStockSvgIcon.js +1 -1
  174. package/build/js/private/ui/atoms/OnexSvgIcon.js +1 -1
  175. package/build/js/private/ui/atoms/PauseSvgIcon.js +1 -1
  176. package/build/js/private/ui/atoms/PrinterSvgIcon.js +1 -1
  177. package/build/js/private/ui/atoms/ProgressBar.js +1 -1
  178. package/build/js/private/ui/atoms/QuestionMarkSvgIcon.js +1 -1
  179. package/build/js/private/ui/atoms/RestartSvgIcon.js +1 -1
  180. package/build/js/private/ui/atoms/RoundedCheckSvgIcon.js +1 -1
  181. package/build/js/private/ui/atoms/RoundedCrossSvgIcon.js +1 -1
  182. package/build/js/private/ui/atoms/RoundedExclamationMarkSvgIcon.js +1 -1
  183. package/build/js/private/ui/atoms/ScanSvgIcon.js +1 -1
  184. package/build/js/private/ui/atoms/ShutterButton.js +1 -1
  185. package/build/js/private/ui/atoms/SlashSvgIcon.js +1 -1
  186. package/build/js/private/ui/atoms/StarFilledSvgIcon.js +1 -1
  187. package/build/js/private/ui/atoms/StarHalfFilledSvgIcon.js +1 -1
  188. package/build/js/private/ui/atoms/StarOutlinedSvgIcon.js +1 -1
  189. package/build/js/private/ui/atoms/SvgIcon.js +1 -1
  190. package/build/js/private/ui/atoms/ToPickSvgIcon.js +1 -1
  191. package/build/js/private/ui/atoms/Toast.d.ts +4 -2
  192. package/build/js/private/ui/atoms/Toast.js +1 -1
  193. package/build/js/private/ui/atoms/TorchOffSvgIcon.js +1 -1
  194. package/build/js/private/ui/atoms/TorchOnSvgIcon.js +1 -1
  195. package/build/js/private/ui/atoms/TwoxSvgIcon.js +1 -1
  196. package/build/js/private/ui/atoms/WrongItemSvgIcon.js +1 -1
  197. package/build/js/private/ui/molecules/CameraFOVSwitchButton.js +1 -1
  198. package/build/js/private/ui/molecules/CameraSwitchButton.js +1 -1
  199. package/build/js/private/ui/molecules/ControlsLayout.js +1 -1
  200. package/build/js/private/ui/molecules/HintPresenter.d.ts +4 -2
  201. package/build/js/private/ui/molecules/HintPresenter.js +1 -1
  202. package/build/js/private/ui/molecules/LoadingOverlay.js +1 -1
  203. package/build/js/private/ui/molecules/TorchSwitchIconButton.d.ts +1 -1
  204. package/build/js/private/ui/molecules/TorchSwitchIconButton.js +1 -1
  205. package/build/js/private/utils/index.js +1 -1
  206. package/build/js/private/utils/polyfillLoader.js +1 -1
  207. package/build/js/private/utils/replaceImagesInViewUtils.d.ts +4 -2
  208. package/build/js/private/utils/warnMultithreadingUnavailable.js +1 -1
  209. package/build/js/worker/ImageConverterForwarder.d.ts +4 -2
  210. package/build/js/worker/ViewInfoHelper.d.ts +4 -2
  211. package/build/js/worker/WorkerMain.d.ts +4 -2
  212. package/build/js/worker/WorkerMain.js +1 -1
  213. package/build/js/worker/coreCapture.inlineWorker.d.ts +4 -2
  214. package/build/js/worker/coreCapture.inlineWorker.js +1 -1
  215. package/build/js/worker/dataCaptureEngine.d.ts +4 -2
  216. package/build/js/worker/dataCaptureEngine.js +1 -1
  217. package/build/js/worker/dataCaptureLoader.d.ts +4 -2
  218. package/build/js/worker/dataCaptureLoader.js +1 -1
  219. package/build/js/worker/dataCaptureWorkerRelated.d.ts +4 -2
  220. package/build/js/worker/dataCaptureWorkerRelated.js +1 -1
  221. package/build/js/worker/index.d.ts +4 -2
  222. package/build/js/worker/index.js +1 -1
  223. package/package.json +6 -6
  224. package/build/js/chunks/chunk-4J3Y5IIL.js +0 -1
  225. package/build/js/chunks/chunk-A225YZFY.js +0 -2
  226. package/build/js/chunks/chunk-IBDUCVB4.js +0 -1
  227. package/build/js/chunks/chunk-LH2NI5UL.js +0 -2
  228. package/build/js/chunks/chunk-Q5WJX5JB.js +0 -1
  229. package/build/js/chunks/chunk-RVAHEVSC.js +0 -1
  230. package/build/js/chunks/chunk-SYGWA3T6.js +0 -35
  231. package/build/js/chunks/chunk-TR5HATUD.js +0 -1
  232. package/build/js/chunks/chunk-TTMLHWYT.js +0 -6
  233. package/build/js/chunks/chunk-UOQFOEG6.js +0 -1
  234. package/build/js/chunks/chunk-VQYVIA64.js +0 -1
  235. package/build/js/chunks/chunk-ZDROGZFO.js +0 -1
  236. /package/build/js/chunks/{chunk-TU2LKPHV.js → chunk-YRQQE3NR.js} +0 -0
@@ -1 +1 @@
1
- import {a as a$1}from'../chunks/chunk-4J3Y5IIL.js';import {d as d$1}from'../chunks/chunk-NT5WI2PS.js';import {b}from'../chunks/chunk-A225YZFY.js';import {a}from'../chunks/chunk-XR65N6EG.js';import {f as f$1,g}from'../chunks/chunk-3D2HNEVH.js';var S=(t=>(t.Idle="idle",t.Pressed="pressed",t))(S||{}),d=class{constructor(e,t){this.state="idle";this.isHover=false;this.controlTypeToAriaLabelMap={"camera-fov":"Switch camera field of view",camera:"Switch camera",torch:"Toggle torch"};this.control=e,this.domHost=t,this.onTouchStartListener=this.onTouchStart.bind(this),this.onMouseEnterListener=this.onMouseEnter.bind(this),this.onMouseLeaveListener=this.onMouseLeave.bind(this),this.onClickListener=this.onClick.bind(this),this.setup();}get frameSource(){var e,t;return (t=(e=this.control.view)==null?void 0:e.getContext())==null?void 0:t.frameSource}get context(){var e;return (e=this.control.view)==null?void 0:e.getContext()}async install(){this.button||this.setup();let e=await this.canShow();return e?(this.updateButtonBackground(this.button,this.getImageFromState()),this.show()):this.hide(),e}remove(e=false){e&&this.button?(this.button.removeEventListener("mouseenter",this.onMouseEnterListener),this.button.removeEventListener("mouseleave",this.onMouseLeaveListener),this.button.removeEventListener("touchstart",this.onTouchStartListener),this.button.removeEventListener("click",this.onClickListener),this.button.remove(),this.isHover=false,this.button=void 0):this.hide();}hide(){this.button&&(this.button.style.display="none");}show(){this.button&&(this.button.style.display="block");}setupButton(){let e=document.createElement("button");e.type="button",e.style.display="none",e.className=`scandit-control-widget scandit-control-widget-${this.control.type}`,this.updateButtonBackground(e,this.getImageFromState()),this.domHost.append(e),e.addEventListener("mouseenter",this.onMouseEnterListener),e.addEventListener("mouseleave",this.onMouseLeaveListener),b.isDesktopDevice()||e.addEventListener("touchstart",this.onTouchStartListener),e.addEventListener("click",this.onClickListener),e.setAttribute("aria-pressed",String(this.state==="pressed"));let t=this.control.type,i=this.controlTypeToAriaLabelMap[t];return e.setAttribute("aria-label",i),this.button=e,this.button}setup(){this.setupButton();}onTouchStart(){var e,t;(e=this.button)==null||e.removeEventListener("mouseenter",this.onMouseEnterListener),(t=this.button)==null||t.removeEventListener("mouseleave",this.onMouseLeaveListener);}onMouseEnter(){this.isHover=true,this.updateButtonBackground(this.button,this.getImageFromState());}onMouseLeave(){this.isHover=false,this.updateButtonBackground(this.button,this.getImageFromState());}onClick(){var e;this.state=this.state==="pressed"?"idle":"pressed",this.buttonClicked(),this.updateButtonBackground(this.button,this.getImageFromState()),(e=this.button)==null||e.setAttribute("aria-pressed",String(this.state==="pressed"));}updateButtonBackground(e,t){t!=null&&e!=null&&(e.style.backgroundImage=`url(${JSON.stringify(t)})`);}},v=class extends d{constructor(e,t){super(e,t);}async buttonClicked(){await this.frameSource.setDesiredTorchState(this.retrieveTorchState()==="on"?"off":"on");}async canShow(){return this.isTorchAvailable()}getImageFromState(){return this.retrieveTorchState()==="on"?this.isHover?this.control.torchOnPressedImage:this.control.torchOnImage:this.isHover?this.control.torchOffPressedImage:this.control.torchOffImage}setup(){if(this.control.torchOffImage==null||this.control.torchOnImage==null){a.log(a.Level.Warn,"TorchSwitchControl icon is not set or is empty, the control will not be rendered.");return}super.setup();}async isTorchAvailable(){return f$1(this.frameSource)?this.frameSource.isTorchAvailable():false}retrieveTorchState(){return f$1(this.frameSource)?this.frameSource.getDesiredTorchState():"off"}},f=class extends d{constructor(e,t){super(e,t);}async canShow(){return (await a$1.getAll()).length>1}getImageFromState(){return this.isHover?this.control.pressedImage:this.control.idleImage}async buttonClicked(){if(this.isTransitioning)return;let e=await this.getNextDeviceCamera();e&&await this.switchCameras(e);}setup(){if(this.control.idleImage==null){a.log(a.Level.Warn,"CameraSwitchControl idle icon is not set or is empty, the control will not be rendered.");return}super.setup();}async getNextDeviceCamera(){var a;let e=await a$1.getAll(false,true),t=this.frameSource?this.frameSource:null,i=t==null?void 0:t.deviceId,r=e.findIndex(n=>n.deviceId===i);return r>-1?(a=e[r+1])!=null?a:e[0]:e.length>0?e[0]:null}async switchCameras(e){var a,n,l;this.isTransitioning=true;let t=(a=this.context)==null?void 0:a.frameSource,i,r;t!=null&&(i=new g(t.settings),r=t.desiredState),await(t==null?void 0:t.switchToDesiredState("off")),i!=null&&await e.applySettings(i),await((n=this.context)==null?void 0:n.setFrameSource(e)),await((l=this.context)==null?void 0:l.frameSource).switchToDesiredState(r!=null?r:"on"),this.isTransitioning=false;}},C=class extends d{constructor(e,t){super(e,t);}async install(){let e=await super.install();return e&&await this.setInitialCamera(),e}async canShow(){return !b.isIOSDeviceWithExtendedCameraAccess()||!f$1(this.frameSource)?false:d$1.isIOSBackDualWideCameraLabel(this.frameSource.label)||d$1.isIOSBackCameraLabel(this.frameSource.label)||d$1.isIOSUltraWideBackCameraLabel(this.frameSource.label)}getImageFromState(){return this.isUltraWideBackCamera()?this.isHover?this.control.cameraFOVUltraWidePressedImage:this.control.cameraFOVUltraWideImage:this.isHover?this.control.cameraFOVWidePressedImage:this.control.cameraFOVWideImage}async buttonClicked(){if(this.isTransitioning)return;let e=await this.getAlternativeCamera();e&&await this.switchCameras(e);}setup(){if(this.control.cameraFOVUltraWideImage==null||this.control.cameraFOVWideImage==null){a.log(a.Level.Warn,"CameraFOVSwitchControl icon is not set or is empty, the control will not be rendered.");return}super.setup();}async setInitialCamera(){var e,t;if(!this.isTransitioning&&!d$1.isIOSBackCameraLabel((t=(e=this.frameSource)==null?void 0:e.label)!=null?t:"")){let r=(await a$1.getAll()).find(a=>d$1.isIOSBackCameraLabel(a.label));r&&await this.switchCameras(r);}}isUltraWideBackCamera(){return f$1(this.frameSource)?d$1.isIOSUltraWideBackCameraLabel(this.frameSource.label):false}async getAlternativeCamera(){return (await a$1.getAll()).find(t=>this.isUltraWideBackCamera()?d$1.isIOSBackCameraLabel(t.label):d$1.isIOSUltraWideBackCameraLabel(t.label))}async switchCameras(e){var a,n,l;this.isTransitioning=true;let t=(a=this.context)==null?void 0:a.frameSource,i,r;t!=null&&(i=new g(t.settings),r=t.desiredState),await(t==null?void 0:t.switchToDesiredState("off")),i!=null&&await e.applySettings(i),await((n=this.context)==null?void 0:n.setFrameSource(e)),await((l=this.context)==null?void 0:l.frameSource).switchToDesiredState(r!=null?r:"on"),this.isTransitioning=false;}};export{S as ButtonState,f as CameraSwitchControlWidget,C as PrivateCameraFOVSwitchControlWidget,v as PrivateTorchControlWidget};
1
+ import {a as a$1}from'../chunks/chunk-RY2EW3RR.js';import {d as d$1}from'../chunks/chunk-YUZDO2PC.js';import {b}from'../chunks/chunk-YONR3EGV.js';import {a}from'../chunks/chunk-XR65N6EG.js';import {f as f$1,g}from'../chunks/chunk-3D2HNEVH.js';var S=(t=>(t.Idle="idle",t.Pressed="pressed",t))(S||{}),d=class{constructor(e,t){this.state="idle";this.isHover=false;this.controlTypeToAriaLabelMap={"camera-fov":"Switch camera field of view",camera:"Switch camera",torch:"Toggle torch"};this.control=e,this.domHost=t,this.onTouchStartListener=this.onTouchStart.bind(this),this.onMouseEnterListener=this.onMouseEnter.bind(this),this.onMouseLeaveListener=this.onMouseLeave.bind(this),this.onClickListener=this.onClick.bind(this),this.setup();}get frameSource(){var e,t;return (t=(e=this.control.view)==null?void 0:e.getContext())==null?void 0:t.frameSource}get context(){var e;return (e=this.control.view)==null?void 0:e.getContext()}async install(){this.button||this.setup();let e=await this.canShow();return e?(this.updateButtonBackground(this.button,this.getImageFromState()),this.show()):this.hide(),e}remove(e=false){e&&this.button?(this.button.removeEventListener("mouseenter",this.onMouseEnterListener),this.button.removeEventListener("mouseleave",this.onMouseLeaveListener),this.button.removeEventListener("touchstart",this.onTouchStartListener),this.button.removeEventListener("click",this.onClickListener),this.button.remove(),this.isHover=false,this.button=void 0):this.hide();}hide(){this.button&&(this.button.style.display="none");}show(){this.button&&(this.button.style.display="block");}setupButton(){let e=document.createElement("button");e.type="button",e.style.display="none",e.className=`scandit-control-widget scandit-control-widget-${this.control.type}`,this.updateButtonBackground(e,this.getImageFromState()),this.domHost.append(e),e.addEventListener("mouseenter",this.onMouseEnterListener),e.addEventListener("mouseleave",this.onMouseLeaveListener),b.isDesktopDevice()||e.addEventListener("touchstart",this.onTouchStartListener),e.addEventListener("click",this.onClickListener),e.setAttribute("aria-pressed",String(this.state==="pressed"));let t=this.control.type,i=this.controlTypeToAriaLabelMap[t];return e.setAttribute("aria-label",i),this.button=e,this.button}setup(){this.setupButton();}onTouchStart(){var e,t;(e=this.button)==null||e.removeEventListener("mouseenter",this.onMouseEnterListener),(t=this.button)==null||t.removeEventListener("mouseleave",this.onMouseLeaveListener);}onMouseEnter(){this.isHover=true,this.updateButtonBackground(this.button,this.getImageFromState());}onMouseLeave(){this.isHover=false,this.updateButtonBackground(this.button,this.getImageFromState());}onClick(){var e;this.state=this.state==="pressed"?"idle":"pressed",this.buttonClicked(),this.updateButtonBackground(this.button,this.getImageFromState()),(e=this.button)==null||e.setAttribute("aria-pressed",String(this.state==="pressed"));}updateButtonBackground(e,t){t!=null&&e!=null&&(e.style.backgroundImage=`url(${JSON.stringify(t)})`);}},v=class extends d{constructor(e,t){super(e,t);}async buttonClicked(){await this.frameSource.setDesiredTorchState(this.retrieveTorchState()==="on"?"off":"on");}async canShow(){return this.isTorchAvailable()}getImageFromState(){return this.retrieveTorchState()==="on"?this.isHover?this.control.torchOnPressedImage:this.control.torchOnImage:this.isHover?this.control.torchOffPressedImage:this.control.torchOffImage}setup(){if(this.control.torchOffImage==null||this.control.torchOnImage==null){a.log(a.Level.Warn,"TorchSwitchControl icon is not set or is empty, the control will not be rendered.");return}super.setup();}async isTorchAvailable(){return f$1(this.frameSource)?this.frameSource.isTorchAvailable():false}retrieveTorchState(){return f$1(this.frameSource)?this.frameSource.getDesiredTorchState():"off"}},f=class extends d{constructor(e,t){super(e,t);}async canShow(){return (await a$1.getAll()).length>1}getImageFromState(){return this.isHover?this.control.pressedImage:this.control.idleImage}async buttonClicked(){if(this.isTransitioning)return;let e=await this.getNextDeviceCamera();e&&await this.switchCameras(e);}setup(){if(this.control.idleImage==null){a.log(a.Level.Warn,"CameraSwitchControl idle icon is not set or is empty, the control will not be rendered.");return}super.setup();}async getNextDeviceCamera(){var a;let e=await a$1.getAll(false,true),t=this.frameSource?this.frameSource:null,i=t==null?void 0:t.deviceId,r=e.findIndex(n=>n.deviceId===i);return r>-1?(a=e[r+1])!=null?a:e[0]:e.length>0?e[0]:null}async switchCameras(e){var a,n,l;this.isTransitioning=true;let t=(a=this.context)==null?void 0:a.frameSource,i,r;t!=null&&(i=new g(t.settings),r=t.desiredState),await(t==null?void 0:t.switchToDesiredState("off")),i!=null&&await e.applySettings(i),await((n=this.context)==null?void 0:n.setFrameSource(e)),await((l=this.context)==null?void 0:l.frameSource).switchToDesiredState(r!=null?r:"on"),this.isTransitioning=false;}},C=class extends d{constructor(e,t){super(e,t);}async install(){let e=await super.install();return e&&await this.setInitialCamera(),e}async canShow(){return !b.isIOSDeviceWithExtendedCameraAccess()||!f$1(this.frameSource)?false:d$1.isIOSBackDualWideCameraLabel(this.frameSource.label)||d$1.isIOSBackCameraLabel(this.frameSource.label)||d$1.isIOSUltraWideBackCameraLabel(this.frameSource.label)}getImageFromState(){return this.isUltraWideBackCamera()?this.isHover?this.control.cameraFOVUltraWidePressedImage:this.control.cameraFOVUltraWideImage:this.isHover?this.control.cameraFOVWidePressedImage:this.control.cameraFOVWideImage}async buttonClicked(){if(this.isTransitioning)return;let e=await this.getAlternativeCamera();e&&await this.switchCameras(e);}setup(){if(this.control.cameraFOVUltraWideImage==null||this.control.cameraFOVWideImage==null){a.log(a.Level.Warn,"CameraFOVSwitchControl icon is not set or is empty, the control will not be rendered.");return}super.setup();}async setInitialCamera(){var e,t;if(!this.isTransitioning&&!d$1.isIOSBackCameraLabel((t=(e=this.frameSource)==null?void 0:e.label)!=null?t:"")){let r=(await a$1.getAll()).find(a=>d$1.isIOSBackCameraLabel(a.label));r&&await this.switchCameras(r);}}isUltraWideBackCamera(){return f$1(this.frameSource)?d$1.isIOSUltraWideBackCameraLabel(this.frameSource.label):false}async getAlternativeCamera(){return (await a$1.getAll()).find(t=>this.isUltraWideBackCamera()?d$1.isIOSBackCameraLabel(t.label):d$1.isIOSUltraWideBackCameraLabel(t.label))}async switchCameras(e){var a,n,l;this.isTransitioning=true;let t=(a=this.context)==null?void 0:a.frameSource,i,r;t!=null&&(i=new g(t.settings),r=t.desiredState),await(t==null?void 0:t.switchToDesiredState("off")),i!=null&&await e.applySettings(i),await((n=this.context)==null?void 0:n.setFrameSource(e)),await((l=this.context)==null?void 0:l.frameSource).switchToDesiredState(r!=null?r:"on"),this.isTransitioning=false;}};export{S as ButtonState,f as CameraSwitchControlWidget,C as PrivateCameraFOVSwitchControlWidget,v as PrivateTorchControlWidget};
@@ -1,6 +1,6 @@
1
1
  /// <reference types="emscripten" />
2
- import { g as FrameSource } from '../Camera-DhGjpcjv.js';
3
- import { y as DataCaptureView, C as Control, p as DataCaptureContext } from '../DataCaptureContext-Dvdr7st4.js';
2
+ import { g as FrameSource } from '../Camera-Cc__1Nc-.js';
3
+ import { C as Control, f as DataCaptureContext, p as DataCaptureView } from '../DataCaptureContext-BcSpF9Dt.js';
4
4
  import { CameraFOVSwitchControl } from '../controls/CameraFOVSwitchControl.js';
5
5
  import { CameraSwitchControl } from '../controls/CameraSwitchControl.js';
6
6
  import { TorchSwitchControl } from '../controls/TorchSwitchControl.js';
@@ -29,9 +29,11 @@ import './CustomLocationsView.js';
29
29
  import './View.js';
30
30
  import './AnchorPositions.js';
31
31
  import './nativeHandle.js';
32
+ import './AdditionalLayerPosition.js';
32
33
  import '../license/OpenSourceSoftwareLicenseInfo.js';
33
34
  import '../logger.js';
34
35
  import './FrameReaders/ColorType.js';
36
+ import './BatteryInterface.js';
35
37
  import '../LoadingStatus.js';
36
38
  import './djinni-types/index.js';
37
39
  import './HtmlElementState.js';
@@ -1 +1 @@
1
- export{a as getDataCaptureViewStyles}from'../chunks/chunk-UOQFOEG6.js';
1
+ export{a as getDataCaptureViewStyles}from'../chunks/chunk-A5G2NHT2.js';
@@ -1,6 +1,6 @@
1
1
  /// <reference types="emscripten" />
2
- import { y as DataCaptureView } from '../DataCaptureContext-Dvdr7st4.js';
3
- import '../Camera-DhGjpcjv.js';
2
+ import { p as DataCaptureView } from '../DataCaptureContext-BcSpF9Dt.js';
3
+ import '../Camera-Cc__1Nc-.js';
4
4
  import '../commons/Rect.js';
5
5
  import './Serializable.js';
6
6
  import '../commons/Point.js';
@@ -26,9 +26,11 @@ import './CustomLocationsView.js';
26
26
  import './View.js';
27
27
  import './AnchorPositions.js';
28
28
  import './nativeHandle.js';
29
+ import './AdditionalLayerPosition.js';
29
30
  import '../license/OpenSourceSoftwareLicenseInfo.js';
30
31
  import '../logger.js';
31
32
  import './FrameReaders/ColorType.js';
33
+ import './BatteryInterface.js';
32
34
  import '../LoadingStatus.js';
33
35
  import './djinni-types/index.js';
34
36
  import './HtmlElementState.js';
@@ -0,0 +1,37 @@
1
+ /// <reference types="emscripten" />
2
+ /**
3
+ * Audio buffer cache manager
4
+ * Avoids re-loading and re-decoding the same audio files
5
+ *
6
+ * Benefits:
7
+ * - Multiple Howl instances for the same sound share one AudioBuffer
8
+ * - Avoids redundant network requests and CPU-intensive decoding
9
+ * - Particularly important for frequently played sounds (like beeps)
10
+ *
11
+ * @private
12
+ */
13
+ declare class AudioCache {
14
+ private cache;
15
+ /**
16
+ * Get a cached audio buffer promise
17
+ * @param src Audio source URL (data URI or file path)
18
+ * @returns Promise<AudioBuffer> if cached, undefined otherwise
19
+ */
20
+ get(src: string): Promise<AudioBuffer> | undefined;
21
+ /**
22
+ * Cache an audio buffer promise
23
+ * @param src Audio source URL
24
+ * @param promise Promise that resolves to decoded AudioBuffer
25
+ */
26
+ set(src: string, promise: Promise<AudioBuffer>): void;
27
+ /**
28
+ * Clear all cached buffers (useful for cleanup or testing)
29
+ */
30
+ clear(): void;
31
+ /**
32
+ * Get cache size (for monitoring)
33
+ */
34
+ size(): number;
35
+ }
36
+
37
+ export { AudioCache };
@@ -0,0 +1 @@
1
+ export{a as AudioCache}from'../../chunks/chunk-NYYGU4ZV.js';
@@ -0,0 +1,189 @@
1
+ /// <reference types="emscripten" />
2
+ /**
3
+ * Type definitions for customHowler audio system
4
+ * @private
5
+ */
6
+ interface HowlOptions {
7
+ src: string | string[];
8
+ /**
9
+ * Force use of HTML5 audio element instead of Web Audio API.
10
+ * Useful for testing or specific use cases where HTML5 is preferred.
11
+ * Default: auto-detect (use Web Audio API everywhere for non-blocking playback)
12
+ * Note: HTML5 audio blocks the main thread and should be avoided.
13
+ */
14
+ html5?: boolean;
15
+ }
16
+ /**
17
+ * Lightweight Howl implementation using Web Audio API
18
+ *
19
+ * ## Features
20
+ *
21
+ * - **Web Audio API** (Desktop): Off-main-thread audio processing (smooth UI rendering)
22
+ * - **HTML5 Audio** (iOS): Reliable playback on iOS devices (avoids pitch shifting)
23
+ * - **HTML5 Sound pooling**: Maintains a pool of audio elements for efficient concurrent playback
24
+ * - **Caching**: Decoded AudioBuffers cached globally (efficient repeated playback)
25
+ * - **Overlapping playback**: Multiple source nodes allow simultaneous sounds
26
+ * - **Tree-shakable**: Side-effect free, lazy initialization
27
+ * - **Auto-unlock**: Automatically unlocks audio on first user interaction
28
+ * - **Auto-detect**: Automatically uses HTML5 on iOS, Web Audio API on desktop
29
+ *
30
+ * ## Usage
31
+ *
32
+ * ```typescript
33
+ * const beep = new Howl({ src: 'beep.mp3' });
34
+ * beep.play(); // First call unlocks audio, subsequent calls play immediately
35
+ * beep.play(); // Overlapping playback supported
36
+ * ```
37
+ *
38
+ * ## Performance Notes
39
+ *
40
+ * **Desktop (Web Audio API):**
41
+ * - Each play() call creates a new AudioBufferSourceNode (allows overlapping)
42
+ * - AudioBuffer is decoded once and shared (efficient repeated playback)
43
+ * - Audio runs on separate thread (doesn't block UI)
44
+ *
45
+ * **iOS (HTML5 Audio):**
46
+ * - Uses HTML5 audio pool for efficient concurrent playback
47
+ * - Main thread may block briefly during playback (unavoidable on iOS)
48
+ * - Reliable pitch and sample rate (avoids Web Audio API issues)
49
+ *
50
+ * ## Overlapping Playback
51
+ *
52
+ * Each call to play() creates a new AudioBufferSourceNode, allowing the same
53
+ * sound to play multiple times simultaneously (useful for rapid scanning feedback).
54
+ * The decoded AudioBuffer is shared, only the source nodes are created per play.
55
+ */
56
+ declare class Howl {
57
+ /** Audio source URL (data URI, file path, or URL) */
58
+ private src;
59
+ /** Use HTML5 audio element (true) or Web Audio API (false) */
60
+ private html5;
61
+ /** Decoded audio buffer (cached after first load) - for Web Audio API only */
62
+ private audioBuffer;
63
+ /** Loading promise (prevents duplicate loads) */
64
+ private loadPromise;
65
+ /** Pool of HTML5 Sound objects (similar to Howler.js) */
66
+ private soundPool;
67
+ private soundPoolSize;
68
+ /** Track inactive (available) sounds for O(1) lookup instead of O(n) find */
69
+ private inactiveSounds;
70
+ constructor(options: HowlOptions);
71
+ /**
72
+ * Load and decode the audio file
73
+ *
74
+ * ## Caching Strategy
75
+ *
76
+ * This method implements three levels of caching:
77
+ *
78
+ * 1. **Instance cache**: Check if this Howl instance has already loaded the audio
79
+ * 2. **Instance promise cache**: Check if this Howl instance is currently loading
80
+ * 3. **Global cache**: Check if any Howl instance has loaded this URL
81
+ *
82
+ * Benefits:
83
+ * - Multiple Howl instances for the same sound share one AudioBuffer
84
+ * - Prevents duplicate network requests
85
+ * - Avoids redundant CPU-intensive audio decoding
86
+ * - Important for rapid scanning where same sound plays frequently
87
+ *
88
+ * ## Loading Process
89
+ *
90
+ * 1. Fetch audio file (supports data URIs, relative paths, full URLs)
91
+ * 2. Convert to ArrayBuffer
92
+ * 3. Decode using AudioContext.decodeAudioData() (async, CPU-intensive)
93
+ * 4. Cache the decoded AudioBuffer
94
+ *
95
+ * Note: decodeAudioData() runs in a separate thread and doesn't block the main thread
96
+ *
97
+ * @returns Promise<AudioBuffer> - Decoded audio ready for playback
98
+ */
99
+ private load;
100
+ /**
101
+ * Get or create a sound from the pool
102
+ * Follows Howler.js pattern: pool of Sound objects with state tracking
103
+ * Uses Set for O(1) lookup of inactive sounds instead of O(n) array find
104
+ * @private
105
+ */
106
+ private getSoundFromPool;
107
+ /**
108
+ * Verify audio buffer contains actual data (debugging helper, no-op in production)
109
+ * @private
110
+ */
111
+ private verifyAudioBuffer;
112
+ /**
113
+ * Handle playback errors for Web Audio API
114
+ * @private
115
+ */
116
+ private handlePlaybackError;
117
+ /**
118
+ * Prepare AudioContext for playback
119
+ * @private
120
+ */
121
+ private prepareAudioContext;
122
+ /**
123
+ * Play sound using HTML5 Sound pool (Howler.js style)
124
+ * Follows Howler.js pattern of Sound objects with state tracking
125
+ *
126
+ * ## Non-blocking Playback
127
+ *
128
+ * On iOS, the HTML5 audio play() call can block the main thread. To prevent
129
+ * this from blocking overlay rendering during continuous scanning, we defer
130
+ * the play() call to the next animation frame using requestAnimationFrame.
131
+ * This keeps the current frame free for UI rendering.
132
+ *
133
+ * @private
134
+ */
135
+ private playHTML5;
136
+ /**
137
+ * Play the sound.
138
+ *
139
+ * This method is the public API - call it to play the sound.
140
+ * It's non-blocking (fire-and-forget) and supports overlapping playback.
141
+ *
142
+ * ## Behavior
143
+ *
144
+ * - Creates a new AudioBufferSourceNode for each call (allows overlapping)
145
+ * - Reuses cached AudioBuffer (efficient repeated playback)
146
+ * - Auto-unlocks audio on first play (if not already unlocked)
147
+ * - Uses iOS MediaStreamDestination workaround when needed
148
+ *
149
+ * ## Example
150
+ *
151
+ * ```typescript
152
+ * const beep = new Howl({ src: 'beep.mp3' });
153
+ * beep.play(); // First play
154
+ * beep.play(); // Overlapping play (both sounds play simultaneously)
155
+ * ```
156
+ */
157
+ play(): void;
158
+ /**
159
+ * Internal async play method
160
+ *
161
+ * ## Playback Flow
162
+ *
163
+ * 1. **Unlock check**: Ensure audio is unlocked (iOS requirement)
164
+ * 2. **Load**: Load and decode audio if not already cached
165
+ * 3. **Create source**: Create new AudioBufferSourceNode for this playback
166
+ * 4. **Setup audio graph**: Source → Gain → Destination
167
+ * 5. **Start playback**: Call source.start(0) to play immediately
168
+ * 6. **Cleanup**: Disconnect source after playback completes
169
+ *
170
+ * ## Platform-specific playback
171
+ *
172
+ * **Desktop:**
173
+ * - Uses Web Audio API with standard AudioContext destination
174
+ *
175
+ * **iOS:**
176
+ * - Uses HTML5 <audio> elements for reliable playback
177
+ * - Avoids Web Audio API pitch shifting issues on real devices
178
+ *
179
+ * ## Performance Notes
180
+ *
181
+ * - AudioBuffer loading/decoding happens once (cached)
182
+ * - Each play() creates only a lightweight source node
183
+ * - Gain node allows future volume control (currently 1.0)
184
+ * - Source disconnects automatically after playback to free memory
185
+ */
186
+ private playAsync;
187
+ }
188
+
189
+ export { Howl, type HowlOptions };
@@ -0,0 +1 @@
1
+ export{a as Howl}from'../../chunks/chunk-EEWGHHL4.js';
@@ -0,0 +1,18 @@
1
+ /// <reference types="emscripten" />
2
+ /**
3
+ * Register a Howl instance in the global registry
4
+ * @private
5
+ */
6
+ declare function registerHowlInstance(howl: any): void;
7
+ /**
8
+ * Unregister a Howl instance from the global registry
9
+ * @private
10
+ */
11
+ declare function unregisterHowlInstance(howl: any): void;
12
+ /**
13
+ * Get all active Howl instances (for internal cleanup)
14
+ * @private
15
+ */
16
+ declare function getActiveHowlInstances(): any[];
17
+
18
+ export { getActiveHowlInstances, registerHowlInstance, unregisterHowlInstance };
@@ -0,0 +1 @@
1
+ export{c as getActiveHowlInstances,a as registerHowlInstance,b as unregisterHowlInstance}from'../../chunks/chunk-ZAXZRQYF.js';
@@ -0,0 +1,52 @@
1
+ /// <reference types="emscripten" />
2
+ /**
3
+ * Wrapper for HTML5 audio element with state tracking (similar to Howler.js Sound)
4
+ * Tracks paused, ended, and seek position independently from element state
5
+ * @private
6
+ */
7
+ declare class Html5Sound {
8
+ node: HTMLAudioElement;
9
+ _paused: boolean;
10
+ _ended: boolean;
11
+ _seek: number;
12
+ private onEndedHandler;
13
+ private onPauseHandler;
14
+ private onPlayHandler;
15
+ private onInactive?;
16
+ constructor(src: string, onInactive?: (sound: Html5Sound) => void);
17
+ /**
18
+ * Handle natural playback completion
19
+ * @private
20
+ */
21
+ private onEnded;
22
+ /**
23
+ * Track pause events
24
+ * @private
25
+ */
26
+ private onPause;
27
+ /**
28
+ * Track play events
29
+ * @private
30
+ */
31
+ private onPlay;
32
+ /**
33
+ * Start playback from the beginning, deferred to the next animation frame.
34
+ * Deferring avoids blocking the main thread (critical for smooth overlay
35
+ * rendering during continuous scanning on iOS).
36
+ */
37
+ play(): void;
38
+ /**
39
+ * Pause playback and preserve current position
40
+ */
41
+ pause(): void;
42
+ /**
43
+ * Stop playback and reset to beginning
44
+ */
45
+ stop(): void;
46
+ /**
47
+ * Clean up event listeners (for disposal)
48
+ */
49
+ dispose(): void;
50
+ }
51
+
52
+ export { Html5Sound };
@@ -0,0 +1 @@
1
+ export{a as Html5Sound}from'../../chunks/chunk-AAPD5YU3.js';
@@ -0,0 +1,39 @@
1
+ /// <reference types="emscripten" />
2
+ /**
3
+ * Manages audio unlock state and event listeners
4
+ * Handles setup of user interaction listeners for iOS audio unlock
5
+ * @private
6
+ */
7
+ declare class UnlockManager {
8
+ private setupComplete;
9
+ private handler;
10
+ private readonly events;
11
+ private readonly doc;
12
+ /**
13
+ * Constructor - accepts optional document for dependency injection
14
+ * @param doc - Document object (defaults to global document for browser, undefined for tests)
15
+ */
16
+ constructor(doc?: Document);
17
+ /**
18
+ * Check if unlock setup is complete
19
+ */
20
+ isSetupComplete(): boolean;
21
+ /**
22
+ * Mark setup as complete
23
+ */
24
+ markSetupComplete(): void;
25
+ /**
26
+ * Setup unlock handlers and add event listeners
27
+ */
28
+ setup(handler: EventListener): void;
29
+ /**
30
+ * Reset unlock state (called during disposal/reset)
31
+ */
32
+ reset(): void;
33
+ /**
34
+ * Remove all event listeners
35
+ */
36
+ private removeListeners;
37
+ }
38
+
39
+ export { UnlockManager };
@@ -0,0 +1 @@
1
+ export{a as UnlockManager}from'../../chunks/chunk-LV6LGCDC.js';
@@ -0,0 +1,161 @@
1
+ /// <reference types="emscripten" />
2
+ import { AudioCache } from './AudioCache.js';
3
+
4
+ declare function getAudioCacheInstance(): AudioCache;
5
+ /**
6
+ * Global Web Audio Context manager
7
+ * Manages a single AudioContext instance for efficient audio playback
8
+ *
9
+ * ## iOS Safari Audio Workaround
10
+ *
11
+ * iOS Safari has a known issue where Web Audio API playback may not produce
12
+ * sound on real devices (works fine in simulator). The workaround routes audio
13
+ * through a MediaStreamDestination connected to an HTML5 Audio element:
14
+ *
15
+ * ```
16
+ * AudioBufferSourceNode → GainNode → MediaStreamDestination → HTML5 <audio> → Speakers
17
+ * ```
18
+ *
19
+ * This tricks iOS Safari into treating the audio as a "live stream" (like a video
20
+ * conference), which it allows to play reliably. The HTML5 audio element stays
21
+ * playing continuously, acting as a bridge between Web Audio and the actual speakers.
22
+ *
23
+ * ## Why This Works
24
+ *
25
+ * - iOS Safari blocks standard Web Audio destination output (silently fails)
26
+ * - MediaStreams are treated differently (needed for WebRTC/conferencing)
27
+ * - By routing through MediaStream, iOS allows the audio to reach speakers
28
+ * - Web Audio API still runs off main thread (smooth UI rendering)
29
+ *
30
+ * ## References
31
+ *
32
+ * - Community workaround: https://www.reddit.com/r/webdev/comments/1ldjqa1/comment/mymw7v3/
33
+ * - Used for background audio, PWAs, and continuous scanning scenarios
34
+ */
35
+ declare class WebAudioContextManager {
36
+ private audioContext;
37
+ private isUnlocked;
38
+ private unlockPromise;
39
+ private unlockAttempts;
40
+ private readonly MAX_UNLOCK_ATTEMPTS;
41
+ private lastKnownSampleRate;
42
+ /** iOS-specific: MediaStreamDestination for routing audio */
43
+ private mediaStreamDestination;
44
+ /** iOS-specific: HTML5 audio element that plays the MediaStream */
45
+ private streamAudioElement;
46
+ private handlerStreamAudioElementError;
47
+ private handlerStreamAudioElementPause;
48
+ /**
49
+ * Get the AudioContext (must be created via unlock first on iOS)
50
+ *
51
+ * ## Sample Rate: Native Hardware Rate
52
+ *
53
+ * We let the browser use its native sample rate to prevent pitch shifting:
54
+ *
55
+ * **The Problem with Forcing 44.1kHz:**
56
+ * - iOS may ignore the sampleRate parameter in AudioContext constructor
57
+ * - This creates a mismatch between requested (44.1kHz) and actual sample rate
58
+ * - When AudioContext uses different rate than what we requested, audio plays at wrong pitch
59
+ * - This happens especially on iOS with dynamic audio routing
60
+ *
61
+ * **The Solution:**
62
+ * - Let the browser choose its native sample rate (no sampleRate parameter)
63
+ * - Detect the actual sample rate and remember it
64
+ * - If sample rate changes during session, recreate context to match
65
+ * - Web Audio API automatically resamples audio buffers to match
66
+ * - Sound quality remains identical (transparent resampling)
67
+ *
68
+ * **Why This Works:**
69
+ * - AudioContext will use the hardware's preferred rate
70
+ * - No mismatch between requested and actual rates
71
+ * - Prevents pitch shifting caused by rate mismatches
72
+ * - More stable across different iOS devices and configurations
73
+ */
74
+ getContext(): AudioContext;
75
+ /**
76
+ * Get the audio destination node.
77
+ *
78
+ * On iOS: Returns MediaStreamDestination routed through HTML5 Audio element
79
+ * On other platforms: Returns the standard AudioContext destination
80
+ *
81
+ * ## iOS MediaStreamDestination Workaround
82
+ *
83
+ * Why we need this:
84
+ * - iOS Safari silently blocks Web Audio API output on real devices
85
+ * - The AudioContext reports "running" and source.start() succeeds
86
+ * - But no sound reaches the speakers (works fine in iOS Simulator)
87
+ *
88
+ * The solution:
89
+ * 1. Create a MediaStreamDestination node from the AudioContext
90
+ * 2. Create an HTML5 <audio> element
91
+ * 3. Connect the audio element to the MediaStream via srcObject
92
+ * 4. Start playing the audio element (it plays continuously as a live stream)
93
+ * 5. Route all audio through this destination instead of context.destination
94
+ *
95
+ * Result:
96
+ * - iOS Safari treats this as a "live stream" (like WebRTC)
97
+ * - Live streams are allowed to play reliably on iOS
98
+ * - The <audio> element acts as a bridge to the speakers
99
+ * - Individual sounds play through the stream as they're triggered
100
+ *
101
+ * ## Lifecycle & Resource Management
102
+ *
103
+ * The stream audio element plays continuously for the page lifetime. This is
104
+ * intentional because:
105
+ * - Recreating it requires a user gesture on iOS (can't do on-demand)
106
+ * - Resource usage is minimal when no audio is playing through it
107
+ * - Stopping and restarting could fail due to iOS autoplay restrictions
108
+ *
109
+ * The element can be cleaned up by calling dispose() if needed, but this will
110
+ * require a new user gesture to re-enable audio on iOS.
111
+ *
112
+ * Error handling: If the stream stops or errors unexpectedly, it automatically
113
+ * attempts to restart to maintain audio functionality.
114
+ *
115
+ * @returns AudioDestinationNode (desktop) or MediaStreamAudioDestinationNode (iOS)
116
+ */
117
+ getDestination(): AudioDestinationNode | MediaStreamAudioDestinationNode;
118
+ onStreamAudioElementError(): void;
119
+ onStreamAudioElementPause(): void;
120
+ /**
121
+ * Create AudioContext (must be called synchronously during a user gesture on iOS)
122
+ */
123
+ private createContext;
124
+ /**
125
+ * Unlock audio playback on iOS/mobile during user gesture.
126
+ *
127
+ * ## iOS Safari Requirements
128
+ *
129
+ * iOS Safari requires explicit user interaction before audio can play:
130
+ *
131
+ * 1. **AudioContext must be created during a user gesture**
132
+ * - Creating it later (async) will result in silent playback
133
+ * - Must happen in synchronous event handler (touchstart, click, etc.)
134
+ *
135
+ * 2. **AudioContext.resume() must be called during a user gesture**
136
+ * - Even if state is "running", calling resume() during gesture is required
137
+ * - Must be initiated synchronously (can complete asynchronously)
138
+ *
139
+ * 3. **Actual audio playback must occur during the unlock**
140
+ * - Just creating and resuming context isn't enough
141
+ * - Must play a buffer (even silent) to truly unlock audio
142
+ *
143
+ * ## Implementation Flow
144
+ *
145
+ * 1. User taps screen (event handler runs synchronously)
146
+ * 2. Create AudioContext synchronously
147
+ * 3. Call context.resume() synchronously (completes async)
148
+ * 4. This async method plays a silent scratch buffer
149
+ * 5. On iOS, this creates MediaStreamDestination on first call
150
+ * 6. Mark as unlocked after successful playback
151
+ *
152
+ * @returns Promise that resolves when unlock is complete
153
+ */
154
+ unlock(): Promise<void>;
155
+ /**
156
+ * Get the unlock status
157
+ */
158
+ get unlocked(): boolean;
159
+ }
160
+
161
+ export { WebAudioContextManager, getAudioCacheInstance };
@@ -0,0 +1 @@
1
+ export{c as WebAudioContextManager,a as createAudioContext,b as getAudioCacheInstance}from'../../chunks/chunk-Y3TODCJD.js';
@@ -0,0 +1,28 @@
1
+ /// <reference types="emscripten" />
2
+ /**
3
+ * Debug logging wrapper - only logs when DEBUG is enabled
4
+ *
5
+ * Used for diagnostic information that helps troubleshoot audio issues.
6
+ * These logs are verbose and should not appear in production.
7
+ *
8
+ * ## Build-Time Configuration
9
+ *
10
+ * Enable debug logging by building with:
11
+ * ```bash
12
+ * DEBUG_AUDIO=true npm run build
13
+ * ```
14
+ *
15
+ * ## Debug Symbols
16
+ *
17
+ * - 🎧 Unlock event listener setup
18
+ * - 👆 User interaction detection
19
+ * - 🎵 AudioContext creation
20
+ * - 🔓 Unlock process (context resume, scratch buffer playback)
21
+ * - 🔊 Audio playback state, buffer data, and routing details
22
+ * - ✅ Success indicators
23
+ * - ⚠️ Warnings for potential issues
24
+ * - ❌ Error indicators
25
+ */
26
+ declare const debugLog: CallableFunction | undefined;
27
+
28
+ export { debugLog };
@@ -0,0 +1 @@
1
+ export{a as debugLog}from'../../chunks/chunk-SJIN27Q5.js';
@@ -0,0 +1,2 @@
1
+ /// <reference types="emscripten" />
2
+ export { Howl, HowlOptions } from './Howl.js';
@@ -0,0 +1 @@
1
+ export{a as disposeGlobalAudioContext,c as ensureUnlockSetup,b as resetGlobalAudioContext}from'../../chunks/chunk-6AQGNP4S.js';export{a as Howl}from'../../chunks/chunk-EEWGHHL4.js';