@layers-app/shared 0.4.7 → 0.4.8

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 (378) hide show
  1. package/dist/assets/default-workspace-avatar.jpg.js +1 -1
  2. package/dist/components/AliasTextInput/AliasTextInput.d.ts.map +1 -1
  3. package/dist/components/AliasTextInput/AliasTextInput.js +32 -32
  4. package/dist/components/AnimatedFigurePage/AnimatedFigurePage.module.css.js +13 -13
  5. package/dist/components/AppContainer/AppContainer.d.ts +1 -1
  6. package/dist/components/AppContainer/AppContainer.d.ts.map +1 -1
  7. package/dist/components/AppContainer/AppContainer.js +76 -71
  8. package/dist/components/AppContainer/AppContainer.module.css.js +14 -14
  9. package/dist/components/AppContainer/components/AppsSidebar/TopSection.d.ts.map +1 -1
  10. package/dist/components/AppContainer/components/AppsSidebar/TopSection.js +77 -49
  11. package/dist/components/AppContainer/components/NavbarContent.d.ts.map +1 -1
  12. package/dist/components/AppContainer/components/NavbarContent.js +16 -2
  13. package/dist/components/AppContainer/components/ToolSidebar.d.ts +5 -0
  14. package/dist/components/AppContainer/components/ToolSidebar.d.ts.map +1 -1
  15. package/dist/components/AppContainer/components/ToolSidebar.js +42 -30
  16. package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.module.css.js +90 -90
  17. package/dist/components/AppContainer/types.d.ts +12 -0
  18. package/dist/components/AppContainer/types.d.ts.map +1 -1
  19. package/dist/components/AppShell/AppShell.module.css.js +5 -5
  20. package/dist/components/AttachmentsGalleryModal/AttachmentsGalleryContext.d.ts +0 -2
  21. package/dist/components/AttachmentsGalleryModal/AttachmentsGalleryContext.d.ts.map +1 -1
  22. package/dist/components/AttachmentsGalleryModal/AttachmentsGalleryContext.js +17 -22
  23. package/dist/components/AttachmentsGalleryModal/components/GallerySlide.js +22 -22
  24. package/dist/components/AttachmentsGalleryModal/components/ModalHeader.d.ts.map +1 -1
  25. package/dist/components/AttachmentsGalleryModal/components/ModalHeader.js +120 -172
  26. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.module.css.js +4 -4
  27. package/dist/components/AttachmentsGalleryModal/styles.module.css.js +28 -32
  28. package/dist/components/AttachmentsPreview/AttachmentsPreview.d.ts +3 -1
  29. package/dist/components/AttachmentsPreview/AttachmentsPreview.d.ts.map +1 -1
  30. package/dist/components/AttachmentsPreview/AttachmentsPreview.js +237 -93
  31. package/dist/components/AttachmentsPreview/AttachmentsPreview.module.css.js +22 -20
  32. package/dist/components/BouncingLogo/BouncingLogo.module.css.js +4 -4
  33. package/dist/components/Chat/CallMessage/CallMessage.module.css.js +8 -8
  34. package/dist/components/Chat/ChatBubble/ChatBubble.module.css.js +1 -1
  35. package/dist/components/Chat/ChatHeader/ChatHeader.module.css.js +1 -1
  36. package/dist/components/Chat/ChatInput/ChatInput.module.css.js +44 -44
  37. package/dist/components/Chat/ChatInput/index.d.ts +13 -1
  38. package/dist/components/Chat/ChatInput/index.d.ts.map +1 -1
  39. package/dist/components/Chat/ChatInput/index.js +264 -164
  40. package/dist/components/Chat/ChatInput/useVoiceRecorder.d.ts +16 -0
  41. package/dist/components/Chat/ChatInput/useVoiceRecorder.d.ts.map +1 -0
  42. package/dist/components/Chat/ChatInput/useVoiceRecorder.js +83 -0
  43. package/dist/components/Chat/ChatLayout/ChatLayout.module.css.js +4 -4
  44. package/dist/components/Chat/ChatMessage/ChatMessage.module.css.js +20 -16
  45. package/dist/components/Chat/ChatMessage/index.d.ts +16 -0
  46. package/dist/components/Chat/ChatMessage/index.d.ts.map +1 -1
  47. package/dist/components/Chat/ChatMessage/index.js +153 -118
  48. package/dist/components/Chat/ChatPill/ChatPill.module.css.js +1 -1
  49. package/dist/components/Chat/DialogItem/DialogItem.module.css.js +4 -4
  50. package/dist/components/Chat/DialogList/DialogList.module.css.js +1 -1
  51. package/dist/components/Chat/MediaDocument/MediaDocument.module.css.js +4 -4
  52. package/dist/components/Chat/MessageActions/MessageActions.module.css.js +1 -1
  53. package/dist/components/Chat/MessageActions/index.d.ts +2 -0
  54. package/dist/components/Chat/MessageActions/index.d.ts.map +1 -1
  55. package/dist/components/Chat/MessageActions/index.js +188 -50
  56. package/dist/components/Chat/MessageAuthor/index.d.ts +7 -1
  57. package/dist/components/Chat/MessageAuthor/index.d.ts.map +1 -1
  58. package/dist/components/Chat/MessageAuthor/index.js +39 -25
  59. package/dist/components/Chat/MessageForward/MessageForward.module.css.js +1 -1
  60. package/dist/components/Chat/MessageList/MessageList.module.css.js +14 -12
  61. package/dist/components/Chat/MessageList/index.d.ts +17 -25
  62. package/dist/components/Chat/MessageList/index.d.ts.map +1 -1
  63. package/dist/components/Chat/MessageList/index.js +201 -149
  64. package/dist/components/Chat/MessageMeta/MessageMeta.module.css.js +3 -3
  65. package/dist/components/Chat/MessageReactions/MessageReactions.module.css.js +12 -12
  66. package/dist/components/Chat/MessageReply/MessageReply.module.css.js +7 -7
  67. package/dist/components/Chat/MessageStatus/MessageStatus.module.css.js +8 -8
  68. package/dist/components/Chat/ServiceMessage/ServiceMessage.module.css.js +1 -1
  69. package/dist/components/CollapsibleContainer/CollapsibleContainer.module.css.js +1 -1
  70. package/dist/components/ColorPicker/ColorPicker.module.css.js +32 -26
  71. package/dist/components/ColorPicker/ColorPickerList.d.ts.map +1 -1
  72. package/dist/components/ColorPicker/ColorPickerList.js +83 -72
  73. package/dist/components/ColorPicker/ColorPickerToolbar.d.ts +1 -0
  74. package/dist/components/ColorPicker/ColorPickerToolbar.d.ts.map +1 -1
  75. package/dist/components/ColorPicker/ColorPickerToolbar.js +94 -85
  76. package/dist/components/ColorPicker/icons.js +5 -5
  77. package/dist/components/ColorPicker/types.d.ts +6 -0
  78. package/dist/components/ColorPicker/types.d.ts.map +1 -1
  79. package/dist/components/ColorPicker/types.js +53 -11
  80. package/dist/components/ColorPicker/useRecentColors.d.ts +3 -1
  81. package/dist/components/ColorPicker/useRecentColors.d.ts.map +1 -1
  82. package/dist/components/ColorPicker/useRecentColors.js +43 -20
  83. package/dist/components/CommentComposer/CommentComposer.module.css.js +4 -4
  84. package/dist/components/CommentComposer/CommentEditorHotkeys.d.ts +2 -1
  85. package/dist/components/CommentComposer/CommentEditorHotkeys.d.ts.map +1 -1
  86. package/dist/components/CommentComposer/CommentEditorHotkeys.js +29 -26
  87. package/dist/components/CommentComposer/index.d.ts +1 -1
  88. package/dist/components/CommentComposer/index.d.ts.map +1 -1
  89. package/dist/components/CommentComposer/index.js +70 -68
  90. package/dist/components/CommentComposer/types.d.ts +6 -0
  91. package/dist/components/CommentComposer/types.d.ts.map +1 -1
  92. package/dist/components/CommunitiesDialog/styles.module.css.js +1 -1
  93. package/dist/components/Copyright/Copyright.module.css.js +1 -1
  94. package/dist/components/CustomKBD/CustomKBD.module.css.js +1 -1
  95. package/dist/components/CustomKBD/index.js +21 -22
  96. package/dist/components/EmojiPicker/EmojiPicker.d.ts +1 -0
  97. package/dist/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
  98. package/dist/components/EmojiPicker/EmojiPicker.js +129 -121
  99. package/dist/components/EmojiPicker/EmojiPicker.module.css.js +8 -8
  100. package/dist/components/EntityTitle/EntityTitle.d.ts +3 -4
  101. package/dist/components/EntityTitle/EntityTitle.d.ts.map +1 -1
  102. package/dist/components/EntityTitle/EntityTitle.js +81 -80
  103. package/dist/components/EntityTitle/EntityTitle.module.css.js +1 -1
  104. package/dist/components/ErrorPage/components/Error404.d.ts.map +1 -1
  105. package/dist/components/FeatureProgress/FeatureProgress.module.css.js +49 -49
  106. package/dist/components/FilePicker/FilePicker.module.css.js +7 -7
  107. package/dist/components/FormViewer/FormViewer.module.css.js +20 -20
  108. package/dist/components/FormViewer/components/fields/DragOptions/DragOptions.module.css.js +1 -1
  109. package/dist/components/FormViewer/components/fields/DropdownField/DropdownField.module.css.js +1 -1
  110. package/dist/components/FormViewer/components/fields/EditableContent/EditableContent.module.css.js +1 -1
  111. package/dist/components/FormViewer/components/fields/SelectableCard/SelectableCard.module.css.js +8 -8
  112. package/dist/components/FormViewer/components/fields/UploadField/UploadFile/UploadFile.module.css.js +4 -4
  113. package/dist/components/FormViewer/helpers/conditions.d.ts.map +1 -1
  114. package/dist/components/FormViewer/helpers/conditions.js +33 -17
  115. package/dist/components/FormViewer/store/formStore.d.ts.map +1 -1
  116. package/dist/components/ImageCropper/ImageCropper.module.css.js +38 -38
  117. package/dist/components/IntegrationFlowAnimation/IntegrationFlowAnimation.module.css.js +11 -11
  118. package/dist/components/LanguagePicker/LanguagePicker.module.css.js +1 -1
  119. package/dist/components/Loaders/styles.module.css.js +6 -6
  120. package/dist/components/MediaLibrary/MediaLibrary.module.css.js +2 -2
  121. package/dist/components/MusicPlayerBar/MusicPlayerBar.module.css.js +23 -23
  122. package/dist/components/NavMenu/NavMenu.module.css.js +12 -12
  123. package/dist/components/NavbarResizer/NavbarResizer.module.css.js +2 -2
  124. package/dist/components/NotPublicPanel/NotPublicPanel.module.css.js +11 -11
  125. package/dist/components/Notification/InfiniteScroll.d.ts +12 -0
  126. package/dist/components/Notification/InfiniteScroll.d.ts.map +1 -0
  127. package/dist/components/Notification/InfiniteScroll.js +42 -0
  128. package/dist/components/Notification/Notification.d.ts +4 -1
  129. package/dist/components/Notification/Notification.d.ts.map +1 -1
  130. package/dist/components/Notification/Notification.module.css.js +28 -4
  131. package/dist/components/Notification/atoms/ActionBadge.d.ts +11 -0
  132. package/dist/components/Notification/atoms/ActionBadge.d.ts.map +1 -0
  133. package/dist/components/Notification/atoms/ActionBadge.js +53 -0
  134. package/dist/components/Notification/atoms/ArchiveIcon.d.ts +7 -0
  135. package/dist/components/Notification/atoms/ArchiveIcon.d.ts.map +1 -0
  136. package/dist/components/Notification/atoms/ArchiveIcon.js +40 -0
  137. package/dist/components/Notification/atoms/InboxIcon.d.ts +7 -0
  138. package/dist/components/Notification/atoms/InboxIcon.d.ts.map +1 -0
  139. package/dist/components/Notification/atoms/InboxIcon.js +33 -0
  140. package/dist/components/Notification/atoms/MarkReadIcon.d.ts +7 -0
  141. package/dist/components/Notification/atoms/MarkReadIcon.d.ts.map +1 -0
  142. package/dist/components/Notification/atoms/MarkReadIcon.js +33 -0
  143. package/dist/components/Notification/atoms/ResourceIcon.d.ts +7 -0
  144. package/dist/components/Notification/atoms/ResourceIcon.d.ts.map +1 -0
  145. package/dist/components/Notification/atoms/TabBadge.d.ts +7 -0
  146. package/dist/components/Notification/atoms/TabBadge.d.ts.map +1 -0
  147. package/dist/components/Notification/atoms/TabBadge.js +32 -0
  148. package/dist/components/Notification/atoms/UnreadDot.d.ts +6 -0
  149. package/dist/components/Notification/atoms/UnreadDot.d.ts.map +1 -0
  150. package/dist/components/Notification/atoms/UnreadDot.js +23 -0
  151. package/dist/components/Notification/atoms/index.d.ts +5 -0
  152. package/dist/components/Notification/atoms/index.d.ts.map +1 -0
  153. package/dist/components/Notification/hooks/index.d.ts +8 -0
  154. package/dist/components/Notification/hooks/index.d.ts.map +1 -0
  155. package/dist/components/Notification/hooks/useInboxActions.d.ts +12 -0
  156. package/dist/components/Notification/hooks/useInboxActions.d.ts.map +1 -0
  157. package/dist/components/Notification/hooks/useInboxActions.js +58 -0
  158. package/dist/components/Notification/hooks/useInboxLoader.d.ts +8 -0
  159. package/dist/components/Notification/hooks/useInboxLoader.d.ts.map +1 -0
  160. package/dist/components/Notification/hooks/useInboxLoader.js +49 -0
  161. package/dist/components/Notification/hooks/useNotificationItem.d.ts +26 -0
  162. package/dist/components/Notification/hooks/useNotificationItem.d.ts.map +1 -0
  163. package/dist/components/Notification/hooks/useNotificationItem.js +51 -0
  164. package/dist/components/Notification/hooks/useNotificationStore.d.ts +49 -0
  165. package/dist/components/Notification/hooks/useNotificationStore.d.ts.map +1 -0
  166. package/dist/components/Notification/hooks/useNotificationStore.js +139 -0
  167. package/dist/components/Notification/hooks/useNotificationStream.d.ts +2 -0
  168. package/dist/components/Notification/hooks/useNotificationStream.d.ts.map +1 -0
  169. package/dist/components/Notification/hooks/useNotificationStream.js +86 -0
  170. package/dist/components/Notification/hooks/useNotificationTime.d.ts +2 -0
  171. package/dist/components/Notification/hooks/useNotificationTime.d.ts.map +1 -0
  172. package/dist/components/Notification/hooks/useNotificationTime.js +23 -0
  173. package/dist/components/Notification/hooks/useNotificationsApi.d.ts +25 -0
  174. package/dist/components/Notification/hooks/useNotificationsApi.d.ts.map +1 -0
  175. package/dist/components/Notification/hooks/useNotificationsApi.js +64 -0
  176. package/dist/components/Notification/lib/api.d.ts +4 -0
  177. package/dist/components/Notification/lib/api.d.ts.map +1 -0
  178. package/dist/components/Notification/lib/api.js +19 -0
  179. package/dist/components/Notification/lib/index.d.ts +5 -0
  180. package/dist/components/Notification/lib/index.d.ts.map +1 -0
  181. package/dist/components/Notification/lib/notificationText.d.ts +10 -0
  182. package/dist/components/Notification/lib/notificationText.d.ts.map +1 -0
  183. package/dist/components/Notification/lib/notificationText.js +131 -0
  184. package/dist/components/Notification/lib/stripHtml.d.ts +2 -0
  185. package/dist/components/Notification/lib/stripHtml.d.ts.map +1 -0
  186. package/dist/components/Notification/lib/stripHtml.js +6 -0
  187. package/dist/components/Notification/lib/types.d.ts +45 -0
  188. package/dist/components/Notification/lib/types.d.ts.map +1 -0
  189. package/dist/components/Notification/lib/types.js +9 -0
  190. package/dist/components/Notification/molecules/InboxEmpty.d.ts +8 -0
  191. package/dist/components/Notification/molecules/InboxEmpty.d.ts.map +1 -0
  192. package/dist/components/Notification/molecules/InboxEmpty.js +21 -0
  193. package/dist/components/Notification/molecules/InboxHeader.d.ts +17 -0
  194. package/dist/components/Notification/molecules/InboxHeader.d.ts.map +1 -0
  195. package/dist/components/Notification/molecules/InboxHeader.js +73 -0
  196. package/dist/components/Notification/molecules/InboxTabs.d.ts +15 -0
  197. package/dist/components/Notification/molecules/InboxTabs.d.ts.map +1 -0
  198. package/dist/components/Notification/molecules/InboxTabs.js +60 -0
  199. package/dist/components/Notification/molecules/NotificationActions.d.ts +9 -0
  200. package/dist/components/Notification/molecules/NotificationActions.d.ts.map +1 -0
  201. package/dist/components/Notification/molecules/NotificationActions.js +64 -0
  202. package/dist/components/Notification/molecules/NotificationAvatar.d.ts +17 -0
  203. package/dist/components/Notification/molecules/NotificationAvatar.d.ts.map +1 -0
  204. package/dist/components/Notification/molecules/NotificationAvatar.js +38 -0
  205. package/dist/components/Notification/molecules/NotificationContent.d.ts +22 -0
  206. package/dist/components/Notification/molecules/NotificationContent.d.ts.map +1 -0
  207. package/dist/components/Notification/molecules/NotificationContent.js +183 -0
  208. package/dist/components/Notification/molecules/index.d.ts +7 -0
  209. package/dist/components/Notification/molecules/index.d.ts.map +1 -0
  210. package/dist/components/Notification/organisms/InboxItem.d.ts +14 -0
  211. package/dist/components/Notification/organisms/InboxItem.d.ts.map +1 -0
  212. package/dist/components/Notification/organisms/InboxItem.js +100 -0
  213. package/dist/components/Notification/organisms/InboxPanel.d.ts +4 -0
  214. package/dist/components/Notification/organisms/InboxPanel.d.ts.map +1 -0
  215. package/dist/components/Notification/organisms/InboxPanel.js +99 -0
  216. package/dist/components/Notification/organisms/index.d.ts +3 -0
  217. package/dist/components/Notification/organisms/index.d.ts.map +1 -0
  218. package/dist/components/PillTabs/PillTabs.module.css.js +1 -1
  219. package/dist/components/SearchFilters/SearchFilters.module.css.js +1 -1
  220. package/dist/components/SettingsSection/styles.module.css.js +1 -1
  221. package/dist/components/StorageUsageProgress/StorageUsageProgress.module.css.js +1 -1
  222. package/dist/components/TreeIndent/TreeIndent.module.css.js +4 -4
  223. package/dist/components/modals/RemoveConfirmModal.d.ts.map +1 -1
  224. package/dist/components/modals/RemoveConfirmModal.js +27 -26
  225. package/dist/components/table/FrontTable.d.ts.map +1 -1
  226. package/dist/components/table/hooks/useColumnsResizing.d.ts.map +1 -1
  227. package/dist/config/envConfig.d.ts +2 -0
  228. package/dist/config/envConfig.d.ts.map +1 -1
  229. package/dist/config/envConfig.js +29 -28
  230. package/dist/helpers/getFileIcons.js +5 -5
  231. package/dist/helpers/getFileType.d.ts.map +1 -1
  232. package/dist/helpers/getFileType.js +11 -2
  233. package/dist/helpers/platform.d.ts +1 -1
  234. package/dist/helpers/platform.d.ts.map +1 -1
  235. package/dist/helpers/platform.js +1 -0
  236. package/dist/helpers/showFeatureFeedback.module.css.js +4 -4
  237. package/dist/helpers/showNotifications.module.css.js +1 -1
  238. package/dist/index.css +1 -1
  239. package/dist/index.d.ts +0 -2
  240. package/dist/index.d.ts.map +1 -1
  241. package/dist/index.js +560 -571
  242. package/dist/lang/locales/ui_en.json.js +1 -1
  243. package/dist/lang/locales/ui_es.json.js +1 -1
  244. package/dist/lang/locales/ui_ru.json.js +1 -1
  245. package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/Audio.context.js +15 -0
  246. package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/Audio.js +228 -0
  247. package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/Audio.module.css.js +4 -0
  248. package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioControls.js +19 -0
  249. package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioMuteButton.js +30 -0
  250. package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioPlayButton.js +40 -0
  251. package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioSkipButton.js +28 -0
  252. package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioSpectrum.js +137 -0
  253. package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioSpeedControl.js +31 -0
  254. package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioTimeDisplay.js +44 -0
  255. package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioTimeline.js +71 -0
  256. package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioVolumeSlider.js +43 -0
  257. package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioWaveform.js +166 -0
  258. package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/use-audio.js +201 -0
  259. package/dist/node_modules/@gfazioli/mantine-video/dist/esm/Video.context.js +15 -0
  260. package/dist/node_modules/@gfazioli/mantine-video/dist/esm/Video.js +272 -0
  261. package/dist/node_modules/@gfazioli/mantine-video/dist/esm/Video.module.css.js +4 -0
  262. package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoCaptionsButton.js +55 -0
  263. package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoControls.js +30 -0
  264. package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoFullscreenButton.js +31 -0
  265. package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoMuteButton.js +29 -0
  266. package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoPiPButton.js +29 -0
  267. package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoPlayButton.js +28 -0
  268. package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoSkipButton.js +27 -0
  269. package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoTimeDisplay.js +44 -0
  270. package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoTimeline.js +70 -0
  271. package/dist/node_modules/@gfazioli/mantine-video/dist/esm/use-video.js +170 -0
  272. package/docs/README.md +499 -499
  273. package/package.json +80 -79
  274. package/dist/components/AttachmentsGalleryModal/components/AttachmentVideoPlayer.d.ts +0 -15
  275. package/dist/components/AttachmentsGalleryModal/components/AttachmentVideoPlayer.d.ts.map +0 -1
  276. package/dist/components/AttachmentsGalleryModal/components/AttachmentVideoPlayer.js +0 -36
  277. package/dist/components/AttachmentsGalleryModal/components/LegacyAttachmentVideoPlayer.d.ts +0 -14
  278. package/dist/components/AttachmentsGalleryModal/components/LegacyAttachmentVideoPlayer.d.ts.map +0 -1
  279. package/dist/components/AttachmentsGalleryModal/components/LegacyAttachmentVideoPlayer.js +0 -31
  280. package/dist/components/AttachmentsGalleryModal/components/StatusVideoPlayer.d.ts +0 -18
  281. package/dist/components/AttachmentsGalleryModal/components/StatusVideoPlayer.d.ts.map +0 -1
  282. package/dist/components/AttachmentsGalleryModal/components/StatusVideoPlayer.js +0 -35
  283. package/dist/components/AttachmentsGalleryModal/components/useAttachmentVideoStatus.d.ts +0 -33
  284. package/dist/components/AttachmentsGalleryModal/components/useAttachmentVideoStatus.d.ts.map +0 -1
  285. package/dist/components/AttachmentsGalleryModal/components/useAttachmentVideoStatus.js +0 -70
  286. package/dist/components/Notification/Notification.js +0 -119
  287. package/dist/components/Notification/NotificationCard.d.ts +0 -10
  288. package/dist/components/Notification/NotificationCard.d.ts.map +0 -1
  289. package/dist/components/Notification/NotificationCard.js +0 -93
  290. package/dist/components/VideoPlayer/VideoPlayer.d.ts +0 -24
  291. package/dist/components/VideoPlayer/VideoPlayer.d.ts.map +0 -1
  292. package/dist/components/VideoPlayer/VideoPlayer.js +0 -727
  293. package/dist/components/VideoPlayer/components/MobileDrawer/index.d.ts +0 -8
  294. package/dist/components/VideoPlayer/components/MobileDrawer/index.d.ts.map +0 -1
  295. package/dist/components/VideoPlayer/components/MobileDrawer/index.js +0 -67
  296. package/dist/components/VideoPlayer/components/SelectListOptionButton.d.ts +0 -7
  297. package/dist/components/VideoPlayer/components/SelectListOptionButton.d.ts.map +0 -1
  298. package/dist/components/VideoPlayer/components/SelectListOptionButton.js +0 -44
  299. package/dist/components/VideoPlayer/components/StoryboardPreview.d.ts +0 -9
  300. package/dist/components/VideoPlayer/components/StoryboardPreview.d.ts.map +0 -1
  301. package/dist/components/VideoPlayer/components/StoryboardPreview.js +0 -38
  302. package/dist/components/VideoPlayer/components/VideoCustomControls.d.ts +0 -33
  303. package/dist/components/VideoPlayer/components/VideoCustomControls.d.ts.map +0 -1
  304. package/dist/components/VideoPlayer/components/VideoCustomControls.js +0 -601
  305. package/dist/components/VideoPlayer/components/VideoIcons.d.ts +0 -25
  306. package/dist/components/VideoPlayer/components/VideoIcons.d.ts.map +0 -1
  307. package/dist/components/VideoPlayer/components/VideoIcons.js +0 -145
  308. package/dist/components/VideoPlayer/components/VideoMenu.d.ts +0 -27
  309. package/dist/components/VideoPlayer/components/VideoMenu.d.ts.map +0 -1
  310. package/dist/components/VideoPlayer/components/VideoMenu.js +0 -77
  311. package/dist/components/VideoPlayer/components/VideoMobileSettingsDrawer.d.ts +0 -17
  312. package/dist/components/VideoPlayer/components/VideoMobileSettingsDrawer.d.ts.map +0 -1
  313. package/dist/components/VideoPlayer/components/VideoMobileSettingsDrawer.js +0 -289
  314. package/dist/components/VideoPlayer/components/VideoQualityMenu/index.d.ts +0 -10
  315. package/dist/components/VideoPlayer/components/VideoQualityMenu/index.d.ts.map +0 -1
  316. package/dist/components/VideoPlayer/components/VideoQualityMenu/index.js +0 -55
  317. package/dist/components/VideoPlayer/components/VideoSelect.d.ts +0 -10
  318. package/dist/components/VideoPlayer/components/VideoSelect.d.ts.map +0 -1
  319. package/dist/components/VideoPlayer/components/VideoSelect.js +0 -168
  320. package/dist/components/VideoPlayer/components/VideoSettingsMenu/index.d.ts +0 -12
  321. package/dist/components/VideoPlayer/components/VideoSettingsMenu/index.d.ts.map +0 -1
  322. package/dist/components/VideoPlayer/components/VideoSettingsMenu/index.js +0 -48
  323. package/dist/components/VideoPlayer/components/VideoSettingsModal/ChaptersSection.d.ts +0 -25
  324. package/dist/components/VideoPlayer/components/VideoSettingsModal/ChaptersSection.d.ts.map +0 -1
  325. package/dist/components/VideoPlayer/components/VideoSettingsModal/ChaptersSection.js +0 -384
  326. package/dist/components/VideoPlayer/components/VideoSettingsModal/CoverSection.d.ts +0 -21
  327. package/dist/components/VideoPlayer/components/VideoSettingsModal/CoverSection.d.ts.map +0 -1
  328. package/dist/components/VideoPlayer/components/VideoSettingsModal/CoverSection.js +0 -264
  329. package/dist/components/VideoPlayer/components/VideoSettingsModal/FooterActions.d.ts +0 -10
  330. package/dist/components/VideoPlayer/components/VideoSettingsModal/FooterActions.d.ts.map +0 -1
  331. package/dist/components/VideoPlayer/components/VideoSettingsModal/FooterActions.js +0 -39
  332. package/dist/components/VideoPlayer/components/VideoSettingsModal/ManualSubtitlesPanel.d.ts +0 -14
  333. package/dist/components/VideoPlayer/components/VideoSettingsModal/ManualSubtitlesPanel.d.ts.map +0 -1
  334. package/dist/components/VideoPlayer/components/VideoSettingsModal/ManualSubtitlesPanel.js +0 -360
  335. package/dist/components/VideoPlayer/components/VideoSettingsModal/SubtitleTrackRow.d.ts +0 -16
  336. package/dist/components/VideoPlayer/components/VideoSettingsModal/SubtitleTrackRow.d.ts.map +0 -1
  337. package/dist/components/VideoPlayer/components/VideoSettingsModal/SubtitlesSection.d.ts +0 -14
  338. package/dist/components/VideoPlayer/components/VideoSettingsModal/SubtitlesSection.d.ts.map +0 -1
  339. package/dist/components/VideoPlayer/components/VideoSettingsModal/context.d.ts +0 -4
  340. package/dist/components/VideoPlayer/components/VideoSettingsModal/context.d.ts.map +0 -1
  341. package/dist/components/VideoPlayer/components/VideoSettingsModal/context.js +0 -14
  342. package/dist/components/VideoPlayer/components/VideoSettingsModal/index.d.ts +0 -22
  343. package/dist/components/VideoPlayer/components/VideoSettingsModal/index.d.ts.map +0 -1
  344. package/dist/components/VideoPlayer/components/VideoSettingsModal/index.js +0 -211
  345. package/dist/components/VideoPlayer/components/VideoSpeedMenu/index.d.ts +0 -11
  346. package/dist/components/VideoPlayer/components/VideoSpeedMenu/index.d.ts.map +0 -1
  347. package/dist/components/VideoPlayer/components/VideoSpeedMenu/index.js +0 -41
  348. package/dist/components/VideoPlayer/components/VideoSubtitlesMenu/index.d.ts +0 -10
  349. package/dist/components/VideoPlayer/components/VideoSubtitlesMenu/index.d.ts.map +0 -1
  350. package/dist/components/VideoPlayer/components/VideoSubtitlesMenu/index.js +0 -69
  351. package/dist/components/VideoPlayer/hooks/useStoryboard.d.ts +0 -21
  352. package/dist/components/VideoPlayer/hooks/useStoryboard.d.ts.map +0 -1
  353. package/dist/components/VideoPlayer/hooks/useStoryboard.js +0 -91
  354. package/dist/components/VideoPlayer/index.d.ts +0 -11
  355. package/dist/components/VideoPlayer/index.d.ts.map +0 -1
  356. package/dist/components/VideoPlayer/types.d.ts +0 -101
  357. package/dist/components/VideoPlayer/types.d.ts.map +0 -1
  358. package/dist/components/VideoPlayer/utils/chapters.d.ts +0 -8
  359. package/dist/components/VideoPlayer/utils/chapters.d.ts.map +0 -1
  360. package/dist/components/VideoPlayer/utils/chapters.js +0 -38
  361. package/dist/components/VideoPlayer/utils/storyboard.d.ts +0 -5
  362. package/dist/components/VideoPlayer/utils/storyboard.d.ts.map +0 -1
  363. package/dist/components/VideoPlayer/utils/storyboard.js +0 -47
  364. package/dist/components/VideoPlayer/utils/subtitles.d.ts +0 -18
  365. package/dist/components/VideoPlayer/utils/subtitles.d.ts.map +0 -1
  366. package/dist/components/VideoPlayer/utils/subtitles.js +0 -23
  367. package/dist/components/VideoPlayer/utils/touch.d.ts +0 -3
  368. package/dist/components/VideoPlayer/utils/touch.d.ts.map +0 -1
  369. package/dist/components/VideoPlayer/utils/touch.js +0 -5
  370. package/dist/components/VideoPlayer/utils/videoPlayerUtils.d.ts +0 -10
  371. package/dist/components/VideoPlayer/utils/videoPlayerUtils.d.ts.map +0 -1
  372. package/dist/components/VideoPlayer/utils/videoPlayerUtils.js +0 -22
  373. package/dist/components/VideoPlayer/utils/videoSettings.d.ts +0 -69
  374. package/dist/components/VideoPlayer/utils/videoSettings.d.ts.map +0 -1
  375. package/dist/components/VideoPlayer/utils/videoSettings.js +0 -90
  376. package/dist/videoSettings/createVideoSettingsDataSource.d.ts +0 -19
  377. package/dist/videoSettings/createVideoSettingsDataSource.d.ts.map +0 -1
  378. package/dist/videoSettings/createVideoSettingsDataSource.js +0 -127
