@mux/mux-player 1.6.0 → 1.7.0-canary.0-e7d6b3f

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 CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var co=Object.create;var Dt=Object.defineProperty;var mo=Object.getOwnPropertyDescriptor;var ho=Object.getOwnPropertyNames;var po=Object.getPrototypeOf,bo=Object.prototype.hasOwnProperty;var Eo=(i,e)=>{for(var t in e)Dt(i,t,{get:e[t],enumerable:!0})},tr=(i,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ho(e))!bo.call(i,r)&&r!==t&&Dt(i,r,{get:()=>e[r],enumerable:!(a=mo(e,r))||a.enumerable});return i};var fo=(i,e,t)=>(t=i!=null?co(po(i)):{},tr(e||!i||!i.__esModule?Dt(t,"default",{value:i,enumerable:!0}):t,i)),vo=i=>tr(Dt({},"__esModule",{value:!0}),i);var Di=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)};var v=(i,e,t)=>(Di(i,e,"read from private field"),t?t.call(i):e.get(i)),I=(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)},V=(i,e,t,a)=>(Di(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t);var S=(i,e,t)=>(Di(i,e,"access private method"),t);var Il={};Eo(Il,{MediaError:()=>g.MediaError,default:()=>Tl,getVideoAttribute:()=>ge});module.exports=vo(Il);var Pe=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class i extends Pe{}globalThis.DocumentFragment=i}var Je=class extends Pe{},xi=class extends Pe{},go={get(i){},define(i,e,t){},upgrade(i){},whenDefined(i){return Promise.resolve(Je)}},et,Ri=class{constructor(e,t={}){I(this,et,void 0);V(this,et,t==null?void 0:t.detail)}get detail(){return v(this,et)}initCustomEvent(){}};et=new WeakMap;function Ao(i,e){return new Je}var ir={document:{createElement:Ao},DocumentFragment,customElements:go,CustomEvent:Ri,EventTarget:Pe,HTMLElement:Je,HTMLVideoElement:xi},ar=typeof window=="undefined"||typeof globalThis.customElements=="undefined",D=ar?ir:globalThis,H=ar?ir.document:globalThis.document;var p={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_VOLUME_REQUEST:"mediavolumerequest",MEDIA_SEEK_REQUEST:"mediaseekrequest",MEDIA_AIRPLAY_REQUEST:"mediaairplayrequest",MEDIA_ENTER_FULLSCREEN_REQUEST:"mediaenterfullscreenrequest",MEDIA_EXIT_FULLSCREEN_REQUEST:"mediaexitfullscreenrequest",MEDIA_PREVIEW_REQUEST:"mediapreviewrequest",MEDIA_ENTER_PIP_REQUEST:"mediaenterpiprequest",MEDIA_EXIT_PIP_REQUEST:"mediaexitpiprequest",MEDIA_ENTER_CAST_REQUEST:"mediaentercastrequest",MEDIA_EXIT_CAST_REQUEST:"mediaexitcastrequest",MEDIA_SHOW_TEXT_TRACKS_REQUEST:"mediashowtexttracksrequest",MEDIA_HIDE_TEXT_TRACKS_REQUEST:"mediahidetexttracksrequest",MEDIA_SHOW_CAPTIONS_REQUEST:"mediashowcaptionsrequest",MEDIA_SHOW_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_CAPTIONS_REQUEST:"mediadisablecaptionsrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},tt={MEDIA_AIRPLAY_UNAVAILABLE:"mediaairplayunavailablechange",MEDIA_PIP_UNAVAILABLE:"mediapipunavailablechange",MEDIA_PAUSED:"mediapausedchange",MEDIA_HAS_PLAYED:"mediahasplayedchange",MEDIA_MUTED:"mediamutedchange",MEDIA_VOLUME_LEVEL:"mediavolumelevelchange",MEDIA_VOLUME:"mediavolumechange",MEDIA_VOLUME_UNAVAILABLE:"mediavolumeunavailablechange",MEDIA_IS_PIP:"mediaispipchange",MEDIA_IS_CASTING:"mediaiscastingchange",MEDIA_CAPTIONS_LIST:"mediacaptionslistchange",MEDIA_SUBTITLES_LIST:"mediasubtitleslistchange",MEDIA_CAPTIONS_SHOWING:"mediacaptionsshowingchange",MEDIA_SUBTITLES_SHOWING:"mediasubtitlesshowingchange",MEDIA_IS_FULLSCREEN:"mediaisfullscreenchange",MEDIA_PLAYBACK_RATE:"mediaplaybackratechange",MEDIA_CURRENT_TIME:"mediacurrenttimechange",MEDIA_DURATION:"mediadurationchange",MEDIA_SEEKABLE:"mediaseekablechange",MEDIA_PREVIEW_IMAGE:"mediapreviewimagechange",MEDIA_PREVIEW_COORDS:"mediapreviewcoordschange",MEDIA_LOADING:"medialoadingchange",USER_INACTIVE:"userinactivechange"},A={MEDIA_CHROME_ATTRIBUTES:"media-chrome-attributes",MEDIA_CONTROLLER:"media-controller"},o={MEDIA_AIRPLAY_UNAVAILABLE:"media-airplay-unavailable",MEDIA_FULLSCREEN_UNAVAILABLE:"media-fullscreen-unavailable",MEDIA_PIP_UNAVAILABLE:"media-pip-unavailable",MEDIA_CAST_UNAVAILABLE:"media-cast-unavailable",MEDIA_PAUSED:"media-paused",MEDIA_HAS_PLAYED:"media-has-played",MEDIA_MUTED:"media-muted",MEDIA_VOLUME_LEVEL:"media-volume-level",MEDIA_VOLUME:"media-volume",MEDIA_VOLUME_UNAVAILABLE:"media-volume-unavailable",MEDIA_IS_PIP:"media-is-pip",MEDIA_IS_CASTING:"media-is-casting",MEDIA_CAPTIONS_LIST:"media-captions-list",MEDIA_SUBTITLES_LIST:"media-subtitles-list",MEDIA_CAPTIONS_SHOWING:"media-captions-showing",MEDIA_SUBTITLES_SHOWING:"media-subtitles-showing",MEDIA_IS_FULLSCREEN:"media-is-fullscreen",MEDIA_PLAYBACK_RATE:"media-playback-rate",MEDIA_CURRENT_TIME:"media-current-time",MEDIA_DURATION:"media-duration",MEDIA_SEEKABLE:"media-seekable",MEDIA_PREVIEW_TIME:"media-preview-time",MEDIA_PREVIEW_IMAGE:"media-preview-image",MEDIA_PREVIEW_COORDS:"media-preview-coords",MEDIA_LOADING:"media-loading",MEDIA_BUFFERED:"media-buffered",MEDIA_STREAM_TYPE:"media-stream-type"},Ll=Object.entries(tt).reduce((i,[e,t])=>{let a=o[e];return a&&(i[t]=a),i},{userinactivechange:"user-inactive"}),rr=Object.entries(o).reduce((i,[e,t])=>{let a=tt[e];return a&&(i[t]=a),i},{"user-inactive":"userinactivechange"}),Ue={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},_e={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Pi={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},q={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},xt={LIVE:"live",ON_DEMAND:"on-demand"};var B={AUDIO_PLAYER:()=>"audio player",VIDEO_PLAYER:()=>"video player",VOLUME:()=>"volume",SEEK:()=>"seek",CLOSED_CAPTIONS:()=>"closed captions",PLAYBACK_RATE:({playbackRate:i=1}={})=>`current playback rate ${i}`,PLAYBACK_TIME:()=>"playback time",MEDIA_LOADING:()=>"media loading"},C={PLAY:()=>"play",PAUSE:()=>"pause",MUTE:()=>"mute",UNMUTE:()=>"unmute",AIRPLAY:()=>"air play",ENTER_CAST:()=>"start casting",EXIT_CAST:()=>"stop casting",ENTER_FULLSCREEN:()=>"enter fullscreen mode",EXIT_FULLSCREEN:()=>"exit fullscreen mode",ENTER_PIP:()=>"enter picture in picture mode",EXIT_PIP:()=>"exit picture in picture mode",SEEK_FORWARD_N_SECS:({seekOffset:i=30}={})=>`seek forward ${i} seconds`,SEEK_BACK_N_SECS:({seekOffset:i=30}={})=>`seek back ${i} seconds`},yo={...B,...C};function Rt(i,e=!1){return i.split("_").map(function(t,a){return(a||e?t[0].toUpperCase():t[0].toLowerCase())+t.slice(1).toLowerCase()}).join("")}function Ui(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function nr(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}function or(i){return typeof i!="string"?!1:!isNaN(i)&&!isNaN(parseFloat(i))}var sr=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],To=(i,e)=>{let t=i===1?sr[e].singular:sr[e].plural;return`${i} ${t}`},ye=i=>{if(!nr(i))return"";let e=Math.abs(i),t=e!==i,a=new Date(0,0,0,0,0,e,0);return`${[a.getHours(),a.getMinutes(),a.getSeconds()].map((l,c)=>l&&To(l,c)).filter(l=>l).join(", ")}${t?" remaining":""}`};function j(i,e){let t=!1;i<0&&(t=!0,i=0-i),i=i<0?0:i;let a=Math.floor(i%60),r=Math.floor(i/60%60),n=Math.floor(i/3600),s=Math.floor(e/60%60),l=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(n=r=a="-"),n=n>0||l>0?n+":":"",r=((n||s>=10)&&r<10?"0"+r:r)+":",a=a<10?"0"+a:a,(t?"-":"")+n+r+a}var Pt=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},lr={HTMLElement:class extends Pt{},DocumentFragment:class extends Pt{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},CustomEvent:function(){}},Mo={createElement:function(){return new lr.HTMLElement}},dr=typeof window=="undefined"||typeof window.customElements=="undefined",u=dr?lr:window,d=dr?Mo:window.document;function h(i,e){u.customElements.get(i)||(u.customElements.define(i,e),u[e.name]=e)}var ko=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Te=(i,e,t)=>(ko(i,e,"read from private field"),t?t.call(i):e.get(i)),Oi=(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)},Ut,Oe,Ni,ur=d.createElement("template");ur.innerHTML=`
1
+ "use strict";var Uo=Object.create;var Ii=Object.defineProperty;var No=Object.getOwnPropertyDescriptor;var Bo=Object.getOwnPropertyNames;var Ho=Object.getPrototypeOf,$o=Object.prototype.hasOwnProperty;var Wo=(i,e)=>{for(var t in e)Ii(i,t,{get:e[t],enumerable:!0})},pn=(i,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Bo(e))!$o.call(i,r)&&r!==t&&Ii(i,r,{get:()=>e[r],enumerable:!(a=No(e,r))||a.enumerable});return i};var Vo=(i,e,t)=>(t=i!=null?Uo(Ho(i)):{},pn(e||!i||!i.__esModule?Ii(t,"default",{value:i,enumerable:!0}):t,i)),Fo=i=>pn(Ii({},"__esModule",{value:!0}),i);var Ma=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)};var A=(i,e,t)=>(Ma(i,e,"read from private field"),t?t.call(i):e.get(i)),L=(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)},G=(i,e,t,a)=>(Ma(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t);var P=(i,e,t)=>(Ma(i,e,"access private method"),t);var qd={};Wo(qd,{MediaError:()=>v.MediaError,default:()=>Zd,getVideoAttribute:()=>Be});module.exports=Fo(qd);var dt=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class i extends dt{}globalThis.DocumentFragment=i}var Dt=class extends dt{},ka=class extends dt{},Ko={get(i){},define(i,e,t){},upgrade(i){},whenDefined(i){return Promise.resolve(Dt)}},Rt,Sa=class{constructor(e,t={}){L(this,Rt,void 0);G(this,Rt,t==null?void 0:t.detail)}get detail(){return A(this,Rt)}initCustomEvent(){}};Rt=new WeakMap;function Yo(i,e){return new Dt}var bn={document:{createElement:Yo},DocumentFragment,customElements:Ko,CustomEvent:Sa,EventTarget:dt,HTMLElement:Dt,HTMLVideoElement:ka},En=typeof window=="undefined"||typeof globalThis.customElements=="undefined",R=En?bn:globalThis,F=En?bn.document:globalThis.document;var h={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_VOLUME_REQUEST:"mediavolumerequest",MEDIA_SEEK_REQUEST:"mediaseekrequest",MEDIA_AIRPLAY_REQUEST:"mediaairplayrequest",MEDIA_ENTER_FULLSCREEN_REQUEST:"mediaenterfullscreenrequest",MEDIA_EXIT_FULLSCREEN_REQUEST:"mediaexitfullscreenrequest",MEDIA_PREVIEW_REQUEST:"mediapreviewrequest",MEDIA_ENTER_PIP_REQUEST:"mediaenterpiprequest",MEDIA_EXIT_PIP_REQUEST:"mediaexitpiprequest",MEDIA_ENTER_CAST_REQUEST:"mediaentercastrequest",MEDIA_EXIT_CAST_REQUEST:"mediaexitcastrequest",MEDIA_SHOW_TEXT_TRACKS_REQUEST:"mediashowtexttracksrequest",MEDIA_HIDE_TEXT_TRACKS_REQUEST:"mediahidetexttracksrequest",MEDIA_SHOW_CAPTIONS_REQUEST:"mediashowcaptionsrequest",MEDIA_SHOW_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_CAPTIONS_REQUEST:"mediadisablecaptionsrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",MEDIA_SEEK_TO_LIVE_REQUEST:"mediaseektoliverequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},Ot={MEDIA_AIRPLAY_UNAVAILABLE:"mediaairplayunavailablechange",MEDIA_PIP_UNAVAILABLE:"mediapipunavailablechange",MEDIA_PAUSED:"mediapausedchange",MEDIA_HAS_PLAYED:"mediahasplayedchange",MEDIA_MUTED:"mediamutedchange",MEDIA_VOLUME_LEVEL:"mediavolumelevelchange",MEDIA_VOLUME:"mediavolumechange",MEDIA_VOLUME_UNAVAILABLE:"mediavolumeunavailablechange",MEDIA_IS_PIP:"mediaispipchange",MEDIA_IS_CASTING:"mediaiscastingchange",MEDIA_CAPTIONS_LIST:"mediacaptionslistchange",MEDIA_SUBTITLES_LIST:"mediasubtitleslistchange",MEDIA_CAPTIONS_SHOWING:"mediacaptionsshowingchange",MEDIA_SUBTITLES_SHOWING:"mediasubtitlesshowingchange",MEDIA_IS_FULLSCREEN:"mediaisfullscreenchange",MEDIA_PLAYBACK_RATE:"mediaplaybackratechange",MEDIA_CURRENT_TIME:"mediacurrenttimechange",MEDIA_DURATION:"mediadurationchange",MEDIA_SEEKABLE:"mediaseekablechange",MEDIA_PREVIEW_IMAGE:"mediapreviewimagechange",MEDIA_PREVIEW_COORDS:"mediapreviewcoordschange",MEDIA_LOADING:"medialoadingchange",USER_INACTIVE:"userinactivechange"},p={MEDIA_CHROME_ATTRIBUTES:"media-chrome-attributes",MEDIA_CONTROLLER:"media-controller"},o={MEDIA_AIRPLAY_UNAVAILABLE:"media-airplay-unavailable",MEDIA_FULLSCREEN_UNAVAILABLE:"media-fullscreen-unavailable",MEDIA_PIP_UNAVAILABLE:"media-pip-unavailable",MEDIA_CAST_UNAVAILABLE:"media-cast-unavailable",MEDIA_PAUSED:"media-paused",MEDIA_HAS_PLAYED:"media-has-played",MEDIA_MUTED:"media-muted",MEDIA_VOLUME_LEVEL:"media-volume-level",MEDIA_VOLUME:"media-volume",MEDIA_VOLUME_UNAVAILABLE:"media-volume-unavailable",MEDIA_IS_PIP:"media-is-pip",MEDIA_IS_CASTING:"media-is-casting",MEDIA_CAPTIONS_LIST:"media-captions-list",MEDIA_SUBTITLES_LIST:"media-subtitles-list",MEDIA_CAPTIONS_SHOWING:"media-captions-showing",MEDIA_SUBTITLES_SHOWING:"media-subtitles-showing",MEDIA_IS_FULLSCREEN:"media-is-fullscreen",MEDIA_PLAYBACK_RATE:"media-playback-rate",MEDIA_CURRENT_TIME:"media-current-time",MEDIA_DURATION:"media-duration",MEDIA_SEEKABLE:"media-seekable",MEDIA_PREVIEW_TIME:"media-preview-time",MEDIA_PREVIEW_IMAGE:"media-preview-image",MEDIA_PREVIEW_COORDS:"media-preview-coords",MEDIA_LOADING:"media-loading",MEDIA_BUFFERED:"media-buffered",MEDIA_STREAM_TYPE:"media-stream-type",MEDIA_TIME_IS_LIVE:"media-time-is-live"},Jd=Object.entries(Ot).reduce((i,[e,t])=>{let a=o[e];return a&&(i[t]=a),i},{userinactivechange:"user-inactive"}),fn=Object.entries(o).reduce((i,[e,t])=>{let a=Ot[e];return a&&(i[t]=a),i},{"user-inactive":"userinactivechange"}),ct={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},$e={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Ca={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},ee={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},Pt={LIVE:"live",ON_DEMAND:"on-demand"};var $={AUDIO_PLAYER:()=>"audio player",VIDEO_PLAYER:()=>"video player",VOLUME:()=>"volume",SEEK:()=>"seek",CLOSED_CAPTIONS:()=>"closed captions",PLAYBACK_RATE:({playbackRate:i=1}={})=>`current playback rate ${i}`,PLAYBACK_TIME:()=>"playback time",MEDIA_LOADING:()=>"media loading"},w={PLAY:()=>"play",PAUSE:()=>"pause",MUTE:()=>"mute",UNMUTE:()=>"unmute",AIRPLAY:()=>"air play",ENTER_CAST:()=>"start casting",EXIT_CAST:()=>"stop casting",ENTER_FULLSCREEN:()=>"enter fullscreen mode",EXIT_FULLSCREEN:()=>"exit fullscreen mode",ENTER_PIP:()=>"enter picture in picture mode",EXIT_PIP:()=>"exit picture in picture mode",SEEK_FORWARD_N_SECS:({seekOffset:i=30}={})=>`seek forward ${i} seconds`,SEEK_BACK_N_SECS:({seekOffset:i=30}={})=>`seek back ${i} seconds`},Zo={...$,...w};function Ti(i,e=!1){return i.split("_").map(function(t,a){return(a||e?t[0].toUpperCase():t[0].toLowerCase())+t.slice(1).toLowerCase()}).join("")}function vn(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function gn(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}function An(i){return typeof i!="string"?!1:!isNaN(i)&&!isNaN(parseFloat(i))}var _n=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],qo=(i,e)=>{let t=i===1?_n[e].singular:_n[e].plural;return`${i} ${t}`},We=i=>{if(!gn(i))return"";let e=Math.abs(i),t=e!==i,a=new Date(0,0,0,0,0,e,0);return`${[a.getHours(),a.getMinutes(),a.getSeconds()].map((d,c)=>d&&qo(d,c)).filter(d=>d).join(", ")}${t?" remaining":""}`};function X(i,e){let t=!1;i<0&&(t=!0,i=0-i),i=i<0?0:i;let a=Math.floor(i%60),r=Math.floor(i/60%60),n=Math.floor(i/3600),s=Math.floor(e/60%60),d=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(n=r=a="-"),n=n>0||d>0?n+":":"",r=((n||s>=10)&&r<10?"0"+r:r)+":",a=a<10?"0"+a:a,(t?"-":"")+n+r+a}var Mi=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},La=class{observe(){}},yn={ResizeObserver:La,HTMLElement:class extends Mi{},DocumentFragment:class extends Mi{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},CustomEvent:function(){}},zo={createElement:function(){return new yn.HTMLElement}},In=typeof window=="undefined"||typeof window.customElements=="undefined",l=In?yn:window,u=In?zo:window.document;var Xo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ve=(i,e,t)=>(Xo(i,e,"read from private field"),t?t.call(i):e.get(i)),wa=(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)},ki,ut,xa,Tn=u.createElement("template");Tn.innerHTML=`
2
2
  <style>
3
3
  :host {
4
4
  display: inline-flex;
@@ -50,12 +50,12 @@
50
50
  min-width: 100%;
51
51
  }
52
52
  </style>
53
- `;var Ot=class extends u.HTMLElement{constructor(e={}){super(),Oi(this,Ut,n=>{this.handleClick(n)}),Oi(this,Oe,n=>{let{key:s}=n;if(!this.keysUsed.includes(s)){this.removeEventListener("keyup",Te(this,Oe));return}this.handleClick(n)}),Oi(this,Ni,n=>{let{metaKey:s,altKey:l,key:c}=n;if(s||l||!this.keysUsed.includes(c)){this.removeEventListener("keyup",Te(this,Oe));return}this.addEventListener("keyup",Te(this,Oe),{once:!0})});let t=this.attachShadow({mode:"open"}),a=ur.content.cloneNode(!0);this.nativeEl=a;let r=e.slotTemplate;r||(r=d.createElement("template"),r.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),t.appendChild(a)}static get observedAttributes(){return["disabled",A.MEDIA_CONTROLLER]}enable(){this.addEventListener("click",Te(this,Ut)),this.addEventListener("keydown",Te(this,Ni)),this.setAttribute("tabindex","0")}disable(){this.removeEventListener("click",Te(this,Ut)),this.removeEventListener("keyup",Te(this,Oe)),this.removeAttribute("tabindex")}attributeChangedCallback(e,t,a){var r,n;if(e===A.MEDIA_CONTROLLER){if(t){let s=d.getElementById(t);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=d.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}else e==="disabled"&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){var e;this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","button");let t=this.getAttribute(A.MEDIA_CONTROLLER);if(t){let a=d.getElementById(t);(e=a==null?void 0:a.associateElement)==null||e.call(a,this)}}disconnectedCallback(){var e;this.disable();let t=this.getAttribute(A.MEDIA_CONTROLLER);if(t){let a=d.getElementById(t);(e=a==null?void 0:a.unassociateElement)==null||e.call(a,this)}}get keysUsed(){return["Enter"," "]}handleClick(e){}};Ut=new WeakMap;Oe=new WeakMap;Ni=new WeakMap;h("media-chrome-button",Ot);var x=Ot;var So=`<svg aria-hidden="true" viewBox="0 0 26 24">
53
+ `;var Si=class extends l.HTMLElement{constructor(e={}){super(),wa(this,ki,n=>{this.handleClick(n)}),wa(this,ut,n=>{let{key:s}=n;if(!this.keysUsed.includes(s)){this.removeEventListener("keyup",Ve(this,ut));return}this.handleClick(n)}),wa(this,xa,n=>{let{metaKey:s,altKey:d,key:c}=n;if(s||d||!this.keysUsed.includes(c)){this.removeEventListener("keyup",Ve(this,ut));return}this.addEventListener("keyup",Ve(this,ut),{once:!0})});let t=this.attachShadow({mode:"open"}),a=Tn.content.cloneNode(!0);this.nativeEl=a;let r=e.slotTemplate;r||(r=u.createElement("template"),r.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),t.appendChild(a)}static get observedAttributes(){return["disabled",p.MEDIA_CONTROLLER]}enable(){this.addEventListener("click",Ve(this,ki)),this.addEventListener("keydown",Ve(this,xa)),this.setAttribute("tabindex","0")}disable(){this.removeEventListener("click",Ve(this,ki)),this.removeEventListener("keyup",Ve(this,ut)),this.removeAttribute("tabindex")}attributeChangedCallback(e,t,a){var r,n;if(e===p.MEDIA_CONTROLLER){if(t){let s=u.getElementById(t);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=u.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}else e==="disabled"&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){var e;this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","button");let t=this.getAttribute(p.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.associateElement)==null||e.call(a,this)}}disconnectedCallback(){var e;this.disable();let t=this.getAttribute(p.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.unassociateElement)==null||e.call(a,this)}}get keysUsed(){return["Enter"," "]}handleClick(e){}};ki=new WeakMap;ut=new WeakMap;xa=new WeakMap;l.customElements.get("media-chrome-button")||l.customElements.define("media-chrome-button",Si);var C=Si;var Jo=`<svg aria-hidden="true" viewBox="0 0 26 24">
54
54
  <path d="M22.13 3H3.87a.87.87 0 0 0-.87.87v13.26a.87.87 0 0 0 .87.87h3.4L9 16H5V5h16v11h-4l1.72 2h3.4a.87.87 0 0 0 .87-.87V3.87a.87.87 0 0 0-.86-.87Zm-8.75 11.44a.5.5 0 0 0-.76 0l-4.91 5.73a.5.5 0 0 0 .38.83h9.82a.501.501 0 0 0 .38-.83l-4.91-5.73Z"/>
55
55
  </svg>
56
- `,cr=d.createElement("template");cr.innerHTML=`
57
- <slot name="airplay">${So}</slot>
58
- `;var Bi=class extends x{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_AIRPLAY_UNAVAILABLE]}constructor(e={}){super({slotTemplate:cr,...e})}connectedCallback(){this.setAttribute("aria-label",C.AIRPLAY()),super.connectedCallback()}handleClick(){let e=new u.CustomEvent(p.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};h("media-airplay-button",Bi);var Lo='<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/></g></svg>',Co='<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/><path class="cast_caf_icon_boxfill" d="M5,7 L5,8.63 C8,8.6 13.37,14 13.37,17 L19,17 L19,7 Z"/></g></svg>',hr=d.createElement("template");hr.innerHTML=`
56
+ `,Mn=u.createElement("template");Mn.innerHTML=`
57
+ <slot name="airplay">${Jo}</slot>
58
+ `;var Da=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_AIRPLAY_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Mn,...e})}connectedCallback(){this.setAttribute("aria-label",w.AIRPLAY()),super.connectedCallback()}handleClick(){let e=new l.CustomEvent(h.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};l.customElements.get("media-airplay-button")||l.customElements.define("media-airplay-button",Da);var jo='<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/></g></svg>',el='<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/><path class="cast_caf_icon_boxfill" d="M5,7 L5,8.63 C8,8.6 13.37,14 13.37,17 L19,17 L19,7 Z"/></g></svg>',Sn=u.createElement("template");Sn.innerHTML=`
59
59
  <style>
60
60
  :host([${o.MEDIA_IS_CASTING}]) slot:not([name=exit]) > *,
61
61
  :host([${o.MEDIA_IS_CASTING}]) ::slotted(:not([slot=exit])) {
@@ -69,16 +69,16 @@
69
69
  }
70
70
  </style>
71
71
 
72
- <slot name="enter">${Lo}</slot>
73
- <slot name="exit">${Co}</slot>
74
- `;var mr=i=>{let t=i.getAttribute(o.MEDIA_IS_CASTING)!=null?C.EXIT_CAST():C.ENTER_CAST();i.setAttribute("aria-label",t)},$i=class extends x{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_CASTING,o.MEDIA_CAST_UNAVAILABLE]}constructor(e={}){super({slotTemplate:hr,...e})}connectedCallback(){mr(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_IS_CASTING&&mr(this),super.attributeChangedCallback(e,t,a)}handleClick(){let e=this.getAttribute(o.MEDIA_IS_CASTING)!=null?p.MEDIA_EXIT_CAST_REQUEST:p.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}};h("media-cast-button",$i);var Nt=(i,e,t=".value")=>{let a=i.querySelector(t);!a||(a.textContent=e)},wo=(i,e)=>{let t=`slot[name="${e}"]`,a=i.shadowRoot.querySelector(t);return a?a.children:[]},Bt=(i,e)=>wo(i,e)[0],it=(i,e)=>!i||!e?!1:i.contains(e)?!0:it(i,e.getRootNode().host),at=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||at(i.getRootNode().host,e)};function ae(i,e){var t;let a;for(a of i.querySelectorAll("style")){let r;try{r=(t=a.sheet)==null?void 0:t.cssRules}catch{continue}for(let n of r!=null?r:[])if(n.selectorText===e)return n}return a!=null&&a.sheet?(a.sheet.insertRule(`${e}{}`,a.sheet.cssRules.length),a.sheet.cssRules[a.sheet.cssRules.length-1]):{style:{setProperty:()=>{}}}}var br=d.createElement("template");br.innerHTML=`
72
+ <slot name="enter">${jo}</slot>
73
+ <slot name="exit">${el}</slot>
74
+ `;var kn=i=>{let t=i.getAttribute(o.MEDIA_IS_CASTING)!=null?w.EXIT_CAST():w.ENTER_CAST();i.setAttribute("aria-label",t)},Ra=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_CASTING,o.MEDIA_CAST_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Sn,...e})}connectedCallback(){kn(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_IS_CASTING&&kn(this),super.attributeChangedCallback(e,t,a)}handleClick(){let e=this.getAttribute(o.MEDIA_IS_CASTING)!=null?h.MEDIA_EXIT_CAST_REQUEST:h.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};l.customElements.get("media-cast-button")||l.customElements.define("media-cast-button",Ra);var Ci=(i,e,t=".value")=>{let a=i.querySelector(t);!a||(a.textContent=e)},tl=(i,e)=>{let t=`slot[name="${e}"]`,a=i.shadowRoot.querySelector(t);return a?a.children:[]},Li=(i,e)=>tl(i,e)[0],Ut=(i,e)=>!i||!e?!1:i.contains(e)?!0:Ut(i,e.getRootNode().host),Fe=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||Fe(i.getRootNode().host,e)};function ce(i,e){var t;let a;for(a of i.querySelectorAll("style")){let r;try{r=(t=a.sheet)==null?void 0:t.cssRules}catch{continue}for(let n of r!=null?r:[])if(n.selectorText===e)return n}return a!=null&&a.sheet?(a.sheet.insertRule(`${e}{}`,a.sheet.cssRules.length),a.sheet.cssRules[a.sheet.cssRules.length-1]):{style:{setProperty:()=>{}}}}var Ln=u.createElement("template");Ln.innerHTML=`
75
75
  <style>
76
76
  :host {
77
77
  display: inline-block;
78
78
  box-sizing: border-box;
79
79
  }
80
80
  </style>
81
- `;var Vi=class extends u.HTMLElement{static get observedAttributes(){return[A.MEDIA_CONTROLLER,o.MEDIA_PAUSED]}constructor(e={}){super();let t=this.attachShadow({mode:"open"}),a=br.content.cloneNode(!0);this.nativeEl=a;let r=e.slotTemplate;r||(r=d.createElement("template"),r.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),t.appendChild(a)}attributeChangedCallback(e,t,a){var r,n;if(e===A.MEDIA_CONTROLLER){if(t){let s=d.getElementById(t);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=d.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}}connectedCallback(){var e;this.setAttribute("tabindex",-1),this.setAttribute("aria-hidden",!0);let t=pr(this);this.getAttribute(A.MEDIA_CONTROLLER)&&((e=t==null?void 0:t.associateElement)==null||e.call(t,this)),t==null||t.addEventListener("pointerdown",this),t==null||t.addEventListener("click",this)}disconnectedCallback(){var e;let t=pr(this);this.getAttribute(A.MEDIA_CONTROLLER)&&((e=t==null?void 0:t.unassociateElement)==null||e.call(t,this)),t==null||t.removeEventListener("pointerdown",this),t==null||t.removeEventListener("click",this)}handleEvent(e){var t;let a=(t=e.composedPath())==null?void 0:t[0];if(!!["video","media-controller"].includes(a==null?void 0:a.localName)){if(e.type==="pointerdown")this._pointerType=e.pointerType;else if(e.type==="click"){let{clientX:n,clientY:s}=e,{left:l,top:c,width:m,height:E}=this.getBoundingClientRect(),f=n-l,w=s-c;if(f<0||w<0||f>m||w>E||m===0&&E===0)return;let{pointerType:T=this._pointerType}=e;if(this._pointerType=void 0,T===Pi.TOUCH){this.handleTap(e);return}else if(T===Pi.MOUSE){this.handleMouseClick(e);return}}}}handleTap(e){}handleMouseClick(e){let t=this.getAttribute(o.MEDIA_PAUSED)!=null?p.MEDIA_PLAY_REQUEST:p.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new u.CustomEvent(t,{composed:!0,bubbles:!0}))}};function pr(i){let e=i.getAttribute(A.MEDIA_CONTROLLER);return e?d.getElementById(e):at(i,"media-controller")}h("media-gesture-receiver",Vi);var Er=d.createElement("template");Er.innerHTML=`
81
+ `;var Oa=class extends l.HTMLElement{static get observedAttributes(){return[p.MEDIA_CONTROLLER,o.MEDIA_PAUSED]}constructor(e={}){super();let t=this.attachShadow({mode:"open"}),a=Ln.content.cloneNode(!0);this.nativeEl=a;let r=e.slotTemplate;r||(r=u.createElement("template"),r.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),t.appendChild(a)}attributeChangedCallback(e,t,a){var r,n;if(e===p.MEDIA_CONTROLLER){if(t){let s=u.getElementById(t);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=u.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}}connectedCallback(){var e;this.setAttribute("tabindex",-1),this.setAttribute("aria-hidden",!0);let t=Cn(this);this.getAttribute(p.MEDIA_CONTROLLER)&&((e=t==null?void 0:t.associateElement)==null||e.call(t,this)),t==null||t.addEventListener("pointerdown",this),t==null||t.addEventListener("click",this)}disconnectedCallback(){var e;let t=Cn(this);this.getAttribute(p.MEDIA_CONTROLLER)&&((e=t==null?void 0:t.unassociateElement)==null||e.call(t,this)),t==null||t.removeEventListener("pointerdown",this),t==null||t.removeEventListener("click",this)}handleEvent(e){var t;let a=(t=e.composedPath())==null?void 0:t[0];if(!!["video","media-controller"].includes(a==null?void 0:a.localName)){if(e.type==="pointerdown")this._pointerType=e.pointerType;else if(e.type==="click"){let{clientX:n,clientY:s}=e,{left:d,top:c,width:m,height:b}=this.getBoundingClientRect(),y=n-d,f=s-c;if(y<0||f<0||y>m||f>b||m===0&&b===0)return;let{pointerType:I=this._pointerType}=e;if(this._pointerType=void 0,I===Ca.TOUCH){this.handleTap(e);return}else if(I===Ca.MOUSE){this.handleMouseClick(e);return}}}}handleTap(e){}handleMouseClick(e){let t=this.getAttribute(o.MEDIA_PAUSED)!=null?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new l.CustomEvent(t,{composed:!0,bubbles:!0}))}};function Cn(i){let e=i.getAttribute(p.MEDIA_CONTROLLER);return e?u.getElementById(e):Fe(i,"media-controller")}l.customElements.get("media-gesture-receiver")||l.customElements.define("media-gesture-receiver",Oa);var wn=u.createElement("template");wn.innerHTML=`
82
82
  <style>
83
83
 
84
84
  :host([media-is-fullscreen]) ::slotted([slot=media]) {
@@ -175,6 +175,10 @@
175
175
  ::slotted(media-control-bar) {
176
176
  align-self: stretch;
177
177
  }
178
+
179
+ :host([${o.MEDIA_HAS_PLAYED}]) ::slotted([slot=poster]) {
180
+ display: none;
181
+ }
178
182
  </style>
179
183
 
180
184
  <slot name="media" part="layer media-layer"></slot>
@@ -189,7 +193,7 @@
189
193
 
190
194
  <slot part="bottom chrome"></slot>
191
195
  </span>
192
- `;var Do=Object.values(o),$t=class extends u.HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Er.content.cloneNode(!0));let e=n=>{let s=this.media;for(let l of n)l.type==="childList"&&(l.removedNodes.forEach(c=>{if(c.slot=="media"&&l.target==this){let m=l.previousSibling&&l.previousSibling.previousElementSibling;if(!m||!s)this.mediaUnsetCallback(c);else{let E=m.slot!=="media";for(;(m=m.previousSibling)!==null;)m.slot=="media"&&(E=!1);E&&this.mediaUnsetCallback(c)}}}),s&&l.addedNodes.forEach(c=>{c==s&&this.handleMediaUpdated(s).then(m=>this.mediaSetCallback(m))}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0});let a=this.media,r=this.querySelector(":scope > slot[slot=media]");r&&r.addEventListener("slotchange",()=>{if(!r.assignedElements({flatten:!0}).length){this.mediaUnsetCallback(a);return}this.media&&(a=this.media,this.handleMediaUpdated(this.media).then(s=>this.mediaSetCallback(s)))})}static get observedAttributes(){return["autohide","gestures-disabled"].concat(Do)}attributeChangedCallback(e,t,a){e.toLowerCase()=="autohide"&&(this.autohide=a)}get media(){let e=this.querySelector(":scope > [slot=media]");return(e==null?void 0:e.nodeName)=="SLOT"&&(e=e.assignedElements({flatten:!0})[0]),e}mediaSetCallback(e){this._mediaClickPlayToggle=()=>{let t=e.paused?p.MEDIA_PLAY_REQUEST:p.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new u.CustomEvent(t,{composed:!0,bubbles:!0}))}}handleMediaUpdated(e){let t=n=>Promise.resolve(n),a=n=>(console.error('<media-chrome>: Media element set with slot="media" does not appear to be compatible.',n),Promise.reject(n));if(!e)return a(e);let r=e.nodeName.toLowerCase();return r.includes("-")?u.customElements.whenDefined(r).then(()=>t(e)):t(e)}mediaUnsetCallback(e){}connectedCallback(){let t=this.getAttribute("audio")!=null?B.AUDIO_PLAYER():B.VIDEO_PLAYER();this.setAttribute("role","region"),this.setAttribute("aria-label",t),this.media&&this.handleMediaUpdated(this.media).then(s=>this.mediaSetCallback(s)),this.setAttribute("user-inactive","user-inactive");let a=()=>{if(this.autohide<0)return;this.setAttribute("user-inactive","user-inactive");let s=new u.CustomEvent(tt.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(s)},r=()=>{this.removeAttribute("user-inactive");let s=new u.CustomEvent(tt.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(s)},n=()=>{r(),u.clearTimeout(this._inactiveTimeout),!(this.autohide<0)&&(this._inactiveTimeout=u.setTimeout(()=>{a()},this.autohide*1e3))};this.addEventListener("keyup",()=>{n()}),this.addEventListener("pointerup",s=>{s.pointerType==="touch"?[this,this.media].includes(s.target)&&!this.hasAttribute("user-inactive")?a():n():s.composedPath().some(l=>{var c;return["media-play-button","media-fullscreen-button"].includes((c=l==null?void 0:l.nodeName)==null?void 0:c.toLowerCase())})&&n()}),this.addEventListener("pointermove",s=>{s.pointerType==="mouse"&&s.target!==this&&(r(),u.clearTimeout(this._inactiveTimeout),[this,this.media].includes(s.target)&&n())}),this.addEventListener("mouseleave",()=>{a()}),this.addEventListener("keyup",()=>{this.setAttribute("media-keyboard-control","")}),this.addEventListener("mouseup",()=>{this.removeAttribute("media-keyboard-control")})}set autohide(e){e=Number(e),this._autohide=isNaN(e)?0:e}get autohide(){return this._autohide===void 0?2:this._autohide}};h("media-container-temp",$t);var fr=$t;var vr=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},N=(i,e,t)=>(vr(i,e,"read from private field"),t?t.call(i):e.get(i)),Hi=(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)},Wi=(i,e,t,a)=>(vr(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ne,Be,K,Vt=class{constructor(e,t){Hi(this,Ne,void 0),Hi(this,Be,void 0),Hi(this,K,[]),Wi(this,Ne,e),Wi(this,Be,t)}[Symbol.iterator](){return N(this,K).values()}get length(){return N(this,K).length}get value(){var e;return(e=N(this,K).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(Wi(this,K,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return N(this,K)[e]}values(){return N(this,K).values()}keys(){return N(this,K).keys()}forEach(e){N(this,K).forEach(e)}add(...e){var t,a;e.forEach(r=>{this.contains(r)||N(this,K).push(r)}),!(this.value===""&&!((t=N(this,Ne))!=null&&t.hasAttribute(`${N(this,Be)}`)))&&((a=N(this,Ne))==null||a.setAttribute(`${N(this,Be)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>{N(this,K).splice(N(this,K).indexOf(a),1)}),(t=N(this,Ne))==null||t.setAttribute(`${N(this,Be)}`,`${this.value}`)}contains(e){return N(this,K).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)}};Ne=new WeakMap;Be=new WeakMap;K=new WeakMap;var U={enter:"requestFullscreen",exit:"exitFullscreen",event:"fullscreenchange",element:"fullscreenElement",error:"fullscreenerror",enabled:"fullscreenEnabled"};d.fullscreenElement===void 0&&(U.enter="webkitRequestFullScreen",U.exit=d.webkitExitFullscreen!=null?"webkitExitFullscreen":"webkitCancelFullScreen",U.event="webkitfullscreenchange",U.element="webkitFullscreenElement",U.error="webkitfullscreenerror",U.enabled="webkitFullscreenEnabled");var Fi=(i="")=>i.split(/\s+/),gr=(i="")=>{let[e,t]=i.split(":"),a=t?decodeURIComponent(t):void 0;return{language:e,label:a}},xo=(i="",e={})=>Fi(i).map(t=>{let a=gr(t);return{...e,...a}}),Ro=i=>Array.isArray(i)?i.map(e=>typeof e=="string"?gr(e):e):typeof i=="string"?xo(i):[i],Po=({label:i,language:e}={})=>i?`${e}:${encodeURIComponent(i)}`:e,Q=(i=[])=>Array.prototype.map.call(i,Po).join(" "),Uo=(i,e)=>t=>t[i]===e,Ar=i=>{let e=Object.entries(i).map(([t,a])=>Uo(t,a));return t=>e.every(a=>a(t))},rt=(i,e=[],t=[])=>{let a=Ro(t).map(Ar),r=n=>a.some(s=>s(n));Array.from(e).filter(r).forEach(n=>{n.mode=i})},$e=(i,e=()=>!0)=>{if(!(i!=null&&i.textTracks))return[];let t=typeof e=="function"?e:Ar(e);return Array.from(i.textTracks).filter(t)},Ki=i=>{let e=!!i.getAttribute(o.MEDIA_CAPTIONS_SHOWING),t=!i.hasAttribute("no-subtitles-fallback")&&!!i.getAttribute(o.MEDIA_SUBTITLES_SHOWING);return e||t},Ht=i=>{var e,t,a,r;if(Ki(i)){let s=i.getAttribute(o.MEDIA_CAPTIONS_SHOWING);if(s){let c=new window.CustomEvent(p.MEDIA_DISABLE_CAPTIONS_REQUEST,{composed:!0,bubbles:!0,detail:s});i.dispatchEvent(c)}let l=i.getAttribute(o.MEDIA_SUBTITLES_SHOWING);if(l&&!i.hasAttribute("no-subtitles-fallback")){let c=new window.CustomEvent(p.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:l});i.dispatchEvent(c)}}else{let[s]=(t=Fi((e=i.getAttribute(o.MEDIA_CAPTIONS_LIST))!=null?e:""))!=null?t:[];if(s){let l=new window.CustomEvent(p.MEDIA_SHOW_CAPTIONS_REQUEST,{composed:!0,bubbles:!0,detail:s});i.dispatchEvent(l)}else if(i.hasAttribute("no-subtitles-fallback"))console.error("Attempting to enable closed captions but none are available! Please verify your media content if this is unexpected.");else{let[l]=(r=Fi((a=i.getAttribute(o.MEDIA_SUBTITLES_LIST))!=null?a:""))!=null?r:[];if(l){let c=new window.CustomEvent(p.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:l});i.dispatchEvent(c)}}}};var Ir=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ve=(i,e,t)=>(Ir(i,e,"read from private field"),t?t.call(i):e.get(i)),Yi=(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)},He=(i,e,t)=>(Ir(i,e,"access private method"),t),ue,We,lt,Kt,Gi,Oo=Object.values(xt),Mr=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],No=10,_r=0,Gt=class extends fr{constructor(){super(),Yi(this,We),Yi(this,Kt),Yi(this,ue,new Vt(this,"hotkeys")),Go||(this._airplayUnavailable=q.UNSUPPORTED),Tr||(this._fullscreenUnavailable=q.UNAVAILABLE),Zo||(this._castUnavailable=q.UNSUPPORTED),Ko||(this._pipUnavailable=q.UNSUPPORTED),st!==void 0?st||(this._volumeUnavailable=q.UNSUPPORTED):Yo.then(()=>{st||(this._volumeUnavailable=q.UNSUPPORTED,this.propagateMediaState(o.MEDIA_VOLUME_UNAVAILABLE,this._volumeUnavailable))}),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,this.associatedElements=[],this.associateElement(this);let e={MEDIA_PLAY_REQUEST:()=>this.media.play(),MEDIA_PAUSE_REQUEST:()=>this.media.pause(),MEDIA_MUTE_REQUEST:()=>this.media.muted=!0,MEDIA_UNMUTE_REQUEST:()=>{let t=this.media;t.muted=!1,t.volume===0&&(t.volume=.25)},MEDIA_VOLUME_REQUEST:t=>{let a=this.media,r=t.detail;a.volume=r,r>0&&a.muted&&(a.muted=!1);try{u.localStorage.setItem("media-chrome-pref-volume",r.toString())}catch{}},MEDIA_ENTER_FULLSCREEN_REQUEST:()=>{if(!Tr){console.warn("Fullscreen support is unavailable; not entering fullscreen");return}let t=this.media;d.pictureInPictureElement&&d.exitPictureInPicture(),super[U.enter]?super[U.enter]():t.webkitEnterFullscreen?t.webkitEnterFullscreen():t.requestFullscreen?t.requestFullscreen():console.warn("MediaChrome: Fullscreen not supported")},MEDIA_EXIT_FULLSCREEN_REQUEST:()=>{d[U.exit]()},MEDIA_ENTER_PIP_REQUEST:()=>{let t=this.media;if(!d.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!t.requestPictureInPicture){console.warn("MediaChrome: The current media does not support picture-in-picture");return}d[U.element]&&d[U.exit]();let a=()=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};t.requestPictureInPicture().catch(r=>{if(r.code===11)if(t.readyState===0&&t.preload==="none"){let n=()=>{t.removeEventListener("loadedmetadata",s),t.preload="none"},s=()=>{t.requestPictureInPicture().catch(a),n()};t.addEventListener("loadedmetadata",s),t.preload="metadata",setTimeout(()=>{t.readyState===0&&a(),n()},1e3)}else throw r;else throw r})},MEDIA_EXIT_PIP_REQUEST:()=>{d.pictureInPictureElement&&d.exitPictureInPicture()},MEDIA_ENTER_CAST_REQUEST:()=>{var t;let a=this.media;!((t=globalThis.CastableVideoElement)!=null&&t.castEnabled)||(d[U.element]&&d[U.exit](),a.requestCast())},MEDIA_EXIT_CAST_REQUEST:async()=>{var t;(t=globalThis.CastableVideoElement)!=null&&t.castElement&&globalThis.CastableVideoElement.exitCast()},MEDIA_SEEK_REQUEST:t=>{let a=this.media,r=t.detail;(a.readyState>0||a.readyState===void 0)&&(a.currentTime=r)},MEDIA_PLAYBACK_RATE_REQUEST:t=>{this.media.playbackRate=t.detail},MEDIA_PREVIEW_REQUEST:t=>{var a;let r=this.media;if(!r)return;let n=t.detail;n===null&&this.propagateMediaState(o.MEDIA_PREVIEW_TIME,void 0),this.propagateMediaState(o.MEDIA_PREVIEW_TIME,n);let[s]=$e(r,{kind:Ue.METADATA,label:"thumbnails"});if(!(s&&s.cues))return;if(n===null){this.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,void 0),this.propagateMediaState(o.MEDIA_PREVIEW_COORDS,void 0);return}let l=Array.prototype.find.call(s.cues,f=>f.startTime>=n);if(!l)return;let c=/'^(?:[a-z]+:)?\/\//i.test(l.text)||(a=r.querySelector('track[label="thumbnails"]'))==null?void 0:a.src,m=new URL(l.text,c),E=new URLSearchParams(m.hash).get("#xywh");this.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,m.href),this.propagateMediaState(o.MEDIA_PREVIEW_COORDS,E.split(",").join(" "))},MEDIA_SHOW_CAPTIONS_REQUEST:t=>{let a=Yt(this),{detail:r=[]}=t;rt(_e.SHOWING,a,r)},MEDIA_DISABLE_CAPTIONS_REQUEST:t=>{let a=Yt(this),{detail:r=[]}=t;rt(_e.DISABLED,a,r)},MEDIA_SHOW_SUBTITLES_REQUEST:t=>{let a=ot(this),{detail:r=[]}=t;rt(_e.SHOWING,a,r)},MEDIA_DISABLE_SUBTITLES_REQUEST:t=>{let a=ot(this),{detail:r=[]}=t;rt(_e.DISABLED,a,r)},MEDIA_AIRPLAY_REQUEST:()=>{let{media:t}=this;if(!!t){if(!(t.webkitShowPlaybackTargetPicker&&u.WebKitPlaybackTargetAvailabilityEvent)){console.warn("received a request to select AirPlay but AirPlay is not supported in this environment");return}t.webkitShowPlaybackTargetPicker()}}};if(Object.keys(e).forEach(t=>{let a=`_handle${Rt(t,!0)}`;this[a]=r=>{if(r.stopPropagation(),!this.media){console.warn("MediaController: No media available.");return}e[t](r,this.media)},this.addEventListener(p[t],this[a])}),this._mediaStatePropagators={"play,pause,emptied":()=>{this.propagateMediaState(o.MEDIA_PAUSED,kr(this))},"playing,emptied":()=>{var t;this.propagateMediaState(o.MEDIA_HAS_PLAYED,!((t=this.media)!=null&&t.paused))},volumechange:()=>{this.propagateMediaState(o.MEDIA_MUTED,Sr(this)),this.propagateMediaState(o.MEDIA_VOLUME,Lr(this)),this.propagateMediaState(o.MEDIA_VOLUME_LEVEL,Cr(this))},[U.event]:t=>{let r=!!d[U.element]&&(t==null?void 0:t.target),n=it(this,r);this.propagateMediaState(o.MEDIA_IS_FULLSCREEN,n)},"enterpictureinpicture,leavepictureinpicture":t=>{var a;let r;if(t)r=t.type=="enterpictureinpicture";else{let n=(a=this.getRootNode().pictureInPictureElement)!=null?a:d.pictureInPictureElement;r=this.media&&it(this.media,n)}this.propagateMediaState(o.MEDIA_IS_PIP,r)},"entercast,leavecast,castchange":t=>{var a;let r=(a=globalThis.CastableVideoElement)==null?void 0:a.castElement,n=this.media&&it(this.media,r);(t==null?void 0:t.type)==="castchange"&&(t==null?void 0:t.detail)==="CONNECTING"&&(n="connecting"),this.propagateMediaState(o.MEDIA_IS_CASTING,n)},"timeupdate,loadedmetadata":()=>{this.propagateMediaState(o.MEDIA_CURRENT_TIME,wr(this))},"durationchange,loadedmetadata,emptied":()=>{this.propagateMediaState(o.MEDIA_DURATION,Dr(this)),this.propagateMediaState(o.MEDIA_STREAM_TYPE)},"loadedmetadata,emptied,progress":()=>{var t;this.propagateMediaState(o.MEDIA_SEEKABLE,(t=xr(this))==null?void 0:t.join(":"))},"progress,emptied":()=>{var t;this.propagateMediaState(o.MEDIA_BUFFERED,zo((t=this.media)==null?void 0:t.buffered))},"ratechange,loadstart":()=>{this.propagateMediaState(o.MEDIA_PLAYBACK_RATE,Rr(this))},"waiting,playing,emptied":()=>{var t;let a=((t=this.media)==null?void 0:t.readyState)<3;this.propagateMediaState(o.MEDIA_LOADING,a)}},this._airplayUnavailable!==q.UNSUPPORTED){let t=a=>{(a==null?void 0:a.availability)==="available"?this._airplayUnavailable=void 0:(a==null?void 0:a.availability)==="not-available"&&(this._airplayUnavailable=q.UNAVAILABLE),this.propagateMediaState(o.MEDIA_AIRPLAY_UNAVAILABLE,this._airplayUnavailable)};this._mediaStatePropagators.webkitplaybacktargetavailabilitychanged=t}if(this._castUnavailable!==q.UNSUPPORTED){let t=()=>{var a;let r=(a=globalThis.CastableVideoElement)==null?void 0:a.castState;r!=null&&r.includes("CONNECT")?this._castUnavailable=void 0:this._castUnavailable=q.UNAVAILABLE,this.propagateMediaState(o.MEDIA_CAST_UNAVAILABLE,this._castUnavailable)};this._mediaStatePropagators.castchange=t}this._textTrackMediaStatePropagators={"addtrack,removetrack,loadstart":()=>{this.propagateMediaState(o.MEDIA_CAPTIONS_LIST,Q(Yt(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_LIST,Q(ot(this))||void 0),this.propagateMediaState(o.MEDIA_CAPTIONS_SHOWING,Q(Zi(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_SHOWING,Q(yr(this))||void 0)},change:()=>{this.propagateMediaState(o.MEDIA_CAPTIONS_SHOWING,Q(Zi(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_SHOWING,Q(yr(this))||void 0)}},this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat("nohotkeys","hotkeys","default-stream-type")}attributeChangedCallback(e,t,a){e==="nohotkeys"?a!==t&&a===""?(this.hasAttribute("hotkeys")&&console.warn("Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):a!==t&&a===null&&this.enableHotkeys():e==="hotkeys"?Ve(this,ue).value=a:e==="default-stream-type"&&this.propagateMediaState(o.MEDIA_STREAM_TYPE),super.attributeChangedCallback(e,t,a)}mediaSetCallback(e){super.mediaSetCallback(e),e.hasAttribute("tabindex")||e.setAttribute("tabindex",-1),Object.keys(this._mediaStatePropagators).forEach(t=>{let a=t.split(","),r=this._mediaStatePropagators[t];a.forEach(n=>{(n==U.event?this.getRootNode():e).addEventListener(n,r)}),r()}),Object.entries(this._textTrackMediaStatePropagators).forEach(([t,a])=>{t.split(",").forEach(n=>{e.textTracks&&e.textTracks.addEventListener(n,a)}),a()});try{let t=u.localStorage.getItem("media-chrome-pref-volume");t!==null&&(e.volume=t)}catch(t){console.debug("Error getting volume pref",t)}}mediaUnsetCallback(e){super.mediaUnsetCallback(e),Object.keys(this._mediaStatePropagators).forEach(t=>{let a=t.split(","),r=this._mediaStatePropagators[t];a.forEach(n=>{(n==U.event?this.getRootNode():e).removeEventListener(n,r)})}),Object.entries(this._textTrackMediaStatePropagators).forEach(([t,a])=>{t.split(",").forEach(n=>{e.textTracks&&e.textTracks.removeEventListener(n,a)}),a()}),this.propagateMediaState(o.MEDIA_PAUSED,!0)}propagateMediaState(e,t){arguments.length===1&&(t=Wt[e](this)),Ie(this.mediaStateReceivers,e,t);let a=new u.CustomEvent(rr[e],{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(a)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(t.has(e))return;let a=this.registerMediaStateReceiver.bind(this),r=this.unregisterMediaStateReceiver.bind(this),n=Ho(e,a,r);Object.keys(p).forEach(s=>{e.addEventListener(p[s],this[`_handle${Rt(s,!0)}`])}),t.set(e,n)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(!t.has(e))return;t.get(e)(),t.delete(e),Object.keys(p).forEach(r=>{e.removeEventListener(p[r],this[`_handle${Rt(r,!0)}`])})}registerMediaStateReceiver(e){if(!e)return;let t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),Ie([e],o.MEDIA_VOLUME_UNAVAILABLE,this._volumeUnavailable),Ie([e],o.MEDIA_AIRPLAY_UNAVAILABLE,this._airplayUnavailable),Ie([e],o.MEDIA_FULLSCREEN_UNAVAILABLE,this._fullscreenUnavailable),Ie([e],o.MEDIA_CAST_UNAVAILABLE,this._castUnavailable),Ie([e],o.MEDIA_PIP_UNAVAILABLE,this._pipUnavailable),this.media&&Object.keys(o).forEach(r=>{r.includes("UNAVAILABLE")||Ie([e],o[r],Wt[o[r]]?Wt[o[r]](this):Wt.default(this,o[r]))}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,a=t.indexOf(e);a<0||t.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",He(this,Kt,Gi))}disableHotkeys(){this.removeEventListener("keydown",He(this,Kt,Gi)),this.removeEventListener("keyup",He(this,We,lt))}get hotkeys(){return Ve(this,ue)}keyboardShortcutHandler(e){var t,a,r,n;if(((n=(r=(t=e.target.getAttribute("keysused"))==null?void 0:t.split(" "))!=null?r:(a=e.target)==null?void 0:a.keysUsed)!=null?n:[]).map(T=>T==="Space"?" ":T).filter(Boolean).includes(e.key))return;let l,c,m,E,f,w=No;if(!Ve(this,ue).contains(`no${e.key.toLowerCase()}`)&&!(e.key===" "&&Ve(this,ue).contains("nospace")))switch(e.key){case" ":case"k":l=this.getAttribute(o.MEDIA_PAUSED)!=null?p.MEDIA_PLAY_REQUEST:p.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new u.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"m":l=this.getAttribute(o.MEDIA_VOLUME_LEVEL)==="off"?p.MEDIA_UNMUTE_REQUEST:p.MEDIA_MUTE_REQUEST,this.dispatchEvent(new u.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"f":l=this.getAttribute(o.MEDIA_IS_FULLSCREEN)!=null?p.MEDIA_EXIT_FULLSCREEN_REQUEST:p.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new u.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"c":Ht(this);break;case"ArrowLeft":c=this.getAttribute(o.MEDIA_CURRENT_TIME),m=c&&!Number.isNaN(+c)?+c:_r,E=Math.max(m-w,0),f=new u.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:E}),this.dispatchEvent(f);break;case"ArrowRight":c=this.getAttribute(o.MEDIA_CURRENT_TIME),m=c&&!Number.isNaN(+c)?+c:_r,E=Math.max(m+w,0),f=new u.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:E}),this.dispatchEvent(f);break;default:break}}};ue=new WeakMap;We=new WeakSet;lt=function(i){let{key:e}=i;if(!Mr.includes(e)){this.removeEventListener("keyup",He(this,We,lt));return}this.keyboardShortcutHandler(i)};Kt=new WeakSet;Gi=function(i){let{metaKey:e,altKey:t,key:a}=i;if(e||t||!Mr.includes(a)){this.removeEventListener("keyup",He(this,We,lt));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(Ve(this,ue).contains(`no${a.toLowerCase()}`)||a===" "&&Ve(this,ue).contains("nospace"))&&i.preventDefault(),this.addEventListener("keyup",He(this,We,lt),{once:!0})};var Wt={default(i,e){return i.getAttribute(e)},[o.MEDIA_CAPTIONS_LIST](i){return Q(Yt(i))||void 0},[o.MEDIA_SUBTITLES_LIST](i){return Q(ot(i))||void 0},[o.MEDIA_SUBTITLES_LIST](i){return Q(ot(i))||void 0},[o.MEDIA_CAPTIONS_SHOWING](i){return Q(Zi(i))||void 0},[o.MEDIA_PAUSED](i){return kr(i)},[o.MEDIA_MUTED](i){return Sr(i)},[o.MEDIA_VOLUME](i){return Lr(i)},[o.MEDIA_VOLUME_LEVEL](i){return Cr(i)},[o.MEDIA_CURRENT_TIME](i){return wr(i)},[o.MEDIA_DURATION](i){return Dr(i)},[o.MEDIA_SEEKABLE](i){var e;return(e=xr(i))==null?void 0:e.join(":")},[o.MEDIA_PLAYBACK_RATE](i){return Rr(i)},[o.MEDIA_STREAM_TYPE](i){let e=i.media;if(!e)return;let t=e.duration;if(t===1/0)return xt.LIVE;if(Number.isFinite(t))return xt.ON_DEMAND;{let a=i.getAttribute("default-stream-type");if(Oo.includes(a))return a}return null}},kr=i=>i.media?i.media.paused:!0,Sr=i=>!!(i.media&&i.media.muted),Lr=i=>{let e=i.media;return e?e.volume:1},Cr=i=>{let e="high";if(!i.media)return e;let{muted:t,volume:a}=i.media;return a===0||t?e="off":a<.5?e="low":a<.75&&(e="medium"),e},wr=i=>{let e=i.media;return e?e.currentTime:0},Dr=i=>{let e=i==null?void 0:i.media;return Number.isFinite(e==null?void 0:e.duration)?e.duration:NaN},xr=i=>{var e;let t=i==null?void 0:i.media;if(!((e=t==null?void 0:t.seekable)!=null&&e.length))return;let a=t.seekable.start(0),r=t.seekable.end(t.seekable.length-1);if(!(!a&&!r))return[Number(a.toFixed(3)),Number(r.toFixed(3))]},Rr=i=>{let e=i.media;return e?e.playbackRate:1},ot=i=>$e(i.media,{kind:Ue.SUBTITLES}),Yt=i=>$e(i.media,{kind:Ue.CAPTIONS}),yr=i=>$e(i.media,{kind:Ue.SUBTITLES,mode:_e.SHOWING}),Zi=i=>$e(i.media,{kind:Ue.CAPTIONS,mode:_e.SHOWING}),Bo=Object.values(o),Pr=i=>{var e,t,a,r;let{observedAttributes:n}=i.constructor;!n&&((e=i.nodeName)==null?void 0:e.includes("-"))&&(u.customElements.upgrade(i),{observedAttributes:n}=i.constructor);let s=(r=(a=(t=i==null?void 0:i.getAttribute)==null?void 0:t.call(i,A.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(n||s)?(n||s).filter(l=>Bo.includes(l)):[]},qi=i=>!!Pr(i).length,$o=async(i,e,t)=>(i.isConnected||await Ur(0),t==null?i.removeAttribute(e):typeof t=="boolean"?t?i.setAttribute(e,""):i.removeAttribute(e):Number.isNaN(t)?i.removeAttribute(e):i.setAttribute(e,t)),Vo=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},nt=(i,e)=>{if(Vo(i))return;let t=(r,n)=>{var s,l;qi(r)&&n(r);let{children:c=[]}=r!=null?r:{},m=(l=(s=r==null?void 0:r.shadowRoot)==null?void 0:s.children)!=null?l:[];[...c,...m].forEach(f=>nt(f,n))},a=i==null?void 0:i.nodeName.toLowerCase();if(a.includes("-")&&!qi(i)){u.customElements.whenDefined(a).then(()=>{t(i,e)});return}t(i,e)},Ie=(i,e,t)=>{i.forEach(a=>{!Pr(a).includes(e)||$o(a,e,t)})},Ho=(i,e,t)=>{nt(i,e);let a=c=>{var m;let E=(m=c==null?void 0:c.composedPath()[0])!=null?m:c.target;e(E)},r=c=>{var m;let E=(m=c==null?void 0:c.composedPath()[0])!=null?m:c.target;t(E)};i.addEventListener(p.REGISTER_MEDIA_STATE_RECEIVER,a),i.addEventListener(p.UNREGISTER_MEDIA_STATE_RECEIVER,r);let n=c=>{c.forEach(m=>{let{addedNodes:E=[],removedNodes:f=[],type:w,target:T,attributeName:P}=m;w==="childList"?(Array.prototype.forEach.call(E,M=>nt(M,e)),Array.prototype.forEach.call(f,M=>nt(M,t))):w==="attributes"&&P===A.MEDIA_CHROME_ATTRIBUTES&&(qi(T)?e(T):t(T))})},s=new MutationObserver(n);return s.observe(i,{childList:!0,attributes:!0,subtree:!0}),()=>{nt(i,t),s.disconnect(),i.removeEventListener(p.REGISTER_MEDIA_STATE_RECEIVER,a),i.removeEventListener(p.UNREGISTER_MEDIA_STATE_RECEIVER,r)}},Ft,Qi=()=>{var i,e;return Ft||(Ft=(e=(i=d)==null?void 0:i.createElement)==null?void 0:e.call(i,"video"),Ft)},Wo=async(i=Qi())=>{if(!i)return!1;let e=i.volume;return i.volume=e/2+.1,await Ur(0),i.volume!==e},Ur=i=>new Promise(e=>setTimeout(e,i)),Fo=(i=Qi())=>typeof(i==null?void 0:i.requestPictureInPicture)=="function",Ko=Fo(),st,Yo=Wo().then(i=>(st=i,st)),Go=!!u.WebKitPlaybackTargetAvailabilityEvent,Zo=!!u.chrome,qo=(i=Qi())=>{let e=d[U.enabled];return!e&&i&&(e="webkitSupportsFullscreen"in i),e},Tr=qo(),Qo=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}});function zo(i=Qo){return Array.from(i).map((e,t)=>[Number(i.start(t).toFixed(3)),Number(i.end(t).toFixed(3))].join(":")).join(" ")}h("media-controller",Gt);var dt=Gt;var Nr=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Xo=(i,e,t)=>(Nr(i,e,"read from private field"),t?t.call(i):e.get(i)),jo=(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)},Jo=(i,e,t,a)=>(Nr(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Zt,Br=d.createElement("template"),Or=`
196
+ `;var il=Object.values(o),al="sm:384 md:576 lg:768 xl:960",rl=i=>{var e;for(let t of i){let a=t.target;if(!a.isConnected)continue;let r=(e=a.getAttribute("breakpoints"))!=null?e:al,n=nl(r),s=sl(n,t.contentRect);Object.keys(n).forEach(d=>{if(s.includes(d)){a.hasAttribute(`breakpoint-${d}`)||a.setAttribute(`breakpoint-${d}`,"");return}a.removeAttribute(`breakpoint-${d}`)})}};function nl(i){let e=i.split(/\s+/);return Object.fromEntries(e.map(t=>t.split(":")))}function sl(i,e){return Object.keys(i).filter(t=>e.width>=i[t])}var wi=class extends l.HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(wn.content.cloneNode(!0));let e=s=>{let d=this.media;for(let c of s)c.type==="childList"&&(c.removedNodes.forEach(m=>{if(m.slot=="media"&&c.target==this){let b=c.previousSibling&&c.previousSibling.previousElementSibling;if(!b||!d)this.mediaUnsetCallback(m);else{let y=b.slot!=="media";for(;(b=b.previousSibling)!==null;)b.slot=="media"&&(y=!1);y&&this.mediaUnsetCallback(m)}}}),d&&c.addedNodes.forEach(m=>{m==d&&this.handleMediaUpdated(d).then(b=>this.mediaSetCallback(b))}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0}),new ResizeObserver(rl).observe(this);let r=this.media,n=this.querySelector(":scope > slot[slot=media]");n&&n.addEventListener("slotchange",()=>{if(!n.assignedElements({flatten:!0}).length){this.mediaUnsetCallback(r);return}this.media&&(r=this.media,this.handleMediaUpdated(this.media).then(d=>this.mediaSetCallback(d)))})}static get observedAttributes(){return["autohide","gestures-disabled"].concat(il)}attributeChangedCallback(e,t,a){e.toLowerCase()=="autohide"&&(this.autohide=a)}get media(){let e=this.querySelector(":scope > [slot=media]");return(e==null?void 0:e.nodeName)=="SLOT"&&(e=e.assignedElements({flatten:!0})[0]),e}mediaSetCallback(e){this._mediaClickPlayToggle=()=>{let t=e.paused?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new l.CustomEvent(t,{composed:!0,bubbles:!0}))}}handleMediaUpdated(e){let t=n=>Promise.resolve(n),a=n=>(console.error('<media-chrome>: Media element set with slot="media" does not appear to be compatible.',n),Promise.reject(n));if(!e)return a(e);let r=e.nodeName.toLowerCase();return r.includes("-")?l.customElements.whenDefined(r).then(()=>t(e)):t(e)}mediaUnsetCallback(e){}connectedCallback(){let t=this.getAttribute("audio")!=null?$.AUDIO_PLAYER():$.VIDEO_PLAYER();this.setAttribute("role","region"),this.setAttribute("aria-label",t),this.media&&this.handleMediaUpdated(this.media).then(s=>this.mediaSetCallback(s)),this.setAttribute("user-inactive","user-inactive");let a=()=>{if(this.autohide<0)return;this.setAttribute("user-inactive","user-inactive");let s=new l.CustomEvent(Ot.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(s)},r=()=>{this.removeAttribute("user-inactive");let s=new l.CustomEvent(Ot.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(s)},n=()=>{r(),l.clearTimeout(this._inactiveTimeout),!(this.autohide<0)&&(this._inactiveTimeout=l.setTimeout(()=>{a()},this.autohide*1e3))};this.addEventListener("keyup",()=>{n()}),this.addEventListener("pointerup",s=>{s.pointerType==="touch"?[this,this.media].includes(s.target)&&!this.hasAttribute("user-inactive")?a():n():s.composedPath().some(d=>{var c;return["media-play-button","media-fullscreen-button"].includes((c=d==null?void 0:d.nodeName)==null?void 0:c.toLowerCase())})&&n()}),this.addEventListener("pointermove",s=>{s.pointerType==="mouse"&&s.target!==this&&(r(),l.clearTimeout(this._inactiveTimeout),[this,this.media].includes(s.target)&&n())}),this.addEventListener("mouseleave",()=>{a()}),this.addEventListener("keyup",()=>{this.setAttribute("media-keyboard-control","")}),this.addEventListener("mouseup",()=>{this.removeAttribute("media-keyboard-control")})}set autohide(e){e=Number(e),this._autohide=isNaN(e)?0:e}get autohide(){return this._autohide===void 0?2:this._autohide}};l.customElements.get("media-container-temp")||l.customElements.define("media-container-temp",wi);var xn=wi;var Dn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},W=(i,e,t)=>(Dn(i,e,"read from private field"),t?t.call(i):e.get(i)),Pa=(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)},Ua=(i,e,t,a)=>(Dn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),mt,ht,z,xi=class{constructor(e,t){Pa(this,mt,void 0),Pa(this,ht,void 0),Pa(this,z,new Set),Ua(this,mt,e),Ua(this,ht,t)}[Symbol.iterator](){return W(this,z).values()}get length(){return W(this,z).size}get value(){var e;return(e=[...W(this,z)].join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(Ua(this,z,new Set),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return[...W(this,z)][e]}values(){return W(this,z).values()}keys(){return W(this,z).keys()}forEach(e){W(this,z).forEach(e)}add(...e){var t,a;e.forEach(r=>W(this,z).add(r)),!(this.value===""&&!((t=W(this,mt))!=null&&t.hasAttribute(`${W(this,ht)}`)))&&((a=W(this,mt))==null||a.setAttribute(`${W(this,ht)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>W(this,z).delete(a)),(t=W(this,mt))==null||t.setAttribute(`${W(this,ht)}`,`${this.value}`)}contains(e){return W(this,z).has(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)}};mt=new WeakMap;ht=new WeakMap;z=new WeakMap;var U={enter:"requestFullscreen",exit:"exitFullscreen",event:"fullscreenchange",element:"fullscreenElement",error:"fullscreenerror",enabled:"fullscreenEnabled"};u.fullscreenElement===void 0&&(U.enter="webkitRequestFullScreen",U.exit=u.webkitExitFullscreen!=null?"webkitExitFullscreen":"webkitCancelFullScreen",U.event="webkitfullscreenchange",U.element="webkitFullscreenElement",U.error="webkitfullscreenerror",U.enabled="webkitFullscreenEnabled");var Na=(i="")=>i.split(/\s+/),Rn=(i="")=>{let[e,t]=i.split(":"),a=t?decodeURIComponent(t):void 0;return{language:e,label:a}},Nt=(i="",e={})=>Na(i).map(t=>{let a=Rn(t);return{...e,...a}}),ol=i=>Array.isArray(i)?i.map(e=>typeof e=="string"?Rn(e):e):typeof i=="string"?Nt(i):[i],Ba=({label:i,language:e}={})=>i?`${e}:${encodeURIComponent(i)}`:e,te=(i=[])=>Array.prototype.map.call(i,Ba).join(" "),ll=(i,e)=>t=>t[i]===e,On=i=>{let e=Object.entries(i).map(([t,a])=>ll(t,a));return t=>e.every(a=>a(t))},Bt=(i,e=[],t=[])=>{let a=ol(t).map(On),r=n=>a.some(s=>s(n));Array.from(e).filter(r).forEach(n=>{n.mode=i})},pt=(i,e=()=>!0)=>{if(!(i!=null&&i.textTracks))return[];let t=typeof e=="function"?e:On(e);return Array.from(i.textTracks).filter(t)},Ht=i=>{let e=!!i.getAttribute(o.MEDIA_CAPTIONS_SHOWING),t=!i.hasAttribute("no-subtitles-fallback")&&!!i.getAttribute(o.MEDIA_SUBTITLES_SHOWING);return e||t},ye=i=>{var e,t,a,r;if(Ht(i)){let s=i.getAttribute(o.MEDIA_CAPTIONS_SHOWING);if(s){let c=new window.CustomEvent(h.MEDIA_DISABLE_CAPTIONS_REQUEST,{composed:!0,bubbles:!0,detail:s});i.dispatchEvent(c)}let d=i.getAttribute(o.MEDIA_SUBTITLES_SHOWING);if(d&&!i.hasAttribute("no-subtitles-fallback")){let c=new window.CustomEvent(h.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:d});i.dispatchEvent(c)}}else{let[s]=(t=Na((e=i.getAttribute(o.MEDIA_CAPTIONS_LIST))!=null?e:""))!=null?t:[];if(s){let d=new window.CustomEvent(h.MEDIA_SHOW_CAPTIONS_REQUEST,{composed:!0,bubbles:!0,detail:s});i.dispatchEvent(d)}else if(i.hasAttribute("no-subtitles-fallback"))console.error("Attempting to enable closed captions but none are available! Please verify your media content if this is unexpected.");else{let[d]=(r=Na((a=i.getAttribute(o.MEDIA_SUBTITLES_LIST))!=null?a:""))!=null?r:[];if(d){let c=new window.CustomEvent(h.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:d});i.dispatchEvent(c)}}}};var Va=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ye=(i,e,t)=>(Va(i,e,"read from private field"),t?t.call(i):e.get(i)),Di=(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)},Pn=(i,e,t,a)=>(Va(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),bt=(i,e,t)=>(Va(i,e,"access private method"),t),Ie,Wt,Et,Yt,Oi,Ha,dl=Object.values(Pt),Hn=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],cl=10,Un=0,Ui=class extends xn{constructor(){super(),Di(this,Et),Di(this,Oi),Di(this,Ie,new xi(this,"hotkeys")),Di(this,Wt,void 0),gl||(this._airplayUnavailable=ee.UNSUPPORTED),Bn||(this._fullscreenUnavailable=ee.UNAVAILABLE),Al||(this._castUnavailable=ee.UNSUPPORTED),fl||(this._pipUnavailable=ee.UNSUPPORTED),Kt!==void 0?Kt||(this._volumeUnavailable=ee.UNSUPPORTED):vl.then(()=>{Kt||(this._volumeUnavailable=ee.UNSUPPORTED,this.propagateMediaState(o.MEDIA_VOLUME_UNAVAILABLE,this._volumeUnavailable))}),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,this.associateElement(this);let e={MEDIA_PLAY_REQUEST:(t,a)=>{let r=$t[o.MEDIA_STREAM_TYPE](this),n=this.getAttribute("noautoseektolive")===null;r==Pt.LIVE&&n&&e.MEDIA_SEEK_TO_LIVE_REQUEST(t,a),this.media.play()},MEDIA_PAUSE_REQUEST:()=>this.media.pause(),MEDIA_MUTE_REQUEST:()=>this.media.muted=!0,MEDIA_UNMUTE_REQUEST:()=>{let t=this.media;t.muted=!1,t.volume===0&&(t.volume=.25)},MEDIA_VOLUME_REQUEST:t=>{let a=this.media,r=t.detail;a.volume=r,r>0&&a.muted&&(a.muted=!1);try{l.localStorage.setItem("media-chrome-pref-volume",r.toString())}catch{}},MEDIA_ENTER_FULLSCREEN_REQUEST:()=>{if(!Bn){console.warn("Fullscreen support is unavailable; not entering fullscreen");return}let t=this.media;u.pictureInPictureElement&&u.exitPictureInPicture(),super[U.enter]?this.fullscreenElement[U.enter]():t.webkitEnterFullscreen?t.webkitEnterFullscreen():t.requestFullscreen?t.requestFullscreen():console.warn("MediaChrome: Fullscreen not supported")},MEDIA_EXIT_FULLSCREEN_REQUEST:()=>{u[U.exit]()},MEDIA_ENTER_PIP_REQUEST:()=>{let t=this.media;if(!u.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!t.requestPictureInPicture){console.warn("MediaChrome: The current media does not support picture-in-picture");return}u[U.element]&&u[U.exit]();let a=()=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};t.requestPictureInPicture().catch(r=>{if(r.code===11)if(t.readyState===0&&t.preload==="none"){let n=()=>{t.removeEventListener("loadedmetadata",s),t.preload="none"},s=()=>{t.requestPictureInPicture().catch(a),n()};t.addEventListener("loadedmetadata",s),t.preload="metadata",setTimeout(()=>{t.readyState===0&&a(),n()},1e3)}else throw r;else throw r})},MEDIA_EXIT_PIP_REQUEST:()=>{u.pictureInPictureElement&&u.exitPictureInPicture()},MEDIA_ENTER_CAST_REQUEST:()=>{var t;let a=this.media;!((t=globalThis.CastableVideoElement)!=null&&t.castEnabled)||(u[U.element]&&u[U.exit](),a.requestCast())},MEDIA_EXIT_CAST_REQUEST:async()=>{var t;(t=globalThis.CastableVideoElement)!=null&&t.castElement&&globalThis.CastableVideoElement.exitCast()},MEDIA_SEEK_REQUEST:t=>{let a=this.media,r=t.detail;(a.readyState>0||a.readyState===void 0)&&(a.currentTime=r)},MEDIA_PLAYBACK_RATE_REQUEST:t=>{this.media.playbackRate=t.detail},MEDIA_PREVIEW_REQUEST:t=>{var a;let r=this.media;if(!r)return;let n=t.detail;n===null&&this.propagateMediaState(o.MEDIA_PREVIEW_TIME,void 0),this.propagateMediaState(o.MEDIA_PREVIEW_TIME,n);let[s]=pt(r,{kind:ct.METADATA,label:"thumbnails"});if(!(s&&s.cues))return;if(n===null){this.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,void 0),this.propagateMediaState(o.MEDIA_PREVIEW_COORDS,void 0);return}let d=Array.prototype.find.call(s.cues,y=>y.startTime>=n);if(!d)return;let c=/'^(?:[a-z]+:)?\/\//i.test(d.text)||(a=r.querySelector('track[label="thumbnails"]'))==null?void 0:a.src,m=new URL(d.text,c),b=new URLSearchParams(m.hash).get("#xywh");this.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,m.href),this.propagateMediaState(o.MEDIA_PREVIEW_COORDS,b.split(",").join(" "))},MEDIA_SHOW_CAPTIONS_REQUEST:t=>{let a=Pi(this),{detail:r=[]}=t;Bt($e.SHOWING,a,r)},MEDIA_DISABLE_CAPTIONS_REQUEST:t=>{let a=Pi(this),{detail:r=[]}=t;Bt($e.DISABLED,a,r)},MEDIA_SHOW_SUBTITLES_REQUEST:t=>{let a=Ft(this),{detail:r=[]}=t;Bt($e.SHOWING,a,r)},MEDIA_DISABLE_SUBTITLES_REQUEST:t=>{let a=Ft(this),{detail:r=[]}=t;Bt($e.DISABLED,a,r)},MEDIA_AIRPLAY_REQUEST:()=>{let{media:t}=this;if(!!t){if(!(t.webkitShowPlaybackTargetPicker&&l.WebKitPlaybackTargetAvailabilityEvent)){console.warn("received a request to select AirPlay but AirPlay is not supported in this environment");return}t.webkitShowPlaybackTargetPicker()}},MEDIA_SEEK_TO_LIVE_REQUEST:(t,a)=>{let r=a.seekable;if(!r){console.warn("MediaController: Media element does not support seeking to live.");return}if(!r.length){console.warn("MediaController: Media is unable to seek to live.");return}a.currentTime=r.end(r.length-1)}};if(Object.keys(e).forEach(t=>{let a=`_handle${Ti(t,!0)}`;this[a]=r=>{if(r.stopPropagation(),!this.media){console.warn("MediaController: No media available.");return}e[t](r,this.media)},this.addEventListener(h[t],this[a])}),this._mediaStatePropagators={"play,pause,emptied":()=>{this.propagateMediaState(o.MEDIA_PAUSED,$n(this))},"playing,emptied":()=>{var t;this.propagateMediaState(o.MEDIA_HAS_PLAYED,!((t=this.media)!=null&&t.paused))},volumechange:()=>{this.propagateMediaState(o.MEDIA_MUTED,Wn(this)),this.propagateMediaState(o.MEDIA_VOLUME,Vn(this)),this.propagateMediaState(o.MEDIA_VOLUME_LEVEL,Fn(this))},[U.event]:t=>{let r=!!u[U.element]&&(t==null?void 0:t.target),n=Ut(this.fullscreenElement,r);this.propagateMediaState(o.MEDIA_IS_FULLSCREEN,n)},"enterpictureinpicture,leavepictureinpicture":t=>{var a;let r;if(t)r=t.type=="enterpictureinpicture";else{let n=(a=this.getRootNode().pictureInPictureElement)!=null?a:u.pictureInPictureElement;r=this.media&&Ut(this.media,n)}this.propagateMediaState(o.MEDIA_IS_PIP,r)},"entercast,leavecast,castchange":t=>{var a;let r=(a=globalThis.CastableVideoElement)==null?void 0:a.castElement,n=this.media&&Ut(this.media,r);(t==null?void 0:t.type)==="castchange"&&(t==null?void 0:t.detail)==="CONNECTING"&&(n="connecting"),this.propagateMediaState(o.MEDIA_IS_CASTING,n)},"timeupdate,loadedmetadata":()=>{this.propagateMediaState(o.MEDIA_CURRENT_TIME,Kn(this))},"durationchange,loadedmetadata,emptied":()=>{this.propagateMediaState(o.MEDIA_DURATION,Yn(this)),this.propagateMediaState(o.MEDIA_STREAM_TYPE)},"loadedmetadata,emptied,progress":()=>{var t;this.propagateMediaState(o.MEDIA_SEEKABLE,(t=Gn(this))==null?void 0:t.join(":"))},"progress,emptied":()=>{var t;this.propagateMediaState(o.MEDIA_BUFFERED,Il((t=this.media)==null?void 0:t.buffered))},"ratechange,loadstart":()=>{this.propagateMediaState(o.MEDIA_PLAYBACK_RATE,Zn(this))},"waiting,playing,emptied":()=>{var t;let a=((t=this.media)==null?void 0:t.readyState)<3;this.propagateMediaState(o.MEDIA_LOADING,a)},"playing,timeupdate,progress,waiting,emptied":()=>{this.propagateMediaState(o.MEDIA_TIME_IS_LIVE)}},this._airplayUnavailable!==ee.UNSUPPORTED){let t=a=>{(a==null?void 0:a.availability)==="available"?this._airplayUnavailable=void 0:(a==null?void 0:a.availability)==="not-available"&&(this._airplayUnavailable=ee.UNAVAILABLE),this.propagateMediaState(o.MEDIA_AIRPLAY_UNAVAILABLE,this._airplayUnavailable)};this._mediaStatePropagators.webkitplaybacktargetavailabilitychanged=t}if(this._castUnavailable!==ee.UNSUPPORTED){let t=()=>{var a;let r=(a=globalThis.CastableVideoElement)==null?void 0:a.castState;r!=null&&r.includes("CONNECT")?this._castUnavailable=void 0:this._castUnavailable=ee.UNAVAILABLE,this.propagateMediaState(o.MEDIA_CAST_UNAVAILABLE,this._castUnavailable)};this._mediaStatePropagators.castchange=t}this._textTrackMediaStatePropagators={"addtrack,removetrack,loadstart":()=>{this.propagateMediaState(o.MEDIA_CAPTIONS_LIST,te(Pi(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_LIST,te(Ft(this))||void 0),this.propagateMediaState(o.MEDIA_CAPTIONS_SHOWING,te($a(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_SHOWING,te(Nn(this))||void 0)},change:()=>{this.propagateMediaState(o.MEDIA_CAPTIONS_SHOWING,te($a(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_SHOWING,te(Nn(this))||void 0)}},this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat("nohotkeys","hotkeys","default-stream-type")}get fullscreenElement(){var e;return(e=Ye(this,Wt))!=null?e:this}set fullscreenElement(e){this.hasAttribute("fullscreen-element")&&this.removeAttribute("fullscreen-element"),Pn(this,Wt,e)}attributeChangedCallback(e,t,a){var r;if(e==="nohotkeys")a!==t&&a===""?(this.hasAttribute("hotkeys")&&console.warn("Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):a!==t&&a===null&&this.enableHotkeys();else if(e==="hotkeys")Ye(this,Ie).value=a;else if(e==="default-stream-type")this.propagateMediaState(o.MEDIA_STREAM_TYPE);else if(e==="fullscreen-element"){let n=a?(r=this.getRootNode())==null?void 0:r.getElementById(a):void 0;Pn(this,Wt,n)}super.attributeChangedCallback(e,t,a)}mediaSetCallback(e){super.mediaSetCallback(e),e.hasAttribute("tabindex")||e.setAttribute("tabindex",-1),Object.keys(this._mediaStatePropagators).forEach(t=>{let a=t.split(","),r=this._mediaStatePropagators[t];a.forEach(n=>{(n==U.event?this.getRootNode():e).addEventListener(n,r)}),r()}),Object.entries(this._textTrackMediaStatePropagators).forEach(([t,a])=>{t.split(",").forEach(n=>{e.textTracks&&e.textTracks.addEventListener(n,a)}),a()});try{let t=l.localStorage.getItem("media-chrome-pref-volume");t!==null&&(e.volume=t)}catch(t){console.debug("Error getting volume pref",t)}}mediaUnsetCallback(e){super.mediaUnsetCallback(e),Object.keys(this._mediaStatePropagators).forEach(t=>{let a=t.split(","),r=this._mediaStatePropagators[t];a.forEach(n=>{(n==U.event?this.getRootNode():e).removeEventListener(n,r)})}),Object.entries(this._textTrackMediaStatePropagators).forEach(([t,a])=>{t.split(",").forEach(n=>{e.textTracks&&e.textTracks.removeEventListener(n,a)}),a()}),this.propagateMediaState(o.MEDIA_PAUSED,!0)}propagateMediaState(e,t){arguments.length===1&&(t=$t[e](this)),Ke(this.mediaStateReceivers,e,t);let a=new l.CustomEvent(fn[e],{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(a)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(t.has(e))return;let a=this.registerMediaStateReceiver.bind(this),r=this.unregisterMediaStateReceiver.bind(this),n=pl(e,a,r);Object.keys(h).forEach(s=>{e.addEventListener(h[s],this[`_handle${Ti(s,!0)}`])}),t.set(e,n)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(!t.has(e))return;t.get(e)(),t.delete(e),Object.keys(h).forEach(r=>{e.removeEventListener(h[r],this[`_handle${Ti(r,!0)}`])})}registerMediaStateReceiver(e){if(!e)return;let t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),Ke([e],o.MEDIA_VOLUME_UNAVAILABLE,this._volumeUnavailable),Ke([e],o.MEDIA_AIRPLAY_UNAVAILABLE,this._airplayUnavailable),Ke([e],o.MEDIA_FULLSCREEN_UNAVAILABLE,this._fullscreenUnavailable),Ke([e],o.MEDIA_CAST_UNAVAILABLE,this._castUnavailable),Ke([e],o.MEDIA_PIP_UNAVAILABLE,this._pipUnavailable),this.media&&Object.keys(o).forEach(r=>{r.includes("UNAVAILABLE")||Ke([e],o[r],$t[o[r]]?$t[o[r]](this):$t.default(this,o[r]))}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,a=t.indexOf(e);a<0||t.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",bt(this,Oi,Ha))}disableHotkeys(){this.removeEventListener("keydown",bt(this,Oi,Ha)),this.removeEventListener("keyup",bt(this,Et,Yt))}get hotkeys(){return Ye(this,Ie)}keyboardShortcutHandler(e){var t,a,r,n;if(((n=(r=(t=e.target.getAttribute("keysused"))==null?void 0:t.split(" "))!=null?r:(a=e.target)==null?void 0:a.keysUsed)!=null?n:[]).map(I=>I==="Space"?" ":I).filter(Boolean).includes(e.key))return;let d,c,m,b,y,f=cl;if(!Ye(this,Ie).contains(`no${e.key.toLowerCase()}`)&&!(e.key===" "&&Ye(this,Ie).contains("nospace")))switch(e.key){case" ":case"k":d=this.getAttribute(o.MEDIA_PAUSED)!=null?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new l.CustomEvent(d,{composed:!0,bubbles:!0}));break;case"m":d=this.getAttribute(o.MEDIA_VOLUME_LEVEL)==="off"?h.MEDIA_UNMUTE_REQUEST:h.MEDIA_MUTE_REQUEST,this.dispatchEvent(new l.CustomEvent(d,{composed:!0,bubbles:!0}));break;case"f":d=this.getAttribute(o.MEDIA_IS_FULLSCREEN)!=null?h.MEDIA_EXIT_FULLSCREEN_REQUEST:h.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new l.CustomEvent(d,{composed:!0,bubbles:!0}));break;case"c":ye(this);break;case"ArrowLeft":c=this.getAttribute(o.MEDIA_CURRENT_TIME),m=c&&!Number.isNaN(+c)?+c:Un,b=Math.max(m-f,0),y=new l.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:b}),this.dispatchEvent(y);break;case"ArrowRight":c=this.getAttribute(o.MEDIA_CURRENT_TIME),m=c&&!Number.isNaN(+c)?+c:Un,b=Math.max(m+f,0),y=new l.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:b}),this.dispatchEvent(y);break;default:break}}};Ie=new WeakMap;Wt=new WeakMap;Et=new WeakSet;Yt=function(i){let{key:e}=i;if(!Hn.includes(e)){this.removeEventListener("keyup",bt(this,Et,Yt));return}this.keyboardShortcutHandler(i)};Oi=new WeakSet;Ha=function(i){let{metaKey:e,altKey:t,key:a}=i;if(e||t||!Hn.includes(a)){this.removeEventListener("keyup",bt(this,Et,Yt));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(Ye(this,Ie).contains(`no${a.toLowerCase()}`)||a===" "&&Ye(this,Ie).contains("nospace"))&&i.preventDefault(),this.addEventListener("keyup",bt(this,Et,Yt),{once:!0})};var $t={default(i,e){return i.getAttribute(e)},[o.MEDIA_CAPTIONS_LIST](i){return te(Pi(i))||void 0},[o.MEDIA_SUBTITLES_LIST](i){return te(Ft(i))||void 0},[o.MEDIA_SUBTITLES_LIST](i){return te(Ft(i))||void 0},[o.MEDIA_CAPTIONS_SHOWING](i){return te($a(i))||void 0},[o.MEDIA_PAUSED](i){return $n(i)},[o.MEDIA_MUTED](i){return Wn(i)},[o.MEDIA_VOLUME](i){return Vn(i)},[o.MEDIA_VOLUME_LEVEL](i){return Fn(i)},[o.MEDIA_CURRENT_TIME](i){return Kn(i)},[o.MEDIA_DURATION](i){return Yn(i)},[o.MEDIA_SEEKABLE](i){var e;return(e=Gn(i))==null?void 0:e.join(":")},[o.MEDIA_PLAYBACK_RATE](i){return Zn(i)},[o.MEDIA_STREAM_TYPE](i){let e=i.media;if(!e)return null;let t=e.duration;if(t===1/0)return Pt.LIVE;if(Number.isFinite(t))return Pt.ON_DEMAND;{let a=i.getAttribute("default-stream-type");if(dl.includes(a))return a}return null},[o.MEDIA_TIME_IS_LIVE](i){let e=i.media;if(!e)return!1;let t=i.getAttribute(o.MEDIA_STREAM_TYPE)==="live",a=e.seekable;if(t&&!a)return!0;if(!(a!=null&&a.length))return!1;let r=10,n=i.getAttribute("livethreshold");n!==null&&(n=Number(n),Number.isNaN(n)||(r=n));let s=e.currentTime,d=a.end(a.length-1);return s>d-r}},$n=i=>i.media?i.media.paused:!0,Wn=i=>!!(i.media&&i.media.muted),Vn=i=>{let e=i.media;return e?e.volume:1},Fn=i=>{let e="high";if(!i.media)return e;let{muted:t,volume:a}=i.media;return a===0||t?e="off":a<.5?e="low":a<.75&&(e="medium"),e},Kn=i=>{let e=i.media;return e?e.currentTime:0},Yn=i=>{let e=i==null?void 0:i.media;return Number.isFinite(e==null?void 0:e.duration)?e.duration:NaN},Gn=i=>{var e;let t=i==null?void 0:i.media;if(!((e=t==null?void 0:t.seekable)!=null&&e.length))return;let a=t.seekable.start(0),r=t.seekable.end(t.seekable.length-1);if(!(!a&&!r))return[Number(a.toFixed(3)),Number(r.toFixed(3))]},Zn=i=>{let e=i.media;return e?e.playbackRate:1},Ft=i=>pt(i.media,{kind:ct.SUBTITLES}),Pi=i=>pt(i.media,{kind:ct.CAPTIONS}),Nn=i=>pt(i.media,{kind:ct.SUBTITLES,mode:$e.SHOWING}),$a=i=>pt(i.media,{kind:ct.CAPTIONS,mode:$e.SHOWING}),ul=Object.values(o),qn=i=>{var e,t,a,r;let{observedAttributes:n}=i.constructor;!n&&((e=i.nodeName)==null?void 0:e.includes("-"))&&(l.customElements.upgrade(i),{observedAttributes:n}=i.constructor);let s=(r=(a=(t=i==null?void 0:i.getAttribute)==null?void 0:t.call(i,p.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(n||s)?(n||s).filter(d=>ul.includes(d)):[]},Wa=i=>!!qn(i).length,ml=async(i,e,t)=>(i.isConnected||await Qn(0),t==null?i.removeAttribute(e):typeof t=="boolean"?t?i.setAttribute(e,""):i.removeAttribute(e):Number.isNaN(t)?i.removeAttribute(e):i.setAttribute(e,t)),hl=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},Vt=(i,e)=>{if(hl(i))return;let t=(r,n)=>{var s,d;Wa(r)&&n(r);let{children:c=[]}=r!=null?r:{},m=(d=(s=r==null?void 0:r.shadowRoot)==null?void 0:s.children)!=null?d:[];[...c,...m].forEach(y=>Vt(y,n))},a=i==null?void 0:i.nodeName.toLowerCase();if(a.includes("-")&&!Wa(i)){l.customElements.whenDefined(a).then(()=>{t(i,e)});return}t(i,e)},Ke=(i,e,t)=>{i.forEach(a=>{!qn(a).includes(e)||ml(a,e,t)})},pl=(i,e,t)=>{Vt(i,e);let a=c=>{var m;let b=(m=c==null?void 0:c.composedPath()[0])!=null?m:c.target;e(b)},r=c=>{var m;let b=(m=c==null?void 0:c.composedPath()[0])!=null?m:c.target;t(b)};i.addEventListener(h.REGISTER_MEDIA_STATE_RECEIVER,a),i.addEventListener(h.UNREGISTER_MEDIA_STATE_RECEIVER,r);let n=c=>{c.forEach(m=>{let{addedNodes:b=[],removedNodes:y=[],type:f,target:I,attributeName:B}=m;f==="childList"?(Array.prototype.forEach.call(b,D=>Vt(D,e)),Array.prototype.forEach.call(y,D=>Vt(D,t))):f==="attributes"&&B===p.MEDIA_CHROME_ATTRIBUTES&&(Wa(I)?e(I):t(I))})},s=new MutationObserver(n);return s.observe(i,{childList:!0,attributes:!0,subtree:!0}),()=>{Vt(i,t),s.disconnect(),i.removeEventListener(h.REGISTER_MEDIA_STATE_RECEIVER,a),i.removeEventListener(h.UNREGISTER_MEDIA_STATE_RECEIVER,r)}},Ri,Fa=()=>{var i,e;return Ri||(Ri=(e=(i=u)==null?void 0:i.createElement)==null?void 0:e.call(i,"video"),Ri)},bl=async(i=Fa())=>{if(!i)return!1;let e=i.volume;return i.volume=e/2+.1,await Qn(0),i.volume!==e},Qn=i=>new Promise(e=>setTimeout(e,i)),El=(i=Fa())=>typeof(i==null?void 0:i.requestPictureInPicture)=="function",fl=El(),Kt,vl=bl().then(i=>(Kt=i,Kt)),gl=!!l.WebKitPlaybackTargetAvailabilityEvent,Al=!!l.chrome,_l=(i=Fa())=>{let e=u[U.enabled];return!e&&i&&(e="webkitSupportsFullscreen"in i),e},Bn=_l(),yl=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}});function Il(i=yl){return Array.from(i).map((e,t)=>[Number(i.start(t).toFixed(3)),Number(i.end(t).toFixed(3))].join(":")).join(" ")}l.customElements.get("media-controller")||l.customElements.define("media-controller",Ui);var Gt=Ui;var Xn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Tl=(i,e,t)=>(Xn(i,e,"read from private field"),t?t.call(i):e.get(i)),Ml=(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)},kl=(i,e,t,a)=>(Xn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ni,Jn=u.createElement("template"),zn=`
193
197
  height: var(--thumb-height);
194
198
  width: var(--media-range-thumb-width, 10px);
195
199
  border: var(--media-range-thumb-border, none);
@@ -200,7 +204,7 @@
200
204
  transition: var(--media-range-thumb-transition, none);
201
205
  transform: var(--media-range-thumb-transform, none);
202
206
  opacity: var(--media-range-thumb-opacity, 1);
203
- `,zi=`
207
+ `,Ka=`
204
208
  width: var(--media-range-track-width, 100%);
205
209
  min-width: 40px;
206
210
  height: var(--track-height);
@@ -213,7 +217,7 @@
213
217
  transition: var(--media-range-track-transition, none);
214
218
  transform: translate(var(--media-range-track-translate-x, 0), var(--media-range-track-translate-y, 0));
215
219
  cursor: pointer;
216
- `;Br.innerHTML=`
220
+ `;Jn.innerHTML=`
217
221
  <style>
218
222
  :host {
219
223
  --thumb-height: var(--media-range-thumb-height, 10px);
@@ -262,19 +266,19 @@
262
266
 
263
267
  input[type=range]::-webkit-slider-thumb {
264
268
  -webkit-appearance: none;
265
- ${Or}
269
+ ${zn}
266
270
 
267
271
  margin-top: calc(calc(0px - var(--thumb-height) + var(--track-height)) / 2);
268
272
  }
269
273
 
270
274
 
271
275
  input[type=range]::-moz-range-thumb {
272
- ${Or}
276
+ ${zn}
273
277
  translate: var(--media-range-track-translate-x, 0) var(--media-range-track-translate-y, 0);
274
278
  }
275
279
 
276
- input[type=range]::-webkit-slider-runnable-track { ${zi} }
277
- input[type=range]::-moz-range-track { ${zi} }
280
+ input[type=range]::-webkit-slider-runnable-track { ${Ka} }
281
+ input[type=range]::-moz-range-track { ${Ka} }
278
282
  input[type=range]::-ms-track {
279
283
 
280
284
  width: 100%;
@@ -284,7 +288,7 @@
284
288
  border-color: transparent;
285
289
  color: transparent;
286
290
 
287
- ${zi}
291
+ ${Ka}
288
292
  }
289
293
 
290
294
  #background,
@@ -362,7 +366,7 @@
362
366
  <div id="hoverzone"></div>
363
367
  <input id="range" type="range" min="0" max="1000" step="any" value="0">
364
368
  </div>
365
- `;var qt=class extends u.HTMLElement{constructor(){super(),jo(this,Zt,void 0),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Br.content.cloneNode(!0)),this.container=this.shadowRoot.querySelector("#container"),this.range=this.shadowRoot.querySelector("#range"),this.range.addEventListener("input",this.updateBar.bind(this)),Jo(this,Zt,parseInt(getComputedStyle(this).getPropertyValue("--media-range-thumb-width")||"10",10))}static get observedAttributes(){return["disabled","aria-disabled",A.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n;if(e===A.MEDIA_CONTROLLER){if(t){let s=d.getElementById(t);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=d.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}else(e==="disabled"||e==="aria-disabled"&&t!==a)&&(a==null?this.range.removeAttribute(e):this.range.setAttribute(e,a))}connectedCallback(){var e;let t=this.getAttribute(A.MEDIA_CONTROLLER);if(t){let a=d.getElementById(t);(e=a==null?void 0:a.associateElement)==null||e.call(a,this)}this.updateBar()}disconnectedCallback(){var e;let t=this.getAttribute(A.MEDIA_CONTROLLER);if(t){let a=d.getElementById(t);(e=a==null?void 0:a.unassociateElement)==null||e.call(a,this)}}updatePointerBar(e){let t=this.range.getBoundingClientRect(),a=(e.clientX-t.left)/t.width;a=Math.max(0,Math.min(1,a));let{style:r}=ae(this.shadowRoot,"#pointer");r.setProperty("width",`${a*t.width}px`)}updateBar(){let e=this.getBarColors(),t="linear-gradient(to right, ",a=0;e.forEach(n=>{n[1]<a||(t=t+`${n[0]} ${a}%, ${n[0]} ${n[1]}%,`,a=n[1])}),t=t.slice(0,t.length-1)+")";let{style:r}=ae(this.shadowRoot,"#range");r.setProperty("--media-range-track-progress-internal",t)}getBarColors(){let e=this.range,t=e.value-e.min,a=e.max-e.min,r=t/a*100,n=0;return e.value>e.min&&e.value<e.max&&(n=Xo(this,Zt)*(.5-r/100)/e.offsetWidth*100),[["var(--media-range-bar-color, #fff)",r+n],["transparent",100]]}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};Zt=new WeakMap;h("media-chrome-range",qt);var ut=qt;var $r=d.createElement("template");$r.innerHTML=`
369
+ `;var Bi=class extends l.HTMLElement{constructor(){super(),Ml(this,Ni,void 0),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Jn.content.cloneNode(!0)),this.container=this.shadowRoot.querySelector("#container"),this.range=this.shadowRoot.querySelector("#range"),this.range.addEventListener("input",this.updateBar.bind(this)),kl(this,Ni,parseInt(getComputedStyle(this).getPropertyValue("--media-range-thumb-width")||"10",10))}static get observedAttributes(){return["disabled","aria-disabled",p.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n;if(e===p.MEDIA_CONTROLLER){if(t){let s=u.getElementById(t);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=u.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}else(e==="disabled"||e==="aria-disabled"&&t!==a)&&(a==null?this.range.removeAttribute(e):this.range.setAttribute(e,a))}connectedCallback(){var e;let t=this.getAttribute(p.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.associateElement)==null||e.call(a,this)}this.updateBar()}disconnectedCallback(){var e;let t=this.getAttribute(p.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.unassociateElement)==null||e.call(a,this)}}updatePointerBar(e){let t=this.range.getBoundingClientRect(),a=(e.clientX-t.left)/t.width;a=Math.max(0,Math.min(1,a));let{style:r}=ce(this.shadowRoot,"#pointer");r.setProperty("width",`${a*t.width}px`)}updateBar(){let e=this.getBarColors(),t="linear-gradient(to right, ",a=0;e.forEach(n=>{n[1]<a||(t=t+`${n[0]} ${a}%, ${n[0]} ${n[1]}%,`,a=n[1])}),t=t.slice(0,t.length-1)+")";let{style:r}=ce(this.shadowRoot,"#range");r.setProperty("--media-range-track-progress-internal",t)}getBarColors(){let e=this.range,t=e.value-e.min,a=e.max-e.min,r=t/a*100,n=0;return e.value>e.min&&e.value<e.max&&(n=Tl(this,Ni)*(.5-r/100)/e.offsetWidth*100),[["var(--media-range-bar-color, #fff)",r+n],["transparent",100]]}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};Ni=new WeakMap;l.customElements.get("media-chrome-range")||l.customElements.define("media-chrome-range",Bi);var Zt=Bi;var jn=u.createElement("template");jn.innerHTML=`
366
370
  <style>
367
371
  :host {
368
372
 
@@ -381,7 +385,7 @@
381
385
  </style>
382
386
 
383
387
  <slot></slot>
384
- `;var Xi=class extends u.HTMLElement{static get observedAttributes(){return[A.MEDIA_CONTROLLER]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild($r.content.cloneNode(!0))}attributeChangedCallback(e,t,a){var r,n;if(e===A.MEDIA_CONTROLLER){if(t){let s=d.getElementById(t);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=d.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}}connectedCallback(){var e;let t=this.getAttribute(A.MEDIA_CONTROLLER);if(t){let a=d.getElementById(t);(e=a==null?void 0:a.associateElement)==null||e.call(a,this)}}disconnectedCallback(){var e;let t=this.getAttribute(A.MEDIA_CONTROLLER);if(t){let a=d.getElementById(t);(e=a==null?void 0:a.unassociateElement)==null||e.call(a,this)}}};h("media-control-bar",Xi);var Vr=d.createElement("template");Vr.innerHTML=`
388
+ `;var Ya=class extends l.HTMLElement{static get observedAttributes(){return[p.MEDIA_CONTROLLER]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(jn.content.cloneNode(!0))}attributeChangedCallback(e,t,a){var r,n;if(e===p.MEDIA_CONTROLLER){if(t){let s=u.getElementById(t);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=u.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}}connectedCallback(){var e;let t=this.getAttribute(p.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.associateElement)==null||e.call(a,this)}}disconnectedCallback(){var e;let t=this.getAttribute(p.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.unassociateElement)==null||e.call(a,this)}}};l.customElements.get("media-control-bar")||l.customElements.define("media-control-bar",Ya);var es=u.createElement("template");es.innerHTML=`
385
389
  <style>
386
390
  :host {
387
391
  display: inline-flex;
@@ -416,11 +420,11 @@
416
420
  <span id="container">
417
421
  <slot></slot>
418
422
  </span>
419
- `;var Qt=class extends u.HTMLElement{static get observedAttributes(){return[A.MEDIA_CONTROLLER]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Vr.content.cloneNode(!0)),this.container=this.shadowRoot.querySelector("#container")}attributeChangedCallback(e,t,a){var r,n;if(e===A.MEDIA_CONTROLLER){if(t){let s=d.getElementById(t);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=d.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}}connectedCallback(){var e;let t=this.getAttribute(A.MEDIA_CONTROLLER);if(t){let a=d.getElementById(t);(e=a==null?void 0:a.associateElement)==null||e.call(a,this)}}disconnectedCallback(){var e;let t=this.getAttribute(A.MEDIA_CONTROLLER);if(t){let a=d.getElementById(t);(e=a==null?void 0:a.unassociateElement)==null||e.call(a,this)}}};h("media-text-display",Qt);var ce=Qt;var ji=class extends ce{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME]}attributeChangedCallback(e,t,a){e===o.MEDIA_CURRENT_TIME&&(this.container.innerHTML=j(a)),super.attributeChangedCallback(e,t,a)}};h("media-current-time-display",ji);var Ji=class extends ce{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_DURATION]}attributeChangedCallback(e,t,a){e===o.MEDIA_DURATION&&(this.container.innerHTML=j(a)),super.attributeChangedCallback(e,t,a)}};h("media-duration-display",Ji);var es="&nbsp;/&nbsp;",ts=(i,{timesSep:e=es}={})=>{var t,a,r;let n=i.getAttribute("remaining")!=null,s=i.getAttribute("show-duration")!=null,l=(t=i.mediaCurrentTime)!=null?t:0,c=(r=(a=i.mediaDuration)!=null?a:i.mediaSeekableEnd)!=null?r:0,m=n?j(0-(c-l)):j(l);return s?`${m}${e}${j(c)}`:m},is="video not loaded, unknown time.",as=i=>{let e=i.mediaCurrentTime,t=i.mediaDuration||i.mediaSeekableEnd;if(e==null||t==null){i.setAttribute("aria-valuetext",is);return}let a=i.hasAttribute("remaining"),r=i.hasAttribute("show-duration"),n=a?ye(0-(t-e)):ye(e);if(!r){i.setAttribute("aria-valuetext",n);return}let s=ye(t),l=`${n} of ${s}`;i.setAttribute("aria-valuetext",l)},ea=class extends ce{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,o.MEDIA_DURATION,o.MEDIA_SEEKABLE,"remaining","show-duration","disabled"]}constructor(){super()}connectedCallback(){this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","progressbar"),this.setAttribute("aria-label",B.PLAYBACK_TIME()),super.connectedCallback()}disconnectedCallback(){this.disable()}attributeChangedCallback(e,t,a){if([o.MEDIA_CURRENT_TIME,o.MEDIA_DURATION,o.MEDIA_SEEKABLE,"remaining","show-duration"].includes(e)){let r=ts(this);as(this),this.container.innerHTML=r}else e==="disabled"&&a!==t&&(a==null?this.enable():this.disable());super.attributeChangedCallback(e,t,a)}enable(){this.setAttribute("tabindex",0)}disable(){this.removeAttribute("tabindex")}get mediaDuration(){let e=this.getAttribute(o.MEDIA_DURATION);return e!=null?+e:void 0}get mediaCurrentTime(){let e=this.getAttribute(o.MEDIA_CURRENT_TIME);return e!=null?+e:void 0}get mediaSeekable(){let e=this.getAttribute(o.MEDIA_SEEKABLE);if(!!e)return e.split(":").map(t=>+t)}get mediaSeekableEnd(){var e;let[,t]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaSeekableStart(){var e;let[t]=(e=this.mediaSeekable)!=null?e:[];return t}};h("media-time-display",ea);var rs=`<svg aria-hidden="true" viewBox="0 0 26 24">
423
+ `;var Hi=class extends l.HTMLElement{static get observedAttributes(){return[p.MEDIA_CONTROLLER]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(es.content.cloneNode(!0)),this.container=this.shadowRoot.querySelector("#container")}attributeChangedCallback(e,t,a){var r,n;if(e===p.MEDIA_CONTROLLER){if(t){let s=u.getElementById(t);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=u.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}}connectedCallback(){var e;let t=this.getAttribute(p.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.associateElement)==null||e.call(a,this)}}disconnectedCallback(){var e;let t=this.getAttribute(p.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.unassociateElement)==null||e.call(a,this)}}};l.customElements.get("media-text-display")||l.customElements.define("media-text-display",Hi);var Te=Hi;var Ga=class extends Te{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME]}constructor(){super(),this.container.innerHTML=X(0)}attributeChangedCallback(e,t,a){e===o.MEDIA_CURRENT_TIME&&(this.container.innerHTML=X(a)),super.attributeChangedCallback(e,t,a)}};l.customElements.get("media-current-time-display")||l.customElements.define("media-current-time-display",Ga);var Za=class extends Te{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_DURATION]}constructor(){super(),this.container.innerHTML=X(0)}attributeChangedCallback(e,t,a){e===o.MEDIA_DURATION&&(this.container.innerHTML=X(a)),super.attributeChangedCallback(e,t,a)}};l.customElements.get("media-duration-display")||l.customElements.define("media-duration-display",Za);var Sl="&nbsp;/&nbsp;",ts=(i,{timesSep:e=Sl}={})=>{var t,a,r;let n=i.getAttribute("remaining")!=null,s=i.getAttribute("show-duration")!=null,d=(t=i.mediaCurrentTime)!=null?t:0,c=(r=(a=i.mediaDuration)!=null?a:i.mediaSeekableEnd)!=null?r:0,m=n?X(0-(c-d)):X(d);return s?`${m}${e}${X(c)}`:m},Cl="video not loaded, unknown time.",Ll=i=>{let e=i.mediaCurrentTime,t=i.mediaDuration||i.mediaSeekableEnd;if(e==null||t==null){i.setAttribute("aria-valuetext",Cl);return}let a=i.hasAttribute("remaining"),r=i.hasAttribute("show-duration"),n=a?We(0-(t-e)):We(e);if(!r){i.setAttribute("aria-valuetext",n);return}let s=We(t),d=`${n} of ${s}`;i.setAttribute("aria-valuetext",d)},qa=class extends Te{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,o.MEDIA_DURATION,o.MEDIA_SEEKABLE,"remaining","show-duration","disabled"]}constructor(){super(),this.container.innerHTML=ts(this)}connectedCallback(){this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","progressbar"),this.setAttribute("aria-label",$.PLAYBACK_TIME()),super.connectedCallback()}disconnectedCallback(){this.disable()}attributeChangedCallback(e,t,a){if([o.MEDIA_CURRENT_TIME,o.MEDIA_DURATION,o.MEDIA_SEEKABLE,"remaining","show-duration"].includes(e)){let r=ts(this);Ll(this),this.container.innerHTML=r}else e==="disabled"&&a!==t&&(a==null?this.enable():this.disable());super.attributeChangedCallback(e,t,a)}enable(){this.setAttribute("tabindex",0)}disable(){this.removeAttribute("tabindex")}get mediaDuration(){let e=this.getAttribute(o.MEDIA_DURATION);return e!=null?+e:void 0}get mediaCurrentTime(){let e=this.getAttribute(o.MEDIA_CURRENT_TIME);return e!=null?+e:void 0}get mediaSeekable(){let e=this.getAttribute(o.MEDIA_SEEKABLE);if(!!e)return e.split(":").map(t=>+t)}get mediaSeekableEnd(){var e;let[,t]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaSeekableStart(){var e;let[t]=(e=this.mediaSeekable)!=null?e:[];return t}};l.customElements.get("media-time-display")||l.customElements.define("media-time-display",qa);var wl=`<svg aria-hidden="true" viewBox="0 0 26 24">
420
424
  <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"/>
421
- </svg>`,ns=`<svg aria-hidden="true" viewBox="0 0 26 24">
425
+ </svg>`,xl=`<svg aria-hidden="true" viewBox="0 0 26 24">
422
426
  <path d="M17.73 14.09a1.4 1.4 0 0 1-1 .37 1.579 1.579 0 0 1-1.27-.58A3 3 0 0 1 15 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34A2.89 2.89 0 0 0 19 9.07a3 3 0 0 0-2.14-.78 3.14 3.14 0 0 0-2.42 1 3.91 3.91 0 0 0-.93 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.17 3.17 0 0 0 1.07-1.74l-1.4-.45c-.083.43-.3.822-.62 1.12Zm-7.22 0a1.43 1.43 0 0 1-1 .37 1.58 1.58 0 0 1-1.27-.58A3 3 0 0 1 7.76 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34a2.81 2.81 0 0 0-.74-1.32 2.94 2.94 0 0 0-2.13-.78 3.18 3.18 0 0 0-2.43 1 4 4 0 0 0-.92 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.23 3.23 0 0 0 1.07-1.74l-1.4-.45a2.06 2.06 0 0 1-.6 1.07Zm12.32-8.41a2.59 2.59 0 0 0-2.3-2.51C18.72 3.05 15.86 3 13 3c-2.86 0-5.72.05-7.53.17a2.59 2.59 0 0 0-2.3 2.51c-.23 4.207-.23 8.423 0 12.63a2.57 2.57 0 0 0 2.3 2.5c1.81.13 4.67.19 7.53.19 2.86 0 5.72-.06 7.53-.19a2.57 2.57 0 0 0 2.3-2.5c.23-4.207.23-8.423 0-12.63Zm-1.49 12.53a1.11 1.11 0 0 1-.91 1.11c-1.67.11-4.45.18-7.43.18-2.98 0-5.76-.07-7.43-.18a1.11 1.11 0 0 1-.91-1.11c-.21-4.14-.21-8.29 0-12.43a1.11 1.11 0 0 1 .91-1.11C7.24 4.56 10 4.49 13 4.49s5.76.07 7.43.18a1.11 1.11 0 0 1 .91 1.11c.21 4.14.21 8.29 0 12.43Z"/>
423
- </svg>`,Wr=d.createElement("template");Wr.innerHTML=`
427
+ </svg>`,as=u.createElement("template");as.innerHTML=`
424
428
  <style>
425
429
  :host([aria-checked="true"]) slot:not([name=on]) > *,
426
430
  :host([aria-checked="true"]) ::slotted(:not([slot=on])) {
@@ -434,15 +438,15 @@
434
438
  }
435
439
  </style>
436
440
 
437
- <slot name="on">${rs}</slot>
438
- <slot name="off">${ns}</slot>
439
- `;var Hr=i=>{i.setAttribute("aria-checked",Ki(i))},ta=class extends x{static get observedAttributes(){return[...super.observedAttributes,"no-subtitles-fallback","default-showing",o.MEDIA_CAPTIONS_LIST,o.MEDIA_CAPTIONS_SHOWING,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}constructor(e={}){super({slotTemplate:Wr,...e}),this._captionsReady=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",B.CLOSED_CAPTIONS()),Hr(this)}attributeChangedCallback(e,t,a){if([o.MEDIA_CAPTIONS_SHOWING,o.MEDIA_SUBTITLES_SHOWING].includes(e)&&Hr(this),this.hasAttribute("default-showing")&&this.getAttribute("aria-checked")!=="true"){let r=!this.hasAttribute("no-subtitles-fallback");if((r?[o.MEDIA_CAPTIONS_LIST,o.MEDIA_SUBTITLES_LIST]:[o.MEDIA_CAPTIONS_LIST]).includes(e)){let s=!!this.getAttribute(o.MEDIA_CAPTIONS_LIST)||!!(r&&this.getAttribute(o.MEDIA_SUBTITLES_LIST));this._captionsReady!==s&&(this._captionsReady=s,this._captionsReady&&this.handleClick())}}super.attributeChangedCallback(e,t,a)}handleClick(){Ht(this)}};h("media-captions-button",ta);var ia="30",os=`<svg aria-hidden="true" viewBox="0 0 20 24"><defs><style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style></defs><text class="text value" transform="translate(8.9 19.87)">${ia}</text><path d="M10 6V3l5.61 4L10 10.94V8a5.54 5.54 0 0 0-1.9 10.48v2.12A7.5 7.5 0 0 1 10 6Z"/></svg>`,Yr=d.createElement("template");Yr.innerHTML=`
440
- <slot name="forward">${os}</slot>
441
- `;var ss=0,Fr=i=>{let e=Math.abs(+i.getAttribute("seek-offset")),t=C.SEEK_FORWARD_N_SECS({seekOffset:e});i.setAttribute("aria-label",t)},Kr=i=>{let e=Bt(i,"forward"),t=i.getAttribute("seek-offset");Nt(e,t)},aa=class extends x{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,"seek-offset"]}constructor(e={}){super({slotTemplate:Yr,...e})}connectedCallback(){this.hasAttribute("seek-offset")||this.setAttribute("seek-offset",ia),Fr(this),Kr(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e==="seek-offset"&&(a==null&&this.setAttribute("seek-offset",ia),Kr(this),Fr(this)),super.attributeChangedCallback(e,t,a)}handleClick(){let e=this.getAttribute(o.MEDIA_CURRENT_TIME),t=+this.getAttribute("seek-offset"),r=(e&&!Number.isNaN(+e)?+e:ss)+t,n=new u.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)}};h("media-seek-forward-button",aa);var ls=`<svg aria-hidden="true" viewBox="0 0 26 24">
441
+ <slot name="on">${wl}</slot>
442
+ <slot name="off">${xl}</slot>
443
+ `;var is=i=>{i.setAttribute("aria-checked",Ht(i))},Qa=class extends C{static get observedAttributes(){return[...super.observedAttributes,"no-subtitles-fallback","default-showing",o.MEDIA_CAPTIONS_LIST,o.MEDIA_CAPTIONS_SHOWING,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}constructor(e={}){super({slotTemplate:as,...e}),this._captionsReady=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",$.CLOSED_CAPTIONS()),is(this)}attributeChangedCallback(e,t,a){if([o.MEDIA_CAPTIONS_SHOWING,o.MEDIA_SUBTITLES_SHOWING].includes(e)&&is(this),this.hasAttribute("default-showing")&&this.getAttribute("aria-checked")!=="true"){let r=!this.hasAttribute("no-subtitles-fallback");if((r?[o.MEDIA_CAPTIONS_LIST,o.MEDIA_SUBTITLES_LIST]:[o.MEDIA_CAPTIONS_LIST]).includes(e)){let s=!!this.getAttribute(o.MEDIA_CAPTIONS_LIST)||!!(r&&this.getAttribute(o.MEDIA_SUBTITLES_LIST));this._captionsReady!==s&&(this._captionsReady=s,this._captionsReady&&this.handleClick())}}super.attributeChangedCallback(e,t,a)}handleClick(){ye(this)}};l.customElements.get("media-captions-button")||l.customElements.define("media-captions-button",Qa);var za="30",Dl=`<svg aria-hidden="true" viewBox="0 0 20 24"><defs><style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style></defs><text class="text value" transform="translate(8.9 19.87)">${za}</text><path d="M10 6V3l5.61 4L10 10.94V8a5.54 5.54 0 0 0-1.9 10.48v2.12A7.5 7.5 0 0 1 10 6Z"/></svg>`,ss=u.createElement("template");ss.innerHTML=`
444
+ <slot name="forward">${Dl}</slot>
445
+ `;var Rl=0,rs=i=>{let e=Math.abs(+i.getAttribute("seek-offset")),t=w.SEEK_FORWARD_N_SECS({seekOffset:e});i.setAttribute("aria-label",t)},ns=i=>{let e=Li(i,"forward"),t=i.getAttribute("seek-offset");Ci(e,t)},Xa=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,"seek-offset"]}constructor(e={}){super({slotTemplate:ss,...e})}connectedCallback(){this.hasAttribute("seek-offset")||this.setAttribute("seek-offset",za),rs(this),ns(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e==="seek-offset"&&(a==null&&this.setAttribute("seek-offset",za),ns(this),rs(this)),super.attributeChangedCallback(e,t,a)}handleClick(){let e=this.getAttribute(o.MEDIA_CURRENT_TIME),t=+this.getAttribute("seek-offset"),r=(e&&!Number.isNaN(+e)?+e:Rl)+t,n=new l.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)}};l.customElements.get("media-seek-forward-button")||l.customElements.define("media-seek-forward-button",Xa);var Ol=`<svg aria-hidden="true" viewBox="0 0 26 24">
442
446
  <path d="M16 3v2.5h3.5V9H22V3h-6ZM4 9h2.5V5.5H10V3H4v6Zm15.5 9.5H16V21h6v-6h-2.5v3.5ZM6.5 15H4v6h6v-2.5H6.5V15Z"/>
443
- </svg>`,ds=`<svg aria-hidden="true" viewBox="0 0 26 24">
447
+ </svg>`,Pl=`<svg aria-hidden="true" viewBox="0 0 26 24">
444
448
  <path d="M18.5 6.5V3H16v6h6V6.5h-3.5ZM16 21h2.5v-3.5H22V15h-6v6ZM4 17.5h3.5V21H10v-6H4v2.5Zm3.5-11H4V9h6V3H7.5v3.5Z"/>
445
- </svg>`,Zr=d.createElement("template");Zr.innerHTML=`
449
+ </svg>`,ls=u.createElement("template");ls.innerHTML=`
446
450
  <style>
447
451
  :host([${o.MEDIA_IS_FULLSCREEN}]) slot:not([name=exit]) > *,
448
452
  :host([${o.MEDIA_IS_FULLSCREEN}]) ::slotted(:not([slot=exit])) {
@@ -456,15 +460,44 @@
456
460
  }
457
461
  </style>
458
462
 
459
- <slot name="enter">${ls}</slot>
460
- <slot name="exit">${ds}</slot>
461
- `;var Gr=i=>{let t=i.getAttribute(o.MEDIA_IS_FULLSCREEN)!=null?C.EXIT_FULLSCREEN():C.ENTER_FULLSCREEN();i.setAttribute("aria-label",t)},ra=class extends x{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_FULLSCREEN,o.MEDIA_FULLSCREEN_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Zr,...e})}connectedCallback(){Gr(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_IS_FULLSCREEN&&Gr(this),super.attributeChangedCallback(e,t,a)}handleClick(){let e=this.getAttribute(o.MEDIA_IS_FULLSCREEN)!=null?p.MEDIA_EXIT_FULLSCREEN_REQUEST:p.MEDIA_ENTER_FULLSCREEN_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}};h("media-fullscreen-button",ra);var us=`<svg aria-hidden="true" viewBox="0 0 24 24">
463
+ <slot name="enter">${Ol}</slot>
464
+ <slot name="exit">${Pl}</slot>
465
+ `;var os=i=>{let t=i.getAttribute(o.MEDIA_IS_FULLSCREEN)!=null?w.EXIT_FULLSCREEN():w.ENTER_FULLSCREEN();i.setAttribute("aria-label",t)},Ja=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_FULLSCREEN,o.MEDIA_FULLSCREEN_UNAVAILABLE]}constructor(e={}){super({slotTemplate:ls,...e})}connectedCallback(){os(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_IS_FULLSCREEN&&os(this),super.attributeChangedCallback(e,t,a)}handleClick(){let e=this.getAttribute(o.MEDIA_IS_FULLSCREEN)!=null?h.MEDIA_EXIT_FULLSCREEN_REQUEST:h.MEDIA_ENTER_FULLSCREEN_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};l.customElements.get("media-fullscreen-button")||l.customElements.define("media-fullscreen-button",Ja);var{MEDIA_TIME_IS_LIVE:qt,MEDIA_PAUSED:ds}=o,{MEDIA_SEEK_TO_LIVE_REQUEST:Ul,MEDIA_PLAY_REQUEST:Nl}=h,Bl='<svg viewBox="0 0 8 16"><circle cx="4" cy="8" r="2"></circle></svg>',cs=u.createElement("template");cs.innerHTML=`
466
+ <style>
467
+
468
+ slot[name=indicator] > *,
469
+ :host ::slotted([slot=indicator]) {
470
+ /* Override styles for icon-only buttons */
471
+ min-width: auto;
472
+ fill: var(--media-live-button-icon-color, rgb(140, 140, 140));
473
+ color: var(--media-live-button-icon-color, rgb(140, 140, 140));
474
+ }
475
+
476
+ :host([${qt}]) slot[name=indicator] > *,
477
+ :host([${qt}]) ::slotted([slot=indicator]) {
478
+ fill: var(--media-live-indicator-color, rgb(255, 0, 0));
479
+ color: var(--media-live-indicator-color, rgb(255, 0, 0));
480
+ }
481
+
482
+ :host([${qt}]) {
483
+ cursor: not-allowed;
484
+ }
485
+
486
+ </style>
487
+
488
+ <slot name="indicator">${Bl}</slot>
489
+ <!--
490
+ A new line between spacer and text creates inconsistent spacing
491
+ between slotted items and default slots.
492
+ -->
493
+ <slot name="spacer">&nbsp;</slot><slot name="text">LIVE</slot>
494
+ `;var ja=class extends C{static get observedAttributes(){return[...super.observedAttributes,ds,qt]}constructor(e={}){super({slotTemplate:cs,...e}),this.setAttribute("aria-label","Seek to Live")}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a)}handleClick(){this.getAttribute(qt)===null&&(this.dispatchEvent(new l.CustomEvent(Ul,{composed:!0,bubbles:!0})),this.getAttribute(ds)!==null&&this.dispatchEvent(new l.CustomEvent(Nl,{composed:!0,bubbles:!0})))}};l.customElements.get("media-live-button")||l.customElements.define("media-live-button",ja);var Hl=`<svg aria-hidden="true" viewBox="0 0 24 24">
462
495
  <path d="M16.5 12A4.5 4.5 0 0 0 14 8v2.18l2.45 2.45a4.22 4.22 0 0 0 .05-.63Zm2.5 0a6.84 6.84 0 0 1-.54 2.64L20 16.15A8.8 8.8 0 0 0 21 12a9 9 0 0 0-7-8.77v2.06A7 7 0 0 1 19 12ZM4.27 3 3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25A6.92 6.92 0 0 1 14 18.7v2.06A9 9 0 0 0 17.69 19l2 2.05L21 19.73l-9-9L4.27 3ZM12 4 9.91 6.09 12 8.18V4Z"/>
463
- </svg>`,qr=`<svg aria-hidden="true" viewBox="0 0 24 24">
496
+ </svg>`,us=`<svg aria-hidden="true" viewBox="0 0 24 24">
464
497
  <path d="M3 9v6h4l5 5V4L7 9H3Zm13.5 3A4.5 4.5 0 0 0 14 8v8a4.47 4.47 0 0 0 2.5-4Z"/>
465
- </svg>`,cs=`<svg aria-hidden="true" viewBox="0 0 24 24">
498
+ </svg>`,$l=`<svg aria-hidden="true" viewBox="0 0 24 24">
466
499
  <path d="M3 9v6h4l5 5V4L7 9H3Zm13.5 3A4.5 4.5 0 0 0 14 8v8a4.47 4.47 0 0 0 2.5-4ZM14 3.23v2.06a7 7 0 0 1 0 13.42v2.06a9 9 0 0 0 0-17.54Z"/>
467
- </svg>`,zr=d.createElement("template");zr.innerHTML=`
500
+ </svg>`,hs=u.createElement("template");hs.innerHTML=`
468
501
  <style>
469
502
 
470
503
  :host(:not([${o.MEDIA_VOLUME_LEVEL}])) slot:not([name=high]) > *,
@@ -490,13 +523,13 @@
490
523
  }
491
524
  </style>
492
525
 
493
- <slot name="off">${us}</slot>
494
- <slot name="low">${qr}</slot>
495
- <slot name="medium">${qr}</slot>
496
- <slot name="high">${cs}</slot>
497
- `;var Qr=i=>{let t=i.getAttribute(o.MEDIA_VOLUME_LEVEL)==="off"?C.UNMUTE():C.MUTE();i.setAttribute("aria-label",t)},na=class extends x{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME_LEVEL]}constructor(e={}){super({slotTemplate:zr,...e})}connectedCallback(){Qr(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_VOLUME_LEVEL&&Qr(this),super.attributeChangedCallback(e,t,a)}handleClick(){let e=this.getAttribute(o.MEDIA_VOLUME_LEVEL)==="off"?p.MEDIA_UNMUTE_REQUEST:p.MEDIA_MUTE_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}};h("media-mute-button",na);var Xr=`<svg aria-hidden="true" viewBox="0 0 28 24">
526
+ <slot name="off">${Hl}</slot>
527
+ <slot name="low">${us}</slot>
528
+ <slot name="medium">${us}</slot>
529
+ <slot name="high">${$l}</slot>
530
+ `;var ms=i=>{let t=i.getAttribute(o.MEDIA_VOLUME_LEVEL)==="off"?w.UNMUTE():w.MUTE();i.setAttribute("aria-label",t)},er=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME_LEVEL]}constructor(e={}){super({slotTemplate:hs,...e})}connectedCallback(){ms(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_VOLUME_LEVEL&&ms(this),super.attributeChangedCallback(e,t,a)}handleClick(){let e=this.getAttribute(o.MEDIA_VOLUME_LEVEL)==="off"?h.MEDIA_UNMUTE_REQUEST:h.MEDIA_MUTE_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};l.customElements.get("media-mute-button")||l.customElements.define("media-mute-button",er);var ps=`<svg aria-hidden="true" viewBox="0 0 28 24">
498
531
  <path d="M24 3H4a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h20a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1Zm-1 16H5V5h18v14Zm-3-8h-7v5h7v-5Z"/>
499
- </svg>`,Jr=d.createElement("template");Jr.innerHTML=`
532
+ </svg>`,Es=u.createElement("template");Es.innerHTML=`
500
533
  <style>
501
534
  :host([${o.MEDIA_IS_PIP}]) slot:not([name=exit]) > *,
502
535
  :host([${o.MEDIA_IS_PIP}]) ::slotted(:not([slot=exit])) {
@@ -510,13 +543,13 @@
510
543
  }
511
544
  </style>
512
545
 
513
- <slot name="enter">${Xr}</slot>
514
- <slot name="exit">${Xr}</slot>
515
- `;var jr=i=>{let t=i.getAttribute(o.MEDIA_IS_PIP)!=null?C.EXIT_PIP():C.ENTER_PIP();i.setAttribute("aria-label",t)},oa=class extends x{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_PIP,o.MEDIA_PIP_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Jr,...e})}connectedCallback(){jr(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_IS_PIP&&jr(this),super.attributeChangedCallback(e,t,a)}handleClick(){let e=this.getAttribute(o.MEDIA_IS_PIP)!=null?p.MEDIA_EXIT_PIP_REQUEST:p.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}};h("media-pip-button",oa);var ms=`<svg aria-hidden="true" viewBox="0 0 24 24">
546
+ <slot name="enter">${ps}</slot>
547
+ <slot name="exit">${ps}</slot>
548
+ `;var bs=i=>{let t=i.getAttribute(o.MEDIA_IS_PIP)!=null?w.EXIT_PIP():w.ENTER_PIP();i.setAttribute("aria-label",t)},tr=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_PIP,o.MEDIA_PIP_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Es,...e})}connectedCallback(){bs(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_IS_PIP&&bs(this),super.attributeChangedCallback(e,t,a)}handleClick(){let e=this.getAttribute(o.MEDIA_IS_PIP)!=null?h.MEDIA_EXIT_PIP_REQUEST:h.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};l.customElements.get("media-pip-button")||l.customElements.define("media-pip-button",tr);var Wl=`<svg aria-hidden="true" viewBox="0 0 24 24">
516
549
  <path d="m6 21 15-9L6 3v18Z"/>
517
- </svg>`,hs=`<svg aria-hidden="true" viewBox="0 0 24 24">
550
+ </svg>`,Vl=`<svg aria-hidden="true" viewBox="0 0 24 24">
518
551
  <path d="M6 20h4V4H6v16Zm8-16v16h4V4h-4Z"/>
519
- </svg>`,tn=d.createElement("template");tn.innerHTML=`
552
+ </svg>`,vs=u.createElement("template");vs.innerHTML=`
520
553
  <style>
521
554
  :host([${o.MEDIA_PAUSED}]) slot[name=pause] > *,
522
555
  :host([${o.MEDIA_PAUSED}]) ::slotted([slot=pause]) {
@@ -529,11 +562,11 @@
529
562
  }
530
563
  </style>
531
564
 
532
- <slot name="play">${ms}</slot>
533
- <slot name="pause">${hs}</slot>
534
- `;var en=i=>{let t=i.getAttribute(o.MEDIA_PAUSED)!=null?C.PLAY():C.PAUSE();i.setAttribute("aria-label",t)},sa=class extends x{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PAUSED]}constructor(e={}){super({slotTemplate:tn,...e})}connectedCallback(){en(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_PAUSED&&en(this),super.attributeChangedCallback(e,t,a)}handleClick(){let e=this.getAttribute(o.MEDIA_PAUSED)!=null?p.MEDIA_PLAY_REQUEST:p.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}};h("media-play-button",sa);var an=[1,1.25,1.5,1.75,2],zt=1,rn=d.createElement("template");rn.innerHTML=`
565
+ <slot name="play">${Wl}</slot>
566
+ <slot name="pause">${Vl}</slot>
567
+ `;var fs=i=>{let t=i.getAttribute(o.MEDIA_PAUSED)!=null?w.PLAY():w.PAUSE();i.setAttribute("aria-label",t)},ir=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PAUSED]}constructor(e={}){super({slotTemplate:vs,...e})}connectedCallback(){fs(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_PAUSED&&fs(this),super.attributeChangedCallback(e,t,a)}handleClick(){let e=this.getAttribute(o.MEDIA_PAUSED)!=null?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};l.customElements.get("media-play-button")||l.customElements.define("media-play-button",ir);var gs=[1,1.25,1.5,1.75,2],$i=1,As=u.createElement("template");As.innerHTML=`
535
568
  <span id="container"></span>
536
- `;var la=class extends x{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,"rates"]}constructor(e={}){super({slotTemplate:rn,...e}),this._rates=an,this.container=this.shadowRoot.querySelector("#container"),this.container.innerHTML=`${zt}x`}attributeChangedCallback(e,t,a){if(e==="rates"){let r=(a!=null?a:"").trim().split(/\s*,?\s+/).map(n=>Number(n)).filter(n=>!Number.isNaN(n)).sort((n,s)=>n-s);this._rates=r.length?r:an;return}if(e===o.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,n=Number.isNaN(r)?zt:r;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",B.PLAYBACK_RATE({playbackRate:n}));return}super.attributeChangedCallback(e,t,a)}handleClick(){var e,t;let a=+this.getAttribute(o.MEDIA_PLAYBACK_RATE)||zt,r=(t=(e=this._rates.find(s=>s>a))!=null?e:this._rates[0])!=null?t:zt,n=new u.CustomEvent(p.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)}};h("media-playback-rate-button",la);var nn=d.createElement("template");nn.innerHTML=`
569
+ `;var ar=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,"rates"]}constructor(e={}){super({slotTemplate:As,...e}),this._rates=gs,this.container=this.shadowRoot.querySelector("#container"),this.container.innerHTML=`${$i}x`}attributeChangedCallback(e,t,a){if(e==="rates"){let r=(a!=null?a:"").trim().split(/\s*,?\s+/).map(n=>Number(n)).filter(n=>!Number.isNaN(n)).sort((n,s)=>n-s);this._rates=r.length?r:gs;return}if(e===o.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,n=Number.isNaN(r)?$i:r;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",$.PLAYBACK_RATE({playbackRate:n}));return}super.attributeChangedCallback(e,t,a)}handleClick(){var e,t;let a=+this.getAttribute(o.MEDIA_PLAYBACK_RATE)||$i,r=(t=(e=this._rates.find(s=>s>a))!=null?e:this._rates[0])!=null?t:$i,n=new l.CustomEvent(h.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)}};l.customElements.get("media-playback-rate-button")||l.customElements.define("media-playback-rate-button",ar);var _s=u.createElement("template");_s.innerHTML=`
537
570
  <style>
538
571
  :host {
539
572
  pointer-events: none;
@@ -552,14 +585,10 @@
552
585
  object-fit: var(--media-object-fit, contain);
553
586
  object-position: var(--media-object-position, center);
554
587
  }
555
-
556
- :host([${o.MEDIA_HAS_PLAYED}]) img {
557
- display: none;
558
- }
559
588
  </style>
560
589
 
561
590
  <img aria-hidden="true" id="image"/>
562
- `;var ps=i=>{i.style.removeProperty("background-image")},bs=(i,e)=>{i.style["background-image"]=`url('${e}')`},da=class extends u.HTMLElement{static get observedAttributes(){return[o.MEDIA_HAS_PLAYED,"placeholder-src","src"]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(nn.content.cloneNode(!0)),this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,t,a){e==="src"&&(a==null?this.image.removeAttribute("src"):this.image.setAttribute("src",a)),e==="placeholder-src"&&(a==null?ps(this.image):bs(this.image,a))}};h("media-poster-image",da);var ba=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},O=(i,e,t)=>(ba(i,e,"read from private field"),t?t.call(i):e.get(i)),Y=(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)},me=(i,e,t,a)=>(ba(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ct=(i,e,t)=>(ba(i,e,"access private method"),t),mt,Xt,ht,ti,ii,jt,ca,Jt,Fe,pt,ma,ai,ni,ei,ha,pa,on,Es="video not loaded, unknown time.",ua=i=>{let e=i.range,t=ye(+e.value),a=ye(+e.max),r=t&&a?`${t} of ${a}`:Es;e.setAttribute("aria-valuetext",r)},sn=d.createElement("template");sn.innerHTML=`
591
+ `;var Fl=i=>{i.style.removeProperty("background-image")},Kl=(i,e)=>{i.style["background-image"]=`url('${e}')`},rr=class extends l.HTMLElement{static get observedAttributes(){return["placeholder-src","src"]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(_s.content.cloneNode(!0)),this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,t,a){e==="src"&&(a==null?this.image.removeAttribute("src"):this.image.setAttribute("src",a)),e==="placeholder-src"&&(a==null?Fl(this.image):Kl(this.image,a))}};l.customElements.get("media-poster-image")||l.customElements.define("media-poster-image",rr);var cr=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},N=(i,e,t)=>(cr(i,e,"read from private field"),t?t.call(i):e.get(i)),Z=(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)},Me=(i,e,t,a)=>(cr(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Qt=(i,e,t)=>(cr(i,e,"access private method"),t),zt,Wi,Xt,Yi,Gi,Vi,sr,Fi,ft,Jt,or,Zi,Qi,Ki,lr,dr,ys,Yl="video not loaded, unknown time.",nr=i=>{let e=i.range,t=We(+e.value),a=We(+e.max),r=t&&a?`${t} of ${a}`:Yl;e.setAttribute("aria-valuetext",r)},Is=u.createElement("template");Is.innerHTML=`
563
592
  <style>
564
593
  :host {
565
594
  --media-preview-background-color: rgba(20,20,30, .5);
@@ -663,9 +692,9 @@
663
692
 
664
693
  </slot>
665
694
  </div>
666
- `;var ri=class extends ut{constructor(){super(),Y(this,jt),Y(this,ei),Y(this,pa),Y(this,mt,void 0),Y(this,Xt,void 0),Y(this,ht,void 0),Y(this,ti,void 0),Y(this,ii,void 0),Y(this,Jt,t=>{if([...O(this,mt)].some(E=>t.composedPath().includes(E)))return;this.updatePointerBar(t);let a=+this.getAttribute(o.MEDIA_DURATION);if(!a)return;let r=this.range.getBoundingClientRect(),n=(t.clientX-r.left)/r.width;n=Math.max(0,Math.min(1,n));let s=ct(this,jt,ca).call(this,O(this,Xt),n),{style:l}=ae(this.shadowRoot,"#preview-rail");l.transform=`translateX(${s})`;let c=n*a,m=new u.CustomEvent(p.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:c});this.dispatchEvent(m)}),Y(this,Fe,!1),Y(this,pt,t=>{(!t.composedPath().includes(this)||[...O(this,mt)].some(a=>t.composedPath().includes(a)))&&(u.removeEventListener("pointermove",O(this,pt)),me(this,Fe,!1),O(this,ai).call(this))}),Y(this,ma,()=>{u.addEventListener("pointermove",O(this,Jt),!1)}),Y(this,ai,()=>{u.removeEventListener("pointermove",O(this,Jt));let t=new u.CustomEvent(p.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:null});this.dispatchEvent(t)}),Y(this,ni,()=>{let t=this.getAttribute(o.MEDIA_DURATION);!O(this,Fe)&&t&&(me(this,Fe,!0),O(this,ma).call(this),u.addEventListener("pointermove",O(this,pt),!1))}),this.container.appendChild(sn.content.cloneNode(!0)),this.range.addEventListener("input",()=>{cancelAnimationFrame(this._refreshId);let a=this.range.value,r=new u.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:a});this.dispatchEvent(r)}),this._refreshBar=()=>{let t=(performance.now()-this._updateTimestamp)/1e3;this.range.value=this.mediaCurrentTime+t*this.mediaPlaybackRate,this.updateBar(),this.updateCurrentBox(),this._refreshId=requestAnimationFrame(this._refreshBar)},me(this,mt,this.shadowRoot.querySelectorAll('[part~="box"]')),me(this,Xt,this.shadowRoot.querySelector('[part~="preview-box"]')),me(this,ht,this.shadowRoot.querySelector('[part~="current-box"]'));let e=getComputedStyle(this);me(this,ti,parseInt(e.getPropertyValue("--media-box-padding-left"))),me(this,ii,parseInt(e.getPropertyValue("--media-box-padding-right"))),ct(this,ei,ha).call(this)}static get observedAttributes(){return[...super.observedAttributes,"thumbnails","disabled",o.MEDIA_PAUSED,o.MEDIA_DURATION,o.MEDIA_SEEKABLE,o.MEDIA_CURRENT_TIME,o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_TIME,o.MEDIA_BUFFERED,o.MEDIA_PLAYBACK_RATE,o.MEDIA_LOADING]}connectedCallback(){this.range.setAttribute("aria-label",B.SEEK()),super.connectedCallback()}disconnectedCallback(){cancelAnimationFrame(this._refreshId),super.disconnectedCallback()}attributeChangedCallback(e,t,a){var r,n,s,l,c;(e===o.MEDIA_CURRENT_TIME||e===o.MEDIA_PAUSED||e===o.MEDIA_LOADING)&&(this._updateTimestamp=performance.now(),this.range.value=this.mediaCurrentTime,ua(this),this.updateBar(),this.updateCurrentBox(),cancelAnimationFrame(this._refreshId),!this.mediaPaused&&!this.mediaLoading&&(this._refreshId=requestAnimationFrame(this._refreshBar))),e===o.MEDIA_DURATION&&(this.range.max=Math.floor((n=(r=this.mediaSeekableEnd)!=null?r:this.mediaDuration)!=null?n:1e3),ua(this),this.updateBar(),this.updateCurrentBox()),e===o.MEDIA_SEEKABLE&&(this.range.min=(s=this.mediaSeekableStart)!=null?s:0,this.range.max=Math.floor((c=(l=this.mediaSeekableEnd)!=null?l:this.mediaDuration)!=null?c:1e3),ua(this),this.updateBar()),e===o.MEDIA_BUFFERED&&this.updateBar(),e==="disabled"&&(a==null?ct(this,ei,ha).call(this):ct(this,pa,on).call(this)),super.attributeChangedCallback(e,t,a)}get mediaPaused(){return this.hasAttribute(o.MEDIA_PAUSED)}get mediaLoading(){return this.hasAttribute(o.MEDIA_LOADING)}get mediaDuration(){let e=this.getAttribute(o.MEDIA_DURATION);return e!=null?+e:void 0}get mediaCurrentTime(){let e=this.getAttribute(o.MEDIA_CURRENT_TIME);return e!=null?+e:void 0}get mediaPlaybackRate(){let e=this.getAttribute(o.MEDIA_PLAYBACK_RATE);return e!=null?+e:1}get mediaBuffered(){let e=this.getAttribute(o.MEDIA_BUFFERED);return e?e.split(" ").map(t=>t.split(":").map(a=>+a)):[]}get mediaSeekable(){let e=this.getAttribute(o.MEDIA_SEEKABLE);if(!!e)return e.split(":").map(t=>+t)}get mediaSeekableEnd(){var e;let[,t]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaSeekableStart(){var e;let[t]=(e=this.mediaSeekable)!=null?e:[];return t}getBarColors(){var e;let t=super.getBarColors(),{range:a}=this,r=a.max-a.min,n=this.mediaBuffered;if(!n.length||!Number.isFinite(r)||r<=0)return t;let s=this.mediaCurrentTime,[,l=a.min]=(e=n.find(([E,f])=>E<=s&&s<=f))!=null?e:[],m=(l-a.min)/r*100;return t.splice(1,0,["var(--media-time-buffered-color, rgba(255,255,255, .4))",m]),t}updateCurrentBox(){if(!O(this,ht).assignedElements().length)return;let e=this.range.value/(this.range.max-this.range.min),t=ct(this,jt,ca).call(this,O(this,ht),e),{style:a}=ae(this.shadowRoot,"#current-rail");a.transform=`translateX(${t})`}};mt=new WeakMap;Xt=new WeakMap;ht=new WeakMap;ti=new WeakMap;ii=new WeakMap;jt=new WeakSet;ca=function(i,e){var t;let a=`${e*100*100}%`,r=i.offsetWidth;if(!r)return a;let n=(t=this.getAttribute("bounds")?at(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?t:this,s=this.range.getBoundingClientRect(),l=n.getBoundingClientRect(),c=(O(this,ti)-(s.left-l.left-r/2))/s.width*100,m=(l.right-s.left-r/2-O(this,ii))/s.width*100;return Number.isNaN(c)||(a=`max(${c*100}%, ${a})`),Number.isNaN(m)||(a=`min(${a}, ${m*100}%)`),a};Jt=new WeakMap;Fe=new WeakMap;pt=new WeakMap;ma=new WeakMap;ai=new WeakMap;ni=new WeakMap;ei=new WeakSet;ha=function(){this.addEventListener("pointermove",O(this,ni),!1)};pa=new WeakSet;on=function(){u.removeEventListener("pointermove",O(this,pt)),this.removeEventListener("pointermove",O(this,ni)),me(this,Fe,!1),O(this,ai).call(this)};h("media-time-range",ri);var Ea=ri;var fa=class extends Ea{constructor(){super(),console.warn("MediaChrome: <media-progress-range> is deprecated. Use <media-time-range> instead.")}};h("media-progress-range",fa);var va="30",fs=`<svg aria-hidden="true" viewBox="0 0 20 24"><defs><style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style></defs><text class="text value" transform="translate(2.18 19.87)">${va}</text><path d="M10 6V3L4.37 7 10 10.94V8a5.54 5.54 0 0 1 1.9 10.48v2.12A7.5 7.5 0 0 0 10 6Z"/></svg>`,un=d.createElement("template");un.innerHTML=`
667
- <slot name="backward">${fs}</slot>
668
- `;var vs=0,ln=i=>{let e=Math.abs(+i.getAttribute("seek-offset")),t=C.SEEK_BACK_N_SECS({seekOffset:e});i.setAttribute("aria-label",t)},dn=i=>{let e=Bt(i,"backward"),t=i.getAttribute("seek-offset");Nt(e,t)},ga=class extends x{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME]}constructor(e={}){super({slotTemplate:un,...e})}connectedCallback(){this.hasAttribute("seek-offset")||this.setAttribute("seek-offset",va),ln(this),dn(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e==="seek-offset"&&(a==null&&this.setAttribute("seek-offset",va),dn(this),ln(this)),super.attributeChangedCallback(e,t,a)}handleClick(){let e=this.getAttribute(o.MEDIA_CURRENT_TIME),t=+this.getAttribute("seek-offset"),a=e&&!Number.isNaN(+e)?+e:vs,r=Math.max(a-t,0),n=new u.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)}};h("media-seek-backward-button",ga);var Aa=class extends ce{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,t,a){e===o.MEDIA_PREVIEW_TIME&&a!=null&&(this.container.textContent=j(a)),super.attributeChangedCallback(e,t,a)}};h("media-preview-time-display",Aa);var cn=d.createElement("template");cn.innerHTML=`
695
+ `;var qi=class extends Zt{constructor(){super(),Z(this,Vi),Z(this,Ki),Z(this,dr),Z(this,zt,void 0),Z(this,Wi,void 0),Z(this,Xt,void 0),Z(this,Yi,void 0),Z(this,Gi,void 0),Z(this,Fi,t=>{if([...N(this,zt)].some(b=>t.composedPath().includes(b)))return;this.updatePointerBar(t);let a=+this.getAttribute(o.MEDIA_DURATION);if(!a)return;let r=this.range.getBoundingClientRect(),n=(t.clientX-r.left)/r.width;n=Math.max(0,Math.min(1,n));let s=Qt(this,Vi,sr).call(this,N(this,Wi),n),{style:d}=ce(this.shadowRoot,"#preview-rail");d.transform=`translateX(${s})`;let c=n*a,m=new l.CustomEvent(h.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:c});this.dispatchEvent(m)}),Z(this,ft,!1),Z(this,Jt,t=>{(!t.composedPath().includes(this)||[...N(this,zt)].some(a=>t.composedPath().includes(a)))&&(l.removeEventListener("pointermove",N(this,Jt)),Me(this,ft,!1),N(this,Zi).call(this))}),Z(this,or,()=>{l.addEventListener("pointermove",N(this,Fi),!1)}),Z(this,Zi,()=>{l.removeEventListener("pointermove",N(this,Fi));let t=new l.CustomEvent(h.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:null});this.dispatchEvent(t)}),Z(this,Qi,()=>{let t=this.getAttribute(o.MEDIA_DURATION);!N(this,ft)&&t&&(Me(this,ft,!0),N(this,or).call(this),l.addEventListener("pointermove",N(this,Jt),!1))}),this.container.appendChild(Is.content.cloneNode(!0)),this.range.addEventListener("input",()=>{cancelAnimationFrame(this._refreshId);let a=this.range.value,r=new l.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:a});this.dispatchEvent(r)}),this._refreshBar=()=>{let t=(performance.now()-this._updateTimestamp)/1e3;this.range.value=this.mediaCurrentTime+t*this.mediaPlaybackRate,this.updateBar(),this.updateCurrentBox(),this._refreshId=requestAnimationFrame(this._refreshBar)},Me(this,zt,this.shadowRoot.querySelectorAll('[part~="box"]')),Me(this,Wi,this.shadowRoot.querySelector('[part~="preview-box"]')),Me(this,Xt,this.shadowRoot.querySelector('[part~="current-box"]'));let e=getComputedStyle(this);Me(this,Yi,parseInt(e.getPropertyValue("--media-box-padding-left"))),Me(this,Gi,parseInt(e.getPropertyValue("--media-box-padding-right"))),Qt(this,Ki,lr).call(this)}static get observedAttributes(){return[...super.observedAttributes,"thumbnails","disabled",o.MEDIA_PAUSED,o.MEDIA_DURATION,o.MEDIA_SEEKABLE,o.MEDIA_CURRENT_TIME,o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_TIME,o.MEDIA_BUFFERED,o.MEDIA_PLAYBACK_RATE,o.MEDIA_LOADING]}connectedCallback(){this.range.setAttribute("aria-label",$.SEEK()),super.connectedCallback()}disconnectedCallback(){cancelAnimationFrame(this._refreshId),super.disconnectedCallback()}attributeChangedCallback(e,t,a){var r,n,s,d,c;(e===o.MEDIA_CURRENT_TIME||e===o.MEDIA_PAUSED||e===o.MEDIA_LOADING)&&(this._updateTimestamp=performance.now(),this.range.value=this.mediaCurrentTime,nr(this),this.updateBar(),this.updateCurrentBox(),cancelAnimationFrame(this._refreshId),!this.mediaPaused&&!this.mediaLoading&&(this._refreshId=requestAnimationFrame(this._refreshBar))),e===o.MEDIA_DURATION&&(this.range.max=(n=(r=this.mediaSeekableEnd)!=null?r:this.mediaDuration)!=null?n:1e3,nr(this),this.updateBar(),this.updateCurrentBox()),e===o.MEDIA_SEEKABLE&&(this.range.min=(s=this.mediaSeekableStart)!=null?s:0,this.range.max=(c=(d=this.mediaSeekableEnd)!=null?d:this.mediaDuration)!=null?c:1e3,nr(this),this.updateBar()),e===o.MEDIA_BUFFERED&&this.updateBar(),e==="disabled"&&(a==null?Qt(this,Ki,lr).call(this):Qt(this,dr,ys).call(this)),super.attributeChangedCallback(e,t,a)}get mediaPaused(){return this.hasAttribute(o.MEDIA_PAUSED)}get mediaLoading(){return this.hasAttribute(o.MEDIA_LOADING)}get mediaDuration(){let e=this.getAttribute(o.MEDIA_DURATION);return e!=null?+e:void 0}get mediaCurrentTime(){let e=this.getAttribute(o.MEDIA_CURRENT_TIME);return e!=null?+e:void 0}get mediaPlaybackRate(){let e=this.getAttribute(o.MEDIA_PLAYBACK_RATE);return e!=null?+e:1}get mediaBuffered(){let e=this.getAttribute(o.MEDIA_BUFFERED);return e?e.split(" ").map(t=>t.split(":").map(a=>+a)):[]}get mediaSeekable(){let e=this.getAttribute(o.MEDIA_SEEKABLE);if(!!e)return e.split(":").map(t=>+t)}get mediaSeekableEnd(){var e;let[,t]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaSeekableStart(){var e;let[t]=(e=this.mediaSeekable)!=null?e:[];return t}getBarColors(){var e;let t=super.getBarColors(),{range:a}=this,r=a.max-a.min,n=this.mediaBuffered;if(!n.length||!Number.isFinite(r)||r<=0)return t;let s=this.mediaCurrentTime,[,d=a.min]=(e=n.find(([b,y])=>b<=s&&s<=y))!=null?e:[],m=(d-a.min)/r*100;return t.splice(1,0,["var(--media-time-buffered-color, rgba(255,255,255, .4))",m]),t}updateCurrentBox(){if(!N(this,Xt).assignedElements().length)return;let e=this.range.value/(this.range.max-this.range.min),t=Qt(this,Vi,sr).call(this,N(this,Xt),e),{style:a}=ce(this.shadowRoot,"#current-rail");a.transform=`translateX(${t})`}};zt=new WeakMap;Wi=new WeakMap;Xt=new WeakMap;Yi=new WeakMap;Gi=new WeakMap;Vi=new WeakSet;sr=function(i,e){var t;let a=`${e*100*100}%`,r=i.offsetWidth;if(!r)return a;let n=(t=this.getAttribute("bounds")?Fe(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?t:this,s=this.range.getBoundingClientRect(),d=n.getBoundingClientRect(),c=(N(this,Yi)-(s.left-d.left-r/2))/s.width*100,m=(d.right-s.left-r/2-N(this,Gi))/s.width*100;return Number.isNaN(c)||(a=`max(${c*100}%, ${a})`),Number.isNaN(m)||(a=`min(${a}, ${m*100}%)`),a};Fi=new WeakMap;ft=new WeakMap;Jt=new WeakMap;or=new WeakMap;Zi=new WeakMap;Qi=new WeakMap;Ki=new WeakSet;lr=function(){this.addEventListener("pointermove",N(this,Qi),!1)};dr=new WeakSet;ys=function(){l.removeEventListener("pointermove",N(this,Jt)),this.removeEventListener("pointermove",N(this,Qi)),Me(this,ft,!1),N(this,Zi).call(this)};l.customElements.get("media-time-range")||l.customElements.define("media-time-range",qi);var ur=qi;var mr=class extends ur{constructor(){super(),console.warn("MediaChrome: <media-progress-range> is deprecated. Use <media-time-range> instead.")}};l.customElements.get("media-progress-range")||l.customElements.define("media-progress-range",mr);var hr="30",Gl=`<svg aria-hidden="true" viewBox="0 0 20 24"><defs><style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style></defs><text class="text value" transform="translate(2.18 19.87)">${hr}</text><path d="M10 6V3L4.37 7 10 10.94V8a5.54 5.54 0 0 1 1.9 10.48v2.12A7.5 7.5 0 0 0 10 6Z"/></svg>`,ks=u.createElement("template");ks.innerHTML=`
696
+ <slot name="backward">${Gl}</slot>
697
+ `;var Zl=0,Ts=i=>{let e=Math.abs(+i.getAttribute("seek-offset")),t=w.SEEK_BACK_N_SECS({seekOffset:e});i.setAttribute("aria-label",t)},Ms=i=>{let e=Li(i,"backward"),t=i.getAttribute("seek-offset");Ci(e,t)},pr=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME]}constructor(e={}){super({slotTemplate:ks,...e})}connectedCallback(){this.hasAttribute("seek-offset")||this.setAttribute("seek-offset",hr),Ts(this),Ms(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e==="seek-offset"&&(a==null&&this.setAttribute("seek-offset",hr),Ms(this),Ts(this)),super.attributeChangedCallback(e,t,a)}handleClick(){let e=this.getAttribute(o.MEDIA_CURRENT_TIME),t=+this.getAttribute("seek-offset"),a=e&&!Number.isNaN(+e)?+e:Zl,r=Math.max(a-t,0),n=new l.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)}};l.customElements.get("media-seek-backward-button")||l.customElements.define("media-seek-backward-button",pr);var br=class extends Te{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,t,a){e===o.MEDIA_PREVIEW_TIME&&a!=null&&(this.container.textContent=X(a)),super.attributeChangedCallback(e,t,a)}};l.customElements.get("media-preview-time-display")||l.customElements.define("media-preview-time-display",br);var Ss=u.createElement("template");Ss.innerHTML=`
669
698
  <style>
670
699
  :host {
671
700
  box-sizing: border-box;
@@ -679,7 +708,7 @@
679
708
  }
680
709
  </style>
681
710
  <img crossorigin loading="eager" decoding="async" />
682
- `;var _a=class extends u.HTMLElement{static get observedAttributes(){return[A.MEDIA_CONTROLLER,"time",o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(cn.content.cloneNode(!0))}connectedCallback(){var e;let t=this.getAttribute(A.MEDIA_CONTROLLER);if(t){let a=d.getElementById(t);(e=a==null?void 0:a.associateElement)==null||e.call(a,this)}}disconnectedCallback(){var e;let t=this.getAttribute(A.MEDIA_CONTROLLER);if(t){let a=d.getElementById(t);(e=a==null?void 0:a.unassociateElement)==null||e.call(a,this)}}attributeChangedCallback(e,t,a){var r,n;if(["time",o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===A.MEDIA_CONTROLLER){if(t){let s=d.getElementById(t);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=d.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}}update(){let e=this.getAttribute(o.MEDIA_PREVIEW_COORDS),t=this.getAttribute(o.MEDIA_PREVIEW_IMAGE);if(!(e&&t))return;let[a,r,n,s]=e.split(/\s+/).map(wt=>+wt),l=t.split("#")[0],c=getComputedStyle(this),{maxWidth:m,maxHeight:E,minWidth:f,minHeight:w}=c,T=Math.min(parseInt(m)/n,parseInt(E)/s),P=Math.max(parseInt(f)/n,parseInt(w)/s),M=T<1,R=M?T:P>1?P:1,{style:L}=ae(this.shadowRoot,":host"),G=ae(this.shadowRoot,"img").style,Z=this.shadowRoot.querySelector("img"),ie=M?"min":"max";L.setProperty(`${ie}-width`,"initial","important"),L.setProperty(`${ie}-height`,"initial","important"),L.width=`${n*R}px`,L.height=`${s*R}px`;let Re=()=>{G.width=`${this.imgWidth*R}px`,G.height=`${this.imgHeight*R}px`,G.display="block"};Z.src!==l&&(Z.onload=()=>{this.imgWidth=Z.naturalWidth,this.imgHeight=Z.naturalHeight,Re()},Z.src=l,Re()),Re(),G.transform=`translate(-${a*R}px, -${r*R}px)`}};h("media-preview-thumbnail",_a);var mn=d.createElement("template"),gs=`
711
+ `;var Er=class extends l.HTMLElement{static get observedAttributes(){return[p.MEDIA_CONTROLLER,"time",o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Ss.content.cloneNode(!0))}connectedCallback(){var e;let t=this.getAttribute(p.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.associateElement)==null||e.call(a,this)}}disconnectedCallback(){var e;let t=this.getAttribute(p.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.unassociateElement)==null||e.call(a,this)}}attributeChangedCallback(e,t,a){var r,n;if(["time",o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===p.MEDIA_CONTROLLER){if(t){let s=u.getElementById(t);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=u.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}}update(){let e=this.getAttribute(o.MEDIA_PREVIEW_COORDS),t=this.getAttribute(o.MEDIA_PREVIEW_IMAGE);if(!(e&&t))return;let[a,r,n,s]=e.split(/\s+/).map(yi=>+yi),d=t.split("#")[0],c=getComputedStyle(this),{maxWidth:m,maxHeight:b,minWidth:y,minHeight:f}=c,I=Math.min(parseInt(m)/n,parseInt(b)/s),B=Math.max(parseInt(y)/n,parseInt(f)/s),D=I<1,M=D?I:B>1?B:1,{style:k}=ce(this.shadowRoot,":host"),j=ce(this.shadowRoot,"img").style,Q=this.shadowRoot.querySelector("img"),de=D?"min":"max";k.setProperty(`${de}-width`,"initial","important"),k.setProperty(`${de}-height`,"initial","important"),k.width=`${n*M}px`,k.height=`${s*M}px`;let lt=()=>{j.width=`${this.imgWidth*M}px`,j.height=`${this.imgHeight*M}px`,j.display="block"};Q.src!==d&&(Q.onload=()=>{this.imgWidth=Q.naturalWidth,this.imgHeight=Q.naturalHeight,lt()},Q.src=d,lt()),lt(),j.transform=`translate(-${a*M}px, -${r*M}px)`}};l.customElements.get("media-preview-thumbnail")||l.customElements.define("media-preview-thumbnail",Er);var Cs=u.createElement("template"),ql=`
683
712
  <svg aria-hidden="true" viewBox="0 0 100 100">
684
713
  <path d="M73,50c0-12.7-10.3-23-23-23S27,37.3,27,50 M30.9,50c0-10.5,8.5-19.1,19.1-19.1S69.1,39.5,69.1,50">
685
714
  <animateTransform
@@ -692,7 +721,7 @@
692
721
  repeatCount="indefinite" />
693
722
  </path>
694
723
  </svg>
695
- `;mn.innerHTML=`
724
+ `;Cs.innerHTML=`
696
725
  <style>
697
726
  :host {
698
727
  display: inline-block;
@@ -729,28 +758,151 @@ svg, img, ::slotted(svg), ::slotted(img) {
729
758
  }
730
759
  </style>
731
760
 
732
- <slot name="loading">${gs}</slot>
733
- <div id="status" role="status" aria-live="polite">${B.MEDIA_LOADING()}</div>
734
- `;var As=500,ya=class extends u.HTMLElement{static get observedAttributes(){return[A.MEDIA_CONTROLLER,o.MEDIA_PAUSED,o.MEDIA_LOADING,"loading-delay"]}constructor(){super();let e=this.attachShadow({mode:"open"}),t=mn.content.cloneNode(!0);e.appendChild(t)}attributeChangedCallback(e,t,a){var r,n,s;if(e===o.MEDIA_LOADING||e===o.MEDIA_PAUSED){let l=this.getAttribute(o.MEDIA_PAUSED)!=null,c=this.getAttribute(o.MEDIA_LOADING)!=null,m=!l&&c;if(!m)this.loadingDelayHandle&&(clearTimeout(this.loadingDelayHandle),this.loadingDelayHandle=void 0),this.removeAttribute("is-loading");else if(!this.loadingDelayHandle&&m){let E=+((r=this.getAttribute("loading-delay"))!=null?r:As);this.loadingDelayHandle=setTimeout(()=>{this.setAttribute("is-loading",""),this.loadingDelayHandle=void 0},E)}}else if(e===A.MEDIA_CONTROLLER){if(t){let l=d.getElementById(t);(n=l==null?void 0:l.unassociateElement)==null||n.call(l,this)}if(a){let l=d.getElementById(a);(s=l==null?void 0:l.associateElement)==null||s.call(l,this)}}}connectedCallback(){var e;let t=this.getAttribute(A.MEDIA_CONTROLLER);if(t){let a=d.getElementById(t);(e=a==null?void 0:a.associateElement)==null||e.call(a,this)}}disconnectedCallback(){var e;this.loadingDelayHandle&&(clearTimeout(this.loadingDelayHandle),this.loadingDelayHandle=void 0);let t=this.getAttribute(A.MEDIA_CONTROLLER);if(t){let a=d.getElementById(t);(e=a==null?void 0:a.unassociateElement)==null||e.call(a,this)}}};h("media-loading-indicator",ya);var hn=d.createElement("template");hn.innerHTML=`
761
+ <slot name="loading">${ql}</slot>
762
+ <div id="status" role="status" aria-live="polite">${$.MEDIA_LOADING()}</div>
763
+ `;var Ql=500,fr=class extends l.HTMLElement{static get observedAttributes(){return[p.MEDIA_CONTROLLER,o.MEDIA_PAUSED,o.MEDIA_LOADING,"loading-delay"]}constructor(){super();let e=this.attachShadow({mode:"open"}),t=Cs.content.cloneNode(!0);e.appendChild(t)}attributeChangedCallback(e,t,a){var r,n,s;if(e===o.MEDIA_LOADING||e===o.MEDIA_PAUSED){let d=this.getAttribute(o.MEDIA_PAUSED)!=null,c=this.getAttribute(o.MEDIA_LOADING)!=null,m=!d&&c;if(!m)this.loadingDelayHandle&&(clearTimeout(this.loadingDelayHandle),this.loadingDelayHandle=void 0),this.removeAttribute("is-loading");else if(!this.loadingDelayHandle&&m){let b=+((r=this.getAttribute("loading-delay"))!=null?r:Ql);this.loadingDelayHandle=setTimeout(()=>{this.setAttribute("is-loading",""),this.loadingDelayHandle=void 0},b)}}else if(e===p.MEDIA_CONTROLLER){if(t){let d=u.getElementById(t);(n=d==null?void 0:d.unassociateElement)==null||n.call(d,this)}if(a){let d=u.getElementById(a);(s=d==null?void 0:d.associateElement)==null||s.call(d,this)}}}connectedCallback(){var e;let t=this.getAttribute(p.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.associateElement)==null||e.call(a,this)}}disconnectedCallback(){var e;this.loadingDelayHandle&&(clearTimeout(this.loadingDelayHandle),this.loadingDelayHandle=void 0);let t=this.getAttribute(p.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.unassociateElement)==null||e.call(a,this)}}};l.customElements.get("media-loading-indicator")||l.customElements.define("media-loading-indicator",fr);var Ls=u.createElement("template");Ls.innerHTML=`
735
764
  <style>
736
765
  :host {
737
766
  }
738
767
  </style>
739
768
  <slot></slot>
740
- `;var Ta=class extends u.HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(hn.content.cloneNode(!0))}};h("media-title-bar",Ta);var _s=100,ys=i=>{var e;if(i.getAttribute(o.MEDIA_MUTED)!=null)return 0;let a=+((e=i.getAttribute(o.MEDIA_VOLUME))!=null?e:1);return Math.round(a*i.range.max)},Ts=({value:i,max:e})=>`${Math.round(i/e*100)}%`,Ia=class extends ut{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME,o.MEDIA_MUTED,o.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.max=_s,this.range.addEventListener("input",()=>{let t=this.range.value/this.range.max,a=new u.CustomEvent(p.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(a)})}connectedCallback(){this.range.setAttribute("aria-label",B.VOLUME()),super.connectedCallback()}attributeChangedCallback(e,t,a){if(e===o.MEDIA_VOLUME||e===o.MEDIA_MUTED){let r=ys(this);this.range.value=r,this.range.setAttribute("aria-valuetext",Ts(this.range)),this.updateBar()}super.attributeChangedCallback(e,t,a)}};h("media-volume-range",Ia);var Is=Object.defineProperty,Ms=(i,e,t)=>e in i?Is(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,ks=(i,e,t)=>(Ms(i,typeof e!="symbol"?e+"":e,t),t),oi=class extends u.HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.render()}render(){this.shadowRoot.textContent="";let e=d.createElement("template");e.innerHTML=this.constructor.template,this.shadowRoot.append(e.content.cloneNode(!0))}get mediaController(){return this.shadowRoot.querySelector("media-controller")}};ks(oi,"template","");h("media-theme-base",oi);var Ma=class extends dt{};u.customElements.get("media-chrome")||u.customElements.define("media-chrome",Ma);var ka=class extends dt{constructor(){super(),console.warn("MediaChrome: <media-container> is deprecated. Use <media-controller>.")}};u.customElements.get("media-container")||u.customElements.define("media-container",ka);var g=fo(require("@mux/mux-video")),k=require("@mux/playback-core");var Sn=require("@mux/mux-video");var Ss="en",Me={code:Ss};var pn="en";function y(i,e=!0){var r,n;let t=e&&(n=(r=Me)==null?void 0:r[i])!=null?n:i,a=e?Me.code:pn;return new Sa(t,a)}var Sa=class{constructor(e,t=(a=>(a=Me.code)!=null?a:pn)()){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 bn(i){let e="";return Object.entries(i).forEach(([t,a])=>{a!=null&&(e+=`${Ls(t)}: ${a}; `)}),e?e.trim():void 0}function Ls(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function En(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function re(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function si(i){let e=Cs(i).toString();return e?"?"+e:""}function Cs(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}function he(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 La=(i,e)=>!i||!e?!1:i.contains(e)?!0:La(i,e.getRootNode().host);var bt=require("@mux/playback-core");var Ca="mux.com",ws=()=>{try{return"1.6.0"}catch{}return"UNKNOWN"},Ds=ws(),di=()=>Ds,wa=(i,{token:e,domain:t=Ca}={})=>`https://stream.${t}/${i}.m3u8${si(!!e?{token:e}:{redundant_streams:!0})}`,gn=(i,{token:e,thumbnailTime:t,domain:a=Ca}={})=>{let r=e==null?t:void 0,{aud:n}=he(e);if(!(e&&n!=="t"))return`https://image.${a}/${i}/thumbnail.webp${si({token:e,time:r})}`},An=(i,{token:e,domain:t=Ca}={})=>{let{aud:a}=he(e);if(!(e&&a!=="s"))return`https://image.${t}/${i}/storyboard.vtt${si({token:e,format:"webp"})}`};var xs={crossorigin:"crossOrigin",playsinline:"playsInline"};function _n(i){var e;return(e=xs[i])!=null?e:En(i)}var yn=i=>{var t,a;let{media:e}=i;return(a=(t=e==null?void 0:e._hls)==null?void 0:t.liveSyncPosition)!=null?a:e!=null&&e.seekable.length?e==null?void 0:e.seekable.end(e.seekable.length-1):void 0},Da=i=>{let e=yn(i);if(e==null){console.warn("attempting to seek to live but cannot determine live edge time!");return}i.currentTime=e},Rs=1,Ps=5,fn=3,vn=.5,Tn=i=>{var n;let{streamType:e}=i,t=yn(i),a=(n=i.media)==null?void 0:n.currentTime;if(t==null||a==null)return!1;let r=t-a;return e===bt.StreamTypes.LL_LIVE||e===bt.StreamTypes.LL_DVR?r<=Rs*(fn+vn):e===bt.StreamTypes.LIVE||e===bt.StreamTypes.DVR?r<=Ps*(fn+vn):!1},ke,Se,W,li=class{constructor(e,t){I(this,ke,void 0);I(this,Se,void 0);I(this,W,[]);V(this,ke,e),V(this,Se,t)}[Symbol.iterator](){return v(this,W).values()}get length(){return v(this,W).length}get value(){var e;return(e=v(this,W).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(V(this,W,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return v(this,W)[e]}values(){return v(this,W).values()}keys(){return v(this,W).keys()}forEach(e){v(this,W).forEach(e)}add(...e){var t,a;e.forEach(r=>{this.contains(r)||v(this,W).push(r)}),!(this.value===""&&!((t=v(this,ke))!=null&&t.hasAttribute(`${v(this,Se)}`)))&&((a=v(this,ke))==null||a.setAttribute(`${v(this,Se)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>{v(this,W).splice(v(this,W).indexOf(a),1)}),(t=v(this,ke))==null||t.setAttribute(`${v(this,Se)}`,`${this.value}`)}contains(e){return v(this,W).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)}};ke=new WeakMap,Se=new WeakMap,W=new WeakMap;var In=`[mux-player ${di()}]`;function pe(...i){console.warn(In,...i)}function J(...i){console.error(In,...i)}function ui(i){var t;let e=(t=i.message)!=null?t:"";if(i.file){let a="https://github.com/muxinc/elements/blob/main/errors/";e+=` ${y("Read more: ")}
741
- ${a}${i.file}`}pe(e)}var $={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},Le={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},kn=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}}),Us=Sn.VideoEvents.filter(i=>i!=="error"),Os=Object.values($).filter(i=>![$.PLAYSINLINE].includes(i)),Ns=Object.values(Le);function Ln(i){i.querySelectorAll(":scope > track").forEach(e=>{var t;(t=i.media)==null||t.append(e.cloneNode())}),Us.forEach(e=>{var t;(t=i.media)==null||t.addEventListener(e,a=>{i.dispatchEvent(new Event(a.type))})})}var xa=class extends D.HTMLElement{static get observedAttributes(){return[...Os,...Ns]}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 l,c;let s=(l=this.media)==null?void 0:l.querySelector(`track[src="${n.src}"]`);s&&((c=this.media)==null||c.removeChild(s))}),r.addedNodes.forEach(n=>{var s;(s=this.media)==null||s.append(n.cloneNode())}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(e,t,a){var r,n;switch(e){case Le.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case Le.VOLUME:{let s=(r=re(a))!=null?r:1;this.media&&(this.media.volume=s);return}case Le.PLAYBACKRATE:{let s=(n=re(a))!=null?n:1;this.media&&(this.media.playbackRate=s,this.media.defaultPlaybackRate=s);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 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:kn}get seekable(){var e,t;return(t=(e=this.media)==null?void 0:e.seekable)!=null?t:kn}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=re(this.getAttribute(Le.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(Le.PLAYBACKRATE,`${e}`):this.removeAttribute(Le.PLAYBACKRATE)}get crossOrigin(){return Et(this,$.CROSSORIGIN)}set crossOrigin(e){this.setAttribute($.CROSSORIGIN,`${e}`)}get autoplay(){return Et(this,$.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute($.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute($.AUTOPLAY)}get loop(){return Et(this,$.LOOP)!=null}set loop(e){e?this.setAttribute($.LOOP,""):this.removeAttribute($.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 Et(this,$.MUTED)!=null}set defaultMuted(e){e?this.setAttribute($.MUTED,""):this.removeAttribute($.MUTED)}get playsInline(){return Et(this,$.PLAYSINLINE)!=null}set playsInline(e){J("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($.PRELOAD,e):this.removeAttribute($.PRELOAD)}};function Et(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var Ra=xa;var Bs=Object.defineProperty,$s=(i,e,t)=>e in i?Bs(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Vs=(i,e,t)=>($s(i,typeof e!="symbol"?e+"":e,t),t),Rn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},_=(i,e,t)=>(Rn(i,e,"read from private field"),t?t.call(i):e.get(i)),ee=(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)},ne=(i,e,t,a)=>(Rn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ke,ci,Ce,ft,be,Ee,fe,we,Ye,mi,z,Cn=1,wn=0,Hs=1,Ws={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 F&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=n:typeof n=="function"&&r instanceof F?r.element[r.attributeName]=n:r.value=n}}}},oe=class extends u.DocumentFragment{constructor(e,t,a=Ws){var r;super(),ee(this,Ke,void 0),ee(this,ci,void 0),this.append(e.content.cloneNode(!0)),ne(this,Ke,Pn(this)),ne(this,ci,a),(r=a.createCallback)==null||r.call(a,this,_(this,Ke),t),a.processCallback(this,_(this,Ke),t)}update(e){_(this,ci).processCallback(this,_(this,Ke),e)}};Ke=new WeakMap;ci=new WeakMap;var Pn=(i,e=[])=>{let t,a;for(let r of i.attributes||[])if(r.value.includes("{{")){let n=new Pa;for([t,a]of xn(r.value))if(!t)n.append(a);else{let s=new F(i,r.name,r.namespaceURI);n.append(s),e.push([a,s])}r.value=n.toString()}for(let r of i.childNodes)if(r.nodeType===Cn&&!(r instanceof HTMLTemplateElement))Pn(r,e);else if(r.nodeType===Cn||r.data.includes("{{")){let n=[];if(r.data)for([t,a]of xn(r.data))if(!t)n.push(new Text(a));else{let s=new se(i);n.push(s),e.push([a,s])}else if(r instanceof HTMLTemplateElement){let s=new vt(i,r);n.push(s),e.push([s.expression,s])}r.replaceWith(...n.flatMap(s=>s.replacementNodes||[s]))}return e},Dn={},xn=i=>{let e="",t=0,a=Dn[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([wn,e]),e="",r++):n==="}"&&i[r+1]==="}"&&i[r-1]!=="\\"&&!--t?(a.push([Hs,e.trim()]),e="",r++):e+=n||"";return e&&a.push([wn,(t>0?"{{":"")+e]),Dn[i]=a},Fs=11,hi=class{get value(){return""}set value(e){}toString(){return this.value}},Un=new WeakMap,Pa=class{constructor(){ee(this,Ce,[])}[Symbol.iterator](){return _(this,Ce).values()}get length(){return _(this,Ce).length}item(e){return _(this,Ce)[e]}append(...e){for(let t of e)t instanceof F&&Un.set(t,this),_(this,Ce).push(t)}toString(){return _(this,Ce).join("")}};Ce=new WeakMap;var F=class extends hi{constructor(e,t,a){super(),ee(this,we),ee(this,ft,""),ee(this,be,void 0),ee(this,Ee,void 0),ee(this,fe,void 0),ne(this,be,e),ne(this,Ee,t),ne(this,fe,a)}get attributeName(){return _(this,Ee)}get attributeNamespace(){return _(this,fe)}get element(){return _(this,be)}get value(){return _(this,ft)}set value(e){_(this,ft)!==e&&(ne(this,ft,e),!_(this,we,Ye)||_(this,we,Ye).length===1?e==null?_(this,be).removeAttributeNS(_(this,fe),_(this,Ee)):_(this,be).setAttributeNS(_(this,fe),_(this,Ee),e):_(this,be).setAttributeNS(_(this,fe),_(this,Ee),_(this,we,Ye)))}get booleanValue(){return _(this,be).hasAttributeNS(_(this,fe),_(this,Ee))}set booleanValue(e){if(!_(this,we,Ye)||_(this,we,Ye).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};ft=new WeakMap;be=new WeakMap;Ee=new WeakMap;fe=new WeakMap;we=new WeakSet;Ye=function(){return Un.get(this)};var se=class extends hi{constructor(e,t){super(),ee(this,mi,void 0),ee(this,z,void 0),ne(this,mi,e),ne(this,z,t?[...t]:[new Text])}get replacementNodes(){return _(this,z)}get parentNode(){return _(this,mi)}get nextSibling(){return _(this,z)[_(this,z).length-1].nextSibling}get previousSibling(){return _(this,z)[0].previousSibling}get value(){return _(this,z).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===Fs?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);t.length||t.push(new Text("")),_(this,z)[0].before(...t);for(let a of _(this,z))t.includes(a)||a.remove();ne(this,z,t)}};mi=new WeakMap;z=new WeakMap;var vt=class extends se{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),Vs(this,"directive"),this.expression=r,this.template=t,this.directive=a}};var Ks=/([>&])?\s*(\w+)\s*(.*)/,Ys=/^(\?\?|\|)?\s*(['"\w]*)/,Gs={"|":{string:i=>String(i)},"??":(i,e)=>i!=null?i:e},pi=class{constructor(e){this.template=e}},Oa={partial:(i,e)=>{e[i.expression]=new pi(i.template)},if:(i,e)=>{Qs(i.expression,e)?i.replace(new oe(i.template,e,bi)):i.replace("")}},Zs=Object.keys(Oa),bi={processCallback(i,e,t){var a,r,n;if(!!t)for(let[s,l]of e){if(l instanceof vt){if(!l.directive){let M=Zs.find(R=>l.template.hasAttribute(R));M&&(l.directive=M,l.expression=l.template.getAttribute(M))}(a=Oa[l.directive])==null||a.call(Oa,l,t);continue}let[,c,m,E]=(r=s.match(Ks))!=null?r:[],f=t[m],[,w,T]=(n=E.match(Ys))!=null?n:[],P=Gs[w];if(typeof P=="function")f=P(f,gt(T,t));else if(P&&f!=null){let M=P[T];M&&(f=M(f))}if(f){if(f instanceof pi){if(c!==">")continue;let M={...t},R=s.matchAll(/(\w+)\s*=\s*(['"\w]*)/g);for(let[,L,G]of R)M[L]=gt(G,t);f=new oe(f.template,M,bi)}l instanceof F&&l.attributeName.startsWith("aria-")&&(f=String(f)),l instanceof F?typeof f=="boolean"?l.booleanValue=f:typeof f=="function"?l.element[l.attributeName]=f:l.value=f:l.value=f}else l instanceof F&&(l.booleanValue=!1)}}},qs={"==":(i,e)=>i==e,"!=":(i,e)=>i!=e};function Qs(i,e){var t;let a=zs(i,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=]=/,ws:/\s+/,param:/[$a-z_][$\w]*/i});if(a.length===0||a.some(({type:n})=>!n))return console.warn(`Warning: invalid expression \`${i}\``),!1;if(a.length===1)return Ua(a[0])?gt(a[0].token,e):(console.warn(`Warning: invalid expression \`${i}\``),!1);let r=a.filter(({type:n})=>n!=="ws");if(r.length===3){let n=qs[(t=r[1])==null?void 0:t.token];return!n||!Ua(r[0])||!Ua(r[2])?(console.warn(`Warning: invalid expression \`${i}\``),!1):n(gt(r[0].token,e),gt(r[2].token,e))}}function Ua({type:i}){return["number","boolean","string","param"].includes(i)}function gt(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):or(i)?parseFloat(i):e[i]}function zs(i,e){let t,a,r,n=[];for(;i;){r=null,t=i.length;for(let s in e)a=e[s].exec(i),a&&a.index<t&&(r={token:a[0],type:s,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 Xs=Object.defineProperty,js=(i,e,t)=>e in i?Xs(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,At=(i,e,t)=>(js(i,typeof e!="symbol"?e+"":e,t),t),$n=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},On=(i,e,t)=>($n(i,e,"read from private field"),t?t.call(i):e.get(i)),Nn=(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)},Bn=(i,e,t,a)=>($n(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ei,fi,Ge=class extends u.HTMLElement{constructor(){super(),At(this,"renderRoot"),At(this,"renderer"),Nn(this,Ei,void 0),Nn(this,fi,void 0),this.renderRoot=this.attachShadow({mode:"open"}),new MutationObserver(()=>this.render()).observe(this,{attributes:!0}),this.createRenderer()}get mediaController(){return this.renderRoot.querySelector("media-controller")}get template(){var e,t;let a=this.getAttribute("template");if(a){let r=(e=this.getRootNode())==null?void 0:e.getElementById(a);if(r)return r}return(t=On(this,Ei))!=null?t:this.constructor.template}set template(e){Bn(this,Ei,e),this.createRenderer()}get props(){let e={};for(let t of this.attributes)t.value!=null?e[Ui(t.name)]=t.value===""?!0:t.value:e[Ui(t.name)]=!1;return e}attributeChangedCallback(e,t,a){e==="template"&&t!=a&&this.createRenderer()}createRenderer(){this.template&&this.template!==On(this,fi)&&(Bn(this,fi,this.template),this.renderer=new oe(this.template,this.props,this.constructor.processor),this.renderRoot.textContent="",this.renderRoot.append(this.renderer))}render(){var e;(e=this.renderer)==null||e.update(this.props)}};Ei=new WeakMap;fi=new WeakMap;At(Ge,"template");At(Ge,"observedAttributes",["template"]);At(Ge,"processor",bi);h("media-theme",Ge);var Hn=`
769
+ `;var vr=class extends l.HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Ls.content.cloneNode(!0))}};l.customElements.get("media-title-bar")||l.customElements.define("media-title-bar",vr);var zl=100,Xl=i=>{var e;if(i.getAttribute(o.MEDIA_MUTED)!=null)return 0;let a=+((e=i.getAttribute(o.MEDIA_VOLUME))!=null?e:1);return Math.round(a*i.range.max)},Jl=({value:i,max:e})=>`${Math.round(i/e*100)}%`,gr=class extends Zt{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME,o.MEDIA_MUTED,o.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.max=zl,this.range.addEventListener("input",()=>{let t=this.range.value/this.range.max,a=new l.CustomEvent(h.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(a)})}connectedCallback(){this.range.setAttribute("aria-label",$.VOLUME()),super.connectedCallback()}attributeChangedCallback(e,t,a){if(e===o.MEDIA_VOLUME||e===o.MEDIA_MUTED){let r=Xl(this);this.range.value=r,this.range.setAttribute("aria-valuetext",Jl(this.range)),this.updateBar()}super.attributeChangedCallback(e,t,a)}};l.customElements.get("media-volume-range")||l.customElements.define("media-volume-range",gr);var Ar=class extends Gt{};l.customElements.get("media-chrome")||l.customElements.define("media-chrome",Ar);var _r=class extends Gt{constructor(){super(),console.warn("MediaChrome: <media-container> is deprecated. Use <media-controller>.")}};l.customElements.get("media-container")||l.customElements.define("media-container",_r);var Tr=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},S=(i,e,t)=>(Tr(i,e,"read from private field"),t?t.call(i):e.get(i)),ie=(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)},Se=(i,e,t,a)=>(Tr(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),jt=(i,e,t)=>(Tr(i,e,"access private method"),t),ke,gt,ei,ue,Ge,At,zi,vt,yr,ti,Xi,Ir,ws,Mr,xs,Ds=u.createElement("template");Ds.innerHTML=`
770
+ <style>
771
+ :host ul {
772
+ list-style: none;
773
+ display: inline-flex;
774
+ flex-direction: column;
775
+ gap: 0.5em;
776
+ margin: 0;
777
+ padding: 0.5em;
778
+ background-color: var(--media-listbox-background, var(--media-control-background, rgba(10,10,15, .8)));
779
+ color: var(--media-text-color, white);
780
+ font-family: Arial, sans-serif;
781
+ }
782
+
783
+ ::slotted(media-chrome-listitem[tabindex="0"]:focus-visible) {
784
+ box-shadow: inset 0 0 0 2px rgba(27, 127, 204, 0.9);
785
+ outline: 0;
786
+ }
787
+
788
+ ::slotted(media-chrome-listitem[aria-selected="true"]) {
789
+ background-color: var(--media-listbox-selected-background, rgba(122,122,184, .8));
790
+ }
791
+
792
+ ::slotted(media-chrome-listitem:hover) {
793
+ background-color: var(--media-listbox-hover-background, rgba(82,82,122, .8));
794
+ outline: var(--media-listbox-hover-outline, none);
795
+ }
796
+ </style>
797
+ <ul tabindex="0">
798
+ <slot></slot>
799
+ </ul>
800
+ `;var Ji=class extends l.HTMLElement{constructor(e={}){super(),ie(this,Ge),ie(this,ti),ie(this,Ir),ie(this,Mr),ie(this,ke,""),ie(this,gt,null),ie(this,ei,void 0),ie(this,ue,void 0),ie(this,zi,n=>{this.handleClick(n)}),ie(this,vt,n=>{let{key:s}=n;if(s==="Escape"){this.removeEventListener("keyup",S(this,vt));return}s==="Enter"||s===" "?this.handleSelection(n):this.handleMovement(n)}),ie(this,yr,n=>{let{metaKey:s,altKey:d}=n;if(s||d){this.removeEventListener("keyup",S(this,vt));return}n.preventDefault(),this.addEventListener("keyup",S(this,vt),{once:!0})});let t=this.attachShadow({mode:"open"}),a=Ds.content.cloneNode(!0);this.nativeEl=a;let r=e.slotTemplate;r||(r=u.createElement("template"),r.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),t.appendChild(a),Se(this,ei,this.shadowRoot.querySelector("slot")),S(this,ei).addEventListener("slotchange",()=>{Se(this,ue,S(this,ei).assignedElements()),S(this,ue).length===1&&S(this,ue)[0].nodeName.toLowerCase()==="slot"&&Se(this,ue,S(this,ue)[0].assignedElements());let n=S(this,Ge,At);if(n.some(c=>c.getAttribute("tabindex")==="0"))return;let d=n.filter(c=>c.getAttribute("aria-selected")==="true")[0];d||(d=n[0]),d&&(d.setAttribute("tabindex",0),d.setAttribute("aria-selected","true"))})}static get observedAttributes(){return["disabled",p.MEDIA_CONTROLLER]}get selectedOptions(){return S(this,Ge,At).filter(e=>e.getAttribute("aria-selected")==="true")}focus(){var e;(e=this.selectedOptions[0])==null||e.focus()}enable(){this.addEventListener("click",S(this,zi)),this.addEventListener("keydown",S(this,yr))}disable(){this.removeEventListener("click",S(this,zi)),this.removeEventListener("keyup",S(this,vt))}attributeChangedCallback(e,t,a){var r,n;if(e===p.MEDIA_CONTROLLER){if(t){let s=u.getElementById(t);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=u.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}else e==="disabled"&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){var e;this.hasAttribute("disabled")||this.enable(),this.hasAttribute("role")||this.setAttribute("role","listbox");let t=this.getAttribute(p.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.associateElement)==null||e.call(a,this)}}disconnectedCallback(){var e;this.disable();let t=this.getAttribute(p.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.unassociateElement)==null||e.call(a,this)}}get keysUsed(){return["Enter"," ","ArrowDown","ArrowUp","Home","End"]}handleSelection(e){let t=jt(this,ti,Xi).call(this,e);if(!t)return;let a=t.getAttribute("aria-selected")==="true";this.getAttribute("aria-multiselectable")!=="true"&&S(this,ue).forEach(r=>r.setAttribute("aria-selected","false")),a?t.setAttribute("aria-selected","false"):t.setAttribute("aria-selected","true"),this.dispatchEvent(new Event("change"))}handleMovement(e){let{key:t}=e,a=S(this,Ge,At),r=jt(this,ti,Xi).call(this,e);r||(r=a.filter(s=>s.getAttribute("tabindex")==="0")[0]);let n;switch(t){case"ArrowDown":n=r.nextElementSibling,n!=null&&n.hasAttribute("disabled")&&(n=n.nextElementSibling);break;case"ArrowUp":n=r.previousElementSibling,n!=null&&n.hasAttribute("disabled")&&(n=n.previousElementSibling);break;case"Home":n=a[0];break;case"End":n=a[a.length-1];break;default:n=jt(this,Ir,ws).call(this,t);break}n&&(a.forEach(s=>s.setAttribute("tabindex","-1")),n.setAttribute("tabindex","0"),n.focus())}handleClick(e){let t=jt(this,ti,Xi).call(this,e);!t||t.hasAttribute("disabled")||(S(this,Ge,At).forEach(a=>a.setAttribute("tabindex","-1")),t.setAttribute("tabindex","0"),this.handleSelection(e))}};ke=new WeakMap;gt=new WeakMap;ei=new WeakMap;ue=new WeakMap;Ge=new WeakSet;At=function(){return S(this,ue).filter(i=>!i.hasAttribute("disabled"))};zi=new WeakMap;vt=new WeakMap;yr=new WeakMap;ti=new WeakSet;Xi=function(i){if(i.target===this)return;let e=i.composedPath(),t=e.findIndex(a=>a.nodeName==="MEDIA-CHROME-LISTITEM");return e[t]};Ir=new WeakSet;ws=function(i){jt(this,Mr,xs).call(this);let e=S(this,Ge,At),t=e.findIndex(m=>m.getAttribute("tabindex")==="0");Se(this,ke,S(this,ke)+i);let a=S(this,ke).split("").every(m=>m===i),r=e.slice(t+(a?1:0)).filter(m=>m.textContent.toLowerCase().startsWith(S(this,ke))),n=e.slice(0,t-(a?1:0)).filter(m=>m.textContent.toLowerCase().startsWith(S(this,ke))),s=[],d=[];return a&&(s=e.slice(t+(a?1:0)).filter(m=>m.textContent.startsWith(i)),d=e.slice(0,t-(a?1:0)).filter(m=>m.textContent.startsWith(i))),[...r,...n,...s,...d][0]};Mr=new WeakSet;xs=function(){l.clearTimeout(S(this,gt)),Se(this,gt,null),Se(this,gt,l.setTimeout(()=>{Se(this,ke,""),Se(this,gt,null)},500))};l.customElements.get("media-chrome-listbox")||l.customElements.define("media-chrome-listbox",Ji);var Rs=Ji;var Lr=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},T=(i,e,t)=>(Lr(i,e,"read from private field"),t?t.call(i):e.get(i)),se=(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)},Ze=(i,e,t,a)=>(Lr(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),_t=(i,e,t)=>(Lr(i,e,"access private method"),t),ji,qe,me,q,Ce,ii,kr,Os,Sr,Ps,ta,wr,ea,xr,Us=u.createElement("template");Us.innerHTML=`
801
+ <style>
802
+ :host {
803
+ display: inline-block;
804
+ }
805
+
806
+ media-chrome-button:not(:focus-visible) {
807
+ outline: none;
808
+ }
809
+ </style>
810
+
811
+ <media-chrome-button aria-haspopup="listbox">
812
+ <slot name="button-content"></slot>
813
+ </media-chrome-button>
814
+ <slot name="listbox" hidden>
815
+ <media-chrome-listbox id="listbox" part="listbox">
816
+ <slot></slot>
817
+ </media-chrome-listbox>
818
+ </slot>
819
+ `;var Cr=class extends l.HTMLElement{constructor(){super(),se(this,kr),se(this,Sr),se(this,ta),se(this,ea),se(this,ji,void 0),se(this,qe,void 0),se(this,me,void 0),se(this,q,void 0),se(this,Ce,void 0),se(this,ii,!1);let e=this.attachShadow({mode:"open"}),t=Us.content.cloneNode(!0);this.nativeEl=t,e.appendChild(t),Ze(this,ji,_t(this,kr,Os).bind(this)),Ze(this,qe,_t(this,Sr,Ps).bind(this)),Ze(this,me,this.shadowRoot.querySelector("media-chrome-button")),Ze(this,q,this.shadowRoot.querySelector("media-chrome-listbox")),Ze(this,Ce,this.shadowRoot.querySelector("slot[name=listbox]")),T(this,Ce).addEventListener("slotchange",()=>{T(this,q).removeEventListener("change",T(this,qe)),Ze(this,q,T(this,Ce).assignedElements()[0]||T(this,q)),T(this,q).addEventListener("change",T(this,qe))})}static get observedAttributes(){return["disabled",p.MEDIA_CONTROLLER]}enable(){T(this,me).removeAttribute("disabled"),T(this,me).handleClick=T(this,ji),_t(this,ea,xr).call(this),T(this,q).addEventListener("change",T(this,qe))}disable(){T(this,me).setAttribute("disabled",""),T(this,me).handleClick=()=>{},T(this,q).addEventListener("change",T(this,qe))}attributeChangedCallback(e,t,a){var r,n;if(e===p.MEDIA_CONTROLLER){if(t){let s=u.getElementById(t);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this),T(this,q).removeAttribute(p.MEDIA_CONTROLLER)}if(a){let s=u.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this),T(this,q).setAttribute(p.MEDIA_CONTROLLER,a)}}else e==="disabled"&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){var e;this.hasAttribute("disabled")||this.enable();let t=this.getAttribute(p.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.associateElement)==null||e.call(a,this),T(this,q).setAttribute(p.MEDIA_CONTROLLER,t)}}disconnectedCallback(){var e;this.disable();let t=this.getAttribute(p.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.unassociateElement)==null||e.call(a,this),T(this,q).removeAttribute(p.MEDIA_CONTROLLER)}}};ji=new WeakMap;qe=new WeakMap;me=new WeakMap;q=new WeakMap;Ce=new WeakMap;ii=new WeakMap;kr=new WeakSet;Os=function(){_t(this,ta,wr).call(this)};Sr=new WeakSet;Ps=function(){_t(this,ta,wr).call(this)};ta=new WeakSet;wr=function(){T(this,Ce).hidden=!T(this,Ce).hidden,_t(this,ea,xr).call(this),T(this,Ce).hidden?T(this,me).focus():T(this,q).focus()};ea=new WeakSet;xr=function(){T(this,me).setAttribute("aria-expanded",T(this,ii)),Ze(this,ii,!T(this,ii))};l.customElements.get("media-chrome-menu-button")||l.customElements.define("media-chrome-menu-button",Cr);var Ns=u.createElement("template");Ns.innerHTML=`
820
+ <style>
821
+ :host {
822
+ display: list-item;
823
+ line-height: 1em;
824
+ padding: 0.5em;
825
+ margin: 0em;
826
+ cursor: pointer;
827
+ }
828
+
829
+ ::slotted:not(:focus-visible) {
830
+ outline: none;
831
+ }
832
+ </style>
833
+ <li>
834
+ <slot></slot>
835
+ </li>
836
+ `;var Dr=class extends l.HTMLElement{static get observedAttributes(){return["disabled","aria-selected","value",p.MEDIA_CONTROLLER]}constructor(){super();let e=this.attachShadow({mode:"open"}),t=Ns.content.cloneNode(!0);this.nativeEl=t,e.appendChild(t)}set value(e){this.setAttribute("value",e)}get value(){return this.getAttribute("value")}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){var r,n;if(e===p.MEDIA_CONTROLLER){if(t){let s=u.getElementById(t);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=u.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}else e==="disabled"&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){var e;this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","option");let t=this.getAttribute(p.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.associateElement)==null||e.call(a,this)}}disconnectedCallback(){var e;this.disable();let t=this.getAttribute(p.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.unassociateElement)==null||e.call(a,this)}}handleClick(){}};l.customElements.get("media-chrome-listitem")||l.customElements.define("media-chrome-listitem",Dr);var Nr=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},H=(i,e,t)=>(Nr(i,e,"read from private field"),t?t.call(i):e.get(i)),Le=(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)},we=(i,e,t,a)=>(Nr(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ae=(i,e,t)=>(Nr(i,e,"access private method"),t),It,Tt,he,J,ia,Rr,ra,Or,Qe,yt,aa,Pr,Hs=`
837
+ fill: var(--media-icon-color, #eee);
838
+ height: var(--media-captions-indicator-height, 1em);
839
+ vertical-align: var(--media-captions-indicator-vertical-align, bottom);
840
+ margin-inline-start: 1ch;
841
+ `,jl=`
842
+ <svg style="${Hs}" aria-hidden="true" viewBox="0 0 26 24">
843
+ <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"/>
844
+ </svg>`,$s=u.createElement("template");$s.innerHTML=`
845
+ <slot hidden name="captions-indicator">${jl}</slot>
846
+ `;var Bs=(i,e)=>i.label===e.label&&i.language===e.language,Ur=class extends Rs{constructor(){super({slotTemplate:$s}),Le(this,ia),Le(this,ra),Le(this,Qe),Le(this,aa),Le(this,It,[]),Le(this,Tt,[]),Le(this,he,void 0),Le(this,J,void 0);let e=u.createElement("media-chrome-listitem");e.value="off",e.textContent="Off",we(this,he,e);let t=this.shadowRoot.querySelector('[name="captions-indicator"]');we(this,J,t.firstElementChild),t.addEventListener("slotchange",()=>{let a=t.assignedElements();if(a.length===1&&a[0].nodeName.toLowerCase()==="slot"){let r=a[0].assignedElements();r.length===0?we(this,J,a[0].firstElementChild):r.length===1&&we(this,J,r[0])}H(this,J)||we(this,J,t.firstElementChild),we(this,J,H(this,J).cloneNode(!0)),H(this,J).removeAttribute("slot"),H(this,J).setAttribute("style",Hs)})}static get observedAttributes(){return[...super.observedAttributes,"aria-multiselectable",o.MEDIA_CAPTIONS_LIST,o.MEDIA_CAPTIONS_SHOWING,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,t,a){if(e===o.MEDIA_SUBTITLES_LIST&&t!==a)we(this,It,ae(this,ia,Rr).call(this,a,H(this,It))),ae(this,Qe,yt).call(this);else if(e===o.MEDIA_CAPTIONS_LIST&&t!==a)we(this,Tt,ae(this,ia,Rr).call(this,a,H(this,Tt))),ae(this,Qe,yt).call(this);else if(e===o.MEDIA_SUBTITLES_SHOWING&&t!==a){let r=Nt(a!=null?a:"")[0];H(this,It).forEach(n=>{n.selected=n.language===r.language&&n.label===r.label}),ae(this,Qe,yt).call(this)}else if(e===o.MEDIA_CAPTIONS_SHOWING&&t!==a){let r=Nt(a!=null?a:"")[0];H(this,Tt).forEach(n=>{n.selected=n.language===r.language&&n.label===r.label}),ae(this,Qe,yt).call(this)}else e==="aria-multiselectable"&&(this.removeAttribute("aria-multiselectable"),console.warn("Captions List doesn't currently support multiple selections. You can enable multiple items via the media.textTrack API."));super.attributeChangedCallback(e,t,a)}connectedCallback(){ae(this,Qe,yt).call(this),this.addEventListener("change",ae(this,aa,Pr)),super.connectedCallback()}disconnectedCallback(){this.removeEventListener("change",ae(this,aa,Pr)),super.disconnectedCallback()}};It=new WeakMap;Tt=new WeakMap;he=new WeakMap;J=new WeakMap;ia=new WeakSet;Rr=function(i,e){let t=i?Nt(i!=null?i:""):[],a=[],r=[];return e.forEach(n=>{t.some(s=>Bs(s,n))||a.push(n)}),t.forEach(n=>{e.some(s=>Bs(s,n))||r.push(n)}),a.forEach(n=>n.el.remove()),e.filter(n=>!a.includes(n)).concat(r)};ra=new WeakSet;Or=function(i,e){i.forEach(t=>{let a=t.el,r=!0;a||(a=u.createElement("media-chrome-listitem"),r=!1,a.value=e+"!"+Ba(t),a.textContent=t.label,e==="cc"&&a.append(H(this,J).cloneNode(!0))),t.selected?a.setAttribute("aria-selected","true"):a.setAttribute("aria-selected","false"),r||(this.append(a),t.el=a)})};Qe=new WeakSet;yt=function(){this.contains(H(this,he))||this.append(H(this,he)),!this.hasAttribute(o.MEDIA_CAPTIONS_SHOWING)&&!this.hasAttribute(o.MEDIA_SUBTITLES_SHOWING)?(H(this,he).setAttribute("aria-selected","true"),H(this,he).setAttribute("tabindex","0")):(H(this,he).setAttribute("aria-selected","false"),H(this,he).setAttribute("tabindex","-1")),ae(this,ra,Or).call(this,H(this,Tt),"cc"),ae(this,ra,Or).call(this,H(this,It),"subs")};aa=new WeakSet;Pr=function(){var i,e,t;let[a,r]=(t=(e=(i=this.selectedOptions[0])==null?void 0:i.value)==null?void 0:e.split("!"))!=null?t:[];if(ye(this),!r)return;let n=new l.CustomEvent(a==="cc"?h.MEDIA_SHOW_CAPTIONS_REQUEST:h.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)};l.customElements.get("media-captions-listbox")||l.customElements.define("media-captions-listbox",Ur);var Vr=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},O=(i,e,t)=>(Vr(i,e,"read from private field"),t?t.call(i):e.get(i)),pe=(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)},ai=(i,e,t,a)=>(Vr(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Mt=(i,e,t)=>(Vr(i,e,"access private method"),t),xe,ze,kt,oe,ri,Br,Vs,Fr,Fs,na,Hr,sa,$r,Ws=`
847
+ <svg aria-hidden="true" viewBox="0 0 26 24">
848
+ <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"/>
849
+ </svg>`,ed=`
850
+ <svg aria-hidden="true" viewBox="0 0 26 24">
851
+ <path d="M17.73 14.09a1.4 1.4 0 0 1-1 .37 1.579 1.579 0 0 1-1.27-.58A3 3 0 0 1 15 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34A2.89 2.89 0 0 0 19 9.07a3 3 0 0 0-2.14-.78 3.14 3.14 0 0 0-2.42 1 3.91 3.91 0 0 0-.93 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.17 3.17 0 0 0 1.07-1.74l-1.4-.45c-.083.43-.3.822-.62 1.12Zm-7.22 0a1.43 1.43 0 0 1-1 .37 1.58 1.58 0 0 1-1.27-.58A3 3 0 0 1 7.76 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34a2.81 2.81 0 0 0-.74-1.32 2.94 2.94 0 0 0-2.13-.78 3.18 3.18 0 0 0-2.43 1 4 4 0 0 0-.92 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.23 3.23 0 0 0 1.07-1.74l-1.4-.45a2.06 2.06 0 0 1-.6 1.07Zm12.32-8.41a2.59 2.59 0 0 0-2.3-2.51C18.72 3.05 15.86 3 13 3c-2.86 0-5.72.05-7.53.17a2.59 2.59 0 0 0-2.3 2.51c-.23 4.207-.23 8.423 0 12.63a2.57 2.57 0 0 0 2.3 2.5c1.81.13 4.67.19 7.53.19 2.86 0 5.72-.06 7.53-.19a2.57 2.57 0 0 0 2.3-2.5c.23-4.207.23-8.423 0-12.63Zm-1.49 12.53a1.11 1.11 0 0 1-.91 1.11c-1.67.11-4.45.18-7.43.18-2.98 0-5.76-.07-7.43-.18a1.11 1.11 0 0 1-.91-1.11c-.21-4.14-.21-8.29 0-12.43a1.11 1.11 0 0 1 .91-1.11C7.24 4.56 10 4.49 13 4.49s5.76.07 7.43.18a1.11 1.11 0 0 1 .91 1.11c.21 4.14.21 8.29 0 12.43Z"/>
852
+ </svg>`,Ks=u.createElement("template");Ks.innerHTML=`
853
+ <style>
854
+ :host,
855
+ media-chrome-menu-button {
856
+ display: contents;
857
+ fill: var(--media-icon-color, #eee);
858
+ }
859
+
860
+ media-captions-listbox {
861
+ position: absolute;
862
+ bottom: 44px;
863
+ max-height: 300px;
864
+ overflow: auto;
865
+ }
866
+ :host([media-controller]) media-captions-listbox {
867
+ z-index: 1;
868
+ bottom: unset;
869
+ }
870
+
871
+ /* copied from media-chrome-button */
872
+ media-chrome-menu-button slot svg {
873
+ width: var(--media-button-icon-width);
874
+ height: var(--media-button-icon-height, var(--media-control-height, 24px));
875
+ transform: var(--media-button-icon-transform);
876
+ transition: var(--media-button-icon-transition);
877
+ fill: var(--media-icon-color, #eee);
878
+ vertical-align: middle;
879
+ max-width: 100%;
880
+ max-height: 100%;
881
+ min-width: 100%;
882
+ }
883
+ </style>
884
+
885
+ <media-chrome-menu-button aria-label="captions menu button">
886
+ <slot slot="button-content" class="enabled" name="on">${Ws}</slot>
887
+ <slot slot="button-content" class="disabled" name="off" hidden>${ed}</slot>
888
+ <media-captions-listbox slot="listbox" part="listbox">
889
+ <slot slot="captions-indicator" name="captions-indicator">${Ws}</slot>
890
+ </media-captions-listbox>
891
+ </media-chrome-menu-button>
892
+ `;var Wr=class extends l.HTMLElement{constructor(){super(),pe(this,Br),pe(this,Fr),pe(this,na),pe(this,sa),pe(this,xe,void 0),pe(this,ze,void 0),pe(this,kt,void 0),pe(this,oe,void 0),pe(this,ri,void 0);let e=this.attachShadow({mode:"open"}),t=Ks.content.cloneNode(!0);this.nativeEl=t,e.append(t),ai(this,xe,this.shadowRoot.querySelector("media-chrome-menu-button")),ai(this,ze,O(this,xe).querySelector(".enabled")),ai(this,kt,O(this,xe).querySelector(".disabled")),ai(this,oe,O(this,xe).querySelector("media-captions-listbox")),ai(this,ri,Mt(this,Br,Vs).bind(this)),this._captionsReady=!1,Mt(this,sa,$r).call(this)}static get observedAttributes(){return["disabled",p.MEDIA_CONTROLLER,"no-subtitles-fallback","default-showing",o.MEDIA_CAPTIONS_LIST,o.MEDIA_CAPTIONS_SHOWING,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,t,a){var r,n;if(e===p.MEDIA_CONTROLLER){if(t){let s=u.getElementById(t);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=u.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}else e===o.MEDIA_CAPTIONS_SHOWING||e===o.MEDIA_SUBTITLES_SHOWING&&a!==t?a?Mt(this,na,Hr).call(this):Mt(this,sa,$r).call(this):e==="disabled"&&a!==t&&(a==null?this.enable():this.disable());if(this.hasAttribute("default-showing")&&O(this,ze).hidden){let s=!this.hasAttribute("no-subtitles-fallback");if((s?[o.MEDIA_CAPTIONS_LIST,o.MEDIA_SUBTITLES_LIST]:[o.MEDIA_CAPTIONS_LIST]).includes(e)){let c=!!this.getAttribute(o.MEDIA_CAPTIONS_LIST)||!!(s&&this.getAttribute(o.MEDIA_SUBTITLES_LIST));this._captionsReady!==c&&(this._captionsReady=c,this._captionsReady&&ye(this))}}}enable(){this.addEventListener("click",O(this,ri)),O(this,xe).removeAttribute("disabled")}disable(){this.removeEventListener("click",O(this,ri)),O(this,xe).setAttribute("disabled","")}connectedCallback(){var e;this.hasAttribute("disabled")||this.enable(),Ht(this)&&Mt(this,na,Hr).call(this);let t=this.getAttribute(p.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.associateElement)==null||e.call(a,this)}}disconnectedCallback(){var e;this.disable();let t=this.getAttribute(p.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.unassociateElement)==null||e.call(a,this)}}get keysUsed(){return["Enter"," ","ArrowUp","ArrowDown","f","c","k","m"]}};xe=new WeakMap;ze=new WeakMap;kt=new WeakMap;oe=new WeakMap;ri=new WeakMap;Br=new WeakSet;Vs=function(){Mt(this,Fr,Fs).call(this)};Fr=new WeakSet;Fs=function(){var i,e,t;if(O(this,oe).offsetWidth===0)return;let a=this.shadowRoot.querySelectorAll("svg"),r=((i=O(this,ze).assignedElements()[0])!=null?i:a[0]).getBoundingClientRect(),n=((e=O(this,kt).assignedElements()[0])!=null?e:a[1]).getBoundingClientRect();if(this.hasAttribute("media-controller")){let s=r.width,d=n.width,c=s>0?s:d>0?d:0,m=r.height,b=n.height,y=m>0?m:b>0?b:0;O(this,oe).style.marginLeft=`calc(-${c}px - 10px * 2)`,O(this,oe).style.marginTop=`calc(${y}px + 10px * 2)`}else{let s=r.x,d=n.x,c=s>0?s:d>0?d:0,m=(t=this.getAttribute("bounds")?Fe(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?t:this,b=m.getBoundingClientRect().x;O(this,oe).offsetWidth+c-b>m.offsetWidth?O(this,oe).style.translate=m.offsetWidth-O(this,oe).offsetWidth+"px":O(this,oe).style.translate=`calc(${c}px - ${b}px - 10px)`}};na=new WeakSet;Hr=function(){O(this,ze).hidden=!1,O(this,kt).hidden=!0};sa=new WeakSet;$r=function(){O(this,ze).hidden=!0,O(this,kt).hidden=!1};l.customElements.get("media-captions-menu-button")||l.customElements.define("media-captions-menu-button",Wr);var v=Vo(require("@mux/mux-video")),x=require("@mux/playback-core");var eo=require("@mux/mux-video");var td="en",Xe={code:td};var Ys="en";function _(i,e=!0){var r,n;let t=e&&(n=(r=Xe)==null?void 0:r[i])!=null?n:i,a=e?Xe.code:Ys;return new Kr(t,a)}var Kr=class{constructor(e,t=(a=>(a=Xe.code)!=null?a:Ys)()){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 Gs(i){let e="";return Object.entries(i).forEach(([t,a])=>{a!=null&&(e+=`${id(t)}: ${a}; `)}),e?e.trim():void 0}function id(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Zs(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 oa(i){let e=ad(i).toString();return e?"?"+e:""}function ad(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}function De(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 Yr=(i,e)=>!i||!e?!1:i.contains(e)?!0:Yr(i,e.getRootNode().host);var Gr="mux.com",rd=()=>{try{return"1.7.0"}catch{}return"UNKNOWN"},nd=rd(),da=()=>nd,Zr=(i,{token:e,domain:t=Gr}={})=>`https://stream.${t}/${i}.m3u8${oa(!!e?{token:e}:{redundant_streams:!0})}`,qs=(i,{token:e,thumbnailTime:t,domain:a=Gr}={})=>{let r=e==null?t:void 0,{aud:n}=De(e);if(!(e&&n!=="t"))return`https://image.${a}/${i}/thumbnail.webp${oa({token:e,time:r})}`},Qs=(i,{token:e,domain:t=Gr}={})=>{let{aud:a}=De(e);if(!(e&&a!=="s"))return`https://image.${t}/${i}/storyboard.vtt${oa({token:e,format:"webp"})}`};var sd={crossorigin:"crossOrigin",playsinline:"playsInline"};function zs(i){var e;return(e=sd[i])!=null?e:Zs(i)}var Je,je,K,la=class{constructor(e,t){L(this,Je,void 0);L(this,je,void 0);L(this,K,[]);G(this,Je,e),G(this,je,t)}[Symbol.iterator](){return A(this,K).values()}get length(){return A(this,K).length}get value(){var e;return(e=A(this,K).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(G(this,K,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return A(this,K)[e]}values(){return A(this,K).values()}keys(){return A(this,K).keys()}forEach(e){A(this,K).forEach(e)}add(...e){var t,a;e.forEach(r=>{this.contains(r)||A(this,K).push(r)}),!(this.value===""&&!((t=A(this,Je))!=null&&t.hasAttribute(`${A(this,je)}`)))&&((a=A(this,Je))==null||a.setAttribute(`${A(this,je)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>{A(this,K).splice(A(this,K).indexOf(a),1)}),(t=A(this,Je))==null||t.setAttribute(`${A(this,je)}`,`${this.value}`)}contains(e){return A(this,K).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)}};Je=new WeakMap,je=new WeakMap,K=new WeakMap;var Xs=`[mux-player ${da()}]`;function Re(...i){console.warn(Xs,...i)}function re(...i){console.error(Xs,...i)}function ca(i){var t;let e=(t=i.message)!=null?t:"";if(i.file){let a="https://github.com/muxinc/elements/blob/main/errors/";e+=` ${_("Read more: ")}
893
+ ${a}${i.file}`}Re(e)}var V={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},et={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},js=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}}),od=eo.VideoEvents.filter(i=>i!=="error"),ld=Object.values(V).filter(i=>![V.PLAYSINLINE].includes(i)),dd=Object.values(et);function to(i){i.querySelectorAll(":scope > track").forEach(e=>{var t;(t=i.media)==null||t.append(e.cloneNode())}),od.forEach(e=>{var t;(t=i.media)==null||t.addEventListener(e,a=>{i.dispatchEvent(new Event(a.type))})})}var qr=class extends R.HTMLElement{static get observedAttributes(){return[...ld,...dd]}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,c;let s=(d=this.media)==null?void 0:d.querySelector(`track[src="${n.src}"]`);s&&((c=this.media)==null||c.removeChild(s))}),r.addedNodes.forEach(n=>{var s;(s=this.media)==null||s.append(n.cloneNode())}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(e,t,a){var r,n;switch(e){case et.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case et.VOLUME:{let s=(r=be(a))!=null?r:1;this.media&&(this.media.volume=s);return}case et.PLAYBACKRATE:{let s=(n=be(a))!=null?n:1;this.media&&(this.media.playbackRate=s,this.media.defaultPlaybackRate=s);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 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:js}get seekable(){var e,t;return(t=(e=this.media)==null?void 0:e.seekable)!=null?t:js}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(et.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(et.PLAYBACKRATE,`${e}`):this.removeAttribute(et.PLAYBACKRATE)}get crossOrigin(){return ni(this,V.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(V.CROSSORIGIN,`${e}`)}get autoplay(){return ni(this,V.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(V.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(V.AUTOPLAY)}get loop(){return ni(this,V.LOOP)!=null}set loop(e){e?this.setAttribute(V.LOOP,""):this.removeAttribute(V.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 ni(this,V.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(V.MUTED,""):this.removeAttribute(V.MUTED)}get playsInline(){return ni(this,V.PLAYSINLINE)!=null}set playsInline(e){re("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(V.PRELOAD,e):this.removeAttribute(V.PRELOAD)}};function ni(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var Qr=qr;var cd=Object.defineProperty,ud=(i,e,t)=>e in i?cd(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,md=(i,e,t)=>(ud(i,typeof e!="symbol"?e+"":e,t),t),so=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},g=(i,e,t)=>(so(i,e,"read from private field"),t?t.call(i):e.get(i)),le=(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)},Ee=(i,e,t,a)=>(so(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),St,ua,tt,si,Oe,Pe,Ue,it,Ct,ma,ne,io=1,ao=0,hd=1,pd={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 Y&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=n:typeof n=="function"&&r instanceof Y?r.element[r.attributeName]=n:r.value=n}}}},fe=class extends l.DocumentFragment{constructor(e,t,a=pd){var r;super(),le(this,St,void 0),le(this,ua,void 0),this.append(e.content.cloneNode(!0)),Ee(this,St,oo(this)),Ee(this,ua,a),(r=a.createCallback)==null||r.call(a,this,g(this,St),t),a.processCallback(this,g(this,St),t)}update(e){g(this,ua).processCallback(this,g(this,St),e)}};St=new WeakMap;ua=new WeakMap;var oo=(i,e=[])=>{let t,a;for(let r of i.attributes||[])if(r.value.includes("{{")){let n=new zr;for([t,a]of no(r.value))if(!t)n.append(a);else{let s=new Y(i,r.name,r.namespaceURI);n.append(s),e.push([a,s])}r.value=n.toString()}for(let r of i.childNodes)if(r.nodeType===io&&!(r instanceof HTMLTemplateElement))oo(r,e);else if(r.nodeType===io||r.data.includes("{{")){let n=[];if(r.data)for([t,a]of no(r.data))if(!t)n.push(new Text(a));else{let s=new ve(i);n.push(s),e.push([a,s])}else if(r instanceof HTMLTemplateElement){let s=new oi(i,r);n.push(s),e.push([s.expression,s])}r.replaceWith(...n.flatMap(s=>s.replacementNodes||[s]))}return e},ro={},no=i=>{let e="",t=0,a=ro[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([ao,e]),e="",r++):n==="}"&&i[r+1]==="}"&&i[r-1]!=="\\"&&!--t?(a.push([hd,e.trim()]),e="",r++):e+=n||"";return e&&a.push([ao,(t>0?"{{":"")+e]),ro[i]=a},bd=11,ha=class{get value(){return""}set value(e){}toString(){return this.value}},lo=new WeakMap,zr=class{constructor(){le(this,tt,[])}[Symbol.iterator](){return g(this,tt).values()}get length(){return g(this,tt).length}item(e){return g(this,tt)[e]}append(...e){for(let t of e)t instanceof Y&&lo.set(t,this),g(this,tt).push(t)}toString(){return g(this,tt).join("")}};tt=new WeakMap;var Y=class extends ha{constructor(e,t,a){super(),le(this,it),le(this,si,""),le(this,Oe,void 0),le(this,Pe,void 0),le(this,Ue,void 0),Ee(this,Oe,e),Ee(this,Pe,t),Ee(this,Ue,a)}get attributeName(){return g(this,Pe)}get attributeNamespace(){return g(this,Ue)}get element(){return g(this,Oe)}get value(){return g(this,si)}set value(e){g(this,si)!==e&&(Ee(this,si,e),!g(this,it,Ct)||g(this,it,Ct).length===1?e==null?g(this,Oe).removeAttributeNS(g(this,Ue),g(this,Pe)):g(this,Oe).setAttributeNS(g(this,Ue),g(this,Pe),e):g(this,Oe).setAttributeNS(g(this,Ue),g(this,Pe),g(this,it,Ct)))}get booleanValue(){return g(this,Oe).hasAttributeNS(g(this,Ue),g(this,Pe))}set booleanValue(e){if(!g(this,it,Ct)||g(this,it,Ct).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};si=new WeakMap;Oe=new WeakMap;Pe=new WeakMap;Ue=new WeakMap;it=new WeakSet;Ct=function(){return lo.get(this)};var ve=class extends ha{constructor(e,t){super(),le(this,ma,void 0),le(this,ne,void 0),Ee(this,ma,e),Ee(this,ne,t?[...t]:[new Text])}get replacementNodes(){return g(this,ne)}get parentNode(){return g(this,ma)}get nextSibling(){return g(this,ne)[g(this,ne).length-1].nextSibling}get previousSibling(){return g(this,ne)[0].previousSibling}get value(){return g(this,ne).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===bd?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);t.length||t.push(new Text),Ee(this,ne,Ed(g(this,ne)[0].parentNode,g(this,ne),t,this.nextSibling))}};ma=new WeakMap;ne=new WeakMap;var oi=class extends ve{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),md(this,"directive"),this.expression=r,this.template=t,this.directive=a}};function Ed(i,e,t,a=null){let r=0,n,s,d,c=t.length,m=e.length;for(;r<c&&r<m&&e[r]==t[r];)r++;for(;r<c&&r<m&&t[c-1]==e[m-1];)a=t[--m,--c];if(r==m)for(;r<c;)i.insertBefore(t[r++],a);if(r==c)for(;r<m;)i.removeChild(e[r++]);else{for(n=e[r];r<c;)d=t[r++],s=n?n.nextSibling:a,n==d?n=s:r<c&&t[r]==s?(i.replaceChild(d,n),n=s):i.insertBefore(d,n);for(;n!=a;)s=n.nextSibling,i.removeChild(n),n=s}return t}var fd=/([>&])?\s*(\w+)\s*(.*)/,vd=/^(\?\?|\|)?\s*(['"\w]*)/,gd={"|":{string:i=>String(i)},"??":(i,e)=>i!=null?i:e},pa=class{constructor(e){this.template=e}},at=new WeakMap,rt=new WeakMap,Jr={partial:(i,e)=>{e[i.expression]=new pa(i.template)},if:(i,e)=>{var t;if(yd(i.expression,e))if(at.get(i)!==i.template){at.set(i,i.template);let a=new fe(i.template,e,ba);i.replace(a),rt.set(i,a)}else(t=rt.get(i))==null||t.update(e);else i.replace(""),at.delete(i),rt.delete(i)}},Ad=Object.keys(Jr),ba={processCallback(i,e,t){var a,r,n,s;if(!!t)for(let[d,c]of e){if(c instanceof oi){if(!c.directive){let M=Ad.find(k=>c.template.hasAttribute(k));M&&(c.directive=M,c.expression=c.template.getAttribute(M))}(a=Jr[c.directive])==null||a.call(Jr,c,t);continue}let[,m,b,y]=(r=d.match(fd))!=null?r:[],f=t[b],[,I,B]=(n=y.match(vd))!=null?n:[],D=gd[I];if(typeof D=="function")f=D(f,li(B,t));else if(D&&f!=null){let M=D[B];M&&(f=M(f))}if(f){if(f instanceof pa){if(m!==">")continue;let M={...t},k=d.matchAll(/(\w+)\s*=\s*(['"\w]*)/g);for(let[,j,Q]of k)M[j]=li(Q,t);at.get(c)!==f.template?(at.set(c,f.template),f=new fe(f.template,M,ba),c.value=f,rt.set(c,f)):(s=rt.get(c))==null||s.update(M);continue}c instanceof Y&&c.attributeName.startsWith("aria-")&&(f=String(f)),c instanceof Y?typeof f=="boolean"?c.booleanValue=f:typeof f=="function"?c.element[c.attributeName]=f:c.value=f:(c.value=f,at.delete(c),rt.delete(c))}else c instanceof Y?c.booleanValue=!1:(c.value=void 0,at.delete(c),rt.delete(c))}}},_d={"==":(i,e)=>i==e,"!=":(i,e)=>i!=e,">":(i,e)=>i>e,">=":(i,e)=>i>=e,"<":(i,e)=>i<e,"<=":(i,e)=>i<=e};function yd(i,e){var t;let a=Id(i,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><]=|[><]/,ws:/\s+/,param:/[$a-z_][$\w]*/i});if(a.length===0||a.some(({type:n})=>!n))return console.warn(`Warning: invalid expression \`${i}\``),!1;if(a.length===1)return Xr(a[0])?li(a[0].token,e):(console.warn(`Warning: invalid expression \`${i}\``),!1);let r=a.filter(({type:n})=>n!=="ws");if(r.length===3){let n=_d[(t=r[1])==null?void 0:t.token];return!n||!Xr(r[0])||!Xr(r[2])?(console.warn(`Warning: invalid expression \`${i}\``),!1):n(li(r[0].token,e),li(r[2].token,e))}}function Xr({type:i}){return["number","boolean","string","param"].includes(i)}function li(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):An(i)?parseFloat(i):e[i]}function Id(i,e){let t,a,r,n=[];for(;i;){r=null,t=i.length;for(let s in e)a=e[s].exec(i),a&&a.index<t&&(r={token:a[0],type:s,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 Td=Object.defineProperty,Md=(i,e,t)=>e in i?Td(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,di=(i,e,t)=>(Md(i,typeof e!="symbol"?e+"":e,t),t),ho=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},co=(i,e,t)=>(ho(i,e,"read from private field"),t?t.call(i):e.get(i)),uo=(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)},mo=(i,e,t,a)=>(ho(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ea,fa,jr={"media-target-live-window":"targetLiveWindow","media-stream-type":"streamType"},Lt=class extends l.HTMLElement{constructor(){super(),di(this,"renderRoot"),di(this,"renderer"),uo(this,Ea,void 0),uo(this,fa,void 0),this.renderRoot=this.attachShadow({mode:"open"});let e=new MutationObserver(t=>{t.some(a=>{let r=a.target;return r===this?!0:r.localName!=="media-controller"?!1:!!(jr[a.attributeName]||a.attributeName.startsWith("breakpoint-"))})&&this.render()});e.observe(this,{attributes:!0}),e.observe(this.renderRoot,{attributes:!0,subtree:!0}),this.createRenderer()}get mediaController(){return this.renderRoot.querySelector("media-controller")}get template(){var e,t;let a=this.getAttribute("template");if(a){let r=(e=this.getRootNode())==null?void 0:e.getElementById(a);if(r)return r}return(t=co(this,Ea))!=null?t:this.constructor.template}set template(e){mo(this,Ea,e),this.createRenderer()}get props(){var e,t,a;let r=[...Array.from((t=(e=this.mediaController)==null?void 0:e.attributes)!=null?t:[]).filter(({name:s})=>jr[s]||s.startsWith("breakpoint-")),...Array.from(this.attributes)],n={};for(let s of r){let d=(a=jr[s.name])!=null?a:vn(s.name);s.value!=null?n[d]=s.value===""?!0:s.value:n[d]=!1}return n}attributeChangedCallback(e,t,a){e==="template"&&t!=a&&this.createRenderer()}createRenderer(){this.template&&this.template!==co(this,fa)&&(mo(this,fa,this.template),this.renderer=new fe(this.template,this.props,this.constructor.processor),this.renderRoot.textContent="",this.renderRoot.append(this.renderer))}render(){var e;(e=this.renderer)==null||e.update(this.props)}};Ea=new WeakMap;fa=new WeakMap;di(Lt,"template");di(Lt,"observedAttributes",["template"]);di(Lt,"processor",ba);l.customElements.get("media-theme")||l.customElements.define("media-theme",Lt);var bo=`
742
894
  :host {
743
895
  cursor: pointer;
744
896
  }
745
897
  media-time-display {
746
898
  color: inherit;
747
899
  }
748
- `,Wn=H.createElement("template");Wn.innerHTML=`
900
+ `,Eo=F.createElement("template");Eo.innerHTML=`
749
901
  <style>
750
- ${Hn}
902
+ ${bo}
751
903
  </style>
752
904
  <media-time-display show-duration></media-time-display>
753
- `;var Vn=["Enter"," "],_t,qe,vi,Ze=class extends D.HTMLElement{constructor(){var t,a;super();I(this,qe);I(this,_t,void 0);this.attachShadow({mode:"open"}),(t=this.shadowRoot)==null||t.appendChild(this.constructor.template.content.cloneNode(!0)),this.timeDisplayEl=(a=this.shadowRoot)==null?void 0:a.querySelector("media-time-display")}static get observedAttributes(){return["hide-duration","remaining","disabled","aria-disabled"]}toggleTimeDisplay(){var t,a,r;(t=this.timeDisplayEl)!=null&&t.hasAttribute("remaining")?(a=this.timeDisplayEl)==null||a.removeAttribute("remaining"):(r=this.timeDisplayEl)==null||r.setAttribute("remaining","")}connectedCallback(){let t=a=>{let{key:r}=a;if(!Vn.includes(r)){this.removeEventListener("keyup",t);return}this.toggleTimeDisplay()};this.addEventListener("keydown",a=>{let{metaKey:r,altKey:n,key:s}=a;if(r||n||!Vn.includes(s)){this.removeEventListener("keyup",t);return}this.addEventListener("keyup",t)}),this.addEventListener("click",this.toggleTimeDisplay),V(this,_t,setInterval(S(this,qe,vi).bind(this),200)),requestAnimationFrame(()=>S(this,qe,vi).call(this))}disconnectedCallback(){clearInterval(v(this,_t))}attributeChangedCallback(t,a,r){var n,s;t==="hide-duration"&&S(this,qe,vi).call(this),["remaining","disabled","aria-disabled"].includes(t)&&a!==r&&(r==null?(n=this.timeDisplayEl)==null||n.removeAttribute(t):(s=this.timeDisplayEl)==null||s.setAttribute(t,r))}};_t=new WeakMap,qe=new WeakSet,vi=function(){var a,r,n,s;getComputedStyle(this).getPropertyValue("--media-duration-display").trim()==="none"||this.getAttribute("hide-duration")!=null?(a=this.timeDisplayEl)!=null&&a.hasAttribute("show-duration")&&((r=this.timeDisplayEl)==null||r.removeAttribute("show-duration")):(n=this.timeDisplayEl)!=null&&n.hasAttribute("show-duration")||(s=this.timeDisplayEl)==null||s.setAttribute("show-duration","")},Ze.styles=Hn,Ze.template=Wn;D.customElements.get("mxp-time-display")||(D.customElements.define("mxp-time-display",Ze),D.MxpTimeDisplay=Ze);var Fn=`:host {
905
+ `;var po=["Enter"," "],ci,xt,va,wt=class extends R.HTMLElement{constructor(){var t,a;super();L(this,xt);L(this,ci,void 0);this.attachShadow({mode:"open"}),(t=this.shadowRoot)==null||t.appendChild(this.constructor.template.content.cloneNode(!0)),this.timeDisplayEl=(a=this.shadowRoot)==null?void 0:a.querySelector("media-time-display")}static get observedAttributes(){return["hide-duration","remaining","disabled","aria-disabled"]}toggleTimeDisplay(){var t,a,r;(t=this.timeDisplayEl)!=null&&t.hasAttribute("remaining")?(a=this.timeDisplayEl)==null||a.removeAttribute("remaining"):(r=this.timeDisplayEl)==null||r.setAttribute("remaining","")}connectedCallback(){let t=a=>{let{key:r}=a;if(!po.includes(r)){this.removeEventListener("keyup",t);return}this.toggleTimeDisplay()};this.addEventListener("keydown",a=>{let{metaKey:r,altKey:n,key:s}=a;if(r||n||!po.includes(s)){this.removeEventListener("keyup",t);return}this.addEventListener("keyup",t)}),this.addEventListener("click",this.toggleTimeDisplay),G(this,ci,setInterval(P(this,xt,va).bind(this),200)),requestAnimationFrame(()=>P(this,xt,va).call(this))}disconnectedCallback(){clearInterval(A(this,ci))}attributeChangedCallback(t,a,r){var n,s;t==="hide-duration"&&P(this,xt,va).call(this),["remaining","disabled","aria-disabled"].includes(t)&&a!==r&&(r==null?(n=this.timeDisplayEl)==null||n.removeAttribute(t):(s=this.timeDisplayEl)==null||s.setAttribute(t,r))}};ci=new WeakMap,xt=new WeakSet,va=function(){var a,r,n,s;getComputedStyle(this).getPropertyValue("--media-duration-display").trim()==="none"||this.getAttribute("hide-duration")!=null?(a=this.timeDisplayEl)!=null&&a.hasAttribute("show-duration")&&((r=this.timeDisplayEl)==null||r.removeAttribute("show-duration")):(n=this.timeDisplayEl)!=null&&n.hasAttribute("show-duration")||(s=this.timeDisplayEl)==null||s.setAttribute("show-duration","")},wt.styles=bo,wt.template=Eo;R.customElements.get("mxp-time-display")||(R.customElements.define("mxp-time-display",wt),R.MxpTimeDisplay=wt);var fo=`:host {
754
906
  display: inline-block;
755
907
  width: 100%;
756
908
  }
@@ -766,46 +918,6 @@ a {
766
918
  text-decoration: underline;
767
919
  }
768
920
 
769
- [audio] [part~='seek-live'] {
770
- margin: 0;
771
- height: 42px;
772
- border-radius: 0;
773
- background-color: var(--media-control-background, rgba(20, 20, 30, 0.7));
774
- }
775
-
776
- [part~='seek-live'] {
777
- margin-left: 10px;
778
- margin-right: 5px;
779
- align-self: center;
780
- position: relative;
781
- box-sizing: border-box;
782
- padding: 4px 6px;
783
- border-radius: 12px;
784
- background-color: rgba(20, 20, 30, 0.7);
785
- font-size: 0.75rem;
786
- line-height: 1;
787
- color: #fff;
788
- border: none;
789
- cursor: pointer;
790
- }
791
-
792
- [part~='seek-live'] svg {
793
- width: 8px;
794
- fill: rgb(118, 118, 118);
795
- }
796
- [part~='seek-live'][in-live-window] svg {
797
- fill: #fb3c4d;
798
- }
799
-
800
- [part~='seek-live'][disabled] {
801
- opacity: 60%;
802
- cursor: not-allowed;
803
- }
804
- [part~='seek-live'][in-live-window] {
805
- opacity: 100%;
806
- cursor: unset;
807
- }
808
-
809
921
  ::part(top),
810
922
  [part~='top'] {
811
923
  --media-controls: var(--controls, var(--top-controls));
@@ -815,6 +927,10 @@ a {
815
927
  --media-seek-forward-button: var(--seek-forward-button, var(--top-seek-forward-button));
816
928
  --media-mute-button: var(--mute-button, var(--top-mute-button));
817
929
  --media-captions-button: var(--captions-button, var(--top-captions-button));
930
+ --media-captions-menu-button: var(
931
+ --captions-menu-button,
932
+ var(--media-captions-button, var(--top-captions-menu-button))
933
+ );
818
934
  --media-airplay-button: var(--airplay-button, var(--top-airplay-button));
819
935
  --media-pip-button: var(--pip-button, var(--top-pip-button));
820
936
  --media-fullscreen-button: var(--fullscreen-button, var(--top-fullscreen-button));
@@ -836,6 +952,10 @@ a {
836
952
  --media-seek-forward-button: var(--seek-forward-button, var(--center-seek-forward-button));
837
953
  --media-mute-button: var(--mute-button, var(--center-mute-button));
838
954
  --media-captions-button: var(--captions-button, var(--center-captions-button));
955
+ --media-captions-menu-button: var(
956
+ --captions-menu-button,
957
+ var(--media-captions-button, var(--center-captions-menu-button))
958
+ );
839
959
  --media-airplay-button: var(--airplay-button, var(--center-airplay-button));
840
960
  --media-pip-button: var(--pip-button, var(--center-pip-button));
841
961
  --media-fullscreen-button: var(--fullscreen-button, var(--center-fullscreen-button));
@@ -856,6 +976,10 @@ a {
856
976
  --media-seek-forward-button: var(--seek-forward-button, var(--bottom-seek-forward-button));
857
977
  --media-mute-button: var(--mute-button, var(--bottom-mute-button));
858
978
  --media-captions-button: var(--captions-button, var(--bottom-captions-button));
979
+ --media-captions-menu-button: var(
980
+ --captions-menu-button,
981
+ var(--media-captions-button, var(--bottom-captions-menu-button))
982
+ );
859
983
  --media-airplay-button: var(--airplay-button, var(--bottom-airplay-button));
860
984
  --media-pip-button: var(--pip-button, var(--bottom-pip-button));
861
985
  --media-fullscreen-button: var(--fullscreen-button, var(--bottom-fullscreen-button));
@@ -886,8 +1010,8 @@ a {
886
1010
  ::part(mute button) {
887
1011
  display: var(--media-controls, var(--media-mute-button));
888
1012
  }
889
- ::part(captions button) {
890
- display: var(--media-controls, var(--media-captions-button));
1013
+ ::part(captions menu-button) {
1014
+ display: var(--media-controls, var(--media-captions-menu-button, contents));
891
1015
  }
892
1016
  ::part(airplay button) {
893
1017
  display: var(--media-controls, var(--media-airplay-button));
@@ -916,7 +1040,8 @@ a {
916
1040
  ::part(title display) {
917
1041
  display: var(--media-controls, var(--media-title-display));
918
1042
  }
919
- `;var Kn=`<template id="media-theme-mux">
1043
+ `;var vo=`<!-- prettier-ignore -->
1044
+ <template id="media-theme-mux">
920
1045
  <style>
921
1046
  :host(:not([audio])) {
922
1047
  --secondary-color: transparent;
@@ -987,8 +1112,21 @@ a {
987
1112
  cursor: not-allowed;
988
1113
  }
989
1114
 
990
- media-captions-button:not(:is([media-captions-list], [media-subtitles-list])) {
991
- --captions-button: none;
1115
+ :host(:not([audio])) media-captions-menu-button::part(listbox) {
1116
+ bottom: 42px;
1117
+ z-index: 10;
1118
+ }
1119
+
1120
+ media-controller:not(:is([media-captions-list], [media-subtitles-list])) media-captions-menu-button {
1121
+ --captions-menu-button: none;
1122
+ }
1123
+
1124
+ media-captions-menu-button {
1125
+ --media-listbox-background: var(--secondary-color);
1126
+ --media-listbox-selected-background: rgba(255, 255, 255, 0.28);
1127
+ --media-listbox-hover-background: none;
1128
+ --media-listbox-hover-outline: white solid 1px;
1129
+ --media-text-color: white;
992
1130
  }
993
1131
 
994
1132
  media-volume-range[media-volume-unavailable] {
@@ -1041,15 +1179,15 @@ a {
1041
1179
  }
1042
1180
 
1043
1181
  media-control-bar {
1044
- --media-control-padding: 9px 7px;
1182
+ --media-control-padding: 4px 3px;
1045
1183
  }
1046
1184
 
1047
- .size-small media-control-bar {
1185
+ [breakpoint-sm] media-control-bar {
1048
1186
  --media-control-padding: 9px 5px;
1049
1187
  }
1050
1188
 
1051
- .size-extra-small media-control-bar {
1052
- --media-control-padding: 4px 3px;
1189
+ [breakpoint-md] media-control-bar {
1190
+ --media-control-padding: 9px 7px;
1053
1191
  }
1054
1192
 
1055
1193
  media-control-bar :is([role='button'], [role='switch'], button) {
@@ -1179,7 +1317,8 @@ a {
1179
1317
  line-height: 24px;
1180
1318
  }
1181
1319
 
1182
- .title-display {
1320
+ :is(.title-display, media-live-button) {
1321
+ color: inherit;
1183
1322
  font-size: 16px;
1184
1323
  text-shadow: 0 0 2px rgb(0 0 0 / 0.6);
1185
1324
  }
@@ -1190,11 +1329,11 @@ a {
1190
1329
  }
1191
1330
  </style>
1192
1331
  <media-controller
1332
+ breakpoints="sm:300 md:700"
1193
1333
  gestures-disabled="{{disabled}}"
1194
1334
  hotkeys="{{hotkeys}}"
1195
1335
  nohotkeys="{{nohotkeys}}"
1196
1336
  audio="{{audio}}"
1197
- class="size-{{playerSize}}"
1198
1337
  exportparts="layer, media-layer, poster-layer, vertical-layer, centered-layer, gesture-layer"
1199
1338
  >
1200
1339
  <slot name="media" slot="media"></slot>
@@ -1208,7 +1347,9 @@ a {
1208
1347
 
1209
1348
  <template partial="TitleDisplay">
1210
1349
  <template if="title">
1211
- <media-text-display part="top title display" class="title-display"> {{title}} </media-text-display>
1350
+ <media-text-display part="top title display" class="title-display">
1351
+ {{title}}
1352
+ </media-text-display>
1212
1353
  </template>
1213
1354
  </template>
1214
1355
 
@@ -1301,10 +1442,10 @@ a {
1301
1442
  </media-pip-button>
1302
1443
  </template>
1303
1444
 
1304
- <template partial="CaptionsButton">
1305
- <media-captions-button
1445
+ <template partial="CaptionsMenuButton">
1446
+ <media-captions-menu-button
1306
1447
  default-showing="{{defaultShowingCaptions}}"
1307
- part="bottom captions button"
1448
+ part="bottom captions menu-button"
1308
1449
  disabled="{{disabled}}"
1309
1450
  aria-disabled="{{disabled}}"
1310
1451
  >
@@ -1318,7 +1459,7 @@ a {
1318
1459
  d="M22.832 5.68a2.58 2.58 0 0 0-2.3-2.5c-1.81-.12-4.67-.18-7.53-.18-2.86 0-5.72.06-7.53.18a2.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.5c1.81.12 4.67.18 7.53.18 2.86 0 5.72-.06 7.53-.18a2.58 2.58 0 0 0 2.3-2.5c.23-4.21.23-8.43 0-12.64Zm-1.49 12.53a1.11 1.11 0 0 1-.91 1.11c-1.67.11-4.45.18-7.43.18-2.98 0-5.76-.07-7.43-.18a1.11 1.11 0 0 1-.91-1.11c-.21-4.137-.21-8.283 0-12.42a1.11 1.11 0 0 1 .91-1.11c1.67-.11 4.43-.18 7.43-.18s5.76.07 7.43.18a1.11 1.11 0 0 1 .91 1.11c.21 4.137.21 8.283 0 12.42ZM10.843 14a1.55 1.55 0 0 1-.76.18 1.57 1.57 0 0 1-.71-.18 1.69 1.69 0 0 1-.57-.42 2.099 2.099 0 0 1-.38-.58 2.47 2.47 0 0 1 0-1.64 2 2 0 0 1 .39-.66 1.73 1.73 0 0 1 .58-.42c.23-.103.479-.158.73-.16.241-.004.48.044.7.14.199.088.373.222.51.39l1.08-.89a2.179 2.179 0 0 0-.47-.44 2.81 2.81 0 0 0-.54-.32 2.91 2.91 0 0 0-.58-.15 2.71 2.71 0 0 0-.56 0 4.08 4.08 0 0 0-1.38.15 3.27 3.27 0 0 0-1.09.67 3.14 3.14 0 0 0-.71 1.06 3.62 3.62 0 0 0-.26 1.39 3.57 3.57 0 0 0 .26 1.38 3 3 0 0 0 .71 1.06c.316.293.687.52 1.09.67.443.16.91.238 1.38.23a3.2 3.2 0 0 0 1.28-.27c.401-.183.747-.47 1-.83l-1.17-.88a1.42 1.42 0 0 1-.53.52Zm6.62 0a1.58 1.58 0 0 1-.76.18 1.54 1.54 0 0 1-.7-.18 1.69 1.69 0 0 1-.57-.42 2.12 2.12 0 0 1-.43-.58 2.29 2.29 0 0 1 .39-2.3 1.84 1.84 0 0 1 1.32-.58c.241-.003.48.045.7.14.199.088.373.222.51.39l1.08-.92a2.43 2.43 0 0 0-.47-.44 3.22 3.22 0 0 0-.53-.29 2.999 2.999 0 0 0-.57-.15 2.87 2.87 0 0 0-.57 0 4.06 4.06 0 0 0-1.36.15 3.17 3.17 0 0 0-1.09.67 3 3 0 0 0-.72 1.06 3.62 3.62 0 0 0-.25 1.39 3.57 3.57 0 0 0 .25 1.38c.16.402.405.764.72 1.06a3.17 3.17 0 0 0 1.09.67c.44.16.904.237 1.37.23.441 0 .877-.092 1.28-.27a2.45 2.45 0 0 0 1-.83l-1.15-.85a1.49 1.49 0 0 1-.54.49Z"
1319
1460
  />
1320
1461
  </svg>
1321
- </media-captions-button>
1462
+ </media-captions-menu-button>
1322
1463
  </template>
1323
1464
 
1324
1465
  <template partial="AirplayButton">
@@ -1369,6 +1510,15 @@ a {
1369
1510
  </media-cast-button>
1370
1511
  </template>
1371
1512
 
1513
+ <template partial="LiveButton">
1514
+ <!-- NOTE: Keeping "seek-live" part for backwards compatibility for now -->
1515
+ <media-live-button
1516
+ part="{{section ?? 'top'}} live seek-live button"
1517
+ disabled="{{disabled}}"
1518
+ aria-disabled="{{disabled}}"
1519
+ ></media-live-button>
1520
+ </template>
1521
+
1372
1522
  <template partial="PlaybackRateButton">
1373
1523
  <media-playback-rate-button
1374
1524
  rates="{{playbackRates}}"
@@ -1403,161 +1553,273 @@ a {
1403
1553
  ></media-time-range>
1404
1554
  </template>
1405
1555
 
1406
- <template if="layout == 'audio on-demand'">
1407
- <template if="title">
1408
- <media-control-bar>{{>TitleDisplay}}</media-control-bar>
1556
+ <template if="audio">
1557
+
1558
+ <template if="streamType == 'on-demand'">
1559
+ <template if="title">
1560
+ <media-control-bar>{{>TitleDisplay}}</media-control-bar>
1561
+ </template>
1562
+ <media-control-bar>
1563
+ {{>PlayButton}}
1564
+ {{>SeekBackwardButton}}
1565
+ {{>SeekForwardButton}}
1566
+ {{>TimeDisplay}}
1567
+ {{>TimeRange}}
1568
+ {{>MuteButton}}
1569
+ {{>VolumeRange}}
1570
+ {{>PlaybackRateButton}}
1571
+ {{>AirplayButton}}
1572
+ {{>CastButton}}
1573
+ </media-control-bar>
1409
1574
  </template>
1410
- <media-control-bar>
1411
- {{>PlayButton}} {{>SeekBackwardButton}} {{>SeekForwardButton}} {{>TimeDisplay}} {{>TimeRange}} {{>MuteButton}}
1412
- {{>VolumeRange}} {{>PlaybackRateButton}} {{>AirplayButton}} {{>CastButton}}
1413
- </media-control-bar>
1414
- </template>
1415
1575
 
1416
- <template if="layout == 'audio dvr'">
1417
- <template if="title">
1418
- <media-control-bar>{{>TitleDisplay}}</media-control-bar>
1419
- </template>
1420
- <media-control-bar>
1421
- {{>PlayButton}}
1422
- <slot name="seek-live"></slot>
1423
- {{>SeekBackwardButton}} {{>SeekForwardButton}} {{>TimeDisplay}} {{>TimeRange}} {{>MuteButton}} {{>VolumeRange}}
1424
- {{>PlaybackRateButton}} {{>AirplayButton}} {{>CastButton}}
1425
- </media-control-bar>
1426
- </template>
1576
+ <template if="streamType == 'live'">
1577
+
1578
+ <template if="targetLiveWindow > 0">
1579
+ <template if="title">
1580
+ <media-control-bar>{{>TitleDisplay}}</media-control-bar>
1581
+ </template>
1582
+ <media-control-bar>
1583
+ {{>PlayButton}}
1584
+ {{>LiveButton section="bottom"}}
1585
+ {{>SeekBackwardButton}}
1586
+ {{>SeekForwardButton}}
1587
+ {{>TimeDisplay}}
1588
+ {{>TimeRange}}
1589
+ {{>MuteButton}}
1590
+ {{>VolumeRange}}
1591
+ {{>PlaybackRateButton}}
1592
+ {{>AirplayButton}}
1593
+ {{>CastButton}}
1594
+ </media-control-bar>
1595
+ </template>
1596
+
1597
+ <template if="targetLiveWindow == null">
1598
+ <template if="title">
1599
+ <media-control-bar>{{>TitleDisplay}}</media-control-bar>
1600
+ </template>
1601
+ <media-control-bar>
1602
+ {{>PlayButton}}
1603
+ {{>LiveButton section="bottom"}}
1604
+ {{>MuteButton}}
1605
+ {{>VolumeRange}}
1606
+ <div class="spacer"></div>
1607
+ {{>AirplayButton}}
1608
+ {{>CastButton}}
1609
+ </media-control-bar>
1610
+ </template>
1427
1611
 
1428
- <template if="layout == 'audio live'">
1429
- <template if="title">
1430
- <media-control-bar>{{>TitleDisplay}}</media-control-bar>
1431
1612
  </template>
1432
- <media-control-bar>
1433
- {{>PlayButton}}
1434
- <slot name="seek-live"></slot>
1435
- {{>MuteButton}} {{>VolumeRange}}
1436
- <div class="spacer"></div>
1437
- {{>AirplayButton}} {{>CastButton}}
1438
- </media-control-bar>
1439
1613
  </template>
1440
1614
 
1441
- <template if="layout == 'on-demand extra-small'">
1442
- {{>TimeRange}}
1443
- <media-control-bar>
1444
- {{>PlayButton}} {{>MuteButton}}
1445
- <div class="spacer"></div>
1446
- {{>CaptionsButton}} {{>FullscreenButton}}
1447
- </media-control-bar>
1448
- </template>
1615
+ <template if="audio == null">
1616
+
1617
+ <template if="streamType == 'on-demand'">
1618
+
1619
+ <template if="breakpointSm == null">
1620
+ {{>TimeRange}}
1621
+ <media-control-bar>
1622
+ {{>PlayButton}}
1623
+ {{>MuteButton}}
1624
+ <div class="spacer"></div>
1625
+ {{>CaptionsMenuButton}}
1626
+ {{>FullscreenButton}}
1627
+ </media-control-bar>
1628
+ </template>
1629
+
1630
+ <template if="breakpointSm">
1631
+ <template if="breakpointMd == null">
1632
+ <media-control-bar slot="top-chrome">
1633
+ {{>TitleDisplay}}
1634
+ </media-control-bar>
1635
+ <div slot="centered-chrome" class="center-controls">
1636
+ {{>SeekBackwardButton section="center"}}
1637
+ {{>PlayButton section="center"}}
1638
+ {{>SeekForwardButton section="center"}}
1639
+ </div>
1640
+ {{>TimeRange}}
1641
+ <media-control-bar>
1642
+ {{>PlayButton}}
1643
+ {{>TimeDisplay}}
1644
+ {{>MuteButton}}
1645
+ {{>VolumeRange}}
1646
+ <div class="spacer"></div>
1647
+ {{>PlaybackRateButton}}
1648
+ {{>CaptionsMenuButton}}
1649
+ {{>AirplayButton}}
1650
+ {{>CastButton}}
1651
+ {{>PipButton}}
1652
+ {{>FullscreenButton}}
1653
+ </media-control-bar>
1654
+ </template>
1655
+ </template>
1656
+
1657
+ <template if="breakpointMd">
1658
+ <media-control-bar slot="top-chrome">
1659
+ {{>TitleDisplay}}
1660
+ </media-control-bar>
1661
+ <div slot="centered-chrome" class="center-controls">
1662
+ {{>PlayButton section="center"}}
1663
+ </div>
1664
+ {{>TimeRange}}
1665
+ <media-control-bar>
1666
+ {{>PlayButton}}
1667
+ {{>SeekBackwardButton}}
1668
+ {{>SeekForwardButton}}
1669
+ {{>TimeDisplay}}
1670
+ {{>MuteButton}}
1671
+ {{>VolumeRange}}
1672
+ <div class="spacer"></div>
1673
+ {{>PlaybackRateButton}}
1674
+ {{>CaptionsMenuButton}}
1675
+ {{>AirplayButton}}
1676
+ {{>CastButton}}
1677
+ {{>PipButton}}
1678
+ {{>FullscreenButton}}
1679
+ </media-control-bar>
1680
+ </template>
1449
1681
 
1450
- <template if="layout == 'on-demand small'">
1451
- <media-control-bar slot="top-chrome"> {{>TitleDisplay}} </media-control-bar>
1452
- <div slot="centered-chrome" class="center-controls">
1453
- {{>SeekBackwardButton section="center"}} {{>PlayButton section="center"}} {{>SeekForwardButton
1454
- section="center"}}
1455
- </div>
1456
- {{>TimeRange}}
1457
- <media-control-bar>
1458
- {{>TimeDisplay}} {{>MuteButton}} {{>VolumeRange}}
1459
- <div class="spacer"></div>
1460
- {{>PlaybackRateButton}} {{>CaptionsButton}} {{>AirplayButton}} {{>CastButton}} {{>PipButton}}
1461
- {{>FullscreenButton}}
1462
- </media-control-bar>
1463
- </template>
1464
-
1465
- <template if="layout == 'on-demand large'">
1466
- <media-control-bar slot="top-chrome"> {{>TitleDisplay}} </media-control-bar>
1467
- <div slot="centered-chrome" class="center-controls">{{>PlayButton section="center"}}</div>
1468
- {{>TimeRange}}
1469
- <media-control-bar>
1470
- {{>PlayButton}} {{>SeekBackwardButton}} {{>SeekForwardButton}} {{>TimeDisplay}} {{>MuteButton}} {{>VolumeRange}}
1471
- <div class="spacer"></div>
1472
- {{>PlaybackRateButton}} {{>CaptionsButton}} {{>AirplayButton}} {{>CastButton}} {{>PipButton}}
1473
- {{>FullscreenButton}}
1474
- </media-control-bar>
1475
- </template>
1476
-
1477
- <template if="layout == 'live extra-small'">
1478
- <media-control-bar slot="top-chrome">
1479
- <slot name="seek-live"></slot>
1480
- </media-control-bar>
1481
- <media-control-bar>
1482
- {{>PlayButton}} {{>MuteButton}}
1483
- <div class="spacer"></div>
1484
- {{>CaptionsButton}} {{>FullscreenButton}}
1485
- </media-control-bar>
1486
- </template>
1487
-
1488
- <template if="layout == 'live small'">
1489
- <media-control-bar slot="top-chrome">
1490
- <slot name="seek-live"></slot>
1491
- {{>TitleDisplay}}
1492
- </media-control-bar>
1493
- <div slot="centered-chrome" class="center-controls">{{>PlayButton section="center"}}</div>
1494
- <media-control-bar>
1495
- {{>MuteButton}} {{>VolumeRange}}
1496
- <div class="spacer"></div>
1497
- {{>CaptionsButton}} {{>AirplayButton}} {{>CastButton}} {{>PipButton}} {{>FullscreenButton}}
1498
- </media-control-bar>
1499
- </template>
1500
-
1501
- <template if="layout == 'live large'">
1502
- <media-control-bar slot="top-chrome">
1503
- <slot name="seek-live"></slot>
1504
- {{>TitleDisplay}}
1505
- </media-control-bar>
1506
- <div slot="centered-chrome" class="center-controls">{{>PlayButton section="center"}}</div>
1507
- <media-control-bar>
1508
- {{>PlayButton}} {{>MuteButton}} {{>VolumeRange}}
1509
- <div class="spacer"></div>
1510
- {{>CaptionsButton}} {{>AirplayButton}} {{>CastButton}} {{>PipButton}} {{>FullscreenButton}}
1511
- </media-control-bar>
1512
- </template>
1682
+ </template>
1513
1683
 
1514
- <template if="layout == 'dvr extra-small'">
1515
- <media-control-bar slot="top-chrome">
1516
- <slot name="seek-live"></slot>
1517
- </media-control-bar>
1518
- {{>TimeRange}}
1519
- <media-control-bar>
1520
- {{>PlayButton}} {{>MuteButton}}
1521
- <div class="spacer"></div>
1522
- {{>CaptionsButton}} {{>FullscreenButton}}
1523
- </media-control-bar>
1524
- </template>
1684
+ <template if="streamType == 'live'">
1685
+
1686
+ <template if="targetLiveWindow == null">
1687
+
1688
+ <template if="breakpointSm == null">
1689
+ <media-control-bar slot="top-chrome">
1690
+ {{>LiveButton}}
1691
+ </media-control-bar>
1692
+ <media-control-bar>
1693
+ {{>PlayButton}}
1694
+ {{>MuteButton}}
1695
+ <div class="spacer"></div>
1696
+ {{>CaptionsMenuButton}}
1697
+ {{>FullscreenButton}}
1698
+ </media-control-bar>
1699
+ </template>
1700
+
1701
+ <template if="breakpointSm">
1702
+ <template if="breakpointMd == null">
1703
+ <media-control-bar slot="top-chrome">
1704
+ {{>LiveButton}}
1705
+ {{>TitleDisplay}}
1706
+ </media-control-bar>
1707
+ <div slot="centered-chrome" class="center-controls">
1708
+ {{>PlayButton section="center"}}
1709
+ </div>
1710
+ <media-control-bar>
1711
+ {{>PlayButton}}
1712
+ {{>MuteButton}}
1713
+ {{>VolumeRange}}
1714
+ <div class="spacer"></div>
1715
+ {{>CaptionsMenuButton}}
1716
+ {{>AirplayButton}}
1717
+ {{>CastButton}}
1718
+ {{>PipButton}}
1719
+ {{>FullscreenButton}}
1720
+ </media-control-bar>
1721
+ </template>
1722
+ </template>
1723
+
1724
+ <template if="breakpointMd">
1725
+ <media-control-bar slot="top-chrome">
1726
+ {{>LiveButton}}
1727
+ {{>TitleDisplay}}
1728
+ </media-control-bar>
1729
+ <div slot="centered-chrome" class="center-controls">
1730
+ {{>PlayButton section="center"}}
1731
+ </div>
1732
+ <media-control-bar>
1733
+ {{>PlayButton}}
1734
+ {{>MuteButton}}
1735
+ {{>VolumeRange}}
1736
+ <div class="spacer"></div>
1737
+ {{>CaptionsMenuButton}}
1738
+ {{>AirplayButton}}
1739
+ {{>CastButton}}
1740
+ {{>PipButton}}
1741
+ {{>FullscreenButton}}
1742
+ </media-control-bar>
1743
+ </template>
1744
+ </template>
1745
+
1746
+ <template if="targetLiveWindow > 0">
1747
+
1748
+ <template if="breakpointSm == null">
1749
+ <media-control-bar slot="top-chrome">
1750
+ {{>LiveButton}}
1751
+ </media-control-bar>
1752
+ {{>TimeRange}}
1753
+ <media-control-bar>
1754
+ {{>PlayButton}}
1755
+ {{>MuteButton}}
1756
+ <div class="spacer"></div>
1757
+ {{>CaptionsMenuButton}}
1758
+ {{>FullscreenButton}}
1759
+ </media-control-bar>
1760
+ </template>
1761
+
1762
+ <template if="breakpointSm">
1763
+ <template if="breakpointMd == null">
1764
+ <media-control-bar slot="top-chrome">
1765
+ {{>LiveButton}}
1766
+ {{>TitleDisplay}}
1767
+ </media-control-bar>
1768
+ <div slot="centered-chrome" class="center-controls">
1769
+ {{>SeekBackwardButton section="center"}}
1770
+ {{>PlayButton section="center"}}
1771
+ {{>SeekForwardButton section="center"}}
1772
+ </div>
1773
+ {{>TimeRange}}
1774
+ <media-control-bar>
1775
+ {{>PlayButton}}
1776
+ {{>MuteButton}}
1777
+ {{>VolumeRange}}
1778
+ <div class="spacer"></div>
1779
+ {{>CaptionsMenuButton}}
1780
+ {{>AirplayButton}}
1781
+ {{>CastButton}}
1782
+ {{>PipButton}}
1783
+ {{>FullscreenButton}}
1784
+ </media-control-bar>
1785
+ </template>
1786
+ </template>
1787
+
1788
+ <template if="breakpointMd">
1789
+ <media-control-bar slot="top-chrome">
1790
+ {{>LiveButton}}
1791
+ {{>TitleDisplay}}
1792
+ </media-control-bar>
1793
+ <div slot="centered-chrome" class="center-controls">
1794
+ {{>PlayButton section="center"}}
1795
+ </div>
1796
+ {{>TimeRange}}
1797
+ <media-control-bar>
1798
+ {{>PlayButton}}
1799
+ {{>SeekBackwardButton}}
1800
+ {{>SeekForwardButton}}
1801
+ {{>MuteButton}}
1802
+ {{>VolumeRange}}
1803
+ <div class="spacer"></div>
1804
+ {{>CaptionsMenuButton}}
1805
+ {{>AirplayButton}}
1806
+ {{>CastButton}}
1807
+ {{>PipButton}}
1808
+ {{>FullscreenButton}}
1809
+ </media-control-bar>
1810
+ </template>
1811
+
1812
+ </template>
1525
1813
 
1526
- <template if="layout == 'dvr small'">
1527
- <media-control-bar slot="top-chrome">
1528
- <slot name="seek-live"></slot>
1529
- {{>TitleDisplay}}
1530
- </media-control-bar>
1531
- <div slot="centered-chrome" class="center-controls">
1532
- {{>SeekBackwardButton section="center"}} {{>PlayButton section="center"}} {{>SeekForwardButton
1533
- section="center"}}
1534
- </div>
1535
- {{>TimeRange}}
1536
- <media-control-bar>
1537
- {{>MuteButton}} {{>VolumeRange}}
1538
- <div class="spacer"></div>
1539
- {{>CaptionsButton}} {{>AirplayButton}} {{>CastButton}} {{>PipButton}} {{>FullscreenButton}}
1540
- </media-control-bar>
1541
- </template>
1814
+ </template>
1542
1815
 
1543
- <template if="layout == 'dvr large'">
1544
- <media-control-bar slot="top-chrome">
1545
- <slot name="seek-live"></slot>
1546
- {{>TitleDisplay}}
1547
- </media-control-bar>
1548
- <div slot="centered-chrome" class="center-controls">{{>PlayButton section="center"}}</div>
1549
- {{>TimeRange}}
1550
- <media-control-bar>
1551
- {{>PlayButton}} {{>SeekBackwardButton}} {{>SeekForwardButton}} {{>MuteButton}} {{>VolumeRange}}
1552
- <div class="spacer"></div>
1553
- {{>CaptionsButton}} {{>AirplayButton}} {{>CastButton}} {{>PipButton}} {{>FullscreenButton}}
1554
- </media-control-bar>
1555
1816
  </template>
1556
1817
 
1557
1818
  <slot></slot>
1819
+
1558
1820
  </media-controller>
1559
1821
  </template>
1560
- `;var Gn=`
1822
+ `;var Ao=`
1561
1823
  :host {
1562
1824
  z-index: 100;
1563
1825
  display: flex;
@@ -1609,17 +1871,17 @@ a {
1609
1871
  text-align: center;
1610
1872
  line-height: 1.4;
1611
1873
  }
1612
- `,Zn=H.createElement("template");Zn.innerHTML=`
1874
+ `,_o=F.createElement("template");_o.innerHTML=`
1613
1875
  <style>
1614
- ${Gn}
1876
+ ${Ao}
1615
1877
  </style>
1616
1878
 
1617
1879
  <div class="dialog">
1618
1880
  <slot></slot>
1619
1881
  </div>
1620
- `;var ve=class extends D.HTMLElement{constructor(){var t;super();this.attachShadow({mode:"open"}),(t=this.shadowRoot)==null||t.appendChild(this.constructor.template.content.cloneNode(!0))}show(){this.setAttribute("open",""),this.dispatchEvent(new CustomEvent("open",{composed:!0,bubbles:!0})),Yn(this)}close(){!this.hasAttribute("open")||(this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("close",{composed:!0,bubbles:!0})),tl(this))}attributeChangedCallback(t,a,r){t==="open"&&a!==r&&(r!=null?this.show():this.close())}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","dialog"),this.hasAttribute("open")&&Yn(this)}};ve.styles=Gn,ve.template=Zn,ve.observedAttributes=["open"];function Yn(i){let e=new CustomEvent("initfocus",{composed:!0,bubbles:!0,cancelable:!0});if(i.dispatchEvent(e),e.defaultPrevented)return;let t=i.querySelector("[autofocus]:not([disabled])");!t&&i.tabIndex>=0&&(t=i),t||(t=qn(i.shadowRoot)),i._previouslyFocusedElement=H.activeElement,H.activeElement instanceof HTMLElement&&H.activeElement.blur(),i.addEventListener("transitionend",()=>{t instanceof HTMLElement&&t.focus({preventScroll:!0})},{once:!0})}function qn(i){let t=["button","input","keygen","select","textarea"].map(function(r){return r+":not([disabled])"});t.push('[tabindex]:not([disabled]):not([tabindex=""])');let a=i==null?void 0:i.querySelector(t.join(", "));if(!a&&"attachShadow"in Element.prototype){let r=(i==null?void 0:i.querySelectorAll("*"))||[];for(let n=0;n<r.length&&!(r[n].tagName&&r[n].shadowRoot&&(a=qn(r[n].shadowRoot),a));n++);}return a}function tl(i){i._previouslyFocusedElement instanceof HTMLElement&&i._previouslyFocusedElement.focus()}D.customElements.get("media-dialog")||(D.customElements.define("media-dialog",ve),D.MediaDialog=ve);var Na=ve;var Qn=H.createElement("template");Qn.innerHTML=`
1882
+ `;var Ne=class extends R.HTMLElement{constructor(){var t;super();this.attachShadow({mode:"open"}),(t=this.shadowRoot)==null||t.appendChild(this.constructor.template.content.cloneNode(!0))}show(){this.setAttribute("open",""),this.dispatchEvent(new CustomEvent("open",{composed:!0,bubbles:!0})),go(this)}close(){!this.hasAttribute("open")||(this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("close",{composed:!0,bubbles:!0})),Cd(this))}attributeChangedCallback(t,a,r){t==="open"&&a!==r&&(r!=null?this.show():this.close())}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","dialog"),this.hasAttribute("open")&&go(this)}};Ne.styles=Ao,Ne.template=_o,Ne.observedAttributes=["open"];function go(i){let e=new CustomEvent("initfocus",{composed:!0,bubbles:!0,cancelable:!0});if(i.dispatchEvent(e),e.defaultPrevented)return;let t=i.querySelector("[autofocus]:not([disabled])");!t&&i.tabIndex>=0&&(t=i),t||(t=yo(i.shadowRoot)),i._previouslyFocusedElement=F.activeElement,F.activeElement instanceof HTMLElement&&F.activeElement.blur(),i.addEventListener("transitionend",()=>{t instanceof HTMLElement&&t.focus({preventScroll:!0})},{once:!0})}function yo(i){let t=["button","input","keygen","select","textarea"].map(function(r){return r+":not([disabled])"});t.push('[tabindex]:not([disabled]):not([tabindex=""])');let a=i==null?void 0:i.querySelector(t.join(", "));if(!a&&"attachShadow"in Element.prototype){let r=(i==null?void 0:i.querySelectorAll("*"))||[];for(let n=0;n<r.length&&!(r[n].tagName&&r[n].shadowRoot&&(a=yo(r[n].shadowRoot),a));n++);}return a}function Cd(i){i._previouslyFocusedElement instanceof HTMLElement&&i._previouslyFocusedElement.focus()}R.customElements.get("media-dialog")||(R.customElements.define("media-dialog",Ne),R.MediaDialog=Ne);var en=Ne;var Io=F.createElement("template");Io.innerHTML=`
1621
1883
  <style>
1622
- ${Na.styles}
1884
+ ${en.styles}
1623
1885
 
1624
1886
  .close {
1625
1887
  background: none;
@@ -1648,87 +1910,76 @@ a {
1648
1910
  </svg>
1649
1911
  </button>
1650
1912
  </slot>
1651
- `;var yt=class extends Na{constructor(){var e,t;super(),(t=(e=this.shadowRoot)==null?void 0:e.querySelector(".close"))==null||t.addEventListener("click",()=>{this.close()})}};yt.template=Qn;D.customElements.get("mxp-dialog")||(D.customElements.define("mxp-dialog",yt),D.MxpDialog=yt);var Tt=new WeakMap,It=class{constructor(e,t){this.element=e;this.type=t;this.element.addEventListener(this.type,this);let a=Tt.get(this.element);a&&a.set(this.type,this)}set(e){if(typeof e=="function")this.handleEvent=e.bind(this.element);else if(typeof e=="object"&&typeof e.handleEvent=="function")this.handleEvent=e.handleEvent.bind(e);else{this.element.removeEventListener(this.type,this);let t=Tt.get(this.element);t&&t.delete(this.type)}}static for(e){Tt.has(e.element)||Tt.set(e.element,new Map);let t=e.attributeName.slice(2),a=Tt.get(e.element);return a&&a.has(t)?a.get(t):new It(e.element,t)}};function il(i,e){return i instanceof F&&i.attributeName.startsWith("on")?(It.for(i).set(e),i.element.removeAttributeNS(i.attributeNamespace,i.attributeName),!0):!1}function al(i,e){return e instanceof gi&&i instanceof se?(e.renderInto(i),!0):!1}function rl(i,e){return e instanceof DocumentFragment&&i instanceof se?(e.childNodes.length&&i.replace(...e.childNodes),!0):!1}function nl(i,e){if(i instanceof F){let t=i.attributeNamespace,a=i.element.getAttributeNS(t,i.attributeName);return String(e)!==a&&(i.value=String(e)),!0}return i.value=String(e),!0}function ol(i,e){if(i instanceof F&&e instanceof Element){let t=i.element;return t[i.attributeName]!==e&&(i.element.removeAttributeNS(i.attributeNamespace,i.attributeName),t[i.attributeName]=e),!0}return!1}function sl(i,e){if(typeof e=="boolean"&&i instanceof F){let t=i.attributeNamespace,a=i.element.hasAttributeNS(t,i.attributeName);return e!==a&&(i.booleanValue=e),!0}return!1}function ll(i,e){return e===!1&&i instanceof se?(i.replace(""),!0):!1}function dl(i,e){ol(i,e)||sl(i,e)||il(i,e)||ll(i,e)||al(i,e)||rl(i,e)||nl(i,e)}var Ba=new Map,zn=new WeakMap,Xn=new WeakMap,gi=class{constructor(e,t,a){this.strings=e;this.values=t;this.processor=a;this.stringsKey=this.strings.join("")}get template(){if(Ba.has(this.stringsKey))return Ba.get(this.stringsKey);{let e=H.createElement("template"),t=this.strings.length-1;return e.innerHTML=this.strings.reduce((a,r,n)=>a+r+(n<t?`{{ ${n} }}`:""),""),Ba.set(this.stringsKey,e),e}}renderInto(e){let t=this.template;if(zn.get(e)!==t){zn.set(e,t);let r=new oe(t,this.values,this.processor);Xn.set(e,r),e instanceof se?e.replace(...r.children):e.appendChild(r);return}let a=Xn.get(e);a&&a.update(this.values)}},ul={processCallback(i,e,t){var a;if(!!t){for(let[r,n]of e)if(r in t){let s=(a=t[r])!=null?a:"";dl(n,s)}}}};function X(i,...e){return new gi(i,e,ul)}function jn(i,e){i.renderInto(e)}var De=require("@mux/playback-core"),$a=H.createElement("template");"innerHTML"in $a&&($a.innerHTML=Kn);var Jn=i=>X`
1913
+ `;var ui=class extends en{constructor(){var e,t;super(),(t=(e=this.shadowRoot)==null?void 0:e.querySelector(".close"))==null||t.addEventListener("click",()=>{this.close()})}};ui.template=Io;R.customElements.get("mxp-dialog")||(R.customElements.define("mxp-dialog",ui),R.MxpDialog=ui);var mi=new WeakMap,hi=class{constructor(e,t){this.element=e;this.type=t;this.element.addEventListener(this.type,this);let a=mi.get(this.element);a&&a.set(this.type,this)}set(e){if(typeof e=="function")this.handleEvent=e.bind(this.element);else if(typeof e=="object"&&typeof e.handleEvent=="function")this.handleEvent=e.handleEvent.bind(e);else{this.element.removeEventListener(this.type,this);let t=mi.get(this.element);t&&t.delete(this.type)}}static for(e){mi.has(e.element)||mi.set(e.element,new Map);let t=e.attributeName.slice(2),a=mi.get(e.element);return a&&a.has(t)?a.get(t):new hi(e.element,t)}};function Ld(i,e){return i instanceof Y&&i.attributeName.startsWith("on")?(hi.for(i).set(e),i.element.removeAttributeNS(i.attributeNamespace,i.attributeName),!0):!1}function wd(i,e){return e instanceof ga&&i instanceof ve?(e.renderInto(i),!0):!1}function xd(i,e){return e instanceof DocumentFragment&&i instanceof ve?(e.childNodes.length&&i.replace(...e.childNodes),!0):!1}function Dd(i,e){if(i instanceof Y){let t=i.attributeNamespace,a=i.element.getAttributeNS(t,i.attributeName);return String(e)!==a&&(i.value=String(e)),!0}return i.value=String(e),!0}function Rd(i,e){if(i instanceof Y&&e instanceof Element){let t=i.element;return t[i.attributeName]!==e&&(i.element.removeAttributeNS(i.attributeNamespace,i.attributeName),t[i.attributeName]=e),!0}return!1}function Od(i,e){if(typeof e=="boolean"&&i instanceof Y){let t=i.attributeNamespace,a=i.element.hasAttributeNS(t,i.attributeName);return e!==a&&(i.booleanValue=e),!0}return!1}function Pd(i,e){return e===!1&&i instanceof ve?(i.replace(""),!0):!1}function Ud(i,e){Rd(i,e)||Od(i,e)||Ld(i,e)||Pd(i,e)||wd(i,e)||xd(i,e)||Dd(i,e)}var tn=new Map,To=new WeakMap,Mo=new WeakMap,ga=class{constructor(e,t,a){this.strings=e;this.values=t;this.processor=a;this.stringsKey=this.strings.join("")}get template(){if(tn.has(this.stringsKey))return tn.get(this.stringsKey);{let e=F.createElement("template"),t=this.strings.length-1;return e.innerHTML=this.strings.reduce((a,r,n)=>a+r+(n<t?`{{ ${n} }}`:""),""),tn.set(this.stringsKey,e),e}}renderInto(e){let t=this.template;if(To.get(e)!==t){To.set(e,t);let r=new fe(t,this.values,this.processor);Mo.set(e,r),e instanceof ve?e.replace(...r.children):e.appendChild(r);return}let a=Mo.get(e);a&&a.update(this.values)}},Nd={processCallback(i,e,t){var a;if(!!t){for(let[r,n]of e)if(r in t){let s=(a=t[r])!=null?a:"";Ud(n,s)}}}};function ge(i,...e){return new ga(i,e,Nd)}function ko(i,e){i.renderInto(e)}var pi=require("@mux/playback-core"),an=F.createElement("template");"innerHTML"in an&&(an.innerHTML=vo);var So=i=>ge`
1652
1914
  <style>
1653
- ${Fn}
1915
+ ${fo}
1654
1916
  </style>
1655
- ${hl(i)}
1656
- `,Va=i=>[De.StreamTypes.LIVE,De.StreamTypes.LL_LIVE].includes(i.streamType),Ha=i=>[De.StreamTypes.LIVE,De.StreamTypes.LL_LIVE,De.StreamTypes.DVR,De.StreamTypes.LL_DVR].includes(i.streamType),cl=i=>{let e="";return i.audio&&(e+="audio "),Va(i)?e+="live":Ha(i)?e+="dvr":e+=i.streamType||"on-demand",!i.audio&&i.playerSize&&(e+=` ${i.playerSize}`),e},ml=i=>{let e=i.hotKeys?`${i.hotKeys}`:"";return Ha(i)&&(e+=" noarrowleft noarrowright"),e},hl=i=>{var e,t,a,r,n,s,l,c,m,E,f,w,T,P,M,R,L,G,Z,ie,Re,wt,Ka,Ya,Ga,Za,qa,Qa,za,Xa,ja,Ja;return X`
1917
+ ${Hd(i)}
1918
+ `,Co=i=>[pi.StreamTypes.LIVE,pi.StreamTypes.LL_LIVE].includes(i.streamType),Lo=i=>[pi.StreamTypes.DVR,pi.StreamTypes.LL_DVR].includes(i.streamType),wo=i=>Co(i)||Lo(i),Bd=i=>{let e=i.hotKeys?`${i.hotKeys}`:"";return wo(i)&&(e+=" noarrowleft noarrowright"),e},Hd=i=>{var e,t,a,r,n,s,d,c,m,b,y,f,I,B,D,M,k,j,Q,de,lt,yi,nn,sn,on,ln,dn,cn,un,mn,hn;return ge`
1657
1919
  <media-theme
1658
- template="${(e=i.theme)!=null?e:$a.content.children[0]}"
1659
- class="size-${i.playerSize}${i.secondaryColor?" two-tone":""}"
1660
- player-size="${(t=i.playerSize)!=null?t:!1}"
1661
- layout="${cl(i)}"
1662
- hotkeys="${ml(i)||!1}"
1920
+ template="${(e=i.theme)!=null?e:an.content.children[0]}"
1921
+ class="${i.secondaryColor?"two-tone":!1}"
1922
+ stream-type="${wo(i)?"live":"on-demand"}"
1923
+ target-live-window="${Lo(i)?1:!1}"
1924
+ hotkeys="${Bd(i)||!1}"
1663
1925
  nohotkeys="${i.noHotKeys||!i.hasSrc||i.isDialogOpen||!1}"
1664
1926
  disabled="${!i.hasSrc||i.isDialogOpen}"
1665
- audio="${(a=i.audio)!=null?a:!1}"
1666
- style="${(r=bn({"--primary-color":i.primaryColor,"--secondary-color":i.secondaryColor}))!=null?r:!1}"
1927
+ audio="${(t=i.audio)!=null?t:!1}"
1928
+ style="${(a=Gs({"--primary-color":i.primaryColor,"--secondary-color":i.secondaryColor}))!=null?a:!1}"
1667
1929
  default-showing-captions="${!i.defaultHiddenCaptions}"
1668
- forward-seek-offset="${(n=i.forwardSeekOffset)!=null?n:!1}"
1669
- backward-seek-offset="${(s=i.backwardSeekOffset)!=null?s:!1}"
1670
- playback-rates="${(l=i.playbackRates)!=null?l:!1}"
1671
- default-show-remaining-time="${(c=i.defaultShowRemainingTime)!=null?c:!1}"
1672
- title="${(m=i.title)!=null?m:!1}"
1673
- poster="${i.poster===""?!1:(E=i.poster)!=null?E:!1}"
1674
- placeholder="${(f=i.placeholder)!=null?f:!1}"
1930
+ forward-seek-offset="${(r=i.forwardSeekOffset)!=null?r:!1}"
1931
+ backward-seek-offset="${(n=i.backwardSeekOffset)!=null?n:!1}"
1932
+ playback-rates="${(s=i.playbackRates)!=null?s:!1}"
1933
+ default-show-remaining-time="${(d=i.defaultShowRemainingTime)!=null?d:!1}"
1934
+ title="${(c=i.title)!=null?c:!1}"
1935
+ poster="${i.poster===""?!1:(m=i.poster)!=null?m:!1}"
1936
+ placeholder="${(b=i.placeholder)!=null?b:!1}"
1675
1937
  exportparts="top, center, bottom, layer, media-layer, poster-layer, vertical-layer, centered-layer, gesture-layer, poster, seek-live, play, button, seek-backward, seek-forward, mute, captions, airplay, pip, fullscreen, cast, playback-rate, volume, range, time, display"
1676
1938
  >
1677
1939
  <mux-video
1678
1940
  slot="media"
1679
- crossorigin="${(w=i.crossOrigin)!=null?w:""}"
1941
+ crossorigin="${(y=i.crossOrigin)!=null?y:""}"
1680
1942
  playsinline
1681
- autoplay="${(T=i.autoplay)!=null?T:!1}"
1682
- muted="${(P=i.muted)!=null?P:!1}"
1683
- loop="${(M=i.loop)!=null?M:!1}"
1684
- preload="${(R=i.preload)!=null?R:!1}"
1685
- debug="${(L=i.debug)!=null?L:!1}"
1686
- prefer-cmcd="${(G=i.preferCmcd)!=null?G:!1}"
1687
- disable-cookies="${(Z=i.disableCookies)!=null?Z:!1}"
1688
- prefer-playback="${(ie=i.preferPlayback)!=null?ie:!1}"
1943
+ autoplay="${(f=i.autoplay)!=null?f:!1}"
1944
+ muted="${(I=i.muted)!=null?I:!1}"
1945
+ loop="${(B=i.loop)!=null?B:!1}"
1946
+ preload="${(D=i.preload)!=null?D:!1}"
1947
+ debug="${(M=i.debug)!=null?M:!1}"
1948
+ prefer-cmcd="${(k=i.preferCmcd)!=null?k:!1}"
1949
+ disable-cookies="${(j=i.disableCookies)!=null?j:!1}"
1950
+ prefer-playback="${(Q=i.preferPlayback)!=null?Q:!1}"
1689
1951
  start-time="${i.startTime!=null?i.startTime:!1}"
1690
- beacon-collection-domain="${(Re=i.beaconCollectionDomain)!=null?Re:!1}"
1691
- player-software-name="${(wt=i.playerSoftwareName)!=null?wt:!1}"
1692
- player-software-version="${(Ka=i.playerSoftwareVersion)!=null?Ka:!1}"
1693
- env-key="${(Ya=i.envKey)!=null?Ya:!1}"
1694
- stream-type="${(Ga=i.streamType)!=null?Ga:!1}"
1695
- custom-domain="${(Za=i.customDomain)!=null?Za:!1}"
1696
- src="${i.src?i.src:i.playbackId?wa(i.playbackId,{domain:i.customDomain,token:i.tokens.playback}):!1}"
1697
- cast-src="${i.src?i.src:i.playbackId?wa(i.playbackId,{domain:i.customDomain,token:i.tokens.playback}):!1}"
1698
- cast-stream-type="${Va(i)?"live":!1}"
1952
+ beacon-collection-domain="${(de=i.beaconCollectionDomain)!=null?de:!1}"
1953
+ player-software-name="${(lt=i.playerSoftwareName)!=null?lt:!1}"
1954
+ player-software-version="${(yi=i.playerSoftwareVersion)!=null?yi:!1}"
1955
+ env-key="${(nn=i.envKey)!=null?nn:!1}"
1956
+ stream-type="${(sn=i.streamType)!=null?sn:!1}"
1957
+ custom-domain="${(on=i.customDomain)!=null?on:!1}"
1958
+ src="${i.src?i.src:i.playbackId?Zr(i.playbackId,{domain:i.customDomain,token:i.tokens.playback}):!1}"
1959
+ cast-src="${i.src?i.src:i.playbackId?Zr(i.playbackId,{domain:i.customDomain,token:i.tokens.playback}):!1}"
1960
+ cast-stream-type="${Co(i)?"live":!1}"
1699
1961
  exportparts="video"
1700
1962
  >
1701
- ${i.storyboard?X`<track label="thumbnails" default kind="metadata" src="${i.storyboard}" />`:X``}
1963
+ ${i.storyboard?ge`<track label="thumbnails" default kind="metadata" src="${i.storyboard}" />`:ge``}
1702
1964
  </mux-video>
1703
- ${Ha(i)?X`<button
1704
- slot="seek-live"
1705
- part="${Va(i)?"top":"bottom"} seek-live button"
1706
- disabled="${i.inLiveWindow||!i.hasSrc||i.isDialogOpen}"
1707
- aria-disabled="${(i.inLiveWindow||!i.hasSrc||i.isDialogOpen)&&"true"}"
1708
- in-live-window="${i.inLiveWindow}"
1709
- onclick="${function(lo){var er;if((er=i.onSeekToLive)==null||er.call(i,lo),i.paused){let uo=new CustomEvent("mediaplayrequest",{composed:!0,bubbles:!0});this.dispatchEvent(uo)}}}"
1710
- >
1711
- <svg viewBox="0 0 8 8"><circle cx="4" cy="4" r="4"></circle></svg>
1712
- Live
1713
- </button>`:X``}
1714
1965
  <mxp-dialog
1715
1966
  no-auto-hide
1716
- open="${(qa=i.isDialogOpen)!=null?qa:!1}"
1967
+ open="${(ln=i.isDialogOpen)!=null?ln:!1}"
1717
1968
  onclose="${i.onCloseErrorDialog}"
1718
1969
  oninitfocus="${i.onInitFocusDialog}"
1719
1970
  >
1720
- ${(Qa=i.dialog)!=null&&Qa.title?X`<h3>${i.dialog.title}</h3>`:X``}
1971
+ ${(dn=i.dialog)!=null&&dn.title?ge`<h3>${i.dialog.title}</h3>`:ge``}
1721
1972
  <p>
1722
- ${(za=i.dialog)==null?void 0:za.message}
1723
- ${(Xa=i.dialog)!=null&&Xa.linkUrl?X`<a
1973
+ ${(cn=i.dialog)==null?void 0:cn.message}
1974
+ ${(un=i.dialog)!=null&&un.linkUrl?ge`<a
1724
1975
  href="${i.dialog.linkUrl}"
1725
1976
  target="_blank"
1726
1977
  rel="external noopener"
1727
- aria-label="${(ja=i.dialog.linkText)!=null?ja:""} ${y("(opens in a new window)")}"
1728
- >${(Ja=i.dialog.linkText)!=null?Ja:i.dialog.linkUrl}</a
1729
- >`:X``}
1978
+ aria-label="${(mn=i.dialog.linkText)!=null?mn:""} ${_("(opens in a new window)")}"
1979
+ >${(hn=i.dialog.linkText)!=null?hn:i.dialog.linkUrl}</a
1980
+ >`:ge``}
1730
1981
  </p>
1731
1982
  </mxp-dialog>
1732
1983
  </media-theme>
1733
- `};var Mt=require("@mux/mux-video");function Ai(i,e,t,a,r){var l,c,m;let n={},s={};switch(i.code){case Mt.MediaError.MEDIA_ERR_NETWORK:{switch(n.title=y("Network Error",r),n.message=i.message,(l=i.data)==null?void 0:l.response.code){case 412:{n.title=y("Video is not currently available",r),n.message=y("The live stream or video file are not yet ready.",r),s.message=y("This playback-id may belong to a live stream that is not currently active or an asset that is not ready.",r),s.file="412-not-playable.md";break}case 404:{n.title=y("Video does not exist",r),n.message="",s.message=y("This playback-id does not exist. You may have used an Asset ID or an ID from a different resource.",r),s.file="404-not-found.md";break}case 403:{if(n.title=y("Invalid playback URL",r),n.message=y("The video URL or playback-token are formatted with incorrect or incomplete information.",r),s.message=y("403 error trying to access this playback URL. If this is a signed URL, you might need to provide a playback-token.",r),s.file="missing-signed-tokens.md",!a)break;let{exp:E,aud:f,sub:w}=he(a),T=Date.now()>E*1e3,P=w!==t,M=f!=="v",R={timeStyle:"medium",dateStyle:"medium"};if(T){n.title=y("Video URL has expired",r),n.message=y("The video\u2019s secured playback-token has expired.",r),s.message=y("This playback is using signed URLs and the playback-token has expired. Expired at: {expiredDate}. Current time: {currentDate}.",r).format({expiredDate:new Intl.DateTimeFormat(Me.code,R).format(E*1e3),currentDate:new Intl.DateTimeFormat(Me.code,R).format(Date.now())}),s.file="403-expired-token.md";break}if(P){n.title=y("Video URL is formatted incorrectly",r),n.message=y("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),s.message=y("The specified playback ID {playbackId} and the playback ID encoded in the playback-token {tokenPlaybackId} do not match.",r).format({playbackId:t,tokenPlaybackId:w}),s.file="403-playback-id-mismatch.md";break}if(M){n.title=y("Video URL is formatted incorrectly",r),n.message=y("The playback-token is formatted with incorrect information.",r),s.message=y("The playback-token has an incorrect aud value: {tokenType}. aud value should be v.",r).format({tokenType:f}),s.file="403-incorrect-aud-value.md";break}s.message=y("403 error trying to access this playback URL. If this is a signed playback ID, the token might not have been generated correctly.",r),s.file="403-malformatted-token.md";break}}break}case Mt.MediaError.MEDIA_ERR_DECODE:{let{message:E}=i;n={title:y("Media Error",r),message:E},s.file="media-decode-error.md";break}case Mt.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:{let E=(m=(c=i.data)==null?void 0:c.response)==null?void 0:m.code;if(E>=400&&E<500){i.code=Mt.MediaError.MEDIA_ERR_NETWORK,i.data={response:{code:E}},{dialog:n,devlog:s}=Ai(i,e,t,a);break}n={title:y("Source Not Supported",r),message:i.message},s.file="media-src-not-supported.md";break}default:n={title:y("Error",r),message:i.message};break}return e&&(n={title:y("Your device appears to be offline",r),message:y("Check your internet connection and try reloading this video.",r)}),{dialog:n,devlog:s}}var pl=Object.values(k.StreamTypes),bl=700,El=300,Wa={LG:"large",SM:"small",XS:"extra-small"};function _i(i){let e=i.getBoundingClientRect();return e.width<El?Wa.XS:e.width<bl?Wa.SM:Wa.LG}var le={SRC:"src",POSTER:"poster"},b={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"};function fl(i,e){var a,r;return{src:!i.playbackId&&i.src,playbackId:i.playbackId,hasSrc:!!i.playbackId||!!i.src,poster:i.poster,storyboard:i.storyboard,storyboardSrc:i.getAttribute(b.STORYBOARD_SRC),placeholder:i.getAttribute("placeholder"),theme:i.getAttribute("theme"),thumbnailTime:!i.tokens.thumbnail&&i.thumbnailTime,autoplay:i.autoplay,crossOrigin:i.crossOrigin,loop:i.loop,noHotKeys:i.hasAttribute(b.NOHOTKEYS),hotKeys:i.getAttribute(b.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,metadata:i.metadata,playerSoftwareName:i.playerSoftwareName,playerSoftwareVersion:i.playerSoftwareVersion,startTime:i.startTime,preferPlayback:i.preferPlayback,audio:i.audio,streamType:i.streamType,primaryColor:i.primaryColor,secondaryColor:i.secondaryColor,forwardSeekOffset:i.forwardSeekOffset,backwardSeekOffset:i.backwardSeekOffset,defaultHiddenCaptions:i.defaultHiddenCaptions,defaultShowRemainingTime:i.defaultShowRemainingTime,playbackRates:i.getAttribute(b.PLAYBACK_RATES),customDomain:(a=i.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?a:void 0,playerSize:_i((r=i.mediaController)!=null?r:i),title:i.getAttribute(b.TITLE),...e}}var vl=Object.values(g.Attributes),gl=Object.values(le),Al=Object.values(b),_l=di(),yl="mux-player",eo={dialog:void 0,isDialogOpen:!1,inLiveWindow:!1},xe,St,de,Lt,ze,te,Xe,yi,Ii,to,Ae,Qe,je,Ti,Ct,Fa,Mi,io,ki,ao,Si,ro,Li,no,Ci,oo,wi,so,kt=class extends Ra{constructor(){super();I(this,Xe);I(this,Ii);I(this,Ae);I(this,je);I(this,Ct);I(this,Mi);I(this,ki);I(this,Si);I(this,Li);I(this,Ci);I(this,wi);I(this,xe,!1);I(this,St,{});I(this,de,!0);I(this,Lt,new li(this,"hotkeys"));I(this,ze,void 0);I(this,te,{...eo,onCloseErrorDialog:()=>S(this,Ae,Qe).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:t=>{La(this,H.activeElement)||t.preventDefault()},onSeekToLive:()=>Da(this)});this.attachShadow({mode:"open"}),S(this,Ii,to).call(this),this.isConnected&&S(this,Xe,yi).call(this)}static get observedAttributes(){var t;return[...(t=Ra.observedAttributes)!=null?t:[],...gl,...vl,...Al]}get theme(){var t;return(t=this.shadowRoot)==null?void 0:t.querySelector("media-theme")}get mediaController(){var t,a;return(a=(t=this.theme)==null?void 0:t.shadowRoot)==null?void 0:a.querySelector("media-controller")}get metadataFromAttrs(){return this.getAttributeNames().filter(t=>t.startsWith("metadata-")).reduce((t,a)=>{let r=this.getAttribute(a);return r!==null&&(t[a.replace(/^metadata-/,"").replace(/-/g,"_")]=r),t},{})}connectedCallback(){var a;S(this,Ct,Fa).call(this);let t=(a=this.shadowRoot)==null?void 0:a.querySelector("mux-video");t&&(t.metadata=this.metadataFromAttrs),S(this,Mi,io).call(this)}disconnectedCallback(){S(this,ki,ao).call(this)}attributeChangedCallback(t,a,r){switch(v(this,xe)||S(this,Xe,yi).call(this),super.attributeChangedCallback(t,a,r),t){case b.HOTKEYS:v(this,Lt).value=r;break;case b.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&pe(y("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case b.THUMBNAIL_TOKEN:{let{aud:s}=he(r);r&&s!=="t"&&pe(y("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:s}));break}case b.STORYBOARD_TOKEN:{let{aud:s}=he(r);r&&s!=="s"&&pe(y("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:s}));break}case g.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&J(y("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r})),this.streamType?this.streamType!=null&&!pl.includes(this.streamType)&&ui({file:"invalid-stream-type.md",message:y("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand`, `live`, `ll-live`, `live:dvr`, or `ll-live:dvr`").format({streamType:this.streamType})}):ui({file:"invalid-stream-type.md",message:String(y("No stream-type value supplied. Defaulting to `on-demand`. Please provide stream-type as either: `on-demand`, `live`, `ll-live`, `live:dvr`, or `ll-live:dvr`"))});break}}[g.Attributes.PLAYBACK_ID,le.SRC,b.PLAYBACK_TOKEN].includes(t)&&a!==r&&V(this,te,{...v(this,te),...eo}),S(this,je,Ti).call(this,{[_n(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?k.CmcdTypeValues.includes(t)?this.setAttribute(g.Attributes.PREFER_CMCD,t):pe(`Invalid value for preferCmcd. Must be one of ${k.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(){return v(this,te).inLiveWindow}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 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=ge(this,le.SRC))!=null?t:void 0:(a=this.getAttribute(le.SRC))!=null?a:void 0}set src(t){t?this.setAttribute(le.SRC,t):this.removeAttribute(le.SRC)}get poster(){var a;let t=this.getAttribute(le.POSTER);if(t!=null)return t;if(this.playbackId&&!this.audio)return gn(this.playbackId,{domain:this.customDomain,thumbnailTime:(a=this.thumbnailTime)!=null?a:this.startTime,token:this.tokens.thumbnail})}set poster(t){t||t===""?this.setAttribute(le.POSTER,t):this.removeAttribute(le.POSTER)}get storyboardSrc(){var t;return(t=this.getAttribute(b.STORYBOARD_SRC))!=null?t:void 0}set storyboardSrc(t){t?this.setAttribute(b.STORYBOARD_SRC,t):this.removeAttribute(b.STORYBOARD_SRC)}get storyboard(){if(!this.audio&&(!this.streamType||![k.StreamTypes.LIVE,k.StreamTypes.LL_LIVE,k.StreamTypes.DVR,k.StreamTypes.LL_DVR].includes(this.streamType))){if(this.storyboardSrc&&!this.tokens.storyboard)return this.storyboardSrc;if(this.playbackId)return An(this.playbackId,{domain:this.customDomain,token:this.tokens.storyboard})}}get audio(){return this.hasAttribute(b.AUDIO)}set audio(t){if(!t){this.removeAttribute(b.AUDIO);return}this.setAttribute(b.AUDIO,"")}get hotkeys(){return v(this,Lt)}get nohotkeys(){return this.hasAttribute(b.NOHOTKEYS)}set nohotkeys(t){if(!t){this.removeAttribute(b.NOHOTKEYS);return}this.setAttribute(b.NOHOTKEYS,"")}get thumbnailTime(){return re(this.getAttribute(b.THUMBNAIL_TIME))}set thumbnailTime(t){this.setAttribute(b.THUMBNAIL_TIME,`${t}`)}get title(){var t;return(t=this.getAttribute(b.TITLE))!=null?t:""}set title(t){t!==this.title&&(t?this.setAttribute(b.TITLE,t):this.removeAttribute("title"),super.title=t)}get placeholder(){var t;return(t=ge(this,b.PLACEHOLDER))!=null?t:""}set placeholder(t){this.setAttribute(b.PLACEHOLDER,`${t}`)}get primaryColor(){var t;return(t=this.getAttribute(b.PRIMARY_COLOR))!=null?t:void 0}set primaryColor(t){this.setAttribute(b.PRIMARY_COLOR,`${t}`)}get secondaryColor(){var t;return(t=this.getAttribute(b.SECONDARY_COLOR))!=null?t:"rgb(0 0 0 / .65)"}set secondaryColor(t){this.setAttribute(b.SECONDARY_COLOR,`${t}`)}get defaultShowRemainingTime(){return this.hasAttribute(b.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(t){t?this.setAttribute(b.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(b.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(!!this.hasAttribute(b.PLAYBACK_RATES))return this.getAttribute(b.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(b.PLAYBACK_RATES);return}this.setAttribute(b.PLAYBACK_RATES,t.join(" "))}get forwardSeekOffset(){var t;return(t=re(this.getAttribute(b.FORWARD_SEEK_OFFSET)))!=null?t:10}set forwardSeekOffset(t){this.setAttribute(b.FORWARD_SEEK_OFFSET,`${t}`)}get backwardSeekOffset(){var t;return(t=re(this.getAttribute(b.BACKWARD_SEEK_OFFSET)))!=null?t:10}set backwardSeekOffset(t){this.setAttribute(b.BACKWARD_SEEK_OFFSET,`${t}`)}get defaultHiddenCaptions(){return this.hasAttribute(b.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(t){t?this.setAttribute(b.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(b.DEFAULT_HIDDEN_CAPTIONS)}get playerSoftwareName(){var t;return(t=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_NAME))!=null?t:yl}get playerSoftwareVersion(){var t;return(t=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_VERSION))!=null?t:_l}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 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=ge(this,g.Attributes.ENV_KEY))!=null?t:void 0}set envKey(t){this.setAttribute(g.Attributes.ENV_KEY,`${t}`)}get debug(){return ge(this,g.Attributes.DEBUG)!=null}set debug(t){t?this.setAttribute(g.Attributes.DEBUG,""):this.removeAttribute(g.Attributes.DEBUG)}get disableCookies(){return ge(this,g.Attributes.DISABLE_COOKIES)!=null}set disableCookies(t){t?this.setAttribute(g.Attributes.DISABLE_COOKIES,""):this.removeAttribute(g.Attributes.DISABLE_COOKIES)}get streamType(){return ge(this,g.Attributes.STREAM_TYPE)}set streamType(t){this.setAttribute(g.Attributes.STREAM_TYPE,`${t}`)}get startTime(){return re(ge(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===k.PlaybackTypes.MSE||t===k.PlaybackTypes.NATIVE)return t}set preferPlayback(t){t!==this.preferPlayback&&(t===k.PlaybackTypes.MSE||t===k.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(v(this,xe)||S(this,Xe,yi).call(this),!this.media){J("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...this.metadataFromAttrs,...t}}get tokens(){let t=this.getAttribute(b.PLAYBACK_TOKEN),a=this.getAttribute(b.THUMBNAIL_TOKEN),r=this.getAttribute(b.STORYBOARD_TOKEN);return{...v(this,St),...t!=null?{playback:t}:{},...a!=null?{thumbnail:a}:{},...r!=null?{storyboard:r}:{}}}set tokens(t){V(this,St,t!=null?t:{})}get playbackToken(){var t;return(t=this.getAttribute(b.PLAYBACK_TOKEN))!=null?t:void 0}set playbackToken(t){this.setAttribute(b.PLAYBACK_TOKEN,`${t}`)}get thumbnailToken(){var t;return(t=this.getAttribute(b.THUMBNAIL_TOKEN))!=null?t:void 0}set thumbnailToken(t){this.setAttribute(b.THUMBNAIL_TOKEN,`${t}`)}get storyboardToken(){var t;return(t=this.getAttribute(b.STORYBOARD_TOKEN))!=null?t:void 0}set storyboardToken(t){this.setAttribute(b.STORYBOARD_TOKEN,`${t}`)}addTextTrack(t,a,r,n){var l;let s=(l=this.media)==null?void 0:l.nativeEl;if(!!s)return(0,k.addTextTrack)(s,t,a,r,n)}removeTextTrack(t){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(!!a)return(0,k.removeTextTrack)(a,t)}get textTracks(){var t;return(t=this.media)==null?void 0:t.textTracks}};xe=new WeakMap,St=new WeakMap,de=new WeakMap,Lt=new WeakMap,ze=new WeakMap,te=new WeakMap,Xe=new WeakSet,yi=function(){var t,a;if(!v(this,xe)){V(this,xe,!0),S(this,Ae,Qe).call(this,{playerSize:_i(this)});try{if(customElements.upgrade(this.theme),!(this.theme instanceof D.HTMLElement))throw""}catch{J("<media-theme> failed to upgrade!")}try{if(customElements.upgrade(this.media),!(this.media instanceof g.default))throw""}catch{J("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof dt))throw""}catch{J("<media-controller> failed to upgrade!")}Ln(this),S(this,Li,no).call(this),S(this,Ci,oo).call(this),S(this,Si,ro).call(this),V(this,de,(a=(t=this.mediaController)==null?void 0:t.hasAttribute("user-inactive"))!=null?a:!0),S(this,wi,so).call(this)}},Ii=new WeakSet,to=function(){var t,a;try{(t=window==null?void 0:window.CSS)==null||t.registerProperty({name:"--primary-color",syntax:"<color>",inherits:!0,initialValue:"white"}),(a=window==null?void 0:window.CSS)==null||a.registerProperty({name:"--secondary-color",syntax:"<color>",inherits:!0,initialValue:"transparent"})}catch{}},Ae=new WeakSet,Qe=function(t){Object.assign(v(this,te),t),S(this,je,Ti).call(this)},je=new WeakSet,Ti=function(t={}){jn(Jn(fl(this,{...v(this,te),...t})),this.shadowRoot)},Ct=new WeakSet,Fa=function(){var t,a;v(this,te).playerSize!=_i((t=this.mediaController)!=null?t:this)&&S(this,Ae,Qe).call(this,{playerSize:_i((a=this.mediaController)!=null?a:this)})},Mi=new WeakSet,io=function(){var t;V(this,ze,new ResizeObserver(()=>S(this,Ct,Fa).call(this))),v(this,ze).observe((t=this.mediaController)!=null?t:this)},ki=new WeakSet,ao=function(){var t;(t=v(this,ze))==null||t.disconnect()},Si=new WeakSet,ro=function(){var a,r,n,s,l;(a=this.mediaController)==null||a.addEventListener("mediaplayrequest",c=>{var m;((m=c.target)==null?void 0:m.localName)==="media-play-button"&&this.streamType&&[k.StreamTypes.LIVE,k.StreamTypes.LL_LIVE,k.StreamTypes.DVR,k.StreamTypes.LL_DVR].includes(this.streamType)&&this.hasPlayed&&Da(this)});let t=()=>{let c=Tn(this),m=v(this,te).inLiveWindow;c!==m&&(S(this,Ae,Qe).call(this,{inLiveWindow:c}),this.dispatchEvent(new CustomEvent("inlivewindowchange",{composed:!0,bubbles:!0,detail:this.inLiveWindow})))};(r=this.media)==null||r.addEventListener("progress",t),(n=this.media)==null||n.addEventListener("waiting",t),(s=this.media)==null||s.addEventListener("timeupdate",t),(l=this.media)==null||l.addEventListener("emptied",t)},Li=new WeakSet,no=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)){pe(n),n.data&&pe(`${n.name} data:`,n.data);return}let{dialog:s,devlog:l}=Ai(n,!window.navigator.onLine,this.playbackId,this.playbackToken);l.message&&ui(l),J(n),n.data&&J(`${n.name} data:`,n.data),S(this,Ae,Qe).call(this,{isDialogOpen:!0,dialog:s})};this.addEventListener("error",t),this.media&&(this.media.errorTranslator=(r={})=>{var s,l,c;if(!((s=this.media)!=null&&s.error))return r;let{devlog:n}=Ai((l=this.media)==null?void 0:l.error,!window.navigator.onLine,this.playbackId,this.playbackToken,!1);return{player_error_code:(c=this.media)==null?void 0:c.error.code,player_error_message:n.message?String(n.message):r.player_error_message}}),(a=this.media)==null||a.addEventListener("error",r=>{var s,l;let{detail:n}=r;if(!n){let{message:c,code:m}=(l=(s=this.media)==null?void 0:s.error)!=null?l:{};n=new g.MediaError(c,m)}!(n!=null&&n.fatal)||this.dispatchEvent(new CustomEvent("error",{detail:n}))})},Ci=new WeakSet,oo=function(){var a,r,n,s;let t=()=>S(this,je,Ti).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",t),(s=(n=this.media)==null?void 0:n.textTracks)==null||s.addEventListener("removetrack",t)},wi=new WeakSet,so=function(){var E,f,w;let t=this.mediaController,a=/.*Version\/.*Safari\/.*/.test(navigator.userAgent);if(a)return;let r,n=new WeakMap,s=()=>this.streamType&&[k.StreamTypes.LIVE,k.StreamTypes.LL_LIVE].includes(this.streamType)&&!this.secondaryColor&&this.offsetWidth>=800,l=(T,P,M=!1)=>{if(s())return;Array.from(T&&T.activeCues||[]).forEach(L=>{if(!(!L.snapToLines||L.line<-5||L.line>=0&&L.line<10))if(!P||this.paused){let G=L.text.split(`
1734
- `).length,Z=a?-2:-3;this.streamType&&[k.StreamTypes.LIVE,k.StreamTypes.LL_LIVE].includes(this.streamType)&&(Z=a?-1:-2);let ie=Z-G;if(L.line===ie&&!M)return;n.has(L)||n.set(L,L.line),L.line=ie-1,L.line=ie}else setTimeout(()=>{L.line=n.get(L)||"auto"},500)})},c=()=>{var T;l(r,(T=t==null?void 0:t.hasAttribute("user-inactive"))!=null?T:!1)},m=()=>{var M;let P=Array.from(((M=t==null?void 0:t.media)==null?void 0:M.textTracks)||[]).filter(R=>["subtitles","captions"].includes(R.kind)&&R.mode==="showing")[0];P!==r&&(r==null||r.removeEventListener("cuechange",c)),r=P,r==null||r.addEventListener("cuechange",c),l(r,v(this,de))};if(m(),(E=t==null?void 0:t.media)==null||E.textTracks.addEventListener("change",m),(f=t==null?void 0:t.media)==null||f.textTracks.addEventListener("addtrack",m),navigator.userAgent.includes("Chrome/")){let T=()=>{l(r,v(this,de),!0),this.paused||window.requestAnimationFrame(T)};(w=t==null?void 0:t.media)==null||w.addEventListener("playing",()=>{T()})}t==null||t.addEventListener("userinactivechange",()=>{let T=t==null?void 0:t.hasAttribute("user-inactive");v(this,de)!==T&&(V(this,de,T),l(r,v(this,de)))})};function ge(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}D.customElements.get("mux-player")||(D.customElements.define("mux-player",kt),D.MuxPlayerElement=kt);var Tl=kt;
1984
+ `};var bi=require("@mux/mux-video");function Aa(i,e,t,a,r){var d,c,m;let n={},s={};switch(i.code){case bi.MediaError.MEDIA_ERR_NETWORK:{switch(n.title=_("Network Error",r),n.message=i.message,(d=i.data)==null?void 0:d.response.code){case 412:{n.title=_("Video is not currently available",r),n.message=_("The live stream or video file are not yet ready.",r),s.message=_("This playback-id may belong to a live stream that is not currently active or an asset that is not ready.",r),s.file="412-not-playable.md";break}case 404:{n.title=_("Video does not exist",r),n.message="",s.message=_("This playback-id does not exist. You may have used an Asset ID or an ID from a different resource.",r),s.file="404-not-found.md";break}case 403:{if(n.title=_("Invalid playback URL",r),n.message=_("The video URL or playback-token are formatted with incorrect or incomplete information.",r),s.message=_("403 error trying to access this playback URL. If this is a signed URL, you might need to provide a playback-token.",r),s.file="missing-signed-tokens.md",!a)break;let{exp:b,aud:y,sub:f}=De(a),I=Date.now()>b*1e3,B=f!==t,D=y!=="v",M={timeStyle:"medium",dateStyle:"medium"};if(I){n.title=_("Video URL has expired",r),n.message=_("The video\u2019s secured playback-token has expired.",r),s.message=_("This playback is using signed URLs and the playback-token has expired. Expired at: {expiredDate}. Current time: {currentDate}.",r).format({expiredDate:new Intl.DateTimeFormat(Xe.code,M).format(b*1e3),currentDate:new Intl.DateTimeFormat(Xe.code,M).format(Date.now())}),s.file="403-expired-token.md";break}if(B){n.title=_("Video URL is formatted incorrectly",r),n.message=_("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),s.message=_("The specified playback ID {playbackId} and the playback ID encoded in the playback-token {tokenPlaybackId} do not match.",r).format({playbackId:t,tokenPlaybackId:f}),s.file="403-playback-id-mismatch.md";break}if(D){n.title=_("Video URL is formatted incorrectly",r),n.message=_("The playback-token is formatted with incorrect information.",r),s.message=_("The playback-token has an incorrect aud value: {tokenType}. aud value should be v.",r).format({tokenType:y}),s.file="403-incorrect-aud-value.md";break}s.message=_("403 error trying to access this playback URL. If this is a signed playback ID, the token might not have been generated correctly.",r),s.file="403-malformatted-token.md";break}}break}case bi.MediaError.MEDIA_ERR_DECODE:{let{message:b}=i;n={title:_("Media Error",r),message:b},s.file="media-decode-error.md";break}case bi.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:{let b=(m=(c=i.data)==null?void 0:c.response)==null?void 0:m.code;if(b>=400&&b<500){i.code=bi.MediaError.MEDIA_ERR_NETWORK,i.data={response:{code:b}},{dialog:n,devlog:s}=Aa(i,e,t,a);break}n={title:_("Source Not Supported",r),message:i.message},s.file="media-src-not-supported.md";break}default:n={title:_("Error",r),message:i.message};break}return e&&(n={title:_("Your device appears to be offline",r),message:_("Check your internet connection and try reloading this video.",r)}),{dialog:n,devlog:s}}var $d=Object.values(x.StreamTypes),Ae={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"};function Wd(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"),theme:i.getAttribute("theme"),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,metadata:i.metadata,playerSoftwareName:i.playerSoftwareName,playerSoftwareVersion:i.playerSoftwareVersion,startTime:i.startTime,preferPlayback:i.preferPlayback,audio:i.audio,streamType:i.streamType,primaryColor:i.primaryColor,secondaryColor:i.secondaryColor,forwardSeekOffset:i.forwardSeekOffset,backwardSeekOffset:i.backwardSeekOffset,defaultHiddenCaptions:i.defaultHiddenCaptions,defaultShowRemainingTime:i.defaultShowRemainingTime,playbackRates:i.getAttribute(E.PLAYBACK_RATES),customDomain:(a=i.getAttribute(v.Attributes.CUSTOM_DOMAIN))!=null?a:void 0,title:i.getAttribute(E.TITLE),...e}}var Vd=Object.values(v.Attributes),Fd=Object.values(Ae),Kd=Object.values(E),Yd=da(),Gd="mux-player",xo={dialog:void 0,isDialogOpen:!1},He,gi,_e,Ai,nt,st,Ei,_a,Do,_i,rn,ot,fi,ya,Ro,Ia,Oo,Ta,Po,vi=class extends Qr{constructor(){super();L(this,st);L(this,_a);L(this,_i);L(this,ot);L(this,ya);L(this,Ia);L(this,Ta);L(this,He,!1);L(this,gi,{});L(this,_e,!0);L(this,Ai,new la(this,"hotkeys"));L(this,nt,{...xo,onCloseErrorDialog:()=>P(this,_i,rn).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:t=>{Yr(this,F.activeElement)||t.preventDefault()}});this.attachShadow({mode:"open"}),P(this,_a,Do).call(this),this.isConnected&&P(this,st,Ei).call(this)}static get observedAttributes(){var t;return[...(t=Qr.observedAttributes)!=null?t:[],...Fd,...Vd,...Kd]}get theme(){var t;return(t=this.shadowRoot)==null?void 0:t.querySelector("media-theme")}get mediaController(){var t,a;return(a=(t=this.theme)==null?void 0:t.shadowRoot)==null?void 0:a.querySelector("media-controller")}get metadataFromAttrs(){return this.getAttributeNames().filter(t=>t.startsWith("metadata-")).reduce((t,a)=>{let r=this.getAttribute(a);return r!==null&&(t[a.replace(/^metadata-/,"").replace(/-/g,"_")]=r),t},{})}connectedCallback(){var a;let t=(a=this.shadowRoot)==null?void 0:a.querySelector("mux-video");t&&(t.metadata=this.metadataFromAttrs)}attributeChangedCallback(t,a,r){switch(A(this,He)||P(this,st,Ei).call(this),super.attributeChangedCallback(t,a,r),t){case E.HOTKEYS:A(this,Ai).value=r;break;case E.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&Re(_("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case E.THUMBNAIL_TOKEN:{let{aud:s}=De(r);r&&s!=="t"&&Re(_("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:s}));break}case E.STORYBOARD_TOKEN:{let{aud:s}=De(r);r&&s!=="s"&&Re(_("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:s}));break}case v.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&re(_("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r})),this.streamType?this.streamType!=null&&!$d.includes(this.streamType)&&ca({file:"invalid-stream-type.md",message:_("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand`, `live`, `ll-live`, `live:dvr`, or `ll-live:dvr`").format({streamType:this.streamType})}):ca({file:"invalid-stream-type.md",message:String(_("No stream-type value supplied. Defaulting to `on-demand`. Please provide stream-type as either: `on-demand`, `live`, `ll-live`, `live:dvr`, or `ll-live:dvr`"))});break}}[v.Attributes.PLAYBACK_ID,Ae.SRC,E.PLAYBACK_TOKEN].includes(t)&&a!==r&&G(this,nt,{...A(this,nt),...xo}),P(this,ot,fi).call(this,{[zs(t)]:r})}get preferCmcd(){var t;return(t=this.getAttribute(v.Attributes.PREFER_CMCD))!=null?t:void 0}set preferCmcd(t){t!==this.preferCmcd&&(t?x.CmcdTypeValues.includes(t)?this.setAttribute(v.Attributes.PREFER_CMCD,t):Re(`Invalid value for preferCmcd. Must be one of ${x.CmcdTypeValues.join()}`):this.removeAttribute(v.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 playbackId(){var t;return(t=this.getAttribute(v.Attributes.PLAYBACK_ID))!=null?t:void 0}set playbackId(t){t?this.setAttribute(v.Attributes.PLAYBACK_ID,t):this.removeAttribute(v.Attributes.PLAYBACK_ID)}get src(){var t,a;return this.playbackId?(t=Be(this,Ae.SRC))!=null?t:void 0:(a=this.getAttribute(Ae.SRC))!=null?a:void 0}set src(t){t?this.setAttribute(Ae.SRC,t):this.removeAttribute(Ae.SRC)}get poster(){var a;let t=this.getAttribute(Ae.POSTER);if(t!=null)return t;if(this.playbackId&&!this.audio)return qs(this.playbackId,{domain:this.customDomain,thumbnailTime:(a=this.thumbnailTime)!=null?a:this.startTime,token:this.tokens.thumbnail})}set poster(t){t||t===""?this.setAttribute(Ae.POSTER,t):this.removeAttribute(Ae.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.audio&&(!this.streamType||![x.StreamTypes.LIVE,x.StreamTypes.LL_LIVE,x.StreamTypes.DVR,x.StreamTypes.LL_DVR].includes(this.streamType))){if(this.storyboardSrc&&!this.tokens.storyboard)return this.storyboardSrc;if(this.playbackId)return Qs(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 A(this,Ai)}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=Be(this,E.PLACEHOLDER))!=null?t:""}set placeholder(t){this.setAttribute(E.PLACEHOLDER,`${t}`)}get primaryColor(){var t;return(t=this.getAttribute(E.PRIMARY_COLOR))!=null?t:void 0}set primaryColor(t){this.setAttribute(E.PRIMARY_COLOR,`${t}`)}get secondaryColor(){var t;return(t=this.getAttribute(E.SECONDARY_COLOR))!=null?t:"rgb(0 0 0 / .75)"}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(v.Attributes.PLAYER_SOFTWARE_NAME))!=null?t:Gd}get playerSoftwareVersion(){var t;return(t=this.getAttribute(v.Attributes.PLAYER_SOFTWARE_VERSION))!=null?t:Yd}get beaconCollectionDomain(){var t;return(t=this.getAttribute(v.Attributes.BEACON_COLLECTION_DOMAIN))!=null?t:void 0}set beaconCollectionDomain(t){t!==this.beaconCollectionDomain&&(t?this.setAttribute(v.Attributes.BEACON_COLLECTION_DOMAIN,t):this.removeAttribute(v.Attributes.BEACON_COLLECTION_DOMAIN))}get customDomain(){var t;return(t=this.getAttribute(v.Attributes.CUSTOM_DOMAIN))!=null?t:void 0}set customDomain(t){t!==this.customDomain&&(t?this.setAttribute(v.Attributes.CUSTOM_DOMAIN,t):this.removeAttribute(v.Attributes.CUSTOM_DOMAIN))}get envKey(){var t;return(t=Be(this,v.Attributes.ENV_KEY))!=null?t:void 0}set envKey(t){this.setAttribute(v.Attributes.ENV_KEY,`${t}`)}get debug(){return Be(this,v.Attributes.DEBUG)!=null}set debug(t){t?this.setAttribute(v.Attributes.DEBUG,""):this.removeAttribute(v.Attributes.DEBUG)}get disableCookies(){return Be(this,v.Attributes.DISABLE_COOKIES)!=null}set disableCookies(t){t?this.setAttribute(v.Attributes.DISABLE_COOKIES,""):this.removeAttribute(v.Attributes.DISABLE_COOKIES)}get streamType(){return Be(this,v.Attributes.STREAM_TYPE)}set streamType(t){this.setAttribute(v.Attributes.STREAM_TYPE,`${t}`)}get startTime(){return be(Be(this,v.Attributes.START_TIME))}set startTime(t){this.setAttribute(v.Attributes.START_TIME,`${t}`)}get preferPlayback(){let t=this.getAttribute(v.Attributes.PREFER_PLAYBACK);if(t===x.PlaybackTypes.MSE||t===x.PlaybackTypes.NATIVE)return t}set preferPlayback(t){t!==this.preferPlayback&&(t===x.PlaybackTypes.MSE||t===x.PlaybackTypes.NATIVE?this.setAttribute(v.Attributes.PREFER_PLAYBACK,t):this.removeAttribute(v.Attributes.PREFER_PLAYBACK))}get metadata(){var t;return(t=this.media)==null?void 0:t.metadata}set metadata(t){if(A(this,He)||P(this,st,Ei).call(this),!this.media){re("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...this.metadataFromAttrs,...t}}async addCuePoints(t){var a;if(A(this,He)||P(this,st,Ei).call(this),!this.media){re("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:[]}get tokens(){let t=this.getAttribute(E.PLAYBACK_TOKEN),a=this.getAttribute(E.THUMBNAIL_TOKEN),r=this.getAttribute(E.STORYBOARD_TOKEN);return{...A(this,gi),...t!=null?{playback:t}:{},...a!=null?{thumbnail:a}:{},...r!=null?{storyboard:r}:{}}}set tokens(t){G(this,gi,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 s=(d=this.media)==null?void 0:d.nativeEl;if(!!s)return(0,x.addTextTrack)(s,t,a,r,n)}removeTextTrack(t){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(!!a)return(0,x.removeTextTrack)(a,t)}get textTracks(){var t;return(t=this.media)==null?void 0:t.textTracks}};He=new WeakMap,gi=new WeakMap,_e=new WeakMap,Ai=new WeakMap,nt=new WeakMap,st=new WeakSet,Ei=function(){var t,a;if(!A(this,He)){G(this,He,!0),P(this,ot,fi).call(this);try{if(customElements.upgrade(this.theme),!(this.theme instanceof R.HTMLElement))throw""}catch{re("<media-theme> failed to upgrade!")}try{if(customElements.upgrade(this.media),!(this.media instanceof v.default))throw""}catch{re("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof Gt))throw""}catch{re("<media-controller> failed to upgrade!")}to(this),P(this,ya,Ro).call(this),P(this,Ia,Oo).call(this),G(this,_e,(a=(t=this.mediaController)==null?void 0:t.hasAttribute("user-inactive"))!=null?a:!0),P(this,Ta,Po).call(this)}},_a=new WeakSet,Do=function(){var t,a;try{(t=window==null?void 0:window.CSS)==null||t.registerProperty({name:"--primary-color",syntax:"<color>",inherits:!0,initialValue:"white"}),(a=window==null?void 0:window.CSS)==null||a.registerProperty({name:"--secondary-color",syntax:"<color>",inherits:!0,initialValue:"transparent"})}catch{}},_i=new WeakSet,rn=function(t){Object.assign(A(this,nt),t),P(this,ot,fi).call(this)},ot=new WeakSet,fi=function(t={}){ko(So(Wd(this,{...A(this,nt),...t})),this.shadowRoot)},ya=new WeakSet,Ro=function(){var a;let t=r=>{let{detail:n}=r;if(n instanceof v.MediaError||(n=new v.MediaError(n.message,n.code,n.fatal)),!(n!=null&&n.fatal)){Re(n),n.data&&Re(`${n.name} data:`,n.data);return}let{dialog:s,devlog:d}=Aa(n,!window.navigator.onLine,this.playbackId,this.playbackToken);d.message&&ca(d),re(n),n.data&&re(`${n.name} data:`,n.data),P(this,_i,rn).call(this,{isDialogOpen:!0,dialog:s})};this.addEventListener("error",t),this.media&&(this.media.errorTranslator=(r={})=>{var s,d,c;if(!((s=this.media)!=null&&s.error))return r;let{devlog:n}=Aa((d=this.media)==null?void 0:d.error,!window.navigator.onLine,this.playbackId,this.playbackToken,!1);return{player_error_code:(c=this.media)==null?void 0:c.error.code,player_error_message:n.message?String(n.message):r.player_error_message}}),(a=this.media)==null||a.addEventListener("error",r=>{var s,d;let{detail:n}=r;if(!n){let{message:c,code:m}=(d=(s=this.media)==null?void 0:s.error)!=null?d:{};n=new v.MediaError(c,m)}!(n!=null&&n.fatal)||this.dispatchEvent(new CustomEvent("error",{detail:n}))})},Ia=new WeakSet,Oo=function(){var a,r,n,s;let t=()=>P(this,ot,fi).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",t),(s=(n=this.media)==null?void 0:n.textTracks)==null||s.addEventListener("removetrack",t)},Ta=new WeakSet,Po=function(){var b,y,f;let t=this.mediaController,a=/.*Version\/.*Safari\/.*/.test(navigator.userAgent);if(a)return;let r,n=new WeakMap,s=()=>this.streamType&&[x.StreamTypes.LIVE,x.StreamTypes.LL_LIVE].includes(this.streamType)&&!this.secondaryColor&&this.offsetWidth>=800,d=(I,B,D=!1)=>{if(s())return;Array.from(I&&I.activeCues||[]).forEach(k=>{if(!(!k.snapToLines||k.line<-5||k.line>=0&&k.line<10))if(!B||this.paused){let j=k.text.split(`
1985
+ `).length,Q=a?-2:-3;this.streamType&&[x.StreamTypes.LIVE,x.StreamTypes.LL_LIVE].includes(this.streamType)&&(Q=a?-1:-2);let de=Q-j;if(k.line===de&&!D)return;n.has(k)||n.set(k,k.line),k.line=de-1,k.line=de}else setTimeout(()=>{k.line=n.get(k)||"auto"},500)})},c=()=>{var I;d(r,(I=t==null?void 0:t.hasAttribute("user-inactive"))!=null?I:!1)},m=()=>{var D;let B=Array.from(((D=t==null?void 0:t.media)==null?void 0:D.textTracks)||[]).filter(M=>["subtitles","captions"].includes(M.kind)&&M.mode==="showing")[0];B!==r&&(r==null||r.removeEventListener("cuechange",c)),r=B,r==null||r.addEventListener("cuechange",c),d(r,A(this,_e))};if(m(),(b=t==null?void 0:t.media)==null||b.textTracks.addEventListener("change",m),(y=t==null?void 0:t.media)==null||y.textTracks.addEventListener("addtrack",m),navigator.userAgent.includes("Chrome/")){let I=()=>{d(r,A(this,_e),!0),this.paused||window.requestAnimationFrame(I)};(f=t==null?void 0:t.media)==null||f.addEventListener("playing",()=>{I()})}t==null||t.addEventListener("userinactivechange",()=>{let I=t==null?void 0:t.hasAttribute("user-inactive");A(this,_e)!==I&&(G(this,_e,I),d(r,A(this,_e)))})};function Be(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}R.customElements.get("mux-player")||(R.customElements.define("mux-player",vi),R.MuxPlayerElement=vi);var Zd=vi;