@mux/mux-player 1.14.0 → 1.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +4 -4
- package/dist/index.mjs +2 -2
- package/dist/mux-player.js +116 -116
- package/dist/mux-player.mjs +116 -116
- package/dist/themes/2023/index.cjs.js +52 -8
- package/dist/themes/2023/index.js +52 -8
- package/dist/themes/2023/index.mjs +52 -8
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -6
package/dist/index.cjs.js
CHANGED
|
@@ -856,7 +856,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
|
|
|
856
856
|
}
|
|
857
857
|
</style>
|
|
858
858
|
<slot></slot>
|
|
859
|
-
`;var Je={VALUE:"value",SELECTED:"selected",DISABLED:"disabled"},qa=class extends l.HTMLElement{constructor(){super(),Gn(this,Za),Gn(this,Ga,!1),Gn(this,Zt,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Ol.content.cloneNode(!0)))}static get observedAttributes(){return[Je.DISABLED,Je.SELECTED,Je.VALUE]}get value(){var e;return(e=this.getAttribute(Je.VALUE))!=null?e:this.text}set value(e){this.setAttribute(Je.VALUE,e)}get text(){var e;return((e=this.textContent)!=null?e:"").trim()}get selected(){return this.getAttribute("aria-selected")==="true"}set selected(e){Zn(this,Ga,!0),this.setAttribute("aria-selected",e?"true":"false"),e?this.part.add("option-selected"):this.part.remove("option-selected")}enable(){this.hasAttribute("tabindex")||this.setAttribute("tabindex",-1),this.hasAttribute("aria-selected")||this.setAttribute("aria-selected","false")}disable(){this.removeAttribute("tabindex")}attributeChangedCallback(e,t,a){e===Je.SELECTED&&!qn(this,Ga)?this.setAttribute("aria-selected",a!=null?"true":"false"):e===Je.DISABLED&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(Je.DISABLED)||this.enable(),this.setAttribute("role","option"),Zn(this,Zt,zn(this,this.parentNode)),xl(this,Za,Qn).call(this)}disconnectedCallback(){this.disable(),xl(this,Za,Qn).call(this),Zn(this,Zt,null)}handleClick(){}};Ga=new WeakMap;Zt=new WeakMap;Za=new WeakSet;Qn=function(){var i;let e=(i=qn(this,Zt))==null?void 0:i.options;if(!e)return;let t=e.filter(a=>a.getAttribute("aria-selected")==="true").pop();t||(t=e[0]),qn(this,Zt).getAttribute("aria-multiselectable")!=="true"&&e.forEach(a=>{a.setAttribute("tabindex","-1"),a.setAttribute("aria-selected","false")}),t==null||t.setAttribute("tabindex","0"),t==null||t.setAttribute("aria-selected","true")};function zn(i,e){if(!i)return null;let{host:t}=i.getRootNode();return!e&&t?zn(i,t):e!=null&&e.options?e:zn(e,e==null?void 0:e.parentNode)}l.customElements.get("media-chrome-option")||l.customElements.define("media-chrome-option",qa);var es=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},
|
|
859
|
+
`;var Je={VALUE:"value",SELECTED:"selected",DISABLED:"disabled"},qa=class extends l.HTMLElement{constructor(){super(),Gn(this,Za),Gn(this,Ga,!1),Gn(this,Zt,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Ol.content.cloneNode(!0)))}static get observedAttributes(){return[Je.DISABLED,Je.SELECTED,Je.VALUE]}get value(){var e;return(e=this.getAttribute(Je.VALUE))!=null?e:this.text}set value(e){this.setAttribute(Je.VALUE,e)}get text(){var e;return((e=this.textContent)!=null?e:"").trim()}get selected(){return this.getAttribute("aria-selected")==="true"}set selected(e){Zn(this,Ga,!0),this.setAttribute("aria-selected",e?"true":"false"),e?this.part.add("option-selected"):this.part.remove("option-selected")}enable(){this.hasAttribute("tabindex")||this.setAttribute("tabindex",-1),this.hasAttribute("aria-selected")||this.setAttribute("aria-selected","false")}disable(){this.removeAttribute("tabindex")}attributeChangedCallback(e,t,a){e===Je.SELECTED&&!qn(this,Ga)?this.setAttribute("aria-selected",a!=null?"true":"false"):e===Je.DISABLED&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(Je.DISABLED)||this.enable(),this.setAttribute("role","option"),Zn(this,Zt,zn(this,this.parentNode)),xl(this,Za,Qn).call(this)}disconnectedCallback(){this.disable(),xl(this,Za,Qn).call(this),Zn(this,Zt,null)}handleClick(){}};Ga=new WeakMap;Zt=new WeakMap;Za=new WeakSet;Qn=function(){var i;let e=(i=qn(this,Zt))==null?void 0:i.options;if(!e)return;let t=e.filter(a=>a.getAttribute("aria-selected")==="true").pop();t||(t=e[0]),qn(this,Zt).getAttribute("aria-multiselectable")!=="true"&&e.forEach(a=>{a.setAttribute("tabindex","-1"),a.setAttribute("aria-selected","false")}),t==null||t.setAttribute("tabindex","0"),t==null||t.setAttribute("aria-selected","true")};function zn(i,e){if(!i)return null;let{host:t}=i.getRootNode();return!e&&t?zn(i,t):e!=null&&e.options?e:zn(e,e==null?void 0:e.parentNode)}l.customElements.get("media-chrome-option")||l.customElements.define("media-chrome-option",qa);var es=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},E=(i,e,t)=>(es(i,e,"read from private field"),t?t.call(i):e.get(i)),q=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},X=(i,e,t,a)=>(es(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Pe=(i,e,t)=>(es(i,e,"access private method"),t),Re,qt,Ti,Qt,F,Ii,U,we,ki,vt,zt,Qa,Jn,Nl,jn,Ul,Xt,Si,ts,Pl,za,is,Bl=m.createElement("template");Bl.innerHTML=`
|
|
860
860
|
<style>
|
|
861
861
|
:host {
|
|
862
862
|
font: var(--media-font,
|
|
@@ -909,7 +909,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
|
|
|
909
909
|
<slot></slot>
|
|
910
910
|
</media-chrome-listbox>
|
|
911
911
|
</slot>
|
|
912
|
-
`;var me=class extends l.HTMLElement{constructor(){var e;super(),q(this,Jn),q(this,jn),q(this,Xt),q(this,ts),q(this,za),q(this,Re,void 0),q(this,qt,void 0),q(this,Ti,void 0),q(this,Qt,!0),q(this,F,void 0),q(this,Ii,void 0),q(this,U,void 0),q(this,we,void 0),q(this,ki,!1),q(this,vt,a=>{let{key:r}=a;if(!this.keysUsed.includes(r)){this.removeEventListener("keyup",
|
|
912
|
+
`;var me=class extends l.HTMLElement{constructor(){var e;super(),q(this,Jn),q(this,jn),q(this,Xt),q(this,ts),q(this,za),q(this,Re,void 0),q(this,qt,void 0),q(this,Ti,void 0),q(this,Qt,!0),q(this,F,void 0),q(this,Ii,void 0),q(this,U,void 0),q(this,we,void 0),q(this,ki,!1),q(this,vt,a=>{let{key:r}=a;if(!this.keysUsed.includes(r)){this.removeEventListener("keyup",E(this,vt));return}a.composedPath().includes(E(this,F))&&(r==="Enter"||r===" ")?E(this,qt).call(this):r==="Escape"&&!E(this,we).hidden&&Pe(this,Xt,Si).call(this)}),q(this,zt,a=>{let{metaKey:r,altKey:n,key:o}=a;if(r||n||!this.keysUsed.includes(o)){this.removeEventListener("keyup",E(this,vt));return}a.preventDefault(),this.addEventListener("keyup",E(this,vt),{once:!0})}),q(this,Qa,a=>{a.composedPath().includes(this)||E(this,we).hidden||Pe(this,Xt,Si).call(this)}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Bl.content.cloneNode(!0)));let{style:t}=N(this.shadowRoot,":host");t.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),X(this,qt,Pe(this,Jn,Nl).bind(this)),X(this,Ti,Pe(this,jn,Ul).bind(this)),(e=this.init)==null||e.call(this),X(this,F,this.shadowRoot.querySelector("[part=button]")),X(this,U,this.shadowRoot.querySelector("[part=listbox]")),X(this,Ii,this.shadowRoot.querySelector("slot[name=button]")),E(this,Ii).addEventListener("slotchange",()=>{let a=E(this,Ii).assignedElements()[0];!a||(this.disable(),X(this,F,a),E(this,F).preventClick=!0,E(this,F).hasAttribute("disabled")&&X(this,Qt,!1),E(this,Qt)?(this.enable(),E(this,F).setAttribute("aria-haspopup","listbox")):this.disable())}),X(this,we,this.shadowRoot.querySelector("slot[name=listbox]")),E(this,we).addEventListener("slotchange",()=>{this.disable(),X(this,U,E(this,we).assignedElements()[0]||E(this,U)),this.enable()})}static get observedAttributes(){return["disabled",A.MEDIA_CONTROLLER]}enable(){E(this,F).removeAttribute("disabled"),E(this,F).addEventListener("click",E(this,qt)),E(this,F).addEventListener("keydown",E(this,zt)),E(this,U).addEventListener("keydown",E(this,zt)),Pe(this,za,is).call(this),E(this,U).addEventListener("change",E(this,Ti)),m.addEventListener("click",E(this,Qa))}disable(){E(this,F).setAttribute("disabled",""),E(this,F).removeEventListener("click",E(this,qt)),E(this,F).removeEventListener("keydown",E(this,zt)),E(this,F).removeEventListener("keyup",E(this,vt)),E(this,U).removeEventListener("keydown",E(this,zt)),E(this,U).removeEventListener("keyup",E(this,vt)),E(this,U).addEventListener("change",E(this,Ti)),m.removeEventListener("click",E(this,Qa))}attributeChangedCallback(e,t,a){var r,n,o,d,u;e===A.MEDIA_CONTROLLER?(t&&((n=(r=E(this,Re))==null?void 0:r.unassociateElement)==null||n.call(r,this),X(this,Re,null),E(this,U).removeAttribute(A.MEDIA_CONTROLLER)),a&&(X(this,Re,(o=this.getRootNode())==null?void 0:o.getElementById(a)),(u=(d=E(this,Re))==null?void 0:d.associateElement)==null||u.call(d,this),E(this,U).setAttribute(A.MEDIA_CONTROLLER,a))):e==="disabled"&&a!==t&&(a==null?(X(this,Qt,!0),this.enable()):(X(this,Qt,!1),this.disable()))}connectedCallback(){var e,t,a;this.hasAttribute("disabled")||this.enable();let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(X(this,Re,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=E(this,Re))==null?void 0:t.associateElement)==null||a.call(t,this),E(this,U).setAttribute(A.MEDIA_CONTROLLER,r))}disconnectedCallback(){var e,t;this.disable(),(t=(e=E(this,Re))==null?void 0:e.unassociateElement)==null||t.call(e,this),X(this,Re,null),E(this,U).removeAttribute(A.MEDIA_CONTROLLER)}get keysUsed(){return["Enter","Escape"," ","ArrowUp","ArrowDown","f","c","k","m"]}};Re=new WeakMap;qt=new WeakMap;Ti=new WeakMap;Qt=new WeakMap;F=new WeakMap;Ii=new WeakMap;U=new WeakMap;we=new WeakMap;ki=new WeakMap;vt=new WeakMap;zt=new WeakMap;Qa=new WeakMap;Jn=new WeakSet;Nl=function(){Pe(this,Xt,Si).call(this)};jn=new WeakSet;Ul=function(){Pe(this,Xt,Si).call(this,!0)};Xt=new WeakSet;Si=function(i){E(this,we).hidden=!E(this,we).hidden||i,Pe(this,za,is).call(this,i),E(this,we).hidden?(this.shadowRoot.activeElement===E(this,U)||E(this,U).contains(this.shadowRoot.activeElement))&&E(this,F).focus():(E(this,U).focus(),Pe(this,ts,Pl).call(this))};ts=new WeakSet;Pl=function(){var i;if(E(this,U).offsetWidth===0)return;let e=E(this,F).getBoundingClientRect();if(this.hasAttribute("mediacontroller")||E(this,F).hasAttribute("mediacontroller")||E(this,U).hasAttribute("mediacontroller")){E(this,U).style.zIndex="1",E(this,U).style.bottom="unset",E(this,U).style.top=e.height+"px";return}let t=(i=this.getAttribute("bounds")?ut(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?i:this,a=E(this,U).offsetWidth,r=t.getBoundingClientRect(),n=-Math.max(e.x+a-r.right,0);E(this,U).style.left=`${n}px`};za=new WeakSet;is=function(i=!1){X(this,ki,!E(this,ki)||i),E(this,F).setAttribute("aria-expanded",E(this,ki))};l.customElements.get("media-chrome-selectmenu")||l.customElements.define("media-chrome-selectmenu",me);var os=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},gc=(i,e,t)=>(os(i,e,"read from private field"),t?t.call(i):e.get(i)),as=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ac=(i,e,t,a)=>(os(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),rs=(i,e,t)=>(os(i,e,"access private method"),t),Ja,ns,Hl,Xa,ss,_c=`
|
|
913
913
|
<svg aria-hidden="true" viewBox="0 0 26 24" part="captions-indicator indicator">
|
|
914
914
|
<path d="M22.83 5.68a2.58 2.58 0 0 0-2.3-2.5c-3.62-.24-11.44-.24-15.06 0a2.58 2.58 0 0 0-2.3 2.5c-.23 4.21-.23 8.43 0 12.64a2.58 2.58 0 0 0 2.3 2.5c3.62.24 11.44.24 15.06 0a2.58 2.58 0 0 0 2.3-2.5c.23-4.21.23-8.43 0-12.64Zm-11.39 9.45a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.92 3.92 0 0 1 .92-2.77 3.18 3.18 0 0 1 2.43-1 2.94 2.94 0 0 1 2.13.78c.364.359.62.813.74 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.17 1.61 1.61 0 0 0-1.29.58 2.79 2.79 0 0 0-.5 1.89 3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.48 1.48 0 0 0 1-.37 2.1 2.1 0 0 0 .59-1.14l1.4.44a3.23 3.23 0 0 1-1.07 1.69Zm7.22 0a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.88 3.88 0 0 1 .93-2.77 3.14 3.14 0 0 1 2.42-1 3 3 0 0 1 2.16.82 2.8 2.8 0 0 1 .73 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.21 1.61 1.61 0 0 0-1.29.58A2.79 2.79 0 0 0 15 12a3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.44 1.44 0 0 0 1-.37 2.1 2.1 0 0 0 .6-1.15l1.4.44a3.17 3.17 0 0 1-1.1 1.7Z"/>
|
|
915
915
|
</svg>`,Wl=m.createElement("template");Wl.innerHTML=`
|
|
@@ -923,7 +923,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
|
|
|
923
923
|
<path d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Zm-2 0a8 8 0 1 0-16 0 8 8 0 0 0 16 0Z"/>
|
|
924
924
|
</svg>`,Zl=m.createElement("template");Zl.innerHTML=`
|
|
925
925
|
<slot name="icon">${Tc}</slot>
|
|
926
|
-
`;var As=class extends L{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_AUDIO_TRACK_ENABLED,s.MEDIA_AUDIO_TRACK_UNAVAILABLE]}constructor(){super({slotTemplate:Zl})}get mediaAudioTrackEnabled(){return w(this,s.MEDIA_AUDIO_TRACK_ENABLED)}set mediaAudioTrackEnabled(e){M(this,s.MEDIA_AUDIO_TRACK_ENABLED,e)}};l.customElements.get("media-audio-track-button")||l.customElements.define("media-audio-track-button",As);var gr=class extends me{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_AUDIO_TRACK_ENABLED,s.MEDIA_AUDIO_TRACK_UNAVAILABLE]}init(){let e=m.createElement("media-audio-track-button");e.part.add("button"),e.preventClick=!0;let t=m.createElement("media-audio-track-listbox");t.part.add("listbox"),t.setAttribute("exportparts","option, option-selected, indicator");let a=this.shadowRoot.querySelector("slot[name=button]"),r=this.shadowRoot.querySelector("slot[name=listbox]");a.textContent="",r.textContent="",a.append(e),r.append(t)}};l.customElements.get("media-audio-track-selectmenu")||l.customElements.define("media-audio-track-selectmenu",gr);var g=Fd(require("@mux/mux-video")),P=require("@mux/playback-core");var id=require("@mux/mux-video");var Ic="en",bt={code:Ic};var ql="en";function y(i,e=!0){var r,n;let t=e&&(n=(r=bt)==null?void 0:r[i])!=null?n:i,a=e?bt.code:ql;return new _s(t,a)}var _s=class{constructor(e,t=(a=>(a=bt.code)!=null?a:ql)()){this.message=e,this.locale=t}format(e){return this.message.replace(/\{(\w+)\}/g,(t,a)=>{var r;return(r=e[a])!=null?r:""})}toString(){return this.message}};function Ql(i){let e="";return Object.entries(i).forEach(([t,a])=>{a!=null&&(e+=`${Ar(t)}: ${a}; `)}),e?e.trim():void 0}function Ar(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function _r(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Be(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function yr(i){let e=kc(i).toString();return e?"?"+e:""}function kc(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}function je(i){let e=(i!=null?i:"").split(".")[1];if(!e)return{};let t=e.replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(t).split("").map(function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}var ys=(i,e)=>!i||!e?!1:i.contains(e)?!0:ys(i,e.getRootNode().host);var Tr=require("@mux/playback-core");var Ts="mux.com",Sc=()=>{try{return"1.14.
|
|
926
|
+
`;var As=class extends L{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_AUDIO_TRACK_ENABLED,s.MEDIA_AUDIO_TRACK_UNAVAILABLE]}constructor(){super({slotTemplate:Zl})}get mediaAudioTrackEnabled(){return w(this,s.MEDIA_AUDIO_TRACK_ENABLED)}set mediaAudioTrackEnabled(e){M(this,s.MEDIA_AUDIO_TRACK_ENABLED,e)}};l.customElements.get("media-audio-track-button")||l.customElements.define("media-audio-track-button",As);var gr=class extends me{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_AUDIO_TRACK_ENABLED,s.MEDIA_AUDIO_TRACK_UNAVAILABLE]}init(){let e=m.createElement("media-audio-track-button");e.part.add("button"),e.preventClick=!0;let t=m.createElement("media-audio-track-listbox");t.part.add("listbox"),t.setAttribute("exportparts","option, option-selected, indicator");let a=this.shadowRoot.querySelector("slot[name=button]"),r=this.shadowRoot.querySelector("slot[name=listbox]");a.textContent="",r.textContent="",a.append(e),r.append(t)}};l.customElements.get("media-audio-track-selectmenu")||l.customElements.define("media-audio-track-selectmenu",gr);var g=Fd(require("@mux/mux-video")),P=require("@mux/playback-core");var id=require("@mux/mux-video");var Ic="en",bt={code:Ic};var ql="en";function y(i,e=!0){var r,n;let t=e&&(n=(r=bt)==null?void 0:r[i])!=null?n:i,a=e?bt.code:ql;return new _s(t,a)}var _s=class{constructor(e,t=(a=>(a=bt.code)!=null?a:ql)()){this.message=e,this.locale=t}format(e){return this.message.replace(/\{(\w+)\}/g,(t,a)=>{var r;return(r=e[a])!=null?r:""})}toString(){return this.message}};function Ql(i){let e="";return Object.entries(i).forEach(([t,a])=>{a!=null&&(e+=`${Ar(t)}: ${a}; `)}),e?e.trim():void 0}function Ar(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function _r(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Be(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function yr(i){let e=kc(i).toString();return e?"?"+e:""}function kc(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}function je(i){let e=(i!=null?i:"").split(".")[1];if(!e)return{};let t=e.replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(t).split("").map(function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}var ys=(i,e)=>!i||!e?!1:i.contains(e)?!0:ys(i,e.getRootNode().host);var Tr=require("@mux/playback-core");var Ts="mux.com",Sc=()=>{try{return"1.14.1"}catch{}return"UNKNOWN"},Mc=Sc(),kr=()=>Mc,Is=(i,{maxResolution:e,token:t,domain:a=Ts}={})=>{let o=!!t?{token:t}:{redundant_streams:!0,...e?{max_resolution:e}:{}};return`https://stream.${a}/${i}.m3u8${yr(o)}`},zl=(i,{token:e,thumbnailTime:t,domain:a=Ts}={})=>{let r=e==null?t:void 0,{aud:n}=je(e);if(!(e&&n!=="t"))return`https://image.${a}/${i}/thumbnail.webp${yr({token:e,time:r})}`},Xl=(i,{token:e,domain:t=Ts}={})=>{let{aud:a}=je(e);if(!(e&&a!=="s"))return`https://image.${t}/${i}/storyboard.vtt${yr({token:e,format:"webp"})}`},wi=i=>{if(!!i){if([Tr.StreamTypes.LIVE,Tr.StreamTypes.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return Tr.StreamTypes.LIVE}};var Lc={crossorigin:"crossOrigin",playsinline:"playsInline"};function Jl(i){var e;return(e=Lc[i])!=null?e:_r(i)}var ft,gt,j,Ir=class{constructor(e,t){W(this,ft,void 0);W(this,gt,void 0);W(this,j,[]);le(this,ft,e),le(this,gt,t)}[Symbol.iterator](){return k(this,j).values()}get length(){return k(this,j).length}get value(){var e;return(e=k(this,j).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(le(this,j,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return k(this,j)[e]}values(){return k(this,j).values()}keys(){return k(this,j).keys()}forEach(e){k(this,j).forEach(e)}add(...e){var t,a;e.forEach(r=>{this.contains(r)||k(this,j).push(r)}),!(this.value===""&&!((t=k(this,ft))!=null&&t.hasAttribute(`${k(this,gt)}`)))&&((a=k(this,ft))==null||a.setAttribute(`${k(this,gt)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>{k(this,j).splice(k(this,j).indexOf(a),1)}),(t=k(this,ft))==null||t.setAttribute(`${k(this,gt)}`,`${this.value}`)}contains(e){return k(this,j).includes(e)}toggle(e,t){return typeof t!="undefined"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){this.remove(e),this.add(t)}};ft=new WeakMap,gt=new WeakMap,j=new WeakMap;var jl=`[mux-player ${kr()}]`;function et(...i){console.warn(jl,...i)}function be(...i){console.error(jl,...i)}function ks(i){var t;let e=(t=i.message)!=null?t:"";if(i.context&&(e+=` ${i.context}`),i.file){let a="https://github.com/muxinc/elements/blob/main/errors/";e+=` ${y("Read more: ")}
|
|
927
927
|
${a}${i.file}`}et(e)}var J={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},At={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},td=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}}),Cc=id.VideoEvents.filter(i=>i!=="error"),Rc=Object.values(J).filter(i=>![J.PLAYSINLINE].includes(i)),wc=Object.values(At);function ad(i){i.querySelectorAll(":scope > track").forEach(e=>{var t;(t=i.media)==null||t.append(e.cloneNode())}),Cc.forEach(e=>{var t;(t=i.media)==null||t.addEventListener(e,a=>{i.dispatchEvent(new Event(a.type))})})}var Ss=class extends B.HTMLElement{static get observedAttributes(){return[...Rc,...wc]}constructor(){super(),this.querySelectorAll(":scope > track").forEach(a=>{var r;(r=this.media)==null||r.append(a.cloneNode())});let e=a=>{for(let r of a)r.type==="childList"&&(r.removedNodes.forEach(n=>{var d,u;let o=(d=this.media)==null?void 0:d.querySelector(`track[src="${n.src}"]`);o&&((u=this.media)==null||u.removeChild(o))}),r.addedNodes.forEach(n=>{var o;(o=this.media)==null||o.append(n.cloneNode())}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(e,t,a){var r,n;switch(e){case At.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case At.VOLUME:{let o=(r=Be(a))!=null?r:1;this.media&&(this.media.volume=o);return}case At.PLAYBACKRATE:{let o=(n=Be(a))!=null?n:1;this.media&&(this.media.playbackRate=o,this.media.defaultPlaybackRate=o);return}}}play(){var e,t;return(t=(e=this.media)==null?void 0:e.play())!=null?t:Promise.reject()}pause(){var e;(e=this.media)==null||e.pause()}requestCast(e){var t;return(t=this.media)==null?void 0:t.requestCast(e)}get media(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("mux-video")}get audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var e,t;return(t=(e=this.media)==null?void 0:e.paused)!=null?t:!0}get duration(){var e,t;return(t=(e=this.media)==null?void 0:e.duration)!=null?t:NaN}get ended(){var e,t;return(t=(e=this.media)==null?void 0:e.ended)!=null?t:!1}get buffered(){var e,t;return(t=(e=this.media)==null?void 0:e.buffered)!=null?t:td}get seekable(){var e,t;return(t=(e=this.media)==null?void 0:e.seekable)!=null?t:td}get readyState(){var e,t;return(t=(e=this.media)==null?void 0:e.readyState)!=null?t:0}get videoWidth(){var e,t;return(t=(e=this.media)==null?void 0:e.videoWidth)!=null?t:0}get videoHeight(){var e,t;return(t=(e=this.media)==null?void 0:e.videoHeight)!=null?t:0}get currentTime(){var e,t;return(t=(e=this.media)==null?void 0:e.currentTime)!=null?t:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,t;return(t=(e=this.media)==null?void 0:e.volume)!=null?t:1}set volume(e){this.media&&(this.media.volume=Number(e))}get playbackRate(){var e,t;return(t=(e=this.media)==null?void 0:e.playbackRate)!=null?t:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get defaultPlaybackRate(){var e;return(e=Be(this.getAttribute(At.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(At.PLAYBACKRATE,`${e}`):this.removeAttribute(At.PLAYBACKRATE)}get crossOrigin(){return Di(this,J.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(J.CROSSORIGIN,`${e}`)}get autoplay(){return Di(this,J.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(J.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(J.AUTOPLAY)}get loop(){return Di(this,J.LOOP)!=null}set loop(e){e?this.setAttribute(J.LOOP,""):this.removeAttribute(J.LOOP)}get muted(){var e,t;return(t=(e=this.media)==null?void 0:e.muted)!=null?t:!1}set muted(e){this.media&&(this.media.muted=Boolean(e))}get defaultMuted(){return Di(this,J.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(J.MUTED,""):this.removeAttribute(J.MUTED)}get playsInline(){return Di(this,J.PLAYSINLINE)!=null}set playsInline(e){be("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(e){["","none","metadata","auto"].includes(e)?this.setAttribute(J.PRELOAD,e):this.removeAttribute(J.PRELOAD)}};function Di(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var Ms=Ss;var Dc=Object.defineProperty,xc=(i,e,t)=>e in i?Dc(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Oc=(i,e,t)=>(xc(i,typeof e!="symbol"?e+"":e,t),t),ld=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},_=(i,e,t)=>(ld(i,e,"read from private field"),t?t.call(i):e.get(i)),De=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},$e=(i,e,t,a)=>(ld(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),jt,Sr,_t,xi,tt,it,at,yt,ei,Mr,fe,rd=1,nd=0,Nc=1,Uc={processCallback(i,e,t){if(!!t){for(let[a,r]of e)if(a in t){let n=t[a];typeof n=="boolean"&&r instanceof ee&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=n:typeof n=="function"&&r instanceof ee?r.element[r.attributeName]=n:r.value=n}}}},Ve=class extends l.DocumentFragment{constructor(e,t,a=Uc){var r;super(),De(this,jt,void 0),De(this,Sr,void 0),this.append(e.content.cloneNode(!0)),$e(this,jt,dd(this)),$e(this,Sr,a),(r=a.createCallback)==null||r.call(a,this,_(this,jt),t),a.processCallback(this,_(this,jt),t)}update(e){_(this,Sr).processCallback(this,_(this,jt),e)}};jt=new WeakMap;Sr=new WeakMap;var dd=(i,e=[])=>{let t,a;for(let r of i.attributes||[])if(r.value.includes("{{")){let n=new Ls;for([t,a]of od(r.value))if(!t)n.append(a);else{let o=new ee(i,r.name,r.namespaceURI);n.append(o),e.push([a,o])}r.value=n.toString()}for(let r of i.childNodes)if(r.nodeType===rd&&!(r instanceof HTMLTemplateElement))dd(r,e);else if(r.nodeType===rd||r.data.includes("{{")){let n=[];if(r.data)for([t,a]of od(r.data))if(!t)n.push(new Text(a));else{let o=new He(i);n.push(o),e.push([a,o])}else if(r instanceof HTMLTemplateElement){let o=new Oi(i,r);n.push(o),e.push([o.expression,o])}r.replaceWith(...n.flatMap(o=>o.replacementNodes||[o]))}return e},sd={},od=i=>{let e="",t=0,a=sd[i],r=0,n;if(a)return a;for(a=[];n=i[r];r++)n==="{"&&i[r+1]==="{"&&i[r-1]!=="\\"&&i[r+2]&&++t==1?(e&&a.push([nd,e]),e="",r++):n==="}"&&i[r+1]==="}"&&i[r-1]!=="\\"&&!--t?(a.push([Nc,e.trim()]),e="",r++):e+=n||"";return e&&a.push([nd,(t>0?"{{":"")+e]),sd[i]=a},Pc=11,Lr=class{get value(){return""}set value(e){}toString(){return this.value}},ud=new WeakMap,Ls=class{constructor(){De(this,_t,[])}[Symbol.iterator](){return _(this,_t).values()}get length(){return _(this,_t).length}item(e){return _(this,_t)[e]}append(...e){for(let t of e)t instanceof ee&&ud.set(t,this),_(this,_t).push(t)}toString(){return _(this,_t).join("")}};_t=new WeakMap;var ee=class extends Lr{constructor(e,t,a){super(),De(this,yt),De(this,xi,""),De(this,tt,void 0),De(this,it,void 0),De(this,at,void 0),$e(this,tt,e),$e(this,it,t),$e(this,at,a)}get attributeName(){return _(this,it)}get attributeNamespace(){return _(this,at)}get element(){return _(this,tt)}get value(){return _(this,xi)}set value(e){_(this,xi)!==e&&($e(this,xi,e),!_(this,yt,ei)||_(this,yt,ei).length===1?e==null?_(this,tt).removeAttributeNS(_(this,at),_(this,it)):_(this,tt).setAttributeNS(_(this,at),_(this,it),e):_(this,tt).setAttributeNS(_(this,at),_(this,it),_(this,yt,ei)))}get booleanValue(){return _(this,tt).hasAttributeNS(_(this,at),_(this,it))}set booleanValue(e){if(!_(this,yt,ei)||_(this,yt,ei).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};xi=new WeakMap;tt=new WeakMap;it=new WeakMap;at=new WeakMap;yt=new WeakSet;ei=function(){return ud.get(this)};var He=class extends Lr{constructor(e,t){super(),De(this,Mr,void 0),De(this,fe,void 0),$e(this,Mr,e),$e(this,fe,t?[...t]:[new Text])}get replacementNodes(){return _(this,fe)}get parentNode(){return _(this,Mr)}get nextSibling(){return _(this,fe)[_(this,fe).length-1].nextSibling}get previousSibling(){return _(this,fe)[0].previousSibling}get value(){return _(this,fe).map(e=>e.textContent).join("")}set value(e){this.replace(e)}replace(...e){let t=e.flat().flatMap(a=>a==null?[new Text]:a.forEach?[...a]:a.nodeType===Pc?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);t.length||t.push(new Text),$e(this,fe,Bc(_(this,fe)[0].parentNode,_(this,fe),t,this.nextSibling))}};Mr=new WeakMap;fe=new WeakMap;var Oi=class extends He{constructor(e,t){let a=t.getAttribute("directive")||t.getAttribute("type"),r=t.getAttribute("expression")||t.getAttribute(a)||"";r.startsWith("{{")&&(r=r.trim().slice(2,-2).trim()),super(e),Oc(this,"directive"),this.expression=r,this.template=t,this.directive=a}};function Bc(i,e,t,a=null){let r=0,n,o,d,u=t.length,c=e.length;for(;r<u&&r<c&&e[r]==t[r];)r++;for(;r<u&&r<c&&t[u-1]==e[c-1];)a=t[--c,--u];if(r==c)for(;r<u;)i.insertBefore(t[r++],a);if(r==u)for(;r<c;)i.removeChild(e[r++]);else{for(n=e[r];r<u;)d=t[r++],o=n?n.nextSibling:a,n==d?n=o:r<u&&t[r]==o?(i.replaceChild(d,n),n=o):i.insertBefore(d,n);for(;n!=a;)o=n.nextSibling,i.removeChild(n),n=o}return t}var cd={string:i=>String(i)},Rr=class{constructor(e){this.template=e,this.state=void 0}},Tt=new WeakMap,It=new WeakMap,Cs={partial:(i,e)=>{e[i.expression]=new Rr(i.template)},if:(i,e)=>{var t;if(hd(i.expression,e))if(Tt.get(i)!==i.template){Tt.set(i,i.template);let a=new Ve(i.template,e,wr);i.replace(a),It.set(i,a)}else(t=It.get(i))==null||t.update(e);else i.replace(""),Tt.delete(i),It.delete(i)}},$c=Object.keys(Cs),wr={processCallback(i,e,t){var a,r;if(!!t)for(let[n,o]of e){if(o instanceof Oi){if(!o.directive){let u=$c.find(c=>o.template.hasAttribute(c));u&&(o.directive=u,o.expression=o.template.getAttribute(u))}(a=Cs[o.directive])==null||a.call(Cs,o,t);continue}let d=hd(n,t);if(d instanceof Rr){Tt.get(o)!==d.template?(Tt.set(o,d.template),d=new Ve(d.template,d.state,wr),o.value=d,It.set(o,d)):(r=It.get(o))==null||r.update(d.state);continue}d?(o instanceof ee&&o.attributeName.startsWith("aria-")&&(d=String(d)),o instanceof ee?typeof d=="boolean"?o.booleanValue=d:typeof d=="function"?o.element[o.attributeName]=d:o.value=d:(o.value=d,Tt.delete(o),It.delete(o))):o instanceof ee?o.value=void 0:(o.value=void 0,Tt.delete(o),It.delete(o))}}},md={"!":i=>!i,"!!":i=>!!i,"==":(i,e)=>i==e,"!=":(i,e)=>i!=e,">":(i,e)=>i>e,">=":(i,e)=>i>=e,"<":(i,e)=>i<e,"<=":(i,e)=>i<=e,"??":(i,e)=>i!=null?i:e,"|":(i,e)=>{var t;return(t=cd[e])==null?void 0:t.call(cd,i)}};function Vc(i){return Hc(i,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function hd(i,e={}){var t,a,r,n,o,d,u;let c=Vc(i);if(c.length===0||c.some(({type:h})=>!h))return Ni(i);if(((t=c[0])==null?void 0:t.token)===">"){let h=e[(a=c[1])==null?void 0:a.token];if(!h)return Ni(i);let f={...e};h.state=f;let b=c.slice(2);for(let T=0;T<b.length;T+=3){let V=(r=b[T])==null?void 0:r.token,G=(n=b[T+1])==null?void 0:n.token,I=(o=b[T+2])==null?void 0:o.token;V&&G==="="&&(f[V]=Ui(I,e))}return h}if(c.length===1)return Cr(c[0])?Ui(c[0].token,e):Ni(i);if(c.length===2){let h=(d=c[0])==null?void 0:d.token,f=md[h];if(!f||!Cr(c[1]))return Ni(i);let b=Ui(c[1].token,e);return f(b)}if(c.length===3){let h=(u=c[1])==null?void 0:u.token,f=md[h];if(!f||!Cr(c[0])||!Cr(c[2]))return Ni(i);let b=Ui(c[0].token,e);if(h==="|")return f(b,c[2].token);let T=Ui(c[2].token,e);return f(b,T)}}function Ni(i){return console.warn(`Warning: invalid expression \`${i}\``),!1}function Cr({type:i}){return["number","boolean","string","param"].includes(i)}function Ui(i,e){let t=i[0],a=i.slice(-1);return i==="true"||i==="false"?i==="true":t===a&&["'",'"'].includes(t)?i.slice(1,-1):Xi(i)?parseFloat(i):e[i]}function Hc(i,e){let t,a,r,n=[];for(;i;){r=null,t=i.length;for(let o in e)a=e[o].exec(i),a&&a.index<t&&(r={token:a[0],type:o,matches:a.slice(1)},t=a.index);t&&n.push({token:i.substr(0,t),type:void 0}),r&&n.push(r),i=i.substr(t+(r?r.token.length:0))}return n}var Wc=Object.defineProperty,Fc=(i,e,t)=>e in i?Wc(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Bi=(i,e,t)=>(Fc(i,typeof e!="symbol"?e+"":e,t),t),Ns=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ds=(i,e,t)=>(Ns(i,e,"read from private field"),t?t.call(i):e.get(i)),Pi=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},kt=(i,e,t,a)=>(Ns(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Rs=(i,e,t)=>(Ns(i,e,"access private method"),t),ti,Dr,ii,xs,pd,xr,Os,ws={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},Ed=m.createElement("template");Ed.innerHTML=`
|
|
928
928
|
<style>
|
|
929
929
|
:host {
|
|
@@ -2018,5 +2018,5 @@ media-poster-image:not([src]) {
|
|
|
2018
2018
|
|
|
2019
2019
|
</media-controller>
|
|
2020
2020
|
</template>
|
|
2021
|
-
`;var Bs=ne.createElement("template");"innerHTML"in Bs&&(Bs.innerHTML=Md);var Ld,Cd,Ur=class extends rt{};Ur.template=(Cd=(Ld=Bs.content)==null?void 0:Ld.children)==null?void 0:Cd[0];B.customElements.get("media-theme-classic")||B.customElements.define("media-theme-classic",Ur);var sm="classic";var Fe={SRC:"src",POSTER:"poster"},E={STYLE:"style",DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-color",FORWARD_SEEK_OFFSET:"forward-seek-offset",BACKWARD_SEEK_OFFSET:"backward-seek-offset",PLAYBACK_TOKEN:"playback-token",THUMBNAIL_TOKEN:"thumbnail-token",STORYBOARD_TOKEN:"storyboard-token",STORYBOARD_SRC:"storyboard-src",THUMBNAIL_TIME:"thumbnail-time",AUDIO:"audio",NOHOTKEYS:"nohotkeys",HOTKEYS:"hotkeys",PLAYBACK_RATES:"playbackrates",DEFAULT_SHOW_REMAINING_TIME:"default-show-remaining-time",TITLE:"title",PLACEHOLDER:"placeholder",THEME:"theme",DEFAULT_STREAM_TYPE:"default-stream-type",TARGET_LIVE_WINDOW:"target-live-window",NO_VOLUME_PREF:"no-volume-pref"},$s=["audio","backwardseekoffset","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","novolumepref"];function om(i,e){var a;return{src:!i.playbackId&&i.src,playbackId:i.playbackId,hasSrc:!!i.playbackId||!!i.src,poster:i.poster,storyboard:i.storyboard,storyboardSrc:i.getAttribute(E.STORYBOARD_SRC),placeholder:i.getAttribute("placeholder"),themeTemplate:lm(i),thumbnailTime:!i.tokens.thumbnail&&i.thumbnailTime,autoplay:i.autoplay,crossOrigin:i.crossOrigin,loop:i.loop,noHotKeys:i.hasAttribute(E.NOHOTKEYS),hotKeys:i.getAttribute(E.HOTKEYS),muted:i.muted,paused:i.paused,preload:i.preload,envKey:i.envKey,preferCmcd:i.preferCmcd,debug:i.debug,disableCookies:i.disableCookies,tokens:i.tokens,beaconCollectionDomain:i.beaconCollectionDomain,maxResolution:i.maxResolution,metadata:i.metadata,playerSoftwareName:i.playerSoftwareName,playerSoftwareVersion:i.playerSoftwareVersion,startTime:i.startTime,preferPlayback:i.preferPlayback,audio:i.audio,defaultStreamType:i.defaultStreamType,targetLiveWindow:i.getAttribute(g.Attributes.TARGET_LIVE_WINDOW),streamType:wi(i.getAttribute(g.Attributes.STREAM_TYPE)),primaryColor:i.primaryColor,secondaryColor:i.secondaryColor,forwardSeekOffset:i.forwardSeekOffset,backwardSeekOffset:i.backwardSeekOffset,defaultHiddenCaptions:i.defaultHiddenCaptions,defaultShowRemainingTime:i.defaultShowRemainingTime,hideDuration:dm(i),playbackRates:i.getAttribute(E.PLAYBACK_RATES),customDomain:(a=i.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?a:void 0,title:i.getAttribute(E.TITLE),novolumepref:i.hasAttribute(E.NO_VOLUME_PREF),...e}}function lm(i){var t,a;let e=i.theme;if(e){let r=(a=(t=i.getRootNode())==null?void 0:t.getElementById)==null?void 0:a.call(t,e);if(r&&r instanceof HTMLTemplateElement)return r;e.startsWith("media-theme-")||(e=`media-theme-${e}`);let n=B.customElements.get(e);if(n!=null&&n.template)return n.template}}function dm(i){var t;let e=(t=i.mediaController)==null?void 0:t.querySelector("media-time-display");return e&&getComputedStyle(e).getPropertyValue("--media-duration-display-display").trim()==="none"}function Rd(i){return i.getAttributeNames().filter(e=>e.startsWith("metadata-")).reduce((e,t)=>{let a=i.getAttribute(t);return a!==null&&(e[t.replace(/^metadata-/,"").replace(/-/g,"_")]=a),e},{})}var um=Object.values(g.Attributes),cm=Object.values(Fe),mm=Object.values(E),hm=kr(),pm="mux-player",wd={dialog:void 0,isDialogOpen:!1},Ki,Yi,Ke,Gi,Mt,st,ai,Pr,Dd,Zi,Vs,ot,ri,Br,xd,$r,Od,Vr,Nd,Hr,Ud,Fi=class extends Ms{constructor(){super();W(this,st);W(this,Pr);W(this,Zi);W(this,ot);W(this,Br);W(this,$r);W(this,Vr);W(this,Hr);W(this,Ki,!1);W(this,Yi,{});W(this,Ke,!0);W(this,Gi,new Ir(this,"hotkeys"));W(this,Mt,{...wd,onCloseErrorDialog:()=>K(this,Zi,Vs).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:t=>{ys(this,ne.activeElement)||t.preventDefault()}});this.attachShadow({mode:"open"}),K(this,Pr,Dd).call(this),this.isConnected&&K(this,st,ai).call(this)}static get observedAttributes(){var t;return[...(t=Ms.observedAttributes)!=null?t:[],...cm,...um,...mm]}get mediaTheme(){var t;return(t=this.shadowRoot)==null?void 0:t.querySelector("media-theme")}get mediaController(){var t,a;return(a=(t=this.mediaTheme)==null?void 0:t.shadowRoot)==null?void 0:a.querySelector("media-controller")}connectedCallback(){var a;let t=(a=this.shadowRoot)==null?void 0:a.querySelector("mux-video");t&&(t.metadata=Rd(this))}attributeChangedCallback(t,a,r){switch(K(this,st,ai).call(this),super.attributeChangedCallback(t,a,r),t){case E.HOTKEYS:k(this,Gi).value=r;break;case E.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&et(y("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case E.THUMBNAIL_TOKEN:{let{aud:o}=je(r);r&&o!=="t"&&et(y("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:o}));break}case E.STORYBOARD_TOKEN:{let{aud:o}=je(r);r&&o!=="s"&&et(y("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:o}));break}case g.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&be(y("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r}));break}case g.Attributes.STREAM_TYPE:r&&![P.StreamTypes.LIVE,P.StreamTypes.ON_DEMAND,P.StreamTypes.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:ks({file:"invalid-stream-type.md",message:y("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):this.targetLiveWindow=r===P.StreamTypes.LIVE?0:Number.NaN}[g.Attributes.PLAYBACK_ID,Fe.SRC,E.PLAYBACK_TOKEN].includes(t)&&a!==r&&le(this,Mt,{...k(this,Mt),...wd}),K(this,ot,ri).call(this,{[Jl(t)]:r})}get preferCmcd(){var t;return(t=this.getAttribute(g.Attributes.PREFER_CMCD))!=null?t:void 0}set preferCmcd(t){t!==this.preferCmcd&&(t?P.CmcdTypeValues.includes(t)?this.setAttribute(g.Attributes.PREFER_CMCD,t):et(`Invalid value for preferCmcd. Must be one of ${P.CmcdTypeValues.join()}`):this.removeAttribute(g.Attributes.PREFER_CMCD))}get hasPlayed(){var t,a;return(a=(t=this.mediaController)==null?void 0:t.hasAttribute("media-has-played"))!=null?a:!1}get inLiveWindow(){var t;return(t=this.mediaController)==null?void 0:t.hasAttribute("media-time-is-live")}get _hls(){var t;return(t=this.media)==null?void 0:t._hls}get mux(){var t;return(t=this.media)==null?void 0:t.mux}get theme(){var t;return(t=this.getAttribute(E.THEME))!=null?t:sm}set theme(t){this.setAttribute(E.THEME,`${t}`)}get themeProps(){let t=this.mediaTheme;if(!t)return;let a={};for(let r of t.getAttributeNames()){if($s.includes(r))continue;let n=t.getAttribute(r);a[_r(r)]=n===""?!0:n}return a}set themeProps(t){var r,n;K(this,st,ai).call(this);let a={...this.themeProps,...t};for(let o in a){if($s.includes(o))continue;let d=t==null?void 0:t[o];typeof d=="boolean"||d==null?(r=this.mediaTheme)==null||r.toggleAttribute(Ar(o),Boolean(d)):(n=this.mediaTheme)==null||n.setAttribute(Ar(o),d)}}get playbackId(){var t;return(t=this.getAttribute(g.Attributes.PLAYBACK_ID))!=null?t:void 0}set playbackId(t){t?this.setAttribute(g.Attributes.PLAYBACK_ID,t):this.removeAttribute(g.Attributes.PLAYBACK_ID)}get src(){var t,a;return this.playbackId?(t=St(this,Fe.SRC))!=null?t:void 0:(a=this.getAttribute(Fe.SRC))!=null?a:void 0}set src(t){t?this.setAttribute(Fe.SRC,t):this.removeAttribute(Fe.SRC)}get poster(){var a;let t=this.getAttribute(Fe.POSTER);if(t!=null)return t;if(this.playbackId&&!this.audio)return zl(this.playbackId,{domain:this.customDomain,thumbnailTime:(a=this.thumbnailTime)!=null?a:this.startTime,token:this.tokens.thumbnail})}set poster(t){t||t===""?this.setAttribute(Fe.POSTER,t):this.removeAttribute(Fe.POSTER)}get storyboardSrc(){var t;return(t=this.getAttribute(E.STORYBOARD_SRC))!=null?t:void 0}set storyboardSrc(t){t?this.setAttribute(E.STORYBOARD_SRC,t):this.removeAttribute(E.STORYBOARD_SRC)}get storyboard(){if(this.storyboardSrc&&!this.tokens.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[P.StreamTypes.LIVE,P.StreamTypes.UNKNOWN].includes(this.streamType)))return Xl(this.playbackId,{domain:this.customDomain,token:this.tokens.storyboard})}get audio(){return this.hasAttribute(E.AUDIO)}set audio(t){if(!t){this.removeAttribute(E.AUDIO);return}this.setAttribute(E.AUDIO,"")}get hotkeys(){return k(this,Gi)}get nohotkeys(){return this.hasAttribute(E.NOHOTKEYS)}set nohotkeys(t){if(!t){this.removeAttribute(E.NOHOTKEYS);return}this.setAttribute(E.NOHOTKEYS,"")}get thumbnailTime(){return Be(this.getAttribute(E.THUMBNAIL_TIME))}set thumbnailTime(t){this.setAttribute(E.THUMBNAIL_TIME,`${t}`)}get title(){var t;return(t=this.getAttribute(E.TITLE))!=null?t:""}set title(t){t!==this.title&&(t?this.setAttribute(E.TITLE,t):this.removeAttribute("title"),super.title=t)}get placeholder(){var t;return(t=St(this,E.PLACEHOLDER))!=null?t:""}set placeholder(t){this.setAttribute(E.PLACEHOLDER,`${t}`)}get primaryColor(){var a,r;let t=this.getAttribute(E.PRIMARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=B.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),t))return t}set primaryColor(t){this.setAttribute(E.PRIMARY_COLOR,`${t}`)}get secondaryColor(){var a,r;let t=this.getAttribute(E.SECONDARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=B.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),t))return t}set secondaryColor(t){this.setAttribute(E.SECONDARY_COLOR,`${t}`)}get defaultShowRemainingTime(){return this.hasAttribute(E.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(t){t?this.setAttribute(E.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(E.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(!!this.hasAttribute(E.PLAYBACK_RATES))return this.getAttribute(E.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(t=>Number(t)).filter(t=>!Number.isNaN(t)).sort((t,a)=>t-a)}set playbackRates(t){if(!t){this.removeAttribute(E.PLAYBACK_RATES);return}this.setAttribute(E.PLAYBACK_RATES,t.join(" "))}get forwardSeekOffset(){var t;return(t=Be(this.getAttribute(E.FORWARD_SEEK_OFFSET)))!=null?t:10}set forwardSeekOffset(t){this.setAttribute(E.FORWARD_SEEK_OFFSET,`${t}`)}get backwardSeekOffset(){var t;return(t=Be(this.getAttribute(E.BACKWARD_SEEK_OFFSET)))!=null?t:10}set backwardSeekOffset(t){this.setAttribute(E.BACKWARD_SEEK_OFFSET,`${t}`)}get defaultHiddenCaptions(){return this.hasAttribute(E.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(t){t?this.setAttribute(E.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(E.DEFAULT_HIDDEN_CAPTIONS)}get playerSoftwareName(){var t;return(t=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_NAME))!=null?t:pm}get playerSoftwareVersion(){var t;return(t=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_VERSION))!=null?t:hm}get beaconCollectionDomain(){var t;return(t=this.getAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN))!=null?t:void 0}set beaconCollectionDomain(t){t!==this.beaconCollectionDomain&&(t?this.setAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN,t):this.removeAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var t;return(t=this.getAttribute(g.Attributes.MAX_RESOLUTION))!=null?t:void 0}set maxResolution(t){t!==this.maxResolution&&(t?this.setAttribute(g.Attributes.MAX_RESOLUTION,t):this.removeAttribute(g.Attributes.MAX_RESOLUTION))}get customDomain(){var t;return(t=this.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?t:void 0}set customDomain(t){t!==this.customDomain&&(t?this.setAttribute(g.Attributes.CUSTOM_DOMAIN,t):this.removeAttribute(g.Attributes.CUSTOM_DOMAIN))}get envKey(){var t;return(t=St(this,g.Attributes.ENV_KEY))!=null?t:void 0}set envKey(t){this.setAttribute(g.Attributes.ENV_KEY,`${t}`)}get noVolumePref(){return this.hasAttribute(E.NO_VOLUME_PREF)}set noVolumePref(t){t?this.setAttribute(E.NO_VOLUME_PREF,""):this.removeAttribute(E.NO_VOLUME_PREF)}get debug(){return St(this,g.Attributes.DEBUG)!=null}set debug(t){t?this.setAttribute(g.Attributes.DEBUG,""):this.removeAttribute(g.Attributes.DEBUG)}get disableCookies(){return St(this,g.Attributes.DISABLE_COOKIES)!=null}set disableCookies(t){t?this.setAttribute(g.Attributes.DISABLE_COOKIES,""):this.removeAttribute(g.Attributes.DISABLE_COOKIES)}get streamType(){var t,a,r;return(r=(a=this.getAttribute(g.Attributes.STREAM_TYPE))!=null?a:(t=this.media)==null?void 0:t.streamType)!=null?r:P.StreamTypes.UNKNOWN}set streamType(t){this.setAttribute(g.Attributes.STREAM_TYPE,`${t}`)}get defaultStreamType(){var t,a,r;return(r=(a=this.getAttribute(E.DEFAULT_STREAM_TYPE))!=null?a:(t=this.mediaController)==null?void 0:t.getAttribute(E.DEFAULT_STREAM_TYPE))!=null?r:P.StreamTypes.ON_DEMAND}set defaultStreamType(t){t?this.setAttribute(E.DEFAULT_STREAM_TYPE,t):this.removeAttribute(E.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var t,a;return this.hasAttribute(E.TARGET_LIVE_WINDOW)?+this.getAttribute(E.TARGET_LIVE_WINDOW):(a=(t=this.media)==null?void 0:t.targetLiveWindow)!=null?a:Number.NaN}set targetLiveWindow(t){t!=this.targetLiveWindow&&(t==null?this.removeAttribute(E.TARGET_LIVE_WINDOW):this.setAttribute(E.TARGET_LIVE_WINDOW,`${+t}`))}get liveEdgeStart(){var t;return(t=this.media)==null?void 0:t.liveEdgeStart}get startTime(){return Be(St(this,g.Attributes.START_TIME))}set startTime(t){this.setAttribute(g.Attributes.START_TIME,`${t}`)}get preferPlayback(){let t=this.getAttribute(g.Attributes.PREFER_PLAYBACK);if(t===P.PlaybackTypes.MSE||t===P.PlaybackTypes.NATIVE)return t}set preferPlayback(t){t!==this.preferPlayback&&(t===P.PlaybackTypes.MSE||t===P.PlaybackTypes.NATIVE?this.setAttribute(g.Attributes.PREFER_PLAYBACK,t):this.removeAttribute(g.Attributes.PREFER_PLAYBACK))}get metadata(){var t;return(t=this.media)==null?void 0:t.metadata}set metadata(t){if(K(this,st,ai).call(this),!this.media){be("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...Rd(this),...t}}async addCuePoints(t){var a;if(K(this,st,ai).call(this),!this.media){be("underlying media element missing when trying to addCuePoints. cuePoints will not be added.");return}return(a=this.media)==null?void 0:a.addCuePoints(t)}get activeCuePoint(){var t;return(t=this.media)==null?void 0:t.activeCuePoint}get cuePoints(){var t,a;return(a=(t=this.media)==null?void 0:t.cuePoints)!=null?a:[]}getStartDate(){var t;return(t=this.media)==null?void 0:t.getStartDate()}get currentPdt(){var t;return(t=this.media)==null?void 0:t.currentPdt}get tokens(){let t=this.getAttribute(E.PLAYBACK_TOKEN),a=this.getAttribute(E.THUMBNAIL_TOKEN),r=this.getAttribute(E.STORYBOARD_TOKEN);return{...k(this,Yi),...t!=null?{playback:t}:{},...a!=null?{thumbnail:a}:{},...r!=null?{storyboard:r}:{}}}set tokens(t){le(this,Yi,t!=null?t:{})}get playbackToken(){var t;return(t=this.getAttribute(E.PLAYBACK_TOKEN))!=null?t:void 0}set playbackToken(t){this.setAttribute(E.PLAYBACK_TOKEN,`${t}`)}get thumbnailToken(){var t;return(t=this.getAttribute(E.THUMBNAIL_TOKEN))!=null?t:void 0}set thumbnailToken(t){this.setAttribute(E.THUMBNAIL_TOKEN,`${t}`)}get storyboardToken(){var t;return(t=this.getAttribute(E.STORYBOARD_TOKEN))!=null?t:void 0}set storyboardToken(t){this.setAttribute(E.STORYBOARD_TOKEN,`${t}`)}addTextTrack(t,a,r,n){var d;let o=(d=this.media)==null?void 0:d.nativeEl;if(!!o)return(0,P.addTextTrack)(o,t,a,r,n)}removeTextTrack(t){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(!!a)return(0,P.removeTextTrack)(a,t)}get textTracks(){var t;return(t=this.media)==null?void 0:t.textTracks}};Ki=new WeakMap,Yi=new WeakMap,Ke=new WeakMap,Gi=new WeakMap,Mt=new WeakMap,st=new WeakSet,ai=function(){var t,a,r;if(!k(this,Ki)){le(this,Ki,!0),K(this,ot,ri).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof B.HTMLElement))throw""}catch{be("<media-theme> failed to upgrade!")}try{if(customElements.upgrade(this.media),!(this.media instanceof g.default))throw""}catch{be("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof on))throw""}catch{be("<media-controller> failed to upgrade!")}ad(this),K(this,Br,xd).call(this),K(this,$r,Od).call(this),K(this,Vr,Nd).call(this),le(this,Ke,(a=(t=this.mediaController)==null?void 0:t.hasAttribute("userinactive"))!=null?a:!0),K(this,Hr,Ud).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",()=>{K(this,ot,ri).call(this)})}},Pr=new WeakSet,Dd=function(){var t,a;try{(t=window==null?void 0:window.CSS)==null||t.registerProperty({name:"--media-primary-color",syntax:"<color>",inherits:!0}),(a=window==null?void 0:window.CSS)==null||a.registerProperty({name:"--media-secondary-color",syntax:"<color>",inherits:!0})}catch{}},Zi=new WeakSet,Vs=function(t){Object.assign(k(this,Mt),t),K(this,ot,ri).call(this)},ot=new WeakSet,ri=function(t={}){Id(Sd(om(this,{...k(this,Mt),...t})),this.shadowRoot)},Br=new WeakSet,xd=function(){let t=r=>{var d,u;if(!(r!=null&&r.startsWith("theme-")))return;let n=r.replace(/^theme-/,"");if($s.includes(n))return;let o=this.getAttribute(r);o!=null?(d=this.mediaTheme)==null||d.setAttribute(n,o):(u=this.mediaTheme)==null||u.removeAttribute(n)};new MutationObserver(r=>{for(let{attributeName:n}of r)t(n)}).observe(this,{attributes:!0}),this.getAttributeNames().forEach(t)},$r=new WeakSet,Od=function(){var a;let t=r=>{let{detail:n}=r;if(n instanceof g.MediaError||(n=new g.MediaError(n.message,n.code,n.fatal)),!(n!=null&&n.fatal)){et(n),n.data&&et(`${n.name} data:`,n.data);return}let{dialog:o,devlog:d}=Nr(n,!window.navigator.onLine,this.playbackId,this.playbackToken);d.message&&ks(d),be(n),n.data&&be(`${n.name} data:`,n.data),K(this,Zi,Vs).call(this,{isDialogOpen:!0,dialog:o})};this.addEventListener("error",t),this.media&&(this.media.errorTranslator=(r={})=>{var o,d,u;if(!(((o=this.media)==null?void 0:o.error)instanceof g.MediaError))return r;let{devlog:n}=Nr((d=this.media)==null?void 0:d.error,!window.navigator.onLine,this.playbackId,this.playbackToken,!1);return{player_error_code:(u=this.media)==null?void 0:u.error.code,player_error_message:n.message?String(n.message):r.player_error_message,player_error_context:n.context?String(n.context):r.player_error_context}}),(a=this.media)==null||a.addEventListener("error",r=>{var o,d;let{detail:n}=r;if(!n){let{message:u,code:c}=(d=(o=this.media)==null?void 0:o.error)!=null?d:{};n=new g.MediaError(u,c)}!(n!=null&&n.fatal)||this.dispatchEvent(new CustomEvent("error",{detail:n}))})},Vr=new WeakSet,Nd=function(){var a,r,n,o;let t=()=>K(this,ot,ri).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",t),(o=(n=this.media)==null?void 0:n.textTracks)==null||o.addEventListener("removetrack",t)},Hr=new WeakSet,Ud=function(){var h,f;let t=/.*Version\/.*Safari\/.*/.test(navigator.userAgent);if(!/Firefox/i.test(navigator.userAgent))return;let r,n=new WeakMap,o=()=>this.streamType===P.StreamTypes.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,d=(b,T,V=!1)=>{if(o())return;Array.from(b&&b.activeCues||[]).forEach(I=>{if(!(!I.snapToLines||I.line<-5||I.line>=0&&I.line<10))if(!T||this.paused){let re=I.text.split(`
|
|
2021
|
+
`;var Bs=ne.createElement("template");"innerHTML"in Bs&&(Bs.innerHTML=Md);var Ld,Cd,Ur=class extends rt{};Ur.template=(Cd=(Ld=Bs.content)==null?void 0:Ld.children)==null?void 0:Cd[0];B.customElements.get("media-theme-classic")||B.customElements.define("media-theme-classic",Ur);var sm="classic";var Fe={SRC:"src",POSTER:"poster"},p={STYLE:"style",DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-color",FORWARD_SEEK_OFFSET:"forward-seek-offset",BACKWARD_SEEK_OFFSET:"backward-seek-offset",PLAYBACK_TOKEN:"playback-token",THUMBNAIL_TOKEN:"thumbnail-token",STORYBOARD_TOKEN:"storyboard-token",STORYBOARD_SRC:"storyboard-src",THUMBNAIL_TIME:"thumbnail-time",AUDIO:"audio",NOHOTKEYS:"nohotkeys",HOTKEYS:"hotkeys",PLAYBACK_RATES:"playbackrates",DEFAULT_SHOW_REMAINING_TIME:"default-show-remaining-time",TITLE:"title",PLACEHOLDER:"placeholder",THEME:"theme",DEFAULT_STREAM_TYPE:"default-stream-type",TARGET_LIVE_WINDOW:"target-live-window",NO_VOLUME_PREF:"no-volume-pref"},$s=["audio","backwardseekoffset","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","novolumepref"];function om(i,e){var a;return{src:!i.playbackId&&i.src,playbackId:i.playbackId,hasSrc:!!i.playbackId||!!i.src,poster:i.poster,storyboard:i.storyboard,storyboardSrc:i.getAttribute(p.STORYBOARD_SRC),placeholder:i.getAttribute("placeholder"),themeTemplate:lm(i),thumbnailTime:!i.tokens.thumbnail&&i.thumbnailTime,autoplay:i.autoplay,crossOrigin:i.crossOrigin,loop:i.loop,noHotKeys:i.hasAttribute(p.NOHOTKEYS),hotKeys:i.getAttribute(p.HOTKEYS),muted:i.muted,paused:i.paused,preload:i.preload,envKey:i.envKey,preferCmcd:i.preferCmcd,debug:i.debug,disableCookies:i.disableCookies,tokens:i.tokens,beaconCollectionDomain:i.beaconCollectionDomain,maxResolution:i.maxResolution,metadata:i.metadata,playerSoftwareName:i.playerSoftwareName,playerSoftwareVersion:i.playerSoftwareVersion,startTime:i.startTime,preferPlayback:i.preferPlayback,audio:i.audio,defaultStreamType:i.defaultStreamType,targetLiveWindow:i.getAttribute(g.Attributes.TARGET_LIVE_WINDOW),streamType:wi(i.getAttribute(g.Attributes.STREAM_TYPE)),primaryColor:i.primaryColor,secondaryColor:i.secondaryColor,forwardSeekOffset:i.forwardSeekOffset,backwardSeekOffset:i.backwardSeekOffset,defaultHiddenCaptions:i.defaultHiddenCaptions,defaultShowRemainingTime:i.defaultShowRemainingTime,hideDuration:dm(i),playbackRates:i.getAttribute(p.PLAYBACK_RATES),customDomain:(a=i.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?a:void 0,title:i.getAttribute(p.TITLE),novolumepref:i.hasAttribute(p.NO_VOLUME_PREF),...e}}function lm(i){var t,a;let e=i.theme;if(e){let r=(a=(t=i.getRootNode())==null?void 0:t.getElementById)==null?void 0:a.call(t,e);if(r&&r instanceof HTMLTemplateElement)return r;e.startsWith("media-theme-")||(e=`media-theme-${e}`);let n=B.customElements.get(e);if(n!=null&&n.template)return n.template}}function dm(i){var t;let e=(t=i.mediaController)==null?void 0:t.querySelector("media-time-display");return e&&getComputedStyle(e).getPropertyValue("--media-duration-display-display").trim()==="none"}function Rd(i){let e=i.hasAttribute(p.TITLE)?{video_title:i.getAttribute(p.TITLE)}:{};return i.getAttributeNames().filter(t=>t.startsWith("metadata-")).reduce((t,a)=>{let r=i.getAttribute(a);return r!==null&&(t[a.replace(/^metadata-/,"").replace(/-/g,"_")]=r),t},e)}var um=Object.values(g.Attributes),cm=Object.values(Fe),mm=Object.values(p),hm=kr(),pm="mux-player",wd={dialog:void 0,isDialogOpen:!1},Ki,Yi,Ke,Gi,Mt,st,ai,Pr,Dd,Zi,Vs,ot,ri,Br,xd,$r,Od,Vr,Nd,Hr,Ud,Fi=class extends Ms{constructor(){super();W(this,st);W(this,Pr);W(this,Zi);W(this,ot);W(this,Br);W(this,$r);W(this,Vr);W(this,Hr);W(this,Ki,!1);W(this,Yi,{});W(this,Ke,!0);W(this,Gi,new Ir(this,"hotkeys"));W(this,Mt,{...wd,onCloseErrorDialog:()=>K(this,Zi,Vs).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:t=>{ys(this,ne.activeElement)||t.preventDefault()}});this.attachShadow({mode:"open"}),K(this,Pr,Dd).call(this),this.isConnected&&K(this,st,ai).call(this)}static get observedAttributes(){var t;return[...(t=Ms.observedAttributes)!=null?t:[],...cm,...um,...mm]}get mediaTheme(){var t;return(t=this.shadowRoot)==null?void 0:t.querySelector("media-theme")}get mediaController(){var t,a;return(a=(t=this.mediaTheme)==null?void 0:t.shadowRoot)==null?void 0:a.querySelector("media-controller")}connectedCallback(){var a;let t=(a=this.shadowRoot)==null?void 0:a.querySelector("mux-video");t&&(t.metadata=Rd(this))}attributeChangedCallback(t,a,r){switch(K(this,st,ai).call(this),super.attributeChangedCallback(t,a,r),t){case p.HOTKEYS:k(this,Gi).value=r;break;case p.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&et(y("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case p.THUMBNAIL_TOKEN:{let{aud:o}=je(r);r&&o!=="t"&&et(y("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:o}));break}case p.STORYBOARD_TOKEN:{let{aud:o}=je(r);r&&o!=="s"&&et(y("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:o}));break}case g.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&be(y("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r}));break}case g.Attributes.STREAM_TYPE:r&&![P.StreamTypes.LIVE,P.StreamTypes.ON_DEMAND,P.StreamTypes.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:ks({file:"invalid-stream-type.md",message:y("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):this.targetLiveWindow=r===P.StreamTypes.LIVE?0:Number.NaN}[g.Attributes.PLAYBACK_ID,Fe.SRC,p.PLAYBACK_TOKEN].includes(t)&&a!==r&&le(this,Mt,{...k(this,Mt),...wd}),K(this,ot,ri).call(this,{[Jl(t)]:r})}get preferCmcd(){var t;return(t=this.getAttribute(g.Attributes.PREFER_CMCD))!=null?t:void 0}set preferCmcd(t){t!==this.preferCmcd&&(t?P.CmcdTypeValues.includes(t)?this.setAttribute(g.Attributes.PREFER_CMCD,t):et(`Invalid value for preferCmcd. Must be one of ${P.CmcdTypeValues.join()}`):this.removeAttribute(g.Attributes.PREFER_CMCD))}get hasPlayed(){var t,a;return(a=(t=this.mediaController)==null?void 0:t.hasAttribute("media-has-played"))!=null?a:!1}get inLiveWindow(){var t;return(t=this.mediaController)==null?void 0:t.hasAttribute("media-time-is-live")}get _hls(){var t;return(t=this.media)==null?void 0:t._hls}get mux(){var t;return(t=this.media)==null?void 0:t.mux}get theme(){var t;return(t=this.getAttribute(p.THEME))!=null?t:sm}set theme(t){this.setAttribute(p.THEME,`${t}`)}get themeProps(){let t=this.mediaTheme;if(!t)return;let a={};for(let r of t.getAttributeNames()){if($s.includes(r))continue;let n=t.getAttribute(r);a[_r(r)]=n===""?!0:n}return a}set themeProps(t){var r,n;K(this,st,ai).call(this);let a={...this.themeProps,...t};for(let o in a){if($s.includes(o))continue;let d=t==null?void 0:t[o];typeof d=="boolean"||d==null?(r=this.mediaTheme)==null||r.toggleAttribute(Ar(o),Boolean(d)):(n=this.mediaTheme)==null||n.setAttribute(Ar(o),d)}}get playbackId(){var t;return(t=this.getAttribute(g.Attributes.PLAYBACK_ID))!=null?t:void 0}set playbackId(t){t?this.setAttribute(g.Attributes.PLAYBACK_ID,t):this.removeAttribute(g.Attributes.PLAYBACK_ID)}get src(){var t,a;return this.playbackId?(t=St(this,Fe.SRC))!=null?t:void 0:(a=this.getAttribute(Fe.SRC))!=null?a:void 0}set src(t){t?this.setAttribute(Fe.SRC,t):this.removeAttribute(Fe.SRC)}get poster(){var a;let t=this.getAttribute(Fe.POSTER);if(t!=null)return t;if(this.playbackId&&!this.audio)return zl(this.playbackId,{domain:this.customDomain,thumbnailTime:(a=this.thumbnailTime)!=null?a:this.startTime,token:this.tokens.thumbnail})}set poster(t){t||t===""?this.setAttribute(Fe.POSTER,t):this.removeAttribute(Fe.POSTER)}get storyboardSrc(){var t;return(t=this.getAttribute(p.STORYBOARD_SRC))!=null?t:void 0}set storyboardSrc(t){t?this.setAttribute(p.STORYBOARD_SRC,t):this.removeAttribute(p.STORYBOARD_SRC)}get storyboard(){if(this.storyboardSrc&&!this.tokens.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[P.StreamTypes.LIVE,P.StreamTypes.UNKNOWN].includes(this.streamType)))return Xl(this.playbackId,{domain:this.customDomain,token:this.tokens.storyboard})}get audio(){return this.hasAttribute(p.AUDIO)}set audio(t){if(!t){this.removeAttribute(p.AUDIO);return}this.setAttribute(p.AUDIO,"")}get hotkeys(){return k(this,Gi)}get nohotkeys(){return this.hasAttribute(p.NOHOTKEYS)}set nohotkeys(t){if(!t){this.removeAttribute(p.NOHOTKEYS);return}this.setAttribute(p.NOHOTKEYS,"")}get thumbnailTime(){return Be(this.getAttribute(p.THUMBNAIL_TIME))}set thumbnailTime(t){this.setAttribute(p.THUMBNAIL_TIME,`${t}`)}get title(){var t;return(t=this.getAttribute(p.TITLE))!=null?t:""}set title(t){t!==this.title&&(t?this.setAttribute(p.TITLE,t):this.removeAttribute("title"),super.title=t)}get placeholder(){var t;return(t=St(this,p.PLACEHOLDER))!=null?t:""}set placeholder(t){this.setAttribute(p.PLACEHOLDER,`${t}`)}get primaryColor(){var a,r;let t=this.getAttribute(p.PRIMARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=B.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),t))return t}set primaryColor(t){this.setAttribute(p.PRIMARY_COLOR,`${t}`)}get secondaryColor(){var a,r;let t=this.getAttribute(p.SECONDARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=B.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),t))return t}set secondaryColor(t){this.setAttribute(p.SECONDARY_COLOR,`${t}`)}get defaultShowRemainingTime(){return this.hasAttribute(p.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(t){t?this.setAttribute(p.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(p.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(!!this.hasAttribute(p.PLAYBACK_RATES))return this.getAttribute(p.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(t=>Number(t)).filter(t=>!Number.isNaN(t)).sort((t,a)=>t-a)}set playbackRates(t){if(!t){this.removeAttribute(p.PLAYBACK_RATES);return}this.setAttribute(p.PLAYBACK_RATES,t.join(" "))}get forwardSeekOffset(){var t;return(t=Be(this.getAttribute(p.FORWARD_SEEK_OFFSET)))!=null?t:10}set forwardSeekOffset(t){this.setAttribute(p.FORWARD_SEEK_OFFSET,`${t}`)}get backwardSeekOffset(){var t;return(t=Be(this.getAttribute(p.BACKWARD_SEEK_OFFSET)))!=null?t:10}set backwardSeekOffset(t){this.setAttribute(p.BACKWARD_SEEK_OFFSET,`${t}`)}get defaultHiddenCaptions(){return this.hasAttribute(p.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(t){t?this.setAttribute(p.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(p.DEFAULT_HIDDEN_CAPTIONS)}get playerSoftwareName(){var t;return(t=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_NAME))!=null?t:pm}get playerSoftwareVersion(){var t;return(t=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_VERSION))!=null?t:hm}get beaconCollectionDomain(){var t;return(t=this.getAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN))!=null?t:void 0}set beaconCollectionDomain(t){t!==this.beaconCollectionDomain&&(t?this.setAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN,t):this.removeAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var t;return(t=this.getAttribute(g.Attributes.MAX_RESOLUTION))!=null?t:void 0}set maxResolution(t){t!==this.maxResolution&&(t?this.setAttribute(g.Attributes.MAX_RESOLUTION,t):this.removeAttribute(g.Attributes.MAX_RESOLUTION))}get customDomain(){var t;return(t=this.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?t:void 0}set customDomain(t){t!==this.customDomain&&(t?this.setAttribute(g.Attributes.CUSTOM_DOMAIN,t):this.removeAttribute(g.Attributes.CUSTOM_DOMAIN))}get envKey(){var t;return(t=St(this,g.Attributes.ENV_KEY))!=null?t:void 0}set envKey(t){this.setAttribute(g.Attributes.ENV_KEY,`${t}`)}get noVolumePref(){return this.hasAttribute(p.NO_VOLUME_PREF)}set noVolumePref(t){t?this.setAttribute(p.NO_VOLUME_PREF,""):this.removeAttribute(p.NO_VOLUME_PREF)}get debug(){return St(this,g.Attributes.DEBUG)!=null}set debug(t){t?this.setAttribute(g.Attributes.DEBUG,""):this.removeAttribute(g.Attributes.DEBUG)}get disableCookies(){return St(this,g.Attributes.DISABLE_COOKIES)!=null}set disableCookies(t){t?this.setAttribute(g.Attributes.DISABLE_COOKIES,""):this.removeAttribute(g.Attributes.DISABLE_COOKIES)}get streamType(){var t,a,r;return(r=(a=this.getAttribute(g.Attributes.STREAM_TYPE))!=null?a:(t=this.media)==null?void 0:t.streamType)!=null?r:P.StreamTypes.UNKNOWN}set streamType(t){this.setAttribute(g.Attributes.STREAM_TYPE,`${t}`)}get defaultStreamType(){var t,a,r;return(r=(a=this.getAttribute(p.DEFAULT_STREAM_TYPE))!=null?a:(t=this.mediaController)==null?void 0:t.getAttribute(p.DEFAULT_STREAM_TYPE))!=null?r:P.StreamTypes.ON_DEMAND}set defaultStreamType(t){t?this.setAttribute(p.DEFAULT_STREAM_TYPE,t):this.removeAttribute(p.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var t,a;return this.hasAttribute(p.TARGET_LIVE_WINDOW)?+this.getAttribute(p.TARGET_LIVE_WINDOW):(a=(t=this.media)==null?void 0:t.targetLiveWindow)!=null?a:Number.NaN}set targetLiveWindow(t){t!=this.targetLiveWindow&&(t==null?this.removeAttribute(p.TARGET_LIVE_WINDOW):this.setAttribute(p.TARGET_LIVE_WINDOW,`${+t}`))}get liveEdgeStart(){var t;return(t=this.media)==null?void 0:t.liveEdgeStart}get startTime(){return Be(St(this,g.Attributes.START_TIME))}set startTime(t){this.setAttribute(g.Attributes.START_TIME,`${t}`)}get preferPlayback(){let t=this.getAttribute(g.Attributes.PREFER_PLAYBACK);if(t===P.PlaybackTypes.MSE||t===P.PlaybackTypes.NATIVE)return t}set preferPlayback(t){t!==this.preferPlayback&&(t===P.PlaybackTypes.MSE||t===P.PlaybackTypes.NATIVE?this.setAttribute(g.Attributes.PREFER_PLAYBACK,t):this.removeAttribute(g.Attributes.PREFER_PLAYBACK))}get metadata(){var t;return(t=this.media)==null?void 0:t.metadata}set metadata(t){if(K(this,st,ai).call(this),!this.media){be("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...Rd(this),...t}}async addCuePoints(t){var a;if(K(this,st,ai).call(this),!this.media){be("underlying media element missing when trying to addCuePoints. cuePoints will not be added.");return}return(a=this.media)==null?void 0:a.addCuePoints(t)}get activeCuePoint(){var t;return(t=this.media)==null?void 0:t.activeCuePoint}get cuePoints(){var t,a;return(a=(t=this.media)==null?void 0:t.cuePoints)!=null?a:[]}getStartDate(){var t;return(t=this.media)==null?void 0:t.getStartDate()}get currentPdt(){var t;return(t=this.media)==null?void 0:t.currentPdt}get tokens(){let t=this.getAttribute(p.PLAYBACK_TOKEN),a=this.getAttribute(p.THUMBNAIL_TOKEN),r=this.getAttribute(p.STORYBOARD_TOKEN);return{...k(this,Yi),...t!=null?{playback:t}:{},...a!=null?{thumbnail:a}:{},...r!=null?{storyboard:r}:{}}}set tokens(t){le(this,Yi,t!=null?t:{})}get playbackToken(){var t;return(t=this.getAttribute(p.PLAYBACK_TOKEN))!=null?t:void 0}set playbackToken(t){this.setAttribute(p.PLAYBACK_TOKEN,`${t}`)}get thumbnailToken(){var t;return(t=this.getAttribute(p.THUMBNAIL_TOKEN))!=null?t:void 0}set thumbnailToken(t){this.setAttribute(p.THUMBNAIL_TOKEN,`${t}`)}get storyboardToken(){var t;return(t=this.getAttribute(p.STORYBOARD_TOKEN))!=null?t:void 0}set storyboardToken(t){this.setAttribute(p.STORYBOARD_TOKEN,`${t}`)}addTextTrack(t,a,r,n){var d;let o=(d=this.media)==null?void 0:d.nativeEl;if(!!o)return(0,P.addTextTrack)(o,t,a,r,n)}removeTextTrack(t){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(!!a)return(0,P.removeTextTrack)(a,t)}get textTracks(){var t;return(t=this.media)==null?void 0:t.textTracks}};Ki=new WeakMap,Yi=new WeakMap,Ke=new WeakMap,Gi=new WeakMap,Mt=new WeakMap,st=new WeakSet,ai=function(){var t,a,r;if(!k(this,Ki)){le(this,Ki,!0),K(this,ot,ri).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof B.HTMLElement))throw""}catch{be("<media-theme> failed to upgrade!")}try{if(customElements.upgrade(this.media),!(this.media instanceof g.default))throw""}catch{be("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof on))throw""}catch{be("<media-controller> failed to upgrade!")}ad(this),K(this,Br,xd).call(this),K(this,$r,Od).call(this),K(this,Vr,Nd).call(this),le(this,Ke,(a=(t=this.mediaController)==null?void 0:t.hasAttribute("userinactive"))!=null?a:!0),K(this,Hr,Ud).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",()=>{K(this,ot,ri).call(this)})}},Pr=new WeakSet,Dd=function(){var t,a;try{(t=window==null?void 0:window.CSS)==null||t.registerProperty({name:"--media-primary-color",syntax:"<color>",inherits:!0}),(a=window==null?void 0:window.CSS)==null||a.registerProperty({name:"--media-secondary-color",syntax:"<color>",inherits:!0})}catch{}},Zi=new WeakSet,Vs=function(t){Object.assign(k(this,Mt),t),K(this,ot,ri).call(this)},ot=new WeakSet,ri=function(t={}){Id(Sd(om(this,{...k(this,Mt),...t})),this.shadowRoot)},Br=new WeakSet,xd=function(){let t=r=>{var d,u;if(!(r!=null&&r.startsWith("theme-")))return;let n=r.replace(/^theme-/,"");if($s.includes(n))return;let o=this.getAttribute(r);o!=null?(d=this.mediaTheme)==null||d.setAttribute(n,o):(u=this.mediaTheme)==null||u.removeAttribute(n)};new MutationObserver(r=>{for(let{attributeName:n}of r)t(n)}).observe(this,{attributes:!0}),this.getAttributeNames().forEach(t)},$r=new WeakSet,Od=function(){var a;let t=r=>{let{detail:n}=r;if(n instanceof g.MediaError||(n=new g.MediaError(n.message,n.code,n.fatal)),!(n!=null&&n.fatal)){et(n),n.data&&et(`${n.name} data:`,n.data);return}let{dialog:o,devlog:d}=Nr(n,!window.navigator.onLine,this.playbackId,this.playbackToken);d.message&&ks(d),be(n),n.data&&be(`${n.name} data:`,n.data),K(this,Zi,Vs).call(this,{isDialogOpen:!0,dialog:o})};this.addEventListener("error",t),this.media&&(this.media.errorTranslator=(r={})=>{var o,d,u;if(!(((o=this.media)==null?void 0:o.error)instanceof g.MediaError))return r;let{devlog:n}=Nr((d=this.media)==null?void 0:d.error,!window.navigator.onLine,this.playbackId,this.playbackToken,!1);return{player_error_code:(u=this.media)==null?void 0:u.error.code,player_error_message:n.message?String(n.message):r.player_error_message,player_error_context:n.context?String(n.context):r.player_error_context}}),(a=this.media)==null||a.addEventListener("error",r=>{var o,d;let{detail:n}=r;if(!n){let{message:u,code:c}=(d=(o=this.media)==null?void 0:o.error)!=null?d:{};n=new g.MediaError(u,c)}!(n!=null&&n.fatal)||this.dispatchEvent(new CustomEvent("error",{detail:n}))})},Vr=new WeakSet,Nd=function(){var a,r,n,o;let t=()=>K(this,ot,ri).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",t),(o=(n=this.media)==null?void 0:n.textTracks)==null||o.addEventListener("removetrack",t)},Hr=new WeakSet,Ud=function(){var h,f;let t=/.*Version\/.*Safari\/.*/.test(navigator.userAgent);if(!/Firefox/i.test(navigator.userAgent))return;let r,n=new WeakMap,o=()=>this.streamType===P.StreamTypes.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,d=(b,T,V=!1)=>{if(o())return;Array.from(b&&b.activeCues||[]).forEach(I=>{if(!(!I.snapToLines||I.line<-5||I.line>=0&&I.line<10))if(!T||this.paused){let re=I.text.split(`
|
|
2022
2022
|
`).length,ge=t?-2:-3;this.streamType===P.StreamTypes.LIVE&&(ge=t?-1:-2);let oe=ge-re;if(I.line===oe&&!V)return;n.has(I)||n.set(I,I.line),I.line=oe-1,I.line=oe}else setTimeout(()=>{I.line=n.get(I)||"auto"},500)})},u=()=>{var b,T;d(r,(T=(b=this.mediaController)==null?void 0:b.hasAttribute("userinactive"))!=null?T:!1)},c=()=>{var V,G;let T=Array.from(((G=(V=this.mediaController)==null?void 0:V.media)==null?void 0:G.textTracks)||[]).filter(I=>["subtitles","captions"].includes(I.kind)&&I.mode==="showing")[0];T!==r&&(r==null||r.removeEventListener("cuechange",u)),r=T,r==null||r.addEventListener("cuechange",u),d(r,k(this,Ke))};if(c(),(h=this.textTracks)==null||h.addEventListener("change",c),(f=this.textTracks)==null||f.addEventListener("addtrack",c),navigator.userAgent.includes("Chrome/")){let b=()=>{d(r,k(this,Ke),!0),this.paused||window.requestAnimationFrame(b)};this.addEventListener("playing",()=>{b()})}this.addEventListener("userinactivechange",()=>{var T,V;let b=(V=(T=this.mediaController)==null?void 0:T.hasAttribute("userinactive"))!=null?V:!0;k(this,Ke)!==b&&(le(this,Ke,b),d(r,k(this,Ke)))})};function St(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}B.customElements.get("mux-player")||(B.customElements.define("mux-player",Fi),B.MuxPlayerElement=Fi);var Em=Fi;
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Oe=(t,a,e)=>{if(!a.has(t))throw TypeError("Cannot "+e)};var u=(t,a,e)=>(Oe(t,a,"read from private field"),e?e.call(t):a.get(t)),b=(t,a,e)=>{if(a.has(t))throw TypeError("Cannot add the same private member more than once");a instanceof WeakSet?a.add(t):a.set(t,e)},x=(t,a,e,r)=>(Oe(t,a,"write to private field"),r?r.call(t,e):a.set(t,e),e);var f=(t,a,e)=>(Oe(t,a,"access private method"),e);var Z=class{addEventListener(){}removeEventListener(){}dispatchEvent(a){return!0}};if(typeof DocumentFragment=="undefined"){class t extends Z{}globalThis.DocumentFragment=t}var z=class extends Z{},Re=class extends Z{},It={get(t){},define(t,a,e){},upgrade(t){},whenDefined(t){return Promise.resolve(z)}},J,Le=class{constructor(a,e={}){b(this,J,void 0);x(this,J,e==null?void 0:e.detail)}get detail(){return u(this,J)}initCustomEvent(){}};J=new WeakMap;function Dt(t,a){return new z}var rt={document:{createElement:Dt},DocumentFragment,customElements:It,CustomEvent:Le,EventTarget:Z,HTMLElement:z,HTMLVideoElement:Re},ot=typeof window=="undefined"||typeof globalThis.customElements=="undefined",p=ot?rt:globalThis,T=ot?rt.document:globalThis.document;import{MediaController as ma}from"media-chrome";import"media-chrome/dist/experimental/index.js";import ua,{MediaError as ke,Attributes as d}from"@mux/mux-video";import{StreamTypes as O,PlaybackTypes as Ee,addTextTrack as ca,removeTextTrack as pa,CmcdTypeValues as Rt}from"@mux/playback-core";import{VideoEvents as Ut}from"@mux/mux-video";var Vt="en",H={code:Vt};var nt="en";function l(t,a=!0){var i,o;let e=a&&(o=(i=H)==null?void 0:i[t])!=null?o:t,r=a?H.code:nt;return new Me(e,r)}var Me=class{constructor(a,e=(r=>(r=H.code)!=null?r:nt)()){this.message=a,this.locale=e}format(a){return this.message.replace(/\{(\w+)\}/g,(e,r)=>{var i;return(i=a[r])!=null?i:""})}toString(){return this.message}};function st(t){let a="";return Object.entries(t).forEach(([e,r])=>{r!=null&&(a+=`${le(e)}: ${r}; `)}),a?a.trim():void 0}function le(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function me(t){return t.replace(/[-_]([a-z])/g,(a,e)=>e.toUpperCase())}function R(t){if(t==null)return;let a=+t;return Number.isNaN(a)?void 0:a}function ue(t){let a=Ht(t).toString();return a?"?"+a:""}function Ht(t){let a={};for(let e in t)t[e]!=null&&(a[e]=t[e]);return new URLSearchParams(a)}function N(t){let a=(t!=null?t:"").split(".")[1];if(!a)return{};let e=a.replace(/-/g,"+").replace(/_/g,"/"),r=decodeURIComponent(atob(e).split("").map(function(i){return"%"+("00"+i.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(r)}var Ce=(t,a)=>!t||!a?!1:t.contains(a)?!0:Ce(t,a.getRootNode().host);import{StreamTypes as Pe}from"@mux/playback-core";var _e="mux.com",$t=()=>{try{return"1.14.
|
|
1
|
+
var Oe=(t,a,e)=>{if(!a.has(t))throw TypeError("Cannot "+e)};var u=(t,a,e)=>(Oe(t,a,"read from private field"),e?e.call(t):a.get(t)),b=(t,a,e)=>{if(a.has(t))throw TypeError("Cannot add the same private member more than once");a instanceof WeakSet?a.add(t):a.set(t,e)},x=(t,a,e,r)=>(Oe(t,a,"write to private field"),r?r.call(t,e):a.set(t,e),e);var f=(t,a,e)=>(Oe(t,a,"access private method"),e);var Z=class{addEventListener(){}removeEventListener(){}dispatchEvent(a){return!0}};if(typeof DocumentFragment=="undefined"){class t extends Z{}globalThis.DocumentFragment=t}var z=class extends Z{},Re=class extends Z{},It={get(t){},define(t,a,e){},upgrade(t){},whenDefined(t){return Promise.resolve(z)}},J,Le=class{constructor(a,e={}){b(this,J,void 0);x(this,J,e==null?void 0:e.detail)}get detail(){return u(this,J)}initCustomEvent(){}};J=new WeakMap;function Dt(t,a){return new z}var rt={document:{createElement:Dt},DocumentFragment,customElements:It,CustomEvent:Le,EventTarget:Z,HTMLElement:z,HTMLVideoElement:Re},ot=typeof window=="undefined"||typeof globalThis.customElements=="undefined",p=ot?rt:globalThis,T=ot?rt.document:globalThis.document;import{MediaController as ma}from"media-chrome";import"media-chrome/dist/experimental/index.js";import ua,{MediaError as ke,Attributes as d}from"@mux/mux-video";import{StreamTypes as O,PlaybackTypes as Ee,addTextTrack as ca,removeTextTrack as pa,CmcdTypeValues as Rt}from"@mux/playback-core";import{VideoEvents as Ut}from"@mux/mux-video";var Vt="en",H={code:Vt};var nt="en";function l(t,a=!0){var i,o;let e=a&&(o=(i=H)==null?void 0:i[t])!=null?o:t,r=a?H.code:nt;return new Me(e,r)}var Me=class{constructor(a,e=(r=>(r=H.code)!=null?r:nt)()){this.message=a,this.locale=e}format(a){return this.message.replace(/\{(\w+)\}/g,(e,r)=>{var i;return(i=a[r])!=null?i:""})}toString(){return this.message}};function st(t){let a="";return Object.entries(t).forEach(([e,r])=>{r!=null&&(a+=`${le(e)}: ${r}; `)}),a?a.trim():void 0}function le(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function me(t){return t.replace(/[-_]([a-z])/g,(a,e)=>e.toUpperCase())}function R(t){if(t==null)return;let a=+t;return Number.isNaN(a)?void 0:a}function ue(t){let a=Ht(t).toString();return a?"?"+a:""}function Ht(t){let a={};for(let e in t)t[e]!=null&&(a[e]=t[e]);return new URLSearchParams(a)}function N(t){let a=(t!=null?t:"").split(".")[1];if(!a)return{};let e=a.replace(/-/g,"+").replace(/_/g,"/"),r=decodeURIComponent(atob(e).split("").map(function(i){return"%"+("00"+i.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(r)}var Ce=(t,a)=>!t||!a?!1:t.contains(a)?!0:Ce(t,a.getRootNode().host);import{StreamTypes as Pe}from"@mux/playback-core";var _e="mux.com",$t=()=>{try{return"1.14.1"}catch{}return"UNKNOWN"},Kt=$t(),pe=()=>Kt,Ne=(t,{maxResolution:a,token:e,domain:r=_e}={})=>{let n=!!e?{token:e}:{redundant_streams:!0,...a?{max_resolution:a}:{}};return`https://stream.${r}/${t}.m3u8${ue(n)}`},dt=(t,{token:a,thumbnailTime:e,domain:r=_e}={})=>{let i=a==null?e:void 0,{aud:o}=N(a);if(!(a&&o!=="t"))return`https://image.${r}/${t}/thumbnail.webp${ue({token:a,time:i})}`},lt=(t,{token:a,domain:e=_e}={})=>{let{aud:r}=N(a);if(!(a&&r!=="s"))return`https://image.${e}/${t}/storyboard.vtt${ue({token:a,format:"webp"})}`},Q=t=>{if(!!t){if([Pe.LIVE,Pe.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return Pe.LIVE}};var Ft={crossorigin:"crossOrigin",playsinline:"playsInline"};function mt(t){var a;return(a=Ft[t])!=null?a:me(t)}var $,K,k,ce=class{constructor(a,e){b(this,$,void 0);b(this,K,void 0);b(this,k,[]);x(this,$,a),x(this,K,e)}[Symbol.iterator](){return u(this,k).values()}get length(){return u(this,k).length}get value(){var a;return(a=u(this,k).join(" "))!=null?a:""}set value(a){var e;a!==this.value&&(x(this,k,[]),this.add(...(e=a==null?void 0:a.split(" "))!=null?e:[]))}toString(){return this.value}item(a){return u(this,k)[a]}values(){return u(this,k).values()}keys(){return u(this,k).keys()}forEach(a){u(this,k).forEach(a)}add(...a){var e,r;a.forEach(i=>{this.contains(i)||u(this,k).push(i)}),!(this.value===""&&!((e=u(this,$))!=null&&e.hasAttribute(`${u(this,K)}`)))&&((r=u(this,$))==null||r.setAttribute(`${u(this,K)}`,`${this.value}`))}remove(...a){var e;a.forEach(r=>{u(this,k).splice(u(this,k).indexOf(r),1)}),(e=u(this,$))==null||e.setAttribute(`${u(this,K)}`,`${this.value}`)}contains(a){return u(this,k).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)}};$=new WeakMap,K=new WeakMap,k=new WeakMap;var ut=`[mux-player ${pe()}]`;function B(...t){console.warn(ut,...t)}function S(...t){console.error(ut,...t)}function Be(t){var e;let a=(e=t.message)!=null?e:"";if(t.context&&(a+=` ${t.context}`),t.file){let r="https://github.com/muxinc/elements/blob/main/errors/";a+=` ${l("Read more: ")}
|
|
2
2
|
${r}${t.file}`}B(a)}var y={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},F={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},pt=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}}),Yt=Ut.filter(t=>t!=="error"),Zt=Object.values(y).filter(t=>![y.PLAYSINLINE].includes(t)),Wt=Object.values(F);function bt(t){t.querySelectorAll(":scope > track").forEach(a=>{var e;(e=t.media)==null||e.append(a.cloneNode())}),Yt.forEach(a=>{var e;(e=t.media)==null||e.addEventListener(a,r=>{t.dispatchEvent(new Event(r.type))})})}var Ie=class extends p.HTMLElement{static get observedAttributes(){return[...Zt,...Wt]}constructor(){super(),this.querySelectorAll(":scope > track").forEach(r=>{var i;(i=this.media)==null||i.append(r.cloneNode())});let a=r=>{for(let i of r)i.type==="childList"&&(i.removedNodes.forEach(o=>{var m,h;let n=(m=this.media)==null?void 0:m.querySelector(`track[src="${o.src}"]`);n&&((h=this.media)==null||h.removeChild(n))}),i.addedNodes.forEach(o=>{var n;(n=this.media)==null||n.append(o.cloneNode())}))};new MutationObserver(a).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(a,e,r){var i,o;switch(a){case F.MUTED:{this.media&&(this.media.muted=r!=null,this.media.defaultMuted=r!=null);return}case F.VOLUME:{let n=(i=R(r))!=null?i:1;this.media&&(this.media.volume=n);return}case F.PLAYBACKRATE:{let n=(o=R(r))!=null?o:1;this.media&&(this.media.playbackRate=n,this.media.defaultPlaybackRate=n);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()}requestCast(a){var e;return(e=this.media)==null?void 0:e.requestCast(a)}get media(){var a;return(a=this.shadowRoot)==null?void 0:a.querySelector("mux-video")}get audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var a,e;return(e=(a=this.media)==null?void 0:a.paused)!=null?e:!0}get duration(){var a,e;return(e=(a=this.media)==null?void 0:a.duration)!=null?e:NaN}get ended(){var a,e;return(e=(a=this.media)==null?void 0:a.ended)!=null?e:!1}get buffered(){var a,e;return(e=(a=this.media)==null?void 0:a.buffered)!=null?e:pt}get seekable(){var a,e;return(e=(a=this.media)==null?void 0:a.seekable)!=null?e:pt}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 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=R(this.getAttribute(F.PLAYBACKRATE)))!=null?a:1}set defaultPlaybackRate(a){a!=null?this.setAttribute(F.PLAYBACKRATE,`${a}`):this.removeAttribute(F.PLAYBACKRATE)}get crossOrigin(){return X(this,y.CROSSORIGIN)}set crossOrigin(a){this.setAttribute(y.CROSSORIGIN,`${a}`)}get autoplay(){return X(this,y.AUTOPLAY)!=null}set autoplay(a){a?this.setAttribute(y.AUTOPLAY,typeof a=="string"?a:""):this.removeAttribute(y.AUTOPLAY)}get loop(){return X(this,y.LOOP)!=null}set loop(a){a?this.setAttribute(y.LOOP,""):this.removeAttribute(y.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=Boolean(a))}get defaultMuted(){return X(this,y.MUTED)!=null}set defaultMuted(a){a?this.setAttribute(y.MUTED,""):this.removeAttribute(y.MUTED)}get playsInline(){return X(this,y.PLAYSINLINE)!=null}set playsInline(a){S("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(y.PRELOAD,a):this.removeAttribute(y.PRELOAD)}};function X(t,a){return t.media?t.media.getAttribute(a):t.getAttribute(a)}var De=Ie;import"media-chrome/dist/media-theme-element.js";var ht=`:host {
|
|
3
3
|
--media-control-display: var(--controls);
|
|
4
4
|
--media-loading-indicator-display: var(--loading-indicator);
|
|
@@ -1069,5 +1069,5 @@ media-poster-image:not([src]) {
|
|
|
1069
1069
|
|
|
1070
1070
|
</media-controller>
|
|
1071
1071
|
</template>
|
|
1072
|
-
`;import{MediaThemeElement as la}from"media-chrome/dist/media-theme-element.js";var $e=T.createElement("template");"innerHTML"in $e&&($e.innerHTML=wt);var St,Ot,ve=class extends la{};ve.template=(Ot=(St=$e.content)==null?void 0:St.children)==null?void 0:Ot[0];p.customElements.get("media-theme-classic")||p.customElements.define("media-theme-classic",ve);var ba="classic";var M={SRC:"src",POSTER:"poster"},s={STYLE:"style",DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-color",FORWARD_SEEK_OFFSET:"forward-seek-offset",BACKWARD_SEEK_OFFSET:"backward-seek-offset",PLAYBACK_TOKEN:"playback-token",THUMBNAIL_TOKEN:"thumbnail-token",STORYBOARD_TOKEN:"storyboard-token",STORYBOARD_SRC:"storyboard-src",THUMBNAIL_TIME:"thumbnail-time",AUDIO:"audio",NOHOTKEYS:"nohotkeys",HOTKEYS:"hotkeys",PLAYBACK_RATES:"playbackrates",DEFAULT_SHOW_REMAINING_TIME:"default-show-remaining-time",TITLE:"title",PLACEHOLDER:"placeholder",THEME:"theme",DEFAULT_STREAM_TYPE:"default-stream-type",TARGET_LIVE_WINDOW:"target-live-window",NO_VOLUME_PREF:"no-volume-pref"},Ke=["audio","backwardseekoffset","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","novolumepref"];function ha(t,a){var r;return{src:!t.playbackId&&t.src,playbackId:t.playbackId,hasSrc:!!t.playbackId||!!t.src,poster:t.poster,storyboard:t.storyboard,storyboardSrc:t.getAttribute(s.STORYBOARD_SRC),placeholder:t.getAttribute("placeholder"),themeTemplate:ga(t),thumbnailTime:!t.tokens.thumbnail&&t.thumbnailTime,autoplay:t.autoplay,crossOrigin:t.crossOrigin,loop:t.loop,noHotKeys:t.hasAttribute(s.NOHOTKEYS),hotKeys:t.getAttribute(s.HOTKEYS),muted:t.muted,paused:t.paused,preload:t.preload,envKey:t.envKey,preferCmcd:t.preferCmcd,debug:t.debug,disableCookies:t.disableCookies,tokens:t.tokens,beaconCollectionDomain:t.beaconCollectionDomain,maxResolution:t.maxResolution,metadata:t.metadata,playerSoftwareName:t.playerSoftwareName,playerSoftwareVersion:t.playerSoftwareVersion,startTime:t.startTime,preferPlayback:t.preferPlayback,audio:t.audio,defaultStreamType:t.defaultStreamType,targetLiveWindow:t.getAttribute(d.TARGET_LIVE_WINDOW),streamType:Q(t.getAttribute(d.STREAM_TYPE)),primaryColor:t.primaryColor,secondaryColor:t.secondaryColor,forwardSeekOffset:t.forwardSeekOffset,backwardSeekOffset:t.backwardSeekOffset,defaultHiddenCaptions:t.defaultHiddenCaptions,defaultShowRemainingTime:t.defaultShowRemainingTime,hideDuration:fa(t),playbackRates:t.getAttribute(s.PLAYBACK_RATES),customDomain:(r=t.getAttribute(d.CUSTOM_DOMAIN))!=null?r:void 0,title:t.getAttribute(s.TITLE),novolumepref:t.hasAttribute(s.NO_VOLUME_PREF),...a}}function ga(t){var e,r;let a=t.theme;if(a){let i=(r=(e=t.getRootNode())==null?void 0:e.getElementById)==null?void 0:r.call(e,a);if(i&&i instanceof HTMLTemplateElement)return i;a.startsWith("media-theme-")||(a=`media-theme-${a}`);let o=p.customElements.get(a);if(o!=null&&o.template)return o.template}}function fa(t){var e;let a=(e=t.mediaController)==null?void 0:e.querySelector("media-time-display");return a&&getComputedStyle(a).getPropertyValue("--media-duration-display-display").trim()==="none"}function Lt(t){return t.getAttributeNames().filter(a=>a.startsWith("metadata-")).reduce((a,e)=>{let r=t.getAttribute(e);return r!==null&&(a[e.replace(/^metadata-/,"").replace(/-/g,"_")]=r),a},{})}var ya=Object.values(d),va=Object.values(M),ka=Object.values(s),Ea=pe(),Ta="mux-player",Mt={dialog:void 0,isDialogOpen:!1},re,oe,C,ne,U,D,j,Te,Ct,se,Fe,V,q,Ae,Pt,xe,_t,we,Nt,Se,Bt,ie=class extends De{constructor(){super();b(this,D);b(this,Te);b(this,se);b(this,V);b(this,Ae);b(this,xe);b(this,we);b(this,Se);b(this,re,!1);b(this,oe,{});b(this,C,!0);b(this,ne,new ce(this,"hotkeys"));b(this,U,{...Mt,onCloseErrorDialog:()=>f(this,se,Fe).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:e=>{Ce(this,T.activeElement)||e.preventDefault()}});this.attachShadow({mode:"open"}),f(this,Te,Ct).call(this),this.isConnected&&f(this,D,j).call(this)}static get observedAttributes(){var e;return[...(e=De.observedAttributes)!=null?e:[],...va,...ya,...ka]}get mediaTheme(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("media-theme")}get mediaController(){var e,r;return(r=(e=this.mediaTheme)==null?void 0:e.shadowRoot)==null?void 0:r.querySelector("media-controller")}connectedCallback(){var r;let e=(r=this.shadowRoot)==null?void 0:r.querySelector("mux-video");e&&(e.metadata=Lt(this))}attributeChangedCallback(e,r,i){switch(f(this,D,j).call(this),super.attributeChangedCallback(e,r,i),e){case s.HOTKEYS:u(this,ne).value=i;break;case s.THUMBNAIL_TIME:{i!=null&&this.tokens.thumbnail&&B(l("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case s.THUMBNAIL_TOKEN:{let{aud:n}=N(i);i&&n!=="t"&&B(l("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:n}));break}case s.STORYBOARD_TOKEN:{let{aud:n}=N(i);i&&n!=="s"&&B(l("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:n}));break}case d.PLAYBACK_ID:{i!=null&&i.includes("?token")&&S(l("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:i}));break}case d.STREAM_TYPE:i&&![O.LIVE,O.ON_DEMAND,O.UNKNOWN].includes(i)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=i.includes("dvr")?Number.POSITIVE_INFINITY:0:Be({file:"invalid-stream-type.md",message:l("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):this.targetLiveWindow=i===O.LIVE?0:Number.NaN}[d.PLAYBACK_ID,M.SRC,s.PLAYBACK_TOKEN].includes(e)&&r!==i&&x(this,U,{...u(this,U),...Mt}),f(this,V,q).call(this,{[mt(e)]:i})}get preferCmcd(){var e;return(e=this.getAttribute(d.PREFER_CMCD))!=null?e:void 0}set preferCmcd(e){e!==this.preferCmcd&&(e?Rt.includes(e)?this.setAttribute(d.PREFER_CMCD,e):B(`Invalid value for preferCmcd. Must be one of ${Rt.join()}`):this.removeAttribute(d.PREFER_CMCD))}get hasPlayed(){var e,r;return(r=(e=this.mediaController)==null?void 0:e.hasAttribute("media-has-played"))!=null?r:!1}get inLiveWindow(){var e;return(e=this.mediaController)==null?void 0:e.hasAttribute("media-time-is-live")}get _hls(){var e;return(e=this.media)==null?void 0:e._hls}get mux(){var e;return(e=this.media)==null?void 0:e.mux}get theme(){var e;return(e=this.getAttribute(s.THEME))!=null?e:ba}set theme(e){this.setAttribute(s.THEME,`${e}`)}get themeProps(){let e=this.mediaTheme;if(!e)return;let r={};for(let i of e.getAttributeNames()){if(Ke.includes(i))continue;let o=e.getAttribute(i);r[me(i)]=o===""?!0:o}return r}set themeProps(e){var i,o;f(this,D,j).call(this);let r={...this.themeProps,...e};for(let n in r){if(Ke.includes(n))continue;let m=e==null?void 0:e[n];typeof m=="boolean"||m==null?(i=this.mediaTheme)==null||i.toggleAttribute(le(n),Boolean(m)):(o=this.mediaTheme)==null||o.setAttribute(le(n),m)}}get playbackId(){var e;return(e=this.getAttribute(d.PLAYBACK_ID))!=null?e:void 0}set playbackId(e){e?this.setAttribute(d.PLAYBACK_ID,e):this.removeAttribute(d.PLAYBACK_ID)}get src(){var e,r;return this.playbackId?(e=W(this,M.SRC))!=null?e:void 0:(r=this.getAttribute(M.SRC))!=null?r:void 0}set src(e){e?this.setAttribute(M.SRC,e):this.removeAttribute(M.SRC)}get poster(){var r;let e=this.getAttribute(M.POSTER);if(e!=null)return e;if(this.playbackId&&!this.audio)return dt(this.playbackId,{domain:this.customDomain,thumbnailTime:(r=this.thumbnailTime)!=null?r:this.startTime,token:this.tokens.thumbnail})}set poster(e){e||e===""?this.setAttribute(M.POSTER,e):this.removeAttribute(M.POSTER)}get storyboardSrc(){var e;return(e=this.getAttribute(s.STORYBOARD_SRC))!=null?e:void 0}set storyboardSrc(e){e?this.setAttribute(s.STORYBOARD_SRC,e):this.removeAttribute(s.STORYBOARD_SRC)}get storyboard(){if(this.storyboardSrc&&!this.tokens.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[O.LIVE,O.UNKNOWN].includes(this.streamType)))return lt(this.playbackId,{domain:this.customDomain,token:this.tokens.storyboard})}get audio(){return this.hasAttribute(s.AUDIO)}set audio(e){if(!e){this.removeAttribute(s.AUDIO);return}this.setAttribute(s.AUDIO,"")}get hotkeys(){return u(this,ne)}get nohotkeys(){return this.hasAttribute(s.NOHOTKEYS)}set nohotkeys(e){if(!e){this.removeAttribute(s.NOHOTKEYS);return}this.setAttribute(s.NOHOTKEYS,"")}get thumbnailTime(){return R(this.getAttribute(s.THUMBNAIL_TIME))}set thumbnailTime(e){this.setAttribute(s.THUMBNAIL_TIME,`${e}`)}get title(){var e;return(e=this.getAttribute(s.TITLE))!=null?e:""}set title(e){e!==this.title&&(e?this.setAttribute(s.TITLE,e):this.removeAttribute("title"),super.title=e)}get placeholder(){var e;return(e=W(this,s.PLACEHOLDER))!=null?e:""}set placeholder(e){this.setAttribute(s.PLACEHOLDER,`${e}`)}get primaryColor(){var r,i;let e=this.getAttribute(s.PRIMARY_COLOR);if(e!=null||this.mediaTheme&&(e=(i=(r=p.getComputedStyle(this.mediaTheme))==null?void 0:r.getPropertyValue("--_primary-color"))==null?void 0:i.trim(),e))return e}set primaryColor(e){this.setAttribute(s.PRIMARY_COLOR,`${e}`)}get secondaryColor(){var r,i;let e=this.getAttribute(s.SECONDARY_COLOR);if(e!=null||this.mediaTheme&&(e=(i=(r=p.getComputedStyle(this.mediaTheme))==null?void 0:r.getPropertyValue("--_secondary-color"))==null?void 0:i.trim(),e))return e}set secondaryColor(e){this.setAttribute(s.SECONDARY_COLOR,`${e}`)}get defaultShowRemainingTime(){return this.hasAttribute(s.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(e){e?this.setAttribute(s.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(s.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(!!this.hasAttribute(s.PLAYBACK_RATES))return this.getAttribute(s.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(e=>Number(e)).filter(e=>!Number.isNaN(e)).sort((e,r)=>e-r)}set playbackRates(e){if(!e){this.removeAttribute(s.PLAYBACK_RATES);return}this.setAttribute(s.PLAYBACK_RATES,e.join(" "))}get forwardSeekOffset(){var e;return(e=R(this.getAttribute(s.FORWARD_SEEK_OFFSET)))!=null?e:10}set forwardSeekOffset(e){this.setAttribute(s.FORWARD_SEEK_OFFSET,`${e}`)}get backwardSeekOffset(){var e;return(e=R(this.getAttribute(s.BACKWARD_SEEK_OFFSET)))!=null?e:10}set backwardSeekOffset(e){this.setAttribute(s.BACKWARD_SEEK_OFFSET,`${e}`)}get defaultHiddenCaptions(){return this.hasAttribute(s.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(e){e?this.setAttribute(s.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(s.DEFAULT_HIDDEN_CAPTIONS)}get playerSoftwareName(){var e;return(e=this.getAttribute(d.PLAYER_SOFTWARE_NAME))!=null?e:Ta}get playerSoftwareVersion(){var e;return(e=this.getAttribute(d.PLAYER_SOFTWARE_VERSION))!=null?e:Ea}get beaconCollectionDomain(){var e;return(e=this.getAttribute(d.BEACON_COLLECTION_DOMAIN))!=null?e:void 0}set beaconCollectionDomain(e){e!==this.beaconCollectionDomain&&(e?this.setAttribute(d.BEACON_COLLECTION_DOMAIN,e):this.removeAttribute(d.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var e;return(e=this.getAttribute(d.MAX_RESOLUTION))!=null?e:void 0}set maxResolution(e){e!==this.maxResolution&&(e?this.setAttribute(d.MAX_RESOLUTION,e):this.removeAttribute(d.MAX_RESOLUTION))}get customDomain(){var e;return(e=this.getAttribute(d.CUSTOM_DOMAIN))!=null?e:void 0}set customDomain(e){e!==this.customDomain&&(e?this.setAttribute(d.CUSTOM_DOMAIN,e):this.removeAttribute(d.CUSTOM_DOMAIN))}get envKey(){var e;return(e=W(this,d.ENV_KEY))!=null?e:void 0}set envKey(e){this.setAttribute(d.ENV_KEY,`${e}`)}get noVolumePref(){return this.hasAttribute(s.NO_VOLUME_PREF)}set noVolumePref(e){e?this.setAttribute(s.NO_VOLUME_PREF,""):this.removeAttribute(s.NO_VOLUME_PREF)}get debug(){return W(this,d.DEBUG)!=null}set debug(e){e?this.setAttribute(d.DEBUG,""):this.removeAttribute(d.DEBUG)}get disableCookies(){return W(this,d.DISABLE_COOKIES)!=null}set disableCookies(e){e?this.setAttribute(d.DISABLE_COOKIES,""):this.removeAttribute(d.DISABLE_COOKIES)}get streamType(){var e,r,i;return(i=(r=this.getAttribute(d.STREAM_TYPE))!=null?r:(e=this.media)==null?void 0:e.streamType)!=null?i:O.UNKNOWN}set streamType(e){this.setAttribute(d.STREAM_TYPE,`${e}`)}get defaultStreamType(){var e,r,i;return(i=(r=this.getAttribute(s.DEFAULT_STREAM_TYPE))!=null?r:(e=this.mediaController)==null?void 0:e.getAttribute(s.DEFAULT_STREAM_TYPE))!=null?i:O.ON_DEMAND}set defaultStreamType(e){e?this.setAttribute(s.DEFAULT_STREAM_TYPE,e):this.removeAttribute(s.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var e,r;return this.hasAttribute(s.TARGET_LIVE_WINDOW)?+this.getAttribute(s.TARGET_LIVE_WINDOW):(r=(e=this.media)==null?void 0:e.targetLiveWindow)!=null?r:Number.NaN}set targetLiveWindow(e){e!=this.targetLiveWindow&&(e==null?this.removeAttribute(s.TARGET_LIVE_WINDOW):this.setAttribute(s.TARGET_LIVE_WINDOW,`${+e}`))}get liveEdgeStart(){var e;return(e=this.media)==null?void 0:e.liveEdgeStart}get startTime(){return R(W(this,d.START_TIME))}set startTime(e){this.setAttribute(d.START_TIME,`${e}`)}get preferPlayback(){let e=this.getAttribute(d.PREFER_PLAYBACK);if(e===Ee.MSE||e===Ee.NATIVE)return e}set preferPlayback(e){e!==this.preferPlayback&&(e===Ee.MSE||e===Ee.NATIVE?this.setAttribute(d.PREFER_PLAYBACK,e):this.removeAttribute(d.PREFER_PLAYBACK))}get metadata(){var e;return(e=this.media)==null?void 0:e.metadata}set metadata(e){if(f(this,D,j).call(this),!this.media){S("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...Lt(this),...e}}async addCuePoints(e){var r;if(f(this,D,j).call(this),!this.media){S("underlying media element missing when trying to addCuePoints. cuePoints will not be added.");return}return(r=this.media)==null?void 0:r.addCuePoints(e)}get activeCuePoint(){var e;return(e=this.media)==null?void 0:e.activeCuePoint}get cuePoints(){var e,r;return(r=(e=this.media)==null?void 0:e.cuePoints)!=null?r:[]}getStartDate(){var e;return(e=this.media)==null?void 0:e.getStartDate()}get currentPdt(){var e;return(e=this.media)==null?void 0:e.currentPdt}get tokens(){let e=this.getAttribute(s.PLAYBACK_TOKEN),r=this.getAttribute(s.THUMBNAIL_TOKEN),i=this.getAttribute(s.STORYBOARD_TOKEN);return{...u(this,oe),...e!=null?{playback:e}:{},...r!=null?{thumbnail:r}:{},...i!=null?{storyboard:i}:{}}}set tokens(e){x(this,oe,e!=null?e:{})}get playbackToken(){var e;return(e=this.getAttribute(s.PLAYBACK_TOKEN))!=null?e:void 0}set playbackToken(e){this.setAttribute(s.PLAYBACK_TOKEN,`${e}`)}get thumbnailToken(){var e;return(e=this.getAttribute(s.THUMBNAIL_TOKEN))!=null?e:void 0}set thumbnailToken(e){this.setAttribute(s.THUMBNAIL_TOKEN,`${e}`)}get storyboardToken(){var e;return(e=this.getAttribute(s.STORYBOARD_TOKEN))!=null?e:void 0}set storyboardToken(e){this.setAttribute(s.STORYBOARD_TOKEN,`${e}`)}addTextTrack(e,r,i,o){var m;let n=(m=this.media)==null?void 0:m.nativeEl;if(!!n)return ca(n,e,r,i,o)}removeTextTrack(e){var i;let r=(i=this.media)==null?void 0:i.nativeEl;if(!!r)return pa(r,e)}get textTracks(){var e;return(e=this.media)==null?void 0:e.textTracks}};re=new WeakMap,oe=new WeakMap,C=new WeakMap,ne=new WeakMap,U=new WeakMap,D=new WeakSet,j=function(){var e,r,i;if(!u(this,re)){x(this,re,!0),f(this,V,q).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof p.HTMLElement))throw""}catch{S("<media-theme> failed to upgrade!")}try{if(customElements.upgrade(this.media),!(this.media instanceof ua))throw""}catch{S("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof ma))throw""}catch{S("<media-controller> failed to upgrade!")}bt(this),f(this,Ae,Pt).call(this),f(this,xe,_t).call(this),f(this,we,Nt).call(this),x(this,C,(r=(e=this.mediaController)==null?void 0:e.hasAttribute("userinactive"))!=null?r:!0),f(this,Se,Bt).call(this),(i=this.media)==null||i.addEventListener("streamtypechange",()=>{f(this,V,q).call(this)})}},Te=new WeakSet,Ct=function(){var e,r;try{(e=window==null?void 0:window.CSS)==null||e.registerProperty({name:"--media-primary-color",syntax:"<color>",inherits:!0}),(r=window==null?void 0:window.CSS)==null||r.registerProperty({name:"--media-secondary-color",syntax:"<color>",inherits:!0})}catch{}},se=new WeakSet,Fe=function(e){Object.assign(u(this,U),e),f(this,V,q).call(this)},V=new WeakSet,q=function(e={}){At(xt(ha(this,{...u(this,U),...e})),this.shadowRoot)},Ae=new WeakSet,Pt=function(){let e=i=>{var m,h;if(!(i!=null&&i.startsWith("theme-")))return;let o=i.replace(/^theme-/,"");if(Ke.includes(o))return;let n=this.getAttribute(i);n!=null?(m=this.mediaTheme)==null||m.setAttribute(o,n):(h=this.mediaTheme)==null||h.removeAttribute(o)};new MutationObserver(i=>{for(let{attributeName:o}of i)e(o)}).observe(this,{attributes:!0}),this.getAttributeNames().forEach(e)},xe=new WeakSet,_t=function(){var r;let e=i=>{let{detail:o}=i;if(o instanceof ke||(o=new ke(o.message,o.code,o.fatal)),!(o!=null&&o.fatal)){B(o),o.data&&B(`${o.name} data:`,o.data);return}let{dialog:n,devlog:m}=ye(o,!window.navigator.onLine,this.playbackId,this.playbackToken);m.message&&Be(m),S(o),o.data&&S(`${o.name} data:`,o.data),f(this,se,Fe).call(this,{isDialogOpen:!0,dialog:n})};this.addEventListener("error",e),this.media&&(this.media.errorTranslator=(i={})=>{var n,m,h;if(!(((n=this.media)==null?void 0:n.error)instanceof ke))return i;let{devlog:o}=ye((m=this.media)==null?void 0:m.error,!window.navigator.onLine,this.playbackId,this.playbackToken,!1);return{player_error_code:(h=this.media)==null?void 0:h.error.code,player_error_message:o.message?String(o.message):i.player_error_message,player_error_context:o.context?String(o.context):i.player_error_context}}),(r=this.media)==null||r.addEventListener("error",i=>{var n,m;let{detail:o}=i;if(!o){let{message:h,code:w}=(m=(n=this.media)==null?void 0:n.error)!=null?m:{};o=new ke(h,w)}!(o!=null&&o.fatal)||this.dispatchEvent(new CustomEvent("error",{detail:o}))})},we=new WeakSet,Nt=function(){var r,i,o,n;let e=()=>f(this,V,q).call(this);(i=(r=this.media)==null?void 0:r.textTracks)==null||i.addEventListener("addtrack",e),(n=(o=this.media)==null?void 0:o.textTracks)==null||n.addEventListener("removetrack",e)},Se=new WeakSet,Bt=function(){var E,P;let e=/.*Version\/.*Safari\/.*/.test(navigator.userAgent);if(!/Firefox/i.test(navigator.userAgent))return;let i,o=new WeakMap,n=()=>this.streamType===O.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,m=(g,v,A=!1)=>{if(n())return;Array.from(g&&g.activeCues||[]).forEach(c=>{if(!(!c.snapToLines||c.line<-5||c.line>=0&&c.line<10))if(!v||this.paused){let de=c.text.split(`
|
|
1072
|
+
`;import{MediaThemeElement as la}from"media-chrome/dist/media-theme-element.js";var $e=T.createElement("template");"innerHTML"in $e&&($e.innerHTML=wt);var St,Ot,ve=class extends la{};ve.template=(Ot=(St=$e.content)==null?void 0:St.children)==null?void 0:Ot[0];p.customElements.get("media-theme-classic")||p.customElements.define("media-theme-classic",ve);var ba="classic";var M={SRC:"src",POSTER:"poster"},s={STYLE:"style",DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-color",FORWARD_SEEK_OFFSET:"forward-seek-offset",BACKWARD_SEEK_OFFSET:"backward-seek-offset",PLAYBACK_TOKEN:"playback-token",THUMBNAIL_TOKEN:"thumbnail-token",STORYBOARD_TOKEN:"storyboard-token",STORYBOARD_SRC:"storyboard-src",THUMBNAIL_TIME:"thumbnail-time",AUDIO:"audio",NOHOTKEYS:"nohotkeys",HOTKEYS:"hotkeys",PLAYBACK_RATES:"playbackrates",DEFAULT_SHOW_REMAINING_TIME:"default-show-remaining-time",TITLE:"title",PLACEHOLDER:"placeholder",THEME:"theme",DEFAULT_STREAM_TYPE:"default-stream-type",TARGET_LIVE_WINDOW:"target-live-window",NO_VOLUME_PREF:"no-volume-pref"},Ke=["audio","backwardseekoffset","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","novolumepref"];function ha(t,a){var r;return{src:!t.playbackId&&t.src,playbackId:t.playbackId,hasSrc:!!t.playbackId||!!t.src,poster:t.poster,storyboard:t.storyboard,storyboardSrc:t.getAttribute(s.STORYBOARD_SRC),placeholder:t.getAttribute("placeholder"),themeTemplate:ga(t),thumbnailTime:!t.tokens.thumbnail&&t.thumbnailTime,autoplay:t.autoplay,crossOrigin:t.crossOrigin,loop:t.loop,noHotKeys:t.hasAttribute(s.NOHOTKEYS),hotKeys:t.getAttribute(s.HOTKEYS),muted:t.muted,paused:t.paused,preload:t.preload,envKey:t.envKey,preferCmcd:t.preferCmcd,debug:t.debug,disableCookies:t.disableCookies,tokens:t.tokens,beaconCollectionDomain:t.beaconCollectionDomain,maxResolution:t.maxResolution,metadata:t.metadata,playerSoftwareName:t.playerSoftwareName,playerSoftwareVersion:t.playerSoftwareVersion,startTime:t.startTime,preferPlayback:t.preferPlayback,audio:t.audio,defaultStreamType:t.defaultStreamType,targetLiveWindow:t.getAttribute(d.TARGET_LIVE_WINDOW),streamType:Q(t.getAttribute(d.STREAM_TYPE)),primaryColor:t.primaryColor,secondaryColor:t.secondaryColor,forwardSeekOffset:t.forwardSeekOffset,backwardSeekOffset:t.backwardSeekOffset,defaultHiddenCaptions:t.defaultHiddenCaptions,defaultShowRemainingTime:t.defaultShowRemainingTime,hideDuration:fa(t),playbackRates:t.getAttribute(s.PLAYBACK_RATES),customDomain:(r=t.getAttribute(d.CUSTOM_DOMAIN))!=null?r:void 0,title:t.getAttribute(s.TITLE),novolumepref:t.hasAttribute(s.NO_VOLUME_PREF),...a}}function ga(t){var e,r;let a=t.theme;if(a){let i=(r=(e=t.getRootNode())==null?void 0:e.getElementById)==null?void 0:r.call(e,a);if(i&&i instanceof HTMLTemplateElement)return i;a.startsWith("media-theme-")||(a=`media-theme-${a}`);let o=p.customElements.get(a);if(o!=null&&o.template)return o.template}}function fa(t){var e;let a=(e=t.mediaController)==null?void 0:e.querySelector("media-time-display");return a&&getComputedStyle(a).getPropertyValue("--media-duration-display-display").trim()==="none"}function Lt(t){let a=t.hasAttribute(s.TITLE)?{video_title:t.getAttribute(s.TITLE)}:{};return t.getAttributeNames().filter(e=>e.startsWith("metadata-")).reduce((e,r)=>{let i=t.getAttribute(r);return i!==null&&(e[r.replace(/^metadata-/,"").replace(/-/g,"_")]=i),e},a)}var ya=Object.values(d),va=Object.values(M),ka=Object.values(s),Ea=pe(),Ta="mux-player",Mt={dialog:void 0,isDialogOpen:!1},re,oe,C,ne,U,D,j,Te,Ct,se,Fe,V,q,Ae,Pt,xe,_t,we,Nt,Se,Bt,ie=class extends De{constructor(){super();b(this,D);b(this,Te);b(this,se);b(this,V);b(this,Ae);b(this,xe);b(this,we);b(this,Se);b(this,re,!1);b(this,oe,{});b(this,C,!0);b(this,ne,new ce(this,"hotkeys"));b(this,U,{...Mt,onCloseErrorDialog:()=>f(this,se,Fe).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:e=>{Ce(this,T.activeElement)||e.preventDefault()}});this.attachShadow({mode:"open"}),f(this,Te,Ct).call(this),this.isConnected&&f(this,D,j).call(this)}static get observedAttributes(){var e;return[...(e=De.observedAttributes)!=null?e:[],...va,...ya,...ka]}get mediaTheme(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("media-theme")}get mediaController(){var e,r;return(r=(e=this.mediaTheme)==null?void 0:e.shadowRoot)==null?void 0:r.querySelector("media-controller")}connectedCallback(){var r;let e=(r=this.shadowRoot)==null?void 0:r.querySelector("mux-video");e&&(e.metadata=Lt(this))}attributeChangedCallback(e,r,i){switch(f(this,D,j).call(this),super.attributeChangedCallback(e,r,i),e){case s.HOTKEYS:u(this,ne).value=i;break;case s.THUMBNAIL_TIME:{i!=null&&this.tokens.thumbnail&&B(l("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case s.THUMBNAIL_TOKEN:{let{aud:n}=N(i);i&&n!=="t"&&B(l("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:n}));break}case s.STORYBOARD_TOKEN:{let{aud:n}=N(i);i&&n!=="s"&&B(l("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:n}));break}case d.PLAYBACK_ID:{i!=null&&i.includes("?token")&&S(l("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:i}));break}case d.STREAM_TYPE:i&&![O.LIVE,O.ON_DEMAND,O.UNKNOWN].includes(i)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=i.includes("dvr")?Number.POSITIVE_INFINITY:0:Be({file:"invalid-stream-type.md",message:l("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):this.targetLiveWindow=i===O.LIVE?0:Number.NaN}[d.PLAYBACK_ID,M.SRC,s.PLAYBACK_TOKEN].includes(e)&&r!==i&&x(this,U,{...u(this,U),...Mt}),f(this,V,q).call(this,{[mt(e)]:i})}get preferCmcd(){var e;return(e=this.getAttribute(d.PREFER_CMCD))!=null?e:void 0}set preferCmcd(e){e!==this.preferCmcd&&(e?Rt.includes(e)?this.setAttribute(d.PREFER_CMCD,e):B(`Invalid value for preferCmcd. Must be one of ${Rt.join()}`):this.removeAttribute(d.PREFER_CMCD))}get hasPlayed(){var e,r;return(r=(e=this.mediaController)==null?void 0:e.hasAttribute("media-has-played"))!=null?r:!1}get inLiveWindow(){var e;return(e=this.mediaController)==null?void 0:e.hasAttribute("media-time-is-live")}get _hls(){var e;return(e=this.media)==null?void 0:e._hls}get mux(){var e;return(e=this.media)==null?void 0:e.mux}get theme(){var e;return(e=this.getAttribute(s.THEME))!=null?e:ba}set theme(e){this.setAttribute(s.THEME,`${e}`)}get themeProps(){let e=this.mediaTheme;if(!e)return;let r={};for(let i of e.getAttributeNames()){if(Ke.includes(i))continue;let o=e.getAttribute(i);r[me(i)]=o===""?!0:o}return r}set themeProps(e){var i,o;f(this,D,j).call(this);let r={...this.themeProps,...e};for(let n in r){if(Ke.includes(n))continue;let m=e==null?void 0:e[n];typeof m=="boolean"||m==null?(i=this.mediaTheme)==null||i.toggleAttribute(le(n),Boolean(m)):(o=this.mediaTheme)==null||o.setAttribute(le(n),m)}}get playbackId(){var e;return(e=this.getAttribute(d.PLAYBACK_ID))!=null?e:void 0}set playbackId(e){e?this.setAttribute(d.PLAYBACK_ID,e):this.removeAttribute(d.PLAYBACK_ID)}get src(){var e,r;return this.playbackId?(e=W(this,M.SRC))!=null?e:void 0:(r=this.getAttribute(M.SRC))!=null?r:void 0}set src(e){e?this.setAttribute(M.SRC,e):this.removeAttribute(M.SRC)}get poster(){var r;let e=this.getAttribute(M.POSTER);if(e!=null)return e;if(this.playbackId&&!this.audio)return dt(this.playbackId,{domain:this.customDomain,thumbnailTime:(r=this.thumbnailTime)!=null?r:this.startTime,token:this.tokens.thumbnail})}set poster(e){e||e===""?this.setAttribute(M.POSTER,e):this.removeAttribute(M.POSTER)}get storyboardSrc(){var e;return(e=this.getAttribute(s.STORYBOARD_SRC))!=null?e:void 0}set storyboardSrc(e){e?this.setAttribute(s.STORYBOARD_SRC,e):this.removeAttribute(s.STORYBOARD_SRC)}get storyboard(){if(this.storyboardSrc&&!this.tokens.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[O.LIVE,O.UNKNOWN].includes(this.streamType)))return lt(this.playbackId,{domain:this.customDomain,token:this.tokens.storyboard})}get audio(){return this.hasAttribute(s.AUDIO)}set audio(e){if(!e){this.removeAttribute(s.AUDIO);return}this.setAttribute(s.AUDIO,"")}get hotkeys(){return u(this,ne)}get nohotkeys(){return this.hasAttribute(s.NOHOTKEYS)}set nohotkeys(e){if(!e){this.removeAttribute(s.NOHOTKEYS);return}this.setAttribute(s.NOHOTKEYS,"")}get thumbnailTime(){return R(this.getAttribute(s.THUMBNAIL_TIME))}set thumbnailTime(e){this.setAttribute(s.THUMBNAIL_TIME,`${e}`)}get title(){var e;return(e=this.getAttribute(s.TITLE))!=null?e:""}set title(e){e!==this.title&&(e?this.setAttribute(s.TITLE,e):this.removeAttribute("title"),super.title=e)}get placeholder(){var e;return(e=W(this,s.PLACEHOLDER))!=null?e:""}set placeholder(e){this.setAttribute(s.PLACEHOLDER,`${e}`)}get primaryColor(){var r,i;let e=this.getAttribute(s.PRIMARY_COLOR);if(e!=null||this.mediaTheme&&(e=(i=(r=p.getComputedStyle(this.mediaTheme))==null?void 0:r.getPropertyValue("--_primary-color"))==null?void 0:i.trim(),e))return e}set primaryColor(e){this.setAttribute(s.PRIMARY_COLOR,`${e}`)}get secondaryColor(){var r,i;let e=this.getAttribute(s.SECONDARY_COLOR);if(e!=null||this.mediaTheme&&(e=(i=(r=p.getComputedStyle(this.mediaTheme))==null?void 0:r.getPropertyValue("--_secondary-color"))==null?void 0:i.trim(),e))return e}set secondaryColor(e){this.setAttribute(s.SECONDARY_COLOR,`${e}`)}get defaultShowRemainingTime(){return this.hasAttribute(s.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(e){e?this.setAttribute(s.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(s.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(!!this.hasAttribute(s.PLAYBACK_RATES))return this.getAttribute(s.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(e=>Number(e)).filter(e=>!Number.isNaN(e)).sort((e,r)=>e-r)}set playbackRates(e){if(!e){this.removeAttribute(s.PLAYBACK_RATES);return}this.setAttribute(s.PLAYBACK_RATES,e.join(" "))}get forwardSeekOffset(){var e;return(e=R(this.getAttribute(s.FORWARD_SEEK_OFFSET)))!=null?e:10}set forwardSeekOffset(e){this.setAttribute(s.FORWARD_SEEK_OFFSET,`${e}`)}get backwardSeekOffset(){var e;return(e=R(this.getAttribute(s.BACKWARD_SEEK_OFFSET)))!=null?e:10}set backwardSeekOffset(e){this.setAttribute(s.BACKWARD_SEEK_OFFSET,`${e}`)}get defaultHiddenCaptions(){return this.hasAttribute(s.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(e){e?this.setAttribute(s.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(s.DEFAULT_HIDDEN_CAPTIONS)}get playerSoftwareName(){var e;return(e=this.getAttribute(d.PLAYER_SOFTWARE_NAME))!=null?e:Ta}get playerSoftwareVersion(){var e;return(e=this.getAttribute(d.PLAYER_SOFTWARE_VERSION))!=null?e:Ea}get beaconCollectionDomain(){var e;return(e=this.getAttribute(d.BEACON_COLLECTION_DOMAIN))!=null?e:void 0}set beaconCollectionDomain(e){e!==this.beaconCollectionDomain&&(e?this.setAttribute(d.BEACON_COLLECTION_DOMAIN,e):this.removeAttribute(d.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var e;return(e=this.getAttribute(d.MAX_RESOLUTION))!=null?e:void 0}set maxResolution(e){e!==this.maxResolution&&(e?this.setAttribute(d.MAX_RESOLUTION,e):this.removeAttribute(d.MAX_RESOLUTION))}get customDomain(){var e;return(e=this.getAttribute(d.CUSTOM_DOMAIN))!=null?e:void 0}set customDomain(e){e!==this.customDomain&&(e?this.setAttribute(d.CUSTOM_DOMAIN,e):this.removeAttribute(d.CUSTOM_DOMAIN))}get envKey(){var e;return(e=W(this,d.ENV_KEY))!=null?e:void 0}set envKey(e){this.setAttribute(d.ENV_KEY,`${e}`)}get noVolumePref(){return this.hasAttribute(s.NO_VOLUME_PREF)}set noVolumePref(e){e?this.setAttribute(s.NO_VOLUME_PREF,""):this.removeAttribute(s.NO_VOLUME_PREF)}get debug(){return W(this,d.DEBUG)!=null}set debug(e){e?this.setAttribute(d.DEBUG,""):this.removeAttribute(d.DEBUG)}get disableCookies(){return W(this,d.DISABLE_COOKIES)!=null}set disableCookies(e){e?this.setAttribute(d.DISABLE_COOKIES,""):this.removeAttribute(d.DISABLE_COOKIES)}get streamType(){var e,r,i;return(i=(r=this.getAttribute(d.STREAM_TYPE))!=null?r:(e=this.media)==null?void 0:e.streamType)!=null?i:O.UNKNOWN}set streamType(e){this.setAttribute(d.STREAM_TYPE,`${e}`)}get defaultStreamType(){var e,r,i;return(i=(r=this.getAttribute(s.DEFAULT_STREAM_TYPE))!=null?r:(e=this.mediaController)==null?void 0:e.getAttribute(s.DEFAULT_STREAM_TYPE))!=null?i:O.ON_DEMAND}set defaultStreamType(e){e?this.setAttribute(s.DEFAULT_STREAM_TYPE,e):this.removeAttribute(s.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var e,r;return this.hasAttribute(s.TARGET_LIVE_WINDOW)?+this.getAttribute(s.TARGET_LIVE_WINDOW):(r=(e=this.media)==null?void 0:e.targetLiveWindow)!=null?r:Number.NaN}set targetLiveWindow(e){e!=this.targetLiveWindow&&(e==null?this.removeAttribute(s.TARGET_LIVE_WINDOW):this.setAttribute(s.TARGET_LIVE_WINDOW,`${+e}`))}get liveEdgeStart(){var e;return(e=this.media)==null?void 0:e.liveEdgeStart}get startTime(){return R(W(this,d.START_TIME))}set startTime(e){this.setAttribute(d.START_TIME,`${e}`)}get preferPlayback(){let e=this.getAttribute(d.PREFER_PLAYBACK);if(e===Ee.MSE||e===Ee.NATIVE)return e}set preferPlayback(e){e!==this.preferPlayback&&(e===Ee.MSE||e===Ee.NATIVE?this.setAttribute(d.PREFER_PLAYBACK,e):this.removeAttribute(d.PREFER_PLAYBACK))}get metadata(){var e;return(e=this.media)==null?void 0:e.metadata}set metadata(e){if(f(this,D,j).call(this),!this.media){S("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...Lt(this),...e}}async addCuePoints(e){var r;if(f(this,D,j).call(this),!this.media){S("underlying media element missing when trying to addCuePoints. cuePoints will not be added.");return}return(r=this.media)==null?void 0:r.addCuePoints(e)}get activeCuePoint(){var e;return(e=this.media)==null?void 0:e.activeCuePoint}get cuePoints(){var e,r;return(r=(e=this.media)==null?void 0:e.cuePoints)!=null?r:[]}getStartDate(){var e;return(e=this.media)==null?void 0:e.getStartDate()}get currentPdt(){var e;return(e=this.media)==null?void 0:e.currentPdt}get tokens(){let e=this.getAttribute(s.PLAYBACK_TOKEN),r=this.getAttribute(s.THUMBNAIL_TOKEN),i=this.getAttribute(s.STORYBOARD_TOKEN);return{...u(this,oe),...e!=null?{playback:e}:{},...r!=null?{thumbnail:r}:{},...i!=null?{storyboard:i}:{}}}set tokens(e){x(this,oe,e!=null?e:{})}get playbackToken(){var e;return(e=this.getAttribute(s.PLAYBACK_TOKEN))!=null?e:void 0}set playbackToken(e){this.setAttribute(s.PLAYBACK_TOKEN,`${e}`)}get thumbnailToken(){var e;return(e=this.getAttribute(s.THUMBNAIL_TOKEN))!=null?e:void 0}set thumbnailToken(e){this.setAttribute(s.THUMBNAIL_TOKEN,`${e}`)}get storyboardToken(){var e;return(e=this.getAttribute(s.STORYBOARD_TOKEN))!=null?e:void 0}set storyboardToken(e){this.setAttribute(s.STORYBOARD_TOKEN,`${e}`)}addTextTrack(e,r,i,o){var m;let n=(m=this.media)==null?void 0:m.nativeEl;if(!!n)return ca(n,e,r,i,o)}removeTextTrack(e){var i;let r=(i=this.media)==null?void 0:i.nativeEl;if(!!r)return pa(r,e)}get textTracks(){var e;return(e=this.media)==null?void 0:e.textTracks}};re=new WeakMap,oe=new WeakMap,C=new WeakMap,ne=new WeakMap,U=new WeakMap,D=new WeakSet,j=function(){var e,r,i;if(!u(this,re)){x(this,re,!0),f(this,V,q).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof p.HTMLElement))throw""}catch{S("<media-theme> failed to upgrade!")}try{if(customElements.upgrade(this.media),!(this.media instanceof ua))throw""}catch{S("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof ma))throw""}catch{S("<media-controller> failed to upgrade!")}bt(this),f(this,Ae,Pt).call(this),f(this,xe,_t).call(this),f(this,we,Nt).call(this),x(this,C,(r=(e=this.mediaController)==null?void 0:e.hasAttribute("userinactive"))!=null?r:!0),f(this,Se,Bt).call(this),(i=this.media)==null||i.addEventListener("streamtypechange",()=>{f(this,V,q).call(this)})}},Te=new WeakSet,Ct=function(){var e,r;try{(e=window==null?void 0:window.CSS)==null||e.registerProperty({name:"--media-primary-color",syntax:"<color>",inherits:!0}),(r=window==null?void 0:window.CSS)==null||r.registerProperty({name:"--media-secondary-color",syntax:"<color>",inherits:!0})}catch{}},se=new WeakSet,Fe=function(e){Object.assign(u(this,U),e),f(this,V,q).call(this)},V=new WeakSet,q=function(e={}){At(xt(ha(this,{...u(this,U),...e})),this.shadowRoot)},Ae=new WeakSet,Pt=function(){let e=i=>{var m,h;if(!(i!=null&&i.startsWith("theme-")))return;let o=i.replace(/^theme-/,"");if(Ke.includes(o))return;let n=this.getAttribute(i);n!=null?(m=this.mediaTheme)==null||m.setAttribute(o,n):(h=this.mediaTheme)==null||h.removeAttribute(o)};new MutationObserver(i=>{for(let{attributeName:o}of i)e(o)}).observe(this,{attributes:!0}),this.getAttributeNames().forEach(e)},xe=new WeakSet,_t=function(){var r;let e=i=>{let{detail:o}=i;if(o instanceof ke||(o=new ke(o.message,o.code,o.fatal)),!(o!=null&&o.fatal)){B(o),o.data&&B(`${o.name} data:`,o.data);return}let{dialog:n,devlog:m}=ye(o,!window.navigator.onLine,this.playbackId,this.playbackToken);m.message&&Be(m),S(o),o.data&&S(`${o.name} data:`,o.data),f(this,se,Fe).call(this,{isDialogOpen:!0,dialog:n})};this.addEventListener("error",e),this.media&&(this.media.errorTranslator=(i={})=>{var n,m,h;if(!(((n=this.media)==null?void 0:n.error)instanceof ke))return i;let{devlog:o}=ye((m=this.media)==null?void 0:m.error,!window.navigator.onLine,this.playbackId,this.playbackToken,!1);return{player_error_code:(h=this.media)==null?void 0:h.error.code,player_error_message:o.message?String(o.message):i.player_error_message,player_error_context:o.context?String(o.context):i.player_error_context}}),(r=this.media)==null||r.addEventListener("error",i=>{var n,m;let{detail:o}=i;if(!o){let{message:h,code:w}=(m=(n=this.media)==null?void 0:n.error)!=null?m:{};o=new ke(h,w)}!(o!=null&&o.fatal)||this.dispatchEvent(new CustomEvent("error",{detail:o}))})},we=new WeakSet,Nt=function(){var r,i,o,n;let e=()=>f(this,V,q).call(this);(i=(r=this.media)==null?void 0:r.textTracks)==null||i.addEventListener("addtrack",e),(n=(o=this.media)==null?void 0:o.textTracks)==null||n.addEventListener("removetrack",e)},Se=new WeakSet,Bt=function(){var E,P;let e=/.*Version\/.*Safari\/.*/.test(navigator.userAgent);if(!/Firefox/i.test(navigator.userAgent))return;let i,o=new WeakMap,n=()=>this.streamType===O.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,m=(g,v,A=!1)=>{if(n())return;Array.from(g&&g.activeCues||[]).forEach(c=>{if(!(!c.snapToLines||c.line<-5||c.line>=0&&c.line<10))if(!v||this.paused){let de=c.text.split(`
|
|
1073
1073
|
`).length,G=e?-2:-3;this.streamType===O.LIVE&&(G=e?-1:-2);let Y=G-de;if(c.line===Y&&!A)return;o.has(c)||o.set(c,c.line),c.line=Y-1,c.line=Y}else setTimeout(()=>{c.line=o.get(c)||"auto"},500)})},h=()=>{var g,v;m(i,(v=(g=this.mediaController)==null?void 0:g.hasAttribute("userinactive"))!=null?v:!1)},w=()=>{var A,_;let v=Array.from(((_=(A=this.mediaController)==null?void 0:A.media)==null?void 0:_.textTracks)||[]).filter(c=>["subtitles","captions"].includes(c.kind)&&c.mode==="showing")[0];v!==i&&(i==null||i.removeEventListener("cuechange",h)),i=v,i==null||i.addEventListener("cuechange",h),m(i,u(this,C))};if(w(),(E=this.textTracks)==null||E.addEventListener("change",w),(P=this.textTracks)==null||P.addEventListener("addtrack",w),navigator.userAgent.includes("Chrome/")){let g=()=>{m(i,u(this,C),!0),this.paused||window.requestAnimationFrame(g)};this.addEventListener("playing",()=>{g()})}this.addEventListener("userinactivechange",()=>{var v,A;let g=(A=(v=this.mediaController)==null?void 0:v.hasAttribute("userinactive"))!=null?A:!0;u(this,C)!==g&&(x(this,C,g),m(i,u(this,C)))})};function W(t,a){return t.media?t.media.getAttribute(a):t.getAttribute(a)}p.customElements.get("mux-player")||(p.customElements.define("mux-player",ie),p.MuxPlayerElement=ie);var Ri=ie;export{ke as MediaError,Ri as default,W as getVideoAttribute};
|