@@ -0,0 +1,44 @@
1
+ import { Text as s } from "@mantine/core";
2
+ import c, { forwardRef as u } from "react";
3
+ import { useAudioContext as f } from "../Audio.context.js";
4
+ const l = u(
5
+ ({ format: e = "current/duration", ...t }, r) => {
6
+ const o = f(), n = p(e, o.currentTime, o.duration);
7
+ return /* @__PURE__ */ c.createElement(
8
+ s,
9
+ {
10
+ ref: r,
11
+ size: "sm",
12
+ ff: "monospace",
13
+ ta: "center",
14
+ ...o.getStyles("timeDisplay"),
15
+ ...t
16
+ },
17
+ n
18
+ );
19
+ }
20
+ );
21
+ l.displayName = "AudioTimeDisplay";
22
+ function a(e) {
23
+ if (!Number.isFinite(e) || e < 0)
24
+ return "0:00";
25
+ const t = Math.floor(e), r = Math.floor(t / 3600), o = Math.floor(t % 3600 / 60), n = t % 60, i = r > 0 ? String(o).padStart(2, "0") : String(o), m = String(n).padStart(2, "0");
26
+ return r > 0 ? `${r}:${i}:${m}` : `${i}:${m}`;
27
+ }
28
+ function p(e, t, r) {
29
+ switch (e) {
30
+ case "current":
31
+ return a(t);
32
+ case "duration":
33
+ return a(r);
34
+ case "remaining":
35
+ return a(Math.max(r - t, 0));
36
+ case "current/-remaining":
37
+ return `${a(t)} / -${a(Math.max(r - t, 0))}`;
38
+ default:
39
+ return `${a(t)} / ${a(r)}`;
40
+ }
41
+ }
42
+ export {
43
+ l as AudioTimeDisplay
44
+ };
@@ -0,0 +1,71 @@
1
+ import { Box as p, Slider as v } from "@mantine/core";
2
+ import b, { forwardRef as R, useState as w, useRef as f, useEffect as A, useCallback as S } from "react";
3
+ import { useAudioContext as E } from "../Audio.context.js";
4
+ const $ = R(
5
+ ({ sliderProps: u, liveScrub: n = !0, scrubSound: l, ...o }, m) => {
6
+ const e = E(), t = l ?? e.scrubSound, [y, h] = w(null), d = f(!1), c = f(!1), r = f(null), a = f(null), s = Number.isFinite(e.duration) && e.duration > 0 ? e.duration : 0, g = y ?? e.currentTime, C = s > 0 ? e.buffered / s * 100 : 0;
7
+ A(
8
+ () => () => {
9
+ r.current !== null && cancelAnimationFrame(r.current);
10
+ },
11
+ []
12
+ );
13
+ const x = S(
14
+ (i) => {
15
+ d.current || (d.current = !0, c.current = e.playing, n && (t && !e.playing ? e.play() : !t && e.playing && e.pause())), h(i), n && (a.current = i, r.current === null && (r.current = requestAnimationFrame(() => {
16
+ r.current = null, a.current !== null && (e.seek(a.current), a.current = null);
17
+ })));
18
+ },
19
+ [e, n, t]
20
+ ), k = S(
21
+ (i) => {
22
+ r.current !== null && (cancelAnimationFrame(r.current), r.current = null), a.current = null, e.seek(i), h(null), d.current = !1, t && !c.current ? e.pause() : !t && c.current && e.play(), c.current = !1;
23
+ },
24
+ [e, t]
25
+ );
26
+ return /* @__PURE__ */ b.createElement(p, { ref: m, ...e.getStyles("timeline"), ...o }, /* @__PURE__ */ b.createElement(
27
+ p,
28
+ {
29
+ ...e.getStyles("timelineBuffered"),
30
+ style: { width: `${C}%` },
31
+ "aria-hidden": !0
32
+ }
33
+ ), /* @__PURE__ */ b.createElement(
34
+ v,
35
+ {
36
+ value: Math.min(g, s || g),
37
+ onChange: x,
38
+ onChangeEnd: k,
39
+ min: 0,
40
+ max: s || 1e-4,
41
+ step: 0.01,
42
+ label: (i) => F(i),
43
+ showLabelOnHover: !0,
44
+ color: "var(--audio-timeline-color)",
45
+ size: "xs",
46
+ "aria-label": "Seek",
47
+ styles: {
48
+ root: { flex: 1, width: "100%" },
49
+ bar: { backgroundColor: "var(--audio-timeline-color)" },
50
+ thumb: {
51
+ backgroundColor: "var(--audio-timeline-thumb-color)",
52
+ borderColor: "var(--audio-timeline-thumb-color)",
53
+ width: "var(--audio-timeline-thumb-size)",
54
+ height: "var(--audio-timeline-thumb-size)"
55
+ }
56
+ },
57
+ ...u
58
+ }
59
+ ));
60
+ }
61
+ );
62
+ $.displayName = "AudioTimeline";
63
+ function F(u) {
64
+ if (!Number.isFinite(u) || u < 0)
65
+ return "0:00";
66
+ const n = Math.floor(u), l = Math.floor(n / 3600), o = Math.floor(n % 3600 / 60), m = n % 60, e = l > 0 ? String(o).padStart(2, "0") : String(o), t = String(m).padStart(2, "0");
67
+ return l > 0 ? `${l}:${e}:${t}` : `${e}:${t}`;
68
+ }
69
+ export {
70
+ $ as AudioTimeline
71
+ };
@@ -0,0 +1,43 @@
1
+ import { Slider as i } from "@mantine/core";
2
+ import u, { forwardRef as d, useCallback as m } from "react";
3
+ import { useAudioContext as n } from "../Audio.context.js";
4
+ const s = d(
5
+ ({ ...r }, a) => {
6
+ const e = n(), l = e.muted ? 0 : Math.round(e.volume * 100), t = m(
7
+ (o) => {
8
+ e.setVolume(o / 100);
9
+ },
10
+ [e]
11
+ );
12
+ return /* @__PURE__ */ u.createElement(
13
+ i,
14
+ {
15
+ ref: a,
16
+ value: l,
17
+ onChange: t,
18
+ min: 0,
19
+ max: 100,
20
+ step: 1,
21
+ label: (o) => `${o}%`,
22
+ showLabelOnHover: !0,
23
+ size: "xs",
24
+ "aria-label": "Volume",
25
+ styles: {
26
+ bar: { backgroundColor: "var(--audio-color)" },
27
+ thumb: {
28
+ backgroundColor: "var(--audio-color)",
29
+ borderColor: "var(--audio-color)",
30
+ width: "var(--audio-timeline-thumb-size)",
31
+ height: "var(--audio-timeline-thumb-size)"
32
+ }
33
+ },
34
+ ...e.getStyles("volumeSlider"),
35
+ ...r
36
+ }
37
+ );
38
+ }
39
+ );
40
+ s.displayName = "AudioVolumeSlider";
41
+ export {
42
+ s as AudioVolumeSlider
43
+ };
@@ -0,0 +1,166 @@
1
+ import { useMantineTheme as ut, getThemeColor as ft, Box as K, getRadius as dt } from "@mantine/core";
2
+ import H, { forwardRef as mt, useRef as R, useState as Q, useEffect as $, useCallback as Y } from "react";
3
+ import { useAudioContext as pt } from "../Audio.context.js";
4
+ function Z(r) {
5
+ if (!r)
6
+ return "transparent";
7
+ if (r.startsWith("#") || r.startsWith("rgb") || r.startsWith("hsl") || r === "transparent" || typeof document > "u")
8
+ return r;
9
+ const i = document.createElement("div");
10
+ i.style.color = r, document.body.appendChild(i);
11
+ const d = getComputedStyle(i).color;
12
+ return i.remove(), d || r;
13
+ }
14
+ const ht = mt(
15
+ ({
16
+ height: r = 64,
17
+ barGap: i = 2,
18
+ barWidth: d,
19
+ barRadius: A = 1,
20
+ radius: z,
21
+ color: L,
22
+ mirror: F = !0,
23
+ mirrorGap: O = 0,
24
+ interactive: v = !0,
25
+ scrubSound: G,
26
+ ...tt
27
+ }, x) => {
28
+ const et = ut(), U = L ? ft(L, et) : null, e = pt(), C = G ?? e.scrubSound, V = R(null), B = R(null), [u, X] = Q(0), [_, j] = Q(null), M = R(!1), m = R(!1), k = R(null), p = R(() => {
29
+ }), S = e.audioRef;
30
+ $(() => {
31
+ const t = B.current;
32
+ if (!t || typeof ResizeObserver > "u")
33
+ return;
34
+ const n = new ResizeObserver((c) => {
35
+ for (const o of c)
36
+ X(o.contentRect.width);
37
+ });
38
+ return n.observe(t), X(t.getBoundingClientRect().width), () => n.disconnect();
39
+ }, []), $(() => {
40
+ const t = V.current;
41
+ if (!t) {
42
+ p.current = () => {
43
+ };
44
+ return;
45
+ }
46
+ const n = e.peaks;
47
+ if (!n || n.length === 0 || u <= 0) {
48
+ const s = window.devicePixelRatio || 1;
49
+ t.width = u * s, t.height = r * s, t.getContext("2d")?.clearRect(0, 0, t.width, t.height), p.current = () => {
50
+ };
51
+ return;
52
+ }
53
+ const c = window.devicePixelRatio || 1;
54
+ t.width = u * c, t.height = r * c, t.style.width = `${u}px`, t.style.height = `${r}px`;
55
+ const o = t.getContext("2d");
56
+ if (!o) {
57
+ p.current = () => {
58
+ };
59
+ return;
60
+ }
61
+ o.scale(c, c);
62
+ const P = !d || d <= 0, rt = P ? 2 : d, ot = Math.max(1, Math.floor((u + i) / (rt + i))), h = Math.min(n.length, ot), E = P ? Math.max(1, (u - i * (h - 1)) / h) : d, D = n.length / h, ct = U || getComputedStyle(t).getPropertyValue("--audio-waveform-played-color").trim() || "#228be6", st = getComputedStyle(t).getPropertyValue("--audio-waveform-color").trim() || "rgba(120, 120, 120, 0.4)", at = Z(ct), it = Z(st), N = new Float32Array(h);
63
+ for (let s = 0; s < h; s += 1) {
64
+ const y = Math.floor(s * D), g = Math.floor((s + 1) * D);
65
+ let a = 0;
66
+ for (let l = y; l < g; l += 1) {
67
+ const f = n[l] ?? 0;
68
+ f > a && (a = f);
69
+ }
70
+ N[s] = a;
71
+ }
72
+ const b = (s, y, g, a, l) => {
73
+ o.fillStyle = l, A > 0 && typeof o.roundRect == "function" ? (o.beginPath(), o.roundRect(s, y, g, a, Math.min(A, g / 2, Math.max(0, a / 2))), o.fill()) : o.fillRect(s, y, g, a);
74
+ };
75
+ p.current = (s) => {
76
+ o.clearRect(0, 0, u, r);
77
+ const y = s * h, g = Math.floor(y), a = r / 2, l = F ? O / 2 : 0;
78
+ for (let f = 0; f < h; f += 1) {
79
+ const J = N[f], W = f * (E + i), q = f < g ? at : it;
80
+ if (F) {
81
+ const w = Math.max(1, J * (a - l));
82
+ b(W, a - l - w, E, w, q), b(W, a + l, E, w, q);
83
+ } else {
84
+ const w = Math.max(2, J * r);
85
+ b(W, r - w, E, w, q);
86
+ }
87
+ }
88
+ };
89
+ const I = e.duration, lt = I > 0 ? (S.current?.currentTime ?? 0) / I : 0;
90
+ p.current(Math.max(0, Math.min(1, lt)));
91
+ }, [e.peaks, u, r, i, d, A, F, O, U]), $(() => {
92
+ const t = () => {
93
+ const n = S.current, c = n?.duration ?? 0, o = n?.currentTime ?? 0, P = c > 0 ? Math.max(0, Math.min(1, o / c)) : 0;
94
+ p.current(P), k.current = requestAnimationFrame(t);
95
+ };
96
+ if (e.playing)
97
+ k.current = requestAnimationFrame(t);
98
+ else {
99
+ const n = e.duration, c = S.current?.currentTime ?? 0, o = n > 0 ? Math.max(0, Math.min(1, c / n)) : 0;
100
+ p.current(o);
101
+ }
102
+ return () => {
103
+ k.current !== null && (cancelAnimationFrame(k.current), k.current = null);
104
+ };
105
+ }, [e.playing, e.duration, e.currentTime, S]);
106
+ const T = Y(
107
+ (t) => {
108
+ const n = B.current;
109
+ if (!n || e.duration <= 0)
110
+ return;
111
+ const c = n.getBoundingClientRect(), o = Math.max(0, Math.min(1, (t.clientX - c.left) / c.width));
112
+ e.seek(o * e.duration);
113
+ },
114
+ [e]
115
+ ), nt = Y(
116
+ (t) => {
117
+ const n = B.current;
118
+ if (!n)
119
+ return;
120
+ const c = n.getBoundingClientRect(), o = Math.max(0, Math.min(1, (t.clientX - c.left) / c.width));
121
+ j(o), M.current && v && T(t);
122
+ },
123
+ [v, T]
124
+ );
125
+ return /* @__PURE__ */ H.createElement(
126
+ K,
127
+ {
128
+ ref: (t) => {
129
+ B.current = t, typeof x == "function" ? x(t) : x && typeof x == "object" && (x.current = t);
130
+ },
131
+ ...e.getStyles("waveform"),
132
+ style: {
133
+ height: r,
134
+ cursor: v ? "pointer" : "default",
135
+ borderRadius: z === void 0 ? void 0 : dt(z)
136
+ },
137
+ onMouseDown: (t) => {
138
+ v && (M.current = !0, m.current = e.playing, C ? e.playing || e.play() : e.playing && e.pause(), T(t));
139
+ },
140
+ onMouseUp: () => {
141
+ M.current && (M.current = !1, C && !m.current ? e.pause() : !C && m.current && e.play(), m.current = !1);
142
+ },
143
+ onMouseMove: nt,
144
+ onMouseLeave: () => {
145
+ M.current && (C && !m.current ? e.pause() : !C && m.current && e.play()), M.current = !1, m.current = !1, j(null);
146
+ },
147
+ "data-loading": e.peaksLoading || void 0,
148
+ "data-error": e.peaksError ? "true" : void 0,
149
+ ...tt
150
+ },
151
+ /* @__PURE__ */ H.createElement("canvas", { ref: V, ...e.getStyles("waveformCanvas") }),
152
+ _ !== null && v && /* @__PURE__ */ H.createElement(
153
+ K,
154
+ {
155
+ ...e.getStyles("waveformHover"),
156
+ style: { left: `${_ * 100}%` },
157
+ "aria-hidden": !0
158
+ }
159
+ )
160
+ );
161
+ }
162
+ );
163
+ ht.displayName = "AudioWaveform";
164
+ export {
165
+ ht as AudioWaveform
166
+ };
@@ -0,0 +1,201 @@
1
+ import { useRef as x, useState as a, useEffect as v, useCallback as i } from "react";
2
+ function me(n, r) {
3
+ const h = n.getChannelData(0), f = Math.floor(h.length / r), E = new Float32Array(r);
4
+ for (let m = 0; m < r; m += 1) {
5
+ const L = m * f;
6
+ let y = 0;
7
+ for (let g = 0; g < f; g += 1) {
8
+ const b = Math.abs(h[L + g] ?? 0);
9
+ b > y && (y = b);
10
+ }
11
+ E[m] = y;
12
+ }
13
+ return E;
14
+ }
15
+ function ye(n = {}) {
16
+ const r = x(null), [h, f] = a(!1), [E, m] = a(0), [L, y] = a(0), [g, b] = a(0), [j, R] = a(n.volume ?? 1), [H, S] = a(n.muted ?? !1), [U, T] = a(n.playbackRate ?? 1), [$, P] = a(!1), [q, p] = a(!1), [J, K] = a(null), [O, A] = a(!1), [Q, M] = a(null), [X, w] = a(!1), [Y, D] = a(null), [Z, _] = a(null), [ee, te] = a(null), [C, ne] = a(null), s = x(n);
17
+ s.current = n;
18
+ const d = x(null);
19
+ v(() => {
20
+ const e = r.current;
21
+ if (!e)
22
+ return;
23
+ const t = () => {
24
+ f(!0), P(!1), s.current.onPlayChange?.(!0);
25
+ }, c = () => {
26
+ f(!1), s.current.onPlayChange?.(!1);
27
+ }, l = () => {
28
+ P(!0), f(!1), s.current.onEnded?.();
29
+ }, o = () => {
30
+ m(e.currentTime), s.current.onCurrentTimeChange?.(e.currentTime);
31
+ }, u = () => {
32
+ const G = e.duration || 0;
33
+ y(G), e.currentSrc && ne(e.currentSrc), s.current.onDurationChange?.(G);
34
+ }, F = () => {
35
+ R(e.volume), S(e.muted), s.current.onVolumeChange?.(e.volume);
36
+ }, N = () => {
37
+ T(e.playbackRate), s.current.onPlaybackRateChange?.(e.playbackRate);
38
+ }, V = () => p(!0), W = () => p(!1), z = () => {
39
+ A(!0), p(!1);
40
+ }, B = () => {
41
+ e.buffered.length > 0 && b(e.buffered.end(e.buffered.length - 1));
42
+ }, I = () => {
43
+ K(e.error), p(!1), s.current.onError?.(e.error);
44
+ };
45
+ return e.addEventListener("play", t), e.addEventListener("pause", c), e.addEventListener("ended", l), e.addEventListener("timeupdate", o), e.addEventListener("durationchange", u), e.addEventListener("loadedmetadata", u), e.addEventListener("volumechange", F), e.addEventListener("ratechange", N), e.addEventListener("waiting", V), e.addEventListener("playing", W), e.addEventListener("canplay", z), e.addEventListener("progress", B), e.addEventListener("error", I), Number.isFinite(e.duration) && e.duration > 0 && y(e.duration), e.currentTime > 0 && m(e.currentTime), (e.volume !== 1 || e.muted) && (R(e.volume), S(e.muted)), e.playbackRate !== 1 && T(e.playbackRate), e.paused || f(!0), e.readyState >= 3 && A(!0), e.buffered.length > 0 && b(e.buffered.end(e.buffered.length - 1)), () => {
46
+ e.removeEventListener("play", t), e.removeEventListener("pause", c), e.removeEventListener("ended", l), e.removeEventListener("timeupdate", o), e.removeEventListener("durationchange", u), e.removeEventListener("loadedmetadata", u), e.removeEventListener("volumechange", F), e.removeEventListener("ratechange", N), e.removeEventListener("waiting", V), e.removeEventListener("playing", W), e.removeEventListener("canplay", z), e.removeEventListener("progress", B), e.removeEventListener("error", I);
47
+ };
48
+ }, []), v(() => {
49
+ if (n.playing === void 0)
50
+ return;
51
+ const e = r.current;
52
+ e && (n.playing && e.paused ? e.play().catch(() => {
53
+ }) : !n.playing && !e.paused && e.pause());
54
+ }, [n.playing]), v(() => {
55
+ if (n.currentTime === void 0)
56
+ return;
57
+ const e = r.current;
58
+ e && Math.abs(e.currentTime - n.currentTime) > 0.5 && (e.currentTime = n.currentTime);
59
+ }, [n.currentTime]), v(() => {
60
+ if (n.volume === void 0)
61
+ return;
62
+ const e = r.current;
63
+ e && Math.abs(e.volume - n.volume) > 0.01 && (e.volume = Math.max(0, Math.min(1, n.volume)));
64
+ }, [n.volume]), v(() => {
65
+ if (n.playbackRate === void 0)
66
+ return;
67
+ const e = r.current;
68
+ e && e.playbackRate !== n.playbackRate && (e.playbackRate = n.playbackRate);
69
+ }, [n.playbackRate]), v(() => {
70
+ if (n.disableWebAudio)
71
+ return;
72
+ const e = C || n.src;
73
+ if (!e || typeof window > "u")
74
+ return;
75
+ const t = window.AudioContext || window.webkitAudioContext;
76
+ if (!t)
77
+ return;
78
+ const c = n.waveformSamples ?? 512;
79
+ if (c <= 0)
80
+ return;
81
+ let l = !1;
82
+ M(null), D(null), w(!0);
83
+ const o = new t();
84
+ return fetch(e).then((u) => {
85
+ if (!u.ok)
86
+ throw new Error(`Failed to fetch audio: HTTP ${u.status}`);
87
+ return u.arrayBuffer();
88
+ }).then((u) => o.decodeAudioData(u.slice(0))).then((u) => {
89
+ l || (M(me(u, c)), w(!1));
90
+ }).catch((u) => {
91
+ l || (D(u instanceof Error ? u : new Error(String(u))), w(!1));
92
+ }).finally(() => {
93
+ o.close().catch(() => {
94
+ });
95
+ }), () => {
96
+ l = !0;
97
+ };
98
+ }, [C, n.src, n.disableWebAudio, n.waveformSamples]);
99
+ const k = i(() => {
100
+ if (d.current && d.current.ctx.state !== "closed")
101
+ return d.current;
102
+ if (d.current = null, s.current.disableWebAudio || typeof window > "u")
103
+ return null;
104
+ const e = r.current;
105
+ if (!e)
106
+ return null;
107
+ const t = window.AudioContext || window.webkitAudioContext;
108
+ if (!t)
109
+ return null;
110
+ try {
111
+ const c = new t(), l = c.createMediaElementSource(e), o = c.createAnalyser();
112
+ return o.fftSize = s.current.fftSize ?? 256, l.connect(o), o.connect(c.destination), d.current = { ctx: c, source: l, analyser: o }, te(c), _(o), d.current;
113
+ } catch {
114
+ return null;
115
+ }
116
+ }, []);
117
+ v(() => () => {
118
+ d.current?.ctx.close().catch(() => {
119
+ }), d.current = null;
120
+ }, []);
121
+ const re = i(async () => {
122
+ const e = r.current;
123
+ if (!e)
124
+ return;
125
+ const t = k();
126
+ t && t.ctx.state === "suspended" && await t.ctx.resume().catch(() => {
127
+ });
128
+ try {
129
+ await e.play();
130
+ } catch {
131
+ }
132
+ }, [k]), ae = i(() => {
133
+ r.current?.pause();
134
+ }, []), ue = i(() => {
135
+ const e = r.current;
136
+ if (!e)
137
+ return;
138
+ const t = k();
139
+ t && t.ctx.state === "suspended" && t.ctx.resume().catch(() => {
140
+ }), e.paused ? e.play().catch(() => {
141
+ }) : e.pause();
142
+ }, [k]), ce = i((e) => {
143
+ const t = r.current;
144
+ if (!t)
145
+ return;
146
+ const c = Number.isFinite(t.duration) ? t.duration : 1 / 0;
147
+ t.currentTime = Math.max(0, Math.min(e, c));
148
+ }, []), se = i((e) => {
149
+ const t = r.current;
150
+ if (!t)
151
+ return;
152
+ const c = Number.isFinite(t.duration) ? t.duration : 1 / 0;
153
+ t.currentTime = Math.max(0, Math.min(t.currentTime + e, c));
154
+ }, []), oe = i((e) => {
155
+ const t = r.current;
156
+ t && (t.volume = Math.max(0, Math.min(1, e)), e > 0 && t.muted && (t.muted = !1));
157
+ }, []), ie = i(() => {
158
+ r.current && (r.current.muted = !0);
159
+ }, []), le = i(() => {
160
+ r.current && (r.current.muted = !1);
161
+ }, []), de = i(() => {
162
+ const e = r.current;
163
+ e && (e.muted = !e.muted);
164
+ }, []), fe = i((e) => {
165
+ r.current && (r.current.playbackRate = e);
166
+ }, []);
167
+ return {
168
+ audioRef: r,
169
+ playing: h,
170
+ paused: !h,
171
+ ended: $,
172
+ currentTime: E,
173
+ duration: L,
174
+ buffered: g,
175
+ volume: j,
176
+ muted: H,
177
+ playbackRate: U,
178
+ isLoading: q,
179
+ error: J,
180
+ canPlay: O,
181
+ currentSrc: C,
182
+ peaks: Q,
183
+ peaksLoading: X,
184
+ peaksError: Y,
185
+ analyser: Z,
186
+ audioContext: ee,
187
+ play: re,
188
+ pause: ae,
189
+ toggle: ue,
190
+ seek: ce,
191
+ seekBy: se,
192
+ setVolume: oe,
193
+ mute: ie,
194
+ unmute: le,
195
+ toggleMute: de,
196
+ setPlaybackRate: fe
197
+ };
198
+ }
199
+ export {
200
+ ye as useAudio
201
+ };
@@ -0,0 +1,15 @@
1
+ import { createContext as t, useContext as n } from "react";
2
+ const o = t(null), d = o.Provider;
3
+ function i() {
4
+ const e = n(o);
5
+ if (!e)
6
+ throw new Error(
7
+ "Video compound component must be rendered inside a <Video /> parent. If you need access to the video state outside the <Video /> tree, use the useVideo() hook instead."
8
+ );
9
+ return e;
10
+ }
11
+ export {
12
+ o as VideoContext,
13
+ d as VideoProvider,
14
+ i as useVideoContext
15
+ };