@oiz/stzh-components 2.0.0 → 2.1.0-alpha

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 (638) hide show
  1. package/dist/cjs/{app-globals-ec8cc33e.js → app-globals-e1f4f1d9.js} +1 -1
  2. package/dist/cjs/{dom-874a1e39.js → dom-9deb26c8.js} +1 -1
  3. package/dist/cjs/{index-ac9bdc7f.js → index-9fcb4305.js} +228 -210
  4. package/dist/cjs/loader.cjs.js +4 -4
  5. package/dist/cjs/{shadow-css-a33dc836.js → shadow-css-bf3843d2.js} +1 -1
  6. package/dist/cjs/stzh-accordion-item.cjs.entry.js +13 -23
  7. package/dist/cjs/stzh-accordion.cjs.entry.js +1 -3
  8. package/dist/cjs/stzh-actions.cjs.entry.js +3 -5
  9. package/dist/cjs/stzh-actionset.cjs.entry.js +16 -16
  10. package/dist/cjs/stzh-anchornav.cjs.entry.js +52 -0
  11. package/dist/cjs/stzh-appnav.cjs.entry.js +4 -7
  12. package/dist/cjs/stzh-appointments.cjs.entry.js +12 -17
  13. package/dist/cjs/stzh-audio.cjs.entry.js +4150 -0
  14. package/dist/cjs/stzh-badge_3.cjs.entry.js +26 -57
  15. package/dist/cjs/stzh-calendar.cjs.entry.js +9 -25
  16. package/dist/cjs/stzh-card-list.cjs.entry.js +6 -8
  17. package/dist/cjs/stzh-card.cjs.entry.js +20 -50
  18. package/dist/cjs/stzh-cell.cjs.entry.js +1 -8
  19. package/dist/cjs/stzh-checkbox.cjs.entry.js +15 -20
  20. package/dist/cjs/stzh-checkboxgroup.cjs.entry.js +29 -20
  21. package/dist/cjs/stzh-chip-select.cjs.entry.js +14 -16
  22. package/dist/cjs/stzh-chip.cjs.entry.js +14 -25
  23. package/dist/cjs/stzh-clamp.cjs.entry.js +27 -0
  24. package/dist/cjs/stzh-components.cjs.js +5 -5
  25. package/dist/cjs/stzh-container.cjs.entry.js +1 -1
  26. package/dist/cjs/stzh-cspace.cjs.entry.js +1 -1
  27. package/dist/cjs/stzh-datalist.cjs.entry.js +8 -20
  28. package/dist/cjs/stzh-datamessagelist-item.cjs.entry.js +11 -11
  29. package/dist/cjs/stzh-datamessagelist.cjs.entry.js +1 -1
  30. package/dist/cjs/stzh-datatable.cjs.entry.js +15 -21
  31. package/dist/cjs/stzh-datepicker_3.cjs.entry.js +431 -0
  32. package/dist/cjs/stzh-dialog.cjs.entry.js +11 -19
  33. package/dist/cjs/stzh-dropdown.cjs.entry.js +17 -37
  34. package/dist/cjs/stzh-fieldset.cjs.entry.js +1 -5
  35. package/dist/cjs/stzh-figure.cjs.entry.js +1 -3
  36. package/dist/cjs/stzh-flyingfocus.cjs.entry.js +7 -7
  37. package/dist/cjs/stzh-footer.cjs.entry.js +5 -5
  38. package/dist/cjs/stzh-ghettobox_2.cjs.entry.js +8 -19
  39. package/dist/cjs/stzh-header.cjs.entry.js +3 -9
  40. package/dist/cjs/stzh-heading.cjs.entry.js +1 -4
  41. package/dist/cjs/stzh-hr.cjs.entry.js +1 -1
  42. package/dist/cjs/stzh-hspace.cjs.entry.js +1 -10
  43. package/dist/cjs/stzh-icon-sprite.cjs.entry.js +2 -2
  44. package/dist/cjs/{stzh-input-description-9802abc2.js → stzh-input-description-4326b0d9.js} +1 -1
  45. package/dist/cjs/stzh-input.cjs.entry.js +30 -37
  46. package/dist/cjs/stzh-link.cjs.entry.js +23 -33
  47. package/dist/cjs/stzh-list-item.cjs.entry.js +1 -1
  48. package/dist/cjs/stzh-list.cjs.entry.js +1 -2
  49. package/dist/cjs/stzh-loader.cjs.entry.js +1 -4
  50. package/dist/cjs/stzh-loadingbar.cjs.entry.js +1 -4
  51. package/dist/cjs/stzh-menu_2.cjs.entry.js +11 -19
  52. package/dist/cjs/stzh-message.cjs.entry.js +5 -18
  53. package/dist/cjs/stzh-metanav.cjs.entry.js +1 -1
  54. package/dist/cjs/stzh-olmap.cjs.entry.js +51129 -0
  55. package/dist/cjs/stzh-overlay.cjs.entry.js +1 -4
  56. package/dist/cjs/stzh-page-skiplinks.cjs.entry.js +1 -1
  57. package/dist/cjs/stzh-pagetitle.cjs.entry.js +1 -1
  58. package/dist/cjs/stzh-popover.cjs.entry.js +10 -13
  59. package/dist/cjs/stzh-portal-mitwirken.cjs.entry.js +1 -1
  60. package/dist/cjs/stzh-progressbar-item.cjs.entry.js +9 -9
  61. package/dist/cjs/stzh-progressbar.cjs.entry.js +9 -24
  62. package/dist/cjs/stzh-readspeaker.cjs.entry.js +3 -1
  63. package/dist/cjs/stzh-row.cjs.entry.js +1 -9
  64. package/dist/cjs/stzh-saptcha.cjs.entry.js +4 -7
  65. package/dist/cjs/stzh-section.cjs.entry.js +1 -2
  66. package/dist/cjs/stzh-skiplink.cjs.entry.js +4 -2
  67. package/dist/cjs/stzh-sortable.cjs.entry.js +26 -30
  68. package/dist/cjs/stzh-status.cjs.entry.js +1 -5
  69. package/dist/cjs/stzh-sticky.cjs.entry.js +84 -0
  70. package/dist/cjs/stzh-table.cjs.entry.js +8 -10
  71. package/dist/cjs/stzh-text.cjs.entry.js +37 -0
  72. package/dist/cjs/stzh-toggle.cjs.entry.js +16 -22
  73. package/dist/cjs/stzh-tooltip.cjs.entry.js +12 -23
  74. package/dist/cjs/stzh-upload.cjs.entry.js +5 -127
  75. package/dist/cjs/stzh-vbz-linechip.cjs.entry.js +5 -7
  76. package/dist/cjs/stzh-vbz-majorticker.cjs.entry.js +8 -9
  77. package/dist/cjs/stzh-vbz-ticker.cjs.entry.js +6 -7
  78. package/dist/cjs/stzh-visuallyhidden.cjs.entry.js +1 -1
  79. package/dist/cjs/stzh-vspace.cjs.entry.js +1 -10
  80. package/dist/collection/assets/i18n/de.json +19 -0
  81. package/dist/collection/assets/i18n/en.json +19 -0
  82. package/dist/collection/assets/icons/mono/target-bullet.svg +12 -0
  83. package/dist/collection/assets/media/olmap/marker-active.png +0 -0
  84. package/dist/collection/assets/media/olmap/marker-position.png +0 -0
  85. package/dist/collection/assets/media/olmap/marker.png +0 -0
  86. package/dist/collection/assets/media/olmap/thumb-satellite.jpg +0 -0
  87. package/dist/collection/assets/media/olmap/thumb-streets.jpg +0 -0
  88. package/dist/collection/collection-manifest.json +7 -2
  89. package/dist/collection/components/stzh-accordion/stzh-accordion.js +0 -2
  90. package/dist/collection/components/stzh-accordion-item/stzh-accordion-item.js +12 -22
  91. package/dist/collection/components/stzh-actions/stzh-actions.js +2 -4
  92. package/dist/collection/components/stzh-actionset/stzh-actionset.js +21 -21
  93. package/dist/collection/components/stzh-anchornav/stzh-anchornav.css +286 -0
  94. package/dist/collection/components/stzh-anchornav/stzh-anchornav.js +216 -0
  95. package/dist/collection/components/stzh-anchornav/stzh-anchornav.stories.js +76 -0
  96. package/dist/collection/components/stzh-appnav/stzh-appnav.js +3 -6
  97. package/dist/collection/components/stzh-appointments/stzh-appointments.js +11 -16
  98. package/dist/collection/components/stzh-audio/stzh-audio.css +319 -0
  99. package/dist/collection/components/stzh-audio/stzh-audio.js +333 -0
  100. package/dist/collection/components/stzh-audio/stzh-audio.localization.js +1 -0
  101. package/dist/collection/components/stzh-audio/stzh-audio.stories.js +89 -0
  102. package/dist/collection/components/stzh-badge/stzh-badge.js +0 -2
  103. package/dist/collection/components/stzh-button/stzh-button.css +1 -0
  104. package/dist/collection/components/stzh-button/stzh-button.js +24 -45
  105. package/dist/collection/components/stzh-calendar/stzh-calendar.js +8 -24
  106. package/dist/collection/components/stzh-card/stzh-card.js +19 -49
  107. package/dist/collection/components/stzh-card-list/stzh-card-list.js +5 -7
  108. package/dist/collection/components/stzh-cell/stzh-cell.js +0 -7
  109. package/dist/collection/components/stzh-checkbox/stzh-checkbox.js +13 -18
  110. package/dist/collection/components/stzh-checkboxgroup/stzh-checkboxgroup.js +33 -20
  111. package/dist/collection/components/stzh-chip/stzh-chip.js +13 -24
  112. package/dist/collection/components/stzh-chip-select/stzh-chip-select.js +12 -14
  113. package/dist/collection/components/stzh-clamp/stzh-clamp.css +279 -0
  114. package/dist/collection/components/stzh-clamp/stzh-clamp.js +125 -0
  115. package/dist/collection/components/stzh-clamp/stzh-clamp.stories.js +41 -0
  116. package/dist/collection/components/stzh-datalist/stzh-datalist.js +7 -19
  117. package/dist/collection/components/stzh-datamessagelist-item/stzh-datamessagelist-item.js +10 -10
  118. package/dist/collection/components/stzh-datatable/stzh-datatable.js +14 -20
  119. package/dist/collection/components/stzh-datepicker/stzh-datepicker.js +19 -35
  120. package/dist/collection/components/stzh-dialog/stzh-dialog.js +10 -18
  121. package/dist/collection/components/stzh-dropdown/stzh-dropdown.js +15 -35
  122. package/dist/collection/components/stzh-fieldset/stzh-fieldset.js +0 -4
  123. package/dist/collection/components/stzh-figure/stzh-figure.js +0 -2
  124. package/dist/collection/components/stzh-flyingfocus/stzh-flyingfocus.js +6 -6
  125. package/dist/collection/components/stzh-footer/stzh-footer.js +4 -4
  126. package/dist/collection/components/stzh-ghettobox/stzh-ghettobox.js +7 -16
  127. package/dist/collection/components/stzh-ghettobox/stzh-ghettobox.stories.js +6 -6
  128. package/dist/collection/components/stzh-header/stzh-header.js +2 -8
  129. package/dist/collection/components/stzh-heading/stzh-heading.js +0 -3
  130. package/dist/collection/components/stzh-hr/stzh-hr.stories.js +11 -1
  131. package/dist/collection/components/stzh-hspace/stzh-hspace.js +0 -9
  132. package/dist/collection/components/stzh-icon/stzh-icon.js +0 -8
  133. package/dist/collection/components/stzh-icon-sprite/assets/svgsprites/symbol/sprite.symbol.html +19 -6
  134. package/dist/collection/components/stzh-icon-sprite/assets/svgsprites/symbol/svg/sprite.symbol.svg +1 -1
  135. package/dist/collection/components/stzh-input/stzh-input.js +29 -36
  136. package/dist/collection/components/stzh-link/stzh-link.css +18 -0
  137. package/dist/collection/components/stzh-link/stzh-link.js +57 -31
  138. package/dist/collection/components/stzh-link/stzh-link.stories.js +3 -1
  139. package/dist/collection/components/stzh-list/stzh-list.js +0 -1
  140. package/dist/collection/components/stzh-loader/stzh-loader.js +0 -3
  141. package/dist/collection/components/stzh-loadingbar/stzh-loadingbar.js +0 -3
  142. package/dist/collection/components/stzh-menu-item/stzh-menu-item.js +10 -18
  143. package/dist/collection/components/stzh-message/stzh-message.js +4 -17
  144. package/dist/collection/components/stzh-olmap/stzh-olmap.css +284 -0
  145. package/dist/collection/components/stzh-olmap/stzh-olmap.js +1042 -0
  146. package/dist/collection/components/stzh-olmap/stzh-olmap.localization.js +1 -0
  147. package/dist/collection/components/stzh-olmap/stzh-olmap.stories.js +36 -0
  148. package/dist/collection/components/stzh-overlay/stzh-overlay.js +0 -3
  149. package/dist/collection/components/stzh-popover/stzh-popover.js +9 -12
  150. package/dist/collection/components/stzh-portal-mitwirken/stzh-portal-mitwirken.js +1 -2
  151. package/dist/collection/components/stzh-portal-mitwirken/stzh-portal-mitwirken.stories.js +1 -1
  152. package/dist/collection/components/stzh-progressbar/stzh-progressbar.js +8 -23
  153. package/dist/collection/components/stzh-progressbar-item/stzh-progressbar-item.js +8 -8
  154. package/dist/collection/components/stzh-radio/stzh-radio.js +13 -18
  155. package/dist/collection/components/stzh-radiogroup/stzh-radiogroup.js +34 -22
  156. package/dist/collection/components/stzh-readspeaker/stzh-readspeaker.js +2 -0
  157. package/dist/collection/components/stzh-richtext/stzh-richtext.js +0 -2
  158. package/dist/collection/components/stzh-row/stzh-row.js +0 -8
  159. package/dist/collection/components/stzh-saptcha/stzh-saptcha.js +3 -6
  160. package/dist/collection/components/stzh-section/stzh-section.js +0 -1
  161. package/dist/collection/components/stzh-skiplink/stzh-skiplink.js +3 -1
  162. package/dist/collection/components/stzh-sortable/stzh-sortable.js +25 -29
  163. package/dist/collection/components/stzh-status/stzh-status.js +0 -4
  164. package/dist/collection/components/stzh-sticky/stzh-sticky.css +144 -0
  165. package/dist/collection/components/stzh-sticky/stzh-sticky.js +184 -0
  166. package/dist/collection/components/stzh-sticky/stzh-sticky.stories.js +91 -0
  167. package/dist/collection/components/stzh-table/stzh-table.js +7 -9
  168. package/dist/collection/components/stzh-text/stzh-text.js +0 -8
  169. package/dist/collection/components/stzh-toggle/stzh-toggle.js +14 -20
  170. package/dist/collection/components/stzh-tooltip/stzh-tooltip.js +11 -22
  171. package/dist/collection/components/stzh-upload/stzh-upload.js +3 -125
  172. package/dist/collection/components/stzh-vbz-linechip/stzh-vbz-linechip.js +4 -6
  173. package/dist/collection/components/stzh-vbz-majorticker/stzh-vbz-majorticker.js +7 -8
  174. package/dist/collection/components/stzh-vbz-ticker/stzh-vbz-ticker.js +5 -6
  175. package/dist/collection/components/stzh-vspace/stzh-vspace.js +0 -9
  176. package/dist/collection/pages/meinkonto.stories.js +2 -2
  177. package/dist/components/index.d.ts +5 -0
  178. package/dist/components/index.js +6 -1
  179. package/dist/components/stzh-accordion-item.js +12 -22
  180. package/dist/components/stzh-accordion.js +0 -2
  181. package/dist/components/stzh-actions.js +2 -4
  182. package/dist/components/stzh-actionset2.js +15 -15
  183. package/dist/components/stzh-anchornav.d.ts +11 -0
  184. package/dist/components/stzh-anchornav.js +97 -0
  185. package/dist/components/stzh-appnav.js +3 -6
  186. package/dist/components/stzh-appointments.js +11 -16
  187. package/dist/components/stzh-audio.d.ts +11 -0
  188. package/dist/components/stzh-audio.js +4195 -0
  189. package/dist/components/stzh-badge2.js +0 -2
  190. package/dist/components/stzh-button2.js +25 -46
  191. package/dist/components/stzh-calendar2.js +8 -24
  192. package/dist/components/stzh-card-list.js +5 -7
  193. package/dist/components/stzh-card.js +19 -49
  194. package/dist/components/stzh-cell.js +0 -7
  195. package/dist/components/stzh-checkbox.js +13 -18
  196. package/dist/components/stzh-checkboxgroup.js +28 -19
  197. package/dist/components/stzh-chip-select.js +12 -14
  198. package/dist/components/stzh-chip2.js +13 -24
  199. package/dist/components/stzh-clamp.d.ts +11 -0
  200. package/dist/components/stzh-clamp.js +6 -0
  201. package/dist/components/stzh-clamp2.js +43 -0
  202. package/dist/components/stzh-datalist.js +7 -19
  203. package/dist/components/stzh-datamessagelist-item.js +10 -10
  204. package/dist/components/stzh-datatable.js +14 -20
  205. package/dist/components/stzh-datepicker2.js +19 -35
  206. package/dist/components/stzh-dialog.js +10 -18
  207. package/dist/components/stzh-dropdown2.js +15 -35
  208. package/dist/components/stzh-fieldset.js +0 -4
  209. package/dist/components/stzh-figure.js +0 -2
  210. package/dist/components/stzh-flyingfocus.js +6 -6
  211. package/dist/components/stzh-footer.js +4 -4
  212. package/dist/components/stzh-ghettobox2.js +7 -16
  213. package/dist/components/stzh-header.js +2 -8
  214. package/dist/components/stzh-heading2.js +0 -3
  215. package/dist/components/stzh-hspace.js +0 -9
  216. package/dist/components/stzh-icon-sprite.js +1 -1
  217. package/dist/components/stzh-icon2.js +0 -8
  218. package/dist/components/stzh-input2.js +28 -35
  219. package/dist/components/stzh-link2.js +24 -32
  220. package/dist/components/stzh-list.js +0 -1
  221. package/dist/components/stzh-loader.js +1 -43
  222. package/dist/components/stzh-loader2.js +42 -0
  223. package/dist/components/stzh-loadingbar.js +0 -3
  224. package/dist/components/stzh-menu-item2.js +10 -18
  225. package/dist/components/stzh-message.js +4 -17
  226. package/dist/components/stzh-olmap.d.ts +11 -0
  227. package/dist/components/stzh-olmap.js +51168 -0
  228. package/dist/components/stzh-overlay.js +0 -3
  229. package/dist/components/stzh-popover2.js +9 -12
  230. package/dist/components/stzh-progressbar-item2.js +8 -8
  231. package/dist/components/stzh-progressbar.js +8 -23
  232. package/dist/components/stzh-radio2.js +13 -18
  233. package/dist/components/stzh-radiogroup2.js +29 -21
  234. package/dist/components/stzh-readspeaker.js +2 -0
  235. package/dist/components/stzh-richtext2.js +0 -2
  236. package/dist/components/stzh-row.js +0 -8
  237. package/dist/components/stzh-saptcha.js +3 -6
  238. package/dist/components/stzh-section.js +0 -1
  239. package/dist/components/stzh-skiplink.js +3 -1
  240. package/dist/components/stzh-sortable2.js +25 -29
  241. package/dist/components/stzh-status2.js +0 -4
  242. package/dist/components/stzh-sticky.d.ts +11 -0
  243. package/dist/components/stzh-sticky.js +102 -0
  244. package/dist/components/stzh-table.js +7 -9
  245. package/dist/components/stzh-text2.js +0 -8
  246. package/dist/components/stzh-toggle.js +14 -20
  247. package/dist/components/stzh-tooltip2.js +11 -22
  248. package/dist/components/stzh-upload.js +3 -125
  249. package/dist/components/stzh-vbz-linechip2.js +4 -6
  250. package/dist/components/stzh-vbz-majorticker.js +7 -8
  251. package/dist/components/stzh-vbz-ticker.js +5 -6
  252. package/dist/components/stzh-vspace.js +0 -9
  253. package/dist/esm/{app-globals-e66420b3.js → app-globals-453acbdb.js} +1 -1
  254. package/dist/esm/{dom-104fb833.js → dom-6be6f662.js} +1 -1
  255. package/dist/esm/{index-84f71a43.js → index-2915b467.js} +228 -210
  256. package/dist/esm/loader.js +4 -4
  257. package/dist/esm/polyfills/css-shim.js +1 -1
  258. package/dist/esm/{shadow-css-4261c637.js → shadow-css-ed4599f8.js} +1 -1
  259. package/dist/esm/stzh-accordion-item.entry.js +13 -23
  260. package/dist/esm/stzh-accordion.entry.js +1 -3
  261. package/dist/esm/stzh-actions.entry.js +3 -5
  262. package/dist/esm/stzh-actionset.entry.js +16 -16
  263. package/dist/esm/stzh-anchornav.entry.js +48 -0
  264. package/dist/esm/stzh-appnav.entry.js +4 -7
  265. package/dist/esm/stzh-appointments.entry.js +12 -17
  266. package/dist/esm/stzh-audio.entry.js +4146 -0
  267. package/dist/esm/stzh-badge_3.entry.js +26 -57
  268. package/dist/esm/stzh-calendar.entry.js +10 -26
  269. package/dist/esm/stzh-card-list.entry.js +6 -8
  270. package/dist/esm/stzh-card.entry.js +20 -50
  271. package/dist/esm/stzh-cell.entry.js +1 -8
  272. package/dist/esm/stzh-checkbox.entry.js +15 -20
  273. package/dist/esm/stzh-checkboxgroup.entry.js +29 -20
  274. package/dist/esm/stzh-chip-select.entry.js +14 -16
  275. package/dist/esm/stzh-chip.entry.js +14 -25
  276. package/dist/esm/stzh-clamp.entry.js +23 -0
  277. package/dist/esm/stzh-components.js +5 -5
  278. package/dist/esm/stzh-container.entry.js +1 -1
  279. package/dist/esm/stzh-cspace.entry.js +1 -1
  280. package/dist/esm/stzh-datalist.entry.js +8 -20
  281. package/dist/esm/stzh-datamessagelist-item.entry.js +11 -11
  282. package/dist/esm/stzh-datamessagelist.entry.js +1 -1
  283. package/dist/esm/stzh-datatable.entry.js +15 -21
  284. package/dist/esm/stzh-datepicker_3.entry.js +425 -0
  285. package/dist/esm/stzh-dialog.entry.js +11 -19
  286. package/dist/esm/stzh-dropdown.entry.js +17 -37
  287. package/dist/esm/stzh-fieldset.entry.js +1 -5
  288. package/dist/esm/stzh-figure.entry.js +1 -3
  289. package/dist/esm/stzh-flyingfocus.entry.js +7 -7
  290. package/dist/esm/stzh-footer.entry.js +5 -5
  291. package/dist/esm/stzh-ghettobox_2.entry.js +8 -19
  292. package/dist/esm/stzh-header.entry.js +3 -9
  293. package/dist/esm/stzh-heading.entry.js +1 -4
  294. package/dist/esm/stzh-hr.entry.js +1 -1
  295. package/dist/esm/stzh-hspace.entry.js +1 -10
  296. package/dist/esm/stzh-icon-sprite.entry.js +2 -2
  297. package/dist/esm/{stzh-input-description-8c477f97.js → stzh-input-description-e87e6697.js} +1 -1
  298. package/dist/esm/stzh-input.entry.js +30 -37
  299. package/dist/esm/stzh-link.entry.js +23 -33
  300. package/dist/esm/stzh-list-item.entry.js +1 -1
  301. package/dist/esm/stzh-list.entry.js +1 -2
  302. package/dist/esm/stzh-loader.entry.js +1 -4
  303. package/dist/esm/stzh-loadingbar.entry.js +1 -4
  304. package/dist/esm/stzh-menu_2.entry.js +11 -19
  305. package/dist/esm/stzh-message.entry.js +5 -18
  306. package/dist/esm/stzh-metanav.entry.js +1 -1
  307. package/dist/esm/stzh-olmap.entry.js +51125 -0
  308. package/dist/esm/stzh-overlay.entry.js +1 -4
  309. package/dist/esm/stzh-page-skiplinks.entry.js +1 -1
  310. package/dist/esm/stzh-pagetitle.entry.js +1 -1
  311. package/dist/esm/stzh-popover.entry.js +10 -13
  312. package/dist/esm/stzh-portal-mitwirken.entry.js +1 -1
  313. package/dist/esm/stzh-progressbar-item.entry.js +9 -9
  314. package/dist/esm/stzh-progressbar.entry.js +9 -24
  315. package/dist/esm/stzh-readspeaker.entry.js +3 -1
  316. package/dist/esm/stzh-row.entry.js +1 -9
  317. package/dist/esm/stzh-saptcha.entry.js +4 -7
  318. package/dist/esm/stzh-section.entry.js +1 -2
  319. package/dist/esm/stzh-skiplink.entry.js +4 -2
  320. package/dist/esm/stzh-sortable.entry.js +26 -30
  321. package/dist/esm/stzh-status.entry.js +1 -5
  322. package/dist/esm/stzh-sticky.entry.js +80 -0
  323. package/dist/esm/stzh-table.entry.js +8 -10
  324. package/dist/esm/stzh-text.entry.js +33 -0
  325. package/dist/esm/stzh-toggle.entry.js +16 -22
  326. package/dist/esm/stzh-tooltip.entry.js +12 -23
  327. package/dist/esm/stzh-upload.entry.js +5 -127
  328. package/dist/esm/stzh-vbz-linechip.entry.js +5 -7
  329. package/dist/esm/stzh-vbz-majorticker.entry.js +8 -9
  330. package/dist/esm/stzh-vbz-ticker.entry.js +6 -7
  331. package/dist/esm/stzh-visuallyhidden.entry.js +1 -1
  332. package/dist/esm/stzh-vspace.entry.js +1 -10
  333. package/dist/esm-es5/app-globals-453acbdb.js +1 -0
  334. package/dist/esm-es5/{dom-104fb833.js → dom-6be6f662.js} +0 -0
  335. package/dist/esm-es5/index-2915b467.js +2 -0
  336. package/dist/esm-es5/loader.js +1 -1
  337. package/dist/esm-es5/{shadow-css-4261c637.js → shadow-css-ed4599f8.js} +0 -0
  338. package/dist/esm-es5/stzh-accordion-item.entry.js +1 -1
  339. package/dist/esm-es5/stzh-accordion.entry.js +1 -1
  340. package/dist/esm-es5/stzh-actions.entry.js +1 -1
  341. package/dist/esm-es5/stzh-actionset.entry.js +1 -1
  342. package/dist/esm-es5/stzh-anchornav.entry.js +1 -0
  343. package/dist/esm-es5/stzh-appnav.entry.js +1 -1
  344. package/dist/esm-es5/stzh-appointments.entry.js +1 -1
  345. package/dist/esm-es5/stzh-audio.entry.js +31 -0
  346. package/dist/esm-es5/stzh-badge_3.entry.js +1 -1
  347. package/dist/esm-es5/stzh-calendar.entry.js +1 -1
  348. package/dist/esm-es5/stzh-card-list.entry.js +1 -1
  349. package/dist/esm-es5/stzh-card.entry.js +1 -1
  350. package/dist/esm-es5/stzh-cell.entry.js +1 -1
  351. package/dist/esm-es5/stzh-checkbox.entry.js +1 -1
  352. package/dist/esm-es5/stzh-checkboxgroup.entry.js +1 -1
  353. package/dist/esm-es5/stzh-chip-select.entry.js +1 -1
  354. package/dist/esm-es5/stzh-chip.entry.js +1 -1
  355. package/dist/esm-es5/stzh-clamp.entry.js +1 -0
  356. package/dist/esm-es5/stzh-components.js +1 -1
  357. package/dist/esm-es5/stzh-container.entry.js +1 -1
  358. package/dist/esm-es5/stzh-cspace.entry.js +1 -1
  359. package/dist/esm-es5/stzh-datalist.entry.js +1 -1
  360. package/dist/esm-es5/stzh-datamessagelist-item.entry.js +1 -1
  361. package/dist/esm-es5/stzh-datamessagelist.entry.js +1 -1
  362. package/dist/esm-es5/stzh-datatable.entry.js +2 -2
  363. package/dist/esm-es5/stzh-datepicker_3.entry.js +1 -0
  364. package/dist/esm-es5/stzh-dialog.entry.js +1 -1
  365. package/dist/esm-es5/stzh-dropdown.entry.js +1 -1
  366. package/dist/esm-es5/stzh-fieldset.entry.js +1 -1
  367. package/dist/esm-es5/stzh-figure.entry.js +1 -1
  368. package/dist/esm-es5/stzh-flyingfocus.entry.js +1 -1
  369. package/dist/esm-es5/stzh-footer.entry.js +1 -1
  370. package/dist/esm-es5/stzh-ghettobox_2.entry.js +1 -1
  371. package/dist/esm-es5/stzh-header.entry.js +1 -1
  372. package/dist/esm-es5/stzh-heading.entry.js +1 -1
  373. package/dist/esm-es5/stzh-hr.entry.js +1 -1
  374. package/dist/esm-es5/stzh-hspace.entry.js +1 -1
  375. package/dist/esm-es5/stzh-icon-sprite.entry.js +1 -1
  376. package/dist/esm-es5/{stzh-input-description-8c477f97.js → stzh-input-description-e87e6697.js} +1 -1
  377. package/dist/esm-es5/stzh-input.entry.js +1 -1
  378. package/dist/esm-es5/stzh-link.entry.js +1 -1
  379. package/dist/esm-es5/stzh-list-item.entry.js +1 -1
  380. package/dist/esm-es5/stzh-list.entry.js +1 -1
  381. package/dist/esm-es5/stzh-loader.entry.js +1 -1
  382. package/dist/esm-es5/stzh-loadingbar.entry.js +1 -1
  383. package/dist/esm-es5/stzh-menu_2.entry.js +1 -1
  384. package/dist/esm-es5/stzh-message.entry.js +1 -1
  385. package/dist/esm-es5/stzh-metanav.entry.js +1 -1
  386. package/dist/esm-es5/stzh-olmap.entry.js +7 -0
  387. package/dist/esm-es5/stzh-overlay.entry.js +1 -1
  388. package/dist/esm-es5/stzh-page-skiplinks.entry.js +1 -1
  389. package/dist/esm-es5/stzh-pagetitle.entry.js +1 -1
  390. package/dist/esm-es5/stzh-popover.entry.js +1 -1
  391. package/dist/esm-es5/stzh-portal-mitwirken.entry.js +1 -1
  392. package/dist/esm-es5/stzh-progressbar-item.entry.js +1 -1
  393. package/dist/esm-es5/stzh-progressbar.entry.js +1 -1
  394. package/dist/esm-es5/stzh-readspeaker.entry.js +1 -1
  395. package/dist/esm-es5/stzh-row.entry.js +1 -1
  396. package/dist/esm-es5/stzh-saptcha.entry.js +1 -1
  397. package/dist/esm-es5/stzh-section.entry.js +1 -1
  398. package/dist/esm-es5/stzh-skiplink.entry.js +1 -1
  399. package/dist/esm-es5/stzh-sortable.entry.js +2 -2
  400. package/dist/esm-es5/stzh-status.entry.js +1 -1
  401. package/dist/esm-es5/stzh-sticky.entry.js +1 -0
  402. package/dist/esm-es5/stzh-table.entry.js +1 -1
  403. package/dist/{stzh-components/p-fc6b4f91.system.entry.js → esm-es5/stzh-text.entry.js} +1 -1
  404. package/dist/esm-es5/stzh-toggle.entry.js +1 -1
  405. package/dist/esm-es5/stzh-tooltip.entry.js +1 -1
  406. package/dist/esm-es5/stzh-upload.entry.js +1 -1
  407. package/dist/esm-es5/stzh-vbz-linechip.entry.js +1 -1
  408. package/dist/esm-es5/stzh-vbz-majorticker.entry.js +1 -1
  409. package/dist/esm-es5/stzh-vbz-ticker.entry.js +1 -1
  410. package/dist/esm-es5/stzh-visuallyhidden.entry.js +1 -1
  411. package/dist/esm-es5/stzh-vspace.entry.js +1 -1
  412. package/dist/stzh-components/assets/i18n/de.json +19 -0
  413. package/dist/stzh-components/assets/i18n/en.json +19 -0
  414. package/dist/stzh-components/assets/icons/mono/target-bullet.svg +12 -0
  415. package/dist/stzh-components/assets/media/olmap/marker-active.png +0 -0
  416. package/dist/stzh-components/assets/media/olmap/marker-position.png +0 -0
  417. package/dist/stzh-components/assets/media/olmap/marker.png +0 -0
  418. package/dist/stzh-components/assets/media/olmap/thumb-satellite.jpg +0 -0
  419. package/dist/stzh-components/assets/media/olmap/thumb-streets.jpg +0 -0
  420. package/dist/stzh-components/assets/svgsprites/symbol/sprite.symbol.html +19 -6
  421. package/dist/stzh-components/assets/svgsprites/symbol/svg/sprite.symbol.svg +1 -1
  422. package/dist/stzh-components/{p-5a354428.system.entry.js → p-011dcf30.system.entry.js} +1 -1
  423. package/dist/stzh-components/{p-f24db7e8.system.entry.js → p-01909f35.system.entry.js} +1 -1
  424. package/dist/stzh-components/p-020379d7.system.entry.js +7 -0
  425. package/dist/stzh-components/p-025953d1.system.entry.js +1 -0
  426. package/dist/stzh-components/{p-981b2629.system.entry.js → p-0321e98e.system.entry.js} +1 -1
  427. package/dist/stzh-components/p-04dd6821.entry.js +1 -0
  428. package/dist/stzh-components/{p-929dbdf1.system.entry.js → p-05901b22.system.entry.js} +1 -1
  429. package/dist/stzh-components/{p-fdf0b4bc.system.entry.js → p-08714718.system.entry.js} +1 -1
  430. package/dist/stzh-components/{p-8b6de2c0.system.entry.js → p-090bfb8e.system.entry.js} +1 -1
  431. package/dist/stzh-components/{p-051bc2a8.entry.js → p-0977d9b6.entry.js} +1 -1
  432. package/dist/stzh-components/{p-713ae713.entry.js → p-0c10d9b1.entry.js} +2 -2
  433. package/dist/stzh-components/{p-ebeb8d7b.system.entry.js → p-0e474d1a.system.entry.js} +1 -1
  434. package/dist/stzh-components/p-0e48efa7.entry.js +1 -0
  435. package/dist/stzh-components/{p-4c61dcad.js → p-13051e1c.js} +0 -0
  436. package/dist/stzh-components/{p-5f4eb46c.entry.js → p-1399b2d7.entry.js} +1 -1
  437. package/dist/stzh-components/p-140e4b63.entry.js +1 -0
  438. package/dist/stzh-components/{p-eb61c369.entry.js → p-14f0d546.entry.js} +1 -1
  439. package/dist/stzh-components/{p-796ae62c.system.entry.js → p-183e4790.system.entry.js} +1 -1
  440. package/dist/stzh-components/p-1a5fc8e3.system.entry.js +1 -0
  441. package/dist/stzh-components/{p-db5363ef.entry.js → p-20a6ffbb.entry.js} +1 -1
  442. package/dist/stzh-components/p-229f4ebc.system.entry.js +1 -0
  443. package/dist/stzh-components/{p-89274cd5.system.entry.js → p-26159eac.system.entry.js} +1 -1
  444. package/dist/stzh-components/{p-6523a23b.system.js → p-2732d8c8.system.js} +0 -0
  445. package/dist/stzh-components/{p-56b9cc3c.system.entry.js → p-27573504.system.entry.js} +1 -1
  446. package/dist/stzh-components/{p-9e716229.entry.js → p-27839f48.entry.js} +1 -1
  447. package/dist/stzh-components/{p-fc13d017.system.entry.js → p-27bfb4c2.system.entry.js} +1 -1
  448. package/dist/stzh-components/{p-29427863.entry.js → p-29d9a568.entry.js} +1 -1
  449. package/dist/stzh-components/p-2bf021f2.js +1 -0
  450. package/dist/stzh-components/{p-f1356a85.entry.js → p-2c16d2ea.entry.js} +1 -1
  451. package/dist/stzh-components/p-2c783943.entry.js +1 -0
  452. package/dist/stzh-components/p-2c891eee.entry.js +1 -0
  453. package/dist/stzh-components/{p-17c6c1db.system.entry.js → p-2e276f2e.system.entry.js} +1 -1
  454. package/dist/stzh-components/{p-5bd2849d.entry.js → p-30e5a674.entry.js} +1 -1
  455. package/dist/stzh-components/{p-19bff884.system.entry.js → p-33a52001.system.entry.js} +1 -1
  456. package/dist/stzh-components/{p-b462a61f.entry.js → p-34eb65b9.entry.js} +1 -1
  457. package/dist/stzh-components/p-3623b3a5.system.js +1 -0
  458. package/dist/stzh-components/p-36596b2b.system.entry.js +1 -0
  459. package/dist/stzh-components/{p-d6c07494.system.entry.js → p-37bdb9cd.system.entry.js} +1 -1
  460. package/dist/stzh-components/p-38977481.entry.js +1 -0
  461. package/dist/stzh-components/p-3a279b45.entry.js +1 -0
  462. package/dist/stzh-components/p-3a47ff2d.system.entry.js +1 -0
  463. package/dist/stzh-components/p-3b33fa76.system.entry.js +1 -0
  464. package/dist/stzh-components/{p-2b338050.entry.js → p-3e24b964.entry.js} +1 -1
  465. package/dist/stzh-components/{p-ee22256f.entry.js → p-3e504f50.entry.js} +1 -1
  466. package/dist/stzh-components/{p-bb3c1249.entry.js → p-3efefb7f.entry.js} +1 -1
  467. package/dist/stzh-components/{p-21566d65.system.entry.js → p-3f8976bc.system.entry.js} +1 -1
  468. package/dist/stzh-components/{p-8d0da18d.system.entry.js → p-3fc40cc0.system.entry.js} +1 -1
  469. package/dist/stzh-components/{p-4c6989ae.system.entry.js → p-440ae0cc.system.entry.js} +1 -1
  470. package/dist/stzh-components/{p-b550feaa.system.entry.js → p-44435254.system.entry.js} +1 -1
  471. package/dist/stzh-components/{p-ab246b66.entry.js → p-456143f9.entry.js} +1 -1
  472. package/dist/stzh-components/{p-190de4de.entry.js → p-46f4e907.entry.js} +1 -1
  473. package/dist/stzh-components/{p-d1552460.system.entry.js → p-470e5f38.system.entry.js} +1 -1
  474. package/dist/stzh-components/{p-ce070ccd.entry.js → p-4b93fb24.entry.js} +1 -1
  475. package/dist/stzh-components/{p-20ef4a20.system.entry.js → p-509c97c9.system.entry.js} +1 -1
  476. package/dist/stzh-components/{p-0fc83964.system.entry.js → p-529a56aa.system.entry.js} +1 -1
  477. package/dist/stzh-components/{p-63d89b96.system.js → p-52cd1bd1.system.js} +1 -1
  478. package/dist/stzh-components/p-53c30c58.entry.js +1 -0
  479. package/dist/stzh-components/p-55435022.system.entry.js +1 -0
  480. package/dist/stzh-components/p-554fb3ac.system.js +1 -0
  481. package/dist/stzh-components/{p-e213663c.system.entry.js → p-5869502c.system.entry.js} +1 -1
  482. package/dist/stzh-components/p-58714045.entry.js +1 -0
  483. package/dist/stzh-components/p-59970f71.entry.js +1 -0
  484. package/dist/stzh-components/{p-3d8317b5.entry.js → p-5c2d0572.entry.js} +1 -1
  485. package/dist/stzh-components/p-5c311df3.entry.js +1 -0
  486. package/dist/stzh-components/{p-72f29f07.entry.js → p-5e81420b.entry.js} +1 -1
  487. package/dist/stzh-components/p-609bf766.system.js +2 -0
  488. package/dist/stzh-components/{p-f832e938.system.entry.js → p-616e70e9.system.entry.js} +1 -1
  489. package/dist/stzh-components/p-62afe664.entry.js +1 -0
  490. package/dist/stzh-components/p-62c7caed.entry.js +1 -0
  491. package/dist/stzh-components/{p-851e0caa.system.entry.js → p-641126a8.system.entry.js} +1 -1
  492. package/dist/stzh-components/{p-562e6c52.entry.js → p-648e03bc.entry.js} +1 -1
  493. package/dist/stzh-components/p-652eee8b.system.entry.js +1 -0
  494. package/dist/stzh-components/{p-69c3187f.system.entry.js → p-67ade1c7.system.entry.js} +1 -1
  495. package/dist/stzh-components/p-6a16ceff.entry.js +1 -0
  496. package/dist/stzh-components/{p-9c72f491.system.entry.js → p-6a96d63e.system.entry.js} +1 -1
  497. package/dist/stzh-components/{p-b391d962.system.entry.js → p-6b2282cd.system.entry.js} +1 -1
  498. package/dist/stzh-components/{p-3b912468.system.entry.js → p-6b5f447c.system.entry.js} +1 -1
  499. package/dist/stzh-components/{p-33c0229f.system.entry.js → p-6c1ad586.system.entry.js} +1 -1
  500. package/dist/stzh-components/{p-f788a468.entry.js → p-6c76e51d.entry.js} +1 -1
  501. package/dist/stzh-components/{p-3042b23e.entry.js → p-6cbdbd06.entry.js} +1 -1
  502. package/dist/stzh-components/{p-64b4cc74.entry.js → p-6f7a7f7a.entry.js} +1 -1
  503. package/dist/stzh-components/{p-61aac051.system.entry.js → p-725b3e74.system.entry.js} +1 -1
  504. package/dist/stzh-components/p-74786856.system.entry.js +1 -0
  505. package/dist/stzh-components/p-783346ed.entry.js +1 -0
  506. package/dist/stzh-components/p-7a4c6adb.js +2 -0
  507. package/dist/stzh-components/{p-a7ee2636.entry.js → p-7d77b8d2.entry.js} +1 -1
  508. package/dist/stzh-components/{p-9fb4da92.system.entry.js → p-7dd6fbc9.system.entry.js} +1 -1
  509. package/dist/stzh-components/{p-f84fa2a4.js → p-8347b91f.js} +1 -1
  510. package/dist/stzh-components/{p-ef5d4167.js → p-8364475f.js} +0 -0
  511. package/dist/stzh-components/{p-bbe4e3d1.system.entry.js → p-881e526e.system.entry.js} +1 -1
  512. package/dist/stzh-components/p-8d9056de.entry.js +1 -0
  513. package/dist/stzh-components/p-8e363084.system.entry.js +1 -0
  514. package/dist/stzh-components/{p-8d547247.system.entry.js → p-8eb72064.system.entry.js} +1 -1
  515. package/dist/stzh-components/{p-fa56fc0d.system.entry.js → p-8fc8d8c2.system.entry.js} +1 -1
  516. package/dist/stzh-components/{p-6305db38.system.entry.js → p-90665664.system.entry.js} +1 -1
  517. package/dist/stzh-components/{p-48b5b697.system.entry.js → p-90941379.system.entry.js} +1 -1
  518. package/dist/stzh-components/p-90ad5e2c.entry.js +1 -0
  519. package/dist/stzh-components/p-92788577.entry.js +34 -0
  520. package/dist/stzh-components/{p-27fd6c6f.system.entry.js → p-92ad9720.system.entry.js} +1 -1
  521. package/dist/stzh-components/{p-c58dd9de.entry.js → p-9454a438.entry.js} +1 -1
  522. package/dist/stzh-components/{p-530252c6.system.entry.js → p-965829a6.system.entry.js} +1 -1
  523. package/dist/stzh-components/p-9a7593f5.entry.js +1 -0
  524. package/dist/stzh-components/{p-58d886cb.system.entry.js → p-9ca1efe4.system.entry.js} +1 -1
  525. package/dist/stzh-components/p-9d58c713.entry.js +1 -0
  526. package/dist/stzh-components/p-a10e0117.system.entry.js +1 -0
  527. package/dist/stzh-components/{p-3f0363db.entry.js → p-a3559e69.entry.js} +1 -1
  528. package/dist/stzh-components/p-a4a4370d.entry.js +1 -0
  529. package/dist/stzh-components/{p-7ec2f3fd.entry.js → p-a61bf274.entry.js} +2 -2
  530. package/dist/stzh-components/{p-8c648042.system.entry.js → p-a6da8c06.system.entry.js} +1 -1
  531. package/dist/stzh-components/{p-ccd30d73.system.entry.js → p-afaa9c37.system.entry.js} +1 -1
  532. package/dist/stzh-components/{p-88e0f453.entry.js → p-b09b85ac.entry.js} +1 -1
  533. package/dist/stzh-components/{p-5997e418.system.entry.js → p-b3587b9d.system.entry.js} +1 -1
  534. package/dist/stzh-components/{p-a67e09cd.system.entry.js → p-b491bcd7.system.entry.js} +1 -1
  535. package/dist/stzh-components/p-b5a59ac0.entry.js +1 -0
  536. package/dist/stzh-components/p-b666bb15.entry.js +1 -0
  537. package/dist/stzh-components/{p-2e559062.entry.js → p-b99c0844.entry.js} +1 -1
  538. package/dist/stzh-components/p-bb8f71a4.entry.js +7 -0
  539. package/dist/stzh-components/p-bb9e8364.entry.js +1 -0
  540. package/dist/stzh-components/p-bc841847.entry.js +1 -0
  541. package/dist/stzh-components/p-bd7dd853.system.entry.js +1 -0
  542. package/dist/stzh-components/p-bdc627fa.system.entry.js +1 -0
  543. package/dist/stzh-components/p-be534671.entry.js +1 -0
  544. package/dist/stzh-components/p-bfdce66c.entry.js +1 -0
  545. package/dist/stzh-components/p-c051fc3b.entry.js +1 -0
  546. package/dist/stzh-components/p-c1100fde.entry.js +1 -0
  547. package/dist/stzh-components/{p-55d23a3c.system.entry.js → p-c3161c9b.system.entry.js} +1 -1
  548. package/dist/stzh-components/{p-0fc06049.system.entry.js → p-c5749124.system.entry.js} +1 -1
  549. package/dist/stzh-components/{p-786a92d4.system.entry.js → p-c6813d9f.system.entry.js} +1 -1
  550. package/dist/stzh-components/p-c7c3735a.entry.js +1 -0
  551. package/dist/stzh-components/{p-c4fc6433.system.entry.js → p-c8009c05.system.entry.js} +1 -1
  552. package/dist/stzh-components/{p-d0aa9d3b.entry.js → p-c866224d.entry.js} +1 -1
  553. package/dist/stzh-components/p-cbaab05e.entry.js +1 -0
  554. package/dist/stzh-components/{p-5353ba86.system.entry.js → p-cc735465.system.entry.js} +2 -2
  555. package/dist/stzh-components/{p-6a873872.entry.js → p-d00e20ff.entry.js} +1 -1
  556. package/dist/stzh-components/{p-c3d93395.entry.js → p-d26ed018.entry.js} +1 -1
  557. package/dist/stzh-components/{p-84ab53cc.system.entry.js → p-d408604f.system.entry.js} +1 -1
  558. package/dist/stzh-components/{p-b9a027aa.entry.js → p-d69b12f8.entry.js} +1 -1
  559. package/dist/stzh-components/p-da857e0d.entry.js +1 -0
  560. package/dist/stzh-components/{p-2ca4a828.system.entry.js → p-de8f9508.system.entry.js} +1 -1
  561. package/dist/stzh-components/{p-a7c35778.system.entry.js → p-e347ce1e.system.entry.js} +1 -1
  562. package/dist/stzh-components/{p-073c89b1.system.entry.js → p-e56d7b16.system.entry.js} +1 -1
  563. package/dist/stzh-components/{p-961cb979.entry.js → p-e662b688.entry.js} +1 -1
  564. package/dist/stzh-components/{p-c4b7c2be.entry.js → p-e69903fe.entry.js} +1 -1
  565. package/dist/stzh-components/p-e7afcd6f.entry.js +1 -0
  566. package/dist/stzh-components/p-e9313802.system.entry.js +31 -0
  567. package/dist/stzh-components/{p-560f96f0.system.entry.js → p-eb3425a1.system.entry.js} +1 -1
  568. package/dist/stzh-components/p-ee711f37.system.entry.js +1 -0
  569. package/dist/stzh-components/{p-b5a85078.system.entry.js → p-ee944add.system.entry.js} +1 -1
  570. package/dist/stzh-components/{p-5a02ef03.entry.js → p-ef62b905.entry.js} +1 -1
  571. package/dist/stzh-components/{p-a8de6293.system.js → p-f39f347c.system.js} +0 -0
  572. package/dist/stzh-components/p-f8ccf5b1.entry.js +1 -0
  573. package/dist/stzh-components/p-f9039c23.entry.js +1 -0
  574. package/dist/stzh-components/{p-ba94e315.system.entry.js → p-fa9a4cd5.system.entry.js} +1 -1
  575. package/dist/stzh-components/p-fade35c7.entry.js +1 -0
  576. package/dist/stzh-components/{p-684c345e.system.entry.js → p-fd811f6b.system.entry.js} +2 -2
  577. package/dist/stzh-components/stzh-components.esm.js +1 -1
  578. package/dist/stzh-components/stzh-components.js +1 -1
  579. package/dist/types/components/stzh-anchornav/stzh-anchornav.d.ts +32 -0
  580. package/dist/types/components/stzh-audio/stzh-audio.localization.d.ts +11 -0
  581. package/dist/types/components/stzh-clamp/stzh-clamp.d.ts +16 -0
  582. package/dist/types/components/stzh-olmap/stzh-olmap.localization.d.ts +10 -0
  583. package/dist/types/components/stzh-portal-mitwirken/stzh-portal-mitwirken.d.ts +1 -2
  584. package/dist/types/components.d.ts +448 -15
  585. package/dist/types/index.d.ts +66 -0
  586. package/dist/types/stencil-public-runtime.d.ts +20 -4
  587. package/dist/vscode-data.json +203 -6
  588. package/package.json +7 -2
  589. package/dist/cjs/stzh-datepicker_4.cjs.entry.js +0 -483
  590. package/dist/esm/stzh-datepicker_4.entry.js +0 -476
  591. package/dist/esm-es5/app-globals-e66420b3.js +0 -1
  592. package/dist/esm-es5/index-84f71a43.js +0 -2
  593. package/dist/esm-es5/stzh-datepicker_4.entry.js +0 -1
  594. package/dist/stzh-components/p-001b7d10.entry.js +0 -1
  595. package/dist/stzh-components/p-03ea86bd.entry.js +0 -1
  596. package/dist/stzh-components/p-0711e511.entry.js +0 -1
  597. package/dist/stzh-components/p-08a564af.entry.js +0 -1
  598. package/dist/stzh-components/p-0bbbbe85.system.entry.js +0 -1
  599. package/dist/stzh-components/p-13b3500e.entry.js +0 -1
  600. package/dist/stzh-components/p-1440163c.system.entry.js +0 -1
  601. package/dist/stzh-components/p-18958371.entry.js +0 -1
  602. package/dist/stzh-components/p-216577b4.entry.js +0 -1
  603. package/dist/stzh-components/p-22701389.system.entry.js +0 -1
  604. package/dist/stzh-components/p-252d3178.entry.js +0 -1
  605. package/dist/stzh-components/p-2cf1ae40.system.entry.js +0 -1
  606. package/dist/stzh-components/p-3beb58d6.system.entry.js +0 -1
  607. package/dist/stzh-components/p-45bab70d.system.entry.js +0 -1
  608. package/dist/stzh-components/p-552f49c4.entry.js +0 -1
  609. package/dist/stzh-components/p-55cdbf79.entry.js +0 -1
  610. package/dist/stzh-components/p-62db1e59.entry.js +0 -1
  611. package/dist/stzh-components/p-638bedfa.entry.js +0 -1
  612. package/dist/stzh-components/p-6425898c.entry.js +0 -1
  613. package/dist/stzh-components/p-676fd54d.entry.js +0 -1
  614. package/dist/stzh-components/p-69f4a27e.entry.js +0 -1
  615. package/dist/stzh-components/p-764ba190.entry.js +0 -1
  616. package/dist/stzh-components/p-7d8c9866.entry.js +0 -1
  617. package/dist/stzh-components/p-80d70586.entry.js +0 -1
  618. package/dist/stzh-components/p-838df84a.system.entry.js +0 -1
  619. package/dist/stzh-components/p-85161133.js +0 -1
  620. package/dist/stzh-components/p-864d7c50.entry.js +0 -1
  621. package/dist/stzh-components/p-93e8e31f.js +0 -2
  622. package/dist/stzh-components/p-9469b812.entry.js +0 -1
  623. package/dist/stzh-components/p-a3fa6122.system.entry.js +0 -1
  624. package/dist/stzh-components/p-a448f5a5.entry.js +0 -1
  625. package/dist/stzh-components/p-a646c09a.entry.js +0 -1
  626. package/dist/stzh-components/p-a6627504.entry.js +0 -1
  627. package/dist/stzh-components/p-b70bc70c.system.js +0 -1
  628. package/dist/stzh-components/p-be461e19.system.entry.js +0 -1
  629. package/dist/stzh-components/p-bf0fdd23.system.js +0 -2
  630. package/dist/stzh-components/p-c1337453.entry.js +0 -1
  631. package/dist/stzh-components/p-cb1d4678.entry.js +0 -1
  632. package/dist/stzh-components/p-cd795307.entry.js +0 -1
  633. package/dist/stzh-components/p-cdc9e600.entry.js +0 -1
  634. package/dist/stzh-components/p-d7893dfd.entry.js +0 -1
  635. package/dist/stzh-components/p-d9643cc4.entry.js +0 -1
  636. package/dist/stzh-components/p-e3e3e88c.system.js +0 -1
  637. package/dist/stzh-components/p-eca1732f.entry.js +0 -1
  638. package/dist/stzh-components/p-fdd1998f.entry.js +0 -1
