@mux/mux-player 3.11.4 → 3.11.5

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
@@ -1399,7 +1399,7 @@
1399
1399
  <path d="m10 15.17 9.193-9.191 1.414 1.414-10.606 10.606-6.364-6.364 1.414-1.414 4.95 4.95Z"/>
1400
1400
  </svg>
1401
1401
  </div>
1402
- `}function tv(){return h("Loop")}var wr=class extends H{constructor(){super(...arguments),this.container=null}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_LOOP]}connectedCallback(){var e;super.connectedCallback(),this.container=((e=this.shadowRoot)==null?void 0:e.querySelector("#icon"))||null,this.container&&(this.container.textContent=h("Loop"))}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_LOOP&&this.container&&this.setAttribute("aria-checked",this.mediaLoop?"true":"false")}get mediaLoop(){return k(this,n.MEDIA_LOOP)}set mediaLoop(e){S(this,n.MEDIA_LOOP,e)}handleClick(){let e=!this.mediaLoop,i=new l.CustomEvent(m.MEDIA_LOOP_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)}};wr.getSlotTemplateHTML=ev;wr.getTooltipContentHTML=tv;l.customElements.get("media-loop-button")||l.customElements.define("media-loop-button",wr);var g=require("@mux/mux-video/base"),D=require("@mux/playback-core");var am=require("@mux/playback-core");var mi=require("@mux/playback-core");function Jc(t){let e="";return Object.entries(t).forEach(([i,a])=>{a!=null&&(e+=`${On(i)}: ${a}; `)}),e?e.trim():void 0}function On(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Pn(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function ce(t){if(t==null)return;let e=+t;return Number.isNaN(e)?void 0:e}function Hl(t){let e=iv(t).toString();return e?"?"+e:""}function iv(t){let e={};for(let i in t)t[i]!=null&&(e[i]=t[i]);return new URLSearchParams(e)}var Bl=(t,e)=>!t||!e?!1:t.contains(e)?!0:Bl(t,e.getRootNode().host);var jc="mux.com",av=()=>{try{return"3.11.4"}catch{}return"UNKNOWN"},rv=av(),Un=()=>rv,em=(t,{token:e,customDomain:i=jc,thumbnailTime:a,programTime:r}={})=>{var d;let o=e==null?a:void 0,{aud:s}=(d=(0,mi.parseJwt)(e))!=null?d:{};if(!(e&&s!=="t"))return`https://image.${i}/${t}/thumbnail.webp${Hl({token:e,time:o,program_time:r})}`},tm=(t,{token:e,customDomain:i=jc,programStartTime:a,programEndTime:r}={})=>{var s;let{aud:o}=(s=(0,mi.parseJwt)(e))!=null?s:{};if(!(e&&o!=="s"))return`https://image.${i}/${t}/storyboard.vtt${Hl({token:e,format:"webp",program_start_time:a,program_end_time:r})}`},Rr=t=>{if(t){if([mi.StreamTypes.LIVE,mi.StreamTypes.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return mi.StreamTypes.LIVE}};var ov={crossorigin:"crossOrigin",playsinline:"playsInline"};function im(t){var e;return(e=ov[t])!=null?e:Pn(t)}var ui,ci,me,Nn=class{constructor(e,i){fe(this,ui);fe(this,ci);fe(this,me,[]);ye(this,ui,e),ye(this,ci,i)}[Symbol.iterator](){return B(this,me).values()}get length(){return B(this,me).length}get value(){var e;return(e=B(this,me).join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(ye(this,me,[]),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return B(this,me)[e]}values(){return B(this,me).values()}keys(){return B(this,me).keys()}forEach(e){B(this,me).forEach(e)}add(...e){var i,a;e.forEach(r=>{this.contains(r)||B(this,me).push(r)}),!(this.value===""&&!((i=B(this,ui))!=null&&i.hasAttribute(`${B(this,ci)}`)))&&((a=B(this,ui))==null||a.setAttribute(`${B(this,ci)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>{B(this,me).splice(B(this,me).indexOf(a),1)}),(i=B(this,ui))==null||i.setAttribute(`${B(this,ci)}`,`${this.value}`)}contains(e){return B(this,me).includes(e)}toggle(e,i){return typeof i!="undefined"?i?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,i){this.remove(e),this.add(i)}};ui=new WeakMap,ci=new WeakMap,me=new WeakMap;var rm=`[mux-player ${Un()}]`;function at(...t){console.warn(rm,...t)}function he(...t){console.error(rm,...t)}function $l(t){var i;let e=(i=t.message)!=null?i:"";t.context&&(e+=` ${t.context}`),t.file&&(e+=` ${(0,am.i18n)("Read more: ")}
1402
+ `}function tv(){return h("Loop")}var wr=class extends H{constructor(){super(...arguments),this.container=null}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_LOOP]}connectedCallback(){var e;super.connectedCallback(),this.container=((e=this.shadowRoot)==null?void 0:e.querySelector("#icon"))||null,this.container&&(this.container.textContent=h("Loop"))}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_LOOP&&this.container&&this.setAttribute("aria-checked",this.mediaLoop?"true":"false")}get mediaLoop(){return k(this,n.MEDIA_LOOP)}set mediaLoop(e){S(this,n.MEDIA_LOOP,e)}handleClick(){let e=!this.mediaLoop,i=new l.CustomEvent(m.MEDIA_LOOP_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)}};wr.getSlotTemplateHTML=ev;wr.getTooltipContentHTML=tv;l.customElements.get("media-loop-button")||l.customElements.define("media-loop-button",wr);var g=require("@mux/mux-video/base"),D=require("@mux/playback-core");var am=require("@mux/playback-core");var mi=require("@mux/playback-core");function Jc(t){let e="";return Object.entries(t).forEach(([i,a])=>{a!=null&&(e+=`${On(i)}: ${a}; `)}),e?e.trim():void 0}function On(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Pn(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function ce(t){if(t==null)return;let e=+t;return Number.isNaN(e)?void 0:e}function Hl(t){let e=iv(t).toString();return e?"?"+e:""}function iv(t){let e={};for(let i in t)t[i]!=null&&(e[i]=t[i]);return new URLSearchParams(e)}var Bl=(t,e)=>!t||!e?!1:t.contains(e)?!0:Bl(t,e.getRootNode().host);var jc="mux.com",av=()=>{try{return"3.11.5"}catch{}return"UNKNOWN"},rv=av(),Un=()=>rv,em=(t,{token:e,customDomain:i=jc,thumbnailTime:a,programTime:r}={})=>{var d;let o=e==null?a:void 0,{aud:s}=(d=(0,mi.parseJwt)(e))!=null?d:{};if(!(e&&s!=="t"))return`https://image.${i}/${t}/thumbnail.webp${Hl({token:e,time:o,program_time:r})}`},tm=(t,{token:e,customDomain:i=jc,programStartTime:a,programEndTime:r}={})=>{var s;let{aud:o}=(s=(0,mi.parseJwt)(e))!=null?s:{};if(!(e&&o!=="s"))return`https://image.${i}/${t}/storyboard.vtt${Hl({token:e,format:"webp",program_start_time:a,program_end_time:r})}`},Rr=t=>{if(t){if([mi.StreamTypes.LIVE,mi.StreamTypes.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return mi.StreamTypes.LIVE}};var ov={crossorigin:"crossOrigin",playsinline:"playsInline"};function im(t){var e;return(e=ov[t])!=null?e:Pn(t)}var ui,ci,me,Nn=class{constructor(e,i){fe(this,ui);fe(this,ci);fe(this,me,[]);ye(this,ui,e),ye(this,ci,i)}[Symbol.iterator](){return B(this,me).values()}get length(){return B(this,me).length}get value(){var e;return(e=B(this,me).join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(ye(this,me,[]),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return B(this,me)[e]}values(){return B(this,me).values()}keys(){return B(this,me).keys()}forEach(e){B(this,me).forEach(e)}add(...e){var i,a;e.forEach(r=>{this.contains(r)||B(this,me).push(r)}),!(this.value===""&&!((i=B(this,ui))!=null&&i.hasAttribute(`${B(this,ci)}`)))&&((a=B(this,ui))==null||a.setAttribute(`${B(this,ci)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>{B(this,me).splice(B(this,me).indexOf(a),1)}),(i=B(this,ui))==null||i.setAttribute(`${B(this,ci)}`,`${this.value}`)}contains(e){return B(this,me).includes(e)}toggle(e,i){return typeof i!="undefined"?i?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,i){this.remove(e),this.add(i)}};ui=new WeakMap,ci=new WeakMap,me=new WeakMap;var rm=`[mux-player ${Un()}]`;function at(...t){console.warn(rm,...t)}function he(...t){console.error(rm,...t)}function $l(t){var i;let e=(i=t.message)!=null?i:"";t.context&&(e+=` ${t.context}`),t.file&&(e+=` ${(0,am.i18n)("Read more: ")}
1403
1403
  https://github.com/muxinc/elements/blob/main/errors/${t.file}`),at(e)}var le={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},Pt={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},lA={...le,...Pt},nm=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}}),nv=Object.values(le).filter(t=>le.PLAYSINLINE!==t),sv=Object.values(Pt),lv=[...nv,...sv],Wl=class extends ke.HTMLElement{static get observedAttributes(){return lv}constructor(){super()}attributeChangedCallback(e,i,a){var r,o;switch(e){case Pt.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case Pt.VOLUME:{let s=(r=ce(a))!=null?r:1;this.media&&(this.media.volume=s);return}case Pt.PLAYBACKRATE:{let s=(o=ce(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:nm}get seekable(){var e,i;return(i=(e=this.media)==null?void 0:e.seekable)!=null?i:nm}get readyState(){var e,i;return(i=(e=this.media)==null?void 0:e.readyState)!=null?i:0}get videoWidth(){var e,i;return(i=(e=this.media)==null?void 0:e.videoWidth)!=null?i:0}get videoHeight(){var e,i;return(i=(e=this.media)==null?void 0:e.videoHeight)!=null?i:0}get currentSrc(){var e,i;return(i=(e=this.media)==null?void 0:e.currentSrc)!=null?i:""}get currentTime(){var e,i;return(i=(e=this.media)==null?void 0:e.currentTime)!=null?i:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,i;return(i=(e=this.media)==null?void 0:e.volume)!=null?i:1}set volume(e){this.media&&(this.media.volume=Number(e))}get playbackRate(){var e,i;return(i=(e=this.media)==null?void 0:e.playbackRate)!=null?i:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get defaultPlaybackRate(){var e;return(e=ce(this.getAttribute(Pt.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(Pt.PLAYBACKRATE,`${e}`):this.removeAttribute(Pt.PLAYBACKRATE)}get crossOrigin(){return xr(this,le.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(le.CROSSORIGIN,`${e}`)}get autoplay(){return xr(this,le.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(le.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(le.AUTOPLAY)}get loop(){return xr(this,le.LOOP)!=null}set loop(e){e?this.setAttribute(le.LOOP,""):this.removeAttribute(le.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 xr(this,le.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(le.MUTED,""):this.removeAttribute(le.MUTED)}get playsInline(){return xr(this,le.PLAYSINLINE)!=null}set playsInline(e){he("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(le.PRELOAD,e):this.removeAttribute(le.PRELOAD)}};function xr(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var Fl=Wl;var cm=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},P=(t,e,i)=>(cm(t,e,"read from private field"),i?i.call(t):e.get(t)),rt=(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)},gt=(t,e,i,a)=>(cm(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ra,Hn,hi,Dr,Nt,Ut,Ht,pi,oa,Bn,$e,sm=1,lm=0,dv=1,uv={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 pe&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=o:typeof o=="function"&&r instanceof pe?r.element[r.attributeName]=o:r.value=o}}}},_t=class extends l.DocumentFragment{constructor(e,i,a=uv){var r;super(),rt(this,ra,void 0),rt(this,Hn,void 0),this.append(e.content.cloneNode(!0)),gt(this,ra,mm(this)),gt(this,Hn,a),(r=a.createCallback)==null||r.call(a,this,P(this,ra),i),a.processCallback(this,P(this,ra),i)}update(e){P(this,Hn).processCallback(this,P(this,ra),e)}};ra=new WeakMap;Hn=new WeakMap;var mm=(t,e=[])=>{let i,a;for(let r of t.attributes||[])if(r.value.includes("{{")){let o=new Vl;for([i,a]of um(r.value))if(!i)o.append(a);else{let s=new pe(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===sm&&!(r instanceof HTMLTemplateElement))mm(r,e);else{let o=r.data;if(r.nodeType===sm||o.includes("{{")){let s=[];if(o)for([i,a]of um(o))if(!i)s.push(new Text(a));else{let d=new At(t);s.push(d),e.push([a,d])}else if(r instanceof HTMLTemplateElement){let d=new Or(t,r);s.push(d),e.push([d.expression,d])}r.replaceWith(...s.flatMap(d=>d.replacementNodes||[d]))}}return e},dm={},um=t=>{let e="",i=0,a=dm[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([lm,e]),e="",r++):o==="}"&&t[r+1]==="}"&&t[r-1]!=="\\"&&!--i?(a.push([dv,e.trim()]),e="",r++):e+=o||"";return e&&a.push([lm,(i>0?"{{":"")+e]),dm[t]=a},cv=11,$n=class{get value(){return""}set value(e){}toString(){return this.value}},hm=new WeakMap,Vl=class{constructor(){rt(this,hi,[])}[Symbol.iterator](){return P(this,hi).values()}get length(){return P(this,hi).length}item(e){return P(this,hi)[e]}append(...e){for(let i of e)i instanceof pe&&hm.set(i,this),P(this,hi).push(i)}toString(){return P(this,hi).join("")}};hi=new WeakMap;var pe=class extends $n{constructor(e,i,a){super(),rt(this,pi),rt(this,Dr,""),rt(this,Nt,void 0),rt(this,Ut,void 0),rt(this,Ht,void 0),gt(this,Nt,e),gt(this,Ut,i),gt(this,Ht,a)}get attributeName(){return P(this,Ut)}get attributeNamespace(){return P(this,Ht)}get element(){return P(this,Nt)}get value(){return P(this,Dr)}set value(e){P(this,Dr)!==e&&(gt(this,Dr,e),!P(this,pi,oa)||P(this,pi,oa).length===1?e==null?P(this,Nt).removeAttributeNS(P(this,Ht),P(this,Ut)):P(this,Nt).setAttributeNS(P(this,Ht),P(this,Ut),e):P(this,Nt).setAttributeNS(P(this,Ht),P(this,Ut),P(this,pi,oa).toString()))}get booleanValue(){return P(this,Nt).hasAttributeNS(P(this,Ht),P(this,Ut))}set booleanValue(e){if(!P(this,pi,oa)||P(this,pi,oa).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};Dr=new WeakMap;Nt=new WeakMap;Ut=new WeakMap;Ht=new WeakMap;pi=new WeakSet;oa=function(){return hm.get(this)};var At=class extends $n{constructor(e,i){super(),rt(this,Bn,void 0),rt(this,$e,void 0),gt(this,Bn,e),gt(this,$e,i?[...i]:[new Text])}get replacementNodes(){return P(this,$e)}get parentNode(){return P(this,Bn)}get nextSibling(){return P(this,$e)[P(this,$e).length-1].nextSibling}get previousSibling(){return P(this,$e)[0].previousSibling}get value(){return P(this,$e).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===cv?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);i.length||i.push(new Text),gt(this,$e,mv(P(this,$e)[0].parentNode,P(this,$e),i,this.nextSibling))}};Bn=new WeakMap;$e=new WeakMap;var Or=class extends At{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 mv(t,e,i,a=null){let r=0,o,s,d,u=i.length,p=e.length;for(;r<u&&r<p&&e[r]==i[r];)r++;for(;r<u&&r<p&&i[u-1]==e[p-1];)a=i[--p,--u];if(r==p)for(;r<u;)t.insertBefore(i[r++],a);if(r==u)for(;r<p;)t.removeChild(e[r++]);else{for(o=e[r];r<u;)d=i[r++],s=o?o.nextSibling:a,o==d?o=s:r<u&&i[r]==s?(t.replaceChild(d,o),o=s):t.insertBefore(d,o);for(;o!=a;)s=o.nextSibling,t.removeChild(o),o=s}return i}var pm={string:t=>String(t)},Fn=class{constructor(e){this.template=e,this.state=void 0}},fi=new WeakMap,vi=new WeakMap,Kl={partial:(t,e)=>{e[t.expression]=new Fn(t.template)},if:(t,e)=>{var i;if(vm(t.expression,e))if(fi.get(t)!==t.template){fi.set(t,t.template);let a=new _t(t.template,e,Vn);t.replace(a),vi.set(t,a)}else(i=vi.get(t))==null||i.update(e);else t.replace(""),fi.delete(t),vi.delete(t)}},hv=Object.keys(Kl),Vn={processCallback(t,e,i){var a,r;if(i)for(let[o,s]of e){if(s instanceof Or){if(!s.directive){let u=hv.find(p=>s.template.hasAttribute(p));u&&(s.directive=u,s.expression=s.template.getAttribute(u))}(a=Kl[s.directive])==null||a.call(Kl,s,i);continue}let d=vm(o,i);if(d instanceof Fn){fi.get(s)!==d.template?(fi.set(s,d.template),d=new _t(d.template,d.state,Vn),s.value=d,vi.set(s,d)):(r=vi.get(s))==null||r.update(d.state);continue}d?(s instanceof pe&&s.attributeName.startsWith("aria-")&&(d=String(d)),s instanceof pe?typeof d=="boolean"?s.booleanValue=d:typeof d=="function"?s.element[s.attributeName]=d:s.value=d:(s.value=d,fi.delete(s),vi.delete(s))):s instanceof pe?s.value=void 0:(s.value=void 0,fi.delete(s),vi.delete(s))}}},fm={"!":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=pm[e])==null?void 0:i.call(pm,t)}};function pv(t){return fv(t,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function vm(t,e={}){var i,a,r,o,s,d,u;let p=pv(t);if(p.length===0||p.some(({type:T})=>!T))return Pr(t);if(((i=p[0])==null?void 0:i.token)===">"){let T=e[(a=p[1])==null?void 0:a.token];if(!T)return Pr(t);let _={...e};T.state=_;let E=p.slice(2);for(let f=0;f<E.length;f+=3){let M=(r=E[f])==null?void 0:r.token,b=(o=E[f+1])==null?void 0:o.token,C=(s=E[f+2])==null?void 0:s.token;M&&b==="="&&(_[M]=Nr(C,e))}return T}if(p.length===1)return Wn(p[0])?Nr(p[0].token,e):Pr(t);if(p.length===2){let T=(d=p[0])==null?void 0:d.token,_=fm[T];if(!_||!Wn(p[1]))return Pr(t);let E=Nr(p[1].token,e);return _(E)}if(p.length===3){let T=(u=p[1])==null?void 0:u.token,_=fm[T];if(!_||!Wn(p[0])||!Wn(p[2]))return Pr(t);let E=Nr(p[0].token,e);if(T==="|")return _(E,p[2].token);let f=Nr(p[2].token,e);return _(E,f)}}function Pr(t){return console.warn(`Warning: invalid expression \`${t}\``),!1}function Wn({type:t}){return["number","boolean","string","param"].includes(t)}function Nr(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):mo(t)?parseFloat(t):e[t]}function fv(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 Ql=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ql=(t,e,i)=>(Ql(t,e,"read from private field"),i?i.call(t):e.get(t)),Ur=(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)},Ei=(t,e,i,a)=>(Ql(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Gl=(t,e,i)=>(Ql(t,e,"access private method"),i),na,Kn,sa,Zl,Em,Gn,zl,Yl={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},bm=V.createElement("template");bm.innerHTML=`
