"use strict";var Wt=Object.defineProperty;var ui=Object.getOwnPropertyDescriptor;var hi=Object.getOwnPropertyNames;var li=Object.getPrototypeOf,fi=Object.prototype.hasOwnProperty;var mi=Reflect.get;var Re=e=>{throw TypeError(e)};var pi=(e,i,t)=>i in e?Wt(e,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[i]=t;var gi=(e,i)=>{for(var t in i)Wt(e,t,{get:i[t],enumerable:!0})},Ei=(e,i,t,s)=>{if(i&&typeof i=="object"||typeof i=="function")for(let n of hi(i))!fi.call(e,n)&&n!==t&&Wt(e,n,{get:()=>i[n],enumerable:!(s=ui(i,n))||s.enumerable});return e};var Ti=e=>Ei(Wt({},"__esModule",{value:!0}),e);var T=(e,i,t)=>pi(e,typeof i!="symbol"?i+"":i,t),ue=(e,i,t)=>i.has(e)||Re("Cannot "+t);var r=(e,i,t)=>(ue(e,i,"read from private field"),t?t.call(e):i.get(e)),l=(e,i,t)=>i.has(e)?Re("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(e):i.set(e,t),u=(e,i,t,s)=>(ue(e,i,"write to private field"),s?s.call(e,t):i.set(e,t),t),y=(e,i,t)=>(ue(e,i,"access private method"),t);var $t=(e,i,t)=>mi(li(e),t,i);var Di={};gi(Di,{Attributes:()=>o,MediaError:()=>p.MediaError,VideoEvents:()=>Xt,default:()=>Ni,generatePlayerInitTime:()=>p.generatePlayerInitTime,playerSoftwareName:()=>Ae,playerSoftwareVersion:()=>ye});module.exports=Ti(Di);var Et=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class e extends Et{}globalThis.DocumentFragment=e}var Mt=class extends Et{},he=class extends Et{},bi={get(e){},define(e,i,t){},getName(e){return null},upgrade(e){},whenDefined(e){return Promise.resolve(Mt)}},wt,le=class{constructor(i,t={}){l(this,wt);u(this,wt,t==null?void 0:t.detail)}get detail(){return r(this,wt)}initCustomEvent(){}};wt=new WeakMap;function vi(e,i){return new Mt}var Ce={document:{createElement:vi},DocumentFragment,customElements:bi,CustomEvent:le,EventTarget:Et,HTMLElement:Mt,HTMLVideoElement:he},_e=typeof window=="undefined"||typeof globalThis.customElements=="undefined",zt=_e?Ce:globalThis,Fi=_e?Ce.document:globalThis.document;var p=require("@mux/playback-core");var yi=()=>{try{return"0.25.0"}catch{}return"UNKNOWN"},Ai=yi(),Pe=()=>Ai;var Xt=["abort","canplay","canplaythrough","durationchange","emptied","encrypted","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","waitingforkey","resize","enterpictureinpicture","leavepictureinpicture","webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"],Le=["autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"];function ki(e){return`
    <style>
      :host {
        display: inline-flex;
        line-height: 0;
        flex-direction: column;
        justify-content: end;
      }

      audio {
        width: 100%;
      }
    </style>
    <slot name="media">
      <audio${Ve(e)}></audio>
    </slot>
    <slot></slot>
  `}function Si(e){return`
    <style>
      :host {
        display: inline-block;
        line-height: 0;
      }

      video {
        max-width: 100%;
        max-height: 100%;
        min-width: 100%;
        min-height: 100%;
        object-fit: var(--media-object-fit, contain);
        object-position: var(--media-object-position, 50% 50%);
      }

      video::-webkit-media-text-track-container {
        transform: var(--media-webkit-text-track-transform);
        transition: var(--media-webkit-text-track-transition);
      }
    </style>
    <slot name="media">
      <video${Ve(e)}></video>
    </slot>
    <slot></slot>
  `}function De(e,{tag:i,is:t}){var h,m,d,b,x,Me,st,a,g,C,S,at,fe,we,me,xe,Ne;let s=(m=(h=globalThis.document)==null?void 0:h.createElement)==null?void 0:m.call(h,i,{is:t}),n=s?Ri(s):[];return d=class extends e{constructor(){super(...arguments);l(this,S);l(this,st,!1);l(this,a,null);l(this,g,new Map);l(this,C);T(this,"get");T(this,"set");T(this,"call")}static get observedAttributes(){var E,I,R;return y(E=d,x,Me).call(E),[...(R=(I=s==null?void 0:s.constructor)==null?void 0:I.observedAttributes)!=null?R:[],...Le]}get nativeEl(){var f,E,I,R,k;return y(this,S,at).call(this),(k=(R=(E=(f=r(this,a))!=null?f:this.querySelector(":scope > [slot=media]"))!=null?E:this.querySelector(i))!=null?R:(I=this.shadowRoot)==null?void 0:I.querySelector(i))!=null?k:null}set nativeEl(f){u(this,a,f)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(f){this.toggleAttribute("muted",f)}get src(){return this.getAttribute("src")}set src(f){this.setAttribute("src",`${f}`)}get preload(){var f,E;return(E=this.getAttribute("preload"))!=null?E:(f=this.nativeEl)==null?void 0:f.preload}set preload(f){this.setAttribute("preload",`${f}`)}init(){var f;if(!this.shadowRoot){this.attachShadow({mode:"open"});let E=Ci(this.attributes);t&&(E.is=t),i&&(E.part=i),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(E)}this.nativeEl.muted=this.hasAttribute("muted");for(let E of n)y(this,S,xe).call(this,E);u(this,C,new MutationObserver(y(this,S,we).bind(this))),this.shadowRoot.addEventListener("slotchange",this),y(this,S,fe).call(this);for(let E of this.constructor.Events)(f=this.shadowRoot)==null||f.addEventListener(E,this,!0)}handleEvent(f){if(f.type==="slotchange"){y(this,S,fe).call(this);return}f.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(f.type,{detail:f.detail}))}attributeChangedCallback(f,E,I){y(this,S,at).call(this),y(this,S,Ne).call(this,f,E,I)}connectedCallback(){y(this,S,at).call(this)}},b=new WeakMap,x=new WeakSet,Me=function(){if(r(this,b))return;u(this,b,!0);let f=new Set(this.observedAttributes);f.delete("muted");for(let E of n)if(!(E in this.prototype))if(typeof s[E]=="function")this.prototype[E]=function(...I){return y(this,S,at).call(this),(()=>{var O;if(this.call)return this.call(E,...I);let k=(O=this.nativeEl)==null?void 0:O[E];return k==null?void 0:k.apply(this.nativeEl,I)})()};else{let I={get(){var k,O,Lt;y(this,S,at).call(this);let R=E.toLowerCase();if(f.has(R)){let gt=this.getAttribute(R);return gt===null?!1:gt===""?!0:gt}return(Lt=(k=this.get)==null?void 0:k.call(this,E))!=null?Lt:(O=this.nativeEl)==null?void 0:O[E]}};E!==E.toUpperCase()&&(I.set=function(R){y(this,S,at).call(this);let k=E.toLowerCase();if(f.has(k)){R===!0||R===!1||R==null?this.toggleAttribute(k,!!R):this.setAttribute(k,R);return}if(this.set){this.set(E,R);return}this.nativeEl&&(this.nativeEl[E]=R)}),Object.defineProperty(this.prototype,E,I)}},st=new WeakMap,a=new WeakMap,g=new WeakMap,C=new WeakMap,S=new WeakSet,at=function(){r(this,st)||(u(this,st,!0),this.init())},fe=function(){var R;let f=new Map(r(this,g)),E=(R=this.shadowRoot)==null?void 0:R.querySelector("slot:not([name])");(E==null?void 0:E.assignedElements({flatten:!0}).filter(k=>["track","source"].includes(k.localName))).forEach(k=>{var Lt,gt;f.delete(k);let O=r(this,g).get(k);O||(O=k.cloneNode(),r(this,g).set(k,O),(Lt=r(this,C))==null||Lt.observe(k,{attributes:!0})),(gt=this.nativeEl)==null||gt.append(O),y(this,S,me).call(this,O)}),f.forEach((k,O)=>{k.remove(),r(this,g).delete(O)})},we=function(f){var E;for(let I of f)if(I.type==="attributes"){let{target:R,attributeName:k}=I,O=r(this,g).get(R);O&&k&&(O.setAttribute(k,(E=R.getAttribute(k))!=null?E:""),y(this,S,me).call(this,O))}},me=function(f){f&&f.localName==="track"&&f.default&&(f.kind==="chapters"||f.kind==="metadata")&&f.track.mode==="disabled"&&(f.track.mode="hidden")},xe=function(f){if(Object.prototype.hasOwnProperty.call(this,f)){let E=this[f];delete this[f],this[f]=E}},Ne=function(f,E,I){var R,k,O;["id","class"].includes(f)||!d.observedAttributes.includes(f)&&this.constructor.observedAttributes.includes(f)||(I===null?(R=this.nativeEl)==null||R.removeAttribute(f):((k=this.nativeEl)==null?void 0:k.getAttribute(f))!==I&&((O=this.nativeEl)==null||O.setAttribute(f,I)))},l(d,x),T(d,"getTemplateHTML",i.endsWith("audio")?ki:Si),T(d,"shadowRootOptions",{mode:"open"}),T(d,"Events",Xt),l(d,b,!1),d}function Ri(e){let i=[];for(let t=Object.getPrototypeOf(e);t&&t!==HTMLElement.prototype;t=Object.getPrototypeOf(t)){let s=Object.getOwnPropertyNames(t);i.push(...s)}return i}function Ve(e){let i="";for(let t in e){if(!Le.includes(t))continue;let s=e[t];s===""?i+=` ${t}`:i+=` ${t}="${s}"`}return i}function Ci(e){let i={};for(let t of e)i[t.name]=t.value;return i}var Ie,Jt=De((Ie=globalThis.HTMLElement)!=null?Ie:class{},{tag:"video"}),Oe,qi=De((Oe=globalThis.HTMLElement)!=null?Oe:class{},{tag:"audio"});var V=new WeakMap,Tt=class extends Error{},Zt=class extends Error{};var _i=["application/x-mpegURL","application/vnd.apple.mpegurl","audio/mpegurl"],Ge=globalThis.WeakRef?class extends Set{add(e){super.add(new WeakRef(e))}forEach(e){super.forEach(i=>{let t=i.deref();t&&e(t)})}}:Set;function Fe(e){var i,t,s;(t=(i=globalThis.chrome)==null?void 0:i.cast)!=null&&t.isAvailable?(s=globalThis.cast)!=null&&s.framework?e():customElements.whenDefined("google-cast-button").then(e):globalThis.__onGCastApiAvailable=()=>{customElements.whenDefined("google-cast-button").then(e)}}function Be(){return globalThis.chrome}function Ke(){var t;let e="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1";if((t=globalThis.chrome)!=null&&t.cast||document.querySelector(`script[src="${e}"]`))return;let i=document.createElement("script");i.src=e,document.head.append(i)}function q(){var e,i;return(i=(e=globalThis.cast)==null?void 0:e.framework)==null?void 0:i.CastContext.getInstance()}function xt(){var e;return(e=q())==null?void 0:e.getCurrentSession()}function Qt(){var e;return(e=xt())==null?void 0:e.getSessionObj().media[0]}function Ue(e){return new Promise((i,t)=>{Qt().editTracksInfo(e,i,t)})}function qe(e){return new Promise((i,t)=>{Qt().getStatus(e,i,t)})}function pe(e){return q().setOptions({...ge(),...e})}function ge(){return{receiverApplicationId:"CC1AD845",autoJoinPolicy:"origin_scoped",androidReceiverCompatible:!1,language:"en-US",resumeSavedSession:!0}}function Pi(e){if(!e)return;let i=/\.([a-zA-Z0-9]+)(?:\?.*)?$/,t=e.match(i);return t?t[1]:null}function Ii(e){let i=e.split(`
`),t=[];for(let s=0;s<i.length;s++)if(i[s].trim().startsWith("#EXT-X-STREAM-INF")){let h=i[s+1]?i[s+1].trim():"";h&&!h.startsWith("#")&&t.push(h)}return t}function Oi(e){return e.split(`
`).find(s=>!s.trim().startsWith("#")&&s.trim()!=="")}async function Ye(e){try{let t=(await fetch(e,{method:"HEAD"})).headers.get("Content-Type");return _i.some(s=>t===s)}catch(i){return console.error("Error while trying to get the Content-Type of the manifest",i),!1}}async function He(e){try{let i=await(await fetch(e)).text(),t=i,s=Ii(i);if(s.length>0){let m=new URL(s[0],e).toString();t=await(await fetch(m)).text()}let n=Oi(t);return Pi(n)}catch(i){console.error("Error while trying to parse the manifest playlist",i);return}}var te=new Ge,Y=new WeakSet,M;Fe(()=>{var e,i,t,s;if(!((i=(e=globalThis.chrome)==null?void 0:e.cast)!=null&&i.isAvailable)){console.debug("chrome.cast.isAvailable",(s=(t=globalThis.chrome)==null?void 0:t.cast)==null?void 0:s.isAvailable);return}M||(M=cast.framework,q().addEventListener(M.CastContextEventType.CAST_STATE_CHANGED,n=>{te.forEach(h=>{var m,d;return(d=(m=V.get(h)).onCastStateChanged)==null?void 0:d.call(m,n)})}),q().addEventListener(M.CastContextEventType.SESSION_STATE_CHANGED,n=>{te.forEach(h=>{var m,d;return(d=(m=V.get(h)).onSessionStateChanged)==null?void 0:d.call(m,n)})}),te.forEach(n=>{var h,m;return(m=(h=V.get(n)).init)==null?void 0:m.call(h)}))});var je=0,A,Nt,w,G,ct,ut,H,ie,P,dt,We,Ee,$e,Te,ze,be,ee=class extends EventTarget{constructor(t){super();l(this,P);l(this,A);l(this,Nt);l(this,w);l(this,G);l(this,ct,"disconnected");l(this,ut,!1);l(this,H,new Set);l(this,ie,new WeakMap);u(this,A,t),te.add(this),V.set(this,{init:()=>y(this,P,Te).call(this),onCastStateChanged:()=>y(this,P,Ee).call(this),onSessionStateChanged:()=>y(this,P,$e).call(this),getCastPlayer:()=>r(this,P,dt)}),y(this,P,Te).call(this)}get state(){return r(this,ct)}async watchAvailability(t){if(r(this,A).disableRemotePlayback)throw new Tt("disableRemotePlayback attribute is present.");return r(this,ie).set(t,++je),r(this,H).add(t),je}async cancelWatchAvailability(t){if(r(this,A).disableRemotePlayback)throw new Tt("disableRemotePlayback attribute is present.");t?r(this,H).delete(t):r(this,H).clear()}async prompt(){var s,n,h,m;if(r(this,A).disableRemotePlayback)throw new Tt("disableRemotePlayback attribute is present.");if(!((n=(s=globalThis.chrome)==null?void 0:s.cast)!=null&&n.isAvailable))throw new Zt("The RemotePlayback API is disabled on this platform.");let t=Y.has(r(this,A));Y.add(r(this,A)),pe(r(this,A).castOptions),Object.entries(r(this,G)).forEach(([d,b])=>{r(this,w).controller.addEventListener(d,b)});try{await q().requestSession()}catch(d){if(d==="cancel"){t||Y.delete(r(this,A));return}throw new Error(d)}(m=(h=V.get(r(this,A)))==null?void 0:h.loadOnPrompt)==null||m.call(h)}};A=new WeakMap,Nt=new WeakMap,w=new WeakMap,G=new WeakMap,ct=new WeakMap,ut=new WeakMap,H=new WeakMap,ie=new WeakMap,P=new WeakSet,dt=function(){if(Y.has(r(this,A)))return r(this,w)},We=function(){Y.has(r(this,A))&&(Object.entries(r(this,G)).forEach(([t,s])=>{r(this,w).controller.removeEventListener(t,s)}),Y.delete(r(this,A)),r(this,A).muted=r(this,w).isMuted,r(this,A).currentTime=r(this,w).savedPlayerState.currentTime,r(this,w).savedPlayerState.isPaused===!1&&r(this,A).play())},Ee=function(){let t=q().getCastState();if(Y.has(r(this,A))&&t==="CONNECTING"&&(u(this,ct,"connecting"),this.dispatchEvent(new Event("connecting"))),!r(this,ut)&&(t!=null&&t.includes("CONNECT"))){u(this,ut,!0);for(let s of r(this,H))s(!0)}else if(r(this,ut)&&(!t||t==="NO_DEVICES_AVAILABLE")){u(this,ut,!1);for(let s of r(this,H))s(!1)}},$e=async function(){var s;let{SESSION_RESUMED:t}=M.SessionState;if(q().getSessionState()===t&&r(this,A).castSrc===((s=Qt())==null?void 0:s.media.contentId)){Y.add(r(this,A)),Object.entries(r(this,G)).forEach(([n,h])=>{r(this,w).controller.addEventListener(n,h)});try{await qe(new chrome.cast.media.GetStatusRequest)}catch(n){console.error(n)}r(this,G)[M.RemotePlayerEventType.IS_PAUSED_CHANGED](),r(this,G)[M.RemotePlayerEventType.PLAYER_STATE_CHANGED]()}},Te=function(){!M||r(this,Nt)||(u(this,Nt,!0),pe(r(this,A).castOptions),r(this,A).textTracks.addEventListener("change",()=>y(this,P,be).call(this)),y(this,P,Ee).call(this),u(this,w,new M.RemotePlayer),new M.RemotePlayerController(r(this,w)),u(this,G,{[M.RemotePlayerEventType.IS_CONNECTED_CHANGED]:({value:t})=>{t===!0?(u(this,ct,"connected"),this.dispatchEvent(new Event("connect"))):(y(this,P,We).call(this),u(this,ct,"disconnected"),this.dispatchEvent(new Event("disconnect")))},[M.RemotePlayerEventType.DURATION_CHANGED]:()=>{r(this,A).dispatchEvent(new Event("durationchange"))},[M.RemotePlayerEventType.VOLUME_LEVEL_CHANGED]:()=>{r(this,A).dispatchEvent(new Event("volumechange"))},[M.RemotePlayerEventType.IS_MUTED_CHANGED]:()=>{r(this,A).dispatchEvent(new Event("volumechange"))},[M.RemotePlayerEventType.CURRENT_TIME_CHANGED]:()=>{var t;(t=r(this,P,dt))!=null&&t.isMediaLoaded&&r(this,A).dispatchEvent(new Event("timeupdate"))},[M.RemotePlayerEventType.VIDEO_INFO_CHANGED]:()=>{r(this,A).dispatchEvent(new Event("resize"))},[M.RemotePlayerEventType.IS_PAUSED_CHANGED]:()=>{r(this,A).dispatchEvent(new Event(this.paused?"pause":"play"))},[M.RemotePlayerEventType.PLAYER_STATE_CHANGED]:()=>{var t,s;((t=r(this,P,dt))==null?void 0:t.playerState)!==chrome.cast.media.PlayerState.PAUSED&&r(this,A).dispatchEvent(new Event({[chrome.cast.media.PlayerState.PLAYING]:"playing",[chrome.cast.media.PlayerState.BUFFERING]:"waiting",[chrome.cast.media.PlayerState.IDLE]:"emptied"}[(s=r(this,P,dt))==null?void 0:s.playerState]))},[M.RemotePlayerEventType.IS_MEDIA_LOADED_CHANGED]:async()=>{var t;(t=r(this,P,dt))!=null&&t.isMediaLoaded&&(await Promise.resolve(),y(this,P,ze).call(this))}}))},ze=function(){y(this,P,be).call(this)},be=async function(){var a,g,C,S,nt;if(!r(this,P,dt))return;let s=((g=(a=r(this,w).mediaInfo)==null?void 0:a.tracks)!=null?g:[]).filter(({type:_})=>_===chrome.cast.media.TrackType.TEXT),n=[...r(this,A).textTracks].filter(({kind:_})=>_==="subtitles"||_==="captions"),h=s.map(({language:_,name:ot,trackId:L})=>{var D;let{mode:U}=(D=n.find(Se=>Se.language===_&&Se.label===ot))!=null?D:{};return U?{mode:U,trackId:L}:!1}).filter(Boolean),d=h.filter(({mode:_})=>_!=="showing").map(({trackId:_})=>_),b=h.find(({mode:_})=>_==="showing"),x=(nt=(S=(C=xt())==null?void 0:C.getSessionObj().media[0])==null?void 0:S.activeTrackIds)!=null?nt:[],K=x;if(x.length&&(K=K.filter(_=>!d.includes(_))),b!=null&&b.trackId&&(K=[...K,b.trackId]),K=[...new Set(K)],!((_,ot)=>_.length===ot.length&&_.every(L=>ot.includes(L)))(x,K))try{let _=new chrome.cast.media.EditTracksInfoRequest(K);await Ue(_)}catch(_){console.error(_)}};var Xe=e=>{var i,t,s,n,h,m,d,v,Je;return t=class extends e{constructor(){super(...arguments);l(this,d);l(this,s,{paused:!1});l(this,n,ge());l(this,h);l(this,m)}get remote(){return r(this,m)?r(this,m):Be()?(this.disableRemotePlayback||Ke(),V.set(this,{loadOnPrompt:()=>y(this,d,Je).call(this)}),u(this,m,new ee(this))):super.remote}attributeChangedCallback(a,g,C){if(super.attributeChangedCallback(a,g,C),a==="cast-receiver"&&C){r(this,n).receiverApplicationId=C;return}if(r(this,d,v))switch(a){case"cast-stream-type":case"cast-src":this.load();break}}async load(){var _,ot;if(!r(this,d,v))return super.load();let a=new chrome.cast.media.MediaInfo(this.castSrc,this.castContentType);a.customData=this.castCustomData;let g=[...this.querySelectorAll("track")].filter(({kind:L,src:U})=>U&&(L==="subtitles"||L==="captions")),C=[],S=0;if(g.length&&(a.tracks=g.map(L=>{let U=++S;C.length===0&&L.track.mode==="showing"&&C.push(U);let D=new chrome.cast.media.Track(U,chrome.cast.media.TrackType.TEXT);return D.trackContentId=L.src,D.trackContentType="text/vtt",D.subtype=L.kind==="captions"?chrome.cast.media.TextTrackType.CAPTIONS:chrome.cast.media.TextTrackType.SUBTITLES,D.name=L.label,D.language=L.srclang,D})),this.castStreamType==="live"?a.streamType=chrome.cast.media.StreamType.LIVE:a.streamType=chrome.cast.media.StreamType.BUFFERED,a.metadata=new chrome.cast.media.GenericMediaMetadata,a.metadata.title=this.title,a.metadata.images=[{url:this.poster}],Ye(this.castSrc)){let L=await He(this.castSrc);((L==null?void 0:L.includes("m4s"))||(L==null?void 0:L.includes("mp4")))&&(a.hlsSegmentFormat=chrome.cast.media.HlsSegmentFormat.FMP4,a.hlsVideoSegmentFormat=chrome.cast.media.HlsVideoSegmentFormat.FMP4)}let nt=new chrome.cast.media.LoadRequest(a);nt.currentTime=(_=super.currentTime)!=null?_:0,nt.autoplay=!r(this,s).paused,nt.activeTrackIds=C,await((ot=xt())==null?void 0:ot.loadMedia(nt)),this.dispatchEvent(new Event("volumechange"))}play(){var a;if(r(this,d,v)){r(this,d,v).isPaused&&((a=r(this,d,v).controller)==null||a.playOrPause());return}return super.play()}pause(){var a;if(r(this,d,v)){r(this,d,v).isPaused||(a=r(this,d,v).controller)==null||a.playOrPause();return}super.pause()}get castOptions(){return r(this,n)}get castReceiver(){var a;return(a=this.getAttribute("cast-receiver"))!=null?a:void 0}set castReceiver(a){this.castReceiver!=a&&this.setAttribute("cast-receiver",`${a}`)}get castSrc(){var a,g,C;return(C=(g=this.getAttribute("cast-src"))!=null?g:(a=this.querySelector("source"))==null?void 0:a.src)!=null?C:this.currentSrc}set castSrc(a){this.castSrc!=a&&this.setAttribute("cast-src",`${a}`)}get castContentType(){var a;return(a=this.getAttribute("cast-content-type"))!=null?a:void 0}set castContentType(a){this.setAttribute("cast-content-type",`${a}`)}get castStreamType(){var a,g;return(g=(a=this.getAttribute("cast-stream-type"))!=null?a:this.streamType)!=null?g:void 0}set castStreamType(a){this.setAttribute("cast-stream-type",`${a}`)}get castCustomData(){return r(this,h)}set castCustomData(a){let g=typeof a;if(!["object","undefined"].includes(g)){console.error(`castCustomData must be nullish or an object but value was of type ${g}`);return}u(this,h,a)}get readyState(){if(r(this,d,v))switch(r(this,d,v).playerState){case chrome.cast.media.PlayerState.IDLE:return 0;case chrome.cast.media.PlayerState.BUFFERING:return 2;default:return 3}return super.readyState}get paused(){return r(this,d,v)?r(this,d,v).isPaused:super.paused}get muted(){var a;return r(this,d,v)?(a=r(this,d,v))==null?void 0:a.isMuted:super.muted}set muted(a){var g;if(r(this,d,v)){(a&&!r(this,d,v).isMuted||!a&&r(this,d,v).isMuted)&&((g=r(this,d,v).controller)==null||g.muteOrUnmute());return}super.muted=a}get volume(){var a,g;return r(this,d,v)?(g=(a=r(this,d,v))==null?void 0:a.volumeLevel)!=null?g:1:super.volume}set volume(a){var g;if(r(this,d,v)){r(this,d,v).volumeLevel=+a,(g=r(this,d,v).controller)==null||g.setVolumeLevel();return}super.volume=a}get duration(){var a,g,C;return r(this,d,v)&&((a=r(this,d,v))!=null&&a.isMediaLoaded)?(C=(g=r(this,d,v))==null?void 0:g.duration)!=null?C:NaN:super.duration}get currentTime(){var a,g,C;return r(this,d,v)&&((a=r(this,d,v))!=null&&a.isMediaLoaded)?(C=(g=r(this,d,v))==null?void 0:g.currentTime)!=null?C:0:super.currentTime}set currentTime(a){var g;if(r(this,d,v)){r(this,d,v).currentTime=a,(g=r(this,d,v).controller)==null||g.seek();return}super.currentTime=a}},s=new WeakMap,n=new WeakMap,h=new WeakMap,m=new WeakMap,d=new WeakSet,v=function(){var a,g;return(g=(a=V.get(this.remote))==null?void 0:a.getCastPlayer)==null?void 0:g.call(a)},Je=async function(){r(this,s).paused=$t(t.prototype,this,"paused"),$t(t.prototype,this,"pause").call(this),this.muted=$t(t.prototype,this,"muted");try{await this.load()}catch(a){console.error(a)}},T(t,"observedAttributes",[...(i=e.observedAttributes)!=null?i:[],"cast-src","cast-content-type","cast-stream-type","cast-receiver"]),t};var F=class extends Event{constructor(t,s){super(t);T(this,"track");this.track=s.track}};var ve=new WeakMap;function c(e){var i;return(i=ve.get(e))!=null?i:Li(e,{})}function Li(e,i){let t=ve.get(e);return t||ve.set(e,t={}),Object.assign(t,i)}function re(e,i){let t=e.videoTracks;c(i).media=e,c(i).renditionSet||(c(i).renditionSet=new Set);let s=c(t).trackSet;s.add(i);let n=s.size-1;n in lt.prototype||Object.defineProperty(lt.prototype,n,{get(){return[...c(this).trackSet][n]}}),queueMicrotask(()=>{t.dispatchEvent(new F("addtrack",{track:i}))})}function se(e){var s;let i=(s=c(e).media)==null?void 0:s.videoTracks;if(!i)return;c(i).trackSet.delete(e),queueMicrotask(()=>{i.dispatchEvent(new F("removetrack",{track:e}))})}function Ze(e){var s;let i=(s=c(e).media.videoTracks)!=null?s:[],t=!1;for(let n of i)n!==e&&(n.selected=!1,t=!0);if(t){if(c(i).changeRequested)return;c(i).changeRequested=!0,queueMicrotask(()=>{delete c(i).changeRequested,i.dispatchEvent(new Event("change"))})}}var j,W,$,ht,Dt,lt=class extends EventTarget{constructor(){super();l(this,ht);l(this,j);l(this,W);l(this,$);c(this).trackSet=new Set}[Symbol.iterator](){return r(this,ht,Dt).values()}get length(){return r(this,ht,Dt).size}getTrackById(t){var s;return(s=[...r(this,ht,Dt)].find(n=>n.id===t))!=null?s:null}get selectedIndex(){return[...r(this,ht,Dt)].findIndex(t=>t.selected)}get onaddtrack(){return r(this,j)}set onaddtrack(t){r(this,j)&&(this.removeEventListener("addtrack",r(this,j)),u(this,j,void 0)),typeof t=="function"&&(u(this,j,t),this.addEventListener("addtrack",t))}get onremovetrack(){return r(this,W)}set onremovetrack(t){r(this,W)&&(this.removeEventListener("removetrack",r(this,W)),u(this,W,void 0)),typeof t=="function"&&(u(this,W,t),this.addEventListener("removetrack",t))}get onchange(){return r(this,$)}set onchange(t){r(this,$)&&(this.removeEventListener("change",r(this,$)),u(this,$,void 0)),typeof t=="function"&&(u(this,$,t),this.addEventListener("change",t))}};j=new WeakMap,W=new WeakMap,$=new WeakMap,ht=new WeakSet,Dt=function(){return c(this).trackSet};var B=class extends Event{constructor(t,s){super(t);T(this,"rendition");this.rendition=s.rendition}};function Qe(e,i){let t=c(e).media.videoRenditions;c(i).media=c(e).media,c(i).track=e;let s=c(e).renditionSet;s.add(i);let n=s.size-1;n in ft.prototype||Object.defineProperty(ft.prototype,n,{get(){return bt(this)[n]}}),queueMicrotask(()=>{e.selected&&t.dispatchEvent(new B("addrendition",{rendition:i}))})}function ti(e){let i=c(e).media.videoRenditions,t=c(e).track;c(t).renditionSet.delete(e),queueMicrotask(()=>{c(e).track.selected&&i.dispatchEvent(new B("removerendition",{rendition:e}))})}function ei(e){let i=c(e).media.videoRenditions;!i||c(i).changeRequested||(c(i).changeRequested=!0,queueMicrotask(()=>{delete c(i).changeRequested,c(e).track.selected&&i.dispatchEvent(new Event("change"))}))}function bt(e){return[...c(e).media.videoTracks].filter(t=>t.selected).flatMap(t=>[...c(t).renditionSet])}var z,X,J,ft=class extends EventTarget{constructor(){super(...arguments);l(this,z);l(this,X);l(this,J)}[Symbol.iterator](){return bt(this).values()}get length(){return bt(this).length}getRenditionById(t){var s;return(s=bt(this).find(n=>`${n.id}`==`${t}`))!=null?s:null}get selectedIndex(){return bt(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[s,n]of bt(this).entries())n.selected=s===t}get onaddrendition(){return r(this,z)}set onaddrendition(t){r(this,z)&&(this.removeEventListener("addrendition",r(this,z)),u(this,z,void 0)),typeof t=="function"&&(u(this,z,t),this.addEventListener("addrendition",t))}get onremoverendition(){return r(this,X)}set onremoverendition(t){r(this,X)&&(this.removeEventListener("removerendition",r(this,X)),u(this,X,void 0)),typeof t=="function"&&(u(this,X,t),this.addEventListener("removerendition",t))}get onchange(){return r(this,J)}set onchange(t){r(this,J)&&(this.removeEventListener("change",r(this,J)),u(this,J,void 0)),typeof t=="function"&&(u(this,J,t),this.addEventListener("change",t))}};z=new WeakMap,X=new WeakMap,J=new WeakMap;var vt,Vt=class{constructor(){T(this,"src");T(this,"id");T(this,"width");T(this,"height");T(this,"bitrate");T(this,"frameRate");T(this,"codec");l(this,vt,!1)}get selected(){return r(this,vt)}set selected(i){r(this,vt)!==i&&(u(this,vt,i),ei(this))}};vt=new WeakMap;var yt,At=class{constructor(){T(this,"id");T(this,"kind");T(this,"label","");T(this,"language","");T(this,"sourceBuffer");l(this,yt,!1)}addRendition(i,t,s,n,h,m){let d=new Vt;return d.src=i,d.width=t,d.height=s,d.frameRate=m,d.bitrate=h,d.codec=n,Qe(this,d),d}removeRendition(i){ti(i)}get selected(){return r(this,yt)}set selected(i){r(this,yt)!==i&&(u(this,yt,i),i===!0&&Ze(this))}};yt=new WeakMap;function ii(e,i){let t=c(e).media.audioRenditions;c(i).media=c(e).media,c(i).track=e;let s=c(e).renditionSet;s.add(i);let n=s.size-1;n in mt.prototype||Object.defineProperty(mt.prototype,n,{get(){return kt(this)[n]}}),queueMicrotask(()=>{e.enabled&&t.dispatchEvent(new B("addrendition",{rendition:i}))})}function ri(e){let i=c(e).media.audioRenditions,t=c(e).track;c(t).renditionSet.delete(e),queueMicrotask(()=>{c(e).track.enabled&&i.dispatchEvent(new B("removerendition",{rendition:e}))})}function si(e){let i=c(e).media.audioRenditions;!i||c(i).changeRequested||(c(i).changeRequested=!0,queueMicrotask(()=>{delete c(i).changeRequested,c(e).track.enabled&&i.dispatchEvent(new Event("change"))}))}function kt(e){return[...c(e).media.audioTracks].filter(t=>t.enabled).flatMap(t=>[...c(t).renditionSet])}var Z,Q,tt,mt=class extends EventTarget{constructor(){super(...arguments);l(this,Z);l(this,Q);l(this,tt)}[Symbol.iterator](){return kt(this).values()}get length(){return kt(this).length}getRenditionById(t){var s;return(s=kt(this).find(n=>`${n.id}`==`${t}`))!=null?s:null}get selectedIndex(){return kt(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[s,n]of kt(this).entries())n.selected=s===t}get onaddrendition(){return r(this,Z)}set onaddrendition(t){r(this,Z)&&(this.removeEventListener("addrendition",r(this,Z)),u(this,Z,void 0)),typeof t=="function"&&(u(this,Z,t),this.addEventListener("addrendition",t))}get onremoverendition(){return r(this,Q)}set onremoverendition(t){r(this,Q)&&(this.removeEventListener("removerendition",r(this,Q)),u(this,Q,void 0)),typeof t=="function"&&(u(this,Q,t),this.addEventListener("removerendition",t))}get onchange(){return r(this,tt)}set onchange(t){r(this,tt)&&(this.removeEventListener("change",r(this,tt)),u(this,tt,void 0)),typeof t=="function"&&(u(this,tt,t),this.addEventListener("change",t))}};Z=new WeakMap,Q=new WeakMap,tt=new WeakMap;var St,Gt=class{constructor(){T(this,"src");T(this,"id");T(this,"bitrate");T(this,"codec");l(this,St,!1)}get selected(){return r(this,St)}set selected(i){r(this,St)!==i&&(u(this,St,i),si(this))}};St=new WeakMap;function oe(e,i){let t=e.audioTracks;c(i).media=e,c(i).renditionSet||(c(i).renditionSet=new Set);let s=c(t).trackSet;s.add(i);let n=s.size-1;n in pt.prototype||Object.defineProperty(pt.prototype,n,{get(){return[...c(this).trackSet][n]}}),queueMicrotask(()=>{t.dispatchEvent(new F("addtrack",{track:i}))})}function ae(e){var s;let i=(s=c(e).media)==null?void 0:s.audioTracks;if(!i)return;c(i).trackSet.delete(e),queueMicrotask(()=>{i.dispatchEvent(new F("removetrack",{track:e}))})}function ni(e){let i=c(e).media.audioTracks;!i||c(i).changeRequested||(c(i).changeRequested=!0,queueMicrotask(()=>{delete c(i).changeRequested,i.dispatchEvent(new Event("change"))}))}var et,it,rt,Rt,ne,pt=class extends EventTarget{constructor(){super();l(this,Rt);l(this,et);l(this,it);l(this,rt);c(this).trackSet=new Set}[Symbol.iterator](){return r(this,Rt,ne).values()}get length(){return r(this,Rt,ne).size}getTrackById(t){var s;return(s=[...r(this,Rt,ne)].find(n=>n.id===t))!=null?s:null}get onaddtrack(){return r(this,et)}set onaddtrack(t){r(this,et)&&(this.removeEventListener("addtrack",r(this,et)),u(this,et,void 0)),typeof t=="function"&&(u(this,et,t),this.addEventListener("addtrack",t))}get onremovetrack(){return r(this,it)}set onremovetrack(t){r(this,it)&&(this.removeEventListener("removetrack",r(this,it)),u(this,it,void 0)),typeof t=="function"&&(u(this,it,t),this.addEventListener("removetrack",t))}get onchange(){return r(this,rt)}set onchange(t){r(this,rt)&&(this.removeEventListener("change",r(this,rt)),u(this,rt,void 0)),typeof t=="function"&&(u(this,rt,t),this.addEventListener("change",t))}};et=new WeakMap,it=new WeakMap,rt=new WeakMap,Rt=new WeakSet,ne=function(){return c(this).trackSet};var Ct,_t=class{constructor(){T(this,"id");T(this,"kind");T(this,"label","");T(this,"language","");T(this,"sourceBuffer");l(this,Ct,!1)}addRendition(i,t,s){let n=new Gt;return n.src=i,n.codec=t,n.bitrate=s,ii(this,n),n}removeRendition(i){ri(i)}get enabled(){return r(this,Ct)}set enabled(i){r(this,Ct)!==i&&(u(this,Ct,i),ni(this))}};Ct=new WeakMap;var oi=de(globalThis.HTMLMediaElement,"video"),ai=de(globalThis.HTMLMediaElement,"audio");function di(e){if(!(e!=null&&e.prototype))return e;let i=de(e,"video");(!i||`${i}`.includes("[native code]"))&&Object.defineProperty(e.prototype,"videoTracks",{get(){return Mi(this)}});let t=de(e,"audio");(!t||`${t}`.includes("[native code]"))&&Object.defineProperty(e.prototype,"audioTracks",{get(){return wi(this)}}),"addVideoTrack"in e.prototype||(e.prototype.addVideoTrack=function(h,m="",d=""){let b=new At;return b.kind=h,b.label=m,b.language=d,re(this,b),b}),"removeVideoTrack"in e.prototype||(e.prototype.removeVideoTrack=se),"addAudioTrack"in e.prototype||(e.prototype.addAudioTrack=function(h,m="",d=""){let b=new _t;return b.kind=h,b.label=m,b.language=d,oe(this,b),b}),"removeAudioTrack"in e.prototype||(e.prototype.removeAudioTrack=ae),"videoRenditions"in e.prototype||Object.defineProperty(e.prototype,"videoRenditions",{get(){return s(this)}});let s=h=>{let m=c(h).videoRenditions;return m||(m=new ft,c(m).media=h,c(h).videoRenditions=m),m};"audioRenditions"in e.prototype||Object.defineProperty(e.prototype,"audioRenditions",{get(){return n(this)}});let n=h=>{let m=c(h).audioRenditions;return m||(m=new mt,c(m).media=h,c(h).audioRenditions=m),m};return e}function de(e,i){var t;if(e!=null&&e.prototype)return(t=Object.getOwnPropertyDescriptor(e.prototype,`${i}Tracks`))==null?void 0:t.get}function Mi(e){var t;let i=c(e).videoTracks;if(!i&&(i=new lt,c(e).videoTracks=i,oi)){let s=oi.call((t=e.nativeEl)!=null?t:e);for(let n of s)re(e,n);s.addEventListener("change",()=>{i.dispatchEvent(new Event("change"))}),s.addEventListener("addtrack",n=>{if([...i].some(h=>h instanceof At)){for(let h of s)se(h);return}re(e,n.track)}),s.addEventListener("removetrack",n=>{se(n.track)})}return i}function wi(e){var t;let i=c(e).audioTracks;if(!i&&(i=new pt,c(e).audioTracks=i,ai)){let s=ai.call((t=e.nativeEl)!=null?t:e);for(let n of s)oe(e,n);s.addEventListener("change",()=>{i.dispatchEvent(new Event("change"))}),s.addEventListener("addtrack",n=>{if([...i].some(h=>h instanceof _t)){for(let h of s)ae(h);return}oe(e,n.track)}),s.addEventListener("removetrack",n=>{ae(n.track)})}return i}var ci=`
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" class="logo" part="logo" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2" viewBox="0 0 1600 500"><g fill="#fff"><path d="M994.287 93.486c-17.121 0-31-13.879-31-31 0-17.121 13.879-31 31-31 17.121 0 31 13.879 31 31 0 17.121-13.879 31-31 31m0-93.486c-34.509 0-62.484 27.976-62.484 62.486v187.511c0 68.943-56.09 125.033-125.032 125.033s-125.03-56.09-125.03-125.033V62.486C681.741 27.976 653.765 0 619.256 0s-62.484 27.976-62.484 62.486v187.511C556.772 387.85 668.921 500 806.771 500c137.851 0 250.001-112.15 250.001-250.003V62.486c0-34.51-27.976-62.486-62.485-62.486M1537.51 468.511c-17.121 0-31-13.879-31-31 0-17.121 13.879-31 31-31 17.121 0 31 13.879 31 31 0 17.121-13.879 31-31 31m-275.883-218.509-143.33 143.329c-24.402 24.402-24.402 63.966 0 88.368 24.402 24.402 63.967 24.402 88.369 0l143.33-143.329 143.328 143.329c24.402 24.4 63.967 24.402 88.369 0 24.403-24.402 24.403-63.966.001-88.368l-143.33-143.329.001-.004 143.329-143.329c24.402-24.402 24.402-63.965 0-88.367s-63.967-24.402-88.369 0L1349.996 161.63 1206.667 18.302c-24.402-24.401-63.967-24.402-88.369 0s-24.402 63.965 0 88.367l143.329 143.329v.004ZM437.511 468.521c-17.121 0-31-13.879-31-31 0-17.121 13.879-31 31-31 17.121 0 31 13.879 31 31 0 17.121-13.879 31-31 31M461.426 4.759C438.078-4.913 411.2.432 393.33 18.303L249.999 161.632 106.669 18.303C88.798.432 61.922-4.913 38.573 4.759 15.224 14.43-.001 37.214-.001 62.488v375.026c0 34.51 27.977 62.486 62.487 62.486 34.51 0 62.486-27.976 62.486-62.486V213.341l80.843 80.844c24.404 24.402 63.965 24.402 88.369 0l80.843-80.844v224.173c0 34.51 27.976 62.486 62.486 62.486s62.486-27.976 62.486-62.486V62.488c0-25.274-15.224-48.058-38.573-57.729" style="fill-rule:nonzero"/></g></svg>`;Xt.push("castchange","entercast","leavecast");var o={BEACON_COLLECTION_DOMAIN:"beacon-collection-domain",CUSTOM_DOMAIN:"custom-domain",DEBUG:"debug",DISABLE_TRACKING:"disable-tracking",DISABLE_COOKIES:"disable-cookies",DRM_TOKEN:"drm-token",PLAYBACK_TOKEN:"playback-token",ENV_KEY:"env-key",MAX_RESOLUTION:"max-resolution",MIN_RESOLUTION:"min-resolution",RENDITION_ORDER:"rendition-order",PROGRAM_START_TIME:"program-start-time",PROGRAM_END_TIME:"program-end-time",ASSET_START_TIME:"asset-start-time",ASSET_END_TIME:"asset-end-time",METADATA_URL:"metadata-url",PLAYBACK_ID:"playback-id",PLAYER_SOFTWARE_NAME:"player-software-name",PLAYER_SOFTWARE_VERSION:"player-software-version",PLAYER_INIT_TIME:"player-init-time",PREFER_CMCD:"prefer-cmcd",PREFER_PLAYBACK:"prefer-playback",START_TIME:"start-time",STREAM_TYPE:"stream-type",TARGET_LIVE_WINDOW:"target-live-window",LIVE_EDGE_OFFSET:"live-edge-offset",TYPE:"type",LOGO:"logo"},xi=Object.values(o),ye=Pe(),Ae="mux-video",N,Pt,Bt,It,Kt,Ut,qt,Yt,Ht,Ot,ce,ke=class extends Jt{constructor(){super();l(this,Ot);l(this,N);l(this,Pt);l(this,Bt);l(this,It,{});l(this,Kt,{});l(this,Ut);l(this,qt);l(this,Yt);l(this,Ht);u(this,Bt,(0,p.generatePlayerInitTime)())}static get NAME(){return Ae}static get VERSION(){return ye}static get observedAttributes(){var t;return[...xi,...(t=Jt.observedAttributes)!=null?t:[]]}static getTemplateHTML(t={}){let s=super.getTemplateHTML(t),n=t.logo!=="false"&&t.logo!==void 0,h=t.logo&&t.logo!=="",m=t.logo,d=n?`
      <style>
        :host {
          position: relative;
        }
        :host slot[name="logo"] {
          display: flex;
          justify-content: end;
          position: absolute;
          top: 1rem;
          right: 1rem;

        }
         :host slot[name="logo"] .logo{
          width: 5rem;
          pointer-events: none;
          user-select: none;
         }
      </style>
      <slot name="logo">
        ${h?`<img class="logo" part="logo" src="${m}" />`:ci}
      </slot>
    `:"";return`
      ${s}
      ${d}
    `}get preferCmcd(){var t;return(t=this.getAttribute(o.PREFER_CMCD))!=null?t:void 0}set preferCmcd(t){t!==this.preferCmcd&&(t?p.CmcdTypeValues.includes(t)?this.setAttribute(o.PREFER_CMCD,t):console.warn(`Invalid value for preferCmcd. Must be one of ${p.CmcdTypeValues.join()}`):this.removeAttribute(o.PREFER_CMCD))}get playerInitTime(){return this.hasAttribute(o.PLAYER_INIT_TIME)?+this.getAttribute(o.PLAYER_INIT_TIME):r(this,Bt)}set playerInitTime(t){t!=this.playerInitTime&&(t==null?this.removeAttribute(o.PLAYER_INIT_TIME):this.setAttribute(o.PLAYER_INIT_TIME,`${+t}`))}get playerSoftwareName(){var t;return(t=r(this,Yt))!=null?t:Ae}set playerSoftwareName(t){u(this,Yt,t)}get playerSoftwareVersion(){var t;return(t=r(this,qt))!=null?t:ye}set playerSoftwareVersion(t){u(this,qt,t)}get _hls(){var t;return(t=r(this,N))==null?void 0:t.engine}get mux(){var t;return(t=this.nativeEl)==null?void 0:t.mux}get error(){var t;return(t=(0,p.getError)(this.nativeEl))!=null?t:null}get errorTranslator(){return r(this,Ht)}set errorTranslator(t){u(this,Ht,t)}get src(){return this.getAttribute("src")}set src(t){t!==this.src&&(t==null?this.removeAttribute("src"):this.setAttribute("src",t))}get type(){var t;return(t=this.getAttribute(o.TYPE))!=null?t:void 0}set type(t){t!==this.type&&(t?this.setAttribute(o.TYPE,t):this.removeAttribute(o.TYPE))}get autoplay(){let t=this.getAttribute("autoplay");return t===null?!1:t===""?!0:t}set autoplay(t){let s=this.autoplay;t!==s&&(t?this.setAttribute("autoplay",typeof t=="string"?t:""):this.removeAttribute("autoplay"))}get preload(){let t=this.getAttribute("preload");return t===""?"auto":["none","metadata","auto"].includes(t)?t:super.preload}set preload(t){t!=this.getAttribute("preload")&&(["","none","metadata","auto"].includes(t)?this.setAttribute("preload",t):this.removeAttribute("preload"))}get debug(){return this.getAttribute(o.DEBUG)!=null}set debug(t){t!==this.debug&&(t?this.setAttribute(o.DEBUG,""):this.removeAttribute(o.DEBUG))}get disableTracking(){return this.hasAttribute(o.DISABLE_TRACKING)}set disableTracking(t){t!==this.disableTracking&&this.toggleAttribute(o.DISABLE_TRACKING,!!t)}get disableCookies(){return this.hasAttribute(o.DISABLE_COOKIES)}set disableCookies(t){t!==this.disableCookies&&(t?this.setAttribute(o.DISABLE_COOKIES,""):this.removeAttribute(o.DISABLE_COOKIES))}get startTime(){let t=this.getAttribute(o.START_TIME);if(t==null)return;let s=+t;return Number.isNaN(s)?void 0:s}set startTime(t){t!==this.startTime&&(t==null?this.removeAttribute(o.START_TIME):this.setAttribute(o.START_TIME,`${t}`))}get playbackId(){var t;return this.hasAttribute(o.PLAYBACK_ID)?this.getAttribute(o.PLAYBACK_ID):(t=(0,p.toPlaybackIdFromSrc)(this.src))!=null?t:void 0}set playbackId(t){t!==this.playbackId&&(t?this.setAttribute(o.PLAYBACK_ID,t):this.removeAttribute(o.PLAYBACK_ID))}get maxResolution(){var t;return(t=this.getAttribute(o.MAX_RESOLUTION))!=null?t:void 0}set maxResolution(t){t!==this.maxResolution&&(t?this.setAttribute(o.MAX_RESOLUTION,t):this.removeAttribute(o.MAX_RESOLUTION))}get minResolution(){var t;return(t=this.getAttribute(o.MIN_RESOLUTION))!=null?t:void 0}set minResolution(t){t!==this.minResolution&&(t?this.setAttribute(o.MIN_RESOLUTION,t):this.removeAttribute(o.MIN_RESOLUTION))}get renditionOrder(){var t;return(t=this.getAttribute(o.RENDITION_ORDER))!=null?t:void 0}set renditionOrder(t){t!==this.renditionOrder&&(t?this.setAttribute(o.RENDITION_ORDER,t):this.removeAttribute(o.RENDITION_ORDER))}get programStartTime(){let t=this.getAttribute(o.PROGRAM_START_TIME);if(t==null)return;let s=+t;return Number.isNaN(s)?void 0:s}set programStartTime(t){t==null?this.removeAttribute(o.PROGRAM_START_TIME):this.setAttribute(o.PROGRAM_START_TIME,`${t}`)}get programEndTime(){let t=this.getAttribute(o.PROGRAM_END_TIME);if(t==null)return;let s=+t;return Number.isNaN(s)?void 0:s}set programEndTime(t){t==null?this.removeAttribute(o.PROGRAM_END_TIME):this.setAttribute(o.PROGRAM_END_TIME,`${t}`)}get assetStartTime(){let t=this.getAttribute(o.ASSET_START_TIME);if(t==null)return;let s=+t;return Number.isNaN(s)?void 0:s}set assetStartTime(t){t==null?this.removeAttribute(o.ASSET_START_TIME):this.setAttribute(o.ASSET_START_TIME,`${t}`)}get assetEndTime(){let t=this.getAttribute(o.ASSET_END_TIME);if(t==null)return;let s=+t;return Number.isNaN(s)?void 0:s}set assetEndTime(t){t==null?this.removeAttribute(o.ASSET_END_TIME):this.setAttribute(o.ASSET_END_TIME,`${t}`)}get customDomain(){var t;return(t=this.getAttribute(o.CUSTOM_DOMAIN))!=null?t:void 0}set customDomain(t){t!==this.customDomain&&(t?this.setAttribute(o.CUSTOM_DOMAIN,t):this.removeAttribute(o.CUSTOM_DOMAIN))}get drmToken(){var t;return(t=this.getAttribute(o.DRM_TOKEN))!=null?t:void 0}set drmToken(t){t!==this.drmToken&&(t?this.setAttribute(o.DRM_TOKEN,t):this.removeAttribute(o.DRM_TOKEN))}get playbackToken(){var t,s,n,h;if(this.hasAttribute(o.PLAYBACK_TOKEN))return(t=this.getAttribute(o.PLAYBACK_TOKEN))!=null?t:void 0;if(this.hasAttribute(o.PLAYBACK_ID)){let[,m]=(0,p.toPlaybackIdParts)((s=this.playbackId)!=null?s:"");return(n=new URLSearchParams(m).get("token"))!=null?n:void 0}if(this.src)return(h=new URLSearchParams(this.src).get("token"))!=null?h:void 0}set playbackToken(t){t!==this.playbackToken&&(t?this.setAttribute(o.PLAYBACK_TOKEN,t):this.removeAttribute(o.PLAYBACK_TOKEN))}get tokens(){let t=this.getAttribute(o.PLAYBACK_TOKEN),s=this.getAttribute(o.DRM_TOKEN);return{...r(this,Kt),...t!=null?{playback:t}:{},...s!=null?{drm:s}:{}}}set tokens(t){u(this,Kt,t!=null?t:{})}get ended(){return(0,p.getEnded)(this.nativeEl,this._hls)}get envKey(){var t;return(t=this.getAttribute(o.ENV_KEY))!=null?t:void 0}set envKey(t){t!==this.envKey&&(t?this.setAttribute(o.ENV_KEY,t):this.removeAttribute(o.ENV_KEY))}get beaconCollectionDomain(){var t;return(t=this.getAttribute(o.BEACON_COLLECTION_DOMAIN))!=null?t:void 0}set beaconCollectionDomain(t){t!==this.beaconCollectionDomain&&(t?this.setAttribute(o.BEACON_COLLECTION_DOMAIN,t):this.removeAttribute(o.BEACON_COLLECTION_DOMAIN))}get streamType(){var t;return(t=this.getAttribute(o.STREAM_TYPE))!=null?t:(0,p.getStreamType)(this.nativeEl)}set streamType(t){t!==this.streamType&&(t?this.setAttribute(o.STREAM_TYPE,t):this.removeAttribute(o.STREAM_TYPE))}get targetLiveWindow(){return this.hasAttribute(o.TARGET_LIVE_WINDOW)?+this.getAttribute(o.TARGET_LIVE_WINDOW):(0,p.getTargetLiveWindow)(this.nativeEl)}set targetLiveWindow(t){t!=this.targetLiveWindow&&(t==null?this.removeAttribute(o.TARGET_LIVE_WINDOW):this.setAttribute(o.TARGET_LIVE_WINDOW,`${+t}`))}get liveEdgeStart(){var t,s;if(this.hasAttribute(o.LIVE_EDGE_OFFSET)){let{liveEdgeOffset:n}=this,h=(t=this.nativeEl.seekable.end(0))!=null?t:0,m=(s=this.nativeEl.seekable.start(0))!=null?s:0;return Math.max(m,h-n)}return(0,p.getLiveEdgeStart)(this.nativeEl)}get liveEdgeOffset(){if(this.hasAttribute(o.LIVE_EDGE_OFFSET))return+this.getAttribute(o.LIVE_EDGE_OFFSET)}set liveEdgeOffset(t){t!=this.liveEdgeOffset&&(t==null?this.removeAttribute(o.LIVE_EDGE_OFFSET):this.setAttribute(o.LIVE_EDGE_OFFSET,`${+t}`))}get seekable(){return(0,p.getSeekable)(this.nativeEl)}async addCuePoints(t){return(0,p.addCuePoints)(this.nativeEl,t)}get activeCuePoint(){return(0,p.getActiveCuePoint)(this.nativeEl)}get cuePoints(){return(0,p.getCuePoints)(this.nativeEl)}async addChapters(t){return(0,p.addChapters)(this.nativeEl,t)}get activeChapter(){return(0,p.getActiveChapter)(this.nativeEl)}get chapters(){return(0,p.getChapters)(this.nativeEl)}getStartDate(){return(0,p.getStartDate)(this.nativeEl,this._hls)}get currentPdt(){return(0,p.getCurrentPdt)(this.nativeEl,this._hls)}get preferPlayback(){let t=this.getAttribute(o.PREFER_PLAYBACK);if(t===p.PlaybackTypes.MSE||t===p.PlaybackTypes.NATIVE)return t}set preferPlayback(t){t!==this.preferPlayback&&(t===p.PlaybackTypes.MSE||t===p.PlaybackTypes.NATIVE?this.setAttribute(o.PREFER_PLAYBACK,t):this.removeAttribute(o.PREFER_PLAYBACK))}get metadata(){return{...this.getAttributeNames().filter(s=>s.startsWith("metadata-")&&![o.METADATA_URL].includes(s)).reduce((s,n)=>{let h=this.getAttribute(n);return h!=null&&(s[n.replace(/^metadata-/,"").replace(/-/g,"_")]=h),s},{}),...r(this,It)}}set metadata(t){u(this,It,t!=null?t:{}),this.mux&&this.mux.emit("hb",r(this,It))}get _hlsConfig(){return r(this,Ut)}set _hlsConfig(t){u(this,Ut,t)}get logo(){return this.getAttribute(o.LOGO)}set logo(t){t?this.setAttribute(o.LOGO,t):this.removeAttribute(o.LOGO)}load(){u(this,N,(0,p.initialize)(this,this.nativeEl,r(this,N)))}unload(){(0,p.teardown)(this.nativeEl,r(this,N)),u(this,N,void 0)}attributeChangedCallback(t,s,n){var m,d;switch(Jt.observedAttributes.includes(t)&&!["src","autoplay","preload"].includes(t)&&super.attributeChangedCallback(t,s,n),t){case o.PLAYER_SOFTWARE_NAME:this.playerSoftwareName=n!=null?n:void 0;break;case o.PLAYER_SOFTWARE_VERSION:this.playerSoftwareVersion=n!=null?n:void 0;break;case"src":{let b=!!s,x=!!n;!b&&x?y(this,Ot,ce).call(this):b&&!x?this.unload():b&&x&&(this.unload(),y(this,Ot,ce).call(this));break}case"autoplay":if(n===s)break;(m=r(this,N))==null||m.setAutoplay(this.autoplay);break;case"preload":if(n===s)break;(d=r(this,N))==null||d.setPreload(n);break;case o.PLAYBACK_ID:this.src=(0,p.toMuxVideoURL)(this);break;case o.DEBUG:{let b=this.debug;this.mux&&console.info("Cannot toggle debug mode of mux data after initialization. Make sure you set all metadata to override before setting the src."),this._hls&&(this._hls.config.debug=b);break}case o.METADATA_URL:n&&fetch(n).then(b=>b.json()).then(b=>this.metadata=b).catch(()=>console.error(`Unable to load or parse metadata JSON from metadata-url ${n}!`));break;case o.STREAM_TYPE:(n==null||n!==s)&&this.dispatchEvent(new CustomEvent("streamtypechange",{composed:!0,bubbles:!0}));break;case o.TARGET_LIVE_WINDOW:(n==null||n!==s)&&this.dispatchEvent(new CustomEvent("targetlivewindowchange",{composed:!0,bubbles:!0,detail:this.targetLiveWindow}));break;default:break}}connectedCallback(){var t;(t=super.connectedCallback)==null||t.call(this),this.nativeEl&&this.src&&!r(this,N)&&y(this,Ot,ce).call(this)}disconnectedCallback(){this.unload()}};N=new WeakMap,Pt=new WeakMap,Bt=new WeakMap,It=new WeakMap,Kt=new WeakMap,Ut=new WeakMap,qt=new WeakMap,Yt=new WeakMap,Ht=new WeakMap,Ot=new WeakSet,ce=async function(){r(this,Pt)||(await u(this,Pt,Promise.resolve()),u(this,Pt,null),this.load())};var jt,Ft=class extends Xe(di(ke)){constructor(){super(...arguments);l(this,jt)}get muxCastCustomData(){return{mux:{playbackId:this.playbackId,minResolution:this.minResolution,maxResolution:this.maxResolution,renditionOrder:this.renditionOrder,customDomain:this.customDomain,tokens:{drm:this.drmToken},envKey:this.envKey,metadata:this.metadata,disableCookies:this.disableCookies,disableTracking:this.disableTracking,beaconCollectionDomain:this.beaconCollectionDomain,startTime:this.startTime,preferCmcd:this.preferCmcd}}}get castCustomData(){var t;return(t=r(this,jt))!=null?t:this.muxCastCustomData}set castCustomData(t){u(this,jt,t)}};jt=new WeakMap;zt.customElements.get("mux-video")||(zt.customElements.define("mux-video",Ft),zt.MuxVideoElement=Ft);var Ni=Ft;
//# sourceMappingURL=index.cjs.js.map
