/**
 * Bundled by jsDelivr using Rollup v2.79.2 and Terser v5.39.0.
 * Original file: /npm/media-chrome@4.16.1/dist/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
const e={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_LOOP_REQUEST:"medialooprequest",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"},t={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},i={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_LOOP:"mediaLoop",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_LANG:"mediaLang",MEDIA_WIDTH:"mediaWidth"},n=Object.entries(i),a=n.reduce(((e,[t,i])=>(e[t]=i.toLowerCase(),e)),{}),s=n.reduce(((e,[t,i])=>(e[t]=i.toLowerCase(),e)),{USER_INACTIVE_CHANGE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"}),o=Object.entries(s).reduce(((e,[t,i])=>{const n=a[t];return n&&(e[i]=n),e}),{userinactivechange:"userinactive"}),r=Object.entries(a).reduce(((e,[t,i])=>{const n=s[t];return n&&(e[i]=n),e}),{userinactive:"userinactivechange"}),l={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},d={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"},c={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},u={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},h={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"},m={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};var p=Object.freeze({__proto__:null,AttributeToStateChangeEventMap:r,AvailabilityStates:u,MediaStateChangeEvents:s,MediaStateReceiverAttributes:t,MediaUIAttributes:a,MediaUIEvents:e,MediaUIProps:i,PointerTypes:c,ReadyStates:{HAVE_NOTHING:0,HAVE_METADATA:1,HAVE_CURRENT_DATA:2,HAVE_FUTURE_DATA:3,HAVE_ENOUGH_DATA:4},StateChangeEventToAttributeMap:o,StreamTypes:h,TextTrackKinds:l,TextTrackModes:d,VolumeLevels:{HIGH:"high",MEDIUM:"medium",LOW:"low",OFF:"off"},WebkitPresentationModes:m});function E(e){if(e){const{id:t,width:i,height:n}=e;return[t,i,n].filter((e=>null!=e)).join(":")}}function v(e){if(e){const{id:t,kind:i,language:n,label:a}=e;return[t,i,n,a].filter((e=>null!=e)).join(":")}}function b(e){return"number"==typeof e&&!Number.isNaN(e)&&Number.isFinite(e)}const g=e=>new Promise((t=>setTimeout(t,e))),A=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],f=e=>{if(!b(e))return"";const t=Math.abs(e),i=t!==e,n=new Date(0,0,0,0,0,t,0);return`${[n.getHours(),n.getMinutes(),n.getSeconds()].map(((e,t)=>e&&((e,t)=>`${e} ${1===e?A[t].singular:A[t].plural}`)(e,t))).filter((e=>e)).join(", ")}${i?" remaining":""}`};function I(e,t){let i=!1;e<0&&(i=!0,e=0-e),e=e<0?0:e;let n=Math.floor(e%60),a=Math.floor(e/60%60),s=Math.floor(e/3600);const o=Math.floor(t/60%60),r=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(s=a=n="0"),s=s>0||r>0?s+":":"",a=((s||o>=10)&&a<10?"0"+a:a)+":",n=n<10?"0"+n:n,(i?"-":"")+s+a+n}const w=Object.freeze({length:0,start(e){const t=e>>>0;if(t>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${t}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(e){const t=e>>>0;if(t>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${t}) is greater than or equal to the maximum bound (${this.length}).`);return 0}});var y=Object.freeze({__proto__:null,emptyTimeRanges:w,formatAsTimePhrase:f,formatTime:I,serializeTimeRanges:function(e=w){return Array.from(e).map(((t,i)=>[Number(e.start(i).toFixed(3)),Number(e.end(i).toFixed(3))].join(":"))).join(" ")}});var _;const T={en:{"Start airplay":"Start airplay","Stop airplay":"Stop airplay",Audio:"Audio",Captions:"Captions","Enable captions":"Enable captions","Disable captions":"Disable captions","Start casting":"Start casting","Stop casting":"Stop casting","Enter fullscreen mode":"Enter fullscreen mode","Exit fullscreen mode":"Exit fullscreen mode",Mute:"Mute",Unmute:"Unmute",Loop:"Loop","Enter picture in picture mode":"Enter picture in picture mode","Exit picture in picture mode":"Exit picture in picture mode",Play:"Play",Pause:"Pause","Playback rate":"Playback rate","Playback rate {playbackRate}":"Playback rate {playbackRate}",Quality:"Quality","Seek backward":"Seek backward","Seek forward":"Seek forward",Settings:"Settings",Auto:"Auto","audio player":"audio player","video player":"video player",volume:"volume",seek:"seek","closed captions":"closed captions","current playback rate":"current playback rate","playback time":"playback time","media loading":"media loading",settings:"settings","audio tracks":"audio tracks",quality:"quality",play:"play",pause:"pause",mute:"mute",unmute:"unmute","chapter: {chapterName}":"chapter: {chapterName}",live:"live",Off:"Off","start airplay":"start airplay","stop airplay":"stop airplay","start casting":"start casting","stop casting":"stop casting","enter fullscreen mode":"enter fullscreen mode","exit fullscreen mode":"exit fullscreen mode","enter picture in picture mode":"enter picture in picture mode","exit picture in picture mode":"exit picture in picture mode","seek to live":"seek to live","playing live":"playing live","seek back {seekOffset} seconds":"seek back {seekOffset} seconds","seek forward {seekOffset} seconds":"seek forward {seekOffset} seconds","Network Error":"Network Error","Decode Error":"Decode Error","Source Not Supported":"Source Not Supported","Encryption Error":"Encryption Error","A network error caused the media download to fail.":"A network error caused the media download to fail.","A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.":"A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.","An unsupported error occurred. The server or network failed, or your browser does not support this format.":"An unsupported error occurred. The server or network failed, or your browser does not support this format.","The media is encrypted and there are no keys to decrypt it.":"The media is encrypted and there are no keys to decrypt it."}};let k=(null==(_=globalThis.navigator)?void 0:_.language)||"en";const M=(e,t={})=>(e=>{var t,i,n;const[a]=k.split("-");return(null==(t=T[k])?void 0:t[e])||(null==(i=T[a])?void 0:i[e])||(null==(n=T.en)?void 0:n[e])||e})(e).replace(/\{(\w+)\}/g,((e,i)=>i in t?String(t[i]):`{${i}}`));class S{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}}class L extends S{}class R extends L{constructor(){super(...arguments),this.role=null}}const D={createElement:function(){return new C.HTMLElement},createElementNS:function(){return new C.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent:e=>!1},C={ResizeObserver:class{observe(){}unobserve(){}disconnect(){}},document:D,Node:L,Element:R,HTMLElement:class extends R{constructor(){super(...arguments),this.innerHTML=""}get content(){return new C.DocumentFragment}},DocumentFragment:class extends S{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},localStorage:{getItem:e=>null,setItem(e,t){},removeItem(e){}},CustomEvent:function(){},getComputedStyle:function(){},navigator:{languages:[],get userAgent(){return""}},matchMedia:e=>({matches:!1,media:e}),DOMParser:class{parseFromString(e,t){return{body:{textContent:e}}}}},x="global"in globalThis&&(null==globalThis?void 0:globalThis.global)===globalThis||"undefined"==typeof window||void 0===window.customElements,U=Object.keys(C).every((e=>e in globalThis)),P=x&&!U?C:globalThis,N=x&&!U?D:globalThis.document,O=new WeakMap,H=e=>{let t=O.get(e);return t||O.set(e,t=new Set),t},V=new P.ResizeObserver((e=>{for(const t of e)for(const e of H(t.target))e(t)}));function W(e,t){H(e).add(t),V.observe(e)}function $(e,t){const i=H(e);i.delete(t),i.size||V.unobserve(e)}function B(e){const t={};for(const i of e)t[i.name]=i.value;return t}function F(e){var i;return null!=(i=function(e){var i;const{MEDIA_CONTROLLER:n}=t,a=e.getAttribute(n);if(a)return null==(i=function(e){var t;const i=null==(t=null==e?void 0:e.getRootNode)?void 0:t.call(e);if(i instanceof ShadowRoot||i instanceof Document)return i;return null}(e))?void 0:i.getElementById(a)}(e))?i:K(e,"media-controller")}const G=(e,t,i=".value")=>{const n=e.querySelector(i);n&&(n.textContent=t)},q=(e,t)=>((e,t)=>{const i=`slot[name="${t}"]`,n=e.shadowRoot.querySelector(i);return n?n.children:[]})(e,t)[0],Q=(e,t)=>!(!e||!t)&&(!!(null==e?void 0:e.contains(t))||Q(e,t.getRootNode().host)),K=(e,t)=>{if(!e)return null;const i=e.closest(t);return i||K(e.getRootNode().host,t)};function j(e=document){var t;const i=null==e?void 0:e.activeElement;return i?null!=(t=j(i.shadowRoot))?t:i:null}function Y(e,{depth:t=3,checkOpacity:i=!0,checkVisibilityCSS:n=!0}={}){if(e.checkVisibility)return e.checkVisibility({checkOpacity:i,checkVisibilityCSS:n});let a=e;for(;a&&t>0;){const e=getComputedStyle(a);if(i&&"0"===e.opacity||n&&"hidden"===e.visibility||"none"===e.display)return!1;a=a.parentElement,t--}return!0}function z(e,t){const i=function(e,t){var i,n;let a;for(a of null!=(i=e.querySelectorAll("style:not([media])"))?i:[]){let e;try{e=null==(n=a.sheet)?void 0:n.cssRules}catch{continue}for(const i of null!=e?e:[])if(t(i.selectorText))return i}}(e,(e=>e===t));return i||Z(e,t)}function Z(e,t){var i,n;const a=null!=(i=e.querySelectorAll("style:not([media])"))?i:[],s=null==a?void 0:a[a.length-1];return(null==s?void 0:s.sheet)?(null==s||s.sheet.insertRule(`${t}{}`,s.sheet.cssRules.length),null==(n=s.sheet.cssRules)?void 0:n[s.sheet.cssRules.length-1]):(console.warn("Media Chrome: No style sheet found on style tag of",e),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}})}function X(e,t,i=Number.NaN){const n=e.getAttribute(t);return null!=n?+n:i}function J(e,t,i){const n=+i;null==i||Number.isNaN(n)?e.hasAttribute(t)&&e.removeAttribute(t):X(e,t,void 0)!==n&&e.setAttribute(t,`${n}`)}function ee(e,t){return e.hasAttribute(t)}function te(e,t,i){null!=i?ee(e,t)!=i&&e.toggleAttribute(t,i):e.hasAttribute(t)&&e.removeAttribute(t)}function ie(e,t,i=null){var n;return null!=(n=e.getAttribute(t))?n:i}function ne(e,t,i){if(null==i)return void(e.hasAttribute(t)&&e.removeAttribute(t));const n=`${i}`;ie(e,t,void 0)!==n&&e.setAttribute(t,n)}var ae,se=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)},oe=(e,t,i)=>(se(e,t,"read from private field"),i?i.call(e):t.get(e)),re=(e,t,i,n)=>(se(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i);class le extends P.HTMLElement{constructor(){if(super(),((e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)})(this,ae,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);const e=B(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[t.MEDIA_CONTROLLER,a.MEDIA_PAUSED]}attributeChangedCallback(e,i,n){var a,s,o,r,l;e===t.MEDIA_CONTROLLER&&(i&&(null==(s=null==(a=oe(this,ae))?void 0:a.unassociateElement)||s.call(a,this),re(this,ae,null)),n&&this.isConnected&&(re(this,ae,null==(o=this.getRootNode())?void 0:o.getElementById(n)),null==(l=null==(r=oe(this,ae))?void 0:r.associateElement)||l.call(r,this)))}connectedCallback(){var e,i,n,a;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),re(this,ae,function(e){var i;const n=e.getAttribute(t.MEDIA_CONTROLLER);if(n)return null==(i=e.getRootNode())?void 0:i.getElementById(n);return K(e,"media-controller")}(this)),this.getAttribute(t.MEDIA_CONTROLLER)&&(null==(i=null==(e=oe(this,ae))?void 0:e.associateElement)||i.call(e,this)),null==(n=oe(this,ae))||n.addEventListener("pointerdown",this),null==(a=oe(this,ae))||a.addEventListener("click",this)}disconnectedCallback(){var e,i,n,a;this.getAttribute(t.MEDIA_CONTROLLER)&&(null==(i=null==(e=oe(this,ae))?void 0:e.unassociateElement)||i.call(e,this)),null==(n=oe(this,ae))||n.removeEventListener("pointerdown",this),null==(a=oe(this,ae))||a.removeEventListener("click",this),re(this,ae,null)}handleEvent(e){var t;const i=null==(t=e.composedPath())?void 0:t[0];if(["video","media-controller"].includes(null==i?void 0:i.localName))if("pointerdown"===e.type)this._pointerType=e.pointerType;else if("click"===e.type){const{clientX:t,clientY:i}=e,{left:n,top:a,width:s,height:o}=this.getBoundingClientRect(),r=t-n,l=i-a;if(r<0||l<0||r>s||l>o||0===s&&0===o)return;const d=this._pointerType||"mouse";if(this._pointerType=void 0,d===c.TOUCH)return void this.handleTap(e);if(d===c.MOUSE||d===c.PEN)return void this.handleMouseClick(e)}}get mediaPaused(){return ee(this,a.MEDIA_PAUSED)}set mediaPaused(e){te(this,a.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(t){const i=this.mediaPaused?e.MEDIA_PLAY_REQUEST:e.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new P.CustomEvent(i,{composed:!0,bubbles:!0}))}}ae=new WeakMap,le.shadowRootOptions={mode:"open"},le.getTemplateHTML=function(e){return"\n    <style>\n      :host {\n        display: var(--media-control-display, var(--media-gesture-receiver-display, inline-block));\n        box-sizing: border-box;\n      }\n    </style>\n  "},P.customElements.get("media-gesture-receiver")||P.customElements.define("media-gesture-receiver",le);var de,ce,ue,he,me,pe,Ee,ve,be,ge,Ae,fe,Ie,we,ye,_e,Te,ke,Me,Se=le,Le=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)},Re=(e,t,i)=>(Le(e,t,"read from private field"),i?i.call(e):t.get(e)),De=(e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)},Ce=(e,t,i,n)=>(Le(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i),xe=(e,t,i)=>(Le(e,t,"access private method"),i);const Ue={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive",AUTOHIDE_OVER_CONTROLS:"autohideovercontrols"};const Pe=Object.values(a);function Ne(e,t){var i;if(!e.isConnected)return;const n=function(e){const t=e.split(/\s+/);return Object.fromEntries(t.map((e=>e.split(":"))))}(null!=(i=e.getAttribute(Ue.BREAKPOINTS))?i:"sm:384 md:576 lg:768 xl:960"),a=function(e,t){return Object.keys(e).filter((i=>t>=parseInt(e[i])))}(n,t);let o=!1;if(Object.keys(n).forEach((t=>{a.includes(t)?e.hasAttribute(`breakpoint${t}`)||(e.setAttribute(`breakpoint${t}`,""),o=!0):e.hasAttribute(`breakpoint${t}`)&&(e.removeAttribute(`breakpoint${t}`),o=!0)})),o){const t=new CustomEvent(s.BREAKPOINTS_CHANGE,{detail:a});e.dispatchEvent(t)}e.breakpointsComputed||(e.breakpointsComputed=!0,e.dispatchEvent(new CustomEvent(s.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))}class Oe extends P.HTMLElement{constructor(){if(super(),De(this,pe),De(this,ge),De(this,fe),De(this,we),De(this,_e),De(this,ke),De(this,de,0),De(this,ce,null),De(this,ue,null),De(this,he,void 0),this.breakpointsComputed=!1,De(this,me,new MutationObserver(xe(this,pe,Ee).bind(this))),De(this,ve,!1),De(this,be,(e=>{Re(this,ve)||(setTimeout((()=>{!function(e){Ne(e.target,e.contentRect.width)}(e),Ce(this,ve,!1)}),0),Ce(this,ve,!0))})),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);const e=B(this.attributes),t=this.constructor.getTemplateHTML(e);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(t):this.shadowRoot.innerHTML=t}const e=this.querySelector(":scope > slot[slot=media]");e&&e.addEventListener("slotchange",(()=>{e.assignedElements({flatten:!0}).length?this.handleMediaUpdated(this.media):Re(this,ce)&&this.mediaUnsetCallback(Re(this,ce))}))}static get observedAttributes(){return[Ue.AUTOHIDE,Ue.GESTURES_DISABLED].concat(Pe).filter((e=>![a.MEDIA_RENDITION_LIST,a.MEDIA_AUDIO_TRACK_LIST,a.MEDIA_CHAPTERS_CUES,a.MEDIA_WIDTH,a.MEDIA_HEIGHT,a.MEDIA_ERROR,a.MEDIA_ERROR_MESSAGE].includes(e)))}attributeChangedCallback(e,t,i){e.toLowerCase()==Ue.AUTOHIDE&&(this.autohide=i)}get media(){let e=this.querySelector(":scope > [slot=media]");return"SLOT"==(null==e?void 0:e.nodeName)&&(e=e.assignedElements({flatten:!0})[0]),e}async handleMediaUpdated(e){e&&(Ce(this,ce,e),e.localName.includes("-")&&await P.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;Re(this,me).observe(this,{childList:!0,subtree:!0}),W(this,Re(this,be));const t=null!=this.getAttribute(Ue.AUDIO),i=M(t?"audio player":"video player");this.setAttribute("role","region"),this.setAttribute("aria-label",i),this.handleMediaUpdated(this.media),this.setAttribute(Ue.USER_INACTIVE,""),Ne(this,this.getBoundingClientRect().width),this.addEventListener("pointerdown",this),this.addEventListener("pointermove",this),this.addEventListener("pointerup",this),this.addEventListener("mouseleave",this),this.addEventListener("keyup",this),null==(e=P.window)||e.addEventListener("mouseup",this)}disconnectedCallback(){var e;Re(this,me).disconnect(),$(this,Re(this,be)),this.media&&this.mediaUnsetCallback(this.media),null==(e=P.window)||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){Ce(this,ce,null)}handleEvent(e){switch(e.type){case"pointerdown":Ce(this,de,e.timeStamp);break;case"pointermove":xe(this,ge,Ae).call(this,e);break;case"pointerup":xe(this,fe,Ie).call(this,e);break;case"mouseleave":xe(this,we,ye).call(this);break;case"mouseup":this.removeAttribute(Ue.KEYBOARD_CONTROL);break;case"keyup":xe(this,ke,Me).call(this),this.setAttribute(Ue.KEYBOARD_CONTROL,"")}}set autohide(e){const t=Number(e);Ce(this,he,isNaN(t)?0:t)}get autohide(){return(void 0===Re(this,he)?2:Re(this,he)).toString()}get breakpoints(){return ie(this,Ue.BREAKPOINTS)}set breakpoints(e){ne(this,Ue.BREAKPOINTS,e)}get audio(){return ee(this,Ue.AUDIO)}set audio(e){te(this,Ue.AUDIO,e)}get gesturesDisabled(){return ee(this,Ue.GESTURES_DISABLED)}set gesturesDisabled(e){te(this,Ue.GESTURES_DISABLED,e)}get keyboardControl(){return ee(this,Ue.KEYBOARD_CONTROL)}set keyboardControl(e){te(this,Ue.KEYBOARD_CONTROL,e)}get noAutohide(){return ee(this,Ue.NO_AUTOHIDE)}set noAutohide(e){te(this,Ue.NO_AUTOHIDE,e)}get autohideOverControls(){return ee(this,Ue.AUTOHIDE_OVER_CONTROLS)}set autohideOverControls(e){te(this,Ue.AUTOHIDE_OVER_CONTROLS,e)}get userInteractive(){return ee(this,Ue.USER_INACTIVE)}set userInteractive(e){te(this,Ue.USER_INACTIVE,e)}}de=new WeakMap,ce=new WeakMap,ue=new WeakMap,he=new WeakMap,me=new WeakMap,pe=new WeakSet,Ee=function(e){const t=this.media;for(const i of e){if("childList"!==i.type)continue;const e=i.removedNodes;for(const n of e){if("media"!=n.slot||i.target!=this)continue;let e=i.previousSibling&&i.previousSibling.previousElementSibling;if(e&&t){let t="media"!==e.slot;for(;null!==(e=e.previousSibling);)"media"==e.slot&&(t=!1);t&&this.mediaUnsetCallback(n)}else this.mediaUnsetCallback(n)}if(t)for(const e of i.addedNodes)e===t&&this.handleMediaUpdated(t)}},ve=new WeakMap,be=new WeakMap,ge=new WeakSet,Ae=function(e){if("mouse"!==e.pointerType){const t=250;if(e.timeStamp-Re(this,de)<t)return}xe(this,_e,Te).call(this),clearTimeout(Re(this,ue));const t=this.hasAttribute(Ue.AUTOHIDE_OVER_CONTROLS);([this,this.media].includes(e.target)||t)&&xe(this,ke,Me).call(this)},fe=new WeakSet,Ie=function(e){if("touch"===e.pointerType){const t=!this.hasAttribute(Ue.USER_INACTIVE);[this,this.media].includes(e.target)&&t?xe(this,we,ye).call(this):xe(this,ke,Me).call(this)}else e.composedPath().some((e=>["media-play-button","media-fullscreen-button"].includes(null==e?void 0:e.localName)))&&xe(this,ke,Me).call(this)},we=new WeakSet,ye=function(){if(Re(this,he)<0)return;if(this.hasAttribute(Ue.USER_INACTIVE))return;this.setAttribute(Ue.USER_INACTIVE,"");const e=new P.CustomEvent(s.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(e)},_e=new WeakSet,Te=function(){if(!this.hasAttribute(Ue.USER_INACTIVE))return;this.removeAttribute(Ue.USER_INACTIVE);const e=new P.CustomEvent(s.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(e)},ke=new WeakSet,Me=function(){xe(this,_e,Te).call(this),clearTimeout(Re(this,ue));const e=parseInt(this.autohide);e<0||Ce(this,ue,setTimeout((()=>{xe(this,we,ye).call(this)}),1e3*e))},Oe.shadowRootOptions={mode:"open"},Oe.getTemplateHTML=function(e){return`\n    <style>\n      \n      :host([${a.MEDIA_IS_FULLSCREEN}]) ::slotted([slot=media]) {\n        outline: none;\n      }\n\n      :host {\n        box-sizing: border-box;\n        position: relative;\n        display: inline-block;\n        line-height: 0;\n        background-color: var(--media-background-color, #000);\n        overflow: hidden;\n      }\n\n      :host(:not([${Ue.AUDIO}])) [part~=layer]:not([part~=media-layer]) {\n        position: absolute;\n        top: 0;\n        left: 0;\n        bottom: 0;\n        right: 0;\n        display: flex;\n        flex-flow: column nowrap;\n        align-items: start;\n        pointer-events: none;\n        background: none;\n      }\n\n      slot[name=media] {\n        display: var(--media-slot-display, contents);\n      }\n\n      \n      :host([${Ue.AUDIO}]) slot[name=media] {\n        display: var(--media-slot-display, none);\n      }\n\n      \n      :host([${Ue.AUDIO}]) [part~=layer][part~=gesture-layer] {\n        height: 0;\n        display: block;\n      }\n\n      \n      :host(:not([${Ue.AUDIO}])[${Ue.GESTURES_DISABLED}]) ::slotted([slot=gestures-chrome]),\n          :host(:not([${Ue.AUDIO}])[${Ue.GESTURES_DISABLED}]) media-gesture-receiver[slot=gestures-chrome] {\n        display: none;\n      }\n\n      \n      ::slotted(:not([slot=media]):not([slot=poster]):not(media-loading-indicator):not([role=dialog]):not([hidden])) {\n        pointer-events: auto;\n      }\n\n      :host(:not([${Ue.AUDIO}])) *[part~=layer][part~=centered-layer] {\n        align-items: center;\n        justify-content: center;\n      }\n\n      :host(:not([${Ue.AUDIO}])) ::slotted(media-gesture-receiver[slot=gestures-chrome]),\n      :host(:not([${Ue.AUDIO}])) media-gesture-receiver[slot=gestures-chrome] {\n        align-self: stretch;\n        flex-grow: 1;\n      }\n\n      slot[name=middle-chrome] {\n        display: inline;\n        flex-grow: 1;\n        pointer-events: none;\n        background: none;\n      }\n\n      \n      ::slotted([slot=media]),\n      ::slotted([slot=poster]) {\n        width: 100%;\n        height: 100%;\n      }\n\n      \n      :host(:not([${Ue.AUDIO}])) .spacer {\n        flex-grow: 1;\n      }\n\n      \n      :host(:-webkit-full-screen) {\n        \n        width: 100% !important;\n        height: 100% !important;\n      }\n\n      \n      ::slotted(:not([slot=media]):not([slot=poster]):not([${Ue.NO_AUTOHIDE}]):not([hidden]):not([role=dialog])) {\n        opacity: 1;\n        transition: var(--media-control-transition-in, opacity 0.25s);\n      }\n\n      \n      :host([${Ue.USER_INACTIVE}]:not([${a.MEDIA_PAUSED}]):not([${a.MEDIA_IS_AIRPLAYING}]):not([${a.MEDIA_IS_CASTING}]):not([${Ue.AUDIO}])) ::slotted(:not([slot=media]):not([slot=poster]):not([${Ue.NO_AUTOHIDE}]):not([role=dialog])) {\n        opacity: 0;\n        transition: var(--media-control-transition-out, opacity 1s);\n      }\n\n      :host([${Ue.USER_INACTIVE}]:not([${Ue.NO_AUTOHIDE}]):not([${a.MEDIA_PAUSED}]):not([${a.MEDIA_IS_CASTING}]):not([${Ue.AUDIO}])) ::slotted([slot=media]) {\n        cursor: none;\n      }\n\n      :host([${Ue.USER_INACTIVE}][${Ue.AUTOHIDE_OVER_CONTROLS}]:not([${Ue.NO_AUTOHIDE}]):not([${a.MEDIA_PAUSED}]):not([${a.MEDIA_IS_CASTING}]):not([${Ue.AUDIO}])) * {\n        --media-cursor: none;\n        cursor: none;\n      }\n\n\n      ::slotted(media-control-bar)  {\n        align-self: stretch;\n      }\n\n      \n      :host(:not([${Ue.AUDIO}])[${a.MEDIA_HAS_PLAYED}]) slot[name=poster] {\n        display: none;\n      }\n\n      ::slotted([role=dialog]) {\n        width: 100%;\n        height: 100%;\n        align-self: center;\n      }\n\n      ::slotted([role=menu]) {\n        align-self: end;\n      }\n    </style>\n\n    <slot name="media" part="layer media-layer"></slot>\n    <slot name="poster" part="layer poster-layer"></slot>\n    <slot name="gestures-chrome" part="layer gesture-layer">\n      <media-gesture-receiver slot="gestures-chrome">\n        <template shadowrootmode="${Se.shadowRootOptions.mode}">\n          ${Se.getTemplateHTML({})}\n        </template>\n      </media-gesture-receiver>\n    </slot>\n    <span part="layer vertical-layer">\n      <slot name="top-chrome" part="top chrome"></slot>\n      <slot name="middle-chrome" part="middle chrome"></slot>\n      <slot name="centered-chrome" part="layer centered-layer center centered chrome"></slot>\n      \n      <slot part="bottom chrome"></slot>\n    </span>\n    <slot name="dialog" part="layer dialog-layer"></slot>\n  `},P.customElements.get("media-container")||P.customElements.define("media-container",Oe);var He,Ve,We,$e,Be,Fe,Ge=Oe,qe=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)},Qe=(e,t,i)=>(qe(e,t,"read from private field"),i?i.call(e):t.get(e)),Ke=(e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)},je=(e,t,i,n)=>(qe(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i);class Ye{constructor(e,t,{defaultValue:i}={defaultValue:void 0}){Ke(this,Be),Ke(this,He,void 0),Ke(this,Ve,void 0),Ke(this,We,void 0),Ke(this,$e,new Set),je(this,He,e),je(this,Ve,t),je(this,We,new Set(i))}[Symbol.iterator](){return Qe(this,Be,Fe).values()}get length(){return Qe(this,Be,Fe).size}get value(){var e;return null!=(e=[...Qe(this,Be,Fe)].join(" "))?e:""}set value(e){var t;e!==this.value&&(je(this,$e,new Set),this.add(...null!=(t=null==e?void 0:e.split(" "))?t:[]))}toString(){return this.value}item(e){return[...Qe(this,Be,Fe)][e]}values(){return Qe(this,Be,Fe).values()}forEach(e,t){Qe(this,Be,Fe).forEach(e,t)}add(...e){var t,i;e.forEach((e=>Qe(this,$e).add(e))),(""!==this.value||(null==(t=Qe(this,He))?void 0:t.hasAttribute(`${Qe(this,Ve)}`)))&&(null==(i=Qe(this,He))||i.setAttribute(`${Qe(this,Ve)}`,`${this.value}`))}remove(...e){var t;e.forEach((e=>Qe(this,$e).delete(e))),null==(t=Qe(this,He))||t.setAttribute(`${Qe(this,Ve)}`,`${this.value}`)}contains(e){return Qe(this,Be,Fe).has(e)}toggle(e,t){return void 0!==t?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}}He=new WeakMap,Ve=new WeakMap,We=new WeakMap,$e=new WeakMap,Be=new WeakSet,Fe=function(){return Qe(this,$e).size?Qe(this,$e):Qe(this,We)};const ze=(e="")=>{const[t,i,n]=e.split(":"),a=n?decodeURIComponent(n):void 0;return{kind:"cc"===t?l.CAPTIONS:l.SUBTITLES,language:i,label:a}},Ze=(e="",t={})=>((e="")=>e.split(/\s+/))(e).map((e=>{const i=ze(e);return{...t,...i}})),Xe=e=>e?Array.isArray(e)?e.map((e=>"string"==typeof e?ze(e):e)):"string"==typeof e?Ze(e):[e]:[],Je=({kind:e,label:t,language:i}={kind:"subtitles"})=>t?`${"captions"===e?"cc":"sb"}:${i}:${encodeURIComponent(t)}`:i,et=(e=[])=>Array.prototype.map.call(e,Je).join(" "),tt=e=>{const t=Object.entries(e).map((([e,t])=>((e,t)=>i=>i[e]===t)(e,t)));return e=>t.every((t=>t(e)))},it=(e,t=[],i=[])=>{const n=Xe(i).map(tt);Array.from(t).filter((e=>n.some((t=>t(e))))).forEach((t=>{t.mode=e}))},nt=(e,t=()=>!0)=>{if(!(null==e?void 0:e.textTracks))return[];const i="function"==typeof t?t:tt(t);return Array.from(e.textTracks).filter(i)},at="exitFullscreen"in N?"exitFullscreen":"webkitExitFullscreen"in N?"webkitExitFullscreen":"webkitCancelFullScreen"in N?"webkitCancelFullScreen":void 0,st="fullscreenElement"in N?"fullscreenElement":"webkitFullscreenElement"in N?"webkitFullscreenElement":void 0,ot=e=>{var t;const{media:i,documentElement:n,fullscreenElement:a=i}=e;if(!i||!n)return!1;const s=(e=>{const{documentElement:t,media:i}=e,n=null==t?void 0:t[st];return!n&&"webkitDisplayingFullscreen"in i&&"webkitPresentationMode"in i&&i.webkitDisplayingFullscreen&&i.webkitPresentationMode===m.FULLSCREEN?i:n})(e);if(!s)return!1;if(s===a||s===i)return!0;if(s.localName.includes("-")){let e=s.shadowRoot;if(!(st in e))return Q(s,a);for(;null==e?void 0:e[st];){if(e[st]===a)return!0;e=null==(t=e[st])?void 0:t.shadowRoot}}return!1},rt="fullscreenEnabled"in N?"fullscreenEnabled":"webkitFullscreenEnabled"in N?"webkitFullscreenEnabled":void 0;let lt;const dt=()=>{var e,t;return lt||(lt=null==(t=null==(e=N)?void 0:e.createElement)?void 0:t.call(e,"video"),lt)},ct=(e,t)=>new Promise((i=>{e.addEventListener("volumechange",(()=>i(!0)),{signal:t})})),ut=async(e,t)=>{for(let i=0;i<10;i++){if(e.volume===t)return!1;await g(10)}return e.volume!==t},ht=/.*Version\/.*Safari\/.*/.test(P.navigator.userAgent),mt=(e=dt())=>(!P.matchMedia("(display-mode: standalone)").matches||!ht)&&"function"==typeof(null==e?void 0:e.requestPictureInPicture),pt=(e=dt())=>(e=>{const{documentElement:t,media:i}=e;return!!(null==t?void 0:t[rt])||i&&"webkitSupportsFullscreen"in i})({documentElement:N,media:e}),Et=pt(),vt=mt(),bt=!!P.WebKitPlaybackTargetAvailabilityEvent,gt=!!P.chrome,At=e=>nt(e.media,(e=>[l.SUBTITLES,l.CAPTIONS].includes(e.kind))).sort(((e,t)=>e.kind>=t.kind?1:-1)),ft=e=>nt(e.media,(e=>e.mode===d.SHOWING&&[l.SUBTITLES,l.CAPTIONS].includes(e.kind))),It=(e,t)=>{const i=At(e),n=ft(e),a=!!n.length;if(i.length)if(!1===t||a&&!0!==t)it(d.DISABLED,i,n);else if(!0===t||!a&&!1!==t){let t=i[0];const{options:a}=e;if(!(null==a?void 0:a.noSubtitlesLangPref)){const e=globalThis.localStorage.getItem("media-chrome-pref-subtitles-lang"),n=e?[e,...globalThis.navigator.languages]:globalThis.navigator.languages,a=i.filter((e=>n.some((t=>e.language.toLowerCase().startsWith(t.split("-")[0]))))).sort(((e,t)=>n.findIndex((t=>e.language.toLowerCase().startsWith(t.split("-")[0])))-n.findIndex((e=>t.language.toLowerCase().startsWith(e.split("-")[0])))));a[0]&&(t=a[0])}const{language:s,label:o,kind:r}=t;it(d.DISABLED,i,n),it(d.SHOWING,i,[{language:s,label:o,kind:r}])}},wt=(e,t)=>e===t||null!=e&&null!=t&&(typeof e==typeof t&&(!("number"!=typeof e||!Number.isNaN(e)||!Number.isNaN(t))||"object"==typeof e&&(Array.isArray(e)?yt(e,t):Object.entries(e).every((([e,i])=>e in t&&wt(i,t[e])))))),yt=(e,t)=>{const i=Array.isArray(e),n=Array.isArray(t);return i===n&&(!i&&!n||e.length===t.length&&e.every(((e,i)=>wt(e,t[i]))))},_t=Object.values(h);let Tt;const kt=(async(e=dt())=>{if(!e)return!1;const t=e.volume;e.volume=t/2+.1;const i=new AbortController,n=await Promise.race([ct(e,i.signal),ut(e,t)]);return i.abort(),n})().then((e=>(Tt=e,Tt))),Mt=new P.DOMParser,St=e=>e&&Mt.parseFromString(e,"text/html").body.textContent||e,Lt={mediaError:{get(e,t){const{media:i}=e;if("playing"!==(null==t?void 0:t.type))return null==i?void 0:i.error},mediaEvents:["emptied","error","playing"]},mediaErrorCode:{get(e,t){var i;const{media:n}=e;if("playing"!==(null==t?void 0:t.type))return null==(i=null==n?void 0:n.error)?void 0:i.code},mediaEvents:["emptied","error","playing"]},mediaErrorMessage:{get(e,t){var i,n;const{media:a}=e;if("playing"!==(null==t?void 0:t.type))return null!=(n=null==(i=null==a?void 0:a.error)?void 0:i.message)?n:""},mediaEvents:["emptied","error","playing"]},mediaWidth:{get(e){var t;const{media:i}=e;return null!=(t=null==i?void 0:i.videoWidth)?t:0},mediaEvents:["resize"]},mediaHeight:{get(e){var t;const{media:i}=e;return null!=(t=null==i?void 0:i.videoHeight)?t:0},mediaEvents:["resize"]},mediaPaused:{get(e){var t;const{media:i}=e;return null==(t=null==i?void 0:i.paused)||t},set(e,t){var i;const{media:n}=t;n&&(e?n.pause():null==(i=n.play())||i.catch((()=>{})))},mediaEvents:["play","playing","pause","emptied"]},mediaHasPlayed:{get(e,t){const{media:i}=e;return!!i&&(t?"playing"===t.type:!i.paused)},mediaEvents:["playing","emptied"]},mediaEnded:{get(e){var t;const{media:i}=e;return null!=(t=null==i?void 0:i.ended)&&t},mediaEvents:["seeked","ended","emptied"]},mediaPlaybackRate:{get(e){var t;const{media:i}=e;return null!=(t=null==i?void 0:i.playbackRate)?t:1},set(e,t){const{media:i}=t;i&&Number.isFinite(+e)&&(i.playbackRate=+e)},mediaEvents:["ratechange","loadstart"]},mediaMuted:{get(e){var t;const{media:i}=e;return null!=(t=null==i?void 0:i.muted)&&t},set(e,t){const{media:i,options:{noMutedPref:n}={}}=t;if(i){i.muted=e;try{const t=null!==P.localStorage.getItem("media-chrome-pref-muted"),a=i.hasAttribute("muted");if(n)return void(t&&P.localStorage.removeItem("media-chrome-pref-muted"));if(a&&!t)return;P.localStorage.setItem("media-chrome-pref-muted",e?"true":"false")}catch(e){console.debug("Error setting muted pref",e)}}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(e,t)=>{const{options:{noMutedPref:i}}=t,{media:n}=t;if(n&&!n.muted&&!i)try{const i="true"===P.localStorage.getItem("media-chrome-pref-muted");Lt.mediaMuted.set(i,t),e(i)}catch(e){console.debug("Error getting muted pref",e)}}]},mediaLoop:{get(e){const{media:t}=e;return null==t?void 0:t.loop},set(e,t){const{media:i}=t;i&&(i.loop=e)},mediaEvents:["medialooprequest"]},mediaVolume:{get(e){var t;const{media:i}=e;return null!=(t=null==i?void 0:i.volume)?t:1},set(e,t){const{media:i,options:{noVolumePref:n}={}}=t;if(i){try{null==e?P.localStorage.removeItem("media-chrome-pref-volume"):i.hasAttribute("muted")||n||P.localStorage.setItem("media-chrome-pref-volume",e.toString())}catch(e){console.debug("Error setting volume pref",e)}Number.isFinite(+e)&&(i.volume=+e)}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(e,t)=>{const{options:{noVolumePref:i}}=t;if(!i)try{const{media:i}=t;if(!i)return;const n=P.localStorage.getItem("media-chrome-pref-volume");if(null==n)return;Lt.mediaVolume.set(+n,t),e(+n)}catch(e){console.debug("Error getting volume pref",e)}}]},mediaVolumeLevel:{get(e){const{media:t}=e;return void 0===(null==t?void 0:t.volume)?"high":t.muted||0===t.volume?"off":t.volume<.5?"low":t.volume<.75?"medium":"high"},mediaEvents:["volumechange"]},mediaCurrentTime:{get(e){var t;const{media:i}=e;return null!=(t=null==i?void 0:i.currentTime)?t:0},set(e,t){const{media:i}=t;i&&b(e)&&(i.currentTime=e)},mediaEvents:["timeupdate","loadedmetadata"]},mediaDuration:{get(e){const{media:t,options:{defaultDuration:i}={}}=e;return!i||t&&t.duration&&!Number.isNaN(t.duration)&&Number.isFinite(t.duration)?Number.isFinite(null==t?void 0:t.duration)?t.duration:Number.NaN:i},mediaEvents:["durationchange","loadedmetadata","emptied"]},mediaLoading:{get(e){const{media:t}=e;return(null==t?void 0:t.readyState)<3},mediaEvents:["waiting","playing","emptied"]},mediaSeekable:{get(e){var t;const{media:i}=e;if(!(null==(t=null==i?void 0:i.seekable)?void 0:t.length))return;const n=i.seekable.start(0),a=i.seekable.end(i.seekable.length-1);return n||a?[Number(n.toFixed(3)),Number(a.toFixed(3))]:void 0},mediaEvents:["loadedmetadata","emptied","progress","seekablechange"]},mediaBuffered:{get(e){var t;const{media:i}=e,n=null!=(t=null==i?void 0:i.buffered)?t:[];return Array.from(n).map(((e,t)=>[Number(n.start(t).toFixed(3)),Number(n.end(t).toFixed(3))]))},mediaEvents:["progress","emptied"]},mediaStreamType:{get(e){const{media:t,options:{defaultStreamType:i}={}}=e,n=[h.LIVE,h.ON_DEMAND].includes(i)?i:void 0;if(!t)return n;const{streamType:a}=t;if(_t.includes(a))return a===h.UNKNOWN?n:a;const s=t.duration;return s===1/0?h.LIVE:Number.isFinite(s)?h.ON_DEMAND:n},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange"]},mediaTargetLiveWindow:{get(e){const{media:t}=e;if(!t)return Number.NaN;const{targetLiveWindow:i}=t,n=Lt.mediaStreamType.get(e);return null!=i&&!Number.isNaN(i)||n!==h.LIVE?i:0},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange","targetlivewindowchange"]},mediaTimeIsLive:{get(e){const{media:t,options:{liveEdgeOffset:i=10}={}}=e;if(!t)return!1;if("number"==typeof t.liveEdgeStart)return!Number.isNaN(t.liveEdgeStart)&&t.currentTime>=t.liveEdgeStart;if(!(Lt.mediaStreamType.get(e)===h.LIVE))return!1;const n=t.seekable;if(!n)return!0;if(!n.length)return!1;const a=n.end(n.length-1)-i;return t.currentTime>=a},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},mediaSubtitlesList:{get:e=>At(e).map((({kind:e,label:t,language:i})=>({kind:e,label:t,language:i}))),mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},mediaSubtitlesShowing:{get:e=>ft(e).map((({kind:e,label:t,language:i})=>({kind:e,label:t,language:i}))),mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(e,t)=>{var i,n;const{media:a,options:s}=t;if(!a)return;const o=e=>{var i;if(!s.defaultSubtitles)return;e&&![l.CAPTIONS,l.SUBTITLES].includes(null==(i=null==e?void 0:e.track)?void 0:i.kind)||It(t,!0)};return a.addEventListener("loadstart",o),null==(i=a.textTracks)||i.addEventListener("addtrack",o),null==(n=a.textTracks)||n.addEventListener("removetrack",o),()=>{var e,t;a.removeEventListener("loadstart",o),null==(e=a.textTracks)||e.removeEventListener("addtrack",o),null==(t=a.textTracks)||t.removeEventListener("removetrack",o)}}]},mediaChaptersCues:{get(e){var t;const{media:i}=e;if(!i)return[];const[n]=nt(i,{kind:l.CHAPTERS});return Array.from(null!=(t=null==n?void 0:n.cues)?t:[]).map((({text:e,startTime:t,endTime:i})=>({text:St(e),startTime:t,endTime:i})))},mediaEvents:["loadstart","loadedmetadata"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(e,t)=>{var i;const{media:n}=t;if(!n)return;const a=n.querySelector('track[kind="chapters"][default][src]'),s=null==(i=n.shadowRoot)?void 0:i.querySelector(':is(video,audio) > track[kind="chapters"][default][src]');return null==a||a.addEventListener("load",e),null==s||s.addEventListener("load",e),()=>{null==a||a.removeEventListener("load",e),null==s||s.removeEventListener("load",e)}}]},mediaIsPip:{get(e){var t,i;const{media:n,documentElement:a}=e;if(!n||!a)return!1;if(!a.pictureInPictureElement)return!1;if(a.pictureInPictureElement===n)return!0;if(a.pictureInPictureElement instanceof HTMLMediaElement)return!!(null==(t=n.localName)?void 0:t.includes("-"))&&Q(n,a.pictureInPictureElement);if(a.pictureInPictureElement.localName.includes("-")){let e=a.pictureInPictureElement.shadowRoot;for(;null==e?void 0:e.pictureInPictureElement;){if(e.pictureInPictureElement===n)return!0;e=null==(i=e.pictureInPictureElement)?void 0:i.shadowRoot}}return!1},set(e,t){const{media:i}=t;if(i)if(e){if(!N.pictureInPictureEnabled)return void console.warn("MediaChrome: Picture-in-picture is not enabled");if(!i.requestPictureInPicture)return void console.warn("MediaChrome: The current media does not support picture-in-picture");const e=()=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};i.requestPictureInPicture().catch((t=>{if(11!==t.code)throw t;if(i.src){if(0!==i.readyState||"none"!==i.preload)throw t;{const t=()=>{i.removeEventListener("loadedmetadata",n),i.preload="none"},n=()=>{i.requestPictureInPicture().catch(e),t()};i.addEventListener("loadedmetadata",n),i.preload="metadata",setTimeout((()=>{0===i.readyState&&e(),t()}),1e3)}}else console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a src set.")}))}else N.pictureInPictureElement&&N.exitPictureInPicture()},mediaEvents:["enterpictureinpicture","leavepictureinpicture"]},mediaRenditionList:{get(e){var t;const{media:i}=e;return[...null!=(t=null==i?void 0:i.videoRenditions)?t:[]].map((e=>({...e})))},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaRenditionSelected:{get(e){var t,i,n;const{media:a}=e;return null==(n=null==(i=null==a?void 0:a.videoRenditions)?void 0:i[null==(t=a.videoRenditions)?void 0:t.selectedIndex])?void 0:n.id},set(e,t){const{media:i}=t;if(!(null==i?void 0:i.videoRenditions))return void console.warn("MediaController: Rendition selection not supported by this media.");const n=e,a=Array.prototype.findIndex.call(i.videoRenditions,(e=>e.id==n));i.videoRenditions.selectedIndex!=a&&(i.videoRenditions.selectedIndex=a)},mediaEvents:["emptied"],videoRenditionsEvents:["addrendition","removerendition","change"]},mediaAudioTrackList:{get(e){var t;const{media:i}=e;return[...null!=(t=null==i?void 0:i.audioTracks)?t:[]]},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaAudioTrackEnabled:{get(e){var t,i;const{media:n}=e;return null==(i=[...null!=(t=null==n?void 0:n.audioTracks)?t:[]].find((e=>e.enabled)))?void 0:i.id},set(e,t){const{media:i}=t;if(!(null==i?void 0:i.audioTracks))return void console.warn("MediaChrome: Audio track selection not supported by this media.");const n=e;for(const e of i.audioTracks)e.enabled=n==e.id},mediaEvents:["emptied"],audioTracksEvents:["addtrack","removetrack","change"]},mediaIsFullscreen:{get:e=>ot(e),set(e,t,i){var n;if(e){(e=>{var t;const{media:i,fullscreenElement:n}=e;try{const e=n&&"requestFullscreen"in n?"requestFullscreen":n&&"webkitRequestFullScreen"in n?"webkitRequestFullScreen":void 0;if(e){const i=null==(t=n[e])?void 0:t.call(n);if(i instanceof Promise)return i.catch((()=>{}))}else(null==i?void 0:i.webkitEnterFullscreen)?i.webkitEnterFullscreen():(null==i?void 0:i.requestFullscreen)&&i.requestFullscreen()}catch(e){console.error(e)}})(t);i.detail&&(null==(n=t.media)||n.focus())}else(e=>{var t;const{documentElement:i}=e;if(at){const e=null==(t=null==i?void 0:i[at])?void 0:t.call(i);if(e instanceof Promise)e.catch((()=>{}))}})(t)},rootEvents:["fullscreenchange","webkitfullscreenchange"],mediaEvents:["webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"]},mediaIsCasting:{get(e){var t;const{media:i}=e;return!(!(null==i?void 0:i.remote)||"disconnected"===(null==(t=i.remote)?void 0:t.state))&&!!i.remote.state},set(e,t){var i,n;const{media:a}=t;a&&(e&&"disconnected"!==(null==(i=a.remote)?void 0:i.state)||(e||"connected"===(null==(n=a.remote)?void 0:n.state))&&("function"==typeof a.remote.prompt?a.remote.prompt().catch((()=>{})):console.warn("MediaChrome: Casting is not supported in this environment")))},remoteEvents:["connect","connecting","disconnect"]},mediaIsAirplaying:{get:()=>!1,set(e,t){const{media:i}=t;i&&(i.webkitShowPlaybackTargetPicker&&P.WebKitPlaybackTargetAvailabilityEvent?i.webkitShowPlaybackTargetPicker():console.error("MediaChrome: received a request to select AirPlay but AirPlay is not supported in this environment"))},mediaEvents:["webkitcurrentplaybacktargetiswirelesschanged"]},mediaFullscreenUnavailable:{get(e){const{media:t}=e;if(!Et||!pt(t))return u.UNSUPPORTED}},mediaPipUnavailable:{get(e){const{media:t}=e;return vt&&mt(t)?(null==t?void 0:t.disablePictureInPicture)?u.UNAVAILABLE:void 0:u.UNSUPPORTED}},mediaVolumeUnavailable:{get(e){const{media:t}=e;if(!1===Tt||null==(null==t?void 0:t.volume))return u.UNSUPPORTED},stateOwnersUpdateHandlers:[e=>{null==Tt&&kt.then((t=>e(t?void 0:u.UNSUPPORTED)))}]},mediaCastUnavailable:{get(e,{availability:t="not-available"}={}){var i;const{media:n}=e;return gt&&(null==(i=null==n?void 0:n.remote)?void 0:i.state)?null!=t&&"available"!==t?u.UNAVAILABLE:void 0:u.UNSUPPORTED},stateOwnersUpdateHandlers:[(e,t)=>{var i;const{media:n}=t;if(!n)return;return n.disableRemotePlayback||n.hasAttribute("disableremoteplayback")||null==(i=null==n?void 0:n.remote)||i.watchAvailability((t=>{e({availability:t?"available":"not-available"})})).catch((t=>{"NotSupportedError"===t.name?e({availability:null}):e({availability:"not-available"})})),()=>{var e;null==(e=null==n?void 0:n.remote)||e.cancelWatchAvailability().catch((()=>{}))}}]},mediaAirplayUnavailable:{get:(e,t)=>bt?"not-available"===(null==t?void 0:t.availability)?u.UNAVAILABLE:void 0:u.UNSUPPORTED,mediaEvents:["webkitplaybacktargetavailabilitychanged"],stateOwnersUpdateHandlers:[(e,t)=>{var i;const{media:n}=t;if(!n)return;return n.disableRemotePlayback||n.hasAttribute("disableremoteplayback")||null==(i=null==n?void 0:n.remote)||i.watchAvailability((t=>{e({availability:t?"available":"not-available"})})).catch((t=>{"NotSupportedError"===t.name?e({availability:null}):e({availability:"not-available"})})),()=>{var e;null==(e=null==n?void 0:n.remote)||e.cancelWatchAvailability().catch((()=>{}))}}]},mediaRenditionUnavailable:{get(e){var t;const{media:i}=e;return(null==i?void 0:i.videoRenditions)?(null==(t=i.videoRenditions)?void 0:t.length)?void 0:u.UNAVAILABLE:u.UNSUPPORTED},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaAudioTrackUnavailable:{get(e){var t,i;const{media:n}=e;return(null==n?void 0:n.audioTracks)?(null!=(i=null==(t=n.audioTracks)?void 0:t.length)?i:0)<=1?u.UNAVAILABLE:void 0:u.UNSUPPORTED},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaLang:{get(e){const{options:{mediaLang:t}={}}=e;return null!=t?t:"en"}}},Rt={[e.MEDIA_PREVIEW_REQUEST](e,t,{detail:i}){var n,a,s;const{media:o}=t,r=null!=i?i:void 0;let d,c;if(o&&null!=r){const[e]=nt(o,{kind:l.METADATA,label:"thumbnails"}),t=Array.prototype.find.call(null!=(n=null==e?void 0:e.cues)?n:[],((e,t,i)=>0===t?e.endTime>r:t===i.length-1?e.startTime<=r:e.startTime<=r&&e.endTime>r));if(t){const e=/'^(?:[a-z]+:)?\/\//i.test(t.text)||null==(a=null==o?void 0:o.querySelector('track[label="thumbnails"]'))?void 0:a.src,i=new URL(t.text,e);c=new URLSearchParams(i.hash).get("#xywh").split(",").map((e=>+e)),d=i.href}}const u=e.mediaDuration.get(t);let h=null==(s=e.mediaChaptersCues.get(t).find(((e,t,i)=>t===i.length-1&&u===e.endTime?e.startTime<=r&&e.endTime>=r:e.startTime<=r&&e.endTime>r)))?void 0:s.text;return null!=i&&null==h&&(h=""),{mediaPreviewTime:r,mediaPreviewImage:d,mediaPreviewCoords:c,mediaPreviewChapter:h}},[e.MEDIA_PAUSE_REQUEST](e,t){e.mediaPaused.set(!0,t)},[e.MEDIA_PLAY_REQUEST](e,t){var i,n,a,s;const o=e.mediaStreamType.get(t)===h.LIVE,r=!(null==(i=t.options)?void 0:i.noAutoSeekToLive),l=e.mediaTargetLiveWindow.get(t)>0;if(o&&r&&!l){const i=null==(n=e.mediaSeekable.get(t))?void 0:n[1];if(i){const n=i-(null!=(s=null==(a=t.options)?void 0:a.seekToLiveOffset)?s:0);e.mediaCurrentTime.set(n,t)}}e.mediaPaused.set(!1,t)},[e.MEDIA_PLAYBACK_RATE_REQUEST](e,t,{detail:i}){const n=i;e.mediaPlaybackRate.set(n,t)},[e.MEDIA_MUTE_REQUEST](e,t){e.mediaMuted.set(!0,t)},[e.MEDIA_UNMUTE_REQUEST](e,t){e.mediaVolume.get(t)||e.mediaVolume.set(.25,t),e.mediaMuted.set(!1,t)},[e.MEDIA_LOOP_REQUEST](e,t,{detail:i}){const n=!!i;return e.mediaLoop.set(n,t),{mediaLoop:n}},[e.MEDIA_VOLUME_REQUEST](e,t,{detail:i}){const n=i;n&&e.mediaMuted.get(t)&&e.mediaMuted.set(!1,t),e.mediaVolume.set(n,t)},[e.MEDIA_SEEK_REQUEST](e,t,{detail:i}){const n=i;e.mediaCurrentTime.set(n,t)},[e.MEDIA_SEEK_TO_LIVE_REQUEST](e,t){var i,n,a;const s=null==(i=e.mediaSeekable.get(t))?void 0:i[1];if(Number.isNaN(Number(s)))return;const o=s-(null!=(a=null==(n=t.options)?void 0:n.seekToLiveOffset)?a:0);e.mediaCurrentTime.set(o,t)},[e.MEDIA_SHOW_SUBTITLES_REQUEST](e,t,{detail:i}){var n;const{options:a}=t,s=At(t),o=Xe(i),r=null==(n=o[0])?void 0:n.language;r&&!a.noSubtitlesLangPref&&P.localStorage.setItem("media-chrome-pref-subtitles-lang",r),it(d.SHOWING,s,o)},[e.MEDIA_DISABLE_SUBTITLES_REQUEST](e,t,{detail:i}){const n=At(t);it(d.DISABLED,n,null!=i?i:[])},[e.MEDIA_TOGGLE_SUBTITLES_REQUEST](e,t,{detail:i}){It(t,i)},[e.MEDIA_RENDITION_REQUEST](e,t,{detail:i}){const n=i;e.mediaRenditionSelected.set(n,t)},[e.MEDIA_AUDIO_TRACK_REQUEST](e,t,{detail:i}){const n=i;e.mediaAudioTrackEnabled.set(n,t)},[e.MEDIA_ENTER_PIP_REQUEST](e,t){e.mediaIsFullscreen.get(t)&&e.mediaIsFullscreen.set(!1,t),e.mediaIsPip.set(!0,t)},[e.MEDIA_EXIT_PIP_REQUEST](e,t){e.mediaIsPip.set(!1,t)},[e.MEDIA_ENTER_FULLSCREEN_REQUEST](e,t,i){e.mediaIsPip.get(t)&&e.mediaIsPip.set(!1,t),e.mediaIsFullscreen.set(!0,t,i)},[e.MEDIA_EXIT_FULLSCREEN_REQUEST](e,t){e.mediaIsFullscreen.set(!1,t)},[e.MEDIA_ENTER_CAST_REQUEST](e,t){e.mediaIsFullscreen.get(t)&&e.mediaIsFullscreen.set(!1,t),e.mediaIsCasting.set(!0,t)},[e.MEDIA_EXIT_CAST_REQUEST](e,t){e.mediaIsCasting.set(!1,t)},[e.MEDIA_AIRPLAY_REQUEST](e,t){e.mediaIsAirplaying.set(!0,t)}},Dt=({media:e,fullscreenElement:t,documentElement:i,stateMediator:n=Lt,requestMap:a=Rt,options:s={},monitorStateOwnersOnlyWithSubscriptions:o=!0})=>{const r=[],l={options:{...s}};let d=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0});const c=e=>{null!=e&&(wt(e,d)||(d=Object.freeze({...d,...e}),r.forEach((e=>e(d)))))},u=()=>{const e=Object.entries(n).reduce(((e,[t,{get:i}])=>(e[t]=i(l),e)),{});c(e)},h={};let m;const p=async(e,t)=>{var i,a,s,d,p,E,v,b,g,A,f,I,w,y,_,T;const k=!!m;if(m={...l,...null!=m?m:{},...e},k)return;await(async(...e)=>{await Promise.all(e.filter((e=>e)).map((async e=>{if(!("localName"in e&&e instanceof P.HTMLElement))return;const t=e.localName;if(!t.includes("-"))return;const i=P.customElements.get(t);i&&e instanceof i||(await P.customElements.whenDefined(t),P.customElements.upgrade(e))})))})(...Object.values(e));const M=r.length>0&&0===t&&o,S=l.media!==m.media,L=(null==(i=l.media)?void 0:i.textTracks)!==(null==(a=m.media)?void 0:a.textTracks),R=(null==(s=l.media)?void 0:s.videoRenditions)!==(null==(d=m.media)?void 0:d.videoRenditions),D=(null==(p=l.media)?void 0:p.audioTracks)!==(null==(E=m.media)?void 0:E.audioTracks),C=(null==(v=l.media)?void 0:v.remote)!==(null==(b=m.media)?void 0:b.remote),x=l.documentElement!==m.documentElement,U=!!l.media&&(S||M),N=!!(null==(g=l.media)?void 0:g.textTracks)&&(L||M),O=!!(null==(A=l.media)?void 0:A.videoRenditions)&&(R||M),H=!!(null==(f=l.media)?void 0:f.audioTracks)&&(D||M),V=!!(null==(I=l.media)?void 0:I.remote)&&(C||M),W=!!l.documentElement&&(x||M),$=U||N||O||H||V||W,B=0===r.length&&1===t&&o,F=!!m.media&&(S||B),G=!!(null==(w=m.media)?void 0:w.textTracks)&&(L||B),q=!!(null==(y=m.media)?void 0:y.videoRenditions)&&(R||B),Q=!!(null==(_=m.media)?void 0:_.audioTracks)&&(D||B),K=!!(null==(T=m.media)?void 0:T.remote)&&(C||B),j=!!m.documentElement&&(x||B),Y=F||G||q||Q||K||j;if(!($||Y))return Object.entries(m).forEach((([e,t])=>{l[e]=t})),u(),void(m=void 0);Object.entries(n).forEach((([e,{get:t,mediaEvents:i=[],textTracksEvents:n=[],videoRenditionsEvents:a=[],audioTracksEvents:s=[],remoteEvents:o=[],rootEvents:r=[],stateOwnersUpdateHandlers:d=[]}])=>{h[e]||(h[e]={});const u=i=>{const n=t(l,i);c({[e]:n})};let p;p=h[e].mediaEvents,i.forEach((t=>{p&&U&&(l.media.removeEventListener(t,p),h[e].mediaEvents=void 0),F&&(m.media.addEventListener(t,u),h[e].mediaEvents=u)})),p=h[e].textTracksEvents,n.forEach((t=>{var i,n;p&&N&&(null==(i=l.media.textTracks)||i.removeEventListener(t,p),h[e].textTracksEvents=void 0),G&&(null==(n=m.media.textTracks)||n.addEventListener(t,u),h[e].textTracksEvents=u)})),p=h[e].videoRenditionsEvents,a.forEach((t=>{var i,n;p&&O&&(null==(i=l.media.videoRenditions)||i.removeEventListener(t,p),h[e].videoRenditionsEvents=void 0),q&&(null==(n=m.media.videoRenditions)||n.addEventListener(t,u),h[e].videoRenditionsEvents=u)})),p=h[e].audioTracksEvents,s.forEach((t=>{var i,n;p&&H&&(null==(i=l.media.audioTracks)||i.removeEventListener(t,p),h[e].audioTracksEvents=void 0),Q&&(null==(n=m.media.audioTracks)||n.addEventListener(t,u),h[e].audioTracksEvents=u)})),p=h[e].remoteEvents,o.forEach((t=>{var i,n;p&&V&&(null==(i=l.media.remote)||i.removeEventListener(t,p),h[e].remoteEvents=void 0),K&&(null==(n=m.media.remote)||n.addEventListener(t,u),h[e].remoteEvents=u)})),p=h[e].rootEvents,r.forEach((t=>{p&&W&&(l.documentElement.removeEventListener(t,p),h[e].rootEvents=void 0),j&&(m.documentElement.addEventListener(t,u),h[e].rootEvents=u)}));const E=h[e].stateOwnersUpdateHandlers;if(E&&$){(Array.isArray(E)?E:[E]).forEach((e=>{"function"==typeof e&&e()}))}if(Y){const t=d.map((e=>e(u,m))).filter((e=>"function"==typeof e));h[e].stateOwnersUpdateHandlers=1===t.length?t[0]:t}else $&&(h[e].stateOwnersUpdateHandlers=void 0)})),Object.entries(m).forEach((([e,t])=>{l[e]=t})),u(),m=void 0};return p({media:e,fullscreenElement:t,documentElement:i,options:s}),{dispatch(e){const{type:t,detail:i}=e;a[t]&&null==d.mediaErrorCode?c(a[t](n,l,e)):"mediaelementchangerequest"===t?p({media:i}):"fullscreenelementchangerequest"===t?p({fullscreenElement:i}):"documentelementchangerequest"===t?p({documentElement:i}):"optionschangerequest"===t&&(Object.entries(null!=i?i:{}).forEach((([e,t])=>{l.options[e]=t})),u())},getState:()=>d,subscribe:e=>(p({},r.length+1),r.push(e),e(d),()=>{const t=r.indexOf(e);t>=0&&(p({},r.length-1),r.splice(t,1))})}};var Ct,xt,Ut,Pt,Nt,Ot,Ht,Vt,Wt,$t,Bt,Ft,Gt,qt,Qt,Kt=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)},jt=(e,t,i)=>(Kt(e,t,"read from private field"),i?i.call(e):t.get(e)),Yt=(e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)},zt=(e,t,i,n)=>(Kt(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i),Zt=(e,t,i)=>(Kt(e,t,"access private method"),i);const Xt=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter"," ","f","m","k","c","l","j",">","<","p"],Jt="defaultsubtitles",ei="defaultstreamtype",ti="defaultduration",ii="fullscreenelement",ni="hotkeys",ai="keyboardbackwardseekoffset",si="keyboardforwardseekoffset",oi="keyboarddownvolumestep",ri="keyboardupvolumestep",li="keysused",di="lang",ci="loop",ui="liveedgeoffset",hi="noautoseektolive",mi="nodefaultstore",pi="nohotkeys",Ei="nomutedpref",vi="nosubtitleslangpref",bi="novolumepref",gi="seektoliveoffset";class Ai extends Oe{constructor(){super(),Yt(this,Vt),Yt(this,$t),Yt(this,Ft),Yt(this,qt),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,Yt(this,Ct,new Ye(this,ni)),Yt(this,xt,void 0),Yt(this,Ut,void 0),Yt(this,Pt,null),Yt(this,Nt,void 0),Yt(this,Ot,void 0),Yt(this,Ht,(e=>{var t;null==(t=jt(this,Ut))||t.dispatch(e)})),this.associateElement(this);let e={};zt(this,Nt,(t=>{Object.entries(t).forEach((([t,i])=>{if(t in e&&e[t]===i)return;this.propagateMediaState(t,i);const n=t.toLowerCase(),a=new P.CustomEvent(r[n],{composed:!0,detail:i});this.dispatchEvent(a)})),e=t})),this.hasAttribute(pi)?this.disableHotkeys():this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(pi,ni,ei,Jt,ti,Ei,bi,di,ci)}get mediaStore(){return jt(this,Ut)}set mediaStore(e){var t,i;jt(this,Ut)&&(null==(t=jt(this,Ot))||t.call(this),zt(this,Ot,void 0)),zt(this,Ut,e),jt(this,Ut)||this.hasAttribute(mi)?zt(this,Ot,null==(i=jt(this,Ut))?void 0:i.subscribe(jt(this,Nt))):Zt(this,Vt,Wt).call(this)}get fullscreenElement(){var e;return null!=(e=jt(this,xt))?e:this}set fullscreenElement(e){var t;this.hasAttribute(ii)&&this.removeAttribute(ii),zt(this,xt,e),null==(t=jt(this,Ut))||t.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}get defaultSubtitles(){return ee(this,Jt)}set defaultSubtitles(e){te(this,Jt,e)}get defaultStreamType(){return ie(this,ei)}set defaultStreamType(e){ne(this,ei,e)}get defaultDuration(){return X(this,ti)}set defaultDuration(e){J(this,ti,e)}get noHotkeys(){return ee(this,pi)}set noHotkeys(e){te(this,pi,e)}get keysUsed(){return ie(this,li)}set keysUsed(e){ne(this,li,e)}get liveEdgeOffset(){return X(this,ui)}set liveEdgeOffset(e){J(this,ui,e)}get noAutoSeekToLive(){return ee(this,hi)}set noAutoSeekToLive(e){te(this,hi,e)}get noVolumePref(){return ee(this,bi)}set noVolumePref(e){te(this,bi,e)}get noMutedPref(){return ee(this,Ei)}set noMutedPref(e){te(this,Ei,e)}get noSubtitlesLangPref(){return ee(this,vi)}set noSubtitlesLangPref(e){te(this,vi,e)}get noDefaultStore(){return ee(this,mi)}set noDefaultStore(e){te(this,mi,e)}attributeChangedCallback(t,i,n){var a,s,o,r,l,d,c,u,h,m,p,E;if(super.attributeChangedCallback(t,i,n),t===pi)n!==i&&""===n?(this.hasAttribute(ni)&&console.warn("Media Chrome: Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):n!==i&&null===n&&this.enableHotkeys();else if(t===ni)jt(this,Ct).value=n;else if(t===Jt&&n!==i)null==(a=jt(this,Ut))||a.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(Jt)}});else if(t===ei)null==(o=jt(this,Ut))||o.dispatch({type:"optionschangerequest",detail:{defaultStreamType:null!=(s=this.getAttribute(ei))?s:void 0}});else if(t===ui)null==(r=jt(this,Ut))||r.dispatch({type:"optionschangerequest",detail:{liveEdgeOffset:this.hasAttribute(ui)?+this.getAttribute(ui):void 0,seekToLiveOffset:this.hasAttribute(gi)?void 0:+this.getAttribute(ui)}});else if(t===gi)null==(l=jt(this,Ut))||l.dispatch({type:"optionschangerequest",detail:{seekToLiveOffset:this.hasAttribute(gi)?+this.getAttribute(gi):void 0}});else if(t===hi)null==(d=jt(this,Ut))||d.dispatch({type:"optionschangerequest",detail:{noAutoSeekToLive:this.hasAttribute(hi)}});else if(t===ii){const e=n?null==(c=this.getRootNode())?void 0:c.getElementById(n):void 0;zt(this,xt,e),null==(u=jt(this,Ut))||u.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}else t===di&&n!==i?(k=n,null==(h=jt(this,Ut))||h.dispatch({type:"optionschangerequest",detail:{mediaLang:n}})):t===ci&&n!==i?null==(m=jt(this,Ut))||m.dispatch({type:e.MEDIA_LOOP_REQUEST,detail:null!=n}):t===bi&&n!==i?null==(p=jt(this,Ut))||p.dispatch({type:"optionschangerequest",detail:{noVolumePref:this.hasAttribute(bi)}}):t===Ei&&n!==i&&(null==(E=jt(this,Ut))||E.dispatch({type:"optionschangerequest",detail:{noMutedPref:this.hasAttribute(Ei)}}))}connectedCallback(){var e,t;jt(this,Ut)||this.hasAttribute(mi)||Zt(this,Vt,Wt).call(this),null==(e=jt(this,Ut))||e.dispatch({type:"documentelementchangerequest",detail:N}),super.connectedCallback(),jt(this,Ut)&&!jt(this,Ot)&&zt(this,Ot,null==(t=jt(this,Ut))?void 0:t.subscribe(jt(this,Nt))),this.hasAttribute(pi)?this.disableHotkeys():this.enableHotkeys()}disconnectedCallback(){var t,i,n,a;null==(t=super.disconnectedCallback)||t.call(this),jt(this,Ut)&&(null==(i=jt(this,Ut))||i.dispatch({type:"documentelementchangerequest",detail:void 0}),null==(n=jt(this,Ut))||n.dispatch({type:e.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})),jt(this,Ot)&&(null==(a=jt(this,Ot))||a.call(this),zt(this,Ot,void 0))}mediaSetCallback(e){var t;super.mediaSetCallback(e),null==(t=jt(this,Ut))||t.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var t;super.mediaUnsetCallback(e),null==(t=jt(this,Ut))||t.dispatch({type:"mediaelementchangerequest",detail:void 0})}propagateMediaState(e,t){Mi(this.mediaStateReceivers,e,t)}associateElement(t){if(!t)return;const{associatedElementSubscriptions:i}=this;if(i.has(t))return;const n=this.registerMediaStateReceiver.bind(this),a=this.unregisterMediaStateReceiver.bind(this),s=Si(t,n,a);Object.values(e).forEach((e=>{t.addEventListener(e,jt(this,Ht))})),i.set(t,s)}unassociateElement(t){if(!t)return;const{associatedElementSubscriptions:i}=this;if(!i.has(t))return;i.get(t)(),i.delete(t),Object.values(e).forEach((e=>{t.removeEventListener(e,jt(this,Ht))}))}registerMediaStateReceiver(e){if(!e)return;const t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),jt(this,Ut)&&Object.entries(jt(this,Ut).getState()).forEach((([t,i])=>{Mi([e],t,i)})))}unregisterMediaStateReceiver(e){const t=this.mediaStateReceivers,i=t.indexOf(e);i<0||t.splice(i,1)}enableHotkeys(){this.addEventListener("keydown",Zt(this,Ft,Gt))}disableHotkeys(){this.removeEventListener("keydown",Zt(this,Ft,Gt)),this.removeEventListener("keyup",Zt(this,$t,Bt))}get hotkeys(){return ie(this,ni)}set hotkeys(e){ne(this,ni,e)}keyboardShortcutHandler(t){var i,n,a,s,o,r,l,d,c;const u=t.target;if((null!=(a=null!=(n=null==(i=u.getAttribute(li))?void 0:i.split(" "))?n:null==u?void 0:u.keysUsed)?a:[]).map((e=>"Space"===e?" ":e)).filter(Boolean).includes(t.key))return;let h,m,p;if(jt(this,Ct).contains(`no${t.key.toLowerCase()}`))return;if(" "===t.key&&jt(this,Ct).contains("nospace"))return;if(!(t.shiftKey&&("/"===t.key||"?"===t.key))||!jt(this,Ct).contains("noshift+/"))switch(t.key){case" ":case"k":h=jt(this,Ut).getState().mediaPaused?e.MEDIA_PLAY_REQUEST:e.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new P.CustomEvent(h,{composed:!0,bubbles:!0}));break;case"m":h="off"===this.mediaStore.getState().mediaVolumeLevel?e.MEDIA_UNMUTE_REQUEST:e.MEDIA_MUTE_REQUEST,this.dispatchEvent(new P.CustomEvent(h,{composed:!0,bubbles:!0}));break;case"f":h=this.mediaStore.getState().mediaIsFullscreen?e.MEDIA_EXIT_FULLSCREEN_REQUEST:e.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new P.CustomEvent(h,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new P.CustomEvent(e.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":case"j":{const t=this.hasAttribute(ai)?+this.getAttribute(ai):10;m=Math.max((null!=(s=this.mediaStore.getState().mediaCurrentTime)?s:0)-t,0),p=new P.CustomEvent(e.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:m}),this.dispatchEvent(p);break}case"ArrowRight":case"l":{const t=this.hasAttribute(si)?+this.getAttribute(si):10;m=Math.max((null!=(o=this.mediaStore.getState().mediaCurrentTime)?o:0)+t,0),p=new P.CustomEvent(e.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:m}),this.dispatchEvent(p);break}case"ArrowUp":{const t=this.hasAttribute(ri)?+this.getAttribute(ri):.025;m=Math.min((null!=(r=this.mediaStore.getState().mediaVolume)?r:1)+t,1),p=new P.CustomEvent(e.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:m}),this.dispatchEvent(p);break}case"ArrowDown":{const t=this.hasAttribute(oi)?+this.getAttribute(oi):.025;m=Math.max((null!=(l=this.mediaStore.getState().mediaVolume)?l:1)-t,0),p=new P.CustomEvent(e.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:m}),this.dispatchEvent(p);break}case"<":{const t=null!=(d=this.mediaStore.getState().mediaPlaybackRate)?d:1;m=Math.max(t-.25,.25).toFixed(2),p=new P.CustomEvent(e.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:m}),this.dispatchEvent(p);break}case">":{const t=null!=(c=this.mediaStore.getState().mediaPlaybackRate)?c:1;m=Math.min(t+.25,2).toFixed(2),p=new P.CustomEvent(e.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:m}),this.dispatchEvent(p);break}case"/":case"?":t.shiftKey&&Zt(this,qt,Qt).call(this);break;case"p":h=this.mediaStore.getState().mediaIsPip?e.MEDIA_EXIT_PIP_REQUEST:e.MEDIA_ENTER_PIP_REQUEST,p=new P.CustomEvent(h,{composed:!0,bubbles:!0}),this.dispatchEvent(p)}}}Ct=new WeakMap,xt=new WeakMap,Ut=new WeakMap,Pt=new WeakMap,Nt=new WeakMap,Ot=new WeakMap,Ht=new WeakMap,Vt=new WeakSet,Wt=function(){var e;this.mediaStore=Dt({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(Jt),defaultDuration:this.hasAttribute(ti)?+this.getAttribute(ti):void 0,defaultStreamType:null!=(e=this.getAttribute(ei))?e:void 0,liveEdgeOffset:this.hasAttribute(ui)?+this.getAttribute(ui):void 0,seekToLiveOffset:this.hasAttribute(gi)?+this.getAttribute(gi):this.hasAttribute(ui)?+this.getAttribute(ui):void 0,noAutoSeekToLive:this.hasAttribute(hi),noVolumePref:this.hasAttribute(bi),noMutedPref:this.hasAttribute(Ei),noSubtitlesLangPref:this.hasAttribute(vi)}})},$t=new WeakSet,Bt=function(e){const{key:t,shiftKey:i}=e;i&&("/"===t||"?"===t)||Xt.includes(t)?this.keyboardShortcutHandler(e):this.removeEventListener("keyup",Zt(this,$t,Bt))},Ft=new WeakSet,Gt=function(e){var t;const{metaKey:i,altKey:n,key:a,shiftKey:s}=e,o=s&&("/"===a||"?"===a);if(o&&(null==(t=jt(this,Pt))?void 0:t.open))return void this.removeEventListener("keyup",Zt(this,$t,Bt));if(i||n||!o&&!Xt.includes(a))return void this.removeEventListener("keyup",Zt(this,$t,Bt));const r=e.target,l=r instanceof HTMLElement&&("media-volume-range"===r.tagName.toLowerCase()||"media-time-range"===r.tagName.toLowerCase());![" ","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(a)||jt(this,Ct).contains(`no${a.toLowerCase()}`)||" "===a&&jt(this,Ct).contains("nospace")||l||e.preventDefault(),this.addEventListener("keyup",Zt(this,$t,Bt),{once:!0})},qt=new WeakSet,Qt=function(){jt(this,Pt)||(zt(this,Pt,N.createElement("media-keyboard-shortcuts-dialog")),this.appendChild(jt(this,Pt))),jt(this,Pt).open=!0};const fi=Object.values(a),Ii=Object.values(i),wi=e=>{var i,n,a,s;let{observedAttributes:o}=e.constructor;!o&&(null==(i=e.nodeName)?void 0:i.includes("-"))&&(P.customElements.upgrade(e),({observedAttributes:o}=e.constructor));const r=null==(s=null==(a=null==(n=null==e?void 0:e.getAttribute)?void 0:n.call(e,t.MEDIA_CHROME_ATTRIBUTES))?void 0:a.split)?void 0:s.call(a,/\s+/);return Array.isArray(o||r)?(o||r).filter((e=>fi.includes(e))):[]},yi=e=>(e=>{var t,i;return!(null==(t=e.nodeName)?void 0:t.includes("-"))||!P.customElements.get(null==(i=e.nodeName)?void 0:i.toLowerCase())||e instanceof P.customElements.get(e.nodeName.toLowerCase())||P.customElements.upgrade(e),Ii.some((t=>t in e))})(e)||!!wi(e).length,_i=e=>{var t;return null==(t=null==e?void 0:e.join)?void 0:t.call(e,":")},Ti={[a.MEDIA_SUBTITLES_LIST]:et,[a.MEDIA_SUBTITLES_SHOWING]:et,[a.MEDIA_SEEKABLE]:_i,[a.MEDIA_BUFFERED]:e=>null==e?void 0:e.map(_i).join(" "),[a.MEDIA_PREVIEW_COORDS]:e=>null==e?void 0:e.join(" "),[a.MEDIA_RENDITION_LIST]:function(e){return null==e?void 0:e.map(E).join(" ")},[a.MEDIA_AUDIO_TRACK_LIST]:function(e){return null==e?void 0:e.map(v).join(" ")}},ki=(e,t)=>{if((e=>{var t;return!!(null==(t=e.closest)?void 0:t.call(e,'*[slot="media"]'))})(e))return;const i=(e,t)=>{var i,n;yi(e)&&t(e);const{children:a=[]}=null!=e?e:{};[...a,...null!=(n=null==(i=null==e?void 0:e.shadowRoot)?void 0:i.children)?n:[]].forEach((e=>ki(e,t)))},n=null==e?void 0:e.nodeName.toLowerCase();!n.includes("-")||yi(e)?i(e,t):P.customElements.whenDefined(n).then((()=>{i(e,t)}))},Mi=(e,t,i)=>{e.forEach((e=>{if(t in e)return void(e[t]=i);const n=wi(e),a=t.toLowerCase();n.includes(a)&&(async(e,t,i)=>{var n,a;if(e.isConnected||await g(0),"boolean"==typeof i||null==i)return te(e,t,i);if("number"==typeof i)return J(e,t,i);if("string"==typeof i)return ne(e,t,i);if(Array.isArray(i)&&!i.length)return e.removeAttribute(t);const s=null!=(a=null==(n=Ti[t])?void 0:n.call(Ti,i))?a:i;e.setAttribute(t,s)})(e,a,i)}))},Si=(i,n,a)=>{ki(i,n);const s=e=>{var t;const i=null!=(t=null==e?void 0:e.composedPath()[0])?t:e.target;n(i)},o=e=>{var t;const i=null!=(t=null==e?void 0:e.composedPath()[0])?t:e.target;a(i)};i.addEventListener(e.REGISTER_MEDIA_STATE_RECEIVER,s),i.addEventListener(e.UNREGISTER_MEDIA_STATE_RECEIVER,o);let r=[];const l=e=>{const t=e.target;"media"!==t.name&&(r.forEach((e=>ki(e,a))),r=[...t.assignedElements({flatten:!0})],r.forEach((e=>ki(e,n))))};i.addEventListener("slotchange",l);const d=new MutationObserver((e=>{e.forEach((e=>{const{addedNodes:i=[],removedNodes:s=[],type:o,target:r,attributeName:l}=e;"childList"===o?(Array.prototype.forEach.call(i,(e=>ki(e,n))),Array.prototype.forEach.call(s,(e=>ki(e,a)))):"attributes"===o&&l===t.MEDIA_CHROME_ATTRIBUTES&&(yi(r)?n(r):a(r))}))}));d.observe(i,{childList:!0,attributes:!0,subtree:!0});return()=>{ki(i,a),i.removeEventListener("slotchange",l),d.disconnect(),i.removeEventListener(e.REGISTER_MEDIA_STATE_RECEIVER,s),i.removeEventListener(e.UNREGISTER_MEDIA_STATE_RECEIVER,o)}};P.customElements.get("media-controller")||P.customElements.define("media-controller",Ai);var Li=Ai;const Ri="placement",Di="bounds";class Ci extends P.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;if(!Y(this,{checkOpacity:!1,checkVisibilityCSS:!1}))return;const t=this.placement;if("left"===t||"right"===t)return void this.style.removeProperty("--media-tooltip-offset-x");const i=getComputedStyle(this),n=null!=(e=K(this,"#"+this.bounds))?e:F(this);if(!n)return;const{x:a,width:s}=n.getBoundingClientRect(),{x:o,width:r}=this.getBoundingClientRect(),l=o+r,d=a+s,c=i.getPropertyValue("--media-tooltip-offset-x"),u=c?parseFloat(c.replace("px","")):0,h=i.getPropertyValue("--media-tooltip-container-margin"),m=h?parseFloat(h.replace("px","")):0,p=o-a+u-m,E=l-d+u+m;p<0?this.style.setProperty("--media-tooltip-offset-x",`${p}px`):E>0?this.style.setProperty("--media-tooltip-offset-x",`${E}px`):this.style.removeProperty("--media-tooltip-offset-x")},!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);const e=B(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}if(this.arrowEl=this.shadowRoot.querySelector("#arrow"),Object.prototype.hasOwnProperty.call(this,"placement")){const e=this.placement;delete this.placement,this.placement=e}}static get observedAttributes(){return[Ri,Di]}get placement(){return ie(this,Ri)}set placement(e){ne(this,Ri,e)}get bounds(){return ie(this,Di)}set bounds(e){ne(this,Di,e)}}Ci.shadowRootOptions={mode:"open"},Ci.getTemplateHTML=function(e){return'\n    <style>\n      :host {\n        --_tooltip-background-color: var(--media-tooltip-background-color, var(--media-secondary-color, rgba(20, 20, 30, .7)));\n        --_tooltip-background: var(--media-tooltip-background, var(--_tooltip-background-color));\n        --_tooltip-arrow-half-width: calc(var(--media-tooltip-arrow-width, 12px) / 2);\n        --_tooltip-arrow-height: var(--media-tooltip-arrow-height, 5px);\n        --_tooltip-arrow-background: var(--media-tooltip-arrow-color, var(--_tooltip-background-color));\n        position: relative;\n        pointer-events: none;\n        display: var(--media-tooltip-display, inline-flex);\n        justify-content: center;\n        align-items: center;\n        box-sizing: border-box;\n        z-index: var(--media-tooltip-z-index, 1);\n        background: var(--_tooltip-background);\n        color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));\n        font: var(--media-font,\n          var(--media-font-weight, 400)\n          var(--media-font-size, 13px) /\n          var(--media-text-content-height, var(--media-control-height, 18px))\n          var(--media-font-family, helvetica neue, segoe ui, roboto, arial, sans-serif));\n        padding: var(--media-tooltip-padding, .35em .7em);\n        border: var(--media-tooltip-border, none);\n        border-radius: var(--media-tooltip-border-radius, 5px);\n        filter: var(--media-tooltip-filter, drop-shadow(0 0 4px rgba(0, 0, 0, .2)));\n        white-space: var(--media-tooltip-white-space, nowrap);\n      }\n\n      :host([hidden]) {\n        display: none;\n      }\n\n      img, svg {\n        display: inline-block;\n      }\n\n      #arrow {\n        position: absolute;\n        width: 0px;\n        height: 0px;\n        border-style: solid;\n        display: var(--media-tooltip-arrow-display, block);\n      }\n\n      :host(:not([placement])),\n      :host([placement="top"]) {\n        position: absolute;\n        bottom: calc(100% + var(--media-tooltip-distance, 12px));\n        left: 50%;\n        transform: translate(calc(-50% - var(--media-tooltip-offset-x, 0px)), 0);\n      }\n      :host(:not([placement])) #arrow,\n      :host([placement="top"]) #arrow {\n        top: 100%;\n        left: 50%;\n        border-width: var(--_tooltip-arrow-height) var(--_tooltip-arrow-half-width) 0 var(--_tooltip-arrow-half-width);\n        border-color: var(--_tooltip-arrow-background) transparent transparent transparent;\n        transform: translate(calc(-50% + var(--media-tooltip-offset-x, 0px)), 0);\n      }\n\n      :host([placement="right"]) {\n        position: absolute;\n        left: calc(100% + var(--media-tooltip-distance, 12px));\n        top: 50%;\n        transform: translate(0, -50%);\n      }\n      :host([placement="right"]) #arrow {\n        top: 50%;\n        right: 100%;\n        border-width: var(--_tooltip-arrow-half-width) var(--_tooltip-arrow-height) var(--_tooltip-arrow-half-width) 0;\n        border-color: transparent var(--_tooltip-arrow-background) transparent transparent;\n        transform: translate(0, -50%);\n      }\n\n      :host([placement="bottom"]) {\n        position: absolute;\n        top: calc(100% + var(--media-tooltip-distance, 12px));\n        left: 50%;\n        transform: translate(calc(-50% - var(--media-tooltip-offset-x, 0px)), 0);\n      }\n      :host([placement="bottom"]) #arrow {\n        bottom: 100%;\n        left: 50%;\n        border-width: 0 var(--_tooltip-arrow-half-width) var(--_tooltip-arrow-height) var(--_tooltip-arrow-half-width);\n        border-color: transparent transparent var(--_tooltip-arrow-background) transparent;\n        transform: translate(calc(-50% + var(--media-tooltip-offset-x, 0px)), 0);\n      }\n\n      :host([placement="left"]) {\n        position: absolute;\n        right: calc(100% + var(--media-tooltip-distance, 12px));\n        top: 50%;\n        transform: translate(0, -50%);\n      }\n      :host([placement="left"]) #arrow {\n        top: 50%;\n        left: 100%;\n        border-width: var(--_tooltip-arrow-half-width) 0 var(--_tooltip-arrow-half-width) var(--_tooltip-arrow-height);\n        border-color: transparent transparent transparent var(--_tooltip-arrow-background);\n        transform: translate(0, -50%);\n      }\n      \n      :host([placement="none"]) #arrow {\n        display: none;\n      }\n    </style>\n    <slot></slot>\n    <div id="arrow"></div>\n  '},P.customElements.get("media-tooltip")||P.customElements.define("media-tooltip",Ci);var xi,Ui,Pi,Ni,Oi,Hi,Vi,Wi=Ci,$i=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)},Bi=(e,t,i)=>($i(e,t,"read from private field"),i?i.call(e):t.get(e)),Fi=(e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)},Gi=(e,t,i,n)=>($i(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i);const qi="tooltipplacement",Qi="disabled",Ki="notooltip";class ji extends P.HTMLElement{constructor(){if(super(),Fi(this,Hi),Fi(this,xi,void 0),this.preventClick=!1,this.tooltipEl=null,Fi(this,Ui,(e=>{this.preventClick||this.handleClick(e),setTimeout(Bi(this,Pi),0)})),Fi(this,Pi,(()=>{var e,t;null==(t=null==(e=this.tooltipEl)?void 0:e.updateXOffset)||t.call(e)})),Fi(this,Ni,(e=>{const{key:t}=e;this.keysUsed.includes(t)?this.preventClick||this.handleClick(e):this.removeEventListener("keyup",Bi(this,Ni))})),Fi(this,Oi,(e=>{const{metaKey:t,altKey:i,key:n}=e;t||i||!this.keysUsed.includes(n)?this.removeEventListener("keyup",Bi(this,Ni)):this.addEventListener("keyup",Bi(this,Ni),{once:!0})})),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);const e=B(this.attributes),t=this.constructor.getTemplateHTML(e);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(t):this.shadowRoot.innerHTML=t}this.tooltipEl=this.shadowRoot.querySelector("media-tooltip")}static get observedAttributes(){return["disabled",qi,t.MEDIA_CONTROLLER,a.MEDIA_LANG]}enable(){this.addEventListener("click",Bi(this,Ui)),this.addEventListener("keydown",Bi(this,Oi)),this.tabIndex=0}disable(){this.removeEventListener("click",Bi(this,Ui)),this.removeEventListener("keydown",Bi(this,Oi)),this.removeEventListener("keyup",Bi(this,Ni)),this.tabIndex=-1}attributeChangedCallback(e,i,n){var s,o,r,l,d;e===t.MEDIA_CONTROLLER?(i&&(null==(o=null==(s=Bi(this,xi))?void 0:s.unassociateElement)||o.call(s,this),Gi(this,xi,null)),n&&this.isConnected&&(Gi(this,xi,null==(r=this.getRootNode())?void 0:r.getElementById(n)),null==(d=null==(l=Bi(this,xi))?void 0:l.associateElement)||d.call(l,this))):"disabled"===e&&n!==i?null==n?this.enable():this.disable():e===qi&&this.tooltipEl&&n!==i?this.tooltipEl.placement=n:e===a.MEDIA_LANG&&(this.shadowRoot.querySelector('slot[name="tooltip-content"]').innerHTML=this.constructor.getTooltipContentHTML()),Bi(this,Pi).call(this)}connectedCallback(){var e,i,n;const{style:a}=z(this.shadowRoot,":host");a.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),this.hasAttribute("disabled")?this.disable():this.enable(),this.setAttribute("role","button");const s=this.getAttribute(t.MEDIA_CONTROLLER);s&&(Gi(this,xi,null==(e=this.getRootNode())?void 0:e.getElementById(s)),null==(n=null==(i=Bi(this,xi))?void 0:i.associateElement)||n.call(i,this)),P.customElements.whenDefined("media-tooltip").then((()=>{return(e=this,t=Hi,i=Vi,$i(e,t,"access private method"),i).call(this);var e,t,i}))}disconnectedCallback(){var e,t;this.disable(),null==(t=null==(e=Bi(this,xi))?void 0:e.unassociateElement)||t.call(e,this),Gi(this,xi,null),this.removeEventListener("mouseenter",Bi(this,Pi)),this.removeEventListener("focus",Bi(this,Pi)),this.removeEventListener("click",Bi(this,Ui))}get keysUsed(){return["Enter"," "]}get tooltipPlacement(){return ie(this,qi)}set tooltipPlacement(e){ne(this,qi,e)}get mediaController(){return ie(this,t.MEDIA_CONTROLLER)}set mediaController(e){ne(this,t.MEDIA_CONTROLLER,e)}get disabled(){return ee(this,Qi)}set disabled(e){te(this,Qi,e)}get noTooltip(){return ee(this,Ki)}set noTooltip(e){te(this,Ki,e)}handleClick(e){}}xi=new WeakMap,Ui=new WeakMap,Pi=new WeakMap,Ni=new WeakMap,Oi=new WeakMap,Hi=new WeakSet,Vi=function(){this.addEventListener("mouseenter",Bi(this,Pi)),this.addEventListener("focus",Bi(this,Pi)),this.addEventListener("click",Bi(this,Ui));const e=this.tooltipPlacement;e&&this.tooltipEl&&(this.tooltipEl.placement=e)},ji.shadowRootOptions={mode:"open"},ji.getTemplateHTML=function(e,t={}){return`\n    <style>\n      :host {\n        position: relative;\n        font: var(--media-font,\n          var(--media-font-weight, bold)\n          var(--media-font-size, 14px) /\n          var(--media-text-content-height, var(--media-control-height, 24px))\n          var(--media-font-family, helvetica neue, segoe ui, roboto, arial, sans-serif));\n        color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));\n        background: var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7)));\n        padding: var(--media-button-padding, var(--media-control-padding, 10px));\n        justify-content: var(--media-button-justify-content, center);\n        display: inline-flex;\n        align-items: center;\n        vertical-align: middle;\n        box-sizing: border-box;\n        transition: background .15s linear;\n        pointer-events: auto;\n        cursor: var(--media-cursor, pointer);\n        -webkit-tap-highlight-color: transparent;\n      }\n\n      \n      :host(:focus-visible) {\n        box-shadow: var(--media-focus-box-shadow, inset 0 0 0 2px rgb(27 127 204 / .9));\n        outline: 0;\n      }\n      \n      :host(:where(:focus)) {\n        box-shadow: none;\n        outline: 0;\n      }\n\n      :host(:hover) {\n        background: var(--media-control-hover-background, rgba(50 50 70 / .7));\n      }\n\n      svg, img, ::slotted(svg), ::slotted(img) {\n        width: var(--media-button-icon-width);\n        height: var(--media-button-icon-height, var(--media-control-height, 24px));\n        transform: var(--media-button-icon-transform);\n        transition: var(--media-button-icon-transition);\n        fill: var(--media-icon-color, var(--media-primary-color, rgb(238 238 238)));\n        vertical-align: middle;\n        max-width: 100%;\n        max-height: 100%;\n        min-width: 100%;\n      }\n\n      media-tooltip {\n        \n        max-width: 0;\n        overflow-x: clip;\n        opacity: 0;\n        transition: opacity .3s, max-width 0s 9s;\n      }\n\n      :host(:hover) media-tooltip,\n      :host(:focus-visible) media-tooltip {\n        max-width: 100vw;\n        opacity: 1;\n        transition: opacity .3s;\n      }\n\n      :host([notooltip]) slot[name="tooltip"] {\n        display: none;\n      }\n    </style>\n\n    ${this.getSlotTemplateHTML(e,t)}\n\n    <slot name="tooltip">\n      <media-tooltip part="tooltip" aria-hidden="true">\n        <template shadowrootmode="${Wi.shadowRootOptions.mode}">\n          ${Wi.getTemplateHTML({})}\n        </template>\n        <slot name="tooltip-content">\n          ${this.getTooltipContentHTML(e)}\n        </slot>\n      </media-tooltip>\n    </slot>\n  `},ji.getSlotTemplateHTML=function(e,t){return"\n    <slot></slot>\n  "},ji.getTooltipContentHTML=function(){return""},P.customElements.get("media-chrome-button")||P.customElements.define("media-chrome-button",ji);var Yi=ji;const zi='<svg aria-hidden="true" viewBox="0 0 26 24">\n  <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"/>\n</svg>\n';const Zi=e=>{const t=e.mediaIsAirplaying?M("stop airplay"):M("start airplay");e.setAttribute("aria-label",t)};class Xi extends ji{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_IS_AIRPLAYING,a.MEDIA_AIRPLAY_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Zi(this)}attributeChangedCallback(e,t,i){super.attributeChangedCallback(e,t,i),e===a.MEDIA_IS_AIRPLAYING&&Zi(this)}get mediaIsAirplaying(){return ee(this,a.MEDIA_IS_AIRPLAYING)}set mediaIsAirplaying(e){te(this,a.MEDIA_IS_AIRPLAYING,e)}get mediaAirplayUnavailable(){return ie(this,a.MEDIA_AIRPLAY_UNAVAILABLE)}set mediaAirplayUnavailable(e){ne(this,a.MEDIA_AIRPLAY_UNAVAILABLE,e)}handleClick(){const t=new P.CustomEvent(e.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(t)}}Xi.getSlotTemplateHTML=function(e){return`\n    <style>\n      :host([${a.MEDIA_IS_AIRPLAYING}]) slot[name=icon] slot:not([name=exit]) {\n        display: none !important;\n      }\n\n      \n      :host(:not([${a.MEDIA_IS_AIRPLAYING}])) slot[name=icon] slot:not([name=enter]) {\n        display: none !important;\n      }\n\n      :host([${a.MEDIA_IS_AIRPLAYING}]) slot[name=tooltip-enter],\n      :host(:not([${a.MEDIA_IS_AIRPLAYING}])) slot[name=tooltip-exit] {\n        display: none;\n      }\n    </style>\n\n    <slot name="icon">\n      <slot name="enter">${zi}</slot>\n      <slot name="exit">${zi}</slot>\n    </slot>\n  `},Xi.getTooltipContentHTML=function(){return`\n    <slot name="tooltip-enter">${M("start airplay")}</slot>\n    <slot name="tooltip-exit">${M("stop airplay")}</slot>\n  `},P.customElements.get("media-airplay-button")||P.customElements.define("media-airplay-button",Xi);var Ji=Xi;const en=e=>{e.setAttribute("aria-checked",(e=>{var t;return!!(null==(t=e.mediaSubtitlesShowing)?void 0:t.length)||e.hasAttribute(a.MEDIA_SUBTITLES_SHOWING)})(e).toString())};class tn extends ji{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_SUBTITLES_LIST,a.MEDIA_SUBTITLES_SHOWING]}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",M("closed captions")),en(this)}attributeChangedCallback(e,t,i){super.attributeChangedCallback(e,t,i),e===a.MEDIA_SUBTITLES_SHOWING&&en(this)}get mediaSubtitlesList(){return nn(this,a.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){an(this,a.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return nn(this,a.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){an(this,a.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){this.dispatchEvent(new P.CustomEvent(e.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}))}}tn.getSlotTemplateHTML=function(e){return'\n    <style>\n      :host([aria-checked="true"]) slot[name=off] {\n        display: none !important;\n      }\n\n      \n      :host(:not([aria-checked="true"])) slot[name=on] {\n        display: none !important;\n      }\n\n      :host([aria-checked="true"]) slot[name=tooltip-enable],\n      :host(:not([aria-checked="true"])) slot[name=tooltip-disable] {\n        display: none;\n      }\n    </style>\n\n    <slot name="icon">\n      <slot name="on"><svg aria-hidden="true" viewBox="0 0 26 24">\n  <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"/>\n</svg></slot>\n      <slot name="off"><svg aria-hidden="true" viewBox="0 0 26 24">\n  <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"/>\n</svg></slot>\n    </slot>\n  '},tn.getTooltipContentHTML=function(){return`\n    <slot name="tooltip-enable">${M("Enable captions")}</slot>\n    <slot name="tooltip-disable">${M("Disable captions")}</slot>\n  `};const nn=(e,t)=>{const i=e.getAttribute(t);return i?Ze(i):[]},an=(e,t,i)=>{if(!(null==i?void 0:i.length))return void e.removeAttribute(t);const n=et(i);e.getAttribute(t)!==n&&e.setAttribute(t,n)};P.customElements.get("media-captions-button")||P.customElements.define("media-captions-button",tn);var sn=tn;const on=e=>{const t=e.mediaIsCasting?M("stop casting"):M("start casting");e.setAttribute("aria-label",t)};class rn extends ji{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_IS_CASTING,a.MEDIA_CAST_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),on(this)}attributeChangedCallback(e,t,i){super.attributeChangedCallback(e,t,i),e===a.MEDIA_IS_CASTING&&on(this)}get mediaIsCasting(){return ee(this,a.MEDIA_IS_CASTING)}set mediaIsCasting(e){te(this,a.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return ie(this,a.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){ne(this,a.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){const t=this.mediaIsCasting?e.MEDIA_EXIT_CAST_REQUEST:e.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new P.CustomEvent(t,{composed:!0,bubbles:!0}))}}rn.getSlotTemplateHTML=function(e){return`\n    <style>\n      :host([${a.MEDIA_IS_CASTING}]) slot[name=icon] slot:not([name=exit]) {\n        display: none !important;\n      }\n\n      \n      :host(:not([${a.MEDIA_IS_CASTING}])) slot[name=icon] slot:not([name=enter]) {\n        display: none !important;\n      }\n\n      :host([${a.MEDIA_IS_CASTING}]) slot[name=tooltip-enter],\n      :host(:not([${a.MEDIA_IS_CASTING}])) slot[name=tooltip-exit] {\n        display: none;\n      }\n    </style>\n\n    <slot name="icon">\n      <slot name="enter"><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></slot>\n      <slot name="exit"><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></slot>\n    </slot>\n  `},rn.getTooltipContentHTML=function(){return`\n    <slot name="tooltip-enter">${M("Start casting")}</slot>\n    <slot name="tooltip-exit">${M("Stop casting")}</slot>\n  `},P.customElements.get("media-cast-button")||P.customElements.define("media-cast-button",rn);var ln,dn,cn,un,hn,mn,pn,En,vn,bn,gn,An,fn,In,wn,yn=rn,_n=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)},Tn=(e,t,i)=>(_n(e,t,"read from private field"),i?i.call(e):t.get(e)),kn=(e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)},Mn=(e,t,i,n)=>(_n(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i),Sn=(e,t,i)=>(_n(e,t,"access private method"),i);const Ln="open",Rn="anchor";class Dn extends P.HTMLElement{constructor(){super(),kn(this,un),kn(this,mn),kn(this,En),kn(this,bn),kn(this,An),kn(this,In),kn(this,ln,!1),kn(this,dn,null),kn(this,cn,null),this.addEventListener("invoke",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this)}static get observedAttributes(){return[Ln,Rn]}get open(){return ee(this,Ln)}set open(e){te(this,Ln,e)}handleEvent(e){switch(e.type){case"invoke":Sn(this,bn,gn).call(this,e);break;case"focusout":Sn(this,An,fn).call(this,e);break;case"keydown":Sn(this,In,wn).call(this,e)}}connectedCallback(){Sn(this,un,hn).call(this),this.role||(this.role="dialog")}attributeChangedCallback(e,t,i){Sn(this,un,hn).call(this),e===Ln&&i!==t&&(this.open?Sn(this,mn,pn).call(this):Sn(this,En,vn).call(this))}focus(){Mn(this,dn,j());const e=!this.dispatchEvent(new Event("focus",{composed:!0,cancelable:!0})),t=!this.dispatchEvent(new Event("focusin",{composed:!0,bubbles:!0,cancelable:!0}));if(e||t)return;const i=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');null==i||i.focus()}get keysUsed(){return["Escape","Tab"]}}ln=new WeakMap,dn=new WeakMap,cn=new WeakMap,un=new WeakSet,hn=function(){if(!Tn(this,ln)&&(Mn(this,ln,!0),!this.shadowRoot)){this.attachShadow(this.constructor.shadowRootOptions);const e=B(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e),queueMicrotask((()=>{const{style:e}=z(this.shadowRoot,":host");e.setProperty("transition","display .15s, visibility .15s, opacity .15s ease-in, transform .15s ease-in")}))}},mn=new WeakSet,pn=function(){var e;null==(e=Tn(this,cn))||e.setAttribute("aria-expanded","true"),this.dispatchEvent(new Event("open",{composed:!0,bubbles:!0})),this.addEventListener("transitionend",(()=>this.focus()),{once:!0})},En=new WeakSet,vn=function(){var e;null==(e=Tn(this,cn))||e.setAttribute("aria-expanded","false"),this.dispatchEvent(new Event("close",{composed:!0,bubbles:!0}))},bn=new WeakSet,gn=function(e){Mn(this,cn,e.relatedTarget),Q(this,e.relatedTarget)||(this.open=!this.open)},An=new WeakSet,fn=function(e){var t;Q(this,e.relatedTarget)||(null==(t=Tn(this,dn))||t.focus(),Tn(this,cn)&&Tn(this,cn)!==e.relatedTarget&&this.open&&(this.open=!1))},In=new WeakSet,wn=function(e){var t,i,n,a,s;const{key:o,ctrlKey:r,altKey:l,metaKey:d}=e;r||l||d||this.keysUsed.includes(o)&&(e.preventDefault(),e.stopPropagation(),"Tab"===o?(e.shiftKey?null==(i=null==(t=this.previousElementSibling)?void 0:t.focus)||i.call(t):null==(a=null==(n=this.nextElementSibling)?void 0:n.focus)||a.call(n),this.blur()):"Escape"===o&&(null==(s=Tn(this,dn))||s.focus(),this.open=!1))},Dn.shadowRootOptions={mode:"open"},Dn.getTemplateHTML=function(e){return`\n    <style>\n      :host {\n        font: var(--media-font,\n          var(--media-font-weight, normal)\n          var(--media-font-size, 14px) /\n          var(--media-text-content-height, var(--media-control-height, 24px))\n          var(--media-font-family, helvetica neue, segoe ui, roboto, arial, sans-serif));\n        color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));\n        display: var(--media-dialog-display, inline-flex);\n        justify-content: center;\n        align-items: center;\n        \n        transition-behavior: allow-discrete;\n        visibility: hidden;\n        opacity: 0;\n        transform: translateY(2px) scale(.99);\n        pointer-events: none;\n      }\n\n      :host([open]) {\n        transition: display .2s, visibility 0s, opacity .2s ease-out, transform .15s ease-out;\n        visibility: visible;\n        opacity: 1;\n        transform: translateY(0) scale(1);\n        pointer-events: auto;\n      }\n\n      #content {\n        display: flex;\n        position: relative;\n        box-sizing: border-box;\n        width: min(320px, 100%);\n        word-wrap: break-word;\n        max-height: 100%;\n        overflow: auto;\n        text-align: center;\n        line-height: 1.4;\n      }\n    </style>\n    ${this.getSlotTemplateHTML(e)}\n  `},Dn.getSlotTemplateHTML=function(e){return'\n    <slot id="content"></slot>\n  '},P.customElements.get("media-chrome-dialog")||P.customElements.define("media-chrome-dialog",Dn);var Cn,xn,Un,Pn,Nn,On,Hn,Vn,Wn,$n,Bn,Fn,Gn,qn,Qn,Kn,jn,Yn,zn,Zn,Xn,Jn,ea,ta,ia,na=Dn,aa=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)},sa=(e,t,i)=>(aa(e,t,"read from private field"),i?i.call(e):t.get(e)),oa=(e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)},ra=(e,t,i,n)=>(aa(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i),la=(e,t,i)=>(aa(e,t,"access private method"),i);class da extends P.HTMLElement{constructor(){if(super(),oa(this,$n),oa(this,Fn),oa(this,qn),oa(this,Kn),oa(this,Yn),oa(this,Zn),oa(this,Jn),oa(this,ta),oa(this,Cn,void 0),oa(this,xn,void 0),oa(this,Un,void 0),oa(this,Pn,void 0),oa(this,Nn,{}),oa(this,On,[]),oa(this,Hn,(()=>{if(this.range.matches(":focus-visible")){const{style:e}=z(this.shadowRoot,":host");e.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}})),oa(this,Vn,(()=>{const{style:e}=z(this.shadowRoot,":host");e.removeProperty("--_focus-visible-box-shadow")})),oa(this,Wn,(()=>{const e=this.shadowRoot.querySelector("#segments-clipping");e&&e.parentNode.append(e)})),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);const e=B(this.attributes),t=this.constructor.getTemplateHTML(e);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(t):this.shadowRoot.innerHTML=t}this.container=this.shadowRoot.querySelector("#container"),ra(this,Un,this.shadowRoot.querySelector("#startpoint")),ra(this,Pn,this.shadowRoot.querySelector("#endpoint")),this.range=this.shadowRoot.querySelector("#range"),this.appearance=this.shadowRoot.querySelector("#appearance")}static get observedAttributes(){return["disabled","aria-disabled",t.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,n){var a,s,o,r,l;e===t.MEDIA_CONTROLLER?(i&&(null==(s=null==(a=sa(this,Cn))?void 0:a.unassociateElement)||s.call(a,this),ra(this,Cn,null)),n&&this.isConnected&&(ra(this,Cn,null==(o=this.getRootNode())?void 0:o.getElementById(n)),null==(l=null==(r=sa(this,Cn))?void 0:r.associateElement)||l.call(r,this))):("disabled"===e||"aria-disabled"===e&&i!==n)&&(null==n?(this.range.removeAttribute(e),la(this,Fn,Gn).call(this)):(this.range.setAttribute(e,n),la(this,qn,Qn).call(this)))}connectedCallback(){var e,i,n;const{style:a}=z(this.shadowRoot,":host");a.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),sa(this,Nn).pointer=z(this.shadowRoot,"#pointer"),sa(this,Nn).progress=z(this.shadowRoot,"#progress"),sa(this,Nn).thumb=z(this.shadowRoot,'#thumb, ::slotted([slot="thumb"])'),sa(this,Nn).activeSegment=z(this.shadowRoot,"#segments-clipping rect:nth-child(0)");const s=this.getAttribute(t.MEDIA_CONTROLLER);s&&(ra(this,Cn,null==(e=this.getRootNode())?void 0:e.getElementById(s)),null==(n=null==(i=sa(this,Cn))?void 0:i.associateElement)||n.call(i,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",sa(this,Hn)),this.shadowRoot.addEventListener("focusout",sa(this,Vn)),la(this,Fn,Gn).call(this),W(this.container,sa(this,Wn))}disconnectedCallback(){var e,t;la(this,qn,Qn).call(this),null==(t=null==(e=sa(this,Cn))?void 0:e.unassociateElement)||t.call(e,this),ra(this,Cn,null),this.shadowRoot.removeEventListener("focusin",sa(this,Hn)),this.shadowRoot.removeEventListener("focusout",sa(this,Vn)),$(this.container,sa(this,Wn))}updatePointerBar(e){var t;null==(t=sa(this,Nn).pointer)||t.style.setProperty("width",100*this.getPointerRatio(e)+"%")}updateBar(){var e,t;const i=100*this.range.valueAsNumber;null==(e=sa(this,Nn).progress)||e.style.setProperty("width",`${i}%`),null==(t=sa(this,Nn).thumb)||t.style.setProperty("left",`${i}%`)}updateSegments(e){const t=this.shadowRoot.querySelector("#segments-clipping");if(t.textContent="",this.container.classList.toggle("segments",!!(null==e?void 0:e.length)),!(null==e?void 0:e.length))return;const i=[...new Set([+this.range.min,...e.flatMap((e=>[e.start,e.end])),+this.range.max])];ra(this,On,[...i]);const n=i.pop();for(const[e,a]of i.entries()){const[s,o]=[0===e,e===i.length-1],r=s?"calc(var(--segments-gap) / -1)":100*a+"%",l=`calc(${100*((o?n:i[e+1])-a)}%${s||o?"":" - var(--segments-gap)"})`,d=N.createElementNS("http://www.w3.org/2000/svg","rect"),c=Z(this.shadowRoot,`#segments-clipping rect:nth-child(${e+1})`);c.style.setProperty("x",r),c.style.setProperty("width",l),t.append(d)}}getPointerRatio(e){return function(e,t,i,n){const a=n.x-i.x,s=n.y-i.y,o=a*a+s*s;if(0===o)return 0;const r=((e-i.x)*a+(t-i.y)*s)/o;return Math.max(0,Math.min(1,r))}(e.clientX,e.clientY,sa(this,Un).getBoundingClientRect(),sa(this,Pn).getBoundingClientRect())}get dragging(){return this.hasAttribute("dragging")}handleEvent(e){switch(e.type){case"pointermove":la(this,ta,ia).call(this,e);break;case"input":this.updateBar();break;case"pointerenter":la(this,Yn,zn).call(this,e);break;case"pointerdown":la(this,Kn,jn).call(this,e);break;case"pointerup":la(this,Zn,Xn).call(this);break;case"pointerleave":la(this,Jn,ea).call(this)}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}}Cn=new WeakMap,xn=new WeakMap,Un=new WeakMap,Pn=new WeakMap,Nn=new WeakMap,On=new WeakMap,Hn=new WeakMap,Vn=new WeakMap,Wn=new WeakMap,$n=new WeakSet,Bn=function(e){const t=sa(this,Nn).activeSegment;if(!t)return;const i=this.getPointerRatio(e),n=`#segments-clipping rect:nth-child(${sa(this,On).findIndex(((e,t,n)=>{const a=n[t+1];return null!=a&&i>=e&&i<=a}))+1})`;t.selectorText==n&&t.style.transform||(t.selectorText=n,t.style.setProperty("transform","var(--media-range-segment-hover-transform, scaleY(2))"))},Fn=new WeakSet,Gn=function(){this.hasAttribute("disabled")||(this.addEventListener("input",this),this.addEventListener("pointerdown",this),this.addEventListener("pointerenter",this))},qn=new WeakSet,Qn=function(){var e,t;this.removeEventListener("input",this),this.removeEventListener("pointerdown",this),this.removeEventListener("pointerenter",this),null==(e=P.window)||e.removeEventListener("pointerup",this),null==(t=P.window)||t.removeEventListener("pointermove",this)},Kn=new WeakSet,jn=function(e){var t;ra(this,xn,e.composedPath().includes(this.range)),null==(t=P.window)||t.addEventListener("pointerup",this)},Yn=new WeakSet,zn=function(e){var t;"mouse"!==e.pointerType&&la(this,Kn,jn).call(this,e),this.addEventListener("pointerleave",this),null==(t=P.window)||t.addEventListener("pointermove",this)},Zn=new WeakSet,Xn=function(){var e;null==(e=P.window)||e.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")},Jn=new WeakSet,ea=function(){var e,t;this.removeEventListener("pointerleave",this),null==(e=P.window)||e.removeEventListener("pointermove",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled"),null==(t=sa(this,Nn).activeSegment)||t.style.removeProperty("transform")},ta=new WeakSet,ia=function(e){"pen"===e.pointerType&&0===e.buttons||(this.toggleAttribute("dragging",1===e.buttons||"mouse"!==e.pointerType),this.updatePointerBar(e),la(this,$n,Bn).call(this,e),!this.dragging||"mouse"===e.pointerType&&sa(this,xn)||(this.range.disabled=!0,this.range.valueAsNumber=this.getPointerRatio(e),this.range.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))))},da.shadowRootOptions={mode:"open"},da.getTemplateHTML=function(e){return'\n    <style>\n      :host {\n        --_focus-box-shadow: var(--media-focus-box-shadow, inset 0 0 0 2px rgb(27 127 204 / .9));\n        --_media-range-padding: var(--media-range-padding, var(--media-control-padding, 10px));\n\n        box-shadow: var(--_focus-visible-box-shadow, none);\n        background: var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7)));\n        height: calc(var(--media-control-height, 24px) + 2 * var(--_media-range-padding));\n        display: inline-flex;\n        align-items: center;\n        \n        vertical-align: middle;\n        box-sizing: border-box;\n        position: relative;\n        width: 100px;\n        transition: background .15s linear;\n        cursor: var(--media-cursor, pointer);\n        pointer-events: auto;\n        touch-action: none; \n      }\n\n      \n      input[type=range]:focus {\n        outline: 0;\n      }\n      input[type=range]:focus::-webkit-slider-runnable-track {\n        outline: 0;\n      }\n\n      :host(:hover) {\n        background: var(--media-control-hover-background, rgb(50 50 70 / .7));\n      }\n\n      #leftgap {\n        padding-left: var(--media-range-padding-left, var(--_media-range-padding));\n      }\n\n      #rightgap {\n        padding-right: var(--media-range-padding-right, var(--_media-range-padding));\n      }\n\n      #startpoint,\n      #endpoint {\n        position: absolute;\n      }\n\n      #endpoint {\n        right: 0;\n      }\n\n      #container {\n        \n        width: var(--media-range-track-width, 100%);\n        transform: translate(var(--media-range-track-translate-x, 0px), var(--media-range-track-translate-y, 0px));\n        position: relative;\n        height: 100%;\n        display: flex;\n        align-items: center;\n        min-width: 40px;\n      }\n\n      #range {\n        \n        display: var(--media-time-range-hover-display, block);\n        bottom: var(--media-time-range-hover-bottom, -7px);\n        height: var(--media-time-range-hover-height, max(100% + 7px, 25px));\n        width: 100%;\n        position: absolute;\n        cursor: var(--media-cursor, pointer);\n\n        -webkit-appearance: none; \n        -webkit-tap-highlight-color: transparent;\n        background: transparent; \n        margin: 0;\n        z-index: 1;\n      }\n\n      @media (hover: hover) {\n        #range {\n          bottom: var(--media-time-range-hover-bottom, -5px);\n          height: var(--media-time-range-hover-height, max(100% + 5px, 20px));\n        }\n      }\n\n      \n      \n      #range::-webkit-slider-thumb {\n        -webkit-appearance: none;\n        background: transparent;\n        width: .1px;\n        height: .1px;\n      }\n\n      \n      #range::-moz-range-thumb {\n        background: transparent;\n        border: transparent;\n        width: .1px;\n        height: .1px;\n      }\n\n      #appearance {\n        height: var(--media-range-track-height, 4px);\n        display: flex;\n        flex-direction: column;\n        justify-content: center;\n        width: 100%;\n        position: absolute;\n        \n        will-change: transform;\n      }\n\n      #track {\n        background: var(--media-range-track-background, rgb(255 255 255 / .2));\n        border-radius: var(--media-range-track-border-radius, 1px);\n        border: var(--media-range-track-border, none);\n        outline: var(--media-range-track-outline);\n        outline-offset: var(--media-range-track-outline-offset);\n        backdrop-filter: var(--media-range-track-backdrop-filter);\n        -webkit-backdrop-filter: var(--media-range-track-backdrop-filter);\n        box-shadow: var(--media-range-track-box-shadow, none);\n        position: absolute;\n        width: 100%;\n        height: 100%;\n        overflow: hidden;\n      }\n\n      #progress,\n      #pointer {\n        position: absolute;\n        height: 100%;\n        will-change: width;\n      }\n\n      #progress {\n        background: var(--media-range-bar-color, var(--media-primary-color, rgb(238 238 238)));\n        transition: var(--media-range-track-transition);\n      }\n\n      #pointer {\n        background: var(--media-range-track-pointer-background);\n        border-right: var(--media-range-track-pointer-border-right);\n        transition: visibility .25s, opacity .25s;\n        visibility: hidden;\n        opacity: 0;\n      }\n\n      @media (hover: hover) {\n        :host(:hover) #pointer {\n          transition: visibility .5s, opacity .5s;\n          visibility: visible;\n          opacity: 1;\n        }\n      }\n\n      #thumb,\n      ::slotted([slot=thumb]) {\n        width: var(--media-range-thumb-width, 10px);\n        height: var(--media-range-thumb-height, 10px);\n        transition: var(--media-range-thumb-transition);\n        transform: var(--media-range-thumb-transform, none);\n        opacity: var(--media-range-thumb-opacity, 1);\n        translate: -50%;\n        position: absolute;\n        left: 0;\n        cursor: var(--media-cursor, pointer);\n      }\n\n      #thumb {\n        border-radius: var(--media-range-thumb-border-radius, 10px);\n        background: var(--media-range-thumb-background, var(--media-primary-color, rgb(238 238 238)));\n        box-shadow: var(--media-range-thumb-box-shadow, 1px 1px 1px transparent);\n        border: var(--media-range-thumb-border, none);\n      }\n\n      :host([disabled]) #thumb {\n        background-color: #777;\n      }\n\n      .segments #appearance {\n        height: var(--media-range-segment-hover-height, 7px);\n      }\n\n      #track {\n        clip-path: url(#segments-clipping);\n      }\n\n      #segments {\n        --segments-gap: var(--media-range-segments-gap, 2px);\n        position: absolute;\n        width: 100%;\n        height: 100%;\n      }\n\n      #segments-clipping {\n        transform: translateX(calc(var(--segments-gap) / 2));\n      }\n\n      #segments-clipping:empty {\n        display: none;\n      }\n\n      #segments-clipping rect {\n        height: var(--media-range-track-height, 4px);\n        y: calc((var(--media-range-segment-hover-height, 7px) - var(--media-range-track-height, 4px)) / 2);\n        transition: var(--media-range-segment-transition, transform .1s ease-in-out);\n        transform: var(--media-range-segment-transform, scaleY(1));\n        transform-origin: center;\n      }\n    </style>\n    <div id="leftgap"></div>\n    <div id="container">\n      <div id="startpoint"></div>\n      <div id="endpoint"></div>\n      <div id="appearance">\n        <div id="track" part="track">\n          <div id="pointer"></div>\n          <div id="progress" part="progress"></div>\n        </div>\n        <slot name="thumb">\n          <div id="thumb" part="thumb"></div>\n        </slot>\n        <svg id="segments"><clipPath id="segments-clipping"></clipPath></svg>\n      </div>\n      <input id="range" type="range" min="0" max="1" step="any" value="0">\n    </div>\n    <div id="rightgap"></div>\n  '},P.customElements.get("media-chrome-range")||P.customElements.define("media-chrome-range",da);var ca,ua=da,ha=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)},ma=(e,t,i)=>(ha(e,t,"read from private field"),i?i.call(e):t.get(e)),pa=(e,t,i,n)=>(ha(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i);class Ea extends P.HTMLElement{constructor(){if(super(),((e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)})(this,ca,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);const e=B(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[t.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,n){var a,s,o,r,l;e===t.MEDIA_CONTROLLER&&(i&&(null==(s=null==(a=ma(this,ca))?void 0:a.unassociateElement)||s.call(a,this),pa(this,ca,null)),n&&this.isConnected&&(pa(this,ca,null==(o=this.getRootNode())?void 0:o.getElementById(n)),null==(l=null==(r=ma(this,ca))?void 0:r.associateElement)||l.call(r,this)))}connectedCallback(){var e,i,n;const a=this.getAttribute(t.MEDIA_CONTROLLER);a&&(pa(this,ca,null==(e=this.getRootNode())?void 0:e.getElementById(a)),null==(n=null==(i=ma(this,ca))?void 0:i.associateElement)||n.call(i,this))}disconnectedCallback(){var e,t;null==(t=null==(e=ma(this,ca))?void 0:e.unassociateElement)||t.call(e,this),pa(this,ca,null)}}ca=new WeakMap,Ea.shadowRootOptions={mode:"open"},Ea.getTemplateHTML=function(e){return'\n    <style>\n      :host {\n        \n        box-sizing: border-box;\n        display: var(--media-control-display, var(--media-control-bar-display, inline-flex));\n        color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));\n        --media-loading-indicator-icon-height: 44px;\n      }\n\n      ::slotted(media-time-range),\n      ::slotted(media-volume-range) {\n        min-height: 100%;\n      }\n\n      ::slotted(media-time-range),\n      ::slotted(media-clip-selector) {\n        flex-grow: 1;\n      }\n\n      ::slotted([role="menu"]) {\n        position: absolute;\n      }\n    </style>\n\n    <slot></slot>\n  '},P.customElements.get("media-control-bar")||P.customElements.define("media-control-bar",Ea);var va,ba=Ea,ga=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)},Aa=(e,t,i)=>(ga(e,t,"read from private field"),i?i.call(e):t.get(e)),fa=(e,t,i,n)=>(ga(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i);class Ia extends P.HTMLElement{constructor(){if(super(),((e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)})(this,va,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);const e=B(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[t.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,n){var a,s,o,r,l;e===t.MEDIA_CONTROLLER&&(i&&(null==(s=null==(a=Aa(this,va))?void 0:a.unassociateElement)||s.call(a,this),fa(this,va,null)),n&&this.isConnected&&(fa(this,va,null==(o=this.getRootNode())?void 0:o.getElementById(n)),null==(l=null==(r=Aa(this,va))?void 0:r.associateElement)||l.call(r,this)))}connectedCallback(){var e,i,n;const{style:a}=z(this.shadowRoot,":host");a.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`);const s=this.getAttribute(t.MEDIA_CONTROLLER);s&&(fa(this,va,null==(e=this.getRootNode())?void 0:e.getElementById(s)),null==(n=null==(i=Aa(this,va))?void 0:i.associateElement)||n.call(i,this))}disconnectedCallback(){var e,t;null==(t=null==(e=Aa(this,va))?void 0:e.unassociateElement)||t.call(e,this),fa(this,va,null)}}va=new WeakMap,Ia.shadowRootOptions={mode:"open"},Ia.getTemplateHTML=function(e,t={}){return`\n    <style>\n      :host {\n        font: var(--media-font,\n          var(--media-font-weight, normal)\n          var(--media-font-size, 14px) /\n          var(--media-text-content-height, var(--media-control-height, 24px))\n          var(--media-font-family, helvetica neue, segoe ui, roboto, arial, sans-serif));\n        color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));\n        background: var(--media-text-background, var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7))));\n        padding: var(--media-control-padding, 10px);\n        display: inline-flex;\n        justify-content: center;\n        align-items: center;\n        vertical-align: middle;\n        box-sizing: border-box;\n        text-align: center;\n        pointer-events: auto;\n      }\n\n      \n      :host(:focus-visible) {\n        box-shadow: inset 0 0 0 2px rgb(27 127 204 / .9);\n        outline: 0;\n      }\n\n      \n      :host(:where(:focus)) {\n        box-shadow: none;\n        outline: 0;\n      }\n    </style>\n\n    ${this.getSlotTemplateHTML(e,t)}\n  `},Ia.getSlotTemplateHTML=function(e,t){return"\n    <slot></slot>\n  "},P.customElements.get("media-text-display")||P.customElements.define("media-text-display",Ia);var wa,ya=Ia,_a=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)},Ta=(e,t,i)=>(_a(e,t,"read from private field"),i?i.call(e):t.get(e));class ka extends Ia{constructor(){var e,t,i,n,a;super(),((e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)})(this,wa,void 0),t=this,i=wa,n=this.shadowRoot.querySelector("slot"),_a(t,i,"write to private field"),a?a.call(t,n):i.set(t,n),Ta(this,wa).textContent=I(null!=(e=this.mediaDuration)?e:0)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_DURATION]}attributeChangedCallback(e,t,i){e===a.MEDIA_DURATION&&(Ta(this,wa).textContent=I(+i)),super.attributeChangedCallback(e,t,i)}get mediaDuration(){return X(this,a.MEDIA_DURATION)}set mediaDuration(e){J(this,a.MEDIA_DURATION,e)}}wa=new WeakMap,ka.getSlotTemplateHTML=function(e,t){return`\n    <slot>${I(t.mediaDuration)}</slot>\n  `},P.customElements.get("media-duration-display")||P.customElements.define("media-duration-display",ka);var Ma=ka;const Sa={2:M("Network Error"),3:M("Decode Error"),4:M("Source Not Supported"),5:M("Encryption Error")},La={2:M("A network error caused the media download to fail."),3:M("A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format."),4:M("An unsupported error occurred. The server or network failed, or your browser does not support this format."),5:M("The media is encrypted and there are no keys to decrypt it.")},Ra=e=>{var t,i;return 1===e.code?null:{title:null!=(t=Sa[e.code])?t:`Error ${e.code}`,message:null!=(i=La[e.code])?i:e.message}};var Da,Ca=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)};function xa(e){var t;const{title:i,message:n}=null!=(t=Ra(e))?t:{};let a="";return i&&(a+=`<slot name="error-${e.code}-title"><h3>${i}</h3></slot>`),n&&(a+=`<slot name="error-${e.code}-message"><p>${n}</p></slot>`),a}const Ua=[a.MEDIA_ERROR_CODE,a.MEDIA_ERROR_MESSAGE];class Pa extends Dn{constructor(){super(...arguments),((e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)})(this,Da,null)}static get observedAttributes(){return[...super.observedAttributes,...Ua]}formatErrorMessage(e){return this.constructor.formatErrorMessage(e)}attributeChangedCallback(e,t,i){var n;if(super.attributeChangedCallback(e,t,i),!Ua.includes(e))return;const a=null!=(n=this.mediaError)?n:{code:this.mediaErrorCode,message:this.mediaErrorMessage};var s;this.open=(s=a).code&&null!==Ra(s),this.open&&(this.shadowRoot.querySelector("slot").name=`error-${this.mediaErrorCode}`,this.shadowRoot.querySelector("#content").innerHTML=this.formatErrorMessage(a))}get mediaError(){return Ca(e=this,t=Da,"read from private field"),i?i.call(e):t.get(e);var e,t,i}set mediaError(e){((e,t,i,n)=>{Ca(e,t,"write to private field"),n?n.call(e,i):t.set(e,i)})(this,Da,e)}get mediaErrorCode(){return X(this,"mediaerrorcode")}set mediaErrorCode(e){J(this,"mediaerrorcode",e)}get mediaErrorMessage(){return ie(this,"mediaerrormessage")}set mediaErrorMessage(e){ne(this,"mediaerrormessage",e)}}Da=new WeakMap,Pa.getSlotTemplateHTML=function(e){return`\n    <style>\n      :host {\n        background: rgb(20 20 30 / .8);\n      }\n\n      #content {\n        display: block;\n        padding: 1.2em 1.5em;\n      }\n\n      h3,\n      p {\n        margin-block: 0 .3em;\n      }\n    </style>\n    <slot name="error-${e.mediaerrorcode}" id="content">\n      ${xa({code:+e.mediaerrorcode,message:e.mediaerrormessage})}\n    </slot>\n  `},Pa.formatErrorMessage=xa,P.customElements.get("media-error-dialog")||P.customElements.define("media-error-dialog",Pa);var Na,Oa,Ha=Pa,Va=(e,t,i)=>(((e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)})(e,t,"read from private field"),i?i.call(e):t.get(e)),Wa=(e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)};class $a extends Dn{constructor(){super(...arguments),Wa(this,Na,(e=>{var t;if(!this.open)return;const i=null==(t=this.shadowRoot)?void 0:t.querySelector("#content");if(!i)return;const n=e.composedPath(),a=n[0]===this||n.includes(this),s=n.includes(i);a&&!s&&(this.open=!1)})),Wa(this,Oa,(e=>{if(!this.open)return;const t=e.shiftKey&&("/"===e.key||"?"===e.key);"Escape"!==e.key&&!t||e.ctrlKey||e.altKey||e.metaKey||(this.open=!1,e.preventDefault(),e.stopPropagation())}))}connectedCallback(){super.connectedCallback(),this.open&&(this.addEventListener("click",Va(this,Na)),document.addEventListener("keydown",Va(this,Oa)))}disconnectedCallback(){this.removeEventListener("click",Va(this,Na)),document.removeEventListener("keydown",Va(this,Oa))}attributeChangedCallback(e,t,i){super.attributeChangedCallback(e,t,i),"open"===e&&(this.open?(this.addEventListener("click",Va(this,Na)),document.addEventListener("keydown",Va(this,Oa))):(this.removeEventListener("click",Va(this,Na)),document.removeEventListener("keydown",Va(this,Oa))))}}Na=new WeakMap,Oa=new WeakMap,$a.getSlotTemplateHTML=function(e){return`\n    <style>\n      :host {\n        position: fixed;\n        top: 0;\n        left: 0;\n        z-index: 9999;\n        background: rgb(20 20 30 / .8);\n        backdrop-filter: blur(10px);\n      }\n\n      #content {\n        display: block;\n        width: clamp(400px, 40vw, 700px);\n        max-width: 90vw;\n        text-align: left;\n      }\n\n      h2 {\n        margin: 0 0 1.5rem 0;\n        font-size: 1.5rem;\n        font-weight: 500;\n        text-align: center;\n      }\n\n      .shortcuts-table {\n        width: 100%;\n        border-collapse: collapse;\n      }\n\n      .shortcuts-table tr {\n        border-bottom: 1px solid rgba(255, 255, 255, 0.1);\n      }\n\n      .shortcuts-table tr:last-child {\n        border-bottom: none;\n      }\n\n      .shortcuts-table td {\n        padding: 0.75rem 0.5rem;\n      }\n\n      .shortcuts-table td:first-child {\n        text-align: right;\n        padding-right: 1rem;\n        width: 40%;\n        min-width: 120px;\n      }\n\n      .shortcuts-table td:last-child {\n        padding-left: 1rem;\n      }\n\n      .key {\n        display: inline-block;\n        background: rgba(255, 255, 255, 0.15);\n        border: 1px solid rgba(255, 255, 255, 0.2);\n        border-radius: 4px;\n        padding: 0.25rem 0.5rem;\n        font-family: 'Courier New', monospace;\n        font-size: 0.9rem;\n        font-weight: 500;\n        min-width: 1.5rem;\n        text-align: center;\n        margin: 0 0.2rem;\n      }\n\n      .description {\n        color: rgba(255, 255, 255, 0.9);\n        font-size: 0.95rem;\n      }\n\n      .key-combo {\n        display: flex;\n        align-items: center;\n        justify-content: flex-end;\n        gap: 0.3rem;\n      }\n\n      .key-separator {\n        color: rgba(255, 255, 255, 0.5);\n        font-size: 0.9rem;\n      }\n    </style>\n    <slot id="content">\n      \n    <h2>Keyboard Shortcuts</h2>\n    <table class="shortcuts-table">${[{keys:["Space","k"],description:"Toggle Playback"},{keys:["m"],description:"Toggle mute"},{keys:["f"],description:"Toggle fullscreen"},{keys:["c"],description:"Toggle captions or subtitles, if available"},{keys:["p"],description:"Toggle Picture in Picture"},{keys:["←","j"],description:"Seek back 10s"},{keys:["→","l"],description:"Seek forward 10s"},{keys:["↑"],description:"Turn volume up"},{keys:["↓"],description:"Turn volume down"},{keys:["< (SHIFT+,)"],description:"Decrease playback rate"},{keys:["> (SHIFT+.)"],description:"Increase playback rate"}].map((({keys:e,description:t})=>`\n      <tr>\n        <td>\n          <div class="key-combo">${e.map(((e,t)=>t>0?`<span class="key-separator">or</span><span class="key">${e}</span>`:`<span class="key">${e}</span>`)).join("")}</div>\n        </td>\n        <td class="description">${t}</td>\n      </tr>\n    `)).join("")}</table>\n  \n    </slot>\n  `},P.customElements.get("media-keyboard-shortcuts-dialog")||P.customElements.define("media-keyboard-shortcuts-dialog",$a);var Ba,Fa=$a,Ga=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)};const qa=e=>{const t=e.mediaIsFullscreen?M("exit fullscreen mode"):M("enter fullscreen mode");e.setAttribute("aria-label",t)};class Qa extends ji{constructor(){super(...arguments),((e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)})(this,Ba,null)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_IS_FULLSCREEN,a.MEDIA_FULLSCREEN_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),qa(this)}attributeChangedCallback(e,t,i){super.attributeChangedCallback(e,t,i),e===a.MEDIA_IS_FULLSCREEN&&qa(this)}get mediaFullscreenUnavailable(){return ie(this,a.MEDIA_FULLSCREEN_UNAVAILABLE)}set mediaFullscreenUnavailable(e){ne(this,a.MEDIA_FULLSCREEN_UNAVAILABLE,e)}get mediaIsFullscreen(){return ee(this,a.MEDIA_IS_FULLSCREEN)}set mediaIsFullscreen(e){te(this,a.MEDIA_IS_FULLSCREEN,e)}handleClick(t){var i,n,a,s;a=t,Ga(i=this,n=Ba,"write to private field"),s?s.call(i,a):n.set(i,a);const o=((e,t,i)=>(Ga(e,t,"read from private field"),i?i.call(e):t.get(e)))(this,Ba)instanceof PointerEvent,r=this.mediaIsFullscreen?new P.CustomEvent(e.MEDIA_EXIT_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0}):new P.CustomEvent(e.MEDIA_ENTER_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0,detail:o});this.dispatchEvent(r)}}Ba=new WeakMap,Qa.getSlotTemplateHTML=function(e){return`\n    <style>\n      :host([${a.MEDIA_IS_FULLSCREEN}]) slot[name=icon] slot:not([name=exit]) {\n        display: none !important;\n      }\n\n      \n      :host(:not([${a.MEDIA_IS_FULLSCREEN}])) slot[name=icon] slot:not([name=enter]) {\n        display: none !important;\n      }\n\n      :host([${a.MEDIA_IS_FULLSCREEN}]) slot[name=tooltip-enter],\n      :host(:not([${a.MEDIA_IS_FULLSCREEN}])) slot[name=tooltip-exit] {\n        display: none;\n      }\n    </style>\n\n    <slot name="icon">\n      <slot name="enter"><svg aria-hidden="true" viewBox="0 0 26 24">\n  <path d="M16 3v2.5h3.5V9H22V3h-6ZM4 9h2.5V5.5H10V3H4v6Zm15.5 9.5H16V21h6v-6h-2.5v3.5ZM6.5 15H4v6h6v-2.5H6.5V15Z"/>\n</svg></slot>\n      <slot name="exit"><svg aria-hidden="true" viewBox="0 0 26 24">\n  <path d="M18.5 6.5V3H16v6h6V6.5h-3.5ZM16 21h2.5v-3.5H22V15h-6v6ZM4 17.5h3.5V21H10v-6H4v2.5Zm3.5-11H4V9h6V3H7.5v3.5Z"/>\n</svg></slot>\n    </slot>\n  `},Qa.getTooltipContentHTML=function(){return`\n    <slot name="tooltip-enter">${M("Enter fullscreen mode")}</slot>\n    <slot name="tooltip-exit">${M("Exit fullscreen mode")}</slot>\n  `},P.customElements.get("media-fullscreen-button")||P.customElements.define("media-fullscreen-button",Qa);var Ka=Qa;const{MEDIA_TIME_IS_LIVE:ja,MEDIA_PAUSED:Ya}=a,{MEDIA_SEEK_TO_LIVE_REQUEST:za,MEDIA_PLAY_REQUEST:Za}=e;const Xa=e=>{var t;const i=e.mediaPaused||!e.mediaTimeIsLive,n=M(i?"seek to live":"playing live");e.setAttribute("aria-label",n);const a=null==(t=e.shadowRoot)?void 0:t.querySelector('slot[name="text"]');a&&(a.textContent=M("live")),i?e.removeAttribute("aria-disabled"):e.setAttribute("aria-disabled","true")};class Ja extends ji{static get observedAttributes(){return[...super.observedAttributes,ja,Ya]}connectedCallback(){super.connectedCallback(),Xa(this)}attributeChangedCallback(e,t,i){super.attributeChangedCallback(e,t,i),Xa(this)}get mediaPaused(){return ee(this,a.MEDIA_PAUSED)}set mediaPaused(e){te(this,a.MEDIA_PAUSED,e)}get mediaTimeIsLive(){return ee(this,a.MEDIA_TIME_IS_LIVE)}set mediaTimeIsLive(e){te(this,a.MEDIA_TIME_IS_LIVE,e)}handleClick(){!this.mediaPaused&&this.mediaTimeIsLive||(this.dispatchEvent(new P.CustomEvent(za,{composed:!0,bubbles:!0})),this.hasAttribute(Ya)&&this.dispatchEvent(new P.CustomEvent(Za,{composed:!0,bubbles:!0})))}}Ja.getSlotTemplateHTML=function(e){return`\n    <style>\n      :host { --media-tooltip-display: none; }\n      \n      slot[name=indicator] > *,\n      :host ::slotted([slot=indicator]) {\n        \n        min-width: auto;\n        fill: var(--media-live-button-icon-color, rgb(140, 140, 140));\n        color: var(--media-live-button-icon-color, rgb(140, 140, 140));\n      }\n\n      :host([${ja}]:not([${Ya}])) slot[name=indicator] > *,\n      :host([${ja}]:not([${Ya}])) ::slotted([slot=indicator]) {\n        fill: var(--media-live-button-indicator-color, rgb(255, 0, 0));\n        color: var(--media-live-button-indicator-color, rgb(255, 0, 0));\n      }\n\n      :host([${ja}]:not([${Ya}])) {\n        cursor: var(--media-cursor, not-allowed);\n      }\n\n      slot[name=text]{\n        text-transform: uppercase;\n      }\n\n    </style>\n\n    <slot name="indicator"><svg viewBox="0 0 6 12"><circle cx="3" cy="6" r="2"></circle></svg></slot>\n    \n    <slot name="spacer">&nbsp;</slot><slot name="text">${M("live")}</slot>\n  `},P.customElements.get("media-live-button")||P.customElements.define("media-live-button",Ja);var es,ts,is=Ja,ns=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)},as=(e,t,i)=>(ns(e,t,"read from private field"),i?i.call(e):t.get(e)),ss=(e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)},os=(e,t,i,n)=>(ns(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i);const rs="loadingdelay",ls="noautohide";class ds extends P.HTMLElement{constructor(){if(super(),ss(this,es,void 0),ss(this,ts,500),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);const e=B(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[t.MEDIA_CONTROLLER,a.MEDIA_PAUSED,a.MEDIA_LOADING,rs]}attributeChangedCallback(e,i,n){var a,s,o,r,l;e===rs&&i!==n?this.loadingDelay=Number(n):e===t.MEDIA_CONTROLLER&&(i&&(null==(s=null==(a=as(this,es))?void 0:a.unassociateElement)||s.call(a,this),os(this,es,null)),n&&this.isConnected&&(os(this,es,null==(o=this.getRootNode())?void 0:o.getElementById(n)),null==(l=null==(r=as(this,es))?void 0:r.associateElement)||l.call(r,this)))}connectedCallback(){var e,i,n;const a=this.getAttribute(t.MEDIA_CONTROLLER);a&&(os(this,es,null==(e=this.getRootNode())?void 0:e.getElementById(a)),null==(n=null==(i=as(this,es))?void 0:i.associateElement)||n.call(i,this))}disconnectedCallback(){var e,t;null==(t=null==(e=as(this,es))?void 0:e.unassociateElement)||t.call(e,this),os(this,es,null)}get loadingDelay(){return as(this,ts)}set loadingDelay(e){os(this,ts,e);const{style:t}=z(this.shadowRoot,":host");t.setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return ee(this,a.MEDIA_PAUSED)}set mediaPaused(e){te(this,a.MEDIA_PAUSED,e)}get mediaLoading(){return ee(this,a.MEDIA_LOADING)}set mediaLoading(e){te(this,a.MEDIA_LOADING,e)}get mediaController(){return ie(this,t.MEDIA_CONTROLLER)}set mediaController(e){ne(this,t.MEDIA_CONTROLLER,e)}get noAutohide(){return ee(this,ls)}set noAutohide(e){te(this,ls,e)}}es=new WeakMap,ts=new WeakMap,ds.shadowRootOptions={mode:"open"},ds.getTemplateHTML=function(e){return`\n    <style>\n      :host {\n        display: var(--media-control-display, var(--media-loading-indicator-display, inline-block));\n        vertical-align: middle;\n        box-sizing: border-box;\n        --_loading-indicator-delay: var(--media-loading-indicator-transition-delay, 500ms);\n      }\n\n      #status {\n        color: rgba(0,0,0,0);\n        width: 0px;\n        height: 0px;\n      }\n\n      :host slot[name=icon] > *,\n      :host ::slotted([slot=icon]) {\n        opacity: var(--media-loading-indicator-opacity, 0);\n        transition: opacity 0.15s;\n      }\n\n      :host([${a.MEDIA_LOADING}]:not([${a.MEDIA_PAUSED}])) slot[name=icon] > *,\n      :host([${a.MEDIA_LOADING}]:not([${a.MEDIA_PAUSED}])) ::slotted([slot=icon]) {\n        opacity: var(--media-loading-indicator-opacity, 1);\n        transition: opacity 0.15s var(--_loading-indicator-delay);\n      }\n\n      :host #status {\n        visibility: var(--media-loading-indicator-opacity, hidden);\n        transition: visibility 0.15s;\n      }\n\n      :host([${a.MEDIA_LOADING}]:not([${a.MEDIA_PAUSED}])) #status {\n        visibility: var(--media-loading-indicator-opacity, visible);\n        transition: visibility 0.15s var(--_loading-indicator-delay);\n      }\n\n      svg, img, ::slotted(svg), ::slotted(img) {\n        width: var(--media-loading-indicator-icon-width);\n        height: var(--media-loading-indicator-icon-height, 100px);\n        fill: var(--media-icon-color, var(--media-primary-color, rgb(238 238 238)));\n        vertical-align: middle;\n      }\n    </style>\n\n    <slot name="icon">\n<svg aria-hidden="true" viewBox="0 0 100 100">\n  <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">\n    <animateTransform\n       attributeName="transform"\n       attributeType="XML"\n       type="rotate"\n       dur="1s"\n       from="0 50 50"\n       to="360 50 50"\n       repeatCount="indefinite" />\n  </path>\n</svg>\n</slot>\n    <div id="status" role="status" aria-live="polite">${M("media loading")}</div>\n  `},P.customElements.get("media-loading-indicator")||P.customElements.define("media-loading-indicator",ds);var cs=ds;const us='<svg aria-hidden="true" viewBox="0 0 24 24">\n  <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"/>\n</svg>';const hs=e=>{const t="off"===e.mediaVolumeLevel,i=M(t?"unmute":"mute");e.setAttribute("aria-label",i)};class ms extends ji{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_VOLUME_LEVEL]}connectedCallback(){super.connectedCallback(),hs(this)}attributeChangedCallback(e,t,i){super.attributeChangedCallback(e,t,i),e===a.MEDIA_VOLUME_LEVEL&&hs(this)}get mediaVolumeLevel(){return ie(this,a.MEDIA_VOLUME_LEVEL)}set mediaVolumeLevel(e){ne(this,a.MEDIA_VOLUME_LEVEL,e)}handleClick(){const t="off"===this.mediaVolumeLevel?e.MEDIA_UNMUTE_REQUEST:e.MEDIA_MUTE_REQUEST;this.dispatchEvent(new P.CustomEvent(t,{composed:!0,bubbles:!0}))}}ms.getSlotTemplateHTML=function(e){return`\n    <style>\n      :host(:not([${a.MEDIA_VOLUME_LEVEL}])) slot[name=icon] slot:not([name=high]),\n      :host([${a.MEDIA_VOLUME_LEVEL}=high]) slot[name=icon] slot:not([name=high]) {\n        display: none !important;\n      }\n\n      :host([${a.MEDIA_VOLUME_LEVEL}=off]) slot[name=icon] slot:not([name=off]) {\n        display: none !important;\n      }\n\n      :host([${a.MEDIA_VOLUME_LEVEL}=low]) slot[name=icon] slot:not([name=low]) {\n        display: none !important;\n      }\n\n      :host([${a.MEDIA_VOLUME_LEVEL}=medium]) slot[name=icon] slot:not([name=medium]) {\n        display: none !important;\n      }\n\n      :host(:not([${a.MEDIA_VOLUME_LEVEL}=off])) slot[name=tooltip-unmute],\n      :host([${a.MEDIA_VOLUME_LEVEL}=off]) slot[name=tooltip-mute] {\n        display: none;\n      }\n    </style>\n\n    <slot name="icon">\n      <slot name="off"><svg aria-hidden="true" viewBox="0 0 24 24">\n  <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"/>\n</svg></slot>\n      <slot name="low">${us}</slot>\n      <slot name="medium">${us}</slot>\n      <slot name="high"><svg aria-hidden="true" viewBox="0 0 24 24">\n  <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"/>\n</svg></slot>\n    </slot>\n  `},ms.getTooltipContentHTML=function(){return`\n    <slot name="tooltip-mute">${M("Mute")}</slot>\n    <slot name="tooltip-unmute">${M("Unmute")}</slot>\n  `},P.customElements.get("media-mute-button")||P.customElements.define("media-mute-button",ms);var ps=ms;const Es='<svg aria-hidden="true" viewBox="0 0 28 24">\n  <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"/>\n</svg>';const vs=e=>{const t=e.mediaIsPip?M("exit picture in picture mode"):M("enter picture in picture mode");e.setAttribute("aria-label",t)};class bs extends ji{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_IS_PIP,a.MEDIA_PIP_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),vs(this)}attributeChangedCallback(e,t,i){super.attributeChangedCallback(e,t,i),e===a.MEDIA_IS_PIP&&vs(this)}get mediaPipUnavailable(){return ie(this,a.MEDIA_PIP_UNAVAILABLE)}set mediaPipUnavailable(e){ne(this,a.MEDIA_PIP_UNAVAILABLE,e)}get mediaIsPip(){return ee(this,a.MEDIA_IS_PIP)}set mediaIsPip(e){te(this,a.MEDIA_IS_PIP,e)}handleClick(){const t=this.mediaIsPip?e.MEDIA_EXIT_PIP_REQUEST:e.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new P.CustomEvent(t,{composed:!0,bubbles:!0}))}}bs.getSlotTemplateHTML=function(e){return`\n    <style>\n      :host([${a.MEDIA_IS_PIP}]) slot[name=icon] slot:not([name=exit]) {\n        display: none !important;\n      }\n\n      :host(:not([${a.MEDIA_IS_PIP}])) slot[name=icon] slot:not([name=enter]) {\n        display: none !important;\n      }\n\n      :host([${a.MEDIA_IS_PIP}]) slot[name=tooltip-enter],\n      :host(:not([${a.MEDIA_IS_PIP}])) slot[name=tooltip-exit] {\n        display: none;\n      }\n    </style>\n\n    <slot name="icon">\n      <slot name="enter">${Es}</slot>\n      <slot name="exit">${Es}</slot>\n    </slot>\n  `},bs.getTooltipContentHTML=function(){return`\n    <slot name="tooltip-enter">${M("Enter picture in picture mode")}</slot>\n    <slot name="tooltip-exit">${M("Exit picture in picture mode")}</slot>\n  `},P.customElements.get("media-pip-button")||P.customElements.define("media-pip-button",bs);var gs,As=bs,fs=(e,t,i)=>(((e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)})(e,t,"read from private field"),i?i.call(e):t.get(e));const Is="rates",ws=[1,1.2,1.5,1.7,2];class ys extends ji{constructor(){var e;super(),((e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)})(this,gs,new Ye(this,Is,{defaultValue:ws})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${null!=(e=this.mediaPlaybackRate)?e:1}x`}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PLAYBACK_RATE,Is]}attributeChangedCallback(e,t,i){if(super.attributeChangedCallback(e,t,i),e===Is&&(fs(this,gs).value=i),e===a.MEDIA_PLAYBACK_RATE){const e=i?+i:Number.NaN,t=Number.isNaN(e)?1:e;this.container.innerHTML=`${t}x`,this.setAttribute("aria-label",M("Playback rate {playbackRate}",{playbackRate:t}))}}get rates(){return fs(this,gs)}set rates(e){e?Array.isArray(e)?fs(this,gs).value=e.join(" "):"string"==typeof e&&(fs(this,gs).value=e):fs(this,gs).value=""}get mediaPlaybackRate(){return X(this,a.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){J(this,a.MEDIA_PLAYBACK_RATE,e)}handleClick(){var t,i;const n=Array.from(fs(this,gs).values(),(e=>+e)).sort(((e,t)=>e-t)),a=null!=(i=null!=(t=n.find((e=>e>this.mediaPlaybackRate)))?t:n[0])?i:1,s=new P.CustomEvent(e.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:a});this.dispatchEvent(s)}}gs=new WeakMap,ys.getSlotTemplateHTML=function(e){return`\n    <style>\n      :host {\n        min-width: 5ch;\n        padding: var(--media-button-padding, var(--media-control-padding, 10px 5px));\n      }\n    </style>\n    <slot name="icon">${e.mediaplaybackrate||1}x</slot>\n  `},ys.getTooltipContentHTML=function(){return M("Playback rate")},P.customElements.get("media-playback-rate-button")||P.customElements.define("media-playback-rate-button",ys);var _s=ys;const Ts=e=>{const t=e.mediaPaused?M("play"):M("pause");e.setAttribute("aria-label",t)};class ks extends ji{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PAUSED,a.MEDIA_ENDED]}connectedCallback(){super.connectedCallback(),Ts(this)}attributeChangedCallback(e,t,i){super.attributeChangedCallback(e,t,i),e!==a.MEDIA_PAUSED&&e!==a.MEDIA_LANG||Ts(this)}get mediaPaused(){return ee(this,a.MEDIA_PAUSED)}set mediaPaused(e){te(this,a.MEDIA_PAUSED,e)}handleClick(){const t=this.mediaPaused?e.MEDIA_PLAY_REQUEST:e.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new P.CustomEvent(t,{composed:!0,bubbles:!0}))}}ks.getSlotTemplateHTML=function(e){return`\n    <style>\n      :host([${a.MEDIA_PAUSED}]) slot[name=pause],\n      :host(:not([${a.MEDIA_PAUSED}])) slot[name=play] {\n        display: none !important;\n      }\n\n      :host([${a.MEDIA_PAUSED}]) slot[name=tooltip-pause],\n      :host(:not([${a.MEDIA_PAUSED}])) slot[name=tooltip-play] {\n        display: none;\n      }\n    </style>\n\n    <slot name="icon">\n      <slot name="play"><svg aria-hidden="true" viewBox="0 0 24 24">\n  <path d="m6 21 15-9L6 3v18Z"/>\n</svg></slot>\n      <slot name="pause"><svg aria-hidden="true" viewBox="0 0 24 24">\n  <path d="M6 20h4V4H6v16Zm8-16v16h4V4h-4Z"/>\n</svg></slot>\n    </slot>\n  `},ks.getTooltipContentHTML=function(){return`\n    <slot name="tooltip-play">${M("Play")}</slot>\n    <slot name="tooltip-pause">${M("Pause")}</slot>\n  `},P.customElements.get("media-play-button")||P.customElements.define("media-play-button",ks);var Ms=ks;const Ss="placeholdersrc",Ls="src";class Rs extends P.HTMLElement{static get observedAttributes(){return[Ss,Ls]}constructor(){if(super(),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);const e=B(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,t,i){e===Ls&&(null==i?this.image.removeAttribute(Ls):this.image.setAttribute(Ls,i)),e===Ss&&(null==i?this.image.style.removeProperty("background-image"):((e,t)=>{e.style["background-image"]=`url('${t}')`})(this.image,i))}get placeholderSrc(){return ie(this,Ss)}set placeholderSrc(e){ne(this,Ls,e)}get src(){return ie(this,Ls)}set src(e){ne(this,Ls,e)}}Rs.shadowRootOptions={mode:"open"},Rs.getTemplateHTML=function(e){return'\n    <style>\n      :host {\n        pointer-events: none;\n        display: var(--media-poster-image-display, inline-block);\n        box-sizing: border-box;\n      }\n\n      img {\n        max-width: 100%;\n        max-height: 100%;\n        min-width: 100%;\n        min-height: 100%;\n        background-repeat: no-repeat;\n        background-position: var(--media-poster-image-background-position, var(--media-object-position, center));\n        background-size: var(--media-poster-image-background-size, var(--media-object-fit, contain));\n        object-fit: var(--media-object-fit, contain);\n        object-position: var(--media-object-position, center);\n      }\n    </style>\n\n    <img part="poster img" aria-hidden="true" id="image"/>\n  '},P.customElements.get("media-poster-image")||P.customElements.define("media-poster-image",Rs);var Ds,Cs=Rs,xs=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)};class Us extends Ia{constructor(){var e,t,i,n;super(),((e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)})(this,Ds,void 0),e=this,t=Ds,i=this.shadowRoot.querySelector("slot"),xs(e,t,"write to private field"),n?n.call(e,i):t.set(e,i)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PREVIEW_CHAPTER,a.MEDIA_LANG]}attributeChangedCallback(e,t,i){if(super.attributeChangedCallback(e,t,i),(e===a.MEDIA_PREVIEW_CHAPTER||e===a.MEDIA_LANG)&&i!==t&&null!=i)if((n=this,s=Ds,xs(n,s,"read from private field"),o?o.call(n):s.get(n)).textContent=i,""!==i){const e=M("chapter: {chapterName}",{chapterName:i});this.setAttribute("aria-valuetext",e)}else this.removeAttribute("aria-valuetext");var n,s,o}get mediaPreviewChapter(){return ie(this,a.MEDIA_PREVIEW_CHAPTER)}set mediaPreviewChapter(e){ne(this,a.MEDIA_PREVIEW_CHAPTER,e)}}Ds=new WeakMap,P.customElements.get("media-preview-chapter-display")||P.customElements.define("media-preview-chapter-display",Us);var Ps,Ns=Us,Os=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)},Hs=(e,t,i)=>(Os(e,t,"read from private field"),i?i.call(e):t.get(e)),Vs=(e,t,i,n)=>(Os(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i);class Ws extends P.HTMLElement{constructor(){if(super(),((e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)})(this,Ps,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);const e=B(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[t.MEDIA_CONTROLLER,a.MEDIA_PREVIEW_IMAGE,a.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,i,n;const a=this.getAttribute(t.MEDIA_CONTROLLER);a&&(Vs(this,Ps,null==(e=this.getRootNode())?void 0:e.getElementById(a)),null==(n=null==(i=Hs(this,Ps))?void 0:i.associateElement)||n.call(i,this))}disconnectedCallback(){var e,t;null==(t=null==(e=Hs(this,Ps))?void 0:e.unassociateElement)||t.call(e,this),Vs(this,Ps,null)}attributeChangedCallback(e,i,n){var s,o,r,l,d;[a.MEDIA_PREVIEW_IMAGE,a.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===t.MEDIA_CONTROLLER&&(i&&(null==(o=null==(s=Hs(this,Ps))?void 0:s.unassociateElement)||o.call(s,this),Vs(this,Ps,null)),n&&this.isConnected&&(Vs(this,Ps,null==(r=this.getRootNode())?void 0:r.getElementById(n)),null==(d=null==(l=Hs(this,Ps))?void 0:l.associateElement)||d.call(l,this)))}get mediaPreviewImage(){return ie(this,a.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){ne(this,a.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewCoords(){const e=this.getAttribute(a.MEDIA_PREVIEW_COORDS);if(e)return e.split(/\s+/).map((e=>+e))}set mediaPreviewCoords(e){e?this.setAttribute(a.MEDIA_PREVIEW_COORDS,e.join(" ")):this.removeAttribute(a.MEDIA_PREVIEW_COORDS)}update(){const e=this.mediaPreviewCoords,t=this.mediaPreviewImage;if(!e||!t)return;const[i,n,a,s]=e,o=t.split("#")[0],r=getComputedStyle(this),{maxWidth:l,maxHeight:d,minWidth:c,minHeight:u}=r,h=Math.min(parseInt(l)/a,parseInt(d)/s),m=Math.max(parseInt(c)/a,parseInt(u)/s),p=h<1,E=p?h:m>1?m:1,{style:v}=z(this.shadowRoot,":host"),b=z(this.shadowRoot,"img").style,g=this.shadowRoot.querySelector("img"),A=p?"min":"max";v.setProperty(`${A}-width`,"initial","important"),v.setProperty(`${A}-height`,"initial","important"),v.width=a*E+"px",v.height=s*E+"px";const f=()=>{b.width=this.imgWidth*E+"px",b.height=this.imgHeight*E+"px",b.display="block"};g.src!==o&&(g.onload=()=>{this.imgWidth=g.naturalWidth,this.imgHeight=g.naturalHeight,f()},g.src=o,f()),f(),b.transform=`translate(-${i*E}px, -${n*E}px)`}}Ps=new WeakMap,Ws.shadowRootOptions={mode:"open"},Ws.getTemplateHTML=function(e){return'\n    <style>\n      :host {\n        box-sizing: border-box;\n        display: var(--media-control-display, var(--media-preview-thumbnail-display, inline-block));\n        overflow: hidden;\n      }\n\n      img {\n        display: none;\n        position: relative;\n      }\n    </style>\n    <img crossorigin loading="eager" decoding="async">\n  '},P.customElements.get("media-preview-thumbnail")||P.customElements.define("media-preview-thumbnail",Ws);var $s,Bs=Ws,Fs=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)},Gs=(e,t,i)=>(Fs(e,t,"read from private field"),i?i.call(e):t.get(e));class qs extends Ia{constructor(){var e,t,i,n;super(),((e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)})(this,$s,void 0),e=this,t=$s,i=this.shadowRoot.querySelector("slot"),Fs(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),Gs(this,$s).textContent=I(0)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,t,i){super.attributeChangedCallback(e,t,i),e===a.MEDIA_PREVIEW_TIME&&null!=i&&(Gs(this,$s).textContent=I(parseFloat(i)))}get mediaPreviewTime(){return X(this,a.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){J(this,a.MEDIA_PREVIEW_TIME,e)}}$s=new WeakMap,P.customElements.get("media-preview-time-display")||P.customElements.define("media-preview-time-display",qs);var Qs=qs;const Ks="seekoffset";class js extends ji{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_CURRENT_TIME,Ks]}connectedCallback(){super.connectedCallback(),this.seekOffset=X(this,Ks,30)}attributeChangedCallback(e,t,i){super.attributeChangedCallback(e,t,i),e===Ks&&(this.seekOffset=X(this,Ks,30))}get seekOffset(){return X(this,Ks,30)}set seekOffset(e){J(this,Ks,e),this.setAttribute("aria-label",M("seek back {seekOffset} seconds",{seekOffset:this.seekOffset})),G(q(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return X(this,a.MEDIA_CURRENT_TIME,0)}set mediaCurrentTime(e){J(this,a.MEDIA_CURRENT_TIME,e)}handleClick(){const t=Math.max(this.mediaCurrentTime-this.seekOffset,0),i=new P.CustomEvent(e.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(i)}}js.getSlotTemplateHTML=function(e,t){return`\n    <slot name="icon">${i=t.seekOffset,`\n  <svg aria-hidden="true" viewBox="0 0 20 24">\n    <defs>\n      <style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style>\n    </defs>\n    <text class="text value" transform="translate(2.18 19.87)">${i}</text>\n    <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"/>\n  </svg>`}</slot>\n  `;var i},js.getTooltipContentHTML=function(){return M("Seek backward")},P.customElements.get("media-seek-backward-button")||P.customElements.define("media-seek-backward-button",js);var Ys=js;const zs="seekoffset";class Zs extends ji{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_CURRENT_TIME,zs]}connectedCallback(){super.connectedCallback(),this.seekOffset=X(this,zs,30)}attributeChangedCallback(e,t,i){super.attributeChangedCallback(e,t,i),e===zs&&(this.seekOffset=X(this,zs,30))}get seekOffset(){return X(this,zs,30)}set seekOffset(e){J(this,zs,e),this.setAttribute("aria-label",M("seek forward {seekOffset} seconds",{seekOffset:this.seekOffset})),G(q(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return X(this,a.MEDIA_CURRENT_TIME,0)}set mediaCurrentTime(e){J(this,a.MEDIA_CURRENT_TIME,e)}handleClick(){const t=this.mediaCurrentTime+this.seekOffset,i=new P.CustomEvent(e.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(i)}}Zs.getSlotTemplateHTML=function(e,t){return`\n    <slot name="icon">${i=t.seekOffset,`\n  <svg aria-hidden="true" viewBox="0 0 20 24">\n    <defs>\n      <style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style>\n    </defs>\n    <text class="text value" transform="translate(8.9 19.87)">${i}</text>\n    <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"/>\n  </svg>`}</slot>\n  `;var i},Zs.getTooltipContentHTML=function(){return M("Seek forward")},P.customElements.get("media-seek-forward-button")||P.customElements.define("media-seek-forward-button",Zs);var Xs,Js=Zs,eo=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)},to=(e,t,i)=>(eo(e,t,"read from private field"),i?i.call(e):t.get(e));const io={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},no=[...Object.values(io),a.MEDIA_CURRENT_TIME,a.MEDIA_DURATION,a.MEDIA_SEEKABLE],ao=["Enter"," "],so=(e,{timesSep:t="&nbsp;/&nbsp;"}={})=>{var i,n;const a=null!=(i=e.mediaCurrentTime)?i:0,[,s]=null!=(n=e.mediaSeekable)?n:[];let o=0;Number.isFinite(e.mediaDuration)?o=e.mediaDuration:Number.isFinite(s)&&(o=s);const r=e.remaining?I(0-(o-a)):I(a);return e.showDuration?`${r}${t}${I(o)}`:r};class oo extends Ia{constructor(){var e,t,i,n;super(),((e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)})(this,Xs,void 0),e=this,t=Xs,i=this.shadowRoot.querySelector("slot"),eo(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),to(this,Xs).innerHTML=`${so(this)}`}static get observedAttributes(){return[...super.observedAttributes,...no,"disabled"]}connectedCallback(){const{style:e}=z(this.shadowRoot,":host(:hover:not([notoggle]))");e.setProperty("cursor","var(--media-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",M("playback time"));const t=e=>{const{key:i}=e;ao.includes(i)?this.toggleTimeDisplay():this.removeEventListener("keyup",t)};this.addEventListener("keydown",(e=>{const{metaKey:i,altKey:n,key:a}=e;i||n||!ao.includes(a)?this.removeEventListener("keyup",t):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,i){no.includes(e)?this.update():"disabled"===e&&i!==t&&(null==i?this.enable():this.disable()),super.attributeChangedCallback(e,t,i)}enable(){this.tabIndex=0}disable(){this.tabIndex=-1}get remaining(){return ee(this,io.REMAINING)}set remaining(e){te(this,io.REMAINING,e)}get showDuration(){return ee(this,io.SHOW_DURATION)}set showDuration(e){te(this,io.SHOW_DURATION,e)}get noToggle(){return ee(this,io.NO_TOGGLE)}set noToggle(e){te(this,io.NO_TOGGLE,e)}get mediaDuration(){return X(this,a.MEDIA_DURATION)}set mediaDuration(e){J(this,a.MEDIA_DURATION,e)}get mediaCurrentTime(){return X(this,a.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){J(this,a.MEDIA_CURRENT_TIME,e)}get mediaSeekable(){const e=this.getAttribute(a.MEDIA_SEEKABLE);if(e)return e.split(":").map((e=>+e))}set mediaSeekable(e){null!=e?this.setAttribute(a.MEDIA_SEEKABLE,e.join(":")):this.removeAttribute(a.MEDIA_SEEKABLE)}update(){const e=so(this);(e=>{var t;const i=e.mediaCurrentTime,[,n]=null!=(t=e.mediaSeekable)?t:[];let a=null;if(Number.isFinite(e.mediaDuration)?a=e.mediaDuration:Number.isFinite(n)&&(a=n),null==i||null===a)return void e.setAttribute("aria-valuetext","video not loaded, unknown time.");const s=e.remaining?f(0-(a-i)):f(i);if(!e.showDuration)return void e.setAttribute("aria-valuetext",s);const o=`${s} of ${f(a)}`;e.setAttribute("aria-valuetext",o)})(this),e!==to(this,Xs).innerHTML&&(to(this,Xs).innerHTML=e)}}Xs=new WeakMap,oo.getSlotTemplateHTML=function(e,t){return`\n    <slot>${so(t)}</slot>\n  `},P.customElements.get("media-time-display")||P.customElements.define("media-time-display",oo);var ro,lo,co,uo,ho,mo,po,Eo,vo,bo,go=oo,Ao=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)},fo=(e,t,i)=>(Ao(e,t,"read from private field"),i?i.call(e):t.get(e)),Io=(e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)},wo=(e,t,i,n)=>(Ao(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i);class yo{constructor(e,t,i){Io(this,ro,void 0),Io(this,lo,void 0),Io(this,co,void 0),Io(this,uo,void 0),Io(this,ho,void 0),Io(this,mo,void 0),Io(this,po,void 0),Io(this,Eo,void 0),Io(this,vo,0),Io(this,bo,((e=performance.now())=>{wo(this,vo,requestAnimationFrame(fo(this,bo))),wo(this,uo,performance.now()-fo(this,co));const t=1e3/this.fps;if(fo(this,uo)>t){wo(this,co,e-fo(this,uo)%t);const o=1e3/((e-fo(this,lo))/++(i=this,n=ho,{set _(e){wo(i,n,e,a)},get _(){return fo(i,n,s)}})._),r=(e-fo(this,mo))/1e3/this.duration;let l=fo(this,po)+r*this.playbackRate;l-fo(this,ro).valueAsNumber>0?wo(this,Eo,this.playbackRate/this.duration/o):(wo(this,Eo,.995*fo(this,Eo)),l=fo(this,ro).valueAsNumber+fo(this,Eo)),this.callback(l)}var i,n,a,s})),wo(this,ro,e),this.callback=t,this.fps=i}start(){0===fo(this,vo)&&(wo(this,co,performance.now()),wo(this,lo,fo(this,co)),wo(this,ho,0),fo(this,bo).call(this))}stop(){0!==fo(this,vo)&&(cancelAnimationFrame(fo(this,vo)),wo(this,vo,0))}update({start:e,duration:t,playbackRate:i}){const n=e-fo(this,ro).valueAsNumber,a=Math.abs(t-this.duration);(n>0||n<-.03||a>=.5)&&this.callback(e),wo(this,po,e),wo(this,mo,performance.now()),this.duration=t,this.playbackRate=i}}ro=new WeakMap,lo=new WeakMap,co=new WeakMap,uo=new WeakMap,ho=new WeakMap,mo=new WeakMap,po=new WeakMap,Eo=new WeakMap,vo=new WeakMap,bo=new WeakMap;var _o,To,ko,Mo,So,Lo,Ro,Do,Co,xo,Uo,Po,No,Oo,Ho,Vo,Wo,$o,Bo,Fo,Go,qo,Qo,Ko,jo,Yo,zo,Zo=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)},Xo=(e,t,i)=>(Zo(e,t,"read from private field"),i?i.call(e):t.get(e)),Jo=(e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)},er=(e,t,i,n)=>(Zo(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i),tr=(e,t,i)=>(Zo(e,t,"access private method"),i);const ir=(e,t=e.mediaCurrentTime)=>{const i=Number.isFinite(e.mediaSeekableStart)?e.mediaSeekableStart:0,n=Number.isFinite(e.mediaDuration)?e.mediaDuration:e.mediaSeekableEnd;if(Number.isNaN(n))return 0;const a=(t-i)/(n-i);return Math.max(0,Math.min(a,1))},nr=(e,t=e.range.valueAsNumber)=>{const i=Number.isFinite(e.mediaSeekableStart)?e.mediaSeekableStart:0,n=Number.isFinite(e.mediaDuration)?e.mediaDuration:e.mediaSeekableEnd;return Number.isNaN(n)?0:t*(n-i)+i};class ar extends da{constructor(){super(),Jo(this,Uo),Jo(this,No),Jo(this,Vo),Jo(this,$o),Jo(this,Fo),Jo(this,qo),Jo(this,Ko),Jo(this,Yo),Jo(this,_o,void 0),Jo(this,To,void 0),Jo(this,ko,void 0),Jo(this,Mo,void 0),Jo(this,So,void 0),Jo(this,Lo,void 0),Jo(this,Ro,void 0),Jo(this,Do,void 0),Jo(this,Co,void 0),Jo(this,xo,void 0),Jo(this,Ho,(e=>{this.dragging||(b(e)&&(this.range.valueAsNumber=e),Xo(this,xo)||this.updateBar())}));this.shadowRoot.querySelector("#track").insertAdjacentHTML("afterbegin",'<div id="buffered" part="buffered"></div>'),er(this,ko,this.shadowRoot.querySelectorAll('[part~="box"]')),er(this,So,this.shadowRoot.querySelector('[part~="preview-box"]')),er(this,Lo,this.shadowRoot.querySelector('[part~="current-box"]'));const e=getComputedStyle(this);er(this,Ro,parseInt(e.getPropertyValue("--media-box-padding-left"))),er(this,Do,parseInt(e.getPropertyValue("--media-box-padding-right"))),er(this,To,new yo(this.range,Xo(this,Ho),60))}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PAUSED,a.MEDIA_DURATION,a.MEDIA_SEEKABLE,a.MEDIA_CURRENT_TIME,a.MEDIA_PREVIEW_IMAGE,a.MEDIA_PREVIEW_TIME,a.MEDIA_PREVIEW_CHAPTER,a.MEDIA_BUFFERED,a.MEDIA_PLAYBACK_RATE,a.MEDIA_LOADING,a.MEDIA_ENDED]}connectedCallback(){var e;super.connectedCallback(),this.range.setAttribute("aria-label",M("seek")),tr(this,Uo,Po).call(this),er(this,_o,this.getRootNode()),null==(e=Xo(this,_o))||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),tr(this,Uo,Po).call(this),null==(e=Xo(this,_o))||e.removeEventListener("transitionstart",this),er(this,_o,null)}attributeChangedCallback(e,t,i){super.attributeChangedCallback(e,t,i),t!=i&&(e===a.MEDIA_CURRENT_TIME||e===a.MEDIA_PAUSED||e===a.MEDIA_ENDED||e===a.MEDIA_LOADING||e===a.MEDIA_DURATION||e===a.MEDIA_SEEKABLE?(Xo(this,To).update({start:ir(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),tr(this,Uo,Po).call(this),(e=>{const t=e.range,i=f(+nr(e)),n=f(+e.mediaSeekableEnd),a=i&&n?`${i} of ${n}`:"video not loaded, unknown time.";t.setAttribute("aria-valuetext",a)})(this)):e===a.MEDIA_BUFFERED&&this.updateBufferedBar(),e!==a.MEDIA_DURATION&&e!==a.MEDIA_SEEKABLE||(this.mediaChaptersCues=Xo(this,Co),this.updateBar()))}get mediaChaptersCues(){return Xo(this,Co)}set mediaChaptersCues(e){var t;er(this,Co,e),this.updateSegments(null==(t=Xo(this,Co))?void 0:t.map((e=>({start:ir(this,e.startTime),end:ir(this,e.endTime)}))))}get mediaPaused(){return ee(this,a.MEDIA_PAUSED)}set mediaPaused(e){te(this,a.MEDIA_PAUSED,e)}get mediaLoading(){return ee(this,a.MEDIA_LOADING)}set mediaLoading(e){te(this,a.MEDIA_LOADING,e)}get mediaDuration(){return X(this,a.MEDIA_DURATION)}set mediaDuration(e){J(this,a.MEDIA_DURATION,e)}get mediaCurrentTime(){return X(this,a.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){J(this,a.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return X(this,a.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){J(this,a.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){const e=this.getAttribute(a.MEDIA_BUFFERED);return e?e.split(" ").map((e=>e.split(":").map((e=>+e)))):[]}set mediaBuffered(e){if(!e)return void this.removeAttribute(a.MEDIA_BUFFERED);const t=e.map((e=>e.join(":"))).join(" ");this.setAttribute(a.MEDIA_BUFFERED,t)}get mediaSeekable(){const e=this.getAttribute(a.MEDIA_SEEKABLE);if(e)return e.split(":").map((e=>+e))}set mediaSeekable(e){null!=e?this.setAttribute(a.MEDIA_SEEKABLE,e.join(":")):this.removeAttribute(a.MEDIA_SEEKABLE)}get mediaSeekableEnd(){var e;const[,t=this.mediaDuration]=null!=(e=this.mediaSeekable)?e:[];return t}get mediaSeekableStart(){var e;const[t=0]=null!=(e=this.mediaSeekable)?e:[];return t}get mediaPreviewImage(){return ie(this,a.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){ne(this,a.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return X(this,a.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){J(this,a.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return ee(this,a.MEDIA_ENDED)}set mediaEnded(e){te(this,a.MEDIA_ENDED,e)}updateBar(){super.updateBar(),this.updateBufferedBar(),this.updateCurrentBox()}updateBufferedBar(){var e;const t=this.mediaBuffered;if(!t.length)return;let i;if(this.mediaEnded)i=1;else{const n=this.mediaCurrentTime,[,a=this.mediaSeekableStart]=null!=(e=t.find((([e,t])=>e<=n&&n<=t)))?e:[];i=ir(this,a)}const{style:n}=z(this.shadowRoot,"#buffered");n.setProperty("width",100*i+"%")}updateCurrentBox(){if(!this.shadowRoot.querySelector('slot[name="current"]').assignedElements().length)return;const e=z(this.shadowRoot,"#current-rail"),t=z(this.shadowRoot,'[part~="current-box"]'),i=tr(this,Vo,Wo).call(this,Xo(this,Lo)),n=tr(this,$o,Bo).call(this,i,this.range.valueAsNumber),a=tr(this,Fo,Go).call(this,i,this.range.valueAsNumber);e.style.transform=`translateX(${n})`,e.style.setProperty("--_range-width",`${i.range.width}`),t.style.setProperty("--_box-shift",`${a}`),t.style.setProperty("--_box-width",`${i.box.width}px`),t.style.setProperty("visibility","initial")}handleEvent(e){switch(super.handleEvent(e),e.type){case"input":tr(this,Yo,zo).call(this);break;case"pointermove":tr(this,qo,Qo).call(this,e);break;case"pointerup":Xo(this,xo)&&er(this,xo,!1);break;case"pointerdown":er(this,xo,!0);break;case"pointerleave":tr(this,Ko,jo).call(this,null);break;case"transitionstart":Q(e.target,this)&&setTimeout((()=>tr(this,Uo,Po).call(this)),0)}}}_o=new WeakMap,To=new WeakMap,ko=new WeakMap,Mo=new WeakMap,So=new WeakMap,Lo=new WeakMap,Ro=new WeakMap,Do=new WeakMap,Co=new WeakMap,xo=new WeakMap,Uo=new WeakSet,Po=function(){tr(this,No,Oo).call(this)?Xo(this,To).start():Xo(this,To).stop()},No=new WeakSet,Oo=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&Y(this)},Ho=new WeakMap,Vo=new WeakSet,Wo=function(e){var t;const i=(null!=(t=this.getAttribute("bounds")?K(this,`#${this.getAttribute("bounds")}`):this.parentElement)?t:this).getBoundingClientRect(),n=this.range.getBoundingClientRect(),a=e.offsetWidth;return{box:{width:a,min:-(n.left-i.left-a/2),max:i.right-n.left-a/2},bounds:i,range:n}},$o=new WeakSet,Bo=function(e,t){let i=100*t+"%";const{width:n,min:a,max:s}=e.box;if(!n)return i;if(!Number.isNaN(a)){i=`max(${`calc(1 / var(--_range-width) * 100 * ${a}% + ${"var(--media-box-padding-left)"})`}, ${i})`}if(!Number.isNaN(s)){i=`min(${i}, ${`calc(1 / var(--_range-width) * 100 * ${s}% - ${"var(--media-box-padding-right)"})`})`}return i},Fo=new WeakSet,Go=function(e,t){const{width:i,min:n,max:a}=e.box,s=t*e.range.width;if(s<n+Xo(this,Ro)){return`${s-i/2+(e.range.left-e.bounds.left-Xo(this,Ro))}px`}if(s>a-Xo(this,Do)){return s+i/2-(e.bounds.right-e.range.right-Xo(this,Do))-e.range.width+"px"}return 0},qo=new WeakSet,Qo=function(e){const t=[...Xo(this,ko)].some((t=>e.composedPath().includes(t)));if(!this.dragging&&(t||!e.composedPath().includes(this)))return void tr(this,Ko,jo).call(this,null);const i=this.mediaSeekableEnd;if(!i)return;const n=z(this.shadowRoot,"#preview-rail"),a=z(this.shadowRoot,'[part~="preview-box"]'),s=tr(this,Vo,Wo).call(this,Xo(this,So));let o=(e.clientX-s.range.left)/s.range.width;o=Math.max(0,Math.min(1,o));const r=tr(this,$o,Bo).call(this,s,o),l=tr(this,Fo,Go).call(this,s,o);n.style.transform=`translateX(${r})`,n.style.setProperty("--_range-width",`${s.range.width}`),a.style.setProperty("--_box-shift",`${l}`),a.style.setProperty("--_box-width",`${s.box.width}px`);const d=Math.round(Xo(this,Mo))-Math.round(o*i);Math.abs(d)<1&&o>.01&&o<.99||(er(this,Mo,o*i),tr(this,Ko,jo).call(this,Xo(this,Mo)))},Ko=new WeakSet,jo=function(t){this.dispatchEvent(new P.CustomEvent(e.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:t}))},Yo=new WeakSet,zo=function(){Xo(this,To).stop();const t=nr(this);this.dispatchEvent(new P.CustomEvent(e.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:t}))},ar.shadowRootOptions={mode:"open"},ar.getTemplateHTML=function(e){return`\n    ${da.getTemplateHTML(e)}\n    <style>\n      :host {\n        --media-box-border-radius: 4px;\n        --media-box-padding-left: 10px;\n        --media-box-padding-right: 10px;\n        --media-preview-border-radius: var(--media-box-border-radius);\n        --media-box-arrow-offset: var(--media-box-border-radius);\n        --_control-background: var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7)));\n        --_preview-background: var(--media-preview-background, var(--_control-background));\n\n        \n        contain: layout;\n      }\n\n      #buffered {\n        background: var(--media-time-range-buffered-color, rgb(255 255 255 / .4));\n        position: absolute;\n        height: 100%;\n        will-change: width;\n      }\n\n      #preview-rail,\n      #current-rail {\n        width: 100%;\n        position: absolute;\n        left: 0;\n        bottom: 100%;\n        pointer-events: none;\n        will-change: transform;\n      }\n\n      [part~="box"] {\n        width: min-content;\n        \n        position: absolute;\n        bottom: 100%;\n        flex-direction: column;\n        align-items: center;\n        transform: translateX(-50%);\n      }\n\n      [part~="current-box"] {\n        display: var(--media-current-box-display, var(--media-box-display, flex));\n        margin: var(--media-current-box-margin, var(--media-box-margin, 0 0 5px));\n        visibility: hidden;\n      }\n\n      [part~="preview-box"] {\n        display: var(--media-preview-box-display, var(--media-box-display, flex));\n        margin: var(--media-preview-box-margin, var(--media-box-margin, 0 0 5px));\n        transition-property: var(--media-preview-transition-property, visibility, opacity);\n        transition-duration: var(--media-preview-transition-duration-out, .25s);\n        transition-delay: var(--media-preview-transition-delay-out, 0s);\n        visibility: hidden;\n        opacity: 0;\n      }\n\n      :host(:is([${a.MEDIA_PREVIEW_IMAGE}], [${a.MEDIA_PREVIEW_TIME}])[dragging]) [part~="preview-box"] {\n        transition-duration: var(--media-preview-transition-duration-in, .5s);\n        transition-delay: var(--media-preview-transition-delay-in, .25s);\n        visibility: visible;\n        opacity: 1;\n      }\n\n      @media (hover: hover) {\n        :host(:is([${a.MEDIA_PREVIEW_IMAGE}], [${a.MEDIA_PREVIEW_TIME}]):hover) [part~="preview-box"] {\n          transition-duration: var(--media-preview-transition-duration-in, .5s);\n          transition-delay: var(--media-preview-transition-delay-in, .25s);\n          visibility: visible;\n          opacity: 1;\n        }\n      }\n\n      media-preview-thumbnail,\n      ::slotted(media-preview-thumbnail) {\n        visibility: hidden;\n        \n        transition: visibility 0s .25s;\n        transition-delay: calc(var(--media-preview-transition-delay-out, 0s) + var(--media-preview-transition-duration-out, .25s));\n        background: var(--media-preview-thumbnail-background, var(--_preview-background));\n        box-shadow: var(--media-preview-thumbnail-box-shadow, 0 0 4px rgb(0 0 0 / .2));\n        max-width: var(--media-preview-thumbnail-max-width, 180px);\n        max-height: var(--media-preview-thumbnail-max-height, 160px);\n        min-width: var(--media-preview-thumbnail-min-width, 120px);\n        min-height: var(--media-preview-thumbnail-min-height, 80px);\n        border: var(--media-preview-thumbnail-border);\n        border-radius: var(--media-preview-thumbnail-border-radius,\n          var(--media-preview-border-radius) var(--media-preview-border-radius) 0 0);\n      }\n\n      :host([${a.MEDIA_PREVIEW_IMAGE}][dragging]) media-preview-thumbnail,\n      :host([${a.MEDIA_PREVIEW_IMAGE}][dragging]) ::slotted(media-preview-thumbnail) {\n        transition-delay: var(--media-preview-transition-delay-in, .25s);\n        visibility: visible;\n      }\n\n      @media (hover: hover) {\n        :host([${a.MEDIA_PREVIEW_IMAGE}]:hover) media-preview-thumbnail,\n        :host([${a.MEDIA_PREVIEW_IMAGE}]:hover) ::slotted(media-preview-thumbnail) {\n          transition-delay: var(--media-preview-transition-delay-in, .25s);\n          visibility: visible;\n        }\n\n        :host([${a.MEDIA_PREVIEW_TIME}]:hover) {\n          --media-time-range-hover-display: block;\n        }\n      }\n\n      media-preview-chapter-display,\n      ::slotted(media-preview-chapter-display) {\n        font-size: var(--media-font-size, 13px);\n        line-height: 17px;\n        min-width: 0;\n        visibility: hidden;\n        \n        transition: min-width 0s, border-radius 0s, margin 0s, padding 0s, visibility 0s;\n        transition-delay: calc(var(--media-preview-transition-delay-out, 0s) + var(--media-preview-transition-duration-out, .25s));\n        background: var(--media-preview-chapter-background, var(--_preview-background));\n        border-radius: var(--media-preview-chapter-border-radius,\n          var(--media-preview-border-radius) var(--media-preview-border-radius)\n          var(--media-preview-border-radius) var(--media-preview-border-radius));\n        padding: var(--media-preview-chapter-padding, 3.5px 9px);\n        margin: var(--media-preview-chapter-margin, 0 0 5px);\n        text-shadow: var(--media-preview-chapter-text-shadow, 0 0 4px rgb(0 0 0 / .75));\n      }\n\n      :host([${a.MEDIA_PREVIEW_IMAGE}]) media-preview-chapter-display,\n      :host([${a.MEDIA_PREVIEW_IMAGE}]) ::slotted(media-preview-chapter-display) {\n        transition-delay: var(--media-preview-transition-delay-in, .25s);\n        border-radius: var(--media-preview-chapter-border-radius, 0);\n        padding: var(--media-preview-chapter-padding, 3.5px 9px 0);\n        margin: var(--media-preview-chapter-margin, 0);\n        min-width: 100%;\n      }\n\n      media-preview-chapter-display[${a.MEDIA_PREVIEW_CHAPTER}],\n      ::slotted(media-preview-chapter-display[${a.MEDIA_PREVIEW_CHAPTER}]) {\n        visibility: visible;\n      }\n\n      media-preview-chapter-display:not([aria-valuetext]),\n      ::slotted(media-preview-chapter-display:not([aria-valuetext])) {\n        display: none;\n      }\n\n      media-preview-time-display,\n      ::slotted(media-preview-time-display),\n      media-time-display,\n      ::slotted(media-time-display) {\n        font-size: var(--media-font-size, 13px);\n        line-height: 17px;\n        min-width: 0;\n        \n        transition: min-width 0s, border-radius 0s;\n        transition-delay: calc(var(--media-preview-transition-delay-out, 0s) + var(--media-preview-transition-duration-out, .25s));\n        background: var(--media-preview-time-background, var(--_preview-background));\n        border-radius: var(--media-preview-time-border-radius,\n          var(--media-preview-border-radius) var(--media-preview-border-radius)\n          var(--media-preview-border-radius) var(--media-preview-border-radius));\n        padding: var(--media-preview-time-padding, 3.5px 9px);\n        margin: var(--media-preview-time-margin, 0);\n        text-shadow: var(--media-preview-time-text-shadow, 0 0 4px rgb(0 0 0 / .75));\n        transform: translateX(min(\n          max(calc(50% - var(--_box-width) / 2),\n          calc(var(--_box-shift, 0))),\n          calc(var(--_box-width) / 2 - 50%)\n        ));\n      }\n\n      :host([${a.MEDIA_PREVIEW_IMAGE}]) media-preview-time-display,\n      :host([${a.MEDIA_PREVIEW_IMAGE}]) ::slotted(media-preview-time-display) {\n        transition-delay: var(--media-preview-transition-delay-in, .25s);\n        border-radius: var(--media-preview-time-border-radius,\n          0 0 var(--media-preview-border-radius) var(--media-preview-border-radius));\n        min-width: 100%;\n      }\n\n      :host([${a.MEDIA_PREVIEW_TIME}]:hover) {\n        --media-time-range-hover-display: block;\n      }\n\n      [part~="arrow"],\n      ::slotted([part~="arrow"]) {\n        display: var(--media-box-arrow-display, inline-block);\n        transform: translateX(min(\n          max(calc(50% - var(--_box-width) / 2 + var(--media-box-arrow-offset)),\n          calc(var(--_box-shift, 0))),\n          calc(var(--_box-width) / 2 - 50% - var(--media-box-arrow-offset))\n        ));\n        \n        border-color: transparent;\n        border-top-color: var(--media-box-arrow-background, var(--_control-background));\n        border-width: var(--media-box-arrow-border-width,\n          var(--media-box-arrow-height, 5px) var(--media-box-arrow-width, 6px) 0);\n        border-style: solid;\n        justify-content: center;\n        height: 0;\n      }\n    </style>\n    <div id="preview-rail">\n      <slot name="preview" part="box preview-box">\n        <media-preview-thumbnail>\n          <template shadowrootmode="${Bs.shadowRootOptions.mode}">\n            ${Bs.getTemplateHTML({})}\n          </template>\n        </media-preview-thumbnail>\n        <media-preview-chapter-display></media-preview-chapter-display>\n        <media-preview-time-display></media-preview-time-display>\n        <slot name="preview-arrow"><div part="arrow"></div></slot>\n      </slot>\n    </div>\n    <div id="current-rail">\n      <slot name="current" part="box current-box">\n        \n      </slot>\n    </div>\n  `},P.customElements.get("media-time-range")||P.customElements.define("media-time-range",ar);var sr=ar;class or extends da{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_VOLUME,a.MEDIA_MUTED,a.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",(()=>{const t=this.range.value,i=new P.CustomEvent(e.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(i)}))}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",M("volume"))}attributeChangedCallback(e,t,i){var n,s;super.attributeChangedCallback(e,t,i),e!==a.MEDIA_VOLUME&&e!==a.MEDIA_MUTED||(this.range.valueAsNumber=(s=this).mediaMuted?0:s.mediaVolume,this.range.setAttribute("aria-valuetext",(n=this.range.valueAsNumber,`${Math.round(100*n)}%`)),this.updateBar())}get mediaVolume(){return X(this,a.MEDIA_VOLUME,1)}set mediaVolume(e){J(this,a.MEDIA_VOLUME,e)}get mediaMuted(){return ee(this,a.MEDIA_MUTED)}set mediaMuted(e){te(this,a.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return ie(this,a.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){ne(this,a.MEDIA_VOLUME_UNAVAILABLE,e)}}P.customElements.get("media-volume-range")||P.customElements.define("media-volume-range",or);var rr=or;class lr extends ji{constructor(){super(...arguments),this.container=null}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_LOOP]}connectedCallback(){var e;super.connectedCallback(),this.container=(null==(e=this.shadowRoot)?void 0:e.querySelector("#icon"))||null,this.container&&(this.container.textContent=M("Loop"))}attributeChangedCallback(e,t,i){super.attributeChangedCallback(e,t,i),e===a.MEDIA_LOOP&&this.container&&this.setAttribute("aria-checked",this.mediaLoop?"true":"false")}get mediaLoop(){return ee(this,a.MEDIA_LOOP)}set mediaLoop(e){te(this,a.MEDIA_LOOP,e)}handleClick(){const t=!this.mediaLoop,i=new P.CustomEvent(e.MEDIA_LOOP_REQUEST,{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(i)}}lr.getSlotTemplateHTML=function(e){return`\n      <style>\n        :host {\n          min-width: 4ch;\n          padding: var(--media-button-padding, var(--media-control-padding, 10px 5px));\n          width: 100%;\n          display: grid;\n          grid-template-columns: 1fr auto;\n          gap: 1rem;\n          font-weight: var(--media-button-font-weight, normal);\n        }\n\n        #checked-indicator {\n          display: none;\n        }\n\n        :host([${a.MEDIA_LOOP}]) #checked-indicator {\n          display: block;\n        }\n      </style>\n      \n      <span id="icon">\n     </span>\n\n      <div id="checked-indicator">\n        <svg aria-hidden="true" viewBox="0 1 24 24" part="checked-indicator indicator">\n          <path d="m10 15.17 9.193-9.191 1.414 1.414-10.606 10.606-6.364-6.364 1.414-1.414 4.95 4.95Z"/>\n        </svg>\n      </div>\n    `},lr.getTooltipContentHTML=function(){return M("Loop")},P.customElements.get("media-loop-button")||P.customElements.define("media-loop-button",lr);var dr=lr;export{Ji as MediaAirplayButton,sn as MediaCaptionsButton,yn as MediaCastButton,Yi as MediaChromeButton,na as MediaChromeDialog,ua as MediaChromeRange,Ge as MediaContainer,ba as MediaControlBar,Li as MediaController,Ma as MediaDurationDisplay,Ha as MediaErrorDialog,Ka as MediaFullscreenButton,Se as MediaGestureReceiver,Fa as MediaKeyboardShortcutsDialog,is as MediaLiveButton,cs as MediaLoadingIndicator,dr as MediaLoopButton,ps as MediaMuteButton,As as MediaPipButton,Ms as MediaPlayButton,_s as MediaPlaybackRateButton,Cs as MediaPosterImage,Ns as MediaPreviewChapterDisplay,Bs as MediaPreviewThumbnail,Qs as MediaPreviewTimeDisplay,Ys as MediaSeekBackwardButton,Js as MediaSeekForwardButton,ya as MediaTextDisplay,go as MediaTimeDisplay,sr as MediaTimeRange,Wi as MediaTooltip,rr as MediaVolumeRange,p as constants,M as t,y as timeUtils};export default null;
//# sourceMappingURL=/sm/c3cada1c1558901cb6b449564d304049c92112cf552a4b1822ab1b9436ce8cca.map