@mux/mux-player 3.4.2-canary.9 → 3.5.0

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/base.cjs.js CHANGED
@@ -1271,7 +1271,7 @@
1271
1271
 
1272
1272
  </slot>
1273
1273
  </div>
1274
- `}var jo=(t,e=t.mediaCurrentTime)=>{let i=Number.isFinite(t.mediaSeekableStart)?t.mediaSeekableStart:0,a=Number.isFinite(t.mediaDuration)?t.mediaDuration:t.mediaSeekableEnd;if(Number.isNaN(a))return 0;let r=(e-i)/(a-i);return Math.max(0,Math.min(r,1))},hc=(t,e=t.range.valueAsNumber)=>{let i=Number.isFinite(t.mediaSeekableStart)?t.mediaSeekableStart:0,a=Number.isFinite(t.mediaDuration)?t.mediaDuration:t.mediaSeekableEnd;return Number.isNaN(a)?0:e*(a-i)+i},dr=class extends Fe{constructor(){super(),re(this,qi),re(this,Js),re(this,rn),re(this,on),re(this,nn),re(this,zs),re(this,lr),re(this,Qs),re(this,Gi,void 0),re(this,ii,void 0),re(this,tn,void 0),re(this,or,void 0),re(this,an,void 0),re(this,en,void 0),re(this,nr,void 0),re(this,sr,void 0),re(this,Yi,void 0),re(this,Zs,a=>{this.dragging||(Ai(a)&&(this.range.valueAsNumber=a),this.updateBar())}),this.shadowRoot.querySelector("#track").insertAdjacentHTML("afterbegin",'<div id="buffered" part="buffered"></div>'),ze(this,tn,this.shadowRoot.querySelectorAll('[part~="box"]')),ze(this,an,this.shadowRoot.querySelector('[part~="preview-box"]')),ze(this,en,this.shadowRoot.querySelector('[part~="current-box"]'));let i=getComputedStyle(this);ze(this,nr,parseInt(i.getPropertyValue("--media-box-padding-left"))),ze(this,sr,parseInt(i.getPropertyValue("--media-box-padding-right"))),ze(this,ii,new Jo(this.range,ee(this,Zs),60))}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PAUSED,n.MEDIA_DURATION,n.MEDIA_SEEKABLE,n.MEDIA_CURRENT_TIME,n.MEDIA_PREVIEW_IMAGE,n.MEDIA_PREVIEW_TIME,n.MEDIA_PREVIEW_CHAPTER,n.MEDIA_BUFFERED,n.MEDIA_PLAYBACK_RATE,n.MEDIA_LOADING,n.MEDIA_ENDED]}connectedCallback(){var e;super.connectedCallback(),this.range.setAttribute("aria-label",h("seek")),le(this,qi,rr).call(this),ze(this,Gi,this.getRootNode()),(e=ee(this,Gi))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),le(this,qi,rr).call(this),(e=ee(this,Gi))==null||e.removeEventListener("transitionstart",this),ze(this,Gi,null)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),i!=a&&(e===n.MEDIA_CURRENT_TIME||e===n.MEDIA_PAUSED||e===n.MEDIA_ENDED||e===n.MEDIA_LOADING||e===n.MEDIA_DURATION||e===n.MEDIA_SEEKABLE?(ee(this,ii).update({start:jo(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),le(this,qi,rr).call(this),Jp(this)):e===n.MEDIA_BUFFERED&&this.updateBufferedBar(),(e===n.MEDIA_DURATION||e===n.MEDIA_SEEKABLE)&&(this.mediaChaptersCues=ee(this,Yi),this.updateBar()))}get mediaChaptersCues(){return ee(this,Yi)}set mediaChaptersCues(e){var i;ze(this,Yi,e),this.updateSegments((i=ee(this,Yi))==null?void 0:i.map(a=>({start:jo(this,a.startTime),end:jo(this,a.endTime)})))}get mediaPaused(){return k(this,n.MEDIA_PAUSED)}set mediaPaused(e){S(this,n.MEDIA_PAUSED,e)}get mediaLoading(){return k(this,n.MEDIA_LOADING)}set mediaLoading(e){S(this,n.MEDIA_LOADING,e)}get mediaDuration(){return R(this,n.MEDIA_DURATION)}set mediaDuration(e){O(this,n.MEDIA_DURATION,e)}get mediaCurrentTime(){return R(this,n.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){O(this,n.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return R(this,n.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){O(this,n.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){let e=this.getAttribute(n.MEDIA_BUFFERED);return e?e.split(" ").map(i=>i.split(":").map(a=>+a)):[]}set mediaBuffered(e){if(!e){this.removeAttribute(n.MEDIA_BUFFERED);return}let i=e.map(a=>a.join(":")).join(" ");this.setAttribute(n.MEDIA_BUFFERED,i)}get mediaSeekable(){let e=this.getAttribute(n.MEDIA_SEEKABLE);if(e)return e.split(":").map(i=>+i)}set mediaSeekable(e){if(e==null){this.removeAttribute(n.MEDIA_SEEKABLE);return}this.setAttribute(n.MEDIA_SEEKABLE,e.join(":"))}get mediaSeekableEnd(){var e;let[,i=this.mediaDuration]=(e=this.mediaSeekable)!=null?e:[];return i}get mediaSeekableStart(){var e;let[i=0]=(e=this.mediaSeekable)!=null?e:[];return i}get mediaPreviewImage(){return I(this,n.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){M(this,n.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return R(this,n.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){O(this,n.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return k(this,n.MEDIA_ENDED)}set mediaEnded(e){S(this,n.MEDIA_ENDED,e)}updateBar(){super.updateBar(),this.updateBufferedBar(),this.updateCurrentBox()}updateBufferedBar(){var e;let i=this.mediaBuffered;if(!i.length)return;let a;if(this.mediaEnded)a=1;else{let o=this.mediaCurrentTime,[,s=this.mediaSeekableStart]=(e=i.find(([l,u])=>l<=o&&o<=u))!=null?e:[];a=jo(this,s)}let{style:r}=W(this.shadowRoot,"#buffered");r.setProperty("width",`${a*100}%`)}updateCurrentBox(){if(!this.shadowRoot.querySelector('slot[name="current"]').assignedElements().length)return;let i=W(this.shadowRoot,"#current-rail"),a=W(this.shadowRoot,'[part~="current-box"]'),r=le(this,rn,js).call(this,ee(this,en)),o=le(this,on,el).call(this,r,this.range.valueAsNumber),s=le(this,nn,tl).call(this,r,this.range.valueAsNumber);i.style.transform=`translateX(${o})`,i.style.setProperty("--_range-width",`${r.range.width}`),a.style.setProperty("--_box-shift",`${s}`),a.style.setProperty("--_box-width",`${r.box.width}px`),a.style.setProperty("visibility","initial")}handleEvent(e){switch(super.handleEvent(e),e.type){case"input":le(this,Qs,mc).call(this);break;case"pointermove":le(this,zs,cc).call(this,e);break;case"pointerup":case"pointerleave":le(this,lr,sn).call(this,null);break;case"transitionstart":de(e.target,this)&&setTimeout(()=>le(this,qi,rr).call(this),0);break}}};Gi=new WeakMap;ii=new WeakMap;tn=new WeakMap;or=new WeakMap;an=new WeakMap;en=new WeakMap;nr=new WeakMap;sr=new WeakMap;Yi=new WeakMap;qi=new WeakSet;rr=function(){le(this,Js,uc).call(this)?ee(this,ii).start():ee(this,ii).stop()};Js=new WeakSet;uc=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&zr(this)};Zs=new WeakMap;rn=new WeakSet;js=function(t){var e;let a=((e=this.getAttribute("bounds")?He(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?e:this).getBoundingClientRect(),r=this.range.getBoundingClientRect(),o=t.offsetWidth,s=-(r.left-a.left-o/2),l=a.right-r.left-o/2;return{box:{width:o,min:s,max:l},bounds:a,range:r}};on=new WeakSet;el=function(t,e){let i=`${e*100}%`,{width:a,min:r,max:o}=t.box;if(!a)return i;if(Number.isNaN(r)||(i=`max(${`calc(1 / var(--_range-width) * 100 * ${r}% + var(--media-box-padding-left))`}, ${i})`),!Number.isNaN(o)){let l=`calc(1 / var(--_range-width) * 100 * ${o}% - var(--media-box-padding-right))`;i=`min(${i}, ${l})`}return i};nn=new WeakSet;tl=function(t,e){let{width:i,min:a,max:r}=t.box,o=e*t.range.width;if(o<a+ee(this,nr)){let s=t.range.left-t.bounds.left-ee(this,nr);return`${o-i/2+s}px`}if(o>r-ee(this,sr)){let s=t.bounds.right-t.range.right-ee(this,sr);return`${o+i/2-s-t.range.width}px`}return 0};zs=new WeakSet;cc=function(t){let e=[...ee(this,tn)].some(_=>t.composedPath().includes(_));if(!this.dragging&&(e||!t.composedPath().includes(this))){le(this,lr,sn).call(this,null);return}let i=this.mediaSeekableEnd;if(!i)return;let a=W(this.shadowRoot,"#preview-rail"),r=W(this.shadowRoot,'[part~="preview-box"]'),o=le(this,rn,js).call(this,ee(this,an)),s=(t.clientX-o.range.left)/o.range.width;s=Math.max(0,Math.min(1,s));let l=le(this,on,el).call(this,o,s),u=le(this,nn,tl).call(this,o,s);a.style.transform=`translateX(${l})`,a.style.setProperty("--_range-width",`${o.range.width}`),r.style.setProperty("--_box-shift",`${u}`),r.style.setProperty("--_box-width",`${o.box.width}px`);let m=Math.round(ee(this,or))-Math.round(s*i);Math.abs(m)<1&&s>.01&&s<.99||(ze(this,or,s*i),le(this,lr,sn).call(this,ee(this,or)))};lr=new WeakSet;sn=function(t){this.dispatchEvent(new d.CustomEvent(p.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:t}))};Qs=new WeakSet;mc=function(){ee(this,ii).stop();let t=hc(this);this.dispatchEvent(new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:t}))};dr.shadowRootOptions={mode:"open"};dr.getTemplateHTML=jp;d.customElements.get("media-time-range")||d.customElements.define("media-time-range",dr);var ef=1,tf=t=>t.mediaMuted?0:t.mediaVolume,af=t=>`${Math.round(t*100)}%`,il=class extends Fe{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_VOLUME,n.MEDIA_MUTED,n.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",h("volume"))}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),(e===n.MEDIA_VOLUME||e===n.MEDIA_MUTED)&&(this.range.valueAsNumber=tf(this),this.range.setAttribute("aria-valuetext",af(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return R(this,n.MEDIA_VOLUME,ef)}set mediaVolume(e){O(this,n.MEDIA_VOLUME,e)}get mediaMuted(){return k(this,n.MEDIA_MUTED)}set mediaMuted(e){S(this,n.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return I(this,n.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){M(this,n.MEDIA_VOLUME_UNAVAILABLE,e)}};d.customElements.get("media-volume-range")||d.customElements.define("media-volume-range",il);var b=require("@mux/mux-video/base"),w=require("@mux/playback-core");var gc=require("@mux/playback-core");var oi=require("@mux/playback-core");function pc(t){let e="";return Object.entries(t).forEach(([i,a])=>{a!=null&&(e+=`${ln(i)}: ${a}; `)}),e?e.trim():void 0}function ln(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function dn(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function ue(t){if(t==null)return;let e=+t;return Number.isNaN(e)?void 0:e}function al(t){let e=rf(t).toString();return e?"?"+e:""}function rf(t){let e={};for(let i in t)t[i]!=null&&(e[i]=t[i]);return new URLSearchParams(e)}var rl=(t,e)=>!t||!e?!1:t.contains(e)?!0:rl(t,e.getRootNode().host);var fc="mux.com",of=()=>{try{return"3.4.1"}catch{}return"UNKNOWN"},nf=of(),cn=()=>nf,vc=(t,{token:e,customDomain:i=fc,thumbnailTime:a,programTime:r}={})=>{var l;let o=e==null?a:void 0,{aud:s}=(l=(0,oi.parseJwt)(e))!=null?l:{};if(!(e&&s!=="t"))return`https://image.${i}/${t}/thumbnail.webp${al({token:e,time:o,program_time:r})}`},Ec=(t,{token:e,customDomain:i=fc,programStartTime:a,programEndTime:r}={})=>{var s;let{aud:o}=(s=(0,oi.parseJwt)(e))!=null?s:{};if(!(e&&o!=="s"))return`https://image.${i}/${t}/storyboard.vtt${al({token:e,format:"webp",program_start_time:a,program_end_time:r})}`},ur=t=>{if(t){if([oi.StreamTypes.LIVE,oi.StreamTypes.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return oi.StreamTypes.LIVE}};var sf={crossorigin:"crossOrigin",playsinline:"playsInline"};function bc(t){var e;return(e=sf[t])!=null?e:dn(t)}var ai,ri,ce,un=class{constructor(e,i){he(this,ai);he(this,ri);he(this,ce,[]);Te(this,ai,e),Te(this,ri,i)}[Symbol.iterator](){return U(this,ce).values()}get length(){return U(this,ce).length}get value(){var e;return(e=U(this,ce).join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(Te(this,ce,[]),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return U(this,ce)[e]}values(){return U(this,ce).values()}keys(){return U(this,ce).keys()}forEach(e){U(this,ce).forEach(e)}add(...e){var i,a;e.forEach(r=>{this.contains(r)||U(this,ce).push(r)}),!(this.value===""&&!((i=U(this,ai))!=null&&i.hasAttribute(`${U(this,ri)}`)))&&((a=U(this,ai))==null||a.setAttribute(`${U(this,ri)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>{U(this,ce).splice(U(this,ce).indexOf(a),1)}),(i=U(this,ai))==null||i.setAttribute(`${U(this,ri)}`,`${this.value}`)}contains(e){return U(this,ce).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)}};ai=new WeakMap,ri=new WeakMap,ce=new WeakMap;var _c=`[mux-player ${cn()}]`;function Qe(...t){console.warn(_c,...t)}function Ee(...t){console.error(_c,...t)}function ol(t){var i;let e=(i=t.message)!=null?i:"";t.context&&(e+=` ${t.context}`),t.file&&(e+=` ${(0,gc.i18n)("Read more: ")}
1274
+ `}var jo=(t,e=t.mediaCurrentTime)=>{let i=Number.isFinite(t.mediaSeekableStart)?t.mediaSeekableStart:0,a=Number.isFinite(t.mediaDuration)?t.mediaDuration:t.mediaSeekableEnd;if(Number.isNaN(a))return 0;let r=(e-i)/(a-i);return Math.max(0,Math.min(r,1))},hc=(t,e=t.range.valueAsNumber)=>{let i=Number.isFinite(t.mediaSeekableStart)?t.mediaSeekableStart:0,a=Number.isFinite(t.mediaDuration)?t.mediaDuration:t.mediaSeekableEnd;return Number.isNaN(a)?0:e*(a-i)+i},dr=class extends Fe{constructor(){super(),re(this,qi),re(this,Js),re(this,rn),re(this,on),re(this,nn),re(this,zs),re(this,lr),re(this,Qs),re(this,Gi,void 0),re(this,ii,void 0),re(this,tn,void 0),re(this,or,void 0),re(this,an,void 0),re(this,en,void 0),re(this,nr,void 0),re(this,sr,void 0),re(this,Yi,void 0),re(this,Zs,a=>{this.dragging||(Ai(a)&&(this.range.valueAsNumber=a),this.updateBar())}),this.shadowRoot.querySelector("#track").insertAdjacentHTML("afterbegin",'<div id="buffered" part="buffered"></div>'),ze(this,tn,this.shadowRoot.querySelectorAll('[part~="box"]')),ze(this,an,this.shadowRoot.querySelector('[part~="preview-box"]')),ze(this,en,this.shadowRoot.querySelector('[part~="current-box"]'));let i=getComputedStyle(this);ze(this,nr,parseInt(i.getPropertyValue("--media-box-padding-left"))),ze(this,sr,parseInt(i.getPropertyValue("--media-box-padding-right"))),ze(this,ii,new Jo(this.range,ee(this,Zs),60))}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PAUSED,n.MEDIA_DURATION,n.MEDIA_SEEKABLE,n.MEDIA_CURRENT_TIME,n.MEDIA_PREVIEW_IMAGE,n.MEDIA_PREVIEW_TIME,n.MEDIA_PREVIEW_CHAPTER,n.MEDIA_BUFFERED,n.MEDIA_PLAYBACK_RATE,n.MEDIA_LOADING,n.MEDIA_ENDED]}connectedCallback(){var e;super.connectedCallback(),this.range.setAttribute("aria-label",h("seek")),le(this,qi,rr).call(this),ze(this,Gi,this.getRootNode()),(e=ee(this,Gi))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),le(this,qi,rr).call(this),(e=ee(this,Gi))==null||e.removeEventListener("transitionstart",this),ze(this,Gi,null)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),i!=a&&(e===n.MEDIA_CURRENT_TIME||e===n.MEDIA_PAUSED||e===n.MEDIA_ENDED||e===n.MEDIA_LOADING||e===n.MEDIA_DURATION||e===n.MEDIA_SEEKABLE?(ee(this,ii).update({start:jo(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),le(this,qi,rr).call(this),Jp(this)):e===n.MEDIA_BUFFERED&&this.updateBufferedBar(),(e===n.MEDIA_DURATION||e===n.MEDIA_SEEKABLE)&&(this.mediaChaptersCues=ee(this,Yi),this.updateBar()))}get mediaChaptersCues(){return ee(this,Yi)}set mediaChaptersCues(e){var i;ze(this,Yi,e),this.updateSegments((i=ee(this,Yi))==null?void 0:i.map(a=>({start:jo(this,a.startTime),end:jo(this,a.endTime)})))}get mediaPaused(){return k(this,n.MEDIA_PAUSED)}set mediaPaused(e){S(this,n.MEDIA_PAUSED,e)}get mediaLoading(){return k(this,n.MEDIA_LOADING)}set mediaLoading(e){S(this,n.MEDIA_LOADING,e)}get mediaDuration(){return R(this,n.MEDIA_DURATION)}set mediaDuration(e){O(this,n.MEDIA_DURATION,e)}get mediaCurrentTime(){return R(this,n.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){O(this,n.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return R(this,n.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){O(this,n.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){let e=this.getAttribute(n.MEDIA_BUFFERED);return e?e.split(" ").map(i=>i.split(":").map(a=>+a)):[]}set mediaBuffered(e){if(!e){this.removeAttribute(n.MEDIA_BUFFERED);return}let i=e.map(a=>a.join(":")).join(" ");this.setAttribute(n.MEDIA_BUFFERED,i)}get mediaSeekable(){let e=this.getAttribute(n.MEDIA_SEEKABLE);if(e)return e.split(":").map(i=>+i)}set mediaSeekable(e){if(e==null){this.removeAttribute(n.MEDIA_SEEKABLE);return}this.setAttribute(n.MEDIA_SEEKABLE,e.join(":"))}get mediaSeekableEnd(){var e;let[,i=this.mediaDuration]=(e=this.mediaSeekable)!=null?e:[];return i}get mediaSeekableStart(){var e;let[i=0]=(e=this.mediaSeekable)!=null?e:[];return i}get mediaPreviewImage(){return I(this,n.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){M(this,n.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return R(this,n.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){O(this,n.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return k(this,n.MEDIA_ENDED)}set mediaEnded(e){S(this,n.MEDIA_ENDED,e)}updateBar(){super.updateBar(),this.updateBufferedBar(),this.updateCurrentBox()}updateBufferedBar(){var e;let i=this.mediaBuffered;if(!i.length)return;let a;if(this.mediaEnded)a=1;else{let o=this.mediaCurrentTime,[,s=this.mediaSeekableStart]=(e=i.find(([l,u])=>l<=o&&o<=u))!=null?e:[];a=jo(this,s)}let{style:r}=W(this.shadowRoot,"#buffered");r.setProperty("width",`${a*100}%`)}updateCurrentBox(){if(!this.shadowRoot.querySelector('slot[name="current"]').assignedElements().length)return;let i=W(this.shadowRoot,"#current-rail"),a=W(this.shadowRoot,'[part~="current-box"]'),r=le(this,rn,js).call(this,ee(this,en)),o=le(this,on,el).call(this,r,this.range.valueAsNumber),s=le(this,nn,tl).call(this,r,this.range.valueAsNumber);i.style.transform=`translateX(${o})`,i.style.setProperty("--_range-width",`${r.range.width}`),a.style.setProperty("--_box-shift",`${s}`),a.style.setProperty("--_box-width",`${r.box.width}px`),a.style.setProperty("visibility","initial")}handleEvent(e){switch(super.handleEvent(e),e.type){case"input":le(this,Qs,mc).call(this);break;case"pointermove":le(this,zs,cc).call(this,e);break;case"pointerup":case"pointerleave":le(this,lr,sn).call(this,null);break;case"transitionstart":de(e.target,this)&&setTimeout(()=>le(this,qi,rr).call(this),0);break}}};Gi=new WeakMap;ii=new WeakMap;tn=new WeakMap;or=new WeakMap;an=new WeakMap;en=new WeakMap;nr=new WeakMap;sr=new WeakMap;Yi=new WeakMap;qi=new WeakSet;rr=function(){le(this,Js,uc).call(this)?ee(this,ii).start():ee(this,ii).stop()};Js=new WeakSet;uc=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&zr(this)};Zs=new WeakMap;rn=new WeakSet;js=function(t){var e;let a=((e=this.getAttribute("bounds")?He(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?e:this).getBoundingClientRect(),r=this.range.getBoundingClientRect(),o=t.offsetWidth,s=-(r.left-a.left-o/2),l=a.right-r.left-o/2;return{box:{width:o,min:s,max:l},bounds:a,range:r}};on=new WeakSet;el=function(t,e){let i=`${e*100}%`,{width:a,min:r,max:o}=t.box;if(!a)return i;if(Number.isNaN(r)||(i=`max(${`calc(1 / var(--_range-width) * 100 * ${r}% + var(--media-box-padding-left))`}, ${i})`),!Number.isNaN(o)){let l=`calc(1 / var(--_range-width) * 100 * ${o}% - var(--media-box-padding-right))`;i=`min(${i}, ${l})`}return i};nn=new WeakSet;tl=function(t,e){let{width:i,min:a,max:r}=t.box,o=e*t.range.width;if(o<a+ee(this,nr)){let s=t.range.left-t.bounds.left-ee(this,nr);return`${o-i/2+s}px`}if(o>r-ee(this,sr)){let s=t.bounds.right-t.range.right-ee(this,sr);return`${o+i/2-s-t.range.width}px`}return 0};zs=new WeakSet;cc=function(t){let e=[...ee(this,tn)].some(_=>t.composedPath().includes(_));if(!this.dragging&&(e||!t.composedPath().includes(this))){le(this,lr,sn).call(this,null);return}let i=this.mediaSeekableEnd;if(!i)return;let a=W(this.shadowRoot,"#preview-rail"),r=W(this.shadowRoot,'[part~="preview-box"]'),o=le(this,rn,js).call(this,ee(this,an)),s=(t.clientX-o.range.left)/o.range.width;s=Math.max(0,Math.min(1,s));let l=le(this,on,el).call(this,o,s),u=le(this,nn,tl).call(this,o,s);a.style.transform=`translateX(${l})`,a.style.setProperty("--_range-width",`${o.range.width}`),r.style.setProperty("--_box-shift",`${u}`),r.style.setProperty("--_box-width",`${o.box.width}px`);let m=Math.round(ee(this,or))-Math.round(s*i);Math.abs(m)<1&&s>.01&&s<.99||(ze(this,or,s*i),le(this,lr,sn).call(this,ee(this,or)))};lr=new WeakSet;sn=function(t){this.dispatchEvent(new d.CustomEvent(p.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:t}))};Qs=new WeakSet;mc=function(){ee(this,ii).stop();let t=hc(this);this.dispatchEvent(new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:t}))};dr.shadowRootOptions={mode:"open"};dr.getTemplateHTML=jp;d.customElements.get("media-time-range")||d.customElements.define("media-time-range",dr);var ef=1,tf=t=>t.mediaMuted?0:t.mediaVolume,af=t=>`${Math.round(t*100)}%`,il=class extends Fe{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_VOLUME,n.MEDIA_MUTED,n.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",h("volume"))}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),(e===n.MEDIA_VOLUME||e===n.MEDIA_MUTED)&&(this.range.valueAsNumber=tf(this),this.range.setAttribute("aria-valuetext",af(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return R(this,n.MEDIA_VOLUME,ef)}set mediaVolume(e){O(this,n.MEDIA_VOLUME,e)}get mediaMuted(){return k(this,n.MEDIA_MUTED)}set mediaMuted(e){S(this,n.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return I(this,n.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){M(this,n.MEDIA_VOLUME_UNAVAILABLE,e)}};d.customElements.get("media-volume-range")||d.customElements.define("media-volume-range",il);var b=require("@mux/mux-video/base"),w=require("@mux/playback-core");var gc=require("@mux/playback-core");var oi=require("@mux/playback-core");function pc(t){let e="";return Object.entries(t).forEach(([i,a])=>{a!=null&&(e+=`${ln(i)}: ${a}; `)}),e?e.trim():void 0}function ln(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function dn(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function ue(t){if(t==null)return;let e=+t;return Number.isNaN(e)?void 0:e}function al(t){let e=rf(t).toString();return e?"?"+e:""}function rf(t){let e={};for(let i in t)t[i]!=null&&(e[i]=t[i]);return new URLSearchParams(e)}var rl=(t,e)=>!t||!e?!1:t.contains(e)?!0:rl(t,e.getRootNode().host);var fc="mux.com",of=()=>{try{return"3.5.0"}catch{}return"UNKNOWN"},nf=of(),cn=()=>nf,vc=(t,{token:e,customDomain:i=fc,thumbnailTime:a,programTime:r}={})=>{var l;let o=e==null?a:void 0,{aud:s}=(l=(0,oi.parseJwt)(e))!=null?l:{};if(!(e&&s!=="t"))return`https://image.${i}/${t}/thumbnail.webp${al({token:e,time:o,program_time:r})}`},Ec=(t,{token:e,customDomain:i=fc,programStartTime:a,programEndTime:r}={})=>{var s;let{aud:o}=(s=(0,oi.parseJwt)(e))!=null?s:{};if(!(e&&o!=="s"))return`https://image.${i}/${t}/storyboard.vtt${al({token:e,format:"webp",program_start_time:a,program_end_time:r})}`},ur=t=>{if(t){if([oi.StreamTypes.LIVE,oi.StreamTypes.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return oi.StreamTypes.LIVE}};var sf={crossorigin:"crossOrigin",playsinline:"playsInline"};function bc(t){var e;return(e=sf[t])!=null?e:dn(t)}var ai,ri,ce,un=class{constructor(e,i){he(this,ai);he(this,ri);he(this,ce,[]);Te(this,ai,e),Te(this,ri,i)}[Symbol.iterator](){return U(this,ce).values()}get length(){return U(this,ce).length}get value(){var e;return(e=U(this,ce).join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(Te(this,ce,[]),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return U(this,ce)[e]}values(){return U(this,ce).values()}keys(){return U(this,ce).keys()}forEach(e){U(this,ce).forEach(e)}add(...e){var i,a;e.forEach(r=>{this.contains(r)||U(this,ce).push(r)}),!(this.value===""&&!((i=U(this,ai))!=null&&i.hasAttribute(`${U(this,ri)}`)))&&((a=U(this,ai))==null||a.setAttribute(`${U(this,ri)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>{U(this,ce).splice(U(this,ce).indexOf(a),1)}),(i=U(this,ai))==null||i.setAttribute(`${U(this,ri)}`,`${this.value}`)}contains(e){return U(this,ce).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)}};ai=new WeakMap,ri=new WeakMap,ce=new WeakMap;var _c=`[mux-player ${cn()}]`;function Qe(...t){console.warn(_c,...t)}function Ee(...t){console.error(_c,...t)}function ol(t){var i;let e=(i=t.message)!=null?i:"";t.context&&(e+=` ${t.context}`),t.file&&(e+=` ${(0,gc.i18n)("Read more: ")}
1275
1275
  https://github.com/muxinc/elements/blob/main/errors/${t.file}`),Qe(e)}var se={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},wt={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},Z1={...se,...wt},Tc=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}}),lf=Object.values(se).filter(t=>se.PLAYSINLINE!==t),df=Object.values(wt),uf=[...lf,...df],nl=class extends ye.HTMLElement{static get observedAttributes(){return uf}constructor(){super()}attributeChangedCallback(e,i,a){var r,o;switch(e){case wt.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case wt.VOLUME:{let s=(r=ue(a))!=null?r:1;this.media&&(this.media.volume=s);return}case wt.PLAYBACKRATE:{let s=(o=ue(a))!=null?o: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()}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:Tc}get seekable(){var e,i;return(i=(e=this.media)==null?void 0:e.seekable)!=null?i:Tc}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=ue(this.getAttribute(wt.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(wt.PLAYBACKRATE,`${e}`):this.removeAttribute(wt.PLAYBACKRATE)}get crossOrigin(){return cr(this,se.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(se.CROSSORIGIN,`${e}`)}get autoplay(){return cr(this,se.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(se.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(se.AUTOPLAY)}get loop(){return cr(this,se.LOOP)!=null}set loop(e){e?this.setAttribute(se.LOOP,""):this.removeAttribute(se.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 cr(this,se.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(se.MUTED,""):this.removeAttribute(se.MUTED)}get playsInline(){return cr(this,se.PLAYSINLINE)!=null}set playsInline(e){Ee("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(e){["","none","metadata","auto"].includes(e)?this.setAttribute(se.PRELOAD,e):this.removeAttribute(se.PRELOAD)}};function cr(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var sl=nl;var Mc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},x=(t,e,i)=>(Mc(t,e,"read from private field"),i?i.call(t):e.get(t)),Xe=(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)},ht=(t,e,i,a)=>(Mc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Zi,mn,ni,mr,Rt,xt,Dt,si,zi,hn,Pe,yc=1,kc=0,cf=1,mf={processCallback(t,e,i){if(i){for(let[a,r]of e)if(a in i){let o=i[a];typeof o=="boolean"&&r instanceof me&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=o:typeof o=="function"&&r instanceof me?r.element[r.attributeName]=o:r.value=o}}}},pt=class extends d.DocumentFragment{constructor(e,i,a=mf){var r;super(),Xe(this,Zi,void 0),Xe(this,mn,void 0),this.append(e.content.cloneNode(!0)),ht(this,Zi,Cc(this)),ht(this,mn,a),(r=a.createCallback)==null||r.call(a,this,x(this,Zi),i),a.processCallback(this,x(this,Zi),i)}update(e){x(this,mn).processCallback(this,x(this,Zi),e)}};Zi=new WeakMap;mn=new WeakMap;var Cc=(t,e=[])=>{let i,a;for(let r of t.attributes||[])if(r.value.includes("{{")){let o=new ll;for([i,a]of Ic(r.value))if(!i)o.append(a);else{let s=new me(t,r.name,r.namespaceURI);o.append(s),e.push([a,s])}r.value=o.toString()}for(let r of t.childNodes)if(r.nodeType===yc&&!(r instanceof HTMLTemplateElement))Cc(r,e);else{let o=r.data;if(r.nodeType===yc||o.includes("{{")){let s=[];if(o)for([i,a]of Ic(o))if(!i)s.push(new Text(a));else{let l=new ft(t);s.push(l),e.push([a,l])}else if(r instanceof HTMLTemplateElement){let l=new hr(t,r);s.push(l),e.push([l.expression,l])}r.replaceWith(...s.flatMap(l=>l.replacementNodes||[l]))}}return e},Sc={},Ic=t=>{let e="",i=0,a=Sc[t],r=0,o;if(a)return a;for(a=[];o=t[r];r++)o==="{"&&t[r+1]==="{"&&t[r-1]!=="\\"&&t[r+2]&&++i==1?(e&&a.push([kc,e]),e="",r++):o==="}"&&t[r+1]==="}"&&t[r-1]!=="\\"&&!--i?(a.push([cf,e.trim()]),e="",r++):e+=o||"";return e&&a.push([kc,(i>0?"{{":"")+e]),Sc[t]=a},hf=11,pn=class{get value(){return""}set value(e){}toString(){return this.value}},Lc=new WeakMap,ll=class{constructor(){Xe(this,ni,[])}[Symbol.iterator](){return x(this,ni).values()}get length(){return x(this,ni).length}item(e){return x(this,ni)[e]}append(...e){for(let i of e)i instanceof me&&Lc.set(i,this),x(this,ni).push(i)}toString(){return x(this,ni).join("")}};ni=new WeakMap;var me=class extends pn{constructor(e,i,a){super(),Xe(this,si),Xe(this,mr,""),Xe(this,Rt,void 0),Xe(this,xt,void 0),Xe(this,Dt,void 0),ht(this,Rt,e),ht(this,xt,i),ht(this,Dt,a)}get attributeName(){return x(this,xt)}get attributeNamespace(){return x(this,Dt)}get element(){return x(this,Rt)}get value(){return x(this,mr)}set value(e){x(this,mr)!==e&&(ht(this,mr,e),!x(this,si,zi)||x(this,si,zi).length===1?e==null?x(this,Rt).removeAttributeNS(x(this,Dt),x(this,xt)):x(this,Rt).setAttributeNS(x(this,Dt),x(this,xt),e):x(this,Rt).setAttributeNS(x(this,Dt),x(this,xt),x(this,si,zi).toString()))}get booleanValue(){return x(this,Rt).hasAttributeNS(x(this,Dt),x(this,xt))}set booleanValue(e){if(!x(this,si,zi)||x(this,si,zi).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};mr=new WeakMap;Rt=new WeakMap;xt=new WeakMap;Dt=new WeakMap;si=new WeakSet;zi=function(){return Lc.get(this)};var ft=class extends pn{constructor(e,i){super(),Xe(this,hn,void 0),Xe(this,Pe,void 0),ht(this,hn,e),ht(this,Pe,i?[...i]:[new Text])}get replacementNodes(){return x(this,Pe)}get parentNode(){return x(this,hn)}get nextSibling(){return x(this,Pe)[x(this,Pe).length-1].nextSibling}get previousSibling(){return x(this,Pe)[0].previousSibling}get value(){return x(this,Pe).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===hf?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);i.length||i.push(new Text),ht(this,Pe,pf(x(this,Pe)[0].parentNode,x(this,Pe),i,this.nextSibling))}};hn=new WeakMap;Pe=new WeakMap;var hr=class extends ft{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 pf(t,e,i,a=null){let r=0,o,s,l,u=i.length,m=e.length;for(;r<u&&r<m&&e[r]==i[r];)r++;for(;r<u&&r<m&&i[u-1]==e[m-1];)a=i[--m,--u];if(r==m)for(;r<u;)t.insertBefore(i[r++],a);if(r==u)for(;r<m;)t.removeChild(e[r++]);else{for(o=e[r];r<u;)l=i[r++],s=o?o.nextSibling:a,o==l?o=s:r<u&&i[r]==s?(t.replaceChild(l,o),o=s):t.insertBefore(l,o);for(;o!=a;)s=o.nextSibling,t.removeChild(o),o=s}return i}var wc={string:t=>String(t)},vn=class{constructor(e){this.template=e,this.state=void 0}},li=new WeakMap,di=new WeakMap,dl={partial:(t,e)=>{e[t.expression]=new vn(t.template)},if:(t,e)=>{var i;if(xc(t.expression,e))if(li.get(t)!==t.template){li.set(t,t.template);let a=new pt(t.template,e,En);t.replace(a),di.set(t,a)}else(i=di.get(t))==null||i.update(e);else t.replace(""),li.delete(t),di.delete(t)}},ff=Object.keys(dl),En={processCallback(t,e,i){var a,r;if(i)for(let[o,s]of e){if(s instanceof hr){if(!s.directive){let u=ff.find(m=>s.template.hasAttribute(m));u&&(s.directive=u,s.expression=s.template.getAttribute(u))}(a=dl[s.directive])==null||a.call(dl,s,i);continue}let l=xc(o,i);if(l instanceof vn){li.get(s)!==l.template?(li.set(s,l.template),l=new pt(l.template,l.state,En),s.value=l,di.set(s,l)):(r=di.get(s))==null||r.update(l.state);continue}l?(s instanceof me&&s.attributeName.startsWith("aria-")&&(l=String(l)),s instanceof me?typeof l=="boolean"?s.booleanValue=l:typeof l=="function"?s.element[s.attributeName]=l:s.value=l:(s.value=l,li.delete(s),di.delete(s))):s instanceof me?s.value=void 0:(s.value=void 0,li.delete(s),di.delete(s))}}},Rc={"!":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=wc[e])==null?void 0:i.call(wc,t)}};function vf(t){return Ef(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,o,s,l,u;let m=vf(t);if(m.length===0||m.some(({type:_})=>!_))return pr(t);if(((i=m[0])==null?void 0:i.token)===">"){let _=e[(a=m[1])==null?void 0:a.token];if(!_)return pr(t);let g={...e};_.state=g;let f=m.slice(2);for(let v=0;v<f.length;v+=3){let N=(r=f[v])==null?void 0:r.token,T=(o=f[v+1])==null?void 0:o.token,C=(s=f[v+2])==null?void 0:s.token;N&&T==="="&&(g[N]=fr(C,e))}return _}if(m.length===1)return fn(m[0])?fr(m[0].token,e):pr(t);if(m.length===2){let _=(l=m[0])==null?void 0:l.token,g=Rc[_];if(!g||!fn(m[1]))return pr(t);let f=fr(m[1].token,e);return g(f)}if(m.length===3){let _=(u=m[1])==null?void 0:u.token,g=Rc[_];if(!g||!fn(m[0])||!fn(m[2]))return pr(t);let f=fr(m[0].token,e);if(_==="|")return g(f,m[2].token);let v=fr(m[2].token,e);return g(f,v)}}function pr(t){return console.warn(`Warning: invalid expression \`${t}\``),!1}function fn({type:t}){return["number","boolean","string","param"].includes(t)}function fr(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):Wr(t)?parseFloat(t):e[t]}function Ef(t,e){let i,a,r,o=[];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&&o.push({token:t.substr(0,i),type:void 0}),r&&o.push(r),t=t.substr(i+(r?r.token.length:0))}return o}var fl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ml=(t,e,i)=>(fl(t,e,"read from private field"),i?i.call(t):e.get(t)),vr=(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)},ui=(t,e,i,a)=>(fl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ul=(t,e,i)=>(fl(t,e,"access private method"),i),Qi,bn,Xi,hl,Dc,gn,pl,cl={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},Oc=V.createElement("template");Oc.innerHTML=`
