@skodaflow/web-library 8.4.0 → 8.5.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 (238) hide show
  1. package/cjs/components/carousel/Autoplay.js.map +1 -1
  2. package/cjs/components/carousel/Carousel.js +1 -1
  3. package/cjs/components/carousel/Carousel.js.map +1 -1
  4. package/cjs/components/carousel/Navigation.js +1 -1
  5. package/cjs/components/carousel/Navigation.js.map +1 -1
  6. package/cjs/components/carousel/Pagination.js +1 -1
  7. package/cjs/components/carousel/Pagination.js.map +1 -1
  8. package/cjs/components/header/Header.js +1 -1
  9. package/cjs/components/header/Header.js.map +1 -1
  10. package/cjs/components/header/HeaderNavigationHero.js +1 -1
  11. package/cjs/components/header/HeaderNavigationHero.js.map +1 -1
  12. package/cjs/components/header/HeaderNavigationMenu.js +1 -1
  13. package/cjs/components/header/HeaderNavigationMenu.js.map +1 -1
  14. package/cjs/components/hotspotCard/HotspotCard.js +1 -1
  15. package/cjs/components/hotspotCard/HotspotCard.js.map +1 -1
  16. package/cjs/components/icon/stroke/EmissionLabelIcon.js.map +1 -1
  17. package/cjs/components/image/Image.d.ts +38 -14
  18. package/cjs/components/image/Image.js +1 -1
  19. package/cjs/components/image/Image.js.map +1 -1
  20. package/cjs/components/index.d.ts +1 -0
  21. package/cjs/components/label/Label.js.map +1 -1
  22. package/cjs/components/overlay/Overlay.js +1 -1
  23. package/cjs/components/overlay/Overlay.js.map +1 -1
  24. package/cjs/components/video/Video.d.ts +9 -8
  25. package/cjs/components/video/Video.js +1 -1
  26. package/cjs/components/video/Video.js.map +1 -1
  27. package/cjs/components/video/index.d.ts +5 -1
  28. package/cjs/components/video/useVideoFullscreen.d.ts +13 -0
  29. package/cjs/components/video/useVideoFullscreen.js +2 -0
  30. package/cjs/components/video/useVideoFullscreen.js.map +1 -0
  31. package/cjs/components/video/useVideoPlayPause.d.ts +13 -0
  32. package/cjs/components/video/useVideoPlayPause.js +2 -0
  33. package/cjs/components/video/useVideoPlayPause.js.map +1 -0
  34. package/cjs/components/video/useVideoReady.d.ts +6 -0
  35. package/cjs/components/video/useVideoReady.js +2 -0
  36. package/cjs/components/video/useVideoReady.js.map +1 -0
  37. package/cjs/components/video/useVideoSoundControls.d.ts +17 -0
  38. package/cjs/components/video/useVideoSoundControls.js +2 -0
  39. package/cjs/components/video/useVideoSoundControls.js.map +1 -0
  40. package/cjs/components/video/useVideoTime.d.ts +22 -0
  41. package/cjs/components/video/useVideoTime.js +2 -0
  42. package/cjs/components/video/useVideoTime.js.map +1 -0
  43. package/cjs/components/videoPlayer/VideoPlayer.d.ts +125 -0
  44. package/cjs/components/videoPlayer/VideoPlayer.js +2 -0
  45. package/cjs/components/videoPlayer/VideoPlayer.js.map +1 -0
  46. package/cjs/components/videoPlayer/VideoPlayerFullscreenButton.d.ts +31 -0
  47. package/cjs/components/videoPlayer/VideoPlayerFullscreenButton.js +2 -0
  48. package/cjs/components/videoPlayer/VideoPlayerFullscreenButton.js.map +1 -0
  49. package/cjs/components/videoPlayer/VideoPlayerIconButton.d.ts +16 -0
  50. package/cjs/components/videoPlayer/VideoPlayerIconButton.js +2 -0
  51. package/cjs/components/videoPlayer/VideoPlayerIconButton.js.map +1 -0
  52. package/cjs/components/videoPlayer/VideoPlayerPlayPauseButton.d.ts +31 -0
  53. package/cjs/components/videoPlayer/VideoPlayerPlayPauseButton.js +2 -0
  54. package/cjs/components/videoPlayer/VideoPlayerPlayPauseButton.js.map +1 -0
  55. package/cjs/components/videoPlayer/VideoPlayerSkipButton.d.ts +23 -0
  56. package/cjs/components/videoPlayer/VideoPlayerSkipButton.js +2 -0
  57. package/cjs/components/videoPlayer/VideoPlayerSkipButton.js.map +1 -0
  58. package/cjs/components/videoPlayer/VideoPlayerSlider.d.ts +12 -0
  59. package/cjs/components/videoPlayer/VideoPlayerSlider.js +2 -0
  60. package/cjs/components/videoPlayer/VideoPlayerSlider.js.map +1 -0
  61. package/cjs/components/videoPlayer/VideoPlayerSoundButton.d.ts +31 -0
  62. package/cjs/components/videoPlayer/VideoPlayerSoundButton.js +2 -0
  63. package/cjs/components/videoPlayer/VideoPlayerSoundButton.js.map +1 -0
  64. package/cjs/components/videoPlayer/VideoPlayerTime.d.ts +17 -0
  65. package/cjs/components/videoPlayer/VideoPlayerTime.js +2 -0
  66. package/cjs/components/videoPlayer/VideoPlayerTime.js.map +1 -0
  67. package/cjs/components/videoPlayer/formatVideoTime.d.ts +5 -0
  68. package/cjs/components/videoPlayer/formatVideoTime.js +2 -0
  69. package/cjs/components/videoPlayer/formatVideoTime.js.map +1 -0
  70. package/cjs/components/videoPlayer/index.d.ts +10 -0
  71. package/cjs/components/videoPlayer/useVideoPlayerVisibility.d.ts +24 -0
  72. package/cjs/components/videoPlayer/useVideoPlayerVisibility.js +2 -0
  73. package/cjs/components/videoPlayer/useVideoPlayerVisibility.js.map +1 -0
  74. package/cjs/index.js +1 -1
  75. package/cjs/materialui/accordion/AccordionSummaryExpandWrapper.d.ts +5 -1
  76. package/cjs/materialui/accordion/AccordionSummaryExpandWrapper.js +1 -1
  77. package/cjs/materialui/accordion/AccordionSummaryExpandWrapper.js.map +1 -1
  78. package/cjs/materialui/alert/alertTitle.theme.js.map +1 -1
  79. package/cjs/materialui/card/Card.js.map +1 -1
  80. package/cjs/materialui/card/card.theme.js +1 -1
  81. package/cjs/materialui/card/card.theme.js.map +1 -1
  82. package/cjs/materialui/divider/divider.theme.js +1 -1
  83. package/cjs/materialui/divider/divider.theme.js.map +1 -1
  84. package/cjs/materialui/skeleton/skeleton.theme.js +1 -1
  85. package/cjs/materialui/skeleton/skeleton.theme.js.map +1 -1
  86. package/cjs/materialui/slider/slider.theme.js +1 -1
  87. package/cjs/materialui/slider/slider.theme.js.map +1 -1
  88. package/cjs/materialui/table/tablePagination.theme.js.map +1 -1
  89. package/cjs/materialui/tabs/Tab.d.ts +1 -0
  90. package/cjs/materialui/tabs/Tab.js +1 -1
  91. package/cjs/materialui/tabs/Tab.js.map +1 -1
  92. package/cjs/materialui/tabs/TabsScrollButton.d.ts +3 -1
  93. package/cjs/materialui/tabs/TabsScrollButton.js +1 -1
  94. package/cjs/materialui/tabs/TabsScrollButton.js.map +1 -1
  95. package/cjs/materialui/textfield/FormControl.js +1 -1
  96. package/cjs/materialui/textfield/FormControl.js.map +1 -1
  97. package/cjs/materialui/textfield/FormHelperText.js +1 -1
  98. package/cjs/materialui/textfield/FormHelperText.js.map +1 -1
  99. package/cjs/materialui/theme/sxConfig.js.map +1 -1
  100. package/cjs/materialui/theme/theme.extensions.d.ts +29 -0
  101. package/cjs/node_modules/swiper/modules/a11y.js +2 -0
  102. package/cjs/node_modules/swiper/modules/a11y.js.map +1 -0
  103. package/cjs/node_modules/swiper/modules/autoplay.js +1 -1
  104. package/cjs/node_modules/swiper/modules/autoplay.js.map +1 -1
  105. package/cjs/node_modules/swiper/modules/effect-fade.js +1 -1
  106. package/cjs/node_modules/swiper/modules/effect-fade.js.map +1 -1
  107. package/cjs/node_modules/swiper/modules/keyboard.js +1 -1
  108. package/cjs/node_modules/swiper/modules/keyboard.js.map +1 -1
  109. package/cjs/node_modules/swiper/modules/parallax.js +1 -1
  110. package/cjs/node_modules/swiper/modules/parallax.js.map +1 -1
  111. package/cjs/node_modules/swiper/shared/classes-to-selector.js +2 -0
  112. package/cjs/node_modules/swiper/shared/classes-to-selector.js.map +1 -0
  113. package/cjs/node_modules/swiper/shared/effect-init.js +1 -1
  114. package/cjs/node_modules/swiper/shared/effect-init.js.map +1 -1
  115. package/cjs/node_modules/swiper/shared/effect-target.js +1 -1
  116. package/cjs/node_modules/swiper/shared/effect-target.js.map +1 -1
  117. package/cjs/node_modules/swiper/shared/effect-virtual-transition-end.js +1 -1
  118. package/cjs/node_modules/swiper/shared/effect-virtual-transition-end.js.map +1 -1
  119. package/cjs/node_modules/swiper/shared/swiper-core.js +1 -1
  120. package/cjs/node_modules/swiper/shared/swiper-core.js.map +1 -1
  121. package/cjs/node_modules/swiper/shared/update-on-virtual-data.js +1 -1
  122. package/cjs/node_modules/swiper/shared/update-on-virtual-data.js.map +1 -1
  123. package/cjs/node_modules/swiper/shared/update-swiper.js +1 -1
  124. package/cjs/node_modules/swiper/shared/update-swiper.js.map +1 -1
  125. package/cjs/node_modules/swiper/shared/utils.js +1 -1
  126. package/cjs/node_modules/swiper/shared/utils.js.map +1 -1
  127. package/cjs/node_modules/swiper/swiper-react.js +1 -1
  128. package/cjs/node_modules/swiper/swiper-react.js.map +1 -1
  129. package/cjs/package.json +1 -0
  130. package/components/carousel/Autoplay.js.map +1 -1
  131. package/components/carousel/Carousel.js +1 -1
  132. package/components/carousel/Carousel.js.map +1 -1
  133. package/components/carousel/Navigation.js +1 -1
  134. package/components/carousel/Navigation.js.map +1 -1
  135. package/components/carousel/Pagination.js +1 -1
  136. package/components/carousel/Pagination.js.map +1 -1
  137. package/components/header/Header.js +1 -1
  138. package/components/header/Header.js.map +1 -1
  139. package/components/header/HeaderNavigationHero.js +1 -1
  140. package/components/header/HeaderNavigationHero.js.map +1 -1
  141. package/components/header/HeaderNavigationMenu.js +1 -1
  142. package/components/header/HeaderNavigationMenu.js.map +1 -1
  143. package/components/hotspotCard/HotspotCard.js +1 -1
  144. package/components/hotspotCard/HotspotCard.js.map +1 -1
  145. package/components/icon/stroke/EmissionLabelIcon.js.map +1 -1
  146. package/components/image/Image.d.ts +38 -14
  147. package/components/image/Image.js +1 -1
  148. package/components/image/Image.js.map +1 -1
  149. package/components/index.d.ts +1 -0
  150. package/components/label/Label.js.map +1 -1
  151. package/components/overlay/Overlay.js +1 -1
  152. package/components/overlay/Overlay.js.map +1 -1
  153. package/components/video/Video.d.ts +9 -8
  154. package/components/video/Video.js +1 -1
  155. package/components/video/Video.js.map +1 -1
  156. package/components/video/index.d.ts +5 -1
  157. package/components/video/useVideoFullscreen.d.ts +13 -0
  158. package/components/video/useVideoFullscreen.js +2 -0
  159. package/components/video/useVideoFullscreen.js.map +1 -0
  160. package/components/video/useVideoPlayPause.d.ts +13 -0
  161. package/components/video/useVideoPlayPause.js +2 -0
  162. package/components/video/useVideoPlayPause.js.map +1 -0
  163. package/components/video/useVideoReady.d.ts +6 -0
  164. package/components/video/useVideoReady.js +2 -0
  165. package/components/video/useVideoReady.js.map +1 -0
  166. package/components/video/useVideoSoundControls.d.ts +17 -0
  167. package/components/video/useVideoSoundControls.js +2 -0
  168. package/components/video/useVideoSoundControls.js.map +1 -0
  169. package/components/video/useVideoTime.d.ts +22 -0
  170. package/components/video/useVideoTime.js +2 -0
  171. package/components/video/useVideoTime.js.map +1 -0
  172. package/components/videoPlayer/VideoPlayer.d.ts +125 -0
  173. package/components/videoPlayer/VideoPlayer.js +2 -0
  174. package/components/videoPlayer/VideoPlayer.js.map +1 -0
  175. package/components/videoPlayer/VideoPlayerFullscreenButton.d.ts +31 -0
  176. package/components/videoPlayer/VideoPlayerFullscreenButton.js +2 -0
  177. package/components/videoPlayer/VideoPlayerFullscreenButton.js.map +1 -0
  178. package/components/videoPlayer/VideoPlayerIconButton.d.ts +16 -0
  179. package/components/videoPlayer/VideoPlayerIconButton.js +2 -0
  180. package/components/videoPlayer/VideoPlayerIconButton.js.map +1 -0
  181. package/components/videoPlayer/VideoPlayerPlayPauseButton.d.ts +31 -0
  182. package/components/videoPlayer/VideoPlayerPlayPauseButton.js +2 -0
  183. package/components/videoPlayer/VideoPlayerPlayPauseButton.js.map +1 -0
  184. package/components/videoPlayer/VideoPlayerSkipButton.d.ts +23 -0
  185. package/components/videoPlayer/VideoPlayerSkipButton.js +2 -0
  186. package/components/videoPlayer/VideoPlayerSkipButton.js.map +1 -0
  187. package/components/videoPlayer/VideoPlayerSlider.d.ts +12 -0
  188. package/components/videoPlayer/VideoPlayerSlider.js +2 -0
  189. package/components/videoPlayer/VideoPlayerSlider.js.map +1 -0
  190. package/components/videoPlayer/VideoPlayerSoundButton.d.ts +31 -0
  191. package/components/videoPlayer/VideoPlayerSoundButton.js +2 -0
  192. package/components/videoPlayer/VideoPlayerSoundButton.js.map +1 -0
  193. package/components/videoPlayer/VideoPlayerTime.d.ts +17 -0
  194. package/components/videoPlayer/VideoPlayerTime.js +2 -0
  195. package/components/videoPlayer/VideoPlayerTime.js.map +1 -0
  196. package/components/videoPlayer/formatVideoTime.d.ts +5 -0
  197. package/components/videoPlayer/formatVideoTime.js +2 -0
  198. package/components/videoPlayer/formatVideoTime.js.map +1 -0
  199. package/components/videoPlayer/index.d.ts +10 -0
  200. package/components/videoPlayer/useVideoPlayerVisibility.d.ts +24 -0
  201. package/components/videoPlayer/useVideoPlayerVisibility.js +2 -0
  202. package/components/videoPlayer/useVideoPlayerVisibility.js.map +1 -0
  203. package/index.js +1 -1
  204. package/materialui/accordion/AccordionSummaryExpandWrapper.d.ts +5 -1
  205. package/materialui/accordion/AccordionSummaryExpandWrapper.js +1 -1
  206. package/materialui/accordion/AccordionSummaryExpandWrapper.js.map +1 -1
  207. package/materialui/alert/alertTitle.theme.js.map +1 -1
  208. package/materialui/card/Card.js.map +1 -1
  209. package/materialui/card/card.theme.js +1 -1
  210. package/materialui/card/card.theme.js.map +1 -1
  211. package/materialui/divider/divider.theme.js +1 -1
  212. package/materialui/divider/divider.theme.js.map +1 -1
  213. package/materialui/skeleton/skeleton.theme.js +1 -1
  214. package/materialui/skeleton/skeleton.theme.js.map +1 -1
  215. package/materialui/slider/slider.theme.js +1 -1
  216. package/materialui/slider/slider.theme.js.map +1 -1
  217. package/materialui/table/tablePagination.theme.js.map +1 -1
  218. package/materialui/tabs/Tab.d.ts +1 -0
  219. package/materialui/tabs/Tab.js +1 -1
  220. package/materialui/tabs/Tab.js.map +1 -1
  221. package/materialui/tabs/TabsScrollButton.d.ts +3 -1
  222. package/materialui/tabs/TabsScrollButton.js +1 -1
  223. package/materialui/tabs/TabsScrollButton.js.map +1 -1
  224. package/materialui/textfield/FormControl.js +1 -1
  225. package/materialui/textfield/FormControl.js.map +1 -1
  226. package/materialui/textfield/FormHelperText.js +1 -1
  227. package/materialui/textfield/FormHelperText.js.map +1 -1
  228. package/materialui/theme/sxConfig.js.map +1 -1
  229. package/materialui/theme/theme.extensions.d.ts +29 -0
  230. package/package.json +1 -1
  231. package/cjs/components/video/hooks.d.ts +0 -43
  232. package/cjs/components/video/hooks.js +0 -2
  233. package/cjs/components/video/hooks.js.map +0 -1
  234. package/cjs/node_modules/swiper/shared/ssr-window.esm.js +0 -2
  235. package/cjs/node_modules/swiper/shared/ssr-window.esm.js.map +0 -1
  236. package/components/video/hooks.d.ts +0 -43
  237. package/components/video/hooks.js +0 -2
  238. package/components/video/hooks.js.map +0 -1
