@mux/mux-player 2.9.1 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -74,6 +74,8 @@ var mediaThemeGerwig = (() => {
74
74
  --media-preview-time-text-shadow: none;
75
75
  --media-control-height: 14px;
76
76
  --media-control-padding: 6px;
77
+ --media-tooltip-container-margin: 6px;
78
+ --media-tooltip-distance: 18px;
77
79
 
78
80
  color: var(--_primary-color);
79
81
  display: inline-block;
@@ -175,18 +177,18 @@ var mediaThemeGerwig = (() => {
175
177
  border-bottom-width: 0;
176
178
  }
177
179
 
178
- [part~='listbox'] {
180
+ [part~='menu'] {
179
181
  border-radius: 2px;
180
182
  border: 1px solid rgba(0, 0, 0, 0.1);
181
- bottom: calc(100% + 16px);
183
+ bottom: 50px;
182
184
  padding: 2.5px 10px;
183
185
  }
184
186
 
185
- [part~='listbox']::part(indicator) {
187
+ [part~='menu']::part(indicator) {
186
188
  fill: var(--_accent-color);
187
189
  }
188
190
 
189
- [part~='listbox']::part(option) {
191
+ [part~='menu']::part(menu-item) {
190
192
  box-sizing: border-box;
191
193
  display: flex;
192
194
  align-items: center;
@@ -194,44 +196,47 @@ var mediaThemeGerwig = (() => {
194
196
  min-height: 34px;
195
197
  }
196
198
 
197
- [part~='listbox']::part(option-selected) {
199
+ [part~='menu']::part(checked) {
198
200
  font-weight: 700;
199
201
  }
200
202
 
201
- media-captions-selectmenu,
202
- media-rendition-selectmenu,
203
- media-audio-track-selectmenu,
204
- media-playback-rate-listbox[part~='listbox'] {
205
- --media-listbox-background: var(--_primary-color);
206
- --media-option-selected-background: transparent;
207
- --media-option-hover-background: transparent;
208
- --media-option-hover-outline: var(--_accent-color) solid 1px;
203
+ media-captions-menu,
204
+ media-rendition-menu,
205
+ media-audio-track-menu,
206
+ media-playback-rate-menu {
207
+ position: absolute; /* ensure they don't take up space in DOM on load */
208
+ --media-menu-background: var(--_primary-color);
209
+ --media-menu-item-checked-background: transparent;
209
210
  --media-text-color: var(--_text-color);
211
+ --media-menu-item-hover-background: transparent;
212
+ --media-menu-item-hover-outline: var(--_accent-color) solid 1px;
210
213
  }
211
214
 
212
215
  /* The icon is a circle so make it 16px high instead of 14px for more balance. */
213
- media-audio-track-selectmenu {
216
+ media-audio-track-menu-button {
214
217
  --media-control-padding: 5px;
215
218
  --media-control-height: 16px;
216
219
  }
217
220
 
218
- media-playback-rate-button {
221
+ media-playback-rate-menu-button {
219
222
  --media-control-padding: 6px 3px;
220
223
  min-width: 4.4ch;
221
224
  }
222
225
 
223
- media-playback-rate-listbox[part~='listbox'] {
224
- --media-listbox-layout: row;
225
- --media-option-selected-background: var(--_accent-color);
226
+ media-playback-rate-menu {
227
+ --media-menu-flex-direction: row;
228
+ --media-menu-item-checked-background: var(--_accent-color);
229
+ --media-menu-item-checked-indicator-display: none;
226
230
  margin-right: 6px;
227
231
  padding: 0;
232
+ --media-menu-gap: 0.25em;
228
233
  }
229
234
 
230
- media-playback-rate-listbox[part~='listbox']::part(option) {
231
- padding: 6px 4px;
235
+ media-playback-rate-menu[part~='menu']::part(menu-item) {
236
+ padding: 6px 6px 6px 8px;
232
237
  }
233
238
 
234
- media-playback-rate-listbox[part~='listbox']::part(option-selected) {
239
+ media-playback-rate-menu[part~='menu']::part(checked) {
235
240
  color: #fff;
236
241
  }
237
242
 
@@ -295,7 +300,7 @@ var mediaThemeGerwig = (() => {
295
300
  }
296
301
 
297
302
  media-control-bar[part~='bottom'] > * {
298
- z-index: 2;
303
+ z-index: 20;
299
304
  }
300
305
 
301
306
  media-control-bar[part~='bottom'] {
@@ -320,6 +325,7 @@ var mediaThemeGerwig = (() => {
320
325
  .center-controls {
321
326
  --media-button-icon-width: 100%;
322
327
  --media-button-icon-height: auto;
328
+ --media-tooltip-display: none;
323
329
  pointer-events: none;
324
330
  width: 100%;
325
331
  display: flex;
@@ -686,55 +692,55 @@ var mediaThemeGerwig = (() => {
686
692
  </media-pip-button>
687
693
  </template>
688
694
 
689
- <template partial="CaptionsMenuButton">
690
- <media-captions-selectmenu part="bottom captions selectmenu" disabled="{{disabled}}" aria-disabled="{{disabled}}">
691
- <media-captions-button
692
- slot="button"
693
- part="bottom captions button"
694
- disabled="{{disabled}}"
695
- aria-disabled="{{disabled}}"
696
- >
697
- <svg aria-hidden="true" viewBox="0 0 18 14" slot="on">
698
- <path
699
- d="M15.989 0H2.011C0.9004 0 0 0.9003 0 2.0109V11.9891C0 13.0997 0.9004 14 2.011 14H15.989C17.0997 14 18 13.0997 18 11.9891V2.0109C18 0.9003 17.0997 0 15.989 0ZM4.2292 8.7639C4.5954 9.1902 5.0935 9.4031 5.7233 9.4031C6.1852 9.4031 6.5544 9.301 6.8302 9.0969C7.1061 8.8933 7.2863 8.614 7.3702 8.26H8.4322C8.3062 8.884 8.0093 9.3733 7.5411 9.7273C7.0733 10.0813 6.4703 10.2581 5.732 10.2581C5.108 10.2581 4.5699 10.1219 4.1168 9.8489C3.6637 9.5759 3.3141 9.1946 3.0685 8.7058C2.8224 8.2165 2.6994 7.6511 2.6994 7.009C2.6994 6.3611 2.8224 5.7927 3.0685 5.3034C3.3141 4.8146 3.6637 4.4323 4.1168 4.1559C4.5699 3.88 5.108 3.7418 5.732 3.7418C6.4703 3.7418 7.0733 3.922 7.5411 4.2818C8.0094 4.6422 8.3062 5.1461 8.4322 5.794H7.3702C7.2862 5.4283 7.106 5.1368 6.8302 4.921C6.5544 4.7052 6.1852 4.5968 5.7233 4.5968C5.0934 4.5968 4.5954 4.8116 4.2292 5.2404C3.8635 5.6696 3.6804 6.259 3.6804 7.009C3.6804 7.7531 3.8635 8.3381 4.2292 8.7639ZM11.0974 8.7639C11.4636 9.1902 11.9617 9.4031 12.5915 9.4031C13.0534 9.4031 13.4226 9.301 13.6984 9.0969C13.9743 8.8933 14.1545 8.614 14.2384 8.26H15.3004C15.1744 8.884 14.8775 9.3733 14.4093 9.7273C13.9415 10.0813 13.3385 10.2581 12.6002 10.2581C11.9762 10.2581 11.4381 10.1219 10.985 9.8489C10.5319 9.5759 10.1823 9.1946 9.9367 8.7058C9.6906 8.2165 9.5676 7.6511 9.5676 7.009C9.5676 6.3611 9.6906 5.7927 9.9367 5.3034C10.1823 4.8146 10.5319 4.4323 10.985 4.1559C11.4381 3.88 11.9762 3.7418 12.6002 3.7418C13.3385 3.7418 13.9415 3.922 14.4093 4.2818C14.8776 4.6422 15.1744 5.1461 15.3004 5.794H14.2384C14.1544 5.4283 13.9742 5.1368 13.6984 4.921C13.4226 4.7052 13.0534 4.5968 12.5915 4.5968C11.9616 4.5968 11.4636 4.8116 11.0974 5.2404C10.7317 5.6696 10.5486 6.259 10.5486 7.009C10.5486 7.7531 10.7317 8.3381 11.0974 8.7639Z"
700
- />
701
- </svg>
702
- <svg aria-hidden="true" viewBox="0 0 18 14" slot="off">
703
- <path
704
- d="M5.73219 10.258C5.10819 10.258 4.57009 10.1218 4.11699 9.8488C3.66389 9.5758 3.31429 9.1945 3.06869 8.7057C2.82259 8.2164 2.69958 7.651 2.69958 7.0089C2.69958 6.361 2.82259 5.7926 3.06869 5.3033C3.31429 4.8145 3.66389 4.4322 4.11699 4.1558C4.57009 3.8799 5.10819 3.7417 5.73219 3.7417C6.47049 3.7417 7.07348 3.9219 7.54128 4.2817C8.00958 4.6421 8.30638 5.146 8.43238 5.7939H7.37039C7.28639 5.4282 7.10618 5.1367 6.83039 4.9209C6.55459 4.7051 6.18538 4.5967 5.72348 4.5967C5.09358 4.5967 4.59559 4.8115 4.22939 5.2403C3.86369 5.6695 3.68058 6.2589 3.68058 7.0089C3.68058 7.753 3.86369 8.338 4.22939 8.7638C4.59559 9.1901 5.09368 9.403 5.72348 9.403C6.18538 9.403 6.55459 9.3009 6.83039 9.0968C7.10629 8.8932 7.28649 8.6139 7.37039 8.2599H8.43238C8.30638 8.8839 8.00948 9.3732 7.54128 9.7272C7.07348 10.0812 6.47049 10.258 5.73219 10.258Z"
705
- />
706
- <path
707
- d="M12.6003 10.258C11.9763 10.258 11.4382 10.1218 10.9851 9.8488C10.532 9.5758 10.1824 9.1945 9.93685 8.7057C9.69075 8.2164 9.56775 7.651 9.56775 7.0089C9.56775 6.361 9.69075 5.7926 9.93685 5.3033C10.1824 4.8145 10.532 4.4322 10.9851 4.1558C11.4382 3.8799 11.9763 3.7417 12.6003 3.7417C13.3386 3.7417 13.9416 3.9219 14.4094 4.2817C14.8777 4.6421 15.1745 5.146 15.3005 5.7939H14.2385C14.1545 5.4282 13.9743 5.1367 13.6985 4.9209C13.4227 4.7051 13.0535 4.5967 12.5916 4.5967C11.9617 4.5967 11.4637 4.8115 11.0975 5.2403C10.7318 5.6695 10.5487 6.2589 10.5487 7.0089C10.5487 7.753 10.7318 8.338 11.0975 8.7638C11.4637 9.1901 11.9618 9.403 12.5916 9.403C13.0535 9.403 13.4227 9.3009 13.6985 9.0968C13.9744 8.8932 14.1546 8.6139 14.2385 8.2599H15.3005C15.1745 8.8839 14.8776 9.3732 14.4094 9.7272C13.9416 10.0812 13.3386 10.258 12.6003 10.258Z"
708
- />
695
+ <template partial="CaptionsMenu">
696
+ <media-captions-menu-button part="bottom captions button">
697
+ <svg aria-hidden="true" viewBox="0 0 18 14" slot="on">
698
+ <path
699
+ d="M15.989 0H2.011C0.9004 0 0 0.9003 0 2.0109V11.9891C0 13.0997 0.9004 14 2.011 14H15.989C17.0997 14 18 13.0997 18 11.9891V2.0109C18 0.9003 17.0997 0 15.989 0ZM4.2292 8.7639C4.5954 9.1902 5.0935 9.4031 5.7233 9.4031C6.1852 9.4031 6.5544 9.301 6.8302 9.0969C7.1061 8.8933 7.2863 8.614 7.3702 8.26H8.4322C8.3062 8.884 8.0093 9.3733 7.5411 9.7273C7.0733 10.0813 6.4703 10.2581 5.732 10.2581C5.108 10.2581 4.5699 10.1219 4.1168 9.8489C3.6637 9.5759 3.3141 9.1946 3.0685 8.7058C2.8224 8.2165 2.6994 7.6511 2.6994 7.009C2.6994 6.3611 2.8224 5.7927 3.0685 5.3034C3.3141 4.8146 3.6637 4.4323 4.1168 4.1559C4.5699 3.88 5.108 3.7418 5.732 3.7418C6.4703 3.7418 7.0733 3.922 7.5411 4.2818C8.0094 4.6422 8.3062 5.1461 8.4322 5.794H7.3702C7.2862 5.4283 7.106 5.1368 6.8302 4.921C6.5544 4.7052 6.1852 4.5968 5.7233 4.5968C5.0934 4.5968 4.5954 4.8116 4.2292 5.2404C3.8635 5.6696 3.6804 6.259 3.6804 7.009C3.6804 7.7531 3.8635 8.3381 4.2292 8.7639ZM11.0974 8.7639C11.4636 9.1902 11.9617 9.4031 12.5915 9.4031C13.0534 9.4031 13.4226 9.301 13.6984 9.0969C13.9743 8.8933 14.1545 8.614 14.2384 8.26H15.3004C15.1744 8.884 14.8775 9.3733 14.4093 9.7273C13.9415 10.0813 13.3385 10.2581 12.6002 10.2581C11.9762 10.2581 11.4381 10.1219 10.985 9.8489C10.5319 9.5759 10.1823 9.1946 9.9367 8.7058C9.6906 8.2165 9.5676 7.6511 9.5676 7.009C9.5676 6.3611 9.6906 5.7927 9.9367 5.3034C10.1823 4.8146 10.5319 4.4323 10.985 4.1559C11.4381 3.88 11.9762 3.7418 12.6002 3.7418C13.3385 3.7418 13.9415 3.922 14.4093 4.2818C14.8776 4.6422 15.1744 5.1461 15.3004 5.794H14.2384C14.1544 5.4283 13.9742 5.1368 13.6984 4.921C13.4226 4.7052 13.0534 4.5968 12.5915 4.5968C11.9616 4.5968 11.4636 4.8116 11.0974 5.2404C10.7317 5.6696 10.5486 6.259 10.5486 7.009C10.5486 7.7531 10.7317 8.3381 11.0974 8.7639Z"
700
+ />
701
+ </svg>
702
+ <svg aria-hidden="true" viewBox="0 0 18 14" slot="off">
703
+ <path
704
+ d="M5.73219 10.258C5.10819 10.258 4.57009 10.1218 4.11699 9.8488C3.66389 9.5758 3.31429 9.1945 3.06869 8.7057C2.82259 8.2164 2.69958 7.651 2.69958 7.0089C2.69958 6.361 2.82259 5.7926 3.06869 5.3033C3.31429 4.8145 3.66389 4.4322 4.11699 4.1558C4.57009 3.8799 5.10819 3.7417 5.73219 3.7417C6.47049 3.7417 7.07348 3.9219 7.54128 4.2817C8.00958 4.6421 8.30638 5.146 8.43238 5.7939H7.37039C7.28639 5.4282 7.10618 5.1367 6.83039 4.9209C6.55459 4.7051 6.18538 4.5967 5.72348 4.5967C5.09358 4.5967 4.59559 4.8115 4.22939 5.2403C3.86369 5.6695 3.68058 6.2589 3.68058 7.0089C3.68058 7.753 3.86369 8.338 4.22939 8.7638C4.59559 9.1901 5.09368 9.403 5.72348 9.403C6.18538 9.403 6.55459 9.3009 6.83039 9.0968C7.10629 8.8932 7.28649 8.6139 7.37039 8.2599H8.43238C8.30638 8.8839 8.00948 9.3732 7.54128 9.7272C7.07348 10.0812 6.47049 10.258 5.73219 10.258Z"
705
+ />
706
+ <path
707
+ d="M12.6003 10.258C11.9763 10.258 11.4382 10.1218 10.9851 9.8488C10.532 9.5758 10.1824 9.1945 9.93685 8.7057C9.69075 8.2164 9.56775 7.651 9.56775 7.0089C9.56775 6.361 9.69075 5.7926 9.93685 5.3033C10.1824 4.8145 10.532 4.4322 10.9851 4.1558C11.4382 3.8799 11.9763 3.7417 12.6003 3.7417C13.3386 3.7417 13.9416 3.9219 14.4094 4.2817C14.8777 4.6421 15.1745 5.146 15.3005 5.7939H14.2385C14.1545 5.4282 13.9743 5.1367 13.6985 4.9209C13.4227 4.7051 13.0535 4.5967 12.5916 4.5967C11.9617 4.5967 11.4637 4.8115 11.0975 5.2403C10.7318 5.6695 10.5487 6.2589 10.5487 7.0089C10.5487 7.753 10.7318 8.338 11.0975 8.7638C11.4637 9.1901 11.9618 9.403 12.5916 9.403C13.0535 9.403 13.4227 9.3009 13.6985 9.0968C13.9744 8.8932 14.1546 8.6139 14.2385 8.2599H15.3005C15.1745 8.8839 14.8776 9.3732 14.4094 9.7272C13.9416 10.0812 13.3386 10.258 12.6003 10.258Z"
708
+ />
709
+ <path
710
+ d="M15.9891 1C16.5465 1 17 1.4535 17 2.011V11.9891C17 12.5465 16.5465 13 15.9891 13H2.0109C1.4535 13 1 12.5465 1 11.9891V2.0109C1 1.4535 1.4535 0.9999 2.0109 0.9999L15.9891 1ZM15.9891 0H2.0109C0.9003 0 0 0.9003 0 2.0109V11.9891C0 13.0997 0.9003 14 2.0109 14H15.9891C17.0997 14 18 13.0997 18 11.9891V2.0109C18 0.9003 17.0997 0 15.9891 0Z"
711
+ />
712
+ </svg>
713
+ </media-captions-menu-button>
714
+ <media-captions-menu
715
+ hidden
716
+ anchor="auto"
717
+ part="bottom captions menu"
718
+ disabled="{{disabled}}"
719
+ aria-disabled="{{disabled}}"
720
+ exportparts="menu-item"
721
+ >
722
+ <div slot="checked-indicator">
723
+ <style>
724
+ .indicator {
725
+ position: relative;
726
+ top: 1px;
727
+ width: 0.9em;
728
+ height: auto;
729
+ fill: var(--_accent-color);
730
+ margin-right: 5px;
731
+ }
732
+
733
+ [aria-checked='false'] .indicator {
734
+ display: none;
735
+ }
736
+ </style>
737
+ <svg viewBox="0 0 14 18" class="indicator">
709
738
  <path
710
- d="M15.9891 1C16.5465 1 17 1.4535 17 2.011V11.9891C17 12.5465 16.5465 13 15.9891 13H2.0109C1.4535 13 1 12.5465 1 11.9891V2.0109C1 1.4535 1.4535 0.9999 2.0109 0.9999L15.9891 1ZM15.9891 0H2.0109C0.9003 0 0 0.9003 0 2.0109V11.9891C0 13.0997 0.9003 14 2.0109 14H15.9891C17.0997 14 18 13.0997 18 11.9891V2.0109C18 0.9003 17.0997 0 15.9891 0Z"
739
+ d="M12.252 3.48c-.115.033-.301.161-.425.291-.059.063-1.407 1.815-2.995 3.894s-2.897 3.79-2.908 3.802c-.013.014-.661-.616-1.672-1.624-.908-.905-1.702-1.681-1.765-1.723-.401-.27-.783-.211-1.176.183a1.285 1.285 0 0 0-.261.342.582.582 0 0 0-.082.35c0 .165.01.205.08.35.075.153.213.296 2.182 2.271 1.156 1.159 2.17 2.159 2.253 2.222.189.143.338.196.539.194.203-.003.412-.104.618-.299.205-.193 6.7-8.693 6.804-8.903a.716.716 0 0 0 .085-.345c.01-.179.005-.203-.062-.339-.124-.252-.45-.531-.746-.639a.784.784 0 0 0-.469-.027"
740
+ fill-rule="evenodd"
711
741
  />
712
- </svg>
713
- </media-captions-button>
714
- <media-captions-listbox slot="listbox" exportparts="option" part="bottom captions listbox">
715
- <div slot="select-indicator">
716
- <style>
717
- .listbox-indicator {
718
- position: relative;
719
- top: 1px;
720
- width: 0.9em;
721
- height: auto;
722
- fill: var(--_accent-color);
723
- }
724
-
725
- [aria-selected='false'] .listbox-indicator {
726
- display: none;
727
- }
728
- </style>
729
- <svg viewBox="0 0 14 18" class="listbox-indicator">
730
- <path
731
- d="M12.252 3.48c-.115.033-.301.161-.425.291-.059.063-1.407 1.815-2.995 3.894s-2.897 3.79-2.908 3.802c-.013.014-.661-.616-1.672-1.624-.908-.905-1.702-1.681-1.765-1.723-.401-.27-.783-.211-1.176.183a1.285 1.285 0 0 0-.261.342.582.582 0 0 0-.082.35c0 .165.01.205.08.35.075.153.213.296 2.182 2.271 1.156 1.159 2.17 2.159 2.253 2.222.189.143.338.196.539.194.203-.003.412-.104.618-.299.205-.193 6.7-8.693 6.804-8.903a.716.716 0 0 0 .085-.345c.01-.179.005-.203-.062-.339-.124-.252-.45-.531-.746-.639a.784.784 0 0 0-.469-.027"
732
- fill-rule="evenodd"
733
- />
734
- </svg>
735
- </div>
736
- </media-captions-listbox>
737
- </media-captions-selectmenu>
742
+ </svg></div
743
+ ></media-captions-menu>
738
744
  </template>
739
745
 
740
746
  <template partial="AirplayButton">
@@ -805,20 +811,17 @@ var mediaThemeGerwig = (() => {
805
811
  </media-live-button>
806
812
  </template>
807
813
 
808
- <template partial="PlaybackRateSelect">
809
- <media-playback-rate-selectmenu
810
- part="bottom playback-rate selectmenu"
814
+ <template partial="PlaybackRateMenu">
815
+ <media-playback-rate-menu-button part="bottom playback-rate button"></media-playback-rate-menu-button>
816
+ <media-playback-rate-menu
817
+ hidden
818
+ anchor="auto"
819
+ rates="{{playbackrates}}"
820
+ exportparts="menu-item"
821
+ part="bottom playback-rate menu"
811
822
  disabled="{{disabled}}"
812
823
  aria-disabled="{{disabled}}"
813
- >
814
- <media-playback-rate-button slot="button" part="bottom playback-rate button"></media-playback-rate-button>
815
- <media-playback-rate-listbox
816
- slot="listbox"
817
- rates="{{playbackrates}}"
818
- exportparts="option"
819
- part="bottom playback-rate listbox"
820
- ></media-playback-rate-listbox>
821
- </media-playback-rate-selectmenu>
824
+ ></media-playback-rate-menu>
822
825
  </template>
823
826
 
824
827
  <template partial="VolumeRange">
@@ -848,79 +851,86 @@ var mediaThemeGerwig = (() => {
848
851
  </media-time-range>
849
852
  </template>
850
853
 
851
- <template partial="AudioTrackSelect">
852
- <media-audio-track-selectmenu
853
- part="bottom audio-track selectmenu"
854
+ <template partial="AudioTrackMenu">
855
+ <media-audio-track-menu-button part="bottom audio-track button">
856
+ <svg aria-hidden="true" slot="icon" viewBox="0 0 18 16">
857
+ <path d="M9 15A7 7 0 1 1 9 1a7 7 0 0 1 0 14Zm0 1A8 8 0 1 0 9 0a8 8 0 0 0 0 16Z" />
858
+ <path
859
+ d="M5.2 6.3a.5.5 0 0 1 .5.5v2.4a.5.5 0 1 1-1 0V6.8a.5.5 0 0 1 .5-.5Zm2.4-2.4a.5.5 0 0 1 .5.5v7.2a.5.5 0 0 1-1 0V4.4a.5.5 0 0 1 .5-.5ZM10 5.5a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5Zm2.4-.8a.5.5 0 0 1 .5.5v5.6a.5.5 0 0 1-1 0V5.2a.5.5 0 0 1 .5-.5Z"
860
+ />
861
+ </svg>
862
+ </media-audio-track-menu-button>
863
+ <media-audio-track-menu
864
+ hidden
865
+ anchor="auto"
866
+ part="bottom audio-track menu"
854
867
  disabled="{{disabled}}"
855
868
  aria-disabled="{{disabled}}"
869
+ exportparts="menu-item"
856
870
  >
857
- <media-audio-track-button slot="button" part="bottom audio-track button">
858
- <svg aria-hidden="true" slot="icon" viewBox="0 0 18 16">
859
- <path d="M9 15A7 7 0 1 1 9 1a7 7 0 0 1 0 14Zm0 1A8 8 0 1 0 9 0a8 8 0 0 0 0 16Z" />
871
+ <div slot="checked-indicator">
872
+ <style>
873
+ .indicator {
874
+ position: relative;
875
+ top: 1px;
876
+ width: 0.9em;
877
+ height: auto;
878
+ fill: var(--_accent-color);
879
+ margin-right: 5px;
880
+ }
881
+
882
+ [aria-checked='false'] .indicator {
883
+ display: none;
884
+ }
885
+ </style>
886
+ <svg viewBox="0 0 14 18" class="indicator">
860
887
  <path
861
- d="M5.2 6.3a.5.5 0 0 1 .5.5v2.4a.5.5 0 1 1-1 0V6.8a.5.5 0 0 1 .5-.5Zm2.4-2.4a.5.5 0 0 1 .5.5v7.2a.5.5 0 0 1-1 0V4.4a.5.5 0 0 1 .5-.5ZM10 5.5a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5Zm2.4-.8a.5.5 0 0 1 .5.5v5.6a.5.5 0 0 1-1 0V5.2a.5.5 0 0 1 .5-.5Z"
888
+ d="M12.252 3.48c-.115.033-.301.161-.425.291-.059.063-1.407 1.815-2.995 3.894s-2.897 3.79-2.908 3.802c-.013.014-.661-.616-1.672-1.624-.908-.905-1.702-1.681-1.765-1.723-.401-.27-.783-.211-1.176.183a1.285 1.285 0 0 0-.261.342.582.582 0 0 0-.082.35c0 .165.01.205.08.35.075.153.213.296 2.182 2.271 1.156 1.159 2.17 2.159 2.253 2.222.189.143.338.196.539.194.203-.003.412-.104.618-.299.205-.193 6.7-8.693 6.804-8.903a.716.716 0 0 0 .085-.345c.01-.179.005-.203-.062-.339-.124-.252-.45-.531-.746-.639a.784.784 0 0 0-.469-.027"
889
+ fill-rule="evenodd"
862
890
  />
863
891
  </svg>
864
- </media-audio-track-button>
865
- <media-audio-track-listbox slot="listbox" exportparts="option" part="bottom audio-track listbox">
866
- <div slot="select-indicator">
867
- <style>
868
- .listbox-indicator {
869
- position: relative;
870
- top: 1px;
871
- width: 0.9em;
872
- height: auto;
873
- fill: var(--_accent-color);
874
- }
875
-
876
- [aria-selected='false'] .listbox-indicator {
877
- display: none;
878
- }
879
- </style>
880
- <svg viewBox="0 0 14 18" class="listbox-indicator">
881
- <path
882
- d="M12.252 3.48c-.115.033-.301.161-.425.291-.059.063-1.407 1.815-2.995 3.894s-2.897 3.79-2.908 3.802c-.013.014-.661-.616-1.672-1.624-.908-.905-1.702-1.681-1.765-1.723-.401-.27-.783-.211-1.176.183a1.285 1.285 0 0 0-.261.342.582.582 0 0 0-.082.35c0 .165.01.205.08.35.075.153.213.296 2.182 2.271 1.156 1.159 2.17 2.159 2.253 2.222.189.143.338.196.539.194.203-.003.412-.104.618-.299.205-.193 6.7-8.693 6.804-8.903a.716.716 0 0 0 .085-.345c.01-.179.005-.203-.062-.339-.124-.252-.45-.531-.746-.639a.784.784 0 0 0-.469-.027"
883
- fill-rule="evenodd"
884
- />
885
- </svg>
886
- </div>
887
- </media-audio-track-listbox>
888
- </media-audio-track-selectmenu>
892
+ </div>
893
+ </media-audio-track-menu>
889
894
  </template>
890
895
 
891
- <template partial="RenditionSelect">
892
- <media-rendition-selectmenu part="bottom rendition selectmenu" disabled="{{disabled}}" aria-disabled="{{disabled}}">
893
- <media-rendition-button slot="button" part="bottom rendition button">
894
- <svg aria-hidden="true" slot="icon" viewBox="0 0 18 14">
896
+ <template partial="RenditionMenu">
897
+ <media-rendition-menu-button part="bottom rendition button">
898
+ <svg aria-hidden="true" slot="icon" viewBox="0 0 18 14">
899
+ <path
900
+ d="M2.25 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM9 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm6.75 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z"
901
+ />
902
+ </svg>
903
+ </media-rendition-menu-button>
904
+ <media-rendition-menu
905
+ hidden
906
+ anchor="auto"
907
+ part="bottom rendition menu"
908
+ disabled="{{disabled}}"
909
+ aria-disabled="{{disabled}}"
910
+ >
911
+ <div slot="checked-indicator">
912
+ <style>
913
+ .indicator {
914
+ position: relative;
915
+ top: 1px;
916
+ width: 0.9em;
917
+ height: auto;
918
+ fill: var(--_accent-color);
919
+ margin-right: 5px;
920
+ }
921
+
922
+ [aria-checked='false'] .indicator {
923
+ display: none;
924
+ }
925
+ </style>
926
+ <svg viewBox="0 0 14 18" class="indicator">
895
927
  <path
896
- d="M2.25 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM9 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm6.75 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z"
928
+ d="M12.252 3.48c-.115.033-.301.161-.425.291-.059.063-1.407 1.815-2.995 3.894s-2.897 3.79-2.908 3.802c-.013.014-.661-.616-1.672-1.624-.908-.905-1.702-1.681-1.765-1.723-.401-.27-.783-.211-1.176.183a1.285 1.285 0 0 0-.261.342.582.582 0 0 0-.082.35c0 .165.01.205.08.35.075.153.213.296 2.182 2.271 1.156 1.159 2.17 2.159 2.253 2.222.189.143.338.196.539.194.203-.003.412-.104.618-.299.205-.193 6.7-8.693 6.804-8.903a.716.716 0 0 0 .085-.345c.01-.179.005-.203-.062-.339-.124-.252-.45-.531-.746-.639a.784.784 0 0 0-.469-.027"
929
+ fill-rule="evenodd"
897
930
  />
898
931
  </svg>
899
- </media-rendition-button>
900
- <media-rendition-listbox slot="listbox" exportparts="option" part="bottom rendition listbox">
901
- <div slot="select-indicator">
902
- <style>
903
- .listbox-indicator {
904
- position: relative;
905
- top: 1px;
906
- width: 0.9em;
907
- height: auto;
908
- fill: var(--_accent-color);
909
- }
910
-
911
- [aria-selected='false'] .listbox-indicator {
912
- display: none;
913
- }
914
- </style>
915
- <svg viewBox="0 0 14 18" class="listbox-indicator">
916
- <path
917
- d="M12.252 3.48c-.115.033-.301.161-.425.291-.059.063-1.407 1.815-2.995 3.894s-2.897 3.79-2.908 3.802c-.013.014-.661-.616-1.672-1.624-.908-.905-1.702-1.681-1.765-1.723-.401-.27-.783-.211-1.176.183a1.285 1.285 0 0 0-.261.342.582.582 0 0 0-.082.35c0 .165.01.205.08.35.075.153.213.296 2.182 2.271 1.156 1.159 2.17 2.159 2.253 2.222.189.143.338.196.539.194.203-.003.412-.104.618-.299.205-.193 6.7-8.693 6.804-8.903a.716.716 0 0 0 .085-.345c.01-.179.005-.203-.062-.339-.124-.252-.45-.531-.746-.639a.784.784 0 0 0-.469-.027"
918
- fill-rule="evenodd"
919
- />
920
- </svg>
921
- </div>
922
- </media-rendition-listbox>
923
- </media-rendition-selectmenu>
932
+ </div>
933
+ </media-rendition-menu>
924
934
  </template>
925
935
 
926
936
  <media-controller
@@ -947,27 +957,13 @@ var mediaThemeGerwig = (() => {
947
957
 
948
958
  <template if="!audio">
949
959
  <!-- Pre-playback UI -->
960
+ <!-- same for both on-demand and live -->
950
961
  <div slot="centered-chrome" class="center-controls pre-playback">
951
- <template if="streamtype == 'on-demand'">
952
- <template if="!breakpointsm"> {{>SeekBackwardButton section="center"}} </template>
953
- <template if="!breakpointsm"> {{>PlayButton section="center"}} </template>
954
- <template if="breakpointsm"> {{>PrePlayButton section="center"}} </template>
955
- <template if="!breakpointsm"> {{>SeekForwardButton section="center"}} </template>
956
- </template>
957
-
958
- <template if="streamtype == 'live'">
959
- <template if="!breakpointsm">
960
- <template if="targetlivewindow > 0"> {{>SeekBackwardButton section="center"}} </template>
961
- </template>
962
- <template if="!breakpointsm"> {{>PlayButton section="center"}} </template>
963
- <template if="breakpointsm"> {{>PrePlayButton section="center"}} </template>
964
- <template if="!breakpointsm">
965
- <template if="targetlivewindow > 0"> {{>SeekForwardButton section="center"}} </template>
966
- </template>
967
- </template>
962
+ <template if="!breakpointsm">{{>PlayButton section="center"}}</template>
963
+ <template if="breakpointsm">{{>PrePlayButton section="center"}}</template>
968
964
  </div>
969
965
 
970
- <!-- Auotplay centered unmute button -->
966
+ <!-- Autoplay centered unmute button -->
971
967
  <!--
972
968
  todo: figure out how show this with available state variables
973
969
  needs to show when:
@@ -995,7 +991,7 @@ var mediaThemeGerwig = (() => {
995
991
  {{>PlayButton}} {{>SeekBackwardButton}} {{>SeekForwardButton}} {{>TimeDisplay}} {{>MuteButton}}
996
992
  {{>VolumeRange}}
997
993
  <div class="spacer"></div>
998
- {{>RenditionSelect}} {{>PlaybackRateSelect}} {{>AudioTrackSelect}} {{>CaptionsMenuButton}} {{>AirplayButton}}
994
+ {{>RenditionMenu}} {{>PlaybackRateMenu}} {{>AudioTrackMenu}} {{>CaptionsMenu}} {{>AirplayButton}}
999
995
  {{>CastButton}} {{>PipButton}} {{>FullscreenButton}}
1000
996
  </media-control-bar>
1001
997
  </template>
@@ -1011,8 +1007,8 @@ var mediaThemeGerwig = (() => {
1011
1007
  <template if="targetlivewindow > 0">{{>SeekBackwardButton}} {{>SeekForwardButton}}</template>
1012
1008
  {{>MuteButton}} {{>VolumeRange}}
1013
1009
  <div class="spacer"></div>
1014
- {{>RenditionSelect}} {{>AudioTrackSelect}} {{>CaptionsMenuButton}} {{>AirplayButton}} {{>CastButton}}
1015
- {{>PipButton}} {{>FullscreenButton}}
1010
+ {{>RenditionMenu}} {{>AudioTrackMenu}} {{>CaptionsMenu}} {{>AirplayButton}} {{>CastButton}} {{>PipButton}}
1011
+ {{>FullscreenButton}}
1016
1012
  </media-control-bar>
1017
1013
  </template>
1018
1014
  </template>
@@ -1028,7 +1024,7 @@ var mediaThemeGerwig = (() => {
1028
1024
  {{>MuteButton}}
1029
1025
  <template if="breakpointsm">{{>VolumeRange}}</template>
1030
1026
  {{>TimeDisplay}} {{>TimeRange}}
1031
- <template if="breakpointsm">{{>PlaybackRateSelect}}</template>
1027
+ <template if="breakpointsm">{{>PlaybackRateMenu}}</template>
1032
1028
  {{>AirplayButton}} {{>CastButton}}
1033
1029
  </media-control-bar>
1034
1030
  </template>
@@ -1038,8 +1034,9 @@ var mediaThemeGerwig = (() => {
1038
1034
  <media-control-bar part="control-bar top">{{>TitleDisplay}}</media-control-bar>
1039
1035
  </template>
1040
1036
  <media-control-bar part="control-bar bottom">
1037
+ {{>PlayButton}} {{>LiveButton section="bottom"}} {{>MuteButton}}
1041
1038
  <template if="breakpointsm">
1042
- {{>PlayButton}} {{>LiveButton section="bottom"}} {{>MuteButton}} {{>VolumeRange}}
1039
+ {{>VolumeRange}}
1043
1040
  <template if="targetlivewindow > 0"> {{>SeekBackwardButton}} {{>SeekForwardButton}} </template>
1044
1041
  </template>
1045
1042
  <template if="targetlivewindow > 0"> {{>TimeDisplay}} {{>TimeRange}} </template>
@@ -1079,6 +1076,9 @@ var mediaThemeGerwig = (() => {
1079
1076
  },
1080
1077
  define(_name, _constructor, _options) {
1081
1078
  },
1079
+ getName(_constructor) {
1080
+ return null;
1081
+ },
1082
1082
  upgrade(_root) {
1083
1083
  },
1084
1084
  whenDefined(_name) {
@@ -1086,7 +1086,7 @@ var mediaThemeGerwig = (() => {
1086
1086
  }
1087
1087
  };
1088
1088
  var _detail;
1089
- var CustomEvent = class {
1089
+ var CustomEvent2 = class {
1090
1090
  constructor(typeArg, eventInitDict = {}) {
1091
1091
  __privateAdd(this, _detail, void 0);
1092
1092
  __privateSet(this, _detail, eventInitDict == null ? void 0 : eventInitDict.detail);
@@ -1107,7 +1107,7 @@ var mediaThemeGerwig = (() => {
1107
1107
  },
1108
1108
  DocumentFragment,
1109
1109
  customElements,
1110
- CustomEvent,
1110
+ CustomEvent: CustomEvent2,
1111
1111
  EventTarget,
1112
1112
  HTMLElement,
1113
1113
  HTMLVideoElement
@@ -1117,6 +1117,37 @@ var mediaThemeGerwig = (() => {
1117
1117
  var internalDocument = isServer ? globalThisShim.document : globalThis.document;
1118
1118
 
1119
1119
  // ../../node_modules/media-chrome/dist/constants.js
1120
+ var MediaUIEvents = {
1121
+ MEDIA_PLAY_REQUEST: "mediaplayrequest",
1122
+ MEDIA_PAUSE_REQUEST: "mediapauserequest",
1123
+ MEDIA_MUTE_REQUEST: "mediamuterequest",
1124
+ MEDIA_UNMUTE_REQUEST: "mediaunmuterequest",
1125
+ MEDIA_VOLUME_REQUEST: "mediavolumerequest",
1126
+ MEDIA_SEEK_REQUEST: "mediaseekrequest",
1127
+ MEDIA_AIRPLAY_REQUEST: "mediaairplayrequest",
1128
+ MEDIA_ENTER_FULLSCREEN_REQUEST: "mediaenterfullscreenrequest",
1129
+ MEDIA_EXIT_FULLSCREEN_REQUEST: "mediaexitfullscreenrequest",
1130
+ MEDIA_PREVIEW_REQUEST: "mediapreviewrequest",
1131
+ MEDIA_ENTER_PIP_REQUEST: "mediaenterpiprequest",
1132
+ MEDIA_EXIT_PIP_REQUEST: "mediaexitpiprequest",
1133
+ MEDIA_ENTER_CAST_REQUEST: "mediaentercastrequest",
1134
+ MEDIA_EXIT_CAST_REQUEST: "mediaexitcastrequest",
1135
+ MEDIA_SHOW_TEXT_TRACKS_REQUEST: "mediashowtexttracksrequest",
1136
+ MEDIA_HIDE_TEXT_TRACKS_REQUEST: "mediahidetexttracksrequest",
1137
+ MEDIA_SHOW_SUBTITLES_REQUEST: "mediashowsubtitlesrequest",
1138
+ MEDIA_DISABLE_SUBTITLES_REQUEST: "mediadisablesubtitlesrequest",
1139
+ MEDIA_TOGGLE_SUBTITLES_REQUEST: "mediatogglesubtitlesrequest",
1140
+ MEDIA_PLAYBACK_RATE_REQUEST: "mediaplaybackraterequest",
1141
+ MEDIA_RENDITION_REQUEST: "mediarenditionrequest",
1142
+ MEDIA_AUDIO_TRACK_REQUEST: "mediaaudiotrackrequest",
1143
+ MEDIA_SEEK_TO_LIVE_REQUEST: "mediaseektoliverequest",
1144
+ REGISTER_MEDIA_STATE_RECEIVER: "registermediastatereceiver",
1145
+ UNREGISTER_MEDIA_STATE_RECEIVER: "unregistermediastatereceiver"
1146
+ };
1147
+ var MediaStateReceiverAttributes = {
1148
+ MEDIA_CHROME_ATTRIBUTES: "mediachromeattributes",
1149
+ MEDIA_CONTROLLER: "mediacontroller"
1150
+ };
1120
1151
  var MediaUIProps = {
1121
1152
  MEDIA_AIRPLAY_UNAVAILABLE: "mediaAirplayUnavailable",
1122
1153
  MEDIA_FULLSCREEN_UNAVAILABLE: "mediaFullscreenUnavailable",
@@ -1124,6 +1155,8 @@ var mediaThemeGerwig = (() => {
1124
1155
  MEDIA_CAST_UNAVAILABLE: "mediaCastUnavailable",
1125
1156
  MEDIA_RENDITION_UNAVAILABLE: "mediaRenditionUnavailable",
1126
1157
  MEDIA_AUDIO_TRACK_UNAVAILABLE: "mediaAudioTrackUnavailable",
1158
+ MEDIA_WIDTH: "mediaWidth",
1159
+ MEDIA_HEIGHT: "mediaHeight",
1127
1160
  MEDIA_PAUSED: "mediaPaused",
1128
1161
  MEDIA_HAS_PLAYED: "mediaHasPlayed",
1129
1162
  MEDIA_ENDED: "mediaEnded",
@@ -1156,35 +1189,27 @@ var mediaThemeGerwig = (() => {
1156
1189
  MEDIA_AUDIO_TRACK_ENABLED: "mediaAudioTrackEnabled",
1157
1190
  MEDIA_CHAPTERS_CUES: "mediaChaptersCues"
1158
1191
  };
1159
- var MediaUIPropsEntries = (
1160
- /** @type {[keyof MediaUIProps, string][]} */
1161
- Object.entries(MediaUIProps)
1192
+ var MediaUIPropsEntries = Object.entries(
1193
+ MediaUIProps
1162
1194
  );
1163
- var MediaUIAttributes = (
1164
- /** @type {{ [k in keyof MediaUIProps]: string }} */
1165
- MediaUIPropsEntries.reduce(
1166
- (dictObj, [key, propName]) => {
1167
- dictObj[key] = `${propName.toLowerCase()}`;
1168
- return dictObj;
1169
- },
1170
- /** @type {Partial<{ [k in keyof MediaUIProps]: string }>} */
1171
- {}
1172
- )
1195
+ var MediaUIAttributes = MediaUIPropsEntries.reduce(
1196
+ (dictObj, [key, propName]) => {
1197
+ dictObj[key] = propName.toLowerCase();
1198
+ return dictObj;
1199
+ },
1200
+ {}
1173
1201
  );
1174
- var MediaStateChangeEvents = (
1175
- /** @type {{ [k in keyof MediaUIProps | 'USER_INACTIVE' | 'BREAKPOINTS_CHANGE' | 'BREAKPOINTS_COMPUTED']: string }} */
1176
- MediaUIPropsEntries.reduce(
1177
- (dictObj, [key, propName]) => {
1178
- dictObj[key] = `${propName.toLowerCase()}`;
1179
- return dictObj;
1180
- },
1181
- /** @type {Partial<{ [k in keyof MediaUIProps | 'USER_INACTIVE' | 'BREAKPOINTS_CHANGE' | 'BREAKPOINTS_COMPUTED']: string }>} */
1182
- {
1183
- USER_INACTIVE: "userinactivechange",
1184
- BREAKPOINTS_CHANGE: "breakpointchange",
1185
- BREAKPOINTS_COMPUTED: "breakpointscomputed"
1186
- }
1187
- )
1202
+ var AdditionalStateChangeEvents = {
1203
+ USER_INACTIVE: "userinactivechange",
1204
+ BREAKPOINTS_CHANGE: "breakpointchange",
1205
+ BREAKPOINTS_COMPUTED: "breakpointscomputed"
1206
+ };
1207
+ var MediaStateChangeEvents = MediaUIPropsEntries.reduce(
1208
+ (dictObj, [key, propName]) => {
1209
+ dictObj[key] = propName.toLowerCase();
1210
+ return dictObj;
1211
+ },
1212
+ { ...AdditionalStateChangeEvents }
1188
1213
  );
1189
1214
  var StateChangeEventToAttributeMap = Object.entries(
1190
1215
  MediaStateChangeEvents
@@ -1210,6 +1235,144 @@ var mediaThemeGerwig = (() => {
1210
1235
  },
1211
1236
  { userinactive: "userinactivechange" }
1212
1237
  );
1238
+ var TextTrackKinds = {
1239
+ SUBTITLES: "subtitles",
1240
+ CAPTIONS: "captions",
1241
+ DESCRIPTIONS: "descriptions",
1242
+ CHAPTERS: "chapters",
1243
+ METADATA: "metadata"
1244
+ };
1245
+
1246
+ // ../../node_modules/media-chrome/dist/utils/element-utils.js
1247
+ function getMediaController(host) {
1248
+ var _a3;
1249
+ return (_a3 = getAttributeMediaController(host)) != null ? _a3 : closestComposedNode(host, "media-controller");
1250
+ }
1251
+ function getAttributeMediaController(host) {
1252
+ var _a3;
1253
+ const { MEDIA_CONTROLLER } = MediaStateReceiverAttributes;
1254
+ const mediaControllerId = host.getAttribute(MEDIA_CONTROLLER);
1255
+ if (mediaControllerId) {
1256
+ return (_a3 = getDocumentOrShadowRoot(host)) == null ? void 0 : _a3.getElementById(
1257
+ mediaControllerId
1258
+ );
1259
+ }
1260
+ }
1261
+ var containsComposedNode = (rootNode, childNode) => {
1262
+ if (!rootNode || !childNode)
1263
+ return false;
1264
+ if (rootNode == null ? void 0 : rootNode.contains(childNode))
1265
+ return true;
1266
+ return containsComposedNode(
1267
+ rootNode,
1268
+ childNode.getRootNode().host
1269
+ );
1270
+ };
1271
+ var closestComposedNode = (childNode, selector) => {
1272
+ if (!childNode)
1273
+ return null;
1274
+ const closest = childNode.closest(selector);
1275
+ if (closest)
1276
+ return closest;
1277
+ return closestComposedNode(
1278
+ childNode.getRootNode().host,
1279
+ selector
1280
+ );
1281
+ };
1282
+ function getActiveElement(root = document) {
1283
+ var _a3;
1284
+ const activeEl = root == null ? void 0 : root.activeElement;
1285
+ if (!activeEl)
1286
+ return null;
1287
+ return (_a3 = getActiveElement(activeEl.shadowRoot)) != null ? _a3 : activeEl;
1288
+ }
1289
+ function getDocumentOrShadowRoot(node) {
1290
+ var _a3;
1291
+ const rootNode = (_a3 = node == null ? void 0 : node.getRootNode) == null ? void 0 : _a3.call(node);
1292
+ if (rootNode instanceof ShadowRoot || rootNode instanceof Document) {
1293
+ return rootNode;
1294
+ }
1295
+ return null;
1296
+ }
1297
+ function getOrInsertCSSRule(styleParent, selectorText) {
1298
+ const cssRule = getCSSRule(styleParent, (st) => st === selectorText);
1299
+ if (cssRule)
1300
+ return cssRule;
1301
+ return insertCSSRule(styleParent, selectorText);
1302
+ }
1303
+ function getCSSRule(styleParent, predicate) {
1304
+ var _a3;
1305
+ let style;
1306
+ for (style of styleParent.querySelectorAll("style")) {
1307
+ let cssRules;
1308
+ try {
1309
+ cssRules = (_a3 = style.sheet) == null ? void 0 : _a3.cssRules;
1310
+ } catch {
1311
+ continue;
1312
+ }
1313
+ for (const rule of cssRules != null ? cssRules : []) {
1314
+ if (predicate(rule.selectorText))
1315
+ return rule;
1316
+ }
1317
+ }
1318
+ }
1319
+ function insertCSSRule(styleParent, selectorText) {
1320
+ var _a3, _b2;
1321
+ const styles = (_a3 = styleParent.querySelectorAll("style")) != null ? _a3 : [];
1322
+ const style = styles == null ? void 0 : styles[styles.length - 1];
1323
+ if (!(style == null ? void 0 : style.sheet)) {
1324
+ console.warn(
1325
+ "Media Chrome: No style sheet found on style tag of",
1326
+ styleParent
1327
+ );
1328
+ return {
1329
+ // @ts-ignore
1330
+ style: {
1331
+ setProperty: () => {
1332
+ },
1333
+ removeProperty: () => "",
1334
+ getPropertyValue: () => ""
1335
+ }
1336
+ };
1337
+ }
1338
+ style == null ? void 0 : style.sheet.insertRule(`${selectorText}{}`, style.sheet.cssRules.length);
1339
+ return (
1340
+ /** @type {CSSStyleRule} */
1341
+ (_b2 = style.sheet.cssRules) == null ? void 0 : _b2[style.sheet.cssRules.length - 1]
1342
+ );
1343
+ }
1344
+ function getNumericAttr(el, attrName, defaultValue = Number.NaN) {
1345
+ const attrVal = el.getAttribute(attrName);
1346
+ return attrVal != null ? +attrVal : defaultValue;
1347
+ }
1348
+ function setNumericAttr(el, attrName, value) {
1349
+ const nextNumericValue = +value;
1350
+ if (value == null || Number.isNaN(nextNumericValue)) {
1351
+ if (el.hasAttribute(attrName)) {
1352
+ el.removeAttribute(attrName);
1353
+ }
1354
+ return;
1355
+ }
1356
+ if (getNumericAttr(el, attrName, void 0) === nextNumericValue)
1357
+ return;
1358
+ el.setAttribute(attrName, `${nextNumericValue}`);
1359
+ }
1360
+ function getStringAttr(el, attrName, defaultValue = null) {
1361
+ var _a3;
1362
+ return (_a3 = el.getAttribute(attrName)) != null ? _a3 : defaultValue;
1363
+ }
1364
+ function setStringAttr(el, attrName, value) {
1365
+ if (value == null) {
1366
+ if (el.hasAttribute(attrName)) {
1367
+ el.removeAttribute(attrName);
1368
+ }
1369
+ return;
1370
+ }
1371
+ const nextValue = `${value}`;
1372
+ if (getStringAttr(el, attrName, void 0) === nextValue)
1373
+ return;
1374
+ el.setAttribute(attrName, nextValue);
1375
+ }
1213
1376
 
1214
1377
  // ../../node_modules/media-chrome/dist/utils/server-safe-globals.js
1215
1378
  var EventTarget2 = class {
@@ -1223,6 +1386,12 @@ var mediaThemeGerwig = (() => {
1223
1386
  };
1224
1387
  var Node = class extends EventTarget2 {
1225
1388
  };
1389
+ var Element = class extends Node {
1390
+ constructor() {
1391
+ super(...arguments);
1392
+ this.role = null;
1393
+ }
1394
+ };
1226
1395
  var ResizeObserver = class {
1227
1396
  observe() {
1228
1397
  }
@@ -1255,7 +1424,15 @@ var mediaThemeGerwig = (() => {
1255
1424
  ResizeObserver,
1256
1425
  document: documentShim,
1257
1426
  Node,
1258
- HTMLElement: class HTMLElement2 extends Node {
1427
+ Element,
1428
+ HTMLElement: class HTMLElement2 extends Element {
1429
+ constructor() {
1430
+ super(...arguments);
1431
+ this.innerHTML = "";
1432
+ }
1433
+ get content() {
1434
+ return new globalThisShim2.DocumentFragment();
1435
+ }
1259
1436
  },
1260
1437
  DocumentFragment: class DocumentFragment2 extends EventTarget2 {
1261
1438
  },
@@ -1281,15 +1458,15 @@ var mediaThemeGerwig = (() => {
1281
1458
  */
1282
1459
  setItem(key, value) {
1283
1460
  },
1284
- // eslint-disable-line no-unused-vars
1461
+ // eslint-disable-line @typescript-eslint/no-unused-vars
1285
1462
  /**
1286
1463
  * @param {string} key
1287
1464
  */
1288
1465
  removeItem(key) {
1289
1466
  }
1290
- // eslint-disable-line no-unused-vars
1467
+ // eslint-disable-line @typescript-eslint/no-unused-vars
1291
1468
  },
1292
- CustomEvent: function CustomEvent2() {
1469
+ CustomEvent: function CustomEvent3() {
1293
1470
  },
1294
1471
  getComputedStyle: function() {
1295
1472
  },
@@ -1312,15 +1489,9 @@ var mediaThemeGerwig = (() => {
1312
1489
  var isServer2 = typeof window === "undefined" || typeof window.customElements === "undefined";
1313
1490
  var isShimmed = Object.keys(globalThisShim2).every((key) => key in globalThis);
1314
1491
  var GlobalThis = isServer2 && !isShimmed ? globalThisShim2 : globalThis;
1315
- var Document = isServer2 && !isShimmed ? documentShim : globalThis.document;
1492
+ var Document2 = isServer2 && !isShimmed ? documentShim : globalThis.document;
1316
1493
 
1317
1494
  // ../../node_modules/media-chrome/dist/utils/template-parts.js
1318
- var __defProp2 = Object.defineProperty;
1319
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1320
- var __publicField = (obj, key, value) => {
1321
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
1322
- return value;
1323
- };
1324
1495
  var __accessCheck2 = (obj, member, msg) => {
1325
1496
  if (!member.has(obj))
1326
1497
  throw TypeError("Cannot " + msg);
@@ -1372,15 +1543,15 @@ var mediaThemeGerwig = (() => {
1372
1543
  }
1373
1544
  };
1374
1545
  var TemplateInstance = class extends GlobalThis.DocumentFragment {
1375
- constructor(template2, state, processor2 = defaultProcessor) {
1376
- var _a2;
1546
+ constructor(template8, state, processor2 = defaultProcessor) {
1547
+ var _a3;
1377
1548
  super();
1378
1549
  __privateAdd2(this, _parts, void 0);
1379
1550
  __privateAdd2(this, _processor, void 0);
1380
- this.append(template2.content.cloneNode(true));
1551
+ this.append(template8.content.cloneNode(true));
1381
1552
  __privateSet2(this, _parts, parse(this));
1382
1553
  __privateSet2(this, _processor, processor2);
1383
- (_a2 = processor2.createCallback) == null ? void 0 : _a2.call(processor2, this, __privateGet2(this, _parts), state);
1554
+ (_a3 = processor2.createCallback) == null ? void 0 : _a3.call(processor2, this, __privateGet2(this, _parts), state);
1384
1555
  processor2.processCallback(this, __privateGet2(this, _parts), state);
1385
1556
  }
1386
1557
  update(state) {
@@ -1391,7 +1562,7 @@ var mediaThemeGerwig = (() => {
1391
1562
  _processor = /* @__PURE__ */ new WeakMap();
1392
1563
  var parse = (element, parts = []) => {
1393
1564
  let type, value;
1394
- for (let attr of element.attributes || []) {
1565
+ for (const attr of element.attributes || []) {
1395
1566
  if (attr.value.includes("{{")) {
1396
1567
  const list = new AttrPartList();
1397
1568
  for ([type, value] of tokenize(attr.value)) {
@@ -1406,14 +1577,15 @@ var mediaThemeGerwig = (() => {
1406
1577
  attr.value = list.toString();
1407
1578
  }
1408
1579
  }
1409
- for (let node of element.childNodes) {
1580
+ for (const node of element.childNodes) {
1410
1581
  if (node.nodeType === ELEMENT && !(node instanceof HTMLTemplateElement)) {
1411
1582
  parse(node, parts);
1412
1583
  } else {
1413
- if (node.nodeType === ELEMENT || node.data.includes("{{")) {
1584
+ const data = node.data;
1585
+ if (node.nodeType === ELEMENT || data.includes("{{")) {
1414
1586
  const items = [];
1415
- if (node.data) {
1416
- for ([type, value] of tokenize(node.data))
1587
+ if (data) {
1588
+ for ([type, value] of tokenize(data))
1417
1589
  if (!type)
1418
1590
  items.push(new Text(value));
1419
1591
  else {
@@ -1541,11 +1713,10 @@ var mediaThemeGerwig = (() => {
1541
1713
  __privateGet2(this, _element).setAttributeNS(
1542
1714
  __privateGet2(this, _namespaceURI),
1543
1715
  __privateGet2(this, _attributeName),
1544
- __privateGet2(this, _list, list_get)
1716
+ __privateGet2(this, _list, list_get).toString()
1545
1717
  );
1546
1718
  }
1547
1719
  }
1548
- /** @type boolean */
1549
1720
  get booleanValue() {
1550
1721
  return __privateGet2(this, _element).hasAttributeNS(
1551
1722
  __privateGet2(this, _namespaceURI),
@@ -1611,15 +1782,14 @@ var mediaThemeGerwig = (() => {
1611
1782
  _parentNode = /* @__PURE__ */ new WeakMap();
1612
1783
  _nodes = /* @__PURE__ */ new WeakMap();
1613
1784
  var InnerTemplatePart = class extends ChildNodePart {
1614
- constructor(parentNode, template2) {
1615
- let directive = template2.getAttribute("directive") || template2.getAttribute("type");
1616
- let expression = template2.getAttribute("expression") || template2.getAttribute(directive) || "";
1785
+ constructor(parentNode, template8) {
1786
+ const directive = template8.getAttribute("directive") || template8.getAttribute("type");
1787
+ let expression = template8.getAttribute("expression") || template8.getAttribute(directive) || "";
1617
1788
  if (expression.startsWith("{{"))
1618
1789
  expression = expression.trim().slice(2, -2).trim();
1619
1790
  super(parentNode);
1620
- __publicField(this, "directive");
1621
1791
  this.expression = expression;
1622
- this.template = template2;
1792
+ this.template = template8;
1623
1793
  this.directive = directive;
1624
1794
  }
1625
1795
  };
@@ -1653,6 +1823,29 @@ var mediaThemeGerwig = (() => {
1653
1823
  }
1654
1824
 
1655
1825
  // ../../node_modules/media-chrome/dist/utils/utils.js
1826
+ function parseRenditionList(renditions) {
1827
+ return renditions == null ? void 0 : renditions.split(/\s+/).map(parseRendition);
1828
+ }
1829
+ function parseRendition(rendition) {
1830
+ if (rendition) {
1831
+ const [id, width, height] = rendition.split(":");
1832
+ return { id, width: +width, height: +height };
1833
+ }
1834
+ }
1835
+ function parseAudioTrackList(audioTracks) {
1836
+ return audioTracks == null ? void 0 : audioTracks.split(/\s+/).map(parseAudioTrack);
1837
+ }
1838
+ function parseAudioTrack(audioTrack) {
1839
+ if (audioTrack) {
1840
+ const [id, kind, language, label] = audioTrack.split(":");
1841
+ return {
1842
+ id,
1843
+ kind,
1844
+ language,
1845
+ label
1846
+ };
1847
+ }
1848
+ }
1656
1849
  function camelCase(name) {
1657
1850
  return name.replace(/[-_]([a-z])/g, ($0, $1) => $1.toUpperCase());
1658
1851
  }
@@ -1667,8 +1860,8 @@ var mediaThemeGerwig = (() => {
1667
1860
  string: (value) => String(value)
1668
1861
  };
1669
1862
  var PartialTemplate = class {
1670
- constructor(template2) {
1671
- this.template = template2;
1863
+ constructor(template8) {
1864
+ this.template = template8;
1672
1865
  this.state = void 0;
1673
1866
  }
1674
1867
  };
@@ -1679,7 +1872,7 @@ var mediaThemeGerwig = (() => {
1679
1872
  state[part.expression] = new PartialTemplate(part.template);
1680
1873
  },
1681
1874
  if: (part, state) => {
1682
- var _a2;
1875
+ var _a3;
1683
1876
  if (evaluateExpression(part.expression, state)) {
1684
1877
  if (templates.get(part) !== part.template) {
1685
1878
  templates.set(part, part.template);
@@ -1687,7 +1880,7 @@ var mediaThemeGerwig = (() => {
1687
1880
  part.replace(tpl);
1688
1881
  templateInstances.set(part, tpl);
1689
1882
  } else {
1690
- (_a2 = templateInstances.get(part)) == null ? void 0 : _a2.update(state);
1883
+ (_a3 = templateInstances.get(part)) == null ? void 0 : _a3.update(state);
1691
1884
  }
1692
1885
  } else {
1693
1886
  part.replace("");
@@ -1699,7 +1892,7 @@ var mediaThemeGerwig = (() => {
1699
1892
  var DirectiveNames = Object.keys(Directives);
1700
1893
  var processor = {
1701
1894
  processCallback(instance, parts, state) {
1702
- var _a2, _b2;
1895
+ var _a3, _b2;
1703
1896
  if (!state)
1704
1897
  return;
1705
1898
  for (const [expression, part] of parts) {
@@ -1713,7 +1906,7 @@ var mediaThemeGerwig = (() => {
1713
1906
  part.expression = part.template.getAttribute(directive);
1714
1907
  }
1715
1908
  }
1716
- (_a2 = Directives[part.directive]) == null ? void 0 : _a2.call(Directives, part, state);
1909
+ (_a3 = Directives[part.directive]) == null ? void 0 : _a3.call(Directives, part, state);
1717
1910
  continue;
1718
1911
  }
1719
1912
  let value = evaluateExpression(expression, state);
@@ -1770,8 +1963,8 @@ var mediaThemeGerwig = (() => {
1770
1963
  "<=": (a, b) => a <= b,
1771
1964
  "??": (a, b) => a != null ? a : b,
1772
1965
  "|": (a, b) => {
1773
- var _a2;
1774
- return (_a2 = pipeModifiers[b]) == null ? void 0 : _a2.call(pipeModifiers, a);
1966
+ var _a3;
1967
+ return (_a3 = pipeModifiers[b]) == null ? void 0 : _a3.call(pipeModifiers, a);
1775
1968
  }
1776
1969
  };
1777
1970
  function tokenizeExpression(expr) {
@@ -1785,12 +1978,12 @@ var mediaThemeGerwig = (() => {
1785
1978
  }).filter(({ type }) => type !== "ws");
1786
1979
  }
1787
1980
  function evaluateExpression(expr, state = {}) {
1788
- var _a2, _b2, _c, _d, _e, _f, _g;
1981
+ var _a3, _b2, _c, _d, _e, _f, _g;
1789
1982
  const tokens = tokenizeExpression(expr);
1790
1983
  if (tokens.length === 0 || tokens.some(({ type }) => !type)) {
1791
1984
  return invalidExpression(expr);
1792
1985
  }
1793
- if (((_a2 = tokens[0]) == null ? void 0 : _a2.token) === ">") {
1986
+ if (((_a3 = tokens[0]) == null ? void 0 : _a3.token) === ">") {
1794
1987
  const partial = state[(_b2 = tokens[1]) == null ? void 0 : _b2.token];
1795
1988
  if (!partial) {
1796
1989
  return invalidExpression(expr);
@@ -1859,11 +2052,12 @@ var mediaThemeGerwig = (() => {
1859
2052
  return state[raw];
1860
2053
  }
1861
2054
  function tokenize2(str, parsers) {
1862
- let len, match, token, tokens = [];
2055
+ let len, match, token;
2056
+ const tokens = [];
1863
2057
  while (str) {
1864
2058
  token = null;
1865
2059
  len = str.length;
1866
- for (let key in parsers) {
2060
+ for (const key in parsers) {
1867
2061
  match = parsers[key].exec(str);
1868
2062
  if (match && match.index < len) {
1869
2063
  token = {
@@ -1889,12 +2083,6 @@ var mediaThemeGerwig = (() => {
1889
2083
  }
1890
2084
 
1891
2085
  // ../../node_modules/media-chrome/dist/media-theme-element.js
1892
- var __defProp3 = Object.defineProperty;
1893
- var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1894
- var __publicField2 = (obj, key, value) => {
1895
- __defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value);
1896
- return value;
1897
- };
1898
2086
  var __accessCheck3 = (obj, member, msg) => {
1899
2087
  if (!member.has(obj))
1900
2088
  throw TypeError("Cannot " + msg);
@@ -1928,13 +2116,16 @@ var mediaThemeGerwig = (() => {
1928
2116
  mediatargetlivewindow: "targetlivewindow",
1929
2117
  mediastreamtype: "streamtype"
1930
2118
  };
1931
- var prependTemplate = Document.createElement("template");
2119
+ var prependTemplate = Document2.createElement("template");
1932
2120
  prependTemplate.innerHTML = /*html*/
1933
2121
  `
1934
2122
  <style>
1935
2123
  :host {
1936
2124
  display: inline-block;
1937
2125
  line-height: 0;
2126
+
2127
+ /* Hide theme element until the breakpoints are available to avoid flicker. */
2128
+ visibility: hidden;
1938
2129
  }
1939
2130
 
1940
2131
  media-controller {
@@ -1942,10 +2133,13 @@ var mediaThemeGerwig = (() => {
1942
2133
  height: 100%;
1943
2134
  }
1944
2135
 
1945
- media-controller:not([mediasubtitleslist]) media-captions-selectmenu,
1946
2136
  media-captions-button:not([mediasubtitleslist]),
1947
- media-rendition-selectmenu[mediarenditionunavailable],
1948
- media-audio-track-selectmenu[mediaaudiotrackunavailable],
2137
+ media-captions-menu:not([mediasubtitleslist]),
2138
+ media-captions-menu-button:not([mediasubtitleslist]),
2139
+ media-audio-track-menu[mediaaudiotrackunavailable],
2140
+ media-audio-track-menu-button[mediaaudiotrackunavailable],
2141
+ media-rendition-menu[mediarenditionunavailable],
2142
+ media-rendition-menu-button[mediarenditionunavailable],
1949
2143
  media-volume-range[mediavolumeunavailable],
1950
2144
  media-airplay-button[mediaairplayunavailable],
1951
2145
  media-fullscreen-button[mediafullscreenunavailable],
@@ -1960,8 +2154,6 @@ var mediaThemeGerwig = (() => {
1960
2154
  super();
1961
2155
  __privateAdd3(this, _upgradeProperty);
1962
2156
  __privateAdd3(this, _updateTemplate);
1963
- __publicField2(this, "renderRoot");
1964
- __publicField2(this, "renderer");
1965
2157
  __privateAdd3(this, _template, void 0);
1966
2158
  __privateAdd3(this, _prevTemplate, void 0);
1967
2159
  __privateAdd3(this, _prevTemplateId, void 0);
@@ -1971,15 +2163,12 @@ var mediaThemeGerwig = (() => {
1971
2163
  this.renderRoot = this.attachShadow({ mode: "open" });
1972
2164
  this.createRenderer();
1973
2165
  }
1974
- const observer = new MutationObserver((mutationList) => {
1975
- var _a2;
1976
- if (this.mediaController && !((_a2 = this.mediaController) == null ? void 0 : _a2.breakpointsComputed))
2166
+ const observer2 = new MutationObserver((mutationList) => {
2167
+ var _a3;
2168
+ if (this.mediaController && !((_a3 = this.mediaController) == null ? void 0 : _a3.breakpointsComputed))
1977
2169
  return;
1978
2170
  if (mutationList.some((mutation) => {
1979
- const target = (
1980
- /** @type {HTMLElement} */
1981
- mutation.target
1982
- );
2171
+ const target = mutation.target;
1983
2172
  if (target === this)
1984
2173
  return true;
1985
2174
  if (target.localName !== "media-controller")
@@ -1993,8 +2182,8 @@ var mediaThemeGerwig = (() => {
1993
2182
  this.render();
1994
2183
  }
1995
2184
  });
1996
- observer.observe(this, { attributes: true });
1997
- observer.observe(this.renderRoot, {
2185
+ observer2.observe(this, { attributes: true });
2186
+ observer2.observe(this.renderRoot, {
1998
2187
  attributes: true,
1999
2188
  subtree: true
2000
2189
  });
@@ -2009,8 +2198,8 @@ var mediaThemeGerwig = (() => {
2009
2198
  return this.renderRoot.querySelector("media-controller");
2010
2199
  }
2011
2200
  get template() {
2012
- var _a2;
2013
- return (_a2 = __privateGet3(this, _template)) != null ? _a2 : this.constructor.template;
2201
+ var _a3;
2202
+ return (_a3 = __privateGet3(this, _template)) != null ? _a3 : this.constructor.template;
2014
2203
  }
2015
2204
  set template(element) {
2016
2205
  __privateSet3(this, _prevTemplateId, null);
@@ -2018,9 +2207,9 @@ var mediaThemeGerwig = (() => {
2018
2207
  this.createRenderer();
2019
2208
  }
2020
2209
  get props() {
2021
- var _a2, _b2, _c;
2210
+ var _a3, _b2, _c;
2022
2211
  const observedAttributes = [
2023
- ...Array.from((_b2 = (_a2 = this.mediaController) == null ? void 0 : _a2.attributes) != null ? _b2 : []).filter(
2212
+ ...Array.from((_b2 = (_a3 = this.mediaController) == null ? void 0 : _a3.attributes) != null ? _b2 : []).filter(
2024
2213
  ({ name }) => {
2025
2214
  return observedMediaAttributes[name] || name.startsWith("breakpoint");
2026
2215
  }
@@ -2028,7 +2217,7 @@ var mediaThemeGerwig = (() => {
2028
2217
  ...Array.from(this.attributes)
2029
2218
  ];
2030
2219
  const props = {};
2031
- for (let attr of observedAttributes) {
2220
+ for (const attr of observedAttributes) {
2032
2221
  const name = (_c = observedMediaAttributes[attr.name]) != null ? _c : camelCase(attr.name);
2033
2222
  let { value } = attr;
2034
2223
  if (value != null) {
@@ -2067,8 +2256,12 @@ var mediaThemeGerwig = (() => {
2067
2256
  }
2068
2257
  }
2069
2258
  render() {
2070
- var _a2;
2071
- (_a2 = this.renderer) == null ? void 0 : _a2.update(this.props);
2259
+ var _a3;
2260
+ (_a3 = this.renderer) == null ? void 0 : _a3.update(this.props);
2261
+ const { style } = getOrInsertCSSRule(this.renderRoot, ":host");
2262
+ if (style.visibility === "hidden") {
2263
+ style.removeProperty("visibility");
2264
+ }
2072
2265
  }
2073
2266
  };
2074
2267
  _template = /* @__PURE__ */ new WeakMap();
@@ -2084,34 +2277,30 @@ var mediaThemeGerwig = (() => {
2084
2277
  };
2085
2278
  _updateTemplate = /* @__PURE__ */ new WeakSet();
2086
2279
  updateTemplate_fn = function() {
2087
- var _a2;
2280
+ var _a3;
2088
2281
  const templateId = this.getAttribute("template");
2089
2282
  if (!templateId || templateId === __privateGet3(this, _prevTemplateId))
2090
2283
  return;
2091
- const rootNode = (
2092
- /** @type HTMLDocument | ShadowRoot */
2093
- this.getRootNode()
2094
- );
2095
- const template2 = (_a2 = rootNode == null ? void 0 : rootNode.getElementById) == null ? void 0 : _a2.call(rootNode, templateId);
2096
- if (template2) {
2284
+ const rootNode = this.getRootNode();
2285
+ const template8 = (_a3 = rootNode == null ? void 0 : rootNode.getElementById) == null ? void 0 : _a3.call(rootNode, templateId);
2286
+ if (template8) {
2097
2287
  __privateSet3(this, _prevTemplateId, templateId);
2098
- __privateSet3(this, _template, template2);
2288
+ __privateSet3(this, _template, template8);
2099
2289
  this.createRenderer();
2100
2290
  return;
2101
2291
  }
2102
2292
  if (isValidUrl(templateId)) {
2103
2293
  __privateSet3(this, _prevTemplateId, templateId);
2104
2294
  request(templateId).then((data) => {
2105
- const template22 = Document.createElement("template");
2295
+ const template22 = Document2.createElement("template");
2106
2296
  template22.innerHTML = data;
2107
2297
  __privateSet3(this, _template, template22);
2108
2298
  this.createRenderer();
2109
2299
  }).catch(console.error);
2110
2300
  }
2111
2301
  };
2112
- __publicField2(MediaThemeElement, "template");
2113
- __publicField2(MediaThemeElement, "observedAttributes", ["template"]);
2114
- __publicField2(MediaThemeElement, "processor", processor);
2302
+ MediaThemeElement.observedAttributes = ["template"];
2303
+ MediaThemeElement.processor = processor;
2115
2304
  function isValidUrl(url) {
2116
2305
  if (!/^(\/|\.\/|https?:\/\/)/.test(url))
2117
2306
  return false;
@@ -2136,14 +2325,3121 @@ var mediaThemeGerwig = (() => {
2136
2325
  GlobalThis.customElements.define("media-theme", MediaThemeElement);
2137
2326
  }
2138
2327
 
2328
+ // ../../node_modules/media-chrome/dist/utils/anchor-utils.js
2329
+ function computePosition({
2330
+ anchor,
2331
+ floating,
2332
+ placement
2333
+ }) {
2334
+ const rects = getElementRects({ anchor, floating });
2335
+ const { x, y } = computeCoordsFromPlacement(rects, placement);
2336
+ return { x, y };
2337
+ }
2338
+ function getElementRects({
2339
+ anchor,
2340
+ floating
2341
+ }) {
2342
+ return {
2343
+ anchor: getRectRelativeToOffsetParent(anchor, floating.offsetParent),
2344
+ floating: {
2345
+ x: 0,
2346
+ y: 0,
2347
+ width: floating.offsetWidth,
2348
+ height: floating.offsetHeight
2349
+ }
2350
+ };
2351
+ }
2352
+ function getRectRelativeToOffsetParent(element, offsetParent) {
2353
+ const rect = element.getBoundingClientRect();
2354
+ const offsetRect = offsetParent.getBoundingClientRect();
2355
+ return {
2356
+ x: rect.x - offsetRect.x,
2357
+ y: rect.y - offsetRect.y,
2358
+ width: rect.width,
2359
+ height: rect.height
2360
+ };
2361
+ }
2362
+ function computeCoordsFromPlacement({ anchor, floating }, placement) {
2363
+ const alignmentAxis = getSideAxis(placement) === "x" ? "y" : "x";
2364
+ const alignLength = alignmentAxis === "y" ? "height" : "width";
2365
+ const side = getSide(placement);
2366
+ const commonX = anchor.x + anchor.width / 2 - floating.width / 2;
2367
+ const commonY = anchor.y + anchor.height / 2 - floating.height / 2;
2368
+ const commonAlign = anchor[alignLength] / 2 - floating[alignLength] / 2;
2369
+ let coords;
2370
+ switch (side) {
2371
+ case "top":
2372
+ coords = { x: commonX, y: anchor.y - floating.height };
2373
+ break;
2374
+ case "bottom":
2375
+ coords = { x: commonX, y: anchor.y + anchor.height };
2376
+ break;
2377
+ case "right":
2378
+ coords = { x: anchor.x + anchor.width, y: commonY };
2379
+ break;
2380
+ case "left":
2381
+ coords = { x: anchor.x - floating.width, y: commonY };
2382
+ break;
2383
+ default:
2384
+ coords = { x: anchor.x, y: anchor.y };
2385
+ }
2386
+ switch (placement.split("-")[1]) {
2387
+ case "start":
2388
+ coords[alignmentAxis] -= commonAlign;
2389
+ break;
2390
+ case "end":
2391
+ coords[alignmentAxis] += commonAlign;
2392
+ break;
2393
+ }
2394
+ return coords;
2395
+ }
2396
+ function getSide(placement) {
2397
+ return placement.split("-")[0];
2398
+ }
2399
+ function getSideAxis(placement) {
2400
+ return ["top", "bottom"].includes(getSide(placement)) ? "y" : "x";
2401
+ }
2402
+
2403
+ // ../../node_modules/media-chrome/dist/utils/resize-observer.js
2404
+ var callbacksMap = /* @__PURE__ */ new WeakMap();
2405
+ var getCallbacks = (element) => {
2406
+ let callbacks = callbacksMap.get(element);
2407
+ if (!callbacks)
2408
+ callbacksMap.set(element, callbacks = /* @__PURE__ */ new Set());
2409
+ return callbacks;
2410
+ };
2411
+ var observer = new GlobalThis.ResizeObserver(
2412
+ (entries) => {
2413
+ for (const entry of entries) {
2414
+ for (const callback of getCallbacks(entry.target)) {
2415
+ callback(entry);
2416
+ }
2417
+ }
2418
+ }
2419
+ );
2420
+ function observeResize(element, callback) {
2421
+ getCallbacks(element).add(callback);
2422
+ observer.observe(element);
2423
+ }
2424
+ function unobserveResize(element, callback) {
2425
+ const callbacks = getCallbacks(element);
2426
+ callbacks.delete(callback);
2427
+ if (!callbacks.size) {
2428
+ observer.unobserve(element);
2429
+ }
2430
+ }
2431
+
2432
+ // ../../node_modules/media-chrome/dist/utils/events.js
2433
+ var InvokeEvent = class extends Event {
2434
+ /**
2435
+ * @param init - The event options.
2436
+ */
2437
+ constructor({ action = "auto", relatedTarget, ...options }) {
2438
+ super("invoke", options);
2439
+ this.action = action;
2440
+ this.relatedTarget = relatedTarget;
2441
+ }
2442
+ };
2443
+ var ToggleEvent = class extends Event {
2444
+ /**
2445
+ * @param init - The event options.
2446
+ */
2447
+ constructor({ newState, oldState, ...options }) {
2448
+ super("toggle", options);
2449
+ this.newState = newState;
2450
+ this.oldState = oldState;
2451
+ }
2452
+ };
2453
+
2454
+ // ../../node_modules/media-chrome/dist/menu/media-chrome-menu.js
2455
+ var __accessCheck4 = (obj, member, msg) => {
2456
+ if (!member.has(obj))
2457
+ throw TypeError("Cannot " + msg);
2458
+ };
2459
+ var __privateGet4 = (obj, member, getter) => {
2460
+ __accessCheck4(obj, member, "read from private field");
2461
+ return getter ? getter.call(obj) : member.get(obj);
2462
+ };
2463
+ var __privateAdd4 = (obj, member, value) => {
2464
+ if (member.has(obj))
2465
+ throw TypeError("Cannot add the same private member more than once");
2466
+ member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
2467
+ };
2468
+ var __privateSet4 = (obj, member, value, setter) => {
2469
+ __accessCheck4(obj, member, "write to private field");
2470
+ setter ? setter.call(obj, value) : member.set(obj, value);
2471
+ return value;
2472
+ };
2473
+ var __privateMethod2 = (obj, member, method) => {
2474
+ __accessCheck4(obj, member, "access private method");
2475
+ return method;
2476
+ };
2477
+ var _mediaController;
2478
+ var _previouslyFocused;
2479
+ var _invokerElement;
2480
+ var _previousItems;
2481
+ var _mutationObserver;
2482
+ var _isPopover;
2483
+ var _handleSlotChange;
2484
+ var handleSlotChange_fn;
2485
+ var _handleMenuItems;
2486
+ var _updateLayoutStyle;
2487
+ var updateLayoutStyle_fn;
2488
+ var _handleInvoke;
2489
+ var handleInvoke_fn;
2490
+ var _handleOpen;
2491
+ var handleOpen_fn;
2492
+ var _handleClosed;
2493
+ var handleClosed_fn;
2494
+ var _handleBoundsResize;
2495
+ var _handleMenuResize;
2496
+ var _positionMenu;
2497
+ var positionMenu_fn;
2498
+ var _resizeMenu;
2499
+ var resizeMenu_fn;
2500
+ var _handleClick;
2501
+ var handleClick_fn;
2502
+ var _backButtonElement;
2503
+ var backButtonElement_get;
2504
+ var _handleToggle;
2505
+ var handleToggle_fn;
2506
+ var _checkSubmenuHasExpanded;
2507
+ var checkSubmenuHasExpanded_fn;
2508
+ var _handleFocusOut;
2509
+ var handleFocusOut_fn;
2510
+ var _handleKeyDown;
2511
+ var handleKeyDown_fn;
2512
+ var _getItem;
2513
+ var getItem_fn;
2514
+ var _getTabItem;
2515
+ var getTabItem_fn;
2516
+ var _setTabItem;
2517
+ var setTabItem_fn;
2518
+ var _selectItem;
2519
+ var selectItem_fn;
2520
+ function createMenuItem({
2521
+ type,
2522
+ text,
2523
+ value,
2524
+ checked
2525
+ }) {
2526
+ const item = Document2.createElement(
2527
+ "media-chrome-menu-item"
2528
+ );
2529
+ item.type = type != null ? type : "";
2530
+ item.part.add("menu-item");
2531
+ if (type)
2532
+ item.part.add(type);
2533
+ item.value = value;
2534
+ item.checked = checked;
2535
+ const label = Document2.createElement("span");
2536
+ label.textContent = text;
2537
+ item.append(label);
2538
+ return item;
2539
+ }
2540
+ function createIndicator(el, name) {
2541
+ let customIndicator = el.querySelector(`:scope > [slot="${name}"]`);
2542
+ if ((customIndicator == null ? void 0 : customIndicator.nodeName) == "SLOT")
2543
+ customIndicator = customIndicator.assignedElements({ flatten: true })[0];
2544
+ if (customIndicator) {
2545
+ customIndicator = customIndicator.cloneNode(true);
2546
+ return customIndicator;
2547
+ }
2548
+ const fallbackIndicator = el.shadowRoot.querySelector(
2549
+ `[name="${name}"] > svg`
2550
+ );
2551
+ if (fallbackIndicator) {
2552
+ return fallbackIndicator.cloneNode(true);
2553
+ }
2554
+ return "";
2555
+ }
2556
+ var template = Document2.createElement("template");
2557
+ template.innerHTML = /*html*/
2558
+ `
2559
+ <style>
2560
+ :host {
2561
+ font: var(--media-font,
2562
+ var(--media-font-weight, normal)
2563
+ var(--media-font-size, 14px) /
2564
+ var(--media-text-content-height, var(--media-control-height, 24px))
2565
+ var(--media-font-family, helvetica neue, segoe ui, roboto, arial, sans-serif));
2566
+ color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));
2567
+ background: var(--media-menu-background, var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .8))));
2568
+ border-radius: var(--media-menu-border-radius);
2569
+ border: var(--media-menu-border, none);
2570
+ display: var(--media-menu-display, inline-flex);
2571
+ transition: var(--media-menu-transition-in,
2572
+ visibility 0s,
2573
+ opacity .2s ease-out,
2574
+ transform .15s ease-out,
2575
+ left .2s ease-in-out,
2576
+ min-width .2s ease-in-out,
2577
+ min-height .2s ease-in-out
2578
+ ) !important;
2579
+ ${/* ^^Prevent transition override by media-container */
2580
+ ""}
2581
+ visibility: var(--media-menu-visibility, visible);
2582
+ opacity: var(--media-menu-opacity, 1);
2583
+ max-height: var(--media-menu-max-height, var(--_menu-max-height, 300px));
2584
+ transform: var(--media-menu-transform-in, translateY(0) scale(1));
2585
+ flex-direction: column;
2586
+ ${/* Prevent overflowing a flex container */
2587
+ ""}
2588
+ min-height: 0;
2589
+ position: relative;
2590
+ box-sizing: border-box;
2591
+ }
2592
+
2593
+ :host([hidden]) {
2594
+ transition: var(--media-menu-transition-out,
2595
+ visibility .15s ease-in,
2596
+ opacity .15s ease-in,
2597
+ transform .15s ease-in
2598
+ ) !important;
2599
+ visibility: var(--media-menu-hidden-visibility, hidden);
2600
+ opacity: var(--media-menu-hidden-opacity, 0);
2601
+ max-height: var(--media-menu-hidden-max-height,
2602
+ var(--media-menu-max-height, var(--_menu-max-height, 300px)));
2603
+ transform: var(--media-menu-transform-out, translateY(2px) scale(.99));
2604
+ pointer-events: none;
2605
+ }
2606
+
2607
+ :host([slot="submenu"]) {
2608
+ background: none;
2609
+ width: 100%;
2610
+ min-height: 100%;
2611
+ position: absolute;
2612
+ bottom: 0;
2613
+ right: -100%;
2614
+ }
2615
+
2616
+ #container {
2617
+ display: flex;
2618
+ flex-direction: column;
2619
+ min-height: 0;
2620
+ transition: transform .2s ease-out;
2621
+ transform: translate(0, 0);
2622
+ }
2623
+
2624
+ #container.has-expanded {
2625
+ transition: transform .2s ease-in;
2626
+ transform: translate(-100%, 0);
2627
+ }
2628
+
2629
+ slot[name="header"] {
2630
+ display: flex;
2631
+ padding: .4em .7em;
2632
+ border-bottom: 1px solid rgb(255 255 255 / .25);
2633
+ cursor: default;
2634
+ }
2635
+
2636
+ slot[name="header"][hidden] {
2637
+ display: none;
2638
+ }
2639
+
2640
+ button[part~="back"] {
2641
+ background: none;
2642
+ color: inherit;
2643
+ border: none;
2644
+ padding: 0;
2645
+ font: inherit;
2646
+ cursor: pointer;
2647
+ outline: inherit;
2648
+ display: inline-flex;
2649
+ align-items: center;
2650
+ cursor: pointer;
2651
+ }
2652
+
2653
+ svg[part~="back"] {
2654
+ height: var(--media-menu-icon-height, var(--media-control-height, 24px));
2655
+ fill: var(--media-icon-color, var(--media-primary-color, rgb(238 238 238)));
2656
+ display: block;
2657
+ margin-right: .5ch;
2658
+ }
2659
+
2660
+ slot:not([name]) {
2661
+ gap: var(--media-menu-gap);
2662
+ flex-direction: var(--media-menu-flex-direction, column);
2663
+ overflow: var(--media-menu-overflow, hidden auto);
2664
+ display: flex;
2665
+ min-height: 0;
2666
+ }
2667
+
2668
+ :host([role="menu"]) slot:not([name]) {
2669
+ padding-block: .4em;
2670
+ }
2671
+
2672
+ slot:not([name])::slotted([role="menu"]) {
2673
+ background: none;
2674
+ }
2675
+
2676
+ media-chrome-menu-item > span {
2677
+ margin-right: .5ch;
2678
+ max-width: var(--media-menu-item-max-width);
2679
+ text-overflow: ellipsis;
2680
+ overflow: hidden;
2681
+ }
2682
+ </style>
2683
+ <style id="layout-row" media="width:0">
2684
+
2685
+ slot[name="header"] {
2686
+ padding: .4em .5em;
2687
+ }
2688
+
2689
+ slot:not([name]) {
2690
+ gap: var(--media-menu-gap, .25em);
2691
+ flex-direction: var(--media-menu-flex-direction, row);
2692
+ padding-inline: .5em;
2693
+ }
2694
+
2695
+ media-chrome-menu-item {
2696
+ padding: .3em .5em;
2697
+ }
2698
+
2699
+ media-chrome-menu-item[aria-checked="true"] {
2700
+ background: var(--media-menu-item-checked-background, rgb(255 255 255 / .2));
2701
+ }
2702
+
2703
+ ${/* In row layout hide the checked indicator completely. */
2704
+ ""}
2705
+ media-chrome-menu-item::part(checked-indicator) {
2706
+ display: var(--media-menu-item-checked-indicator-display, none);
2707
+ }
2708
+ </style>
2709
+ <div id="container">
2710
+ <slot name="header" hidden>
2711
+ <button part="back button" aria-label="Back to previous menu">
2712
+ <slot name="back-icon">
2713
+ <svg aria-hidden="true" viewBox="0 0 20 24" part="back indicator">
2714
+ <path d="m11.88 17.585.742-.669-4.2-4.665 4.2-4.666-.743-.669-4.803 5.335 4.803 5.334Z"/>
2715
+ </svg>
2716
+ </slot>
2717
+ <slot name="title"></slot>
2718
+ </button>
2719
+ </slot>
2720
+ <slot></slot>
2721
+ </div>
2722
+ <slot name="checked-indicator" hidden></slot>
2723
+ `;
2724
+ var Attributes = {
2725
+ STYLE: "style",
2726
+ HIDDEN: "hidden",
2727
+ DISABLED: "disabled",
2728
+ ANCHOR: "anchor"
2729
+ };
2730
+ var MediaChromeMenu = class extends GlobalThis.HTMLElement {
2731
+ constructor() {
2732
+ super();
2733
+ __privateAdd4(this, _handleSlotChange);
2734
+ __privateAdd4(this, _updateLayoutStyle);
2735
+ __privateAdd4(this, _handleInvoke);
2736
+ __privateAdd4(this, _handleOpen);
2737
+ __privateAdd4(this, _handleClosed);
2738
+ __privateAdd4(this, _positionMenu);
2739
+ __privateAdd4(this, _resizeMenu);
2740
+ __privateAdd4(this, _handleClick);
2741
+ __privateAdd4(this, _backButtonElement);
2742
+ __privateAdd4(this, _handleToggle);
2743
+ __privateAdd4(this, _checkSubmenuHasExpanded);
2744
+ __privateAdd4(this, _handleFocusOut);
2745
+ __privateAdd4(this, _handleKeyDown);
2746
+ __privateAdd4(this, _getItem);
2747
+ __privateAdd4(this, _getTabItem);
2748
+ __privateAdd4(this, _setTabItem);
2749
+ __privateAdd4(this, _selectItem);
2750
+ __privateAdd4(this, _mediaController, null);
2751
+ __privateAdd4(this, _previouslyFocused, null);
2752
+ __privateAdd4(this, _invokerElement, null);
2753
+ __privateAdd4(this, _previousItems, /* @__PURE__ */ new Set());
2754
+ __privateAdd4(this, _mutationObserver, void 0);
2755
+ __privateAdd4(this, _isPopover, false);
2756
+ __privateAdd4(this, _handleMenuItems, () => {
2757
+ const previousItems = __privateGet4(this, _previousItems);
2758
+ const currentItems = new Set(this.items);
2759
+ for (const item of previousItems) {
2760
+ if (!currentItems.has(item)) {
2761
+ this.dispatchEvent(new CustomEvent("removemenuitem", { detail: item }));
2762
+ }
2763
+ }
2764
+ for (const item of currentItems) {
2765
+ if (!previousItems.has(item)) {
2766
+ this.dispatchEvent(new CustomEvent("addmenuitem", { detail: item }));
2767
+ }
2768
+ }
2769
+ __privateSet4(this, _previousItems, currentItems);
2770
+ });
2771
+ __privateAdd4(this, _handleBoundsResize, () => {
2772
+ __privateMethod2(this, _positionMenu, positionMenu_fn).call(this, false);
2773
+ __privateMethod2(this, _resizeMenu, resizeMenu_fn).call(this, false);
2774
+ });
2775
+ __privateAdd4(this, _handleMenuResize, () => {
2776
+ __privateMethod2(this, _positionMenu, positionMenu_fn).call(this, false);
2777
+ });
2778
+ if (!this.shadowRoot) {
2779
+ this.attachShadow({ mode: "open" });
2780
+ this.nativeEl = this.constructor.template.content.cloneNode(true);
2781
+ this.shadowRoot.append(this.nativeEl);
2782
+ }
2783
+ this.container = this.shadowRoot.querySelector("#container");
2784
+ this.defaultSlot = this.shadowRoot.querySelector(
2785
+ "slot:not([name])"
2786
+ );
2787
+ this.shadowRoot.addEventListener("slotchange", this);
2788
+ __privateSet4(this, _mutationObserver, new MutationObserver(__privateGet4(this, _handleMenuItems)));
2789
+ __privateGet4(this, _mutationObserver).observe(this.defaultSlot, { childList: true });
2790
+ }
2791
+ static get observedAttributes() {
2792
+ return [
2793
+ Attributes.DISABLED,
2794
+ Attributes.HIDDEN,
2795
+ Attributes.STYLE,
2796
+ Attributes.ANCHOR,
2797
+ MediaStateReceiverAttributes.MEDIA_CONTROLLER
2798
+ ];
2799
+ }
2800
+ static formatMenuItemText(text) {
2801
+ return text;
2802
+ }
2803
+ enable() {
2804
+ this.addEventListener("click", this);
2805
+ this.addEventListener("focusout", this);
2806
+ this.addEventListener("keydown", this);
2807
+ this.addEventListener("invoke", this);
2808
+ this.addEventListener("toggle", this);
2809
+ }
2810
+ disable() {
2811
+ this.removeEventListener("click", this);
2812
+ this.removeEventListener("focusout", this);
2813
+ this.removeEventListener("keyup", this);
2814
+ this.removeEventListener("invoke", this);
2815
+ this.removeEventListener("toggle", this);
2816
+ }
2817
+ handleEvent(event) {
2818
+ switch (event.type) {
2819
+ case "slotchange":
2820
+ __privateMethod2(this, _handleSlotChange, handleSlotChange_fn).call(this, event);
2821
+ break;
2822
+ case "invoke":
2823
+ __privateMethod2(this, _handleInvoke, handleInvoke_fn).call(this, event);
2824
+ break;
2825
+ case "click":
2826
+ __privateMethod2(this, _handleClick, handleClick_fn).call(this, event);
2827
+ break;
2828
+ case "toggle":
2829
+ __privateMethod2(this, _handleToggle, handleToggle_fn).call(this, event);
2830
+ break;
2831
+ case "focusout":
2832
+ __privateMethod2(this, _handleFocusOut, handleFocusOut_fn).call(this, event);
2833
+ break;
2834
+ case "keydown":
2835
+ __privateMethod2(this, _handleKeyDown, handleKeyDown_fn).call(this, event);
2836
+ break;
2837
+ }
2838
+ }
2839
+ connectedCallback() {
2840
+ var _a3, _b2;
2841
+ __privateMethod2(this, _updateLayoutStyle, updateLayoutStyle_fn).call(this);
2842
+ if (!this.hasAttribute("disabled")) {
2843
+ this.enable();
2844
+ }
2845
+ if (!this.role) {
2846
+ this.role = "menu";
2847
+ }
2848
+ __privateSet4(this, _mediaController, getAttributeMediaController(this));
2849
+ (_b2 = (_a3 = __privateGet4(this, _mediaController)) == null ? void 0 : _a3.associateElement) == null ? void 0 : _b2.call(_a3, this);
2850
+ if (!this.hidden) {
2851
+ observeResize(getBoundsElement(this), __privateGet4(this, _handleBoundsResize));
2852
+ observeResize(this, __privateGet4(this, _handleMenuResize));
2853
+ }
2854
+ }
2855
+ disconnectedCallback() {
2856
+ var _a3, _b2;
2857
+ unobserveResize(getBoundsElement(this), __privateGet4(this, _handleBoundsResize));
2858
+ unobserveResize(this, __privateGet4(this, _handleMenuResize));
2859
+ this.disable();
2860
+ (_b2 = (_a3 = __privateGet4(this, _mediaController)) == null ? void 0 : _a3.unassociateElement) == null ? void 0 : _b2.call(_a3, this);
2861
+ __privateSet4(this, _mediaController, null);
2862
+ }
2863
+ attributeChangedCallback(attrName, oldValue, newValue) {
2864
+ var _a3, _b2, _c, _d;
2865
+ if (attrName === Attributes.HIDDEN && newValue !== oldValue) {
2866
+ if (!__privateGet4(this, _isPopover))
2867
+ __privateSet4(this, _isPopover, true);
2868
+ if (this.hidden) {
2869
+ __privateMethod2(this, _handleClosed, handleClosed_fn).call(this);
2870
+ } else {
2871
+ __privateMethod2(this, _handleOpen, handleOpen_fn).call(this);
2872
+ }
2873
+ this.dispatchEvent(
2874
+ new ToggleEvent({
2875
+ oldState: this.hidden ? "open" : "closed",
2876
+ newState: this.hidden ? "closed" : "open",
2877
+ bubbles: true
2878
+ })
2879
+ );
2880
+ } else if (attrName === MediaStateReceiverAttributes.MEDIA_CONTROLLER) {
2881
+ if (oldValue) {
2882
+ (_b2 = (_a3 = __privateGet4(this, _mediaController)) == null ? void 0 : _a3.unassociateElement) == null ? void 0 : _b2.call(_a3, this);
2883
+ __privateSet4(this, _mediaController, null);
2884
+ }
2885
+ if (newValue && this.isConnected) {
2886
+ __privateSet4(this, _mediaController, getAttributeMediaController(this));
2887
+ (_d = (_c = __privateGet4(this, _mediaController)) == null ? void 0 : _c.associateElement) == null ? void 0 : _d.call(_c, this);
2888
+ }
2889
+ } else if (attrName === Attributes.DISABLED && newValue !== oldValue) {
2890
+ if (newValue == null) {
2891
+ this.enable();
2892
+ } else {
2893
+ this.disable();
2894
+ }
2895
+ } else if (attrName === Attributes.STYLE && newValue !== oldValue) {
2896
+ __privateMethod2(this, _updateLayoutStyle, updateLayoutStyle_fn).call(this);
2897
+ }
2898
+ }
2899
+ formatMenuItemText(text, data) {
2900
+ return this.constructor.formatMenuItemText(text, data);
2901
+ }
2902
+ get anchor() {
2903
+ return this.getAttribute("anchor");
2904
+ }
2905
+ set anchor(value) {
2906
+ this.setAttribute("anchor", `${value}`);
2907
+ }
2908
+ /**
2909
+ * Returns the anchor element when it is a floating menu.
2910
+ */
2911
+ get anchorElement() {
2912
+ var _a3;
2913
+ if (this.anchor) {
2914
+ return (_a3 = getDocumentOrShadowRoot(this)) == null ? void 0 : _a3.querySelector(`#${this.anchor}`);
2915
+ }
2916
+ return null;
2917
+ }
2918
+ /**
2919
+ * Returns the menu items.
2920
+ */
2921
+ get items() {
2922
+ return this.defaultSlot.assignedElements({ flatten: true }).filter(isMenuItem);
2923
+ }
2924
+ get radioGroupItems() {
2925
+ return this.items.filter((item) => item.role === "menuitemradio");
2926
+ }
2927
+ get checkedItems() {
2928
+ return this.items.filter((item) => item.checked);
2929
+ }
2930
+ get value() {
2931
+ var _a3, _b2;
2932
+ return (_b2 = (_a3 = this.checkedItems[0]) == null ? void 0 : _a3.value) != null ? _b2 : "";
2933
+ }
2934
+ set value(newValue) {
2935
+ const item = this.items.find((item2) => item2.value === newValue);
2936
+ if (!item)
2937
+ return;
2938
+ __privateMethod2(this, _selectItem, selectItem_fn).call(this, item);
2939
+ }
2940
+ focus() {
2941
+ __privateSet4(this, _previouslyFocused, getActiveElement());
2942
+ if (this.items.length) {
2943
+ __privateMethod2(this, _setTabItem, setTabItem_fn).call(this, this.items[0]);
2944
+ this.items[0].focus();
2945
+ return;
2946
+ }
2947
+ const focusable = this.querySelector(
2948
+ '[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]'
2949
+ );
2950
+ focusable == null ? void 0 : focusable.focus();
2951
+ }
2952
+ handleSelect(event) {
2953
+ var _a3;
2954
+ const item = __privateMethod2(this, _getItem, getItem_fn).call(this, event);
2955
+ if (!item)
2956
+ return;
2957
+ __privateMethod2(this, _selectItem, selectItem_fn).call(this, item, item.type === "checkbox");
2958
+ if (__privateGet4(this, _invokerElement) && !this.hidden) {
2959
+ (_a3 = __privateGet4(this, _previouslyFocused)) == null ? void 0 : _a3.focus();
2960
+ this.hidden = true;
2961
+ }
2962
+ }
2963
+ get keysUsed() {
2964
+ return [
2965
+ "Enter",
2966
+ "Escape",
2967
+ "Tab",
2968
+ " ",
2969
+ "ArrowDown",
2970
+ "ArrowUp",
2971
+ "Home",
2972
+ "End"
2973
+ ];
2974
+ }
2975
+ handleMove(event) {
2976
+ var _a3, _b2;
2977
+ const { key } = event;
2978
+ const items = this.items;
2979
+ const currentItem = (_b2 = (_a3 = __privateMethod2(this, _getItem, getItem_fn).call(this, event)) != null ? _a3 : __privateMethod2(this, _getTabItem, getTabItem_fn).call(this)) != null ? _b2 : items[0];
2980
+ const currentIndex = items.indexOf(currentItem);
2981
+ let index = Math.max(0, currentIndex);
2982
+ if (key === "ArrowDown") {
2983
+ index++;
2984
+ } else if (key === "ArrowUp") {
2985
+ index--;
2986
+ } else if (event.key === "Home") {
2987
+ index = 0;
2988
+ } else if (event.key === "End") {
2989
+ index = items.length - 1;
2990
+ }
2991
+ if (index < 0) {
2992
+ index = items.length - 1;
2993
+ }
2994
+ if (index > items.length - 1) {
2995
+ index = 0;
2996
+ }
2997
+ __privateMethod2(this, _setTabItem, setTabItem_fn).call(this, items[index]);
2998
+ items[index].focus();
2999
+ }
3000
+ };
3001
+ _mediaController = /* @__PURE__ */ new WeakMap();
3002
+ _previouslyFocused = /* @__PURE__ */ new WeakMap();
3003
+ _invokerElement = /* @__PURE__ */ new WeakMap();
3004
+ _previousItems = /* @__PURE__ */ new WeakMap();
3005
+ _mutationObserver = /* @__PURE__ */ new WeakMap();
3006
+ _isPopover = /* @__PURE__ */ new WeakMap();
3007
+ _handleSlotChange = /* @__PURE__ */ new WeakSet();
3008
+ handleSlotChange_fn = function(event) {
3009
+ const slot = event.target;
3010
+ for (const node of slot.assignedNodes({ flatten: true })) {
3011
+ if (node.nodeType === 3 && node.textContent.trim() === "") {
3012
+ node.remove();
3013
+ }
3014
+ }
3015
+ if (["header", "title"].includes(slot.name)) {
3016
+ const header = this.shadowRoot.querySelector(
3017
+ 'slot[name="header"]'
3018
+ );
3019
+ header.hidden = slot.assignedNodes().length === 0;
3020
+ }
3021
+ if (!slot.name) {
3022
+ __privateGet4(this, _handleMenuItems).call(this);
3023
+ }
3024
+ };
3025
+ _handleMenuItems = /* @__PURE__ */ new WeakMap();
3026
+ _updateLayoutStyle = /* @__PURE__ */ new WeakSet();
3027
+ updateLayoutStyle_fn = function() {
3028
+ var _a3;
3029
+ const layoutRowStyle = this.shadowRoot.querySelector("#layout-row");
3030
+ const menuLayout = (_a3 = getComputedStyle(this).getPropertyValue("--media-menu-layout")) == null ? void 0 : _a3.trim();
3031
+ layoutRowStyle.setAttribute("media", menuLayout === "row" ? "" : "width:0");
3032
+ };
3033
+ _handleInvoke = /* @__PURE__ */ new WeakSet();
3034
+ handleInvoke_fn = function(event) {
3035
+ __privateSet4(this, _invokerElement, event.relatedTarget);
3036
+ if (!containsComposedNode(this, event.relatedTarget)) {
3037
+ this.hidden = !this.hidden;
3038
+ }
3039
+ };
3040
+ _handleOpen = /* @__PURE__ */ new WeakSet();
3041
+ handleOpen_fn = function() {
3042
+ var _a3;
3043
+ (_a3 = __privateGet4(this, _invokerElement)) == null ? void 0 : _a3.setAttribute("aria-expanded", "true");
3044
+ requestAnimationFrame(() => __privateMethod2(this, _positionMenu, positionMenu_fn).call(this, false));
3045
+ this.addEventListener("transitionend", () => this.focus(), { once: true });
3046
+ observeResize(getBoundsElement(this), __privateGet4(this, _handleBoundsResize));
3047
+ observeResize(this, __privateGet4(this, _handleMenuResize));
3048
+ };
3049
+ _handleClosed = /* @__PURE__ */ new WeakSet();
3050
+ handleClosed_fn = function() {
3051
+ var _a3;
3052
+ (_a3 = __privateGet4(this, _invokerElement)) == null ? void 0 : _a3.setAttribute("aria-expanded", "false");
3053
+ unobserveResize(getBoundsElement(this), __privateGet4(this, _handleBoundsResize));
3054
+ unobserveResize(this, __privateGet4(this, _handleMenuResize));
3055
+ };
3056
+ _handleBoundsResize = /* @__PURE__ */ new WeakMap();
3057
+ _handleMenuResize = /* @__PURE__ */ new WeakMap();
3058
+ _positionMenu = /* @__PURE__ */ new WeakSet();
3059
+ positionMenu_fn = function(animate, menuWidth) {
3060
+ if (this.hasAttribute("mediacontroller") && !this.anchor)
3061
+ return;
3062
+ if (this.hidden || !this.anchorElement)
3063
+ return;
3064
+ const { x, y } = computePosition({
3065
+ anchor: this.anchorElement,
3066
+ floating: this,
3067
+ placement: "top-start"
3068
+ });
3069
+ menuWidth != null ? menuWidth : menuWidth = this.offsetWidth;
3070
+ const bounds = getBoundsElement(this);
3071
+ const boundsRect = bounds.getBoundingClientRect();
3072
+ const anchorRect = this.anchorElement.getBoundingClientRect();
3073
+ const right = boundsRect.width - x - menuWidth;
3074
+ const bottom = boundsRect.height - y - this.offsetHeight;
3075
+ const maxHeight = boundsRect.height - anchorRect.height;
3076
+ const { style } = getOrInsertCSSRule(this.shadowRoot, ":host");
3077
+ if (!animate) {
3078
+ style.setProperty("--media-menu-transition-in", "none");
3079
+ }
3080
+ style.setProperty("position", "absolute");
3081
+ style.setProperty("right", `${Math.max(0, right)}px`);
3082
+ style.setProperty("bottom", `${bottom}px`);
3083
+ style.setProperty("--_menu-max-height", `${maxHeight}px`);
3084
+ style.removeProperty("--media-menu-transition-in");
3085
+ };
3086
+ _resizeMenu = /* @__PURE__ */ new WeakSet();
3087
+ resizeMenu_fn = function(animate) {
3088
+ const expandedMenuItem = this.querySelector(
3089
+ '[role="menuitem"][aria-haspopup][aria-expanded="true"]'
3090
+ );
3091
+ const expandedSubmenu = expandedMenuItem == null ? void 0 : expandedMenuItem.querySelector(
3092
+ '[role="menu"]'
3093
+ );
3094
+ const { style } = getOrInsertCSSRule(this.shadowRoot, ":host");
3095
+ if (!animate) {
3096
+ style.setProperty("--media-menu-transition-in", "none");
3097
+ }
3098
+ if (expandedSubmenu) {
3099
+ const height = expandedSubmenu.offsetHeight;
3100
+ const width = Math.max(
3101
+ expandedSubmenu.offsetWidth,
3102
+ expandedMenuItem.offsetWidth
3103
+ );
3104
+ this.style.setProperty("min-width", `${width}px`);
3105
+ this.style.setProperty("min-height", `${height}px`);
3106
+ __privateMethod2(this, _positionMenu, positionMenu_fn).call(this, animate, width);
3107
+ } else {
3108
+ this.style.removeProperty("min-width");
3109
+ this.style.removeProperty("min-height");
3110
+ __privateMethod2(this, _positionMenu, positionMenu_fn).call(this, animate);
3111
+ }
3112
+ style.removeProperty("--media-menu-transition-in");
3113
+ };
3114
+ _handleClick = /* @__PURE__ */ new WeakSet();
3115
+ handleClick_fn = function(event) {
3116
+ var _a3;
3117
+ event.stopPropagation();
3118
+ if (event.composedPath().includes(__privateGet4(this, _backButtonElement, backButtonElement_get))) {
3119
+ (_a3 = __privateGet4(this, _previouslyFocused)) == null ? void 0 : _a3.focus();
3120
+ this.hidden = true;
3121
+ return;
3122
+ }
3123
+ const item = __privateMethod2(this, _getItem, getItem_fn).call(this, event);
3124
+ if (!item || item.hasAttribute("disabled"))
3125
+ return;
3126
+ __privateMethod2(this, _setTabItem, setTabItem_fn).call(this, item);
3127
+ this.handleSelect(event);
3128
+ };
3129
+ _backButtonElement = /* @__PURE__ */ new WeakSet();
3130
+ backButtonElement_get = function() {
3131
+ var _a3;
3132
+ const headerSlot = this.shadowRoot.querySelector(
3133
+ 'slot[name="header"]'
3134
+ );
3135
+ return (_a3 = headerSlot.assignedElements({ flatten: true })) == null ? void 0 : _a3.find(
3136
+ (el) => el.part.contains("back") && el.part.contains("button")
3137
+ );
3138
+ };
3139
+ _handleToggle = /* @__PURE__ */ new WeakSet();
3140
+ handleToggle_fn = function(event) {
3141
+ if (event.target === this)
3142
+ return;
3143
+ __privateMethod2(this, _checkSubmenuHasExpanded, checkSubmenuHasExpanded_fn).call(this);
3144
+ const menuItemsWithSubmenu = Array.from(
3145
+ this.querySelectorAll('[role="menuitem"][aria-haspopup]')
3146
+ );
3147
+ for (const item of menuItemsWithSubmenu) {
3148
+ if (item.invokeTargetElement == event.target)
3149
+ continue;
3150
+ if (event.newState == "open" && item.getAttribute("aria-expanded") == "true" && !item.invokeTargetElement.hidden) {
3151
+ item.invokeTargetElement.dispatchEvent(
3152
+ new InvokeEvent({ relatedTarget: item })
3153
+ );
3154
+ }
3155
+ }
3156
+ for (const item of menuItemsWithSubmenu) {
3157
+ item.setAttribute("aria-expanded", `${!item.submenuElement.hidden}`);
3158
+ }
3159
+ __privateMethod2(this, _resizeMenu, resizeMenu_fn).call(this, true);
3160
+ };
3161
+ _checkSubmenuHasExpanded = /* @__PURE__ */ new WeakSet();
3162
+ checkSubmenuHasExpanded_fn = function() {
3163
+ const selector = '[role="menuitem"] > [role="menu"]:not([hidden])';
3164
+ const expandedMenuItem = this.querySelector(selector);
3165
+ this.container.classList.toggle("has-expanded", !!expandedMenuItem);
3166
+ };
3167
+ _handleFocusOut = /* @__PURE__ */ new WeakSet();
3168
+ handleFocusOut_fn = function(event) {
3169
+ var _a3;
3170
+ if (!containsComposedNode(this, event.relatedTarget)) {
3171
+ if (__privateGet4(this, _isPopover)) {
3172
+ (_a3 = __privateGet4(this, _previouslyFocused)) == null ? void 0 : _a3.focus();
3173
+ }
3174
+ if (__privateGet4(this, _invokerElement) && __privateGet4(this, _invokerElement) !== event.relatedTarget && !this.hidden) {
3175
+ this.hidden = true;
3176
+ }
3177
+ }
3178
+ };
3179
+ _handleKeyDown = /* @__PURE__ */ new WeakSet();
3180
+ handleKeyDown_fn = function(event) {
3181
+ var _a3, _b2, _c, _d, _e;
3182
+ const { key, ctrlKey, altKey, metaKey } = event;
3183
+ if (ctrlKey || altKey || metaKey) {
3184
+ return;
3185
+ }
3186
+ if (!this.keysUsed.includes(key)) {
3187
+ return;
3188
+ }
3189
+ event.preventDefault();
3190
+ event.stopPropagation();
3191
+ if (key === "Tab") {
3192
+ if (__privateGet4(this, _isPopover)) {
3193
+ this.hidden = true;
3194
+ return;
3195
+ }
3196
+ if (event.shiftKey) {
3197
+ (_b2 = (_a3 = this.previousElementSibling) == null ? void 0 : _a3.focus) == null ? void 0 : _b2.call(_a3);
3198
+ } else {
3199
+ (_d = (_c = this.nextElementSibling) == null ? void 0 : _c.focus) == null ? void 0 : _d.call(_c);
3200
+ }
3201
+ this.blur();
3202
+ } else if (key === "Escape") {
3203
+ (_e = __privateGet4(this, _previouslyFocused)) == null ? void 0 : _e.focus();
3204
+ if (__privateGet4(this, _isPopover)) {
3205
+ this.hidden = true;
3206
+ }
3207
+ } else if (key === "Enter" || key === " ") {
3208
+ this.handleSelect(event);
3209
+ } else {
3210
+ this.handleMove(event);
3211
+ }
3212
+ };
3213
+ _getItem = /* @__PURE__ */ new WeakSet();
3214
+ getItem_fn = function(event) {
3215
+ return event.composedPath().find((el) => {
3216
+ return ["menuitemradio", "menuitemcheckbox"].includes(
3217
+ el.role
3218
+ );
3219
+ });
3220
+ };
3221
+ _getTabItem = /* @__PURE__ */ new WeakSet();
3222
+ getTabItem_fn = function() {
3223
+ return this.items.find((item) => item.tabIndex === 0);
3224
+ };
3225
+ _setTabItem = /* @__PURE__ */ new WeakSet();
3226
+ setTabItem_fn = function(tabItem) {
3227
+ for (const item of this.items) {
3228
+ item.tabIndex = item === tabItem ? 0 : -1;
3229
+ }
3230
+ };
3231
+ _selectItem = /* @__PURE__ */ new WeakSet();
3232
+ selectItem_fn = function(item, toggle) {
3233
+ const oldCheckedItems = [...this.checkedItems];
3234
+ if (item.type === "radio") {
3235
+ this.radioGroupItems.forEach((el) => el.checked = false);
3236
+ }
3237
+ if (toggle) {
3238
+ item.checked = !item.checked;
3239
+ } else {
3240
+ item.checked = true;
3241
+ }
3242
+ if (this.checkedItems.some((opt, i) => opt != oldCheckedItems[i])) {
3243
+ this.dispatchEvent(
3244
+ new Event("change", { bubbles: true, composed: true })
3245
+ );
3246
+ }
3247
+ };
3248
+ MediaChromeMenu.template = template;
3249
+ function isMenuItem(element) {
3250
+ return ["menuitem", "menuitemradio", "menuitemcheckbox"].includes(
3251
+ element == null ? void 0 : element.role
3252
+ );
3253
+ }
3254
+ function getBoundsElement(host) {
3255
+ var _a3;
3256
+ return (_a3 = host.getAttribute("bounds") ? closestComposedNode(host, `#${host.getAttribute("bounds")}`) : getMediaController(host) || host.parentElement) != null ? _a3 : host;
3257
+ }
3258
+ if (!GlobalThis.customElements.get("media-chrome-menu")) {
3259
+ GlobalThis.customElements.define("media-chrome-menu", MediaChromeMenu);
3260
+ }
3261
+
3262
+ // ../../node_modules/media-chrome/dist/menu/media-chrome-menu-item.js
3263
+ var __accessCheck5 = (obj, member, msg) => {
3264
+ if (!member.has(obj))
3265
+ throw TypeError("Cannot " + msg);
3266
+ };
3267
+ var __privateGet5 = (obj, member, getter) => {
3268
+ __accessCheck5(obj, member, "read from private field");
3269
+ return getter ? getter.call(obj) : member.get(obj);
3270
+ };
3271
+ var __privateAdd5 = (obj, member, value) => {
3272
+ if (member.has(obj))
3273
+ throw TypeError("Cannot add the same private member more than once");
3274
+ member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
3275
+ };
3276
+ var __privateSet5 = (obj, member, value, setter) => {
3277
+ __accessCheck5(obj, member, "write to private field");
3278
+ setter ? setter.call(obj, value) : member.set(obj, value);
3279
+ return value;
3280
+ };
3281
+ var __privateMethod3 = (obj, member, method) => {
3282
+ __accessCheck5(obj, member, "access private method");
3283
+ return method;
3284
+ };
3285
+ var _dirty;
3286
+ var _ownerElement;
3287
+ var _handleSlotChange2;
3288
+ var handleSlotChange_fn2;
3289
+ var _submenuConnected;
3290
+ var submenuConnected_fn;
3291
+ var _submenuDisconnected;
3292
+ var submenuDisconnected_fn;
3293
+ var _handleMenuItem;
3294
+ var _handleKeyUp;
3295
+ var handleKeyUp_fn;
3296
+ var _handleKeyDown2;
3297
+ var handleKeyDown_fn2;
3298
+ var _reset;
3299
+ var reset_fn;
3300
+ var template2 = Document2.createElement("template");
3301
+ template2.innerHTML = /*html*/
3302
+ `
3303
+ <style>
3304
+ :host {
3305
+ transition: var(--media-menu-item-transition,
3306
+ background .15s linear,
3307
+ opacity .2s ease-in-out
3308
+ );
3309
+ outline: var(--media-menu-item-outline, 0);
3310
+ outline-offset: var(--media-menu-item-outline-offset, -1px);
3311
+ cursor: pointer;
3312
+ display: flex;
3313
+ align-items: center;
3314
+ align-self: stretch;
3315
+ justify-self: stretch;
3316
+ white-space: nowrap;
3317
+ white-space-collapse: collapse;
3318
+ text-wrap: nowrap;
3319
+ padding: .4em .8em .4em 1em;
3320
+ }
3321
+
3322
+ :host(:focus-visible) {
3323
+ box-shadow: var(--media-menu-item-focus-shadow, inset 0 0 0 2px rgb(27 127 204 / .9));
3324
+ outline: var(--media-menu-item-hover-outline, 0);
3325
+ outline-offset: var(--media-menu-item-hover-outline-offset, var(--media-menu-item-outline-offset, -1px));
3326
+ }
3327
+
3328
+ :host(:hover) {
3329
+ cursor: pointer;
3330
+ background: var(--media-menu-item-hover-background, rgb(92 92 102 / .5));
3331
+ outline: var(--media-menu-item-hover-outline);
3332
+ outline-offset: var(--media-menu-item-hover-outline-offset, var(--media-menu-item-outline-offset, -1px));
3333
+ }
3334
+
3335
+ :host([aria-checked="true"]) {
3336
+ background: var(--media-menu-item-checked-background);
3337
+ }
3338
+
3339
+ :host([hidden]) {
3340
+ display: none;
3341
+ }
3342
+
3343
+ :host([disabled]) {
3344
+ pointer-events: none;
3345
+ color: rgba(255, 255, 255, .3);
3346
+ }
3347
+
3348
+ slot:not([name]) {
3349
+ width: 100%;
3350
+ }
3351
+
3352
+ slot:not([name="submenu"]) {
3353
+ display: inline-flex;
3354
+ align-items: center;
3355
+ transition: inherit;
3356
+ opacity: var(--media-menu-item-opacity, 1);
3357
+ }
3358
+
3359
+ slot[name="description"] {
3360
+ justify-content: end;
3361
+ }
3362
+
3363
+ slot[name="description"] > span {
3364
+ display: inline-block;
3365
+ margin-inline: 1em .2em;
3366
+ max-width: var(--media-menu-item-description-max-width, 100px);
3367
+ text-overflow: ellipsis;
3368
+ overflow: hidden;
3369
+ font-size: .8em;
3370
+ font-weight: 400;
3371
+ text-align: right;
3372
+ position: relative;
3373
+ top: .04em;
3374
+ }
3375
+
3376
+ slot[name="checked-indicator"] {
3377
+ display: none;
3378
+ }
3379
+
3380
+ :host(:is([role="menuitemradio"],[role="menuitemcheckbox"])) slot[name="checked-indicator"] {
3381
+ display: var(--media-menu-item-checked-indicator-display, inline-block);
3382
+ }
3383
+
3384
+ ${/* For all slotted icons in prefix and suffix. */
3385
+ ""}
3386
+ svg, img, ::slotted(svg), ::slotted(img) {
3387
+ height: var(--media-menu-item-icon-height, var(--media-control-height, 24px));
3388
+ fill: var(--media-icon-color, var(--media-primary-color, rgb(238 238 238)));
3389
+ display: block;
3390
+ }
3391
+
3392
+ ${/* Only for indicator icons like checked-indicator or captions-indicator. */
3393
+ ""}
3394
+ [part~="indicator"],
3395
+ ::slotted([part~="indicator"]) {
3396
+ fill: var(--media-menu-item-indicator-fill,
3397
+ var(--media-icon-color, var(--media-primary-color, rgb(238 238 238))));
3398
+ height: var(--media-menu-item-indicator-height, 1.25em);
3399
+ margin-right: .5ch;
3400
+ }
3401
+
3402
+ [part~="checked-indicator"] {
3403
+ visibility: hidden;
3404
+ }
3405
+
3406
+ :host([aria-checked="true"]) [part~="checked-indicator"] {
3407
+ visibility: visible;
3408
+ }
3409
+ </style>
3410
+ <slot name="checked-indicator">
3411
+ <svg aria-hidden="true" viewBox="0 1 24 24" part="checked-indicator indicator">
3412
+ <path d="m10 15.17 9.193-9.191 1.414 1.414-10.606 10.606-6.364-6.364 1.414-1.414 4.95 4.95Z"/>
3413
+ </svg>
3414
+ </slot>
3415
+ <slot name="prefix"></slot>
3416
+ <slot></slot>
3417
+ <slot name="description"></slot>
3418
+ <slot name="suffix"></slot>
3419
+ <slot name="submenu"></slot>
3420
+ `;
3421
+ var Attributes2 = {
3422
+ TYPE: "type",
3423
+ VALUE: "value",
3424
+ CHECKED: "checked",
3425
+ DISABLED: "disabled"
3426
+ };
3427
+ var MediaChromeMenuItem = class extends GlobalThis.HTMLElement {
3428
+ constructor() {
3429
+ super();
3430
+ __privateAdd5(this, _handleSlotChange2);
3431
+ __privateAdd5(this, _submenuConnected);
3432
+ __privateAdd5(this, _submenuDisconnected);
3433
+ __privateAdd5(this, _handleKeyUp);
3434
+ __privateAdd5(this, _handleKeyDown2);
3435
+ __privateAdd5(this, _reset);
3436
+ __privateAdd5(this, _dirty, false);
3437
+ __privateAdd5(this, _ownerElement, void 0);
3438
+ __privateAdd5(this, _handleMenuItem, () => {
3439
+ var _a3, _b2;
3440
+ this.setAttribute("submenusize", `${this.submenuElement.items.length}`);
3441
+ const descriptionSlot = this.shadowRoot.querySelector(
3442
+ 'slot[name="description"]'
3443
+ );
3444
+ const checkedItem = (_a3 = this.submenuElement.checkedItems) == null ? void 0 : _a3[0];
3445
+ const description = (_b2 = checkedItem == null ? void 0 : checkedItem.dataset.description) != null ? _b2 : checkedItem == null ? void 0 : checkedItem.text;
3446
+ const span = Document2.createElement("span");
3447
+ span.textContent = description != null ? description : "";
3448
+ descriptionSlot.replaceChildren(span);
3449
+ });
3450
+ if (!this.shadowRoot) {
3451
+ this.attachShadow({ mode: "open" });
3452
+ this.shadowRoot.append(this.constructor.template.content.cloneNode(true));
3453
+ }
3454
+ this.shadowRoot.addEventListener("slotchange", this);
3455
+ }
3456
+ static get observedAttributes() {
3457
+ return [
3458
+ Attributes2.TYPE,
3459
+ Attributes2.DISABLED,
3460
+ Attributes2.CHECKED,
3461
+ Attributes2.VALUE
3462
+ ];
3463
+ }
3464
+ enable() {
3465
+ if (!this.hasAttribute("tabindex")) {
3466
+ this.setAttribute("tabindex", "-1");
3467
+ }
3468
+ if (isCheckable(this) && !this.hasAttribute("aria-checked")) {
3469
+ this.setAttribute("aria-checked", "false");
3470
+ }
3471
+ this.addEventListener("click", this);
3472
+ this.addEventListener("keydown", this);
3473
+ }
3474
+ disable() {
3475
+ this.removeAttribute("tabindex");
3476
+ this.removeEventListener("click", this);
3477
+ this.removeEventListener("keydown", this);
3478
+ this.removeEventListener("keyup", this);
3479
+ }
3480
+ handleEvent(event) {
3481
+ switch (event.type) {
3482
+ case "slotchange":
3483
+ __privateMethod3(this, _handleSlotChange2, handleSlotChange_fn2).call(this, event);
3484
+ break;
3485
+ case "click":
3486
+ this.handleClick(event);
3487
+ break;
3488
+ case "keydown":
3489
+ __privateMethod3(this, _handleKeyDown2, handleKeyDown_fn2).call(this, event);
3490
+ break;
3491
+ case "keyup":
3492
+ __privateMethod3(this, _handleKeyUp, handleKeyUp_fn).call(this, event);
3493
+ break;
3494
+ }
3495
+ }
3496
+ attributeChangedCallback(attrName, oldValue, newValue) {
3497
+ if (attrName === Attributes2.CHECKED && isCheckable(this) && !__privateGet5(this, _dirty)) {
3498
+ this.setAttribute("aria-checked", newValue != null ? "true" : "false");
3499
+ } else if (attrName === Attributes2.TYPE && newValue !== oldValue) {
3500
+ this.role = "menuitem" + newValue;
3501
+ } else if (attrName === Attributes2.DISABLED && newValue !== oldValue) {
3502
+ if (newValue == null) {
3503
+ this.enable();
3504
+ } else {
3505
+ this.disable();
3506
+ }
3507
+ }
3508
+ }
3509
+ connectedCallback() {
3510
+ if (!this.hasAttribute(Attributes2.DISABLED)) {
3511
+ this.enable();
3512
+ }
3513
+ this.role = "menuitem" + this.type;
3514
+ __privateSet5(this, _ownerElement, closestMenuItemsContainer(this, this.parentNode));
3515
+ __privateMethod3(this, _reset, reset_fn).call(this);
3516
+ }
3517
+ disconnectedCallback() {
3518
+ this.disable();
3519
+ __privateMethod3(this, _reset, reset_fn).call(this);
3520
+ __privateSet5(this, _ownerElement, null);
3521
+ }
3522
+ get invokeTarget() {
3523
+ return this.getAttribute("invoketarget");
3524
+ }
3525
+ set invokeTarget(value) {
3526
+ this.setAttribute("invoketarget", `${value}`);
3527
+ }
3528
+ /**
3529
+ * Returns the element with the id specified by the `invoketarget` attribute
3530
+ * or the slotted submenu element.
3531
+ */
3532
+ get invokeTargetElement() {
3533
+ var _a3;
3534
+ if (this.invokeTarget) {
3535
+ return (_a3 = getDocumentOrShadowRoot(this)) == null ? void 0 : _a3.querySelector(
3536
+ `#${this.invokeTarget}`
3537
+ );
3538
+ }
3539
+ return this.submenuElement;
3540
+ }
3541
+ /**
3542
+ * Returns the slotted submenu element.
3543
+ */
3544
+ get submenuElement() {
3545
+ const submenuSlot = this.shadowRoot.querySelector(
3546
+ 'slot[name="submenu"]'
3547
+ );
3548
+ return submenuSlot.assignedElements({
3549
+ flatten: true
3550
+ })[0];
3551
+ }
3552
+ get type() {
3553
+ var _a3;
3554
+ return (_a3 = this.getAttribute(Attributes2.TYPE)) != null ? _a3 : "";
3555
+ }
3556
+ set type(val) {
3557
+ this.setAttribute(Attributes2.TYPE, `${val}`);
3558
+ }
3559
+ get value() {
3560
+ var _a3;
3561
+ return (_a3 = this.getAttribute(Attributes2.VALUE)) != null ? _a3 : this.text;
3562
+ }
3563
+ set value(val) {
3564
+ this.setAttribute(Attributes2.VALUE, val);
3565
+ }
3566
+ get text() {
3567
+ var _a3;
3568
+ return ((_a3 = this.textContent) != null ? _a3 : "").trim();
3569
+ }
3570
+ get checked() {
3571
+ if (!isCheckable(this))
3572
+ return void 0;
3573
+ return this.getAttribute("aria-checked") === "true";
3574
+ }
3575
+ set checked(value) {
3576
+ if (!isCheckable(this))
3577
+ return;
3578
+ __privateSet5(this, _dirty, true);
3579
+ this.setAttribute("aria-checked", value ? "true" : "false");
3580
+ if (value) {
3581
+ this.part.add("checked");
3582
+ } else {
3583
+ this.part.remove("checked");
3584
+ }
3585
+ }
3586
+ handleClick(event) {
3587
+ if (isCheckable(this))
3588
+ return;
3589
+ if (this.invokeTargetElement && containsComposedNode(this, event.target)) {
3590
+ this.invokeTargetElement.dispatchEvent(
3591
+ new InvokeEvent({ relatedTarget: this })
3592
+ );
3593
+ }
3594
+ }
3595
+ get keysUsed() {
3596
+ return ["Enter", " "];
3597
+ }
3598
+ };
3599
+ _dirty = /* @__PURE__ */ new WeakMap();
3600
+ _ownerElement = /* @__PURE__ */ new WeakMap();
3601
+ _handleSlotChange2 = /* @__PURE__ */ new WeakSet();
3602
+ handleSlotChange_fn2 = function(event) {
3603
+ const slot = event.target;
3604
+ const isDefaultSlot = !(slot == null ? void 0 : slot.name);
3605
+ if (isDefaultSlot) {
3606
+ for (const node of slot.assignedNodes({ flatten: true })) {
3607
+ if (node instanceof Text && node.textContent.trim() === "") {
3608
+ node.remove();
3609
+ }
3610
+ }
3611
+ }
3612
+ if (slot.name === "submenu") {
3613
+ if (this.submenuElement) {
3614
+ __privateMethod3(this, _submenuConnected, submenuConnected_fn).call(this);
3615
+ } else {
3616
+ __privateMethod3(this, _submenuDisconnected, submenuDisconnected_fn).call(this);
3617
+ }
3618
+ }
3619
+ };
3620
+ _submenuConnected = /* @__PURE__ */ new WeakSet();
3621
+ submenuConnected_fn = async function() {
3622
+ this.setAttribute("aria-haspopup", "menu");
3623
+ this.setAttribute("aria-expanded", `${!this.submenuElement.hidden}`);
3624
+ this.submenuElement.addEventListener("change", __privateGet5(this, _handleMenuItem));
3625
+ this.submenuElement.addEventListener("addmenuitem", __privateGet5(this, _handleMenuItem));
3626
+ this.submenuElement.addEventListener(
3627
+ "removemenuitem",
3628
+ __privateGet5(this, _handleMenuItem)
3629
+ );
3630
+ __privateGet5(this, _handleMenuItem).call(this);
3631
+ };
3632
+ _submenuDisconnected = /* @__PURE__ */ new WeakSet();
3633
+ submenuDisconnected_fn = function() {
3634
+ this.removeAttribute("aria-haspopup");
3635
+ this.removeAttribute("aria-expanded");
3636
+ this.submenuElement.removeEventListener("change", __privateGet5(this, _handleMenuItem));
3637
+ this.submenuElement.removeEventListener(
3638
+ "addmenuitem",
3639
+ __privateGet5(this, _handleMenuItem)
3640
+ );
3641
+ this.submenuElement.removeEventListener(
3642
+ "removemenuitem",
3643
+ __privateGet5(this, _handleMenuItem)
3644
+ );
3645
+ __privateGet5(this, _handleMenuItem).call(this);
3646
+ };
3647
+ _handleMenuItem = /* @__PURE__ */ new WeakMap();
3648
+ _handleKeyUp = /* @__PURE__ */ new WeakSet();
3649
+ handleKeyUp_fn = function(event) {
3650
+ const { key } = event;
3651
+ if (!this.keysUsed.includes(key)) {
3652
+ this.removeEventListener("keyup", __privateMethod3(this, _handleKeyUp, handleKeyUp_fn));
3653
+ return;
3654
+ }
3655
+ this.handleClick(event);
3656
+ };
3657
+ _handleKeyDown2 = /* @__PURE__ */ new WeakSet();
3658
+ handleKeyDown_fn2 = function(event) {
3659
+ const { metaKey, altKey, key } = event;
3660
+ if (metaKey || altKey || !this.keysUsed.includes(key)) {
3661
+ this.removeEventListener("keyup", __privateMethod3(this, _handleKeyUp, handleKeyUp_fn));
3662
+ return;
3663
+ }
3664
+ this.addEventListener("keyup", __privateMethod3(this, _handleKeyUp, handleKeyUp_fn), { once: true });
3665
+ };
3666
+ _reset = /* @__PURE__ */ new WeakSet();
3667
+ reset_fn = function() {
3668
+ var _a3;
3669
+ const items = (_a3 = __privateGet5(this, _ownerElement)) == null ? void 0 : _a3.radioGroupItems;
3670
+ if (!items)
3671
+ return;
3672
+ let checkedItem = items.filter((item) => item.getAttribute("aria-checked") === "true").pop();
3673
+ if (!checkedItem)
3674
+ checkedItem = items[0];
3675
+ for (const item of items) {
3676
+ item.setAttribute("aria-checked", "false");
3677
+ }
3678
+ checkedItem == null ? void 0 : checkedItem.setAttribute("aria-checked", "true");
3679
+ };
3680
+ MediaChromeMenuItem.template = template2;
3681
+ function isCheckable(item) {
3682
+ return item.type === "radio" || item.type === "checkbox";
3683
+ }
3684
+ function closestMenuItemsContainer(childNode, parentNode) {
3685
+ if (!childNode)
3686
+ return null;
3687
+ const { host } = childNode.getRootNode();
3688
+ if (!parentNode && host)
3689
+ return closestMenuItemsContainer(childNode, host);
3690
+ if (parentNode == null ? void 0 : parentNode.items)
3691
+ return parentNode;
3692
+ return closestMenuItemsContainer(parentNode, parentNode == null ? void 0 : parentNode.parentNode);
3693
+ }
3694
+ if (!GlobalThis.customElements.get("media-chrome-menu-item")) {
3695
+ GlobalThis.customElements.define(
3696
+ "media-chrome-menu-item",
3697
+ MediaChromeMenuItem
3698
+ );
3699
+ }
3700
+
3701
+ // ../../node_modules/media-chrome/dist/menu/media-settings-menu.js
3702
+ var template3 = Document2.createElement("template");
3703
+ template3.innerHTML = MediaChromeMenu.template.innerHTML + /*html*/
3704
+ `
3705
+ <style>
3706
+ :host {
3707
+ background: var(--media-settings-menu-background,
3708
+ var(--media-menu-background,
3709
+ var(--media-control-background,
3710
+ var(--media-secondary-color, rgb(20 20 30 / .8)))));
3711
+ min-width: var(--media-settings-menu-min-width, 170px);
3712
+ border-radius: 2px 2px 0 0;
3713
+ overflow: hidden;
3714
+ }
3715
+
3716
+ :host([role="menu"]) {
3717
+ ${/* Bottom fix setting menu items for animation when the height expands. */
3718
+ ""}
3719
+ justify-content: end;
3720
+ }
3721
+
3722
+ slot:not([name]) {
3723
+ justify-content: var(--media-settings-menu-justify-content);
3724
+ flex-direction: var(--media-settings-menu-flex-direction, column);
3725
+ overflow: visible;
3726
+ }
3727
+
3728
+ #container.has-expanded {
3729
+ --media-settings-menu-item-opacity: 0;
3730
+ }
3731
+ </style>
3732
+ `;
3733
+ var MediaSettingsMenu = class extends MediaChromeMenu {
3734
+ /**
3735
+ * Returns the anchor element when it is a floating menu.
3736
+ */
3737
+ get anchorElement() {
3738
+ if (this.anchor !== "auto")
3739
+ return super.anchorElement;
3740
+ return getMediaController(this).querySelector("media-settings-menu-button");
3741
+ }
3742
+ };
3743
+ MediaSettingsMenu.template = template3;
3744
+ if (!GlobalThis.customElements.get("media-settings-menu")) {
3745
+ GlobalThis.customElements.define("media-settings-menu", MediaSettingsMenu);
3746
+ }
3747
+
3748
+ // ../../node_modules/media-chrome/dist/menu/media-settings-menu-item.js
3749
+ var _a;
3750
+ var template4 = Document2.createElement("template");
3751
+ template4.innerHTML = MediaChromeMenuItem.template.innerHTML + /*html*/
3752
+ `
3753
+ <style>
3754
+ slot:not([name="submenu"]) {
3755
+ opacity: var(--media-settings-menu-item-opacity, var(--media-menu-item-opacity));
3756
+ }
3757
+
3758
+ :host([aria-expanded="true"]:hover) {
3759
+ background: transparent;
3760
+ }
3761
+ </style>
3762
+ `;
3763
+ if ((_a = template4.content) == null ? void 0 : _a.querySelector) {
3764
+ template4.content.querySelector('slot[name="suffix"]').innerHTML = /*html*/
3765
+ `
3766
+ <svg aria-hidden="true" viewBox="0 0 20 24">
3767
+ <path d="m8.12 17.585-.742-.669 4.2-4.665-4.2-4.666.743-.669 4.803 5.335-4.803 5.334Z"/>
3768
+ </svg>
3769
+ `;
3770
+ }
3771
+ var MediaSettingsMenuItem = class extends MediaChromeMenuItem {
3772
+ };
3773
+ MediaSettingsMenuItem.template = template4;
3774
+ if (!GlobalThis.customElements.get("media-settings-menu-item")) {
3775
+ GlobalThis.customElements.define(
3776
+ "media-settings-menu-item",
3777
+ MediaSettingsMenuItem
3778
+ );
3779
+ }
3780
+
3781
+ // ../../node_modules/media-chrome/dist/media-chrome-button.js
3782
+ var __accessCheck6 = (obj, member, msg) => {
3783
+ if (!member.has(obj))
3784
+ throw TypeError("Cannot " + msg);
3785
+ };
3786
+ var __privateGet6 = (obj, member, getter) => {
3787
+ __accessCheck6(obj, member, "read from private field");
3788
+ return getter ? getter.call(obj) : member.get(obj);
3789
+ };
3790
+ var __privateAdd6 = (obj, member, value) => {
3791
+ if (member.has(obj))
3792
+ throw TypeError("Cannot add the same private member more than once");
3793
+ member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
3794
+ };
3795
+ var __privateSet6 = (obj, member, value, setter) => {
3796
+ __accessCheck6(obj, member, "write to private field");
3797
+ setter ? setter.call(obj, value) : member.set(obj, value);
3798
+ return value;
3799
+ };
3800
+ var _mediaController2;
3801
+ var _clickListener;
3802
+ var _keyupListener;
3803
+ var _keydownListener;
3804
+ var Attributes3 = {
3805
+ TOOLTIP_PLACEMENT: "tooltipplacement"
3806
+ };
3807
+ var template5 = Document2.createElement("template");
3808
+ template5.innerHTML = /*html*/
3809
+ `
3810
+ <style>
3811
+ :host {
3812
+ position: relative;
3813
+ font: var(--media-font,
3814
+ var(--media-font-weight, bold)
3815
+ var(--media-font-size, 14px) /
3816
+ var(--media-text-content-height, var(--media-control-height, 24px))
3817
+ var(--media-font-family, helvetica neue, segoe ui, roboto, arial, sans-serif));
3818
+ color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));
3819
+ background: var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7)));
3820
+ padding: var(--media-button-padding, var(--media-control-padding, 10px));
3821
+ justify-content: var(--media-button-justify-content, center);
3822
+ display: inline-flex;
3823
+ align-items: center;
3824
+ vertical-align: middle;
3825
+ box-sizing: border-box;
3826
+ transition: background .15s linear;
3827
+ pointer-events: auto;
3828
+ cursor: pointer;
3829
+ -webkit-tap-highlight-color: transparent;
3830
+ }
3831
+
3832
+ ${/*
3833
+ Only show outline when keyboard focusing.
3834
+ https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo
3835
+ */
3836
+ ""}
3837
+ :host(:focus-visible) {
3838
+ box-shadow: inset 0 0 0 2px rgb(27 127 204 / .9);
3839
+ outline: 0;
3840
+ }
3841
+ ${/*
3842
+ * hide default focus ring, particularly when using mouse
3843
+ */
3844
+ ""}
3845
+ :host(:where(:focus)) {
3846
+ box-shadow: none;
3847
+ outline: 0;
3848
+ }
3849
+
3850
+ :host(:hover) {
3851
+ background: var(--media-control-hover-background, rgba(50 50 70 / .7));
3852
+ }
3853
+
3854
+ svg, img, ::slotted(svg), ::slotted(img) {
3855
+ width: var(--media-button-icon-width);
3856
+ height: var(--media-button-icon-height, var(--media-control-height, 24px));
3857
+ transform: var(--media-button-icon-transform);
3858
+ transition: var(--media-button-icon-transition);
3859
+ fill: var(--media-icon-color, var(--media-primary-color, rgb(238 238 238)));
3860
+ vertical-align: middle;
3861
+ max-width: 100%;
3862
+ max-height: 100%;
3863
+ min-width: 100%;
3864
+ }
3865
+
3866
+ media-tooltip {
3867
+ opacity: 0;
3868
+ transition: opacity .3s;
3869
+ }
3870
+
3871
+ :host(:hover) media-tooltip,
3872
+ :host(:focus-visible) media-tooltip {
3873
+ opacity: 1;
3874
+ }
3875
+
3876
+ :host([notooltip]) slot[name="tooltip"] {
3877
+ display: none;
3878
+ }
3879
+ </style>
3880
+
3881
+ <slot name="tooltip">
3882
+ <media-tooltip>
3883
+ <slot name="tooltip-content"></slot>
3884
+ </media-tooltip>
3885
+ </slot>
3886
+ `;
3887
+ var MediaChromeButton = class extends GlobalThis.HTMLElement {
3888
+ constructor(options = {}) {
3889
+ var _a3;
3890
+ super();
3891
+ __privateAdd6(this, _mediaController2, void 0);
3892
+ this.preventClick = false;
3893
+ this.tooltipEl = null;
3894
+ this.tooltipContent = "";
3895
+ __privateAdd6(this, _clickListener, (e) => {
3896
+ if (!this.preventClick) {
3897
+ this.handleClick(e);
3898
+ }
3899
+ setTimeout(this.tooltipEl.updateXOffset, 0);
3900
+ });
3901
+ __privateAdd6(this, _keyupListener, (e) => {
3902
+ const { key } = e;
3903
+ if (!this.keysUsed.includes(key)) {
3904
+ this.removeEventListener("keyup", __privateGet6(this, _keyupListener));
3905
+ return;
3906
+ }
3907
+ if (!this.preventClick) {
3908
+ this.handleClick(e);
3909
+ }
3910
+ });
3911
+ __privateAdd6(this, _keydownListener, (e) => {
3912
+ const { metaKey, altKey, key } = e;
3913
+ if (metaKey || altKey || !this.keysUsed.includes(key)) {
3914
+ this.removeEventListener("keyup", __privateGet6(this, _keyupListener));
3915
+ return;
3916
+ }
3917
+ this.addEventListener("keyup", __privateGet6(this, _keyupListener), { once: true });
3918
+ });
3919
+ if (!this.shadowRoot) {
3920
+ this.attachShadow({ mode: "open" });
3921
+ const buttonHTML = template5.content.cloneNode(true);
3922
+ this.nativeEl = buttonHTML;
3923
+ let slotTemplate7 = options.slotTemplate;
3924
+ if (!slotTemplate7) {
3925
+ slotTemplate7 = Document2.createElement("template");
3926
+ slotTemplate7.innerHTML = `<slot>${options.defaultContent || ""}</slot>`;
3927
+ }
3928
+ if (options.tooltipContent) {
3929
+ buttonHTML.querySelector('slot[name="tooltip-content"]').innerHTML = (_a3 = options.tooltipContent) != null ? _a3 : "";
3930
+ this.tooltipContent = options.tooltipContent;
3931
+ }
3932
+ this.nativeEl.appendChild(slotTemplate7.content.cloneNode(true));
3933
+ this.shadowRoot.appendChild(buttonHTML);
3934
+ this.tooltipEl = this.shadowRoot.querySelector("media-tooltip");
3935
+ }
3936
+ }
3937
+ static get observedAttributes() {
3938
+ return [
3939
+ "disabled",
3940
+ Attributes3.TOOLTIP_PLACEMENT,
3941
+ MediaStateReceiverAttributes.MEDIA_CONTROLLER
3942
+ ];
3943
+ }
3944
+ enable() {
3945
+ this.addEventListener("click", __privateGet6(this, _clickListener));
3946
+ this.addEventListener("keydown", __privateGet6(this, _keydownListener));
3947
+ this.tabIndex = 0;
3948
+ }
3949
+ disable() {
3950
+ this.removeEventListener("click", __privateGet6(this, _clickListener));
3951
+ this.removeEventListener("keydown", __privateGet6(this, _keydownListener));
3952
+ this.removeEventListener("keyup", __privateGet6(this, _keyupListener));
3953
+ this.tabIndex = -1;
3954
+ }
3955
+ attributeChangedCallback(attrName, oldValue, newValue) {
3956
+ var _a3, _b2, _c, _d, _e, _f, _g;
3957
+ if (attrName === MediaStateReceiverAttributes.MEDIA_CONTROLLER) {
3958
+ if (oldValue) {
3959
+ (_b2 = (_a3 = __privateGet6(this, _mediaController2)) == null ? void 0 : _a3.unassociateElement) == null ? void 0 : _b2.call(_a3, this);
3960
+ __privateSet6(this, _mediaController2, null);
3961
+ }
3962
+ if (newValue && this.isConnected) {
3963
+ __privateSet6(this, _mediaController2, (_c = this.getRootNode()) == null ? void 0 : _c.getElementById(newValue));
3964
+ (_e = (_d = __privateGet6(this, _mediaController2)) == null ? void 0 : _d.associateElement) == null ? void 0 : _e.call(_d, this);
3965
+ }
3966
+ } else if (attrName === "disabled" && newValue !== oldValue) {
3967
+ if (newValue == null) {
3968
+ this.enable();
3969
+ } else {
3970
+ this.disable();
3971
+ }
3972
+ } else if (attrName === Attributes3.TOOLTIP_PLACEMENT && this.tooltipEl && newValue !== oldValue) {
3973
+ this.tooltipEl.placement = newValue;
3974
+ }
3975
+ if (this.tooltipEl) {
3976
+ (_g = (_f = this.tooltipEl) == null ? void 0 : _f.updateXOffset) == null ? void 0 : _g.call(_f);
3977
+ }
3978
+ }
3979
+ connectedCallback() {
3980
+ var _a3, _b2, _c;
3981
+ const { style } = getOrInsertCSSRule(this.shadowRoot, ":host");
3982
+ style.setProperty(
3983
+ "display",
3984
+ `var(--media-control-display, var(--${this.localName}-display, inline-flex))`
3985
+ );
3986
+ if (!this.hasAttribute("disabled")) {
3987
+ this.enable();
3988
+ }
3989
+ this.setAttribute("role", "button");
3990
+ const mediaControllerId = this.getAttribute(
3991
+ MediaStateReceiverAttributes.MEDIA_CONTROLLER
3992
+ );
3993
+ if (mediaControllerId) {
3994
+ __privateSet6(
3995
+ this,
3996
+ _mediaController2,
3997
+ // @ts-ignore
3998
+ (_a3 = this.getRootNode()) == null ? void 0 : _a3.getElementById(mediaControllerId)
3999
+ );
4000
+ (_c = (_b2 = __privateGet6(this, _mediaController2)) == null ? void 0 : _b2.associateElement) == null ? void 0 : _c.call(_b2, this);
4001
+ }
4002
+ GlobalThis.customElements.whenDefined("media-tooltip").then(this.setupTooltip.bind(this));
4003
+ }
4004
+ disconnectedCallback() {
4005
+ var _a3, _b2, _c, _d;
4006
+ this.disable();
4007
+ (_b2 = (_a3 = __privateGet6(this, _mediaController2)) == null ? void 0 : _a3.unassociateElement) == null ? void 0 : _b2.call(_a3, this);
4008
+ __privateSet6(this, _mediaController2, null);
4009
+ this.removeEventListener("mouseenter", (_c = this.tooltipEl) == null ? void 0 : _c.updateXOffset);
4010
+ this.removeEventListener("focus", (_d = this.tooltipEl) == null ? void 0 : _d.updateXOffset);
4011
+ this.removeEventListener("click", __privateGet6(this, _clickListener));
4012
+ this.tooltipEl = null;
4013
+ }
4014
+ get keysUsed() {
4015
+ return ["Enter", " "];
4016
+ }
4017
+ /**
4018
+ * Get or set tooltip placement
4019
+ */
4020
+ get tooltipPlacement() {
4021
+ return getStringAttr(this, Attributes3.TOOLTIP_PLACEMENT);
4022
+ }
4023
+ set tooltipPlacement(value) {
4024
+ setStringAttr(this, Attributes3.TOOLTIP_PLACEMENT, value);
4025
+ }
4026
+ /**
4027
+ * @abstract
4028
+ * @argument {Event} e
4029
+ */
4030
+ handleClick(e) {
4031
+ }
4032
+ // eslint-disable-line
4033
+ // Called when we know the tooltip is ready / defined
4034
+ setupTooltip() {
4035
+ this.addEventListener("mouseenter", this.tooltipEl.updateXOffset);
4036
+ this.addEventListener("focus", this.tooltipEl.updateXOffset);
4037
+ this.addEventListener("click", __privateGet6(this, _clickListener));
4038
+ const initialPlacement = this.tooltipPlacement;
4039
+ if (initialPlacement)
4040
+ this.tooltipEl.placement = initialPlacement;
4041
+ }
4042
+ };
4043
+ _mediaController2 = /* @__PURE__ */ new WeakMap();
4044
+ _clickListener = /* @__PURE__ */ new WeakMap();
4045
+ _keyupListener = /* @__PURE__ */ new WeakMap();
4046
+ _keydownListener = /* @__PURE__ */ new WeakMap();
4047
+ if (!GlobalThis.customElements.get("media-chrome-button")) {
4048
+ GlobalThis.customElements.define("media-chrome-button", MediaChromeButton);
4049
+ }
4050
+
4051
+ // ../../node_modules/media-chrome/dist/menu/media-chrome-menu-button.js
4052
+ var MediaChromeMenuButton = class extends MediaChromeButton {
4053
+ connectedCallback() {
4054
+ super.connectedCallback();
4055
+ if (this.invokeTargetElement) {
4056
+ this.setAttribute("aria-haspopup", "menu");
4057
+ }
4058
+ }
4059
+ get invokeTarget() {
4060
+ return this.getAttribute("invoketarget");
4061
+ }
4062
+ set invokeTarget(value) {
4063
+ this.setAttribute("invoketarget", `${value}`);
4064
+ }
4065
+ /**
4066
+ * Returns the element with the id specified by the `invoketarget` attribute.
4067
+ * @return {HTMLElement | null}
4068
+ */
4069
+ get invokeTargetElement() {
4070
+ var _a3;
4071
+ if (this.invokeTarget) {
4072
+ return (_a3 = getDocumentOrShadowRoot(this)) == null ? void 0 : _a3.querySelector(
4073
+ `#${this.invokeTarget}`
4074
+ );
4075
+ }
4076
+ return null;
4077
+ }
4078
+ handleClick() {
4079
+ var _a3;
4080
+ (_a3 = this.invokeTargetElement) == null ? void 0 : _a3.dispatchEvent(
4081
+ new InvokeEvent({ relatedTarget: this })
4082
+ );
4083
+ }
4084
+ };
4085
+ if (!GlobalThis.customElements.get("media-chrome-menu-button")) {
4086
+ GlobalThis.customElements.define(
4087
+ "media-chrome-menu-button",
4088
+ MediaChromeMenuButton
4089
+ );
4090
+ }
4091
+
4092
+ // ../../node_modules/media-chrome/dist/labels/labels.js
4093
+ var tooltipLabels = {
4094
+ ENTER_AIRPLAY: "Start airplay",
4095
+ EXIT_AIRPLAY: "Stop airplay",
4096
+ AUDIO_TRACK_MENU: "Audio",
4097
+ CAPTIONS: "Captions",
4098
+ ENABLE_CAPTIONS: "Enable captions",
4099
+ DISABLE_CAPTIONS: "Disable captions",
4100
+ START_CAST: "Start casting",
4101
+ STOP_CAST: "Stop casting",
4102
+ ENTER_FULLSCREEN: "Enter fullscreen mode",
4103
+ EXIT_FULLSCREEN: "Exit fullscreen mode",
4104
+ MUTE: "Mute",
4105
+ UNMUTE: "Unmute",
4106
+ ENTER_PIP: "Enter picture in picture mode",
4107
+ EXIT_PIP: "Enter picture in picture mode",
4108
+ PLAY: "Play",
4109
+ PAUSE: "Pause",
4110
+ PLAYBACK_RATE: "Playback rate",
4111
+ RENDITIONS: "Quality",
4112
+ SEEK_BACKWARD: "Seek backward",
4113
+ SEEK_FORWARD: "Seek forward",
4114
+ SETTINGS: "Settings"
4115
+ };
4116
+ var nouns = {
4117
+ AUDIO_PLAYER: () => "audio player",
4118
+ VIDEO_PLAYER: () => "video player",
4119
+ VOLUME: () => "volume",
4120
+ SEEK: () => "seek",
4121
+ CLOSED_CAPTIONS: () => "closed captions",
4122
+ PLAYBACK_RATE: ({ playbackRate = 1 } = {}) => `current playback rate ${playbackRate}`,
4123
+ PLAYBACK_TIME: () => `playback time`,
4124
+ MEDIA_LOADING: () => `media loading`,
4125
+ SETTINGS: () => `settings`,
4126
+ AUDIO_TRACKS: () => `audio tracks`,
4127
+ QUALITY: () => `quality`
4128
+ };
4129
+ var verbs = {
4130
+ PLAY: () => "play",
4131
+ PAUSE: () => "pause",
4132
+ MUTE: () => "mute",
4133
+ UNMUTE: () => "unmute",
4134
+ ENTER_AIRPLAY: () => "start airplay",
4135
+ EXIT_AIRPLAY: () => "stop airplay",
4136
+ ENTER_CAST: () => "start casting",
4137
+ EXIT_CAST: () => "stop casting",
4138
+ ENTER_FULLSCREEN: () => "enter fullscreen mode",
4139
+ EXIT_FULLSCREEN: () => "exit fullscreen mode",
4140
+ ENTER_PIP: () => "enter picture in picture mode",
4141
+ EXIT_PIP: () => "exit picture in picture mode",
4142
+ SEEK_FORWARD_N_SECS: ({ seekOffset = 30 } = {}) => `seek forward ${seekOffset} seconds`,
4143
+ SEEK_BACK_N_SECS: ({ seekOffset = 30 } = {}) => `seek back ${seekOffset} seconds`,
4144
+ SEEK_LIVE: () => "seek to live",
4145
+ PLAYING_LIVE: () => "playing live"
4146
+ };
4147
+ var labels_default = {
4148
+ ...nouns,
4149
+ ...verbs
4150
+ };
4151
+
4152
+ // ../../node_modules/media-chrome/dist/menu/media-settings-menu-button.js
4153
+ var slotTemplate = Document2.createElement("template");
4154
+ slotTemplate.innerHTML = /*html*/
4155
+ `
4156
+ <style>
4157
+ :host([aria-expanded="true"]) slot[name=tooltip] {
4158
+ display: none;
4159
+ }
4160
+ </style>
4161
+ <slot name="icon">
4162
+ <svg aria-hidden="true" viewBox="0 0 24 24">
4163
+ <path d="M4.5 14.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Zm7.5 0a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Zm7.5 0a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z"/>
4164
+ </svg>
4165
+ </slot>
4166
+ `;
4167
+ var MediaSettingsMenuButton = class extends MediaChromeMenuButton {
4168
+ static get observedAttributes() {
4169
+ return [...super.observedAttributes, "target"];
4170
+ }
4171
+ constructor() {
4172
+ super({ slotTemplate, tooltipContent: tooltipLabels.SETTINGS });
4173
+ }
4174
+ connectedCallback() {
4175
+ super.connectedCallback();
4176
+ this.setAttribute("aria-label", nouns.SETTINGS());
4177
+ }
4178
+ /**
4179
+ * Returns the element with the id specified by the `invoketarget` attribute.
4180
+ * @return {HTMLElement | null}
4181
+ */
4182
+ get invokeTargetElement() {
4183
+ if (this.invokeTarget != void 0)
4184
+ return super.invokeTargetElement;
4185
+ return getMediaController(this).querySelector("media-settings-menu");
4186
+ }
4187
+ };
4188
+ if (!GlobalThis.customElements.get("media-settings-menu-button")) {
4189
+ GlobalThis.customElements.define(
4190
+ "media-settings-menu-button",
4191
+ MediaSettingsMenuButton
4192
+ );
4193
+ }
4194
+
4195
+ // ../../node_modules/media-chrome/dist/menu/media-audio-track-menu.js
4196
+ var __accessCheck7 = (obj, member, msg) => {
4197
+ if (!member.has(obj))
4198
+ throw TypeError("Cannot " + msg);
4199
+ };
4200
+ var __privateGet7 = (obj, member, getter) => {
4201
+ __accessCheck7(obj, member, "read from private field");
4202
+ return getter ? getter.call(obj) : member.get(obj);
4203
+ };
4204
+ var __privateAdd7 = (obj, member, value) => {
4205
+ if (member.has(obj))
4206
+ throw TypeError("Cannot add the same private member more than once");
4207
+ member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
4208
+ };
4209
+ var __privateSet7 = (obj, member, value, setter) => {
4210
+ __accessCheck7(obj, member, "write to private field");
4211
+ setter ? setter.call(obj, value) : member.set(obj, value);
4212
+ return value;
4213
+ };
4214
+ var __privateMethod4 = (obj, member, method) => {
4215
+ __accessCheck7(obj, member, "access private method");
4216
+ return method;
4217
+ };
4218
+ var _audioTrackList;
4219
+ var _prevState;
4220
+ var _render;
4221
+ var render_fn;
4222
+ var _onChange;
4223
+ var onChange_fn;
4224
+ var MediaAudioTrackMenu = class extends MediaChromeMenu {
4225
+ constructor() {
4226
+ super(...arguments);
4227
+ __privateAdd7(this, _render);
4228
+ __privateAdd7(this, _onChange);
4229
+ __privateAdd7(this, _audioTrackList, []);
4230
+ __privateAdd7(this, _prevState, void 0);
4231
+ }
4232
+ static get observedAttributes() {
4233
+ return [
4234
+ ...super.observedAttributes,
4235
+ MediaUIAttributes.MEDIA_AUDIO_TRACK_LIST,
4236
+ MediaUIAttributes.MEDIA_AUDIO_TRACK_ENABLED,
4237
+ MediaUIAttributes.MEDIA_AUDIO_TRACK_UNAVAILABLE
4238
+ ];
4239
+ }
4240
+ attributeChangedCallback(attrName, oldValue, newValue) {
4241
+ super.attributeChangedCallback(attrName, oldValue, newValue);
4242
+ if (attrName === MediaUIAttributes.MEDIA_AUDIO_TRACK_ENABLED && oldValue !== newValue) {
4243
+ this.value = newValue;
4244
+ } else if (attrName === MediaUIAttributes.MEDIA_AUDIO_TRACK_LIST && oldValue !== newValue) {
4245
+ __privateSet7(this, _audioTrackList, parseAudioTrackList(newValue != null ? newValue : ""));
4246
+ __privateMethod4(this, _render, render_fn).call(this);
4247
+ }
4248
+ }
4249
+ connectedCallback() {
4250
+ super.connectedCallback();
4251
+ this.addEventListener("change", __privateMethod4(this, _onChange, onChange_fn));
4252
+ }
4253
+ disconnectedCallback() {
4254
+ super.disconnectedCallback();
4255
+ this.removeEventListener("change", __privateMethod4(this, _onChange, onChange_fn));
4256
+ }
4257
+ /**
4258
+ * Returns the anchor element when it is a floating menu.
4259
+ */
4260
+ get anchorElement() {
4261
+ var _a3;
4262
+ if (this.anchor !== "auto")
4263
+ return super.anchorElement;
4264
+ return (_a3 = getMediaController(this)) == null ? void 0 : _a3.querySelector(
4265
+ "media-audio-track-menu-button"
4266
+ );
4267
+ }
4268
+ get mediaAudioTrackList() {
4269
+ return __privateGet7(this, _audioTrackList);
4270
+ }
4271
+ set mediaAudioTrackList(list) {
4272
+ __privateSet7(this, _audioTrackList, list);
4273
+ __privateMethod4(this, _render, render_fn).call(this);
4274
+ }
4275
+ /**
4276
+ * Get enabled audio track id.
4277
+ */
4278
+ get mediaAudioTrackEnabled() {
4279
+ var _a3;
4280
+ return (_a3 = getStringAttr(this, MediaUIAttributes.MEDIA_AUDIO_TRACK_ENABLED)) != null ? _a3 : "";
4281
+ }
4282
+ set mediaAudioTrackEnabled(id) {
4283
+ setStringAttr(this, MediaUIAttributes.MEDIA_AUDIO_TRACK_ENABLED, id);
4284
+ }
4285
+ };
4286
+ _audioTrackList = /* @__PURE__ */ new WeakMap();
4287
+ _prevState = /* @__PURE__ */ new WeakMap();
4288
+ _render = /* @__PURE__ */ new WeakSet();
4289
+ render_fn = function() {
4290
+ if (__privateGet7(this, _prevState) === JSON.stringify(this.mediaAudioTrackList))
4291
+ return;
4292
+ __privateSet7(this, _prevState, JSON.stringify(this.mediaAudioTrackList));
4293
+ const audioTrackList = this.mediaAudioTrackList;
4294
+ this.defaultSlot.textContent = "";
4295
+ for (const audioTrack of audioTrackList) {
4296
+ const text = this.formatMenuItemText(audioTrack.label, audioTrack);
4297
+ const item = createMenuItem({
4298
+ type: "radio",
4299
+ text,
4300
+ value: `${audioTrack.id}`,
4301
+ checked: audioTrack.enabled
4302
+ });
4303
+ item.prepend(createIndicator(this, "checked-indicator"));
4304
+ this.defaultSlot.append(item);
4305
+ }
4306
+ };
4307
+ _onChange = /* @__PURE__ */ new WeakSet();
4308
+ onChange_fn = function() {
4309
+ if (this.value == null)
4310
+ return;
4311
+ const event = new GlobalThis.CustomEvent(
4312
+ MediaUIEvents.MEDIA_AUDIO_TRACK_REQUEST,
4313
+ {
4314
+ composed: true,
4315
+ bubbles: true,
4316
+ detail: this.value
4317
+ }
4318
+ );
4319
+ this.dispatchEvent(event);
4320
+ };
4321
+ if (!GlobalThis.customElements.get("media-audio-track-menu")) {
4322
+ GlobalThis.customElements.define(
4323
+ "media-audio-track-menu",
4324
+ MediaAudioTrackMenu
4325
+ );
4326
+ }
4327
+
4328
+ // ../../node_modules/media-chrome/dist/menu/media-audio-track-menu-button.js
4329
+ var audioTrackIcon = (
4330
+ /*html*/
4331
+ `<svg aria-hidden="true" viewBox="0 0 24 24">
4332
+ <path d="M11 17H9.5V7H11v10Zm-3-3H6.5v-4H8v4Zm6-5h-1.5v6H14V9Zm3 7h-1.5V8H17v8Z"/>
4333
+ <path d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Zm-2 0a8 8 0 1 0-16 0 8 8 0 0 0 16 0Z"/>
4334
+ </svg>`
4335
+ );
4336
+ var slotTemplate2 = Document2.createElement("template");
4337
+ slotTemplate2.innerHTML = /*html*/
4338
+ `
4339
+ <style>
4340
+ :host([aria-expanded="true"]) slot[name=tooltip] {
4341
+ display: none;
4342
+ }
4343
+ </style>
4344
+ <slot name="icon">${audioTrackIcon}</slot>
4345
+ `;
4346
+ var MediaAudioTrackMenuButton = class extends MediaChromeMenuButton {
4347
+ static get observedAttributes() {
4348
+ return [
4349
+ ...super.observedAttributes,
4350
+ MediaUIAttributes.MEDIA_AUDIO_TRACK_ENABLED,
4351
+ MediaUIAttributes.MEDIA_AUDIO_TRACK_UNAVAILABLE
4352
+ ];
4353
+ }
4354
+ constructor() {
4355
+ super({ slotTemplate: slotTemplate2, tooltipContent: tooltipLabels.AUDIO_TRACK_MENU });
4356
+ }
4357
+ connectedCallback() {
4358
+ super.connectedCallback();
4359
+ this.setAttribute("aria-label", nouns.AUDIO_TRACKS());
4360
+ }
4361
+ attributeChangedCallback(attrName, oldValue, newValue) {
4362
+ super.attributeChangedCallback(attrName, oldValue, newValue);
4363
+ }
4364
+ /**
4365
+ * Returns the element with the id specified by the `invoketarget` attribute.
4366
+ * @return {HTMLElement | null}
4367
+ */
4368
+ get invokeTargetElement() {
4369
+ var _a3;
4370
+ if (this.invokeTarget != void 0)
4371
+ return super.invokeTargetElement;
4372
+ return (_a3 = getMediaController(this)) == null ? void 0 : _a3.querySelector("media-audio-track-menu");
4373
+ }
4374
+ /**
4375
+ * Get enabled audio track id.
4376
+ * @return {string}
4377
+ */
4378
+ get mediaAudioTrackEnabled() {
4379
+ var _a3;
4380
+ return (_a3 = getStringAttr(this, MediaUIAttributes.MEDIA_AUDIO_TRACK_ENABLED)) != null ? _a3 : "";
4381
+ }
4382
+ set mediaAudioTrackEnabled(id) {
4383
+ setStringAttr(this, MediaUIAttributes.MEDIA_AUDIO_TRACK_ENABLED, id);
4384
+ }
4385
+ };
4386
+ if (!GlobalThis.customElements.get("media-audio-track-menu-button")) {
4387
+ GlobalThis.customElements.define(
4388
+ "media-audio-track-menu-button",
4389
+ MediaAudioTrackMenuButton
4390
+ );
4391
+ }
4392
+
4393
+ // ../../node_modules/media-chrome/dist/utils/captions.js
4394
+ var splitTextTracksStr = (textTracksStr = "") => textTracksStr.split(/\s+/);
4395
+ var parseTextTrackStr = (textTrackStr = "") => {
4396
+ const [kind, language, encodedLabel] = textTrackStr.split(":");
4397
+ const label = encodedLabel ? decodeURIComponent(encodedLabel) : void 0;
4398
+ return {
4399
+ kind: kind === "cc" ? TextTrackKinds.CAPTIONS : TextTrackKinds.SUBTITLES,
4400
+ language,
4401
+ label
4402
+ };
4403
+ };
4404
+ var parseTextTracksStr = (textTracksStr = "", textTrackLikeObj = {}) => {
4405
+ return splitTextTracksStr(textTracksStr).map((textTrackStr) => {
4406
+ const textTrackObj = parseTextTrackStr(textTrackStr);
4407
+ return {
4408
+ ...textTrackLikeObj,
4409
+ ...textTrackObj
4410
+ };
4411
+ });
4412
+ };
4413
+ var formatTextTrackObj = ({ kind, label, language } = { kind: "subtitles" }) => {
4414
+ if (!label)
4415
+ return language;
4416
+ return `${kind === "captions" ? "cc" : "sb"}:${language}:${encodeURIComponent(
4417
+ label
4418
+ )}`;
4419
+ };
4420
+ var stringifyTextTrackList = (textTracks = []) => {
4421
+ return Array.prototype.map.call(textTracks, formatTextTrackObj).join(" ");
4422
+ };
4423
+ var areSubsOn = (el) => {
4424
+ var _a3;
4425
+ const showingSubtitles = !!((_a3 = el.mediaSubtitlesShowing) == null ? void 0 : _a3.length) || el.hasAttribute(MediaUIAttributes.MEDIA_SUBTITLES_SHOWING);
4426
+ return showingSubtitles;
4427
+ };
4428
+
4429
+ // ../../node_modules/media-chrome/dist/menu/media-captions-menu.js
4430
+ var __accessCheck8 = (obj, member, msg) => {
4431
+ if (!member.has(obj))
4432
+ throw TypeError("Cannot " + msg);
4433
+ };
4434
+ var __privateGet8 = (obj, member, getter) => {
4435
+ __accessCheck8(obj, member, "read from private field");
4436
+ return getter ? getter.call(obj) : member.get(obj);
4437
+ };
4438
+ var __privateAdd8 = (obj, member, value) => {
4439
+ if (member.has(obj))
4440
+ throw TypeError("Cannot add the same private member more than once");
4441
+ member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
4442
+ };
4443
+ var __privateSet8 = (obj, member, value, setter) => {
4444
+ __accessCheck8(obj, member, "write to private field");
4445
+ setter ? setter.call(obj, value) : member.set(obj, value);
4446
+ return value;
4447
+ };
4448
+ var __privateMethod5 = (obj, member, method) => {
4449
+ __accessCheck8(obj, member, "access private method");
4450
+ return method;
4451
+ };
4452
+ var _prevState2;
4453
+ var _render2;
4454
+ var render_fn2;
4455
+ var _onChange2;
4456
+ var onChange_fn2;
4457
+ var ccIcon = (
4458
+ /*html*/
4459
+ `
4460
+ <svg aria-hidden="true" viewBox="0 0 26 24" part="captions-indicator indicator">
4461
+ <path d="M22.83 5.68a2.58 2.58 0 0 0-2.3-2.5c-3.62-.24-11.44-.24-15.06 0a2.58 2.58 0 0 0-2.3 2.5c-.23 4.21-.23 8.43 0 12.64a2.58 2.58 0 0 0 2.3 2.5c3.62.24 11.44.24 15.06 0a2.58 2.58 0 0 0 2.3-2.5c.23-4.21.23-8.43 0-12.64Zm-11.39 9.45a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.92 3.92 0 0 1 .92-2.77 3.18 3.18 0 0 1 2.43-1 2.94 2.94 0 0 1 2.13.78c.364.359.62.813.74 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.17 1.61 1.61 0 0 0-1.29.58 2.79 2.79 0 0 0-.5 1.89 3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.48 1.48 0 0 0 1-.37 2.1 2.1 0 0 0 .59-1.14l1.4.44a3.23 3.23 0 0 1-1.07 1.69Zm7.22 0a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.88 3.88 0 0 1 .93-2.77 3.14 3.14 0 0 1 2.42-1 3 3 0 0 1 2.16.82 2.8 2.8 0 0 1 .73 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.21 1.61 1.61 0 0 0-1.29.58A2.79 2.79 0 0 0 15 12a3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.44 1.44 0 0 0 1-.37 2.1 2.1 0 0 0 .6-1.15l1.4.44a3.17 3.17 0 0 1-1.1 1.7Z"/>
4462
+ </svg>`
4463
+ );
4464
+ var template6 = Document2.createElement("template");
4465
+ template6.innerHTML = MediaChromeMenu.template.innerHTML + /*html*/
4466
+ `
4467
+ <slot name="captions-indicator" hidden>${ccIcon}</slot>`;
4468
+ var MediaCaptionsMenu = class extends MediaChromeMenu {
4469
+ constructor() {
4470
+ super(...arguments);
4471
+ __privateAdd8(this, _render2);
4472
+ __privateAdd8(this, _onChange2);
4473
+ __privateAdd8(this, _prevState2, void 0);
4474
+ }
4475
+ static get observedAttributes() {
4476
+ return [
4477
+ ...super.observedAttributes,
4478
+ MediaUIAttributes.MEDIA_SUBTITLES_LIST,
4479
+ MediaUIAttributes.MEDIA_SUBTITLES_SHOWING
4480
+ ];
4481
+ }
4482
+ attributeChangedCallback(attrName, oldValue, newValue) {
4483
+ super.attributeChangedCallback(attrName, oldValue, newValue);
4484
+ if (attrName === MediaUIAttributes.MEDIA_SUBTITLES_LIST && oldValue !== newValue) {
4485
+ __privateMethod5(this, _render2, render_fn2).call(this);
4486
+ } else if (attrName === MediaUIAttributes.MEDIA_SUBTITLES_SHOWING && oldValue !== newValue) {
4487
+ this.value = newValue;
4488
+ }
4489
+ }
4490
+ connectedCallback() {
4491
+ super.connectedCallback();
4492
+ this.addEventListener("change", __privateMethod5(this, _onChange2, onChange_fn2));
4493
+ }
4494
+ disconnectedCallback() {
4495
+ super.disconnectedCallback();
4496
+ this.removeEventListener("change", __privateMethod5(this, _onChange2, onChange_fn2));
4497
+ }
4498
+ /**
4499
+ * Returns the anchor element when it is a floating menu.
4500
+ */
4501
+ get anchorElement() {
4502
+ if (this.anchor !== "auto")
4503
+ return super.anchorElement;
4504
+ return getMediaController(this).querySelector("media-captions-menu-button");
4505
+ }
4506
+ /**
4507
+ * @type {Array<object>} An array of TextTrack-like objects.
4508
+ * Objects must have the properties: kind, language, and label.
4509
+ */
4510
+ get mediaSubtitlesList() {
4511
+ return getSubtitlesListAttr(this, MediaUIAttributes.MEDIA_SUBTITLES_LIST);
4512
+ }
4513
+ set mediaSubtitlesList(list) {
4514
+ setSubtitlesListAttr(this, MediaUIAttributes.MEDIA_SUBTITLES_LIST, list);
4515
+ }
4516
+ /**
4517
+ * An array of TextTrack-like objects.
4518
+ * Objects must have the properties: kind, language, and label.
4519
+ */
4520
+ get mediaSubtitlesShowing() {
4521
+ return getSubtitlesListAttr(
4522
+ this,
4523
+ MediaUIAttributes.MEDIA_SUBTITLES_SHOWING
4524
+ );
4525
+ }
4526
+ set mediaSubtitlesShowing(list) {
4527
+ setSubtitlesListAttr(this, MediaUIAttributes.MEDIA_SUBTITLES_SHOWING, list);
4528
+ }
4529
+ };
4530
+ _prevState2 = /* @__PURE__ */ new WeakMap();
4531
+ _render2 = /* @__PURE__ */ new WeakSet();
4532
+ render_fn2 = function() {
4533
+ var _a3;
4534
+ if (__privateGet8(this, _prevState2) === JSON.stringify(this.mediaSubtitlesList))
4535
+ return;
4536
+ __privateSet8(this, _prevState2, JSON.stringify(this.mediaSubtitlesList));
4537
+ this.defaultSlot.textContent = "";
4538
+ const isOff = !this.value;
4539
+ const item = createMenuItem({
4540
+ type: "radio",
4541
+ text: this.formatMenuItemText("Off"),
4542
+ value: "off",
4543
+ checked: isOff
4544
+ });
4545
+ item.prepend(createIndicator(this, "checked-indicator"));
4546
+ this.defaultSlot.append(item);
4547
+ const subtitlesList = this.mediaSubtitlesList;
4548
+ for (const subs of subtitlesList) {
4549
+ const item2 = createMenuItem({
4550
+ type: "radio",
4551
+ text: this.formatMenuItemText(subs.label, subs),
4552
+ value: formatTextTrackObj(subs),
4553
+ checked: this.value == formatTextTrackObj(subs)
4554
+ });
4555
+ item2.prepend(createIndicator(this, "checked-indicator"));
4556
+ const type = (_a3 = subs.kind) != null ? _a3 : "subs";
4557
+ if (type === "captions") {
4558
+ item2.append(createIndicator(this, "captions-indicator"));
4559
+ }
4560
+ this.defaultSlot.append(item2);
4561
+ }
4562
+ };
4563
+ _onChange2 = /* @__PURE__ */ new WeakSet();
4564
+ onChange_fn2 = function() {
4565
+ const showingSubs = this.mediaSubtitlesShowing;
4566
+ const showingSubsStr = this.getAttribute(
4567
+ MediaUIAttributes.MEDIA_SUBTITLES_SHOWING
4568
+ );
4569
+ const localStateChange = this.value !== showingSubsStr;
4570
+ if ((showingSubs == null ? void 0 : showingSubs.length) && localStateChange) {
4571
+ this.dispatchEvent(
4572
+ new GlobalThis.CustomEvent(
4573
+ MediaUIEvents.MEDIA_DISABLE_SUBTITLES_REQUEST,
4574
+ {
4575
+ composed: true,
4576
+ bubbles: true,
4577
+ detail: showingSubs
4578
+ }
4579
+ )
4580
+ );
4581
+ }
4582
+ if (!this.value || !localStateChange)
4583
+ return;
4584
+ const event = new GlobalThis.CustomEvent(
4585
+ MediaUIEvents.MEDIA_SHOW_SUBTITLES_REQUEST,
4586
+ {
4587
+ composed: true,
4588
+ bubbles: true,
4589
+ detail: this.value
4590
+ }
4591
+ );
4592
+ this.dispatchEvent(event);
4593
+ };
4594
+ MediaCaptionsMenu.template = template6;
4595
+ var getSubtitlesListAttr = (el, attrName) => {
4596
+ const attrVal = el.getAttribute(attrName);
4597
+ return attrVal ? parseTextTracksStr(attrVal) : [];
4598
+ };
4599
+ var setSubtitlesListAttr = (el, attrName, list) => {
4600
+ if (!(list == null ? void 0 : list.length)) {
4601
+ el.removeAttribute(attrName);
4602
+ return;
4603
+ }
4604
+ const newValStr = stringifyTextTrackList(list);
4605
+ const oldVal = el.getAttribute(attrName);
4606
+ if (oldVal === newValStr)
4607
+ return;
4608
+ el.setAttribute(attrName, newValStr);
4609
+ };
4610
+ if (!GlobalThis.customElements.get("media-captions-menu")) {
4611
+ GlobalThis.customElements.define("media-captions-menu", MediaCaptionsMenu);
4612
+ }
4613
+
4614
+ // ../../node_modules/media-chrome/dist/menu/media-captions-menu-button.js
4615
+ var __accessCheck9 = (obj, member, msg) => {
4616
+ if (!member.has(obj))
4617
+ throw TypeError("Cannot " + msg);
4618
+ };
4619
+ var __privateAdd9 = (obj, member, value) => {
4620
+ if (member.has(obj))
4621
+ throw TypeError("Cannot add the same private member more than once");
4622
+ member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
4623
+ };
4624
+ var __privateSet9 = (obj, member, value, setter) => {
4625
+ __accessCheck9(obj, member, "write to private field");
4626
+ setter ? setter.call(obj, value) : member.set(obj, value);
4627
+ return value;
4628
+ };
4629
+ var _captionsReady;
4630
+ var ccIconOn = `<svg aria-hidden="true" viewBox="0 0 26 24">
4631
+ <path d="M22.83 5.68a2.58 2.58 0 0 0-2.3-2.5c-3.62-.24-11.44-.24-15.06 0a2.58 2.58 0 0 0-2.3 2.5c-.23 4.21-.23 8.43 0 12.64a2.58 2.58 0 0 0 2.3 2.5c3.62.24 11.44.24 15.06 0a2.58 2.58 0 0 0 2.3-2.5c.23-4.21.23-8.43 0-12.64Zm-11.39 9.45a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.92 3.92 0 0 1 .92-2.77 3.18 3.18 0 0 1 2.43-1 2.94 2.94 0 0 1 2.13.78c.364.359.62.813.74 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.17 1.61 1.61 0 0 0-1.29.58 2.79 2.79 0 0 0-.5 1.89 3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.48 1.48 0 0 0 1-.37 2.1 2.1 0 0 0 .59-1.14l1.4.44a3.23 3.23 0 0 1-1.07 1.69Zm7.22 0a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.88 3.88 0 0 1 .93-2.77 3.14 3.14 0 0 1 2.42-1 3 3 0 0 1 2.16.82 2.8 2.8 0 0 1 .73 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.21 1.61 1.61 0 0 0-1.29.58A2.79 2.79 0 0 0 15 12a3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.44 1.44 0 0 0 1-.37 2.1 2.1 0 0 0 .6-1.15l1.4.44a3.17 3.17 0 0 1-1.1 1.7Z"/>
4632
+ </svg>`;
4633
+ var ccIconOff = `<svg aria-hidden="true" viewBox="0 0 26 24">
4634
+ <path d="M17.73 14.09a1.4 1.4 0 0 1-1 .37 1.579 1.579 0 0 1-1.27-.58A3 3 0 0 1 15 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34A2.89 2.89 0 0 0 19 9.07a3 3 0 0 0-2.14-.78 3.14 3.14 0 0 0-2.42 1 3.91 3.91 0 0 0-.93 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.17 3.17 0 0 0 1.07-1.74l-1.4-.45c-.083.43-.3.822-.62 1.12Zm-7.22 0a1.43 1.43 0 0 1-1 .37 1.58 1.58 0 0 1-1.27-.58A3 3 0 0 1 7.76 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34a2.81 2.81 0 0 0-.74-1.32 2.94 2.94 0 0 0-2.13-.78 3.18 3.18 0 0 0-2.43 1 4 4 0 0 0-.92 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.23 3.23 0 0 0 1.07-1.74l-1.4-.45a2.06 2.06 0 0 1-.6 1.07Zm12.32-8.41a2.59 2.59 0 0 0-2.3-2.51C18.72 3.05 15.86 3 13 3c-2.86 0-5.72.05-7.53.17a2.59 2.59 0 0 0-2.3 2.51c-.23 4.207-.23 8.423 0 12.63a2.57 2.57 0 0 0 2.3 2.5c1.81.13 4.67.19 7.53.19 2.86 0 5.72-.06 7.53-.19a2.57 2.57 0 0 0 2.3-2.5c.23-4.207.23-8.423 0-12.63Zm-1.49 12.53a1.11 1.11 0 0 1-.91 1.11c-1.67.11-4.45.18-7.43.18-2.98 0-5.76-.07-7.43-.18a1.11 1.11 0 0 1-.91-1.11c-.21-4.14-.21-8.29 0-12.43a1.11 1.11 0 0 1 .91-1.11C7.24 4.56 10 4.49 13 4.49s5.76.07 7.43.18a1.11 1.11 0 0 1 .91 1.11c.21 4.14.21 8.29 0 12.43Z"/>
4635
+ </svg>`;
4636
+ var slotTemplate3 = Document2.createElement("template");
4637
+ slotTemplate3.innerHTML = /*html*/
4638
+ `
4639
+ <style>
4640
+ :host([aria-checked="true"]) slot[name=off] {
4641
+ display: none !important;
4642
+ }
4643
+
4644
+ ${/* Double negative, but safer if display doesn't equal 'block' */
4645
+ ""}
4646
+ :host(:not([aria-checked="true"])) slot[name=on] {
4647
+ display: none !important;
4648
+ }
4649
+
4650
+ :host([aria-expanded="true"]) slot[name=tooltip] {
4651
+ display: none;
4652
+ }
4653
+ </style>
4654
+
4655
+ <slot name="icon">
4656
+ <slot name="on">${ccIconOn}</slot>
4657
+ <slot name="off">${ccIconOff}</slot>
4658
+ </slot>
4659
+ `;
4660
+ var updateAriaChecked = (el) => {
4661
+ el.setAttribute("aria-checked", areSubsOn(el).toString());
4662
+ };
4663
+ var MediaCaptionsMenuButton = class extends MediaChromeMenuButton {
4664
+ constructor(options = {}) {
4665
+ super({ slotTemplate: slotTemplate3, tooltipContent: tooltipLabels.CAPTIONS, ...options });
4666
+ __privateAdd9(this, _captionsReady, void 0);
4667
+ __privateSet9(this, _captionsReady, false);
4668
+ }
4669
+ static get observedAttributes() {
4670
+ return [
4671
+ ...super.observedAttributes,
4672
+ MediaUIAttributes.MEDIA_SUBTITLES_LIST,
4673
+ MediaUIAttributes.MEDIA_SUBTITLES_SHOWING
4674
+ ];
4675
+ }
4676
+ connectedCallback() {
4677
+ super.connectedCallback();
4678
+ this.setAttribute("aria-label", nouns.CLOSED_CAPTIONS());
4679
+ updateAriaChecked(this);
4680
+ }
4681
+ attributeChangedCallback(attrName, oldValue, newValue) {
4682
+ super.attributeChangedCallback(attrName, oldValue, newValue);
4683
+ if (attrName === MediaUIAttributes.MEDIA_SUBTITLES_SHOWING) {
4684
+ updateAriaChecked(this);
4685
+ }
4686
+ }
4687
+ /**
4688
+ * Returns the element with the id specified by the `invoketarget` attribute.
4689
+ * @return {HTMLElement | null}
4690
+ */
4691
+ get invokeTargetElement() {
4692
+ var _a3;
4693
+ if (this.invokeTarget != void 0)
4694
+ return super.invokeTargetElement;
4695
+ return (_a3 = getMediaController(this)) == null ? void 0 : _a3.querySelector("media-captions-menu");
4696
+ }
4697
+ /**
4698
+ * An array of TextTrack-like objects.
4699
+ * Objects must have the properties: kind, language, and label.
4700
+ */
4701
+ get mediaSubtitlesList() {
4702
+ return getSubtitlesListAttr2(this, MediaUIAttributes.MEDIA_SUBTITLES_LIST);
4703
+ }
4704
+ set mediaSubtitlesList(list) {
4705
+ setSubtitlesListAttr2(this, MediaUIAttributes.MEDIA_SUBTITLES_LIST, list);
4706
+ }
4707
+ /**
4708
+ * An array of TextTrack-like objects.
4709
+ * Objects must have the properties: kind, language, and label.
4710
+ */
4711
+ get mediaSubtitlesShowing() {
4712
+ return getSubtitlesListAttr2(
4713
+ this,
4714
+ MediaUIAttributes.MEDIA_SUBTITLES_SHOWING
4715
+ );
4716
+ }
4717
+ set mediaSubtitlesShowing(list) {
4718
+ setSubtitlesListAttr2(this, MediaUIAttributes.MEDIA_SUBTITLES_SHOWING, list);
4719
+ }
4720
+ };
4721
+ _captionsReady = /* @__PURE__ */ new WeakMap();
4722
+ var getSubtitlesListAttr2 = (el, attrName) => {
4723
+ const attrVal = el.getAttribute(attrName);
4724
+ return attrVal ? parseTextTracksStr(attrVal) : [];
4725
+ };
4726
+ var setSubtitlesListAttr2 = (el, attrName, list) => {
4727
+ if (!(list == null ? void 0 : list.length)) {
4728
+ el.removeAttribute(attrName);
4729
+ return;
4730
+ }
4731
+ const newValStr = stringifyTextTrackList(list);
4732
+ const oldVal = el.getAttribute(attrName);
4733
+ if (oldVal === newValStr)
4734
+ return;
4735
+ el.setAttribute(attrName, newValStr);
4736
+ };
4737
+ if (!GlobalThis.customElements.get("media-captions-menu-button")) {
4738
+ GlobalThis.customElements.define(
4739
+ "media-captions-menu-button",
4740
+ MediaCaptionsMenuButton
4741
+ );
4742
+ }
4743
+
4744
+ // ../../node_modules/media-chrome/dist/utils/attribute-token-list.js
4745
+ var __accessCheck10 = (obj, member, msg) => {
4746
+ if (!member.has(obj))
4747
+ throw TypeError("Cannot " + msg);
4748
+ };
4749
+ var __privateGet9 = (obj, member, getter) => {
4750
+ __accessCheck10(obj, member, "read from private field");
4751
+ return getter ? getter.call(obj) : member.get(obj);
4752
+ };
4753
+ var __privateAdd10 = (obj, member, value) => {
4754
+ if (member.has(obj))
4755
+ throw TypeError("Cannot add the same private member more than once");
4756
+ member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
4757
+ };
4758
+ var __privateSet10 = (obj, member, value, setter) => {
4759
+ __accessCheck10(obj, member, "write to private field");
4760
+ setter ? setter.call(obj, value) : member.set(obj, value);
4761
+ return value;
4762
+ };
4763
+ var _el;
4764
+ var _attr;
4765
+ var _defaultSet;
4766
+ var _tokenSet;
4767
+ var _tokens;
4768
+ var tokens_get;
4769
+ var AttributeTokenList = class {
4770
+ constructor(el, attr, { defaultValue } = { defaultValue: void 0 }) {
4771
+ __privateAdd10(this, _tokens);
4772
+ __privateAdd10(this, _el, void 0);
4773
+ __privateAdd10(this, _attr, void 0);
4774
+ __privateAdd10(this, _defaultSet, void 0);
4775
+ __privateAdd10(this, _tokenSet, /* @__PURE__ */ new Set());
4776
+ __privateSet10(this, _el, el);
4777
+ __privateSet10(this, _attr, attr);
4778
+ __privateSet10(this, _defaultSet, new Set(defaultValue));
4779
+ }
4780
+ [Symbol.iterator]() {
4781
+ return __privateGet9(this, _tokens, tokens_get).values();
4782
+ }
4783
+ get length() {
4784
+ return __privateGet9(this, _tokens, tokens_get).size;
4785
+ }
4786
+ get value() {
4787
+ var _a3;
4788
+ return (_a3 = [...__privateGet9(this, _tokens, tokens_get)].join(" ")) != null ? _a3 : "";
4789
+ }
4790
+ set value(val) {
4791
+ var _a3;
4792
+ if (val === this.value)
4793
+ return;
4794
+ __privateSet10(this, _tokenSet, /* @__PURE__ */ new Set());
4795
+ this.add(...(_a3 = val == null ? void 0 : val.split(" ")) != null ? _a3 : []);
4796
+ }
4797
+ toString() {
4798
+ return this.value;
4799
+ }
4800
+ item(index) {
4801
+ return [...__privateGet9(this, _tokens, tokens_get)][index];
4802
+ }
4803
+ values() {
4804
+ return __privateGet9(this, _tokens, tokens_get).values();
4805
+ }
4806
+ forEach(callback, thisArg) {
4807
+ __privateGet9(this, _tokens, tokens_get).forEach(callback, thisArg);
4808
+ }
4809
+ add(...tokens) {
4810
+ var _a3, _b2;
4811
+ tokens.forEach((t) => __privateGet9(this, _tokenSet).add(t));
4812
+ if (this.value === "" && !((_a3 = __privateGet9(this, _el)) == null ? void 0 : _a3.hasAttribute(`${__privateGet9(this, _attr)}`))) {
4813
+ return;
4814
+ }
4815
+ (_b2 = __privateGet9(this, _el)) == null ? void 0 : _b2.setAttribute(`${__privateGet9(this, _attr)}`, `${this.value}`);
4816
+ }
4817
+ remove(...tokens) {
4818
+ var _a3;
4819
+ tokens.forEach((t) => __privateGet9(this, _tokenSet).delete(t));
4820
+ (_a3 = __privateGet9(this, _el)) == null ? void 0 : _a3.setAttribute(`${__privateGet9(this, _attr)}`, `${this.value}`);
4821
+ }
4822
+ contains(token) {
4823
+ return __privateGet9(this, _tokens, tokens_get).has(token);
4824
+ }
4825
+ toggle(token, force) {
4826
+ if (typeof force !== "undefined") {
4827
+ if (force) {
4828
+ this.add(token);
4829
+ return true;
4830
+ } else {
4831
+ this.remove(token);
4832
+ return false;
4833
+ }
4834
+ }
4835
+ if (this.contains(token)) {
4836
+ this.remove(token);
4837
+ return false;
4838
+ }
4839
+ this.add(token);
4840
+ return true;
4841
+ }
4842
+ replace(oldToken, newToken) {
4843
+ this.remove(oldToken);
4844
+ this.add(newToken);
4845
+ return oldToken === newToken;
4846
+ }
4847
+ };
4848
+ _el = /* @__PURE__ */ new WeakMap();
4849
+ _attr = /* @__PURE__ */ new WeakMap();
4850
+ _defaultSet = /* @__PURE__ */ new WeakMap();
4851
+ _tokenSet = /* @__PURE__ */ new WeakMap();
4852
+ _tokens = /* @__PURE__ */ new WeakSet();
4853
+ tokens_get = function() {
4854
+ return __privateGet9(this, _tokenSet).size ? __privateGet9(this, _tokenSet) : __privateGet9(this, _defaultSet);
4855
+ };
4856
+
4857
+ // ../../node_modules/media-chrome/dist/media-playback-rate-button.js
4858
+ var __accessCheck11 = (obj, member, msg) => {
4859
+ if (!member.has(obj))
4860
+ throw TypeError("Cannot " + msg);
4861
+ };
4862
+ var __privateGet10 = (obj, member, getter) => {
4863
+ __accessCheck11(obj, member, "read from private field");
4864
+ return getter ? getter.call(obj) : member.get(obj);
4865
+ };
4866
+ var __privateAdd11 = (obj, member, value) => {
4867
+ if (member.has(obj))
4868
+ throw TypeError("Cannot add the same private member more than once");
4869
+ member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
4870
+ };
4871
+ var _rates;
4872
+ var Attributes4 = {
4873
+ RATES: "rates"
4874
+ };
4875
+ var DEFAULT_RATES = [1, 1.2, 1.5, 1.7, 2];
4876
+ var DEFAULT_RATE = 1;
4877
+ var slotTemplate4 = Document2.createElement("template");
4878
+ slotTemplate4.innerHTML = /*html*/
4879
+ `
4880
+ <style>
4881
+ :host {
4882
+ min-width: 5ch;
4883
+ padding: var(--media-button-padding, var(--media-control-padding, 10px 5px));
4884
+ }
4885
+ </style>
4886
+ <slot name="icon"></slot>
4887
+ `;
4888
+ var MediaPlaybackRateButton = class extends MediaChromeButton {
4889
+ constructor(options = {}) {
4890
+ super({
4891
+ slotTemplate: slotTemplate4,
4892
+ tooltipContent: tooltipLabels.PLAYBACK_RATE,
4893
+ ...options
4894
+ });
4895
+ __privateAdd11(this, _rates, new AttributeTokenList(this, Attributes4.RATES, {
4896
+ defaultValue: DEFAULT_RATES
4897
+ }));
4898
+ this.container = this.shadowRoot.querySelector('slot[name="icon"]');
4899
+ this.container.innerHTML = `${DEFAULT_RATE}x`;
4900
+ }
4901
+ static get observedAttributes() {
4902
+ return [
4903
+ ...super.observedAttributes,
4904
+ MediaUIAttributes.MEDIA_PLAYBACK_RATE,
4905
+ Attributes4.RATES
4906
+ ];
4907
+ }
4908
+ attributeChangedCallback(attrName, oldValue, newValue) {
4909
+ super.attributeChangedCallback(attrName, oldValue, newValue);
4910
+ if (attrName === Attributes4.RATES) {
4911
+ __privateGet10(this, _rates).value = newValue;
4912
+ }
4913
+ if (attrName === MediaUIAttributes.MEDIA_PLAYBACK_RATE) {
4914
+ const newPlaybackRate = newValue ? +newValue : Number.NaN;
4915
+ const playbackRate = !Number.isNaN(newPlaybackRate) ? newPlaybackRate : DEFAULT_RATE;
4916
+ this.container.innerHTML = `${playbackRate}x`;
4917
+ this.setAttribute("aria-label", nouns.PLAYBACK_RATE({ playbackRate }));
4918
+ }
4919
+ }
4920
+ /**
4921
+ * @type { AttributeTokenList | Array<number> | undefined} Will return a DOMTokenList.
4922
+ * Setting a value will accept an array of numbers.
4923
+ */
4924
+ get rates() {
4925
+ return __privateGet10(this, _rates);
4926
+ }
4927
+ set rates(value) {
4928
+ if (!value) {
4929
+ __privateGet10(this, _rates).value = "";
4930
+ } else if (Array.isArray(value)) {
4931
+ __privateGet10(this, _rates).value = value.join(" ");
4932
+ }
4933
+ }
4934
+ /**
4935
+ * @type {number} The current playback rate
4936
+ */
4937
+ get mediaPlaybackRate() {
4938
+ return getNumericAttr(
4939
+ this,
4940
+ MediaUIAttributes.MEDIA_PLAYBACK_RATE,
4941
+ DEFAULT_RATE
4942
+ );
4943
+ }
4944
+ set mediaPlaybackRate(value) {
4945
+ setNumericAttr(this, MediaUIAttributes.MEDIA_PLAYBACK_RATE, value);
4946
+ }
4947
+ handleClick() {
4948
+ var _a3, _b2;
4949
+ const availableRates = Array.from(this.rates.values(), (str) => +str).sort(
4950
+ (a, b) => a - b
4951
+ );
4952
+ const detail = (_b2 = (_a3 = availableRates.find((r) => r > this.mediaPlaybackRate)) != null ? _a3 : availableRates[0]) != null ? _b2 : DEFAULT_RATE;
4953
+ const evt = new GlobalThis.CustomEvent(
4954
+ MediaUIEvents.MEDIA_PLAYBACK_RATE_REQUEST,
4955
+ { composed: true, bubbles: true, detail }
4956
+ );
4957
+ this.dispatchEvent(evt);
4958
+ }
4959
+ };
4960
+ _rates = /* @__PURE__ */ new WeakMap();
4961
+ if (!GlobalThis.customElements.get("media-playback-rate-button")) {
4962
+ GlobalThis.customElements.define(
4963
+ "media-playback-rate-button",
4964
+ MediaPlaybackRateButton
4965
+ );
4966
+ }
4967
+
4968
+ // ../../node_modules/media-chrome/dist/menu/media-playback-rate-menu.js
4969
+ var __accessCheck12 = (obj, member, msg) => {
4970
+ if (!member.has(obj))
4971
+ throw TypeError("Cannot " + msg);
4972
+ };
4973
+ var __privateGet11 = (obj, member, getter) => {
4974
+ __accessCheck12(obj, member, "read from private field");
4975
+ return getter ? getter.call(obj) : member.get(obj);
4976
+ };
4977
+ var __privateAdd12 = (obj, member, value) => {
4978
+ if (member.has(obj))
4979
+ throw TypeError("Cannot add the same private member more than once");
4980
+ member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
4981
+ };
4982
+ var __privateMethod6 = (obj, member, method) => {
4983
+ __accessCheck12(obj, member, "access private method");
4984
+ return method;
4985
+ };
4986
+ var _rates2;
4987
+ var _render3;
4988
+ var render_fn3;
4989
+ var _onChange3;
4990
+ var onChange_fn3;
4991
+ var Attributes5 = {
4992
+ RATES: "rates"
4993
+ };
4994
+ var MediaPlaybackRateMenu = class extends MediaChromeMenu {
4995
+ constructor() {
4996
+ super();
4997
+ __privateAdd12(this, _render3);
4998
+ __privateAdd12(this, _onChange3);
4999
+ __privateAdd12(this, _rates2, new AttributeTokenList(this, Attributes5.RATES, {
5000
+ defaultValue: DEFAULT_RATES
5001
+ }));
5002
+ __privateMethod6(this, _render3, render_fn3).call(this);
5003
+ }
5004
+ static get observedAttributes() {
5005
+ return [
5006
+ ...super.observedAttributes,
5007
+ MediaUIAttributes.MEDIA_PLAYBACK_RATE,
5008
+ Attributes5.RATES
5009
+ ];
5010
+ }
5011
+ attributeChangedCallback(attrName, oldValue, newValue) {
5012
+ super.attributeChangedCallback(attrName, oldValue, newValue);
5013
+ if (attrName === MediaUIAttributes.MEDIA_PLAYBACK_RATE && oldValue != newValue) {
5014
+ this.value = newValue;
5015
+ } else if (attrName === Attributes5.RATES && oldValue != newValue) {
5016
+ __privateGet11(this, _rates2).value = newValue;
5017
+ __privateMethod6(this, _render3, render_fn3).call(this);
5018
+ }
5019
+ }
5020
+ connectedCallback() {
5021
+ super.connectedCallback();
5022
+ this.addEventListener("change", __privateMethod6(this, _onChange3, onChange_fn3));
5023
+ }
5024
+ disconnectedCallback() {
5025
+ super.disconnectedCallback();
5026
+ this.removeEventListener("change", __privateMethod6(this, _onChange3, onChange_fn3));
5027
+ }
5028
+ /**
5029
+ * Returns the anchor element when it is a floating menu.
5030
+ */
5031
+ get anchorElement() {
5032
+ if (this.anchor !== "auto")
5033
+ return super.anchorElement;
5034
+ return getMediaController(this).querySelector(
5035
+ "media-playback-rate-menu-button"
5036
+ );
5037
+ }
5038
+ /**
5039
+ * Will return a DOMTokenList.
5040
+ * Setting a value will accept an array of numbers.
5041
+ */
5042
+ get rates() {
5043
+ return __privateGet11(this, _rates2);
5044
+ }
5045
+ set rates(value) {
5046
+ if (!value) {
5047
+ __privateGet11(this, _rates2).value = "";
5048
+ } else if (Array.isArray(value)) {
5049
+ __privateGet11(this, _rates2).value = value.join(" ");
5050
+ }
5051
+ __privateMethod6(this, _render3, render_fn3).call(this);
5052
+ }
5053
+ /**
5054
+ * The current playback rate
5055
+ */
5056
+ get mediaPlaybackRate() {
5057
+ return getNumericAttr(
5058
+ this,
5059
+ MediaUIAttributes.MEDIA_PLAYBACK_RATE,
5060
+ DEFAULT_RATE
5061
+ );
5062
+ }
5063
+ set mediaPlaybackRate(value) {
5064
+ setNumericAttr(this, MediaUIAttributes.MEDIA_PLAYBACK_RATE, value);
5065
+ }
5066
+ };
5067
+ _rates2 = /* @__PURE__ */ new WeakMap();
5068
+ _render3 = /* @__PURE__ */ new WeakSet();
5069
+ render_fn3 = function() {
5070
+ this.defaultSlot.textContent = "";
5071
+ for (const rate of this.rates) {
5072
+ const item = createMenuItem({
5073
+ type: "radio",
5074
+ text: this.formatMenuItemText(`${rate}x`, rate),
5075
+ value: rate,
5076
+ checked: this.mediaPlaybackRate == rate
5077
+ });
5078
+ item.prepend(createIndicator(this, "checked-indicator"));
5079
+ this.defaultSlot.append(item);
5080
+ }
5081
+ };
5082
+ _onChange3 = /* @__PURE__ */ new WeakSet();
5083
+ onChange_fn3 = function() {
5084
+ if (!this.value)
5085
+ return;
5086
+ const event = new GlobalThis.CustomEvent(
5087
+ MediaUIEvents.MEDIA_PLAYBACK_RATE_REQUEST,
5088
+ {
5089
+ composed: true,
5090
+ bubbles: true,
5091
+ detail: this.value
5092
+ }
5093
+ );
5094
+ this.dispatchEvent(event);
5095
+ };
5096
+ if (!GlobalThis.customElements.get("media-playback-rate-menu")) {
5097
+ GlobalThis.customElements.define(
5098
+ "media-playback-rate-menu",
5099
+ MediaPlaybackRateMenu
5100
+ );
5101
+ }
5102
+
5103
+ // ../../node_modules/media-chrome/dist/menu/media-playback-rate-menu-button.js
5104
+ var __accessCheck13 = (obj, member, msg) => {
5105
+ if (!member.has(obj))
5106
+ throw TypeError("Cannot " + msg);
5107
+ };
5108
+ var __privateGet12 = (obj, member, getter) => {
5109
+ __accessCheck13(obj, member, "read from private field");
5110
+ return getter ? getter.call(obj) : member.get(obj);
5111
+ };
5112
+ var __privateAdd13 = (obj, member, value) => {
5113
+ if (member.has(obj))
5114
+ throw TypeError("Cannot add the same private member more than once");
5115
+ member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
5116
+ };
5117
+ var _rates3;
5118
+ var Attributes6 = {
5119
+ RATES: "rates"
5120
+ };
5121
+ var DEFAULT_RATES2 = [1, 1.2, 1.5, 1.7, 2];
5122
+ var DEFAULT_RATE2 = 1;
5123
+ var slotTemplate5 = Document2.createElement("template");
5124
+ slotTemplate5.innerHTML = /*html*/
5125
+ `
5126
+ <style>
5127
+ :host {
5128
+ min-width: 5ch;
5129
+ padding: var(--media-button-padding, var(--media-control-padding, 10px 5px));
5130
+ }
5131
+
5132
+ :host([aria-expanded="true"]) slot[name=tooltip] {
5133
+ display: none;
5134
+ }
5135
+ </style>
5136
+ <slot name="icon"></slot>
5137
+ `;
5138
+ var MediaPlaybackRateMenuButton = class extends MediaChromeMenuButton {
5139
+ constructor(options = {}) {
5140
+ super({
5141
+ slotTemplate: slotTemplate5,
5142
+ tooltipContent: tooltipLabels.PLAYBACK_RATE,
5143
+ ...options
5144
+ });
5145
+ __privateAdd13(this, _rates3, new AttributeTokenList(this, Attributes6.RATES, {
5146
+ defaultValue: DEFAULT_RATES2
5147
+ }));
5148
+ this.container = this.shadowRoot.querySelector('slot[name="icon"]');
5149
+ this.container.innerHTML = `${DEFAULT_RATE2}x`;
5150
+ }
5151
+ static get observedAttributes() {
5152
+ return [
5153
+ ...super.observedAttributes,
5154
+ MediaUIAttributes.MEDIA_PLAYBACK_RATE,
5155
+ Attributes6.RATES
5156
+ ];
5157
+ }
5158
+ attributeChangedCallback(attrName, oldValue, newValue) {
5159
+ super.attributeChangedCallback(attrName, oldValue, newValue);
5160
+ if (attrName === Attributes6.RATES) {
5161
+ __privateGet12(this, _rates3).value = newValue;
5162
+ }
5163
+ if (attrName === MediaUIAttributes.MEDIA_PLAYBACK_RATE) {
5164
+ const newPlaybackRate = newValue ? +newValue : Number.NaN;
5165
+ const playbackRate = !Number.isNaN(newPlaybackRate) ? newPlaybackRate : DEFAULT_RATE2;
5166
+ this.container.innerHTML = `${playbackRate}x`;
5167
+ this.setAttribute("aria-label", nouns.PLAYBACK_RATE({ playbackRate }));
5168
+ }
5169
+ }
5170
+ /**
5171
+ * Returns the element with the id specified by the `invoketarget` attribute.
5172
+ */
5173
+ get invokeTargetElement() {
5174
+ if (this.invokeTarget != void 0)
5175
+ return super.invokeTargetElement;
5176
+ return getMediaController(this).querySelector("media-playback-rate-menu");
5177
+ }
5178
+ /**
5179
+ * Will return a DOMTokenList.
5180
+ * Setting a value will accept an array of numbers.
5181
+ */
5182
+ get rates() {
5183
+ return __privateGet12(this, _rates3);
5184
+ }
5185
+ set rates(value) {
5186
+ if (!value) {
5187
+ __privateGet12(this, _rates3).value = "";
5188
+ } else if (Array.isArray(value)) {
5189
+ __privateGet12(this, _rates3).value = value.join(" ");
5190
+ }
5191
+ }
5192
+ /**
5193
+ * The current playback rate
5194
+ */
5195
+ get mediaPlaybackRate() {
5196
+ return getNumericAttr(
5197
+ this,
5198
+ MediaUIAttributes.MEDIA_PLAYBACK_RATE,
5199
+ DEFAULT_RATE2
5200
+ );
5201
+ }
5202
+ set mediaPlaybackRate(value) {
5203
+ setNumericAttr(this, MediaUIAttributes.MEDIA_PLAYBACK_RATE, value);
5204
+ }
5205
+ };
5206
+ _rates3 = /* @__PURE__ */ new WeakMap();
5207
+ if (!GlobalThis.customElements.get("media-playback-rate-menu-button")) {
5208
+ GlobalThis.customElements.define(
5209
+ "media-playback-rate-menu-button",
5210
+ MediaPlaybackRateMenuButton
5211
+ );
5212
+ }
5213
+
5214
+ // ../../node_modules/media-chrome/dist/menu/media-rendition-menu.js
5215
+ var __accessCheck14 = (obj, member, msg) => {
5216
+ if (!member.has(obj))
5217
+ throw TypeError("Cannot " + msg);
5218
+ };
5219
+ var __privateGet13 = (obj, member, getter) => {
5220
+ __accessCheck14(obj, member, "read from private field");
5221
+ return getter ? getter.call(obj) : member.get(obj);
5222
+ };
5223
+ var __privateAdd14 = (obj, member, value) => {
5224
+ if (member.has(obj))
5225
+ throw TypeError("Cannot add the same private member more than once");
5226
+ member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
5227
+ };
5228
+ var __privateSet11 = (obj, member, value, setter) => {
5229
+ __accessCheck14(obj, member, "write to private field");
5230
+ setter ? setter.call(obj, value) : member.set(obj, value);
5231
+ return value;
5232
+ };
5233
+ var __privateMethod7 = (obj, member, method) => {
5234
+ __accessCheck14(obj, member, "access private method");
5235
+ return method;
5236
+ };
5237
+ var _renditionList;
5238
+ var _prevState3;
5239
+ var _render4;
5240
+ var render_fn4;
5241
+ var _onChange4;
5242
+ var onChange_fn4;
5243
+ var MediaRenditionMenu = class extends MediaChromeMenu {
5244
+ constructor() {
5245
+ super(...arguments);
5246
+ __privateAdd14(this, _render4);
5247
+ __privateAdd14(this, _onChange4);
5248
+ __privateAdd14(this, _renditionList, []);
5249
+ __privateAdd14(this, _prevState3, {});
5250
+ }
5251
+ static get observedAttributes() {
5252
+ return [
5253
+ ...super.observedAttributes,
5254
+ MediaUIAttributes.MEDIA_RENDITION_LIST,
5255
+ MediaUIAttributes.MEDIA_RENDITION_SELECTED,
5256
+ MediaUIAttributes.MEDIA_RENDITION_UNAVAILABLE,
5257
+ MediaUIAttributes.MEDIA_HEIGHT
5258
+ ];
5259
+ }
5260
+ attributeChangedCallback(attrName, oldValue, newValue) {
5261
+ super.attributeChangedCallback(attrName, oldValue, newValue);
5262
+ if (attrName === MediaUIAttributes.MEDIA_RENDITION_SELECTED && oldValue !== newValue) {
5263
+ this.value = newValue != null ? newValue : "auto";
5264
+ } else if (attrName === MediaUIAttributes.MEDIA_RENDITION_LIST && oldValue !== newValue) {
5265
+ __privateSet11(this, _renditionList, parseRenditionList(newValue));
5266
+ __privateMethod7(this, _render4, render_fn4).call(this);
5267
+ } else if (attrName === MediaUIAttributes.MEDIA_HEIGHT && oldValue !== newValue) {
5268
+ __privateMethod7(this, _render4, render_fn4).call(this);
5269
+ }
5270
+ }
5271
+ connectedCallback() {
5272
+ super.connectedCallback();
5273
+ this.addEventListener("change", __privateMethod7(this, _onChange4, onChange_fn4));
5274
+ }
5275
+ disconnectedCallback() {
5276
+ super.disconnectedCallback();
5277
+ this.removeEventListener("change", __privateMethod7(this, _onChange4, onChange_fn4));
5278
+ }
5279
+ /**
5280
+ * Returns the anchor element when it is a floating menu.
5281
+ */
5282
+ get anchorElement() {
5283
+ if (this.anchor !== "auto")
5284
+ return super.anchorElement;
5285
+ return getMediaController(this).querySelector(
5286
+ "media-rendition-menu-button"
5287
+ );
5288
+ }
5289
+ get mediaRenditionList() {
5290
+ return __privateGet13(this, _renditionList);
5291
+ }
5292
+ set mediaRenditionList(list) {
5293
+ __privateSet11(this, _renditionList, list);
5294
+ __privateMethod7(this, _render4, render_fn4).call(this);
5295
+ }
5296
+ /**
5297
+ * Get selected rendition id.
5298
+ */
5299
+ get mediaRenditionSelected() {
5300
+ return getStringAttr(this, MediaUIAttributes.MEDIA_RENDITION_SELECTED);
5301
+ }
5302
+ set mediaRenditionSelected(id) {
5303
+ setStringAttr(this, MediaUIAttributes.MEDIA_RENDITION_SELECTED, id);
5304
+ }
5305
+ get mediaHeight() {
5306
+ return getNumericAttr(this, MediaUIAttributes.MEDIA_HEIGHT);
5307
+ }
5308
+ set mediaHeight(height) {
5309
+ setNumericAttr(this, MediaUIAttributes.MEDIA_HEIGHT, height);
5310
+ }
5311
+ };
5312
+ _renditionList = /* @__PURE__ */ new WeakMap();
5313
+ _prevState3 = /* @__PURE__ */ new WeakMap();
5314
+ _render4 = /* @__PURE__ */ new WeakSet();
5315
+ render_fn4 = function() {
5316
+ if (__privateGet13(this, _prevState3).mediaRenditionList === JSON.stringify(this.mediaRenditionList) && __privateGet13(this, _prevState3).mediaHeight === this.mediaHeight)
5317
+ return;
5318
+ __privateGet13(this, _prevState3).mediaRenditionList = JSON.stringify(this.mediaRenditionList);
5319
+ __privateGet13(this, _prevState3).mediaHeight = this.mediaHeight;
5320
+ const renditionList = this.mediaRenditionList.sort(
5321
+ (a, b) => b.height - a.height
5322
+ );
5323
+ for (const rendition of renditionList) {
5324
+ rendition.selected = rendition.id === this.mediaRenditionSelected;
5325
+ }
5326
+ this.defaultSlot.textContent = "";
5327
+ const isAuto = !this.mediaRenditionSelected;
5328
+ for (const rendition of renditionList) {
5329
+ const text = this.formatMenuItemText(
5330
+ `${Math.min(rendition.width, rendition.height)}p`,
5331
+ rendition
5332
+ );
5333
+ const item2 = createMenuItem({
5334
+ type: "radio",
5335
+ text,
5336
+ value: `${rendition.id}`,
5337
+ checked: rendition.selected && !isAuto
5338
+ });
5339
+ item2.prepend(createIndicator(this, "checked-indicator"));
5340
+ this.defaultSlot.append(item2);
5341
+ }
5342
+ const item = createMenuItem({
5343
+ type: "radio",
5344
+ text: this.formatMenuItemText("Auto"),
5345
+ value: "auto",
5346
+ checked: isAuto
5347
+ });
5348
+ const autoDescription = this.mediaHeight > 0 ? `Auto (${this.mediaHeight}p)` : "Auto";
5349
+ item.dataset.description = autoDescription;
5350
+ item.prepend(createIndicator(this, "checked-indicator"));
5351
+ this.defaultSlot.append(item);
5352
+ };
5353
+ _onChange4 = /* @__PURE__ */ new WeakSet();
5354
+ onChange_fn4 = function() {
5355
+ if (this.value == null)
5356
+ return;
5357
+ const event = new GlobalThis.CustomEvent(
5358
+ MediaUIEvents.MEDIA_RENDITION_REQUEST,
5359
+ {
5360
+ composed: true,
5361
+ bubbles: true,
5362
+ detail: this.value
5363
+ }
5364
+ );
5365
+ this.dispatchEvent(event);
5366
+ };
5367
+ if (!GlobalThis.customElements.get("media-rendition-menu")) {
5368
+ GlobalThis.customElements.define("media-rendition-menu", MediaRenditionMenu);
5369
+ }
5370
+
5371
+ // ../../node_modules/media-chrome/dist/menu/media-rendition-menu-button.js
5372
+ var renditionIcon = (
5373
+ /*html*/
5374
+ `<svg aria-hidden="true" viewBox="0 0 24 24">
5375
+ <path d="M13.5 2.5h2v6h-2v-2h-11v-2h11v-2Zm4 2h4v2h-4v-2Zm-12 4h2v6h-2v-2h-3v-2h3v-2Zm4 2h12v2h-12v-2Zm1 4h2v6h-2v-2h-8v-2h8v-2Zm4 2h7v2h-7v-2Z" />
5376
+ </svg>`
5377
+ );
5378
+ var slotTemplate6 = Document2.createElement("template");
5379
+ slotTemplate6.innerHTML = /*html*/
5380
+ `
5381
+ <style>
5382
+ :host([aria-expanded="true"]) slot[name=tooltip] {
5383
+ display: none;
5384
+ }
5385
+ </style>
5386
+ <slot name="icon">${renditionIcon}</slot>
5387
+ `;
5388
+ var MediaRenditionMenuButton = class extends MediaChromeMenuButton {
5389
+ static get observedAttributes() {
5390
+ return [
5391
+ ...super.observedAttributes,
5392
+ MediaUIAttributes.MEDIA_RENDITION_SELECTED,
5393
+ MediaUIAttributes.MEDIA_RENDITION_UNAVAILABLE,
5394
+ MediaUIAttributes.MEDIA_HEIGHT
5395
+ ];
5396
+ }
5397
+ constructor() {
5398
+ super({ slotTemplate: slotTemplate6, tooltipContent: tooltipLabels.RENDITIONS });
5399
+ }
5400
+ connectedCallback() {
5401
+ super.connectedCallback();
5402
+ this.setAttribute("aria-label", nouns.QUALITY());
5403
+ }
5404
+ /**
5405
+ * Returns the element with the id specified by the `invoketarget` attribute.
5406
+ */
5407
+ get invokeTargetElement() {
5408
+ if (this.invokeTarget != void 0)
5409
+ return super.invokeTargetElement;
5410
+ return getMediaController(this).querySelector("media-rendition-menu");
5411
+ }
5412
+ /**
5413
+ * Get selected rendition id.
5414
+ */
5415
+ get mediaRenditionSelected() {
5416
+ return getStringAttr(this, MediaUIAttributes.MEDIA_RENDITION_SELECTED);
5417
+ }
5418
+ set mediaRenditionSelected(id) {
5419
+ setStringAttr(this, MediaUIAttributes.MEDIA_RENDITION_SELECTED, id);
5420
+ }
5421
+ get mediaHeight() {
5422
+ return getNumericAttr(this, MediaUIAttributes.MEDIA_HEIGHT);
5423
+ }
5424
+ set mediaHeight(height) {
5425
+ setNumericAttr(this, MediaUIAttributes.MEDIA_HEIGHT, height);
5426
+ }
5427
+ };
5428
+ if (!GlobalThis.customElements.get("media-rendition-menu-button")) {
5429
+ GlobalThis.customElements.define(
5430
+ "media-rendition-menu-button",
5431
+ MediaRenditionMenuButton
5432
+ );
5433
+ }
5434
+
2139
5435
  // src/themes/gerwig/index.ts
2140
- var template = internalDocument.createElement("template");
2141
- if ("innerHTML" in template)
2142
- template.innerHTML = gerwig_default;
2143
- var _a, _b;
5436
+ var template7 = internalDocument.createElement("template");
5437
+ if ("innerHTML" in template7)
5438
+ template7.innerHTML = gerwig_default;
5439
+ var _a2, _b;
2144
5440
  var MediaThemeGerwig = class extends MediaThemeElement {
2145
5441
  };
2146
- MediaThemeGerwig.template = (_b = (_a = template.content) == null ? void 0 : _a.children) == null ? void 0 : _b[0];
5442
+ MediaThemeGerwig.template = (_b = (_a2 = template7.content) == null ? void 0 : _a2.children) == null ? void 0 : _b[0];
2147
5443
  if (!internalGlobalThis.customElements.get("media-theme-gerwig")) {
2148
5444
  internalGlobalThis.customElements.define("media-theme-gerwig", MediaThemeGerwig);
2149
5445
  }