@mux/mux-player 3.1.0 → 3.2.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 lh=Object.create;var Tr=Object.defineProperty;var dh=Object.getOwnPropertyDescriptor;var uh=Object.getOwnPropertyNames;var ch=Object.getPrototypeOf,mh=Object.prototype.hasOwnProperty;var hh=(i,e)=>{for(var t in e)Tr(i,t,{get:e[t],enumerable:!0})},kd=(i,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of uh(e))!mh.call(i,r)&&r!==t&&Tr(i,r,{get:()=>e[r],enumerable:!(a=dh(e,r))||a.enumerable});return i};var ph=(i,e,t)=>(t=i!=null?lh(ch(i)):{},kd(e||!i||!i.__esModule?Tr(t,"default",{value:i,enumerable:!0}):t,i)),vh=i=>kd(Tr({},"__esModule",{value:!0}),i);var Oo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)};var R=(i,e,t)=>(Oo(i,e,"read from private field"),t?t.call(i):e.get(i)),X=(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)=>(Oo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t);var j=(i,e,t)=>(Oo(i,e,"access private method"),t);var df={};hh(df,{MediaError:()=>E.MediaError,default:()=>lf,getVideoAttribute:()=>Ut});module.exports=vh(df);var fi=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class i extends fi{}globalThis.DocumentFragment=i}var va=class extends fi{},No=class extends fi{},fh={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(va)}},fa,Po=class{constructor(e,t={}){X(this,fa,void 0);Se(this,fa,t==null?void 0:t.detail)}get detail(){return R(this,fa)}initCustomEvent(){}};fa=new WeakMap;function Eh(i,e){return new va}var Sd={document:{createElement:Eh},DocumentFragment,customElements:fh,CustomEvent:Po,EventTarget:fi,HTMLElement:va,HTMLVideoElement:No},Id=typeof window=="undefined"||typeof globalThis.customElements=="undefined",Q=Id?Sd:globalThis,Ae=Id?Sd.document:globalThis.document;var p={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"},k={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},Uo={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_WIDTH:"mediaWidth",MEDIA_HEIGHT:"mediaHeight",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"},Cd=Object.entries(Uo),o=Cd.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{}),bh={USER_INACTIVE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},ot=Cd.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{...bh}),pf=Object.entries(ot).reduce((i,[e,t])=>{let a=o[e];return a&&(i[t]=a),i},{userinactivechange:"userinactive"}),Md=Object.entries(o).reduce((i,[e,t])=>{let a=ot[e];return a&&(i[t]=a),i},{userinactive:"userinactivechange"}),pe={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},_t={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Bo={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},Te={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},Me={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var Ld={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};var I={ENTER_AIRPLAY:"Start airplay",EXIT_AIRPLAY:"Stop airplay",AUDIO_TRACK_MENU:"Audio",CAPTIONS:"Captions",ENABLE_CAPTIONS:"Enable captions",DISABLE_CAPTIONS:"Disable captions",START_CAST:"Start casting",STOP_CAST:"Stop casting",ENTER_FULLSCREEN:"Enter fullscreen mode",EXIT_FULLSCREEN:"Exit fullscreen mode",MUTE:"Mute",UNMUTE:"Unmute",ENTER_PIP:"Enter picture in picture mode",EXIT_PIP:"Enter picture in picture mode",PLAY:"Play",PAUSE:"Pause",PLAYBACK_RATE:"Playback rate",RENDITIONS:"Quality",SEEK_BACKWARD:"Seek backward",SEEK_FORWARD:"Seek forward",SETTINGS:"Settings"},V={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"},_h={...V,...Y};function Rd(i){return i==null?void 0:i.map(Ah).join(" ")}function wd(i){return i==null?void 0:i.split(/\s+/).map(Th)}function Ah(i){if(i){let{id:e,width:t,height:a}=i;return[e,t,a].filter(r=>r!=null).join(":")}}function Th(i){if(i){let[e,t,a]=i.split(":");return{id:e,width:+t,height:+a}}}function xd(i){return i==null?void 0:i.map(yh).join(" ")}function Dd(i){return i==null?void 0:i.split(/\s+/).map(kh)}function yh(i){if(i){let{id:e,kind:t,language:a,label:r}=i;return[e,t,a,r].filter(n=>n!=null).join(":")}}function kh(i){if(i){let[e,t,a,r]=i.split(":");return{id:e,kind:t,language:a,label:r}}}function Od(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Ei(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}function yr(i){return typeof i!="string"?!1:!isNaN(i)&&!isNaN(parseFloat(i))}var kr=i=>new Promise(e=>setTimeout(e,i));var Nd=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],Sh=(i,e)=>{let t=i===1?Nd[e].singular:Nd[e].plural;return`${i} ${t}`},Ht=i=>{if(!Ei(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((l,u)=>l&&Sh(l,u)).filter(l=>l).join(", ")}${t?" remaining":""}`};function Pe(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),s=Math.floor(e/60%60),l=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(n=r=a="0"),n=n>0||l>0?n+":":"",r=((n||s>=10)&&r<10?"0"+r:r)+":",a=a<10?"0"+a:a,(t?"-":"")+n+r+a}var bf=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 Sr=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},Ir=class extends Sr{},Cr=class extends Ir{constructor(){super(...arguments),this.role=null}},Ho=class{observe(){}unobserve(){}disconnect(){}},Pd={createElement:function(){return new Ea.HTMLElement},createElementNS:function(){return new Ea.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(i){return!1}},Ea={ResizeObserver:Ho,document:Pd,Node:Ir,Element:Cr,HTMLElement:class extends Cr{constructor(){super(...arguments),this.innerHTML=""}get content(){return new Ea.DocumentFragment}},DocumentFragment:class extends Sr{},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}}},Ud=typeof window=="undefined"||typeof window.customElements=="undefined",Bd=Object.keys(Ea).every(i=>i in globalThis),d=Ud&&!Bd?Ea:globalThis,m=Ud&&!Bd?Pd:globalThis.document;var Hd=new WeakMap,Wo=i=>{let e=Hd.get(i);return e||Hd.set(i,e=new Set),e},Wd=new d.ResizeObserver(i=>{for(let e of i)for(let t of Wo(e.target))t(e)});function st(i,e){Wo(i).add(e),Wd.observe(i)}function Wt(i,e){let t=Wo(i);t.delete(e),t.size||Wd.unobserve(i)}function Z(i){var e;return(e=Mr(i))!=null?e:Ue(i,"media-controller")}function Mr(i){var e;let{MEDIA_CONTROLLER:t}=k,a=i.getAttribute(t);if(a)return(e=$t(i))==null?void 0:e.getElementById(a)}var Lr=(i,e,t=".value")=>{let a=i.querySelector(t);a&&(a.textContent=e)},Ch=(i,e)=>{let t=`slot[name="${e}"]`,a=i.shadowRoot.querySelector(t);return a?a.children:[]},Rr=(i,e)=>Ch(i,e)[0],ce=(i,e)=>!i||!e?!1:i!=null&&i.contains(e)?!0:ce(i,e.getRootNode().host),Ue=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||Ue(i.getRootNode().host,e)};function ba(i=document){var e;let t=i==null?void 0:i.activeElement;return t?(e=ba(t.shadowRoot))!=null?e:t:null}function $t(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 $d(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 Fd(i,e,t,a){let r=$o(t,a),n=$o(t,{x:i,y:e}),s=$o(a,{x:i,y:e});return n>r||s>r?n>s?1:0:n/r}function $o(i,e){return Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2))}function W(i,e){let t=Mh(i,a=>a===e);return t||Fo(i,e)}function Mh(i,e){var t,a;let r;for(r of(t=i.querySelectorAll("style:not([media])"))!=null?t:[]){let n;try{n=(a=r.sheet)==null?void 0:a.cssRules}catch{continue}for(let s of n!=null?n:[])if(e(s.selectorText))return s}}function Fo(i,e){var t,a;let r=(t=i.querySelectorAll("style:not([media])"))!=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 w(i,e,t=Number.NaN){let a=i.getAttribute(e);return a!=null?+a:t}function P(i,e,t){let a=+t;if(t==null||Number.isNaN(a)){i.hasAttribute(e)&&i.removeAttribute(e);return}w(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 x(i,e,t=null){var a;return(a=i.getAttribute(e))!=null?a:t}function M(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}let a=`${t}`;x(i,e,void 0)!==a&&i.setAttribute(e,a)}var Kd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},At=(i,e,t)=>(Kd(i,e,"read from private field"),t?t.call(i):e.get(i)),Lh=(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)},wr=(i,e,t,a)=>(Kd(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ve,Vd=m.createElement("template");Vd.innerHTML=`
1
+ "use strict";var mh=Object.create;var gr=Object.defineProperty;var hh=Object.getOwnPropertyDescriptor;var ph=Object.getOwnPropertyNames;var fh=Object.getPrototypeOf,vh=Object.prototype.hasOwnProperty;var Eh=(t,e)=>{for(var i in e)gr(t,i,{get:e[i],enumerable:!0})},xd=(t,e,i,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ph(e))!vh.call(t,r)&&r!==i&&gr(t,r,{get:()=>e[r],enumerable:!(a=hh(e,r))||a.enumerable});return t};var bh=(t,e,i)=>(i=t!=null?mh(fh(t)):{},xd(e||!t||!t.__esModule?gr(i,"default",{value:t,enumerable:!0}):i,t)),gh=t=>xd(gr({},"__esModule",{value:!0}),t);var No=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)};var P=(t,e,i)=>(No(t,e,"read from private field"),i?i.call(t):e.get(t)),X=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Ae=(t,e,i,a)=>(No(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i);var J=(t,e,i)=>(No(t,e,"access private method"),i);var _v={};Eh(_v,{MediaError:()=>E.MediaError,default:()=>gv,generatePlayerInitTime:()=>y.generatePlayerInitTime,getVideoAttribute:()=>Ot,playerSoftwareName:()=>dd,playerSoftwareVersion:()=>ld});module.exports=gh(_v);var fi=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class t extends fi{}globalThis.DocumentFragment=t}var ua=class extends fi{},Po=class extends fi{},_h={get(t){},define(t,e,i){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(ua)}},ca,Uo=class{constructor(e,i={}){X(this,ca,void 0);Ae(this,ca,i==null?void 0:i.detail)}get detail(){return P(this,ca)}initCustomEvent(){}};ca=new WeakMap;function Ah(t,e){return new ua}var Dd={document:{createElement:Ah},DocumentFragment,customElements:_h,CustomEvent:Uo,EventTarget:fi,HTMLElement:ua,HTMLVideoElement:Po},Od=typeof window=="undefined"||typeof globalThis.customElements=="undefined",pe=Od?Dd:globalThis,vi=Od?Dd.document:globalThis.document;var p={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"},S={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},Bo={MEDIA_AIRPLAY_UNAVAILABLE:"mediaAirplayUnavailable",MEDIA_AUDIO_TRACK_ENABLED:"mediaAudioTrackEnabled",MEDIA_AUDIO_TRACK_LIST:"mediaAudioTrackList",MEDIA_AUDIO_TRACK_UNAVAILABLE:"mediaAudioTrackUnavailable",MEDIA_BUFFERED:"mediaBuffered",MEDIA_CAST_UNAVAILABLE:"mediaCastUnavailable",MEDIA_CHAPTERS_CUES:"mediaChaptersCues",MEDIA_CURRENT_TIME:"mediaCurrentTime",MEDIA_DURATION:"mediaDuration",MEDIA_ENDED:"mediaEnded",MEDIA_ERROR:"mediaError",MEDIA_ERROR_CODE:"mediaErrorCode",MEDIA_ERROR_MESSAGE:"mediaErrorMessage",MEDIA_FULLSCREEN_UNAVAILABLE:"mediaFullscreenUnavailable",MEDIA_HAS_PLAYED:"mediaHasPlayed",MEDIA_HEIGHT:"mediaHeight",MEDIA_IS_AIRPLAYING:"mediaIsAirplaying",MEDIA_IS_CASTING:"mediaIsCasting",MEDIA_IS_FULLSCREEN:"mediaIsFullscreen",MEDIA_IS_PIP:"mediaIsPip",MEDIA_LOADING:"mediaLoading",MEDIA_MUTED:"mediaMuted",MEDIA_PAUSED:"mediaPaused",MEDIA_PIP_UNAVAILABLE:"mediaPipUnavailable",MEDIA_PLAYBACK_RATE:"mediaPlaybackRate",MEDIA_PREVIEW_CHAPTER:"mediaPreviewChapter",MEDIA_PREVIEW_COORDS:"mediaPreviewCoords",MEDIA_PREVIEW_IMAGE:"mediaPreviewImage",MEDIA_PREVIEW_TIME:"mediaPreviewTime",MEDIA_RENDITION_LIST:"mediaRenditionList",MEDIA_RENDITION_SELECTED:"mediaRenditionSelected",MEDIA_RENDITION_UNAVAILABLE:"mediaRenditionUnavailable",MEDIA_SEEKABLE:"mediaSeekable",MEDIA_STREAM_TYPE:"mediaStreamType",MEDIA_SUBTITLES_LIST:"mediaSubtitlesList",MEDIA_SUBTITLES_SHOWING:"mediaSubtitlesShowing",MEDIA_TARGET_LIVE_WINDOW:"mediaTargetLiveWindow",MEDIA_TIME_IS_LIVE:"mediaTimeIsLive",MEDIA_VOLUME:"mediaVolume",MEDIA_VOLUME_LEVEL:"mediaVolumeLevel",MEDIA_VOLUME_UNAVAILABLE:"mediaVolumeUnavailable",MEDIA_WIDTH:"mediaWidth"},Nd=Object.entries(Bo),o=Nd.reduce((t,[e,i])=>(t[e]=i.toLowerCase(),t),{}),Th={USER_INACTIVE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},rt=Nd.reduce((t,[e,i])=>(t[e]=i.toLowerCase(),t),{...Th}),Sv=Object.entries(rt).reduce((t,[e,i])=>{let a=o[e];return a&&(t[i]=a),t},{userinactivechange:"userinactive"}),Pd=Object.entries(o).reduce((t,[e,i])=>{let a=rt[e];return a&&(t[i]=a),t},{userinactive:"userinactivechange"}),fe={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},bt={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Ho={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},Te={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},Ce={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var Ud={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};var kh={2:"Network Error",3:"Decode Error",4:"Source Not Supported",5:"Encryption Error"},Sh={2:"A network error caused the media download to fail.",3:"A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.",4:"An unsupported error occurred. The server or network failed, or your browser does not support this format.",5:"The media is encrypted and there are no keys to decrypt it."},$o=t=>{var e,i;return t.code===1?null:{title:(e=kh[t.code])!=null?e:`Error ${t.code}`,message:(i=Sh[t.code])!=null?i:t.message}},C={ENTER_AIRPLAY:"Start airplay",EXIT_AIRPLAY:"Stop airplay",AUDIO_TRACK_MENU:"Audio",CAPTIONS:"Captions",ENABLE_CAPTIONS:"Enable captions",DISABLE_CAPTIONS:"Disable captions",START_CAST:"Start casting",STOP_CAST:"Stop casting",ENTER_FULLSCREEN:"Enter fullscreen mode",EXIT_FULLSCREEN:"Exit fullscreen mode",MUTE:"Mute",UNMUTE:"Unmute",ENTER_PIP:"Enter picture in picture mode",EXIT_PIP:"Enter picture in picture mode",PLAY:"Play",PAUSE:"Pause",PLAYBACK_RATE:"Playback rate",RENDITIONS:"Quality",SEEK_BACKWARD:"Seek backward",SEEK_FORWARD:"Seek forward",SETTINGS:"Settings"},V={AUDIO_PLAYER:()=>"audio player",VIDEO_PLAYER:()=>"video player",VOLUME:()=>"volume",SEEK:()=>"seek",CLOSED_CAPTIONS:()=>"closed captions",PLAYBACK_RATE:({playbackRate:t=1}={})=>`current playback rate ${t}`,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:t=30}={})=>`seek forward ${t} seconds`,SEEK_BACK_N_SECS:({seekOffset:t=30}={})=>`seek back ${t} seconds`,SEEK_LIVE:()=>"seek to live",PLAYING_LIVE:()=>"playing live"},Ih={...V,...Y};function Bd(t){return t==null?void 0:t.map(Ch).join(" ")}function Hd(t){return t==null?void 0:t.split(/\s+/).map(Mh)}function Ch(t){if(t){let{id:e,width:i,height:a}=t;return[e,i,a].filter(r=>r!=null).join(":")}}function Mh(t){if(t){let[e,i,a]=t.split(":");return{id:e,width:+i,height:+a}}}function $d(t){return t==null?void 0:t.map(Rh).join(" ")}function Wd(t){return t==null?void 0:t.split(/\s+/).map(wh)}function Rh(t){if(t){let{id:e,kind:i,language:a,label:r}=t;return[e,i,a,r].filter(n=>n!=null).join(":")}}function wh(t){if(t){let[e,i,a,r]=t.split(":");return{id:e,kind:i,language:a,label:r}}}function Fd(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function Ei(t){return typeof t=="number"&&!Number.isNaN(t)&&Number.isFinite(t)}function _r(t){return typeof t!="string"?!1:!isNaN(t)&&!isNaN(parseFloat(t))}var Ar=t=>new Promise(e=>setTimeout(e,t));var Kd=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],Lh=(t,e)=>{let i=t===1?Kd[e].singular:Kd[e].plural;return`${t} ${i}`},Pt=t=>{if(!Ei(t))return"";let e=Math.abs(t),i=e!==t,a=new Date(0,0,0,0,0,e,0);return`${[a.getHours(),a.getMinutes(),a.getSeconds()].map((l,u)=>l&&Lh(l,u)).filter(l=>l).join(", ")}${i?" remaining":""}`};function Ne(t,e){let i=!1;t<0&&(i=!0,t=0-t),t=t<0?0:t;let a=Math.floor(t%60),r=Math.floor(t/60%60),n=Math.floor(t/3600),s=Math.floor(e/60%60),l=Math.floor(e/3600);return(isNaN(t)||t===1/0)&&(n=r=a="0"),n=n>0||l>0?n+":":"",r=((n||s>=10)&&r<10?"0"+r:r)+":",a=a<10?"0"+a:a,(i?"-":"")+n+r+a}var Rv=Object.freeze({length:0,start(t){let e=t>>>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(t){let e=t>>>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 Tr=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},yr=class extends Tr{},kr=class extends yr{constructor(){super(...arguments),this.role=null}},Wo=class{observe(){}unobserve(){}disconnect(){}},Vd={createElement:function(){return new ma.HTMLElement},createElementNS:function(){return new ma.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(t){return!1}},ma={ResizeObserver:Wo,document:Vd,Node:yr,Element:kr,HTMLElement:class extends kr{constructor(){super(...arguments),this.innerHTML=""}get content(){return new ma.DocumentFragment}},DocumentFragment:class extends Tr{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},localStorage:{getItem(t){return null},setItem(t,e){},removeItem(t){}},CustomEvent:function(){},getComputedStyle:function(){},navigator:{languages:[],get userAgent(){return""}},matchMedia(t){return{matches:!1,media:t}}},Yd=typeof window=="undefined"||typeof window.customElements=="undefined",Gd=Object.keys(ma).every(t=>t in globalThis),d=Yd&&!Gd?ma:globalThis,h=Yd&&!Gd?Vd:globalThis.document;var qd=new WeakMap,Fo=t=>{let e=qd.get(t);return e||qd.set(t,e=new Set),e},Zd=new d.ResizeObserver(t=>{for(let e of t)for(let i of Fo(e.target))i(e)});function nt(t,e){Fo(t).add(e),Zd.observe(t)}function Ut(t,e){let i=Fo(t);i.delete(e),i.size||Zd.unobserve(t)}function Qd(t){let e={};for(let i of t)e[i.name]=i.value;return e}function Z(t){var e;return(e=Sr(t))!=null?e:Pe(t,"media-controller")}function Sr(t){var e;let{MEDIA_CONTROLLER:i}=S,a=t.getAttribute(i);if(a)return(e=Bt(t))==null?void 0:e.getElementById(a)}var Ir=(t,e,i=".value")=>{let a=t.querySelector(i);a&&(a.textContent=e)},Dh=(t,e)=>{let i=`slot[name="${e}"]`,a=t.shadowRoot.querySelector(i);return a?a.children:[]},Cr=(t,e)=>Dh(t,e)[0],ue=(t,e)=>!t||!e?!1:t!=null&&t.contains(e)?!0:ue(t,e.getRootNode().host),Pe=(t,e)=>{if(!t)return null;let i=t.closest(e);return i||Pe(t.getRootNode().host,e)};function ha(t=document){var e;let i=t==null?void 0:t.activeElement;return i?(e=ha(i.shadowRoot))!=null?e:i:null}function Bt(t){var e;let i=(e=t==null?void 0:t.getRootNode)==null?void 0:e.call(t);return i instanceof ShadowRoot||i instanceof Document?i:null}function Mr(t,{depth:e=3,checkOpacity:i=!0,checkVisibilityCSS:a=!0}={}){if(t.checkVisibility)return t.checkVisibility({checkOpacity:i,checkVisibilityCSS:a});let r=t;for(;r&&e>0;){let n=getComputedStyle(r);if(i&&n.opacity==="0"||a&&n.visibility==="hidden"||n.display==="none")return!1;r=r.parentElement,e--}return!0}function zd(t,e,i,a){let r=Ko(i,a),n=Ko(i,{x:t,y:e}),s=Ko(a,{x:t,y:e});return n>r||s>r?n>s?1:0:n/r}function Ko(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function $(t,e){let i=Oh(t,a=>a===e);return i||Vo(t,e)}function Oh(t,e){var i,a;let r;for(r of(i=t.querySelectorAll("style:not([media])"))!=null?i:[]){let n;try{n=(a=r.sheet)==null?void 0:a.cssRules}catch{continue}for(let s of n!=null?n:[])if(e(s.selectorText))return s}}function Vo(t,e){var i,a;let r=(i=t.querySelectorAll("style:not([media])"))!=null?i:[],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",t),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}})}function M(t,e,i=Number.NaN){let a=t.getAttribute(e);return a!=null?+a:i}function D(t,e,i){let a=+i;if(i==null||Number.isNaN(a)){t.hasAttribute(e)&&t.removeAttribute(e);return}M(t,e,void 0)!==a&&t.setAttribute(e,`${a}`)}function H(t,e){return t.hasAttribute(e)}function U(t,e,i){if(i==null){t.hasAttribute(e)&&t.removeAttribute(e);return}H(t,e)!=i&&t.toggleAttribute(e,i)}function R(t,e,i=null){var a;return(a=t.getAttribute(e))!=null?a:i}function I(t,e,i){if(i==null){t.hasAttribute(e)&&t.removeAttribute(e);return}let a=`${i}`;R(t,e,void 0)!==a&&t.setAttribute(e,a)}var Xd=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},gt=(t,e,i)=>(Xd(t,e,"read from private field"),i?i.call(t):e.get(t)),Nh=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Rr=(t,e,i,a)=>(Xd(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ve,Jd=h.createElement("template");Jd.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 Ko=class extends d.HTMLElement{constructor(e={}){if(super(),Lh(this,ve,void 0),!this.shadowRoot){let t=this.attachShadow({mode:"open"}),a=Vd.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[k.MEDIA_CONTROLLER,o.MEDIA_PAUSED]}attributeChangedCallback(e,t,a){var r,n,s,l,u;e===k.MEDIA_CONTROLLER&&(t&&((n=(r=At(this,ve))==null?void 0:r.unassociateElement)==null||n.call(r,this),wr(this,ve,null)),a&&this.isConnected&&(wr(this,ve,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=At(this,ve))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,t,a,r;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),wr(this,ve,Rh(this)),this.getAttribute(k.MEDIA_CONTROLLER)&&((t=(e=At(this,ve))==null?void 0:e.associateElement)==null||t.call(e,this)),(a=At(this,ve))==null||a.addEventListener("pointerdown",this),(r=At(this,ve))==null||r.addEventListener("click",this)}disconnectedCallback(){var e,t,a,r;this.getAttribute(k.MEDIA_CONTROLLER)&&((t=(e=At(this,ve))==null?void 0:e.unassociateElement)==null||t.call(e,this)),(a=At(this,ve))==null||a.removeEventListener("pointerdown",this),(r=At(this,ve))==null||r.removeEventListener("click",this),wr(this,ve,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:s}=e,{left:l,top:u,width:c,height:b}=this.getBoundingClientRect(),g=n-l,v=s-u;if(g<0||v<0||g>c||v>b||c===0&&b===0)return;let{pointerType:f=this._pointerType}=e;if(this._pointerType=void 0,f===Bo.TOUCH){this.handleTap(e);return}else if(f===Bo.MOUSE){this.handleMouseClick(e);return}}}}get mediaPaused(){return H(this,o.MEDIA_PAUSED)}set mediaPaused(e){B(this,o.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(e){let t=this.mediaPaused?p.MEDIA_PLAY_REQUEST:p.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(t,{composed:!0,bubbles:!0}))}};ve=new WeakMap;function Rh(i){var e;let t=i.getAttribute(k.MEDIA_CONTROLLER);return t?(e=i.getRootNode())==null?void 0:e.getElementById(t):Ue(i,"media-controller")}d.customElements.get("media-gesture-receiver")||d.customElements.define("media-gesture-receiver",Ko);var Go=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Tt=(i,e,t)=>(Go(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)},ga=(i,e,t,a)=>(Go(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Le=(i,e,t)=>(Go(i,e,"access private method"),t),xr,bi,_a,gi,Vo,Yd,Yo,Gd,Aa,Dr,Or,qo,_i,Ta,D={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive"},qd=m.createElement("template");qd.innerHTML=`
8
+ `;var Yo=class extends d.HTMLElement{constructor(e={}){if(super(),Nh(this,ve,void 0),!this.shadowRoot){let i=this.attachShadow({mode:"open"}),a=Jd.content.cloneNode(!0);this.nativeEl=a;let r=e.slotTemplate;r||(r=h.createElement("template"),r.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),i.appendChild(a)}}static get observedAttributes(){return[S.MEDIA_CONTROLLER,o.MEDIA_PAUSED]}attributeChangedCallback(e,i,a){var r,n,s,l,u;e===S.MEDIA_CONTROLLER&&(i&&((n=(r=gt(this,ve))==null?void 0:r.unassociateElement)==null||n.call(r,this),Rr(this,ve,null)),a&&this.isConnected&&(Rr(this,ve,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=gt(this,ve))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,i,a,r;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),Rr(this,ve,Ph(this)),this.getAttribute(S.MEDIA_CONTROLLER)&&((i=(e=gt(this,ve))==null?void 0:e.associateElement)==null||i.call(e,this)),(a=gt(this,ve))==null||a.addEventListener("pointerdown",this),(r=gt(this,ve))==null||r.addEventListener("click",this)}disconnectedCallback(){var e,i,a,r;this.getAttribute(S.MEDIA_CONTROLLER)&&((i=(e=gt(this,ve))==null?void 0:e.unassociateElement)==null||i.call(e,this)),(a=gt(this,ve))==null||a.removeEventListener("pointerdown",this),(r=gt(this,ve))==null||r.removeEventListener("click",this),Rr(this,ve,null)}handleEvent(e){var i;let a=(i=e.composedPath())==null?void 0:i[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:s}=e,{left:l,top:u,width:c,height:b}=this.getBoundingClientRect(),g=n-l,f=s-u;if(g<0||f<0||g>c||f>b||c===0&&b===0)return;let{pointerType:v=this._pointerType}=e;if(this._pointerType=void 0,v===Ho.TOUCH){this.handleTap(e);return}else if(v===Ho.MOUSE){this.handleMouseClick(e);return}}}}get mediaPaused(){return H(this,o.MEDIA_PAUSED)}set mediaPaused(e){U(this,o.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(e){let i=this.mediaPaused?p.MEDIA_PLAY_REQUEST:p.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(i,{composed:!0,bubbles:!0}))}};ve=new WeakMap;function Ph(t){var e;let i=t.getAttribute(S.MEDIA_CONTROLLER);return i?(e=t.getRootNode())==null?void 0:e.getElementById(i):Pe(t,"media-controller")}d.customElements.get("media-gesture-receiver")||d.customElements.define("media-gesture-receiver",Yo);var Zo=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},_t=(t,e,i)=>(Zo(t,e,"read from private field"),i?i.call(t):e.get(t)),ot=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},pa=(t,e,i,a)=>(Zo(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Me=(t,e,i)=>(Zo(t,e,"access private method"),i),wr,bi,fa,gi,Go,jd,qo,eu,va,Lr,xr,Qo,_i,Ea,x={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive"},tu=h.createElement("template");tu.innerHTML=`
9
9
  <style>
10
10
 
11
11
  :host([${o.MEDIA_IS_FULLSCREEN}]) ::slotted([slot=media]) {
@@ -20,7 +20,7 @@
20
20
  background-color: var(--media-background-color, #000);
21
21
  }
22
22
 
23
- :host(:not([${D.AUDIO}])) [part~=layer]:not([part~=media-layer]) {
23
+ :host(:not([${x.AUDIO}])) [part~=layer]:not([part~=media-layer]) {
24
24
  position: absolute;
25
25
  top: 0;
26
26
  left: 0;
@@ -38,34 +38,34 @@
38
38
  }
39
39
 
40
40
 
41
- :host([${D.AUDIO}]) slot[name=media] {
41
+ :host([${x.AUDIO}]) slot[name=media] {
42
42
  display: var(--media-slot-display, none);
43
43
  }
44
44
 
45
45
 
46
- :host([${D.AUDIO}]) [part~=layer][part~=gesture-layer] {
46
+ :host([${x.AUDIO}]) [part~=layer][part~=gesture-layer] {
47
47
  height: 0;
48
48
  display: block;
49
49
  }
50
50
 
51
51
 
52
- :host(:not([${D.AUDIO}])[${D.GESTURES_DISABLED}]) ::slotted([slot=gestures-chrome]),
53
- :host(:not([${D.AUDIO}])[${D.GESTURES_DISABLED}]) media-gesture-receiver[slot=gestures-chrome] {
52
+ :host(:not([${x.AUDIO}])[${x.GESTURES_DISABLED}]) ::slotted([slot=gestures-chrome]),
53
+ :host(:not([${x.AUDIO}])[${x.GESTURES_DISABLED}]) media-gesture-receiver[slot=gestures-chrome] {
54
54
  display: none;
55
55
  }
56
56
 
57
57
 
58
- ::slotted(:not([slot=media]):not([slot=poster]):not(media-loading-indicator):not([hidden])) {
58
+ ::slotted(:not([slot=media]):not([slot=poster]):not(media-loading-indicator):not([role=dialog]):not([hidden])) {
59
59
  pointer-events: auto;
60
60
  }
61
61
 
62
- :host(:not([${D.AUDIO}])) *[part~=layer][part~=centered-layer] {
62
+ :host(:not([${x.AUDIO}])) *[part~=layer][part~=centered-layer] {
63
63
  align-items: center;
64
64
  justify-content: center;
65
65
  }
66
66
 
67
- :host(:not([${D.AUDIO}])) ::slotted(media-gesture-receiver[slot=gestures-chrome]),
68
- :host(:not([${D.AUDIO}])) media-gesture-receiver[slot=gestures-chrome] {
67
+ :host(:not([${x.AUDIO}])) ::slotted(media-gesture-receiver[slot=gestures-chrome]),
68
+ :host(:not([${x.AUDIO}])) media-gesture-receiver[slot=gestures-chrome] {
69
69
  align-self: stretch;
70
70
  flex-grow: 1;
71
71
  }
@@ -85,7 +85,7 @@
85
85
  }
86
86
 
87
87
 
88
- :host(:not([${D.AUDIO}])) .spacer {
88
+ :host(:not([${x.AUDIO}])) .spacer {
89
89
  flex-grow: 1;
90
90
  }
91
91
 
@@ -97,18 +97,18 @@
97
97
  }
98
98
 
99
99
 
100
- ::slotted(:not([slot=media]):not([slot=poster]):not([${D.NO_AUTOHIDE}]):not([hidden])) {
100
+ ::slotted(:not([slot=media]):not([slot=poster]):not([${x.NO_AUTOHIDE}]):not([hidden]):not([role=dialog])) {
101
101
  opacity: 1;
102
102
  transition: opacity 0.25s;
103
103
  }
104
104
 
105
105
 
106
- :host([${D.USER_INACTIVE}]:not([${o.MEDIA_PAUSED}]):not([${o.MEDIA_IS_AIRPLAYING}]):not([${o.MEDIA_IS_CASTING}]):not([${D.AUDIO}])) ::slotted(:not([slot=media]):not([slot=poster]):not([${D.NO_AUTOHIDE}])) {
106
+ :host([${x.USER_INACTIVE}]:not([${o.MEDIA_PAUSED}]):not([${o.MEDIA_IS_AIRPLAYING}]):not([${o.MEDIA_IS_CASTING}]):not([${x.AUDIO}])) ::slotted(:not([slot=media]):not([slot=poster]):not([${x.NO_AUTOHIDE}]):not([role=dialog])) {
107
107
  opacity: 0;
108
108
  transition: opacity 1s;
109
109
  }
110
110
 
111
- :host([${D.USER_INACTIVE}]:not([${o.MEDIA_PAUSED}]):not([${o.MEDIA_IS_CASTING}]):not([${D.AUDIO}])) ::slotted([slot=media]) {
111
+ :host([${x.USER_INACTIVE}]:not([${o.MEDIA_PAUSED}]):not([${o.MEDIA_IS_CASTING}]):not([${x.AUDIO}])) ::slotted([slot=media]) {
112
112
  cursor: none;
113
113
  }
114
114
 
@@ -117,16 +117,18 @@
117
117
  }
118
118
 
119
119
 
120
- :host(:not([${D.AUDIO}])[${o.MEDIA_HAS_PLAYED}]) slot[name=poster] {
120
+ :host(:not([${x.AUDIO}])[${o.MEDIA_HAS_PLAYED}]) slot[name=poster] {
121
121
  display: none;
122
122
  }
123
123
 
124
- ::slotted([role="menu"]) {
125
- align-self: end;
124
+ ::slotted([role=dialog]) {
125
+ width: 100%;
126
+ height: 100%;
127
+ align-self: center;
126
128
  }
127
129
 
128
- ::slotted([role="dialog"]) {
129
- align-self: center;
130
+ ::slotted([role=menu]) {
131
+ align-self: end;
130
132
  }
131
133
  </style>
132
134
 
@@ -142,7 +144,8 @@
142
144
 
143
145
  <slot part="bottom chrome"></slot>
144
146
  </span>
145
- `;var wh=Object.values(o),xh="sm:384 md:576 lg:768 xl:960";function Dh(i){Oh(i.target,i.contentRect.width)}function Oh(i,e){var t;if(!i.isConnected)return;let a=(t=i.getAttribute(D.BREAKPOINTS))!=null?t:xh,r=Nh(a),n=Ph(r,e),s=!1;if(Object.keys(r).forEach(l=>{if(n.includes(l)){i.hasAttribute(`breakpoint${l}`)||(i.setAttribute(`breakpoint${l}`,""),s=!0);return}i.hasAttribute(`breakpoint${l}`)&&(i.removeAttribute(`breakpoint${l}`),s=!0)}),s){let l=new CustomEvent(ot.BREAKPOINTS_CHANGE,{detail:n});i.dispatchEvent(l)}}function Nh(i){let e=i.split(/\s+/);return Object.fromEntries(e.map(t=>t.split(":")))}function Ph(i,e){return Object.keys(i).filter(t=>e>=parseInt(i[t]))}var ya=class extends d.HTMLElement{constructor(){super(),lt(this,Vo),lt(this,Yo),lt(this,Aa),lt(this,Or),lt(this,_i),lt(this,xr,0),lt(this,bi,null),lt(this,_a,null),lt(this,gi,void 0),this.breakpointsComputed=!1,this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(qd.content.cloneNode(!0)));let e=s=>{let l=this.media;for(let u of s)u.type==="childList"&&(u.removedNodes.forEach(c=>{if(c.slot=="media"&&u.target==this){let b=u.previousSibling&&u.previousSibling.previousElementSibling;if(!b||!l)this.mediaUnsetCallback(c);else{let g=b.slot!=="media";for(;(b=b.previousSibling)!==null;)b.slot=="media"&&(g=!1);g&&this.mediaUnsetCallback(c)}}}),l&&u.addedNodes.forEach(c=>{c===l&&this.handleMediaUpdated(l)}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0});let a=!1;st(this,s=>{a||(setTimeout(()=>{Dh(s),a=!1,this.breakpointsComputed||(this.breakpointsComputed=!0,this.dispatchEvent(new CustomEvent(ot.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){Tt(this,bi)&&this.mediaUnsetCallback(Tt(this,bi));return}this.handleMediaUpdated(this.media)})}static get observedAttributes(){return[D.AUTOHIDE,D.GESTURES_DISABLED].concat(wh).filter(e=>![o.MEDIA_RENDITION_LIST,o.MEDIA_AUDIO_TRACK_LIST,o.MEDIA_CHAPTERS_CUES,o.MEDIA_WIDTH,o.MEDIA_HEIGHT].includes(e))}attributeChangedCallback(e,t,a){e.toLowerCase()==D.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&&(ga(this,bi,e),e.localName.includes("-")&&await d.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;let a=this.getAttribute(D.AUDIO)!=null?V.AUDIO_PLAYER():V.VIDEO_PLAYER();this.setAttribute("role","region"),this.setAttribute("aria-label",a),this.handleMediaUpdated(this.media),this.setAttribute(D.USER_INACTIVE,""),this.addEventListener("pointerdown",this),this.addEventListener("pointermove",this),this.addEventListener("pointerup",this),this.addEventListener("mouseleave",this),this.addEventListener("keyup",this),(e=d.window)==null||e.addEventListener("mouseup",this)}disconnectedCallback(){var e;this.media&&this.mediaUnsetCallback(this.media),(e=d.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){ga(this,bi,null)}handleEvent(e){switch(e.type){case"pointerdown":ga(this,xr,e.timeStamp);break;case"pointermove":Le(this,Vo,Yd).call(this,e);break;case"pointerup":Le(this,Yo,Gd).call(this,e);break;case"mouseleave":Le(this,Aa,Dr).call(this);break;case"mouseup":this.removeAttribute(D.KEYBOARD_CONTROL);break;case"keyup":Le(this,_i,Ta).call(this),this.setAttribute(D.KEYBOARD_CONTROL,"");break}}set autohide(e){let t=Number(e);ga(this,gi,isNaN(t)?0:t)}get autohide(){return(Tt(this,gi)===void 0?2:Tt(this,gi)).toString()}};xr=new WeakMap;bi=new WeakMap;_a=new WeakMap;gi=new WeakMap;Vo=new WeakSet;Yd=function(i){i.pointerType!=="mouse"&&i.timeStamp-Tt(this,xr)<250||(Le(this,Or,qo).call(this),clearTimeout(Tt(this,_a)),[this,this.media].includes(i.target)&&Le(this,_i,Ta).call(this))};Yo=new WeakSet;Gd=function(i){if(i.pointerType==="touch"){let e=!this.hasAttribute(D.USER_INACTIVE);[this,this.media].includes(i.target)&&e?Le(this,Aa,Dr).call(this):Le(this,_i,Ta).call(this)}else i.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&Le(this,_i,Ta).call(this)};Aa=new WeakSet;Dr=function(){if(Tt(this,gi)<0||this.hasAttribute(D.USER_INACTIVE))return;this.setAttribute(D.USER_INACTIVE,"");let i=new d.CustomEvent(ot.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(i)};Or=new WeakSet;qo=function(){if(!this.hasAttribute(D.USER_INACTIVE))return;this.removeAttribute(D.USER_INACTIVE);let i=new d.CustomEvent(ot.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(i)};_i=new WeakSet;Ta=function(){Le(this,Or,qo).call(this),clearTimeout(Tt(this,_a));let i=parseInt(this.autohide);i<0||ga(this,_a,setTimeout(()=>{Le(this,Aa,Dr).call(this)},i*1e3))};d.customElements.get("media-container")||d.customElements.define("media-container",ya);var Zd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},re=(i,e,t)=>(Zd(i,e,"read from private field"),t?t.call(i):e.get(i)),ka=(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)},Nr=(i,e,t,a)=>(Zd(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ai,Ti,Pr,Ft,dt,yt,Be=class{constructor(e,t,{defaultValue:a}={defaultValue:void 0}){ka(this,dt),ka(this,Ai,void 0),ka(this,Ti,void 0),ka(this,Pr,void 0),ka(this,Ft,new Set),Nr(this,Ai,e),Nr(this,Ti,t),Nr(this,Pr,new Set(a))}[Symbol.iterator](){return re(this,dt,yt).values()}get length(){return re(this,dt,yt).size}get value(){var e;return(e=[...re(this,dt,yt)].join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(Nr(this,Ft,new Set),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return[...re(this,dt,yt)][e]}values(){return re(this,dt,yt).values()}forEach(e,t){re(this,dt,yt).forEach(e,t)}add(...e){var t,a;e.forEach(r=>re(this,Ft).add(r)),!(this.value===""&&!((t=re(this,Ai))!=null&&t.hasAttribute(`${re(this,Ti)}`)))&&((a=re(this,Ai))==null||a.setAttribute(`${re(this,Ti)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>re(this,Ft).delete(a)),(t=re(this,Ai))==null||t.setAttribute(`${re(this,Ti)}`,`${this.value}`)}contains(e){return re(this,dt,yt).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}};Ai=new WeakMap;Ti=new WeakMap;Pr=new WeakMap;Ft=new WeakMap;dt=new WeakSet;yt=function(){return re(this,Ft).size?re(this,Ft):re(this,Pr)};var Uh=(i="")=>i.split(/\s+/),Qd=(i="")=>{let[e,t,a]=i.split(":"),r=a?decodeURIComponent(a):void 0;return{kind:e==="cc"?pe.CAPTIONS:pe.SUBTITLES,language:t,label:r}},Kt=(i="",e={})=>Uh(i).map(t=>{let a=Qd(t);return{...e,...a}}),Zo=i=>i?Array.isArray(i)?i.map(e=>typeof e=="string"?Qd(e):e):typeof i=="string"?Kt(i):[i]:[],Ur=({kind:i,label:e,language:t}={kind:"subtitles"})=>e?`${i==="captions"?"cc":"sb"}:${t}:${encodeURIComponent(e)}`:t,ut=(i=[])=>Array.prototype.map.call(i,Ur).join(" "),Bh=(i,e)=>t=>t[i]===e,zd=i=>{let e=Object.entries(i).map(([t,a])=>Bh(t,a));return t=>e.every(a=>a(t))},Vt=(i,e=[],t=[])=>{let a=Zo(t).map(zd),r=n=>a.some(s=>s(n));Array.from(e).filter(r).forEach(n=>{n.mode=i})},Yt=(i,e=()=>!0)=>{if(!(i!=null&&i.textTracks))return[];let t=typeof e=="function"?e:zd(e);return Array.from(i.textTracks).filter(t)},Br=i=>{var e;return!!((e=i.mediaSubtitlesShowing)!=null&&e.length)||i.hasAttribute(o.MEDIA_SUBTITLES_SHOWING)};var Jd=i=>{var e;let{media:t,fullscreenElement:a}=i,r=a&&"requestFullscreen"in a?"requestFullscreen":a&&"webkitRequestFullScreen"in a?"webkitRequestFullScreen":void 0;if(r){let n=(e=a[r])==null?void 0:e.call(a);if(n instanceof Promise)return n.catch(()=>{})}else t!=null&&t.webkitEnterFullscreen?t.webkitEnterFullscreen():t!=null&&t.requestFullscreen&&t.requestFullscreen()},Xd="exitFullscreen"in m?"exitFullscreen":"webkitExitFullscreen"in m?"webkitExitFullscreen":"webkitCancelFullScreen"in m?"webkitCancelFullScreen":void 0,jd=i=>{var e;let{documentElement:t}=i;if(Xd){let a=(e=t==null?void 0:t[Xd])==null?void 0:e.call(t);if(a instanceof Promise)return a.catch(()=>{})}},Sa="fullscreenElement"in m?"fullscreenElement":"webkitFullscreenElement"in m?"webkitFullscreenElement":void 0,Hh=i=>{let{documentElement:e,media:t}=i,a=e==null?void 0:e[Sa];return!a&&"webkitDisplayingFullscreen"in t&&"webkitPresentationMode"in t&&t.webkitDisplayingFullscreen&&t.webkitPresentationMode===Ld.FULLSCREEN?t:a},eu=i=>{var e;let{media:t,documentElement:a,fullscreenElement:r=t}=i;if(!t||!a)return!1;let n=Hh(i);if(!n)return!1;if(n===r||n===t)return!0;if(n.localName.includes("-")){let s=n.shadowRoot;if(!(Sa in s))return ce(n,r);for(;s!=null&&s[Sa];){if(s[Sa]===r)return!0;s=(e=s[Sa])==null?void 0:e.shadowRoot}}return!1},Wh="fullscreenEnabled"in m?"fullscreenEnabled":"webkitFullscreenEnabled"in m?"webkitFullscreenEnabled":void 0,tu=i=>{let{documentElement:e,media:t}=i;return!!(e!=null&&e[Wh])||t&&"webkitSupportsFullscreen"in t};var Hr,Qo=()=>{var i,e;return Hr||(Hr=(e=(i=m)==null?void 0:i.createElement)==null?void 0:e.call(i,"video"),Hr)},iu=async(i=Qo())=>{if(!i)return!1;let e=i.volume;return i.volume=e/2+.1,await kr(0),i.volume!==e},$h=/.*Version\/.*Safari\/.*/.test(d.navigator.userAgent),zo=(i=Qo())=>d.matchMedia("(display-mode: standalone)").matches&&$h?!1:typeof(i==null?void 0:i.requestPictureInPicture)=="function",Xo=(i=Qo())=>tu({documentElement:m,media:i}),au=Xo(),ru=zo(),nu=!!d.WebKitPlaybackTargetAvailabilityEvent,ou=!!d.chrome;var yi=i=>Yt(i.media,e=>[pe.SUBTITLES,pe.CAPTIONS].includes(e.kind)).sort((e,t)=>e.kind>=t.kind?1:-1),Jo=i=>Yt(i.media,e=>e.mode===_t.SHOWING&&[pe.SUBTITLES,pe.CAPTIONS].includes(e.kind)),Wr=(i,e)=>{let t=yi(i),a=Jo(i),r=!!a.length;if(t.length){if(e===!1||r&&e!==!0)Vt(_t.DISABLED,t,a);else if(e===!0||!r&&e!==!1){let n=t[0],{options:s}=i;if(!(s!=null&&s.noSubtitlesLangPref)){let b=globalThis.localStorage.getItem("media-chrome-pref-subtitles-lang"),g=b?[b,...globalThis.navigator.languages]:globalThis.navigator.languages,v=t.filter(f=>g.some(L=>f.language.toLowerCase().startsWith(L.split("-")[0]))).sort((f,L)=>{let A=g.findIndex(N=>f.language.toLowerCase().startsWith(N.split("-")[0])),T=g.findIndex(N=>L.language.toLowerCase().startsWith(N.split("-")[0]));return A-T});v[0]&&(n=v[0])}let{language:l,label:u,kind:c}=n;Vt(_t.DISABLED,t,a),Vt(_t.SHOWING,t,[{language:l,label:u,kind:c}])}}},$r=(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)?Fh(i,e):Object.entries(i).every(([t,a])=>t in e&&$r(a,e[t])),Fh=(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)=>$r(r,e[n])):!0};var Kh=Object.values(Me),Fr,Vh=iu().then(i=>(Fr=i,Fr)),su=async(...i)=>{await Promise.all(i.filter(e=>e).map(async e=>{if(!("localName"in e&&e instanceof d.HTMLElement))return;let t=e.localName;if(!t.includes("-"))return;let a=d.customElements.get(t);a&&e instanceof a||(await d.customElements.whenDefined(t),d.customElements.upgrade(e))}))},Ia={mediaWidth:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.videoWidth)!=null?e:0},mediaEvents:["resize"]},mediaHeight:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.videoHeight)!=null?e:0},mediaEvents:["resize"]},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?d.localStorage.removeItem("media-chrome-pref-volume"):d.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=d.localStorage.getItem("media-chrome-pref-volume");if(a==null)return;Ia.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||!Ei(i)||(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=[Me.LIVE,Me.ON_DEMAND].includes(t)?t:void 0;if(!e)return a;let{streamType:r}=e;if(Kh.includes(r))return r===Me.UNKNOWN?a:r;let n=e.duration;return n===1/0?Me.LIVE:Number.isFinite(n)?Me.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=Ia.mediaStreamType.get(i);return(t==null||Number.isNaN(t))&&a===Me.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(!(Ia.mediaStreamType.get(i)===Me.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 yi(i).map(({kind:e,label:t,language:a})=>({kind:e,label:t,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},mediaSubtitlesShowing:{get(i){return Jo(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 s=l=>{var u;!n.defaultSubtitles||l&&![pe.CAPTIONS,pe.SUBTITLES].includes((u=l==null?void 0:l.track)==null?void 0:u.kind)||Wr(e,!0)};return(t=r.textTracks)==null||t.addEventListener("addtrack",s),(a=r.textTracks)==null||a.addEventListener("removetrack",s),s(),()=>{var l,u;(l=r.textTracks)==null||l.removeEventListener("addtrack",s),(u=r.textTracks)==null||u.removeEventListener("removetrack",s)}}]},mediaChaptersCues:{get(i){var e;let{media:t}=i;if(!t)return[];let[a]=Yt(t,{kind:pe.CHAPTERS});return Array.from((e=a==null?void 0:a.cues)!=null?e:[]).map(({text:r,startTime:n,endTime:s})=>({text:r,startTime:n,endTime:s}))},mediaEvents:["loadstart","loadedmetadata"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:a}=e;if(!a)return;let r=a.querySelector('track[kind="chapters"][default][src]'),n=(t=a.shadowRoot)==null?void 0:t.querySelector(':is(video,audio) > track[kind="chapters"][default][src]');return r==null||r.addEventListener("load",i),n==null||n.addEventListener("load",i),()=>{r==null||r.removeEventListener("load",i),n==null||n.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("-")?ce(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",s),t.preload="none"},s=()=>{t.requestPictureInPicture().catch(a),n()};t.addEventListener("loadedmetadata",s),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){return eu(i)},set(i,e){i?Jd(e):jd(e)},rootEvents:["fullscreenchange","webkitfullscreenchange"],mediaEvents:["webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"]},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&&d.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(!au||!Xo(e))return Te.UNSUPPORTED}},mediaPipUnavailable:{get(i){let{media:e}=i;if(!ru||!zo(e))return Te.UNSUPPORTED}},mediaVolumeUnavailable:{get(i){let{media:e}=i;if(Fr===!1||(e==null?void 0:e.volume)==null)return Te.UNSUPPORTED},stateOwnersUpdateHandlers:[i=>{Fr==null&&Vh.then(e=>i(e?void 0:Te.UNSUPPORTED))}]},mediaCastUnavailable:{get(i,{availability:e="not-available"}={}){var t;let{media:a}=i;if(!ou||!((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(!nu)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 lu={[p.MEDIA_PREVIEW_REQUEST](i,e,{detail:t}){var a,r,n;let{media:s}=e,l=t!=null?t:void 0,u,c;if(s&&l!=null){let[f]=Yt(s,{kind:pe.METADATA,label:"thumbnails"}),L=Array.prototype.find.call((a=f==null?void 0:f.cues)!=null?a:[],(A,T,N)=>T===0?A.endTime>l:T===N.length-1?A.startTime<=l:A.startTime<=l&&A.endTime>l);if(L){let A=/'^(?:[a-z]+:)?\/\//i.test(L.text)||(r=s==null?void 0:s.querySelector('track[label="thumbnails"]'))==null?void 0:r.src,T=new URL(L.text,A);c=new URLSearchParams(T.hash).get("#xywh").split(",").map(te=>+te),u=T.href}}let b=i.mediaDuration.get(e),v=(n=i.mediaChaptersCues.get(e).find((f,L,A)=>L===A.length-1&&b===f.endTime?f.startTime<=l&&f.endTime>=l:f.startTime<=l&&f.endTime>l))==null?void 0:n.text;return t!=null&&v==null&&(v=""),{mediaPreviewTime:l,mediaPreviewImage:u,mediaPreviewCoords:c,mediaPreviewChapter:v}},[p.MEDIA_PAUSE_REQUEST](i,e){i["mediaPaused"].set(!0,e)},[p.MEDIA_PLAY_REQUEST](i,e){var t;let a="mediaPaused";if(i.mediaStreamType.get(e)===Me.LIVE){let s=!(i.mediaTargetLiveWindow.get(e)>0),l=(t=i.mediaSeekable.get(e))==null?void 0:t[1];s&&l&&i.mediaCurrentTime.set(l,e)}i[a].set(!1,e)},[p.MEDIA_PLAYBACK_RATE_REQUEST](i,e,{detail:t}){let a="mediaPlaybackRate",r=t;i[a].set(r,e)},[p.MEDIA_MUTE_REQUEST](i,e){i["mediaMuted"].set(!0,e)},[p.MEDIA_UNMUTE_REQUEST](i,e){let t="mediaMuted";i.mediaVolume.get(e)||i.mediaVolume.set(.25,e),i[t].set(!1,e)},[p.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)},[p.MEDIA_SEEK_REQUEST](i,e,{detail:t}){let a="mediaCurrentTime",r=t;i[a].set(r,e)},[p.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)},[p.MEDIA_SHOW_SUBTITLES_REQUEST](i,e,{detail:t}){var a;let{options:r}=e,n=yi(e),s=Zo(t),l=(a=s[0])==null?void 0:a.language;l&&!r.noSubtitlesLangPref&&d.localStorage.setItem("media-chrome-pref-subtitles-lang",l),Vt(_t.SHOWING,n,s)},[p.MEDIA_DISABLE_SUBTITLES_REQUEST](i,e,{detail:t}){let a=yi(e),r=t!=null?t:[];Vt(_t.DISABLED,a,r)},[p.MEDIA_TOGGLE_SUBTITLES_REQUEST](i,e,{detail:t}){Wr(e,t)},[p.MEDIA_RENDITION_REQUEST](i,e,{detail:t}){let a="mediaRenditionSelected",r=t;i[a].set(r,e)},[p.MEDIA_AUDIO_TRACK_REQUEST](i,e,{detail:t}){let a="mediaAudioTrackEnabled",r=t;i[a].set(r,e)},[p.MEDIA_ENTER_PIP_REQUEST](i,e){let t="mediaIsPip";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[p.MEDIA_EXIT_PIP_REQUEST](i,e){i["mediaIsPip"].set(!1,e)},[p.MEDIA_ENTER_FULLSCREEN_REQUEST](i,e){let t="mediaIsFullscreen";i.mediaIsPip.get(e)&&i.mediaIsPip.set(!1,e),i[t].set(!0,e)},[p.MEDIA_EXIT_FULLSCREEN_REQUEST](i,e){i["mediaIsFullscreen"].set(!1,e)},[p.MEDIA_ENTER_CAST_REQUEST](i,e){let t="mediaIsCasting";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[p.MEDIA_EXIT_CAST_REQUEST](i,e){i["mediaIsCasting"].set(!1,e)},[p.MEDIA_AIRPLAY_REQUEST](i,e){i["mediaIsAirplaying"].set(!0,e)}};var Yh=({media:i,fullscreenElement:e,documentElement:t,stateMediator:a=Ia,requestMap:r=lu,options:n={},monitorStateOwnersOnlyWithSubscriptions:s=!0})=>{let l=[],u={options:{...n}},c=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0}),b=A=>{A!=null&&($r(A,c)||(c=Object.freeze({...c,...A}),l.forEach(T=>T(c))))},g=()=>{let A=Object.entries(a).reduce((T,[N,{get:te}])=>(T[N]=te(u),T),{});b(A)},v={},f,L=async(A,T)=>{var N,te,be,gt,rt,ji,ea,ta,ia,aa,ra,na,oa,sa,la,da;let Ar=!!f;if(f={...u,...f!=null?f:{},...A},Ar)return;await su(...Object.values(A));let nt=l.length>0&&T===0&&s,ua=u.media!==f.media,ca=((N=u.media)==null?void 0:N.textTracks)!==((te=f.media)==null?void 0:te.textTracks),ma=((be=u.media)==null?void 0:be.videoRenditions)!==((gt=f.media)==null?void 0:gt.videoRenditions),ha=((rt=u.media)==null?void 0:rt.audioTracks)!==((ji=f.media)==null?void 0:ji.audioTracks),sd=((ea=u.media)==null?void 0:ea.remote)!==((ta=f.media)==null?void 0:ta.remote),ld=u.documentElement!==f.documentElement,dd=!!u.media&&(ua||nt),ud=!!((ia=u.media)!=null&&ia.textTracks)&&(ca||nt),cd=!!((aa=u.media)!=null&&aa.videoRenditions)&&(ma||nt),md=!!((ra=u.media)!=null&&ra.audioTracks)&&(ha||nt),hd=!!((na=u.media)!=null&&na.remote)&&(sd||nt),pd=!!u.documentElement&&(ld||nt),vd=dd||ud||cd||md||hd||pd,vi=l.length===0&&T===1&&s,fd=!!f.media&&(ua||vi),Ed=!!((oa=f.media)!=null&&oa.textTracks)&&(ca||vi),bd=!!((sa=f.media)!=null&&sa.videoRenditions)&&(ma||vi),gd=!!((la=f.media)!=null&&la.audioTracks)&&(ha||vi),_d=!!((da=f.media)!=null&&da.remote)&&(sd||vi),Ad=!!f.documentElement&&(ld||vi),Td=fd||Ed||bd||gd||_d||Ad;if(!(vd||Td)){Object.entries(f).forEach(([$,pa])=>{u[$]=pa}),g(),f=void 0;return}Object.entries(a).forEach(([$,{get:pa,mediaEvents:th=[],textTracksEvents:ih=[],videoRenditionsEvents:ah=[],audioTracksEvents:rh=[],remoteEvents:nh=[],rootEvents:oh=[],stateOwnersUpdateHandlers:sh=[]}])=>{v[$]||(v[$]={});let ge=J=>{let _e=pa(u,J);b({[$]:_e})},ae;ae=v[$].mediaEvents,th.forEach(J=>{ae&&dd&&(u.media.removeEventListener(J,ae),v[$].mediaEvents=void 0),fd&&(f.media.addEventListener(J,ge),v[$].mediaEvents=ge)}),ae=v[$].textTracksEvents,ih.forEach(J=>{var _e,Ce;ae&&ud&&((_e=u.media.textTracks)==null||_e.removeEventListener(J,ae),v[$].textTracksEvents=void 0),Ed&&((Ce=f.media.textTracks)==null||Ce.addEventListener(J,ge),v[$].textTracksEvents=ge)}),ae=v[$].videoRenditionsEvents,ah.forEach(J=>{var _e,Ce;ae&&cd&&((_e=u.media.videoRenditions)==null||_e.removeEventListener(J,ae),v[$].videoRenditionsEvents=void 0),bd&&((Ce=f.media.videoRenditions)==null||Ce.addEventListener(J,ge),v[$].videoRenditionsEvents=ge)}),ae=v[$].audioTracksEvents,rh.forEach(J=>{var _e,Ce;ae&&md&&((_e=u.media.audioTracks)==null||_e.removeEventListener(J,ae),v[$].audioTracksEvents=void 0),gd&&((Ce=f.media.audioTracks)==null||Ce.addEventListener(J,ge),v[$].audioTracksEvents=ge)}),ae=v[$].remoteEvents,nh.forEach(J=>{var _e,Ce;ae&&hd&&((_e=u.media.remote)==null||_e.removeEventListener(J,ae),v[$].remoteEvents=void 0),_d&&((Ce=f.media.remote)==null||Ce.addEventListener(J,ge),v[$].remoteEvents=ge)}),ae=v[$].rootEvents,oh.forEach(J=>{ae&&pd&&(u.documentElement.removeEventListener(J,ae),v[$].rootEvents=void 0),Ad&&(f.documentElement.addEventListener(J,ge),v[$].rootEvents=ge)});let yd=v[$].stateOwnersUpdateHandlers;sh.forEach(J=>{yd&&vd&&yd(),Td&&(v[$].stateOwnersUpdateHandlers=J(ge,f))})}),Object.entries(f).forEach(([$,pa])=>{u[$]=pa}),g(),f=void 0};return L({media:i,fullscreenElement:e,documentElement:t,options:n}),{dispatch(A){let{type:T,detail:N}=A;if(r[T]){b(r[T](a,u,A));return}T==="mediaelementchangerequest"?L({media:N}):T==="fullscreenelementchangerequest"?L({fullscreenElement:N}):T==="documentelementchangerequest"?L({documentElement:N}):T==="optionschangerequest"&&Object.entries(N!=null?N:{}).forEach(([te,be])=>{u.options[te]=be})},getState(){return c},subscribe(A){return L({},l.length+1),l.push(A),A(c),()=>{let T=l.indexOf(A);T>=0&&(L({},l.length-1),l.splice(T,1))}}}},du=Yh;var is=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},C=(i,e,t)=>(is(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)},kt=(i,e,t,a)=>(is(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),St=(i,e,t)=>(is(i,e,"access private method"),t),It,Ca,q,Ma,He,Kr,Vr,jo,ki,La,Yr,es,pu=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],uu=10,O={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"},Gr=class extends ya{constructor(){super(),ct(this,Vr),ct(this,ki),ct(this,Yr),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,ct(this,It,new Be(this,O.HOTKEYS)),ct(this,Ca,void 0),ct(this,q,void 0),ct(this,Ma,void 0),ct(this,He,void 0),ct(this,Kr,t=>{var a;(a=C(this,q))==null||a.dispatch(t)}),this.associateElement(this);let e={};kt(this,Ma,t=>{Object.entries(t).forEach(([a,r])=>{if(a in e&&e[a]===r)return;this.propagateMediaState(a,r);let n=a.toLowerCase(),s=new d.CustomEvent(Md[n],{composed:!0,detail:r});this.dispatchEvent(s)}),e=t}),this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(O.NO_HOTKEYS,O.HOTKEYS,O.DEFAULT_STREAM_TYPE,O.DEFAULT_SUBTITLES,O.DEFAULT_DURATION)}get mediaStore(){return C(this,q)}set mediaStore(e){var t,a;if(C(this,q)&&((t=C(this,He))==null||t.call(this),kt(this,He,void 0)),kt(this,q,e),!C(this,q)&&!this.hasAttribute(O.NO_DEFAULT_STORE)){St(this,Vr,jo).call(this);return}kt(this,He,(a=C(this,q))==null?void 0:a.subscribe(C(this,Ma)))}get fullscreenElement(){var e;return(e=C(this,Ca))!=null?e:this}set fullscreenElement(e){var t;this.hasAttribute(O.FULLSCREEN_ELEMENT)&&this.removeAttribute(O.FULLSCREEN_ELEMENT),kt(this,Ca,e),(t=C(this,q))==null||t.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}attributeChangedCallback(e,t,a){var r,n,s,l,u,c;if(super.attributeChangedCallback(e,t,a),e===O.NO_HOTKEYS)a!==t&&a===""?(this.hasAttribute(O.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===O.HOTKEYS)C(this,It).value=a;else if(e===O.DEFAULT_SUBTITLES&&a!==t)(r=C(this,q))==null||r.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(O.DEFAULT_SUBTITLES)}});else if(e===O.DEFAULT_STREAM_TYPE)(s=C(this,q))==null||s.dispatch({type:"optionschangerequest",detail:{defaultStreamType:(n=this.getAttribute(O.DEFAULT_STREAM_TYPE))!=null?n:void 0}});else if(e===O.LIVE_EDGE_OFFSET)(l=C(this,q))==null||l.dispatch({type:"optionschangerequest",detail:{liveEdgeOffset:this.hasAttribute(O.LIVE_EDGE_OFFSET)?+this.getAttribute(O.LIVE_EDGE_OFFSET):void 0}});else if(e===O.FULLSCREEN_ELEMENT){let b=a?(u=this.getRootNode())==null?void 0:u.getElementById(a):void 0;kt(this,Ca,b),(c=C(this,q))==null||c.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}}connectedCallback(){var e,t;!C(this,q)&&!this.hasAttribute(O.NO_DEFAULT_STORE)&&St(this,Vr,jo).call(this),(e=C(this,q))==null||e.dispatch({type:"documentelementchangerequest",detail:m}),super.connectedCallback(),C(this,q)&&!C(this,He)&&kt(this,He,(t=C(this,q))==null?void 0:t.subscribe(C(this,Ma))),this.enableHotkeys()}disconnectedCallback(){var e,t,a,r;(e=super.disconnectedCallback)==null||e.call(this),C(this,q)&&((t=C(this,q))==null||t.dispatch({type:"documentelementchangerequest",detail:void 0}),(a=C(this,q))==null||a.dispatch({type:p.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})),C(this,He)&&((r=C(this,He))==null||r.call(this),kt(this,He,void 0))}mediaSetCallback(e){var t;super.mediaSetCallback(e),(t=C(this,q))==null||t.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var t;super.mediaUnsetCallback(e),(t=C(this,q))==null||t.dispatch({type:"mediaelementchangerequest",detail:void 0})}propagateMediaState(e,t){hu(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=Xh(e,a,r);Object.values(p).forEach(s=>{e.addEventListener(s,C(this,Kr))}),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(p).forEach(r=>{e.removeEventListener(r,C(this,Kr))})}registerMediaStateReceiver(e){if(!e)return;let t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),C(this,q)&&Object.entries(C(this,q).getState()).forEach(([r,n])=>{hu([e],r,n)}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,a=t.indexOf(e);a<0||t.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",St(this,Yr,es))}disableHotkeys(){this.removeEventListener("keydown",St(this,Yr,es)),this.removeEventListener("keyup",St(this,ki,La))}get hotkeys(){return C(this,It)}keyboardShortcutHandler(e){var t,a,r,n,s;let l=e.target;if(((r=(a=(t=l.getAttribute(O.KEYS_USED))==null?void 0:t.split(" "))!=null?a:l==null?void 0:l.keysUsed)!=null?r:[]).map(v=>v==="Space"?" ":v).filter(Boolean).includes(e.key))return;let c,b,g;if(!C(this,It).contains(`no${e.key.toLowerCase()}`)&&!(e.key===" "&&C(this,It).contains("nospace")))switch(e.key){case" ":case"k":c=C(this,q).getState().mediaPaused?p.MEDIA_PLAY_REQUEST:p.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new d.CustomEvent(c,{composed:!0,bubbles:!0}));break;case"m":c=this.mediaStore.getState().mediaVolumeLevel==="off"?p.MEDIA_UNMUTE_REQUEST:p.MEDIA_MUTE_REQUEST,this.dispatchEvent(new d.CustomEvent(c,{composed:!0,bubbles:!0}));break;case"f":c=this.mediaStore.getState().mediaIsFullscreen?p.MEDIA_EXIT_FULLSCREEN_REQUEST:p.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new d.CustomEvent(c,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new d.CustomEvent(p.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":{let v=this.hasAttribute(O.KEYBOARD_BACKWARD_SEEK_OFFSET)?+this.getAttribute(O.KEYBOARD_BACKWARD_SEEK_OFFSET):uu;b=Math.max(((n=this.mediaStore.getState().mediaCurrentTime)!=null?n:0)-v,0),g=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:b}),this.dispatchEvent(g);break}case"ArrowRight":{let v=this.hasAttribute(O.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(O.KEYBOARD_FORWARD_SEEK_OFFSET):uu;b=Math.max(((s=this.mediaStore.getState().mediaCurrentTime)!=null?s:0)+v,0),g=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:b}),this.dispatchEvent(g);break}default:break}}};It=new WeakMap;Ca=new WeakMap;q=new WeakMap;Ma=new WeakMap;He=new WeakMap;Kr=new WeakMap;Vr=new WeakSet;jo=function(){var i;this.mediaStore=du({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(O.DEFAULT_SUBTITLES),defaultDuration:this.hasAttribute(O.DEFAULT_DURATION)?+this.getAttribute(O.DEFAULT_DURATION):void 0,defaultStreamType:(i=this.getAttribute(O.DEFAULT_STREAM_TYPE))!=null?i:void 0,liveEdgeOffset:this.hasAttribute(O.LIVE_EDGE_OFFSET)?+this.getAttribute(O.LIVE_EDGE_OFFSET):void 0,noVolumePref:this.hasAttribute(O.NO_VOLUME_PREF),noSubtitlesLangPref:this.hasAttribute(O.NO_SUBTITLES_LANG_PREF)}})};ki=new WeakSet;La=function(i){let{key:e}=i;if(!pu.includes(e)){this.removeEventListener("keyup",St(this,ki,La));return}this.keyboardShortcutHandler(i)};Yr=new WeakSet;es=function(i){let{metaKey:e,altKey:t,key:a}=i;if(e||t||!pu.includes(a)){this.removeEventListener("keyup",St(this,ki,La));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(C(this,It).contains(`no${a.toLowerCase()}`)||a===" "&&C(this,It).contains("nospace"))&&i.preventDefault(),this.addEventListener("keyup",St(this,ki,La),{once:!0})};var Gh=Object.values(o),qh=Object.values(Uo),vu=i=>{var e,t,a,r;let{observedAttributes:n}=i.constructor;!n&&((e=i.nodeName)!=null&&e.includes("-"))&&(d.customElements.upgrade(i),{observedAttributes:n}=i.constructor);let s=(r=(a=(t=i==null?void 0:i.getAttribute)==null?void 0:t.call(i,k.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(n||s)?(n||s).filter(l=>Gh.includes(l)):[]},Zh=i=>{var e,t;return(e=i.nodeName)!=null&&e.includes("-")&&d.customElements.get((t=i.nodeName)==null?void 0:t.toLowerCase())&&!(i instanceof d.customElements.get(i.nodeName.toLowerCase()))&&d.customElements.upgrade(i),qh.some(a=>a in i)},ts=i=>Zh(i)||!!vu(i).length,cu=i=>{var e;return(e=i==null?void 0:i.join)==null?void 0:e.call(i,":")},mu={[o.MEDIA_SUBTITLES_LIST]:ut,[o.MEDIA_SUBTITLES_SHOWING]:ut,[o.MEDIA_SEEKABLE]:cu,[o.MEDIA_BUFFERED]:i=>i==null?void 0:i.map(cu).join(" "),[o.MEDIA_PREVIEW_COORDS]:i=>i==null?void 0:i.join(" "),[o.MEDIA_RENDITION_LIST]:Rd,[o.MEDIA_AUDIO_TRACK_LIST]:xd},Qh=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 P(i,e,t);if(typeof t=="string")return M(i,e,t);if(Array.isArray(t)&&!t.length)return i.removeAttribute(e);let n=(r=(a=mu[e])==null?void 0:a.call(mu,t))!=null?r:t;return i.setAttribute(e,n)},zh=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},Gt=(i,e)=>{if(zh(i))return;let t=(r,n)=>{var s,l;ts(r)&&n(r);let{children:u=[]}=r!=null?r:{},c=(l=(s=r==null?void 0:r.shadowRoot)==null?void 0:s.children)!=null?l:[];[...u,...c].forEach(g=>Gt(g,n))},a=i==null?void 0:i.nodeName.toLowerCase();if(a.includes("-")&&!ts(i)){d.customElements.whenDefined(a).then(()=>{t(i,e)});return}t(i,e)},hu=(i,e,t)=>{i.forEach(a=>{if(e in a){a[e]=t;return}let r=vu(a),n=e.toLowerCase();r.includes(n)&&Qh(a,n,t)})},Xh=(i,e,t)=>{Gt(i,e);let a=b=>{var g;let v=(g=b==null?void 0:b.composedPath()[0])!=null?g:b.target;e(v)},r=b=>{var g;let v=(g=b==null?void 0:b.composedPath()[0])!=null?g:b.target;t(v)};i.addEventListener(p.REGISTER_MEDIA_STATE_RECEIVER,a),i.addEventListener(p.UNREGISTER_MEDIA_STATE_RECEIVER,r);let n=b=>{b.forEach(g=>{let{addedNodes:v=[],removedNodes:f=[],type:L,target:A,attributeName:T}=g;L==="childList"?(Array.prototype.forEach.call(v,N=>Gt(N,e)),Array.prototype.forEach.call(f,N=>Gt(N,t))):L==="attributes"&&T===k.MEDIA_CHROME_ATTRIBUTES&&(ts(A)?e(A):t(A))})},s=[],l=b=>{let g=b.target;g.name!=="media"&&(s.forEach(v=>Gt(v,t)),s=[...g.assignedElements({flatten:!0})],s.forEach(v=>Gt(v,e)))};i.addEventListener("slotchange",l);let u=new MutationObserver(n);return u.observe(i,{childList:!0,attributes:!0,subtree:!0}),()=>{Gt(i,t),i.removeEventListener("slotchange",l),u.disconnect(),i.removeEventListener(p.REGISTER_MEDIA_STATE_RECEIVER,a),i.removeEventListener(p.UNREGISTER_MEDIA_STATE_RECEIVER,r)}};d.customElements.get("media-controller")||d.customElements.define("media-controller",Gr);var as=Gr;var ns=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ee=(i,e,t)=>(ns(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)},qr=(i,e,t,a)=>(ns(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Jh=(i,e,t)=>(ns(i,e,"access private method"),t),We,Ci,Ct,Ii,Qr,rs,fu,Zr={TOOLTIP_PLACEMENT:"tooltipplacement"},Eu=m.createElement("template");Eu.innerHTML=`
147
+ <slot name="dialog" part="layer dialog-layer"></slot>
148
+ `;var Uh=Object.values(o),Bh="sm:384 md:576 lg:768 xl:960";function Hh(t){$h(t.target,t.contentRect.width)}function $h(t,e){var i;if(!t.isConnected)return;let a=(i=t.getAttribute(x.BREAKPOINTS))!=null?i:Bh,r=Wh(a),n=Fh(r,e),s=!1;if(Object.keys(r).forEach(l=>{if(n.includes(l)){t.hasAttribute(`breakpoint${l}`)||(t.setAttribute(`breakpoint${l}`,""),s=!0);return}t.hasAttribute(`breakpoint${l}`)&&(t.removeAttribute(`breakpoint${l}`),s=!0)}),s){let l=new CustomEvent(rt.BREAKPOINTS_CHANGE,{detail:n});t.dispatchEvent(l)}}function Wh(t){let e=t.split(/\s+/);return Object.fromEntries(e.map(i=>i.split(":")))}function Fh(t,e){return Object.keys(t).filter(i=>e>=parseInt(t[i]))}var ba=class extends d.HTMLElement{constructor(){super(),ot(this,Go),ot(this,qo),ot(this,va),ot(this,xr),ot(this,_i),ot(this,wr,0),ot(this,bi,null),ot(this,fa,null),ot(this,gi,void 0),this.breakpointsComputed=!1,this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(tu.content.cloneNode(!0)));let e=s=>{let l=this.media;for(let u of s)u.type==="childList"&&(u.removedNodes.forEach(c=>{if(c.slot=="media"&&u.target==this){let b=u.previousSibling&&u.previousSibling.previousElementSibling;if(!b||!l)this.mediaUnsetCallback(c);else{let g=b.slot!=="media";for(;(b=b.previousSibling)!==null;)b.slot=="media"&&(g=!1);g&&this.mediaUnsetCallback(c)}}}),l&&u.addedNodes.forEach(c=>{c===l&&this.handleMediaUpdated(l)}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0});let a=!1;nt(this,s=>{a||(setTimeout(()=>{Hh(s),a=!1,this.breakpointsComputed||(this.breakpointsComputed=!0,this.dispatchEvent(new CustomEvent(rt.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){_t(this,bi)&&this.mediaUnsetCallback(_t(this,bi));return}this.handleMediaUpdated(this.media)})}static get observedAttributes(){return[x.AUTOHIDE,x.GESTURES_DISABLED].concat(Uh).filter(e=>![o.MEDIA_RENDITION_LIST,o.MEDIA_AUDIO_TRACK_LIST,o.MEDIA_CHAPTERS_CUES,o.MEDIA_WIDTH,o.MEDIA_HEIGHT,o.MEDIA_ERROR,o.MEDIA_ERROR_MESSAGE].includes(e))}attributeChangedCallback(e,i,a){e.toLowerCase()==x.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&&(pa(this,bi,e),e.localName.includes("-")&&await d.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;let a=this.getAttribute(x.AUDIO)!=null?V.AUDIO_PLAYER():V.VIDEO_PLAYER();this.setAttribute("role","region"),this.setAttribute("aria-label",a),this.handleMediaUpdated(this.media),this.setAttribute(x.USER_INACTIVE,""),this.addEventListener("pointerdown",this),this.addEventListener("pointermove",this),this.addEventListener("pointerup",this),this.addEventListener("mouseleave",this),this.addEventListener("keyup",this),(e=d.window)==null||e.addEventListener("mouseup",this)}disconnectedCallback(){var e;this.media&&this.mediaUnsetCallback(this.media),(e=d.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){pa(this,bi,null)}handleEvent(e){switch(e.type){case"pointerdown":pa(this,wr,e.timeStamp);break;case"pointermove":Me(this,Go,jd).call(this,e);break;case"pointerup":Me(this,qo,eu).call(this,e);break;case"mouseleave":Me(this,va,Lr).call(this);break;case"mouseup":this.removeAttribute(x.KEYBOARD_CONTROL);break;case"keyup":Me(this,_i,Ea).call(this),this.setAttribute(x.KEYBOARD_CONTROL,"");break}}set autohide(e){let i=Number(e);pa(this,gi,isNaN(i)?0:i)}get autohide(){return(_t(this,gi)===void 0?2:_t(this,gi)).toString()}};wr=new WeakMap;bi=new WeakMap;fa=new WeakMap;gi=new WeakMap;Go=new WeakSet;jd=function(t){t.pointerType!=="mouse"&&t.timeStamp-_t(this,wr)<250||(Me(this,xr,Qo).call(this),clearTimeout(_t(this,fa)),[this,this.media].includes(t.target)&&Me(this,_i,Ea).call(this))};qo=new WeakSet;eu=function(t){if(t.pointerType==="touch"){let e=!this.hasAttribute(x.USER_INACTIVE);[this,this.media].includes(t.target)&&e?Me(this,va,Lr).call(this):Me(this,_i,Ea).call(this)}else t.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&Me(this,_i,Ea).call(this)};va=new WeakSet;Lr=function(){if(_t(this,gi)<0||this.hasAttribute(x.USER_INACTIVE))return;this.setAttribute(x.USER_INACTIVE,"");let t=new d.CustomEvent(rt.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(t)};xr=new WeakSet;Qo=function(){if(!this.hasAttribute(x.USER_INACTIVE))return;this.removeAttribute(x.USER_INACTIVE);let t=new d.CustomEvent(rt.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(t)};_i=new WeakSet;Ea=function(){Me(this,xr,Qo).call(this),clearTimeout(_t(this,fa));let t=parseInt(this.autohide);t<0||pa(this,fa,setTimeout(()=>{Me(this,va,Lr).call(this)},t*1e3))};d.customElements.get("media-container")||d.customElements.define("media-container",ba);var iu=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ae=(t,e,i)=>(iu(t,e,"read from private field"),i?i.call(t):e.get(t)),ga=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Dr=(t,e,i,a)=>(iu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ai,Ti,Or,Ht,st,At,Ue=class{constructor(e,i,{defaultValue:a}={defaultValue:void 0}){ga(this,st),ga(this,Ai,void 0),ga(this,Ti,void 0),ga(this,Or,void 0),ga(this,Ht,new Set),Dr(this,Ai,e),Dr(this,Ti,i),Dr(this,Or,new Set(a))}[Symbol.iterator](){return ae(this,st,At).values()}get length(){return ae(this,st,At).size}get value(){var e;return(e=[...ae(this,st,At)].join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(Dr(this,Ht,new Set),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return[...ae(this,st,At)][e]}values(){return ae(this,st,At).values()}forEach(e,i){ae(this,st,At).forEach(e,i)}add(...e){var i,a;e.forEach(r=>ae(this,Ht).add(r)),!(this.value===""&&!((i=ae(this,Ai))!=null&&i.hasAttribute(`${ae(this,Ti)}`)))&&((a=ae(this,Ai))==null||a.setAttribute(`${ae(this,Ti)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>ae(this,Ht).delete(a)),(i=ae(this,Ai))==null||i.setAttribute(`${ae(this,Ti)}`,`${this.value}`)}contains(e){return ae(this,st,At).has(e)}toggle(e,i){return typeof i!="undefined"?i?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,i){return this.remove(e),this.add(i),e===i}};Ai=new WeakMap;Ti=new WeakMap;Or=new WeakMap;Ht=new WeakMap;st=new WeakSet;At=function(){return ae(this,Ht).size?ae(this,Ht):ae(this,Or)};var Kh=(t="")=>t.split(/\s+/),au=(t="")=>{let[e,i,a]=t.split(":"),r=a?decodeURIComponent(a):void 0;return{kind:e==="cc"?fe.CAPTIONS:fe.SUBTITLES,language:i,label:r}},$t=(t="",e={})=>Kh(t).map(i=>{let a=au(i);return{...e,...a}}),zo=t=>t?Array.isArray(t)?t.map(e=>typeof e=="string"?au(e):e):typeof t=="string"?$t(t):[t]:[],Nr=({kind:t,label:e,language:i}={kind:"subtitles"})=>e?`${t==="captions"?"cc":"sb"}:${i}:${encodeURIComponent(e)}`:i,lt=(t=[])=>Array.prototype.map.call(t,Nr).join(" "),Vh=(t,e)=>i=>i[t]===e,ru=t=>{let e=Object.entries(t).map(([i,a])=>Vh(i,a));return i=>e.every(a=>a(i))},Wt=(t,e=[],i=[])=>{let a=zo(i).map(ru),r=n=>a.some(s=>s(n));Array.from(e).filter(r).forEach(n=>{n.mode=t})},Ft=(t,e=()=>!0)=>{if(!(t!=null&&t.textTracks))return[];let i=typeof e=="function"?e:ru(e);return Array.from(t.textTracks).filter(i)},Pr=t=>{var e;return!!((e=t.mediaSubtitlesShowing)!=null&&e.length)||t.hasAttribute(o.MEDIA_SUBTITLES_SHOWING)};var ou=t=>{var e;let{media:i,fullscreenElement:a}=t,r=a&&"requestFullscreen"in a?"requestFullscreen":a&&"webkitRequestFullScreen"in a?"webkitRequestFullScreen":void 0;if(r){let n=(e=a[r])==null?void 0:e.call(a);if(n instanceof Promise)return n.catch(()=>{})}else i!=null&&i.webkitEnterFullscreen?i.webkitEnterFullscreen():i!=null&&i.requestFullscreen&&i.requestFullscreen()},nu="exitFullscreen"in h?"exitFullscreen":"webkitExitFullscreen"in h?"webkitExitFullscreen":"webkitCancelFullScreen"in h?"webkitCancelFullScreen":void 0,su=t=>{var e;let{documentElement:i}=t;if(nu){let a=(e=i==null?void 0:i[nu])==null?void 0:e.call(i);if(a instanceof Promise)return a.catch(()=>{})}},_a="fullscreenElement"in h?"fullscreenElement":"webkitFullscreenElement"in h?"webkitFullscreenElement":void 0,Yh=t=>{let{documentElement:e,media:i}=t,a=e==null?void 0:e[_a];return!a&&"webkitDisplayingFullscreen"in i&&"webkitPresentationMode"in i&&i.webkitDisplayingFullscreen&&i.webkitPresentationMode===Ud.FULLSCREEN?i:a},lu=t=>{var e;let{media:i,documentElement:a,fullscreenElement:r=i}=t;if(!i||!a)return!1;let n=Yh(t);if(!n)return!1;if(n===r||n===i)return!0;if(n.localName.includes("-")){let s=n.shadowRoot;if(!(_a in s))return ue(n,r);for(;s!=null&&s[_a];){if(s[_a]===r)return!0;s=(e=s[_a])==null?void 0:e.shadowRoot}}return!1},Gh="fullscreenEnabled"in h?"fullscreenEnabled":"webkitFullscreenEnabled"in h?"webkitFullscreenEnabled":void 0,du=t=>{let{documentElement:e,media:i}=t;return!!(e!=null&&e[Gh])||i&&"webkitSupportsFullscreen"in i};var Ur,Xo=()=>{var t,e;return Ur||(Ur=(e=(t=h)==null?void 0:t.createElement)==null?void 0:e.call(t,"video"),Ur)},uu=async(t=Xo())=>{if(!t)return!1;let e=t.volume;t.volume=e/2+.1;let i=new AbortController,a=await Promise.race([qh(t,i.signal),Zh(t,e)]);return i.abort(),a},qh=(t,e)=>new Promise(i=>{t.addEventListener("volumechange",()=>i(!0),{signal:e})}),Zh=async(t,e)=>{for(let i=0;i<10;i++){if(t.volume===e)return!1;await Ar(10)}return t.volume!==e},Qh=/.*Version\/.*Safari\/.*/.test(d.navigator.userAgent),Jo=(t=Xo())=>d.matchMedia("(display-mode: standalone)").matches&&Qh?!1:typeof(t==null?void 0:t.requestPictureInPicture)=="function",jo=(t=Xo())=>du({documentElement:h,media:t}),cu=jo(),mu=Jo(),hu=!!d.WebKitPlaybackTargetAvailabilityEvent,pu=!!d.chrome;var yi=t=>Ft(t.media,e=>[fe.SUBTITLES,fe.CAPTIONS].includes(e.kind)).sort((e,i)=>e.kind>=i.kind?1:-1),es=t=>Ft(t.media,e=>e.mode===bt.SHOWING&&[fe.SUBTITLES,fe.CAPTIONS].includes(e.kind)),Br=(t,e)=>{let i=yi(t),a=es(t),r=!!a.length;if(i.length){if(e===!1||r&&e!==!0)Wt(bt.DISABLED,i,a);else if(e===!0||!r&&e!==!1){let n=i[0],{options:s}=t;if(!(s!=null&&s.noSubtitlesLangPref)){let b=globalThis.localStorage.getItem("media-chrome-pref-subtitles-lang"),g=b?[b,...globalThis.navigator.languages]:globalThis.navigator.languages,f=i.filter(v=>g.some(L=>v.language.toLowerCase().startsWith(L.split("-")[0]))).sort((v,L)=>{let A=g.findIndex(N=>v.language.toLowerCase().startsWith(N.split("-")[0])),T=g.findIndex(N=>L.language.toLowerCase().startsWith(N.split("-")[0]));return A-T});f[0]&&(n=f[0])}let{language:l,label:u,kind:c}=n;Wt(bt.DISABLED,i,a),Wt(bt.SHOWING,i,[{language:l,label:u,kind:c}])}}},Hr=(t,e)=>t===e?!0:t==null||e==null||typeof t!=typeof e?!1:typeof t=="number"&&Number.isNaN(t)&&Number.isNaN(e)?!0:typeof t!="object"?!1:Array.isArray(t)?zh(t,e):Object.entries(t).every(([i,a])=>i in e&&Hr(a,e[i])),zh=(t,e)=>{let i=Array.isArray(t),a=Array.isArray(e);return i!==a?!1:i||a?t.length!==e.length?!1:t.every((r,n)=>Hr(r,e[n])):!0};var Xh=Object.values(Ce),$r,Jh=uu().then(t=>($r=t,$r)),fu=async(...t)=>{await Promise.all(t.filter(e=>e).map(async e=>{if(!("localName"in e&&e instanceof d.HTMLElement))return;let i=e.localName;if(!i.includes("-"))return;let a=d.customElements.get(i);a&&e instanceof a||(await d.customElements.whenDefined(i),d.customElements.upgrade(e))}))},Aa={mediaError:{get(t){let{media:e}=t;return e==null?void 0:e.error},mediaEvents:["emptied","error"]},mediaErrorCode:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.error)==null?void 0:e.code},mediaEvents:["emptied","error"]},mediaErrorMessage:{get(t){var e,i;let{media:a}=t;return(i=(e=a==null?void 0:a.error)==null?void 0:e.message)!=null?i:""},mediaEvents:["emptied","error"]},mediaWidth:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.videoWidth)!=null?e:0},mediaEvents:["resize"]},mediaHeight:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.videoHeight)!=null?e:0},mediaEvents:["resize"]},mediaPaused:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.paused)!=null?e:!0},set(t,e){var i;let{media:a}=e;a&&(t?a.pause():(i=a.play())==null||i.catch(()=>{}))},mediaEvents:["play","playing","pause","emptied"]},mediaHasPlayed:{get(t,e){let{media:i}=t;return i?e?e.type==="playing":!i.paused:!1},mediaEvents:["playing","emptied"]},mediaEnded:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.ended)!=null?e:!1},mediaEvents:["seeked","ended","emptied"]},mediaPlaybackRate:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.playbackRate)!=null?e:1},set(t,e){let{media:i}=e;i&&Number.isFinite(+t)&&(i.playbackRate=+t)},mediaEvents:["ratechange","loadstart"]},mediaMuted:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.muted)!=null?e:!1},set(t,e){let{media:i}=e;i&&(i.muted=t)},mediaEvents:["volumechange"]},mediaVolume:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.volume)!=null?e:1},set(t,e){let{media:i}=e;if(i){try{t==null?d.localStorage.removeItem("media-chrome-pref-volume"):d.localStorage.setItem("media-chrome-pref-volume",t.toString())}catch{}Number.isFinite(+t)&&(i.volume=+t)}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(t,e)=>{let{options:{noVolumePref:i}}=e;if(!i)try{let a=d.localStorage.getItem("media-chrome-pref-volume");if(a==null)return;Aa.mediaVolume.set(+a,e),t(+a)}catch(a){console.debug("Error getting volume pref",a)}}]},mediaVolumeLevel:{get(t){let{media:e}=t;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(t){var e;let{media:i}=t;return(e=i==null?void 0:i.currentTime)!=null?e:0},set(t,e){let{media:i}=e;!i||!Ei(t)||(i.currentTime=t)},mediaEvents:["timeupdate","loadedmetadata"]},mediaDuration:{get(t){let{media:e,options:{defaultDuration:i}={}}=t;return i&&(!e||!e.duration||Number.isNaN(e.duration)||!Number.isFinite(e.duration))?i:Number.isFinite(e==null?void 0:e.duration)?e.duration:Number.NaN},mediaEvents:["durationchange","loadedmetadata","emptied"]},mediaLoading:{get(t){let{media:e}=t;return(e==null?void 0:e.readyState)<3},mediaEvents:["waiting","playing","emptied"]},mediaSeekable:{get(t){var e;let{media:i}=t;if(!((e=i==null?void 0:i.seekable)!=null&&e.length))return;let a=i.seekable.start(0),r=i.seekable.end(i.seekable.length-1);if(!(!a&&!r))return[Number(a.toFixed(3)),Number(r.toFixed(3))]},mediaEvents:["loadedmetadata","emptied","progress","seekablechange"]},mediaBuffered:{get(t){var e;let{media:i}=t,a=(e=i==null?void 0:i.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(t){let{media:e,options:{defaultStreamType:i}={}}=t,a=[Ce.LIVE,Ce.ON_DEMAND].includes(i)?i:void 0;if(!e)return a;let{streamType:r}=e;if(Xh.includes(r))return r===Ce.UNKNOWN?a:r;let n=e.duration;return n===1/0?Ce.LIVE:Number.isFinite(n)?Ce.ON_DEMAND:a},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange"]},mediaTargetLiveWindow:{get(t){let{media:e}=t;if(!e)return Number.NaN;let{targetLiveWindow:i}=e,a=Aa.mediaStreamType.get(t);return(i==null||Number.isNaN(i))&&a===Ce.LIVE?0:i},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange","targetlivewindowchange"]},mediaTimeIsLive:{get(t){let{media:e,options:{liveEdgeOffset:i=10}={}}=t;if(!e)return!1;if(typeof e.liveEdgeStart=="number")return Number.isNaN(e.liveEdgeStart)?!1:e.currentTime>=e.liveEdgeStart;if(!(Aa.mediaStreamType.get(t)===Ce.LIVE))return!1;let r=e.seekable;if(!r)return!0;if(!r.length)return!1;let n=r.end(r.length-1)-i;return e.currentTime>=n},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},mediaSubtitlesList:{get(t){return yi(t).map(({kind:e,label:i,language:a})=>({kind:e,label:i,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},mediaSubtitlesShowing:{get(t){return es(t).map(({kind:e,label:i,language:a})=>({kind:e,label:i,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(t,e)=>{var i,a;let{media:r,options:n}=e;if(!r)return;let s=l=>{var u;!n.defaultSubtitles||l&&![fe.CAPTIONS,fe.SUBTITLES].includes((u=l==null?void 0:l.track)==null?void 0:u.kind)||Br(e,!0)};return(i=r.textTracks)==null||i.addEventListener("addtrack",s),(a=r.textTracks)==null||a.addEventListener("removetrack",s),s(),()=>{var l,u;(l=r.textTracks)==null||l.removeEventListener("addtrack",s),(u=r.textTracks)==null||u.removeEventListener("removetrack",s)}}]},mediaChaptersCues:{get(t){var e;let{media:i}=t;if(!i)return[];let[a]=Ft(i,{kind:fe.CHAPTERS});return Array.from((e=a==null?void 0:a.cues)!=null?e:[]).map(({text:r,startTime:n,endTime:s})=>({text:r,startTime:n,endTime:s}))},mediaEvents:["loadstart","loadedmetadata"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(t,e)=>{var i;let{media:a}=e;if(!a)return;let r=a.querySelector('track[kind="chapters"][default][src]'),n=(i=a.shadowRoot)==null?void 0:i.querySelector(':is(video,audio) > track[kind="chapters"][default][src]');return r==null||r.addEventListener("load",t),n==null||n.addEventListener("load",t),()=>{r==null||r.removeEventListener("load",t),n==null||n.removeEventListener("load",t)}}]},mediaIsPip:{get(t){var e,i;let{media:a,documentElement:r}=t;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=(i=n.pictureInPictureElement)==null?void 0:i.shadowRoot}}return!1},set(t,e){let{media:i}=e;if(i)if(t){if(!h.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!i.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.")};i.requestPictureInPicture().catch(r=>{if(r.code===11){if(!i.src){console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a src set.");return}if(i.readyState===0&&i.preload==="none"){let n=()=>{i.removeEventListener("loadedmetadata",s),i.preload="none"},s=()=>{i.requestPictureInPicture().catch(a),n()};i.addEventListener("loadedmetadata",s),i.preload="metadata",setTimeout(()=>{i.readyState===0&&a(),n()},1e3)}else throw r}else throw r})}else h.pictureInPictureElement&&h.exitPictureInPicture()},mediaEvents:["enterpictureinpicture","leavepictureinpicture"]},mediaRenditionList:{get(t){var e;let{media:i}=t;return[...(e=i==null?void 0:i.videoRenditions)!=null?e:[]].map(a=>({...a}))},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaRenditionSelected:{get(t){var e,i,a;let{media:r}=t;return(a=(i=r==null?void 0:r.videoRenditions)==null?void 0:i[(e=r.videoRenditions)==null?void 0:e.selectedIndex])==null?void 0:a.id},set(t,e){let{media:i}=e;if(!(i!=null&&i.videoRenditions)){console.warn("MediaController: Rendition selection not supported by this media.");return}let a=t,r=Array.prototype.findIndex.call(i.videoRenditions,n=>n.id==a);i.videoRenditions.selectedIndex!=r&&(i.videoRenditions.selectedIndex=r)},mediaEvents:["emptied"],videoRenditionsEvents:["addrendition","removerendition","change"]},mediaAudioTrackList:{get(t){var e;let{media:i}=t;return[...(e=i==null?void 0:i.audioTracks)!=null?e:[]]},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaAudioTrackEnabled:{get(t){var e,i;let{media:a}=t;return(i=[...(e=a==null?void 0:a.audioTracks)!=null?e:[]].find(r=>r.enabled))==null?void 0:i.id},set(t,e){let{media:i}=e;if(!(i!=null&&i.audioTracks)){console.warn("MediaChrome: Audio track selection not supported by this media.");return}let a=t;for(let r of i.audioTracks)r.enabled=a==r.id},mediaEvents:["emptied"],audioTracksEvents:["addtrack","removetrack","change"]},mediaIsFullscreen:{get(t){return lu(t)},set(t,e){t?ou(e):su(e)},rootEvents:["fullscreenchange","webkitfullscreenchange"],mediaEvents:["webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"]},mediaIsCasting:{get(t){var e;let{media:i}=t;return!(i!=null&&i.remote)||((e=i.remote)==null?void 0:e.state)==="disconnected"?!1:!!i.remote.state},set(t,e){var i,a;let{media:r}=e;if(r&&!(t&&((i=r.remote)==null?void 0:i.state)!=="disconnected")&&!(!t&&((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(t,e){let{media:i}=e;if(i){if(!(i.webkitShowPlaybackTargetPicker&&d.WebKitPlaybackTargetAvailabilityEvent)){console.warn("MediaChrome: received a request to select AirPlay but AirPlay is not supported in this environment");return}i.webkitShowPlaybackTargetPicker()}},mediaEvents:["webkitcurrentplaybacktargetiswirelesschanged"]},mediaFullscreenUnavailable:{get(t){let{media:e}=t;if(!cu||!jo(e))return Te.UNSUPPORTED}},mediaPipUnavailable:{get(t){let{media:e}=t;if(!mu||!Jo(e))return Te.UNSUPPORTED}},mediaVolumeUnavailable:{get(t){let{media:e}=t;if($r===!1||(e==null?void 0:e.volume)==null)return Te.UNSUPPORTED},stateOwnersUpdateHandlers:[t=>{$r==null&&Jh.then(e=>t(e?void 0:Te.UNSUPPORTED))}]},mediaCastUnavailable:{get(t,{availability:e="not-available"}={}){var i;let{media:a}=t;if(!pu||!((i=a==null?void 0:a.remote)!=null&&i.state))return Te.UNSUPPORTED;if(!(e==null||e==="available"))return Te.UNAVAILABLE},stateOwnersUpdateHandlers:[(t,e)=>{var i;let{media:a}=e;return a?(a.disableRemotePlayback||a.hasAttribute("disableremoteplayback")||(i=a==null?void 0:a.remote)==null||i.watchAvailability(n=>{t({availability:n?"available":"not-available"})}).catch(n=>{n.name==="NotSupportedError"?t({availability:null}):t({availability:"not-available"})}),()=>{var n;(n=a==null?void 0:a.remote)==null||n.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaAirplayUnavailable:{get(t,e){if(!hu)return Te.UNSUPPORTED;if((e==null?void 0:e.availability)==="not-available")return Te.UNAVAILABLE},mediaEvents:["webkitplaybacktargetavailabilitychanged"],stateOwnersUpdateHandlers:[(t,e)=>{var i;let{media:a}=e;return a?(a.disableRemotePlayback||a.hasAttribute("disableremoteplayback")||(i=a==null?void 0:a.remote)==null||i.watchAvailability(n=>{t({availability:n?"available":"not-available"})}).catch(n=>{n.name==="NotSupportedError"?t({availability:null}):t({availability:"not-available"})}),()=>{var n;(n=a==null?void 0:a.remote)==null||n.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaRenditionUnavailable:{get(t){var e;let{media:i}=t;if(!(i!=null&&i.videoRenditions))return Te.UNSUPPORTED;if(!((e=i.videoRenditions)!=null&&e.length))return Te.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaAudioTrackUnavailable:{get(t){var e,i;let{media:a}=t;if(!(a!=null&&a.audioTracks))return Te.UNSUPPORTED;if(((i=(e=a.audioTracks)==null?void 0:e.length)!=null?i:0)<=1)return Te.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]}};var vu={[p.MEDIA_PREVIEW_REQUEST](t,e,{detail:i}){var a,r,n;let{media:s}=e,l=i!=null?i:void 0,u,c;if(s&&l!=null){let[v]=Ft(s,{kind:fe.METADATA,label:"thumbnails"}),L=Array.prototype.find.call((a=v==null?void 0:v.cues)!=null?a:[],(A,T,N)=>T===0?A.endTime>l:T===N.length-1?A.startTime<=l:A.startTime<=l&&A.endTime>l);if(L){let A=/'^(?:[a-z]+:)?\/\//i.test(L.text)||(r=s==null?void 0:s.querySelector('track[label="thumbnails"]'))==null?void 0:r.src,T=new URL(L.text,A);c=new URLSearchParams(T.hash).get("#xywh").split(",").map(ee=>+ee),u=T.href}}let b=t.mediaDuration.get(e),f=(n=t.mediaChaptersCues.get(e).find((v,L,A)=>L===A.length-1&&b===v.endTime?v.startTime<=l&&v.endTime>=l:v.startTime<=l&&v.endTime>l))==null?void 0:n.text;return i!=null&&f==null&&(f=""),{mediaPreviewTime:l,mediaPreviewImage:u,mediaPreviewCoords:c,mediaPreviewChapter:f}},[p.MEDIA_PAUSE_REQUEST](t,e){t["mediaPaused"].set(!0,e)},[p.MEDIA_PLAY_REQUEST](t,e){var i;let a="mediaPaused";if(t.mediaStreamType.get(e)===Ce.LIVE){let s=!(t.mediaTargetLiveWindow.get(e)>0),l=(i=t.mediaSeekable.get(e))==null?void 0:i[1];s&&l&&t.mediaCurrentTime.set(l,e)}t[a].set(!1,e)},[p.MEDIA_PLAYBACK_RATE_REQUEST](t,e,{detail:i}){let a="mediaPlaybackRate",r=i;t[a].set(r,e)},[p.MEDIA_MUTE_REQUEST](t,e){t["mediaMuted"].set(!0,e)},[p.MEDIA_UNMUTE_REQUEST](t,e){let i="mediaMuted";t.mediaVolume.get(e)||t.mediaVolume.set(.25,e),t[i].set(!1,e)},[p.MEDIA_VOLUME_REQUEST](t,e,{detail:i}){let a="mediaVolume",r=i;r&&t.mediaMuted.get(e)&&t.mediaMuted.set(!1,e),t[a].set(r,e)},[p.MEDIA_SEEK_REQUEST](t,e,{detail:i}){let a="mediaCurrentTime",r=i;t[a].set(r,e)},[p.MEDIA_SEEK_TO_LIVE_REQUEST](t,e){var i;let a="mediaCurrentTime",r=(i=t.mediaSeekable.get(e))==null?void 0:i[1];Number.isNaN(Number(r))||t[a].set(r,e)},[p.MEDIA_SHOW_SUBTITLES_REQUEST](t,e,{detail:i}){var a;let{options:r}=e,n=yi(e),s=zo(i),l=(a=s[0])==null?void 0:a.language;l&&!r.noSubtitlesLangPref&&d.localStorage.setItem("media-chrome-pref-subtitles-lang",l),Wt(bt.SHOWING,n,s)},[p.MEDIA_DISABLE_SUBTITLES_REQUEST](t,e,{detail:i}){let a=yi(e),r=i!=null?i:[];Wt(bt.DISABLED,a,r)},[p.MEDIA_TOGGLE_SUBTITLES_REQUEST](t,e,{detail:i}){Br(e,i)},[p.MEDIA_RENDITION_REQUEST](t,e,{detail:i}){let a="mediaRenditionSelected",r=i;t[a].set(r,e)},[p.MEDIA_AUDIO_TRACK_REQUEST](t,e,{detail:i}){let a="mediaAudioTrackEnabled",r=i;t[a].set(r,e)},[p.MEDIA_ENTER_PIP_REQUEST](t,e){let i="mediaIsPip";t.mediaIsFullscreen.get(e)&&t.mediaIsFullscreen.set(!1,e),t[i].set(!0,e)},[p.MEDIA_EXIT_PIP_REQUEST](t,e){t["mediaIsPip"].set(!1,e)},[p.MEDIA_ENTER_FULLSCREEN_REQUEST](t,e){let i="mediaIsFullscreen";t.mediaIsPip.get(e)&&t.mediaIsPip.set(!1,e),t[i].set(!0,e)},[p.MEDIA_EXIT_FULLSCREEN_REQUEST](t,e){t["mediaIsFullscreen"].set(!1,e)},[p.MEDIA_ENTER_CAST_REQUEST](t,e){let i="mediaIsCasting";t.mediaIsFullscreen.get(e)&&t.mediaIsFullscreen.set(!1,e),t[i].set(!0,e)},[p.MEDIA_EXIT_CAST_REQUEST](t,e){t["mediaIsCasting"].set(!1,e)},[p.MEDIA_AIRPLAY_REQUEST](t,e){t["mediaIsAirplaying"].set(!0,e)}};var jh=({media:t,fullscreenElement:e,documentElement:i,stateMediator:a=Aa,requestMap:r=vu,options:n={},monitorStateOwnersOnlyWithSubscriptions:s=!0})=>{let l=[],u={options:{...n}},c=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0}),b=A=>{A!=null&&(Hr(A,c)||(c=Object.freeze({...c,...A}),l.forEach(T=>T(c))))},g=()=>{let A=Object.entries(a).reduce((T,[N,{get:ee}])=>(T[N]=ee(u),T),{});b(A)},f={},v,L=async(A,T)=>{var N,ee,be,Et,at,Ji,ji,ea,ta,ia,aa,ra,na,oa,sa,la;let br=!!v;if(v={...u,...v!=null?v:{},...A},br)return;await fu(...Object.values(A));let hi=l.length>0&&T===0&&s,cd=u.media!==v.media,md=((N=u.media)==null?void 0:N.textTracks)!==((ee=v.media)==null?void 0:ee.textTracks),hd=((be=u.media)==null?void 0:be.videoRenditions)!==((Et=v.media)==null?void 0:Et.videoRenditions),pd=((at=u.media)==null?void 0:at.audioTracks)!==((Ji=v.media)==null?void 0:Ji.audioTracks),fd=((ji=u.media)==null?void 0:ji.remote)!==((ea=v.media)==null?void 0:ea.remote),vd=u.documentElement!==v.documentElement,Ed=!!u.media&&(cd||hi),bd=!!((ta=u.media)!=null&&ta.textTracks)&&(md||hi),gd=!!((ia=u.media)!=null&&ia.videoRenditions)&&(hd||hi),_d=!!((aa=u.media)!=null&&aa.audioTracks)&&(pd||hi),Ad=!!((ra=u.media)!=null&&ra.remote)&&(fd||hi),Td=!!u.documentElement&&(vd||hi),yd=Ed||bd||gd||_d||Ad||Td,pi=l.length===0&&T===1&&s,kd=!!v.media&&(cd||pi),Sd=!!((na=v.media)!=null&&na.textTracks)&&(md||pi),Id=!!((oa=v.media)!=null&&oa.videoRenditions)&&(hd||pi),Cd=!!((sa=v.media)!=null&&sa.audioTracks)&&(pd||pi),Md=!!((la=v.media)!=null&&la.remote)&&(fd||pi),Rd=!!v.documentElement&&(vd||pi),wd=kd||Sd||Id||Cd||Md||Rd;if(!(yd||wd)){Object.entries(v).forEach(([W,da])=>{u[W]=da}),g(),v=void 0;return}Object.entries(a).forEach(([W,{get:da,mediaEvents:nh=[],textTracksEvents:oh=[],videoRenditionsEvents:sh=[],audioTracksEvents:lh=[],remoteEvents:dh=[],rootEvents:uh=[],stateOwnersUpdateHandlers:ch=[]}])=>{f[W]||(f[W]={});let ge=z=>{let _e=da(u,z);b({[W]:_e})},ie;ie=f[W].mediaEvents,nh.forEach(z=>{ie&&Ed&&(u.media.removeEventListener(z,ie),f[W].mediaEvents=void 0),kd&&(v.media.addEventListener(z,ge),f[W].mediaEvents=ge)}),ie=f[W].textTracksEvents,oh.forEach(z=>{var _e,Ie;ie&&bd&&((_e=u.media.textTracks)==null||_e.removeEventListener(z,ie),f[W].textTracksEvents=void 0),Sd&&((Ie=v.media.textTracks)==null||Ie.addEventListener(z,ge),f[W].textTracksEvents=ge)}),ie=f[W].videoRenditionsEvents,sh.forEach(z=>{var _e,Ie;ie&&gd&&((_e=u.media.videoRenditions)==null||_e.removeEventListener(z,ie),f[W].videoRenditionsEvents=void 0),Id&&((Ie=v.media.videoRenditions)==null||Ie.addEventListener(z,ge),f[W].videoRenditionsEvents=ge)}),ie=f[W].audioTracksEvents,lh.forEach(z=>{var _e,Ie;ie&&_d&&((_e=u.media.audioTracks)==null||_e.removeEventListener(z,ie),f[W].audioTracksEvents=void 0),Cd&&((Ie=v.media.audioTracks)==null||Ie.addEventListener(z,ge),f[W].audioTracksEvents=ge)}),ie=f[W].remoteEvents,dh.forEach(z=>{var _e,Ie;ie&&Ad&&((_e=u.media.remote)==null||_e.removeEventListener(z,ie),f[W].remoteEvents=void 0),Md&&((Ie=v.media.remote)==null||Ie.addEventListener(z,ge),f[W].remoteEvents=ge)}),ie=f[W].rootEvents,uh.forEach(z=>{ie&&Td&&(u.documentElement.removeEventListener(z,ie),f[W].rootEvents=void 0),Rd&&(v.documentElement.addEventListener(z,ge),f[W].rootEvents=ge)});let Ld=f[W].stateOwnersUpdateHandlers;ch.forEach(z=>{Ld&&yd&&Ld(),wd&&(f[W].stateOwnersUpdateHandlers=z(ge,v))})}),Object.entries(v).forEach(([W,da])=>{u[W]=da}),g(),v=void 0};return L({media:t,fullscreenElement:e,documentElement:i,options:n}),{dispatch(A){let{type:T,detail:N}=A;if(r[T]&&c.mediaErrorCode==null){b(r[T](a,u,A));return}T==="mediaelementchangerequest"?L({media:N}):T==="fullscreenelementchangerequest"?L({fullscreenElement:N}):T==="documentelementchangerequest"?L({documentElement:N}):T==="optionschangerequest"&&Object.entries(N!=null?N:{}).forEach(([ee,be])=>{u.options[ee]=be})},getState(){return c},subscribe(A){return L({},l.length+1),l.push(A),A(c),()=>{let T=l.indexOf(A);T>=0&&(L({},l.length-1),l.splice(T,1))}}}},Eu=jh;var rs=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},w=(t,e,i)=>(rs(t,e,"read from private field"),i?i.call(t):e.get(t)),dt=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Tt=(t,e,i,a)=>(rs(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),yt=(t,e,i)=>(rs(t,e,"access private method"),i),kt,Ta,q,ya,Be,Wr,Fr,ts,ki,ka,Kr,is,Tu=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],bu=10,O={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"},Vr=class extends ba{constructor(){super(),dt(this,Fr),dt(this,ki),dt(this,Kr),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,dt(this,kt,new Ue(this,O.HOTKEYS)),dt(this,Ta,void 0),dt(this,q,void 0),dt(this,ya,void 0),dt(this,Be,void 0),dt(this,Wr,i=>{var a;(a=w(this,q))==null||a.dispatch(i)}),this.associateElement(this);let e={};Tt(this,ya,i=>{Object.entries(i).forEach(([a,r])=>{if(a in e&&e[a]===r)return;this.propagateMediaState(a,r);let n=a.toLowerCase(),s=new d.CustomEvent(Pd[n],{composed:!0,detail:r});this.dispatchEvent(s)}),e=i}),this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(O.NO_HOTKEYS,O.HOTKEYS,O.DEFAULT_STREAM_TYPE,O.DEFAULT_SUBTITLES,O.DEFAULT_DURATION)}get mediaStore(){return w(this,q)}set mediaStore(e){var i,a;if(w(this,q)&&((i=w(this,Be))==null||i.call(this),Tt(this,Be,void 0)),Tt(this,q,e),!w(this,q)&&!this.hasAttribute(O.NO_DEFAULT_STORE)){yt(this,Fr,ts).call(this);return}Tt(this,Be,(a=w(this,q))==null?void 0:a.subscribe(w(this,ya)))}get fullscreenElement(){var e;return(e=w(this,Ta))!=null?e:this}set fullscreenElement(e){var i;this.hasAttribute(O.FULLSCREEN_ELEMENT)&&this.removeAttribute(O.FULLSCREEN_ELEMENT),Tt(this,Ta,e),(i=w(this,q))==null||i.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}attributeChangedCallback(e,i,a){var r,n,s,l,u,c;if(super.attributeChangedCallback(e,i,a),e===O.NO_HOTKEYS)a!==i&&a===""?(this.hasAttribute(O.HOTKEYS)&&console.warn("Media Chrome: Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):a!==i&&a===null&&this.enableHotkeys();else if(e===O.HOTKEYS)w(this,kt).value=a;else if(e===O.DEFAULT_SUBTITLES&&a!==i)(r=w(this,q))==null||r.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(O.DEFAULT_SUBTITLES)}});else if(e===O.DEFAULT_STREAM_TYPE)(s=w(this,q))==null||s.dispatch({type:"optionschangerequest",detail:{defaultStreamType:(n=this.getAttribute(O.DEFAULT_STREAM_TYPE))!=null?n:void 0}});else if(e===O.LIVE_EDGE_OFFSET)(l=w(this,q))==null||l.dispatch({type:"optionschangerequest",detail:{liveEdgeOffset:this.hasAttribute(O.LIVE_EDGE_OFFSET)?+this.getAttribute(O.LIVE_EDGE_OFFSET):void 0}});else if(e===O.FULLSCREEN_ELEMENT){let b=a?(u=this.getRootNode())==null?void 0:u.getElementById(a):void 0;Tt(this,Ta,b),(c=w(this,q))==null||c.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}}connectedCallback(){var e,i;!w(this,q)&&!this.hasAttribute(O.NO_DEFAULT_STORE)&&yt(this,Fr,ts).call(this),(e=w(this,q))==null||e.dispatch({type:"documentelementchangerequest",detail:h}),super.connectedCallback(),w(this,q)&&!w(this,Be)&&Tt(this,Be,(i=w(this,q))==null?void 0:i.subscribe(w(this,ya))),this.enableHotkeys()}disconnectedCallback(){var e,i,a,r;(e=super.disconnectedCallback)==null||e.call(this),w(this,q)&&((i=w(this,q))==null||i.dispatch({type:"documentelementchangerequest",detail:void 0}),(a=w(this,q))==null||a.dispatch({type:p.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})),w(this,Be)&&((r=w(this,Be))==null||r.call(this),Tt(this,Be,void 0))}mediaSetCallback(e){var i;super.mediaSetCallback(e),(i=w(this,q))==null||i.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var i;super.mediaUnsetCallback(e),(i=w(this,q))==null||i.dispatch({type:"mediaelementchangerequest",detail:void 0})}propagateMediaState(e,i){Au(this.mediaStateReceivers,e,i)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:i}=this;if(i.has(e))return;let a=this.registerMediaStateReceiver.bind(this),r=this.unregisterMediaStateReceiver.bind(this),n=np(e,a,r);Object.values(p).forEach(s=>{e.addEventListener(s,w(this,Wr))}),i.set(e,n)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:i}=this;if(!i.has(e))return;i.get(e)(),i.delete(e),Object.values(p).forEach(r=>{e.removeEventListener(r,w(this,Wr))})}registerMediaStateReceiver(e){if(!e)return;let i=this.mediaStateReceivers;i.indexOf(e)>-1||(i.push(e),w(this,q)&&Object.entries(w(this,q).getState()).forEach(([r,n])=>{Au([e],r,n)}))}unregisterMediaStateReceiver(e){let i=this.mediaStateReceivers,a=i.indexOf(e);a<0||i.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",yt(this,Kr,is))}disableHotkeys(){this.removeEventListener("keydown",yt(this,Kr,is)),this.removeEventListener("keyup",yt(this,ki,ka))}get hotkeys(){return w(this,kt)}keyboardShortcutHandler(e){var i,a,r,n,s;let l=e.target;if(((r=(a=(i=l.getAttribute(O.KEYS_USED))==null?void 0:i.split(" "))!=null?a:l==null?void 0:l.keysUsed)!=null?r:[]).map(f=>f==="Space"?" ":f).filter(Boolean).includes(e.key))return;let c,b,g;if(!w(this,kt).contains(`no${e.key.toLowerCase()}`)&&!(e.key===" "&&w(this,kt).contains("nospace")))switch(e.key){case" ":case"k":c=w(this,q).getState().mediaPaused?p.MEDIA_PLAY_REQUEST:p.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new d.CustomEvent(c,{composed:!0,bubbles:!0}));break;case"m":c=this.mediaStore.getState().mediaVolumeLevel==="off"?p.MEDIA_UNMUTE_REQUEST:p.MEDIA_MUTE_REQUEST,this.dispatchEvent(new d.CustomEvent(c,{composed:!0,bubbles:!0}));break;case"f":c=this.mediaStore.getState().mediaIsFullscreen?p.MEDIA_EXIT_FULLSCREEN_REQUEST:p.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new d.CustomEvent(c,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new d.CustomEvent(p.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":{let f=this.hasAttribute(O.KEYBOARD_BACKWARD_SEEK_OFFSET)?+this.getAttribute(O.KEYBOARD_BACKWARD_SEEK_OFFSET):bu;b=Math.max(((n=this.mediaStore.getState().mediaCurrentTime)!=null?n:0)-f,0),g=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:b}),this.dispatchEvent(g);break}case"ArrowRight":{let f=this.hasAttribute(O.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(O.KEYBOARD_FORWARD_SEEK_OFFSET):bu;b=Math.max(((s=this.mediaStore.getState().mediaCurrentTime)!=null?s:0)+f,0),g=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:b}),this.dispatchEvent(g);break}default:break}}};kt=new WeakMap;Ta=new WeakMap;q=new WeakMap;ya=new WeakMap;Be=new WeakMap;Wr=new WeakMap;Fr=new WeakSet;ts=function(){var t;this.mediaStore=Eu({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(O.DEFAULT_SUBTITLES),defaultDuration:this.hasAttribute(O.DEFAULT_DURATION)?+this.getAttribute(O.DEFAULT_DURATION):void 0,defaultStreamType:(t=this.getAttribute(O.DEFAULT_STREAM_TYPE))!=null?t:void 0,liveEdgeOffset:this.hasAttribute(O.LIVE_EDGE_OFFSET)?+this.getAttribute(O.LIVE_EDGE_OFFSET):void 0,noVolumePref:this.hasAttribute(O.NO_VOLUME_PREF),noSubtitlesLangPref:this.hasAttribute(O.NO_SUBTITLES_LANG_PREF)}})};ki=new WeakSet;ka=function(t){let{key:e}=t;if(!Tu.includes(e)){this.removeEventListener("keyup",yt(this,ki,ka));return}this.keyboardShortcutHandler(t)};Kr=new WeakSet;is=function(t){let{metaKey:e,altKey:i,key:a}=t;if(e||i||!Tu.includes(a)){this.removeEventListener("keyup",yt(this,ki,ka));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(w(this,kt).contains(`no${a.toLowerCase()}`)||a===" "&&w(this,kt).contains("nospace"))&&t.preventDefault(),this.addEventListener("keyup",yt(this,ki,ka),{once:!0})};var ep=Object.values(o),tp=Object.values(Bo),yu=t=>{var e,i,a,r;let{observedAttributes:n}=t.constructor;!n&&((e=t.nodeName)!=null&&e.includes("-"))&&(d.customElements.upgrade(t),{observedAttributes:n}=t.constructor);let s=(r=(a=(i=t==null?void 0:t.getAttribute)==null?void 0:i.call(t,S.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(n||s)?(n||s).filter(l=>ep.includes(l)):[]},ip=t=>{var e,i;return(e=t.nodeName)!=null&&e.includes("-")&&d.customElements.get((i=t.nodeName)==null?void 0:i.toLowerCase())&&!(t instanceof d.customElements.get(t.nodeName.toLowerCase()))&&d.customElements.upgrade(t),tp.some(a=>a in t)},as=t=>ip(t)||!!yu(t).length,gu=t=>{var e;return(e=t==null?void 0:t.join)==null?void 0:e.call(t,":")},_u={[o.MEDIA_SUBTITLES_LIST]:lt,[o.MEDIA_SUBTITLES_SHOWING]:lt,[o.MEDIA_SEEKABLE]:gu,[o.MEDIA_BUFFERED]:t=>t==null?void 0:t.map(gu).join(" "),[o.MEDIA_PREVIEW_COORDS]:t=>t==null?void 0:t.join(" "),[o.MEDIA_RENDITION_LIST]:Bd,[o.MEDIA_AUDIO_TRACK_LIST]:$d},ap=async(t,e,i)=>{var a,r;if(t.isConnected||await Ar(0),typeof i=="boolean"||i==null)return U(t,e,i);if(typeof i=="number")return D(t,e,i);if(typeof i=="string")return I(t,e,i);if(Array.isArray(i)&&!i.length)return t.removeAttribute(e);let n=(r=(a=_u[e])==null?void 0:a.call(_u,i))!=null?r:i;return t.setAttribute(e,n)},rp=t=>{var e;return!!((e=t.closest)!=null&&e.call(t,'*[slot="media"]'))},Kt=(t,e)=>{if(rp(t))return;let i=(r,n)=>{var s,l;as(r)&&n(r);let{children:u=[]}=r!=null?r:{},c=(l=(s=r==null?void 0:r.shadowRoot)==null?void 0:s.children)!=null?l:[];[...u,...c].forEach(g=>Kt(g,n))},a=t==null?void 0:t.nodeName.toLowerCase();if(a.includes("-")&&!as(t)){d.customElements.whenDefined(a).then(()=>{i(t,e)});return}i(t,e)},Au=(t,e,i)=>{t.forEach(a=>{if(e in a){a[e]=i;return}let r=yu(a),n=e.toLowerCase();r.includes(n)&&ap(a,n,i)})},np=(t,e,i)=>{Kt(t,e);let a=b=>{var g;let f=(g=b==null?void 0:b.composedPath()[0])!=null?g:b.target;e(f)},r=b=>{var g;let f=(g=b==null?void 0:b.composedPath()[0])!=null?g:b.target;i(f)};t.addEventListener(p.REGISTER_MEDIA_STATE_RECEIVER,a),t.addEventListener(p.UNREGISTER_MEDIA_STATE_RECEIVER,r);let n=b=>{b.forEach(g=>{let{addedNodes:f=[],removedNodes:v=[],type:L,target:A,attributeName:T}=g;L==="childList"?(Array.prototype.forEach.call(f,N=>Kt(N,e)),Array.prototype.forEach.call(v,N=>Kt(N,i))):L==="attributes"&&T===S.MEDIA_CHROME_ATTRIBUTES&&(as(A)?e(A):i(A))})},s=[],l=b=>{let g=b.target;g.name!=="media"&&(s.forEach(f=>Kt(f,i)),s=[...g.assignedElements({flatten:!0})],s.forEach(f=>Kt(f,e)))};t.addEventListener("slotchange",l);let u=new MutationObserver(n);return u.observe(t,{childList:!0,attributes:!0,subtree:!0}),()=>{Kt(t,i),t.removeEventListener("slotchange",l),u.disconnect(),t.removeEventListener(p.REGISTER_MEDIA_STATE_RECEIVER,a),t.removeEventListener(p.UNREGISTER_MEDIA_STATE_RECEIVER,r)}};d.customElements.get("media-controller")||d.customElements.define("media-controller",Vr);var ns=Vr;var ss=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},j=(t,e,i)=>(ss(t,e,"read from private field"),i?i.call(t):e.get(t)),Si=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Yr=(t,e,i,a)=>(ss(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),op=(t,e,i)=>(ss(t,e,"access private method"),i),He,Ci,St,Ii,qr,os,ku,Gr={TOOLTIP_PLACEMENT:"tooltipplacement"},Su=h.createElement("template");Su.innerHTML=`
146
149
  <style>
147
150
  :host {
148
151
  position: relative;
@@ -217,10 +220,10 @@
217
220
  <slot name="tooltip-content"></slot>
218
221
  </media-tooltip>
219
222
  </slot>
220
- `;var F=class extends d.HTMLElement{constructor(e={}){var t;if(super(),Si(this,rs),Si(this,We,void 0),this.preventClick=!1,this.tooltipEl=null,this.tooltipContent="",Si(this,Ci,a=>{this.preventClick||this.handleClick(a),setTimeout(ee(this,Ct),0)}),Si(this,Ct,()=>{var a,r;(r=(a=this.tooltipEl)==null?void 0:a.updateXOffset)==null||r.call(a)}),Si(this,Ii,a=>{let{key:r}=a;if(!this.keysUsed.includes(r)){this.removeEventListener("keyup",ee(this,Ii));return}this.preventClick||this.handleClick(a)}),Si(this,Qr,a=>{let{metaKey:r,altKey:n,key:s}=a;if(r||n||!this.keysUsed.includes(s)){this.removeEventListener("keyup",ee(this,Ii));return}this.addEventListener("keyup",ee(this,Ii),{once:!0})}),!this.shadowRoot){this.attachShadow({mode:"open"});let a=Eu.content.cloneNode(!0);this.nativeEl=a;let r=e.slotTemplate;r||(r=m.createElement("template"),r.innerHTML=`<slot>${e.defaultContent||""}</slot>`),e.tooltipContent&&(a.querySelector('slot[name="tooltip-content"]').innerHTML=(t=e.tooltipContent)!=null?t:"",this.tooltipContent=e.tooltipContent),this.nativeEl.appendChild(r.content.cloneNode(!0)),this.shadowRoot.appendChild(a)}this.tooltipEl=this.shadowRoot.querySelector("media-tooltip")}static get observedAttributes(){return["disabled",Zr.TOOLTIP_PLACEMENT,k.MEDIA_CONTROLLER]}enable(){this.addEventListener("click",ee(this,Ci)),this.addEventListener("keydown",ee(this,Qr)),this.tabIndex=0}disable(){this.removeEventListener("click",ee(this,Ci)),this.removeEventListener("keydown",ee(this,Qr)),this.removeEventListener("keyup",ee(this,Ii)),this.tabIndex=-1}attributeChangedCallback(e,t,a){var r,n,s,l,u;e===k.MEDIA_CONTROLLER?(t&&((n=(r=ee(this,We))==null?void 0:r.unassociateElement)==null||n.call(r,this),qr(this,We,null)),a&&this.isConnected&&(qr(this,We,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=ee(this,We))==null?void 0:l.associateElement)==null||u.call(l,this))):e==="disabled"&&a!==t?a==null?this.enable():this.disable():e===Zr.TOOLTIP_PLACEMENT&&this.tooltipEl&&a!==t&&(this.tooltipEl.placement=a),ee(this,Ct).call(this)}connectedCallback(){var e,t,a;let{style:r}=W(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(k.MEDIA_CONTROLLER);n&&(qr(this,We,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(t=ee(this,We))==null?void 0:t.associateElement)==null||a.call(t,this)),d.customElements.whenDefined("media-tooltip").then(()=>Jh(this,rs,fu).call(this))}disconnectedCallback(){var e,t;this.disable(),(t=(e=ee(this,We))==null?void 0:e.unassociateElement)==null||t.call(e,this),qr(this,We,null),this.removeEventListener("mouseenter",ee(this,Ct)),this.removeEventListener("focus",ee(this,Ct)),this.removeEventListener("click",ee(this,Ci))}get keysUsed(){return["Enter"," "]}get tooltipPlacement(){return x(this,Zr.TOOLTIP_PLACEMENT)}set tooltipPlacement(e){M(this,Zr.TOOLTIP_PLACEMENT,e)}handleClick(e){}};We=new WeakMap;Ci=new WeakMap;Ct=new WeakMap;Ii=new WeakMap;Qr=new WeakMap;rs=new WeakSet;fu=function(){this.addEventListener("mouseenter",ee(this,Ct)),this.addEventListener("focus",ee(this,Ct)),this.addEventListener("click",ee(this,Ci));let i=this.tooltipPlacement;i&&this.tooltipEl&&(this.tooltipEl.placement=i)};d.customElements.get("media-chrome-button")||d.customElements.define("media-chrome-button",F);var bu=`<svg aria-hidden="true" viewBox="0 0 26 24">
223
+ `;var F=class extends d.HTMLElement{constructor(e={}){var i;if(super(),Si(this,os),Si(this,He,void 0),this.preventClick=!1,this.tooltipEl=null,this.tooltipContent="",Si(this,Ci,a=>{this.preventClick||this.handleClick(a),setTimeout(j(this,St),0)}),Si(this,St,()=>{var a,r;(r=(a=this.tooltipEl)==null?void 0:a.updateXOffset)==null||r.call(a)}),Si(this,Ii,a=>{let{key:r}=a;if(!this.keysUsed.includes(r)){this.removeEventListener("keyup",j(this,Ii));return}this.preventClick||this.handleClick(a)}),Si(this,qr,a=>{let{metaKey:r,altKey:n,key:s}=a;if(r||n||!this.keysUsed.includes(s)){this.removeEventListener("keyup",j(this,Ii));return}this.addEventListener("keyup",j(this,Ii),{once:!0})}),!this.shadowRoot){this.attachShadow({mode:"open"});let a=Su.content.cloneNode(!0);this.nativeEl=a;let r=e.slotTemplate;r||(r=h.createElement("template"),r.innerHTML=`<slot>${e.defaultContent||""}</slot>`),e.tooltipContent&&(a.querySelector('slot[name="tooltip-content"]').innerHTML=(i=e.tooltipContent)!=null?i:"",this.tooltipContent=e.tooltipContent),this.nativeEl.appendChild(r.content.cloneNode(!0)),this.shadowRoot.appendChild(a)}this.tooltipEl=this.shadowRoot.querySelector("media-tooltip")}static get observedAttributes(){return["disabled",Gr.TOOLTIP_PLACEMENT,S.MEDIA_CONTROLLER]}enable(){this.addEventListener("click",j(this,Ci)),this.addEventListener("keydown",j(this,qr)),this.tabIndex=0}disable(){this.removeEventListener("click",j(this,Ci)),this.removeEventListener("keydown",j(this,qr)),this.removeEventListener("keyup",j(this,Ii)),this.tabIndex=-1}attributeChangedCallback(e,i,a){var r,n,s,l,u;e===S.MEDIA_CONTROLLER?(i&&((n=(r=j(this,He))==null?void 0:r.unassociateElement)==null||n.call(r,this),Yr(this,He,null)),a&&this.isConnected&&(Yr(this,He,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=j(this,He))==null?void 0:l.associateElement)==null||u.call(l,this))):e==="disabled"&&a!==i?a==null?this.enable():this.disable():e===Gr.TOOLTIP_PLACEMENT&&this.tooltipEl&&a!==i&&(this.tooltipEl.placement=a),j(this,St).call(this)}connectedCallback(){var e,i,a;let{style:r}=$(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(S.MEDIA_CONTROLLER);n&&(Yr(this,He,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(i=j(this,He))==null?void 0:i.associateElement)==null||a.call(i,this)),d.customElements.whenDefined("media-tooltip").then(()=>op(this,os,ku).call(this))}disconnectedCallback(){var e,i;this.disable(),(i=(e=j(this,He))==null?void 0:e.unassociateElement)==null||i.call(e,this),Yr(this,He,null),this.removeEventListener("mouseenter",j(this,St)),this.removeEventListener("focus",j(this,St)),this.removeEventListener("click",j(this,Ci))}get keysUsed(){return["Enter"," "]}get tooltipPlacement(){return R(this,Gr.TOOLTIP_PLACEMENT)}set tooltipPlacement(e){I(this,Gr.TOOLTIP_PLACEMENT,e)}handleClick(e){}};He=new WeakMap;Ci=new WeakMap;St=new WeakMap;Ii=new WeakMap;qr=new WeakMap;os=new WeakSet;ku=function(){this.addEventListener("mouseenter",j(this,St)),this.addEventListener("focus",j(this,St)),this.addEventListener("click",j(this,Ci));let t=this.tooltipPlacement;t&&this.tooltipEl&&(this.tooltipEl.placement=t)};d.customElements.get("media-chrome-button")||d.customElements.define("media-chrome-button",F);var Iu=`<svg aria-hidden="true" viewBox="0 0 26 24">
221
224
  <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"/>
222
225
  </svg>
223
- `,_u=m.createElement("template");_u.innerHTML=`
226
+ `,Mu=h.createElement("template");Mu.innerHTML=`
224
227
  <style>
225
228
  :host([${o.MEDIA_IS_AIRPLAYING}]) slot[name=icon] slot:not([name=exit]) {
226
229
  display: none !important;
@@ -238,17 +241,17 @@
238
241
  </style>
239
242
 
240
243
  <slot name="icon">
241
- <slot name="enter">${bu}</slot>
242
- <slot name="exit">${bu}</slot>
244
+ <slot name="enter">${Iu}</slot>
245
+ <slot name="exit">${Iu}</slot>
243
246
  </slot>
244
- `;var jh=`
245
- <slot name="tooltip-enter">${I.ENTER_AIRPLAY}</slot>
246
- <slot name="tooltip-exit">${I.EXIT_AIRPLAY}</slot>
247
- `,gu=i=>{let e=i.mediaIsAirplaying?Y.EXIT_AIRPLAY():Y.ENTER_AIRPLAY();i.setAttribute("aria-label",e)},os=class extends F{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_AIRPLAYING,o.MEDIA_AIRPLAY_UNAVAILABLE]}constructor(e={}){super({slotTemplate:_u,tooltipContent:jh,...e})}connectedCallback(){super.connectedCallback(),gu(this)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_IS_AIRPLAYING&&gu(this)}get mediaIsAirplaying(){return H(this,o.MEDIA_IS_AIRPLAYING)}set mediaIsAirplaying(e){B(this,o.MEDIA_IS_AIRPLAYING,e)}get mediaAirplayUnavailable(){return x(this,o.MEDIA_AIRPLAY_UNAVAILABLE)}set mediaAirplayUnavailable(e){M(this,o.MEDIA_AIRPLAY_UNAVAILABLE,e)}handleClick(){let e=new d.CustomEvent(p.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};d.customElements.get("media-airplay-button")||d.customElements.define("media-airplay-button",os);var ep=`<svg aria-hidden="true" viewBox="0 0 26 24">
247
+ `;var sp=`
248
+ <slot name="tooltip-enter">${C.ENTER_AIRPLAY}</slot>
249
+ <slot name="tooltip-exit">${C.EXIT_AIRPLAY}</slot>
250
+ `,Cu=t=>{let e=t.mediaIsAirplaying?Y.EXIT_AIRPLAY():Y.ENTER_AIRPLAY();t.setAttribute("aria-label",e)},ls=class extends F{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_AIRPLAYING,o.MEDIA_AIRPLAY_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Mu,tooltipContent:sp,...e})}connectedCallback(){super.connectedCallback(),Cu(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_IS_AIRPLAYING&&Cu(this)}get mediaIsAirplaying(){return H(this,o.MEDIA_IS_AIRPLAYING)}set mediaIsAirplaying(e){U(this,o.MEDIA_IS_AIRPLAYING,e)}get mediaAirplayUnavailable(){return R(this,o.MEDIA_AIRPLAY_UNAVAILABLE)}set mediaAirplayUnavailable(e){I(this,o.MEDIA_AIRPLAY_UNAVAILABLE,e)}handleClick(){let e=new d.CustomEvent(p.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};d.customElements.get("media-airplay-button")||d.customElements.define("media-airplay-button",ls);var lp=`<svg aria-hidden="true" viewBox="0 0 26 24">
248
251
  <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"/>
249
- </svg>`,tp=`<svg aria-hidden="true" viewBox="0 0 26 24">
252
+ </svg>`,dp=`<svg aria-hidden="true" viewBox="0 0 26 24">
250
253
  <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"/>
251
- </svg>`,ku=m.createElement("template");ku.innerHTML=`
254
+ </svg>`,xu=h.createElement("template");xu.innerHTML=`
252
255
  <style>
253
256
  :host([aria-checked="true"]) slot[name=off] {
254
257
  display: none !important;
@@ -266,13 +269,13 @@
266
269
  </style>
267
270
 
268
271
  <slot name="icon">
269
- <slot name="on">${ep}</slot>
270
- <slot name="off">${tp}</slot>
272
+ <slot name="on">${lp}</slot>
273
+ <slot name="off">${dp}</slot>
271
274
  </slot>
272
- `;var ip=`
273
- <slot name="tooltip-enable">${I.ENABLE_CAPTIONS}</slot>
274
- <slot name="tooltip-disable">${I.DISABLE_CAPTIONS}</slot>
275
- `,Au=i=>{i.setAttribute("aria-checked",Br(i).toString())},ss=class extends F{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}constructor(e={}){super({slotTemplate:ku,tooltipContent:ip,...e}),this._captionsReady=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",V.CLOSED_CAPTIONS()),Au(this)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_SUBTITLES_SHOWING&&Au(this)}get mediaSubtitlesList(){return Tu(this,o.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){yu(this,o.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Tu(this,o.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){yu(this,o.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){this.dispatchEvent(new d.CustomEvent(p.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}))}},Tu=(i,e)=>{let t=i.getAttribute(e);return t?Kt(t):[]},yu=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let a=ut(t);i.getAttribute(e)!==a&&i.setAttribute(e,a)};d.customElements.get("media-captions-button")||d.customElements.define("media-captions-button",ss);var ap='<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>',rp='<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>',Iu=m.createElement("template");Iu.innerHTML=`
275
+ `;var up=`
276
+ <slot name="tooltip-enable">${C.ENABLE_CAPTIONS}</slot>
277
+ <slot name="tooltip-disable">${C.DISABLE_CAPTIONS}</slot>
278
+ `,Ru=t=>{t.setAttribute("aria-checked",Pr(t).toString())},ds=class extends F{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}constructor(e={}){super({slotTemplate:xu,tooltipContent:up,...e}),this._captionsReady=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",V.CLOSED_CAPTIONS()),Ru(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_SUBTITLES_SHOWING&&Ru(this)}get mediaSubtitlesList(){return wu(this,o.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Lu(this,o.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return wu(this,o.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Lu(this,o.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){this.dispatchEvent(new d.CustomEvent(p.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}))}},wu=(t,e)=>{let i=t.getAttribute(e);return i?$t(i):[]},Lu=(t,e,i)=>{if(!(i!=null&&i.length)){t.removeAttribute(e);return}let a=lt(i);t.getAttribute(e)!==a&&t.setAttribute(e,a)};d.customElements.get("media-captions-button")||d.customElements.define("media-captions-button",ds);var cp='<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>',mp='<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>',Ou=h.createElement("template");Ou.innerHTML=`
276
279
  <style>
277
280
  :host([${o.MEDIA_IS_CASTING}]) slot[name=icon] slot:not([name=exit]) {
278
281
  display: none !important;
@@ -290,50 +293,57 @@
290
293
  </style>
291
294
 
292
295
  <slot name="icon">
293
- <slot name="enter">${ap}</slot>
294
- <slot name="exit">${rp}</slot>
296
+ <slot name="enter">${cp}</slot>
297
+ <slot name="exit">${mp}</slot>
295
298
  </slot>
296
- `;var np=`
297
- <slot name="tooltip-enter">${I.START_CAST}</slot>
298
- <slot name="tooltip-exit">${I.STOP_CAST}</slot>
299
- `,Su=i=>{let e=i.mediaIsCasting?Y.EXIT_CAST():Y.ENTER_CAST();i.setAttribute("aria-label",e)},ls=class extends F{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_CASTING,o.MEDIA_CAST_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Iu,tooltipContent:np,...e})}connectedCallback(){super.connectedCallback(),Su(this)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_IS_CASTING&&Su(this)}get mediaIsCasting(){return H(this,o.MEDIA_IS_CASTING)}set mediaIsCasting(e){B(this,o.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return x(this,o.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){M(this,o.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){let e=this.mediaIsCasting?p.MEDIA_EXIT_CAST_REQUEST:p.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-cast-button")||d.customElements.define("media-cast-button",ls);var vs=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Mi=(i,e,t)=>(vs(i,e,"read from private field"),t?t.call(i):e.get(i)),qt=(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)},Cu=(i,e,t,a)=>(vs(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ra=(i,e,t)=>(vs(i,e,"access private method"),t),wa,Zt,us,Mu,cs,Lu,ms,Ru,hs,wu,ps,xu,Du=m.createElement("template");Du.innerHTML=`
300
- <style>
301
- :host {
302
- font: var(--media-font,
303
- var(--media-font-weight, normal)
304
- var(--media-font-size, 14px) /
305
- var(--media-text-content-height, var(--media-control-height, 24px))
306
- var(--media-font-family, helvetica neue, segoe ui, roboto, arial, sans-serif));
307
- color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));
308
- background: var(--media-dialog-background, var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .8))));
309
- border-radius: var(--media-dialog-border-radius);
310
- border: var(--media-dialog-border, none);
311
- display: var(--media-dialog-display, inline-flex);
312
- transition: var(--media-dialog-transition-in,
313
- visibility 0s,
314
- opacity .2s ease-out,
315
- transform .15s ease-out
316
- ) !important;
317
-
318
- visibility: var(--media-dialog-visibility, visible);
319
- opacity: var(--media-dialog-opacity, 1);
320
- transform: var(--media-dialog-transform-in, translateY(0) scale(1));
321
- }
299
+ `;var hp=`
300
+ <slot name="tooltip-enter">${C.START_CAST}</slot>
301
+ <slot name="tooltip-exit">${C.STOP_CAST}</slot>
302
+ `,Du=t=>{let e=t.mediaIsCasting?Y.EXIT_CAST():Y.ENTER_CAST();t.setAttribute("aria-label",e)},us=class extends F{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_CASTING,o.MEDIA_CAST_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Ou,tooltipContent:hp,...e})}connectedCallback(){super.connectedCallback(),Du(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_IS_CASTING&&Du(this)}get mediaIsCasting(){return H(this,o.MEDIA_IS_CASTING)}set mediaIsCasting(e){U(this,o.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return R(this,o.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){I(this,o.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){let e=this.mediaIsCasting?p.MEDIA_EXIT_CAST_REQUEST:p.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-cast-button")||d.customElements.define("media-cast-button",us);var Es=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Yt=(t,e,i)=>(Es(t,e,"read from private field"),i?i.call(t):e.get(t)),ut=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},bs=(t,e,i,a)=>(Es(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Vt=(t,e,i)=>(Es(t,e,"access private method"),i),Qr,Ia,Gt,Zr,cs,ms,Nu,hs,Pu,ps,Uu,fs,Bu,vs,Hu;function pp(t){return`
303
+ <style>
304
+ :host {
305
+ font: var(--media-font,
306
+ var(--media-font-weight, normal)
307
+ var(--media-font-size, 14px) /
308
+ var(--media-text-content-height, var(--media-control-height, 24px))
309
+ var(--media-font-family, helvetica neue, segoe ui, roboto, arial, sans-serif));
310
+ color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));
311
+ display: var(--media-dialog-display, inline-flex);
312
+ justify-content: center;
313
+ align-items: center;
314
+ transition: display .15s, opacity .15s ease-in, transform .15s ease-in;
315
+ transition-behavior: allow-discrete;
316
+ opacity: 0;
317
+ transform: translateY(2px) scale(.99);
318
+ pointer-events: none;
319
+ }
322
320
 
323
- :host([hidden]) {
324
- transition: var(--media-dialog-transition-out,
325
- visibility .15s ease-in,
326
- opacity .15s ease-in,
327
- transform .15s ease-in
328
- ) !important;
329
- visibility: var(--media-dialog-hidden-visibility, hidden);
330
- opacity: var(--media-dialog-hidden-opacity, 0);
331
- transform: var(--media-dialog-transform-out, translateY(2px) scale(.99));
332
- pointer-events: none;
333
- }
334
- </style>
335
- <slot></slot>
336
- `;var ds={HIDDEN:"hidden",ANCHOR:"anchor"},zr=class extends d.HTMLElement{constructor(){super(),qt(this,us),qt(this,cs),qt(this,ms),qt(this,hs),qt(this,ps),qt(this,wa,null),qt(this,Zt,null),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[ds.HIDDEN,ds.ANCHOR]}handleEvent(e){switch(e.type){case"invoke":Ra(this,ms,Ru).call(this,e);break;case"focusout":Ra(this,hs,wu).call(this,e);break;case"keydown":Ra(this,ps,xu).call(this,e);break}}connectedCallback(){this.role||(this.role="dialog")}attributeChangedCallback(e,t,a){e===ds.HIDDEN&&a!==t&&(this.hidden?Ra(this,cs,Lu).call(this):Ra(this,us,Mu).call(this))}focus(){Cu(this,wa,ba());let e=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');e==null||e.focus()}get keysUsed(){return["Escape","Tab"]}};wa=new WeakMap;Zt=new WeakMap;us=new WeakSet;Mu=function(){var i;(i=Mi(this,Zt))==null||i.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0})};cs=new WeakSet;Lu=function(){var i;(i=Mi(this,Zt))==null||i.setAttribute("aria-expanded","false")};ms=new WeakSet;Ru=function(i){Cu(this,Zt,i.relatedTarget),ce(this,i.relatedTarget)||(this.hidden=!this.hidden)};hs=new WeakSet;wu=function(i){var e;ce(this,i.relatedTarget)||((e=Mi(this,wa))==null||e.focus(),Mi(this,Zt)&&Mi(this,Zt)!==i.relatedTarget&&!this.hidden&&(this.hidden=!0))};ps=new WeakSet;xu=function(i){var e,t,a,r,n;let{key:s,ctrlKey:l,altKey:u,metaKey:c}=i;l||u||c||this.keysUsed.includes(s)&&(i.preventDefault(),i.stopPropagation(),s==="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()):s==="Escape"&&((n=Mi(this,wa))==null||n.focus(),this.hidden=!0))};zr.template=Du;d.customElements.get("media-chrome-dialog")||d.customElements.define("media-chrome-dialog",zr);var Ts=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},z=(i,e,t)=>(Ts(i,e,"read from private field"),t?t.call(i):e.get(i)),se=(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)=>(Ts(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Re=(i,e,t)=>(Ts(i,e,"access private method"),t),$e,sn,Xr,Jr,we,nn,jr,en,tn,ys,Ou,an,fs,rn,Es,on,ks,bs,Nu,gs,Pu,_s,Uu,As,Bu,Hu=m.createElement("template");Hu.innerHTML=`
321
+ :host([open]) {
322
+ transition: display .2s, opacity .2s ease-out, transform .15s ease-out;
323
+ transition-behavior: allow-discrete;
324
+ opacity: 1;
325
+ transform: translateY(0) scale(1);
326
+ pointer-events: auto;
327
+ }
328
+
329
+ #content {
330
+ display: flex;
331
+ position: relative;
332
+ box-sizing: border-box;
333
+ width: min(320px, 100%);
334
+ word-wrap: break-word;
335
+ max-height: 100%;
336
+ overflow: auto;
337
+ text-align: center;
338
+ line-height: 1.4;
339
+ }
340
+ </style>
341
+ ${this.getSlotTemplateHTML(t)}
342
+ `}function fp(t){return`
343
+ <slot id="content"></slot>
344
+ `}var Sa={OPEN:"open",ANCHOR:"anchor"},qt=class extends d.HTMLElement{constructor(){super(),ut(this,Zr),ut(this,ms),ut(this,hs),ut(this,ps),ut(this,fs),ut(this,vs),ut(this,Qr,!1),ut(this,Ia,null),ut(this,Gt,null),this.addEventListener("invoke",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this)}static get observedAttributes(){return[Sa.OPEN,Sa.ANCHOR]}get open(){return H(this,Sa.OPEN)}set open(e){U(this,Sa.OPEN,e)}handleEvent(e){switch(e.type){case"invoke":Vt(this,ps,Uu).call(this,e);break;case"focusout":Vt(this,fs,Bu).call(this,e);break;case"keydown":Vt(this,vs,Hu).call(this,e);break}}connectedCallback(){Vt(this,Zr,cs).call(this),this.role||(this.role="dialog")}attributeChangedCallback(e,i,a){Vt(this,Zr,cs).call(this),e===Sa.OPEN&&a!==i&&(this.open?Vt(this,ms,Nu).call(this):Vt(this,hs,Pu).call(this))}focus(){bs(this,Ia,ha());let e=!this.dispatchEvent(new Event("focus",{composed:!0,cancelable:!0})),i=!this.dispatchEvent(new Event("focusin",{composed:!0,bubbles:!0,cancelable:!0}));if(e||i)return;let a=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');a==null||a.focus()}get keysUsed(){return["Escape","Tab"]}};Qr=new WeakMap;Ia=new WeakMap;Gt=new WeakMap;Zr=new WeakSet;cs=function(){if(!Yt(this,Qr)&&(bs(this,Qr,!0),!this.shadowRoot)){this.attachShadow({mode:"open"});let t=Qd(this.attributes);this.shadowRoot.innerHTML=`
345
+ ${this.constructor.getTemplateHTML(t)}
346
+ `}};ms=new WeakSet;Nu=function(){var t;(t=Yt(this,Gt))==null||t.setAttribute("aria-expanded","true"),this.dispatchEvent(new Event("open",{composed:!0,bubbles:!0})),this.addEventListener("transitionend",()=>this.focus(),{once:!0})};hs=new WeakSet;Pu=function(){var t;(t=Yt(this,Gt))==null||t.setAttribute("aria-expanded","false"),this.dispatchEvent(new Event("close",{composed:!0,bubbles:!0}))};ps=new WeakSet;Uu=function(t){bs(this,Gt,t.relatedTarget),ue(this,t.relatedTarget)||(this.open=!this.open)};fs=new WeakSet;Bu=function(t){var e;ue(this,t.relatedTarget)||((e=Yt(this,Ia))==null||e.focus(),Yt(this,Gt)&&Yt(this,Gt)!==t.relatedTarget&&this.open&&(this.open=!1))};vs=new WeakSet;Hu=function(t){var e,i,a,r,n;let{key:s,ctrlKey:l,altKey:u,metaKey:c}=t;l||u||c||this.keysUsed.includes(s)&&(t.preventDefault(),t.stopPropagation(),s==="Tab"?(t.shiftKey?(i=(e=this.previousElementSibling)==null?void 0:e.focus)==null||i.call(e):(r=(a=this.nextElementSibling)==null?void 0:a.focus)==null||r.call(a),this.blur()):s==="Escape"&&((n=Yt(this,Ia))==null||n.focus(),this.open=!1))};qt.getTemplateHTML=pp;qt.getSlotTemplateHTML=fp;d.customElements.get("media-chrome-dialog")||d.customElements.define("media-chrome-dialog",qt);var Ss=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Q=(t,e,i)=>(Ss(t,e,"read from private field"),i?i.call(t):e.get(t)),oe=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},It=(t,e,i,a)=>(Ss(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Re=(t,e,i)=>(Ss(t,e,"access private method"),i),$e,on,zr,Xr,we,rn,Jr,jr,en,Is,$u,tn,gs,an,_s,nn,Cs,As,Wu,Ts,Fu,ys,Ku,ks,Vu,Yu=h.createElement("template");Yu.innerHTML=`
337
347
  <style>
338
348
  :host {
339
349
  --_focus-box-shadow: var(--media-focus-box-shadow, inset 0 0 0 2px rgb(27 127 204 / .9));
@@ -353,7 +363,6 @@
353
363
  cursor: pointer;
354
364
  pointer-events: auto;
355
365
  touch-action: none;
356
- z-index: 1;
357
366
  }
358
367
 
359
368
 
@@ -556,7 +565,7 @@
556
565
  <input id="range" type="range" min="0" max="1" step="any" value="0">
557
566
  </div>
558
567
  <div id="rightgap"></div>
559
- `;var Qt=class extends d.HTMLElement{constructor(){super(),se(this,ys),se(this,an),se(this,rn),se(this,on),se(this,bs),se(this,gs),se(this,_s),se(this,As),se(this,$e,void 0),se(this,sn,void 0),se(this,Xr,void 0),se(this,Jr,void 0),se(this,we,{}),se(this,nn,[]),se(this,jr,()=>{if(this.range.matches(":focus-visible")){let{style:e}=W(this.shadowRoot,":host");e.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),se(this,en,()=>{let{style:e}=W(this.shadowRoot,":host");e.removeProperty("--_focus-visible-box-shadow")}),se(this,tn,()=>{let e=this.shadowRoot.querySelector("#segments-clipping");e&&e.parentNode.append(e)}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Hu.content.cloneNode(!0))),this.container=this.shadowRoot.querySelector("#container"),Mt(this,Xr,this.shadowRoot.querySelector("#startpoint")),Mt(this,Jr,this.shadowRoot.querySelector("#endpoint")),this.range=this.shadowRoot.querySelector("#range"),this.appearance=this.shadowRoot.querySelector("#appearance")}static get observedAttributes(){return["disabled","aria-disabled",k.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n,s,l,u;e===k.MEDIA_CONTROLLER?(t&&((n=(r=z(this,$e))==null?void 0:r.unassociateElement)==null||n.call(r,this),Mt(this,$e,null)),a&&this.isConnected&&(Mt(this,$e,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=z(this,$e))==null?void 0:l.associateElement)==null||u.call(l,this))):(e==="disabled"||e==="aria-disabled"&&t!==a)&&(a==null?(this.range.removeAttribute(e),Re(this,an,fs).call(this)):(this.range.setAttribute(e,a),Re(this,rn,Es).call(this)))}connectedCallback(){var e,t,a;let{style:r}=W(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),z(this,we).pointer=W(this.shadowRoot,"#pointer"),z(this,we).progress=W(this.shadowRoot,"#progress"),z(this,we).thumb=W(this.shadowRoot,"#thumb"),z(this,we).activeSegment=W(this.shadowRoot,"#segments-clipping rect:nth-child(0)");let n=this.getAttribute(k.MEDIA_CONTROLLER);n&&(Mt(this,$e,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(t=z(this,$e))==null?void 0:t.associateElement)==null||a.call(t,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",z(this,jr)),this.shadowRoot.addEventListener("focusout",z(this,en)),Re(this,an,fs).call(this),st(this.container,z(this,tn))}disconnectedCallback(){var e,t;Re(this,rn,Es).call(this),(t=(e=z(this,$e))==null?void 0:e.unassociateElement)==null||t.call(e,this),Mt(this,$e,null),this.shadowRoot.removeEventListener("focusin",z(this,jr)),this.shadowRoot.removeEventListener("focusout",z(this,en)),Wt(this.container,z(this,tn))}updatePointerBar(e){var t;(t=z(this,we).pointer)==null||t.style.setProperty("width",`${this.getPointerRatio(e)*100}%`)}updateBar(){var e,t;let a=this.range.valueAsNumber*100;(e=z(this,we).progress)==null||e.style.setProperty("width",`${a}%`),(t=z(this,we).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;let a=[...new Set([+this.range.min,...e.flatMap(n=>[n.start,n.end]),+this.range.max])];Mt(this,nn,[...a]);let r=a.pop();for(let[n,s]of a.entries()){let[l,u]=[n===0,n===a.length-1],c=l?"calc(var(--segments-gap) / -1)":`${s*100}%`,g=`calc(${((u?r:a[n+1])-s)*100}%${l||u?"":" - var(--segments-gap)"})`,v=m.createElementNS("http://www.w3.org/2000/svg","rect"),f=W(this.shadowRoot,`#segments-clipping rect:nth-child(${n+1})`);f.style.setProperty("x",c),f.style.setProperty("width",g),t.append(v)}}getPointerRatio(e){let t=Fd(e.clientX,e.clientY,z(this,Xr).getBoundingClientRect(),z(this,Jr).getBoundingClientRect());return Math.max(0,Math.min(1,t))}get dragging(){return this.hasAttribute("dragging")}handleEvent(e){switch(e.type){case"pointermove":Re(this,As,Bu).call(this,e);break;case"input":this.updateBar();break;case"pointerenter":Re(this,bs,Nu).call(this,e);break;case"pointerdown":Re(this,on,ks).call(this,e);break;case"pointerup":Re(this,gs,Pu).call(this);break;case"pointerleave":Re(this,_s,Uu).call(this);break}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};$e=new WeakMap;sn=new WeakMap;Xr=new WeakMap;Jr=new WeakMap;we=new WeakMap;nn=new WeakMap;jr=new WeakMap;en=new WeakMap;tn=new WeakMap;ys=new WeakSet;Ou=function(i){let e=z(this,we).activeSegment;if(!e)return;let t=this.getPointerRatio(i),r=`#segments-clipping rect:nth-child(${z(this,nn).findIndex((n,s,l)=>{let u=l[s+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))"))};an=new WeakSet;fs=function(){this.hasAttribute("disabled")||(this.addEventListener("input",this),this.addEventListener("pointerdown",this),this.addEventListener("pointerenter",this))};rn=new WeakSet;Es=function(){var i,e;this.removeEventListener("input",this),this.removeEventListener("pointerdown",this),this.removeEventListener("pointerenter",this),(i=d.window)==null||i.removeEventListener("pointerup",this),(e=d.window)==null||e.removeEventListener("pointermove",this)};on=new WeakSet;ks=function(i){var e;Mt(this,sn,i.composedPath().includes(this.range)),(e=d.window)==null||e.addEventListener("pointerup",this)};bs=new WeakSet;Nu=function(i){var e;i.pointerType!=="mouse"&&Re(this,on,ks).call(this,i),this.addEventListener("pointerleave",this),(e=d.window)==null||e.addEventListener("pointermove",this)};gs=new WeakSet;Pu=function(){var i;(i=d.window)==null||i.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};_s=new WeakSet;Uu=function(){var i,e;this.removeEventListener("pointerleave",this),(i=d.window)==null||i.removeEventListener("pointermove",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled"),(e=z(this,we).activeSegment)==null||e.style.removeProperty("transform")};As=new WeakSet;Bu=function(i){this.toggleAttribute("dragging",i.buttons===1||i.pointerType!=="mouse"),this.updatePointerBar(i),Re(this,ys,Ou).call(this,i),this.dragging&&(i.pointerType!=="mouse"||!z(this,sn))&&(this.range.disabled=!0,this.range.valueAsNumber=this.getPointerRatio(i),this.range.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})))};d.customElements.get("media-chrome-range")||d.customElements.define("media-chrome-range",Qt);var Wu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ln=(i,e,t)=>(Wu(i,e,"read from private field"),t?t.call(i):e.get(i)),op=(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)},dn=(i,e,t,a)=>(Wu(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Fe,$u=m.createElement("template");$u.innerHTML=`
568
+ `;var Zt=class extends d.HTMLElement{constructor(){super(),oe(this,Is),oe(this,tn),oe(this,an),oe(this,nn),oe(this,As),oe(this,Ts),oe(this,ys),oe(this,ks),oe(this,$e,void 0),oe(this,on,void 0),oe(this,zr,void 0),oe(this,Xr,void 0),oe(this,we,{}),oe(this,rn,[]),oe(this,Jr,()=>{if(this.range.matches(":focus-visible")){let{style:e}=$(this.shadowRoot,":host");e.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),oe(this,jr,()=>{let{style:e}=$(this.shadowRoot,":host");e.removeProperty("--_focus-visible-box-shadow")}),oe(this,en,()=>{let e=this.shadowRoot.querySelector("#segments-clipping");e&&e.parentNode.append(e)}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Yu.content.cloneNode(!0))),this.container=this.shadowRoot.querySelector("#container"),It(this,zr,this.shadowRoot.querySelector("#startpoint")),It(this,Xr,this.shadowRoot.querySelector("#endpoint")),this.range=this.shadowRoot.querySelector("#range"),this.appearance=this.shadowRoot.querySelector("#appearance")}static get observedAttributes(){return["disabled","aria-disabled",S.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,a){var r,n,s,l,u;e===S.MEDIA_CONTROLLER?(i&&((n=(r=Q(this,$e))==null?void 0:r.unassociateElement)==null||n.call(r,this),It(this,$e,null)),a&&this.isConnected&&(It(this,$e,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=Q(this,$e))==null?void 0:l.associateElement)==null||u.call(l,this))):(e==="disabled"||e==="aria-disabled"&&i!==a)&&(a==null?(this.range.removeAttribute(e),Re(this,tn,gs).call(this)):(this.range.setAttribute(e,a),Re(this,an,_s).call(this)))}connectedCallback(){var e,i,a;let{style:r}=$(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),Q(this,we).pointer=$(this.shadowRoot,"#pointer"),Q(this,we).progress=$(this.shadowRoot,"#progress"),Q(this,we).thumb=$(this.shadowRoot,"#thumb"),Q(this,we).activeSegment=$(this.shadowRoot,"#segments-clipping rect:nth-child(0)");let n=this.getAttribute(S.MEDIA_CONTROLLER);n&&(It(this,$e,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(i=Q(this,$e))==null?void 0:i.associateElement)==null||a.call(i,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",Q(this,Jr)),this.shadowRoot.addEventListener("focusout",Q(this,jr)),Re(this,tn,gs).call(this),nt(this.container,Q(this,en))}disconnectedCallback(){var e,i;Re(this,an,_s).call(this),(i=(e=Q(this,$e))==null?void 0:e.unassociateElement)==null||i.call(e,this),It(this,$e,null),this.shadowRoot.removeEventListener("focusin",Q(this,Jr)),this.shadowRoot.removeEventListener("focusout",Q(this,jr)),Ut(this.container,Q(this,en))}updatePointerBar(e){var i;(i=Q(this,we).pointer)==null||i.style.setProperty("width",`${this.getPointerRatio(e)*100}%`)}updateBar(){var e,i;let a=this.range.valueAsNumber*100;(e=Q(this,we).progress)==null||e.style.setProperty("width",`${a}%`),(i=Q(this,we).thumb)==null||i.style.setProperty("left",`${a}%`)}updateSegments(e){let i=this.shadowRoot.querySelector("#segments-clipping");if(i.textContent="",this.container.classList.toggle("segments",!!(e!=null&&e.length)),!(e!=null&&e.length))return;let a=[...new Set([+this.range.min,...e.flatMap(n=>[n.start,n.end]),+this.range.max])];It(this,rn,[...a]);let r=a.pop();for(let[n,s]of a.entries()){let[l,u]=[n===0,n===a.length-1],c=l?"calc(var(--segments-gap) / -1)":`${s*100}%`,g=`calc(${((u?r:a[n+1])-s)*100}%${l||u?"":" - var(--segments-gap)"})`,f=h.createElementNS("http://www.w3.org/2000/svg","rect"),v=$(this.shadowRoot,`#segments-clipping rect:nth-child(${n+1})`);v.style.setProperty("x",c),v.style.setProperty("width",g),i.append(f)}}getPointerRatio(e){let i=zd(e.clientX,e.clientY,Q(this,zr).getBoundingClientRect(),Q(this,Xr).getBoundingClientRect());return Math.max(0,Math.min(1,i))}get dragging(){return this.hasAttribute("dragging")}handleEvent(e){switch(e.type){case"pointermove":Re(this,ks,Vu).call(this,e);break;case"input":this.updateBar();break;case"pointerenter":Re(this,As,Wu).call(this,e);break;case"pointerdown":Re(this,nn,Cs).call(this,e);break;case"pointerup":Re(this,Ts,Fu).call(this);break;case"pointerleave":Re(this,ys,Ku).call(this);break}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};$e=new WeakMap;on=new WeakMap;zr=new WeakMap;Xr=new WeakMap;we=new WeakMap;rn=new WeakMap;Jr=new WeakMap;jr=new WeakMap;en=new WeakMap;Is=new WeakSet;$u=function(t){let e=Q(this,we).activeSegment;if(!e)return;let i=this.getPointerRatio(t),r=`#segments-clipping rect:nth-child(${Q(this,rn).findIndex((n,s,l)=>{let u=l[s+1];return u!=null&&i>=n&&i<=u})+1})`;(e.selectorText!=r||!e.style.transform)&&(e.selectorText=r,e.style.setProperty("transform","var(--media-range-segment-hover-transform, scaleY(2))"))};tn=new WeakSet;gs=function(){this.hasAttribute("disabled")||(this.addEventListener("input",this),this.addEventListener("pointerdown",this),this.addEventListener("pointerenter",this))};an=new WeakSet;_s=function(){var t,e;this.removeEventListener("input",this),this.removeEventListener("pointerdown",this),this.removeEventListener("pointerenter",this),(t=d.window)==null||t.removeEventListener("pointerup",this),(e=d.window)==null||e.removeEventListener("pointermove",this)};nn=new WeakSet;Cs=function(t){var e;It(this,on,t.composedPath().includes(this.range)),(e=d.window)==null||e.addEventListener("pointerup",this)};As=new WeakSet;Wu=function(t){var e;t.pointerType!=="mouse"&&Re(this,nn,Cs).call(this,t),this.addEventListener("pointerleave",this),(e=d.window)==null||e.addEventListener("pointermove",this)};Ts=new WeakSet;Fu=function(){var t;(t=d.window)==null||t.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};ys=new WeakSet;Ku=function(){var t,e;this.removeEventListener("pointerleave",this),(t=d.window)==null||t.removeEventListener("pointermove",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled"),(e=Q(this,we).activeSegment)==null||e.style.removeProperty("transform")};ks=new WeakSet;Vu=function(t){this.toggleAttribute("dragging",t.buttons===1||t.pointerType!=="mouse"),this.updatePointerBar(t),Re(this,Is,$u).call(this,t),this.dragging&&(t.pointerType!=="mouse"||!Q(this,on))&&(this.range.disabled=!0,this.range.valueAsNumber=this.getPointerRatio(t),this.range.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})))};d.customElements.get("media-chrome-range")||d.customElements.define("media-chrome-range",Zt);var Gu=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},sn=(t,e,i)=>(Gu(t,e,"read from private field"),i?i.call(t):e.get(t)),vp=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},ln=(t,e,i,a)=>(Gu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),We,qu=h.createElement("template");qu.innerHTML=`
560
569
  <style>
561
570
  :host {
562
571
 
@@ -582,7 +591,7 @@
582
591
  </style>
583
592
 
584
593
  <slot></slot>
585
- `;var Ss=class extends d.HTMLElement{constructor(){super(),op(this,Fe,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild($u.content.cloneNode(!0)))}static get observedAttributes(){return[k.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n,s,l,u;e===k.MEDIA_CONTROLLER&&(t&&((n=(r=ln(this,Fe))==null?void 0:r.unassociateElement)==null||n.call(r,this),dn(this,Fe,null)),a&&this.isConnected&&(dn(this,Fe,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=ln(this,Fe))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(k.MEDIA_CONTROLLER);r&&(dn(this,Fe,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=ln(this,Fe))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=ln(this,Fe))==null?void 0:e.unassociateElement)==null||t.call(e,this),dn(this,Fe,null)}};Fe=new WeakMap;d.customElements.get("media-control-bar")||d.customElements.define("media-control-bar",Ss);var Fu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},un=(i,e,t)=>(Fu(i,e,"read from private field"),t?t.call(i):e.get(i)),sp=(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)},cn=(i,e,t,a)=>(Fu(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ke,Ku=m.createElement("template");Ku.innerHTML=`
594
+ `;var Ms=class extends d.HTMLElement{constructor(){super(),vp(this,We,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(qu.content.cloneNode(!0)))}static get observedAttributes(){return[S.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,a){var r,n,s,l,u;e===S.MEDIA_CONTROLLER&&(i&&((n=(r=sn(this,We))==null?void 0:r.unassociateElement)==null||n.call(r,this),ln(this,We,null)),a&&this.isConnected&&(ln(this,We,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=sn(this,We))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,i,a;let r=this.getAttribute(S.MEDIA_CONTROLLER);r&&(ln(this,We,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(i=sn(this,We))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=sn(this,We))==null?void 0:e.unassociateElement)==null||i.call(e,this),ln(this,We,null)}};We=new WeakMap;d.customElements.get("media-control-bar")||d.customElements.define("media-control-bar",Ms);var Zu=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},dn=(t,e,i)=>(Zu(t,e,"read from private field"),i?i.call(t):e.get(t)),Ep=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},un=(t,e,i,a)=>(Zu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Fe,Qu=h.createElement("template");Qu.innerHTML=`
586
595
  <style>
587
596
  :host {
588
597
  font: var(--media-font,
@@ -615,11 +624,30 @@
615
624
  }
616
625
  </style>
617
626
  <slot></slot>
618
- `;var xe=class extends d.HTMLElement{constructor(){super(),sp(this,Ke,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Ku.content.cloneNode(!0)))}static get observedAttributes(){return[k.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n,s,l,u;e===k.MEDIA_CONTROLLER&&(t&&((n=(r=un(this,Ke))==null?void 0:r.unassociateElement)==null||n.call(r,this),cn(this,Ke,null)),a&&this.isConnected&&(cn(this,Ke,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=un(this,Ke))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,t,a;let{style:r}=W(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`);let n=this.getAttribute(k.MEDIA_CONTROLLER);n&&(cn(this,Ke,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(t=un(this,Ke))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=un(this,Ke))==null?void 0:e.unassociateElement)==null||t.call(e,this),cn(this,Ke,null)}};Ke=new WeakMap;d.customElements.get("media-text-display")||d.customElements.define("media-text-display",xe);var Yu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Vu=(i,e,t)=>(Yu(i,e,"read from private field"),t?t.call(i):e.get(i)),lp=(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)},dp=(i,e,t,a)=>(Yu(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),xa,Is=class extends xe{constructor(){super(),lp(this,xa,void 0),dp(this,xa,this.shadowRoot.querySelector("slot")),Vu(this,xa).textContent=Pe(0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_DURATION]}attributeChangedCallback(e,t,a){e===o.MEDIA_DURATION&&(Vu(this,xa).textContent=Pe(+a)),super.attributeChangedCallback(e,t,a)}get mediaDuration(){return w(this,o.MEDIA_DURATION)}set mediaDuration(e){P(this,o.MEDIA_DURATION,e)}};xa=new WeakMap;d.customElements.get("media-duration-display")||d.customElements.define("media-duration-display",Is);var up=`<svg aria-hidden="true" viewBox="0 0 26 24">
627
+ `;var Le=class extends d.HTMLElement{constructor(){super(),Ep(this,Fe,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Qu.content.cloneNode(!0)))}static get observedAttributes(){return[S.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,a){var r,n,s,l,u;e===S.MEDIA_CONTROLLER&&(i&&((n=(r=dn(this,Fe))==null?void 0:r.unassociateElement)==null||n.call(r,this),un(this,Fe,null)),a&&this.isConnected&&(un(this,Fe,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=dn(this,Fe))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,i,a;let{style:r}=$(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`);let n=this.getAttribute(S.MEDIA_CONTROLLER);n&&(un(this,Fe,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(i=dn(this,Fe))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=dn(this,Fe))==null?void 0:e.unassociateElement)==null||i.call(e,this),un(this,Fe,null)}};Fe=new WeakMap;d.customElements.get("media-text-display")||d.customElements.define("media-text-display",Le);var Xu=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},zu=(t,e,i)=>(Xu(t,e,"read from private field"),i?i.call(t):e.get(t)),bp=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},gp=(t,e,i,a)=>(Xu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ca,Rs=class extends Le{constructor(){super(),bp(this,Ca,void 0),gp(this,Ca,this.shadowRoot.querySelector("slot")),zu(this,Ca).textContent=Ne(0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_DURATION]}attributeChangedCallback(e,i,a){e===o.MEDIA_DURATION&&(zu(this,Ca).textContent=Ne(+a)),super.attributeChangedCallback(e,i,a)}get mediaDuration(){return M(this,o.MEDIA_DURATION)}set mediaDuration(e){D(this,o.MEDIA_DURATION,e)}};Ca=new WeakMap;d.customElements.get("media-duration-display")||d.customElements.define("media-duration-display",Rs);var ju=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},_p=(t,e,i)=>(ju(t,e,"read from private field"),i?i.call(t):e.get(t)),Ap=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Tp=(t,e,i,a)=>(ju(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),cn;function yp(t){return`
628
+ <style>
629
+ :host {
630
+ background: rgb(20 20 30 / .8);
631
+ }
632
+
633
+ #content {
634
+ display: block;
635
+ padding: 1.2em 1.5em;
636
+ }
637
+
638
+ h3,
639
+ p {
640
+ margin-block: 0 .3em;
641
+ }
642
+ </style>
643
+ <slot name="error-${t.mediaerrorcode}" id="content">
644
+ ${ec({code:+t.mediaerrorcode,message:t.mediaerrormessage})}
645
+ </slot>
646
+ `}function kp(t){return t.code&&$o(t)!==null}function ec(t){var e;let{title:i,message:a}=(e=$o(t))!=null?e:{},r="";return i&&(r+=`<slot name="error-${t.code}-title"><h3>${i}</h3></slot>`),a&&(r+=`<slot name="error-${t.code}-message"><p>${a}</p></slot>`),r}var Ju=[o.MEDIA_ERROR_CODE,o.MEDIA_ERROR_MESSAGE],Mi=class extends qt{constructor(){super(...arguments),Ap(this,cn,null)}static get observedAttributes(){return[...super.observedAttributes,...Ju]}formatErrorMessage(e){return this.constructor.formatErrorMessage(e)}attributeChangedCallback(e,i,a){var r;if(super.attributeChangedCallback(e,i,a),!Ju.includes(e))return;let n=(r=this.mediaError)!=null?r:{code:this.mediaErrorCode,message:this.mediaErrorMessage};this.open=kp(n),this.open&&(this.shadowRoot.querySelector("slot").name=`error-${this.mediaErrorCode}`,this.shadowRoot.querySelector("#content").innerHTML=this.formatErrorMessage(n))}get mediaError(){return _p(this,cn)}set mediaError(e){Tp(this,cn,e)}get mediaErrorCode(){return M(this,"mediaerrorcode")}set mediaErrorCode(e){D(this,"mediaerrorcode",e)}get mediaErrorMessage(){return R(this,"mediaerrormessage")}set mediaErrorMessage(e){I(this,"mediaerrormessage",e)}};cn=new WeakMap;Mi.getSlotTemplateHTML=yp;Mi.formatErrorMessage=ec;d.customElements.get("media-error-dialog")||d.customElements.define("media-error-dialog",Mi);var mn=Mi;var Sp=`<svg aria-hidden="true" viewBox="0 0 26 24">
619
647
  <path d="M16 3v2.5h3.5V9H22V3h-6ZM4 9h2.5V5.5H10V3H4v6Zm15.5 9.5H16V21h6v-6h-2.5v3.5ZM6.5 15H4v6h6v-2.5H6.5V15Z"/>
620
- </svg>`,cp=`<svg aria-hidden="true" viewBox="0 0 26 24">
648
+ </svg>`,Ip=`<svg aria-hidden="true" viewBox="0 0 26 24">
621
649
  <path d="M18.5 6.5V3H16v6h6V6.5h-3.5ZM16 21h2.5v-3.5H22V15h-6v6ZM4 17.5h3.5V21H10v-6H4v2.5Zm3.5-11H4V9h6V3H7.5v3.5Z"/>
622
- </svg>`,qu=m.createElement("template");qu.innerHTML=`
650
+ </svg>`,ic=h.createElement("template");ic.innerHTML=`
623
651
  <style>
624
652
  :host([${o.MEDIA_IS_FULLSCREEN}]) slot[name=icon] slot:not([name=exit]) {
625
653
  display: none !important;
@@ -637,13 +665,13 @@
637
665
  </style>
638
666
 
639
667
  <slot name="icon">
640
- <slot name="enter">${up}</slot>
641
- <slot name="exit">${cp}</slot>
668
+ <slot name="enter">${Sp}</slot>
669
+ <slot name="exit">${Ip}</slot>
642
670
  </slot>
643
- `;var mp=`
644
- <slot name="tooltip-enter">${I.ENTER_FULLSCREEN}</slot>
645
- <slot name="tooltip-exit">${I.EXIT_FULLSCREEN}</slot>
646
- `,Gu=i=>{let e=i.mediaIsFullscreen?Y.EXIT_FULLSCREEN():Y.ENTER_FULLSCREEN();i.setAttribute("aria-label",e)},Cs=class extends F{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_FULLSCREEN,o.MEDIA_FULLSCREEN_UNAVAILABLE]}constructor(e={}){super({slotTemplate:qu,tooltipContent:mp,...e})}connectedCallback(){super.connectedCallback(),Gu(this)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_IS_FULLSCREEN&&Gu(this)}get mediaFullscreenUnavailable(){return x(this,o.MEDIA_FULLSCREEN_UNAVAILABLE)}set mediaFullscreenUnavailable(e){M(this,o.MEDIA_FULLSCREEN_UNAVAILABLE,e)}get mediaIsFullscreen(){return H(this,o.MEDIA_IS_FULLSCREEN)}set mediaIsFullscreen(e){B(this,o.MEDIA_IS_FULLSCREEN,e)}handleClick(){let e=this.mediaIsFullscreen?p.MEDIA_EXIT_FULLSCREEN_REQUEST:p.MEDIA_ENTER_FULLSCREEN_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-fullscreen-button")||d.customElements.define("media-fullscreen-button",Cs);var{MEDIA_TIME_IS_LIVE:mn,MEDIA_PAUSED:Da}=o,{MEDIA_SEEK_TO_LIVE_REQUEST:hp,MEDIA_PLAY_REQUEST:pp}=p,vp='<svg viewBox="0 0 6 12"><circle cx="3" cy="6" r="2"></circle></svg>',Qu=m.createElement("template");Qu.innerHTML=`
671
+ `;var Cp=`
672
+ <slot name="tooltip-enter">${C.ENTER_FULLSCREEN}</slot>
673
+ <slot name="tooltip-exit">${C.EXIT_FULLSCREEN}</slot>
674
+ `,tc=t=>{let e=t.mediaIsFullscreen?Y.EXIT_FULLSCREEN():Y.ENTER_FULLSCREEN();t.setAttribute("aria-label",e)},ws=class extends F{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_FULLSCREEN,o.MEDIA_FULLSCREEN_UNAVAILABLE]}constructor(e={}){super({slotTemplate:ic,tooltipContent:Cp,...e})}connectedCallback(){super.connectedCallback(),tc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_IS_FULLSCREEN&&tc(this)}get mediaFullscreenUnavailable(){return R(this,o.MEDIA_FULLSCREEN_UNAVAILABLE)}set mediaFullscreenUnavailable(e){I(this,o.MEDIA_FULLSCREEN_UNAVAILABLE,e)}get mediaIsFullscreen(){return H(this,o.MEDIA_IS_FULLSCREEN)}set mediaIsFullscreen(e){U(this,o.MEDIA_IS_FULLSCREEN,e)}handleClick(){let e=this.mediaIsFullscreen?p.MEDIA_EXIT_FULLSCREEN_REQUEST:p.MEDIA_ENTER_FULLSCREEN_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-fullscreen-button")||d.customElements.define("media-fullscreen-button",ws);var{MEDIA_TIME_IS_LIVE:hn,MEDIA_PAUSED:Ma}=o,{MEDIA_SEEK_TO_LIVE_REQUEST:Mp,MEDIA_PLAY_REQUEST:Rp}=p,wp='<svg viewBox="0 0 6 12"><circle cx="3" cy="6" r="2"></circle></svg>',rc=h.createElement("template");rc.innerHTML=`
647
675
  <style>
648
676
  :host { --media-tooltip-display: none; }
649
677
 
@@ -655,22 +683,22 @@
655
683
  color: var(--media-live-button-icon-color, rgb(140, 140, 140));
656
684
  }
657
685
 
658
- :host([${mn}]:not([${Da}])) slot[name=indicator] > *,
659
- :host([${mn}]:not([${Da}])) ::slotted([slot=indicator]) {
686
+ :host([${hn}]:not([${Ma}])) slot[name=indicator] > *,
687
+ :host([${hn}]:not([${Ma}])) ::slotted([slot=indicator]) {
660
688
  fill: var(--media-live-button-indicator-color, rgb(255, 0, 0));
661
689
  color: var(--media-live-button-indicator-color, rgb(255, 0, 0));
662
690
  }
663
691
 
664
- :host([${mn}]:not([${Da}])) {
692
+ :host([${hn}]:not([${Ma}])) {
665
693
  cursor: not-allowed;
666
694
  }
667
695
 
668
696
  </style>
669
697
 
670
- <slot name="indicator">${vp}</slot>
698
+ <slot name="indicator">${wp}</slot>
671
699
 
672
700
  <slot name="spacer">&nbsp;</slot><slot name="text">LIVE</slot>
673
- `;var Zu=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")},Ms=class extends F{static get observedAttributes(){return[...super.observedAttributes,Da,mn]}constructor(e={}){super({slotTemplate:Qu,...e})}connectedCallback(){Zu(this),super.connectedCallback()}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),Zu(this)}get mediaPaused(){return H(this,o.MEDIA_PAUSED)}set mediaPaused(e){B(this,o.MEDIA_PAUSED,e)}get mediaTimeIsLive(){return H(this,o.MEDIA_TIME_IS_LIVE)}set mediaTimeIsLive(e){B(this,o.MEDIA_TIME_IS_LIVE,e)}handleClick(){!this.mediaPaused&&this.mediaTimeIsLive||(this.dispatchEvent(new d.CustomEvent(hp,{composed:!0,bubbles:!0})),this.hasAttribute(Da)&&this.dispatchEvent(new d.CustomEvent(pp,{composed:!0,bubbles:!0})))}};d.customElements.get("media-live-button")||d.customElements.define("media-live-button",Ms);var Ju=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Oa=(i,e,t)=>(Ju(i,e,"read from private field"),t?t.call(i):e.get(i)),zu=(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)},Na=(i,e,t,a)=>(Ju(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ve,hn,Xu={LOADING_DELAY:"loadingdelay"},ju=500,ec=m.createElement("template"),fp=`
701
+ `;var ac=t=>{let e=t.mediaPaused||!t.mediaTimeIsLive,i=e?Y.SEEK_LIVE():Y.PLAYING_LIVE();t.setAttribute("aria-label",i),e?t.removeAttribute("aria-disabled"):t.setAttribute("aria-disabled","true")},Ls=class extends F{static get observedAttributes(){return[...super.observedAttributes,Ma,hn]}constructor(e={}){super({slotTemplate:rc,...e})}connectedCallback(){ac(this),super.connectedCallback()}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),ac(this)}get mediaPaused(){return H(this,o.MEDIA_PAUSED)}set mediaPaused(e){U(this,o.MEDIA_PAUSED,e)}get mediaTimeIsLive(){return H(this,o.MEDIA_TIME_IS_LIVE)}set mediaTimeIsLive(e){U(this,o.MEDIA_TIME_IS_LIVE,e)}handleClick(){!this.mediaPaused&&this.mediaTimeIsLive||(this.dispatchEvent(new d.CustomEvent(Mp,{composed:!0,bubbles:!0})),this.hasAttribute(Ma)&&this.dispatchEvent(new d.CustomEvent(Rp,{composed:!0,bubbles:!0})))}};d.customElements.get("media-live-button")||d.customElements.define("media-live-button",Ls);var sc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Ra=(t,e,i)=>(sc(t,e,"read from private field"),i?i.call(t):e.get(t)),nc=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},wa=(t,e,i,a)=>(sc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ke,pn,oc={LOADING_DELAY:"loadingdelay"},lc=500,dc=h.createElement("template"),Lp=`
674
702
  <svg aria-hidden="true" viewBox="0 0 100 100">
675
703
  <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">
676
704
  <animateTransform
@@ -683,13 +711,13 @@
683
711
  repeatCount="indefinite" />
684
712
  </path>
685
713
  </svg>
686
- `;ec.innerHTML=`
714
+ `;dc.innerHTML=`
687
715
  <style>
688
716
  :host {
689
717
  display: var(--media-control-display, var(--media-loading-indicator-display, inline-block));
690
718
  vertical-align: middle;
691
719
  box-sizing: border-box;
692
- --_loading-indicator-delay: var(--media-loading-indicator-transition-delay, ${ju}ms);
720
+ --_loading-indicator-delay: var(--media-loading-indicator-transition-delay, ${lc}ms);
693
721
  }
694
722
 
695
723
  #status {
@@ -728,52 +756,52 @@ svg, img, ::slotted(svg), ::slotted(img) {
728
756
  }
729
757
  </style>
730
758
 
731
- <slot name="icon">${fp}</slot>
759
+ <slot name="icon">${Lp}</slot>
732
760
  <div id="status" role="status" aria-live="polite">${V.MEDIA_LOADING()}</div>
733
- `;var Ls=class extends d.HTMLElement{constructor(){if(super(),zu(this,Ve,void 0),zu(this,hn,ju),!this.shadowRoot){let e=this.attachShadow({mode:"open"}),t=ec.content.cloneNode(!0);e.appendChild(t)}}static get observedAttributes(){return[k.MEDIA_CONTROLLER,o.MEDIA_PAUSED,o.MEDIA_LOADING,Xu.LOADING_DELAY]}attributeChangedCallback(e,t,a){var r,n,s,l,u;e===Xu.LOADING_DELAY&&t!==a?this.loadingDelay=Number(a):e===k.MEDIA_CONTROLLER&&(t&&((n=(r=Oa(this,Ve))==null?void 0:r.unassociateElement)==null||n.call(r,this),Na(this,Ve,null)),a&&this.isConnected&&(Na(this,Ve,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=Oa(this,Ve))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(k.MEDIA_CONTROLLER);r&&(Na(this,Ve,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=Oa(this,Ve))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Oa(this,Ve))==null?void 0:e.unassociateElement)==null||t.call(e,this),Na(this,Ve,null)}get loadingDelay(){return Oa(this,hn)}set loadingDelay(e){Na(this,hn,e);let{style:t}=W(this.shadowRoot,":host");t.setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return H(this,o.MEDIA_PAUSED)}set mediaPaused(e){B(this,o.MEDIA_PAUSED,e)}get mediaLoading(){return H(this,o.MEDIA_LOADING)}set mediaLoading(e){B(this,o.MEDIA_LOADING,e)}};Ve=new WeakMap;hn=new WeakMap;d.customElements.get("media-loading-indicator")||d.customElements.define("media-loading-indicator",Ls);var{MEDIA_VOLUME_LEVEL:zt}=o,Ep=`<svg aria-hidden="true" viewBox="0 0 24 24">
761
+ `;var xs=class extends d.HTMLElement{constructor(){if(super(),nc(this,Ke,void 0),nc(this,pn,lc),!this.shadowRoot){let e=this.attachShadow({mode:"open"}),i=dc.content.cloneNode(!0);e.appendChild(i)}}static get observedAttributes(){return[S.MEDIA_CONTROLLER,o.MEDIA_PAUSED,o.MEDIA_LOADING,oc.LOADING_DELAY]}attributeChangedCallback(e,i,a){var r,n,s,l,u;e===oc.LOADING_DELAY&&i!==a?this.loadingDelay=Number(a):e===S.MEDIA_CONTROLLER&&(i&&((n=(r=Ra(this,Ke))==null?void 0:r.unassociateElement)==null||n.call(r,this),wa(this,Ke,null)),a&&this.isConnected&&(wa(this,Ke,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=Ra(this,Ke))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,i,a;let r=this.getAttribute(S.MEDIA_CONTROLLER);r&&(wa(this,Ke,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(i=Ra(this,Ke))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=Ra(this,Ke))==null?void 0:e.unassociateElement)==null||i.call(e,this),wa(this,Ke,null)}get loadingDelay(){return Ra(this,pn)}set loadingDelay(e){wa(this,pn,e);let{style:i}=$(this.shadowRoot,":host");i.setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return H(this,o.MEDIA_PAUSED)}set mediaPaused(e){U(this,o.MEDIA_PAUSED,e)}get mediaLoading(){return H(this,o.MEDIA_LOADING)}set mediaLoading(e){U(this,o.MEDIA_LOADING,e)}};Ke=new WeakMap;pn=new WeakMap;d.customElements.get("media-loading-indicator")||d.customElements.define("media-loading-indicator",xs);var{MEDIA_VOLUME_LEVEL:Qt}=o,xp=`<svg aria-hidden="true" viewBox="0 0 24 24">
734
762
  <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"/>
735
- </svg>`,tc=`<svg aria-hidden="true" viewBox="0 0 24 24">
763
+ </svg>`,uc=`<svg aria-hidden="true" viewBox="0 0 24 24">
736
764
  <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"/>
737
- </svg>`,bp=`<svg aria-hidden="true" viewBox="0 0 24 24">
765
+ </svg>`,Dp=`<svg aria-hidden="true" viewBox="0 0 24 24">
738
766
  <path d="M3 9v6h4l5 5V4L7 9H3Zm13.5 3A4.5 4.5 0 0 0 14 8v8a4.47 4.47 0 0 0 2.5-4ZM14 3.23v2.06a7 7 0 0 1 0 13.42v2.06a9 9 0 0 0 0-17.54Z"/>
739
- </svg>`,ac=m.createElement("template");ac.innerHTML=`
767
+ </svg>`,mc=h.createElement("template");mc.innerHTML=`
740
768
  <style>
741
769
 
742
- :host(:not([${zt}])) slot[name=icon] slot:not([name=high]),
743
- :host([${zt}=high]) slot[name=icon] slot:not([name=high]) {
770
+ :host(:not([${Qt}])) slot[name=icon] slot:not([name=high]),
771
+ :host([${Qt}=high]) slot[name=icon] slot:not([name=high]) {
744
772
  display: none !important;
745
773
  }
746
774
 
747
- :host([${zt}=off]) slot[name=icon] slot:not([name=off]) {
775
+ :host([${Qt}=off]) slot[name=icon] slot:not([name=off]) {
748
776
  display: none !important;
749
777
  }
750
778
 
751
- :host([${zt}=low]) slot[name=icon] slot:not([name=low]) {
779
+ :host([${Qt}=low]) slot[name=icon] slot:not([name=low]) {
752
780
  display: none !important;
753
781
  }
754
782
 
755
- :host([${zt}=medium]) slot[name=icon] slot:not([name=medium]) {
783
+ :host([${Qt}=medium]) slot[name=icon] slot:not([name=medium]) {
756
784
  display: none !important;
757
785
  }
758
786
 
759
- :host(:not([${zt}=off])) slot[name=tooltip-unmute],
760
- :host([${zt}=off]) slot[name=tooltip-mute] {
787
+ :host(:not([${Qt}=off])) slot[name=tooltip-unmute],
788
+ :host([${Qt}=off]) slot[name=tooltip-mute] {
761
789
  display: none;
762
790
  }
763
791
  </style>
764
792
 
765
793
  <slot name="icon">
766
- <slot name="off">${Ep}</slot>
767
- <slot name="low">${tc}</slot>
768
- <slot name="medium">${tc}</slot>
769
- <slot name="high">${bp}</slot>
794
+ <slot name="off">${xp}</slot>
795
+ <slot name="low">${uc}</slot>
796
+ <slot name="medium">${uc}</slot>
797
+ <slot name="high">${Dp}</slot>
770
798
  </slot>
771
- `;var gp=`
772
- <slot name="tooltip-mute">${I.MUTE}</slot>
773
- <slot name="tooltip-unmute">${I.UNMUTE}</slot>
774
- `,ic=i=>{let t=i.mediaVolumeLevel==="off"?Y.UNMUTE():Y.MUTE();i.setAttribute("aria-label",t)},Rs=class extends F{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME_LEVEL]}constructor(e={}){super({slotTemplate:ac,tooltipContent:gp,...e})}connectedCallback(){ic(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_VOLUME_LEVEL&&ic(this),super.attributeChangedCallback(e,t,a)}get mediaVolumeLevel(){return x(this,o.MEDIA_VOLUME_LEVEL)}set mediaVolumeLevel(e){M(this,o.MEDIA_VOLUME_LEVEL,e)}handleClick(){let e=this.mediaVolumeLevel==="off"?p.MEDIA_UNMUTE_REQUEST:p.MEDIA_MUTE_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-mute-button")||d.customElements.define("media-mute-button",Rs);var rc=`<svg aria-hidden="true" viewBox="0 0 28 24">
799
+ `;var Op=`
800
+ <slot name="tooltip-mute">${C.MUTE}</slot>
801
+ <slot name="tooltip-unmute">${C.UNMUTE}</slot>
802
+ `,cc=t=>{let i=t.mediaVolumeLevel==="off"?Y.UNMUTE():Y.MUTE();t.setAttribute("aria-label",i)},Ds=class extends F{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME_LEVEL]}constructor(e={}){super({slotTemplate:mc,tooltipContent:Op,...e})}connectedCallback(){cc(this),super.connectedCallback()}attributeChangedCallback(e,i,a){e===o.MEDIA_VOLUME_LEVEL&&cc(this),super.attributeChangedCallback(e,i,a)}get mediaVolumeLevel(){return R(this,o.MEDIA_VOLUME_LEVEL)}set mediaVolumeLevel(e){I(this,o.MEDIA_VOLUME_LEVEL,e)}handleClick(){let e=this.mediaVolumeLevel==="off"?p.MEDIA_UNMUTE_REQUEST:p.MEDIA_MUTE_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-mute-button")||d.customElements.define("media-mute-button",Ds);var hc=`<svg aria-hidden="true" viewBox="0 0 28 24">
775
803
  <path d="M24 3H4a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h20a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1Zm-1 16H5V5h18v14Zm-3-8h-7v5h7v-5Z"/>
776
- </svg>`,oc=m.createElement("template");oc.innerHTML=`
804
+ </svg>`,fc=h.createElement("template");fc.innerHTML=`
777
805
  <style>
778
806
  :host([${o.MEDIA_IS_PIP}]) slot[name=icon] slot:not([name=exit]) {
779
807
  display: none !important;
@@ -791,13 +819,13 @@ svg, img, ::slotted(svg), ::slotted(img) {
791
819
  </style>
792
820
 
793
821
  <slot name="icon">
794
- <slot name="enter">${rc}</slot>
795
- <slot name="exit">${rc}</slot>
822
+ <slot name="enter">${hc}</slot>
823
+ <slot name="exit">${hc}</slot>
796
824
  </slot>
797
- `;var _p=`
798
- <slot name="tooltip-enter">${I.ENTER_PIP}</slot>
799
- <slot name="tooltip-exit">${I.EXIT_PIP}</slot>
800
- `,nc=i=>{let e=i.mediaIsPip?Y.EXIT_PIP():Y.ENTER_PIP();i.setAttribute("aria-label",e)},ws=class extends F{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_PIP,o.MEDIA_PIP_UNAVAILABLE]}constructor(e={}){super({slotTemplate:oc,tooltipContent:_p,...e})}connectedCallback(){nc(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_IS_PIP&&nc(this),super.attributeChangedCallback(e,t,a)}get mediaPipUnavailable(){return x(this,o.MEDIA_PIP_UNAVAILABLE)}set mediaPipUnavailable(e){M(this,o.MEDIA_PIP_UNAVAILABLE,e)}get mediaIsPip(){return H(this,o.MEDIA_IS_PIP)}set mediaIsPip(e){B(this,o.MEDIA_IS_PIP,e)}handleClick(){let e=this.mediaIsPip?p.MEDIA_EXIT_PIP_REQUEST:p.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-pip-button")||d.customElements.define("media-pip-button",ws);var Ap=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},pn=(i,e,t)=>(Ap(i,e,"read from private field"),t?t.call(i):e.get(i)),Tp=(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)},Li,xs={RATES:"rates"},Os=[1,1.2,1.5,1.7,2],Ri=1,sc=m.createElement("template");sc.innerHTML=`
825
+ `;var Np=`
826
+ <slot name="tooltip-enter">${C.ENTER_PIP}</slot>
827
+ <slot name="tooltip-exit">${C.EXIT_PIP}</slot>
828
+ `,pc=t=>{let e=t.mediaIsPip?Y.EXIT_PIP():Y.ENTER_PIP();t.setAttribute("aria-label",e)},Os=class extends F{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_PIP,o.MEDIA_PIP_UNAVAILABLE]}constructor(e={}){super({slotTemplate:fc,tooltipContent:Np,...e})}connectedCallback(){pc(this),super.connectedCallback()}attributeChangedCallback(e,i,a){e===o.MEDIA_IS_PIP&&pc(this),super.attributeChangedCallback(e,i,a)}get mediaPipUnavailable(){return R(this,o.MEDIA_PIP_UNAVAILABLE)}set mediaPipUnavailable(e){I(this,o.MEDIA_PIP_UNAVAILABLE,e)}get mediaIsPip(){return H(this,o.MEDIA_IS_PIP)}set mediaIsPip(e){U(this,o.MEDIA_IS_PIP,e)}handleClick(){let e=this.mediaIsPip?p.MEDIA_EXIT_PIP_REQUEST:p.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-pip-button")||d.customElements.define("media-pip-button",Os);var Pp=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},fn=(t,e,i)=>(Pp(t,e,"read from private field"),i?i.call(t):e.get(t)),Up=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Ri,Ns={RATES:"rates"},Us=[1,1.2,1.5,1.7,2],wi=1,vc=h.createElement("template");vc.innerHTML=`
801
829
  <style>
802
830
  :host {
803
831
  min-width: 5ch;
@@ -805,11 +833,11 @@ svg, img, ::slotted(svg), ::slotted(img) {
805
833
  }
806
834
  </style>
807
835
  <slot name="icon"></slot>
808
- `;var Ds=class extends F{constructor(e={}){super({slotTemplate:sc,tooltipContent:I.PLAYBACK_RATE,...e}),Tp(this,Li,new Be(this,xs.RATES,{defaultValue:Os})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${Ri}x`}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,xs.RATES]}attributeChangedCallback(e,t,a){if(super.attributeChangedCallback(e,t,a),e===xs.RATES&&(pn(this,Li).value=a),e===o.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,n=Number.isNaN(r)?Ri:r;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",V.PLAYBACK_RATE({playbackRate:n}))}}get rates(){return pn(this,Li)}set rates(e){e?Array.isArray(e)&&(pn(this,Li).value=e.join(" ")):pn(this,Li).value=""}get mediaPlaybackRate(){return w(this,o.MEDIA_PLAYBACK_RATE,Ri)}set mediaPlaybackRate(e){P(this,o.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,t;let a=Array.from(this.rates.values(),s=>+s).sort((s,l)=>s-l),r=(t=(e=a.find(s=>s>this.mediaPlaybackRate))!=null?e:a[0])!=null?t:Ri,n=new d.CustomEvent(p.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)}};Li=new WeakMap;d.customElements.get("media-playback-rate-button")||d.customElements.define("media-playback-rate-button",Ds);var yp=`<svg aria-hidden="true" viewBox="0 0 24 24">
836
+ `;var Ps=class extends F{constructor(e={}){super({slotTemplate:vc,tooltipContent:C.PLAYBACK_RATE,...e}),Up(this,Ri,new Ue(this,Ns.RATES,{defaultValue:Us})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${wi}x`}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,Ns.RATES]}attributeChangedCallback(e,i,a){if(super.attributeChangedCallback(e,i,a),e===Ns.RATES&&(fn(this,Ri).value=a),e===o.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,n=Number.isNaN(r)?wi:r;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",V.PLAYBACK_RATE({playbackRate:n}))}}get rates(){return fn(this,Ri)}set rates(e){e?Array.isArray(e)&&(fn(this,Ri).value=e.join(" ")):fn(this,Ri).value=""}get mediaPlaybackRate(){return M(this,o.MEDIA_PLAYBACK_RATE,wi)}set mediaPlaybackRate(e){D(this,o.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,i;let a=Array.from(this.rates.values(),s=>+s).sort((s,l)=>s-l),r=(i=(e=a.find(s=>s>this.mediaPlaybackRate))!=null?e:a[0])!=null?i:wi,n=new d.CustomEvent(p.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)}};Ri=new WeakMap;d.customElements.get("media-playback-rate-button")||d.customElements.define("media-playback-rate-button",Ps);var Bp=`<svg aria-hidden="true" viewBox="0 0 24 24">
809
837
  <path d="m6 21 15-9L6 3v18Z"/>
810
- </svg>`,kp=`<svg aria-hidden="true" viewBox="0 0 24 24">
838
+ </svg>`,Hp=`<svg aria-hidden="true" viewBox="0 0 24 24">
811
839
  <path d="M6 20h4V4H6v16Zm8-16v16h4V4h-4Z"/>
812
- </svg>`,dc=m.createElement("template");dc.innerHTML=`
840
+ </svg>`,bc=h.createElement("template");bc.innerHTML=`
813
841
  <style>
814
842
  :host([${o.MEDIA_PAUSED}]) slot[name=pause],
815
843
  :host(:not([${o.MEDIA_PAUSED}])) slot[name=play] {
@@ -823,13 +851,13 @@ svg, img, ::slotted(svg), ::slotted(img) {
823
851
  </style>
824
852
 
825
853
  <slot name="icon">
826
- <slot name="play">${yp}</slot>
827
- <slot name="pause">${kp}</slot>
854
+ <slot name="play">${Bp}</slot>
855
+ <slot name="pause">${Hp}</slot>
828
856
  </slot>
829
- `;var Sp=`
830
- <slot name="tooltip-play">${I.PLAY}</slot>
831
- <slot name="tooltip-pause">${I.PAUSE}</slot>
832
- `,lc=i=>{let e=i.mediaPaused?Y.PLAY():Y.PAUSE();i.setAttribute("aria-label",e)},Ns=class extends F{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PAUSED,o.MEDIA_ENDED]}constructor(e={}){super({slotTemplate:dc,tooltipContent:Sp,...e})}connectedCallback(){lc(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_PAUSED&&lc(this),super.attributeChangedCallback(e,t,a)}get mediaPaused(){return H(this,o.MEDIA_PAUSED)}set mediaPaused(e){B(this,o.MEDIA_PAUSED,e)}handleClick(){let e=this.mediaPaused?p.MEDIA_PLAY_REQUEST:p.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-play-button")||d.customElements.define("media-play-button",Ns);var Ye={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"},uc=m.createElement("template");uc.innerHTML=`
857
+ `;var $p=`
858
+ <slot name="tooltip-play">${C.PLAY}</slot>
859
+ <slot name="tooltip-pause">${C.PAUSE}</slot>
860
+ `,Ec=t=>{let e=t.mediaPaused?Y.PLAY():Y.PAUSE();t.setAttribute("aria-label",e)},Bs=class extends F{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PAUSED,o.MEDIA_ENDED]}constructor(e={}){super({slotTemplate:bc,tooltipContent:$p,...e})}connectedCallback(){Ec(this),super.connectedCallback()}attributeChangedCallback(e,i,a){e===o.MEDIA_PAUSED&&Ec(this),super.attributeChangedCallback(e,i,a)}get mediaPaused(){return H(this,o.MEDIA_PAUSED)}set mediaPaused(e){U(this,o.MEDIA_PAUSED,e)}handleClick(){let e=this.mediaPaused?p.MEDIA_PLAY_REQUEST:p.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-play-button")||d.customElements.define("media-play-button",Bs);var Ve={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"},gc=h.createElement("template");gc.innerHTML=`
833
861
  <style>
834
862
  :host {
835
863
  pointer-events: none;
@@ -851,7 +879,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
851
879
  </style>
852
880
 
853
881
  <img part="poster img" aria-hidden="true" id="image"/>
854
- `;var Ip=i=>{i.style.removeProperty("background-image")},Cp=(i,e)=>{i.style["background-image"]=`url('${e}')`},Ps=class extends d.HTMLElement{static get observedAttributes(){return[Ye.PLACEHOLDER_SRC,Ye.SRC]}constructor(){super(),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(uc.content.cloneNode(!0))),this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,t,a){e===Ye.SRC&&(a==null?this.image.removeAttribute(Ye.SRC):this.image.setAttribute(Ye.SRC,a)),e===Ye.PLACEHOLDER_SRC&&(a==null?Ip(this.image):Cp(this.image,a))}get placeholderSrc(){return x(this,Ye.PLACEHOLDER_SRC)}set placeholderSrc(e){M(this,Ye.SRC,e)}get src(){return x(this,Ye.SRC)}set src(e){M(this,Ye.SRC,e)}};d.customElements.get("media-poster-image")||d.customElements.define("media-poster-image",Ps);var cc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Mp=(i,e,t)=>(cc(i,e,"read from private field"),t?t.call(i):e.get(i)),Lp=(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)},Rp=(i,e,t,a)=>(cc(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),vn,Us=class extends xe{constructor(){super(),Lp(this,vn,void 0),Rp(this,vn,this.shadowRoot.querySelector("slot"))}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PREVIEW_CHAPTER]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_PREVIEW_CHAPTER&&a!==t&&a!=null&&(Mp(this,vn).textContent=a,a!==""?this.setAttribute("aria-valuetext",`chapter: ${a}`):this.removeAttribute("aria-valuetext"))}get mediaPreviewChapter(){return x(this,o.MEDIA_PREVIEW_CHAPTER)}set mediaPreviewChapter(e){M(this,o.MEDIA_PREVIEW_CHAPTER,e)}};vn=new WeakMap;d.customElements.get("media-preview-chapter-display")||d.customElements.define("media-preview-chapter-display",Us);var mc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},fn=(i,e,t)=>(mc(i,e,"read from private field"),t?t.call(i):e.get(i)),wp=(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)},En=(i,e,t,a)=>(mc(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ge,hc=m.createElement("template");hc.innerHTML=`
882
+ `;var Wp=t=>{t.style.removeProperty("background-image")},Fp=(t,e)=>{t.style["background-image"]=`url('${e}')`},Hs=class extends d.HTMLElement{static get observedAttributes(){return[Ve.PLACEHOLDER_SRC,Ve.SRC]}constructor(){super(),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(gc.content.cloneNode(!0))),this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,i,a){e===Ve.SRC&&(a==null?this.image.removeAttribute(Ve.SRC):this.image.setAttribute(Ve.SRC,a)),e===Ve.PLACEHOLDER_SRC&&(a==null?Wp(this.image):Fp(this.image,a))}get placeholderSrc(){return R(this,Ve.PLACEHOLDER_SRC)}set placeholderSrc(e){I(this,Ve.SRC,e)}get src(){return R(this,Ve.SRC)}set src(e){I(this,Ve.SRC,e)}};d.customElements.get("media-poster-image")||d.customElements.define("media-poster-image",Hs);var _c=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Kp=(t,e,i)=>(_c(t,e,"read from private field"),i?i.call(t):e.get(t)),Vp=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Yp=(t,e,i,a)=>(_c(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),vn,$s=class extends Le{constructor(){super(),Vp(this,vn,void 0),Yp(this,vn,this.shadowRoot.querySelector("slot"))}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PREVIEW_CHAPTER]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_PREVIEW_CHAPTER&&a!==i&&a!=null&&(Kp(this,vn).textContent=a,a!==""?this.setAttribute("aria-valuetext",`chapter: ${a}`):this.removeAttribute("aria-valuetext"))}get mediaPreviewChapter(){return R(this,o.MEDIA_PREVIEW_CHAPTER)}set mediaPreviewChapter(e){I(this,o.MEDIA_PREVIEW_CHAPTER,e)}};vn=new WeakMap;d.customElements.get("media-preview-chapter-display")||d.customElements.define("media-preview-chapter-display",$s);var Ac=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},En=(t,e,i)=>(Ac(t,e,"read from private field"),i?i.call(t):e.get(t)),Gp=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},bn=(t,e,i,a)=>(Ac(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ye,Tc=h.createElement("template");Tc.innerHTML=`
855
883
  <style>
856
884
  :host {
857
885
  box-sizing: border-box;
@@ -865,11 +893,11 @@ svg, img, ::slotted(svg), ::slotted(img) {
865
893
  }
866
894
  </style>
867
895
  <img crossorigin loading="eager" decoding="async">
868
- `;var Bs=class extends d.HTMLElement{constructor(){super(),wp(this,Ge,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(hc.content.cloneNode(!0)))}static get observedAttributes(){return[k.MEDIA_CONTROLLER,o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,t,a;let r=this.getAttribute(k.MEDIA_CONTROLLER);r&&(En(this,Ge,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=fn(this,Ge))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=fn(this,Ge))==null?void 0:e.unassociateElement)==null||t.call(e,this),En(this,Ge,null)}attributeChangedCallback(e,t,a){var r,n,s,l,u;[o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===k.MEDIA_CONTROLLER&&(t&&((n=(r=fn(this,Ge))==null?void 0:r.unassociateElement)==null||n.call(r,this),En(this,Ge,null)),a&&this.isConnected&&(En(this,Ge,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=fn(this,Ge))==null?void 0:l.associateElement)==null||u.call(l,this)))}get mediaPreviewImage(){return x(this,o.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){M(this,o.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewCoords(){let e=this.getAttribute(o.MEDIA_PREVIEW_COORDS);if(e)return e.split(/\s+/).map(t=>+t)}set mediaPreviewCoords(e){if(!e){this.removeAttribute(o.MEDIA_PREVIEW_COORDS);return}this.setAttribute(o.MEDIA_PREVIEW_COORDS,e.join(" "))}update(){let e=this.mediaPreviewCoords,t=this.mediaPreviewImage;if(!(e&&t))return;let[a,r,n,s]=e,l=t.split("#")[0],u=getComputedStyle(this),{maxWidth:c,maxHeight:b,minWidth:g,minHeight:v}=u,f=Math.min(parseInt(c)/n,parseInt(b)/s),L=Math.max(parseInt(g)/n,parseInt(v)/s),A=f<1,T=A?f:L>1?L:1,{style:N}=W(this.shadowRoot,":host"),te=W(this.shadowRoot,"img").style,be=this.shadowRoot.querySelector("img"),gt=A?"min":"max";N.setProperty(`${gt}-width`,"initial","important"),N.setProperty(`${gt}-height`,"initial","important"),N.width=`${n*T}px`,N.height=`${s*T}px`;let rt=()=>{te.width=`${this.imgWidth*T}px`,te.height=`${this.imgHeight*T}px`,te.display="block"};be.src!==l&&(be.onload=()=>{this.imgWidth=be.naturalWidth,this.imgHeight=be.naturalHeight,rt()},be.src=l,rt()),rt(),te.transform=`translate(-${a*T}px, -${r*T}px)`}};Ge=new WeakMap;d.customElements.get("media-preview-thumbnail")||d.customElements.define("media-preview-thumbnail",Bs);var vc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},pc=(i,e,t)=>(vc(i,e,"read from private field"),t?t.call(i):e.get(i)),xp=(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)},Dp=(i,e,t,a)=>(vc(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Pa,Hs=class extends xe{constructor(){super(),xp(this,Pa,void 0),Dp(this,Pa,this.shadowRoot.querySelector("slot")),pc(this,Pa).textContent=Pe(0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_PREVIEW_TIME&&a!=null&&(pc(this,Pa).textContent=Pe(parseFloat(a)))}get mediaPreviewTime(){return w(this,o.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){P(this,o.MEDIA_PREVIEW_TIME,e)}};Pa=new WeakMap;d.customElements.get("media-preview-time-display")||d.customElements.define("media-preview-time-display",Hs);var wi={SEEK_OFFSET:"seekoffset"},bn=30,Op=`<svg aria-hidden="true" viewBox="0 0 20 24"><defs><style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style></defs><text class="text value" transform="translate(2.18 19.87)">${bn}</text><path d="M10 6V3L4.37 7 10 10.94V8a5.54 5.54 0 0 1 1.9 10.48v2.12A7.5 7.5 0 0 0 10 6Z"/></svg>`,fc=m.createElement("template");fc.innerHTML=`
869
- <slot name="icon">${Op}</slot>
870
- `;var Np=0,Ws=class extends F{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,wi.SEEK_OFFSET]}constructor(e={}){super({slotTemplate:fc,tooltipContent:I.SEEK_BACKWARD,...e})}connectedCallback(){this.seekOffset=w(this,wi.SEEK_OFFSET,bn),super.connectedCallback()}attributeChangedCallback(e,t,a){e===wi.SEEK_OFFSET&&(this.seekOffset=w(this,wi.SEEK_OFFSET,bn)),super.attributeChangedCallback(e,t,a)}get seekOffset(){return w(this,wi.SEEK_OFFSET,bn)}set seekOffset(e){P(this,wi.SEEK_OFFSET,e),this.setAttribute("aria-label",Y.SEEK_BACK_N_SECS({seekOffset:this.seekOffset})),Lr(Rr(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return w(this,o.MEDIA_CURRENT_TIME,Np)}set mediaCurrentTime(e){P(this,o.MEDIA_CURRENT_TIME,e)}handleClick(){let e=Math.max(this.mediaCurrentTime-this.seekOffset,0),t=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};d.customElements.get("media-seek-backward-button")||d.customElements.define("media-seek-backward-button",Ws);var xi={SEEK_OFFSET:"seekoffset"},gn=30,Pp=`<svg aria-hidden="true" viewBox="0 0 20 24"><defs><style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style></defs><text class="text value" transform="translate(8.9 19.87)">${gn}</text><path d="M10 6V3l5.61 4L10 10.94V8a5.54 5.54 0 0 0-1.9 10.48v2.12A7.5 7.5 0 0 1 10 6Z"/></svg>`,Ec=m.createElement("template");Ec.innerHTML=`
871
- <slot name="icon">${Pp}</slot>
872
- `;var Up=0,$s=class extends F{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,xi.SEEK_OFFSET]}constructor(e={}){super({slotTemplate:Ec,tooltipContent:I.SEEK_FORWARD,...e})}connectedCallback(){this.seekOffset=w(this,xi.SEEK_OFFSET,gn),super.connectedCallback()}attributeChangedCallback(e,t,a){e===xi.SEEK_OFFSET&&(this.seekOffset=w(this,xi.SEEK_OFFSET,gn)),super.attributeChangedCallback(e,t,a)}get seekOffset(){return w(this,xi.SEEK_OFFSET,gn)}set seekOffset(e){P(this,xi.SEEK_OFFSET,e),this.setAttribute("aria-label",Y.SEEK_FORWARD_N_SECS({seekOffset:this.seekOffset})),Lr(Rr(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return w(this,o.MEDIA_CURRENT_TIME,Up)}set mediaCurrentTime(e){P(this,o.MEDIA_CURRENT_TIME,e)}handleClick(){let e=this.mediaCurrentTime+this.seekOffset,t=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};d.customElements.get("media-seek-forward-button")||d.customElements.define("media-seek-forward-button",$s);var Ac=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Fs=(i,e,t)=>(Ac(i,e,"read from private field"),t?t.call(i):e.get(i)),Bp=(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)},Hp=(i,e,t,a)=>(Ac(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Di,De={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},bc=[...Object.values(De),o.MEDIA_CURRENT_TIME,o.MEDIA_DURATION,o.MEDIA_SEEKABLE],gc=["Enter"," "],Wp="&nbsp;/&nbsp;",_c=(i,{timesSep:e=Wp}={})=>{var t,a;let r=i.hasAttribute(De.REMAINING),n=i.hasAttribute(De.SHOW_DURATION),s=(t=i.mediaCurrentTime)!=null?t:0,[,l]=(a=i.mediaSeekable)!=null?a:[],u=0;Number.isFinite(i.mediaDuration)?u=i.mediaDuration:Number.isFinite(l)&&(u=l);let c=r?Pe(0-(u-s)):Pe(s);return n?`${c}${e}${Pe(u)}`:c},$p="video not loaded, unknown time.",Fp=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",$p);return}let n=i.hasAttribute(De.REMAINING),s=i.hasAttribute(De.SHOW_DURATION),l=n?Ht(0-(r-t)):Ht(t);if(!s){i.setAttribute("aria-valuetext",l);return}let u=Ht(r),c=`${l} of ${u}`;i.setAttribute("aria-valuetext",c)},Ks=class extends xe{constructor(){super(),Bp(this,Di,void 0),Hp(this,Di,this.shadowRoot.querySelector("slot")),Fs(this,Di).innerHTML=`${_c(this)}`}static get observedAttributes(){return[...super.observedAttributes,...bc,"disabled"]}connectedCallback(){let{style:e}=W(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",V.PLAYBACK_TIME());let t=a=>{let{key:r}=a;if(!gc.includes(r)){this.removeEventListener("keyup",t);return}this.toggleTimeDisplay()};this.addEventListener("keydown",a=>{let{metaKey:r,altKey:n,key:s}=a;if(r||n||!gc.includes(s)){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){bc.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,De.REMAINING)}set remaining(e){B(this,De.REMAINING,e)}get showDuration(){return H(this,De.SHOW_DURATION)}set showDuration(e){B(this,De.SHOW_DURATION,e)}get noToggle(){return H(this,De.NO_TOGGLE)}set noToggle(e){B(this,De.NO_TOGGLE,e)}get mediaDuration(){return w(this,o.MEDIA_DURATION)}set mediaDuration(e){P(this,o.MEDIA_DURATION,e)}get mediaCurrentTime(){return w(this,o.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){P(this,o.MEDIA_CURRENT_TIME,e)}get mediaSeekable(){let e=this.getAttribute(o.MEDIA_SEEKABLE);if(e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(o.MEDIA_SEEKABLE);return}this.setAttribute(o.MEDIA_SEEKABLE,e.join(":"))}update(){let e=_c(this);Fp(this),e!==Fs(this,Di).innerHTML&&(Fs(this,Di).innerHTML=e)}};Di=new WeakMap;d.customElements.get("media-time-display")||d.customElements.define("media-time-display",Ks);var Tc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ne=(i,e,t)=>(Tc(i,e,"read from private field"),t?t.call(i):e.get(i)),qe=(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)},ye=(i,e,t,a)=>(Tc(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Kp=(i,e,t,a)=>({set _(r){ye(i,e,r,t)},get _(){return ne(i,e,a)}}),Oi,_n,Ni,Ua,An,Tn,yn,Pi,Xt,kn,Sn=class{constructor(e,t,a){qe(this,Oi,void 0),qe(this,_n,void 0),qe(this,Ni,void 0),qe(this,Ua,void 0),qe(this,An,void 0),qe(this,Tn,void 0),qe(this,yn,void 0),qe(this,Pi,void 0),qe(this,Xt,0),qe(this,kn,(r=performance.now())=>{ye(this,Xt,requestAnimationFrame(ne(this,kn))),ye(this,Ua,performance.now()-ne(this,Ni));let n=1e3/this.fps;if(ne(this,Ua)>n){ye(this,Ni,r-ne(this,Ua)%n);let s=1e3/((r-ne(this,_n))/++Kp(this,An)._),l=(r-ne(this,Tn))/1e3/this.duration,u=ne(this,yn)+l*this.playbackRate;u-ne(this,Oi).valueAsNumber>0?ye(this,Pi,this.playbackRate/this.duration/s):(ye(this,Pi,.995*ne(this,Pi)),u=ne(this,Oi).valueAsNumber+ne(this,Pi)),this.callback(u)}}),ye(this,Oi,e),this.callback=t,this.fps=a}start(){ne(this,Xt)===0&&(ye(this,Ni,performance.now()),ye(this,_n,ne(this,Ni)),ye(this,An,0),ne(this,kn).call(this))}stop(){ne(this,Xt)!==0&&(cancelAnimationFrame(ne(this,Xt)),ye(this,Xt,0))}update({start:e,duration:t,playbackRate:a}){let r=e-ne(this,Oi).valueAsNumber,n=Math.abs(t-this.duration);(r>0||r<-.03||n>=.5)&&this.callback(e),ye(this,yn,e),ye(this,Tn,performance.now()),this.duration=t,this.playbackRate=a}};Oi=new WeakMap;_n=new WeakMap;Ni=new WeakMap;Ua=new WeakMap;An=new WeakMap;Tn=new WeakMap;yn=new WeakMap;Pi=new WeakMap;Xt=new WeakMap;kn=new WeakMap;var Zs=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ie=(i,e,t)=>(Zs(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)},Ze=(i,e,t,a)=>(Zs(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),de=(i,e,t)=>(Zs(i,e,"access private method"),t),Ui,Jt,Mn,Ha,Ln,Cn,Wa,$a,Bi,Hi,Ba,Qs,yc,Vs,Rn,zs,wn,Xs,xn,Js,Ys,kc,Fa,Dn,Gs,Sc,Vp="video not loaded, unknown time.",Yp=i=>{let e=i.range,t=Ht(+Cc(i)),a=Ht(+i.mediaSeekableEnd),r=t&&a?`${t} of ${a}`:Vp;e.setAttribute("aria-valuetext",r)},Ic=m.createElement("template");Ic.innerHTML=`
896
+ `;var Ws=class extends d.HTMLElement{constructor(){super(),Gp(this,Ye,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Tc.content.cloneNode(!0)))}static get observedAttributes(){return[S.MEDIA_CONTROLLER,o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,i,a;let r=this.getAttribute(S.MEDIA_CONTROLLER);r&&(bn(this,Ye,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(i=En(this,Ye))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=En(this,Ye))==null?void 0:e.unassociateElement)==null||i.call(e,this),bn(this,Ye,null)}attributeChangedCallback(e,i,a){var r,n,s,l,u;[o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===S.MEDIA_CONTROLLER&&(i&&((n=(r=En(this,Ye))==null?void 0:r.unassociateElement)==null||n.call(r,this),bn(this,Ye,null)),a&&this.isConnected&&(bn(this,Ye,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=En(this,Ye))==null?void 0:l.associateElement)==null||u.call(l,this)))}get mediaPreviewImage(){return R(this,o.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){I(this,o.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewCoords(){let e=this.getAttribute(o.MEDIA_PREVIEW_COORDS);if(e)return e.split(/\s+/).map(i=>+i)}set mediaPreviewCoords(e){if(!e){this.removeAttribute(o.MEDIA_PREVIEW_COORDS);return}this.setAttribute(o.MEDIA_PREVIEW_COORDS,e.join(" "))}update(){let e=this.mediaPreviewCoords,i=this.mediaPreviewImage;if(!(e&&i))return;let[a,r,n,s]=e,l=i.split("#")[0],u=getComputedStyle(this),{maxWidth:c,maxHeight:b,minWidth:g,minHeight:f}=u,v=Math.min(parseInt(c)/n,parseInt(b)/s),L=Math.max(parseInt(g)/n,parseInt(f)/s),A=v<1,T=A?v:L>1?L:1,{style:N}=$(this.shadowRoot,":host"),ee=$(this.shadowRoot,"img").style,be=this.shadowRoot.querySelector("img"),Et=A?"min":"max";N.setProperty(`${Et}-width`,"initial","important"),N.setProperty(`${Et}-height`,"initial","important"),N.width=`${n*T}px`,N.height=`${s*T}px`;let at=()=>{ee.width=`${this.imgWidth*T}px`,ee.height=`${this.imgHeight*T}px`,ee.display="block"};be.src!==l&&(be.onload=()=>{this.imgWidth=be.naturalWidth,this.imgHeight=be.naturalHeight,at()},be.src=l,at()),at(),ee.transform=`translate(-${a*T}px, -${r*T}px)`}};Ye=new WeakMap;d.customElements.get("media-preview-thumbnail")||d.customElements.define("media-preview-thumbnail",Ws);var kc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},yc=(t,e,i)=>(kc(t,e,"read from private field"),i?i.call(t):e.get(t)),qp=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Zp=(t,e,i,a)=>(kc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),La,Fs=class extends Le{constructor(){super(),qp(this,La,void 0),Zp(this,La,this.shadowRoot.querySelector("slot")),yc(this,La).textContent=Ne(0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_PREVIEW_TIME&&a!=null&&(yc(this,La).textContent=Ne(parseFloat(a)))}get mediaPreviewTime(){return M(this,o.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){D(this,o.MEDIA_PREVIEW_TIME,e)}};La=new WeakMap;d.customElements.get("media-preview-time-display")||d.customElements.define("media-preview-time-display",Fs);var Li={SEEK_OFFSET:"seekoffset"},gn=30,Qp=`<svg aria-hidden="true" viewBox="0 0 20 24"><defs><style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style></defs><text class="text value" transform="translate(2.18 19.87)">${gn}</text><path d="M10 6V3L4.37 7 10 10.94V8a5.54 5.54 0 0 1 1.9 10.48v2.12A7.5 7.5 0 0 0 10 6Z"/></svg>`,Sc=h.createElement("template");Sc.innerHTML=`
897
+ <slot name="icon">${Qp}</slot>
898
+ `;var zp=0,Ks=class extends F{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,Li.SEEK_OFFSET]}constructor(e={}){super({slotTemplate:Sc,tooltipContent:C.SEEK_BACKWARD,...e})}connectedCallback(){this.seekOffset=M(this,Li.SEEK_OFFSET,gn),super.connectedCallback()}attributeChangedCallback(e,i,a){e===Li.SEEK_OFFSET&&(this.seekOffset=M(this,Li.SEEK_OFFSET,gn)),super.attributeChangedCallback(e,i,a)}get seekOffset(){return M(this,Li.SEEK_OFFSET,gn)}set seekOffset(e){D(this,Li.SEEK_OFFSET,e),this.setAttribute("aria-label",Y.SEEK_BACK_N_SECS({seekOffset:this.seekOffset})),Ir(Cr(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return M(this,o.MEDIA_CURRENT_TIME,zp)}set mediaCurrentTime(e){D(this,o.MEDIA_CURRENT_TIME,e)}handleClick(){let e=Math.max(this.mediaCurrentTime-this.seekOffset,0),i=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)}};d.customElements.get("media-seek-backward-button")||d.customElements.define("media-seek-backward-button",Ks);var xi={SEEK_OFFSET:"seekoffset"},_n=30,Xp=`<svg aria-hidden="true" viewBox="0 0 20 24"><defs><style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style></defs><text class="text value" transform="translate(8.9 19.87)">${_n}</text><path d="M10 6V3l5.61 4L10 10.94V8a5.54 5.54 0 0 0-1.9 10.48v2.12A7.5 7.5 0 0 1 10 6Z"/></svg>`,Ic=h.createElement("template");Ic.innerHTML=`
899
+ <slot name="icon">${Xp}</slot>
900
+ `;var Jp=0,Vs=class extends F{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,xi.SEEK_OFFSET]}constructor(e={}){super({slotTemplate:Ic,tooltipContent:C.SEEK_FORWARD,...e})}connectedCallback(){this.seekOffset=M(this,xi.SEEK_OFFSET,_n),super.connectedCallback()}attributeChangedCallback(e,i,a){e===xi.SEEK_OFFSET&&(this.seekOffset=M(this,xi.SEEK_OFFSET,_n)),super.attributeChangedCallback(e,i,a)}get seekOffset(){return M(this,xi.SEEK_OFFSET,_n)}set seekOffset(e){D(this,xi.SEEK_OFFSET,e),this.setAttribute("aria-label",Y.SEEK_FORWARD_N_SECS({seekOffset:this.seekOffset})),Ir(Cr(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return M(this,o.MEDIA_CURRENT_TIME,Jp)}set mediaCurrentTime(e){D(this,o.MEDIA_CURRENT_TIME,e)}handleClick(){let e=this.mediaCurrentTime+this.seekOffset,i=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)}};d.customElements.get("media-seek-forward-button")||d.customElements.define("media-seek-forward-button",Vs);var wc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Ys=(t,e,i)=>(wc(t,e,"read from private field"),i?i.call(t):e.get(t)),jp=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},ef=(t,e,i,a)=>(wc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Di,xe={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},Cc=[...Object.values(xe),o.MEDIA_CURRENT_TIME,o.MEDIA_DURATION,o.MEDIA_SEEKABLE],Mc=["Enter"," "],tf="&nbsp;/&nbsp;",Rc=(t,{timesSep:e=tf}={})=>{var i,a;let r=t.hasAttribute(xe.REMAINING),n=t.hasAttribute(xe.SHOW_DURATION),s=(i=t.mediaCurrentTime)!=null?i:0,[,l]=(a=t.mediaSeekable)!=null?a:[],u=0;Number.isFinite(t.mediaDuration)?u=t.mediaDuration:Number.isFinite(l)&&(u=l);let c=r?Ne(0-(u-s)):Ne(s);return n?`${c}${e}${Ne(u)}`:c},af="video not loaded, unknown time.",rf=t=>{var e;let i=t.mediaCurrentTime,[,a]=(e=t.mediaSeekable)!=null?e:[],r=null;if(Number.isFinite(t.mediaDuration)?r=t.mediaDuration:Number.isFinite(a)&&(r=a),i==null||r===null){t.setAttribute("aria-valuetext",af);return}let n=t.hasAttribute(xe.REMAINING),s=t.hasAttribute(xe.SHOW_DURATION),l=n?Pt(0-(r-i)):Pt(i);if(!s){t.setAttribute("aria-valuetext",l);return}let u=Pt(r),c=`${l} of ${u}`;t.setAttribute("aria-valuetext",c)},Gs=class extends Le{constructor(){super(),jp(this,Di,void 0),ef(this,Di,this.shadowRoot.querySelector("slot")),Ys(this,Di).innerHTML=`${Rc(this)}`}static get observedAttributes(){return[...super.observedAttributes,...Cc,"disabled"]}connectedCallback(){let{style:e}=$(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",V.PLAYBACK_TIME());let i=a=>{let{key:r}=a;if(!Mc.includes(r)){this.removeEventListener("keyup",i);return}this.toggleTimeDisplay()};this.addEventListener("keydown",a=>{let{metaKey:r,altKey:n,key:s}=a;if(r||n||!Mc.includes(s)){this.removeEventListener("keyup",i);return}this.addEventListener("keyup",i)}),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,i,a){Cc.includes(e)?this.update():e==="disabled"&&a!==i&&(a==null?this.enable():this.disable()),super.attributeChangedCallback(e,i,a)}enable(){this.tabIndex=0}disable(){this.tabIndex=-1}get remaining(){return H(this,xe.REMAINING)}set remaining(e){U(this,xe.REMAINING,e)}get showDuration(){return H(this,xe.SHOW_DURATION)}set showDuration(e){U(this,xe.SHOW_DURATION,e)}get noToggle(){return H(this,xe.NO_TOGGLE)}set noToggle(e){U(this,xe.NO_TOGGLE,e)}get mediaDuration(){return M(this,o.MEDIA_DURATION)}set mediaDuration(e){D(this,o.MEDIA_DURATION,e)}get mediaCurrentTime(){return M(this,o.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){D(this,o.MEDIA_CURRENT_TIME,e)}get mediaSeekable(){let e=this.getAttribute(o.MEDIA_SEEKABLE);if(e)return e.split(":").map(i=>+i)}set mediaSeekable(e){if(e==null){this.removeAttribute(o.MEDIA_SEEKABLE);return}this.setAttribute(o.MEDIA_SEEKABLE,e.join(":"))}update(){let e=Rc(this);rf(this),e!==Ys(this,Di).innerHTML&&(Ys(this,Di).innerHTML=e)}};Di=new WeakMap;d.customElements.get("media-time-display")||d.customElements.define("media-time-display",Gs);var Lc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},re=(t,e,i)=>(Lc(t,e,"read from private field"),i?i.call(t):e.get(t)),Ge=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},ye=(t,e,i,a)=>(Lc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),nf=(t,e,i,a)=>({set _(r){ye(t,e,r,i)},get _(){return re(t,e,a)}}),Oi,An,Ni,xa,Tn,yn,kn,Pi,zt,Sn,In=class{constructor(e,i,a){Ge(this,Oi,void 0),Ge(this,An,void 0),Ge(this,Ni,void 0),Ge(this,xa,void 0),Ge(this,Tn,void 0),Ge(this,yn,void 0),Ge(this,kn,void 0),Ge(this,Pi,void 0),Ge(this,zt,0),Ge(this,Sn,(r=performance.now())=>{ye(this,zt,requestAnimationFrame(re(this,Sn))),ye(this,xa,performance.now()-re(this,Ni));let n=1e3/this.fps;if(re(this,xa)>n){ye(this,Ni,r-re(this,xa)%n);let s=1e3/((r-re(this,An))/++nf(this,Tn)._),l=(r-re(this,yn))/1e3/this.duration,u=re(this,kn)+l*this.playbackRate;u-re(this,Oi).valueAsNumber>0?ye(this,Pi,this.playbackRate/this.duration/s):(ye(this,Pi,.995*re(this,Pi)),u=re(this,Oi).valueAsNumber+re(this,Pi)),this.callback(u)}}),ye(this,Oi,e),this.callback=i,this.fps=a}start(){re(this,zt)===0&&(ye(this,Ni,performance.now()),ye(this,An,re(this,Ni)),ye(this,Tn,0),re(this,Sn).call(this))}stop(){re(this,zt)!==0&&(cancelAnimationFrame(re(this,zt)),ye(this,zt,0))}update({start:e,duration:i,playbackRate:a}){let r=e-re(this,Oi).valueAsNumber,n=Math.abs(i-this.duration);(r>0||r<-.03||n>=.5)&&this.callback(e),ye(this,kn,e),ye(this,yn,performance.now()),this.duration=i,this.playbackRate=a}};Oi=new WeakMap;An=new WeakMap;Ni=new WeakMap;xa=new WeakMap;Tn=new WeakMap;yn=new WeakMap;kn=new WeakMap;Pi=new WeakMap;zt=new WeakMap;Sn=new WeakMap;var Xs=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},te=(t,e,i)=>(Xs(t,e,"read from private field"),i?i.call(t):e.get(t)),ne=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},qe=(t,e,i,a)=>(Xs(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),le=(t,e,i)=>(Xs(t,e,"access private method"),i),Ui,Xt,Rn,Oa,wn,Mn,Na,Pa,Bi,Hi,Da,Js,xc,qs,Ln,js,xn,el,Dn,tl,Zs,Dc,Ua,On,Qs,Oc,of="video not loaded, unknown time.",sf=t=>{let e=t.range,i=Pt(+Pc(t)),a=Pt(+t.mediaSeekableEnd),r=i&&a?`${i} of ${a}`:of;e.setAttribute("aria-valuetext",r)},Nc=h.createElement("template");Nc.innerHTML=`
873
901
  <style>
874
902
  :host {
875
903
  --media-box-border-radius: 4px;
@@ -1082,7 +1110,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
1082
1110
 
1083
1111
  </slot>
1084
1112
  </div>
1085
- `;var In=(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))},Cc=(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},qs=class extends Qt{constructor(){super(),oe(this,Hi),oe(this,Qs),oe(this,Rn),oe(this,wn),oe(this,xn),oe(this,Ys),oe(this,Fa),oe(this,Gs),oe(this,Ui,void 0),oe(this,Jt,void 0),oe(this,Mn,void 0),oe(this,Ha,void 0),oe(this,Ln,void 0),oe(this,Cn,void 0),oe(this,Wa,void 0),oe(this,$a,void 0),oe(this,Bi,void 0),oe(this,Vs,a=>{this.dragging||(Ei(a)&&(this.range.valueAsNumber=a),this.updateBar())}),this.container.appendChild(Ic.content.cloneNode(!0)),this.shadowRoot.querySelector("#track").insertAdjacentHTML("afterbegin",'<div id="buffered" part="buffered"></div>'),Ze(this,Mn,this.shadowRoot.querySelectorAll('[part~="box"]')),Ze(this,Ln,this.shadowRoot.querySelector('[part~="preview-box"]')),Ze(this,Cn,this.shadowRoot.querySelector('[part~="current-box"]'));let t=getComputedStyle(this);Ze(this,Wa,parseInt(t.getPropertyValue("--media-box-padding-left"))),Ze(this,$a,parseInt(t.getPropertyValue("--media-box-padding-right"))),Ze(this,Jt,new Sn(this.range,ie(this,Vs),60))}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PAUSED,o.MEDIA_DURATION,o.MEDIA_SEEKABLE,o.MEDIA_CURRENT_TIME,o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_TIME,o.MEDIA_PREVIEW_CHAPTER,o.MEDIA_BUFFERED,o.MEDIA_PLAYBACK_RATE,o.MEDIA_LOADING,o.MEDIA_ENDED]}connectedCallback(){var e;super.connectedCallback(),this.range.setAttribute("aria-label",V.SEEK()),de(this,Hi,Ba).call(this),Ze(this,Ui,this.getRootNode()),(e=ie(this,Ui))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),de(this,Hi,Ba).call(this),(e=ie(this,Ui))==null||e.removeEventListener("transitionstart",this),Ze(this,Ui,null)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),t!=a&&(e===o.MEDIA_CURRENT_TIME||e===o.MEDIA_PAUSED||e===o.MEDIA_ENDED||e===o.MEDIA_LOADING||e===o.MEDIA_DURATION||e===o.MEDIA_SEEKABLE?(ie(this,Jt).update({start:In(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),de(this,Hi,Ba).call(this),Yp(this)):e===o.MEDIA_BUFFERED&&this.updateBufferedBar(),(e===o.MEDIA_DURATION||e===o.MEDIA_SEEKABLE)&&(this.mediaChaptersCues=ie(this,Bi),this.updateBar()))}get mediaChaptersCues(){return ie(this,Bi)}set mediaChaptersCues(e){var t;Ze(this,Bi,e),this.updateSegments((t=ie(this,Bi))==null?void 0:t.map(a=>({start:In(this,a.startTime),end:In(this,a.endTime)})))}get mediaPaused(){return H(this,o.MEDIA_PAUSED)}set mediaPaused(e){B(this,o.MEDIA_PAUSED,e)}get mediaLoading(){return H(this,o.MEDIA_LOADING)}set mediaLoading(e){B(this,o.MEDIA_LOADING,e)}get mediaDuration(){return w(this,o.MEDIA_DURATION)}set mediaDuration(e){P(this,o.MEDIA_DURATION,e)}get mediaCurrentTime(){return w(this,o.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){P(this,o.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return w(this,o.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){P(this,o.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){let e=this.getAttribute(o.MEDIA_BUFFERED);return e?e.split(" ").map(t=>t.split(":").map(a=>+a)):[]}set mediaBuffered(e){if(!e){this.removeAttribute(o.MEDIA_BUFFERED);return}let t=e.map(a=>a.join(":")).join(" ");this.setAttribute(o.MEDIA_BUFFERED,t)}get mediaSeekable(){let e=this.getAttribute(o.MEDIA_SEEKABLE);if(e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(o.MEDIA_SEEKABLE);return}this.setAttribute(o.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 x(this,o.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){M(this,o.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return w(this,o.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){P(this,o.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return H(this,o.MEDIA_ENDED)}set mediaEnded(e){B(this,o.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,[,s=this.mediaSeekableStart]=(e=t.find(([l,u])=>l<=n&&n<=u))!=null?e:[];a=In(this,s)}let{style:r}=W(this.shadowRoot,"#buffered");r.setProperty("width",`${a*100}%`)}updateCurrentBox(){if(!this.shadowRoot.querySelector('slot[name="current"]').assignedElements().length)return;let t=W(this.shadowRoot,"#current-rail"),a=W(this.shadowRoot,'[part~="current-box"]'),r=de(this,Rn,zs).call(this,ie(this,Cn)),n=de(this,wn,Xs).call(this,r,this.range.valueAsNumber),s=de(this,xn,Js).call(this,r,this.range.valueAsNumber);t.style.transform=`translateX(${n})`,t.style.setProperty("--_range-width",`${r.range.width}`),a.style.setProperty("--_box-shift",`${s}`),a.style.setProperty("--_box-width",`${r.box.width}px`),a.style.setProperty("visibility","initial")}handleEvent(e){switch(super.handleEvent(e),e.type){case"input":de(this,Gs,Sc).call(this);break;case"pointermove":de(this,Ys,kc).call(this,e);break;case"pointerup":case"pointerleave":de(this,Fa,Dn).call(this,null);break;case"transitionstart":ce(e.target,this)&&setTimeout(()=>de(this,Hi,Ba).call(this),0);break}}};Ui=new WeakMap;Jt=new WeakMap;Mn=new WeakMap;Ha=new WeakMap;Ln=new WeakMap;Cn=new WeakMap;Wa=new WeakMap;$a=new WeakMap;Bi=new WeakMap;Hi=new WeakSet;Ba=function(){de(this,Qs,yc).call(this)?ie(this,Jt).start():ie(this,Jt).stop()};Qs=new WeakSet;yc=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&$d(this)};Vs=new WeakMap;Rn=new WeakSet;zs=function(i){var e;let a=((e=this.getAttribute("bounds")?Ue(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?e:this).getBoundingClientRect(),r=this.range.getBoundingClientRect(),n=i.offsetWidth,s=-(r.left-a.left-n/2),l=a.right-r.left-n/2;return{box:{width:n,min:s,max:l},bounds:a,range:r}};wn=new WeakSet;Xs=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 l=`calc(1 / var(--_range-width) * 100 * ${n}% - var(--media-box-padding-right))`;t=`min(${t}, ${l})`}return t};xn=new WeakSet;Js=function(i,e){let{width:t,min:a,max:r}=i.box,n=e*i.range.width;if(n<a+ie(this,Wa)){let s=i.range.left-i.bounds.left-ie(this,Wa);return`${n-t/2+s}px`}if(n>r-ie(this,$a)){let s=i.bounds.right-i.range.right-ie(this,$a);return`${n+t/2-s-i.range.width}px`}return 0};Ys=new WeakSet;kc=function(i){let e=[...ie(this,Mn)].some(b=>i.composedPath().includes(b));if(!this.dragging&&(e||!i.composedPath().includes(this))){de(this,Fa,Dn).call(this,null);return}let t=this.mediaSeekableEnd;if(!t)return;let a=W(this.shadowRoot,"#preview-rail"),r=W(this.shadowRoot,'[part~="preview-box"]'),n=de(this,Rn,zs).call(this,ie(this,Ln)),s=(i.clientX-n.range.left)/n.range.width;s=Math.max(0,Math.min(1,s));let l=de(this,wn,Xs).call(this,n,s),u=de(this,xn,Js).call(this,n,s);a.style.transform=`translateX(${l})`,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(ie(this,Ha))-Math.round(s*t);Math.abs(c)<1&&s>.01&&s<.99||(Ze(this,Ha,s*t),de(this,Fa,Dn).call(this,ie(this,Ha)))};Fa=new WeakSet;Dn=function(i){this.dispatchEvent(new d.CustomEvent(p.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:i}))};Gs=new WeakSet;Sc=function(){ie(this,Jt).stop();let i=Cc(this);this.dispatchEvent(new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:i}))};d.customElements.get("media-time-range")||d.customElements.define("media-time-range",qs);var Wi={PLACEMENT:"placement",BOUNDS:"bounds"},Mc=m.createElement("template");Mc.innerHTML=`
1113
+ `;var Cn=(t,e=t.mediaCurrentTime)=>{let i=Number.isFinite(t.mediaSeekableStart)?t.mediaSeekableStart:0,a=Number.isFinite(t.mediaDuration)?t.mediaDuration:t.mediaSeekableEnd;if(Number.isNaN(a))return 0;let r=(e-i)/(a-i);return Math.max(0,Math.min(r,1))},Pc=(t,e=t.range.valueAsNumber)=>{let i=Number.isFinite(t.mediaSeekableStart)?t.mediaSeekableStart:0,a=Number.isFinite(t.mediaDuration)?t.mediaDuration:t.mediaSeekableEnd;return Number.isNaN(a)?0:e*(a-i)+i},zs=class extends Zt{constructor(){super(),ne(this,Hi),ne(this,Js),ne(this,Ln),ne(this,xn),ne(this,Dn),ne(this,Zs),ne(this,Ua),ne(this,Qs),ne(this,Ui,void 0),ne(this,Xt,void 0),ne(this,Rn,void 0),ne(this,Oa,void 0),ne(this,wn,void 0),ne(this,Mn,void 0),ne(this,Na,void 0),ne(this,Pa,void 0),ne(this,Bi,void 0),ne(this,qs,a=>{this.dragging||(Ei(a)&&(this.range.valueAsNumber=a),this.updateBar())}),this.container.appendChild(Nc.content.cloneNode(!0)),this.shadowRoot.querySelector("#track").insertAdjacentHTML("afterbegin",'<div id="buffered" part="buffered"></div>'),qe(this,Rn,this.shadowRoot.querySelectorAll('[part~="box"]')),qe(this,wn,this.shadowRoot.querySelector('[part~="preview-box"]')),qe(this,Mn,this.shadowRoot.querySelector('[part~="current-box"]'));let i=getComputedStyle(this);qe(this,Na,parseInt(i.getPropertyValue("--media-box-padding-left"))),qe(this,Pa,parseInt(i.getPropertyValue("--media-box-padding-right"))),qe(this,Xt,new In(this.range,te(this,qs),60))}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PAUSED,o.MEDIA_DURATION,o.MEDIA_SEEKABLE,o.MEDIA_CURRENT_TIME,o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_TIME,o.MEDIA_PREVIEW_CHAPTER,o.MEDIA_BUFFERED,o.MEDIA_PLAYBACK_RATE,o.MEDIA_LOADING,o.MEDIA_ENDED]}connectedCallback(){var e;super.connectedCallback(),this.range.setAttribute("aria-label",V.SEEK()),le(this,Hi,Da).call(this),qe(this,Ui,this.getRootNode()),(e=te(this,Ui))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),le(this,Hi,Da).call(this),(e=te(this,Ui))==null||e.removeEventListener("transitionstart",this),qe(this,Ui,null)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),i!=a&&(e===o.MEDIA_CURRENT_TIME||e===o.MEDIA_PAUSED||e===o.MEDIA_ENDED||e===o.MEDIA_LOADING||e===o.MEDIA_DURATION||e===o.MEDIA_SEEKABLE?(te(this,Xt).update({start:Cn(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),le(this,Hi,Da).call(this),sf(this)):e===o.MEDIA_BUFFERED&&this.updateBufferedBar(),(e===o.MEDIA_DURATION||e===o.MEDIA_SEEKABLE)&&(this.mediaChaptersCues=te(this,Bi),this.updateBar()))}get mediaChaptersCues(){return te(this,Bi)}set mediaChaptersCues(e){var i;qe(this,Bi,e),this.updateSegments((i=te(this,Bi))==null?void 0:i.map(a=>({start:Cn(this,a.startTime),end:Cn(this,a.endTime)})))}get mediaPaused(){return H(this,o.MEDIA_PAUSED)}set mediaPaused(e){U(this,o.MEDIA_PAUSED,e)}get mediaLoading(){return H(this,o.MEDIA_LOADING)}set mediaLoading(e){U(this,o.MEDIA_LOADING,e)}get mediaDuration(){return M(this,o.MEDIA_DURATION)}set mediaDuration(e){D(this,o.MEDIA_DURATION,e)}get mediaCurrentTime(){return M(this,o.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){D(this,o.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return M(this,o.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){D(this,o.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){let e=this.getAttribute(o.MEDIA_BUFFERED);return e?e.split(" ").map(i=>i.split(":").map(a=>+a)):[]}set mediaBuffered(e){if(!e){this.removeAttribute(o.MEDIA_BUFFERED);return}let i=e.map(a=>a.join(":")).join(" ");this.setAttribute(o.MEDIA_BUFFERED,i)}get mediaSeekable(){let e=this.getAttribute(o.MEDIA_SEEKABLE);if(e)return e.split(":").map(i=>+i)}set mediaSeekable(e){if(e==null){this.removeAttribute(o.MEDIA_SEEKABLE);return}this.setAttribute(o.MEDIA_SEEKABLE,e.join(":"))}get mediaSeekableEnd(){var e;let[,i=this.mediaDuration]=(e=this.mediaSeekable)!=null?e:[];return i}get mediaSeekableStart(){var e;let[i=0]=(e=this.mediaSeekable)!=null?e:[];return i}get mediaPreviewImage(){return R(this,o.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){I(this,o.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return M(this,o.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){D(this,o.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return H(this,o.MEDIA_ENDED)}set mediaEnded(e){U(this,o.MEDIA_ENDED,e)}updateBar(){super.updateBar(),this.updateBufferedBar(),this.updateCurrentBox()}updateBufferedBar(){var e;let i=this.mediaBuffered;if(!i.length)return;let a;if(this.mediaEnded)a=1;else{let n=this.mediaCurrentTime,[,s=this.mediaSeekableStart]=(e=i.find(([l,u])=>l<=n&&n<=u))!=null?e:[];a=Cn(this,s)}let{style:r}=$(this.shadowRoot,"#buffered");r.setProperty("width",`${a*100}%`)}updateCurrentBox(){if(!this.shadowRoot.querySelector('slot[name="current"]').assignedElements().length)return;let i=$(this.shadowRoot,"#current-rail"),a=$(this.shadowRoot,'[part~="current-box"]'),r=le(this,Ln,js).call(this,te(this,Mn)),n=le(this,xn,el).call(this,r,this.range.valueAsNumber),s=le(this,Dn,tl).call(this,r,this.range.valueAsNumber);i.style.transform=`translateX(${n})`,i.style.setProperty("--_range-width",`${r.range.width}`),a.style.setProperty("--_box-shift",`${s}`),a.style.setProperty("--_box-width",`${r.box.width}px`),a.style.setProperty("visibility","initial")}handleEvent(e){switch(super.handleEvent(e),e.type){case"input":le(this,Qs,Oc).call(this);break;case"pointermove":le(this,Zs,Dc).call(this,e);break;case"pointerup":case"pointerleave":le(this,Ua,On).call(this,null);break;case"transitionstart":ue(e.target,this)&&setTimeout(()=>le(this,Hi,Da).call(this),0);break}}};Ui=new WeakMap;Xt=new WeakMap;Rn=new WeakMap;Oa=new WeakMap;wn=new WeakMap;Mn=new WeakMap;Na=new WeakMap;Pa=new WeakMap;Bi=new WeakMap;Hi=new WeakSet;Da=function(){le(this,Js,xc).call(this)?te(this,Xt).start():te(this,Xt).stop()};Js=new WeakSet;xc=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&Mr(this)};qs=new WeakMap;Ln=new WeakSet;js=function(t){var e;let a=((e=this.getAttribute("bounds")?Pe(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?e:this).getBoundingClientRect(),r=this.range.getBoundingClientRect(),n=t.offsetWidth,s=-(r.left-a.left-n/2),l=a.right-r.left-n/2;return{box:{width:n,min:s,max:l},bounds:a,range:r}};xn=new WeakSet;el=function(t,e){let i=`${e*100}%`,{width:a,min:r,max:n}=t.box;if(!a)return i;if(Number.isNaN(r)||(i=`max(${`calc(1 / var(--_range-width) * 100 * ${r}% + var(--media-box-padding-left))`}, ${i})`),!Number.isNaN(n)){let l=`calc(1 / var(--_range-width) * 100 * ${n}% - var(--media-box-padding-right))`;i=`min(${i}, ${l})`}return i};Dn=new WeakSet;tl=function(t,e){let{width:i,min:a,max:r}=t.box,n=e*t.range.width;if(n<a+te(this,Na)){let s=t.range.left-t.bounds.left-te(this,Na);return`${n-i/2+s}px`}if(n>r-te(this,Pa)){let s=t.bounds.right-t.range.right-te(this,Pa);return`${n+i/2-s-t.range.width}px`}return 0};Zs=new WeakSet;Dc=function(t){let e=[...te(this,Rn)].some(b=>t.composedPath().includes(b));if(!this.dragging&&(e||!t.composedPath().includes(this))){le(this,Ua,On).call(this,null);return}let i=this.mediaSeekableEnd;if(!i)return;let a=$(this.shadowRoot,"#preview-rail"),r=$(this.shadowRoot,'[part~="preview-box"]'),n=le(this,Ln,js).call(this,te(this,wn)),s=(t.clientX-n.range.left)/n.range.width;s=Math.max(0,Math.min(1,s));let l=le(this,xn,el).call(this,n,s),u=le(this,Dn,tl).call(this,n,s);a.style.transform=`translateX(${l})`,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(te(this,Oa))-Math.round(s*i);Math.abs(c)<1&&s>.01&&s<.99||(qe(this,Oa,s*i),le(this,Ua,On).call(this,te(this,Oa)))};Ua=new WeakSet;On=function(t){this.dispatchEvent(new d.CustomEvent(p.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:t}))};Qs=new WeakSet;Oc=function(){te(this,Xt).stop();let t=Pc(this);this.dispatchEvent(new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:t}))};d.customElements.get("media-time-range")||d.customElements.define("media-time-range",zs);var $i={PLACEMENT:"placement",BOUNDS:"bounds"},Uc=h.createElement("template");Uc.innerHTML=`
1086
1114
  <style>
1087
1115
  :host {
1088
1116
  --_tooltip-background-color: var(--media-tooltip-background-color, var(--media-secondary-color, rgba(20, 20, 30, .7)));
@@ -1192,8 +1220,8 @@ svg, img, ::slotted(svg), ::slotted(img) {
1192
1220
  </style>
1193
1221
  <slot></slot>
1194
1222
  <div id="arrow"></div>
1195
- `;var js=class extends d.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;let t=this.placement;if(t==="left"||t==="right"){this.style.removeProperty("--media-tooltip-offset-x");return}let a=getComputedStyle(this),r=(e=Ue(this,"#"+this.bounds))!=null?e:Z(this);if(!r)return;let{x:n,width:s}=r.getBoundingClientRect(),{x:l,width:u}=this.getBoundingClientRect(),c=l+u,b=n+s,g=a.getPropertyValue("--media-tooltip-offset-x"),v=g?parseFloat(g.replace("px","")):0,f=a.getPropertyValue("--media-tooltip-container-margin"),L=f?parseFloat(f.replace("px","")):0,A=l-n+v-L,T=c-b+v+L;if(A<0){this.style.setProperty("--media-tooltip-offset-x",`${A}px`);return}if(T>0){this.style.setProperty("--media-tooltip-offset-x",`${T}px`);return}this.style.removeProperty("--media-tooltip-offset-x")},this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Mc.content.cloneNode(!0))),this.arrowEl=this.shadowRoot.querySelector("#arrow"),Object.prototype.hasOwnProperty.call(this,"placement")){let e=this.placement;delete this.placement,this.placement=e}}static get observedAttributes(){return[Wi.PLACEMENT,Wi.BOUNDS]}get placement(){return x(this,Wi.PLACEMENT)}set placement(e){M(this,Wi.PLACEMENT,e)}get bounds(){return x(this,Wi.BOUNDS)}set bounds(e){M(this,Wi.BOUNDS,e)}};d.customElements.get("media-tooltip")||d.customElements.define("media-tooltip",js);var Gp=1,qp=i=>i.mediaMuted?0:i.mediaVolume,Zp=i=>`${Math.round(i*100)}%`,el=class extends Qt{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME,o.MEDIA_MUTED,o.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",()=>{let e=this.range.value,t=new d.CustomEvent(p.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",V.VOLUME())}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),(e===o.MEDIA_VOLUME||e===o.MEDIA_MUTED)&&(this.range.valueAsNumber=qp(this),this.range.setAttribute("aria-valuetext",Zp(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return w(this,o.MEDIA_VOLUME,Gp)}set mediaVolume(e){P(this,o.MEDIA_VOLUME,e)}get mediaMuted(){return H(this,o.MEDIA_MUTED)}set mediaMuted(e){B(this,o.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return x(this,o.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){M(this,o.MEDIA_VOLUME_UNAVAILABLE,e)}};d.customElements.get("media-volume-range")||d.customElements.define("media-volume-range",el);var E=ph(require("@mux/mux-video")),S=require("@mux/playback-core");var Hc=require("@mux/mux-video");var Oc=require("@mux/playback-core");var ti=require("@mux/playback-core");function Lc(i){let e="";return Object.entries(i).forEach(([t,a])=>{a!=null&&(e+=`${On(t)}: ${a}; `)}),e?e.trim():void 0}function On(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Nn(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function fe(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function tl(i){let e=Qp(i).toString();return e?"?"+e:""}function Qp(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var il=(i,e)=>!i||!e?!1:i.contains(e)?!0:il(i,e.getRootNode().host);var Rc="mux.com",zp=()=>{try{return"3.1.0"}catch{}return"UNKNOWN"},Xp=zp(),Un=()=>Xp,wc=(i,{token:e,customDomain:t=Rc,thumbnailTime:a,programTime:r}={})=>{var l;let n=e==null?a:void 0,{aud:s}=(l=(0,ti.parseJwt)(e))!=null?l:{};if(!(e&&s!=="t"))return`https://image.${t}/${i}/thumbnail.webp${tl({token:e,time:n,program_time:r})}`},xc=(i,{token:e,customDomain:t=Rc,programStartTime:a,programEndTime:r}={})=>{var s;let{aud:n}=(s=(0,ti.parseJwt)(e))!=null?s:{};if(!(e&&n!=="s"))return`https://image.${t}/${i}/storyboard.vtt${tl({token:e,format:"webp",program_start_time:a,program_end_time:r})}`},Ka=i=>{if(i){if([ti.StreamTypes.LIVE,ti.StreamTypes.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return ti.StreamTypes.LIVE}};var Jp={crossorigin:"crossOrigin",playsinline:"playsInline"};function Dc(i){var e;return(e=Jp[i])!=null?e:Nn(i)}var jt,ei,me,Pn=class{constructor(e,t){X(this,jt,void 0);X(this,ei,void 0);X(this,me,[]);Se(this,jt,e),Se(this,ei,t)}[Symbol.iterator](){return R(this,me).values()}get length(){return R(this,me).length}get value(){var e;return(e=R(this,me).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(Se(this,me,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return R(this,me)[e]}values(){return R(this,me).values()}keys(){return R(this,me).keys()}forEach(e){R(this,me).forEach(e)}add(...e){var t,a;e.forEach(r=>{this.contains(r)||R(this,me).push(r)}),!(this.value===""&&!((t=R(this,jt))!=null&&t.hasAttribute(`${R(this,ei)}`)))&&((a=R(this,jt))==null||a.setAttribute(`${R(this,ei)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>{R(this,me).splice(R(this,me).indexOf(a),1)}),(t=R(this,jt))==null||t.setAttribute(`${R(this,ei)}`,`${this.value}`)}contains(e){return R(this,me).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)}};jt=new WeakMap,ei=new WeakMap,me=new WeakMap;var Nc=`[mux-player ${Un()}]`;function Qe(...i){console.warn(Nc,...i)}function Ee(...i){console.error(Nc,...i)}function al(i){var t;let e=(t=i.message)!=null?t:"";i.context&&(e+=` ${i.context}`),i.file&&(e+=` ${(0,Oc.i18n)("Read more: ")}
1196
- https://github.com/muxinc/elements/blob/main/errors/${i.file}`),Qe(e)}var ue={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},ii={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},Uc=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}}),jp=Hc.VideoEvents.filter(i=>i!=="error"),ev=Object.values(ue).filter(i=>![ue.PLAYSINLINE].includes(i)),tv=Object.values(ii),$i,rl=class extends Q.HTMLElement{constructor(){super();X(this,$i,new WeakMap);let t=r=>{for(let n of r)n.type==="childList"&&(n.removedNodes.forEach(s=>{var l;(l=R(this,$i).get(s))==null||l.remove()}),n.addedNodes.forEach(s=>{var u;let l=s;l!=null&&l.slot||(u=this.media)==null||u.append(Bc(R(this,$i),s))}))};new MutationObserver(t).observe(this,{childList:!0,subtree:!0})}static get observedAttributes(){return[...ev,...tv]}init(){this.querySelectorAll(":scope > :not([slot])").forEach(t=>{var a;(a=this.media)==null||a.append(Bc(R(this,$i),t))}),jp.forEach(t=>{var a;(a=this.media)==null||a.addEventListener(t,r=>{this.dispatchEvent(new Event(r.type))})})}attributeChangedCallback(t,a,r){var n,s;switch(t){case ii.MUTED:{this.media&&(this.media.muted=r!=null,this.media.defaultMuted=r!=null);return}case ii.VOLUME:{let l=(n=fe(r))!=null?n:1;this.media&&(this.media.volume=l);return}case ii.PLAYBACKRATE:{let l=(s=fe(r))!=null?s:1;this.media&&(this.media.playbackRate=l,this.media.defaultPlaybackRate=l);return}}}play(){var t,a;return(a=(t=this.media)==null?void 0:t.play())!=null?a:Promise.reject()}pause(){var t;(t=this.media)==null||t.pause()}load(){var t;(t=this.media)==null||t.load()}requestCast(t){var a;return(a=this.media)==null?void 0:a.requestCast(t)}get media(){var t;return(t=this.shadowRoot)==null?void 0:t.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 t,a;return(a=(t=this.media)==null?void 0:t.paused)!=null?a:!0}get duration(){var t,a;return(a=(t=this.media)==null?void 0:t.duration)!=null?a:NaN}get ended(){var t,a;return(a=(t=this.media)==null?void 0:t.ended)!=null?a:!1}get buffered(){var t,a;return(a=(t=this.media)==null?void 0:t.buffered)!=null?a:Uc}get seekable(){var t,a;return(a=(t=this.media)==null?void 0:t.seekable)!=null?a:Uc}get readyState(){var t,a;return(a=(t=this.media)==null?void 0:t.readyState)!=null?a:0}get videoWidth(){var t,a;return(a=(t=this.media)==null?void 0:t.videoWidth)!=null?a:0}get videoHeight(){var t,a;return(a=(t=this.media)==null?void 0:t.videoHeight)!=null?a:0}get currentSrc(){var t,a;return(a=(t=this.media)==null?void 0:t.currentSrc)!=null?a:""}get currentTime(){var t,a;return(a=(t=this.media)==null?void 0:t.currentTime)!=null?a:0}set currentTime(t){this.media&&(this.media.currentTime=Number(t))}get volume(){var t,a;return(a=(t=this.media)==null?void 0:t.volume)!=null?a:1}set volume(t){this.media&&(this.media.volume=Number(t))}get playbackRate(){var t,a;return(a=(t=this.media)==null?void 0:t.playbackRate)!=null?a:1}set playbackRate(t){this.media&&(this.media.playbackRate=Number(t))}get defaultPlaybackRate(){var t;return(t=fe(this.getAttribute(ii.PLAYBACKRATE)))!=null?t:1}set defaultPlaybackRate(t){t!=null?this.setAttribute(ii.PLAYBACKRATE,`${t}`):this.removeAttribute(ii.PLAYBACKRATE)}get crossOrigin(){return Va(this,ue.CROSSORIGIN)}set crossOrigin(t){this.setAttribute(ue.CROSSORIGIN,`${t}`)}get autoplay(){return Va(this,ue.AUTOPLAY)!=null}set autoplay(t){t?this.setAttribute(ue.AUTOPLAY,typeof t=="string"?t:""):this.removeAttribute(ue.AUTOPLAY)}get loop(){return Va(this,ue.LOOP)!=null}set loop(t){t?this.setAttribute(ue.LOOP,""):this.removeAttribute(ue.LOOP)}get muted(){var t,a;return(a=(t=this.media)==null?void 0:t.muted)!=null?a:!1}set muted(t){this.media&&(this.media.muted=!!t)}get defaultMuted(){return Va(this,ue.MUTED)!=null}set defaultMuted(t){t?this.setAttribute(ue.MUTED,""):this.removeAttribute(ue.MUTED)}get playsInline(){return Va(this,ue.PLAYSINLINE)!=null}set playsInline(t){Ee("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(t){["","none","metadata","auto"].includes(t)?this.setAttribute(ue.PRELOAD,t):this.removeAttribute(ue.PRELOAD)}};$i=new WeakMap;function Va(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}function Bc(i,e){let t=i.get(e);return t||(t=e.cloneNode(),i.set(e,t)),t}var nl=rl;var Vc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},y=(i,e,t)=>(Vc(i,e,"read from private field"),t?t.call(i):e.get(i)),ze=(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)=>(Vc(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Fi,Bn,ai,Ya,Lt,Rt,wt,ri,Ki,Hn,Oe,Wc=1,$c=0,iv=1,av={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 he&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=n:typeof n=="function"&&r instanceof he?r.element[r.attributeName]=n:r.value=n}}}},ht=class extends d.DocumentFragment{constructor(e,t,a=av){var r;super(),ze(this,Fi,void 0),ze(this,Bn,void 0),this.append(e.content.cloneNode(!0)),mt(this,Fi,Yc(this)),mt(this,Bn,a),(r=a.createCallback)==null||r.call(a,this,y(this,Fi),t),a.processCallback(this,y(this,Fi),t)}update(e){y(this,Bn).processCallback(this,y(this,Fi),e)}};Fi=new WeakMap;Bn=new WeakMap;var Yc=(i,e=[])=>{let t,a;for(let r of i.attributes||[])if(r.value.includes("{{")){let n=new ol;for([t,a]of Kc(r.value))if(!t)n.append(a);else{let s=new he(i,r.name,r.namespaceURI);n.append(s),e.push([a,s])}r.value=n.toString()}for(let r of i.childNodes)if(r.nodeType===Wc&&!(r instanceof HTMLTemplateElement))Yc(r,e);else{let n=r.data;if(r.nodeType===Wc||n.includes("{{")){let s=[];if(n)for([t,a]of Kc(n))if(!t)s.push(new Text(a));else{let l=new pt(i);s.push(l),e.push([a,l])}else if(r instanceof HTMLTemplateElement){let l=new Ga(i,r);s.push(l),e.push([l.expression,l])}r.replaceWith(...s.flatMap(l=>l.replacementNodes||[l]))}}return e},Fc={},Kc=i=>{let e="",t=0,a=Fc[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([$c,e]),e="",r++):n==="}"&&i[r+1]==="}"&&i[r-1]!=="\\"&&!--t?(a.push([iv,e.trim()]),e="",r++):e+=n||"";return e&&a.push([$c,(t>0?"{{":"")+e]),Fc[i]=a},rv=11,Wn=class{get value(){return""}set value(e){}toString(){return this.value}},Gc=new WeakMap,ol=class{constructor(){ze(this,ai,[])}[Symbol.iterator](){return y(this,ai).values()}get length(){return y(this,ai).length}item(e){return y(this,ai)[e]}append(...e){for(let t of e)t instanceof he&&Gc.set(t,this),y(this,ai).push(t)}toString(){return y(this,ai).join("")}};ai=new WeakMap;var he=class extends Wn{constructor(e,t,a){super(),ze(this,ri),ze(this,Ya,""),ze(this,Lt,void 0),ze(this,Rt,void 0),ze(this,wt,void 0),mt(this,Lt,e),mt(this,Rt,t),mt(this,wt,a)}get attributeName(){return y(this,Rt)}get attributeNamespace(){return y(this,wt)}get element(){return y(this,Lt)}get value(){return y(this,Ya)}set value(e){y(this,Ya)!==e&&(mt(this,Ya,e),!y(this,ri,Ki)||y(this,ri,Ki).length===1?e==null?y(this,Lt).removeAttributeNS(y(this,wt),y(this,Rt)):y(this,Lt).setAttributeNS(y(this,wt),y(this,Rt),e):y(this,Lt).setAttributeNS(y(this,wt),y(this,Rt),y(this,ri,Ki).toString()))}get booleanValue(){return y(this,Lt).hasAttributeNS(y(this,wt),y(this,Rt))}set booleanValue(e){if(!y(this,ri,Ki)||y(this,ri,Ki).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};Ya=new WeakMap;Lt=new WeakMap;Rt=new WeakMap;wt=new WeakMap;ri=new WeakSet;Ki=function(){return Gc.get(this)};var pt=class extends Wn{constructor(e,t){super(),ze(this,Hn,void 0),ze(this,Oe,void 0),mt(this,Hn,e),mt(this,Oe,t?[...t]:[new Text])}get replacementNodes(){return y(this,Oe)}get parentNode(){return y(this,Hn)}get nextSibling(){return y(this,Oe)[y(this,Oe).length-1].nextSibling}get previousSibling(){return y(this,Oe)[0].previousSibling}get value(){return y(this,Oe).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===rv?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);t.length||t.push(new Text),mt(this,Oe,nv(y(this,Oe)[0].parentNode,y(this,Oe),t,this.nextSibling))}};Hn=new WeakMap;Oe=new WeakMap;var Ga=class extends pt{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),this.expression=r,this.template=t,this.directive=a}};function nv(i,e,t,a=null){let r=0,n,s,l,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;)l=t[r++],s=n?n.nextSibling:a,n==l?n=s:r<u&&t[r]==s?(i.replaceChild(l,n),n=s):i.insertBefore(l,n);for(;n!=a;)s=n.nextSibling,i.removeChild(n),n=s}return t}var qc={string:i=>String(i)},Fn=class{constructor(e){this.template=e,this.state=void 0}},ni=new WeakMap,oi=new WeakMap,sl={partial:(i,e)=>{e[i.expression]=new Fn(i.template)},if:(i,e)=>{var t;if(Qc(i.expression,e))if(ni.get(i)!==i.template){ni.set(i,i.template);let a=new ht(i.template,e,Kn);i.replace(a),oi.set(i,a)}else(t=oi.get(i))==null||t.update(e);else i.replace(""),ni.delete(i),oi.delete(i)}},ov=Object.keys(sl),Kn={processCallback(i,e,t){var a,r;if(t)for(let[n,s]of e){if(s instanceof Ga){if(!s.directive){let u=ov.find(c=>s.template.hasAttribute(c));u&&(s.directive=u,s.expression=s.template.getAttribute(u))}(a=sl[s.directive])==null||a.call(sl,s,t);continue}let l=Qc(n,t);if(l instanceof Fn){ni.get(s)!==l.template?(ni.set(s,l.template),l=new ht(l.template,l.state,Kn),s.value=l,oi.set(s,l)):(r=oi.get(s))==null||r.update(l.state);continue}l?(s instanceof he&&s.attributeName.startsWith("aria-")&&(l=String(l)),s instanceof he?typeof l=="boolean"?s.booleanValue=l:typeof l=="function"?s.element[s.attributeName]=l:s.value=l:(s.value=l,ni.delete(s),oi.delete(s))):s instanceof he?s.value=void 0:(s.value=void 0,ni.delete(s),oi.delete(s))}}},Zc={"!":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=qc[e])==null?void 0:t.call(qc,i)}};function sv(i){return lv(i,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function Qc(i,e={}){var t,a,r,n,s,l,u;let c=sv(i);if(c.length===0||c.some(({type:b})=>!b))return qa(i);if(((t=c[0])==null?void 0:t.token)===">"){let b=e[(a=c[1])==null?void 0:a.token];if(!b)return qa(i);let g={...e};b.state=g;let v=c.slice(2);for(let f=0;f<v.length;f+=3){let L=(r=v[f])==null?void 0:r.token,A=(n=v[f+1])==null?void 0:n.token,T=(s=v[f+2])==null?void 0:s.token;L&&A==="="&&(g[L]=Za(T,e))}return b}if(c.length===1)return $n(c[0])?Za(c[0].token,e):qa(i);if(c.length===2){let b=(l=c[0])==null?void 0:l.token,g=Zc[b];if(!g||!$n(c[1]))return qa(i);let v=Za(c[1].token,e);return g(v)}if(c.length===3){let b=(u=c[1])==null?void 0:u.token,g=Zc[b];if(!g||!$n(c[0])||!$n(c[2]))return qa(i);let v=Za(c[0].token,e);if(b==="|")return g(v,c[2].token);let f=Za(c[2].token,e);return g(v,f)}}function qa(i){return console.warn(`Warning: invalid expression \`${i}\``),!1}function $n({type:i}){return["number","boolean","string","param"].includes(i)}function Za(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):yr(i)?parseFloat(i):e[i]}function lv(i,e){let t,a,r,n=[];for(;i;){r=null,t=i.length;for(let s in e)a=e[s].exec(i),a&&a.index<t&&(r={token:a[0],type:s,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 hl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ul=(i,e,t)=>(hl(i,e,"read from private field"),t?t.call(i):e.get(i)),Qa=(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)},si=(i,e,t,a)=>(hl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ll=(i,e,t)=>(hl(i,e,"access private method"),t),Vi,Vn,Yi,cl,zc,Yn,ml,dl={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},Xc=m.createElement("template");Xc.innerHTML=`
1223
+ `;var il=class extends d.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;if(!Mr(this,{checkOpacity:!1,checkVisibilityCSS:!1}))return;let i=this.placement;if(i==="left"||i==="right"){this.style.removeProperty("--media-tooltip-offset-x");return}let a=getComputedStyle(this),r=(e=Pe(this,"#"+this.bounds))!=null?e:Z(this);if(!r)return;let{x:n,width:s}=r.getBoundingClientRect(),{x:l,width:u}=this.getBoundingClientRect(),c=l+u,b=n+s,g=a.getPropertyValue("--media-tooltip-offset-x"),f=g?parseFloat(g.replace("px","")):0,v=a.getPropertyValue("--media-tooltip-container-margin"),L=v?parseFloat(v.replace("px","")):0,A=l-n+f-L,T=c-b+f+L;if(A<0){this.style.setProperty("--media-tooltip-offset-x",`${A}px`);return}if(T>0){this.style.setProperty("--media-tooltip-offset-x",`${T}px`);return}this.style.removeProperty("--media-tooltip-offset-x")},this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Uc.content.cloneNode(!0))),this.arrowEl=this.shadowRoot.querySelector("#arrow"),Object.prototype.hasOwnProperty.call(this,"placement")){let e=this.placement;delete this.placement,this.placement=e}}static get observedAttributes(){return[$i.PLACEMENT,$i.BOUNDS]}get placement(){return R(this,$i.PLACEMENT)}set placement(e){I(this,$i.PLACEMENT,e)}get bounds(){return R(this,$i.BOUNDS)}set bounds(e){I(this,$i.BOUNDS,e)}};d.customElements.get("media-tooltip")||d.customElements.define("media-tooltip",il);var lf=1,df=t=>t.mediaMuted?0:t.mediaVolume,uf=t=>`${Math.round(t*100)}%`,al=class extends Zt{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME,o.MEDIA_MUTED,o.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",()=>{let e=this.range.value,i=new d.CustomEvent(p.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",V.VOLUME())}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),(e===o.MEDIA_VOLUME||e===o.MEDIA_MUTED)&&(this.range.valueAsNumber=df(this),this.range.setAttribute("aria-valuetext",uf(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return M(this,o.MEDIA_VOLUME,lf)}set mediaVolume(e){D(this,o.MEDIA_VOLUME,e)}get mediaMuted(){return H(this,o.MEDIA_MUTED)}set mediaMuted(e){U(this,o.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return R(this,o.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){I(this,o.MEDIA_VOLUME_UNAVAILABLE,e)}};d.customElements.get("media-volume-range")||d.customElements.define("media-volume-range",al);var E=bh(require("@mux/mux-video")),y=require("@mux/playback-core");var qc=require("@mux/mux-video");var Kc=require("@mux/playback-core");var ei=require("@mux/playback-core");function Bc(t){let e="";return Object.entries(t).forEach(([i,a])=>{a!=null&&(e+=`${Nn(i)}: ${a}; `)}),e?e.trim():void 0}function Nn(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Pn(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function ce(t){if(t==null)return;let e=+t;return Number.isNaN(e)?void 0:e}function rl(t){let e=cf(t).toString();return e?"?"+e:""}function cf(t){let e={};for(let i in t)t[i]!=null&&(e[i]=t[i]);return new URLSearchParams(e)}var nl=(t,e)=>!t||!e?!1:t.contains(e)?!0:nl(t,e.getRootNode().host);var Hc="mux.com",mf=()=>{try{return"3.2.0"}catch{}return"UNKNOWN"},hf=mf(),Bn=()=>hf,$c=(t,{token:e,customDomain:i=Hc,thumbnailTime:a,programTime:r}={})=>{var l;let n=e==null?a:void 0,{aud:s}=(l=(0,ei.parseJwt)(e))!=null?l:{};if(!(e&&s!=="t"))return`https://image.${i}/${t}/thumbnail.webp${rl({token:e,time:n,program_time:r})}`},Wc=(t,{token:e,customDomain:i=Hc,programStartTime:a,programEndTime:r}={})=>{var s;let{aud:n}=(s=(0,ei.parseJwt)(e))!=null?s:{};if(!(e&&n!=="s"))return`https://image.${i}/${t}/storyboard.vtt${rl({token:e,format:"webp",program_start_time:a,program_end_time:r})}`},Ba=t=>{if(t){if([ei.StreamTypes.LIVE,ei.StreamTypes.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return ei.StreamTypes.LIVE}};var pf={crossorigin:"crossOrigin",playsinline:"playsInline"};function Fc(t){var e;return(e=pf[t])!=null?e:Pn(t)}var Jt,jt,me,Un=class{constructor(e,i){X(this,Jt,void 0);X(this,jt,void 0);X(this,me,[]);Ae(this,Jt,e),Ae(this,jt,i)}[Symbol.iterator](){return P(this,me).values()}get length(){return P(this,me).length}get value(){var e;return(e=P(this,me).join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(Ae(this,me,[]),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return P(this,me)[e]}values(){return P(this,me).values()}keys(){return P(this,me).keys()}forEach(e){P(this,me).forEach(e)}add(...e){var i,a;e.forEach(r=>{this.contains(r)||P(this,me).push(r)}),!(this.value===""&&!((i=P(this,Jt))!=null&&i.hasAttribute(`${P(this,jt)}`)))&&((a=P(this,Jt))==null||a.setAttribute(`${P(this,jt)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>{P(this,me).splice(P(this,me).indexOf(a),1)}),(i=P(this,Jt))==null||i.setAttribute(`${P(this,jt)}`,`${this.value}`)}contains(e){return P(this,me).includes(e)}toggle(e,i){return typeof i!="undefined"?i?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,i){this.remove(e),this.add(i)}};Jt=new WeakMap,jt=new WeakMap,me=new WeakMap;var Vc=`[mux-player ${Bn()}]`;function Ze(...t){console.warn(Vc,...t)}function Ee(...t){console.error(Vc,...t)}function ol(t){var i;let e=(i=t.message)!=null?i:"";t.context&&(e+=` ${t.context}`),t.file&&(e+=` ${(0,Kc.i18n)("Read more: ")}
1224
+ https://github.com/muxinc/elements/blob/main/errors/${t.file}`),Ze(e)}var de={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},ti={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},Gc=Object.freeze({length:0,start(t){let e=t>>>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(t){let e=t>>>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}}),ff=qc.VideoEvents.filter(t=>t!=="error"),vf=Object.values(de).filter(t=>![de.PLAYSINLINE].includes(t)),Ef=Object.values(ti),sl=class extends pe.HTMLElement{static get observedAttributes(){return[...vf,...Ef]}constructor(){super()}init(){ff.forEach(e=>{var i;(i=this.media)==null||i.addEventListener(e,a=>{this.dispatchEvent(new Event(a.type))})})}attributeChangedCallback(e,i,a){var r,n;switch(e){case ti.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case ti.VOLUME:{let s=(r=ce(a))!=null?r:1;this.media&&(this.media.volume=s);return}case ti.PLAYBACKRATE:{let s=(n=ce(a))!=null?n:1;this.media&&(this.media.playbackRate=s,this.media.defaultPlaybackRate=s);return}}}play(){var e,i;return(i=(e=this.media)==null?void 0:e.play())!=null?i:Promise.reject()}pause(){var e;(e=this.media)==null||e.pause()}load(){var e;(e=this.media)==null||e.load()}requestCast(e){var i;return(i=this.media)==null?void 0:i.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,i;return(i=(e=this.media)==null?void 0:e.paused)!=null?i:!0}get duration(){var e,i;return(i=(e=this.media)==null?void 0:e.duration)!=null?i:NaN}get ended(){var e,i;return(i=(e=this.media)==null?void 0:e.ended)!=null?i:!1}get buffered(){var e,i;return(i=(e=this.media)==null?void 0:e.buffered)!=null?i:Gc}get seekable(){var e,i;return(i=(e=this.media)==null?void 0:e.seekable)!=null?i:Gc}get readyState(){var e,i;return(i=(e=this.media)==null?void 0:e.readyState)!=null?i:0}get videoWidth(){var e,i;return(i=(e=this.media)==null?void 0:e.videoWidth)!=null?i:0}get videoHeight(){var e,i;return(i=(e=this.media)==null?void 0:e.videoHeight)!=null?i:0}get currentSrc(){var e,i;return(i=(e=this.media)==null?void 0:e.currentSrc)!=null?i:""}get currentTime(){var e,i;return(i=(e=this.media)==null?void 0:e.currentTime)!=null?i:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,i;return(i=(e=this.media)==null?void 0:e.volume)!=null?i:1}set volume(e){this.media&&(this.media.volume=Number(e))}get playbackRate(){var e,i;return(i=(e=this.media)==null?void 0:e.playbackRate)!=null?i:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get defaultPlaybackRate(){var e;return(e=ce(this.getAttribute(ti.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(ti.PLAYBACKRATE,`${e}`):this.removeAttribute(ti.PLAYBACKRATE)}get crossOrigin(){return Ha(this,de.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(de.CROSSORIGIN,`${e}`)}get autoplay(){return Ha(this,de.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(de.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(de.AUTOPLAY)}get loop(){return Ha(this,de.LOOP)!=null}set loop(e){e?this.setAttribute(de.LOOP,""):this.removeAttribute(de.LOOP)}get muted(){var e,i;return(i=(e=this.media)==null?void 0:e.muted)!=null?i:!1}set muted(e){this.media&&(this.media.muted=!!e)}get defaultMuted(){return Ha(this,de.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(de.MUTED,""):this.removeAttribute(de.MUTED)}get playsInline(){return Ha(this,de.PLAYSINLINE)!=null}set playsInline(e){Ee("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(de.PRELOAD,e):this.removeAttribute(de.PRELOAD)}};function Ha(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var ll=sl;var Jc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},k=(t,e,i)=>(Jc(t,e,"read from private field"),i?i.call(t):e.get(t)),Qe=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},ct=(t,e,i,a)=>(Jc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Wi,Hn,ii,$a,Ct,Mt,Rt,ai,Fi,$n,De,Zc=1,Qc=0,bf=1,gf={processCallback(t,e,i){if(i){for(let[a,r]of e)if(a in i){let n=i[a];typeof n=="boolean"&&r instanceof he&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=n:typeof n=="function"&&r instanceof he?r.element[r.attributeName]=n:r.value=n}}}},mt=class extends d.DocumentFragment{constructor(e,i,a=gf){var r;super(),Qe(this,Wi,void 0),Qe(this,Hn,void 0),this.append(e.content.cloneNode(!0)),ct(this,Wi,jc(this)),ct(this,Hn,a),(r=a.createCallback)==null||r.call(a,this,k(this,Wi),i),a.processCallback(this,k(this,Wi),i)}update(e){k(this,Hn).processCallback(this,k(this,Wi),e)}};Wi=new WeakMap;Hn=new WeakMap;var jc=(t,e=[])=>{let i,a;for(let r of t.attributes||[])if(r.value.includes("{{")){let n=new dl;for([i,a]of Xc(r.value))if(!i)n.append(a);else{let s=new he(t,r.name,r.namespaceURI);n.append(s),e.push([a,s])}r.value=n.toString()}for(let r of t.childNodes)if(r.nodeType===Zc&&!(r instanceof HTMLTemplateElement))jc(r,e);else{let n=r.data;if(r.nodeType===Zc||n.includes("{{")){let s=[];if(n)for([i,a]of Xc(n))if(!i)s.push(new Text(a));else{let l=new ht(t);s.push(l),e.push([a,l])}else if(r instanceof HTMLTemplateElement){let l=new Wa(t,r);s.push(l),e.push([l.expression,l])}r.replaceWith(...s.flatMap(l=>l.replacementNodes||[l]))}}return e},zc={},Xc=t=>{let e="",i=0,a=zc[t],r=0,n;if(a)return a;for(a=[];n=t[r];r++)n==="{"&&t[r+1]==="{"&&t[r-1]!=="\\"&&t[r+2]&&++i==1?(e&&a.push([Qc,e]),e="",r++):n==="}"&&t[r+1]==="}"&&t[r-1]!=="\\"&&!--i?(a.push([bf,e.trim()]),e="",r++):e+=n||"";return e&&a.push([Qc,(i>0?"{{":"")+e]),zc[t]=a},_f=11,Wn=class{get value(){return""}set value(e){}toString(){return this.value}},em=new WeakMap,dl=class{constructor(){Qe(this,ii,[])}[Symbol.iterator](){return k(this,ii).values()}get length(){return k(this,ii).length}item(e){return k(this,ii)[e]}append(...e){for(let i of e)i instanceof he&&em.set(i,this),k(this,ii).push(i)}toString(){return k(this,ii).join("")}};ii=new WeakMap;var he=class extends Wn{constructor(e,i,a){super(),Qe(this,ai),Qe(this,$a,""),Qe(this,Ct,void 0),Qe(this,Mt,void 0),Qe(this,Rt,void 0),ct(this,Ct,e),ct(this,Mt,i),ct(this,Rt,a)}get attributeName(){return k(this,Mt)}get attributeNamespace(){return k(this,Rt)}get element(){return k(this,Ct)}get value(){return k(this,$a)}set value(e){k(this,$a)!==e&&(ct(this,$a,e),!k(this,ai,Fi)||k(this,ai,Fi).length===1?e==null?k(this,Ct).removeAttributeNS(k(this,Rt),k(this,Mt)):k(this,Ct).setAttributeNS(k(this,Rt),k(this,Mt),e):k(this,Ct).setAttributeNS(k(this,Rt),k(this,Mt),k(this,ai,Fi).toString()))}get booleanValue(){return k(this,Ct).hasAttributeNS(k(this,Rt),k(this,Mt))}set booleanValue(e){if(!k(this,ai,Fi)||k(this,ai,Fi).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};$a=new WeakMap;Ct=new WeakMap;Mt=new WeakMap;Rt=new WeakMap;ai=new WeakSet;Fi=function(){return em.get(this)};var ht=class extends Wn{constructor(e,i){super(),Qe(this,$n,void 0),Qe(this,De,void 0),ct(this,$n,e),ct(this,De,i?[...i]:[new Text])}get replacementNodes(){return k(this,De)}get parentNode(){return k(this,$n)}get nextSibling(){return k(this,De)[k(this,De).length-1].nextSibling}get previousSibling(){return k(this,De)[0].previousSibling}get value(){return k(this,De).map(e=>e.textContent).join("")}set value(e){this.replace(e)}replace(...e){let i=e.flat().flatMap(a=>a==null?[new Text]:a.forEach?[...a]:a.nodeType===_f?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);i.length||i.push(new Text),ct(this,De,Af(k(this,De)[0].parentNode,k(this,De),i,this.nextSibling))}};$n=new WeakMap;De=new WeakMap;var Wa=class extends ht{constructor(e,i){let a=i.getAttribute("directive")||i.getAttribute("type"),r=i.getAttribute("expression")||i.getAttribute(a)||"";r.startsWith("{{")&&(r=r.trim().slice(2,-2).trim()),super(e),this.expression=r,this.template=i,this.directive=a}};function Af(t,e,i,a=null){let r=0,n,s,l,u=i.length,c=e.length;for(;r<u&&r<c&&e[r]==i[r];)r++;for(;r<u&&r<c&&i[u-1]==e[c-1];)a=i[--c,--u];if(r==c)for(;r<u;)t.insertBefore(i[r++],a);if(r==u)for(;r<c;)t.removeChild(e[r++]);else{for(n=e[r];r<u;)l=i[r++],s=n?n.nextSibling:a,n==l?n=s:r<u&&i[r]==s?(t.replaceChild(l,n),n=s):t.insertBefore(l,n);for(;n!=a;)s=n.nextSibling,t.removeChild(n),n=s}return i}var tm={string:t=>String(t)},Kn=class{constructor(e){this.template=e,this.state=void 0}},ri=new WeakMap,ni=new WeakMap,ul={partial:(t,e)=>{e[t.expression]=new Kn(t.template)},if:(t,e)=>{var i;if(am(t.expression,e))if(ri.get(t)!==t.template){ri.set(t,t.template);let a=new mt(t.template,e,Vn);t.replace(a),ni.set(t,a)}else(i=ni.get(t))==null||i.update(e);else t.replace(""),ri.delete(t),ni.delete(t)}},Tf=Object.keys(ul),Vn={processCallback(t,e,i){var a,r;if(i)for(let[n,s]of e){if(s instanceof Wa){if(!s.directive){let u=Tf.find(c=>s.template.hasAttribute(c));u&&(s.directive=u,s.expression=s.template.getAttribute(u))}(a=ul[s.directive])==null||a.call(ul,s,i);continue}let l=am(n,i);if(l instanceof Kn){ri.get(s)!==l.template?(ri.set(s,l.template),l=new mt(l.template,l.state,Vn),s.value=l,ni.set(s,l)):(r=ni.get(s))==null||r.update(l.state);continue}l?(s instanceof he&&s.attributeName.startsWith("aria-")&&(l=String(l)),s instanceof he?typeof l=="boolean"?s.booleanValue=l:typeof l=="function"?s.element[s.attributeName]=l:s.value=l:(s.value=l,ri.delete(s),ni.delete(s))):s instanceof he?s.value=void 0:(s.value=void 0,ri.delete(s),ni.delete(s))}}},im={"!":t=>!t,"!!":t=>!!t,"==":(t,e)=>t==e,"!=":(t,e)=>t!=e,">":(t,e)=>t>e,">=":(t,e)=>t>=e,"<":(t,e)=>t<e,"<=":(t,e)=>t<=e,"??":(t,e)=>t!=null?t:e,"|":(t,e)=>{var i;return(i=tm[e])==null?void 0:i.call(tm,t)}};function yf(t){return kf(t,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function am(t,e={}){var i,a,r,n,s,l,u;let c=yf(t);if(c.length===0||c.some(({type:b})=>!b))return Fa(t);if(((i=c[0])==null?void 0:i.token)===">"){let b=e[(a=c[1])==null?void 0:a.token];if(!b)return Fa(t);let g={...e};b.state=g;let f=c.slice(2);for(let v=0;v<f.length;v+=3){let L=(r=f[v])==null?void 0:r.token,A=(n=f[v+1])==null?void 0:n.token,T=(s=f[v+2])==null?void 0:s.token;L&&A==="="&&(g[L]=Ka(T,e))}return b}if(c.length===1)return Fn(c[0])?Ka(c[0].token,e):Fa(t);if(c.length===2){let b=(l=c[0])==null?void 0:l.token,g=im[b];if(!g||!Fn(c[1]))return Fa(t);let f=Ka(c[1].token,e);return g(f)}if(c.length===3){let b=(u=c[1])==null?void 0:u.token,g=im[b];if(!g||!Fn(c[0])||!Fn(c[2]))return Fa(t);let f=Ka(c[0].token,e);if(b==="|")return g(f,c[2].token);let v=Ka(c[2].token,e);return g(f,v)}}function Fa(t){return console.warn(`Warning: invalid expression \`${t}\``),!1}function Fn({type:t}){return["number","boolean","string","param"].includes(t)}function Ka(t,e){let i=t[0],a=t.slice(-1);return t==="true"||t==="false"?t==="true":i===a&&["'",'"'].includes(i)?t.slice(1,-1):_r(t)?parseFloat(t):e[t]}function kf(t,e){let i,a,r,n=[];for(;t;){r=null,i=t.length;for(let s in e)a=e[s].exec(t),a&&a.index<i&&(r={token:a[0],type:s,matches:a.slice(1)},i=a.index);i&&n.push({token:t.substr(0,i),type:void 0}),r&&n.push(r),t=t.substr(i+(r?r.token.length:0))}return n}var vl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},hl=(t,e,i)=>(vl(t,e,"read from private field"),i?i.call(t):e.get(t)),Va=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},oi=(t,e,i,a)=>(vl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),cl=(t,e,i)=>(vl(t,e,"access private method"),i),Ki,Yn,Vi,pl,rm,Gn,fl,ml={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},nm=h.createElement("template");nm.innerHTML=`
1197
1225
  <style>
1198
1226
  :host {
1199
1227
  display: inline-block;
@@ -1223,7 +1251,7 @@ https://github.com/muxinc/elements/blob/main/errors/${i.file}`),Qe(e)}var ue={AU
1223
1251
  display: none;
1224
1252
  }
1225
1253
  </style>
1226
- `;var li=class extends d.HTMLElement{constructor(){super(),Qa(this,cl),Qa(this,Yn),Qa(this,Vi,void 0),Qa(this,Vn,void 0),Qa(this,Yi,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:!!(dl[r.attributeName]||r.attributeName.startsWith("breakpoint"))})&&this.render()});e.observe(this,{attributes:!0}),e.observe(this.renderRoot,{attributes:!0,subtree:!0}),this.addEventListener(ot.BREAKPOINTS_COMPUTED,this.render),ll(this,cl,zc).call(this,"template")}get mediaController(){return this.renderRoot.querySelector("media-controller")}get template(){var e;return(e=ul(this,Vi))!=null?e:this.constructor.template}set template(e){si(this,Yi,null),si(this,Vi,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:s})=>dl[s]||s.startsWith("breakpoint")),...Array.from(this.attributes)],n={};for(let s of r){let l=(a=dl[s.name])!=null?a:Od(s.name),{value:u}=s;u!=null?(yr(u)&&(u=parseFloat(u)),n[l]=u===""?!0:u):n[l]=!1}return n}attributeChangedCallback(e,t,a){e==="template"&&t!=a&&ll(this,Yn,ml).call(this)}connectedCallback(){ll(this,Yn,ml).call(this)}createRenderer(){this.template&&this.template!==ul(this,Vn)&&(si(this,Vn,this.template),this.renderer=new ht(this.template,this.props,this.constructor.processor),this.renderRoot.textContent="",this.renderRoot.append(Xc.content.cloneNode(!0),this.renderer))}render(){var e;if((e=this.renderer)==null||e.update(this.props),this.renderRoot.isConnected){let{style:t}=W(this.renderRoot,":host");t.visibility==="hidden"&&t.removeProperty("visibility")}}};Vi=new WeakMap;Vn=new WeakMap;Yi=new WeakMap;cl=new WeakSet;zc=function(i){if(Object.prototype.hasOwnProperty.call(this,i)){let e=this[i];delete this[i],this[i]=e}};Yn=new WeakSet;ml=function(){var i;let e=this.getAttribute("template");if(!e||e===ul(this,Yi))return;let t=this.getRootNode(),a=(i=t==null?void 0:t.getElementById)==null?void 0:i.call(t,e);if(a){si(this,Yi,e),si(this,Vi,a),this.createRenderer();return}dv(e)&&(si(this,Yi,e),uv(e).then(r=>{let n=m.createElement("template");n.innerHTML=r,si(this,Vi,n),this.createRenderer()}).catch(console.error))};li.observedAttributes=["template"];li.processor=Kn;function dv(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 uv(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()}d.customElements.get("media-theme")||d.customElements.define("media-theme",li);var Jc=`:host {
1254
+ `;var si=class extends d.HTMLElement{constructor(){super(),Va(this,pl),Va(this,Gn),Va(this,Ki,void 0),Va(this,Yn,void 0),Va(this,Vi,void 0),this.shadowRoot?this.renderRoot=this.shadowRoot:(this.renderRoot=this.attachShadow({mode:"open"}),this.createRenderer());let e=new MutationObserver(i=>{var a;this.mediaController&&!((a=this.mediaController)!=null&&a.breakpointsComputed)||i.some(r=>{let n=r.target;return n===this?!0:n.localName!=="media-controller"?!1:!!(ml[r.attributeName]||r.attributeName.startsWith("breakpoint"))})&&this.render()});e.observe(this,{attributes:!0}),e.observe(this.renderRoot,{attributes:!0,subtree:!0}),this.addEventListener(rt.BREAKPOINTS_COMPUTED,this.render),cl(this,pl,rm).call(this,"template")}get mediaController(){return this.renderRoot.querySelector("media-controller")}get template(){var e;return(e=hl(this,Ki))!=null?e:this.constructor.template}set template(e){oi(this,Vi,null),oi(this,Ki,e),this.createRenderer()}get props(){var e,i,a;let r=[...Array.from((i=(e=this.mediaController)==null?void 0:e.attributes)!=null?i:[]).filter(({name:s})=>ml[s]||s.startsWith("breakpoint")),...Array.from(this.attributes)],n={};for(let s of r){let l=(a=ml[s.name])!=null?a:Fd(s.name),{value:u}=s;u!=null?(_r(u)&&(u=parseFloat(u)),n[l]=u===""?!0:u):n[l]=!1}return n}attributeChangedCallback(e,i,a){e==="template"&&i!=a&&cl(this,Gn,fl).call(this)}connectedCallback(){cl(this,Gn,fl).call(this)}createRenderer(){this.template&&this.template!==hl(this,Yn)&&(oi(this,Yn,this.template),this.renderer=new mt(this.template,this.props,this.constructor.processor),this.renderRoot.textContent="",this.renderRoot.append(nm.content.cloneNode(!0),this.renderer))}render(){var e;if((e=this.renderer)==null||e.update(this.props),this.renderRoot.isConnected){let{style:i}=$(this.renderRoot,":host");i.visibility==="hidden"&&i.removeProperty("visibility")}}};Ki=new WeakMap;Yn=new WeakMap;Vi=new WeakMap;pl=new WeakSet;rm=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let e=this[t];delete this[t],this[t]=e}};Gn=new WeakSet;fl=function(){var t;let e=this.getAttribute("template");if(!e||e===hl(this,Vi))return;let i=this.getRootNode(),a=(t=i==null?void 0:i.getElementById)==null?void 0:t.call(i,e);if(a){oi(this,Vi,e),oi(this,Ki,a),this.createRenderer();return}Sf(e)&&(oi(this,Vi,e),If(e).then(r=>{let n=h.createElement("template");n.innerHTML=r,oi(this,Ki,n),this.createRenderer()}).catch(console.error))};si.observedAttributes=["template"];si.processor=Vn;function Sf(t){if(!/^(\/|\.\/|https?:\/\/)/.test(t))return!1;let e=/^https?:\/\//.test(t)?void 0:location.origin;try{new URL(t,e)}catch{return!1}return!0}async function If(t){let e=await fetch(t);if(e.status!==200)throw new Error(`Failed to load resource: the server responded with a status of ${e.status}`);return e.text()}d.customElements.get("media-theme")||d.customElements.define("media-theme",si);var om=`:host {
1227
1255
  --media-control-display: var(--controls);
1228
1256
  --media-loading-indicator-display: var(--loading-indicator);
1229
1257
  --media-dialog-display: var(--dialog);
@@ -1374,181 +1402,76 @@ media-poster-image:not([src]):not([placeholdersrc]) {
1374
1402
  :host([no-tooltips]) {
1375
1403
  --media-tooltip-display: none;
1376
1404
  }
1377
- `;var em=`
1378
- :host {
1379
- z-index: 100;
1380
- display: var(--media-dialog-display, flex);
1381
- justify-content: center;
1382
- align-items: center;
1383
- width: 100%;
1384
- height: 100%;
1385
- position: absolute;
1386
- top: 0;
1387
- left: 0;
1388
- box-sizing: border-box;
1389
- color: #fff;
1390
- line-height: 18px;
1391
- font-family: Arial, sans-serif;
1392
- padding: var(--media-dialog-backdrop-padding, 0);
1393
- background: var(--media-dialog-backdrop-background,
1394
- linear-gradient(to bottom, rgba(20, 20, 30, 0.7) 50%, rgba(20, 20, 30, 0.9))
1395
- );
1396
- /* Needs to use !important to prevent overwrite of media-chrome */
1397
- transition: var(--media-dialog-transition-open, visibility .2s, opacity .2s) !important;
1398
- transform: var(--media-dialog-transform-open, none) !important;
1399
- visibility: visible !important;
1400
- opacity: 1 !important;
1401
- pointer-events: auto !important;
1402
- }
1403
-
1404
- :host(:not([open])) {
1405
- /* Needs to use !important to prevent overwrite of media-chrome */
1406
- transition: var(--media-dialog-transition-close, visibility .1s, opacity .1s) !important;
1407
- transform: var(--media-dialog-transform-close, none) !important;
1408
- visibility: hidden !important;
1409
- opacity: 0 !important;
1410
- pointer-events: none !important;
1411
- }
1412
-
1413
- :focus-visible {
1414
- box-shadow: 0 0 0 2px rgba(27, 127, 204, 0.9);
1415
- }
1416
-
1417
- .dialog {
1418
- position: relative;
1419
- box-sizing: border-box;
1420
- background: var(--media-dialog-background, none);
1421
- padding: var(--media-dialog-padding, 10px);
1422
- width: min(320px, 100%);
1423
- word-wrap: break-word;
1424
- max-height: 100%;
1425
- overflow: auto;
1426
- text-align: center;
1427
- line-height: 1.4;
1428
- }
1429
- `,tm=Ae.createElement("template");tm.innerHTML=`
1405
+ `;var Ya=new WeakMap,bl=class t{constructor(e,i){this.element=e;this.type=i;this.element.addEventListener(this.type,this);let a=Ya.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 i=Ya.get(this.element);i&&i.delete(this.type)}}static for(e){Ya.has(e.element)||Ya.set(e.element,new Map);let i=e.attributeName.slice(2),a=Ya.get(e.element);return a&&a.has(i)?a.get(i):new t(e.element,i)}};function Mf(t,e){return t instanceof he&&t.attributeName.startsWith("on")?(bl.for(t).set(e),t.element.removeAttributeNS(t.attributeNamespace,t.attributeName),!0):!1}function Rf(t,e){return e instanceof qn&&t instanceof ht?(e.renderInto(t),!0):!1}function wf(t,e){return e instanceof DocumentFragment&&t instanceof ht?(e.childNodes.length&&t.replace(...e.childNodes),!0):!1}function Lf(t,e){if(t instanceof he){let i=t.attributeNamespace,a=t.element.getAttributeNS(i,t.attributeName);return String(e)!==a&&(t.value=String(e)),!0}return t.value=String(e),!0}function xf(t,e){if(t instanceof he&&e instanceof Element){let i=t.element;return i[t.attributeName]!==e&&(t.element.removeAttributeNS(t.attributeNamespace,t.attributeName),i[t.attributeName]=e),!0}return!1}function Df(t,e){if(typeof e=="boolean"&&t instanceof he){let i=t.attributeNamespace,a=t.element.hasAttributeNS(i,t.attributeName);return e!==a&&(t.booleanValue=e),!0}return!1}function Of(t,e){return e===!1&&t instanceof ht?(t.replace(""),!0):!1}function Nf(t,e){xf(t,e)||Df(t,e)||Mf(t,e)||Of(t,e)||Rf(t,e)||wf(t,e)||Lf(t,e)}var El=new Map,sm=new WeakMap,lm=new WeakMap,qn=class{constructor(e,i,a){this.strings=e;this.values=i;this.processor=a;this.stringsKey=this.strings.join("")}get template(){if(El.has(this.stringsKey))return El.get(this.stringsKey);{let e=vi.createElement("template"),i=this.strings.length-1;return e.innerHTML=this.strings.reduce((a,r,n)=>a+r+(n<i?`{{ ${n} }}`:""),""),El.set(this.stringsKey,e),e}}renderInto(e){var r;let i=this.template;if(sm.get(e)!==i){sm.set(e,i);let n=new mt(i,this.values,this.processor);lm.set(e,n),e instanceof ht?e.replace(...n.children):e.appendChild(n);return}let a=lm.get(e);(r=a==null?void 0:a.update)==null||r.call(a,this.values)}},Pf={processCallback(t,e,i){var a;if(i){for(let[r,n]of e)if(r in i){let s=(a=i[r])!=null?a:"";Nf(n,s)}}}};function Ga(t,...e){return new qn(t,e,Pf)}function dm(t,e){t.renderInto(e)}var qa=require("@mux/playback-core"),Uf=t=>{let{tokens:e}=t;return e.drm?":host { --_cast-button-drm-display: none; }":""},um=t=>Ga`
1430
1406
  <style>
1431
- ${em}
1407
+ ${Uf(t)}
1408
+ ${om}
1432
1409
  </style>
1433
-
1434
- <div class="dialog">
1435
- <slot></slot>
1436
- </div>
1437
- `;var xt=class extends Q.HTMLElement{constructor(){var e;super(),this.attachShadow({mode:"open"}),(e=this.shadowRoot)==null||e.appendChild(this.constructor.template.content.cloneNode(!0))}show(){this.setAttribute("open",""),this.dispatchEvent(new CustomEvent("open",{composed:!0,bubbles:!0})),jc(this)}close(){this.hasAttribute("open")&&(this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("close",{composed:!0,bubbles:!0})),mv(this))}attributeChangedCallback(e,t,a){e==="open"&&t!==a&&(a!=null?this.show():this.close())}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","dialog"),this.hasAttribute("open")&&jc(this)}};xt.styles=em,xt.template=tm,xt.observedAttributes=["open"];function jc(i){let e=new CustomEvent("initfocus",{composed:!0,bubbles:!0,cancelable:!0});if(i.dispatchEvent(e),e.defaultPrevented)return;let t=i.querySelector("[autofocus]:not([disabled])");!t&&i.tabIndex>=0&&(t=i),t||(t=im(i.shadowRoot)),i._previouslyFocusedElement=Ae.activeElement,Ae.activeElement instanceof HTMLElement&&Ae.activeElement.blur(),i.addEventListener("transitionend",()=>{t instanceof HTMLElement&&t.focus({preventScroll:!0})},{once:!0})}function im(i){let t=["button","input","keygen","select","textarea"].map(function(r){return r+":not([disabled])"});t.push('[tabindex]:not([disabled]):not([tabindex=""])');let a=i==null?void 0:i.querySelector(t.join(", "));if(!a&&"attachShadow"in Element.prototype){let r=(i==null?void 0:i.querySelectorAll("*"))||[];for(let n=0;n<r.length&&!(r[n].tagName&&r[n].shadowRoot&&(a=im(r[n].shadowRoot),a));n++);}return a}function mv(i){i._previouslyFocusedElement instanceof HTMLElement&&i._previouslyFocusedElement.focus()}Q.customElements.get("media-dialog")||(Q.customElements.define("media-dialog",xt),Q.MediaDialog=xt);var pl=xt;var am=Ae.createElement("template");am.innerHTML=`
1438
- <style>
1439
- ${pl.styles}
1440
-
1441
- .close {
1442
- background: none;
1443
- color: inherit;
1444
- border: none;
1445
- padding: 0;
1446
- font: inherit;
1447
- cursor: pointer;
1448
- outline: inherit;
1449
- width: 28px;
1450
- height: 28px;
1451
- position: absolute;
1452
- top: 1rem;
1453
- right: 1rem;
1454
- }
1455
- </style>
1456
-
1457
- <div class="dialog">
1458
- <slot></slot>
1459
- </div>
1460
-
1461
- <slot name="close">
1462
- <button class="close" tabindex="0">
1463
- <svg fill="none" viewBox="0 0 24 24" stroke="currentColor">
1464
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
1465
- </svg>
1466
- </button>
1467
- </slot>
1468
- `;var za=class extends pl{constructor(){var e,t;super(),(t=(e=this.shadowRoot)==null?void 0:e.querySelector(".close"))==null||t.addEventListener("click",()=>{this.close()})}};za.template=am;Q.customElements.get("mxp-dialog")||(Q.customElements.define("mxp-dialog",za),Q.MxpDialog=za);var Xa=new WeakMap,fl=class i{constructor(e,t){this.element=e;this.type=t;this.element.addEventListener(this.type,this);let a=Xa.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=Xa.get(this.element);t&&t.delete(this.type)}}static for(e){Xa.has(e.element)||Xa.set(e.element,new Map);let t=e.attributeName.slice(2),a=Xa.get(e.element);return a&&a.has(t)?a.get(t):new i(e.element,t)}};function hv(i,e){return i instanceof he&&i.attributeName.startsWith("on")?(fl.for(i).set(e),i.element.removeAttributeNS(i.attributeNamespace,i.attributeName),!0):!1}function pv(i,e){return e instanceof Gn&&i instanceof pt?(e.renderInto(i),!0):!1}function vv(i,e){return e instanceof DocumentFragment&&i instanceof pt?(e.childNodes.length&&i.replace(...e.childNodes),!0):!1}function fv(i,e){if(i instanceof he){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 Ev(i,e){if(i instanceof he&&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 bv(i,e){if(typeof e=="boolean"&&i instanceof he){let t=i.attributeNamespace,a=i.element.hasAttributeNS(t,i.attributeName);return e!==a&&(i.booleanValue=e),!0}return!1}function gv(i,e){return e===!1&&i instanceof pt?(i.replace(""),!0):!1}function _v(i,e){Ev(i,e)||bv(i,e)||hv(i,e)||gv(i,e)||pv(i,e)||vv(i,e)||fv(i,e)}var vl=new Map,rm=new WeakMap,nm=new WeakMap,Gn=class{constructor(e,t,a){this.strings=e;this.values=t;this.processor=a;this.stringsKey=this.strings.join("")}get template(){if(vl.has(this.stringsKey))return vl.get(this.stringsKey);{let e=Ae.createElement("template"),t=this.strings.length-1;return e.innerHTML=this.strings.reduce((a,r,n)=>a+r+(n<t?`{{ ${n} }}`:""),""),vl.set(this.stringsKey,e),e}}renderInto(e){var r;let t=this.template;if(rm.get(e)!==t){rm.set(e,t);let n=new ht(t,this.values,this.processor);nm.set(e,n),e instanceof pt?e.replace(...n.children):e.appendChild(n);return}let a=nm.get(e);(r=a==null?void 0:a.update)==null||r.call(a,this.values)}},Av={processCallback(i,e,t){var a;if(t){for(let[r,n]of e)if(r in t){let s=(a=t[r])!=null?a:"";_v(n,s)}}}};function vt(i,...e){return new Gn(i,e,Av)}function om(i,e){i.renderInto(e)}var di=require("@mux/playback-core"),Tv=i=>{let{tokens:e}=i;return e.drm?":host { --_cast-button-drm-display: none; }":""},sm=i=>vt`
1469
- <style>
1470
- ${Tv(i)}
1471
- ${Jc}
1472
- </style>
1473
- ${Iv(i)}
1474
- `,yv=i=>{let e=i.hotKeys?`${i.hotKeys}`:"";return Ka(i.streamType)==="live"&&(e+=" noarrowleft noarrowright"),e},kv={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",MENU_BUTTON:"menu-button",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"},Sv=Object.values(kv).join(", "),Iv=i=>{var e,t,a,r,n,s,l,u,c,b,g,v,f,L,A,T,N,te,be,gt,rt,ji,ea,ta,ia,aa,ra,na,oa,sa,la,da,Ar,nt,ua,ca,ma,ha;return vt`
1410
+ ${Wf(t)}
1411
+ `,Bf=t=>{let e=t.hotKeys?`${t.hotKeys}`:"";return Ba(t.streamType)==="live"&&(e+=" noarrowleft noarrowright"),e},Hf={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",MENU_BUTTON:"menu-button",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"},$f=Object.values(Hf).join(", "),Wf=t=>{var e,i,a,r,n,s,l,u,c,b,g,f,v,L,A,T,N,ee,be,Et,at,Ji,ji,ea,ta,ia,aa,ra,na,oa,sa,la,br;return Ga`
1475
1412
  <media-theme
1476
- template="${i.themeTemplate||!1}"
1477
- defaultstreamtype="${(e=i.defaultStreamType)!=null?e:!1}"
1478
- hotkeys="${yv(i)||!1}"
1479
- nohotkeys="${i.noHotKeys||!i.hasSrc||i.isDialogOpen||!1}"
1480
- noautoseektolive="${!!((t=i.streamType)!=null&&t.includes(di.StreamTypes.LIVE))&&i.targetLiveWindow!==0}"
1481
- novolumepref="${i.novolumepref||!1}"
1482
- disabled="${!i.hasSrc||i.isDialogOpen}"
1483
- audio="${(a=i.audio)!=null?a:!1}"
1484
- style="${(r=Lc({"--media-primary-color":i.primaryColor,"--media-secondary-color":i.secondaryColor,"--media-accent-color":i.accentColor}))!=null?r:!1}"
1485
- defaultsubtitles="${!i.defaultHiddenCaptions}"
1486
- forwardseekoffset="${(n=i.forwardSeekOffset)!=null?n:!1}"
1487
- backwardseekoffset="${(s=i.backwardSeekOffset)!=null?s:!1}"
1488
- playbackrates="${(l=i.playbackRates)!=null?l:!1}"
1489
- defaultshowremainingtime="${(u=i.defaultShowRemainingTime)!=null?u:!1}"
1490
- defaultduration="${(c=i.defaultDuration)!=null?c:!1}"
1491
- hideduration="${(b=i.hideDuration)!=null?b:!1}"
1492
- title="${(g=i.title)!=null?g:!1}"
1493
- exportparts="${Sv}"
1413
+ template="${t.themeTemplate||!1}"
1414
+ defaultstreamtype="${(e=t.defaultStreamType)!=null?e:!1}"
1415
+ hotkeys="${Bf(t)||!1}"
1416
+ nohotkeys="${t.noHotKeys||!t.hasSrc||!1}"
1417
+ noautoseektolive="${!!((i=t.streamType)!=null&&i.includes(qa.StreamTypes.LIVE))&&t.targetLiveWindow!==0}"
1418
+ novolumepref="${t.novolumepref||!1}"
1419
+ disabled="${!t.hasSrc||t.isDialogOpen}"
1420
+ audio="${(a=t.audio)!=null?a:!1}"
1421
+ style="${(r=Bc({"--media-primary-color":t.primaryColor,"--media-secondary-color":t.secondaryColor,"--media-accent-color":t.accentColor}))!=null?r:!1}"
1422
+ defaultsubtitles="${!t.defaultHiddenCaptions}"
1423
+ forwardseekoffset="${(n=t.forwardSeekOffset)!=null?n:!1}"
1424
+ backwardseekoffset="${(s=t.backwardSeekOffset)!=null?s:!1}"
1425
+ playbackrates="${(l=t.playbackRates)!=null?l:!1}"
1426
+ defaultshowremainingtime="${(u=t.defaultShowRemainingTime)!=null?u:!1}"
1427
+ defaultduration="${(c=t.defaultDuration)!=null?c:!1}"
1428
+ hideduration="${(b=t.hideDuration)!=null?b:!1}"
1429
+ title="${(g=t.title)!=null?g:!1}"
1430
+ exportparts="${$f}"
1431
+ onclose="${t.onCloseErrorDialog}"
1432
+ onfocusin="${t.onFocusInErrorDialog}"
1494
1433
  >
1495
1434
  <mux-video
1496
1435
  slot="media"
1497
- target-live-window="${(v=i.targetLiveWindow)!=null?v:!1}"
1498
- stream-type="${(f=Ka(i.streamType))!=null?f:!1}"
1499
- crossorigin="${(L=i.crossOrigin)!=null?L:""}"
1436
+ target-live-window="${(f=t.targetLiveWindow)!=null?f:!1}"
1437
+ stream-type="${(v=Ba(t.streamType))!=null?v:!1}"
1438
+ crossorigin="${(L=t.crossOrigin)!=null?L:""}"
1500
1439
  playsinline
1501
- autoplay="${(A=i.autoplay)!=null?A:!1}"
1502
- muted="${(T=i.muted)!=null?T:!1}"
1503
- loop="${(N=i.loop)!=null?N:!1}"
1504
- preload="${(te=i.preload)!=null?te:!1}"
1505
- debug="${(be=i.debug)!=null?be:!1}"
1506
- prefer-cmcd="${(gt=i.preferCmcd)!=null?gt:!1}"
1507
- disable-tracking="${(rt=i.disableTracking)!=null?rt:!1}"
1508
- disable-cookies="${(ji=i.disableCookies)!=null?ji:!1}"
1509
- prefer-playback="${(ea=i.preferPlayback)!=null?ea:!1}"
1510
- start-time="${i.startTime!=null?i.startTime:!1}"
1511
- beacon-collection-domain="${(ta=i.beaconCollectionDomain)!=null?ta:!1}"
1512
- player-software-name="${(ia=i.playerSoftwareName)!=null?ia:!1}"
1513
- player-software-version="${(aa=i.playerSoftwareVersion)!=null?aa:!1}"
1514
- env-key="${(ra=i.envKey)!=null?ra:!1}"
1515
- custom-domain="${(na=i.customDomain)!=null?na:!1}"
1516
- src="${i.src?i.src:i.playbackId?(0,di.toMuxVideoURL)(i):!1}"
1517
- cast-src="${i.src?i.src:i.playbackId?(0,di.toMuxVideoURL)(i):!1}"
1518
- cast-receiver="${(oa=i.castReceiver)!=null?oa:!1}"
1519
- drm-token="${(la=(sa=i.tokens)==null?void 0:sa.drm)!=null?la:!1}"
1440
+ autoplay="${(A=t.autoplay)!=null?A:!1}"
1441
+ muted="${(T=t.muted)!=null?T:!1}"
1442
+ loop="${(N=t.loop)!=null?N:!1}"
1443
+ preload="${(ee=t.preload)!=null?ee:!1}"
1444
+ debug="${(be=t.debug)!=null?be:!1}"
1445
+ prefer-cmcd="${(Et=t.preferCmcd)!=null?Et:!1}"
1446
+ disable-tracking="${(at=t.disableTracking)!=null?at:!1}"
1447
+ disable-cookies="${(Ji=t.disableCookies)!=null?Ji:!1}"
1448
+ prefer-playback="${(ji=t.preferPlayback)!=null?ji:!1}"
1449
+ start-time="${t.startTime!=null?t.startTime:!1}"
1450
+ beacon-collection-domain="${(ea=t.beaconCollectionDomain)!=null?ea:!1}"
1451
+ player-init-time="${(ta=t.playerInitTime)!=null?ta:!1}"
1452
+ player-software-name="${(ia=t.playerSoftwareName)!=null?ia:!1}"
1453
+ player-software-version="${(aa=t.playerSoftwareVersion)!=null?aa:!1}"
1454
+ env-key="${(ra=t.envKey)!=null?ra:!1}"
1455
+ custom-domain="${(na=t.customDomain)!=null?na:!1}"
1456
+ src="${t.src?t.src:t.playbackId?(0,qa.toMuxVideoURL)(t):!1}"
1457
+ cast-src="${t.src?t.src:t.playbackId?(0,qa.toMuxVideoURL)(t):!1}"
1458
+ cast-receiver="${(oa=t.castReceiver)!=null?oa:!1}"
1459
+ drm-token="${(la=(sa=t.tokens)==null?void 0:sa.drm)!=null?la:!1}"
1520
1460
  exportparts="video"
1521
1461
  >
1522
- ${i.storyboard?vt`<track label="thumbnails" default kind="metadata" src="${i.storyboard}" />`:vt``}
1462
+ ${t.storyboard?Ga`<track label="thumbnails" default kind="metadata" src="${t.storyboard}" />`:Ga``}
1463
+ <slot></slot>
1523
1464
  </mux-video>
1524
1465
  <slot name="poster" slot="poster">
1525
1466
  <media-poster-image
1526
1467
  part="poster"
1527
1468
  exportparts="poster, img"
1528
- src="${i.poster?i.poster:!1}"
1529
- placeholdersrc="${(da=i.placeholder)!=null?da:!1}"
1469
+ src="${t.poster?t.poster:!1}"
1470
+ placeholdersrc="${(br=t.placeholder)!=null?br:!1}"
1530
1471
  ></media-poster-image>
1531
1472
  </slot>
1532
- <mxp-dialog
1533
- no-auto-hide
1534
- open="${(Ar=i.isDialogOpen)!=null?Ar:!1}"
1535
- onclose="${i.onCloseErrorDialog}"
1536
- oninitfocus="${i.onInitFocusDialog}"
1537
- >
1538
- ${(nt=i.dialog)!=null&&nt.title?vt`<h3>${i.dialog.title}</h3>`:vt``}
1539
- <p>
1540
- ${(ua=i.dialog)==null?void 0:ua.message}
1541
- ${(ca=i.dialog)!=null&&ca.linkUrl?vt`<a
1542
- href="${i.dialog.linkUrl}"
1543
- target="_blank"
1544
- rel="external noopener"
1545
- aria-label="${(ma=i.dialog.linkText)!=null?ma:""} ${(0,di.i18n)("(opens in a new window)")}"
1546
- >${(ha=i.dialog.linkText)!=null?ha:i.dialog.linkUrl}</a
1547
- >`:vt``}
1548
- </p>
1549
- </mxp-dialog>
1550
1473
  </media-theme>
1551
- `};var _=require("@mux/playback-core"),lm=i=>i.charAt(0).toUpperCase()+i.slice(1),Cv=(i,e=!1)=>{var t,a;if(i.muxCode){let r=lm((t=i.errorCategory)!=null?t:"video"),n=(0,_.errorCategoryToTokenNameOrPrefix)((a=i.errorCategory)!=null?a:_.MuxErrorCategory.VIDEO);if(i.muxCode===_.MuxErrorCode.NETWORK_OFFLINE)return(0,_.i18n)("Your device appears to be offline",e);if(i.muxCode===_.MuxErrorCode.NETWORK_TOKEN_EXPIRED)return(0,_.i18n)("{category} URL has expired",e).format({category:r});if([_.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH,_.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,_.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING,_.MuxErrorCode.NETWORK_TOKEN_MALFORMED].includes(i.muxCode))return(0,_.i18n)("{category} URL is formatted incorrectly",e).format({category:r});if(i.muxCode===_.MuxErrorCode.NETWORK_TOKEN_MISSING)return(0,_.i18n)("Invalid {categoryName} URL",e).format({categoryName:n});if(i.muxCode===_.MuxErrorCode.NETWORK_NOT_FOUND)return(0,_.i18n)("{category} does not exist",e).format({category:r});if(i.muxCode===_.MuxErrorCode.NETWORK_NOT_READY)return(0,_.i18n)("{category} is not currently available",e).format({category:r})}if(i.code){if(i.code===_.MediaError.MEDIA_ERR_NETWORK)return(0,_.i18n)("Network Error",e);if(i.code===_.MediaError.MEDIA_ERR_DECODE)return(0,_.i18n)("Media Error",e);if(i.code===_.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED)return(0,_.i18n)("Source Not Supported",e)}return(0,_.i18n)("Error",e)},Mv=(i,e=!1)=>{var t,a;if(i.muxCode){let r=lm((t=i.errorCategory)!=null?t:"video"),n=(0,_.errorCategoryToTokenNameOrPrefix)((a=i.errorCategory)!=null?a:_.MuxErrorCategory.VIDEO);return i.muxCode===_.MuxErrorCode.NETWORK_OFFLINE?(0,_.i18n)("Check your internet connection and try reloading this video.",e):i.muxCode===_.MuxErrorCode.NETWORK_TOKEN_EXPIRED?(0,_.i18n)("The video\u2019s secured {tokenNamePrefix}-token has expired.",e).format({tokenNamePrefix:n}):i.muxCode===_.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH?(0,_.i18n)("The video\u2019s playback ID does not match the one encoded in the {tokenNamePrefix}-token.",e).format({tokenNamePrefix:n}):i.muxCode===_.MuxErrorCode.NETWORK_TOKEN_MALFORMED?(0,_.i18n)("{category} URL is formatted incorrectly",e).format({category:r}):[_.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,_.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING].includes(i.muxCode)?(0,_.i18n)("The {tokenNamePrefix}-token is formatted with incorrect information.",e).format({tokenNamePrefix:n}):[_.MuxErrorCode.NETWORK_TOKEN_MISSING,_.MuxErrorCode.NETWORK_INVALID_URL].includes(i.muxCode)?(0,_.i18n)("The video URL or {tokenNamePrefix}-token are formatted with incorrect or incomplete information.",e).format({tokenNamePrefix:n}):i.muxCode===_.MuxErrorCode.NETWORK_NOT_FOUND?"":i.muxCode===_.MuxErrorCode.NETWORK_NOT_READY?(0,_.i18n)("The live stream or video file are not yet ready.",e):i.message}return i.code&&(i.code===_.MediaError.MEDIA_ERR_NETWORK||i.code===_.MediaError.MEDIA_ERR_DECODE||i.code===_.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED),i.message},Lv=(i,e=!1)=>{let t=Cv(i,e),a=Mv(i,e);return{title:t,message:a}},Rv=i=>{if(i.muxCode){if(i.muxCode===_.MuxErrorCode.NETWORK_TOKEN_EXPIRED)return"403-expired-token.md";if(i.muxCode===_.MuxErrorCode.NETWORK_TOKEN_MALFORMED)return"403-malformatted-token.md";if([_.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,_.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING].includes(i.muxCode))return"403-incorrect-aud-value.md";if(i.muxCode===_.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH)return"403-playback-id-mismatch.md";if(i.muxCode===_.MuxErrorCode.NETWORK_TOKEN_MISSING)return"missing-signed-tokens.md";if(i.muxCode===_.MuxErrorCode.NETWORK_NOT_FOUND)return"404-not-found.md";if(i.muxCode===_.MuxErrorCode.NETWORK_NOT_READY)return"412-not-playable.md"}if(i.code){if(i.code===_.MediaError.MEDIA_ERR_NETWORK)return"";if(i.code===_.MediaError.MEDIA_ERR_DECODE)return"media-decode-error.md";if(i.code===_.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED)return"media-src-not-supported.md"}return""},wv=(i,e)=>{let t=Rv(i);return{message:i.message,context:i.context,file:t}};function El(i,e=!1){let t=Lv(i,e),a=wv(i,e);return{dialog:t,devlog:a}}var dm=`<template id="media-theme-gerwig">
1474
+ `};var _=require("@mux/playback-core"),cm=t=>t.charAt(0).toUpperCase()+t.slice(1),Ff=(t,e=!1)=>{var i,a;if(t.muxCode){let r=cm((i=t.errorCategory)!=null?i:"video"),n=(0,_.errorCategoryToTokenNameOrPrefix)((a=t.errorCategory)!=null?a:_.MuxErrorCategory.VIDEO);if(t.muxCode===_.MuxErrorCode.NETWORK_OFFLINE)return(0,_.i18n)("Your device appears to be offline",e);if(t.muxCode===_.MuxErrorCode.NETWORK_TOKEN_EXPIRED)return(0,_.i18n)("{category} URL has expired",e).format({category:r});if([_.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH,_.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,_.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING,_.MuxErrorCode.NETWORK_TOKEN_MALFORMED].includes(t.muxCode))return(0,_.i18n)("{category} URL is formatted incorrectly",e).format({category:r});if(t.muxCode===_.MuxErrorCode.NETWORK_TOKEN_MISSING)return(0,_.i18n)("Invalid {categoryName} URL",e).format({categoryName:n});if(t.muxCode===_.MuxErrorCode.NETWORK_NOT_FOUND)return(0,_.i18n)("{category} does not exist",e).format({category:r});if(t.muxCode===_.MuxErrorCode.NETWORK_NOT_READY)return(0,_.i18n)("{category} is not currently available",e).format({category:r})}if(t.code){if(t.code===_.MediaError.MEDIA_ERR_NETWORK)return(0,_.i18n)("Network Error",e);if(t.code===_.MediaError.MEDIA_ERR_DECODE)return(0,_.i18n)("Media Error",e);if(t.code===_.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED)return(0,_.i18n)("Source Not Supported",e)}return(0,_.i18n)("Error",e)},Kf=(t,e=!1)=>{var i,a;if(t.muxCode){let r=cm((i=t.errorCategory)!=null?i:"video"),n=(0,_.errorCategoryToTokenNameOrPrefix)((a=t.errorCategory)!=null?a:_.MuxErrorCategory.VIDEO);return t.muxCode===_.MuxErrorCode.NETWORK_OFFLINE?(0,_.i18n)("Check your internet connection and try reloading this video.",e):t.muxCode===_.MuxErrorCode.NETWORK_TOKEN_EXPIRED?(0,_.i18n)("The video\u2019s secured {tokenNamePrefix}-token has expired.",e).format({tokenNamePrefix:n}):t.muxCode===_.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH?(0,_.i18n)("The video\u2019s playback ID does not match the one encoded in the {tokenNamePrefix}-token.",e).format({tokenNamePrefix:n}):t.muxCode===_.MuxErrorCode.NETWORK_TOKEN_MALFORMED?(0,_.i18n)("{category} URL is formatted incorrectly",e).format({category:r}):[_.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,_.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING].includes(t.muxCode)?(0,_.i18n)("The {tokenNamePrefix}-token is formatted with incorrect information.",e).format({tokenNamePrefix:n}):[_.MuxErrorCode.NETWORK_TOKEN_MISSING,_.MuxErrorCode.NETWORK_INVALID_URL].includes(t.muxCode)?(0,_.i18n)("The video URL or {tokenNamePrefix}-token are formatted with incorrect or incomplete information.",e).format({tokenNamePrefix:n}):t.muxCode===_.MuxErrorCode.NETWORK_NOT_FOUND?"":t.muxCode===_.MuxErrorCode.NETWORK_NOT_READY?(0,_.i18n)("The live stream or video file are not yet ready.",e):t.message}return t.code&&(t.code===_.MediaError.MEDIA_ERR_NETWORK||t.code===_.MediaError.MEDIA_ERR_DECODE||t.code===_.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED),t.message},mm=(t,e=!1)=>{let i=Ff(t,e),a=Kf(t,e);return{title:i,message:a}},Vf=t=>{if(t.muxCode){if(t.muxCode===_.MuxErrorCode.NETWORK_TOKEN_EXPIRED)return"403-expired-token.md";if(t.muxCode===_.MuxErrorCode.NETWORK_TOKEN_MALFORMED)return"403-malformatted-token.md";if([_.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,_.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING].includes(t.muxCode))return"403-incorrect-aud-value.md";if(t.muxCode===_.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH)return"403-playback-id-mismatch.md";if(t.muxCode===_.MuxErrorCode.NETWORK_TOKEN_MISSING)return"missing-signed-tokens.md";if(t.muxCode===_.MuxErrorCode.NETWORK_NOT_FOUND)return"404-not-found.md";if(t.muxCode===_.MuxErrorCode.NETWORK_NOT_READY)return"412-not-playable.md"}if(t.code){if(t.code===_.MediaError.MEDIA_ERR_NETWORK)return"";if(t.code===_.MediaError.MEDIA_ERR_DECODE)return"media-decode-error.md";if(t.code===_.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED)return"media-src-not-supported.md"}return""},gl=(t,e)=>{let i=Vf(t);return{message:t.message,context:t.context,file:i}};var hm=`<template id="media-theme-gerwig">
1552
1475
  <style>
1553
1476
  @keyframes pre-play-hide {
1554
1477
  0% {
@@ -2459,6 +2382,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2459
2382
  <slot name="poster" slot="poster"></slot>
2460
2383
 
2461
2384
  <media-loading-indicator slot="centered-chrome" noautohide></media-loading-indicator>
2385
+ <media-error-dialog slot="dialog" noautohide></media-error-dialog>
2462
2386
 
2463
2387
  <template if="!audio">
2464
2388
  <!-- Pre-playback UI -->
@@ -2554,7 +2478,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2554
2478
  <slot></slot>
2555
2479
  </media-controller>
2556
2480
  </template>
2557
- `;function um({anchor:i,floating:e,placement:t}){let a=Dv({anchor:i,floating:e}),{x:r,y:n}=Nv(a,t);return{x:r,y:n}}function Dv({anchor:i,floating:e}){return{anchor:Ov(i,e.offsetParent),floating:{x:0,y:0,width:e.offsetWidth,height:e.offsetHeight}}}function Ov(i,e){var t;let a=i.getBoundingClientRect(),r=(t=e==null?void 0:e.getBoundingClientRect())!=null?t:{x:0,y:0};return{x:a.x-r.x,y:a.y-r.y,width:a.width,height:a.height}}function Nv({anchor:i,floating:e},t){let a=Pv(t)==="x"?"y":"x",r=a==="y"?"height":"width",n=cm(t),s=i.x+i.width/2-e.width/2,l=i.y+i.height/2-e.height/2,u=i[r]/2-e[r]/2,c;switch(n){case"top":c={x:s,y:i.y-e.height};break;case"bottom":c={x:s,y:i.y+i.height};break;case"right":c={x:i.x+i.width,y:l};break;case"left":c={x:i.x-e.width,y:l};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 cm(i){return i.split("-")[0]}function Pv(i){return["top","bottom"].includes(cm(i))?"y":"x"}var Dt=class extends Event{constructor({action:e="auto",relatedTarget:t,...a}){super("invoke",a),this.action=e,this.relatedTarget=t}},qn=class extends Event{constructor({newState:e,oldState:t,...a}){super("toggle",a),this.newState=e,this.oldState=t}};var Ll=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},U=(i,e,t)=>(Ll(i,e,"read from private field"),t?t.call(i):e.get(i)),K=(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)},Xe=(i,e,t,a)=>(Ll(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),G=(i,e,t)=>(Ll(i,e,"access private method"),t),Je,ci,Ot,Zn,Qn,mi,er,bl,mm,Jn,zn,gl,_l,hm,Al,pm,Tl,vm,Gi,qi,Zi,tr,jn,Rl,yl,fm,wl,Em,kl,bm,xl,gm,Sl,_m,Il,Am,Ja,eo,Cl,Tm,ja,to,Xn,Ml;function je({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 Ne(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 ym=m.createElement("template");ym.innerHTML=`
2481
+ `;function pm({anchor:t,floating:e,placement:i}){let a=Gf({anchor:t,floating:e}),{x:r,y:n}=Zf(a,i);return{x:r,y:n}}function Gf({anchor:t,floating:e}){return{anchor:qf(t,e.offsetParent),floating:{x:0,y:0,width:e.offsetWidth,height:e.offsetHeight}}}function qf(t,e){var i;let a=t.getBoundingClientRect(),r=(i=e==null?void 0:e.getBoundingClientRect())!=null?i:{x:0,y:0};return{x:a.x-r.x,y:a.y-r.y,width:a.width,height:a.height}}function Zf({anchor:t,floating:e},i){let a=Qf(i)==="x"?"y":"x",r=a==="y"?"height":"width",n=fm(i),s=t.x+t.width/2-e.width/2,l=t.y+t.height/2-e.height/2,u=t[r]/2-e[r]/2,c;switch(n){case"top":c={x:s,y:t.y-e.height};break;case"bottom":c={x:s,y:t.y+t.height};break;case"right":c={x:t.x+t.width,y:l};break;case"left":c={x:t.x-e.width,y:l};break;default:c={x:t.x,y:t.y}}switch(i.split("-")[1]){case"start":c[a]-=u;break;case"end":c[a]+=u;break}return c}function fm(t){return t.split("-")[0]}function Qf(t){return["top","bottom"].includes(fm(t))?"y":"x"}var wt=class extends Event{constructor({action:e="auto",relatedTarget:i,...a}){super("invoke",a),this.action=e,this.relatedTarget=i}},Zn=class extends Event{constructor({newState:e,oldState:i,...a}){super("toggle",a),this.newState=e,this.oldState=i}};var Ll=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},B=(t,e,i)=>(Ll(t,e,"read from private field"),i?i.call(t):e.get(t)),K=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},ze=(t,e,i,a)=>(Ll(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),G=(t,e,i)=>(Ll(t,e,"access private method"),i),Xe,di,Lt,Qn,zn,ui,za,_l,vm,jn,Xn,Al,Tl,Em,yl,bm,kl,gm,Yi,Gi,qi,Xa,eo,xl,Sl,_m,Dl,Am,Il,Tm,Ol,ym,Cl,km,Ml,Sm,Za,to,Rl,Im,Qa,io,Jn,wl;function Je({type:t,text:e,value:i,checked:a}){let r=h.createElement("media-chrome-menu-item");r.type=t!=null?t:"",r.part.add("menu-item"),t&&r.part.add(t),r.value=i,r.checked=a;let n=h.createElement("span");return n.textContent=e,r.append(n),r}function Oe(t,e){let i=t.querySelector(`:scope > [slot="${e}"]`);if((i==null?void 0:i.nodeName)=="SLOT"&&(i=i.assignedElements({flatten:!0})[0]),i)return i=i.cloneNode(!0),i;let a=t.shadowRoot.querySelector(`[name="${e}"] > svg`);return a?a.cloneNode(!0):""}var Cm=h.createElement("template");Cm.innerHTML=`
2558
2482
  <style>
2559
2483
  :host {
2560
2484
  font: var(--media-font,
@@ -2721,7 +2645,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2721
2645
  <slot></slot>
2722
2646
  </div>
2723
2647
  <slot name="checked-indicator" hidden></slot>
2724
- `;var ui={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},le=class extends d.HTMLElement{constructor(){super(),K(this,bl),K(this,zn),K(this,_l),K(this,Al),K(this,Tl),K(this,Zi),K(this,jn),K(this,yl),K(this,wl),K(this,kl),K(this,xl),K(this,Sl),K(this,Il),K(this,Ja),K(this,Cl),K(this,ja),K(this,Xn),K(this,Je,null),K(this,ci,null),K(this,Ot,null),K(this,Zn,new Set),K(this,Qn,void 0),K(this,mi,!1),K(this,er,null),K(this,Jn,()=>{let e=U(this,Zn),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}));Xe(this,Zn,t)}),K(this,Gi,()=>{G(this,Zi,tr).call(this),G(this,jn,Rl).call(this,!1)}),K(this,qi,()=>{G(this,Zi,tr).call(this)}),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),Xe(this,Qn,new MutationObserver(U(this,Jn))),U(this,Qn).observe(this.defaultSlot,{childList:!0})}static get observedAttributes(){return[ui.DISABLED,ui.HIDDEN,ui.STYLE,ui.ANCHOR,k.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":G(this,bl,mm).call(this,e);break;case"invoke":G(this,_l,hm).call(this,e);break;case"click":G(this,yl,fm).call(this,e);break;case"toggle":G(this,kl,bm).call(this,e);break;case"focusout":G(this,Sl,_m).call(this,e);break;case"keydown":G(this,Il,Am).call(this,e);break}}connectedCallback(){var e,t;Xe(this,er,Fo(this.shadowRoot,":host")),G(this,zn,gl).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),Xe(this,Je,Mr(this)),(t=(e=U(this,Je))==null?void 0:e.associateElement)==null||t.call(e,this),this.hidden||(st(ir(this),U(this,Gi)),st(this,U(this,qi)))}disconnectedCallback(){var e,t;Wt(ir(this),U(this,Gi)),Wt(this,U(this,qi)),this.disable(),(t=(e=U(this,Je))==null?void 0:e.unassociateElement)==null||t.call(e,this),Xe(this,Je,null)}attributeChangedCallback(e,t,a){var r,n,s,l;e===ui.HIDDEN&&a!==t?(U(this,mi)||Xe(this,mi,!0),this.hidden?G(this,Tl,vm).call(this):G(this,Al,pm).call(this),this.dispatchEvent(new qn({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:!0}))):e===k.MEDIA_CONTROLLER?(t&&((n=(r=U(this,Je))==null?void 0:r.unassociateElement)==null||n.call(r,this),Xe(this,Je,null)),a&&this.isConnected&&(Xe(this,Je,Mr(this)),(l=(s=U(this,Je))==null?void 0:s.associateElement)==null||l.call(s,this))):e===ui.DISABLED&&a!==t?a==null?this.enable():this.disable():e===ui.STYLE&&a!==t&&G(this,zn,gl).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=$t(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:!0}).filter(Uv)}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&&G(this,Xn,Ml).call(this,t)}focus(){if(Xe(this,ci,ba()),this.items.length){G(this,ja,to).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=G(this,Ja,eo).call(this,e);a&&(G(this,Xn,Ml).call(this,a,a.type==="checkbox"),U(this,Ot)&&!this.hidden&&((t=U(this,ci))==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,s=(a=(t=G(this,Ja,eo).call(this,e))!=null?t:G(this,Cl,Tm).call(this))!=null?a:n[0],l=n.indexOf(s),u=Math.max(0,l);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),G(this,ja,to).call(this,n[u]),n[u].focus()}};Je=new WeakMap;ci=new WeakMap;Ot=new WeakMap;Zn=new WeakMap;Qn=new WeakMap;mi=new WeakMap;er=new WeakMap;bl=new WeakSet;mm=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||U(this,Jn).call(this)};Jn=new WeakMap;zn=new WeakSet;gl=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")};_l=new WeakSet;hm=function(i){Xe(this,Ot,i.relatedTarget),ce(this,i.relatedTarget)||(this.hidden=!this.hidden)};Al=new WeakSet;pm=function(){var i;(i=U(this,Ot))==null||i.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),st(ir(this),U(this,Gi)),st(this,U(this,qi))};Tl=new WeakSet;vm=function(){var i;(i=U(this,Ot))==null||i.setAttribute("aria-expanded","false"),Wt(ir(this),U(this,Gi)),Wt(this,U(this,qi))};Gi=new WeakMap;qi=new WeakMap;Zi=new WeakSet;tr=function(i){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:e,y:t}=um({anchor:this.anchorElement,floating:this,placement:"top-start"});i!=null||(i=this.offsetWidth);let r=ir(this).getBoundingClientRect(),n=r.width-e-i,s=r.height-t-this.offsetHeight,{style:l}=U(this,er);l.setProperty("position","absolute"),l.setProperty("right",`${Math.max(0,n)}px`),l.setProperty("--_menu-bottom",`${s}px`);let u=getComputedStyle(this),b=l.getPropertyValue("--_menu-bottom")===u.bottom?s:parseFloat(u.bottom),g=r.height-b-parseFloat(u.marginBottom);this.style.setProperty("--_menu-max-height",`${g}px`)};jn=new WeakSet;Rl=function(i){let e=this.querySelector('[role="menuitem"][aria-haspopup][aria-expanded="true"]'),t=e==null?void 0:e.querySelector('[role="menu"]'),{style:a}=U(this,er);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`),G(this,Zi,tr).call(this,n)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),G(this,Zi,tr).call(this);a.removeProperty("--media-menu-transition-in")};yl=new WeakSet;fm=function(i){var e;if(i.stopPropagation(),i.composedPath().includes(U(this,wl,Em))){(e=U(this,ci))==null||e.focus(),this.hidden=!0;return}let t=G(this,Ja,eo).call(this,i);!t||t.hasAttribute("disabled")||(G(this,ja,to).call(this,t),this.handleSelect(i))};wl=new WeakSet;Em=function(){var i;return(i=this.shadowRoot.querySelector('slot[name="header"]').assignedElements({flatten:!0}))==null?void 0:i.find(t=>t.matches('button[part~="back"]'))};kl=new WeakSet;bm=function(i){if(i.target===this)return;G(this,xl,gm).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 Dt({relatedTarget:t}));for(let t of e)t.setAttribute("aria-expanded",`${!t.submenuElement.hidden}`);G(this,jn,Rl).call(this,!0)};xl=new WeakSet;gm=function(){let e=this.querySelector('[role="menuitem"] > [role="menu"]:not([hidden])');this.container.classList.toggle("has-expanded",!!e)};Sl=new WeakSet;_m=function(i){var e;ce(this,i.relatedTarget)||(U(this,mi)&&((e=U(this,ci))==null||e.focus()),U(this,Ot)&&U(this,Ot)!==i.relatedTarget&&!this.hidden&&(this.hidden=!0))};Il=new WeakSet;Am=function(i){var e,t,a,r,n;let{key:s,ctrlKey:l,altKey:u,metaKey:c}=i;if(!(l||u||c)&&this.keysUsed.includes(s))if(i.preventDefault(),i.stopPropagation(),s==="Tab"){if(U(this,mi)){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 s==="Escape"?((n=U(this,ci))==null||n.focus(),U(this,mi)&&(this.hidden=!0)):s==="Enter"||s===" "?this.handleSelect(i):this.handleMove(i)};Ja=new WeakSet;eo=function(i){return i.composedPath().find(e=>["menuitemradio","menuitemcheckbox"].includes(e.role))};Cl=new WeakSet;Tm=function(){return this.items.find(i=>i.tabIndex===0)};ja=new WeakSet;to=function(i){for(let e of this.items)e.tabIndex=e===i?0:-1};Xn=new WeakSet;Ml=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}))};le.template=ym;function Uv(i){return["menuitem","menuitemradio","menuitemcheckbox"].includes(i==null?void 0:i.role)}function ir(i){var e;return(e=i.getAttribute("bounds")?Ue(i,`#${i.getAttribute("bounds")}`):Z(i)||i.parentElement)!=null?e:i}d.customElements.get("media-chrome-menu")||d.customElements.define("media-chrome-menu",le);var Bl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},tt=(i,e,t)=>(Bl(i,e,"read from private field"),t?t.call(i):e.get(i)),ft=(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)},Dl=(i,e,t,a)=>(Bl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),et=(i,e,t)=>(Bl(i,e,"access private method"),t),io,rr,Ol,km,Hl,Sm,Wl,Im,it,Qi,nr,Nl,Cm,ao,Pl,Mm=m.createElement("template");Mm.innerHTML=`
2648
+ `;var li={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},se=class extends d.HTMLElement{constructor(){super(),K(this,_l),K(this,Xn),K(this,Tl),K(this,yl),K(this,kl),K(this,qi),K(this,eo),K(this,Sl),K(this,Dl),K(this,Il),K(this,Ol),K(this,Cl),K(this,Ml),K(this,Za),K(this,Rl),K(this,Qa),K(this,Jn),K(this,Xe,null),K(this,di,null),K(this,Lt,null),K(this,Qn,new Set),K(this,zn,void 0),K(this,ui,!1),K(this,za,null),K(this,jn,()=>{let e=B(this,Qn),i=new Set(this.items);for(let a of e)i.has(a)||this.dispatchEvent(new CustomEvent("removemenuitem",{detail:a}));for(let a of i)e.has(a)||this.dispatchEvent(new CustomEvent("addmenuitem",{detail:a}));ze(this,Qn,i)}),K(this,Yi,()=>{G(this,qi,Xa).call(this),G(this,eo,xl).call(this,!1)}),K(this,Gi,()=>{G(this,qi,Xa).call(this)}),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),ze(this,zn,new MutationObserver(B(this,jn))),B(this,zn).observe(this.defaultSlot,{childList:!0})}static get observedAttributes(){return[li.DISABLED,li.HIDDEN,li.STYLE,li.ANCHOR,S.MEDIA_CONTROLLER]}static formatMenuItemText(e,i){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":G(this,_l,vm).call(this,e);break;case"invoke":G(this,Tl,Em).call(this,e);break;case"click":G(this,Sl,_m).call(this,e);break;case"toggle":G(this,Il,Tm).call(this,e);break;case"focusout":G(this,Cl,km).call(this,e);break;case"keydown":G(this,Ml,Sm).call(this,e);break}}connectedCallback(){var e,i;ze(this,za,Vo(this.shadowRoot,":host")),G(this,Xn,Al).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),ze(this,Xe,Sr(this)),(i=(e=B(this,Xe))==null?void 0:e.associateElement)==null||i.call(e,this),this.hidden||(nt(Ja(this),B(this,Yi)),nt(this,B(this,Gi)))}disconnectedCallback(){var e,i;Ut(Ja(this),B(this,Yi)),Ut(this,B(this,Gi)),this.disable(),(i=(e=B(this,Xe))==null?void 0:e.unassociateElement)==null||i.call(e,this),ze(this,Xe,null)}attributeChangedCallback(e,i,a){var r,n,s,l;e===li.HIDDEN&&a!==i?(B(this,ui)||ze(this,ui,!0),this.hidden?G(this,kl,gm).call(this):G(this,yl,bm).call(this),this.dispatchEvent(new Zn({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:!0}))):e===S.MEDIA_CONTROLLER?(i&&((n=(r=B(this,Xe))==null?void 0:r.unassociateElement)==null||n.call(r,this),ze(this,Xe,null)),a&&this.isConnected&&(ze(this,Xe,Sr(this)),(l=(s=B(this,Xe))==null?void 0:s.associateElement)==null||l.call(s,this))):e===li.DISABLED&&a!==i?a==null?this.enable():this.disable():e===li.STYLE&&a!==i&&G(this,Xn,Al).call(this)}formatMenuItemText(e,i){return this.constructor.formatMenuItemText(e,i)}get anchor(){return this.getAttribute("anchor")}set anchor(e){this.setAttribute("anchor",`${e}`)}get anchorElement(){var e;return this.anchor?(e=Bt(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:!0}).filter(zf)}get radioGroupItems(){return this.items.filter(e=>e.role==="menuitemradio")}get checkedItems(){return this.items.filter(e=>e.checked)}get value(){var e,i;return(i=(e=this.checkedItems[0])==null?void 0:e.value)!=null?i:""}set value(e){let i=this.items.find(a=>a.value===e);i&&G(this,Jn,wl).call(this,i)}focus(){if(ze(this,di,ha()),this.items.length){G(this,Qa,io).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 i;let a=G(this,Za,to).call(this,e);a&&(G(this,Jn,wl).call(this,a,a.type==="checkbox"),B(this,Lt)&&!this.hidden&&((i=B(this,di))==null||i.focus(),this.hidden=!0))}get keysUsed(){return["Enter","Escape","Tab"," ","ArrowDown","ArrowUp","Home","End"]}handleMove(e){var i,a;let{key:r}=e,n=this.items,s=(a=(i=G(this,Za,to).call(this,e))!=null?i:G(this,Rl,Im).call(this))!=null?a:n[0],l=n.indexOf(s),u=Math.max(0,l);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),G(this,Qa,io).call(this,n[u]),n[u].focus()}};Xe=new WeakMap;di=new WeakMap;Lt=new WeakMap;Qn=new WeakMap;zn=new WeakMap;ui=new WeakMap;za=new WeakMap;_l=new WeakSet;vm=function(t){let e=t.target;for(let i of e.assignedNodes({flatten:!0}))i.nodeType===3&&i.textContent.trim()===""&&i.remove();if(["header","title"].includes(e.name)){let i=this.shadowRoot.querySelector('slot[name="header"]');i.hidden=e.assignedNodes().length===0}e.name||B(this,jn).call(this)};jn=new WeakMap;Xn=new WeakSet;Al=function(){var t;let e=this.shadowRoot.querySelector("#layout-row"),i=(t=getComputedStyle(this).getPropertyValue("--media-menu-layout"))==null?void 0:t.trim();e.setAttribute("media",i==="row"?"":"width:0")};Tl=new WeakSet;Em=function(t){ze(this,Lt,t.relatedTarget),ue(this,t.relatedTarget)||(this.hidden=!this.hidden)};yl=new WeakSet;bm=function(){var t;(t=B(this,Lt))==null||t.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),nt(Ja(this),B(this,Yi)),nt(this,B(this,Gi))};kl=new WeakSet;gm=function(){var t;(t=B(this,Lt))==null||t.setAttribute("aria-expanded","false"),Ut(Ja(this),B(this,Yi)),Ut(this,B(this,Gi))};Yi=new WeakMap;Gi=new WeakMap;qi=new WeakSet;Xa=function(t){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:e,y:i}=pm({anchor:this.anchorElement,floating:this,placement:"top-start"});t!=null||(t=this.offsetWidth);let r=Ja(this).getBoundingClientRect(),n=r.width-e-t,s=r.height-i-this.offsetHeight,{style:l}=B(this,za);l.setProperty("position","absolute"),l.setProperty("right",`${Math.max(0,n)}px`),l.setProperty("--_menu-bottom",`${s}px`);let u=getComputedStyle(this),b=l.getPropertyValue("--_menu-bottom")===u.bottom?s:parseFloat(u.bottom),g=r.height-b-parseFloat(u.marginBottom);this.style.setProperty("--_menu-max-height",`${g}px`)};eo=new WeakSet;xl=function(t){let e=this.querySelector('[role="menuitem"][aria-haspopup][aria-expanded="true"]'),i=e==null?void 0:e.querySelector('[role="menu"]'),{style:a}=B(this,za);if(t||a.setProperty("--media-menu-transition-in","none"),i){let r=i.offsetHeight,n=Math.max(i.offsetWidth,e.offsetWidth);this.style.setProperty("min-width",`${n}px`),this.style.setProperty("min-height",`${r}px`),G(this,qi,Xa).call(this,n)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),G(this,qi,Xa).call(this);a.removeProperty("--media-menu-transition-in")};Sl=new WeakSet;_m=function(t){var e;if(t.stopPropagation(),t.composedPath().includes(B(this,Dl,Am))){(e=B(this,di))==null||e.focus(),this.hidden=!0;return}let i=G(this,Za,to).call(this,t);!i||i.hasAttribute("disabled")||(G(this,Qa,io).call(this,i),this.handleSelect(t))};Dl=new WeakSet;Am=function(){var t;return(t=this.shadowRoot.querySelector('slot[name="header"]').assignedElements({flatten:!0}))==null?void 0:t.find(i=>i.matches('button[part~="back"]'))};Il=new WeakSet;Tm=function(t){if(t.target===this)return;G(this,Ol,ym).call(this);let e=Array.from(this.querySelectorAll('[role="menuitem"][aria-haspopup]'));for(let i of e)i.invokeTargetElement!=t.target&&t.newState=="open"&&i.getAttribute("aria-expanded")=="true"&&!i.invokeTargetElement.hidden&&i.invokeTargetElement.dispatchEvent(new wt({relatedTarget:i}));for(let i of e)i.setAttribute("aria-expanded",`${!i.submenuElement.hidden}`);G(this,eo,xl).call(this,!0)};Ol=new WeakSet;ym=function(){let e=this.querySelector('[role="menuitem"] > [role="menu"]:not([hidden])');this.container.classList.toggle("has-expanded",!!e)};Cl=new WeakSet;km=function(t){var e;ue(this,t.relatedTarget)||(B(this,ui)&&((e=B(this,di))==null||e.focus()),B(this,Lt)&&B(this,Lt)!==t.relatedTarget&&!this.hidden&&(this.hidden=!0))};Ml=new WeakSet;Sm=function(t){var e,i,a,r,n;let{key:s,ctrlKey:l,altKey:u,metaKey:c}=t;if(!(l||u||c)&&this.keysUsed.includes(s))if(t.preventDefault(),t.stopPropagation(),s==="Tab"){if(B(this,ui)){this.hidden=!0;return}t.shiftKey?(i=(e=this.previousElementSibling)==null?void 0:e.focus)==null||i.call(e):(r=(a=this.nextElementSibling)==null?void 0:a.focus)==null||r.call(a),this.blur()}else s==="Escape"?((n=B(this,di))==null||n.focus(),B(this,ui)&&(this.hidden=!0)):s==="Enter"||s===" "?this.handleSelect(t):this.handleMove(t)};Za=new WeakSet;to=function(t){return t.composedPath().find(e=>["menuitemradio","menuitemcheckbox"].includes(e.role))};Rl=new WeakSet;Im=function(){return this.items.find(t=>t.tabIndex===0)};Qa=new WeakSet;io=function(t){for(let e of this.items)e.tabIndex=e===t?0:-1};Jn=new WeakSet;wl=function(t,e){let i=[...this.checkedItems];t.type==="radio"&&this.radioGroupItems.forEach(a=>a.checked=!1),e?t.checked=!t.checked:t.checked=!0,this.checkedItems.some((a,r)=>a!=i[r])&&this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))};se.template=Cm;function zf(t){return["menuitem","menuitemradio","menuitemcheckbox"].includes(t==null?void 0:t.role)}function Ja(t){var e;return(e=t.getAttribute("bounds")?Pe(t,`#${t.getAttribute("bounds")}`):Z(t)||t.parentElement)!=null?e:t}d.customElements.get("media-chrome-menu")||d.customElements.define("media-chrome-menu",se);var $l=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},et=(t,e,i)=>($l(t,e,"read from private field"),i?i.call(t):e.get(t)),pt=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Nl=(t,e,i,a)=>($l(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),je=(t,e,i)=>($l(t,e,"access private method"),i),ao,er,Pl,Mm,Wl,Rm,Fl,wm,tt,Zi,tr,Ul,Lm,ro,Bl,xm=h.createElement("template");xm.innerHTML=`
2725
2649
  <style>
2726
2650
  :host {
2727
2651
  transition: var(--media-menu-item-transition,
@@ -2837,7 +2761,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2837
2761
  <slot name="description"></slot>
2838
2762
  <slot name="suffix"></slot>
2839
2763
  <slot name="submenu"></slot>
2840
- `;var Ie={TYPE:"type",VALUE:"value",CHECKED:"checked",DISABLED:"disabled"},Nt=class extends d.HTMLElement{constructor(){super(),ft(this,Ol),ft(this,Hl),ft(this,Wl),ft(this,Qi),ft(this,Nl),ft(this,ao),ft(this,io,!1),ft(this,rr,void 0),ft(this,it,()=>{var e,t;this.setAttribute("submenusize",`${this.submenuElement.items.length}`);let a=this.shadowRoot.querySelector('slot[name="description"]'),r=(e=this.submenuElement.checkedItems)==null?void 0:e[0],n=(t=r==null?void 0:r.dataset.description)!=null?t:r==null?void 0:r.text,s=m.createElement("span");s.textContent=n!=null?n:"",a.replaceChildren(s)}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.append(this.constructor.template.content.cloneNode(!0))),this.shadowRoot.addEventListener("slotchange",this)}static get observedAttributes(){return[Ie.TYPE,Ie.DISABLED,Ie.CHECKED,Ie.VALUE]}enable(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","-1"),ar(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":et(this,Ol,km).call(this,e);break;case"click":this.handleClick(e);break;case"keydown":et(this,Nl,Cm).call(this,e);break;case"keyup":et(this,Qi,nr).call(this,e);break}}attributeChangedCallback(e,t,a){e===Ie.CHECKED&&ar(this)&&!tt(this,io)?this.setAttribute("aria-checked",a!=null?"true":"false"):e===Ie.TYPE&&a!==t?this.role="menuitem"+a:e===Ie.DISABLED&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(Ie.DISABLED)||this.enable(),this.role="menuitem"+this.type,Dl(this,rr,Ul(this,this.parentNode)),et(this,ao,Pl).call(this)}disconnectedCallback(){this.disable(),et(this,ao,Pl).call(this),Dl(this,rr,null)}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=$t(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(Ie.TYPE))!=null?e:""}set type(e){this.setAttribute(Ie.TYPE,`${e}`)}get value(){var e;return(e=this.getAttribute(Ie.VALUE))!=null?e:this.text}set value(e){this.setAttribute(Ie.VALUE,e)}get text(){var e;return((e=this.textContent)!=null?e:"").trim()}get checked(){if(ar(this))return this.getAttribute("aria-checked")==="true"}set checked(e){ar(this)&&(Dl(this,io,!0),this.setAttribute("aria-checked",e?"true":"false"),e?this.part.add("checked"):this.part.remove("checked"))}handleClick(e){ar(this)||this.invokeTargetElement&&ce(this,e.target)&&this.invokeTargetElement.dispatchEvent(new Dt({relatedTarget:this}))}get keysUsed(){return["Enter"," "]}};io=new WeakMap;rr=new WeakMap;Ol=new WeakSet;km=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?et(this,Hl,Sm).call(this):et(this,Wl,Im).call(this))};Hl=new WeakSet;Sm=async function(){this.setAttribute("aria-haspopup","menu"),this.setAttribute("aria-expanded",`${!this.submenuElement.hidden}`),this.submenuElement.addEventListener("change",tt(this,it)),this.submenuElement.addEventListener("addmenuitem",tt(this,it)),this.submenuElement.addEventListener("removemenuitem",tt(this,it)),tt(this,it).call(this)};Wl=new WeakSet;Im=function(){this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.submenuElement.removeEventListener("change",tt(this,it)),this.submenuElement.removeEventListener("addmenuitem",tt(this,it)),this.submenuElement.removeEventListener("removemenuitem",tt(this,it)),tt(this,it).call(this)};it=new WeakMap;Qi=new WeakSet;nr=function(i){let{key:e}=i;if(!this.keysUsed.includes(e)){this.removeEventListener("keyup",et(this,Qi,nr));return}this.handleClick(i)};Nl=new WeakSet;Cm=function(i){let{metaKey:e,altKey:t,key:a}=i;if(e||t||!this.keysUsed.includes(a)){this.removeEventListener("keyup",et(this,Qi,nr));return}this.addEventListener("keyup",et(this,Qi,nr),{once:!0})};ao=new WeakSet;Pl=function(){var i;let e=(i=tt(this,rr))==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")};Nt.template=Mm;function ar(i){return i.type==="radio"||i.type==="checkbox"}function Ul(i,e){if(!i)return null;let{host:t}=i.getRootNode();return!e&&t?Ul(i,t):e!=null&&e.items?e:Ul(e,e==null?void 0:e.parentNode)}d.customElements.get("media-chrome-menu-item")||d.customElements.define("media-chrome-menu-item",Nt);var Lm=m.createElement("template");Lm.innerHTML=le.template.innerHTML+`
2764
+ `;var Se={TYPE:"type",VALUE:"value",CHECKED:"checked",DISABLED:"disabled"},xt=class extends d.HTMLElement{constructor(){super(),pt(this,Pl),pt(this,Wl),pt(this,Fl),pt(this,Zi),pt(this,Ul),pt(this,ro),pt(this,ao,!1),pt(this,er,void 0),pt(this,tt,()=>{var e,i;this.setAttribute("submenusize",`${this.submenuElement.items.length}`);let a=this.shadowRoot.querySelector('slot[name="description"]'),r=(e=this.submenuElement.checkedItems)==null?void 0:e[0],n=(i=r==null?void 0:r.dataset.description)!=null?i:r==null?void 0:r.text,s=h.createElement("span");s.textContent=n!=null?n:"",a.replaceChildren(s)}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.append(this.constructor.template.content.cloneNode(!0))),this.shadowRoot.addEventListener("slotchange",this)}static get observedAttributes(){return[Se.TYPE,Se.DISABLED,Se.CHECKED,Se.VALUE]}enable(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","-1"),ja(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":je(this,Pl,Mm).call(this,e);break;case"click":this.handleClick(e);break;case"keydown":je(this,Ul,Lm).call(this,e);break;case"keyup":je(this,Zi,tr).call(this,e);break}}attributeChangedCallback(e,i,a){e===Se.CHECKED&&ja(this)&&!et(this,ao)?this.setAttribute("aria-checked",a!=null?"true":"false"):e===Se.TYPE&&a!==i?this.role="menuitem"+a:e===Se.DISABLED&&a!==i&&(a==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(Se.DISABLED)||this.enable(),this.role="menuitem"+this.type,Nl(this,er,Hl(this,this.parentNode)),je(this,ro,Bl).call(this)}disconnectedCallback(){this.disable(),je(this,ro,Bl).call(this),Nl(this,er,null)}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=Bt(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(Se.TYPE))!=null?e:""}set type(e){this.setAttribute(Se.TYPE,`${e}`)}get value(){var e;return(e=this.getAttribute(Se.VALUE))!=null?e:this.text}set value(e){this.setAttribute(Se.VALUE,e)}get text(){var e;return((e=this.textContent)!=null?e:"").trim()}get checked(){if(ja(this))return this.getAttribute("aria-checked")==="true"}set checked(e){ja(this)&&(Nl(this,ao,!0),this.setAttribute("aria-checked",e?"true":"false"),e?this.part.add("checked"):this.part.remove("checked"))}handleClick(e){ja(this)||this.invokeTargetElement&&ue(this,e.target)&&this.invokeTargetElement.dispatchEvent(new wt({relatedTarget:this}))}get keysUsed(){return["Enter"," "]}};ao=new WeakMap;er=new WeakMap;Pl=new WeakSet;Mm=function(t){let e=t.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?je(this,Wl,Rm).call(this):je(this,Fl,wm).call(this))};Wl=new WeakSet;Rm=async function(){this.setAttribute("aria-haspopup","menu"),this.setAttribute("aria-expanded",`${!this.submenuElement.hidden}`),this.submenuElement.addEventListener("change",et(this,tt)),this.submenuElement.addEventListener("addmenuitem",et(this,tt)),this.submenuElement.addEventListener("removemenuitem",et(this,tt)),et(this,tt).call(this)};Fl=new WeakSet;wm=function(){this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.submenuElement.removeEventListener("change",et(this,tt)),this.submenuElement.removeEventListener("addmenuitem",et(this,tt)),this.submenuElement.removeEventListener("removemenuitem",et(this,tt)),et(this,tt).call(this)};tt=new WeakMap;Zi=new WeakSet;tr=function(t){let{key:e}=t;if(!this.keysUsed.includes(e)){this.removeEventListener("keyup",je(this,Zi,tr));return}this.handleClick(t)};Ul=new WeakSet;Lm=function(t){let{metaKey:e,altKey:i,key:a}=t;if(e||i||!this.keysUsed.includes(a)){this.removeEventListener("keyup",je(this,Zi,tr));return}this.addEventListener("keyup",je(this,Zi,tr),{once:!0})};ro=new WeakSet;Bl=function(){var t;let e=(t=et(this,er))==null?void 0:t.radioGroupItems;if(!e)return;let i=e.filter(a=>a.getAttribute("aria-checked")==="true").pop();i||(i=e[0]);for(let a of e)a.setAttribute("aria-checked","false");i==null||i.setAttribute("aria-checked","true")};xt.template=xm;function ja(t){return t.type==="radio"||t.type==="checkbox"}function Hl(t,e){if(!t)return null;let{host:i}=t.getRootNode();return!e&&i?Hl(t,i):e!=null&&e.items?e:Hl(e,e==null?void 0:e.parentNode)}d.customElements.get("media-chrome-menu-item")||d.customElements.define("media-chrome-menu-item",xt);var Dm=h.createElement("template");Dm.innerHTML=se.template.innerHTML+`
2841
2765
  <style>
2842
2766
  :host {
2843
2767
  background: var(--media-settings-menu-background,
@@ -2864,7 +2788,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2864
2788
  --media-settings-menu-item-opacity: 0;
2865
2789
  }
2866
2790
  </style>
2867
- `;var or=class extends le{get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Z(this).querySelector("media-settings-menu-button")}};or.template=Lm;d.customElements.get("media-settings-menu")||d.customElements.define("media-settings-menu",or);var Rm,ro=m.createElement("template");ro.innerHTML=Nt.template.innerHTML+`
2791
+ `;var ir=class extends se{get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Z(this).querySelector("media-settings-menu-button")}};ir.template=Dm;d.customElements.get("media-settings-menu")||d.customElements.define("media-settings-menu",ir);var Om,no=h.createElement("template");no.innerHTML=xt.template.innerHTML+`
2868
2792
  <style>
2869
2793
  slot:not([name="submenu"]) {
2870
2794
  opacity: var(--media-settings-menu-item-opacity, var(--media-menu-item-opacity));
@@ -2874,11 +2798,11 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2874
2798
  background: transparent;
2875
2799
  }
2876
2800
  </style>
2877
- `;(Rm=ro.content)!=null&&Rm.querySelector&&(ro.content.querySelector('slot[name="suffix"]').innerHTML=`
2801
+ `;(Om=no.content)!=null&&Om.querySelector&&(no.content.querySelector('slot[name="suffix"]').innerHTML=`
2878
2802
  <svg aria-hidden="true" viewBox="0 0 20 24">
2879
2803
  <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"/>
2880
2804
  </svg>
2881
- `);var sr=class extends Nt{};sr.template=ro;d.customElements.get("media-settings-menu-item")||d.customElements.define("media-settings-menu-item",sr);var ke=class extends F{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=$t(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):null}handleClick(){var e;(e=this.invokeTargetElement)==null||e.dispatchEvent(new Dt({relatedTarget:this}))}};d.customElements.get("media-chrome-menu-button")||d.customElements.define("media-chrome-menu-button",ke);var wm=m.createElement("template");wm.innerHTML=`
2805
+ `);var ar=class extends xt{};ar.template=no;d.customElements.get("media-settings-menu-item")||d.customElements.define("media-settings-menu-item",ar);var ke=class extends F{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=Bt(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):null}handleClick(){var e;(e=this.invokeTargetElement)==null||e.dispatchEvent(new wt({relatedTarget:this}))}};d.customElements.get("media-chrome-menu-button")||d.customElements.define("media-chrome-menu-button",ke);var Nm=h.createElement("template");Nm.innerHTML=`
2882
2806
  <style>
2883
2807
  :host([aria-expanded="true"]) slot[name=tooltip] {
2884
2808
  display: none;
@@ -2889,25 +2813,25 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2889
2813
  <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"/>
2890
2814
  </svg>
2891
2815
  </slot>
2892
- `;var no=class extends ke{static get observedAttributes(){return[...super.observedAttributes,"target"]}constructor(){super({slotTemplate:wm,tooltipContent:I.SETTINGS})}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",V.SETTINGS())}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:Z(this).querySelector("media-settings-menu")}};d.customElements.get("media-settings-menu-button")||d.customElements.define("media-settings-menu-button",no);var Vl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},xm=(i,e,t)=>(Vl(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)},$l=(i,e,t,a)=>(Vl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),so=(i,e,t)=>(Vl(i,e,"access private method"),t),lr,co,lo,Fl,uo,Kl,mo=class extends le{constructor(){super(...arguments),oo(this,lo),oo(this,uo),oo(this,lr,[]),oo(this,co,void 0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_AUDIO_TRACK_LIST,o.MEDIA_AUDIO_TRACK_ENABLED,o.MEDIA_AUDIO_TRACK_UNAVAILABLE]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_AUDIO_TRACK_ENABLED&&t!==a?this.value=a:e===o.MEDIA_AUDIO_TRACK_LIST&&t!==a&&($l(this,lr,Dd(a!=null?a:"")),so(this,lo,Fl).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",so(this,uo,Kl))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",so(this,uo,Kl))}get anchorElement(){var e;return this.anchor!=="auto"?super.anchorElement:(e=Z(this))==null?void 0:e.querySelector("media-audio-track-menu-button")}get mediaAudioTrackList(){return xm(this,lr)}set mediaAudioTrackList(e){$l(this,lr,e),so(this,lo,Fl).call(this)}get mediaAudioTrackEnabled(){var e;return(e=x(this,o.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){M(this,o.MEDIA_AUDIO_TRACK_ENABLED,e)}};lr=new WeakMap;co=new WeakMap;lo=new WeakSet;Fl=function(){if(xm(this,co)===JSON.stringify(this.mediaAudioTrackList))return;$l(this,co,JSON.stringify(this.mediaAudioTrackList));let i=this.mediaAudioTrackList;this.defaultSlot.textContent="";for(let e of i){let t=this.formatMenuItemText(e.label,e),a=je({type:"radio",text:t,value:`${e.id}`,checked:e.enabled});a.prepend(Ne(this,"checked-indicator")),this.defaultSlot.append(a)}};uo=new WeakSet;Kl=function(){if(this.value==null)return;let i=new d.CustomEvent(p.MEDIA_AUDIO_TRACK_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};d.customElements.get("media-audio-track-menu")||d.customElements.define("media-audio-track-menu",mo);var Bv=`<svg aria-hidden="true" viewBox="0 0 24 24">
2816
+ `;var oo=class extends ke{static get observedAttributes(){return[...super.observedAttributes,"target"]}constructor(){super({slotTemplate:Nm,tooltipContent:C.SETTINGS})}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",V.SETTINGS())}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:Z(this).querySelector("media-settings-menu")}};d.customElements.get("media-settings-menu-button")||d.customElements.define("media-settings-menu-button",oo);var Gl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Pm=(t,e,i)=>(Gl(t,e,"read from private field"),i?i.call(t):e.get(t)),so=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Kl=(t,e,i,a)=>(Gl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),lo=(t,e,i)=>(Gl(t,e,"access private method"),i),rr,mo,uo,Vl,co,Yl,ho=class extends se{constructor(){super(...arguments),so(this,uo),so(this,co),so(this,rr,[]),so(this,mo,void 0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_AUDIO_TRACK_LIST,o.MEDIA_AUDIO_TRACK_ENABLED,o.MEDIA_AUDIO_TRACK_UNAVAILABLE]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_AUDIO_TRACK_ENABLED&&i!==a?this.value=a:e===o.MEDIA_AUDIO_TRACK_LIST&&i!==a&&(Kl(this,rr,Wd(a!=null?a:"")),lo(this,uo,Vl).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",lo(this,co,Yl))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",lo(this,co,Yl))}get anchorElement(){var e;return this.anchor!=="auto"?super.anchorElement:(e=Z(this))==null?void 0:e.querySelector("media-audio-track-menu-button")}get mediaAudioTrackList(){return Pm(this,rr)}set mediaAudioTrackList(e){Kl(this,rr,e),lo(this,uo,Vl).call(this)}get mediaAudioTrackEnabled(){var e;return(e=R(this,o.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){I(this,o.MEDIA_AUDIO_TRACK_ENABLED,e)}};rr=new WeakMap;mo=new WeakMap;uo=new WeakSet;Vl=function(){if(Pm(this,mo)===JSON.stringify(this.mediaAudioTrackList))return;Kl(this,mo,JSON.stringify(this.mediaAudioTrackList));let t=this.mediaAudioTrackList;this.defaultSlot.textContent="";for(let e of t){let i=this.formatMenuItemText(e.label,e),a=Je({type:"radio",text:i,value:`${e.id}`,checked:e.enabled});a.prepend(Oe(this,"checked-indicator")),this.defaultSlot.append(a)}};co=new WeakSet;Yl=function(){if(this.value==null)return;let t=new d.CustomEvent(p.MEDIA_AUDIO_TRACK_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(t)};d.customElements.get("media-audio-track-menu")||d.customElements.define("media-audio-track-menu",ho);var Xf=`<svg aria-hidden="true" viewBox="0 0 24 24">
2893
2817
  <path d="M11 17H9.5V7H11v10Zm-3-3H6.5v-4H8v4Zm6-5h-1.5v6H14V9Zm3 7h-1.5V8H17v8Z"/>
2894
2818
  <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"/>
2895
- </svg>`,Dm=m.createElement("template");Dm.innerHTML=`
2819
+ </svg>`,Um=h.createElement("template");Um.innerHTML=`
2896
2820
  <style>
2897
2821
  :host([aria-expanded="true"]) slot[name=tooltip] {
2898
2822
  display: none;
2899
2823
  }
2900
2824
  </style>
2901
- <slot name="icon">${Bv}</slot>
2902
- `;var ho=class extends ke{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_AUDIO_TRACK_ENABLED,o.MEDIA_AUDIO_TRACK_UNAVAILABLE]}constructor(){super({slotTemplate:Dm,tooltipContent:I.AUDIO_TRACK_MENU})}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",V.AUDIO_TRACKS())}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=Z(this))==null?void 0:e.querySelector("media-audio-track-menu")}get mediaAudioTrackEnabled(){var e;return(e=x(this,o.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){M(this,o.MEDIA_AUDIO_TRACK_ENABLED,e)}};d.customElements.get("media-audio-track-menu-button")||d.customElements.define("media-audio-track-menu-button",ho);var Ql=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Hv=(i,e,t)=>(Ql(i,e,"read from private field"),t?t.call(i):e.get(i)),Yl=(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)},Wv=(i,e,t,a)=>(Ql(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Gl=(i,e,t)=>(Ql(i,e,"access private method"),t),vo,ql,Pm,po,Zl,$v=`
2825
+ <slot name="icon">${Xf}</slot>
2826
+ `;var po=class extends ke{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_AUDIO_TRACK_ENABLED,o.MEDIA_AUDIO_TRACK_UNAVAILABLE]}constructor(){super({slotTemplate:Um,tooltipContent:C.AUDIO_TRACK_MENU})}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",V.AUDIO_TRACKS())}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=Z(this))==null?void 0:e.querySelector("media-audio-track-menu")}get mediaAudioTrackEnabled(){var e;return(e=R(this,o.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){I(this,o.MEDIA_AUDIO_TRACK_ENABLED,e)}};d.customElements.get("media-audio-track-menu-button")||d.customElements.define("media-audio-track-menu-button",po);var Xl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Jf=(t,e,i)=>(Xl(t,e,"read from private field"),i?i.call(t):e.get(t)),ql=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},jf=(t,e,i,a)=>(Xl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Zl=(t,e,i)=>(Xl(t,e,"access private method"),i),vo,Ql,$m,fo,zl,ev=`
2903
2827
  <svg aria-hidden="true" viewBox="0 0 26 24" part="captions-indicator indicator">
2904
2828
  <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"/>
2905
- </svg>`,Um=m.createElement("template");Um.innerHTML=le.template.innerHTML+`
2906
- <slot name="captions-indicator" hidden>${$v}</slot>`;var dr=class extends le{constructor(){super(...arguments),Yl(this,ql),Yl(this,po),Yl(this,vo,void 0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_SUBTITLES_LIST&&t!==a?Gl(this,ql,Pm).call(this):e===o.MEDIA_SUBTITLES_SHOWING&&t!==a&&(this.value=a)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Gl(this,po,Zl))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Gl(this,po,Zl))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Z(this).querySelector("media-captions-menu-button")}get mediaSubtitlesList(){return Om(this,o.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Nm(this,o.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Om(this,o.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Nm(this,o.MEDIA_SUBTITLES_SHOWING,e)}};vo=new WeakMap;ql=new WeakSet;Pm=function(){var i;if(Hv(this,vo)===JSON.stringify(this.mediaSubtitlesList))return;Wv(this,vo,JSON.stringify(this.mediaSubtitlesList)),this.defaultSlot.textContent="";let e=!this.value,t=je({type:"radio",text:this.formatMenuItemText("Off"),value:"off",checked:e});t.prepend(Ne(this,"checked-indicator")),this.defaultSlot.append(t);let a=this.mediaSubtitlesList;for(let r of a){let n=je({type:"radio",text:this.formatMenuItemText(r.label,r),value:Ur(r),checked:this.value==Ur(r)});n.prepend(Ne(this,"checked-indicator")),((i=r.kind)!=null?i:"subs")==="captions"&&n.append(Ne(this,"captions-indicator")),this.defaultSlot.append(n)}};po=new WeakSet;Zl=function(){let i=this.mediaSubtitlesShowing,e=this.getAttribute(o.MEDIA_SUBTITLES_SHOWING),t=this.value!==e;if(i!=null&&i.length&&t&&this.dispatchEvent(new d.CustomEvent(p.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:i})),!this.value||!t)return;let a=new d.CustomEvent(p.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(a)};dr.template=Um;var Om=(i,e)=>{let t=i.getAttribute(e);return t?Kt(t):[]},Nm=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let a=ut(t);i.getAttribute(e)!==a&&i.setAttribute(e,a)};d.customElements.get("media-captions-menu")||d.customElements.define("media-captions-menu",dr);var Fv=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Kv=(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)},Vv=(i,e,t,a)=>(Fv(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),zl,Yv=`<svg aria-hidden="true" viewBox="0 0 26 24">
2829
+ </svg>`,Wm=h.createElement("template");Wm.innerHTML=se.template.innerHTML+`
2830
+ <slot name="captions-indicator" hidden>${ev}</slot>`;var nr=class extends se{constructor(){super(...arguments),ql(this,Ql),ql(this,fo),ql(this,vo,void 0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_SUBTITLES_LIST&&i!==a?Zl(this,Ql,$m).call(this):e===o.MEDIA_SUBTITLES_SHOWING&&i!==a&&(this.value=a)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Zl(this,fo,zl))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Zl(this,fo,zl))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Z(this).querySelector("media-captions-menu-button")}get mediaSubtitlesList(){return Bm(this,o.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Hm(this,o.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Bm(this,o.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Hm(this,o.MEDIA_SUBTITLES_SHOWING,e)}};vo=new WeakMap;Ql=new WeakSet;$m=function(){var t;if(Jf(this,vo)===JSON.stringify(this.mediaSubtitlesList))return;jf(this,vo,JSON.stringify(this.mediaSubtitlesList)),this.defaultSlot.textContent="";let e=!this.value,i=Je({type:"radio",text:this.formatMenuItemText("Off"),value:"off",checked:e});i.prepend(Oe(this,"checked-indicator")),this.defaultSlot.append(i);let a=this.mediaSubtitlesList;for(let r of a){let n=Je({type:"radio",text:this.formatMenuItemText(r.label,r),value:Nr(r),checked:this.value==Nr(r)});n.prepend(Oe(this,"checked-indicator")),((t=r.kind)!=null?t:"subs")==="captions"&&n.append(Oe(this,"captions-indicator")),this.defaultSlot.append(n)}};fo=new WeakSet;zl=function(){let t=this.mediaSubtitlesShowing,e=this.getAttribute(o.MEDIA_SUBTITLES_SHOWING),i=this.value!==e;if(t!=null&&t.length&&i&&this.dispatchEvent(new d.CustomEvent(p.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:t})),!this.value||!i)return;let a=new d.CustomEvent(p.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(a)};nr.template=Wm;var Bm=(t,e)=>{let i=t.getAttribute(e);return i?$t(i):[]},Hm=(t,e,i)=>{if(!(i!=null&&i.length)){t.removeAttribute(e);return}let a=lt(i);t.getAttribute(e)!==a&&t.setAttribute(e,a)};d.customElements.get("media-captions-menu")||d.customElements.define("media-captions-menu",nr);var tv=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},iv=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},av=(t,e,i,a)=>(tv(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Jl,rv=`<svg aria-hidden="true" viewBox="0 0 26 24">
2907
2831
  <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"/>
2908
- </svg>`,Gv=`<svg aria-hidden="true" viewBox="0 0 26 24">
2832
+ </svg>`,nv=`<svg aria-hidden="true" viewBox="0 0 26 24">
2909
2833
  <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"/>
2910
- </svg>`,$m=m.createElement("template");$m.innerHTML=`
2834
+ </svg>`,Ym=h.createElement("template");Ym.innerHTML=`
2911
2835
  <style>
2912
2836
  :host([aria-checked="true"]) slot[name=off] {
2913
2837
  display: none !important;
@@ -2924,10 +2848,10 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2924
2848
  </style>
2925
2849
 
2926
2850
  <slot name="icon">
2927
- <slot name="on">${Yv}</slot>
2928
- <slot name="off">${Gv}</slot>
2851
+ <slot name="on">${rv}</slot>
2852
+ <slot name="off">${nv}</slot>
2929
2853
  </slot>
2930
- `;var Bm=i=>{i.setAttribute("aria-checked",Br(i).toString())},fo=class extends ke{constructor(e={}){super({slotTemplate:$m,tooltipContent:I.CAPTIONS,...e}),Kv(this,zl,void 0),Vv(this,zl,!1)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",V.CLOSED_CAPTIONS()),Bm(this)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_SUBTITLES_SHOWING&&Bm(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=Z(this))==null?void 0:e.querySelector("media-captions-menu")}get mediaSubtitlesList(){return Hm(this,o.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Wm(this,o.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Hm(this,o.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Wm(this,o.MEDIA_SUBTITLES_SHOWING,e)}};zl=new WeakMap;var Hm=(i,e)=>{let t=i.getAttribute(e);return t?Kt(t):[]},Wm=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let a=ut(t);i.getAttribute(e)!==a&&i.setAttribute(e,a)};d.customElements.get("media-captions-menu-button")||d.customElements.define("media-captions-menu-button",fo);var Fm=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Eo=(i,e,t)=>(Fm(i,e,"read from private field"),t?t.call(i):e.get(i)),Xl=(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)},ur=(i,e,t)=>(Fm(i,e,"access private method"),t),zi,cr,bo,go,jl,Jl={RATES:"rates"},_o=class extends le{constructor(){super(),Xl(this,cr),Xl(this,go),Xl(this,zi,new Be(this,Jl.RATES,{defaultValue:Os})),ur(this,cr,bo).call(this)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,Jl.RATES]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_PLAYBACK_RATE&&t!=a?this.value=a:e===Jl.RATES&&t!=a&&(Eo(this,zi).value=a,ur(this,cr,bo).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",ur(this,go,jl))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",ur(this,go,jl))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Z(this).querySelector("media-playback-rate-menu-button")}get rates(){return Eo(this,zi)}set rates(e){e?Array.isArray(e)&&(Eo(this,zi).value=e.join(" ")):Eo(this,zi).value="",ur(this,cr,bo).call(this)}get mediaPlaybackRate(){return w(this,o.MEDIA_PLAYBACK_RATE,Ri)}set mediaPlaybackRate(e){P(this,o.MEDIA_PLAYBACK_RATE,e)}};zi=new WeakMap;cr=new WeakSet;bo=function(){this.defaultSlot.textContent="";for(let i of this.rates){let e=je({type:"radio",text:this.formatMenuItemText(`${i}x`,i),value:i,checked:this.mediaPlaybackRate==i});e.prepend(Ne(this,"checked-indicator")),this.defaultSlot.append(e)}};go=new WeakSet;jl=function(){if(!this.value)return;let i=new d.CustomEvent(p.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};d.customElements.get("media-playback-rate-menu")||d.customElements.define("media-playback-rate-menu",_o);var qv=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ao=(i,e,t)=>(qv(i,e,"read from private field"),t?t.call(i):e.get(i)),Zv=(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,ed={RATES:"rates"},Qv=[1,1.2,1.5,1.7,2],td=1,Km=m.createElement("template");Km.innerHTML=`
2854
+ `;var Fm=t=>{t.setAttribute("aria-checked",Pr(t).toString())},Eo=class extends ke{constructor(e={}){super({slotTemplate:Ym,tooltipContent:C.CAPTIONS,...e}),iv(this,Jl,void 0),av(this,Jl,!1)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",V.CLOSED_CAPTIONS()),Fm(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_SUBTITLES_SHOWING&&Fm(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=Z(this))==null?void 0:e.querySelector("media-captions-menu")}get mediaSubtitlesList(){return Km(this,o.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Vm(this,o.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Km(this,o.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Vm(this,o.MEDIA_SUBTITLES_SHOWING,e)}};Jl=new WeakMap;var Km=(t,e)=>{let i=t.getAttribute(e);return i?$t(i):[]},Vm=(t,e,i)=>{if(!(i!=null&&i.length)){t.removeAttribute(e);return}let a=lt(i);t.getAttribute(e)!==a&&t.setAttribute(e,a)};d.customElements.get("media-captions-menu-button")||d.customElements.define("media-captions-menu-button",Eo);var Gm=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},bo=(t,e,i)=>(Gm(t,e,"read from private field"),i?i.call(t):e.get(t)),jl=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},or=(t,e,i)=>(Gm(t,e,"access private method"),i),Qi,sr,go,_o,td,ed={RATES:"rates"},Ao=class extends se{constructor(){super(),jl(this,sr),jl(this,_o),jl(this,Qi,new Ue(this,ed.RATES,{defaultValue:Us})),or(this,sr,go).call(this)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,ed.RATES]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_PLAYBACK_RATE&&i!=a?this.value=a:e===ed.RATES&&i!=a&&(bo(this,Qi).value=a,or(this,sr,go).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",or(this,_o,td))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",or(this,_o,td))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Z(this).querySelector("media-playback-rate-menu-button")}get rates(){return bo(this,Qi)}set rates(e){e?Array.isArray(e)&&(bo(this,Qi).value=e.join(" ")):bo(this,Qi).value="",or(this,sr,go).call(this)}get mediaPlaybackRate(){return M(this,o.MEDIA_PLAYBACK_RATE,wi)}set mediaPlaybackRate(e){D(this,o.MEDIA_PLAYBACK_RATE,e)}};Qi=new WeakMap;sr=new WeakSet;go=function(){this.defaultSlot.textContent="";for(let t of this.rates){let e=Je({type:"radio",text:this.formatMenuItemText(`${t}x`,t),value:t,checked:this.mediaPlaybackRate==t});e.prepend(Oe(this,"checked-indicator")),this.defaultSlot.append(e)}};_o=new WeakSet;td=function(){if(!this.value)return;let t=new d.CustomEvent(p.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(t)};d.customElements.get("media-playback-rate-menu")||d.customElements.define("media-playback-rate-menu",Ao);var ov=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},To=(t,e,i)=>(ov(t,e,"read from private field"),i?i.call(t):e.get(t)),sv=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},zi,id={RATES:"rates"},lv=[1,1.2,1.5,1.7,2],ad=1,qm=h.createElement("template");qm.innerHTML=`
2931
2855
  <style>
2932
2856
  :host {
2933
2857
  min-width: 5ch;
@@ -2939,14 +2863,26 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2939
2863
  }
2940
2864
  </style>
2941
2865
  <slot name="icon"></slot>
2942
- `;var To=class extends ke{constructor(e={}){super({slotTemplate:Km,tooltipContent:I.PLAYBACK_RATE,...e}),Zv(this,Xi,new Be(this,ed.RATES,{defaultValue:Qv})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${td}x`}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,ed.RATES]}attributeChangedCallback(e,t,a){if(super.attributeChangedCallback(e,t,a),e===ed.RATES&&(Ao(this,Xi).value=a),e===o.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,n=Number.isNaN(r)?td:r;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",V.PLAYBACK_RATE({playbackRate:n}))}}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:Z(this).querySelector("media-playback-rate-menu")}get rates(){return Ao(this,Xi)}set rates(e){e?Array.isArray(e)&&(Ao(this,Xi).value=e.join(" ")):Ao(this,Xi).value=""}get mediaPlaybackRate(){return w(this,o.MEDIA_PLAYBACK_RATE,td)}set mediaPlaybackRate(e){P(this,o.MEDIA_PLAYBACK_RATE,e)}};Xi=new WeakMap;d.customElements.get("media-playback-rate-menu-button")||d.customElements.define("media-playback-rate-menu-button",To);var ad=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},hr=(i,e,t)=>(ad(i,e,"read from private field"),t?t.call(i):e.get(i)),yo=(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)},Vm=(i,e,t,a)=>(ad(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),mr=(i,e,t)=>(ad(i,e,"access private method"),t),pr,Ji,vr,ko,So,id,Io=class extends le{constructor(){super(...arguments),yo(this,vr),yo(this,So),yo(this,pr,[]),yo(this,Ji,{})}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_RENDITION_LIST,o.MEDIA_RENDITION_SELECTED,o.MEDIA_RENDITION_UNAVAILABLE,o.MEDIA_HEIGHT]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_RENDITION_SELECTED&&t!==a?this.value=a!=null?a:"auto":e===o.MEDIA_RENDITION_LIST&&t!==a?(Vm(this,pr,wd(a)),mr(this,vr,ko).call(this)):e===o.MEDIA_HEIGHT&&t!==a&&mr(this,vr,ko).call(this)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",mr(this,So,id))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",mr(this,So,id))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Z(this).querySelector("media-rendition-menu-button")}get mediaRenditionList(){return hr(this,pr)}set mediaRenditionList(e){Vm(this,pr,e),mr(this,vr,ko).call(this)}get mediaRenditionSelected(){return x(this,o.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){M(this,o.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return w(this,o.MEDIA_HEIGHT)}set mediaHeight(e){P(this,o.MEDIA_HEIGHT,e)}};pr=new WeakMap;Ji=new WeakMap;vr=new WeakSet;ko=function(){if(hr(this,Ji).mediaRenditionList===JSON.stringify(this.mediaRenditionList)&&hr(this,Ji).mediaHeight===this.mediaHeight)return;hr(this,Ji).mediaRenditionList=JSON.stringify(this.mediaRenditionList),hr(this,Ji).mediaHeight=this.mediaHeight;let i=this.mediaRenditionList.sort((r,n)=>n.height-r.height);for(let r of i)r.selected=r.id===this.mediaRenditionSelected;this.defaultSlot.textContent="";let e=!this.mediaRenditionSelected;for(let r of i){let n=this.formatMenuItemText(`${Math.min(r.width,r.height)}p`,r),s=je({type:"radio",text:n,value:`${r.id}`,checked:r.selected&&!e});s.prepend(Ne(this,"checked-indicator")),this.defaultSlot.append(s)}let t=je({type:"radio",text:this.formatMenuItemText("Auto"),value:"auto",checked:e}),a=this.mediaHeight>0?`Auto (${this.mediaHeight}p)`:"Auto";t.dataset.description=a,t.prepend(Ne(this,"checked-indicator")),this.defaultSlot.append(t)};So=new WeakSet;id=function(){if(this.value==null)return;let i=new d.CustomEvent(p.MEDIA_RENDITION_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};d.customElements.get("media-rendition-menu")||d.customElements.define("media-rendition-menu",Io);var zv=`<svg aria-hidden="true" viewBox="0 0 24 24">
2866
+ `;var yo=class extends ke{constructor(e={}){super({slotTemplate:qm,tooltipContent:C.PLAYBACK_RATE,...e}),sv(this,zi,new Ue(this,id.RATES,{defaultValue:lv})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${ad}x`}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,id.RATES]}attributeChangedCallback(e,i,a){if(super.attributeChangedCallback(e,i,a),e===id.RATES&&(To(this,zi).value=a),e===o.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,n=Number.isNaN(r)?ad:r;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",V.PLAYBACK_RATE({playbackRate:n}))}}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:Z(this).querySelector("media-playback-rate-menu")}get rates(){return To(this,zi)}set rates(e){e?Array.isArray(e)&&(To(this,zi).value=e.join(" ")):To(this,zi).value=""}get mediaPlaybackRate(){return M(this,o.MEDIA_PLAYBACK_RATE,ad)}set mediaPlaybackRate(e){D(this,o.MEDIA_PLAYBACK_RATE,e)}};zi=new WeakMap;d.customElements.get("media-playback-rate-menu-button")||d.customElements.define("media-playback-rate-menu-button",yo);var nd=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},dr=(t,e,i)=>(nd(t,e,"read from private field"),i?i.call(t):e.get(t)),ko=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Zm=(t,e,i,a)=>(nd(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),lr=(t,e,i)=>(nd(t,e,"access private method"),i),ur,Xi,cr,So,Io,rd,Co=class extends se{constructor(){super(...arguments),ko(this,cr),ko(this,Io),ko(this,ur,[]),ko(this,Xi,{})}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_RENDITION_LIST,o.MEDIA_RENDITION_SELECTED,o.MEDIA_RENDITION_UNAVAILABLE,o.MEDIA_HEIGHT]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_RENDITION_SELECTED&&i!==a?this.value=a!=null?a:"auto":e===o.MEDIA_RENDITION_LIST&&i!==a?(Zm(this,ur,Hd(a)),lr(this,cr,So).call(this)):e===o.MEDIA_HEIGHT&&i!==a&&lr(this,cr,So).call(this)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",lr(this,Io,rd))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",lr(this,Io,rd))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Z(this).querySelector("media-rendition-menu-button")}get mediaRenditionList(){return dr(this,ur)}set mediaRenditionList(e){Zm(this,ur,e),lr(this,cr,So).call(this)}get mediaRenditionSelected(){return R(this,o.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){I(this,o.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return M(this,o.MEDIA_HEIGHT)}set mediaHeight(e){D(this,o.MEDIA_HEIGHT,e)}};ur=new WeakMap;Xi=new WeakMap;cr=new WeakSet;So=function(){if(dr(this,Xi).mediaRenditionList===JSON.stringify(this.mediaRenditionList)&&dr(this,Xi).mediaHeight===this.mediaHeight)return;dr(this,Xi).mediaRenditionList=JSON.stringify(this.mediaRenditionList),dr(this,Xi).mediaHeight=this.mediaHeight;let t=this.mediaRenditionList.sort((r,n)=>n.height-r.height);for(let r of t)r.selected=r.id===this.mediaRenditionSelected;this.defaultSlot.textContent="";let e=!this.mediaRenditionSelected;for(let r of t){let n=this.formatMenuItemText(`${Math.min(r.width,r.height)}p`,r),s=Je({type:"radio",text:n,value:`${r.id}`,checked:r.selected&&!e});s.prepend(Oe(this,"checked-indicator")),this.defaultSlot.append(s)}let i=Je({type:"radio",text:this.formatMenuItemText("Auto"),value:"auto",checked:e}),a=this.mediaHeight>0?`Auto (${this.mediaHeight}p)`:"Auto";i.dataset.description=a,i.prepend(Oe(this,"checked-indicator")),this.defaultSlot.append(i)};Io=new WeakSet;rd=function(){if(this.value==null)return;let t=new d.CustomEvent(p.MEDIA_RENDITION_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(t)};d.customElements.get("media-rendition-menu")||d.customElements.define("media-rendition-menu",Co);var dv=`<svg aria-hidden="true" viewBox="0 0 24 24">
2943
2867
  <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" />
2944
- </svg>`,Ym=m.createElement("template");Ym.innerHTML=`
2868
+ </svg>`,Qm=h.createElement("template");Qm.innerHTML=`
2945
2869
  <style>
2946
2870
  :host([aria-expanded="true"]) slot[name=tooltip] {
2947
2871
  display: none;
2948
2872
  }
2949
2873
  </style>
2950
- <slot name="icon">${zv}</slot>
2951
- `;var Co=class extends ke{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_RENDITION_SELECTED,o.MEDIA_RENDITION_UNAVAILABLE,o.MEDIA_HEIGHT]}constructor(){super({slotTemplate:Ym,tooltipContent:I.RENDITIONS})}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",V.QUALITY())}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:Z(this).querySelector("media-rendition-menu")}get mediaRenditionSelected(){return x(this,o.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){M(this,o.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return w(this,o.MEDIA_HEIGHT)}set mediaHeight(e){P(this,o.MEDIA_HEIGHT,e)}};d.customElements.get("media-rendition-menu-button")||d.customElements.define("media-rendition-menu-button",Co);var rd=Ae.createElement("template");"innerHTML"in rd&&(rd.innerHTML=dm);var Gm,qm,Mo=class extends li{};Mo.template=(qm=(Gm=rd.content)==null?void 0:Gm.children)==null?void 0:qm[0];Q.customElements.get("media-theme-gerwig")||Q.customElements.define("media-theme-gerwig",Mo);var Xv="gerwig";var Et={SRC:"src",POSTER:"poster"},h={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",DRM_TOKEN:"drm-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",CAST_RECEIVER:"cast-receiver",NO_TOOLTIPS:"no-tooltips"},nd=["audio","backwardseekoffset","defaultduration","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","novolumepref"];function Jv(i,e){var a;return{src:!i.playbackId&&i.src,playbackId:i.playbackId,hasSrc:!!i.playbackId||!!i.src||!!i.currentSrc,poster:i.poster,storyboard:i.storyboard,storyboardSrc:i.getAttribute(h.STORYBOARD_SRC),placeholder:i.getAttribute("placeholder"),themeTemplate:jv(i),thumbnailTime:!i.tokens.thumbnail&&i.thumbnailTime,autoplay:i.autoplay,crossOrigin:i.crossOrigin,loop:i.loop,noHotKeys:i.hasAttribute(h.NOHOTKEYS),hotKeys:i.getAttribute(h.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,assetStartTime:i.assetStartTime,assetEndTime:i.assetEndTime,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:Ka(i.getAttribute(E.Attributes.STREAM_TYPE)),primaryColor:i.getAttribute(h.PRIMARY_COLOR),secondaryColor:i.getAttribute(h.SECONDARY_COLOR),accentColor:i.getAttribute(h.ACCENT_COLOR),forwardSeekOffset:i.forwardSeekOffset,backwardSeekOffset:i.backwardSeekOffset,defaultHiddenCaptions:i.defaultHiddenCaptions,defaultDuration:i.defaultDuration,defaultShowRemainingTime:i.defaultShowRemainingTime,hideDuration:ef(i),playbackRates:i.getAttribute(h.PLAYBACK_RATES),customDomain:(a=i.getAttribute(E.Attributes.CUSTOM_DOMAIN))!=null?a:void 0,title:i.getAttribute(h.TITLE),novolumepref:i.hasAttribute(h.NO_VOLUME_PREF),castReceiver:i.castReceiver,...e,extraSourceParams:i.extraSourceParams}}function jv(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=Q.customElements.get(e);if(n!=null&&n.template)return n.template}}function ef(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 Zm(i){let e=i.hasAttribute(h.TITLE)?{video_title:i.getAttribute(h.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 tf=Object.values(E.Attributes),af=Object.values(Et),rf=Object.values(h),nf=Un(),of="mux-player",Qm={dialog:void 0,isDialogOpen:!1},sf={redundant_streams:!0},Er,br,Bt,gr,pi,at,Pt,Lo,zm,_r,od,bt,hi,Ro,Xm,wo,Jm,xo,jm,Do,eh,fr=class extends nl{constructor(){super();X(this,at);X(this,Lo);X(this,_r);X(this,bt);X(this,Ro);X(this,wo);X(this,xo);X(this,Do);X(this,Er,!1);X(this,br,{});X(this,Bt,!0);X(this,gr,new Pn(this,"hotkeys"));X(this,pi,{...Qm,onCloseErrorDialog:()=>j(this,_r,od).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:t=>{il(this,Ae.activeElement)||t.preventDefault()}});this.attachShadow({mode:"open"}),j(this,Lo,zm).call(this),this.isConnected&&j(this,at,Pt).call(this)}static get observedAttributes(){var t;return[...(t=nl.observedAttributes)!=null?t:[],...af,...tf,...rf]}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=Zm(this))}attributeChangedCallback(t,a,r){switch(j(this,at,Pt).call(this),super.attributeChangedCallback(t,a,r),t){case h.HOTKEYS:R(this,gr).value=r;break;case h.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&Qe((0,S.i18n)("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time."));break}case h.THUMBNAIL_TOKEN:{if(r){let s=(0,S.parseJwt)(r);if(s){let{aud:l}=s,u=S.MuxJWTAud.THUMBNAIL;l!==u&&Qe((0,S.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:l,expectedAud:u,tokenNamePrefix:"thumbnail"}))}}break}case h.STORYBOARD_TOKEN:{if(r){let s=(0,S.parseJwt)(r);if(s){let{aud:l}=s,u=S.MuxJWTAud.STORYBOARD;l!==u&&Qe((0,S.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:l,expectedAud:u,tokenNamePrefix:"storyboard"}))}}break}case h.DRM_TOKEN:{if(r){let s=(0,S.parseJwt)(r);if(s){let{aud:l}=s,u=S.MuxJWTAud.DRM;l!==u&&Qe((0,S.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:l,expectedAud:u,tokenNamePrefix:"drm"}))}}break}case E.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&Ee((0,S.i18n)("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&&![S.StreamTypes.LIVE,S.StreamTypes.ON_DEMAND,S.StreamTypes.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:al({file:"invalid-stream-type.md",message:(0,S.i18n)("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):r===S.StreamTypes.LIVE?this.getAttribute(h.TARGET_LIVE_WINDOW)==null&&(this.targetLiveWindow=0):this.targetLiveWindow=Number.NaN}[E.Attributes.PLAYBACK_ID,Et.SRC,h.PLAYBACK_TOKEN].includes(t)&&a!==r&&Se(this,pi,{...R(this,pi),...Qm}),j(this,bt,hi).call(this,{[Dc(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?S.CmcdTypeValues.includes(t)?this.setAttribute(E.Attributes.PREFER_CMCD,t):Qe(`Invalid value for preferCmcd. Must be one of ${S.CmcdTypeValues.join()}`):this.removeAttribute(E.Attributes.PREFER_CMCD))}get hasPlayed(){var t,a;return(a=(t=this.mediaController)==null?void 0:t.hasAttribute(o.MEDIA_HAS_PLAYED))!=null?a:!1}get inLiveWindow(){var t;return(t=this.mediaController)==null?void 0:t.hasAttribute(o.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(h.THEME))!=null?t:Xv}set theme(t){this.setAttribute(h.THEME,`${t}`)}get themeProps(){let t=this.mediaTheme;if(!t)return;let a={};for(let r of t.getAttributeNames()){if(nd.includes(r))continue;let n=t.getAttribute(r);a[Nn(r)]=n===""?!0:n}return a}set themeProps(t){var r,n;j(this,at,Pt).call(this);let a={...this.themeProps,...t};for(let s in a){if(nd.includes(s))continue;let l=t==null?void 0:t[s];typeof l=="boolean"||l==null?(r=this.mediaTheme)==null||r.toggleAttribute(On(s),!!l):(n=this.mediaTheme)==null||n.setAttribute(On(s),l)}}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=Ut(this,Et.SRC))!=null?t:void 0:(a=this.getAttribute(Et.SRC))!=null?a:void 0}set src(t){t?this.setAttribute(Et.SRC,t):this.removeAttribute(Et.SRC)}get poster(){var r;let t=this.getAttribute(Et.POSTER);if(t!=null)return t;let{tokens:a}=this;if(a.playback&&!a.thumbnail){Qe("Missing expected thumbnail token. No poster image will be shown");return}if(this.playbackId&&!this.audio)return wc(this.playbackId,{customDomain:this.customDomain,thumbnailTime:(r=this.thumbnailTime)!=null?r:this.startTime,programTime:this.programStartTime,token:a.thumbnail})}set poster(t){t||t===""?this.setAttribute(Et.POSTER,t):this.removeAttribute(Et.POSTER)}get storyboardSrc(){var t;return(t=this.getAttribute(h.STORYBOARD_SRC))!=null?t:void 0}set storyboardSrc(t){t?this.setAttribute(h.STORYBOARD_SRC,t):this.removeAttribute(h.STORYBOARD_SRC)}get storyboard(){let{tokens:t}=this;if(this.storyboardSrc&&!t.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[S.StreamTypes.LIVE,S.StreamTypes.UNKNOWN].includes(this.streamType)||t.playback&&!t.storyboard))return xc(this.playbackId,{customDomain:this.customDomain,token:t.storyboard,programStartTime:this.programStartTime,programEndTime:this.programEndTime})}get audio(){return this.hasAttribute(h.AUDIO)}set audio(t){if(!t){this.removeAttribute(h.AUDIO);return}this.setAttribute(h.AUDIO,"")}get hotkeys(){return R(this,gr)}get nohotkeys(){return this.hasAttribute(h.NOHOTKEYS)}set nohotkeys(t){if(!t){this.removeAttribute(h.NOHOTKEYS);return}this.setAttribute(h.NOHOTKEYS,"")}get thumbnailTime(){return fe(this.getAttribute(h.THUMBNAIL_TIME))}set thumbnailTime(t){this.setAttribute(h.THUMBNAIL_TIME,`${t}`)}get title(){var t;return(t=this.getAttribute(h.TITLE))!=null?t:""}set title(t){t!==this.title&&(t?this.setAttribute(h.TITLE,t):this.removeAttribute("title"),super.title=t)}get placeholder(){var t;return(t=Ut(this,h.PLACEHOLDER))!=null?t:""}set placeholder(t){this.setAttribute(h.PLACEHOLDER,`${t}`)}get primaryColor(){var a,r;let t=this.getAttribute(h.PRIMARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=Q.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),t))return t}set primaryColor(t){this.setAttribute(h.PRIMARY_COLOR,`${t}`)}get secondaryColor(){var a,r;let t=this.getAttribute(h.SECONDARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=Q.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),t))return t}set secondaryColor(t){this.setAttribute(h.SECONDARY_COLOR,`${t}`)}get accentColor(){var a,r;let t=this.getAttribute(h.ACCENT_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=Q.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_accent-color"))==null?void 0:r.trim(),t))return t}set accentColor(t){this.setAttribute(h.ACCENT_COLOR,`${t}`)}get defaultShowRemainingTime(){return this.hasAttribute(h.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(t){t?this.setAttribute(h.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(h.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(this.hasAttribute(h.PLAYBACK_RATES))return this.getAttribute(h.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(h.PLAYBACK_RATES);return}this.setAttribute(h.PLAYBACK_RATES,t.join(" "))}get forwardSeekOffset(){var t;return(t=fe(this.getAttribute(h.FORWARD_SEEK_OFFSET)))!=null?t:10}set forwardSeekOffset(t){this.setAttribute(h.FORWARD_SEEK_OFFSET,`${t}`)}get backwardSeekOffset(){var t;return(t=fe(this.getAttribute(h.BACKWARD_SEEK_OFFSET)))!=null?t:10}set backwardSeekOffset(t){this.setAttribute(h.BACKWARD_SEEK_OFFSET,`${t}`)}get defaultHiddenCaptions(){return this.hasAttribute(h.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(t){t?this.setAttribute(h.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(h.DEFAULT_HIDDEN_CAPTIONS)}get defaultDuration(){return fe(this.getAttribute(h.DEFAULT_DURATION))}set defaultDuration(t){t==null?this.removeAttribute(h.DEFAULT_DURATION):this.setAttribute(h.DEFAULT_DURATION,`${t}`)}get playerSoftwareName(){var t;return(t=this.getAttribute(E.Attributes.PLAYER_SOFTWARE_NAME))!=null?t:of}get playerSoftwareVersion(){var t;return(t=this.getAttribute(E.Attributes.PLAYER_SOFTWARE_VERSION))!=null?t:nf}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 fe(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 fe(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 assetStartTime(){return fe(this.getAttribute(E.Attributes.ASSET_START_TIME))}set assetStartTime(t){t==null?this.removeAttribute(E.Attributes.ASSET_START_TIME):this.setAttribute(E.Attributes.ASSET_START_TIME,`${t}`)}get assetEndTime(){return fe(this.getAttribute(E.Attributes.ASSET_END_TIME))}set assetEndTime(t){t==null?this.removeAttribute(E.Attributes.ASSET_END_TIME):this.setAttribute(E.Attributes.ASSET_END_TIME,`${t}`)}get extraSourceParams(){return this.hasAttribute(h.EXTRA_SOURCE_PARAMS)?[...new URLSearchParams(this.getAttribute(h.EXTRA_SOURCE_PARAMS)).entries()].reduce((t,[a,r])=>(t[a]=r,t),{}):sf}set extraSourceParams(t){t==null?this.removeAttribute(h.EXTRA_SOURCE_PARAMS):this.setAttribute(h.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=Ut(this,E.Attributes.ENV_KEY))!=null?t:void 0}set envKey(t){this.setAttribute(E.Attributes.ENV_KEY,`${t}`)}get noVolumePref(){return this.hasAttribute(h.NO_VOLUME_PREF)}set noVolumePref(t){t?this.setAttribute(h.NO_VOLUME_PREF,""):this.removeAttribute(h.NO_VOLUME_PREF)}get debug(){return Ut(this,E.Attributes.DEBUG)!=null}set debug(t){t?this.setAttribute(E.Attributes.DEBUG,""):this.removeAttribute(E.Attributes.DEBUG)}get disableTracking(){return Ut(this,E.Attributes.DISABLE_TRACKING)!=null}set disableTracking(t){this.toggleAttribute(E.Attributes.DISABLE_TRACKING,!!t)}get disableCookies(){return Ut(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:S.StreamTypes.UNKNOWN}set streamType(t){this.setAttribute(E.Attributes.STREAM_TYPE,`${t}`)}get defaultStreamType(){var t,a,r;return(r=(a=this.getAttribute(h.DEFAULT_STREAM_TYPE))!=null?a:(t=this.mediaController)==null?void 0:t.getAttribute(h.DEFAULT_STREAM_TYPE))!=null?r:S.StreamTypes.ON_DEMAND}set defaultStreamType(t){t?this.setAttribute(h.DEFAULT_STREAM_TYPE,t):this.removeAttribute(h.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var t,a;return this.hasAttribute(h.TARGET_LIVE_WINDOW)?+this.getAttribute(h.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(h.TARGET_LIVE_WINDOW):this.setAttribute(h.TARGET_LIVE_WINDOW,`${+t}`))}get liveEdgeStart(){var t;return(t=this.media)==null?void 0:t.liveEdgeStart}get startTime(){return fe(Ut(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===S.PlaybackTypes.MSE||t===S.PlaybackTypes.NATIVE)return t}set preferPlayback(t){t!==this.preferPlayback&&(t===S.PlaybackTypes.MSE||t===S.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(j(this,at,Pt).call(this),!this.media){Ee("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...Zm(this),...t}}get _hlsConfig(){var t;return(t=this.media)==null?void 0:t._hlsConfig}set _hlsConfig(t){if(j(this,at,Pt).call(this),!this.media){Ee("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(j(this,at,Pt).call(this),!this.media){Ee("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(j(this,at,Pt).call(this),!this.media){Ee("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(h.PLAYBACK_TOKEN),a=this.getAttribute(h.DRM_TOKEN),r=this.getAttribute(h.THUMBNAIL_TOKEN),n=this.getAttribute(h.STORYBOARD_TOKEN);return{...R(this,br),...t!=null?{playback:t}:{},...a!=null?{drm:a}:{},...r!=null?{thumbnail:r}:{},...n!=null?{storyboard:n}:{}}}set tokens(t){Se(this,br,t!=null?t:{})}get playbackToken(){var t;return(t=this.getAttribute(h.PLAYBACK_TOKEN))!=null?t:void 0}set playbackToken(t){this.setAttribute(h.PLAYBACK_TOKEN,`${t}`)}get drmToken(){var t;return(t=this.getAttribute(h.DRM_TOKEN))!=null?t:void 0}set drmToken(t){this.setAttribute(h.DRM_TOKEN,`${t}`)}get thumbnailToken(){var t;return(t=this.getAttribute(h.THUMBNAIL_TOKEN))!=null?t:void 0}set thumbnailToken(t){this.setAttribute(h.THUMBNAIL_TOKEN,`${t}`)}get storyboardToken(){var t;return(t=this.getAttribute(h.STORYBOARD_TOKEN))!=null?t:void 0}set storyboardToken(t){this.setAttribute(h.STORYBOARD_TOKEN,`${t}`)}addTextTrack(t,a,r,n){var l;let s=(l=this.media)==null?void 0:l.nativeEl;if(s)return(0,S.addTextTrack)(s,t,a,r,n)}removeTextTrack(t){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(a)return(0,S.removeTextTrack)(a,t)}get textTracks(){var t;return(t=this.media)==null?void 0:t.textTracks}get castReceiver(){var t;return(t=this.getAttribute(h.CAST_RECEIVER))!=null?t:void 0}set castReceiver(t){t!==this.castReceiver&&(t?this.setAttribute(h.CAST_RECEIVER,t):this.removeAttribute(h.CAST_RECEIVER))}get castCustomData(){var t;return(t=this.media)==null?void 0:t.castCustomData}set castCustomData(t){if(!this.media){Ee("underlying media element missing when trying to set castCustomData. castCustomData will not be set.");return}this.media.castCustomData=t}get noTooltips(){return this.hasAttribute(h.NO_TOOLTIPS)}set noTooltips(t){if(!t){this.removeAttribute(h.NO_TOOLTIPS);return}this.setAttribute(h.NO_TOOLTIPS,"")}};Er=new WeakMap,br=new WeakMap,Bt=new WeakMap,gr=new WeakMap,pi=new WeakMap,at=new WeakSet,Pt=function(){var t,a,r,n;if(!R(this,Er)){Se(this,Er,!0),j(this,bt,hi).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof Q.HTMLElement))throw""}catch{Ee("<media-theme> failed to upgrade!")}try{if(customElements.upgrade(this.media),!(this.media instanceof E.default))throw""}catch{Ee("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof as))throw""}catch{Ee("<media-controller> failed to upgrade!")}this.init(),j(this,Ro,Xm).call(this),j(this,wo,Jm).call(this),j(this,xo,jm).call(this),Se(this,Bt,(a=(t=this.mediaController)==null?void 0:t.hasAttribute(D.USER_INACTIVE))!=null?a:!0),j(this,Do,eh).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",()=>j(this,bt,hi).call(this)),(n=this.media)==null||n.addEventListener("loadstart",()=>j(this,bt,hi).call(this))}},Lo=new WeakSet,zm=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{}},_r=new WeakSet,od=function(t){Object.assign(R(this,pi),t),j(this,bt,hi).call(this)},bt=new WeakSet,hi=function(t={}){om(sm(Jv(this,{...R(this,pi),...t})),this.shadowRoot)},Ro=new WeakSet,Xm=function(){let t=r=>{var l,u;if(!(r!=null&&r.startsWith("theme-")))return;let n=r.replace(/^theme-/,"");if(nd.includes(n))return;let s=this.getAttribute(r);s!=null?(l=this.mediaTheme)==null||l.setAttribute(n,s):(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)},wo=new WeakSet,Jm=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)){Qe(n),n.data&&Qe(`${n.name} data:`,n.data);return}let{dialog:s,devlog:l}=El(n,!1);l.message&&al(l),Ee(n),n.data&&Ee(`${n.name} data:`,n.data),j(this,_r,od).call(this,{isDialogOpen:!0,dialog:s})};this.addEventListener("error",t),this.media&&(this.media.errorTranslator=(r={})=>{var s,l,u;if(!(((s=this.media)==null?void 0:s.error)instanceof E.MediaError))return r;let{devlog:n}=El((l=this.media)==null?void 0:l.error,!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 s,l;let{detail:n}=r;if(!n){let{message:u,code:c}=(l=(s=this.media)==null?void 0:s.error)!=null?l:{};n=new E.MediaError(u,c)}n!=null&&n.fatal&&this.dispatchEvent(new CustomEvent("error",{detail:n}))})},xo=new WeakSet,jm=function(){var a,r,n,s;let t=()=>j(this,bt,hi).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",t),(s=(n=this.media)==null?void 0:n.textTracks)==null||s.addEventListener("removetrack",t)},Do=new WeakSet,eh=function(){var c,b;if(!/Firefox/i.test(navigator.userAgent))return;let a,r=new WeakMap,n=()=>this.streamType===S.StreamTypes.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,s=(g,v,f=!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(`
2952
- `).length,N=-3;this.streamType===S.StreamTypes.LIVE&&(N=-2);let te=N-T;if(A.line===te&&!f)return;r.has(A)||r.set(A,A.line),A.line=te}else setTimeout(()=>{A.line=r.get(A)||"auto"},500)})},l=()=>{var g,v;s(a,(v=(g=this.mediaController)==null?void 0:g.hasAttribute(D.USER_INACTIVE))!=null?v:!1)},u=()=>{var f,L;let v=Array.from(((L=(f=this.mediaController)==null?void 0:f.media)==null?void 0:L.textTracks)||[]).filter(A=>["subtitles","captions"].includes(A.kind)&&A.mode==="showing")[0];v!==a&&(a==null||a.removeEventListener("cuechange",l)),a=v,a==null||a.addEventListener("cuechange",l),s(a,R(this,Bt))};u(),(c=this.textTracks)==null||c.addEventListener("change",u),(b=this.textTracks)==null||b.addEventListener("addtrack",u),this.addEventListener("userinactivechange",()=>{var v,f;let g=(f=(v=this.mediaController)==null?void 0:v.hasAttribute(D.USER_INACTIVE))!=null?f:!0;R(this,Bt)!==g&&(Se(this,Bt,g),s(a,R(this,Bt)))})};function Ut(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}Q.customElements.get("mux-player")||(Q.customElements.define("mux-player",fr),Q.MuxPlayerElement=fr);var lf=fr;
2874
+ <slot name="icon">${dv}</slot>
2875
+ `;var Mo=class extends ke{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_RENDITION_SELECTED,o.MEDIA_RENDITION_UNAVAILABLE,o.MEDIA_HEIGHT]}constructor(){super({slotTemplate:Qm,tooltipContent:C.RENDITIONS})}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",V.QUALITY())}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:Z(this).querySelector("media-rendition-menu")}get mediaRenditionSelected(){return R(this,o.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){I(this,o.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return M(this,o.MEDIA_HEIGHT)}set mediaHeight(e){D(this,o.MEDIA_HEIGHT,e)}};d.customElements.get("media-rendition-menu-button")||d.customElements.define("media-rendition-menu-button",Mo);var od=vi.createElement("template");"innerHTML"in od&&(od.innerHTML=hm);var zm,Xm,Ro=class extends si{};Ro.template=(Xm=(zm=od.content)==null?void 0:zm.children)==null?void 0:Xm[0];pe.customElements.get("media-theme-gerwig")||pe.customElements.define("media-theme-gerwig",Ro);var uv="gerwig";var ft={SRC:"src",POSTER:"poster"},m={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",DRM_TOKEN:"drm-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",CAST_RECEIVER:"cast-receiver",NO_TOOLTIPS:"no-tooltips"},sd=["audio","backwardseekoffset","defaultduration","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","novolumepref"];function cv(t,e){var a;return{src:!t.playbackId&&t.src,playbackId:t.playbackId,hasSrc:!!t.playbackId||!!t.src||!!t.currentSrc,poster:t.poster,storyboard:t.storyboard,storyboardSrc:t.getAttribute(m.STORYBOARD_SRC),placeholder:t.getAttribute("placeholder"),themeTemplate:hv(t),thumbnailTime:!t.tokens.thumbnail&&t.thumbnailTime,autoplay:t.autoplay,crossOrigin:t.crossOrigin,loop:t.loop,noHotKeys:t.hasAttribute(m.NOHOTKEYS),hotKeys:t.getAttribute(m.HOTKEYS),muted:t.muted,paused:t.paused,preload:t.preload,envKey:t.envKey,preferCmcd:t.preferCmcd,debug:t.debug,disableTracking:t.disableTracking,disableCookies:t.disableCookies,tokens:t.tokens,beaconCollectionDomain:t.beaconCollectionDomain,maxResolution:t.maxResolution,minResolution:t.minResolution,programStartTime:t.programStartTime,programEndTime:t.programEndTime,assetStartTime:t.assetStartTime,assetEndTime:t.assetEndTime,renditionOrder:t.renditionOrder,metadata:t.metadata,playerInitTime:t.playerInitTime,playerSoftwareName:t.playerSoftwareName,playerSoftwareVersion:t.playerSoftwareVersion,startTime:t.startTime,preferPlayback:t.preferPlayback,audio:t.audio,defaultStreamType:t.defaultStreamType,targetLiveWindow:t.getAttribute(E.Attributes.TARGET_LIVE_WINDOW),streamType:Ba(t.getAttribute(E.Attributes.STREAM_TYPE)),primaryColor:t.getAttribute(m.PRIMARY_COLOR),secondaryColor:t.getAttribute(m.SECONDARY_COLOR),accentColor:t.getAttribute(m.ACCENT_COLOR),forwardSeekOffset:t.forwardSeekOffset,backwardSeekOffset:t.backwardSeekOffset,defaultHiddenCaptions:t.defaultHiddenCaptions,defaultDuration:t.defaultDuration,defaultShowRemainingTime:t.defaultShowRemainingTime,hideDuration:pv(t),playbackRates:t.getAttribute(m.PLAYBACK_RATES),customDomain:(a=t.getAttribute(E.Attributes.CUSTOM_DOMAIN))!=null?a:void 0,title:t.getAttribute(m.TITLE),novolumepref:t.hasAttribute(m.NO_VOLUME_PREF),castReceiver:t.castReceiver,...e,extraSourceParams:t.extraSourceParams}}var mv=mn.formatErrorMessage;mn.formatErrorMessage=t=>{var e,i;if(t instanceof E.MediaError){let a=mm(t,!1);return`
2876
+ ${a!=null&&a.title?`<h3>${a.title}</h3>`:""}
2877
+ ${a!=null&&a.message||a!=null&&a.linkUrl?`<p>
2878
+ ${a==null?void 0:a.message}
2879
+ ${a!=null&&a.linkUrl?`<a
2880
+ href="${a.linkUrl}"
2881
+ target="_blank"
2882
+ rel="external noopener"
2883
+ aria-label="${(e=a.linkText)!=null?e:""} ${(0,y.i18n)("(opens in a new window)")}"
2884
+ >${(i=a.linkText)!=null?i:a.linkUrl}</a
2885
+ >`:""}
2886
+ </p>`:""}
2887
+ `}return mv(t)};function hv(t){var i,a;let e=t.theme;if(e){let r=(a=(i=t.getRootNode())==null?void 0:i.getElementById)==null?void 0:a.call(i,e);if(r&&r instanceof HTMLTemplateElement)return r;e.startsWith("media-theme-")||(e=`media-theme-${e}`);let n=pe.customElements.get(e);if(n!=null&&n.template)return n.template}}function pv(t){var i;let e=(i=t.mediaController)==null?void 0:i.querySelector("media-time-display");return e&&getComputedStyle(e).getPropertyValue("--media-duration-display-display").trim()==="none"}function Jm(t){let e=t.hasAttribute(m.TITLE)?{video_title:t.getAttribute(m.TITLE)}:{};return t.getAttributeNames().filter(i=>i.startsWith("metadata-")).reduce((i,a)=>{let r=t.getAttribute(a);return r!==null&&(i[a.replace(/^metadata-/,"").replace(/-/g,"_")]=r),i},e)}var fv=Object.values(E.Attributes),vv=Object.values(ft),Ev=Object.values(m),ld=Bn(),dd="mux-player",jm={isDialogOpen:!1},bv={redundant_streams:!0},hr,pr,fr,Nt,vr,mi,it,Dt,wo,eh,Er,ud,vt,ci,Lo,th,xo,ih,Do,ah,Oo,rh,mr=class extends ll{constructor(){super();X(this,it);X(this,wo);X(this,Er);X(this,vt);X(this,Lo);X(this,xo);X(this,Do);X(this,Oo);X(this,hr,void 0);X(this,pr,!1);X(this,fr,{});X(this,Nt,!0);X(this,vr,new Un(this,"hotkeys"));X(this,mi,{...jm,onCloseErrorDialog:i=>{var r;((r=i.composedPath()[0])==null?void 0:r.localName)==="media-error-dialog"&&J(this,Er,ud).call(this,{isDialogOpen:!1})},onFocusInErrorDialog:i=>{var n;if(((n=i.composedPath()[0])==null?void 0:n.localName)!=="media-error-dialog")return;nl(this,vi.activeElement)||i.preventDefault()}});Ae(this,hr,(0,y.generatePlayerInitTime)()),this.attachShadow({mode:"open"}),J(this,wo,eh).call(this),this.isConnected&&J(this,it,Dt).call(this)}static get NAME(){return dd}static get VERSION(){return ld}static get observedAttributes(){var i;return[...(i=ll.observedAttributes)!=null?i:[],...vv,...fv,...Ev]}get mediaTheme(){var i;return(i=this.shadowRoot)==null?void 0:i.querySelector("media-theme")}get mediaController(){var i,a;return(a=(i=this.mediaTheme)==null?void 0:i.shadowRoot)==null?void 0:a.querySelector("media-controller")}connectedCallback(){var a;let i=(a=this.shadowRoot)==null?void 0:a.querySelector("mux-video");i&&(i.metadata=Jm(this))}attributeChangedCallback(i,a,r){switch(J(this,it,Dt).call(this),super.attributeChangedCallback(i,a,r),i){case m.HOTKEYS:P(this,vr).value=r;break;case m.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&Ze((0,y.i18n)("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time."));break}case m.THUMBNAIL_TOKEN:{if(r){let s=(0,y.parseJwt)(r);if(s){let{aud:l}=s,u=y.MuxJWTAud.THUMBNAIL;l!==u&&Ze((0,y.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:l,expectedAud:u,tokenNamePrefix:"thumbnail"}))}}break}case m.STORYBOARD_TOKEN:{if(r){let s=(0,y.parseJwt)(r);if(s){let{aud:l}=s,u=y.MuxJWTAud.STORYBOARD;l!==u&&Ze((0,y.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:l,expectedAud:u,tokenNamePrefix:"storyboard"}))}}break}case m.DRM_TOKEN:{if(r){let s=(0,y.parseJwt)(r);if(s){let{aud:l}=s,u=y.MuxJWTAud.DRM;l!==u&&Ze((0,y.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:l,expectedAud:u,tokenNamePrefix:"drm"}))}}break}case E.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&Ee((0,y.i18n)("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&&![y.StreamTypes.LIVE,y.StreamTypes.ON_DEMAND,y.StreamTypes.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:ol({file:"invalid-stream-type.md",message:(0,y.i18n)("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):r===y.StreamTypes.LIVE?this.getAttribute(m.TARGET_LIVE_WINDOW)==null&&(this.targetLiveWindow=0):this.targetLiveWindow=Number.NaN}[E.Attributes.PLAYBACK_ID,ft.SRC,m.PLAYBACK_TOKEN].includes(i)&&a!==r&&Ae(this,mi,{...P(this,mi),...jm}),J(this,vt,ci).call(this,{[Fc(i)]:r})}get preferCmcd(){var i;return(i=this.getAttribute(E.Attributes.PREFER_CMCD))!=null?i:void 0}set preferCmcd(i){i!==this.preferCmcd&&(i?y.CmcdTypeValues.includes(i)?this.setAttribute(E.Attributes.PREFER_CMCD,i):Ze(`Invalid value for preferCmcd. Must be one of ${y.CmcdTypeValues.join()}`):this.removeAttribute(E.Attributes.PREFER_CMCD))}get hasPlayed(){var i,a;return(a=(i=this.mediaController)==null?void 0:i.hasAttribute(o.MEDIA_HAS_PLAYED))!=null?a:!1}get inLiveWindow(){var i;return(i=this.mediaController)==null?void 0:i.hasAttribute(o.MEDIA_TIME_IS_LIVE)}get _hls(){var i;return(i=this.media)==null?void 0:i._hls}get mux(){var i;return(i=this.media)==null?void 0:i.mux}get theme(){var i;return(i=this.getAttribute(m.THEME))!=null?i:uv}set theme(i){this.setAttribute(m.THEME,`${i}`)}get themeProps(){let i=this.mediaTheme;if(!i)return;let a={};for(let r of i.getAttributeNames()){if(sd.includes(r))continue;let n=i.getAttribute(r);a[Pn(r)]=n===""?!0:n}return a}set themeProps(i){var r,n;J(this,it,Dt).call(this);let a={...this.themeProps,...i};for(let s in a){if(sd.includes(s))continue;let l=i==null?void 0:i[s];typeof l=="boolean"||l==null?(r=this.mediaTheme)==null||r.toggleAttribute(Nn(s),!!l):(n=this.mediaTheme)==null||n.setAttribute(Nn(s),l)}}get playbackId(){var i;return(i=this.getAttribute(E.Attributes.PLAYBACK_ID))!=null?i:void 0}set playbackId(i){i?this.setAttribute(E.Attributes.PLAYBACK_ID,i):this.removeAttribute(E.Attributes.PLAYBACK_ID)}get src(){var i,a;return this.playbackId?(i=Ot(this,ft.SRC))!=null?i:void 0:(a=this.getAttribute(ft.SRC))!=null?a:void 0}set src(i){i?this.setAttribute(ft.SRC,i):this.removeAttribute(ft.SRC)}get poster(){var r;let i=this.getAttribute(ft.POSTER);if(i!=null)return i;let{tokens:a}=this;if(a.playback&&!a.thumbnail){Ze("Missing expected thumbnail token. No poster image will be shown");return}if(this.playbackId&&!this.audio)return $c(this.playbackId,{customDomain:this.customDomain,thumbnailTime:(r=this.thumbnailTime)!=null?r:this.startTime,programTime:this.programStartTime,token:a.thumbnail})}set poster(i){i||i===""?this.setAttribute(ft.POSTER,i):this.removeAttribute(ft.POSTER)}get storyboardSrc(){var i;return(i=this.getAttribute(m.STORYBOARD_SRC))!=null?i:void 0}set storyboardSrc(i){i?this.setAttribute(m.STORYBOARD_SRC,i):this.removeAttribute(m.STORYBOARD_SRC)}get storyboard(){let{tokens:i}=this;if(this.storyboardSrc&&!i.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[y.StreamTypes.LIVE,y.StreamTypes.UNKNOWN].includes(this.streamType)||i.playback&&!i.storyboard))return Wc(this.playbackId,{customDomain:this.customDomain,token:i.storyboard,programStartTime:this.programStartTime,programEndTime:this.programEndTime})}get audio(){return this.hasAttribute(m.AUDIO)}set audio(i){if(!i){this.removeAttribute(m.AUDIO);return}this.setAttribute(m.AUDIO,"")}get hotkeys(){return P(this,vr)}get nohotkeys(){return this.hasAttribute(m.NOHOTKEYS)}set nohotkeys(i){if(!i){this.removeAttribute(m.NOHOTKEYS);return}this.setAttribute(m.NOHOTKEYS,"")}get thumbnailTime(){return ce(this.getAttribute(m.THUMBNAIL_TIME))}set thumbnailTime(i){this.setAttribute(m.THUMBNAIL_TIME,`${i}`)}get title(){var i;return(i=this.getAttribute(m.TITLE))!=null?i:""}set title(i){i!==this.title&&(i?this.setAttribute(m.TITLE,i):this.removeAttribute("title"),super.title=i)}get placeholder(){var i;return(i=Ot(this,m.PLACEHOLDER))!=null?i:""}set placeholder(i){this.setAttribute(m.PLACEHOLDER,`${i}`)}get primaryColor(){var a,r;let i=this.getAttribute(m.PRIMARY_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=pe.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),i))return i}set primaryColor(i){this.setAttribute(m.PRIMARY_COLOR,`${i}`)}get secondaryColor(){var a,r;let i=this.getAttribute(m.SECONDARY_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=pe.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),i))return i}set secondaryColor(i){this.setAttribute(m.SECONDARY_COLOR,`${i}`)}get accentColor(){var a,r;let i=this.getAttribute(m.ACCENT_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=pe.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_accent-color"))==null?void 0:r.trim(),i))return i}set accentColor(i){this.setAttribute(m.ACCENT_COLOR,`${i}`)}get defaultShowRemainingTime(){return this.hasAttribute(m.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(i){i?this.setAttribute(m.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(m.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(this.hasAttribute(m.PLAYBACK_RATES))return this.getAttribute(m.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(i=>Number(i)).filter(i=>!Number.isNaN(i)).sort((i,a)=>i-a)}set playbackRates(i){if(!i){this.removeAttribute(m.PLAYBACK_RATES);return}this.setAttribute(m.PLAYBACK_RATES,i.join(" "))}get forwardSeekOffset(){var i;return(i=ce(this.getAttribute(m.FORWARD_SEEK_OFFSET)))!=null?i:10}set forwardSeekOffset(i){this.setAttribute(m.FORWARD_SEEK_OFFSET,`${i}`)}get backwardSeekOffset(){var i;return(i=ce(this.getAttribute(m.BACKWARD_SEEK_OFFSET)))!=null?i:10}set backwardSeekOffset(i){this.setAttribute(m.BACKWARD_SEEK_OFFSET,`${i}`)}get defaultHiddenCaptions(){return this.hasAttribute(m.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(i){i?this.setAttribute(m.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(m.DEFAULT_HIDDEN_CAPTIONS)}get defaultDuration(){return ce(this.getAttribute(m.DEFAULT_DURATION))}set defaultDuration(i){i==null?this.removeAttribute(m.DEFAULT_DURATION):this.setAttribute(m.DEFAULT_DURATION,`${i}`)}get playerInitTime(){return this.hasAttribute(E.Attributes.PLAYER_INIT_TIME)?ce(this.getAttribute(E.Attributes.PLAYER_INIT_TIME)):P(this,hr)}set playerInitTime(i){i!=this.playerInitTime&&(i==null?this.removeAttribute(E.Attributes.PLAYER_INIT_TIME):this.setAttribute(E.Attributes.PLAYER_INIT_TIME,`${+i}`))}get playerSoftwareName(){var i;return(i=this.getAttribute(E.Attributes.PLAYER_SOFTWARE_NAME))!=null?i:dd}get playerSoftwareVersion(){var i;return(i=this.getAttribute(E.Attributes.PLAYER_SOFTWARE_VERSION))!=null?i:ld}get beaconCollectionDomain(){var i;return(i=this.getAttribute(E.Attributes.BEACON_COLLECTION_DOMAIN))!=null?i:void 0}set beaconCollectionDomain(i){i!==this.beaconCollectionDomain&&(i?this.setAttribute(E.Attributes.BEACON_COLLECTION_DOMAIN,i):this.removeAttribute(E.Attributes.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var i;return(i=this.getAttribute(E.Attributes.MAX_RESOLUTION))!=null?i:void 0}set maxResolution(i){i!==this.maxResolution&&(i?this.setAttribute(E.Attributes.MAX_RESOLUTION,i):this.removeAttribute(E.Attributes.MAX_RESOLUTION))}get minResolution(){var i;return(i=this.getAttribute(E.Attributes.MIN_RESOLUTION))!=null?i:void 0}set minResolution(i){i!==this.minResolution&&(i?this.setAttribute(E.Attributes.MIN_RESOLUTION,i):this.removeAttribute(E.Attributes.MIN_RESOLUTION))}get renditionOrder(){var i;return(i=this.getAttribute(E.Attributes.RENDITION_ORDER))!=null?i:void 0}set renditionOrder(i){i!==this.renditionOrder&&(i?this.setAttribute(E.Attributes.RENDITION_ORDER,i):this.removeAttribute(E.Attributes.RENDITION_ORDER))}get programStartTime(){return ce(this.getAttribute(E.Attributes.PROGRAM_START_TIME))}set programStartTime(i){i==null?this.removeAttribute(E.Attributes.PROGRAM_START_TIME):this.setAttribute(E.Attributes.PROGRAM_START_TIME,`${i}`)}get programEndTime(){return ce(this.getAttribute(E.Attributes.PROGRAM_END_TIME))}set programEndTime(i){i==null?this.removeAttribute(E.Attributes.PROGRAM_END_TIME):this.setAttribute(E.Attributes.PROGRAM_END_TIME,`${i}`)}get assetStartTime(){return ce(this.getAttribute(E.Attributes.ASSET_START_TIME))}set assetStartTime(i){i==null?this.removeAttribute(E.Attributes.ASSET_START_TIME):this.setAttribute(E.Attributes.ASSET_START_TIME,`${i}`)}get assetEndTime(){return ce(this.getAttribute(E.Attributes.ASSET_END_TIME))}set assetEndTime(i){i==null?this.removeAttribute(E.Attributes.ASSET_END_TIME):this.setAttribute(E.Attributes.ASSET_END_TIME,`${i}`)}get extraSourceParams(){return this.hasAttribute(m.EXTRA_SOURCE_PARAMS)?[...new URLSearchParams(this.getAttribute(m.EXTRA_SOURCE_PARAMS)).entries()].reduce((i,[a,r])=>(i[a]=r,i),{}):bv}set extraSourceParams(i){i==null?this.removeAttribute(m.EXTRA_SOURCE_PARAMS):this.setAttribute(m.EXTRA_SOURCE_PARAMS,new URLSearchParams(i).toString())}get customDomain(){var i;return(i=this.getAttribute(E.Attributes.CUSTOM_DOMAIN))!=null?i:void 0}set customDomain(i){i!==this.customDomain&&(i?this.setAttribute(E.Attributes.CUSTOM_DOMAIN,i):this.removeAttribute(E.Attributes.CUSTOM_DOMAIN))}get envKey(){var i;return(i=Ot(this,E.Attributes.ENV_KEY))!=null?i:void 0}set envKey(i){this.setAttribute(E.Attributes.ENV_KEY,`${i}`)}get noVolumePref(){return this.hasAttribute(m.NO_VOLUME_PREF)}set noVolumePref(i){i?this.setAttribute(m.NO_VOLUME_PREF,""):this.removeAttribute(m.NO_VOLUME_PREF)}get debug(){return Ot(this,E.Attributes.DEBUG)!=null}set debug(i){i?this.setAttribute(E.Attributes.DEBUG,""):this.removeAttribute(E.Attributes.DEBUG)}get disableTracking(){return Ot(this,E.Attributes.DISABLE_TRACKING)!=null}set disableTracking(i){this.toggleAttribute(E.Attributes.DISABLE_TRACKING,!!i)}get disableCookies(){return Ot(this,E.Attributes.DISABLE_COOKIES)!=null}set disableCookies(i){i?this.setAttribute(E.Attributes.DISABLE_COOKIES,""):this.removeAttribute(E.Attributes.DISABLE_COOKIES)}get streamType(){var i,a,r;return(r=(a=this.getAttribute(E.Attributes.STREAM_TYPE))!=null?a:(i=this.media)==null?void 0:i.streamType)!=null?r:y.StreamTypes.UNKNOWN}set streamType(i){this.setAttribute(E.Attributes.STREAM_TYPE,`${i}`)}get defaultStreamType(){var i,a,r;return(r=(a=this.getAttribute(m.DEFAULT_STREAM_TYPE))!=null?a:(i=this.mediaController)==null?void 0:i.getAttribute(m.DEFAULT_STREAM_TYPE))!=null?r:y.StreamTypes.ON_DEMAND}set defaultStreamType(i){i?this.setAttribute(m.DEFAULT_STREAM_TYPE,i):this.removeAttribute(m.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var i,a;return this.hasAttribute(m.TARGET_LIVE_WINDOW)?+this.getAttribute(m.TARGET_LIVE_WINDOW):(a=(i=this.media)==null?void 0:i.targetLiveWindow)!=null?a:Number.NaN}set targetLiveWindow(i){i==this.targetLiveWindow||Number.isNaN(i)&&Number.isNaN(this.targetLiveWindow)||(i==null?this.removeAttribute(m.TARGET_LIVE_WINDOW):this.setAttribute(m.TARGET_LIVE_WINDOW,`${+i}`))}get liveEdgeStart(){var i;return(i=this.media)==null?void 0:i.liveEdgeStart}get startTime(){return ce(Ot(this,E.Attributes.START_TIME))}set startTime(i){this.setAttribute(E.Attributes.START_TIME,`${i}`)}get preferPlayback(){let i=this.getAttribute(E.Attributes.PREFER_PLAYBACK);if(i===y.PlaybackTypes.MSE||i===y.PlaybackTypes.NATIVE)return i}set preferPlayback(i){i!==this.preferPlayback&&(i===y.PlaybackTypes.MSE||i===y.PlaybackTypes.NATIVE?this.setAttribute(E.Attributes.PREFER_PLAYBACK,i):this.removeAttribute(E.Attributes.PREFER_PLAYBACK))}get metadata(){var i;return(i=this.media)==null?void 0:i.metadata}set metadata(i){if(J(this,it,Dt).call(this),!this.media){Ee("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...Jm(this),...i}}get _hlsConfig(){var i;return(i=this.media)==null?void 0:i._hlsConfig}set _hlsConfig(i){if(J(this,it,Dt).call(this),!this.media){Ee("underlying media element missing when trying to set _hlsConfig. _hlsConfig will not be set.");return}this.media._hlsConfig=i}async addCuePoints(i){var a;if(J(this,it,Dt).call(this),!this.media){Ee("underlying media element missing when trying to addCuePoints. cuePoints will not be added.");return}return(a=this.media)==null?void 0:a.addCuePoints(i)}get activeCuePoint(){var i;return(i=this.media)==null?void 0:i.activeCuePoint}get cuePoints(){var i,a;return(a=(i=this.media)==null?void 0:i.cuePoints)!=null?a:[]}addChapters(i){var a;if(J(this,it,Dt).call(this),!this.media){Ee("underlying media element missing when trying to addChapters. chapters will not be added.");return}return(a=this.media)==null?void 0:a.addChapters(i)}get activeChapter(){var i;return(i=this.media)==null?void 0:i.activeChapter}get chapters(){var i,a;return(a=(i=this.media)==null?void 0:i.chapters)!=null?a:[]}getStartDate(){var i;return(i=this.media)==null?void 0:i.getStartDate()}get currentPdt(){var i;return(i=this.media)==null?void 0:i.currentPdt}get tokens(){let i=this.getAttribute(m.PLAYBACK_TOKEN),a=this.getAttribute(m.DRM_TOKEN),r=this.getAttribute(m.THUMBNAIL_TOKEN),n=this.getAttribute(m.STORYBOARD_TOKEN);return{...P(this,fr),...i!=null?{playback:i}:{},...a!=null?{drm:a}:{},...r!=null?{thumbnail:r}:{},...n!=null?{storyboard:n}:{}}}set tokens(i){Ae(this,fr,i!=null?i:{})}get playbackToken(){var i;return(i=this.getAttribute(m.PLAYBACK_TOKEN))!=null?i:void 0}set playbackToken(i){this.setAttribute(m.PLAYBACK_TOKEN,`${i}`)}get drmToken(){var i;return(i=this.getAttribute(m.DRM_TOKEN))!=null?i:void 0}set drmToken(i){this.setAttribute(m.DRM_TOKEN,`${i}`)}get thumbnailToken(){var i;return(i=this.getAttribute(m.THUMBNAIL_TOKEN))!=null?i:void 0}set thumbnailToken(i){this.setAttribute(m.THUMBNAIL_TOKEN,`${i}`)}get storyboardToken(){var i;return(i=this.getAttribute(m.STORYBOARD_TOKEN))!=null?i:void 0}set storyboardToken(i){this.setAttribute(m.STORYBOARD_TOKEN,`${i}`)}addTextTrack(i,a,r,n){var l;let s=(l=this.media)==null?void 0:l.nativeEl;if(s)return(0,y.addTextTrack)(s,i,a,r,n)}removeTextTrack(i){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(a)return(0,y.removeTextTrack)(a,i)}get textTracks(){var i;return(i=this.media)==null?void 0:i.textTracks}get castReceiver(){var i;return(i=this.getAttribute(m.CAST_RECEIVER))!=null?i:void 0}set castReceiver(i){i!==this.castReceiver&&(i?this.setAttribute(m.CAST_RECEIVER,i):this.removeAttribute(m.CAST_RECEIVER))}get castCustomData(){var i;return(i=this.media)==null?void 0:i.castCustomData}set castCustomData(i){if(!this.media){Ee("underlying media element missing when trying to set castCustomData. castCustomData will not be set.");return}this.media.castCustomData=i}get noTooltips(){return this.hasAttribute(m.NO_TOOLTIPS)}set noTooltips(i){if(!i){this.removeAttribute(m.NO_TOOLTIPS);return}this.setAttribute(m.NO_TOOLTIPS,"")}};hr=new WeakMap,pr=new WeakMap,fr=new WeakMap,Nt=new WeakMap,vr=new WeakMap,mi=new WeakMap,it=new WeakSet,Dt=function(){var i,a,r,n;if(!P(this,pr)){Ae(this,pr,!0),J(this,vt,ci).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof pe.HTMLElement))throw""}catch{Ee("<media-theme> failed to upgrade!")}try{if(customElements.upgrade(this.media),!(this.media instanceof E.default))throw""}catch{Ee("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof ns))throw""}catch{Ee("<media-controller> failed to upgrade!")}this.init(),J(this,Lo,th).call(this),J(this,xo,ih).call(this),J(this,Do,ah).call(this),Ae(this,Nt,(a=(i=this.mediaController)==null?void 0:i.hasAttribute(x.USER_INACTIVE))!=null?a:!0),J(this,Oo,rh).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",()=>J(this,vt,ci).call(this)),(n=this.media)==null||n.addEventListener("loadstart",()=>J(this,vt,ci).call(this))}},wo=new WeakSet,eh=function(){var i,a;try{(i=window==null?void 0:window.CSS)==null||i.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{}},Er=new WeakSet,ud=function(i){Object.assign(P(this,mi),i),J(this,vt,ci).call(this)},vt=new WeakSet,ci=function(i={}){dm(um(cv(this,{...P(this,mi),...i})),this.shadowRoot)},Lo=new WeakSet,th=function(){let i=r=>{var l,u;if(!(r!=null&&r.startsWith("theme-")))return;let n=r.replace(/^theme-/,"");if(sd.includes(n))return;let s=this.getAttribute(r);s!=null?(l=this.mediaTheme)==null||l.setAttribute(n,s):(u=this.mediaTheme)==null||u.removeAttribute(n)};new MutationObserver(r=>{for(let{attributeName:n}of r)i(n)}).observe(this,{attributes:!0}),this.getAttributeNames().forEach(i)},xo=new WeakSet,ih=function(){var a;let i=r=>{let{detail:n}=r;if(n instanceof E.MediaError||(n=new E.MediaError(n.message,n.code,n.fatal)),!(n!=null&&n.fatal)){Ze(n),n.data&&Ze(`${n.name} data:`,n.data);return}let s=gl(n,!1);s.message&&ol(s),Ee(n),n.data&&Ee(`${n.name} data:`,n.data),J(this,Er,ud).call(this,{isDialogOpen:!0})};this.addEventListener("error",i),this.media&&(this.media.errorTranslator=(r={})=>{var s,l,u;if(!(((s=this.media)==null?void 0:s.error)instanceof E.MediaError))return r;let n=gl((l=this.media)==null?void 0:l.error,!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 s,l;let{detail:n}=r;if(!n){let{message:u,code:c}=(l=(s=this.media)==null?void 0:s.error)!=null?l:{};n=new E.MediaError(u,c)}n!=null&&n.fatal&&this.dispatchEvent(new CustomEvent("error",{detail:n}))})},Do=new WeakSet,ah=function(){var a,r,n,s;let i=()=>J(this,vt,ci).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",i),(s=(n=this.media)==null?void 0:n.textTracks)==null||s.addEventListener("removetrack",i)},Oo=new WeakSet,rh=function(){var c,b;if(!/Firefox/i.test(navigator.userAgent))return;let a,r=new WeakMap,n=()=>this.streamType===y.StreamTypes.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,s=(g,f,v=!1)=>{if(n())return;Array.from(g&&g.activeCues||[]).forEach(A=>{if(!(!A.snapToLines||A.line<-5||A.line>=0&&A.line<10))if(!f||this.paused){let T=A.text.split(`
2888
+ `).length,N=-3;this.streamType===y.StreamTypes.LIVE&&(N=-2);let ee=N-T;if(A.line===ee&&!v)return;r.has(A)||r.set(A,A.line),A.line=ee}else setTimeout(()=>{A.line=r.get(A)||"auto"},500)})},l=()=>{var g,f;s(a,(f=(g=this.mediaController)==null?void 0:g.hasAttribute(x.USER_INACTIVE))!=null?f:!1)},u=()=>{var v,L;let f=Array.from(((L=(v=this.mediaController)==null?void 0:v.media)==null?void 0:L.textTracks)||[]).filter(A=>["subtitles","captions"].includes(A.kind)&&A.mode==="showing")[0];f!==a&&(a==null||a.removeEventListener("cuechange",l)),a=f,a==null||a.addEventListener("cuechange",l),s(a,P(this,Nt))};u(),(c=this.textTracks)==null||c.addEventListener("change",u),(b=this.textTracks)==null||b.addEventListener("addtrack",u),this.addEventListener("userinactivechange",()=>{var f,v;let g=(v=(f=this.mediaController)==null?void 0:f.hasAttribute(x.USER_INACTIVE))!=null?v:!0;P(this,Nt)!==g&&(Ae(this,Nt,g),s(a,P(this,Nt)))})};function Ot(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}pe.customElements.get("mux-player")||(pe.customElements.define("mux-player",mr),pe.MuxPlayerElement=mr);var gv=mr;