@@ -319,7 +319,28 @@ declare module '@mui/material/Avatar' {
319
319
  border?: 'auto' | 'on' | 'off';
320
320
  }
321
321
  }
322
+ declare module '@mui/material/Tab' {
323
+ interface TabOwnProps {
324
+ /**
325
+ * Only the selected tab is a tab stop, the others are reached with arrow keys
326
+ * @default false
327
+ */
328
+ rovingTabIndex?: boolean;
329
+ }
330
+ }
322
331
  declare module '@mui/material/Tabs' {
332
+ interface TabsScrollButtonsSlotPropsOverrides {
333
+ /**
334
+ * Label of the button scrolling to the start
335
+ * @default Scroll left
336
+ */
337
+ scrollLeftTitle?: string;
338
+ /**
339
+ * Label of the button scrolling to the end
340
+ * @default Scroll right
341
+ */
342
+ scrollRightTitle?: string;
343
+ }
323
344
  interface TabsOwnProps {
324
345
  /**
325
346
  * Default or rounded buttons variant
@@ -455,6 +476,14 @@ declare module '@mui/material/InputLabel' {
455
476
  'data-variant'?: 'standard' | 'static';
456
477
  }
457
478
  }
479
+ declare module '@mui/material/AccordionSummary' {
480
+ interface AccordionSummaryExpandIconWrapperSlotPropsOverrides {
481
+ /**
482
+ * Properties applied to expand/collapse IconButton
483
+ */
484
+ iconButtonProps?: IconButtonProps;
485
+ }
486
+ }
458
487
  declare module '@mui/material/DialogTitle' {
459
488
  interface DialogTitleOwnProps {
460
489
  /**
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@skodaflow/web-library","version":"8.4.0","description":"Implementation of Skoda Flow Design System with Material UI as core library.","author":"Skoda Auto","license":"SKODA AUTO Library EULA 1.1","peerDependencies":{"@emotion/cache":"^11.14.0","@emotion/react":"^11.14.0","@emotion/styled":"^11.14.1","@mui/material":"^7.3.10 || ^9.0.0","@mui/system":"^7.3.10 || ^9.0.0","@mui/x-date-pickers":"^9.0.0","country-flag-icons":"^1.6.15","react":"^18.3.1 || ^19.2.4","react-dom":"^18.3.1 || ^19.2.4","swiper":"^12.1.3"},"dependencies":{"@skodaflow/web-tokens":"3.2.0","stylis":"4.4.0","stylis-plugin-rtl":"2.1.1","tslib":"2.8.1"},"sideEffects":false,"main":"./cjs/index.js","browser":"./index.js","module":"./index.js","types":"./index.d.ts"}
1
+ {"name":"@skodaflow/web-library","version":"8.5.0","description":"Implementation of Skoda Flow Design System with Material UI as core library.","author":"Skoda Auto","license":"SKODA AUTO Library EULA 1.1","type":"module","peerDependencies":{"@emotion/cache":"^11.14.0","@emotion/react":"^11.14.0","@emotion/styled":"^11.14.1","@mui/material":"^7.3.10 || ^9.0.0","@mui/system":"^7.3.10 || ^9.0.0","@mui/x-date-pickers":"^9.0.0","country-flag-icons":"^1.6.15","react":"^18.3.1 || ^19.2.4","react-dom":"^18.3.1 || ^19.2.4","swiper":"^12.1.3 || ^14.0.0"},"dependencies":{"@skodaflow/web-tokens":"3.2.0","stylis":"4.4.0","stylis-plugin-rtl":"2.1.1","tslib":"2.9.1"},"sideEffects":false,"main":"./cjs/index.js","browser":"./index.js","module":"./index.js","types":"./index.d.ts"}
@@ -1,43 +0,0 @@
1
- import React, { RefObject } from 'react';
2
- interface SoundControls {
3
- /** A boolean indicating if the video is muted. */
4
- isMuted: boolean;
5
- /** handleMuteToggle: A function to toggle the mute state. */
6
- handleMuteToggle: () => void;
7
- /** A number representing the current volume level (0 to 1). */
8
- volume: number;
9
- /** A function to change the volume level. */
10
- handleVolumeChange: (newVolume: number) => void;
11
- }
12
- /**
13
- * A custom hook to manage sound controls (mute and volume) for a video element.
14
- * @param videoRef - A reference to the video element.
15
- */
16
- export declare const useVideoSoundControls: (videoRef: React.RefObject<HTMLVideoElement>) => SoundControls;
17
- interface PlayPause {
18
- /** A boolean indicating if the video is currently playing. */
19
- isPlaying: boolean;
20
- /** A function to toggle between play and pause states. */
21
- handlePlayPause: () => void;
22
- }
23
- /**
24
- * A custom hook to manage play/pause functionality for a video element.
25
- * @param videoRef - A reference to the video element.
26
- */
27
- export declare const useVideoPlayPause: (videoRef: React.RefObject<HTMLVideoElement>) => PlayPause;
28
- interface VideoTime {
29
- /** The current playback time. */
30
- currentTime: number;
31
- /** The total duration of the video. */
32
- duration: number;
33
- /** A function to seek to a specific time. */
34
- handleSeek: (newTime: number) => void;
35
- }
36
- /**
37
- * useVideoTime is a custom React hook designed to manage and synchronize the playback time state
38
- * of a video element with the React component state. It provides an interface to track the current
39
- * playback time, the total duration of the video, and a method to seek to a specific time in the video.
40
- * @param {RefObject<HTMLVideoElement>} videoRef - A reference to the HTML video element.
41
- */
42
- export declare const useVideoTime: (videoRef: RefObject<HTMLVideoElement>) => VideoTime;
43
- export {};
@@ -1,2 +0,0 @@
1
- "use strict";var e=require("react");exports.useVideoPlayPause=t=>{const[r,u]=e.useState(!t.current?.paused);e.useEffect(()=>{const e=t?.current;e&&void 0===r&&u(!e?.paused);const n=()=>{(!e.autoplay||!e.ended)&&u(!0)},a=()=>u(!1);if(e)return e.addEventListener("pause",a),u(!e.paused),e.addEventListener("play",n),()=>{e.removeEventListener("play",n),e.removeEventListener("pause",a)}},[t]);const n=e.useCallback(()=>{t?.current&&(r?t.current.pause():t.current.play().catch(()=>{}),u(e=>!e))},[r,t?.current]);return{isPlaying:r,handlePlayPause:n}},exports.useVideoSoundControls=t=>{const[r,u]=e.useState(t.current?.muted),[n,a]=e.useState(1);e.useEffect(()=>{const e=t?.current;e&&(void 0===r&&u(e?.muted),t.current.muted=r,t.current.volume=n)},[r,n,t]);const s=e.useCallback(()=>{u(e=>!e)},[]),c=e.useCallback(e=>{a(e)},[]);return{isMuted:r,handleMuteToggle:s,volume:n,handleVolumeChange:c}},exports.useVideoTime=t=>{const[r,u]=e.useState(0),[n,a]=e.useState(t.current?.duration),s=e.useCallback(()=>{t.current?.currentTime&&u(t.current.currentTime)},[t]),c=e.useCallback(e=>{t.current?.currentTime&&(t.current.currentTime=e),u(e)},[t]),d=e.useCallback(()=>{t.current?.duration&&a(t.current.duration)},[t]);return e.useEffect(()=>{const e=t?.current;if(e)return e.addEventListener("loadedmetadata",d),e.addEventListener("timeupdate",s),()=>{e.removeEventListener("loadedmetadata",d),e.removeEventListener("timeupdate",s)}},[d,s,t]),{currentTime:r,duration:n,handleSeek:c}};
2
- //# sourceMappingURL=hooks.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hooks.js","sources":["../../../../../src/components/video/hooks.ts"],"sourcesContent":["import React, { useCallback, useEffect, useState, RefObject } from 'react';\n\ninterface SoundControls {\n /** A boolean indicating if the video is muted. */\n isMuted: boolean;\n /** handleMuteToggle: A function to toggle the mute state. */\n handleMuteToggle: () => void;\n /** A number representing the current volume level (0 to 1). */\n volume: number;\n /** A function to change the volume level. */\n handleVolumeChange: (newVolume: number) => void;\n}\n\n/**\n * A custom hook to manage sound controls (mute and volume) for a video element.\n * @param videoRef - A reference to the video element.\n */\nexport const useVideoSoundControls = (videoRef: React.RefObject<HTMLVideoElement>): SoundControls => {\n const [isMuted, setIsMuted] = useState(videoRef.current?.muted);\n const [volume, setVolume] = useState(1);\n\n useEffect(() => {\n const video = videoRef?.current;\n if (video) {\n if (typeof isMuted === 'undefined') {\n setIsMuted(video?.muted);\n }\n\n videoRef.current.muted = isMuted;\n videoRef.current.volume = volume;\n }\n }, [isMuted, volume, videoRef]);\n\n const handleMuteToggle = useCallback(() => {\n setIsMuted((prevMuted) => !prevMuted);\n }, []);\n\n const handleVolumeChange = useCallback((newVolume: number) => {\n setVolume(newVolume);\n }, []);\n\n return {\n isMuted,\n handleMuteToggle,\n volume,\n handleVolumeChange,\n };\n};\n\ninterface PlayPause {\n /** A boolean indicating if the video is currently playing. */\n isPlaying: boolean;\n /** A function to toggle between play and pause states. */\n handlePlayPause: () => void;\n}\n\n/**\n * A custom hook to manage play/pause functionality for a video element.\n * @param videoRef - A reference to the video element.\n */\nexport const useVideoPlayPause = (videoRef: React.RefObject<HTMLVideoElement>): PlayPause => {\n const [isPlaying, setIsPlaying] = useState(!videoRef.current?.paused);\n\n useEffect(() => {\n const video = videoRef?.current;\n\n if (video && typeof isPlaying === 'undefined') {\n setIsPlaying(!video?.paused);\n }\n\n const handlePlay = () => {\n // prevent playing state when autoplay triggers play event on re-entering viewport after video ended\n !(video.autoplay && video.ended) && setIsPlaying(true);\n };\n const handlePause = () => setIsPlaying(false);\n\n if (video) {\n video.addEventListener('pause', handlePause);\n\n // Set initial state (not enough without event listeners due to autoPlay and paused race conditions)\n setIsPlaying(!video.paused);\n\n video.addEventListener('play', handlePlay);\n\n return () => {\n video.removeEventListener('play', handlePlay);\n video.removeEventListener('pause', handlePause);\n };\n }\n }, [videoRef]);\n\n const handlePlayPause = useCallback(() => {\n if (videoRef?.current) {\n if (isPlaying) {\n videoRef.current.pause();\n } else {\n videoRef.current.play().catch(() => {});\n }\n setIsPlaying((prevIsPlaying) => !prevIsPlaying);\n }\n }, [isPlaying, videoRef?.current]);\n\n return {\n isPlaying,\n handlePlayPause,\n };\n};\n\ninterface VideoTime {\n /** The current playback time. */\n currentTime: number;\n /** The total duration of the video. */\n duration: number;\n /** A function to seek to a specific time. */\n handleSeek: (newTime: number) => void;\n}\n\n/**\n * useVideoTime is a custom React hook designed to manage and synchronize the playback time state\n * of a video element with the React component state. It provides an interface to track the current\n * playback time, the total duration of the video, and a method to seek to a specific time in the video.\n * @param {RefObject<HTMLVideoElement>} videoRef - A reference to the HTML video element.\n */\n\nexport const useVideoTime = (videoRef: RefObject<HTMLVideoElement>): VideoTime => {\n const [currentTime, setCurrentTime] = useState(0);\n const [duration, setDuration] = useState(videoRef.current?.duration);\n\n const handleTimeUpdate = useCallback(() => {\n if (videoRef.current?.currentTime) {\n setCurrentTime(videoRef.current.currentTime);\n }\n }, [videoRef]);\n\n const handleSeek = useCallback(\n (newTime: number) => {\n if (videoRef.current?.currentTime) {\n videoRef.current.currentTime = newTime;\n }\n setCurrentTime(newTime);\n },\n [videoRef],\n );\n\n const handleLoadedMetadata = useCallback(() => {\n if (videoRef.current?.duration) {\n setDuration(videoRef.current.duration);\n }\n }, [videoRef]);\n\n useEffect(() => {\n const video = videoRef?.current;\n if (video) {\n video.addEventListener('loadedmetadata', handleLoadedMetadata);\n video.addEventListener('timeupdate', handleTimeUpdate);\n\n return () => {\n video.removeEventListener('loadedmetadata', handleLoadedMetadata);\n video.removeEventListener('timeupdate', handleTimeUpdate);\n };\n }\n }, [handleLoadedMetadata, handleTimeUpdate, videoRef]);\n\n return {\n currentTime,\n duration,\n handleSeek,\n };\n};\n"],"names":["videoRef","isPlaying","setIsPlaying","useState","current","paused","useEffect","video","handlePlay","autoplay","ended","handlePause","addEventListener","removeEventListener","handlePlayPause","useCallback","pause","play","catch","prevIsPlaying","isMuted","setIsMuted","muted","volume","setVolume","handleMuteToggle","prevMuted","handleVolumeChange","newVolume","currentTime","setCurrentTime","duration","setDuration","handleTimeUpdate","handleSeek","newTime","handleLoadedMetadata"],"mappings":"8DA4DkCA,IAChC,MAAOC,EAAWC,GAAgBC,EAAAA,UAAUH,EAASI,SAASC,QAE9DC,EAAAA,UAAU,KACR,MAAMC,EAAQP,GAAUI,QAEpBG,QAA8B,IAAdN,GAClBC,GAAcK,GAAOF,QAGvB,MAAMG,EAAa,OAEfD,EAAME,WAAYF,EAAMG,QAAUR,GAAa,IAE7CS,EAAc,IAAMT,GAAa,GAEvC,GAAIK,EAQF,OAPAA,EAAMK,iBAAiB,QAASD,GAGhCT,GAAcK,EAAMF,QAEpBE,EAAMK,iBAAiB,OAAQJ,GAExB,KACLD,EAAMM,oBAAoB,OAAQL,GAClCD,EAAMM,oBAAoB,QAASF,KAGtC,CAACX,IAEJ,MAAMc,EAAkBC,EAAAA,YAAY,KAC9Bf,GAAUI,UACRH,EACFD,EAASI,QAAQY,QAEjBhB,EAASI,QAAQa,OAAOC,MAAM,QAEhChB,EAAciB,IAAmBA,KAElC,CAAClB,EAAWD,GAAUI,UAEzB,MAAO,CACLH,YACAa,kDAvFkCd,IACpC,MAAOoB,EAASC,GAAclB,EAAAA,SAASH,EAASI,SAASkB,QAClDC,EAAQC,GAAarB,EAAAA,SAAS,GAErCG,EAAAA,UAAU,KACR,MAAMC,EAAQP,GAAUI,QACpBG,SACqB,IAAZa,GACTC,EAAWd,GAAOe,OAGpBtB,EAASI,QAAQkB,MAAQF,EACzBpB,EAASI,QAAQmB,OAASA,IAE3B,CAACH,EAASG,EAAQvB,IAErB,MAAMyB,EAAmBV,EAAAA,YAAY,KACnCM,EAAYK,IAAeA,IAC1B,IAEGC,EAAqBZ,cAAaa,IACtCJ,EAAUI,IACT,IAEH,MAAO,CACLR,UACAK,mBACAF,SACAI,4CA+EyB3B,IAC3B,MAAO6B,EAAaC,GAAkB3B,EAAAA,SAAS,IACxC4B,EAAUC,GAAe7B,EAAAA,SAASH,EAASI,SAAS2B,UAErDE,EAAmBlB,EAAAA,YAAY,KAC/Bf,EAASI,SAASyB,aACpBC,EAAe9B,EAASI,QAAQyB,cAEjC,CAAC7B,IAEEkC,EAAanB,cAChBoB,IACKnC,EAASI,SAASyB,cACpB7B,EAASI,QAAQyB,YAAcM,GAEjCL,EAAeK,IAEjB,CAACnC,IAGGoC,EAAuBrB,EAAAA,YAAY,KACnCf,EAASI,SAAS2B,UACpBC,EAAYhC,EAASI,QAAQ2B,WAE9B,CAAC/B,IAeJ,OAbAM,EAAAA,UAAU,KACR,MAAMC,EAAQP,GAAUI,QACxB,GAAIG,EAIF,OAHAA,EAAMK,iBAAiB,iBAAkBwB,GACzC7B,EAAMK,iBAAiB,aAAcqB,GAE9B,KACL1B,EAAMM,oBAAoB,iBAAkBuB,GAC5C7B,EAAMM,oBAAoB,aAAcoB,KAG3C,CAACG,EAAsBH,EAAkBjC,IAErC,CACL6B,cACAE,WACAG"}
@@ -1,2 +0,0 @@
1
- "use strict";function e(e){return null!==e&&"object"==typeof e&&"constructor"in e&&e.constructor===Object}function t(n={},o={}){const r=["__proto__","constructor","prototype"];Object.keys(o).filter(e=>r.indexOf(e)<0).forEach(r=>{void 0===n[r]?n[r]=o[r]:e(o[r])&&e(n[r])&&Object.keys(o[r]).length>0&&t(n[r],o[r])})}const n={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector:()=>null,querySelectorAll:()=>[],getElementById:()=>null,createEvent:()=>({initEvent(){}}),createElement:()=>({children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName:()=>[]}),createElementNS:()=>({}),importNode:()=>null,location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};const o={document:n,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function(){return this},addEventListener(){},removeEventListener(){},getComputedStyle:()=>({getPropertyValue:()=>""}),Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia:()=>({}),requestAnimationFrame:e=>"undefined"==typeof setTimeout?(e(),null):setTimeout(e,0),cancelAnimationFrame(e){"undefined"!=typeof setTimeout&&clearTimeout(e)}};exports.a=function(){const e="undefined"!=typeof window?window:{};return t(e,o),e},exports.g=function(){const e="undefined"!=typeof document?document:{};return t(e,n),e};
2
- //# sourceMappingURL=ssr-window.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ssr-window.esm.js","sources":["../../../../../node_modules/swiper/shared/ssr-window.esm.mjs"],"sourcesContent":["/**\n * SSR Window 5.0.1\n * Better handling for window object in SSR environment\n * https://github.com/nolimits4web/ssr-window\n *\n * Copyright 2025, Vladimir Kharlampidi\n *\n * Licensed under MIT\n *\n * Released on: June 27, 2025\n */\n/* eslint-disable no-param-reassign */\nfunction isObject(obj) {\n return obj !== null && typeof obj === 'object' && 'constructor' in obj && obj.constructor === Object;\n}\nfunction extend(target = {}, src = {}) {\n const noExtend = ['__proto__', 'constructor', 'prototype'];\n Object.keys(src).filter(key => noExtend.indexOf(key) < 0).forEach(key => {\n if (typeof target[key] === 'undefined') target[key] = src[key];else if (isObject(src[key]) && isObject(target[key]) && Object.keys(src[key]).length > 0) {\n extend(target[key], src[key]);\n }\n });\n}\nconst ssrDocument = {\n body: {},\n addEventListener() {},\n removeEventListener() {},\n activeElement: {\n blur() {},\n nodeName: ''\n },\n querySelector() {\n return null;\n },\n querySelectorAll() {\n return [];\n },\n getElementById() {\n return null;\n },\n createEvent() {\n return {\n initEvent() {}\n };\n },\n createElement() {\n return {\n children: [],\n childNodes: [],\n style: {},\n setAttribute() {},\n getElementsByTagName() {\n return [];\n }\n };\n },\n createElementNS() {\n return {};\n },\n importNode() {\n return null;\n },\n location: {\n hash: '',\n host: '',\n hostname: '',\n href: '',\n origin: '',\n pathname: '',\n protocol: '',\n search: ''\n }\n};\nfunction getDocument() {\n const doc = typeof document !== 'undefined' ? document : {};\n extend(doc, ssrDocument);\n return doc;\n}\nconst ssrWindow = {\n document: ssrDocument,\n navigator: {\n userAgent: ''\n },\n location: {\n hash: '',\n host: '',\n hostname: '',\n href: '',\n origin: '',\n pathname: '',\n protocol: '',\n search: ''\n },\n history: {\n replaceState() {},\n pushState() {},\n go() {},\n back() {}\n },\n CustomEvent: function CustomEvent() {\n return this;\n },\n addEventListener() {},\n removeEventListener() {},\n getComputedStyle() {\n return {\n getPropertyValue() {\n return '';\n }\n };\n },\n Image() {},\n Date() {},\n screen: {},\n setTimeout() {},\n clearTimeout() {},\n matchMedia() {\n return {};\n },\n requestAnimationFrame(callback) {\n if (typeof setTimeout === 'undefined') {\n callback();\n return null;\n }\n return setTimeout(callback, 0);\n },\n cancelAnimationFrame(id) {\n if (typeof setTimeout === 'undefined') {\n return;\n }\n clearTimeout(id);\n }\n};\nfunction getWindow() {\n const win = typeof window !== 'undefined' ? window : {};\n extend(win, ssrWindow);\n return win;\n}\n\nexport { getWindow as a, getDocument as g };\n"],"names":["isObject","obj","constructor","Object","extend","target","src","noExtend","keys","filter","key","indexOf","forEach","length","ssrDocument","body","addEventListener","removeEventListener","activeElement","blur","nodeName","querySelector","querySelectorAll","getElementById","createEvent","initEvent","createElement","children","childNodes","style","setAttribute","getElementsByTagName","createElementNS","importNode","location","hash","host","hostname","href","origin","pathname","protocol","search","ssrWindow","document","navigator","userAgent","history","replaceState","pushState","go","back","CustomEvent","this","getComputedStyle","getPropertyValue","Image","Date","screen","setTimeout","clearTimeout","matchMedia","requestAnimationFrame","callback","cancelAnimationFrame","id","win","window","doc"],"mappings":"aAYA,SAASA,EAASC,GAChB,OAAe,OAARA,GAA+B,iBAARA,GAAoB,gBAAiBA,GAAOA,EAAIC,cAAgBC,MAChG,CACA,SAASC,EAAOC,EAAS,GAAIC,EAAM,CAAA,GACjC,MAAMC,EAAW,CAAC,YAAa,cAAe,aAC9CJ,OAAOK,KAAKF,GAAKG,OAAOC,GAAOH,EAASI,QAAQD,GAAO,GAAGE,QAAQF,SACrC,IAAhBL,EAAOK,GAAsBL,EAAOK,GAAOJ,EAAII,GAAcV,EAASM,EAAII,KAASV,EAASK,EAAOK,KAASP,OAAOK,KAAKF,EAAII,IAAMG,OAAS,GACpJT,EAAOC,EAAOK,GAAMJ,EAAII,KAG9B,CACA,MAAMI,EAAc,CAClBC,KAAM,CAAA,EACN,gBAAAC,GAAoB,EACpB,mBAAAC,GAAuB,EACvBC,cAAe,CACb,IAAAC,GAAQ,EACRC,SAAU,IAEZC,cAAa,IACJ,KAETC,iBAAgB,IACP,GAETC,eAAc,IACL,KAETC,YAAW,KACF,CACL,SAAAC,GAAa,IAGjBC,cAAa,KACJ,CACLC,SAAU,GACVC,WAAY,GACZC,MAAO,CAAA,EACP,YAAAC,GAAgB,EAChBC,qBAAoB,IACX,KAIbC,gBAAe,KACN,CAAA,GAETC,WAAU,IACD,KAETC,SAAU,CACRC,KAAM,GACNC,KAAM,GACNC,SAAU,GACVC,KAAM,GACNC,OAAQ,GACRC,SAAU,GACVC,SAAU,GACVC,OAAQ,KAQZ,MAAMC,EAAY,CAChBC,SAAU9B,EACV+B,UAAW,CACTC,UAAW,IAEbZ,SAAU,CACRC,KAAM,GACNC,KAAM,GACNC,SAAU,GACVC,KAAM,GACNC,OAAQ,GACRC,SAAU,GACVC,SAAU,GACVC,OAAQ,IAEVK,QAAS,CACP,YAAAC,GAAgB,EAChB,SAAAC,GAAa,EACb,EAAAC,GAAM,EACN,IAAAC,GAAQ,GAEVC,YAAa,WACX,OAAOC,IACT,EACA,gBAAArC,GAAoB,EACpB,mBAAAC,GAAuB,EACvBqC,iBAAgB,KACP,CACLC,iBAAgB,IACP,KAIb,KAAAC,GAAS,EACT,IAAAC,GAAQ,EACRC,OAAQ,CAAA,EACR,UAAAC,GAAc,EACd,YAAAC,GAAgB,EAChBC,WAAU,KACD,CAAA,GAETC,sBAAsBC,GACM,oBAAfJ,YACTI,IACO,MAEFJ,WAAWI,EAAU,GAE9B,oBAAAC,CAAqBC,GACO,oBAAfN,YAGXC,aAAaK,EACf,aAEF,WACE,MAAMC,EAAwB,oBAAXC,OAAyBA,OAAS,CAAA,EAErD,OADA/D,EAAO8D,EAAKvB,GACLuB,CACT,YAhEA,WACE,MAAME,EAA0B,oBAAbxB,SAA2BA,SAAW,CAAA,EAEzD,OADAxC,EAAOgE,EAAKtD,GACLsD,CACT","x_google_ignoreList":[0]}
@@ -1,43 +0,0 @@
1
- import React, { RefObject } from 'react';
2
- interface SoundControls {
3
- /** A boolean indicating if the video is muted. */
4
- isMuted: boolean;
5
- /** handleMuteToggle: A function to toggle the mute state. */
6
- handleMuteToggle: () => void;
7
- /** A number representing the current volume level (0 to 1). */
8
- volume: number;
9
- /** A function to change the volume level. */
10
- handleVolumeChange: (newVolume: number) => void;
11
- }
12
- /**
13
- * A custom hook to manage sound controls (mute and volume) for a video element.
14
- * @param videoRef - A reference to the video element.
15
- */
16
- export declare const useVideoSoundControls: (videoRef: React.RefObject<HTMLVideoElement>) => SoundControls;
17
- interface PlayPause {
18
- /** A boolean indicating if the video is currently playing. */
19
- isPlaying: boolean;
20
- /** A function to toggle between play and pause states. */
21
- handlePlayPause: () => void;
22
- }
23
- /**
24
- * A custom hook to manage play/pause functionality for a video element.
25
- * @param videoRef - A reference to the video element.
26
- */
27
- export declare const useVideoPlayPause: (videoRef: React.RefObject<HTMLVideoElement>) => PlayPause;
28
- interface VideoTime {
29
- /** The current playback time. */
30
- currentTime: number;
31
- /** The total duration of the video. */
32
- duration: number;
33
- /** A function to seek to a specific time. */
34
- handleSeek: (newTime: number) => void;
35
- }
36
- /**
37
- * useVideoTime is a custom React hook designed to manage and synchronize the playback time state
38
- * of a video element with the React component state. It provides an interface to track the current
39
- * playback time, the total duration of the video, and a method to seek to a specific time in the video.
40
- * @param {RefObject<HTMLVideoElement>} videoRef - A reference to the HTML video element.
41
- */
42
- export declare const useVideoTime: (videoRef: RefObject<HTMLVideoElement>) => VideoTime;
43
- export {};
@@ -1,2 +0,0 @@
1
- import{useState as e,useEffect as r,useCallback as t}from"react";const n=n=>{const[u,a]=e(n.current?.muted),[c,d]=e(1);r(()=>{const e=n?.current;e&&(void 0===u&&a(e?.muted),n.current.muted=u,n.current.volume=c)},[u,c,n]);const o=t(()=>{a(e=>!e)},[]),i=t(e=>{d(e)},[]);return{isMuted:u,handleMuteToggle:o,volume:c,handleVolumeChange:i}},u=n=>{const[u,a]=e(!n.current?.paused);r(()=>{const e=n?.current;e&&void 0===u&&a(!e?.paused);const r=()=>{(!e.autoplay||!e.ended)&&a(!0)},t=()=>a(!1);if(e)return e.addEventListener("pause",t),a(!e.paused),e.addEventListener("play",r),()=>{e.removeEventListener("play",r),e.removeEventListener("pause",t)}},[n]);const c=t(()=>{n?.current&&(u?n.current.pause():n.current.play().catch(()=>{}),a(e=>!e))},[u,n?.current]);return{isPlaying:u,handlePlayPause:c}},a=n=>{const[u,a]=e(0),[c,d]=e(n.current?.duration),o=t(()=>{n.current?.currentTime&&a(n.current.currentTime)},[n]),i=t(e=>{n.current?.currentTime&&(n.current.currentTime=e),a(e)},[n]),s=t(()=>{n.current?.duration&&d(n.current.duration)},[n]);return r(()=>{const e=n?.current;if(e)return e.addEventListener("loadedmetadata",s),e.addEventListener("timeupdate",o),()=>{e.removeEventListener("loadedmetadata",s),e.removeEventListener("timeupdate",o)}},[s,o,n]),{currentTime:u,duration:c,handleSeek:i}};export{u as useVideoPlayPause,n as useVideoSoundControls,a as useVideoTime};
2
- //# sourceMappingURL=hooks.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hooks.js","sources":["../../../src/components/video/hooks.ts"],"sourcesContent":["import React, { useCallback, useEffect, useState, RefObject } from 'react';\n\ninterface SoundControls {\n /** A boolean indicating if the video is muted. */\n isMuted: boolean;\n /** handleMuteToggle: A function to toggle the mute state. */\n handleMuteToggle: () => void;\n /** A number representing the current volume level (0 to 1). */\n volume: number;\n /** A function to change the volume level. */\n handleVolumeChange: (newVolume: number) => void;\n}\n\n/**\n * A custom hook to manage sound controls (mute and volume) for a video element.\n * @param videoRef - A reference to the video element.\n */\nexport const useVideoSoundControls = (videoRef: React.RefObject<HTMLVideoElement>): SoundControls => {\n const [isMuted, setIsMuted] = useState(videoRef.current?.muted);\n const [volume, setVolume] = useState(1);\n\n useEffect(() => {\n const video = videoRef?.current;\n if (video) {\n if (typeof isMuted === 'undefined') {\n setIsMuted(video?.muted);\n }\n\n videoRef.current.muted = isMuted;\n videoRef.current.volume = volume;\n }\n }, [isMuted, volume, videoRef]);\n\n const handleMuteToggle = useCallback(() => {\n setIsMuted((prevMuted) => !prevMuted);\n }, []);\n\n const handleVolumeChange = useCallback((newVolume: number) => {\n setVolume(newVolume);\n }, []);\n\n return {\n isMuted,\n handleMuteToggle,\n volume,\n handleVolumeChange,\n };\n};\n\ninterface PlayPause {\n /** A boolean indicating if the video is currently playing. */\n isPlaying: boolean;\n /** A function to toggle between play and pause states. */\n handlePlayPause: () => void;\n}\n\n/**\n * A custom hook to manage play/pause functionality for a video element.\n * @param videoRef - A reference to the video element.\n */\nexport const useVideoPlayPause = (videoRef: React.RefObject<HTMLVideoElement>): PlayPause => {\n const [isPlaying, setIsPlaying] = useState(!videoRef.current?.paused);\n\n useEffect(() => {\n const video = videoRef?.current;\n\n if (video && typeof isPlaying === 'undefined') {\n setIsPlaying(!video?.paused);\n }\n\n const handlePlay = () => {\n // prevent playing state when autoplay triggers play event on re-entering viewport after video ended\n !(video.autoplay && video.ended) && setIsPlaying(true);\n };\n const handlePause = () => setIsPlaying(false);\n\n if (video) {\n video.addEventListener('pause', handlePause);\n\n // Set initial state (not enough without event listeners due to autoPlay and paused race conditions)\n setIsPlaying(!video.paused);\n\n video.addEventListener('play', handlePlay);\n\n return () => {\n video.removeEventListener('play', handlePlay);\n video.removeEventListener('pause', handlePause);\n };\n }\n }, [videoRef]);\n\n const handlePlayPause = useCallback(() => {\n if (videoRef?.current) {\n if (isPlaying) {\n videoRef.current.pause();\n } else {\n videoRef.current.play().catch(() => {});\n }\n setIsPlaying((prevIsPlaying) => !prevIsPlaying);\n }\n }, [isPlaying, videoRef?.current]);\n\n return {\n isPlaying,\n handlePlayPause,\n };\n};\n\ninterface VideoTime {\n /** The current playback time. */\n currentTime: number;\n /** The total duration of the video. */\n duration: number;\n /** A function to seek to a specific time. */\n handleSeek: (newTime: number) => void;\n}\n\n/**\n * useVideoTime is a custom React hook designed to manage and synchronize the playback time state\n * of a video element with the React component state. It provides an interface to track the current\n * playback time, the total duration of the video, and a method to seek to a specific time in the video.\n * @param {RefObject<HTMLVideoElement>} videoRef - A reference to the HTML video element.\n */\n\nexport const useVideoTime = (videoRef: RefObject<HTMLVideoElement>): VideoTime => {\n const [currentTime, setCurrentTime] = useState(0);\n const [duration, setDuration] = useState(videoRef.current?.duration);\n\n const handleTimeUpdate = useCallback(() => {\n if (videoRef.current?.currentTime) {\n setCurrentTime(videoRef.current.currentTime);\n }\n }, [videoRef]);\n\n const handleSeek = useCallback(\n (newTime: number) => {\n if (videoRef.current?.currentTime) {\n videoRef.current.currentTime = newTime;\n }\n setCurrentTime(newTime);\n },\n [videoRef],\n );\n\n const handleLoadedMetadata = useCallback(() => {\n if (videoRef.current?.duration) {\n setDuration(videoRef.current.duration);\n }\n }, [videoRef]);\n\n useEffect(() => {\n const video = videoRef?.current;\n if (video) {\n video.addEventListener('loadedmetadata', handleLoadedMetadata);\n video.addEventListener('timeupdate', handleTimeUpdate);\n\n return () => {\n video.removeEventListener('loadedmetadata', handleLoadedMetadata);\n video.removeEventListener('timeupdate', handleTimeUpdate);\n };\n }\n }, [handleLoadedMetadata, handleTimeUpdate, videoRef]);\n\n return {\n currentTime,\n duration,\n handleSeek,\n };\n};\n"],"names":["useVideoSoundControls","videoRef","isMuted","setIsMuted","useState","current","muted","volume","setVolume","useEffect","video","handleMuteToggle","useCallback","prevMuted","handleVolumeChange","newVolume","useVideoPlayPause","isPlaying","setIsPlaying","paused","handlePlay","autoplay","ended","handlePause","addEventListener","removeEventListener","handlePlayPause","pause","play","catch","prevIsPlaying","useVideoTime","currentTime","setCurrentTime","duration","setDuration","handleTimeUpdate","handleSeek","newTime","handleLoadedMetadata"],"mappings":"iEAiBO,MAAMA,EAAyBC,IACpC,MAAOC,EAASC,GAAcC,EAASH,EAASI,SAASC,QAClDC,EAAQC,GAAaJ,EAAS,GAErCK,EAAU,KACR,MAAMC,EAAQT,GAAUI,QACpBK,SACqB,IAAZR,GACTC,EAAWO,GAAOJ,OAGpBL,EAASI,QAAQC,MAAQJ,EACzBD,EAASI,QAAQE,OAASA,IAE3B,CAACL,EAASK,EAAQN,IAErB,MAAMU,EAAmBC,EAAY,KACnCT,EAAYU,IAAeA,IAC1B,IAEGC,EAAqBF,EAAaG,IACtCP,EAAUO,IACT,IAEH,MAAO,CACLb,UACAS,mBACAJ,SACAO,uBAeSE,EAAqBf,IAChC,MAAOgB,EAAWC,GAAgBd,GAAUH,EAASI,SAASc,QAE9DV,EAAU,KACR,MAAMC,EAAQT,GAAUI,QAEpBK,QAA8B,IAAdO,GAClBC,GAAcR,GAAOS,QAGvB,MAAMC,EAAa,OAEfV,EAAMW,WAAYX,EAAMY,QAAUJ,GAAa,IAE7CK,EAAc,IAAML,GAAa,GAEvC,GAAIR,EAQF,OAPAA,EAAMc,iBAAiB,QAASD,GAGhCL,GAAcR,EAAMS,QAEpBT,EAAMc,iBAAiB,OAAQJ,GAExB,KACLV,EAAMe,oBAAoB,OAAQL,GAClCV,EAAMe,oBAAoB,QAASF,KAGtC,CAACtB,IAEJ,MAAMyB,EAAkBd,EAAY,KAC9BX,GAAUI,UACRY,EACFhB,EAASI,QAAQsB,QAEjB1B,EAASI,QAAQuB,OAAOC,MAAM,QAEhCX,EAAcY,IAAmBA,KAElC,CAACb,EAAWhB,GAAUI,UAEzB,MAAO,CACLY,YACAS,oBAoBSK,EAAgB9B,IAC3B,MAAO+B,EAAaC,GAAkB7B,EAAS,IACxC8B,EAAUC,GAAe/B,EAASH,EAASI,SAAS6B,UAErDE,EAAmBxB,EAAY,KAC/BX,EAASI,SAAS2B,aACpBC,EAAehC,EAASI,QAAQ2B,cAEjC,CAAC/B,IAEEoC,EAAazB,EAChB0B,IACKrC,EAASI,SAAS2B,cACpB/B,EAASI,QAAQ2B,YAAcM,GAEjCL,EAAeK,IAEjB,CAACrC,IAGGsC,EAAuB3B,EAAY,KACnCX,EAASI,SAAS6B,UACpBC,EAAYlC,EAASI,QAAQ6B,WAE9B,CAACjC,IAeJ,OAbAQ,EAAU,KACR,MAAMC,EAAQT,GAAUI,QACxB,GAAIK,EAIF,OAHAA,EAAMc,iBAAiB,iBAAkBe,GACzC7B,EAAMc,iBAAiB,aAAcY,GAE9B,KACL1B,EAAMe,oBAAoB,iBAAkBc,GAC5C7B,EAAMe,oBAAoB,aAAcW,KAG3C,CAACG,EAAsBH,EAAkBnC,IAErC,CACL+B,cACAE,WACAG"}