1404
1404
  <style>
1405
1405
  :host {
package/dist/base.mjs CHANGED
@@ -1,4 +1,4 @@
1
- var tt=t=>{throw TypeError(t)};var he=(t,a,e)=>a.has(t)||tt("Cannot "+e);var u=(t,a,e)=>(he(t,a,"read from private field"),e?e.call(t):a.get(t)),v=(t,a,e)=>a.has(t)?tt("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 F=class{addEventListener(){}removeEventListener(){}dispatchEvent(a){return!0}};if(typeof DocumentFragment=="undefined"){class t extends F{}globalThis.DocumentFragment=t}var G=class extends F{},ge=class extends F{},Bt={get(t){},define(t,a,e){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(G)}},j,fe=class{constructor(a,e={}){v(this,j);C(this,j,e==null?void 0:e.detail)}get detail(){return u(this,j)}initCustomEvent(){}};j=new WeakMap;function Ht(t,a){return new G}var at={document:{createElement:Ht},DocumentFragment,customElements:Bt,CustomEvent:fe,EventTarget:F,HTMLElement:G,HTMLVideoElement:ge},it=typeof window=="undefined"||typeof globalThis.customElements=="undefined",k=it?at:globalThis,w=it?at.document:globalThis.document;import{MediaController as fa,MediaErrorDialog as It}from"media-chrome";import{Attributes as Oe}from"media-chrome/dist/media-container.js";import{MediaStateChangeEvents as Rt,MediaUIAttributes as ce,MediaUIEvents as xt}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 ya,removeTextTrack as Ta,CmcdTypeValues as Ot,i18n as B,parseJwt as Le,MuxJWTAud as Me,generatePlayerInitTime as Ea}from"@mux/playback-core";import{i18n as Wt}from"@mux/playback-core";import{StreamTypes as Ee,parseJwt as ot}from"@mux/playback-core";function rt(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=Kt(t).toString();return a?"?"+a:""}function Kt(t){let a={};for(let e in t)t[e]!=null&&(a[e]=t[e]);return new URLSearchParams(a)}var Te=(t,a)=>!t||!a?!1:t.contains(a)?!0:Te(t,a.getRootNode().host);var nt="mux.com",$t=()=>{try{return"3.11.4"}catch{}return"UNKNOWN"},Ft=$t(),se=()=>Ft,st=(t,{token:a,customDomain:e=nt,thumbnailTime:i,programTime:r}={})=>{var l;let n=a==null?i:void 0,{aud:d}=(l=ot(a))!=null?l:{};if(!(a&&d!=="t"))return`https://image.${e}/${t}/thumbnail.webp${ye({token:a,time:n,program_time:r})}`},dt=(t,{token:a,customDomain:e=nt,programStartTime:i,programEndTime:r}={})=>{var d;let{aud:n}=(d=ot(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([Ee.LIVE,Ee.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return Ee.LIVE}};var Yt={crossorigin:"crossOrigin",playsinline:"playsInline"};function lt(t){var a;return(a=Yt[t])!=null?a:oe(t)}var D,U,T,ne=class{constructor(a,e){v(this,D);v(this,U);v(this,T,[]);C(this,D,a),C(this,U,e)}[Symbol.iterator](){return u(this,T).values()}get length(){return u(this,T).length}get value(){var a;return(a=u(this,T).join(" "))!=null?a:""}set value(a){var e;a!==this.value&&(C(this,T,[]),this.add(...(e=a==null?void 0:a.split(" "))!=null?e:[]))}toString(){return this.value}item(a){return u(this,T)[a]}values(){return u(this,T).values()}keys(){return u(this,T).keys()}forEach(a){u(this,T).forEach(a)}add(...a){var e,i;a.forEach(r=>{this.contains(r)||u(this,T).push(r)}),!(this.value===""&&!((e=u(this,D))!=null&&e.hasAttribute(`${u(this,U)}`)))&&((i=u(this,D))==null||i.setAttribute(`${u(this,U)}`,`${this.value}`))}remove(...a){var e;a.forEach(i=>{u(this,T).splice(u(this,T).indexOf(i),1)}),(e=u(this,D))==null||e.setAttribute(`${u(this,U)}`,`${this.value}`)}contains(a){return u(this,T).includes(a)}toggle(a,e){return typeof e!="undefined"?e?(this.add(a),!0):(this.remove(a),!1):this.contains(a)?(this.remove(a),!1):(this.add(a),!0)}replace(a,e){this.remove(a),this.add(e)}};D=new WeakMap,U=new WeakMap,T=new WeakMap;var ut=`[mux-player ${se()}]`;function x(...t){console.warn(ut,...t)}function E(...t){console.error(ut,...t)}function ve(t){var e;let a=(e=t.message)!=null?e:"";t.context&&(a+=` ${t.context}`),t.file&&(a+=` ${Wt("Read more: ")}
1
+ var tt=t=>{throw TypeError(t)};var he=(t,a,e)=>a.has(t)||tt("Cannot "+e);var u=(t,a,e)=>(he(t,a,"read from private field"),e?e.call(t):a.get(t)),v=(t,a,e)=>a.has(t)?tt("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 F=class{addEventListener(){}removeEventListener(){}dispatchEvent(a){return!0}};if(typeof DocumentFragment=="undefined"){class t extends F{}globalThis.DocumentFragment=t}var G=class extends F{},ge=class extends F{},Bt={get(t){},define(t,a,e){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(G)}},j,fe=class{constructor(a,e={}){v(this,j);C(this,j,e==null?void 0:e.detail)}get detail(){return u(this,j)}initCustomEvent(){}};j=new WeakMap;function Ht(t,a){return new G}var at={document:{createElement:Ht},DocumentFragment,customElements:Bt,CustomEvent:fe,EventTarget:F,HTMLElement:G,HTMLVideoElement:ge},it=typeof window=="undefined"||typeof globalThis.customElements=="undefined",k=it?at:globalThis,w=it?at.document:globalThis.document;import{MediaController as fa,MediaErrorDialog as It}from"media-chrome";import{Attributes as Oe}from"media-chrome/dist/media-container.js";import{MediaStateChangeEvents as Rt,MediaUIAttributes as ce,MediaUIEvents as xt}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 ya,removeTextTrack as Ta,CmcdTypeValues as Ot,i18n as B,parseJwt as Le,MuxJWTAud as Me,generatePlayerInitTime as Ea}from"@mux/playback-core";import{i18n as Wt}from"@mux/playback-core";import{StreamTypes as Ee,parseJwt as ot}from"@mux/playback-core";function rt(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=Kt(t).toString();return a?"?"+a:""}function Kt(t){let a={};for(let e in t)t[e]!=null&&(a[e]=t[e]);return new URLSearchParams(a)}var Te=(t,a)=>!t||!a?!1:t.contains(a)?!0:Te(t,a.getRootNode().host);var nt="mux.com",$t=()=>{try{return"3.11.5"}catch{}return"UNKNOWN"},Ft=$t(),se=()=>Ft,st=(t,{token:a,customDomain:e=nt,thumbnailTime:i,programTime:r}={})=>{var l;let n=a==null?i:void 0,{aud:d}=(l=ot(a))!=null?l:{};if(!(a&&d!=="t"))return`https://image.${e}/${t}/thumbnail.webp${ye({token:a,time:n,program_time:r})}`},dt=(t,{token:a,customDomain:e=nt,programStartTime:i,programEndTime:r}={})=>{var d;let{aud:n}=(d=ot(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([Ee.LIVE,Ee.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return Ee.LIVE}};var Yt={crossorigin:"crossOrigin",playsinline:"playsInline"};function lt(t){var a;return(a=Yt[t])!=null?a:oe(t)}var D,U,T,ne=class{constructor(a,e){v(this,D);v(this,U);v(this,T,[]);C(this,D,a),C(this,U,e)}[Symbol.iterator](){return u(this,T).values()}get length(){return u(this,T).length}get value(){var a;return(a=u(this,T).join(" "))!=null?a:""}set value(a){var e;a!==this.value&&(C(this,T,[]),this.add(...(e=a==null?void 0:a.split(" "))!=null?e:[]))}toString(){return this.value}item(a){return u(this,T)[a]}values(){return u(this,T).values()}keys(){return u(this,T).keys()}forEach(a){u(this,T).forEach(a)}add(...a){var e,i;a.forEach(r=>{this.contains(r)||u(this,T).push(r)}),!(this.value===""&&!((e=u(this,D))!=null&&e.hasAttribute(`${u(this,U)}`)))&&((i=u(this,D))==null||i.setAttribute(`${u(this,U)}`,`${this.value}`))}remove(...a){var e;a.forEach(i=>{u(this,T).splice(u(this,T).indexOf(i),1)}),(e=u(this,D))==null||e.setAttribute(`${u(this,U)}`,`${this.value}`)}contains(a){return u(this,T).includes(a)}toggle(a,e){return typeof e!="undefined"?e?(this.add(a),!0):(this.remove(a),!1):this.contains(a)?(this.remove(a),!1):(this.add(a),!0)}replace(a,e){this.remove(a),this.add(e)}};D=new WeakMap,U=new WeakMap,T=new WeakMap;var ut=`[mux-player ${se()}]`;function x(...t){console.warn(ut,...t)}function E(...t){console.error(ut,...t)}function ve(t){var e;let a=(e=t.message)!=null?e:"";t.context&&(a+=` ${t.context}`),t.file&&(a+=` ${Wt("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"},$a={...g,...N},ct=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}}),Zt=Object.values(g).filter(t=>g.PLAYSINLINE!==t),Gt=Object.values(N),jt=[...Zt,...Gt],Ae=class extends k.HTMLElement{static get observedAttributes(){return jt}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:ct}get seekable(){var a,e;return(e=(a=this.media)==null?void 0:a.seekable)!=null?e:ct}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 pt=`:host {
3
3
  --media-control-display: var(--controls);
4
4
  --media-loading-indicator-display: var(--loading-indicator);