@mux/mux-player 2.6.0 → 2.7.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.
package/dist/index.cjs.js CHANGED
@@ -1,11 +1,11 @@
1
- "use strict";var uv=Object.create;var Hr=Object.defineProperty;var cv=Object.getOwnPropertyDescriptor;var mv=Object.getOwnPropertyNames;var hv=Object.getPrototypeOf,pv=Object.prototype.hasOwnProperty;var vv=(i,e)=>{for(var t in e)Hr(i,t,{get:e[t],enumerable:!0})},vc=(i,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of mv(e))!pv.call(i,r)&&r!==t&&Hr(i,r,{get:()=>e[r],enumerable:!(a=cv(e,r))||a.enumerable});return i};var fv=(i,e,t)=>(t=i!=null?uv(hv(i)):{},vc(e||!i||!i.__esModule?Hr(t,"default",{value:i,enumerable:!0}):t,i)),bv=i=>vc(Hr({},"__esModule",{value:!0}),i);var No=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)};var O=(i,e,t)=>(No(i,e,"read from private field"),t?t.call(i):e.get(i)),ee=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ce=(i,e,t,a)=>(No(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t);var ie=(i,e,t)=>(No(i,e,"access private method"),t);var w0={};vv(w0,{MediaError:()=>A.MediaError,default:()=>M0,getVideoAttribute:()=>ei});module.exports=bv(w0);var Ni=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class i extends Ni{}globalThis.DocumentFragment=i}var xa=class extends Ni{},Uo=class extends Ni{},Ev={get(i){},define(i,e,t){},upgrade(i){},whenDefined(i){return Promise.resolve(xa)}},Da,Bo=class{constructor(e,t={}){ee(this,Da,void 0);Ce(this,Da,t==null?void 0:t.detail)}get detail(){return O(this,Da)}initCustomEvent(){}};Da=new WeakMap;function gv(i,e){return new xa}var fc={document:{createElement:gv},DocumentFragment,customElements:Ev,CustomEvent:Bo,EventTarget:Ni,HTMLElement:xa,HTMLVideoElement:Uo},bc=typeof window=="undefined"||typeof globalThis.customElements=="undefined",Z=bc?fc:globalThis,ye=bc?fc.document:globalThis.document;var h={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_VOLUME_REQUEST:"mediavolumerequest",MEDIA_SEEK_REQUEST:"mediaseekrequest",MEDIA_AIRPLAY_REQUEST:"mediaairplayrequest",MEDIA_ENTER_FULLSCREEN_REQUEST:"mediaenterfullscreenrequest",MEDIA_EXIT_FULLSCREEN_REQUEST:"mediaexitfullscreenrequest",MEDIA_PREVIEW_REQUEST:"mediapreviewrequest",MEDIA_ENTER_PIP_REQUEST:"mediaenterpiprequest",MEDIA_EXIT_PIP_REQUEST:"mediaexitpiprequest",MEDIA_ENTER_CAST_REQUEST:"mediaentercastrequest",MEDIA_EXIT_CAST_REQUEST:"mediaexitcastrequest",MEDIA_SHOW_TEXT_TRACKS_REQUEST:"mediashowtexttracksrequest",MEDIA_HIDE_TEXT_TRACKS_REQUEST:"mediahidetexttracksrequest",MEDIA_SHOW_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_TOGGLE_SUBTITLES_REQUEST:"mediatogglesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",MEDIA_RENDITION_REQUEST:"mediarenditionrequest",MEDIA_AUDIO_TRACK_REQUEST:"mediaaudiotrackrequest",MEDIA_SEEK_TO_LIVE_REQUEST:"mediaseektoliverequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},y={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},Wo={MEDIA_AIRPLAY_UNAVAILABLE:"mediaAirplayUnavailable",MEDIA_FULLSCREEN_UNAVAILABLE:"mediaFullscreenUnavailable",MEDIA_PIP_UNAVAILABLE:"mediaPipUnavailable",MEDIA_CAST_UNAVAILABLE:"mediaCastUnavailable",MEDIA_RENDITION_UNAVAILABLE:"mediaRenditionUnavailable",MEDIA_AUDIO_TRACK_UNAVAILABLE:"mediaAudioTrackUnavailable",MEDIA_PAUSED:"mediaPaused",MEDIA_HAS_PLAYED:"mediaHasPlayed",MEDIA_ENDED:"mediaEnded",MEDIA_MUTED:"mediaMuted",MEDIA_VOLUME_LEVEL:"mediaVolumeLevel",MEDIA_VOLUME:"mediaVolume",MEDIA_VOLUME_UNAVAILABLE:"mediaVolumeUnavailable",MEDIA_IS_PIP:"mediaIsPip",MEDIA_IS_CASTING:"mediaIsCasting",MEDIA_IS_AIRPLAYING:"mediaIsAirplaying",MEDIA_SUBTITLES_LIST:"mediaSubtitlesList",MEDIA_SUBTITLES_SHOWING:"mediaSubtitlesShowing",MEDIA_IS_FULLSCREEN:"mediaIsFullscreen",MEDIA_PLAYBACK_RATE:"mediaPlaybackRate",MEDIA_CURRENT_TIME:"mediaCurrentTime",MEDIA_DURATION:"mediaDuration",MEDIA_SEEKABLE:"mediaSeekable",MEDIA_PREVIEW_TIME:"mediaPreviewTime",MEDIA_PREVIEW_IMAGE:"mediaPreviewImage",MEDIA_PREVIEW_COORDS:"mediaPreviewCoords",MEDIA_PREVIEW_CHAPTER:"mediaPreviewChapter",MEDIA_LOADING:"mediaLoading",MEDIA_BUFFERED:"mediaBuffered",MEDIA_STREAM_TYPE:"mediaStreamType",MEDIA_TARGET_LIVE_WINDOW:"mediaTargetLiveWindow",MEDIA_TIME_IS_LIVE:"mediaTimeIsLive",MEDIA_RENDITION_LIST:"mediaRenditionList",MEDIA_RENDITION_SELECTED:"mediaRenditionSelected",MEDIA_AUDIO_TRACK_LIST:"mediaAudioTrackList",MEDIA_AUDIO_TRACK_ENABLED:"mediaAudioTrackEnabled",MEDIA_CHAPTERS_CUES:"mediaChaptersCues"},Ec=Object.entries(Wo),s=Ec.reduce((i,[e,t])=>(i[e]=`${t.toLowerCase()}`,i),{}),yt=Ec.reduce((i,[e,t])=>(i[e]=`${t.toLowerCase()}`,i),{USER_INACTIVE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"}),P0=Object.entries(yt).reduce((i,[e,t])=>{let a=s[e];return a&&(i[t]=a),i},{userinactivechange:"userinactive"}),gc=Object.entries(s).reduce((i,[e,t])=>{let a=yt[e];return a&&(i[t]=a),i},{userinactive:"userinactivechange"}),Ne={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},Pt={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Ho={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},Te={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},Ue={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var _c={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};var K={AUDIO_PLAYER:()=>"audio player",VIDEO_PLAYER:()=>"video player",VOLUME:()=>"volume",SEEK:()=>"seek",CLOSED_CAPTIONS:()=>"closed captions",PLAYBACK_RATE:({playbackRate:i=1}={})=>`current playback rate ${i}`,PLAYBACK_TIME:()=>"playback time",MEDIA_LOADING:()=>"media loading",SETTINGS:()=>"settings",AUDIO_TRACKS:()=>"audio tracks",QUALITY:()=>"quality"},Y={PLAY:()=>"play",PAUSE:()=>"pause",MUTE:()=>"mute",UNMUTE:()=>"unmute",ENTER_AIRPLAY:()=>"start airplay",EXIT_AIRPLAY:()=>"stop airplay",ENTER_CAST:()=>"start casting",EXIT_CAST:()=>"stop casting",ENTER_FULLSCREEN:()=>"enter fullscreen mode",EXIT_FULLSCREEN:()=>"exit fullscreen mode",ENTER_PIP:()=>"enter picture in picture mode",EXIT_PIP:()=>"exit picture in picture mode",SEEK_FORWARD_N_SECS:({seekOffset:i=30}={})=>`seek forward ${i} seconds`,SEEK_BACK_N_SECS:({seekOffset:i=30}={})=>`seek back ${i} seconds`,SEEK_LIVE:()=>"seek to live",PLAYING_LIVE:()=>"playing live"},Av={...K,...Y};function Ac(i){return i==null?void 0:i.map(yv).join(" ")}function $r(i){return i==null?void 0:i.split(/\s+/).map(Tv)}function yv(i){if(i){let{id:e,width:t,height:a}=i;return[e,t,a].filter(r=>r!=null).join(":")}}function Tv(i){if(i){let[e,t,a]=i.split(":");return{id:e,width:t,height:a}}}function yc(i){return i==null?void 0:i.map(kv).join(" ")}function Fr(i){return i==null?void 0:i.split(/\s+/).map(Sv)}function kv(i){if(i){let{id:e,kind:t,language:a,label:r}=i;return[e,t,a,r].filter(n=>n!=null).join(":")}}function Sv(i){if(i){let[e,t,a,r]=i.split(":");return{id:e,kind:t,language:a,label:r}}}function Tc(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function kc(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}function Vr(i){return typeof i!="string"?!1:!isNaN(i)&&!isNaN(parseFloat(i))}var Kr=i=>new Promise(e=>setTimeout(e,i));var Sc=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],Iv=(i,e)=>{let t=i===1?Sc[e].singular:Sc[e].plural;return`${i} ${t}`},ai=i=>{if(!kc(i))return"";let e=Math.abs(i),t=e!==i,a=new Date(0,0,0,0,0,e,0);return`${[a.getHours(),a.getMinutes(),a.getSeconds()].map((d,u)=>d&&Iv(d,u)).filter(d=>d).join(", ")}${t?" remaining":""}`};function ze(i,e){let t=!1;i<0&&(t=!0,i=0-i),i=i<0?0:i;let a=Math.floor(i%60),r=Math.floor(i/60%60),n=Math.floor(i/3600),o=Math.floor(e/60%60),d=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(n=r=a="0"),n=n>0||d>0?n+":":"",r=((n||o>=10)&&r<10?"0"+r:r)+":",a=a<10?"0"+a:a,(t?"-":"")+n+r+a}var W0=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}});var Yr=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},Gr=class extends Yr{},$o=class{observe(){}unobserve(){}disconnect(){}},Ic={createElement:function(){return new qr.HTMLElement},createElementNS:function(){return new qr.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(i){return!1}},qr={ResizeObserver:$o,document:Ic,Node:Gr,HTMLElement:class extends Gr{},DocumentFragment:class extends Yr{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},localStorage:{getItem(i){return null},setItem(i,e){},removeItem(i){}},CustomEvent:function(){},getComputedStyle:function(){},navigator:{languages:[],get userAgent(){return""}},matchMedia(i){return{matches:!1,media:i}}},Cc=typeof window=="undefined"||typeof window.customElements=="undefined",Lc=Object.keys(qr).every(i=>i in globalThis),l=Cc&&!Lc?qr:globalThis,m=Cc&&!Lc?Ic:globalThis.document;var Mc=new WeakMap,Fo=i=>{let e=Mc.get(i);return e||Mc.set(i,e=new Set),e},wc=new l.ResizeObserver(i=>{for(let e of i)for(let t of Fo(e.target))t(e)});function Le(i,e){Fo(i).add(e),wc.observe(i)}function Xe(i,e){let t=Fo(i);t.delete(e),t.size||wc.unobserve(i)}function X(i){var e;return(e=Zr(i))!=null?e:Be(i,"media-controller")}function Zr(i){var e;let{MEDIA_CONTROLLER:t}=y,a=i.getAttribute(t);if(a)return(e=ni(i))==null?void 0:e.getElementById(a)}var Qr=(i,e,t=".value")=>{let a=i.querySelector(t);a&&(a.textContent=e)},Lv=(i,e)=>{let t=`slot[name="${e}"]`,a=i.shadowRoot.querySelector(t);return a?a.children:[]},zr=(i,e)=>Lv(i,e)[0],ue=(i,e)=>!i||!e?!1:i!=null&&i.contains(e)?!0:ue(i,e.getRootNode().host),Be=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||Be(i.getRootNode().host,e)};function ri(i=document){var e;let t=i==null?void 0:i.activeElement;return t?(e=ri(t.shadowRoot))!=null?e:t:null}function ni(i){var e;let t=(e=i==null?void 0:i.getRootNode)==null?void 0:e.call(i);return t instanceof ShadowRoot||t instanceof Document?t:null}function Rc(i,e=3){if(i.checkVisibility)return i.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0});let t=i;for(;t&&e>0;){let a=getComputedStyle(t);if(a.opacity==="0"||a.visibility==="hidden"||a.display==="none")return!1;t=t.parentElement,e--}return!0}function xc(i,e,t,a){let r=Vo(t,a),n=Vo(t,{x:i,y:e}),o=Vo(a,{x:i,y:e});return n>r||o>r?n>o?1:0:n/r}function Vo(i,e){return Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2))}function N(i,e){let t=Mv(i,a=>a===e);return t||Ko(i,e)}function Mv(i,e){var t;let a;for(a of i.querySelectorAll("style")){let r;try{r=(t=a.sheet)==null?void 0:t.cssRules}catch{continue}for(let n of r!=null?r:[])if(e(n.selectorText))return n}}function Ko(i,e){var t,a;let r=(t=i.querySelectorAll("style"))!=null?t:[],n=r==null?void 0:r[r.length-1];return n!=null&&n.sheet?(n==null||n.sheet.insertRule(`${e}{}`,n.sheet.cssRules.length),(a=n.sheet.cssRules)==null?void 0:a[n.sheet.cssRules.length-1]):(console.warn("Media Chrome: No style sheet found on style tag of",i),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}})}function x(i,e,t=Number.NaN){let a=i.getAttribute(e);return a!=null?+a:t}function U(i,e,t){let a=+t;if(t==null||Number.isNaN(a)){i.hasAttribute(e)&&i.removeAttribute(e);return}x(i,e,void 0)!==a&&i.setAttribute(e,`${a}`)}function H(i,e){return i.hasAttribute(e)}function B(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}H(i,e)!=t&&i.toggleAttribute(e,t)}function I(i,e,t=null){var a;return(a=i.getAttribute(e))!=null?a:t}function k(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}let a=`${t}`;I(i,e,void 0)!==a&&i.setAttribute(e,a)}var Dc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Nt=(i,e,t)=>(Dc(i,e,"read from private field"),t?t.call(i):e.get(i)),wv=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Xr=(i,e,t,a)=>(Dc(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),be,Oc=m.createElement("template");Oc.innerHTML=`
1
+ "use strict";var uv=Object.create;var Hr=Object.defineProperty;var cv=Object.getOwnPropertyDescriptor;var mv=Object.getOwnPropertyNames;var hv=Object.getPrototypeOf,pv=Object.prototype.hasOwnProperty;var vv=(i,e)=>{for(var t in e)Hr(i,t,{get:e[t],enumerable:!0})},vc=(i,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of mv(e))!pv.call(i,r)&&r!==t&&Hr(i,r,{get:()=>e[r],enumerable:!(a=cv(e,r))||a.enumerable});return i};var fv=(i,e,t)=>(t=i!=null?uv(hv(i)):{},vc(e||!i||!i.__esModule?Hr(t,"default",{value:i,enumerable:!0}):t,i)),bv=i=>vc(Hr({},"__esModule",{value:!0}),i);var No=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)};var O=(i,e,t)=>(No(i,e,"read from private field"),t?t.call(i):e.get(i)),ee=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Le=(i,e,t,a)=>(No(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t);var te=(i,e,t)=>(No(i,e,"access private method"),t);var w0={};vv(w0,{MediaError:()=>E.MediaError,default:()=>M0,getVideoAttribute:()=>ti});module.exports=bv(w0);var Ni=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class i extends Ni{}globalThis.DocumentFragment=i}var xa=class extends Ni{},Uo=class extends Ni{},Ev={get(i){},define(i,e,t){},upgrade(i){},whenDefined(i){return Promise.resolve(xa)}},Da,Bo=class{constructor(e,t={}){ee(this,Da,void 0);Le(this,Da,t==null?void 0:t.detail)}get detail(){return O(this,Da)}initCustomEvent(){}};Da=new WeakMap;function gv(i,e){return new xa}var fc={document:{createElement:gv},DocumentFragment,customElements:Ev,CustomEvent:Bo,EventTarget:Ni,HTMLElement:xa,HTMLVideoElement:Uo},bc=typeof window=="undefined"||typeof globalThis.customElements=="undefined",Z=bc?fc:globalThis,ye=bc?fc.document:globalThis.document;var h={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_VOLUME_REQUEST:"mediavolumerequest",MEDIA_SEEK_REQUEST:"mediaseekrequest",MEDIA_AIRPLAY_REQUEST:"mediaairplayrequest",MEDIA_ENTER_FULLSCREEN_REQUEST:"mediaenterfullscreenrequest",MEDIA_EXIT_FULLSCREEN_REQUEST:"mediaexitfullscreenrequest",MEDIA_PREVIEW_REQUEST:"mediapreviewrequest",MEDIA_ENTER_PIP_REQUEST:"mediaenterpiprequest",MEDIA_EXIT_PIP_REQUEST:"mediaexitpiprequest",MEDIA_ENTER_CAST_REQUEST:"mediaentercastrequest",MEDIA_EXIT_CAST_REQUEST:"mediaexitcastrequest",MEDIA_SHOW_TEXT_TRACKS_REQUEST:"mediashowtexttracksrequest",MEDIA_HIDE_TEXT_TRACKS_REQUEST:"mediahidetexttracksrequest",MEDIA_SHOW_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_TOGGLE_SUBTITLES_REQUEST:"mediatogglesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",MEDIA_RENDITION_REQUEST:"mediarenditionrequest",MEDIA_AUDIO_TRACK_REQUEST:"mediaaudiotrackrequest",MEDIA_SEEK_TO_LIVE_REQUEST:"mediaseektoliverequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},y={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},Wo={MEDIA_AIRPLAY_UNAVAILABLE:"mediaAirplayUnavailable",MEDIA_FULLSCREEN_UNAVAILABLE:"mediaFullscreenUnavailable",MEDIA_PIP_UNAVAILABLE:"mediaPipUnavailable",MEDIA_CAST_UNAVAILABLE:"mediaCastUnavailable",MEDIA_RENDITION_UNAVAILABLE:"mediaRenditionUnavailable",MEDIA_AUDIO_TRACK_UNAVAILABLE:"mediaAudioTrackUnavailable",MEDIA_PAUSED:"mediaPaused",MEDIA_HAS_PLAYED:"mediaHasPlayed",MEDIA_ENDED:"mediaEnded",MEDIA_MUTED:"mediaMuted",MEDIA_VOLUME_LEVEL:"mediaVolumeLevel",MEDIA_VOLUME:"mediaVolume",MEDIA_VOLUME_UNAVAILABLE:"mediaVolumeUnavailable",MEDIA_IS_PIP:"mediaIsPip",MEDIA_IS_CASTING:"mediaIsCasting",MEDIA_IS_AIRPLAYING:"mediaIsAirplaying",MEDIA_SUBTITLES_LIST:"mediaSubtitlesList",MEDIA_SUBTITLES_SHOWING:"mediaSubtitlesShowing",MEDIA_IS_FULLSCREEN:"mediaIsFullscreen",MEDIA_PLAYBACK_RATE:"mediaPlaybackRate",MEDIA_CURRENT_TIME:"mediaCurrentTime",MEDIA_DURATION:"mediaDuration",MEDIA_SEEKABLE:"mediaSeekable",MEDIA_PREVIEW_TIME:"mediaPreviewTime",MEDIA_PREVIEW_IMAGE:"mediaPreviewImage",MEDIA_PREVIEW_COORDS:"mediaPreviewCoords",MEDIA_PREVIEW_CHAPTER:"mediaPreviewChapter",MEDIA_LOADING:"mediaLoading",MEDIA_BUFFERED:"mediaBuffered",MEDIA_STREAM_TYPE:"mediaStreamType",MEDIA_TARGET_LIVE_WINDOW:"mediaTargetLiveWindow",MEDIA_TIME_IS_LIVE:"mediaTimeIsLive",MEDIA_RENDITION_LIST:"mediaRenditionList",MEDIA_RENDITION_SELECTED:"mediaRenditionSelected",MEDIA_AUDIO_TRACK_LIST:"mediaAudioTrackList",MEDIA_AUDIO_TRACK_ENABLED:"mediaAudioTrackEnabled",MEDIA_CHAPTERS_CUES:"mediaChaptersCues"},Ec=Object.entries(Wo),s=Ec.reduce((i,[e,t])=>(i[e]=`${t.toLowerCase()}`,i),{}),Tt=Ec.reduce((i,[e,t])=>(i[e]=`${t.toLowerCase()}`,i),{USER_INACTIVE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"}),P0=Object.entries(Tt).reduce((i,[e,t])=>{let a=s[e];return a&&(i[t]=a),i},{userinactivechange:"userinactive"}),gc=Object.entries(s).reduce((i,[e,t])=>{let a=Tt[e];return a&&(i[t]=a),i},{userinactive:"userinactivechange"}),Ue={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},Pt={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Ho={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},Te={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},Be={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var _c={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};var K={AUDIO_PLAYER:()=>"audio player",VIDEO_PLAYER:()=>"video player",VOLUME:()=>"volume",SEEK:()=>"seek",CLOSED_CAPTIONS:()=>"closed captions",PLAYBACK_RATE:({playbackRate:i=1}={})=>`current playback rate ${i}`,PLAYBACK_TIME:()=>"playback time",MEDIA_LOADING:()=>"media loading",SETTINGS:()=>"settings",AUDIO_TRACKS:()=>"audio tracks",QUALITY:()=>"quality"},Y={PLAY:()=>"play",PAUSE:()=>"pause",MUTE:()=>"mute",UNMUTE:()=>"unmute",ENTER_AIRPLAY:()=>"start airplay",EXIT_AIRPLAY:()=>"stop airplay",ENTER_CAST:()=>"start casting",EXIT_CAST:()=>"stop casting",ENTER_FULLSCREEN:()=>"enter fullscreen mode",EXIT_FULLSCREEN:()=>"exit fullscreen mode",ENTER_PIP:()=>"enter picture in picture mode",EXIT_PIP:()=>"exit picture in picture mode",SEEK_FORWARD_N_SECS:({seekOffset:i=30}={})=>`seek forward ${i} seconds`,SEEK_BACK_N_SECS:({seekOffset:i=30}={})=>`seek back ${i} seconds`,SEEK_LIVE:()=>"seek to live",PLAYING_LIVE:()=>"playing live"},Av={...K,...Y};function Ac(i){return i==null?void 0:i.map(yv).join(" ")}function $r(i){return i==null?void 0:i.split(/\s+/).map(Tv)}function yv(i){if(i){let{id:e,width:t,height:a}=i;return[e,t,a].filter(r=>r!=null).join(":")}}function Tv(i){if(i){let[e,t,a]=i.split(":");return{id:e,width:t,height:a}}}function yc(i){return i==null?void 0:i.map(kv).join(" ")}function Fr(i){return i==null?void 0:i.split(/\s+/).map(Sv)}function kv(i){if(i){let{id:e,kind:t,language:a,label:r}=i;return[e,t,a,r].filter(n=>n!=null).join(":")}}function Sv(i){if(i){let[e,t,a,r]=i.split(":");return{id:e,kind:t,language:a,label:r}}}function Tc(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function kc(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}function Vr(i){return typeof i!="string"?!1:!isNaN(i)&&!isNaN(parseFloat(i))}var Kr=i=>new Promise(e=>setTimeout(e,i));var Sc=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],Iv=(i,e)=>{let t=i===1?Sc[e].singular:Sc[e].plural;return`${i} ${t}`},ri=i=>{if(!kc(i))return"";let e=Math.abs(i),t=e!==i,a=new Date(0,0,0,0,0,e,0);return`${[a.getHours(),a.getMinutes(),a.getSeconds()].map((d,u)=>d&&Iv(d,u)).filter(d=>d).join(", ")}${t?" remaining":""}`};function Xe(i,e){let t=!1;i<0&&(t=!0,i=0-i),i=i<0?0:i;let a=Math.floor(i%60),r=Math.floor(i/60%60),n=Math.floor(i/3600),o=Math.floor(e/60%60),d=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(n=r=a="0"),n=n>0||d>0?n+":":"",r=((n||o>=10)&&r<10?"0"+r:r)+":",a=a<10?"0"+a:a,(t?"-":"")+n+r+a}var W0=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}});var Yr=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},Gr=class extends Yr{},$o=class{observe(){}unobserve(){}disconnect(){}},Ic={createElement:function(){return new qr.HTMLElement},createElementNS:function(){return new qr.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(i){return!1}},qr={ResizeObserver:$o,document:Ic,Node:Gr,HTMLElement:class extends Gr{},DocumentFragment:class extends Yr{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},localStorage:{getItem(i){return null},setItem(i,e){},removeItem(i){}},CustomEvent:function(){},getComputedStyle:function(){},navigator:{languages:[],get userAgent(){return""}},matchMedia(i){return{matches:!1,media:i}}},Cc=typeof window=="undefined"||typeof window.customElements=="undefined",Lc=Object.keys(qr).every(i=>i in globalThis),l=Cc&&!Lc?qr:globalThis,m=Cc&&!Lc?Ic:globalThis.document;var Mc=new WeakMap,Fo=i=>{let e=Mc.get(i);return e||Mc.set(i,e=new Set),e},wc=new l.ResizeObserver(i=>{for(let e of i)for(let t of Fo(e.target))t(e)});function Me(i,e){Fo(i).add(e),wc.observe(i)}function Je(i,e){let t=Fo(i);t.delete(e),t.size||wc.unobserve(i)}function X(i){var e;return(e=Zr(i))!=null?e:We(i,"media-controller")}function Zr(i){var e;let{MEDIA_CONTROLLER:t}=y,a=i.getAttribute(t);if(a)return(e=si(i))==null?void 0:e.getElementById(a)}var Qr=(i,e,t=".value")=>{let a=i.querySelector(t);a&&(a.textContent=e)},Lv=(i,e)=>{let t=`slot[name="${e}"]`,a=i.shadowRoot.querySelector(t);return a?a.children:[]},zr=(i,e)=>Lv(i,e)[0],ue=(i,e)=>!i||!e?!1:i!=null&&i.contains(e)?!0:ue(i,e.getRootNode().host),We=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||We(i.getRootNode().host,e)};function ni(i=document){var e;let t=i==null?void 0:i.activeElement;return t?(e=ni(t.shadowRoot))!=null?e:t:null}function si(i){var e;let t=(e=i==null?void 0:i.getRootNode)==null?void 0:e.call(i);return t instanceof ShadowRoot||t instanceof Document?t:null}function Rc(i,e=3){if(i.checkVisibility)return i.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0});let t=i;for(;t&&e>0;){let a=getComputedStyle(t);if(a.opacity==="0"||a.visibility==="hidden"||a.display==="none")return!1;t=t.parentElement,e--}return!0}function xc(i,e,t,a){let r=Vo(t,a),n=Vo(t,{x:i,y:e}),o=Vo(a,{x:i,y:e});return n>r||o>r?n>o?1:0:n/r}function Vo(i,e){return Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2))}function N(i,e){let t=Mv(i,a=>a===e);return t||Ko(i,e)}function Mv(i,e){var t;let a;for(a of i.querySelectorAll("style")){let r;try{r=(t=a.sheet)==null?void 0:t.cssRules}catch{continue}for(let n of r!=null?r:[])if(e(n.selectorText))return n}}function Ko(i,e){var t,a;let r=(t=i.querySelectorAll("style"))!=null?t:[],n=r==null?void 0:r[r.length-1];return n!=null&&n.sheet?(n==null||n.sheet.insertRule(`${e}{}`,n.sheet.cssRules.length),(a=n.sheet.cssRules)==null?void 0:a[n.sheet.cssRules.length-1]):(console.warn("Media Chrome: No style sheet found on style tag of",i),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}})}function x(i,e,t=Number.NaN){let a=i.getAttribute(e);return a!=null?+a:t}function U(i,e,t){let a=+t;if(t==null||Number.isNaN(a)){i.hasAttribute(e)&&i.removeAttribute(e);return}x(i,e,void 0)!==a&&i.setAttribute(e,`${a}`)}function H(i,e){return i.hasAttribute(e)}function B(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}H(i,e)!=t&&i.toggleAttribute(e,t)}function I(i,e,t=null){var a;return(a=i.getAttribute(e))!=null?a:t}function k(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}let a=`${t}`;I(i,e,void 0)!==a&&i.setAttribute(e,a)}var Dc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Nt=(i,e,t)=>(Dc(i,e,"read from private field"),t?t.call(i):e.get(i)),wv=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Xr=(i,e,t,a)=>(Dc(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),be,Oc=m.createElement("template");Oc.innerHTML=`
2
2
  <style>
3
3
  :host {
4
4
  display: var(--media-control-display, var(--media-gesture-receiver-display, inline-block));
5
5
  box-sizing: border-box;
6
6
  }
7
7
  </style>
8
- `;var Yo=class extends l.HTMLElement{constructor(e={}){if(super(),wv(this,be,void 0),!this.shadowRoot){let t=this.attachShadow({mode:"open"}),a=Oc.content.cloneNode(!0);this.nativeEl=a;let r=e.slotTemplate;r||(r=m.createElement("template"),r.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),t.appendChild(a)}}static get observedAttributes(){return[y.MEDIA_CONTROLLER,s.MEDIA_PAUSED]}attributeChangedCallback(e,t,a){var r,n,o,d,u;e===y.MEDIA_CONTROLLER&&(t&&((n=(r=Nt(this,be))==null?void 0:r.unassociateElement)==null||n.call(r,this),Xr(this,be,null)),a&&this.isConnected&&(Xr(this,be,(o=this.getRootNode())==null?void 0:o.getElementById(a)),(u=(d=Nt(this,be))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,t,a,r;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),Xr(this,be,Rv(this)),this.getAttribute(y.MEDIA_CONTROLLER)&&((t=(e=Nt(this,be))==null?void 0:e.associateElement)==null||t.call(e,this)),(a=Nt(this,be))==null||a.addEventListener("pointerdown",this),(r=Nt(this,be))==null||r.addEventListener("click",this)}disconnectedCallback(){var e,t,a,r;this.getAttribute(y.MEDIA_CONTROLLER)&&((t=(e=Nt(this,be))==null?void 0:e.unassociateElement)==null||t.call(e,this)),(a=Nt(this,be))==null||a.removeEventListener("pointerdown",this),(r=Nt(this,be))==null||r.removeEventListener("click",this),Xr(this,be,null)}handleEvent(e){var t;let a=(t=e.composedPath())==null?void 0:t[0];if(["video","media-controller"].includes(a==null?void 0:a.localName)){if(e.type==="pointerdown")this._pointerType=e.pointerType;else if(e.type==="click"){let{clientX:n,clientY:o}=e,{left:d,top:u,width:c,height:f}=this.getBoundingClientRect(),E=n-d,v=o-u;if(E<0||v<0||E>c||v>f||c===0&&f===0)return;let{pointerType:b=this._pointerType}=e;if(this._pointerType=void 0,b===Ho.TOUCH){this.handleTap(e);return}else if(b===Ho.MOUSE){this.handleMouseClick(e);return}}}}get mediaPaused(){return H(this,s.MEDIA_PAUSED)}set mediaPaused(e){B(this,s.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(e){let t=this.mediaPaused?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new l.CustomEvent(t,{composed:!0,bubbles:!0}))}};be=new WeakMap;function Rv(i){var e;let t=i.getAttribute(y.MEDIA_CONTROLLER);return t?(e=i.getRootNode())==null?void 0:e.getElementById(t):Be(i,"media-controller")}l.customElements.get("media-gesture-receiver")||l.customElements.define("media-gesture-receiver",Yo);var xv=Object.defineProperty,Dv=(i,e,t)=>e in i?xv(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Ov=(i,e,t)=>(Dv(i,typeof e!="symbol"?e+"":e,t),t),zo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},qo=(i,e,t)=>(zo(i,e,"read from private field"),t?t.call(i):e.get(i)),si=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Go=(i,e,t,a)=>(zo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),We=(i,e,t)=>(zo(i,e,"access private method"),t),Jr,Ui,Zo,Pc,Qo,Nc,Oa,jr,en,Xo,Bi,Pa,M={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive"},Uc=m.createElement("template");Uc.innerHTML=`
8
+ `;var Yo=class extends l.HTMLElement{constructor(e={}){if(super(),wv(this,be,void 0),!this.shadowRoot){let t=this.attachShadow({mode:"open"}),a=Oc.content.cloneNode(!0);this.nativeEl=a;let r=e.slotTemplate;r||(r=m.createElement("template"),r.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),t.appendChild(a)}}static get observedAttributes(){return[y.MEDIA_CONTROLLER,s.MEDIA_PAUSED]}attributeChangedCallback(e,t,a){var r,n,o,d,u;e===y.MEDIA_CONTROLLER&&(t&&((n=(r=Nt(this,be))==null?void 0:r.unassociateElement)==null||n.call(r,this),Xr(this,be,null)),a&&this.isConnected&&(Xr(this,be,(o=this.getRootNode())==null?void 0:o.getElementById(a)),(u=(d=Nt(this,be))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,t,a,r;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),Xr(this,be,Rv(this)),this.getAttribute(y.MEDIA_CONTROLLER)&&((t=(e=Nt(this,be))==null?void 0:e.associateElement)==null||t.call(e,this)),(a=Nt(this,be))==null||a.addEventListener("pointerdown",this),(r=Nt(this,be))==null||r.addEventListener("click",this)}disconnectedCallback(){var e,t,a,r;this.getAttribute(y.MEDIA_CONTROLLER)&&((t=(e=Nt(this,be))==null?void 0:e.unassociateElement)==null||t.call(e,this)),(a=Nt(this,be))==null||a.removeEventListener("pointerdown",this),(r=Nt(this,be))==null||r.removeEventListener("click",this),Xr(this,be,null)}handleEvent(e){var t;let a=(t=e.composedPath())==null?void 0:t[0];if(["video","media-controller"].includes(a==null?void 0:a.localName)){if(e.type==="pointerdown")this._pointerType=e.pointerType;else if(e.type==="click"){let{clientX:n,clientY:o}=e,{left:d,top:u,width:c,height:f}=this.getBoundingClientRect(),g=n-d,v=o-u;if(g<0||v<0||g>c||v>f||c===0&&f===0)return;let{pointerType:b=this._pointerType}=e;if(this._pointerType=void 0,b===Ho.TOUCH){this.handleTap(e);return}else if(b===Ho.MOUSE){this.handleMouseClick(e);return}}}}get mediaPaused(){return H(this,s.MEDIA_PAUSED)}set mediaPaused(e){B(this,s.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(e){let t=this.mediaPaused?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new l.CustomEvent(t,{composed:!0,bubbles:!0}))}};be=new WeakMap;function Rv(i){var e;let t=i.getAttribute(y.MEDIA_CONTROLLER);return t?(e=i.getRootNode())==null?void 0:e.getElementById(t):We(i,"media-controller")}l.customElements.get("media-gesture-receiver")||l.customElements.define("media-gesture-receiver",Yo);var xv=Object.defineProperty,Dv=(i,e,t)=>e in i?xv(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Ov=(i,e,t)=>(Dv(i,typeof e!="symbol"?e+"":e,t),t),zo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},qo=(i,e,t)=>(zo(i,e,"read from private field"),t?t.call(i):e.get(i)),oi=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Go=(i,e,t,a)=>(zo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),He=(i,e,t)=>(zo(i,e,"access private method"),t),Jr,Ui,Zo,Pc,Qo,Nc,Oa,jr,en,Xo,Bi,Pa,M={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive"},Uc=m.createElement("template");Uc.innerHTML=`
9
9
  <style>
10
10
 
11
11
  :host([${s.MEDIA_IS_FULLSCREEN}]) ::slotted([slot=media]) {
@@ -142,7 +142,7 @@
142
142
 
143
143
  <slot part="bottom chrome"></slot>
144
144
  </span>
145
- `;var Pv=Object.values(s),Nv="sm:384 md:576 lg:768 xl:960";function Uv(i){Bv(i.target,i.contentRect.width)}function Bv(i,e){var t;if(!i.isConnected)return;let a=(t=i.getAttribute(M.BREAKPOINTS))!=null?t:Nv,r=Wv(a),n=Hv(r,e),o=!1;if(Object.keys(r).forEach(d=>{if(n.includes(d)){i.hasAttribute(`breakpoint${d}`)||(i.setAttribute(`breakpoint${d}`,""),o=!0);return}i.hasAttribute(`breakpoint${d}`)&&(i.removeAttribute(`breakpoint${d}`),o=!0)}),o){let d=new CustomEvent(yt.BREAKPOINTS_CHANGE,{detail:n});i.dispatchEvent(d)}}function Wv(i){let e=i.split(/\s+/);return Object.fromEntries(e.map(t=>t.split(":")))}function Hv(i,e){return Object.keys(i).filter(t=>e>=i[t])}var Na=class extends l.HTMLElement{constructor(){super(),si(this,Zo),si(this,Qo),si(this,Oa),si(this,en),si(this,Bi),si(this,Jr,0),si(this,Ui,void 0),Ov(this,"breakpointsComputed",!1),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Uc.content.cloneNode(!0)));let e=o=>{let d=this.media;for(let u of o)u.type==="childList"&&(u.removedNodes.forEach(c=>{if(c.slot=="media"&&u.target==this){let f=u.previousSibling&&u.previousSibling.previousElementSibling;if(!f||!d)this.mediaUnsetCallback(c);else{let E=f.slot!=="media";for(;(f=f.previousSibling)!==null;)f.slot=="media"&&(E=!1);E&&this.mediaUnsetCallback(c)}}}),d&&u.addedNodes.forEach(c=>{c===d&&this.handleMediaUpdated(d)}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0});let a=!1;Le(this,o=>{a||(setTimeout(()=>{Uv(o),a=!1,this.breakpointsComputed||(this.breakpointsComputed=!0,this.dispatchEvent(new CustomEvent(yt.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))},0),a=!0)});let n=this.querySelector(":scope > slot[slot=media]");n&&n.addEventListener("slotchange",()=>{if(!n.assignedElements({flatten:!0}).length){qo(this,Ui)&&this.mediaUnsetCallback(qo(this,Ui));return}this.handleMediaUpdated(this.media)})}static get observedAttributes(){return[M.AUTOHIDE,M.GESTURES_DISABLED].concat(Pv).filter(e=>![s.MEDIA_RENDITION_LIST,s.MEDIA_AUDIO_TRACK_LIST,s.MEDIA_CHAPTERS_CUES].includes(e))}attributeChangedCallback(e,t,a){e.toLowerCase()==M.AUTOHIDE&&(this.autohide=a)}get media(){let e=this.querySelector(":scope > [slot=media]");return(e==null?void 0:e.nodeName)=="SLOT"&&(e=e.assignedElements({flatten:!0})[0]),e}async handleMediaUpdated(e){e&&(Go(this,Ui,e),e.localName.includes("-")&&await l.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;let a=this.getAttribute(M.AUDIO)!=null?K.AUDIO_PLAYER():K.VIDEO_PLAYER();this.setAttribute("role","region"),this.setAttribute("aria-label",a),this.handleMediaUpdated(this.media),this.setAttribute(M.USER_INACTIVE,""),this.addEventListener("pointerdown",this),this.addEventListener("pointermove",this),this.addEventListener("pointerup",this),this.addEventListener("mouseleave",this),this.addEventListener("keyup",this),(e=l.window)==null||e.addEventListener("mouseup",this)}disconnectedCallback(){var e;this.media&&this.mediaUnsetCallback(this.media),(e=l.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){Go(this,Ui,null)}handleEvent(e){switch(e.type){case"pointerdown":Go(this,Jr,e.timeStamp);break;case"pointermove":We(this,Zo,Pc).call(this,e);break;case"pointerup":We(this,Qo,Nc).call(this,e);break;case"mouseleave":We(this,Oa,jr).call(this);break;case"mouseup":this.removeAttribute(M.KEYBOARD_CONTROL);break;case"keyup":We(this,Bi,Pa).call(this),this.setAttribute(M.KEYBOARD_CONTROL,"");break}}set autohide(e){e=Number(e),this._autohide=isNaN(e)?0:e}get autohide(){return this._autohide===void 0?2:this._autohide}};Jr=new WeakMap;Ui=new WeakMap;Zo=new WeakSet;Pc=function(i){i.pointerType!=="mouse"&&i.timeStamp-qo(this,Jr)<250||(We(this,en,Xo).call(this),clearTimeout(this._inactiveTimeout),[this,this.media].includes(i.target)&&We(this,Bi,Pa).call(this))};Qo=new WeakSet;Nc=function(i){if(i.pointerType==="touch"){let e=!this.hasAttribute(M.USER_INACTIVE);[this,this.media].includes(i.target)&&e?We(this,Oa,jr).call(this):We(this,Bi,Pa).call(this)}else i.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&We(this,Bi,Pa).call(this)};Oa=new WeakSet;jr=function(){if(this.autohide<0||this.hasAttribute(M.USER_INACTIVE))return;this.setAttribute(M.USER_INACTIVE,"");let i=new l.CustomEvent(yt.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(i)};en=new WeakSet;Xo=function(){if(!this.hasAttribute(M.USER_INACTIVE))return;this.removeAttribute(M.USER_INACTIVE);let i=new l.CustomEvent(yt.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(i)};Bi=new WeakSet;Pa=function(){We(this,en,Xo).call(this),clearTimeout(this._inactiveTimeout),!(this.autohide<0)&&(this._inactiveTimeout=setTimeout(()=>{We(this,Oa,jr).call(this)},this.autohide*1e3))};l.customElements.get("media-container")||l.customElements.define("media-container",Na);var Bc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ne=(i,e,t)=>(Bc(i,e,"read from private field"),t?t.call(i):e.get(i)),Ua=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},tn=(i,e,t,a)=>(Bc(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Wi,Hi,an,oi,Tt,Ut,Me=class{constructor(e,t,{defaultValue:a}={defaultValue:void 0}){Ua(this,Tt),Ua(this,Wi,void 0),Ua(this,Hi,void 0),Ua(this,an,void 0),Ua(this,oi,new Set),tn(this,Wi,e),tn(this,Hi,t),tn(this,an,new Set(a))}[Symbol.iterator](){return ne(this,Tt,Ut).values()}get length(){return ne(this,Tt,Ut).size}get value(){var e;return(e=[...ne(this,Tt,Ut)].join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(tn(this,oi,new Set),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return[...ne(this,Tt,Ut)][e]}values(){return ne(this,Tt,Ut).values()}forEach(e){ne(this,Tt,Ut).forEach(e)}add(...e){var t,a;e.forEach(r=>ne(this,oi).add(r)),!(this.value===""&&!((t=ne(this,Wi))!=null&&t.hasAttribute(`${ne(this,Hi)}`)))&&((a=ne(this,Wi))==null||a.setAttribute(`${ne(this,Hi)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>ne(this,oi).delete(a)),(t=ne(this,Wi))==null||t.setAttribute(`${ne(this,Hi)}`,`${this.value}`)}contains(e){return ne(this,Tt,Ut).has(e)}toggle(e,t){return typeof t!="undefined"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){return this.remove(e),this.add(t),e===t}};Wi=new WeakMap;Hi=new WeakMap;an=new WeakMap;oi=new WeakMap;Tt=new WeakSet;Ut=function(){return ne(this,oi).size?ne(this,oi):ne(this,an)};var $v=(i="")=>i.split(/\s+/),Wc=(i="")=>{let[e,t,a]=i.split(":"),r=a?decodeURIComponent(a):void 0;return e=e==="cc"?"captions":"subtitles",{kind:e,language:t,label:r}},kt=(i="",e={})=>$v(i).map(t=>{let a=Wc(t);return{...e,...a}}),Jo=i=>i?Array.isArray(i)?i.map(e=>typeof e=="string"?Wc(e):e):typeof i=="string"?kt(i):[i]:[],li=({kind:i,label:e,language:t}={kind:"subtitles"})=>e?`${i==="captions"?"cc":"sb"}:${t}:${encodeURIComponent(e)}`:t,He=(i=[])=>Array.prototype.map.call(i,li).join(" "),Fv=(i,e)=>t=>t[i]===e,Hc=i=>{let e=Object.entries(i).map(([t,a])=>Fv(t,a));return t=>e.every(a=>a(t))},di=(i,e=[],t=[])=>{let a=Jo(t).map(Hc),r=n=>a.some(o=>o(n));Array.from(e).filter(r).forEach(n=>{n.mode=i})},ui=(i,e=()=>!0)=>{if(!(i!=null&&i.textTracks))return[];let t=typeof e=="function"?e:Hc(e);return Array.from(i.textTracks).filter(t)},rn=i=>{var e;return!!((e=i.mediaSubtitlesShowing)!=null&&e.length)||i.hasAttribute(s.MEDIA_SUBTITLES_SHOWING)};var G={enter:"requestFullscreen",exit:"exitFullscreen",rootEvents:["fullscreenchange"],mediaEvents:[],element:"fullscreenElement",error:"fullscreenerror",enabled:"fullscreenEnabled"};m.fullscreenElement===void 0&&(G.enter="webkitRequestFullScreen",G.exit=m.webkitExitFullscreen!=null?"webkitExitFullscreen":"webkitCancelFullScreen",G.rootEvents=["webkitfullscreenchange"],G.mediaEvents=["webkitbeginfullscreen","webkitendfullscreen"],G.element="webkitFullscreenElement",G.error="webkitfullscreenerror",G.enabled="webkitFullscreenEnabled");var nn,jo=()=>{var i,e;return nn||(nn=(e=(i=m)==null?void 0:i.createElement)==null?void 0:e.call(i,"video"),nn)},$c=async(i=jo())=>{if(!i)return!1;let e=i.volume;return i.volume=e/2+.1,await Kr(0),i.volume!==e},Vv=/.*Version\/.*Safari\/.*/.test(l.navigator.userAgent),el=(i=jo())=>l.matchMedia("(display-mode: standalone)").matches&&Vv?!1:typeof(i==null?void 0:i.requestPictureInPicture)=="function",tl=(i=jo())=>{let e=m[G.enabled];return!e&&i&&(e="webkitSupportsFullscreen"in i),e},Fc=tl(),Vc=el(),Kc=!!l.WebKitPlaybackTargetAvailabilityEvent,Yc=!!l.chrome;var $i=i=>ui(i.media,e=>[Ne.SUBTITLES,Ne.CAPTIONS].includes(e.kind)).sort((e,t)=>e.kind>=t.kind?1:-1),il=i=>ui(i.media,e=>e.mode===Pt.SHOWING&&[Ne.SUBTITLES,Ne.CAPTIONS].includes(e.kind)),sn=(i,e)=>{let t=$i(i),a=il(i),r=!!a.length;if(t.length){if(e===!1||r&&e!==!0)di(Pt.DISABLED,t,a);else if(e===!0||!r&&e!==!1){let n=t[0],{options:o}=i;if(!(o!=null&&o.noSubtitlesLangPref)){let f=globalThis.localStorage.getItem("media-chrome-pref-subtitles-lang"),E=f?[f,...globalThis.navigator.languages]:globalThis.navigator.languages,v=t.filter(b=>E.some(w=>b.language.toLowerCase().startsWith(w.split("-")[0]))).sort((b,w)=>{let _=E.findIndex(D=>b.language.toLowerCase().startsWith(D.split("-")[0])),T=E.findIndex(D=>w.language.toLowerCase().startsWith(D.split("-")[0]));return _-T});v[0]&&(n=v[0])}let{language:d,label:u,kind:c}=n;di(Pt.DISABLED,t,a),di(Pt.SHOWING,t,[{language:d,label:u,kind:c}])}}},on=(i,e)=>i===e?!0:typeof i!=typeof e?!1:typeof i=="number"&&Number.isNaN(i)&&Number.isNaN(e)?!0:typeof i!="object"?!1:Array.isArray(i)?Kv(i,e):Object.entries(i).every(([t,a])=>t in e&&on(a,e[t])),Kv=(i,e)=>{let t=Array.isArray(i),a=Array.isArray(e);return t!==a?!1:t||a?i.length!==e.length?!1:i.every((r,n)=>on(r,e[n])):!0};var Yv=Object.values(Ue),ln,Gv=$c().then(i=>(ln=i,ln)),Gc=async(...i)=>{await Promise.all(i.filter(e=>e).map(async e=>{if(!("localName"in e&&e instanceof l.HTMLElement))return;let t=e.localName;if(!t.includes("-"))return;let a=l.customElements.get(t);a&&e instanceof a||(await l.customElements.whenDefined(t),l.customElements.upgrade(e))}))},Ba={mediaPaused:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.paused)!=null?e:!0},set(i,e){var t;let{media:a}=e;a&&(i?a.pause():(t=a.play())==null||t.catch(()=>{}))},mediaEvents:["play","playing","pause","emptied"]},mediaHasPlayed:{get(i,e){let{media:t}=i;return t?e?e.type==="playing":!t.paused:!1},mediaEvents:["playing","emptied"]},mediaEnded:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.ended)!=null?e:!1},mediaEvents:["seeked","ended","emptied"]},mediaPlaybackRate:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.playbackRate)!=null?e:1},set(i,e){let{media:t}=e;t&&Number.isFinite(+i)&&(t.playbackRate=+i)},mediaEvents:["ratechange","loadstart"]},mediaMuted:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.muted)!=null?e:!1},set(i,e){let{media:t}=e;t&&(t.muted=i)},mediaEvents:["volumechange"]},mediaVolume:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.volume)!=null?e:1},set(i,e){let{media:t}=e;if(t){try{i==null?l.localStorage.removeItem("media-chrome-pref-volume"):l.localStorage.setItem("media-chrome-pref-volume",i.toString())}catch{}Number.isFinite(+i)&&(t.volume=+i)}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(i,e)=>{let{options:{noVolumePref:t}}=e;if(!t)try{let a=l.localStorage.getItem("media-chrome-pref-volume");if(a==null)return;Ba.mediaVolume.set(+a,e),i(a)}catch(a){console.debug("Error getting volume pref",a)}}]},mediaVolumeLevel:{get(i){let{media:e}=i;return typeof(e==null?void 0:e.volume)=="undefined"?"high":e.muted||e.volume===0?"off":e.volume<.5?"low":e.volume<.75?"medium":"high"},mediaEvents:["volumechange"]},mediaCurrentTime:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.currentTime)!=null?e:0},set(i,e){let{media:t}=e;!t||t.readyState===0||(t.currentTime=i)},mediaEvents:["timeupdate","loadedmetadata"]},mediaDuration:{get(i){let{media:e,options:{defaultDuration:t}={}}=i;return t&&(!e||!e.duration||Number.isNaN(e.duration)||!Number.isFinite(e.duration))?t:Number.isFinite(e==null?void 0:e.duration)?e.duration:Number.NaN},mediaEvents:["durationchange","loadedmetadata","emptied"]},mediaLoading:{get(i){let{media:e}=i;return(e==null?void 0:e.readyState)<3},mediaEvents:["waiting","playing","emptied"]},mediaSeekable:{get(i){var e;let{media:t}=i;if(!((e=t==null?void 0:t.seekable)!=null&&e.length))return;let a=t.seekable.start(0),r=t.seekable.end(t.seekable.length-1);if(!(!a&&!r))return[Number(a.toFixed(3)),Number(r.toFixed(3))]},mediaEvents:["loadedmetadata","emptied","progress","seekablechange"]},mediaBuffered:{get(i){var e;let{media:t}=i,a=(e=t==null?void 0:t.buffered)!=null?e:[];return Array.from(a).map((r,n)=>[Number(a.start(n).toFixed(3)),Number(a.end(n).toFixed(3))])},mediaEvents:["progress","emptied"]},mediaStreamType:{get(i){let{media:e,options:{defaultStreamType:t}={}}=i,a=[Ue.LIVE,Ue.ON_DEMAND].includes(t)?t:void 0;if(!e)return a;let{streamType:r}=e;if(Yv.includes(r))return r===Ue.UNKNOWN?a:r;let n=e.duration;return n===1/0?Ue.LIVE:Number.isFinite(n)?Ue.ON_DEMAND:a},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange"]},mediaTargetLiveWindow:{get(i){let{media:e}=i;if(!e)return Number.NaN;let{targetLiveWindow:t}=e,a=Ba.mediaStreamType.get(i);return(t==null||Number.isNaN(t))&&a===Ue.LIVE?0:t},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange","targetlivewindowchange"]},mediaTimeIsLive:{get(i){let{media:e,options:{liveEdgeOffset:t=10}={}}=i;if(!e)return!1;if(typeof e.liveEdgeStart=="number")return Number.isNaN(e.liveEdgeStart)?!1:e.currentTime>=e.liveEdgeStart;if(!(Ba.mediaStreamType.get(i)===Ue.LIVE))return!1;let r=e.seekable;if(!r)return!0;if(!r.length)return!1;let n=r.end(r.length-1)-t;return e.currentTime>=n},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},mediaSubtitlesList:{get(i){return $i(i).map(({kind:e,label:t,language:a})=>({kind:e,label:t,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},mediaSubtitlesShowing:{get(i){return il(i).map(({kind:e,label:t,language:a})=>({kind:e,label:t,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(i,e)=>{var t,a;let{media:r,options:n}=e;if(!r)return;let o=d=>{var u;!n.defaultSubtitles||d&&![Ne.CAPTIONS,Ne.SUBTITLES].includes((u=d==null?void 0:d.track)==null?void 0:u.kind)||sn(e,!0)};return(t=r.textTracks)==null||t.addEventListener("addtrack",o),(a=r.textTracks)==null||a.addEventListener("removetrack",o),o(),()=>{var d,u;(d=r.textTracks)==null||d.removeEventListener("addtrack",o),(u=r.textTracks)==null||u.removeEventListener("removetrack",o)}}]},mediaChaptersCues:{get(i){var e;let{media:t}=i;if(!t)return[];let[a]=ui(t,{kind:Ne.CHAPTERS});return Array.from((e=a==null?void 0:a.cues)!=null?e:[]).map(({text:r,startTime:n,endTime:o})=>({text:r,startTime:n,endTime:o}))},mediaEvents:["loadstart","loadedmetadata"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(i,e)=>{let{media:t}=e;if(!t)return;let a=t.querySelector('track[kind="chapters"][default][src]');return a==null||a.addEventListener("load",i),()=>{a==null||a.removeEventListener("load",i)}}]},mediaIsPip:{get(i){var e,t;let{media:a,documentElement:r}=i;if(!a||!r||!r.pictureInPictureElement)return!1;if(r.pictureInPictureElement===a)return!0;if(r.pictureInPictureElement instanceof HTMLMediaElement)return(e=a.localName)!=null&&e.includes("-")?ue(a,r.pictureInPictureElement):!1;if(r.pictureInPictureElement.localName.includes("-")){let n=r.pictureInPictureElement.shadowRoot;for(;n!=null&&n.pictureInPictureElement;){if(n.pictureInPictureElement===a)return!0;n=(t=n.pictureInPictureElement)==null?void 0:t.shadowRoot}}return!1},set(i,e){let{media:t}=e;if(t)if(i){if(!m.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!t.requestPictureInPicture){console.warn("MediaChrome: The current media does not support picture-in-picture");return}let a=()=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};t.requestPictureInPicture().catch(r=>{if(r.code===11){if(!t.src){console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a src set.");return}if(t.readyState===0&&t.preload==="none"){let n=()=>{t.removeEventListener("loadedmetadata",o),t.preload="none"},o=()=>{t.requestPictureInPicture().catch(a),n()};t.addEventListener("loadedmetadata",o),t.preload="metadata",setTimeout(()=>{t.readyState===0&&a(),n()},1e3)}else throw r}else throw r})}else m.pictureInPictureElement&&m.exitPictureInPicture()},mediaEvents:["enterpictureinpicture","leavepictureinpicture"]},mediaRenditionList:{get(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.videoRenditions)!=null?e:[]].map(a=>({...a}))},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaRenditionSelected:{get(i){var e,t,a;let{media:r}=i;return(a=(t=r==null?void 0:r.videoRenditions)==null?void 0:t[(e=r.videoRenditions)==null?void 0:e.selectedIndex])==null?void 0:a.id},set(i,e){let{media:t}=e;if(!(t!=null&&t.videoRenditions)){console.warn("MediaController: Rendition selection not supported by this media.");return}let a=i,r=Array.prototype.findIndex.call(t.videoRenditions,n=>n.id==a);t.videoRenditions.selectedIndex!=r&&(t.videoRenditions.selectedIndex=r)},mediaEvents:["emptied"],videoRenditionsEvents:["addrendition","removerendition","change"]},mediaAudioTrackList:{get(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.audioTracks)!=null?e:[]]},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaAudioTrackEnabled:{get(i){var e,t;let{media:a}=i;return(t=[...(e=a==null?void 0:a.audioTracks)!=null?e:[]].find(r=>r.enabled))==null?void 0:t.id},set(i,e){let{media:t}=e;if(!(t!=null&&t.audioTracks)){console.warn("MediaChrome: Audio track selection not supported by this media.");return}let a=i;for(let r of t.audioTracks)r.enabled=a==r.id},mediaEvents:["emptied"],audioTracksEvents:["addtrack","removetrack","change"]},mediaIsFullscreen:{get(i){var e;let{media:t,documentElement:a,fullscreenElement:r=t}=i;if(!t||!a)return!1;if(!a[G.element])return"webkitDisplayingFullscreen"in t&&"webkitPresentationMode"in t?t.webkitDisplayingFullscreen&&t.webkitPresentationMode===_c.FULLSCREEN:!1;if(a[G.element]===r)return!0;if(a[G.element].localName.includes("-")){let n=a[G.element].shadowRoot;if(!(G.element in n))return ue(a[G.element],r);for(;n!=null&&n[G.element];){if(n[G.element]===r)return!0;n=(e=n[G.element])==null?void 0:e.shadowRoot}}return!1},set(i,e){var t,a;let{media:r,fullscreenElement:n,documentElement:o}=e;if(!i&&(o!=null&&o[G.exit])){let d=(t=o==null?void 0:o[G.exit])==null?void 0:t.call(o);d instanceof Promise&&d.catch(()=>{});return}if(n!=null&&n[G.enter]){let d=(a=n[G.enter])==null?void 0:a.call(n);d instanceof Promise&&d.catch(()=>{})}else r!=null&&r.webkitEnterFullscreen?r.webkitEnterFullscreen():r!=null&&r.requestFullscreen&&r.requestFullscreen()},rootEvents:G.rootEvents,mediaEvents:G.mediaEvents},mediaIsCasting:{get(i){var e;let{media:t}=i;return!(t!=null&&t.remote)||((e=t.remote)==null?void 0:e.state)==="disconnected"?!1:!!t.remote.state},set(i,e){var t,a;let{media:r}=e;if(r&&!(i&&((t=r.remote)==null?void 0:t.state)!=="disconnected")&&!(!i&&((a=r.remote)==null?void 0:a.state)!=="connected")){if(typeof r.remote.prompt!="function"){console.warn("MediaChrome: Casting is not supported in this environment");return}r.remote.prompt().catch(()=>{})}},remoteEvents:["connect","connecting","disconnect"]},mediaIsAirplaying:{get(){return!1},set(i,e){let{media:t}=e;if(t){if(!(t.webkitShowPlaybackTargetPicker&&l.WebKitPlaybackTargetAvailabilityEvent)){console.warn("MediaChrome: received a request to select AirPlay but AirPlay is not supported in this environment");return}t.webkitShowPlaybackTargetPicker()}},mediaEvents:["webkitcurrentplaybacktargetiswirelesschanged"]},mediaFullscreenUnavailable:{get(i){let{media:e}=i;if(!Fc||!tl(e))return Te.UNSUPPORTED}},mediaPipUnavailable:{get(i){let{media:e}=i;if(!Vc||!el(e))return Te.UNSUPPORTED}},mediaVolumeUnavailable:{get(i){let{media:e}=i;if(ln===!1||(e==null?void 0:e.volume)==null)return Te.UNSUPPORTED},stateOwnersUpdateHandlers:[i=>{ln==null&&Gv.then(e=>i(e?void 0:Te.UNSUPPORTED))}]},mediaCastUnavailable:{get(i,{availability:e="not-available"}={}){var t;let{media:a}=i;if(!Yc||!((t=a==null?void 0:a.remote)!=null&&t.state))return Te.UNSUPPORTED;if(!(e==null||e==="available"))return Te.UNAVAILABLE},stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:a}=e;return a?(a.disableRemotePlayback||a.hasAttribute("disableremoteplayback")||(t=a==null?void 0:a.remote)==null||t.watchAvailability(n=>{i({availability:n?"available":"not-available"})}).catch(n=>{n.name==="NotSupportedError"?i({availability:null}):i({availability:"not-available"})}),()=>{var n;(n=a==null?void 0:a.remote)==null||n.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaAirplayUnavailable:{get(i,e){if(!Kc)return Te.UNSUPPORTED;if((e==null?void 0:e.availability)==="not-available")return Te.UNAVAILABLE},mediaEvents:["webkitplaybacktargetavailabilitychanged"],stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:a}=e;return a?(a.disableRemotePlayback||a.hasAttribute("disableremoteplayback")||(t=a==null?void 0:a.remote)==null||t.watchAvailability(n=>{i({availability:n?"available":"not-available"})}).catch(n=>{n.name==="NotSupportedError"?i({availability:null}):i({availability:"not-available"})}),()=>{var n;(n=a==null?void 0:a.remote)==null||n.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaRenditionUnavailable:{get(i){var e;let{media:t}=i;if(!(t!=null&&t.videoRenditions))return Te.UNSUPPORTED;if(!((e=t.videoRenditions)!=null&&e.length))return Te.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaAudioTrackUnavailable:{get(i){var e,t;let{media:a}=i;if(!(a!=null&&a.audioTracks))return Te.UNSUPPORTED;if(((t=(e=a.audioTracks)==null?void 0:e.length)!=null?t:0)<=1)return Te.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]}};var qc={[h.MEDIA_PREVIEW_REQUEST](i,e,{detail:t}){var a,r,n;let{media:o}=e,d=t!=null?t:void 0,u,c;if(o&&d!=null){let[b]=ui(o,{kind:Ne.METADATA,label:"thumbnails"}),w=Array.prototype.find.call((a=b==null?void 0:b.cues)!=null?a:[],(_,T,D)=>T===0?_.endTime>d:T===D.length-1?_.startTime<=d:_.startTime<=d&&_.endTime>d);if(w){let _=/'^(?:[a-z]+:)?\/\//i.test(w.text)||(r=o==null?void 0:o.querySelector('track[label="thumbnails"]'))==null?void 0:r.src,T=new URL(w.text,_);c=new URLSearchParams(T.hash).get("#xywh").split(",").map(te=>+te),u=T.href}}let f=i.mediaDuration.get(e),v=(n=i.mediaChaptersCues.get(e).find((b,w,_)=>w===_.length-1&&f===b.endTime?b.startTime<=d&&b.endTime>=d:b.startTime<=d&&b.endTime>d))==null?void 0:n.text;return t!=null&&v==null&&(v=""),{mediaPreviewTime:d,mediaPreviewImage:u,mediaPreviewCoords:c,mediaPreviewChapter:v}},[h.MEDIA_PAUSE_REQUEST](i,e){i["mediaPaused"].set(!0,e)},[h.MEDIA_PLAY_REQUEST](i,e){var t;let a="mediaPaused";if(i.mediaStreamType.get(e)===Ue.LIVE){let o=!(i.mediaTargetLiveWindow.get(e)>0),d=(t=i.mediaSeekable.get(e))==null?void 0:t[1];o&&d&&i.mediaCurrentTime.set(d,e)}i[a].set(!1,e)},[h.MEDIA_PLAYBACK_RATE_REQUEST](i,e,{detail:t}){let a="mediaPlaybackRate",r=t;i[a].set(r,e)},[h.MEDIA_MUTE_REQUEST](i,e){i["mediaMuted"].set(!0,e)},[h.MEDIA_UNMUTE_REQUEST](i,e){let t="mediaMuted";i.mediaVolume.get(e)||i.mediaVolume.set(.25,e),i[t].set(!1,e)},[h.MEDIA_VOLUME_REQUEST](i,e,{detail:t}){let a="mediaVolume",r=t;r&&i.mediaMuted.get(e)&&i.mediaMuted.set(!1,e),i[a].set(r,e)},[h.MEDIA_SEEK_REQUEST](i,e,{detail:t}){let a="mediaCurrentTime",r=t;i[a].set(r,e)},[h.MEDIA_SEEK_TO_LIVE_REQUEST](i,e){var t;let a="mediaCurrentTime",r=(t=i.mediaSeekable.get(e))==null?void 0:t[1];Number.isNaN(Number(r))&&i[a].set(r,e)},[h.MEDIA_SHOW_SUBTITLES_REQUEST](i,e,{detail:t}){var a;let{options:r}=e,n=$i(e),o=Jo(t),d=(a=o[0])==null?void 0:a.language;d&&!r.noSubtitlesLangPref&&l.localStorage.setItem("media-chrome-pref-subtitles-lang",d),di(Pt.SHOWING,n,o)},[h.MEDIA_DISABLE_SUBTITLES_REQUEST](i,e,{detail:t}){let a=$i(e),r=t!=null?t:[];di(Pt.DISABLED,a,r)},[h.MEDIA_TOGGLE_SUBTITLES_REQUEST](i,e,{detail:t}){sn(e,t)},[h.MEDIA_RENDITION_REQUEST](i,e,{detail:t}){let a="mediaRenditionSelected",r=t;i[a].set(r,e)},[h.MEDIA_AUDIO_TRACK_REQUEST](i,e,{detail:t}){let a="mediaAudioTrackEnabled",r=t;i[a].set(r,e)},[h.MEDIA_ENTER_PIP_REQUEST](i,e){let t="mediaIsPip";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[h.MEDIA_EXIT_PIP_REQUEST](i,e){i["mediaIsPip"].set(!1,e)},[h.MEDIA_ENTER_FULLSCREEN_REQUEST](i,e){let t="mediaIsFullscreen";i.mediaIsPip.get(e)&&i.mediaIsPip.set(!1,e),i[t].set(!0,e)},[h.MEDIA_EXIT_FULLSCREEN_REQUEST](i,e){i["mediaIsFullscreen"].set(!1,e)},[h.MEDIA_ENTER_CAST_REQUEST](i,e){let t="mediaIsCasting";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[h.MEDIA_EXIT_CAST_REQUEST](i,e){i["mediaIsCasting"].set(!1,e)},[h.MEDIA_AIRPLAY_REQUEST](i,e){i["mediaIsAirplaying"].set(!0,e)}};var qv=({media:i,fullscreenElement:e,documentElement:t,stateMediator:a=Ba,requestMap:r=qc,options:n={},monitorStateOwnersOnlyWithSubscriptions:o=!0})=>{let d=[],u={options:{...n}},c=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0}),f=_=>{_!=null&&(on(_,c)||(c=Object.freeze({...c,..._}),d.forEach(T=>T(c))))},E=()=>{let _=Object.entries(a).reduce((T,[D,{get:te}])=>(T[D]=te(u),T),{});f(_)},v={},b,w=async(_,T)=>{var D,te,ge,Ot,_t,Ea,ga,_a,Aa,ya,Ta,ka,Sa,Ia,Ca,La;let Wr=!!b;if(b={...u,...b!=null?b:{},..._},Wr)return;await Gc(...Object.values(_));let At=d.length>0&&T===0&&o,Ma=u.media!==b.media,wa=((D=u.media)==null?void 0:D.textTracks)!==((te=b.media)==null?void 0:te.textTracks),zu=((ge=u.media)==null?void 0:ge.videoRenditions)!==((Ot=b.media)==null?void 0:Ot.videoRenditions),Xu=((_t=u.media)==null?void 0:_t.audioTracks)!==((Ea=b.media)==null?void 0:Ea.audioTracks),Ju=((ga=u.media)==null?void 0:ga.remote)!==((_a=b.media)==null?void 0:_a.remote),ju=u.documentElement!==b.documentElement,ec=!!u.media&&(Ma||At),tc=!!((Aa=u.media)!=null&&Aa.textTracks)&&(wa||At),ic=!!((ya=u.media)!=null&&ya.videoRenditions)&&(zu||At),ac=!!((Ta=u.media)!=null&&Ta.audioTracks)&&(Xu||At),rc=!!((ka=u.media)!=null&&ka.remote)&&(Ju||At),nc=!!u.documentElement&&(ju||At),sc=ec||tc||ic||ac||rc||nc,Pi=d.length===0&&T===1&&o,oc=!!b.media&&(Ma||Pi),lc=!!((Sa=b.media)!=null&&Sa.textTracks)&&(wa||Pi),dc=!!((Ia=b.media)!=null&&Ia.videoRenditions)&&(zu||Pi),uc=!!((Ca=b.media)!=null&&Ca.audioTracks)&&(Xu||Pi),cc=!!((La=b.media)!=null&&La.remote)&&(Ju||Pi),mc=!!b.documentElement&&(ju||Pi),hc=oc||lc||dc||uc||cc||mc;if(!(sc||hc)){Object.entries(b).forEach(([F,Ra])=>{u[F]=Ra}),E(),b=void 0;return}Object.entries(a).forEach(([F,{get:Ra,mediaEvents:av=[],textTracksEvents:rv=[],videoRenditionsEvents:nv=[],audioTracksEvents:sv=[],remoteEvents:ov=[],rootEvents:lv=[],stateOwnersUpdateHandlers:dv=[]}])=>{v[F]||(v[F]={});let _e=j=>{let Ae=Ra(u,j);f({[F]:Ae})},re;re=v[F].mediaEvents,av.forEach(j=>{re&&ec&&(u.media.removeEventListener(j,re),v[F].mediaEvents=void 0),oc&&(b.media.addEventListener(j,_e),v[F].mediaEvents=_e)}),re=v[F].textTracksEvents,rv.forEach(j=>{var Ae,Pe;re&&tc&&((Ae=u.media.textTracks)==null||Ae.removeEventListener(j,re),v[F].textTracksEvents=void 0),lc&&((Pe=b.media.textTracks)==null||Pe.addEventListener(j,_e),v[F].textTracksEvents=_e)}),re=v[F].videoRenditionsEvents,nv.forEach(j=>{var Ae,Pe;re&&ic&&((Ae=u.media.videoRenditions)==null||Ae.removeEventListener(j,re),v[F].videoRenditionsEvents=void 0),dc&&((Pe=b.media.videoRenditions)==null||Pe.addEventListener(j,_e),v[F].videoRenditionsEvents=_e)}),re=v[F].audioTracksEvents,sv.forEach(j=>{var Ae,Pe;re&&ac&&((Ae=u.media.audioTracks)==null||Ae.removeEventListener(j,re),v[F].audioTracksEvents=void 0),uc&&((Pe=b.media.audioTracks)==null||Pe.addEventListener(j,_e),v[F].audioTracksEvents=_e)}),re=v[F].remoteEvents,ov.forEach(j=>{var Ae,Pe;re&&rc&&((Ae=u.media.remote)==null||Ae.removeEventListener(j,re),v[F].remoteEvents=void 0),cc&&((Pe=b.media.remote)==null||Pe.addEventListener(j,_e),v[F].remoteEvents=_e)}),re=v[F].rootEvents,lv.forEach(j=>{re&&nc&&(u.documentElement.removeEventListener(j,re),v[F].rootEvents=void 0),mc&&(b.documentElement.addEventListener(j,_e),v[F].rootEvents=_e)});let pc=v[F].stateOwnersUpdateHandlers;dv.forEach(j=>{pc&&sc&&pc(),hc&&(v[F].stateOwnersUpdateHandlers=j(_e,b))})}),Object.entries(b).forEach(([F,Ra])=>{u[F]=Ra}),E(),b=void 0};return w({media:i,fullscreenElement:e,documentElement:t,options:n}),{dispatch(_){let{type:T,detail:D}=_;if(r[T]){f(r[T](a,u,_));return}T==="mediaelementchangerequest"?w({media:D}):T==="fullscreenelementchangerequest"?w({fullscreenElement:D}):T==="documentelementchangerequest"?w({documentElement:D}):T==="optionschangerequest"&&Object.entries(D!=null?D:{}).forEach(([te,ge])=>{u.options[te]=ge})},getState(){return c},subscribe(_){return w({},d.length+1),d.push(_),_(c),()=>{let T=d.indexOf(_);T>=0&&(w({},d.length-1),d.splice(T,1))}}}},Zc=qv;var sl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},L=(i,e,t)=>(sl(i,e,"read from private field"),t?t.call(i):e.get(i)),St=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Bt=(i,e,t,a)=>(sl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Wt=(i,e,t)=>(sl(i,e,"access private method"),t),Ht,Wa,q,Ha,Je,dn,un,al,Fi,$a,cn,rl,jc=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],Qc=10,R={DEFAULT_SUBTITLES:"defaultsubtitles",DEFAULT_STREAM_TYPE:"defaultstreamtype",DEFAULT_DURATION:"defaultduration",FULLSCREEN_ELEMENT:"fullscreenelement",HOTKEYS:"hotkeys",KEYS_USED:"keysused",LIVE_EDGE_OFFSET:"liveedgeoffset",NO_AUTO_SEEK_TO_LIVE:"noautoseektolive",NO_HOTKEYS:"nohotkeys",NO_VOLUME_PREF:"novolumepref",NO_SUBTITLES_LANG_PREF:"nosubtitleslangpref",NO_DEFAULT_STORE:"nodefaultstore",KEYBOARD_FORWARD_SEEK_OFFSET:"keyboardforwardseekoffset",KEYBOARD_BACKWARD_SEEK_OFFSET:"keyboardbackwardseekoffset"},mn=class extends Na{constructor(){super(),St(this,un),St(this,Fi),St(this,cn),St(this,Ht,new Me(this,R.HOTKEYS)),St(this,Wa,void 0),St(this,q,void 0),St(this,Ha,void 0),St(this,Je,void 0),St(this,dn,t=>{var a;(a=L(this,q))==null||a.dispatch(t)}),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,this.associateElement(this);let e={};Bt(this,Ha,t=>{Object.entries(t).forEach(([a,r])=>{if(a in e&&e[a]===r)return;this.propagateMediaState(a,r);let n=a.toLowerCase(),o=new l.CustomEvent(gc[n],{composed:!0,detail:r});this.dispatchEvent(o)}),e=t}),this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(R.NO_HOTKEYS,R.HOTKEYS,R.DEFAULT_STREAM_TYPE,R.DEFAULT_SUBTITLES,R.DEFAULT_DURATION)}get mediaStore(){return L(this,q)}set mediaStore(e){var t,a;if(L(this,q)&&((t=L(this,Je))==null||t.call(this),Bt(this,Je,void 0)),Bt(this,q,e),!L(this,q)&&!this.hasAttribute(R.NO_DEFAULT_STORE)){Wt(this,un,al).call(this);return}Bt(this,Je,(a=L(this,q))==null?void 0:a.subscribe(L(this,Ha)))}get fullscreenElement(){var e;return(e=L(this,Wa))!=null?e:this}set fullscreenElement(e){var t;this.hasAttribute(R.FULLSCREEN_ELEMENT)&&this.removeAttribute(R.FULLSCREEN_ELEMENT),Bt(this,Wa,e),(t=L(this,q))==null||t.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}attributeChangedCallback(e,t,a){var r,n,o,d,u,c;if(super.attributeChangedCallback(e,t,a),e===R.NO_HOTKEYS)a!==t&&a===""?(this.hasAttribute(R.HOTKEYS)&&console.warn("Media Chrome: Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):a!==t&&a===null&&this.enableHotkeys();else if(e===R.HOTKEYS)L(this,Ht).value=a;else if(e===R.DEFAULT_SUBTITLES&&a!==t)(r=L(this,q))==null||r.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(R.DEFAULT_SUBTITLES)}});else if(e===R.DEFAULT_STREAM_TYPE)(o=L(this,q))==null||o.dispatch({type:"optionschangerequest",detail:{defaultStreamType:(n=this.getAttribute(R.DEFAULT_STREAM_TYPE))!=null?n:void 0}});else if(e===R.LIVE_EDGE_OFFSET)(d=L(this,q))==null||d.dispatch({type:"optionschangerequest",detail:{liveEdgeOffset:this.hasAttribute(R.LIVE_EDGE_OFFSET)?+this.getAttribute(R.LIVE_EDGE_OFFSET):void 0}});else if(e===R.FULLSCREEN_ELEMENT){let f=a?(u=this.getRootNode())==null?void 0:u.getElementById(a):void 0;Bt(this,Wa,f),(c=L(this,q))==null||c.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}}connectedCallback(){var e,t;!L(this,q)&&!this.hasAttribute(R.NO_DEFAULT_STORE)&&Wt(this,un,al).call(this),(e=L(this,q))==null||e.dispatch({type:"documentelementchangerequest",detail:m}),super.connectedCallback(),L(this,q)&&!L(this,Je)&&Bt(this,Je,(t=L(this,q))==null?void 0:t.subscribe(L(this,Ha))),this.enableHotkeys()}disconnectedCallback(){var e,t,a,r;(e=super.disconnectedCallback)==null||e.call(this),L(this,q)&&((t=L(this,q))==null||t.dispatch({type:"documentelementchangerequest",detail:void 0}),(a=L(this,q))==null||a.dispatch({type:h.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})),L(this,Je)&&((r=L(this,Je))==null||r.call(this),Bt(this,Je,void 0))}mediaSetCallback(e){var t;super.mediaSetCallback(e),(t=L(this,q))==null||t.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var t;super.mediaUnsetCallback(e),(t=L(this,q))==null||t.dispatch({type:"mediaelementchangerequest",detail:void 0})}propagateMediaState(e,t){Jc(this.mediaStateReceivers,e,t)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(t.has(e))return;let a=this.registerMediaStateReceiver.bind(this),r=this.unregisterMediaStateReceiver.bind(this),n=jv(e,a,r);Object.values(h).forEach(o=>{e.addEventListener(o,L(this,dn))}),t.set(e,n)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(!t.has(e))return;t.get(e)(),t.delete(e),Object.values(h).forEach(r=>{e.removeEventListener(r,L(this,dn))})}registerMediaStateReceiver(e){if(!e)return;let t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),L(this,q)&&Object.entries(L(this,q).getState()).forEach(([r,n])=>{Jc([e],r,n)}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,a=t.indexOf(e);a<0||t.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",Wt(this,cn,rl))}disableHotkeys(){this.removeEventListener("keydown",Wt(this,cn,rl)),this.removeEventListener("keyup",Wt(this,Fi,$a))}get hotkeys(){return L(this,Ht)}keyboardShortcutHandler(e){var t,a,r,n,o,d;if(((n=(r=(t=e.target.getAttribute(R.KEYS_USED))==null?void 0:t.split(" "))!=null?r:(a=e.target)==null?void 0:a.keysUsed)!=null?n:[]).map(v=>v==="Space"?" ":v).filter(Boolean).includes(e.key))return;let c,f,E;if(!L(this,Ht).contains(`no${e.key.toLowerCase()}`)&&!(e.key===" "&&L(this,Ht).contains("nospace")))switch(e.key){case" ":case"k":c=L(this,q).getState().mediaPaused?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new l.CustomEvent(c,{composed:!0,bubbles:!0}));break;case"m":c=this.mediaStore.getState().mediaVolumeLevel==="off"?h.MEDIA_UNMUTE_REQUEST:h.MEDIA_MUTE_REQUEST,this.dispatchEvent(new l.CustomEvent(c,{composed:!0,bubbles:!0}));break;case"f":c=this.mediaStore.getState().mediaIsFullscreen?h.MEDIA_EXIT_FULLSCREEN_REQUEST:h.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new l.CustomEvent(c,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new l.CustomEvent(h.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":{let v=this.hasAttribute(R.KEYBOARD_BACKWARD_SEEK_OFFSET)?+this.getAttribute(R.KEYBOARD_BACKWARD_SEEK_OFFSET):Qc;f=Math.max(((o=this.mediaStore.getState().mediaCurrentTime)!=null?o:0)-v,0),E=new l.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:f}),this.dispatchEvent(E);break}case"ArrowRight":{let v=this.hasAttribute(R.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(R.KEYBOARD_FORWARD_SEEK_OFFSET):Qc;f=Math.max(((d=this.mediaStore.getState().mediaCurrentTime)!=null?d:0)+v,0),E=new l.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:f}),this.dispatchEvent(E);break}default:break}}};Ht=new WeakMap;Wa=new WeakMap;q=new WeakMap;Ha=new WeakMap;Je=new WeakMap;dn=new WeakMap;un=new WeakSet;al=function(){var i;this.mediaStore=Zc({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(R.DEFAULT_SUBTITLES),defaultDuration:this.hasAttribute(R.DEFAULT_DURATION)?+this.getAttribute(R.DEFAULT_DURATION):void 0,defaultStreamType:(i=this.getAttribute(R.DEFAULT_STREAM_TYPE))!=null?i:void 0,liveEdgeOffset:this.hasAttribute(R.LIVE_EDGE_OFFSET)?+this.getAttribute(R.LIVE_EDGE_OFFSET):void 0,noVolumePref:this.hasAttribute(R.NO_VOLUME_PREF),noSubtitlesLangPref:this.hasAttribute(R.NO_SUBTITLES_LANG_PREF)}})};Fi=new WeakSet;$a=function(i){let{key:e}=i;if(!jc.includes(e)){this.removeEventListener("keyup",Wt(this,Fi,$a));return}this.keyboardShortcutHandler(i)};cn=new WeakSet;rl=function(i){let{metaKey:e,altKey:t,key:a}=i;if(e||t||!jc.includes(a)){this.removeEventListener("keyup",Wt(this,Fi,$a));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(L(this,Ht).contains(`no${a.toLowerCase()}`)||a===" "&&L(this,Ht).contains("nospace"))&&i.preventDefault(),this.addEventListener("keyup",Wt(this,Fi,$a),{once:!0})};var Zv=Object.values(s),Qv=Object.values(Wo),em=i=>{var e,t,a,r;let{observedAttributes:n}=i.constructor;!n&&((e=i.nodeName)!=null&&e.includes("-"))&&(l.customElements.upgrade(i),{observedAttributes:n}=i.constructor);let o=(r=(a=(t=i==null?void 0:i.getAttribute)==null?void 0:t.call(i,y.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(n||o)?(n||o).filter(d=>Zv.includes(d)):[]},zv=i=>{var e,t;return(e=i.nodeName)!=null&&e.includes("-")&&l.customElements.get((t=i.nodeName)==null?void 0:t.toLowerCase())&&!(i instanceof l.customElements.get(i.nodeName.toLowerCase()))&&l.customElements.upgrade(i),Qv.some(a=>a in i)},nl=i=>zv(i)||!!em(i).length,zc=i=>{var e;return(e=i==null?void 0:i.join)==null?void 0:e.call(i,":")},Xc={[s.MEDIA_SUBTITLES_LIST]:He,[s.MEDIA_SUBTITLES_SHOWING]:He,[s.MEDIA_SEEKABLE]:zc,[s.MEDIA_BUFFERED]:i=>i==null?void 0:i.map(zc).join(" "),[s.MEDIA_PREVIEW_COORDS]:i=>i==null?void 0:i.join(" "),[s.MEDIA_RENDITION_LIST]:Ac,[s.MEDIA_AUDIO_TRACK_LIST]:yc},Xv=async(i,e,t)=>{var a,r;if(i.isConnected||await Kr(0),typeof t=="boolean"||t==null)return B(i,e,t);if(typeof t=="number")return U(i,e,t);if(typeof t=="string")return k(i,e,t);if(Array.isArray(t)&&!t.length)return i.removeAttribute(e);let n=(r=(a=Xc[e])==null?void 0:a.call(Xc,t))!=null?r:t;return i.setAttribute(e,n)},Jv=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},ci=(i,e)=>{if(Jv(i))return;let t=(r,n)=>{var o,d;nl(r)&&n(r);let{children:u=[]}=r!=null?r:{},c=(d=(o=r==null?void 0:r.shadowRoot)==null?void 0:o.children)!=null?d:[];[...u,...c].forEach(E=>ci(E,n))},a=i==null?void 0:i.nodeName.toLowerCase();if(a.includes("-")&&!nl(i)){l.customElements.whenDefined(a).then(()=>{t(i,e)});return}t(i,e)},Jc=(i,e,t)=>{i.forEach(a=>{if(e in a){a[e]=t;return}let r=em(a),n=e.toLowerCase();r.includes(n)&&Xv(a,n,t)})},jv=(i,e,t)=>{ci(i,e);let a=f=>{var E;let v=(E=f==null?void 0:f.composedPath()[0])!=null?E:f.target;e(v)},r=f=>{var E;let v=(E=f==null?void 0:f.composedPath()[0])!=null?E:f.target;t(v)};i.addEventListener(h.REGISTER_MEDIA_STATE_RECEIVER,a),i.addEventListener(h.UNREGISTER_MEDIA_STATE_RECEIVER,r);let n=f=>{f.forEach(E=>{let{addedNodes:v=[],removedNodes:b=[],type:w,target:_,attributeName:T}=E;w==="childList"?(Array.prototype.forEach.call(v,D=>ci(D,e)),Array.prototype.forEach.call(b,D=>ci(D,t))):w==="attributes"&&T===y.MEDIA_CHROME_ATTRIBUTES&&(nl(_)?e(_):t(_))})},o=[],d=f=>{let E=f.target;E.name!=="media"&&(o.forEach(v=>ci(v,t)),o=[...E.assignedElements({flatten:!0})],o.forEach(v=>ci(v,e)))};i.addEventListener("slotchange",d);let u=new MutationObserver(n);return u.observe(i,{childList:!0,attributes:!0,subtree:!0}),()=>{ci(i,t),i.removeEventListener("slotchange",d),u.disconnect(),i.removeEventListener(h.REGISTER_MEDIA_STATE_RECEIVER,a),i.removeEventListener(h.UNREGISTER_MEDIA_STATE_RECEIVER,r)}};l.customElements.get("media-controller")||l.customElements.define("media-controller",mn);var ol=mn;var ef=Object.defineProperty,tf=(i,e,t)=>e in i?ef(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,af=(i,e,t)=>(tf(i,typeof e!="symbol"?e+"":e,t),t),tm=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},we=(i,e,t)=>(tm(i,e,"read from private field"),t?t.call(i):e.get(i)),hn=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},pn=(i,e,t,a)=>(tm(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),je,vn,Vi,fn,im=m.createElement("template");im.innerHTML=`
145
+ `;var Pv=Object.values(s),Nv="sm:384 md:576 lg:768 xl:960";function Uv(i){Bv(i.target,i.contentRect.width)}function Bv(i,e){var t;if(!i.isConnected)return;let a=(t=i.getAttribute(M.BREAKPOINTS))!=null?t:Nv,r=Wv(a),n=Hv(r,e),o=!1;if(Object.keys(r).forEach(d=>{if(n.includes(d)){i.hasAttribute(`breakpoint${d}`)||(i.setAttribute(`breakpoint${d}`,""),o=!0);return}i.hasAttribute(`breakpoint${d}`)&&(i.removeAttribute(`breakpoint${d}`),o=!0)}),o){let d=new CustomEvent(Tt.BREAKPOINTS_CHANGE,{detail:n});i.dispatchEvent(d)}}function Wv(i){let e=i.split(/\s+/);return Object.fromEntries(e.map(t=>t.split(":")))}function Hv(i,e){return Object.keys(i).filter(t=>e>=i[t])}var Na=class extends l.HTMLElement{constructor(){super(),oi(this,Zo),oi(this,Qo),oi(this,Oa),oi(this,en),oi(this,Bi),oi(this,Jr,0),oi(this,Ui,void 0),Ov(this,"breakpointsComputed",!1),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Uc.content.cloneNode(!0)));let e=o=>{let d=this.media;for(let u of o)u.type==="childList"&&(u.removedNodes.forEach(c=>{if(c.slot=="media"&&u.target==this){let f=u.previousSibling&&u.previousSibling.previousElementSibling;if(!f||!d)this.mediaUnsetCallback(c);else{let g=f.slot!=="media";for(;(f=f.previousSibling)!==null;)f.slot=="media"&&(g=!1);g&&this.mediaUnsetCallback(c)}}}),d&&u.addedNodes.forEach(c=>{c===d&&this.handleMediaUpdated(d)}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0});let a=!1;Me(this,o=>{a||(setTimeout(()=>{Uv(o),a=!1,this.breakpointsComputed||(this.breakpointsComputed=!0,this.dispatchEvent(new CustomEvent(Tt.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))},0),a=!0)});let n=this.querySelector(":scope > slot[slot=media]");n&&n.addEventListener("slotchange",()=>{if(!n.assignedElements({flatten:!0}).length){qo(this,Ui)&&this.mediaUnsetCallback(qo(this,Ui));return}this.handleMediaUpdated(this.media)})}static get observedAttributes(){return[M.AUTOHIDE,M.GESTURES_DISABLED].concat(Pv).filter(e=>![s.MEDIA_RENDITION_LIST,s.MEDIA_AUDIO_TRACK_LIST,s.MEDIA_CHAPTERS_CUES].includes(e))}attributeChangedCallback(e,t,a){e.toLowerCase()==M.AUTOHIDE&&(this.autohide=a)}get media(){let e=this.querySelector(":scope > [slot=media]");return(e==null?void 0:e.nodeName)=="SLOT"&&(e=e.assignedElements({flatten:!0})[0]),e}async handleMediaUpdated(e){e&&(Go(this,Ui,e),e.localName.includes("-")&&await l.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;let a=this.getAttribute(M.AUDIO)!=null?K.AUDIO_PLAYER():K.VIDEO_PLAYER();this.setAttribute("role","region"),this.setAttribute("aria-label",a),this.handleMediaUpdated(this.media),this.setAttribute(M.USER_INACTIVE,""),this.addEventListener("pointerdown",this),this.addEventListener("pointermove",this),this.addEventListener("pointerup",this),this.addEventListener("mouseleave",this),this.addEventListener("keyup",this),(e=l.window)==null||e.addEventListener("mouseup",this)}disconnectedCallback(){var e;this.media&&this.mediaUnsetCallback(this.media),(e=l.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){Go(this,Ui,null)}handleEvent(e){switch(e.type){case"pointerdown":Go(this,Jr,e.timeStamp);break;case"pointermove":He(this,Zo,Pc).call(this,e);break;case"pointerup":He(this,Qo,Nc).call(this,e);break;case"mouseleave":He(this,Oa,jr).call(this);break;case"mouseup":this.removeAttribute(M.KEYBOARD_CONTROL);break;case"keyup":He(this,Bi,Pa).call(this),this.setAttribute(M.KEYBOARD_CONTROL,"");break}}set autohide(e){e=Number(e),this._autohide=isNaN(e)?0:e}get autohide(){return this._autohide===void 0?2:this._autohide}};Jr=new WeakMap;Ui=new WeakMap;Zo=new WeakSet;Pc=function(i){i.pointerType!=="mouse"&&i.timeStamp-qo(this,Jr)<250||(He(this,en,Xo).call(this),clearTimeout(this._inactiveTimeout),[this,this.media].includes(i.target)&&He(this,Bi,Pa).call(this))};Qo=new WeakSet;Nc=function(i){if(i.pointerType==="touch"){let e=!this.hasAttribute(M.USER_INACTIVE);[this,this.media].includes(i.target)&&e?He(this,Oa,jr).call(this):He(this,Bi,Pa).call(this)}else i.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&He(this,Bi,Pa).call(this)};Oa=new WeakSet;jr=function(){if(this.autohide<0||this.hasAttribute(M.USER_INACTIVE))return;this.setAttribute(M.USER_INACTIVE,"");let i=new l.CustomEvent(Tt.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(i)};en=new WeakSet;Xo=function(){if(!this.hasAttribute(M.USER_INACTIVE))return;this.removeAttribute(M.USER_INACTIVE);let i=new l.CustomEvent(Tt.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(i)};Bi=new WeakSet;Pa=function(){He(this,en,Xo).call(this),clearTimeout(this._inactiveTimeout),!(this.autohide<0)&&(this._inactiveTimeout=setTimeout(()=>{He(this,Oa,jr).call(this)},this.autohide*1e3))};l.customElements.get("media-container")||l.customElements.define("media-container",Na);var Bc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ne=(i,e,t)=>(Bc(i,e,"read from private field"),t?t.call(i):e.get(i)),Ua=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},tn=(i,e,t,a)=>(Bc(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Wi,Hi,an,li,kt,Ut,we=class{constructor(e,t,{defaultValue:a}={defaultValue:void 0}){Ua(this,kt),Ua(this,Wi,void 0),Ua(this,Hi,void 0),Ua(this,an,void 0),Ua(this,li,new Set),tn(this,Wi,e),tn(this,Hi,t),tn(this,an,new Set(a))}[Symbol.iterator](){return ne(this,kt,Ut).values()}get length(){return ne(this,kt,Ut).size}get value(){var e;return(e=[...ne(this,kt,Ut)].join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(tn(this,li,new Set),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return[...ne(this,kt,Ut)][e]}values(){return ne(this,kt,Ut).values()}forEach(e){ne(this,kt,Ut).forEach(e)}add(...e){var t,a;e.forEach(r=>ne(this,li).add(r)),!(this.value===""&&!((t=ne(this,Wi))!=null&&t.hasAttribute(`${ne(this,Hi)}`)))&&((a=ne(this,Wi))==null||a.setAttribute(`${ne(this,Hi)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>ne(this,li).delete(a)),(t=ne(this,Wi))==null||t.setAttribute(`${ne(this,Hi)}`,`${this.value}`)}contains(e){return ne(this,kt,Ut).has(e)}toggle(e,t){return typeof t!="undefined"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){return this.remove(e),this.add(t),e===t}};Wi=new WeakMap;Hi=new WeakMap;an=new WeakMap;li=new WeakMap;kt=new WeakSet;Ut=function(){return ne(this,li).size?ne(this,li):ne(this,an)};var $v=(i="")=>i.split(/\s+/),Wc=(i="")=>{let[e,t,a]=i.split(":"),r=a?decodeURIComponent(a):void 0;return e=e==="cc"?"captions":"subtitles",{kind:e,language:t,label:r}},St=(i="",e={})=>$v(i).map(t=>{let a=Wc(t);return{...e,...a}}),Jo=i=>i?Array.isArray(i)?i.map(e=>typeof e=="string"?Wc(e):e):typeof i=="string"?St(i):[i]:[],di=({kind:i,label:e,language:t}={kind:"subtitles"})=>e?`${i==="captions"?"cc":"sb"}:${t}:${encodeURIComponent(e)}`:t,$e=(i=[])=>Array.prototype.map.call(i,di).join(" "),Fv=(i,e)=>t=>t[i]===e,Hc=i=>{let e=Object.entries(i).map(([t,a])=>Fv(t,a));return t=>e.every(a=>a(t))},ui=(i,e=[],t=[])=>{let a=Jo(t).map(Hc),r=n=>a.some(o=>o(n));Array.from(e).filter(r).forEach(n=>{n.mode=i})},ci=(i,e=()=>!0)=>{if(!(i!=null&&i.textTracks))return[];let t=typeof e=="function"?e:Hc(e);return Array.from(i.textTracks).filter(t)},rn=i=>{var e;return!!((e=i.mediaSubtitlesShowing)!=null&&e.length)||i.hasAttribute(s.MEDIA_SUBTITLES_SHOWING)};var G={enter:"requestFullscreen",exit:"exitFullscreen",rootEvents:["fullscreenchange"],mediaEvents:[],element:"fullscreenElement",error:"fullscreenerror",enabled:"fullscreenEnabled"};m.fullscreenElement===void 0&&(G.enter="webkitRequestFullScreen",G.exit=m.webkitExitFullscreen!=null?"webkitExitFullscreen":"webkitCancelFullScreen",G.rootEvents=["webkitfullscreenchange"],G.mediaEvents=["webkitbeginfullscreen","webkitendfullscreen"],G.element="webkitFullscreenElement",G.error="webkitfullscreenerror",G.enabled="webkitFullscreenEnabled");var nn,jo=()=>{var i,e;return nn||(nn=(e=(i=m)==null?void 0:i.createElement)==null?void 0:e.call(i,"video"),nn)},$c=async(i=jo())=>{if(!i)return!1;let e=i.volume;return i.volume=e/2+.1,await Kr(0),i.volume!==e},Vv=/.*Version\/.*Safari\/.*/.test(l.navigator.userAgent),el=(i=jo())=>l.matchMedia("(display-mode: standalone)").matches&&Vv?!1:typeof(i==null?void 0:i.requestPictureInPicture)=="function",tl=(i=jo())=>{let e=m[G.enabled];return!e&&i&&(e="webkitSupportsFullscreen"in i),e},Fc=tl(),Vc=el(),Kc=!!l.WebKitPlaybackTargetAvailabilityEvent,Yc=!!l.chrome;var $i=i=>ci(i.media,e=>[Ue.SUBTITLES,Ue.CAPTIONS].includes(e.kind)).sort((e,t)=>e.kind>=t.kind?1:-1),il=i=>ci(i.media,e=>e.mode===Pt.SHOWING&&[Ue.SUBTITLES,Ue.CAPTIONS].includes(e.kind)),sn=(i,e)=>{let t=$i(i),a=il(i),r=!!a.length;if(t.length){if(e===!1||r&&e!==!0)ui(Pt.DISABLED,t,a);else if(e===!0||!r&&e!==!1){let n=t[0],{options:o}=i;if(!(o!=null&&o.noSubtitlesLangPref)){let f=globalThis.localStorage.getItem("media-chrome-pref-subtitles-lang"),g=f?[f,...globalThis.navigator.languages]:globalThis.navigator.languages,v=t.filter(b=>g.some(w=>b.language.toLowerCase().startsWith(w.split("-")[0]))).sort((b,w)=>{let A=g.findIndex(D=>b.language.toLowerCase().startsWith(D.split("-")[0])),T=g.findIndex(D=>w.language.toLowerCase().startsWith(D.split("-")[0]));return A-T});v[0]&&(n=v[0])}let{language:d,label:u,kind:c}=n;ui(Pt.DISABLED,t,a),ui(Pt.SHOWING,t,[{language:d,label:u,kind:c}])}}},on=(i,e)=>i===e?!0:typeof i!=typeof e?!1:typeof i=="number"&&Number.isNaN(i)&&Number.isNaN(e)?!0:typeof i!="object"?!1:Array.isArray(i)?Kv(i,e):Object.entries(i).every(([t,a])=>t in e&&on(a,e[t])),Kv=(i,e)=>{let t=Array.isArray(i),a=Array.isArray(e);return t!==a?!1:t||a?i.length!==e.length?!1:i.every((r,n)=>on(r,e[n])):!0};var Yv=Object.values(Be),ln,Gv=$c().then(i=>(ln=i,ln)),Gc=async(...i)=>{await Promise.all(i.filter(e=>e).map(async e=>{if(!("localName"in e&&e instanceof l.HTMLElement))return;let t=e.localName;if(!t.includes("-"))return;let a=l.customElements.get(t);a&&e instanceof a||(await l.customElements.whenDefined(t),l.customElements.upgrade(e))}))},Ba={mediaPaused:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.paused)!=null?e:!0},set(i,e){var t;let{media:a}=e;a&&(i?a.pause():(t=a.play())==null||t.catch(()=>{}))},mediaEvents:["play","playing","pause","emptied"]},mediaHasPlayed:{get(i,e){let{media:t}=i;return t?e?e.type==="playing":!t.paused:!1},mediaEvents:["playing","emptied"]},mediaEnded:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.ended)!=null?e:!1},mediaEvents:["seeked","ended","emptied"]},mediaPlaybackRate:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.playbackRate)!=null?e:1},set(i,e){let{media:t}=e;t&&Number.isFinite(+i)&&(t.playbackRate=+i)},mediaEvents:["ratechange","loadstart"]},mediaMuted:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.muted)!=null?e:!1},set(i,e){let{media:t}=e;t&&(t.muted=i)},mediaEvents:["volumechange"]},mediaVolume:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.volume)!=null?e:1},set(i,e){let{media:t}=e;if(t){try{i==null?l.localStorage.removeItem("media-chrome-pref-volume"):l.localStorage.setItem("media-chrome-pref-volume",i.toString())}catch{}Number.isFinite(+i)&&(t.volume=+i)}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(i,e)=>{let{options:{noVolumePref:t}}=e;if(!t)try{let a=l.localStorage.getItem("media-chrome-pref-volume");if(a==null)return;Ba.mediaVolume.set(+a,e),i(a)}catch(a){console.debug("Error getting volume pref",a)}}]},mediaVolumeLevel:{get(i){let{media:e}=i;return typeof(e==null?void 0:e.volume)=="undefined"?"high":e.muted||e.volume===0?"off":e.volume<.5?"low":e.volume<.75?"medium":"high"},mediaEvents:["volumechange"]},mediaCurrentTime:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.currentTime)!=null?e:0},set(i,e){let{media:t}=e;!t||t.readyState===0||(t.currentTime=i)},mediaEvents:["timeupdate","loadedmetadata"]},mediaDuration:{get(i){let{media:e,options:{defaultDuration:t}={}}=i;return t&&(!e||!e.duration||Number.isNaN(e.duration)||!Number.isFinite(e.duration))?t:Number.isFinite(e==null?void 0:e.duration)?e.duration:Number.NaN},mediaEvents:["durationchange","loadedmetadata","emptied"]},mediaLoading:{get(i){let{media:e}=i;return(e==null?void 0:e.readyState)<3},mediaEvents:["waiting","playing","emptied"]},mediaSeekable:{get(i){var e;let{media:t}=i;if(!((e=t==null?void 0:t.seekable)!=null&&e.length))return;let a=t.seekable.start(0),r=t.seekable.end(t.seekable.length-1);if(!(!a&&!r))return[Number(a.toFixed(3)),Number(r.toFixed(3))]},mediaEvents:["loadedmetadata","emptied","progress","seekablechange"]},mediaBuffered:{get(i){var e;let{media:t}=i,a=(e=t==null?void 0:t.buffered)!=null?e:[];return Array.from(a).map((r,n)=>[Number(a.start(n).toFixed(3)),Number(a.end(n).toFixed(3))])},mediaEvents:["progress","emptied"]},mediaStreamType:{get(i){let{media:e,options:{defaultStreamType:t}={}}=i,a=[Be.LIVE,Be.ON_DEMAND].includes(t)?t:void 0;if(!e)return a;let{streamType:r}=e;if(Yv.includes(r))return r===Be.UNKNOWN?a:r;let n=e.duration;return n===1/0?Be.LIVE:Number.isFinite(n)?Be.ON_DEMAND:a},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange"]},mediaTargetLiveWindow:{get(i){let{media:e}=i;if(!e)return Number.NaN;let{targetLiveWindow:t}=e,a=Ba.mediaStreamType.get(i);return(t==null||Number.isNaN(t))&&a===Be.LIVE?0:t},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange","targetlivewindowchange"]},mediaTimeIsLive:{get(i){let{media:e,options:{liveEdgeOffset:t=10}={}}=i;if(!e)return!1;if(typeof e.liveEdgeStart=="number")return Number.isNaN(e.liveEdgeStart)?!1:e.currentTime>=e.liveEdgeStart;if(!(Ba.mediaStreamType.get(i)===Be.LIVE))return!1;let r=e.seekable;if(!r)return!0;if(!r.length)return!1;let n=r.end(r.length-1)-t;return e.currentTime>=n},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},mediaSubtitlesList:{get(i){return $i(i).map(({kind:e,label:t,language:a})=>({kind:e,label:t,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},mediaSubtitlesShowing:{get(i){return il(i).map(({kind:e,label:t,language:a})=>({kind:e,label:t,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(i,e)=>{var t,a;let{media:r,options:n}=e;if(!r)return;let o=d=>{var u;!n.defaultSubtitles||d&&![Ue.CAPTIONS,Ue.SUBTITLES].includes((u=d==null?void 0:d.track)==null?void 0:u.kind)||sn(e,!0)};return(t=r.textTracks)==null||t.addEventListener("addtrack",o),(a=r.textTracks)==null||a.addEventListener("removetrack",o),o(),()=>{var d,u;(d=r.textTracks)==null||d.removeEventListener("addtrack",o),(u=r.textTracks)==null||u.removeEventListener("removetrack",o)}}]},mediaChaptersCues:{get(i){var e;let{media:t}=i;if(!t)return[];let[a]=ci(t,{kind:Ue.CHAPTERS});return Array.from((e=a==null?void 0:a.cues)!=null?e:[]).map(({text:r,startTime:n,endTime:o})=>({text:r,startTime:n,endTime:o}))},mediaEvents:["loadstart","loadedmetadata"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(i,e)=>{let{media:t}=e;if(!t)return;let a=t.querySelector('track[kind="chapters"][default][src]');return a==null||a.addEventListener("load",i),()=>{a==null||a.removeEventListener("load",i)}}]},mediaIsPip:{get(i){var e,t;let{media:a,documentElement:r}=i;if(!a||!r||!r.pictureInPictureElement)return!1;if(r.pictureInPictureElement===a)return!0;if(r.pictureInPictureElement instanceof HTMLMediaElement)return(e=a.localName)!=null&&e.includes("-")?ue(a,r.pictureInPictureElement):!1;if(r.pictureInPictureElement.localName.includes("-")){let n=r.pictureInPictureElement.shadowRoot;for(;n!=null&&n.pictureInPictureElement;){if(n.pictureInPictureElement===a)return!0;n=(t=n.pictureInPictureElement)==null?void 0:t.shadowRoot}}return!1},set(i,e){let{media:t}=e;if(t)if(i){if(!m.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!t.requestPictureInPicture){console.warn("MediaChrome: The current media does not support picture-in-picture");return}let a=()=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};t.requestPictureInPicture().catch(r=>{if(r.code===11){if(!t.src){console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a src set.");return}if(t.readyState===0&&t.preload==="none"){let n=()=>{t.removeEventListener("loadedmetadata",o),t.preload="none"},o=()=>{t.requestPictureInPicture().catch(a),n()};t.addEventListener("loadedmetadata",o),t.preload="metadata",setTimeout(()=>{t.readyState===0&&a(),n()},1e3)}else throw r}else throw r})}else m.pictureInPictureElement&&m.exitPictureInPicture()},mediaEvents:["enterpictureinpicture","leavepictureinpicture"]},mediaRenditionList:{get(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.videoRenditions)!=null?e:[]].map(a=>({...a}))},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaRenditionSelected:{get(i){var e,t,a;let{media:r}=i;return(a=(t=r==null?void 0:r.videoRenditions)==null?void 0:t[(e=r.videoRenditions)==null?void 0:e.selectedIndex])==null?void 0:a.id},set(i,e){let{media:t}=e;if(!(t!=null&&t.videoRenditions)){console.warn("MediaController: Rendition selection not supported by this media.");return}let a=i,r=Array.prototype.findIndex.call(t.videoRenditions,n=>n.id==a);t.videoRenditions.selectedIndex!=r&&(t.videoRenditions.selectedIndex=r)},mediaEvents:["emptied"],videoRenditionsEvents:["addrendition","removerendition","change"]},mediaAudioTrackList:{get(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.audioTracks)!=null?e:[]]},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaAudioTrackEnabled:{get(i){var e,t;let{media:a}=i;return(t=[...(e=a==null?void 0:a.audioTracks)!=null?e:[]].find(r=>r.enabled))==null?void 0:t.id},set(i,e){let{media:t}=e;if(!(t!=null&&t.audioTracks)){console.warn("MediaChrome: Audio track selection not supported by this media.");return}let a=i;for(let r of t.audioTracks)r.enabled=a==r.id},mediaEvents:["emptied"],audioTracksEvents:["addtrack","removetrack","change"]},mediaIsFullscreen:{get(i){var e;let{media:t,documentElement:a,fullscreenElement:r=t}=i;if(!t||!a)return!1;if(!a[G.element])return"webkitDisplayingFullscreen"in t&&"webkitPresentationMode"in t?t.webkitDisplayingFullscreen&&t.webkitPresentationMode===_c.FULLSCREEN:!1;if(a[G.element]===r)return!0;if(a[G.element].localName.includes("-")){let n=a[G.element].shadowRoot;if(!(G.element in n))return ue(a[G.element],r);for(;n!=null&&n[G.element];){if(n[G.element]===r)return!0;n=(e=n[G.element])==null?void 0:e.shadowRoot}}return!1},set(i,e){var t,a;let{media:r,fullscreenElement:n,documentElement:o}=e;if(!i&&(o!=null&&o[G.exit])){let d=(t=o==null?void 0:o[G.exit])==null?void 0:t.call(o);d instanceof Promise&&d.catch(()=>{});return}if(n!=null&&n[G.enter]){let d=(a=n[G.enter])==null?void 0:a.call(n);d instanceof Promise&&d.catch(()=>{})}else r!=null&&r.webkitEnterFullscreen?r.webkitEnterFullscreen():r!=null&&r.requestFullscreen&&r.requestFullscreen()},rootEvents:G.rootEvents,mediaEvents:G.mediaEvents},mediaIsCasting:{get(i){var e;let{media:t}=i;return!(t!=null&&t.remote)||((e=t.remote)==null?void 0:e.state)==="disconnected"?!1:!!t.remote.state},set(i,e){var t,a;let{media:r}=e;if(r&&!(i&&((t=r.remote)==null?void 0:t.state)!=="disconnected")&&!(!i&&((a=r.remote)==null?void 0:a.state)!=="connected")){if(typeof r.remote.prompt!="function"){console.warn("MediaChrome: Casting is not supported in this environment");return}r.remote.prompt().catch(()=>{})}},remoteEvents:["connect","connecting","disconnect"]},mediaIsAirplaying:{get(){return!1},set(i,e){let{media:t}=e;if(t){if(!(t.webkitShowPlaybackTargetPicker&&l.WebKitPlaybackTargetAvailabilityEvent)){console.warn("MediaChrome: received a request to select AirPlay but AirPlay is not supported in this environment");return}t.webkitShowPlaybackTargetPicker()}},mediaEvents:["webkitcurrentplaybacktargetiswirelesschanged"]},mediaFullscreenUnavailable:{get(i){let{media:e}=i;if(!Fc||!tl(e))return Te.UNSUPPORTED}},mediaPipUnavailable:{get(i){let{media:e}=i;if(!Vc||!el(e))return Te.UNSUPPORTED}},mediaVolumeUnavailable:{get(i){let{media:e}=i;if(ln===!1||(e==null?void 0:e.volume)==null)return Te.UNSUPPORTED},stateOwnersUpdateHandlers:[i=>{ln==null&&Gv.then(e=>i(e?void 0:Te.UNSUPPORTED))}]},mediaCastUnavailable:{get(i,{availability:e="not-available"}={}){var t;let{media:a}=i;if(!Yc||!((t=a==null?void 0:a.remote)!=null&&t.state))return Te.UNSUPPORTED;if(!(e==null||e==="available"))return Te.UNAVAILABLE},stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:a}=e;return a?(a.disableRemotePlayback||a.hasAttribute("disableremoteplayback")||(t=a==null?void 0:a.remote)==null||t.watchAvailability(n=>{i({availability:n?"available":"not-available"})}).catch(n=>{n.name==="NotSupportedError"?i({availability:null}):i({availability:"not-available"})}),()=>{var n;(n=a==null?void 0:a.remote)==null||n.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaAirplayUnavailable:{get(i,e){if(!Kc)return Te.UNSUPPORTED;if((e==null?void 0:e.availability)==="not-available")return Te.UNAVAILABLE},mediaEvents:["webkitplaybacktargetavailabilitychanged"],stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:a}=e;return a?(a.disableRemotePlayback||a.hasAttribute("disableremoteplayback")||(t=a==null?void 0:a.remote)==null||t.watchAvailability(n=>{i({availability:n?"available":"not-available"})}).catch(n=>{n.name==="NotSupportedError"?i({availability:null}):i({availability:"not-available"})}),()=>{var n;(n=a==null?void 0:a.remote)==null||n.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaRenditionUnavailable:{get(i){var e;let{media:t}=i;if(!(t!=null&&t.videoRenditions))return Te.UNSUPPORTED;if(!((e=t.videoRenditions)!=null&&e.length))return Te.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaAudioTrackUnavailable:{get(i){var e,t;let{media:a}=i;if(!(a!=null&&a.audioTracks))return Te.UNSUPPORTED;if(((t=(e=a.audioTracks)==null?void 0:e.length)!=null?t:0)<=1)return Te.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]}};var qc={[h.MEDIA_PREVIEW_REQUEST](i,e,{detail:t}){var a,r,n;let{media:o}=e,d=t!=null?t:void 0,u,c;if(o&&d!=null){let[b]=ci(o,{kind:Ue.METADATA,label:"thumbnails"}),w=Array.prototype.find.call((a=b==null?void 0:b.cues)!=null?a:[],(A,T,D)=>T===0?A.endTime>d:T===D.length-1?A.startTime<=d:A.startTime<=d&&A.endTime>d);if(w){let A=/'^(?:[a-z]+:)?\/\//i.test(w.text)||(r=o==null?void 0:o.querySelector('track[label="thumbnails"]'))==null?void 0:r.src,T=new URL(w.text,A);c=new URLSearchParams(T.hash).get("#xywh").split(",").map(ie=>+ie),u=T.href}}let f=i.mediaDuration.get(e),v=(n=i.mediaChaptersCues.get(e).find((b,w,A)=>w===A.length-1&&f===b.endTime?b.startTime<=d&&b.endTime>=d:b.startTime<=d&&b.endTime>d))==null?void 0:n.text;return t!=null&&v==null&&(v=""),{mediaPreviewTime:d,mediaPreviewImage:u,mediaPreviewCoords:c,mediaPreviewChapter:v}},[h.MEDIA_PAUSE_REQUEST](i,e){i["mediaPaused"].set(!0,e)},[h.MEDIA_PLAY_REQUEST](i,e){var t;let a="mediaPaused";if(i.mediaStreamType.get(e)===Be.LIVE){let o=!(i.mediaTargetLiveWindow.get(e)>0),d=(t=i.mediaSeekable.get(e))==null?void 0:t[1];o&&d&&i.mediaCurrentTime.set(d,e)}i[a].set(!1,e)},[h.MEDIA_PLAYBACK_RATE_REQUEST](i,e,{detail:t}){let a="mediaPlaybackRate",r=t;i[a].set(r,e)},[h.MEDIA_MUTE_REQUEST](i,e){i["mediaMuted"].set(!0,e)},[h.MEDIA_UNMUTE_REQUEST](i,e){let t="mediaMuted";i.mediaVolume.get(e)||i.mediaVolume.set(.25,e),i[t].set(!1,e)},[h.MEDIA_VOLUME_REQUEST](i,e,{detail:t}){let a="mediaVolume",r=t;r&&i.mediaMuted.get(e)&&i.mediaMuted.set(!1,e),i[a].set(r,e)},[h.MEDIA_SEEK_REQUEST](i,e,{detail:t}){let a="mediaCurrentTime",r=t;i[a].set(r,e)},[h.MEDIA_SEEK_TO_LIVE_REQUEST](i,e){var t;let a="mediaCurrentTime",r=(t=i.mediaSeekable.get(e))==null?void 0:t[1];Number.isNaN(Number(r))&&i[a].set(r,e)},[h.MEDIA_SHOW_SUBTITLES_REQUEST](i,e,{detail:t}){var a;let{options:r}=e,n=$i(e),o=Jo(t),d=(a=o[0])==null?void 0:a.language;d&&!r.noSubtitlesLangPref&&l.localStorage.setItem("media-chrome-pref-subtitles-lang",d),ui(Pt.SHOWING,n,o)},[h.MEDIA_DISABLE_SUBTITLES_REQUEST](i,e,{detail:t}){let a=$i(e),r=t!=null?t:[];ui(Pt.DISABLED,a,r)},[h.MEDIA_TOGGLE_SUBTITLES_REQUEST](i,e,{detail:t}){sn(e,t)},[h.MEDIA_RENDITION_REQUEST](i,e,{detail:t}){let a="mediaRenditionSelected",r=t;i[a].set(r,e)},[h.MEDIA_AUDIO_TRACK_REQUEST](i,e,{detail:t}){let a="mediaAudioTrackEnabled",r=t;i[a].set(r,e)},[h.MEDIA_ENTER_PIP_REQUEST](i,e){let t="mediaIsPip";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[h.MEDIA_EXIT_PIP_REQUEST](i,e){i["mediaIsPip"].set(!1,e)},[h.MEDIA_ENTER_FULLSCREEN_REQUEST](i,e){let t="mediaIsFullscreen";i.mediaIsPip.get(e)&&i.mediaIsPip.set(!1,e),i[t].set(!0,e)},[h.MEDIA_EXIT_FULLSCREEN_REQUEST](i,e){i["mediaIsFullscreen"].set(!1,e)},[h.MEDIA_ENTER_CAST_REQUEST](i,e){let t="mediaIsCasting";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[h.MEDIA_EXIT_CAST_REQUEST](i,e){i["mediaIsCasting"].set(!1,e)},[h.MEDIA_AIRPLAY_REQUEST](i,e){i["mediaIsAirplaying"].set(!0,e)}};var qv=({media:i,fullscreenElement:e,documentElement:t,stateMediator:a=Ba,requestMap:r=qc,options:n={},monitorStateOwnersOnlyWithSubscriptions:o=!0})=>{let d=[],u={options:{...n}},c=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0}),f=A=>{A!=null&&(on(A,c)||(c=Object.freeze({...c,...A}),d.forEach(T=>T(c))))},g=()=>{let A=Object.entries(a).reduce((T,[D,{get:ie}])=>(T[D]=ie(u),T),{});f(A)},v={},b,w=async(A,T)=>{var D,ie,ge,Ot,At,Ea,ga,_a,Aa,ya,Ta,ka,Sa,Ia,Ca,La;let Wr=!!b;if(b={...u,...b!=null?b:{},...A},Wr)return;await Gc(...Object.values(A));let yt=d.length>0&&T===0&&o,Ma=u.media!==b.media,wa=((D=u.media)==null?void 0:D.textTracks)!==((ie=b.media)==null?void 0:ie.textTracks),zu=((ge=u.media)==null?void 0:ge.videoRenditions)!==((Ot=b.media)==null?void 0:Ot.videoRenditions),Xu=((At=u.media)==null?void 0:At.audioTracks)!==((Ea=b.media)==null?void 0:Ea.audioTracks),Ju=((ga=u.media)==null?void 0:ga.remote)!==((_a=b.media)==null?void 0:_a.remote),ju=u.documentElement!==b.documentElement,ec=!!u.media&&(Ma||yt),tc=!!((Aa=u.media)!=null&&Aa.textTracks)&&(wa||yt),ic=!!((ya=u.media)!=null&&ya.videoRenditions)&&(zu||yt),ac=!!((Ta=u.media)!=null&&Ta.audioTracks)&&(Xu||yt),rc=!!((ka=u.media)!=null&&ka.remote)&&(Ju||yt),nc=!!u.documentElement&&(ju||yt),sc=ec||tc||ic||ac||rc||nc,Pi=d.length===0&&T===1&&o,oc=!!b.media&&(Ma||Pi),lc=!!((Sa=b.media)!=null&&Sa.textTracks)&&(wa||Pi),dc=!!((Ia=b.media)!=null&&Ia.videoRenditions)&&(zu||Pi),uc=!!((Ca=b.media)!=null&&Ca.audioTracks)&&(Xu||Pi),cc=!!((La=b.media)!=null&&La.remote)&&(Ju||Pi),mc=!!b.documentElement&&(ju||Pi),hc=oc||lc||dc||uc||cc||mc;if(!(sc||hc)){Object.entries(b).forEach(([F,Ra])=>{u[F]=Ra}),g(),b=void 0;return}Object.entries(a).forEach(([F,{get:Ra,mediaEvents:av=[],textTracksEvents:rv=[],videoRenditionsEvents:nv=[],audioTracksEvents:sv=[],remoteEvents:ov=[],rootEvents:lv=[],stateOwnersUpdateHandlers:dv=[]}])=>{v[F]||(v[F]={});let _e=j=>{let Ae=Ra(u,j);f({[F]:Ae})},re;re=v[F].mediaEvents,av.forEach(j=>{re&&ec&&(u.media.removeEventListener(j,re),v[F].mediaEvents=void 0),oc&&(b.media.addEventListener(j,_e),v[F].mediaEvents=_e)}),re=v[F].textTracksEvents,rv.forEach(j=>{var Ae,Ne;re&&tc&&((Ae=u.media.textTracks)==null||Ae.removeEventListener(j,re),v[F].textTracksEvents=void 0),lc&&((Ne=b.media.textTracks)==null||Ne.addEventListener(j,_e),v[F].textTracksEvents=_e)}),re=v[F].videoRenditionsEvents,nv.forEach(j=>{var Ae,Ne;re&&ic&&((Ae=u.media.videoRenditions)==null||Ae.removeEventListener(j,re),v[F].videoRenditionsEvents=void 0),dc&&((Ne=b.media.videoRenditions)==null||Ne.addEventListener(j,_e),v[F].videoRenditionsEvents=_e)}),re=v[F].audioTracksEvents,sv.forEach(j=>{var Ae,Ne;re&&ac&&((Ae=u.media.audioTracks)==null||Ae.removeEventListener(j,re),v[F].audioTracksEvents=void 0),uc&&((Ne=b.media.audioTracks)==null||Ne.addEventListener(j,_e),v[F].audioTracksEvents=_e)}),re=v[F].remoteEvents,ov.forEach(j=>{var Ae,Ne;re&&rc&&((Ae=u.media.remote)==null||Ae.removeEventListener(j,re),v[F].remoteEvents=void 0),cc&&((Ne=b.media.remote)==null||Ne.addEventListener(j,_e),v[F].remoteEvents=_e)}),re=v[F].rootEvents,lv.forEach(j=>{re&&nc&&(u.documentElement.removeEventListener(j,re),v[F].rootEvents=void 0),mc&&(b.documentElement.addEventListener(j,_e),v[F].rootEvents=_e)});let pc=v[F].stateOwnersUpdateHandlers;dv.forEach(j=>{pc&&sc&&pc(),hc&&(v[F].stateOwnersUpdateHandlers=j(_e,b))})}),Object.entries(b).forEach(([F,Ra])=>{u[F]=Ra}),g(),b=void 0};return w({media:i,fullscreenElement:e,documentElement:t,options:n}),{dispatch(A){let{type:T,detail:D}=A;if(r[T]){f(r[T](a,u,A));return}T==="mediaelementchangerequest"?w({media:D}):T==="fullscreenelementchangerequest"?w({fullscreenElement:D}):T==="documentelementchangerequest"?w({documentElement:D}):T==="optionschangerequest"&&Object.entries(D!=null?D:{}).forEach(([ie,ge])=>{u.options[ie]=ge})},getState(){return c},subscribe(A){return w({},d.length+1),d.push(A),A(c),()=>{let T=d.indexOf(A);T>=0&&(w({},d.length-1),d.splice(T,1))}}}},Zc=qv;var sl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},L=(i,e,t)=>(sl(i,e,"read from private field"),t?t.call(i):e.get(i)),It=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Bt=(i,e,t,a)=>(sl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Wt=(i,e,t)=>(sl(i,e,"access private method"),t),Ht,Wa,q,Ha,je,dn,un,al,Fi,$a,cn,rl,jc=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],Qc=10,R={DEFAULT_SUBTITLES:"defaultsubtitles",DEFAULT_STREAM_TYPE:"defaultstreamtype",DEFAULT_DURATION:"defaultduration",FULLSCREEN_ELEMENT:"fullscreenelement",HOTKEYS:"hotkeys",KEYS_USED:"keysused",LIVE_EDGE_OFFSET:"liveedgeoffset",NO_AUTO_SEEK_TO_LIVE:"noautoseektolive",NO_HOTKEYS:"nohotkeys",NO_VOLUME_PREF:"novolumepref",NO_SUBTITLES_LANG_PREF:"nosubtitleslangpref",NO_DEFAULT_STORE:"nodefaultstore",KEYBOARD_FORWARD_SEEK_OFFSET:"keyboardforwardseekoffset",KEYBOARD_BACKWARD_SEEK_OFFSET:"keyboardbackwardseekoffset"},mn=class extends Na{constructor(){super(),It(this,un),It(this,Fi),It(this,cn),It(this,Ht,new we(this,R.HOTKEYS)),It(this,Wa,void 0),It(this,q,void 0),It(this,Ha,void 0),It(this,je,void 0),It(this,dn,t=>{var a;(a=L(this,q))==null||a.dispatch(t)}),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,this.associateElement(this);let e={};Bt(this,Ha,t=>{Object.entries(t).forEach(([a,r])=>{if(a in e&&e[a]===r)return;this.propagateMediaState(a,r);let n=a.toLowerCase(),o=new l.CustomEvent(gc[n],{composed:!0,detail:r});this.dispatchEvent(o)}),e=t}),this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(R.NO_HOTKEYS,R.HOTKEYS,R.DEFAULT_STREAM_TYPE,R.DEFAULT_SUBTITLES,R.DEFAULT_DURATION)}get mediaStore(){return L(this,q)}set mediaStore(e){var t,a;if(L(this,q)&&((t=L(this,je))==null||t.call(this),Bt(this,je,void 0)),Bt(this,q,e),!L(this,q)&&!this.hasAttribute(R.NO_DEFAULT_STORE)){Wt(this,un,al).call(this);return}Bt(this,je,(a=L(this,q))==null?void 0:a.subscribe(L(this,Ha)))}get fullscreenElement(){var e;return(e=L(this,Wa))!=null?e:this}set fullscreenElement(e){var t;this.hasAttribute(R.FULLSCREEN_ELEMENT)&&this.removeAttribute(R.FULLSCREEN_ELEMENT),Bt(this,Wa,e),(t=L(this,q))==null||t.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}attributeChangedCallback(e,t,a){var r,n,o,d,u,c;if(super.attributeChangedCallback(e,t,a),e===R.NO_HOTKEYS)a!==t&&a===""?(this.hasAttribute(R.HOTKEYS)&&console.warn("Media Chrome: Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):a!==t&&a===null&&this.enableHotkeys();else if(e===R.HOTKEYS)L(this,Ht).value=a;else if(e===R.DEFAULT_SUBTITLES&&a!==t)(r=L(this,q))==null||r.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(R.DEFAULT_SUBTITLES)}});else if(e===R.DEFAULT_STREAM_TYPE)(o=L(this,q))==null||o.dispatch({type:"optionschangerequest",detail:{defaultStreamType:(n=this.getAttribute(R.DEFAULT_STREAM_TYPE))!=null?n:void 0}});else if(e===R.LIVE_EDGE_OFFSET)(d=L(this,q))==null||d.dispatch({type:"optionschangerequest",detail:{liveEdgeOffset:this.hasAttribute(R.LIVE_EDGE_OFFSET)?+this.getAttribute(R.LIVE_EDGE_OFFSET):void 0}});else if(e===R.FULLSCREEN_ELEMENT){let f=a?(u=this.getRootNode())==null?void 0:u.getElementById(a):void 0;Bt(this,Wa,f),(c=L(this,q))==null||c.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}}connectedCallback(){var e,t;!L(this,q)&&!this.hasAttribute(R.NO_DEFAULT_STORE)&&Wt(this,un,al).call(this),(e=L(this,q))==null||e.dispatch({type:"documentelementchangerequest",detail:m}),super.connectedCallback(),L(this,q)&&!L(this,je)&&Bt(this,je,(t=L(this,q))==null?void 0:t.subscribe(L(this,Ha))),this.enableHotkeys()}disconnectedCallback(){var e,t,a,r;(e=super.disconnectedCallback)==null||e.call(this),L(this,q)&&((t=L(this,q))==null||t.dispatch({type:"documentelementchangerequest",detail:void 0}),(a=L(this,q))==null||a.dispatch({type:h.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})),L(this,je)&&((r=L(this,je))==null||r.call(this),Bt(this,je,void 0))}mediaSetCallback(e){var t;super.mediaSetCallback(e),(t=L(this,q))==null||t.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var t;super.mediaUnsetCallback(e),(t=L(this,q))==null||t.dispatch({type:"mediaelementchangerequest",detail:void 0})}propagateMediaState(e,t){Jc(this.mediaStateReceivers,e,t)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(t.has(e))return;let a=this.registerMediaStateReceiver.bind(this),r=this.unregisterMediaStateReceiver.bind(this),n=jv(e,a,r);Object.values(h).forEach(o=>{e.addEventListener(o,L(this,dn))}),t.set(e,n)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(!t.has(e))return;t.get(e)(),t.delete(e),Object.values(h).forEach(r=>{e.removeEventListener(r,L(this,dn))})}registerMediaStateReceiver(e){if(!e)return;let t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),L(this,q)&&Object.entries(L(this,q).getState()).forEach(([r,n])=>{Jc([e],r,n)}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,a=t.indexOf(e);a<0||t.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",Wt(this,cn,rl))}disableHotkeys(){this.removeEventListener("keydown",Wt(this,cn,rl)),this.removeEventListener("keyup",Wt(this,Fi,$a))}get hotkeys(){return L(this,Ht)}keyboardShortcutHandler(e){var t,a,r,n,o,d;if(((n=(r=(t=e.target.getAttribute(R.KEYS_USED))==null?void 0:t.split(" "))!=null?r:(a=e.target)==null?void 0:a.keysUsed)!=null?n:[]).map(v=>v==="Space"?" ":v).filter(Boolean).includes(e.key))return;let c,f,g;if(!L(this,Ht).contains(`no${e.key.toLowerCase()}`)&&!(e.key===" "&&L(this,Ht).contains("nospace")))switch(e.key){case" ":case"k":c=L(this,q).getState().mediaPaused?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new l.CustomEvent(c,{composed:!0,bubbles:!0}));break;case"m":c=this.mediaStore.getState().mediaVolumeLevel==="off"?h.MEDIA_UNMUTE_REQUEST:h.MEDIA_MUTE_REQUEST,this.dispatchEvent(new l.CustomEvent(c,{composed:!0,bubbles:!0}));break;case"f":c=this.mediaStore.getState().mediaIsFullscreen?h.MEDIA_EXIT_FULLSCREEN_REQUEST:h.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new l.CustomEvent(c,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new l.CustomEvent(h.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":{let v=this.hasAttribute(R.KEYBOARD_BACKWARD_SEEK_OFFSET)?+this.getAttribute(R.KEYBOARD_BACKWARD_SEEK_OFFSET):Qc;f=Math.max(((o=this.mediaStore.getState().mediaCurrentTime)!=null?o:0)-v,0),g=new l.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:f}),this.dispatchEvent(g);break}case"ArrowRight":{let v=this.hasAttribute(R.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(R.KEYBOARD_FORWARD_SEEK_OFFSET):Qc;f=Math.max(((d=this.mediaStore.getState().mediaCurrentTime)!=null?d:0)+v,0),g=new l.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:f}),this.dispatchEvent(g);break}default:break}}};Ht=new WeakMap;Wa=new WeakMap;q=new WeakMap;Ha=new WeakMap;je=new WeakMap;dn=new WeakMap;un=new WeakSet;al=function(){var i;this.mediaStore=Zc({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(R.DEFAULT_SUBTITLES),defaultDuration:this.hasAttribute(R.DEFAULT_DURATION)?+this.getAttribute(R.DEFAULT_DURATION):void 0,defaultStreamType:(i=this.getAttribute(R.DEFAULT_STREAM_TYPE))!=null?i:void 0,liveEdgeOffset:this.hasAttribute(R.LIVE_EDGE_OFFSET)?+this.getAttribute(R.LIVE_EDGE_OFFSET):void 0,noVolumePref:this.hasAttribute(R.NO_VOLUME_PREF),noSubtitlesLangPref:this.hasAttribute(R.NO_SUBTITLES_LANG_PREF)}})};Fi=new WeakSet;$a=function(i){let{key:e}=i;if(!jc.includes(e)){this.removeEventListener("keyup",Wt(this,Fi,$a));return}this.keyboardShortcutHandler(i)};cn=new WeakSet;rl=function(i){let{metaKey:e,altKey:t,key:a}=i;if(e||t||!jc.includes(a)){this.removeEventListener("keyup",Wt(this,Fi,$a));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(L(this,Ht).contains(`no${a.toLowerCase()}`)||a===" "&&L(this,Ht).contains("nospace"))&&i.preventDefault(),this.addEventListener("keyup",Wt(this,Fi,$a),{once:!0})};var Zv=Object.values(s),Qv=Object.values(Wo),em=i=>{var e,t,a,r;let{observedAttributes:n}=i.constructor;!n&&((e=i.nodeName)!=null&&e.includes("-"))&&(l.customElements.upgrade(i),{observedAttributes:n}=i.constructor);let o=(r=(a=(t=i==null?void 0:i.getAttribute)==null?void 0:t.call(i,y.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(n||o)?(n||o).filter(d=>Zv.includes(d)):[]},zv=i=>{var e,t;return(e=i.nodeName)!=null&&e.includes("-")&&l.customElements.get((t=i.nodeName)==null?void 0:t.toLowerCase())&&!(i instanceof l.customElements.get(i.nodeName.toLowerCase()))&&l.customElements.upgrade(i),Qv.some(a=>a in i)},nl=i=>zv(i)||!!em(i).length,zc=i=>{var e;return(e=i==null?void 0:i.join)==null?void 0:e.call(i,":")},Xc={[s.MEDIA_SUBTITLES_LIST]:$e,[s.MEDIA_SUBTITLES_SHOWING]:$e,[s.MEDIA_SEEKABLE]:zc,[s.MEDIA_BUFFERED]:i=>i==null?void 0:i.map(zc).join(" "),[s.MEDIA_PREVIEW_COORDS]:i=>i==null?void 0:i.join(" "),[s.MEDIA_RENDITION_LIST]:Ac,[s.MEDIA_AUDIO_TRACK_LIST]:yc},Xv=async(i,e,t)=>{var a,r;if(i.isConnected||await Kr(0),typeof t=="boolean"||t==null)return B(i,e,t);if(typeof t=="number")return U(i,e,t);if(typeof t=="string")return k(i,e,t);if(Array.isArray(t)&&!t.length)return i.removeAttribute(e);let n=(r=(a=Xc[e])==null?void 0:a.call(Xc,t))!=null?r:t;return i.setAttribute(e,n)},Jv=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},mi=(i,e)=>{if(Jv(i))return;let t=(r,n)=>{var o,d;nl(r)&&n(r);let{children:u=[]}=r!=null?r:{},c=(d=(o=r==null?void 0:r.shadowRoot)==null?void 0:o.children)!=null?d:[];[...u,...c].forEach(g=>mi(g,n))},a=i==null?void 0:i.nodeName.toLowerCase();if(a.includes("-")&&!nl(i)){l.customElements.whenDefined(a).then(()=>{t(i,e)});return}t(i,e)},Jc=(i,e,t)=>{i.forEach(a=>{if(e in a){a[e]=t;return}let r=em(a),n=e.toLowerCase();r.includes(n)&&Xv(a,n,t)})},jv=(i,e,t)=>{mi(i,e);let a=f=>{var g;let v=(g=f==null?void 0:f.composedPath()[0])!=null?g:f.target;e(v)},r=f=>{var g;let v=(g=f==null?void 0:f.composedPath()[0])!=null?g:f.target;t(v)};i.addEventListener(h.REGISTER_MEDIA_STATE_RECEIVER,a),i.addEventListener(h.UNREGISTER_MEDIA_STATE_RECEIVER,r);let n=f=>{f.forEach(g=>{let{addedNodes:v=[],removedNodes:b=[],type:w,target:A,attributeName:T}=g;w==="childList"?(Array.prototype.forEach.call(v,D=>mi(D,e)),Array.prototype.forEach.call(b,D=>mi(D,t))):w==="attributes"&&T===y.MEDIA_CHROME_ATTRIBUTES&&(nl(A)?e(A):t(A))})},o=[],d=f=>{let g=f.target;g.name!=="media"&&(o.forEach(v=>mi(v,t)),o=[...g.assignedElements({flatten:!0})],o.forEach(v=>mi(v,e)))};i.addEventListener("slotchange",d);let u=new MutationObserver(n);return u.observe(i,{childList:!0,attributes:!0,subtree:!0}),()=>{mi(i,t),i.removeEventListener("slotchange",d),u.disconnect(),i.removeEventListener(h.REGISTER_MEDIA_STATE_RECEIVER,a),i.removeEventListener(h.UNREGISTER_MEDIA_STATE_RECEIVER,r)}};l.customElements.get("media-controller")||l.customElements.define("media-controller",mn);var ol=mn;var ef=Object.defineProperty,tf=(i,e,t)=>e in i?ef(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,af=(i,e,t)=>(tf(i,typeof e!="symbol"?e+"":e,t),t),tm=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Re=(i,e,t)=>(tm(i,e,"read from private field"),t?t.call(i):e.get(i)),hn=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},pn=(i,e,t,a)=>(tm(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),et,vn,Vi,fn,im=m.createElement("template");im.innerHTML=`
146
146
  <style>
147
147
  :host {
148
148
  font: var(--media-font,
@@ -191,7 +191,7 @@
191
191
  min-width: 100%;
192
192
  }
193
193
  </style>
194
- `;var P=class extends l.HTMLElement{constructor(e={}){if(super(),hn(this,je,void 0),af(this,"preventClick",!1),hn(this,vn,t=>{this.preventClick||this.handleClick(t)}),hn(this,Vi,t=>{let{key:a}=t;if(!this.keysUsed.includes(a)){this.removeEventListener("keyup",we(this,Vi));return}this.preventClick||this.handleClick(t)}),hn(this,fn,t=>{let{metaKey:a,altKey:r,key:n}=t;if(a||r||!this.keysUsed.includes(n)){this.removeEventListener("keyup",we(this,Vi));return}this.addEventListener("keyup",we(this,Vi),{once:!0})}),!this.shadowRoot){this.attachShadow({mode:"open"});let t=im.content.cloneNode(!0);this.nativeEl=t;let a=e.slotTemplate;a||(a=m.createElement("template"),a.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(a.content.cloneNode(!0)),this.shadowRoot.appendChild(t)}}static get observedAttributes(){return["disabled",y.MEDIA_CONTROLLER]}enable(){this.addEventListener("click",we(this,vn)),this.addEventListener("keydown",we(this,fn)),this.tabIndex=0}disable(){this.removeEventListener("click",we(this,vn)),this.removeEventListener("keydown",we(this,fn)),this.removeEventListener("keyup",we(this,Vi)),this.tabIndex=-1}attributeChangedCallback(e,t,a){var r,n,o,d,u;e===y.MEDIA_CONTROLLER?(t&&((n=(r=we(this,je))==null?void 0:r.unassociateElement)==null||n.call(r,this),pn(this,je,null)),a&&this.isConnected&&(pn(this,je,(o=this.getRootNode())==null?void 0:o.getElementById(a)),(u=(d=we(this,je))==null?void 0:d.associateElement)==null||u.call(d,this))):e==="disabled"&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){var e,t,a;let{style:r}=N(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","button");let n=this.getAttribute(y.MEDIA_CONTROLLER);n&&(pn(this,je,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(t=we(this,je))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;this.disable(),(t=(e=we(this,je))==null?void 0:e.unassociateElement)==null||t.call(e,this),pn(this,je,null)}get keysUsed(){return["Enter"," "]}handleClick(e){}};je=new WeakMap;vn=new WeakMap;Vi=new WeakMap;fn=new WeakMap;l.customElements.get("media-chrome-button")||l.customElements.define("media-chrome-button",P);var am=`<svg aria-hidden="true" viewBox="0 0 26 24">
194
+ `;var P=class extends l.HTMLElement{constructor(e={}){if(super(),hn(this,et,void 0),af(this,"preventClick",!1),hn(this,vn,t=>{this.preventClick||this.handleClick(t)}),hn(this,Vi,t=>{let{key:a}=t;if(!this.keysUsed.includes(a)){this.removeEventListener("keyup",Re(this,Vi));return}this.preventClick||this.handleClick(t)}),hn(this,fn,t=>{let{metaKey:a,altKey:r,key:n}=t;if(a||r||!this.keysUsed.includes(n)){this.removeEventListener("keyup",Re(this,Vi));return}this.addEventListener("keyup",Re(this,Vi),{once:!0})}),!this.shadowRoot){this.attachShadow({mode:"open"});let t=im.content.cloneNode(!0);this.nativeEl=t;let a=e.slotTemplate;a||(a=m.createElement("template"),a.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(a.content.cloneNode(!0)),this.shadowRoot.appendChild(t)}}static get observedAttributes(){return["disabled",y.MEDIA_CONTROLLER]}enable(){this.addEventListener("click",Re(this,vn)),this.addEventListener("keydown",Re(this,fn)),this.tabIndex=0}disable(){this.removeEventListener("click",Re(this,vn)),this.removeEventListener("keydown",Re(this,fn)),this.removeEventListener("keyup",Re(this,Vi)),this.tabIndex=-1}attributeChangedCallback(e,t,a){var r,n,o,d,u;e===y.MEDIA_CONTROLLER?(t&&((n=(r=Re(this,et))==null?void 0:r.unassociateElement)==null||n.call(r,this),pn(this,et,null)),a&&this.isConnected&&(pn(this,et,(o=this.getRootNode())==null?void 0:o.getElementById(a)),(u=(d=Re(this,et))==null?void 0:d.associateElement)==null||u.call(d,this))):e==="disabled"&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){var e,t,a;let{style:r}=N(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","button");let n=this.getAttribute(y.MEDIA_CONTROLLER);n&&(pn(this,et,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(t=Re(this,et))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;this.disable(),(t=(e=Re(this,et))==null?void 0:e.unassociateElement)==null||t.call(e,this),pn(this,et,null)}get keysUsed(){return["Enter"," "]}handleClick(e){}};et=new WeakMap;vn=new WeakMap;Vi=new WeakMap;fn=new WeakMap;l.customElements.get("media-chrome-button")||l.customElements.define("media-chrome-button",P);var am=`<svg aria-hidden="true" viewBox="0 0 26 24">
195
195
  <path d="M22.13 3H3.87a.87.87 0 0 0-.87.87v13.26a.87.87 0 0 0 .87.87h3.4L9 16H5V5h16v11h-4l1.72 2h3.4a.87.87 0 0 0 .87-.87V3.87a.87.87 0 0 0-.86-.87Zm-8.75 11.44a.5.5 0 0 0-.76 0l-4.91 5.73a.5.5 0 0 0 .38.83h9.82a.501.501 0 0 0 .38-.83l-4.91-5.73Z"/>
196
196
  </svg>
197
197
  `,nm=m.createElement("template");nm.innerHTML=`
@@ -210,7 +210,7 @@
210
210
  <slot name="enter">${am}</slot>
211
211
  <slot name="exit">${am}</slot>
212
212
  </slot>
213
- `;var rm=i=>{let e=i.mediaIsAirplaying?Y.EXIT_AIRPLAY():Y.ENTER_AIRPLAY();i.setAttribute("aria-label",e)},ll=class extends P{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_AIRPLAYING,s.MEDIA_AIRPLAY_UNAVAILABLE]}constructor(e={}){super({slotTemplate:nm,...e})}connectedCallback(){super.connectedCallback(),rm(this)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_IS_AIRPLAYING&&rm(this)}get mediaIsAirplaying(){return H(this,s.MEDIA_IS_AIRPLAYING)}set mediaIsAirplaying(e){B(this,s.MEDIA_IS_AIRPLAYING,e)}get mediaAirplayUnavailable(){return I(this,s.MEDIA_AIRPLAY_UNAVAILABLE)}set mediaAirplayUnavailable(e){k(this,s.MEDIA_AIRPLAY_UNAVAILABLE,e)}handleClick(){let e=new l.CustomEvent(h.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};l.customElements.get("media-airplay-button")||l.customElements.define("media-airplay-button",ll);function sm({anchor:i,floating:e,placement:t}){let a=rf({anchor:i,floating:e}),{x:r,y:n}=sf(a,t);return{x:r,y:n}}function rf({anchor:i,floating:e}){return{anchor:nf(i,e.offsetParent),floating:{x:0,y:0,width:e.offsetWidth,height:e.offsetHeight}}}function nf(i,e){let t=i.getBoundingClientRect(),a=e.getBoundingClientRect();return{x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}function sf({anchor:i,floating:e},t){let a=of(t)==="x"?"y":"x",r=a==="y"?"height":"width",n=om(t),o=i.x+i.width/2-e.width/2,d=i.y+i.height/2-e.height/2,u=i[r]/2-e[r]/2,c;switch(n){case"top":c={x:o,y:i.y-e.height};break;case"bottom":c={x:o,y:i.y+i.height};break;case"right":c={x:i.x+i.width,y:d};break;case"left":c={x:i.x-e.width,y:d};break;default:c={x:i.x,y:i.y}}switch(t.split("-")[1]){case"start":c[a]-=u;break;case"end":c[a]+=u;break}return c}function om(i){return i.split("-")[0]}function of(i){return["top","bottom"].includes(om(i))?"y":"x"}var lf=Object.defineProperty,df=(i,e,t)=>e in i?lf(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,bn=(i,e,t)=>(df(i,typeof e!="symbol"?e+"":e,t),t),$t=class extends Event{constructor({action:e="auto",relatedTarget:t,...a}){super("invoke",a),bn(this,"action"),bn(this,"relatedTarget"),this.action=e,this.relatedTarget=t}},En=class extends Event{constructor({newState:e,oldState:t,...a}){super("toggle",a),bn(this,"newState"),bn(this,"oldState"),this.newState=e,this.oldState=t}};var uf=Object.defineProperty,cf=(i,e,t)=>e in i?uf(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,mf=(i,e,t)=>(cf(i,typeof e!="symbol"?e+"":e,t),t),_l=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},W=(i,e,t)=>(_l(i,e,"read from private field"),t?t.call(i):e.get(i)),$=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},It=(i,e,t,a)=>(_l(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),V=(i,e,t)=>(_l(i,e,"access private method"),t),et,hi,Ft,lm,dm,gn,_n,pi,dl,um,Tn,An,ul,cl,cm,ml,mm,hl,hm,Ki,Yi,vi,Gi,kn,Al,pl,pm,yl,vm,vl,fm,Tl,bm,fl,Em,bl,gm,Fa,Sn,El,_m,Va,In,yn,gl;function tt({type:i,text:e,value:t,checked:a}){let r=m.createElement("media-chrome-menu-item");r.type=i!=null?i:"",r.part.add("menu-item"),i&&r.part.add(i),r.value=t,r.checked=a;let n=m.createElement("span");return n.textContent=e,r.append(n),r}function $e(i,e){let t=i.querySelector(`:scope > [slot="${e}"]`);if((t==null?void 0:t.nodeName)=="SLOT"&&(t=t.assignedElements({flatten:!0})[0]),t)return t=t.cloneNode(!0),t;let a=i.shadowRoot.querySelector(`[name="${e}"] > svg`);return a?a.cloneNode(!0):""}var Am=m.createElement("template");Am.innerHTML=`
213
+ `;var rm=i=>{let e=i.mediaIsAirplaying?Y.EXIT_AIRPLAY():Y.ENTER_AIRPLAY();i.setAttribute("aria-label",e)},ll=class extends P{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_AIRPLAYING,s.MEDIA_AIRPLAY_UNAVAILABLE]}constructor(e={}){super({slotTemplate:nm,...e})}connectedCallback(){super.connectedCallback(),rm(this)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_IS_AIRPLAYING&&rm(this)}get mediaIsAirplaying(){return H(this,s.MEDIA_IS_AIRPLAYING)}set mediaIsAirplaying(e){B(this,s.MEDIA_IS_AIRPLAYING,e)}get mediaAirplayUnavailable(){return I(this,s.MEDIA_AIRPLAY_UNAVAILABLE)}set mediaAirplayUnavailable(e){k(this,s.MEDIA_AIRPLAY_UNAVAILABLE,e)}handleClick(){let e=new l.CustomEvent(h.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};l.customElements.get("media-airplay-button")||l.customElements.define("media-airplay-button",ll);function sm({anchor:i,floating:e,placement:t}){let a=rf({anchor:i,floating:e}),{x:r,y:n}=sf(a,t);return{x:r,y:n}}function rf({anchor:i,floating:e}){return{anchor:nf(i,e.offsetParent),floating:{x:0,y:0,width:e.offsetWidth,height:e.offsetHeight}}}function nf(i,e){let t=i.getBoundingClientRect(),a=e.getBoundingClientRect();return{x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}function sf({anchor:i,floating:e},t){let a=of(t)==="x"?"y":"x",r=a==="y"?"height":"width",n=om(t),o=i.x+i.width/2-e.width/2,d=i.y+i.height/2-e.height/2,u=i[r]/2-e[r]/2,c;switch(n){case"top":c={x:o,y:i.y-e.height};break;case"bottom":c={x:o,y:i.y+i.height};break;case"right":c={x:i.x+i.width,y:d};break;case"left":c={x:i.x-e.width,y:d};break;default:c={x:i.x,y:i.y}}switch(t.split("-")[1]){case"start":c[a]-=u;break;case"end":c[a]+=u;break}return c}function om(i){return i.split("-")[0]}function of(i){return["top","bottom"].includes(om(i))?"y":"x"}var lf=Object.defineProperty,df=(i,e,t)=>e in i?lf(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,bn=(i,e,t)=>(df(i,typeof e!="symbol"?e+"":e,t),t),$t=class extends Event{constructor({action:e="auto",relatedTarget:t,...a}){super("invoke",a),bn(this,"action"),bn(this,"relatedTarget"),this.action=e,this.relatedTarget=t}},En=class extends Event{constructor({newState:e,oldState:t,...a}){super("toggle",a),bn(this,"newState"),bn(this,"oldState"),this.newState=e,this.oldState=t}};var uf=Object.defineProperty,cf=(i,e,t)=>e in i?uf(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,mf=(i,e,t)=>(cf(i,typeof e!="symbol"?e+"":e,t),t),_l=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},W=(i,e,t)=>(_l(i,e,"read from private field"),t?t.call(i):e.get(i)),$=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ct=(i,e,t,a)=>(_l(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),V=(i,e,t)=>(_l(i,e,"access private method"),t),tt,pi,Ft,lm,dm,gn,_n,vi,dl,um,Tn,An,ul,cl,cm,ml,mm,hl,hm,Ki,Yi,fi,Gi,kn,Al,pl,pm,yl,vm,vl,fm,Tl,bm,fl,Em,bl,gm,Fa,Sn,El,_m,Va,In,yn,gl;function it({type:i,text:e,value:t,checked:a}){let r=m.createElement("media-chrome-menu-item");r.type=i!=null?i:"",r.part.add("menu-item"),i&&r.part.add(i),r.value=t,r.checked=a;let n=m.createElement("span");return n.textContent=e,r.append(n),r}function Fe(i,e){let t=i.querySelector(`:scope > [slot="${e}"]`);if((t==null?void 0:t.nodeName)=="SLOT"&&(t=t.assignedElements({flatten:!0})[0]),t)return t=t.cloneNode(!0),t;let a=i.shadowRoot.querySelector(`[name="${e}"] > svg`);return a?a.cloneNode(!0):""}var Am=m.createElement("template");Am.innerHTML=`
214
214
  <style>
215
215
  :host {
216
216
  font: var(--media-font,
@@ -372,7 +372,7 @@
372
372
  <slot></slot>
373
373
  </div>
374
374
  <slot name="checked-indicator" hidden></slot>
375
- `;var mi={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},ce=class extends l.HTMLElement{constructor(){super(),$(this,dl),$(this,An),$(this,cl),$(this,ml),$(this,hl),$(this,vi),$(this,kn),$(this,pl),$(this,yl),$(this,vl),$(this,Tl),$(this,fl),$(this,bl),$(this,Fa),$(this,El),$(this,Va),$(this,yn),$(this,et,void 0),$(this,hi,void 0),$(this,Ft,void 0),$(this,lm,""),$(this,dm,null),$(this,gn,new Set),$(this,_n,void 0),$(this,pi,!1),$(this,Tn,()=>{let e=W(this,gn),t=new Set(this.items);for(let a of e)t.has(a)||this.dispatchEvent(new CustomEvent("removemenuitem",{detail:a}));for(let a of t)e.has(a)||this.dispatchEvent(new CustomEvent("addmenuitem",{detail:a}));It(this,gn,t)}),$(this,Ki,()=>{V(this,vi,Gi).call(this,!1),V(this,kn,Al).call(this,!1)}),$(this,Yi,()=>{V(this,vi,Gi).call(this,!1)}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.nativeEl=this.constructor.template.content.cloneNode(!0),this.shadowRoot.append(this.nativeEl)),this.container=this.shadowRoot.querySelector("#container"),this.defaultSlot=this.shadowRoot.querySelector("slot:not([name])"),this.shadowRoot.addEventListener("slotchange",this),It(this,_n,new MutationObserver(W(this,Tn))),W(this,_n).observe(this.defaultSlot,{childList:!0})}static get observedAttributes(){return[mi.DISABLED,mi.HIDDEN,mi.STYLE,mi.ANCHOR,y.MEDIA_CONTROLLER]}static formatMenuItemText(e){return e}enable(){this.addEventListener("click",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this),this.addEventListener("invoke",this),this.addEventListener("toggle",this)}disable(){this.removeEventListener("click",this),this.removeEventListener("focusout",this),this.removeEventListener("keyup",this),this.removeEventListener("invoke",this),this.removeEventListener("toggle",this)}handleEvent(e){switch(e.type){case"slotchange":V(this,dl,um).call(this,e);break;case"invoke":V(this,cl,cm).call(this,e);break;case"click":V(this,pl,pm).call(this,e);break;case"toggle":V(this,vl,fm).call(this,e);break;case"focusout":V(this,fl,Em).call(this,e);break;case"keydown":V(this,bl,gm).call(this,e);break}}connectedCallback(){var e,t;V(this,An,ul).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),It(this,et,Zr(this)),(t=(e=W(this,et))==null?void 0:e.associateElement)==null||t.call(e,this),this.hidden||(Le(Ka(this),W(this,Ki)),Le(this,W(this,Yi)))}disconnectedCallback(){var e,t;Xe(Ka(this),W(this,Ki)),Xe(this,W(this,Yi)),this.disable(),(t=(e=W(this,et))==null?void 0:e.unassociateElement)==null||t.call(e,this),It(this,et,null)}attributeChangedCallback(e,t,a){var r,n,o,d;e===mi.HIDDEN&&a!==t?(W(this,pi)||It(this,pi,!0),this.hidden?V(this,hl,hm).call(this):V(this,ml,mm).call(this),this.dispatchEvent(new En({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:!0}))):e===y.MEDIA_CONTROLLER?(t&&((n=(r=W(this,et))==null?void 0:r.unassociateElement)==null||n.call(r,this),It(this,et,null)),a&&this.isConnected&&(It(this,et,Zr(this)),(d=(o=W(this,et))==null?void 0:o.associateElement)==null||d.call(o,this))):e===mi.DISABLED&&a!==t?a==null?this.enable():this.disable():e===mi.STYLE&&a!==t&&V(this,An,ul).call(this)}formatMenuItemText(e,t){return this.constructor.formatMenuItemText(e,t)}get anchor(){return this.getAttribute("anchor")}set anchor(e){this.setAttribute("anchor",`${e}`)}get anchorElement(){var e;return this.anchor?(e=ni(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:!0}).filter(hf)}get radioGroupItems(){return this.items.filter(e=>e.role==="menuitemradio")}get checkedItems(){return this.items.filter(e=>e.checked)}get value(){var e,t;return(t=(e=this.checkedItems[0])==null?void 0:e.value)!=null?t:""}set value(e){let t=this.items.find(a=>a.value===e);t&&V(this,yn,gl).call(this,t)}focus(){if(It(this,hi,ri()),this.items.length){V(this,Va,In).call(this,this.items[0]),this.items[0].focus();return}let e=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');e==null||e.focus()}handleSelect(e){var t;let a=V(this,Fa,Sn).call(this,e);a&&(V(this,yn,gl).call(this,a,a.type==="checkbox"),W(this,Ft)&&!this.hidden&&((t=W(this,hi))==null||t.focus(),this.hidden=!0))}get keysUsed(){return["Enter","Escape","Tab"," ","ArrowDown","ArrowUp","Home","End"]}handleMove(e){var t,a;let{key:r}=e,n=this.items,o=(a=(t=V(this,Fa,Sn).call(this,e))!=null?t:V(this,El,_m).call(this))!=null?a:n[0],d=n.indexOf(o),u=Math.max(0,d);r==="ArrowDown"?u++:r==="ArrowUp"?u--:e.key==="Home"?u=0:e.key==="End"&&(u=n.length-1),u<0&&(u=n.length-1),u>n.length-1&&(u=0),V(this,Va,In).call(this,n[u]),n[u].focus()}};et=new WeakMap;hi=new WeakMap;Ft=new WeakMap;lm=new WeakMap;dm=new WeakMap;gn=new WeakMap;_n=new WeakMap;pi=new WeakMap;dl=new WeakSet;um=function(i){let e=i.target;for(let t of e.assignedNodes({flatten:!0}))t.nodeType===3&&t.textContent.trim()===""&&t.remove();if(["header","title"].includes(e.name)){let t=this.shadowRoot.querySelector('slot[name="header"]');t.hidden=e.assignedNodes().length===0}e.name||W(this,Tn).call(this)};Tn=new WeakMap;An=new WeakSet;ul=function(){var i;let e=this.shadowRoot.querySelector("#layout-row"),t=(i=getComputedStyle(this).getPropertyValue("--media-menu-layout"))==null?void 0:i.trim();e.setAttribute("media",t==="row"?"":"width:0")};cl=new WeakSet;cm=function(i){It(this,Ft,i.relatedTarget),ue(this,i.relatedTarget)||(this.hidden=!this.hidden)};ml=new WeakSet;mm=function(){var i;(i=W(this,Ft))==null||i.setAttribute("aria-expanded","true"),requestAnimationFrame(()=>V(this,vi,Gi).call(this,!1)),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),Le(Ka(this),W(this,Ki)),Le(this,W(this,Yi))};hl=new WeakSet;hm=function(){var i;(i=W(this,Ft))==null||i.setAttribute("aria-expanded","false"),Xe(Ka(this),W(this,Ki)),Xe(this,W(this,Yi))};Ki=new WeakMap;Yi=new WeakMap;vi=new WeakSet;Gi=function(i,e){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:t,y:a}=sm({anchor:this.anchorElement,floating:this,placement:"top-start"});e!=null||(e=this.offsetWidth);let n=Ka(this).getBoundingClientRect(),o=this.anchorElement.getBoundingClientRect(),d=n.width-t-e,u=n.height-a-this.offsetHeight,c=n.height-o.height,{style:f}=N(this.shadowRoot,":host");i||f.setProperty("--media-menu-transition-in","none"),f.setProperty("position","absolute"),f.setProperty("right",`${Math.max(0,d)}px`),f.setProperty("bottom",`${u}px`),f.setProperty("--_menu-max-height",`${c}px`),f.removeProperty("--media-menu-transition-in")};kn=new WeakSet;Al=function(i){let e=this.querySelector('[role="menuitem"][aria-haspopup][aria-expanded="true"]'),t=e==null?void 0:e.querySelector('[role="menu"]'),{style:a}=N(this.shadowRoot,":host");if(i||a.setProperty("--media-menu-transition-in","none"),t){let r=t.offsetHeight,n=Math.max(t.offsetWidth,e.offsetWidth);this.style.setProperty("min-width",`${n}px`),this.style.setProperty("min-height",`${r}px`),V(this,vi,Gi).call(this,i,n)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),V(this,vi,Gi).call(this,i);a.removeProperty("--media-menu-transition-in")};pl=new WeakSet;pm=function(i){var e;if(i.stopPropagation(),i.composedPath().includes(W(this,yl,vm))){(e=W(this,hi))==null||e.focus(),this.hidden=!0;return}let t=V(this,Fa,Sn).call(this,i);!t||t.hasAttribute("disabled")||(V(this,Va,In).call(this,t),this.handleSelect(i))};yl=new WeakSet;vm=function(){var i;return(i=this.shadowRoot.querySelector('slot[name="header"]').assignedElements({flatten:!0}))==null?void 0:i.find(t=>t.part.contains("back")&&t.part.contains("button"))};vl=new WeakSet;fm=function(i){if(i.target===this)return;V(this,Tl,bm).call(this);let e=Array.from(this.querySelectorAll('[role="menuitem"][aria-haspopup]'));for(let t of e)t.invokeTargetElement!=i.target&&i.newState=="open"&&t.getAttribute("aria-expanded")=="true"&&!t.invokeTargetElement.hidden&&t.invokeTargetElement.dispatchEvent(new $t({relatedTarget:t}));for(let t of e)t.setAttribute("aria-expanded",`${!t.submenuElement.hidden}`);V(this,kn,Al).call(this,!0)};Tl=new WeakSet;bm=function(){let i='[role="menuitem"] > [role="menu"]:not([hidden])',e=this.querySelector(i);this.container.classList.toggle("has-expanded",!!e)};fl=new WeakSet;Em=function(i){var e;ue(this,i.relatedTarget)||(W(this,pi)&&((e=W(this,hi))==null||e.focus()),W(this,Ft)&&W(this,Ft)!==i.relatedTarget&&!this.hidden&&(this.hidden=!0))};bl=new WeakSet;gm=function(i){var e,t,a,r,n;let{key:o,ctrlKey:d,altKey:u,metaKey:c}=i;if(!(d||u||c)&&this.keysUsed.includes(o))if(i.preventDefault(),i.stopPropagation(),o==="Tab"){if(W(this,pi)){this.hidden=!0;return}i.shiftKey?(t=(e=this.previousElementSibling)==null?void 0:e.focus)==null||t.call(e):(r=(a=this.nextElementSibling)==null?void 0:a.focus)==null||r.call(a),this.blur()}else o==="Escape"?((n=W(this,hi))==null||n.focus(),W(this,pi)&&(this.hidden=!0)):o==="Enter"||o===" "?this.handleSelect(i):this.handleMove(i)};Fa=new WeakSet;Sn=function(i){return i.composedPath().find(e=>["menuitemradio","menuitemcheckbox"].includes(e.role))};El=new WeakSet;_m=function(){return this.items.find(i=>i.tabIndex===0)};Va=new WeakSet;In=function(i){for(let e of this.items)e.tabIndex=e===i?0:-1};yn=new WeakSet;gl=function(i,e){let t=[...this.checkedItems];i.type==="radio"&&this.radioGroupItems.forEach(a=>a.checked=!1),e?i.checked=!i.checked:i.checked=!0,this.checkedItems.some((a,r)=>a!=t[r])&&this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))};mf(ce,"template",Am);function hf(i){return["menuitem","menuitemradio","menuitemcheckbox"].includes(i==null?void 0:i.role)}function Ka(i){var e;return(e=i.getAttribute("bounds")?Be(i,`#${i.getAttribute("bounds")}`):X(i)||i.parentElement)!=null?e:i}l.customElements.get("media-chrome-menu")||l.customElements.define("media-chrome-menu",ce);var Ll=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ym=(i,e,t)=>(Ll(i,e,"read from private field"),t?t.call(i):e.get(i)),Cn=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},kl=(i,e,t,a)=>(Ll(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ln=(i,e,t)=>(Ll(i,e,"access private method"),t),Ya,Rn,Mn,Sl,wn,Il,Cl=class extends ce{constructor(){super(...arguments),Cn(this,Mn),Cn(this,wn),Cn(this,Ya,[]),Cn(this,Rn,void 0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_AUDIO_TRACK_LIST,s.MEDIA_AUDIO_TRACK_ENABLED,s.MEDIA_AUDIO_TRACK_UNAVAILABLE]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_AUDIO_TRACK_ENABLED&&t!==a?this.value=a:e===s.MEDIA_AUDIO_TRACK_LIST&&t!==a&&(kl(this,Ya,Fr(a)),Ln(this,Mn,Sl).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Ln(this,wn,Il))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Ln(this,wn,Il))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-audio-track-menu-button")}get mediaAudioTrackList(){return ym(this,Ya)}set mediaAudioTrackList(e){kl(this,Ya,e),Ln(this,Mn,Sl).call(this)}get mediaAudioTrackEnabled(){return I(this,s.MEDIA_AUDIO_TRACK_ENABLED)}set mediaAudioTrackEnabled(e){k(this,s.MEDIA_AUDIO_TRACK_ENABLED,e)}};Ya=new WeakMap;Rn=new WeakMap;Mn=new WeakSet;Sl=function(){if(ym(this,Rn)===JSON.stringify(this.mediaAudioTrackList))return;kl(this,Rn,JSON.stringify(this.mediaAudioTrackList));let i=this.mediaAudioTrackList;this.defaultSlot.textContent="";for(let e of i){let t=this.formatMenuItemText(e.label,e),a=tt({type:"radio",text:t,value:`${e.id}`,checked:e.enabled});a.prepend($e(this,"checked-indicator")),this.defaultSlot.append(a)}};wn=new WeakSet;Il=function(){if(this.value==null)return;let i=new l.CustomEvent(h.MEDIA_AUDIO_TRACK_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};l.customElements.get("media-audio-track-menu")||l.customElements.define("media-audio-track-menu",Cl);var ke=class extends P{connectedCallback(){super.connectedCallback(),this.invokeTargetElement&&this.setAttribute("aria-haspopup","menu")}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=ni(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):null}handleClick(){this.invokeTargetElement.dispatchEvent(new $t({relatedTarget:this}))}};l.customElements.get("media-chrome-menu-button")||l.customElements.define("media-chrome-menu-button",ke);var pf=`<svg aria-hidden="true" viewBox="0 0 24 24">
375
+ `;var hi={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},ce=class extends l.HTMLElement{constructor(){super(),$(this,dl),$(this,An),$(this,cl),$(this,ml),$(this,hl),$(this,fi),$(this,kn),$(this,pl),$(this,yl),$(this,vl),$(this,Tl),$(this,fl),$(this,bl),$(this,Fa),$(this,El),$(this,Va),$(this,yn),$(this,tt,void 0),$(this,pi,void 0),$(this,Ft,void 0),$(this,lm,""),$(this,dm,null),$(this,gn,new Set),$(this,_n,void 0),$(this,vi,!1),$(this,Tn,()=>{let e=W(this,gn),t=new Set(this.items);for(let a of e)t.has(a)||this.dispatchEvent(new CustomEvent("removemenuitem",{detail:a}));for(let a of t)e.has(a)||this.dispatchEvent(new CustomEvent("addmenuitem",{detail:a}));Ct(this,gn,t)}),$(this,Ki,()=>{V(this,fi,Gi).call(this,!1),V(this,kn,Al).call(this,!1)}),$(this,Yi,()=>{V(this,fi,Gi).call(this,!1)}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.nativeEl=this.constructor.template.content.cloneNode(!0),this.shadowRoot.append(this.nativeEl)),this.container=this.shadowRoot.querySelector("#container"),this.defaultSlot=this.shadowRoot.querySelector("slot:not([name])"),this.shadowRoot.addEventListener("slotchange",this),Ct(this,_n,new MutationObserver(W(this,Tn))),W(this,_n).observe(this.defaultSlot,{childList:!0})}static get observedAttributes(){return[hi.DISABLED,hi.HIDDEN,hi.STYLE,hi.ANCHOR,y.MEDIA_CONTROLLER]}static formatMenuItemText(e){return e}enable(){this.addEventListener("click",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this),this.addEventListener("invoke",this),this.addEventListener("toggle",this)}disable(){this.removeEventListener("click",this),this.removeEventListener("focusout",this),this.removeEventListener("keyup",this),this.removeEventListener("invoke",this),this.removeEventListener("toggle",this)}handleEvent(e){switch(e.type){case"slotchange":V(this,dl,um).call(this,e);break;case"invoke":V(this,cl,cm).call(this,e);break;case"click":V(this,pl,pm).call(this,e);break;case"toggle":V(this,vl,fm).call(this,e);break;case"focusout":V(this,fl,Em).call(this,e);break;case"keydown":V(this,bl,gm).call(this,e);break}}connectedCallback(){var e,t;V(this,An,ul).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),Ct(this,tt,Zr(this)),(t=(e=W(this,tt))==null?void 0:e.associateElement)==null||t.call(e,this),this.hidden||(Me(Ka(this),W(this,Ki)),Me(this,W(this,Yi)))}disconnectedCallback(){var e,t;Je(Ka(this),W(this,Ki)),Je(this,W(this,Yi)),this.disable(),(t=(e=W(this,tt))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ct(this,tt,null)}attributeChangedCallback(e,t,a){var r,n,o,d;e===hi.HIDDEN&&a!==t?(W(this,vi)||Ct(this,vi,!0),this.hidden?V(this,hl,hm).call(this):V(this,ml,mm).call(this),this.dispatchEvent(new En({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:!0}))):e===y.MEDIA_CONTROLLER?(t&&((n=(r=W(this,tt))==null?void 0:r.unassociateElement)==null||n.call(r,this),Ct(this,tt,null)),a&&this.isConnected&&(Ct(this,tt,Zr(this)),(d=(o=W(this,tt))==null?void 0:o.associateElement)==null||d.call(o,this))):e===hi.DISABLED&&a!==t?a==null?this.enable():this.disable():e===hi.STYLE&&a!==t&&V(this,An,ul).call(this)}formatMenuItemText(e,t){return this.constructor.formatMenuItemText(e,t)}get anchor(){return this.getAttribute("anchor")}set anchor(e){this.setAttribute("anchor",`${e}`)}get anchorElement(){var e;return this.anchor?(e=si(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:!0}).filter(hf)}get radioGroupItems(){return this.items.filter(e=>e.role==="menuitemradio")}get checkedItems(){return this.items.filter(e=>e.checked)}get value(){var e,t;return(t=(e=this.checkedItems[0])==null?void 0:e.value)!=null?t:""}set value(e){let t=this.items.find(a=>a.value===e);t&&V(this,yn,gl).call(this,t)}focus(){if(Ct(this,pi,ni()),this.items.length){V(this,Va,In).call(this,this.items[0]),this.items[0].focus();return}let e=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');e==null||e.focus()}handleSelect(e){var t;let a=V(this,Fa,Sn).call(this,e);a&&(V(this,yn,gl).call(this,a,a.type==="checkbox"),W(this,Ft)&&!this.hidden&&((t=W(this,pi))==null||t.focus(),this.hidden=!0))}get keysUsed(){return["Enter","Escape","Tab"," ","ArrowDown","ArrowUp","Home","End"]}handleMove(e){var t,a;let{key:r}=e,n=this.items,o=(a=(t=V(this,Fa,Sn).call(this,e))!=null?t:V(this,El,_m).call(this))!=null?a:n[0],d=n.indexOf(o),u=Math.max(0,d);r==="ArrowDown"?u++:r==="ArrowUp"?u--:e.key==="Home"?u=0:e.key==="End"&&(u=n.length-1),u<0&&(u=n.length-1),u>n.length-1&&(u=0),V(this,Va,In).call(this,n[u]),n[u].focus()}};tt=new WeakMap;pi=new WeakMap;Ft=new WeakMap;lm=new WeakMap;dm=new WeakMap;gn=new WeakMap;_n=new WeakMap;vi=new WeakMap;dl=new WeakSet;um=function(i){let e=i.target;for(let t of e.assignedNodes({flatten:!0}))t.nodeType===3&&t.textContent.trim()===""&&t.remove();if(["header","title"].includes(e.name)){let t=this.shadowRoot.querySelector('slot[name="header"]');t.hidden=e.assignedNodes().length===0}e.name||W(this,Tn).call(this)};Tn=new WeakMap;An=new WeakSet;ul=function(){var i;let e=this.shadowRoot.querySelector("#layout-row"),t=(i=getComputedStyle(this).getPropertyValue("--media-menu-layout"))==null?void 0:i.trim();e.setAttribute("media",t==="row"?"":"width:0")};cl=new WeakSet;cm=function(i){Ct(this,Ft,i.relatedTarget),ue(this,i.relatedTarget)||(this.hidden=!this.hidden)};ml=new WeakSet;mm=function(){var i;(i=W(this,Ft))==null||i.setAttribute("aria-expanded","true"),requestAnimationFrame(()=>V(this,fi,Gi).call(this,!1)),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),Me(Ka(this),W(this,Ki)),Me(this,W(this,Yi))};hl=new WeakSet;hm=function(){var i;(i=W(this,Ft))==null||i.setAttribute("aria-expanded","false"),Je(Ka(this),W(this,Ki)),Je(this,W(this,Yi))};Ki=new WeakMap;Yi=new WeakMap;fi=new WeakSet;Gi=function(i,e){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:t,y:a}=sm({anchor:this.anchorElement,floating:this,placement:"top-start"});e!=null||(e=this.offsetWidth);let n=Ka(this).getBoundingClientRect(),o=this.anchorElement.getBoundingClientRect(),d=n.width-t-e,u=n.height-a-this.offsetHeight,c=n.height-o.height,{style:f}=N(this.shadowRoot,":host");i||f.setProperty("--media-menu-transition-in","none"),f.setProperty("position","absolute"),f.setProperty("right",`${Math.max(0,d)}px`),f.setProperty("bottom",`${u}px`),f.setProperty("--_menu-max-height",`${c}px`),f.removeProperty("--media-menu-transition-in")};kn=new WeakSet;Al=function(i){let e=this.querySelector('[role="menuitem"][aria-haspopup][aria-expanded="true"]'),t=e==null?void 0:e.querySelector('[role="menu"]'),{style:a}=N(this.shadowRoot,":host");if(i||a.setProperty("--media-menu-transition-in","none"),t){let r=t.offsetHeight,n=Math.max(t.offsetWidth,e.offsetWidth);this.style.setProperty("min-width",`${n}px`),this.style.setProperty("min-height",`${r}px`),V(this,fi,Gi).call(this,i,n)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),V(this,fi,Gi).call(this,i);a.removeProperty("--media-menu-transition-in")};pl=new WeakSet;pm=function(i){var e;if(i.stopPropagation(),i.composedPath().includes(W(this,yl,vm))){(e=W(this,pi))==null||e.focus(),this.hidden=!0;return}let t=V(this,Fa,Sn).call(this,i);!t||t.hasAttribute("disabled")||(V(this,Va,In).call(this,t),this.handleSelect(i))};yl=new WeakSet;vm=function(){var i;return(i=this.shadowRoot.querySelector('slot[name="header"]').assignedElements({flatten:!0}))==null?void 0:i.find(t=>t.part.contains("back")&&t.part.contains("button"))};vl=new WeakSet;fm=function(i){if(i.target===this)return;V(this,Tl,bm).call(this);let e=Array.from(this.querySelectorAll('[role="menuitem"][aria-haspopup]'));for(let t of e)t.invokeTargetElement!=i.target&&i.newState=="open"&&t.getAttribute("aria-expanded")=="true"&&!t.invokeTargetElement.hidden&&t.invokeTargetElement.dispatchEvent(new $t({relatedTarget:t}));for(let t of e)t.setAttribute("aria-expanded",`${!t.submenuElement.hidden}`);V(this,kn,Al).call(this,!0)};Tl=new WeakSet;bm=function(){let i='[role="menuitem"] > [role="menu"]:not([hidden])',e=this.querySelector(i);this.container.classList.toggle("has-expanded",!!e)};fl=new WeakSet;Em=function(i){var e;ue(this,i.relatedTarget)||(W(this,vi)&&((e=W(this,pi))==null||e.focus()),W(this,Ft)&&W(this,Ft)!==i.relatedTarget&&!this.hidden&&(this.hidden=!0))};bl=new WeakSet;gm=function(i){var e,t,a,r,n;let{key:o,ctrlKey:d,altKey:u,metaKey:c}=i;if(!(d||u||c)&&this.keysUsed.includes(o))if(i.preventDefault(),i.stopPropagation(),o==="Tab"){if(W(this,vi)){this.hidden=!0;return}i.shiftKey?(t=(e=this.previousElementSibling)==null?void 0:e.focus)==null||t.call(e):(r=(a=this.nextElementSibling)==null?void 0:a.focus)==null||r.call(a),this.blur()}else o==="Escape"?((n=W(this,pi))==null||n.focus(),W(this,vi)&&(this.hidden=!0)):o==="Enter"||o===" "?this.handleSelect(i):this.handleMove(i)};Fa=new WeakSet;Sn=function(i){return i.composedPath().find(e=>["menuitemradio","menuitemcheckbox"].includes(e.role))};El=new WeakSet;_m=function(){return this.items.find(i=>i.tabIndex===0)};Va=new WeakSet;In=function(i){for(let e of this.items)e.tabIndex=e===i?0:-1};yn=new WeakSet;gl=function(i,e){let t=[...this.checkedItems];i.type==="radio"&&this.radioGroupItems.forEach(a=>a.checked=!1),e?i.checked=!i.checked:i.checked=!0,this.checkedItems.some((a,r)=>a!=t[r])&&this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))};mf(ce,"template",Am);function hf(i){return["menuitem","menuitemradio","menuitemcheckbox"].includes(i==null?void 0:i.role)}function Ka(i){var e;return(e=i.getAttribute("bounds")?We(i,`#${i.getAttribute("bounds")}`):X(i)||i.parentElement)!=null?e:i}l.customElements.get("media-chrome-menu")||l.customElements.define("media-chrome-menu",ce);var Ll=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ym=(i,e,t)=>(Ll(i,e,"read from private field"),t?t.call(i):e.get(i)),Cn=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},kl=(i,e,t,a)=>(Ll(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ln=(i,e,t)=>(Ll(i,e,"access private method"),t),Ya,Rn,Mn,Sl,wn,Il,Cl=class extends ce{constructor(){super(...arguments),Cn(this,Mn),Cn(this,wn),Cn(this,Ya,[]),Cn(this,Rn,void 0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_AUDIO_TRACK_LIST,s.MEDIA_AUDIO_TRACK_ENABLED,s.MEDIA_AUDIO_TRACK_UNAVAILABLE]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_AUDIO_TRACK_ENABLED&&t!==a?this.value=a:e===s.MEDIA_AUDIO_TRACK_LIST&&t!==a&&(kl(this,Ya,Fr(a)),Ln(this,Mn,Sl).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Ln(this,wn,Il))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Ln(this,wn,Il))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-audio-track-menu-button")}get mediaAudioTrackList(){return ym(this,Ya)}set mediaAudioTrackList(e){kl(this,Ya,e),Ln(this,Mn,Sl).call(this)}get mediaAudioTrackEnabled(){return I(this,s.MEDIA_AUDIO_TRACK_ENABLED)}set mediaAudioTrackEnabled(e){k(this,s.MEDIA_AUDIO_TRACK_ENABLED,e)}};Ya=new WeakMap;Rn=new WeakMap;Mn=new WeakSet;Sl=function(){if(ym(this,Rn)===JSON.stringify(this.mediaAudioTrackList))return;kl(this,Rn,JSON.stringify(this.mediaAudioTrackList));let i=this.mediaAudioTrackList;this.defaultSlot.textContent="";for(let e of i){let t=this.formatMenuItemText(e.label,e),a=it({type:"radio",text:t,value:`${e.id}`,checked:e.enabled});a.prepend(Fe(this,"checked-indicator")),this.defaultSlot.append(a)}};wn=new WeakSet;Il=function(){if(this.value==null)return;let i=new l.CustomEvent(h.MEDIA_AUDIO_TRACK_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};l.customElements.get("media-audio-track-menu")||l.customElements.define("media-audio-track-menu",Cl);var ke=class extends P{connectedCallback(){super.connectedCallback(),this.invokeTargetElement&&this.setAttribute("aria-haspopup","menu")}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=si(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):null}handleClick(){this.invokeTargetElement.dispatchEvent(new $t({relatedTarget:this}))}};l.customElements.get("media-chrome-menu-button")||l.customElements.define("media-chrome-menu-button",ke);var pf=`<svg aria-hidden="true" viewBox="0 0 24 24">
376
376
  <path d="M11 17H9.5V7H11v10Zm-3-3H6.5v-4H8v4Zm6-5h-1.5v6H14V9Zm3 7h-1.5V8H17v8Z"/>
377
377
  <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"/>
378
378
  </svg>`,Tm=m.createElement("template");Tm.innerHTML=`
@@ -397,11 +397,11 @@
397
397
  <slot name="on">${vf}</slot>
398
398
  <slot name="off">${ff}</slot>
399
399
  </slot>
400
- `;var km=i=>{i.setAttribute("aria-checked",rn(i))},wl=class extends P{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_SUBTITLES_LIST,s.MEDIA_SUBTITLES_SHOWING]}constructor(e={}){super({slotTemplate:Cm,...e}),this._captionsReady=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",K.CLOSED_CAPTIONS()),km(this)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_SUBTITLES_SHOWING&&km(this)}get mediaSubtitlesList(){return Sm(this,s.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Im(this,s.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Sm(this,s.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Im(this,s.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){this.dispatchEvent(new l.CustomEvent(h.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}))}},Sm=(i,e)=>{let t=i.getAttribute(e);return t?kt(t):[]},Im=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let a=He(t);i.getAttribute(e)!==a&&i.setAttribute(e,a)};l.customElements.get("media-captions-button")||l.customElements.define("media-captions-button",wl);var bf=Object.defineProperty,Ef=(i,e,t)=>e in i?bf(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,gf=(i,e,t)=>(Ef(i,typeof e!="symbol"?e+"":e,t),t),Pl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},_f=(i,e,t)=>(Pl(i,e,"read from private field"),t?t.call(i):e.get(i)),Rl=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Af=(i,e,t,a)=>(Pl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),xl=(i,e,t)=>(Pl(i,e,"access private method"),t),Dn,Dl,wm,xn,Ol,yf=`
400
+ `;var km=i=>{i.setAttribute("aria-checked",rn(i))},wl=class extends P{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_SUBTITLES_LIST,s.MEDIA_SUBTITLES_SHOWING]}constructor(e={}){super({slotTemplate:Cm,...e}),this._captionsReady=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",K.CLOSED_CAPTIONS()),km(this)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_SUBTITLES_SHOWING&&km(this)}get mediaSubtitlesList(){return Sm(this,s.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Im(this,s.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Sm(this,s.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Im(this,s.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){this.dispatchEvent(new l.CustomEvent(h.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}))}},Sm=(i,e)=>{let t=i.getAttribute(e);return t?St(t):[]},Im=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let a=$e(t);i.getAttribute(e)!==a&&i.setAttribute(e,a)};l.customElements.get("media-captions-button")||l.customElements.define("media-captions-button",wl);var bf=Object.defineProperty,Ef=(i,e,t)=>e in i?bf(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,gf=(i,e,t)=>(Ef(i,typeof e!="symbol"?e+"":e,t),t),Pl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},_f=(i,e,t)=>(Pl(i,e,"read from private field"),t?t.call(i):e.get(i)),Rl=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Af=(i,e,t,a)=>(Pl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),xl=(i,e,t)=>(Pl(i,e,"access private method"),t),Dn,Dl,wm,xn,Ol,yf=`
401
401
  <svg aria-hidden="true" viewBox="0 0 26 24" part="captions-indicator indicator">
402
402
  <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"/>
403
403
  </svg>`,Rm=m.createElement("template");Rm.innerHTML=ce.template.innerHTML+`
404
- <slot name="captions-indicator" hidden>${yf}</slot>`;var On=class extends ce{constructor(){super(...arguments),Rl(this,Dl),Rl(this,xn),Rl(this,Dn,void 0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_SUBTITLES_LIST,s.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_SUBTITLES_LIST&&t!==a?xl(this,Dl,wm).call(this):e===s.MEDIA_SUBTITLES_SHOWING&&t!==a&&(this.value=a)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",xl(this,xn,Ol))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",xl(this,xn,Ol))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-captions-menu-button")}get mediaSubtitlesList(){return Lm(this,s.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Mm(this,s.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Lm(this,s.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Mm(this,s.MEDIA_SUBTITLES_SHOWING,e)}};Dn=new WeakMap;Dl=new WeakSet;wm=function(){var i;if(_f(this,Dn)===JSON.stringify(this.mediaSubtitlesList))return;Af(this,Dn,JSON.stringify(this.mediaSubtitlesList)),this.defaultSlot.textContent="";let e=!this.value,t=tt({type:"radio",text:this.formatMenuItemText("Off"),value:"off",checked:e});t.prepend($e(this,"checked-indicator")),this.defaultSlot.append(t);let a=this.mediaSubtitlesList;for(let r of a){let n=tt({type:"radio",text:this.formatMenuItemText(r.label,r),value:li(r),checked:this.value==li(r)});n.prepend($e(this,"checked-indicator")),((i=r.kind)!=null?i:"subs")==="captions"&&n.append($e(this,"captions-indicator")),this.defaultSlot.append(n)}};xn=new WeakSet;Ol=function(){let i=this.mediaSubtitlesShowing,e=this.getAttribute(s.MEDIA_SUBTITLES_SHOWING),t=this.value!==e;if(i!=null&&i.length&&t&&this.dispatchEvent(new l.CustomEvent(h.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:i})),!this.value||!t)return;let a=new l.CustomEvent(h.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(a)};gf(On,"template",Rm);var Lm=(i,e)=>{let t=i.getAttribute(e);return t?kt(t):[]},Mm=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let a=He(t);i.getAttribute(e)!==a&&i.setAttribute(e,a)};l.customElements.get("media-captions-menu")||l.customElements.define("media-captions-menu",On);var Tf=`<svg aria-hidden="true" viewBox="0 0 26 24">
404
+ <slot name="captions-indicator" hidden>${yf}</slot>`;var On=class extends ce{constructor(){super(...arguments),Rl(this,Dl),Rl(this,xn),Rl(this,Dn,void 0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_SUBTITLES_LIST,s.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_SUBTITLES_LIST&&t!==a?xl(this,Dl,wm).call(this):e===s.MEDIA_SUBTITLES_SHOWING&&t!==a&&(this.value=a)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",xl(this,xn,Ol))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",xl(this,xn,Ol))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-captions-menu-button")}get mediaSubtitlesList(){return Lm(this,s.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Mm(this,s.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Lm(this,s.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Mm(this,s.MEDIA_SUBTITLES_SHOWING,e)}};Dn=new WeakMap;Dl=new WeakSet;wm=function(){var i;if(_f(this,Dn)===JSON.stringify(this.mediaSubtitlesList))return;Af(this,Dn,JSON.stringify(this.mediaSubtitlesList)),this.defaultSlot.textContent="";let e=!this.value,t=it({type:"radio",text:this.formatMenuItemText("Off"),value:"off",checked:e});t.prepend(Fe(this,"checked-indicator")),this.defaultSlot.append(t);let a=this.mediaSubtitlesList;for(let r of a){let n=it({type:"radio",text:this.formatMenuItemText(r.label,r),value:di(r),checked:this.value==di(r)});n.prepend(Fe(this,"checked-indicator")),((i=r.kind)!=null?i:"subs")==="captions"&&n.append(Fe(this,"captions-indicator")),this.defaultSlot.append(n)}};xn=new WeakSet;Ol=function(){let i=this.mediaSubtitlesShowing,e=this.getAttribute(s.MEDIA_SUBTITLES_SHOWING),t=this.value!==e;if(i!=null&&i.length&&t&&this.dispatchEvent(new l.CustomEvent(h.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:i})),!this.value||!t)return;let a=new l.CustomEvent(h.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(a)};gf(On,"template",Rm);var Lm=(i,e)=>{let t=i.getAttribute(e);return t?St(t):[]},Mm=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let a=$e(t);i.getAttribute(e)!==a&&i.setAttribute(e,a)};l.customElements.get("media-captions-menu")||l.customElements.define("media-captions-menu",On);var Tf=`<svg aria-hidden="true" viewBox="0 0 26 24">
405
405
  <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"/>
406
406
  </svg>`,kf=`<svg aria-hidden="true" viewBox="0 0 26 24">
407
407
  <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"/>
@@ -421,7 +421,7 @@
421
421
  <slot name="on">${Tf}</slot>
422
422
  <slot name="off">${kf}</slot>
423
423
  </slot>
424
- `;var xm=i=>{i.setAttribute("aria-checked",rn(i))},Nl=class extends ke{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_SUBTITLES_LIST,s.MEDIA_SUBTITLES_SHOWING]}constructor(e={}){super({slotTemplate:Pm,...e}),this._captionsReady=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",K.CLOSED_CAPTIONS()),xm(this)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_SUBTITLES_SHOWING&&xm(this)}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:X(this).querySelector("media-captions-menu")}get mediaSubtitlesList(){return Dm(this,s.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Om(this,s.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Dm(this,s.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Om(this,s.MEDIA_SUBTITLES_SHOWING,e)}},Dm=(i,e)=>{let t=i.getAttribute(e);return t?kt(t):[]},Om=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let a=He(t);i.getAttribute(e)!==a&&i.setAttribute(e,a)};l.customElements.get("media-captions-menu-button")||l.customElements.define("media-captions-menu-button",Nl);var Sf='<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/></g></svg>',If='<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/><path class="cast_caf_icon_boxfill" d="M5,7 L5,8.63 C8,8.6 13.37,14 13.37,17 L19,17 L19,7 Z"/></g></svg>',Um=m.createElement("template");Um.innerHTML=`
424
+ `;var xm=i=>{i.setAttribute("aria-checked",rn(i))},Nl=class extends ke{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_SUBTITLES_LIST,s.MEDIA_SUBTITLES_SHOWING]}constructor(e={}){super({slotTemplate:Pm,...e}),this._captionsReady=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",K.CLOSED_CAPTIONS()),xm(this)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_SUBTITLES_SHOWING&&xm(this)}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:X(this).querySelector("media-captions-menu")}get mediaSubtitlesList(){return Dm(this,s.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Om(this,s.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Dm(this,s.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Om(this,s.MEDIA_SUBTITLES_SHOWING,e)}},Dm=(i,e)=>{let t=i.getAttribute(e);return t?St(t):[]},Om=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let a=$e(t);i.getAttribute(e)!==a&&i.setAttribute(e,a)};l.customElements.get("media-captions-menu-button")||l.customElements.define("media-captions-menu-button",Nl);var Sf='<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/></g></svg>',If='<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/><path class="cast_caf_icon_boxfill" d="M5,7 L5,8.63 C8,8.6 13.37,14 13.37,17 L19,17 L19,7 Z"/></g></svg>',Um=m.createElement("template");Um.innerHTML=`
425
425
  <style>
426
426
  :host([${s.MEDIA_IS_CASTING}]) slot:not([name=exit]):not([name=icon]) {
427
427
  display: none !important;
@@ -437,7 +437,7 @@
437
437
  <slot name="enter">${Sf}</slot>
438
438
  <slot name="exit">${If}</slot>
439
439
  </slot>
440
- `;var Nm=i=>{let e=i.mediaIsCasting?Y.EXIT_CAST():Y.ENTER_CAST();i.setAttribute("aria-label",e)},Ul=class extends P{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_CASTING,s.MEDIA_CAST_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Um,...e})}connectedCallback(){super.connectedCallback(),Nm(this)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_IS_CASTING&&Nm(this)}get mediaIsCasting(){return H(this,s.MEDIA_IS_CASTING)}set mediaIsCasting(e){B(this,s.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return I(this,s.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){k(this,s.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){let e=this.mediaIsCasting?h.MEDIA_EXIT_CAST_REQUEST:h.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};l.customElements.get("media-cast-button")||l.customElements.define("media-cast-button",Ul);var Cf=Object.defineProperty,Lf=(i,e,t)=>e in i?Cf(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Mf=(i,e,t)=>(Lf(i,typeof e!="symbol"?e+"":e,t),t),Kl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},qi=(i,e,t)=>(Kl(i,e,"read from private field"),t?t.call(i):e.get(i)),fi=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Bm=(i,e,t,a)=>(Kl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ga=(i,e,t)=>(Kl(i,e,"access private method"),t),qa,bi,Wl,Wm,Hl,Hm,$l,$m,Fl,Fm,Vl,Vm,Km=m.createElement("template");Km.innerHTML=`
440
+ `;var Nm=i=>{let e=i.mediaIsCasting?Y.EXIT_CAST():Y.ENTER_CAST();i.setAttribute("aria-label",e)},Ul=class extends P{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_CASTING,s.MEDIA_CAST_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Um,...e})}connectedCallback(){super.connectedCallback(),Nm(this)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_IS_CASTING&&Nm(this)}get mediaIsCasting(){return H(this,s.MEDIA_IS_CASTING)}set mediaIsCasting(e){B(this,s.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return I(this,s.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){k(this,s.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){let e=this.mediaIsCasting?h.MEDIA_EXIT_CAST_REQUEST:h.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};l.customElements.get("media-cast-button")||l.customElements.define("media-cast-button",Ul);var Cf=Object.defineProperty,Lf=(i,e,t)=>e in i?Cf(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Mf=(i,e,t)=>(Lf(i,typeof e!="symbol"?e+"":e,t),t),Kl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},qi=(i,e,t)=>(Kl(i,e,"read from private field"),t?t.call(i):e.get(i)),bi=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Bm=(i,e,t,a)=>(Kl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ga=(i,e,t)=>(Kl(i,e,"access private method"),t),qa,Ei,Wl,Wm,Hl,Hm,$l,$m,Fl,Fm,Vl,Vm,Km=m.createElement("template");Km.innerHTML=`
441
441
  <style>
442
442
  :host {
443
443
  font: var(--media-font,
@@ -474,7 +474,7 @@
474
474
  }
475
475
  </style>
476
476
  <slot></slot>
477
- `;var Bl={HIDDEN:"hidden",ANCHOR:"anchor"},Pn=class extends l.HTMLElement{constructor(){super(),fi(this,Wl),fi(this,Hl),fi(this,$l),fi(this,Fl),fi(this,Vl),fi(this,qa,void 0),fi(this,bi,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.nativeEl=this.constructor.template.content.cloneNode(!0),this.shadowRoot.append(this.nativeEl)),this.addEventListener("invoke",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this)}static get observedAttributes(){return[Bl.HIDDEN,Bl.ANCHOR]}handleEvent(e){switch(e.type){case"invoke":Ga(this,$l,$m).call(this,e);break;case"focusout":Ga(this,Fl,Fm).call(this,e);break;case"keydown":Ga(this,Vl,Vm).call(this,e);break}}connectedCallback(){this.role||(this.role="dialog")}attributeChangedCallback(e,t,a){e===Bl.HIDDEN&&a!==t&&(this.hidden?Ga(this,Hl,Hm).call(this):Ga(this,Wl,Wm).call(this))}focus(){Bm(this,qa,ri());let e=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');e==null||e.focus()}get keysUsed(){return["Escape","Tab"]}};qa=new WeakMap;bi=new WeakMap;Wl=new WeakSet;Wm=function(){var i;(i=qi(this,bi))==null||i.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0})};Hl=new WeakSet;Hm=function(){var i;(i=qi(this,bi))==null||i.setAttribute("aria-expanded","false")};$l=new WeakSet;$m=function(i){Bm(this,bi,i.relatedTarget),ue(this,i.relatedTarget)||(this.hidden=!this.hidden)};Fl=new WeakSet;Fm=function(i){var e;ue(this,i.relatedTarget)||((e=qi(this,qa))==null||e.focus(),qi(this,bi)&&qi(this,bi)!==i.relatedTarget&&!this.hidden&&(this.hidden=!0))};Vl=new WeakSet;Vm=function(i){var e,t,a,r,n;let{key:o,ctrlKey:d,altKey:u,metaKey:c}=i;d||u||c||this.keysUsed.includes(o)&&(i.preventDefault(),i.stopPropagation(),o==="Tab"?(i.shiftKey?(t=(e=this.previousElementSibling)==null?void 0:e.focus)==null||t.call(e):(r=(a=this.nextElementSibling)==null?void 0:a.focus)==null||r.call(a),this.blur()):o==="Escape"&&((n=qi(this,qa))==null||n.focus(),this.hidden=!0))};Mf(Pn,"template",Km);l.customElements.get("media-chrome-dialog")||l.customElements.define("media-chrome-dialog",Pn);var wf=Object.defineProperty,Rf=(i,e,t)=>e in i?wf(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,xf=(i,e,t)=>(Rf(i,typeof e!="symbol"?e+"":e,t),t),zl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},at=(i,e,t)=>(zl(i,e,"read from private field"),t?t.call(i):e.get(i)),Ct=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Yl=(i,e,t,a)=>(zl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),it=(i,e,t)=>(zl(i,e,"access private method"),t),Nn,Qa,Gl,Ym,Xl,Gm,Jl,qm,rt,Zi,za,ql,Zm,Un,Zl,Qm=m.createElement("template");Qm.innerHTML=`
477
+ `;var Bl={HIDDEN:"hidden",ANCHOR:"anchor"},Pn=class extends l.HTMLElement{constructor(){super(),bi(this,Wl),bi(this,Hl),bi(this,$l),bi(this,Fl),bi(this,Vl),bi(this,qa,void 0),bi(this,Ei,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.nativeEl=this.constructor.template.content.cloneNode(!0),this.shadowRoot.append(this.nativeEl)),this.addEventListener("invoke",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this)}static get observedAttributes(){return[Bl.HIDDEN,Bl.ANCHOR]}handleEvent(e){switch(e.type){case"invoke":Ga(this,$l,$m).call(this,e);break;case"focusout":Ga(this,Fl,Fm).call(this,e);break;case"keydown":Ga(this,Vl,Vm).call(this,e);break}}connectedCallback(){this.role||(this.role="dialog")}attributeChangedCallback(e,t,a){e===Bl.HIDDEN&&a!==t&&(this.hidden?Ga(this,Hl,Hm).call(this):Ga(this,Wl,Wm).call(this))}focus(){Bm(this,qa,ni());let e=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');e==null||e.focus()}get keysUsed(){return["Escape","Tab"]}};qa=new WeakMap;Ei=new WeakMap;Wl=new WeakSet;Wm=function(){var i;(i=qi(this,Ei))==null||i.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0})};Hl=new WeakSet;Hm=function(){var i;(i=qi(this,Ei))==null||i.setAttribute("aria-expanded","false")};$l=new WeakSet;$m=function(i){Bm(this,Ei,i.relatedTarget),ue(this,i.relatedTarget)||(this.hidden=!this.hidden)};Fl=new WeakSet;Fm=function(i){var e;ue(this,i.relatedTarget)||((e=qi(this,qa))==null||e.focus(),qi(this,Ei)&&qi(this,Ei)!==i.relatedTarget&&!this.hidden&&(this.hidden=!0))};Vl=new WeakSet;Vm=function(i){var e,t,a,r,n;let{key:o,ctrlKey:d,altKey:u,metaKey:c}=i;d||u||c||this.keysUsed.includes(o)&&(i.preventDefault(),i.stopPropagation(),o==="Tab"?(i.shiftKey?(t=(e=this.previousElementSibling)==null?void 0:e.focus)==null||t.call(e):(r=(a=this.nextElementSibling)==null?void 0:a.focus)==null||r.call(a),this.blur()):o==="Escape"&&((n=qi(this,qa))==null||n.focus(),this.hidden=!0))};Mf(Pn,"template",Km);l.customElements.get("media-chrome-dialog")||l.customElements.define("media-chrome-dialog",Pn);var wf=Object.defineProperty,Rf=(i,e,t)=>e in i?wf(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,xf=(i,e,t)=>(Rf(i,typeof e!="symbol"?e+"":e,t),t),zl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},rt=(i,e,t)=>(zl(i,e,"read from private field"),t?t.call(i):e.get(i)),Lt=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Yl=(i,e,t,a)=>(zl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),at=(i,e,t)=>(zl(i,e,"access private method"),t),Nn,Qa,Gl,Ym,Xl,Gm,Jl,qm,nt,Zi,za,ql,Zm,Un,Zl,Qm=m.createElement("template");Qm.innerHTML=`
478
478
  <style>
479
479
  :host {
480
480
  transition: var(--media-menu-item-transition,
@@ -590,7 +590,7 @@
590
590
  <slot name="description"></slot>
591
591
  <slot name="suffix"></slot>
592
592
  <slot name="submenu"></slot>
593
- `;var Re={TYPE:"type",VALUE:"value",CHECKED:"checked",DISABLED:"disabled"},Ei=class extends l.HTMLElement{constructor(){super(),Ct(this,Gl),Ct(this,Xl),Ct(this,Jl),Ct(this,Zi),Ct(this,ql),Ct(this,Un),Ct(this,Nn,!1),Ct(this,Qa,void 0),Ct(this,rt,()=>{var e,t;this.setAttribute("submenusize",`${this.submenuElement.items.length}`);let a=this.shadowRoot.querySelector('slot[name="description"]'),r=(t=(e=this.submenuElement.checkedItems)==null?void 0:e[0])==null?void 0:t.text,n=m.createElement("span");n.textContent=r!=null?r:"",a.replaceChildren(n)}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.append(this.constructor.template.content.cloneNode(!0))),this.shadowRoot.addEventListener("slotchange",this)}static get observedAttributes(){return[Re.TYPE,Re.DISABLED,Re.CHECKED,Re.VALUE]}enable(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","-1"),Za(this)&&!this.hasAttribute("aria-checked")&&this.setAttribute("aria-checked","false"),this.addEventListener("click",this),this.addEventListener("keydown",this)}disable(){this.removeAttribute("tabindex"),this.removeEventListener("click",this),this.removeEventListener("keydown",this),this.removeEventListener("keyup",this)}handleEvent(e){switch(e.type){case"slotchange":it(this,Gl,Ym).call(this,e);break;case"click":this.handleClick(e);break;case"keydown":it(this,ql,Zm).call(this,e);break;case"keyup":it(this,Zi,za).call(this,e);break}}attributeChangedCallback(e,t,a){e===Re.CHECKED&&Za(this)&&!at(this,Nn)?this.setAttribute("aria-checked",a!=null?"true":"false"):e===Re.TYPE&&a!==t?this.role="menuitem"+a:e===Re.DISABLED&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(Re.DISABLED)||this.enable(),this.role="menuitem"+this.type,Yl(this,Qa,Ql(this,this.parentNode)),it(this,Un,Zl).call(this)}disconnectedCallback(){this.disable(),it(this,Un,Zl).call(this),Yl(this,Qa,null)}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=ni(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):this.submenuElement}get submenuElement(){return this.shadowRoot.querySelector('slot[name="submenu"]').assignedElements({flatten:!0})[0]}get type(){var e;return(e=this.getAttribute(Re.TYPE))!=null?e:""}set type(e){this.setAttribute(Re.TYPE,`${e}`)}get value(){var e;return(e=this.getAttribute(Re.VALUE))!=null?e:this.text}set value(e){this.setAttribute(Re.VALUE,e)}get text(){var e;return((e=this.textContent)!=null?e:"").trim()}get checked(){if(Za(this))return this.getAttribute("aria-checked")==="true"}set checked(e){Za(this)&&(Yl(this,Nn,!0),this.setAttribute("aria-checked",e?"true":"false"),e?this.part.add("checked"):this.part.remove("checked"))}handleClick(e){Za(this)||this.invokeTargetElement&&ue(this,e.target)&&this.invokeTargetElement.dispatchEvent(new $t({relatedTarget:this}))}get keysUsed(){return["Enter"," "]}};Nn=new WeakMap;Qa=new WeakMap;Gl=new WeakSet;Ym=function(i){let e=i.target;if(!(e!=null&&e.name))for(let a of e.assignedNodes({flatten:!0}))a instanceof Text&&a.textContent.trim()===""&&a.remove();e.name==="submenu"&&(this.submenuElement?it(this,Xl,Gm).call(this):it(this,Jl,qm).call(this))};Xl=new WeakSet;Gm=async function(){this.setAttribute("aria-haspopup","menu"),this.setAttribute("aria-expanded",`${!this.submenuElement.hidden}`),this.submenuElement.addEventListener("change",at(this,rt)),this.submenuElement.addEventListener("addmenuitem",at(this,rt)),this.submenuElement.addEventListener("removemenuitem",at(this,rt)),at(this,rt).call(this)};Jl=new WeakSet;qm=function(){this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.submenuElement.removeEventListener("change",at(this,rt)),this.submenuElement.removeEventListener("addmenuitem",at(this,rt)),this.submenuElement.removeEventListener("removemenuitem",at(this,rt)),at(this,rt).call(this)};rt=new WeakMap;Zi=new WeakSet;za=function(i){let{key:e}=i;if(!this.keysUsed.includes(e)){this.removeEventListener("keyup",it(this,Zi,za));return}this.handleClick(i)};ql=new WeakSet;Zm=function(i){let{metaKey:e,altKey:t,key:a}=i;if(e||t||!this.keysUsed.includes(a)){this.removeEventListener("keyup",it(this,Zi,za));return}this.addEventListener("keyup",it(this,Zi,za),{once:!0})};Un=new WeakSet;Zl=function(){var i;let e=(i=at(this,Qa))==null?void 0:i.radioGroupItems;if(!e)return;let t=e.filter(a=>a.getAttribute("aria-checked")==="true").pop();t||(t=e[0]);for(let a of e)a.setAttribute("aria-checked","false");t==null||t.setAttribute("aria-checked","true")};xf(Ei,"template",Qm);function Za(i){return i.type==="radio"||i.type==="checkbox"}function Ql(i,e){if(!i)return null;let{host:t}=i.getRootNode();return!e&&t?Ql(i,t):e!=null&&e.items?e:Ql(e,e==null?void 0:e.parentNode)}l.customElements.get("media-chrome-menu-item")||l.customElements.define("media-chrome-menu-item",Ei);var nd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Q=(i,e,t)=>(nd(i,e,"read from private field"),t?t.call(i):e.get(i)),le=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Vt=(i,e,t,a)=>(nd(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Fe=(i,e,t)=>(nd(i,e,"access private method"),t),nt,qn,Bn,Wn,Ve,Yn,Hn,$n,Fn,sd,zm,Vn,jl,Kn,ed,Gn,od,td,Xm,id,Jm,ad,jm,rd,eh,th=m.createElement("template");th.innerHTML=`
593
+ `;var xe={TYPE:"type",VALUE:"value",CHECKED:"checked",DISABLED:"disabled"},gi=class extends l.HTMLElement{constructor(){super(),Lt(this,Gl),Lt(this,Xl),Lt(this,Jl),Lt(this,Zi),Lt(this,ql),Lt(this,Un),Lt(this,Nn,!1),Lt(this,Qa,void 0),Lt(this,nt,()=>{var e,t;this.setAttribute("submenusize",`${this.submenuElement.items.length}`);let a=this.shadowRoot.querySelector('slot[name="description"]'),r=(t=(e=this.submenuElement.checkedItems)==null?void 0:e[0])==null?void 0:t.text,n=m.createElement("span");n.textContent=r!=null?r:"",a.replaceChildren(n)}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.append(this.constructor.template.content.cloneNode(!0))),this.shadowRoot.addEventListener("slotchange",this)}static get observedAttributes(){return[xe.TYPE,xe.DISABLED,xe.CHECKED,xe.VALUE]}enable(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","-1"),Za(this)&&!this.hasAttribute("aria-checked")&&this.setAttribute("aria-checked","false"),this.addEventListener("click",this),this.addEventListener("keydown",this)}disable(){this.removeAttribute("tabindex"),this.removeEventListener("click",this),this.removeEventListener("keydown",this),this.removeEventListener("keyup",this)}handleEvent(e){switch(e.type){case"slotchange":at(this,Gl,Ym).call(this,e);break;case"click":this.handleClick(e);break;case"keydown":at(this,ql,Zm).call(this,e);break;case"keyup":at(this,Zi,za).call(this,e);break}}attributeChangedCallback(e,t,a){e===xe.CHECKED&&Za(this)&&!rt(this,Nn)?this.setAttribute("aria-checked",a!=null?"true":"false"):e===xe.TYPE&&a!==t?this.role="menuitem"+a:e===xe.DISABLED&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(xe.DISABLED)||this.enable(),this.role="menuitem"+this.type,Yl(this,Qa,Ql(this,this.parentNode)),at(this,Un,Zl).call(this)}disconnectedCallback(){this.disable(),at(this,Un,Zl).call(this),Yl(this,Qa,null)}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=si(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):this.submenuElement}get submenuElement(){return this.shadowRoot.querySelector('slot[name="submenu"]').assignedElements({flatten:!0})[0]}get type(){var e;return(e=this.getAttribute(xe.TYPE))!=null?e:""}set type(e){this.setAttribute(xe.TYPE,`${e}`)}get value(){var e;return(e=this.getAttribute(xe.VALUE))!=null?e:this.text}set value(e){this.setAttribute(xe.VALUE,e)}get text(){var e;return((e=this.textContent)!=null?e:"").trim()}get checked(){if(Za(this))return this.getAttribute("aria-checked")==="true"}set checked(e){Za(this)&&(Yl(this,Nn,!0),this.setAttribute("aria-checked",e?"true":"false"),e?this.part.add("checked"):this.part.remove("checked"))}handleClick(e){Za(this)||this.invokeTargetElement&&ue(this,e.target)&&this.invokeTargetElement.dispatchEvent(new $t({relatedTarget:this}))}get keysUsed(){return["Enter"," "]}};Nn=new WeakMap;Qa=new WeakMap;Gl=new WeakSet;Ym=function(i){let e=i.target;if(!(e!=null&&e.name))for(let a of e.assignedNodes({flatten:!0}))a instanceof Text&&a.textContent.trim()===""&&a.remove();e.name==="submenu"&&(this.submenuElement?at(this,Xl,Gm).call(this):at(this,Jl,qm).call(this))};Xl=new WeakSet;Gm=async function(){this.setAttribute("aria-haspopup","menu"),this.setAttribute("aria-expanded",`${!this.submenuElement.hidden}`),this.submenuElement.addEventListener("change",rt(this,nt)),this.submenuElement.addEventListener("addmenuitem",rt(this,nt)),this.submenuElement.addEventListener("removemenuitem",rt(this,nt)),rt(this,nt).call(this)};Jl=new WeakSet;qm=function(){this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.submenuElement.removeEventListener("change",rt(this,nt)),this.submenuElement.removeEventListener("addmenuitem",rt(this,nt)),this.submenuElement.removeEventListener("removemenuitem",rt(this,nt)),rt(this,nt).call(this)};nt=new WeakMap;Zi=new WeakSet;za=function(i){let{key:e}=i;if(!this.keysUsed.includes(e)){this.removeEventListener("keyup",at(this,Zi,za));return}this.handleClick(i)};ql=new WeakSet;Zm=function(i){let{metaKey:e,altKey:t,key:a}=i;if(e||t||!this.keysUsed.includes(a)){this.removeEventListener("keyup",at(this,Zi,za));return}this.addEventListener("keyup",at(this,Zi,za),{once:!0})};Un=new WeakSet;Zl=function(){var i;let e=(i=rt(this,Qa))==null?void 0:i.radioGroupItems;if(!e)return;let t=e.filter(a=>a.getAttribute("aria-checked")==="true").pop();t||(t=e[0]);for(let a of e)a.setAttribute("aria-checked","false");t==null||t.setAttribute("aria-checked","true")};xf(gi,"template",Qm);function Za(i){return i.type==="radio"||i.type==="checkbox"}function Ql(i,e){if(!i)return null;let{host:t}=i.getRootNode();return!e&&t?Ql(i,t):e!=null&&e.items?e:Ql(e,e==null?void 0:e.parentNode)}l.customElements.get("media-chrome-menu-item")||l.customElements.define("media-chrome-menu-item",gi);var nd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Q=(i,e,t)=>(nd(i,e,"read from private field"),t?t.call(i):e.get(i)),le=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Vt=(i,e,t,a)=>(nd(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ve=(i,e,t)=>(nd(i,e,"access private method"),t),st,qn,Bn,Wn,Ke,Yn,Hn,$n,Fn,sd,zm,Vn,jl,Kn,ed,Gn,od,td,Xm,id,Jm,ad,jm,rd,eh,th=m.createElement("template");th.innerHTML=`
594
594
  <style>
595
595
  :host {
596
596
  --_focus-box-shadow: var(--media-focus-box-shadow, inset 0 0 0 2px rgb(27 127 204 / .9));
@@ -826,7 +826,7 @@
826
826
  <input id="range" type="range" min="0" max="1" step="any" value="0">
827
827
  </div>
828
828
  <div id="rightgap"></div>
829
- `;var gi=class extends l.HTMLElement{constructor(){super(),le(this,sd),le(this,Vn),le(this,Kn),le(this,Gn),le(this,td),le(this,id),le(this,ad),le(this,rd),le(this,nt,void 0),le(this,qn,void 0),le(this,Bn,void 0),le(this,Wn,void 0),le(this,Ve,{}),le(this,Yn,[]),le(this,Hn,()=>{if(this.range.matches(":focus-visible")){let{style:e}=N(this.shadowRoot,":host");e.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),le(this,$n,()=>{let{style:e}=N(this.shadowRoot,":host");e.removeProperty("--_focus-visible-box-shadow")}),le(this,Fn,()=>{let e=this.shadowRoot.querySelector("#segments-clipping");e&&e.parentNode.append(e)}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(th.content.cloneNode(!0))),this.container=this.shadowRoot.querySelector("#container"),Vt(this,Bn,this.shadowRoot.querySelector("#startpoint")),Vt(this,Wn,this.shadowRoot.querySelector("#endpoint")),this.range=this.shadowRoot.querySelector("#range"),this.appearance=this.shadowRoot.querySelector("#appearance")}static get observedAttributes(){return["disabled","aria-disabled",y.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n,o,d,u;e===y.MEDIA_CONTROLLER?(t&&((n=(r=Q(this,nt))==null?void 0:r.unassociateElement)==null||n.call(r,this),Vt(this,nt,null)),a&&this.isConnected&&(Vt(this,nt,(o=this.getRootNode())==null?void 0:o.getElementById(a)),(u=(d=Q(this,nt))==null?void 0:d.associateElement)==null||u.call(d,this))):(e==="disabled"||e==="aria-disabled"&&t!==a)&&(a==null?(this.range.removeAttribute(e),Fe(this,Vn,jl).call(this)):(this.range.setAttribute(e,a),Fe(this,Kn,ed).call(this)))}connectedCallback(){var e,t,a;let{style:r}=N(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),Q(this,Ve).pointer=N(this.shadowRoot,"#pointer"),Q(this,Ve).progress=N(this.shadowRoot,"#progress"),Q(this,Ve).thumb=N(this.shadowRoot,"#thumb");let n=this.getAttribute(y.MEDIA_CONTROLLER);n&&(Vt(this,nt,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(t=Q(this,nt))==null?void 0:t.associateElement)==null||a.call(t,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",Q(this,Hn)),this.shadowRoot.addEventListener("focusout",Q(this,$n)),Fe(this,Vn,jl).call(this),Le(this.container,Q(this,Fn))}disconnectedCallback(){var e,t;Fe(this,Kn,ed).call(this),(t=(e=Q(this,nt))==null?void 0:e.unassociateElement)==null||t.call(e,this),Vt(this,nt,null),this.shadowRoot.removeEventListener("focusin",Q(this,Hn)),this.shadowRoot.removeEventListener("focusout",Q(this,$n)),Xe(this.container,Q(this,Fn))}updatePointerBar(e){var t;(t=Q(this,Ve).pointer)==null||t.style.setProperty("width",`${this.getPointerRatio(e)*100}%`)}updateBar(){var e,t;let a=this.range.valueAsNumber*100;(e=Q(this,Ve).progress)==null||e.style.setProperty("width",`${a}%`),(t=Q(this,Ve).thumb)==null||t.style.setProperty("left",`${a}%`)}updateSegments(e){let t=this.shadowRoot.querySelector("#segments-clipping");if(t.textContent="",this.container.classList.toggle("segments",!!(e!=null&&e.length)),!(e!=null&&e.length))return;Q(this,Ve).activeSegment=Ko(this.shadowRoot,"#segments-clipping rect:nth-child(0)");let a=[...new Set([+this.range.min,...e.flatMap(n=>[n.start,n.end]),+this.range.max])];Vt(this,Yn,[...a]);let r=a.pop();for(let[n,o]of a.entries()){let[d,u]=[n===0,n===a.length-1],c=d?"calc(var(--segments-gap) / -1)":`${o*100}%`,E=`calc(${((u?r:a[n+1])-o)*100}%${d||u?"":" - var(--segments-gap)"})`,v=m.createElementNS("http://www.w3.org/2000/svg","rect"),b=N(this.shadowRoot,`#segments-clipping rect:nth-child(${n+1})`);b.style.setProperty("x",c),b.style.setProperty("width",E),t.append(v)}}getPointerRatio(e){let t=xc(e.clientX,e.clientY,Q(this,Bn).getBoundingClientRect(),Q(this,Wn).getBoundingClientRect());return Math.max(0,Math.min(1,t))}get dragging(){return this.hasAttribute("dragging")}handleEvent(e){switch(e.type){case"pointermove":Fe(this,rd,eh).call(this,e);break;case"input":this.updateBar();break;case"pointerenter":Fe(this,td,Xm).call(this,e);break;case"pointerdown":Fe(this,Gn,od).call(this,e);break;case"pointerup":Fe(this,id,Jm).call(this);break;case"pointerleave":Fe(this,ad,jm).call(this);break}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};nt=new WeakMap;qn=new WeakMap;Bn=new WeakMap;Wn=new WeakMap;Ve=new WeakMap;Yn=new WeakMap;Hn=new WeakMap;$n=new WeakMap;Fn=new WeakMap;sd=new WeakSet;zm=function(i){let e=Q(this,Ve).activeSegment;if(!e)return;let t=this.getPointerRatio(i),r=`#segments-clipping rect:nth-child(${Q(this,Yn).findIndex((n,o,d)=>{let u=d[o+1];return u!=null&&t>=n&&t<=u})+1})`;(e.selectorText!=r||!e.style.transform)&&(e.selectorText=r,e.style.setProperty("transform","var(--media-range-segment-hover-transform, scaleY(2))"))};Vn=new WeakSet;jl=function(){this.hasAttribute("disabled")||(this.addEventListener("input",this),this.addEventListener("pointerdown",this),this.addEventListener("pointerenter",this))};Kn=new WeakSet;ed=function(){var i,e;this.removeEventListener("input",this),this.removeEventListener("pointerdown",this),this.removeEventListener("pointerenter",this),(i=l.window)==null||i.removeEventListener("pointerup",this),(e=l.window)==null||e.removeEventListener("pointermove",this)};Gn=new WeakSet;od=function(i){var e;Vt(this,qn,i.composedPath().includes(this.range)),(e=l.window)==null||e.addEventListener("pointerup",this)};td=new WeakSet;Xm=function(i){var e;i.pointerType!=="mouse"&&Fe(this,Gn,od).call(this,i),this.addEventListener("pointerleave",this),(e=l.window)==null||e.addEventListener("pointermove",this)};id=new WeakSet;Jm=function(){var i;(i=l.window)==null||i.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};ad=new WeakSet;jm=function(){var i,e;this.removeEventListener("pointerleave",this),(i=l.window)==null||i.removeEventListener("pointermove",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled"),(e=Q(this,Ve).activeSegment)==null||e.style.removeProperty("transform")};rd=new WeakSet;eh=function(i){this.toggleAttribute("dragging",i.buttons===1||i.pointerType!=="mouse"),this.updatePointerBar(i),Fe(this,sd,zm).call(this,i),this.dragging&&(i.pointerType!=="mouse"||!Q(this,qn))&&(this.range.disabled=!0,this.range.valueAsNumber=this.getPointerRatio(i),this.range.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})))};l.customElements.get("media-chrome-range")||l.customElements.define("media-chrome-range",gi);var ih=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Zn=(i,e,t)=>(ih(i,e,"read from private field"),t?t.call(i):e.get(i)),Df=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Qn=(i,e,t,a)=>(ih(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),st,ah=m.createElement("template");ah.innerHTML=`
829
+ `;var _i=class extends l.HTMLElement{constructor(){super(),le(this,sd),le(this,Vn),le(this,Kn),le(this,Gn),le(this,td),le(this,id),le(this,ad),le(this,rd),le(this,st,void 0),le(this,qn,void 0),le(this,Bn,void 0),le(this,Wn,void 0),le(this,Ke,{}),le(this,Yn,[]),le(this,Hn,()=>{if(this.range.matches(":focus-visible")){let{style:e}=N(this.shadowRoot,":host");e.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),le(this,$n,()=>{let{style:e}=N(this.shadowRoot,":host");e.removeProperty("--_focus-visible-box-shadow")}),le(this,Fn,()=>{let e=this.shadowRoot.querySelector("#segments-clipping");e&&e.parentNode.append(e)}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(th.content.cloneNode(!0))),this.container=this.shadowRoot.querySelector("#container"),Vt(this,Bn,this.shadowRoot.querySelector("#startpoint")),Vt(this,Wn,this.shadowRoot.querySelector("#endpoint")),this.range=this.shadowRoot.querySelector("#range"),this.appearance=this.shadowRoot.querySelector("#appearance")}static get observedAttributes(){return["disabled","aria-disabled",y.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n,o,d,u;e===y.MEDIA_CONTROLLER?(t&&((n=(r=Q(this,st))==null?void 0:r.unassociateElement)==null||n.call(r,this),Vt(this,st,null)),a&&this.isConnected&&(Vt(this,st,(o=this.getRootNode())==null?void 0:o.getElementById(a)),(u=(d=Q(this,st))==null?void 0:d.associateElement)==null||u.call(d,this))):(e==="disabled"||e==="aria-disabled"&&t!==a)&&(a==null?(this.range.removeAttribute(e),Ve(this,Vn,jl).call(this)):(this.range.setAttribute(e,a),Ve(this,Kn,ed).call(this)))}connectedCallback(){var e,t,a;let{style:r}=N(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),Q(this,Ke).pointer=N(this.shadowRoot,"#pointer"),Q(this,Ke).progress=N(this.shadowRoot,"#progress"),Q(this,Ke).thumb=N(this.shadowRoot,"#thumb");let n=this.getAttribute(y.MEDIA_CONTROLLER);n&&(Vt(this,st,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(t=Q(this,st))==null?void 0:t.associateElement)==null||a.call(t,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",Q(this,Hn)),this.shadowRoot.addEventListener("focusout",Q(this,$n)),Ve(this,Vn,jl).call(this),Me(this.container,Q(this,Fn))}disconnectedCallback(){var e,t;Ve(this,Kn,ed).call(this),(t=(e=Q(this,st))==null?void 0:e.unassociateElement)==null||t.call(e,this),Vt(this,st,null),this.shadowRoot.removeEventListener("focusin",Q(this,Hn)),this.shadowRoot.removeEventListener("focusout",Q(this,$n)),Je(this.container,Q(this,Fn))}updatePointerBar(e){var t;(t=Q(this,Ke).pointer)==null||t.style.setProperty("width",`${this.getPointerRatio(e)*100}%`)}updateBar(){var e,t;let a=this.range.valueAsNumber*100;(e=Q(this,Ke).progress)==null||e.style.setProperty("width",`${a}%`),(t=Q(this,Ke).thumb)==null||t.style.setProperty("left",`${a}%`)}updateSegments(e){let t=this.shadowRoot.querySelector("#segments-clipping");if(t.textContent="",this.container.classList.toggle("segments",!!(e!=null&&e.length)),!(e!=null&&e.length))return;Q(this,Ke).activeSegment=Ko(this.shadowRoot,"#segments-clipping rect:nth-child(0)");let a=[...new Set([+this.range.min,...e.flatMap(n=>[n.start,n.end]),+this.range.max])];Vt(this,Yn,[...a]);let r=a.pop();for(let[n,o]of a.entries()){let[d,u]=[n===0,n===a.length-1],c=d?"calc(var(--segments-gap) / -1)":`${o*100}%`,g=`calc(${((u?r:a[n+1])-o)*100}%${d||u?"":" - var(--segments-gap)"})`,v=m.createElementNS("http://www.w3.org/2000/svg","rect"),b=N(this.shadowRoot,`#segments-clipping rect:nth-child(${n+1})`);b.style.setProperty("x",c),b.style.setProperty("width",g),t.append(v)}}getPointerRatio(e){let t=xc(e.clientX,e.clientY,Q(this,Bn).getBoundingClientRect(),Q(this,Wn).getBoundingClientRect());return Math.max(0,Math.min(1,t))}get dragging(){return this.hasAttribute("dragging")}handleEvent(e){switch(e.type){case"pointermove":Ve(this,rd,eh).call(this,e);break;case"input":this.updateBar();break;case"pointerenter":Ve(this,td,Xm).call(this,e);break;case"pointerdown":Ve(this,Gn,od).call(this,e);break;case"pointerup":Ve(this,id,Jm).call(this);break;case"pointerleave":Ve(this,ad,jm).call(this);break}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};st=new WeakMap;qn=new WeakMap;Bn=new WeakMap;Wn=new WeakMap;Ke=new WeakMap;Yn=new WeakMap;Hn=new WeakMap;$n=new WeakMap;Fn=new WeakMap;sd=new WeakSet;zm=function(i){let e=Q(this,Ke).activeSegment;if(!e)return;let t=this.getPointerRatio(i),r=`#segments-clipping rect:nth-child(${Q(this,Yn).findIndex((n,o,d)=>{let u=d[o+1];return u!=null&&t>=n&&t<=u})+1})`;(e.selectorText!=r||!e.style.transform)&&(e.selectorText=r,e.style.setProperty("transform","var(--media-range-segment-hover-transform, scaleY(2))"))};Vn=new WeakSet;jl=function(){this.hasAttribute("disabled")||(this.addEventListener("input",this),this.addEventListener("pointerdown",this),this.addEventListener("pointerenter",this))};Kn=new WeakSet;ed=function(){var i,e;this.removeEventListener("input",this),this.removeEventListener("pointerdown",this),this.removeEventListener("pointerenter",this),(i=l.window)==null||i.removeEventListener("pointerup",this),(e=l.window)==null||e.removeEventListener("pointermove",this)};Gn=new WeakSet;od=function(i){var e;Vt(this,qn,i.composedPath().includes(this.range)),(e=l.window)==null||e.addEventListener("pointerup",this)};td=new WeakSet;Xm=function(i){var e;i.pointerType!=="mouse"&&Ve(this,Gn,od).call(this,i),this.addEventListener("pointerleave",this),(e=l.window)==null||e.addEventListener("pointermove",this)};id=new WeakSet;Jm=function(){var i;(i=l.window)==null||i.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};ad=new WeakSet;jm=function(){var i,e;this.removeEventListener("pointerleave",this),(i=l.window)==null||i.removeEventListener("pointermove",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled"),(e=Q(this,Ke).activeSegment)==null||e.style.removeProperty("transform")};rd=new WeakSet;eh=function(i){this.toggleAttribute("dragging",i.buttons===1||i.pointerType!=="mouse"),this.updatePointerBar(i),Ve(this,sd,zm).call(this,i),this.dragging&&(i.pointerType!=="mouse"||!Q(this,qn))&&(this.range.disabled=!0,this.range.valueAsNumber=this.getPointerRatio(i),this.range.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})))};l.customElements.get("media-chrome-range")||l.customElements.define("media-chrome-range",_i);var ih=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Zn=(i,e,t)=>(ih(i,e,"read from private field"),t?t.call(i):e.get(i)),Df=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Qn=(i,e,t,a)=>(ih(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ot,ah=m.createElement("template");ah.innerHTML=`
830
830
  <style>
831
831
  :host {
832
832
 
@@ -848,7 +848,7 @@
848
848
  </style>
849
849
 
850
850
  <slot></slot>
851
- `;var ld=class extends l.HTMLElement{constructor(){super(),Df(this,st,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(ah.content.cloneNode(!0)))}static get observedAttributes(){return[y.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n,o,d,u;e===y.MEDIA_CONTROLLER&&(t&&((n=(r=Zn(this,st))==null?void 0:r.unassociateElement)==null||n.call(r,this),Qn(this,st,null)),a&&this.isConnected&&(Qn(this,st,(o=this.getRootNode())==null?void 0:o.getElementById(a)),(u=(d=Zn(this,st))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(y.MEDIA_CONTROLLER);r&&(Qn(this,st,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=Zn(this,st))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Zn(this,st))==null?void 0:e.unassociateElement)==null||t.call(e,this),Qn(this,st,null)}};st=new WeakMap;l.customElements.get("media-control-bar")||l.customElements.define("media-control-bar",ld);var rh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},zn=(i,e,t)=>(rh(i,e,"read from private field"),t?t.call(i):e.get(i)),Of=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Xn=(i,e,t,a)=>(rh(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ot,nh=m.createElement("template");nh.innerHTML=`
851
+ `;var ld=class extends l.HTMLElement{constructor(){super(),Df(this,ot,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(ah.content.cloneNode(!0)))}static get observedAttributes(){return[y.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n,o,d,u;e===y.MEDIA_CONTROLLER&&(t&&((n=(r=Zn(this,ot))==null?void 0:r.unassociateElement)==null||n.call(r,this),Qn(this,ot,null)),a&&this.isConnected&&(Qn(this,ot,(o=this.getRootNode())==null?void 0:o.getElementById(a)),(u=(d=Zn(this,ot))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(y.MEDIA_CONTROLLER);r&&(Qn(this,ot,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=Zn(this,ot))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Zn(this,ot))==null?void 0:e.unassociateElement)==null||t.call(e,this),Qn(this,ot,null)}};ot=new WeakMap;l.customElements.get("media-control-bar")||l.customElements.define("media-control-bar",ld);var rh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},zn=(i,e,t)=>(rh(i,e,"read from private field"),t?t.call(i):e.get(i)),Of=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Xn=(i,e,t,a)=>(rh(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),lt,nh=m.createElement("template");nh.innerHTML=`
852
852
  <style>
853
853
  :host {
854
854
  font: var(--media-font,
@@ -881,7 +881,7 @@
881
881
  }
882
882
  </style>
883
883
  <slot></slot>
884
- `;var lt=class extends l.HTMLElement{constructor(){super(),Of(this,ot,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(nh.content.cloneNode(!0)))}static get observedAttributes(){return[y.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n,o,d,u;e===y.MEDIA_CONTROLLER&&(t&&((n=(r=zn(this,ot))==null?void 0:r.unassociateElement)==null||n.call(r,this),Xn(this,ot,null)),a&&this.isConnected&&(Xn(this,ot,(o=this.getRootNode())==null?void 0:o.getElementById(a)),(u=(d=zn(this,ot))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,t,a;let{style:r}=N(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`);let n=this.getAttribute(y.MEDIA_CONTROLLER);n&&(Xn(this,ot,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(t=zn(this,ot))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=zn(this,ot))==null?void 0:e.unassociateElement)==null||t.call(e,this),Xn(this,ot,null)}};ot=new WeakMap;l.customElements.get("media-text-display")||l.customElements.define("media-text-display",lt);var sh=lt;var lh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},oh=(i,e,t)=>(lh(i,e,"read from private field"),t?t.call(i):e.get(i)),Pf=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Nf=(i,e,t,a)=>(lh(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Xa,dd=class extends lt{constructor(){super(),Pf(this,Xa,void 0),Nf(this,Xa,this.shadowRoot.querySelector("slot")),oh(this,Xa).textContent=ze(0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_DURATION]}attributeChangedCallback(e,t,a){e===s.MEDIA_DURATION&&(oh(this,Xa).textContent=ze(+a)),super.attributeChangedCallback(e,t,a)}get mediaDuration(){return x(this,s.MEDIA_DURATION)}set mediaDuration(e){U(this,s.MEDIA_DURATION,e)}};Xa=new WeakMap;l.customElements.get("media-duration-display")||l.customElements.define("media-duration-display",dd);var Uf=`<svg aria-hidden="true" viewBox="0 0 26 24">
884
+ `;var dt=class extends l.HTMLElement{constructor(){super(),Of(this,lt,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(nh.content.cloneNode(!0)))}static get observedAttributes(){return[y.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n,o,d,u;e===y.MEDIA_CONTROLLER&&(t&&((n=(r=zn(this,lt))==null?void 0:r.unassociateElement)==null||n.call(r,this),Xn(this,lt,null)),a&&this.isConnected&&(Xn(this,lt,(o=this.getRootNode())==null?void 0:o.getElementById(a)),(u=(d=zn(this,lt))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,t,a;let{style:r}=N(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`);let n=this.getAttribute(y.MEDIA_CONTROLLER);n&&(Xn(this,lt,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(t=zn(this,lt))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=zn(this,lt))==null?void 0:e.unassociateElement)==null||t.call(e,this),Xn(this,lt,null)}};lt=new WeakMap;l.customElements.get("media-text-display")||l.customElements.define("media-text-display",dt);var sh=dt;var lh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},oh=(i,e,t)=>(lh(i,e,"read from private field"),t?t.call(i):e.get(i)),Pf=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Nf=(i,e,t,a)=>(lh(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Xa,dd=class extends dt{constructor(){super(),Pf(this,Xa,void 0),Nf(this,Xa,this.shadowRoot.querySelector("slot")),oh(this,Xa).textContent=Xe(0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_DURATION]}attributeChangedCallback(e,t,a){e===s.MEDIA_DURATION&&(oh(this,Xa).textContent=Xe(+a)),super.attributeChangedCallback(e,t,a)}get mediaDuration(){return x(this,s.MEDIA_DURATION)}set mediaDuration(e){U(this,s.MEDIA_DURATION,e)}};Xa=new WeakMap;l.customElements.get("media-duration-display")||l.customElements.define("media-duration-display",dd);var Uf=`<svg aria-hidden="true" viewBox="0 0 26 24">
885
885
  <path d="M16 3v2.5h3.5V9H22V3h-6ZM4 9h2.5V5.5H10V3H4v6Zm15.5 9.5H16V21h6v-6h-2.5v3.5ZM6.5 15H4v6h6v-2.5H6.5V15Z"/>
886
886
  </svg>`,Bf=`<svg aria-hidden="true" viewBox="0 0 26 24">
887
887
  <path d="M18.5 6.5V3H16v6h6V6.5h-3.5ZM16 21h2.5v-3.5H22V15h-6v6ZM4 17.5h3.5V21H10v-6H4v2.5Zm3.5-11H4V9h6V3H7.5v3.5Z"/>
@@ -927,7 +927,7 @@
927
927
  <slot name="indicator">${$f}</slot>
928
928
 
929
929
  <slot name="spacer">&nbsp;</slot><slot name="text">LIVE</slot>
930
- `;var ch=i=>{let e=i.mediaPaused||!i.mediaTimeIsLive,t=e?Y.SEEK_LIVE():Y.PLAYING_LIVE();i.setAttribute("aria-label",t),e?i.removeAttribute("aria-disabled"):i.setAttribute("aria-disabled","true")},cd=class extends P{static get observedAttributes(){return[...super.observedAttributes,Ja,Jn]}constructor(e={}){super({slotTemplate:mh,...e})}connectedCallback(){ch(this),super.connectedCallback()}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),ch(this)}get mediaPaused(){return H(this,s.MEDIA_PAUSED)}set mediaPaused(e){B(this,s.MEDIA_PAUSED,e)}get mediaTimeIsLive(){return H(this,s.MEDIA_TIME_IS_LIVE)}set mediaTimeIsLive(e){B(this,s.MEDIA_TIME_IS_LIVE,e)}handleClick(){!this.mediaPaused&&this.mediaTimeIsLive||(this.dispatchEvent(new l.CustomEvent(Wf,{composed:!0,bubbles:!0})),this.hasAttribute(Ja)&&this.dispatchEvent(new l.CustomEvent(Hf,{composed:!0,bubbles:!0})))}};l.customElements.get("media-live-button")||l.customElements.define("media-live-button",cd);var vh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ja=(i,e,t)=>(vh(i,e,"read from private field"),t?t.call(i):e.get(i)),hh=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},er=(i,e,t,a)=>(vh(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),dt,jn,ph={LOADING_DELAY:"loadingdelay"},fh=500,bh=m.createElement("template"),Ff=`
930
+ `;var ch=i=>{let e=i.mediaPaused||!i.mediaTimeIsLive,t=e?Y.SEEK_LIVE():Y.PLAYING_LIVE();i.setAttribute("aria-label",t),e?i.removeAttribute("aria-disabled"):i.setAttribute("aria-disabled","true")},cd=class extends P{static get observedAttributes(){return[...super.observedAttributes,Ja,Jn]}constructor(e={}){super({slotTemplate:mh,...e})}connectedCallback(){ch(this),super.connectedCallback()}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),ch(this)}get mediaPaused(){return H(this,s.MEDIA_PAUSED)}set mediaPaused(e){B(this,s.MEDIA_PAUSED,e)}get mediaTimeIsLive(){return H(this,s.MEDIA_TIME_IS_LIVE)}set mediaTimeIsLive(e){B(this,s.MEDIA_TIME_IS_LIVE,e)}handleClick(){!this.mediaPaused&&this.mediaTimeIsLive||(this.dispatchEvent(new l.CustomEvent(Wf,{composed:!0,bubbles:!0})),this.hasAttribute(Ja)&&this.dispatchEvent(new l.CustomEvent(Hf,{composed:!0,bubbles:!0})))}};l.customElements.get("media-live-button")||l.customElements.define("media-live-button",cd);var vh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ja=(i,e,t)=>(vh(i,e,"read from private field"),t?t.call(i):e.get(i)),hh=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},er=(i,e,t,a)=>(vh(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ut,jn,ph={LOADING_DELAY:"loadingdelay"},fh=500,bh=m.createElement("template"),Ff=`
931
931
  <svg aria-hidden="true" viewBox="0 0 100 100">
932
932
  <path d="M73,50c0-12.7-10.3-23-23-23S27,37.3,27,50 M30.9,50c0-10.5,8.5-19.1,19.1-19.1S69.1,39.5,69.1,50">
933
933
  <animateTransform
@@ -987,7 +987,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
987
987
 
988
988
  <slot name="icon">${Ff}</slot>
989
989
  <div id="status" role="status" aria-live="polite">${K.MEDIA_LOADING()}</div>
990
- `;var md=class extends l.HTMLElement{constructor(){if(super(),hh(this,dt,void 0),hh(this,jn,fh),!this.shadowRoot){let e=this.attachShadow({mode:"open"}),t=bh.content.cloneNode(!0);e.appendChild(t)}}static get observedAttributes(){return[y.MEDIA_CONTROLLER,s.MEDIA_PAUSED,s.MEDIA_LOADING,ph.LOADING_DELAY]}attributeChangedCallback(e,t,a){var r,n,o,d,u;e===ph.LOADING_DELAY&&t!==a?this.loadingDelay=Number(a):e===y.MEDIA_CONTROLLER&&(t&&((n=(r=ja(this,dt))==null?void 0:r.unassociateElement)==null||n.call(r,this),er(this,dt,null)),a&&this.isConnected&&(er(this,dt,(o=this.getRootNode())==null?void 0:o.getElementById(a)),(u=(d=ja(this,dt))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(y.MEDIA_CONTROLLER);r&&(er(this,dt,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=ja(this,dt))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=ja(this,dt))==null?void 0:e.unassociateElement)==null||t.call(e,this),er(this,dt,null)}get loadingDelay(){return ja(this,jn)}set loadingDelay(e){er(this,jn,e);let{style:t}=N(this.shadowRoot,":host");t.setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return H(this,s.MEDIA_PAUSED)}set mediaPaused(e){B(this,s.MEDIA_PAUSED,e)}get mediaLoading(){return H(this,s.MEDIA_LOADING)}set mediaLoading(e){B(this,s.MEDIA_LOADING,e)}};dt=new WeakMap;jn=new WeakMap;l.customElements.get("media-loading-indicator")||l.customElements.define("media-loading-indicator",md);var{MEDIA_VOLUME_LEVEL:tr}=s,Vf=`<svg aria-hidden="true" viewBox="0 0 24 24">
990
+ `;var md=class extends l.HTMLElement{constructor(){if(super(),hh(this,ut,void 0),hh(this,jn,fh),!this.shadowRoot){let e=this.attachShadow({mode:"open"}),t=bh.content.cloneNode(!0);e.appendChild(t)}}static get observedAttributes(){return[y.MEDIA_CONTROLLER,s.MEDIA_PAUSED,s.MEDIA_LOADING,ph.LOADING_DELAY]}attributeChangedCallback(e,t,a){var r,n,o,d,u;e===ph.LOADING_DELAY&&t!==a?this.loadingDelay=Number(a):e===y.MEDIA_CONTROLLER&&(t&&((n=(r=ja(this,ut))==null?void 0:r.unassociateElement)==null||n.call(r,this),er(this,ut,null)),a&&this.isConnected&&(er(this,ut,(o=this.getRootNode())==null?void 0:o.getElementById(a)),(u=(d=ja(this,ut))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(y.MEDIA_CONTROLLER);r&&(er(this,ut,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=ja(this,ut))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=ja(this,ut))==null?void 0:e.unassociateElement)==null||t.call(e,this),er(this,ut,null)}get loadingDelay(){return ja(this,jn)}set loadingDelay(e){er(this,jn,e);let{style:t}=N(this.shadowRoot,":host");t.setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return H(this,s.MEDIA_PAUSED)}set mediaPaused(e){B(this,s.MEDIA_PAUSED,e)}get mediaLoading(){return H(this,s.MEDIA_LOADING)}set mediaLoading(e){B(this,s.MEDIA_LOADING,e)}};ut=new WeakMap;jn=new WeakMap;l.customElements.get("media-loading-indicator")||l.customElements.define("media-loading-indicator",md);var{MEDIA_VOLUME_LEVEL:tr}=s,Vf=`<svg aria-hidden="true" viewBox="0 0 24 24">
991
991
  <path d="M16.5 12A4.5 4.5 0 0 0 14 8v2.18l2.45 2.45a4.22 4.22 0 0 0 .05-.63Zm2.5 0a6.84 6.84 0 0 1-.54 2.64L20 16.15A8.8 8.8 0 0 0 21 12a9 9 0 0 0-7-8.77v2.06A7 7 0 0 1 19 12ZM4.27 3 3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25A6.92 6.92 0 0 1 14 18.7v2.06A9 9 0 0 0 17.69 19l2 2.05L21 19.73l-9-9L4.27 3ZM12 4 9.91 6.09 12 8.18V4Z"/>
992
992
  </svg>`,Eh=`<svg aria-hidden="true" viewBox="0 0 24 24">
993
993
  <path d="M3 9v6h4l5 5V4L7 9H3Zm13.5 3A4.5 4.5 0 0 0 14 8v8a4.47 4.47 0 0 0 2.5-4Z"/>
@@ -1046,7 +1046,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
1046
1046
  }
1047
1047
  </style>
1048
1048
  <slot name="icon"></slot>
1049
- `;var fd=class extends P{constructor(e={}){super({slotTemplate:kh,...e}),Gf(this,Qi,new Me(this,vd.RATES,{defaultValue:ir})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${Kt}x`}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PLAYBACK_RATE,vd.RATES]}attributeChangedCallback(e,t,a){if(super.attributeChangedCallback(e,t,a),e===vd.RATES&&(es(this,Qi).value=a),e===s.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,n=Number.isNaN(r)?Kt:r;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",K.PLAYBACK_RATE({playbackRate:n}))}}get rates(){return es(this,Qi)}set rates(e){e?Array.isArray(e)&&(es(this,Qi).value=e.join(" ")):es(this,Qi).value=""}get mediaPlaybackRate(){return x(this,s.MEDIA_PLAYBACK_RATE,Kt)}set mediaPlaybackRate(e){U(this,s.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,t;let a=Array.from(this.rates.values(),o=>+o).sort((o,d)=>o-d),r=(t=(e=a.find(o=>o>this.mediaPlaybackRate))!=null?e:a[0])!=null?t:Kt,n=new l.CustomEvent(h.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)}};Qi=new WeakMap;l.customElements.get("media-playback-rate-button")||l.customElements.define("media-playback-rate-button",fd);var Sh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ts=(i,e,t)=>(Sh(i,e,"read from private field"),t?t.call(i):e.get(i)),bd=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ar=(i,e,t)=>(Sh(i,e,"access private method"),t),zi,rr,is,as,gd,Ed={RATES:"rates"},_d=class extends ce{constructor(){super(),bd(this,rr),bd(this,as),bd(this,zi,new Me(this,Ed.RATES,{defaultValue:ir})),ar(this,rr,is).call(this)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PLAYBACK_RATE,Ed.RATES]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_PLAYBACK_RATE&&t!=a?this.value=a:e===Ed.RATES&&t!=a&&(ts(this,zi).value=a,ar(this,rr,is).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",ar(this,as,gd))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",ar(this,as,gd))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-playback-rate-menu-button")}get rates(){return ts(this,zi)}set rates(e){e?Array.isArray(e)&&(ts(this,zi).value=e.join(" ")):ts(this,zi).value="",ar(this,rr,is).call(this)}get mediaPlaybackRate(){return x(this,s.MEDIA_PLAYBACK_RATE,Kt)}set mediaPlaybackRate(e){U(this,s.MEDIA_PLAYBACK_RATE,e)}};zi=new WeakMap;rr=new WeakSet;is=function(){this.defaultSlot.textContent="";for(let i of this.rates){let e=tt({type:"radio",text:this.formatMenuItemText(`${i}x`,i),value:i,checked:this.mediaPlaybackRate==i});e.prepend($e(this,"checked-indicator")),this.defaultSlot.append(e)}};as=new WeakSet;gd=function(){if(!this.value)return;let i=new l.CustomEvent(h.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};l.customElements.get("media-playback-rate-menu")||l.customElements.define("media-playback-rate-menu",_d);var qf=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},rs=(i,e,t)=>(qf(i,e,"read from private field"),t?t.call(i):e.get(i)),Zf=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Xi,Ad={RATES:"rates"},Qf=[1,1.2,1.5,1.7,2],yd=1,Ih=m.createElement("template");Ih.innerHTML=`
1049
+ `;var fd=class extends P{constructor(e={}){super({slotTemplate:kh,...e}),Gf(this,Qi,new we(this,vd.RATES,{defaultValue:ir})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${Kt}x`}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PLAYBACK_RATE,vd.RATES]}attributeChangedCallback(e,t,a){if(super.attributeChangedCallback(e,t,a),e===vd.RATES&&(es(this,Qi).value=a),e===s.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,n=Number.isNaN(r)?Kt:r;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",K.PLAYBACK_RATE({playbackRate:n}))}}get rates(){return es(this,Qi)}set rates(e){e?Array.isArray(e)&&(es(this,Qi).value=e.join(" ")):es(this,Qi).value=""}get mediaPlaybackRate(){return x(this,s.MEDIA_PLAYBACK_RATE,Kt)}set mediaPlaybackRate(e){U(this,s.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,t;let a=Array.from(this.rates.values(),o=>+o).sort((o,d)=>o-d),r=(t=(e=a.find(o=>o>this.mediaPlaybackRate))!=null?e:a[0])!=null?t:Kt,n=new l.CustomEvent(h.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)}};Qi=new WeakMap;l.customElements.get("media-playback-rate-button")||l.customElements.define("media-playback-rate-button",fd);var Sh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ts=(i,e,t)=>(Sh(i,e,"read from private field"),t?t.call(i):e.get(i)),bd=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ar=(i,e,t)=>(Sh(i,e,"access private method"),t),zi,rr,is,as,gd,Ed={RATES:"rates"},_d=class extends ce{constructor(){super(),bd(this,rr),bd(this,as),bd(this,zi,new we(this,Ed.RATES,{defaultValue:ir})),ar(this,rr,is).call(this)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PLAYBACK_RATE,Ed.RATES]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_PLAYBACK_RATE&&t!=a?this.value=a:e===Ed.RATES&&t!=a&&(ts(this,zi).value=a,ar(this,rr,is).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",ar(this,as,gd))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",ar(this,as,gd))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-playback-rate-menu-button")}get rates(){return ts(this,zi)}set rates(e){e?Array.isArray(e)&&(ts(this,zi).value=e.join(" ")):ts(this,zi).value="",ar(this,rr,is).call(this)}get mediaPlaybackRate(){return x(this,s.MEDIA_PLAYBACK_RATE,Kt)}set mediaPlaybackRate(e){U(this,s.MEDIA_PLAYBACK_RATE,e)}};zi=new WeakMap;rr=new WeakSet;is=function(){this.defaultSlot.textContent="";for(let i of this.rates){let e=it({type:"radio",text:this.formatMenuItemText(`${i}x`,i),value:i,checked:this.mediaPlaybackRate==i});e.prepend(Fe(this,"checked-indicator")),this.defaultSlot.append(e)}};as=new WeakSet;gd=function(){if(!this.value)return;let i=new l.CustomEvent(h.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};l.customElements.get("media-playback-rate-menu")||l.customElements.define("media-playback-rate-menu",_d);var qf=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},rs=(i,e,t)=>(qf(i,e,"read from private field"),t?t.call(i):e.get(i)),Zf=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Xi,Ad={RATES:"rates"},Qf=[1,1.2,1.5,1.7,2],yd=1,Ih=m.createElement("template");Ih.innerHTML=`
1050
1050
  <style>
1051
1051
  :host {
1052
1052
  min-width: 5ch;
@@ -1054,7 +1054,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
1054
1054
  }
1055
1055
  </style>
1056
1056
  <slot name="icon"></slot>
1057
- `;var Td=class extends ke{constructor(e={}){super({slotTemplate:Ih,...e}),Zf(this,Xi,new Me(this,Ad.RATES,{defaultValue:Qf})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${yd}x`}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PLAYBACK_RATE,Ad.RATES]}attributeChangedCallback(e,t,a){if(super.attributeChangedCallback(e,t,a),e===Ad.RATES&&(rs(this,Xi).value=a),e===s.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,n=Number.isNaN(r)?yd:r;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",K.PLAYBACK_RATE({playbackRate:n}))}}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:X(this).querySelector("media-playback-rate-menu")}get rates(){return rs(this,Xi)}set rates(e){e?Array.isArray(e)&&(rs(this,Xi).value=e.join(" ")):rs(this,Xi).value=""}get mediaPlaybackRate(){return x(this,s.MEDIA_PLAYBACK_RATE,yd)}set mediaPlaybackRate(e){U(this,s.MEDIA_PLAYBACK_RATE,e)}};Xi=new WeakMap;l.customElements.get("media-playback-rate-menu-button")||l.customElements.define("media-playback-rate-menu-button",Td);var zf=`<svg aria-hidden="true" viewBox="0 0 24 24">
1057
+ `;var Td=class extends ke{constructor(e={}){super({slotTemplate:Ih,...e}),Zf(this,Xi,new we(this,Ad.RATES,{defaultValue:Qf})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${yd}x`}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PLAYBACK_RATE,Ad.RATES]}attributeChangedCallback(e,t,a){if(super.attributeChangedCallback(e,t,a),e===Ad.RATES&&(rs(this,Xi).value=a),e===s.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,n=Number.isNaN(r)?yd:r;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",K.PLAYBACK_RATE({playbackRate:n}))}}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:X(this).querySelector("media-playback-rate-menu")}get rates(){return rs(this,Xi)}set rates(e){e?Array.isArray(e)&&(rs(this,Xi).value=e.join(" ")):rs(this,Xi).value=""}get mediaPlaybackRate(){return x(this,s.MEDIA_PLAYBACK_RATE,yd)}set mediaPlaybackRate(e){U(this,s.MEDIA_PLAYBACK_RATE,e)}};Xi=new WeakMap;l.customElements.get("media-playback-rate-menu-button")||l.customElements.define("media-playback-rate-menu-button",Td);var zf=`<svg aria-hidden="true" viewBox="0 0 24 24">
1058
1058
  <path d="m6 21 15-9L6 3v18Z"/>
1059
1059
  </svg>`,Xf=`<svg aria-hidden="true" viewBox="0 0 24 24">
1060
1060
  <path d="M6 20h4V4H6v16Zm8-16v16h4V4h-4Z"/>
@@ -1073,7 +1073,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
1073
1073
  <slot name="play">${zf}</slot>
1074
1074
  <slot name="pause">${Xf}</slot>
1075
1075
  </slot>
1076
- `;var Ch=i=>{let e=i.mediaPaused?Y.PLAY():Y.PAUSE();i.setAttribute("aria-label",e)},kd=class extends P{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PAUSED,s.MEDIA_ENDED]}constructor(e={}){super({slotTemplate:Lh,...e})}connectedCallback(){Ch(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===s.MEDIA_PAUSED&&Ch(this),super.attributeChangedCallback(e,t,a)}get mediaPaused(){return H(this,s.MEDIA_PAUSED)}set mediaPaused(e){B(this,s.MEDIA_PAUSED,e)}handleClick(){let e=this.mediaPaused?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};l.customElements.get("media-play-button")||l.customElements.define("media-play-button",kd);var ut={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"},Mh=m.createElement("template");Mh.innerHTML=`
1076
+ `;var Ch=i=>{let e=i.mediaPaused?Y.PLAY():Y.PAUSE();i.setAttribute("aria-label",e)},kd=class extends P{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PAUSED,s.MEDIA_ENDED]}constructor(e={}){super({slotTemplate:Lh,...e})}connectedCallback(){Ch(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===s.MEDIA_PAUSED&&Ch(this),super.attributeChangedCallback(e,t,a)}get mediaPaused(){return H(this,s.MEDIA_PAUSED)}set mediaPaused(e){B(this,s.MEDIA_PAUSED,e)}handleClick(){let e=this.mediaPaused?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};l.customElements.get("media-play-button")||l.customElements.define("media-play-button",kd);var ct={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"},Mh=m.createElement("template");Mh.innerHTML=`
1077
1077
  <style>
1078
1078
  :host {
1079
1079
  pointer-events: none;
@@ -1095,7 +1095,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
1095
1095
  </style>
1096
1096
 
1097
1097
  <img part="poster img" aria-hidden="true" id="image"/>
1098
- `;var Jf=i=>{i.style.removeProperty("background-image")},jf=(i,e)=>{i.style["background-image"]=`url('${e}')`},Sd=class extends l.HTMLElement{static get observedAttributes(){return[ut.PLACEHOLDER_SRC,ut.SRC]}constructor(){super(),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Mh.content.cloneNode(!0))),this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,t,a){e===ut.SRC&&(a==null?this.image.removeAttribute(ut.SRC):this.image.setAttribute(ut.SRC,a)),e===ut.PLACEHOLDER_SRC&&(a==null?Jf(this.image):jf(this.image,a))}get placeholderSrc(){return I(this,ut.PLACEHOLDER_SRC)}set placeholderSrc(e){k(this,ut.SRC,e)}get src(){return I(this,ut.SRC)}set src(e){k(this,ut.SRC,e)}};l.customElements.get("media-poster-image")||l.customElements.define("media-poster-image",Sd);var wh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},eb=(i,e,t)=>(wh(i,e,"read from private field"),t?t.call(i):e.get(i)),tb=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ib=(i,e,t,a)=>(wh(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ns,Id=class extends sh{constructor(){super(),tb(this,ns,void 0),ib(this,ns,this.shadowRoot.querySelector("slot"))}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PREVIEW_CHAPTER]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_PREVIEW_CHAPTER&&a!==t&&a!=null&&(eb(this,ns).textContent=a,a!==""?this.setAttribute("aria-valuetext",`chapter: ${a}`):this.removeAttribute("aria-valuetext"))}get mediaPreviewChapter(){return I(this,s.MEDIA_PREVIEW_CHAPTER)}set mediaPreviewChapter(e){k(this,s.MEDIA_PREVIEW_CHAPTER,e)}};ns=new WeakMap;l.customElements.get("media-preview-chapter-display")||l.customElements.define("media-preview-chapter-display",Id);var Rh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ss=(i,e,t)=>(Rh(i,e,"read from private field"),t?t.call(i):e.get(i)),ab=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},os=(i,e,t,a)=>(Rh(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ct,xh=m.createElement("template");xh.innerHTML=`
1098
+ `;var Jf=i=>{i.style.removeProperty("background-image")},jf=(i,e)=>{i.style["background-image"]=`url('${e}')`},Sd=class extends l.HTMLElement{static get observedAttributes(){return[ct.PLACEHOLDER_SRC,ct.SRC]}constructor(){super(),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Mh.content.cloneNode(!0))),this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,t,a){e===ct.SRC&&(a==null?this.image.removeAttribute(ct.SRC):this.image.setAttribute(ct.SRC,a)),e===ct.PLACEHOLDER_SRC&&(a==null?Jf(this.image):jf(this.image,a))}get placeholderSrc(){return I(this,ct.PLACEHOLDER_SRC)}set placeholderSrc(e){k(this,ct.SRC,e)}get src(){return I(this,ct.SRC)}set src(e){k(this,ct.SRC,e)}};l.customElements.get("media-poster-image")||l.customElements.define("media-poster-image",Sd);var wh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},eb=(i,e,t)=>(wh(i,e,"read from private field"),t?t.call(i):e.get(i)),tb=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ib=(i,e,t,a)=>(wh(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ns,Id=class extends sh{constructor(){super(),tb(this,ns,void 0),ib(this,ns,this.shadowRoot.querySelector("slot"))}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PREVIEW_CHAPTER]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_PREVIEW_CHAPTER&&a!==t&&a!=null&&(eb(this,ns).textContent=a,a!==""?this.setAttribute("aria-valuetext",`chapter: ${a}`):this.removeAttribute("aria-valuetext"))}get mediaPreviewChapter(){return I(this,s.MEDIA_PREVIEW_CHAPTER)}set mediaPreviewChapter(e){k(this,s.MEDIA_PREVIEW_CHAPTER,e)}};ns=new WeakMap;l.customElements.get("media-preview-chapter-display")||l.customElements.define("media-preview-chapter-display",Id);var Rh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ss=(i,e,t)=>(Rh(i,e,"read from private field"),t?t.call(i):e.get(i)),ab=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},os=(i,e,t,a)=>(Rh(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),mt,xh=m.createElement("template");xh.innerHTML=`
1099
1099
  <style>
1100
1100
  :host {
1101
1101
  box-sizing: border-box;
@@ -1109,7 +1109,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
1109
1109
  }
1110
1110
  </style>
1111
1111
  <img crossorigin loading="eager" decoding="async">
1112
- `;var Cd=class extends l.HTMLElement{constructor(){super(),ab(this,ct,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(xh.content.cloneNode(!0)))}static get observedAttributes(){return[y.MEDIA_CONTROLLER,s.MEDIA_PREVIEW_IMAGE,s.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,t,a;let r=this.getAttribute(y.MEDIA_CONTROLLER);r&&(os(this,ct,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=ss(this,ct))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=ss(this,ct))==null?void 0:e.unassociateElement)==null||t.call(e,this),os(this,ct,null)}attributeChangedCallback(e,t,a){var r,n,o,d,u;[s.MEDIA_PREVIEW_IMAGE,s.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===y.MEDIA_CONTROLLER&&(t&&((n=(r=ss(this,ct))==null?void 0:r.unassociateElement)==null||n.call(r,this),os(this,ct,null)),a&&this.isConnected&&(os(this,ct,(o=this.getRootNode())==null?void 0:o.getElementById(a)),(u=(d=ss(this,ct))==null?void 0:d.associateElement)==null||u.call(d,this)))}get mediaPreviewImage(){return I(this,s.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){k(this,s.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewCoords(){let e=this.getAttribute(s.MEDIA_PREVIEW_COORDS);if(e)return e.split(/\s+/).map(t=>+t)}set mediaPreviewCoords(e){if(!e){this.removeAttribute(s.MEDIA_PREVIEW_COORDS);return}this.setAttribute(s.MEDIA_PREVIEW_COORDS,e.join(" "))}update(){let e=this.mediaPreviewCoords,t=this.mediaPreviewImage;if(!(e&&t))return;let[a,r,n,o]=e,d=t.split("#")[0],u=getComputedStyle(this),{maxWidth:c,maxHeight:f,minWidth:E,minHeight:v}=u,b=Math.min(parseInt(c)/n,parseInt(f)/o),w=Math.max(parseInt(E)/n,parseInt(v)/o),_=b<1,T=_?b:w>1?w:1,{style:D}=N(this.shadowRoot,":host"),te=N(this.shadowRoot,"img").style,ge=this.shadowRoot.querySelector("img"),Ot=_?"min":"max";D.setProperty(`${Ot}-width`,"initial","important"),D.setProperty(`${Ot}-height`,"initial","important"),D.width=`${n*T}px`,D.height=`${o*T}px`;let _t=()=>{te.width=`${this.imgWidth*T}px`,te.height=`${this.imgHeight*T}px`,te.display="block"};ge.src!==d&&(ge.onload=()=>{this.imgWidth=ge.naturalWidth,this.imgHeight=ge.naturalHeight,_t()},ge.src=d,_t()),_t(),te.transform=`translate(-${a*T}px, -${r*T}px)`}};ct=new WeakMap;l.customElements.get("media-preview-thumbnail")||l.customElements.define("media-preview-thumbnail",Cd);var Oh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Dh=(i,e,t)=>(Oh(i,e,"read from private field"),t?t.call(i):e.get(i)),rb=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},nb=(i,e,t,a)=>(Oh(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),nr,Ld=class extends lt{constructor(){super(),rb(this,nr,void 0),nb(this,nr,this.shadowRoot.querySelector("slot")),Dh(this,nr).textContent=ze(0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_PREVIEW_TIME&&a!=null&&(Dh(this,nr).textContent=ze(a))}get mediaPreviewTime(){return x(this,s.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){U(this,s.MEDIA_PREVIEW_TIME,e)}};nr=new WeakMap;l.customElements.get("media-preview-time-display")||l.customElements.define("media-preview-time-display",Ld);var Dd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ph=(i,e,t)=>(Dd(i,e,"read from private field"),t?t.call(i):e.get(i)),ls=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Md=(i,e,t,a)=>(Dd(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ds=(i,e,t)=>(Dd(i,e,"access private method"),t),sr,ms,us,wd,cs,Rd,xd=class extends ce{constructor(){super(...arguments),ls(this,us),ls(this,cs),ls(this,sr,[]),ls(this,ms,void 0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_RENDITION_LIST,s.MEDIA_RENDITION_SELECTED,s.MEDIA_RENDITION_UNAVAILABLE]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_RENDITION_SELECTED&&t!==a?this.value=a!=null?a:"auto":e===s.MEDIA_RENDITION_LIST&&t!==a&&(Md(this,sr,$r(a)),ds(this,us,wd).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",ds(this,cs,Rd))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",ds(this,cs,Rd))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-rendition-menu-button")}get mediaRenditionList(){return Ph(this,sr)}set mediaRenditionList(e){Md(this,sr,e),ds(this,us,wd).call(this)}get mediaRenditionSelected(){return I(this,s.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){k(this,s.MEDIA_RENDITION_SELECTED,e)}};sr=new WeakMap;ms=new WeakMap;us=new WeakSet;wd=function(){if(Ph(this,ms)===JSON.stringify(this.mediaRenditionList))return;Md(this,ms,JSON.stringify(this.mediaRenditionList));let i=this.mediaRenditionList.sort((a,r)=>r.height-a.height);this.defaultSlot.textContent="";let e=!this.mediaRenditionSelected;for(let a of i){let r=this.formatMenuItemText(`${Math.min(a.width,a.height)}p`,a),n=tt({type:"radio",text:r,value:`${a.id}`,checked:a.selected&&!e});n.prepend($e(this,"checked-indicator")),this.defaultSlot.append(n)}let t=tt({type:"radio",text:this.formatMenuItemText("Auto"),value:"auto",checked:e});t.prepend($e(this,"checked-indicator")),this.defaultSlot.append(t)};cs=new WeakSet;Rd=function(){if(this.value==null)return;let i=new l.CustomEvent(h.MEDIA_RENDITION_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};l.customElements.get("media-rendition-menu")||l.customElements.define("media-rendition-menu",xd);var sb=`<svg aria-hidden="true" viewBox="0 0 24 24">
1112
+ `;var Cd=class extends l.HTMLElement{constructor(){super(),ab(this,mt,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(xh.content.cloneNode(!0)))}static get observedAttributes(){return[y.MEDIA_CONTROLLER,s.MEDIA_PREVIEW_IMAGE,s.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,t,a;let r=this.getAttribute(y.MEDIA_CONTROLLER);r&&(os(this,mt,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=ss(this,mt))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=ss(this,mt))==null?void 0:e.unassociateElement)==null||t.call(e,this),os(this,mt,null)}attributeChangedCallback(e,t,a){var r,n,o,d,u;[s.MEDIA_PREVIEW_IMAGE,s.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===y.MEDIA_CONTROLLER&&(t&&((n=(r=ss(this,mt))==null?void 0:r.unassociateElement)==null||n.call(r,this),os(this,mt,null)),a&&this.isConnected&&(os(this,mt,(o=this.getRootNode())==null?void 0:o.getElementById(a)),(u=(d=ss(this,mt))==null?void 0:d.associateElement)==null||u.call(d,this)))}get mediaPreviewImage(){return I(this,s.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){k(this,s.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewCoords(){let e=this.getAttribute(s.MEDIA_PREVIEW_COORDS);if(e)return e.split(/\s+/).map(t=>+t)}set mediaPreviewCoords(e){if(!e){this.removeAttribute(s.MEDIA_PREVIEW_COORDS);return}this.setAttribute(s.MEDIA_PREVIEW_COORDS,e.join(" "))}update(){let e=this.mediaPreviewCoords,t=this.mediaPreviewImage;if(!(e&&t))return;let[a,r,n,o]=e,d=t.split("#")[0],u=getComputedStyle(this),{maxWidth:c,maxHeight:f,minWidth:g,minHeight:v}=u,b=Math.min(parseInt(c)/n,parseInt(f)/o),w=Math.max(parseInt(g)/n,parseInt(v)/o),A=b<1,T=A?b:w>1?w:1,{style:D}=N(this.shadowRoot,":host"),ie=N(this.shadowRoot,"img").style,ge=this.shadowRoot.querySelector("img"),Ot=A?"min":"max";D.setProperty(`${Ot}-width`,"initial","important"),D.setProperty(`${Ot}-height`,"initial","important"),D.width=`${n*T}px`,D.height=`${o*T}px`;let At=()=>{ie.width=`${this.imgWidth*T}px`,ie.height=`${this.imgHeight*T}px`,ie.display="block"};ge.src!==d&&(ge.onload=()=>{this.imgWidth=ge.naturalWidth,this.imgHeight=ge.naturalHeight,At()},ge.src=d,At()),At(),ie.transform=`translate(-${a*T}px, -${r*T}px)`}};mt=new WeakMap;l.customElements.get("media-preview-thumbnail")||l.customElements.define("media-preview-thumbnail",Cd);var Oh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Dh=(i,e,t)=>(Oh(i,e,"read from private field"),t?t.call(i):e.get(i)),rb=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},nb=(i,e,t,a)=>(Oh(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),nr,Ld=class extends dt{constructor(){super(),rb(this,nr,void 0),nb(this,nr,this.shadowRoot.querySelector("slot")),Dh(this,nr).textContent=Xe(0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_PREVIEW_TIME&&a!=null&&(Dh(this,nr).textContent=Xe(a))}get mediaPreviewTime(){return x(this,s.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){U(this,s.MEDIA_PREVIEW_TIME,e)}};nr=new WeakMap;l.customElements.get("media-preview-time-display")||l.customElements.define("media-preview-time-display",Ld);var Dd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ph=(i,e,t)=>(Dd(i,e,"read from private field"),t?t.call(i):e.get(i)),ls=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Md=(i,e,t,a)=>(Dd(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ds=(i,e,t)=>(Dd(i,e,"access private method"),t),sr,ms,us,wd,cs,Rd,xd=class extends ce{constructor(){super(...arguments),ls(this,us),ls(this,cs),ls(this,sr,[]),ls(this,ms,void 0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_RENDITION_LIST,s.MEDIA_RENDITION_SELECTED,s.MEDIA_RENDITION_UNAVAILABLE]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_RENDITION_SELECTED&&t!==a?this.value=a!=null?a:"auto":e===s.MEDIA_RENDITION_LIST&&t!==a&&(Md(this,sr,$r(a)),ds(this,us,wd).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",ds(this,cs,Rd))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",ds(this,cs,Rd))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-rendition-menu-button")}get mediaRenditionList(){return Ph(this,sr)}set mediaRenditionList(e){Md(this,sr,e),ds(this,us,wd).call(this)}get mediaRenditionSelected(){return I(this,s.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){k(this,s.MEDIA_RENDITION_SELECTED,e)}};sr=new WeakMap;ms=new WeakMap;us=new WeakSet;wd=function(){if(Ph(this,ms)===JSON.stringify(this.mediaRenditionList))return;Md(this,ms,JSON.stringify(this.mediaRenditionList));let i=this.mediaRenditionList.sort((a,r)=>r.height-a.height);this.defaultSlot.textContent="";let e=!this.mediaRenditionSelected;for(let a of i){let r=this.formatMenuItemText(`${Math.min(a.width,a.height)}p`,a),n=it({type:"radio",text:r,value:`${a.id}`,checked:a.selected&&!e});n.prepend(Fe(this,"checked-indicator")),this.defaultSlot.append(n)}let t=it({type:"radio",text:this.formatMenuItemText("Auto"),value:"auto",checked:e});t.prepend(Fe(this,"checked-indicator")),this.defaultSlot.append(t)};cs=new WeakSet;Rd=function(){if(this.value==null)return;let i=new l.CustomEvent(h.MEDIA_RENDITION_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};l.customElements.get("media-rendition-menu")||l.customElements.define("media-rendition-menu",xd);var sb=`<svg aria-hidden="true" viewBox="0 0 24 24">
1113
1113
  <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" />
1114
1114
  </svg>`,Nh=m.createElement("template");Nh.innerHTML=`
1115
1115
  <slot name="icon">${sb}</slot>
@@ -1150,7 +1150,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
1150
1150
  <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"/>
1151
1151
  </svg>
1152
1152
  </slot>
1153
- `;var Ud=class extends ke{static get observedAttributes(){return[...super.observedAttributes,"target"]}constructor(){super({slotTemplate:Hh})}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",K.SETTINGS())}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:X(this).querySelector("media-settings-menu")}};l.customElements.get("media-settings-menu-button")||l.customElements.define("media-settings-menu-button",Ud);var pb=Object.defineProperty,vb=(i,e,t)=>e in i?pb(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,fb=(i,e,t)=>(vb(i,typeof e!="symbol"?e+"":e,t),t),$h,fs=m.createElement("template");fs.innerHTML=Ei.template.innerHTML+`
1153
+ `;var Ud=class extends ke{static get observedAttributes(){return[...super.observedAttributes,"target"]}constructor(){super({slotTemplate:Hh})}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",K.SETTINGS())}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:X(this).querySelector("media-settings-menu")}};l.customElements.get("media-settings-menu-button")||l.customElements.define("media-settings-menu-button",Ud);var pb=Object.defineProperty,vb=(i,e,t)=>e in i?pb(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,fb=(i,e,t)=>(vb(i,typeof e!="symbol"?e+"":e,t),t),$h,fs=m.createElement("template");fs.innerHTML=gi.template.innerHTML+`
1154
1154
  <style>
1155
1155
  slot:not([name="submenu"]) {
1156
1156
  opacity: var(--media-settings-menu-item-opacity, var(--media-menu-item-opacity));
@@ -1164,7 +1164,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
1164
1164
  <svg aria-hidden="true" viewBox="0 0 20 24">
1165
1165
  <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"/>
1166
1166
  </svg>
1167
- `);var bs=class extends Ei{};fb(bs,"template",fs);l.customElements.get("media-settings-menu-item")||l.customElements.define("media-settings-menu-item",bs);var Yh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Bd=(i,e,t)=>(Yh(i,e,"read from private field"),t?t.call(i):e.get(i)),bb=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Eb=(i,e,t,a)=>(Yh(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ea,Ke={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},Fh=[...Object.values(Ke),s.MEDIA_CURRENT_TIME,s.MEDIA_DURATION,s.MEDIA_SEEKABLE],Vh=["Enter"," "],gb="&nbsp;/&nbsp;",Kh=(i,{timesSep:e=gb}={})=>{var t,a;let r=i.hasAttribute(Ke.REMAINING),n=i.hasAttribute(Ke.SHOW_DURATION),o=(t=i.mediaCurrentTime)!=null?t:0,[,d]=(a=i.mediaSeekable)!=null?a:[],u=0;Number.isFinite(i.mediaDuration)?u=i.mediaDuration:Number.isFinite(d)&&(u=d);let c=r?ze(0-(u-o)):ze(o);return n?`${c}${e}${ze(u)}`:c},_b="video not loaded, unknown time.",Ab=i=>{var e;let t=i.mediaCurrentTime,[,a]=(e=i.mediaSeekable)!=null?e:[],r=null;if(Number.isFinite(i.mediaDuration)?r=i.mediaDuration:Number.isFinite(a)&&(r=a),t==null||r===null){i.setAttribute("aria-valuetext",_b);return}let n=i.hasAttribute(Ke.REMAINING),o=i.hasAttribute(Ke.SHOW_DURATION),d=n?ai(0-(r-t)):ai(t);if(!o){i.setAttribute("aria-valuetext",d);return}let u=ai(r),c=`${d} of ${u}`;i.setAttribute("aria-valuetext",c)},Wd=class extends lt{constructor(){super(),bb(this,ea,void 0),Eb(this,ea,this.shadowRoot.querySelector("slot")),Bd(this,ea).innerHTML=`${Kh(this)}`}static get observedAttributes(){return[...super.observedAttributes,...Fh,"disabled"]}connectedCallback(){let{style:e}=N(this.shadowRoot,":host(:hover:not([notoggle]))");e.setProperty("cursor","pointer"),e.setProperty("background","var(--media-control-hover-background, rgba(50 50 70 / .7))"),this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","progressbar"),this.setAttribute("aria-label",K.PLAYBACK_TIME());let t=a=>{let{key:r}=a;if(!Vh.includes(r)){this.removeEventListener("keyup",t);return}this.toggleTimeDisplay()};this.addEventListener("keydown",a=>{let{metaKey:r,altKey:n,key:o}=a;if(r||n||!Vh.includes(o)){this.removeEventListener("keyup",t);return}this.addEventListener("keyup",t)}),this.addEventListener("click",this.toggleTimeDisplay),super.connectedCallback()}toggleTimeDisplay(){this.noToggle||(this.hasAttribute("remaining")?this.removeAttribute("remaining"):this.setAttribute("remaining",""))}disconnectedCallback(){this.disable(),super.disconnectedCallback()}attributeChangedCallback(e,t,a){Fh.includes(e)?this.update():e==="disabled"&&a!==t&&(a==null?this.enable():this.disable()),super.attributeChangedCallback(e,t,a)}enable(){this.tabIndex=0}disable(){this.tabIndex=-1}get remaining(){return H(this,Ke.REMAINING)}set remaining(e){B(this,Ke.REMAINING,e)}get showDuration(){return H(this,Ke.SHOW_DURATION)}set showDuration(e){B(this,Ke.SHOW_DURATION,e)}get noToggle(){return H(this,Ke.NO_TOGGLE)}set noToggle(e){B(this,Ke.NO_TOGGLE,e)}get mediaDuration(){return x(this,s.MEDIA_DURATION)}set mediaDuration(e){U(this,s.MEDIA_DURATION,e)}get mediaCurrentTime(){return x(this,s.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){U(this,s.MEDIA_CURRENT_TIME,e)}get mediaSeekable(){let e=this.getAttribute(s.MEDIA_SEEKABLE);if(e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(s.MEDIA_SEEKABLE);return}this.setAttribute(s.MEDIA_SEEKABLE,e.join(":"))}update(){let e=Kh(this);Ab(this),e!==Bd(this,ea).innerHTML&&(Bd(this,ea).innerHTML=e)}};ea=new WeakMap;l.customElements.get("media-time-display")||l.customElements.define("media-time-display",Wd);var Gh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},se=(i,e,t)=>(Gh(i,e,"read from private field"),t?t.call(i):e.get(i)),mt=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Se=(i,e,t,a)=>(Gh(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),yb=(i,e,t,a)=>({set _(r){Se(i,e,r,t)},get _(){return se(i,e,a)}}),ta,Es,ia,or,gs,_s,As,aa,_i,ys,Ts=class{constructor(e,t,a){mt(this,ta,void 0),mt(this,Es,void 0),mt(this,ia,void 0),mt(this,or,void 0),mt(this,gs,void 0),mt(this,_s,void 0),mt(this,As,void 0),mt(this,aa,void 0),mt(this,_i,0),mt(this,ys,(r=performance.now())=>{Se(this,_i,requestAnimationFrame(se(this,ys))),Se(this,or,performance.now()-se(this,ia));let n=1e3/this.fps;if(se(this,or)>n){Se(this,ia,r-se(this,or)%n);let o=1e3/((r-se(this,Es))/++yb(this,gs)._),d=(r-se(this,_s))/1e3/this.duration,u=se(this,As)+d*this.playbackRate;u-se(this,ta).valueAsNumber>0?Se(this,aa,this.playbackRate/this.duration/o):(Se(this,aa,.995*se(this,aa)),u=se(this,ta).valueAsNumber+se(this,aa)),this.callback(u)}}),Se(this,ta,e),this.callback=t,this.fps=a}start(){se(this,_i)===0&&(Se(this,ia,performance.now()),Se(this,Es,se(this,ia)),Se(this,gs,0),se(this,ys).call(this))}stop(){se(this,_i)!==0&&(cancelAnimationFrame(se(this,_i)),Se(this,_i,0))}update({start:e,duration:t,playbackRate:a}){let r=e-se(this,ta).valueAsNumber,n=Math.abs(t-this.duration);(r>0||r<-.03||n>=.5)&&this.callback(e),Se(this,As,e),Se(this,_s,performance.now()),this.duration=t,this.playbackRate=a}};ta=new WeakMap;Es=new WeakMap;ia=new WeakMap;or=new WeakMap;gs=new WeakMap;_s=new WeakMap;As=new WeakMap;aa=new WeakMap;_i=new WeakMap;ys=new WeakMap;var Kd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ae=(i,e,t)=>(Kd(i,e,"read from private field"),t?t.call(i):e.get(i)),oe=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ht=(i,e,t,a)=>(Kd(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),me=(i,e,t)=>(Kd(i,e,"access private method"),t),ra,Ai,Is,dr,Cs,Ss,ur,cr,na,sa,lr,Yd,qh,Hd,Ls,Gd,Ms,qd,ws,Zd,$d,Zh,mr,Rs,Fd,Qh,Tb="video not loaded, unknown time.",kb=i=>{let e=i.range,t=ai(+Xh(i)),a=ai(+i.mediaSeekableEnd),r=t&&a?`${t} of ${a}`:Tb;e.setAttribute("aria-valuetext",r)},zh=m.createElement("template");zh.innerHTML=`
1167
+ `);var bs=class extends gi{};fb(bs,"template",fs);l.customElements.get("media-settings-menu-item")||l.customElements.define("media-settings-menu-item",bs);var Yh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Bd=(i,e,t)=>(Yh(i,e,"read from private field"),t?t.call(i):e.get(i)),bb=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Eb=(i,e,t,a)=>(Yh(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ea,Ye={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},Fh=[...Object.values(Ye),s.MEDIA_CURRENT_TIME,s.MEDIA_DURATION,s.MEDIA_SEEKABLE],Vh=["Enter"," "],gb="&nbsp;/&nbsp;",Kh=(i,{timesSep:e=gb}={})=>{var t,a;let r=i.hasAttribute(Ye.REMAINING),n=i.hasAttribute(Ye.SHOW_DURATION),o=(t=i.mediaCurrentTime)!=null?t:0,[,d]=(a=i.mediaSeekable)!=null?a:[],u=0;Number.isFinite(i.mediaDuration)?u=i.mediaDuration:Number.isFinite(d)&&(u=d);let c=r?Xe(0-(u-o)):Xe(o);return n?`${c}${e}${Xe(u)}`:c},_b="video not loaded, unknown time.",Ab=i=>{var e;let t=i.mediaCurrentTime,[,a]=(e=i.mediaSeekable)!=null?e:[],r=null;if(Number.isFinite(i.mediaDuration)?r=i.mediaDuration:Number.isFinite(a)&&(r=a),t==null||r===null){i.setAttribute("aria-valuetext",_b);return}let n=i.hasAttribute(Ye.REMAINING),o=i.hasAttribute(Ye.SHOW_DURATION),d=n?ri(0-(r-t)):ri(t);if(!o){i.setAttribute("aria-valuetext",d);return}let u=ri(r),c=`${d} of ${u}`;i.setAttribute("aria-valuetext",c)},Wd=class extends dt{constructor(){super(),bb(this,ea,void 0),Eb(this,ea,this.shadowRoot.querySelector("slot")),Bd(this,ea).innerHTML=`${Kh(this)}`}static get observedAttributes(){return[...super.observedAttributes,...Fh,"disabled"]}connectedCallback(){let{style:e}=N(this.shadowRoot,":host(:hover:not([notoggle]))");e.setProperty("cursor","pointer"),e.setProperty("background","var(--media-control-hover-background, rgba(50 50 70 / .7))"),this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","progressbar"),this.setAttribute("aria-label",K.PLAYBACK_TIME());let t=a=>{let{key:r}=a;if(!Vh.includes(r)){this.removeEventListener("keyup",t);return}this.toggleTimeDisplay()};this.addEventListener("keydown",a=>{let{metaKey:r,altKey:n,key:o}=a;if(r||n||!Vh.includes(o)){this.removeEventListener("keyup",t);return}this.addEventListener("keyup",t)}),this.addEventListener("click",this.toggleTimeDisplay),super.connectedCallback()}toggleTimeDisplay(){this.noToggle||(this.hasAttribute("remaining")?this.removeAttribute("remaining"):this.setAttribute("remaining",""))}disconnectedCallback(){this.disable(),super.disconnectedCallback()}attributeChangedCallback(e,t,a){Fh.includes(e)?this.update():e==="disabled"&&a!==t&&(a==null?this.enable():this.disable()),super.attributeChangedCallback(e,t,a)}enable(){this.tabIndex=0}disable(){this.tabIndex=-1}get remaining(){return H(this,Ye.REMAINING)}set remaining(e){B(this,Ye.REMAINING,e)}get showDuration(){return H(this,Ye.SHOW_DURATION)}set showDuration(e){B(this,Ye.SHOW_DURATION,e)}get noToggle(){return H(this,Ye.NO_TOGGLE)}set noToggle(e){B(this,Ye.NO_TOGGLE,e)}get mediaDuration(){return x(this,s.MEDIA_DURATION)}set mediaDuration(e){U(this,s.MEDIA_DURATION,e)}get mediaCurrentTime(){return x(this,s.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){U(this,s.MEDIA_CURRENT_TIME,e)}get mediaSeekable(){let e=this.getAttribute(s.MEDIA_SEEKABLE);if(e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(s.MEDIA_SEEKABLE);return}this.setAttribute(s.MEDIA_SEEKABLE,e.join(":"))}update(){let e=Kh(this);Ab(this),e!==Bd(this,ea).innerHTML&&(Bd(this,ea).innerHTML=e)}};ea=new WeakMap;l.customElements.get("media-time-display")||l.customElements.define("media-time-display",Wd);var Gh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},se=(i,e,t)=>(Gh(i,e,"read from private field"),t?t.call(i):e.get(i)),ht=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Se=(i,e,t,a)=>(Gh(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),yb=(i,e,t,a)=>({set _(r){Se(i,e,r,t)},get _(){return se(i,e,a)}}),ta,Es,ia,or,gs,_s,As,aa,Ai,ys,Ts=class{constructor(e,t,a){ht(this,ta,void 0),ht(this,Es,void 0),ht(this,ia,void 0),ht(this,or,void 0),ht(this,gs,void 0),ht(this,_s,void 0),ht(this,As,void 0),ht(this,aa,void 0),ht(this,Ai,0),ht(this,ys,(r=performance.now())=>{Se(this,Ai,requestAnimationFrame(se(this,ys))),Se(this,or,performance.now()-se(this,ia));let n=1e3/this.fps;if(se(this,or)>n){Se(this,ia,r-se(this,or)%n);let o=1e3/((r-se(this,Es))/++yb(this,gs)._),d=(r-se(this,_s))/1e3/this.duration,u=se(this,As)+d*this.playbackRate;u-se(this,ta).valueAsNumber>0?Se(this,aa,this.playbackRate/this.duration/o):(Se(this,aa,.995*se(this,aa)),u=se(this,ta).valueAsNumber+se(this,aa)),this.callback(u)}}),Se(this,ta,e),this.callback=t,this.fps=a}start(){se(this,Ai)===0&&(Se(this,ia,performance.now()),Se(this,Es,se(this,ia)),Se(this,gs,0),se(this,ys).call(this))}stop(){se(this,Ai)!==0&&(cancelAnimationFrame(se(this,Ai)),Se(this,Ai,0))}update({start:e,duration:t,playbackRate:a}){let r=e-se(this,ta).valueAsNumber,n=Math.abs(t-this.duration);(r>0||r<-.03||n>=.5)&&this.callback(e),Se(this,As,e),Se(this,_s,performance.now()),this.duration=t,this.playbackRate=a}};ta=new WeakMap;Es=new WeakMap;ia=new WeakMap;or=new WeakMap;gs=new WeakMap;_s=new WeakMap;As=new WeakMap;aa=new WeakMap;Ai=new WeakMap;ys=new WeakMap;var Kd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ae=(i,e,t)=>(Kd(i,e,"read from private field"),t?t.call(i):e.get(i)),oe=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},pt=(i,e,t,a)=>(Kd(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),me=(i,e,t)=>(Kd(i,e,"access private method"),t),ra,yi,Is,dr,Cs,Ss,ur,cr,na,sa,lr,Yd,qh,Hd,Ls,Gd,Ms,qd,ws,Zd,$d,Zh,mr,Rs,Fd,Qh,Tb="video not loaded, unknown time.",kb=i=>{let e=i.range,t=ri(+Xh(i)),a=ri(+i.mediaSeekableEnd),r=t&&a?`${t} of ${a}`:Tb;e.setAttribute("aria-valuetext",r)},zh=m.createElement("template");zh.innerHTML=`
1168
1168
  <style>
1169
1169
  :host {
1170
1170
  --media-box-border-radius: 4px;
@@ -1375,10 +1375,10 @@ svg, img, ::slotted(svg), ::slotted(img) {
1375
1375
 
1376
1376
  </slot>
1377
1377
  </div>
1378
- `;var ks=(i,e=i.mediaCurrentTime)=>{let t=Number.isFinite(i.mediaSeekableStart)?i.mediaSeekableStart:0,a=Number.isFinite(i.mediaDuration)?i.mediaDuration:i.mediaSeekableEnd;if(Number.isNaN(a))return 0;let r=(e-t)/(a-t);return Math.max(0,Math.min(r,1))},Xh=(i,e=i.range.valueAsNumber)=>{let t=Number.isFinite(i.mediaSeekableStart)?i.mediaSeekableStart:0,a=Number.isFinite(i.mediaDuration)?i.mediaDuration:i.mediaSeekableEnd;return Number.isNaN(a)?0:e*(a-t)+t},Vd=class extends gi{constructor(){super(),oe(this,sa),oe(this,Yd),oe(this,Ls),oe(this,Ms),oe(this,ws),oe(this,$d),oe(this,mr),oe(this,Fd),oe(this,ra,void 0),oe(this,Ai,void 0),oe(this,Is,void 0),oe(this,dr,void 0),oe(this,Cs,void 0),oe(this,Ss,void 0),oe(this,ur,void 0),oe(this,cr,void 0),oe(this,na,void 0),oe(this,Hd,t=>{this.dragging||(this.range.valueAsNumber=t,this.updateBar())}),this.container.appendChild(zh.content.cloneNode(!0)),ht(this,Is,this.shadowRoot.querySelectorAll('[part~="box"]')),ht(this,Cs,this.shadowRoot.querySelector('[part~="preview-box"]')),ht(this,Ss,this.shadowRoot.querySelector('[part~="current-box"]'));let e=getComputedStyle(this);ht(this,ur,parseInt(e.getPropertyValue("--media-box-padding-left"))),ht(this,cr,parseInt(e.getPropertyValue("--media-box-padding-right"))),ht(this,Ai,new Ts(this.range,ae(this,Hd),60))}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PAUSED,s.MEDIA_DURATION,s.MEDIA_SEEKABLE,s.MEDIA_CURRENT_TIME,s.MEDIA_PREVIEW_IMAGE,s.MEDIA_PREVIEW_TIME,s.MEDIA_PREVIEW_CHAPTER,s.MEDIA_BUFFERED,s.MEDIA_PLAYBACK_RATE,s.MEDIA_LOADING,s.MEDIA_ENDED]}connectedCallback(){var e;super.connectedCallback(),this.range.setAttribute("aria-label",K.SEEK()),me(this,sa,lr).call(this),ht(this,ra,this.getRootNode()),(e=ae(this,ra))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),me(this,sa,lr).call(this),(e=ae(this,ra))==null||e.removeEventListener("transitionstart",this),ht(this,ra,null)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),t!=a&&(e===s.MEDIA_CURRENT_TIME||e===s.MEDIA_PAUSED||e===s.MEDIA_ENDED||e===s.MEDIA_LOADING||e===s.MEDIA_DURATION||e===s.MEDIA_SEEKABLE?(ae(this,Ai).update({start:ks(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),me(this,sa,lr).call(this),kb(this)):e===s.MEDIA_BUFFERED&&this.updateBufferedBar(),(e===s.MEDIA_DURATION||e===s.MEDIA_SEEKABLE)&&(this.mediaChaptersCues=ae(this,na),this.updateBar()))}get mediaChaptersCues(){return ae(this,na)}set mediaChaptersCues(e){var t;ht(this,na,e),this.updateSegments((t=ae(this,na))==null?void 0:t.map(a=>({start:ks(this,a.startTime),end:ks(this,a.endTime)})))}get mediaPaused(){return H(this,s.MEDIA_PAUSED)}set mediaPaused(e){B(this,s.MEDIA_PAUSED,e)}get mediaLoading(){return H(this,s.MEDIA_LOADING)}set mediaLoading(e){B(this,s.MEDIA_LOADING,e)}get mediaDuration(){return x(this,s.MEDIA_DURATION)}set mediaDuration(e){U(this,s.MEDIA_DURATION,e)}get mediaCurrentTime(){return x(this,s.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){U(this,s.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return x(this,s.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){U(this,s.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){let e=this.getAttribute(s.MEDIA_BUFFERED);return e?e.split(" ").map(t=>t.split(":").map(a=>+a)):[]}set mediaBuffered(e){if(!e){this.removeAttribute(s.MEDIA_BUFFERED);return}let t=e.map(a=>a.join(":")).join(" ");this.setAttribute(s.MEDIA_BUFFERED,t)}get mediaSeekable(){let e=this.getAttribute(s.MEDIA_SEEKABLE);if(e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(s.MEDIA_SEEKABLE);return}this.setAttribute(s.MEDIA_SEEKABLE,e.join(":"))}get mediaSeekableEnd(){var e;let[,t=this.mediaDuration]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaSeekableStart(){var e;let[t=0]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaPreviewImage(){return I(this,s.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){k(this,s.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return x(this,s.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){U(this,s.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return H(this,s.MEDIA_ENDED)}set mediaEnded(e){B(this,s.MEDIA_ENDED,e)}updateBar(){super.updateBar(),this.updateBufferedBar(),this.updateCurrentBox()}updateBufferedBar(){var e;let t=this.mediaBuffered;if(!t.length)return;let a;if(this.mediaEnded)a=1;else{let n=this.mediaCurrentTime,[,o=this.mediaSeekableStart]=(e=t.find(([d,u])=>d<=n&&n<=u))!=null?e:[];a=ks(this,o)}let{style:r}=N(this.shadowRoot,"#highlight");r.setProperty("width",`${a*100}%`)}updateCurrentBox(){if(!this.shadowRoot.querySelector('slot[name="current"]').assignedElements().length)return;let t=N(this.shadowRoot,"#current-rail"),a=N(this.shadowRoot,'[part~="current-box"]'),r=me(this,Ls,Gd).call(this,ae(this,Ss)),n=me(this,Ms,qd).call(this,r,this.range.valueAsNumber),o=me(this,ws,Zd).call(this,r,this.range.valueAsNumber);t.style.transform=`translateX(${n})`,t.style.setProperty("--_range-width",`${r.range.width}`),a.style.setProperty("--_box-shift",`${o}`),a.style.setProperty("--_box-width",`${r.box.width}px`),a.style.setProperty("visibility","initial")}handleEvent(e){switch(super.handleEvent(e),e.type){case"input":me(this,Fd,Qh).call(this);break;case"pointermove":me(this,$d,Zh).call(this,e);break;case"pointerup":case"pointerleave":me(this,mr,Rs).call(this,null);break;case"transitionstart":ue(e.target,this)&&setTimeout(()=>me(this,sa,lr).call(this),0);break}}};ra=new WeakMap;Ai=new WeakMap;Is=new WeakMap;dr=new WeakMap;Cs=new WeakMap;Ss=new WeakMap;ur=new WeakMap;cr=new WeakMap;na=new WeakMap;sa=new WeakSet;lr=function(){me(this,Yd,qh).call(this)?ae(this,Ai).start():ae(this,Ai).stop()};Yd=new WeakSet;qh=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&Rc(this)};Hd=new WeakMap;Ls=new WeakSet;Gd=function(i){var e;let a=((e=this.getAttribute("bounds")?Be(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?e:this).getBoundingClientRect(),r=this.range.getBoundingClientRect(),n=i.offsetWidth,o=-(r.left-a.left-n/2),d=a.right-r.left-n/2;return{box:{width:n,min:o,max:d},bounds:a,range:r}};Ms=new WeakSet;qd=function(i,e){let t=`${e*100}%`,{width:a,min:r,max:n}=i.box;if(!a)return t;if(Number.isNaN(r)||(t=`max(${`calc(1 / var(--_range-width) * 100 * ${r}% + var(--media-box-padding-left))`}, ${t})`),!Number.isNaN(n)){let d=`calc(1 / var(--_range-width) * 100 * ${n}% - var(--media-box-padding-right))`;t=`min(${t}, ${d})`}return t};ws=new WeakSet;Zd=function(i,e){let{width:t,min:a,max:r}=i.box,n=e*i.range.width;if(n<a+ae(this,ur)){let o=i.range.left-i.bounds.left-ae(this,ur);return`${n-t/2+o}px`}if(n>r-ae(this,cr)){let o=i.bounds.right-i.range.right-ae(this,cr);return`${n+t/2-o-i.range.width}px`}return 0};$d=new WeakSet;Zh=function(i){let e=[...ae(this,Is)].some(f=>i.composedPath().includes(f));if(!this.dragging&&(e||!i.composedPath().includes(this))){me(this,mr,Rs).call(this,null);return}let t=this.mediaSeekableEnd;if(!t)return;let a=N(this.shadowRoot,"#preview-rail"),r=N(this.shadowRoot,'[part~="preview-box"]'),n=me(this,Ls,Gd).call(this,ae(this,Cs)),o=(i.clientX-n.range.left)/n.range.width;o=Math.max(0,Math.min(1,o));let d=me(this,Ms,qd).call(this,n,o),u=me(this,ws,Zd).call(this,n,o);a.style.transform=`translateX(${d})`,a.style.setProperty("--_range-width",`${n.range.width}`),r.style.setProperty("--_box-shift",`${u}`),r.style.setProperty("--_box-width",`${n.box.width}px`);let c=Math.round(ae(this,dr))-Math.round(o*t);Math.abs(c)<1&&o>.01&&o<.99||(ht(this,dr,o*t),me(this,mr,Rs).call(this,ae(this,dr)))};mr=new WeakSet;Rs=function(i){this.dispatchEvent(new l.CustomEvent(h.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:i}))};Fd=new WeakSet;Qh=function(){ae(this,Ai).stop();let i=Xh(this);this.dispatchEvent(new l.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:i}))};l.customElements.get("media-time-range")||l.customElements.define("media-time-range",Vd);var Sb=1,Ib=i=>i.mediaMuted?0:i.mediaVolume,Cb=({value:i})=>`${Math.round(i*100)}%`,Qd=class extends gi{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_VOLUME,s.MEDIA_MUTED,s.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",()=>{let e=this.range.value,t=new l.CustomEvent(h.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",K.VOLUME())}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),(e===s.MEDIA_VOLUME||e===s.MEDIA_MUTED)&&(this.range.valueAsNumber=Ib(this),this.range.setAttribute("aria-valuetext",Cb(this.range)),this.updateBar())}get mediaVolume(){return x(this,s.MEDIA_VOLUME,Sb)}set mediaVolume(e){U(this,s.MEDIA_VOLUME,e)}get mediaMuted(){return H(this,s.MEDIA_MUTED)}set mediaMuted(e){B(this,s.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return I(this,s.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){k(this,s.MEDIA_VOLUME_UNAVAILABLE,e)}};l.customElements.get("media-volume-range")||l.customElements.define("media-volume-range",Qd);var tu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},de=(i,e,t)=>(tu(i,e,"read from private field"),t?t.call(i):e.get(i)),Ie=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ge=(i,e,t,a)=>(tu(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ye=(i,e,t)=>(tu(i,e,"access private method"),t),pt,Yt,la,hr,xs,Ds,zd,oa,Xd,Os,Jd,pr,Ps,Ns,jd,eu,Jh,iu,jh,Lb=`
1378
+ `;var ks=(i,e=i.mediaCurrentTime)=>{let t=Number.isFinite(i.mediaSeekableStart)?i.mediaSeekableStart:0,a=Number.isFinite(i.mediaDuration)?i.mediaDuration:i.mediaSeekableEnd;if(Number.isNaN(a))return 0;let r=(e-t)/(a-t);return Math.max(0,Math.min(r,1))},Xh=(i,e=i.range.valueAsNumber)=>{let t=Number.isFinite(i.mediaSeekableStart)?i.mediaSeekableStart:0,a=Number.isFinite(i.mediaDuration)?i.mediaDuration:i.mediaSeekableEnd;return Number.isNaN(a)?0:e*(a-t)+t},Vd=class extends _i{constructor(){super(),oe(this,sa),oe(this,Yd),oe(this,Ls),oe(this,Ms),oe(this,ws),oe(this,$d),oe(this,mr),oe(this,Fd),oe(this,ra,void 0),oe(this,yi,void 0),oe(this,Is,void 0),oe(this,dr,void 0),oe(this,Cs,void 0),oe(this,Ss,void 0),oe(this,ur,void 0),oe(this,cr,void 0),oe(this,na,void 0),oe(this,Hd,t=>{this.dragging||(this.range.valueAsNumber=t,this.updateBar())}),this.container.appendChild(zh.content.cloneNode(!0)),pt(this,Is,this.shadowRoot.querySelectorAll('[part~="box"]')),pt(this,Cs,this.shadowRoot.querySelector('[part~="preview-box"]')),pt(this,Ss,this.shadowRoot.querySelector('[part~="current-box"]'));let e=getComputedStyle(this);pt(this,ur,parseInt(e.getPropertyValue("--media-box-padding-left"))),pt(this,cr,parseInt(e.getPropertyValue("--media-box-padding-right"))),pt(this,yi,new Ts(this.range,ae(this,Hd),60))}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PAUSED,s.MEDIA_DURATION,s.MEDIA_SEEKABLE,s.MEDIA_CURRENT_TIME,s.MEDIA_PREVIEW_IMAGE,s.MEDIA_PREVIEW_TIME,s.MEDIA_PREVIEW_CHAPTER,s.MEDIA_BUFFERED,s.MEDIA_PLAYBACK_RATE,s.MEDIA_LOADING,s.MEDIA_ENDED]}connectedCallback(){var e;super.connectedCallback(),this.range.setAttribute("aria-label",K.SEEK()),me(this,sa,lr).call(this),pt(this,ra,this.getRootNode()),(e=ae(this,ra))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),me(this,sa,lr).call(this),(e=ae(this,ra))==null||e.removeEventListener("transitionstart",this),pt(this,ra,null)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),t!=a&&(e===s.MEDIA_CURRENT_TIME||e===s.MEDIA_PAUSED||e===s.MEDIA_ENDED||e===s.MEDIA_LOADING||e===s.MEDIA_DURATION||e===s.MEDIA_SEEKABLE?(ae(this,yi).update({start:ks(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),me(this,sa,lr).call(this),kb(this)):e===s.MEDIA_BUFFERED&&this.updateBufferedBar(),(e===s.MEDIA_DURATION||e===s.MEDIA_SEEKABLE)&&(this.mediaChaptersCues=ae(this,na),this.updateBar()))}get mediaChaptersCues(){return ae(this,na)}set mediaChaptersCues(e){var t;pt(this,na,e),this.updateSegments((t=ae(this,na))==null?void 0:t.map(a=>({start:ks(this,a.startTime),end:ks(this,a.endTime)})))}get mediaPaused(){return H(this,s.MEDIA_PAUSED)}set mediaPaused(e){B(this,s.MEDIA_PAUSED,e)}get mediaLoading(){return H(this,s.MEDIA_LOADING)}set mediaLoading(e){B(this,s.MEDIA_LOADING,e)}get mediaDuration(){return x(this,s.MEDIA_DURATION)}set mediaDuration(e){U(this,s.MEDIA_DURATION,e)}get mediaCurrentTime(){return x(this,s.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){U(this,s.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return x(this,s.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){U(this,s.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){let e=this.getAttribute(s.MEDIA_BUFFERED);return e?e.split(" ").map(t=>t.split(":").map(a=>+a)):[]}set mediaBuffered(e){if(!e){this.removeAttribute(s.MEDIA_BUFFERED);return}let t=e.map(a=>a.join(":")).join(" ");this.setAttribute(s.MEDIA_BUFFERED,t)}get mediaSeekable(){let e=this.getAttribute(s.MEDIA_SEEKABLE);if(e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(s.MEDIA_SEEKABLE);return}this.setAttribute(s.MEDIA_SEEKABLE,e.join(":"))}get mediaSeekableEnd(){var e;let[,t=this.mediaDuration]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaSeekableStart(){var e;let[t=0]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaPreviewImage(){return I(this,s.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){k(this,s.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return x(this,s.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){U(this,s.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return H(this,s.MEDIA_ENDED)}set mediaEnded(e){B(this,s.MEDIA_ENDED,e)}updateBar(){super.updateBar(),this.updateBufferedBar(),this.updateCurrentBox()}updateBufferedBar(){var e;let t=this.mediaBuffered;if(!t.length)return;let a;if(this.mediaEnded)a=1;else{let n=this.mediaCurrentTime,[,o=this.mediaSeekableStart]=(e=t.find(([d,u])=>d<=n&&n<=u))!=null?e:[];a=ks(this,o)}let{style:r}=N(this.shadowRoot,"#highlight");r.setProperty("width",`${a*100}%`)}updateCurrentBox(){if(!this.shadowRoot.querySelector('slot[name="current"]').assignedElements().length)return;let t=N(this.shadowRoot,"#current-rail"),a=N(this.shadowRoot,'[part~="current-box"]'),r=me(this,Ls,Gd).call(this,ae(this,Ss)),n=me(this,Ms,qd).call(this,r,this.range.valueAsNumber),o=me(this,ws,Zd).call(this,r,this.range.valueAsNumber);t.style.transform=`translateX(${n})`,t.style.setProperty("--_range-width",`${r.range.width}`),a.style.setProperty("--_box-shift",`${o}`),a.style.setProperty("--_box-width",`${r.box.width}px`),a.style.setProperty("visibility","initial")}handleEvent(e){switch(super.handleEvent(e),e.type){case"input":me(this,Fd,Qh).call(this);break;case"pointermove":me(this,$d,Zh).call(this,e);break;case"pointerup":case"pointerleave":me(this,mr,Rs).call(this,null);break;case"transitionstart":ue(e.target,this)&&setTimeout(()=>me(this,sa,lr).call(this),0);break}}};ra=new WeakMap;yi=new WeakMap;Is=new WeakMap;dr=new WeakMap;Cs=new WeakMap;Ss=new WeakMap;ur=new WeakMap;cr=new WeakMap;na=new WeakMap;sa=new WeakSet;lr=function(){me(this,Yd,qh).call(this)?ae(this,yi).start():ae(this,yi).stop()};Yd=new WeakSet;qh=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&Rc(this)};Hd=new WeakMap;Ls=new WeakSet;Gd=function(i){var e;let a=((e=this.getAttribute("bounds")?We(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?e:this).getBoundingClientRect(),r=this.range.getBoundingClientRect(),n=i.offsetWidth,o=-(r.left-a.left-n/2),d=a.right-r.left-n/2;return{box:{width:n,min:o,max:d},bounds:a,range:r}};Ms=new WeakSet;qd=function(i,e){let t=`${e*100}%`,{width:a,min:r,max:n}=i.box;if(!a)return t;if(Number.isNaN(r)||(t=`max(${`calc(1 / var(--_range-width) * 100 * ${r}% + var(--media-box-padding-left))`}, ${t})`),!Number.isNaN(n)){let d=`calc(1 / var(--_range-width) * 100 * ${n}% - var(--media-box-padding-right))`;t=`min(${t}, ${d})`}return t};ws=new WeakSet;Zd=function(i,e){let{width:t,min:a,max:r}=i.box,n=e*i.range.width;if(n<a+ae(this,ur)){let o=i.range.left-i.bounds.left-ae(this,ur);return`${n-t/2+o}px`}if(n>r-ae(this,cr)){let o=i.bounds.right-i.range.right-ae(this,cr);return`${n+t/2-o-i.range.width}px`}return 0};$d=new WeakSet;Zh=function(i){let e=[...ae(this,Is)].some(f=>i.composedPath().includes(f));if(!this.dragging&&(e||!i.composedPath().includes(this))){me(this,mr,Rs).call(this,null);return}let t=this.mediaSeekableEnd;if(!t)return;let a=N(this.shadowRoot,"#preview-rail"),r=N(this.shadowRoot,'[part~="preview-box"]'),n=me(this,Ls,Gd).call(this,ae(this,Cs)),o=(i.clientX-n.range.left)/n.range.width;o=Math.max(0,Math.min(1,o));let d=me(this,Ms,qd).call(this,n,o),u=me(this,ws,Zd).call(this,n,o);a.style.transform=`translateX(${d})`,a.style.setProperty("--_range-width",`${n.range.width}`),r.style.setProperty("--_box-shift",`${u}`),r.style.setProperty("--_box-width",`${n.box.width}px`);let c=Math.round(ae(this,dr))-Math.round(o*t);Math.abs(c)<1&&o>.01&&o<.99||(pt(this,dr,o*t),me(this,mr,Rs).call(this,ae(this,dr)))};mr=new WeakSet;Rs=function(i){this.dispatchEvent(new l.CustomEvent(h.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:i}))};Fd=new WeakSet;Qh=function(){ae(this,yi).stop();let i=Xh(this);this.dispatchEvent(new l.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:i}))};l.customElements.get("media-time-range")||l.customElements.define("media-time-range",Vd);var Sb=1,Ib=i=>i.mediaMuted?0:i.mediaVolume,Cb=({value:i})=>`${Math.round(i*100)}%`,Qd=class extends _i{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_VOLUME,s.MEDIA_MUTED,s.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",()=>{let e=this.range.value,t=new l.CustomEvent(h.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",K.VOLUME())}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),(e===s.MEDIA_VOLUME||e===s.MEDIA_MUTED)&&(this.range.valueAsNumber=Ib(this),this.range.setAttribute("aria-valuetext",Cb(this.range)),this.updateBar())}get mediaVolume(){return x(this,s.MEDIA_VOLUME,Sb)}set mediaVolume(e){U(this,s.MEDIA_VOLUME,e)}get mediaMuted(){return H(this,s.MEDIA_MUTED)}set mediaMuted(e){B(this,s.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return I(this,s.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){k(this,s.MEDIA_VOLUME_UNAVAILABLE,e)}};l.customElements.get("media-volume-range")||l.customElements.define("media-volume-range",Qd);var tu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},de=(i,e,t)=>(tu(i,e,"read from private field"),t?t.call(i):e.get(i)),Ie=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},qe=(i,e,t,a)=>(tu(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ge=(i,e,t)=>(tu(i,e,"access private method"),t),vt,Yt,la,hr,xs,Ds,zd,oa,Xd,Os,Jd,pr,Ps,Ns,jd,eu,Jh,iu,jh,Lb=`
1379
1379
  <svg aria-hidden="true" viewBox="0 1 24 24" part="select-indicator indicator">
1380
1380
  <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"/>
1381
- </svg>`;function vt(i,e,t){let a=m.createElement("media-chrome-option");a.part.add("option"),a.value=e,a.selected=t;let r=m.createElement("span");return r.textContent=i,a.append(r),a}function qe(i,e){let t=i.querySelector(`:scope > [slot="${e}"]`);return(t==null?void 0:t.nodeName)=="SLOT"&&(t=t.assignedElements({flatten:!0})[0]),t?(t=t.cloneNode(!0),t.removeAttribute("slot"),t):i.shadowRoot.querySelector(`[name="${e}"] > svg`).cloneNode(!0)}var ep=m.createElement("template");ep.innerHTML=`
1381
+ </svg>`;function ft(i,e,t){let a=m.createElement("media-chrome-option");a.part.add("option"),a.value=e,a.selected=t;let r=m.createElement("span");return r.textContent=i,a.append(r),a}function Ze(i,e){let t=i.querySelector(`:scope > [slot="${e}"]`);return(t==null?void 0:t.nodeName)=="SLOT"&&(t=t.assignedElements({flatten:!0})[0]),t?(t=t.cloneNode(!0),t.removeAttribute("slot"),t):i.shadowRoot.querySelector(`[name="${e}"] > svg`).cloneNode(!0)}var ep=m.createElement("template");ep.innerHTML=`
1382
1382
  <style>
1383
1383
  :host {
1384
1384
  font: var(--media-font,
@@ -1458,7 +1458,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
1458
1458
  <slot name="header"></slot>
1459
1459
  <slot id="container"></slot>
1460
1460
  <slot name="select-indicator" hidden>${Lb}</slot>
1461
- `;var xe=class extends l.HTMLElement{constructor(e={}){super(),Ie(this,Ds),Ie(this,Os),Ie(this,pr),Ie(this,Ns),Ie(this,eu),Ie(this,iu),Ie(this,pt,void 0),Ie(this,Yt,""),Ie(this,la,null),Ie(this,hr,!1),Ie(this,xs,t=>{this.handleClick(t)}),Ie(this,oa,t=>{let{key:a}=t;if(a==="Escape"){this.removeEventListener("keyup",de(this,oa));return}if(a==="Meta"){Ge(this,hr,!1);return}Ye(this,Ds,zd).call(this,t)}),Ie(this,Xd,t=>{let{key:a,altKey:r}=t;if(r){this.removeEventListener("keyup",de(this,oa));return}if(a==="Meta"){Ge(this,hr,!0);return}if(this.keysUsed.includes(a)&&t.preventDefault(),de(this,hr)&&this.keysUsed.includes(a)){Ye(this,Ds,zd).call(this,t);return}this.addEventListener("keyup",de(this,oa),{once:!0})}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.nativeEl=ep.content.cloneNode(!0),e.slotTemplate&&this.nativeEl.append(e.slotTemplate.content.cloneNode(!0)),this.shadowRoot.append(this.nativeEl)),this.container=this.shadowRoot.querySelector("#container"),this.container.addEventListener("slotchange",t=>{for(let a of t.target.assignedNodes({flatten:!0}))a.nodeType===3&&a.textContent.trim()===""&&a.remove()})}static get observedAttributes(){return["disabled","style",y.MEDIA_CONTROLLER]}static formatOptionText(e){return e}formatOptionText(e,t){return this.constructor.formatOptionText(e,t)}get options(){var e;let t=this.querySelectorAll("media-chrome-option");return t.length||(t=(e=this.container)==null?void 0:e.querySelectorAll("media-chrome-option")),Array.from(t)}get selectedOptions(){return this.options.filter(e=>e.selected)}get value(){var e,t;return(t=(e=this.selectedOptions[0])==null?void 0:e.value)!=null?t:""}set value(e){let t=this.options.find(a=>a.value===e);t&&Ye(this,Ns,jd).call(this,t)}focus(){var e;(e=this.selectedOptions[0])==null||e.focus()}enable(){this.addEventListener("click",de(this,xs)),this.addEventListener("keydown",de(this,Xd))}disable(){this.removeEventListener("click",de(this,xs)),this.removeEventListener("keyup",de(this,oa))}attributeChangedCallback(e,t,a){var r,n,o,d,u;e==="style"&&a!==t?Ye(this,Os,Jd).call(this):e===y.MEDIA_CONTROLLER?(t&&((n=(r=de(this,pt))==null?void 0:r.unassociateElement)==null||n.call(r,this),Ge(this,pt,null)),a&&this.isConnected&&(Ge(this,pt,(o=this.getRootNode())==null?void 0:o.getElementById(a)),(u=(d=de(this,pt))==null?void 0:d.associateElement)==null||u.call(d,this))):e==="disabled"&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){var e,t,a;Ye(this,Os,Jd).call(this),this.hasAttribute("disabled")||this.enable(),this.hasAttribute("role")||this.setAttribute("role","listbox");let r=this.getAttribute(y.MEDIA_CONTROLLER);r&&(Ge(this,pt,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=de(this,pt))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;this.disable(),(t=(e=de(this,pt))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ge(this,pt,null)}get keysUsed(){return["Enter"," ","ArrowDown","ArrowUp","Home","End"]}handleSelection(e,t){let a=Ye(this,pr,Ps).call(this,e);a&&Ye(this,Ns,jd).call(this,a,t)}handleMovement(e){let{key:t}=e,a=this.options,r=Ye(this,pr,Ps).call(this,e);r||(r=a.filter(o=>o.getAttribute("tabindex")==="0")[0]);let n;switch(t){case"ArrowDown":n=r.nextElementSibling,n!=null&&n.hasAttribute("disabled")&&(n=n.nextElementSibling);break;case"ArrowUp":n=r.previousElementSibling,n!=null&&n.hasAttribute("disabled")&&(n=n.previousElementSibling);break;case"Home":n=a[0];break;case"End":n=a[a.length-1];break;default:n=Ye(this,eu,Jh).call(this,t);break}n&&(a.forEach(o=>o.setAttribute("tabindex","-1")),n.setAttribute("tabindex","0"),n.focus())}handleClick(e){let t=Ye(this,pr,Ps).call(this,e);!t||t.hasAttribute("disabled")||(this.options.forEach(a=>a.setAttribute("tabindex","-1")),t.setAttribute("tabindex","0"),this.handleSelection(e,this.hasAttribute("aria-multiselectable")&&this.getAttribute("aria-multiselectable")==="true"))}};pt=new WeakMap;Yt=new WeakMap;la=new WeakMap;hr=new WeakMap;xs=new WeakMap;Ds=new WeakSet;zd=function(i){let{key:e}=i;e==="Enter"||e===" "?this.handleSelection(i,this.hasAttribute("aria-multiselectable")&&this.getAttribute("aria-multiselectable")==="true"):this.handleMovement(i)};oa=new WeakMap;Xd=new WeakMap;Os=new WeakSet;Jd=function(){var i;let e=this.shadowRoot.querySelector("#layout-row"),t=((i=getComputedStyle(this).getPropertyValue("--media-listbox-layout"))==null?void 0:i.trim())==="row";e.setAttribute("media",t?"":"width:0")};pr=new WeakSet;Ps=function(i){let e=i.composedPath(),t=e.findIndex(a=>a.nodeName==="MEDIA-CHROME-OPTION");return e[t]};Ns=new WeakSet;jd=function(i,e){let t=[...this.selectedOptions];(!this.hasAttribute("aria-multiselectable")||this.getAttribute("aria-multiselectable")!=="true")&&this.options.forEach(a=>a.selected=!1),e?i.selected=!i.selected:i.selected=!0,this.selectedOptions.some((a,r)=>a!=t[r])&&this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))};eu=new WeakSet;Jh=function(i){Ye(this,iu,jh).call(this);let e=this.options,t=e.findIndex(c=>c.getAttribute("tabindex")==="0");Ge(this,Yt,de(this,Yt)+i);let a=de(this,Yt).split("").every(c=>c===i),r=e.slice(t+(a?1:0)).filter(c=>c.textContent.toLowerCase().startsWith(de(this,Yt))),n=e.slice(0,t-(a?1:0)).filter(c=>c.textContent.toLowerCase().startsWith(de(this,Yt))),o=[],d=[];return a&&(o=e.slice(t+(a?1:0)).filter(c=>c.textContent.startsWith(i)),d=e.slice(0,t-(a?1:0)).filter(c=>c.textContent.startsWith(i))),[...r,...n,...o,...d][0]};iu=new WeakSet;jh=function(){clearTimeout(de(this,la)),Ge(this,la,null),Ge(this,la,setTimeout(()=>{Ge(this,Yt,""),Ge(this,la,null)},500))};l.customElements.get("media-chrome-listbox")||l.customElements.define("media-chrome-listbox",xe);var lu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},nu=(i,e,t)=>(lu(i,e,"read from private field"),t?t.call(i):e.get(i)),au=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ru=(i,e,t,a)=>(lu(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),tp=(i,e,t)=>(lu(i,e,"access private method"),t),Us,da,Bs,su,ip=m.createElement("template");ip.innerHTML=`
1461
+ `;var De=class extends l.HTMLElement{constructor(e={}){super(),Ie(this,Ds),Ie(this,Os),Ie(this,pr),Ie(this,Ns),Ie(this,eu),Ie(this,iu),Ie(this,vt,void 0),Ie(this,Yt,""),Ie(this,la,null),Ie(this,hr,!1),Ie(this,xs,t=>{this.handleClick(t)}),Ie(this,oa,t=>{let{key:a}=t;if(a==="Escape"){this.removeEventListener("keyup",de(this,oa));return}if(a==="Meta"){qe(this,hr,!1);return}Ge(this,Ds,zd).call(this,t)}),Ie(this,Xd,t=>{let{key:a,altKey:r}=t;if(r){this.removeEventListener("keyup",de(this,oa));return}if(a==="Meta"){qe(this,hr,!0);return}if(this.keysUsed.includes(a)&&t.preventDefault(),de(this,hr)&&this.keysUsed.includes(a)){Ge(this,Ds,zd).call(this,t);return}this.addEventListener("keyup",de(this,oa),{once:!0})}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.nativeEl=ep.content.cloneNode(!0),e.slotTemplate&&this.nativeEl.append(e.slotTemplate.content.cloneNode(!0)),this.shadowRoot.append(this.nativeEl)),this.container=this.shadowRoot.querySelector("#container"),this.container.addEventListener("slotchange",t=>{for(let a of t.target.assignedNodes({flatten:!0}))a.nodeType===3&&a.textContent.trim()===""&&a.remove()})}static get observedAttributes(){return["disabled","style",y.MEDIA_CONTROLLER]}static formatOptionText(e){return e}formatOptionText(e,t){return this.constructor.formatOptionText(e,t)}get options(){var e;let t=this.querySelectorAll("media-chrome-option");return t.length||(t=(e=this.container)==null?void 0:e.querySelectorAll("media-chrome-option")),Array.from(t)}get selectedOptions(){return this.options.filter(e=>e.selected)}get value(){var e,t;return(t=(e=this.selectedOptions[0])==null?void 0:e.value)!=null?t:""}set value(e){let t=this.options.find(a=>a.value===e);t&&Ge(this,Ns,jd).call(this,t)}focus(){var e;(e=this.selectedOptions[0])==null||e.focus()}enable(){this.addEventListener("click",de(this,xs)),this.addEventListener("keydown",de(this,Xd))}disable(){this.removeEventListener("click",de(this,xs)),this.removeEventListener("keyup",de(this,oa))}attributeChangedCallback(e,t,a){var r,n,o,d,u;e==="style"&&a!==t?Ge(this,Os,Jd).call(this):e===y.MEDIA_CONTROLLER?(t&&((n=(r=de(this,vt))==null?void 0:r.unassociateElement)==null||n.call(r,this),qe(this,vt,null)),a&&this.isConnected&&(qe(this,vt,(o=this.getRootNode())==null?void 0:o.getElementById(a)),(u=(d=de(this,vt))==null?void 0:d.associateElement)==null||u.call(d,this))):e==="disabled"&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){var e,t,a;Ge(this,Os,Jd).call(this),this.hasAttribute("disabled")||this.enable(),this.hasAttribute("role")||this.setAttribute("role","listbox");let r=this.getAttribute(y.MEDIA_CONTROLLER);r&&(qe(this,vt,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=de(this,vt))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;this.disable(),(t=(e=de(this,vt))==null?void 0:e.unassociateElement)==null||t.call(e,this),qe(this,vt,null)}get keysUsed(){return["Enter"," ","ArrowDown","ArrowUp","Home","End"]}handleSelection(e,t){let a=Ge(this,pr,Ps).call(this,e);a&&Ge(this,Ns,jd).call(this,a,t)}handleMovement(e){let{key:t}=e,a=this.options,r=Ge(this,pr,Ps).call(this,e);r||(r=a.filter(o=>o.getAttribute("tabindex")==="0")[0]);let n;switch(t){case"ArrowDown":n=r.nextElementSibling,n!=null&&n.hasAttribute("disabled")&&(n=n.nextElementSibling);break;case"ArrowUp":n=r.previousElementSibling,n!=null&&n.hasAttribute("disabled")&&(n=n.previousElementSibling);break;case"Home":n=a[0];break;case"End":n=a[a.length-1];break;default:n=Ge(this,eu,Jh).call(this,t);break}n&&(a.forEach(o=>o.setAttribute("tabindex","-1")),n.setAttribute("tabindex","0"),n.focus())}handleClick(e){let t=Ge(this,pr,Ps).call(this,e);!t||t.hasAttribute("disabled")||(this.options.forEach(a=>a.setAttribute("tabindex","-1")),t.setAttribute("tabindex","0"),this.handleSelection(e,this.hasAttribute("aria-multiselectable")&&this.getAttribute("aria-multiselectable")==="true"))}};vt=new WeakMap;Yt=new WeakMap;la=new WeakMap;hr=new WeakMap;xs=new WeakMap;Ds=new WeakSet;zd=function(i){let{key:e}=i;e==="Enter"||e===" "?this.handleSelection(i,this.hasAttribute("aria-multiselectable")&&this.getAttribute("aria-multiselectable")==="true"):this.handleMovement(i)};oa=new WeakMap;Xd=new WeakMap;Os=new WeakSet;Jd=function(){var i;let e=this.shadowRoot.querySelector("#layout-row"),t=((i=getComputedStyle(this).getPropertyValue("--media-listbox-layout"))==null?void 0:i.trim())==="row";e.setAttribute("media",t?"":"width:0")};pr=new WeakSet;Ps=function(i){let e=i.composedPath(),t=e.findIndex(a=>a.nodeName==="MEDIA-CHROME-OPTION");return e[t]};Ns=new WeakSet;jd=function(i,e){let t=[...this.selectedOptions];(!this.hasAttribute("aria-multiselectable")||this.getAttribute("aria-multiselectable")!=="true")&&this.options.forEach(a=>a.selected=!1),e?i.selected=!i.selected:i.selected=!0,this.selectedOptions.some((a,r)=>a!=t[r])&&this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))};eu=new WeakSet;Jh=function(i){Ge(this,iu,jh).call(this);let e=this.options,t=e.findIndex(c=>c.getAttribute("tabindex")==="0");qe(this,Yt,de(this,Yt)+i);let a=de(this,Yt).split("").every(c=>c===i),r=e.slice(t+(a?1:0)).filter(c=>c.textContent.toLowerCase().startsWith(de(this,Yt))),n=e.slice(0,t-(a?1:0)).filter(c=>c.textContent.toLowerCase().startsWith(de(this,Yt))),o=[],d=[];return a&&(o=e.slice(t+(a?1:0)).filter(c=>c.textContent.startsWith(i)),d=e.slice(0,t-(a?1:0)).filter(c=>c.textContent.startsWith(i))),[...r,...n,...o,...d][0]};iu=new WeakSet;jh=function(){clearTimeout(de(this,la)),qe(this,la,null),qe(this,la,setTimeout(()=>{qe(this,Yt,""),qe(this,la,null)},500))};l.customElements.get("media-chrome-listbox")||l.customElements.define("media-chrome-listbox",De);var lu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},nu=(i,e,t)=>(lu(i,e,"read from private field"),t?t.call(i):e.get(i)),au=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ru=(i,e,t,a)=>(lu(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),tp=(i,e,t)=>(lu(i,e,"access private method"),t),Us,da,Bs,su,ip=m.createElement("template");ip.innerHTML=`
1462
1462
  <style>
1463
1463
  :host {
1464
1464
  cursor: pointer;
@@ -1496,7 +1496,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
1496
1496
  }
1497
1497
  </style>
1498
1498
  <slot></slot>
1499
- `;var Gt={VALUE:"value",SELECTED:"selected",DISABLED:"disabled"},Ws=class extends l.HTMLElement{constructor(){super(),au(this,Bs),au(this,Us,!1),au(this,da,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(ip.content.cloneNode(!0)))}static get observedAttributes(){return[Gt.DISABLED,Gt.SELECTED,Gt.VALUE]}get value(){var e;return(e=this.getAttribute(Gt.VALUE))!=null?e:this.text}set value(e){this.setAttribute(Gt.VALUE,e)}get text(){var e;return((e=this.textContent)!=null?e:"").trim()}get selected(){return this.getAttribute("aria-selected")==="true"}set selected(e){ru(this,Us,!0),this.setAttribute("aria-selected",e?"true":"false"),e?this.part.add("option-selected"):this.part.remove("option-selected")}enable(){this.hasAttribute("tabindex")||this.setAttribute("tabindex",-1),this.hasAttribute("aria-selected")||this.setAttribute("aria-selected","false")}disable(){this.removeAttribute("tabindex")}attributeChangedCallback(e,t,a){e===Gt.SELECTED&&!nu(this,Us)?this.setAttribute("aria-selected",a!=null?"true":"false"):e===Gt.DISABLED&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(Gt.DISABLED)||this.enable(),this.setAttribute("role","option"),ru(this,da,ou(this,this.parentNode)),tp(this,Bs,su).call(this)}disconnectedCallback(){this.disable(),tp(this,Bs,su).call(this),ru(this,da,null)}handleClick(){}};Us=new WeakMap;da=new WeakMap;Bs=new WeakSet;su=function(){var i;let e=(i=nu(this,da))==null?void 0:i.options;if(!e)return;let t=e.filter(a=>a.getAttribute("aria-selected")==="true").pop();t||(t=e[0]),nu(this,da).getAttribute("aria-multiselectable")!=="true"&&e.forEach(a=>{a.setAttribute("tabindex","-1"),a.setAttribute("aria-selected","false")}),t==null||t.setAttribute("tabindex","0"),t==null||t.setAttribute("aria-selected","true")};function ou(i,e){if(!i)return null;let{host:t}=i.getRootNode();return!e&&t?ou(i,t):e!=null&&e.options?e:ou(e,e==null?void 0:e.parentNode)}l.customElements.get("media-chrome-option")||l.customElements.define("media-chrome-option",Ws);var uu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},g=(i,e,t)=>(uu(i,e,"read from private field"),t?t.call(i):e.get(i)),Ee=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ft=(i,e,t,a)=>(uu(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),yi=(i,e,t)=>(uu(i,e,"access private method"),t),bt,he,vr,J,Ze,ua,Hs,$s,Fs,Vs,Ks,du,cu,ap,ca,fr,Ti,rp=m.createElement("template");rp.innerHTML=`
1499
+ `;var Gt={VALUE:"value",SELECTED:"selected",DISABLED:"disabled"},Ws=class extends l.HTMLElement{constructor(){super(),au(this,Bs),au(this,Us,!1),au(this,da,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(ip.content.cloneNode(!0)))}static get observedAttributes(){return[Gt.DISABLED,Gt.SELECTED,Gt.VALUE]}get value(){var e;return(e=this.getAttribute(Gt.VALUE))!=null?e:this.text}set value(e){this.setAttribute(Gt.VALUE,e)}get text(){var e;return((e=this.textContent)!=null?e:"").trim()}get selected(){return this.getAttribute("aria-selected")==="true"}set selected(e){ru(this,Us,!0),this.setAttribute("aria-selected",e?"true":"false"),e?this.part.add("option-selected"):this.part.remove("option-selected")}enable(){this.hasAttribute("tabindex")||this.setAttribute("tabindex",-1),this.hasAttribute("aria-selected")||this.setAttribute("aria-selected","false")}disable(){this.removeAttribute("tabindex")}attributeChangedCallback(e,t,a){e===Gt.SELECTED&&!nu(this,Us)?this.setAttribute("aria-selected",a!=null?"true":"false"):e===Gt.DISABLED&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(Gt.DISABLED)||this.enable(),this.setAttribute("role","option"),ru(this,da,ou(this,this.parentNode)),tp(this,Bs,su).call(this)}disconnectedCallback(){this.disable(),tp(this,Bs,su).call(this),ru(this,da,null)}handleClick(){}};Us=new WeakMap;da=new WeakMap;Bs=new WeakSet;su=function(){var i;let e=(i=nu(this,da))==null?void 0:i.options;if(!e)return;let t=e.filter(a=>a.getAttribute("aria-selected")==="true").pop();t||(t=e[0]),nu(this,da).getAttribute("aria-multiselectable")!=="true"&&e.forEach(a=>{a.setAttribute("tabindex","-1"),a.setAttribute("aria-selected","false")}),t==null||t.setAttribute("tabindex","0"),t==null||t.setAttribute("aria-selected","true")};function ou(i,e){if(!i)return null;let{host:t}=i.getRootNode();return!e&&t?ou(i,t):e!=null&&e.options?e:ou(e,e==null?void 0:e.parentNode)}l.customElements.get("media-chrome-option")||l.customElements.define("media-chrome-option",Ws);var uu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},_=(i,e,t)=>(uu(i,e,"read from private field"),t?t.call(i):e.get(i)),Ee=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},bt=(i,e,t,a)=>(uu(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ti=(i,e,t)=>(uu(i,e,"access private method"),t),Et,he,vr,J,Qe,ua,Hs,$s,Fs,Vs,Ks,du,cu,ap,ca,fr,ki,rp=m.createElement("template");rp.innerHTML=`
1500
1500
  <style>
1501
1501
  :host {
1502
1502
  font: var(--media-font,
@@ -1547,22 +1547,22 @@ svg, img, ::slotted(svg), ::slotted(img) {
1547
1547
  <slot></slot>
1548
1548
  </media-chrome-listbox>
1549
1549
  </slot>
1550
- `;var De=class extends l.HTMLElement{constructor(){var e;super(),Ee(this,Ks),Ee(this,cu),Ee(this,ca),Ee(this,bt,void 0),Ee(this,he,void 0),Ee(this,vr,void 0),Ee(this,J,void 0),Ee(this,Ze,void 0),Ee(this,ua,t=>{let{key:a}=t;if(!this.keysUsed.includes(a)){this.removeEventListener("keyup",g(this,ua));return}t.composedPath().includes(g(this,he))&&(a==="Enter"||a===" ")?yi(this,Ks,du).call(this):a==="Escape"&&yi(this,ca,fr).call(this)}),Ee(this,Hs,t=>{let{metaKey:a,altKey:r,key:n}=t;if(a||r||!this.keysUsed.includes(n)){this.removeEventListener("keyup",g(this,ua));return}t.preventDefault(),this.addEventListener("keyup",g(this,ua),{once:!0})}),Ee(this,$s,t=>{t.composedPath().includes(this)||yi(this,ca,fr).call(this)}),Ee(this,Fs,t=>{t.composedPath().includes(g(this,he))&&yi(this,Ks,du).call(this)}),Ee(this,Vs,()=>{yi(this,ca,fr).call(this)}),Ee(this,Ti,()=>{if(g(this,J).offsetWidth===0)return;let t=g(this,J).offsetWidth,a=g(this,he).getBoundingClientRect();if(this.hasAttribute("mediacontroller")||g(this,he).hasAttribute("mediacontroller")||g(this,J).hasAttribute("mediacontroller")){g(this,J).style.zIndex="1",g(this,J).style.bottom="unset",g(this,J).style.right=null,g(this,J).style.left="0",g(this,J).style.top=`${a.height}px`;return}let n=br(this).getBoundingClientRect(),o=a.x+t,d=Math.max(a.right-o,a.right-n.right);g(this,J).style.left=null,g(this,J).style.right=`${d}px`,g(this,J).style.maxHeight=`${n.height-a.height}px`}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(rp.content.cloneNode(!0))),(e=this.init)==null||e.call(this),ft(this,he,this.shadowRoot.querySelector("[part=button]")),ft(this,J,this.shadowRoot.querySelector("[part=listbox]")),ft(this,vr,this.shadowRoot.querySelector("slot[name=button]")),g(this,vr).addEventListener("slotchange",()=>{let t=g(this,vr).assignedElements()[0];if(!t)return;ft(this,he,t),g(this,he).preventClick=!0,this.hasAttribute("disabled")||g(this,he).hasAttribute("disabled")?this.disable():(this.enable(),g(this,he).setAttribute("aria-haspopup","listbox"))}),ft(this,Ze,this.shadowRoot.querySelector("slot[name=listbox]")),g(this,Ze).addEventListener("slotchange",()=>{ft(this,J,g(this,Ze).assignedElements()[0]||g(this,J))})}static get observedAttributes(){return["disabled",y.MEDIA_CONTROLLER]}enable(){g(this,he).toggleAttribute("disabled",!1),this.addEventListener("change",g(this,Vs)),this.addEventListener("keydown",g(this,Hs)),this.addEventListener("click",g(this,Fs)),m.addEventListener("click",g(this,$s))}disable(){g(this,he).toggleAttribute("disabled",!0),this.removeEventListener("change",g(this,Vs)),this.removeEventListener("keydown",g(this,Hs)),this.removeEventListener("keyup",g(this,ua)),this.removeEventListener("click",g(this,Fs)),m.removeEventListener("click",g(this,$s))}attributeChangedCallback(e,t,a){var r,n,o,d,u;e===y.MEDIA_CONTROLLER?(t&&((n=(r=g(this,bt))==null?void 0:r.unassociateElement)==null||n.call(r,this),ft(this,bt,null),g(this,J).removeAttribute(y.MEDIA_CONTROLLER)),a&&this.isConnected&&(ft(this,bt,(o=this.getRootNode())==null?void 0:o.getElementById(a)),(u=(d=g(this,bt))==null?void 0:d.associateElement)==null||u.call(d,this),g(this,J).setAttribute(y.MEDIA_CONTROLLER,a))):e==="disabled"&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){var e,t,a;let{style:r}=N(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`);let n=this.getAttribute(y.MEDIA_CONTROLLER);n&&(ft(this,bt,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(t=g(this,bt))==null?void 0:t.associateElement)==null||a.call(t,this),g(this,J).setAttribute(y.MEDIA_CONTROLLER,n)),this.hasAttribute("disabled")||this.enable(),g(this,Ze).hidden||Le(br(this),g(this,Ti))}disconnectedCallback(){var e,t;Xe(br(this),g(this,Ti)),this.disable(),(t=(e=g(this,bt))==null?void 0:e.unassociateElement)==null||t.call(e,this),ft(this,bt,null),g(this,J).removeAttribute(y.MEDIA_CONTROLLER)}get keysUsed(){return["Enter","Escape"," ","ArrowUp","ArrowDown","f","c","k","m"]}};bt=new WeakMap;he=new WeakMap;vr=new WeakMap;J=new WeakMap;Ze=new WeakMap;ua=new WeakMap;Hs=new WeakMap;$s=new WeakMap;Fs=new WeakMap;Vs=new WeakMap;Ks=new WeakSet;du=function(){g(this,Ze).hidden?yi(this,cu,ap).call(this):yi(this,ca,fr).call(this)};cu=new WeakSet;ap=function(){g(this,Ze).hidden&&(g(this,Ze).hidden=!1,g(this,he).setAttribute("aria-expanded","true"),g(this,Ti).call(this),g(this,J).focus(),Le(br(this),g(this,Ti)))};ca=new WeakSet;fr=function(){if(g(this,Ze).hidden)return;Xe(br(this),g(this,Ti));let i=ri();g(this,Ze).hidden=!0,g(this,he).setAttribute("aria-expanded","false"),ue(g(this,J),i)&&g(this,he).focus()};Ti=new WeakMap;function br(i){var e;return(e=i.getAttribute("bounds")?Be(i,`#${i.getAttribute("bounds")}`):Mb(i)||i.parentElement)!=null?e:i}function Mb(i){var e;let t=i.getAttribute(y.MEDIA_CONTROLLER);return t?(e=i.getRootNode())==null?void 0:e.getElementById(t):Be(i,"media-controller")}l.customElements.get("media-chrome-selectmenu")||l.customElements.define("media-chrome-selectmenu",De);var fu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},wb=(i,e,t)=>(fu(i,e,"read from private field"),t?t.call(i):e.get(i)),mu=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Rb=(i,e,t,a)=>(fu(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),hu=(i,e,t)=>(fu(i,e,"access private method"),t),Gs,pu,op,Ys,vu,xb=`
1550
+ `;var Oe=class extends l.HTMLElement{constructor(){var e;super(),Ee(this,Ks),Ee(this,cu),Ee(this,ca),Ee(this,Et,void 0),Ee(this,he,void 0),Ee(this,vr,void 0),Ee(this,J,void 0),Ee(this,Qe,void 0),Ee(this,ua,t=>{let{key:a}=t;if(!this.keysUsed.includes(a)){this.removeEventListener("keyup",_(this,ua));return}t.composedPath().includes(_(this,he))&&(a==="Enter"||a===" ")?Ti(this,Ks,du).call(this):a==="Escape"&&Ti(this,ca,fr).call(this)}),Ee(this,Hs,t=>{let{metaKey:a,altKey:r,key:n}=t;if(a||r||!this.keysUsed.includes(n)){this.removeEventListener("keyup",_(this,ua));return}t.preventDefault(),this.addEventListener("keyup",_(this,ua),{once:!0})}),Ee(this,$s,t=>{t.composedPath().includes(this)||Ti(this,ca,fr).call(this)}),Ee(this,Fs,t=>{t.composedPath().includes(_(this,he))&&Ti(this,Ks,du).call(this)}),Ee(this,Vs,()=>{Ti(this,ca,fr).call(this)}),Ee(this,ki,()=>{if(_(this,J).offsetWidth===0)return;let t=_(this,J).offsetWidth,a=_(this,he).getBoundingClientRect();if(this.hasAttribute("mediacontroller")||_(this,he).hasAttribute("mediacontroller")||_(this,J).hasAttribute("mediacontroller")){_(this,J).style.zIndex="1",_(this,J).style.bottom="unset",_(this,J).style.right=null,_(this,J).style.left="0",_(this,J).style.top=`${a.height}px`;return}let n=br(this).getBoundingClientRect(),o=a.x+t,d=Math.max(a.right-o,a.right-n.right);_(this,J).style.left=null,_(this,J).style.right=`${d}px`,_(this,J).style.maxHeight=`${n.height-a.height}px`}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(rp.content.cloneNode(!0))),(e=this.init)==null||e.call(this),bt(this,he,this.shadowRoot.querySelector("[part=button]")),bt(this,J,this.shadowRoot.querySelector("[part=listbox]")),bt(this,vr,this.shadowRoot.querySelector("slot[name=button]")),_(this,vr).addEventListener("slotchange",()=>{let t=_(this,vr).assignedElements()[0];if(!t)return;bt(this,he,t),_(this,he).preventClick=!0,this.hasAttribute("disabled")||_(this,he).hasAttribute("disabled")?this.disable():(this.enable(),_(this,he).setAttribute("aria-haspopup","listbox"))}),bt(this,Qe,this.shadowRoot.querySelector("slot[name=listbox]")),_(this,Qe).addEventListener("slotchange",()=>{bt(this,J,_(this,Qe).assignedElements()[0]||_(this,J))})}static get observedAttributes(){return["disabled",y.MEDIA_CONTROLLER]}enable(){_(this,he).toggleAttribute("disabled",!1),this.addEventListener("change",_(this,Vs)),this.addEventListener("keydown",_(this,Hs)),this.addEventListener("click",_(this,Fs)),m.addEventListener("click",_(this,$s))}disable(){_(this,he).toggleAttribute("disabled",!0),this.removeEventListener("change",_(this,Vs)),this.removeEventListener("keydown",_(this,Hs)),this.removeEventListener("keyup",_(this,ua)),this.removeEventListener("click",_(this,Fs)),m.removeEventListener("click",_(this,$s))}attributeChangedCallback(e,t,a){var r,n,o,d,u;e===y.MEDIA_CONTROLLER?(t&&((n=(r=_(this,Et))==null?void 0:r.unassociateElement)==null||n.call(r,this),bt(this,Et,null),_(this,J).removeAttribute(y.MEDIA_CONTROLLER)),a&&this.isConnected&&(bt(this,Et,(o=this.getRootNode())==null?void 0:o.getElementById(a)),(u=(d=_(this,Et))==null?void 0:d.associateElement)==null||u.call(d,this),_(this,J).setAttribute(y.MEDIA_CONTROLLER,a))):e==="disabled"&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){var e,t,a;let{style:r}=N(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`);let n=this.getAttribute(y.MEDIA_CONTROLLER);n&&(bt(this,Et,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(t=_(this,Et))==null?void 0:t.associateElement)==null||a.call(t,this),_(this,J).setAttribute(y.MEDIA_CONTROLLER,n)),this.hasAttribute("disabled")||this.enable(),_(this,Qe).hidden||Me(br(this),_(this,ki))}disconnectedCallback(){var e,t;Je(br(this),_(this,ki)),this.disable(),(t=(e=_(this,Et))==null?void 0:e.unassociateElement)==null||t.call(e,this),bt(this,Et,null),_(this,J).removeAttribute(y.MEDIA_CONTROLLER)}get keysUsed(){return["Enter","Escape"," ","ArrowUp","ArrowDown","f","c","k","m"]}};Et=new WeakMap;he=new WeakMap;vr=new WeakMap;J=new WeakMap;Qe=new WeakMap;ua=new WeakMap;Hs=new WeakMap;$s=new WeakMap;Fs=new WeakMap;Vs=new WeakMap;Ks=new WeakSet;du=function(){_(this,Qe).hidden?Ti(this,cu,ap).call(this):Ti(this,ca,fr).call(this)};cu=new WeakSet;ap=function(){_(this,Qe).hidden&&(_(this,Qe).hidden=!1,_(this,he).setAttribute("aria-expanded","true"),_(this,ki).call(this),_(this,J).focus(),Me(br(this),_(this,ki)))};ca=new WeakSet;fr=function(){if(_(this,Qe).hidden)return;Je(br(this),_(this,ki));let i=ni();_(this,Qe).hidden=!0,_(this,he).setAttribute("aria-expanded","false"),ue(_(this,J),i)&&_(this,he).focus()};ki=new WeakMap;function br(i){var e;return(e=i.getAttribute("bounds")?We(i,`#${i.getAttribute("bounds")}`):Mb(i)||i.parentElement)!=null?e:i}function Mb(i){var e;let t=i.getAttribute(y.MEDIA_CONTROLLER);return t?(e=i.getRootNode())==null?void 0:e.getElementById(t):We(i,"media-controller")}l.customElements.get("media-chrome-selectmenu")||l.customElements.define("media-chrome-selectmenu",Oe);var fu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},wb=(i,e,t)=>(fu(i,e,"read from private field"),t?t.call(i):e.get(i)),mu=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Rb=(i,e,t,a)=>(fu(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),hu=(i,e,t)=>(fu(i,e,"access private method"),t),Gs,pu,op,Ys,vu,xb=`
1551
1551
  <svg aria-hidden="true" viewBox="0 0 26 24" part="captions-indicator indicator">
1552
1552
  <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"/>
1553
1553
  </svg>`,lp=m.createElement("template");lp.innerHTML=`
1554
1554
  <slot name="captions-indicator" hidden>${xb}</slot>
1555
- `;var qs=class extends xe{constructor(){super({slotTemplate:lp}),mu(this,pu),mu(this,Ys),mu(this,Gs,void 0)}static get observedAttributes(){return[...super.observedAttributes,"aria-multiselectable",s.MEDIA_SUBTITLES_LIST,s.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_SUBTITLES_LIST&&t!==a?hu(this,pu,op).call(this):e===s.MEDIA_SUBTITLES_SHOWING&&t!==a?this.value=a:e==="aria-multiselectable"&&(this.removeAttribute("aria-multiselectable"),console.warn("Captions List doesn't currently support multiple selections. You can enable multiple items via the media.textTracks API."))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",hu(this,Ys,vu))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",hu(this,Ys,vu))}get mediaSubtitlesList(){return np(this,s.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){sp(this,s.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return np(this,s.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){sp(this,s.MEDIA_SUBTITLES_SHOWING,e)}};Gs=new WeakMap;pu=new WeakSet;op=function(){var i;if(wb(this,Gs)===JSON.stringify(this.mediaSubtitlesList))return;Rb(this,Gs,JSON.stringify(this.mediaSubtitlesList));let e=this.shadowRoot.querySelector("#container");e.textContent="";let t=!this.value,a=vt(this.formatOptionText("Off"),"off",t);a.prepend(qe(this,"select-indicator")),e.append(a);let r=this.mediaSubtitlesList;for(let n of r){let o=vt(this.formatOptionText(n.label,n),li(n),this.value==li(n));o.prepend(qe(this,"select-indicator")),((i=n.kind)!=null?i:"subs")==="captions"&&o.append(qe(this,"captions-indicator")),e.append(o)}};Ys=new WeakSet;vu=function(){let i=this.mediaSubtitlesShowing,e=this.getAttribute(s.MEDIA_SUBTITLES_SHOWING),t=this.value!==e;if(i!=null&&i.length&&t&&this.dispatchEvent(new l.CustomEvent(h.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:i})),!this.value||!t)return;let a=new l.CustomEvent(h.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(a)};var np=(i,e)=>{let t=i.getAttribute(e);return t?kt(t):[]},sp=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let a=He(t);i.getAttribute(e)!==a&&i.setAttribute(e,a)};l.customElements.get("media-captions-listbox")||l.customElements.define("media-captions-listbox",qs);var Zs=class extends De{init(){let e=m.createElement("media-captions-button");e.part.add("button"),e.preventClick=!0;let t=m.createElement("media-captions-listbox");t.part.add("listbox"),t.setAttribute("exportparts","option, option-selected, indicator");let a=this.shadowRoot.querySelector("slot[name=button]"),r=this.shadowRoot.querySelector("slot[name=listbox]");a.textContent="",r.textContent="",a.append(e),r.append(t)}};l.customElements.get("media-captions-selectmenu")||l.customElements.define("media-captions-selectmenu",Zs);var dp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Qs=(i,e,t)=>(dp(i,e,"read from private field"),t?t.call(i):e.get(i)),bu=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Er=(i,e,t)=>(dp(i,e,"access private method"),t),ma,gr,zs,Xs,gu,Eu={RATES:"rates"},Js=class extends xe{constructor(){super(),bu(this,gr),bu(this,Xs),bu(this,ma,new Me(this,Eu.RATES,{defaultValue:ir})),Er(this,gr,zs).call(this)}static get observedAttributes(){return[...super.observedAttributes,"aria-multiselectable",s.MEDIA_PLAYBACK_RATE,Eu.RATES]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_PLAYBACK_RATE&&t!=a?this.value=a:e===Eu.RATES&&t!=a&&(Qs(this,ma).value=a,Er(this,gr,zs).call(this))}get rates(){return Qs(this,ma)}set rates(e){e?Array.isArray(e)&&(Qs(this,ma).value=e.join(" ")):Qs(this,ma).value="",Er(this,gr,zs).call(this)}get mediaPlaybackRate(){return x(this,s.MEDIA_PLAYBACK_RATE,Kt)}set mediaPlaybackRate(e){U(this,s.MEDIA_PLAYBACK_RATE,e)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Er(this,Xs,gu))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Er(this,Xs,gu))}};ma=new WeakMap;gr=new WeakSet;zs=function(){let i=this.shadowRoot.querySelector("#container");i.textContent="";for(let e of this.rates){let t=vt(this.formatOptionText(`${e}x`,e),e,this.mediaPlaybackRate==e);t.prepend(qe(this,"select-indicator")),i.append(t)}};Xs=new WeakSet;gu=function(){if(!this.value)return;let i=new l.CustomEvent(h.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};l.customElements.get("media-playback-rate-listbox")||l.customElements.define("media-playback-rate-listbox",Js);var js=class extends De{init(){let e=m.createElement("media-playback-rate-button");e.part.add("button"),e.preventClick=!0;let t=m.createElement("media-playback-rate-listbox");t.part.add("listbox"),t.setAttribute("exportparts","option, option-selected, indicator");let a=this.shadowRoot.querySelector("slot[name=button]"),r=this.shadowRoot.querySelector("slot[name=listbox]");a.textContent="",r.textContent="",a.append(e),r.append(t)}};l.customElements.get("media-playback-rate-selectmenu")||l.customElements.define("media-playback-rate-selectmenu",js);var Tu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},up=(i,e,t)=>(Tu(i,e,"read from private field"),t?t.call(i):e.get(i)),eo=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},_u=(i,e,t,a)=>(Tu(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),to=(i,e,t)=>(Tu(i,e,"access private method"),t),_r,ro,io,Au,ao,yu,no=class extends xe{constructor(){super(...arguments),eo(this,io),eo(this,ao),eo(this,_r,[]),eo(this,ro,void 0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_RENDITION_LIST,s.MEDIA_RENDITION_SELECTED]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_RENDITION_SELECTED&&t!==a?this.value=a!=null?a:"auto":e===s.MEDIA_RENDITION_LIST&&t!==a&&(_u(this,_r,$r(a)),to(this,io,Au).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",to(this,ao,yu))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",to(this,ao,yu))}get mediaRenditionList(){return up(this,_r)}set mediaRenditionList(e){_u(this,_r,e),to(this,io,Au).call(this)}get mediaRenditionSelected(){return I(this,s.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){k(this,s.MEDIA_RENDITION_SELECTED,e)}};_r=new WeakMap;ro=new WeakMap;io=new WeakSet;Au=function(){if(up(this,ro)===JSON.stringify(this.mediaRenditionList))return;_u(this,ro,JSON.stringify(this.mediaRenditionList));let i=this.mediaRenditionList.sort((r,n)=>n.height-r.height),e=this.shadowRoot.querySelector("#container");e.textContent="";let t=!this.mediaRenditionSelected;for(let r of i){let n=this.formatOptionText(`${Math.min(r.width,r.height)}p`,r),o=vt(n,`${r.id}`,r.selected&&!t);o.prepend(qe(this,"select-indicator")),e.append(o)}let a=vt(this.formatOptionText("Auto"),"auto",t);a.prepend(qe(this,"select-indicator")),e.append(a)};ao=new WeakSet;yu=function(){if(this.value==null)return;let i=new l.CustomEvent(h.MEDIA_RENDITION_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};l.customElements.get("media-rendition-listbox")||l.customElements.define("media-rendition-listbox",no);var Db=`<svg aria-hidden="true" viewBox="0 0 24 24">
1555
+ `;var qs=class extends De{constructor(){super({slotTemplate:lp}),mu(this,pu),mu(this,Ys),mu(this,Gs,void 0)}static get observedAttributes(){return[...super.observedAttributes,"aria-multiselectable",s.MEDIA_SUBTITLES_LIST,s.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_SUBTITLES_LIST&&t!==a?hu(this,pu,op).call(this):e===s.MEDIA_SUBTITLES_SHOWING&&t!==a?this.value=a:e==="aria-multiselectable"&&(this.removeAttribute("aria-multiselectable"),console.warn("Captions List doesn't currently support multiple selections. You can enable multiple items via the media.textTracks API."))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",hu(this,Ys,vu))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",hu(this,Ys,vu))}get mediaSubtitlesList(){return np(this,s.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){sp(this,s.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return np(this,s.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){sp(this,s.MEDIA_SUBTITLES_SHOWING,e)}};Gs=new WeakMap;pu=new WeakSet;op=function(){var i;if(wb(this,Gs)===JSON.stringify(this.mediaSubtitlesList))return;Rb(this,Gs,JSON.stringify(this.mediaSubtitlesList));let e=this.shadowRoot.querySelector("#container");e.textContent="";let t=!this.value,a=ft(this.formatOptionText("Off"),"off",t);a.prepend(Ze(this,"select-indicator")),e.append(a);let r=this.mediaSubtitlesList;for(let n of r){let o=ft(this.formatOptionText(n.label,n),di(n),this.value==di(n));o.prepend(Ze(this,"select-indicator")),((i=n.kind)!=null?i:"subs")==="captions"&&o.append(Ze(this,"captions-indicator")),e.append(o)}};Ys=new WeakSet;vu=function(){let i=this.mediaSubtitlesShowing,e=this.getAttribute(s.MEDIA_SUBTITLES_SHOWING),t=this.value!==e;if(i!=null&&i.length&&t&&this.dispatchEvent(new l.CustomEvent(h.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:i})),!this.value||!t)return;let a=new l.CustomEvent(h.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(a)};var np=(i,e)=>{let t=i.getAttribute(e);return t?St(t):[]},sp=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let a=$e(t);i.getAttribute(e)!==a&&i.setAttribute(e,a)};l.customElements.get("media-captions-listbox")||l.customElements.define("media-captions-listbox",qs);var Zs=class extends Oe{init(){let e=m.createElement("media-captions-button");e.part.add("button"),e.preventClick=!0;let t=m.createElement("media-captions-listbox");t.part.add("listbox"),t.setAttribute("exportparts","option, option-selected, indicator");let a=this.shadowRoot.querySelector("slot[name=button]"),r=this.shadowRoot.querySelector("slot[name=listbox]");a.textContent="",r.textContent="",a.append(e),r.append(t)}};l.customElements.get("media-captions-selectmenu")||l.customElements.define("media-captions-selectmenu",Zs);var dp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Qs=(i,e,t)=>(dp(i,e,"read from private field"),t?t.call(i):e.get(i)),bu=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Er=(i,e,t)=>(dp(i,e,"access private method"),t),ma,gr,zs,Xs,gu,Eu={RATES:"rates"},Js=class extends De{constructor(){super(),bu(this,gr),bu(this,Xs),bu(this,ma,new we(this,Eu.RATES,{defaultValue:ir})),Er(this,gr,zs).call(this)}static get observedAttributes(){return[...super.observedAttributes,"aria-multiselectable",s.MEDIA_PLAYBACK_RATE,Eu.RATES]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_PLAYBACK_RATE&&t!=a?this.value=a:e===Eu.RATES&&t!=a&&(Qs(this,ma).value=a,Er(this,gr,zs).call(this))}get rates(){return Qs(this,ma)}set rates(e){e?Array.isArray(e)&&(Qs(this,ma).value=e.join(" ")):Qs(this,ma).value="",Er(this,gr,zs).call(this)}get mediaPlaybackRate(){return x(this,s.MEDIA_PLAYBACK_RATE,Kt)}set mediaPlaybackRate(e){U(this,s.MEDIA_PLAYBACK_RATE,e)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Er(this,Xs,gu))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Er(this,Xs,gu))}};ma=new WeakMap;gr=new WeakSet;zs=function(){let i=this.shadowRoot.querySelector("#container");i.textContent="";for(let e of this.rates){let t=ft(this.formatOptionText(`${e}x`,e),e,this.mediaPlaybackRate==e);t.prepend(Ze(this,"select-indicator")),i.append(t)}};Xs=new WeakSet;gu=function(){if(!this.value)return;let i=new l.CustomEvent(h.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};l.customElements.get("media-playback-rate-listbox")||l.customElements.define("media-playback-rate-listbox",Js);var js=class extends Oe{init(){let e=m.createElement("media-playback-rate-button");e.part.add("button"),e.preventClick=!0;let t=m.createElement("media-playback-rate-listbox");t.part.add("listbox"),t.setAttribute("exportparts","option, option-selected, indicator");let a=this.shadowRoot.querySelector("slot[name=button]"),r=this.shadowRoot.querySelector("slot[name=listbox]");a.textContent="",r.textContent="",a.append(e),r.append(t)}};l.customElements.get("media-playback-rate-selectmenu")||l.customElements.define("media-playback-rate-selectmenu",js);var Tu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},up=(i,e,t)=>(Tu(i,e,"read from private field"),t?t.call(i):e.get(i)),eo=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},_u=(i,e,t,a)=>(Tu(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),to=(i,e,t)=>(Tu(i,e,"access private method"),t),_r,ro,io,Au,ao,yu,no=class extends De{constructor(){super(...arguments),eo(this,io),eo(this,ao),eo(this,_r,[]),eo(this,ro,void 0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_RENDITION_LIST,s.MEDIA_RENDITION_SELECTED]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_RENDITION_SELECTED&&t!==a?this.value=a!=null?a:"auto":e===s.MEDIA_RENDITION_LIST&&t!==a&&(_u(this,_r,$r(a)),to(this,io,Au).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",to(this,ao,yu))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",to(this,ao,yu))}get mediaRenditionList(){return up(this,_r)}set mediaRenditionList(e){_u(this,_r,e),to(this,io,Au).call(this)}get mediaRenditionSelected(){return I(this,s.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){k(this,s.MEDIA_RENDITION_SELECTED,e)}};_r=new WeakMap;ro=new WeakMap;io=new WeakSet;Au=function(){if(up(this,ro)===JSON.stringify(this.mediaRenditionList))return;_u(this,ro,JSON.stringify(this.mediaRenditionList));let i=this.mediaRenditionList.sort((r,n)=>n.height-r.height),e=this.shadowRoot.querySelector("#container");e.textContent="";let t=!this.mediaRenditionSelected;for(let r of i){let n=this.formatOptionText(`${Math.min(r.width,r.height)}p`,r),o=ft(n,`${r.id}`,r.selected&&!t);o.prepend(Ze(this,"select-indicator")),e.append(o)}let a=ft(this.formatOptionText("Auto"),"auto",t);a.prepend(Ze(this,"select-indicator")),e.append(a)};ao=new WeakSet;yu=function(){if(this.value==null)return;let i=new l.CustomEvent(h.MEDIA_RENDITION_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};l.customElements.get("media-rendition-listbox")||l.customElements.define("media-rendition-listbox",no);var Db=`<svg aria-hidden="true" viewBox="0 0 24 24">
1556
1556
  <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" />
1557
1557
  </svg>`,cp=m.createElement("template");cp.innerHTML=`
1558
1558
  <slot name="icon">${Db}</slot>
1559
- `;var ku=class extends P{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_RENDITION_SELECTED,s.MEDIA_RENDITION_UNAVAILABLE]}constructor(){super({slotTemplate:cp})}get mediaRenditionSelected(){return I(this,s.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){k(this,s.MEDIA_RENDITION_SELECTED,e)}};l.customElements.get("media-rendition-button")||l.customElements.define("media-rendition-button",ku);var so=class extends De{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_RENDITION_SELECTED,s.MEDIA_RENDITION_UNAVAILABLE]}init(){let e=m.createElement("media-rendition-button");e.part.add("button"),e.preventClick=!0;let t=m.createElement("media-rendition-listbox");t.part.add("listbox"),t.setAttribute("exportparts","option, option-selected, indicator");let a=this.shadowRoot.querySelector("slot[name=button]"),r=this.shadowRoot.querySelector("slot[name=listbox]");a.textContent="",r.textContent="",a.append(e),r.append(t)}};l.customElements.get("media-rendition-selectmenu")||l.customElements.define("media-rendition-selectmenu",so);var Lu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},mp=(i,e,t)=>(Lu(i,e,"read from private field"),t?t.call(i):e.get(i)),oo=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Su=(i,e,t,a)=>(Lu(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),lo=(i,e,t)=>(Lu(i,e,"access private method"),t),Ar,mo,uo,Iu,co,Cu,ho=class extends xe{constructor(){super(...arguments),oo(this,uo),oo(this,co),oo(this,Ar,[]),oo(this,mo,void 0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_AUDIO_TRACK_LIST,s.MEDIA_AUDIO_TRACK_ENABLED]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_AUDIO_TRACK_ENABLED&&t!==a?this.value=a:e===s.MEDIA_AUDIO_TRACK_LIST&&t!==a&&(Su(this,Ar,Fr(a)),lo(this,uo,Iu).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",lo(this,co,Cu))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",lo(this,co,Cu))}get mediaAudioTrackList(){return mp(this,Ar)}set mediaAudioTrackList(e){Su(this,Ar,e),lo(this,uo,Iu).call(this)}get mediaAudioTrackEnabled(){return I(this,s.MEDIA_AUDIO_TRACK_ENABLED)}set mediaAudioTrackEnabled(e){k(this,s.MEDIA_AUDIO_TRACK_ENABLED,e)}};Ar=new WeakMap;mo=new WeakMap;uo=new WeakSet;Iu=function(){if(mp(this,mo)===JSON.stringify(this.mediaAudioTrackList))return;Su(this,mo,JSON.stringify(this.mediaAudioTrackList));let i=this.mediaAudioTrackList,e=this.shadowRoot.querySelector("#container");e.textContent="";for(let t of i){let a=this.formatOptionText(t.label,t),r=vt(a,`${t.id}`,t.enabled);r.prepend(qe(this,"select-indicator")),e.append(r)}};co=new WeakSet;Cu=function(){if(this.value==null)return;let i=new l.CustomEvent(h.MEDIA_AUDIO_TRACK_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};l.customElements.get("media-audio-track-listbox")||l.customElements.define("media-audio-track-listbox",ho);var Ob=`<svg aria-hidden="true" viewBox="0 0 24 24">
1559
+ `;var ku=class extends P{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_RENDITION_SELECTED,s.MEDIA_RENDITION_UNAVAILABLE]}constructor(){super({slotTemplate:cp})}get mediaRenditionSelected(){return I(this,s.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){k(this,s.MEDIA_RENDITION_SELECTED,e)}};l.customElements.get("media-rendition-button")||l.customElements.define("media-rendition-button",ku);var so=class extends Oe{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_RENDITION_SELECTED,s.MEDIA_RENDITION_UNAVAILABLE]}init(){let e=m.createElement("media-rendition-button");e.part.add("button"),e.preventClick=!0;let t=m.createElement("media-rendition-listbox");t.part.add("listbox"),t.setAttribute("exportparts","option, option-selected, indicator");let a=this.shadowRoot.querySelector("slot[name=button]"),r=this.shadowRoot.querySelector("slot[name=listbox]");a.textContent="",r.textContent="",a.append(e),r.append(t)}};l.customElements.get("media-rendition-selectmenu")||l.customElements.define("media-rendition-selectmenu",so);var Lu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},mp=(i,e,t)=>(Lu(i,e,"read from private field"),t?t.call(i):e.get(i)),oo=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Su=(i,e,t,a)=>(Lu(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),lo=(i,e,t)=>(Lu(i,e,"access private method"),t),Ar,mo,uo,Iu,co,Cu,ho=class extends De{constructor(){super(...arguments),oo(this,uo),oo(this,co),oo(this,Ar,[]),oo(this,mo,void 0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_AUDIO_TRACK_LIST,s.MEDIA_AUDIO_TRACK_ENABLED]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_AUDIO_TRACK_ENABLED&&t!==a?this.value=a:e===s.MEDIA_AUDIO_TRACK_LIST&&t!==a&&(Su(this,Ar,Fr(a)),lo(this,uo,Iu).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",lo(this,co,Cu))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",lo(this,co,Cu))}get mediaAudioTrackList(){return mp(this,Ar)}set mediaAudioTrackList(e){Su(this,Ar,e),lo(this,uo,Iu).call(this)}get mediaAudioTrackEnabled(){return I(this,s.MEDIA_AUDIO_TRACK_ENABLED)}set mediaAudioTrackEnabled(e){k(this,s.MEDIA_AUDIO_TRACK_ENABLED,e)}};Ar=new WeakMap;mo=new WeakMap;uo=new WeakSet;Iu=function(){if(mp(this,mo)===JSON.stringify(this.mediaAudioTrackList))return;Su(this,mo,JSON.stringify(this.mediaAudioTrackList));let i=this.mediaAudioTrackList,e=this.shadowRoot.querySelector("#container");e.textContent="";for(let t of i){let a=this.formatOptionText(t.label,t),r=ft(a,`${t.id}`,t.enabled);r.prepend(Ze(this,"select-indicator")),e.append(r)}};co=new WeakSet;Cu=function(){if(this.value==null)return;let i=new l.CustomEvent(h.MEDIA_AUDIO_TRACK_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};l.customElements.get("media-audio-track-listbox")||l.customElements.define("media-audio-track-listbox",ho);var Ob=`<svg aria-hidden="true" viewBox="0 0 24 24">
1560
1560
  <path d="M11 17H9.5V7H11v10Zm-3-3H6.5v-4H8v4Zm6-5h-1.5v6H14V9Zm3 7h-1.5V8H17v8Z"/>
1561
1561
  <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"/>
1562
1562
  </svg>`,hp=m.createElement("template");hp.innerHTML=`
1563
1563
  <slot name="icon">${Ob}</slot>
1564
- `;var Mu=class extends P{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_AUDIO_TRACK_ENABLED,s.MEDIA_AUDIO_TRACK_UNAVAILABLE]}constructor(){super({slotTemplate:hp})}get mediaAudioTrackEnabled(){return I(this,s.MEDIA_AUDIO_TRACK_ENABLED)}set mediaAudioTrackEnabled(e){k(this,s.MEDIA_AUDIO_TRACK_ENABLED,e)}};l.customElements.get("media-audio-track-button")||l.customElements.define("media-audio-track-button",Mu);var po=class extends De{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_AUDIO_TRACK_ENABLED,s.MEDIA_AUDIO_TRACK_UNAVAILABLE]}init(){let e=m.createElement("media-audio-track-button");e.part.add("button"),e.preventClick=!0;let t=m.createElement("media-audio-track-listbox");t.part.add("listbox"),t.setAttribute("exportparts","option, option-selected, indicator");let a=this.shadowRoot.querySelector("slot[name=button]"),r=this.shadowRoot.querySelector("slot[name=listbox]");a.textContent="",r.textContent="",a.append(e),r.append(t)}};l.customElements.get("media-audio-track-selectmenu")||l.customElements.define("media-audio-track-selectmenu",po);var A=fv(require("@mux/mux-video")),z=require("@mux/playback-core");var Tp=require("@mux/mux-video");var Pb="en",ki={code:Pb};var pp="en";function C(i,e=!0){var r,n;let t=e&&(n=(r=ki)==null?void 0:r[i])!=null?n:i,a=e?ki.code:pp;return new wu(t,a)}var wu=class{constructor(e,t=(a=>(a=ki.code)!=null?a:pp)()){this.message=e,this.locale=t}format(e){return this.message.replace(/\{(\w+)\}/g,(t,a)=>{var r;return(r=e[a])!=null?r:""})}toString(){return this.message}};function vp(i){let e="";return Object.entries(i).forEach(([t,a])=>{a!=null&&(e+=`${vo(t)}: ${a}; `)}),e?e.trim():void 0}function vo(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function fo(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Et(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function Ru(i){let e=Nb(i).toString();return e?"?"+e:""}function Nb(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}function qt(i){let e=(i!=null?i:"").split(".")[1];if(!e)return{};let t=e.replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(t).split("").map(function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}var xu=(i,e)=>!i||!e?!1:i.contains(e)?!0:xu(i,e.getRootNode().host);var bo=require("@mux/playback-core");var fp="mux.com",Ub=()=>{try{return"2.6.0"}catch{}return"UNKNOWN"},Bb=Ub(),go=()=>Bb,bp=(i,{token:e,customDomain:t=fp,thumbnailTime:a}={})=>{let r=e==null?a:void 0,{aud:n}=qt(e);if(!(e&&n!=="t"))return`https://image.${t}/${i}/thumbnail.webp${Ru({token:e,time:r})}`},Ep=(i,{token:e,customDomain:t=fp}={})=>{let{aud:a}=qt(e);if(!(e&&a!=="s"))return`https://image.${t}/${i}/storyboard.vtt${Ru({token:e,format:"webp"})}`},yr=i=>{if(i){if([bo.StreamTypes.LIVE,bo.StreamTypes.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return bo.StreamTypes.LIVE}};var Wb={crossorigin:"crossOrigin",playsinline:"playsInline"};function gp(i){var e;return(e=Wb[i])!=null?e:fo(i)}var Si,Ii,ve,Eo=class{constructor(e,t){ee(this,Si,void 0);ee(this,Ii,void 0);ee(this,ve,[]);Ce(this,Si,e),Ce(this,Ii,t)}[Symbol.iterator](){return O(this,ve).values()}get length(){return O(this,ve).length}get value(){var e;return(e=O(this,ve).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(Ce(this,ve,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return O(this,ve)[e]}values(){return O(this,ve).values()}keys(){return O(this,ve).keys()}forEach(e){O(this,ve).forEach(e)}add(...e){var t,a;e.forEach(r=>{this.contains(r)||O(this,ve).push(r)}),!(this.value===""&&!((t=O(this,Si))!=null&&t.hasAttribute(`${O(this,Ii)}`)))&&((a=O(this,Si))==null||a.setAttribute(`${O(this,Ii)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>{O(this,ve).splice(O(this,ve).indexOf(a),1)}),(t=O(this,Si))==null||t.setAttribute(`${O(this,Ii)}`,`${this.value}`)}contains(e){return O(this,ve).includes(e)}toggle(e,t){return typeof t!="undefined"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){this.remove(e),this.add(t)}};Si=new WeakMap,Ii=new WeakMap,ve=new WeakMap;var _p=`[mux-player ${go()}]`;function Zt(...i){console.warn(_p,...i)}function Oe(...i){console.error(_p,...i)}function Du(i){var t;let e=(t=i.message)!=null?t:"";if(i.context&&(e+=` ${i.context}`),i.file){let a="https://github.com/muxinc/elements/blob/main/errors/";e+=` ${C("Read more: ")}
1565
- ${a}${i.file}`}Zt(e)}var pe={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},Ci={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},yp=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),Hb=Tp.VideoEvents.filter(i=>i!=="error"),$b=Object.values(pe).filter(i=>![pe.PLAYSINLINE].includes(i)),Fb=Object.values(Ci);function kp(i){i.querySelectorAll(":scope > track").forEach(e=>{var t;(t=i.media)==null||t.append(e.cloneNode())}),Hb.forEach(e=>{var t;(t=i.media)==null||t.addEventListener(e,a=>{i.dispatchEvent(new Event(a.type))})})}var Ou=class extends Z.HTMLElement{static get observedAttributes(){return[...$b,...Fb]}constructor(){super(),this.querySelectorAll(":scope > track").forEach(a=>{var r;(r=this.media)==null||r.append(a.cloneNode())});let e=a=>{for(let r of a)r.type==="childList"&&(r.removedNodes.forEach(n=>{var d,u;let o=(d=this.media)==null?void 0:d.querySelector(`track[src="${n.src}"]`);o&&((u=this.media)==null||u.removeChild(o))}),r.addedNodes.forEach(n=>{var o;(o=this.media)==null||o.append(n.cloneNode())}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(e,t,a){var r,n;switch(e){case Ci.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case Ci.VOLUME:{let o=(r=Et(a))!=null?r:1;this.media&&(this.media.volume=o);return}case Ci.PLAYBACKRATE:{let o=(n=Et(a))!=null?n:1;this.media&&(this.media.playbackRate=o,this.media.defaultPlaybackRate=o);return}}}play(){var e,t;return(t=(e=this.media)==null?void 0:e.play())!=null?t:Promise.reject()}pause(){var e;(e=this.media)==null||e.pause()}requestCast(e){var t;return(t=this.media)==null?void 0:t.requestCast(e)}get media(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("mux-video")}get audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var e,t;return(t=(e=this.media)==null?void 0:e.paused)!=null?t:!0}get duration(){var e,t;return(t=(e=this.media)==null?void 0:e.duration)!=null?t:NaN}get ended(){var e,t;return(t=(e=this.media)==null?void 0:e.ended)!=null?t:!1}get buffered(){var e,t;return(t=(e=this.media)==null?void 0:e.buffered)!=null?t:yp}get seekable(){var e,t;return(t=(e=this.media)==null?void 0:e.seekable)!=null?t:yp}get readyState(){var e,t;return(t=(e=this.media)==null?void 0:e.readyState)!=null?t:0}get videoWidth(){var e,t;return(t=(e=this.media)==null?void 0:e.videoWidth)!=null?t:0}get videoHeight(){var e,t;return(t=(e=this.media)==null?void 0:e.videoHeight)!=null?t:0}get currentTime(){var e,t;return(t=(e=this.media)==null?void 0:e.currentTime)!=null?t:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,t;return(t=(e=this.media)==null?void 0:e.volume)!=null?t:1}set volume(e){this.media&&(this.media.volume=Number(e))}get playbackRate(){var e,t;return(t=(e=this.media)==null?void 0:e.playbackRate)!=null?t:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get defaultPlaybackRate(){var e;return(e=Et(this.getAttribute(Ci.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(Ci.PLAYBACKRATE,`${e}`):this.removeAttribute(Ci.PLAYBACKRATE)}get crossOrigin(){return Tr(this,pe.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(pe.CROSSORIGIN,`${e}`)}get autoplay(){return Tr(this,pe.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(pe.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(pe.AUTOPLAY)}get loop(){return Tr(this,pe.LOOP)!=null}set loop(e){e?this.setAttribute(pe.LOOP,""):this.removeAttribute(pe.LOOP)}get muted(){var e,t;return(t=(e=this.media)==null?void 0:e.muted)!=null?t:!1}set muted(e){this.media&&(this.media.muted=!!e)}get defaultMuted(){return Tr(this,pe.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(pe.MUTED,""):this.removeAttribute(pe.MUTED)}get playsInline(){return Tr(this,pe.PLAYSINLINE)!=null}set playsInline(e){Oe("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(e){["","none","metadata","auto"].includes(e)?this.setAttribute(pe.PRELOAD,e):this.removeAttribute(pe.PRELOAD)}};function Tr(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var Pu=Ou;var Vb=Object.defineProperty,Kb=(i,e,t)=>e in i?Vb(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Yb=(i,e,t)=>(Kb(i,typeof e!="symbol"?e+"":e,t),t),Mp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},S=(i,e,t)=>(Mp(i,e,"read from private field"),t?t.call(i):e.get(i)),gt=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Lt=(i,e,t,a)=>(Mp(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ha,_o,Li,kr,Qt,zt,Xt,Mi,pa,Ao,Qe,Sp=1,Ip=0,Gb=1,qb={processCallback(i,e,t){if(t){for(let[a,r]of e)if(a in t){let n=t[a];typeof n=="boolean"&&r instanceof fe&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=n:typeof n=="function"&&r instanceof fe?r.element[r.attributeName]=n:r.value=n}}}},Mt=class extends l.DocumentFragment{constructor(e,t,a=qb){var r;super(),gt(this,ha,void 0),gt(this,_o,void 0),this.append(e.content.cloneNode(!0)),Lt(this,ha,wp(this)),Lt(this,_o,a),(r=a.createCallback)==null||r.call(a,this,S(this,ha),t),a.processCallback(this,S(this,ha),t)}update(e){S(this,_o).processCallback(this,S(this,ha),e)}};ha=new WeakMap;_o=new WeakMap;var wp=(i,e=[])=>{let t,a;for(let r of i.attributes||[])if(r.value.includes("{{")){let n=new Nu;for([t,a]of Lp(r.value))if(!t)n.append(a);else{let o=new fe(i,r.name,r.namespaceURI);n.append(o),e.push([a,o])}r.value=n.toString()}for(let r of i.childNodes)if(r.nodeType===Sp&&!(r instanceof HTMLTemplateElement))wp(r,e);else if(r.nodeType===Sp||r.data.includes("{{")){let n=[];if(r.data)for([t,a]of Lp(r.data))if(!t)n.push(new Text(a));else{let o=new wt(i);n.push(o),e.push([a,o])}else if(r instanceof HTMLTemplateElement){let o=new Sr(i,r);n.push(o),e.push([o.expression,o])}r.replaceWith(...n.flatMap(o=>o.replacementNodes||[o]))}return e},Cp={},Lp=i=>{let e="",t=0,a=Cp[i],r=0,n;if(a)return a;for(a=[];n=i[r];r++)n==="{"&&i[r+1]==="{"&&i[r-1]!=="\\"&&i[r+2]&&++t==1?(e&&a.push([Ip,e]),e="",r++):n==="}"&&i[r+1]==="}"&&i[r-1]!=="\\"&&!--t?(a.push([Gb,e.trim()]),e="",r++):e+=n||"";return e&&a.push([Ip,(t>0?"{{":"")+e]),Cp[i]=a},Zb=11,yo=class{get value(){return""}set value(e){}toString(){return this.value}},Rp=new WeakMap,Nu=class{constructor(){gt(this,Li,[])}[Symbol.iterator](){return S(this,Li).values()}get length(){return S(this,Li).length}item(e){return S(this,Li)[e]}append(...e){for(let t of e)t instanceof fe&&Rp.set(t,this),S(this,Li).push(t)}toString(){return S(this,Li).join("")}};Li=new WeakMap;var fe=class extends yo{constructor(e,t,a){super(),gt(this,Mi),gt(this,kr,""),gt(this,Qt,void 0),gt(this,zt,void 0),gt(this,Xt,void 0),Lt(this,Qt,e),Lt(this,zt,t),Lt(this,Xt,a)}get attributeName(){return S(this,zt)}get attributeNamespace(){return S(this,Xt)}get element(){return S(this,Qt)}get value(){return S(this,kr)}set value(e){S(this,kr)!==e&&(Lt(this,kr,e),!S(this,Mi,pa)||S(this,Mi,pa).length===1?e==null?S(this,Qt).removeAttributeNS(S(this,Xt),S(this,zt)):S(this,Qt).setAttributeNS(S(this,Xt),S(this,zt),e):S(this,Qt).setAttributeNS(S(this,Xt),S(this,zt),S(this,Mi,pa)))}get booleanValue(){return S(this,Qt).hasAttributeNS(S(this,Xt),S(this,zt))}set booleanValue(e){if(!S(this,Mi,pa)||S(this,Mi,pa).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};kr=new WeakMap;Qt=new WeakMap;zt=new WeakMap;Xt=new WeakMap;Mi=new WeakSet;pa=function(){return Rp.get(this)};var wt=class extends yo{constructor(e,t){super(),gt(this,Ao,void 0),gt(this,Qe,void 0),Lt(this,Ao,e),Lt(this,Qe,t?[...t]:[new Text])}get replacementNodes(){return S(this,Qe)}get parentNode(){return S(this,Ao)}get nextSibling(){return S(this,Qe)[S(this,Qe).length-1].nextSibling}get previousSibling(){return S(this,Qe)[0].previousSibling}get value(){return S(this,Qe).map(e=>e.textContent).join("")}set value(e){this.replace(e)}replace(...e){let t=e.flat().flatMap(a=>a==null?[new Text]:a.forEach?[...a]:a.nodeType===Zb?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);t.length||t.push(new Text),Lt(this,Qe,Qb(S(this,Qe)[0].parentNode,S(this,Qe),t,this.nextSibling))}};Ao=new WeakMap;Qe=new WeakMap;var Sr=class extends wt{constructor(e,t){let a=t.getAttribute("directive")||t.getAttribute("type"),r=t.getAttribute("expression")||t.getAttribute(a)||"";r.startsWith("{{")&&(r=r.trim().slice(2,-2).trim()),super(e),Yb(this,"directive"),this.expression=r,this.template=t,this.directive=a}};function Qb(i,e,t,a=null){let r=0,n,o,d,u=t.length,c=e.length;for(;r<u&&r<c&&e[r]==t[r];)r++;for(;r<u&&r<c&&t[u-1]==e[c-1];)a=t[--c,--u];if(r==c)for(;r<u;)i.insertBefore(t[r++],a);if(r==u)for(;r<c;)i.removeChild(e[r++]);else{for(n=e[r];r<u;)d=t[r++],o=n?n.nextSibling:a,n==d?n=o:r<u&&t[r]==o?(i.replaceChild(d,n),n=o):i.insertBefore(d,n);for(;n!=a;)o=n.nextSibling,i.removeChild(n),n=o}return t}var xp={string:i=>String(i)},ko=class{constructor(e){this.template=e,this.state=void 0}},wi=new WeakMap,Ri=new WeakMap,Uu={partial:(i,e)=>{e[i.expression]=new ko(i.template)},if:(i,e)=>{var t;if(Op(i.expression,e))if(wi.get(i)!==i.template){wi.set(i,i.template);let a=new Mt(i.template,e,So);i.replace(a),Ri.set(i,a)}else(t=Ri.get(i))==null||t.update(e);else i.replace(""),wi.delete(i),Ri.delete(i)}},zb=Object.keys(Uu),So={processCallback(i,e,t){var a,r;if(t)for(let[n,o]of e){if(o instanceof Sr){if(!o.directive){let u=zb.find(c=>o.template.hasAttribute(c));u&&(o.directive=u,o.expression=o.template.getAttribute(u))}(a=Uu[o.directive])==null||a.call(Uu,o,t);continue}let d=Op(n,t);if(d instanceof ko){wi.get(o)!==d.template?(wi.set(o,d.template),d=new Mt(d.template,d.state,So),o.value=d,Ri.set(o,d)):(r=Ri.get(o))==null||r.update(d.state);continue}d?(o instanceof fe&&o.attributeName.startsWith("aria-")&&(d=String(d)),o instanceof fe?typeof d=="boolean"?o.booleanValue=d:typeof d=="function"?o.element[o.attributeName]=d:o.value=d:(o.value=d,wi.delete(o),Ri.delete(o))):o instanceof fe?o.value=void 0:(o.value=void 0,wi.delete(o),Ri.delete(o))}}},Dp={"!":i=>!i,"!!":i=>!!i,"==":(i,e)=>i==e,"!=":(i,e)=>i!=e,">":(i,e)=>i>e,">=":(i,e)=>i>=e,"<":(i,e)=>i<e,"<=":(i,e)=>i<=e,"??":(i,e)=>i!=null?i:e,"|":(i,e)=>{var t;return(t=xp[e])==null?void 0:t.call(xp,i)}};function Xb(i){return Jb(i,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function Op(i,e={}){var t,a,r,n,o,d,u;let c=Xb(i);if(c.length===0||c.some(({type:f})=>!f))return Ir(i);if(((t=c[0])==null?void 0:t.token)===">"){let f=e[(a=c[1])==null?void 0:a.token];if(!f)return Ir(i);let E={...e};f.state=E;let v=c.slice(2);for(let b=0;b<v.length;b+=3){let w=(r=v[b])==null?void 0:r.token,_=(n=v[b+1])==null?void 0:n.token,T=(o=v[b+2])==null?void 0:o.token;w&&_==="="&&(E[w]=Cr(T,e))}return f}if(c.length===1)return To(c[0])?Cr(c[0].token,e):Ir(i);if(c.length===2){let f=(d=c[0])==null?void 0:d.token,E=Dp[f];if(!E||!To(c[1]))return Ir(i);let v=Cr(c[1].token,e);return E(v)}if(c.length===3){let f=(u=c[1])==null?void 0:u.token,E=Dp[f];if(!E||!To(c[0])||!To(c[2]))return Ir(i);let v=Cr(c[0].token,e);if(f==="|")return E(v,c[2].token);let b=Cr(c[2].token,e);return E(v,b)}}function Ir(i){return console.warn(`Warning: invalid expression \`${i}\``),!1}function To({type:i}){return["number","boolean","string","param"].includes(i)}function Cr(i,e){let t=i[0],a=i.slice(-1);return i==="true"||i==="false"?i==="true":t===a&&["'",'"'].includes(t)?i.slice(1,-1):Vr(i)?parseFloat(i):e[i]}function Jb(i,e){let t,a,r,n=[];for(;i;){r=null,t=i.length;for(let o in e)a=e[o].exec(i),a&&a.index<t&&(r={token:a[0],type:o,matches:a.slice(1)},t=a.index);t&&n.push({token:i.substr(0,t),type:void 0}),r&&n.push(r),i=i.substr(t+(r?r.token.length:0))}return n}var jb=Object.defineProperty,e0=(i,e,t)=>e in i?jb(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Mr=(i,e,t)=>(e0(i,typeof e!="symbol"?e+"":e,t),t),Vu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Hu=(i,e,t)=>(Vu(i,e,"read from private field"),t?t.call(i):e.get(i)),Lr=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},xi=(i,e,t,a)=>(Vu(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Bu=(i,e,t)=>(Vu(i,e,"access private method"),t),va,Io,fa,$u,Pp,Co,Fu,Wu={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},Np=m.createElement("template");Np.innerHTML=`
1564
+ `;var Mu=class extends P{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_AUDIO_TRACK_ENABLED,s.MEDIA_AUDIO_TRACK_UNAVAILABLE]}constructor(){super({slotTemplate:hp})}get mediaAudioTrackEnabled(){return I(this,s.MEDIA_AUDIO_TRACK_ENABLED)}set mediaAudioTrackEnabled(e){k(this,s.MEDIA_AUDIO_TRACK_ENABLED,e)}};l.customElements.get("media-audio-track-button")||l.customElements.define("media-audio-track-button",Mu);var po=class extends Oe{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_AUDIO_TRACK_ENABLED,s.MEDIA_AUDIO_TRACK_UNAVAILABLE]}init(){let e=m.createElement("media-audio-track-button");e.part.add("button"),e.preventClick=!0;let t=m.createElement("media-audio-track-listbox");t.part.add("listbox"),t.setAttribute("exportparts","option, option-selected, indicator");let a=this.shadowRoot.querySelector("slot[name=button]"),r=this.shadowRoot.querySelector("slot[name=listbox]");a.textContent="",r.textContent="",a.append(e),r.append(t)}};l.customElements.get("media-audio-track-selectmenu")||l.customElements.define("media-audio-track-selectmenu",po);var E=fv(require("@mux/mux-video")),z=require("@mux/playback-core");var Tp=require("@mux/mux-video");var Pb="en",Si={code:Pb};var pp="en";function C(i,e=!0){var r,n;let t=e&&(n=(r=Si)==null?void 0:r[i])!=null?n:i,a=e?Si.code:pp;return new wu(t,a)}var wu=class{constructor(e,t=(a=>(a=Si.code)!=null?a:pp)()){this.message=e,this.locale=t}format(e){return this.message.replace(/\{(\w+)\}/g,(t,a)=>{var r;return(r=e[a])!=null?r:""})}toString(){return this.message}};function vp(i){let e="";return Object.entries(i).forEach(([t,a])=>{a!=null&&(e+=`${vo(t)}: ${a}; `)}),e?e.trim():void 0}function vo(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function fo(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Pe(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function Ru(i){let e=Nb(i).toString();return e?"?"+e:""}function Nb(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}function qt(i){let e=(i!=null?i:"").split(".")[1];if(!e)return{};let t=e.replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(t).split("").map(function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}var xu=(i,e)=>!i||!e?!1:i.contains(e)?!0:xu(i,e.getRootNode().host);var bo=require("@mux/playback-core");var fp="mux.com",Ub=()=>{try{return"2.7.0"}catch{}return"UNKNOWN"},Bb=Ub(),go=()=>Bb,bp=(i,{token:e,customDomain:t=fp,thumbnailTime:a,programTime:r}={})=>{let n=e==null?a:void 0,{aud:o}=qt(e);if(!(e&&o!=="t"))return`https://image.${t}/${i}/thumbnail.webp${Ru({token:e,time:n,program_time:r})}`},Ep=(i,{token:e,customDomain:t=fp,programStartTime:a,programEndTime:r}={})=>{let{aud:n}=qt(e);if(!(e&&n!=="s"))return`https://image.${t}/${i}/storyboard.vtt${Ru({token:e,format:"webp",program_start_time:a,program_end_time:r})}`},yr=i=>{if(i){if([bo.StreamTypes.LIVE,bo.StreamTypes.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return bo.StreamTypes.LIVE}};var Wb={crossorigin:"crossOrigin",playsinline:"playsInline"};function gp(i){var e;return(e=Wb[i])!=null?e:fo(i)}var Ii,Ci,ve,Eo=class{constructor(e,t){ee(this,Ii,void 0);ee(this,Ci,void 0);ee(this,ve,[]);Le(this,Ii,e),Le(this,Ci,t)}[Symbol.iterator](){return O(this,ve).values()}get length(){return O(this,ve).length}get value(){var e;return(e=O(this,ve).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(Le(this,ve,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return O(this,ve)[e]}values(){return O(this,ve).values()}keys(){return O(this,ve).keys()}forEach(e){O(this,ve).forEach(e)}add(...e){var t,a;e.forEach(r=>{this.contains(r)||O(this,ve).push(r)}),!(this.value===""&&!((t=O(this,Ii))!=null&&t.hasAttribute(`${O(this,Ci)}`)))&&((a=O(this,Ii))==null||a.setAttribute(`${O(this,Ci)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>{O(this,ve).splice(O(this,ve).indexOf(a),1)}),(t=O(this,Ii))==null||t.setAttribute(`${O(this,Ci)}`,`${this.value}`)}contains(e){return O(this,ve).includes(e)}toggle(e,t){return typeof t!="undefined"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){this.remove(e),this.add(t)}};Ii=new WeakMap,Ci=new WeakMap,ve=new WeakMap;var _p=`[mux-player ${go()}]`;function Zt(...i){console.warn(_p,...i)}function Ce(...i){console.error(_p,...i)}function Du(i){var t;let e=(t=i.message)!=null?t:"";if(i.context&&(e+=` ${i.context}`),i.file){let a="https://github.com/muxinc/elements/blob/main/errors/";e+=` ${C("Read more: ")}
1565
+ ${a}${i.file}`}Zt(e)}var pe={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},Li={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},yp=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),Hb=Tp.VideoEvents.filter(i=>i!=="error"),$b=Object.values(pe).filter(i=>![pe.PLAYSINLINE].includes(i)),Fb=Object.values(Li);function kp(i){i.querySelectorAll(":scope > track").forEach(e=>{var t;(t=i.media)==null||t.append(e.cloneNode())}),Hb.forEach(e=>{var t;(t=i.media)==null||t.addEventListener(e,a=>{i.dispatchEvent(new Event(a.type))})})}var Ou=class extends Z.HTMLElement{static get observedAttributes(){return[...$b,...Fb]}constructor(){super(),this.querySelectorAll(":scope > track").forEach(a=>{var r;(r=this.media)==null||r.append(a.cloneNode())});let e=a=>{for(let r of a)r.type==="childList"&&(r.removedNodes.forEach(n=>{var d,u;let o=(d=this.media)==null?void 0:d.querySelector(`track[src="${n.src}"]`);o&&((u=this.media)==null||u.removeChild(o))}),r.addedNodes.forEach(n=>{var o;(o=this.media)==null||o.append(n.cloneNode())}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(e,t,a){var r,n;switch(e){case Li.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case Li.VOLUME:{let o=(r=Pe(a))!=null?r:1;this.media&&(this.media.volume=o);return}case Li.PLAYBACKRATE:{let o=(n=Pe(a))!=null?n:1;this.media&&(this.media.playbackRate=o,this.media.defaultPlaybackRate=o);return}}}play(){var e,t;return(t=(e=this.media)==null?void 0:e.play())!=null?t:Promise.reject()}pause(){var e;(e=this.media)==null||e.pause()}requestCast(e){var t;return(t=this.media)==null?void 0:t.requestCast(e)}get media(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("mux-video")}get audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var e,t;return(t=(e=this.media)==null?void 0:e.paused)!=null?t:!0}get duration(){var e,t;return(t=(e=this.media)==null?void 0:e.duration)!=null?t:NaN}get ended(){var e,t;return(t=(e=this.media)==null?void 0:e.ended)!=null?t:!1}get buffered(){var e,t;return(t=(e=this.media)==null?void 0:e.buffered)!=null?t:yp}get seekable(){var e,t;return(t=(e=this.media)==null?void 0:e.seekable)!=null?t:yp}get readyState(){var e,t;return(t=(e=this.media)==null?void 0:e.readyState)!=null?t:0}get videoWidth(){var e,t;return(t=(e=this.media)==null?void 0:e.videoWidth)!=null?t:0}get videoHeight(){var e,t;return(t=(e=this.media)==null?void 0:e.videoHeight)!=null?t:0}get currentTime(){var e,t;return(t=(e=this.media)==null?void 0:e.currentTime)!=null?t:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,t;return(t=(e=this.media)==null?void 0:e.volume)!=null?t:1}set volume(e){this.media&&(this.media.volume=Number(e))}get playbackRate(){var e,t;return(t=(e=this.media)==null?void 0:e.playbackRate)!=null?t:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get defaultPlaybackRate(){var e;return(e=Pe(this.getAttribute(Li.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(Li.PLAYBACKRATE,`${e}`):this.removeAttribute(Li.PLAYBACKRATE)}get crossOrigin(){return Tr(this,pe.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(pe.CROSSORIGIN,`${e}`)}get autoplay(){return Tr(this,pe.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(pe.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(pe.AUTOPLAY)}get loop(){return Tr(this,pe.LOOP)!=null}set loop(e){e?this.setAttribute(pe.LOOP,""):this.removeAttribute(pe.LOOP)}get muted(){var e,t;return(t=(e=this.media)==null?void 0:e.muted)!=null?t:!1}set muted(e){this.media&&(this.media.muted=!!e)}get defaultMuted(){return Tr(this,pe.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(pe.MUTED,""):this.removeAttribute(pe.MUTED)}get playsInline(){return Tr(this,pe.PLAYSINLINE)!=null}set playsInline(e){Ce("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(e){["","none","metadata","auto"].includes(e)?this.setAttribute(pe.PRELOAD,e):this.removeAttribute(pe.PRELOAD)}};function Tr(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var Pu=Ou;var Vb=Object.defineProperty,Kb=(i,e,t)=>e in i?Vb(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Yb=(i,e,t)=>(Kb(i,typeof e!="symbol"?e+"":e,t),t),Mp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},S=(i,e,t)=>(Mp(i,e,"read from private field"),t?t.call(i):e.get(i)),gt=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Mt=(i,e,t,a)=>(Mp(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ha,_o,Mi,kr,Qt,zt,Xt,wi,pa,Ao,ze,Sp=1,Ip=0,Gb=1,qb={processCallback(i,e,t){if(t){for(let[a,r]of e)if(a in t){let n=t[a];typeof n=="boolean"&&r instanceof fe&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=n:typeof n=="function"&&r instanceof fe?r.element[r.attributeName]=n:r.value=n}}}},wt=class extends l.DocumentFragment{constructor(e,t,a=qb){var r;super(),gt(this,ha,void 0),gt(this,_o,void 0),this.append(e.content.cloneNode(!0)),Mt(this,ha,wp(this)),Mt(this,_o,a),(r=a.createCallback)==null||r.call(a,this,S(this,ha),t),a.processCallback(this,S(this,ha),t)}update(e){S(this,_o).processCallback(this,S(this,ha),e)}};ha=new WeakMap;_o=new WeakMap;var wp=(i,e=[])=>{let t,a;for(let r of i.attributes||[])if(r.value.includes("{{")){let n=new Nu;for([t,a]of Lp(r.value))if(!t)n.append(a);else{let o=new fe(i,r.name,r.namespaceURI);n.append(o),e.push([a,o])}r.value=n.toString()}for(let r of i.childNodes)if(r.nodeType===Sp&&!(r instanceof HTMLTemplateElement))wp(r,e);else if(r.nodeType===Sp||r.data.includes("{{")){let n=[];if(r.data)for([t,a]of Lp(r.data))if(!t)n.push(new Text(a));else{let o=new Rt(i);n.push(o),e.push([a,o])}else if(r instanceof HTMLTemplateElement){let o=new Sr(i,r);n.push(o),e.push([o.expression,o])}r.replaceWith(...n.flatMap(o=>o.replacementNodes||[o]))}return e},Cp={},Lp=i=>{let e="",t=0,a=Cp[i],r=0,n;if(a)return a;for(a=[];n=i[r];r++)n==="{"&&i[r+1]==="{"&&i[r-1]!=="\\"&&i[r+2]&&++t==1?(e&&a.push([Ip,e]),e="",r++):n==="}"&&i[r+1]==="}"&&i[r-1]!=="\\"&&!--t?(a.push([Gb,e.trim()]),e="",r++):e+=n||"";return e&&a.push([Ip,(t>0?"{{":"")+e]),Cp[i]=a},Zb=11,yo=class{get value(){return""}set value(e){}toString(){return this.value}},Rp=new WeakMap,Nu=class{constructor(){gt(this,Mi,[])}[Symbol.iterator](){return S(this,Mi).values()}get length(){return S(this,Mi).length}item(e){return S(this,Mi)[e]}append(...e){for(let t of e)t instanceof fe&&Rp.set(t,this),S(this,Mi).push(t)}toString(){return S(this,Mi).join("")}};Mi=new WeakMap;var fe=class extends yo{constructor(e,t,a){super(),gt(this,wi),gt(this,kr,""),gt(this,Qt,void 0),gt(this,zt,void 0),gt(this,Xt,void 0),Mt(this,Qt,e),Mt(this,zt,t),Mt(this,Xt,a)}get attributeName(){return S(this,zt)}get attributeNamespace(){return S(this,Xt)}get element(){return S(this,Qt)}get value(){return S(this,kr)}set value(e){S(this,kr)!==e&&(Mt(this,kr,e),!S(this,wi,pa)||S(this,wi,pa).length===1?e==null?S(this,Qt).removeAttributeNS(S(this,Xt),S(this,zt)):S(this,Qt).setAttributeNS(S(this,Xt),S(this,zt),e):S(this,Qt).setAttributeNS(S(this,Xt),S(this,zt),S(this,wi,pa)))}get booleanValue(){return S(this,Qt).hasAttributeNS(S(this,Xt),S(this,zt))}set booleanValue(e){if(!S(this,wi,pa)||S(this,wi,pa).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};kr=new WeakMap;Qt=new WeakMap;zt=new WeakMap;Xt=new WeakMap;wi=new WeakSet;pa=function(){return Rp.get(this)};var Rt=class extends yo{constructor(e,t){super(),gt(this,Ao,void 0),gt(this,ze,void 0),Mt(this,Ao,e),Mt(this,ze,t?[...t]:[new Text])}get replacementNodes(){return S(this,ze)}get parentNode(){return S(this,Ao)}get nextSibling(){return S(this,ze)[S(this,ze).length-1].nextSibling}get previousSibling(){return S(this,ze)[0].previousSibling}get value(){return S(this,ze).map(e=>e.textContent).join("")}set value(e){this.replace(e)}replace(...e){let t=e.flat().flatMap(a=>a==null?[new Text]:a.forEach?[...a]:a.nodeType===Zb?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);t.length||t.push(new Text),Mt(this,ze,Qb(S(this,ze)[0].parentNode,S(this,ze),t,this.nextSibling))}};Ao=new WeakMap;ze=new WeakMap;var Sr=class extends Rt{constructor(e,t){let a=t.getAttribute("directive")||t.getAttribute("type"),r=t.getAttribute("expression")||t.getAttribute(a)||"";r.startsWith("{{")&&(r=r.trim().slice(2,-2).trim()),super(e),Yb(this,"directive"),this.expression=r,this.template=t,this.directive=a}};function Qb(i,e,t,a=null){let r=0,n,o,d,u=t.length,c=e.length;for(;r<u&&r<c&&e[r]==t[r];)r++;for(;r<u&&r<c&&t[u-1]==e[c-1];)a=t[--c,--u];if(r==c)for(;r<u;)i.insertBefore(t[r++],a);if(r==u)for(;r<c;)i.removeChild(e[r++]);else{for(n=e[r];r<u;)d=t[r++],o=n?n.nextSibling:a,n==d?n=o:r<u&&t[r]==o?(i.replaceChild(d,n),n=o):i.insertBefore(d,n);for(;n!=a;)o=n.nextSibling,i.removeChild(n),n=o}return t}var xp={string:i=>String(i)},ko=class{constructor(e){this.template=e,this.state=void 0}},Ri=new WeakMap,xi=new WeakMap,Uu={partial:(i,e)=>{e[i.expression]=new ko(i.template)},if:(i,e)=>{var t;if(Op(i.expression,e))if(Ri.get(i)!==i.template){Ri.set(i,i.template);let a=new wt(i.template,e,So);i.replace(a),xi.set(i,a)}else(t=xi.get(i))==null||t.update(e);else i.replace(""),Ri.delete(i),xi.delete(i)}},zb=Object.keys(Uu),So={processCallback(i,e,t){var a,r;if(t)for(let[n,o]of e){if(o instanceof Sr){if(!o.directive){let u=zb.find(c=>o.template.hasAttribute(c));u&&(o.directive=u,o.expression=o.template.getAttribute(u))}(a=Uu[o.directive])==null||a.call(Uu,o,t);continue}let d=Op(n,t);if(d instanceof ko){Ri.get(o)!==d.template?(Ri.set(o,d.template),d=new wt(d.template,d.state,So),o.value=d,xi.set(o,d)):(r=xi.get(o))==null||r.update(d.state);continue}d?(o instanceof fe&&o.attributeName.startsWith("aria-")&&(d=String(d)),o instanceof fe?typeof d=="boolean"?o.booleanValue=d:typeof d=="function"?o.element[o.attributeName]=d:o.value=d:(o.value=d,Ri.delete(o),xi.delete(o))):o instanceof fe?o.value=void 0:(o.value=void 0,Ri.delete(o),xi.delete(o))}}},Dp={"!":i=>!i,"!!":i=>!!i,"==":(i,e)=>i==e,"!=":(i,e)=>i!=e,">":(i,e)=>i>e,">=":(i,e)=>i>=e,"<":(i,e)=>i<e,"<=":(i,e)=>i<=e,"??":(i,e)=>i!=null?i:e,"|":(i,e)=>{var t;return(t=xp[e])==null?void 0:t.call(xp,i)}};function Xb(i){return Jb(i,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function Op(i,e={}){var t,a,r,n,o,d,u;let c=Xb(i);if(c.length===0||c.some(({type:f})=>!f))return Ir(i);if(((t=c[0])==null?void 0:t.token)===">"){let f=e[(a=c[1])==null?void 0:a.token];if(!f)return Ir(i);let g={...e};f.state=g;let v=c.slice(2);for(let b=0;b<v.length;b+=3){let w=(r=v[b])==null?void 0:r.token,A=(n=v[b+1])==null?void 0:n.token,T=(o=v[b+2])==null?void 0:o.token;w&&A==="="&&(g[w]=Cr(T,e))}return f}if(c.length===1)return To(c[0])?Cr(c[0].token,e):Ir(i);if(c.length===2){let f=(d=c[0])==null?void 0:d.token,g=Dp[f];if(!g||!To(c[1]))return Ir(i);let v=Cr(c[1].token,e);return g(v)}if(c.length===3){let f=(u=c[1])==null?void 0:u.token,g=Dp[f];if(!g||!To(c[0])||!To(c[2]))return Ir(i);let v=Cr(c[0].token,e);if(f==="|")return g(v,c[2].token);let b=Cr(c[2].token,e);return g(v,b)}}function Ir(i){return console.warn(`Warning: invalid expression \`${i}\``),!1}function To({type:i}){return["number","boolean","string","param"].includes(i)}function Cr(i,e){let t=i[0],a=i.slice(-1);return i==="true"||i==="false"?i==="true":t===a&&["'",'"'].includes(t)?i.slice(1,-1):Vr(i)?parseFloat(i):e[i]}function Jb(i,e){let t,a,r,n=[];for(;i;){r=null,t=i.length;for(let o in e)a=e[o].exec(i),a&&a.index<t&&(r={token:a[0],type:o,matches:a.slice(1)},t=a.index);t&&n.push({token:i.substr(0,t),type:void 0}),r&&n.push(r),i=i.substr(t+(r?r.token.length:0))}return n}var jb=Object.defineProperty,e0=(i,e,t)=>e in i?jb(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Mr=(i,e,t)=>(e0(i,typeof e!="symbol"?e+"":e,t),t),Vu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Hu=(i,e,t)=>(Vu(i,e,"read from private field"),t?t.call(i):e.get(i)),Lr=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Di=(i,e,t,a)=>(Vu(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Bu=(i,e,t)=>(Vu(i,e,"access private method"),t),va,Io,fa,$u,Pp,Co,Fu,Wu={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},Np=m.createElement("template");Np.innerHTML=`
1566
1566
  <style>
1567
1567
  :host {
1568
1568
  display: inline-block;
@@ -1586,7 +1586,7 @@ ${a}${i.file}`}Zt(e)}var pe={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:
1586
1586
  display: none;
1587
1587
  }
1588
1588
  </style>
1589
- `;var Jt=class extends l.HTMLElement{constructor(){super(),Lr(this,$u),Lr(this,Co),Mr(this,"renderRoot"),Mr(this,"renderer"),Lr(this,va,void 0),Lr(this,Io,void 0),Lr(this,fa,void 0),this.shadowRoot?this.renderRoot=this.shadowRoot:(this.renderRoot=this.attachShadow({mode:"open"}),this.createRenderer());let e=new MutationObserver(t=>{var a;this.mediaController&&!((a=this.mediaController)!=null&&a.breakpointsComputed)||t.some(r=>{let n=r.target;return n===this?!0:n.localName!=="media-controller"?!1:!!(Wu[r.attributeName]||r.attributeName.startsWith("breakpoint"))})&&this.render()});e.observe(this,{attributes:!0}),e.observe(this.renderRoot,{attributes:!0,subtree:!0}),this.addEventListener(yt.BREAKPOINTS_COMPUTED,this.render),Bu(this,$u,Pp).call(this,"template")}get mediaController(){return this.renderRoot.querySelector("media-controller")}get template(){var e;return(e=Hu(this,va))!=null?e:this.constructor.template}set template(e){xi(this,fa,null),xi(this,va,e),this.createRenderer()}get props(){var e,t,a;let r=[...Array.from((t=(e=this.mediaController)==null?void 0:e.attributes)!=null?t:[]).filter(({name:o})=>Wu[o]||o.startsWith("breakpoint")),...Array.from(this.attributes)],n={};for(let o of r){let d=(a=Wu[o.name])!=null?a:Tc(o.name),{value:u}=o;u!=null?(Vr(u)&&(u=parseFloat(u)),n[d]=u===""?!0:u):n[d]=!1}return n}attributeChangedCallback(e,t,a){e==="template"&&t!=a&&Bu(this,Co,Fu).call(this)}connectedCallback(){Bu(this,Co,Fu).call(this)}createRenderer(){this.template&&this.template!==Hu(this,Io)&&(xi(this,Io,this.template),this.renderer=new Mt(this.template,this.props,this.constructor.processor),this.renderRoot.textContent="",this.renderRoot.append(Np.content.cloneNode(!0),this.renderer))}render(){var e;(e=this.renderer)==null||e.update(this.props)}};va=new WeakMap;Io=new WeakMap;fa=new WeakMap;$u=new WeakSet;Pp=function(i){if(Object.prototype.hasOwnProperty.call(this,i)){let e=this[i];delete this[i],this[i]=e}};Co=new WeakSet;Fu=function(){var i;let e=this.getAttribute("template");if(!e||e===Hu(this,fa))return;let t=this.getRootNode(),a=(i=t==null?void 0:t.getElementById)==null?void 0:i.call(t,e);if(a){xi(this,fa,e),xi(this,va,a),this.createRenderer();return}t0(e)&&(xi(this,fa,e),i0(e).then(r=>{let n=m.createElement("template");n.innerHTML=r,xi(this,va,n),this.createRenderer()}).catch(console.error))};Mr(Jt,"template");Mr(Jt,"observedAttributes",["template"]);Mr(Jt,"processor",So);function t0(i){if(!/^(\/|\.\/|https?:\/\/)/.test(i))return!1;let e=/^https?:\/\//.test(i)?void 0:location.origin;try{new URL(i,e)}catch{return!1}return!0}async function i0(i){let e=await fetch(i);if(e.status!==200)throw new Error(`Failed to load resource: the server responded with a status of ${e.status}`);return e.text()}l.customElements.get("media-theme")||l.customElements.define("media-theme",Jt);var Up=`:host {
1589
+ `;var Jt=class extends l.HTMLElement{constructor(){super(),Lr(this,$u),Lr(this,Co),Mr(this,"renderRoot"),Mr(this,"renderer"),Lr(this,va,void 0),Lr(this,Io,void 0),Lr(this,fa,void 0),this.shadowRoot?this.renderRoot=this.shadowRoot:(this.renderRoot=this.attachShadow({mode:"open"}),this.createRenderer());let e=new MutationObserver(t=>{var a;this.mediaController&&!((a=this.mediaController)!=null&&a.breakpointsComputed)||t.some(r=>{let n=r.target;return n===this?!0:n.localName!=="media-controller"?!1:!!(Wu[r.attributeName]||r.attributeName.startsWith("breakpoint"))})&&this.render()});e.observe(this,{attributes:!0}),e.observe(this.renderRoot,{attributes:!0,subtree:!0}),this.addEventListener(Tt.BREAKPOINTS_COMPUTED,this.render),Bu(this,$u,Pp).call(this,"template")}get mediaController(){return this.renderRoot.querySelector("media-controller")}get template(){var e;return(e=Hu(this,va))!=null?e:this.constructor.template}set template(e){Di(this,fa,null),Di(this,va,e),this.createRenderer()}get props(){var e,t,a;let r=[...Array.from((t=(e=this.mediaController)==null?void 0:e.attributes)!=null?t:[]).filter(({name:o})=>Wu[o]||o.startsWith("breakpoint")),...Array.from(this.attributes)],n={};for(let o of r){let d=(a=Wu[o.name])!=null?a:Tc(o.name),{value:u}=o;u!=null?(Vr(u)&&(u=parseFloat(u)),n[d]=u===""?!0:u):n[d]=!1}return n}attributeChangedCallback(e,t,a){e==="template"&&t!=a&&Bu(this,Co,Fu).call(this)}connectedCallback(){Bu(this,Co,Fu).call(this)}createRenderer(){this.template&&this.template!==Hu(this,Io)&&(Di(this,Io,this.template),this.renderer=new wt(this.template,this.props,this.constructor.processor),this.renderRoot.textContent="",this.renderRoot.append(Np.content.cloneNode(!0),this.renderer))}render(){var e;(e=this.renderer)==null||e.update(this.props)}};va=new WeakMap;Io=new WeakMap;fa=new WeakMap;$u=new WeakSet;Pp=function(i){if(Object.prototype.hasOwnProperty.call(this,i)){let e=this[i];delete this[i],this[i]=e}};Co=new WeakSet;Fu=function(){var i;let e=this.getAttribute("template");if(!e||e===Hu(this,fa))return;let t=this.getRootNode(),a=(i=t==null?void 0:t.getElementById)==null?void 0:i.call(t,e);if(a){Di(this,fa,e),Di(this,va,a),this.createRenderer();return}t0(e)&&(Di(this,fa,e),i0(e).then(r=>{let n=m.createElement("template");n.innerHTML=r,Di(this,va,n),this.createRenderer()}).catch(console.error))};Mr(Jt,"template");Mr(Jt,"observedAttributes",["template"]);Mr(Jt,"processor",So);function t0(i){if(!/^(\/|\.\/|https?:\/\/)/.test(i))return!1;let e=/^https?:\/\//.test(i)?void 0:location.origin;try{new URL(i,e)}catch{return!1}return!0}async function i0(i){let e=await fetch(i);if(e.status!==200)throw new Error(`Failed to load resource: the server responded with a status of ${e.status}`);return e.text()}l.customElements.get("media-theme")||l.customElements.define("media-theme",Jt);var Up=`:host {
1590
1590
  --media-control-display: var(--controls);
1591
1591
  --media-loading-indicator-display: var(--loading-indicator);
1592
1592
  --media-dialog-display: var(--dialog);
@@ -1824,12 +1824,12 @@ media-poster-image:not([src]):not([placeholdersrc]) {
1824
1824
  </svg>
1825
1825
  </button>
1826
1826
  </slot>
1827
- `;var wr=class extends Ku{constructor(){var e,t;super(),(t=(e=this.shadowRoot)==null?void 0:e.querySelector(".close"))==null||t.addEventListener("click",()=>{this.close()})}};wr.template=Fp;Z.customElements.get("mxp-dialog")||(Z.customElements.define("mxp-dialog",wr),Z.MxpDialog=wr);var Rr=new WeakMap,Gu=class i{constructor(e,t){this.element=e;this.type=t;this.element.addEventListener(this.type,this);let a=Rr.get(this.element);a&&a.set(this.type,this)}set(e){if(typeof e=="function")this.handleEvent=e.bind(this.element);else if(typeof e=="object"&&typeof e.handleEvent=="function")this.handleEvent=e.handleEvent.bind(e);else{this.element.removeEventListener(this.type,this);let t=Rr.get(this.element);t&&t.delete(this.type)}}static for(e){Rr.has(e.element)||Rr.set(e.element,new Map);let t=e.attributeName.slice(2),a=Rr.get(e.element);return a&&a.has(t)?a.get(t):new i(e.element,t)}};function n0(i,e){return i instanceof fe&&i.attributeName.startsWith("on")?(Gu.for(i).set(e),i.element.removeAttributeNS(i.attributeNamespace,i.attributeName),!0):!1}function s0(i,e){return e instanceof Lo&&i instanceof wt?(e.renderInto(i),!0):!1}function o0(i,e){return e instanceof DocumentFragment&&i instanceof wt?(e.childNodes.length&&i.replace(...e.childNodes),!0):!1}function l0(i,e){if(i instanceof fe){let t=i.attributeNamespace,a=i.element.getAttributeNS(t,i.attributeName);return String(e)!==a&&(i.value=String(e)),!0}return i.value=String(e),!0}function d0(i,e){if(i instanceof fe&&e instanceof Element){let t=i.element;return t[i.attributeName]!==e&&(i.element.removeAttributeNS(i.attributeNamespace,i.attributeName),t[i.attributeName]=e),!0}return!1}function u0(i,e){if(typeof e=="boolean"&&i instanceof fe){let t=i.attributeNamespace,a=i.element.hasAttributeNS(t,i.attributeName);return e!==a&&(i.booleanValue=e),!0}return!1}function c0(i,e){return e===!1&&i instanceof wt?(i.replace(""),!0):!1}function m0(i,e){d0(i,e)||u0(i,e)||n0(i,e)||c0(i,e)||s0(i,e)||o0(i,e)||l0(i,e)}var Yu=new Map,Vp=new WeakMap,Kp=new WeakMap,Lo=class{constructor(e,t,a){this.strings=e;this.values=t;this.processor=a;this.stringsKey=this.strings.join("")}get template(){if(Yu.has(this.stringsKey))return Yu.get(this.stringsKey);{let e=ye.createElement("template"),t=this.strings.length-1;return e.innerHTML=this.strings.reduce((a,r,n)=>a+r+(n<t?`{{ ${n} }}`:""),""),Yu.set(this.stringsKey,e),e}}renderInto(e){var r;let t=this.template;if(Vp.get(e)!==t){Vp.set(e,t);let n=new Mt(t,this.values,this.processor);Kp.set(e,n),e instanceof wt?e.replace(...n.children):e.appendChild(n);return}let a=Kp.get(e);(r=a==null?void 0:a.update)==null||r.call(a,this.values)}},h0={processCallback(i,e,t){var a;if(t){for(let[r,n]of e)if(r in t){let o=(a=t[r])!=null?a:"";m0(n,o)}}}};function Rt(i,...e){return new Lo(i,e,h0)}function Yp(i,e){i.renderInto(e)}var xr=require("@mux/playback-core"),Gp=i=>Rt`
1827
+ `;var wr=class extends Ku{constructor(){var e,t;super(),(t=(e=this.shadowRoot)==null?void 0:e.querySelector(".close"))==null||t.addEventListener("click",()=>{this.close()})}};wr.template=Fp;Z.customElements.get("mxp-dialog")||(Z.customElements.define("mxp-dialog",wr),Z.MxpDialog=wr);var Rr=new WeakMap,Gu=class i{constructor(e,t){this.element=e;this.type=t;this.element.addEventListener(this.type,this);let a=Rr.get(this.element);a&&a.set(this.type,this)}set(e){if(typeof e=="function")this.handleEvent=e.bind(this.element);else if(typeof e=="object"&&typeof e.handleEvent=="function")this.handleEvent=e.handleEvent.bind(e);else{this.element.removeEventListener(this.type,this);let t=Rr.get(this.element);t&&t.delete(this.type)}}static for(e){Rr.has(e.element)||Rr.set(e.element,new Map);let t=e.attributeName.slice(2),a=Rr.get(e.element);return a&&a.has(t)?a.get(t):new i(e.element,t)}};function n0(i,e){return i instanceof fe&&i.attributeName.startsWith("on")?(Gu.for(i).set(e),i.element.removeAttributeNS(i.attributeNamespace,i.attributeName),!0):!1}function s0(i,e){return e instanceof Lo&&i instanceof Rt?(e.renderInto(i),!0):!1}function o0(i,e){return e instanceof DocumentFragment&&i instanceof Rt?(e.childNodes.length&&i.replace(...e.childNodes),!0):!1}function l0(i,e){if(i instanceof fe){let t=i.attributeNamespace,a=i.element.getAttributeNS(t,i.attributeName);return String(e)!==a&&(i.value=String(e)),!0}return i.value=String(e),!0}function d0(i,e){if(i instanceof fe&&e instanceof Element){let t=i.element;return t[i.attributeName]!==e&&(i.element.removeAttributeNS(i.attributeNamespace,i.attributeName),t[i.attributeName]=e),!0}return!1}function u0(i,e){if(typeof e=="boolean"&&i instanceof fe){let t=i.attributeNamespace,a=i.element.hasAttributeNS(t,i.attributeName);return e!==a&&(i.booleanValue=e),!0}return!1}function c0(i,e){return e===!1&&i instanceof Rt?(i.replace(""),!0):!1}function m0(i,e){d0(i,e)||u0(i,e)||n0(i,e)||c0(i,e)||s0(i,e)||o0(i,e)||l0(i,e)}var Yu=new Map,Vp=new WeakMap,Kp=new WeakMap,Lo=class{constructor(e,t,a){this.strings=e;this.values=t;this.processor=a;this.stringsKey=this.strings.join("")}get template(){if(Yu.has(this.stringsKey))return Yu.get(this.stringsKey);{let e=ye.createElement("template"),t=this.strings.length-1;return e.innerHTML=this.strings.reduce((a,r,n)=>a+r+(n<t?`{{ ${n} }}`:""),""),Yu.set(this.stringsKey,e),e}}renderInto(e){var r;let t=this.template;if(Vp.get(e)!==t){Vp.set(e,t);let n=new wt(t,this.values,this.processor);Kp.set(e,n),e instanceof Rt?e.replace(...n.children):e.appendChild(n);return}let a=Kp.get(e);(r=a==null?void 0:a.update)==null||r.call(a,this.values)}},h0={processCallback(i,e,t){var a;if(t){for(let[r,n]of e)if(r in t){let o=(a=t[r])!=null?a:"";m0(n,o)}}}};function xt(i,...e){return new Lo(i,e,h0)}function Yp(i,e){i.renderInto(e)}var xr=require("@mux/playback-core"),Gp=i=>xt`
1828
1828
  <style>
1829
1829
  ${Up}
1830
1830
  </style>
1831
1831
  ${b0(i)}
1832
- `,p0=i=>{let e=i.hotKeys?`${i.hotKeys}`:"";return yr(i.streamType)==="live"&&(e+=" noarrowleft noarrowright"),e},v0={TOP:"top",CENTER:"center",BOTTOM:"bottom",LAYER:"layer",MEDIA_LAYER:"media-layer",POSTER_LAYER:"poster-layer",VERTICAL_LAYER:"vertical-layer",CENTERED_LAYER:"centered-layer",GESTURE_LAYER:"gesture-layer",CONTROLLER_LAYER:"controller",BUTTON:"button",RANGE:"range",DISPLAY:"display",CONTROL_BAR:"control-bar",SELECTMENU:"selectmenu",LISTBOX:"listbox",OPTION:"option",POSTER:"poster",LIVE:"live",PLAY:"play",PRE_PLAY:"pre-play",SEEK_BACKWARD:"seek-backward",SEEK_FORWARD:"seek-forward",MUTE:"mute",CAPTIONS:"captions",AIRPLAY:"airplay",PIP:"pip",FULLSCREEN:"fullscreen",CAST:"cast",PLAYBACK_RATE:"playback-rate",VOLUME:"volume",TIME:"time",TITLE:"title",AUDIO_TRACK:"audio-track",RENDITION:"rendition"},f0=Object.values(v0).join(", "),b0=i=>{var e,t,a,r,n,o,d,u,c,f,E,v,b,w,_,T,D,te,ge,Ot,_t,Ea,ga,_a,Aa,ya,Ta,ka,Sa,Ia,Ca,La,Wr,At,Ma,wa;return Rt`
1832
+ `,p0=i=>{let e=i.hotKeys?`${i.hotKeys}`:"";return yr(i.streamType)==="live"&&(e+=" noarrowleft noarrowright"),e},v0={TOP:"top",CENTER:"center",BOTTOM:"bottom",LAYER:"layer",MEDIA_LAYER:"media-layer",POSTER_LAYER:"poster-layer",VERTICAL_LAYER:"vertical-layer",CENTERED_LAYER:"centered-layer",GESTURE_LAYER:"gesture-layer",CONTROLLER_LAYER:"controller",BUTTON:"button",RANGE:"range",DISPLAY:"display",CONTROL_BAR:"control-bar",SELECTMENU:"selectmenu",LISTBOX:"listbox",OPTION:"option",POSTER:"poster",LIVE:"live",PLAY:"play",PRE_PLAY:"pre-play",SEEK_BACKWARD:"seek-backward",SEEK_FORWARD:"seek-forward",MUTE:"mute",CAPTIONS:"captions",AIRPLAY:"airplay",PIP:"pip",FULLSCREEN:"fullscreen",CAST:"cast",PLAYBACK_RATE:"playback-rate",VOLUME:"volume",TIME:"time",TITLE:"title",AUDIO_TRACK:"audio-track",RENDITION:"rendition"},f0=Object.values(v0).join(", "),b0=i=>{var e,t,a,r,n,o,d,u,c,f,g,v,b,w,A,T,D,ie,ge,Ot,At,Ea,ga,_a,Aa,ya,Ta,ka,Sa,Ia,Ca,La,Wr,yt,Ma,wa;return xt`
1833
1833
  <media-theme
1834
1834
  template="${i.themeTemplate||!1}"
1835
1835
  defaultstreamtype="${(e=i.defaultStreamType)!=null?e:!1}"
@@ -1847,7 +1847,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
1847
1847
  defaultshowremainingtime="${(u=i.defaultShowRemainingTime)!=null?u:!1}"
1848
1848
  defaultduration="${(c=i.defaultDuration)!=null?c:!1}"
1849
1849
  hideduration="${(f=i.hideDuration)!=null?f:!1}"
1850
- title="${(E=i.title)!=null?E:!1}"
1850
+ title="${(g=i.title)!=null?g:!1}"
1851
1851
  exportparts="${f0}"
1852
1852
  >
1853
1853
  <mux-video
@@ -1856,13 +1856,13 @@ media-poster-image:not([src]):not([placeholdersrc]) {
1856
1856
  stream-type="${(b=yr(i.streamType))!=null?b:!1}"
1857
1857
  crossorigin="${(w=i.crossOrigin)!=null?w:""}"
1858
1858
  playsinline
1859
- autoplay="${(_=i.autoplay)!=null?_:!1}"
1859
+ autoplay="${(A=i.autoplay)!=null?A:!1}"
1860
1860
  muted="${(T=i.muted)!=null?T:!1}"
1861
1861
  loop="${(D=i.loop)!=null?D:!1}"
1862
- preload="${(te=i.preload)!=null?te:!1}"
1862
+ preload="${(ie=i.preload)!=null?ie:!1}"
1863
1863
  debug="${(ge=i.debug)!=null?ge:!1}"
1864
1864
  prefer-cmcd="${(Ot=i.preferCmcd)!=null?Ot:!1}"
1865
- disable-tracking="${(_t=i.disableTracking)!=null?_t:!1}"
1865
+ disable-tracking="${(At=i.disableTracking)!=null?At:!1}"
1866
1866
  disable-cookies="${(Ea=i.disableCookies)!=null?Ea:!1}"
1867
1867
  prefer-playback="${(ga=i.preferPlayback)!=null?ga:!1}"
1868
1868
  start-time="${i.startTime!=null?i.startTime:!1}"
@@ -1875,7 +1875,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
1875
1875
  cast-src="${i.src?i.src:i.playbackId?(0,xr.toMuxVideoURL)(i):!1}"
1876
1876
  exportparts="video"
1877
1877
  >
1878
- ${i.storyboard?Rt`<track label="thumbnails" default kind="metadata" src="${i.storyboard}" />`:Rt``}
1878
+ ${i.storyboard?xt`<track label="thumbnails" default kind="metadata" src="${i.storyboard}" />`:xt``}
1879
1879
  </mux-video>
1880
1880
  <slot name="poster" slot="poster">
1881
1881
  <media-poster-image
@@ -1891,20 +1891,20 @@ media-poster-image:not([src]):not([placeholdersrc]) {
1891
1891
  onclose="${i.onCloseErrorDialog}"
1892
1892
  oninitfocus="${i.onInitFocusDialog}"
1893
1893
  >
1894
- ${(La=i.dialog)!=null&&La.title?Rt`<h3>${i.dialog.title}</h3>`:Rt``}
1894
+ ${(La=i.dialog)!=null&&La.title?xt`<h3>${i.dialog.title}</h3>`:xt``}
1895
1895
  <p>
1896
1896
  ${(Wr=i.dialog)==null?void 0:Wr.message}
1897
- ${(At=i.dialog)!=null&&At.linkUrl?Rt`<a
1897
+ ${(yt=i.dialog)!=null&&yt.linkUrl?xt`<a
1898
1898
  href="${i.dialog.linkUrl}"
1899
1899
  target="_blank"
1900
1900
  rel="external noopener"
1901
1901
  aria-label="${(Ma=i.dialog.linkText)!=null?Ma:""} ${C("(opens in a new window)")}"
1902
1902
  >${(wa=i.dialog.linkText)!=null?wa:i.dialog.linkUrl}</a
1903
- >`:Rt``}
1903
+ >`:xt``}
1904
1904
  </p>
1905
1905
  </mxp-dialog>
1906
1906
  </media-theme>
1907
- `};var Dr=require("@mux/mux-video");function Mo(i,e,t,a,r){var d,u,c;let n={},o={};switch(i.code){case Dr.MediaError.MEDIA_ERR_NETWORK:{switch(n.title=C("Network Error",r),n.message=i.message,(d=i.data)==null?void 0:d.response.code){case 412:{n.title=C("Video is not currently available",r),n.message=C("The live stream or video file are not yet ready.",r),o.message=C("This playback-id may belong to a live stream that is not currently active or an asset that is not ready.",r),o.file="412-not-playable.md";break}case 404:{n.title=C("Video does not exist",r),n.message="",o.message=C("This playback-id does not exist. You may have used an Asset ID or an ID from a different resource.",r),o.file="404-not-found.md";break}case 403:{if(n.title=C("Invalid playback URL",r),n.message=C("The video URL or playback-token are formatted with incorrect or incomplete information.",r),o.message=C("403 error trying to access this playback URL. If this is a signed URL, you might need to provide a playback-token.",r),o.file="missing-signed-tokens.md",!a)break;let{exp:f,aud:E,sub:v}=qt(a),b=Date.now()>f*1e3,w=v!==t,_=E!=="v",T={timeStyle:"medium",dateStyle:"medium"};if(b){n.title=C("Video URL has expired",r),n.message=C("The video\u2019s secured playback-token has expired.",r),o.message=C("The video\u2019s secured playback-token has expired.",r),o.context=C("Expired at: {expiredDate}. Current time: {currentDate}.",r).format({expiredDate:new Intl.DateTimeFormat(ki.code,T).format(f*1e3),currentDate:new Intl.DateTimeFormat(ki.code,T).format(Date.now())}),o.file="403-expired-token.md";break}if(w){n.title=C("Video URL is formatted incorrectly",r),n.message=C("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),o.message=C("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),o.context=C("Specified playback ID: {playbackId} and the playback ID encoded in the playback-token: {tokenPlaybackId}",r).format({playbackId:t,tokenPlaybackId:v}),o.file="403-playback-id-mismatch.md";break}if(_){n.title=C("Video URL is formatted incorrectly",r),n.message=C("The playback-token is formatted with incorrect information.",r),o.message=C("The playback-token is formatted with incorrect information.",r),o.context=C("The playback-token has an incorrect aud value: {tokenType}. aud value should be v.",r).format({tokenType:E}),o.file="403-incorrect-aud-value.md";break}o.message=C("403 error trying to access this playback URL. If this is a signed playback ID, the token might not have been generated correctly.",r),o.file="403-malformatted-token.md";break}}break}case Dr.MediaError.MEDIA_ERR_DECODE:{let{message:f}=i;n={title:C("Media Error",r),message:f},o.file="media-decode-error.md";break}case Dr.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:{let f=(c=(u=i.data)==null?void 0:u.response)==null?void 0:c.code;if(f>=400&&f<500){i.code=Dr.MediaError.MEDIA_ERR_NETWORK,i.data={response:{code:f}},{dialog:n,devlog:o}=Mo(i,e,t,a);break}n={title:C("Source Not Supported",r),message:i.message},o.file="media-src-not-supported.md";break}default:n={title:C("Error",r),message:i.message};break}return e&&(n={title:C("Your device appears to be offline",r),message:C("Check your internet connection and try reloading this video.",r)}),{dialog:n,devlog:o}}var qp=`<template id="media-theme-gerwig">
1907
+ `};var Dr=require("@mux/mux-video");function Mo(i,e,t,a,r){var d,u,c;let n={},o={};switch(i.code){case Dr.MediaError.MEDIA_ERR_NETWORK:{switch(n.title=C("Network Error",r),n.message=i.message,(d=i.data)==null?void 0:d.response.code){case 412:{n.title=C("Video is not currently available",r),n.message=C("The live stream or video file are not yet ready.",r),o.message=C("This playback-id may belong to a live stream that is not currently active or an asset that is not ready.",r),o.file="412-not-playable.md";break}case 404:{n.title=C("Video does not exist",r),n.message="",o.message=C("This playback-id does not exist. You may have used an Asset ID or an ID from a different resource.",r),o.file="404-not-found.md";break}case 403:{if(n.title=C("Invalid playback URL",r),n.message=C("The video URL or playback-token are formatted with incorrect or incomplete information.",r),o.message=C("403 error trying to access this playback URL. If this is a signed URL, you might need to provide a playback-token.",r),o.file="missing-signed-tokens.md",!a)break;let{exp:f,aud:g,sub:v}=qt(a),b=Date.now()>f*1e3,w=v!==t,A=g!=="v",T={timeStyle:"medium",dateStyle:"medium"};if(b){n.title=C("Video URL has expired",r),n.message=C("The video\u2019s secured playback-token has expired.",r),o.message=C("The video\u2019s secured playback-token has expired.",r),o.context=C("Expired at: {expiredDate}. Current time: {currentDate}.",r).format({expiredDate:new Intl.DateTimeFormat(Si.code,T).format(f*1e3),currentDate:new Intl.DateTimeFormat(Si.code,T).format(Date.now())}),o.file="403-expired-token.md";break}if(w){n.title=C("Video URL is formatted incorrectly",r),n.message=C("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),o.message=C("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),o.context=C("Specified playback ID: {playbackId} and the playback ID encoded in the playback-token: {tokenPlaybackId}",r).format({playbackId:t,tokenPlaybackId:v}),o.file="403-playback-id-mismatch.md";break}if(A){n.title=C("Video URL is formatted incorrectly",r),n.message=C("The playback-token is formatted with incorrect information.",r),o.message=C("The playback-token is formatted with incorrect information.",r),o.context=C("The playback-token has an incorrect aud value: {tokenType}. aud value should be v.",r).format({tokenType:g}),o.file="403-incorrect-aud-value.md";break}o.message=C("403 error trying to access this playback URL. If this is a signed playback ID, the token might not have been generated correctly.",r),o.file="403-malformatted-token.md";break}}break}case Dr.MediaError.MEDIA_ERR_DECODE:{let{message:f}=i;n={title:C("Media Error",r),message:f},o.file="media-decode-error.md";break}case Dr.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:{let f=(c=(u=i.data)==null?void 0:u.response)==null?void 0:c.code;if(f>=400&&f<500){i.code=Dr.MediaError.MEDIA_ERR_NETWORK,i.data={response:{code:f}},{dialog:n,devlog:o}=Mo(i,e,t,a);break}n={title:C("Source Not Supported",r),message:i.message},o.file="media-src-not-supported.md";break}default:n={title:C("Error",r),message:i.message};break}return e&&(n={title:C("Your device appears to be offline",r),message:C("Check your internet connection and try reloading this video.",r)}),{dialog:n,devlog:o}}var qp=`<template id="media-theme-gerwig">
1908
1908
  <style>
1909
1909
  @keyframes pre-play-hide {
1910
1910
  0% {
@@ -2006,6 +2006,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2006
2006
  --media-preview-border-radius: 5px;
2007
2007
  --media-text-color: var(--_text-color);
2008
2008
  --media-control-hover-background: transparent;
2009
+ --media-preview-chapter-text-shadow: none;
2009
2010
  color: var(--_accent-color);
2010
2011
  padding: 0 6px;
2011
2012
  }
@@ -2178,7 +2179,9 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2178
2179
  paint-order: stroke;
2179
2180
  stroke: rgba(102, 102, 102, 1);
2180
2181
  stroke-width: 0.3px;
2181
- text-shadow: 0 0 2px rgb(0 0 0 / 0.25), 0 0 6px rgb(0 0 0 / 0.25);
2182
+ text-shadow:
2183
+ 0 0 2px rgb(0 0 0 / 0.25),
2184
+ 0 0 6px rgb(0 0 0 / 0.25);
2182
2185
  }
2183
2186
 
2184
2187
  .center-controls media-play-button {
@@ -2895,5 +2898,5 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2895
2898
  <slot></slot>
2896
2899
  </media-controller>
2897
2900
  </template>
2898
- `;var qu=ye.createElement("template");"innerHTML"in qu&&(qu.innerHTML=qp);var Zp,Qp,wo=class extends Jt{};wo.template=(Qp=(Zp=qu.content)==null?void 0:Zp.children)==null?void 0:Qp[0];Z.customElements.get("media-theme-gerwig")||Z.customElements.define("media-theme-gerwig",wo);var g0="gerwig";var xt={SRC:"src",POSTER:"poster"},p={STYLE:"style",DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-color",ACCENT_COLOR:"accent-color",FORWARD_SEEK_OFFSET:"forward-seek-offset",BACKWARD_SEEK_OFFSET:"backward-seek-offset",PLAYBACK_TOKEN:"playback-token",THUMBNAIL_TOKEN:"thumbnail-token",STORYBOARD_TOKEN:"storyboard-token",STORYBOARD_SRC:"storyboard-src",THUMBNAIL_TIME:"thumbnail-time",AUDIO:"audio",NOHOTKEYS:"nohotkeys",HOTKEYS:"hotkeys",PLAYBACK_RATES:"playbackrates",DEFAULT_SHOW_REMAINING_TIME:"default-show-remaining-time",DEFAULT_DURATION:"default-duration",TITLE:"title",PLACEHOLDER:"placeholder",THEME:"theme",DEFAULT_STREAM_TYPE:"default-stream-type",TARGET_LIVE_WINDOW:"target-live-window",EXTRA_SOURCE_PARAMS:"extra-source-params",NO_VOLUME_PREF:"no-volume-pref"},Zu=["audio","backwardseekoffset","defaultduration","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","novolumepref"];function _0(i,e){var a;return{src:!i.playbackId&&i.src,playbackId:i.playbackId,hasSrc:!!i.playbackId||!!i.src,poster:i.poster,storyboard:i.storyboard,storyboardSrc:i.getAttribute(p.STORYBOARD_SRC),placeholder:i.getAttribute("placeholder"),themeTemplate:A0(i),thumbnailTime:!i.tokens.thumbnail&&i.thumbnailTime,autoplay:i.autoplay,crossOrigin:i.crossOrigin,loop:i.loop,noHotKeys:i.hasAttribute(p.NOHOTKEYS),hotKeys:i.getAttribute(p.HOTKEYS),muted:i.muted,paused:i.paused,preload:i.preload,envKey:i.envKey,preferCmcd:i.preferCmcd,debug:i.debug,disableTracking:i.disableTracking,disableCookies:i.disableCookies,tokens:i.tokens,beaconCollectionDomain:i.beaconCollectionDomain,maxResolution:i.maxResolution,minResolution:i.minResolution,renditionOrder:i.renditionOrder,metadata:i.metadata,playerSoftwareName:i.playerSoftwareName,playerSoftwareVersion:i.playerSoftwareVersion,startTime:i.startTime,preferPlayback:i.preferPlayback,audio:i.audio,defaultStreamType:i.defaultStreamType,targetLiveWindow:i.getAttribute(A.Attributes.TARGET_LIVE_WINDOW),streamType:yr(i.getAttribute(A.Attributes.STREAM_TYPE)),primaryColor:i.getAttribute(p.PRIMARY_COLOR),secondaryColor:i.getAttribute(p.SECONDARY_COLOR),accentColor:i.getAttribute(p.ACCENT_COLOR),forwardSeekOffset:i.forwardSeekOffset,backwardSeekOffset:i.backwardSeekOffset,defaultHiddenCaptions:i.defaultHiddenCaptions,defaultDuration:i.defaultDuration,defaultShowRemainingTime:i.defaultShowRemainingTime,hideDuration:y0(i),playbackRates:i.getAttribute(p.PLAYBACK_RATES),customDomain:(a=i.getAttribute(A.Attributes.CUSTOM_DOMAIN))!=null?a:void 0,title:i.getAttribute(p.TITLE),novolumepref:i.hasAttribute(p.NO_VOLUME_PREF),...e,extraSourceParams:i.extraSourceParams}}function A0(i){var t,a;let e=i.theme;if(e){let r=(a=(t=i.getRootNode())==null?void 0:t.getElementById)==null?void 0:a.call(t,e);if(r&&r instanceof HTMLTemplateElement)return r;e.startsWith("media-theme-")||(e=`media-theme-${e}`);let n=Z.customElements.get(e);if(n!=null&&n.template)return n.template}}function y0(i){var t;let e=(t=i.mediaController)==null?void 0:t.querySelector("media-time-display");return e&&getComputedStyle(e).getPropertyValue("--media-duration-display-display").trim()==="none"}function zp(i){let e=i.hasAttribute(p.TITLE)?{video_title:i.getAttribute(p.TITLE)}:{};return i.getAttributeNames().filter(t=>t.startsWith("metadata-")).reduce((t,a)=>{let r=i.getAttribute(a);return r!==null&&(t[a.replace(/^metadata-/,"").replace(/-/g,"_")]=r),t},e)}var T0=Object.values(A.Attributes),k0=Object.values(xt),S0=Object.values(p),I0=go(),C0="mux-player",Xp={dialog:void 0,isDialogOpen:!1},L0={redundant_streams:!0},Pr,Nr,ti,Ur,Oi,Dt,Di,Ro,Jp,Br,Qu,ii,ba,xo,jp,Do,ev,Oo,tv,Po,iv,Or=class extends Pu{constructor(){super();ee(this,Dt);ee(this,Ro);ee(this,Br);ee(this,ii);ee(this,xo);ee(this,Do);ee(this,Oo);ee(this,Po);ee(this,Pr,!1);ee(this,Nr,{});ee(this,ti,!0);ee(this,Ur,new Eo(this,"hotkeys"));ee(this,Oi,{...Xp,onCloseErrorDialog:()=>ie(this,Br,Qu).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:t=>{xu(this,ye.activeElement)||t.preventDefault()}});this.attachShadow({mode:"open"}),ie(this,Ro,Jp).call(this),this.isConnected&&ie(this,Dt,Di).call(this)}static get observedAttributes(){var t;return[...(t=Pu.observedAttributes)!=null?t:[],...k0,...T0,...S0]}get mediaTheme(){var t;return(t=this.shadowRoot)==null?void 0:t.querySelector("media-theme")}get mediaController(){var t,a;return(a=(t=this.mediaTheme)==null?void 0:t.shadowRoot)==null?void 0:a.querySelector("media-controller")}connectedCallback(){var a;let t=(a=this.shadowRoot)==null?void 0:a.querySelector("mux-video");t&&(t.metadata=zp(this))}attributeChangedCallback(t,a,r){switch(ie(this,Dt,Di).call(this),super.attributeChangedCallback(t,a,r),t){case p.HOTKEYS:O(this,Ur).value=r;break;case p.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&Zt(C("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case p.THUMBNAIL_TOKEN:{let{aud:o}=qt(r);r&&o!=="t"&&Zt(C("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:o}));break}case p.STORYBOARD_TOKEN:{let{aud:o}=qt(r);r&&o!=="s"&&Zt(C("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:o}));break}case A.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&Oe(C("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r}));break}case A.Attributes.STREAM_TYPE:r&&![z.StreamTypes.LIVE,z.StreamTypes.ON_DEMAND,z.StreamTypes.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:Du({file:"invalid-stream-type.md",message:C("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):r===z.StreamTypes.LIVE?this.getAttribute(p.TARGET_LIVE_WINDOW)==null&&(this.targetLiveWindow=0):this.targetLiveWindow=Number.NaN}[A.Attributes.PLAYBACK_ID,xt.SRC,p.PLAYBACK_TOKEN].includes(t)&&a!==r&&Ce(this,Oi,{...O(this,Oi),...Xp}),ie(this,ii,ba).call(this,{[gp(t)]:r})}get preferCmcd(){var t;return(t=this.getAttribute(A.Attributes.PREFER_CMCD))!=null?t:void 0}set preferCmcd(t){t!==this.preferCmcd&&(t?z.CmcdTypeValues.includes(t)?this.setAttribute(A.Attributes.PREFER_CMCD,t):Zt(`Invalid value for preferCmcd. Must be one of ${z.CmcdTypeValues.join()}`):this.removeAttribute(A.Attributes.PREFER_CMCD))}get hasPlayed(){var t,a;return(a=(t=this.mediaController)==null?void 0:t.hasAttribute(s.MEDIA_HAS_PLAYED))!=null?a:!1}get inLiveWindow(){var t;return(t=this.mediaController)==null?void 0:t.hasAttribute(s.MEDIA_TIME_IS_LIVE)}get _hls(){var t;return(t=this.media)==null?void 0:t._hls}get mux(){var t;return(t=this.media)==null?void 0:t.mux}get theme(){var t;return(t=this.getAttribute(p.THEME))!=null?t:g0}set theme(t){this.setAttribute(p.THEME,`${t}`)}get themeProps(){let t=this.mediaTheme;if(!t)return;let a={};for(let r of t.getAttributeNames()){if(Zu.includes(r))continue;let n=t.getAttribute(r);a[fo(r)]=n===""?!0:n}return a}set themeProps(t){var r,n;ie(this,Dt,Di).call(this);let a={...this.themeProps,...t};for(let o in a){if(Zu.includes(o))continue;let d=t==null?void 0:t[o];typeof d=="boolean"||d==null?(r=this.mediaTheme)==null||r.toggleAttribute(vo(o),!!d):(n=this.mediaTheme)==null||n.setAttribute(vo(o),d)}}get playbackId(){var t;return(t=this.getAttribute(A.Attributes.PLAYBACK_ID))!=null?t:void 0}set playbackId(t){t?this.setAttribute(A.Attributes.PLAYBACK_ID,t):this.removeAttribute(A.Attributes.PLAYBACK_ID)}get src(){var t,a;return this.playbackId?(t=ei(this,xt.SRC))!=null?t:void 0:(a=this.getAttribute(xt.SRC))!=null?a:void 0}set src(t){t?this.setAttribute(xt.SRC,t):this.removeAttribute(xt.SRC)}get poster(){var a;let t=this.getAttribute(xt.POSTER);if(t!=null)return t;if(this.playbackId&&!this.audio)return bp(this.playbackId,{customDomain:this.customDomain,thumbnailTime:(a=this.thumbnailTime)!=null?a:this.startTime,token:this.tokens.thumbnail})}set poster(t){t||t===""?this.setAttribute(xt.POSTER,t):this.removeAttribute(xt.POSTER)}get storyboardSrc(){var t;return(t=this.getAttribute(p.STORYBOARD_SRC))!=null?t:void 0}set storyboardSrc(t){t?this.setAttribute(p.STORYBOARD_SRC,t):this.removeAttribute(p.STORYBOARD_SRC)}get storyboard(){if(this.storyboardSrc&&!this.tokens.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[z.StreamTypes.LIVE,z.StreamTypes.UNKNOWN].includes(this.streamType)))return Ep(this.playbackId,{customDomain:this.customDomain,token:this.tokens.storyboard})}get audio(){return this.hasAttribute(p.AUDIO)}set audio(t){if(!t){this.removeAttribute(p.AUDIO);return}this.setAttribute(p.AUDIO,"")}get hotkeys(){return O(this,Ur)}get nohotkeys(){return this.hasAttribute(p.NOHOTKEYS)}set nohotkeys(t){if(!t){this.removeAttribute(p.NOHOTKEYS);return}this.setAttribute(p.NOHOTKEYS,"")}get thumbnailTime(){return Et(this.getAttribute(p.THUMBNAIL_TIME))}set thumbnailTime(t){this.setAttribute(p.THUMBNAIL_TIME,`${t}`)}get title(){var t;return(t=this.getAttribute(p.TITLE))!=null?t:""}set title(t){t!==this.title&&(t?this.setAttribute(p.TITLE,t):this.removeAttribute("title"),super.title=t)}get placeholder(){var t;return(t=ei(this,p.PLACEHOLDER))!=null?t:""}set placeholder(t){this.setAttribute(p.PLACEHOLDER,`${t}`)}get primaryColor(){var a,r;let t=this.getAttribute(p.PRIMARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=Z.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),t))return t}set primaryColor(t){this.setAttribute(p.PRIMARY_COLOR,`${t}`)}get secondaryColor(){var a,r;let t=this.getAttribute(p.SECONDARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=Z.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),t))return t}set secondaryColor(t){this.setAttribute(p.SECONDARY_COLOR,`${t}`)}get accentColor(){var a,r;let t=this.getAttribute(p.ACCENT_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=Z.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_accent-color"))==null?void 0:r.trim(),t))return t}set accentColor(t){this.setAttribute(p.ACCENT_COLOR,`${t}`)}get defaultShowRemainingTime(){return this.hasAttribute(p.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(t){t?this.setAttribute(p.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(p.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(this.hasAttribute(p.PLAYBACK_RATES))return this.getAttribute(p.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(t=>Number(t)).filter(t=>!Number.isNaN(t)).sort((t,a)=>t-a)}set playbackRates(t){if(!t){this.removeAttribute(p.PLAYBACK_RATES);return}this.setAttribute(p.PLAYBACK_RATES,t.join(" "))}get forwardSeekOffset(){var t;return(t=Et(this.getAttribute(p.FORWARD_SEEK_OFFSET)))!=null?t:10}set forwardSeekOffset(t){this.setAttribute(p.FORWARD_SEEK_OFFSET,`${t}`)}get backwardSeekOffset(){var t;return(t=Et(this.getAttribute(p.BACKWARD_SEEK_OFFSET)))!=null?t:10}set backwardSeekOffset(t){this.setAttribute(p.BACKWARD_SEEK_OFFSET,`${t}`)}get defaultHiddenCaptions(){return this.hasAttribute(p.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(t){t?this.setAttribute(p.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(p.DEFAULT_HIDDEN_CAPTIONS)}get defaultDuration(){return Et(this.getAttribute(p.DEFAULT_DURATION))}set defaultDuration(t){t==null?this.removeAttribute(p.DEFAULT_DURATION):this.setAttribute(p.DEFAULT_DURATION,`${t}`)}get playerSoftwareName(){var t;return(t=this.getAttribute(A.Attributes.PLAYER_SOFTWARE_NAME))!=null?t:C0}get playerSoftwareVersion(){var t;return(t=this.getAttribute(A.Attributes.PLAYER_SOFTWARE_VERSION))!=null?t:I0}get beaconCollectionDomain(){var t;return(t=this.getAttribute(A.Attributes.BEACON_COLLECTION_DOMAIN))!=null?t:void 0}set beaconCollectionDomain(t){t!==this.beaconCollectionDomain&&(t?this.setAttribute(A.Attributes.BEACON_COLLECTION_DOMAIN,t):this.removeAttribute(A.Attributes.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var t;return(t=this.getAttribute(A.Attributes.MAX_RESOLUTION))!=null?t:void 0}set maxResolution(t){t!==this.maxResolution&&(t?this.setAttribute(A.Attributes.MAX_RESOLUTION,t):this.removeAttribute(A.Attributes.MAX_RESOLUTION))}get minResolution(){var t;return(t=this.getAttribute(A.Attributes.MIN_RESOLUTION))!=null?t:void 0}set minResolution(t){t!==this.minResolution&&(t?this.setAttribute(A.Attributes.MIN_RESOLUTION,t):this.removeAttribute(A.Attributes.MIN_RESOLUTION))}get renditionOrder(){var t;return(t=this.getAttribute(A.Attributes.RENDITION_ORDER))!=null?t:void 0}set renditionOrder(t){t!==this.renditionOrder&&(t?this.setAttribute(A.Attributes.RENDITION_ORDER,t):this.removeAttribute(A.Attributes.RENDITION_ORDER))}get extraSourceParams(){return this.hasAttribute(p.EXTRA_SOURCE_PARAMS)?[...new URLSearchParams(this.getAttribute(p.EXTRA_SOURCE_PARAMS)).entries()].reduce((t,[a,r])=>(t[a]=r,t),{}):L0}set extraSourceParams(t){t==null?this.removeAttribute(p.EXTRA_SOURCE_PARAMS):this.setAttribute(p.EXTRA_SOURCE_PARAMS,new URLSearchParams(t).toString())}get customDomain(){var t;return(t=this.getAttribute(A.Attributes.CUSTOM_DOMAIN))!=null?t:void 0}set customDomain(t){t!==this.customDomain&&(t?this.setAttribute(A.Attributes.CUSTOM_DOMAIN,t):this.removeAttribute(A.Attributes.CUSTOM_DOMAIN))}get envKey(){var t;return(t=ei(this,A.Attributes.ENV_KEY))!=null?t:void 0}set envKey(t){this.setAttribute(A.Attributes.ENV_KEY,`${t}`)}get noVolumePref(){return this.hasAttribute(p.NO_VOLUME_PREF)}set noVolumePref(t){t?this.setAttribute(p.NO_VOLUME_PREF,""):this.removeAttribute(p.NO_VOLUME_PREF)}get debug(){return ei(this,A.Attributes.DEBUG)!=null}set debug(t){t?this.setAttribute(A.Attributes.DEBUG,""):this.removeAttribute(A.Attributes.DEBUG)}get disableTracking(){return ei(this,A.Attributes.DISABLE_TRACKING)!=null}set disableTracking(t){this.toggleAttribute(A.Attributes.DISABLE_TRACKING,!!t)}get disableCookies(){return ei(this,A.Attributes.DISABLE_COOKIES)!=null}set disableCookies(t){t?this.setAttribute(A.Attributes.DISABLE_COOKIES,""):this.removeAttribute(A.Attributes.DISABLE_COOKIES)}get streamType(){var t,a,r;return(r=(a=this.getAttribute(A.Attributes.STREAM_TYPE))!=null?a:(t=this.media)==null?void 0:t.streamType)!=null?r:z.StreamTypes.UNKNOWN}set streamType(t){this.setAttribute(A.Attributes.STREAM_TYPE,`${t}`)}get defaultStreamType(){var t,a,r;return(r=(a=this.getAttribute(p.DEFAULT_STREAM_TYPE))!=null?a:(t=this.mediaController)==null?void 0:t.getAttribute(p.DEFAULT_STREAM_TYPE))!=null?r:z.StreamTypes.ON_DEMAND}set defaultStreamType(t){t?this.setAttribute(p.DEFAULT_STREAM_TYPE,t):this.removeAttribute(p.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var t,a;return this.hasAttribute(p.TARGET_LIVE_WINDOW)?+this.getAttribute(p.TARGET_LIVE_WINDOW):(a=(t=this.media)==null?void 0:t.targetLiveWindow)!=null?a:Number.NaN}set targetLiveWindow(t){t==this.targetLiveWindow||Number.isNaN(t)&&Number.isNaN(this.targetLiveWindow)||(t==null?this.removeAttribute(p.TARGET_LIVE_WINDOW):this.setAttribute(p.TARGET_LIVE_WINDOW,`${+t}`))}get liveEdgeStart(){var t;return(t=this.media)==null?void 0:t.liveEdgeStart}get startTime(){return Et(ei(this,A.Attributes.START_TIME))}set startTime(t){this.setAttribute(A.Attributes.START_TIME,`${t}`)}get preferPlayback(){let t=this.getAttribute(A.Attributes.PREFER_PLAYBACK);if(t===z.PlaybackTypes.MSE||t===z.PlaybackTypes.NATIVE)return t}set preferPlayback(t){t!==this.preferPlayback&&(t===z.PlaybackTypes.MSE||t===z.PlaybackTypes.NATIVE?this.setAttribute(A.Attributes.PREFER_PLAYBACK,t):this.removeAttribute(A.Attributes.PREFER_PLAYBACK))}get metadata(){var t;return(t=this.media)==null?void 0:t.metadata}set metadata(t){if(ie(this,Dt,Di).call(this),!this.media){Oe("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...zp(this),...t}}get _hlsConfig(){var t;return(t=this.media)==null?void 0:t._hlsConfig}set _hlsConfig(t){if(ie(this,Dt,Di).call(this),!this.media){Oe("underlying media element missing when trying to set _hlsConfig. _hlsConfig will not be set.");return}this.media._hlsConfig=t}async addCuePoints(t){var a;if(ie(this,Dt,Di).call(this),!this.media){Oe("underlying media element missing when trying to addCuePoints. cuePoints will not be added.");return}return(a=this.media)==null?void 0:a.addCuePoints(t)}get activeCuePoint(){var t;return(t=this.media)==null?void 0:t.activeCuePoint}get cuePoints(){var t,a;return(a=(t=this.media)==null?void 0:t.cuePoints)!=null?a:[]}getStartDate(){var t;return(t=this.media)==null?void 0:t.getStartDate()}get currentPdt(){var t;return(t=this.media)==null?void 0:t.currentPdt}get tokens(){let t=this.getAttribute(p.PLAYBACK_TOKEN),a=this.getAttribute(p.THUMBNAIL_TOKEN),r=this.getAttribute(p.STORYBOARD_TOKEN);return{...O(this,Nr),...t!=null?{playback:t}:{},...a!=null?{thumbnail:a}:{},...r!=null?{storyboard:r}:{}}}set tokens(t){Ce(this,Nr,t!=null?t:{})}get playbackToken(){var t;return(t=this.getAttribute(p.PLAYBACK_TOKEN))!=null?t:void 0}set playbackToken(t){this.setAttribute(p.PLAYBACK_TOKEN,`${t}`)}get thumbnailToken(){var t;return(t=this.getAttribute(p.THUMBNAIL_TOKEN))!=null?t:void 0}set thumbnailToken(t){this.setAttribute(p.THUMBNAIL_TOKEN,`${t}`)}get storyboardToken(){var t;return(t=this.getAttribute(p.STORYBOARD_TOKEN))!=null?t:void 0}set storyboardToken(t){this.setAttribute(p.STORYBOARD_TOKEN,`${t}`)}addTextTrack(t,a,r,n){var d;let o=(d=this.media)==null?void 0:d.nativeEl;if(o)return(0,z.addTextTrack)(o,t,a,r,n)}removeTextTrack(t){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(a)return(0,z.removeTextTrack)(a,t)}get textTracks(){var t;return(t=this.media)==null?void 0:t.textTracks}};Pr=new WeakMap,Nr=new WeakMap,ti=new WeakMap,Ur=new WeakMap,Oi=new WeakMap,Dt=new WeakSet,Di=function(){var t,a,r;if(!O(this,Pr)){Ce(this,Pr,!0),ie(this,ii,ba).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof Z.HTMLElement))throw""}catch{Oe("<media-theme> failed to upgrade!")}try{if(customElements.upgrade(this.media),!(this.media instanceof A.default))throw""}catch{Oe("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof ol))throw""}catch{Oe("<media-controller> failed to upgrade!")}kp(this),ie(this,xo,jp).call(this),ie(this,Do,ev).call(this),ie(this,Oo,tv).call(this),Ce(this,ti,(a=(t=this.mediaController)==null?void 0:t.hasAttribute(M.USER_INACTIVE))!=null?a:!0),ie(this,Po,iv).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",()=>{ie(this,ii,ba).call(this)})}},Ro=new WeakSet,Jp=function(){var t,a;try{(t=window==null?void 0:window.CSS)==null||t.registerProperty({name:"--media-primary-color",syntax:"<color>",inherits:!0}),(a=window==null?void 0:window.CSS)==null||a.registerProperty({name:"--media-secondary-color",syntax:"<color>",inherits:!0})}catch{}},Br=new WeakSet,Qu=function(t){Object.assign(O(this,Oi),t),ie(this,ii,ba).call(this)},ii=new WeakSet,ba=function(t={}){Yp(Gp(_0(this,{...O(this,Oi),...t})),this.shadowRoot)},xo=new WeakSet,jp=function(){let t=r=>{var d,u;if(!(r!=null&&r.startsWith("theme-")))return;let n=r.replace(/^theme-/,"");if(Zu.includes(n))return;let o=this.getAttribute(r);o!=null?(d=this.mediaTheme)==null||d.setAttribute(n,o):(u=this.mediaTheme)==null||u.removeAttribute(n)};new MutationObserver(r=>{for(let{attributeName:n}of r)t(n)}).observe(this,{attributes:!0}),this.getAttributeNames().forEach(t)},Do=new WeakSet,ev=function(){var a;let t=r=>{let{detail:n}=r;if(n instanceof A.MediaError||(n=new A.MediaError(n.message,n.code,n.fatal)),!(n!=null&&n.fatal)){Zt(n),n.data&&Zt(`${n.name} data:`,n.data);return}let{dialog:o,devlog:d}=Mo(n,!window.navigator.onLine,this.playbackId,this.playbackToken);d.message&&Du(d),Oe(n),n.data&&Oe(`${n.name} data:`,n.data),ie(this,Br,Qu).call(this,{isDialogOpen:!0,dialog:o})};this.addEventListener("error",t),this.media&&(this.media.errorTranslator=(r={})=>{var o,d,u;if(!(((o=this.media)==null?void 0:o.error)instanceof A.MediaError))return r;let{devlog:n}=Mo((d=this.media)==null?void 0:d.error,!window.navigator.onLine,this.playbackId,this.playbackToken,!1);return{player_error_code:(u=this.media)==null?void 0:u.error.code,player_error_message:n.message?String(n.message):r.player_error_message,player_error_context:n.context?String(n.context):r.player_error_context}}),(a=this.media)==null||a.addEventListener("error",r=>{var o,d;let{detail:n}=r;if(!n){let{message:u,code:c}=(d=(o=this.media)==null?void 0:o.error)!=null?d:{};n=new A.MediaError(u,c)}n!=null&&n.fatal&&this.dispatchEvent(new CustomEvent("error",{detail:n}))})},Oo=new WeakSet,tv=function(){var a,r,n,o;let t=()=>ie(this,ii,ba).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",t),(o=(n=this.media)==null?void 0:n.textTracks)==null||o.addEventListener("removetrack",t)},Po=new WeakSet,iv=function(){var c,f;if(!/Firefox/i.test(navigator.userAgent))return;let a,r=new WeakMap,n=()=>this.streamType===z.StreamTypes.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,o=(E,v,b=!1)=>{if(n())return;Array.from(E&&E.activeCues||[]).forEach(_=>{if(!(!_.snapToLines||_.line<-5||_.line>=0&&_.line<10))if(!v||this.paused){let T=_.text.split(`
2899
- `).length,D=-3;this.streamType===z.StreamTypes.LIVE&&(D=-2);let te=D-T;if(_.line===te&&!b)return;r.has(_)||r.set(_,_.line),_.line=te}else setTimeout(()=>{_.line=r.get(_)||"auto"},500)})},d=()=>{var E,v;o(a,(v=(E=this.mediaController)==null?void 0:E.hasAttribute(M.USER_INACTIVE))!=null?v:!1)},u=()=>{var b,w;let v=Array.from(((w=(b=this.mediaController)==null?void 0:b.media)==null?void 0:w.textTracks)||[]).filter(_=>["subtitles","captions"].includes(_.kind)&&_.mode==="showing")[0];v!==a&&(a==null||a.removeEventListener("cuechange",d)),a=v,a==null||a.addEventListener("cuechange",d),o(a,O(this,ti))};u(),(c=this.textTracks)==null||c.addEventListener("change",u),(f=this.textTracks)==null||f.addEventListener("addtrack",u),this.addEventListener("userinactivechange",()=>{var v,b;let E=(b=(v=this.mediaController)==null?void 0:v.hasAttribute(M.USER_INACTIVE))!=null?b:!0;O(this,ti)!==E&&(Ce(this,ti,E),o(a,O(this,ti)))})};function ei(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}Z.customElements.get("mux-player")||(Z.customElements.define("mux-player",Or),Z.MuxPlayerElement=Or);var M0=Or;
2901
+ `;var qu=ye.createElement("template");"innerHTML"in qu&&(qu.innerHTML=qp);var Zp,Qp,wo=class extends Jt{};wo.template=(Qp=(Zp=qu.content)==null?void 0:Zp.children)==null?void 0:Qp[0];Z.customElements.get("media-theme-gerwig")||Z.customElements.define("media-theme-gerwig",wo);var g0="gerwig";var Dt={SRC:"src",POSTER:"poster"},p={STYLE:"style",DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-color",ACCENT_COLOR:"accent-color",FORWARD_SEEK_OFFSET:"forward-seek-offset",BACKWARD_SEEK_OFFSET:"backward-seek-offset",PLAYBACK_TOKEN:"playback-token",THUMBNAIL_TOKEN:"thumbnail-token",STORYBOARD_TOKEN:"storyboard-token",STORYBOARD_SRC:"storyboard-src",THUMBNAIL_TIME:"thumbnail-time",AUDIO:"audio",NOHOTKEYS:"nohotkeys",HOTKEYS:"hotkeys",PLAYBACK_RATES:"playbackrates",DEFAULT_SHOW_REMAINING_TIME:"default-show-remaining-time",DEFAULT_DURATION:"default-duration",TITLE:"title",PLACEHOLDER:"placeholder",THEME:"theme",DEFAULT_STREAM_TYPE:"default-stream-type",TARGET_LIVE_WINDOW:"target-live-window",EXTRA_SOURCE_PARAMS:"extra-source-params",NO_VOLUME_PREF:"no-volume-pref"},Zu=["audio","backwardseekoffset","defaultduration","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","novolumepref"];function _0(i,e){var a;return{src:!i.playbackId&&i.src,playbackId:i.playbackId,hasSrc:!!i.playbackId||!!i.src,poster:i.poster,storyboard:i.storyboard,storyboardSrc:i.getAttribute(p.STORYBOARD_SRC),placeholder:i.getAttribute("placeholder"),themeTemplate:A0(i),thumbnailTime:!i.tokens.thumbnail&&i.thumbnailTime,autoplay:i.autoplay,crossOrigin:i.crossOrigin,loop:i.loop,noHotKeys:i.hasAttribute(p.NOHOTKEYS),hotKeys:i.getAttribute(p.HOTKEYS),muted:i.muted,paused:i.paused,preload:i.preload,envKey:i.envKey,preferCmcd:i.preferCmcd,debug:i.debug,disableTracking:i.disableTracking,disableCookies:i.disableCookies,tokens:i.tokens,beaconCollectionDomain:i.beaconCollectionDomain,maxResolution:i.maxResolution,minResolution:i.minResolution,programStartTime:i.programStartTime,programEndTime:i.programEndTime,renditionOrder:i.renditionOrder,metadata:i.metadata,playerSoftwareName:i.playerSoftwareName,playerSoftwareVersion:i.playerSoftwareVersion,startTime:i.startTime,preferPlayback:i.preferPlayback,audio:i.audio,defaultStreamType:i.defaultStreamType,targetLiveWindow:i.getAttribute(E.Attributes.TARGET_LIVE_WINDOW),streamType:yr(i.getAttribute(E.Attributes.STREAM_TYPE)),primaryColor:i.getAttribute(p.PRIMARY_COLOR),secondaryColor:i.getAttribute(p.SECONDARY_COLOR),accentColor:i.getAttribute(p.ACCENT_COLOR),forwardSeekOffset:i.forwardSeekOffset,backwardSeekOffset:i.backwardSeekOffset,defaultHiddenCaptions:i.defaultHiddenCaptions,defaultDuration:i.defaultDuration,defaultShowRemainingTime:i.defaultShowRemainingTime,hideDuration:y0(i),playbackRates:i.getAttribute(p.PLAYBACK_RATES),customDomain:(a=i.getAttribute(E.Attributes.CUSTOM_DOMAIN))!=null?a:void 0,title:i.getAttribute(p.TITLE),novolumepref:i.hasAttribute(p.NO_VOLUME_PREF),...e,extraSourceParams:i.extraSourceParams}}function A0(i){var t,a;let e=i.theme;if(e){let r=(a=(t=i.getRootNode())==null?void 0:t.getElementById)==null?void 0:a.call(t,e);if(r&&r instanceof HTMLTemplateElement)return r;e.startsWith("media-theme-")||(e=`media-theme-${e}`);let n=Z.customElements.get(e);if(n!=null&&n.template)return n.template}}function y0(i){var t;let e=(t=i.mediaController)==null?void 0:t.querySelector("media-time-display");return e&&getComputedStyle(e).getPropertyValue("--media-duration-display-display").trim()==="none"}function zp(i){let e=i.hasAttribute(p.TITLE)?{video_title:i.getAttribute(p.TITLE)}:{};return i.getAttributeNames().filter(t=>t.startsWith("metadata-")).reduce((t,a)=>{let r=i.getAttribute(a);return r!==null&&(t[a.replace(/^metadata-/,"").replace(/-/g,"_")]=r),t},e)}var T0=Object.values(E.Attributes),k0=Object.values(Dt),S0=Object.values(p),I0=go(),C0="mux-player",Xp={dialog:void 0,isDialogOpen:!1},L0={redundant_streams:!0},Pr,Nr,ii,Ur,Oi,_t,ei,Ro,Jp,Br,Qu,ai,ba,xo,jp,Do,ev,Oo,tv,Po,iv,Or=class extends Pu{constructor(){super();ee(this,_t);ee(this,Ro);ee(this,Br);ee(this,ai);ee(this,xo);ee(this,Do);ee(this,Oo);ee(this,Po);ee(this,Pr,!1);ee(this,Nr,{});ee(this,ii,!0);ee(this,Ur,new Eo(this,"hotkeys"));ee(this,Oi,{...Xp,onCloseErrorDialog:()=>te(this,Br,Qu).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:t=>{xu(this,ye.activeElement)||t.preventDefault()}});this.attachShadow({mode:"open"}),te(this,Ro,Jp).call(this),this.isConnected&&te(this,_t,ei).call(this)}static get observedAttributes(){var t;return[...(t=Pu.observedAttributes)!=null?t:[],...k0,...T0,...S0]}get mediaTheme(){var t;return(t=this.shadowRoot)==null?void 0:t.querySelector("media-theme")}get mediaController(){var t,a;return(a=(t=this.mediaTheme)==null?void 0:t.shadowRoot)==null?void 0:a.querySelector("media-controller")}connectedCallback(){var a;let t=(a=this.shadowRoot)==null?void 0:a.querySelector("mux-video");t&&(t.metadata=zp(this))}attributeChangedCallback(t,a,r){switch(te(this,_t,ei).call(this),super.attributeChangedCallback(t,a,r),t){case p.HOTKEYS:O(this,Ur).value=r;break;case p.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&Zt(C("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case p.THUMBNAIL_TOKEN:{let{aud:o}=qt(r);r&&o!=="t"&&Zt(C("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:o}));break}case p.STORYBOARD_TOKEN:{let{aud:o}=qt(r);r&&o!=="s"&&Zt(C("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:o}));break}case E.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&Ce(C("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r}));break}case E.Attributes.STREAM_TYPE:r&&![z.StreamTypes.LIVE,z.StreamTypes.ON_DEMAND,z.StreamTypes.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:Du({file:"invalid-stream-type.md",message:C("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):r===z.StreamTypes.LIVE?this.getAttribute(p.TARGET_LIVE_WINDOW)==null&&(this.targetLiveWindow=0):this.targetLiveWindow=Number.NaN}[E.Attributes.PLAYBACK_ID,Dt.SRC,p.PLAYBACK_TOKEN].includes(t)&&a!==r&&Le(this,Oi,{...O(this,Oi),...Xp}),te(this,ai,ba).call(this,{[gp(t)]:r})}get preferCmcd(){var t;return(t=this.getAttribute(E.Attributes.PREFER_CMCD))!=null?t:void 0}set preferCmcd(t){t!==this.preferCmcd&&(t?z.CmcdTypeValues.includes(t)?this.setAttribute(E.Attributes.PREFER_CMCD,t):Zt(`Invalid value for preferCmcd. Must be one of ${z.CmcdTypeValues.join()}`):this.removeAttribute(E.Attributes.PREFER_CMCD))}get hasPlayed(){var t,a;return(a=(t=this.mediaController)==null?void 0:t.hasAttribute(s.MEDIA_HAS_PLAYED))!=null?a:!1}get inLiveWindow(){var t;return(t=this.mediaController)==null?void 0:t.hasAttribute(s.MEDIA_TIME_IS_LIVE)}get _hls(){var t;return(t=this.media)==null?void 0:t._hls}get mux(){var t;return(t=this.media)==null?void 0:t.mux}get theme(){var t;return(t=this.getAttribute(p.THEME))!=null?t:g0}set theme(t){this.setAttribute(p.THEME,`${t}`)}get themeProps(){let t=this.mediaTheme;if(!t)return;let a={};for(let r of t.getAttributeNames()){if(Zu.includes(r))continue;let n=t.getAttribute(r);a[fo(r)]=n===""?!0:n}return a}set themeProps(t){var r,n;te(this,_t,ei).call(this);let a={...this.themeProps,...t};for(let o in a){if(Zu.includes(o))continue;let d=t==null?void 0:t[o];typeof d=="boolean"||d==null?(r=this.mediaTheme)==null||r.toggleAttribute(vo(o),!!d):(n=this.mediaTheme)==null||n.setAttribute(vo(o),d)}}get playbackId(){var t;return(t=this.getAttribute(E.Attributes.PLAYBACK_ID))!=null?t:void 0}set playbackId(t){t?this.setAttribute(E.Attributes.PLAYBACK_ID,t):this.removeAttribute(E.Attributes.PLAYBACK_ID)}get src(){var t,a;return this.playbackId?(t=ti(this,Dt.SRC))!=null?t:void 0:(a=this.getAttribute(Dt.SRC))!=null?a:void 0}set src(t){t?this.setAttribute(Dt.SRC,t):this.removeAttribute(Dt.SRC)}get poster(){var a;let t=this.getAttribute(Dt.POSTER);if(t!=null)return t;if(this.playbackId&&!this.audio)return bp(this.playbackId,{customDomain:this.customDomain,thumbnailTime:(a=this.thumbnailTime)!=null?a:this.startTime,programTime:this.programStartTime,token:this.tokens.thumbnail})}set poster(t){t||t===""?this.setAttribute(Dt.POSTER,t):this.removeAttribute(Dt.POSTER)}get storyboardSrc(){var t;return(t=this.getAttribute(p.STORYBOARD_SRC))!=null?t:void 0}set storyboardSrc(t){t?this.setAttribute(p.STORYBOARD_SRC,t):this.removeAttribute(p.STORYBOARD_SRC)}get storyboard(){if(this.storyboardSrc&&!this.tokens.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[z.StreamTypes.LIVE,z.StreamTypes.UNKNOWN].includes(this.streamType)))return Ep(this.playbackId,{customDomain:this.customDomain,token:this.tokens.storyboard,programStartTime:this.programStartTime,programEndTime:this.programEndTime})}get audio(){return this.hasAttribute(p.AUDIO)}set audio(t){if(!t){this.removeAttribute(p.AUDIO);return}this.setAttribute(p.AUDIO,"")}get hotkeys(){return O(this,Ur)}get nohotkeys(){return this.hasAttribute(p.NOHOTKEYS)}set nohotkeys(t){if(!t){this.removeAttribute(p.NOHOTKEYS);return}this.setAttribute(p.NOHOTKEYS,"")}get thumbnailTime(){return Pe(this.getAttribute(p.THUMBNAIL_TIME))}set thumbnailTime(t){this.setAttribute(p.THUMBNAIL_TIME,`${t}`)}get title(){var t;return(t=this.getAttribute(p.TITLE))!=null?t:""}set title(t){t!==this.title&&(t?this.setAttribute(p.TITLE,t):this.removeAttribute("title"),super.title=t)}get placeholder(){var t;return(t=ti(this,p.PLACEHOLDER))!=null?t:""}set placeholder(t){this.setAttribute(p.PLACEHOLDER,`${t}`)}get primaryColor(){var a,r;let t=this.getAttribute(p.PRIMARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=Z.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),t))return t}set primaryColor(t){this.setAttribute(p.PRIMARY_COLOR,`${t}`)}get secondaryColor(){var a,r;let t=this.getAttribute(p.SECONDARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=Z.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),t))return t}set secondaryColor(t){this.setAttribute(p.SECONDARY_COLOR,`${t}`)}get accentColor(){var a,r;let t=this.getAttribute(p.ACCENT_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=Z.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_accent-color"))==null?void 0:r.trim(),t))return t}set accentColor(t){this.setAttribute(p.ACCENT_COLOR,`${t}`)}get defaultShowRemainingTime(){return this.hasAttribute(p.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(t){t?this.setAttribute(p.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(p.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(this.hasAttribute(p.PLAYBACK_RATES))return this.getAttribute(p.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(t=>Number(t)).filter(t=>!Number.isNaN(t)).sort((t,a)=>t-a)}set playbackRates(t){if(!t){this.removeAttribute(p.PLAYBACK_RATES);return}this.setAttribute(p.PLAYBACK_RATES,t.join(" "))}get forwardSeekOffset(){var t;return(t=Pe(this.getAttribute(p.FORWARD_SEEK_OFFSET)))!=null?t:10}set forwardSeekOffset(t){this.setAttribute(p.FORWARD_SEEK_OFFSET,`${t}`)}get backwardSeekOffset(){var t;return(t=Pe(this.getAttribute(p.BACKWARD_SEEK_OFFSET)))!=null?t:10}set backwardSeekOffset(t){this.setAttribute(p.BACKWARD_SEEK_OFFSET,`${t}`)}get defaultHiddenCaptions(){return this.hasAttribute(p.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(t){t?this.setAttribute(p.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(p.DEFAULT_HIDDEN_CAPTIONS)}get defaultDuration(){return Pe(this.getAttribute(p.DEFAULT_DURATION))}set defaultDuration(t){t==null?this.removeAttribute(p.DEFAULT_DURATION):this.setAttribute(p.DEFAULT_DURATION,`${t}`)}get playerSoftwareName(){var t;return(t=this.getAttribute(E.Attributes.PLAYER_SOFTWARE_NAME))!=null?t:C0}get playerSoftwareVersion(){var t;return(t=this.getAttribute(E.Attributes.PLAYER_SOFTWARE_VERSION))!=null?t:I0}get beaconCollectionDomain(){var t;return(t=this.getAttribute(E.Attributes.BEACON_COLLECTION_DOMAIN))!=null?t:void 0}set beaconCollectionDomain(t){t!==this.beaconCollectionDomain&&(t?this.setAttribute(E.Attributes.BEACON_COLLECTION_DOMAIN,t):this.removeAttribute(E.Attributes.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var t;return(t=this.getAttribute(E.Attributes.MAX_RESOLUTION))!=null?t:void 0}set maxResolution(t){t!==this.maxResolution&&(t?this.setAttribute(E.Attributes.MAX_RESOLUTION,t):this.removeAttribute(E.Attributes.MAX_RESOLUTION))}get minResolution(){var t;return(t=this.getAttribute(E.Attributes.MIN_RESOLUTION))!=null?t:void 0}set minResolution(t){t!==this.minResolution&&(t?this.setAttribute(E.Attributes.MIN_RESOLUTION,t):this.removeAttribute(E.Attributes.MIN_RESOLUTION))}get renditionOrder(){var t;return(t=this.getAttribute(E.Attributes.RENDITION_ORDER))!=null?t:void 0}set renditionOrder(t){t!==this.renditionOrder&&(t?this.setAttribute(E.Attributes.RENDITION_ORDER,t):this.removeAttribute(E.Attributes.RENDITION_ORDER))}get programStartTime(){return Pe(this.getAttribute(E.Attributes.PROGRAM_START_TIME))}set programStartTime(t){t==null?this.removeAttribute(E.Attributes.PROGRAM_START_TIME):this.setAttribute(E.Attributes.PROGRAM_START_TIME,`${t}`)}get programEndTime(){return Pe(this.getAttribute(E.Attributes.PROGRAM_END_TIME))}set programEndTime(t){t==null?this.removeAttribute(E.Attributes.PROGRAM_END_TIME):this.setAttribute(E.Attributes.PROGRAM_END_TIME,`${t}`)}get extraSourceParams(){return this.hasAttribute(p.EXTRA_SOURCE_PARAMS)?[...new URLSearchParams(this.getAttribute(p.EXTRA_SOURCE_PARAMS)).entries()].reduce((t,[a,r])=>(t[a]=r,t),{}):L0}set extraSourceParams(t){t==null?this.removeAttribute(p.EXTRA_SOURCE_PARAMS):this.setAttribute(p.EXTRA_SOURCE_PARAMS,new URLSearchParams(t).toString())}get customDomain(){var t;return(t=this.getAttribute(E.Attributes.CUSTOM_DOMAIN))!=null?t:void 0}set customDomain(t){t!==this.customDomain&&(t?this.setAttribute(E.Attributes.CUSTOM_DOMAIN,t):this.removeAttribute(E.Attributes.CUSTOM_DOMAIN))}get envKey(){var t;return(t=ti(this,E.Attributes.ENV_KEY))!=null?t:void 0}set envKey(t){this.setAttribute(E.Attributes.ENV_KEY,`${t}`)}get noVolumePref(){return this.hasAttribute(p.NO_VOLUME_PREF)}set noVolumePref(t){t?this.setAttribute(p.NO_VOLUME_PREF,""):this.removeAttribute(p.NO_VOLUME_PREF)}get debug(){return ti(this,E.Attributes.DEBUG)!=null}set debug(t){t?this.setAttribute(E.Attributes.DEBUG,""):this.removeAttribute(E.Attributes.DEBUG)}get disableTracking(){return ti(this,E.Attributes.DISABLE_TRACKING)!=null}set disableTracking(t){this.toggleAttribute(E.Attributes.DISABLE_TRACKING,!!t)}get disableCookies(){return ti(this,E.Attributes.DISABLE_COOKIES)!=null}set disableCookies(t){t?this.setAttribute(E.Attributes.DISABLE_COOKIES,""):this.removeAttribute(E.Attributes.DISABLE_COOKIES)}get streamType(){var t,a,r;return(r=(a=this.getAttribute(E.Attributes.STREAM_TYPE))!=null?a:(t=this.media)==null?void 0:t.streamType)!=null?r:z.StreamTypes.UNKNOWN}set streamType(t){this.setAttribute(E.Attributes.STREAM_TYPE,`${t}`)}get defaultStreamType(){var t,a,r;return(r=(a=this.getAttribute(p.DEFAULT_STREAM_TYPE))!=null?a:(t=this.mediaController)==null?void 0:t.getAttribute(p.DEFAULT_STREAM_TYPE))!=null?r:z.StreamTypes.ON_DEMAND}set defaultStreamType(t){t?this.setAttribute(p.DEFAULT_STREAM_TYPE,t):this.removeAttribute(p.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var t,a;return this.hasAttribute(p.TARGET_LIVE_WINDOW)?+this.getAttribute(p.TARGET_LIVE_WINDOW):(a=(t=this.media)==null?void 0:t.targetLiveWindow)!=null?a:Number.NaN}set targetLiveWindow(t){t==this.targetLiveWindow||Number.isNaN(t)&&Number.isNaN(this.targetLiveWindow)||(t==null?this.removeAttribute(p.TARGET_LIVE_WINDOW):this.setAttribute(p.TARGET_LIVE_WINDOW,`${+t}`))}get liveEdgeStart(){var t;return(t=this.media)==null?void 0:t.liveEdgeStart}get startTime(){return Pe(ti(this,E.Attributes.START_TIME))}set startTime(t){this.setAttribute(E.Attributes.START_TIME,`${t}`)}get preferPlayback(){let t=this.getAttribute(E.Attributes.PREFER_PLAYBACK);if(t===z.PlaybackTypes.MSE||t===z.PlaybackTypes.NATIVE)return t}set preferPlayback(t){t!==this.preferPlayback&&(t===z.PlaybackTypes.MSE||t===z.PlaybackTypes.NATIVE?this.setAttribute(E.Attributes.PREFER_PLAYBACK,t):this.removeAttribute(E.Attributes.PREFER_PLAYBACK))}get metadata(){var t;return(t=this.media)==null?void 0:t.metadata}set metadata(t){if(te(this,_t,ei).call(this),!this.media){Ce("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...zp(this),...t}}get _hlsConfig(){var t;return(t=this.media)==null?void 0:t._hlsConfig}set _hlsConfig(t){if(te(this,_t,ei).call(this),!this.media){Ce("underlying media element missing when trying to set _hlsConfig. _hlsConfig will not be set.");return}this.media._hlsConfig=t}async addCuePoints(t){var a;if(te(this,_t,ei).call(this),!this.media){Ce("underlying media element missing when trying to addCuePoints. cuePoints will not be added.");return}return(a=this.media)==null?void 0:a.addCuePoints(t)}get activeCuePoint(){var t;return(t=this.media)==null?void 0:t.activeCuePoint}get cuePoints(){var t,a;return(a=(t=this.media)==null?void 0:t.cuePoints)!=null?a:[]}addChapters(t){var a;if(te(this,_t,ei).call(this),!this.media){Ce("underlying media element missing when trying to addChapters. chapters will not be added.");return}return(a=this.media)==null?void 0:a.addChapters(t)}get activeChapter(){var t;return(t=this.media)==null?void 0:t.activeChapter}get chapters(){var t,a;return(a=(t=this.media)==null?void 0:t.chapters)!=null?a:[]}getStartDate(){var t;return(t=this.media)==null?void 0:t.getStartDate()}get currentPdt(){var t;return(t=this.media)==null?void 0:t.currentPdt}get tokens(){let t=this.getAttribute(p.PLAYBACK_TOKEN),a=this.getAttribute(p.THUMBNAIL_TOKEN),r=this.getAttribute(p.STORYBOARD_TOKEN);return{...O(this,Nr),...t!=null?{playback:t}:{},...a!=null?{thumbnail:a}:{},...r!=null?{storyboard:r}:{}}}set tokens(t){Le(this,Nr,t!=null?t:{})}get playbackToken(){var t;return(t=this.getAttribute(p.PLAYBACK_TOKEN))!=null?t:void 0}set playbackToken(t){this.setAttribute(p.PLAYBACK_TOKEN,`${t}`)}get thumbnailToken(){var t;return(t=this.getAttribute(p.THUMBNAIL_TOKEN))!=null?t:void 0}set thumbnailToken(t){this.setAttribute(p.THUMBNAIL_TOKEN,`${t}`)}get storyboardToken(){var t;return(t=this.getAttribute(p.STORYBOARD_TOKEN))!=null?t:void 0}set storyboardToken(t){this.setAttribute(p.STORYBOARD_TOKEN,`${t}`)}addTextTrack(t,a,r,n){var d;let o=(d=this.media)==null?void 0:d.nativeEl;if(o)return(0,z.addTextTrack)(o,t,a,r,n)}removeTextTrack(t){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(a)return(0,z.removeTextTrack)(a,t)}get textTracks(){var t;return(t=this.media)==null?void 0:t.textTracks}};Pr=new WeakMap,Nr=new WeakMap,ii=new WeakMap,Ur=new WeakMap,Oi=new WeakMap,_t=new WeakSet,ei=function(){var t,a,r;if(!O(this,Pr)){Le(this,Pr,!0),te(this,ai,ba).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof Z.HTMLElement))throw""}catch{Ce("<media-theme> failed to upgrade!")}try{if(customElements.upgrade(this.media),!(this.media instanceof E.default))throw""}catch{Ce("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof ol))throw""}catch{Ce("<media-controller> failed to upgrade!")}kp(this),te(this,xo,jp).call(this),te(this,Do,ev).call(this),te(this,Oo,tv).call(this),Le(this,ii,(a=(t=this.mediaController)==null?void 0:t.hasAttribute(M.USER_INACTIVE))!=null?a:!0),te(this,Po,iv).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",()=>{te(this,ai,ba).call(this)})}},Ro=new WeakSet,Jp=function(){var t,a;try{(t=window==null?void 0:window.CSS)==null||t.registerProperty({name:"--media-primary-color",syntax:"<color>",inherits:!0}),(a=window==null?void 0:window.CSS)==null||a.registerProperty({name:"--media-secondary-color",syntax:"<color>",inherits:!0})}catch{}},Br=new WeakSet,Qu=function(t){Object.assign(O(this,Oi),t),te(this,ai,ba).call(this)},ai=new WeakSet,ba=function(t={}){Yp(Gp(_0(this,{...O(this,Oi),...t})),this.shadowRoot)},xo=new WeakSet,jp=function(){let t=r=>{var d,u;if(!(r!=null&&r.startsWith("theme-")))return;let n=r.replace(/^theme-/,"");if(Zu.includes(n))return;let o=this.getAttribute(r);o!=null?(d=this.mediaTheme)==null||d.setAttribute(n,o):(u=this.mediaTheme)==null||u.removeAttribute(n)};new MutationObserver(r=>{for(let{attributeName:n}of r)t(n)}).observe(this,{attributes:!0}),this.getAttributeNames().forEach(t)},Do=new WeakSet,ev=function(){var a;let t=r=>{let{detail:n}=r;if(n instanceof E.MediaError||(n=new E.MediaError(n.message,n.code,n.fatal)),!(n!=null&&n.fatal)){Zt(n),n.data&&Zt(`${n.name} data:`,n.data);return}let{dialog:o,devlog:d}=Mo(n,!window.navigator.onLine,this.playbackId,this.playbackToken);d.message&&Du(d),Ce(n),n.data&&Ce(`${n.name} data:`,n.data),te(this,Br,Qu).call(this,{isDialogOpen:!0,dialog:o})};this.addEventListener("error",t),this.media&&(this.media.errorTranslator=(r={})=>{var o,d,u;if(!(((o=this.media)==null?void 0:o.error)instanceof E.MediaError))return r;let{devlog:n}=Mo((d=this.media)==null?void 0:d.error,!window.navigator.onLine,this.playbackId,this.playbackToken,!1);return{player_error_code:(u=this.media)==null?void 0:u.error.code,player_error_message:n.message?String(n.message):r.player_error_message,player_error_context:n.context?String(n.context):r.player_error_context}}),(a=this.media)==null||a.addEventListener("error",r=>{var o,d;let{detail:n}=r;if(!n){let{message:u,code:c}=(d=(o=this.media)==null?void 0:o.error)!=null?d:{};n=new E.MediaError(u,c)}n!=null&&n.fatal&&this.dispatchEvent(new CustomEvent("error",{detail:n}))})},Oo=new WeakSet,tv=function(){var a,r,n,o;let t=()=>te(this,ai,ba).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",t),(o=(n=this.media)==null?void 0:n.textTracks)==null||o.addEventListener("removetrack",t)},Po=new WeakSet,iv=function(){var c,f;if(!/Firefox/i.test(navigator.userAgent))return;let a,r=new WeakMap,n=()=>this.streamType===z.StreamTypes.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,o=(g,v,b=!1)=>{if(n())return;Array.from(g&&g.activeCues||[]).forEach(A=>{if(!(!A.snapToLines||A.line<-5||A.line>=0&&A.line<10))if(!v||this.paused){let T=A.text.split(`
2902
+ `).length,D=-3;this.streamType===z.StreamTypes.LIVE&&(D=-2);let ie=D-T;if(A.line===ie&&!b)return;r.has(A)||r.set(A,A.line),A.line=ie}else setTimeout(()=>{A.line=r.get(A)||"auto"},500)})},d=()=>{var g,v;o(a,(v=(g=this.mediaController)==null?void 0:g.hasAttribute(M.USER_INACTIVE))!=null?v:!1)},u=()=>{var b,w;let v=Array.from(((w=(b=this.mediaController)==null?void 0:b.media)==null?void 0:w.textTracks)||[]).filter(A=>["subtitles","captions"].includes(A.kind)&&A.mode==="showing")[0];v!==a&&(a==null||a.removeEventListener("cuechange",d)),a=v,a==null||a.addEventListener("cuechange",d),o(a,O(this,ii))};u(),(c=this.textTracks)==null||c.addEventListener("change",u),(f=this.textTracks)==null||f.addEventListener("addtrack",u),this.addEventListener("userinactivechange",()=>{var v,b;let g=(b=(v=this.mediaController)==null?void 0:v.hasAttribute(M.USER_INACTIVE))!=null?b:!0;O(this,ii)!==g&&(Le(this,ii,g),o(a,O(this,ii)))})};function ti(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}Z.customElements.get("mux-player")||(Z.customElements.define("mux-player",Or),Z.MuxPlayerElement=Or);var M0=Or;