@mux/mux-video
Advanced tools
Comparing version 0.20.2-canary.0-8159569 to 0.20.2-canary.0-840a0be
{ | ||
"inputs": { | ||
"src/polyfills/index.ts": { | ||
"bytes": 2117, | ||
"bytes": 2165, | ||
"imports": [ | ||
@@ -416,3 +416,3 @@ { | ||
"inputs": {}, | ||
"bytes": 141840 | ||
"bytes": 141923 | ||
}, | ||
@@ -434,3 +434,3 @@ "dist/index.cjs.js": { | ||
"src/polyfills/index.ts": { | ||
"bytesInOutput": 764 | ||
"bytesInOutput": 788 | ||
}, | ||
@@ -492,5 +492,5 @@ "src/env.ts": { | ||
}, | ||
"bytes": 42212 | ||
"bytes": 42236 | ||
} | ||
} | ||
} |
{ | ||
"inputs": { | ||
"src/polyfills/index.ts": { | ||
"bytes": 2117, | ||
"bytes": 2165, | ||
"imports": [ | ||
@@ -416,3 +416,3 @@ { | ||
"inputs": {}, | ||
"bytes": 142680 | ||
"bytes": 142763 | ||
}, | ||
@@ -436,3 +436,3 @@ "dist/index.mjs": { | ||
"src/polyfills/index.ts": { | ||
"bytesInOutput": 764 | ||
"bytesInOutput": 788 | ||
}, | ||
@@ -497,5 +497,5 @@ "src/index.ts": { | ||
}, | ||
"bytes": 41790 | ||
"bytes": 41814 | ||
} | ||
} | ||
} |
{ | ||
"inputs": { | ||
"src/polyfills/index.ts": { | ||
"bytes": 2117, | ||
"bytes": 2165, | ||
"imports": [ | ||
@@ -442,3 +442,3 @@ { | ||
"inputs": {}, | ||
"bytes": 2293092 | ||
"bytes": 2293122 | ||
}, | ||
@@ -451,3 +451,3 @@ "dist/mux-video.js": { | ||
"src/polyfills/index.ts": { | ||
"bytesInOutput": 764 | ||
"bytesInOutput": 788 | ||
}, | ||
@@ -521,5 +521,5 @@ "../../node_modules/mux-embed/dist/mux.mjs": { | ||
}, | ||
"bytes": 545088 | ||
"bytes": 545112 | ||
} | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
"use strict";var Jt=Object.defineProperty;var ai=Object.getOwnPropertyDescriptor;var di=Object.getOwnPropertyNames;var ci=Object.getPrototypeOf,ui=Object.prototype.hasOwnProperty;var hi=Reflect.get;var li=(e,i,t)=>i in e?Jt(e,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[i]=t;var fi=(e,i)=>{for(var t in i)Jt(e,t,{get:i[t],enumerable:!0})},mi=(e,i,t,s)=>{if(i&&typeof i=="object"||typeof i=="function")for(let n of di(i))!ui.call(e,n)&&n!==t&&Jt(e,n,{get:()=>i[n],enumerable:!(s=ai(i,n))||s.enumerable});return e};var pi=e=>mi(Jt({},"__esModule",{value:!0}),e);var b=(e,i,t)=>(li(e,typeof i!="symbol"?i+"":i,t),t),Ee=(e,i,t)=>{if(!i.has(e))throw TypeError("Cannot "+t)};var r=(e,i,t)=>(Ee(e,i,"read from private field"),t?t.call(e):i.get(e)),u=(e,i,t)=>{if(i.has(e))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(e):i.set(e,t)},h=(e,i,t,s)=>(Ee(e,i,"write to private field"),s?s.call(e,t):i.set(e,t),t);var k=(e,i,t)=>(Ee(e,i,"access private method"),t),Qt=(e,i,t)=>hi(ci(e),t,i);var Li={};fi(Li,{Attributes:()=>c,MediaError:()=>f.MediaError,VideoEvents:()=>te,default:()=>Ii});module.exports=pi(Li);var bt=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class e extends bt{}globalThis.DocumentFragment=e}var xt=class extends bt{},be=class extends bt{},gi={get(e){},define(e,i,t){},upgrade(e){},whenDefined(e){return Promise.resolve(xt)}},Dt,ve=class{constructor(i,t={}){u(this,Dt,void 0);h(this,Dt,t==null?void 0:t.detail)}get detail(){return r(this,Dt)}initCustomEvent(){}};Dt=new WeakMap;function Ei(e,i){return new xt}var Pe={document:{createElement:Ei},DocumentFragment,customElements:gi,CustomEvent:ve,EventTarget:bt,HTMLElement:xt,HTMLVideoElement:be},_e=typeof window=="undefined"||typeof globalThis.customElements=="undefined",Zt=_e?Pe:globalThis,xi=_e?Pe.document:globalThis.document;var f=require("@mux/playback-core");var bi=()=>{try{return"0.20.2"}catch{}return"UNKNOWN"},vi=bi(),Ie=()=>vi;var te=["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"];function Ti(e){return` | ||
"use strict";var Jt=Object.defineProperty;var ai=Object.getOwnPropertyDescriptor;var di=Object.getOwnPropertyNames;var ci=Object.getPrototypeOf,ui=Object.prototype.hasOwnProperty;var hi=Reflect.get;var li=(e,i,t)=>i in e?Jt(e,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[i]=t;var fi=(e,i)=>{for(var t in i)Jt(e,t,{get:i[t],enumerable:!0})},mi=(e,i,t,s)=>{if(i&&typeof i=="object"||typeof i=="function")for(let n of di(i))!ui.call(e,n)&&n!==t&&Jt(e,n,{get:()=>i[n],enumerable:!(s=ai(i,n))||s.enumerable});return e};var pi=e=>mi(Jt({},"__esModule",{value:!0}),e);var b=(e,i,t)=>(li(e,typeof i!="symbol"?i+"":i,t),t),Ee=(e,i,t)=>{if(!i.has(e))throw TypeError("Cannot "+t)};var r=(e,i,t)=>(Ee(e,i,"read from private field"),t?t.call(e):i.get(e)),u=(e,i,t)=>{if(i.has(e))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(e):i.set(e,t)},h=(e,i,t,s)=>(Ee(e,i,"write to private field"),s?s.call(e,t):i.set(e,t),t);var k=(e,i,t)=>(Ee(e,i,"access private method"),t),Qt=(e,i,t)=>hi(ci(e),t,i);var Li={};fi(Li,{Attributes:()=>c,MediaError:()=>f.MediaError,VideoEvents:()=>te,default:()=>Ii});module.exports=pi(Li);var bt=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class e extends bt{}globalThis.DocumentFragment=e}var xt=class extends bt{},be=class extends bt{},gi={get(e){},define(e,i,t){},getName(e){return null},upgrade(e){},whenDefined(e){return Promise.resolve(xt)}},Dt,ve=class{constructor(i,t={}){u(this,Dt,void 0);h(this,Dt,t==null?void 0:t.detail)}get detail(){return r(this,Dt)}initCustomEvent(){}};Dt=new WeakMap;function Ei(e,i){return new xt}var _e={document:{createElement:Ei},DocumentFragment,customElements:gi,CustomEvent:ve,EventTarget:bt,HTMLElement:xt,HTMLVideoElement:be},Pe=typeof window=="undefined"||typeof globalThis.customElements=="undefined",Zt=Pe?_e:globalThis,xi=Pe?_e.document:globalThis.document;var f=require("@mux/playback-core");var bi=()=>{try{return"0.20.2"}catch{}return"UNKNOWN"},vi=bi(),Ie=()=>vi;var te=["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"];function Ti(e){return` | ||
<style> | ||
@@ -43,3 +43,3 @@ :host { | ||
<slot></slot> | ||
`}var we=(e,{tag:i,is:t})=>{var l,p,a,v,O,xe,pt,D,o,m,ot,x,Te,M,De,_,Ne;let s=(p=(l=globalThis.document)==null?void 0:l.createElement)==null?void 0:p.call(l,i,{is:t}),n=s?Ai(s):[];return a=class extends e{constructor(){super();u(this,m);u(this,x);u(this,M);u(this,_);u(this,pt,void 0);u(this,D,void 0);u(this,o,new Map)}static get observedAttributes(){var E,y,I;return k(E=a,O,xe).call(E),[...(I=(y=s==null?void 0:s.constructor)==null?void 0:y.observedAttributes)!=null?I:[],"autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"]}get nativeEl(){var g,E,y;return k(this,m,ot).call(this),(y=(E=(g=r(this,D))!=null?g:this.shadowRoot.querySelector(i))!=null?E:this.querySelector(":scope > [slot=media]"))!=null?y:this.querySelector(i)}set nativeEl(g){h(this,D,g)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(g){this.toggleAttribute("muted",!!g)}get src(){return this.getAttribute("src")}set src(g){this.setAttribute("src",`${g}`)}get preload(){var g,E;return(E=this.getAttribute("preload"))!=null?E:(g=this.nativeEl)==null?void 0:g.preload}set preload(g){this.setAttribute("preload",`${g}`)}init(){var g,E;if(!this.shadowRoot){this.attachShadow({mode:"open"});let y=ki(this.attributes);t&&(y.is=t),i&&(y.part=i),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(y)}this.nativeEl.muted=this.hasAttribute("muted");for(let y of n)k(this,M,De).call(this,y);this.shadowRoot.addEventListener("slotchange",this),k(this,x,Te).call(this);for(let y of this.constructor.Events)(E=(g=this.shadowRoot).addEventListener)==null||E.call(g,y,this,!0)}handleEvent(g){if(g.type==="slotchange"){k(this,x,Te).call(this);return}g.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(g.type,{detail:g.detail}))}attributeChangedCallback(g,E,y){k(this,m,ot).call(this),k(this,_,Ne).call(this,g,E,y)}connectedCallback(){k(this,m,ot).call(this)}},v=new WeakMap,O=new WeakSet,xe=function(){if(r(this,v))return;h(this,v,!0);let g=new Set(this.observedAttributes);g.delete("muted");for(let E of n){if(E in this.prototype)continue;if(typeof s[E]=="function")this.prototype[E]=function(...I){return k(this,m,ot).call(this),this.call?this.call(E,...I):this.nativeEl[E].apply(this.nativeEl,I)};else{let I={get(){var V,Mt,wt;k(this,m,ot).call(this);let P=E.toLowerCase();if(g.has(P)){let Et=this.getAttribute(P);return Et===null?!1:Et===""?!0:Et}return(wt=(V=this.get)==null?void 0:V.call(this,E))!=null?wt:(Mt=this.nativeEl)==null?void 0:Mt[E]}};E!==E.toUpperCase()&&(I.set=function(P){k(this,m,ot).call(this);let V=E.toLowerCase();if(g.has(V)){P===!0||P===!1||P==null?this.toggleAttribute(V,!!P):this.setAttribute(V,P);return}if(this.set){this.set(E,P);return}this.nativeEl[E]=P}),Object.defineProperty(this.prototype,E,I)}}},pt=new WeakMap,D=new WeakMap,o=new WeakMap,m=new WeakSet,ot=function(){r(this,pt)||(h(this,pt,!0),this.init())},x=new WeakSet,Te=function(){let g=new Map(r(this,o));this.shadowRoot.querySelector("slot:not([name])").assignedElements({flatten:!0}).filter(E=>["track","source"].includes(E.localName)).forEach(E=>{var I,P;g.delete(E);let y=r(this,o).get(E);y||(y=E.cloneNode(),r(this,o).set(E,y)),(P=(I=this.nativeEl).append)==null||P.call(I,y),y.localName==="track"&&y.default&&(y.kind==="chapters"||y.kind==="metadata")&&y.track.mode==="disabled"&&(y.track.mode="hidden")}),g.forEach(E=>E.remove())},M=new WeakSet,De=function(g){if(Object.prototype.hasOwnProperty.call(this,g)){let E=this[g];delete this[g],this[g]=E}},_=new WeakSet,Ne=function(g,E,y){var I,P,V,Mt,wt,Et;["id","class"].includes(g)||!a.observedAttributes.includes(g)&&this.constructor.observedAttributes.includes(g)||(y===null?(P=(I=this.nativeEl).removeAttribute)==null||P.call(I,g):((Mt=(V=this.nativeEl).getAttribute)==null?void 0:Mt.call(V,g))!=y&&((Et=(wt=this.nativeEl).setAttribute)==null||Et.call(wt,g,y)))},u(a,O),b(a,"getTemplateHTML",i.endsWith("audio")?Ti:yi),b(a,"shadowRootOptions",{mode:"open"}),b(a,"Events",te),u(a,v,void 0),a};function Ai(e){let i=[];for(let t=Object.getPrototypeOf(e);t&&t!==HTMLElement.prototype;t=Object.getPrototypeOf(t))i.push(...Object.getOwnPropertyNames(t));return i}function Ve(e){let i="";for(let t in e){let s=e[t];s===""?i+=` ${t}`:i+=` ${t}="${s}"`}return i}function ki(e){let i={};for(let t of e)i[t.name]=t.value;return i}var Le,ee=we((Le=globalThis.HTMLElement)!=null?Le:class{},{tag:"video"}),Me,Gi=we((Me=globalThis.HTMLElement)!=null?Me:class{},{tag:"audio"});var G=new WeakMap,vt=class extends Error{},ie=class extends Error{};var 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 qe(){return globalThis.chrome}function Be(){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 W(){var e,i;return(i=(e=globalThis.cast)==null?void 0:e.framework)==null?void 0:i.CastContext.getInstance()}function Nt(){var e;return(e=W())==null?void 0:e.getCurrentSession()}function re(){var e;return(e=Nt())==null?void 0:e.getSessionObj().media[0]}function Ue(e){return new Promise((i,t)=>{re().editTracksInfo(e,i,t)})}function je(e){return new Promise((i,t)=>{re().getStatus(e,i,t)})}function ye(e){return W().setOptions({...Ae(),...e})}function Ae(){return{receiverApplicationId:"CC1AD845",autoJoinPolicy:"origin_scoped",androidReceiverCompatible:!1,language:"en-US",resumeSavedSession:!0}}var se=new Ge,K=new WeakSet,C;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}C||(C=cast.framework,W().addEventListener(C.CastContextEventType.CAST_STATE_CHANGED,n=>{se.forEach(l=>{var p,a;return(a=(p=G.get(l)).onCastStateChanged)==null?void 0:a.call(p,n)})}),W().addEventListener(C.CastContextEventType.SESSION_STATE_CHANGED,n=>{se.forEach(l=>{var p,a;return(a=(p=G.get(l)).onSessionStateChanged)==null?void 0:a.call(p,n)})}),se.forEach(n=>{var l,p;return(p=(l=G.get(n)).init)==null?void 0:p.call(l)}))});var We=0,A,Vt,L,F,dt,ct,Y,oe,q,at,ae,Ke,Gt,ke,de,Ye,Ft,Re,ce,He,qt,Se,ne=class extends EventTarget{constructor(t){super();u(this,q);u(this,ae);u(this,Gt);u(this,de);u(this,Ft);u(this,ce);u(this,qt);u(this,A,void 0);u(this,Vt,void 0);u(this,L,void 0);u(this,F,void 0);u(this,dt,"disconnected");u(this,ct,!1);u(this,Y,new Set);u(this,oe,new WeakMap);h(this,A,t),se.add(this),G.set(this,{init:()=>k(this,Ft,Re).call(this),onCastStateChanged:()=>k(this,Gt,ke).call(this),onSessionStateChanged:()=>k(this,de,Ye).call(this),getCastPlayer:()=>r(this,q,at)}),k(this,Ft,Re).call(this)}get state(){return r(this,dt)}async watchAvailability(t){if(r(this,A).disableRemotePlayback)throw new vt("disableRemotePlayback attribute is present.");return r(this,oe).set(t,++We),r(this,Y).add(t),We}async cancelWatchAvailability(t){if(r(this,A).disableRemotePlayback)throw new vt("disableRemotePlayback attribute is present.");t?r(this,Y).delete(t):r(this,Y).clear()}async prompt(){var s,n,l,p;if(r(this,A).disableRemotePlayback)throw new vt("disableRemotePlayback attribute is present.");if(!((n=(s=globalThis.chrome)==null?void 0:s.cast)!=null&&n.isAvailable))throw new ie("The RemotePlayback API is disabled on this platform.");let t=K.has(r(this,A));K.add(r(this,A)),ye(r(this,A).castOptions),Object.entries(r(this,F)).forEach(([a,v])=>{r(this,L).controller.addEventListener(a,v)});try{await W().requestSession()}catch(a){if(a==="cancel"){t||K.delete(r(this,A));return}throw new Error(a)}(p=(l=G.get(r(this,A)))==null?void 0:l.loadOnPrompt)==null||p.call(l)}};A=new WeakMap,Vt=new WeakMap,L=new WeakMap,F=new WeakMap,dt=new WeakMap,ct=new WeakMap,Y=new WeakMap,oe=new WeakMap,q=new WeakSet,at=function(){if(K.has(r(this,A)))return r(this,L)},ae=new WeakSet,Ke=function(){K.has(r(this,A))&&(Object.entries(r(this,F)).forEach(([t,s])=>{r(this,L).controller.removeEventListener(t,s)}),K.delete(r(this,A)),r(this,A).muted=r(this,L).isMuted,r(this,A).currentTime=r(this,L).savedPlayerState.currentTime,r(this,L).savedPlayerState.isPaused===!1&&r(this,A).play())},Gt=new WeakSet,ke=function(){let t=W().getCastState();if(K.has(r(this,A))&&t==="CONNECTING"&&(h(this,dt,"connecting"),this.dispatchEvent(new Event("connecting"))),!r(this,ct)&&(t!=null&&t.includes("CONNECT"))){h(this,ct,!0);for(let s of r(this,Y))s(!0)}else if(r(this,ct)&&(!t||t==="NO_DEVICES_AVAILABLE")){h(this,ct,!1);for(let s of r(this,Y))s(!1)}},de=new WeakSet,Ye=async function(){var s;let{SESSION_RESUMED:t}=C.SessionState;if(W().getSessionState()===t&&r(this,A).castSrc===((s=re())==null?void 0:s.media.contentId)){K.add(r(this,A)),Object.entries(r(this,F)).forEach(([n,l])=>{r(this,L).controller.addEventListener(n,l)});try{await je(new chrome.cast.media.GetStatusRequest)}catch(n){console.error(n)}r(this,F)[C.RemotePlayerEventType.IS_PAUSED_CHANGED](),r(this,F)[C.RemotePlayerEventType.PLAYER_STATE_CHANGED]()}},Ft=new WeakSet,Re=function(){!C||r(this,Vt)||(h(this,Vt,!0),ye(r(this,A).castOptions),r(this,A).textTracks.addEventListener("change",()=>k(this,qt,Se).call(this)),k(this,Gt,ke).call(this),h(this,L,new C.RemotePlayer),new C.RemotePlayerController(r(this,L)),h(this,F,{[C.RemotePlayerEventType.IS_CONNECTED_CHANGED]:({value:t})=>{t===!0?(h(this,dt,"connected"),this.dispatchEvent(new Event("connect"))):(k(this,ae,Ke).call(this),h(this,dt,"disconnected"),this.dispatchEvent(new Event("disconnect")))},[C.RemotePlayerEventType.DURATION_CHANGED]:()=>{r(this,A).dispatchEvent(new Event("durationchange"))},[C.RemotePlayerEventType.VOLUME_LEVEL_CHANGED]:()=>{r(this,A).dispatchEvent(new Event("volumechange"))},[C.RemotePlayerEventType.IS_MUTED_CHANGED]:()=>{r(this,A).dispatchEvent(new Event("volumechange"))},[C.RemotePlayerEventType.CURRENT_TIME_CHANGED]:()=>{var t;(t=r(this,q,at))!=null&&t.isMediaLoaded&&r(this,A).dispatchEvent(new Event("timeupdate"))},[C.RemotePlayerEventType.VIDEO_INFO_CHANGED]:()=>{r(this,A).dispatchEvent(new Event("resize"))},[C.RemotePlayerEventType.IS_PAUSED_CHANGED]:()=>{r(this,A).dispatchEvent(new Event(this.paused?"pause":"play"))},[C.RemotePlayerEventType.PLAYER_STATE_CHANGED]:()=>{var t,s;((t=r(this,q,at))==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,q,at))==null?void 0:s.playerState]))},[C.RemotePlayerEventType.IS_MEDIA_LOADED_CHANGED]:async()=>{var t;(t=r(this,q,at))!=null&&t.isMediaLoaded&&(await Promise.resolve(),k(this,ce,He).call(this))}}))},ce=new WeakSet,He=function(){k(this,qt,Se).call(this)},qt=new WeakSet,Se=async function(){var D,o,m,S,x;if(!r(this,q,at))return;let s=((o=(D=r(this,L).mediaInfo)==null?void 0:D.tracks)!=null?o:[]).filter(({type:R})=>R===chrome.cast.media.TrackType.TEXT),n=[...r(this,A).textTracks].filter(({kind:R})=>R==="subtitles"||R==="captions"),l=s.map(({language:R,name:M,trackId:gt})=>{var nt;let{mode:_}=(nt=n.find(N=>N.language===R&&N.label===M))!=null?nt:{};return _?{mode:_,trackId:gt}:!1}).filter(Boolean),a=l.filter(({mode:R})=>R!=="showing").map(({trackId:R})=>R),v=l.find(({mode:R})=>R==="showing"),O=(x=(S=(m=Nt())==null?void 0:m.getSessionObj().media[0])==null?void 0:S.activeTrackIds)!=null?x:[],j=O;if(O.length&&(j=j.filter(R=>!a.includes(R))),v!=null&&v.trackId&&(j=[...j,v.trackId]),j=[...new Set(j)],!((R,M)=>R.length===M.length&&R.every(gt=>M.includes(gt)))(O,j))try{let R=new chrome.cast.media.EditTracksInfoRequest(j);await Ue(R)}catch(R){console.error(R)}};var $e=e=>{var i,t,s,n,l,p,a,T,O,ze;return t=class extends e{constructor(){super(...arguments);u(this,a);u(this,O);u(this,s,{paused:!1});u(this,n,Ae());u(this,l,void 0);u(this,p,void 0)}get remote(){return r(this,p)?r(this,p):qe()?(Be(),G.set(this,{loadOnPrompt:()=>k(this,O,ze).call(this)}),h(this,p,new ne(this))):super.remote}attributeChangedCallback(o,m,S){if(super.attributeChangedCallback(o,m,S),o==="cast-receiver"&&S){r(this,n).receiverApplicationId=S;return}if(r(this,a,T))switch(o){case"cast-stream-type":case"cast-src":this.load();break}}async load(){var M,gt;if(!r(this,a,T))return super.load();let o=new chrome.cast.media.MediaInfo(this.castSrc,this.castContentType);o.customData=this.castCustomData;let m=[...this.querySelectorAll("track")].filter(({kind:_,src:nt})=>nt&&(_==="subtitles"||_==="captions")),S=[],x=0;m.length&&(o.tracks=m.map(_=>{let nt=++x;S.length===0&&_.track.mode==="showing"&&S.push(nt);let N=new chrome.cast.media.Track(nt,chrome.cast.media.TrackType.TEXT);return N.trackContentId=_.src,N.trackContentType="text/vtt",N.subtype=_.kind==="captions"?chrome.cast.media.TextTrackType.CAPTIONS:chrome.cast.media.TextTrackType.SUBTITLES,N.name=_.label,N.language=_.srclang,N})),this.castStreamType==="live"?o.streamType=chrome.cast.media.StreamType.LIVE:o.streamType=chrome.cast.media.StreamType.BUFFERED,o.metadata=new chrome.cast.media.GenericMediaMetadata,o.metadata.title=this.title,o.metadata.images=[{url:this.poster}];let R=new chrome.cast.media.LoadRequest(o);R.currentTime=(M=super.currentTime)!=null?M:0,R.autoplay=!r(this,s).paused,R.activeTrackIds=S,await((gt=Nt())==null?void 0:gt.loadMedia(R)),this.dispatchEvent(new Event("volumechange"))}play(){var o;if(r(this,a,T)){r(this,a,T).isPaused&&((o=r(this,a,T).controller)==null||o.playOrPause());return}return super.play()}pause(){var o;if(r(this,a,T)){r(this,a,T).isPaused||(o=r(this,a,T).controller)==null||o.playOrPause();return}super.pause()}get castOptions(){return r(this,n)}get castReceiver(){var o;return(o=this.getAttribute("cast-receiver"))!=null?o:void 0}set castReceiver(o){this.castReceiver!=o&&this.setAttribute("cast-receiver",`${o}`)}get castSrc(){var o,m,S;return(S=(m=this.getAttribute("cast-src"))!=null?m:(o=this.querySelector("source"))==null?void 0:o.src)!=null?S:this.currentSrc}set castSrc(o){this.castSrc!=o&&this.setAttribute("cast-src",`${o}`)}get castContentType(){var o;return(o=this.getAttribute("cast-content-type"))!=null?o:void 0}set castContentType(o){this.setAttribute("cast-content-type",`${o}`)}get castStreamType(){var o,m;return(m=(o=this.getAttribute("cast-stream-type"))!=null?o:this.streamType)!=null?m:void 0}set castStreamType(o){this.setAttribute("cast-stream-type",`${o}`)}get castCustomData(){return r(this,l)}set castCustomData(o){let m=typeof o;if(!["object","undefined"].includes(m)){console.error(`castCustomData must be nullish or an object but value was of type ${m}`);return}h(this,l,o)}get readyState(){if(r(this,a,T))switch(r(this,a,T).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,a,T)?r(this,a,T).isPaused:super.paused}get muted(){var o;return r(this,a,T)?(o=r(this,a,T))==null?void 0:o.isMuted:super.muted}set muted(o){var m;if(r(this,a,T)){(o&&!r(this,a,T).isMuted||!o&&r(this,a,T).isMuted)&&((m=r(this,a,T).controller)==null||m.muteOrUnmute());return}super.muted=o}get volume(){var o,m;return r(this,a,T)?(m=(o=r(this,a,T))==null?void 0:o.volumeLevel)!=null?m:1:super.volume}set volume(o){var m;if(r(this,a,T)){r(this,a,T).volumeLevel=+o,(m=r(this,a,T).controller)==null||m.setVolumeLevel();return}super.volume=o}get duration(){var o,m,S;return r(this,a,T)&&((o=r(this,a,T))!=null&&o.isMediaLoaded)?(S=(m=r(this,a,T))==null?void 0:m.duration)!=null?S:NaN:super.duration}get currentTime(){var o,m,S;return r(this,a,T)&&((o=r(this,a,T))!=null&&o.isMediaLoaded)?(S=(m=r(this,a,T))==null?void 0:m.currentTime)!=null?S:0:super.currentTime}set currentTime(o){var m;if(r(this,a,T)){r(this,a,T).currentTime=o,(m=r(this,a,T).controller)==null||m.seek();return}super.currentTime=o}},s=new WeakMap,n=new WeakMap,l=new WeakMap,p=new WeakMap,a=new WeakSet,T=function(){var o,m;return(m=(o=G.get(this.remote))==null?void 0:o.getCastPlayer)==null?void 0:m.call(o)},O=new WeakSet,ze=async function(){r(this,s).paused=Qt(t.prototype,this,"paused"),Qt(t.prototype,this,"pause").call(this),this.muted=Qt(t.prototype,this,"muted");try{await this.load()}catch(o){console.error(o)}},b(t,"observedAttributes",[...(i=e.observedAttributes)!=null?i:[],"cast-src","cast-content-type","cast-stream-type","cast-receiver"]),t};var B=class extends Event{constructor(t,s){super(t);b(this,"track");this.track=s.track}};var Ce=new WeakMap;function d(e){var i;return(i=Ce.get(e))!=null?i:Ri(e,{})}function Ri(e,i){let t=Ce.get(e);return t||Ce.set(e,t={}),Object.assign(t,i)}function ue(e,i){let t=e.videoTracks;d(i).media=e,d(i).renditionSet||(d(i).renditionSet=new Set);let s=d(t).trackSet;s.add(i);let n=s.size-1;n in ht.prototype||Object.defineProperty(ht.prototype,n,{get(){return[...d(this).trackSet][n]}}),queueMicrotask(()=>{t.dispatchEvent(new B("addtrack",{track:i}))})}function he(e){var s;let i=(s=d(e).media)==null?void 0:s.videoTracks;if(!i)return;d(i).trackSet.delete(e),queueMicrotask(()=>{i.dispatchEvent(new B("removetrack",{track:e}))})}function Xe(e){var s;let i=(s=d(e).media.videoTracks)!=null?s:[],t=!1;for(let n of i)n!==e&&(n.selected=!1,t=!0);if(t){if(d(i).changeRequested)return;d(i).changeRequested=!0,queueMicrotask(()=>{delete d(i).changeRequested,i.dispatchEvent(new Event("change"))})}}var H,$,z,ut,Bt,ht=class extends EventTarget{constructor(){super();u(this,ut);u(this,H,void 0);u(this,$,void 0);u(this,z,void 0);d(this).trackSet=new Set}[Symbol.iterator](){return r(this,ut,Bt).values()}get length(){return r(this,ut,Bt).size}getTrackById(t){var s;return(s=[...r(this,ut,Bt)].find(n=>n.id===t))!=null?s:null}get selectedIndex(){return[...r(this,ut,Bt)].findIndex(t=>t.selected)}get onaddtrack(){return r(this,H)}set onaddtrack(t){r(this,H)&&(this.removeEventListener("addtrack",r(this,H)),h(this,H,void 0)),typeof t=="function"&&(h(this,H,t),this.addEventListener("addtrack",t))}get onremovetrack(){return r(this,$)}set onremovetrack(t){r(this,$)&&(this.removeEventListener("removetrack",r(this,$)),h(this,$,void 0)),typeof t=="function"&&(h(this,$,t),this.addEventListener("removetrack",t))}get onchange(){return r(this,z)}set onchange(t){r(this,z)&&(this.removeEventListener("change",r(this,z)),h(this,z,void 0)),typeof t=="function"&&(h(this,z,t),this.addEventListener("change",t))}};H=new WeakMap,$=new WeakMap,z=new WeakMap,ut=new WeakSet,Bt=function(){return d(this).trackSet};var U=class extends Event{constructor(t,s){super(t);b(this,"rendition");this.rendition=s.rendition}};function Je(e,i){let t=d(e).media.videoRenditions;d(i).media=d(e).media,d(i).track=e;let s=d(e).renditionSet;s.add(i);let n=s.size-1;n in lt.prototype||Object.defineProperty(lt.prototype,n,{get(){return Tt(this)[n]}}),queueMicrotask(()=>{e.selected&&t.dispatchEvent(new U("addrendition",{rendition:i}))})}function Qe(e){let i=d(e).media.videoRenditions,t=d(e).track;d(t).renditionSet.delete(e),queueMicrotask(()=>{d(e).track.selected&&i.dispatchEvent(new U("removerendition",{rendition:e}))})}function Ze(e){let i=d(e).media.videoRenditions;!i||d(i).changeRequested||(d(i).changeRequested=!0,queueMicrotask(()=>{delete d(i).changeRequested,d(e).track.selected&&i.dispatchEvent(new Event("change"))}))}function Tt(e){return[...d(e).media.videoTracks].filter(t=>t.selected).flatMap(t=>[...d(t).renditionSet])}var X,J,Q,lt=class extends EventTarget{constructor(){super(...arguments);u(this,X,void 0);u(this,J,void 0);u(this,Q,void 0)}[Symbol.iterator](){return Tt(this).values()}get length(){return Tt(this).length}getRenditionById(t){var s;return(s=Tt(this).find(n=>`${n.id}`==`${t}`))!=null?s:null}get selectedIndex(){return Tt(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[s,n]of Tt(this).entries())n.selected=s===t}get onaddrendition(){return r(this,X)}set onaddrendition(t){r(this,X)&&(this.removeEventListener("addrendition",r(this,X)),h(this,X,void 0)),typeof t=="function"&&(h(this,X,t),this.addEventListener("addrendition",t))}get onremoverendition(){return r(this,J)}set onremoverendition(t){r(this,J)&&(this.removeEventListener("removerendition",r(this,J)),h(this,J,void 0)),typeof t=="function"&&(h(this,J,t),this.addEventListener("removerendition",t))}get onchange(){return r(this,Q)}set onchange(t){r(this,Q)&&(this.removeEventListener("change",r(this,Q)),h(this,Q,void 0)),typeof t=="function"&&(h(this,Q,t),this.addEventListener("change",t))}};X=new WeakMap,J=new WeakMap,Q=new WeakMap;var yt,Ut=class{constructor(){b(this,"src");b(this,"id");b(this,"width");b(this,"height");b(this,"bitrate");b(this,"frameRate");b(this,"codec");u(this,yt,!1)}get selected(){return r(this,yt)}set selected(i){r(this,yt)!==i&&(h(this,yt,i),Ze(this))}};yt=new WeakMap;var At,kt=class{constructor(){b(this,"id");b(this,"kind");b(this,"label","");b(this,"language","");b(this,"sourceBuffer");u(this,At,!1)}addRendition(i,t,s,n,l,p){let a=new Ut;return a.src=i,a.width=t,a.height=s,a.frameRate=p,a.bitrate=l,a.codec=n,Je(this,a),a}removeRendition(i){Qe(i)}get selected(){return r(this,At)}set selected(i){r(this,At)!==i&&(h(this,At,i),i===!0&&Xe(this))}};At=new WeakMap;function ti(e,i){let t=d(e).media.audioRenditions;d(i).media=d(e).media,d(i).track=e;let s=d(e).renditionSet;s.add(i);let n=s.size-1;n in ft.prototype||Object.defineProperty(ft.prototype,n,{get(){return Rt(this)[n]}}),queueMicrotask(()=>{e.enabled&&t.dispatchEvent(new U("addrendition",{rendition:i}))})}function ei(e){let i=d(e).media.audioRenditions,t=d(e).track;d(t).renditionSet.delete(e),queueMicrotask(()=>{d(e).track.enabled&&i.dispatchEvent(new U("removerendition",{rendition:e}))})}function ii(e){let i=d(e).media.audioRenditions;!i||d(i).changeRequested||(d(i).changeRequested=!0,queueMicrotask(()=>{delete d(i).changeRequested,d(e).track.enabled&&i.dispatchEvent(new Event("change"))}))}function Rt(e){return[...d(e).media.audioTracks].filter(t=>t.enabled).flatMap(t=>[...d(t).renditionSet])}var Z,tt,et,ft=class extends EventTarget{constructor(){super(...arguments);u(this,Z,void 0);u(this,tt,void 0);u(this,et,void 0)}[Symbol.iterator](){return Rt(this).values()}get length(){return Rt(this).length}getRenditionById(t){var s;return(s=Rt(this).find(n=>`${n.id}`==`${t}`))!=null?s:null}get selectedIndex(){return Rt(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[s,n]of Rt(this).entries())n.selected=s===t}get onaddrendition(){return r(this,Z)}set onaddrendition(t){r(this,Z)&&(this.removeEventListener("addrendition",r(this,Z)),h(this,Z,void 0)),typeof t=="function"&&(h(this,Z,t),this.addEventListener("addrendition",t))}get onremoverendition(){return r(this,tt)}set onremoverendition(t){r(this,tt)&&(this.removeEventListener("removerendition",r(this,tt)),h(this,tt,void 0)),typeof t=="function"&&(h(this,tt,t),this.addEventListener("removerendition",t))}get onchange(){return r(this,et)}set onchange(t){r(this,et)&&(this.removeEventListener("change",r(this,et)),h(this,et,void 0)),typeof t=="function"&&(h(this,et,t),this.addEventListener("change",t))}};Z=new WeakMap,tt=new WeakMap,et=new WeakMap;var St,jt=class{constructor(){b(this,"src");b(this,"id");b(this,"bitrate");b(this,"codec");u(this,St,!1)}get selected(){return r(this,St)}set selected(i){r(this,St)!==i&&(h(this,St,i),ii(this))}};St=new WeakMap;function fe(e,i){let t=e.audioTracks;d(i).media=e,d(i).renditionSet||(d(i).renditionSet=new Set);let s=d(t).trackSet;s.add(i);let n=s.size-1;n in mt.prototype||Object.defineProperty(mt.prototype,n,{get(){return[...d(this).trackSet][n]}}),queueMicrotask(()=>{t.dispatchEvent(new B("addtrack",{track:i}))})}function me(e){var s;let i=(s=d(e).media)==null?void 0:s.audioTracks;if(!i)return;d(i).trackSet.delete(e),queueMicrotask(()=>{i.dispatchEvent(new B("removetrack",{track:e}))})}function ri(e){let i=d(e).media.audioTracks;!i||d(i).changeRequested||(d(i).changeRequested=!0,queueMicrotask(()=>{delete d(i).changeRequested,i.dispatchEvent(new Event("change"))}))}var it,rt,st,Ct,le,mt=class extends EventTarget{constructor(){super();u(this,Ct);u(this,it,void 0);u(this,rt,void 0);u(this,st,void 0);d(this).trackSet=new Set}[Symbol.iterator](){return r(this,Ct,le).values()}get length(){return r(this,Ct,le).size}getTrackById(t){var s;return(s=[...r(this,Ct,le)].find(n=>n.id===t))!=null?s:null}get onaddtrack(){return r(this,it)}set onaddtrack(t){r(this,it)&&(this.removeEventListener("addtrack",r(this,it)),h(this,it,void 0)),typeof t=="function"&&(h(this,it,t),this.addEventListener("addtrack",t))}get onremovetrack(){return r(this,rt)}set onremovetrack(t){r(this,rt)&&(this.removeEventListener("removetrack",r(this,rt)),h(this,rt,void 0)),typeof t=="function"&&(h(this,rt,t),this.addEventListener("removetrack",t))}get onchange(){return r(this,st)}set onchange(t){r(this,st)&&(this.removeEventListener("change",r(this,st)),h(this,st,void 0)),typeof t=="function"&&(h(this,st,t),this.addEventListener("change",t))}};it=new WeakMap,rt=new WeakMap,st=new WeakMap,Ct=new WeakSet,le=function(){return d(this).trackSet};var Ot,Pt=class{constructor(){b(this,"id");b(this,"kind");b(this,"label","");b(this,"language","");b(this,"sourceBuffer");u(this,Ot,!1)}addRendition(i,t,s){let n=new jt;return n.src=i,n.codec=t,n.bitrate=s,ti(this,n),n}removeRendition(i){ei(i)}get enabled(){return r(this,Ot)}set enabled(i){r(this,Ot)!==i&&(h(this,Ot,i),ri(this))}};Ot=new WeakMap;var si=pe(globalThis.HTMLMediaElement,"video"),ni=pe(globalThis.HTMLMediaElement,"audio");function oi(e){if(!(e!=null&&e.prototype))return e;let i=pe(e,"video");(!i||`${i}`.includes("[native code]"))&&Object.defineProperty(e.prototype,"videoTracks",{get(){return Si(this)}});let t=pe(e,"audio");(!t||`${t}`.includes("[native code]"))&&Object.defineProperty(e.prototype,"audioTracks",{get(){return Ci(this)}}),"addVideoTrack"in e.prototype||(e.prototype.addVideoTrack=function(l,p="",a=""){let v=new kt;return v.kind=l,v.label=p,v.language=a,ue(this,v),v}),"removeVideoTrack"in e.prototype||(e.prototype.removeVideoTrack=he),"addAudioTrack"in e.prototype||(e.prototype.addAudioTrack=function(l,p="",a=""){let v=new Pt;return v.kind=l,v.label=p,v.language=a,fe(this,v),v}),"removeAudioTrack"in e.prototype||(e.prototype.removeAudioTrack=me),"videoRenditions"in e.prototype||Object.defineProperty(e.prototype,"videoRenditions",{get(){return s(this)}});let s=l=>{let p=d(l).videoRenditions;return p||(p=new lt,d(p).media=l,d(l).videoRenditions=p),p};"audioRenditions"in e.prototype||Object.defineProperty(e.prototype,"audioRenditions",{get(){return n(this)}});let n=l=>{let p=d(l).audioRenditions;return p||(p=new ft,d(p).media=l,d(l).audioRenditions=p),p};return e}function pe(e,i){var t;if(e!=null&&e.prototype)return(t=Object.getOwnPropertyDescriptor(e.prototype,`${i}Tracks`))==null?void 0:t.get}function Si(e){var t;let i=d(e).videoTracks;if(!i&&(i=new ht,d(e).videoTracks=i,si)){let s=si.call((t=e.nativeEl)!=null?t:e);for(let n of s)ue(e,n);s.addEventListener("change",()=>{i.dispatchEvent(new Event("change"))}),s.addEventListener("addtrack",n=>{if([...i].some(l=>l instanceof kt)){for(let l of s)he(l);return}ue(e,n.track)}),s.addEventListener("removetrack",n=>{he(n.track)})}return i}function Ci(e){var t;let i=d(e).audioTracks;if(!i&&(i=new mt,d(e).audioTracks=i,ni)){let s=ni.call((t=e.nativeEl)!=null?t:e);for(let n of s)fe(e,n);s.addEventListener("change",()=>{i.dispatchEvent(new Event("change"))}),s.addEventListener("addtrack",n=>{if([...i].some(l=>l instanceof Pt)){for(let l of s)me(l);return}fe(e,n.track)}),s.addEventListener("removetrack",n=>{me(n.track)})}return i}te.push("castchange","entercast","leavecast");var c={BEACON_COLLECTION_DOMAIN:"beacon-collection-domain",CUSTOM_DOMAIN:"custom-domain",DEBUG:"debug",DISABLE_TRACKING:"disable-tracking",DISABLE_COOKIES:"disable-cookies",DRM_TOKEN:"drm-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",METADATA_URL:"metadata-url",PLAYBACK_ID:"playback-id",PLAYER_SOFTWARE_NAME:"player-software-name",PLAYER_SOFTWARE_VERSION:"player-software-version",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"},Oi=Object.values(c),Pi=Ie(),_i="mux-video",w,_t,Kt,It,Yt,Ht,$t,zt,Lt,ge,Oe=class extends ee{constructor(){super();u(this,Lt);u(this,w,void 0);u(this,_t,void 0);u(this,Kt,void 0);u(this,It,{});u(this,Yt,void 0);u(this,Ht,void 0);u(this,$t,void 0);u(this,zt,void 0);h(this,Kt,(0,f.generatePlayerInitTime)())}static get observedAttributes(){var t;return[...Oi,...(t=ee.observedAttributes)!=null?t:[]]}get preferCmcd(){var t;return(t=this.getAttribute(c.PREFER_CMCD))!=null?t:void 0}set preferCmcd(t){t!==this.preferCmcd&&(t?f.CmcdTypeValues.includes(t)?this.setAttribute(c.PREFER_CMCD,t):console.warn(`Invalid value for preferCmcd. Must be one of ${f.CmcdTypeValues.join()}`):this.removeAttribute(c.PREFER_CMCD))}get playerInitTime(){return r(this,Kt)}get playerSoftwareName(){var t;return(t=r(this,$t))!=null?t:_i}set playerSoftwareName(t){h(this,$t,t)}get playerSoftwareVersion(){var t;return(t=r(this,Ht))!=null?t:Pi}set playerSoftwareVersion(t){h(this,Ht,t)}get _hls(){var t;return(t=r(this,w))==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,f.getError)(this.nativeEl))!=null?t:null}get errorTranslator(){return r(this,zt)}set errorTranslator(t){h(this,zt,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(c.TYPE))!=null?t:void 0}set type(t){t!==this.type&&(t?this.setAttribute(c.TYPE,t):this.removeAttribute(c.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(c.DEBUG)!=null}set debug(t){t!==this.debug&&(t?this.setAttribute(c.DEBUG,""):this.removeAttribute(c.DEBUG))}get disableTracking(){return this.hasAttribute(c.DISABLE_TRACKING)}set disableTracking(t){t!==this.disableTracking&&this.toggleAttribute(c.DISABLE_TRACKING,!!t)}get disableCookies(){return this.hasAttribute(c.DISABLE_COOKIES)}set disableCookies(t){t!==this.disableCookies&&(t?this.setAttribute(c.DISABLE_COOKIES,""):this.removeAttribute(c.DISABLE_COOKIES))}get startTime(){let t=this.getAttribute(c.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(c.START_TIME):this.setAttribute(c.START_TIME,`${t}`))}get playbackId(){var t;return this.hasAttribute(c.PLAYBACK_ID)?this.getAttribute(c.PLAYBACK_ID):(t=(0,f.toPlaybackIdFromSrc)(this.src))!=null?t:void 0}set playbackId(t){t!==this.playbackId&&(t?this.setAttribute(c.PLAYBACK_ID,t):this.removeAttribute(c.PLAYBACK_ID))}get maxResolution(){var t;return(t=this.getAttribute(c.MAX_RESOLUTION))!=null?t:void 0}set maxResolution(t){t!==this.maxResolution&&(t?this.setAttribute(c.MAX_RESOLUTION,t):this.removeAttribute(c.MAX_RESOLUTION))}get minResolution(){var t;return(t=this.getAttribute(c.MIN_RESOLUTION))!=null?t:void 0}set minResolution(t){t!==this.minResolution&&(t?this.setAttribute(c.MIN_RESOLUTION,t):this.removeAttribute(c.MIN_RESOLUTION))}get renditionOrder(){var t;return(t=this.getAttribute(c.RENDITION_ORDER))!=null?t:void 0}set renditionOrder(t){t!==this.renditionOrder&&(t?this.setAttribute(c.RENDITION_ORDER,t):this.removeAttribute(c.RENDITION_ORDER))}get programStartTime(){let t=this.getAttribute(c.PROGRAM_START_TIME);if(t==null)return;let s=+t;return Number.isNaN(s)?void 0:s}set programStartTime(t){t==null?this.removeAttribute(c.PROGRAM_START_TIME):this.setAttribute(c.PROGRAM_START_TIME,`${t}`)}get programEndTime(){let t=this.getAttribute(c.PROGRAM_END_TIME);if(t==null)return;let s=+t;return Number.isNaN(s)?void 0:s}set programEndTime(t){t==null?this.removeAttribute(c.PROGRAM_END_TIME):this.setAttribute(c.PROGRAM_END_TIME,`${t}`)}get customDomain(){var t;return(t=this.getAttribute(c.CUSTOM_DOMAIN))!=null?t:void 0}set customDomain(t){t!==this.customDomain&&(t?this.setAttribute(c.CUSTOM_DOMAIN,t):this.removeAttribute(c.CUSTOM_DOMAIN))}get drmToken(){var t;return(t=this.getAttribute(c.DRM_TOKEN))!=null?t:void 0}set drmToken(t){t!==this.drmToken&&(t?this.setAttribute(c.DRM_TOKEN,t):this.removeAttribute(c.DRM_TOKEN))}get ended(){return(0,f.getEnded)(this.nativeEl,this._hls)}get envKey(){var t;return(t=this.getAttribute(c.ENV_KEY))!=null?t:void 0}set envKey(t){t!==this.envKey&&(t?this.setAttribute(c.ENV_KEY,t):this.removeAttribute(c.ENV_KEY))}get beaconCollectionDomain(){var t;return(t=this.getAttribute(c.BEACON_COLLECTION_DOMAIN))!=null?t:void 0}set beaconCollectionDomain(t){t!==this.beaconCollectionDomain&&(t?this.setAttribute(c.BEACON_COLLECTION_DOMAIN,t):this.removeAttribute(c.BEACON_COLLECTION_DOMAIN))}get streamType(){var t;return(t=this.getAttribute(c.STREAM_TYPE))!=null?t:(0,f.getStreamType)(this.nativeEl)}set streamType(t){t!==this.streamType&&(t?this.setAttribute(c.STREAM_TYPE,t):this.removeAttribute(c.STREAM_TYPE))}get targetLiveWindow(){return this.hasAttribute(c.TARGET_LIVE_WINDOW)?+this.getAttribute(c.TARGET_LIVE_WINDOW):(0,f.getTargetLiveWindow)(this.nativeEl)}set targetLiveWindow(t){t!=this.targetLiveWindow&&(t==null?this.removeAttribute(c.TARGET_LIVE_WINDOW):this.setAttribute(c.TARGET_LIVE_WINDOW,`${+t}`))}get liveEdgeStart(){var t,s;if(this.hasAttribute(c.LIVE_EDGE_OFFSET)){let{liveEdgeOffset:n}=this,l=(t=this.nativeEl.seekable.end(0))!=null?t:0,p=(s=this.nativeEl.seekable.start(0))!=null?s:0;return Math.max(p,l-n)}return(0,f.getLiveEdgeStart)(this.nativeEl)}get liveEdgeOffset(){if(this.hasAttribute(c.LIVE_EDGE_OFFSET))return+this.getAttribute(c.LIVE_EDGE_OFFSET)}set liveEdgeOffset(t){t!=this.targetLiveWindow&&(t==null?this.removeAttribute(c.LIVE_EDGE_OFFSET):this.setAttribute(c.LIVE_EDGE_OFFSET,`${+t}`))}get seekable(){return(0,f.getSeekable)(this.nativeEl)}async addCuePoints(t){return(0,f.addCuePoints)(this.nativeEl,t)}get activeCuePoint(){return(0,f.getActiveCuePoint)(this.nativeEl)}get cuePoints(){return(0,f.getCuePoints)(this.nativeEl)}async addChapters(t){return(0,f.addChapters)(this.nativeEl,t)}get activeChapter(){return(0,f.getActiveChapter)(this.nativeEl)}get chapters(){return(0,f.getChapters)(this.nativeEl)}getStartDate(){return(0,f.getStartDate)(this.nativeEl,this._hls)}get currentPdt(){return(0,f.getCurrentPdt)(this.nativeEl,this._hls)}get preferPlayback(){let t=this.getAttribute(c.PREFER_PLAYBACK);if(t===f.PlaybackTypes.MSE||t===f.PlaybackTypes.NATIVE)return t}set preferPlayback(t){t!==this.preferPlayback&&(t===f.PlaybackTypes.MSE||t===f.PlaybackTypes.NATIVE?this.setAttribute(c.PREFER_PLAYBACK,t):this.removeAttribute(c.PREFER_PLAYBACK))}get metadata(){return{...this.getAttributeNames().filter(s=>s.startsWith("metadata-")&&![c.METADATA_URL].includes(s)).reduce((s,n)=>{let l=this.getAttribute(n);return l!=null&&(s[n.replace(/^metadata-/,"").replace(/-/g,"_")]=l),s},{}),...r(this,It)}}set metadata(t){h(this,It,t!=null?t:{}),this.mux&&this.mux.emit("hb",r(this,It))}get _hlsConfig(){return r(this,Yt)}set _hlsConfig(t){h(this,Yt,t)}load(){h(this,w,(0,f.initialize)(this,this.nativeEl,r(this,w)))}unload(){(0,f.teardown)(this.nativeEl,r(this,w)),h(this,w,void 0)}attributeChangedCallback(t,s,n){var p,a;switch(ee.observedAttributes.includes(t)&&!["src","autoplay","preload"].includes(t)&&super.attributeChangedCallback(t,s,n),t){case c.PLAYER_SOFTWARE_NAME:this.playerSoftwareName=n!=null?n:void 0;break;case c.PLAYER_SOFTWARE_VERSION:this.playerSoftwareVersion=n!=null?n:void 0;break;case"src":{let v=!!s,O=!!n;!v&&O?k(this,Lt,ge).call(this):v&&!O?this.unload():v&&O&&(this.unload(),k(this,Lt,ge).call(this));break}case"autoplay":if(n===s)break;(p=r(this,w))==null||p.setAutoplay(this.autoplay);break;case"preload":if(n===s)break;(a=r(this,w))==null||a.setPreload(n);break;case c.PLAYBACK_ID:this.src=(0,f.toMuxVideoURL)(this);break;case c.DEBUG:{let v=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=v);break}case c.METADATA_URL:n&&fetch(n).then(v=>v.json()).then(v=>this.metadata=v).catch(()=>console.error(`Unable to load or parse metadata JSON from metadata-url ${n}!`));break;case c.STREAM_TYPE:(n==null||n!==s)&&this.dispatchEvent(new CustomEvent("streamtypechange",{composed:!0,bubbles:!0}));break;case c.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,w)&&k(this,Lt,ge).call(this)}disconnectedCallback(){this.unload()}};w=new WeakMap,_t=new WeakMap,Kt=new WeakMap,It=new WeakMap,Yt=new WeakMap,Ht=new WeakMap,$t=new WeakMap,zt=new WeakMap,Lt=new WeakSet,ge=async function(){r(this,_t)||(await h(this,_t,Promise.resolve()),h(this,_t,null),this.load())};var Xt,Wt=class extends $e(oi(Oe)){constructor(){super(...arguments);u(this,Xt,void 0)}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,Xt))!=null?t:this.muxCastCustomData}set castCustomData(t){h(this,Xt,t)}};Xt=new WeakMap;Zt.customElements.get("mux-video")||(Zt.customElements.define("mux-video",Wt),Zt.MuxVideoElement=Wt);var Ii=Wt; | ||
`}var we=(e,{tag:i,is:t})=>{var l,p,a,v,O,xe,pt,D,o,m,ot,x,Te,M,De,P,Ne;let s=(p=(l=globalThis.document)==null?void 0:l.createElement)==null?void 0:p.call(l,i,{is:t}),n=s?Ai(s):[];return a=class extends e{constructor(){super();u(this,m);u(this,x);u(this,M);u(this,P);u(this,pt,void 0);u(this,D,void 0);u(this,o,new Map)}static get observedAttributes(){var E,y,I;return k(E=a,O,xe).call(E),[...(I=(y=s==null?void 0:s.constructor)==null?void 0:y.observedAttributes)!=null?I:[],"autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"]}get nativeEl(){var g,E,y;return k(this,m,ot).call(this),(y=(E=(g=r(this,D))!=null?g:this.shadowRoot.querySelector(i))!=null?E:this.querySelector(":scope > [slot=media]"))!=null?y:this.querySelector(i)}set nativeEl(g){h(this,D,g)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(g){this.toggleAttribute("muted",!!g)}get src(){return this.getAttribute("src")}set src(g){this.setAttribute("src",`${g}`)}get preload(){var g,E;return(E=this.getAttribute("preload"))!=null?E:(g=this.nativeEl)==null?void 0:g.preload}set preload(g){this.setAttribute("preload",`${g}`)}init(){var g,E;if(!this.shadowRoot){this.attachShadow({mode:"open"});let y=ki(this.attributes);t&&(y.is=t),i&&(y.part=i),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(y)}this.nativeEl.muted=this.hasAttribute("muted");for(let y of n)k(this,M,De).call(this,y);this.shadowRoot.addEventListener("slotchange",this),k(this,x,Te).call(this);for(let y of this.constructor.Events)(E=(g=this.shadowRoot).addEventListener)==null||E.call(g,y,this,!0)}handleEvent(g){if(g.type==="slotchange"){k(this,x,Te).call(this);return}g.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(g.type,{detail:g.detail}))}attributeChangedCallback(g,E,y){k(this,m,ot).call(this),k(this,P,Ne).call(this,g,E,y)}connectedCallback(){k(this,m,ot).call(this)}},v=new WeakMap,O=new WeakSet,xe=function(){if(r(this,v))return;h(this,v,!0);let g=new Set(this.observedAttributes);g.delete("muted");for(let E of n){if(E in this.prototype)continue;if(typeof s[E]=="function")this.prototype[E]=function(...I){return k(this,m,ot).call(this),this.call?this.call(E,...I):this.nativeEl[E].apply(this.nativeEl,I)};else{let I={get(){var V,Mt,wt;k(this,m,ot).call(this);let _=E.toLowerCase();if(g.has(_)){let Et=this.getAttribute(_);return Et===null?!1:Et===""?!0:Et}return(wt=(V=this.get)==null?void 0:V.call(this,E))!=null?wt:(Mt=this.nativeEl)==null?void 0:Mt[E]}};E!==E.toUpperCase()&&(I.set=function(_){k(this,m,ot).call(this);let V=E.toLowerCase();if(g.has(V)){_===!0||_===!1||_==null?this.toggleAttribute(V,!!_):this.setAttribute(V,_);return}if(this.set){this.set(E,_);return}this.nativeEl[E]=_}),Object.defineProperty(this.prototype,E,I)}}},pt=new WeakMap,D=new WeakMap,o=new WeakMap,m=new WeakSet,ot=function(){r(this,pt)||(h(this,pt,!0),this.init())},x=new WeakSet,Te=function(){let g=new Map(r(this,o));this.shadowRoot.querySelector("slot:not([name])").assignedElements({flatten:!0}).filter(E=>["track","source"].includes(E.localName)).forEach(E=>{var I,_;g.delete(E);let y=r(this,o).get(E);y||(y=E.cloneNode(),r(this,o).set(E,y)),(_=(I=this.nativeEl).append)==null||_.call(I,y),y.localName==="track"&&y.default&&(y.kind==="chapters"||y.kind==="metadata")&&y.track.mode==="disabled"&&(y.track.mode="hidden")}),g.forEach(E=>E.remove())},M=new WeakSet,De=function(g){if(Object.prototype.hasOwnProperty.call(this,g)){let E=this[g];delete this[g],this[g]=E}},P=new WeakSet,Ne=function(g,E,y){var I,_,V,Mt,wt,Et;["id","class"].includes(g)||!a.observedAttributes.includes(g)&&this.constructor.observedAttributes.includes(g)||(y===null?(_=(I=this.nativeEl).removeAttribute)==null||_.call(I,g):((Mt=(V=this.nativeEl).getAttribute)==null?void 0:Mt.call(V,g))!=y&&((Et=(wt=this.nativeEl).setAttribute)==null||Et.call(wt,g,y)))},u(a,O),b(a,"getTemplateHTML",i.endsWith("audio")?Ti:yi),b(a,"shadowRootOptions",{mode:"open"}),b(a,"Events",te),u(a,v,void 0),a};function Ai(e){let i=[];for(let t=Object.getPrototypeOf(e);t&&t!==HTMLElement.prototype;t=Object.getPrototypeOf(t))i.push(...Object.getOwnPropertyNames(t));return i}function Ve(e){let i="";for(let t in e){let s=e[t];s===""?i+=` ${t}`:i+=` ${t}="${s}"`}return i}function ki(e){let i={};for(let t of e)i[t.name]=t.value;return i}var Le,ee=we((Le=globalThis.HTMLElement)!=null?Le:class{},{tag:"video"}),Me,Gi=we((Me=globalThis.HTMLElement)!=null?Me:class{},{tag:"audio"});var G=new WeakMap,vt=class extends Error{},ie=class extends Error{};var 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 qe(){return globalThis.chrome}function Be(){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 W(){var e,i;return(i=(e=globalThis.cast)==null?void 0:e.framework)==null?void 0:i.CastContext.getInstance()}function Nt(){var e;return(e=W())==null?void 0:e.getCurrentSession()}function re(){var e;return(e=Nt())==null?void 0:e.getSessionObj().media[0]}function Ue(e){return new Promise((i,t)=>{re().editTracksInfo(e,i,t)})}function je(e){return new Promise((i,t)=>{re().getStatus(e,i,t)})}function ye(e){return W().setOptions({...Ae(),...e})}function Ae(){return{receiverApplicationId:"CC1AD845",autoJoinPolicy:"origin_scoped",androidReceiverCompatible:!1,language:"en-US",resumeSavedSession:!0}}var se=new Ge,K=new WeakSet,C;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}C||(C=cast.framework,W().addEventListener(C.CastContextEventType.CAST_STATE_CHANGED,n=>{se.forEach(l=>{var p,a;return(a=(p=G.get(l)).onCastStateChanged)==null?void 0:a.call(p,n)})}),W().addEventListener(C.CastContextEventType.SESSION_STATE_CHANGED,n=>{se.forEach(l=>{var p,a;return(a=(p=G.get(l)).onSessionStateChanged)==null?void 0:a.call(p,n)})}),se.forEach(n=>{var l,p;return(p=(l=G.get(n)).init)==null?void 0:p.call(l)}))});var We=0,A,Vt,L,F,dt,ct,Y,oe,q,at,ae,Ke,Gt,ke,de,Ye,Ft,Re,ce,He,qt,Se,ne=class extends EventTarget{constructor(t){super();u(this,q);u(this,ae);u(this,Gt);u(this,de);u(this,Ft);u(this,ce);u(this,qt);u(this,A,void 0);u(this,Vt,void 0);u(this,L,void 0);u(this,F,void 0);u(this,dt,"disconnected");u(this,ct,!1);u(this,Y,new Set);u(this,oe,new WeakMap);h(this,A,t),se.add(this),G.set(this,{init:()=>k(this,Ft,Re).call(this),onCastStateChanged:()=>k(this,Gt,ke).call(this),onSessionStateChanged:()=>k(this,de,Ye).call(this),getCastPlayer:()=>r(this,q,at)}),k(this,Ft,Re).call(this)}get state(){return r(this,dt)}async watchAvailability(t){if(r(this,A).disableRemotePlayback)throw new vt("disableRemotePlayback attribute is present.");return r(this,oe).set(t,++We),r(this,Y).add(t),We}async cancelWatchAvailability(t){if(r(this,A).disableRemotePlayback)throw new vt("disableRemotePlayback attribute is present.");t?r(this,Y).delete(t):r(this,Y).clear()}async prompt(){var s,n,l,p;if(r(this,A).disableRemotePlayback)throw new vt("disableRemotePlayback attribute is present.");if(!((n=(s=globalThis.chrome)==null?void 0:s.cast)!=null&&n.isAvailable))throw new ie("The RemotePlayback API is disabled on this platform.");let t=K.has(r(this,A));K.add(r(this,A)),ye(r(this,A).castOptions),Object.entries(r(this,F)).forEach(([a,v])=>{r(this,L).controller.addEventListener(a,v)});try{await W().requestSession()}catch(a){if(a==="cancel"){t||K.delete(r(this,A));return}throw new Error(a)}(p=(l=G.get(r(this,A)))==null?void 0:l.loadOnPrompt)==null||p.call(l)}};A=new WeakMap,Vt=new WeakMap,L=new WeakMap,F=new WeakMap,dt=new WeakMap,ct=new WeakMap,Y=new WeakMap,oe=new WeakMap,q=new WeakSet,at=function(){if(K.has(r(this,A)))return r(this,L)},ae=new WeakSet,Ke=function(){K.has(r(this,A))&&(Object.entries(r(this,F)).forEach(([t,s])=>{r(this,L).controller.removeEventListener(t,s)}),K.delete(r(this,A)),r(this,A).muted=r(this,L).isMuted,r(this,A).currentTime=r(this,L).savedPlayerState.currentTime,r(this,L).savedPlayerState.isPaused===!1&&r(this,A).play())},Gt=new WeakSet,ke=function(){let t=W().getCastState();if(K.has(r(this,A))&&t==="CONNECTING"&&(h(this,dt,"connecting"),this.dispatchEvent(new Event("connecting"))),!r(this,ct)&&(t!=null&&t.includes("CONNECT"))){h(this,ct,!0);for(let s of r(this,Y))s(!0)}else if(r(this,ct)&&(!t||t==="NO_DEVICES_AVAILABLE")){h(this,ct,!1);for(let s of r(this,Y))s(!1)}},de=new WeakSet,Ye=async function(){var s;let{SESSION_RESUMED:t}=C.SessionState;if(W().getSessionState()===t&&r(this,A).castSrc===((s=re())==null?void 0:s.media.contentId)){K.add(r(this,A)),Object.entries(r(this,F)).forEach(([n,l])=>{r(this,L).controller.addEventListener(n,l)});try{await je(new chrome.cast.media.GetStatusRequest)}catch(n){console.error(n)}r(this,F)[C.RemotePlayerEventType.IS_PAUSED_CHANGED](),r(this,F)[C.RemotePlayerEventType.PLAYER_STATE_CHANGED]()}},Ft=new WeakSet,Re=function(){!C||r(this,Vt)||(h(this,Vt,!0),ye(r(this,A).castOptions),r(this,A).textTracks.addEventListener("change",()=>k(this,qt,Se).call(this)),k(this,Gt,ke).call(this),h(this,L,new C.RemotePlayer),new C.RemotePlayerController(r(this,L)),h(this,F,{[C.RemotePlayerEventType.IS_CONNECTED_CHANGED]:({value:t})=>{t===!0?(h(this,dt,"connected"),this.dispatchEvent(new Event("connect"))):(k(this,ae,Ke).call(this),h(this,dt,"disconnected"),this.dispatchEvent(new Event("disconnect")))},[C.RemotePlayerEventType.DURATION_CHANGED]:()=>{r(this,A).dispatchEvent(new Event("durationchange"))},[C.RemotePlayerEventType.VOLUME_LEVEL_CHANGED]:()=>{r(this,A).dispatchEvent(new Event("volumechange"))},[C.RemotePlayerEventType.IS_MUTED_CHANGED]:()=>{r(this,A).dispatchEvent(new Event("volumechange"))},[C.RemotePlayerEventType.CURRENT_TIME_CHANGED]:()=>{var t;(t=r(this,q,at))!=null&&t.isMediaLoaded&&r(this,A).dispatchEvent(new Event("timeupdate"))},[C.RemotePlayerEventType.VIDEO_INFO_CHANGED]:()=>{r(this,A).dispatchEvent(new Event("resize"))},[C.RemotePlayerEventType.IS_PAUSED_CHANGED]:()=>{r(this,A).dispatchEvent(new Event(this.paused?"pause":"play"))},[C.RemotePlayerEventType.PLAYER_STATE_CHANGED]:()=>{var t,s;((t=r(this,q,at))==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,q,at))==null?void 0:s.playerState]))},[C.RemotePlayerEventType.IS_MEDIA_LOADED_CHANGED]:async()=>{var t;(t=r(this,q,at))!=null&&t.isMediaLoaded&&(await Promise.resolve(),k(this,ce,He).call(this))}}))},ce=new WeakSet,He=function(){k(this,qt,Se).call(this)},qt=new WeakSet,Se=async function(){var D,o,m,S,x;if(!r(this,q,at))return;let s=((o=(D=r(this,L).mediaInfo)==null?void 0:D.tracks)!=null?o:[]).filter(({type:R})=>R===chrome.cast.media.TrackType.TEXT),n=[...r(this,A).textTracks].filter(({kind:R})=>R==="subtitles"||R==="captions"),l=s.map(({language:R,name:M,trackId:gt})=>{var nt;let{mode:P}=(nt=n.find(N=>N.language===R&&N.label===M))!=null?nt:{};return P?{mode:P,trackId:gt}:!1}).filter(Boolean),a=l.filter(({mode:R})=>R!=="showing").map(({trackId:R})=>R),v=l.find(({mode:R})=>R==="showing"),O=(x=(S=(m=Nt())==null?void 0:m.getSessionObj().media[0])==null?void 0:S.activeTrackIds)!=null?x:[],j=O;if(O.length&&(j=j.filter(R=>!a.includes(R))),v!=null&&v.trackId&&(j=[...j,v.trackId]),j=[...new Set(j)],!((R,M)=>R.length===M.length&&R.every(gt=>M.includes(gt)))(O,j))try{let R=new chrome.cast.media.EditTracksInfoRequest(j);await Ue(R)}catch(R){console.error(R)}};var $e=e=>{var i,t,s,n,l,p,a,T,O,ze;return t=class extends e{constructor(){super(...arguments);u(this,a);u(this,O);u(this,s,{paused:!1});u(this,n,Ae());u(this,l,void 0);u(this,p,void 0)}get remote(){return r(this,p)?r(this,p):qe()?(Be(),G.set(this,{loadOnPrompt:()=>k(this,O,ze).call(this)}),h(this,p,new ne(this))):super.remote}attributeChangedCallback(o,m,S){if(super.attributeChangedCallback(o,m,S),o==="cast-receiver"&&S){r(this,n).receiverApplicationId=S;return}if(r(this,a,T))switch(o){case"cast-stream-type":case"cast-src":this.load();break}}async load(){var M,gt;if(!r(this,a,T))return super.load();let o=new chrome.cast.media.MediaInfo(this.castSrc,this.castContentType);o.customData=this.castCustomData;let m=[...this.querySelectorAll("track")].filter(({kind:P,src:nt})=>nt&&(P==="subtitles"||P==="captions")),S=[],x=0;m.length&&(o.tracks=m.map(P=>{let nt=++x;S.length===0&&P.track.mode==="showing"&&S.push(nt);let N=new chrome.cast.media.Track(nt,chrome.cast.media.TrackType.TEXT);return N.trackContentId=P.src,N.trackContentType="text/vtt",N.subtype=P.kind==="captions"?chrome.cast.media.TextTrackType.CAPTIONS:chrome.cast.media.TextTrackType.SUBTITLES,N.name=P.label,N.language=P.srclang,N})),this.castStreamType==="live"?o.streamType=chrome.cast.media.StreamType.LIVE:o.streamType=chrome.cast.media.StreamType.BUFFERED,o.metadata=new chrome.cast.media.GenericMediaMetadata,o.metadata.title=this.title,o.metadata.images=[{url:this.poster}];let R=new chrome.cast.media.LoadRequest(o);R.currentTime=(M=super.currentTime)!=null?M:0,R.autoplay=!r(this,s).paused,R.activeTrackIds=S,await((gt=Nt())==null?void 0:gt.loadMedia(R)),this.dispatchEvent(new Event("volumechange"))}play(){var o;if(r(this,a,T)){r(this,a,T).isPaused&&((o=r(this,a,T).controller)==null||o.playOrPause());return}return super.play()}pause(){var o;if(r(this,a,T)){r(this,a,T).isPaused||(o=r(this,a,T).controller)==null||o.playOrPause();return}super.pause()}get castOptions(){return r(this,n)}get castReceiver(){var o;return(o=this.getAttribute("cast-receiver"))!=null?o:void 0}set castReceiver(o){this.castReceiver!=o&&this.setAttribute("cast-receiver",`${o}`)}get castSrc(){var o,m,S;return(S=(m=this.getAttribute("cast-src"))!=null?m:(o=this.querySelector("source"))==null?void 0:o.src)!=null?S:this.currentSrc}set castSrc(o){this.castSrc!=o&&this.setAttribute("cast-src",`${o}`)}get castContentType(){var o;return(o=this.getAttribute("cast-content-type"))!=null?o:void 0}set castContentType(o){this.setAttribute("cast-content-type",`${o}`)}get castStreamType(){var o,m;return(m=(o=this.getAttribute("cast-stream-type"))!=null?o:this.streamType)!=null?m:void 0}set castStreamType(o){this.setAttribute("cast-stream-type",`${o}`)}get castCustomData(){return r(this,l)}set castCustomData(o){let m=typeof o;if(!["object","undefined"].includes(m)){console.error(`castCustomData must be nullish or an object but value was of type ${m}`);return}h(this,l,o)}get readyState(){if(r(this,a,T))switch(r(this,a,T).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,a,T)?r(this,a,T).isPaused:super.paused}get muted(){var o;return r(this,a,T)?(o=r(this,a,T))==null?void 0:o.isMuted:super.muted}set muted(o){var m;if(r(this,a,T)){(o&&!r(this,a,T).isMuted||!o&&r(this,a,T).isMuted)&&((m=r(this,a,T).controller)==null||m.muteOrUnmute());return}super.muted=o}get volume(){var o,m;return r(this,a,T)?(m=(o=r(this,a,T))==null?void 0:o.volumeLevel)!=null?m:1:super.volume}set volume(o){var m;if(r(this,a,T)){r(this,a,T).volumeLevel=+o,(m=r(this,a,T).controller)==null||m.setVolumeLevel();return}super.volume=o}get duration(){var o,m,S;return r(this,a,T)&&((o=r(this,a,T))!=null&&o.isMediaLoaded)?(S=(m=r(this,a,T))==null?void 0:m.duration)!=null?S:NaN:super.duration}get currentTime(){var o,m,S;return r(this,a,T)&&((o=r(this,a,T))!=null&&o.isMediaLoaded)?(S=(m=r(this,a,T))==null?void 0:m.currentTime)!=null?S:0:super.currentTime}set currentTime(o){var m;if(r(this,a,T)){r(this,a,T).currentTime=o,(m=r(this,a,T).controller)==null||m.seek();return}super.currentTime=o}},s=new WeakMap,n=new WeakMap,l=new WeakMap,p=new WeakMap,a=new WeakSet,T=function(){var o,m;return(m=(o=G.get(this.remote))==null?void 0:o.getCastPlayer)==null?void 0:m.call(o)},O=new WeakSet,ze=async function(){r(this,s).paused=Qt(t.prototype,this,"paused"),Qt(t.prototype,this,"pause").call(this),this.muted=Qt(t.prototype,this,"muted");try{await this.load()}catch(o){console.error(o)}},b(t,"observedAttributes",[...(i=e.observedAttributes)!=null?i:[],"cast-src","cast-content-type","cast-stream-type","cast-receiver"]),t};var B=class extends Event{constructor(t,s){super(t);b(this,"track");this.track=s.track}};var Ce=new WeakMap;function d(e){var i;return(i=Ce.get(e))!=null?i:Ri(e,{})}function Ri(e,i){let t=Ce.get(e);return t||Ce.set(e,t={}),Object.assign(t,i)}function ue(e,i){let t=e.videoTracks;d(i).media=e,d(i).renditionSet||(d(i).renditionSet=new Set);let s=d(t).trackSet;s.add(i);let n=s.size-1;n in ht.prototype||Object.defineProperty(ht.prototype,n,{get(){return[...d(this).trackSet][n]}}),queueMicrotask(()=>{t.dispatchEvent(new B("addtrack",{track:i}))})}function he(e){var s;let i=(s=d(e).media)==null?void 0:s.videoTracks;if(!i)return;d(i).trackSet.delete(e),queueMicrotask(()=>{i.dispatchEvent(new B("removetrack",{track:e}))})}function Xe(e){var s;let i=(s=d(e).media.videoTracks)!=null?s:[],t=!1;for(let n of i)n!==e&&(n.selected=!1,t=!0);if(t){if(d(i).changeRequested)return;d(i).changeRequested=!0,queueMicrotask(()=>{delete d(i).changeRequested,i.dispatchEvent(new Event("change"))})}}var H,$,z,ut,Bt,ht=class extends EventTarget{constructor(){super();u(this,ut);u(this,H,void 0);u(this,$,void 0);u(this,z,void 0);d(this).trackSet=new Set}[Symbol.iterator](){return r(this,ut,Bt).values()}get length(){return r(this,ut,Bt).size}getTrackById(t){var s;return(s=[...r(this,ut,Bt)].find(n=>n.id===t))!=null?s:null}get selectedIndex(){return[...r(this,ut,Bt)].findIndex(t=>t.selected)}get onaddtrack(){return r(this,H)}set onaddtrack(t){r(this,H)&&(this.removeEventListener("addtrack",r(this,H)),h(this,H,void 0)),typeof t=="function"&&(h(this,H,t),this.addEventListener("addtrack",t))}get onremovetrack(){return r(this,$)}set onremovetrack(t){r(this,$)&&(this.removeEventListener("removetrack",r(this,$)),h(this,$,void 0)),typeof t=="function"&&(h(this,$,t),this.addEventListener("removetrack",t))}get onchange(){return r(this,z)}set onchange(t){r(this,z)&&(this.removeEventListener("change",r(this,z)),h(this,z,void 0)),typeof t=="function"&&(h(this,z,t),this.addEventListener("change",t))}};H=new WeakMap,$=new WeakMap,z=new WeakMap,ut=new WeakSet,Bt=function(){return d(this).trackSet};var U=class extends Event{constructor(t,s){super(t);b(this,"rendition");this.rendition=s.rendition}};function Je(e,i){let t=d(e).media.videoRenditions;d(i).media=d(e).media,d(i).track=e;let s=d(e).renditionSet;s.add(i);let n=s.size-1;n in lt.prototype||Object.defineProperty(lt.prototype,n,{get(){return Tt(this)[n]}}),queueMicrotask(()=>{e.selected&&t.dispatchEvent(new U("addrendition",{rendition:i}))})}function Qe(e){let i=d(e).media.videoRenditions,t=d(e).track;d(t).renditionSet.delete(e),queueMicrotask(()=>{d(e).track.selected&&i.dispatchEvent(new U("removerendition",{rendition:e}))})}function Ze(e){let i=d(e).media.videoRenditions;!i||d(i).changeRequested||(d(i).changeRequested=!0,queueMicrotask(()=>{delete d(i).changeRequested,d(e).track.selected&&i.dispatchEvent(new Event("change"))}))}function Tt(e){return[...d(e).media.videoTracks].filter(t=>t.selected).flatMap(t=>[...d(t).renditionSet])}var X,J,Q,lt=class extends EventTarget{constructor(){super(...arguments);u(this,X,void 0);u(this,J,void 0);u(this,Q,void 0)}[Symbol.iterator](){return Tt(this).values()}get length(){return Tt(this).length}getRenditionById(t){var s;return(s=Tt(this).find(n=>`${n.id}`==`${t}`))!=null?s:null}get selectedIndex(){return Tt(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[s,n]of Tt(this).entries())n.selected=s===t}get onaddrendition(){return r(this,X)}set onaddrendition(t){r(this,X)&&(this.removeEventListener("addrendition",r(this,X)),h(this,X,void 0)),typeof t=="function"&&(h(this,X,t),this.addEventListener("addrendition",t))}get onremoverendition(){return r(this,J)}set onremoverendition(t){r(this,J)&&(this.removeEventListener("removerendition",r(this,J)),h(this,J,void 0)),typeof t=="function"&&(h(this,J,t),this.addEventListener("removerendition",t))}get onchange(){return r(this,Q)}set onchange(t){r(this,Q)&&(this.removeEventListener("change",r(this,Q)),h(this,Q,void 0)),typeof t=="function"&&(h(this,Q,t),this.addEventListener("change",t))}};X=new WeakMap,J=new WeakMap,Q=new WeakMap;var yt,Ut=class{constructor(){b(this,"src");b(this,"id");b(this,"width");b(this,"height");b(this,"bitrate");b(this,"frameRate");b(this,"codec");u(this,yt,!1)}get selected(){return r(this,yt)}set selected(i){r(this,yt)!==i&&(h(this,yt,i),Ze(this))}};yt=new WeakMap;var At,kt=class{constructor(){b(this,"id");b(this,"kind");b(this,"label","");b(this,"language","");b(this,"sourceBuffer");u(this,At,!1)}addRendition(i,t,s,n,l,p){let a=new Ut;return a.src=i,a.width=t,a.height=s,a.frameRate=p,a.bitrate=l,a.codec=n,Je(this,a),a}removeRendition(i){Qe(i)}get selected(){return r(this,At)}set selected(i){r(this,At)!==i&&(h(this,At,i),i===!0&&Xe(this))}};At=new WeakMap;function ti(e,i){let t=d(e).media.audioRenditions;d(i).media=d(e).media,d(i).track=e;let s=d(e).renditionSet;s.add(i);let n=s.size-1;n in ft.prototype||Object.defineProperty(ft.prototype,n,{get(){return Rt(this)[n]}}),queueMicrotask(()=>{e.enabled&&t.dispatchEvent(new U("addrendition",{rendition:i}))})}function ei(e){let i=d(e).media.audioRenditions,t=d(e).track;d(t).renditionSet.delete(e),queueMicrotask(()=>{d(e).track.enabled&&i.dispatchEvent(new U("removerendition",{rendition:e}))})}function ii(e){let i=d(e).media.audioRenditions;!i||d(i).changeRequested||(d(i).changeRequested=!0,queueMicrotask(()=>{delete d(i).changeRequested,d(e).track.enabled&&i.dispatchEvent(new Event("change"))}))}function Rt(e){return[...d(e).media.audioTracks].filter(t=>t.enabled).flatMap(t=>[...d(t).renditionSet])}var Z,tt,et,ft=class extends EventTarget{constructor(){super(...arguments);u(this,Z,void 0);u(this,tt,void 0);u(this,et,void 0)}[Symbol.iterator](){return Rt(this).values()}get length(){return Rt(this).length}getRenditionById(t){var s;return(s=Rt(this).find(n=>`${n.id}`==`${t}`))!=null?s:null}get selectedIndex(){return Rt(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[s,n]of Rt(this).entries())n.selected=s===t}get onaddrendition(){return r(this,Z)}set onaddrendition(t){r(this,Z)&&(this.removeEventListener("addrendition",r(this,Z)),h(this,Z,void 0)),typeof t=="function"&&(h(this,Z,t),this.addEventListener("addrendition",t))}get onremoverendition(){return r(this,tt)}set onremoverendition(t){r(this,tt)&&(this.removeEventListener("removerendition",r(this,tt)),h(this,tt,void 0)),typeof t=="function"&&(h(this,tt,t),this.addEventListener("removerendition",t))}get onchange(){return r(this,et)}set onchange(t){r(this,et)&&(this.removeEventListener("change",r(this,et)),h(this,et,void 0)),typeof t=="function"&&(h(this,et,t),this.addEventListener("change",t))}};Z=new WeakMap,tt=new WeakMap,et=new WeakMap;var St,jt=class{constructor(){b(this,"src");b(this,"id");b(this,"bitrate");b(this,"codec");u(this,St,!1)}get selected(){return r(this,St)}set selected(i){r(this,St)!==i&&(h(this,St,i),ii(this))}};St=new WeakMap;function fe(e,i){let t=e.audioTracks;d(i).media=e,d(i).renditionSet||(d(i).renditionSet=new Set);let s=d(t).trackSet;s.add(i);let n=s.size-1;n in mt.prototype||Object.defineProperty(mt.prototype,n,{get(){return[...d(this).trackSet][n]}}),queueMicrotask(()=>{t.dispatchEvent(new B("addtrack",{track:i}))})}function me(e){var s;let i=(s=d(e).media)==null?void 0:s.audioTracks;if(!i)return;d(i).trackSet.delete(e),queueMicrotask(()=>{i.dispatchEvent(new B("removetrack",{track:e}))})}function ri(e){let i=d(e).media.audioTracks;!i||d(i).changeRequested||(d(i).changeRequested=!0,queueMicrotask(()=>{delete d(i).changeRequested,i.dispatchEvent(new Event("change"))}))}var it,rt,st,Ct,le,mt=class extends EventTarget{constructor(){super();u(this,Ct);u(this,it,void 0);u(this,rt,void 0);u(this,st,void 0);d(this).trackSet=new Set}[Symbol.iterator](){return r(this,Ct,le).values()}get length(){return r(this,Ct,le).size}getTrackById(t){var s;return(s=[...r(this,Ct,le)].find(n=>n.id===t))!=null?s:null}get onaddtrack(){return r(this,it)}set onaddtrack(t){r(this,it)&&(this.removeEventListener("addtrack",r(this,it)),h(this,it,void 0)),typeof t=="function"&&(h(this,it,t),this.addEventListener("addtrack",t))}get onremovetrack(){return r(this,rt)}set onremovetrack(t){r(this,rt)&&(this.removeEventListener("removetrack",r(this,rt)),h(this,rt,void 0)),typeof t=="function"&&(h(this,rt,t),this.addEventListener("removetrack",t))}get onchange(){return r(this,st)}set onchange(t){r(this,st)&&(this.removeEventListener("change",r(this,st)),h(this,st,void 0)),typeof t=="function"&&(h(this,st,t),this.addEventListener("change",t))}};it=new WeakMap,rt=new WeakMap,st=new WeakMap,Ct=new WeakSet,le=function(){return d(this).trackSet};var Ot,_t=class{constructor(){b(this,"id");b(this,"kind");b(this,"label","");b(this,"language","");b(this,"sourceBuffer");u(this,Ot,!1)}addRendition(i,t,s){let n=new jt;return n.src=i,n.codec=t,n.bitrate=s,ti(this,n),n}removeRendition(i){ei(i)}get enabled(){return r(this,Ot)}set enabled(i){r(this,Ot)!==i&&(h(this,Ot,i),ri(this))}};Ot=new WeakMap;var si=pe(globalThis.HTMLMediaElement,"video"),ni=pe(globalThis.HTMLMediaElement,"audio");function oi(e){if(!(e!=null&&e.prototype))return e;let i=pe(e,"video");(!i||`${i}`.includes("[native code]"))&&Object.defineProperty(e.prototype,"videoTracks",{get(){return Si(this)}});let t=pe(e,"audio");(!t||`${t}`.includes("[native code]"))&&Object.defineProperty(e.prototype,"audioTracks",{get(){return Ci(this)}}),"addVideoTrack"in e.prototype||(e.prototype.addVideoTrack=function(l,p="",a=""){let v=new kt;return v.kind=l,v.label=p,v.language=a,ue(this,v),v}),"removeVideoTrack"in e.prototype||(e.prototype.removeVideoTrack=he),"addAudioTrack"in e.prototype||(e.prototype.addAudioTrack=function(l,p="",a=""){let v=new _t;return v.kind=l,v.label=p,v.language=a,fe(this,v),v}),"removeAudioTrack"in e.prototype||(e.prototype.removeAudioTrack=me),"videoRenditions"in e.prototype||Object.defineProperty(e.prototype,"videoRenditions",{get(){return s(this)}});let s=l=>{let p=d(l).videoRenditions;return p||(p=new lt,d(p).media=l,d(l).videoRenditions=p),p};"audioRenditions"in e.prototype||Object.defineProperty(e.prototype,"audioRenditions",{get(){return n(this)}});let n=l=>{let p=d(l).audioRenditions;return p||(p=new ft,d(p).media=l,d(l).audioRenditions=p),p};return e}function pe(e,i){var t;if(e!=null&&e.prototype)return(t=Object.getOwnPropertyDescriptor(e.prototype,`${i}Tracks`))==null?void 0:t.get}function Si(e){var t;let i=d(e).videoTracks;if(!i&&(i=new ht,d(e).videoTracks=i,si)){let s=si.call((t=e.nativeEl)!=null?t:e);for(let n of s)ue(e,n);s.addEventListener("change",()=>{i.dispatchEvent(new Event("change"))}),s.addEventListener("addtrack",n=>{if([...i].some(l=>l instanceof kt)){for(let l of s)he(l);return}ue(e,n.track)}),s.addEventListener("removetrack",n=>{he(n.track)})}return i}function Ci(e){var t;let i=d(e).audioTracks;if(!i&&(i=new mt,d(e).audioTracks=i,ni)){let s=ni.call((t=e.nativeEl)!=null?t:e);for(let n of s)fe(e,n);s.addEventListener("change",()=>{i.dispatchEvent(new Event("change"))}),s.addEventListener("addtrack",n=>{if([...i].some(l=>l instanceof _t)){for(let l of s)me(l);return}fe(e,n.track)}),s.addEventListener("removetrack",n=>{me(n.track)})}return i}te.push("castchange","entercast","leavecast");var c={BEACON_COLLECTION_DOMAIN:"beacon-collection-domain",CUSTOM_DOMAIN:"custom-domain",DEBUG:"debug",DISABLE_TRACKING:"disable-tracking",DISABLE_COOKIES:"disable-cookies",DRM_TOKEN:"drm-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",METADATA_URL:"metadata-url",PLAYBACK_ID:"playback-id",PLAYER_SOFTWARE_NAME:"player-software-name",PLAYER_SOFTWARE_VERSION:"player-software-version",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"},Oi=Object.values(c),_i=Ie(),Pi="mux-video",w,Pt,Kt,It,Yt,Ht,$t,zt,Lt,ge,Oe=class extends ee{constructor(){super();u(this,Lt);u(this,w,void 0);u(this,Pt,void 0);u(this,Kt,void 0);u(this,It,{});u(this,Yt,void 0);u(this,Ht,void 0);u(this,$t,void 0);u(this,zt,void 0);h(this,Kt,(0,f.generatePlayerInitTime)())}static get observedAttributes(){var t;return[...Oi,...(t=ee.observedAttributes)!=null?t:[]]}get preferCmcd(){var t;return(t=this.getAttribute(c.PREFER_CMCD))!=null?t:void 0}set preferCmcd(t){t!==this.preferCmcd&&(t?f.CmcdTypeValues.includes(t)?this.setAttribute(c.PREFER_CMCD,t):console.warn(`Invalid value for preferCmcd. Must be one of ${f.CmcdTypeValues.join()}`):this.removeAttribute(c.PREFER_CMCD))}get playerInitTime(){return r(this,Kt)}get playerSoftwareName(){var t;return(t=r(this,$t))!=null?t:Pi}set playerSoftwareName(t){h(this,$t,t)}get playerSoftwareVersion(){var t;return(t=r(this,Ht))!=null?t:_i}set playerSoftwareVersion(t){h(this,Ht,t)}get _hls(){var t;return(t=r(this,w))==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,f.getError)(this.nativeEl))!=null?t:null}get errorTranslator(){return r(this,zt)}set errorTranslator(t){h(this,zt,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(c.TYPE))!=null?t:void 0}set type(t){t!==this.type&&(t?this.setAttribute(c.TYPE,t):this.removeAttribute(c.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(c.DEBUG)!=null}set debug(t){t!==this.debug&&(t?this.setAttribute(c.DEBUG,""):this.removeAttribute(c.DEBUG))}get disableTracking(){return this.hasAttribute(c.DISABLE_TRACKING)}set disableTracking(t){t!==this.disableTracking&&this.toggleAttribute(c.DISABLE_TRACKING,!!t)}get disableCookies(){return this.hasAttribute(c.DISABLE_COOKIES)}set disableCookies(t){t!==this.disableCookies&&(t?this.setAttribute(c.DISABLE_COOKIES,""):this.removeAttribute(c.DISABLE_COOKIES))}get startTime(){let t=this.getAttribute(c.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(c.START_TIME):this.setAttribute(c.START_TIME,`${t}`))}get playbackId(){var t;return this.hasAttribute(c.PLAYBACK_ID)?this.getAttribute(c.PLAYBACK_ID):(t=(0,f.toPlaybackIdFromSrc)(this.src))!=null?t:void 0}set playbackId(t){t!==this.playbackId&&(t?this.setAttribute(c.PLAYBACK_ID,t):this.removeAttribute(c.PLAYBACK_ID))}get maxResolution(){var t;return(t=this.getAttribute(c.MAX_RESOLUTION))!=null?t:void 0}set maxResolution(t){t!==this.maxResolution&&(t?this.setAttribute(c.MAX_RESOLUTION,t):this.removeAttribute(c.MAX_RESOLUTION))}get minResolution(){var t;return(t=this.getAttribute(c.MIN_RESOLUTION))!=null?t:void 0}set minResolution(t){t!==this.minResolution&&(t?this.setAttribute(c.MIN_RESOLUTION,t):this.removeAttribute(c.MIN_RESOLUTION))}get renditionOrder(){var t;return(t=this.getAttribute(c.RENDITION_ORDER))!=null?t:void 0}set renditionOrder(t){t!==this.renditionOrder&&(t?this.setAttribute(c.RENDITION_ORDER,t):this.removeAttribute(c.RENDITION_ORDER))}get programStartTime(){let t=this.getAttribute(c.PROGRAM_START_TIME);if(t==null)return;let s=+t;return Number.isNaN(s)?void 0:s}set programStartTime(t){t==null?this.removeAttribute(c.PROGRAM_START_TIME):this.setAttribute(c.PROGRAM_START_TIME,`${t}`)}get programEndTime(){let t=this.getAttribute(c.PROGRAM_END_TIME);if(t==null)return;let s=+t;return Number.isNaN(s)?void 0:s}set programEndTime(t){t==null?this.removeAttribute(c.PROGRAM_END_TIME):this.setAttribute(c.PROGRAM_END_TIME,`${t}`)}get customDomain(){var t;return(t=this.getAttribute(c.CUSTOM_DOMAIN))!=null?t:void 0}set customDomain(t){t!==this.customDomain&&(t?this.setAttribute(c.CUSTOM_DOMAIN,t):this.removeAttribute(c.CUSTOM_DOMAIN))}get drmToken(){var t;return(t=this.getAttribute(c.DRM_TOKEN))!=null?t:void 0}set drmToken(t){t!==this.drmToken&&(t?this.setAttribute(c.DRM_TOKEN,t):this.removeAttribute(c.DRM_TOKEN))}get ended(){return(0,f.getEnded)(this.nativeEl,this._hls)}get envKey(){var t;return(t=this.getAttribute(c.ENV_KEY))!=null?t:void 0}set envKey(t){t!==this.envKey&&(t?this.setAttribute(c.ENV_KEY,t):this.removeAttribute(c.ENV_KEY))}get beaconCollectionDomain(){var t;return(t=this.getAttribute(c.BEACON_COLLECTION_DOMAIN))!=null?t:void 0}set beaconCollectionDomain(t){t!==this.beaconCollectionDomain&&(t?this.setAttribute(c.BEACON_COLLECTION_DOMAIN,t):this.removeAttribute(c.BEACON_COLLECTION_DOMAIN))}get streamType(){var t;return(t=this.getAttribute(c.STREAM_TYPE))!=null?t:(0,f.getStreamType)(this.nativeEl)}set streamType(t){t!==this.streamType&&(t?this.setAttribute(c.STREAM_TYPE,t):this.removeAttribute(c.STREAM_TYPE))}get targetLiveWindow(){return this.hasAttribute(c.TARGET_LIVE_WINDOW)?+this.getAttribute(c.TARGET_LIVE_WINDOW):(0,f.getTargetLiveWindow)(this.nativeEl)}set targetLiveWindow(t){t!=this.targetLiveWindow&&(t==null?this.removeAttribute(c.TARGET_LIVE_WINDOW):this.setAttribute(c.TARGET_LIVE_WINDOW,`${+t}`))}get liveEdgeStart(){var t,s;if(this.hasAttribute(c.LIVE_EDGE_OFFSET)){let{liveEdgeOffset:n}=this,l=(t=this.nativeEl.seekable.end(0))!=null?t:0,p=(s=this.nativeEl.seekable.start(0))!=null?s:0;return Math.max(p,l-n)}return(0,f.getLiveEdgeStart)(this.nativeEl)}get liveEdgeOffset(){if(this.hasAttribute(c.LIVE_EDGE_OFFSET))return+this.getAttribute(c.LIVE_EDGE_OFFSET)}set liveEdgeOffset(t){t!=this.targetLiveWindow&&(t==null?this.removeAttribute(c.LIVE_EDGE_OFFSET):this.setAttribute(c.LIVE_EDGE_OFFSET,`${+t}`))}get seekable(){return(0,f.getSeekable)(this.nativeEl)}async addCuePoints(t){return(0,f.addCuePoints)(this.nativeEl,t)}get activeCuePoint(){return(0,f.getActiveCuePoint)(this.nativeEl)}get cuePoints(){return(0,f.getCuePoints)(this.nativeEl)}async addChapters(t){return(0,f.addChapters)(this.nativeEl,t)}get activeChapter(){return(0,f.getActiveChapter)(this.nativeEl)}get chapters(){return(0,f.getChapters)(this.nativeEl)}getStartDate(){return(0,f.getStartDate)(this.nativeEl,this._hls)}get currentPdt(){return(0,f.getCurrentPdt)(this.nativeEl,this._hls)}get preferPlayback(){let t=this.getAttribute(c.PREFER_PLAYBACK);if(t===f.PlaybackTypes.MSE||t===f.PlaybackTypes.NATIVE)return t}set preferPlayback(t){t!==this.preferPlayback&&(t===f.PlaybackTypes.MSE||t===f.PlaybackTypes.NATIVE?this.setAttribute(c.PREFER_PLAYBACK,t):this.removeAttribute(c.PREFER_PLAYBACK))}get metadata(){return{...this.getAttributeNames().filter(s=>s.startsWith("metadata-")&&![c.METADATA_URL].includes(s)).reduce((s,n)=>{let l=this.getAttribute(n);return l!=null&&(s[n.replace(/^metadata-/,"").replace(/-/g,"_")]=l),s},{}),...r(this,It)}}set metadata(t){h(this,It,t!=null?t:{}),this.mux&&this.mux.emit("hb",r(this,It))}get _hlsConfig(){return r(this,Yt)}set _hlsConfig(t){h(this,Yt,t)}load(){h(this,w,(0,f.initialize)(this,this.nativeEl,r(this,w)))}unload(){(0,f.teardown)(this.nativeEl,r(this,w)),h(this,w,void 0)}attributeChangedCallback(t,s,n){var p,a;switch(ee.observedAttributes.includes(t)&&!["src","autoplay","preload"].includes(t)&&super.attributeChangedCallback(t,s,n),t){case c.PLAYER_SOFTWARE_NAME:this.playerSoftwareName=n!=null?n:void 0;break;case c.PLAYER_SOFTWARE_VERSION:this.playerSoftwareVersion=n!=null?n:void 0;break;case"src":{let v=!!s,O=!!n;!v&&O?k(this,Lt,ge).call(this):v&&!O?this.unload():v&&O&&(this.unload(),k(this,Lt,ge).call(this));break}case"autoplay":if(n===s)break;(p=r(this,w))==null||p.setAutoplay(this.autoplay);break;case"preload":if(n===s)break;(a=r(this,w))==null||a.setPreload(n);break;case c.PLAYBACK_ID:this.src=(0,f.toMuxVideoURL)(this);break;case c.DEBUG:{let v=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=v);break}case c.METADATA_URL:n&&fetch(n).then(v=>v.json()).then(v=>this.metadata=v).catch(()=>console.error(`Unable to load or parse metadata JSON from metadata-url ${n}!`));break;case c.STREAM_TYPE:(n==null||n!==s)&&this.dispatchEvent(new CustomEvent("streamtypechange",{composed:!0,bubbles:!0}));break;case c.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,w)&&k(this,Lt,ge).call(this)}disconnectedCallback(){this.unload()}};w=new WeakMap,Pt=new WeakMap,Kt=new WeakMap,It=new WeakMap,Yt=new WeakMap,Ht=new WeakMap,$t=new WeakMap,zt=new WeakMap,Lt=new WeakSet,ge=async function(){r(this,Pt)||(await h(this,Pt,Promise.resolve()),h(this,Pt,null),this.load())};var Xt,Wt=class extends $e(oi(Oe)){constructor(){super(...arguments);u(this,Xt,void 0)}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,Xt))!=null?t:this.muxCastCustomData}set castCustomData(t){h(this,Xt,t)}};Xt=new WeakMap;Zt.customElements.get("mux-video")||(Zt.customElements.define("mux-video",Wt),Zt.MuxVideoElement=Wt);var Ii=Wt; | ||
//# sourceMappingURL=index.cjs.js.map |
{ | ||
"inputs": { | ||
"src/polyfills/index.ts": { | ||
"bytes": 2117, | ||
"bytes": 2165, | ||
"imports": [ | ||
@@ -442,3 +442,3 @@ { | ||
"inputs": {}, | ||
"bytes": 2293092 | ||
"bytes": 2293122 | ||
}, | ||
@@ -456,3 +456,3 @@ "dist/mux-video.mjs": { | ||
"src/polyfills/index.ts": { | ||
"bytesInOutput": 764 | ||
"bytesInOutput": 788 | ||
}, | ||
@@ -526,5 +526,5 @@ "../../node_modules/mux-embed/dist/mux.mjs": { | ||
}, | ||
"bytes": 545138 | ||
"bytes": 545162 | ||
} | ||
} | ||
} |
@@ -1,2 +0,1 @@ | ||
/// <reference types="mux-embed/dist/types/mux-embed" /> | ||
import { MuxMediaProps, StreamTypes, PlaybackTypes, Metadata, MediaError, CmcdTypes } from '@mux/playback-core'; | ||
@@ -3,0 +2,0 @@ import { PlaybackEngine, Autoplay, ExtensionMimeTypeMap, ValueOf, MaxResolutionValue, MinResolutionValue, RenditionOrderValue, Chapter, CuePoint } from '@mux/playback-core'; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="mux-embed/dist/types/mux-embed" /> | ||
import { MuxMediaProps, StreamTypes, PlaybackTypes, Metadata, MediaError, CmcdTypes } from '@mux/playback-core'; | ||
@@ -3,0 +2,0 @@ import type { PlaybackEngine, Autoplay, ExtensionMimeTypeMap, ValueOf, MaxResolutionValue, MinResolutionValue, RenditionOrderValue, Chapter, CuePoint } from '@mux/playback-core'; |
{ | ||
"name": "@mux/mux-video", | ||
"version": "0.20.2-canary.0-8159569", | ||
"version": "0.20.2-canary.0-840a0be", | ||
"description": "A custom mux video element for the browser that Just Works™", | ||
@@ -48,3 +48,3 @@ "keywords": [ | ||
"clean": "shx rm -rf dist/ && shx rm -rf src/polyfills", | ||
"lint": "eslint src/ --ext .js,.jsx,.ts,.tsx", | ||
"lint": "ESLINT_USE_FLAT_CONFIG=false eslint src/ --ext .js,.jsx,.ts,.tsx", | ||
"test": "web-test-runner **/*test.js --port 8002 --coverage --config test/web-test-runner.config.mjs --root-dir ../..", | ||
@@ -70,3 +70,3 @@ "posttest": "replace 'SF:src/' 'SF:packages/mux-video/src/' coverage/lcov.info --silent", | ||
"dependencies": { | ||
"@mux/playback-core": "0.25.2-canary.0-8159569", | ||
"@mux/playback-core": "0.25.2-canary.0-840a0be", | ||
"castable-video": "~1.1.0", | ||
@@ -78,4 +78,4 @@ "custom-media-element": "~1.3.1", | ||
"@open-wc/testing": "^4.0.0", | ||
"@typescript-eslint/eslint-plugin": "^5.48.0", | ||
"@typescript-eslint/parser": "^5.48.0", | ||
"@typescript-eslint/eslint-plugin": "^8.3.0", | ||
"@typescript-eslint/parser": "^8.3.0", | ||
"@web/dev-server-esbuild": "^1.0.2", | ||
@@ -86,3 +86,3 @@ "@web/dev-server-import-maps": "^0.2.1", | ||
"esbuild": "^0.19.8", | ||
"eslint": "^8.24.0", | ||
"eslint": "^9.9.1", | ||
"hls.js": "~1.5.11", | ||
@@ -92,4 +92,4 @@ "npm-run-all": "^4.1.5", | ||
"shx": "^0.3.4", | ||
"typescript": "^4.9.4" | ||
"typescript": "^5.5.4" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6178262
+ Added@mux/playback-core@0.25.2-canary.0-840a0be(transitive)
- Removed@mux/playback-core@0.25.2-canary.0-8159569(transitive)