@@ -0,0 +1,4146 @@
1
+ import { r as registerInstance, c as createEvent, h as h$2, a as Host, g as getElement } from './index-2915b467.js';
2
+ import { h as hasSlot } from './utils-68a28fce.js';
3
+ import { f as fetchTranslations } from './translation-utils-2623783f.js';
4
+
5
+ /**
6
+ * @license
7
+ * Copyright 2017 Google LLC
8
+ * SPDX-License-Identifier: BSD-3-Clause
9
+ */
10
+ var t$2;const i$2=window,s$3=i$2.trustedTypes,e$3=s$3?s$3.createPolicy("lit-html",{createHTML:t=>t}):void 0,o$3=`lit$${(Math.random()+"").slice(9)}$`,n$3="?"+o$3,l$2=`<${n$3}>`,h$1=document,r$2=(t="")=>h$1.createComment(t),d$1=t=>null===t||"object"!=typeof t&&"function"!=typeof t,u=Array.isArray,c$1=t=>u(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]),v=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,a$1=/-->/g,f=/>/g,_=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),m=/'/g,p=/"/g,$=/^(?:script|style|textarea|title)$/i,g=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),y=g(1),x=Symbol.for("lit-noChange"),b=Symbol.for("lit-nothing"),T=new WeakMap,A=h$1.createTreeWalker(h$1,129,null,!1),E=(t,i)=>{const s=t.length-1,n=[];let h,r=2===i?"<svg>":"",d=v;for(let i=0;i<s;i++){const s=t[i];let e,u,c=-1,g=0;for(;g<s.length&&(d.lastIndex=g,u=d.exec(s),null!==u);)g=d.lastIndex,d===v?"!--"===u[1]?d=a$1:void 0!==u[1]?d=f:void 0!==u[2]?($.test(u[2])&&(h=RegExp("</"+u[2],"g")),d=_):void 0!==u[3]&&(d=_):d===_?">"===u[0]?(d=null!=h?h:v,c=-1):void 0===u[1]?c=-2:(c=d.lastIndex-u[2].length,e=u[1],d=void 0===u[3]?_:'"'===u[3]?p:m):d===p||d===m?d=_:d===a$1||d===f?d=v:(d=_,h=void 0);const y=d===_&&t[i+1].startsWith("/>")?" ":"";r+=d===v?s+l$2:c>=0?(n.push(e),s.slice(0,c)+"$lit$"+s.slice(c)+o$3+y):s+o$3+(-2===c?(n.push(void 0),i):y);}const u=r+(t[s]||"<?>")+(2===i?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return [void 0!==e$3?e$3.createHTML(u):u,n]};class C{constructor({strings:t,_$litType$:i},e){let l;this.parts=[];let h=0,d=0;const u=t.length-1,c=this.parts,[v,a]=E(t,i);if(this.el=C.createElement(v,e),A.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes);}for(;null!==(l=A.nextNode())&&c.length<u;){if(1===l.nodeType){if(l.hasAttributes()){const t=[];for(const i of l.getAttributeNames())if(i.endsWith("$lit$")||i.startsWith(o$3)){const s=a[d++];if(t.push(i),void 0!==s){const t=l.getAttribute(s.toLowerCase()+"$lit$").split(o$3),i=/([.?@])?(.*)/.exec(s);c.push({type:1,index:h,name:i[2],strings:t,ctor:"."===i[1]?M:"?"===i[1]?k:"@"===i[1]?H:S$1});}else c.push({type:6,index:h});}for(const i of t)l.removeAttribute(i);}if($.test(l.tagName)){const t=l.textContent.split(o$3),i=t.length-1;if(i>0){l.textContent=s$3?s$3.emptyScript:"";for(let s=0;s<i;s++)l.append(t[s],r$2()),A.nextNode(),c.push({type:2,index:++h});l.append(t[i],r$2());}}}else if(8===l.nodeType)if(l.data===n$3)c.push({type:2,index:h});else {let t=-1;for(;-1!==(t=l.data.indexOf(o$3,t+1));)c.push({type:7,index:h}),t+=o$3.length-1;}h++;}}static createElement(t,i){const s=h$1.createElement("template");return s.innerHTML=t,s}}function P(t,i,s=t,e){var o,n,l,h;if(i===x)return i;let r=void 0!==e?null===(o=s._$Co)||void 0===o?void 0:o[e]:s._$Cl;const u=d$1(i)?void 0:i._$litDirective$;return (null==r?void 0:r.constructor)!==u&&(null===(n=null==r?void 0:r._$AO)||void 0===n||n.call(r,!1),void 0===u?r=void 0:(r=new u(t),r._$AT(t,s,e)),void 0!==e?(null!==(l=(h=s)._$Co)&&void 0!==l?l:h._$Co=[])[e]=r:s._$Cl=r),void 0!==r&&(i=P(t,r._$AS(t,i.values),r,e)),i}class V{constructor(t,i){this.u=[],this._$AN=void 0,this._$AD=t,this._$AM=i;}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}v(t){var i;const{el:{content:s},parts:e}=this._$AD,o=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:h$1).importNode(s,!0);A.currentNode=o;let n=A.nextNode(),l=0,r=0,d=e[0];for(;void 0!==d;){if(l===d.index){let i;2===d.type?i=new N(n,n.nextSibling,this,t):1===d.type?i=new d.ctor(n,d.name,d.strings,this,t):6===d.type&&(i=new I(n,this,t)),this.u.push(i),d=e[++r];}l!==(null==d?void 0:d.index)&&(n=A.nextNode(),l++);}return o}p(t){let i=0;for(const s of this.u)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++;}}class N{constructor(t,i,s,e){var o;this.type=2,this._$AH=b,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cm=null===(o=null==e?void 0:e.isConnected)||void 0===o||o;}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$Cm}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=P(this,t,i),d$1(t)?t===b||null==t||""===t?(this._$AH!==b&&this._$AR(),this._$AH=b):t!==this._$AH&&t!==x&&this.g(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):c$1(t)?this.k(t):this.g(t);}O(t,i=this._$AB){return this._$AA.parentNode.insertBefore(t,i)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t));}g(t){this._$AH!==b&&d$1(this._$AH)?this._$AA.nextSibling.data=t:this.T(h$1.createTextNode(t)),this._$AH=t;}$(t){var i;const{values:s,_$litType$:e}=t,o="number"==typeof e?this._$AC(t):(void 0===e.el&&(e.el=C.createElement(e.h,this.options)),e);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===o)this._$AH.p(s);else {const t=new V(o,this),i=t.v(this.options);t.p(s),this.T(i),this._$AH=t;}}_$AC(t){let i=T.get(t.strings);return void 0===i&&T.set(t.strings,i=new C(t)),i}k(t){u(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const o of t)e===i.length?i.push(s=new N(this.O(r$2()),this.O(r$2()),this,this.options)):s=i[e],s._$AI(o),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e);}_$AR(t=this._$AA.nextSibling,i){var s;for(null===(s=this._$AP)||void 0===s||s.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i;}}setConnected(t){var i;void 0===this._$AM&&(this._$Cm=t,null===(i=this._$AP)||void 0===i||i.call(this,t));}}class S$1{constructor(t,i,s,e,o){this.type=1,this._$AH=b,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=o,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=b;}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,s,e){const o=this.strings;let n=!1;if(void 0===o)t=P(this,t,i,0),n=!d$1(t)||t!==this._$AH&&t!==x,n&&(this._$AH=t);else {const e=t;let l,h;for(t=o[0],l=0;l<o.length-1;l++)h=P(this,e[s+l],i,l),h===x&&(h=this._$AH[l]),n||(n=!d$1(h)||h!==this._$AH[l]),h===b?t=b:t!==b&&(t+=(null!=h?h:"")+o[l+1]),this._$AH[l]=h;}n&&!e&&this.j(t);}j(t){t===b?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"");}}class M extends S$1{constructor(){super(...arguments),this.type=3;}j(t){this.element[this.name]=t===b?void 0:t;}}const R=s$3?s$3.emptyScript:"";class k extends S$1{constructor(){super(...arguments),this.type=4;}j(t){t&&t!==b?this.element.setAttribute(this.name,R):this.element.removeAttribute(this.name);}}class H extends S$1{constructor(t,i,s,e,o){super(t,i,s,e,o),this.type=5;}_$AI(t,i=this){var s;if((t=null!==(s=P(this,t,i,0))&&void 0!==s?s:b)===x)return;const e=this._$AH,o=t===b&&e!==b||t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive,n=t!==b&&(e===b||o);o&&this.element.removeEventListener(this.name,this,e),n&&this.element.addEventListener(this.name,this,t),this._$AH=t;}handleEvent(t){var i,s;"function"==typeof this._$AH?this._$AH.call(null!==(s=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==s?s:this.element,t):this._$AH.handleEvent(t);}}class I{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s;}get _$AU(){return this._$AM._$AU}_$AI(t){P(this,t);}}const z=i$2.litHtmlPolyfillSupport;null==z||z(C,N),(null!==(t$2=i$2.litHtmlVersions)&&void 0!==t$2?t$2:i$2.litHtmlVersions=[]).push("2.5.0");const Z=(t,i,s)=>{var e,o;const n=null!==(e=null==s?void 0:s.renderBefore)&&void 0!==e?e:i;let l=n._$litPart$;if(void 0===l){const t=null!==(o=null==s?void 0:s.renderBefore)&&void 0!==o?o:null;n._$litPart$=l=new N(i.insertBefore(r$2(),t),t,void 0,null!=s?s:{});}return l._$AI(t),l};
11
+
12
+ var functionDebounce = debounce;
13
+
14
+ function debounce(fn, wait, callFirst) {
15
+ var timeout = null;
16
+ var debouncedFn = null;
17
+
18
+ var clear = function() {
19
+ if (timeout) {
20
+ clearTimeout(timeout);
21
+
22
+ debouncedFn = null;
23
+ timeout = null;
24
+ }
25
+ };
26
+
27
+ var flush = function() {
28
+ var call = debouncedFn;
29
+ clear();
30
+
31
+ if (call) {
32
+ call();
33
+ }
34
+ };
35
+
36
+ var debounceWrapper = function() {
37
+ if (!wait) {
38
+ return fn.apply(this, arguments);
39
+ }
40
+
41
+ var context = this;
42
+ var args = arguments;
43
+ var callNow = callFirst && !timeout;
44
+ clear();
45
+
46
+ debouncedFn = function() {
47
+ fn.apply(context, args);
48
+ };
49
+
50
+ timeout = setTimeout(function() {
51
+ timeout = null;
52
+
53
+ if (!callNow) {
54
+ var call = debouncedFn;
55
+ debouncedFn = null;
56
+
57
+ return call();
58
+ }
59
+ }, wait);
60
+
61
+ if (callNow) {
62
+ return debouncedFn();
63
+ }
64
+ };
65
+
66
+ debounceWrapper.cancel = clear;
67
+ debounceWrapper.flush = flush;
68
+
69
+ return debounceWrapper;
70
+ }
71
+
72
+ var functionThrottle = throttle;
73
+
74
+ function throttle(fn, interval, options) {
75
+ var timeoutId = null;
76
+ var throttledFn = null;
77
+ var leading = (options && options.leading);
78
+ var trailing = (options && options.trailing);
79
+
80
+ if (leading == null) {
81
+ leading = true; // default
82
+ }
83
+
84
+ if (trailing == null) {
85
+ trailing = !leading; //default
86
+ }
87
+
88
+ if (leading == true) {
89
+ trailing = false; // forced because there should be invocation per call
90
+ }
91
+
92
+ var cancel = function() {
93
+ if (timeoutId) {
94
+ clearTimeout(timeoutId);
95
+ timeoutId = null;
96
+ }
97
+ };
98
+
99
+ var flush = function() {
100
+ var call = throttledFn;
101
+ cancel();
102
+
103
+ if (call) {
104
+ call();
105
+ }
106
+ };
107
+
108
+ var throttleWrapper = function() {
109
+ var callNow = leading && !timeoutId;
110
+ var context = this;
111
+ var args = arguments;
112
+
113
+ throttledFn = function() {
114
+ return fn.apply(context, args);
115
+ };
116
+
117
+ if (!timeoutId) {
118
+ timeoutId = setTimeout(function() {
119
+ timeoutId = null;
120
+
121
+ if (trailing) {
122
+ return throttledFn();
123
+ }
124
+ }, interval);
125
+ }
126
+
127
+ if (callNow) {
128
+ callNow = false;
129
+ return throttledFn();
130
+ }
131
+ };
132
+
133
+ throttleWrapper.cancel = cancel;
134
+ throttleWrapper.flush = flush;
135
+
136
+ return throttleWrapper;
137
+ }
138
+
139
+ // src/utils/events.ts
140
+ function listen(target, type, listener, options) {
141
+ target.addEventListener(type, listener, options);
142
+ return () => {
143
+ target.removeEventListener(type, listener, options);
144
+ };
145
+ }
146
+ var DisposalBin = class {
147
+ constructor() {
148
+ this._disposal = this._disposal ?? [];
149
+ }
150
+ add(...callbacks) {
151
+ if (callbacks) {
152
+ callbacks.forEach((cb) => {
153
+ this._disposal.push(cb);
154
+ });
155
+ }
156
+ }
157
+ empty() {
158
+ this._disposal.forEach((fn) => fn());
159
+ this._disposal = [];
160
+ }
161
+ };
162
+
163
+ // src/events/event-listener.ts
164
+ function eventListener(host, type, listener, options) {
165
+ let off;
166
+ function attach() {
167
+ if (!off) {
168
+ off = listen(options?.target ?? host, type, listener, options);
169
+ }
170
+ }
171
+ attach();
172
+ host.addController({
173
+ hostConnected() {
174
+ attach();
175
+ },
176
+ hostDisconnected() {
177
+ off?.();
178
+ off = void 0;
179
+ }
180
+ });
181
+ }
182
+
183
+ // src/events/VdsEvent.ts
184
+ var VdsEvent = class extends CustomEvent {
185
+ constructor(type, eventInit = {}) {
186
+ super(type, eventInit);
187
+ this.triggerEvent = eventInit.triggerEvent;
188
+ if (!this.hasOwnProperty("originEvent")) {
189
+ Object.defineProperties(this, {
190
+ originEvent: {
191
+ get() {
192
+ return getOriginEvent(this) ?? this;
193
+ }
194
+ },
195
+ isOriginTrusted: {
196
+ get() {
197
+ return getOriginEvent(this)?.isTrusted ?? false;
198
+ }
199
+ }
200
+ });
201
+ }
202
+ }
203
+ get originEvent() {
204
+ return getOriginEvent(this) ?? this;
205
+ }
206
+ get isOriginTrusted() {
207
+ return this.originEvent?.isTrusted ?? false;
208
+ }
209
+ };
210
+ function vdsEvent(type, eventInit = {}) {
211
+ return new VdsEvent(type, eventInit);
212
+ }
213
+ function getOriginEvent(event) {
214
+ let triggerEvent = event.triggerEvent;
215
+ while (triggerEvent && triggerEvent.triggerEvent) {
216
+ triggerEvent = triggerEvent.triggerEvent;
217
+ }
218
+ return triggerEvent;
219
+ }
220
+ function appendTriggerEvent(event, triggerEvent) {
221
+ (getOriginEvent(event) ?? event).triggerEvent = triggerEvent;
222
+ }
223
+
224
+ // src/context/ContextConsumerController.ts
225
+ var orphanConsumers = /* @__PURE__ */ new Map();
226
+ var ContextConsumerController = class {
227
+ constructor(_host, initialValue, _options) {
228
+ this._host = _host;
229
+ this.initialValue = initialValue;
230
+ this._options = _options;
231
+ this._registrationCallbacks = [];
232
+ _host.addController({
233
+ hostConnected: () => {
234
+ this._connect();
235
+ },
236
+ hostDisconnected: () => {
237
+ delete this._host[this.id];
238
+ }
239
+ });
240
+ }
241
+ get id() {
242
+ return this._options.id;
243
+ }
244
+ get value() {
245
+ return this._host[this.id] ?? this.initialValue;
246
+ }
247
+ get registered() {
248
+ return this.id in this._host;
249
+ }
250
+ _connect() {
251
+ if (this.id in this._host)
252
+ return;
253
+ const setValue = (value) => {
254
+ this._host[this.id] = value;
255
+ this._registrationCallbacks?.forEach((fn) => fn(value));
256
+ this._registrationCallbacks = void 0;
257
+ };
258
+ this._host.dispatchEvent(
259
+ vdsEvent("vds-context-consumer-connect", {
260
+ bubbles: true,
261
+ composed: true,
262
+ detail: {
263
+ id: this.id,
264
+ setValue
265
+ }
266
+ })
267
+ );
268
+ if (!this.registered) {
269
+ const orphans = orphanConsumers.get(this.id) ?? [];
270
+ orphans.push({ host: this._host, setValue });
271
+ orphanConsumers.set(this.id, orphans);
272
+ }
273
+ }
274
+ whenRegistered(callback) {
275
+ if (this.registered) {
276
+ callback(this.value);
277
+ return;
278
+ }
279
+ this._registrationCallbacks?.push(callback);
280
+ }
281
+ };
282
+ function adoptOrphans(id, provider) {
283
+ const orphans = orphanConsumers.get(id) ?? [];
284
+ const adoptees = orphans.filter(({ host }) => provider.contains(host));
285
+ orphanConsumers.set(
286
+ id,
287
+ orphans.filter(({ host }) => !provider.contains(host))
288
+ );
289
+ return adoptees;
290
+ }
291
+
292
+ // src/context/ContextProviderController.ts
293
+ var ContextProviderController = class {
294
+ constructor(_host, _initValue, _options) {
295
+ this._host = _host;
296
+ this._initValue = _initValue;
297
+ this._options = _options;
298
+ this._stopDisposal = new DisposalBin();
299
+ this._value = _initValue();
300
+ _host.addController({
301
+ hostConnected: this.start.bind(this),
302
+ hostDisconnected: this.stop.bind(this)
303
+ });
304
+ }
305
+ get id() {
306
+ return this._options.id;
307
+ }
308
+ get value() {
309
+ return this._value;
310
+ }
311
+ start() {
312
+ const dispose = listen(
313
+ this._host,
314
+ "vds-context-consumer-connect",
315
+ this._handleConsumerConnect.bind(this)
316
+ );
317
+ for (const orphan of adoptOrphans(this.id, this._host)) {
318
+ orphan.setValue(this._value);
319
+ }
320
+ this._stopDisposal.add(dispose);
321
+ }
322
+ stop() {
323
+ this._stopDisposal.empty();
324
+ }
325
+ _handleConsumerConnect(event) {
326
+ const consumer = event.detail;
327
+ if (consumer.id !== this.id)
328
+ return;
329
+ event.stopImmediatePropagation();
330
+ consumer.setValue(this._value);
331
+ }
332
+ };
333
+
334
+ // src/context/context.ts
335
+ function createContext(initValue) {
336
+ const id = Symbol("@vidstack/context");
337
+ return {
338
+ id,
339
+ consume(host) {
340
+ return new ContextConsumerController(host, initValue(), { id });
341
+ },
342
+ provide(host) {
343
+ return new ContextProviderController(host, initValue, { id });
344
+ }
345
+ };
346
+ }
347
+ function isContext(context) {
348
+ return typeof context?.id === "symbol" && context.id.description === "@vidstack/context";
349
+ }
350
+
351
+ // src/utils/unit.ts
352
+ function noop(...args) {
353
+ }
354
+ function safeNotEqual(a, b) {
355
+ return a != a ? b == b : a !== b || a && typeof a === "object" || typeof a === "function";
356
+ }
357
+ function isNull(value) {
358
+ return value === null;
359
+ }
360
+ function isUndefined(value) {
361
+ return typeof value === "undefined";
362
+ }
363
+ function isNil(value) {
364
+ return isNull(value) || isUndefined(value);
365
+ }
366
+ function isNumber(value) {
367
+ return typeof value === "number" && !Number.isNaN(value);
368
+ }
369
+ function isString(value) {
370
+ return typeof value === "string";
371
+ }
372
+ function isFunction(value) {
373
+ return typeof value === "function";
374
+ }
375
+ function isArray(value) {
376
+ return Array.isArray(value);
377
+ }
378
+
379
+ // src/elements/discovery/discover.ts
380
+ var discoverers = /* @__PURE__ */ new Map();
381
+ var discoverables = /* @__PURE__ */ new Map();
382
+ function connect(discoverable2, id, onDisconnect) {
383
+ for (const { host, callback } of Array.from(discoverers.get(id) ?? [])) {
384
+ if (host !== discoverable2 && host.contains(discoverable2)) {
385
+ callback(discoverable2, onDisconnect);
386
+ }
387
+ }
388
+ }
389
+ function find(host, id) {
390
+ return Array.from(discoverables.get(id) ?? []).filter(
391
+ ({ element }) => host !== element && host.contains(element)
392
+ );
393
+ }
394
+ function discover(host, id, callback) {
395
+ const discoverer = { host, callback };
396
+ host.addController({
397
+ hostConnected: () => {
398
+ for (const { element, onDisconnect } of find(host, id)) {
399
+ callback(element, onDisconnect);
400
+ }
401
+ discoverers.set(id, (discoverers.get(id) ?? /* @__PURE__ */ new Set()).add(discoverer));
402
+ },
403
+ hostDisconnected: () => {
404
+ discoverers.get(id)?.delete(discoverer);
405
+ }
406
+ });
407
+ }
408
+ function discoverable(host, eventType, options = {}) {
409
+ const id = options.register;
410
+ const disconnectDisposal = new DisposalBin();
411
+ const onDisconnect = (callback) => {
412
+ disconnectDisposal.add(callback);
413
+ };
414
+ const discoverable2 = {
415
+ element: host,
416
+ onDisconnect
417
+ };
418
+ host.addController({
419
+ hostConnected() {
420
+ const event = vdsEvent(eventType, {
421
+ bubbles: true,
422
+ composed: true,
423
+ detail: discoverable2
424
+ });
425
+ host.dispatchEvent(event);
426
+ if (id) {
427
+ discoverables.set(id, (discoverables.get(id) ?? /* @__PURE__ */ new Set()).add(discoverable2));
428
+ connect(host, id, onDisconnect);
429
+ }
430
+ },
431
+ hostDisconnected() {
432
+ disconnectDisposal.empty();
433
+ if (id) {
434
+ discoverables.get(id)?.delete(discoverable2);
435
+ }
436
+ }
437
+ });
438
+ }
439
+
440
+ // src/utils/support.ts
441
+ var IS_CLIENT = typeof window !== "undefined";
442
+ var UA = IS_CLIENT ? window.navigator?.userAgent.toLowerCase() : "";
443
+ var IS_IOS = /iphone|ipad|ipod|ios|CriOS|FxiOS/.test(UA);
444
+ /android/.test(UA);
445
+ IS_CLIENT && /(iPhone|iPod)/gi.test(window.navigator?.platform);
446
+ /firefox/.test(UA);
447
+ var IS_CHROME = IS_CLIENT && !!window.chrome;
448
+ IS_CLIENT && !IS_CHROME && (window.safari || IS_IOS || /(apple|safari)/.test(UA));
449
+ function canOrientScreen() {
450
+ return IS_CLIENT && !isUndefined(screen.orientation) && isFunction(screen.orientation.lock) && isFunction(screen.orientation.unlock);
451
+ }
452
+
453
+ // ../../node_modules/.pnpm/fscreen@1.2.0/node_modules/fscreen/dist/fscreen.esm.js
454
+ var key = {
455
+ fullscreenEnabled: 0,
456
+ fullscreenElement: 1,
457
+ requestFullscreen: 2,
458
+ exitFullscreen: 3,
459
+ fullscreenchange: 4,
460
+ fullscreenerror: 5,
461
+ fullscreen: 6
462
+ };
463
+ var webkit = [
464
+ "webkitFullscreenEnabled",
465
+ "webkitFullscreenElement",
466
+ "webkitRequestFullscreen",
467
+ "webkitExitFullscreen",
468
+ "webkitfullscreenchange",
469
+ "webkitfullscreenerror",
470
+ "-webkit-full-screen"
471
+ ];
472
+ var moz = [
473
+ "mozFullScreenEnabled",
474
+ "mozFullScreenElement",
475
+ "mozRequestFullScreen",
476
+ "mozCancelFullScreen",
477
+ "mozfullscreenchange",
478
+ "mozfullscreenerror",
479
+ "-moz-full-screen"
480
+ ];
481
+ var ms = [
482
+ "msFullscreenEnabled",
483
+ "msFullscreenElement",
484
+ "msRequestFullscreen",
485
+ "msExitFullscreen",
486
+ "MSFullscreenChange",
487
+ "MSFullscreenError",
488
+ "-ms-fullscreen"
489
+ ];
490
+ var document2 = typeof window !== "undefined" && typeof window.document !== "undefined" ? window.document : {};
491
+ var vendor = "fullscreenEnabled" in document2 && Object.keys(key) || webkit[0] in document2 && webkit || moz[0] in document2 && moz || ms[0] in document2 && ms || [];
492
+ var fscreen = {
493
+ requestFullscreen: function(element) {
494
+ return element[vendor[key.requestFullscreen]]();
495
+ },
496
+ requestFullscreenFunction: function(element) {
497
+ return element[vendor[key.requestFullscreen]];
498
+ },
499
+ get exitFullscreen() {
500
+ return document2[vendor[key.exitFullscreen]].bind(document2);
501
+ },
502
+ get fullscreenPseudoClass() {
503
+ return ":" + vendor[key.fullscreen];
504
+ },
505
+ addEventListener: function(type, handler, options) {
506
+ return document2.addEventListener(vendor[key[type]], handler, options);
507
+ },
508
+ removeEventListener: function(type, handler, options) {
509
+ return document2.removeEventListener(vendor[key[type]], handler, options);
510
+ },
511
+ get fullscreenEnabled() {
512
+ return Boolean(document2[vendor[key.fullscreenEnabled]]);
513
+ },
514
+ set fullscreenEnabled(val) {
515
+ },
516
+ get fullscreenElement() {
517
+ return document2[vendor[key.fullscreenElement]];
518
+ },
519
+ set fullscreenElement(val) {
520
+ },
521
+ get onfullscreenchange() {
522
+ return document2[("on" + vendor[key.fullscreenchange]).toLowerCase()];
523
+ },
524
+ set onfullscreenchange(handler) {
525
+ return document2[("on" + vendor[key.fullscreenchange]).toLowerCase()] = handler;
526
+ },
527
+ get onfullscreenerror() {
528
+ return document2[("on" + vendor[key.fullscreenerror]).toLowerCase()];
529
+ },
530
+ set onfullscreenerror(handler) {
531
+ return document2[("on" + vendor[key.fullscreenerror]).toLowerCase()] = handler;
532
+ }
533
+ };
534
+ var fscreen_esm_default = fscreen;
535
+
536
+ // src/logger/colors.ts
537
+ var LOCAL_STORAGE_KEY = "@vidstack/log-colors";
538
+ getSavedColors();
539
+ function getSavedColors() {
540
+ if (IS_CLIENT && !isUndefined(window.localStorage)) {
541
+ let colors2 = {};
542
+ try {
543
+ colors2 = JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY) ?? "");
544
+ } catch {
545
+ }
546
+ return new Map(Object.entries(colors2));
547
+ }
548
+ return /* @__PURE__ */ new Map();
549
+ }
550
+
551
+ // src/logger/LogLevel.ts
552
+ Object.freeze({
553
+ silent: 0,
554
+ error: 1,
555
+ warn: 2,
556
+ info: 3,
557
+ debug: 4
558
+ });
559
+ Object.freeze({
560
+ silent: "white",
561
+ error: "hsl(6, 58%, 50%)",
562
+ warn: "hsl(51, 58%, 50%)",
563
+ info: "hsl(219, 58%, 50%)",
564
+ debug: "hsl(280, 58%, 50%)"
565
+ });
566
+
567
+ // src/utils/number.ts
568
+ function round(num, decimalPlaces = 2) {
569
+ return Number(num.toFixed(decimalPlaces));
570
+ }
571
+ function clampNumber(min, value, max) {
572
+ return Math.max(min, Math.min(max, value));
573
+ }
574
+ function getNumberOfDecimalPlaces(num) {
575
+ return String(num).split(".")[1]?.length ?? 0;
576
+ }
577
+
578
+ // src/fullscreen/FullscreenController.ts
579
+ var FullscreenController = class {
580
+ constructor(_host, _screenOrientationController) {
581
+ this._host = _host;
582
+ this._screenOrientationController = _screenOrientationController;
583
+ this._logger = void 0;
584
+ this._listenerDisposal = new DisposalBin();
585
+ _host.addController({
586
+ hostDisconnected: this._handleHostDisconnected.bind(this)
587
+ });
588
+ }
589
+ async _handleHostDisconnected() {
590
+ if (this.isFullscreen)
591
+ await this.exitFullscreen();
592
+ this._listenerDisposal.empty();
593
+ }
594
+ get isSupported() {
595
+ return this.isSupportedNatively;
596
+ }
597
+ get isSupportedNatively() {
598
+ return fscreen_esm_default.fullscreenEnabled;
599
+ }
600
+ get isFullscreen() {
601
+ return this.isNativeFullscreen;
602
+ }
603
+ get isNativeFullscreen() {
604
+ if (fscreen_esm_default.fullscreenElement === this._host)
605
+ return true;
606
+ try {
607
+ return this._host.matches(
608
+ fscreen_esm_default.fullscreenPseudoClass
609
+ );
610
+ } catch (error) {
611
+ return false;
612
+ }
613
+ }
614
+ _addFullscreenChangeEventListener(listener) {
615
+ if (!this.isSupported)
616
+ return noop;
617
+ const dispose = listen(fscreen_esm_default, "fullscreenchange", listener);
618
+ return () => {
619
+ dispose();
620
+ };
621
+ }
622
+ _addFullscreenErrorEventListener(listener) {
623
+ if (!this.isSupported)
624
+ return noop;
625
+ const dispose = listen(fscreen_esm_default, "fullscreenerror", listener);
626
+ return () => {
627
+ dispose();
628
+ };
629
+ }
630
+ async enterFullscreen() {
631
+ if (this.isFullscreen)
632
+ return;
633
+ this._throwIfNoFullscreenSupport();
634
+ this._listenerDisposal.add(
635
+ this._addFullscreenChangeEventListener(this._handleFullscreenChange.bind(this))
636
+ );
637
+ this._listenerDisposal.add(
638
+ this._addFullscreenErrorEventListener(this._handleFullscreenError.bind(this))
639
+ );
640
+ const response = await this._makeEnterFullscreenRequest();
641
+ await this._lockScreenOrientation();
642
+ return response;
643
+ }
644
+ async _makeEnterFullscreenRequest() {
645
+ return fscreen_esm_default.requestFullscreen(this._host);
646
+ }
647
+ _handleFullscreenChange(event) {
648
+ if (!this.isFullscreen)
649
+ this._listenerDisposal.empty();
650
+ this._host.dispatchEvent(
651
+ vdsEvent("vds-fullscreen-change", {
652
+ bubbles: true,
653
+ composed: true,
654
+ detail: this.isFullscreen,
655
+ triggerEvent: event
656
+ })
657
+ );
658
+ }
659
+ _handleFullscreenError(event) {
660
+ this._host.dispatchEvent(
661
+ vdsEvent("vds-fullscreen-error", {
662
+ bubbles: true,
663
+ composed: true,
664
+ triggerEvent: event
665
+ })
666
+ );
667
+ }
668
+ async exitFullscreen() {
669
+ if (!this.isFullscreen)
670
+ return;
671
+ this._throwIfNoFullscreenSupport();
672
+ const response = await this._makeExitFullscreenRequest();
673
+ await this._unlockScreenOrientation();
674
+ return response;
675
+ }
676
+ async _makeExitFullscreenRequest() {
677
+ return fscreen_esm_default.exitFullscreen();
678
+ }
679
+ _shouldOrientScreen() {
680
+ return this._screenOrientationController.canOrient && !isUndefined(this.screenOrientationLock);
681
+ }
682
+ async _lockScreenOrientation() {
683
+ if (isUndefined(this.screenOrientationLock) || !this._shouldOrientScreen()) {
684
+ return;
685
+ }
686
+ await this._screenOrientationController.lock(this.screenOrientationLock);
687
+ }
688
+ async _unlockScreenOrientation() {
689
+ if (!this._shouldOrientScreen())
690
+ return;
691
+ await this._screenOrientationController.unlock();
692
+ }
693
+ _throwIfNoFullscreenSupport() {
694
+ if (this.isSupported)
695
+ return;
696
+ throw Error("Fullscreen API is not enabled or supported in this environment.");
697
+ }
698
+ };
699
+
700
+ // src/observers/FocusVisibleController.ts
701
+ var FocusVisibleController = class {
702
+ constructor(_host) {
703
+ this._host = _host;
704
+ const disposal = new DisposalBin();
705
+ let hadKeyboardEvent = false;
706
+ disposal.add(
707
+ listen(document, "pointerdown", () => {
708
+ hadKeyboardEvent = false;
709
+ })
710
+ );
711
+ eventListener(_host, "keydown", (e) => {
712
+ if (e.metaKey || e.altKey || e.ctrlKey) {
713
+ return;
714
+ }
715
+ hadKeyboardEvent = true;
716
+ });
717
+ eventListener(_host, "focus", (e) => {
718
+ if (hadKeyboardEvent) {
719
+ _host.classList.add("focus-visible");
720
+ }
721
+ });
722
+ eventListener(_host, "blur", (e) => {
723
+ _host.classList.remove("focus-visible");
724
+ });
725
+ _host.addController({
726
+ hostDisconnected: () => {
727
+ disposal.empty();
728
+ }
729
+ });
730
+ }
731
+ };
732
+ function focusVisiblePolyfill(host) {
733
+ return new FocusVisibleController(host);
734
+ }
735
+
736
+ // src/observers/IntersectionController.ts
737
+ var IntersectionController = class {
738
+ constructor(_host, config = {}, _callback = () => true, _logger = void 0) {
739
+ this._host = _host;
740
+ this._callback = _callback;
741
+ this._logger = _logger;
742
+ this._skipInitial = false;
743
+ this._unobservedUpdate = false;
744
+ const { target, skipInitial, ...intersectionObserverInit } = config;
745
+ this._target = target ?? void 0;
746
+ this._skipInitial = skipInitial ?? this._skipInitial;
747
+ if (!window.IntersectionObserver) {
748
+ return;
749
+ }
750
+ this._observer = new IntersectionObserver((entries) => {
751
+ const unobservedUpdate = this._unobservedUpdate;
752
+ this._unobservedUpdate = false;
753
+ if (this._skipInitial && unobservedUpdate)
754
+ return;
755
+ this.handleChanges(entries);
756
+ this._host.requestUpdate();
757
+ }, intersectionObserverInit);
758
+ _host.addController(this);
759
+ }
760
+ handleChanges(entries) {
761
+ this.value = this._callback(entries, this._observer);
762
+ }
763
+ hostConnected() {
764
+ if (this._target) {
765
+ this.observe(this._target);
766
+ }
767
+ }
768
+ hostDisconnected() {
769
+ this._disconnect();
770
+ }
771
+ async hostUpdated() {
772
+ const pendingRecords = this._observer.takeRecords();
773
+ if (pendingRecords.length) {
774
+ this.handleChanges(pendingRecords);
775
+ }
776
+ }
777
+ observe(target) {
778
+ this._observer.observe(target);
779
+ this._unobservedUpdate = true;
780
+ return () => {
781
+ this._observer.unobserve(target);
782
+ };
783
+ }
784
+ _disconnect() {
785
+ this._observer.disconnect();
786
+ }
787
+ };
788
+ function createIntersectionController(...params) {
789
+ return new IntersectionController(...params);
790
+ }
791
+
792
+ // src/utils/promise.ts
793
+ function deferredPromise() {
794
+ let resolve = noop;
795
+ let reject = noop;
796
+ const promise = new Promise((res, rej) => {
797
+ resolve = res;
798
+ reject = rej;
799
+ });
800
+ return { promise, resolve, reject };
801
+ }
802
+
803
+ // src/queue/RequestQueue.ts
804
+ var RequestQueue = class {
805
+ constructor() {
806
+ this._requestQueue = /* @__PURE__ */ new Map();
807
+ this._requestKeys = [];
808
+ this._pendingFlush = deferredPromise();
809
+ this._isServing = false;
810
+ }
811
+ get isServing() {
812
+ return this._isServing;
813
+ }
814
+ get size() {
815
+ return this._requestQueue.size;
816
+ }
817
+ async waitForFlush() {
818
+ if (this._isServing)
819
+ return;
820
+ await this._pendingFlush.promise;
821
+ }
822
+ queue(key2, callback) {
823
+ if (this._isServing) {
824
+ callback();
825
+ return;
826
+ }
827
+ this._requestKeys = [...this._requestKeys.filter((k) => k !== key2), key2];
828
+ this._requestQueue.set(key2, callback);
829
+ }
830
+ serve(key2) {
831
+ this._requestQueue.get(key2)?.();
832
+ this._requestQueue.delete(key2);
833
+ }
834
+ start() {
835
+ this._flush();
836
+ this._isServing = true;
837
+ if (this._requestQueue.size > 0) {
838
+ this._flush();
839
+ }
840
+ }
841
+ _flush() {
842
+ for (const requestKey of this._requestKeys) {
843
+ this.serve(requestKey);
844
+ }
845
+ this._requestKeys = [];
846
+ this._release();
847
+ }
848
+ _empty() {
849
+ this._requestQueue.clear();
850
+ }
851
+ _release() {
852
+ this._pendingFlush.resolve();
853
+ this._pendingFlush = deferredPromise();
854
+ }
855
+ stop() {
856
+ this._isServing = false;
857
+ }
858
+ destroy() {
859
+ this.stop();
860
+ this._empty();
861
+ this._release();
862
+ }
863
+ };
864
+
865
+ // src/queue/host-request-queue.ts
866
+ function hostRequestQueue(host) {
867
+ const q = new RequestQueue();
868
+ host.addController({
869
+ hostConnected: q.start.bind(q),
870
+ hostDisconnected: q.destroy.bind(q)
871
+ });
872
+ return q;
873
+ }
874
+
875
+ // src/screen-orientation/ScreenOrientationController.ts
876
+ var ScreenOrientationController = class {
877
+ constructor(_host) {
878
+ this._host = _host;
879
+ this._isScreenOrientationLocked = false;
880
+ this._logger = void 0;
881
+ this._updateScreenOrientation();
882
+ this._listenerDisposal = new DisposalBin();
883
+ _host.addController({
884
+ hostConnected: this._handleHostConnected.bind(this),
885
+ hostDisconnected: this._handleHostDisconnected.bind(this)
886
+ });
887
+ }
888
+ async _handleHostConnected() {
889
+ this._updateScreenOrientation();
890
+ this._addScreenOrientationEventListeners();
891
+ }
892
+ async _handleHostDisconnected() {
893
+ if (this.canOrient && this._isScreenOrientationLocked)
894
+ await this.unlock();
895
+ this._listenerDisposal.empty();
896
+ }
897
+ get currentOrientation() {
898
+ return this._screenOrientation;
899
+ }
900
+ get canOrient() {
901
+ return canOrientScreen();
902
+ }
903
+ get isLocked() {
904
+ return this._isScreenOrientationLocked;
905
+ }
906
+ async lock(lockType) {
907
+ this._throwIfScreenOrientationUnavailable();
908
+ await screen.orientation.lock(lockType);
909
+ this._isScreenOrientationLocked = true;
910
+ this._host.dispatchEvent(
911
+ vdsEvent("vds-screen-orientation-lock-change", {
912
+ bubbles: true,
913
+ composed: true,
914
+ detail: lockType
915
+ })
916
+ );
917
+ }
918
+ async unlock() {
919
+ this._throwIfScreenOrientationUnavailable();
920
+ await screen.orientation.unlock();
921
+ this._isScreenOrientationLocked = false;
922
+ this._host.dispatchEvent(
923
+ vdsEvent("vds-screen-orientation-lock-change", {
924
+ bubbles: true,
925
+ composed: true,
926
+ detail: screen.orientation.type
927
+ })
928
+ );
929
+ }
930
+ _addScreenOrientationEventListeners() {
931
+ if (!this.canOrient)
932
+ return;
933
+ this._listenerDisposal.add(this._addScreenOrientationChangeEventListener());
934
+ }
935
+ _addScreenOrientationChangeEventListener() {
936
+ return listen(screen.orientation, "change", this._handleOrientationChange.bind(this));
937
+ }
938
+ _handleOrientationChange(event) {
939
+ this._screenOrientation = window.screen.orientation.type;
940
+ this._host.dispatchEvent(
941
+ vdsEvent("vds-screen-orientation-change", {
942
+ bubbles: true,
943
+ composed: true,
944
+ detail: this._screenOrientation,
945
+ triggerEvent: event
946
+ })
947
+ );
948
+ }
949
+ _updateScreenOrientation() {
950
+ this._screenOrientation = IS_CLIENT ? window.screen?.orientation?.type : void 0;
951
+ }
952
+ _throwIfScreenOrientationUnavailable() {
953
+ if (this.canOrient)
954
+ return;
955
+ throw Error("Screen orientation API is not available.");
956
+ }
957
+ };
958
+
959
+ // src/utils/object.ts
960
+ function keysOf(obj) {
961
+ return Object.keys(obj);
962
+ }
963
+
964
+ // src/stores/store-subscription.ts
965
+ function storeSubscription(host, store, onChange) {
966
+ let consumer;
967
+ let unsubscribe;
968
+ const subscribe = () => {
969
+ unsubscribe = (consumer?.value ?? store).subscribe(onChange);
970
+ };
971
+ if (isContext(store)) {
972
+ consumer = store.consume(host);
973
+ }
974
+ host.addController({
975
+ hostConnected() {
976
+ if (isContext(store)) {
977
+ consumer.whenRegistered(subscribe);
978
+ } else {
979
+ subscribe();
980
+ }
981
+ },
982
+ hostDisconnected() {
983
+ unsubscribe?.();
984
+ }
985
+ });
986
+ }
987
+
988
+ // src/stores/stores.ts
989
+ var subscriberQueue = [];
990
+ function readable(value, start) {
991
+ return {
992
+ initialValue: value,
993
+ subscribe: writable(value, start).subscribe
994
+ };
995
+ }
996
+ function writable(value, start = noop) {
997
+ let stop;
998
+ const subscribers = /* @__PURE__ */ new Set();
999
+ function set(newValue) {
1000
+ if (safeNotEqual(value, newValue)) {
1001
+ value = newValue;
1002
+ if (stop) {
1003
+ const runQueue = !subscriberQueue.length;
1004
+ for (const subscriber of subscribers) {
1005
+ subscriber[1]();
1006
+ subscriberQueue.push(subscriber, value);
1007
+ }
1008
+ if (runQueue) {
1009
+ for (let i = 0; i < subscriberQueue.length; i += 2) {
1010
+ subscriberQueue[i][0](subscriberQueue[i + 1]);
1011
+ }
1012
+ subscriberQueue.length = 0;
1013
+ }
1014
+ }
1015
+ }
1016
+ }
1017
+ function update(updater) {
1018
+ set(updater(value));
1019
+ }
1020
+ function subscribe(run, invalidate = noop) {
1021
+ const subscriber = [run, invalidate];
1022
+ subscribers.add(subscriber);
1023
+ if (subscribers.size === 1) {
1024
+ stop = start(set) || noop;
1025
+ }
1026
+ run(value);
1027
+ return () => {
1028
+ subscribers.delete(subscriber);
1029
+ if (subscribers.size === 0) {
1030
+ stop?.();
1031
+ stop = null;
1032
+ }
1033
+ };
1034
+ }
1035
+ return { initialValue: value, set, update, subscribe };
1036
+ }
1037
+ function derived(stores, fn, initialValue) {
1038
+ const single = !Array.isArray(stores);
1039
+ const storesArray = single ? [stores] : stores;
1040
+ const auto = fn.length < 2;
1041
+ return readable(initialValue, (set) => {
1042
+ let initialized = false;
1043
+ const values = [];
1044
+ let pending = 0;
1045
+ let cleanup = noop;
1046
+ const sync = () => {
1047
+ if (pending) {
1048
+ return;
1049
+ }
1050
+ cleanup();
1051
+ const result = fn(single ? values[0] : values, set);
1052
+ if (auto) {
1053
+ set(result);
1054
+ } else {
1055
+ cleanup = isFunction(result) ? result : noop;
1056
+ }
1057
+ };
1058
+ const unsubscribers = storesArray.map(
1059
+ (store, i) => store.subscribe(
1060
+ (value) => {
1061
+ values[i] = value;
1062
+ pending &= ~(1 << i);
1063
+ if (initialized) {
1064
+ sync();
1065
+ }
1066
+ },
1067
+ () => {
1068
+ pending |= 1 << i;
1069
+ }
1070
+ )
1071
+ );
1072
+ initialized = true;
1073
+ sync();
1074
+ return function stop() {
1075
+ unsubscribers.forEach((fn2) => fn2());
1076
+ cleanup();
1077
+ };
1078
+ });
1079
+ }
1080
+ function getStoreValue(store) {
1081
+ let value;
1082
+ store.subscribe((_) => value = _)();
1083
+ return value;
1084
+ }
1085
+
1086
+ // src/stores/store-record.ts
1087
+ function storeRecordSubscription(host, store, key2, onChange) {
1088
+ if (isContext(store)) {
1089
+ const consumer = store.consume(host);
1090
+ let unsubscribe;
1091
+ const subscribe = () => {
1092
+ unsubscribe = consumer.value[key2].subscribe(onChange);
1093
+ };
1094
+ host.addController({
1095
+ hostConnected: () => {
1096
+ consumer.whenRegistered(subscribe);
1097
+ },
1098
+ hostDisconnected: () => {
1099
+ unsubscribe?.();
1100
+ }
1101
+ });
1102
+ } else {
1103
+ return storeSubscription(host, store[key2], onChange);
1104
+ }
1105
+ }
1106
+ function copyStoreRecords(storeRecordA, storeRecordB) {
1107
+ for (const key2 of keysOf(storeRecordA)) {
1108
+ const storeA = storeRecordA[key2];
1109
+ const storeB = storeRecordB[key2];
1110
+ if (!storeA || !storeB)
1111
+ continue;
1112
+ const valA = getStoreValue(storeA);
1113
+ const valB = getStoreValue(storeB);
1114
+ if (valA !== valB)
1115
+ storeB.set(valA);
1116
+ }
1117
+ }
1118
+ function unwrapStoreRecord(store) {
1119
+ return new Proxy(store, {
1120
+ get(target, key2) {
1121
+ return getStoreValue(target[key2]);
1122
+ },
1123
+ has(target, key2) {
1124
+ return Reflect.has(target, key2);
1125
+ },
1126
+ ownKeys(target) {
1127
+ return Reflect.ownKeys(target);
1128
+ },
1129
+ getOwnPropertyDescriptor(target, key2) {
1130
+ return Reflect.getOwnPropertyDescriptor(target, key2);
1131
+ }
1132
+ });
1133
+ }
1134
+
1135
+ // src/utils/array.ts
1136
+ function isScalarArrayEqual(arrayA, arrayB) {
1137
+ return arrayA.length === arrayB.length && arrayA.every((value, i) => value === arrayB[i]);
1138
+ }
1139
+
1140
+ // src/utils/dom.ts
1141
+ function raf(callback) {
1142
+ return new Promise((resolve) => {
1143
+ const rafId = window.requestAnimationFrame(async () => {
1144
+ await callback?.();
1145
+ resolve(rafId);
1146
+ });
1147
+ });
1148
+ }
1149
+ function safelyDefineCustomElement(name, constructor, isClient = IS_CLIENT) {
1150
+ const isElementRegistered = isClient && !isUndefined(window.customElements.get(name));
1151
+ if (!isClient || isElementRegistered)
1152
+ return;
1153
+ window.customElements.define(name, constructor);
1154
+ }
1155
+ function setAttribute(element, attrName, attrValue) {
1156
+ if (isNil(attrValue) || attrValue === false) {
1157
+ element.removeAttribute(attrName);
1158
+ } else {
1159
+ const value = isString(attrValue) ? attrValue : "";
1160
+ element.setAttribute(attrName, value);
1161
+ }
1162
+ }
1163
+ function setAttributeIfEmpty(element, attrName, attrValue) {
1164
+ if (!element.hasAttribute(attrName)) {
1165
+ element.setAttribute(attrName, attrValue);
1166
+ }
1167
+ }
1168
+ function setCSSProperty(element, name, value, prefix = "vds") {
1169
+ element.style.setProperty(`--${prefix}-${name}`, value ? value : null);
1170
+ }
1171
+ function getSlottedChildren(el, name) {
1172
+ const selector = name ? `slot[name="${name}"]` : "slot:not([name])";
1173
+ const slot = el.shadowRoot?.querySelector(selector);
1174
+ const childNodes = slot?.assignedNodes({ flatten: true }) ?? [];
1175
+ return Array.prototype.filter.call(childNodes, (node) => node.nodeType == Node.ELEMENT_NODE);
1176
+ }
1177
+ function requestIdleCallback(callback) {
1178
+ const idle = window.requestIdleCallback ?? ((fn) => fn());
1179
+ if (document.readyState === "complete") {
1180
+ idle(callback);
1181
+ } else {
1182
+ window.addEventListener(
1183
+ "load",
1184
+ () => {
1185
+ idle(callback);
1186
+ },
1187
+ { once: true }
1188
+ );
1189
+ }
1190
+ }
1191
+
1192
+ // src/utils/keyboard.ts
1193
+ function isKeyboardEvent(event) {
1194
+ return event?.type.startsWith("key") ?? false;
1195
+ }
1196
+ function isKeyboardClick(event) {
1197
+ return isKeyboardEvent(event) && (event.key === "Enter" || event.key === " ");
1198
+ }
1199
+ function camelToKebabCase(str) {
1200
+ return str.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
1201
+ }
1202
+
1203
+ // src/utils/time.ts
1204
+ function padNumberWithZeroes(num, expectedLength) {
1205
+ const str = String(num);
1206
+ const actualLength = str.length;
1207
+ const shouldPad = actualLength < expectedLength;
1208
+ if (shouldPad) {
1209
+ const padLength = expectedLength - actualLength;
1210
+ const padding = `0`.repeat(padLength);
1211
+ return `${padding}${num}`;
1212
+ }
1213
+ return str;
1214
+ }
1215
+ function parseTime(duration) {
1216
+ const hours = Math.trunc(duration / 3600);
1217
+ const minutes = Math.trunc(duration % 3600 / 60);
1218
+ const seconds = Math.trunc(duration % 60);
1219
+ const fraction = Number((duration - Math.trunc(duration)).toPrecision(3));
1220
+ return {
1221
+ ["hours" /* Hours */]: hours,
1222
+ ["minutes" /* Minutes */]: minutes,
1223
+ ["seconds" /* Seconds */]: seconds,
1224
+ ["fraction" /* Fraction */]: fraction
1225
+ };
1226
+ }
1227
+ function formatTime(duration, shouldPadHours = false, shouldAlwaysShowHours = false) {
1228
+ const { hours, minutes, seconds } = parseTime(duration);
1229
+ const paddedHours = shouldPadHours ? padNumberWithZeroes(hours, 2) : hours;
1230
+ const paddedMinutes = padNumberWithZeroes(minutes, 2);
1231
+ const paddedSeconds = padNumberWithZeroes(seconds, 2);
1232
+ if (hours > 0 || shouldAlwaysShowHours) {
1233
+ return `${paddedHours}:${paddedMinutes}:${paddedSeconds}`;
1234
+ }
1235
+ return `${minutes}:${paddedSeconds}`;
1236
+ }
1237
+ function formatSpokenTime(duration) {
1238
+ const spokenParts = [];
1239
+ const { hours, minutes, seconds } = parseTime(duration);
1240
+ const pluralize = (num, word) => num === 1 ? word : `${word}s`;
1241
+ if (hours > 0) {
1242
+ spokenParts.push(`${hours} ${pluralize(hours, "hour")}`);
1243
+ }
1244
+ if (minutes > 0) {
1245
+ spokenParts.push(`${minutes} ${pluralize(minutes, "minute")}`);
1246
+ }
1247
+ if (seconds > 0 || spokenParts.length === 0) {
1248
+ spokenParts.push(`${seconds} ${pluralize(seconds, "second")}`);
1249
+ }
1250
+ return spokenParts.join(", ");
1251
+ }
1252
+ function rafThrottle(func) {
1253
+ let rafId;
1254
+ const pending = () => !isUndefined(rafId);
1255
+ const cancel = () => {
1256
+ if (isUndefined(rafId))
1257
+ return;
1258
+ window.cancelAnimationFrame(rafId);
1259
+ rafId = void 0;
1260
+ };
1261
+ function throttled(...args) {
1262
+ if (pending())
1263
+ return;
1264
+ rafId = window.requestAnimationFrame(() => {
1265
+ func.apply(this, args);
1266
+ rafId = void 0;
1267
+ });
1268
+ }
1269
+ throttled.cancel = cancel;
1270
+ throttled.pending = pending;
1271
+ return throttled;
1272
+ }
1273
+
1274
+ // src/media/provider/media-provider-context.ts
1275
+ var mediaProviderElementContext = createContext(
1276
+ () => writable(void 0)
1277
+ );
1278
+
1279
+ // src/media/MediaType.ts
1280
+ function rangeCheck(fnName, index, maxIndex) {
1281
+ if (!isNumber(index) || index < 0 || index > maxIndex) {
1282
+ throw new Error(
1283
+ `Failed to execute '${fnName}' on 'TimeRanges': The index provided (${index}) is non-numeric or out of bounds (0-${maxIndex}).`
1284
+ );
1285
+ }
1286
+ }
1287
+ function getRange(fnName, valueIndex, ranges, rangeIndex) {
1288
+ rangeCheck(fnName, rangeIndex, ranges.length - 1);
1289
+ return ranges[rangeIndex][valueIndex];
1290
+ }
1291
+ function createTimeRangesObj(ranges) {
1292
+ if (isUndefined(ranges) || ranges.length === 0) {
1293
+ const throwEmptyError = () => {
1294
+ throw new Error("This TimeRanges object is empty");
1295
+ };
1296
+ return {
1297
+ length: 0,
1298
+ start: throwEmptyError,
1299
+ end: throwEmptyError
1300
+ };
1301
+ }
1302
+ return {
1303
+ length: ranges.length,
1304
+ start: getRange.bind(null, "start", 0, ranges),
1305
+ end: getRange.bind(null, "end", 1, ranges)
1306
+ };
1307
+ }
1308
+ function createTimeRanges(start, end) {
1309
+ if (isArray(start)) {
1310
+ return createTimeRangesObj(start);
1311
+ } else if (isUndefined(start) || isUndefined(end)) {
1312
+ return createTimeRangesObj();
1313
+ }
1314
+ return createTimeRangesObj([[start, end]]);
1315
+ }
1316
+
1317
+ // src/media/store.ts
1318
+ var MEDIA_STORE_DEFAULTS = {
1319
+ autoplay: false,
1320
+ autoplayError: void 0,
1321
+ buffered: createTimeRanges(),
1322
+ duration: 0,
1323
+ bufferedAmount: 0,
1324
+ canLoad: false,
1325
+ canPlay: false,
1326
+ canFullscreen: false,
1327
+ controls: false,
1328
+ poster: "",
1329
+ currentSrc: "",
1330
+ currentTime: 0,
1331
+ ended: false,
1332
+ error: void 0,
1333
+ fullscreen: false,
1334
+ userIdle: false,
1335
+ loop: false,
1336
+ mediaType: "unknown" /* Unknown */,
1337
+ muted: false,
1338
+ paused: true,
1339
+ played: createTimeRanges(),
1340
+ playing: false,
1341
+ playsinline: false,
1342
+ seekable: createTimeRanges(),
1343
+ seekableAmount: 0,
1344
+ seeking: false,
1345
+ src: [],
1346
+ started: false,
1347
+ viewType: "unknown" /* Unknown */,
1348
+ volume: 1,
1349
+ waiting: false
1350
+ };
1351
+ function createMediaStore() {
1352
+ const store = {};
1353
+ for (const prop of keysOf(MEDIA_STORE_DEFAULTS)) {
1354
+ store[prop] = writable(MEDIA_STORE_DEFAULTS[prop]);
1355
+ }
1356
+ return store;
1357
+ }
1358
+ var DO_NOT_RESET_ON_SRC_CHANGE = /* @__PURE__ */ new Set([
1359
+ "autoplay",
1360
+ "canFullscreen",
1361
+ "canLoad",
1362
+ "controls",
1363
+ "currentSrc",
1364
+ "loop",
1365
+ "muted",
1366
+ "playsinline",
1367
+ "poster",
1368
+ "src",
1369
+ "viewType",
1370
+ "volume"
1371
+ ]);
1372
+ function softResetMediaStore(store) {
1373
+ keysOf(store).forEach((prop) => {
1374
+ if (!DO_NOT_RESET_ON_SRC_CHANGE.has(prop)) {
1375
+ store[prop].set(store[prop].initialValue);
1376
+ }
1377
+ });
1378
+ }
1379
+ function resetMediaStore(store) {
1380
+ for (const prop of keysOf(MEDIA_STORE_DEFAULTS)) {
1381
+ store[prop].set(MEDIA_STORE_DEFAULTS[prop]);
1382
+ }
1383
+ }
1384
+ var mediaStoreContext = createContext(createMediaStore);
1385
+ function mediaStoreSubscription(host, property, onChange) {
1386
+ return storeRecordSubscription(host, mediaStoreContext, property, onChange);
1387
+ }
1388
+
1389
+ var __defProp = Object.defineProperty;
1390
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
1391
+ var __decorateClass = (decorators, target, key, kind) => {
1392
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
1393
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
1394
+ if (decorator = decorators[i])
1395
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1396
+ if (kind && result)
1397
+ __defProp(target, key, result);
1398
+ return result;
1399
+ };
1400
+
1401
+ /**
1402
+ * @license
1403
+ * Copyright 2019 Google LLC
1404
+ * SPDX-License-Identifier: BSD-3-Clause
1405
+ */
1406
+ const t$1=window,e$2=t$1.ShadowRoot&&(void 0===t$1.ShadyCSS||t$1.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s$2=Symbol(),n$2=new WeakMap;class o$2{constructor(t,e,n){if(this._$cssResult$=!0,n!==s$2)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e;}get styleSheet(){let t=this.o;const s=this.t;if(e$2&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=n$2.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&n$2.set(s,t));}return t}toString(){return this.cssText}}const r$1=t=>new o$2("string"==typeof t?t:t+"",void 0,s$2),i$1=(t,...e)=>{const n=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new o$2(n,t,s$2)},S=(s,n)=>{e$2?s.adoptedStyleSheets=n.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):n.forEach((e=>{const n=document.createElement("style"),o=t$1.litNonce;void 0!==o&&n.setAttribute("nonce",o),n.textContent=e.cssText,s.appendChild(n);}));},c=e$2?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r$1(e)})(t):t;
1407
+
1408
+ /**
1409
+ * @license
1410
+ * Copyright 2017 Google LLC
1411
+ * SPDX-License-Identifier: BSD-3-Clause
1412
+ */var s$1;const e$1=window,r=e$1.trustedTypes,h=r?r.emptyScript:"",o$1=e$1.reactiveElementPolyfillSupport,n$1={toAttribute(t,i){switch(i){case Boolean:t=t?h:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t);}return t},fromAttribute(t,i){let s=t;switch(i){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t);}catch(t){s=null;}}return s}},a=(t,i)=>i!==t&&(i==i||t==t),l$1={attribute:!0,type:String,converter:n$1,reflect:!1,hasChanged:a};class d extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u();}static addInitializer(t){var i;this.finalize(),(null!==(i=this.h)&&void 0!==i?i:this.h=[]).push(t);}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((i,s)=>{const e=this._$Ep(s,i);void 0!==e&&(this._$Ev.set(e,s),t.push(e));})),t}static createProperty(t,i=l$1){if(i.state&&(i.attribute=!1),this.finalize(),this.elementProperties.set(t,i),!i.noAccessor&&!this.prototype.hasOwnProperty(t)){const s="symbol"==typeof t?Symbol():"__"+t,e=this.getPropertyDescriptor(t,s,i);void 0!==e&&Object.defineProperty(this.prototype,t,e);}}static getPropertyDescriptor(t,i,s){return {get(){return this[i]},set(e){const r=this[t];this[i]=e,this.requestUpdate(t,r,s);},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||l$1}static finalize(){if(this.hasOwnProperty("finalized"))return !1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,i=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const s of i)this.createProperty(s,t[s]);}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(i){const s=[];if(Array.isArray(i)){const e=new Set(i.flat(1/0).reverse());for(const i of e)s.unshift(c(i));}else void 0!==i&&s.push(c(i));return s}static _$Ep(t,i){const s=i.attribute;return !1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)));}addController(t){var i,s;(null!==(i=this._$ES)&&void 0!==i?i:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(s=t.hostConnected)||void 0===s||s.call(t));}removeController(t){var i;null===(i=this._$ES)||void 0===i||i.splice(this._$ES.indexOf(t)>>>0,1);}_$Eg(){this.constructor.elementProperties.forEach(((t,i)=>{this.hasOwnProperty(i)&&(this._$Ei.set(i,this[i]),delete this[i]);}));}createRenderRoot(){var t;const s=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return S(s,this.constructor.elementStyles),s}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostConnected)||void 0===i?void 0:i.call(t)}));}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostDisconnected)||void 0===i?void 0:i.call(t)}));}attributeChangedCallback(t,i,s){this._$AK(t,s);}_$EO(t,i,s=l$1){var e;const r=this.constructor._$Ep(t,s);if(void 0!==r&&!0===s.reflect){const h=(void 0!==(null===(e=s.converter)||void 0===e?void 0:e.toAttribute)?s.converter:n$1).toAttribute(i,s.type);this._$El=t,null==h?this.removeAttribute(r):this.setAttribute(r,h),this._$El=null;}}_$AK(t,i){var s;const e=this.constructor,r=e._$Ev.get(t);if(void 0!==r&&this._$El!==r){const t=e.getPropertyOptions(r),h="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(s=t.converter)||void 0===s?void 0:s.fromAttribute)?t.converter:n$1;this._$El=r,this[r]=h.fromAttribute(i,t.type),this._$El=null;}}requestUpdate(t,i,s){let e=!0;void 0!==t&&(((s=s||this.constructor.getPropertyOptions(t)).hasChanged||a)(this[t],i)?(this._$AL.has(t)||this._$AL.set(t,i),!0===s.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,s))):e=!1),!this.isUpdatePending&&e&&(this._$E_=this._$Ej());}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_;}catch(t){Promise.reject(t);}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this._$Ei&&(this._$Ei.forEach(((t,i)=>this[i]=t)),this._$Ei=void 0);let i=!1;const s=this._$AL;try{i=this.shouldUpdate(s),i?(this.willUpdate(s),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostUpdate)||void 0===i?void 0:i.call(t)})),this.update(s)):this._$Ek();}catch(t){throw i=!1,this._$Ek(),t}i&&this._$AE(s);}willUpdate(t){}_$AE(t){var i;null===(i=this._$ES)||void 0===i||i.forEach((t=>{var i;return null===(i=t.hostUpdated)||void 0===i?void 0:i.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t);}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return !0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,i)=>this._$EO(i,this[i],t))),this._$EC=void 0),this._$Ek();}updated(t){}firstUpdated(t){}}d.finalized=!0,d.elementProperties=new Map,d.elementStyles=[],d.shadowRootOptions={mode:"open"},null==o$1||o$1({ReactiveElement:d}),(null!==(s$1=e$1.reactiveElementVersions)&&void 0!==s$1?s$1:e$1.reactiveElementVersions=[]).push("1.5.0");
1413
+
1414
+ /**
1415
+ * @license
1416
+ * Copyright 2017 Google LLC
1417
+ * SPDX-License-Identifier: BSD-3-Clause
1418
+ */var l,o;class s extends d{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0;}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Z(i,this.renderRoot,this.renderOptions);}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0);}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1);}render(){return x}}s.finalized=!0,s._$litElement$=!0,null===(l=globalThis.litElementHydrateSupport)||void 0===l||l.call(globalThis,{LitElement:s});const n=globalThis.litElementPolyfillSupport;null==n||n({LitElement:s});(null!==(o=globalThis.litElementVersions)&&void 0!==o?o:globalThis.litElementVersions=[]).push("3.2.2");
1419
+
1420
+ /**
1421
+ * @license
1422
+ * Copyright 2017 Google LLC
1423
+ * SPDX-License-Identifier: BSD-3-Clause
1424
+ */
1425
+ const i=(i,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(n){n.createProperty(e.key,i);}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this));},finisher(n){n.createProperty(e.key,i);}};function e(e){return (n,t)=>void 0!==t?((i,e,n)=>{e.constructor.createProperty(n,i);})(e,n,t):i(e,n)}
1426
+
1427
+ /**
1428
+ * @license
1429
+ * Copyright 2017 Google LLC
1430
+ * SPDX-License-Identifier: BSD-3-Clause
1431
+ */function t(t){return e({...t,state:!0})}
1432
+
1433
+ var mediaProviderDiscoveryId = Symbol("@vidstack/media-provider-discovery");
1434
+ var MediaProviderElement = class extends s {
1435
+ constructor() {
1436
+ super();
1437
+ this._disconnectDisposal = new DisposalBin();
1438
+ this._logger = void 0;
1439
+ this.loading = "visible";
1440
+ this._attemptingAutoplay = false;
1441
+ this.controllerQueue = new RequestQueue();
1442
+ this._store = createMediaStore();
1443
+ this._state = unwrapStoreRecord(this._store);
1444
+ this.connectedQueue = hostRequestQueue(this);
1445
+ this.mediaQueue = new RequestQueue();
1446
+ this.screenOrientationController = new ScreenOrientationController(this);
1447
+ this.fullscreenController = new FullscreenController(this, this.screenOrientationController);
1448
+ discoverable(this, "vds-media-provider-connect", { register: mediaProviderDiscoveryId });
1449
+ const intersectionController = createIntersectionController(
1450
+ this,
1451
+ { target: this, threshold: 0 },
1452
+ (entries) => {
1453
+ if (!/(visible|lazy)/.test(this.loading)) {
1454
+ intersectionController.hostDisconnected();
1455
+ return;
1456
+ }
1457
+ if (entries[0]?.isIntersecting) {
1458
+ this.startLoadingMedia();
1459
+ intersectionController.hostDisconnected();
1460
+ }
1461
+ }
1462
+ );
1463
+ }
1464
+ connectedCallback() {
1465
+ super.connectedCallback();
1466
+ this._logMediaEvents();
1467
+ window.requestAnimationFrame(() => {
1468
+ if (isUndefined(this.canLoadPoster)) {
1469
+ this.canLoadPoster = true;
1470
+ }
1471
+ });
1472
+ }
1473
+ firstUpdated(changedProperties) {
1474
+ super.firstUpdated(changedProperties);
1475
+ this.dispatchEvent(
1476
+ vdsEvent("vds-fullscreen-support-change", {
1477
+ detail: this.canFullscreen
1478
+ })
1479
+ );
1480
+ if (this.canLoad || this.loading === "eager") {
1481
+ window?.requestAnimationFrame(() => {
1482
+ this.startLoadingMedia();
1483
+ });
1484
+ } else if (this.loading === "idle") {
1485
+ requestIdleCallback(() => {
1486
+ this.startLoadingMedia();
1487
+ });
1488
+ }
1489
+ }
1490
+ render() {
1491
+ return y`<slot @slotchange="${this.handleDefaultSlotChange}"></slot>`;
1492
+ }
1493
+ disconnectedCallback() {
1494
+ this._updateMediaStoreOnDisconnect(this._store);
1495
+ this.mediaQueue.destroy();
1496
+ this._disconnectDisposal.empty();
1497
+ super.disconnectedCallback();
1498
+ raf(() => {
1499
+ raf(() => {
1500
+ if (!this.isConnected)
1501
+ this.destroy();
1502
+ });
1503
+ });
1504
+ }
1505
+ _updateMediaStoreOnDisconnect(store) {
1506
+ store.paused.set(true);
1507
+ store.playing.set(false);
1508
+ store.seeking.set(false);
1509
+ store.waiting.set(false);
1510
+ store.fullscreen.set(false);
1511
+ }
1512
+ destroy() {
1513
+ if (this.isConnected)
1514
+ this.disconnectedCallback();
1515
+ this.dispatchEvent(vdsEvent("vds-destroy"));
1516
+ }
1517
+ _logMediaEvents() {
1518
+ }
1519
+ get volume() {
1520
+ return this._getVolume();
1521
+ }
1522
+ set volume(newVolume) {
1523
+ this.mediaQueue.queue("volume", () => {
1524
+ const oldVol = this.volume;
1525
+ const newVol = clampNumber(0, newVolume, 1);
1526
+ if (oldVol !== newVol) {
1527
+ this._setVolume(newVol);
1528
+ this.requestUpdate("volume", oldVol);
1529
+ }
1530
+ });
1531
+ }
1532
+ get paused() {
1533
+ return this._getPaused();
1534
+ }
1535
+ set paused(newPaused) {
1536
+ this.mediaQueue.queue("paused", () => {
1537
+ if (this.paused === newPaused)
1538
+ return;
1539
+ try {
1540
+ if (!newPaused) {
1541
+ this.play();
1542
+ } else {
1543
+ this.pause();
1544
+ }
1545
+ this.requestUpdate("paused", !newPaused);
1546
+ } catch (e) {
1547
+ this._logger?.error("paused-change-fail", e);
1548
+ }
1549
+ });
1550
+ }
1551
+ get currentTime() {
1552
+ return this._getCurrentTime();
1553
+ }
1554
+ set currentTime(newTime) {
1555
+ this.mediaQueue.queue("current-time", () => {
1556
+ const oldTime = this.currentTime;
1557
+ if (oldTime !== newTime) {
1558
+ this._setCurrentTime(newTime);
1559
+ this.requestUpdate("currentTime", oldTime);
1560
+ }
1561
+ });
1562
+ }
1563
+ get muted() {
1564
+ return this._getMuted();
1565
+ }
1566
+ set muted(newMuted) {
1567
+ this.mediaQueue.queue("muted", () => {
1568
+ const oldMuted = this.muted;
1569
+ if (oldMuted !== newMuted) {
1570
+ this._setMuted(newMuted);
1571
+ this.requestUpdate("muted", oldMuted);
1572
+ }
1573
+ });
1574
+ }
1575
+ get poster() {
1576
+ return this.state.poster;
1577
+ }
1578
+ set poster(newPoster) {
1579
+ const oldPoster = this.poster;
1580
+ if (oldPoster !== newPoster) {
1581
+ this.dispatchEvent(vdsEvent("vds-poster-change", { detail: newPoster }));
1582
+ this.requestUpdate("poster", oldPoster);
1583
+ }
1584
+ }
1585
+ get loop() {
1586
+ return this.state.loop;
1587
+ }
1588
+ set loop(newLoop) {
1589
+ const oldLoop = this.loop;
1590
+ if (oldLoop !== newLoop) {
1591
+ this.dispatchEvent(vdsEvent("vds-loop-change", { detail: newLoop }));
1592
+ this.requestUpdate("loop", oldLoop);
1593
+ }
1594
+ }
1595
+ get controls() {
1596
+ return this.state.controls;
1597
+ }
1598
+ set controls(newControls) {
1599
+ const oldControls = this.controls;
1600
+ if (oldControls !== newControls) {
1601
+ this.dispatchEvent(vdsEvent("vds-controls-change", { detail: newControls }));
1602
+ this.requestUpdate("controls", oldControls);
1603
+ }
1604
+ }
1605
+ get canLoad() {
1606
+ return this.state.canLoad;
1607
+ }
1608
+ startLoadingMedia() {
1609
+ if (this.state.canPlay)
1610
+ return;
1611
+ this.dispatchEvent(vdsEvent("vds-can-load"));
1612
+ }
1613
+ _throwIfNotReadyForPlayback() {
1614
+ if (!this.state.canPlay) {
1615
+ throw Error(`Media is not ready - wait for \`vds-can-play\` event.`);
1616
+ }
1617
+ }
1618
+ async _resetPlaybackIfEnded() {
1619
+ if (!this.state.ended || this.state.currentTime === 0)
1620
+ return;
1621
+ return this._setCurrentTime(0);
1622
+ }
1623
+ _throwIfNotVideoView() {
1624
+ if (this.state.viewType !== "video" /* Video */) {
1625
+ throw Error("Player is currently not in a video view.");
1626
+ }
1627
+ }
1628
+ async _handleMediaReady({ event, duration }) {
1629
+ if (this.state.canPlay)
1630
+ return;
1631
+ this.dispatchEvent(
1632
+ vdsEvent("vds-can-play", {
1633
+ triggerEvent: event,
1634
+ detail: { duration }
1635
+ })
1636
+ );
1637
+ this.mediaQueue.start();
1638
+ await this._attemptAutoplay();
1639
+ }
1640
+ _handleCurrentSrcChange(currentSrc, triggerEvent) {
1641
+ if (this.state.currentSrc === currentSrc)
1642
+ return;
1643
+ this.mediaQueue.stop();
1644
+ this.dispatchEvent(
1645
+ vdsEvent("vds-current-src-change", {
1646
+ detail: currentSrc,
1647
+ triggerEvent
1648
+ })
1649
+ );
1650
+ }
1651
+ get autoplay() {
1652
+ return this.state.autoplay;
1653
+ }
1654
+ set autoplay(newAutoplay) {
1655
+ if (this.autoplay !== newAutoplay) {
1656
+ this.dispatchEvent(vdsEvent("vds-autoplay-change", { detail: newAutoplay }));
1657
+ this.requestUpdate("autoplay", !newAutoplay);
1658
+ }
1659
+ this._attemptAutoplay();
1660
+ }
1661
+ get _canAttemptAutoplay() {
1662
+ return this.state.canPlay && this.state.autoplay && !this.state.started;
1663
+ }
1664
+ async _attemptAutoplay() {
1665
+ if (!this._canAttemptAutoplay)
1666
+ return;
1667
+ this._attemptingAutoplay = true;
1668
+ try {
1669
+ await this.play();
1670
+ this.dispatchEvent(vdsEvent("vds-autoplay", { detail: { muted: this.muted } }));
1671
+ } catch (error) {
1672
+ this.dispatchEvent(
1673
+ vdsEvent("vds-autoplay-fail", {
1674
+ detail: {
1675
+ muted: this.muted,
1676
+ error
1677
+ }
1678
+ })
1679
+ );
1680
+ this.requestUpdate();
1681
+ }
1682
+ this._attemptingAutoplay = false;
1683
+ }
1684
+ get controller() {
1685
+ return this._controller;
1686
+ }
1687
+ get logLevel() {
1688
+ return this._controller?.logLevel ?? "silent";
1689
+ }
1690
+ set logLevel(level) {
1691
+ }
1692
+ get idleDelay() {
1693
+ return this._controller?.idleDelay ?? 0;
1694
+ }
1695
+ set idleDelay(delay) {
1696
+ this.controllerQueue.queue("idle-delay", () => {
1697
+ this._controller.idleDelay = delay;
1698
+ });
1699
+ }
1700
+ attachMediaController(controller, onDisconnect) {
1701
+ this._controller = controller;
1702
+ this._store = controller._store;
1703
+ this._state = controller.state;
1704
+ this.controllerQueue.start();
1705
+ onDisconnect(() => {
1706
+ this.controllerQueue.destroy();
1707
+ this._store = createMediaStore();
1708
+ this._state = unwrapStoreRecord(this._store);
1709
+ if (this._controller) {
1710
+ copyStoreRecords(this._controller._store, this._store);
1711
+ this._updateMediaStoreOnDisconnect(this._controller._store);
1712
+ }
1713
+ this._controller = void 0;
1714
+ });
1715
+ }
1716
+ dispatchEvent(event) {
1717
+ if (!this._controller && event.type.startsWith("vds-") && event.type !== "vds-destroy") {
1718
+ this.controllerQueue.queue(event.type, () => {
1719
+ super.dispatchEvent(event);
1720
+ });
1721
+ return false;
1722
+ }
1723
+ return super.dispatchEvent(event);
1724
+ }
1725
+ store() {
1726
+ return this._store;
1727
+ }
1728
+ get state() {
1729
+ return this._state;
1730
+ }
1731
+ get canFullscreen() {
1732
+ return this.fullscreenController.isSupported;
1733
+ }
1734
+ get fullscreen() {
1735
+ return this.fullscreenController.isFullscreen;
1736
+ }
1737
+ get fullscreenOrientation() {
1738
+ return this.fullscreenController.screenOrientationLock;
1739
+ }
1740
+ set fullscreenOrientation(lockType) {
1741
+ const prevLockType = this.fullscreenController.screenOrientationLock;
1742
+ if (prevLockType !== lockType) {
1743
+ this.fullscreenController.screenOrientationLock = lockType;
1744
+ this.requestUpdate("fullscreen-orientation", prevLockType);
1745
+ }
1746
+ }
1747
+ enterFullscreen() {
1748
+ return this.fullscreenController.enterFullscreen();
1749
+ }
1750
+ exitFullscreen() {
1751
+ return this.fullscreenController.exitFullscreen();
1752
+ }
1753
+ };
1754
+ __decorateClass([
1755
+ e({ type: Number })
1756
+ ], MediaProviderElement.prototype, "volume", 1);
1757
+ __decorateClass([
1758
+ e({ type: Boolean })
1759
+ ], MediaProviderElement.prototype, "paused", 1);
1760
+ __decorateClass([
1761
+ e({ type: Number })
1762
+ ], MediaProviderElement.prototype, "currentTime", 1);
1763
+ __decorateClass([
1764
+ e({ type: Boolean })
1765
+ ], MediaProviderElement.prototype, "muted", 1);
1766
+ __decorateClass([
1767
+ e()
1768
+ ], MediaProviderElement.prototype, "poster", 1);
1769
+ __decorateClass([
1770
+ e({ type: Boolean })
1771
+ ], MediaProviderElement.prototype, "loop", 1);
1772
+ __decorateClass([
1773
+ e({ type: Boolean })
1774
+ ], MediaProviderElement.prototype, "controls", 1);
1775
+ __decorateClass([
1776
+ t()
1777
+ ], MediaProviderElement.prototype, "canLoadPoster", 2);
1778
+ __decorateClass([
1779
+ e({ attribute: "loading" })
1780
+ ], MediaProviderElement.prototype, "loading", 2);
1781
+ __decorateClass([
1782
+ e({ type: Boolean })
1783
+ ], MediaProviderElement.prototype, "autoplay", 1);
1784
+ __decorateClass([
1785
+ e({ attribute: "log-level" })
1786
+ ], MediaProviderElement.prototype, "logLevel", 1);
1787
+ __decorateClass([
1788
+ e({ attribute: "idle-delay", type: Number })
1789
+ ], MediaProviderElement.prototype, "idleDelay", 1);
1790
+ __decorateClass([
1791
+ e({ attribute: "fullscreen-orientation" })
1792
+ ], MediaProviderElement.prototype, "fullscreenOrientation", 1);
1793
+
1794
+ var UserIdleController = class {
1795
+ constructor(_host, _mediaStore) {
1796
+ this._host = _host;
1797
+ this._mediaStore = _mediaStore;
1798
+ this._idle = false;
1799
+ this._mediaPaused = false;
1800
+ this._idlingPaused = false;
1801
+ this._disposal = new DisposalBin();
1802
+ this.delay = 2e3;
1803
+ _host.addController(this);
1804
+ }
1805
+ get paused() {
1806
+ return this._idlingPaused || this._mediaPaused;
1807
+ }
1808
+ set paused(paused) {
1809
+ this._idlingPaused = paused;
1810
+ this._handleIdleChange();
1811
+ }
1812
+ hostConnected() {
1813
+ this._disposal.add(
1814
+ this._mediaStore.paused.subscribe(($paused) => {
1815
+ this._mediaPaused = $paused;
1816
+ this._handleIdleChange();
1817
+ })
1818
+ );
1819
+ const startIdleTimerEvents = ["pointerdown", "pointermove", "focus", "keydown"];
1820
+ startIdleTimerEvents.forEach((eventType) => {
1821
+ const off = listen(this._host, eventType, this._handleIdleChange.bind(this));
1822
+ this._disposal.add(off);
1823
+ });
1824
+ }
1825
+ hostDisconnected() {
1826
+ this._disposal.empty();
1827
+ this._stopIdleTimer();
1828
+ }
1829
+ _handleIdleChange() {
1830
+ if (this.paused) {
1831
+ this._stopIdleTimer();
1832
+ } else {
1833
+ this._startIdleTimer();
1834
+ }
1835
+ }
1836
+ _startIdleTimer() {
1837
+ this._stopIdleTimer();
1838
+ this._idleTimeout = window.setTimeout(() => {
1839
+ this._dispatchIdleChange(!this.paused);
1840
+ }, this.delay);
1841
+ }
1842
+ _stopIdleTimer() {
1843
+ window.clearTimeout(this._idleTimeout);
1844
+ this._dispatchIdleChange(false);
1845
+ }
1846
+ _dispatchIdleChange(isIdle) {
1847
+ if (this._idle !== isIdle) {
1848
+ this._host.dispatchEvent(vdsEvent("vds-user-idle-change", { detail: isIdle }));
1849
+ this._idle = isIdle;
1850
+ }
1851
+ }
1852
+ };
1853
+ var MediaController = class {
1854
+ constructor(_host) {
1855
+ this._host = _host;
1856
+ this._disconnectDisposal = new DisposalBin();
1857
+ this.providerQueue = new RequestQueue();
1858
+ this.providerDisposal = new DisposalBin();
1859
+ this._logController = void 0;
1860
+ this._logger = void 0;
1861
+ this._providerContext = mediaProviderElementContext.provide(this._host);
1862
+ this._mediaStoreProvider = mediaStoreContext.provide(this._host);
1863
+ this.state = unwrapStoreRecord(this._store);
1864
+ this._userIdleController = new UserIdleController(this._host, this._store);
1865
+ this._handleIdleChange = eventListener(this._host, "vds-user-idle-change", (event) => {
1866
+ this._store.userIdle.set(event.detail);
1867
+ this._satisfyMediaRequest("userIdle", event);
1868
+ });
1869
+ this._pendingMediaRequests = {
1870
+ loading: [],
1871
+ play: [],
1872
+ pause: [],
1873
+ volume: [],
1874
+ fullscreen: [],
1875
+ seeked: [],
1876
+ seeking: [],
1877
+ userIdle: []
1878
+ };
1879
+ this._handleStartLoadingRequest = eventListener(
1880
+ this._host,
1881
+ "vds-start-loading",
1882
+ this._createMediaRequestHandler("loading", (event) => {
1883
+ if (this.state.canLoad)
1884
+ return;
1885
+ this._pendingMediaRequests.loading.push(event);
1886
+ this._provider.startLoadingMedia();
1887
+ })
1888
+ );
1889
+ this._handleMuteRequest = eventListener(
1890
+ this._host,
1891
+ "vds-mute-request",
1892
+ this._createMediaRequestHandler("muted", (event) => {
1893
+ if (this.state.muted)
1894
+ return;
1895
+ this._pendingMediaRequests.volume.push(event);
1896
+ this.provider.muted = true;
1897
+ })
1898
+ );
1899
+ this._handleUnmuteRequest = eventListener(
1900
+ this._host,
1901
+ "vds-unmute-request",
1902
+ this._createMediaRequestHandler("muted", (event) => {
1903
+ if (!this.state.muted)
1904
+ return;
1905
+ this._pendingMediaRequests.volume.push(event);
1906
+ this.provider.muted = false;
1907
+ if (this.state.volume === 0) {
1908
+ this._pendingMediaRequests.volume.push(event);
1909
+ this.provider.volume = 0.25;
1910
+ }
1911
+ })
1912
+ );
1913
+ this._handlePlayRequest = eventListener(
1914
+ this._host,
1915
+ "vds-play-request",
1916
+ this._createMediaRequestHandler("paused", (event) => {
1917
+ if (!this.state.paused)
1918
+ return;
1919
+ this._pendingMediaRequests.play.push(event);
1920
+ this.provider.paused = false;
1921
+ })
1922
+ );
1923
+ this._handlePauseRequest = eventListener(
1924
+ this._host,
1925
+ "vds-pause-request",
1926
+ this._createMediaRequestHandler("paused", (event) => {
1927
+ if (this.state.paused)
1928
+ return;
1929
+ this._pendingMediaRequests.pause.push(event);
1930
+ this.provider.paused = true;
1931
+ })
1932
+ );
1933
+ this._isSeekingRequestPending = false;
1934
+ this._handleSeekingRequest = eventListener(
1935
+ this._host,
1936
+ "vds-seeking-request",
1937
+ this._createMediaRequestHandler("seeking", (event) => {
1938
+ this._stopWaiting();
1939
+ this._pendingMediaRequests.seeking.push(event);
1940
+ this._isSeekingRequestPending = true;
1941
+ this._store.seeking.set(true);
1942
+ })
1943
+ );
1944
+ this._handleSeekRequest = eventListener(
1945
+ this._host,
1946
+ "vds-seek-request",
1947
+ this._createMediaRequestHandler("seeking", (event) => {
1948
+ if (this.store.ended) {
1949
+ this._isReplay = true;
1950
+ }
1951
+ this._pendingMediaRequests.seeked.push(event);
1952
+ this._isSeekingRequestPending = false;
1953
+ let time = event.detail;
1954
+ if (this.state.duration - event.detail < 0.25) {
1955
+ time = this.state.duration;
1956
+ }
1957
+ this.provider.currentTime = time;
1958
+ })
1959
+ );
1960
+ this._handleVolumeChangeRequest = eventListener(
1961
+ this._host,
1962
+ "vds-volume-change-request",
1963
+ this._createMediaRequestHandler("volume", (event) => {
1964
+ const volume = event.detail;
1965
+ if (this.state.volume === volume)
1966
+ return;
1967
+ this._pendingMediaRequests.volume.push(event);
1968
+ this.provider.volume = volume;
1969
+ if (volume > 0 && this.state.muted) {
1970
+ this._pendingMediaRequests.volume.push(event);
1971
+ this.provider.muted = false;
1972
+ }
1973
+ })
1974
+ );
1975
+ this._handleEnterFullscreenRequest = eventListener(
1976
+ this._host,
1977
+ "vds-enter-fullscreen-request",
1978
+ this._createMediaRequestHandler("fullscreen", async (event) => {
1979
+ if (this.state.fullscreen)
1980
+ return;
1981
+ const target = event.detail ?? "media";
1982
+ if (target === "media" && this._host.canFullscreen) {
1983
+ this._pendingMediaRequests.fullscreen.push(event);
1984
+ await this._host.enterFullscreen?.();
1985
+ } else if (this.provider) {
1986
+ this._pendingMediaRequests.fullscreen.push(event);
1987
+ await this.provider.enterFullscreen();
1988
+ }
1989
+ })
1990
+ );
1991
+ this._handleExitFullscreenRequest = eventListener(
1992
+ this._host,
1993
+ "vds-exit-fullscreen-request",
1994
+ this._createMediaRequestHandler("fullscreen", async (event) => {
1995
+ if (!this.state.fullscreen)
1996
+ return;
1997
+ const target = event.detail ?? "media";
1998
+ if (target === "media" && this._host.canFullscreen) {
1999
+ this._pendingMediaRequests.fullscreen.push(event);
2000
+ await this._host.exitFullscreen?.();
2001
+ } else if (this.provider) {
2002
+ this._pendingMediaRequests.fullscreen.push(event);
2003
+ await this.provider.exitFullscreen();
2004
+ }
2005
+ })
2006
+ );
2007
+ this._handleResumeIdlingRequest = eventListener(
2008
+ this._host,
2009
+ "vds-resume-user-idle-request",
2010
+ (event) => {
2011
+ if (!this._mediaRequestEventGateway(event))
2012
+ return;
2013
+ this._pendingMediaRequests.userIdle.push(event);
2014
+ this._userIdleController.paused = false;
2015
+ }
2016
+ );
2017
+ this._handlePauseIdlingRequest = eventListener(
2018
+ this._host,
2019
+ "vds-pause-user-idle-request",
2020
+ (event) => {
2021
+ if (!this._mediaRequestEventGateway(event))
2022
+ return;
2023
+ this._pendingMediaRequests.userIdle.push(event);
2024
+ this._userIdleController.paused = true;
2025
+ }
2026
+ );
2027
+ this._handleShowPosterRequest = eventListener(
2028
+ this._host,
2029
+ "vds-show-poster-request",
2030
+ this._createMediaRequestHandler("poster", () => {
2031
+ this._provider.canLoadPoster = true;
2032
+ })
2033
+ );
2034
+ this._handleHidePosterRequest = eventListener(
2035
+ this._host,
2036
+ "vds-hide-poster-request",
2037
+ this._createMediaRequestHandler("poster", () => {
2038
+ this._provider.canLoadPoster = false;
2039
+ })
2040
+ );
2041
+ this._handleLoopRequest = this._createMediaRequestHandler("loop", () => {
2042
+ window.requestAnimationFrame(async () => {
2043
+ try {
2044
+ this._isLooping = true;
2045
+ this._isReplay = true;
2046
+ await this._provider.play();
2047
+ } catch (e) {
2048
+ this._isReplay = false;
2049
+ this._isLooping = false;
2050
+ }
2051
+ });
2052
+ });
2053
+ this._handleFullscreenChange = eventListener(
2054
+ this._host,
2055
+ "vds-fullscreen-change",
2056
+ (event) => {
2057
+ this._store.fullscreen.set(event.detail);
2058
+ if (event.target !== this._host)
2059
+ return;
2060
+ this._satisfyMediaRequest("fullscreen", event);
2061
+ this._provider?.dispatchEvent(
2062
+ vdsEvent("vds-fullscreen-change", {
2063
+ detail: event.detail,
2064
+ triggerEvent: event
2065
+ })
2066
+ );
2067
+ }
2068
+ );
2069
+ this._handleFullscreenError = eventListener(
2070
+ this._host,
2071
+ "vds-fullscreen-error",
2072
+ (event) => {
2073
+ if (event.target !== this._host)
2074
+ return;
2075
+ this._satisfyMediaRequest("fullscreen", event);
2076
+ this._provider?.dispatchEvent(
2077
+ vdsEvent("vds-fullscreen-error", {
2078
+ detail: event.detail,
2079
+ triggerEvent: event
2080
+ })
2081
+ );
2082
+ }
2083
+ );
2084
+ this._isReplay = false;
2085
+ this._isLooping = false;
2086
+ this._firingWaiting = false;
2087
+ this._mediaEvents = [];
2088
+ this._handleSeeking = functionThrottle(
2089
+ (event) => {
2090
+ this._mediaEvents.push(event);
2091
+ this._store.seeking.set(true);
2092
+ this._store.currentTime.set(event.detail);
2093
+ this._satisfyMediaRequest("seeking", event);
2094
+ },
2095
+ 150,
2096
+ { leading: true }
2097
+ );
2098
+ this._fireWaiting = functionDebounce(() => {
2099
+ if (!this._originalWaitingEvent)
2100
+ return;
2101
+ this._firingWaiting = true;
2102
+ const event = vdsEvent("vds-waiting", this._originalWaitingEvent);
2103
+ this._mediaEvents.push(event);
2104
+ this._store.waiting.set(true);
2105
+ this._store.playing.set(false);
2106
+ this._provider?.dispatchEvent(event);
2107
+ this._originalWaitingEvent = void 0;
2108
+ this._firingWaiting = false;
2109
+ }, 300);
2110
+ this._skipInitialSrcChange = true;
2111
+ discover(_host, mediaProviderDiscoveryId, (provider, onDisconnect) => {
2112
+ this.attachMediaProvider(provider, onDisconnect);
2113
+ });
2114
+ _host.addController({
2115
+ hostConnected: () => {
2116
+ if (!this.state.canPlay) {
2117
+ this._host.setAttribute("aria-busy", "true");
2118
+ }
2119
+ },
2120
+ hostDisconnected: () => {
2121
+ this._clearMediaStateTracking();
2122
+ this._clearPendingMediaRequests();
2123
+ this.providerQueue.destroy();
2124
+ this.providerDisposal.empty();
2125
+ this._skipInitialSrcChange = true;
2126
+ this._disconnectDisposal.empty();
2127
+ }
2128
+ });
2129
+ }
2130
+ get logLevel() {
2131
+ return this._logController?.logLevel ?? "silent";
2132
+ }
2133
+ set logLevel(level) {
2134
+ }
2135
+ get provider() {
2136
+ return this._provider;
2137
+ }
2138
+ attachMediaProvider(provider, onDisconnect) {
2139
+ if (!isNil(this.provider) || this.provider === provider)
2140
+ return;
2141
+ this._handleMediaProviderDisconnect();
2142
+ this._provider = provider;
2143
+ this._providerContext.value.set(provider);
2144
+ copyStoreRecords(this._provider._store, this._store);
2145
+ this._attachMediaEventListeners();
2146
+ provider.attachMediaController(this, (cb) => this._disconnectDisposal.add(cb));
2147
+ this._flushMediaProviderConnectedQueue();
2148
+ onDisconnect(this._handleMediaProviderDisconnect.bind(this));
2149
+ }
2150
+ _handleMediaProviderDisconnect() {
2151
+ if (isNil(this.provider))
2152
+ return;
2153
+ this._stopWaiting();
2154
+ this.providerQueue.destroy();
2155
+ this.providerDisposal.empty();
2156
+ this._provider = void 0;
2157
+ this._providerContext.value.set(void 0);
2158
+ resetMediaStore(this._store);
2159
+ this._store.viewType.set("unknown" /* Unknown */);
2160
+ }
2161
+ _flushMediaProviderConnectedQueue() {
2162
+ this.providerQueue.start();
2163
+ this.providerDisposal.add(() => {
2164
+ this.providerQueue.stop();
2165
+ });
2166
+ }
2167
+ get store() {
2168
+ return this._mediaStoreProvider.value;
2169
+ }
2170
+ get _store() {
2171
+ return this._mediaStoreProvider.value;
2172
+ }
2173
+ get idleDelay() {
2174
+ return this._userIdleController.delay;
2175
+ }
2176
+ set idleDelay(delay) {
2177
+ this._userIdleController.delay = delay;
2178
+ }
2179
+ _clearPendingMediaRequests() {
2180
+ keysOf(this._pendingMediaRequests).forEach((key) => {
2181
+ this._pendingMediaRequests[key] = [];
2182
+ });
2183
+ }
2184
+ _satisfyMediaRequest(type, event) {
2185
+ const requestEvent = this._pendingMediaRequests[type].shift();
2186
+ if (requestEvent) {
2187
+ event.requestEvent = requestEvent;
2188
+ appendTriggerEvent(event, requestEvent);
2189
+ }
2190
+ }
2191
+ _mediaRequestEventGateway(event) {
2192
+ event.stopPropagation();
2193
+ return true;
2194
+ }
2195
+ _createMediaRequestHandler(queueKey, callback) {
2196
+ return (event) => {
2197
+ if (!this._mediaRequestEventGateway(event))
2198
+ return;
2199
+ if (this._provider) {
2200
+ callback(event);
2201
+ return;
2202
+ }
2203
+ this.providerQueue.queue(queueKey, () => {
2204
+ callback(event);
2205
+ });
2206
+ };
2207
+ }
2208
+ _attachMediaEventListeners() {
2209
+ if (!this._provider)
2210
+ return;
2211
+ const mediaEventListeners = {
2212
+ "vds-can-load": this._handleCanLoad,
2213
+ "vds-load-start": this._handleLoadStart,
2214
+ "vds-loaded-data": this._handleLoadedData,
2215
+ "vds-loaded-metadata": this._handleLoadedMetadata,
2216
+ "vds-can-play": this._handleCanPlay,
2217
+ "vds-can-play-through": this._handleCanPlayThrough,
2218
+ "vds-current-src-change": this._handleCurrentSrcChange,
2219
+ "vds-autoplay": this._handleAutoplay,
2220
+ "vds-autoplay-fail": this._handleAutoplayFail,
2221
+ "vds-loop-request": this._handleLoopRequest,
2222
+ "vds-play": this._handlePlay,
2223
+ "vds-play-fail": this._handlePlayFail,
2224
+ "vds-playing": this._handlePlaying,
2225
+ "vds-pause": this._handlePause,
2226
+ "vds-time-update": this._handleTimeUpdate,
2227
+ "vds-volume-change": this._handleVolumeChange,
2228
+ "vds-seeking": this._handleSeeking,
2229
+ "vds-seeked": this._handleSeeked,
2230
+ "vds-waiting": this._handleWaiting,
2231
+ "vds-ended": this._handleEnded,
2232
+ "vds-autoplay-change": this._handleAutoplayChange,
2233
+ "vds-error": this._handleError,
2234
+ "vds-fullscreen-support-change": this._handleFullscreenSupportChange,
2235
+ "vds-poster-change": this._handlePosterChange,
2236
+ "vds-loop-change": this._handleLoopChange,
2237
+ "vds-playsinline-change": this._handlePlaysinlineChange,
2238
+ "vds-controls-change": this._handleControlsChange,
2239
+ "vds-media-type-change": this._handleMediaTypeChange,
2240
+ "vds-view-type-change": this._handleViewTypeChange,
2241
+ "vds-duration-change": this._handleDurationChange,
2242
+ "vds-progress": this._handleProgress,
2243
+ "vds-src-change": this._handleSrcChange
2244
+ };
2245
+ for (const eventType of keysOf(mediaEventListeners)) {
2246
+ const handler = mediaEventListeners[eventType].bind(this);
2247
+ this.providerDisposal.add(listen(this._provider, eventType, handler));
2248
+ }
2249
+ }
2250
+ _clearMediaStateTracking() {
2251
+ this._isReplay = false;
2252
+ this._isLooping = false;
2253
+ this._firingWaiting = false;
2254
+ this._originalWaitingEvent = void 0;
2255
+ this._mediaEvents = [];
2256
+ }
2257
+ _findLastMediaEvent(eventType) {
2258
+ return this._mediaEvents[this._mediaEvents.map((e) => e.type).lastIndexOf(eventType)];
2259
+ }
2260
+ _handleCanLoad(event) {
2261
+ this._store.canLoad.set(true);
2262
+ this._mediaEvents.push(event);
2263
+ this._satisfyMediaRequest("loading", event);
2264
+ }
2265
+ _updateMetadata(metadata) {
2266
+ this._store.currentSrc.set(metadata.currentSrc);
2267
+ this._store.mediaType.set(metadata.mediaType);
2268
+ this._store.viewType.set(metadata.viewType);
2269
+ }
2270
+ _handleLoadStart(event) {
2271
+ this._updateMetadata(event.detail);
2272
+ this._mediaEvents.push(event);
2273
+ appendTriggerEvent(event, this._findLastMediaEvent("vds-src-change"));
2274
+ appendTriggerEvent(event, this._findLastMediaEvent("vds-can-load"));
2275
+ }
2276
+ _handleLoadedData(event) {
2277
+ this._mediaEvents.push(event);
2278
+ appendTriggerEvent(event, this._findLastMediaEvent("vds-load-start"));
2279
+ }
2280
+ _handleLoadedMetadata(event) {
2281
+ this._updateMetadata(event.detail);
2282
+ this._mediaEvents.push(event);
2283
+ appendTriggerEvent(event, this._findLastMediaEvent("vds-load-start"));
2284
+ }
2285
+ _handleCanPlay(event) {
2286
+ this._mediaEvents.push(event);
2287
+ if (event.triggerEvent?.type !== "loadedmetadata") {
2288
+ appendTriggerEvent(event, this._findLastMediaEvent("vds-loaded-metadata"));
2289
+ }
2290
+ this._store.canPlay.set(true);
2291
+ this._store.duration.set(event.detail.duration);
2292
+ this._host.setAttribute("aria-busy", "false");
2293
+ }
2294
+ _handleCanPlayThrough(event) {
2295
+ this._store.canPlay.set(true);
2296
+ this._store.duration.set(event.detail.duration);
2297
+ appendTriggerEvent(event, this._findLastMediaEvent("vds-can-play"));
2298
+ }
2299
+ _handleAutoplay(event) {
2300
+ this._mediaEvents.push(event);
2301
+ appendTriggerEvent(event, this._findLastMediaEvent("vds-play"));
2302
+ appendTriggerEvent(event, this._findLastMediaEvent("vds-can-play"));
2303
+ this._store.autoplayError.set(void 0);
2304
+ }
2305
+ _handleAutoplayFail(event) {
2306
+ appendTriggerEvent(event, this._findLastMediaEvent("vds-play-fail"));
2307
+ appendTriggerEvent(event, this._findLastMediaEvent("vds-can-play"));
2308
+ this._store.autoplayError.set(event.detail);
2309
+ this._clearMediaStateTracking();
2310
+ }
2311
+ _handlePlay(event) {
2312
+ if (this._isLooping || !this.state.paused) {
2313
+ event.stopImmediatePropagation();
2314
+ return;
2315
+ }
2316
+ this._mediaEvents.push(event);
2317
+ appendTriggerEvent(event, this._findLastMediaEvent("vds-waiting"));
2318
+ this._satisfyMediaRequest("play", event);
2319
+ this._store.paused.set(false);
2320
+ this._store.autoplayError.set(void 0);
2321
+ if (this.state.ended || this._isReplay) {
2322
+ this._isReplay = false;
2323
+ this._store.ended.set(false);
2324
+ const replayEvent = vdsEvent("vds-replay", {
2325
+ triggerEvent: event
2326
+ });
2327
+ this._provider?.dispatchEvent(replayEvent);
2328
+ }
2329
+ }
2330
+ _handlePlayFail(event) {
2331
+ this._mediaEvents.push(event);
2332
+ this._stopWaiting();
2333
+ appendTriggerEvent(event, this._findLastMediaEvent("vds-play"));
2334
+ this._store.paused.set(true);
2335
+ this._store.playing.set(false);
2336
+ this._satisfyMediaRequest("play", event);
2337
+ this._clearMediaStateTracking();
2338
+ }
2339
+ _handlePlaying(event) {
2340
+ this._mediaEvents.push(event);
2341
+ const playEvent = this._findLastMediaEvent("vds-play");
2342
+ if (playEvent) {
2343
+ appendTriggerEvent(event, this._findLastMediaEvent("vds-waiting"));
2344
+ appendTriggerEvent(event, playEvent);
2345
+ } else {
2346
+ appendTriggerEvent(event, this._findLastMediaEvent("vds-seeked"));
2347
+ }
2348
+ this._stopWaiting();
2349
+ this._clearMediaStateTracking();
2350
+ this._store.paused.set(false);
2351
+ this._store.playing.set(true);
2352
+ this._store.seeking.set(false);
2353
+ this._store.ended.set(false);
2354
+ if (this._isLooping) {
2355
+ event.stopImmediatePropagation();
2356
+ this._isLooping = false;
2357
+ return;
2358
+ }
2359
+ if (!this.state.started) {
2360
+ this._store.started.set(true);
2361
+ this._provider?.dispatchEvent(vdsEvent("vds-started", { triggerEvent: event }));
2362
+ }
2363
+ }
2364
+ _handlePause(event) {
2365
+ if (this._isLooping) {
2366
+ event.stopImmediatePropagation();
2367
+ return;
2368
+ }
2369
+ appendTriggerEvent(event, this._findLastMediaEvent("vds-seeked"));
2370
+ this._satisfyMediaRequest("pause", event);
2371
+ this._store.paused.set(true);
2372
+ this._store.playing.set(false);
2373
+ this._store.seeking.set(false);
2374
+ this._stopWaiting();
2375
+ this._clearMediaStateTracking();
2376
+ }
2377
+ _handleTimeUpdate(event) {
2378
+ const { currentTime, played } = event.detail;
2379
+ this._store.currentTime.set(currentTime);
2380
+ this._store.played.set(played);
2381
+ this._store.waiting.set(false);
2382
+ }
2383
+ _handleVolumeChange(event) {
2384
+ this._store.volume.set(event.detail.volume);
2385
+ this._store.muted.set(event.detail.muted || event.detail.volume === 0);
2386
+ this._satisfyMediaRequest("volume", event);
2387
+ }
2388
+ _handleSeeked(event) {
2389
+ if (this._isSeekingRequestPending) {
2390
+ this._store.seeking.set(true);
2391
+ event.stopImmediatePropagation();
2392
+ } else if (this.state.seeking) {
2393
+ this._mediaEvents.push(event);
2394
+ appendTriggerEvent(event, this._findLastMediaEvent("vds-waiting"));
2395
+ appendTriggerEvent(event, this._findLastMediaEvent("vds-seeking"));
2396
+ if (this.state.paused) {
2397
+ this._stopWaiting();
2398
+ }
2399
+ this._store.seeking.set(false);
2400
+ if (event.detail !== this.state.duration) {
2401
+ this._store.ended.set(false);
2402
+ }
2403
+ this._store.currentTime.set(event.detail);
2404
+ this._satisfyMediaRequest("seeked", event);
2405
+ }
2406
+ }
2407
+ _stopWaiting() {
2408
+ this._fireWaiting.cancel();
2409
+ this._store.waiting.set(false);
2410
+ }
2411
+ _handleWaiting(event) {
2412
+ if (this._firingWaiting)
2413
+ return;
2414
+ event.stopImmediatePropagation();
2415
+ this._originalWaitingEvent = event;
2416
+ this._fireWaiting();
2417
+ }
2418
+ _handleEnded(event) {
2419
+ if (this._isLooping) {
2420
+ event.stopImmediatePropagation();
2421
+ return;
2422
+ }
2423
+ this._stopWaiting();
2424
+ this._store.paused.set(true);
2425
+ this._store.playing.set(false);
2426
+ this._store.seeking.set(false);
2427
+ this._store.ended.set(true);
2428
+ this._clearMediaStateTracking();
2429
+ }
2430
+ _handleAutoplayChange(event) {
2431
+ this._store.autoplay.set(event.detail);
2432
+ }
2433
+ _handleCurrentSrcChange(event) {
2434
+ this._store.currentSrc.set(event.detail);
2435
+ if (this._skipInitialSrcChange) {
2436
+ this._skipInitialSrcChange = false;
2437
+ return;
2438
+ }
2439
+ this._clearMediaStateTracking();
2440
+ softResetMediaStore(this._store);
2441
+ this._host.setAttribute("aria-busy", "true");
2442
+ }
2443
+ _handleError(event) {
2444
+ this._store.error.set(event.detail);
2445
+ }
2446
+ _handleFullscreenSupportChange(event) {
2447
+ this._store.canFullscreen.set(event.detail);
2448
+ }
2449
+ _handlePosterChange(event) {
2450
+ this._store.poster.set(event.detail);
2451
+ }
2452
+ _handleLoopChange(event) {
2453
+ this._store.loop.set(event.detail);
2454
+ }
2455
+ _handlePlaysinlineChange(event) {
2456
+ this._store.playsinline.set(event.detail);
2457
+ }
2458
+ _handleControlsChange(event) {
2459
+ this._store.controls.set(event.detail);
2460
+ }
2461
+ _handleMediaTypeChange(event) {
2462
+ this._store.mediaType.set(event.detail);
2463
+ }
2464
+ _handleDurationChange(event) {
2465
+ const duration = event.detail;
2466
+ this._store.duration.set(!isNaN(duration) ? duration : 0);
2467
+ }
2468
+ _handleProgress(event) {
2469
+ const { buffered, seekable } = event.detail;
2470
+ const bufferedAmount = buffered.length === 0 ? 0 : buffered.end(buffered.length - 1);
2471
+ const seekableAmount = seekable.length === 0 ? 0 : seekable.end(seekable.length - 1);
2472
+ this._store.buffered.set(buffered);
2473
+ this._store.bufferedAmount.set(bufferedAmount);
2474
+ this._store.seekable.set(seekable);
2475
+ this._store.seekableAmount.set(seekableAmount);
2476
+ }
2477
+ _handleSrcChange(event) {
2478
+ this._store.src.set(event.detail);
2479
+ }
2480
+ _handleViewTypeChange(event) {
2481
+ this._store.viewType.set(event.detail);
2482
+ }
2483
+ };
2484
+ var MediaStyleController = class {
2485
+ constructor(_host, _store, _mediaProps) {
2486
+ this._host = _host;
2487
+ this._store = _store;
2488
+ this._mediaProps = _mediaProps;
2489
+ this._disposal = new DisposalBin();
2490
+ this._host.addController({
2491
+ hostConnected: this._hostConnected.bind(this),
2492
+ hostDisconnected: this._hostDisconnected.bind(this)
2493
+ });
2494
+ }
2495
+ _hostConnected() {
2496
+ requestIdleCallback(() => {
2497
+ for (const propName of this._mediaProps) {
2498
+ const store = this._store[propName];
2499
+ if (store) {
2500
+ const attrName = this._getMediaAttrName(propName);
2501
+ const unsub = store.subscribe(($v) => {
2502
+ window?.requestAnimationFrame(() => {
2503
+ this._handleValueChange(propName, attrName, $v);
2504
+ });
2505
+ });
2506
+ this._disposal.add(unsub);
2507
+ }
2508
+ }
2509
+ });
2510
+ }
2511
+ _hostDisconnected() {
2512
+ for (const propName of this._mediaProps) {
2513
+ this._handleDisconnect(propName, this._getMediaAttrName(propName));
2514
+ }
2515
+ this._disposal.empty();
2516
+ }
2517
+ _getMediaAttrName(propName) {
2518
+ return camelToKebabCase(propName);
2519
+ }
2520
+ };
2521
+
2522
+ // src/media/style/MediaAttrsController.ts
2523
+ var MediaAttrsController = class extends MediaStyleController {
2524
+ _handleValueChange(_, attrName, value) {
2525
+ window.requestAnimationFrame(() => {
2526
+ setAttribute(
2527
+ this._host,
2528
+ attrName,
2529
+ isString(value) || isNumber(value) ? String(value) : !!value
2530
+ );
2531
+ });
2532
+ }
2533
+ _handleDisconnect(_, attrName) {
2534
+ this._host.removeAttribute(attrName);
2535
+ }
2536
+ };
2537
+ function bindMediaPropsToAttrs(...params) {
2538
+ return new MediaAttrsController(...params);
2539
+ }
2540
+ var MediaCssPropsController = class extends MediaStyleController {
2541
+ _handleValueChange(_, attrName, value) {
2542
+ window.requestAnimationFrame(() => {
2543
+ this._host.style.setProperty(
2544
+ this._getCssPropName(attrName),
2545
+ isString(value) || isNumber(value) ? String(value) : null
2546
+ );
2547
+ });
2548
+ }
2549
+ _getCssPropName(attrName) {
2550
+ return `--vds-${attrName}`;
2551
+ }
2552
+ _handleDisconnect(_, attrName) {
2553
+ this._host.style.setProperty(this._getCssPropName(attrName), null);
2554
+ }
2555
+ };
2556
+ function bindMediaPropsToCssProps(...params) {
2557
+ return new MediaCssPropsController(...params);
2558
+ }
2559
+
2560
+ // src/media/MediaElement.ts
2561
+ var mediaDiscoveryId = Symbol("@vidstack/media-discovery");
2562
+ var MediaElement = class extends s {
2563
+ constructor() {
2564
+ super();
2565
+ this.controller = new MediaController(this);
2566
+ this.__mediaFullscreen = false;
2567
+ this.__mediaIsVideoView = false;
2568
+ this.__mediaPlaysinline = false;
2569
+ this.screenOrientationController = new ScreenOrientationController(this);
2570
+ this.fullscreenController = new FullscreenController(this, this.screenOrientationController);
2571
+ discoverable(this, "vds-media-connect", { register: mediaDiscoveryId });
2572
+ mediaStoreSubscription(this, "fullscreen", ($fullscreen) => {
2573
+ this.__mediaFullscreen = $fullscreen;
2574
+ });
2575
+ mediaStoreSubscription(this, "viewType", ($viewType) => {
2576
+ this.__mediaIsVideoView = $viewType === "video" /* Video */;
2577
+ });
2578
+ mediaStoreSubscription(this, "playsinline", ($playsinline) => {
2579
+ this.__mediaPlaysinline = $playsinline;
2580
+ });
2581
+ this._bindMediaAttributes();
2582
+ this._bindMediaCSSProperties();
2583
+ }
2584
+ static get styles() {
2585
+ return [
2586
+ i$1`:host{display:inline-block;position:relative;contain:content}:host([hidden]){display:none}`
2587
+ ];
2588
+ }
2589
+ get provider() {
2590
+ return this.controller.provider;
2591
+ }
2592
+ update(changedProperties) {
2593
+ setAttribute(this, "hide-ui", this._shouldHideMediaUI());
2594
+ super.update(changedProperties);
2595
+ }
2596
+ render() {
2597
+ return y`<slot></slot>`;
2598
+ }
2599
+ get canFullscreen() {
2600
+ return this.fullscreenController.isSupported;
2601
+ }
2602
+ get fullscreen() {
2603
+ return this.fullscreenController.isFullscreen;
2604
+ }
2605
+ get fullscreenOrientation() {
2606
+ return this.fullscreenController.screenOrientationLock;
2607
+ }
2608
+ set fullscreenOrientation(lockType) {
2609
+ const prevLockType = this.fullscreenController.screenOrientationLock;
2610
+ if (prevLockType !== lockType) {
2611
+ this.fullscreenController.screenOrientationLock = lockType;
2612
+ this.requestUpdate("fullscreen-orientation", prevLockType);
2613
+ }
2614
+ }
2615
+ enterFullscreen() {
2616
+ return this.fullscreenController.enterFullscreen();
2617
+ }
2618
+ exitFullscreen() {
2619
+ return this.fullscreenController.exitFullscreen();
2620
+ }
2621
+ _bindMediaAttributes() {
2622
+ bindMediaPropsToAttrs(this, this.controller.store, [
2623
+ "autoplay",
2624
+ "autoplayError",
2625
+ "canLoad",
2626
+ "canPlay",
2627
+ "canFullscreen",
2628
+ "ended",
2629
+ "error",
2630
+ "fullscreen",
2631
+ "userIdle",
2632
+ "loop",
2633
+ "mediaType",
2634
+ "muted",
2635
+ "paused",
2636
+ "playing",
2637
+ "playsinline",
2638
+ "seeking",
2639
+ "started",
2640
+ "viewType",
2641
+ "waiting"
2642
+ ]);
2643
+ }
2644
+ _bindMediaCSSProperties() {
2645
+ bindMediaPropsToCssProps(this, this.controller.store, [
2646
+ "bufferedAmount",
2647
+ "currentTime",
2648
+ "duration",
2649
+ "seekableAmount"
2650
+ ]);
2651
+ }
2652
+ _shouldHideMediaUI() {
2653
+ return IS_IOS && this.__mediaIsVideoView && (!this.__mediaPlaysinline || this.__mediaFullscreen);
2654
+ }
2655
+ };
2656
+ __decorateClass([
2657
+ t()
2658
+ ], MediaElement.prototype, "__mediaFullscreen", 2);
2659
+ __decorateClass([
2660
+ t()
2661
+ ], MediaElement.prototype, "__mediaIsVideoView", 2);
2662
+ __decorateClass([
2663
+ t()
2664
+ ], MediaElement.prototype, "__mediaPlaysinline", 2);
2665
+ __decorateClass([
2666
+ e({ attribute: "fullscreen-orientation" })
2667
+ ], MediaElement.prototype, "fullscreenOrientation", 1);
2668
+
2669
+ safelyDefineCustomElement("vds-media", MediaElement);
2670
+
2671
+ var AUDIO_EXTENSIONS = /\.(m4a|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i;
2672
+ var VIDEO_EXTENSIONS = /\.(mp4|og[gv]|webm|mov|m4v|avi)($|\?)/i;
2673
+ function getMediaTypeFromExt(src) {
2674
+ if (AUDIO_EXTENSIONS.test(src))
2675
+ return "audio" /* Audio */;
2676
+ if (VIDEO_EXTENSIONS.test(src))
2677
+ return "video" /* Video */;
2678
+ return "unknown" /* Unknown */;
2679
+ }
2680
+ var Html5MediaElement = class extends MediaProviderElement {
2681
+ constructor() {
2682
+ super(...arguments);
2683
+ this.preload = "metadata";
2684
+ this._timeRAF = void 0;
2685
+ this._hasMediaElementConnected = false;
2686
+ this._mediaElementDisposal = new DisposalBin();
2687
+ this._isMediaWaiting = false;
2688
+ this._ignoreNextAbortEvent = false;
2689
+ this._ignoreNextEmptiedEvent = false;
2690
+ }
2691
+ get mediaElement() {
2692
+ return this._mediaElement;
2693
+ }
2694
+ disconnectedCallback() {
2695
+ this._isMediaWaiting = false;
2696
+ super.disconnectedCallback();
2697
+ this._cancelTimeUpdates();
2698
+ }
2699
+ destroy() {
2700
+ if (this.mediaElement) {
2701
+ this.mediaElement.pause();
2702
+ this.mediaElement.src = "";
2703
+ this.mediaElement.innerHTML = "";
2704
+ this.mediaElement.load();
2705
+ }
2706
+ super.destroy();
2707
+ }
2708
+ _cancelTimeUpdates() {
2709
+ if (isNumber(this._timeRAF))
2710
+ window.cancelAnimationFrame(this._timeRAF);
2711
+ this._timeRAF = void 0;
2712
+ }
2713
+ _requestTimeUpdates() {
2714
+ if (!isUndefined(this._timeRAF))
2715
+ return;
2716
+ this._requestTimeUpdate();
2717
+ }
2718
+ _requestTimeUpdate() {
2719
+ const newTime = this.mediaElement?.currentTime ?? 0;
2720
+ if (this.state.currentTime !== newTime) {
2721
+ this._updateCurrentTime(newTime);
2722
+ }
2723
+ this._timeRAF = window.requestAnimationFrame(() => {
2724
+ if (isUndefined(this._timeRAF))
2725
+ return;
2726
+ this._requestTimeUpdate();
2727
+ });
2728
+ }
2729
+ _updateCurrentTime(newTime, triggerEvent) {
2730
+ this.dispatchEvent(
2731
+ vdsEvent("vds-time-update", {
2732
+ detail: {
2733
+ currentTime: Math.min(newTime, this.mediaElement?.duration ?? 0),
2734
+ played: this.mediaElement.played
2735
+ },
2736
+ triggerEvent
2737
+ })
2738
+ );
2739
+ }
2740
+ handleDefaultSlotChange() {
2741
+ this._handleMediaElementDisconnect();
2742
+ this._handleMediaElementConnect();
2743
+ }
2744
+ get _canMediaElementConnect() {
2745
+ return this.canLoad && !isNil(this.mediaElement) && !this._hasMediaElementConnected;
2746
+ }
2747
+ _findSlottedMediaElement() {
2748
+ const mediaElement = getSlottedChildren(this)[0];
2749
+ const tagName = mediaElement?.tagName ?? "";
2750
+ if (!/^(audio|video)$/i.test(tagName)) ;
2751
+ this._mediaElement = mediaElement ?? void 0;
2752
+ }
2753
+ _handleMediaElementConnect() {
2754
+ window.requestAnimationFrame(() => {
2755
+ this._findSlottedMediaElement();
2756
+ if (!this._canMediaElementConnect)
2757
+ return;
2758
+ const mediaEl = this.mediaElement;
2759
+ if (mediaEl.hasAttribute("loop")) {
2760
+ this.loop = true;
2761
+ }
2762
+ mediaEl.removeAttribute("loop");
2763
+ mediaEl.removeAttribute("poster");
2764
+ setAttribute(mediaEl, "controls", this.controls);
2765
+ if (!this.state.canFullscreen && this.fullscreenController.isSupported) {
2766
+ this.dispatchEvent(
2767
+ vdsEvent("vds-fullscreen-support-change", {
2768
+ detail: this.canFullscreen
2769
+ })
2770
+ );
2771
+ }
2772
+ this._attachMediaEventListeners();
2773
+ this._observePlaysinline();
2774
+ this._observeMediaSources();
2775
+ if (this.canLoadPoster && this.poster.length > 0 && mediaEl.getAttribute("poster") !== this.poster) {
2776
+ mediaEl.setAttribute("poster", this.poster);
2777
+ }
2778
+ this._startPreloadingMedia();
2779
+ this._hasMediaElementConnected = true;
2780
+ this._disconnectDisposal.add(this._handleMediaElementDisconnect.bind(this));
2781
+ });
2782
+ }
2783
+ _handleMediaElementDisconnect() {
2784
+ this._cancelTimeUpdates();
2785
+ window.requestAnimationFrame(() => {
2786
+ this._mediaElementDisposal.empty();
2787
+ this._mediaElement = void 0;
2788
+ });
2789
+ if (this._hasMediaElementConnected && false) {
2790
+ this._logger?.infoGroup("Media element disconnected").labelledLog("Media Element", this.mediaElement).dispatch();
2791
+ }
2792
+ this._hasMediaElementConnected = false;
2793
+ }
2794
+ startLoadingMedia() {
2795
+ super.startLoadingMedia();
2796
+ this._handleMediaElementConnect();
2797
+ }
2798
+ _startPreloadingMedia() {
2799
+ if (this.state.canPlay)
2800
+ return;
2801
+ this.mediaElement.setAttribute("preload", this.preload);
2802
+ const isNetworkActive = this.mediaElement.networkState >= 1;
2803
+ this._ignoreNextAbortEvent = isNetworkActive;
2804
+ this._ignoreNextEmptiedEvent = isNetworkActive;
2805
+ this.mediaElement.load();
2806
+ setTimeout(() => {
2807
+ this._ignoreNextAbortEvent = false;
2808
+ this._ignoreNextEmptiedEvent = false;
2809
+ }, 0);
2810
+ }
2811
+ _observePlaysinline() {
2812
+ const isPlayingInline = () => this.mediaElement.hasAttribute("playsinline");
2813
+ this._handlePlaysinlineChange(isPlayingInline());
2814
+ const observer = new MutationObserver(() => this._handlePlaysinlineChange(isPlayingInline()));
2815
+ observer.observe(this.mediaElement, { attributeFilter: ["playsinline"] });
2816
+ this._mediaElementDisposal.add(() => observer.disconnect());
2817
+ }
2818
+ _handlePlaysinlineChange(playsinline) {
2819
+ this.dispatchEvent(vdsEvent("vds-playsinline-change", { detail: playsinline }));
2820
+ }
2821
+ _observeMediaSources() {
2822
+ this._handleSrcChange(this._getMediaSources());
2823
+ const observer = new MutationObserver(() => this._handleSrcChange(this._getMediaSources()));
2824
+ observer.observe(this.mediaElement, { attributeFilter: ["src"], subtree: true });
2825
+ this._mediaElementDisposal.add(() => observer.disconnect());
2826
+ }
2827
+ _handleSrcChange(sources) {
2828
+ const prevSources = this.state.src;
2829
+ if (!isScalarArrayEqual(prevSources, sources)) {
2830
+ this.dispatchEvent(vdsEvent("vds-src-change", { detail: sources }));
2831
+ }
2832
+ }
2833
+ _getMediaSources() {
2834
+ const resources = [
2835
+ this.mediaElement?.src,
2836
+ ...Array.from(this.mediaElement?.querySelectorAll("source") ?? []).map(
2837
+ (source) => source.src
2838
+ )
2839
+ ].filter(Boolean);
2840
+ return Array.from(new Set(resources));
2841
+ }
2842
+ _getMediaMetadata() {
2843
+ return {
2844
+ src: this.state.src,
2845
+ currentSrc: this.mediaElement.currentSrc,
2846
+ duration: this.mediaElement.duration || 0,
2847
+ poster: this.mediaElement.poster,
2848
+ mediaType: this._getMediaType(),
2849
+ viewType: this.state.viewType
2850
+ };
2851
+ }
2852
+ _attachMediaEventListeners() {
2853
+ if (isNil(this.mediaElement))
2854
+ return;
2855
+ const mediaEventListeners = {
2856
+ abort: this._handleAbort,
2857
+ canplay: this._handleCanPlay,
2858
+ canplaythrough: this._handleCanPlayThrough,
2859
+ durationchange: this._handleDurationChange,
2860
+ emptied: this._handleEmptied,
2861
+ ended: this._handleEnded,
2862
+ error: this._handleError,
2863
+ loadeddata: this._handleLoadedData,
2864
+ loadedmetadata: this._handleLoadedMetadata,
2865
+ loadstart: this._handleLoadStart,
2866
+ pause: this._handlePause,
2867
+ play: this._handlePlay,
2868
+ playing: this._handlePlaying,
2869
+ progress: this._handleProgress,
2870
+ ratechange: this._handleRateChange,
2871
+ seeked: this._handleSeeked,
2872
+ seeking: this._handleSeeking,
2873
+ stalled: this._handleStalled,
2874
+ suspend: this._handleSuspend,
2875
+ volumechange: this._handleVolumeChange,
2876
+ waiting: this._handleWaiting
2877
+ };
2878
+ keysOf(mediaEventListeners).forEach((type) => {
2879
+ const handler = mediaEventListeners[type].bind(this);
2880
+ const off = listen(this.mediaElement, type, async (event) => {
2881
+ await handler(event);
2882
+ });
2883
+ this._mediaElementDisposal.add(off);
2884
+ });
2885
+ }
2886
+ _handleAbort(event) {
2887
+ if (this._ignoreNextAbortEvent)
2888
+ return;
2889
+ this.dispatchEvent(vdsEvent("vds-abort", { triggerEvent: event }));
2890
+ this._handleCurrentSrcChange("", event);
2891
+ }
2892
+ _handleCanPlay(event) {
2893
+ this._handleMediaReady({ event, duration: this.mediaElement.duration });
2894
+ }
2895
+ _handleCanPlayThrough(event) {
2896
+ if (this.state.started)
2897
+ return;
2898
+ this.dispatchEvent(
2899
+ vdsEvent("vds-can-play-through", {
2900
+ triggerEvent: event,
2901
+ detail: { duration: this.mediaElement.duration }
2902
+ })
2903
+ );
2904
+ }
2905
+ _handleLoadStart(event) {
2906
+ this._handleCurrentSrcChange(this.mediaElement.currentSrc, event);
2907
+ if (this.mediaElement.currentSrc === "") {
2908
+ this._handleAbort();
2909
+ return;
2910
+ }
2911
+ this.dispatchEvent(
2912
+ vdsEvent("vds-load-start", {
2913
+ triggerEvent: event,
2914
+ detail: this._getMediaMetadata()
2915
+ })
2916
+ );
2917
+ }
2918
+ _handleEmptied(event) {
2919
+ if (this._ignoreNextEmptiedEvent)
2920
+ return;
2921
+ this.dispatchEvent(vdsEvent("vds-emptied", { triggerEvent: event }));
2922
+ }
2923
+ _handleLoadedData(event) {
2924
+ this.dispatchEvent(vdsEvent("vds-loaded-data", { triggerEvent: event }));
2925
+ }
2926
+ _handleLoadedMetadata(event) {
2927
+ this.dispatchEvent(
2928
+ vdsEvent("vds-volume-change", {
2929
+ detail: {
2930
+ volume: this.mediaElement.volume,
2931
+ muted: this.mediaElement.muted
2932
+ }
2933
+ })
2934
+ );
2935
+ this.dispatchEvent(
2936
+ vdsEvent("vds-loaded-metadata", {
2937
+ triggerEvent: event,
2938
+ detail: this._getMediaMetadata()
2939
+ })
2940
+ );
2941
+ }
2942
+ _determineMediaType(event) {
2943
+ this.dispatchEvent(
2944
+ vdsEvent("vds-media-type-change", {
2945
+ detail: this._getMediaType(),
2946
+ triggerEvent: event
2947
+ })
2948
+ );
2949
+ }
2950
+ _handlePlay(event) {
2951
+ const playEvent = vdsEvent("vds-play", { triggerEvent: event });
2952
+ playEvent.autoplay = this._attemptingAutoplay;
2953
+ this.dispatchEvent(playEvent);
2954
+ }
2955
+ _handlePause(event) {
2956
+ if (this.mediaElement.readyState === 1 && !this._isMediaWaiting) {
2957
+ return;
2958
+ }
2959
+ this._isMediaWaiting = false;
2960
+ this._cancelTimeUpdates();
2961
+ this.dispatchEvent(vdsEvent("vds-pause", { triggerEvent: event }));
2962
+ }
2963
+ _handlePlaying(event) {
2964
+ this._isMediaWaiting = false;
2965
+ const playingEvent = vdsEvent("vds-playing", { triggerEvent: event });
2966
+ this.dispatchEvent(playingEvent);
2967
+ this._requestTimeUpdates();
2968
+ }
2969
+ _handleDurationChange(event) {
2970
+ if (this.mediaElement.ended) {
2971
+ this._updateCurrentTime(this.mediaElement.duration, event);
2972
+ }
2973
+ this.dispatchEvent(
2974
+ vdsEvent("vds-duration-change", {
2975
+ detail: this.mediaElement.duration,
2976
+ triggerEvent: event
2977
+ })
2978
+ );
2979
+ }
2980
+ _handleProgress(event) {
2981
+ this.dispatchEvent(
2982
+ vdsEvent("vds-progress", {
2983
+ triggerEvent: event,
2984
+ detail: {
2985
+ buffered: this.mediaElement.buffered,
2986
+ seekable: this.mediaElement.seekable
2987
+ }
2988
+ })
2989
+ );
2990
+ }
2991
+ _handleRateChange(event) {
2992
+ throw Error("Not implemented");
2993
+ }
2994
+ _handleSeeking(event) {
2995
+ this.dispatchEvent(
2996
+ vdsEvent("vds-seeking", {
2997
+ detail: this.mediaElement.currentTime,
2998
+ triggerEvent: event
2999
+ })
3000
+ );
3001
+ }
3002
+ _handleSeeked(event) {
3003
+ const seekedEvent = vdsEvent("vds-seeked", {
3004
+ detail: this.mediaElement.currentTime,
3005
+ triggerEvent: event
3006
+ });
3007
+ this.dispatchEvent(seekedEvent);
3008
+ const currentTime = this.mediaElement.currentTime;
3009
+ if (Math.trunc(currentTime) === Math.trunc(this.mediaElement.duration) && getNumberOfDecimalPlaces(this.mediaElement.duration) > getNumberOfDecimalPlaces(currentTime)) {
3010
+ this._updateCurrentTime(this.mediaElement.duration, event);
3011
+ if (!this.mediaElement.ended) {
3012
+ try {
3013
+ this.play();
3014
+ } catch (e) {
3015
+ }
3016
+ }
3017
+ }
3018
+ }
3019
+ _handleStalled(event) {
3020
+ this.dispatchEvent(vdsEvent("vds-stalled", { triggerEvent: event }));
3021
+ if (this.mediaElement.readyState < 3) {
3022
+ this._isMediaWaiting = true;
3023
+ this.dispatchEvent(vdsEvent("vds-waiting", { triggerEvent: event }));
3024
+ }
3025
+ }
3026
+ _handleVolumeChange(event) {
3027
+ this.dispatchEvent(
3028
+ vdsEvent("vds-volume-change", {
3029
+ detail: {
3030
+ volume: this.mediaElement.volume,
3031
+ muted: this.mediaElement.muted
3032
+ },
3033
+ triggerEvent: event
3034
+ })
3035
+ );
3036
+ }
3037
+ _handleWaiting(event) {
3038
+ if (this.mediaElement.readyState < 3) {
3039
+ this._isMediaWaiting = true;
3040
+ this.dispatchEvent(vdsEvent("vds-waiting", { triggerEvent: event }));
3041
+ }
3042
+ }
3043
+ _handleSuspend(event) {
3044
+ const suspendEvent = vdsEvent("vds-suspend", { triggerEvent: event });
3045
+ this.dispatchEvent(suspendEvent);
3046
+ }
3047
+ _handleEnded(event) {
3048
+ this._cancelTimeUpdates();
3049
+ this._updateCurrentTime(this.mediaElement.duration, event);
3050
+ const endEvent = vdsEvent("vds-end", { triggerEvent: event });
3051
+ this.dispatchEvent(endEvent);
3052
+ if (this.state.loop) {
3053
+ this._handleLoop();
3054
+ } else {
3055
+ this.dispatchEvent(vdsEvent("vds-ended", { triggerEvent: event }));
3056
+ }
3057
+ }
3058
+ _handleLoop() {
3059
+ const hasCustomControls = isNil(this.controls);
3060
+ if (hasCustomControls) {
3061
+ this.mediaElement.controls = false;
3062
+ }
3063
+ this.dispatchEvent(vdsEvent("vds-loop-request"));
3064
+ }
3065
+ _handleError(event) {
3066
+ const mediaError = this.mediaElement.error;
3067
+ if (!mediaError)
3068
+ return;
3069
+ this.dispatchEvent(
3070
+ vdsEvent("vds-error", {
3071
+ detail: {
3072
+ message: mediaError.message,
3073
+ code: mediaError.code,
3074
+ mediaError
3075
+ },
3076
+ triggerEvent: event
3077
+ })
3078
+ );
3079
+ }
3080
+ _getPaused() {
3081
+ return this.mediaElement?.paused ?? true;
3082
+ }
3083
+ _getVolume() {
3084
+ return this.mediaElement?.volume ?? 1;
3085
+ }
3086
+ _setVolume(newVolume) {
3087
+ this.mediaElement.volume = newVolume;
3088
+ }
3089
+ _getCurrentTime() {
3090
+ return this.mediaElement?.currentTime ?? 0;
3091
+ }
3092
+ _setCurrentTime(newTime) {
3093
+ if (this.mediaElement.currentTime !== newTime) {
3094
+ this.mediaElement.currentTime = newTime;
3095
+ }
3096
+ }
3097
+ _getMuted() {
3098
+ return this.mediaElement?.muted ?? false;
3099
+ }
3100
+ _setMuted(isMuted) {
3101
+ this.mediaElement.muted = isMuted;
3102
+ }
3103
+ async play() {
3104
+ try {
3105
+ this._throwIfNotReadyForPlayback();
3106
+ await this._resetPlaybackIfEnded();
3107
+ return this.mediaElement?.play();
3108
+ } catch (error) {
3109
+ const playErrorEvent = vdsEvent("vds-play-fail");
3110
+ playErrorEvent.autoplay = this._attemptingAutoplay;
3111
+ playErrorEvent.error = error;
3112
+ throw error;
3113
+ }
3114
+ }
3115
+ async pause() {
3116
+ return this.mediaElement?.pause();
3117
+ }
3118
+ _getMediaType() {
3119
+ return getMediaTypeFromExt(this.state.currentSrc);
3120
+ }
3121
+ };
3122
+ __decorateClass([
3123
+ e()
3124
+ ], Html5MediaElement.prototype, "preload", 2);
3125
+
3126
+ var AudioElement = class extends Html5MediaElement {
3127
+ static get styles() {
3128
+ return [
3129
+ i$1`:host{display:inline-block}:host([hidden]){display:none}`
3130
+ ];
3131
+ }
3132
+ connectedCallback() {
3133
+ super.connectedCallback();
3134
+ this.dispatchEvent(
3135
+ vdsEvent("vds-view-type-change", {
3136
+ detail: "audio" /* Audio */
3137
+ })
3138
+ );
3139
+ }
3140
+ };
3141
+
3142
+ safelyDefineCustomElement("vds-audio", AudioElement);
3143
+
3144
+ var toggleButtonElementStyles = i$1`:host{display:table;contain:content;user-select:none;cursor:pointer;-webkit-user-select:none;-webkit-tap-highlight-color:transparent}:host([hidden]){display:none}:host(:focus){outline:0}:host(:focus-visible){outline:1px auto Highlight;outline:1px auto -webkit-focus-ring-color}:host(.focus-visible){outline:1px auto Highlight;outline:1px auto -webkit-focus-ring-color}`;
3145
+
3146
+ // src/ui/toggle-button/ToggleButtonElement.ts
3147
+ var ToggleButtonElement = class extends s {
3148
+ constructor() {
3149
+ super();
3150
+ this.pressed = false;
3151
+ this.disabled = false;
3152
+ this._handleButtonClickCapture = eventListener(
3153
+ this,
3154
+ "click",
3155
+ (event) => {
3156
+ if (this.disabled) {
3157
+ event.preventDefault();
3158
+ event.stopImmediatePropagation();
3159
+ }
3160
+ },
3161
+ { capture: true }
3162
+ );
3163
+ focusVisiblePolyfill(this);
3164
+ ["pointerup", "keydown"].forEach((eventType) => {
3165
+ eventListener(this, eventType, (event) => {
3166
+ if (this.disabled || isKeyboardEvent(event) && !isKeyboardClick(event)) {
3167
+ return;
3168
+ }
3169
+ this._handleButtonClick(event);
3170
+ });
3171
+ });
3172
+ }
3173
+ static get styles() {
3174
+ return [toggleButtonElementStyles];
3175
+ }
3176
+ static get parts() {
3177
+ return [];
3178
+ }
3179
+ connectedCallback() {
3180
+ super.connectedCallback();
3181
+ setAttributeIfEmpty(this, "tabindex", "0");
3182
+ setAttributeIfEmpty(this, "role", "button");
3183
+ this._updateAriaPressedAttr();
3184
+ }
3185
+ updated(changedProperties) {
3186
+ if (changedProperties.has("pressed")) {
3187
+ this._updateAriaPressedAttr();
3188
+ }
3189
+ }
3190
+ _updateAriaPressedAttr() {
3191
+ setAttribute(this, "aria-pressed", this.pressed ? "true" : "false");
3192
+ }
3193
+ render() {
3194
+ return this._renderDefaultSlot();
3195
+ }
3196
+ _renderDefaultSlot() {
3197
+ return y`<slot></slot>`;
3198
+ }
3199
+ _handleButtonClick(event) {
3200
+ this.pressed = !this.pressed;
3201
+ }
3202
+ };
3203
+ __decorateClass([
3204
+ e({ type: Boolean })
3205
+ ], ToggleButtonElement.prototype, "pressed", 2);
3206
+ __decorateClass([
3207
+ e({ type: Boolean, reflect: true })
3208
+ ], ToggleButtonElement.prototype, "disabled", 2);
3209
+
3210
+ // src/media/interact/MediaRemoteControl.ts
3211
+ var MediaRemoteControl = class {
3212
+ constructor(_host) {
3213
+ if (_host) {
3214
+ this._target = _host;
3215
+ this._createLogger(_host);
3216
+ this._requests = hostRequestQueue(_host);
3217
+ } else {
3218
+ this._requests = new RequestQueue();
3219
+ }
3220
+ }
3221
+ startLoading(triggerEvent) {
3222
+ this._dispatchRequest("vds-start-loading", { triggerEvent });
3223
+ }
3224
+ play(triggerEvent) {
3225
+ this._dispatchRequest("vds-play-request", { triggerEvent });
3226
+ }
3227
+ pause(triggerEvent) {
3228
+ this._dispatchRequest("vds-pause-request", { triggerEvent });
3229
+ }
3230
+ mute(triggerEvent) {
3231
+ this._dispatchRequest("vds-mute-request", { triggerEvent });
3232
+ }
3233
+ unmute(triggerEvent) {
3234
+ this._dispatchRequest("vds-unmute-request", { triggerEvent });
3235
+ }
3236
+ enterFullscreen(target, triggerEvent) {
3237
+ this._dispatchRequest("vds-enter-fullscreen-request", {
3238
+ triggerEvent,
3239
+ detail: target
3240
+ });
3241
+ }
3242
+ exitFullscreen(target, triggerEvent) {
3243
+ this._dispatchRequest("vds-exit-fullscreen-request", {
3244
+ triggerEvent,
3245
+ detail: target
3246
+ });
3247
+ }
3248
+ seeking(time, triggerEvent) {
3249
+ this._dispatchRequest("vds-seeking-request", {
3250
+ detail: time,
3251
+ triggerEvent
3252
+ });
3253
+ }
3254
+ seek(time, triggerEvent) {
3255
+ this._dispatchRequest("vds-seek-request", {
3256
+ detail: time,
3257
+ triggerEvent
3258
+ });
3259
+ }
3260
+ changeVolume(volume, triggerEvent) {
3261
+ this._dispatchRequest("vds-volume-change-request", {
3262
+ detail: volume,
3263
+ triggerEvent
3264
+ });
3265
+ }
3266
+ resumeUserIdle(triggerEvent) {
3267
+ this._dispatchRequest("vds-resume-user-idle-request", { triggerEvent });
3268
+ }
3269
+ pauseUserIdle(triggerEvent) {
3270
+ this._dispatchRequest("vds-pause-user-idle-request", { triggerEvent });
3271
+ }
3272
+ showPoster(triggerEvent) {
3273
+ this._dispatchRequest("vds-show-poster-request", { triggerEvent });
3274
+ }
3275
+ hidePoster(triggerEvent) {
3276
+ this._dispatchRequest("vds-hide-poster-request", { triggerEvent });
3277
+ }
3278
+ setTarget(target) {
3279
+ if (this._target === target)
3280
+ return;
3281
+ this._target = target;
3282
+ if (target) {
3283
+ this._createLogger(target);
3284
+ this._requests.start();
3285
+ } else {
3286
+ this._requests.stop();
3287
+ }
3288
+ }
3289
+ _dispatchRequest(type, eventInit) {
3290
+ this._requests.queue(type, () => {
3291
+ const request = vdsEvent(type, {
3292
+ ...eventInit,
3293
+ bubbles: true,
3294
+ composed: true
3295
+ });
3296
+ this._target?.dispatchEvent(request);
3297
+ });
3298
+ }
3299
+ _createLogger(target) {
3300
+ }
3301
+ };
3302
+
3303
+ var PlayButtonElement = class extends ToggleButtonElement {
3304
+ constructor() {
3305
+ super();
3306
+ this._mediaRemote = new MediaRemoteControl(this);
3307
+ mediaStoreSubscription(this, "paused", ($paused) => {
3308
+ this.pressed = !$paused;
3309
+ setAttribute(this, "paused", $paused);
3310
+ });
3311
+ }
3312
+ connectedCallback() {
3313
+ super.connectedCallback();
3314
+ setAttributeIfEmpty(this, "aria-label", "Play");
3315
+ }
3316
+ _handleButtonClick(event) {
3317
+ if (this.disabled)
3318
+ return;
3319
+ if (this.pressed) {
3320
+ this._mediaRemote.pause(event);
3321
+ } else {
3322
+ this._mediaRemote.play(event);
3323
+ }
3324
+ }
3325
+ };
3326
+
3327
+ safelyDefineCustomElement("vds-play-button", PlayButtonElement);
3328
+
3329
+ var MuteButtonElement = class extends ToggleButtonElement {
3330
+ constructor() {
3331
+ super();
3332
+ this._mediaRemote = new MediaRemoteControl(this);
3333
+ this._volume = 1;
3334
+ this._muted = false;
3335
+ mediaStoreSubscription(this, "volume", ($volume) => {
3336
+ this._volume = $volume;
3337
+ this._handleMutedChange();
3338
+ });
3339
+ mediaStoreSubscription(this, "muted", ($muted) => {
3340
+ this._muted = $muted;
3341
+ this._handleMutedChange();
3342
+ });
3343
+ }
3344
+ connectedCallback() {
3345
+ super.connectedCallback();
3346
+ setAttributeIfEmpty(this, "aria-label", "Mute");
3347
+ }
3348
+ _handleMutedChange() {
3349
+ const muted = this._muted || this._volume === 0;
3350
+ this.pressed = muted;
3351
+ setAttribute(this, "muted", muted);
3352
+ }
3353
+ _handleButtonClick(event) {
3354
+ if (this.disabled)
3355
+ return;
3356
+ if (this.pressed) {
3357
+ this._mediaRemote.unmute(event);
3358
+ } else {
3359
+ this._mediaRemote.mute(event);
3360
+ }
3361
+ }
3362
+ };
3363
+
3364
+ safelyDefineCustomElement("vds-mute-button", MuteButtonElement);
3365
+
3366
+ // src/ui/slider/store.ts
3367
+ function createSliderStore() {
3368
+ const dragging = writable(false);
3369
+ const pointing = writable(false);
3370
+ return {
3371
+ value: writable(50),
3372
+ pointerValue: writable(0),
3373
+ min: writable(0),
3374
+ max: writable(100),
3375
+ dragging,
3376
+ pointing,
3377
+ interactive: derived([dragging, pointing], ([$dragging, $pointing]) => $dragging || $pointing)
3378
+ };
3379
+ }
3380
+ var sliderStoreContext = createContext(createSliderStore);
3381
+
3382
+ var sliderElementStyles = i$1`*{box-sizing:border-box;touch-action:none}:host{display:block;contain:layout;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent}:host([hidden]){display:none}:host(:focus){outline:0}:host(:focus-visible){outline:1px auto Highlight;outline:1px auto -webkit-focus-ring-color}:host(.focus-visible){outline:1px auto Highlight;outline:1px auto -webkit-focus-ring-color}`;
3383
+
3384
+ // src/ui/slider/SliderElement.ts
3385
+ var SliderKeyDirection = /* @__PURE__ */ ((SliderKeyDirection2) => {
3386
+ SliderKeyDirection2[SliderKeyDirection2["Left"] = -1] = "Left";
3387
+ SliderKeyDirection2[SliderKeyDirection2["ArrowLeft"] = -1] = "ArrowLeft";
3388
+ SliderKeyDirection2[SliderKeyDirection2["Up"] = -1] = "Up";
3389
+ SliderKeyDirection2[SliderKeyDirection2["ArrowUp"] = -1] = "ArrowUp";
3390
+ SliderKeyDirection2[SliderKeyDirection2["Right"] = 1] = "Right";
3391
+ SliderKeyDirection2[SliderKeyDirection2["ArrowRight"] = 1] = "ArrowRight";
3392
+ SliderKeyDirection2[SliderKeyDirection2["Down"] = 1] = "Down";
3393
+ SliderKeyDirection2[SliderKeyDirection2["ArrowDown"] = 1] = "ArrowDown";
3394
+ return SliderKeyDirection2;
3395
+ })(SliderKeyDirection || {});
3396
+ var SliderElement = class extends s {
3397
+ constructor() {
3398
+ super();
3399
+ this._sliderStoreProvider = sliderStoreContext.provide(this);
3400
+ this.disabled = false;
3401
+ this.value = 50;
3402
+ this._step = 1;
3403
+ this._keyboardStep = 1;
3404
+ this.shiftKeyMultiplier = 5;
3405
+ this.customValueText = false;
3406
+ this._mediaRemote = new MediaRemoteControl(this);
3407
+ this._disconnectDisposal = new DisposalBin();
3408
+ this._handlePointerEnter = eventListener(this, "pointerenter", () => {
3409
+ if (this.disabled)
3410
+ return;
3411
+ this.setAttribute("pointing", "");
3412
+ this.store.pointing.set(true);
3413
+ });
3414
+ this._handlePointerMove = eventListener(this, "pointermove", (event) => {
3415
+ if (this.disabled || this.isDragging)
3416
+ return;
3417
+ const value = this._getValueBasedOnThumbPosition(event);
3418
+ this.store.pointerValue.set(value);
3419
+ this._dispatchPointerValueChange(event);
3420
+ });
3421
+ this._handlePointerLeave = eventListener(this, "pointerleave", () => {
3422
+ if (this.disabled)
3423
+ return;
3424
+ this.removeAttribute("pointing");
3425
+ this.store.pointing.set(false);
3426
+ });
3427
+ this._handlePointerDown = eventListener(this, "pointerdown", (event) => {
3428
+ if (this.disabled)
3429
+ return;
3430
+ this._startDragging(event);
3431
+ this._onDrag(event);
3432
+ });
3433
+ this._handleKeydown = eventListener(this, "keydown", (event) => {
3434
+ if (this.disabled)
3435
+ return;
3436
+ const { key, shiftKey } = event;
3437
+ const isValidKey = Object.keys(SliderKeyDirection).includes(key);
3438
+ if (!isValidKey)
3439
+ return;
3440
+ const modifiedStep = !shiftKey ? this.keyboardStep : this.keyboardStep * this.shiftKeyMultiplier;
3441
+ const direction = Number(SliderKeyDirection[key]);
3442
+ const diff = modifiedStep * direction;
3443
+ const steps = (this.value + diff) / this.step;
3444
+ const value = this.step * steps;
3445
+ this.value = this._getClampedValue(value);
3446
+ this._dispatchValueChange(event);
3447
+ });
3448
+ this._handleFillValueChange = eventListener(
3449
+ this,
3450
+ "vds-slider-value-change",
3451
+ this._updateFillCSSProps.bind(this)
3452
+ );
3453
+ this._handlePointerValueChange = eventListener(
3454
+ this,
3455
+ "vds-slider-pointer-value-change",
3456
+ this._updatePointerCSSProps.bind(this)
3457
+ );
3458
+ this._onDrag = rafThrottle((event) => {
3459
+ if (this.disabled || !this.isDragging)
3460
+ return;
3461
+ const value = this._getValueBasedOnThumbPosition(event);
3462
+ this.store.pointerValue.set(value);
3463
+ this._dispatchPointerValueChange(event);
3464
+ });
3465
+ this._handleDocumentPointerUp = eventListener(
3466
+ this,
3467
+ "pointerup",
3468
+ (event) => {
3469
+ if (this.disabled || !this.isDragging)
3470
+ return;
3471
+ this._stopDragging(event);
3472
+ },
3473
+ { target: document }
3474
+ );
3475
+ this._handleDocumentTouchMove = eventListener(
3476
+ this,
3477
+ "touchmove",
3478
+ (event) => {
3479
+ if (this.disabled || !this.isDragging)
3480
+ return;
3481
+ event.preventDefault();
3482
+ },
3483
+ { target: document, passive: false }
3484
+ );
3485
+ this._handleDocumentPointerMove = eventListener(
3486
+ this,
3487
+ "pointermove",
3488
+ (event) => {
3489
+ if (this.disabled || !this.isDragging)
3490
+ return;
3491
+ this._onDrag(event);
3492
+ },
3493
+ { target: document }
3494
+ );
3495
+ this._lastDispatchedValue = this.value;
3496
+ this._dispatchValueChange = rafThrottle((event) => {
3497
+ if (this.value === this._lastDispatchedValue)
3498
+ return;
3499
+ this.dispatchEvent(
3500
+ vdsEvent("vds-slider-value-change", {
3501
+ detail: this.value,
3502
+ triggerEvent: event
3503
+ })
3504
+ );
3505
+ this._lastDispatchedValue = this.value;
3506
+ });
3507
+ this._lastDispatchedPointerValue = this.pointerValue;
3508
+ this._dispatchPointerValueChange = rafThrottle((event) => {
3509
+ if (this.pointerValue === this._lastDispatchedPointerValue)
3510
+ return;
3511
+ const events = [
3512
+ "vds-slider-pointer-value-change",
3513
+ this.isDragging && "vds-slider-drag-value-change"
3514
+ ];
3515
+ events.forEach((eventType) => {
3516
+ if (eventType) {
3517
+ this.dispatchEvent(
3518
+ vdsEvent(eventType, {
3519
+ detail: this.pointerValue,
3520
+ triggerEvent: event
3521
+ })
3522
+ );
3523
+ }
3524
+ });
3525
+ this._lastDispatchedPointerValue = this.pointerValue;
3526
+ });
3527
+ focusVisiblePolyfill(this);
3528
+ }
3529
+ static get styles() {
3530
+ return [sliderElementStyles];
3531
+ }
3532
+ static get parts() {
3533
+ return [];
3534
+ }
3535
+ get store() {
3536
+ return this._sliderStoreProvider.value;
3537
+ }
3538
+ get min() {
3539
+ return getStoreValue(this.store.min);
3540
+ }
3541
+ set min(newMin) {
3542
+ this.store.min.set(newMin);
3543
+ }
3544
+ get max() {
3545
+ return getStoreValue(this.store.max);
3546
+ }
3547
+ set max(newMax) {
3548
+ this.store.max.set(newMax);
3549
+ }
3550
+ get step() {
3551
+ return this._step;
3552
+ }
3553
+ set step(newStep) {
3554
+ this._step = newStep;
3555
+ }
3556
+ get keyboardStep() {
3557
+ return this._keyboardStep;
3558
+ }
3559
+ set keyboardStep(newStep) {
3560
+ this._keyboardStep = newStep;
3561
+ }
3562
+ get isDragging() {
3563
+ return getStoreValue(this.store.dragging);
3564
+ }
3565
+ get fillRate() {
3566
+ const range = this.max - this.min, offset = this.value - this.min;
3567
+ return range > 0 ? offset / range : 0;
3568
+ }
3569
+ get fillPercent() {
3570
+ return this.fillRate * 100;
3571
+ }
3572
+ get pointerValue() {
3573
+ return getStoreValue(this.store.pointerValue);
3574
+ }
3575
+ get pointerRate() {
3576
+ const range = this.max - this.min, offset = this.pointerValue - this.min;
3577
+ return range > 0 ? offset / range : 0;
3578
+ }
3579
+ get pointerPercent() {
3580
+ return this.pointerRate * 100;
3581
+ }
3582
+ connectedCallback() {
3583
+ super.connectedCallback();
3584
+ this._setupAriaAttrs();
3585
+ this._updateFillCSSProps();
3586
+ this._updatePointerCSSProps();
3587
+ this._disconnectDisposal.add(
3588
+ this.store.interactive.subscribe(($interactive) => {
3589
+ setAttribute(this, "interactive", $interactive);
3590
+ })
3591
+ );
3592
+ }
3593
+ willUpdate(changedProperties) {
3594
+ if (changedProperties.has("value") || changedProperties.has("min") || changedProperties.has("max")) {
3595
+ this.value = this._getClampedValue(this.value);
3596
+ this.store.value.set(this.value);
3597
+ this._updateFillCSSProps();
3598
+ this._dispatchValueChange();
3599
+ }
3600
+ if (changedProperties.has("disabled") && this.disabled) {
3601
+ this.store.dragging.set(false);
3602
+ this.store.pointing.set(false);
3603
+ this.removeAttribute("dragging");
3604
+ this.removeAttribute("pointing");
3605
+ this.removeAttribute("interactive");
3606
+ setAttribute(this, "aria-disabled", this.disabled);
3607
+ }
3608
+ if (!this.customValueText) {
3609
+ this._updateAriaValueAttrs();
3610
+ }
3611
+ super.willUpdate(changedProperties);
3612
+ }
3613
+ disconnectedCallback() {
3614
+ this._onDrag.cancel();
3615
+ this._disconnectDisposal.empty();
3616
+ super.disconnectedCallback();
3617
+ }
3618
+ _updateFillCSSProps() {
3619
+ setCSSProperty(this, "fill-value", `${this.value}`);
3620
+ setCSSProperty(this, "fill-rate", `${this.fillRate}`);
3621
+ setCSSProperty(this, "fill-percent", `${this.fillPercent}%`);
3622
+ }
3623
+ _updatePointerCSSProps() {
3624
+ setCSSProperty(this, "pointer-value", `${this.pointerValue}`);
3625
+ setCSSProperty(this, "pointer-rate", `${this.pointerRate}`);
3626
+ setCSSProperty(this, "pointer-percent", `${this.pointerPercent}%`);
3627
+ }
3628
+ render() {
3629
+ return this._renderSlider();
3630
+ }
3631
+ _renderSlider() {
3632
+ return y`${this._renderDefaultSlot()}`;
3633
+ }
3634
+ _renderDefaultSlot() {
3635
+ return y`<slot></slot>`;
3636
+ }
3637
+ _setupAriaAttrs() {
3638
+ setAttributeIfEmpty(this, "role", "slider");
3639
+ setAttributeIfEmpty(this, "tabindex", "0");
3640
+ setAttributeIfEmpty(this, "aria-orientation", "horizontal");
3641
+ setAttributeIfEmpty(this, "autocomplete", "off");
3642
+ }
3643
+ _updateAriaValueAttrs() {
3644
+ this.setAttribute("aria-valuemin", this._getValueMin());
3645
+ this.setAttribute("aria-valuenow", this._getValueNow());
3646
+ this.setAttribute("aria-valuemax", this._getValueMax());
3647
+ this.setAttribute("aria-valuetext", this._getValueText());
3648
+ }
3649
+ _getValueMin() {
3650
+ return String(this.min);
3651
+ }
3652
+ _getValueNow() {
3653
+ return String(this.value);
3654
+ }
3655
+ _getValueMax() {
3656
+ return String(this.max);
3657
+ }
3658
+ _getValueText() {
3659
+ return `${round(this.value / this.max * 100, 2)}%`;
3660
+ }
3661
+ _startDragging(event) {
3662
+ if (this.isDragging)
3663
+ return;
3664
+ this.store.dragging.set(true);
3665
+ this.setAttribute("dragging", "");
3666
+ const value = this._getValueBasedOnThumbPosition(event);
3667
+ this.store.pointerValue.set(value);
3668
+ this._dispatchPointerValueChange(event);
3669
+ this.dispatchEvent(
3670
+ vdsEvent("vds-slider-drag-start", {
3671
+ triggerEvent: event,
3672
+ detail: this.value
3673
+ })
3674
+ );
3675
+ this._mediaRemote.pauseUserIdle(event);
3676
+ }
3677
+ _stopDragging(event) {
3678
+ if (!this.isDragging)
3679
+ return;
3680
+ this.store.dragging.set(false);
3681
+ this._dispatchValueChange.cancel();
3682
+ this.removeAttribute("dragging");
3683
+ const value = this._getValueBasedOnThumbPosition(event);
3684
+ this.value = value;
3685
+ this.store.pointerValue.set(value);
3686
+ this._dispatchValueChange(event);
3687
+ this._dispatchPointerValueChange(event);
3688
+ this.dispatchEvent(
3689
+ vdsEvent("vds-slider-drag-end", {
3690
+ triggerEvent: event,
3691
+ detail: this.value
3692
+ })
3693
+ );
3694
+ this._mediaRemote.resumeUserIdle(event);
3695
+ }
3696
+ _getClampedValue(value) {
3697
+ return clampNumber(this.min, round(value, getNumberOfDecimalPlaces(this.step)), this.max);
3698
+ }
3699
+ _getValueFromRate(rate) {
3700
+ const boundRate = clampNumber(0, rate, 1);
3701
+ const range = this.max - this.min;
3702
+ const fill = range * boundRate;
3703
+ const stepRatio = Math.round(fill / this.step);
3704
+ const steps = this.step * stepRatio;
3705
+ return this.min + steps;
3706
+ }
3707
+ _getValueBasedOnThumbPosition(event) {
3708
+ const thumbClientX = event.clientX;
3709
+ const { left: trackLeft, width: trackWidth } = this.getBoundingClientRect();
3710
+ const thumbPositionRate = (thumbClientX - trackLeft) / trackWidth;
3711
+ return this._getValueFromRate(thumbPositionRate);
3712
+ }
3713
+ };
3714
+ __decorateClass([
3715
+ e({ type: Number })
3716
+ ], SliderElement.prototype, "min", 1);
3717
+ __decorateClass([
3718
+ e({ type: Number })
3719
+ ], SliderElement.prototype, "max", 1);
3720
+ __decorateClass([
3721
+ e({ reflect: true, type: Boolean })
3722
+ ], SliderElement.prototype, "disabled", 2);
3723
+ __decorateClass([
3724
+ e({ type: Number })
3725
+ ], SliderElement.prototype, "value", 2);
3726
+ __decorateClass([
3727
+ e({ type: Number })
3728
+ ], SliderElement.prototype, "step", 1);
3729
+ __decorateClass([
3730
+ e({ attribute: "keyboard-step", type: Number })
3731
+ ], SliderElement.prototype, "keyboardStep", 1);
3732
+ __decorateClass([
3733
+ e({ attribute: "shift-key-multiplier", type: Number })
3734
+ ], SliderElement.prototype, "shiftKeyMultiplier", 2);
3735
+ __decorateClass([
3736
+ e({ type: Boolean, attribute: "custom-value-text" })
3737
+ ], SliderElement.prototype, "customValueText", 2);
3738
+
3739
+ var timeSliderElementStyles = i$1``;
3740
+
3741
+ // src/ui/time-slider/TimeSliderElement.ts
3742
+ var TimeSliderElement = class extends SliderElement {
3743
+ constructor() {
3744
+ super();
3745
+ this._step = 0.1;
3746
+ this.value = 0;
3747
+ this.valueText = "{currentTime} out of {duration}";
3748
+ this.pauseWhileDragging = false;
3749
+ this.seekingRequestThrottle = 100;
3750
+ this.__mediaDuration = 0;
3751
+ this.__mediaPaused = true;
3752
+ this._handleSliderDragStart = eventListener(
3753
+ this,
3754
+ "vds-slider-drag-start",
3755
+ (event) => {
3756
+ this._togglePlaybackWhileDragging(event);
3757
+ }
3758
+ );
3759
+ this._handleSliderValueChange = eventListener(
3760
+ this,
3761
+ "vds-slider-value-change",
3762
+ (event) => {
3763
+ if (isKeyboardEvent(event.originEvent)) {
3764
+ this._dispatchSeekingRequest.cancel();
3765
+ this._mediaRemote.seek(this.value, event);
3766
+ }
3767
+ }
3768
+ );
3769
+ this._handleSliderDragValueChange = eventListener(
3770
+ this,
3771
+ "vds-slider-drag-value-change",
3772
+ (event) => {
3773
+ this._dispatchSeekingRequest(event);
3774
+ }
3775
+ );
3776
+ this._handleSliderDragEnd = eventListener(this, "vds-slider-drag-end", (event) => {
3777
+ this._dispatchSeekingRequest.cancel();
3778
+ this._mediaRemote.seek(this.value, event);
3779
+ this._togglePlaybackWhileDragging(event);
3780
+ });
3781
+ this._dispatchSeekingRequest = functionThrottle((event) => {
3782
+ this._mediaRemote.seeking(this.value, event);
3783
+ }, this.seekingRequestThrottle);
3784
+ this._wasPlayingBeforeDragStart = false;
3785
+ mediaStoreSubscription(this, "currentTime", ($currentTime) => {
3786
+ this.value = $currentTime;
3787
+ });
3788
+ mediaStoreSubscription(this, "duration", ($duration) => {
3789
+ this.__mediaDuration = $duration;
3790
+ this.requestUpdate("max");
3791
+ });
3792
+ mediaStoreSubscription(this, "paused", ($paused) => {
3793
+ this.__mediaPaused = $paused;
3794
+ });
3795
+ }
3796
+ static get styles() {
3797
+ return [super.styles, timeSliderElementStyles];
3798
+ }
3799
+ connectedCallback() {
3800
+ super.connectedCallback();
3801
+ setAttributeIfEmpty(this, "aria-label", "Media time");
3802
+ }
3803
+ get min() {
3804
+ return 0;
3805
+ }
3806
+ set min(_) {
3807
+ }
3808
+ get max() {
3809
+ return this.__mediaDuration;
3810
+ }
3811
+ set max(_) {
3812
+ }
3813
+ update(changedProperties) {
3814
+ if (changedProperties.has("disabled") && this.disabled) {
3815
+ this._dispatchSeekingRequest.cancel();
3816
+ }
3817
+ super.update(changedProperties);
3818
+ }
3819
+ disconnectedCallback() {
3820
+ this._dispatchSeekingRequest.cancel();
3821
+ super.disconnectedCallback();
3822
+ }
3823
+ _getValueMin() {
3824
+ return "0%";
3825
+ }
3826
+ _getValueNow() {
3827
+ return `${Math.round(this.fillPercent)}%`;
3828
+ }
3829
+ _getValueText() {
3830
+ return this.valueText.replace("{currentTime}", formatSpokenTime(this.value)).replace("{duration}", formatSpokenTime(this.__mediaDuration));
3831
+ }
3832
+ _getValueMax() {
3833
+ return "100%";
3834
+ }
3835
+ _togglePlaybackWhileDragging(event) {
3836
+ if (!this.pauseWhileDragging)
3837
+ return;
3838
+ if (this.isDragging && !this.__mediaPaused) {
3839
+ this._wasPlayingBeforeDragStart = true;
3840
+ this._mediaRemote.pause(event);
3841
+ } else if (this._wasPlayingBeforeDragStart && !this.isDragging && this.__mediaPaused) {
3842
+ this._wasPlayingBeforeDragStart = false;
3843
+ this._mediaRemote.play(event);
3844
+ }
3845
+ }
3846
+ };
3847
+ __decorateClass([
3848
+ e({ attribute: false, state: true })
3849
+ ], TimeSliderElement.prototype, "value", 2);
3850
+ __decorateClass([
3851
+ e({ attribute: false })
3852
+ ], TimeSliderElement.prototype, "min", 1);
3853
+ __decorateClass([
3854
+ e({ attribute: false })
3855
+ ], TimeSliderElement.prototype, "max", 1);
3856
+ __decorateClass([
3857
+ e({ attribute: "value-text" })
3858
+ ], TimeSliderElement.prototype, "valueText", 2);
3859
+ __decorateClass([
3860
+ e({ attribute: "pause-while-dragging", type: Boolean })
3861
+ ], TimeSliderElement.prototype, "pauseWhileDragging", 2);
3862
+ __decorateClass([
3863
+ e({ attribute: "seeking-request-throttle", type: Number })
3864
+ ], TimeSliderElement.prototype, "seekingRequestThrottle", 2);
3865
+ __decorateClass([
3866
+ t()
3867
+ ], TimeSliderElement.prototype, "__mediaDuration", 2);
3868
+ __decorateClass([
3869
+ t()
3870
+ ], TimeSliderElement.prototype, "__mediaPaused", 2);
3871
+
3872
+ safelyDefineCustomElement("vds-time-slider", TimeSliderElement);
3873
+
3874
+ var VolumeSliderElement = class extends SliderElement {
3875
+ constructor() {
3876
+ super();
3877
+ this.value = 100;
3878
+ this._handleSliderValueChange = eventListener(
3879
+ this,
3880
+ "vds-slider-value-change",
3881
+ this._changeVolume.bind(this)
3882
+ );
3883
+ this._handleSliderDragValueChange = eventListener(
3884
+ this,
3885
+ "vds-slider-drag-value-change",
3886
+ this._changeVolume.bind(this)
3887
+ );
3888
+ mediaStoreSubscription(this, "volume", ($volume) => {
3889
+ this.value = $volume * 100;
3890
+ });
3891
+ }
3892
+ connectedCallback() {
3893
+ super.connectedCallback();
3894
+ setAttributeIfEmpty(this, "aria-label", "Media volume");
3895
+ }
3896
+ get min() {
3897
+ return 0;
3898
+ }
3899
+ set min(_) {
3900
+ }
3901
+ get max() {
3902
+ return 100;
3903
+ }
3904
+ set max(_) {
3905
+ }
3906
+ _changeVolume(event) {
3907
+ const newVolume = event.detail;
3908
+ const mediaVolume = round(newVolume / 100, 3);
3909
+ this._mediaRemote.changeVolume(mediaVolume, event);
3910
+ }
3911
+ };
3912
+ __decorateClass([
3913
+ e({ attribute: false })
3914
+ ], VolumeSliderElement.prototype, "min", 1);
3915
+ __decorateClass([
3916
+ e({ attribute: false })
3917
+ ], VolumeSliderElement.prototype, "max", 1);
3918
+ __decorateClass([
3919
+ e({ attribute: false, state: true })
3920
+ ], VolumeSliderElement.prototype, "value", 2);
3921
+
3922
+ safelyDefineCustomElement("vds-volume-slider", VolumeSliderElement);
3923
+
3924
+ var SliderValueTextElement = class extends s {
3925
+ constructor() {
3926
+ super(...arguments);
3927
+ this._disposal = new DisposalBin();
3928
+ this._sliderStoreConsumer = sliderStoreContext.consume(this);
3929
+ this.__value = 0;
3930
+ this.type = "current";
3931
+ this.showHours = false;
3932
+ this.padHours = false;
3933
+ this.decimalPlaces = 2;
3934
+ }
3935
+ static get styles() {
3936
+ return [
3937
+ i$1`:host{display:inline-block;contain:content}:host([hidden]){display:none}`
3938
+ ];
3939
+ }
3940
+ get _sliderStore() {
3941
+ return this._sliderStoreConsumer.value;
3942
+ }
3943
+ connectedCallback() {
3944
+ super.connectedCallback();
3945
+ this._handleTypeChange();
3946
+ }
3947
+ update(changedProperties) {
3948
+ if (changedProperties.has("type") || changedProperties.has("format")) {
3949
+ this._handleTypeChange();
3950
+ }
3951
+ super.update(changedProperties);
3952
+ }
3953
+ disconnectedCallback() {
3954
+ this._disposal.empty();
3955
+ super.disconnectedCallback();
3956
+ }
3957
+ render() {
3958
+ return y`${this._getValueText()}`;
3959
+ }
3960
+ _handleTypeChange() {
3961
+ this._disposal.empty();
3962
+ const valueStore = this._sliderStore[this.type === "current" ? "value" : "pointerValue"];
3963
+ const store = this.format === "percent" ? this._createPercentStore(valueStore) : valueStore;
3964
+ const unsub = store.subscribe(($value) => {
3965
+ this.__value = $value;
3966
+ });
3967
+ this._disposal.add(unsub);
3968
+ }
3969
+ _createPercentStore(valueStore) {
3970
+ return derived(
3971
+ [valueStore, this._sliderStore.min, this._sliderStore.max],
3972
+ ([$value, $min, $max]) => {
3973
+ const range = $max - $min;
3974
+ return $value / range * 100;
3975
+ }
3976
+ );
3977
+ }
3978
+ _getValueText() {
3979
+ switch (this.format) {
3980
+ case "percent":
3981
+ return this._getPercentFormat();
3982
+ case "time":
3983
+ return this._getTimeFormat();
3984
+ default:
3985
+ return `${this.__value}`;
3986
+ }
3987
+ }
3988
+ _getPercentFormat() {
3989
+ return `${round(this.__value, this.decimalPlaces)}%`;
3990
+ }
3991
+ _getTimeFormat() {
3992
+ return formatTime(this.__value, this.padHours, this.showHours);
3993
+ }
3994
+ };
3995
+ __decorateClass([
3996
+ t()
3997
+ ], SliderValueTextElement.prototype, "__value", 2);
3998
+ __decorateClass([
3999
+ e()
4000
+ ], SliderValueTextElement.prototype, "type", 2);
4001
+ __decorateClass([
4002
+ e()
4003
+ ], SliderValueTextElement.prototype, "format", 2);
4004
+ __decorateClass([
4005
+ e({ attribute: "show-hours", type: Boolean })
4006
+ ], SliderValueTextElement.prototype, "showHours", 2);
4007
+ __decorateClass([
4008
+ e({ attribute: "pad-hours", type: Boolean })
4009
+ ], SliderValueTextElement.prototype, "padHours", 2);
4010
+ __decorateClass([
4011
+ e({ attribute: "decimal-places", type: Number })
4012
+ ], SliderValueTextElement.prototype, "decimalPlaces", 2);
4013
+
4014
+ safelyDefineCustomElement("vds-slider-value-text", SliderValueTextElement);
4015
+
4016
+ var TimeElement = class extends s {
4017
+ constructor() {
4018
+ super(...arguments);
4019
+ this._disposal = new DisposalBin();
4020
+ this._mediaStoreConsumer = mediaStoreContext.consume(this);
4021
+ this.__seconds = 0;
4022
+ this.type = "current";
4023
+ this.showHours = false;
4024
+ this.padHours = false;
4025
+ this.remainder = false;
4026
+ }
4027
+ static get styles() {
4028
+ return [
4029
+ i$1`:host{display:inline-block;contain:content}:host([hidden]){display:none}`
4030
+ ];
4031
+ }
4032
+ get _mediaStore() {
4033
+ return this._mediaStoreConsumer.value;
4034
+ }
4035
+ connectedCallback() {
4036
+ super.connectedCallback();
4037
+ this._handleTypeChange();
4038
+ }
4039
+ update(changedProperties) {
4040
+ if (changedProperties.has("type") || changedProperties.has("remainder")) {
4041
+ this._handleTypeChange();
4042
+ }
4043
+ super.update(changedProperties);
4044
+ }
4045
+ disconnectedCallback() {
4046
+ this._disposal.empty();
4047
+ super.disconnectedCallback();
4048
+ }
4049
+ render() {
4050
+ return y`${this._getFormattedTime()}`;
4051
+ }
4052
+ _handleTypeChange() {
4053
+ this._disposal.empty();
4054
+ const store = this._getTypeStore();
4055
+ const unsub = (this.remainder ? this._createRemainderStore(store) : store).subscribe(
4056
+ ($seconds) => {
4057
+ this.__seconds = $seconds;
4058
+ }
4059
+ );
4060
+ this._disposal.add(unsub);
4061
+ }
4062
+ _getTypeStore() {
4063
+ switch (this.type) {
4064
+ case "buffered":
4065
+ return this._mediaStore.bufferedAmount;
4066
+ case "seekable":
4067
+ return this._mediaStore.seekableAmount;
4068
+ case "duration":
4069
+ return this._mediaStore.duration;
4070
+ default:
4071
+ return this._mediaStore.currentTime;
4072
+ }
4073
+ }
4074
+ _createRemainderStore(secondsStore) {
4075
+ return derived(
4076
+ [secondsStore, this._mediaStore.duration],
4077
+ ([$seconds, $duration]) => Math.max(0, $duration - $seconds)
4078
+ );
4079
+ }
4080
+ _getFormattedTime() {
4081
+ return formatTime(this.__seconds, this.padHours, this.showHours);
4082
+ }
4083
+ };
4084
+ __decorateClass([
4085
+ t()
4086
+ ], TimeElement.prototype, "__seconds", 2);
4087
+ __decorateClass([
4088
+ e()
4089
+ ], TimeElement.prototype, "type", 2);
4090
+ __decorateClass([
4091
+ e({ attribute: "show-hours", type: Boolean })
4092
+ ], TimeElement.prototype, "showHours", 2);
4093
+ __decorateClass([
4094
+ e({ attribute: "pad-hours", type: Boolean })
4095
+ ], TimeElement.prototype, "padHours", 2);
4096
+ __decorateClass([
4097
+ e({ type: Boolean })
4098
+ ], TimeElement.prototype, "remainder", 2);
4099
+
4100
+ safelyDefineCustomElement("vds-time", TimeElement);
4101
+
4102
+ const stzhAudioCss = ".sc-stzh-audio-h{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:normal;color:var(--stzh-base-color);-webkit-box-sizing:border-box;box-sizing:border-box;display:block}[hidden].sc-stzh-audio-h{display:none}.sc-stzh-audio-h *.sc-stzh-audio,.sc-stzh-audio-h *.sc-stzh-audio::before,.sc-stzh-audio-h *.sc-stzh-audio::after{-webkit-box-sizing:border-box;box-sizing:border-box}.stzh-audio.sc-stzh-audio{display:block;contain:none}.stzh-audio__audio.sc-stzh-audio{border:0;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}.stzh-audio__controls.sc-stzh-audio{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.stzh-audio__controls-top.sc-stzh-audio{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;margin-bottom:var(--stzh-space-small)}.stzh-audio__controls-bottom.sc-stzh-audio{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.stzh-audio__controls.sc-stzh-audio,.stzh-audio__transcript.sc-stzh-audio{border:0.0625rem solid var(--stzh-color-grey25);padding:var(--stzh-space-medium) var(--stzh-space-xlarge)}.stzh-audio__controls.sc-stzh-audio{padding-bottom:var(--stzh-space-xsmall)}.stzh-audio__button.sc-stzh-audio{width:2.5rem;height:2.5rem;display:grid;place-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;border:none;border-radius:var(--stzh-button-border-radius);-webkit-transition-duration:var(--stzh-base-transition-animation-speed);transition-duration:var(--stzh-base-transition-animation-speed);-webkit-transition-property:color, background-color;transition-property:color, background-color;color:var(--stzh-color-grey55)}.stzh-audio__button.is-play.sc-stzh-audio,.stzh-audio__button.is-mute.sc-stzh-audio,.stzh-audio__button.is-transcript.sc-stzh-audio{margin-right:var(--stzh-space-xsmall)}.stzh-audio__button.is-active.sc-stzh-audio{color:var(--stzh-color-primary, var(--stzh-color-zueriblue))}.stzh-audio__button.sc-stzh-audio:hover{color:var(--stzh-color-white);background-color:var(--stzh-color-primary, var(--stzh-color-zueriblue))}.stzh-audio__transcript.sc-stzh-audio{border-top:none}.stzh-audio__loader-overlay.sc-stzh-audio{display:grid;place-items:center;position:absolute;z-index:3;top:0;left:0;width:100%;height:100%;background-color:var(--stzh-color-white);opacity:0;visibility:hidden}.stzh-audio__time.sc-stzh-audio{font-size:var(--stzh-font-curve-p2-default-font-size, var(--stzh-font-micro-font-size));line-height:var(--stzh-font-curve-p2-default-text-line-height, var(--stzh-font-micro-text-line-height));display:-ms-inline-flexbox;display:inline-flex;margin-right:var(--stzh-space-xlarge)}@media screen and (min-width: 1024px){.stzh-audio__time.sc-stzh-audio{font-size:var(--stzh-font-curve-p2-medium-font-size, var(--stzh-font-milli-font-size));line-height:var(--stzh-font-curve-p2-medium-text-line-height, var(--stzh-font-milli-text-line-height));letter-spacing:var(--stzh-font-curve-p2-medium-text-letter-spacing)}}@media screen and (max-width: 599px){.stzh-audio__time.sc-stzh-audio{margin-right:auto}}.stzh-audio__time-separator.sc-stzh-audio{margin:0 var(--stzh-space-xxsmall)}.stzh-audio__slider.sc-stzh-audio{--height:1.1875rem;--thumb-width:0.8125rem;--track-height:0.3125rem;cursor:pointer;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;height:var(--height);border-radius:var(--stzh-button-border-radius)}.stzh-audio__slider.is-time.sc-stzh-audio{-ms-flex-positive:1;flex-grow:1}.stzh-audio__slider.is-volume.sc-stzh-audio{width:20%;min-width:5rem;max-width:6.875rem;display:none}@media screen and (min-width: 600px){.stzh-audio__slider.is-volume.sc-stzh-audio{display:-ms-flexbox;display:flex;margin-right:auto}}.stzh-audio__slider-track.sc-stzh-audio{width:100%;height:var(--track-height);position:absolute;top:50%;left:0;z-index:0;-webkit-transform:translateY(-50%);transform:translateY(-50%);border-radius:0.25rem;background-color:var(--stzh-color-grey25)}.stzh-audio__slider-track.is-fill.sc-stzh-audio{background-color:var(--stzh-color-primary, var(--stzh-color-zueriblue));-webkit-transform-origin:left center;transform-origin:left center;-webkit-transform:translateY(-50%);transform:translateY(-50%);width:calc(var(--vds-fill-rate) * 100%);z-index:1}.stzh-audio__slider-thumb-container.sc-stzh-audio{position:absolute;top:0;left:var(--vds-fill-percent);width:var(--thumb-width);height:100%;-webkit-transform:translateX(-50%);transform:translateX(-50%);z-index:2}.stzh-audio__slider[dragging].sc-stzh-audio .stzh-audio__slider-thumb-container.sc-stzh-audio{left:var(--vds-pointer-percent)}.stzh-audio__slider-thumb.sc-stzh-audio{position:absolute;top:50%;left:0;width:var(--thumb-width);height:var(--thumb-width);border-radius:50%;background-color:var(--stzh-color-white);-webkit-box-shadow:0 0 0 0.0625rem rgba(0, 0, 0, 0.25);box-shadow:0 0 0 0.0625rem rgba(0, 0, 0, 0.25);-webkit-transform:translateY(-50%);transform:translateY(-50%)}.stzh-audio__media-preview-container.sc-stzh-audio{--width:2.625rem;--width-half:calc(var(--width) / 2);--top:-1.5rem;--left-clamp:max(var(--width-half), var(--vds-pointer-percent));--right-clamp:calc(100% - var(--width-half));--left:min(var(--left-clamp), var(--right-clamp));display:grid;place-items:center;position:absolute;width:var(--width);top:var(--top);left:var(--left);width:var(--width);opacity:0;-webkit-transition:opacity var(--stzh-base-transition-animation-speed);transition:opacity var(--stzh-base-transition-animation-speed);-webkit-transform:translateX(-50%);transform:translateX(-50%);z-index:var(--stzh-z-index-popover);-webkit-box-shadow:var(--stzh-box-shadow-popover);box-shadow:var(--stzh-box-shadow-popover);border-radius:var(--stzh-tooltip-border-radius);background-color:var(--stzh-color-white)}@supports ((-webkit-filter: var(--stzh-tooltip-drop-shadow)) or (filter: var(--stzh-tooltip-drop-shadow))){.stzh-audio__media-preview-container.sc-stzh-audio{-webkit-box-shadow:none;box-shadow:none;-webkit-filter:var(--stzh-tooltip-drop-shadow);filter:var(--stzh-tooltip-drop-shadow)}}.stzh-audio__slider[pointing].sc-stzh-audio .stzh-audio__media-preview-container.sc-stzh-audio{opacity:1}.stzh-audio__slider-text.sc-stzh-audio{font-size:var(--stzh-font-nano-font-size);line-height:var(--stzh-font-nano-text-line-height)}.stzh-audio[hide-ui].sc-stzh-audio .stzh-audio__controls.sc-stzh-audio{opacity:0;visibility:hidden}.stzh-audio[autoplay-error].sc-stzh-audio .stzh-audio__controls.sc-stzh-audio{opacity:1}.stzh-audio.sc-stzh-audio:not([can-play]) .stzh-audio__loader-overlay.sc-stzh-audio,.stzh-audio[waiting].sc-stzh-audio .stzh-audio__loader-overlay.sc-stzh-audio{opacity:0.8;visibility:visible}.stzh-audio[paused].sc-stzh-audio .stzh-audio__paused.sc-stzh-audio{display:none}.stzh-audio.sc-stzh-audio:not([paused]) .stzh-audio__played.sc-stzh-audio{display:none}.stzh-audio[muted].sc-stzh-audio .stzh-audio__muted.sc-stzh-audio{display:none}.stzh-audio.sc-stzh-audio:not([muted]) .stzh-audio__unmuted.sc-stzh-audio{display:none}";
4103
+
4104
+ const StzhAudio = class {
4105
+ constructor(hostRef) {
4106
+ registerInstance(this, hostRef);
4107
+ this.stzhPlay = createEvent(this, "stzhPlay", 7);
4108
+ this.stzhPlaying = createEvent(this, "stzhPlaying", 7);
4109
+ this.stzhPause = createEvent(this, "stzhPause", 7);
4110
+ this.stzhReplay = createEvent(this, "stzhReplay", 7);
4111
+ this.stzhEnd = createEvent(this, "stzhEnd", 7);
4112
+ this.stzhEnded = createEvent(this, "stzhEnded", 7);
4113
+ this.stzhError = createEvent(this, "stzhError", 7);
4114
+ this.localization = undefined;
4115
+ this.src = "";
4116
+ this.preload = "none";
4117
+ this.transcript = "";
4118
+ this.transcriptShown = false;
4119
+ }
4120
+ async play() {
4121
+ this.vsdAudioElement.play();
4122
+ }
4123
+ async pause() {
4124
+ this.vsdAudioElement.pause();
4125
+ }
4126
+ async componentWillLoad() {
4127
+ if (!this.localization) {
4128
+ this.localization = await fetchTranslations(this.element, "audio");
4129
+ }
4130
+ }
4131
+ render() {
4132
+ const hasTranscript = !!this.transcript || hasSlot(this.element, "transcript");
4133
+ const classes = {
4134
+ "stzh-audio": true
4135
+ };
4136
+ return (h$2(Host, null, h$2("vds-media", { class: classes }, h$2("vds-audio", { class: "stzh-audio__audio", ref: (el) => (this.vsdAudioElement = el), "onVds-play": () => { this.stzhPlay.emit({ component: "stzh-audio" }); }, "onVds-playing": () => { this.stzhPlaying.emit({ component: "stzh-audio" }); }, "onVds-end": () => { this.stzhEnd.emit({ component: "stzh-audio" }); }, "onVds-ended": () => { this.stzhEnded.emit({ component: "stzh-audio" }); }, "onVds-replay": () => { this.stzhReplay.emit({ component: "stzh-audio" }); }, "onVds-error": (e) => { this.stzhError.emit({ component: "stzh-audio", originalEvent: e }); } }, h$2("audio", { preload: this.preload, src: this.src }, h$2("slot", null))), h$2("div", { class: "stzh-audio__controls" }, h$2("div", { class: "stzh-audio__loader-overlay" }, h$2("stzh-loader", { class: "stzh-audio__loader", label: this.localization.loading, "hide-label": true })), h$2("div", { class: "stzh-audio__controls-top" }, h$2("vds-time-slider", { class: "stzh-audio__slider is-time" }, h$2("div", { class: "stzh-audio__slider-track" }), h$2("div", { class: "stzh-audio__slider-track is-fill" }), h$2("div", { class: "stzh-audio__slider-thumb-container" }, h$2("div", { class: "stzh-audio__slider-thumb" })), h$2("div", { class: "stzh-audio__media-preview-container" }, h$2("vds-slider-value-text", { class: "stzh-audio__slider-text", type: "pointer", format: "time" })))), h$2("div", { class: "stzh-audio__controls-bottom" }, h$2("stzh-tooltip", null, h$2("vds-play-button", { class: "stzh-audio__button is-play" }, h$2("stzh-icon", { class: "stzh-audio__played", name: "play" }), h$2("stzh-icon", { class: "stzh-audio__paused", name: "close" })), h$2("span", { slot: "content" }, h$2("span", { class: "stzh-audio__played" }, this.localization.play), h$2("span", { class: "stzh-audio__paused" }, this.localization.pause))), h$2("div", { class: "stzh-audio__time" }, h$2("vds-time", { type: "current" }), h$2("span", { class: "stzh-audio__time-separator" }, "/"), h$2("vds-time", { type: "duration" })), h$2("stzh-tooltip", null, h$2("vds-mute-button", { class: "stzh-audio__button is-mute" }, h$2("stzh-icon", { class: "stzh-audio__muted", name: "volume-medium" }), h$2("stzh-icon", { class: "stzh-audio__unmuted", name: "silent-mode" })), h$2("span", { slot: "content" }, h$2("span", { class: "stzh-audio__muted" }, this.localization.mute), h$2("span", { class: "stzh-audio__unmuted" }, this.localization.unmute))), h$2("vds-volume-slider", { class: "stzh-audio__slider is-volume" }, h$2("div", { class: "stzh-audio__slider-track" }), h$2("div", { class: "stzh-audio__slider-track is-fill" }), h$2("div", { class: "stzh-audio__slider-thumb-container" }, h$2("div", { class: "stzh-audio__slider-thumb" })), h$2("div", { class: "stzh-audio__media-preview-container" }, h$2("vds-slider-value-text", { class: "stzh-audio__slider-text", type: "pointer", format: "percent" }))), hasTranscript &&
4137
+ h$2("stzh-tooltip", { content: this.transcriptShown ? this.localization.hideTranscript : this.localization.showTranscript }, h$2("button", { class: {
4138
+ "stzh-audio__button is-transcript": true,
4139
+ "is-active": this.transcriptShown
4140
+ }, onClick: () => this.transcriptShown = !this.transcriptShown }, h$2("stzh-icon", { name: "transcript" }))), h$2("stzh-tooltip", { content: this.localization.download }, h$2("a", { class: "stzh-audio__button is-download", href: this.src, download: "" }, h$2("stzh-icon", { name: "download" }))))), h$2("div", { class: "stzh-audio__transcript", hidden: !this.transcriptShown }, h$2("stzh-text", null, this.transcript ? this.transcript : h$2("slot", { name: "transcript" }))))));
4141
+ }
4142
+ get element() { return getElement(this); }
4143
+ };
4144
+ StzhAudio.style = stzhAudioCss;
4145
+
4146
+ export { StzhAudio as stzh_audio };