1276
1276
  <style>
1277
1277
  :host {
package/dist/base.mjs CHANGED
@@ -1,4 +1,4 @@
1
- var qe=t=>{throw TypeError(t)};var he=(t,a,e)=>a.has(t)||qe("Cannot "+e);var u=(t,a,e)=>(he(t,a,"read from private field"),e?e.call(t):a.get(t)),T=(t,a,e)=>a.has(t)?qe("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(t):a.set(t,e),C=(t,a,e,i)=>(he(t,a,"write to private field"),i?i.call(t,e):a.set(t,e),e),p=(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 ${},ge=class extends ${},Pt={get(t){},define(t,a,e){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(G)}},j,fe=class{constructor(a,e={}){T(this,j);C(this,j,e==null?void 0:e.detail)}get detail(){return u(this,j)}initCustomEvent(){}};j=new WeakMap;function Dt(t,a){return new G}var Qe={document:{createElement:Dt},DocumentFragment,customElements:Pt,CustomEvent:fe,EventTarget:$,HTMLElement:G,HTMLVideoElement:ge},Je=typeof window=="undefined"||typeof globalThis.customElements=="undefined",k=Je?Qe:globalThis,Y=Je?Qe.document:globalThis.document;import{MediaController as pa,MediaErrorDialog as Lt}from"media-chrome";import{Attributes as Oe}from"media-chrome/dist/media-container.js";import{MediaStateChangeEvents as At,MediaUIAttributes as ce,MediaUIEvents as Ct}from"media-chrome/dist/constants.js";import"media-chrome/dist/experimental/index.js";import{MediaError as be,Attributes as s}from"@mux/mux-video/base";import{StreamTypes as O,PlaybackTypes as pe,addTextTrack as ba,removeTextTrack as ha,CmcdTypeValues as kt,i18n as V,parseJwt as Le,MuxJWTAud as Me,generatePlayerInitTime as ga}from"@mux/playback-core";import{i18n as Kt}from"@mux/playback-core";import{StreamTypes as Te,parseJwt as tt}from"@mux/playback-core";function et(t){let a="";return Object.entries(t).forEach(([e,i])=>{i!=null&&(a+=`${re(e)}: ${i}; `)}),a?a.trim():void 0}function re(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function oe(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=Ut(t).toString();return a?"?"+a:""}function Ut(t){let a={};for(let e in t)t[e]!=null&&(a[e]=t[e]);return new URLSearchParams(a)}var ve=(t,a)=>!t||!a?!1:t.contains(a)?!0:ve(t,a.getRootNode().host);var at="mux.com",Vt=()=>{try{return"3.4.1"}catch{}return"UNKNOWN"},Bt=Vt(),se=()=>Bt,it=(t,{token:a,customDomain:e=at,thumbnailTime:i,programTime:r}={})=>{var l;let n=a==null?i:void 0,{aud:d}=(l=tt(a))!=null?l:{};if(!(a&&d!=="t"))return`https://image.${e}/${t}/thumbnail.webp${ye({token:a,time:n,program_time:r})}`},rt=(t,{token:a,customDomain:e=at,programStartTime:i,programEndTime:r}={})=>{var d;let{aud:n}=(d=tt(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})}`},z=t=>{if(t){if([Te.LIVE,Te.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return Te.LIVE}};var Ht={crossorigin:"crossOrigin",playsinline:"playsInline"};function ot(t){var a;return(a=Ht[t])!=null?a:oe(t)}var P,D,v,ne=class{constructor(a,e){T(this,P);T(this,D);T(this,v,[]);C(this,P,a),C(this,D,e)}[Symbol.iterator](){return u(this,v).values()}get length(){return u(this,v).length}get value(){var a;return(a=u(this,v).join(" "))!=null?a:""}set value(a){var e;a!==this.value&&(C(this,v,[]),this.add(...(e=a==null?void 0:a.split(" "))!=null?e:[]))}toString(){return this.value}item(a){return u(this,v)[a]}values(){return u(this,v).values()}keys(){return u(this,v).keys()}forEach(a){u(this,v).forEach(a)}add(...a){var e,i;a.forEach(r=>{this.contains(r)||u(this,v).push(r)}),!(this.value===""&&!((e=u(this,P))!=null&&e.hasAttribute(`${u(this,D)}`)))&&((i=u(this,P))==null||i.setAttribute(`${u(this,D)}`,`${this.value}`))}remove(...a){var e;a.forEach(i=>{u(this,v).splice(u(this,v).indexOf(i),1)}),(e=u(this,P))==null||e.setAttribute(`${u(this,D)}`,`${this.value}`)}contains(a){return u(this,v).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,D=new WeakMap,v=new WeakMap;var nt=`[mux-player ${se()}]`;function x(...t){console.warn(nt,...t)}function E(...t){console.error(nt,...t)}function Ee(t){var e;let a=(e=t.message)!=null?e:"";t.context&&(a+=` ${t.context}`),t.file&&(a+=` ${Kt("Read more: ")}
1
+ var qe=t=>{throw TypeError(t)};var he=(t,a,e)=>a.has(t)||qe("Cannot "+e);var u=(t,a,e)=>(he(t,a,"read from private field"),e?e.call(t):a.get(t)),T=(t,a,e)=>a.has(t)?qe("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(t):a.set(t,e),C=(t,a,e,i)=>(he(t,a,"write to private field"),i?i.call(t,e):a.set(t,e),e),p=(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 ${},ge=class extends ${},Pt={get(t){},define(t,a,e){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(G)}},j,fe=class{constructor(a,e={}){T(this,j);C(this,j,e==null?void 0:e.detail)}get detail(){return u(this,j)}initCustomEvent(){}};j=new WeakMap;function Dt(t,a){return new G}var Qe={document:{createElement:Dt},DocumentFragment,customElements:Pt,CustomEvent:fe,EventTarget:$,HTMLElement:G,HTMLVideoElement:ge},Je=typeof window=="undefined"||typeof globalThis.customElements=="undefined",k=Je?Qe:globalThis,Y=Je?Qe.document:globalThis.document;import{MediaController as pa,MediaErrorDialog as Lt}from"media-chrome";import{Attributes as Oe}from"media-chrome/dist/media-container.js";import{MediaStateChangeEvents as At,MediaUIAttributes as ce,MediaUIEvents as Ct}from"media-chrome/dist/constants.js";import"media-chrome/dist/experimental/index.js";import{MediaError as be,Attributes as s}from"@mux/mux-video/base";import{StreamTypes as O,PlaybackTypes as pe,addTextTrack as ba,removeTextTrack as ha,CmcdTypeValues as kt,i18n as V,parseJwt as Le,MuxJWTAud as Me,generatePlayerInitTime as ga}from"@mux/playback-core";import{i18n as Kt}from"@mux/playback-core";import{StreamTypes as Te,parseJwt as tt}from"@mux/playback-core";function et(t){let a="";return Object.entries(t).forEach(([e,i])=>{i!=null&&(a+=`${re(e)}: ${i}; `)}),a?a.trim():void 0}function re(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function oe(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=Ut(t).toString();return a?"?"+a:""}function Ut(t){let a={};for(let e in t)t[e]!=null&&(a[e]=t[e]);return new URLSearchParams(a)}var ve=(t,a)=>!t||!a?!1:t.contains(a)?!0:ve(t,a.getRootNode().host);var at="mux.com",Vt=()=>{try{return"3.5.0"}catch{}return"UNKNOWN"},Bt=Vt(),se=()=>Bt,it=(t,{token:a,customDomain:e=at,thumbnailTime:i,programTime:r}={})=>{var l;let n=a==null?i:void 0,{aud:d}=(l=tt(a))!=null?l:{};if(!(a&&d!=="t"))return`https://image.${e}/${t}/thumbnail.webp${ye({token:a,time:n,program_time:r})}`},rt=(t,{token:a,customDomain:e=at,programStartTime:i,programEndTime:r}={})=>{var d;let{aud:n}=(d=tt(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})}`},z=t=>{if(t){if([Te.LIVE,Te.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return Te.LIVE}};var Ht={crossorigin:"crossOrigin",playsinline:"playsInline"};function ot(t){var a;return(a=Ht[t])!=null?a:oe(t)}var P,D,v,ne=class{constructor(a,e){T(this,P);T(this,D);T(this,v,[]);C(this,P,a),C(this,D,e)}[Symbol.iterator](){return u(this,v).values()}get length(){return u(this,v).length}get value(){var a;return(a=u(this,v).join(" "))!=null?a:""}set value(a){var e;a!==this.value&&(C(this,v,[]),this.add(...(e=a==null?void 0:a.split(" "))!=null?e:[]))}toString(){return this.value}item(a){return u(this,v)[a]}values(){return u(this,v).values()}keys(){return u(this,v).keys()}forEach(a){u(this,v).forEach(a)}add(...a){var e,i;a.forEach(r=>{this.contains(r)||u(this,v).push(r)}),!(this.value===""&&!((e=u(this,P))!=null&&e.hasAttribute(`${u(this,D)}`)))&&((i=u(this,P))==null||i.setAttribute(`${u(this,D)}`,`${this.value}`))}remove(...a){var e;a.forEach(i=>{u(this,v).splice(u(this,v).indexOf(i),1)}),(e=u(this,P))==null||e.setAttribute(`${u(this,D)}`,`${this.value}`)}contains(a){return u(this,v).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,D=new WeakMap,v=new WeakMap;var nt=`[mux-player ${se()}]`;function x(...t){console.warn(nt,...t)}function E(...t){console.error(nt,...t)}function Ee(t){var e;let a=(e=t.message)!=null?e:"";t.context&&(a+=` ${t.context}`),t.file&&(a+=` ${Kt("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"},N={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},Va={...g,...N},dt=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}}),$t=Object.values(g).filter(t=>g.PLAYSINLINE!==t),Yt=Object.values(N),Ft=[...$t,...Yt],Ae=class extends k.HTMLElement{static get observedAttributes(){return Ft}constructor(){super()}attributeChangedCallback(a,e,i){var r,n;switch(a){case N.MUTED:{this.media&&(this.media.muted=i!=null,this.media.defaultMuted=i!=null);return}case N.VOLUME:{let d=(r=y(i))!=null?r:1;this.media&&(this.media.volume=d);return}case N.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()}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:dt}get seekable(){var a,e;return(e=(a=this.media)==null?void 0:a.seekable)!=null?e:dt}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(N.PLAYBACKRATE)))!=null?a:1}set defaultPlaybackRate(a){a!=null?this.setAttribute(N.PLAYBACKRATE,`${a}`):this.removeAttribute(N.PLAYBACKRATE)}get crossOrigin(){return X(this,g.CROSSORIGIN)}set crossOrigin(a){this.setAttribute(g.CROSSORIGIN,`${a}`)}get autoplay(){return X(this,g.AUTOPLAY)!=null}set autoplay(a){a?this.setAttribute(g.AUTOPLAY,typeof a=="string"?a:""):this.removeAttribute(g.AUTOPLAY)}get loop(){return X(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 X(this,g.MUTED)!=null}set defaultMuted(a){a?this.setAttribute(g.MUTED,""):this.removeAttribute(g.MUTED)}get playsInline(){return X(this,g.PLAYSINLINE)!=null}set playsInline(a){E("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 X(t,a){return t.media?t.media.getAttribute(a):t.getAttribute(a)}var Ce=Ae;import"media-chrome/dist/media-theme-element.js";var lt=`:host {
3
3
  --media-control-display: var(--controls);
4
4
  --media-loading-indicator-display: var(--loading-indicator);
@@ -92,7 +92,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
92
92
  <video${gT(i)}></video>
93
93
  </slot>
94
94
  <slot></slot>
95
- `}function pT(i,{tag:e,is:t}){var n,a,o,l,d,cT,c,h,f,m,p,vs,Rm,hT,Im,fT,mT;let r=(a=(n=globalThis.document)==null?void 0:n.createElement)==null?void 0:a.call(n,e,{is:t}),s=r?QL(r):[];return o=class extends i{constructor(){super(...arguments);ie(this,p);ie(this,c,!1);ie(this,h,null);ie(this,f,new Map);ie(this,m);Te(this,"get");Te(this,"set");Te(this,"call")}static get observedAttributes(){var O,w,C;return Ce(O=o,d,cT).call(O),[...(C=(w=r==null?void 0:r.constructor)==null?void 0:w.observedAttributes)!=null?C:[],...uT]}get nativeEl(){var x,O,w,C,P;return Ce(this,p,vs).call(this),(P=(C=(O=(x=I(this,h))!=null?x:this.querySelector(":scope > [slot=media]"))!=null?O:this.querySelector(e))!=null?C:(w=this.shadowRoot)==null?void 0:w.querySelector(e))!=null?P:null}set nativeEl(x){Z(this,h,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,O;return(O=this.getAttribute("preload"))!=null?O:(x=this.nativeEl)==null?void 0:x.preload}set preload(x){this.setAttribute("preload",`${x}`)}init(){if(!this.shadowRoot){this.attachShadow({mode:"open"});let x=ZL(this.attributes);t&&(x.is=t),e&&(x.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(x)}this.nativeEl.muted=this.hasAttribute("muted");for(let x of s)Ce(this,p,fT).call(this,x);Z(this,m,new MutationObserver(Ce(this,p,hT).bind(this))),this.shadowRoot.addEventListener("slotchange",()=>Ce(this,p,Rm).call(this)),Ce(this,p,Rm).call(this);for(let x of this.constructor.Events)this.shadowRoot.addEventListener(x,this,!0)}handleEvent(x){x.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(x.type,{detail:x.detail}))}attributeChangedCallback(x,O,w){Ce(this,p,vs).call(this),Ce(this,p,mT).call(this,x,O,w)}connectedCallback(){Ce(this,p,vs).call(this)}},l=new WeakMap,d=new WeakSet,cT=function(){if(I(this,l))return;Z(this,l,!0);let x=new Set(this.observedAttributes);x.delete("muted");for(let O of s)if(!(O in this.prototype))if(typeof r[O]=="function")this.prototype[O]=function(...w){return Ce(this,p,vs).call(this),(()=>{var U;if(this.call)return this.call(O,...w);let P=(U=this.nativeEl)==null?void 0:U[O];return P==null?void 0:P.apply(this.nativeEl,w)})()};else{let w={get(){var P,U,X;Ce(this,p,vs).call(this);let C=O.toLowerCase();if(x.has(C)){let z=this.getAttribute(C);return z===null?!1:z===""?!0:z}return(X=(P=this.get)==null?void 0:P.call(this,O))!=null?X:(U=this.nativeEl)==null?void 0:U[O]}};O!==O.toUpperCase()&&(w.set=function(C){Ce(this,p,vs).call(this);let P=O.toLowerCase();if(x.has(P)){C===!0||C===!1||C==null?this.toggleAttribute(P,!!C):this.setAttribute(P,C);return}if(this.set){this.set(O,C);return}this.nativeEl&&(this.nativeEl[O]=C)}),Object.defineProperty(this.prototype,O,w)}},c=new WeakMap,h=new WeakMap,f=new WeakMap,m=new WeakMap,p=new WeakSet,vs=function(){I(this,c)||(Z(this,c,!0),this.init())},Rm=function(){var C;let x=new Map(I(this,f)),O=(C=this.shadowRoot)==null?void 0:C.querySelector("slot:not([name])");(O==null?void 0:O.assignedElements({flatten:!0}).filter(P=>["track","source"].includes(P.localName))).forEach(P=>{var X,z;x.delete(P);let U=I(this,f).get(P);U||(U=P.cloneNode(),I(this,f).set(P,U),(X=I(this,m))==null||X.observe(P,{attributes:!0})),(z=this.nativeEl)==null||z.append(U),Ce(this,p,Im).call(this,U)}),x.forEach((P,U)=>{P.remove(),I(this,f).delete(U)})},hT=function(x){var O;for(let w of x)if(w.type==="attributes"){let{target:C,attributeName:P}=w,U=I(this,f).get(C);U&&P&&(U.setAttribute(P,(O=C.getAttribute(P))!=null?O:""),Ce(this,p,Im).call(this,U))}},Im=function(x){x&&x.localName==="track"&&x.default&&(x.kind==="chapters"||x.kind==="metadata")&&x.track.mode==="disabled"&&(x.track.mode="hidden")},fT=function(x){if(Object.prototype.hasOwnProperty.call(this,x)){let O=this[x];delete this[x],this[x]=O}},mT=function(x,O,w){var C,P,U;["id","class"].includes(x)||!o.observedAttributes.includes(x)&&this.constructor.observedAttributes.includes(x)||(w===null?(C=this.nativeEl)==null||C.removeAttribute(x):((P=this.nativeEl)==null?void 0:P.getAttribute(x))!==w&&((U=this.nativeEl)==null||U.setAttribute(x,w)))},ie(o,d),Te(o,"getTemplateHTML",e.endsWith("audio")?zL:XL),Te(o,"shadowRootOptions",{mode:"open"}),Te(o,"Events",dT),ie(o,l,!1),o}function QL(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 gT(i){let e="";for(let t in i){if(!uT.includes(t))continue;let r=i[t];r===""?e+=` ${t}`:e+=` ${t}="${r}"`}return e}function ZL(i){let e={};for(let t of i)e[t.name]=t.value;return e}var oT,Xa=pT((oT=globalThis.HTMLElement)!=null?oT:class{},{tag:"video"}),lT,LM=pT((lT=globalThis.HTMLElement)!=null?lT:class{},{tag:"audio"});var TT=i=>{throw TypeError(i)},km=(i,e,t)=>e.has(i)||TT("Cannot "+t),bt=(i,e,t)=>(km(i,e,"read from private field"),t?t.call(i):e.get(i)),ui=(i,e,t)=>e.has(i)?TT("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),Xt=(i,e,t,r)=>(km(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Lm=(i,e,t)=>(km(i,e,"access private method"),t),JL=()=>{try{return"0.25.3"}catch{}return"UNKNOWN"},ek=JL(),tk=()=>ek,ik=`
95
+ `}function pT(i,{tag:e,is:t}){var n,a,o,l,d,cT,c,h,f,m,p,vs,Rm,hT,Im,fT,mT;let r=(a=(n=globalThis.document)==null?void 0:n.createElement)==null?void 0:a.call(n,e,{is:t}),s=r?QL(r):[];return o=class extends i{constructor(){super(...arguments);ie(this,p);ie(this,c,!1);ie(this,h,null);ie(this,f,new Map);ie(this,m);Te(this,"get");Te(this,"set");Te(this,"call")}static get observedAttributes(){var O,w,C;return Ce(O=o,d,cT).call(O),[...(C=(w=r==null?void 0:r.constructor)==null?void 0:w.observedAttributes)!=null?C:[],...uT]}get nativeEl(){var x,O,w,C,P;return Ce(this,p,vs).call(this),(P=(C=(O=(x=I(this,h))!=null?x:this.querySelector(":scope > [slot=media]"))!=null?O:this.querySelector(e))!=null?C:(w=this.shadowRoot)==null?void 0:w.querySelector(e))!=null?P:null}set nativeEl(x){Z(this,h,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,O;return(O=this.getAttribute("preload"))!=null?O:(x=this.nativeEl)==null?void 0:x.preload}set preload(x){this.setAttribute("preload",`${x}`)}init(){if(!this.shadowRoot){this.attachShadow({mode:"open"});let x=ZL(this.attributes);t&&(x.is=t),e&&(x.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(x)}this.nativeEl.muted=this.hasAttribute("muted");for(let x of s)Ce(this,p,fT).call(this,x);Z(this,m,new MutationObserver(Ce(this,p,hT).bind(this))),this.shadowRoot.addEventListener("slotchange",()=>Ce(this,p,Rm).call(this)),Ce(this,p,Rm).call(this);for(let x of this.constructor.Events)this.shadowRoot.addEventListener(x,this,!0)}handleEvent(x){x.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(x.type,{detail:x.detail}))}attributeChangedCallback(x,O,w){Ce(this,p,vs).call(this),Ce(this,p,mT).call(this,x,O,w)}connectedCallback(){Ce(this,p,vs).call(this)}},l=new WeakMap,d=new WeakSet,cT=function(){if(I(this,l))return;Z(this,l,!0);let x=new Set(this.observedAttributes);x.delete("muted");for(let O of s)if(!(O in this.prototype))if(typeof r[O]=="function")this.prototype[O]=function(...w){return Ce(this,p,vs).call(this),(()=>{var U;if(this.call)return this.call(O,...w);let P=(U=this.nativeEl)==null?void 0:U[O];return P==null?void 0:P.apply(this.nativeEl,w)})()};else{let w={get(){var P,U,X;Ce(this,p,vs).call(this);let C=O.toLowerCase();if(x.has(C)){let z=this.getAttribute(C);return z===null?!1:z===""?!0:z}return(X=(P=this.get)==null?void 0:P.call(this,O))!=null?X:(U=this.nativeEl)==null?void 0:U[O]}};O!==O.toUpperCase()&&(w.set=function(C){Ce(this,p,vs).call(this);let P=O.toLowerCase();if(x.has(P)){C===!0||C===!1||C==null?this.toggleAttribute(P,!!C):this.setAttribute(P,C);return}if(this.set){this.set(O,C);return}this.nativeEl&&(this.nativeEl[O]=C)}),Object.defineProperty(this.prototype,O,w)}},c=new WeakMap,h=new WeakMap,f=new WeakMap,m=new WeakMap,p=new WeakSet,vs=function(){I(this,c)||(Z(this,c,!0),this.init())},Rm=function(){var C;let x=new Map(I(this,f)),O=(C=this.shadowRoot)==null?void 0:C.querySelector("slot:not([name])");(O==null?void 0:O.assignedElements({flatten:!0}).filter(P=>["track","source"].includes(P.localName))).forEach(P=>{var X,z;x.delete(P);let U=I(this,f).get(P);U||(U=P.cloneNode(),I(this,f).set(P,U),(X=I(this,m))==null||X.observe(P,{attributes:!0})),(z=this.nativeEl)==null||z.append(U),Ce(this,p,Im).call(this,U)}),x.forEach((P,U)=>{P.remove(),I(this,f).delete(U)})},hT=function(x){var O;for(let w of x)if(w.type==="attributes"){let{target:C,attributeName:P}=w,U=I(this,f).get(C);U&&P&&(U.setAttribute(P,(O=C.getAttribute(P))!=null?O:""),Ce(this,p,Im).call(this,U))}},Im=function(x){x&&x.localName==="track"&&x.default&&(x.kind==="chapters"||x.kind==="metadata")&&x.track.mode==="disabled"&&(x.track.mode="hidden")},fT=function(x){if(Object.prototype.hasOwnProperty.call(this,x)){let O=this[x];delete this[x],this[x]=O}},mT=function(x,O,w){var C,P,U;["id","class"].includes(x)||!o.observedAttributes.includes(x)&&this.constructor.observedAttributes.includes(x)||(w===null?(C=this.nativeEl)==null||C.removeAttribute(x):((P=this.nativeEl)==null?void 0:P.getAttribute(x))!==w&&((U=this.nativeEl)==null||U.setAttribute(x,w)))},ie(o,d),Te(o,"getTemplateHTML",e.endsWith("audio")?zL:XL),Te(o,"shadowRootOptions",{mode:"open"}),Te(o,"Events",dT),ie(o,l,!1),o}function QL(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 gT(i){let e="";for(let t in i){if(!uT.includes(t))continue;let r=i[t];r===""?e+=` ${t}`:e+=` ${t}="${r}"`}return e}function ZL(i){let e={};for(let t of i)e[t.name]=t.value;return e}var oT,Xa=pT((oT=globalThis.HTMLElement)!=null?oT:class{},{tag:"video"}),lT,LM=pT((lT=globalThis.HTMLElement)!=null?lT:class{},{tag:"audio"});var TT=i=>{throw TypeError(i)},km=(i,e,t)=>e.has(i)||TT("Cannot "+t),bt=(i,e,t)=>(km(i,e,"read from private field"),t?t.call(i):e.get(i)),ui=(i,e,t)=>e.has(i)?TT("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),Xt=(i,e,t,r)=>(km(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Lm=(i,e,t)=>(km(i,e,"access private method"),t),JL=()=>{try{return"0.26.0"}catch{}return"UNKNOWN"},ek=JL(),tk=()=>ek,ik=`
96
96
  <svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" part="logo" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2" viewBox="0 0 1600 500"><g fill="#fff"><path d="M994.287 93.486c-17.121 0-31-13.879-31-31 0-17.121 13.879-31 31-31 17.121 0 31 13.879 31 31 0 17.121-13.879 31-31 31m0-93.486c-34.509 0-62.484 27.976-62.484 62.486v187.511c0 68.943-56.09 125.033-125.032 125.033s-125.03-56.09-125.03-125.033V62.486C681.741 27.976 653.765 0 619.256 0s-62.484 27.976-62.484 62.486v187.511C556.772 387.85 668.921 500 806.771 500c137.851 0 250.001-112.15 250.001-250.003V62.486c0-34.51-27.976-62.486-62.485-62.486M1537.51 468.511c-17.121 0-31-13.879-31-31 0-17.121 13.879-31 31-31 17.121 0 31 13.879 31 31 0 17.121-13.879 31-31 31m-275.883-218.509-143.33 143.329c-24.402 24.402-24.402 63.966 0 88.368 24.402 24.402 63.967 24.402 88.369 0l143.33-143.329 143.328 143.329c24.402 24.4 63.967 24.402 88.369 0 24.403-24.402 24.403-63.966.001-88.368l-143.33-143.329.001-.004 143.329-143.329c24.402-24.402 24.402-63.965 0-88.367s-63.967-24.402-88.369 0L1349.996 161.63 1206.667 18.302c-24.402-24.401-63.967-24.402-88.369 0s-24.402 63.965 0 88.367l143.329 143.329v.004ZM437.511 468.521c-17.121 0-31-13.879-31-31 0-17.121 13.879-31 31-31 17.121 0 31 13.879 31 31 0 17.121-13.879 31-31 31M461.426 4.759C438.078-4.913 411.2.432 393.33 18.303L249.999 161.632 106.669 18.303C88.798.432 61.922-4.913 38.573 4.759 15.224 14.43-.001 37.214-.001 62.488v375.026c0 34.51 27.977 62.486 62.487 62.486 34.51 0 62.486-27.976 62.486-62.486V213.341l80.843 80.844c24.404 24.402 63.965 24.402 88.369 0l80.843-80.844v224.173c0 34.51 27.976 62.486 62.486 62.486s62.486-27.976 62.486-62.486V62.488c0-25.274-15.224-48.058-38.573-57.729" style="fill-rule:nonzero"/></g></svg>`,D={BEACON_COLLECTION_DOMAIN:"beacon-collection-domain",CUSTOM_DOMAIN:"custom-domain",DEBUG:"debug",DISABLE_TRACKING:"disable-tracking",DISABLE_COOKIES:"disable-cookies",DRM_TOKEN:"drm-token",PLAYBACK_TOKEN:"playback-token",ENV_KEY:"env-key",MAX_RESOLUTION:"max-resolution",MIN_RESOLUTION:"min-resolution",RENDITION_ORDER:"rendition-order",PROGRAM_START_TIME:"program-start-time",PROGRAM_END_TIME:"program-end-time",ASSET_START_TIME:"asset-start-time",ASSET_END_TIME:"asset-end-time",METADATA_URL:"metadata-url",PLAYBACK_ID:"playback-id",PLAYER_SOFTWARE_NAME:"player-software-name",PLAYER_SOFTWARE_VERSION:"player-software-version",PLAYER_INIT_TIME:"player-init-time",PREFER_CMCD:"prefer-cmcd",PREFER_PLAYBACK:"prefer-playback",START_TIME:"start-time",STREAM_TYPE:"stream-type",TARGET_LIVE_WINDOW:"target-live-window",LIVE_EDGE_OFFSET:"live-edge-offset",TYPE:"type",LOGO:"logo"},rk=Object.values(D),vT=tk(),ET="mux-video",xi,Qa,Ld,Za,kd,wd,Dd,Cd,Md,Ja,eo,Od,bT=class extends Xa{constructor(){super(),ui(this,eo),ui(this,xi),ui(this,Qa),ui(this,Ld),ui(this,Za,{}),ui(this,kd,{}),ui(this,wd),ui(this,Dd),ui(this,Cd),ui(this,Md),ui(this,Ja,""),Xt(this,Ld,Sd()),this.nativeEl.addEventListener("muxmetadata",i=>{var e;let t=XE(this.nativeEl),r=(e=this.metadata)!=null?e:{};this.metadata={...t,...r},(t==null?void 0:t["com.mux.video.branding"])==="mux-free-plan"&&(Xt(this,Ja,"default"),this.updateLogo())})}static get NAME(){return ET}static get VERSION(){return vT}static get observedAttributes(){var i;return[...rk,...(i=Xa.observedAttributes)!=null?i:[]]}static getLogoHTML(i){return!i||i==="false"?"":i==="default"?ik:`<img part="logo" src="${i}" />`}static getTemplateHTML(i={}){var e;return`
97
97
  ${Xa.getTemplateHTML(i)}
98
98
  <style>
@@ -1837,7 +1837,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1837
1837
  }
1838
1838
  </style>
1839
1839
  <slot name="icon">${mC}</slot>
1840
- `}function gC(){return B("Quality")}var va=class extends Pt{static get observedAttributes(){return[...super.observedAttributes,b.MEDIA_RENDITION_SELECTED,b.MEDIA_RENDITION_UNAVAILABLE,b.MEDIA_HEIGHT]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",B("quality"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:We(this).querySelector("media-rendition-menu")}get mediaRenditionSelected(){return de(this,b.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){ue(this,b.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return ge(this,b.MEDIA_HEIGHT)}set mediaHeight(e){ye(this,b.MEDIA_HEIGHT,e)}};va.getSlotTemplateHTML=pC;va.getTooltipContentHTML=gC;S.customElements.get("media-rendition-menu-button")||S.customElements.define("media-rendition-menu-button",va);var U_=i=>{throw TypeError(i)},Bg=(i,e,t)=>e.has(i)||U_("Cannot "+t),De=(i,e,t)=>(Bg(i,e,"read from private field"),t?t.call(i):e.get(i)),vi=(i,e,t)=>e.has(i)?U_("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),qi=(i,e,t,r)=>(Bg(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),nt=(i,e,t)=>(Bg(i,e,"access private method"),t),eh=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends eh{}globalThis.DocumentFragment=i}var $g=class extends eh{},vC=class extends eh{},EC={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve($g)}},jc,TC=class{constructor(i,e={}){vi(this,jc),qi(this,jc,e==null?void 0:e.detail)}get detail(){return De(this,jc)}initCustomEvent(){}};jc=new WeakMap;function bC(i,e){return new $g}var F_={document:{createElement:bC},DocumentFragment,customElements:EC,CustomEvent:TC,EventTarget:eh,HTMLElement:$g,HTMLVideoElement:vC},B_=typeof window=="undefined"||typeof globalThis.customElements=="undefined",Yi=B_?F_:globalThis,Hg=B_?F_.document:globalThis.document;function yC(i){let e="";return Object.entries(i).forEach(([t,r])=>{r!=null&&(e+=`${Pg(t)}: ${r}; `)}),e?e.trim():void 0}function Pg(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function $_(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Wt(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function H_(i){let e=_C(i).toString();return e?"?"+e:""}function _C(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var G_=(i,e)=>!i||!e?!1:i.contains(e)?!0:G_(i,e.getRootNode().host),K_="mux.com",AC=()=>{try{return"3.4.1"}catch{}return"UNKNOWN"},SC=AC(),V_=()=>SC,xC=(i,{token:e,customDomain:t=K_,thumbnailTime:r,programTime:s}={})=>{var n;let a=e==null?r:void 0,{aud:o}=(n=Sr(e))!=null?n:{};if(!(e&&o!=="t"))return`https://image.${t}/${i}/thumbnail.webp${H_({token:e,time:a,program_time:s})}`},RC=(i,{token:e,customDomain:t=K_,programStartTime:r,programEndTime:s}={})=>{var n;let{aud:a}=(n=Sr(e))!=null?n:{};if(!(e&&a!=="s"))return`https://image.${t}/${i}/storyboard.vtt${H_({token:e,format:"webp",program_start_time:r,program_end_time:s})}`},Gg=i=>{if(i){if([Se.LIVE,Se.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return Se.LIVE}},IC={crossorigin:"crossOrigin",playsinline:"playsInline"};function LC(i){var e;return(e=IC[i])!=null?e:$_(i)}var Ea,Ta,Nt,kC=class{constructor(i,e){vi(this,Ea),vi(this,Ta),vi(this,Nt,[]),qi(this,Ea,i),qi(this,Ta,e)}[Symbol.iterator](){return De(this,Nt).values()}get length(){return De(this,Nt).length}get value(){var i;return(i=De(this,Nt).join(" "))!=null?i:""}set value(i){var e;i!==this.value&&(qi(this,Nt,[]),this.add(...(e=i==null?void 0:i.split(" "))!=null?e:[]))}toString(){return this.value}item(i){return De(this,Nt)[i]}values(){return De(this,Nt).values()}keys(){return De(this,Nt).keys()}forEach(i){De(this,Nt).forEach(i)}add(...i){var e,t;i.forEach(r=>{this.contains(r)||De(this,Nt).push(r)}),!(this.value===""&&!((e=De(this,Ea))!=null&&e.hasAttribute(`${De(this,Ta)}`)))&&((t=De(this,Ea))==null||t.setAttribute(`${De(this,Ta)}`,`${this.value}`))}remove(...i){var e;i.forEach(t=>{De(this,Nt).splice(De(this,Nt).indexOf(t),1)}),(e=De(this,Ea))==null||e.setAttribute(`${De(this,Ta)}`,`${this.value}`)}contains(i){return De(this,Nt).includes(i)}toggle(i,e){return typeof e!="undefined"?e?(this.add(i),!0):(this.remove(i),!1):this.contains(i)?(this.remove(i),!1):(this.add(i),!0)}replace(i,e){this.remove(i),this.add(e)}};Ea=new WeakMap,Ta=new WeakMap,Nt=new WeakMap;var W_=`[mux-player ${V_()}]`;function vr(...i){console.warn(W_,...i)}function ei(...i){console.error(W_,...i)}function Y_(i){var e;let t=(e=i.message)!=null?e:"";i.context&&(t+=` ${i.context}`),i.file&&(t+=` ${Q("Read more: ")}
1840
+ `}function gC(){return B("Quality")}var va=class extends Pt{static get observedAttributes(){return[...super.observedAttributes,b.MEDIA_RENDITION_SELECTED,b.MEDIA_RENDITION_UNAVAILABLE,b.MEDIA_HEIGHT]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",B("quality"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:We(this).querySelector("media-rendition-menu")}get mediaRenditionSelected(){return de(this,b.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){ue(this,b.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return ge(this,b.MEDIA_HEIGHT)}set mediaHeight(e){ye(this,b.MEDIA_HEIGHT,e)}};va.getSlotTemplateHTML=pC;va.getTooltipContentHTML=gC;S.customElements.get("media-rendition-menu-button")||S.customElements.define("media-rendition-menu-button",va);var U_=i=>{throw TypeError(i)},Bg=(i,e,t)=>e.has(i)||U_("Cannot "+t),De=(i,e,t)=>(Bg(i,e,"read from private field"),t?t.call(i):e.get(i)),vi=(i,e,t)=>e.has(i)?U_("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),qi=(i,e,t,r)=>(Bg(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),nt=(i,e,t)=>(Bg(i,e,"access private method"),t),eh=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends eh{}globalThis.DocumentFragment=i}var $g=class extends eh{},vC=class extends eh{},EC={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve($g)}},jc,TC=class{constructor(i,e={}){vi(this,jc),qi(this,jc,e==null?void 0:e.detail)}get detail(){return De(this,jc)}initCustomEvent(){}};jc=new WeakMap;function bC(i,e){return new $g}var F_={document:{createElement:bC},DocumentFragment,customElements:EC,CustomEvent:TC,EventTarget:eh,HTMLElement:$g,HTMLVideoElement:vC},B_=typeof window=="undefined"||typeof globalThis.customElements=="undefined",Yi=B_?F_:globalThis,Hg=B_?F_.document:globalThis.document;function yC(i){let e="";return Object.entries(i).forEach(([t,r])=>{r!=null&&(e+=`${Pg(t)}: ${r}; `)}),e?e.trim():void 0}function Pg(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function $_(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Wt(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function H_(i){let e=_C(i).toString();return e?"?"+e:""}function _C(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var G_=(i,e)=>!i||!e?!1:i.contains(e)?!0:G_(i,e.getRootNode().host),K_="mux.com",AC=()=>{try{return"3.5.0"}catch{}return"UNKNOWN"},SC=AC(),V_=()=>SC,xC=(i,{token:e,customDomain:t=K_,thumbnailTime:r,programTime:s}={})=>{var n;let a=e==null?r:void 0,{aud:o}=(n=Sr(e))!=null?n:{};if(!(e&&o!=="t"))return`https://image.${t}/${i}/thumbnail.webp${H_({token:e,time:a,program_time:s})}`},RC=(i,{token:e,customDomain:t=K_,programStartTime:r,programEndTime:s}={})=>{var n;let{aud:a}=(n=Sr(e))!=null?n:{};if(!(e&&a!=="s"))return`https://image.${t}/${i}/storyboard.vtt${H_({token:e,format:"webp",program_start_time:r,program_end_time:s})}`},Gg=i=>{if(i){if([Se.LIVE,Se.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return Se.LIVE}},IC={crossorigin:"crossOrigin",playsinline:"playsInline"};function LC(i){var e;return(e=IC[i])!=null?e:$_(i)}var Ea,Ta,Nt,kC=class{constructor(i,e){vi(this,Ea),vi(this,Ta),vi(this,Nt,[]),qi(this,Ea,i),qi(this,Ta,e)}[Symbol.iterator](){return De(this,Nt).values()}get length(){return De(this,Nt).length}get value(){var i;return(i=De(this,Nt).join(" "))!=null?i:""}set value(i){var e;i!==this.value&&(qi(this,Nt,[]),this.add(...(e=i==null?void 0:i.split(" "))!=null?e:[]))}toString(){return this.value}item(i){return De(this,Nt)[i]}values(){return De(this,Nt).values()}keys(){return De(this,Nt).keys()}forEach(i){De(this,Nt).forEach(i)}add(...i){var e,t;i.forEach(r=>{this.contains(r)||De(this,Nt).push(r)}),!(this.value===""&&!((e=De(this,Ea))!=null&&e.hasAttribute(`${De(this,Ta)}`)))&&((t=De(this,Ea))==null||t.setAttribute(`${De(this,Ta)}`,`${this.value}`))}remove(...i){var e;i.forEach(t=>{De(this,Nt).splice(De(this,Nt).indexOf(t),1)}),(e=De(this,Ea))==null||e.setAttribute(`${De(this,Ta)}`,`${this.value}`)}contains(i){return De(this,Nt).includes(i)}toggle(i,e){return typeof e!="undefined"?e?(this.add(i),!0):(this.remove(i),!1):this.contains(i)?(this.remove(i),!1):(this.add(i),!0)}replace(i,e){this.remove(i),this.add(e)}};Ea=new WeakMap,Ta=new WeakMap,Nt=new WeakMap;var W_=`[mux-player ${V_()}]`;function vr(...i){console.warn(W_,...i)}function ei(...i){console.error(W_,...i)}function Y_(i){var e;let t=(e=i.message)!=null?e:"";i.context&&(t+=` ${i.context}`),i.file&&(t+=` ${Q("Read more: ")}
1841
1841
  https://github.com/muxinc/elements/blob/main/errors/${i.file}`),vr(t)}var _t={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},rs={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},R8={..._t,...rs},__=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}}),wC=Object.values(_t).filter(i=>_t.PLAYSINLINE!==i),DC=Object.values(rs),CC=[...wC,...DC],MC=class extends Yi.HTMLElement{static get observedAttributes(){return CC}constructor(){super()}attributeChangedCallback(i,e,t){var r,s;switch(i){case rs.MUTED:{this.media&&(this.media.muted=t!=null,this.media.defaultMuted=t!=null);return}case rs.VOLUME:{let n=(r=Wt(t))!=null?r:1;this.media&&(this.media.volume=n);return}case rs.PLAYBACKRATE:{let n=(s=Wt(t))!=null?s:1;this.media&&(this.media.playbackRate=n,this.media.defaultPlaybackRate=n);return}}}play(){var i,e;return(e=(i=this.media)==null?void 0:i.play())!=null?e:Promise.reject()}pause(){var i;(i=this.media)==null||i.pause()}load(){var i;(i=this.media)==null||i.load()}get media(){var i;return(i=this.shadowRoot)==null?void 0:i.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 i,e;return(e=(i=this.media)==null?void 0:i.paused)!=null?e:!0}get duration(){var i,e;return(e=(i=this.media)==null?void 0:i.duration)!=null?e:NaN}get ended(){var i,e;return(e=(i=this.media)==null?void 0:i.ended)!=null?e:!1}get buffered(){var i,e;return(e=(i=this.media)==null?void 0:i.buffered)!=null?e:__}get seekable(){var i,e;return(e=(i=this.media)==null?void 0:i.seekable)!=null?e:__}get readyState(){var i,e;return(e=(i=this.media)==null?void 0:i.readyState)!=null?e:0}get videoWidth(){var i,e;return(e=(i=this.media)==null?void 0:i.videoWidth)!=null?e:0}get videoHeight(){var i,e;return(e=(i=this.media)==null?void 0:i.videoHeight)!=null?e:0}get currentSrc(){var i,e;return(e=(i=this.media)==null?void 0:i.currentSrc)!=null?e:""}get currentTime(){var i,e;return(e=(i=this.media)==null?void 0:i.currentTime)!=null?e:0}set currentTime(i){this.media&&(this.media.currentTime=Number(i))}get volume(){var i,e;return(e=(i=this.media)==null?void 0:i.volume)!=null?e:1}set volume(i){this.media&&(this.media.volume=Number(i))}get playbackRate(){var i,e;return(e=(i=this.media)==null?void 0:i.playbackRate)!=null?e:1}set playbackRate(i){this.media&&(this.media.playbackRate=Number(i))}get defaultPlaybackRate(){var i;return(i=Wt(this.getAttribute(rs.PLAYBACKRATE)))!=null?i:1}set defaultPlaybackRate(i){i!=null?this.setAttribute(rs.PLAYBACKRATE,`${i}`):this.removeAttribute(rs.PLAYBACKRATE)}get crossOrigin(){return hl(this,_t.CROSSORIGIN)}set crossOrigin(i){this.setAttribute(_t.CROSSORIGIN,`${i}`)}get autoplay(){return hl(this,_t.AUTOPLAY)!=null}set autoplay(i){i?this.setAttribute(_t.AUTOPLAY,typeof i=="string"?i:""):this.removeAttribute(_t.AUTOPLAY)}get loop(){return hl(this,_t.LOOP)!=null}set loop(i){i?this.setAttribute(_t.LOOP,""):this.removeAttribute(_t.LOOP)}get muted(){var i,e;return(e=(i=this.media)==null?void 0:i.muted)!=null?e:!1}set muted(i){this.media&&(this.media.muted=!!i)}get defaultMuted(){return hl(this,_t.MUTED)!=null}set defaultMuted(i){i?this.setAttribute(_t.MUTED,""):this.removeAttribute(_t.MUTED)}get playsInline(){return hl(this,_t.PLAYSINLINE)!=null}set playsInline(i){ei("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(i){["","none","metadata","auto"].includes(i)?this.setAttribute(_t.PRELOAD,i):this.removeAttribute(_t.PRELOAD)}};function hl(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var A_=MC,OC=`:host {
1842
1842
  --media-control-display: var(--controls);
1843
1843
  --media-loading-indicator-display: var(--loading-indicator);
@@ -92,7 +92,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
92
92
  <video${gT(i)}></video>
93
93
  </slot>
94
94
  <slot></slot>
95
- `}function pT(i,{tag:e,is:t}){var n,a,o,l,d,cT,c,h,f,m,p,vs,Rm,hT,Im,fT,mT;let r=(a=(n=globalThis.document)==null?void 0:n.createElement)==null?void 0:a.call(n,e,{is:t}),s=r?QL(r):[];return o=class extends i{constructor(){super(...arguments);ie(this,p);ie(this,c,!1);ie(this,h,null);ie(this,f,new Map);ie(this,m);Te(this,"get");Te(this,"set");Te(this,"call")}static get observedAttributes(){var O,w,C;return Ce(O=o,d,cT).call(O),[...(C=(w=r==null?void 0:r.constructor)==null?void 0:w.observedAttributes)!=null?C:[],...uT]}get nativeEl(){var x,O,w,C,P;return Ce(this,p,vs).call(this),(P=(C=(O=(x=I(this,h))!=null?x:this.querySelector(":scope > [slot=media]"))!=null?O:this.querySelector(e))!=null?C:(w=this.shadowRoot)==null?void 0:w.querySelector(e))!=null?P:null}set nativeEl(x){Z(this,h,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,O;return(O=this.getAttribute("preload"))!=null?O:(x=this.nativeEl)==null?void 0:x.preload}set preload(x){this.setAttribute("preload",`${x}`)}init(){if(!this.shadowRoot){this.attachShadow({mode:"open"});let x=ZL(this.attributes);t&&(x.is=t),e&&(x.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(x)}this.nativeEl.muted=this.hasAttribute("muted");for(let x of s)Ce(this,p,fT).call(this,x);Z(this,m,new MutationObserver(Ce(this,p,hT).bind(this))),this.shadowRoot.addEventListener("slotchange",()=>Ce(this,p,Rm).call(this)),Ce(this,p,Rm).call(this);for(let x of this.constructor.Events)this.shadowRoot.addEventListener(x,this,!0)}handleEvent(x){x.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(x.type,{detail:x.detail}))}attributeChangedCallback(x,O,w){Ce(this,p,vs).call(this),Ce(this,p,mT).call(this,x,O,w)}connectedCallback(){Ce(this,p,vs).call(this)}},l=new WeakMap,d=new WeakSet,cT=function(){if(I(this,l))return;Z(this,l,!0);let x=new Set(this.observedAttributes);x.delete("muted");for(let O of s)if(!(O in this.prototype))if(typeof r[O]=="function")this.prototype[O]=function(...w){return Ce(this,p,vs).call(this),(()=>{var U;if(this.call)return this.call(O,...w);let P=(U=this.nativeEl)==null?void 0:U[O];return P==null?void 0:P.apply(this.nativeEl,w)})()};else{let w={get(){var P,U,X;Ce(this,p,vs).call(this);let C=O.toLowerCase();if(x.has(C)){let z=this.getAttribute(C);return z===null?!1:z===""?!0:z}return(X=(P=this.get)==null?void 0:P.call(this,O))!=null?X:(U=this.nativeEl)==null?void 0:U[O]}};O!==O.toUpperCase()&&(w.set=function(C){Ce(this,p,vs).call(this);let P=O.toLowerCase();if(x.has(P)){C===!0||C===!1||C==null?this.toggleAttribute(P,!!C):this.setAttribute(P,C);return}if(this.set){this.set(O,C);return}this.nativeEl&&(this.nativeEl[O]=C)}),Object.defineProperty(this.prototype,O,w)}},c=new WeakMap,h=new WeakMap,f=new WeakMap,m=new WeakMap,p=new WeakSet,vs=function(){I(this,c)||(Z(this,c,!0),this.init())},Rm=function(){var C;let x=new Map(I(this,f)),O=(C=this.shadowRoot)==null?void 0:C.querySelector("slot:not([name])");(O==null?void 0:O.assignedElements({flatten:!0}).filter(P=>["track","source"].includes(P.localName))).forEach(P=>{var X,z;x.delete(P);let U=I(this,f).get(P);U||(U=P.cloneNode(),I(this,f).set(P,U),(X=I(this,m))==null||X.observe(P,{attributes:!0})),(z=this.nativeEl)==null||z.append(U),Ce(this,p,Im).call(this,U)}),x.forEach((P,U)=>{P.remove(),I(this,f).delete(U)})},hT=function(x){var O;for(let w of x)if(w.type==="attributes"){let{target:C,attributeName:P}=w,U=I(this,f).get(C);U&&P&&(U.setAttribute(P,(O=C.getAttribute(P))!=null?O:""),Ce(this,p,Im).call(this,U))}},Im=function(x){x&&x.localName==="track"&&x.default&&(x.kind==="chapters"||x.kind==="metadata")&&x.track.mode==="disabled"&&(x.track.mode="hidden")},fT=function(x){if(Object.prototype.hasOwnProperty.call(this,x)){let O=this[x];delete this[x],this[x]=O}},mT=function(x,O,w){var C,P,U;["id","class"].includes(x)||!o.observedAttributes.includes(x)&&this.constructor.observedAttributes.includes(x)||(w===null?(C=this.nativeEl)==null||C.removeAttribute(x):((P=this.nativeEl)==null?void 0:P.getAttribute(x))!==w&&((U=this.nativeEl)==null||U.setAttribute(x,w)))},ie(o,d),Te(o,"getTemplateHTML",e.endsWith("audio")?zL:XL),Te(o,"shadowRootOptions",{mode:"open"}),Te(o,"Events",dT),ie(o,l,!1),o}function QL(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 gT(i){let e="";for(let t in i){if(!uT.includes(t))continue;let r=i[t];r===""?e+=` ${t}`:e+=` ${t}="${r}"`}return e}function ZL(i){let e={};for(let t of i)e[t.name]=t.value;return e}var oT,Xa=pT((oT=globalThis.HTMLElement)!=null?oT:class{},{tag:"video"}),lT,LM=pT((lT=globalThis.HTMLElement)!=null?lT:class{},{tag:"audio"});var TT=i=>{throw TypeError(i)},km=(i,e,t)=>e.has(i)||TT("Cannot "+t),bt=(i,e,t)=>(km(i,e,"read from private field"),t?t.call(i):e.get(i)),ui=(i,e,t)=>e.has(i)?TT("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),Xt=(i,e,t,r)=>(km(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Lm=(i,e,t)=>(km(i,e,"access private method"),t),JL=()=>{try{return"0.25.3"}catch{}return"UNKNOWN"},ek=JL(),tk=()=>ek,ik=`
95
+ `}function pT(i,{tag:e,is:t}){var n,a,o,l,d,cT,c,h,f,m,p,vs,Rm,hT,Im,fT,mT;let r=(a=(n=globalThis.document)==null?void 0:n.createElement)==null?void 0:a.call(n,e,{is:t}),s=r?QL(r):[];return o=class extends i{constructor(){super(...arguments);ie(this,p);ie(this,c,!1);ie(this,h,null);ie(this,f,new Map);ie(this,m);Te(this,"get");Te(this,"set");Te(this,"call")}static get observedAttributes(){var O,w,C;return Ce(O=o,d,cT).call(O),[...(C=(w=r==null?void 0:r.constructor)==null?void 0:w.observedAttributes)!=null?C:[],...uT]}get nativeEl(){var x,O,w,C,P;return Ce(this,p,vs).call(this),(P=(C=(O=(x=I(this,h))!=null?x:this.querySelector(":scope > [slot=media]"))!=null?O:this.querySelector(e))!=null?C:(w=this.shadowRoot)==null?void 0:w.querySelector(e))!=null?P:null}set nativeEl(x){Z(this,h,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,O;return(O=this.getAttribute("preload"))!=null?O:(x=this.nativeEl)==null?void 0:x.preload}set preload(x){this.setAttribute("preload",`${x}`)}init(){if(!this.shadowRoot){this.attachShadow({mode:"open"});let x=ZL(this.attributes);t&&(x.is=t),e&&(x.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(x)}this.nativeEl.muted=this.hasAttribute("muted");for(let x of s)Ce(this,p,fT).call(this,x);Z(this,m,new MutationObserver(Ce(this,p,hT).bind(this))),this.shadowRoot.addEventListener("slotchange",()=>Ce(this,p,Rm).call(this)),Ce(this,p,Rm).call(this);for(let x of this.constructor.Events)this.shadowRoot.addEventListener(x,this,!0)}handleEvent(x){x.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(x.type,{detail:x.detail}))}attributeChangedCallback(x,O,w){Ce(this,p,vs).call(this),Ce(this,p,mT).call(this,x,O,w)}connectedCallback(){Ce(this,p,vs).call(this)}},l=new WeakMap,d=new WeakSet,cT=function(){if(I(this,l))return;Z(this,l,!0);let x=new Set(this.observedAttributes);x.delete("muted");for(let O of s)if(!(O in this.prototype))if(typeof r[O]=="function")this.prototype[O]=function(...w){return Ce(this,p,vs).call(this),(()=>{var U;if(this.call)return this.call(O,...w);let P=(U=this.nativeEl)==null?void 0:U[O];return P==null?void 0:P.apply(this.nativeEl,w)})()};else{let w={get(){var P,U,X;Ce(this,p,vs).call(this);let C=O.toLowerCase();if(x.has(C)){let z=this.getAttribute(C);return z===null?!1:z===""?!0:z}return(X=(P=this.get)==null?void 0:P.call(this,O))!=null?X:(U=this.nativeEl)==null?void 0:U[O]}};O!==O.toUpperCase()&&(w.set=function(C){Ce(this,p,vs).call(this);let P=O.toLowerCase();if(x.has(P)){C===!0||C===!1||C==null?this.toggleAttribute(P,!!C):this.setAttribute(P,C);return}if(this.set){this.set(O,C);return}this.nativeEl&&(this.nativeEl[O]=C)}),Object.defineProperty(this.prototype,O,w)}},c=new WeakMap,h=new WeakMap,f=new WeakMap,m=new WeakMap,p=new WeakSet,vs=function(){I(this,c)||(Z(this,c,!0),this.init())},Rm=function(){var C;let x=new Map(I(this,f)),O=(C=this.shadowRoot)==null?void 0:C.querySelector("slot:not([name])");(O==null?void 0:O.assignedElements({flatten:!0}).filter(P=>["track","source"].includes(P.localName))).forEach(P=>{var X,z;x.delete(P);let U=I(this,f).get(P);U||(U=P.cloneNode(),I(this,f).set(P,U),(X=I(this,m))==null||X.observe(P,{attributes:!0})),(z=this.nativeEl)==null||z.append(U),Ce(this,p,Im).call(this,U)}),x.forEach((P,U)=>{P.remove(),I(this,f).delete(U)})},hT=function(x){var O;for(let w of x)if(w.type==="attributes"){let{target:C,attributeName:P}=w,U=I(this,f).get(C);U&&P&&(U.setAttribute(P,(O=C.getAttribute(P))!=null?O:""),Ce(this,p,Im).call(this,U))}},Im=function(x){x&&x.localName==="track"&&x.default&&(x.kind==="chapters"||x.kind==="metadata")&&x.track.mode==="disabled"&&(x.track.mode="hidden")},fT=function(x){if(Object.prototype.hasOwnProperty.call(this,x)){let O=this[x];delete this[x],this[x]=O}},mT=function(x,O,w){var C,P,U;["id","class"].includes(x)||!o.observedAttributes.includes(x)&&this.constructor.observedAttributes.includes(x)||(w===null?(C=this.nativeEl)==null||C.removeAttribute(x):((P=this.nativeEl)==null?void 0:P.getAttribute(x))!==w&&((U=this.nativeEl)==null||U.setAttribute(x,w)))},ie(o,d),Te(o,"getTemplateHTML",e.endsWith("audio")?zL:XL),Te(o,"shadowRootOptions",{mode:"open"}),Te(o,"Events",dT),ie(o,l,!1),o}function QL(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 gT(i){let e="";for(let t in i){if(!uT.includes(t))continue;let r=i[t];r===""?e+=` ${t}`:e+=` ${t}="${r}"`}return e}function ZL(i){let e={};for(let t of i)e[t.name]=t.value;return e}var oT,Xa=pT((oT=globalThis.HTMLElement)!=null?oT:class{},{tag:"video"}),lT,LM=pT((lT=globalThis.HTMLElement)!=null?lT:class{},{tag:"audio"});var TT=i=>{throw TypeError(i)},km=(i,e,t)=>e.has(i)||TT("Cannot "+t),bt=(i,e,t)=>(km(i,e,"read from private field"),t?t.call(i):e.get(i)),ui=(i,e,t)=>e.has(i)?TT("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),Xt=(i,e,t,r)=>(km(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Lm=(i,e,t)=>(km(i,e,"access private method"),t),JL=()=>{try{return"0.26.0"}catch{}return"UNKNOWN"},ek=JL(),tk=()=>ek,ik=`
96
96
  <svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" part="logo" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2" viewBox="0 0 1600 500"><g fill="#fff"><path d="M994.287 93.486c-17.121 0-31-13.879-31-31 0-17.121 13.879-31 31-31 17.121 0 31 13.879 31 31 0 17.121-13.879 31-31 31m0-93.486c-34.509 0-62.484 27.976-62.484 62.486v187.511c0 68.943-56.09 125.033-125.032 125.033s-125.03-56.09-125.03-125.033V62.486C681.741 27.976 653.765 0 619.256 0s-62.484 27.976-62.484 62.486v187.511C556.772 387.85 668.921 500 806.771 500c137.851 0 250.001-112.15 250.001-250.003V62.486c0-34.51-27.976-62.486-62.485-62.486M1537.51 468.511c-17.121 0-31-13.879-31-31 0-17.121 13.879-31 31-31 17.121 0 31 13.879 31 31 0 17.121-13.879 31-31 31m-275.883-218.509-143.33 143.329c-24.402 24.402-24.402 63.966 0 88.368 24.402 24.402 63.967 24.402 88.369 0l143.33-143.329 143.328 143.329c24.402 24.4 63.967 24.402 88.369 0 24.403-24.402 24.403-63.966.001-88.368l-143.33-143.329.001-.004 143.329-143.329c24.402-24.402 24.402-63.965 0-88.367s-63.967-24.402-88.369 0L1349.996 161.63 1206.667 18.302c-24.402-24.401-63.967-24.402-88.369 0s-24.402 63.965 0 88.367l143.329 143.329v.004ZM437.511 468.521c-17.121 0-31-13.879-31-31 0-17.121 13.879-31 31-31 17.121 0 31 13.879 31 31 0 17.121-13.879 31-31 31M461.426 4.759C438.078-4.913 411.2.432 393.33 18.303L249.999 161.632 106.669 18.303C88.798.432 61.922-4.913 38.573 4.759 15.224 14.43-.001 37.214-.001 62.488v375.026c0 34.51 27.977 62.486 62.487 62.486 34.51 0 62.486-27.976 62.486-62.486V213.341l80.843 80.844c24.404 24.402 63.965 24.402 88.369 0l80.843-80.844v224.173c0 34.51 27.976 62.486 62.486 62.486s62.486-27.976 62.486-62.486V62.488c0-25.274-15.224-48.058-38.573-57.729" style="fill-rule:nonzero"/></g></svg>`,D={BEACON_COLLECTION_DOMAIN:"beacon-collection-domain",CUSTOM_DOMAIN:"custom-domain",DEBUG:"debug",DISABLE_TRACKING:"disable-tracking",DISABLE_COOKIES:"disable-cookies",DRM_TOKEN:"drm-token",PLAYBACK_TOKEN:"playback-token",ENV_KEY:"env-key",MAX_RESOLUTION:"max-resolution",MIN_RESOLUTION:"min-resolution",RENDITION_ORDER:"rendition-order",PROGRAM_START_TIME:"program-start-time",PROGRAM_END_TIME:"program-end-time",ASSET_START_TIME:"asset-start-time",ASSET_END_TIME:"asset-end-time",METADATA_URL:"metadata-url",PLAYBACK_ID:"playback-id",PLAYER_SOFTWARE_NAME:"player-software-name",PLAYER_SOFTWARE_VERSION:"player-software-version",PLAYER_INIT_TIME:"player-init-time",PREFER_CMCD:"prefer-cmcd",PREFER_PLAYBACK:"prefer-playback",START_TIME:"start-time",STREAM_TYPE:"stream-type",TARGET_LIVE_WINDOW:"target-live-window",LIVE_EDGE_OFFSET:"live-edge-offset",TYPE:"type",LOGO:"logo"},rk=Object.values(D),vT=tk(),ET="mux-video",xi,Qa,Ld,Za,kd,wd,Dd,Cd,Md,Ja,eo,Od,bT=class extends Xa{constructor(){super(),ui(this,eo),ui(this,xi),ui(this,Qa),ui(this,Ld),ui(this,Za,{}),ui(this,kd,{}),ui(this,wd),ui(this,Dd),ui(this,Cd),ui(this,Md),ui(this,Ja,""),Xt(this,Ld,Sd()),this.nativeEl.addEventListener("muxmetadata",i=>{var e;let t=XE(this.nativeEl),r=(e=this.metadata)!=null?e:{};this.metadata={...t,...r},(t==null?void 0:t["com.mux.video.branding"])==="mux-free-plan"&&(Xt(this,Ja,"default"),this.updateLogo())})}static get NAME(){return ET}static get VERSION(){return vT}static get observedAttributes(){var i;return[...rk,...(i=Xa.observedAttributes)!=null?i:[]]}static getLogoHTML(i){return!i||i==="false"?"":i==="default"?ik:`<img part="logo" src="${i}" />`}static getTemplateHTML(i={}){var e;return`
97
97
  ${Xa.getTemplateHTML(i)}
98
98
  <style>
@@ -1837,7 +1837,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1837
1837
  }
1838
1838
  </style>
1839
1839
  <slot name="icon">${mC}</slot>
1840
- `}function gC(){return B("Quality")}var va=class extends Pt{static get observedAttributes(){return[...super.observedAttributes,b.MEDIA_RENDITION_SELECTED,b.MEDIA_RENDITION_UNAVAILABLE,b.MEDIA_HEIGHT]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",B("quality"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:We(this).querySelector("media-rendition-menu")}get mediaRenditionSelected(){return de(this,b.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){ue(this,b.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return ge(this,b.MEDIA_HEIGHT)}set mediaHeight(e){ye(this,b.MEDIA_HEIGHT,e)}};va.getSlotTemplateHTML=pC;va.getTooltipContentHTML=gC;S.customElements.get("media-rendition-menu-button")||S.customElements.define("media-rendition-menu-button",va);var U_=i=>{throw TypeError(i)},Bg=(i,e,t)=>e.has(i)||U_("Cannot "+t),De=(i,e,t)=>(Bg(i,e,"read from private field"),t?t.call(i):e.get(i)),vi=(i,e,t)=>e.has(i)?U_("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),qi=(i,e,t,r)=>(Bg(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),nt=(i,e,t)=>(Bg(i,e,"access private method"),t),eh=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends eh{}globalThis.DocumentFragment=i}var $g=class extends eh{},vC=class extends eh{},EC={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve($g)}},jc,TC=class{constructor(i,e={}){vi(this,jc),qi(this,jc,e==null?void 0:e.detail)}get detail(){return De(this,jc)}initCustomEvent(){}};jc=new WeakMap;function bC(i,e){return new $g}var F_={document:{createElement:bC},DocumentFragment,customElements:EC,CustomEvent:TC,EventTarget:eh,HTMLElement:$g,HTMLVideoElement:vC},B_=typeof window=="undefined"||typeof globalThis.customElements=="undefined",Yi=B_?F_:globalThis,Hg=B_?F_.document:globalThis.document;function yC(i){let e="";return Object.entries(i).forEach(([t,r])=>{r!=null&&(e+=`${Pg(t)}: ${r}; `)}),e?e.trim():void 0}function Pg(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function $_(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Wt(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function H_(i){let e=_C(i).toString();return e?"?"+e:""}function _C(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var G_=(i,e)=>!i||!e?!1:i.contains(e)?!0:G_(i,e.getRootNode().host),K_="mux.com",AC=()=>{try{return"3.4.1"}catch{}return"UNKNOWN"},SC=AC(),V_=()=>SC,xC=(i,{token:e,customDomain:t=K_,thumbnailTime:r,programTime:s}={})=>{var n;let a=e==null?r:void 0,{aud:o}=(n=Sr(e))!=null?n:{};if(!(e&&o!=="t"))return`https://image.${t}/${i}/thumbnail.webp${H_({token:e,time:a,program_time:s})}`},RC=(i,{token:e,customDomain:t=K_,programStartTime:r,programEndTime:s}={})=>{var n;let{aud:a}=(n=Sr(e))!=null?n:{};if(!(e&&a!=="s"))return`https://image.${t}/${i}/storyboard.vtt${H_({token:e,format:"webp",program_start_time:r,program_end_time:s})}`},Gg=i=>{if(i){if([Se.LIVE,Se.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return Se.LIVE}},IC={crossorigin:"crossOrigin",playsinline:"playsInline"};function LC(i){var e;return(e=IC[i])!=null?e:$_(i)}var Ea,Ta,Nt,kC=class{constructor(i,e){vi(this,Ea),vi(this,Ta),vi(this,Nt,[]),qi(this,Ea,i),qi(this,Ta,e)}[Symbol.iterator](){return De(this,Nt).values()}get length(){return De(this,Nt).length}get value(){var i;return(i=De(this,Nt).join(" "))!=null?i:""}set value(i){var e;i!==this.value&&(qi(this,Nt,[]),this.add(...(e=i==null?void 0:i.split(" "))!=null?e:[]))}toString(){return this.value}item(i){return De(this,Nt)[i]}values(){return De(this,Nt).values()}keys(){return De(this,Nt).keys()}forEach(i){De(this,Nt).forEach(i)}add(...i){var e,t;i.forEach(r=>{this.contains(r)||De(this,Nt).push(r)}),!(this.value===""&&!((e=De(this,Ea))!=null&&e.hasAttribute(`${De(this,Ta)}`)))&&((t=De(this,Ea))==null||t.setAttribute(`${De(this,Ta)}`,`${this.value}`))}remove(...i){var e;i.forEach(t=>{De(this,Nt).splice(De(this,Nt).indexOf(t),1)}),(e=De(this,Ea))==null||e.setAttribute(`${De(this,Ta)}`,`${this.value}`)}contains(i){return De(this,Nt).includes(i)}toggle(i,e){return typeof e!="undefined"?e?(this.add(i),!0):(this.remove(i),!1):this.contains(i)?(this.remove(i),!1):(this.add(i),!0)}replace(i,e){this.remove(i),this.add(e)}};Ea=new WeakMap,Ta=new WeakMap,Nt=new WeakMap;var W_=`[mux-player ${V_()}]`;function vr(...i){console.warn(W_,...i)}function ei(...i){console.error(W_,...i)}function Y_(i){var e;let t=(e=i.message)!=null?e:"";i.context&&(t+=` ${i.context}`),i.file&&(t+=` ${Q("Read more: ")}
1840
+ `}function gC(){return B("Quality")}var va=class extends Pt{static get observedAttributes(){return[...super.observedAttributes,b.MEDIA_RENDITION_SELECTED,b.MEDIA_RENDITION_UNAVAILABLE,b.MEDIA_HEIGHT]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",B("quality"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:We(this).querySelector("media-rendition-menu")}get mediaRenditionSelected(){return de(this,b.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){ue(this,b.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return ge(this,b.MEDIA_HEIGHT)}set mediaHeight(e){ye(this,b.MEDIA_HEIGHT,e)}};va.getSlotTemplateHTML=pC;va.getTooltipContentHTML=gC;S.customElements.get("media-rendition-menu-button")||S.customElements.define("media-rendition-menu-button",va);var U_=i=>{throw TypeError(i)},Bg=(i,e,t)=>e.has(i)||U_("Cannot "+t),De=(i,e,t)=>(Bg(i,e,"read from private field"),t?t.call(i):e.get(i)),vi=(i,e,t)=>e.has(i)?U_("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),qi=(i,e,t,r)=>(Bg(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),nt=(i,e,t)=>(Bg(i,e,"access private method"),t),eh=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends eh{}globalThis.DocumentFragment=i}var $g=class extends eh{},vC=class extends eh{},EC={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve($g)}},jc,TC=class{constructor(i,e={}){vi(this,jc),qi(this,jc,e==null?void 0:e.detail)}get detail(){return De(this,jc)}initCustomEvent(){}};jc=new WeakMap;function bC(i,e){return new $g}var F_={document:{createElement:bC},DocumentFragment,customElements:EC,CustomEvent:TC,EventTarget:eh,HTMLElement:$g,HTMLVideoElement:vC},B_=typeof window=="undefined"||typeof globalThis.customElements=="undefined",Yi=B_?F_:globalThis,Hg=B_?F_.document:globalThis.document;function yC(i){let e="";return Object.entries(i).forEach(([t,r])=>{r!=null&&(e+=`${Pg(t)}: ${r}; `)}),e?e.trim():void 0}function Pg(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function $_(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Wt(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function H_(i){let e=_C(i).toString();return e?"?"+e:""}function _C(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var G_=(i,e)=>!i||!e?!1:i.contains(e)?!0:G_(i,e.getRootNode().host),K_="mux.com",AC=()=>{try{return"3.5.0"}catch{}return"UNKNOWN"},SC=AC(),V_=()=>SC,xC=(i,{token:e,customDomain:t=K_,thumbnailTime:r,programTime:s}={})=>{var n;let a=e==null?r:void 0,{aud:o}=(n=Sr(e))!=null?n:{};if(!(e&&o!=="t"))return`https://image.${t}/${i}/thumbnail.webp${H_({token:e,time:a,program_time:s})}`},RC=(i,{token:e,customDomain:t=K_,programStartTime:r,programEndTime:s}={})=>{var n;let{aud:a}=(n=Sr(e))!=null?n:{};if(!(e&&a!=="s"))return`https://image.${t}/${i}/storyboard.vtt${H_({token:e,format:"webp",program_start_time:r,program_end_time:s})}`},Gg=i=>{if(i){if([Se.LIVE,Se.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return Se.LIVE}},IC={crossorigin:"crossOrigin",playsinline:"playsInline"};function LC(i){var e;return(e=IC[i])!=null?e:$_(i)}var Ea,Ta,Nt,kC=class{constructor(i,e){vi(this,Ea),vi(this,Ta),vi(this,Nt,[]),qi(this,Ea,i),qi(this,Ta,e)}[Symbol.iterator](){return De(this,Nt).values()}get length(){return De(this,Nt).length}get value(){var i;return(i=De(this,Nt).join(" "))!=null?i:""}set value(i){var e;i!==this.value&&(qi(this,Nt,[]),this.add(...(e=i==null?void 0:i.split(" "))!=null?e:[]))}toString(){return this.value}item(i){return De(this,Nt)[i]}values(){return De(this,Nt).values()}keys(){return De(this,Nt).keys()}forEach(i){De(this,Nt).forEach(i)}add(...i){var e,t;i.forEach(r=>{this.contains(r)||De(this,Nt).push(r)}),!(this.value===""&&!((e=De(this,Ea))!=null&&e.hasAttribute(`${De(this,Ta)}`)))&&((t=De(this,Ea))==null||t.setAttribute(`${De(this,Ta)}`,`${this.value}`))}remove(...i){var e;i.forEach(t=>{De(this,Nt).splice(De(this,Nt).indexOf(t),1)}),(e=De(this,Ea))==null||e.setAttribute(`${De(this,Ta)}`,`${this.value}`)}contains(i){return De(this,Nt).includes(i)}toggle(i,e){return typeof e!="undefined"?e?(this.add(i),!0):(this.remove(i),!1):this.contains(i)?(this.remove(i),!1):(this.add(i),!0)}replace(i,e){this.remove(i),this.add(e)}};Ea=new WeakMap,Ta=new WeakMap,Nt=new WeakMap;var W_=`[mux-player ${V_()}]`;function vr(...i){console.warn(W_,...i)}function ei(...i){console.error(W_,...i)}function Y_(i){var e;let t=(e=i.message)!=null?e:"";i.context&&(t+=` ${i.context}`),i.file&&(t+=` ${Q("Read more: ")}
1841
1841
  https://github.com/muxinc/elements/blob/main/errors/${i.file}`),vr(t)}var _t={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},rs={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},R8={..._t,...rs},__=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}}),wC=Object.values(_t).filter(i=>_t.PLAYSINLINE!==i),DC=Object.values(rs),CC=[...wC,...DC],MC=class extends Yi.HTMLElement{static get observedAttributes(){return CC}constructor(){super()}attributeChangedCallback(i,e,t){var r,s;switch(i){case rs.MUTED:{this.media&&(this.media.muted=t!=null,this.media.defaultMuted=t!=null);return}case rs.VOLUME:{let n=(r=Wt(t))!=null?r:1;this.media&&(this.media.volume=n);return}case rs.PLAYBACKRATE:{let n=(s=Wt(t))!=null?s:1;this.media&&(this.media.playbackRate=n,this.media.defaultPlaybackRate=n);return}}}play(){var i,e;return(e=(i=this.media)==null?void 0:i.play())!=null?e:Promise.reject()}pause(){var i;(i=this.media)==null||i.pause()}load(){var i;(i=this.media)==null||i.load()}get media(){var i;return(i=this.shadowRoot)==null?void 0:i.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 i,e;return(e=(i=this.media)==null?void 0:i.paused)!=null?e:!0}get duration(){var i,e;return(e=(i=this.media)==null?void 0:i.duration)!=null?e:NaN}get ended(){var i,e;return(e=(i=this.media)==null?void 0:i.ended)!=null?e:!1}get buffered(){var i,e;return(e=(i=this.media)==null?void 0:i.buffered)!=null?e:__}get seekable(){var i,e;return(e=(i=this.media)==null?void 0:i.seekable)!=null?e:__}get readyState(){var i,e;return(e=(i=this.media)==null?void 0:i.readyState)!=null?e:0}get videoWidth(){var i,e;return(e=(i=this.media)==null?void 0:i.videoWidth)!=null?e:0}get videoHeight(){var i,e;return(e=(i=this.media)==null?void 0:i.videoHeight)!=null?e:0}get currentSrc(){var i,e;return(e=(i=this.media)==null?void 0:i.currentSrc)!=null?e:""}get currentTime(){var i,e;return(e=(i=this.media)==null?void 0:i.currentTime)!=null?e:0}set currentTime(i){this.media&&(this.media.currentTime=Number(i))}get volume(){var i,e;return(e=(i=this.media)==null?void 0:i.volume)!=null?e:1}set volume(i){this.media&&(this.media.volume=Number(i))}get playbackRate(){var i,e;return(e=(i=this.media)==null?void 0:i.playbackRate)!=null?e:1}set playbackRate(i){this.media&&(this.media.playbackRate=Number(i))}get defaultPlaybackRate(){var i;return(i=Wt(this.getAttribute(rs.PLAYBACKRATE)))!=null?i:1}set defaultPlaybackRate(i){i!=null?this.setAttribute(rs.PLAYBACKRATE,`${i}`):this.removeAttribute(rs.PLAYBACKRATE)}get crossOrigin(){return hl(this,_t.CROSSORIGIN)}set crossOrigin(i){this.setAttribute(_t.CROSSORIGIN,`${i}`)}get autoplay(){return hl(this,_t.AUTOPLAY)!=null}set autoplay(i){i?this.setAttribute(_t.AUTOPLAY,typeof i=="string"?i:""):this.removeAttribute(_t.AUTOPLAY)}get loop(){return hl(this,_t.LOOP)!=null}set loop(i){i?this.setAttribute(_t.LOOP,""):this.removeAttribute(_t.LOOP)}get muted(){var i,e;return(e=(i=this.media)==null?void 0:i.muted)!=null?e:!1}set muted(i){this.media&&(this.media.muted=!!i)}get defaultMuted(){return hl(this,_t.MUTED)!=null}set defaultMuted(i){i?this.setAttribute(_t.MUTED,""):this.removeAttribute(_t.MUTED)}get playsInline(){return hl(this,_t.PLAYSINLINE)!=null}set playsInline(i){ei("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(i){["","none","metadata","auto"].includes(i)?this.setAttribute(_t.PRELOAD,i):this.removeAttribute(_t.PRELOAD)}};function hl(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var A_=MC,OC=`:host {
1842
1842
  --media-control-display: var(--controls);
1843
1843
  --media-loading-indicator-display: var(--loading-indicator);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mux/mux-player",
3
- "version": "3.4.2-canary.9",
3
+ "version": "3.5.0",
4
4
  "description": "An open source Mux player web component that Just Works™",
5
5
  "homepage": "https://mux.com/player",
6
6
  "keywords": [
@@ -125,8 +125,8 @@
125
125
  "build": "npm-run-all 'build:esm:base -- --minify' 'build:cjs:base -- --minify' 'build:esm:ads:mixin -- --minify' 'build:cjs:ads:mixin -- --minify' --parallel 'build:esm:** -- --minify' 'build:iife:** -- --minify' 'build:cjs:** -- --minify' 'build:esm-module:** -- --minify' 'build:themes'"
126
126
  },
127
127
  "dependencies": {
128
- "@mux/mux-video": "0.25.3",
129
- "@mux/playback-core": "0.29.1",
128
+ "@mux/mux-video": "0.26.0",
129
+ "@mux/playback-core": "0.30.0",
130
130
  "media-chrome": "~4.11.1",
131
131
  "player.style": "^0.1.9"
132
132
  },