"use strict";var lh=Object.create;var Tr=Object.defineProperty;var dh=Object.getOwnPropertyDescriptor;var uh=Object.getOwnPropertyNames;var ch=Object.getPrototypeOf,mh=Object.prototype.hasOwnProperty;var hh=(i,e)=>{for(var t in e)Tr(i,t,{get:e[t],enumerable:!0})},kd=(i,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of uh(e))!mh.call(i,r)&&r!==t&&Tr(i,r,{get:()=>e[r],enumerable:!(a=dh(e,r))||a.enumerable});return i};var ph=(i,e,t)=>(t=i!=null?lh(ch(i)):{},kd(e||!i||!i.__esModule?Tr(t,"default",{value:i,enumerable:!0}):t,i)),vh=i=>kd(Tr({},"__esModule",{value:!0}),i);var Oo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)};var R=(i,e,t)=>(Oo(i,e,"read from private field"),t?t.call(i):e.get(i)),X=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Se=(i,e,t,a)=>(Oo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t);var j=(i,e,t)=>(Oo(i,e,"access private method"),t);var df={};hh(df,{MediaError:()=>E.MediaError,default:()=>lf,getVideoAttribute:()=>Ut});module.exports=vh(df);var fi=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class i extends fi{}globalThis.DocumentFragment=i}var va=class extends fi{},No=class extends fi{},fh={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(va)}},fa,Po=class{constructor(e,t={}){X(this,fa,void 0);Se(this,fa,t==null?void 0:t.detail)}get detail(){return R(this,fa)}initCustomEvent(){}};fa=new WeakMap;function Eh(i,e){return new va}var Sd={document:{createElement:Eh},DocumentFragment,customElements:fh,CustomEvent:Po,EventTarget:fi,HTMLElement:va,HTMLVideoElement:No},Id=typeof window=="undefined"||typeof globalThis.customElements=="undefined",Q=Id?Sd:globalThis,Ae=Id?Sd.document:globalThis.document;var p={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_VOLUME_REQUEST:"mediavolumerequest",MEDIA_SEEK_REQUEST:"mediaseekrequest",MEDIA_AIRPLAY_REQUEST:"mediaairplayrequest",MEDIA_ENTER_FULLSCREEN_REQUEST:"mediaenterfullscreenrequest",MEDIA_EXIT_FULLSCREEN_REQUEST:"mediaexitfullscreenrequest",MEDIA_PREVIEW_REQUEST:"mediapreviewrequest",MEDIA_ENTER_PIP_REQUEST:"mediaenterpiprequest",MEDIA_EXIT_PIP_REQUEST:"mediaexitpiprequest",MEDIA_ENTER_CAST_REQUEST:"mediaentercastrequest",MEDIA_EXIT_CAST_REQUEST:"mediaexitcastrequest",MEDIA_SHOW_TEXT_TRACKS_REQUEST:"mediashowtexttracksrequest",MEDIA_HIDE_TEXT_TRACKS_REQUEST:"mediahidetexttracksrequest",MEDIA_SHOW_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_TOGGLE_SUBTITLES_REQUEST:"mediatogglesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",MEDIA_RENDITION_REQUEST:"mediarenditionrequest",MEDIA_AUDIO_TRACK_REQUEST:"mediaaudiotrackrequest",MEDIA_SEEK_TO_LIVE_REQUEST:"mediaseektoliverequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},k={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},Uo={MEDIA_AIRPLAY_UNAVAILABLE:"mediaAirplayUnavailable",MEDIA_FULLSCREEN_UNAVAILABLE:"mediaFullscreenUnavailable",MEDIA_PIP_UNAVAILABLE:"mediaPipUnavailable",MEDIA_CAST_UNAVAILABLE:"mediaCastUnavailable",MEDIA_RENDITION_UNAVAILABLE:"mediaRenditionUnavailable",MEDIA_AUDIO_TRACK_UNAVAILABLE:"mediaAudioTrackUnavailable",MEDIA_WIDTH:"mediaWidth",MEDIA_HEIGHT:"mediaHeight",MEDIA_PAUSED:"mediaPaused",MEDIA_HAS_PLAYED:"mediaHasPlayed",MEDIA_ENDED:"mediaEnded",MEDIA_MUTED:"mediaMuted",MEDIA_VOLUME_LEVEL:"mediaVolumeLevel",MEDIA_VOLUME:"mediaVolume",MEDIA_VOLUME_UNAVAILABLE:"mediaVolumeUnavailable",MEDIA_IS_PIP:"mediaIsPip",MEDIA_IS_CASTING:"mediaIsCasting",MEDIA_IS_AIRPLAYING:"mediaIsAirplaying",MEDIA_SUBTITLES_LIST:"mediaSubtitlesList",MEDIA_SUBTITLES_SHOWING:"mediaSubtitlesShowing",MEDIA_IS_FULLSCREEN:"mediaIsFullscreen",MEDIA_PLAYBACK_RATE:"mediaPlaybackRate",MEDIA_CURRENT_TIME:"mediaCurrentTime",MEDIA_DURATION:"mediaDuration",MEDIA_SEEKABLE:"mediaSeekable",MEDIA_PREVIEW_TIME:"mediaPreviewTime",MEDIA_PREVIEW_IMAGE:"mediaPreviewImage",MEDIA_PREVIEW_COORDS:"mediaPreviewCoords",MEDIA_PREVIEW_CHAPTER:"mediaPreviewChapter",MEDIA_LOADING:"mediaLoading",MEDIA_BUFFERED:"mediaBuffered",MEDIA_STREAM_TYPE:"mediaStreamType",MEDIA_TARGET_LIVE_WINDOW:"mediaTargetLiveWindow",MEDIA_TIME_IS_LIVE:"mediaTimeIsLive",MEDIA_RENDITION_LIST:"mediaRenditionList",MEDIA_RENDITION_SELECTED:"mediaRenditionSelected",MEDIA_AUDIO_TRACK_LIST:"mediaAudioTrackList",MEDIA_AUDIO_TRACK_ENABLED:"mediaAudioTrackEnabled",MEDIA_CHAPTERS_CUES:"mediaChaptersCues"},Cd=Object.entries(Uo),o=Cd.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{}),bh={USER_INACTIVE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},ot=Cd.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{...bh}),pf=Object.entries(ot).reduce((i,[e,t])=>{let a=o[e];return a&&(i[t]=a),i},{userinactivechange:"userinactive"}),Md=Object.entries(o).reduce((i,[e,t])=>{let a=ot[e];return a&&(i[t]=a),i},{userinactive:"userinactivechange"}),pe={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},_t={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Bo={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},Te={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},Me={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var Ld={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};var I={ENTER_AIRPLAY:"Start airplay",EXIT_AIRPLAY:"Stop airplay",AUDIO_TRACK_MENU:"Audio",CAPTIONS:"Captions",ENABLE_CAPTIONS:"Enable captions",DISABLE_CAPTIONS:"Disable captions",START_CAST:"Start casting",STOP_CAST:"Stop casting",ENTER_FULLSCREEN:"Enter fullscreen mode",EXIT_FULLSCREEN:"Exit fullscreen mode",MUTE:"Mute",UNMUTE:"Unmute",ENTER_PIP:"Enter picture in picture mode",EXIT_PIP:"Enter picture in picture mode",PLAY:"Play",PAUSE:"Pause",PLAYBACK_RATE:"Playback rate",RENDITIONS:"Quality",SEEK_BACKWARD:"Seek backward",SEEK_FORWARD:"Seek forward",SETTINGS:"Settings"},V={AUDIO_PLAYER:()=>"audio player",VIDEO_PLAYER:()=>"video player",VOLUME:()=>"volume",SEEK:()=>"seek",CLOSED_CAPTIONS:()=>"closed captions",PLAYBACK_RATE:({playbackRate:i=1}={})=>`current playback rate ${i}`,PLAYBACK_TIME:()=>"playback time",MEDIA_LOADING:()=>"media loading",SETTINGS:()=>"settings",AUDIO_TRACKS:()=>"audio tracks",QUALITY:()=>"quality"},Y={PLAY:()=>"play",PAUSE:()=>"pause",MUTE:()=>"mute",UNMUTE:()=>"unmute",ENTER_AIRPLAY:()=>"start airplay",EXIT_AIRPLAY:()=>"stop airplay",ENTER_CAST:()=>"start casting",EXIT_CAST:()=>"stop casting",ENTER_FULLSCREEN:()=>"enter fullscreen mode",EXIT_FULLSCREEN:()=>"exit fullscreen mode",ENTER_PIP:()=>"enter picture in picture mode",EXIT_PIP:()=>"exit picture in picture mode",SEEK_FORWARD_N_SECS:({seekOffset:i=30}={})=>`seek forward ${i} seconds`,SEEK_BACK_N_SECS:({seekOffset:i=30}={})=>`seek back ${i} seconds`,SEEK_LIVE:()=>"seek to live",PLAYING_LIVE:()=>"playing live"},_h={...V,...Y};function Rd(i){return i==null?void 0:i.map(Ah).join(" ")}function wd(i){return i==null?void 0:i.split(/\s+/).map(Th)}function Ah(i){if(i){let{id:e,width:t,height:a}=i;return[e,t,a].filter(r=>r!=null).join(":")}}function Th(i){if(i){let[e,t,a]=i.split(":");return{id:e,width:+t,height:+a}}}function xd(i){return i==null?void 0:i.map(yh).join(" ")}function Dd(i){return i==null?void 0:i.split(/\s+/).map(kh)}function yh(i){if(i){let{id:e,kind:t,language:a,label:r}=i;return[e,t,a,r].filter(n=>n!=null).join(":")}}function kh(i){if(i){let[e,t,a,r]=i.split(":");return{id:e,kind:t,language:a,label:r}}}function Od(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Ei(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}function yr(i){return typeof i!="string"?!1:!isNaN(i)&&!isNaN(parseFloat(i))}var kr=i=>new Promise(e=>setTimeout(e,i));var Nd=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],Sh=(i,e)=>{let t=i===1?Nd[e].singular:Nd[e].plural;return`${i} ${t}`},Ht=i=>{if(!Ei(i))return"";let e=Math.abs(i),t=e!==i,a=new Date(0,0,0,0,0,e,0);return`${[a.getHours(),a.getMinutes(),a.getSeconds()].map((l,u)=>l&&Sh(l,u)).filter(l=>l).join(", ")}${t?" remaining":""}`};function Pe(i,e){let t=!1;i<0&&(t=!0,i=0-i),i=i<0?0:i;let a=Math.floor(i%60),r=Math.floor(i/60%60),n=Math.floor(i/3600),s=Math.floor(e/60%60),l=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(n=r=a="0"),n=n>0||l>0?n+":":"",r=((n||s>=10)&&r<10?"0"+r:r)+":",a=a<10?"0"+a:a,(t?"-":"")+n+r+a}var bf=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}});var Sr=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},Ir=class extends Sr{},Cr=class extends Ir{constructor(){super(...arguments),this.role=null}},Ho=class{observe(){}unobserve(){}disconnect(){}},Pd={createElement:function(){return new Ea.HTMLElement},createElementNS:function(){return new Ea.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(i){return!1}},Ea={ResizeObserver:Ho,document:Pd,Node:Ir,Element:Cr,HTMLElement:class extends Cr{constructor(){super(...arguments),this.innerHTML=""}get content(){return new Ea.DocumentFragment}},DocumentFragment:class extends Sr{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},localStorage:{getItem(i){return null},setItem(i,e){},removeItem(i){}},CustomEvent:function(){},getComputedStyle:function(){},navigator:{languages:[],get userAgent(){return""}},matchMedia(i){return{matches:!1,media:i}}},Ud=typeof window=="undefined"||typeof window.customElements=="undefined",Bd=Object.keys(Ea).every(i=>i in globalThis),d=Ud&&!Bd?Ea:globalThis,m=Ud&&!Bd?Pd:globalThis.document;var Hd=new WeakMap,Wo=i=>{let e=Hd.get(i);return e||Hd.set(i,e=new Set),e},Wd=new d.ResizeObserver(i=>{for(let e of i)for(let t of Wo(e.target))t(e)});function st(i,e){Wo(i).add(e),Wd.observe(i)}function Wt(i,e){let t=Wo(i);t.delete(e),t.size||Wd.unobserve(i)}function Z(i){var e;return(e=Mr(i))!=null?e:Ue(i,"media-controller")}function Mr(i){var e;let{MEDIA_CONTROLLER:t}=k,a=i.getAttribute(t);if(a)return(e=$t(i))==null?void 0:e.getElementById(a)}var Lr=(i,e,t=".value")=>{let a=i.querySelector(t);a&&(a.textContent=e)},Ch=(i,e)=>{let t=`slot[name="${e}"]`,a=i.shadowRoot.querySelector(t);return a?a.children:[]},Rr=(i,e)=>Ch(i,e)[0],ce=(i,e)=>!i||!e?!1:i!=null&&i.contains(e)?!0:ce(i,e.getRootNode().host),Ue=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||Ue(i.getRootNode().host,e)};function ba(i=document){var e;let t=i==null?void 0:i.activeElement;return t?(e=ba(t.shadowRoot))!=null?e:t:null}function $t(i){var e;let t=(e=i==null?void 0:i.getRootNode)==null?void 0:e.call(i);return t instanceof ShadowRoot||t instanceof Document?t:null}function $d(i,e=3){if(i.checkVisibility)return i.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0});let t=i;for(;t&&e>0;){let a=getComputedStyle(t);if(a.opacity==="0"||a.visibility==="hidden"||a.display==="none")return!1;t=t.parentElement,e--}return!0}function Fd(i,e,t,a){let r=$o(t,a),n=$o(t,{x:i,y:e}),s=$o(a,{x:i,y:e});return n>r||s>r?n>s?1:0:n/r}function $o(i,e){return Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2))}function W(i,e){let t=Mh(i,a=>a===e);return t||Fo(i,e)}function Mh(i,e){var t,a;let r;for(r of(t=i.querySelectorAll("style:not([media])"))!=null?t:[]){let n;try{n=(a=r.sheet)==null?void 0:a.cssRules}catch{continue}for(let s of n!=null?n:[])if(e(s.selectorText))return s}}function Fo(i,e){var t,a;let r=(t=i.querySelectorAll("style:not([media])"))!=null?t:[],n=r==null?void 0:r[r.length-1];return n!=null&&n.sheet?(n==null||n.sheet.insertRule(`${e}{}`,n.sheet.cssRules.length),(a=n.sheet.cssRules)==null?void 0:a[n.sheet.cssRules.length-1]):(console.warn("Media Chrome: No style sheet found on style tag of",i),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}})}function w(i,e,t=Number.NaN){let a=i.getAttribute(e);return a!=null?+a:t}function P(i,e,t){let a=+t;if(t==null||Number.isNaN(a)){i.hasAttribute(e)&&i.removeAttribute(e);return}w(i,e,void 0)!==a&&i.setAttribute(e,`${a}`)}function H(i,e){return i.hasAttribute(e)}function B(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}H(i,e)!=t&&i.toggleAttribute(e,t)}function x(i,e,t=null){var a;return(a=i.getAttribute(e))!=null?a:t}function M(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}let a=`${t}`;x(i,e,void 0)!==a&&i.setAttribute(e,a)}var Kd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},At=(i,e,t)=>(Kd(i,e,"read from private field"),t?t.call(i):e.get(i)),Lh=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},wr=(i,e,t,a)=>(Kd(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ve,Vd=m.createElement("template");Vd.innerHTML=`
`;var Ko=class extends d.HTMLElement{constructor(e={}){if(super(),Lh(this,ve,void 0),!this.shadowRoot){let t=this.attachShadow({mode:"open"}),a=Vd.content.cloneNode(!0);this.nativeEl=a;let r=e.slotTemplate;r||(r=m.createElement("template"),r.innerHTML=`${e.defaultContent||""} `),this.nativeEl.appendChild(r.content.cloneNode(!0)),t.appendChild(a)}}static get observedAttributes(){return[k.MEDIA_CONTROLLER,o.MEDIA_PAUSED]}attributeChangedCallback(e,t,a){var r,n,s,l,u;e===k.MEDIA_CONTROLLER&&(t&&((n=(r=At(this,ve))==null?void 0:r.unassociateElement)==null||n.call(r,this),wr(this,ve,null)),a&&this.isConnected&&(wr(this,ve,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=At(this,ve))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,t,a,r;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),wr(this,ve,Rh(this)),this.getAttribute(k.MEDIA_CONTROLLER)&&((t=(e=At(this,ve))==null?void 0:e.associateElement)==null||t.call(e,this)),(a=At(this,ve))==null||a.addEventListener("pointerdown",this),(r=At(this,ve))==null||r.addEventListener("click",this)}disconnectedCallback(){var e,t,a,r;this.getAttribute(k.MEDIA_CONTROLLER)&&((t=(e=At(this,ve))==null?void 0:e.unassociateElement)==null||t.call(e,this)),(a=At(this,ve))==null||a.removeEventListener("pointerdown",this),(r=At(this,ve))==null||r.removeEventListener("click",this),wr(this,ve,null)}handleEvent(e){var t;let a=(t=e.composedPath())==null?void 0:t[0];if(["video","media-controller"].includes(a==null?void 0:a.localName)){if(e.type==="pointerdown")this._pointerType=e.pointerType;else if(e.type==="click"){let{clientX:n,clientY:s}=e,{left:l,top:u,width:c,height:b}=this.getBoundingClientRect(),g=n-l,v=s-u;if(g<0||v<0||g>c||v>b||c===0&&b===0)return;let{pointerType:f=this._pointerType}=e;if(this._pointerType=void 0,f===Bo.TOUCH){this.handleTap(e);return}else if(f===Bo.MOUSE){this.handleMouseClick(e);return}}}}get mediaPaused(){return H(this,o.MEDIA_PAUSED)}set mediaPaused(e){B(this,o.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(e){let t=this.mediaPaused?p.MEDIA_PLAY_REQUEST:p.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(t,{composed:!0,bubbles:!0}))}};ve=new WeakMap;function Rh(i){var e;let t=i.getAttribute(k.MEDIA_CONTROLLER);return t?(e=i.getRootNode())==null?void 0:e.getElementById(t):Ue(i,"media-controller")}d.customElements.get("media-gesture-receiver")||d.customElements.define("media-gesture-receiver",Ko);var Go=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Tt=(i,e,t)=>(Go(i,e,"read from private field"),t?t.call(i):e.get(i)),lt=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ga=(i,e,t,a)=>(Go(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Le=(i,e,t)=>(Go(i,e,"access private method"),t),xr,bi,_a,gi,Vo,Yd,Yo,Gd,Aa,Dr,Or,qo,_i,Ta,D={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive"},qd=m.createElement("template");qd.innerHTML=`
`;var wh=Object.values(o),xh="sm:384 md:576 lg:768 xl:960";function Dh(i){Oh(i.target,i.contentRect.width)}function Oh(i,e){var t;if(!i.isConnected)return;let a=(t=i.getAttribute(D.BREAKPOINTS))!=null?t:xh,r=Nh(a),n=Ph(r,e),s=!1;if(Object.keys(r).forEach(l=>{if(n.includes(l)){i.hasAttribute(`breakpoint${l}`)||(i.setAttribute(`breakpoint${l}`,""),s=!0);return}i.hasAttribute(`breakpoint${l}`)&&(i.removeAttribute(`breakpoint${l}`),s=!0)}),s){let l=new CustomEvent(ot.BREAKPOINTS_CHANGE,{detail:n});i.dispatchEvent(l)}}function Nh(i){let e=i.split(/\s+/);return Object.fromEntries(e.map(t=>t.split(":")))}function Ph(i,e){return Object.keys(i).filter(t=>e>=parseInt(i[t]))}var ya=class extends d.HTMLElement{constructor(){super(),lt(this,Vo),lt(this,Yo),lt(this,Aa),lt(this,Or),lt(this,_i),lt(this,xr,0),lt(this,bi,null),lt(this,_a,null),lt(this,gi,void 0),this.breakpointsComputed=!1,this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(qd.content.cloneNode(!0)));let e=s=>{let l=this.media;for(let u of s)u.type==="childList"&&(u.removedNodes.forEach(c=>{if(c.slot=="media"&&u.target==this){let b=u.previousSibling&&u.previousSibling.previousElementSibling;if(!b||!l)this.mediaUnsetCallback(c);else{let g=b.slot!=="media";for(;(b=b.previousSibling)!==null;)b.slot=="media"&&(g=!1);g&&this.mediaUnsetCallback(c)}}}),l&&u.addedNodes.forEach(c=>{c===l&&this.handleMediaUpdated(l)}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0});let a=!1;st(this,s=>{a||(setTimeout(()=>{Dh(s),a=!1,this.breakpointsComputed||(this.breakpointsComputed=!0,this.dispatchEvent(new CustomEvent(ot.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))},0),a=!0)});let n=this.querySelector(":scope > slot[slot=media]");n&&n.addEventListener("slotchange",()=>{if(!n.assignedElements({flatten:!0}).length){Tt(this,bi)&&this.mediaUnsetCallback(Tt(this,bi));return}this.handleMediaUpdated(this.media)})}static get observedAttributes(){return[D.AUTOHIDE,D.GESTURES_DISABLED].concat(wh).filter(e=>![o.MEDIA_RENDITION_LIST,o.MEDIA_AUDIO_TRACK_LIST,o.MEDIA_CHAPTERS_CUES,o.MEDIA_WIDTH,o.MEDIA_HEIGHT].includes(e))}attributeChangedCallback(e,t,a){e.toLowerCase()==D.AUTOHIDE&&(this.autohide=a)}get media(){let e=this.querySelector(":scope > [slot=media]");return(e==null?void 0:e.nodeName)=="SLOT"&&(e=e.assignedElements({flatten:!0})[0]),e}async handleMediaUpdated(e){e&&(ga(this,bi,e),e.localName.includes("-")&&await d.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;let a=this.getAttribute(D.AUDIO)!=null?V.AUDIO_PLAYER():V.VIDEO_PLAYER();this.setAttribute("role","region"),this.setAttribute("aria-label",a),this.handleMediaUpdated(this.media),this.setAttribute(D.USER_INACTIVE,""),this.addEventListener("pointerdown",this),this.addEventListener("pointermove",this),this.addEventListener("pointerup",this),this.addEventListener("mouseleave",this),this.addEventListener("keyup",this),(e=d.window)==null||e.addEventListener("mouseup",this)}disconnectedCallback(){var e;this.media&&this.mediaUnsetCallback(this.media),(e=d.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){ga(this,bi,null)}handleEvent(e){switch(e.type){case"pointerdown":ga(this,xr,e.timeStamp);break;case"pointermove":Le(this,Vo,Yd).call(this,e);break;case"pointerup":Le(this,Yo,Gd).call(this,e);break;case"mouseleave":Le(this,Aa,Dr).call(this);break;case"mouseup":this.removeAttribute(D.KEYBOARD_CONTROL);break;case"keyup":Le(this,_i,Ta).call(this),this.setAttribute(D.KEYBOARD_CONTROL,"");break}}set autohide(e){let t=Number(e);ga(this,gi,isNaN(t)?0:t)}get autohide(){return(Tt(this,gi)===void 0?2:Tt(this,gi)).toString()}};xr=new WeakMap;bi=new WeakMap;_a=new WeakMap;gi=new WeakMap;Vo=new WeakSet;Yd=function(i){i.pointerType!=="mouse"&&i.timeStamp-Tt(this,xr)<250||(Le(this,Or,qo).call(this),clearTimeout(Tt(this,_a)),[this,this.media].includes(i.target)&&Le(this,_i,Ta).call(this))};Yo=new WeakSet;Gd=function(i){if(i.pointerType==="touch"){let e=!this.hasAttribute(D.USER_INACTIVE);[this,this.media].includes(i.target)&&e?Le(this,Aa,Dr).call(this):Le(this,_i,Ta).call(this)}else i.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&Le(this,_i,Ta).call(this)};Aa=new WeakSet;Dr=function(){if(Tt(this,gi)<0||this.hasAttribute(D.USER_INACTIVE))return;this.setAttribute(D.USER_INACTIVE,"");let i=new d.CustomEvent(ot.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(i)};Or=new WeakSet;qo=function(){if(!this.hasAttribute(D.USER_INACTIVE))return;this.removeAttribute(D.USER_INACTIVE);let i=new d.CustomEvent(ot.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(i)};_i=new WeakSet;Ta=function(){Le(this,Or,qo).call(this),clearTimeout(Tt(this,_a));let i=parseInt(this.autohide);i<0||ga(this,_a,setTimeout(()=>{Le(this,Aa,Dr).call(this)},i*1e3))};d.customElements.get("media-container")||d.customElements.define("media-container",ya);var Zd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},re=(i,e,t)=>(Zd(i,e,"read from private field"),t?t.call(i):e.get(i)),ka=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Nr=(i,e,t,a)=>(Zd(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ai,Ti,Pr,Ft,dt,yt,Be=class{constructor(e,t,{defaultValue:a}={defaultValue:void 0}){ka(this,dt),ka(this,Ai,void 0),ka(this,Ti,void 0),ka(this,Pr,void 0),ka(this,Ft,new Set),Nr(this,Ai,e),Nr(this,Ti,t),Nr(this,Pr,new Set(a))}[Symbol.iterator](){return re(this,dt,yt).values()}get length(){return re(this,dt,yt).size}get value(){var e;return(e=[...re(this,dt,yt)].join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(Nr(this,Ft,new Set),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return[...re(this,dt,yt)][e]}values(){return re(this,dt,yt).values()}forEach(e,t){re(this,dt,yt).forEach(e,t)}add(...e){var t,a;e.forEach(r=>re(this,Ft).add(r)),!(this.value===""&&!((t=re(this,Ai))!=null&&t.hasAttribute(`${re(this,Ti)}`)))&&((a=re(this,Ai))==null||a.setAttribute(`${re(this,Ti)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>re(this,Ft).delete(a)),(t=re(this,Ai))==null||t.setAttribute(`${re(this,Ti)}`,`${this.value}`)}contains(e){return re(this,dt,yt).has(e)}toggle(e,t){return typeof t!="undefined"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){return this.remove(e),this.add(t),e===t}};Ai=new WeakMap;Ti=new WeakMap;Pr=new WeakMap;Ft=new WeakMap;dt=new WeakSet;yt=function(){return re(this,Ft).size?re(this,Ft):re(this,Pr)};var Uh=(i="")=>i.split(/\s+/),Qd=(i="")=>{let[e,t,a]=i.split(":"),r=a?decodeURIComponent(a):void 0;return{kind:e==="cc"?pe.CAPTIONS:pe.SUBTITLES,language:t,label:r}},Kt=(i="",e={})=>Uh(i).map(t=>{let a=Qd(t);return{...e,...a}}),Zo=i=>i?Array.isArray(i)?i.map(e=>typeof e=="string"?Qd(e):e):typeof i=="string"?Kt(i):[i]:[],Ur=({kind:i,label:e,language:t}={kind:"subtitles"})=>e?`${i==="captions"?"cc":"sb"}:${t}:${encodeURIComponent(e)}`:t,ut=(i=[])=>Array.prototype.map.call(i,Ur).join(" "),Bh=(i,e)=>t=>t[i]===e,zd=i=>{let e=Object.entries(i).map(([t,a])=>Bh(t,a));return t=>e.every(a=>a(t))},Vt=(i,e=[],t=[])=>{let a=Zo(t).map(zd),r=n=>a.some(s=>s(n));Array.from(e).filter(r).forEach(n=>{n.mode=i})},Yt=(i,e=()=>!0)=>{if(!(i!=null&&i.textTracks))return[];let t=typeof e=="function"?e:zd(e);return Array.from(i.textTracks).filter(t)},Br=i=>{var e;return!!((e=i.mediaSubtitlesShowing)!=null&&e.length)||i.hasAttribute(o.MEDIA_SUBTITLES_SHOWING)};var Jd=i=>{var e;let{media:t,fullscreenElement:a}=i,r=a&&"requestFullscreen"in a?"requestFullscreen":a&&"webkitRequestFullScreen"in a?"webkitRequestFullScreen":void 0;if(r){let n=(e=a[r])==null?void 0:e.call(a);if(n instanceof Promise)return n.catch(()=>{})}else t!=null&&t.webkitEnterFullscreen?t.webkitEnterFullscreen():t!=null&&t.requestFullscreen&&t.requestFullscreen()},Xd="exitFullscreen"in m?"exitFullscreen":"webkitExitFullscreen"in m?"webkitExitFullscreen":"webkitCancelFullScreen"in m?"webkitCancelFullScreen":void 0,jd=i=>{var e;let{documentElement:t}=i;if(Xd){let a=(e=t==null?void 0:t[Xd])==null?void 0:e.call(t);if(a instanceof Promise)return a.catch(()=>{})}},Sa="fullscreenElement"in m?"fullscreenElement":"webkitFullscreenElement"in m?"webkitFullscreenElement":void 0,Hh=i=>{let{documentElement:e,media:t}=i,a=e==null?void 0:e[Sa];return!a&&"webkitDisplayingFullscreen"in t&&"webkitPresentationMode"in t&&t.webkitDisplayingFullscreen&&t.webkitPresentationMode===Ld.FULLSCREEN?t:a},eu=i=>{var e;let{media:t,documentElement:a,fullscreenElement:r=t}=i;if(!t||!a)return!1;let n=Hh(i);if(!n)return!1;if(n===r||n===t)return!0;if(n.localName.includes("-")){let s=n.shadowRoot;if(!(Sa in s))return ce(n,r);for(;s!=null&&s[Sa];){if(s[Sa]===r)return!0;s=(e=s[Sa])==null?void 0:e.shadowRoot}}return!1},Wh="fullscreenEnabled"in m?"fullscreenEnabled":"webkitFullscreenEnabled"in m?"webkitFullscreenEnabled":void 0,tu=i=>{let{documentElement:e,media:t}=i;return!!(e!=null&&e[Wh])||t&&"webkitSupportsFullscreen"in t};var Hr,Qo=()=>{var i,e;return Hr||(Hr=(e=(i=m)==null?void 0:i.createElement)==null?void 0:e.call(i,"video"),Hr)},iu=async(i=Qo())=>{if(!i)return!1;let e=i.volume;return i.volume=e/2+.1,await kr(0),i.volume!==e},$h=/.*Version\/.*Safari\/.*/.test(d.navigator.userAgent),zo=(i=Qo())=>d.matchMedia("(display-mode: standalone)").matches&&$h?!1:typeof(i==null?void 0:i.requestPictureInPicture)=="function",Xo=(i=Qo())=>tu({documentElement:m,media:i}),au=Xo(),ru=zo(),nu=!!d.WebKitPlaybackTargetAvailabilityEvent,ou=!!d.chrome;var yi=i=>Yt(i.media,e=>[pe.SUBTITLES,pe.CAPTIONS].includes(e.kind)).sort((e,t)=>e.kind>=t.kind?1:-1),Jo=i=>Yt(i.media,e=>e.mode===_t.SHOWING&&[pe.SUBTITLES,pe.CAPTIONS].includes(e.kind)),Wr=(i,e)=>{let t=yi(i),a=Jo(i),r=!!a.length;if(t.length){if(e===!1||r&&e!==!0)Vt(_t.DISABLED,t,a);else if(e===!0||!r&&e!==!1){let n=t[0],{options:s}=i;if(!(s!=null&&s.noSubtitlesLangPref)){let b=globalThis.localStorage.getItem("media-chrome-pref-subtitles-lang"),g=b?[b,...globalThis.navigator.languages]:globalThis.navigator.languages,v=t.filter(f=>g.some(L=>f.language.toLowerCase().startsWith(L.split("-")[0]))).sort((f,L)=>{let A=g.findIndex(N=>f.language.toLowerCase().startsWith(N.split("-")[0])),T=g.findIndex(N=>L.language.toLowerCase().startsWith(N.split("-")[0]));return A-T});v[0]&&(n=v[0])}let{language:l,label:u,kind:c}=n;Vt(_t.DISABLED,t,a),Vt(_t.SHOWING,t,[{language:l,label:u,kind:c}])}}},$r=(i,e)=>i===e?!0:typeof i!=typeof e?!1:typeof i=="number"&&Number.isNaN(i)&&Number.isNaN(e)?!0:typeof i!="object"?!1:Array.isArray(i)?Fh(i,e):Object.entries(i).every(([t,a])=>t in e&&$r(a,e[t])),Fh=(i,e)=>{let t=Array.isArray(i),a=Array.isArray(e);return t!==a?!1:t||a?i.length!==e.length?!1:i.every((r,n)=>$r(r,e[n])):!0};var Kh=Object.values(Me),Fr,Vh=iu().then(i=>(Fr=i,Fr)),su=async(...i)=>{await Promise.all(i.filter(e=>e).map(async e=>{if(!("localName"in e&&e instanceof d.HTMLElement))return;let t=e.localName;if(!t.includes("-"))return;let a=d.customElements.get(t);a&&e instanceof a||(await d.customElements.whenDefined(t),d.customElements.upgrade(e))}))},Ia={mediaWidth:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.videoWidth)!=null?e:0},mediaEvents:["resize"]},mediaHeight:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.videoHeight)!=null?e:0},mediaEvents:["resize"]},mediaPaused:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.paused)!=null?e:!0},set(i,e){var t;let{media:a}=e;a&&(i?a.pause():(t=a.play())==null||t.catch(()=>{}))},mediaEvents:["play","playing","pause","emptied"]},mediaHasPlayed:{get(i,e){let{media:t}=i;return t?e?e.type==="playing":!t.paused:!1},mediaEvents:["playing","emptied"]},mediaEnded:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.ended)!=null?e:!1},mediaEvents:["seeked","ended","emptied"]},mediaPlaybackRate:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.playbackRate)!=null?e:1},set(i,e){let{media:t}=e;t&&Number.isFinite(+i)&&(t.playbackRate=+i)},mediaEvents:["ratechange","loadstart"]},mediaMuted:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.muted)!=null?e:!1},set(i,e){let{media:t}=e;t&&(t.muted=i)},mediaEvents:["volumechange"]},mediaVolume:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.volume)!=null?e:1},set(i,e){let{media:t}=e;if(t){try{i==null?d.localStorage.removeItem("media-chrome-pref-volume"):d.localStorage.setItem("media-chrome-pref-volume",i.toString())}catch{}Number.isFinite(+i)&&(t.volume=+i)}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(i,e)=>{let{options:{noVolumePref:t}}=e;if(!t)try{let a=d.localStorage.getItem("media-chrome-pref-volume");if(a==null)return;Ia.mediaVolume.set(+a,e),i(+a)}catch(a){console.debug("Error getting volume pref",a)}}]},mediaVolumeLevel:{get(i){let{media:e}=i;return typeof(e==null?void 0:e.volume)=="undefined"?"high":e.muted||e.volume===0?"off":e.volume<.5?"low":e.volume<.75?"medium":"high"},mediaEvents:["volumechange"]},mediaCurrentTime:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.currentTime)!=null?e:0},set(i,e){let{media:t}=e;!t||!Ei(i)||(t.currentTime=i)},mediaEvents:["timeupdate","loadedmetadata"]},mediaDuration:{get(i){let{media:e,options:{defaultDuration:t}={}}=i;return t&&(!e||!e.duration||Number.isNaN(e.duration)||!Number.isFinite(e.duration))?t:Number.isFinite(e==null?void 0:e.duration)?e.duration:Number.NaN},mediaEvents:["durationchange","loadedmetadata","emptied"]},mediaLoading:{get(i){let{media:e}=i;return(e==null?void 0:e.readyState)<3},mediaEvents:["waiting","playing","emptied"]},mediaSeekable:{get(i){var e;let{media:t}=i;if(!((e=t==null?void 0:t.seekable)!=null&&e.length))return;let a=t.seekable.start(0),r=t.seekable.end(t.seekable.length-1);if(!(!a&&!r))return[Number(a.toFixed(3)),Number(r.toFixed(3))]},mediaEvents:["loadedmetadata","emptied","progress","seekablechange"]},mediaBuffered:{get(i){var e;let{media:t}=i,a=(e=t==null?void 0:t.buffered)!=null?e:[];return Array.from(a).map((r,n)=>[Number(a.start(n).toFixed(3)),Number(a.end(n).toFixed(3))])},mediaEvents:["progress","emptied"]},mediaStreamType:{get(i){let{media:e,options:{defaultStreamType:t}={}}=i,a=[Me.LIVE,Me.ON_DEMAND].includes(t)?t:void 0;if(!e)return a;let{streamType:r}=e;if(Kh.includes(r))return r===Me.UNKNOWN?a:r;let n=e.duration;return n===1/0?Me.LIVE:Number.isFinite(n)?Me.ON_DEMAND:a},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange"]},mediaTargetLiveWindow:{get(i){let{media:e}=i;if(!e)return Number.NaN;let{targetLiveWindow:t}=e,a=Ia.mediaStreamType.get(i);return(t==null||Number.isNaN(t))&&a===Me.LIVE?0:t},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange","targetlivewindowchange"]},mediaTimeIsLive:{get(i){let{media:e,options:{liveEdgeOffset:t=10}={}}=i;if(!e)return!1;if(typeof e.liveEdgeStart=="number")return Number.isNaN(e.liveEdgeStart)?!1:e.currentTime>=e.liveEdgeStart;if(!(Ia.mediaStreamType.get(i)===Me.LIVE))return!1;let r=e.seekable;if(!r)return!0;if(!r.length)return!1;let n=r.end(r.length-1)-t;return e.currentTime>=n},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},mediaSubtitlesList:{get(i){return yi(i).map(({kind:e,label:t,language:a})=>({kind:e,label:t,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},mediaSubtitlesShowing:{get(i){return Jo(i).map(({kind:e,label:t,language:a})=>({kind:e,label:t,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(i,e)=>{var t,a;let{media:r,options:n}=e;if(!r)return;let s=l=>{var u;!n.defaultSubtitles||l&&![pe.CAPTIONS,pe.SUBTITLES].includes((u=l==null?void 0:l.track)==null?void 0:u.kind)||Wr(e,!0)};return(t=r.textTracks)==null||t.addEventListener("addtrack",s),(a=r.textTracks)==null||a.addEventListener("removetrack",s),s(),()=>{var l,u;(l=r.textTracks)==null||l.removeEventListener("addtrack",s),(u=r.textTracks)==null||u.removeEventListener("removetrack",s)}}]},mediaChaptersCues:{get(i){var e;let{media:t}=i;if(!t)return[];let[a]=Yt(t,{kind:pe.CHAPTERS});return Array.from((e=a==null?void 0:a.cues)!=null?e:[]).map(({text:r,startTime:n,endTime:s})=>({text:r,startTime:n,endTime:s}))},mediaEvents:["loadstart","loadedmetadata"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:a}=e;if(!a)return;let r=a.querySelector('track[kind="chapters"][default][src]'),n=(t=a.shadowRoot)==null?void 0:t.querySelector(':is(video,audio) > track[kind="chapters"][default][src]');return r==null||r.addEventListener("load",i),n==null||n.addEventListener("load",i),()=>{r==null||r.removeEventListener("load",i),n==null||n.removeEventListener("load",i)}}]},mediaIsPip:{get(i){var e,t;let{media:a,documentElement:r}=i;if(!a||!r||!r.pictureInPictureElement)return!1;if(r.pictureInPictureElement===a)return!0;if(r.pictureInPictureElement instanceof HTMLMediaElement)return(e=a.localName)!=null&&e.includes("-")?ce(a,r.pictureInPictureElement):!1;if(r.pictureInPictureElement.localName.includes("-")){let n=r.pictureInPictureElement.shadowRoot;for(;n!=null&&n.pictureInPictureElement;){if(n.pictureInPictureElement===a)return!0;n=(t=n.pictureInPictureElement)==null?void 0:t.shadowRoot}}return!1},set(i,e){let{media:t}=e;if(t)if(i){if(!m.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!t.requestPictureInPicture){console.warn("MediaChrome: The current media does not support picture-in-picture");return}let a=()=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};t.requestPictureInPicture().catch(r=>{if(r.code===11){if(!t.src){console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a src set.");return}if(t.readyState===0&&t.preload==="none"){let n=()=>{t.removeEventListener("loadedmetadata",s),t.preload="none"},s=()=>{t.requestPictureInPicture().catch(a),n()};t.addEventListener("loadedmetadata",s),t.preload="metadata",setTimeout(()=>{t.readyState===0&&a(),n()},1e3)}else throw r}else throw r})}else m.pictureInPictureElement&&m.exitPictureInPicture()},mediaEvents:["enterpictureinpicture","leavepictureinpicture"]},mediaRenditionList:{get(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.videoRenditions)!=null?e:[]].map(a=>({...a}))},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaRenditionSelected:{get(i){var e,t,a;let{media:r}=i;return(a=(t=r==null?void 0:r.videoRenditions)==null?void 0:t[(e=r.videoRenditions)==null?void 0:e.selectedIndex])==null?void 0:a.id},set(i,e){let{media:t}=e;if(!(t!=null&&t.videoRenditions)){console.warn("MediaController: Rendition selection not supported by this media.");return}let a=i,r=Array.prototype.findIndex.call(t.videoRenditions,n=>n.id==a);t.videoRenditions.selectedIndex!=r&&(t.videoRenditions.selectedIndex=r)},mediaEvents:["emptied"],videoRenditionsEvents:["addrendition","removerendition","change"]},mediaAudioTrackList:{get(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.audioTracks)!=null?e:[]]},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaAudioTrackEnabled:{get(i){var e,t;let{media:a}=i;return(t=[...(e=a==null?void 0:a.audioTracks)!=null?e:[]].find(r=>r.enabled))==null?void 0:t.id},set(i,e){let{media:t}=e;if(!(t!=null&&t.audioTracks)){console.warn("MediaChrome: Audio track selection not supported by this media.");return}let a=i;for(let r of t.audioTracks)r.enabled=a==r.id},mediaEvents:["emptied"],audioTracksEvents:["addtrack","removetrack","change"]},mediaIsFullscreen:{get(i){return eu(i)},set(i,e){i?Jd(e):jd(e)},rootEvents:["fullscreenchange","webkitfullscreenchange"],mediaEvents:["webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"]},mediaIsCasting:{get(i){var e;let{media:t}=i;return!(t!=null&&t.remote)||((e=t.remote)==null?void 0:e.state)==="disconnected"?!1:!!t.remote.state},set(i,e){var t,a;let{media:r}=e;if(r&&!(i&&((t=r.remote)==null?void 0:t.state)!=="disconnected")&&!(!i&&((a=r.remote)==null?void 0:a.state)!=="connected")){if(typeof r.remote.prompt!="function"){console.warn("MediaChrome: Casting is not supported in this environment");return}r.remote.prompt().catch(()=>{})}},remoteEvents:["connect","connecting","disconnect"]},mediaIsAirplaying:{get(){return!1},set(i,e){let{media:t}=e;if(t){if(!(t.webkitShowPlaybackTargetPicker&&d.WebKitPlaybackTargetAvailabilityEvent)){console.warn("MediaChrome: received a request to select AirPlay but AirPlay is not supported in this environment");return}t.webkitShowPlaybackTargetPicker()}},mediaEvents:["webkitcurrentplaybacktargetiswirelesschanged"]},mediaFullscreenUnavailable:{get(i){let{media:e}=i;if(!au||!Xo(e))return Te.UNSUPPORTED}},mediaPipUnavailable:{get(i){let{media:e}=i;if(!ru||!zo(e))return Te.UNSUPPORTED}},mediaVolumeUnavailable:{get(i){let{media:e}=i;if(Fr===!1||(e==null?void 0:e.volume)==null)return Te.UNSUPPORTED},stateOwnersUpdateHandlers:[i=>{Fr==null&&Vh.then(e=>i(e?void 0:Te.UNSUPPORTED))}]},mediaCastUnavailable:{get(i,{availability:e="not-available"}={}){var t;let{media:a}=i;if(!ou||!((t=a==null?void 0:a.remote)!=null&&t.state))return Te.UNSUPPORTED;if(!(e==null||e==="available"))return Te.UNAVAILABLE},stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:a}=e;return a?(a.disableRemotePlayback||a.hasAttribute("disableremoteplayback")||(t=a==null?void 0:a.remote)==null||t.watchAvailability(n=>{i({availability:n?"available":"not-available"})}).catch(n=>{n.name==="NotSupportedError"?i({availability:null}):i({availability:"not-available"})}),()=>{var n;(n=a==null?void 0:a.remote)==null||n.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaAirplayUnavailable:{get(i,e){if(!nu)return Te.UNSUPPORTED;if((e==null?void 0:e.availability)==="not-available")return Te.UNAVAILABLE},mediaEvents:["webkitplaybacktargetavailabilitychanged"],stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:a}=e;return a?(a.disableRemotePlayback||a.hasAttribute("disableremoteplayback")||(t=a==null?void 0:a.remote)==null||t.watchAvailability(n=>{i({availability:n?"available":"not-available"})}).catch(n=>{n.name==="NotSupportedError"?i({availability:null}):i({availability:"not-available"})}),()=>{var n;(n=a==null?void 0:a.remote)==null||n.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaRenditionUnavailable:{get(i){var e;let{media:t}=i;if(!(t!=null&&t.videoRenditions))return Te.UNSUPPORTED;if(!((e=t.videoRenditions)!=null&&e.length))return Te.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaAudioTrackUnavailable:{get(i){var e,t;let{media:a}=i;if(!(a!=null&&a.audioTracks))return Te.UNSUPPORTED;if(((t=(e=a.audioTracks)==null?void 0:e.length)!=null?t:0)<=1)return Te.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]}};var lu={[p.MEDIA_PREVIEW_REQUEST](i,e,{detail:t}){var a,r,n;let{media:s}=e,l=t!=null?t:void 0,u,c;if(s&&l!=null){let[f]=Yt(s,{kind:pe.METADATA,label:"thumbnails"}),L=Array.prototype.find.call((a=f==null?void 0:f.cues)!=null?a:[],(A,T,N)=>T===0?A.endTime>l:T===N.length-1?A.startTime<=l:A.startTime<=l&&A.endTime>l);if(L){let A=/'^(?:[a-z]+:)?\/\//i.test(L.text)||(r=s==null?void 0:s.querySelector('track[label="thumbnails"]'))==null?void 0:r.src,T=new URL(L.text,A);c=new URLSearchParams(T.hash).get("#xywh").split(",").map(te=>+te),u=T.href}}let b=i.mediaDuration.get(e),v=(n=i.mediaChaptersCues.get(e).find((f,L,A)=>L===A.length-1&&b===f.endTime?f.startTime<=l&&f.endTime>=l:f.startTime<=l&&f.endTime>l))==null?void 0:n.text;return t!=null&&v==null&&(v=""),{mediaPreviewTime:l,mediaPreviewImage:u,mediaPreviewCoords:c,mediaPreviewChapter:v}},[p.MEDIA_PAUSE_REQUEST](i,e){i["mediaPaused"].set(!0,e)},[p.MEDIA_PLAY_REQUEST](i,e){var t;let a="mediaPaused";if(i.mediaStreamType.get(e)===Me.LIVE){let s=!(i.mediaTargetLiveWindow.get(e)>0),l=(t=i.mediaSeekable.get(e))==null?void 0:t[1];s&&l&&i.mediaCurrentTime.set(l,e)}i[a].set(!1,e)},[p.MEDIA_PLAYBACK_RATE_REQUEST](i,e,{detail:t}){let a="mediaPlaybackRate",r=t;i[a].set(r,e)},[p.MEDIA_MUTE_REQUEST](i,e){i["mediaMuted"].set(!0,e)},[p.MEDIA_UNMUTE_REQUEST](i,e){let t="mediaMuted";i.mediaVolume.get(e)||i.mediaVolume.set(.25,e),i[t].set(!1,e)},[p.MEDIA_VOLUME_REQUEST](i,e,{detail:t}){let a="mediaVolume",r=t;r&&i.mediaMuted.get(e)&&i.mediaMuted.set(!1,e),i[a].set(r,e)},[p.MEDIA_SEEK_REQUEST](i,e,{detail:t}){let a="mediaCurrentTime",r=t;i[a].set(r,e)},[p.MEDIA_SEEK_TO_LIVE_REQUEST](i,e){var t;let a="mediaCurrentTime",r=(t=i.mediaSeekable.get(e))==null?void 0:t[1];Number.isNaN(Number(r))||i[a].set(r,e)},[p.MEDIA_SHOW_SUBTITLES_REQUEST](i,e,{detail:t}){var a;let{options:r}=e,n=yi(e),s=Zo(t),l=(a=s[0])==null?void 0:a.language;l&&!r.noSubtitlesLangPref&&d.localStorage.setItem("media-chrome-pref-subtitles-lang",l),Vt(_t.SHOWING,n,s)},[p.MEDIA_DISABLE_SUBTITLES_REQUEST](i,e,{detail:t}){let a=yi(e),r=t!=null?t:[];Vt(_t.DISABLED,a,r)},[p.MEDIA_TOGGLE_SUBTITLES_REQUEST](i,e,{detail:t}){Wr(e,t)},[p.MEDIA_RENDITION_REQUEST](i,e,{detail:t}){let a="mediaRenditionSelected",r=t;i[a].set(r,e)},[p.MEDIA_AUDIO_TRACK_REQUEST](i,e,{detail:t}){let a="mediaAudioTrackEnabled",r=t;i[a].set(r,e)},[p.MEDIA_ENTER_PIP_REQUEST](i,e){let t="mediaIsPip";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[p.MEDIA_EXIT_PIP_REQUEST](i,e){i["mediaIsPip"].set(!1,e)},[p.MEDIA_ENTER_FULLSCREEN_REQUEST](i,e){let t="mediaIsFullscreen";i.mediaIsPip.get(e)&&i.mediaIsPip.set(!1,e),i[t].set(!0,e)},[p.MEDIA_EXIT_FULLSCREEN_REQUEST](i,e){i["mediaIsFullscreen"].set(!1,e)},[p.MEDIA_ENTER_CAST_REQUEST](i,e){let t="mediaIsCasting";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[p.MEDIA_EXIT_CAST_REQUEST](i,e){i["mediaIsCasting"].set(!1,e)},[p.MEDIA_AIRPLAY_REQUEST](i,e){i["mediaIsAirplaying"].set(!0,e)}};var Yh=({media:i,fullscreenElement:e,documentElement:t,stateMediator:a=Ia,requestMap:r=lu,options:n={},monitorStateOwnersOnlyWithSubscriptions:s=!0})=>{let l=[],u={options:{...n}},c=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0}),b=A=>{A!=null&&($r(A,c)||(c=Object.freeze({...c,...A}),l.forEach(T=>T(c))))},g=()=>{let A=Object.entries(a).reduce((T,[N,{get:te}])=>(T[N]=te(u),T),{});b(A)},v={},f,L=async(A,T)=>{var N,te,be,gt,rt,ji,ea,ta,ia,aa,ra,na,oa,sa,la,da;let Ar=!!f;if(f={...u,...f!=null?f:{},...A},Ar)return;await su(...Object.values(A));let nt=l.length>0&&T===0&&s,ua=u.media!==f.media,ca=((N=u.media)==null?void 0:N.textTracks)!==((te=f.media)==null?void 0:te.textTracks),ma=((be=u.media)==null?void 0:be.videoRenditions)!==((gt=f.media)==null?void 0:gt.videoRenditions),ha=((rt=u.media)==null?void 0:rt.audioTracks)!==((ji=f.media)==null?void 0:ji.audioTracks),sd=((ea=u.media)==null?void 0:ea.remote)!==((ta=f.media)==null?void 0:ta.remote),ld=u.documentElement!==f.documentElement,dd=!!u.media&&(ua||nt),ud=!!((ia=u.media)!=null&&ia.textTracks)&&(ca||nt),cd=!!((aa=u.media)!=null&&aa.videoRenditions)&&(ma||nt),md=!!((ra=u.media)!=null&&ra.audioTracks)&&(ha||nt),hd=!!((na=u.media)!=null&&na.remote)&&(sd||nt),pd=!!u.documentElement&&(ld||nt),vd=dd||ud||cd||md||hd||pd,vi=l.length===0&&T===1&&s,fd=!!f.media&&(ua||vi),Ed=!!((oa=f.media)!=null&&oa.textTracks)&&(ca||vi),bd=!!((sa=f.media)!=null&&sa.videoRenditions)&&(ma||vi),gd=!!((la=f.media)!=null&&la.audioTracks)&&(ha||vi),_d=!!((da=f.media)!=null&&da.remote)&&(sd||vi),Ad=!!f.documentElement&&(ld||vi),Td=fd||Ed||bd||gd||_d||Ad;if(!(vd||Td)){Object.entries(f).forEach(([$,pa])=>{u[$]=pa}),g(),f=void 0;return}Object.entries(a).forEach(([$,{get:pa,mediaEvents:th=[],textTracksEvents:ih=[],videoRenditionsEvents:ah=[],audioTracksEvents:rh=[],remoteEvents:nh=[],rootEvents:oh=[],stateOwnersUpdateHandlers:sh=[]}])=>{v[$]||(v[$]={});let ge=J=>{let _e=pa(u,J);b({[$]:_e})},ae;ae=v[$].mediaEvents,th.forEach(J=>{ae&&dd&&(u.media.removeEventListener(J,ae),v[$].mediaEvents=void 0),fd&&(f.media.addEventListener(J,ge),v[$].mediaEvents=ge)}),ae=v[$].textTracksEvents,ih.forEach(J=>{var _e,Ce;ae&&ud&&((_e=u.media.textTracks)==null||_e.removeEventListener(J,ae),v[$].textTracksEvents=void 0),Ed&&((Ce=f.media.textTracks)==null||Ce.addEventListener(J,ge),v[$].textTracksEvents=ge)}),ae=v[$].videoRenditionsEvents,ah.forEach(J=>{var _e,Ce;ae&&cd&&((_e=u.media.videoRenditions)==null||_e.removeEventListener(J,ae),v[$].videoRenditionsEvents=void 0),bd&&((Ce=f.media.videoRenditions)==null||Ce.addEventListener(J,ge),v[$].videoRenditionsEvents=ge)}),ae=v[$].audioTracksEvents,rh.forEach(J=>{var _e,Ce;ae&&md&&((_e=u.media.audioTracks)==null||_e.removeEventListener(J,ae),v[$].audioTracksEvents=void 0),gd&&((Ce=f.media.audioTracks)==null||Ce.addEventListener(J,ge),v[$].audioTracksEvents=ge)}),ae=v[$].remoteEvents,nh.forEach(J=>{var _e,Ce;ae&&hd&&((_e=u.media.remote)==null||_e.removeEventListener(J,ae),v[$].remoteEvents=void 0),_d&&((Ce=f.media.remote)==null||Ce.addEventListener(J,ge),v[$].remoteEvents=ge)}),ae=v[$].rootEvents,oh.forEach(J=>{ae&&pd&&(u.documentElement.removeEventListener(J,ae),v[$].rootEvents=void 0),Ad&&(f.documentElement.addEventListener(J,ge),v[$].rootEvents=ge)});let yd=v[$].stateOwnersUpdateHandlers;sh.forEach(J=>{yd&&vd&&yd(),Td&&(v[$].stateOwnersUpdateHandlers=J(ge,f))})}),Object.entries(f).forEach(([$,pa])=>{u[$]=pa}),g(),f=void 0};return L({media:i,fullscreenElement:e,documentElement:t,options:n}),{dispatch(A){let{type:T,detail:N}=A;if(r[T]){b(r[T](a,u,A));return}T==="mediaelementchangerequest"?L({media:N}):T==="fullscreenelementchangerequest"?L({fullscreenElement:N}):T==="documentelementchangerequest"?L({documentElement:N}):T==="optionschangerequest"&&Object.entries(N!=null?N:{}).forEach(([te,be])=>{u.options[te]=be})},getState(){return c},subscribe(A){return L({},l.length+1),l.push(A),A(c),()=>{let T=l.indexOf(A);T>=0&&(L({},l.length-1),l.splice(T,1))}}}},du=Yh;var is=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},C=(i,e,t)=>(is(i,e,"read from private field"),t?t.call(i):e.get(i)),ct=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},kt=(i,e,t,a)=>(is(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),St=(i,e,t)=>(is(i,e,"access private method"),t),It,Ca,q,Ma,He,Kr,Vr,jo,ki,La,Yr,es,pu=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],uu=10,O={DEFAULT_SUBTITLES:"defaultsubtitles",DEFAULT_STREAM_TYPE:"defaultstreamtype",DEFAULT_DURATION:"defaultduration",FULLSCREEN_ELEMENT:"fullscreenelement",HOTKEYS:"hotkeys",KEYS_USED:"keysused",LIVE_EDGE_OFFSET:"liveedgeoffset",NO_AUTO_SEEK_TO_LIVE:"noautoseektolive",NO_HOTKEYS:"nohotkeys",NO_VOLUME_PREF:"novolumepref",NO_SUBTITLES_LANG_PREF:"nosubtitleslangpref",NO_DEFAULT_STORE:"nodefaultstore",KEYBOARD_FORWARD_SEEK_OFFSET:"keyboardforwardseekoffset",KEYBOARD_BACKWARD_SEEK_OFFSET:"keyboardbackwardseekoffset"},Gr=class extends ya{constructor(){super(),ct(this,Vr),ct(this,ki),ct(this,Yr),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,ct(this,It,new Be(this,O.HOTKEYS)),ct(this,Ca,void 0),ct(this,q,void 0),ct(this,Ma,void 0),ct(this,He,void 0),ct(this,Kr,t=>{var a;(a=C(this,q))==null||a.dispatch(t)}),this.associateElement(this);let e={};kt(this,Ma,t=>{Object.entries(t).forEach(([a,r])=>{if(a in e&&e[a]===r)return;this.propagateMediaState(a,r);let n=a.toLowerCase(),s=new d.CustomEvent(Md[n],{composed:!0,detail:r});this.dispatchEvent(s)}),e=t}),this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(O.NO_HOTKEYS,O.HOTKEYS,O.DEFAULT_STREAM_TYPE,O.DEFAULT_SUBTITLES,O.DEFAULT_DURATION)}get mediaStore(){return C(this,q)}set mediaStore(e){var t,a;if(C(this,q)&&((t=C(this,He))==null||t.call(this),kt(this,He,void 0)),kt(this,q,e),!C(this,q)&&!this.hasAttribute(O.NO_DEFAULT_STORE)){St(this,Vr,jo).call(this);return}kt(this,He,(a=C(this,q))==null?void 0:a.subscribe(C(this,Ma)))}get fullscreenElement(){var e;return(e=C(this,Ca))!=null?e:this}set fullscreenElement(e){var t;this.hasAttribute(O.FULLSCREEN_ELEMENT)&&this.removeAttribute(O.FULLSCREEN_ELEMENT),kt(this,Ca,e),(t=C(this,q))==null||t.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}attributeChangedCallback(e,t,a){var r,n,s,l,u,c;if(super.attributeChangedCallback(e,t,a),e===O.NO_HOTKEYS)a!==t&&a===""?(this.hasAttribute(O.HOTKEYS)&&console.warn("Media Chrome: Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):a!==t&&a===null&&this.enableHotkeys();else if(e===O.HOTKEYS)C(this,It).value=a;else if(e===O.DEFAULT_SUBTITLES&&a!==t)(r=C(this,q))==null||r.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(O.DEFAULT_SUBTITLES)}});else if(e===O.DEFAULT_STREAM_TYPE)(s=C(this,q))==null||s.dispatch({type:"optionschangerequest",detail:{defaultStreamType:(n=this.getAttribute(O.DEFAULT_STREAM_TYPE))!=null?n:void 0}});else if(e===O.LIVE_EDGE_OFFSET)(l=C(this,q))==null||l.dispatch({type:"optionschangerequest",detail:{liveEdgeOffset:this.hasAttribute(O.LIVE_EDGE_OFFSET)?+this.getAttribute(O.LIVE_EDGE_OFFSET):void 0}});else if(e===O.FULLSCREEN_ELEMENT){let b=a?(u=this.getRootNode())==null?void 0:u.getElementById(a):void 0;kt(this,Ca,b),(c=C(this,q))==null||c.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}}connectedCallback(){var e,t;!C(this,q)&&!this.hasAttribute(O.NO_DEFAULT_STORE)&&St(this,Vr,jo).call(this),(e=C(this,q))==null||e.dispatch({type:"documentelementchangerequest",detail:m}),super.connectedCallback(),C(this,q)&&!C(this,He)&&kt(this,He,(t=C(this,q))==null?void 0:t.subscribe(C(this,Ma))),this.enableHotkeys()}disconnectedCallback(){var e,t,a,r;(e=super.disconnectedCallback)==null||e.call(this),C(this,q)&&((t=C(this,q))==null||t.dispatch({type:"documentelementchangerequest",detail:void 0}),(a=C(this,q))==null||a.dispatch({type:p.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})),C(this,He)&&((r=C(this,He))==null||r.call(this),kt(this,He,void 0))}mediaSetCallback(e){var t;super.mediaSetCallback(e),(t=C(this,q))==null||t.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var t;super.mediaUnsetCallback(e),(t=C(this,q))==null||t.dispatch({type:"mediaelementchangerequest",detail:void 0})}propagateMediaState(e,t){hu(this.mediaStateReceivers,e,t)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(t.has(e))return;let a=this.registerMediaStateReceiver.bind(this),r=this.unregisterMediaStateReceiver.bind(this),n=Xh(e,a,r);Object.values(p).forEach(s=>{e.addEventListener(s,C(this,Kr))}),t.set(e,n)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(!t.has(e))return;t.get(e)(),t.delete(e),Object.values(p).forEach(r=>{e.removeEventListener(r,C(this,Kr))})}registerMediaStateReceiver(e){if(!e)return;let t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),C(this,q)&&Object.entries(C(this,q).getState()).forEach(([r,n])=>{hu([e],r,n)}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,a=t.indexOf(e);a<0||t.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",St(this,Yr,es))}disableHotkeys(){this.removeEventListener("keydown",St(this,Yr,es)),this.removeEventListener("keyup",St(this,ki,La))}get hotkeys(){return C(this,It)}keyboardShortcutHandler(e){var t,a,r,n,s;let l=e.target;if(((r=(a=(t=l.getAttribute(O.KEYS_USED))==null?void 0:t.split(" "))!=null?a:l==null?void 0:l.keysUsed)!=null?r:[]).map(v=>v==="Space"?" ":v).filter(Boolean).includes(e.key))return;let c,b,g;if(!C(this,It).contains(`no${e.key.toLowerCase()}`)&&!(e.key===" "&&C(this,It).contains("nospace")))switch(e.key){case" ":case"k":c=C(this,q).getState().mediaPaused?p.MEDIA_PLAY_REQUEST:p.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new d.CustomEvent(c,{composed:!0,bubbles:!0}));break;case"m":c=this.mediaStore.getState().mediaVolumeLevel==="off"?p.MEDIA_UNMUTE_REQUEST:p.MEDIA_MUTE_REQUEST,this.dispatchEvent(new d.CustomEvent(c,{composed:!0,bubbles:!0}));break;case"f":c=this.mediaStore.getState().mediaIsFullscreen?p.MEDIA_EXIT_FULLSCREEN_REQUEST:p.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new d.CustomEvent(c,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new d.CustomEvent(p.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":{let v=this.hasAttribute(O.KEYBOARD_BACKWARD_SEEK_OFFSET)?+this.getAttribute(O.KEYBOARD_BACKWARD_SEEK_OFFSET):uu;b=Math.max(((n=this.mediaStore.getState().mediaCurrentTime)!=null?n:0)-v,0),g=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:b}),this.dispatchEvent(g);break}case"ArrowRight":{let v=this.hasAttribute(O.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(O.KEYBOARD_FORWARD_SEEK_OFFSET):uu;b=Math.max(((s=this.mediaStore.getState().mediaCurrentTime)!=null?s:0)+v,0),g=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:b}),this.dispatchEvent(g);break}default:break}}};It=new WeakMap;Ca=new WeakMap;q=new WeakMap;Ma=new WeakMap;He=new WeakMap;Kr=new WeakMap;Vr=new WeakSet;jo=function(){var i;this.mediaStore=du({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(O.DEFAULT_SUBTITLES),defaultDuration:this.hasAttribute(O.DEFAULT_DURATION)?+this.getAttribute(O.DEFAULT_DURATION):void 0,defaultStreamType:(i=this.getAttribute(O.DEFAULT_STREAM_TYPE))!=null?i:void 0,liveEdgeOffset:this.hasAttribute(O.LIVE_EDGE_OFFSET)?+this.getAttribute(O.LIVE_EDGE_OFFSET):void 0,noVolumePref:this.hasAttribute(O.NO_VOLUME_PREF),noSubtitlesLangPref:this.hasAttribute(O.NO_SUBTITLES_LANG_PREF)}})};ki=new WeakSet;La=function(i){let{key:e}=i;if(!pu.includes(e)){this.removeEventListener("keyup",St(this,ki,La));return}this.keyboardShortcutHandler(i)};Yr=new WeakSet;es=function(i){let{metaKey:e,altKey:t,key:a}=i;if(e||t||!pu.includes(a)){this.removeEventListener("keyup",St(this,ki,La));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(C(this,It).contains(`no${a.toLowerCase()}`)||a===" "&&C(this,It).contains("nospace"))&&i.preventDefault(),this.addEventListener("keyup",St(this,ki,La),{once:!0})};var Gh=Object.values(o),qh=Object.values(Uo),vu=i=>{var e,t,a,r;let{observedAttributes:n}=i.constructor;!n&&((e=i.nodeName)!=null&&e.includes("-"))&&(d.customElements.upgrade(i),{observedAttributes:n}=i.constructor);let s=(r=(a=(t=i==null?void 0:i.getAttribute)==null?void 0:t.call(i,k.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(n||s)?(n||s).filter(l=>Gh.includes(l)):[]},Zh=i=>{var e,t;return(e=i.nodeName)!=null&&e.includes("-")&&d.customElements.get((t=i.nodeName)==null?void 0:t.toLowerCase())&&!(i instanceof d.customElements.get(i.nodeName.toLowerCase()))&&d.customElements.upgrade(i),qh.some(a=>a in i)},ts=i=>Zh(i)||!!vu(i).length,cu=i=>{var e;return(e=i==null?void 0:i.join)==null?void 0:e.call(i,":")},mu={[o.MEDIA_SUBTITLES_LIST]:ut,[o.MEDIA_SUBTITLES_SHOWING]:ut,[o.MEDIA_SEEKABLE]:cu,[o.MEDIA_BUFFERED]:i=>i==null?void 0:i.map(cu).join(" "),[o.MEDIA_PREVIEW_COORDS]:i=>i==null?void 0:i.join(" "),[o.MEDIA_RENDITION_LIST]:Rd,[o.MEDIA_AUDIO_TRACK_LIST]:xd},Qh=async(i,e,t)=>{var a,r;if(i.isConnected||await kr(0),typeof t=="boolean"||t==null)return B(i,e,t);if(typeof t=="number")return P(i,e,t);if(typeof t=="string")return M(i,e,t);if(Array.isArray(t)&&!t.length)return i.removeAttribute(e);let n=(r=(a=mu[e])==null?void 0:a.call(mu,t))!=null?r:t;return i.setAttribute(e,n)},zh=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},Gt=(i,e)=>{if(zh(i))return;let t=(r,n)=>{var s,l;ts(r)&&n(r);let{children:u=[]}=r!=null?r:{},c=(l=(s=r==null?void 0:r.shadowRoot)==null?void 0:s.children)!=null?l:[];[...u,...c].forEach(g=>Gt(g,n))},a=i==null?void 0:i.nodeName.toLowerCase();if(a.includes("-")&&!ts(i)){d.customElements.whenDefined(a).then(()=>{t(i,e)});return}t(i,e)},hu=(i,e,t)=>{i.forEach(a=>{if(e in a){a[e]=t;return}let r=vu(a),n=e.toLowerCase();r.includes(n)&&Qh(a,n,t)})},Xh=(i,e,t)=>{Gt(i,e);let a=b=>{var g;let v=(g=b==null?void 0:b.composedPath()[0])!=null?g:b.target;e(v)},r=b=>{var g;let v=(g=b==null?void 0:b.composedPath()[0])!=null?g:b.target;t(v)};i.addEventListener(p.REGISTER_MEDIA_STATE_RECEIVER,a),i.addEventListener(p.UNREGISTER_MEDIA_STATE_RECEIVER,r);let n=b=>{b.forEach(g=>{let{addedNodes:v=[],removedNodes:f=[],type:L,target:A,attributeName:T}=g;L==="childList"?(Array.prototype.forEach.call(v,N=>Gt(N,e)),Array.prototype.forEach.call(f,N=>Gt(N,t))):L==="attributes"&&T===k.MEDIA_CHROME_ATTRIBUTES&&(ts(A)?e(A):t(A))})},s=[],l=b=>{let g=b.target;g.name!=="media"&&(s.forEach(v=>Gt(v,t)),s=[...g.assignedElements({flatten:!0})],s.forEach(v=>Gt(v,e)))};i.addEventListener("slotchange",l);let u=new MutationObserver(n);return u.observe(i,{childList:!0,attributes:!0,subtree:!0}),()=>{Gt(i,t),i.removeEventListener("slotchange",l),u.disconnect(),i.removeEventListener(p.REGISTER_MEDIA_STATE_RECEIVER,a),i.removeEventListener(p.UNREGISTER_MEDIA_STATE_RECEIVER,r)}};d.customElements.get("media-controller")||d.customElements.define("media-controller",Gr);var as=Gr;var ns=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ee=(i,e,t)=>(ns(i,e,"read from private field"),t?t.call(i):e.get(i)),Si=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},qr=(i,e,t,a)=>(ns(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Jh=(i,e,t)=>(ns(i,e,"access private method"),t),We,Ci,Ct,Ii,Qr,rs,fu,Zr={TOOLTIP_PLACEMENT:"tooltipplacement"},Eu=m.createElement("template");Eu.innerHTML=`
`;var F=class extends d.HTMLElement{constructor(e={}){var t;if(super(),Si(this,rs),Si(this,We,void 0),this.preventClick=!1,this.tooltipEl=null,this.tooltipContent="",Si(this,Ci,a=>{this.preventClick||this.handleClick(a),setTimeout(ee(this,Ct),0)}),Si(this,Ct,()=>{var a,r;(r=(a=this.tooltipEl)==null?void 0:a.updateXOffset)==null||r.call(a)}),Si(this,Ii,a=>{let{key:r}=a;if(!this.keysUsed.includes(r)){this.removeEventListener("keyup",ee(this,Ii));return}this.preventClick||this.handleClick(a)}),Si(this,Qr,a=>{let{metaKey:r,altKey:n,key:s}=a;if(r||n||!this.keysUsed.includes(s)){this.removeEventListener("keyup",ee(this,Ii));return}this.addEventListener("keyup",ee(this,Ii),{once:!0})}),!this.shadowRoot){this.attachShadow({mode:"open"});let a=Eu.content.cloneNode(!0);this.nativeEl=a;let r=e.slotTemplate;r||(r=m.createElement("template"),r.innerHTML=`${e.defaultContent||""} `),e.tooltipContent&&(a.querySelector('slot[name="tooltip-content"]').innerHTML=(t=e.tooltipContent)!=null?t:"",this.tooltipContent=e.tooltipContent),this.nativeEl.appendChild(r.content.cloneNode(!0)),this.shadowRoot.appendChild(a)}this.tooltipEl=this.shadowRoot.querySelector("media-tooltip")}static get observedAttributes(){return["disabled",Zr.TOOLTIP_PLACEMENT,k.MEDIA_CONTROLLER]}enable(){this.addEventListener("click",ee(this,Ci)),this.addEventListener("keydown",ee(this,Qr)),this.tabIndex=0}disable(){this.removeEventListener("click",ee(this,Ci)),this.removeEventListener("keydown",ee(this,Qr)),this.removeEventListener("keyup",ee(this,Ii)),this.tabIndex=-1}attributeChangedCallback(e,t,a){var r,n,s,l,u;e===k.MEDIA_CONTROLLER?(t&&((n=(r=ee(this,We))==null?void 0:r.unassociateElement)==null||n.call(r,this),qr(this,We,null)),a&&this.isConnected&&(qr(this,We,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=ee(this,We))==null?void 0:l.associateElement)==null||u.call(l,this))):e==="disabled"&&a!==t?a==null?this.enable():this.disable():e===Zr.TOOLTIP_PLACEMENT&&this.tooltipEl&&a!==t&&(this.tooltipEl.placement=a),ee(this,Ct).call(this)}connectedCallback(){var e,t,a;let{style:r}=W(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","button");let n=this.getAttribute(k.MEDIA_CONTROLLER);n&&(qr(this,We,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(t=ee(this,We))==null?void 0:t.associateElement)==null||a.call(t,this)),d.customElements.whenDefined("media-tooltip").then(()=>Jh(this,rs,fu).call(this))}disconnectedCallback(){var e,t;this.disable(),(t=(e=ee(this,We))==null?void 0:e.unassociateElement)==null||t.call(e,this),qr(this,We,null),this.removeEventListener("mouseenter",ee(this,Ct)),this.removeEventListener("focus",ee(this,Ct)),this.removeEventListener("click",ee(this,Ci))}get keysUsed(){return["Enter"," "]}get tooltipPlacement(){return x(this,Zr.TOOLTIP_PLACEMENT)}set tooltipPlacement(e){M(this,Zr.TOOLTIP_PLACEMENT,e)}handleClick(e){}};We=new WeakMap;Ci=new WeakMap;Ct=new WeakMap;Ii=new WeakMap;Qr=new WeakMap;rs=new WeakSet;fu=function(){this.addEventListener("mouseenter",ee(this,Ct)),this.addEventListener("focus",ee(this,Ct)),this.addEventListener("click",ee(this,Ci));let i=this.tooltipPlacement;i&&this.tooltipEl&&(this.tooltipEl.placement=i)};d.customElements.get("media-chrome-button")||d.customElements.define("media-chrome-button",F);var bu=`
`,_u=m.createElement("template");_u.innerHTML=`
${bu}
${bu}
`;var jh=`
${I.ENTER_AIRPLAY}
${I.EXIT_AIRPLAY}
`,gu=i=>{let e=i.mediaIsAirplaying?Y.EXIT_AIRPLAY():Y.ENTER_AIRPLAY();i.setAttribute("aria-label",e)},os=class extends F{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_AIRPLAYING,o.MEDIA_AIRPLAY_UNAVAILABLE]}constructor(e={}){super({slotTemplate:_u,tooltipContent:jh,...e})}connectedCallback(){super.connectedCallback(),gu(this)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_IS_AIRPLAYING&&gu(this)}get mediaIsAirplaying(){return H(this,o.MEDIA_IS_AIRPLAYING)}set mediaIsAirplaying(e){B(this,o.MEDIA_IS_AIRPLAYING,e)}get mediaAirplayUnavailable(){return x(this,o.MEDIA_AIRPLAY_UNAVAILABLE)}set mediaAirplayUnavailable(e){M(this,o.MEDIA_AIRPLAY_UNAVAILABLE,e)}handleClick(){let e=new d.CustomEvent(p.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};d.customElements.get("media-airplay-button")||d.customElements.define("media-airplay-button",os);var ep=`
`,tp=`
`,ku=m.createElement("template");ku.innerHTML=`
${ep}
${tp}
`;var ip=`
${I.ENABLE_CAPTIONS}
${I.DISABLE_CAPTIONS}
`,Au=i=>{i.setAttribute("aria-checked",Br(i).toString())},ss=class extends F{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}constructor(e={}){super({slotTemplate:ku,tooltipContent:ip,...e}),this._captionsReady=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",V.CLOSED_CAPTIONS()),Au(this)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_SUBTITLES_SHOWING&&Au(this)}get mediaSubtitlesList(){return Tu(this,o.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){yu(this,o.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Tu(this,o.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){yu(this,o.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){this.dispatchEvent(new d.CustomEvent(p.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}))}},Tu=(i,e)=>{let t=i.getAttribute(e);return t?Kt(t):[]},yu=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let a=ut(t);i.getAttribute(e)!==a&&i.setAttribute(e,a)};d.customElements.get("media-captions-button")||d.customElements.define("media-captions-button",ss);var ap=' ',rp=' ',Iu=m.createElement("template");Iu.innerHTML=`
${ap}
${rp}
`;var np=`
${I.START_CAST}
${I.STOP_CAST}
`,Su=i=>{let e=i.mediaIsCasting?Y.EXIT_CAST():Y.ENTER_CAST();i.setAttribute("aria-label",e)},ls=class extends F{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_CASTING,o.MEDIA_CAST_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Iu,tooltipContent:np,...e})}connectedCallback(){super.connectedCallback(),Su(this)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_IS_CASTING&&Su(this)}get mediaIsCasting(){return H(this,o.MEDIA_IS_CASTING)}set mediaIsCasting(e){B(this,o.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return x(this,o.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){M(this,o.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){let e=this.mediaIsCasting?p.MEDIA_EXIT_CAST_REQUEST:p.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-cast-button")||d.customElements.define("media-cast-button",ls);var vs=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Mi=(i,e,t)=>(vs(i,e,"read from private field"),t?t.call(i):e.get(i)),qt=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Cu=(i,e,t,a)=>(vs(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ra=(i,e,t)=>(vs(i,e,"access private method"),t),wa,Zt,us,Mu,cs,Lu,ms,Ru,hs,wu,ps,xu,Du=m.createElement("template");Du.innerHTML=`
`;var ds={HIDDEN:"hidden",ANCHOR:"anchor"},zr=class extends d.HTMLElement{constructor(){super(),qt(this,us),qt(this,cs),qt(this,ms),qt(this,hs),qt(this,ps),qt(this,wa,null),qt(this,Zt,null),this.shadowRoot||(this.attachShadow({mode:"open"}),this.nativeEl=this.constructor.template.content.cloneNode(!0),this.shadowRoot.append(this.nativeEl)),this.addEventListener("invoke",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this)}static get observedAttributes(){return[ds.HIDDEN,ds.ANCHOR]}handleEvent(e){switch(e.type){case"invoke":Ra(this,ms,Ru).call(this,e);break;case"focusout":Ra(this,hs,wu).call(this,e);break;case"keydown":Ra(this,ps,xu).call(this,e);break}}connectedCallback(){this.role||(this.role="dialog")}attributeChangedCallback(e,t,a){e===ds.HIDDEN&&a!==t&&(this.hidden?Ra(this,cs,Lu).call(this):Ra(this,us,Mu).call(this))}focus(){Cu(this,wa,ba());let e=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');e==null||e.focus()}get keysUsed(){return["Escape","Tab"]}};wa=new WeakMap;Zt=new WeakMap;us=new WeakSet;Mu=function(){var i;(i=Mi(this,Zt))==null||i.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0})};cs=new WeakSet;Lu=function(){var i;(i=Mi(this,Zt))==null||i.setAttribute("aria-expanded","false")};ms=new WeakSet;Ru=function(i){Cu(this,Zt,i.relatedTarget),ce(this,i.relatedTarget)||(this.hidden=!this.hidden)};hs=new WeakSet;wu=function(i){var e;ce(this,i.relatedTarget)||((e=Mi(this,wa))==null||e.focus(),Mi(this,Zt)&&Mi(this,Zt)!==i.relatedTarget&&!this.hidden&&(this.hidden=!0))};ps=new WeakSet;xu=function(i){var e,t,a,r,n;let{key:s,ctrlKey:l,altKey:u,metaKey:c}=i;l||u||c||this.keysUsed.includes(s)&&(i.preventDefault(),i.stopPropagation(),s==="Tab"?(i.shiftKey?(t=(e=this.previousElementSibling)==null?void 0:e.focus)==null||t.call(e):(r=(a=this.nextElementSibling)==null?void 0:a.focus)==null||r.call(a),this.blur()):s==="Escape"&&((n=Mi(this,wa))==null||n.focus(),this.hidden=!0))};zr.template=Du;d.customElements.get("media-chrome-dialog")||d.customElements.define("media-chrome-dialog",zr);var Ts=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},z=(i,e,t)=>(Ts(i,e,"read from private field"),t?t.call(i):e.get(i)),se=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Mt=(i,e,t,a)=>(Ts(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Re=(i,e,t)=>(Ts(i,e,"access private method"),t),$e,sn,Xr,Jr,we,nn,jr,en,tn,ys,Ou,an,fs,rn,Es,on,ks,bs,Nu,gs,Pu,_s,Uu,As,Bu,Hu=m.createElement("template");Hu.innerHTML=`
`;var Qt=class extends d.HTMLElement{constructor(){super(),se(this,ys),se(this,an),se(this,rn),se(this,on),se(this,bs),se(this,gs),se(this,_s),se(this,As),se(this,$e,void 0),se(this,sn,void 0),se(this,Xr,void 0),se(this,Jr,void 0),se(this,we,{}),se(this,nn,[]),se(this,jr,()=>{if(this.range.matches(":focus-visible")){let{style:e}=W(this.shadowRoot,":host");e.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),se(this,en,()=>{let{style:e}=W(this.shadowRoot,":host");e.removeProperty("--_focus-visible-box-shadow")}),se(this,tn,()=>{let e=this.shadowRoot.querySelector("#segments-clipping");e&&e.parentNode.append(e)}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Hu.content.cloneNode(!0))),this.container=this.shadowRoot.querySelector("#container"),Mt(this,Xr,this.shadowRoot.querySelector("#startpoint")),Mt(this,Jr,this.shadowRoot.querySelector("#endpoint")),this.range=this.shadowRoot.querySelector("#range"),this.appearance=this.shadowRoot.querySelector("#appearance")}static get observedAttributes(){return["disabled","aria-disabled",k.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n,s,l,u;e===k.MEDIA_CONTROLLER?(t&&((n=(r=z(this,$e))==null?void 0:r.unassociateElement)==null||n.call(r,this),Mt(this,$e,null)),a&&this.isConnected&&(Mt(this,$e,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=z(this,$e))==null?void 0:l.associateElement)==null||u.call(l,this))):(e==="disabled"||e==="aria-disabled"&&t!==a)&&(a==null?(this.range.removeAttribute(e),Re(this,an,fs).call(this)):(this.range.setAttribute(e,a),Re(this,rn,Es).call(this)))}connectedCallback(){var e,t,a;let{style:r}=W(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),z(this,we).pointer=W(this.shadowRoot,"#pointer"),z(this,we).progress=W(this.shadowRoot,"#progress"),z(this,we).thumb=W(this.shadowRoot,"#thumb"),z(this,we).activeSegment=W(this.shadowRoot,"#segments-clipping rect:nth-child(0)");let n=this.getAttribute(k.MEDIA_CONTROLLER);n&&(Mt(this,$e,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(t=z(this,$e))==null?void 0:t.associateElement)==null||a.call(t,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",z(this,jr)),this.shadowRoot.addEventListener("focusout",z(this,en)),Re(this,an,fs).call(this),st(this.container,z(this,tn))}disconnectedCallback(){var e,t;Re(this,rn,Es).call(this),(t=(e=z(this,$e))==null?void 0:e.unassociateElement)==null||t.call(e,this),Mt(this,$e,null),this.shadowRoot.removeEventListener("focusin",z(this,jr)),this.shadowRoot.removeEventListener("focusout",z(this,en)),Wt(this.container,z(this,tn))}updatePointerBar(e){var t;(t=z(this,we).pointer)==null||t.style.setProperty("width",`${this.getPointerRatio(e)*100}%`)}updateBar(){var e,t;let a=this.range.valueAsNumber*100;(e=z(this,we).progress)==null||e.style.setProperty("width",`${a}%`),(t=z(this,we).thumb)==null||t.style.setProperty("left",`${a}%`)}updateSegments(e){let t=this.shadowRoot.querySelector("#segments-clipping");if(t.textContent="",this.container.classList.toggle("segments",!!(e!=null&&e.length)),!(e!=null&&e.length))return;let a=[...new Set([+this.range.min,...e.flatMap(n=>[n.start,n.end]),+this.range.max])];Mt(this,nn,[...a]);let r=a.pop();for(let[n,s]of a.entries()){let[l,u]=[n===0,n===a.length-1],c=l?"calc(var(--segments-gap) / -1)":`${s*100}%`,g=`calc(${((u?r:a[n+1])-s)*100}%${l||u?"":" - var(--segments-gap)"})`,v=m.createElementNS("http://www.w3.org/2000/svg","rect"),f=W(this.shadowRoot,`#segments-clipping rect:nth-child(${n+1})`);f.style.setProperty("x",c),f.style.setProperty("width",g),t.append(v)}}getPointerRatio(e){let t=Fd(e.clientX,e.clientY,z(this,Xr).getBoundingClientRect(),z(this,Jr).getBoundingClientRect());return Math.max(0,Math.min(1,t))}get dragging(){return this.hasAttribute("dragging")}handleEvent(e){switch(e.type){case"pointermove":Re(this,As,Bu).call(this,e);break;case"input":this.updateBar();break;case"pointerenter":Re(this,bs,Nu).call(this,e);break;case"pointerdown":Re(this,on,ks).call(this,e);break;case"pointerup":Re(this,gs,Pu).call(this);break;case"pointerleave":Re(this,_s,Uu).call(this);break}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};$e=new WeakMap;sn=new WeakMap;Xr=new WeakMap;Jr=new WeakMap;we=new WeakMap;nn=new WeakMap;jr=new WeakMap;en=new WeakMap;tn=new WeakMap;ys=new WeakSet;Ou=function(i){let e=z(this,we).activeSegment;if(!e)return;let t=this.getPointerRatio(i),r=`#segments-clipping rect:nth-child(${z(this,nn).findIndex((n,s,l)=>{let u=l[s+1];return u!=null&&t>=n&&t<=u})+1})`;(e.selectorText!=r||!e.style.transform)&&(e.selectorText=r,e.style.setProperty("transform","var(--media-range-segment-hover-transform, scaleY(2))"))};an=new WeakSet;fs=function(){this.hasAttribute("disabled")||(this.addEventListener("input",this),this.addEventListener("pointerdown",this),this.addEventListener("pointerenter",this))};rn=new WeakSet;Es=function(){var i,e;this.removeEventListener("input",this),this.removeEventListener("pointerdown",this),this.removeEventListener("pointerenter",this),(i=d.window)==null||i.removeEventListener("pointerup",this),(e=d.window)==null||e.removeEventListener("pointermove",this)};on=new WeakSet;ks=function(i){var e;Mt(this,sn,i.composedPath().includes(this.range)),(e=d.window)==null||e.addEventListener("pointerup",this)};bs=new WeakSet;Nu=function(i){var e;i.pointerType!=="mouse"&&Re(this,on,ks).call(this,i),this.addEventListener("pointerleave",this),(e=d.window)==null||e.addEventListener("pointermove",this)};gs=new WeakSet;Pu=function(){var i;(i=d.window)==null||i.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};_s=new WeakSet;Uu=function(){var i,e;this.removeEventListener("pointerleave",this),(i=d.window)==null||i.removeEventListener("pointermove",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled"),(e=z(this,we).activeSegment)==null||e.style.removeProperty("transform")};As=new WeakSet;Bu=function(i){this.toggleAttribute("dragging",i.buttons===1||i.pointerType!=="mouse"),this.updatePointerBar(i),Re(this,ys,Ou).call(this,i),this.dragging&&(i.pointerType!=="mouse"||!z(this,sn))&&(this.range.disabled=!0,this.range.valueAsNumber=this.getPointerRatio(i),this.range.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})))};d.customElements.get("media-chrome-range")||d.customElements.define("media-chrome-range",Qt);var Wu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ln=(i,e,t)=>(Wu(i,e,"read from private field"),t?t.call(i):e.get(i)),op=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},dn=(i,e,t,a)=>(Wu(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Fe,$u=m.createElement("template");$u.innerHTML=`
`;var Ss=class extends d.HTMLElement{constructor(){super(),op(this,Fe,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild($u.content.cloneNode(!0)))}static get observedAttributes(){return[k.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n,s,l,u;e===k.MEDIA_CONTROLLER&&(t&&((n=(r=ln(this,Fe))==null?void 0:r.unassociateElement)==null||n.call(r,this),dn(this,Fe,null)),a&&this.isConnected&&(dn(this,Fe,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=ln(this,Fe))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(k.MEDIA_CONTROLLER);r&&(dn(this,Fe,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=ln(this,Fe))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=ln(this,Fe))==null?void 0:e.unassociateElement)==null||t.call(e,this),dn(this,Fe,null)}};Fe=new WeakMap;d.customElements.get("media-control-bar")||d.customElements.define("media-control-bar",Ss);var Fu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},un=(i,e,t)=>(Fu(i,e,"read from private field"),t?t.call(i):e.get(i)),sp=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},cn=(i,e,t,a)=>(Fu(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ke,Ku=m.createElement("template");Ku.innerHTML=`
`;var xe=class extends d.HTMLElement{constructor(){super(),sp(this,Ke,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Ku.content.cloneNode(!0)))}static get observedAttributes(){return[k.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n,s,l,u;e===k.MEDIA_CONTROLLER&&(t&&((n=(r=un(this,Ke))==null?void 0:r.unassociateElement)==null||n.call(r,this),cn(this,Ke,null)),a&&this.isConnected&&(cn(this,Ke,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=un(this,Ke))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,t,a;let{style:r}=W(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`);let n=this.getAttribute(k.MEDIA_CONTROLLER);n&&(cn(this,Ke,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(t=un(this,Ke))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=un(this,Ke))==null?void 0:e.unassociateElement)==null||t.call(e,this),cn(this,Ke,null)}};Ke=new WeakMap;d.customElements.get("media-text-display")||d.customElements.define("media-text-display",xe);var Yu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Vu=(i,e,t)=>(Yu(i,e,"read from private field"),t?t.call(i):e.get(i)),lp=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},dp=(i,e,t,a)=>(Yu(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),xa,Is=class extends xe{constructor(){super(),lp(this,xa,void 0),dp(this,xa,this.shadowRoot.querySelector("slot")),Vu(this,xa).textContent=Pe(0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_DURATION]}attributeChangedCallback(e,t,a){e===o.MEDIA_DURATION&&(Vu(this,xa).textContent=Pe(+a)),super.attributeChangedCallback(e,t,a)}get mediaDuration(){return w(this,o.MEDIA_DURATION)}set mediaDuration(e){P(this,o.MEDIA_DURATION,e)}};xa=new WeakMap;d.customElements.get("media-duration-display")||d.customElements.define("media-duration-display",Is);var up=`
`,cp=`
`,qu=m.createElement("template");qu.innerHTML=`
${up}
${cp}
`;var mp=`
${I.ENTER_FULLSCREEN}
${I.EXIT_FULLSCREEN}
`,Gu=i=>{let e=i.mediaIsFullscreen?Y.EXIT_FULLSCREEN():Y.ENTER_FULLSCREEN();i.setAttribute("aria-label",e)},Cs=class extends F{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_FULLSCREEN,o.MEDIA_FULLSCREEN_UNAVAILABLE]}constructor(e={}){super({slotTemplate:qu,tooltipContent:mp,...e})}connectedCallback(){super.connectedCallback(),Gu(this)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_IS_FULLSCREEN&&Gu(this)}get mediaFullscreenUnavailable(){return x(this,o.MEDIA_FULLSCREEN_UNAVAILABLE)}set mediaFullscreenUnavailable(e){M(this,o.MEDIA_FULLSCREEN_UNAVAILABLE,e)}get mediaIsFullscreen(){return H(this,o.MEDIA_IS_FULLSCREEN)}set mediaIsFullscreen(e){B(this,o.MEDIA_IS_FULLSCREEN,e)}handleClick(){let e=this.mediaIsFullscreen?p.MEDIA_EXIT_FULLSCREEN_REQUEST:p.MEDIA_ENTER_FULLSCREEN_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-fullscreen-button")||d.customElements.define("media-fullscreen-button",Cs);var{MEDIA_TIME_IS_LIVE:mn,MEDIA_PAUSED:Da}=o,{MEDIA_SEEK_TO_LIVE_REQUEST:hp,MEDIA_PLAY_REQUEST:pp}=p,vp=' ',Qu=m.createElement("template");Qu.innerHTML=`
${vp}
LIVE
`;var Zu=i=>{let e=i.mediaPaused||!i.mediaTimeIsLive,t=e?Y.SEEK_LIVE():Y.PLAYING_LIVE();i.setAttribute("aria-label",t),e?i.removeAttribute("aria-disabled"):i.setAttribute("aria-disabled","true")},Ms=class extends F{static get observedAttributes(){return[...super.observedAttributes,Da,mn]}constructor(e={}){super({slotTemplate:Qu,...e})}connectedCallback(){Zu(this),super.connectedCallback()}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),Zu(this)}get mediaPaused(){return H(this,o.MEDIA_PAUSED)}set mediaPaused(e){B(this,o.MEDIA_PAUSED,e)}get mediaTimeIsLive(){return H(this,o.MEDIA_TIME_IS_LIVE)}set mediaTimeIsLive(e){B(this,o.MEDIA_TIME_IS_LIVE,e)}handleClick(){!this.mediaPaused&&this.mediaTimeIsLive||(this.dispatchEvent(new d.CustomEvent(hp,{composed:!0,bubbles:!0})),this.hasAttribute(Da)&&this.dispatchEvent(new d.CustomEvent(pp,{composed:!0,bubbles:!0})))}};d.customElements.get("media-live-button")||d.customElements.define("media-live-button",Ms);var Ju=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Oa=(i,e,t)=>(Ju(i,e,"read from private field"),t?t.call(i):e.get(i)),zu=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Na=(i,e,t,a)=>(Ju(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ve,hn,Xu={LOADING_DELAY:"loadingdelay"},ju=500,ec=m.createElement("template"),fp=`
`;ec.innerHTML=`
${fp}
${V.MEDIA_LOADING()}
`;var Ls=class extends d.HTMLElement{constructor(){if(super(),zu(this,Ve,void 0),zu(this,hn,ju),!this.shadowRoot){let e=this.attachShadow({mode:"open"}),t=ec.content.cloneNode(!0);e.appendChild(t)}}static get observedAttributes(){return[k.MEDIA_CONTROLLER,o.MEDIA_PAUSED,o.MEDIA_LOADING,Xu.LOADING_DELAY]}attributeChangedCallback(e,t,a){var r,n,s,l,u;e===Xu.LOADING_DELAY&&t!==a?this.loadingDelay=Number(a):e===k.MEDIA_CONTROLLER&&(t&&((n=(r=Oa(this,Ve))==null?void 0:r.unassociateElement)==null||n.call(r,this),Na(this,Ve,null)),a&&this.isConnected&&(Na(this,Ve,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=Oa(this,Ve))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(k.MEDIA_CONTROLLER);r&&(Na(this,Ve,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=Oa(this,Ve))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Oa(this,Ve))==null?void 0:e.unassociateElement)==null||t.call(e,this),Na(this,Ve,null)}get loadingDelay(){return Oa(this,hn)}set loadingDelay(e){Na(this,hn,e);let{style:t}=W(this.shadowRoot,":host");t.setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return H(this,o.MEDIA_PAUSED)}set mediaPaused(e){B(this,o.MEDIA_PAUSED,e)}get mediaLoading(){return H(this,o.MEDIA_LOADING)}set mediaLoading(e){B(this,o.MEDIA_LOADING,e)}};Ve=new WeakMap;hn=new WeakMap;d.customElements.get("media-loading-indicator")||d.customElements.define("media-loading-indicator",Ls);var{MEDIA_VOLUME_LEVEL:zt}=o,Ep=`
`,tc=`
`,bp=`
`,ac=m.createElement("template");ac.innerHTML=`
${Ep}
${tc}
${tc}
${bp}
`;var gp=`
${I.MUTE}
${I.UNMUTE}
`,ic=i=>{let t=i.mediaVolumeLevel==="off"?Y.UNMUTE():Y.MUTE();i.setAttribute("aria-label",t)},Rs=class extends F{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME_LEVEL]}constructor(e={}){super({slotTemplate:ac,tooltipContent:gp,...e})}connectedCallback(){ic(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_VOLUME_LEVEL&&ic(this),super.attributeChangedCallback(e,t,a)}get mediaVolumeLevel(){return x(this,o.MEDIA_VOLUME_LEVEL)}set mediaVolumeLevel(e){M(this,o.MEDIA_VOLUME_LEVEL,e)}handleClick(){let e=this.mediaVolumeLevel==="off"?p.MEDIA_UNMUTE_REQUEST:p.MEDIA_MUTE_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-mute-button")||d.customElements.define("media-mute-button",Rs);var rc=`
`,oc=m.createElement("template");oc.innerHTML=`
${rc}
${rc}
`;var _p=`
${I.ENTER_PIP}
${I.EXIT_PIP}
`,nc=i=>{let e=i.mediaIsPip?Y.EXIT_PIP():Y.ENTER_PIP();i.setAttribute("aria-label",e)},ws=class extends F{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_PIP,o.MEDIA_PIP_UNAVAILABLE]}constructor(e={}){super({slotTemplate:oc,tooltipContent:_p,...e})}connectedCallback(){nc(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_IS_PIP&&nc(this),super.attributeChangedCallback(e,t,a)}get mediaPipUnavailable(){return x(this,o.MEDIA_PIP_UNAVAILABLE)}set mediaPipUnavailable(e){M(this,o.MEDIA_PIP_UNAVAILABLE,e)}get mediaIsPip(){return H(this,o.MEDIA_IS_PIP)}set mediaIsPip(e){B(this,o.MEDIA_IS_PIP,e)}handleClick(){let e=this.mediaIsPip?p.MEDIA_EXIT_PIP_REQUEST:p.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-pip-button")||d.customElements.define("media-pip-button",ws);var Ap=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},pn=(i,e,t)=>(Ap(i,e,"read from private field"),t?t.call(i):e.get(i)),Tp=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Li,xs={RATES:"rates"},Os=[1,1.2,1.5,1.7,2],Ri=1,sc=m.createElement("template");sc.innerHTML=`
`;var Ds=class extends F{constructor(e={}){super({slotTemplate:sc,tooltipContent:I.PLAYBACK_RATE,...e}),Tp(this,Li,new Be(this,xs.RATES,{defaultValue:Os})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${Ri}x`}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,xs.RATES]}attributeChangedCallback(e,t,a){if(super.attributeChangedCallback(e,t,a),e===xs.RATES&&(pn(this,Li).value=a),e===o.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,n=Number.isNaN(r)?Ri:r;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",V.PLAYBACK_RATE({playbackRate:n}))}}get rates(){return pn(this,Li)}set rates(e){e?Array.isArray(e)&&(pn(this,Li).value=e.join(" ")):pn(this,Li).value=""}get mediaPlaybackRate(){return w(this,o.MEDIA_PLAYBACK_RATE,Ri)}set mediaPlaybackRate(e){P(this,o.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,t;let a=Array.from(this.rates.values(),s=>+s).sort((s,l)=>s-l),r=(t=(e=a.find(s=>s>this.mediaPlaybackRate))!=null?e:a[0])!=null?t:Ri,n=new d.CustomEvent(p.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)}};Li=new WeakMap;d.customElements.get("media-playback-rate-button")||d.customElements.define("media-playback-rate-button",Ds);var yp=`
`,kp=`
`,dc=m.createElement("template");dc.innerHTML=`
${yp}
${kp}
`;var Sp=`
${I.PLAY}
${I.PAUSE}
`,lc=i=>{let e=i.mediaPaused?Y.PLAY():Y.PAUSE();i.setAttribute("aria-label",e)},Ns=class extends F{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PAUSED,o.MEDIA_ENDED]}constructor(e={}){super({slotTemplate:dc,tooltipContent:Sp,...e})}connectedCallback(){lc(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_PAUSED&&lc(this),super.attributeChangedCallback(e,t,a)}get mediaPaused(){return H(this,o.MEDIA_PAUSED)}set mediaPaused(e){B(this,o.MEDIA_PAUSED,e)}handleClick(){let e=this.mediaPaused?p.MEDIA_PLAY_REQUEST:p.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-play-button")||d.customElements.define("media-play-button",Ns);var Ye={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"},uc=m.createElement("template");uc.innerHTML=`
`;var Ip=i=>{i.style.removeProperty("background-image")},Cp=(i,e)=>{i.style["background-image"]=`url('${e}')`},Ps=class extends d.HTMLElement{static get observedAttributes(){return[Ye.PLACEHOLDER_SRC,Ye.SRC]}constructor(){super(),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(uc.content.cloneNode(!0))),this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,t,a){e===Ye.SRC&&(a==null?this.image.removeAttribute(Ye.SRC):this.image.setAttribute(Ye.SRC,a)),e===Ye.PLACEHOLDER_SRC&&(a==null?Ip(this.image):Cp(this.image,a))}get placeholderSrc(){return x(this,Ye.PLACEHOLDER_SRC)}set placeholderSrc(e){M(this,Ye.SRC,e)}get src(){return x(this,Ye.SRC)}set src(e){M(this,Ye.SRC,e)}};d.customElements.get("media-poster-image")||d.customElements.define("media-poster-image",Ps);var cc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Mp=(i,e,t)=>(cc(i,e,"read from private field"),t?t.call(i):e.get(i)),Lp=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Rp=(i,e,t,a)=>(cc(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),vn,Us=class extends xe{constructor(){super(),Lp(this,vn,void 0),Rp(this,vn,this.shadowRoot.querySelector("slot"))}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PREVIEW_CHAPTER]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_PREVIEW_CHAPTER&&a!==t&&a!=null&&(Mp(this,vn).textContent=a,a!==""?this.setAttribute("aria-valuetext",`chapter: ${a}`):this.removeAttribute("aria-valuetext"))}get mediaPreviewChapter(){return x(this,o.MEDIA_PREVIEW_CHAPTER)}set mediaPreviewChapter(e){M(this,o.MEDIA_PREVIEW_CHAPTER,e)}};vn=new WeakMap;d.customElements.get("media-preview-chapter-display")||d.customElements.define("media-preview-chapter-display",Us);var mc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},fn=(i,e,t)=>(mc(i,e,"read from private field"),t?t.call(i):e.get(i)),wp=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},En=(i,e,t,a)=>(mc(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ge,hc=m.createElement("template");hc.innerHTML=`
`;var Bs=class extends d.HTMLElement{constructor(){super(),wp(this,Ge,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(hc.content.cloneNode(!0)))}static get observedAttributes(){return[k.MEDIA_CONTROLLER,o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,t,a;let r=this.getAttribute(k.MEDIA_CONTROLLER);r&&(En(this,Ge,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=fn(this,Ge))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=fn(this,Ge))==null?void 0:e.unassociateElement)==null||t.call(e,this),En(this,Ge,null)}attributeChangedCallback(e,t,a){var r,n,s,l,u;[o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===k.MEDIA_CONTROLLER&&(t&&((n=(r=fn(this,Ge))==null?void 0:r.unassociateElement)==null||n.call(r,this),En(this,Ge,null)),a&&this.isConnected&&(En(this,Ge,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=fn(this,Ge))==null?void 0:l.associateElement)==null||u.call(l,this)))}get mediaPreviewImage(){return x(this,o.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){M(this,o.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewCoords(){let e=this.getAttribute(o.MEDIA_PREVIEW_COORDS);if(e)return e.split(/\s+/).map(t=>+t)}set mediaPreviewCoords(e){if(!e){this.removeAttribute(o.MEDIA_PREVIEW_COORDS);return}this.setAttribute(o.MEDIA_PREVIEW_COORDS,e.join(" "))}update(){let e=this.mediaPreviewCoords,t=this.mediaPreviewImage;if(!(e&&t))return;let[a,r,n,s]=e,l=t.split("#")[0],u=getComputedStyle(this),{maxWidth:c,maxHeight:b,minWidth:g,minHeight:v}=u,f=Math.min(parseInt(c)/n,parseInt(b)/s),L=Math.max(parseInt(g)/n,parseInt(v)/s),A=f<1,T=A?f:L>1?L:1,{style:N}=W(this.shadowRoot,":host"),te=W(this.shadowRoot,"img").style,be=this.shadowRoot.querySelector("img"),gt=A?"min":"max";N.setProperty(`${gt}-width`,"initial","important"),N.setProperty(`${gt}-height`,"initial","important"),N.width=`${n*T}px`,N.height=`${s*T}px`;let rt=()=>{te.width=`${this.imgWidth*T}px`,te.height=`${this.imgHeight*T}px`,te.display="block"};be.src!==l&&(be.onload=()=>{this.imgWidth=be.naturalWidth,this.imgHeight=be.naturalHeight,rt()},be.src=l,rt()),rt(),te.transform=`translate(-${a*T}px, -${r*T}px)`}};Ge=new WeakMap;d.customElements.get("media-preview-thumbnail")||d.customElements.define("media-preview-thumbnail",Bs);var vc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},pc=(i,e,t)=>(vc(i,e,"read from private field"),t?t.call(i):e.get(i)),xp=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Dp=(i,e,t,a)=>(vc(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Pa,Hs=class extends xe{constructor(){super(),xp(this,Pa,void 0),Dp(this,Pa,this.shadowRoot.querySelector("slot")),pc(this,Pa).textContent=Pe(0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_PREVIEW_TIME&&a!=null&&(pc(this,Pa).textContent=Pe(parseFloat(a)))}get mediaPreviewTime(){return w(this,o.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){P(this,o.MEDIA_PREVIEW_TIME,e)}};Pa=new WeakMap;d.customElements.get("media-preview-time-display")||d.customElements.define("media-preview-time-display",Hs);var wi={SEEK_OFFSET:"seekoffset"},bn=30,Op=`${bn} `,fc=m.createElement("template");fc.innerHTML=`
${Op}
`;var Np=0,Ws=class extends F{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,wi.SEEK_OFFSET]}constructor(e={}){super({slotTemplate:fc,tooltipContent:I.SEEK_BACKWARD,...e})}connectedCallback(){this.seekOffset=w(this,wi.SEEK_OFFSET,bn),super.connectedCallback()}attributeChangedCallback(e,t,a){e===wi.SEEK_OFFSET&&(this.seekOffset=w(this,wi.SEEK_OFFSET,bn)),super.attributeChangedCallback(e,t,a)}get seekOffset(){return w(this,wi.SEEK_OFFSET,bn)}set seekOffset(e){P(this,wi.SEEK_OFFSET,e),this.setAttribute("aria-label",Y.SEEK_BACK_N_SECS({seekOffset:this.seekOffset})),Lr(Rr(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return w(this,o.MEDIA_CURRENT_TIME,Np)}set mediaCurrentTime(e){P(this,o.MEDIA_CURRENT_TIME,e)}handleClick(){let e=Math.max(this.mediaCurrentTime-this.seekOffset,0),t=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};d.customElements.get("media-seek-backward-button")||d.customElements.define("media-seek-backward-button",Ws);var xi={SEEK_OFFSET:"seekoffset"},gn=30,Pp=`${gn} `,Ec=m.createElement("template");Ec.innerHTML=`
${Pp}
`;var Up=0,$s=class extends F{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,xi.SEEK_OFFSET]}constructor(e={}){super({slotTemplate:Ec,tooltipContent:I.SEEK_FORWARD,...e})}connectedCallback(){this.seekOffset=w(this,xi.SEEK_OFFSET,gn),super.connectedCallback()}attributeChangedCallback(e,t,a){e===xi.SEEK_OFFSET&&(this.seekOffset=w(this,xi.SEEK_OFFSET,gn)),super.attributeChangedCallback(e,t,a)}get seekOffset(){return w(this,xi.SEEK_OFFSET,gn)}set seekOffset(e){P(this,xi.SEEK_OFFSET,e),this.setAttribute("aria-label",Y.SEEK_FORWARD_N_SECS({seekOffset:this.seekOffset})),Lr(Rr(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return w(this,o.MEDIA_CURRENT_TIME,Up)}set mediaCurrentTime(e){P(this,o.MEDIA_CURRENT_TIME,e)}handleClick(){let e=this.mediaCurrentTime+this.seekOffset,t=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};d.customElements.get("media-seek-forward-button")||d.customElements.define("media-seek-forward-button",$s);var Ac=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Fs=(i,e,t)=>(Ac(i,e,"read from private field"),t?t.call(i):e.get(i)),Bp=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Hp=(i,e,t,a)=>(Ac(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Di,De={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},bc=[...Object.values(De),o.MEDIA_CURRENT_TIME,o.MEDIA_DURATION,o.MEDIA_SEEKABLE],gc=["Enter"," "],Wp=" / ",_c=(i,{timesSep:e=Wp}={})=>{var t,a;let r=i.hasAttribute(De.REMAINING),n=i.hasAttribute(De.SHOW_DURATION),s=(t=i.mediaCurrentTime)!=null?t:0,[,l]=(a=i.mediaSeekable)!=null?a:[],u=0;Number.isFinite(i.mediaDuration)?u=i.mediaDuration:Number.isFinite(l)&&(u=l);let c=r?Pe(0-(u-s)):Pe(s);return n?`${c}${e}${Pe(u)}`:c},$p="video not loaded, unknown time.",Fp=i=>{var e;let t=i.mediaCurrentTime,[,a]=(e=i.mediaSeekable)!=null?e:[],r=null;if(Number.isFinite(i.mediaDuration)?r=i.mediaDuration:Number.isFinite(a)&&(r=a),t==null||r===null){i.setAttribute("aria-valuetext",$p);return}let n=i.hasAttribute(De.REMAINING),s=i.hasAttribute(De.SHOW_DURATION),l=n?Ht(0-(r-t)):Ht(t);if(!s){i.setAttribute("aria-valuetext",l);return}let u=Ht(r),c=`${l} of ${u}`;i.setAttribute("aria-valuetext",c)},Ks=class extends xe{constructor(){super(),Bp(this,Di,void 0),Hp(this,Di,this.shadowRoot.querySelector("slot")),Fs(this,Di).innerHTML=`${_c(this)}`}static get observedAttributes(){return[...super.observedAttributes,...bc,"disabled"]}connectedCallback(){let{style:e}=W(this.shadowRoot,":host(:hover:not([notoggle]))");e.setProperty("cursor","pointer"),e.setProperty("background","var(--media-control-hover-background, rgba(50 50 70 / .7))"),this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","progressbar"),this.setAttribute("aria-label",V.PLAYBACK_TIME());let t=a=>{let{key:r}=a;if(!gc.includes(r)){this.removeEventListener("keyup",t);return}this.toggleTimeDisplay()};this.addEventListener("keydown",a=>{let{metaKey:r,altKey:n,key:s}=a;if(r||n||!gc.includes(s)){this.removeEventListener("keyup",t);return}this.addEventListener("keyup",t)}),this.addEventListener("click",this.toggleTimeDisplay),super.connectedCallback()}toggleTimeDisplay(){this.noToggle||(this.hasAttribute("remaining")?this.removeAttribute("remaining"):this.setAttribute("remaining",""))}disconnectedCallback(){this.disable(),super.disconnectedCallback()}attributeChangedCallback(e,t,a){bc.includes(e)?this.update():e==="disabled"&&a!==t&&(a==null?this.enable():this.disable()),super.attributeChangedCallback(e,t,a)}enable(){this.tabIndex=0}disable(){this.tabIndex=-1}get remaining(){return H(this,De.REMAINING)}set remaining(e){B(this,De.REMAINING,e)}get showDuration(){return H(this,De.SHOW_DURATION)}set showDuration(e){B(this,De.SHOW_DURATION,e)}get noToggle(){return H(this,De.NO_TOGGLE)}set noToggle(e){B(this,De.NO_TOGGLE,e)}get mediaDuration(){return w(this,o.MEDIA_DURATION)}set mediaDuration(e){P(this,o.MEDIA_DURATION,e)}get mediaCurrentTime(){return w(this,o.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){P(this,o.MEDIA_CURRENT_TIME,e)}get mediaSeekable(){let e=this.getAttribute(o.MEDIA_SEEKABLE);if(e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(o.MEDIA_SEEKABLE);return}this.setAttribute(o.MEDIA_SEEKABLE,e.join(":"))}update(){let e=_c(this);Fp(this),e!==Fs(this,Di).innerHTML&&(Fs(this,Di).innerHTML=e)}};Di=new WeakMap;d.customElements.get("media-time-display")||d.customElements.define("media-time-display",Ks);var Tc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ne=(i,e,t)=>(Tc(i,e,"read from private field"),t?t.call(i):e.get(i)),qe=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ye=(i,e,t,a)=>(Tc(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Kp=(i,e,t,a)=>({set _(r){ye(i,e,r,t)},get _(){return ne(i,e,a)}}),Oi,_n,Ni,Ua,An,Tn,yn,Pi,Xt,kn,Sn=class{constructor(e,t,a){qe(this,Oi,void 0),qe(this,_n,void 0),qe(this,Ni,void 0),qe(this,Ua,void 0),qe(this,An,void 0),qe(this,Tn,void 0),qe(this,yn,void 0),qe(this,Pi,void 0),qe(this,Xt,0),qe(this,kn,(r=performance.now())=>{ye(this,Xt,requestAnimationFrame(ne(this,kn))),ye(this,Ua,performance.now()-ne(this,Ni));let n=1e3/this.fps;if(ne(this,Ua)>n){ye(this,Ni,r-ne(this,Ua)%n);let s=1e3/((r-ne(this,_n))/++Kp(this,An)._),l=(r-ne(this,Tn))/1e3/this.duration,u=ne(this,yn)+l*this.playbackRate;u-ne(this,Oi).valueAsNumber>0?ye(this,Pi,this.playbackRate/this.duration/s):(ye(this,Pi,.995*ne(this,Pi)),u=ne(this,Oi).valueAsNumber+ne(this,Pi)),this.callback(u)}}),ye(this,Oi,e),this.callback=t,this.fps=a}start(){ne(this,Xt)===0&&(ye(this,Ni,performance.now()),ye(this,_n,ne(this,Ni)),ye(this,An,0),ne(this,kn).call(this))}stop(){ne(this,Xt)!==0&&(cancelAnimationFrame(ne(this,Xt)),ye(this,Xt,0))}update({start:e,duration:t,playbackRate:a}){let r=e-ne(this,Oi).valueAsNumber,n=Math.abs(t-this.duration);(r>0||r<-.03||n>=.5)&&this.callback(e),ye(this,yn,e),ye(this,Tn,performance.now()),this.duration=t,this.playbackRate=a}};Oi=new WeakMap;_n=new WeakMap;Ni=new WeakMap;Ua=new WeakMap;An=new WeakMap;Tn=new WeakMap;yn=new WeakMap;Pi=new WeakMap;Xt=new WeakMap;kn=new WeakMap;var Zs=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ie=(i,e,t)=>(Zs(i,e,"read from private field"),t?t.call(i):e.get(i)),oe=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ze=(i,e,t,a)=>(Zs(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),de=(i,e,t)=>(Zs(i,e,"access private method"),t),Ui,Jt,Mn,Ha,Ln,Cn,Wa,$a,Bi,Hi,Ba,Qs,yc,Vs,Rn,zs,wn,Xs,xn,Js,Ys,kc,Fa,Dn,Gs,Sc,Vp="video not loaded, unknown time.",Yp=i=>{let e=i.range,t=Ht(+Cc(i)),a=Ht(+i.mediaSeekableEnd),r=t&&a?`${t} of ${a}`:Vp;e.setAttribute("aria-valuetext",r)},Ic=m.createElement("template");Ic.innerHTML=`
`;var In=(i,e=i.mediaCurrentTime)=>{let t=Number.isFinite(i.mediaSeekableStart)?i.mediaSeekableStart:0,a=Number.isFinite(i.mediaDuration)?i.mediaDuration:i.mediaSeekableEnd;if(Number.isNaN(a))return 0;let r=(e-t)/(a-t);return Math.max(0,Math.min(r,1))},Cc=(i,e=i.range.valueAsNumber)=>{let t=Number.isFinite(i.mediaSeekableStart)?i.mediaSeekableStart:0,a=Number.isFinite(i.mediaDuration)?i.mediaDuration:i.mediaSeekableEnd;return Number.isNaN(a)?0:e*(a-t)+t},qs=class extends Qt{constructor(){super(),oe(this,Hi),oe(this,Qs),oe(this,Rn),oe(this,wn),oe(this,xn),oe(this,Ys),oe(this,Fa),oe(this,Gs),oe(this,Ui,void 0),oe(this,Jt,void 0),oe(this,Mn,void 0),oe(this,Ha,void 0),oe(this,Ln,void 0),oe(this,Cn,void 0),oe(this,Wa,void 0),oe(this,$a,void 0),oe(this,Bi,void 0),oe(this,Vs,a=>{this.dragging||(Ei(a)&&(this.range.valueAsNumber=a),this.updateBar())}),this.container.appendChild(Ic.content.cloneNode(!0)),this.shadowRoot.querySelector("#track").insertAdjacentHTML("afterbegin",'
'),Ze(this,Mn,this.shadowRoot.querySelectorAll('[part~="box"]')),Ze(this,Ln,this.shadowRoot.querySelector('[part~="preview-box"]')),Ze(this,Cn,this.shadowRoot.querySelector('[part~="current-box"]'));let t=getComputedStyle(this);Ze(this,Wa,parseInt(t.getPropertyValue("--media-box-padding-left"))),Ze(this,$a,parseInt(t.getPropertyValue("--media-box-padding-right"))),Ze(this,Jt,new Sn(this.range,ie(this,Vs),60))}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PAUSED,o.MEDIA_DURATION,o.MEDIA_SEEKABLE,o.MEDIA_CURRENT_TIME,o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_TIME,o.MEDIA_PREVIEW_CHAPTER,o.MEDIA_BUFFERED,o.MEDIA_PLAYBACK_RATE,o.MEDIA_LOADING,o.MEDIA_ENDED]}connectedCallback(){var e;super.connectedCallback(),this.range.setAttribute("aria-label",V.SEEK()),de(this,Hi,Ba).call(this),Ze(this,Ui,this.getRootNode()),(e=ie(this,Ui))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),de(this,Hi,Ba).call(this),(e=ie(this,Ui))==null||e.removeEventListener("transitionstart",this),Ze(this,Ui,null)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),t!=a&&(e===o.MEDIA_CURRENT_TIME||e===o.MEDIA_PAUSED||e===o.MEDIA_ENDED||e===o.MEDIA_LOADING||e===o.MEDIA_DURATION||e===o.MEDIA_SEEKABLE?(ie(this,Jt).update({start:In(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),de(this,Hi,Ba).call(this),Yp(this)):e===o.MEDIA_BUFFERED&&this.updateBufferedBar(),(e===o.MEDIA_DURATION||e===o.MEDIA_SEEKABLE)&&(this.mediaChaptersCues=ie(this,Bi),this.updateBar()))}get mediaChaptersCues(){return ie(this,Bi)}set mediaChaptersCues(e){var t;Ze(this,Bi,e),this.updateSegments((t=ie(this,Bi))==null?void 0:t.map(a=>({start:In(this,a.startTime),end:In(this,a.endTime)})))}get mediaPaused(){return H(this,o.MEDIA_PAUSED)}set mediaPaused(e){B(this,o.MEDIA_PAUSED,e)}get mediaLoading(){return H(this,o.MEDIA_LOADING)}set mediaLoading(e){B(this,o.MEDIA_LOADING,e)}get mediaDuration(){return w(this,o.MEDIA_DURATION)}set mediaDuration(e){P(this,o.MEDIA_DURATION,e)}get mediaCurrentTime(){return w(this,o.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){P(this,o.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return w(this,o.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){P(this,o.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){let e=this.getAttribute(o.MEDIA_BUFFERED);return e?e.split(" ").map(t=>t.split(":").map(a=>+a)):[]}set mediaBuffered(e){if(!e){this.removeAttribute(o.MEDIA_BUFFERED);return}let t=e.map(a=>a.join(":")).join(" ");this.setAttribute(o.MEDIA_BUFFERED,t)}get mediaSeekable(){let e=this.getAttribute(o.MEDIA_SEEKABLE);if(e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(o.MEDIA_SEEKABLE);return}this.setAttribute(o.MEDIA_SEEKABLE,e.join(":"))}get mediaSeekableEnd(){var e;let[,t=this.mediaDuration]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaSeekableStart(){var e;let[t=0]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaPreviewImage(){return x(this,o.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){M(this,o.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return w(this,o.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){P(this,o.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return H(this,o.MEDIA_ENDED)}set mediaEnded(e){B(this,o.MEDIA_ENDED,e)}updateBar(){super.updateBar(),this.updateBufferedBar(),this.updateCurrentBox()}updateBufferedBar(){var e;let t=this.mediaBuffered;if(!t.length)return;let a;if(this.mediaEnded)a=1;else{let n=this.mediaCurrentTime,[,s=this.mediaSeekableStart]=(e=t.find(([l,u])=>l<=n&&n<=u))!=null?e:[];a=In(this,s)}let{style:r}=W(this.shadowRoot,"#buffered");r.setProperty("width",`${a*100}%`)}updateCurrentBox(){if(!this.shadowRoot.querySelector('slot[name="current"]').assignedElements().length)return;let t=W(this.shadowRoot,"#current-rail"),a=W(this.shadowRoot,'[part~="current-box"]'),r=de(this,Rn,zs).call(this,ie(this,Cn)),n=de(this,wn,Xs).call(this,r,this.range.valueAsNumber),s=de(this,xn,Js).call(this,r,this.range.valueAsNumber);t.style.transform=`translateX(${n})`,t.style.setProperty("--_range-width",`${r.range.width}`),a.style.setProperty("--_box-shift",`${s}`),a.style.setProperty("--_box-width",`${r.box.width}px`),a.style.setProperty("visibility","initial")}handleEvent(e){switch(super.handleEvent(e),e.type){case"input":de(this,Gs,Sc).call(this);break;case"pointermove":de(this,Ys,kc).call(this,e);break;case"pointerup":case"pointerleave":de(this,Fa,Dn).call(this,null);break;case"transitionstart":ce(e.target,this)&&setTimeout(()=>de(this,Hi,Ba).call(this),0);break}}};Ui=new WeakMap;Jt=new WeakMap;Mn=new WeakMap;Ha=new WeakMap;Ln=new WeakMap;Cn=new WeakMap;Wa=new WeakMap;$a=new WeakMap;Bi=new WeakMap;Hi=new WeakSet;Ba=function(){de(this,Qs,yc).call(this)?ie(this,Jt).start():ie(this,Jt).stop()};Qs=new WeakSet;yc=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&$d(this)};Vs=new WeakMap;Rn=new WeakSet;zs=function(i){var e;let a=((e=this.getAttribute("bounds")?Ue(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?e:this).getBoundingClientRect(),r=this.range.getBoundingClientRect(),n=i.offsetWidth,s=-(r.left-a.left-n/2),l=a.right-r.left-n/2;return{box:{width:n,min:s,max:l},bounds:a,range:r}};wn=new WeakSet;Xs=function(i,e){let t=`${e*100}%`,{width:a,min:r,max:n}=i.box;if(!a)return t;if(Number.isNaN(r)||(t=`max(${`calc(1 / var(--_range-width) * 100 * ${r}% + var(--media-box-padding-left))`}, ${t})`),!Number.isNaN(n)){let l=`calc(1 / var(--_range-width) * 100 * ${n}% - var(--media-box-padding-right))`;t=`min(${t}, ${l})`}return t};xn=new WeakSet;Js=function(i,e){let{width:t,min:a,max:r}=i.box,n=e*i.range.width;if(nr-ie(this,$a)){let s=i.bounds.right-i.range.right-ie(this,$a);return`${n+t/2-s-i.range.width}px`}return 0};Ys=new WeakSet;kc=function(i){let e=[...ie(this,Mn)].some(b=>i.composedPath().includes(b));if(!this.dragging&&(e||!i.composedPath().includes(this))){de(this,Fa,Dn).call(this,null);return}let t=this.mediaSeekableEnd;if(!t)return;let a=W(this.shadowRoot,"#preview-rail"),r=W(this.shadowRoot,'[part~="preview-box"]'),n=de(this,Rn,zs).call(this,ie(this,Ln)),s=(i.clientX-n.range.left)/n.range.width;s=Math.max(0,Math.min(1,s));let l=de(this,wn,Xs).call(this,n,s),u=de(this,xn,Js).call(this,n,s);a.style.transform=`translateX(${l})`,a.style.setProperty("--_range-width",`${n.range.width}`),r.style.setProperty("--_box-shift",`${u}`),r.style.setProperty("--_box-width",`${n.box.width}px`);let c=Math.round(ie(this,Ha))-Math.round(s*t);Math.abs(c)<1&&s>.01&&s<.99||(Ze(this,Ha,s*t),de(this,Fa,Dn).call(this,ie(this,Ha)))};Fa=new WeakSet;Dn=function(i){this.dispatchEvent(new d.CustomEvent(p.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:i}))};Gs=new WeakSet;Sc=function(){ie(this,Jt).stop();let i=Cc(this);this.dispatchEvent(new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:i}))};d.customElements.get("media-time-range")||d.customElements.define("media-time-range",qs);var Wi={PLACEMENT:"placement",BOUNDS:"bounds"},Mc=m.createElement("template");Mc.innerHTML=`
`;var js=class extends d.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;let t=this.placement;if(t==="left"||t==="right"){this.style.removeProperty("--media-tooltip-offset-x");return}let a=getComputedStyle(this),r=(e=Ue(this,"#"+this.bounds))!=null?e:Z(this);if(!r)return;let{x:n,width:s}=r.getBoundingClientRect(),{x:l,width:u}=this.getBoundingClientRect(),c=l+u,b=n+s,g=a.getPropertyValue("--media-tooltip-offset-x"),v=g?parseFloat(g.replace("px","")):0,f=a.getPropertyValue("--media-tooltip-container-margin"),L=f?parseFloat(f.replace("px","")):0,A=l-n+v-L,T=c-b+v+L;if(A<0){this.style.setProperty("--media-tooltip-offset-x",`${A}px`);return}if(T>0){this.style.setProperty("--media-tooltip-offset-x",`${T}px`);return}this.style.removeProperty("--media-tooltip-offset-x")},this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Mc.content.cloneNode(!0))),this.arrowEl=this.shadowRoot.querySelector("#arrow"),Object.prototype.hasOwnProperty.call(this,"placement")){let e=this.placement;delete this.placement,this.placement=e}}static get observedAttributes(){return[Wi.PLACEMENT,Wi.BOUNDS]}get placement(){return x(this,Wi.PLACEMENT)}set placement(e){M(this,Wi.PLACEMENT,e)}get bounds(){return x(this,Wi.BOUNDS)}set bounds(e){M(this,Wi.BOUNDS,e)}};d.customElements.get("media-tooltip")||d.customElements.define("media-tooltip",js);var Gp=1,qp=i=>i.mediaMuted?0:i.mediaVolume,Zp=i=>`${Math.round(i*100)}%`,el=class extends Qt{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME,o.MEDIA_MUTED,o.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",()=>{let e=this.range.value,t=new d.CustomEvent(p.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",V.VOLUME())}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),(e===o.MEDIA_VOLUME||e===o.MEDIA_MUTED)&&(this.range.valueAsNumber=qp(this),this.range.setAttribute("aria-valuetext",Zp(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return w(this,o.MEDIA_VOLUME,Gp)}set mediaVolume(e){P(this,o.MEDIA_VOLUME,e)}get mediaMuted(){return H(this,o.MEDIA_MUTED)}set mediaMuted(e){B(this,o.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return x(this,o.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){M(this,o.MEDIA_VOLUME_UNAVAILABLE,e)}};d.customElements.get("media-volume-range")||d.customElements.define("media-volume-range",el);var E=ph(require("@mux/mux-video")),S=require("@mux/playback-core");var Hc=require("@mux/mux-video");var Oc=require("@mux/playback-core");var ti=require("@mux/playback-core");function Lc(i){let e="";return Object.entries(i).forEach(([t,a])=>{a!=null&&(e+=`${On(t)}: ${a}; `)}),e?e.trim():void 0}function On(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Nn(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function fe(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function tl(i){let e=Qp(i).toString();return e?"?"+e:""}function Qp(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var il=(i,e)=>!i||!e?!1:i.contains(e)?!0:il(i,e.getRootNode().host);var Rc="mux.com",zp=()=>{try{return"3.1.0"}catch{}return"UNKNOWN"},Xp=zp(),Un=()=>Xp,wc=(i,{token:e,customDomain:t=Rc,thumbnailTime:a,programTime:r}={})=>{var l;let n=e==null?a:void 0,{aud:s}=(l=(0,ti.parseJwt)(e))!=null?l:{};if(!(e&&s!=="t"))return`https://image.${t}/${i}/thumbnail.webp${tl({token:e,time:n,program_time:r})}`},xc=(i,{token:e,customDomain:t=Rc,programStartTime:a,programEndTime:r}={})=>{var s;let{aud:n}=(s=(0,ti.parseJwt)(e))!=null?s:{};if(!(e&&n!=="s"))return`https://image.${t}/${i}/storyboard.vtt${tl({token:e,format:"webp",program_start_time:a,program_end_time:r})}`},Ka=i=>{if(i){if([ti.StreamTypes.LIVE,ti.StreamTypes.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return ti.StreamTypes.LIVE}};var Jp={crossorigin:"crossOrigin",playsinline:"playsInline"};function Dc(i){var e;return(e=Jp[i])!=null?e:Nn(i)}var jt,ei,me,Pn=class{constructor(e,t){X(this,jt,void 0);X(this,ei,void 0);X(this,me,[]);Se(this,jt,e),Se(this,ei,t)}[Symbol.iterator](){return R(this,me).values()}get length(){return R(this,me).length}get value(){var e;return(e=R(this,me).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(Se(this,me,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return R(this,me)[e]}values(){return R(this,me).values()}keys(){return R(this,me).keys()}forEach(e){R(this,me).forEach(e)}add(...e){var t,a;e.forEach(r=>{this.contains(r)||R(this,me).push(r)}),!(this.value===""&&!((t=R(this,jt))!=null&&t.hasAttribute(`${R(this,ei)}`)))&&((a=R(this,jt))==null||a.setAttribute(`${R(this,ei)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>{R(this,me).splice(R(this,me).indexOf(a),1)}),(t=R(this,jt))==null||t.setAttribute(`${R(this,ei)}`,`${this.value}`)}contains(e){return R(this,me).includes(e)}toggle(e,t){return typeof t!="undefined"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){this.remove(e),this.add(t)}};jt=new WeakMap,ei=new WeakMap,me=new WeakMap;var Nc=`[mux-player ${Un()}]`;function Qe(...i){console.warn(Nc,...i)}function Ee(...i){console.error(Nc,...i)}function al(i){var t;let e=(t=i.message)!=null?t:"";i.context&&(e+=` ${i.context}`),i.file&&(e+=` ${(0,Oc.i18n)("Read more: ")}
https://github.com/muxinc/elements/blob/main/errors/${i.file}`),Qe(e)}var ue={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},ii={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},Uc=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),jp=Hc.VideoEvents.filter(i=>i!=="error"),ev=Object.values(ue).filter(i=>![ue.PLAYSINLINE].includes(i)),tv=Object.values(ii),$i,rl=class extends Q.HTMLElement{constructor(){super();X(this,$i,new WeakMap);let t=r=>{for(let n of r)n.type==="childList"&&(n.removedNodes.forEach(s=>{var l;(l=R(this,$i).get(s))==null||l.remove()}),n.addedNodes.forEach(s=>{var u;let l=s;l!=null&&l.slot||(u=this.media)==null||u.append(Bc(R(this,$i),s))}))};new MutationObserver(t).observe(this,{childList:!0,subtree:!0})}static get observedAttributes(){return[...ev,...tv]}init(){this.querySelectorAll(":scope > :not([slot])").forEach(t=>{var a;(a=this.media)==null||a.append(Bc(R(this,$i),t))}),jp.forEach(t=>{var a;(a=this.media)==null||a.addEventListener(t,r=>{this.dispatchEvent(new Event(r.type))})})}attributeChangedCallback(t,a,r){var n,s;switch(t){case ii.MUTED:{this.media&&(this.media.muted=r!=null,this.media.defaultMuted=r!=null);return}case ii.VOLUME:{let l=(n=fe(r))!=null?n:1;this.media&&(this.media.volume=l);return}case ii.PLAYBACKRATE:{let l=(s=fe(r))!=null?s:1;this.media&&(this.media.playbackRate=l,this.media.defaultPlaybackRate=l);return}}}play(){var t,a;return(a=(t=this.media)==null?void 0:t.play())!=null?a:Promise.reject()}pause(){var t;(t=this.media)==null||t.pause()}load(){var t;(t=this.media)==null||t.load()}requestCast(t){var a;return(a=this.media)==null?void 0:a.requestCast(t)}get media(){var t;return(t=this.shadowRoot)==null?void 0:t.querySelector("mux-video")}get audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var t,a;return(a=(t=this.media)==null?void 0:t.paused)!=null?a:!0}get duration(){var t,a;return(a=(t=this.media)==null?void 0:t.duration)!=null?a:NaN}get ended(){var t,a;return(a=(t=this.media)==null?void 0:t.ended)!=null?a:!1}get buffered(){var t,a;return(a=(t=this.media)==null?void 0:t.buffered)!=null?a:Uc}get seekable(){var t,a;return(a=(t=this.media)==null?void 0:t.seekable)!=null?a:Uc}get readyState(){var t,a;return(a=(t=this.media)==null?void 0:t.readyState)!=null?a:0}get videoWidth(){var t,a;return(a=(t=this.media)==null?void 0:t.videoWidth)!=null?a:0}get videoHeight(){var t,a;return(a=(t=this.media)==null?void 0:t.videoHeight)!=null?a:0}get currentSrc(){var t,a;return(a=(t=this.media)==null?void 0:t.currentSrc)!=null?a:""}get currentTime(){var t,a;return(a=(t=this.media)==null?void 0:t.currentTime)!=null?a:0}set currentTime(t){this.media&&(this.media.currentTime=Number(t))}get volume(){var t,a;return(a=(t=this.media)==null?void 0:t.volume)!=null?a:1}set volume(t){this.media&&(this.media.volume=Number(t))}get playbackRate(){var t,a;return(a=(t=this.media)==null?void 0:t.playbackRate)!=null?a:1}set playbackRate(t){this.media&&(this.media.playbackRate=Number(t))}get defaultPlaybackRate(){var t;return(t=fe(this.getAttribute(ii.PLAYBACKRATE)))!=null?t:1}set defaultPlaybackRate(t){t!=null?this.setAttribute(ii.PLAYBACKRATE,`${t}`):this.removeAttribute(ii.PLAYBACKRATE)}get crossOrigin(){return Va(this,ue.CROSSORIGIN)}set crossOrigin(t){this.setAttribute(ue.CROSSORIGIN,`${t}`)}get autoplay(){return Va(this,ue.AUTOPLAY)!=null}set autoplay(t){t?this.setAttribute(ue.AUTOPLAY,typeof t=="string"?t:""):this.removeAttribute(ue.AUTOPLAY)}get loop(){return Va(this,ue.LOOP)!=null}set loop(t){t?this.setAttribute(ue.LOOP,""):this.removeAttribute(ue.LOOP)}get muted(){var t,a;return(a=(t=this.media)==null?void 0:t.muted)!=null?a:!1}set muted(t){this.media&&(this.media.muted=!!t)}get defaultMuted(){return Va(this,ue.MUTED)!=null}set defaultMuted(t){t?this.setAttribute(ue.MUTED,""):this.removeAttribute(ue.MUTED)}get playsInline(){return Va(this,ue.PLAYSINLINE)!=null}set playsInline(t){Ee("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(t){["","none","metadata","auto"].includes(t)?this.setAttribute(ue.PRELOAD,t):this.removeAttribute(ue.PRELOAD)}};$i=new WeakMap;function Va(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}function Bc(i,e){let t=i.get(e);return t||(t=e.cloneNode(),i.set(e,t)),t}var nl=rl;var Vc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},y=(i,e,t)=>(Vc(i,e,"read from private field"),t?t.call(i):e.get(i)),ze=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},mt=(i,e,t,a)=>(Vc(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Fi,Bn,ai,Ya,Lt,Rt,wt,ri,Ki,Hn,Oe,Wc=1,$c=0,iv=1,av={processCallback(i,e,t){if(t){for(let[a,r]of e)if(a in t){let n=t[a];typeof n=="boolean"&&r instanceof he&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=n:typeof n=="function"&&r instanceof he?r.element[r.attributeName]=n:r.value=n}}}},ht=class extends d.DocumentFragment{constructor(e,t,a=av){var r;super(),ze(this,Fi,void 0),ze(this,Bn,void 0),this.append(e.content.cloneNode(!0)),mt(this,Fi,Yc(this)),mt(this,Bn,a),(r=a.createCallback)==null||r.call(a,this,y(this,Fi),t),a.processCallback(this,y(this,Fi),t)}update(e){y(this,Bn).processCallback(this,y(this,Fi),e)}};Fi=new WeakMap;Bn=new WeakMap;var Yc=(i,e=[])=>{let t,a;for(let r of i.attributes||[])if(r.value.includes("{{")){let n=new ol;for([t,a]of Kc(r.value))if(!t)n.append(a);else{let s=new he(i,r.name,r.namespaceURI);n.append(s),e.push([a,s])}r.value=n.toString()}for(let r of i.childNodes)if(r.nodeType===Wc&&!(r instanceof HTMLTemplateElement))Yc(r,e);else{let n=r.data;if(r.nodeType===Wc||n.includes("{{")){let s=[];if(n)for([t,a]of Kc(n))if(!t)s.push(new Text(a));else{let l=new pt(i);s.push(l),e.push([a,l])}else if(r instanceof HTMLTemplateElement){let l=new Ga(i,r);s.push(l),e.push([l.expression,l])}r.replaceWith(...s.flatMap(l=>l.replacementNodes||[l]))}}return e},Fc={},Kc=i=>{let e="",t=0,a=Fc[i],r=0,n;if(a)return a;for(a=[];n=i[r];r++)n==="{"&&i[r+1]==="{"&&i[r-1]!=="\\"&&i[r+2]&&++t==1?(e&&a.push([$c,e]),e="",r++):n==="}"&&i[r+1]==="}"&&i[r-1]!=="\\"&&!--t?(a.push([iv,e.trim()]),e="",r++):e+=n||"";return e&&a.push([$c,(t>0?"{{":"")+e]),Fc[i]=a},rv=11,Wn=class{get value(){return""}set value(e){}toString(){return this.value}},Gc=new WeakMap,ol=class{constructor(){ze(this,ai,[])}[Symbol.iterator](){return y(this,ai).values()}get length(){return y(this,ai).length}item(e){return y(this,ai)[e]}append(...e){for(let t of e)t instanceof he&&Gc.set(t,this),y(this,ai).push(t)}toString(){return y(this,ai).join("")}};ai=new WeakMap;var he=class extends Wn{constructor(e,t,a){super(),ze(this,ri),ze(this,Ya,""),ze(this,Lt,void 0),ze(this,Rt,void 0),ze(this,wt,void 0),mt(this,Lt,e),mt(this,Rt,t),mt(this,wt,a)}get attributeName(){return y(this,Rt)}get attributeNamespace(){return y(this,wt)}get element(){return y(this,Lt)}get value(){return y(this,Ya)}set value(e){y(this,Ya)!==e&&(mt(this,Ya,e),!y(this,ri,Ki)||y(this,ri,Ki).length===1?e==null?y(this,Lt).removeAttributeNS(y(this,wt),y(this,Rt)):y(this,Lt).setAttributeNS(y(this,wt),y(this,Rt),e):y(this,Lt).setAttributeNS(y(this,wt),y(this,Rt),y(this,ri,Ki).toString()))}get booleanValue(){return y(this,Lt).hasAttributeNS(y(this,wt),y(this,Rt))}set booleanValue(e){if(!y(this,ri,Ki)||y(this,ri,Ki).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};Ya=new WeakMap;Lt=new WeakMap;Rt=new WeakMap;wt=new WeakMap;ri=new WeakSet;Ki=function(){return Gc.get(this)};var pt=class extends Wn{constructor(e,t){super(),ze(this,Hn,void 0),ze(this,Oe,void 0),mt(this,Hn,e),mt(this,Oe,t?[...t]:[new Text])}get replacementNodes(){return y(this,Oe)}get parentNode(){return y(this,Hn)}get nextSibling(){return y(this,Oe)[y(this,Oe).length-1].nextSibling}get previousSibling(){return y(this,Oe)[0].previousSibling}get value(){return y(this,Oe).map(e=>e.textContent).join("")}set value(e){this.replace(e)}replace(...e){let t=e.flat().flatMap(a=>a==null?[new Text]:a.forEach?[...a]:a.nodeType===rv?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);t.length||t.push(new Text),mt(this,Oe,nv(y(this,Oe)[0].parentNode,y(this,Oe),t,this.nextSibling))}};Hn=new WeakMap;Oe=new WeakMap;var Ga=class extends pt{constructor(e,t){let a=t.getAttribute("directive")||t.getAttribute("type"),r=t.getAttribute("expression")||t.getAttribute(a)||"";r.startsWith("{{")&&(r=r.trim().slice(2,-2).trim()),super(e),this.expression=r,this.template=t,this.directive=a}};function nv(i,e,t,a=null){let r=0,n,s,l,u=t.length,c=e.length;for(;rString(i)},Fn=class{constructor(e){this.template=e,this.state=void 0}},ni=new WeakMap,oi=new WeakMap,sl={partial:(i,e)=>{e[i.expression]=new Fn(i.template)},if:(i,e)=>{var t;if(Qc(i.expression,e))if(ni.get(i)!==i.template){ni.set(i,i.template);let a=new ht(i.template,e,Kn);i.replace(a),oi.set(i,a)}else(t=oi.get(i))==null||t.update(e);else i.replace(""),ni.delete(i),oi.delete(i)}},ov=Object.keys(sl),Kn={processCallback(i,e,t){var a,r;if(t)for(let[n,s]of e){if(s instanceof Ga){if(!s.directive){let u=ov.find(c=>s.template.hasAttribute(c));u&&(s.directive=u,s.expression=s.template.getAttribute(u))}(a=sl[s.directive])==null||a.call(sl,s,t);continue}let l=Qc(n,t);if(l instanceof Fn){ni.get(s)!==l.template?(ni.set(s,l.template),l=new ht(l.template,l.state,Kn),s.value=l,oi.set(s,l)):(r=oi.get(s))==null||r.update(l.state);continue}l?(s instanceof he&&s.attributeName.startsWith("aria-")&&(l=String(l)),s instanceof he?typeof l=="boolean"?s.booleanValue=l:typeof l=="function"?s.element[s.attributeName]=l:s.value=l:(s.value=l,ni.delete(s),oi.delete(s))):s instanceof he?s.value=void 0:(s.value=void 0,ni.delete(s),oi.delete(s))}}},Zc={"!":i=>!i,"!!":i=>!!i,"==":(i,e)=>i==e,"!=":(i,e)=>i!=e,">":(i,e)=>i>e,">=":(i,e)=>i>=e,"<":(i,e)=>ii<=e,"??":(i,e)=>i!=null?i:e,"|":(i,e)=>{var t;return(t=qc[e])==null?void 0:t.call(qc,i)}};function sv(i){return lv(i,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function Qc(i,e={}){var t,a,r,n,s,l,u;let c=sv(i);if(c.length===0||c.some(({type:b})=>!b))return qa(i);if(((t=c[0])==null?void 0:t.token)===">"){let b=e[(a=c[1])==null?void 0:a.token];if(!b)return qa(i);let g={...e};b.state=g;let v=c.slice(2);for(let f=0;f{if(!e.has(i))throw TypeError("Cannot "+t)},ul=(i,e,t)=>(hl(i,e,"read from private field"),t?t.call(i):e.get(i)),Qa=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},si=(i,e,t,a)=>(hl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ll=(i,e,t)=>(hl(i,e,"access private method"),t),Vi,Vn,Yi,cl,zc,Yn,ml,dl={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},Xc=m.createElement("template");Xc.innerHTML=`
`;var li=class extends d.HTMLElement{constructor(){super(),Qa(this,cl),Qa(this,Yn),Qa(this,Vi,void 0),Qa(this,Vn,void 0),Qa(this,Yi,void 0),this.shadowRoot?this.renderRoot=this.shadowRoot:(this.renderRoot=this.attachShadow({mode:"open"}),this.createRenderer());let e=new MutationObserver(t=>{var a;this.mediaController&&!((a=this.mediaController)!=null&&a.breakpointsComputed)||t.some(r=>{let n=r.target;return n===this?!0:n.localName!=="media-controller"?!1:!!(dl[r.attributeName]||r.attributeName.startsWith("breakpoint"))})&&this.render()});e.observe(this,{attributes:!0}),e.observe(this.renderRoot,{attributes:!0,subtree:!0}),this.addEventListener(ot.BREAKPOINTS_COMPUTED,this.render),ll(this,cl,zc).call(this,"template")}get mediaController(){return this.renderRoot.querySelector("media-controller")}get template(){var e;return(e=ul(this,Vi))!=null?e:this.constructor.template}set template(e){si(this,Yi,null),si(this,Vi,e),this.createRenderer()}get props(){var e,t,a;let r=[...Array.from((t=(e=this.mediaController)==null?void 0:e.attributes)!=null?t:[]).filter(({name:s})=>dl[s]||s.startsWith("breakpoint")),...Array.from(this.attributes)],n={};for(let s of r){let l=(a=dl[s.name])!=null?a:Od(s.name),{value:u}=s;u!=null?(yr(u)&&(u=parseFloat(u)),n[l]=u===""?!0:u):n[l]=!1}return n}attributeChangedCallback(e,t,a){e==="template"&&t!=a&&ll(this,Yn,ml).call(this)}connectedCallback(){ll(this,Yn,ml).call(this)}createRenderer(){this.template&&this.template!==ul(this,Vn)&&(si(this,Vn,this.template),this.renderer=new ht(this.template,this.props,this.constructor.processor),this.renderRoot.textContent="",this.renderRoot.append(Xc.content.cloneNode(!0),this.renderer))}render(){var e;if((e=this.renderer)==null||e.update(this.props),this.renderRoot.isConnected){let{style:t}=W(this.renderRoot,":host");t.visibility==="hidden"&&t.removeProperty("visibility")}}};Vi=new WeakMap;Vn=new WeakMap;Yi=new WeakMap;cl=new WeakSet;zc=function(i){if(Object.prototype.hasOwnProperty.call(this,i)){let e=this[i];delete this[i],this[i]=e}};Yn=new WeakSet;ml=function(){var i;let e=this.getAttribute("template");if(!e||e===ul(this,Yi))return;let t=this.getRootNode(),a=(i=t==null?void 0:t.getElementById)==null?void 0:i.call(t,e);if(a){si(this,Yi,e),si(this,Vi,a),this.createRenderer();return}dv(e)&&(si(this,Yi,e),uv(e).then(r=>{let n=m.createElement("template");n.innerHTML=r,si(this,Vi,n),this.createRenderer()}).catch(console.error))};li.observedAttributes=["template"];li.processor=Kn;function dv(i){if(!/^(\/|\.\/|https?:\/\/)/.test(i))return!1;let e=/^https?:\/\//.test(i)?void 0:location.origin;try{new URL(i,e)}catch{return!1}return!0}async function uv(i){let e=await fetch(i);if(e.status!==200)throw new Error(`Failed to load resource: the server responded with a status of ${e.status}`);return e.text()}d.customElements.get("media-theme")||d.customElements.define("media-theme",li);var Jc=`:host {
--media-control-display: var(--controls);
--media-loading-indicator-display: var(--loading-indicator);
--media-dialog-display: var(--dialog);
--media-play-button-display: var(--play-button);
--media-live-button-display: var(--live-button);
--media-seek-backward-button-display: var(--seek-backward-button);
--media-seek-forward-button-display: var(--seek-forward-button);
--media-mute-button-display: var(--mute-button);
--media-captions-button-display: var(--captions-button);
--media-captions-menu-button-display: var(--captions-menu-button, var(--media-captions-button-display));
--media-rendition-menu-button-display: var(--rendition-menu-button);
--media-audio-track-menu-button-display: var(--audio-track-menu-button);
--media-airplay-button-display: var(--airplay-button);
--media-pip-button-display: var(--pip-button);
--media-fullscreen-button-display: var(--fullscreen-button);
--media-cast-button-display: var(--cast-button, var(--_cast-button-drm-display));
--media-playback-rate-button-display: var(--playback-rate-button);
--media-playback-rate-menu-button-display: var(--playback-rate-menu-button);
--media-volume-range-display: var(--volume-range);
--media-time-range-display: var(--time-range);
--media-time-display-display: var(--time-display);
--media-duration-display-display: var(--duration-display);
--media-title-display-display: var(--title-display);
display: inline-block;
width: 100%;
line-height: 0;
}
/* Hide custom elements that are not defined yet */
:not(:defined) {
display: none;
}
a {
color: #fff;
font-size: 0.9em;
text-decoration: underline;
}
media-theme {
width: 100%;
height: 100%;
direction: ltr;
}
media-poster-image {
width: 100%;
height: 100%;
}
media-poster-image:not([src]):not([placeholdersrc]) {
display: none;
}
::part(top),
[part~='top'] {
--media-control-display: var(--controls, var(--top-controls));
--media-play-button-display: var(--play-button, var(--top-play-button));
--media-live-button-display: var(--live-button, var(--top-live-button));
--media-seek-backward-button-display: var(--seek-backward-button, var(--top-seek-backward-button));
--media-seek-forward-button-display: var(--seek-forward-button, var(--top-seek-forward-button));
--media-mute-button-display: var(--mute-button, var(--top-mute-button));
--media-captions-button-display: var(--captions-button, var(--top-captions-button));
--media-captions-menu-button-display: var(
--captions-menu-button,
var(--media-captions-button-display, var(--top-captions-menu-button))
);
--media-rendition-menu-button-display: var(--rendition-menu-button, var(--top-rendition-menu-button));
--media-audio-track-menu-button-display: var(--audio-track-menu-button, var(--top-audio-track-menu-button));
--media-airplay-button-display: var(--airplay-button, var(--top-airplay-button));
--media-pip-button-display: var(--pip-button, var(--top-pip-button));
--media-fullscreen-button-display: var(--fullscreen-button, var(--top-fullscreen-button));
--media-cast-button-display: var(--cast-button, var(--top-cast-button, var(--_cast-button-drm-display)));
--media-playback-rate-button-display: var(--playback-rate-button, var(--top-playback-rate-button));
--media-playback-rate-menu-button-display: var(
--captions-menu-button,
var(--media-playback-rate-button-display, var(--top-playback-rate-menu-button))
);
--media-volume-range-display: var(--volume-range, var(--top-volume-range));
--media-time-range-display: var(--time-range, var(--top-time-range));
--media-time-display-display: var(--time-display, var(--top-time-display));
--media-duration-display-display: var(--duration-display, var(--top-duration-display));
--media-title-display-display: var(--title-display, var(--top-title-display));
}
::part(center),
[part~='center'] {
--media-control-display: var(--controls, var(--center-controls));
--media-play-button-display: var(--play-button, var(--center-play-button));
--media-live-button-display: var(--live-button, var(--center-live-button));
--media-seek-backward-button-display: var(--seek-backward-button, var(--center-seek-backward-button));
--media-seek-forward-button-display: var(--seek-forward-button, var(--center-seek-forward-button));
--media-mute-button-display: var(--mute-button, var(--center-mute-button));
--media-captions-button-display: var(--captions-button, var(--center-captions-button));
--media-captions-menu-button-display: var(
--captions-menu-button,
var(--media-captions-button-display, var(--center-captions-menu-button))
);
--media-rendition-menu-button-display: var(--rendition-menu-button, var(--center-rendition-menu-button));
--media-audio-track-menu-button-display: var(--audio-track-menu-button, var(--center-audio-track-menu-button));
--media-airplay-button-display: var(--airplay-button, var(--center-airplay-button));
--media-pip-button-display: var(--pip-button, var(--center-pip-button));
--media-fullscreen-button-display: var(--fullscreen-button, var(--center-fullscreen-button));
--media-cast-button-display: var(--cast-button, var(--center-cast-button, var(--_cast-button-drm-display)));
--media-playback-rate-button-display: var(--playback-rate-button, var(--center-playback-rate-button));
--media-playback-rate-menu-button-display: var(
--playback-rate-menu-button,
var(--media-playback-rate-button-display, var(--center-playback-rate-menu-button))
);
--media-volume-range-display: var(--volume-range, var(--center-volume-range));
--media-time-range-display: var(--time-range, var(--center-time-range));
--media-time-display-display: var(--time-display, var(--center-time-display));
--media-duration-display-display: var(--duration-display, var(--center-duration-display));
}
::part(bottom),
[part~='bottom'] {
--media-control-display: var(--controls, var(--bottom-controls));
--media-play-button-display: var(--play-button, var(--bottom-play-button));
--media-live-button-display: var(--live-button, var(--bottom-live-button));
--media-seek-backward-button-display: var(--seek-backward-button, var(--bottom-seek-backward-button));
--media-seek-forward-button-display: var(--seek-forward-button, var(--bottom-seek-forward-button));
--media-mute-button-display: var(--mute-button, var(--bottom-mute-button));
--media-captions-button-display: var(--captions-button, var(--bottom-captions-button));
--media-captions-menu-button-display: var(
--captions-menu-button,
var(--media-captions-button-display, var(--bottom-captions-menu-button))
);
--media-rendition-menu-button-display: var(--rendition-menu-button, var(--bottom-rendition-menu-button));
--media-audio-track-menu-button-display: var(--audio-track-menu-button, var(--bottom-audio-track-menu-button));
--media-airplay-button-display: var(--airplay-button, var(--bottom-airplay-button));
--media-pip-button-display: var(--pip-button, var(--bottom-pip-button));
--media-fullscreen-button-display: var(--fullscreen-button, var(--bottom-fullscreen-button));
--media-cast-button-display: var(--cast-button, var(--bottom-cast-button, var(--_cast-button-drm-display)));
--media-playback-rate-button-display: var(--playback-rate-button, var(--bottom-playback-rate-button));
--media-playback-rate-menu-button-display: var(
--playback-rate-menu-button,
var(--media-playback-rate-button-display, var(--bottom-playback-rate-menu-button))
);
--media-volume-range-display: var(--volume-range, var(--bottom-volume-range));
--media-time-range-display: var(--time-range, var(--bottom-time-range));
--media-time-display-display: var(--time-display, var(--bottom-time-display));
--media-duration-display-display: var(--duration-display, var(--bottom-duration-display));
--media-title-display-display: var(--title-display, var(--bottom-title-display));
}
:host([no-tooltips]) {
--media-tooltip-display: none;
}
`;var em=`
:host {
z-index: 100;
display: var(--media-dialog-display, flex);
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
box-sizing: border-box;
color: #fff;
line-height: 18px;
font-family: Arial, sans-serif;
padding: var(--media-dialog-backdrop-padding, 0);
background: var(--media-dialog-backdrop-background,
linear-gradient(to bottom, rgba(20, 20, 30, 0.7) 50%, rgba(20, 20, 30, 0.9))
);
/* Needs to use !important to prevent overwrite of media-chrome */
transition: var(--media-dialog-transition-open, visibility .2s, opacity .2s) !important;
transform: var(--media-dialog-transform-open, none) !important;
visibility: visible !important;
opacity: 1 !important;
pointer-events: auto !important;
}
:host(:not([open])) {
/* Needs to use !important to prevent overwrite of media-chrome */
transition: var(--media-dialog-transition-close, visibility .1s, opacity .1s) !important;
transform: var(--media-dialog-transform-close, none) !important;
visibility: hidden !important;
opacity: 0 !important;
pointer-events: none !important;
}
:focus-visible {
box-shadow: 0 0 0 2px rgba(27, 127, 204, 0.9);
}
.dialog {
position: relative;
box-sizing: border-box;
background: var(--media-dialog-background, none);
padding: var(--media-dialog-padding, 10px);
width: min(320px, 100%);
word-wrap: break-word;
max-height: 100%;
overflow: auto;
text-align: center;
line-height: 1.4;
}
`,tm=Ae.createElement("template");tm.innerHTML=`
`;var xt=class extends Q.HTMLElement{constructor(){var e;super(),this.attachShadow({mode:"open"}),(e=this.shadowRoot)==null||e.appendChild(this.constructor.template.content.cloneNode(!0))}show(){this.setAttribute("open",""),this.dispatchEvent(new CustomEvent("open",{composed:!0,bubbles:!0})),jc(this)}close(){this.hasAttribute("open")&&(this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("close",{composed:!0,bubbles:!0})),mv(this))}attributeChangedCallback(e,t,a){e==="open"&&t!==a&&(a!=null?this.show():this.close())}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","dialog"),this.hasAttribute("open")&&jc(this)}};xt.styles=em,xt.template=tm,xt.observedAttributes=["open"];function jc(i){let e=new CustomEvent("initfocus",{composed:!0,bubbles:!0,cancelable:!0});if(i.dispatchEvent(e),e.defaultPrevented)return;let t=i.querySelector("[autofocus]:not([disabled])");!t&&i.tabIndex>=0&&(t=i),t||(t=im(i.shadowRoot)),i._previouslyFocusedElement=Ae.activeElement,Ae.activeElement instanceof HTMLElement&&Ae.activeElement.blur(),i.addEventListener("transitionend",()=>{t instanceof HTMLElement&&t.focus({preventScroll:!0})},{once:!0})}function im(i){let t=["button","input","keygen","select","textarea"].map(function(r){return r+":not([disabled])"});t.push('[tabindex]:not([disabled]):not([tabindex=""])');let a=i==null?void 0:i.querySelector(t.join(", "));if(!a&&"attachShadow"in Element.prototype){let r=(i==null?void 0:i.querySelectorAll("*"))||[];for(let n=0;n
${pl.styles}
.close {
background: none;
color: inherit;
border: none;
padding: 0;
font: inherit;
cursor: pointer;
outline: inherit;
width: 28px;
height: 28px;
position: absolute;
top: 1rem;
right: 1rem;
}
`;var za=class extends pl{constructor(){var e,t;super(),(t=(e=this.shadowRoot)==null?void 0:e.querySelector(".close"))==null||t.addEventListener("click",()=>{this.close()})}};za.template=am;Q.customElements.get("mxp-dialog")||(Q.customElements.define("mxp-dialog",za),Q.MxpDialog=za);var Xa=new WeakMap,fl=class i{constructor(e,t){this.element=e;this.type=t;this.element.addEventListener(this.type,this);let a=Xa.get(this.element);a&&a.set(this.type,this)}set(e){if(typeof e=="function")this.handleEvent=e.bind(this.element);else if(typeof e=="object"&&typeof e.handleEvent=="function")this.handleEvent=e.handleEvent.bind(e);else{this.element.removeEventListener(this.type,this);let t=Xa.get(this.element);t&&t.delete(this.type)}}static for(e){Xa.has(e.element)||Xa.set(e.element,new Map);let t=e.attributeName.slice(2),a=Xa.get(e.element);return a&&a.has(t)?a.get(t):new i(e.element,t)}};function hv(i,e){return i instanceof he&&i.attributeName.startsWith("on")?(fl.for(i).set(e),i.element.removeAttributeNS(i.attributeNamespace,i.attributeName),!0):!1}function pv(i,e){return e instanceof Gn&&i instanceof pt?(e.renderInto(i),!0):!1}function vv(i,e){return e instanceof DocumentFragment&&i instanceof pt?(e.childNodes.length&&i.replace(...e.childNodes),!0):!1}function fv(i,e){if(i instanceof he){let t=i.attributeNamespace,a=i.element.getAttributeNS(t,i.attributeName);return String(e)!==a&&(i.value=String(e)),!0}return i.value=String(e),!0}function Ev(i,e){if(i instanceof he&&e instanceof Element){let t=i.element;return t[i.attributeName]!==e&&(i.element.removeAttributeNS(i.attributeNamespace,i.attributeName),t[i.attributeName]=e),!0}return!1}function bv(i,e){if(typeof e=="boolean"&&i instanceof he){let t=i.attributeNamespace,a=i.element.hasAttributeNS(t,i.attributeName);return e!==a&&(i.booleanValue=e),!0}return!1}function gv(i,e){return e===!1&&i instanceof pt?(i.replace(""),!0):!1}function _v(i,e){Ev(i,e)||bv(i,e)||hv(i,e)||gv(i,e)||pv(i,e)||vv(i,e)||fv(i,e)}var vl=new Map,rm=new WeakMap,nm=new WeakMap,Gn=class{constructor(e,t,a){this.strings=e;this.values=t;this.processor=a;this.stringsKey=this.strings.join("")}get template(){if(vl.has(this.stringsKey))return vl.get(this.stringsKey);{let e=Ae.createElement("template"),t=this.strings.length-1;return e.innerHTML=this.strings.reduce((a,r,n)=>a+r+(n{let{tokens:e}=i;return e.drm?":host { --_cast-button-drm-display: none; }":""},sm=i=>vt`
${Iv(i)}
`,yv=i=>{let e=i.hotKeys?`${i.hotKeys}`:"";return Ka(i.streamType)==="live"&&(e+=" noarrowleft noarrowright"),e},kv={TOP:"top",CENTER:"center",BOTTOM:"bottom",LAYER:"layer",MEDIA_LAYER:"media-layer",POSTER_LAYER:"poster-layer",VERTICAL_LAYER:"vertical-layer",CENTERED_LAYER:"centered-layer",GESTURE_LAYER:"gesture-layer",CONTROLLER_LAYER:"controller",BUTTON:"button",RANGE:"range",DISPLAY:"display",CONTROL_BAR:"control-bar",MENU_BUTTON:"menu-button",LISTBOX:"listbox",OPTION:"option",POSTER:"poster",LIVE:"live",PLAY:"play",PRE_PLAY:"pre-play",SEEK_BACKWARD:"seek-backward",SEEK_FORWARD:"seek-forward",MUTE:"mute",CAPTIONS:"captions",AIRPLAY:"airplay",PIP:"pip",FULLSCREEN:"fullscreen",CAST:"cast",PLAYBACK_RATE:"playback-rate",VOLUME:"volume",TIME:"time",TITLE:"title",AUDIO_TRACK:"audio-track",RENDITION:"rendition"},Sv=Object.values(kv).join(", "),Iv=i=>{var e,t,a,r,n,s,l,u,c,b,g,v,f,L,A,T,N,te,be,gt,rt,ji,ea,ta,ia,aa,ra,na,oa,sa,la,da,Ar,nt,ua,ca,ma,ha;return vt`
${i.storyboard?vt` `:vt``}
${(nt=i.dialog)!=null&&nt.title?vt`${i.dialog.title} `:vt``}
${(ua=i.dialog)==null?void 0:ua.message}
${(ca=i.dialog)!=null&&ca.linkUrl?vt`${(ha=i.dialog.linkText)!=null?ha:i.dialog.linkUrl} `:vt``}
`};var _=require("@mux/playback-core"),lm=i=>i.charAt(0).toUpperCase()+i.slice(1),Cv=(i,e=!1)=>{var t,a;if(i.muxCode){let r=lm((t=i.errorCategory)!=null?t:"video"),n=(0,_.errorCategoryToTokenNameOrPrefix)((a=i.errorCategory)!=null?a:_.MuxErrorCategory.VIDEO);if(i.muxCode===_.MuxErrorCode.NETWORK_OFFLINE)return(0,_.i18n)("Your device appears to be offline",e);if(i.muxCode===_.MuxErrorCode.NETWORK_TOKEN_EXPIRED)return(0,_.i18n)("{category} URL has expired",e).format({category:r});if([_.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH,_.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,_.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING,_.MuxErrorCode.NETWORK_TOKEN_MALFORMED].includes(i.muxCode))return(0,_.i18n)("{category} URL is formatted incorrectly",e).format({category:r});if(i.muxCode===_.MuxErrorCode.NETWORK_TOKEN_MISSING)return(0,_.i18n)("Invalid {categoryName} URL",e).format({categoryName:n});if(i.muxCode===_.MuxErrorCode.NETWORK_NOT_FOUND)return(0,_.i18n)("{category} does not exist",e).format({category:r});if(i.muxCode===_.MuxErrorCode.NETWORK_NOT_READY)return(0,_.i18n)("{category} is not currently available",e).format({category:r})}if(i.code){if(i.code===_.MediaError.MEDIA_ERR_NETWORK)return(0,_.i18n)("Network Error",e);if(i.code===_.MediaError.MEDIA_ERR_DECODE)return(0,_.i18n)("Media Error",e);if(i.code===_.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED)return(0,_.i18n)("Source Not Supported",e)}return(0,_.i18n)("Error",e)},Mv=(i,e=!1)=>{var t,a;if(i.muxCode){let r=lm((t=i.errorCategory)!=null?t:"video"),n=(0,_.errorCategoryToTokenNameOrPrefix)((a=i.errorCategory)!=null?a:_.MuxErrorCategory.VIDEO);return i.muxCode===_.MuxErrorCode.NETWORK_OFFLINE?(0,_.i18n)("Check your internet connection and try reloading this video.",e):i.muxCode===_.MuxErrorCode.NETWORK_TOKEN_EXPIRED?(0,_.i18n)("The video\u2019s secured {tokenNamePrefix}-token has expired.",e).format({tokenNamePrefix:n}):i.muxCode===_.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH?(0,_.i18n)("The video\u2019s playback ID does not match the one encoded in the {tokenNamePrefix}-token.",e).format({tokenNamePrefix:n}):i.muxCode===_.MuxErrorCode.NETWORK_TOKEN_MALFORMED?(0,_.i18n)("{category} URL is formatted incorrectly",e).format({category:r}):[_.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,_.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING].includes(i.muxCode)?(0,_.i18n)("The {tokenNamePrefix}-token is formatted with incorrect information.",e).format({tokenNamePrefix:n}):[_.MuxErrorCode.NETWORK_TOKEN_MISSING,_.MuxErrorCode.NETWORK_INVALID_URL].includes(i.muxCode)?(0,_.i18n)("The video URL or {tokenNamePrefix}-token are formatted with incorrect or incomplete information.",e).format({tokenNamePrefix:n}):i.muxCode===_.MuxErrorCode.NETWORK_NOT_FOUND?"":i.muxCode===_.MuxErrorCode.NETWORK_NOT_READY?(0,_.i18n)("The live stream or video file are not yet ready.",e):i.message}return i.code&&(i.code===_.MediaError.MEDIA_ERR_NETWORK||i.code===_.MediaError.MEDIA_ERR_DECODE||i.code===_.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED),i.message},Lv=(i,e=!1)=>{let t=Cv(i,e),a=Mv(i,e);return{title:t,message:a}},Rv=i=>{if(i.muxCode){if(i.muxCode===_.MuxErrorCode.NETWORK_TOKEN_EXPIRED)return"403-expired-token.md";if(i.muxCode===_.MuxErrorCode.NETWORK_TOKEN_MALFORMED)return"403-malformatted-token.md";if([_.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,_.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING].includes(i.muxCode))return"403-incorrect-aud-value.md";if(i.muxCode===_.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH)return"403-playback-id-mismatch.md";if(i.muxCode===_.MuxErrorCode.NETWORK_TOKEN_MISSING)return"missing-signed-tokens.md";if(i.muxCode===_.MuxErrorCode.NETWORK_NOT_FOUND)return"404-not-found.md";if(i.muxCode===_.MuxErrorCode.NETWORK_NOT_READY)return"412-not-playable.md"}if(i.code){if(i.code===_.MediaError.MEDIA_ERR_NETWORK)return"";if(i.code===_.MediaError.MEDIA_ERR_DECODE)return"media-decode-error.md";if(i.code===_.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED)return"media-src-not-supported.md"}return""},wv=(i,e)=>{let t=Rv(i);return{message:i.message,context:i.context,file:t}};function El(i,e=!1){let t=Lv(i,e),a=wv(i,e);return{dialog:t,devlog:a}}var dm=`
{{title}}
{{backwardseekoffset}}
{{forwardseekoffset}}
Live
{{>PlayButton section="center"}}
{{>PrePlayButton section="center"}}
{{>TitleDisplay}}
{{>TimeRange}}
{{>PlayButton}} {{>SeekBackwardButton}} {{>SeekForwardButton}} {{>TimeDisplay}} {{>MuteButton}}
{{>VolumeRange}}
{{>RenditionMenu}} {{>PlaybackRateMenu}} {{>AudioTrackMenu}} {{>CaptionsMenu}} {{>AirplayButton}}
{{>CastButton}} {{>PipButton}} {{>FullscreenButton}}
{{>LiveButton}}
{{>TitleDisplay}}
{{>TimeRange}}
{{>PlayButton}}
{{>SeekBackwardButton}} {{>SeekForwardButton}}
{{>MuteButton}} {{>VolumeRange}}
{{>RenditionMenu}} {{>AudioTrackMenu}} {{>CaptionsMenu}} {{>AirplayButton}} {{>CastButton}} {{>PipButton}}
{{>FullscreenButton}}
{{>TitleDisplay}}
{{>PlayButton}}
{{>SeekBackwardButton}} {{>SeekForwardButton}}
{{>MuteButton}}
{{>VolumeRange}}
{{>TimeDisplay}} {{>TimeRange}}
{{>PlaybackRateMenu}}
{{>AirplayButton}} {{>CastButton}}
{{>TitleDisplay}}
{{>PlayButton}} {{>LiveButton section="bottom"}} {{>MuteButton}}
{{>VolumeRange}}
{{>SeekBackwardButton}} {{>SeekForwardButton}}
{{>TimeDisplay}} {{>TimeRange}}
{{>AirplayButton}} {{>CastButton}}
`;function um({anchor:i,floating:e,placement:t}){let a=Dv({anchor:i,floating:e}),{x:r,y:n}=Nv(a,t);return{x:r,y:n}}function Dv({anchor:i,floating:e}){return{anchor:Ov(i,e.offsetParent),floating:{x:0,y:0,width:e.offsetWidth,height:e.offsetHeight}}}function Ov(i,e){var t;let a=i.getBoundingClientRect(),r=(t=e==null?void 0:e.getBoundingClientRect())!=null?t:{x:0,y:0};return{x:a.x-r.x,y:a.y-r.y,width:a.width,height:a.height}}function Nv({anchor:i,floating:e},t){let a=Pv(t)==="x"?"y":"x",r=a==="y"?"height":"width",n=cm(t),s=i.x+i.width/2-e.width/2,l=i.y+i.height/2-e.height/2,u=i[r]/2-e[r]/2,c;switch(n){case"top":c={x:s,y:i.y-e.height};break;case"bottom":c={x:s,y:i.y+i.height};break;case"right":c={x:i.x+i.width,y:l};break;case"left":c={x:i.x-e.width,y:l};break;default:c={x:i.x,y:i.y}}switch(t.split("-")[1]){case"start":c[a]-=u;break;case"end":c[a]+=u;break}return c}function cm(i){return i.split("-")[0]}function Pv(i){return["top","bottom"].includes(cm(i))?"y":"x"}var Dt=class extends Event{constructor({action:e="auto",relatedTarget:t,...a}){super("invoke",a),this.action=e,this.relatedTarget=t}},qn=class extends Event{constructor({newState:e,oldState:t,...a}){super("toggle",a),this.newState=e,this.oldState=t}};var Ll=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},U=(i,e,t)=>(Ll(i,e,"read from private field"),t?t.call(i):e.get(i)),K=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Xe=(i,e,t,a)=>(Ll(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),G=(i,e,t)=>(Ll(i,e,"access private method"),t),Je,ci,Ot,Zn,Qn,mi,er,bl,mm,Jn,zn,gl,_l,hm,Al,pm,Tl,vm,Gi,qi,Zi,tr,jn,Rl,yl,fm,wl,Em,kl,bm,xl,gm,Sl,_m,Il,Am,Ja,eo,Cl,Tm,ja,to,Xn,Ml;function je({type:i,text:e,value:t,checked:a}){let r=m.createElement("media-chrome-menu-item");r.type=i!=null?i:"",r.part.add("menu-item"),i&&r.part.add(i),r.value=t,r.checked=a;let n=m.createElement("span");return n.textContent=e,r.append(n),r}function Ne(i,e){let t=i.querySelector(`:scope > [slot="${e}"]`);if((t==null?void 0:t.nodeName)=="SLOT"&&(t=t.assignedElements({flatten:!0})[0]),t)return t=t.cloneNode(!0),t;let a=i.shadowRoot.querySelector(`[name="${e}"] > svg`);return a?a.cloneNode(!0):""}var ym=m.createElement("template");ym.innerHTML=`
`;var ui={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},le=class extends d.HTMLElement{constructor(){super(),K(this,bl),K(this,zn),K(this,_l),K(this,Al),K(this,Tl),K(this,Zi),K(this,jn),K(this,yl),K(this,wl),K(this,kl),K(this,xl),K(this,Sl),K(this,Il),K(this,Ja),K(this,Cl),K(this,ja),K(this,Xn),K(this,Je,null),K(this,ci,null),K(this,Ot,null),K(this,Zn,new Set),K(this,Qn,void 0),K(this,mi,!1),K(this,er,null),K(this,Jn,()=>{let e=U(this,Zn),t=new Set(this.items);for(let a of e)t.has(a)||this.dispatchEvent(new CustomEvent("removemenuitem",{detail:a}));for(let a of t)e.has(a)||this.dispatchEvent(new CustomEvent("addmenuitem",{detail:a}));Xe(this,Zn,t)}),K(this,Gi,()=>{G(this,Zi,tr).call(this),G(this,jn,Rl).call(this,!1)}),K(this,qi,()=>{G(this,Zi,tr).call(this)}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.nativeEl=this.constructor.template.content.cloneNode(!0),this.shadowRoot.append(this.nativeEl)),this.container=this.shadowRoot.querySelector("#container"),this.defaultSlot=this.shadowRoot.querySelector("slot:not([name])"),this.shadowRoot.addEventListener("slotchange",this),Xe(this,Qn,new MutationObserver(U(this,Jn))),U(this,Qn).observe(this.defaultSlot,{childList:!0})}static get observedAttributes(){return[ui.DISABLED,ui.HIDDEN,ui.STYLE,ui.ANCHOR,k.MEDIA_CONTROLLER]}static formatMenuItemText(e){return e}enable(){this.addEventListener("click",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this),this.addEventListener("invoke",this),this.addEventListener("toggle",this)}disable(){this.removeEventListener("click",this),this.removeEventListener("focusout",this),this.removeEventListener("keyup",this),this.removeEventListener("invoke",this),this.removeEventListener("toggle",this)}handleEvent(e){switch(e.type){case"slotchange":G(this,bl,mm).call(this,e);break;case"invoke":G(this,_l,hm).call(this,e);break;case"click":G(this,yl,fm).call(this,e);break;case"toggle":G(this,kl,bm).call(this,e);break;case"focusout":G(this,Sl,_m).call(this,e);break;case"keydown":G(this,Il,Am).call(this,e);break}}connectedCallback(){var e,t;Xe(this,er,Fo(this.shadowRoot,":host")),G(this,zn,gl).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),Xe(this,Je,Mr(this)),(t=(e=U(this,Je))==null?void 0:e.associateElement)==null||t.call(e,this),this.hidden||(st(ir(this),U(this,Gi)),st(this,U(this,qi)))}disconnectedCallback(){var e,t;Wt(ir(this),U(this,Gi)),Wt(this,U(this,qi)),this.disable(),(t=(e=U(this,Je))==null?void 0:e.unassociateElement)==null||t.call(e,this),Xe(this,Je,null)}attributeChangedCallback(e,t,a){var r,n,s,l;e===ui.HIDDEN&&a!==t?(U(this,mi)||Xe(this,mi,!0),this.hidden?G(this,Tl,vm).call(this):G(this,Al,pm).call(this),this.dispatchEvent(new qn({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:!0}))):e===k.MEDIA_CONTROLLER?(t&&((n=(r=U(this,Je))==null?void 0:r.unassociateElement)==null||n.call(r,this),Xe(this,Je,null)),a&&this.isConnected&&(Xe(this,Je,Mr(this)),(l=(s=U(this,Je))==null?void 0:s.associateElement)==null||l.call(s,this))):e===ui.DISABLED&&a!==t?a==null?this.enable():this.disable():e===ui.STYLE&&a!==t&&G(this,zn,gl).call(this)}formatMenuItemText(e,t){return this.constructor.formatMenuItemText(e,t)}get anchor(){return this.getAttribute("anchor")}set anchor(e){this.setAttribute("anchor",`${e}`)}get anchorElement(){var e;return this.anchor?(e=$t(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:!0}).filter(Uv)}get radioGroupItems(){return this.items.filter(e=>e.role==="menuitemradio")}get checkedItems(){return this.items.filter(e=>e.checked)}get value(){var e,t;return(t=(e=this.checkedItems[0])==null?void 0:e.value)!=null?t:""}set value(e){let t=this.items.find(a=>a.value===e);t&&G(this,Xn,Ml).call(this,t)}focus(){if(Xe(this,ci,ba()),this.items.length){G(this,ja,to).call(this,this.items[0]),this.items[0].focus();return}let e=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');e==null||e.focus()}handleSelect(e){var t;let a=G(this,Ja,eo).call(this,e);a&&(G(this,Xn,Ml).call(this,a,a.type==="checkbox"),U(this,Ot)&&!this.hidden&&((t=U(this,ci))==null||t.focus(),this.hidden=!0))}get keysUsed(){return["Enter","Escape","Tab"," ","ArrowDown","ArrowUp","Home","End"]}handleMove(e){var t,a;let{key:r}=e,n=this.items,s=(a=(t=G(this,Ja,eo).call(this,e))!=null?t:G(this,Cl,Tm).call(this))!=null?a:n[0],l=n.indexOf(s),u=Math.max(0,l);r==="ArrowDown"?u++:r==="ArrowUp"?u--:e.key==="Home"?u=0:e.key==="End"&&(u=n.length-1),u<0&&(u=n.length-1),u>n.length-1&&(u=0),G(this,ja,to).call(this,n[u]),n[u].focus()}};Je=new WeakMap;ci=new WeakMap;Ot=new WeakMap;Zn=new WeakMap;Qn=new WeakMap;mi=new WeakMap;er=new WeakMap;bl=new WeakSet;mm=function(i){let e=i.target;for(let t of e.assignedNodes({flatten:!0}))t.nodeType===3&&t.textContent.trim()===""&&t.remove();if(["header","title"].includes(e.name)){let t=this.shadowRoot.querySelector('slot[name="header"]');t.hidden=e.assignedNodes().length===0}e.name||U(this,Jn).call(this)};Jn=new WeakMap;zn=new WeakSet;gl=function(){var i;let e=this.shadowRoot.querySelector("#layout-row"),t=(i=getComputedStyle(this).getPropertyValue("--media-menu-layout"))==null?void 0:i.trim();e.setAttribute("media",t==="row"?"":"width:0")};_l=new WeakSet;hm=function(i){Xe(this,Ot,i.relatedTarget),ce(this,i.relatedTarget)||(this.hidden=!this.hidden)};Al=new WeakSet;pm=function(){var i;(i=U(this,Ot))==null||i.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),st(ir(this),U(this,Gi)),st(this,U(this,qi))};Tl=new WeakSet;vm=function(){var i;(i=U(this,Ot))==null||i.setAttribute("aria-expanded","false"),Wt(ir(this),U(this,Gi)),Wt(this,U(this,qi))};Gi=new WeakMap;qi=new WeakMap;Zi=new WeakSet;tr=function(i){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:e,y:t}=um({anchor:this.anchorElement,floating:this,placement:"top-start"});i!=null||(i=this.offsetWidth);let r=ir(this).getBoundingClientRect(),n=r.width-e-i,s=r.height-t-this.offsetHeight,{style:l}=U(this,er);l.setProperty("position","absolute"),l.setProperty("right",`${Math.max(0,n)}px`),l.setProperty("--_menu-bottom",`${s}px`);let u=getComputedStyle(this),b=l.getPropertyValue("--_menu-bottom")===u.bottom?s:parseFloat(u.bottom),g=r.height-b-parseFloat(u.marginBottom);this.style.setProperty("--_menu-max-height",`${g}px`)};jn=new WeakSet;Rl=function(i){let e=this.querySelector('[role="menuitem"][aria-haspopup][aria-expanded="true"]'),t=e==null?void 0:e.querySelector('[role="menu"]'),{style:a}=U(this,er);if(i||a.setProperty("--media-menu-transition-in","none"),t){let r=t.offsetHeight,n=Math.max(t.offsetWidth,e.offsetWidth);this.style.setProperty("min-width",`${n}px`),this.style.setProperty("min-height",`${r}px`),G(this,Zi,tr).call(this,n)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),G(this,Zi,tr).call(this);a.removeProperty("--media-menu-transition-in")};yl=new WeakSet;fm=function(i){var e;if(i.stopPropagation(),i.composedPath().includes(U(this,wl,Em))){(e=U(this,ci))==null||e.focus(),this.hidden=!0;return}let t=G(this,Ja,eo).call(this,i);!t||t.hasAttribute("disabled")||(G(this,ja,to).call(this,t),this.handleSelect(i))};wl=new WeakSet;Em=function(){var i;return(i=this.shadowRoot.querySelector('slot[name="header"]').assignedElements({flatten:!0}))==null?void 0:i.find(t=>t.matches('button[part~="back"]'))};kl=new WeakSet;bm=function(i){if(i.target===this)return;G(this,xl,gm).call(this);let e=Array.from(this.querySelectorAll('[role="menuitem"][aria-haspopup]'));for(let t of e)t.invokeTargetElement!=i.target&&i.newState=="open"&&t.getAttribute("aria-expanded")=="true"&&!t.invokeTargetElement.hidden&&t.invokeTargetElement.dispatchEvent(new Dt({relatedTarget:t}));for(let t of e)t.setAttribute("aria-expanded",`${!t.submenuElement.hidden}`);G(this,jn,Rl).call(this,!0)};xl=new WeakSet;gm=function(){let e=this.querySelector('[role="menuitem"] > [role="menu"]:not([hidden])');this.container.classList.toggle("has-expanded",!!e)};Sl=new WeakSet;_m=function(i){var e;ce(this,i.relatedTarget)||(U(this,mi)&&((e=U(this,ci))==null||e.focus()),U(this,Ot)&&U(this,Ot)!==i.relatedTarget&&!this.hidden&&(this.hidden=!0))};Il=new WeakSet;Am=function(i){var e,t,a,r,n;let{key:s,ctrlKey:l,altKey:u,metaKey:c}=i;if(!(l||u||c)&&this.keysUsed.includes(s))if(i.preventDefault(),i.stopPropagation(),s==="Tab"){if(U(this,mi)){this.hidden=!0;return}i.shiftKey?(t=(e=this.previousElementSibling)==null?void 0:e.focus)==null||t.call(e):(r=(a=this.nextElementSibling)==null?void 0:a.focus)==null||r.call(a),this.blur()}else s==="Escape"?((n=U(this,ci))==null||n.focus(),U(this,mi)&&(this.hidden=!0)):s==="Enter"||s===" "?this.handleSelect(i):this.handleMove(i)};Ja=new WeakSet;eo=function(i){return i.composedPath().find(e=>["menuitemradio","menuitemcheckbox"].includes(e.role))};Cl=new WeakSet;Tm=function(){return this.items.find(i=>i.tabIndex===0)};ja=new WeakSet;to=function(i){for(let e of this.items)e.tabIndex=e===i?0:-1};Xn=new WeakSet;Ml=function(i,e){let t=[...this.checkedItems];i.type==="radio"&&this.radioGroupItems.forEach(a=>a.checked=!1),e?i.checked=!i.checked:i.checked=!0,this.checkedItems.some((a,r)=>a!=t[r])&&this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))};le.template=ym;function Uv(i){return["menuitem","menuitemradio","menuitemcheckbox"].includes(i==null?void 0:i.role)}function ir(i){var e;return(e=i.getAttribute("bounds")?Ue(i,`#${i.getAttribute("bounds")}`):Z(i)||i.parentElement)!=null?e:i}d.customElements.get("media-chrome-menu")||d.customElements.define("media-chrome-menu",le);var Bl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},tt=(i,e,t)=>(Bl(i,e,"read from private field"),t?t.call(i):e.get(i)),ft=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Dl=(i,e,t,a)=>(Bl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),et=(i,e,t)=>(Bl(i,e,"access private method"),t),io,rr,Ol,km,Hl,Sm,Wl,Im,it,Qi,nr,Nl,Cm,ao,Pl,Mm=m.createElement("template");Mm.innerHTML=`
`;var Ie={TYPE:"type",VALUE:"value",CHECKED:"checked",DISABLED:"disabled"},Nt=class extends d.HTMLElement{constructor(){super(),ft(this,Ol),ft(this,Hl),ft(this,Wl),ft(this,Qi),ft(this,Nl),ft(this,ao),ft(this,io,!1),ft(this,rr,void 0),ft(this,it,()=>{var e,t;this.setAttribute("submenusize",`${this.submenuElement.items.length}`);let a=this.shadowRoot.querySelector('slot[name="description"]'),r=(e=this.submenuElement.checkedItems)==null?void 0:e[0],n=(t=r==null?void 0:r.dataset.description)!=null?t:r==null?void 0:r.text,s=m.createElement("span");s.textContent=n!=null?n:"",a.replaceChildren(s)}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.append(this.constructor.template.content.cloneNode(!0))),this.shadowRoot.addEventListener("slotchange",this)}static get observedAttributes(){return[Ie.TYPE,Ie.DISABLED,Ie.CHECKED,Ie.VALUE]}enable(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","-1"),ar(this)&&!this.hasAttribute("aria-checked")&&this.setAttribute("aria-checked","false"),this.addEventListener("click",this),this.addEventListener("keydown",this)}disable(){this.removeAttribute("tabindex"),this.removeEventListener("click",this),this.removeEventListener("keydown",this),this.removeEventListener("keyup",this)}handleEvent(e){switch(e.type){case"slotchange":et(this,Ol,km).call(this,e);break;case"click":this.handleClick(e);break;case"keydown":et(this,Nl,Cm).call(this,e);break;case"keyup":et(this,Qi,nr).call(this,e);break}}attributeChangedCallback(e,t,a){e===Ie.CHECKED&&ar(this)&&!tt(this,io)?this.setAttribute("aria-checked",a!=null?"true":"false"):e===Ie.TYPE&&a!==t?this.role="menuitem"+a:e===Ie.DISABLED&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(Ie.DISABLED)||this.enable(),this.role="menuitem"+this.type,Dl(this,rr,Ul(this,this.parentNode)),et(this,ao,Pl).call(this)}disconnectedCallback(){this.disable(),et(this,ao,Pl).call(this),Dl(this,rr,null)}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=$t(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):this.submenuElement}get submenuElement(){return this.shadowRoot.querySelector('slot[name="submenu"]').assignedElements({flatten:!0})[0]}get type(){var e;return(e=this.getAttribute(Ie.TYPE))!=null?e:""}set type(e){this.setAttribute(Ie.TYPE,`${e}`)}get value(){var e;return(e=this.getAttribute(Ie.VALUE))!=null?e:this.text}set value(e){this.setAttribute(Ie.VALUE,e)}get text(){var e;return((e=this.textContent)!=null?e:"").trim()}get checked(){if(ar(this))return this.getAttribute("aria-checked")==="true"}set checked(e){ar(this)&&(Dl(this,io,!0),this.setAttribute("aria-checked",e?"true":"false"),e?this.part.add("checked"):this.part.remove("checked"))}handleClick(e){ar(this)||this.invokeTargetElement&&ce(this,e.target)&&this.invokeTargetElement.dispatchEvent(new Dt({relatedTarget:this}))}get keysUsed(){return["Enter"," "]}};io=new WeakMap;rr=new WeakMap;Ol=new WeakSet;km=function(i){let e=i.target;if(!(e!=null&&e.name))for(let a of e.assignedNodes({flatten:!0}))a instanceof Text&&a.textContent.trim()===""&&a.remove();e.name==="submenu"&&(this.submenuElement?et(this,Hl,Sm).call(this):et(this,Wl,Im).call(this))};Hl=new WeakSet;Sm=async function(){this.setAttribute("aria-haspopup","menu"),this.setAttribute("aria-expanded",`${!this.submenuElement.hidden}`),this.submenuElement.addEventListener("change",tt(this,it)),this.submenuElement.addEventListener("addmenuitem",tt(this,it)),this.submenuElement.addEventListener("removemenuitem",tt(this,it)),tt(this,it).call(this)};Wl=new WeakSet;Im=function(){this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.submenuElement.removeEventListener("change",tt(this,it)),this.submenuElement.removeEventListener("addmenuitem",tt(this,it)),this.submenuElement.removeEventListener("removemenuitem",tt(this,it)),tt(this,it).call(this)};it=new WeakMap;Qi=new WeakSet;nr=function(i){let{key:e}=i;if(!this.keysUsed.includes(e)){this.removeEventListener("keyup",et(this,Qi,nr));return}this.handleClick(i)};Nl=new WeakSet;Cm=function(i){let{metaKey:e,altKey:t,key:a}=i;if(e||t||!this.keysUsed.includes(a)){this.removeEventListener("keyup",et(this,Qi,nr));return}this.addEventListener("keyup",et(this,Qi,nr),{once:!0})};ao=new WeakSet;Pl=function(){var i;let e=(i=tt(this,rr))==null?void 0:i.radioGroupItems;if(!e)return;let t=e.filter(a=>a.getAttribute("aria-checked")==="true").pop();t||(t=e[0]);for(let a of e)a.setAttribute("aria-checked","false");t==null||t.setAttribute("aria-checked","true")};Nt.template=Mm;function ar(i){return i.type==="radio"||i.type==="checkbox"}function Ul(i,e){if(!i)return null;let{host:t}=i.getRootNode();return!e&&t?Ul(i,t):e!=null&&e.items?e:Ul(e,e==null?void 0:e.parentNode)}d.customElements.get("media-chrome-menu-item")||d.customElements.define("media-chrome-menu-item",Nt);var Lm=m.createElement("template");Lm.innerHTML=le.template.innerHTML+`
`;var or=class extends le{get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Z(this).querySelector("media-settings-menu-button")}};or.template=Lm;d.customElements.get("media-settings-menu")||d.customElements.define("media-settings-menu",or);var Rm,ro=m.createElement("template");ro.innerHTML=Nt.template.innerHTML+`
`;(Rm=ro.content)!=null&&Rm.querySelector&&(ro.content.querySelector('slot[name="suffix"]').innerHTML=`
`);var sr=class extends Nt{};sr.template=ro;d.customElements.get("media-settings-menu-item")||d.customElements.define("media-settings-menu-item",sr);var ke=class extends F{connectedCallback(){super.connectedCallback(),this.invokeTargetElement&&this.setAttribute("aria-haspopup","menu")}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=$t(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):null}handleClick(){var e;(e=this.invokeTargetElement)==null||e.dispatchEvent(new Dt({relatedTarget:this}))}};d.customElements.get("media-chrome-menu-button")||d.customElements.define("media-chrome-menu-button",ke);var wm=m.createElement("template");wm.innerHTML=`
`;var no=class extends ke{static get observedAttributes(){return[...super.observedAttributes,"target"]}constructor(){super({slotTemplate:wm,tooltipContent:I.SETTINGS})}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",V.SETTINGS())}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:Z(this).querySelector("media-settings-menu")}};d.customElements.get("media-settings-menu-button")||d.customElements.define("media-settings-menu-button",no);var Vl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},xm=(i,e,t)=>(Vl(i,e,"read from private field"),t?t.call(i):e.get(i)),oo=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},$l=(i,e,t,a)=>(Vl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),so=(i,e,t)=>(Vl(i,e,"access private method"),t),lr,co,lo,Fl,uo,Kl,mo=class extends le{constructor(){super(...arguments),oo(this,lo),oo(this,uo),oo(this,lr,[]),oo(this,co,void 0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_AUDIO_TRACK_LIST,o.MEDIA_AUDIO_TRACK_ENABLED,o.MEDIA_AUDIO_TRACK_UNAVAILABLE]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_AUDIO_TRACK_ENABLED&&t!==a?this.value=a:e===o.MEDIA_AUDIO_TRACK_LIST&&t!==a&&($l(this,lr,Dd(a!=null?a:"")),so(this,lo,Fl).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",so(this,uo,Kl))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",so(this,uo,Kl))}get anchorElement(){var e;return this.anchor!=="auto"?super.anchorElement:(e=Z(this))==null?void 0:e.querySelector("media-audio-track-menu-button")}get mediaAudioTrackList(){return xm(this,lr)}set mediaAudioTrackList(e){$l(this,lr,e),so(this,lo,Fl).call(this)}get mediaAudioTrackEnabled(){var e;return(e=x(this,o.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){M(this,o.MEDIA_AUDIO_TRACK_ENABLED,e)}};lr=new WeakMap;co=new WeakMap;lo=new WeakSet;Fl=function(){if(xm(this,co)===JSON.stringify(this.mediaAudioTrackList))return;$l(this,co,JSON.stringify(this.mediaAudioTrackList));let i=this.mediaAudioTrackList;this.defaultSlot.textContent="";for(let e of i){let t=this.formatMenuItemText(e.label,e),a=je({type:"radio",text:t,value:`${e.id}`,checked:e.enabled});a.prepend(Ne(this,"checked-indicator")),this.defaultSlot.append(a)}};uo=new WeakSet;Kl=function(){if(this.value==null)return;let i=new d.CustomEvent(p.MEDIA_AUDIO_TRACK_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};d.customElements.get("media-audio-track-menu")||d.customElements.define("media-audio-track-menu",mo);var Bv=`
`,Dm=m.createElement("template");Dm.innerHTML=`
${Bv}
`;var ho=class extends ke{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_AUDIO_TRACK_ENABLED,o.MEDIA_AUDIO_TRACK_UNAVAILABLE]}constructor(){super({slotTemplate:Dm,tooltipContent:I.AUDIO_TRACK_MENU})}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",V.AUDIO_TRACKS())}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=Z(this))==null?void 0:e.querySelector("media-audio-track-menu")}get mediaAudioTrackEnabled(){var e;return(e=x(this,o.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){M(this,o.MEDIA_AUDIO_TRACK_ENABLED,e)}};d.customElements.get("media-audio-track-menu-button")||d.customElements.define("media-audio-track-menu-button",ho);var Ql=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Hv=(i,e,t)=>(Ql(i,e,"read from private field"),t?t.call(i):e.get(i)),Yl=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Wv=(i,e,t,a)=>(Ql(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Gl=(i,e,t)=>(Ql(i,e,"access private method"),t),vo,ql,Pm,po,Zl,$v=`
`,Um=m.createElement("template");Um.innerHTML=le.template.innerHTML+`
${$v} `;var dr=class extends le{constructor(){super(...arguments),Yl(this,ql),Yl(this,po),Yl(this,vo,void 0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_SUBTITLES_LIST&&t!==a?Gl(this,ql,Pm).call(this):e===o.MEDIA_SUBTITLES_SHOWING&&t!==a&&(this.value=a)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Gl(this,po,Zl))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Gl(this,po,Zl))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Z(this).querySelector("media-captions-menu-button")}get mediaSubtitlesList(){return Om(this,o.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Nm(this,o.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Om(this,o.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Nm(this,o.MEDIA_SUBTITLES_SHOWING,e)}};vo=new WeakMap;ql=new WeakSet;Pm=function(){var i;if(Hv(this,vo)===JSON.stringify(this.mediaSubtitlesList))return;Wv(this,vo,JSON.stringify(this.mediaSubtitlesList)),this.defaultSlot.textContent="";let e=!this.value,t=je({type:"radio",text:this.formatMenuItemText("Off"),value:"off",checked:e});t.prepend(Ne(this,"checked-indicator")),this.defaultSlot.append(t);let a=this.mediaSubtitlesList;for(let r of a){let n=je({type:"radio",text:this.formatMenuItemText(r.label,r),value:Ur(r),checked:this.value==Ur(r)});n.prepend(Ne(this,"checked-indicator")),((i=r.kind)!=null?i:"subs")==="captions"&&n.append(Ne(this,"captions-indicator")),this.defaultSlot.append(n)}};po=new WeakSet;Zl=function(){let i=this.mediaSubtitlesShowing,e=this.getAttribute(o.MEDIA_SUBTITLES_SHOWING),t=this.value!==e;if(i!=null&&i.length&&t&&this.dispatchEvent(new d.CustomEvent(p.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:i})),!this.value||!t)return;let a=new d.CustomEvent(p.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(a)};dr.template=Um;var Om=(i,e)=>{let t=i.getAttribute(e);return t?Kt(t):[]},Nm=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let a=ut(t);i.getAttribute(e)!==a&&i.setAttribute(e,a)};d.customElements.get("media-captions-menu")||d.customElements.define("media-captions-menu",dr);var Fv=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Kv=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Vv=(i,e,t,a)=>(Fv(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),zl,Yv=`
`,Gv=`
`,$m=m.createElement("template");$m.innerHTML=`
${Yv}
${Gv}
`;var Bm=i=>{i.setAttribute("aria-checked",Br(i).toString())},fo=class extends ke{constructor(e={}){super({slotTemplate:$m,tooltipContent:I.CAPTIONS,...e}),Kv(this,zl,void 0),Vv(this,zl,!1)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",V.CLOSED_CAPTIONS()),Bm(this)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_SUBTITLES_SHOWING&&Bm(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=Z(this))==null?void 0:e.querySelector("media-captions-menu")}get mediaSubtitlesList(){return Hm(this,o.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Wm(this,o.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Hm(this,o.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Wm(this,o.MEDIA_SUBTITLES_SHOWING,e)}};zl=new WeakMap;var Hm=(i,e)=>{let t=i.getAttribute(e);return t?Kt(t):[]},Wm=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let a=ut(t);i.getAttribute(e)!==a&&i.setAttribute(e,a)};d.customElements.get("media-captions-menu-button")||d.customElements.define("media-captions-menu-button",fo);var Fm=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Eo=(i,e,t)=>(Fm(i,e,"read from private field"),t?t.call(i):e.get(i)),Xl=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ur=(i,e,t)=>(Fm(i,e,"access private method"),t),zi,cr,bo,go,jl,Jl={RATES:"rates"},_o=class extends le{constructor(){super(),Xl(this,cr),Xl(this,go),Xl(this,zi,new Be(this,Jl.RATES,{defaultValue:Os})),ur(this,cr,bo).call(this)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,Jl.RATES]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_PLAYBACK_RATE&&t!=a?this.value=a:e===Jl.RATES&&t!=a&&(Eo(this,zi).value=a,ur(this,cr,bo).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",ur(this,go,jl))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",ur(this,go,jl))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Z(this).querySelector("media-playback-rate-menu-button")}get rates(){return Eo(this,zi)}set rates(e){e?Array.isArray(e)&&(Eo(this,zi).value=e.join(" ")):Eo(this,zi).value="",ur(this,cr,bo).call(this)}get mediaPlaybackRate(){return w(this,o.MEDIA_PLAYBACK_RATE,Ri)}set mediaPlaybackRate(e){P(this,o.MEDIA_PLAYBACK_RATE,e)}};zi=new WeakMap;cr=new WeakSet;bo=function(){this.defaultSlot.textContent="";for(let i of this.rates){let e=je({type:"radio",text:this.formatMenuItemText(`${i}x`,i),value:i,checked:this.mediaPlaybackRate==i});e.prepend(Ne(this,"checked-indicator")),this.defaultSlot.append(e)}};go=new WeakSet;jl=function(){if(!this.value)return;let i=new d.CustomEvent(p.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};d.customElements.get("media-playback-rate-menu")||d.customElements.define("media-playback-rate-menu",_o);var qv=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ao=(i,e,t)=>(qv(i,e,"read from private field"),t?t.call(i):e.get(i)),Zv=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Xi,ed={RATES:"rates"},Qv=[1,1.2,1.5,1.7,2],td=1,Km=m.createElement("template");Km.innerHTML=`
`;var To=class extends ke{constructor(e={}){super({slotTemplate:Km,tooltipContent:I.PLAYBACK_RATE,...e}),Zv(this,Xi,new Be(this,ed.RATES,{defaultValue:Qv})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${td}x`}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,ed.RATES]}attributeChangedCallback(e,t,a){if(super.attributeChangedCallback(e,t,a),e===ed.RATES&&(Ao(this,Xi).value=a),e===o.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,n=Number.isNaN(r)?td:r;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",V.PLAYBACK_RATE({playbackRate:n}))}}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:Z(this).querySelector("media-playback-rate-menu")}get rates(){return Ao(this,Xi)}set rates(e){e?Array.isArray(e)&&(Ao(this,Xi).value=e.join(" ")):Ao(this,Xi).value=""}get mediaPlaybackRate(){return w(this,o.MEDIA_PLAYBACK_RATE,td)}set mediaPlaybackRate(e){P(this,o.MEDIA_PLAYBACK_RATE,e)}};Xi=new WeakMap;d.customElements.get("media-playback-rate-menu-button")||d.customElements.define("media-playback-rate-menu-button",To);var ad=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},hr=(i,e,t)=>(ad(i,e,"read from private field"),t?t.call(i):e.get(i)),yo=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Vm=(i,e,t,a)=>(ad(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),mr=(i,e,t)=>(ad(i,e,"access private method"),t),pr,Ji,vr,ko,So,id,Io=class extends le{constructor(){super(...arguments),yo(this,vr),yo(this,So),yo(this,pr,[]),yo(this,Ji,{})}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_RENDITION_LIST,o.MEDIA_RENDITION_SELECTED,o.MEDIA_RENDITION_UNAVAILABLE,o.MEDIA_HEIGHT]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_RENDITION_SELECTED&&t!==a?this.value=a!=null?a:"auto":e===o.MEDIA_RENDITION_LIST&&t!==a?(Vm(this,pr,wd(a)),mr(this,vr,ko).call(this)):e===o.MEDIA_HEIGHT&&t!==a&&mr(this,vr,ko).call(this)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",mr(this,So,id))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",mr(this,So,id))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Z(this).querySelector("media-rendition-menu-button")}get mediaRenditionList(){return hr(this,pr)}set mediaRenditionList(e){Vm(this,pr,e),mr(this,vr,ko).call(this)}get mediaRenditionSelected(){return x(this,o.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){M(this,o.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return w(this,o.MEDIA_HEIGHT)}set mediaHeight(e){P(this,o.MEDIA_HEIGHT,e)}};pr=new WeakMap;Ji=new WeakMap;vr=new WeakSet;ko=function(){if(hr(this,Ji).mediaRenditionList===JSON.stringify(this.mediaRenditionList)&&hr(this,Ji).mediaHeight===this.mediaHeight)return;hr(this,Ji).mediaRenditionList=JSON.stringify(this.mediaRenditionList),hr(this,Ji).mediaHeight=this.mediaHeight;let i=this.mediaRenditionList.sort((r,n)=>n.height-r.height);for(let r of i)r.selected=r.id===this.mediaRenditionSelected;this.defaultSlot.textContent="";let e=!this.mediaRenditionSelected;for(let r of i){let n=this.formatMenuItemText(`${Math.min(r.width,r.height)}p`,r),s=je({type:"radio",text:n,value:`${r.id}`,checked:r.selected&&!e});s.prepend(Ne(this,"checked-indicator")),this.defaultSlot.append(s)}let t=je({type:"radio",text:this.formatMenuItemText("Auto"),value:"auto",checked:e}),a=this.mediaHeight>0?`Auto (${this.mediaHeight}p)`:"Auto";t.dataset.description=a,t.prepend(Ne(this,"checked-indicator")),this.defaultSlot.append(t)};So=new WeakSet;id=function(){if(this.value==null)return;let i=new d.CustomEvent(p.MEDIA_RENDITION_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};d.customElements.get("media-rendition-menu")||d.customElements.define("media-rendition-menu",Io);var zv=`
`,Ym=m.createElement("template");Ym.innerHTML=`
${zv}
`;var Co=class extends ke{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_RENDITION_SELECTED,o.MEDIA_RENDITION_UNAVAILABLE,o.MEDIA_HEIGHT]}constructor(){super({slotTemplate:Ym,tooltipContent:I.RENDITIONS})}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",V.QUALITY())}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:Z(this).querySelector("media-rendition-menu")}get mediaRenditionSelected(){return x(this,o.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){M(this,o.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return w(this,o.MEDIA_HEIGHT)}set mediaHeight(e){P(this,o.MEDIA_HEIGHT,e)}};d.customElements.get("media-rendition-menu-button")||d.customElements.define("media-rendition-menu-button",Co);var rd=Ae.createElement("template");"innerHTML"in rd&&(rd.innerHTML=dm);var Gm,qm,Mo=class extends li{};Mo.template=(qm=(Gm=rd.content)==null?void 0:Gm.children)==null?void 0:qm[0];Q.customElements.get("media-theme-gerwig")||Q.customElements.define("media-theme-gerwig",Mo);var Xv="gerwig";var Et={SRC:"src",POSTER:"poster"},h={STYLE:"style",DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-color",ACCENT_COLOR:"accent-color",FORWARD_SEEK_OFFSET:"forward-seek-offset",BACKWARD_SEEK_OFFSET:"backward-seek-offset",PLAYBACK_TOKEN:"playback-token",THUMBNAIL_TOKEN:"thumbnail-token",STORYBOARD_TOKEN:"storyboard-token",DRM_TOKEN:"drm-token",STORYBOARD_SRC:"storyboard-src",THUMBNAIL_TIME:"thumbnail-time",AUDIO:"audio",NOHOTKEYS:"nohotkeys",HOTKEYS:"hotkeys",PLAYBACK_RATES:"playbackrates",DEFAULT_SHOW_REMAINING_TIME:"default-show-remaining-time",DEFAULT_DURATION:"default-duration",TITLE:"title",PLACEHOLDER:"placeholder",THEME:"theme",DEFAULT_STREAM_TYPE:"default-stream-type",TARGET_LIVE_WINDOW:"target-live-window",EXTRA_SOURCE_PARAMS:"extra-source-params",NO_VOLUME_PREF:"no-volume-pref",CAST_RECEIVER:"cast-receiver",NO_TOOLTIPS:"no-tooltips"},nd=["audio","backwardseekoffset","defaultduration","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","novolumepref"];function Jv(i,e){var a;return{src:!i.playbackId&&i.src,playbackId:i.playbackId,hasSrc:!!i.playbackId||!!i.src||!!i.currentSrc,poster:i.poster,storyboard:i.storyboard,storyboardSrc:i.getAttribute(h.STORYBOARD_SRC),placeholder:i.getAttribute("placeholder"),themeTemplate:jv(i),thumbnailTime:!i.tokens.thumbnail&&i.thumbnailTime,autoplay:i.autoplay,crossOrigin:i.crossOrigin,loop:i.loop,noHotKeys:i.hasAttribute(h.NOHOTKEYS),hotKeys:i.getAttribute(h.HOTKEYS),muted:i.muted,paused:i.paused,preload:i.preload,envKey:i.envKey,preferCmcd:i.preferCmcd,debug:i.debug,disableTracking:i.disableTracking,disableCookies:i.disableCookies,tokens:i.tokens,beaconCollectionDomain:i.beaconCollectionDomain,maxResolution:i.maxResolution,minResolution:i.minResolution,programStartTime:i.programStartTime,programEndTime:i.programEndTime,assetStartTime:i.assetStartTime,assetEndTime:i.assetEndTime,renditionOrder:i.renditionOrder,metadata:i.metadata,playerSoftwareName:i.playerSoftwareName,playerSoftwareVersion:i.playerSoftwareVersion,startTime:i.startTime,preferPlayback:i.preferPlayback,audio:i.audio,defaultStreamType:i.defaultStreamType,targetLiveWindow:i.getAttribute(E.Attributes.TARGET_LIVE_WINDOW),streamType:Ka(i.getAttribute(E.Attributes.STREAM_TYPE)),primaryColor:i.getAttribute(h.PRIMARY_COLOR),secondaryColor:i.getAttribute(h.SECONDARY_COLOR),accentColor:i.getAttribute(h.ACCENT_COLOR),forwardSeekOffset:i.forwardSeekOffset,backwardSeekOffset:i.backwardSeekOffset,defaultHiddenCaptions:i.defaultHiddenCaptions,defaultDuration:i.defaultDuration,defaultShowRemainingTime:i.defaultShowRemainingTime,hideDuration:ef(i),playbackRates:i.getAttribute(h.PLAYBACK_RATES),customDomain:(a=i.getAttribute(E.Attributes.CUSTOM_DOMAIN))!=null?a:void 0,title:i.getAttribute(h.TITLE),novolumepref:i.hasAttribute(h.NO_VOLUME_PREF),castReceiver:i.castReceiver,...e,extraSourceParams:i.extraSourceParams}}function jv(i){var t,a;let e=i.theme;if(e){let r=(a=(t=i.getRootNode())==null?void 0:t.getElementById)==null?void 0:a.call(t,e);if(r&&r instanceof HTMLTemplateElement)return r;e.startsWith("media-theme-")||(e=`media-theme-${e}`);let n=Q.customElements.get(e);if(n!=null&&n.template)return n.template}}function ef(i){var t;let e=(t=i.mediaController)==null?void 0:t.querySelector("media-time-display");return e&&getComputedStyle(e).getPropertyValue("--media-duration-display-display").trim()==="none"}function Zm(i){let e=i.hasAttribute(h.TITLE)?{video_title:i.getAttribute(h.TITLE)}:{};return i.getAttributeNames().filter(t=>t.startsWith("metadata-")).reduce((t,a)=>{let r=i.getAttribute(a);return r!==null&&(t[a.replace(/^metadata-/,"").replace(/-/g,"_")]=r),t},e)}var tf=Object.values(E.Attributes),af=Object.values(Et),rf=Object.values(h),nf=Un(),of="mux-player",Qm={dialog:void 0,isDialogOpen:!1},sf={redundant_streams:!0},Er,br,Bt,gr,pi,at,Pt,Lo,zm,_r,od,bt,hi,Ro,Xm,wo,Jm,xo,jm,Do,eh,fr=class extends nl{constructor(){super();X(this,at);X(this,Lo);X(this,_r);X(this,bt);X(this,Ro);X(this,wo);X(this,xo);X(this,Do);X(this,Er,!1);X(this,br,{});X(this,Bt,!0);X(this,gr,new Pn(this,"hotkeys"));X(this,pi,{...Qm,onCloseErrorDialog:()=>j(this,_r,od).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:t=>{il(this,Ae.activeElement)||t.preventDefault()}});this.attachShadow({mode:"open"}),j(this,Lo,zm).call(this),this.isConnected&&j(this,at,Pt).call(this)}static get observedAttributes(){var t;return[...(t=nl.observedAttributes)!=null?t:[],...af,...tf,...rf]}get mediaTheme(){var t;return(t=this.shadowRoot)==null?void 0:t.querySelector("media-theme")}get mediaController(){var t,a;return(a=(t=this.mediaTheme)==null?void 0:t.shadowRoot)==null?void 0:a.querySelector("media-controller")}connectedCallback(){var a;let t=(a=this.shadowRoot)==null?void 0:a.querySelector("mux-video");t&&(t.metadata=Zm(this))}attributeChangedCallback(t,a,r){switch(j(this,at,Pt).call(this),super.attributeChangedCallback(t,a,r),t){case h.HOTKEYS:R(this,gr).value=r;break;case h.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&Qe((0,S.i18n)("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time."));break}case h.THUMBNAIL_TOKEN:{if(r){let s=(0,S.parseJwt)(r);if(s){let{aud:l}=s,u=S.MuxJWTAud.THUMBNAIL;l!==u&&Qe((0,S.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:l,expectedAud:u,tokenNamePrefix:"thumbnail"}))}}break}case h.STORYBOARD_TOKEN:{if(r){let s=(0,S.parseJwt)(r);if(s){let{aud:l}=s,u=S.MuxJWTAud.STORYBOARD;l!==u&&Qe((0,S.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:l,expectedAud:u,tokenNamePrefix:"storyboard"}))}}break}case h.DRM_TOKEN:{if(r){let s=(0,S.parseJwt)(r);if(s){let{aud:l}=s,u=S.MuxJWTAud.DRM;l!==u&&Qe((0,S.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:l,expectedAud:u,tokenNamePrefix:"drm"}))}}break}case E.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&Ee((0,S.i18n)("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r}));break}case E.Attributes.STREAM_TYPE:r&&![S.StreamTypes.LIVE,S.StreamTypes.ON_DEMAND,S.StreamTypes.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:al({file:"invalid-stream-type.md",message:(0,S.i18n)("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):r===S.StreamTypes.LIVE?this.getAttribute(h.TARGET_LIVE_WINDOW)==null&&(this.targetLiveWindow=0):this.targetLiveWindow=Number.NaN}[E.Attributes.PLAYBACK_ID,Et.SRC,h.PLAYBACK_TOKEN].includes(t)&&a!==r&&Se(this,pi,{...R(this,pi),...Qm}),j(this,bt,hi).call(this,{[Dc(t)]:r})}get preferCmcd(){var t;return(t=this.getAttribute(E.Attributes.PREFER_CMCD))!=null?t:void 0}set preferCmcd(t){t!==this.preferCmcd&&(t?S.CmcdTypeValues.includes(t)?this.setAttribute(E.Attributes.PREFER_CMCD,t):Qe(`Invalid value for preferCmcd. Must be one of ${S.CmcdTypeValues.join()}`):this.removeAttribute(E.Attributes.PREFER_CMCD))}get hasPlayed(){var t,a;return(a=(t=this.mediaController)==null?void 0:t.hasAttribute(o.MEDIA_HAS_PLAYED))!=null?a:!1}get inLiveWindow(){var t;return(t=this.mediaController)==null?void 0:t.hasAttribute(o.MEDIA_TIME_IS_LIVE)}get _hls(){var t;return(t=this.media)==null?void 0:t._hls}get mux(){var t;return(t=this.media)==null?void 0:t.mux}get theme(){var t;return(t=this.getAttribute(h.THEME))!=null?t:Xv}set theme(t){this.setAttribute(h.THEME,`${t}`)}get themeProps(){let t=this.mediaTheme;if(!t)return;let a={};for(let r of t.getAttributeNames()){if(nd.includes(r))continue;let n=t.getAttribute(r);a[Nn(r)]=n===""?!0:n}return a}set themeProps(t){var r,n;j(this,at,Pt).call(this);let a={...this.themeProps,...t};for(let s in a){if(nd.includes(s))continue;let l=t==null?void 0:t[s];typeof l=="boolean"||l==null?(r=this.mediaTheme)==null||r.toggleAttribute(On(s),!!l):(n=this.mediaTheme)==null||n.setAttribute(On(s),l)}}get playbackId(){var t;return(t=this.getAttribute(E.Attributes.PLAYBACK_ID))!=null?t:void 0}set playbackId(t){t?this.setAttribute(E.Attributes.PLAYBACK_ID,t):this.removeAttribute(E.Attributes.PLAYBACK_ID)}get src(){var t,a;return this.playbackId?(t=Ut(this,Et.SRC))!=null?t:void 0:(a=this.getAttribute(Et.SRC))!=null?a:void 0}set src(t){t?this.setAttribute(Et.SRC,t):this.removeAttribute(Et.SRC)}get poster(){var r;let t=this.getAttribute(Et.POSTER);if(t!=null)return t;let{tokens:a}=this;if(a.playback&&!a.thumbnail){Qe("Missing expected thumbnail token. No poster image will be shown");return}if(this.playbackId&&!this.audio)return wc(this.playbackId,{customDomain:this.customDomain,thumbnailTime:(r=this.thumbnailTime)!=null?r:this.startTime,programTime:this.programStartTime,token:a.thumbnail})}set poster(t){t||t===""?this.setAttribute(Et.POSTER,t):this.removeAttribute(Et.POSTER)}get storyboardSrc(){var t;return(t=this.getAttribute(h.STORYBOARD_SRC))!=null?t:void 0}set storyboardSrc(t){t?this.setAttribute(h.STORYBOARD_SRC,t):this.removeAttribute(h.STORYBOARD_SRC)}get storyboard(){let{tokens:t}=this;if(this.storyboardSrc&&!t.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[S.StreamTypes.LIVE,S.StreamTypes.UNKNOWN].includes(this.streamType)||t.playback&&!t.storyboard))return xc(this.playbackId,{customDomain:this.customDomain,token:t.storyboard,programStartTime:this.programStartTime,programEndTime:this.programEndTime})}get audio(){return this.hasAttribute(h.AUDIO)}set audio(t){if(!t){this.removeAttribute(h.AUDIO);return}this.setAttribute(h.AUDIO,"")}get hotkeys(){return R(this,gr)}get nohotkeys(){return this.hasAttribute(h.NOHOTKEYS)}set nohotkeys(t){if(!t){this.removeAttribute(h.NOHOTKEYS);return}this.setAttribute(h.NOHOTKEYS,"")}get thumbnailTime(){return fe(this.getAttribute(h.THUMBNAIL_TIME))}set thumbnailTime(t){this.setAttribute(h.THUMBNAIL_TIME,`${t}`)}get title(){var t;return(t=this.getAttribute(h.TITLE))!=null?t:""}set title(t){t!==this.title&&(t?this.setAttribute(h.TITLE,t):this.removeAttribute("title"),super.title=t)}get placeholder(){var t;return(t=Ut(this,h.PLACEHOLDER))!=null?t:""}set placeholder(t){this.setAttribute(h.PLACEHOLDER,`${t}`)}get primaryColor(){var a,r;let t=this.getAttribute(h.PRIMARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=Q.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),t))return t}set primaryColor(t){this.setAttribute(h.PRIMARY_COLOR,`${t}`)}get secondaryColor(){var a,r;let t=this.getAttribute(h.SECONDARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=Q.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),t))return t}set secondaryColor(t){this.setAttribute(h.SECONDARY_COLOR,`${t}`)}get accentColor(){var a,r;let t=this.getAttribute(h.ACCENT_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=Q.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_accent-color"))==null?void 0:r.trim(),t))return t}set accentColor(t){this.setAttribute(h.ACCENT_COLOR,`${t}`)}get defaultShowRemainingTime(){return this.hasAttribute(h.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(t){t?this.setAttribute(h.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(h.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(this.hasAttribute(h.PLAYBACK_RATES))return this.getAttribute(h.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(t=>Number(t)).filter(t=>!Number.isNaN(t)).sort((t,a)=>t-a)}set playbackRates(t){if(!t){this.removeAttribute(h.PLAYBACK_RATES);return}this.setAttribute(h.PLAYBACK_RATES,t.join(" "))}get forwardSeekOffset(){var t;return(t=fe(this.getAttribute(h.FORWARD_SEEK_OFFSET)))!=null?t:10}set forwardSeekOffset(t){this.setAttribute(h.FORWARD_SEEK_OFFSET,`${t}`)}get backwardSeekOffset(){var t;return(t=fe(this.getAttribute(h.BACKWARD_SEEK_OFFSET)))!=null?t:10}set backwardSeekOffset(t){this.setAttribute(h.BACKWARD_SEEK_OFFSET,`${t}`)}get defaultHiddenCaptions(){return this.hasAttribute(h.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(t){t?this.setAttribute(h.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(h.DEFAULT_HIDDEN_CAPTIONS)}get defaultDuration(){return fe(this.getAttribute(h.DEFAULT_DURATION))}set defaultDuration(t){t==null?this.removeAttribute(h.DEFAULT_DURATION):this.setAttribute(h.DEFAULT_DURATION,`${t}`)}get playerSoftwareName(){var t;return(t=this.getAttribute(E.Attributes.PLAYER_SOFTWARE_NAME))!=null?t:of}get playerSoftwareVersion(){var t;return(t=this.getAttribute(E.Attributes.PLAYER_SOFTWARE_VERSION))!=null?t:nf}get beaconCollectionDomain(){var t;return(t=this.getAttribute(E.Attributes.BEACON_COLLECTION_DOMAIN))!=null?t:void 0}set beaconCollectionDomain(t){t!==this.beaconCollectionDomain&&(t?this.setAttribute(E.Attributes.BEACON_COLLECTION_DOMAIN,t):this.removeAttribute(E.Attributes.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var t;return(t=this.getAttribute(E.Attributes.MAX_RESOLUTION))!=null?t:void 0}set maxResolution(t){t!==this.maxResolution&&(t?this.setAttribute(E.Attributes.MAX_RESOLUTION,t):this.removeAttribute(E.Attributes.MAX_RESOLUTION))}get minResolution(){var t;return(t=this.getAttribute(E.Attributes.MIN_RESOLUTION))!=null?t:void 0}set minResolution(t){t!==this.minResolution&&(t?this.setAttribute(E.Attributes.MIN_RESOLUTION,t):this.removeAttribute(E.Attributes.MIN_RESOLUTION))}get renditionOrder(){var t;return(t=this.getAttribute(E.Attributes.RENDITION_ORDER))!=null?t:void 0}set renditionOrder(t){t!==this.renditionOrder&&(t?this.setAttribute(E.Attributes.RENDITION_ORDER,t):this.removeAttribute(E.Attributes.RENDITION_ORDER))}get programStartTime(){return fe(this.getAttribute(E.Attributes.PROGRAM_START_TIME))}set programStartTime(t){t==null?this.removeAttribute(E.Attributes.PROGRAM_START_TIME):this.setAttribute(E.Attributes.PROGRAM_START_TIME,`${t}`)}get programEndTime(){return fe(this.getAttribute(E.Attributes.PROGRAM_END_TIME))}set programEndTime(t){t==null?this.removeAttribute(E.Attributes.PROGRAM_END_TIME):this.setAttribute(E.Attributes.PROGRAM_END_TIME,`${t}`)}get assetStartTime(){return fe(this.getAttribute(E.Attributes.ASSET_START_TIME))}set assetStartTime(t){t==null?this.removeAttribute(E.Attributes.ASSET_START_TIME):this.setAttribute(E.Attributes.ASSET_START_TIME,`${t}`)}get assetEndTime(){return fe(this.getAttribute(E.Attributes.ASSET_END_TIME))}set assetEndTime(t){t==null?this.removeAttribute(E.Attributes.ASSET_END_TIME):this.setAttribute(E.Attributes.ASSET_END_TIME,`${t}`)}get extraSourceParams(){return this.hasAttribute(h.EXTRA_SOURCE_PARAMS)?[...new URLSearchParams(this.getAttribute(h.EXTRA_SOURCE_PARAMS)).entries()].reduce((t,[a,r])=>(t[a]=r,t),{}):sf}set extraSourceParams(t){t==null?this.removeAttribute(h.EXTRA_SOURCE_PARAMS):this.setAttribute(h.EXTRA_SOURCE_PARAMS,new URLSearchParams(t).toString())}get customDomain(){var t;return(t=this.getAttribute(E.Attributes.CUSTOM_DOMAIN))!=null?t:void 0}set customDomain(t){t!==this.customDomain&&(t?this.setAttribute(E.Attributes.CUSTOM_DOMAIN,t):this.removeAttribute(E.Attributes.CUSTOM_DOMAIN))}get envKey(){var t;return(t=Ut(this,E.Attributes.ENV_KEY))!=null?t:void 0}set envKey(t){this.setAttribute(E.Attributes.ENV_KEY,`${t}`)}get noVolumePref(){return this.hasAttribute(h.NO_VOLUME_PREF)}set noVolumePref(t){t?this.setAttribute(h.NO_VOLUME_PREF,""):this.removeAttribute(h.NO_VOLUME_PREF)}get debug(){return Ut(this,E.Attributes.DEBUG)!=null}set debug(t){t?this.setAttribute(E.Attributes.DEBUG,""):this.removeAttribute(E.Attributes.DEBUG)}get disableTracking(){return Ut(this,E.Attributes.DISABLE_TRACKING)!=null}set disableTracking(t){this.toggleAttribute(E.Attributes.DISABLE_TRACKING,!!t)}get disableCookies(){return Ut(this,E.Attributes.DISABLE_COOKIES)!=null}set disableCookies(t){t?this.setAttribute(E.Attributes.DISABLE_COOKIES,""):this.removeAttribute(E.Attributes.DISABLE_COOKIES)}get streamType(){var t,a,r;return(r=(a=this.getAttribute(E.Attributes.STREAM_TYPE))!=null?a:(t=this.media)==null?void 0:t.streamType)!=null?r:S.StreamTypes.UNKNOWN}set streamType(t){this.setAttribute(E.Attributes.STREAM_TYPE,`${t}`)}get defaultStreamType(){var t,a,r;return(r=(a=this.getAttribute(h.DEFAULT_STREAM_TYPE))!=null?a:(t=this.mediaController)==null?void 0:t.getAttribute(h.DEFAULT_STREAM_TYPE))!=null?r:S.StreamTypes.ON_DEMAND}set defaultStreamType(t){t?this.setAttribute(h.DEFAULT_STREAM_TYPE,t):this.removeAttribute(h.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var t,a;return this.hasAttribute(h.TARGET_LIVE_WINDOW)?+this.getAttribute(h.TARGET_LIVE_WINDOW):(a=(t=this.media)==null?void 0:t.targetLiveWindow)!=null?a:Number.NaN}set targetLiveWindow(t){t==this.targetLiveWindow||Number.isNaN(t)&&Number.isNaN(this.targetLiveWindow)||(t==null?this.removeAttribute(h.TARGET_LIVE_WINDOW):this.setAttribute(h.TARGET_LIVE_WINDOW,`${+t}`))}get liveEdgeStart(){var t;return(t=this.media)==null?void 0:t.liveEdgeStart}get startTime(){return fe(Ut(this,E.Attributes.START_TIME))}set startTime(t){this.setAttribute(E.Attributes.START_TIME,`${t}`)}get preferPlayback(){let t=this.getAttribute(E.Attributes.PREFER_PLAYBACK);if(t===S.PlaybackTypes.MSE||t===S.PlaybackTypes.NATIVE)return t}set preferPlayback(t){t!==this.preferPlayback&&(t===S.PlaybackTypes.MSE||t===S.PlaybackTypes.NATIVE?this.setAttribute(E.Attributes.PREFER_PLAYBACK,t):this.removeAttribute(E.Attributes.PREFER_PLAYBACK))}get metadata(){var t;return(t=this.media)==null?void 0:t.metadata}set metadata(t){if(j(this,at,Pt).call(this),!this.media){Ee("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...Zm(this),...t}}get _hlsConfig(){var t;return(t=this.media)==null?void 0:t._hlsConfig}set _hlsConfig(t){if(j(this,at,Pt).call(this),!this.media){Ee("underlying media element missing when trying to set _hlsConfig. _hlsConfig will not be set.");return}this.media._hlsConfig=t}async addCuePoints(t){var a;if(j(this,at,Pt).call(this),!this.media){Ee("underlying media element missing when trying to addCuePoints. cuePoints will not be added.");return}return(a=this.media)==null?void 0:a.addCuePoints(t)}get activeCuePoint(){var t;return(t=this.media)==null?void 0:t.activeCuePoint}get cuePoints(){var t,a;return(a=(t=this.media)==null?void 0:t.cuePoints)!=null?a:[]}addChapters(t){var a;if(j(this,at,Pt).call(this),!this.media){Ee("underlying media element missing when trying to addChapters. chapters will not be added.");return}return(a=this.media)==null?void 0:a.addChapters(t)}get activeChapter(){var t;return(t=this.media)==null?void 0:t.activeChapter}get chapters(){var t,a;return(a=(t=this.media)==null?void 0:t.chapters)!=null?a:[]}getStartDate(){var t;return(t=this.media)==null?void 0:t.getStartDate()}get currentPdt(){var t;return(t=this.media)==null?void 0:t.currentPdt}get tokens(){let t=this.getAttribute(h.PLAYBACK_TOKEN),a=this.getAttribute(h.DRM_TOKEN),r=this.getAttribute(h.THUMBNAIL_TOKEN),n=this.getAttribute(h.STORYBOARD_TOKEN);return{...R(this,br),...t!=null?{playback:t}:{},...a!=null?{drm:a}:{},...r!=null?{thumbnail:r}:{},...n!=null?{storyboard:n}:{}}}set tokens(t){Se(this,br,t!=null?t:{})}get playbackToken(){var t;return(t=this.getAttribute(h.PLAYBACK_TOKEN))!=null?t:void 0}set playbackToken(t){this.setAttribute(h.PLAYBACK_TOKEN,`${t}`)}get drmToken(){var t;return(t=this.getAttribute(h.DRM_TOKEN))!=null?t:void 0}set drmToken(t){this.setAttribute(h.DRM_TOKEN,`${t}`)}get thumbnailToken(){var t;return(t=this.getAttribute(h.THUMBNAIL_TOKEN))!=null?t:void 0}set thumbnailToken(t){this.setAttribute(h.THUMBNAIL_TOKEN,`${t}`)}get storyboardToken(){var t;return(t=this.getAttribute(h.STORYBOARD_TOKEN))!=null?t:void 0}set storyboardToken(t){this.setAttribute(h.STORYBOARD_TOKEN,`${t}`)}addTextTrack(t,a,r,n){var l;let s=(l=this.media)==null?void 0:l.nativeEl;if(s)return(0,S.addTextTrack)(s,t,a,r,n)}removeTextTrack(t){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(a)return(0,S.removeTextTrack)(a,t)}get textTracks(){var t;return(t=this.media)==null?void 0:t.textTracks}get castReceiver(){var t;return(t=this.getAttribute(h.CAST_RECEIVER))!=null?t:void 0}set castReceiver(t){t!==this.castReceiver&&(t?this.setAttribute(h.CAST_RECEIVER,t):this.removeAttribute(h.CAST_RECEIVER))}get castCustomData(){var t;return(t=this.media)==null?void 0:t.castCustomData}set castCustomData(t){if(!this.media){Ee("underlying media element missing when trying to set castCustomData. castCustomData will not be set.");return}this.media.castCustomData=t}get noTooltips(){return this.hasAttribute(h.NO_TOOLTIPS)}set noTooltips(t){if(!t){this.removeAttribute(h.NO_TOOLTIPS);return}this.setAttribute(h.NO_TOOLTIPS,"")}};Er=new WeakMap,br=new WeakMap,Bt=new WeakMap,gr=new WeakMap,pi=new WeakMap,at=new WeakSet,Pt=function(){var t,a,r,n;if(!R(this,Er)){Se(this,Er,!0),j(this,bt,hi).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof Q.HTMLElement))throw""}catch{Ee(" failed to upgrade!")}try{if(customElements.upgrade(this.media),!(this.media instanceof E.default))throw""}catch{Ee(" failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof as))throw""}catch{Ee(" failed to upgrade!")}this.init(),j(this,Ro,Xm).call(this),j(this,wo,Jm).call(this),j(this,xo,jm).call(this),Se(this,Bt,(a=(t=this.mediaController)==null?void 0:t.hasAttribute(D.USER_INACTIVE))!=null?a:!0),j(this,Do,eh).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",()=>j(this,bt,hi).call(this)),(n=this.media)==null||n.addEventListener("loadstart",()=>j(this,bt,hi).call(this))}},Lo=new WeakSet,zm=function(){var t,a;try{(t=window==null?void 0:window.CSS)==null||t.registerProperty({name:"--media-primary-color",syntax:"",inherits:!0}),(a=window==null?void 0:window.CSS)==null||a.registerProperty({name:"--media-secondary-color",syntax:"",inherits:!0})}catch{}},_r=new WeakSet,od=function(t){Object.assign(R(this,pi),t),j(this,bt,hi).call(this)},bt=new WeakSet,hi=function(t={}){om(sm(Jv(this,{...R(this,pi),...t})),this.shadowRoot)},Ro=new WeakSet,Xm=function(){let t=r=>{var l,u;if(!(r!=null&&r.startsWith("theme-")))return;let n=r.replace(/^theme-/,"");if(nd.includes(n))return;let s=this.getAttribute(r);s!=null?(l=this.mediaTheme)==null||l.setAttribute(n,s):(u=this.mediaTheme)==null||u.removeAttribute(n)};new MutationObserver(r=>{for(let{attributeName:n}of r)t(n)}).observe(this,{attributes:!0}),this.getAttributeNames().forEach(t)},wo=new WeakSet,Jm=function(){var a;let t=r=>{let{detail:n}=r;if(n instanceof E.MediaError||(n=new E.MediaError(n.message,n.code,n.fatal)),!(n!=null&&n.fatal)){Qe(n),n.data&&Qe(`${n.name} data:`,n.data);return}let{dialog:s,devlog:l}=El(n,!1);l.message&&al(l),Ee(n),n.data&&Ee(`${n.name} data:`,n.data),j(this,_r,od).call(this,{isDialogOpen:!0,dialog:s})};this.addEventListener("error",t),this.media&&(this.media.errorTranslator=(r={})=>{var s,l,u;if(!(((s=this.media)==null?void 0:s.error)instanceof E.MediaError))return r;let{devlog:n}=El((l=this.media)==null?void 0:l.error,!1);return{player_error_code:(u=this.media)==null?void 0:u.error.code,player_error_message:n.message?String(n.message):r.player_error_message,player_error_context:n.context?String(n.context):r.player_error_context}}),(a=this.media)==null||a.addEventListener("error",r=>{var s,l;let{detail:n}=r;if(!n){let{message:u,code:c}=(l=(s=this.media)==null?void 0:s.error)!=null?l:{};n=new E.MediaError(u,c)}n!=null&&n.fatal&&this.dispatchEvent(new CustomEvent("error",{detail:n}))})},xo=new WeakSet,jm=function(){var a,r,n,s;let t=()=>j(this,bt,hi).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",t),(s=(n=this.media)==null?void 0:n.textTracks)==null||s.addEventListener("removetrack",t)},Do=new WeakSet,eh=function(){var c,b;if(!/Firefox/i.test(navigator.userAgent))return;let a,r=new WeakMap,n=()=>this.streamType===S.StreamTypes.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,s=(g,v,f=!1)=>{if(n())return;Array.from(g&&g.activeCues||[]).forEach(A=>{if(!(!A.snapToLines||A.line<-5||A.line>=0&&A.line<10))if(!v||this.paused){let T=A.text.split(`
`).length,N=-3;this.streamType===S.StreamTypes.LIVE&&(N=-2);let te=N-T;if(A.line===te&&!f)return;r.has(A)||r.set(A,A.line),A.line=te}else setTimeout(()=>{A.line=r.get(A)||"auto"},500)})},l=()=>{var g,v;s(a,(v=(g=this.mediaController)==null?void 0:g.hasAttribute(D.USER_INACTIVE))!=null?v:!1)},u=()=>{var f,L;let v=Array.from(((L=(f=this.mediaController)==null?void 0:f.media)==null?void 0:L.textTracks)||[]).filter(A=>["subtitles","captions"].includes(A.kind)&&A.mode==="showing")[0];v!==a&&(a==null||a.removeEventListener("cuechange",l)),a=v,a==null||a.addEventListener("cuechange",l),s(a,R(this,Bt))};u(),(c=this.textTracks)==null||c.addEventListener("change",u),(b=this.textTracks)==null||b.addEventListener("addtrack",u),this.addEventListener("userinactivechange",()=>{var v,f;let g=(f=(v=this.mediaController)==null?void 0:v.hasAttribute(D.USER_INACTIVE))!=null?f:!0;R(this,Bt)!==g&&(Se(this,Bt,g),s(a,R(this,Bt)))})};function Ut(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}Q.customElements.get("mux-player")||(Q.customElements.define("mux-player",fr),Q.MuxPlayerElement=fr);var lf=fr;