@mux/mux-player 3.2.4-canary.2 → 3.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/mux-player.js +2 -2
- package/dist/mux-player.mjs +2 -2
- package/package.json +3 -3
package/dist/index.cjs.js
CHANGED
|
@@ -1220,7 +1220,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
|
|
|
1220
1220
|
</style>
|
|
1221
1221
|
<slot></slot>
|
|
1222
1222
|
<div id="arrow"></div>
|
|
1223
|
-
`;var Qs=class extends d.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;if(!Ir(this,{checkOpacity:!1,checkVisibilityCSS:!1}))return;let i=this.placement;if(i==="left"||i==="right"){this.style.removeProperty("--media-tooltip-offset-x");return}let a=getComputedStyle(this),r=(e=Ue(this,"#"+this.bounds))!=null?e:Q(this);if(!r)return;let{x:n,width:s}=r.getBoundingClientRect(),{x:l,width:u}=this.getBoundingClientRect(),c=l+u,b=n+s,g=a.getPropertyValue("--media-tooltip-offset-x"),f=g?parseFloat(g.replace("px","")):0,v=a.getPropertyValue("--media-tooltip-container-margin"),L=v?parseFloat(v.replace("px","")):0,A=l-n+f-L,T=c-b+f+L;if(A<0){this.style.setProperty("--media-tooltip-offset-x",`${A}px`);return}if(T>0){this.style.setProperty("--media-tooltip-offset-x",`${T}px`);return}this.style.removeProperty("--media-tooltip-offset-x")},this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Lc.content.cloneNode(!0))),this.arrowEl=this.shadowRoot.querySelector("#arrow"),Object.prototype.hasOwnProperty.call(this,"placement")){let e=this.placement;delete this.placement,this.placement=e}}static get observedAttributes(){return[Hi.PLACEMENT,Hi.BOUNDS]}get placement(){return R(this,Hi.PLACEMENT)}set placement(e){I(this,Hi.PLACEMENT,e)}get bounds(){return R(this,Hi.BOUNDS)}set bounds(e){I(this,Hi.BOUNDS,e)}};d.customElements.get("media-tooltip")||d.customElements.define("media-tooltip",Qs);var tf=1,af=t=>t.mediaMuted?0:t.mediaVolume,rf=t=>`${Math.round(t*100)}%`,zs=class extends qt{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME,o.MEDIA_MUTED,o.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",()=>{let e=this.range.value,i=new d.CustomEvent(p.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",Y.VOLUME())}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),(e===o.MEDIA_VOLUME||e===o.MEDIA_MUTED)&&(this.range.valueAsNumber=af(this),this.range.setAttribute("aria-valuetext",rf(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return M(this,o.MEDIA_VOLUME,tf)}set mediaVolume(e){D(this,o.MEDIA_VOLUME,e)}get mediaMuted(){return H(this,o.MEDIA_MUTED)}set mediaMuted(e){U(this,o.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return R(this,o.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){I(this,o.MEDIA_VOLUME_UNAVAILABLE,e)}};d.customElements.get("media-volume-range")||d.customElements.define("media-volume-range",zs);var E=mh(require("@mux/mux-video")),y=require("@mux/playback-core");var Wc=require("@mux/mux-video");var Uc=require("@mux/playback-core");var jt=require("@mux/playback-core");function xc(t){let e="";return Object.entries(t).forEach(([i,a])=>{a!=null&&(e+=`${Dn(i)}: ${a}; `)}),e?e.trim():void 0}function Dn(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function On(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function ce(t){if(t==null)return;let e=+t;return Number.isNaN(e)?void 0:e}function Xs(t){let e=nf(t).toString();return e?"?"+e:""}function nf(t){let e={};for(let i in t)t[i]!=null&&(e[i]=t[i]);return new URLSearchParams(e)}var Js=(t,e)=>!t||!e?!1:t.contains(e)?!0:Js(t,e.getRootNode().host);var Dc="mux.com",of=()=>{try{return"3.2.
|
|
1223
|
+
`;var Qs=class extends d.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;if(!Ir(this,{checkOpacity:!1,checkVisibilityCSS:!1}))return;let i=this.placement;if(i==="left"||i==="right"){this.style.removeProperty("--media-tooltip-offset-x");return}let a=getComputedStyle(this),r=(e=Ue(this,"#"+this.bounds))!=null?e:Q(this);if(!r)return;let{x:n,width:s}=r.getBoundingClientRect(),{x:l,width:u}=this.getBoundingClientRect(),c=l+u,b=n+s,g=a.getPropertyValue("--media-tooltip-offset-x"),f=g?parseFloat(g.replace("px","")):0,v=a.getPropertyValue("--media-tooltip-container-margin"),L=v?parseFloat(v.replace("px","")):0,A=l-n+f-L,T=c-b+f+L;if(A<0){this.style.setProperty("--media-tooltip-offset-x",`${A}px`);return}if(T>0){this.style.setProperty("--media-tooltip-offset-x",`${T}px`);return}this.style.removeProperty("--media-tooltip-offset-x")},this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Lc.content.cloneNode(!0))),this.arrowEl=this.shadowRoot.querySelector("#arrow"),Object.prototype.hasOwnProperty.call(this,"placement")){let e=this.placement;delete this.placement,this.placement=e}}static get observedAttributes(){return[Hi.PLACEMENT,Hi.BOUNDS]}get placement(){return R(this,Hi.PLACEMENT)}set placement(e){I(this,Hi.PLACEMENT,e)}get bounds(){return R(this,Hi.BOUNDS)}set bounds(e){I(this,Hi.BOUNDS,e)}};d.customElements.get("media-tooltip")||d.customElements.define("media-tooltip",Qs);var tf=1,af=t=>t.mediaMuted?0:t.mediaVolume,rf=t=>`${Math.round(t*100)}%`,zs=class extends qt{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME,o.MEDIA_MUTED,o.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",()=>{let e=this.range.value,i=new d.CustomEvent(p.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",Y.VOLUME())}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),(e===o.MEDIA_VOLUME||e===o.MEDIA_MUTED)&&(this.range.valueAsNumber=af(this),this.range.setAttribute("aria-valuetext",rf(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return M(this,o.MEDIA_VOLUME,tf)}set mediaVolume(e){D(this,o.MEDIA_VOLUME,e)}get mediaMuted(){return H(this,o.MEDIA_MUTED)}set mediaMuted(e){U(this,o.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return R(this,o.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){I(this,o.MEDIA_VOLUME_UNAVAILABLE,e)}};d.customElements.get("media-volume-range")||d.customElements.define("media-volume-range",zs);var E=mh(require("@mux/mux-video")),y=require("@mux/playback-core");var Wc=require("@mux/mux-video");var Uc=require("@mux/playback-core");var jt=require("@mux/playback-core");function xc(t){let e="";return Object.entries(t).forEach(([i,a])=>{a!=null&&(e+=`${Dn(i)}: ${a}; `)}),e?e.trim():void 0}function Dn(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function On(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function ce(t){if(t==null)return;let e=+t;return Number.isNaN(e)?void 0:e}function Xs(t){let e=nf(t).toString();return e?"?"+e:""}function nf(t){let e={};for(let i in t)t[i]!=null&&(e[i]=t[i]);return new URLSearchParams(e)}var Js=(t,e)=>!t||!e?!1:t.contains(e)?!0:Js(t,e.getRootNode().host);var Dc="mux.com",of=()=>{try{return"3.2.4"}catch{}return"UNKNOWN"},sf=of(),Pn=()=>sf,Oc=(t,{token:e,customDomain:i=Dc,thumbnailTime:a,programTime:r}={})=>{var l;let n=e==null?a:void 0,{aud:s}=(l=(0,jt.parseJwt)(e))!=null?l:{};if(!(e&&s!=="t"))return`https://image.${i}/${t}/thumbnail.webp${Xs({token:e,time:n,program_time:r})}`},Nc=(t,{token:e,customDomain:i=Dc,programStartTime:a,programEndTime:r}={})=>{var s;let{aud:n}=(s=(0,jt.parseJwt)(e))!=null?s:{};if(!(e&&n!=="s"))return`https://image.${i}/${t}/storyboard.vtt${Xs({token:e,format:"webp",program_start_time:a,program_end_time:r})}`},Ua=t=>{if(t){if([jt.StreamTypes.LIVE,jt.StreamTypes.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return jt.StreamTypes.LIVE}};var lf={crossorigin:"crossOrigin",playsinline:"playsInline"};function Pc(t){var e;return(e=lf[t])!=null?e:On(t)}var Xt,Jt,me,Nn=class{constructor(e,i){pe(this,Xt);pe(this,Jt);pe(this,me,[]);Te(this,Xt,e),Te(this,Jt,i)}[Symbol.iterator](){return P(this,me).values()}get length(){return P(this,me).length}get value(){var e;return(e=P(this,me).join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(Te(this,me,[]),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return P(this,me)[e]}values(){return P(this,me).values()}keys(){return P(this,me).keys()}forEach(e){P(this,me).forEach(e)}add(...e){var i,a;e.forEach(r=>{this.contains(r)||P(this,me).push(r)}),!(this.value===""&&!((i=P(this,Xt))!=null&&i.hasAttribute(`${P(this,Jt)}`)))&&((a=P(this,Xt))==null||a.setAttribute(`${P(this,Jt)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>{P(this,me).splice(P(this,me).indexOf(a),1)}),(i=P(this,Xt))==null||i.setAttribute(`${P(this,Jt)}`,`${this.value}`)}contains(e){return P(this,me).includes(e)}toggle(e,i){return typeof i!="undefined"?i?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,i){this.remove(e),this.add(i)}};Xt=new WeakMap,Jt=new WeakMap,me=new WeakMap;var Bc=`[mux-player ${Pn()}]`;function Qe(...t){console.warn(Bc,...t)}function be(...t){console.error(Bc,...t)}function js(t){var i;let e=(i=t.message)!=null?i:"";t.context&&(e+=` ${t.context}`),t.file&&(e+=` ${(0,Uc.i18n)("Read more: ")}
|
|
1224
1224
|
https://github.com/muxinc/elements/blob/main/errors/${t.file}`),Qe(e)}var de={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},ei={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},$c=Object.freeze({length:0,start(t){let e=t>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(t){let e=t>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),df=Wc.VideoEvents.filter(t=>t!=="error"),uf=Object.values(de).filter(t=>![de.PLAYSINLINE].includes(t)),cf=Object.values(ei),el=class extends fe.HTMLElement{static get observedAttributes(){return[...uf,...cf]}constructor(){super()}init(){df.forEach(e=>{var i;(i=this.media)==null||i.addEventListener(e,a=>{this.dispatchEvent(new Event(a.type))})})}attributeChangedCallback(e,i,a){var r,n;switch(e){case ei.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case ei.VOLUME:{let s=(r=ce(a))!=null?r:1;this.media&&(this.media.volume=s);return}case ei.PLAYBACKRATE:{let s=(n=ce(a))!=null?n:1;this.media&&(this.media.playbackRate=s,this.media.defaultPlaybackRate=s);return}}}play(){var e,i;return(i=(e=this.media)==null?void 0:e.play())!=null?i:Promise.reject()}pause(){var e;(e=this.media)==null||e.pause()}load(){var e;(e=this.media)==null||e.load()}requestCast(e){var i;return(i=this.media)==null?void 0:i.requestCast(e)}get media(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("mux-video")}get audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var e,i;return(i=(e=this.media)==null?void 0:e.paused)!=null?i:!0}get duration(){var e,i;return(i=(e=this.media)==null?void 0:e.duration)!=null?i:NaN}get ended(){var e,i;return(i=(e=this.media)==null?void 0:e.ended)!=null?i:!1}get buffered(){var e,i;return(i=(e=this.media)==null?void 0:e.buffered)!=null?i:$c}get seekable(){var e,i;return(i=(e=this.media)==null?void 0:e.seekable)!=null?i:$c}get readyState(){var e,i;return(i=(e=this.media)==null?void 0:e.readyState)!=null?i:0}get videoWidth(){var e,i;return(i=(e=this.media)==null?void 0:e.videoWidth)!=null?i:0}get videoHeight(){var e,i;return(i=(e=this.media)==null?void 0:e.videoHeight)!=null?i:0}get currentSrc(){var e,i;return(i=(e=this.media)==null?void 0:e.currentSrc)!=null?i:""}get currentTime(){var e,i;return(i=(e=this.media)==null?void 0:e.currentTime)!=null?i:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,i;return(i=(e=this.media)==null?void 0:e.volume)!=null?i:1}set volume(e){this.media&&(this.media.volume=Number(e))}get playbackRate(){var e,i;return(i=(e=this.media)==null?void 0:e.playbackRate)!=null?i:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get defaultPlaybackRate(){var e;return(e=ce(this.getAttribute(ei.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(ei.PLAYBACKRATE,`${e}`):this.removeAttribute(ei.PLAYBACKRATE)}get crossOrigin(){return Ba(this,de.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(de.CROSSORIGIN,`${e}`)}get autoplay(){return Ba(this,de.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(de.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(de.AUTOPLAY)}get loop(){return Ba(this,de.LOOP)!=null}set loop(e){e?this.setAttribute(de.LOOP,""):this.removeAttribute(de.LOOP)}get muted(){var e,i;return(i=(e=this.media)==null?void 0:e.muted)!=null?i:!1}set muted(e){this.media&&(this.media.muted=!!e)}get defaultMuted(){return Ba(this,de.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(de.MUTED,""):this.removeAttribute(de.MUTED)}get playsInline(){return Ba(this,de.PLAYSINLINE)!=null}set playsInline(e){be("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(e){["","none","metadata","auto"].includes(e)?this.setAttribute(de.PRELOAD,e):this.removeAttribute(de.PRELOAD)}};function Ba(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var tl=el;var Gc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},k=(t,e,i)=>(Gc(t,e,"read from private field"),i?i.call(t):e.get(t)),ze=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},ct=(t,e,i,a)=>(Gc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),$i,Un,ti,Ha,It,Ct,Mt,ii,Wi,Bn,Oe,Fc=1,Kc=0,mf=1,hf={processCallback(t,e,i){if(i){for(let[a,r]of e)if(a in i){let n=i[a];typeof n=="boolean"&&r instanceof he&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=n:typeof n=="function"&&r instanceof he?r.element[r.attributeName]=n:r.value=n}}}},mt=class extends d.DocumentFragment{constructor(e,i,a=hf){var r;super(),ze(this,$i,void 0),ze(this,Un,void 0),this.append(e.content.cloneNode(!0)),ct(this,$i,qc(this)),ct(this,Un,a),(r=a.createCallback)==null||r.call(a,this,k(this,$i),i),a.processCallback(this,k(this,$i),i)}update(e){k(this,Un).processCallback(this,k(this,$i),e)}};$i=new WeakMap;Un=new WeakMap;var qc=(t,e=[])=>{let i,a;for(let r of t.attributes||[])if(r.value.includes("{{")){let n=new il;for([i,a]of Yc(r.value))if(!i)n.append(a);else{let s=new he(t,r.name,r.namespaceURI);n.append(s),e.push([a,s])}r.value=n.toString()}for(let r of t.childNodes)if(r.nodeType===Fc&&!(r instanceof HTMLTemplateElement))qc(r,e);else{let n=r.data;if(r.nodeType===Fc||n.includes("{{")){let s=[];if(n)for([i,a]of Yc(n))if(!i)s.push(new Text(a));else{let l=new ht(t);s.push(l),e.push([a,l])}else if(r instanceof HTMLTemplateElement){let l=new $a(t,r);s.push(l),e.push([l.expression,l])}r.replaceWith(...s.flatMap(l=>l.replacementNodes||[l]))}}return e},Vc={},Yc=t=>{let e="",i=0,a=Vc[t],r=0,n;if(a)return a;for(a=[];n=t[r];r++)n==="{"&&t[r+1]==="{"&&t[r-1]!=="\\"&&t[r+2]&&++i==1?(e&&a.push([Kc,e]),e="",r++):n==="}"&&t[r+1]==="}"&&t[r-1]!=="\\"&&!--i?(a.push([mf,e.trim()]),e="",r++):e+=n||"";return e&&a.push([Kc,(i>0?"{{":"")+e]),Vc[t]=a},pf=11,Hn=class{get value(){return""}set value(e){}toString(){return this.value}},Zc=new WeakMap,il=class{constructor(){ze(this,ti,[])}[Symbol.iterator](){return k(this,ti).values()}get length(){return k(this,ti).length}item(e){return k(this,ti)[e]}append(...e){for(let i of e)i instanceof he&&Zc.set(i,this),k(this,ti).push(i)}toString(){return k(this,ti).join("")}};ti=new WeakMap;var he=class extends Hn{constructor(e,i,a){super(),ze(this,ii),ze(this,Ha,""),ze(this,It,void 0),ze(this,Ct,void 0),ze(this,Mt,void 0),ct(this,It,e),ct(this,Ct,i),ct(this,Mt,a)}get attributeName(){return k(this,Ct)}get attributeNamespace(){return k(this,Mt)}get element(){return k(this,It)}get value(){return k(this,Ha)}set value(e){k(this,Ha)!==e&&(ct(this,Ha,e),!k(this,ii,Wi)||k(this,ii,Wi).length===1?e==null?k(this,It).removeAttributeNS(k(this,Mt),k(this,Ct)):k(this,It).setAttributeNS(k(this,Mt),k(this,Ct),e):k(this,It).setAttributeNS(k(this,Mt),k(this,Ct),k(this,ii,Wi).toString()))}get booleanValue(){return k(this,It).hasAttributeNS(k(this,Mt),k(this,Ct))}set booleanValue(e){if(!k(this,ii,Wi)||k(this,ii,Wi).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};Ha=new WeakMap;It=new WeakMap;Ct=new WeakMap;Mt=new WeakMap;ii=new WeakSet;Wi=function(){return Zc.get(this)};var ht=class extends Hn{constructor(e,i){super(),ze(this,Bn,void 0),ze(this,Oe,void 0),ct(this,Bn,e),ct(this,Oe,i?[...i]:[new Text])}get replacementNodes(){return k(this,Oe)}get parentNode(){return k(this,Bn)}get nextSibling(){return k(this,Oe)[k(this,Oe).length-1].nextSibling}get previousSibling(){return k(this,Oe)[0].previousSibling}get value(){return k(this,Oe).map(e=>e.textContent).join("")}set value(e){this.replace(e)}replace(...e){let i=e.flat().flatMap(a=>a==null?[new Text]:a.forEach?[...a]:a.nodeType===pf?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);i.length||i.push(new Text),ct(this,Oe,ff(k(this,Oe)[0].parentNode,k(this,Oe),i,this.nextSibling))}};Bn=new WeakMap;Oe=new WeakMap;var $a=class extends ht{constructor(e,i){let a=i.getAttribute("directive")||i.getAttribute("type"),r=i.getAttribute("expression")||i.getAttribute(a)||"";r.startsWith("{{")&&(r=r.trim().slice(2,-2).trim()),super(e),this.expression=r,this.template=i,this.directive=a}};function ff(t,e,i,a=null){let r=0,n,s,l,u=i.length,c=e.length;for(;r<u&&r<c&&e[r]==i[r];)r++;for(;r<u&&r<c&&i[u-1]==e[c-1];)a=i[--c,--u];if(r==c)for(;r<u;)t.insertBefore(i[r++],a);if(r==u)for(;r<c;)t.removeChild(e[r++]);else{for(n=e[r];r<u;)l=i[r++],s=n?n.nextSibling:a,n==l?n=s:r<u&&i[r]==s?(t.replaceChild(l,n),n=s):t.insertBefore(l,n);for(;n!=a;)s=n.nextSibling,t.removeChild(n),n=s}return i}var Qc={string:t=>String(t)},Wn=class{constructor(e){this.template=e,this.state=void 0}},ai=new WeakMap,ri=new WeakMap,al={partial:(t,e)=>{e[t.expression]=new Wn(t.template)},if:(t,e)=>{var i;if(Xc(t.expression,e))if(ai.get(t)!==t.template){ai.set(t,t.template);let a=new mt(t.template,e,Fn);t.replace(a),ri.set(t,a)}else(i=ri.get(t))==null||i.update(e);else t.replace(""),ai.delete(t),ri.delete(t)}},vf=Object.keys(al),Fn={processCallback(t,e,i){var a,r;if(i)for(let[n,s]of e){if(s instanceof $a){if(!s.directive){let u=vf.find(c=>s.template.hasAttribute(c));u&&(s.directive=u,s.expression=s.template.getAttribute(u))}(a=al[s.directive])==null||a.call(al,s,i);continue}let l=Xc(n,i);if(l instanceof Wn){ai.get(s)!==l.template?(ai.set(s,l.template),l=new mt(l.template,l.state,Fn),s.value=l,ri.set(s,l)):(r=ri.get(s))==null||r.update(l.state);continue}l?(s instanceof he&&s.attributeName.startsWith("aria-")&&(l=String(l)),s instanceof he?typeof l=="boolean"?s.booleanValue=l:typeof l=="function"?s.element[s.attributeName]=l:s.value=l:(s.value=l,ai.delete(s),ri.delete(s))):s instanceof he?s.value=void 0:(s.value=void 0,ai.delete(s),ri.delete(s))}}},zc={"!":t=>!t,"!!":t=>!!t,"==":(t,e)=>t==e,"!=":(t,e)=>t!=e,">":(t,e)=>t>e,">=":(t,e)=>t>=e,"<":(t,e)=>t<e,"<=":(t,e)=>t<=e,"??":(t,e)=>t!=null?t:e,"|":(t,e)=>{var i;return(i=Qc[e])==null?void 0:i.call(Qc,t)}};function Ef(t){return bf(t,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function Xc(t,e={}){var i,a,r,n,s,l,u;let c=Ef(t);if(c.length===0||c.some(({type:b})=>!b))return Wa(t);if(((i=c[0])==null?void 0:i.token)===">"){let b=e[(a=c[1])==null?void 0:a.token];if(!b)return Wa(t);let g={...e};b.state=g;let f=c.slice(2);for(let v=0;v<f.length;v+=3){let L=(r=f[v])==null?void 0:r.token,A=(n=f[v+1])==null?void 0:n.token,T=(s=f[v+2])==null?void 0:s.token;L&&A==="="&&(g[L]=Fa(T,e))}return b}if(c.length===1)return $n(c[0])?Fa(c[0].token,e):Wa(t);if(c.length===2){let b=(l=c[0])==null?void 0:l.token,g=zc[b];if(!g||!$n(c[1]))return Wa(t);let f=Fa(c[1].token,e);return g(f)}if(c.length===3){let b=(u=c[1])==null?void 0:u.token,g=zc[b];if(!g||!$n(c[0])||!$n(c[2]))return Wa(t);let f=Fa(c[0].token,e);if(b==="|")return g(f,c[2].token);let v=Fa(c[2].token,e);return g(f,v)}}function Wa(t){return console.warn(`Warning: invalid expression \`${t}\``),!1}function $n({type:t}){return["number","boolean","string","param"].includes(t)}function Fa(t,e){let i=t[0],a=t.slice(-1);return t==="true"||t==="false"?t==="true":i===a&&["'",'"'].includes(i)?t.slice(1,-1):br(t)?parseFloat(t):e[t]}function bf(t,e){let i,a,r,n=[];for(;t;){r=null,i=t.length;for(let s in e)a=e[s].exec(t),a&&a.index<i&&(r={token:a[0],type:s,matches:a.slice(1)},i=a.index);i&&n.push({token:t.substr(0,i),type:void 0}),r&&n.push(r),t=t.substr(i+(r?r.token.length:0))}return n}var dl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ol=(t,e,i)=>(dl(t,e,"read from private field"),i?i.call(t):e.get(t)),Ka=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},ni=(t,e,i,a)=>(dl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),rl=(t,e,i)=>(dl(t,e,"access private method"),i),Fi,Kn,Ki,sl,Jc,Vn,ll,nl={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},jc=h.createElement("template");jc.innerHTML=`
|
|
1225
1225
|
<style>
|
|
1226
1226
|
:host {
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var je=t=>{throw TypeError(t)};var he=(t,a,e)=>a.has(t)||je("Cannot "+e);var u=(t,a,e)=>(he(t,a,"read from private field"),e?e.call(t):a.get(t)),v=(t,a,e)=>a.has(t)?je("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(t):a.set(t,e),k=(t,a,e,i)=>(he(t,a,"write to private field"),i?i.call(t,e):a.set(t,e),e),b=(t,a,e)=>(he(t,a,"access private method"),e);var $=class{addEventListener(){}removeEventListener(){}dispatchEvent(a){return!0}};if(typeof DocumentFragment=="undefined"){class t extends ${}globalThis.DocumentFragment=t}var G=class extends ${},fe=class extends ${},Nt={get(t){},define(t,a,e){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(G)}},j,ge=class{constructor(a,e={}){v(this,j);k(this,j,e==null?void 0:e.detail)}get detail(){return u(this,j)}initCustomEvent(){}};j=new WeakMap;function St(t,a){return new G}var qe={document:{createElement:St},DocumentFragment,customElements:Nt,CustomEvent:ge,EventTarget:$,HTMLElement:G,HTMLVideoElement:fe},ze=typeof window=="undefined"||typeof globalThis.customElements=="undefined",E=ze?qe:globalThis,Y=ze?qe.document:globalThis.document;import{MediaController as ua,MediaErrorDialog as Rt}from"media-chrome";import{Attributes as xe}from"media-chrome/dist/media-container.js";import{MediaUIAttributes as Tt}from"media-chrome/dist/constants.js";import"media-chrome/dist/experimental/index.js";import ma,{MediaError as Q,Attributes as s}from"@mux/mux-video";import{StreamTypes as M,PlaybackTypes as be,addTextTrack as ca,removeTextTrack as pa,CmcdTypeValues as vt,i18n as K,parseJwt as Me,MuxJWTAud as Le,generatePlayerInitTime as ba}from"@mux/playback-core";import{VideoEvents as Kt}from"@mux/mux-video";import{i18n as Vt}from"@mux/playback-core";import{StreamTypes as ve,parseJwt as Je}from"@mux/playback-core";function Xe(t){let a="";return Object.entries(t).forEach(([e,i])=>{i!=null&&(a+=`${ne(e)}: ${i}; `)}),a?a.trim():void 0}function ne(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function se(t){return t.replace(/[-_]([a-z])/g,(a,e)=>e.toUpperCase())}function y(t){if(t==null)return;let a=+t;return Number.isNaN(a)?void 0:a}function ye(t){let a=wt(t).toString();return a?"?"+a:""}function wt(t){let a={};for(let e in t)t[e]!=null&&(a[e]=t[e]);return new URLSearchParams(a)}var Te=(t,a)=>!t||!a?!1:t.contains(a)?!0:Te(t,a.getRootNode().host);var Qe="mux.com",Pt=()=>{try{return"3.2.
|
|
1
|
+
var je=t=>{throw TypeError(t)};var he=(t,a,e)=>a.has(t)||je("Cannot "+e);var u=(t,a,e)=>(he(t,a,"read from private field"),e?e.call(t):a.get(t)),v=(t,a,e)=>a.has(t)?je("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(t):a.set(t,e),k=(t,a,e,i)=>(he(t,a,"write to private field"),i?i.call(t,e):a.set(t,e),e),b=(t,a,e)=>(he(t,a,"access private method"),e);var $=class{addEventListener(){}removeEventListener(){}dispatchEvent(a){return!0}};if(typeof DocumentFragment=="undefined"){class t extends ${}globalThis.DocumentFragment=t}var G=class extends ${},fe=class extends ${},Nt={get(t){},define(t,a,e){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(G)}},j,ge=class{constructor(a,e={}){v(this,j);k(this,j,e==null?void 0:e.detail)}get detail(){return u(this,j)}initCustomEvent(){}};j=new WeakMap;function St(t,a){return new G}var qe={document:{createElement:St},DocumentFragment,customElements:Nt,CustomEvent:ge,EventTarget:$,HTMLElement:G,HTMLVideoElement:fe},ze=typeof window=="undefined"||typeof globalThis.customElements=="undefined",E=ze?qe:globalThis,Y=ze?qe.document:globalThis.document;import{MediaController as ua,MediaErrorDialog as Rt}from"media-chrome";import{Attributes as xe}from"media-chrome/dist/media-container.js";import{MediaUIAttributes as Tt}from"media-chrome/dist/constants.js";import"media-chrome/dist/experimental/index.js";import ma,{MediaError as Q,Attributes as s}from"@mux/mux-video";import{StreamTypes as M,PlaybackTypes as be,addTextTrack as ca,removeTextTrack as pa,CmcdTypeValues as vt,i18n as K,parseJwt as Me,MuxJWTAud as Le,generatePlayerInitTime as ba}from"@mux/playback-core";import{VideoEvents as Kt}from"@mux/mux-video";import{i18n as Vt}from"@mux/playback-core";import{StreamTypes as ve,parseJwt as Je}from"@mux/playback-core";function Xe(t){let a="";return Object.entries(t).forEach(([e,i])=>{i!=null&&(a+=`${ne(e)}: ${i}; `)}),a?a.trim():void 0}function ne(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function se(t){return t.replace(/[-_]([a-z])/g,(a,e)=>e.toUpperCase())}function y(t){if(t==null)return;let a=+t;return Number.isNaN(a)?void 0:a}function ye(t){let a=wt(t).toString();return a?"?"+a:""}function wt(t){let a={};for(let e in t)t[e]!=null&&(a[e]=t[e]);return new URLSearchParams(a)}var Te=(t,a)=>!t||!a?!1:t.contains(a)?!0:Te(t,a.getRootNode().host);var Qe="mux.com",Pt=()=>{try{return"3.2.4"}catch{}return"UNKNOWN"},It=Pt(),le=()=>It,et=(t,{token:a,customDomain:e=Qe,thumbnailTime:i,programTime:r}={})=>{var l;let n=a==null?i:void 0,{aud:d}=(l=Je(a))!=null?l:{};if(!(a&&d!=="t"))return`https://image.${e}/${t}/thumbnail.webp${ye({token:a,time:n,program_time:r})}`},tt=(t,{token:a,customDomain:e=Qe,programStartTime:i,programEndTime:r}={})=>{var d;let{aud:n}=(d=Je(a))!=null?d:{};if(!(a&&n!=="s"))return`https://image.${e}/${t}/storyboard.vtt${ye({token:a,format:"webp",program_start_time:i,program_end_time:r})}`},q=t=>{if(t){if([ve.LIVE,ve.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return ve.LIVE}};var Dt={crossorigin:"crossOrigin",playsinline:"playsInline"};function at(t){var a;return(a=Dt[t])!=null?a:se(t)}var P,I,T,de=class{constructor(a,e){v(this,P);v(this,I);v(this,T,[]);k(this,P,a),k(this,I,e)}[Symbol.iterator](){return u(this,T).values()}get length(){return u(this,T).length}get value(){var a;return(a=u(this,T).join(" "))!=null?a:""}set value(a){var e;a!==this.value&&(k(this,T,[]),this.add(...(e=a==null?void 0:a.split(" "))!=null?e:[]))}toString(){return this.value}item(a){return u(this,T)[a]}values(){return u(this,T).values()}keys(){return u(this,T).keys()}forEach(a){u(this,T).forEach(a)}add(...a){var e,i;a.forEach(r=>{this.contains(r)||u(this,T).push(r)}),!(this.value===""&&!((e=u(this,P))!=null&&e.hasAttribute(`${u(this,I)}`)))&&((i=u(this,P))==null||i.setAttribute(`${u(this,I)}`,`${this.value}`))}remove(...a){var e;a.forEach(i=>{u(this,T).splice(u(this,T).indexOf(i),1)}),(e=u(this,P))==null||e.setAttribute(`${u(this,I)}`,`${this.value}`)}contains(a){return u(this,T).includes(a)}toggle(a,e){return typeof e!="undefined"?e?(this.add(a),!0):(this.remove(a),!1):this.contains(a)?(this.remove(a),!1):(this.add(a),!0)}replace(a,e){this.remove(a),this.add(e)}};P=new WeakMap,I=new WeakMap,T=new WeakMap;var it=`[mux-player ${le()}]`;function x(...t){console.warn(it,...t)}function A(...t){console.error(it,...t)}function Ee(t){var e;let a=(e=t.message)!=null?e:"";t.context&&(a+=` ${t.context}`),t.file&&(a+=` ${Vt("Read more: ")}
|
|
2
2
|
https://github.com/muxinc/elements/blob/main/errors/${t.file}`),x(a)}var g={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},D={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},ot=Object.freeze({length:0,start(t){let a=t>>>0;if(a>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${a}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(t){let a=t>>>0;if(a>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${a}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),Ht=Kt.filter(t=>t!=="error"),Ut=Object.values(g).filter(t=>![g.PLAYSINLINE].includes(t)),Bt=Object.values(D),Ae=class extends E.HTMLElement{static get observedAttributes(){return[...Ut,...Bt]}constructor(){super()}init(){Ht.forEach(a=>{var e;(e=this.media)==null||e.addEventListener(a,i=>{this.dispatchEvent(new Event(i.type))})})}attributeChangedCallback(a,e,i){var r,n;switch(a){case D.MUTED:{this.media&&(this.media.muted=i!=null,this.media.defaultMuted=i!=null);return}case D.VOLUME:{let d=(r=y(i))!=null?r:1;this.media&&(this.media.volume=d);return}case D.PLAYBACKRATE:{let d=(n=y(i))!=null?n:1;this.media&&(this.media.playbackRate=d,this.media.defaultPlaybackRate=d);return}}}play(){var a,e;return(e=(a=this.media)==null?void 0:a.play())!=null?e:Promise.reject()}pause(){var a;(a=this.media)==null||a.pause()}load(){var a;(a=this.media)==null||a.load()}requestCast(a){var e;return(e=this.media)==null?void 0:e.requestCast(a)}get media(){var a;return(a=this.shadowRoot)==null?void 0:a.querySelector("mux-video")}get audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var a,e;return(e=(a=this.media)==null?void 0:a.paused)!=null?e:!0}get duration(){var a,e;return(e=(a=this.media)==null?void 0:a.duration)!=null?e:NaN}get ended(){var a,e;return(e=(a=this.media)==null?void 0:a.ended)!=null?e:!1}get buffered(){var a,e;return(e=(a=this.media)==null?void 0:a.buffered)!=null?e:ot}get seekable(){var a,e;return(e=(a=this.media)==null?void 0:a.seekable)!=null?e:ot}get readyState(){var a,e;return(e=(a=this.media)==null?void 0:a.readyState)!=null?e:0}get videoWidth(){var a,e;return(e=(a=this.media)==null?void 0:a.videoWidth)!=null?e:0}get videoHeight(){var a,e;return(e=(a=this.media)==null?void 0:a.videoHeight)!=null?e:0}get currentSrc(){var a,e;return(e=(a=this.media)==null?void 0:a.currentSrc)!=null?e:""}get currentTime(){var a,e;return(e=(a=this.media)==null?void 0:a.currentTime)!=null?e:0}set currentTime(a){this.media&&(this.media.currentTime=Number(a))}get volume(){var a,e;return(e=(a=this.media)==null?void 0:a.volume)!=null?e:1}set volume(a){this.media&&(this.media.volume=Number(a))}get playbackRate(){var a,e;return(e=(a=this.media)==null?void 0:a.playbackRate)!=null?e:1}set playbackRate(a){this.media&&(this.media.playbackRate=Number(a))}get defaultPlaybackRate(){var a;return(a=y(this.getAttribute(D.PLAYBACKRATE)))!=null?a:1}set defaultPlaybackRate(a){a!=null?this.setAttribute(D.PLAYBACKRATE,`${a}`):this.removeAttribute(D.PLAYBACKRATE)}get crossOrigin(){return z(this,g.CROSSORIGIN)}set crossOrigin(a){this.setAttribute(g.CROSSORIGIN,`${a}`)}get autoplay(){return z(this,g.AUTOPLAY)!=null}set autoplay(a){a?this.setAttribute(g.AUTOPLAY,typeof a=="string"?a:""):this.removeAttribute(g.AUTOPLAY)}get loop(){return z(this,g.LOOP)!=null}set loop(a){a?this.setAttribute(g.LOOP,""):this.removeAttribute(g.LOOP)}get muted(){var a,e;return(e=(a=this.media)==null?void 0:a.muted)!=null?e:!1}set muted(a){this.media&&(this.media.muted=!!a)}get defaultMuted(){return z(this,g.MUTED)!=null}set defaultMuted(a){a?this.setAttribute(g.MUTED,""):this.removeAttribute(g.MUTED)}get playsInline(){return z(this,g.PLAYSINLINE)!=null}set playsInline(a){A("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(a){["","none","metadata","auto"].includes(a)?this.setAttribute(g.PRELOAD,a):this.removeAttribute(g.PRELOAD)}};function z(t,a){return t.media?t.media.getAttribute(a):t.getAttribute(a)}var Ce=Ae;import"media-chrome/dist/media-theme-element.js";var nt=`:host {
|
|
3
3
|
--media-control-display: var(--controls);
|
|
4
4
|
--media-loading-indicator-display: var(--loading-indicator);
|
package/dist/mux-player.js
CHANGED
|
@@ -1271,7 +1271,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1271
1271
|
`:""}${i.error?`error: ${i.error}
|
|
1272
1272
|
`:""}${i.event?`event: ${i.event}
|
|
1273
1273
|
`:""}${i.err?`error message: ${(s=i.err)==null?void 0:s.message}
|
|
1274
|
-
`:""}`),l.data=i,l};var fC=Object.defineProperty,mC=Object.getPrototypeOf,pC=Reflect.get,sT=i=>{throw TypeError(i)},gC=(i,e,t)=>e in i?fC(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Le=(i,e,t)=>gC(i,typeof e!="symbol"?e+"":e,t),bp=(i,e,t)=>e.has(i)||sT("Cannot "+t),I=(i,e,t)=>(bp(i,e,"read from private field"),t?t.call(i):e.get(i)),ie=(i,e,t)=>e.has(i)?sT("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),Q=(i,e,t,r)=>(bp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ne=(i,e,t)=>(bp(i,e,"access private method"),t),tp=(i,e,t)=>pC(mC(i),t,e),pu=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends pu{}globalThis.DocumentFragment=i}var yp=class extends pu{},vC=class extends pu{},EC={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(yp)}},iu,bC=class{constructor(i,e={}){ie(this,iu),Q(this,iu,e==null?void 0:e.detail)}get detail(){return I(this,iu)}initCustomEvent(){}};iu=new WeakMap;function yC(i,e){return new yp}var nT={document:{createElement:yC},DocumentFragment,customElements:EC,CustomEvent:bC,EventTarget:pu,HTMLElement:yp,HTMLVideoElement:vC},aT=typeof window=="undefined"||typeof globalThis.customElements=="undefined",ip=aT?nT:globalThis,A2=aT?nT.document:globalThis.document,TC=()=>{try{return"0.24.
|
|
1274
|
+
`:""}`),l.data=i,l};var fC=Object.defineProperty,mC=Object.getPrototypeOf,pC=Reflect.get,sT=i=>{throw TypeError(i)},gC=(i,e,t)=>e in i?fC(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Le=(i,e,t)=>gC(i,typeof e!="symbol"?e+"":e,t),bp=(i,e,t)=>e.has(i)||sT("Cannot "+t),I=(i,e,t)=>(bp(i,e,"read from private field"),t?t.call(i):e.get(i)),ie=(i,e,t)=>e.has(i)?sT("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),Q=(i,e,t,r)=>(bp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ne=(i,e,t)=>(bp(i,e,"access private method"),t),tp=(i,e,t)=>pC(mC(i),t,e),pu=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends pu{}globalThis.DocumentFragment=i}var yp=class extends pu{},vC=class extends pu{},EC={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(yp)}},iu,bC=class{constructor(i,e={}){ie(this,iu),Q(this,iu,e==null?void 0:e.detail)}get detail(){return I(this,iu)}initCustomEvent(){}};iu=new WeakMap;function yC(i,e){return new yp}var nT={document:{createElement:yC},DocumentFragment,customElements:EC,CustomEvent:bC,EventTarget:pu,HTMLElement:yp,HTMLVideoElement:vC},aT=typeof window=="undefined"||typeof globalThis.customElements=="undefined",ip=aT?nT:globalThis,A2=aT?nT.document:globalThis.document,TC=()=>{try{return"0.24.2"}catch{}return"UNKNOWN"},_C=TC(),AC=()=>_C,gu=["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"],oT=["autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"];function SC(i){return`
|
|
1275
1275
|
<style>
|
|
1276
1276
|
:host {
|
|
1277
1277
|
display: inline-flex;
|
|
@@ -1313,7 +1313,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1313
1313
|
<video${dT(i)}></video>
|
|
1314
1314
|
</slot>
|
|
1315
1315
|
<slot></slot>
|
|
1316
|
-
`}function lT(i,{tag:e,is:t}){var r,s,n,a,o,l,d,u,c,h,f,m,p,g,E,b,T;let _=(s=(r=globalThis.document)==null?void 0:r.createElement)==null?void 0:s.call(r,e,{is:t}),A=_?RC(_):[];return n=class extends i{constructor(){super(...arguments),ie(this,f),ie(this,d,!1),ie(this,u,null),ie(this,c,new Map),ie(this,h),Le(this,"get"),Le(this,"set"),Le(this,"call")}static get observedAttributes(){var x,S,w;return Ne(x=n,o,l).call(x),[...(w=(S=_==null?void 0:_.constructor)==null?void 0:S.observedAttributes)!=null?w:[],...oT]}get nativeEl(){var x,S,w,M,k;return Ne(this,f,m).call(this),(k=(M=(S=(x=I(this,u))!=null?x:this.querySelector(":scope > [slot=media]"))!=null?S:this.querySelector(e))!=null?M:(w=this.shadowRoot)==null?void 0:w.querySelector(e))!=null?k:null}set nativeEl(x){Q(this,u,x)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(x){this.toggleAttribute("muted",x)}get src(){return this.getAttribute("src")}set src(x){this.setAttribute("src",`${x}`)}get preload(){var x,S;return(S=this.getAttribute("preload"))!=null?S:(x=this.nativeEl)==null?void 0:x.preload}set preload(x){this.setAttribute("preload",`${x}`)}init(){var x;if(!this.shadowRoot){this.attachShadow({mode:"open"});let S=IC(this.attributes);t&&(S.is=t),e&&(S.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(S)}this.nativeEl.muted=this.hasAttribute("muted");for(let S of A)Ne(this,f,b).call(this,S);Q(this,h,new MutationObserver(Ne(this,f,g).bind(this))),this.shadowRoot.addEventListener("slotchange",this),Ne(this,f,p).call(this);for(let S of this.constructor.Events)(x=this.shadowRoot)==null||x.addEventListener(S,this,!0)}handleEvent(x){if(x.type==="slotchange"){Ne(this,f,p).call(this);return}x.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(x.type,{detail:x.detail}))}attributeChangedCallback(x,S,w){Ne(this,f,m).call(this),Ne(this,f,T).call(this,x,S,w)}connectedCallback(){Ne(this,f,m).call(this)}},a=new WeakMap,o=new WeakSet,l=function(){if(I(this,a))return;Q(this,a,!0);let x=new Set(this.observedAttributes);x.delete("muted");for(let S of A)if(!(S in this.prototype))if(typeof _[S]=="function")this.prototype[S]=function(...w){return Ne(this,f,m).call(this),(()=>{var M;if(this.call)return this.call(S,...w);let k=(M=this.nativeEl)==null?void 0:M[S];return k==null?void 0:k.apply(this.nativeEl,w)})()};else{let w={get(){var M,k,P;Ne(this,f,m).call(this);let N=S.toLowerCase();if(x.has(N)){let B=this.getAttribute(N);return B===null?!1:B===""?!0:B}return(P=(M=this.get)==null?void 0:M.call(this,S))!=null?P:(k=this.nativeEl)==null?void 0:k[S]}};S!==S.toUpperCase()&&(w.set=function(M){Ne(this,f,m).call(this);let k=S.toLowerCase();if(x.has(k)){M===!0||M===!1||M==null?this.toggleAttribute(k,!!M):this.setAttribute(k,M);return}if(this.set){this.set(S,M);return}this.nativeEl&&(this.nativeEl[S]=M)}),Object.defineProperty(this.prototype,S,w)}},d=new WeakMap,u=new WeakMap,c=new WeakMap,h=new WeakMap,f=new WeakSet,m=function(){I(this,d)||(Q(this,d,!0),this.init())},p=function(){var x;let S=new Map(I(this,c)),w=(x=this.shadowRoot)==null?void 0:x.querySelector("slot:not([name])");(w==null?void 0:w.assignedElements({flatten:!0}).filter(M=>["track","source"].includes(M.localName))).forEach(M=>{var k,P;S.delete(M);let N=I(this,c).get(M);N||(N=M.cloneNode(),I(this,c).set(M,N),(k=I(this,h))==null||k.observe(M,{attributes:!0})),(P=this.nativeEl)==null||P.append(N),Ne(this,f,E).call(this,N)}),S.forEach((M,k)=>{M.remove(),I(this,c).delete(k)})},g=function(x){var S;for(let w of x)if(w.type==="attributes"){let{target:M,attributeName:k}=w,P=I(this,c).get(M);P&&k&&(P.setAttribute(k,(S=M.getAttribute(k))!=null?S:""),Ne(this,f,E).call(this,P))}},E=function(x){x&&x.localName==="track"&&x.default&&(x.kind==="chapters"||x.kind==="metadata")&&x.track.mode==="disabled"&&(x.track.mode="hidden")},b=function(x){if(Object.prototype.hasOwnProperty.call(this,x)){let S=this[x];delete this[x],this[x]=S}},T=function(x,S,w){var M,k,P;["id","class"].includes(x)||!n.observedAttributes.includes(x)&&this.constructor.observedAttributes.includes(x)||(w===null?(M=this.nativeEl)==null||M.removeAttribute(x):((k=this.nativeEl)==null?void 0:k.getAttribute(x))!==w&&((P=this.nativeEl)==null||P.setAttribute(x,w)))},ie(n,o),Le(n,"getTemplateHTML",e.endsWith("audio")?SC:xC),Le(n,"shadowRootOptions",{mode:"open"}),Le(n,"Events",gu),ie(n,a,!1),n}function RC(i){let e=[];for(let t=Object.getPrototypeOf(i);t&&t!==HTMLElement.prototype;t=Object.getPrototypeOf(t)){let r=Object.getOwnPropertyNames(t);e.push(...r)}return e}function dT(i){let e="";for(let t in i){if(!oT.includes(t))continue;let r=i[t];r===""?e+=` ${t}`:e+=` ${t}="${r}"`}return e}function IC(i){let e={};for(let t of i)e[t.name]=t.value;return e}var zy,rp=lT((zy=globalThis.HTMLElement)!=null?zy:class{},{tag:"video"}),Xy,x2=lT((Xy=globalThis.HTMLElement)!=null?Xy:class{},{tag:"audio"}),Ts=new WeakMap,sp=class extends Error{},LC=class extends Error{},kC=globalThis.WeakRef?class extends Set{add(i){super.add(new WeakRef(i))}forEach(i){super.forEach(e=>{let t=e.deref();t&&i(t)})}}:Set;function CC(i){var e,t,r;(t=(e=globalThis.chrome)==null?void 0:e.cast)!=null&&t.isAvailable?(r=globalThis.cast)!=null&&r.framework?i():customElements.whenDefined("google-cast-button").then(i):globalThis.__onGCastApiAvailable=()=>{customElements.whenDefined("google-cast-button").then(i)}}function wC(){return globalThis.chrome}function DC(){var i;let e="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1";if((i=globalThis.chrome)!=null&&i.cast||document.querySelector(`script[src="${e}"]`))return;let t=document.createElement("script");t.src=e,document.head.append(t)}function _s(){var i,e;return(e=(i=globalThis.cast)==null?void 0:i.framework)==null?void 0:e.CastContext.getInstance()}function Tp(){var i;return(i=_s())==null?void 0:i.getCurrentSession()}function _p(){var i;return(i=Tp())==null?void 0:i.getSessionObj().media[0]}function MC(i){return new Promise((e,t)=>{_p().editTracksInfo(i,e,t)})}function PC(i){return new Promise((e,t)=>{_p().getStatus(i,e,t)})}function uT(i){return _s().setOptions({...cT(),...i})}function cT(){return{receiverApplicationId:"CC1AD845",autoJoinPolicy:"origin_scoped",androidReceiverCompatible:!1,language:"en-US",resumeSavedSession:!0}}var ru=new kC,xr=new WeakSet,ot;CC(()=>{var i,e,t,r;if(!((e=(i=globalThis.chrome)==null?void 0:i.cast)!=null&&e.isAvailable)){console.debug("chrome.cast.isAvailable",(r=(t=globalThis.chrome)==null?void 0:t.cast)==null?void 0:r.isAvailable);return}ot||(ot=cast.framework,_s().addEventListener(ot.CastContextEventType.CAST_STATE_CHANGED,s=>{ru.forEach(n=>{var a,o;return(o=(a=Ts.get(n)).onCastStateChanged)==null?void 0:o.call(a,s)})}),_s().addEventListener(ot.CastContextEventType.SESSION_STATE_CHANGED,s=>{ru.forEach(n=>{var a,o;return(o=(a=Ts.get(n)).onSessionStateChanged)==null?void 0:o.call(a,s)})}),ru.forEach(s=>{var n,a;return(a=(n=Ts.get(s)).init)==null?void 0:a.call(n)}))});var Qy=0,Ie,su,jt,Sr,Dn,Ln,ys,ap,bt,os,Zy,op,hT,lp,Jy,np,OC=class extends EventTarget{constructor(i){super(),ie(this,bt),ie(this,Ie),ie(this,su),ie(this,jt),ie(this,Sr),ie(this,Dn,"disconnected"),ie(this,Ln,!1),ie(this,ys,new Set),ie(this,ap,new WeakMap),Q(this,Ie,i),ru.add(this),Ts.set(this,{init:()=>Ne(this,bt,lp).call(this),onCastStateChanged:()=>Ne(this,bt,op).call(this),onSessionStateChanged:()=>Ne(this,bt,hT).call(this),getCastPlayer:()=>I(this,bt,os)}),Ne(this,bt,lp).call(this)}get state(){return I(this,Dn)}async watchAvailability(i){if(I(this,Ie).disableRemotePlayback)throw new sp("disableRemotePlayback attribute is present.");return I(this,ap).set(i,++Qy),I(this,ys).add(i),Qy}async cancelWatchAvailability(i){if(I(this,Ie).disableRemotePlayback)throw new sp("disableRemotePlayback attribute is present.");i?I(this,ys).delete(i):I(this,ys).clear()}async prompt(){var i,e,t,r;if(I(this,Ie).disableRemotePlayback)throw new sp("disableRemotePlayback attribute is present.");if(!((e=(i=globalThis.chrome)==null?void 0:i.cast)!=null&&e.isAvailable))throw new LC("The RemotePlayback API is disabled on this platform.");let s=xr.has(I(this,Ie));xr.add(I(this,Ie)),uT(I(this,Ie).castOptions),Object.entries(I(this,Sr)).forEach(([n,a])=>{I(this,jt).controller.addEventListener(n,a)});try{await _s().requestSession()}catch(n){if(n==="cancel"){s||xr.delete(I(this,Ie));return}throw new Error(n)}(r=(t=Ts.get(I(this,Ie)))==null?void 0:t.loadOnPrompt)==null||r.call(t)}};Ie=new WeakMap,su=new WeakMap,jt=new WeakMap,Sr=new WeakMap,Dn=new WeakMap,Ln=new WeakMap,ys=new WeakMap,ap=new WeakMap,bt=new WeakSet,os=function(){if(xr.has(I(this,Ie)))return I(this,jt)},Zy=function(){xr.has(I(this,Ie))&&(Object.entries(I(this,Sr)).forEach(([i,e])=>{I(this,jt).controller.removeEventListener(i,e)}),xr.delete(I(this,Ie)),I(this,Ie).muted=I(this,jt).isMuted,I(this,Ie).currentTime=I(this,jt).savedPlayerState.currentTime,I(this,jt).savedPlayerState.isPaused===!1&&I(this,Ie).play())},op=function(){let i=_s().getCastState();if(xr.has(I(this,Ie))&&i==="CONNECTING"&&(Q(this,Dn,"connecting"),this.dispatchEvent(new Event("connecting"))),!I(this,Ln)&&i!=null&&i.includes("CONNECT")){Q(this,Ln,!0);for(let e of I(this,ys))e(!0)}else if(I(this,Ln)&&(!i||i==="NO_DEVICES_AVAILABLE")){Q(this,Ln,!1);for(let e of I(this,ys))e(!1)}},hT=async function(){var i;let{SESSION_RESUMED:e}=ot.SessionState;if(_s().getSessionState()===e&&I(this,Ie).castSrc===((i=_p())==null?void 0:i.media.contentId)){xr.add(I(this,Ie)),Object.entries(I(this,Sr)).forEach(([t,r])=>{I(this,jt).controller.addEventListener(t,r)});try{await PC(new chrome.cast.media.GetStatusRequest)}catch(t){console.error(t)}I(this,Sr)[ot.RemotePlayerEventType.IS_PAUSED_CHANGED](),I(this,Sr)[ot.RemotePlayerEventType.PLAYER_STATE_CHANGED]()}},lp=function(){!ot||I(this,su)||(Q(this,su,!0),uT(I(this,Ie).castOptions),I(this,Ie).textTracks.addEventListener("change",()=>Ne(this,bt,np).call(this)),Ne(this,bt,op).call(this),Q(this,jt,new ot.RemotePlayer),new ot.RemotePlayerController(I(this,jt)),Q(this,Sr,{[ot.RemotePlayerEventType.IS_CONNECTED_CHANGED]:({value:i})=>{i===!0?(Q(this,Dn,"connected"),this.dispatchEvent(new Event("connect"))):(Ne(this,bt,Zy).call(this),Q(this,Dn,"disconnected"),this.dispatchEvent(new Event("disconnect")))},[ot.RemotePlayerEventType.DURATION_CHANGED]:()=>{I(this,Ie).dispatchEvent(new Event("durationchange"))},[ot.RemotePlayerEventType.VOLUME_LEVEL_CHANGED]:()=>{I(this,Ie).dispatchEvent(new Event("volumechange"))},[ot.RemotePlayerEventType.IS_MUTED_CHANGED]:()=>{I(this,Ie).dispatchEvent(new Event("volumechange"))},[ot.RemotePlayerEventType.CURRENT_TIME_CHANGED]:()=>{var i;(i=I(this,bt,os))!=null&&i.isMediaLoaded&&I(this,Ie).dispatchEvent(new Event("timeupdate"))},[ot.RemotePlayerEventType.VIDEO_INFO_CHANGED]:()=>{I(this,Ie).dispatchEvent(new Event("resize"))},[ot.RemotePlayerEventType.IS_PAUSED_CHANGED]:()=>{I(this,Ie).dispatchEvent(new Event(this.paused?"pause":"play"))},[ot.RemotePlayerEventType.PLAYER_STATE_CHANGED]:()=>{var i,e;((i=I(this,bt,os))==null?void 0:i.playerState)!==chrome.cast.media.PlayerState.PAUSED&&I(this,Ie).dispatchEvent(new Event({[chrome.cast.media.PlayerState.PLAYING]:"playing",[chrome.cast.media.PlayerState.BUFFERING]:"waiting",[chrome.cast.media.PlayerState.IDLE]:"emptied"}[(e=I(this,bt,os))==null?void 0:e.playerState]))},[ot.RemotePlayerEventType.IS_MEDIA_LOADED_CHANGED]:async()=>{var i;(i=I(this,bt,os))!=null&&i.isMediaLoaded&&(await Promise.resolve(),Ne(this,bt,Jy).call(this))}}))},Jy=function(){Ne(this,bt,np).call(this)},np=async function(){var i,e,t,r,s;if(!I(this,bt,os))return;let n=((e=(i=I(this,jt).mediaInfo)==null?void 0:i.tracks)!=null?e:[]).filter(({type:h})=>h===chrome.cast.media.TrackType.TEXT),a=[...I(this,Ie).textTracks].filter(({kind:h})=>h==="subtitles"||h==="captions"),o=n.map(({language:h,name:f,trackId:m})=>{var p;let{mode:g}=(p=a.find(E=>E.language===h&&E.label===f))!=null?p:{};return g?{mode:g,trackId:m}:!1}).filter(Boolean),l=o.filter(({mode:h})=>h!=="showing").map(({trackId:h})=>h),d=o.find(({mode:h})=>h==="showing"),u=(s=(r=(t=Tp())==null?void 0:t.getSessionObj().media[0])==null?void 0:r.activeTrackIds)!=null?s:[],c=u;if(u.length&&(c=c.filter(h=>!l.includes(h))),d!=null&&d.trackId&&(c=[...c,d.trackId]),c=[...new Set(c)],!((h,f)=>h.length===f.length&&h.every(m=>f.includes(m)))(u,c))try{let h=new chrome.cast.media.EditTracksInfoRequest(c);await MC(h)}catch(h){console.error(h)}};var NC=i=>{var e,t,r,s,n,a,o,l,d;return t=class extends i{constructor(){super(...arguments),ie(this,o),ie(this,r,{paused:!1}),ie(this,s,cT()),ie(this,n),ie(this,a)}get remote(){return I(this,a)?I(this,a):wC()?(this.disableRemotePlayback||DC(),Ts.set(this,{loadOnPrompt:()=>Ne(this,o,d).call(this)}),Q(this,a,new OC(this))):super.remote}attributeChangedCallback(u,c,h){if(super.attributeChangedCallback(u,c,h),u==="cast-receiver"&&h){I(this,s).receiverApplicationId=h;return}if(I(this,o,l))switch(u){case"cast-stream-type":case"cast-src":this.load();break}}async load(){var u,c;if(!I(this,o,l))return super.load();let h=new chrome.cast.media.MediaInfo(this.castSrc,this.castContentType);h.customData=this.castCustomData;let f=[...this.querySelectorAll("track")].filter(({kind:E,src:b})=>b&&(E==="subtitles"||E==="captions")),m=[],p=0;f.length&&(h.tracks=f.map(E=>{let b=++p;m.length===0&&E.track.mode==="showing"&&m.push(b);let T=new chrome.cast.media.Track(b,chrome.cast.media.TrackType.TEXT);return T.trackContentId=E.src,T.trackContentType="text/vtt",T.subtype=E.kind==="captions"?chrome.cast.media.TextTrackType.CAPTIONS:chrome.cast.media.TextTrackType.SUBTITLES,T.name=E.label,T.language=E.srclang,T})),this.castStreamType==="live"?h.streamType=chrome.cast.media.StreamType.LIVE:h.streamType=chrome.cast.media.StreamType.BUFFERED,h.metadata=new chrome.cast.media.GenericMediaMetadata,h.metadata.title=this.title,h.metadata.images=[{url:this.poster}];let g=new chrome.cast.media.LoadRequest(h);g.currentTime=(u=super.currentTime)!=null?u:0,g.autoplay=!I(this,r).paused,g.activeTrackIds=m,await((c=Tp())==null?void 0:c.loadMedia(g)),this.dispatchEvent(new Event("volumechange"))}play(){var u;if(I(this,o,l)){I(this,o,l).isPaused&&((u=I(this,o,l).controller)==null||u.playOrPause());return}return super.play()}pause(){var u;if(I(this,o,l)){I(this,o,l).isPaused||(u=I(this,o,l).controller)==null||u.playOrPause();return}super.pause()}get castOptions(){return I(this,s)}get castReceiver(){var u;return(u=this.getAttribute("cast-receiver"))!=null?u:void 0}set castReceiver(u){this.castReceiver!=u&&this.setAttribute("cast-receiver",`${u}`)}get castSrc(){var u,c,h;return(h=(c=this.getAttribute("cast-src"))!=null?c:(u=this.querySelector("source"))==null?void 0:u.src)!=null?h:this.currentSrc}set castSrc(u){this.castSrc!=u&&this.setAttribute("cast-src",`${u}`)}get castContentType(){var u;return(u=this.getAttribute("cast-content-type"))!=null?u:void 0}set castContentType(u){this.setAttribute("cast-content-type",`${u}`)}get castStreamType(){var u,c;return(c=(u=this.getAttribute("cast-stream-type"))!=null?u:this.streamType)!=null?c:void 0}set castStreamType(u){this.setAttribute("cast-stream-type",`${u}`)}get castCustomData(){return I(this,n)}set castCustomData(u){let c=typeof u;if(!["object","undefined"].includes(c)){console.error(`castCustomData must be nullish or an object but value was of type ${c}`);return}Q(this,n,u)}get readyState(){if(I(this,o,l))switch(I(this,o,l).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 I(this,o,l)?I(this,o,l).isPaused:super.paused}get muted(){var u;return I(this,o,l)?(u=I(this,o,l))==null?void 0:u.isMuted:super.muted}set muted(u){var c;if(I(this,o,l)){(u&&!I(this,o,l).isMuted||!u&&I(this,o,l).isMuted)&&((c=I(this,o,l).controller)==null||c.muteOrUnmute());return}super.muted=u}get volume(){var u,c;return I(this,o,l)?(c=(u=I(this,o,l))==null?void 0:u.volumeLevel)!=null?c:1:super.volume}set volume(u){var c;if(I(this,o,l)){I(this,o,l).volumeLevel=+u,(c=I(this,o,l).controller)==null||c.setVolumeLevel();return}super.volume=u}get duration(){var u,c,h;return I(this,o,l)&&(u=I(this,o,l))!=null&&u.isMediaLoaded?(h=(c=I(this,o,l))==null?void 0:c.duration)!=null?h:NaN:super.duration}get currentTime(){var u,c,h;return I(this,o,l)&&(u=I(this,o,l))!=null&&u.isMediaLoaded?(h=(c=I(this,o,l))==null?void 0:c.currentTime)!=null?h:0:super.currentTime}set currentTime(u){var c;if(I(this,o,l)){I(this,o,l).currentTime=u,(c=I(this,o,l).controller)==null||c.seek();return}super.currentTime=u}},r=new WeakMap,s=new WeakMap,n=new WeakMap,a=new WeakMap,o=new WeakSet,l=function(){var u,c;return(c=(u=Ts.get(this.remote))==null?void 0:u.getCastPlayer)==null?void 0:c.call(u)},d=async function(){I(this,r).paused=tp(t.prototype,this,"paused"),tp(t.prototype,this,"pause").call(this),this.muted=tp(t.prototype,this,"muted");try{await this.load()}catch(u){console.error(u)}},Le(t,"observedAttributes",[...(e=i.observedAttributes)!=null?e:[],"cast-src","cast-content-type","cast-stream-type","cast-receiver"]),t},vu=class extends Event{constructor(i,e){super(i),Le(this,"track"),this.track=e.track}},dp=new WeakMap;function Y(i){var e;return(e=dp.get(i))!=null?e:UC(i,{})}function UC(i,e){let t=dp.get(i);return t||dp.set(i,t={}),Object.assign(t,e)}function up(i,e){let t=i.videoTracks;Y(e).media=i,Y(e).renditionSet||(Y(e).renditionSet=new Set);let r=Y(t).trackSet;r.add(e);let s=r.size-1;s in hp.prototype||Object.defineProperty(hp.prototype,s,{get(){return[...Y(this).trackSet][s]}}),queueMicrotask(()=>{t.dispatchEvent(new vu("addtrack",{track:e}))})}function cp(i){var e;let t=(e=Y(i).media)==null?void 0:e.videoTracks;t&&(Y(t).trackSet.delete(i),queueMicrotask(()=>{t.dispatchEvent(new vu("removetrack",{track:i}))}))}function FC(i){var e;let t=(e=Y(i).media.videoTracks)!=null?e:[],r=!1;for(let s of t)s!==i&&(s.selected=!1,r=!0);if(r){if(Y(t).changeRequested)return;Y(t).changeRequested=!0,queueMicrotask(()=>{delete Y(t).changeRequested,t.dispatchEvent(new Event("change"))})}}var ls,ds,us,kn,Va,hp=class extends EventTarget{constructor(){super(),ie(this,kn),ie(this,ls),ie(this,ds),ie(this,us),Y(this).trackSet=new Set}[Symbol.iterator](){return I(this,kn,Va).values()}get length(){return I(this,kn,Va).size}getTrackById(i){var e;return(e=[...I(this,kn,Va)].find(t=>t.id===i))!=null?e:null}get selectedIndex(){return[...I(this,kn,Va)].findIndex(i=>i.selected)}get onaddtrack(){return I(this,ls)}set onaddtrack(i){I(this,ls)&&(this.removeEventListener("addtrack",I(this,ls)),Q(this,ls,void 0)),typeof i=="function"&&(Q(this,ls,i),this.addEventListener("addtrack",i))}get onremovetrack(){return I(this,ds)}set onremovetrack(i){I(this,ds)&&(this.removeEventListener("removetrack",I(this,ds)),Q(this,ds,void 0)),typeof i=="function"&&(Q(this,ds,i),this.addEventListener("removetrack",i))}get onchange(){return I(this,us)}set onchange(i){I(this,us)&&(this.removeEventListener("change",I(this,us)),Q(this,us,void 0)),typeof i=="function"&&(Q(this,us,i),this.addEventListener("change",i))}};ls=new WeakMap,ds=new WeakMap,us=new WeakMap,kn=new WeakSet,Va=function(){return Y(this).trackSet};var Eu=class extends Event{constructor(i,e){super(i),Le(this,"rendition"),this.rendition=e.rendition}};function BC(i,e){let t=Y(i).media.videoRenditions;Y(e).media=Y(i).media,Y(e).track=i;let r=Y(i).renditionSet;r.add(e);let s=r.size-1;s in fp.prototype||Object.defineProperty(fp.prototype,s,{get(){return Cn(this)[s]}}),queueMicrotask(()=>{i.selected&&t.dispatchEvent(new Eu("addrendition",{rendition:e}))})}function $C(i){let e=Y(i).media.videoRenditions,t=Y(i).track;Y(t).renditionSet.delete(i),queueMicrotask(()=>{Y(i).track.selected&&e.dispatchEvent(new Eu("removerendition",{rendition:i}))})}function HC(i){let e=Y(i).media.videoRenditions;!e||Y(e).changeRequested||(Y(e).changeRequested=!0,queueMicrotask(()=>{delete Y(e).changeRequested,Y(i).track.selected&&e.dispatchEvent(new Event("change"))}))}function Cn(i){return[...Y(i).media.videoTracks].filter(e=>e.selected).flatMap(e=>[...Y(e).renditionSet])}var cs,hs,fs,fp=class extends EventTarget{constructor(){super(...arguments),ie(this,cs),ie(this,hs),ie(this,fs)}[Symbol.iterator](){return Cn(this).values()}get length(){return Cn(this).length}getRenditionById(i){var e;return(e=Cn(this).find(t=>`${t.id}`==`${i}`))!=null?e:null}get selectedIndex(){return Cn(this).findIndex(i=>i.selected)}set selectedIndex(i){for(let[e,t]of Cn(this).entries())t.selected=e===i}get onaddrendition(){return I(this,cs)}set onaddrendition(i){I(this,cs)&&(this.removeEventListener("addrendition",I(this,cs)),Q(this,cs,void 0)),typeof i=="function"&&(Q(this,cs,i),this.addEventListener("addrendition",i))}get onremoverendition(){return I(this,hs)}set onremoverendition(i){I(this,hs)&&(this.removeEventListener("removerendition",I(this,hs)),Q(this,hs,void 0)),typeof i=="function"&&(Q(this,hs,i),this.addEventListener("removerendition",i))}get onchange(){return I(this,fs)}set onchange(i){I(this,fs)&&(this.removeEventListener("change",I(this,fs)),Q(this,fs,void 0)),typeof i=="function"&&(Q(this,fs,i),this.addEventListener("change",i))}};cs=new WeakMap,hs=new WeakMap,fs=new WeakMap;var Wa,GC=class{constructor(){Le(this,"src"),Le(this,"id"),Le(this,"width"),Le(this,"height"),Le(this,"bitrate"),Le(this,"frameRate"),Le(this,"codec"),ie(this,Wa,!1)}get selected(){return I(this,Wa)}set selected(i){I(this,Wa)!==i&&(Q(this,Wa,i),HC(this))}};Wa=new WeakMap;var Ya,fT=class{constructor(){Le(this,"id"),Le(this,"kind"),Le(this,"label",""),Le(this,"language",""),Le(this,"sourceBuffer"),ie(this,Ya,!1)}addRendition(i,e,t,r,s,n){let a=new GC;return a.src=i,a.width=e,a.height=t,a.frameRate=n,a.bitrate=s,a.codec=r,BC(this,a),a}removeRendition(i){$C(i)}get selected(){return I(this,Ya)}set selected(i){I(this,Ya)!==i&&(Q(this,Ya,i),i===!0&&FC(this))}};Ya=new WeakMap;function KC(i,e){let t=Y(i).media.audioRenditions;Y(e).media=Y(i).media,Y(e).track=i;let r=Y(i).renditionSet;r.add(e);let s=r.size-1;s in mp.prototype||Object.defineProperty(mp.prototype,s,{get(){return wn(this)[s]}}),queueMicrotask(()=>{i.enabled&&t.dispatchEvent(new Eu("addrendition",{rendition:e}))})}function VC(i){let e=Y(i).media.audioRenditions,t=Y(i).track;Y(t).renditionSet.delete(i),queueMicrotask(()=>{Y(i).track.enabled&&e.dispatchEvent(new Eu("removerendition",{rendition:i}))})}function WC(i){let e=Y(i).media.audioRenditions;!e||Y(e).changeRequested||(Y(e).changeRequested=!0,queueMicrotask(()=>{delete Y(e).changeRequested,Y(i).track.enabled&&e.dispatchEvent(new Event("change"))}))}function wn(i){return[...Y(i).media.audioTracks].filter(e=>e.enabled).flatMap(e=>[...Y(e).renditionSet])}var ms,ps,gs,mp=class extends EventTarget{constructor(){super(...arguments),ie(this,ms),ie(this,ps),ie(this,gs)}[Symbol.iterator](){return wn(this).values()}get length(){return wn(this).length}getRenditionById(i){var e;return(e=wn(this).find(t=>`${t.id}`==`${i}`))!=null?e:null}get selectedIndex(){return wn(this).findIndex(i=>i.selected)}set selectedIndex(i){for(let[e,t]of wn(this).entries())t.selected=e===i}get onaddrendition(){return I(this,ms)}set onaddrendition(i){I(this,ms)&&(this.removeEventListener("addrendition",I(this,ms)),Q(this,ms,void 0)),typeof i=="function"&&(Q(this,ms,i),this.addEventListener("addrendition",i))}get onremoverendition(){return I(this,ps)}set onremoverendition(i){I(this,ps)&&(this.removeEventListener("removerendition",I(this,ps)),Q(this,ps,void 0)),typeof i=="function"&&(Q(this,ps,i),this.addEventListener("removerendition",i))}get onchange(){return I(this,gs)}set onchange(i){I(this,gs)&&(this.removeEventListener("change",I(this,gs)),Q(this,gs,void 0)),typeof i=="function"&&(Q(this,gs,i),this.addEventListener("change",i))}};ms=new WeakMap,ps=new WeakMap,gs=new WeakMap;var qa,YC=class{constructor(){Le(this,"src"),Le(this,"id"),Le(this,"bitrate"),Le(this,"codec"),ie(this,qa,!1)}get selected(){return I(this,qa)}set selected(i){I(this,qa)!==i&&(Q(this,qa,i),WC(this))}};qa=new WeakMap;function pp(i,e){let t=i.audioTracks;Y(e).media=i,Y(e).renditionSet||(Y(e).renditionSet=new Set);let r=Y(t).trackSet;r.add(e);let s=r.size-1;s in vp.prototype||Object.defineProperty(vp.prototype,s,{get(){return[...Y(this).trackSet][s]}}),queueMicrotask(()=>{t.dispatchEvent(new vu("addtrack",{track:e}))})}function gp(i){var e;let t=(e=Y(i).media)==null?void 0:e.audioTracks;t&&(Y(t).trackSet.delete(i),queueMicrotask(()=>{t.dispatchEvent(new vu("removetrack",{track:i}))}))}function qC(i){let e=Y(i).media.audioTracks;!e||Y(e).changeRequested||(Y(e).changeRequested=!0,queueMicrotask(()=>{delete Y(e).changeRequested,e.dispatchEvent(new Event("change"))}))}var vs,Es,bs,ja,nu,vp=class extends EventTarget{constructor(){super(),ie(this,ja),ie(this,vs),ie(this,Es),ie(this,bs),Y(this).trackSet=new Set}[Symbol.iterator](){return I(this,ja,nu).values()}get length(){return I(this,ja,nu).size}getTrackById(i){var e;return(e=[...I(this,ja,nu)].find(t=>t.id===i))!=null?e:null}get onaddtrack(){return I(this,vs)}set onaddtrack(i){I(this,vs)&&(this.removeEventListener("addtrack",I(this,vs)),Q(this,vs,void 0)),typeof i=="function"&&(Q(this,vs,i),this.addEventListener("addtrack",i))}get onremovetrack(){return I(this,Es)}set onremovetrack(i){I(this,Es)&&(this.removeEventListener("removetrack",I(this,Es)),Q(this,Es,void 0)),typeof i=="function"&&(Q(this,Es,i),this.addEventListener("removetrack",i))}get onchange(){return I(this,bs)}set onchange(i){I(this,bs)&&(this.removeEventListener("change",I(this,bs)),Q(this,bs,void 0)),typeof i=="function"&&(Q(this,bs,i),this.addEventListener("change",i))}};vs=new WeakMap,Es=new WeakMap,bs=new WeakMap,ja=new WeakSet,nu=function(){return Y(this).trackSet};var za,mT=class{constructor(){Le(this,"id"),Le(this,"kind"),Le(this,"label",""),Le(this,"language",""),Le(this,"sourceBuffer"),ie(this,za,!1)}addRendition(i,e,t){let r=new YC;return r.src=i,r.codec=e,r.bitrate=t,KC(this,r),r}removeRendition(i){VC(i)}get enabled(){return I(this,za)}set enabled(i){I(this,za)!==i&&(Q(this,za,i),qC(this))}};za=new WeakMap;var eT=mu(globalThis.HTMLMediaElement,"video"),tT=mu(globalThis.HTMLMediaElement,"audio");function jC(i){if(!(i!=null&&i.prototype))return i;let e=mu(i,"video");(!e||`${e}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"videoTracks",{get(){return zC(this)}});let t=mu(i,"audio");(!t||`${t}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"audioTracks",{get(){return XC(this)}}),"addVideoTrack"in i.prototype||(i.prototype.addVideoTrack=function(n,a="",o=""){let l=new fT;return l.kind=n,l.label=a,l.language=o,up(this,l),l}),"removeVideoTrack"in i.prototype||(i.prototype.removeVideoTrack=cp),"addAudioTrack"in i.prototype||(i.prototype.addAudioTrack=function(n,a="",o=""){let l=new mT;return l.kind=n,l.label=a,l.language=o,pp(this,l),l}),"removeAudioTrack"in i.prototype||(i.prototype.removeAudioTrack=gp),"videoRenditions"in i.prototype||Object.defineProperty(i.prototype,"videoRenditions",{get(){return r(this)}});let r=n=>{let a=Y(n).videoRenditions;return a||(a=new fp,Y(a).media=n,Y(n).videoRenditions=a),a};"audioRenditions"in i.prototype||Object.defineProperty(i.prototype,"audioRenditions",{get(){return s(this)}});let s=n=>{let a=Y(n).audioRenditions;return a||(a=new mp,Y(a).media=n,Y(n).audioRenditions=a),a};return i}function mu(i,e){var t;if(i!=null&&i.prototype)return(t=Object.getOwnPropertyDescriptor(i.prototype,`${e}Tracks`))==null?void 0:t.get}function zC(i){var e;let t=Y(i).videoTracks;if(!t&&(t=new hp,Y(i).videoTracks=t,eT)){let r=eT.call((e=i.nativeEl)!=null?e:i);for(let s of r)up(i,s);r.addEventListener("change",()=>{t.dispatchEvent(new Event("change"))}),r.addEventListener("addtrack",s=>{if([...t].some(n=>n instanceof fT)){for(let n of r)cp(n);return}up(i,s.track)}),r.addEventListener("removetrack",s=>{cp(s.track)})}return t}function XC(i){var e;let t=Y(i).audioTracks;if(!t&&(t=new vp,Y(i).audioTracks=t,tT)){let r=tT.call((e=i.nativeEl)!=null?e:i);for(let s of r)pp(i,s);r.addEventListener("change",()=>{t.dispatchEvent(new Event("change"))}),r.addEventListener("addtrack",s=>{if([...t].some(n=>n instanceof mT)){for(let n of r)gp(n);return}pp(i,s.track)}),r.addEventListener("removetrack",s=>{gp(s.track)})}return t}gu.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",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"},QC=Object.values(C),iT=AC(),rT="mux-video",Pi,Xa,au,Qa,ou,lu,du,uu,cu,Za,hu,ZC=class extends rp{constructor(){super(),ie(this,Za),ie(this,Pi),ie(this,Xa),ie(this,au),ie(this,Qa,{}),ie(this,ou,{}),ie(this,lu),ie(this,du),ie(this,uu),ie(this,cu),Q(this,au,Jd())}static get NAME(){return rT}static get VERSION(){return iT}static get observedAttributes(){var i;return[...QC,...(i=rp.observedAttributes)!=null?i:[]]}get preferCmcd(){var i;return(i=this.getAttribute(C.PREFER_CMCD))!=null?i:void 0}set preferCmcd(i){i!==this.preferCmcd&&(i?In.includes(i)?this.setAttribute(C.PREFER_CMCD,i):console.warn(`Invalid value for preferCmcd. Must be one of ${In.join()}`):this.removeAttribute(C.PREFER_CMCD))}get playerInitTime(){return this.hasAttribute(C.PLAYER_INIT_TIME)?+this.getAttribute(C.PLAYER_INIT_TIME):I(this,au)}set playerInitTime(i){i!=this.playerInitTime&&(i==null?this.removeAttribute(C.PLAYER_INIT_TIME):this.setAttribute(C.PLAYER_INIT_TIME,`${+i}`))}get playerSoftwareName(){var i;return(i=I(this,uu))!=null?i:rT}set playerSoftwareName(i){Q(this,uu,i)}get playerSoftwareVersion(){var i;return(i=I(this,du))!=null?i:iT}set playerSoftwareVersion(i){Q(this,du,i)}get _hls(){var i;return(i=I(this,Pi))==null?void 0:i.engine}get mux(){var i;return(i=this.nativeEl)==null?void 0:i.mux}get error(){var i;return(i=Qm(this.nativeEl))!=null?i:null}get errorTranslator(){return I(this,cu)}set errorTranslator(i){Q(this,cu,i)}get src(){return this.getAttribute("src")}set src(i){i!==this.src&&(i==null?this.removeAttribute("src"):this.setAttribute("src",i))}get type(){var i;return(i=this.getAttribute(C.TYPE))!=null?i:void 0}set type(i){i!==this.type&&(i?this.setAttribute(C.TYPE,i):this.removeAttribute(C.TYPE))}get autoplay(){let i=this.getAttribute("autoplay");return i===null?!1:i===""?!0:i}set autoplay(i){let e=this.autoplay;i!==e&&(i?this.setAttribute("autoplay",typeof i=="string"?i:""):this.removeAttribute("autoplay"))}get preload(){let i=this.getAttribute("preload");return i===""?"auto":["none","metadata","auto"].includes(i)?i:super.preload}set preload(i){i!=this.getAttribute("preload")&&(["","none","metadata","auto"].includes(i)?this.setAttribute("preload",i):this.removeAttribute("preload"))}get debug(){return this.getAttribute(C.DEBUG)!=null}set debug(i){i!==this.debug&&(i?this.setAttribute(C.DEBUG,""):this.removeAttribute(C.DEBUG))}get disableTracking(){return this.hasAttribute(C.DISABLE_TRACKING)}set disableTracking(i){i!==this.disableTracking&&this.toggleAttribute(C.DISABLE_TRACKING,!!i)}get disableCookies(){return this.hasAttribute(C.DISABLE_COOKIES)}set disableCookies(i){i!==this.disableCookies&&(i?this.setAttribute(C.DISABLE_COOKIES,""):this.removeAttribute(C.DISABLE_COOKIES))}get startTime(){let i=this.getAttribute(C.START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set startTime(i){i!==this.startTime&&(i==null?this.removeAttribute(C.START_TIME):this.setAttribute(C.START_TIME,`${i}`))}get playbackId(){var i;return this.hasAttribute(C.PLAYBACK_ID)?this.getAttribute(C.PLAYBACK_ID):(i=Xm(this.src))!=null?i:void 0}set playbackId(i){i!==this.playbackId&&(i?this.setAttribute(C.PLAYBACK_ID,i):this.removeAttribute(C.PLAYBACK_ID))}get maxResolution(){var i;return(i=this.getAttribute(C.MAX_RESOLUTION))!=null?i:void 0}set maxResolution(i){i!==this.maxResolution&&(i?this.setAttribute(C.MAX_RESOLUTION,i):this.removeAttribute(C.MAX_RESOLUTION))}get minResolution(){var i;return(i=this.getAttribute(C.MIN_RESOLUTION))!=null?i:void 0}set minResolution(i){i!==this.minResolution&&(i?this.setAttribute(C.MIN_RESOLUTION,i):this.removeAttribute(C.MIN_RESOLUTION))}get renditionOrder(){var i;return(i=this.getAttribute(C.RENDITION_ORDER))!=null?i:void 0}set renditionOrder(i){i!==this.renditionOrder&&(i?this.setAttribute(C.RENDITION_ORDER,i):this.removeAttribute(C.RENDITION_ORDER))}get programStartTime(){let i=this.getAttribute(C.PROGRAM_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programStartTime(i){i==null?this.removeAttribute(C.PROGRAM_START_TIME):this.setAttribute(C.PROGRAM_START_TIME,`${i}`)}get programEndTime(){let i=this.getAttribute(C.PROGRAM_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programEndTime(i){i==null?this.removeAttribute(C.PROGRAM_END_TIME):this.setAttribute(C.PROGRAM_END_TIME,`${i}`)}get assetStartTime(){let i=this.getAttribute(C.ASSET_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetStartTime(i){i==null?this.removeAttribute(C.ASSET_START_TIME):this.setAttribute(C.ASSET_START_TIME,`${i}`)}get assetEndTime(){let i=this.getAttribute(C.ASSET_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetEndTime(i){i==null?this.removeAttribute(C.ASSET_END_TIME):this.setAttribute(C.ASSET_END_TIME,`${i}`)}get customDomain(){var i;return(i=this.getAttribute(C.CUSTOM_DOMAIN))!=null?i:void 0}set customDomain(i){i!==this.customDomain&&(i?this.setAttribute(C.CUSTOM_DOMAIN,i):this.removeAttribute(C.CUSTOM_DOMAIN))}get drmToken(){var i;return(i=this.getAttribute(C.DRM_TOKEN))!=null?i:void 0}set drmToken(i){i!==this.drmToken&&(i?this.setAttribute(C.DRM_TOKEN,i):this.removeAttribute(C.DRM_TOKEN))}get playbackToken(){var i,e,t,r;if(this.hasAttribute(C.PLAYBACK_TOKEN))return(i=this.getAttribute(C.PLAYBACK_TOKEN))!=null?i:void 0;if(this.hasAttribute(C.PLAYBACK_ID)){let[,s]=Xd((e=this.playbackId)!=null?e:"");return(t=new URLSearchParams(s).get("token"))!=null?t:void 0}if(this.src)return(r=new URLSearchParams(this.src).get("token"))!=null?r:void 0}set playbackToken(i){i!==this.playbackToken&&(i?this.setAttribute(C.PLAYBACK_TOKEN,i):this.removeAttribute(C.PLAYBACK_TOKEN))}get tokens(){let i=this.getAttribute(C.PLAYBACK_TOKEN),e=this.getAttribute(C.DRM_TOKEN);return{...I(this,ou),...i!=null?{playback:i}:{},...e!=null?{drm:e}:{}}}set tokens(i){Q(this,ou,i!=null?i:{})}get ended(){return Jm(this.nativeEl,this._hls)}get envKey(){var i;return(i=this.getAttribute(C.ENV_KEY))!=null?i:void 0}set envKey(i){i!==this.envKey&&(i?this.setAttribute(C.ENV_KEY,i):this.removeAttribute(C.ENV_KEY))}get beaconCollectionDomain(){var i;return(i=this.getAttribute(C.BEACON_COLLECTION_DOMAIN))!=null?i:void 0}set beaconCollectionDomain(i){i!==this.beaconCollectionDomain&&(i?this.setAttribute(C.BEACON_COLLECTION_DOMAIN,i):this.removeAttribute(C.BEACON_COLLECTION_DOMAIN))}get streamType(){var i;return(i=this.getAttribute(C.STREAM_TYPE))!=null?i:zd(this.nativeEl)}set streamType(i){i!==this.streamType&&(i?this.setAttribute(C.STREAM_TYPE,i):this.removeAttribute(C.STREAM_TYPE))}get targetLiveWindow(){return this.hasAttribute(C.TARGET_LIVE_WINDOW)?+this.getAttribute(C.TARGET_LIVE_WINDOW):By(this.nativeEl)}set targetLiveWindow(i){i!=this.targetLiveWindow&&(i==null?this.removeAttribute(C.TARGET_LIVE_WINDOW):this.setAttribute(C.TARGET_LIVE_WINDOW,`${+i}`))}get liveEdgeStart(){var i,e;if(this.hasAttribute(C.LIVE_EDGE_OFFSET)){let{liveEdgeOffset:t}=this,r=(i=this.nativeEl.seekable.end(0))!=null?i:0,s=(e=this.nativeEl.seekable.start(0))!=null?e:0;return Math.max(s,r-t)}return $y(this.nativeEl)}get liveEdgeOffset(){if(this.hasAttribute(C.LIVE_EDGE_OFFSET))return+this.getAttribute(C.LIVE_EDGE_OFFSET)}set liveEdgeOffset(i){i!=this.liveEdgeOffset&&(i==null?this.removeAttribute(C.LIVE_EDGE_OFFSET):this.setAttribute(C.LIVE_EDGE_OFFSET,`${+i}`))}get seekable(){return tu(this.nativeEl)}async addCuePoints(i){return Wm(this.nativeEl,i)}get activeCuePoint(){return Ym(this.nativeEl)}get cuePoints(){return wy(this.nativeEl)}async addChapters(i){return jm(this.nativeEl,i)}get activeChapter(){return zm(this.nativeEl)}get chapters(){return My(this.nativeEl)}getStartDate(){return Py(this.nativeEl,this._hls)}get currentPdt(){return Oy(this.nativeEl,this._hls)}get preferPlayback(){let i=this.getAttribute(C.PREFER_PLAYBACK);if(i===qt.MSE||i===qt.NATIVE)return i}set preferPlayback(i){i!==this.preferPlayback&&(i===qt.MSE||i===qt.NATIVE?this.setAttribute(C.PREFER_PLAYBACK,i):this.removeAttribute(C.PREFER_PLAYBACK))}get metadata(){return{...this.getAttributeNames().filter(i=>i.startsWith("metadata-")&&![C.METADATA_URL].includes(i)).reduce((i,e)=>{let t=this.getAttribute(e);return t!=null&&(i[e.replace(/^metadata-/,"").replace(/-/g,"_")]=t),i},{}),...I(this,Qa)}}set metadata(i){Q(this,Qa,i!=null?i:{}),this.mux&&this.mux.emit("hb",I(this,Qa))}get _hlsConfig(){return I(this,lu)}set _hlsConfig(i){Q(this,lu,i)}load(){Q(this,Pi,Ky(this,this.nativeEl,I(this,Pi)))}unload(){ep(this.nativeEl,I(this,Pi)),Q(this,Pi,void 0)}attributeChangedCallback(i,e,t){var r,s;switch(rp.observedAttributes.includes(i)&&!["src","autoplay","preload"].includes(i)&&super.attributeChangedCallback(i,e,t),i){case C.PLAYER_SOFTWARE_NAME:this.playerSoftwareName=t!=null?t:void 0;break;case C.PLAYER_SOFTWARE_VERSION:this.playerSoftwareVersion=t!=null?t:void 0;break;case"src":{let n=!!e,a=!!t;!n&&a?Ne(this,Za,hu).call(this):n&&!a?this.unload():n&&a&&(this.unload(),Ne(this,Za,hu).call(this));break}case"autoplay":if(t===e)break;(r=I(this,Pi))==null||r.setAutoplay(this.autoplay);break;case"preload":if(t===e)break;(s=I(this,Pi))==null||s.setPreload(t);break;case C.PLAYBACK_ID:this.src=Ka(this);break;case C.DEBUG:{let n=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=n);break}case C.METADATA_URL:t&&fetch(t).then(n=>n.json()).then(n=>this.metadata=n).catch(()=>console.error(`Unable to load or parse metadata JSON from metadata-url ${t}!`));break;case C.STREAM_TYPE:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("streamtypechange",{composed:!0,bubbles:!0}));break;case C.TARGET_LIVE_WINDOW:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("targetlivewindowchange",{composed:!0,bubbles:!0,detail:this.targetLiveWindow}));break;default:break}}connectedCallback(){var i;(i=super.connectedCallback)==null||i.call(this),this.nativeEl&&this.src&&!I(this,Pi)&&Ne(this,Za,hu).call(this)}disconnectedCallback(){this.unload()}};Pi=new WeakMap,Xa=new WeakMap,au=new WeakMap,Qa=new WeakMap,ou=new WeakMap,lu=new WeakMap,du=new WeakMap,uu=new WeakMap,cu=new WeakMap,Za=new WeakSet,hu=async function(){I(this,Xa)||(await Q(this,Xa,Promise.resolve()),Q(this,Xa,null),this.load())};var fu,Ep=class extends NC(jC(ZC)){constructor(){super(...arguments),ie(this,fu)}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 i;return(i=I(this,fu))!=null?i:this.muxCastCustomData}set castCustomData(i){Q(this,fu,i)}};fu=new WeakMap;ip.customElements.get("mux-video")||(ip.customElements.define("mux-video",Ep),ip.MuxVideoElement=Ep);var pT=Ep;function gT(i){let e="";return Object.entries(i).forEach(([t,r])=>{r!=null&&(e+=`${bu(t)}: ${r}; `)}),e?e.trim():void 0}function bu(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function yu(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Rt(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function Ap(i){let e=JC(i).toString();return e?"?"+e:""}function JC(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var Sp=(i,e)=>!i||!e?!1:i.contains(e)?!0:Sp(i,e.getRootNode().host);var vT="mux.com",ew=()=>{try{return"3.2.3"}catch{}return"UNKNOWN"},tw=ew(),_u=()=>tw,ET=(i,{token:e,customDomain:t=vT,thumbnailTime:r,programTime:s}={})=>{var o;let n=e==null?r:void 0,{aud:a}=(o=Ar(e))!=null?o:{};if(!(e&&a!=="t"))return`https://image.${t}/${i}/thumbnail.webp${Ap({token:e,time:n,program_time:s})}`},bT=(i,{token:e,customDomain:t=vT,programStartTime:r,programEndTime:s}={})=>{var a;let{aud:n}=(a=Ar(e))!=null?a:{};if(!(e&&n!=="s"))return`https://image.${t}/${i}/storyboard.vtt${Ap({token:e,format:"webp",program_start_time:r,program_end_time:s})}`},Ja=i=>{if(i){if([Re.LIVE,Re.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return Re.LIVE}};var iw={crossorigin:"crossOrigin",playsinline:"playsInline"};function yT(i){var e;return(e=iw[i])!=null?e:yu(i)}var As,Ss,It,Tu=class{constructor(e,t){kt(this,As);kt(this,Ss);kt(this,It,[]);$t(this,As,e),$t(this,Ss,t)}[Symbol.iterator](){return _e(this,It).values()}get length(){return _e(this,It).length}get value(){var e;return(e=_e(this,It).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&($t(this,It,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return _e(this,It)[e]}values(){return _e(this,It).values()}keys(){return _e(this,It).keys()}forEach(e){_e(this,It).forEach(e)}add(...e){var t,r;e.forEach(s=>{this.contains(s)||_e(this,It).push(s)}),!(this.value===""&&!((t=_e(this,As))!=null&&t.hasAttribute(`${_e(this,Ss)}`)))&&((r=_e(this,As))==null||r.setAttribute(`${_e(this,Ss)}`,`${this.value}`))}remove(...e){var t;e.forEach(r=>{_e(this,It).splice(_e(this,It).indexOf(r),1)}),(t=_e(this,As))==null||t.setAttribute(`${_e(this,Ss)}`,`${this.value}`)}contains(e){return _e(this,It).includes(e)}toggle(e,t){return typeof t!="undefined"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){this.remove(e),this.add(t)}};As=new WeakMap,Ss=new WeakMap,It=new WeakMap;var TT=`[mux-player ${_u()}]`;function Oi(...i){console.warn(TT,...i)}function Ut(...i){console.error(TT,...i)}function xp(i){var t;let e=(t=i.message)!=null?t:"";i.context&&(e+=` ${i.context}`),i.file&&(e+=` ${j("Read more: ")}
|
|
1316
|
+
`}function lT(i,{tag:e,is:t}){var r,s,n,a,o,l,d,u,c,h,f,m,p,g,E,b,T;let _=(s=(r=globalThis.document)==null?void 0:r.createElement)==null?void 0:s.call(r,e,{is:t}),A=_?RC(_):[];return n=class extends i{constructor(){super(...arguments),ie(this,f),ie(this,d,!1),ie(this,u,null),ie(this,c,new Map),ie(this,h),Le(this,"get"),Le(this,"set"),Le(this,"call")}static get observedAttributes(){var x,S,w;return Ne(x=n,o,l).call(x),[...(w=(S=_==null?void 0:_.constructor)==null?void 0:S.observedAttributes)!=null?w:[],...oT]}get nativeEl(){var x,S,w,M,k;return Ne(this,f,m).call(this),(k=(M=(S=(x=I(this,u))!=null?x:this.querySelector(":scope > [slot=media]"))!=null?S:this.querySelector(e))!=null?M:(w=this.shadowRoot)==null?void 0:w.querySelector(e))!=null?k:null}set nativeEl(x){Q(this,u,x)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(x){this.toggleAttribute("muted",x)}get src(){return this.getAttribute("src")}set src(x){this.setAttribute("src",`${x}`)}get preload(){var x,S;return(S=this.getAttribute("preload"))!=null?S:(x=this.nativeEl)==null?void 0:x.preload}set preload(x){this.setAttribute("preload",`${x}`)}init(){var x;if(!this.shadowRoot){this.attachShadow({mode:"open"});let S=IC(this.attributes);t&&(S.is=t),e&&(S.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(S)}this.nativeEl.muted=this.hasAttribute("muted");for(let S of A)Ne(this,f,b).call(this,S);Q(this,h,new MutationObserver(Ne(this,f,g).bind(this))),this.shadowRoot.addEventListener("slotchange",this),Ne(this,f,p).call(this);for(let S of this.constructor.Events)(x=this.shadowRoot)==null||x.addEventListener(S,this,!0)}handleEvent(x){if(x.type==="slotchange"){Ne(this,f,p).call(this);return}x.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(x.type,{detail:x.detail}))}attributeChangedCallback(x,S,w){Ne(this,f,m).call(this),Ne(this,f,T).call(this,x,S,w)}connectedCallback(){Ne(this,f,m).call(this)}},a=new WeakMap,o=new WeakSet,l=function(){if(I(this,a))return;Q(this,a,!0);let x=new Set(this.observedAttributes);x.delete("muted");for(let S of A)if(!(S in this.prototype))if(typeof _[S]=="function")this.prototype[S]=function(...w){return Ne(this,f,m).call(this),(()=>{var M;if(this.call)return this.call(S,...w);let k=(M=this.nativeEl)==null?void 0:M[S];return k==null?void 0:k.apply(this.nativeEl,w)})()};else{let w={get(){var M,k,P;Ne(this,f,m).call(this);let N=S.toLowerCase();if(x.has(N)){let B=this.getAttribute(N);return B===null?!1:B===""?!0:B}return(P=(M=this.get)==null?void 0:M.call(this,S))!=null?P:(k=this.nativeEl)==null?void 0:k[S]}};S!==S.toUpperCase()&&(w.set=function(M){Ne(this,f,m).call(this);let k=S.toLowerCase();if(x.has(k)){M===!0||M===!1||M==null?this.toggleAttribute(k,!!M):this.setAttribute(k,M);return}if(this.set){this.set(S,M);return}this.nativeEl&&(this.nativeEl[S]=M)}),Object.defineProperty(this.prototype,S,w)}},d=new WeakMap,u=new WeakMap,c=new WeakMap,h=new WeakMap,f=new WeakSet,m=function(){I(this,d)||(Q(this,d,!0),this.init())},p=function(){var x;let S=new Map(I(this,c)),w=(x=this.shadowRoot)==null?void 0:x.querySelector("slot:not([name])");(w==null?void 0:w.assignedElements({flatten:!0}).filter(M=>["track","source"].includes(M.localName))).forEach(M=>{var k,P;S.delete(M);let N=I(this,c).get(M);N||(N=M.cloneNode(),I(this,c).set(M,N),(k=I(this,h))==null||k.observe(M,{attributes:!0})),(P=this.nativeEl)==null||P.append(N),Ne(this,f,E).call(this,N)}),S.forEach((M,k)=>{M.remove(),I(this,c).delete(k)})},g=function(x){var S;for(let w of x)if(w.type==="attributes"){let{target:M,attributeName:k}=w,P=I(this,c).get(M);P&&k&&(P.setAttribute(k,(S=M.getAttribute(k))!=null?S:""),Ne(this,f,E).call(this,P))}},E=function(x){x&&x.localName==="track"&&x.default&&(x.kind==="chapters"||x.kind==="metadata")&&x.track.mode==="disabled"&&(x.track.mode="hidden")},b=function(x){if(Object.prototype.hasOwnProperty.call(this,x)){let S=this[x];delete this[x],this[x]=S}},T=function(x,S,w){var M,k,P;["id","class"].includes(x)||!n.observedAttributes.includes(x)&&this.constructor.observedAttributes.includes(x)||(w===null?(M=this.nativeEl)==null||M.removeAttribute(x):((k=this.nativeEl)==null?void 0:k.getAttribute(x))!==w&&((P=this.nativeEl)==null||P.setAttribute(x,w)))},ie(n,o),Le(n,"getTemplateHTML",e.endsWith("audio")?SC:xC),Le(n,"shadowRootOptions",{mode:"open"}),Le(n,"Events",gu),ie(n,a,!1),n}function RC(i){let e=[];for(let t=Object.getPrototypeOf(i);t&&t!==HTMLElement.prototype;t=Object.getPrototypeOf(t)){let r=Object.getOwnPropertyNames(t);e.push(...r)}return e}function dT(i){let e="";for(let t in i){if(!oT.includes(t))continue;let r=i[t];r===""?e+=` ${t}`:e+=` ${t}="${r}"`}return e}function IC(i){let e={};for(let t of i)e[t.name]=t.value;return e}var zy,rp=lT((zy=globalThis.HTMLElement)!=null?zy:class{},{tag:"video"}),Xy,x2=lT((Xy=globalThis.HTMLElement)!=null?Xy:class{},{tag:"audio"}),Ts=new WeakMap,sp=class extends Error{},LC=class extends Error{},kC=globalThis.WeakRef?class extends Set{add(i){super.add(new WeakRef(i))}forEach(i){super.forEach(e=>{let t=e.deref();t&&i(t)})}}:Set;function CC(i){var e,t,r;(t=(e=globalThis.chrome)==null?void 0:e.cast)!=null&&t.isAvailable?(r=globalThis.cast)!=null&&r.framework?i():customElements.whenDefined("google-cast-button").then(i):globalThis.__onGCastApiAvailable=()=>{customElements.whenDefined("google-cast-button").then(i)}}function wC(){return globalThis.chrome}function DC(){var i;let e="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1";if((i=globalThis.chrome)!=null&&i.cast||document.querySelector(`script[src="${e}"]`))return;let t=document.createElement("script");t.src=e,document.head.append(t)}function _s(){var i,e;return(e=(i=globalThis.cast)==null?void 0:i.framework)==null?void 0:e.CastContext.getInstance()}function Tp(){var i;return(i=_s())==null?void 0:i.getCurrentSession()}function _p(){var i;return(i=Tp())==null?void 0:i.getSessionObj().media[0]}function MC(i){return new Promise((e,t)=>{_p().editTracksInfo(i,e,t)})}function PC(i){return new Promise((e,t)=>{_p().getStatus(i,e,t)})}function uT(i){return _s().setOptions({...cT(),...i})}function cT(){return{receiverApplicationId:"CC1AD845",autoJoinPolicy:"origin_scoped",androidReceiverCompatible:!1,language:"en-US",resumeSavedSession:!0}}var ru=new kC,xr=new WeakSet,ot;CC(()=>{var i,e,t,r;if(!((e=(i=globalThis.chrome)==null?void 0:i.cast)!=null&&e.isAvailable)){console.debug("chrome.cast.isAvailable",(r=(t=globalThis.chrome)==null?void 0:t.cast)==null?void 0:r.isAvailable);return}ot||(ot=cast.framework,_s().addEventListener(ot.CastContextEventType.CAST_STATE_CHANGED,s=>{ru.forEach(n=>{var a,o;return(o=(a=Ts.get(n)).onCastStateChanged)==null?void 0:o.call(a,s)})}),_s().addEventListener(ot.CastContextEventType.SESSION_STATE_CHANGED,s=>{ru.forEach(n=>{var a,o;return(o=(a=Ts.get(n)).onSessionStateChanged)==null?void 0:o.call(a,s)})}),ru.forEach(s=>{var n,a;return(a=(n=Ts.get(s)).init)==null?void 0:a.call(n)}))});var Qy=0,Ie,su,jt,Sr,Dn,Ln,ys,ap,bt,os,Zy,op,hT,lp,Jy,np,OC=class extends EventTarget{constructor(i){super(),ie(this,bt),ie(this,Ie),ie(this,su),ie(this,jt),ie(this,Sr),ie(this,Dn,"disconnected"),ie(this,Ln,!1),ie(this,ys,new Set),ie(this,ap,new WeakMap),Q(this,Ie,i),ru.add(this),Ts.set(this,{init:()=>Ne(this,bt,lp).call(this),onCastStateChanged:()=>Ne(this,bt,op).call(this),onSessionStateChanged:()=>Ne(this,bt,hT).call(this),getCastPlayer:()=>I(this,bt,os)}),Ne(this,bt,lp).call(this)}get state(){return I(this,Dn)}async watchAvailability(i){if(I(this,Ie).disableRemotePlayback)throw new sp("disableRemotePlayback attribute is present.");return I(this,ap).set(i,++Qy),I(this,ys).add(i),Qy}async cancelWatchAvailability(i){if(I(this,Ie).disableRemotePlayback)throw new sp("disableRemotePlayback attribute is present.");i?I(this,ys).delete(i):I(this,ys).clear()}async prompt(){var i,e,t,r;if(I(this,Ie).disableRemotePlayback)throw new sp("disableRemotePlayback attribute is present.");if(!((e=(i=globalThis.chrome)==null?void 0:i.cast)!=null&&e.isAvailable))throw new LC("The RemotePlayback API is disabled on this platform.");let s=xr.has(I(this,Ie));xr.add(I(this,Ie)),uT(I(this,Ie).castOptions),Object.entries(I(this,Sr)).forEach(([n,a])=>{I(this,jt).controller.addEventListener(n,a)});try{await _s().requestSession()}catch(n){if(n==="cancel"){s||xr.delete(I(this,Ie));return}throw new Error(n)}(r=(t=Ts.get(I(this,Ie)))==null?void 0:t.loadOnPrompt)==null||r.call(t)}};Ie=new WeakMap,su=new WeakMap,jt=new WeakMap,Sr=new WeakMap,Dn=new WeakMap,Ln=new WeakMap,ys=new WeakMap,ap=new WeakMap,bt=new WeakSet,os=function(){if(xr.has(I(this,Ie)))return I(this,jt)},Zy=function(){xr.has(I(this,Ie))&&(Object.entries(I(this,Sr)).forEach(([i,e])=>{I(this,jt).controller.removeEventListener(i,e)}),xr.delete(I(this,Ie)),I(this,Ie).muted=I(this,jt).isMuted,I(this,Ie).currentTime=I(this,jt).savedPlayerState.currentTime,I(this,jt).savedPlayerState.isPaused===!1&&I(this,Ie).play())},op=function(){let i=_s().getCastState();if(xr.has(I(this,Ie))&&i==="CONNECTING"&&(Q(this,Dn,"connecting"),this.dispatchEvent(new Event("connecting"))),!I(this,Ln)&&i!=null&&i.includes("CONNECT")){Q(this,Ln,!0);for(let e of I(this,ys))e(!0)}else if(I(this,Ln)&&(!i||i==="NO_DEVICES_AVAILABLE")){Q(this,Ln,!1);for(let e of I(this,ys))e(!1)}},hT=async function(){var i;let{SESSION_RESUMED:e}=ot.SessionState;if(_s().getSessionState()===e&&I(this,Ie).castSrc===((i=_p())==null?void 0:i.media.contentId)){xr.add(I(this,Ie)),Object.entries(I(this,Sr)).forEach(([t,r])=>{I(this,jt).controller.addEventListener(t,r)});try{await PC(new chrome.cast.media.GetStatusRequest)}catch(t){console.error(t)}I(this,Sr)[ot.RemotePlayerEventType.IS_PAUSED_CHANGED](),I(this,Sr)[ot.RemotePlayerEventType.PLAYER_STATE_CHANGED]()}},lp=function(){!ot||I(this,su)||(Q(this,su,!0),uT(I(this,Ie).castOptions),I(this,Ie).textTracks.addEventListener("change",()=>Ne(this,bt,np).call(this)),Ne(this,bt,op).call(this),Q(this,jt,new ot.RemotePlayer),new ot.RemotePlayerController(I(this,jt)),Q(this,Sr,{[ot.RemotePlayerEventType.IS_CONNECTED_CHANGED]:({value:i})=>{i===!0?(Q(this,Dn,"connected"),this.dispatchEvent(new Event("connect"))):(Ne(this,bt,Zy).call(this),Q(this,Dn,"disconnected"),this.dispatchEvent(new Event("disconnect")))},[ot.RemotePlayerEventType.DURATION_CHANGED]:()=>{I(this,Ie).dispatchEvent(new Event("durationchange"))},[ot.RemotePlayerEventType.VOLUME_LEVEL_CHANGED]:()=>{I(this,Ie).dispatchEvent(new Event("volumechange"))},[ot.RemotePlayerEventType.IS_MUTED_CHANGED]:()=>{I(this,Ie).dispatchEvent(new Event("volumechange"))},[ot.RemotePlayerEventType.CURRENT_TIME_CHANGED]:()=>{var i;(i=I(this,bt,os))!=null&&i.isMediaLoaded&&I(this,Ie).dispatchEvent(new Event("timeupdate"))},[ot.RemotePlayerEventType.VIDEO_INFO_CHANGED]:()=>{I(this,Ie).dispatchEvent(new Event("resize"))},[ot.RemotePlayerEventType.IS_PAUSED_CHANGED]:()=>{I(this,Ie).dispatchEvent(new Event(this.paused?"pause":"play"))},[ot.RemotePlayerEventType.PLAYER_STATE_CHANGED]:()=>{var i,e;((i=I(this,bt,os))==null?void 0:i.playerState)!==chrome.cast.media.PlayerState.PAUSED&&I(this,Ie).dispatchEvent(new Event({[chrome.cast.media.PlayerState.PLAYING]:"playing",[chrome.cast.media.PlayerState.BUFFERING]:"waiting",[chrome.cast.media.PlayerState.IDLE]:"emptied"}[(e=I(this,bt,os))==null?void 0:e.playerState]))},[ot.RemotePlayerEventType.IS_MEDIA_LOADED_CHANGED]:async()=>{var i;(i=I(this,bt,os))!=null&&i.isMediaLoaded&&(await Promise.resolve(),Ne(this,bt,Jy).call(this))}}))},Jy=function(){Ne(this,bt,np).call(this)},np=async function(){var i,e,t,r,s;if(!I(this,bt,os))return;let n=((e=(i=I(this,jt).mediaInfo)==null?void 0:i.tracks)!=null?e:[]).filter(({type:h})=>h===chrome.cast.media.TrackType.TEXT),a=[...I(this,Ie).textTracks].filter(({kind:h})=>h==="subtitles"||h==="captions"),o=n.map(({language:h,name:f,trackId:m})=>{var p;let{mode:g}=(p=a.find(E=>E.language===h&&E.label===f))!=null?p:{};return g?{mode:g,trackId:m}:!1}).filter(Boolean),l=o.filter(({mode:h})=>h!=="showing").map(({trackId:h})=>h),d=o.find(({mode:h})=>h==="showing"),u=(s=(r=(t=Tp())==null?void 0:t.getSessionObj().media[0])==null?void 0:r.activeTrackIds)!=null?s:[],c=u;if(u.length&&(c=c.filter(h=>!l.includes(h))),d!=null&&d.trackId&&(c=[...c,d.trackId]),c=[...new Set(c)],!((h,f)=>h.length===f.length&&h.every(m=>f.includes(m)))(u,c))try{let h=new chrome.cast.media.EditTracksInfoRequest(c);await MC(h)}catch(h){console.error(h)}};var NC=i=>{var e,t,r,s,n,a,o,l,d;return t=class extends i{constructor(){super(...arguments),ie(this,o),ie(this,r,{paused:!1}),ie(this,s,cT()),ie(this,n),ie(this,a)}get remote(){return I(this,a)?I(this,a):wC()?(this.disableRemotePlayback||DC(),Ts.set(this,{loadOnPrompt:()=>Ne(this,o,d).call(this)}),Q(this,a,new OC(this))):super.remote}attributeChangedCallback(u,c,h){if(super.attributeChangedCallback(u,c,h),u==="cast-receiver"&&h){I(this,s).receiverApplicationId=h;return}if(I(this,o,l))switch(u){case"cast-stream-type":case"cast-src":this.load();break}}async load(){var u,c;if(!I(this,o,l))return super.load();let h=new chrome.cast.media.MediaInfo(this.castSrc,this.castContentType);h.customData=this.castCustomData;let f=[...this.querySelectorAll("track")].filter(({kind:E,src:b})=>b&&(E==="subtitles"||E==="captions")),m=[],p=0;f.length&&(h.tracks=f.map(E=>{let b=++p;m.length===0&&E.track.mode==="showing"&&m.push(b);let T=new chrome.cast.media.Track(b,chrome.cast.media.TrackType.TEXT);return T.trackContentId=E.src,T.trackContentType="text/vtt",T.subtype=E.kind==="captions"?chrome.cast.media.TextTrackType.CAPTIONS:chrome.cast.media.TextTrackType.SUBTITLES,T.name=E.label,T.language=E.srclang,T})),this.castStreamType==="live"?h.streamType=chrome.cast.media.StreamType.LIVE:h.streamType=chrome.cast.media.StreamType.BUFFERED,h.metadata=new chrome.cast.media.GenericMediaMetadata,h.metadata.title=this.title,h.metadata.images=[{url:this.poster}];let g=new chrome.cast.media.LoadRequest(h);g.currentTime=(u=super.currentTime)!=null?u:0,g.autoplay=!I(this,r).paused,g.activeTrackIds=m,await((c=Tp())==null?void 0:c.loadMedia(g)),this.dispatchEvent(new Event("volumechange"))}play(){var u;if(I(this,o,l)){I(this,o,l).isPaused&&((u=I(this,o,l).controller)==null||u.playOrPause());return}return super.play()}pause(){var u;if(I(this,o,l)){I(this,o,l).isPaused||(u=I(this,o,l).controller)==null||u.playOrPause();return}super.pause()}get castOptions(){return I(this,s)}get castReceiver(){var u;return(u=this.getAttribute("cast-receiver"))!=null?u:void 0}set castReceiver(u){this.castReceiver!=u&&this.setAttribute("cast-receiver",`${u}`)}get castSrc(){var u,c,h;return(h=(c=this.getAttribute("cast-src"))!=null?c:(u=this.querySelector("source"))==null?void 0:u.src)!=null?h:this.currentSrc}set castSrc(u){this.castSrc!=u&&this.setAttribute("cast-src",`${u}`)}get castContentType(){var u;return(u=this.getAttribute("cast-content-type"))!=null?u:void 0}set castContentType(u){this.setAttribute("cast-content-type",`${u}`)}get castStreamType(){var u,c;return(c=(u=this.getAttribute("cast-stream-type"))!=null?u:this.streamType)!=null?c:void 0}set castStreamType(u){this.setAttribute("cast-stream-type",`${u}`)}get castCustomData(){return I(this,n)}set castCustomData(u){let c=typeof u;if(!["object","undefined"].includes(c)){console.error(`castCustomData must be nullish or an object but value was of type ${c}`);return}Q(this,n,u)}get readyState(){if(I(this,o,l))switch(I(this,o,l).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 I(this,o,l)?I(this,o,l).isPaused:super.paused}get muted(){var u;return I(this,o,l)?(u=I(this,o,l))==null?void 0:u.isMuted:super.muted}set muted(u){var c;if(I(this,o,l)){(u&&!I(this,o,l).isMuted||!u&&I(this,o,l).isMuted)&&((c=I(this,o,l).controller)==null||c.muteOrUnmute());return}super.muted=u}get volume(){var u,c;return I(this,o,l)?(c=(u=I(this,o,l))==null?void 0:u.volumeLevel)!=null?c:1:super.volume}set volume(u){var c;if(I(this,o,l)){I(this,o,l).volumeLevel=+u,(c=I(this,o,l).controller)==null||c.setVolumeLevel();return}super.volume=u}get duration(){var u,c,h;return I(this,o,l)&&(u=I(this,o,l))!=null&&u.isMediaLoaded?(h=(c=I(this,o,l))==null?void 0:c.duration)!=null?h:NaN:super.duration}get currentTime(){var u,c,h;return I(this,o,l)&&(u=I(this,o,l))!=null&&u.isMediaLoaded?(h=(c=I(this,o,l))==null?void 0:c.currentTime)!=null?h:0:super.currentTime}set currentTime(u){var c;if(I(this,o,l)){I(this,o,l).currentTime=u,(c=I(this,o,l).controller)==null||c.seek();return}super.currentTime=u}},r=new WeakMap,s=new WeakMap,n=new WeakMap,a=new WeakMap,o=new WeakSet,l=function(){var u,c;return(c=(u=Ts.get(this.remote))==null?void 0:u.getCastPlayer)==null?void 0:c.call(u)},d=async function(){I(this,r).paused=tp(t.prototype,this,"paused"),tp(t.prototype,this,"pause").call(this),this.muted=tp(t.prototype,this,"muted");try{await this.load()}catch(u){console.error(u)}},Le(t,"observedAttributes",[...(e=i.observedAttributes)!=null?e:[],"cast-src","cast-content-type","cast-stream-type","cast-receiver"]),t},vu=class extends Event{constructor(i,e){super(i),Le(this,"track"),this.track=e.track}},dp=new WeakMap;function Y(i){var e;return(e=dp.get(i))!=null?e:UC(i,{})}function UC(i,e){let t=dp.get(i);return t||dp.set(i,t={}),Object.assign(t,e)}function up(i,e){let t=i.videoTracks;Y(e).media=i,Y(e).renditionSet||(Y(e).renditionSet=new Set);let r=Y(t).trackSet;r.add(e);let s=r.size-1;s in hp.prototype||Object.defineProperty(hp.prototype,s,{get(){return[...Y(this).trackSet][s]}}),queueMicrotask(()=>{t.dispatchEvent(new vu("addtrack",{track:e}))})}function cp(i){var e;let t=(e=Y(i).media)==null?void 0:e.videoTracks;t&&(Y(t).trackSet.delete(i),queueMicrotask(()=>{t.dispatchEvent(new vu("removetrack",{track:i}))}))}function FC(i){var e;let t=(e=Y(i).media.videoTracks)!=null?e:[],r=!1;for(let s of t)s!==i&&(s.selected=!1,r=!0);if(r){if(Y(t).changeRequested)return;Y(t).changeRequested=!0,queueMicrotask(()=>{delete Y(t).changeRequested,t.dispatchEvent(new Event("change"))})}}var ls,ds,us,kn,Va,hp=class extends EventTarget{constructor(){super(),ie(this,kn),ie(this,ls),ie(this,ds),ie(this,us),Y(this).trackSet=new Set}[Symbol.iterator](){return I(this,kn,Va).values()}get length(){return I(this,kn,Va).size}getTrackById(i){var e;return(e=[...I(this,kn,Va)].find(t=>t.id===i))!=null?e:null}get selectedIndex(){return[...I(this,kn,Va)].findIndex(i=>i.selected)}get onaddtrack(){return I(this,ls)}set onaddtrack(i){I(this,ls)&&(this.removeEventListener("addtrack",I(this,ls)),Q(this,ls,void 0)),typeof i=="function"&&(Q(this,ls,i),this.addEventListener("addtrack",i))}get onremovetrack(){return I(this,ds)}set onremovetrack(i){I(this,ds)&&(this.removeEventListener("removetrack",I(this,ds)),Q(this,ds,void 0)),typeof i=="function"&&(Q(this,ds,i),this.addEventListener("removetrack",i))}get onchange(){return I(this,us)}set onchange(i){I(this,us)&&(this.removeEventListener("change",I(this,us)),Q(this,us,void 0)),typeof i=="function"&&(Q(this,us,i),this.addEventListener("change",i))}};ls=new WeakMap,ds=new WeakMap,us=new WeakMap,kn=new WeakSet,Va=function(){return Y(this).trackSet};var Eu=class extends Event{constructor(i,e){super(i),Le(this,"rendition"),this.rendition=e.rendition}};function BC(i,e){let t=Y(i).media.videoRenditions;Y(e).media=Y(i).media,Y(e).track=i;let r=Y(i).renditionSet;r.add(e);let s=r.size-1;s in fp.prototype||Object.defineProperty(fp.prototype,s,{get(){return Cn(this)[s]}}),queueMicrotask(()=>{i.selected&&t.dispatchEvent(new Eu("addrendition",{rendition:e}))})}function $C(i){let e=Y(i).media.videoRenditions,t=Y(i).track;Y(t).renditionSet.delete(i),queueMicrotask(()=>{Y(i).track.selected&&e.dispatchEvent(new Eu("removerendition",{rendition:i}))})}function HC(i){let e=Y(i).media.videoRenditions;!e||Y(e).changeRequested||(Y(e).changeRequested=!0,queueMicrotask(()=>{delete Y(e).changeRequested,Y(i).track.selected&&e.dispatchEvent(new Event("change"))}))}function Cn(i){return[...Y(i).media.videoTracks].filter(e=>e.selected).flatMap(e=>[...Y(e).renditionSet])}var cs,hs,fs,fp=class extends EventTarget{constructor(){super(...arguments),ie(this,cs),ie(this,hs),ie(this,fs)}[Symbol.iterator](){return Cn(this).values()}get length(){return Cn(this).length}getRenditionById(i){var e;return(e=Cn(this).find(t=>`${t.id}`==`${i}`))!=null?e:null}get selectedIndex(){return Cn(this).findIndex(i=>i.selected)}set selectedIndex(i){for(let[e,t]of Cn(this).entries())t.selected=e===i}get onaddrendition(){return I(this,cs)}set onaddrendition(i){I(this,cs)&&(this.removeEventListener("addrendition",I(this,cs)),Q(this,cs,void 0)),typeof i=="function"&&(Q(this,cs,i),this.addEventListener("addrendition",i))}get onremoverendition(){return I(this,hs)}set onremoverendition(i){I(this,hs)&&(this.removeEventListener("removerendition",I(this,hs)),Q(this,hs,void 0)),typeof i=="function"&&(Q(this,hs,i),this.addEventListener("removerendition",i))}get onchange(){return I(this,fs)}set onchange(i){I(this,fs)&&(this.removeEventListener("change",I(this,fs)),Q(this,fs,void 0)),typeof i=="function"&&(Q(this,fs,i),this.addEventListener("change",i))}};cs=new WeakMap,hs=new WeakMap,fs=new WeakMap;var Wa,GC=class{constructor(){Le(this,"src"),Le(this,"id"),Le(this,"width"),Le(this,"height"),Le(this,"bitrate"),Le(this,"frameRate"),Le(this,"codec"),ie(this,Wa,!1)}get selected(){return I(this,Wa)}set selected(i){I(this,Wa)!==i&&(Q(this,Wa,i),HC(this))}};Wa=new WeakMap;var Ya,fT=class{constructor(){Le(this,"id"),Le(this,"kind"),Le(this,"label",""),Le(this,"language",""),Le(this,"sourceBuffer"),ie(this,Ya,!1)}addRendition(i,e,t,r,s,n){let a=new GC;return a.src=i,a.width=e,a.height=t,a.frameRate=n,a.bitrate=s,a.codec=r,BC(this,a),a}removeRendition(i){$C(i)}get selected(){return I(this,Ya)}set selected(i){I(this,Ya)!==i&&(Q(this,Ya,i),i===!0&&FC(this))}};Ya=new WeakMap;function KC(i,e){let t=Y(i).media.audioRenditions;Y(e).media=Y(i).media,Y(e).track=i;let r=Y(i).renditionSet;r.add(e);let s=r.size-1;s in mp.prototype||Object.defineProperty(mp.prototype,s,{get(){return wn(this)[s]}}),queueMicrotask(()=>{i.enabled&&t.dispatchEvent(new Eu("addrendition",{rendition:e}))})}function VC(i){let e=Y(i).media.audioRenditions,t=Y(i).track;Y(t).renditionSet.delete(i),queueMicrotask(()=>{Y(i).track.enabled&&e.dispatchEvent(new Eu("removerendition",{rendition:i}))})}function WC(i){let e=Y(i).media.audioRenditions;!e||Y(e).changeRequested||(Y(e).changeRequested=!0,queueMicrotask(()=>{delete Y(e).changeRequested,Y(i).track.enabled&&e.dispatchEvent(new Event("change"))}))}function wn(i){return[...Y(i).media.audioTracks].filter(e=>e.enabled).flatMap(e=>[...Y(e).renditionSet])}var ms,ps,gs,mp=class extends EventTarget{constructor(){super(...arguments),ie(this,ms),ie(this,ps),ie(this,gs)}[Symbol.iterator](){return wn(this).values()}get length(){return wn(this).length}getRenditionById(i){var e;return(e=wn(this).find(t=>`${t.id}`==`${i}`))!=null?e:null}get selectedIndex(){return wn(this).findIndex(i=>i.selected)}set selectedIndex(i){for(let[e,t]of wn(this).entries())t.selected=e===i}get onaddrendition(){return I(this,ms)}set onaddrendition(i){I(this,ms)&&(this.removeEventListener("addrendition",I(this,ms)),Q(this,ms,void 0)),typeof i=="function"&&(Q(this,ms,i),this.addEventListener("addrendition",i))}get onremoverendition(){return I(this,ps)}set onremoverendition(i){I(this,ps)&&(this.removeEventListener("removerendition",I(this,ps)),Q(this,ps,void 0)),typeof i=="function"&&(Q(this,ps,i),this.addEventListener("removerendition",i))}get onchange(){return I(this,gs)}set onchange(i){I(this,gs)&&(this.removeEventListener("change",I(this,gs)),Q(this,gs,void 0)),typeof i=="function"&&(Q(this,gs,i),this.addEventListener("change",i))}};ms=new WeakMap,ps=new WeakMap,gs=new WeakMap;var qa,YC=class{constructor(){Le(this,"src"),Le(this,"id"),Le(this,"bitrate"),Le(this,"codec"),ie(this,qa,!1)}get selected(){return I(this,qa)}set selected(i){I(this,qa)!==i&&(Q(this,qa,i),WC(this))}};qa=new WeakMap;function pp(i,e){let t=i.audioTracks;Y(e).media=i,Y(e).renditionSet||(Y(e).renditionSet=new Set);let r=Y(t).trackSet;r.add(e);let s=r.size-1;s in vp.prototype||Object.defineProperty(vp.prototype,s,{get(){return[...Y(this).trackSet][s]}}),queueMicrotask(()=>{t.dispatchEvent(new vu("addtrack",{track:e}))})}function gp(i){var e;let t=(e=Y(i).media)==null?void 0:e.audioTracks;t&&(Y(t).trackSet.delete(i),queueMicrotask(()=>{t.dispatchEvent(new vu("removetrack",{track:i}))}))}function qC(i){let e=Y(i).media.audioTracks;!e||Y(e).changeRequested||(Y(e).changeRequested=!0,queueMicrotask(()=>{delete Y(e).changeRequested,e.dispatchEvent(new Event("change"))}))}var vs,Es,bs,ja,nu,vp=class extends EventTarget{constructor(){super(),ie(this,ja),ie(this,vs),ie(this,Es),ie(this,bs),Y(this).trackSet=new Set}[Symbol.iterator](){return I(this,ja,nu).values()}get length(){return I(this,ja,nu).size}getTrackById(i){var e;return(e=[...I(this,ja,nu)].find(t=>t.id===i))!=null?e:null}get onaddtrack(){return I(this,vs)}set onaddtrack(i){I(this,vs)&&(this.removeEventListener("addtrack",I(this,vs)),Q(this,vs,void 0)),typeof i=="function"&&(Q(this,vs,i),this.addEventListener("addtrack",i))}get onremovetrack(){return I(this,Es)}set onremovetrack(i){I(this,Es)&&(this.removeEventListener("removetrack",I(this,Es)),Q(this,Es,void 0)),typeof i=="function"&&(Q(this,Es,i),this.addEventListener("removetrack",i))}get onchange(){return I(this,bs)}set onchange(i){I(this,bs)&&(this.removeEventListener("change",I(this,bs)),Q(this,bs,void 0)),typeof i=="function"&&(Q(this,bs,i),this.addEventListener("change",i))}};vs=new WeakMap,Es=new WeakMap,bs=new WeakMap,ja=new WeakSet,nu=function(){return Y(this).trackSet};var za,mT=class{constructor(){Le(this,"id"),Le(this,"kind"),Le(this,"label",""),Le(this,"language",""),Le(this,"sourceBuffer"),ie(this,za,!1)}addRendition(i,e,t){let r=new YC;return r.src=i,r.codec=e,r.bitrate=t,KC(this,r),r}removeRendition(i){VC(i)}get enabled(){return I(this,za)}set enabled(i){I(this,za)!==i&&(Q(this,za,i),qC(this))}};za=new WeakMap;var eT=mu(globalThis.HTMLMediaElement,"video"),tT=mu(globalThis.HTMLMediaElement,"audio");function jC(i){if(!(i!=null&&i.prototype))return i;let e=mu(i,"video");(!e||`${e}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"videoTracks",{get(){return zC(this)}});let t=mu(i,"audio");(!t||`${t}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"audioTracks",{get(){return XC(this)}}),"addVideoTrack"in i.prototype||(i.prototype.addVideoTrack=function(n,a="",o=""){let l=new fT;return l.kind=n,l.label=a,l.language=o,up(this,l),l}),"removeVideoTrack"in i.prototype||(i.prototype.removeVideoTrack=cp),"addAudioTrack"in i.prototype||(i.prototype.addAudioTrack=function(n,a="",o=""){let l=new mT;return l.kind=n,l.label=a,l.language=o,pp(this,l),l}),"removeAudioTrack"in i.prototype||(i.prototype.removeAudioTrack=gp),"videoRenditions"in i.prototype||Object.defineProperty(i.prototype,"videoRenditions",{get(){return r(this)}});let r=n=>{let a=Y(n).videoRenditions;return a||(a=new fp,Y(a).media=n,Y(n).videoRenditions=a),a};"audioRenditions"in i.prototype||Object.defineProperty(i.prototype,"audioRenditions",{get(){return s(this)}});let s=n=>{let a=Y(n).audioRenditions;return a||(a=new mp,Y(a).media=n,Y(n).audioRenditions=a),a};return i}function mu(i,e){var t;if(i!=null&&i.prototype)return(t=Object.getOwnPropertyDescriptor(i.prototype,`${e}Tracks`))==null?void 0:t.get}function zC(i){var e;let t=Y(i).videoTracks;if(!t&&(t=new hp,Y(i).videoTracks=t,eT)){let r=eT.call((e=i.nativeEl)!=null?e:i);for(let s of r)up(i,s);r.addEventListener("change",()=>{t.dispatchEvent(new Event("change"))}),r.addEventListener("addtrack",s=>{if([...t].some(n=>n instanceof fT)){for(let n of r)cp(n);return}up(i,s.track)}),r.addEventListener("removetrack",s=>{cp(s.track)})}return t}function XC(i){var e;let t=Y(i).audioTracks;if(!t&&(t=new vp,Y(i).audioTracks=t,tT)){let r=tT.call((e=i.nativeEl)!=null?e:i);for(let s of r)pp(i,s);r.addEventListener("change",()=>{t.dispatchEvent(new Event("change"))}),r.addEventListener("addtrack",s=>{if([...t].some(n=>n instanceof mT)){for(let n of r)gp(n);return}pp(i,s.track)}),r.addEventListener("removetrack",s=>{gp(s.track)})}return t}gu.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",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"},QC=Object.values(C),iT=AC(),rT="mux-video",Pi,Xa,au,Qa,ou,lu,du,uu,cu,Za,hu,ZC=class extends rp{constructor(){super(),ie(this,Za),ie(this,Pi),ie(this,Xa),ie(this,au),ie(this,Qa,{}),ie(this,ou,{}),ie(this,lu),ie(this,du),ie(this,uu),ie(this,cu),Q(this,au,Jd())}static get NAME(){return rT}static get VERSION(){return iT}static get observedAttributes(){var i;return[...QC,...(i=rp.observedAttributes)!=null?i:[]]}get preferCmcd(){var i;return(i=this.getAttribute(C.PREFER_CMCD))!=null?i:void 0}set preferCmcd(i){i!==this.preferCmcd&&(i?In.includes(i)?this.setAttribute(C.PREFER_CMCD,i):console.warn(`Invalid value for preferCmcd. Must be one of ${In.join()}`):this.removeAttribute(C.PREFER_CMCD))}get playerInitTime(){return this.hasAttribute(C.PLAYER_INIT_TIME)?+this.getAttribute(C.PLAYER_INIT_TIME):I(this,au)}set playerInitTime(i){i!=this.playerInitTime&&(i==null?this.removeAttribute(C.PLAYER_INIT_TIME):this.setAttribute(C.PLAYER_INIT_TIME,`${+i}`))}get playerSoftwareName(){var i;return(i=I(this,uu))!=null?i:rT}set playerSoftwareName(i){Q(this,uu,i)}get playerSoftwareVersion(){var i;return(i=I(this,du))!=null?i:iT}set playerSoftwareVersion(i){Q(this,du,i)}get _hls(){var i;return(i=I(this,Pi))==null?void 0:i.engine}get mux(){var i;return(i=this.nativeEl)==null?void 0:i.mux}get error(){var i;return(i=Qm(this.nativeEl))!=null?i:null}get errorTranslator(){return I(this,cu)}set errorTranslator(i){Q(this,cu,i)}get src(){return this.getAttribute("src")}set src(i){i!==this.src&&(i==null?this.removeAttribute("src"):this.setAttribute("src",i))}get type(){var i;return(i=this.getAttribute(C.TYPE))!=null?i:void 0}set type(i){i!==this.type&&(i?this.setAttribute(C.TYPE,i):this.removeAttribute(C.TYPE))}get autoplay(){let i=this.getAttribute("autoplay");return i===null?!1:i===""?!0:i}set autoplay(i){let e=this.autoplay;i!==e&&(i?this.setAttribute("autoplay",typeof i=="string"?i:""):this.removeAttribute("autoplay"))}get preload(){let i=this.getAttribute("preload");return i===""?"auto":["none","metadata","auto"].includes(i)?i:super.preload}set preload(i){i!=this.getAttribute("preload")&&(["","none","metadata","auto"].includes(i)?this.setAttribute("preload",i):this.removeAttribute("preload"))}get debug(){return this.getAttribute(C.DEBUG)!=null}set debug(i){i!==this.debug&&(i?this.setAttribute(C.DEBUG,""):this.removeAttribute(C.DEBUG))}get disableTracking(){return this.hasAttribute(C.DISABLE_TRACKING)}set disableTracking(i){i!==this.disableTracking&&this.toggleAttribute(C.DISABLE_TRACKING,!!i)}get disableCookies(){return this.hasAttribute(C.DISABLE_COOKIES)}set disableCookies(i){i!==this.disableCookies&&(i?this.setAttribute(C.DISABLE_COOKIES,""):this.removeAttribute(C.DISABLE_COOKIES))}get startTime(){let i=this.getAttribute(C.START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set startTime(i){i!==this.startTime&&(i==null?this.removeAttribute(C.START_TIME):this.setAttribute(C.START_TIME,`${i}`))}get playbackId(){var i;return this.hasAttribute(C.PLAYBACK_ID)?this.getAttribute(C.PLAYBACK_ID):(i=Xm(this.src))!=null?i:void 0}set playbackId(i){i!==this.playbackId&&(i?this.setAttribute(C.PLAYBACK_ID,i):this.removeAttribute(C.PLAYBACK_ID))}get maxResolution(){var i;return(i=this.getAttribute(C.MAX_RESOLUTION))!=null?i:void 0}set maxResolution(i){i!==this.maxResolution&&(i?this.setAttribute(C.MAX_RESOLUTION,i):this.removeAttribute(C.MAX_RESOLUTION))}get minResolution(){var i;return(i=this.getAttribute(C.MIN_RESOLUTION))!=null?i:void 0}set minResolution(i){i!==this.minResolution&&(i?this.setAttribute(C.MIN_RESOLUTION,i):this.removeAttribute(C.MIN_RESOLUTION))}get renditionOrder(){var i;return(i=this.getAttribute(C.RENDITION_ORDER))!=null?i:void 0}set renditionOrder(i){i!==this.renditionOrder&&(i?this.setAttribute(C.RENDITION_ORDER,i):this.removeAttribute(C.RENDITION_ORDER))}get programStartTime(){let i=this.getAttribute(C.PROGRAM_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programStartTime(i){i==null?this.removeAttribute(C.PROGRAM_START_TIME):this.setAttribute(C.PROGRAM_START_TIME,`${i}`)}get programEndTime(){let i=this.getAttribute(C.PROGRAM_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programEndTime(i){i==null?this.removeAttribute(C.PROGRAM_END_TIME):this.setAttribute(C.PROGRAM_END_TIME,`${i}`)}get assetStartTime(){let i=this.getAttribute(C.ASSET_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetStartTime(i){i==null?this.removeAttribute(C.ASSET_START_TIME):this.setAttribute(C.ASSET_START_TIME,`${i}`)}get assetEndTime(){let i=this.getAttribute(C.ASSET_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetEndTime(i){i==null?this.removeAttribute(C.ASSET_END_TIME):this.setAttribute(C.ASSET_END_TIME,`${i}`)}get customDomain(){var i;return(i=this.getAttribute(C.CUSTOM_DOMAIN))!=null?i:void 0}set customDomain(i){i!==this.customDomain&&(i?this.setAttribute(C.CUSTOM_DOMAIN,i):this.removeAttribute(C.CUSTOM_DOMAIN))}get drmToken(){var i;return(i=this.getAttribute(C.DRM_TOKEN))!=null?i:void 0}set drmToken(i){i!==this.drmToken&&(i?this.setAttribute(C.DRM_TOKEN,i):this.removeAttribute(C.DRM_TOKEN))}get playbackToken(){var i,e,t,r;if(this.hasAttribute(C.PLAYBACK_TOKEN))return(i=this.getAttribute(C.PLAYBACK_TOKEN))!=null?i:void 0;if(this.hasAttribute(C.PLAYBACK_ID)){let[,s]=Xd((e=this.playbackId)!=null?e:"");return(t=new URLSearchParams(s).get("token"))!=null?t:void 0}if(this.src)return(r=new URLSearchParams(this.src).get("token"))!=null?r:void 0}set playbackToken(i){i!==this.playbackToken&&(i?this.setAttribute(C.PLAYBACK_TOKEN,i):this.removeAttribute(C.PLAYBACK_TOKEN))}get tokens(){let i=this.getAttribute(C.PLAYBACK_TOKEN),e=this.getAttribute(C.DRM_TOKEN);return{...I(this,ou),...i!=null?{playback:i}:{},...e!=null?{drm:e}:{}}}set tokens(i){Q(this,ou,i!=null?i:{})}get ended(){return Jm(this.nativeEl,this._hls)}get envKey(){var i;return(i=this.getAttribute(C.ENV_KEY))!=null?i:void 0}set envKey(i){i!==this.envKey&&(i?this.setAttribute(C.ENV_KEY,i):this.removeAttribute(C.ENV_KEY))}get beaconCollectionDomain(){var i;return(i=this.getAttribute(C.BEACON_COLLECTION_DOMAIN))!=null?i:void 0}set beaconCollectionDomain(i){i!==this.beaconCollectionDomain&&(i?this.setAttribute(C.BEACON_COLLECTION_DOMAIN,i):this.removeAttribute(C.BEACON_COLLECTION_DOMAIN))}get streamType(){var i;return(i=this.getAttribute(C.STREAM_TYPE))!=null?i:zd(this.nativeEl)}set streamType(i){i!==this.streamType&&(i?this.setAttribute(C.STREAM_TYPE,i):this.removeAttribute(C.STREAM_TYPE))}get targetLiveWindow(){return this.hasAttribute(C.TARGET_LIVE_WINDOW)?+this.getAttribute(C.TARGET_LIVE_WINDOW):By(this.nativeEl)}set targetLiveWindow(i){i!=this.targetLiveWindow&&(i==null?this.removeAttribute(C.TARGET_LIVE_WINDOW):this.setAttribute(C.TARGET_LIVE_WINDOW,`${+i}`))}get liveEdgeStart(){var i,e;if(this.hasAttribute(C.LIVE_EDGE_OFFSET)){let{liveEdgeOffset:t}=this,r=(i=this.nativeEl.seekable.end(0))!=null?i:0,s=(e=this.nativeEl.seekable.start(0))!=null?e:0;return Math.max(s,r-t)}return $y(this.nativeEl)}get liveEdgeOffset(){if(this.hasAttribute(C.LIVE_EDGE_OFFSET))return+this.getAttribute(C.LIVE_EDGE_OFFSET)}set liveEdgeOffset(i){i!=this.liveEdgeOffset&&(i==null?this.removeAttribute(C.LIVE_EDGE_OFFSET):this.setAttribute(C.LIVE_EDGE_OFFSET,`${+i}`))}get seekable(){return tu(this.nativeEl)}async addCuePoints(i){return Wm(this.nativeEl,i)}get activeCuePoint(){return Ym(this.nativeEl)}get cuePoints(){return wy(this.nativeEl)}async addChapters(i){return jm(this.nativeEl,i)}get activeChapter(){return zm(this.nativeEl)}get chapters(){return My(this.nativeEl)}getStartDate(){return Py(this.nativeEl,this._hls)}get currentPdt(){return Oy(this.nativeEl,this._hls)}get preferPlayback(){let i=this.getAttribute(C.PREFER_PLAYBACK);if(i===qt.MSE||i===qt.NATIVE)return i}set preferPlayback(i){i!==this.preferPlayback&&(i===qt.MSE||i===qt.NATIVE?this.setAttribute(C.PREFER_PLAYBACK,i):this.removeAttribute(C.PREFER_PLAYBACK))}get metadata(){return{...this.getAttributeNames().filter(i=>i.startsWith("metadata-")&&![C.METADATA_URL].includes(i)).reduce((i,e)=>{let t=this.getAttribute(e);return t!=null&&(i[e.replace(/^metadata-/,"").replace(/-/g,"_")]=t),i},{}),...I(this,Qa)}}set metadata(i){Q(this,Qa,i!=null?i:{}),this.mux&&this.mux.emit("hb",I(this,Qa))}get _hlsConfig(){return I(this,lu)}set _hlsConfig(i){Q(this,lu,i)}load(){Q(this,Pi,Ky(this,this.nativeEl,I(this,Pi)))}unload(){ep(this.nativeEl,I(this,Pi)),Q(this,Pi,void 0)}attributeChangedCallback(i,e,t){var r,s;switch(rp.observedAttributes.includes(i)&&!["src","autoplay","preload"].includes(i)&&super.attributeChangedCallback(i,e,t),i){case C.PLAYER_SOFTWARE_NAME:this.playerSoftwareName=t!=null?t:void 0;break;case C.PLAYER_SOFTWARE_VERSION:this.playerSoftwareVersion=t!=null?t:void 0;break;case"src":{let n=!!e,a=!!t;!n&&a?Ne(this,Za,hu).call(this):n&&!a?this.unload():n&&a&&(this.unload(),Ne(this,Za,hu).call(this));break}case"autoplay":if(t===e)break;(r=I(this,Pi))==null||r.setAutoplay(this.autoplay);break;case"preload":if(t===e)break;(s=I(this,Pi))==null||s.setPreload(t);break;case C.PLAYBACK_ID:this.src=Ka(this);break;case C.DEBUG:{let n=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=n);break}case C.METADATA_URL:t&&fetch(t).then(n=>n.json()).then(n=>this.metadata=n).catch(()=>console.error(`Unable to load or parse metadata JSON from metadata-url ${t}!`));break;case C.STREAM_TYPE:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("streamtypechange",{composed:!0,bubbles:!0}));break;case C.TARGET_LIVE_WINDOW:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("targetlivewindowchange",{composed:!0,bubbles:!0,detail:this.targetLiveWindow}));break;default:break}}connectedCallback(){var i;(i=super.connectedCallback)==null||i.call(this),this.nativeEl&&this.src&&!I(this,Pi)&&Ne(this,Za,hu).call(this)}disconnectedCallback(){this.unload()}};Pi=new WeakMap,Xa=new WeakMap,au=new WeakMap,Qa=new WeakMap,ou=new WeakMap,lu=new WeakMap,du=new WeakMap,uu=new WeakMap,cu=new WeakMap,Za=new WeakSet,hu=async function(){I(this,Xa)||(await Q(this,Xa,Promise.resolve()),Q(this,Xa,null),this.load())};var fu,Ep=class extends NC(jC(ZC)){constructor(){super(...arguments),ie(this,fu)}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 i;return(i=I(this,fu))!=null?i:this.muxCastCustomData}set castCustomData(i){Q(this,fu,i)}};fu=new WeakMap;ip.customElements.get("mux-video")||(ip.customElements.define("mux-video",Ep),ip.MuxVideoElement=Ep);var pT=Ep;function gT(i){let e="";return Object.entries(i).forEach(([t,r])=>{r!=null&&(e+=`${bu(t)}: ${r}; `)}),e?e.trim():void 0}function bu(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function yu(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Rt(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function Ap(i){let e=JC(i).toString();return e?"?"+e:""}function JC(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var Sp=(i,e)=>!i||!e?!1:i.contains(e)?!0:Sp(i,e.getRootNode().host);var vT="mux.com",ew=()=>{try{return"3.2.4"}catch{}return"UNKNOWN"},tw=ew(),_u=()=>tw,ET=(i,{token:e,customDomain:t=vT,thumbnailTime:r,programTime:s}={})=>{var o;let n=e==null?r:void 0,{aud:a}=(o=Ar(e))!=null?o:{};if(!(e&&a!=="t"))return`https://image.${t}/${i}/thumbnail.webp${Ap({token:e,time:n,program_time:s})}`},bT=(i,{token:e,customDomain:t=vT,programStartTime:r,programEndTime:s}={})=>{var a;let{aud:n}=(a=Ar(e))!=null?a:{};if(!(e&&n!=="s"))return`https://image.${t}/${i}/storyboard.vtt${Ap({token:e,format:"webp",program_start_time:r,program_end_time:s})}`},Ja=i=>{if(i){if([Re.LIVE,Re.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return Re.LIVE}};var iw={crossorigin:"crossOrigin",playsinline:"playsInline"};function yT(i){var e;return(e=iw[i])!=null?e:yu(i)}var As,Ss,It,Tu=class{constructor(e,t){kt(this,As);kt(this,Ss);kt(this,It,[]);$t(this,As,e),$t(this,Ss,t)}[Symbol.iterator](){return _e(this,It).values()}get length(){return _e(this,It).length}get value(){var e;return(e=_e(this,It).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&($t(this,It,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return _e(this,It)[e]}values(){return _e(this,It).values()}keys(){return _e(this,It).keys()}forEach(e){_e(this,It).forEach(e)}add(...e){var t,r;e.forEach(s=>{this.contains(s)||_e(this,It).push(s)}),!(this.value===""&&!((t=_e(this,As))!=null&&t.hasAttribute(`${_e(this,Ss)}`)))&&((r=_e(this,As))==null||r.setAttribute(`${_e(this,Ss)}`,`${this.value}`))}remove(...e){var t;e.forEach(r=>{_e(this,It).splice(_e(this,It).indexOf(r),1)}),(t=_e(this,As))==null||t.setAttribute(`${_e(this,Ss)}`,`${this.value}`)}contains(e){return _e(this,It).includes(e)}toggle(e,t){return typeof t!="undefined"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){this.remove(e),this.add(t)}};As=new WeakMap,Ss=new WeakMap,It=new WeakMap;var TT=`[mux-player ${_u()}]`;function Oi(...i){console.warn(TT,...i)}function Ut(...i){console.error(TT,...i)}function xp(i){var t;let e=(t=i.message)!=null?t:"";i.context&&(e+=` ${i.context}`),i.file&&(e+=` ${j("Read more: ")}
|
|
1317
1317
|
https://github.com/muxinc/elements/blob/main/errors/${i.file}`),Oi(e)}var At={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},xs={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},AT=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),rw=gu.filter(i=>i!=="error"),sw=Object.values(At).filter(i=>![At.PLAYSINLINE].includes(i)),nw=Object.values(xs),Rp=class extends Ct.HTMLElement{static get observedAttributes(){return[...sw,...nw]}constructor(){super()}init(){rw.forEach(e=>{var t;(t=this.media)==null||t.addEventListener(e,r=>{this.dispatchEvent(new Event(r.type))})})}attributeChangedCallback(e,t,r){var s,n;switch(e){case xs.MUTED:{this.media&&(this.media.muted=r!=null,this.media.defaultMuted=r!=null);return}case xs.VOLUME:{let a=(s=Rt(r))!=null?s:1;this.media&&(this.media.volume=a);return}case xs.PLAYBACKRATE:{let a=(n=Rt(r))!=null?n:1;this.media&&(this.media.playbackRate=a,this.media.defaultPlaybackRate=a);return}}}play(){var e,t;return(t=(e=this.media)==null?void 0:e.play())!=null?t:Promise.reject()}pause(){var e;(e=this.media)==null||e.pause()}load(){var e;(e=this.media)==null||e.load()}requestCast(e){var t;return(t=this.media)==null?void 0:t.requestCast(e)}get media(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("mux-video")}get audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var e,t;return(t=(e=this.media)==null?void 0:e.paused)!=null?t:!0}get duration(){var e,t;return(t=(e=this.media)==null?void 0:e.duration)!=null?t:NaN}get ended(){var e,t;return(t=(e=this.media)==null?void 0:e.ended)!=null?t:!1}get buffered(){var e,t;return(t=(e=this.media)==null?void 0:e.buffered)!=null?t:AT}get seekable(){var e,t;return(t=(e=this.media)==null?void 0:e.seekable)!=null?t:AT}get readyState(){var e,t;return(t=(e=this.media)==null?void 0:e.readyState)!=null?t:0}get videoWidth(){var e,t;return(t=(e=this.media)==null?void 0:e.videoWidth)!=null?t:0}get videoHeight(){var e,t;return(t=(e=this.media)==null?void 0:e.videoHeight)!=null?t:0}get currentSrc(){var e,t;return(t=(e=this.media)==null?void 0:e.currentSrc)!=null?t:""}get currentTime(){var e,t;return(t=(e=this.media)==null?void 0:e.currentTime)!=null?t:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,t;return(t=(e=this.media)==null?void 0:e.volume)!=null?t:1}set volume(e){this.media&&(this.media.volume=Number(e))}get playbackRate(){var e,t;return(t=(e=this.media)==null?void 0:e.playbackRate)!=null?t:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get defaultPlaybackRate(){var e;return(e=Rt(this.getAttribute(xs.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(xs.PLAYBACKRATE,`${e}`):this.removeAttribute(xs.PLAYBACKRATE)}get crossOrigin(){return eo(this,At.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(At.CROSSORIGIN,`${e}`)}get autoplay(){return eo(this,At.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(At.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(At.AUTOPLAY)}get loop(){return eo(this,At.LOOP)!=null}set loop(e){e?this.setAttribute(At.LOOP,""):this.removeAttribute(At.LOOP)}get muted(){var e,t;return(t=(e=this.media)==null?void 0:e.muted)!=null?t:!1}set muted(e){this.media&&(this.media.muted=!!e)}get defaultMuted(){return eo(this,At.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(At.MUTED,""):this.removeAttribute(At.MUTED)}get playsInline(){return eo(this,At.PLAYSINLINE)!=null}set playsInline(e){Ut("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(e){["","none","metadata","auto"].includes(e)?this.setAttribute(At.PRELOAD,e):this.removeAttribute(At.PRELOAD)}};function eo(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var Ip=Rp;var LT=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},de=(i,e,t)=>(LT(i,e,"read from private field"),t?t.call(i):e.get(i)),Ni=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},tr=(i,e,t,r)=>(LT(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Mn,Au,Rs,to,Rr,Ir,Lr,Is,Pn,Su,ci,ST=1,xT=0,aw=1,ow={processCallback(i,e,t){if(t){for(let[r,s]of e)if(r in t){let n=t[r];typeof n=="boolean"&&s instanceof Lt&&typeof s.element[s.attributeName]=="boolean"?s.booleanValue=n:typeof n=="function"&&s instanceof Lt?s.element[s.attributeName]=n:s.value=n}}}},ir=class extends R.DocumentFragment{constructor(e,t,r=ow){var s;super(),Ni(this,Mn,void 0),Ni(this,Au,void 0),this.append(e.content.cloneNode(!0)),tr(this,Mn,kT(this)),tr(this,Au,r),(s=r.createCallback)==null||s.call(r,this,de(this,Mn),t),r.processCallback(this,de(this,Mn),t)}update(e){de(this,Au).processCallback(this,de(this,Mn),e)}};Mn=new WeakMap;Au=new WeakMap;var kT=(i,e=[])=>{let t,r;for(let s of i.attributes||[])if(s.value.includes("{{")){let n=new Lp;for([t,r]of IT(s.value))if(!t)n.append(r);else{let a=new Lt(i,s.name,s.namespaceURI);n.append(a),e.push([r,a])}s.value=n.toString()}for(let s of i.childNodes)if(s.nodeType===ST&&!(s instanceof HTMLTemplateElement))kT(s,e);else{let n=s.data;if(s.nodeType===ST||n.includes("{{")){let a=[];if(n)for([t,r]of IT(n))if(!t)a.push(new Text(r));else{let o=new rr(i);a.push(o),e.push([r,o])}else if(s instanceof HTMLTemplateElement){let o=new io(i,s);a.push(o),e.push([o.expression,o])}s.replaceWith(...a.flatMap(o=>o.replacementNodes||[o]))}}return e},RT={},IT=i=>{let e="",t=0,r=RT[i],s=0,n;if(r)return r;for(r=[];n=i[s];s++)n==="{"&&i[s+1]==="{"&&i[s-1]!=="\\"&&i[s+2]&&++t==1?(e&&r.push([xT,e]),e="",s++):n==="}"&&i[s+1]==="}"&&i[s-1]!=="\\"&&!--t?(r.push([aw,e.trim()]),e="",s++):e+=n||"";return e&&r.push([xT,(t>0?"{{":"")+e]),RT[i]=r},lw=11,xu=class{get value(){return""}set value(e){}toString(){return this.value}},CT=new WeakMap,Lp=class{constructor(){Ni(this,Rs,[])}[Symbol.iterator](){return de(this,Rs).values()}get length(){return de(this,Rs).length}item(e){return de(this,Rs)[e]}append(...e){for(let t of e)t instanceof Lt&&CT.set(t,this),de(this,Rs).push(t)}toString(){return de(this,Rs).join("")}};Rs=new WeakMap;var Lt=class extends xu{constructor(e,t,r){super(),Ni(this,Is),Ni(this,to,""),Ni(this,Rr,void 0),Ni(this,Ir,void 0),Ni(this,Lr,void 0),tr(this,Rr,e),tr(this,Ir,t),tr(this,Lr,r)}get attributeName(){return de(this,Ir)}get attributeNamespace(){return de(this,Lr)}get element(){return de(this,Rr)}get value(){return de(this,to)}set value(e){de(this,to)!==e&&(tr(this,to,e),!de(this,Is,Pn)||de(this,Is,Pn).length===1?e==null?de(this,Rr).removeAttributeNS(de(this,Lr),de(this,Ir)):de(this,Rr).setAttributeNS(de(this,Lr),de(this,Ir),e):de(this,Rr).setAttributeNS(de(this,Lr),de(this,Ir),de(this,Is,Pn).toString()))}get booleanValue(){return de(this,Rr).hasAttributeNS(de(this,Lr),de(this,Ir))}set booleanValue(e){if(!de(this,Is,Pn)||de(this,Is,Pn).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};to=new WeakMap;Rr=new WeakMap;Ir=new WeakMap;Lr=new WeakMap;Is=new WeakSet;Pn=function(){return CT.get(this)};var rr=class extends xu{constructor(e,t){super(),Ni(this,Su,void 0),Ni(this,ci,void 0),tr(this,Su,e),tr(this,ci,t?[...t]:[new Text])}get replacementNodes(){return de(this,ci)}get parentNode(){return de(this,Su)}get nextSibling(){return de(this,ci)[de(this,ci).length-1].nextSibling}get previousSibling(){return de(this,ci)[0].previousSibling}get value(){return de(this,ci).map(e=>e.textContent).join("")}set value(e){this.replace(e)}replace(...e){let t=e.flat().flatMap(r=>r==null?[new Text]:r.forEach?[...r]:r.nodeType===lw?[...r.childNodes]:r.nodeType?[r]:[new Text(r)]);t.length||t.push(new Text),tr(this,ci,dw(de(this,ci)[0].parentNode,de(this,ci),t,this.nextSibling))}};Su=new WeakMap;ci=new WeakMap;var io=class extends rr{constructor(e,t){let r=t.getAttribute("directive")||t.getAttribute("type"),s=t.getAttribute("expression")||t.getAttribute(r)||"";s.startsWith("{{")&&(s=s.trim().slice(2,-2).trim()),super(e),this.expression=s,this.template=t,this.directive=r}};function dw(i,e,t,r=null){let s=0,n,a,o,l=t.length,d=e.length;for(;s<l&&s<d&&e[s]==t[s];)s++;for(;s<l&&s<d&&t[l-1]==e[d-1];)r=t[--d,--l];if(s==d)for(;s<l;)i.insertBefore(t[s++],r);if(s==l)for(;s<d;)i.removeChild(e[s++]);else{for(n=e[s];s<l;)o=t[s++],a=n?n.nextSibling:r,n==o?n=a:s<l&&t[s]==a?(i.replaceChild(o,n),n=a):i.insertBefore(o,n);for(;n!=r;)a=n.nextSibling,i.removeChild(n),n=a}return t}var wT={string:i=>String(i)},Iu=class{constructor(e){this.template=e,this.state=void 0}},Ls=new WeakMap,ks=new WeakMap,kp={partial:(i,e)=>{e[i.expression]=new Iu(i.template)},if:(i,e)=>{var t;if(MT(i.expression,e))if(Ls.get(i)!==i.template){Ls.set(i,i.template);let r=new ir(i.template,e,Lu);i.replace(r),ks.set(i,r)}else(t=ks.get(i))==null||t.update(e);else i.replace(""),Ls.delete(i),ks.delete(i)}},uw=Object.keys(kp),Lu={processCallback(i,e,t){var r,s;if(t)for(let[n,a]of e){if(a instanceof io){if(!a.directive){let l=uw.find(d=>a.template.hasAttribute(d));l&&(a.directive=l,a.expression=a.template.getAttribute(l))}(r=kp[a.directive])==null||r.call(kp,a,t);continue}let o=MT(n,t);if(o instanceof Iu){Ls.get(a)!==o.template?(Ls.set(a,o.template),o=new ir(o.template,o.state,Lu),a.value=o,ks.set(a,o)):(s=ks.get(a))==null||s.update(o.state);continue}o?(a instanceof Lt&&a.attributeName.startsWith("aria-")&&(o=String(o)),a instanceof Lt?typeof o=="boolean"?a.booleanValue=o:typeof o=="function"?a.element[a.attributeName]=o:a.value=o:(a.value=o,Ls.delete(a),ks.delete(a))):a instanceof Lt?a.value=void 0:(a.value=void 0,Ls.delete(a),ks.delete(a))}}},DT={"!":i=>!i,"!!":i=>!!i,"==":(i,e)=>i==e,"!=":(i,e)=>i!=e,">":(i,e)=>i>e,">=":(i,e)=>i>=e,"<":(i,e)=>i<e,"<=":(i,e)=>i<=e,"??":(i,e)=>i!=null?i:e,"|":(i,e)=>{var t;return(t=wT[e])==null?void 0:t.call(wT,i)}};function cw(i){return hw(i,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function MT(i,e={}){var t,r,s,n,a,o,l;let d=cw(i);if(d.length===0||d.some(({type:u})=>!u))return ro(i);if(((t=d[0])==null?void 0:t.token)===">"){let u=e[(r=d[1])==null?void 0:r.token];if(!u)return ro(i);let c={...e};u.state=c;let h=d.slice(2);for(let f=0;f<h.length;f+=3){let m=(s=h[f])==null?void 0:s.token,p=(n=h[f+1])==null?void 0:n.token,g=(a=h[f+2])==null?void 0:a.token;m&&p==="="&&(c[m]=so(g,e))}return u}if(d.length===1)return Ru(d[0])?so(d[0].token,e):ro(i);if(d.length===2){let u=(o=d[0])==null?void 0:o.token,c=DT[u];if(!c||!Ru(d[1]))return ro(i);let h=so(d[1].token,e);return c(h)}if(d.length===3){let u=(l=d[1])==null?void 0:l.token,c=DT[u];if(!c||!Ru(d[0])||!Ru(d[2]))return ro(i);let h=so(d[0].token,e);if(u==="|")return c(h,d[2].token);let f=so(d[2].token,e);return c(h,f)}}function ro(i){return console.warn(`Warning: invalid expression \`${i}\``),!1}function Ru({type:i}){return["number","boolean","string","param"].includes(i)}function so(i,e){let t=i[0],r=i.slice(-1);return i==="true"||i==="false"?i==="true":t===r&&["'",'"'].includes(t)?i.slice(1,-1):Do(i)?parseFloat(i):e[i]}function hw(i,e){let t,r,s,n=[];for(;i;){s=null,t=i.length;for(let a in e)r=e[a].exec(i),r&&r.index<t&&(s={token:r[0],type:a,matches:r.slice(1)},t=r.index);t&&n.push({token:i.substr(0,t),type:void 0}),s&&n.push(s),i=i.substr(t+(s?s.token.length:0))}return n}var Op=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Dp=(i,e,t)=>(Op(i,e,"read from private field"),t?t.call(i):e.get(i)),no=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Cs=(i,e,t,r)=>(Op(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Cp=(i,e,t)=>(Op(i,e,"access private method"),t),On,ku,Nn,Mp,PT,Cu,Pp,wp={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},OT=F.createElement("template");OT.innerHTML=`
|
|
1318
1318
|
<style>
|
|
1319
1319
|
:host {
|
package/dist/mux-player.mjs
CHANGED
|
@@ -1271,7 +1271,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1271
1271
|
`:""}${i.error?`error: ${i.error}
|
|
1272
1272
|
`:""}${i.event?`event: ${i.event}
|
|
1273
1273
|
`:""}${i.err?`error message: ${(s=i.err)==null?void 0:s.message}
|
|
1274
|
-
`:""}`),l.data=i,l};var fC=Object.defineProperty,mC=Object.getPrototypeOf,pC=Reflect.get,sT=i=>{throw TypeError(i)},gC=(i,e,t)=>e in i?fC(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Le=(i,e,t)=>gC(i,typeof e!="symbol"?e+"":e,t),bp=(i,e,t)=>e.has(i)||sT("Cannot "+t),I=(i,e,t)=>(bp(i,e,"read from private field"),t?t.call(i):e.get(i)),ie=(i,e,t)=>e.has(i)?sT("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),Q=(i,e,t,r)=>(bp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ne=(i,e,t)=>(bp(i,e,"access private method"),t),tp=(i,e,t)=>pC(mC(i),t,e),pu=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends pu{}globalThis.DocumentFragment=i}var yp=class extends pu{},vC=class extends pu{},EC={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(yp)}},iu,bC=class{constructor(i,e={}){ie(this,iu),Q(this,iu,e==null?void 0:e.detail)}get detail(){return I(this,iu)}initCustomEvent(){}};iu=new WeakMap;function yC(i,e){return new yp}var nT={document:{createElement:yC},DocumentFragment,customElements:EC,CustomEvent:bC,EventTarget:pu,HTMLElement:yp,HTMLVideoElement:vC},aT=typeof window=="undefined"||typeof globalThis.customElements=="undefined",ip=aT?nT:globalThis,A2=aT?nT.document:globalThis.document,TC=()=>{try{return"0.24.
|
|
1274
|
+
`:""}`),l.data=i,l};var fC=Object.defineProperty,mC=Object.getPrototypeOf,pC=Reflect.get,sT=i=>{throw TypeError(i)},gC=(i,e,t)=>e in i?fC(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Le=(i,e,t)=>gC(i,typeof e!="symbol"?e+"":e,t),bp=(i,e,t)=>e.has(i)||sT("Cannot "+t),I=(i,e,t)=>(bp(i,e,"read from private field"),t?t.call(i):e.get(i)),ie=(i,e,t)=>e.has(i)?sT("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),Q=(i,e,t,r)=>(bp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ne=(i,e,t)=>(bp(i,e,"access private method"),t),tp=(i,e,t)=>pC(mC(i),t,e),pu=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends pu{}globalThis.DocumentFragment=i}var yp=class extends pu{},vC=class extends pu{},EC={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(yp)}},iu,bC=class{constructor(i,e={}){ie(this,iu),Q(this,iu,e==null?void 0:e.detail)}get detail(){return I(this,iu)}initCustomEvent(){}};iu=new WeakMap;function yC(i,e){return new yp}var nT={document:{createElement:yC},DocumentFragment,customElements:EC,CustomEvent:bC,EventTarget:pu,HTMLElement:yp,HTMLVideoElement:vC},aT=typeof window=="undefined"||typeof globalThis.customElements=="undefined",ip=aT?nT:globalThis,A2=aT?nT.document:globalThis.document,TC=()=>{try{return"0.24.2"}catch{}return"UNKNOWN"},_C=TC(),AC=()=>_C,gu=["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"],oT=["autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"];function SC(i){return`
|
|
1275
1275
|
<style>
|
|
1276
1276
|
:host {
|
|
1277
1277
|
display: inline-flex;
|
|
@@ -1313,7 +1313,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1313
1313
|
<video${dT(i)}></video>
|
|
1314
1314
|
</slot>
|
|
1315
1315
|
<slot></slot>
|
|
1316
|
-
`}function lT(i,{tag:e,is:t}){var r,s,n,a,o,l,d,u,c,h,f,m,p,g,E,b,T;let _=(s=(r=globalThis.document)==null?void 0:r.createElement)==null?void 0:s.call(r,e,{is:t}),A=_?RC(_):[];return n=class extends i{constructor(){super(...arguments),ie(this,f),ie(this,d,!1),ie(this,u,null),ie(this,c,new Map),ie(this,h),Le(this,"get"),Le(this,"set"),Le(this,"call")}static get observedAttributes(){var x,S,w;return Ne(x=n,o,l).call(x),[...(w=(S=_==null?void 0:_.constructor)==null?void 0:S.observedAttributes)!=null?w:[],...oT]}get nativeEl(){var x,S,w,M,k;return Ne(this,f,m).call(this),(k=(M=(S=(x=I(this,u))!=null?x:this.querySelector(":scope > [slot=media]"))!=null?S:this.querySelector(e))!=null?M:(w=this.shadowRoot)==null?void 0:w.querySelector(e))!=null?k:null}set nativeEl(x){Q(this,u,x)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(x){this.toggleAttribute("muted",x)}get src(){return this.getAttribute("src")}set src(x){this.setAttribute("src",`${x}`)}get preload(){var x,S;return(S=this.getAttribute("preload"))!=null?S:(x=this.nativeEl)==null?void 0:x.preload}set preload(x){this.setAttribute("preload",`${x}`)}init(){var x;if(!this.shadowRoot){this.attachShadow({mode:"open"});let S=IC(this.attributes);t&&(S.is=t),e&&(S.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(S)}this.nativeEl.muted=this.hasAttribute("muted");for(let S of A)Ne(this,f,b).call(this,S);Q(this,h,new MutationObserver(Ne(this,f,g).bind(this))),this.shadowRoot.addEventListener("slotchange",this),Ne(this,f,p).call(this);for(let S of this.constructor.Events)(x=this.shadowRoot)==null||x.addEventListener(S,this,!0)}handleEvent(x){if(x.type==="slotchange"){Ne(this,f,p).call(this);return}x.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(x.type,{detail:x.detail}))}attributeChangedCallback(x,S,w){Ne(this,f,m).call(this),Ne(this,f,T).call(this,x,S,w)}connectedCallback(){Ne(this,f,m).call(this)}},a=new WeakMap,o=new WeakSet,l=function(){if(I(this,a))return;Q(this,a,!0);let x=new Set(this.observedAttributes);x.delete("muted");for(let S of A)if(!(S in this.prototype))if(typeof _[S]=="function")this.prototype[S]=function(...w){return Ne(this,f,m).call(this),(()=>{var M;if(this.call)return this.call(S,...w);let k=(M=this.nativeEl)==null?void 0:M[S];return k==null?void 0:k.apply(this.nativeEl,w)})()};else{let w={get(){var M,k,P;Ne(this,f,m).call(this);let N=S.toLowerCase();if(x.has(N)){let B=this.getAttribute(N);return B===null?!1:B===""?!0:B}return(P=(M=this.get)==null?void 0:M.call(this,S))!=null?P:(k=this.nativeEl)==null?void 0:k[S]}};S!==S.toUpperCase()&&(w.set=function(M){Ne(this,f,m).call(this);let k=S.toLowerCase();if(x.has(k)){M===!0||M===!1||M==null?this.toggleAttribute(k,!!M):this.setAttribute(k,M);return}if(this.set){this.set(S,M);return}this.nativeEl&&(this.nativeEl[S]=M)}),Object.defineProperty(this.prototype,S,w)}},d=new WeakMap,u=new WeakMap,c=new WeakMap,h=new WeakMap,f=new WeakSet,m=function(){I(this,d)||(Q(this,d,!0),this.init())},p=function(){var x;let S=new Map(I(this,c)),w=(x=this.shadowRoot)==null?void 0:x.querySelector("slot:not([name])");(w==null?void 0:w.assignedElements({flatten:!0}).filter(M=>["track","source"].includes(M.localName))).forEach(M=>{var k,P;S.delete(M);let N=I(this,c).get(M);N||(N=M.cloneNode(),I(this,c).set(M,N),(k=I(this,h))==null||k.observe(M,{attributes:!0})),(P=this.nativeEl)==null||P.append(N),Ne(this,f,E).call(this,N)}),S.forEach((M,k)=>{M.remove(),I(this,c).delete(k)})},g=function(x){var S;for(let w of x)if(w.type==="attributes"){let{target:M,attributeName:k}=w,P=I(this,c).get(M);P&&k&&(P.setAttribute(k,(S=M.getAttribute(k))!=null?S:""),Ne(this,f,E).call(this,P))}},E=function(x){x&&x.localName==="track"&&x.default&&(x.kind==="chapters"||x.kind==="metadata")&&x.track.mode==="disabled"&&(x.track.mode="hidden")},b=function(x){if(Object.prototype.hasOwnProperty.call(this,x)){let S=this[x];delete this[x],this[x]=S}},T=function(x,S,w){var M,k,P;["id","class"].includes(x)||!n.observedAttributes.includes(x)&&this.constructor.observedAttributes.includes(x)||(w===null?(M=this.nativeEl)==null||M.removeAttribute(x):((k=this.nativeEl)==null?void 0:k.getAttribute(x))!==w&&((P=this.nativeEl)==null||P.setAttribute(x,w)))},ie(n,o),Le(n,"getTemplateHTML",e.endsWith("audio")?SC:xC),Le(n,"shadowRootOptions",{mode:"open"}),Le(n,"Events",gu),ie(n,a,!1),n}function RC(i){let e=[];for(let t=Object.getPrototypeOf(i);t&&t!==HTMLElement.prototype;t=Object.getPrototypeOf(t)){let r=Object.getOwnPropertyNames(t);e.push(...r)}return e}function dT(i){let e="";for(let t in i){if(!oT.includes(t))continue;let r=i[t];r===""?e+=` ${t}`:e+=` ${t}="${r}"`}return e}function IC(i){let e={};for(let t of i)e[t.name]=t.value;return e}var zy,rp=lT((zy=globalThis.HTMLElement)!=null?zy:class{},{tag:"video"}),Xy,x2=lT((Xy=globalThis.HTMLElement)!=null?Xy:class{},{tag:"audio"}),Ts=new WeakMap,sp=class extends Error{},LC=class extends Error{},kC=globalThis.WeakRef?class extends Set{add(i){super.add(new WeakRef(i))}forEach(i){super.forEach(e=>{let t=e.deref();t&&i(t)})}}:Set;function CC(i){var e,t,r;(t=(e=globalThis.chrome)==null?void 0:e.cast)!=null&&t.isAvailable?(r=globalThis.cast)!=null&&r.framework?i():customElements.whenDefined("google-cast-button").then(i):globalThis.__onGCastApiAvailable=()=>{customElements.whenDefined("google-cast-button").then(i)}}function wC(){return globalThis.chrome}function DC(){var i;let e="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1";if((i=globalThis.chrome)!=null&&i.cast||document.querySelector(`script[src="${e}"]`))return;let t=document.createElement("script");t.src=e,document.head.append(t)}function _s(){var i,e;return(e=(i=globalThis.cast)==null?void 0:i.framework)==null?void 0:e.CastContext.getInstance()}function Tp(){var i;return(i=_s())==null?void 0:i.getCurrentSession()}function _p(){var i;return(i=Tp())==null?void 0:i.getSessionObj().media[0]}function MC(i){return new Promise((e,t)=>{_p().editTracksInfo(i,e,t)})}function PC(i){return new Promise((e,t)=>{_p().getStatus(i,e,t)})}function uT(i){return _s().setOptions({...cT(),...i})}function cT(){return{receiverApplicationId:"CC1AD845",autoJoinPolicy:"origin_scoped",androidReceiverCompatible:!1,language:"en-US",resumeSavedSession:!0}}var ru=new kC,xr=new WeakSet,ot;CC(()=>{var i,e,t,r;if(!((e=(i=globalThis.chrome)==null?void 0:i.cast)!=null&&e.isAvailable)){console.debug("chrome.cast.isAvailable",(r=(t=globalThis.chrome)==null?void 0:t.cast)==null?void 0:r.isAvailable);return}ot||(ot=cast.framework,_s().addEventListener(ot.CastContextEventType.CAST_STATE_CHANGED,s=>{ru.forEach(n=>{var a,o;return(o=(a=Ts.get(n)).onCastStateChanged)==null?void 0:o.call(a,s)})}),_s().addEventListener(ot.CastContextEventType.SESSION_STATE_CHANGED,s=>{ru.forEach(n=>{var a,o;return(o=(a=Ts.get(n)).onSessionStateChanged)==null?void 0:o.call(a,s)})}),ru.forEach(s=>{var n,a;return(a=(n=Ts.get(s)).init)==null?void 0:a.call(n)}))});var Qy=0,Ie,su,jt,Sr,Dn,Ln,ys,ap,bt,os,Zy,op,hT,lp,Jy,np,OC=class extends EventTarget{constructor(i){super(),ie(this,bt),ie(this,Ie),ie(this,su),ie(this,jt),ie(this,Sr),ie(this,Dn,"disconnected"),ie(this,Ln,!1),ie(this,ys,new Set),ie(this,ap,new WeakMap),Q(this,Ie,i),ru.add(this),Ts.set(this,{init:()=>Ne(this,bt,lp).call(this),onCastStateChanged:()=>Ne(this,bt,op).call(this),onSessionStateChanged:()=>Ne(this,bt,hT).call(this),getCastPlayer:()=>I(this,bt,os)}),Ne(this,bt,lp).call(this)}get state(){return I(this,Dn)}async watchAvailability(i){if(I(this,Ie).disableRemotePlayback)throw new sp("disableRemotePlayback attribute is present.");return I(this,ap).set(i,++Qy),I(this,ys).add(i),Qy}async cancelWatchAvailability(i){if(I(this,Ie).disableRemotePlayback)throw new sp("disableRemotePlayback attribute is present.");i?I(this,ys).delete(i):I(this,ys).clear()}async prompt(){var i,e,t,r;if(I(this,Ie).disableRemotePlayback)throw new sp("disableRemotePlayback attribute is present.");if(!((e=(i=globalThis.chrome)==null?void 0:i.cast)!=null&&e.isAvailable))throw new LC("The RemotePlayback API is disabled on this platform.");let s=xr.has(I(this,Ie));xr.add(I(this,Ie)),uT(I(this,Ie).castOptions),Object.entries(I(this,Sr)).forEach(([n,a])=>{I(this,jt).controller.addEventListener(n,a)});try{await _s().requestSession()}catch(n){if(n==="cancel"){s||xr.delete(I(this,Ie));return}throw new Error(n)}(r=(t=Ts.get(I(this,Ie)))==null?void 0:t.loadOnPrompt)==null||r.call(t)}};Ie=new WeakMap,su=new WeakMap,jt=new WeakMap,Sr=new WeakMap,Dn=new WeakMap,Ln=new WeakMap,ys=new WeakMap,ap=new WeakMap,bt=new WeakSet,os=function(){if(xr.has(I(this,Ie)))return I(this,jt)},Zy=function(){xr.has(I(this,Ie))&&(Object.entries(I(this,Sr)).forEach(([i,e])=>{I(this,jt).controller.removeEventListener(i,e)}),xr.delete(I(this,Ie)),I(this,Ie).muted=I(this,jt).isMuted,I(this,Ie).currentTime=I(this,jt).savedPlayerState.currentTime,I(this,jt).savedPlayerState.isPaused===!1&&I(this,Ie).play())},op=function(){let i=_s().getCastState();if(xr.has(I(this,Ie))&&i==="CONNECTING"&&(Q(this,Dn,"connecting"),this.dispatchEvent(new Event("connecting"))),!I(this,Ln)&&i!=null&&i.includes("CONNECT")){Q(this,Ln,!0);for(let e of I(this,ys))e(!0)}else if(I(this,Ln)&&(!i||i==="NO_DEVICES_AVAILABLE")){Q(this,Ln,!1);for(let e of I(this,ys))e(!1)}},hT=async function(){var i;let{SESSION_RESUMED:e}=ot.SessionState;if(_s().getSessionState()===e&&I(this,Ie).castSrc===((i=_p())==null?void 0:i.media.contentId)){xr.add(I(this,Ie)),Object.entries(I(this,Sr)).forEach(([t,r])=>{I(this,jt).controller.addEventListener(t,r)});try{await PC(new chrome.cast.media.GetStatusRequest)}catch(t){console.error(t)}I(this,Sr)[ot.RemotePlayerEventType.IS_PAUSED_CHANGED](),I(this,Sr)[ot.RemotePlayerEventType.PLAYER_STATE_CHANGED]()}},lp=function(){!ot||I(this,su)||(Q(this,su,!0),uT(I(this,Ie).castOptions),I(this,Ie).textTracks.addEventListener("change",()=>Ne(this,bt,np).call(this)),Ne(this,bt,op).call(this),Q(this,jt,new ot.RemotePlayer),new ot.RemotePlayerController(I(this,jt)),Q(this,Sr,{[ot.RemotePlayerEventType.IS_CONNECTED_CHANGED]:({value:i})=>{i===!0?(Q(this,Dn,"connected"),this.dispatchEvent(new Event("connect"))):(Ne(this,bt,Zy).call(this),Q(this,Dn,"disconnected"),this.dispatchEvent(new Event("disconnect")))},[ot.RemotePlayerEventType.DURATION_CHANGED]:()=>{I(this,Ie).dispatchEvent(new Event("durationchange"))},[ot.RemotePlayerEventType.VOLUME_LEVEL_CHANGED]:()=>{I(this,Ie).dispatchEvent(new Event("volumechange"))},[ot.RemotePlayerEventType.IS_MUTED_CHANGED]:()=>{I(this,Ie).dispatchEvent(new Event("volumechange"))},[ot.RemotePlayerEventType.CURRENT_TIME_CHANGED]:()=>{var i;(i=I(this,bt,os))!=null&&i.isMediaLoaded&&I(this,Ie).dispatchEvent(new Event("timeupdate"))},[ot.RemotePlayerEventType.VIDEO_INFO_CHANGED]:()=>{I(this,Ie).dispatchEvent(new Event("resize"))},[ot.RemotePlayerEventType.IS_PAUSED_CHANGED]:()=>{I(this,Ie).dispatchEvent(new Event(this.paused?"pause":"play"))},[ot.RemotePlayerEventType.PLAYER_STATE_CHANGED]:()=>{var i,e;((i=I(this,bt,os))==null?void 0:i.playerState)!==chrome.cast.media.PlayerState.PAUSED&&I(this,Ie).dispatchEvent(new Event({[chrome.cast.media.PlayerState.PLAYING]:"playing",[chrome.cast.media.PlayerState.BUFFERING]:"waiting",[chrome.cast.media.PlayerState.IDLE]:"emptied"}[(e=I(this,bt,os))==null?void 0:e.playerState]))},[ot.RemotePlayerEventType.IS_MEDIA_LOADED_CHANGED]:async()=>{var i;(i=I(this,bt,os))!=null&&i.isMediaLoaded&&(await Promise.resolve(),Ne(this,bt,Jy).call(this))}}))},Jy=function(){Ne(this,bt,np).call(this)},np=async function(){var i,e,t,r,s;if(!I(this,bt,os))return;let n=((e=(i=I(this,jt).mediaInfo)==null?void 0:i.tracks)!=null?e:[]).filter(({type:h})=>h===chrome.cast.media.TrackType.TEXT),a=[...I(this,Ie).textTracks].filter(({kind:h})=>h==="subtitles"||h==="captions"),o=n.map(({language:h,name:f,trackId:m})=>{var p;let{mode:g}=(p=a.find(E=>E.language===h&&E.label===f))!=null?p:{};return g?{mode:g,trackId:m}:!1}).filter(Boolean),l=o.filter(({mode:h})=>h!=="showing").map(({trackId:h})=>h),d=o.find(({mode:h})=>h==="showing"),u=(s=(r=(t=Tp())==null?void 0:t.getSessionObj().media[0])==null?void 0:r.activeTrackIds)!=null?s:[],c=u;if(u.length&&(c=c.filter(h=>!l.includes(h))),d!=null&&d.trackId&&(c=[...c,d.trackId]),c=[...new Set(c)],!((h,f)=>h.length===f.length&&h.every(m=>f.includes(m)))(u,c))try{let h=new chrome.cast.media.EditTracksInfoRequest(c);await MC(h)}catch(h){console.error(h)}};var NC=i=>{var e,t,r,s,n,a,o,l,d;return t=class extends i{constructor(){super(...arguments),ie(this,o),ie(this,r,{paused:!1}),ie(this,s,cT()),ie(this,n),ie(this,a)}get remote(){return I(this,a)?I(this,a):wC()?(this.disableRemotePlayback||DC(),Ts.set(this,{loadOnPrompt:()=>Ne(this,o,d).call(this)}),Q(this,a,new OC(this))):super.remote}attributeChangedCallback(u,c,h){if(super.attributeChangedCallback(u,c,h),u==="cast-receiver"&&h){I(this,s).receiverApplicationId=h;return}if(I(this,o,l))switch(u){case"cast-stream-type":case"cast-src":this.load();break}}async load(){var u,c;if(!I(this,o,l))return super.load();let h=new chrome.cast.media.MediaInfo(this.castSrc,this.castContentType);h.customData=this.castCustomData;let f=[...this.querySelectorAll("track")].filter(({kind:E,src:b})=>b&&(E==="subtitles"||E==="captions")),m=[],p=0;f.length&&(h.tracks=f.map(E=>{let b=++p;m.length===0&&E.track.mode==="showing"&&m.push(b);let T=new chrome.cast.media.Track(b,chrome.cast.media.TrackType.TEXT);return T.trackContentId=E.src,T.trackContentType="text/vtt",T.subtype=E.kind==="captions"?chrome.cast.media.TextTrackType.CAPTIONS:chrome.cast.media.TextTrackType.SUBTITLES,T.name=E.label,T.language=E.srclang,T})),this.castStreamType==="live"?h.streamType=chrome.cast.media.StreamType.LIVE:h.streamType=chrome.cast.media.StreamType.BUFFERED,h.metadata=new chrome.cast.media.GenericMediaMetadata,h.metadata.title=this.title,h.metadata.images=[{url:this.poster}];let g=new chrome.cast.media.LoadRequest(h);g.currentTime=(u=super.currentTime)!=null?u:0,g.autoplay=!I(this,r).paused,g.activeTrackIds=m,await((c=Tp())==null?void 0:c.loadMedia(g)),this.dispatchEvent(new Event("volumechange"))}play(){var u;if(I(this,o,l)){I(this,o,l).isPaused&&((u=I(this,o,l).controller)==null||u.playOrPause());return}return super.play()}pause(){var u;if(I(this,o,l)){I(this,o,l).isPaused||(u=I(this,o,l).controller)==null||u.playOrPause();return}super.pause()}get castOptions(){return I(this,s)}get castReceiver(){var u;return(u=this.getAttribute("cast-receiver"))!=null?u:void 0}set castReceiver(u){this.castReceiver!=u&&this.setAttribute("cast-receiver",`${u}`)}get castSrc(){var u,c,h;return(h=(c=this.getAttribute("cast-src"))!=null?c:(u=this.querySelector("source"))==null?void 0:u.src)!=null?h:this.currentSrc}set castSrc(u){this.castSrc!=u&&this.setAttribute("cast-src",`${u}`)}get castContentType(){var u;return(u=this.getAttribute("cast-content-type"))!=null?u:void 0}set castContentType(u){this.setAttribute("cast-content-type",`${u}`)}get castStreamType(){var u,c;return(c=(u=this.getAttribute("cast-stream-type"))!=null?u:this.streamType)!=null?c:void 0}set castStreamType(u){this.setAttribute("cast-stream-type",`${u}`)}get castCustomData(){return I(this,n)}set castCustomData(u){let c=typeof u;if(!["object","undefined"].includes(c)){console.error(`castCustomData must be nullish or an object but value was of type ${c}`);return}Q(this,n,u)}get readyState(){if(I(this,o,l))switch(I(this,o,l).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 I(this,o,l)?I(this,o,l).isPaused:super.paused}get muted(){var u;return I(this,o,l)?(u=I(this,o,l))==null?void 0:u.isMuted:super.muted}set muted(u){var c;if(I(this,o,l)){(u&&!I(this,o,l).isMuted||!u&&I(this,o,l).isMuted)&&((c=I(this,o,l).controller)==null||c.muteOrUnmute());return}super.muted=u}get volume(){var u,c;return I(this,o,l)?(c=(u=I(this,o,l))==null?void 0:u.volumeLevel)!=null?c:1:super.volume}set volume(u){var c;if(I(this,o,l)){I(this,o,l).volumeLevel=+u,(c=I(this,o,l).controller)==null||c.setVolumeLevel();return}super.volume=u}get duration(){var u,c,h;return I(this,o,l)&&(u=I(this,o,l))!=null&&u.isMediaLoaded?(h=(c=I(this,o,l))==null?void 0:c.duration)!=null?h:NaN:super.duration}get currentTime(){var u,c,h;return I(this,o,l)&&(u=I(this,o,l))!=null&&u.isMediaLoaded?(h=(c=I(this,o,l))==null?void 0:c.currentTime)!=null?h:0:super.currentTime}set currentTime(u){var c;if(I(this,o,l)){I(this,o,l).currentTime=u,(c=I(this,o,l).controller)==null||c.seek();return}super.currentTime=u}},r=new WeakMap,s=new WeakMap,n=new WeakMap,a=new WeakMap,o=new WeakSet,l=function(){var u,c;return(c=(u=Ts.get(this.remote))==null?void 0:u.getCastPlayer)==null?void 0:c.call(u)},d=async function(){I(this,r).paused=tp(t.prototype,this,"paused"),tp(t.prototype,this,"pause").call(this),this.muted=tp(t.prototype,this,"muted");try{await this.load()}catch(u){console.error(u)}},Le(t,"observedAttributes",[...(e=i.observedAttributes)!=null?e:[],"cast-src","cast-content-type","cast-stream-type","cast-receiver"]),t},vu=class extends Event{constructor(i,e){super(i),Le(this,"track"),this.track=e.track}},dp=new WeakMap;function Y(i){var e;return(e=dp.get(i))!=null?e:UC(i,{})}function UC(i,e){let t=dp.get(i);return t||dp.set(i,t={}),Object.assign(t,e)}function up(i,e){let t=i.videoTracks;Y(e).media=i,Y(e).renditionSet||(Y(e).renditionSet=new Set);let r=Y(t).trackSet;r.add(e);let s=r.size-1;s in hp.prototype||Object.defineProperty(hp.prototype,s,{get(){return[...Y(this).trackSet][s]}}),queueMicrotask(()=>{t.dispatchEvent(new vu("addtrack",{track:e}))})}function cp(i){var e;let t=(e=Y(i).media)==null?void 0:e.videoTracks;t&&(Y(t).trackSet.delete(i),queueMicrotask(()=>{t.dispatchEvent(new vu("removetrack",{track:i}))}))}function FC(i){var e;let t=(e=Y(i).media.videoTracks)!=null?e:[],r=!1;for(let s of t)s!==i&&(s.selected=!1,r=!0);if(r){if(Y(t).changeRequested)return;Y(t).changeRequested=!0,queueMicrotask(()=>{delete Y(t).changeRequested,t.dispatchEvent(new Event("change"))})}}var ls,ds,us,kn,Va,hp=class extends EventTarget{constructor(){super(),ie(this,kn),ie(this,ls),ie(this,ds),ie(this,us),Y(this).trackSet=new Set}[Symbol.iterator](){return I(this,kn,Va).values()}get length(){return I(this,kn,Va).size}getTrackById(i){var e;return(e=[...I(this,kn,Va)].find(t=>t.id===i))!=null?e:null}get selectedIndex(){return[...I(this,kn,Va)].findIndex(i=>i.selected)}get onaddtrack(){return I(this,ls)}set onaddtrack(i){I(this,ls)&&(this.removeEventListener("addtrack",I(this,ls)),Q(this,ls,void 0)),typeof i=="function"&&(Q(this,ls,i),this.addEventListener("addtrack",i))}get onremovetrack(){return I(this,ds)}set onremovetrack(i){I(this,ds)&&(this.removeEventListener("removetrack",I(this,ds)),Q(this,ds,void 0)),typeof i=="function"&&(Q(this,ds,i),this.addEventListener("removetrack",i))}get onchange(){return I(this,us)}set onchange(i){I(this,us)&&(this.removeEventListener("change",I(this,us)),Q(this,us,void 0)),typeof i=="function"&&(Q(this,us,i),this.addEventListener("change",i))}};ls=new WeakMap,ds=new WeakMap,us=new WeakMap,kn=new WeakSet,Va=function(){return Y(this).trackSet};var Eu=class extends Event{constructor(i,e){super(i),Le(this,"rendition"),this.rendition=e.rendition}};function BC(i,e){let t=Y(i).media.videoRenditions;Y(e).media=Y(i).media,Y(e).track=i;let r=Y(i).renditionSet;r.add(e);let s=r.size-1;s in fp.prototype||Object.defineProperty(fp.prototype,s,{get(){return Cn(this)[s]}}),queueMicrotask(()=>{i.selected&&t.dispatchEvent(new Eu("addrendition",{rendition:e}))})}function $C(i){let e=Y(i).media.videoRenditions,t=Y(i).track;Y(t).renditionSet.delete(i),queueMicrotask(()=>{Y(i).track.selected&&e.dispatchEvent(new Eu("removerendition",{rendition:i}))})}function HC(i){let e=Y(i).media.videoRenditions;!e||Y(e).changeRequested||(Y(e).changeRequested=!0,queueMicrotask(()=>{delete Y(e).changeRequested,Y(i).track.selected&&e.dispatchEvent(new Event("change"))}))}function Cn(i){return[...Y(i).media.videoTracks].filter(e=>e.selected).flatMap(e=>[...Y(e).renditionSet])}var cs,hs,fs,fp=class extends EventTarget{constructor(){super(...arguments),ie(this,cs),ie(this,hs),ie(this,fs)}[Symbol.iterator](){return Cn(this).values()}get length(){return Cn(this).length}getRenditionById(i){var e;return(e=Cn(this).find(t=>`${t.id}`==`${i}`))!=null?e:null}get selectedIndex(){return Cn(this).findIndex(i=>i.selected)}set selectedIndex(i){for(let[e,t]of Cn(this).entries())t.selected=e===i}get onaddrendition(){return I(this,cs)}set onaddrendition(i){I(this,cs)&&(this.removeEventListener("addrendition",I(this,cs)),Q(this,cs,void 0)),typeof i=="function"&&(Q(this,cs,i),this.addEventListener("addrendition",i))}get onremoverendition(){return I(this,hs)}set onremoverendition(i){I(this,hs)&&(this.removeEventListener("removerendition",I(this,hs)),Q(this,hs,void 0)),typeof i=="function"&&(Q(this,hs,i),this.addEventListener("removerendition",i))}get onchange(){return I(this,fs)}set onchange(i){I(this,fs)&&(this.removeEventListener("change",I(this,fs)),Q(this,fs,void 0)),typeof i=="function"&&(Q(this,fs,i),this.addEventListener("change",i))}};cs=new WeakMap,hs=new WeakMap,fs=new WeakMap;var Wa,GC=class{constructor(){Le(this,"src"),Le(this,"id"),Le(this,"width"),Le(this,"height"),Le(this,"bitrate"),Le(this,"frameRate"),Le(this,"codec"),ie(this,Wa,!1)}get selected(){return I(this,Wa)}set selected(i){I(this,Wa)!==i&&(Q(this,Wa,i),HC(this))}};Wa=new WeakMap;var Ya,fT=class{constructor(){Le(this,"id"),Le(this,"kind"),Le(this,"label",""),Le(this,"language",""),Le(this,"sourceBuffer"),ie(this,Ya,!1)}addRendition(i,e,t,r,s,n){let a=new GC;return a.src=i,a.width=e,a.height=t,a.frameRate=n,a.bitrate=s,a.codec=r,BC(this,a),a}removeRendition(i){$C(i)}get selected(){return I(this,Ya)}set selected(i){I(this,Ya)!==i&&(Q(this,Ya,i),i===!0&&FC(this))}};Ya=new WeakMap;function KC(i,e){let t=Y(i).media.audioRenditions;Y(e).media=Y(i).media,Y(e).track=i;let r=Y(i).renditionSet;r.add(e);let s=r.size-1;s in mp.prototype||Object.defineProperty(mp.prototype,s,{get(){return wn(this)[s]}}),queueMicrotask(()=>{i.enabled&&t.dispatchEvent(new Eu("addrendition",{rendition:e}))})}function VC(i){let e=Y(i).media.audioRenditions,t=Y(i).track;Y(t).renditionSet.delete(i),queueMicrotask(()=>{Y(i).track.enabled&&e.dispatchEvent(new Eu("removerendition",{rendition:i}))})}function WC(i){let e=Y(i).media.audioRenditions;!e||Y(e).changeRequested||(Y(e).changeRequested=!0,queueMicrotask(()=>{delete Y(e).changeRequested,Y(i).track.enabled&&e.dispatchEvent(new Event("change"))}))}function wn(i){return[...Y(i).media.audioTracks].filter(e=>e.enabled).flatMap(e=>[...Y(e).renditionSet])}var ms,ps,gs,mp=class extends EventTarget{constructor(){super(...arguments),ie(this,ms),ie(this,ps),ie(this,gs)}[Symbol.iterator](){return wn(this).values()}get length(){return wn(this).length}getRenditionById(i){var e;return(e=wn(this).find(t=>`${t.id}`==`${i}`))!=null?e:null}get selectedIndex(){return wn(this).findIndex(i=>i.selected)}set selectedIndex(i){for(let[e,t]of wn(this).entries())t.selected=e===i}get onaddrendition(){return I(this,ms)}set onaddrendition(i){I(this,ms)&&(this.removeEventListener("addrendition",I(this,ms)),Q(this,ms,void 0)),typeof i=="function"&&(Q(this,ms,i),this.addEventListener("addrendition",i))}get onremoverendition(){return I(this,ps)}set onremoverendition(i){I(this,ps)&&(this.removeEventListener("removerendition",I(this,ps)),Q(this,ps,void 0)),typeof i=="function"&&(Q(this,ps,i),this.addEventListener("removerendition",i))}get onchange(){return I(this,gs)}set onchange(i){I(this,gs)&&(this.removeEventListener("change",I(this,gs)),Q(this,gs,void 0)),typeof i=="function"&&(Q(this,gs,i),this.addEventListener("change",i))}};ms=new WeakMap,ps=new WeakMap,gs=new WeakMap;var qa,YC=class{constructor(){Le(this,"src"),Le(this,"id"),Le(this,"bitrate"),Le(this,"codec"),ie(this,qa,!1)}get selected(){return I(this,qa)}set selected(i){I(this,qa)!==i&&(Q(this,qa,i),WC(this))}};qa=new WeakMap;function pp(i,e){let t=i.audioTracks;Y(e).media=i,Y(e).renditionSet||(Y(e).renditionSet=new Set);let r=Y(t).trackSet;r.add(e);let s=r.size-1;s in vp.prototype||Object.defineProperty(vp.prototype,s,{get(){return[...Y(this).trackSet][s]}}),queueMicrotask(()=>{t.dispatchEvent(new vu("addtrack",{track:e}))})}function gp(i){var e;let t=(e=Y(i).media)==null?void 0:e.audioTracks;t&&(Y(t).trackSet.delete(i),queueMicrotask(()=>{t.dispatchEvent(new vu("removetrack",{track:i}))}))}function qC(i){let e=Y(i).media.audioTracks;!e||Y(e).changeRequested||(Y(e).changeRequested=!0,queueMicrotask(()=>{delete Y(e).changeRequested,e.dispatchEvent(new Event("change"))}))}var vs,Es,bs,ja,nu,vp=class extends EventTarget{constructor(){super(),ie(this,ja),ie(this,vs),ie(this,Es),ie(this,bs),Y(this).trackSet=new Set}[Symbol.iterator](){return I(this,ja,nu).values()}get length(){return I(this,ja,nu).size}getTrackById(i){var e;return(e=[...I(this,ja,nu)].find(t=>t.id===i))!=null?e:null}get onaddtrack(){return I(this,vs)}set onaddtrack(i){I(this,vs)&&(this.removeEventListener("addtrack",I(this,vs)),Q(this,vs,void 0)),typeof i=="function"&&(Q(this,vs,i),this.addEventListener("addtrack",i))}get onremovetrack(){return I(this,Es)}set onremovetrack(i){I(this,Es)&&(this.removeEventListener("removetrack",I(this,Es)),Q(this,Es,void 0)),typeof i=="function"&&(Q(this,Es,i),this.addEventListener("removetrack",i))}get onchange(){return I(this,bs)}set onchange(i){I(this,bs)&&(this.removeEventListener("change",I(this,bs)),Q(this,bs,void 0)),typeof i=="function"&&(Q(this,bs,i),this.addEventListener("change",i))}};vs=new WeakMap,Es=new WeakMap,bs=new WeakMap,ja=new WeakSet,nu=function(){return Y(this).trackSet};var za,mT=class{constructor(){Le(this,"id"),Le(this,"kind"),Le(this,"label",""),Le(this,"language",""),Le(this,"sourceBuffer"),ie(this,za,!1)}addRendition(i,e,t){let r=new YC;return r.src=i,r.codec=e,r.bitrate=t,KC(this,r),r}removeRendition(i){VC(i)}get enabled(){return I(this,za)}set enabled(i){I(this,za)!==i&&(Q(this,za,i),qC(this))}};za=new WeakMap;var eT=mu(globalThis.HTMLMediaElement,"video"),tT=mu(globalThis.HTMLMediaElement,"audio");function jC(i){if(!(i!=null&&i.prototype))return i;let e=mu(i,"video");(!e||`${e}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"videoTracks",{get(){return zC(this)}});let t=mu(i,"audio");(!t||`${t}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"audioTracks",{get(){return XC(this)}}),"addVideoTrack"in i.prototype||(i.prototype.addVideoTrack=function(n,a="",o=""){let l=new fT;return l.kind=n,l.label=a,l.language=o,up(this,l),l}),"removeVideoTrack"in i.prototype||(i.prototype.removeVideoTrack=cp),"addAudioTrack"in i.prototype||(i.prototype.addAudioTrack=function(n,a="",o=""){let l=new mT;return l.kind=n,l.label=a,l.language=o,pp(this,l),l}),"removeAudioTrack"in i.prototype||(i.prototype.removeAudioTrack=gp),"videoRenditions"in i.prototype||Object.defineProperty(i.prototype,"videoRenditions",{get(){return r(this)}});let r=n=>{let a=Y(n).videoRenditions;return a||(a=new fp,Y(a).media=n,Y(n).videoRenditions=a),a};"audioRenditions"in i.prototype||Object.defineProperty(i.prototype,"audioRenditions",{get(){return s(this)}});let s=n=>{let a=Y(n).audioRenditions;return a||(a=new mp,Y(a).media=n,Y(n).audioRenditions=a),a};return i}function mu(i,e){var t;if(i!=null&&i.prototype)return(t=Object.getOwnPropertyDescriptor(i.prototype,`${e}Tracks`))==null?void 0:t.get}function zC(i){var e;let t=Y(i).videoTracks;if(!t&&(t=new hp,Y(i).videoTracks=t,eT)){let r=eT.call((e=i.nativeEl)!=null?e:i);for(let s of r)up(i,s);r.addEventListener("change",()=>{t.dispatchEvent(new Event("change"))}),r.addEventListener("addtrack",s=>{if([...t].some(n=>n instanceof fT)){for(let n of r)cp(n);return}up(i,s.track)}),r.addEventListener("removetrack",s=>{cp(s.track)})}return t}function XC(i){var e;let t=Y(i).audioTracks;if(!t&&(t=new vp,Y(i).audioTracks=t,tT)){let r=tT.call((e=i.nativeEl)!=null?e:i);for(let s of r)pp(i,s);r.addEventListener("change",()=>{t.dispatchEvent(new Event("change"))}),r.addEventListener("addtrack",s=>{if([...t].some(n=>n instanceof mT)){for(let n of r)gp(n);return}pp(i,s.track)}),r.addEventListener("removetrack",s=>{gp(s.track)})}return t}gu.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",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"},QC=Object.values(C),iT=AC(),rT="mux-video",Pi,Xa,au,Qa,ou,lu,du,uu,cu,Za,hu,ZC=class extends rp{constructor(){super(),ie(this,Za),ie(this,Pi),ie(this,Xa),ie(this,au),ie(this,Qa,{}),ie(this,ou,{}),ie(this,lu),ie(this,du),ie(this,uu),ie(this,cu),Q(this,au,Jd())}static get NAME(){return rT}static get VERSION(){return iT}static get observedAttributes(){var i;return[...QC,...(i=rp.observedAttributes)!=null?i:[]]}get preferCmcd(){var i;return(i=this.getAttribute(C.PREFER_CMCD))!=null?i:void 0}set preferCmcd(i){i!==this.preferCmcd&&(i?In.includes(i)?this.setAttribute(C.PREFER_CMCD,i):console.warn(`Invalid value for preferCmcd. Must be one of ${In.join()}`):this.removeAttribute(C.PREFER_CMCD))}get playerInitTime(){return this.hasAttribute(C.PLAYER_INIT_TIME)?+this.getAttribute(C.PLAYER_INIT_TIME):I(this,au)}set playerInitTime(i){i!=this.playerInitTime&&(i==null?this.removeAttribute(C.PLAYER_INIT_TIME):this.setAttribute(C.PLAYER_INIT_TIME,`${+i}`))}get playerSoftwareName(){var i;return(i=I(this,uu))!=null?i:rT}set playerSoftwareName(i){Q(this,uu,i)}get playerSoftwareVersion(){var i;return(i=I(this,du))!=null?i:iT}set playerSoftwareVersion(i){Q(this,du,i)}get _hls(){var i;return(i=I(this,Pi))==null?void 0:i.engine}get mux(){var i;return(i=this.nativeEl)==null?void 0:i.mux}get error(){var i;return(i=Qm(this.nativeEl))!=null?i:null}get errorTranslator(){return I(this,cu)}set errorTranslator(i){Q(this,cu,i)}get src(){return this.getAttribute("src")}set src(i){i!==this.src&&(i==null?this.removeAttribute("src"):this.setAttribute("src",i))}get type(){var i;return(i=this.getAttribute(C.TYPE))!=null?i:void 0}set type(i){i!==this.type&&(i?this.setAttribute(C.TYPE,i):this.removeAttribute(C.TYPE))}get autoplay(){let i=this.getAttribute("autoplay");return i===null?!1:i===""?!0:i}set autoplay(i){let e=this.autoplay;i!==e&&(i?this.setAttribute("autoplay",typeof i=="string"?i:""):this.removeAttribute("autoplay"))}get preload(){let i=this.getAttribute("preload");return i===""?"auto":["none","metadata","auto"].includes(i)?i:super.preload}set preload(i){i!=this.getAttribute("preload")&&(["","none","metadata","auto"].includes(i)?this.setAttribute("preload",i):this.removeAttribute("preload"))}get debug(){return this.getAttribute(C.DEBUG)!=null}set debug(i){i!==this.debug&&(i?this.setAttribute(C.DEBUG,""):this.removeAttribute(C.DEBUG))}get disableTracking(){return this.hasAttribute(C.DISABLE_TRACKING)}set disableTracking(i){i!==this.disableTracking&&this.toggleAttribute(C.DISABLE_TRACKING,!!i)}get disableCookies(){return this.hasAttribute(C.DISABLE_COOKIES)}set disableCookies(i){i!==this.disableCookies&&(i?this.setAttribute(C.DISABLE_COOKIES,""):this.removeAttribute(C.DISABLE_COOKIES))}get startTime(){let i=this.getAttribute(C.START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set startTime(i){i!==this.startTime&&(i==null?this.removeAttribute(C.START_TIME):this.setAttribute(C.START_TIME,`${i}`))}get playbackId(){var i;return this.hasAttribute(C.PLAYBACK_ID)?this.getAttribute(C.PLAYBACK_ID):(i=Xm(this.src))!=null?i:void 0}set playbackId(i){i!==this.playbackId&&(i?this.setAttribute(C.PLAYBACK_ID,i):this.removeAttribute(C.PLAYBACK_ID))}get maxResolution(){var i;return(i=this.getAttribute(C.MAX_RESOLUTION))!=null?i:void 0}set maxResolution(i){i!==this.maxResolution&&(i?this.setAttribute(C.MAX_RESOLUTION,i):this.removeAttribute(C.MAX_RESOLUTION))}get minResolution(){var i;return(i=this.getAttribute(C.MIN_RESOLUTION))!=null?i:void 0}set minResolution(i){i!==this.minResolution&&(i?this.setAttribute(C.MIN_RESOLUTION,i):this.removeAttribute(C.MIN_RESOLUTION))}get renditionOrder(){var i;return(i=this.getAttribute(C.RENDITION_ORDER))!=null?i:void 0}set renditionOrder(i){i!==this.renditionOrder&&(i?this.setAttribute(C.RENDITION_ORDER,i):this.removeAttribute(C.RENDITION_ORDER))}get programStartTime(){let i=this.getAttribute(C.PROGRAM_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programStartTime(i){i==null?this.removeAttribute(C.PROGRAM_START_TIME):this.setAttribute(C.PROGRAM_START_TIME,`${i}`)}get programEndTime(){let i=this.getAttribute(C.PROGRAM_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programEndTime(i){i==null?this.removeAttribute(C.PROGRAM_END_TIME):this.setAttribute(C.PROGRAM_END_TIME,`${i}`)}get assetStartTime(){let i=this.getAttribute(C.ASSET_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetStartTime(i){i==null?this.removeAttribute(C.ASSET_START_TIME):this.setAttribute(C.ASSET_START_TIME,`${i}`)}get assetEndTime(){let i=this.getAttribute(C.ASSET_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetEndTime(i){i==null?this.removeAttribute(C.ASSET_END_TIME):this.setAttribute(C.ASSET_END_TIME,`${i}`)}get customDomain(){var i;return(i=this.getAttribute(C.CUSTOM_DOMAIN))!=null?i:void 0}set customDomain(i){i!==this.customDomain&&(i?this.setAttribute(C.CUSTOM_DOMAIN,i):this.removeAttribute(C.CUSTOM_DOMAIN))}get drmToken(){var i;return(i=this.getAttribute(C.DRM_TOKEN))!=null?i:void 0}set drmToken(i){i!==this.drmToken&&(i?this.setAttribute(C.DRM_TOKEN,i):this.removeAttribute(C.DRM_TOKEN))}get playbackToken(){var i,e,t,r;if(this.hasAttribute(C.PLAYBACK_TOKEN))return(i=this.getAttribute(C.PLAYBACK_TOKEN))!=null?i:void 0;if(this.hasAttribute(C.PLAYBACK_ID)){let[,s]=Xd((e=this.playbackId)!=null?e:"");return(t=new URLSearchParams(s).get("token"))!=null?t:void 0}if(this.src)return(r=new URLSearchParams(this.src).get("token"))!=null?r:void 0}set playbackToken(i){i!==this.playbackToken&&(i?this.setAttribute(C.PLAYBACK_TOKEN,i):this.removeAttribute(C.PLAYBACK_TOKEN))}get tokens(){let i=this.getAttribute(C.PLAYBACK_TOKEN),e=this.getAttribute(C.DRM_TOKEN);return{...I(this,ou),...i!=null?{playback:i}:{},...e!=null?{drm:e}:{}}}set tokens(i){Q(this,ou,i!=null?i:{})}get ended(){return Jm(this.nativeEl,this._hls)}get envKey(){var i;return(i=this.getAttribute(C.ENV_KEY))!=null?i:void 0}set envKey(i){i!==this.envKey&&(i?this.setAttribute(C.ENV_KEY,i):this.removeAttribute(C.ENV_KEY))}get beaconCollectionDomain(){var i;return(i=this.getAttribute(C.BEACON_COLLECTION_DOMAIN))!=null?i:void 0}set beaconCollectionDomain(i){i!==this.beaconCollectionDomain&&(i?this.setAttribute(C.BEACON_COLLECTION_DOMAIN,i):this.removeAttribute(C.BEACON_COLLECTION_DOMAIN))}get streamType(){var i;return(i=this.getAttribute(C.STREAM_TYPE))!=null?i:zd(this.nativeEl)}set streamType(i){i!==this.streamType&&(i?this.setAttribute(C.STREAM_TYPE,i):this.removeAttribute(C.STREAM_TYPE))}get targetLiveWindow(){return this.hasAttribute(C.TARGET_LIVE_WINDOW)?+this.getAttribute(C.TARGET_LIVE_WINDOW):By(this.nativeEl)}set targetLiveWindow(i){i!=this.targetLiveWindow&&(i==null?this.removeAttribute(C.TARGET_LIVE_WINDOW):this.setAttribute(C.TARGET_LIVE_WINDOW,`${+i}`))}get liveEdgeStart(){var i,e;if(this.hasAttribute(C.LIVE_EDGE_OFFSET)){let{liveEdgeOffset:t}=this,r=(i=this.nativeEl.seekable.end(0))!=null?i:0,s=(e=this.nativeEl.seekable.start(0))!=null?e:0;return Math.max(s,r-t)}return $y(this.nativeEl)}get liveEdgeOffset(){if(this.hasAttribute(C.LIVE_EDGE_OFFSET))return+this.getAttribute(C.LIVE_EDGE_OFFSET)}set liveEdgeOffset(i){i!=this.liveEdgeOffset&&(i==null?this.removeAttribute(C.LIVE_EDGE_OFFSET):this.setAttribute(C.LIVE_EDGE_OFFSET,`${+i}`))}get seekable(){return tu(this.nativeEl)}async addCuePoints(i){return Wm(this.nativeEl,i)}get activeCuePoint(){return Ym(this.nativeEl)}get cuePoints(){return wy(this.nativeEl)}async addChapters(i){return jm(this.nativeEl,i)}get activeChapter(){return zm(this.nativeEl)}get chapters(){return My(this.nativeEl)}getStartDate(){return Py(this.nativeEl,this._hls)}get currentPdt(){return Oy(this.nativeEl,this._hls)}get preferPlayback(){let i=this.getAttribute(C.PREFER_PLAYBACK);if(i===qt.MSE||i===qt.NATIVE)return i}set preferPlayback(i){i!==this.preferPlayback&&(i===qt.MSE||i===qt.NATIVE?this.setAttribute(C.PREFER_PLAYBACK,i):this.removeAttribute(C.PREFER_PLAYBACK))}get metadata(){return{...this.getAttributeNames().filter(i=>i.startsWith("metadata-")&&![C.METADATA_URL].includes(i)).reduce((i,e)=>{let t=this.getAttribute(e);return t!=null&&(i[e.replace(/^metadata-/,"").replace(/-/g,"_")]=t),i},{}),...I(this,Qa)}}set metadata(i){Q(this,Qa,i!=null?i:{}),this.mux&&this.mux.emit("hb",I(this,Qa))}get _hlsConfig(){return I(this,lu)}set _hlsConfig(i){Q(this,lu,i)}load(){Q(this,Pi,Ky(this,this.nativeEl,I(this,Pi)))}unload(){ep(this.nativeEl,I(this,Pi)),Q(this,Pi,void 0)}attributeChangedCallback(i,e,t){var r,s;switch(rp.observedAttributes.includes(i)&&!["src","autoplay","preload"].includes(i)&&super.attributeChangedCallback(i,e,t),i){case C.PLAYER_SOFTWARE_NAME:this.playerSoftwareName=t!=null?t:void 0;break;case C.PLAYER_SOFTWARE_VERSION:this.playerSoftwareVersion=t!=null?t:void 0;break;case"src":{let n=!!e,a=!!t;!n&&a?Ne(this,Za,hu).call(this):n&&!a?this.unload():n&&a&&(this.unload(),Ne(this,Za,hu).call(this));break}case"autoplay":if(t===e)break;(r=I(this,Pi))==null||r.setAutoplay(this.autoplay);break;case"preload":if(t===e)break;(s=I(this,Pi))==null||s.setPreload(t);break;case C.PLAYBACK_ID:this.src=Ka(this);break;case C.DEBUG:{let n=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=n);break}case C.METADATA_URL:t&&fetch(t).then(n=>n.json()).then(n=>this.metadata=n).catch(()=>console.error(`Unable to load or parse metadata JSON from metadata-url ${t}!`));break;case C.STREAM_TYPE:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("streamtypechange",{composed:!0,bubbles:!0}));break;case C.TARGET_LIVE_WINDOW:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("targetlivewindowchange",{composed:!0,bubbles:!0,detail:this.targetLiveWindow}));break;default:break}}connectedCallback(){var i;(i=super.connectedCallback)==null||i.call(this),this.nativeEl&&this.src&&!I(this,Pi)&&Ne(this,Za,hu).call(this)}disconnectedCallback(){this.unload()}};Pi=new WeakMap,Xa=new WeakMap,au=new WeakMap,Qa=new WeakMap,ou=new WeakMap,lu=new WeakMap,du=new WeakMap,uu=new WeakMap,cu=new WeakMap,Za=new WeakSet,hu=async function(){I(this,Xa)||(await Q(this,Xa,Promise.resolve()),Q(this,Xa,null),this.load())};var fu,Ep=class extends NC(jC(ZC)){constructor(){super(...arguments),ie(this,fu)}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 i;return(i=I(this,fu))!=null?i:this.muxCastCustomData}set castCustomData(i){Q(this,fu,i)}};fu=new WeakMap;ip.customElements.get("mux-video")||(ip.customElements.define("mux-video",Ep),ip.MuxVideoElement=Ep);var pT=Ep;function gT(i){let e="";return Object.entries(i).forEach(([t,r])=>{r!=null&&(e+=`${bu(t)}: ${r}; `)}),e?e.trim():void 0}function bu(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function yu(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Rt(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function Ap(i){let e=JC(i).toString();return e?"?"+e:""}function JC(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var Sp=(i,e)=>!i||!e?!1:i.contains(e)?!0:Sp(i,e.getRootNode().host);var vT="mux.com",ew=()=>{try{return"3.2.3"}catch{}return"UNKNOWN"},tw=ew(),_u=()=>tw,ET=(i,{token:e,customDomain:t=vT,thumbnailTime:r,programTime:s}={})=>{var o;let n=e==null?r:void 0,{aud:a}=(o=Ar(e))!=null?o:{};if(!(e&&a!=="t"))return`https://image.${t}/${i}/thumbnail.webp${Ap({token:e,time:n,program_time:s})}`},bT=(i,{token:e,customDomain:t=vT,programStartTime:r,programEndTime:s}={})=>{var a;let{aud:n}=(a=Ar(e))!=null?a:{};if(!(e&&n!=="s"))return`https://image.${t}/${i}/storyboard.vtt${Ap({token:e,format:"webp",program_start_time:r,program_end_time:s})}`},Ja=i=>{if(i){if([Re.LIVE,Re.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return Re.LIVE}};var iw={crossorigin:"crossOrigin",playsinline:"playsInline"};function yT(i){var e;return(e=iw[i])!=null?e:yu(i)}var As,Ss,It,Tu=class{constructor(e,t){kt(this,As);kt(this,Ss);kt(this,It,[]);$t(this,As,e),$t(this,Ss,t)}[Symbol.iterator](){return _e(this,It).values()}get length(){return _e(this,It).length}get value(){var e;return(e=_e(this,It).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&($t(this,It,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return _e(this,It)[e]}values(){return _e(this,It).values()}keys(){return _e(this,It).keys()}forEach(e){_e(this,It).forEach(e)}add(...e){var t,r;e.forEach(s=>{this.contains(s)||_e(this,It).push(s)}),!(this.value===""&&!((t=_e(this,As))!=null&&t.hasAttribute(`${_e(this,Ss)}`)))&&((r=_e(this,As))==null||r.setAttribute(`${_e(this,Ss)}`,`${this.value}`))}remove(...e){var t;e.forEach(r=>{_e(this,It).splice(_e(this,It).indexOf(r),1)}),(t=_e(this,As))==null||t.setAttribute(`${_e(this,Ss)}`,`${this.value}`)}contains(e){return _e(this,It).includes(e)}toggle(e,t){return typeof t!="undefined"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){this.remove(e),this.add(t)}};As=new WeakMap,Ss=new WeakMap,It=new WeakMap;var TT=`[mux-player ${_u()}]`;function Oi(...i){console.warn(TT,...i)}function Ut(...i){console.error(TT,...i)}function xp(i){var t;let e=(t=i.message)!=null?t:"";i.context&&(e+=` ${i.context}`),i.file&&(e+=` ${j("Read more: ")}
|
|
1316
|
+
`}function lT(i,{tag:e,is:t}){var r,s,n,a,o,l,d,u,c,h,f,m,p,g,E,b,T;let _=(s=(r=globalThis.document)==null?void 0:r.createElement)==null?void 0:s.call(r,e,{is:t}),A=_?RC(_):[];return n=class extends i{constructor(){super(...arguments),ie(this,f),ie(this,d,!1),ie(this,u,null),ie(this,c,new Map),ie(this,h),Le(this,"get"),Le(this,"set"),Le(this,"call")}static get observedAttributes(){var x,S,w;return Ne(x=n,o,l).call(x),[...(w=(S=_==null?void 0:_.constructor)==null?void 0:S.observedAttributes)!=null?w:[],...oT]}get nativeEl(){var x,S,w,M,k;return Ne(this,f,m).call(this),(k=(M=(S=(x=I(this,u))!=null?x:this.querySelector(":scope > [slot=media]"))!=null?S:this.querySelector(e))!=null?M:(w=this.shadowRoot)==null?void 0:w.querySelector(e))!=null?k:null}set nativeEl(x){Q(this,u,x)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(x){this.toggleAttribute("muted",x)}get src(){return this.getAttribute("src")}set src(x){this.setAttribute("src",`${x}`)}get preload(){var x,S;return(S=this.getAttribute("preload"))!=null?S:(x=this.nativeEl)==null?void 0:x.preload}set preload(x){this.setAttribute("preload",`${x}`)}init(){var x;if(!this.shadowRoot){this.attachShadow({mode:"open"});let S=IC(this.attributes);t&&(S.is=t),e&&(S.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(S)}this.nativeEl.muted=this.hasAttribute("muted");for(let S of A)Ne(this,f,b).call(this,S);Q(this,h,new MutationObserver(Ne(this,f,g).bind(this))),this.shadowRoot.addEventListener("slotchange",this),Ne(this,f,p).call(this);for(let S of this.constructor.Events)(x=this.shadowRoot)==null||x.addEventListener(S,this,!0)}handleEvent(x){if(x.type==="slotchange"){Ne(this,f,p).call(this);return}x.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(x.type,{detail:x.detail}))}attributeChangedCallback(x,S,w){Ne(this,f,m).call(this),Ne(this,f,T).call(this,x,S,w)}connectedCallback(){Ne(this,f,m).call(this)}},a=new WeakMap,o=new WeakSet,l=function(){if(I(this,a))return;Q(this,a,!0);let x=new Set(this.observedAttributes);x.delete("muted");for(let S of A)if(!(S in this.prototype))if(typeof _[S]=="function")this.prototype[S]=function(...w){return Ne(this,f,m).call(this),(()=>{var M;if(this.call)return this.call(S,...w);let k=(M=this.nativeEl)==null?void 0:M[S];return k==null?void 0:k.apply(this.nativeEl,w)})()};else{let w={get(){var M,k,P;Ne(this,f,m).call(this);let N=S.toLowerCase();if(x.has(N)){let B=this.getAttribute(N);return B===null?!1:B===""?!0:B}return(P=(M=this.get)==null?void 0:M.call(this,S))!=null?P:(k=this.nativeEl)==null?void 0:k[S]}};S!==S.toUpperCase()&&(w.set=function(M){Ne(this,f,m).call(this);let k=S.toLowerCase();if(x.has(k)){M===!0||M===!1||M==null?this.toggleAttribute(k,!!M):this.setAttribute(k,M);return}if(this.set){this.set(S,M);return}this.nativeEl&&(this.nativeEl[S]=M)}),Object.defineProperty(this.prototype,S,w)}},d=new WeakMap,u=new WeakMap,c=new WeakMap,h=new WeakMap,f=new WeakSet,m=function(){I(this,d)||(Q(this,d,!0),this.init())},p=function(){var x;let S=new Map(I(this,c)),w=(x=this.shadowRoot)==null?void 0:x.querySelector("slot:not([name])");(w==null?void 0:w.assignedElements({flatten:!0}).filter(M=>["track","source"].includes(M.localName))).forEach(M=>{var k,P;S.delete(M);let N=I(this,c).get(M);N||(N=M.cloneNode(),I(this,c).set(M,N),(k=I(this,h))==null||k.observe(M,{attributes:!0})),(P=this.nativeEl)==null||P.append(N),Ne(this,f,E).call(this,N)}),S.forEach((M,k)=>{M.remove(),I(this,c).delete(k)})},g=function(x){var S;for(let w of x)if(w.type==="attributes"){let{target:M,attributeName:k}=w,P=I(this,c).get(M);P&&k&&(P.setAttribute(k,(S=M.getAttribute(k))!=null?S:""),Ne(this,f,E).call(this,P))}},E=function(x){x&&x.localName==="track"&&x.default&&(x.kind==="chapters"||x.kind==="metadata")&&x.track.mode==="disabled"&&(x.track.mode="hidden")},b=function(x){if(Object.prototype.hasOwnProperty.call(this,x)){let S=this[x];delete this[x],this[x]=S}},T=function(x,S,w){var M,k,P;["id","class"].includes(x)||!n.observedAttributes.includes(x)&&this.constructor.observedAttributes.includes(x)||(w===null?(M=this.nativeEl)==null||M.removeAttribute(x):((k=this.nativeEl)==null?void 0:k.getAttribute(x))!==w&&((P=this.nativeEl)==null||P.setAttribute(x,w)))},ie(n,o),Le(n,"getTemplateHTML",e.endsWith("audio")?SC:xC),Le(n,"shadowRootOptions",{mode:"open"}),Le(n,"Events",gu),ie(n,a,!1),n}function RC(i){let e=[];for(let t=Object.getPrototypeOf(i);t&&t!==HTMLElement.prototype;t=Object.getPrototypeOf(t)){let r=Object.getOwnPropertyNames(t);e.push(...r)}return e}function dT(i){let e="";for(let t in i){if(!oT.includes(t))continue;let r=i[t];r===""?e+=` ${t}`:e+=` ${t}="${r}"`}return e}function IC(i){let e={};for(let t of i)e[t.name]=t.value;return e}var zy,rp=lT((zy=globalThis.HTMLElement)!=null?zy:class{},{tag:"video"}),Xy,x2=lT((Xy=globalThis.HTMLElement)!=null?Xy:class{},{tag:"audio"}),Ts=new WeakMap,sp=class extends Error{},LC=class extends Error{},kC=globalThis.WeakRef?class extends Set{add(i){super.add(new WeakRef(i))}forEach(i){super.forEach(e=>{let t=e.deref();t&&i(t)})}}:Set;function CC(i){var e,t,r;(t=(e=globalThis.chrome)==null?void 0:e.cast)!=null&&t.isAvailable?(r=globalThis.cast)!=null&&r.framework?i():customElements.whenDefined("google-cast-button").then(i):globalThis.__onGCastApiAvailable=()=>{customElements.whenDefined("google-cast-button").then(i)}}function wC(){return globalThis.chrome}function DC(){var i;let e="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1";if((i=globalThis.chrome)!=null&&i.cast||document.querySelector(`script[src="${e}"]`))return;let t=document.createElement("script");t.src=e,document.head.append(t)}function _s(){var i,e;return(e=(i=globalThis.cast)==null?void 0:i.framework)==null?void 0:e.CastContext.getInstance()}function Tp(){var i;return(i=_s())==null?void 0:i.getCurrentSession()}function _p(){var i;return(i=Tp())==null?void 0:i.getSessionObj().media[0]}function MC(i){return new Promise((e,t)=>{_p().editTracksInfo(i,e,t)})}function PC(i){return new Promise((e,t)=>{_p().getStatus(i,e,t)})}function uT(i){return _s().setOptions({...cT(),...i})}function cT(){return{receiverApplicationId:"CC1AD845",autoJoinPolicy:"origin_scoped",androidReceiverCompatible:!1,language:"en-US",resumeSavedSession:!0}}var ru=new kC,xr=new WeakSet,ot;CC(()=>{var i,e,t,r;if(!((e=(i=globalThis.chrome)==null?void 0:i.cast)!=null&&e.isAvailable)){console.debug("chrome.cast.isAvailable",(r=(t=globalThis.chrome)==null?void 0:t.cast)==null?void 0:r.isAvailable);return}ot||(ot=cast.framework,_s().addEventListener(ot.CastContextEventType.CAST_STATE_CHANGED,s=>{ru.forEach(n=>{var a,o;return(o=(a=Ts.get(n)).onCastStateChanged)==null?void 0:o.call(a,s)})}),_s().addEventListener(ot.CastContextEventType.SESSION_STATE_CHANGED,s=>{ru.forEach(n=>{var a,o;return(o=(a=Ts.get(n)).onSessionStateChanged)==null?void 0:o.call(a,s)})}),ru.forEach(s=>{var n,a;return(a=(n=Ts.get(s)).init)==null?void 0:a.call(n)}))});var Qy=0,Ie,su,jt,Sr,Dn,Ln,ys,ap,bt,os,Zy,op,hT,lp,Jy,np,OC=class extends EventTarget{constructor(i){super(),ie(this,bt),ie(this,Ie),ie(this,su),ie(this,jt),ie(this,Sr),ie(this,Dn,"disconnected"),ie(this,Ln,!1),ie(this,ys,new Set),ie(this,ap,new WeakMap),Q(this,Ie,i),ru.add(this),Ts.set(this,{init:()=>Ne(this,bt,lp).call(this),onCastStateChanged:()=>Ne(this,bt,op).call(this),onSessionStateChanged:()=>Ne(this,bt,hT).call(this),getCastPlayer:()=>I(this,bt,os)}),Ne(this,bt,lp).call(this)}get state(){return I(this,Dn)}async watchAvailability(i){if(I(this,Ie).disableRemotePlayback)throw new sp("disableRemotePlayback attribute is present.");return I(this,ap).set(i,++Qy),I(this,ys).add(i),Qy}async cancelWatchAvailability(i){if(I(this,Ie).disableRemotePlayback)throw new sp("disableRemotePlayback attribute is present.");i?I(this,ys).delete(i):I(this,ys).clear()}async prompt(){var i,e,t,r;if(I(this,Ie).disableRemotePlayback)throw new sp("disableRemotePlayback attribute is present.");if(!((e=(i=globalThis.chrome)==null?void 0:i.cast)!=null&&e.isAvailable))throw new LC("The RemotePlayback API is disabled on this platform.");let s=xr.has(I(this,Ie));xr.add(I(this,Ie)),uT(I(this,Ie).castOptions),Object.entries(I(this,Sr)).forEach(([n,a])=>{I(this,jt).controller.addEventListener(n,a)});try{await _s().requestSession()}catch(n){if(n==="cancel"){s||xr.delete(I(this,Ie));return}throw new Error(n)}(r=(t=Ts.get(I(this,Ie)))==null?void 0:t.loadOnPrompt)==null||r.call(t)}};Ie=new WeakMap,su=new WeakMap,jt=new WeakMap,Sr=new WeakMap,Dn=new WeakMap,Ln=new WeakMap,ys=new WeakMap,ap=new WeakMap,bt=new WeakSet,os=function(){if(xr.has(I(this,Ie)))return I(this,jt)},Zy=function(){xr.has(I(this,Ie))&&(Object.entries(I(this,Sr)).forEach(([i,e])=>{I(this,jt).controller.removeEventListener(i,e)}),xr.delete(I(this,Ie)),I(this,Ie).muted=I(this,jt).isMuted,I(this,Ie).currentTime=I(this,jt).savedPlayerState.currentTime,I(this,jt).savedPlayerState.isPaused===!1&&I(this,Ie).play())},op=function(){let i=_s().getCastState();if(xr.has(I(this,Ie))&&i==="CONNECTING"&&(Q(this,Dn,"connecting"),this.dispatchEvent(new Event("connecting"))),!I(this,Ln)&&i!=null&&i.includes("CONNECT")){Q(this,Ln,!0);for(let e of I(this,ys))e(!0)}else if(I(this,Ln)&&(!i||i==="NO_DEVICES_AVAILABLE")){Q(this,Ln,!1);for(let e of I(this,ys))e(!1)}},hT=async function(){var i;let{SESSION_RESUMED:e}=ot.SessionState;if(_s().getSessionState()===e&&I(this,Ie).castSrc===((i=_p())==null?void 0:i.media.contentId)){xr.add(I(this,Ie)),Object.entries(I(this,Sr)).forEach(([t,r])=>{I(this,jt).controller.addEventListener(t,r)});try{await PC(new chrome.cast.media.GetStatusRequest)}catch(t){console.error(t)}I(this,Sr)[ot.RemotePlayerEventType.IS_PAUSED_CHANGED](),I(this,Sr)[ot.RemotePlayerEventType.PLAYER_STATE_CHANGED]()}},lp=function(){!ot||I(this,su)||(Q(this,su,!0),uT(I(this,Ie).castOptions),I(this,Ie).textTracks.addEventListener("change",()=>Ne(this,bt,np).call(this)),Ne(this,bt,op).call(this),Q(this,jt,new ot.RemotePlayer),new ot.RemotePlayerController(I(this,jt)),Q(this,Sr,{[ot.RemotePlayerEventType.IS_CONNECTED_CHANGED]:({value:i})=>{i===!0?(Q(this,Dn,"connected"),this.dispatchEvent(new Event("connect"))):(Ne(this,bt,Zy).call(this),Q(this,Dn,"disconnected"),this.dispatchEvent(new Event("disconnect")))},[ot.RemotePlayerEventType.DURATION_CHANGED]:()=>{I(this,Ie).dispatchEvent(new Event("durationchange"))},[ot.RemotePlayerEventType.VOLUME_LEVEL_CHANGED]:()=>{I(this,Ie).dispatchEvent(new Event("volumechange"))},[ot.RemotePlayerEventType.IS_MUTED_CHANGED]:()=>{I(this,Ie).dispatchEvent(new Event("volumechange"))},[ot.RemotePlayerEventType.CURRENT_TIME_CHANGED]:()=>{var i;(i=I(this,bt,os))!=null&&i.isMediaLoaded&&I(this,Ie).dispatchEvent(new Event("timeupdate"))},[ot.RemotePlayerEventType.VIDEO_INFO_CHANGED]:()=>{I(this,Ie).dispatchEvent(new Event("resize"))},[ot.RemotePlayerEventType.IS_PAUSED_CHANGED]:()=>{I(this,Ie).dispatchEvent(new Event(this.paused?"pause":"play"))},[ot.RemotePlayerEventType.PLAYER_STATE_CHANGED]:()=>{var i,e;((i=I(this,bt,os))==null?void 0:i.playerState)!==chrome.cast.media.PlayerState.PAUSED&&I(this,Ie).dispatchEvent(new Event({[chrome.cast.media.PlayerState.PLAYING]:"playing",[chrome.cast.media.PlayerState.BUFFERING]:"waiting",[chrome.cast.media.PlayerState.IDLE]:"emptied"}[(e=I(this,bt,os))==null?void 0:e.playerState]))},[ot.RemotePlayerEventType.IS_MEDIA_LOADED_CHANGED]:async()=>{var i;(i=I(this,bt,os))!=null&&i.isMediaLoaded&&(await Promise.resolve(),Ne(this,bt,Jy).call(this))}}))},Jy=function(){Ne(this,bt,np).call(this)},np=async function(){var i,e,t,r,s;if(!I(this,bt,os))return;let n=((e=(i=I(this,jt).mediaInfo)==null?void 0:i.tracks)!=null?e:[]).filter(({type:h})=>h===chrome.cast.media.TrackType.TEXT),a=[...I(this,Ie).textTracks].filter(({kind:h})=>h==="subtitles"||h==="captions"),o=n.map(({language:h,name:f,trackId:m})=>{var p;let{mode:g}=(p=a.find(E=>E.language===h&&E.label===f))!=null?p:{};return g?{mode:g,trackId:m}:!1}).filter(Boolean),l=o.filter(({mode:h})=>h!=="showing").map(({trackId:h})=>h),d=o.find(({mode:h})=>h==="showing"),u=(s=(r=(t=Tp())==null?void 0:t.getSessionObj().media[0])==null?void 0:r.activeTrackIds)!=null?s:[],c=u;if(u.length&&(c=c.filter(h=>!l.includes(h))),d!=null&&d.trackId&&(c=[...c,d.trackId]),c=[...new Set(c)],!((h,f)=>h.length===f.length&&h.every(m=>f.includes(m)))(u,c))try{let h=new chrome.cast.media.EditTracksInfoRequest(c);await MC(h)}catch(h){console.error(h)}};var NC=i=>{var e,t,r,s,n,a,o,l,d;return t=class extends i{constructor(){super(...arguments),ie(this,o),ie(this,r,{paused:!1}),ie(this,s,cT()),ie(this,n),ie(this,a)}get remote(){return I(this,a)?I(this,a):wC()?(this.disableRemotePlayback||DC(),Ts.set(this,{loadOnPrompt:()=>Ne(this,o,d).call(this)}),Q(this,a,new OC(this))):super.remote}attributeChangedCallback(u,c,h){if(super.attributeChangedCallback(u,c,h),u==="cast-receiver"&&h){I(this,s).receiverApplicationId=h;return}if(I(this,o,l))switch(u){case"cast-stream-type":case"cast-src":this.load();break}}async load(){var u,c;if(!I(this,o,l))return super.load();let h=new chrome.cast.media.MediaInfo(this.castSrc,this.castContentType);h.customData=this.castCustomData;let f=[...this.querySelectorAll("track")].filter(({kind:E,src:b})=>b&&(E==="subtitles"||E==="captions")),m=[],p=0;f.length&&(h.tracks=f.map(E=>{let b=++p;m.length===0&&E.track.mode==="showing"&&m.push(b);let T=new chrome.cast.media.Track(b,chrome.cast.media.TrackType.TEXT);return T.trackContentId=E.src,T.trackContentType="text/vtt",T.subtype=E.kind==="captions"?chrome.cast.media.TextTrackType.CAPTIONS:chrome.cast.media.TextTrackType.SUBTITLES,T.name=E.label,T.language=E.srclang,T})),this.castStreamType==="live"?h.streamType=chrome.cast.media.StreamType.LIVE:h.streamType=chrome.cast.media.StreamType.BUFFERED,h.metadata=new chrome.cast.media.GenericMediaMetadata,h.metadata.title=this.title,h.metadata.images=[{url:this.poster}];let g=new chrome.cast.media.LoadRequest(h);g.currentTime=(u=super.currentTime)!=null?u:0,g.autoplay=!I(this,r).paused,g.activeTrackIds=m,await((c=Tp())==null?void 0:c.loadMedia(g)),this.dispatchEvent(new Event("volumechange"))}play(){var u;if(I(this,o,l)){I(this,o,l).isPaused&&((u=I(this,o,l).controller)==null||u.playOrPause());return}return super.play()}pause(){var u;if(I(this,o,l)){I(this,o,l).isPaused||(u=I(this,o,l).controller)==null||u.playOrPause();return}super.pause()}get castOptions(){return I(this,s)}get castReceiver(){var u;return(u=this.getAttribute("cast-receiver"))!=null?u:void 0}set castReceiver(u){this.castReceiver!=u&&this.setAttribute("cast-receiver",`${u}`)}get castSrc(){var u,c,h;return(h=(c=this.getAttribute("cast-src"))!=null?c:(u=this.querySelector("source"))==null?void 0:u.src)!=null?h:this.currentSrc}set castSrc(u){this.castSrc!=u&&this.setAttribute("cast-src",`${u}`)}get castContentType(){var u;return(u=this.getAttribute("cast-content-type"))!=null?u:void 0}set castContentType(u){this.setAttribute("cast-content-type",`${u}`)}get castStreamType(){var u,c;return(c=(u=this.getAttribute("cast-stream-type"))!=null?u:this.streamType)!=null?c:void 0}set castStreamType(u){this.setAttribute("cast-stream-type",`${u}`)}get castCustomData(){return I(this,n)}set castCustomData(u){let c=typeof u;if(!["object","undefined"].includes(c)){console.error(`castCustomData must be nullish or an object but value was of type ${c}`);return}Q(this,n,u)}get readyState(){if(I(this,o,l))switch(I(this,o,l).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 I(this,o,l)?I(this,o,l).isPaused:super.paused}get muted(){var u;return I(this,o,l)?(u=I(this,o,l))==null?void 0:u.isMuted:super.muted}set muted(u){var c;if(I(this,o,l)){(u&&!I(this,o,l).isMuted||!u&&I(this,o,l).isMuted)&&((c=I(this,o,l).controller)==null||c.muteOrUnmute());return}super.muted=u}get volume(){var u,c;return I(this,o,l)?(c=(u=I(this,o,l))==null?void 0:u.volumeLevel)!=null?c:1:super.volume}set volume(u){var c;if(I(this,o,l)){I(this,o,l).volumeLevel=+u,(c=I(this,o,l).controller)==null||c.setVolumeLevel();return}super.volume=u}get duration(){var u,c,h;return I(this,o,l)&&(u=I(this,o,l))!=null&&u.isMediaLoaded?(h=(c=I(this,o,l))==null?void 0:c.duration)!=null?h:NaN:super.duration}get currentTime(){var u,c,h;return I(this,o,l)&&(u=I(this,o,l))!=null&&u.isMediaLoaded?(h=(c=I(this,o,l))==null?void 0:c.currentTime)!=null?h:0:super.currentTime}set currentTime(u){var c;if(I(this,o,l)){I(this,o,l).currentTime=u,(c=I(this,o,l).controller)==null||c.seek();return}super.currentTime=u}},r=new WeakMap,s=new WeakMap,n=new WeakMap,a=new WeakMap,o=new WeakSet,l=function(){var u,c;return(c=(u=Ts.get(this.remote))==null?void 0:u.getCastPlayer)==null?void 0:c.call(u)},d=async function(){I(this,r).paused=tp(t.prototype,this,"paused"),tp(t.prototype,this,"pause").call(this),this.muted=tp(t.prototype,this,"muted");try{await this.load()}catch(u){console.error(u)}},Le(t,"observedAttributes",[...(e=i.observedAttributes)!=null?e:[],"cast-src","cast-content-type","cast-stream-type","cast-receiver"]),t},vu=class extends Event{constructor(i,e){super(i),Le(this,"track"),this.track=e.track}},dp=new WeakMap;function Y(i){var e;return(e=dp.get(i))!=null?e:UC(i,{})}function UC(i,e){let t=dp.get(i);return t||dp.set(i,t={}),Object.assign(t,e)}function up(i,e){let t=i.videoTracks;Y(e).media=i,Y(e).renditionSet||(Y(e).renditionSet=new Set);let r=Y(t).trackSet;r.add(e);let s=r.size-1;s in hp.prototype||Object.defineProperty(hp.prototype,s,{get(){return[...Y(this).trackSet][s]}}),queueMicrotask(()=>{t.dispatchEvent(new vu("addtrack",{track:e}))})}function cp(i){var e;let t=(e=Y(i).media)==null?void 0:e.videoTracks;t&&(Y(t).trackSet.delete(i),queueMicrotask(()=>{t.dispatchEvent(new vu("removetrack",{track:i}))}))}function FC(i){var e;let t=(e=Y(i).media.videoTracks)!=null?e:[],r=!1;for(let s of t)s!==i&&(s.selected=!1,r=!0);if(r){if(Y(t).changeRequested)return;Y(t).changeRequested=!0,queueMicrotask(()=>{delete Y(t).changeRequested,t.dispatchEvent(new Event("change"))})}}var ls,ds,us,kn,Va,hp=class extends EventTarget{constructor(){super(),ie(this,kn),ie(this,ls),ie(this,ds),ie(this,us),Y(this).trackSet=new Set}[Symbol.iterator](){return I(this,kn,Va).values()}get length(){return I(this,kn,Va).size}getTrackById(i){var e;return(e=[...I(this,kn,Va)].find(t=>t.id===i))!=null?e:null}get selectedIndex(){return[...I(this,kn,Va)].findIndex(i=>i.selected)}get onaddtrack(){return I(this,ls)}set onaddtrack(i){I(this,ls)&&(this.removeEventListener("addtrack",I(this,ls)),Q(this,ls,void 0)),typeof i=="function"&&(Q(this,ls,i),this.addEventListener("addtrack",i))}get onremovetrack(){return I(this,ds)}set onremovetrack(i){I(this,ds)&&(this.removeEventListener("removetrack",I(this,ds)),Q(this,ds,void 0)),typeof i=="function"&&(Q(this,ds,i),this.addEventListener("removetrack",i))}get onchange(){return I(this,us)}set onchange(i){I(this,us)&&(this.removeEventListener("change",I(this,us)),Q(this,us,void 0)),typeof i=="function"&&(Q(this,us,i),this.addEventListener("change",i))}};ls=new WeakMap,ds=new WeakMap,us=new WeakMap,kn=new WeakSet,Va=function(){return Y(this).trackSet};var Eu=class extends Event{constructor(i,e){super(i),Le(this,"rendition"),this.rendition=e.rendition}};function BC(i,e){let t=Y(i).media.videoRenditions;Y(e).media=Y(i).media,Y(e).track=i;let r=Y(i).renditionSet;r.add(e);let s=r.size-1;s in fp.prototype||Object.defineProperty(fp.prototype,s,{get(){return Cn(this)[s]}}),queueMicrotask(()=>{i.selected&&t.dispatchEvent(new Eu("addrendition",{rendition:e}))})}function $C(i){let e=Y(i).media.videoRenditions,t=Y(i).track;Y(t).renditionSet.delete(i),queueMicrotask(()=>{Y(i).track.selected&&e.dispatchEvent(new Eu("removerendition",{rendition:i}))})}function HC(i){let e=Y(i).media.videoRenditions;!e||Y(e).changeRequested||(Y(e).changeRequested=!0,queueMicrotask(()=>{delete Y(e).changeRequested,Y(i).track.selected&&e.dispatchEvent(new Event("change"))}))}function Cn(i){return[...Y(i).media.videoTracks].filter(e=>e.selected).flatMap(e=>[...Y(e).renditionSet])}var cs,hs,fs,fp=class extends EventTarget{constructor(){super(...arguments),ie(this,cs),ie(this,hs),ie(this,fs)}[Symbol.iterator](){return Cn(this).values()}get length(){return Cn(this).length}getRenditionById(i){var e;return(e=Cn(this).find(t=>`${t.id}`==`${i}`))!=null?e:null}get selectedIndex(){return Cn(this).findIndex(i=>i.selected)}set selectedIndex(i){for(let[e,t]of Cn(this).entries())t.selected=e===i}get onaddrendition(){return I(this,cs)}set onaddrendition(i){I(this,cs)&&(this.removeEventListener("addrendition",I(this,cs)),Q(this,cs,void 0)),typeof i=="function"&&(Q(this,cs,i),this.addEventListener("addrendition",i))}get onremoverendition(){return I(this,hs)}set onremoverendition(i){I(this,hs)&&(this.removeEventListener("removerendition",I(this,hs)),Q(this,hs,void 0)),typeof i=="function"&&(Q(this,hs,i),this.addEventListener("removerendition",i))}get onchange(){return I(this,fs)}set onchange(i){I(this,fs)&&(this.removeEventListener("change",I(this,fs)),Q(this,fs,void 0)),typeof i=="function"&&(Q(this,fs,i),this.addEventListener("change",i))}};cs=new WeakMap,hs=new WeakMap,fs=new WeakMap;var Wa,GC=class{constructor(){Le(this,"src"),Le(this,"id"),Le(this,"width"),Le(this,"height"),Le(this,"bitrate"),Le(this,"frameRate"),Le(this,"codec"),ie(this,Wa,!1)}get selected(){return I(this,Wa)}set selected(i){I(this,Wa)!==i&&(Q(this,Wa,i),HC(this))}};Wa=new WeakMap;var Ya,fT=class{constructor(){Le(this,"id"),Le(this,"kind"),Le(this,"label",""),Le(this,"language",""),Le(this,"sourceBuffer"),ie(this,Ya,!1)}addRendition(i,e,t,r,s,n){let a=new GC;return a.src=i,a.width=e,a.height=t,a.frameRate=n,a.bitrate=s,a.codec=r,BC(this,a),a}removeRendition(i){$C(i)}get selected(){return I(this,Ya)}set selected(i){I(this,Ya)!==i&&(Q(this,Ya,i),i===!0&&FC(this))}};Ya=new WeakMap;function KC(i,e){let t=Y(i).media.audioRenditions;Y(e).media=Y(i).media,Y(e).track=i;let r=Y(i).renditionSet;r.add(e);let s=r.size-1;s in mp.prototype||Object.defineProperty(mp.prototype,s,{get(){return wn(this)[s]}}),queueMicrotask(()=>{i.enabled&&t.dispatchEvent(new Eu("addrendition",{rendition:e}))})}function VC(i){let e=Y(i).media.audioRenditions,t=Y(i).track;Y(t).renditionSet.delete(i),queueMicrotask(()=>{Y(i).track.enabled&&e.dispatchEvent(new Eu("removerendition",{rendition:i}))})}function WC(i){let e=Y(i).media.audioRenditions;!e||Y(e).changeRequested||(Y(e).changeRequested=!0,queueMicrotask(()=>{delete Y(e).changeRequested,Y(i).track.enabled&&e.dispatchEvent(new Event("change"))}))}function wn(i){return[...Y(i).media.audioTracks].filter(e=>e.enabled).flatMap(e=>[...Y(e).renditionSet])}var ms,ps,gs,mp=class extends EventTarget{constructor(){super(...arguments),ie(this,ms),ie(this,ps),ie(this,gs)}[Symbol.iterator](){return wn(this).values()}get length(){return wn(this).length}getRenditionById(i){var e;return(e=wn(this).find(t=>`${t.id}`==`${i}`))!=null?e:null}get selectedIndex(){return wn(this).findIndex(i=>i.selected)}set selectedIndex(i){for(let[e,t]of wn(this).entries())t.selected=e===i}get onaddrendition(){return I(this,ms)}set onaddrendition(i){I(this,ms)&&(this.removeEventListener("addrendition",I(this,ms)),Q(this,ms,void 0)),typeof i=="function"&&(Q(this,ms,i),this.addEventListener("addrendition",i))}get onremoverendition(){return I(this,ps)}set onremoverendition(i){I(this,ps)&&(this.removeEventListener("removerendition",I(this,ps)),Q(this,ps,void 0)),typeof i=="function"&&(Q(this,ps,i),this.addEventListener("removerendition",i))}get onchange(){return I(this,gs)}set onchange(i){I(this,gs)&&(this.removeEventListener("change",I(this,gs)),Q(this,gs,void 0)),typeof i=="function"&&(Q(this,gs,i),this.addEventListener("change",i))}};ms=new WeakMap,ps=new WeakMap,gs=new WeakMap;var qa,YC=class{constructor(){Le(this,"src"),Le(this,"id"),Le(this,"bitrate"),Le(this,"codec"),ie(this,qa,!1)}get selected(){return I(this,qa)}set selected(i){I(this,qa)!==i&&(Q(this,qa,i),WC(this))}};qa=new WeakMap;function pp(i,e){let t=i.audioTracks;Y(e).media=i,Y(e).renditionSet||(Y(e).renditionSet=new Set);let r=Y(t).trackSet;r.add(e);let s=r.size-1;s in vp.prototype||Object.defineProperty(vp.prototype,s,{get(){return[...Y(this).trackSet][s]}}),queueMicrotask(()=>{t.dispatchEvent(new vu("addtrack",{track:e}))})}function gp(i){var e;let t=(e=Y(i).media)==null?void 0:e.audioTracks;t&&(Y(t).trackSet.delete(i),queueMicrotask(()=>{t.dispatchEvent(new vu("removetrack",{track:i}))}))}function qC(i){let e=Y(i).media.audioTracks;!e||Y(e).changeRequested||(Y(e).changeRequested=!0,queueMicrotask(()=>{delete Y(e).changeRequested,e.dispatchEvent(new Event("change"))}))}var vs,Es,bs,ja,nu,vp=class extends EventTarget{constructor(){super(),ie(this,ja),ie(this,vs),ie(this,Es),ie(this,bs),Y(this).trackSet=new Set}[Symbol.iterator](){return I(this,ja,nu).values()}get length(){return I(this,ja,nu).size}getTrackById(i){var e;return(e=[...I(this,ja,nu)].find(t=>t.id===i))!=null?e:null}get onaddtrack(){return I(this,vs)}set onaddtrack(i){I(this,vs)&&(this.removeEventListener("addtrack",I(this,vs)),Q(this,vs,void 0)),typeof i=="function"&&(Q(this,vs,i),this.addEventListener("addtrack",i))}get onremovetrack(){return I(this,Es)}set onremovetrack(i){I(this,Es)&&(this.removeEventListener("removetrack",I(this,Es)),Q(this,Es,void 0)),typeof i=="function"&&(Q(this,Es,i),this.addEventListener("removetrack",i))}get onchange(){return I(this,bs)}set onchange(i){I(this,bs)&&(this.removeEventListener("change",I(this,bs)),Q(this,bs,void 0)),typeof i=="function"&&(Q(this,bs,i),this.addEventListener("change",i))}};vs=new WeakMap,Es=new WeakMap,bs=new WeakMap,ja=new WeakSet,nu=function(){return Y(this).trackSet};var za,mT=class{constructor(){Le(this,"id"),Le(this,"kind"),Le(this,"label",""),Le(this,"language",""),Le(this,"sourceBuffer"),ie(this,za,!1)}addRendition(i,e,t){let r=new YC;return r.src=i,r.codec=e,r.bitrate=t,KC(this,r),r}removeRendition(i){VC(i)}get enabled(){return I(this,za)}set enabled(i){I(this,za)!==i&&(Q(this,za,i),qC(this))}};za=new WeakMap;var eT=mu(globalThis.HTMLMediaElement,"video"),tT=mu(globalThis.HTMLMediaElement,"audio");function jC(i){if(!(i!=null&&i.prototype))return i;let e=mu(i,"video");(!e||`${e}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"videoTracks",{get(){return zC(this)}});let t=mu(i,"audio");(!t||`${t}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"audioTracks",{get(){return XC(this)}}),"addVideoTrack"in i.prototype||(i.prototype.addVideoTrack=function(n,a="",o=""){let l=new fT;return l.kind=n,l.label=a,l.language=o,up(this,l),l}),"removeVideoTrack"in i.prototype||(i.prototype.removeVideoTrack=cp),"addAudioTrack"in i.prototype||(i.prototype.addAudioTrack=function(n,a="",o=""){let l=new mT;return l.kind=n,l.label=a,l.language=o,pp(this,l),l}),"removeAudioTrack"in i.prototype||(i.prototype.removeAudioTrack=gp),"videoRenditions"in i.prototype||Object.defineProperty(i.prototype,"videoRenditions",{get(){return r(this)}});let r=n=>{let a=Y(n).videoRenditions;return a||(a=new fp,Y(a).media=n,Y(n).videoRenditions=a),a};"audioRenditions"in i.prototype||Object.defineProperty(i.prototype,"audioRenditions",{get(){return s(this)}});let s=n=>{let a=Y(n).audioRenditions;return a||(a=new mp,Y(a).media=n,Y(n).audioRenditions=a),a};return i}function mu(i,e){var t;if(i!=null&&i.prototype)return(t=Object.getOwnPropertyDescriptor(i.prototype,`${e}Tracks`))==null?void 0:t.get}function zC(i){var e;let t=Y(i).videoTracks;if(!t&&(t=new hp,Y(i).videoTracks=t,eT)){let r=eT.call((e=i.nativeEl)!=null?e:i);for(let s of r)up(i,s);r.addEventListener("change",()=>{t.dispatchEvent(new Event("change"))}),r.addEventListener("addtrack",s=>{if([...t].some(n=>n instanceof fT)){for(let n of r)cp(n);return}up(i,s.track)}),r.addEventListener("removetrack",s=>{cp(s.track)})}return t}function XC(i){var e;let t=Y(i).audioTracks;if(!t&&(t=new vp,Y(i).audioTracks=t,tT)){let r=tT.call((e=i.nativeEl)!=null?e:i);for(let s of r)pp(i,s);r.addEventListener("change",()=>{t.dispatchEvent(new Event("change"))}),r.addEventListener("addtrack",s=>{if([...t].some(n=>n instanceof mT)){for(let n of r)gp(n);return}pp(i,s.track)}),r.addEventListener("removetrack",s=>{gp(s.track)})}return t}gu.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",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"},QC=Object.values(C),iT=AC(),rT="mux-video",Pi,Xa,au,Qa,ou,lu,du,uu,cu,Za,hu,ZC=class extends rp{constructor(){super(),ie(this,Za),ie(this,Pi),ie(this,Xa),ie(this,au),ie(this,Qa,{}),ie(this,ou,{}),ie(this,lu),ie(this,du),ie(this,uu),ie(this,cu),Q(this,au,Jd())}static get NAME(){return rT}static get VERSION(){return iT}static get observedAttributes(){var i;return[...QC,...(i=rp.observedAttributes)!=null?i:[]]}get preferCmcd(){var i;return(i=this.getAttribute(C.PREFER_CMCD))!=null?i:void 0}set preferCmcd(i){i!==this.preferCmcd&&(i?In.includes(i)?this.setAttribute(C.PREFER_CMCD,i):console.warn(`Invalid value for preferCmcd. Must be one of ${In.join()}`):this.removeAttribute(C.PREFER_CMCD))}get playerInitTime(){return this.hasAttribute(C.PLAYER_INIT_TIME)?+this.getAttribute(C.PLAYER_INIT_TIME):I(this,au)}set playerInitTime(i){i!=this.playerInitTime&&(i==null?this.removeAttribute(C.PLAYER_INIT_TIME):this.setAttribute(C.PLAYER_INIT_TIME,`${+i}`))}get playerSoftwareName(){var i;return(i=I(this,uu))!=null?i:rT}set playerSoftwareName(i){Q(this,uu,i)}get playerSoftwareVersion(){var i;return(i=I(this,du))!=null?i:iT}set playerSoftwareVersion(i){Q(this,du,i)}get _hls(){var i;return(i=I(this,Pi))==null?void 0:i.engine}get mux(){var i;return(i=this.nativeEl)==null?void 0:i.mux}get error(){var i;return(i=Qm(this.nativeEl))!=null?i:null}get errorTranslator(){return I(this,cu)}set errorTranslator(i){Q(this,cu,i)}get src(){return this.getAttribute("src")}set src(i){i!==this.src&&(i==null?this.removeAttribute("src"):this.setAttribute("src",i))}get type(){var i;return(i=this.getAttribute(C.TYPE))!=null?i:void 0}set type(i){i!==this.type&&(i?this.setAttribute(C.TYPE,i):this.removeAttribute(C.TYPE))}get autoplay(){let i=this.getAttribute("autoplay");return i===null?!1:i===""?!0:i}set autoplay(i){let e=this.autoplay;i!==e&&(i?this.setAttribute("autoplay",typeof i=="string"?i:""):this.removeAttribute("autoplay"))}get preload(){let i=this.getAttribute("preload");return i===""?"auto":["none","metadata","auto"].includes(i)?i:super.preload}set preload(i){i!=this.getAttribute("preload")&&(["","none","metadata","auto"].includes(i)?this.setAttribute("preload",i):this.removeAttribute("preload"))}get debug(){return this.getAttribute(C.DEBUG)!=null}set debug(i){i!==this.debug&&(i?this.setAttribute(C.DEBUG,""):this.removeAttribute(C.DEBUG))}get disableTracking(){return this.hasAttribute(C.DISABLE_TRACKING)}set disableTracking(i){i!==this.disableTracking&&this.toggleAttribute(C.DISABLE_TRACKING,!!i)}get disableCookies(){return this.hasAttribute(C.DISABLE_COOKIES)}set disableCookies(i){i!==this.disableCookies&&(i?this.setAttribute(C.DISABLE_COOKIES,""):this.removeAttribute(C.DISABLE_COOKIES))}get startTime(){let i=this.getAttribute(C.START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set startTime(i){i!==this.startTime&&(i==null?this.removeAttribute(C.START_TIME):this.setAttribute(C.START_TIME,`${i}`))}get playbackId(){var i;return this.hasAttribute(C.PLAYBACK_ID)?this.getAttribute(C.PLAYBACK_ID):(i=Xm(this.src))!=null?i:void 0}set playbackId(i){i!==this.playbackId&&(i?this.setAttribute(C.PLAYBACK_ID,i):this.removeAttribute(C.PLAYBACK_ID))}get maxResolution(){var i;return(i=this.getAttribute(C.MAX_RESOLUTION))!=null?i:void 0}set maxResolution(i){i!==this.maxResolution&&(i?this.setAttribute(C.MAX_RESOLUTION,i):this.removeAttribute(C.MAX_RESOLUTION))}get minResolution(){var i;return(i=this.getAttribute(C.MIN_RESOLUTION))!=null?i:void 0}set minResolution(i){i!==this.minResolution&&(i?this.setAttribute(C.MIN_RESOLUTION,i):this.removeAttribute(C.MIN_RESOLUTION))}get renditionOrder(){var i;return(i=this.getAttribute(C.RENDITION_ORDER))!=null?i:void 0}set renditionOrder(i){i!==this.renditionOrder&&(i?this.setAttribute(C.RENDITION_ORDER,i):this.removeAttribute(C.RENDITION_ORDER))}get programStartTime(){let i=this.getAttribute(C.PROGRAM_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programStartTime(i){i==null?this.removeAttribute(C.PROGRAM_START_TIME):this.setAttribute(C.PROGRAM_START_TIME,`${i}`)}get programEndTime(){let i=this.getAttribute(C.PROGRAM_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programEndTime(i){i==null?this.removeAttribute(C.PROGRAM_END_TIME):this.setAttribute(C.PROGRAM_END_TIME,`${i}`)}get assetStartTime(){let i=this.getAttribute(C.ASSET_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetStartTime(i){i==null?this.removeAttribute(C.ASSET_START_TIME):this.setAttribute(C.ASSET_START_TIME,`${i}`)}get assetEndTime(){let i=this.getAttribute(C.ASSET_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetEndTime(i){i==null?this.removeAttribute(C.ASSET_END_TIME):this.setAttribute(C.ASSET_END_TIME,`${i}`)}get customDomain(){var i;return(i=this.getAttribute(C.CUSTOM_DOMAIN))!=null?i:void 0}set customDomain(i){i!==this.customDomain&&(i?this.setAttribute(C.CUSTOM_DOMAIN,i):this.removeAttribute(C.CUSTOM_DOMAIN))}get drmToken(){var i;return(i=this.getAttribute(C.DRM_TOKEN))!=null?i:void 0}set drmToken(i){i!==this.drmToken&&(i?this.setAttribute(C.DRM_TOKEN,i):this.removeAttribute(C.DRM_TOKEN))}get playbackToken(){var i,e,t,r;if(this.hasAttribute(C.PLAYBACK_TOKEN))return(i=this.getAttribute(C.PLAYBACK_TOKEN))!=null?i:void 0;if(this.hasAttribute(C.PLAYBACK_ID)){let[,s]=Xd((e=this.playbackId)!=null?e:"");return(t=new URLSearchParams(s).get("token"))!=null?t:void 0}if(this.src)return(r=new URLSearchParams(this.src).get("token"))!=null?r:void 0}set playbackToken(i){i!==this.playbackToken&&(i?this.setAttribute(C.PLAYBACK_TOKEN,i):this.removeAttribute(C.PLAYBACK_TOKEN))}get tokens(){let i=this.getAttribute(C.PLAYBACK_TOKEN),e=this.getAttribute(C.DRM_TOKEN);return{...I(this,ou),...i!=null?{playback:i}:{},...e!=null?{drm:e}:{}}}set tokens(i){Q(this,ou,i!=null?i:{})}get ended(){return Jm(this.nativeEl,this._hls)}get envKey(){var i;return(i=this.getAttribute(C.ENV_KEY))!=null?i:void 0}set envKey(i){i!==this.envKey&&(i?this.setAttribute(C.ENV_KEY,i):this.removeAttribute(C.ENV_KEY))}get beaconCollectionDomain(){var i;return(i=this.getAttribute(C.BEACON_COLLECTION_DOMAIN))!=null?i:void 0}set beaconCollectionDomain(i){i!==this.beaconCollectionDomain&&(i?this.setAttribute(C.BEACON_COLLECTION_DOMAIN,i):this.removeAttribute(C.BEACON_COLLECTION_DOMAIN))}get streamType(){var i;return(i=this.getAttribute(C.STREAM_TYPE))!=null?i:zd(this.nativeEl)}set streamType(i){i!==this.streamType&&(i?this.setAttribute(C.STREAM_TYPE,i):this.removeAttribute(C.STREAM_TYPE))}get targetLiveWindow(){return this.hasAttribute(C.TARGET_LIVE_WINDOW)?+this.getAttribute(C.TARGET_LIVE_WINDOW):By(this.nativeEl)}set targetLiveWindow(i){i!=this.targetLiveWindow&&(i==null?this.removeAttribute(C.TARGET_LIVE_WINDOW):this.setAttribute(C.TARGET_LIVE_WINDOW,`${+i}`))}get liveEdgeStart(){var i,e;if(this.hasAttribute(C.LIVE_EDGE_OFFSET)){let{liveEdgeOffset:t}=this,r=(i=this.nativeEl.seekable.end(0))!=null?i:0,s=(e=this.nativeEl.seekable.start(0))!=null?e:0;return Math.max(s,r-t)}return $y(this.nativeEl)}get liveEdgeOffset(){if(this.hasAttribute(C.LIVE_EDGE_OFFSET))return+this.getAttribute(C.LIVE_EDGE_OFFSET)}set liveEdgeOffset(i){i!=this.liveEdgeOffset&&(i==null?this.removeAttribute(C.LIVE_EDGE_OFFSET):this.setAttribute(C.LIVE_EDGE_OFFSET,`${+i}`))}get seekable(){return tu(this.nativeEl)}async addCuePoints(i){return Wm(this.nativeEl,i)}get activeCuePoint(){return Ym(this.nativeEl)}get cuePoints(){return wy(this.nativeEl)}async addChapters(i){return jm(this.nativeEl,i)}get activeChapter(){return zm(this.nativeEl)}get chapters(){return My(this.nativeEl)}getStartDate(){return Py(this.nativeEl,this._hls)}get currentPdt(){return Oy(this.nativeEl,this._hls)}get preferPlayback(){let i=this.getAttribute(C.PREFER_PLAYBACK);if(i===qt.MSE||i===qt.NATIVE)return i}set preferPlayback(i){i!==this.preferPlayback&&(i===qt.MSE||i===qt.NATIVE?this.setAttribute(C.PREFER_PLAYBACK,i):this.removeAttribute(C.PREFER_PLAYBACK))}get metadata(){return{...this.getAttributeNames().filter(i=>i.startsWith("metadata-")&&![C.METADATA_URL].includes(i)).reduce((i,e)=>{let t=this.getAttribute(e);return t!=null&&(i[e.replace(/^metadata-/,"").replace(/-/g,"_")]=t),i},{}),...I(this,Qa)}}set metadata(i){Q(this,Qa,i!=null?i:{}),this.mux&&this.mux.emit("hb",I(this,Qa))}get _hlsConfig(){return I(this,lu)}set _hlsConfig(i){Q(this,lu,i)}load(){Q(this,Pi,Ky(this,this.nativeEl,I(this,Pi)))}unload(){ep(this.nativeEl,I(this,Pi)),Q(this,Pi,void 0)}attributeChangedCallback(i,e,t){var r,s;switch(rp.observedAttributes.includes(i)&&!["src","autoplay","preload"].includes(i)&&super.attributeChangedCallback(i,e,t),i){case C.PLAYER_SOFTWARE_NAME:this.playerSoftwareName=t!=null?t:void 0;break;case C.PLAYER_SOFTWARE_VERSION:this.playerSoftwareVersion=t!=null?t:void 0;break;case"src":{let n=!!e,a=!!t;!n&&a?Ne(this,Za,hu).call(this):n&&!a?this.unload():n&&a&&(this.unload(),Ne(this,Za,hu).call(this));break}case"autoplay":if(t===e)break;(r=I(this,Pi))==null||r.setAutoplay(this.autoplay);break;case"preload":if(t===e)break;(s=I(this,Pi))==null||s.setPreload(t);break;case C.PLAYBACK_ID:this.src=Ka(this);break;case C.DEBUG:{let n=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=n);break}case C.METADATA_URL:t&&fetch(t).then(n=>n.json()).then(n=>this.metadata=n).catch(()=>console.error(`Unable to load or parse metadata JSON from metadata-url ${t}!`));break;case C.STREAM_TYPE:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("streamtypechange",{composed:!0,bubbles:!0}));break;case C.TARGET_LIVE_WINDOW:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("targetlivewindowchange",{composed:!0,bubbles:!0,detail:this.targetLiveWindow}));break;default:break}}connectedCallback(){var i;(i=super.connectedCallback)==null||i.call(this),this.nativeEl&&this.src&&!I(this,Pi)&&Ne(this,Za,hu).call(this)}disconnectedCallback(){this.unload()}};Pi=new WeakMap,Xa=new WeakMap,au=new WeakMap,Qa=new WeakMap,ou=new WeakMap,lu=new WeakMap,du=new WeakMap,uu=new WeakMap,cu=new WeakMap,Za=new WeakSet,hu=async function(){I(this,Xa)||(await Q(this,Xa,Promise.resolve()),Q(this,Xa,null),this.load())};var fu,Ep=class extends NC(jC(ZC)){constructor(){super(...arguments),ie(this,fu)}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 i;return(i=I(this,fu))!=null?i:this.muxCastCustomData}set castCustomData(i){Q(this,fu,i)}};fu=new WeakMap;ip.customElements.get("mux-video")||(ip.customElements.define("mux-video",Ep),ip.MuxVideoElement=Ep);var pT=Ep;function gT(i){let e="";return Object.entries(i).forEach(([t,r])=>{r!=null&&(e+=`${bu(t)}: ${r}; `)}),e?e.trim():void 0}function bu(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function yu(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Rt(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function Ap(i){let e=JC(i).toString();return e?"?"+e:""}function JC(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var Sp=(i,e)=>!i||!e?!1:i.contains(e)?!0:Sp(i,e.getRootNode().host);var vT="mux.com",ew=()=>{try{return"3.2.4"}catch{}return"UNKNOWN"},tw=ew(),_u=()=>tw,ET=(i,{token:e,customDomain:t=vT,thumbnailTime:r,programTime:s}={})=>{var o;let n=e==null?r:void 0,{aud:a}=(o=Ar(e))!=null?o:{};if(!(e&&a!=="t"))return`https://image.${t}/${i}/thumbnail.webp${Ap({token:e,time:n,program_time:s})}`},bT=(i,{token:e,customDomain:t=vT,programStartTime:r,programEndTime:s}={})=>{var a;let{aud:n}=(a=Ar(e))!=null?a:{};if(!(e&&n!=="s"))return`https://image.${t}/${i}/storyboard.vtt${Ap({token:e,format:"webp",program_start_time:r,program_end_time:s})}`},Ja=i=>{if(i){if([Re.LIVE,Re.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return Re.LIVE}};var iw={crossorigin:"crossOrigin",playsinline:"playsInline"};function yT(i){var e;return(e=iw[i])!=null?e:yu(i)}var As,Ss,It,Tu=class{constructor(e,t){kt(this,As);kt(this,Ss);kt(this,It,[]);$t(this,As,e),$t(this,Ss,t)}[Symbol.iterator](){return _e(this,It).values()}get length(){return _e(this,It).length}get value(){var e;return(e=_e(this,It).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&($t(this,It,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return _e(this,It)[e]}values(){return _e(this,It).values()}keys(){return _e(this,It).keys()}forEach(e){_e(this,It).forEach(e)}add(...e){var t,r;e.forEach(s=>{this.contains(s)||_e(this,It).push(s)}),!(this.value===""&&!((t=_e(this,As))!=null&&t.hasAttribute(`${_e(this,Ss)}`)))&&((r=_e(this,As))==null||r.setAttribute(`${_e(this,Ss)}`,`${this.value}`))}remove(...e){var t;e.forEach(r=>{_e(this,It).splice(_e(this,It).indexOf(r),1)}),(t=_e(this,As))==null||t.setAttribute(`${_e(this,Ss)}`,`${this.value}`)}contains(e){return _e(this,It).includes(e)}toggle(e,t){return typeof t!="undefined"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){this.remove(e),this.add(t)}};As=new WeakMap,Ss=new WeakMap,It=new WeakMap;var TT=`[mux-player ${_u()}]`;function Oi(...i){console.warn(TT,...i)}function Ut(...i){console.error(TT,...i)}function xp(i){var t;let e=(t=i.message)!=null?t:"";i.context&&(e+=` ${i.context}`),i.file&&(e+=` ${j("Read more: ")}
|
|
1317
1317
|
https://github.com/muxinc/elements/blob/main/errors/${i.file}`),Oi(e)}var At={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},xs={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},AT=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),rw=gu.filter(i=>i!=="error"),sw=Object.values(At).filter(i=>![At.PLAYSINLINE].includes(i)),nw=Object.values(xs),Rp=class extends Ct.HTMLElement{static get observedAttributes(){return[...sw,...nw]}constructor(){super()}init(){rw.forEach(e=>{var t;(t=this.media)==null||t.addEventListener(e,r=>{this.dispatchEvent(new Event(r.type))})})}attributeChangedCallback(e,t,r){var s,n;switch(e){case xs.MUTED:{this.media&&(this.media.muted=r!=null,this.media.defaultMuted=r!=null);return}case xs.VOLUME:{let a=(s=Rt(r))!=null?s:1;this.media&&(this.media.volume=a);return}case xs.PLAYBACKRATE:{let a=(n=Rt(r))!=null?n:1;this.media&&(this.media.playbackRate=a,this.media.defaultPlaybackRate=a);return}}}play(){var e,t;return(t=(e=this.media)==null?void 0:e.play())!=null?t:Promise.reject()}pause(){var e;(e=this.media)==null||e.pause()}load(){var e;(e=this.media)==null||e.load()}requestCast(e){var t;return(t=this.media)==null?void 0:t.requestCast(e)}get media(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("mux-video")}get audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var e,t;return(t=(e=this.media)==null?void 0:e.paused)!=null?t:!0}get duration(){var e,t;return(t=(e=this.media)==null?void 0:e.duration)!=null?t:NaN}get ended(){var e,t;return(t=(e=this.media)==null?void 0:e.ended)!=null?t:!1}get buffered(){var e,t;return(t=(e=this.media)==null?void 0:e.buffered)!=null?t:AT}get seekable(){var e,t;return(t=(e=this.media)==null?void 0:e.seekable)!=null?t:AT}get readyState(){var e,t;return(t=(e=this.media)==null?void 0:e.readyState)!=null?t:0}get videoWidth(){var e,t;return(t=(e=this.media)==null?void 0:e.videoWidth)!=null?t:0}get videoHeight(){var e,t;return(t=(e=this.media)==null?void 0:e.videoHeight)!=null?t:0}get currentSrc(){var e,t;return(t=(e=this.media)==null?void 0:e.currentSrc)!=null?t:""}get currentTime(){var e,t;return(t=(e=this.media)==null?void 0:e.currentTime)!=null?t:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,t;return(t=(e=this.media)==null?void 0:e.volume)!=null?t:1}set volume(e){this.media&&(this.media.volume=Number(e))}get playbackRate(){var e,t;return(t=(e=this.media)==null?void 0:e.playbackRate)!=null?t:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get defaultPlaybackRate(){var e;return(e=Rt(this.getAttribute(xs.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(xs.PLAYBACKRATE,`${e}`):this.removeAttribute(xs.PLAYBACKRATE)}get crossOrigin(){return eo(this,At.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(At.CROSSORIGIN,`${e}`)}get autoplay(){return eo(this,At.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(At.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(At.AUTOPLAY)}get loop(){return eo(this,At.LOOP)!=null}set loop(e){e?this.setAttribute(At.LOOP,""):this.removeAttribute(At.LOOP)}get muted(){var e,t;return(t=(e=this.media)==null?void 0:e.muted)!=null?t:!1}set muted(e){this.media&&(this.media.muted=!!e)}get defaultMuted(){return eo(this,At.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(At.MUTED,""):this.removeAttribute(At.MUTED)}get playsInline(){return eo(this,At.PLAYSINLINE)!=null}set playsInline(e){Ut("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(e){["","none","metadata","auto"].includes(e)?this.setAttribute(At.PRELOAD,e):this.removeAttribute(At.PRELOAD)}};function eo(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var Ip=Rp;var LT=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},de=(i,e,t)=>(LT(i,e,"read from private field"),t?t.call(i):e.get(i)),Ni=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},tr=(i,e,t,r)=>(LT(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Mn,Au,Rs,to,Rr,Ir,Lr,Is,Pn,Su,ci,ST=1,xT=0,aw=1,ow={processCallback(i,e,t){if(t){for(let[r,s]of e)if(r in t){let n=t[r];typeof n=="boolean"&&s instanceof Lt&&typeof s.element[s.attributeName]=="boolean"?s.booleanValue=n:typeof n=="function"&&s instanceof Lt?s.element[s.attributeName]=n:s.value=n}}}},ir=class extends R.DocumentFragment{constructor(e,t,r=ow){var s;super(),Ni(this,Mn,void 0),Ni(this,Au,void 0),this.append(e.content.cloneNode(!0)),tr(this,Mn,kT(this)),tr(this,Au,r),(s=r.createCallback)==null||s.call(r,this,de(this,Mn),t),r.processCallback(this,de(this,Mn),t)}update(e){de(this,Au).processCallback(this,de(this,Mn),e)}};Mn=new WeakMap;Au=new WeakMap;var kT=(i,e=[])=>{let t,r;for(let s of i.attributes||[])if(s.value.includes("{{")){let n=new Lp;for([t,r]of IT(s.value))if(!t)n.append(r);else{let a=new Lt(i,s.name,s.namespaceURI);n.append(a),e.push([r,a])}s.value=n.toString()}for(let s of i.childNodes)if(s.nodeType===ST&&!(s instanceof HTMLTemplateElement))kT(s,e);else{let n=s.data;if(s.nodeType===ST||n.includes("{{")){let a=[];if(n)for([t,r]of IT(n))if(!t)a.push(new Text(r));else{let o=new rr(i);a.push(o),e.push([r,o])}else if(s instanceof HTMLTemplateElement){let o=new io(i,s);a.push(o),e.push([o.expression,o])}s.replaceWith(...a.flatMap(o=>o.replacementNodes||[o]))}}return e},RT={},IT=i=>{let e="",t=0,r=RT[i],s=0,n;if(r)return r;for(r=[];n=i[s];s++)n==="{"&&i[s+1]==="{"&&i[s-1]!=="\\"&&i[s+2]&&++t==1?(e&&r.push([xT,e]),e="",s++):n==="}"&&i[s+1]==="}"&&i[s-1]!=="\\"&&!--t?(r.push([aw,e.trim()]),e="",s++):e+=n||"";return e&&r.push([xT,(t>0?"{{":"")+e]),RT[i]=r},lw=11,xu=class{get value(){return""}set value(e){}toString(){return this.value}},CT=new WeakMap,Lp=class{constructor(){Ni(this,Rs,[])}[Symbol.iterator](){return de(this,Rs).values()}get length(){return de(this,Rs).length}item(e){return de(this,Rs)[e]}append(...e){for(let t of e)t instanceof Lt&&CT.set(t,this),de(this,Rs).push(t)}toString(){return de(this,Rs).join("")}};Rs=new WeakMap;var Lt=class extends xu{constructor(e,t,r){super(),Ni(this,Is),Ni(this,to,""),Ni(this,Rr,void 0),Ni(this,Ir,void 0),Ni(this,Lr,void 0),tr(this,Rr,e),tr(this,Ir,t),tr(this,Lr,r)}get attributeName(){return de(this,Ir)}get attributeNamespace(){return de(this,Lr)}get element(){return de(this,Rr)}get value(){return de(this,to)}set value(e){de(this,to)!==e&&(tr(this,to,e),!de(this,Is,Pn)||de(this,Is,Pn).length===1?e==null?de(this,Rr).removeAttributeNS(de(this,Lr),de(this,Ir)):de(this,Rr).setAttributeNS(de(this,Lr),de(this,Ir),e):de(this,Rr).setAttributeNS(de(this,Lr),de(this,Ir),de(this,Is,Pn).toString()))}get booleanValue(){return de(this,Rr).hasAttributeNS(de(this,Lr),de(this,Ir))}set booleanValue(e){if(!de(this,Is,Pn)||de(this,Is,Pn).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};to=new WeakMap;Rr=new WeakMap;Ir=new WeakMap;Lr=new WeakMap;Is=new WeakSet;Pn=function(){return CT.get(this)};var rr=class extends xu{constructor(e,t){super(),Ni(this,Su,void 0),Ni(this,ci,void 0),tr(this,Su,e),tr(this,ci,t?[...t]:[new Text])}get replacementNodes(){return de(this,ci)}get parentNode(){return de(this,Su)}get nextSibling(){return de(this,ci)[de(this,ci).length-1].nextSibling}get previousSibling(){return de(this,ci)[0].previousSibling}get value(){return de(this,ci).map(e=>e.textContent).join("")}set value(e){this.replace(e)}replace(...e){let t=e.flat().flatMap(r=>r==null?[new Text]:r.forEach?[...r]:r.nodeType===lw?[...r.childNodes]:r.nodeType?[r]:[new Text(r)]);t.length||t.push(new Text),tr(this,ci,dw(de(this,ci)[0].parentNode,de(this,ci),t,this.nextSibling))}};Su=new WeakMap;ci=new WeakMap;var io=class extends rr{constructor(e,t){let r=t.getAttribute("directive")||t.getAttribute("type"),s=t.getAttribute("expression")||t.getAttribute(r)||"";s.startsWith("{{")&&(s=s.trim().slice(2,-2).trim()),super(e),this.expression=s,this.template=t,this.directive=r}};function dw(i,e,t,r=null){let s=0,n,a,o,l=t.length,d=e.length;for(;s<l&&s<d&&e[s]==t[s];)s++;for(;s<l&&s<d&&t[l-1]==e[d-1];)r=t[--d,--l];if(s==d)for(;s<l;)i.insertBefore(t[s++],r);if(s==l)for(;s<d;)i.removeChild(e[s++]);else{for(n=e[s];s<l;)o=t[s++],a=n?n.nextSibling:r,n==o?n=a:s<l&&t[s]==a?(i.replaceChild(o,n),n=a):i.insertBefore(o,n);for(;n!=r;)a=n.nextSibling,i.removeChild(n),n=a}return t}var wT={string:i=>String(i)},Iu=class{constructor(e){this.template=e,this.state=void 0}},Ls=new WeakMap,ks=new WeakMap,kp={partial:(i,e)=>{e[i.expression]=new Iu(i.template)},if:(i,e)=>{var t;if(MT(i.expression,e))if(Ls.get(i)!==i.template){Ls.set(i,i.template);let r=new ir(i.template,e,Lu);i.replace(r),ks.set(i,r)}else(t=ks.get(i))==null||t.update(e);else i.replace(""),Ls.delete(i),ks.delete(i)}},uw=Object.keys(kp),Lu={processCallback(i,e,t){var r,s;if(t)for(let[n,a]of e){if(a instanceof io){if(!a.directive){let l=uw.find(d=>a.template.hasAttribute(d));l&&(a.directive=l,a.expression=a.template.getAttribute(l))}(r=kp[a.directive])==null||r.call(kp,a,t);continue}let o=MT(n,t);if(o instanceof Iu){Ls.get(a)!==o.template?(Ls.set(a,o.template),o=new ir(o.template,o.state,Lu),a.value=o,ks.set(a,o)):(s=ks.get(a))==null||s.update(o.state);continue}o?(a instanceof Lt&&a.attributeName.startsWith("aria-")&&(o=String(o)),a instanceof Lt?typeof o=="boolean"?a.booleanValue=o:typeof o=="function"?a.element[a.attributeName]=o:a.value=o:(a.value=o,Ls.delete(a),ks.delete(a))):a instanceof Lt?a.value=void 0:(a.value=void 0,Ls.delete(a),ks.delete(a))}}},DT={"!":i=>!i,"!!":i=>!!i,"==":(i,e)=>i==e,"!=":(i,e)=>i!=e,">":(i,e)=>i>e,">=":(i,e)=>i>=e,"<":(i,e)=>i<e,"<=":(i,e)=>i<=e,"??":(i,e)=>i!=null?i:e,"|":(i,e)=>{var t;return(t=wT[e])==null?void 0:t.call(wT,i)}};function cw(i){return hw(i,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function MT(i,e={}){var t,r,s,n,a,o,l;let d=cw(i);if(d.length===0||d.some(({type:u})=>!u))return ro(i);if(((t=d[0])==null?void 0:t.token)===">"){let u=e[(r=d[1])==null?void 0:r.token];if(!u)return ro(i);let c={...e};u.state=c;let h=d.slice(2);for(let f=0;f<h.length;f+=3){let m=(s=h[f])==null?void 0:s.token,p=(n=h[f+1])==null?void 0:n.token,g=(a=h[f+2])==null?void 0:a.token;m&&p==="="&&(c[m]=so(g,e))}return u}if(d.length===1)return Ru(d[0])?so(d[0].token,e):ro(i);if(d.length===2){let u=(o=d[0])==null?void 0:o.token,c=DT[u];if(!c||!Ru(d[1]))return ro(i);let h=so(d[1].token,e);return c(h)}if(d.length===3){let u=(l=d[1])==null?void 0:l.token,c=DT[u];if(!c||!Ru(d[0])||!Ru(d[2]))return ro(i);let h=so(d[0].token,e);if(u==="|")return c(h,d[2].token);let f=so(d[2].token,e);return c(h,f)}}function ro(i){return console.warn(`Warning: invalid expression \`${i}\``),!1}function Ru({type:i}){return["number","boolean","string","param"].includes(i)}function so(i,e){let t=i[0],r=i.slice(-1);return i==="true"||i==="false"?i==="true":t===r&&["'",'"'].includes(t)?i.slice(1,-1):Do(i)?parseFloat(i):e[i]}function hw(i,e){let t,r,s,n=[];for(;i;){s=null,t=i.length;for(let a in e)r=e[a].exec(i),r&&r.index<t&&(s={token:r[0],type:a,matches:r.slice(1)},t=r.index);t&&n.push({token:i.substr(0,t),type:void 0}),s&&n.push(s),i=i.substr(t+(s?s.token.length:0))}return n}var Op=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Dp=(i,e,t)=>(Op(i,e,"read from private field"),t?t.call(i):e.get(i)),no=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Cs=(i,e,t,r)=>(Op(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Cp=(i,e,t)=>(Op(i,e,"access private method"),t),On,ku,Nn,Mp,PT,Cu,Pp,wp={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},OT=F.createElement("template");OT.innerHTML=`
|
|
1318
1318
|
<style>
|
|
1319
1319
|
:host {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mux/mux-player",
|
|
3
|
-
"version": "3.2.4
|
|
3
|
+
"version": "3.2.4",
|
|
4
4
|
"description": "An open source Mux player web component that Just Works™",
|
|
5
5
|
"homepage": "https://mux.com/player",
|
|
6
6
|
"keywords": [
|
|
@@ -93,8 +93,8 @@
|
|
|
93
93
|
"build": "npm-run-all --parallel 'build:esm --minify' 'build:iife --minify' 'build:cjs --minify' 'build:esm-module --minify' 'build:themes'"
|
|
94
94
|
},
|
|
95
95
|
"dependencies": {
|
|
96
|
-
"@mux/mux-video": "0.24.
|
|
97
|
-
"@mux/playback-core": "0.28.
|
|
96
|
+
"@mux/mux-video": "0.24.2",
|
|
97
|
+
"@mux/playback-core": "0.28.2",
|
|
98
98
|
"media-chrome": "~4.3.0",
|
|
99
99
|
"player.style": "^0.1.1"
|
|
100
100
|
},
|