@mux/mux-player 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var Vo=Object.create;var Rt=Object.defineProperty;var Ho=Object.getOwnPropertyDescriptor;var Wo=Object.getOwnPropertyNames;var Fo=Object.getPrototypeOf,Ko=Object.prototype.hasOwnProperty;var Yo=(t,i)=>{for(var e in i)Rt(t,e,{get:i[e],enumerable:!0})},or=(t,i,e,a)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of Wo(i))!Ko.call(t,r)&&r!==e&&Rt(t,r,{get:()=>i[r],enumerable:!(a=Ho(i,r))||a.enumerable});return t};var Go=(t,i,e)=>(e=t!=null?Vo(Fo(t)):{},or(i||!t||!t.__esModule?Rt(e,"default",{value:t,enumerable:!0}):e,t)),Zo=t=>or(Rt({},"__esModule",{value:!0}),t);var Si=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)};var v=(t,i,e)=>(Si(t,i,"read from private field"),e?e.call(t):i.get(t)),T=(t,i,e)=>{if(i.has(t))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(t):i.set(t,e)},B=(t,i,e,a)=>(Si(t,i,"write to private field"),a?a.call(t,e):i.set(t,e),e);var I=(t,i,e)=>(Si(t,i,"access private method"),e);var cd={};Yo(cd,{MediaError:()=>g.MediaError,default:()=>dd,getVideoAttribute:()=>ve});module.exports=Zo(cd);var Ne=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class t extends Ne{}globalThis.DocumentFragment=t}var it=class extends Ne{},ki=class extends Ne{},Qo={get(t){},define(t,i,e){},upgrade(t){},whenDefined(t){return Promise.resolve(it)}},at,Li=class{constructor(i,e={}){T(this,at,void 0);B(this,at,e==null?void 0:e.detail)}get detail(){return v(this,at)}initCustomEvent(){}};at=new WeakMap;function qo(t,i){return new it}var sr={document:{createElement:qo},DocumentFragment,customElements:Qo,CustomEvent:Li,EventTarget:Ne,HTMLElement:it,HTMLVideoElement:ki},lr=typeof window=="undefined"||typeof globalThis.customElements=="undefined",M=lr?sr:globalThis,G=lr?sr.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",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},rt={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"},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_CHROME_ATTRIBUTES:"media-chrome-attributes",MEDIA_CONTROLLER:"media-controller",MEDIA_LOADING:"media-loading",MEDIA_BUFFERED:"media-buffered"},hd=Object.entries(rt).reduce((t,[i,e])=>{let a=o[i];return a&&(t[e]=a),t},{userinactivechange:"user-inactive"}),dr=Object.entries(o).reduce((t,[i,e])=>{let a=rt[i];return a&&(t[e]=a),t},{"user-inactive":"userinactivechange"}),$e={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},_e={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Ci={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},Z={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"};var N={AUDIO_PLAYER:()=>"audio player",VIDEO_PLAYER:()=>"video player",VOLUME:()=>"volume",SEEK:()=>"seek",CLOSED_CAPTIONS:()=>"closed captions",PLAYBACK_RATE:({playbackRate:t=1}={})=>`current playback rate ${t}`,PLAYBACK_TIME:()=>"playback time",MEDIA_LOADING:()=>"media loading"},L={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:t=30}={})=>`seek forward ${t} seconds`,SEEK_BACK_N_SECS:({seekOffset:t=30}={})=>`seek back ${t} seconds`},jo={...N,...L};var Xo=t=>typeof t=="number"&&!Number.isNaN(t)&&Number.isFinite(t),cr=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],Jo=(t,i)=>{let e=t===1?cr[i].singular:cr[i].plural;return`${t} ${e}`},ye=t=>{if(!Xo(t))return"";let i=Math.abs(t),e=i!==t,a=new Date(0,0,0,0,0,i,0);return`${[a.getHours(),a.getMinutes(),a.getSeconds()].map((l,c)=>l&&Jo(l,c)).filter(l=>l).join(", ")}${e?" remaining":""}`};function z(t,i){let e=!1;t<0&&(e=!0,t=0-t),t=t<0?0:t;let a=Math.floor(t%60),r=Math.floor(t/60%60),n=Math.floor(t/3600),s=Math.floor(i/60%60),l=Math.floor(i/3600);return(isNaN(t)||t===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,(e?"-":"")+n+r+a}var ur={HTMLElement:function(){this.addEventListener=()=>{},this.removeEventListener=()=>{},this.dispatchEvent=()=>{}},customElements:{get:function(){},define:function(){},whenDefined:function(){}},CustomEvent:function(){}},ts={createElement:function(){return new ur.HTMLElement}},mr=typeof window=="undefined"||typeof window.customElements=="undefined",u=mr?ur:window,d=mr?ts:window.document;function p(t,i){u.customElements.get(t)||(u.customElements.define(t,i),u[i.name]=i)}var is=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)},Te=(t,i,e)=>(is(t,i,"read from private field"),e?e.call(t):i.get(t)),wi=(t,i,e)=>{if(i.has(t))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(t):i.set(t,e)},Pt,Be,Di,hr=d.createElement("template");hr.innerHTML=`
1
+ "use strict";var Vo=Object.create;var Rt=Object.defineProperty;var Ho=Object.getOwnPropertyDescriptor;var Wo=Object.getOwnPropertyNames;var Fo=Object.getPrototypeOf,Ko=Object.prototype.hasOwnProperty;var Yo=(t,i)=>{for(var e in i)Rt(t,e,{get:i[e],enumerable:!0})},or=(t,i,e,a)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of Wo(i))!Ko.call(t,r)&&r!==e&&Rt(t,r,{get:()=>i[r],enumerable:!(a=Ho(i,r))||a.enumerable});return t};var Go=(t,i,e)=>(e=t!=null?Vo(Fo(t)):{},or(i||!t||!t.__esModule?Rt(e,"default",{value:t,enumerable:!0}):e,t)),Zo=t=>or(Rt({},"__esModule",{value:!0}),t);var Mi=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)};var v=(t,i,e)=>(Mi(t,i,"read from private field"),e?e.call(t):i.get(t)),T=(t,i,e)=>{if(i.has(t))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(t):i.set(t,e)},$=(t,i,e,a)=>(Mi(t,i,"write to private field"),a?a.call(t,e):i.set(t,e),e);var I=(t,i,e)=>(Mi(t,i,"access private method"),e);var ud={};Yo(ud,{MediaError:()=>g.MediaError,default:()=>cd,getVideoAttribute:()=>Te});module.exports=Zo(ud);var Ne=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class t extends Ne{}globalThis.DocumentFragment=t}var it=class extends Ne{},ki=class extends Ne{},Qo={get(t){},define(t,i,e){},upgrade(t){},whenDefined(t){return Promise.resolve(it)}},at,Si=class{constructor(i,e={}){T(this,at,void 0);$(this,at,e==null?void 0:e.detail)}get detail(){return v(this,at)}initCustomEvent(){}};at=new WeakMap;function qo(t,i){return new it}var sr={document:{createElement:qo},DocumentFragment,customElements:Qo,CustomEvent:Si,EventTarget:Ne,HTMLElement:it,HTMLVideoElement:ki},lr=typeof window=="undefined"||typeof globalThis.customElements=="undefined",k=lr?sr:globalThis,Z=lr?sr.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",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},rt={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"},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_CHROME_ATTRIBUTES:"media-chrome-attributes",MEDIA_CONTROLLER:"media-controller",MEDIA_LOADING:"media-loading",MEDIA_BUFFERED:"media-buffered"},pd=Object.entries(rt).reduce((t,[i,e])=>{let a=o[i];return a&&(t[e]=a),t},{userinactivechange:"user-inactive"}),dr=Object.entries(o).reduce((t,[i,e])=>{let a=rt[i];return a&&(t[e]=a),t},{"user-inactive":"userinactivechange"}),$e={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},Me={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Li={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},Q={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"};var O={AUDIO_PLAYER:()=>"audio player",VIDEO_PLAYER:()=>"video player",VOLUME:()=>"volume",SEEK:()=>"seek",CLOSED_CAPTIONS:()=>"closed captions",PLAYBACK_RATE:({playbackRate:t=1}={})=>`current playback rate ${t}`,PLAYBACK_TIME:()=>"playback time",MEDIA_LOADING:()=>"media loading"},L={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:t=30}={})=>`seek forward ${t} seconds`,SEEK_BACK_N_SECS:({seekOffset:t=30}={})=>`seek back ${t} seconds`},jo={...O,...L};var Xo=t=>typeof t=="number"&&!Number.isNaN(t)&&Number.isFinite(t),cr=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],Jo=(t,i)=>{let e=t===1?cr[i].singular:cr[i].plural;return`${t} ${e}`},ke=t=>{if(!Xo(t))return"";let i=Math.abs(t),e=i!==t,a=new Date(0,0,0,0,0,i,0);return`${[a.getHours(),a.getMinutes(),a.getSeconds()].map((l,c)=>l&&Jo(l,c)).filter(l=>l).join(", ")}${e?" remaining":""}`};function j(t,i){let e=!1;t<0&&(e=!0,t=0-t),t=t<0?0:t;let a=Math.floor(t%60),r=Math.floor(t/60%60),n=Math.floor(t/3600),s=Math.floor(i/60%60),l=Math.floor(i/3600);return(isNaN(t)||t===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,(e?"-":"")+n+r+a}var ur={HTMLElement:function(){this.addEventListener=()=>{},this.removeEventListener=()=>{},this.dispatchEvent=()=>{}},customElements:{get:function(){},define:function(){},whenDefined:function(){}},CustomEvent:function(){}},ts={createElement:function(){return new ur.HTMLElement}},mr=typeof window=="undefined"||typeof window.customElements=="undefined",u=mr?ur:window,d=mr?ts:window.document;function p(t,i){u.customElements.get(t)||(u.customElements.define(t,i),u[i.name]=i)}var is=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)},Se=(t,i,e)=>(is(t,i,"read from private field"),e?e.call(t):i.get(t)),Ci=(t,i,e)=>{if(i.has(t))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(t):i.set(t,e)},Pt,Be,wi,hr=d.createElement("template");hr.innerHTML=`
2
2
  <style>
3
3
  :host {
4
4
  display: inline-flex;
@@ -50,7 +50,7 @@
50
50
  min-width: 100%;
51
51
  }
52
52
  </style>
53
- `;var Ut=class extends u.HTMLElement{constructor(i={}){super(),wi(this,Pt,n=>{this.handleClick(n)}),wi(this,Be,n=>{let{key:s}=n;if(!this.keysUsed.includes(s)){this.removeEventListener("keyup",Te(this,Be));return}this.handleClick(n)}),wi(this,Di,n=>{let{metaKey:s,altKey:l,key:c}=n;if(s||l||!this.keysUsed.includes(c)){this.removeEventListener("keyup",Te(this,Be));return}this.addEventListener("keyup",Te(this,Be),{once:!0})});let e=this.attachShadow({mode:"open"}),a=hr.content.cloneNode(!0);this.nativeEl=a;let r=i.slotTemplate;r||(r=d.createElement("template"),r.innerHTML=`<slot>${i.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),e.appendChild(a)}static get observedAttributes(){return["disabled",o.MEDIA_CONTROLLER]}enable(){this.addEventListener("click",Te(this,Pt)),this.addEventListener("keydown",Te(this,Di)),this.setAttribute("tabindex",0)}disable(){this.removeEventListener("click",Te(this,Pt)),this.removeEventListener("keyup",Te(this,Be)),this.removeAttribute("tabindex")}attributeChangedCallback(i,e,a){var r,n;if(i===o.MEDIA_CONTROLLER){if(e){let s=d.getElementById(e);(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 i==="disabled"&&a!==e&&(a==null?this.enable():this.disable())}connectedCallback(){var i;this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","button");let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.associateElement)==null||i.call(a,this)}}disconnectedCallback(){var i;this.disable();let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.unassociateElement)==null||i.call(a,this)}}get keysUsed(){return["Enter"," "]}handleClick(){}};Pt=new WeakMap;Be=new WeakMap;Di=new WeakMap;p("media-chrome-button",Ut);var w=Ut;var as=`<svg aria-hidden="true" viewBox="0 0 26 24">
53
+ `;var Ut=class extends u.HTMLElement{constructor(i={}){super(),Ci(this,Pt,n=>{this.handleClick(n)}),Ci(this,Be,n=>{let{key:s}=n;if(!this.keysUsed.includes(s)){this.removeEventListener("keyup",Se(this,Be));return}this.handleClick(n)}),Ci(this,wi,n=>{let{metaKey:s,altKey:l,key:c}=n;if(s||l||!this.keysUsed.includes(c)){this.removeEventListener("keyup",Se(this,Be));return}this.addEventListener("keyup",Se(this,Be),{once:!0})});let e=this.attachShadow({mode:"open"}),a=hr.content.cloneNode(!0);this.nativeEl=a;let r=i.slotTemplate;r||(r=d.createElement("template"),r.innerHTML=`<slot>${i.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),e.appendChild(a)}static get observedAttributes(){return["disabled",o.MEDIA_CONTROLLER]}enable(){this.addEventListener("click",Se(this,Pt)),this.addEventListener("keydown",Se(this,wi)),this.setAttribute("tabindex",0)}disable(){this.removeEventListener("click",Se(this,Pt)),this.removeEventListener("keyup",Se(this,Be)),this.removeAttribute("tabindex")}attributeChangedCallback(i,e,a){var r,n;if(i===o.MEDIA_CONTROLLER){if(e){let s=d.getElementById(e);(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 i==="disabled"&&a!==e&&(a==null?this.enable():this.disable())}connectedCallback(){var i;this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","button");let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.associateElement)==null||i.call(a,this)}}disconnectedCallback(){var i;this.disable();let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.unassociateElement)==null||i.call(a,this)}}get keysUsed(){return["Enter"," "]}handleClick(){}};Pt=new WeakMap;Be=new WeakMap;wi=new WeakMap;p("media-chrome-button",Ut);var w=Ut;var as=`<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
56
  `,pr=d.createElement("template");pr.innerHTML=`
@@ -71,14 +71,14 @@
71
71
 
72
72
  <slot name="enter">${rs}</slot>
73
73
  <slot name="exit">${ns}</slot>
74
- `;var br=t=>{let e=t.getAttribute(o.MEDIA_IS_CASTING)!=null?L.EXIT_CAST():L.ENTER_CAST();t.setAttribute("aria-label",e)},Ri=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_CASTING,o.MEDIA_CAST_UNAVAILABLE]}constructor(i={}){super({slotTemplate:Er,...i})}connectedCallback(){br(this),super.connectedCallback()}attributeChangedCallback(i,e,a){i===o.MEDIA_IS_CASTING&&br(this),super.attributeChangedCallback(i,e,a)}handleClick(i){let e=this.getAttribute(o.MEDIA_IS_CASTING)!=null?h.MEDIA_EXIT_CAST_REQUEST:h.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}};p("media-cast-button",Ri);var Ot=(t,i,e=".value")=>{let a=t.querySelector(e);!a||(a.textContent=i)},os=(t,i)=>{let e=`slot[name="${i}"]`,a=t.shadowRoot.querySelector(e);return a?a.children:[]},Nt=(t,i)=>os(t,i)[0],nt=(t,i)=>!t||!i?!1:t.contains(i)?!0:nt(t,i.getRootNode().host),ot=(t,i)=>{if(!t)return null;let e=t.closest(i);return e||ot(t.getRootNode().host,i)};function oe(t,i){var e,a;let r;for(r of t.querySelectorAll("style"))for(let n of(a=(e=r.sheet)==null?void 0:e.cssRules)!=null?a:[])if(n.selectorText===i)return n;return r!=null&&r.sheet?(r.sheet.insertRule(`${i}{}`,r.sheet.cssRules.length),r.sheet.cssRules[r.sheet.cssRules.length-1]):{style:{setProperty:()=>{}}}}var gr=d.createElement("template");gr.innerHTML=`
74
+ `;var br=t=>{let e=t.getAttribute(o.MEDIA_IS_CASTING)!=null?L.EXIT_CAST():L.ENTER_CAST();t.setAttribute("aria-label",e)},Di=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_CASTING,o.MEDIA_CAST_UNAVAILABLE]}constructor(i={}){super({slotTemplate:Er,...i})}connectedCallback(){br(this),super.connectedCallback()}attributeChangedCallback(i,e,a){i===o.MEDIA_IS_CASTING&&br(this),super.attributeChangedCallback(i,e,a)}handleClick(i){let e=this.getAttribute(o.MEDIA_IS_CASTING)!=null?h.MEDIA_EXIT_CAST_REQUEST:h.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}};p("media-cast-button",Di);var Ot=(t,i,e=".value")=>{let a=t.querySelector(e);!a||(a.textContent=i)},os=(t,i)=>{let e=`slot[name="${i}"]`,a=t.shadowRoot.querySelector(e);return a?a.children:[]},Nt=(t,i)=>os(t,i)[0],nt=(t,i)=>!t||!i?!1:t.contains(i)?!0:nt(t,i.getRootNode().host),ot=(t,i)=>{if(!t)return null;let e=t.closest(i);return e||ot(t.getRootNode().host,i)};function re(t,i){var e;let a;for(a of t.querySelectorAll("style")){let r;try{r=(e=a.sheet)==null?void 0:e.cssRules}catch{continue}for(let n of r!=null?r:[])if(n.selectorText===i)return n}return a!=null&&a.sheet?(a.sheet.insertRule(`${i}{}`,a.sheet.cssRules.length),a.sheet.cssRules[a.sheet.cssRules.length-1]):{style:{setProperty:()=>{}}}}var gr=d.createElement("template");gr.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 Pi=class extends u.HTMLElement{static get observedAttributes(){return[o.MEDIA_CONTROLLER,o.MEDIA_PAUSED]}constructor(i={}){super();let e=this.attachShadow({mode:"open"}),a=gr.content.cloneNode(!0);this.nativeEl=a;let r=i.slotTemplate;r||(r=d.createElement("template"),r.innerHTML=`<slot>${i.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),e.appendChild(a)}attributeChangedCallback(i,e,a){var r,n;if(i===o.MEDIA_CONTROLLER){if(e){let s=d.getElementById(e);(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 i;this.setAttribute("tabindex",-1),this.setAttribute("aria-hidden",!0);let e=fr(this);this.getAttribute(o.MEDIA_CONTROLLER)&&((i=e==null?void 0:e.associateElement)==null||i.call(e,this)),e==null||e.addEventListener("pointerdown",this),e==null||e.addEventListener("click",this)}disconnectedCallback(){var i;let e=fr(this);this.getAttribute(o.MEDIA_CONTROLLER)&&((i=e==null?void 0:e.unassociateElement)==null||i.call(e,this)),e==null||e.removeEventListener("pointerdown",this),e==null||e.removeEventListener("click",this)}handleEvent(i){var e;let a=(e=i.composedPath())==null?void 0:e[0];if(!!["video","media-controller"].includes(a==null?void 0:a.localName)){if(i.type==="pointerdown")this._pointerType=i.pointerType;else if(i.type==="click"){let{clientX:n,clientY:s}=i,{left:l,top:c,width:m,height:E}=this.getBoundingClientRect(),y=n-l,k=s-c;if(y<0||k<0||y>m||k>E||m===0&&E===0)return;let{pointerType:_=this._pointerType}=i;if(this._pointerType=void 0,_===Ci.TOUCH){this.handleTap(i);return}else if(_===Ci.MOUSE){this.handleMouseClick(i);return}}}}handleTap(){}handleMouseClick(){let i=this.getAttribute(o.MEDIA_PAUSED)!=null?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new u.CustomEvent(i,{composed:!0,bubbles:!0}))}};function fr(t){let i=t.getAttribute(o.MEDIA_CONTROLLER);return i?d.getElementById(i):ot(t,"media-controller")}p("media-gesture-receiver",Pi);var vr=d.createElement("template");vr.innerHTML=`
81
+ `;var Ri=class extends u.HTMLElement{static get observedAttributes(){return[o.MEDIA_CONTROLLER,o.MEDIA_PAUSED]}constructor(i={}){super();let e=this.attachShadow({mode:"open"}),a=gr.content.cloneNode(!0);this.nativeEl=a;let r=i.slotTemplate;r||(r=d.createElement("template"),r.innerHTML=`<slot>${i.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),e.appendChild(a)}attributeChangedCallback(i,e,a){var r,n;if(i===o.MEDIA_CONTROLLER){if(e){let s=d.getElementById(e);(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 i;this.setAttribute("tabindex",-1),this.setAttribute("aria-hidden",!0);let e=fr(this);this.getAttribute(o.MEDIA_CONTROLLER)&&((i=e==null?void 0:e.associateElement)==null||i.call(e,this)),e==null||e.addEventListener("pointerdown",this),e==null||e.addEventListener("click",this)}disconnectedCallback(){var i;let e=fr(this);this.getAttribute(o.MEDIA_CONTROLLER)&&((i=e==null?void 0:e.unassociateElement)==null||i.call(e,this)),e==null||e.removeEventListener("pointerdown",this),e==null||e.removeEventListener("click",this)}handleEvent(i){var e;let a=(e=i.composedPath())==null?void 0:e[0];if(!!["video","media-controller"].includes(a==null?void 0:a.localName)){if(i.type==="pointerdown")this._pointerType=i.pointerType;else if(i.type==="click"){let{clientX:n,clientY:s}=i,{left:l,top:c,width:m,height:f}=this.getBoundingClientRect(),_=n-l,S=s-c;if(_<0||S<0||_>m||S>f||m===0&&f===0)return;let{pointerType:y=this._pointerType}=i;if(this._pointerType=void 0,y===Li.TOUCH){this.handleTap(i);return}else if(y===Li.MOUSE){this.handleMouseClick(i);return}}}}handleTap(){}handleMouseClick(){let i=this.getAttribute(o.MEDIA_PAUSED)!=null?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new u.CustomEvent(i,{composed:!0,bubbles:!0}))}};function fr(t){let i=t.getAttribute(o.MEDIA_CONTROLLER);return i?d.getElementById(i):ot(t,"media-controller")}p("media-gesture-receiver",Ri);var vr=d.createElement("template");vr.innerHTML=`
82
82
  <style>
83
83
 
84
84
  :host([media-is-fullscreen]) ::slotted([slot=media]) {
@@ -189,7 +189,7 @@
189
189
 
190
190
  <slot part="bottom chrome"></slot>
191
191
  </span>
192
- `;var ss=Object.values(o),$t=class extends u.HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(vr.content.cloneNode(!0));let i=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(i).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(ss)}attributeChangedCallback(i,e,a){i.toLowerCase()=="autohide"&&(this.autohide=a)}get media(){let i=this.querySelector(":scope > [slot=media]");return(i==null?void 0:i.nodeName)=="SLOT"&&(i=i.assignedElements({flatten:!0})[0]),i}mediaSetCallback(i){this._mediaClickPlayToggle=()=>{let e=i.paused?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}}handleMediaUpdated(i){let e=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(!i)return a(i);let r=i.nodeName.toLowerCase();return r.includes("-")?u.customElements.whenDefined(r).then(()=>e(i)):e(i)}mediaUnsetCallback(){}connectedCallback(){let e=this.getAttribute("audio")!=null?N.AUDIO_PLAYER():N.VIDEO_PLAYER();this.setAttribute("role","region"),this.setAttribute("aria-label",e),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(rt.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(s)},r=()=>{this.removeAttribute("user-inactive");let s=new u.CustomEvent(rt.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(i){i=Number(i),this._autohide=isNaN(i)?0:i}get autohide(){return this._autohide===void 0?2:this._autohide}};p("media-container-temp",$t);var Ar=$t;var _r=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)},U=(t,i,e)=>(_r(t,i,"read from private field"),e?e.call(t):i.get(t)),Ui=(t,i,e)=>{if(i.has(t))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(t):i.set(t,e)},Oi=(t,i,e,a)=>(_r(t,i,"write to private field"),a?a.call(t,e):i.set(t,e),e),Ve,He,W,Bt=class{constructor(i,e){Ui(this,Ve,void 0),Ui(this,He,void 0),Ui(this,W,[]),Oi(this,Ve,i),Oi(this,He,e)}[Symbol.iterator](){return U(this,W).values()}get length(){return U(this,W).length}get value(){var i;return(i=U(this,W).join(" "))!=null?i:""}set value(i){var e;i!==this.value&&(Oi(this,W,[]),this.add(...(e=i==null?void 0:i.split(" "))!=null?e:[]))}toString(){return this.value}item(i){return U(this,W)[i]}values(){return U(this,W).values()}keys(){return U(this,W).keys()}forEach(i){U(this,W).forEach(i)}add(...i){var e,a;i.forEach(r=>{this.contains(r)||U(this,W).push(r)}),!(this.value===""&&!((e=U(this,Ve))!=null&&e.hasAttribute(`${U(this,He)}`)))&&((a=U(this,Ve))==null||a.setAttribute(`${U(this,He)}`,`${this.value}`))}remove(...i){var e;i.forEach(a=>{U(this,W).splice(U(this,W).indexOf(a),1)}),(e=U(this,Ve))==null||e.setAttribute(`${U(this,He)}`,`${this.value}`)}contains(i){return U(this,W).includes(i)}toggle(i,e){return typeof e!="undefined"?e?(this.add(i),!0):(this.remove(i),!1):this.contains(i)?(this.remove(i),!1):(this.add(i),!0)}replace(i,e){this.remove(i),this.add(e)}};Ve=new WeakMap;He=new WeakMap;W=new WeakMap;var D={enter:"requestFullscreen",exit:"exitFullscreen",event:"fullscreenchange",element:"fullscreenElement",error:"fullscreenerror",enabled:"fullscreenEnabled"};d.fullscreenElement===void 0&&(D.enter="webkitRequestFullScreen",D.exit=d.webkitExitFullscreen!=null?"webkitExitFullscreen":"webkitCancelFullScreen",D.event="webkitfullscreenchange",D.element="webkitFullscreenElement",D.error="webkitfullscreenerror",D.enabled="webkitFullscreenEnabled");function Vt(t,i=!1){return t.split("_").map(function(e,a){return(a||i?e[0].toUpperCase():e[0].toLowerCase())+e.slice(1).toLowerCase()}).join("")}var Ni=(t="")=>t.split(/\s+/),yr=(t="")=>{let[i,e]=t.split(":"),a=e?decodeURIComponent(e):void 0;return{language:i,label:a}},ls=(t="",i={})=>Ni(t).map(e=>{let a=yr(e);return{...i,...a}}),ds=t=>Array.isArray(t)?t.map(i=>typeof i=="string"?yr(i):i):typeof t=="string"?ls(t):[t],cs=({label:t,language:i}={})=>t?`${i}:${encodeURIComponent(t)}`:i,Q=(t=[])=>Array.prototype.map.call(t,cs).join(" "),us=(t,i)=>e=>e[t]===i,Tr=t=>{let i=Object.entries(t).map(([e,a])=>us(e,a));return e=>i.every(a=>a(e))},st=(t,i=[],e=[])=>{let a=ds(e).map(Tr),r=n=>a.some(s=>s(n));Array.from(i).filter(r).forEach(n=>{n.mode=t})},We=(t,i=()=>!0)=>{if(!(t!=null&&t.textTracks))return[];let e=typeof i=="function"?i:Tr(i);return Array.from(t.textTracks).filter(e)},$i=t=>{let i=!!t.getAttribute(o.MEDIA_CAPTIONS_SHOWING),e=!t.hasAttribute("no-subtitles-fallback")&&!!t.getAttribute(o.MEDIA_SUBTITLES_SHOWING);return i||e},Ht=t=>{var i,e,a,r;if($i(t)){let s=t.getAttribute(o.MEDIA_CAPTIONS_SHOWING);if(s){let c=new window.CustomEvent(h.MEDIA_DISABLE_CAPTIONS_REQUEST,{composed:!0,bubbles:!0,detail:s});t.dispatchEvent(c)}let l=t.getAttribute(o.MEDIA_SUBTITLES_SHOWING);if(l&&!t.hasAttribute("no-subtitles-fallback")){let c=new window.CustomEvent(h.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:l});t.dispatchEvent(c)}}else{let[s]=(e=Ni((i=t.getAttribute(o.MEDIA_CAPTIONS_LIST))!=null?i:""))!=null?e:[];if(s){let l=new window.CustomEvent(h.MEDIA_SHOW_CAPTIONS_REQUEST,{composed:!0,bubbles:!0,detail:s});t.dispatchEvent(l)}else if(t.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=Ni((a=t.getAttribute(o.MEDIA_SUBTITLES_LIST))!=null?a:""))!=null?r:[];if(l){let c=new window.CustomEvent(h.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:l});t.dispatchEvent(c)}}}};var kr=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)},Fe=(t,i,e)=>(kr(t,i,"read from private field"),e?e.call(t):i.get(t)),Bi=(t,i,e)=>{if(i.has(t))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(t):i.set(t,e)},Ke=(t,i,e)=>(kr(t,i,"access private method"),e),pe,Ye,ut,Ft,Hi,Lr=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],ms=10,Ir=0,Yt=class extends Ar{constructor(){super(),Bi(this,Ye),Bi(this,Ft),Bi(this,pe,new Bt(this,"hotkeys")),_s||(this._airplayUnavailable=Z.UNSUPPORTED),Sr||(this._fullscreenUnavailable=Z.UNAVAILABLE),ys||(this._castUnavailable=Z.UNSUPPORTED),vs||(this._pipUnavailable=Z.UNSUPPORTED),ct!==void 0?ct||(this._volumeUnavailable=Z.UNSUPPORTED):As.then(()=>{ct||(this._volumeUnavailable=Z.UNSUPPORTED,this.propagateMediaState(o.MEDIA_VOLUME_UNAVAILABLE,this._volumeUnavailable))}),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,this.associatedElements=[],this.associateElement(this);let i={MEDIA_PLAY_REQUEST:()=>this.media.play(),MEDIA_PAUSE_REQUEST:()=>this.media.pause(),MEDIA_MUTE_REQUEST:()=>this.media.muted=!0,MEDIA_UNMUTE_REQUEST:()=>{let e=this.media;e.muted=!1,e.volume===0&&(e.volume=.25)},MEDIA_VOLUME_REQUEST:e=>{let a=this.media,r=e.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(!Sr){console.warn("Fullscreen support is unavailable; not entering fullscreen");return}let e=this.media;d.pictureInPictureElement&&d.exitPictureInPicture(),super[D.enter]?super[D.enter]():e.webkitEnterFullscreen?e.webkitEnterFullscreen():e.requestFullscreen?e.requestFullscreen():console.warn("MediaChrome: Fullscreen not supported")},MEDIA_EXIT_FULLSCREEN_REQUEST:()=>{d[D.exit]()},MEDIA_ENTER_PIP_REQUEST:()=>{let e=this.media;if(!d.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!e.requestPictureInPicture){console.warn("MediaChrome: The current media does not support picture-in-picture");return}d[D.element]&&d[D.exit]();let a=r=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};e.requestPictureInPicture().catch(r=>{if(r.code===11)if(e.readyState===0&&e.preload==="none"){let n=function(){e.removeEventListener("loadedmetadata",s),e.preload="none"},s=function(){e.requestPictureInPicture().catch(a),n()};e.addEventListener("loadedmetadata",s),e.preload="metadata",setTimeout(()=>{e.readyState===0&&a(),n()},1e3)}else throw r;else throw r})},MEDIA_EXIT_PIP_REQUEST:()=>{d.pictureInPictureElement&&d.exitPictureInPicture()},MEDIA_ENTER_CAST_REQUEST:()=>{var e;let a=this.media;!((e=globalThis.CastableVideoElement)!=null&&e.castEnabled)||(d[D.element]&&d[D.exit](),a.requestCast())},MEDIA_EXIT_CAST_REQUEST:async()=>{var e;(e=globalThis.CastableVideoElement)!=null&&e.castElement&&globalThis.CastableVideoElement.exitCast()},MEDIA_SEEK_REQUEST:e=>{let a=this.media,r=e.detail;(a.readyState>0||a.readyState===void 0)&&(a.currentTime=r)},MEDIA_PLAYBACK_RATE_REQUEST:e=>{this.media.playbackRate=e.detail},MEDIA_PREVIEW_REQUEST:e=>{var a;let r=this.media;if(!r)return;let n=e.detail;n===null&&this.propagateMediaState(o.MEDIA_PREVIEW_TIME,void 0),this.propagateMediaState(o.MEDIA_PREVIEW_TIME,n);let[s]=We(r,{kind:$e.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,y=>y.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:e=>{let a=Kt(this),{detail:r=[]}=e;st(_e.SHOWING,a,r)},MEDIA_DISABLE_CAPTIONS_REQUEST:e=>{let a=Kt(this),{detail:r=[]}=e;st(_e.DISABLED,a,r)},MEDIA_SHOW_SUBTITLES_REQUEST:e=>{let a=dt(this),{detail:r=[]}=e;st(_e.SHOWING,a,r)},MEDIA_DISABLE_SUBTITLES_REQUEST:e=>{let a=dt(this),{detail:r=[]}=e;st(_e.DISABLED,a,r)},MEDIA_AIRPLAY_REQUEST:()=>{let{media:e}=this;if(!!e){if(!(e.webkitShowPlaybackTargetPicker&&u.WebKitPlaybackTargetAvailabilityEvent)){console.warn("received a request to select AirPlay but AirPlay is not supported in this environment");return}e.webkitShowPlaybackTargetPicker()}}};if(Object.keys(i).forEach(e=>{let a=`_handle${Vt(e,!0)}`;this[a]=r=>{if(r.stopPropagation(),!this.media){console.warn("MediaController: No media available.");return}i[e](r,this.media)},this.addEventListener(h[e],this[a])}),this._mediaStatePropagators={"play,pause,emptied":()=>{this.propagateMediaState(o.MEDIA_PAUSED,Cr(this))},"playing,emptied":()=>{var e;this.propagateMediaState(o.MEDIA_HAS_PLAYED,!((e=this.media)!=null&&e.paused))},volumechange:()=>{this.propagateMediaState(o.MEDIA_MUTED,wr(this)),this.propagateMediaState(o.MEDIA_VOLUME,Dr(this)),this.propagateMediaState(o.MEDIA_VOLUME_LEVEL,xr(this))},[D.event]:e=>{let r=!!d[D.element]&&(e==null?void 0:e.target),n=nt(this,r);this.propagateMediaState(o.MEDIA_IS_FULLSCREEN,n)},"enterpictureinpicture,leavepictureinpicture":e=>{var a;let r;if(e)r=e.type=="enterpictureinpicture";else{let n=(a=this.getRootNode().pictureInPictureElement)!=null?a:d.pictureInPictureElement;r=this.media&&nt(this.media,n)}this.propagateMediaState(o.MEDIA_IS_PIP,r)},"entercast,leavecast,castchange":e=>{var a;let r=(a=globalThis.CastableVideoElement)==null?void 0:a.castElement,n=this.media&&nt(this.media,r);(e==null?void 0:e.type)==="castchange"&&(e==null?void 0:e.detail)==="CONNECTING"&&(n="connecting"),this.propagateMediaState(o.MEDIA_IS_CASTING,n)},"timeupdate,loadedmetadata":()=>{this.propagateMediaState(o.MEDIA_CURRENT_TIME,Rr(this))},"durationchange,loadedmetadata,emptied":()=>{this.propagateMediaState(o.MEDIA_DURATION,Pr(this))},"loadedmetadata,emptied,progress":()=>{var e;this.propagateMediaState(o.MEDIA_SEEKABLE,(e=Ur(this))==null?void 0:e.join(":"))},"progress,emptied":()=>{var e;this.propagateMediaState(o.MEDIA_BUFFERED,Is((e=this.media)==null?void 0:e.buffered))},"ratechange,loadstart":()=>{this.propagateMediaState(o.MEDIA_PLAYBACK_RATE,Or(this))},"waiting,playing,emptied":()=>{var e;let a=((e=this.media)==null?void 0:e.readyState)<3;this.propagateMediaState(o.MEDIA_LOADING,a)}},this._airplayUnavailable!==Z.UNSUPPORTED){let e=a=>{(a==null?void 0:a.availability)==="available"?this._airplayUnavailable=void 0:(a==null?void 0:a.availability)==="not-available"&&(this._airplayUnavailable=Z.UNAVAILABLE),this.propagateMediaState(o.MEDIA_AIRPLAY_UNAVAILABLE,this._airplayUnavailable)};this._mediaStatePropagators.webkitplaybacktargetavailabilitychanged=e}if(this._castUnavailable!==Z.UNSUPPORTED){let e=()=>{var a;let r=(a=globalThis.CastableVideoElement)==null?void 0:a.castState;r!=null&&r.includes("CONNECT")?this._castUnavailable=void 0:this._castUnavailable=Z.UNAVAILABLE,this.propagateMediaState(o.MEDIA_CAST_UNAVAILABLE,this._castUnavailable)};this._mediaStatePropagators.castchange=e}this._textTrackMediaStatePropagators={"addtrack,removetrack,loadstart":()=>{this.propagateMediaState(o.MEDIA_CAPTIONS_LIST,Q(Kt(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_LIST,Q(dt(this))||void 0),this.propagateMediaState(o.MEDIA_CAPTIONS_SHOWING,Q(Wi(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_SHOWING,Q(Mr(this))||void 0)},change:()=>{this.propagateMediaState(o.MEDIA_CAPTIONS_SHOWING,Q(Wi(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_SHOWING,Q(Mr(this))||void 0)}},this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat("nohotkeys","hotkeys")}attributeChangedCallback(i,e,a){i==="nohotkeys"?a!==e&&a===""?(this.hasAttribute("hotkeys")&&console.warn("Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):a!==e&&a===null&&this.enableHotkeys():i==="hotkeys"&&(Fe(this,pe).value=a),super.attributeChangedCallback(i,e,a)}mediaSetCallback(i){super.mediaSetCallback(i),i.hasAttribute("tabindex")||i.setAttribute("tabindex",-1),Object.keys(this._mediaStatePropagators).forEach(e=>{let a=e.split(","),r=this._mediaStatePropagators[e];a.forEach(n=>{(n==D.event?this.getRootNode():i).addEventListener(n,r)}),r()}),Object.entries(this._textTrackMediaStatePropagators).forEach(([e,a])=>{e.split(",").forEach(n=>{i.textTracks&&i.textTracks.addEventListener(n,a)}),a()});try{let e=u.localStorage.getItem("media-chrome-pref-volume");e!==null&&(i.volume=e)}catch(e){console.debug("Error getting volume pref",e)}}mediaUnsetCallback(i){super.mediaUnsetCallback(i),Object.keys(this._mediaStatePropagators).forEach(e=>{let a=e.split(","),r=this._mediaStatePropagators[e];a.forEach(n=>{(n==D.event?this.getRootNode():i).removeEventListener(n,r)})}),Object.entries(this._textTrackMediaStatePropagators).forEach(([e,a])=>{e.split(",").forEach(n=>{i.textTracks&&i.textTracks.removeEventListener(n,a)}),a()}),this.propagateMediaState(o.MEDIA_PAUSED,!0)}propagateMediaState(i,e){Ie(this.mediaStateReceivers,i,e);let a=new u.CustomEvent(dr[i],{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(a)}associateElement(i){if(!i)return;let{associatedElementSubscriptions:e}=this;if(e.has(i))return;let a=this.registerMediaStateReceiver.bind(this),r=this.unregisterMediaStateReceiver.bind(this),n=Es(i,a,r);Object.keys(h).forEach(s=>{i.addEventListener(h[s],this[`_handle${Vt(s,!0)}`])}),e.set(i,n)}unassociateElement(i){if(!i)return;let{associatedElementSubscriptions:e}=this;if(!e.has(i))return;e.get(i)(),e.delete(i),Object.keys(h).forEach(r=>{i.removeEventListener(h[r],this[`_handle${Vt(r,!0)}`])})}registerMediaStateReceiver(i){if(!i)return;let e=this.mediaStateReceivers;e.indexOf(i)>-1||(e.push(i),Ie([i],o.MEDIA_VOLUME_UNAVAILABLE,this._volumeUnavailable),Ie([i],o.MEDIA_AIRPLAY_UNAVAILABLE,this._airplayUnavailable),Ie([i],o.MEDIA_FULLSCREEN_UNAVAILABLE,this._fullscreenUnavailable),Ie([i],o.MEDIA_CAST_UNAVAILABLE,this._castUnavailable),Ie([i],o.MEDIA_PIP_UNAVAILABLE,this._pipUnavailable),this.media&&Object.keys(o).forEach(r=>{r.includes("UNAVAILABLE")||Ie([i],o[r],Vi[o[r]]?Vi[o[r]](this):Vi.default(this,o[r]))}))}unregisterMediaStateReceiver(i){let e=this.mediaStateReceivers,a=e.indexOf(i);a<0||e.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",Ke(this,Ft,Hi))}disableHotkeys(){this.removeEventListener("keydown",Ke(this,Ft,Hi)),this.removeEventListener("keyup",Ke(this,Ye,ut))}get hotkeys(){return Fe(this,pe)}keyboardShortcutHandler(i){var e,a,r,n;if(((n=(r=(e=i.target.getAttribute("keysused"))==null?void 0:e.split(" "))!=null?r:(a=i.target)==null?void 0:a.keysUsed)!=null?n:[]).map(_=>_==="Space"?" ":_).filter(Boolean).includes(i.key))return;let l,c,m,E,y,k=ms;if(!Fe(this,pe).contains(`no${i.key.toLowerCase()}`)&&!(i.key===" "&&Fe(this,pe).contains("nospace")))switch(i.key){case" ":case"k":l=this.getAttribute(o.MEDIA_PAUSED)!=null?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new u.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"m":l=this.getAttribute(o.MEDIA_VOLUME_LEVEL)==="off"?h.MEDIA_UNMUTE_REQUEST:h.MEDIA_MUTE_REQUEST,this.dispatchEvent(new u.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"f":l=this.getAttribute(o.MEDIA_IS_FULLSCREEN)!=null?h.MEDIA_EXIT_FULLSCREEN_REQUEST:h.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:Ir,E=Math.max(m-k,0),y=new u.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:E}),this.dispatchEvent(y);break;case"ArrowRight":c=this.getAttribute(o.MEDIA_CURRENT_TIME),m=c&&!Number.isNaN(+c)?+c:Ir,E=Math.max(m+k,0),y=new u.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:E}),this.dispatchEvent(y);break;default:break}}};pe=new WeakMap;Ye=new WeakSet;ut=function(t){let{key:i}=t;if(!Lr.includes(i)){this.removeEventListener("keyup",Ke(this,Ye,ut));return}this.keyboardShortcutHandler(t)};Ft=new WeakSet;Hi=function(t){let{metaKey:i,altKey:e,key:a}=t;if(i||e||!Lr.includes(a)){this.removeEventListener("keyup",Ke(this,Ye,ut));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(Fe(this,pe).contains(`no${a.toLowerCase()}`)||a===" "&&Fe(this,pe).contains("nospace"))&&t.preventDefault(),this.addEventListener("keyup",Ke(this,Ye,ut),{once:!0})};var Vi={default(t,i){return t.getAttribute(i)},[o.MEDIA_CAPTIONS_LIST](t){return Q(Kt(t))||void 0},[o.MEDIA_SUBTITLES_LIST](t){return Q(dt(t))||void 0},[o.MEDIA_SUBTITLES_LIST](t){return Q(dt(t))||void 0},[o.MEDIA_CAPTIONS_SHOWING](t){return Q(Wi(t))||void 0},[o.MEDIA_PAUSED](t){return Cr(t)},[o.MEDIA_MUTED](t){return wr(t)},[o.MEDIA_VOLUME](t){return Dr(t)},[o.MEDIA_VOLUME_LEVEL](t){return xr(t)},[o.MEDIA_CURRENT_TIME](t){return Rr(t)},[o.MEDIA_DURATION](t){return Pr(t)},[o.MEDIA_SEEKABLE](t){var i;return(i=Ur(t))==null?void 0:i.join(":")},[o.MEDIA_PLAYBACK_RATE](t){return Or(t)}},Cr=t=>t.media?t.media.paused:!0,wr=t=>!!(t.media&&t.media.muted),Dr=t=>{let i=t.media;return i?i.volume:1},xr=t=>{let i="high";if(!t.media)return i;let{muted:e,volume:a}=t.media;return a===0||e?i="off":a<.5?i="low":a<.75&&(i="medium"),i},Rr=t=>{let i=t.media;return i?i.currentTime:0},Pr=t=>{let i=t==null?void 0:t.media;return Number.isFinite(i==null?void 0:i.duration)?i.duration:NaN},Ur=t=>{var i;let e=t==null?void 0:t.media;if(!((i=e==null?void 0:e.seekable)!=null&&i.length))return;let a=e.seekable.start(0),r=e.seekable.end(e.seekable.length-1);if(!(!a&&!r))return[Number(a.toFixed(3)),Number(r.toFixed(3))]},Or=t=>{let i=t.media;return i?i.playbackRate:1},dt=t=>We(t.media,{kind:$e.SUBTITLES}),Kt=t=>We(t.media,{kind:$e.CAPTIONS}),Mr=t=>We(t.media,{kind:$e.SUBTITLES,mode:_e.SHOWING}),Wi=t=>We(t.media,{kind:$e.CAPTIONS,mode:_e.SHOWING}),hs=Object.values(o),Nr=t=>{var i,e,a,r;let{observedAttributes:n}=t.constructor;!n&&((i=t.nodeName)==null?void 0:i.includes("-"))&&(u.customElements.upgrade(t),{observedAttributes:n}=t.constructor);let s=(r=(a=(e=t==null?void 0:t.getAttribute)==null?void 0:e.call(t,o.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(n||s)?(n||s).filter(l=>hs.includes(l)):[]},Fi=t=>!!Nr(t).length,ps=async(t,i,e)=>(t.isConnected||await $r(0),e==null?t.removeAttribute(i):typeof e=="boolean"?e?t.setAttribute(i,""):t.removeAttribute(i):Number.isNaN(e)?t.removeAttribute(i):t.setAttribute(i,e)),bs=t=>{var i;return!!((i=t.closest)!=null&&i.call(t,'*[slot="media"]'))},lt=(t,i)=>{if(bs(t))return;let e=(r,n)=>{var s,l;Fi(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(y=>lt(y,n))},a=t==null?void 0:t.nodeName.toLowerCase();if(a.includes("-")&&!Fi(t)){u.customElements.whenDefined(a).then(()=>{e(t,i)});return}e(t,i)},Ie=(t,i,e)=>{t.forEach(a=>{!Nr(a).includes(i)||ps(a,i,e)})},Es=(t,i,e)=>{lt(t,i);let a=c=>{var m;let E=(m=c==null?void 0:c.composedPath()[0])!=null?m:c.target;i(E)},r=c=>{var m;let E=(m=c==null?void 0:c.composedPath()[0])!=null?m:c.target;e(E)};t.addEventListener(h.REGISTER_MEDIA_STATE_RECEIVER,a),t.addEventListener(h.UNREGISTER_MEDIA_STATE_RECEIVER,r);let n=c=>{c.forEach(m=>{let{addedNodes:E=[],removedNodes:y=[],type:k,target:_,attributeName:O}=m;k==="childList"?(Array.prototype.forEach.call(E,x=>lt(x,i)),Array.prototype.forEach.call(y,x=>lt(x,e))):k==="attributes"&&O===o.MEDIA_CHROME_ATTRIBUTES&&(Fi(_)?i(_):e(_))})},s=new MutationObserver(n);return s.observe(t,{childList:!0,attributes:!0,subtree:!0}),()=>{lt(t,e),s.disconnect(),t.removeEventListener(h.REGISTER_MEDIA_STATE_RECEIVER,a),t.removeEventListener(h.UNREGISTER_MEDIA_STATE_RECEIVER,r)}},Wt,Ki=()=>{var t,i;return Wt||(Wt=(i=(t=d)==null?void 0:t.createElement)==null?void 0:i.call(t,"video"),Wt)},fs=async(t=Ki())=>{if(!t)return!1;let i=t.volume;return t.volume=i/2+.1,await $r(0),t.volume!==i},$r=t=>new Promise(i=>setTimeout(i,t)),gs=(t=Ki())=>typeof(t==null?void 0:t.requestPictureInPicture)=="function",vs=gs(),ct,As=fs().then(t=>(ct=t,ct)),_s=!!u.WebKitPlaybackTargetAvailabilityEvent,ys=!!u.chrome,Ts=(t=Ki())=>{let i=d[D.enabled];return!i&&t&&(i="webkitSupportsFullscreen"in t),i},Sr=Ts();function Is(t=[]){return Array.from(t).map((i,e)=>[Number(t.start(e).toFixed(3)),Number(t.end(e).toFixed(3))].join(":")).join(" ")}p("media-controller",Yt);var mt=Yt;var Vr=d.createElement("template"),Br=`
192
+ `;var ss=Object.values(o),$t=class extends u.HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(vr.content.cloneNode(!0));let i=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 f=m.slot!=="media";for(;(m=m.previousSibling)!==null;)m.slot=="media"&&(f=!1);f&&this.mediaUnsetCallback(c)}}}),s&&l.addedNodes.forEach(c=>{c==s&&this.handleMediaUpdated(s).then(m=>this.mediaSetCallback(m))}))};new MutationObserver(i).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(ss)}attributeChangedCallback(i,e,a){i.toLowerCase()=="autohide"&&(this.autohide=a)}get media(){let i=this.querySelector(":scope > [slot=media]");return(i==null?void 0:i.nodeName)=="SLOT"&&(i=i.assignedElements({flatten:!0})[0]),i}mediaSetCallback(i){this._mediaClickPlayToggle=()=>{let e=i.paused?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}}handleMediaUpdated(i){let e=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(!i)return a(i);let r=i.nodeName.toLowerCase();return r.includes("-")?u.customElements.whenDefined(r).then(()=>e(i)):e(i)}mediaUnsetCallback(){}connectedCallback(){let e=this.getAttribute("audio")!=null?O.AUDIO_PLAYER():O.VIDEO_PLAYER();this.setAttribute("role","region"),this.setAttribute("aria-label",e),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(rt.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(s)},r=()=>{this.removeAttribute("user-inactive");let s=new u.CustomEvent(rt.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(i){i=Number(i),this._autohide=isNaN(i)?0:i}get autohide(){return this._autohide===void 0?2:this._autohide}};p("media-container-temp",$t);var Ar=$t;var _r=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)},R=(t,i,e)=>(_r(t,i,"read from private field"),e?e.call(t):i.get(t)),Pi=(t,i,e)=>{if(i.has(t))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(t):i.set(t,e)},Ui=(t,i,e,a)=>(_r(t,i,"write to private field"),a?a.call(t,e):i.set(t,e),e),Ve,He,F,Bt=class{constructor(i,e){Pi(this,Ve,void 0),Pi(this,He,void 0),Pi(this,F,[]),Ui(this,Ve,i),Ui(this,He,e)}[Symbol.iterator](){return R(this,F).values()}get length(){return R(this,F).length}get value(){var i;return(i=R(this,F).join(" "))!=null?i:""}set value(i){var e;i!==this.value&&(Ui(this,F,[]),this.add(...(e=i==null?void 0:i.split(" "))!=null?e:[]))}toString(){return this.value}item(i){return R(this,F)[i]}values(){return R(this,F).values()}keys(){return R(this,F).keys()}forEach(i){R(this,F).forEach(i)}add(...i){var e,a;i.forEach(r=>{this.contains(r)||R(this,F).push(r)}),!(this.value===""&&!((e=R(this,Ve))!=null&&e.hasAttribute(`${R(this,He)}`)))&&((a=R(this,Ve))==null||a.setAttribute(`${R(this,He)}`,`${this.value}`))}remove(...i){var e;i.forEach(a=>{R(this,F).splice(R(this,F).indexOf(a),1)}),(e=R(this,Ve))==null||e.setAttribute(`${R(this,He)}`,`${this.value}`)}contains(i){return R(this,F).includes(i)}toggle(i,e){return typeof e!="undefined"?e?(this.add(i),!0):(this.remove(i),!1):this.contains(i)?(this.remove(i),!1):(this.add(i),!0)}replace(i,e){this.remove(i),this.add(e)}};Ve=new WeakMap;He=new WeakMap;F=new WeakMap;var x={enter:"requestFullscreen",exit:"exitFullscreen",event:"fullscreenchange",element:"fullscreenElement",error:"fullscreenerror",enabled:"fullscreenEnabled"};d.fullscreenElement===void 0&&(x.enter="webkitRequestFullScreen",x.exit=d.webkitExitFullscreen!=null?"webkitExitFullscreen":"webkitCancelFullScreen",x.event="webkitfullscreenchange",x.element="webkitFullscreenElement",x.error="webkitfullscreenerror",x.enabled="webkitFullscreenEnabled");function Vt(t,i=!1){return t.split("_").map(function(e,a){return(a||i?e[0].toUpperCase():e[0].toLowerCase())+e.slice(1).toLowerCase()}).join("")}var Oi=(t="")=>t.split(/\s+/),yr=(t="")=>{let[i,e]=t.split(":"),a=e?decodeURIComponent(e):void 0;return{language:i,label:a}},ls=(t="",i={})=>Oi(t).map(e=>{let a=yr(e);return{...i,...a}}),ds=t=>Array.isArray(t)?t.map(i=>typeof i=="string"?yr(i):i):typeof t=="string"?ls(t):[t],cs=({label:t,language:i}={})=>t?`${i}:${encodeURIComponent(t)}`:i,q=(t=[])=>Array.prototype.map.call(t,cs).join(" "),us=(t,i)=>e=>e[t]===i,Tr=t=>{let i=Object.entries(t).map(([e,a])=>us(e,a));return e=>i.every(a=>a(e))},st=(t,i=[],e=[])=>{let a=ds(e).map(Tr),r=n=>a.some(s=>s(n));Array.from(i).filter(r).forEach(n=>{n.mode=t})},We=(t,i=()=>!0)=>{if(!(t!=null&&t.textTracks))return[];let e=typeof i=="function"?i:Tr(i);return Array.from(t.textTracks).filter(e)},Ni=t=>{let i=!!t.getAttribute(o.MEDIA_CAPTIONS_SHOWING),e=!t.hasAttribute("no-subtitles-fallback")&&!!t.getAttribute(o.MEDIA_SUBTITLES_SHOWING);return i||e},Ht=t=>{var i,e,a,r;if(Ni(t)){let s=t.getAttribute(o.MEDIA_CAPTIONS_SHOWING);if(s){let c=new window.CustomEvent(h.MEDIA_DISABLE_CAPTIONS_REQUEST,{composed:!0,bubbles:!0,detail:s});t.dispatchEvent(c)}let l=t.getAttribute(o.MEDIA_SUBTITLES_SHOWING);if(l&&!t.hasAttribute("no-subtitles-fallback")){let c=new window.CustomEvent(h.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:l});t.dispatchEvent(c)}}else{let[s]=(e=Oi((i=t.getAttribute(o.MEDIA_CAPTIONS_LIST))!=null?i:""))!=null?e:[];if(s){let l=new window.CustomEvent(h.MEDIA_SHOW_CAPTIONS_REQUEST,{composed:!0,bubbles:!0,detail:s});t.dispatchEvent(l)}else if(t.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=Oi((a=t.getAttribute(o.MEDIA_SUBTITLES_LIST))!=null?a:""))!=null?r:[];if(l){let c=new window.CustomEvent(h.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:l});t.dispatchEvent(c)}}}};var Sr=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)},Fe=(t,i,e)=>(Sr(t,i,"read from private field"),e?e.call(t):i.get(t)),$i=(t,i,e)=>{if(i.has(t))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(t):i.set(t,e)},Ke=(t,i,e)=>(Sr(t,i,"access private method"),e),Ee,Ye,ut,Ft,Vi,Lr=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],ms=10,Ir=0,Yt=class extends Ar{constructor(){super(),$i(this,Ye),$i(this,Ft),$i(this,Ee,new Bt(this,"hotkeys")),_s||(this._airplayUnavailable=Q.UNSUPPORTED),kr||(this._fullscreenUnavailable=Q.UNAVAILABLE),ys||(this._castUnavailable=Q.UNSUPPORTED),vs||(this._pipUnavailable=Q.UNSUPPORTED),ct!==void 0?ct||(this._volumeUnavailable=Q.UNSUPPORTED):As.then(()=>{ct||(this._volumeUnavailable=Q.UNSUPPORTED,this.propagateMediaState(o.MEDIA_VOLUME_UNAVAILABLE,this._volumeUnavailable))}),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,this.associatedElements=[],this.associateElement(this);let i={MEDIA_PLAY_REQUEST:()=>this.media.play(),MEDIA_PAUSE_REQUEST:()=>this.media.pause(),MEDIA_MUTE_REQUEST:()=>this.media.muted=!0,MEDIA_UNMUTE_REQUEST:()=>{let e=this.media;e.muted=!1,e.volume===0&&(e.volume=.25)},MEDIA_VOLUME_REQUEST:e=>{let a=this.media,r=e.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(!kr){console.warn("Fullscreen support is unavailable; not entering fullscreen");return}let e=this.media;d.pictureInPictureElement&&d.exitPictureInPicture(),super[x.enter]?super[x.enter]():e.webkitEnterFullscreen?e.webkitEnterFullscreen():e.requestFullscreen?e.requestFullscreen():console.warn("MediaChrome: Fullscreen not supported")},MEDIA_EXIT_FULLSCREEN_REQUEST:()=>{d[x.exit]()},MEDIA_ENTER_PIP_REQUEST:()=>{let e=this.media;if(!d.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!e.requestPictureInPicture){console.warn("MediaChrome: The current media does not support picture-in-picture");return}d[x.element]&&d[x.exit]();let a=r=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};e.requestPictureInPicture().catch(r=>{if(r.code===11)if(e.readyState===0&&e.preload==="none"){let n=function(){e.removeEventListener("loadedmetadata",s),e.preload="none"},s=function(){e.requestPictureInPicture().catch(a),n()};e.addEventListener("loadedmetadata",s),e.preload="metadata",setTimeout(()=>{e.readyState===0&&a(),n()},1e3)}else throw r;else throw r})},MEDIA_EXIT_PIP_REQUEST:()=>{d.pictureInPictureElement&&d.exitPictureInPicture()},MEDIA_ENTER_CAST_REQUEST:()=>{var e;let a=this.media;!((e=globalThis.CastableVideoElement)!=null&&e.castEnabled)||(d[x.element]&&d[x.exit](),a.requestCast())},MEDIA_EXIT_CAST_REQUEST:async()=>{var e;(e=globalThis.CastableVideoElement)!=null&&e.castElement&&globalThis.CastableVideoElement.exitCast()},MEDIA_SEEK_REQUEST:e=>{let a=this.media,r=e.detail;(a.readyState>0||a.readyState===void 0)&&(a.currentTime=r)},MEDIA_PLAYBACK_RATE_REQUEST:e=>{this.media.playbackRate=e.detail},MEDIA_PREVIEW_REQUEST:e=>{var a;let r=this.media;if(!r)return;let n=e.detail;n===null&&this.propagateMediaState(o.MEDIA_PREVIEW_TIME,void 0),this.propagateMediaState(o.MEDIA_PREVIEW_TIME,n);let[s]=We(r,{kind:$e.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,_=>_.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),f=new URLSearchParams(m.hash).get("#xywh");this.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,m.href),this.propagateMediaState(o.MEDIA_PREVIEW_COORDS,f.split(",").join(" "))},MEDIA_SHOW_CAPTIONS_REQUEST:e=>{let a=Kt(this),{detail:r=[]}=e;st(Me.SHOWING,a,r)},MEDIA_DISABLE_CAPTIONS_REQUEST:e=>{let a=Kt(this),{detail:r=[]}=e;st(Me.DISABLED,a,r)},MEDIA_SHOW_SUBTITLES_REQUEST:e=>{let a=dt(this),{detail:r=[]}=e;st(Me.SHOWING,a,r)},MEDIA_DISABLE_SUBTITLES_REQUEST:e=>{let a=dt(this),{detail:r=[]}=e;st(Me.DISABLED,a,r)},MEDIA_AIRPLAY_REQUEST:()=>{let{media:e}=this;if(!!e){if(!(e.webkitShowPlaybackTargetPicker&&u.WebKitPlaybackTargetAvailabilityEvent)){console.warn("received a request to select AirPlay but AirPlay is not supported in this environment");return}e.webkitShowPlaybackTargetPicker()}}};if(Object.keys(i).forEach(e=>{let a=`_handle${Vt(e,!0)}`;this[a]=r=>{if(r.stopPropagation(),!this.media){console.warn("MediaController: No media available.");return}i[e](r,this.media)},this.addEventListener(h[e],this[a])}),this._mediaStatePropagators={"play,pause,emptied":()=>{this.propagateMediaState(o.MEDIA_PAUSED,Cr(this))},"playing,emptied":()=>{var e;this.propagateMediaState(o.MEDIA_HAS_PLAYED,!((e=this.media)!=null&&e.paused))},volumechange:()=>{this.propagateMediaState(o.MEDIA_MUTED,wr(this)),this.propagateMediaState(o.MEDIA_VOLUME,xr(this)),this.propagateMediaState(o.MEDIA_VOLUME_LEVEL,Dr(this))},[x.event]:e=>{let r=!!d[x.element]&&(e==null?void 0:e.target),n=nt(this,r);this.propagateMediaState(o.MEDIA_IS_FULLSCREEN,n)},"enterpictureinpicture,leavepictureinpicture":e=>{var a;let r;if(e)r=e.type=="enterpictureinpicture";else{let n=(a=this.getRootNode().pictureInPictureElement)!=null?a:d.pictureInPictureElement;r=this.media&&nt(this.media,n)}this.propagateMediaState(o.MEDIA_IS_PIP,r)},"entercast,leavecast,castchange":e=>{var a;let r=(a=globalThis.CastableVideoElement)==null?void 0:a.castElement,n=this.media&&nt(this.media,r);(e==null?void 0:e.type)==="castchange"&&(e==null?void 0:e.detail)==="CONNECTING"&&(n="connecting"),this.propagateMediaState(o.MEDIA_IS_CASTING,n)},"timeupdate,loadedmetadata":()=>{this.propagateMediaState(o.MEDIA_CURRENT_TIME,Rr(this))},"durationchange,loadedmetadata,emptied":()=>{this.propagateMediaState(o.MEDIA_DURATION,Pr(this))},"loadedmetadata,emptied,progress":()=>{var e;this.propagateMediaState(o.MEDIA_SEEKABLE,(e=Ur(this))==null?void 0:e.join(":"))},"progress,emptied":()=>{var e;this.propagateMediaState(o.MEDIA_BUFFERED,Is((e=this.media)==null?void 0:e.buffered))},"ratechange,loadstart":()=>{this.propagateMediaState(o.MEDIA_PLAYBACK_RATE,Or(this))},"waiting,playing,emptied":()=>{var e;let a=((e=this.media)==null?void 0:e.readyState)<3;this.propagateMediaState(o.MEDIA_LOADING,a)}},this._airplayUnavailable!==Q.UNSUPPORTED){let e=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=e}if(this._castUnavailable!==Q.UNSUPPORTED){let e=()=>{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=e}this._textTrackMediaStatePropagators={"addtrack,removetrack,loadstart":()=>{this.propagateMediaState(o.MEDIA_CAPTIONS_LIST,q(Kt(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_LIST,q(dt(this))||void 0),this.propagateMediaState(o.MEDIA_CAPTIONS_SHOWING,q(Hi(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_SHOWING,q(Mr(this))||void 0)},change:()=>{this.propagateMediaState(o.MEDIA_CAPTIONS_SHOWING,q(Hi(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_SHOWING,q(Mr(this))||void 0)}},this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat("nohotkeys","hotkeys")}attributeChangedCallback(i,e,a){i==="nohotkeys"?a!==e&&a===""?(this.hasAttribute("hotkeys")&&console.warn("Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):a!==e&&a===null&&this.enableHotkeys():i==="hotkeys"&&(Fe(this,Ee).value=a),super.attributeChangedCallback(i,e,a)}mediaSetCallback(i){super.mediaSetCallback(i),i.hasAttribute("tabindex")||i.setAttribute("tabindex",-1),Object.keys(this._mediaStatePropagators).forEach(e=>{let a=e.split(","),r=this._mediaStatePropagators[e];a.forEach(n=>{(n==x.event?this.getRootNode():i).addEventListener(n,r)}),r()}),Object.entries(this._textTrackMediaStatePropagators).forEach(([e,a])=>{e.split(",").forEach(n=>{i.textTracks&&i.textTracks.addEventListener(n,a)}),a()});try{let e=u.localStorage.getItem("media-chrome-pref-volume");e!==null&&(i.volume=e)}catch(e){console.debug("Error getting volume pref",e)}}mediaUnsetCallback(i){super.mediaUnsetCallback(i),Object.keys(this._mediaStatePropagators).forEach(e=>{let a=e.split(","),r=this._mediaStatePropagators[e];a.forEach(n=>{(n==x.event?this.getRootNode():i).removeEventListener(n,r)})}),Object.entries(this._textTrackMediaStatePropagators).forEach(([e,a])=>{e.split(",").forEach(n=>{i.textTracks&&i.textTracks.removeEventListener(n,a)}),a()}),this.propagateMediaState(o.MEDIA_PAUSED,!0)}propagateMediaState(i,e){Le(this.mediaStateReceivers,i,e);let a=new u.CustomEvent(dr[i],{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(a)}associateElement(i){if(!i)return;let{associatedElementSubscriptions:e}=this;if(e.has(i))return;let a=this.registerMediaStateReceiver.bind(this),r=this.unregisterMediaStateReceiver.bind(this),n=Es(i,a,r);Object.keys(h).forEach(s=>{i.addEventListener(h[s],this[`_handle${Vt(s,!0)}`])}),e.set(i,n)}unassociateElement(i){if(!i)return;let{associatedElementSubscriptions:e}=this;if(!e.has(i))return;e.get(i)(),e.delete(i),Object.keys(h).forEach(r=>{i.removeEventListener(h[r],this[`_handle${Vt(r,!0)}`])})}registerMediaStateReceiver(i){if(!i)return;let e=this.mediaStateReceivers;e.indexOf(i)>-1||(e.push(i),Le([i],o.MEDIA_VOLUME_UNAVAILABLE,this._volumeUnavailable),Le([i],o.MEDIA_AIRPLAY_UNAVAILABLE,this._airplayUnavailable),Le([i],o.MEDIA_FULLSCREEN_UNAVAILABLE,this._fullscreenUnavailable),Le([i],o.MEDIA_CAST_UNAVAILABLE,this._castUnavailable),Le([i],o.MEDIA_PIP_UNAVAILABLE,this._pipUnavailable),this.media&&Object.keys(o).forEach(r=>{r.includes("UNAVAILABLE")||Le([i],o[r],Bi[o[r]]?Bi[o[r]](this):Bi.default(this,o[r]))}))}unregisterMediaStateReceiver(i){let e=this.mediaStateReceivers,a=e.indexOf(i);a<0||e.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",Ke(this,Ft,Vi))}disableHotkeys(){this.removeEventListener("keydown",Ke(this,Ft,Vi)),this.removeEventListener("keyup",Ke(this,Ye,ut))}get hotkeys(){return Fe(this,Ee)}keyboardShortcutHandler(i){var e,a,r,n;if(((n=(r=(e=i.target.getAttribute("keysused"))==null?void 0:e.split(" "))!=null?r:(a=i.target)==null?void 0:a.keysUsed)!=null?n:[]).map(y=>y==="Space"?" ":y).filter(Boolean).includes(i.key))return;let l,c,m,f,_,S=ms;if(!Fe(this,Ee).contains(`no${i.key.toLowerCase()}`)&&!(i.key===" "&&Fe(this,Ee).contains("nospace")))switch(i.key){case" ":case"k":l=this.getAttribute(o.MEDIA_PAUSED)!=null?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new u.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"m":l=this.getAttribute(o.MEDIA_VOLUME_LEVEL)==="off"?h.MEDIA_UNMUTE_REQUEST:h.MEDIA_MUTE_REQUEST,this.dispatchEvent(new u.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"f":l=this.getAttribute(o.MEDIA_IS_FULLSCREEN)!=null?h.MEDIA_EXIT_FULLSCREEN_REQUEST:h.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:Ir,f=Math.max(m-S,0),_=new u.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:f}),this.dispatchEvent(_);break;case"ArrowRight":c=this.getAttribute(o.MEDIA_CURRENT_TIME),m=c&&!Number.isNaN(+c)?+c:Ir,f=Math.max(m+S,0),_=new u.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:f}),this.dispatchEvent(_);break;default:break}}};Ee=new WeakMap;Ye=new WeakSet;ut=function(t){let{key:i}=t;if(!Lr.includes(i)){this.removeEventListener("keyup",Ke(this,Ye,ut));return}this.keyboardShortcutHandler(t)};Ft=new WeakSet;Vi=function(t){let{metaKey:i,altKey:e,key:a}=t;if(i||e||!Lr.includes(a)){this.removeEventListener("keyup",Ke(this,Ye,ut));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(Fe(this,Ee).contains(`no${a.toLowerCase()}`)||a===" "&&Fe(this,Ee).contains("nospace"))&&t.preventDefault(),this.addEventListener("keyup",Ke(this,Ye,ut),{once:!0})};var Bi={default(t,i){return t.getAttribute(i)},[o.MEDIA_CAPTIONS_LIST](t){return q(Kt(t))||void 0},[o.MEDIA_SUBTITLES_LIST](t){return q(dt(t))||void 0},[o.MEDIA_SUBTITLES_LIST](t){return q(dt(t))||void 0},[o.MEDIA_CAPTIONS_SHOWING](t){return q(Hi(t))||void 0},[o.MEDIA_PAUSED](t){return Cr(t)},[o.MEDIA_MUTED](t){return wr(t)},[o.MEDIA_VOLUME](t){return xr(t)},[o.MEDIA_VOLUME_LEVEL](t){return Dr(t)},[o.MEDIA_CURRENT_TIME](t){return Rr(t)},[o.MEDIA_DURATION](t){return Pr(t)},[o.MEDIA_SEEKABLE](t){var i;return(i=Ur(t))==null?void 0:i.join(":")},[o.MEDIA_PLAYBACK_RATE](t){return Or(t)}},Cr=t=>t.media?t.media.paused:!0,wr=t=>!!(t.media&&t.media.muted),xr=t=>{let i=t.media;return i?i.volume:1},Dr=t=>{let i="high";if(!t.media)return i;let{muted:e,volume:a}=t.media;return a===0||e?i="off":a<.5?i="low":a<.75&&(i="medium"),i},Rr=t=>{let i=t.media;return i?i.currentTime:0},Pr=t=>{let i=t==null?void 0:t.media;return Number.isFinite(i==null?void 0:i.duration)?i.duration:NaN},Ur=t=>{var i;let e=t==null?void 0:t.media;if(!((i=e==null?void 0:e.seekable)!=null&&i.length))return;let a=e.seekable.start(0),r=e.seekable.end(e.seekable.length-1);if(!(!a&&!r))return[Number(a.toFixed(3)),Number(r.toFixed(3))]},Or=t=>{let i=t.media;return i?i.playbackRate:1},dt=t=>We(t.media,{kind:$e.SUBTITLES}),Kt=t=>We(t.media,{kind:$e.CAPTIONS}),Mr=t=>We(t.media,{kind:$e.SUBTITLES,mode:Me.SHOWING}),Hi=t=>We(t.media,{kind:$e.CAPTIONS,mode:Me.SHOWING}),hs=Object.values(o),Nr=t=>{var i,e,a,r;let{observedAttributes:n}=t.constructor;!n&&((i=t.nodeName)==null?void 0:i.includes("-"))&&(u.customElements.upgrade(t),{observedAttributes:n}=t.constructor);let s=(r=(a=(e=t==null?void 0:t.getAttribute)==null?void 0:e.call(t,o.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(n||s)?(n||s).filter(l=>hs.includes(l)):[]},Wi=t=>!!Nr(t).length,ps=async(t,i,e)=>(t.isConnected||await $r(0),e==null?t.removeAttribute(i):typeof e=="boolean"?e?t.setAttribute(i,""):t.removeAttribute(i):Number.isNaN(e)?t.removeAttribute(i):t.setAttribute(i,e)),bs=t=>{var i;return!!((i=t.closest)!=null&&i.call(t,'*[slot="media"]'))},lt=(t,i)=>{if(bs(t))return;let e=(r,n)=>{var s,l;Wi(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(_=>lt(_,n))},a=t==null?void 0:t.nodeName.toLowerCase();if(a.includes("-")&&!Wi(t)){u.customElements.whenDefined(a).then(()=>{e(t,i)});return}e(t,i)},Le=(t,i,e)=>{t.forEach(a=>{!Nr(a).includes(i)||ps(a,i,e)})},Es=(t,i,e)=>{lt(t,i);let a=c=>{var m;let f=(m=c==null?void 0:c.composedPath()[0])!=null?m:c.target;i(f)},r=c=>{var m;let f=(m=c==null?void 0:c.composedPath()[0])!=null?m:c.target;e(f)};t.addEventListener(h.REGISTER_MEDIA_STATE_RECEIVER,a),t.addEventListener(h.UNREGISTER_MEDIA_STATE_RECEIVER,r);let n=c=>{c.forEach(m=>{let{addedNodes:f=[],removedNodes:_=[],type:S,target:y,attributeName:W}=m;S==="childList"?(Array.prototype.forEach.call(f,P=>lt(P,i)),Array.prototype.forEach.call(_,P=>lt(P,e))):S==="attributes"&&W===o.MEDIA_CHROME_ATTRIBUTES&&(Wi(y)?i(y):e(y))})},s=new MutationObserver(n);return s.observe(t,{childList:!0,attributes:!0,subtree:!0}),()=>{lt(t,e),s.disconnect(),t.removeEventListener(h.REGISTER_MEDIA_STATE_RECEIVER,a),t.removeEventListener(h.UNREGISTER_MEDIA_STATE_RECEIVER,r)}},Wt,Fi=()=>{var t,i;return Wt||(Wt=(i=(t=d)==null?void 0:t.createElement)==null?void 0:i.call(t,"video"),Wt)},fs=async(t=Fi())=>{if(!t)return!1;let i=t.volume;return t.volume=i/2+.1,await $r(0),t.volume!==i},$r=t=>new Promise(i=>setTimeout(i,t)),gs=(t=Fi())=>typeof(t==null?void 0:t.requestPictureInPicture)=="function",vs=gs(),ct,As=fs().then(t=>(ct=t,ct)),_s=!!u.WebKitPlaybackTargetAvailabilityEvent,ys=!!u.chrome,Ts=(t=Fi())=>{let i=d[x.enabled];return!i&&t&&(i="webkitSupportsFullscreen"in t),i},kr=Ts();function Is(t=[]){return Array.from(t).map((i,e)=>[Number(t.start(e).toFixed(3)),Number(t.end(e).toFixed(3))].join(":")).join(" ")}p("media-controller",Yt);var mt=Yt;var Vr=d.createElement("template"),Br=`
193
193
  height: var(--thumb-height);
194
194
  width: var(--media-range-thumb-width, 10px);
195
195
  border: var(--media-range-thumb-border, none);
@@ -200,11 +200,13 @@
200
200
  transition: var(--media-range-thumb-transition, none);
201
201
  transform: var(--media-range-thumb-transform, none);
202
202
  opacity: var(--media-range-thumb-opacity, 1);
203
- `,Gt=`
203
+ `,Ki=`
204
204
  width: var(--media-range-track-width, 100%);
205
205
  min-width: 40px;
206
206
  height: var(--track-height);
207
207
  border: var(--media-range-track-border, none);
208
+ outline: var(--media-range-track-outline);
209
+ outline-offset: var(--media-range-track-outline-offset);
208
210
  border-radius: var(--media-range-track-border-radius, 0);
209
211
  background: var(--media-range-track-progress-internal, var(--media-range-track-background, #eee));
210
212
  box-shadow: var(--media-range-track-box-shadow, none);
@@ -219,12 +221,10 @@
219
221
  --media-range-padding: var(--media-control-padding, 10px);
220
222
  --_media-range-padding: var(--media-range-padding, 10px);
221
223
 
222
- position: relative;
223
- display: inline-flex;
224
- align-items: center;
225
- justify-content: center;
226
224
  vertical-align: middle;
227
225
  box-sizing: border-box;
226
+ display: inline-block;
227
+ position: relative;
228
228
  background: var(--media-control-background, rgba(20,20,30, 0.7));
229
229
  transition: background 0.15s linear;
230
230
  width: 100px;
@@ -240,6 +240,11 @@
240
240
  background: var(--media-control-hover-background, rgba(50,50,60, 0.7));
241
241
  }
242
242
 
243
+ #container {
244
+ position: relative;
245
+ height: 100%;
246
+ }
247
+
243
248
  input[type=range] {
244
249
 
245
250
  -webkit-appearance: none;
@@ -268,8 +273,8 @@
268
273
  translate: var(--media-range-track-translate-x, 0) var(--media-range-track-translate-y, 0);
269
274
  }
270
275
 
271
- input[type=range]::-webkit-slider-runnable-track { ${Gt} }
272
- input[type=range]::-moz-range-track { ${Gt} }
276
+ input[type=range]::-webkit-slider-runnable-track { ${Ki} }
277
+ input[type=range]::-moz-range-track { ${Ki} }
273
278
  input[type=range]::-ms-track {
274
279
 
275
280
  width: 100%;
@@ -279,24 +284,23 @@
279
284
  border-color: transparent;
280
285
  color: transparent;
281
286
 
282
- ${Gt}
287
+ ${Ki}
283
288
  }
284
289
 
285
290
  #background,
286
291
  #pointer {
287
- ${Gt}
288
- width: auto;
292
+ min-width: 40px;
293
+ width: var(--media-range-track-width, 100%);
294
+ height: var(--track-height);
295
+ border-radius: var(--media-range-track-border-radius, 0);
289
296
  position: absolute;
290
297
  top: 50%;
291
298
  transform: translate(var(--media-range-track-translate-x, 0px), calc(var(--media-range-track-translate-y, 0px) - 50%));
292
- left: var(--media-range-padding-left, var(--_media-range-padding));
293
- right: var(--media-range-padding-right, var(--_media-range-padding));
294
299
  background: var(--media-range-track-background, #333);
295
300
  }
296
301
 
297
302
  #pointer {
298
303
  min-width: auto;
299
- right: auto;
300
304
  background: var(--media-range-track-pointer-background);
301
305
  border-right: var(--media-range-track-pointer-border-right);
302
306
  transition: visibility .25s, opacity .25s;
@@ -314,10 +318,8 @@
314
318
 
315
319
  z-index: 1;
316
320
  display: var(--media-time-range-hover-display, none);
317
- box-sizing: border-box;
318
321
  position: absolute;
319
- left: var(--media-range-padding-left, var(--_media-range-padding));
320
- right: var(--media-range-padding-right, var(--_media-range-padding));
322
+ width: 100%;
321
323
  bottom: var(--media-time-range-hover-bottom, -5px);
322
324
  height: var(--media-time-range-hover-height, max(calc(100% + 5px), 20px));
323
325
  }
@@ -354,11 +356,13 @@
354
356
  background-color: #777;
355
357
  }
356
358
  </style>
357
- <div id="background"></div>
358
- <div id="pointer"></div>
359
- <div id="hoverzone"></div>
360
- <input id="range" type="range" min="0" max="1000" step="any" value="0">
361
- `;var Zt=class extends u.HTMLElement{static get observedAttributes(){return["disabled","aria-disabled",o.MEDIA_CONTROLLER]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Vr.content.cloneNode(!0)),this.range=this.shadowRoot.querySelector("#range"),this.range.addEventListener("input",this.updateBar.bind(this))}attributeChangedCallback(i,e,a){var r,n;if(i===o.MEDIA_CONTROLLER){if(e){let s=d.getElementById(e);(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(i==="disabled"||i==="aria-disabled"&&e!==a)&&(a==null?this.range.removeAttribute(i):this.range.setAttribute(i,a))}connectedCallback(){var i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.associateElement)==null||i.call(a,this)}this.updateBar()}disconnectedCallback(){var i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.unassociateElement)==null||i.call(a,this)}}updatePointerBar(i){let e=this.range.getBoundingClientRect(),a=(i.clientX-e.left)/e.width;a=Math.max(0,Math.min(1,a));let{style:r}=oe(this.shadowRoot,"#pointer");r.setProperty("width",`${a*e.width}px`)}updateBar(){let i=this.getBarColors(),e="linear-gradient(to right, ",a=0;i.forEach(n=>{n[1]<a||(e=e+`${n[0]} ${a}%, ${n[0]} ${n[1]}%,`,a=n[1])}),e=e.slice(0,e.length-1)+")";let{style:r}=oe(this.shadowRoot,":host");r.setProperty("--media-range-track-progress-internal",e)}getBarColors(){let i=this.range,e=i.value-i.min,a=i.max-i.min,r=e/a*100,n=0;if(i.value>i.min&&i.value<i.max){let l=getComputedStyle(this).getPropertyValue("--media-range-thumb-width")||"10px";n=parseInt(l)*(.5-r/100)/i.offsetWidth*100}return[["var(--media-range-bar-color, #fff)",r+n],["transparent",100]]}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};p("media-chrome-range",Zt);var ht=Zt;var Hr=d.createElement("template");Hr.innerHTML=`
359
+ <div id="container">
360
+ <div id="background"></div>
361
+ <div id="pointer"></div>
362
+ <div id="hoverzone"></div>
363
+ <input id="range" type="range" min="0" max="1000" step="any" value="0">
364
+ </div>
365
+ `;var Gt=class extends u.HTMLElement{static get observedAttributes(){return["disabled","aria-disabled",o.MEDIA_CONTROLLER]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Vr.content.cloneNode(!0)),this.container=this.shadowRoot.querySelector("#container"),this.range=this.shadowRoot.querySelector("#range"),this.range.addEventListener("input",this.updateBar.bind(this))}attributeChangedCallback(i,e,a){var r,n;if(i===o.MEDIA_CONTROLLER){if(e){let s=d.getElementById(e);(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(i==="disabled"||i==="aria-disabled"&&e!==a)&&(a==null?this.range.removeAttribute(i):this.range.setAttribute(i,a))}connectedCallback(){var i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.associateElement)==null||i.call(a,this)}this.updateBar()}disconnectedCallback(){var i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.unassociateElement)==null||i.call(a,this)}}updatePointerBar(i){let e=this.range.getBoundingClientRect(),a=(i.clientX-e.left)/e.width;a=Math.max(0,Math.min(1,a));let{style:r}=re(this.shadowRoot,"#pointer");r.setProperty("width",`${a*e.width}px`)}updateBar(){let i=this.getBarColors(),e="linear-gradient(to right, ",a=0;i.forEach(n=>{n[1]<a||(e=e+`${n[0]} ${a}%, ${n[0]} ${n[1]}%,`,a=n[1])}),e=e.slice(0,e.length-1)+")";let{style:r}=re(this.shadowRoot,":host");r.setProperty("--media-range-track-progress-internal",e)}getBarColors(){let i=this.range,e=i.value-i.min,a=i.max-i.min,r=e/a*100,n=0;if(i.value>i.min&&i.value<i.max){let l=getComputedStyle(this).getPropertyValue("--media-range-thumb-width")||"10px";n=parseInt(l)*(.5-r/100)/i.offsetWidth*100}return[["var(--media-range-bar-color, #fff)",r+n],["transparent",100]]}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};p("media-chrome-range",Gt);var ht=Gt;var Hr=d.createElement("template");Hr.innerHTML=`
362
366
  <style>
363
367
  :host {
364
368
 
@@ -412,7 +416,7 @@
412
416
  <span id="container">
413
417
  <slot></slot>
414
418
  </span>
415
- `;var Qt=class extends u.HTMLElement{static get observedAttributes(){return[o.MEDIA_CONTROLLER]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Wr.content.cloneNode(!0)),this.container=this.shadowRoot.querySelector("#container")}attributeChangedCallback(i,e,a){var r,n;if(i===o.MEDIA_CONTROLLER){if(e){let s=d.getElementById(e);(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 i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.associateElement)==null||i.call(a,this)}}disconnectedCallback(){var i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.unassociateElement)==null||i.call(a,this)}}};p("media-text-display",Qt);var be=Qt;var Gi=class extends be{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME]}attributeChangedCallback(i,e,a){i===o.MEDIA_CURRENT_TIME&&(this.container.innerHTML=z(a)),super.attributeChangedCallback(i,e,a)}};p("media-current-time-display",Gi);var Zi=class extends be{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_DURATION]}attributeChangedCallback(i,e,a){i===o.MEDIA_DURATION&&(this.container.innerHTML=z(a)),super.attributeChangedCallback(i,e,a)}};p("media-duration-display",Zi);var Ms="&nbsp;/&nbsp;",Ss=(t,{timesSep:i=Ms}={})=>{var e,a,r;let n=t.getAttribute("remaining")!=null,s=t.getAttribute("show-duration")!=null,l=(e=t.mediaCurrentTime)!=null?e:0,c=(r=(a=t.mediaDuration)!=null?a:t.mediaSeekableEnd)!=null?r:0,m=n?z(0-(c-l)):z(l);return s?`${m}${i}${z(c)}`:m},ks="video not loaded, unknown time.",Ls=t=>{let i=t.mediaCurrentTime,e=t.mediaDuration||t.mediaSeekableEnd;if(i==null||e==null){t.setAttribute("aria-valuetext",ks);return}let a=t.hasAttribute("remaining"),r=t.hasAttribute("show-duration"),n=a?ye(0-(e-i)):ye(i);if(!r){t.setAttribute("aria-valuetext",n);return}let s=ye(e),l=`${n} of ${s}`;t.setAttribute("aria-valuetext",l)},Qi=class extends be{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",N.PLAYBACK_TIME()),super.connectedCallback()}disconnectedCallback(){this.disable()}attributeChangedCallback(i,e,a){if([o.MEDIA_CURRENT_TIME,o.MEDIA_DURATION,o.MEDIA_SEEKABLE,"remaining","show-duration"].includes(i)){let r=Ss(this);Ls(this),this.container.innerHTML=r}else i==="disabled"&&a!==e&&(a==null?this.enable():this.disable());super.attributeChangedCallback(i,e,a)}enable(){this.setAttribute("tabindex",0)}disable(){this.removeAttribute("tabindex")}get mediaDuration(){let i=this.getAttribute(o.MEDIA_DURATION);return i!=null?+i:void 0}get mediaCurrentTime(){let i=this.getAttribute(o.MEDIA_CURRENT_TIME);return i!=null?+i:void 0}get mediaSeekable(){let i=this.getAttribute(o.MEDIA_SEEKABLE);if(!!i)return i.split(":").map(e=>+e)}get mediaSeekableEnd(){var i;let[,e]=(i=this.mediaSeekable)!=null?i:[];return e}get mediaSeekableStart(){var i;let[e]=(i=this.mediaSeekable)!=null?i:[];return e}};p("media-time-display",Qi);var Cs=`<svg aria-hidden="true" viewBox="0 0 26 24">
419
+ `;var Zt=class extends u.HTMLElement{static get observedAttributes(){return[o.MEDIA_CONTROLLER]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Wr.content.cloneNode(!0)),this.container=this.shadowRoot.querySelector("#container")}attributeChangedCallback(i,e,a){var r,n;if(i===o.MEDIA_CONTROLLER){if(e){let s=d.getElementById(e);(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 i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.associateElement)==null||i.call(a,this)}}disconnectedCallback(){var i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.unassociateElement)==null||i.call(a,this)}}};p("media-text-display",Zt);var fe=Zt;var Gi=class extends fe{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME]}attributeChangedCallback(i,e,a){i===o.MEDIA_CURRENT_TIME&&(this.container.innerHTML=j(a)),super.attributeChangedCallback(i,e,a)}};p("media-current-time-display",Gi);var Zi=class extends fe{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_DURATION]}attributeChangedCallback(i,e,a){i===o.MEDIA_DURATION&&(this.container.innerHTML=j(a)),super.attributeChangedCallback(i,e,a)}};p("media-duration-display",Zi);var Ms="&nbsp;/&nbsp;",ks=(t,{timesSep:i=Ms}={})=>{var e,a,r;let n=t.getAttribute("remaining")!=null,s=t.getAttribute("show-duration")!=null,l=(e=t.mediaCurrentTime)!=null?e:0,c=(r=(a=t.mediaDuration)!=null?a:t.mediaSeekableEnd)!=null?r:0,m=n?j(0-(c-l)):j(l);return s?`${m}${i}${j(c)}`:m},Ss="video not loaded, unknown time.",Ls=t=>{let i=t.mediaCurrentTime,e=t.mediaDuration||t.mediaSeekableEnd;if(i==null||e==null){t.setAttribute("aria-valuetext",Ss);return}let a=t.hasAttribute("remaining"),r=t.hasAttribute("show-duration"),n=a?ke(0-(e-i)):ke(i);if(!r){t.setAttribute("aria-valuetext",n);return}let s=ke(e),l=`${n} of ${s}`;t.setAttribute("aria-valuetext",l)},Qi=class extends fe{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",O.PLAYBACK_TIME()),super.connectedCallback()}disconnectedCallback(){this.disable()}attributeChangedCallback(i,e,a){if([o.MEDIA_CURRENT_TIME,o.MEDIA_DURATION,o.MEDIA_SEEKABLE,"remaining","show-duration"].includes(i)){let r=ks(this);Ls(this),this.container.innerHTML=r}else i==="disabled"&&a!==e&&(a==null?this.enable():this.disable());super.attributeChangedCallback(i,e,a)}enable(){this.setAttribute("tabindex",0)}disable(){this.removeAttribute("tabindex")}get mediaDuration(){let i=this.getAttribute(o.MEDIA_DURATION);return i!=null?+i:void 0}get mediaCurrentTime(){let i=this.getAttribute(o.MEDIA_CURRENT_TIME);return i!=null?+i:void 0}get mediaSeekable(){let i=this.getAttribute(o.MEDIA_SEEKABLE);if(!!i)return i.split(":").map(e=>+e)}get mediaSeekableEnd(){var i;let[,e]=(i=this.mediaSeekable)!=null?i:[];return e}get mediaSeekableStart(){var i;let[e]=(i=this.mediaSeekable)!=null?i:[];return e}};p("media-time-display",Qi);var Cs=`<svg aria-hidden="true" viewBox="0 0 26 24">
416
420
  <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"/>
417
421
  </svg>`,ws=`<svg aria-hidden="true" viewBox="0 0 26 24">
418
422
  <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"/>
@@ -432,9 +436,9 @@
432
436
 
433
437
  <slot name="on">${Cs}</slot>
434
438
  <slot name="off">${ws}</slot>
435
- `;var Fr=t=>{t.setAttribute("aria-checked",$i(t))},qi=class extends w{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(i={}){super({slotTemplate:Kr,...i}),this._captionsReady=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",N.CLOSED_CAPTIONS()),Fr(this)}attributeChangedCallback(i,e,a){if([o.MEDIA_CAPTIONS_SHOWING,o.MEDIA_SUBTITLES_SHOWING].includes(i)&&Fr(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(i)){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(i,e,a)}handleClick(i){Ht(this)}};p("media-captions-button",qi);var zi=30,Ds=`<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)">${zi}</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>`,Zr=d.createElement("template");Zr.innerHTML=`
436
- <slot name="forward">${Ds}</slot>
437
- `;var xs=0,Yr=t=>{let i=Math.abs(+t.getAttribute("seek-offset")),e=L.SEEK_FORWARD_N_SECS({seekOffset:i});t.setAttribute("aria-label",e)},Gr=t=>{let i=Nt(t,"forward"),e=t.getAttribute("seek-offset");Ot(i,e)},ji=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,"seek-offset"]}constructor(i={}){super({slotTemplate:Zr,...i})}connectedCallback(){this.hasAttribute("seek-offset")||this.setAttribute("seek-offset",zi),Yr(this),Gr(this),super.connectedCallback()}attributeChangedCallback(i,e,a){i==="seek-offset"&&(a==null&&this.setAttribute("seek-offset",zi),Gr(this),Yr(this)),super.attributeChangedCallback(i,e,a)}handleClick(){let i=this.getAttribute(o.MEDIA_CURRENT_TIME),e=+this.getAttribute("seek-offset"),r=(i&&!Number.isNaN(+i)?+i:xs)+e,n=new u.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)}};p("media-seek-forward-button",ji);var Rs=`<svg aria-hidden="true" viewBox="0 0 26 24">
439
+ `;var Fr=t=>{t.setAttribute("aria-checked",Ni(t))},qi=class extends w{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(i={}){super({slotTemplate:Kr,...i}),this._captionsReady=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",O.CLOSED_CAPTIONS()),Fr(this)}attributeChangedCallback(i,e,a){if([o.MEDIA_CAPTIONS_SHOWING,o.MEDIA_SUBTITLES_SHOWING].includes(i)&&Fr(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(i)){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(i,e,a)}handleClick(i){Ht(this)}};p("media-captions-button",qi);var zi=30,xs=`<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)">${zi}</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>`,Zr=d.createElement("template");Zr.innerHTML=`
440
+ <slot name="forward">${xs}</slot>
441
+ `;var Ds=0,Yr=t=>{let i=Math.abs(+t.getAttribute("seek-offset")),e=L.SEEK_FORWARD_N_SECS({seekOffset:i});t.setAttribute("aria-label",e)},Gr=t=>{let i=Nt(t,"forward"),e=t.getAttribute("seek-offset");Ot(i,e)},ji=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,"seek-offset"]}constructor(i={}){super({slotTemplate:Zr,...i})}connectedCallback(){this.hasAttribute("seek-offset")||this.setAttribute("seek-offset",zi),Yr(this),Gr(this),super.connectedCallback()}attributeChangedCallback(i,e,a){i==="seek-offset"&&(a==null&&this.setAttribute("seek-offset",zi),Gr(this),Yr(this)),super.attributeChangedCallback(i,e,a)}handleClick(){let i=this.getAttribute(o.MEDIA_CURRENT_TIME),e=+this.getAttribute("seek-offset"),r=(i&&!Number.isNaN(+i)?+i:Ds)+e,n=new u.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)}};p("media-seek-forward-button",ji);var Rs=`<svg aria-hidden="true" viewBox="0 0 26 24">
438
442
  <path d="M16 3v2.5h3.5V9H22V3h-6ZM4 9h2.5V5.5H10V3H4v6Zm15.5 9.5H16V21h6v-6h-2.5v3.5ZM6.5 15H4v6h6v-2.5H6.5V15Z"/>
439
443
  </svg>`,Ps=`<svg aria-hidden="true" viewBox="0 0 26 24">
440
444
  <path d="M18.5 6.5V3H16v6h6V6.5h-3.5ZM16 21h2.5v-3.5H22V15h-6v6ZM4 17.5h3.5V21H10v-6H4v2.5Zm3.5-11H4V9h6V3H7.5v3.5Z"/>
@@ -527,9 +531,9 @@
527
531
 
528
532
  <slot name="play">${Ns}</slot>
529
533
  <slot name="pause">${$s}</slot>
530
- `;var an=t=>{let e=t.getAttribute(o.MEDIA_PAUSED)!=null?L.PLAY():L.PAUSE();t.setAttribute("aria-label",e)},ta=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PAUSED]}constructor(i={}){super({slotTemplate:rn,...i})}connectedCallback(){an(this),super.connectedCallback()}attributeChangedCallback(i,e,a){i===o.MEDIA_PAUSED&&an(this),super.attributeChangedCallback(i,e,a)}handleClick(i){let e=this.getAttribute(o.MEDIA_PAUSED)!=null?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}};p("media-play-button",ta);var nn=[1,1.25,1.5,1.75,2],qt=1,on=d.createElement("template");on.innerHTML=`
534
+ `;var an=t=>{let e=t.getAttribute(o.MEDIA_PAUSED)!=null?L.PLAY():L.PAUSE();t.setAttribute("aria-label",e)},ta=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PAUSED]}constructor(i={}){super({slotTemplate:rn,...i})}connectedCallback(){an(this),super.connectedCallback()}attributeChangedCallback(i,e,a){i===o.MEDIA_PAUSED&&an(this),super.attributeChangedCallback(i,e,a)}handleClick(i){let e=this.getAttribute(o.MEDIA_PAUSED)!=null?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}};p("media-play-button",ta);var nn=[1,1.25,1.5,1.75,2],Qt=1,on=d.createElement("template");on.innerHTML=`
531
535
  <span id="container"></span>
532
- `;var ia=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,"rates"]}constructor(i={}){super({slotTemplate:on,...i}),this._rates=nn,this.container=this.shadowRoot.querySelector("#container"),this.container.innerHTML=`${qt}x`}attributeChangedCallback(i,e,a){if(i==="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:nn;return}if(i===o.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,n=Number.isNaN(r)?qt:r;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",N.PLAYBACK_RATE({playbackRate:n}));return}super.attributeChangedCallback(i,e,a)}handleClick(i){var e,a;let r=+this.getAttribute(o.MEDIA_PLAYBACK_RATE)||qt,n=(a=(e=this._rates.find(l=>l>r))!=null?e:this._rates[0])!=null?a:qt,s=new u.CustomEvent(h.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:n});this.dispatchEvent(s)}};p("media-playback-rate-button",ia);var sn=d.createElement("template");sn.innerHTML=`
536
+ `;var ia=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,"rates"]}constructor(i={}){super({slotTemplate:on,...i}),this._rates=nn,this.container=this.shadowRoot.querySelector("#container"),this.container.innerHTML=`${Qt}x`}attributeChangedCallback(i,e,a){if(i==="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:nn;return}if(i===o.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,n=Number.isNaN(r)?Qt:r;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",O.PLAYBACK_RATE({playbackRate:n}));return}super.attributeChangedCallback(i,e,a)}handleClick(i){var e,a;let r=+this.getAttribute(o.MEDIA_PLAYBACK_RATE)||Qt,n=(a=(e=this._rates.find(l=>l>r))!=null?e:this._rates[0])!=null?a:Qt,s=new u.CustomEvent(h.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:n});this.dispatchEvent(s)}};p("media-playback-rate-button",ia);var sn=d.createElement("template");sn.innerHTML=`
533
537
  <style>
534
538
  :host {
535
539
  pointer-events: none;
@@ -555,7 +559,7 @@
555
559
  </style>
556
560
 
557
561
  <img aria-hidden="true" id="image"/>
558
- `;var Bs=t=>{t.style.removeProperty("background-image")},Vs=(t,i)=>{t.style["background-image"]=`url('${i}')`},aa=class extends u.HTMLElement{static get observedAttributes(){return[o.MEDIA_HAS_PLAYED,"placeholder-src","src"]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(sn.content.cloneNode(!0)),this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(i,e,a){i==="src"&&(a==null?this.image.removeAttribute("src"):this.image.setAttribute("src",a)),i==="placeholder-src"&&(a==null?Bs(this.image):Vs(this.image,a))}};p("media-poster-image",aa);var da=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)},F=(t,i,e)=>(da(t,i,"read from private field"),e?e.call(t):i.get(t)),j=(t,i,e)=>{if(i.has(t))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(t):i.set(t,e)},pt=(t,i,e,a)=>(da(t,i,"write to private field"),a?a.call(t,e):i.set(t,e),e),ra=(t,i,e)=>(da(t,i,"access private method"),e),bt,zt,jt,Ge,Et,oa,Jt,ti,Xt,sa,la,dn,Hs="video not loaded, unknown time.",na=t=>{let i=t.range,e=ye(+i.value),a=ye(+i.max),r=e&&a?`${e} of ${a}`:Hs;i.setAttribute("aria-valuetext",r)},cn=d.createElement("template");cn.innerHTML=`
562
+ `;var Bs=t=>{t.style.removeProperty("background-image")},Vs=(t,i)=>{t.style["background-image"]=`url('${i}')`},aa=class extends u.HTMLElement{static get observedAttributes(){return[o.MEDIA_HAS_PLAYED,"placeholder-src","src"]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(sn.content.cloneNode(!0)),this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(i,e,a){i==="src"&&(a==null?this.image.removeAttribute("src"):this.image.setAttribute("src",a)),i==="placeholder-src"&&(a==null?Bs(this.image):Vs(this.image,a))}};p("media-poster-image",aa);var da=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)},K=(t,i,e)=>(da(t,i,"read from private field"),e?e.call(t):i.get(t)),X=(t,i,e)=>{if(i.has(t))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(t):i.set(t,e)},pt=(t,i,e,a)=>(da(t,i,"write to private field"),a?a.call(t,e):i.set(t,e),e),ra=(t,i,e)=>(da(t,i,"access private method"),e),bt,qt,zt,Ge,Et,oa,Xt,ei,jt,sa,la,dn,Hs="video not loaded, unknown time.",na=t=>{let i=t.range,e=ke(+i.value),a=ke(+i.max),r=e&&a?`${e} of ${a}`:Hs;i.setAttribute("aria-valuetext",r)},cn=d.createElement("template");cn.innerHTML=`
559
563
  <style>
560
564
  :host {
561
565
  --media-preview-background-color: rgba(20,20,30, .5);
@@ -567,13 +571,24 @@
567
571
  color: #fff;
568
572
  }
569
573
 
574
+ #preview-rail,
575
+ #current-rail {
576
+
577
+ width: 1%;
578
+ position: absolute;
579
+ left: 0;
580
+ bottom: 100%;
581
+ pointer-events: none;
582
+ }
583
+
570
584
  [part~="box"] {
585
+
586
+ position: absolute;
587
+ bottom: 100%;
571
588
  display: flex;
572
589
  flex-direction: column;
573
590
  align-items: center;
574
- position: absolute;
575
- left: 0;
576
- bottom: 100%;
591
+ transform: translateX(-50%);
577
592
  }
578
593
 
579
594
  [part~="preview-box"] {
@@ -637,20 +652,20 @@
637
652
  --media-time-range-hover-display: block;
638
653
  }
639
654
  </style>
640
- <span part="box preview-box">
641
- <slot name="preview">
655
+ <div id="preview-rail">
656
+ <slot name="preview" part="box preview-box">
642
657
  <media-preview-thumbnail></media-preview-thumbnail>
643
658
  <media-preview-time-display></media-preview-time-display>
644
659
  </slot>
645
- </span>
646
- <span part="box current-box">
647
- <slot name="current">
660
+ </div>
661
+ <div id="current-rail">
662
+ <slot name="current" part="box current-box">
648
663
 
649
664
  </slot>
650
- </span>
651
- `;var ei=class extends ht{constructor(){super(),j(this,Xt),j(this,la),j(this,bt,void 0),j(this,zt,void 0),j(this,jt,i=>{if([...F(this,bt)].some(m=>i.composedPath().includes(m)))return;this.updatePointerBar(i);let e=+this.getAttribute(o.MEDIA_DURATION);if(!e)return;let a=this.range.getBoundingClientRect(),r=(i.clientX-a.left)/a.width;r=Math.max(0,Math.min(1,r));let n=ln(this,F(this,zt),r),{style:s}=oe(this.shadowRoot,'[part~="preview-box"]');s.transform=`translateX(${n}px)`;let l=r*e,c=new u.CustomEvent(h.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:l});this.dispatchEvent(c)}),j(this,Ge,!1),j(this,Et,i=>{(!i.composedPath().includes(this)||[...F(this,bt)].some(e=>i.composedPath().includes(e)))&&(u.removeEventListener("pointermove",F(this,Et)),pt(this,Ge,!1),F(this,Jt).call(this))}),j(this,oa,()=>{u.addEventListener("pointermove",F(this,jt),!1)}),j(this,Jt,()=>{u.removeEventListener("pointermove",F(this,jt));let i=new u.CustomEvent(h.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:null});this.dispatchEvent(i)}),j(this,ti,()=>{let i=this.getAttribute(o.MEDIA_DURATION);!F(this,Ge)&&i&&(pt(this,Ge,!0),F(this,oa).call(this),u.addEventListener("pointermove",F(this,Et),!1))}),this.shadowRoot.appendChild(cn.content.cloneNode(!0)),this.range.addEventListener("input",()=>{cancelAnimationFrame(this._refreshId);let e=this.range.value,a=new u.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(a)}),this._refreshBar=()=>{let i=(performance.now()-this._updateTimestamp)/1e3;this.range.value=this.mediaCurrentTime+i*this.mediaPlaybackRate,this.updateBar(),this.updateCurrentBox(),this._refreshId=requestAnimationFrame(this._refreshBar)},pt(this,bt,this.shadowRoot.querySelectorAll('[part~="box"]')),pt(this,zt,this.shadowRoot.querySelector('[part~="preview-box"]')),ra(this,Xt,sa).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",N.SEEK()),super.connectedCallback()}disconnectedCallback(){cancelAnimationFrame(this._refreshId),super.disconnectedCallback()}attributeChangedCallback(i,e,a){var r,n,s,l,c;(i===o.MEDIA_CURRENT_TIME||i===o.MEDIA_PAUSED||i===o.MEDIA_LOADING)&&(this._updateTimestamp=performance.now(),this.range.value=this.mediaCurrentTime,na(this),this.updateBar(),this.updateCurrentBox(),cancelAnimationFrame(this._refreshId),!this.mediaPaused&&!this.mediaLoading&&(this._refreshId=requestAnimationFrame(this._refreshBar))),i===o.MEDIA_DURATION&&(this.range.max=Math.floor((n=(r=this.mediaSeekableEnd)!=null?r:this.mediaDuration)!=null?n:1e3),na(this),this.updateBar(),this.updateCurrentBox()),i===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),na(this),this.updateBar()),i===o.MEDIA_BUFFERED&&this.updateBar(),i==="disabled"&&(a==null?ra(this,Xt,sa).call(this):ra(this,la,dn).call(this)),super.attributeChangedCallback(i,e,a)}get mediaPaused(){return this.hasAttribute(o.MEDIA_PAUSED)}get mediaLoading(){return this.hasAttribute(o.MEDIA_LOADING)}get mediaDuration(){let i=this.getAttribute(o.MEDIA_DURATION);return i!=null?+i:void 0}get mediaCurrentTime(){let i=this.getAttribute(o.MEDIA_CURRENT_TIME);return i!=null?+i:void 0}get mediaPlaybackRate(){let i=this.getAttribute(o.MEDIA_PLAYBACK_RATE);return i!=null?+i:1}get mediaBuffered(){let i=this.getAttribute(o.MEDIA_BUFFERED);return i?i.split(" ").map(e=>e.split(":").map(a=>+a)):[]}get mediaSeekable(){let i=this.getAttribute(o.MEDIA_SEEKABLE);if(!!i)return i.split(":").map(e=>+e)}get mediaSeekableEnd(){var i;let[,e]=(i=this.mediaSeekable)!=null?i:[];return e}get mediaSeekableStart(){var i;let[e]=(i=this.mediaSeekable)!=null?i:[];return e}getBarColors(){var i;let e=super.getBarColors(),{range:a}=this,r=a.max-a.min,n=this.mediaBuffered;if(!n.length||!Number.isFinite(r)||r<=0)return e;let s=this.mediaCurrentTime,[,l=a.min]=(i=n.find(([E,y])=>E<=s&&s<=y))!=null?i:[],m=(l-a.min)/r*100;return e.splice(1,0,["var(--media-time-buffered-color, rgba(255,255,255, .4))",m]),e}updateCurrentBox(){let i=this.shadowRoot.querySelector('[part~="current-box"]'),e=this.range.value/(this.range.max-this.range.min),a=ln(this,i,e),{style:r}=oe(this.shadowRoot,'[part~="current-box"]');r.transform=`translateX(${a}px)`}};bt=new WeakMap;zt=new WeakMap;jt=new WeakMap;Ge=new WeakMap;Et=new WeakMap;oa=new WeakMap;Jt=new WeakMap;ti=new WeakMap;Xt=new WeakSet;sa=function(){this.addEventListener("pointermove",F(this,ti),!1)};la=new WeakSet;dn=function(){u.removeEventListener("pointermove",F(this,Et)),this.removeEventListener("pointermove",F(this,ti)),pt(this,Ge,!1),F(this,Jt).call(this)};function ln(t,i,e){var a;let r=t.getBoundingClientRect(),n=t.range.getBoundingClientRect(),s=parseInt(getComputedStyle(t).getPropertyValue("--media-box-padding-left")),l=parseInt(getComputedStyle(t).getPropertyValue("--media-box-padding-right")),c=s+e*n.width,m=i.offsetWidth,E=c-m/2,k=((a=t.getAttribute("media-bounds")?ot(t,`#${t.getAttribute("media-bounds")}`):t.parentElement)!=null?a:t).getBoundingClientRect(),_=r.left-k.left,O=k.right-r.left-m-l,x=s-_;return Math.max(x,Math.min(E,O))}p("media-time-range",ei);var ca=ei;var ua=class extends ca{constructor(){super(),console.warn("MediaChrome: <media-progress-range> is deprecated. Use <media-time-range> instead.")}};p("media-progress-range",ua);var ma=30,Ws=`<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)">${ma}</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>`,hn=d.createElement("template");hn.innerHTML=`
665
+ </div>
666
+ `;var Jt=class extends ht{constructor(){super(),X(this,jt),X(this,la),X(this,bt,void 0),X(this,qt,void 0),X(this,zt,i=>{if([...K(this,bt)].some(m=>i.composedPath().includes(m)))return;this.updatePointerBar(i);let e=+this.getAttribute(o.MEDIA_DURATION);if(!e)return;let a=this.range.getBoundingClientRect(),r=(i.clientX-a.left)/a.width;r=Math.max(0,Math.min(1,r));let n=ln(this,K(this,qt),r),{style:s}=re(this.shadowRoot,"#preview-rail");s.transform=`translateX(${n})`;let l=r*e,c=new u.CustomEvent(h.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:l});this.dispatchEvent(c)}),X(this,Ge,!1),X(this,Et,i=>{(!i.composedPath().includes(this)||[...K(this,bt)].some(e=>i.composedPath().includes(e)))&&(u.removeEventListener("pointermove",K(this,Et)),pt(this,Ge,!1),K(this,Xt).call(this))}),X(this,oa,()=>{u.addEventListener("pointermove",K(this,zt),!1)}),X(this,Xt,()=>{u.removeEventListener("pointermove",K(this,zt));let i=new u.CustomEvent(h.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:null});this.dispatchEvent(i)}),X(this,ei,()=>{let i=this.getAttribute(o.MEDIA_DURATION);!K(this,Ge)&&i&&(pt(this,Ge,!0),K(this,oa).call(this),u.addEventListener("pointermove",K(this,Et),!1))}),this.container.appendChild(cn.content.cloneNode(!0)),this.range.addEventListener("input",()=>{cancelAnimationFrame(this._refreshId);let e=this.range.value,a=new u.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(a)}),this._refreshBar=()=>{let i=(performance.now()-this._updateTimestamp)/1e3;this.range.value=this.mediaCurrentTime+i*this.mediaPlaybackRate,this.updateBar(),this.updateCurrentBox(),this._refreshId=requestAnimationFrame(this._refreshBar)},pt(this,bt,this.shadowRoot.querySelectorAll('[part~="box"]')),pt(this,qt,this.shadowRoot.querySelector('[part~="preview-box"]')),ra(this,jt,sa).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",O.SEEK()),super.connectedCallback()}disconnectedCallback(){cancelAnimationFrame(this._refreshId),super.disconnectedCallback()}attributeChangedCallback(i,e,a){var r,n,s,l,c;(i===o.MEDIA_CURRENT_TIME||i===o.MEDIA_PAUSED||i===o.MEDIA_LOADING)&&(this._updateTimestamp=performance.now(),this.range.value=this.mediaCurrentTime,na(this),this.updateBar(),this.updateCurrentBox(),cancelAnimationFrame(this._refreshId),!this.mediaPaused&&!this.mediaLoading&&(this._refreshId=requestAnimationFrame(this._refreshBar))),i===o.MEDIA_DURATION&&(this.range.max=Math.floor((n=(r=this.mediaSeekableEnd)!=null?r:this.mediaDuration)!=null?n:1e3),na(this),this.updateBar(),this.updateCurrentBox()),i===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),na(this),this.updateBar()),i===o.MEDIA_BUFFERED&&this.updateBar(),i==="disabled"&&(a==null?ra(this,jt,sa).call(this):ra(this,la,dn).call(this)),super.attributeChangedCallback(i,e,a)}get mediaPaused(){return this.hasAttribute(o.MEDIA_PAUSED)}get mediaLoading(){return this.hasAttribute(o.MEDIA_LOADING)}get mediaDuration(){let i=this.getAttribute(o.MEDIA_DURATION);return i!=null?+i:void 0}get mediaCurrentTime(){let i=this.getAttribute(o.MEDIA_CURRENT_TIME);return i!=null?+i:void 0}get mediaPlaybackRate(){let i=this.getAttribute(o.MEDIA_PLAYBACK_RATE);return i!=null?+i:1}get mediaBuffered(){let i=this.getAttribute(o.MEDIA_BUFFERED);return i?i.split(" ").map(e=>e.split(":").map(a=>+a)):[]}get mediaSeekable(){let i=this.getAttribute(o.MEDIA_SEEKABLE);if(!!i)return i.split(":").map(e=>+e)}get mediaSeekableEnd(){var i;let[,e]=(i=this.mediaSeekable)!=null?i:[];return e}get mediaSeekableStart(){var i;let[e]=(i=this.mediaSeekable)!=null?i:[];return e}getBarColors(){var i;let e=super.getBarColors(),{range:a}=this,r=a.max-a.min,n=this.mediaBuffered;if(!n.length||!Number.isFinite(r)||r<=0)return e;let s=this.mediaCurrentTime,[,l=a.min]=(i=n.find(([f,_])=>f<=s&&s<=_))!=null?i:[],m=(l-a.min)/r*100;return e.splice(1,0,["var(--media-time-buffered-color, rgba(255,255,255, .4))",m]),e}updateCurrentBox(){let i=this.shadowRoot.querySelector('[part~="current-box"]'),e=this.range.value/(this.range.max-this.range.min),a=ln(this,i,e),{style:r}=re(this.shadowRoot,"#current-rail");r.transform=`translateX(${a})`}};bt=new WeakMap;qt=new WeakMap;zt=new WeakMap;Ge=new WeakMap;Et=new WeakMap;oa=new WeakMap;Xt=new WeakMap;ei=new WeakMap;jt=new WeakSet;sa=function(){this.addEventListener("pointermove",K(this,ei),!1)};la=new WeakSet;dn=function(){u.removeEventListener("pointermove",K(this,Et)),this.removeEventListener("pointermove",K(this,ei)),pt(this,Ge,!1),K(this,Xt).call(this)};function ln(t,i,e){var a;let r=`${e*100*100}%`,n=i.offsetWidth;if(!n)return r;let s=(a=t.getAttribute("bounds")?ot(t,`#${t.getAttribute("bounds")}`):t.parentElement)!=null?a:t,l=parseInt(getComputedStyle(t).getPropertyValue("--media-box-padding-left")),c=parseInt(getComputedStyle(t).getPropertyValue("--media-box-padding-right")),m=t.range.getBoundingClientRect(),f=s.getBoundingClientRect(),_=(l-(m.left-f.left-n/2))/m.width*100,S=(f.right-m.left-n/2-c)/m.width*100;return Number.isNaN(_)||(r=`max(${_*100}%, ${r})`),Number.isNaN(S)||(r=`min(${r}, ${S*100}%)`),r}p("media-time-range",Jt);var ca=Jt;var ua=class extends ca{constructor(){super(),console.warn("MediaChrome: <media-progress-range> is deprecated. Use <media-time-range> instead.")}};p("media-progress-range",ua);var ma=30,Ws=`<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)">${ma}</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>`,hn=d.createElement("template");hn.innerHTML=`
652
667
  <slot name="backward">${Ws}</slot>
653
- `;var Fs=0,un=t=>{let i=Math.abs(+t.getAttribute("seek-offset")),e=L.SEEK_BACK_N_SECS({seekOffset:i});t.setAttribute("aria-label",e)},mn=t=>{let i=Nt(t,"backward"),e=t.getAttribute("seek-offset");Ot(i,e)},ha=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME]}constructor(i={}){super({slotTemplate:hn,...i})}connectedCallback(){this.hasAttribute("seek-offset")||this.setAttribute("seek-offset",ma),un(this),mn(this),super.connectedCallback()}attributeChangedCallback(i,e,a){i==="seek-offset"&&(a==null&&this.setAttribute("seek-offset",ma),mn(this),un(this)),super.attributeChangedCallback(i,e,a)}handleClick(){let i=this.getAttribute(o.MEDIA_CURRENT_TIME),e=+this.getAttribute("seek-offset"),a=i&&!Number.isNaN(+i)?+i:Fs,r=Math.max(a-e,0),n=new u.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)}};p("media-seek-backward-button",ha);var pa=class extends be{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PREVIEW_TIME]}attributeChangedCallback(i,e,a){i===o.MEDIA_PREVIEW_TIME&&a!=null&&(this.container.textContent=z(a)),super.attributeChangedCallback(i,e,a)}};p("media-preview-time-display",pa);var pn=d.createElement("template");pn.innerHTML=`
668
+ `;var Fs=0,un=t=>{let i=Math.abs(+t.getAttribute("seek-offset")),e=L.SEEK_BACK_N_SECS({seekOffset:i});t.setAttribute("aria-label",e)},mn=t=>{let i=Nt(t,"backward"),e=t.getAttribute("seek-offset");Ot(i,e)},ha=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME]}constructor(i={}){super({slotTemplate:hn,...i})}connectedCallback(){this.hasAttribute("seek-offset")||this.setAttribute("seek-offset",ma),un(this),mn(this),super.connectedCallback()}attributeChangedCallback(i,e,a){i==="seek-offset"&&(a==null&&this.setAttribute("seek-offset",ma),mn(this),un(this)),super.attributeChangedCallback(i,e,a)}handleClick(){let i=this.getAttribute(o.MEDIA_CURRENT_TIME),e=+this.getAttribute("seek-offset"),a=i&&!Number.isNaN(+i)?+i:Fs,r=Math.max(a-e,0),n=new u.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)}};p("media-seek-backward-button",ha);var pa=class extends fe{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PREVIEW_TIME]}attributeChangedCallback(i,e,a){i===o.MEDIA_PREVIEW_TIME&&a!=null&&(this.container.textContent=j(a)),super.attributeChangedCallback(i,e,a)}};p("media-preview-time-display",pa);var pn=d.createElement("template");pn.innerHTML=`
654
669
  <style>
655
670
  :host {
656
671
  box-sizing: border-box;
@@ -664,7 +679,7 @@
664
679
  }
665
680
  </style>
666
681
  <img crossorigin loading="eager" decoding="async" />
667
- `;var ba=class extends u.HTMLElement{static get observedAttributes(){return[o.MEDIA_CONTROLLER,"time",o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(pn.content.cloneNode(!0))}connectedCallback(){var i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.associateElement)==null||i.call(a,this)}}disconnectedCallback(){var i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.unassociateElement)==null||i.call(a,this)}}attributeChangedCallback(i,e,a){var r,n;if(["time",o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS].includes(i)&&this.update(),i===o.MEDIA_CONTROLLER){if(e){let s=d.getElementById(e);(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 i=this.getAttribute(o.MEDIA_PREVIEW_COORDS),e=this.getAttribute(o.MEDIA_PREVIEW_IMAGE);if(!(i&&e))return;let[a,r,n,s]=i.split(/\s+/).map(xt=>+xt),l=e.split("#")[0],c=getComputedStyle(this),{maxWidth:m,maxHeight:E,minWidth:y,minHeight:k}=c,_=Math.min(parseInt(m)/n,parseInt(E)/s),O=Math.max(parseInt(y)/n,parseInt(k)/s),x=_<1,P=x?_:O>1?O:1,{style:C}=oe(this.shadowRoot,":host"),re=oe(this.shadowRoot,"img").style,Y=this.shadowRoot.querySelector("img"),ne=x?"min":"max";C.setProperty(`${ne}-width`,"initial","important"),C.setProperty(`${ne}-height`,"initial","important"),C.width=`${n*P}px`,C.height=`${s*P}px`;let Oe=()=>{re.width=`${this.imgWidth*P}px`,re.height=`${this.imgHeight*P}px`,re.display="block"};Y.src!==l&&(Y.onload=()=>{this.imgWidth=Y.naturalWidth,this.imgHeight=Y.naturalHeight,Oe()},Y.src=l,Oe()),Oe(),re.transform=`translate(-${a*P}px, -${r*P}px)`}};p("media-preview-thumbnail",ba);var bn=d.createElement("template"),Ks=`
682
+ `;var ba=class extends u.HTMLElement{static get observedAttributes(){return[o.MEDIA_CONTROLLER,"time",o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(pn.content.cloneNode(!0))}connectedCallback(){var i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.associateElement)==null||i.call(a,this)}}disconnectedCallback(){var i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.unassociateElement)==null||i.call(a,this)}}attributeChangedCallback(i,e,a){var r,n;if(["time",o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS].includes(i)&&this.update(),i===o.MEDIA_CONTROLLER){if(e){let s=d.getElementById(e);(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 i=this.getAttribute(o.MEDIA_PREVIEW_COORDS),e=this.getAttribute(o.MEDIA_PREVIEW_IMAGE);if(!(i&&e))return;let[a,r,n,s]=i.split(/\s+/).map(Dt=>+Dt),l=e.split("#")[0],c=getComputedStyle(this),{maxWidth:m,maxHeight:f,minWidth:_,minHeight:S}=c,y=Math.min(parseInt(m)/n,parseInt(f)/s),W=Math.max(parseInt(_)/n,parseInt(S)/s),P=y<1,U=P?y:W>1?W:1,{style:C}=re(this.shadowRoot,":host"),ie=re(this.shadowRoot,"img").style,G=this.shadowRoot.querySelector("img"),ae=P?"min":"max";C.setProperty(`${ae}-width`,"initial","important"),C.setProperty(`${ae}-height`,"initial","important"),C.width=`${n*U}px`,C.height=`${s*U}px`;let Oe=()=>{ie.width=`${this.imgWidth*U}px`,ie.height=`${this.imgHeight*U}px`,ie.display="block"};G.src!==l&&(G.onload=()=>{this.imgWidth=G.naturalWidth,this.imgHeight=G.naturalHeight,Oe()},G.src=l,Oe()),Oe(),ie.transform=`translate(-${a*U}px, -${r*U}px)`}};p("media-preview-thumbnail",ba);var bn=d.createElement("template"),Ks=`
668
683
  <svg aria-hidden="true" viewBox="0 0 100 100">
669
684
  <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">
670
685
  <animateTransform
@@ -715,27 +730,27 @@ svg, img, ::slotted(svg), ::slotted(img) {
715
730
  </style>
716
731
 
717
732
  <slot name="loading">${Ks}</slot>
718
- <div id="status" role="status" aria-live="polite">${N.MEDIA_LOADING()}</div>
719
- `;var Ys=500,Ea=class extends u.HTMLElement{static get observedAttributes(){return[o.MEDIA_CONTROLLER,o.MEDIA_PAUSED,o.MEDIA_LOADING,"loading-delay"]}constructor(){super();let i=this.attachShadow({mode:"open"}),e=bn.content.cloneNode(!0);i.appendChild(e)}attributeChangedCallback(i,e,a){var r,n,s;if(i===o.MEDIA_LOADING||i===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:Ys);this.loadingDelayHandle=setTimeout(()=>{this.setAttribute("is-loading",""),this.loadingDelayHandle=void 0},E)}}else if(i===o.MEDIA_CONTROLLER){if(e){let l=d.getElementById(e);(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 i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.associateElement)==null||i.call(a,this)}}disconnectedCallback(){var i;this.loadingDelayHandle&&(clearTimeout(this.loadingDelayHandle),this.loadingDelayHandle=void 0);let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.unassociateElement)==null||i.call(a,this)}}};p("media-loading-indicator",Ea);var En=d.createElement("template");En.innerHTML=`
733
+ <div id="status" role="status" aria-live="polite">${O.MEDIA_LOADING()}</div>
734
+ `;var Ys=500,Ea=class extends u.HTMLElement{static get observedAttributes(){return[o.MEDIA_CONTROLLER,o.MEDIA_PAUSED,o.MEDIA_LOADING,"loading-delay"]}constructor(){super();let i=this.attachShadow({mode:"open"}),e=bn.content.cloneNode(!0);i.appendChild(e)}attributeChangedCallback(i,e,a){var r,n,s;if(i===o.MEDIA_LOADING||i===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 f=+((r=this.getAttribute("loading-delay"))!=null?r:Ys);this.loadingDelayHandle=setTimeout(()=>{this.setAttribute("is-loading",""),this.loadingDelayHandle=void 0},f)}}else if(i===o.MEDIA_CONTROLLER){if(e){let l=d.getElementById(e);(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 i;let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.associateElement)==null||i.call(a,this)}}disconnectedCallback(){var i;this.loadingDelayHandle&&(clearTimeout(this.loadingDelayHandle),this.loadingDelayHandle=void 0);let e=this.getAttribute(o.MEDIA_CONTROLLER);if(e){let a=d.getElementById(e);(i=a==null?void 0:a.unassociateElement)==null||i.call(a,this)}}};p("media-loading-indicator",Ea);var En=d.createElement("template");En.innerHTML=`
720
735
  <style>
721
736
  :host {
722
737
  }
723
738
  </style>
724
739
  <slot></slot>
725
- `;var fa=class extends u.HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(En.content.cloneNode(!0))}};p("media-title-bar",fa);var Gs=100,Zs=t=>{var i;if(t.getAttribute(o.MEDIA_MUTED)!=null)return 0;let a=+((i=t.getAttribute(o.MEDIA_VOLUME))!=null?i:1);return Math.round(a*t.range.max)},Qs=({value:t,max:i})=>`${Math.round(t/i*100)}%`,ga=class extends ht{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME,o.MEDIA_MUTED,o.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.max=Gs,this.range.addEventListener("input",()=>{let e=this.range.value/this.range.max,a=new u.CustomEvent(h.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(a)})}connectedCallback(){this.range.setAttribute("aria-label",N.VOLUME()),super.connectedCallback()}attributeChangedCallback(i,e,a){if(i===o.MEDIA_VOLUME||i===o.MEDIA_MUTED){let r=Zs(this);this.range.value=r,this.range.setAttribute("aria-valuetext",Qs(this.range)),this.updateBar()}super.attributeChangedCallback(i,e,a)}};p("media-volume-range",ga);var qs=Object.defineProperty,zs=(t,i,e)=>i in t?qs(t,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[i]=e,js=(t,i,e)=>(zs(t,typeof i!="symbol"?i+"":i,e),e),ft=class extends u.HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.render()}render(){this.shadowRoot.textContent="";let i=d.createElement("template");i.innerHTML=this.constructor.template,this.shadowRoot.append(i.content.cloneNode(!0))}get mediaController(){return this.shadowRoot.querySelector("media-controller")}};js(ft,"template","");p("media-theme",ft);var va=ft;var Aa=class extends mt{};u.customElements.get("media-chrome")||u.customElements.define("media-chrome",Aa);var _a=class extends mt{constructor(){super(),console.warn("MediaChrome: <media-container> is deprecated. Use <media-controller>.")}};u.customElements.get("media-container")||u.customElements.define("media-container",_a);var g=Go(require("@mux/mux-video")),S=require("@mux/playback-core");var wn=require("@mux/mux-video");var Xs="en",Me={code:Xs};var fn="en";function A(t,i=!0){var r,n;let e=i&&(n=(r=Me)==null?void 0:r[t])!=null?n:t,a=i?Me.code:fn;return new ya(e,a)}var ya=class{constructor(i,e=(a=>(a=Me.code)!=null?a:fn)()){this.message=i,this.locale=e}format(i){return this.message.replace(/\{(\w+)\}/g,(e,a)=>{var r;return(r=i[a])!=null?r:""})}toString(){return this.message}};function gn(t){let i="";return Object.entries(t).forEach(([e,a])=>{a!=null&&(i+=`${Js(e)}: ${a}; `)}),i?i.trim():void 0}function Js(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function vn(t){return t.replace(/[-_]([a-z])/g,(i,e)=>e.toUpperCase())}function se(t){if(t==null)return;let i=+t;return Number.isNaN(i)?void 0:i}function ii(t){let i=el(t).toString();return i?"?"+i:""}function el(t){let i={};for(let e in t)t[e]!=null&&(i[e]=t[e]);return new URLSearchParams(i)}function Ee(t){let i=(t!=null?t:"").split(".")[1];if(!i)return{};let e=i.replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(e).split("").map(function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}var Ta=(t,i)=>!t||!i?!1:t.contains(i)?!0:Ta(t,i.getRootNode().host);var gt=require("@mux/playback-core");var Ia="mux.com",tl=()=>{try{return"1.3.0"}catch{}return"UNKNOWN"},il=tl(),ri=()=>il,Ma=(t,{token:i,domain:e=Ia}={})=>`https://stream.${e}/${t}.m3u8${ii(!!i?{token:i}:{redundant_streams:!0})}`,yn=(t,{token:i,thumbnailTime:e,domain:a=Ia}={})=>{let r=i==null?e:void 0,{aud:n}=Ee(i);if(!(i&&n!=="t"))return`https://image.${a}/${t}/thumbnail.jpg${ii({token:i,time:r})}`},Tn=(t,{token:i,domain:e=Ia}={})=>{let{aud:a}=Ee(i);if(!(i&&a!=="s"))return`https://image.${e}/${t}/storyboard.vtt${ii({token:i})}`};function Sa(t){if(t&&/^media-theme-[\w-]+$/.test(t))return t}var al={crossorigin:"crossOrigin",playsinline:"playsInline"};function In(t){var i;return(i=al[t])!=null?i:vn(t)}var Mn=t=>{var e,a;let{media:i}=t;return(a=(e=i==null?void 0:i._hls)==null?void 0:e.liveSyncPosition)!=null?a:i!=null&&i.seekable.length?i==null?void 0:i.seekable.end(i.seekable.length-1):void 0},ka=t=>{let i=Mn(t);if(i==null){console.warn("attempting to seek to live but cannot determine live edge time!");return}t.currentTime=i},rl=1,nl=5,An=3,_n=.5,Sn=t=>{var n;let{streamType:i}=t,e=Mn(t),a=(n=t.media)==null?void 0:n.currentTime;if(e==null||a==null)return!1;let r=e-a;return i===gt.StreamTypes.LL_LIVE||i===gt.StreamTypes.LL_DVR?r<=rl*(An+_n):i===gt.StreamTypes.LIVE||i===gt.StreamTypes.DVR?r<=nl*(An+_n):!1},Se,ke,V,ai=class{constructor(i,e){T(this,Se,void 0);T(this,ke,void 0);T(this,V,[]);B(this,Se,i),B(this,ke,e)}[Symbol.iterator](){return v(this,V).values()}get length(){return v(this,V).length}get value(){var i;return(i=v(this,V).join(" "))!=null?i:""}set value(i){var e;i!==this.value&&(B(this,V,[]),this.add(...(e=i==null?void 0:i.split(" "))!=null?e:[]))}toString(){return this.value}item(i){return v(this,V)[i]}values(){return v(this,V).values()}keys(){return v(this,V).keys()}forEach(i){v(this,V).forEach(i)}add(...i){var e,a;i.forEach(r=>{this.contains(r)||v(this,V).push(r)}),!(this.value===""&&!((e=v(this,Se))!=null&&e.hasAttribute(`${v(this,ke)}`)))&&((a=v(this,Se))==null||a.setAttribute(`${v(this,ke)}`,`${this.value}`))}remove(...i){var e;i.forEach(a=>{v(this,V).splice(v(this,V).indexOf(a),1)}),(e=v(this,Se))==null||e.setAttribute(`${v(this,ke)}`,`${this.value}`)}contains(i){return v(this,V).includes(i)}toggle(i,e){return typeof e!="undefined"?e?(this.add(i),!0):(this.remove(i),!1):this.contains(i)?(this.remove(i),!1):(this.add(i),!0)}replace(i,e){this.remove(i),this.add(e)}};Se=new WeakMap,ke=new WeakMap,V=new WeakMap;var kn=`[mux-player ${ri()}]`;function Le(...t){console.warn(kn,...t)}function X(...t){console.error(kn,...t)}function ni(t){var e;let i=(e=t.message)!=null?e:"";if(t.file){let a="https://github.com/muxinc/elements/blob/main/errors/";i+=` ${A("Read more: ")}
726
- ${a}${t.file}`}Le(i)}var $={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},Ce={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},Cn=Object.freeze({length:0,start(t){let i=t>>>0;if(i>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${i}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(t){let i=t>>>0;if(i>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${i}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),ol=wn.VideoEvents.filter(t=>t!=="error"),sl=Object.values($).filter(t=>![$.PLAYSINLINE].includes(t)),ll=Object.values(Ce);function Dn(t){t.querySelectorAll(":scope > track").forEach(i=>{var e;(e=t.media)==null||e.append(i.cloneNode())}),ol.forEach(i=>{var e;(e=t.media)==null||e.addEventListener(i,a=>{t.dispatchEvent(new Event(a.type))})})}var La=class extends M.HTMLElement{static get observedAttributes(){return[...sl,...ll]}constructor(){super(),this.querySelectorAll(":scope > track").forEach(a=>{var r;(r=this.media)==null||r.append(a.cloneNode())});let i=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(i).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(i,e,a){var r,n;switch(i){case Ce.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case Ce.VOLUME:{let s=(r=se(a))!=null?r:1;this.media&&(this.media.volume=s);return}case Ce.PLAYBACKRATE:{let s=(n=se(a))!=null?n:1;this.media&&(this.media.playbackRate=s,this.media.defaultPlaybackRate=s);return}}}play(){var i,e;return(e=(i=this.media)==null?void 0:i.play())!=null?e:Promise.reject()}pause(){var i;(i=this.media)==null||i.pause()}requestCast(i){var e;return(e=this.media)==null?void 0:e.requestCast(i)}get media(){var i;return(i=this.shadowRoot)==null?void 0:i.querySelector("mux-video")}get paused(){var i,e;return(e=(i=this.media)==null?void 0:i.paused)!=null?e:!0}get duration(){var i,e;return(e=(i=this.media)==null?void 0:i.duration)!=null?e:NaN}get ended(){var i,e;return(e=(i=this.media)==null?void 0:i.ended)!=null?e:!1}get buffered(){var i,e;return(e=(i=this.media)==null?void 0:i.buffered)!=null?e:Cn}get seekable(){var i,e;return(e=(i=this.media)==null?void 0:i.seekable)!=null?e:Cn}get readyState(){var i,e;return(e=(i=this.media)==null?void 0:i.readyState)!=null?e:0}get videoWidth(){var i,e;return(e=(i=this.media)==null?void 0:i.videoWidth)!=null?e:0}get videoHeight(){var i,e;return(e=(i=this.media)==null?void 0:i.videoHeight)!=null?e:0}get currentTime(){var i,e;return(e=(i=this.media)==null?void 0:i.currentTime)!=null?e:0}set currentTime(i){this.media&&(this.media.currentTime=Number(i))}get volume(){var i,e;return(e=(i=this.media)==null?void 0:i.volume)!=null?e:1}set volume(i){this.media&&(this.media.volume=Number(i))}get playbackRate(){var i,e;return(e=(i=this.media)==null?void 0:i.playbackRate)!=null?e:1}set playbackRate(i){this.media&&(this.media.playbackRate=Number(i))}get defaultPlaybackRate(){var i;return(i=se(this.getAttribute(Ce.PLAYBACKRATE)))!=null?i:1}set defaultPlaybackRate(i){i!=null?this.setAttribute(Ce.PLAYBACKRATE,`${i}`):this.removeAttribute(Ce.PLAYBACKRATE)}get crossOrigin(){return vt(this,$.CROSSORIGIN)}set crossOrigin(i){this.setAttribute($.CROSSORIGIN,`${i}`)}get autoplay(){return vt(this,$.AUTOPLAY)!=null}set autoplay(i){i?this.setAttribute($.AUTOPLAY,typeof i=="string"?i:""):this.removeAttribute($.AUTOPLAY)}get loop(){return vt(this,$.LOOP)!=null}set loop(i){i?this.setAttribute($.LOOP,""):this.removeAttribute($.LOOP)}get muted(){var i,e;return(e=(i=this.media)==null?void 0:i.muted)!=null?e:!1}set muted(i){this.media&&(this.media.muted=Boolean(i))}get defaultMuted(){return vt(this,$.MUTED)!=null}set defaultMuted(i){i?this.setAttribute($.MUTED,""):this.removeAttribute($.MUTED)}get playsInline(){return vt(this,$.PLAYSINLINE)!=null}set playsInline(i){X("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(i){["","none","metadata","auto"].includes(i)?this.setAttribute($.PRELOAD,i):this.removeAttribute($.PRELOAD)}};function vt(t,i){return t.media?t.media.getAttribute(i):t.getAttribute(i)}var Ca=La;var oi=new Map;function si(t){if(oi.has(t))return oi.get(t);let i=t.length,e=0,a=0,r=0,n=[];for(let s=0;s<i;s+=1){let l=t[s],c=t[s+1],m=t[s-1];l==="{"&&c==="{"&&m!=="\\"?(r+=1,r===1&&(a=s),s+=1):l==="}"&&c==="}"&&m!=="\\"&&r&&(r-=1,r===0&&(a>e&&(n.push(Object.freeze({type:"string",start:e,end:a,value:t.slice(e,a)})),e=a),n.push(Object.freeze({type:"part",start:a,end:s+2,value:t.slice(e+2,s).trim()})),s+=1,e=s+1))}return e<i&&n.push(Object.freeze({type:"string",start:e,end:i,value:t.slice(e,i)})),oi.set(t,Object.freeze(n)),oi.get(t)}var we=new WeakMap,xn=new WeakMap,q=class{constructor(i,e){this.expression=e,we.set(this,i),i.updateParent("")}get attributeName(){return we.get(this).attr.name}get attributeNamespace(){return we.get(this).attr.namespaceURI}get value(){return xn.get(this)}set value(i){xn.set(this,i||""),we.get(this).updateParent(i)}get element(){return we.get(this).element}get booleanValue(){return we.get(this).booleanValue}set booleanValue(i){we.get(this).booleanValue=i}},At=class{constructor(i,e){this.element=i,this.attr=e,this.partList=[]}get booleanValue(){return this.element.hasAttributeNS(this.attr.namespaceURI,this.attr.name)}set booleanValue(i){if(this.partList.length!==1)throw new DOMException("Operation not supported","NotSupportedError");this.partList[0].value=i?"":null}append(i){this.partList.push(i)}updateParent(i){if(this.partList.length===1&&i===null)this.element.removeAttributeNS(this.attr.namespaceURI,this.attr.name);else{let e=this.partList.map(a=>typeof a=="string"?a:a.value).join("");this.element.setAttributeNS(this.attr.namespaceURI,this.attr.name,e)}}};var fe=new WeakMap,J=class{constructor(i,e){this.expression=e,fe.set(this,[i]),i.textContent=""}get value(){return fe.get(this).map(i=>i.textContent).join("")}set value(i){this.replace(i)}get previousSibling(){return fe.get(this)[0].previousSibling}get nextSibling(){return fe.get(this)[fe.get(this).length-1].nextSibling}replace(...i){let e=i.map(a=>typeof a=="string"?new Text(a):a);e.length||e.push(new Text("")),fe.get(this)[0].before(...e);for(let a of fe.get(this))a.remove();fe.set(this,e)}};function _t(t){return{processCallback(i,e,a){var r;if(!(typeof a!="object"||!a)){for(let n of e)if(n.expression in a){let s=(r=a[n.expression])!==null&&r!==void 0?r:"";t(n,s)}}}}}function wa(t,i){t.value=String(i)}function Rn(t,i){return typeof i=="boolean"&&t instanceof q&&typeof t.element[t.attributeName]=="boolean"?(t.booleanValue=i,!0):!1}var Da=_t(wa),dl=_t((t,i)=>{Rn(t,i)||wa(t,i)});function*cl(t){let i=t.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null,!1),e;for(;e=i.nextNode();)if(e instanceof Element&&e.hasAttributes())for(let a=0;a<e.attributes.length;a+=1){let r=e.attributes.item(a);if(r&&r.value.includes("{{")){let n=new At(e,r);for(let s of si(r.value))if(s.type==="string")n.append(s.value);else{let l=new q(n,s.value);n.append(l),yield l}}}else if(e instanceof Text&&e.textContent&&e.textContent.includes("{{")){let a=si(e.textContent);for(let r=0;r<a.length;r+=1){let n=a[r];n.end<e.textContent.length&&e.splitText(n.end),n.type==="part"&&(yield new J(e,n.value));break}}}var li=new WeakMap,di=new WeakMap,le=class extends DocumentFragment{constructor(i,e,a=Da){var r,n;super(),Object.getPrototypeOf(this)!==le.prototype&&Object.setPrototypeOf(this,le.prototype),this.appendChild(i.content.cloneNode(!0)),di.set(this,Array.from(cl(this))),li.set(this,a),(n=(r=li.get(this)).createCallback)===null||n===void 0||n.call(r,this,di.get(this),e),li.get(this).processCallback(this,di.get(this),e)}update(i){li.get(this).processCallback(this,di.get(this),i)}};var yt=new WeakMap,Tt=class{constructor(i,e){this.element=i;this.type=e;this.element.addEventListener(this.type,this);let a=yt.get(this.element);a&&a.set(this.type,this)}set(i){if(typeof i=="function")this.handleEvent=i.bind(this.element);else if(typeof i=="object"&&typeof i.handleEvent=="function")this.handleEvent=i.handleEvent.bind(i);else{this.element.removeEventListener(this.type,this);let e=yt.get(this.element);e&&e.delete(this.type)}}static for(i){yt.has(i.element)||yt.set(i.element,new Map);let e=i.attributeName.slice(2),a=yt.get(i.element);return a&&a.has(e)?a.get(e):new Tt(i.element,e)}};function ul(t,i){return t instanceof q&&t.attributeName.startsWith("on")?(Tt.for(t).set(i),t.element.removeAttributeNS(t.attributeNamespace,t.attributeName),!0):!1}function ml(t,i){return i instanceof It&&t instanceof J?(i.renderInto(t),!0):!1}function hl(t,i){return i instanceof DocumentFragment&&t instanceof J?(i.childNodes.length&&t.replace(...i.childNodes),!0):!1}function pl(t,i){if(t instanceof q){let e=t.attributeNamespace,a=t.element.getAttributeNS(e,t.attributeName);return String(i)!==a&&(t.value=String(i)),!0}return t.value=String(i),!0}function bl(t,i){if(typeof i=="boolean"&&t instanceof q){let e=t.attributeNamespace,a=t.element.hasAttributeNS(e,t.attributeName);return i!==a&&(t.booleanValue=i),!0}return!1}function El(t,i){return i===!1&&t instanceof J?(t.replace(""),!0):!1}function fl(t,i){bl(t,i)||ul(t,i)||El(t,i)||ml(t,i)||hl(t,i)||pl(t,i)}var xa=new WeakMap,Pn=new WeakMap,Un=new WeakMap,It=class{constructor(i,e,a){this.strings=i;this.values=e;this.processor=a}get template(){if(xa.has(this.strings))return xa.get(this.strings);{let i=document.createElement("template"),e=this.strings.length-1;return i.innerHTML=this.strings.reduce((a,r,n)=>a+r+(n<e?`{{ ${n} }}`:""),""),xa.set(this.strings,i),i}}renderInto(i){let e=this.template;if(Pn.get(i)!==e){Pn.set(i,e);let r=new le(e,this.values,this.processor);Un.set(i,r),i instanceof J?i.replace(...r.children):i.appendChild(r);return}let a=Un.get(i);a&&a.update(this.values)}},On=new Map,gl=_t(fl);function f(t,...i){let e=[""],a=[],r,n=!1,s=(l,c=[])=>{e[e.length-1]=e[e.length-1]+l[0],c.forEach((m,E)=>{(r=m==null?void 0:m.$static$)!==void 0?(r.forEach(y=>{s(y.strings,y.values)}),e[e.length-1]=e[e.length-1]+l[E+1],n=!0):(a.push(m),e.push(l[E+1]))})};if(s(t,i),n){let l=e.join("$$html$$");t=On.get(l),t===void 0&&(e.raw=e,On.set(l,t=e)),i=a}return new It(t,i,gl)}function ci(t,i){t.renderInto(i)}function R(t,i){let e=document.createElement("template");return e.innerHTML=t,new le(e,i)}var Ra=(...t)=>({$static$:t.map(i=>i instanceof It?i:/\w-/.test(i)?{strings:[i]}:{strings:[]})});var $n=`
740
+ `;var fa=class extends u.HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(En.content.cloneNode(!0))}};p("media-title-bar",fa);var Gs=100,Zs=t=>{var i;if(t.getAttribute(o.MEDIA_MUTED)!=null)return 0;let a=+((i=t.getAttribute(o.MEDIA_VOLUME))!=null?i:1);return Math.round(a*t.range.max)},Qs=({value:t,max:i})=>`${Math.round(t/i*100)}%`,ga=class extends ht{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME,o.MEDIA_MUTED,o.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.max=Gs,this.range.addEventListener("input",()=>{let e=this.range.value/this.range.max,a=new u.CustomEvent(h.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(a)})}connectedCallback(){this.range.setAttribute("aria-label",O.VOLUME()),super.connectedCallback()}attributeChangedCallback(i,e,a){if(i===o.MEDIA_VOLUME||i===o.MEDIA_MUTED){let r=Zs(this);this.range.value=r,this.range.setAttribute("aria-valuetext",Qs(this.range)),this.updateBar()}super.attributeChangedCallback(i,e,a)}};p("media-volume-range",ga);var qs=Object.defineProperty,zs=(t,i,e)=>i in t?qs(t,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[i]=e,js=(t,i,e)=>(zs(t,typeof i!="symbol"?i+"":i,e),e),ft=class extends u.HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.render()}render(){this.shadowRoot.textContent="";let i=d.createElement("template");i.innerHTML=this.constructor.template,this.shadowRoot.append(i.content.cloneNode(!0))}get mediaController(){return this.shadowRoot.querySelector("media-controller")}};js(ft,"template","");p("media-theme",ft);var va=ft;var Aa=class extends mt{};u.customElements.get("media-chrome")||u.customElements.define("media-chrome",Aa);var _a=class extends mt{constructor(){super(),console.warn("MediaChrome: <media-container> is deprecated. Use <media-controller>.")}};u.customElements.get("media-container")||u.customElements.define("media-container",_a);var g=Go(require("@mux/mux-video")),M=require("@mux/playback-core");var wn=require("@mux/mux-video");var Xs="en",Ce={code:Xs};var fn="en";function A(t,i=!0){var r,n;let e=i&&(n=(r=Ce)==null?void 0:r[t])!=null?n:t,a=i?Ce.code:fn;return new ya(e,a)}var ya=class{constructor(i,e=(a=>(a=Ce.code)!=null?a:fn)()){this.message=i,this.locale=e}format(i){return this.message.replace(/\{(\w+)\}/g,(e,a)=>{var r;return(r=i[a])!=null?r:""})}toString(){return this.message}};function gn(t){let i="";return Object.entries(t).forEach(([e,a])=>{a!=null&&(i+=`${Js(e)}: ${a}; `)}),i?i.trim():void 0}function Js(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function vn(t){return t.replace(/[-_]([a-z])/g,(i,e)=>e.toUpperCase())}function ne(t){if(t==null)return;let i=+t;return Number.isNaN(i)?void 0:i}function ti(t){let i=el(t).toString();return i?"?"+i:""}function el(t){let i={};for(let e in t)t[e]!=null&&(i[e]=t[e]);return new URLSearchParams(i)}function ge(t){let i=(t!=null?t:"").split(".")[1];if(!i)return{};let e=i.replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(e).split("").map(function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}var Ta=(t,i)=>!t||!i?!1:t.contains(i)?!0:Ta(t,i.getRootNode().host);var gt=require("@mux/playback-core");var Ia="mux.com",tl=()=>{try{return"1.4.0"}catch{}return"UNKNOWN"},il=tl(),ai=()=>il,Ma=(t,{token:i,domain:e=Ia}={})=>`https://stream.${e}/${t}.m3u8${ti(!!i?{token:i}:{redundant_streams:!0})}`,yn=(t,{token:i,thumbnailTime:e,domain:a=Ia}={})=>{let r=i==null?e:void 0,{aud:n}=ge(i);if(!(i&&n!=="t"))return`https://image.${a}/${t}/thumbnail.jpg${ti({token:i,time:r})}`},Tn=(t,{token:i,domain:e=Ia}={})=>{let{aud:a}=ge(i);if(!(i&&a!=="s"))return`https://image.${e}/${t}/storyboard.vtt${ti({token:i})}`};function ka(t){if(t&&/^media-theme-[\w-]+$/.test(t))return t}var al={crossorigin:"crossOrigin",playsinline:"playsInline"};function In(t){var i;return(i=al[t])!=null?i:vn(t)}var Mn=t=>{var e,a;let{media:i}=t;return(a=(e=i==null?void 0:i._hls)==null?void 0:e.liveSyncPosition)!=null?a:i!=null&&i.seekable.length?i==null?void 0:i.seekable.end(i.seekable.length-1):void 0},Sa=t=>{let i=Mn(t);if(i==null){console.warn("attempting to seek to live but cannot determine live edge time!");return}t.currentTime=i},rl=1,nl=5,An=3,_n=.5,kn=t=>{var n;let{streamType:i}=t,e=Mn(t),a=(n=t.media)==null?void 0:n.currentTime;if(e==null||a==null)return!1;let r=e-a;return i===gt.StreamTypes.LL_LIVE||i===gt.StreamTypes.LL_DVR?r<=rl*(An+_n):i===gt.StreamTypes.LIVE||i===gt.StreamTypes.DVR?r<=nl*(An+_n):!1},we,xe,B,ii=class{constructor(i,e){T(this,we,void 0);T(this,xe,void 0);T(this,B,[]);$(this,we,i),$(this,xe,e)}[Symbol.iterator](){return v(this,B).values()}get length(){return v(this,B).length}get value(){var i;return(i=v(this,B).join(" "))!=null?i:""}set value(i){var e;i!==this.value&&($(this,B,[]),this.add(...(e=i==null?void 0:i.split(" "))!=null?e:[]))}toString(){return this.value}item(i){return v(this,B)[i]}values(){return v(this,B).values()}keys(){return v(this,B).keys()}forEach(i){v(this,B).forEach(i)}add(...i){var e,a;i.forEach(r=>{this.contains(r)||v(this,B).push(r)}),!(this.value===""&&!((e=v(this,we))!=null&&e.hasAttribute(`${v(this,xe)}`)))&&((a=v(this,we))==null||a.setAttribute(`${v(this,xe)}`,`${this.value}`))}remove(...i){var e;i.forEach(a=>{v(this,B).splice(v(this,B).indexOf(a),1)}),(e=v(this,we))==null||e.setAttribute(`${v(this,xe)}`,`${this.value}`)}contains(i){return v(this,B).includes(i)}toggle(i,e){return typeof e!="undefined"?e?(this.add(i),!0):(this.remove(i),!1):this.contains(i)?(this.remove(i),!1):(this.add(i),!0)}replace(i,e){this.remove(i),this.add(e)}};we=new WeakMap,xe=new WeakMap,B=new WeakMap;var Sn=`[mux-player ${ai()}]`;function ve(...t){console.warn(Sn,...t)}function J(...t){console.error(Sn,...t)}function ri(t){var e;let i=(e=t.message)!=null?e:"";if(t.file){let a="https://github.com/muxinc/elements/blob/main/errors/";i+=` ${A("Read more: ")}
741
+ ${a}${t.file}`}ve(i)}var N={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},De={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},Cn=Object.freeze({length:0,start(t){let i=t>>>0;if(i>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${i}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(t){let i=t>>>0;if(i>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${i}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),ol=wn.VideoEvents.filter(t=>t!=="error"),sl=Object.values(N).filter(t=>![N.PLAYSINLINE].includes(t)),ll=Object.values(De);function xn(t){t.querySelectorAll(":scope > track").forEach(i=>{var e;(e=t.media)==null||e.append(i.cloneNode())}),ol.forEach(i=>{var e;(e=t.media)==null||e.addEventListener(i,a=>{t.dispatchEvent(new Event(a.type))})})}var La=class extends k.HTMLElement{static get observedAttributes(){return[...sl,...ll]}constructor(){super(),this.querySelectorAll(":scope > track").forEach(a=>{var r;(r=this.media)==null||r.append(a.cloneNode())});let i=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(i).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(i,e,a){var r,n;switch(i){case De.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case De.VOLUME:{let s=(r=ne(a))!=null?r:1;this.media&&(this.media.volume=s);return}case De.PLAYBACKRATE:{let s=(n=ne(a))!=null?n:1;this.media&&(this.media.playbackRate=s,this.media.defaultPlaybackRate=s);return}}}play(){var i,e;return(e=(i=this.media)==null?void 0:i.play())!=null?e:Promise.reject()}pause(){var i;(i=this.media)==null||i.pause()}requestCast(i){var e;return(e=this.media)==null?void 0:e.requestCast(i)}get media(){var i;return(i=this.shadowRoot)==null?void 0:i.querySelector("mux-video")}get paused(){var i,e;return(e=(i=this.media)==null?void 0:i.paused)!=null?e:!0}get duration(){var i,e;return(e=(i=this.media)==null?void 0:i.duration)!=null?e:NaN}get ended(){var i,e;return(e=(i=this.media)==null?void 0:i.ended)!=null?e:!1}get buffered(){var i,e;return(e=(i=this.media)==null?void 0:i.buffered)!=null?e:Cn}get seekable(){var i,e;return(e=(i=this.media)==null?void 0:i.seekable)!=null?e:Cn}get readyState(){var i,e;return(e=(i=this.media)==null?void 0:i.readyState)!=null?e:0}get videoWidth(){var i,e;return(e=(i=this.media)==null?void 0:i.videoWidth)!=null?e:0}get videoHeight(){var i,e;return(e=(i=this.media)==null?void 0:i.videoHeight)!=null?e:0}get currentTime(){var i,e;return(e=(i=this.media)==null?void 0:i.currentTime)!=null?e:0}set currentTime(i){this.media&&(this.media.currentTime=Number(i))}get volume(){var i,e;return(e=(i=this.media)==null?void 0:i.volume)!=null?e:1}set volume(i){this.media&&(this.media.volume=Number(i))}get playbackRate(){var i,e;return(e=(i=this.media)==null?void 0:i.playbackRate)!=null?e:1}set playbackRate(i){this.media&&(this.media.playbackRate=Number(i))}get defaultPlaybackRate(){var i;return(i=ne(this.getAttribute(De.PLAYBACKRATE)))!=null?i:1}set defaultPlaybackRate(i){i!=null?this.setAttribute(De.PLAYBACKRATE,`${i}`):this.removeAttribute(De.PLAYBACKRATE)}get crossOrigin(){return vt(this,N.CROSSORIGIN)}set crossOrigin(i){this.setAttribute(N.CROSSORIGIN,`${i}`)}get autoplay(){return vt(this,N.AUTOPLAY)!=null}set autoplay(i){i?this.setAttribute(N.AUTOPLAY,typeof i=="string"?i:""):this.removeAttribute(N.AUTOPLAY)}get loop(){return vt(this,N.LOOP)!=null}set loop(i){i?this.setAttribute(N.LOOP,""):this.removeAttribute(N.LOOP)}get muted(){var i,e;return(e=(i=this.media)==null?void 0:i.muted)!=null?e:!1}set muted(i){this.media&&(this.media.muted=Boolean(i))}get defaultMuted(){return vt(this,N.MUTED)!=null}set defaultMuted(i){i?this.setAttribute(N.MUTED,""):this.removeAttribute(N.MUTED)}get playsInline(){return vt(this,N.PLAYSINLINE)!=null}set playsInline(i){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(i){["","none","metadata","auto"].includes(i)?this.setAttribute(N.PRELOAD,i):this.removeAttribute(N.PRELOAD)}};function vt(t,i){return t.media?t.media.getAttribute(i):t.getAttribute(i)}var Ca=La;var ni=new Map;function oi(t){if(ni.has(t))return ni.get(t);let i=t.length,e=0,a=0,r=0,n=[];for(let s=0;s<i;s+=1){let l=t[s],c=t[s+1],m=t[s-1];l==="{"&&c==="{"&&m!=="\\"?(r+=1,r===1&&(a=s),s+=1):l==="}"&&c==="}"&&m!=="\\"&&r&&(r-=1,r===0&&(a>e&&(n.push(Object.freeze({type:"string",start:e,end:a,value:t.slice(e,a)})),e=a),n.push(Object.freeze({type:"part",start:a,end:s+2,value:t.slice(e+2,s).trim()})),s+=1,e=s+1))}return e<i&&n.push(Object.freeze({type:"string",start:e,end:i,value:t.slice(e,i)})),ni.set(t,Object.freeze(n)),ni.get(t)}var Re=new WeakMap,Dn=new WeakMap,z=class{constructor(i,e){this.expression=e,Re.set(this,i),i.updateParent("")}get attributeName(){return Re.get(this).attr.name}get attributeNamespace(){return Re.get(this).attr.namespaceURI}get value(){return Dn.get(this)}set value(i){Dn.set(this,i||""),Re.get(this).updateParent(i)}get element(){return Re.get(this).element}get booleanValue(){return Re.get(this).booleanValue}set booleanValue(i){Re.get(this).booleanValue=i}},At=class{constructor(i,e){this.element=i,this.attr=e,this.partList=[]}get booleanValue(){return this.element.hasAttributeNS(this.attr.namespaceURI,this.attr.name)}set booleanValue(i){if(this.partList.length!==1)throw new DOMException("Operation not supported","NotSupportedError");this.partList[0].value=i?"":null}append(i){this.partList.push(i)}updateParent(i){if(this.partList.length===1&&i===null)this.element.removeAttributeNS(this.attr.namespaceURI,this.attr.name);else{let e=this.partList.map(a=>typeof a=="string"?a:a.value).join("");this.element.setAttributeNS(this.attr.namespaceURI,this.attr.name,e)}}};var Ae=new WeakMap,ee=class{constructor(i,e){this.expression=e,Ae.set(this,[i]),i.textContent=""}get value(){return Ae.get(this).map(i=>i.textContent).join("")}set value(i){this.replace(i)}get previousSibling(){return Ae.get(this)[0].previousSibling}get nextSibling(){return Ae.get(this)[Ae.get(this).length-1].nextSibling}replace(...i){let e=i.map(a=>typeof a=="string"?new Text(a):a);e.length||e.push(new Text("")),Ae.get(this)[0].before(...e);for(let a of Ae.get(this))a.remove();Ae.set(this,e)}};function _t(t){return{processCallback(i,e,a){var r;if(!(typeof a!="object"||!a)){for(let n of e)if(n.expression in a){let s=(r=a[n.expression])!==null&&r!==void 0?r:"";t(n,s)}}}}}function wa(t,i){t.value=String(i)}function Rn(t,i){return typeof i=="boolean"&&t instanceof z&&typeof t.element[t.attributeName]=="boolean"?(t.booleanValue=i,!0):!1}var xa=_t(wa),dl=_t((t,i)=>{Rn(t,i)||wa(t,i)});function*cl(t){let i=t.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null,!1),e;for(;e=i.nextNode();)if(e instanceof Element&&e.hasAttributes())for(let a=0;a<e.attributes.length;a+=1){let r=e.attributes.item(a);if(r&&r.value.includes("{{")){let n=new At(e,r);for(let s of oi(r.value))if(s.type==="string")n.append(s.value);else{let l=new z(n,s.value);n.append(l),yield l}}}else if(e instanceof Text&&e.textContent&&e.textContent.includes("{{")){let a=oi(e.textContent);for(let r=0;r<a.length;r+=1){let n=a[r];n.end<e.textContent.length&&e.splitText(n.end),n.type==="part"&&(yield new ee(e,n.value));break}}}var si=new WeakMap,li=new WeakMap,oe=class extends DocumentFragment{constructor(i,e,a=xa){var r,n;super(),Object.getPrototypeOf(this)!==oe.prototype&&Object.setPrototypeOf(this,oe.prototype),this.appendChild(i.content.cloneNode(!0)),li.set(this,Array.from(cl(this))),si.set(this,a),(n=(r=si.get(this)).createCallback)===null||n===void 0||n.call(r,this,li.get(this),e),si.get(this).processCallback(this,li.get(this),e)}update(i){si.get(this).processCallback(this,li.get(this),i)}};var yt=new WeakMap,Tt=class{constructor(i,e){this.element=i;this.type=e;this.element.addEventListener(this.type,this);let a=yt.get(this.element);a&&a.set(this.type,this)}set(i){if(typeof i=="function")this.handleEvent=i.bind(this.element);else if(typeof i=="object"&&typeof i.handleEvent=="function")this.handleEvent=i.handleEvent.bind(i);else{this.element.removeEventListener(this.type,this);let e=yt.get(this.element);e&&e.delete(this.type)}}static for(i){yt.has(i.element)||yt.set(i.element,new Map);let e=i.attributeName.slice(2),a=yt.get(i.element);return a&&a.has(e)?a.get(e):new Tt(i.element,e)}};function ul(t,i){return t instanceof z&&t.attributeName.startsWith("on")?(Tt.for(t).set(i),t.element.removeAttributeNS(t.attributeNamespace,t.attributeName),!0):!1}function ml(t,i){return i instanceof It&&t instanceof ee?(i.renderInto(t),!0):!1}function hl(t,i){return i instanceof DocumentFragment&&t instanceof ee?(i.childNodes.length&&t.replace(...i.childNodes),!0):!1}function pl(t,i){if(t instanceof z){let e=t.attributeNamespace,a=t.element.getAttributeNS(e,t.attributeName);return String(i)!==a&&(t.value=String(i)),!0}return t.value=String(i),!0}function bl(t,i){if(typeof i=="boolean"&&t instanceof z){let e=t.attributeNamespace,a=t.element.hasAttributeNS(e,t.attributeName);return i!==a&&(t.booleanValue=i),!0}return!1}function El(t,i){return i===!1&&t instanceof ee?(t.replace(""),!0):!1}function fl(t,i){bl(t,i)||ul(t,i)||El(t,i)||ml(t,i)||hl(t,i)||pl(t,i)}var Da=new WeakMap,Pn=new WeakMap,Un=new WeakMap,It=class{constructor(i,e,a){this.strings=i;this.values=e;this.processor=a}get template(){if(Da.has(this.strings))return Da.get(this.strings);{let i=document.createElement("template"),e=this.strings.length-1;return i.innerHTML=this.strings.reduce((a,r,n)=>a+r+(n<e?`{{ ${n} }}`:""),""),Da.set(this.strings,i),i}}renderInto(i){let e=this.template;if(Pn.get(i)!==e){Pn.set(i,e);let r=new oe(e,this.values,this.processor);Un.set(i,r),i instanceof ee?i.replace(...r.children):i.appendChild(r);return}let a=Un.get(i);a&&a.update(this.values)}},On=new Map,gl=_t(fl);function b(t,...i){let e=[""],a=[],r,n=!1,s=(l,c=[])=>{e[e.length-1]=e[e.length-1]+l[0],c.forEach((m,f)=>{(r=m==null?void 0:m.$static$)!==void 0?(r.forEach(_=>{s(_.strings,_.values)}),e[e.length-1]=e[e.length-1]+l[f+1],n=!0):(a.push(m),e.push(l[f+1]))})};if(s(t,i),n){let l=e.join("$$html$$");t=On.get(l),t===void 0&&(e.raw=e,On.set(l,t=e)),i=a}return new It(t,i,gl)}function di(t,i){t.renderInto(i)}function D(t,i){let e=document.createElement("template");return e.innerHTML=t,new oe(e,i)}var Ra=(...t)=>({$static$:t.map(i=>i instanceof It?i:/\w-/.test(i)?{strings:[i]}:{strings:[]})});var $n=`
727
742
  :host {
728
743
  cursor: pointer;
729
744
  }
730
745
  media-time-display {
731
746
  color: inherit;
732
747
  }
733
- `,Bn=G.createElement("template");Bn.innerHTML=`
748
+ `,Bn=Z.createElement("template");Bn.innerHTML=`
734
749
  <style>
735
750
  ${$n}
736
751
  </style>
737
752
  <media-time-display show-duration></media-time-display>
738
- `;var Nn=["Enter"," "],Mt,Qe,ui,Ze=class extends M.HTMLElement{constructor(){var e,a;super();T(this,Qe);T(this,Mt,void 0);this.attachShadow({mode:"open"}),(e=this.shadowRoot)==null||e.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 e,a,r;(e=this.timeDisplayEl)!=null&&e.hasAttribute("remaining")?(a=this.timeDisplayEl)==null||a.removeAttribute("remaining"):(r=this.timeDisplayEl)==null||r.setAttribute("remaining","")}connectedCallback(){let e=a=>{let{key:r}=a;if(!Nn.includes(r)){this.removeEventListener("keyup",e);return}this.toggleTimeDisplay()};this.addEventListener("keydown",a=>{let{metaKey:r,altKey:n,key:s}=a;if(r||n||!Nn.includes(s)){this.removeEventListener("keyup",e);return}this.addEventListener("keyup",e)}),this.addEventListener("click",this.toggleTimeDisplay),B(this,Mt,setInterval(I(this,Qe,ui).bind(this),200)),requestAnimationFrame(()=>I(this,Qe,ui).call(this))}disconnectedCallback(){clearInterval(v(this,Mt))}attributeChangedCallback(e,a,r){var n,s;e==="hide-duration"&&I(this,Qe,ui).call(this),["remaining","disabled","aria-disabled"].includes(e)&&a!==r&&(r==null?(n=this.timeDisplayEl)==null||n.removeAttribute(e):(s=this.timeDisplayEl)==null||s.setAttribute(e,r))}};Mt=new WeakMap,Qe=new WeakSet,ui=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=$n,Ze.template=Bn;M.customElements.get("mxp-time-display")||(M.customElements.define("mxp-time-display",Ze),M.MxpTimeDisplay=Ze);var Vn=`:host(:not([audio])) {
753
+ `;var Nn=["Enter"," "],Mt,Qe,ci,Ze=class extends k.HTMLElement{constructor(){var e,a;super();T(this,Qe);T(this,Mt,void 0);this.attachShadow({mode:"open"}),(e=this.shadowRoot)==null||e.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 e,a,r;(e=this.timeDisplayEl)!=null&&e.hasAttribute("remaining")?(a=this.timeDisplayEl)==null||a.removeAttribute("remaining"):(r=this.timeDisplayEl)==null||r.setAttribute("remaining","")}connectedCallback(){let e=a=>{let{key:r}=a;if(!Nn.includes(r)){this.removeEventListener("keyup",e);return}this.toggleTimeDisplay()};this.addEventListener("keydown",a=>{let{metaKey:r,altKey:n,key:s}=a;if(r||n||!Nn.includes(s)){this.removeEventListener("keyup",e);return}this.addEventListener("keyup",e)}),this.addEventListener("click",this.toggleTimeDisplay),$(this,Mt,setInterval(I(this,Qe,ci).bind(this),200)),requestAnimationFrame(()=>I(this,Qe,ci).call(this))}disconnectedCallback(){clearInterval(v(this,Mt))}attributeChangedCallback(e,a,r){var n,s;e==="hide-duration"&&I(this,Qe,ci).call(this),["remaining","disabled","aria-disabled"].includes(e)&&a!==r&&(r==null?(n=this.timeDisplayEl)==null||n.removeAttribute(e):(s=this.timeDisplayEl)==null||s.setAttribute(e,r))}};Mt=new WeakMap,Qe=new WeakSet,ci=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=$n,Ze.template=Bn;k.customElements.get("mxp-time-display")||(k.customElements.define("mxp-time-display",Ze),k.MxpTimeDisplay=Ze);var Vn=`:host(:not([audio])) {
739
754
  --secondary-color: transparent;
740
755
  }
741
756
 
@@ -835,57 +850,87 @@ media-controller {
835
850
 
836
851
  :host media-time-range {
837
852
  color: var(--_primary-color);
853
+ --media-range-thumb-opacity: 0;
838
854
  }
839
855
 
840
856
  :host(:not([audio])) media-time-range {
841
857
  --media-range-padding-left: var(--mux-time-range-padding, 10px);
842
858
  --media-range-padding-right: var(--mux-time-range-padding, 10px);
843
- width: 100%;
859
+ --media-range-padding: 0;
844
860
  z-index: 10;
845
861
  height: 10px;
846
- bottom: -2px;
862
+ bottom: -3px;
847
863
  background: linear-gradient(
848
864
  180deg,
849
865
  transparent,
850
866
  transparent 3px,
851
- var(--media-control-background) 3px,
852
- var(--media-control-background) 8px,
853
- transparent 8px,
867
+ var(--media-control-background, rgba(20, 20, 30, 0.7)) 3px,
868
+ var(--media-control-background, rgba(20, 20, 30, 0.7)) 7px,
869
+ transparent 7px,
854
870
  transparent
855
871
  );
872
+ width: 100%;
873
+ }
874
+
875
+ media-control-bar {
876
+ --media-control-padding: 9px 7px;
877
+ }
878
+
879
+ .size-small media-control-bar {
880
+ --media-control-padding: 9px 5px;
881
+ }
882
+
883
+ .size-extra-small media-control-bar {
884
+ --media-control-padding: 4px 3px;
856
885
  }
857
886
 
858
887
  media-control-bar :is([role='button'], [role='switch'], button) {
859
888
  line-height: 0;
860
- --media-control-padding: 10px 7px;
861
889
  }
862
890
 
863
- .size-extra-small media-control-bar [role='button'],
864
- .size-extra-small media-control-bar [role='switch'] {
865
- height: auto;
866
- padding: 4.4% 3.2%;
891
+ media-control-bar :is(media-text-display, mxp-time-display):first-child {
892
+ --media-control-padding: 9px 5px 9px 10px;
867
893
  }
868
894
 
869
895
  .spacer {
870
896
  flex-grow: 1;
871
- height: 100%;
872
897
  background-color: var(--media-control-background, rgba(20, 20, 30, 0.7));
873
898
  }
874
899
 
875
900
  /* Add a small space on the right to have the play button and
876
901
  * fullscreen button aligned in relation to the progress bar. */
877
- .size-large .padding-2 {
902
+ media-control-bar:not([slot])::after {
903
+ content: '';
878
904
  width: 2px;
879
905
  height: 100%;
880
906
  background-color: var(--media-control-background, rgba(20, 20, 30, 0.7));
881
907
  }
882
908
 
909
+ media-control-bar[slot='top-chrome'] {
910
+ min-height: 42px;
911
+ pointer-events: none;
912
+ }
913
+
914
+ :host([title]) media-control-bar[slot='top-chrome']::before {
915
+ content: '';
916
+ position: absolute;
917
+ width: 100%;
918
+ padding-bottom: min(160px, 25%);
919
+ background: linear-gradient(rgb(0 0 0 / 0.4), transparent);
920
+ }
921
+
922
+ media-control-bar[slot='top-chrome'] > * {
923
+ --media-control-background: transparent;
924
+ --media-control-hover-background: transparent;
925
+ position: relative;
926
+ }
927
+
883
928
  media-controller::part(vertical-layer) {
884
929
  transition: background-color 1s;
885
930
  }
886
931
 
887
932
  media-controller:is([media-paused], :not([user-inactive]))::part(vertical-layer) {
888
- background-color: var(--controls-backdrop-color, var(--controls, rgba(0, 0, 0, 0.6)));
933
+ background-color: var(--controls-backdrop-color, var(--controls, transparent));
889
934
  transition: background-color 0.25s;
890
935
  }
891
936
 
@@ -898,13 +943,18 @@ media-controller:is([media-paused], :not([user-inactive]))::part(vertical-layer)
898
943
  flex-flow: row;
899
944
  align-items: center;
900
945
  justify-content: center;
946
+ filter: drop-shadow(0 0 2px rgb(0 0 0 / 0.25)) drop-shadow(0 0 6px rgb(0 0 0 / 0.25));
947
+ paint-order: stroke;
948
+ stroke: rgba(102, 102, 102, 1);
949
+ stroke-width: 0.3px;
950
+ text-shadow: 0 0 2px rgb(0 0 0 / 0.25), 0 0 6px rgb(0 0 0 / 0.25);
901
951
  }
902
952
 
903
953
  .center-controls media-play-button {
904
954
  --media-control-background: transparent;
905
955
  --media-control-hover-background: transparent;
906
956
  padding: 0;
907
- width: max(30px, min(11%, 100px));
957
+ width: max(43px, min(10%, 55px));
908
958
  }
909
959
 
910
960
  .center-controls media-seek-backward-button,
@@ -912,8 +962,16 @@ media-controller:is([media-paused], :not([user-inactive]))::part(vertical-layer)
912
962
  --media-control-background: transparent;
913
963
  --media-control-hover-background: transparent;
914
964
  padding: 0;
915
- margin: 0 4%;
916
- width: min(7%, 70px);
965
+ margin: 0 2%;
966
+ width: max(33px, min(8%, 40px));
967
+ }
968
+
969
+ media-control-bar:not([slot]) media-seek-backward-button {
970
+ padding-right: 5px;
971
+ }
972
+
973
+ media-control-bar:not([slot]) media-seek-forward-button {
974
+ padding-left: 5px;
917
975
  }
918
976
 
919
977
  media-loading-indicator {
@@ -955,6 +1013,7 @@ media-time-display {
955
1013
 
956
1014
  .title-display {
957
1015
  font-size: 16px;
1016
+ text-shadow: 0 0 2px rgb(0 0 0 / 0.6);
958
1017
  }
959
1018
 
960
1019
  :host([audio]) .title-display {
@@ -1032,7 +1091,7 @@ media-time-display {
1032
1091
  `;var ao=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="off">
1033
1092
  <path d="m3 4.05 4.48 4.47-.33.33a.49.49 0 0 1-.36.15H3.25a.25.25 0 0 0-.25.25v5.5a.25.25 0 0 0 .25.25h3.54a.49.49 0 0 1 .36.15l4 4a.48.48 0 0 0 .36.15.5.5 0 0 0 .5-.5v-5.75l4.67 4.66a7.71 7.71 0 0 1-2.79 1.47v1.52a9.32 9.32 0 0 0 3.87-1.91L20 21l1-1L4.06 3 3 4.05Zm5.36 5.36 2.39 2.39V17L8 14.26a1.74 1.74 0 0 0-1.24-.51H4.25v-3.5h2.54A1.74 1.74 0 0 0 8 9.74l.36-.33ZM19.47 12a7.19 7.19 0 0 1-.89 3.47l1.11 1.1A8.64 8.64 0 0 0 21 12a9 9 0 0 0-7.12-8.7v1.52A7.52 7.52 0 0 1 19.47 12ZM12 8.88V5.21a.5.5 0 0 0-.5-.5.48.48 0 0 0-.36.15L9.56 6.44 12 8.88ZM15.91 12a4.284 4.284 0 0 1-.07.72l1.22 1.22a5.2 5.2 0 0 0 .38-1.94 5.49 5.49 0 0 0-3.56-5.1v1.66A4 4 0 0 1 15.91 12Z"/>
1034
1093
  </svg>
1035
- `;var ro=()=>R(Hn),no=()=>R(Wn),oo=()=>R(Fn),so=()=>R(Kn),lo=()=>R(Yn),co=()=>R(Gn),uo=()=>R(Zn),mo=()=>R(Qn),ho=()=>R(qn),po=()=>R(zn),bo=()=>R(jn),Eo=t=>R(Xn,t),fo=t=>R(Jn,t),go=()=>R(eo),vo=()=>R(to),Ao=()=>R(io),_o=()=>R(ao);var H=require("@mux/playback-core");var de={LG:"large",SM:"small",XS:"extra-small"},hi,yo,mi=class extends va{constructor(){super();T(this,hi);I(this,hi,yo).call(this)}static get observedAttributes(){return["audio","has-open-dialog","has-src","nohotkeys","hotkeys","stream-type","player-size","default-hidden-captions","forward-seek-offset","backward-seek-offset","playbackrates","default-show-remaining-time","poster","placeholder","title"]}attributeChangedCallback(){this.render()}render(){var a,r,n;let e={hasSrc:this.hasAttribute("has-src"),isDialogOpen:this.hasAttribute("has-open-dialog"),audio:this.hasAttribute("audio"),nohotkeys:this.hasAttribute("nohotkeys"),hotkeys:this.getAttribute("hotkeys"),streamType:this.getAttribute("stream-type"),playerSize:this.getAttribute("player-size"),defaultHiddenCaptions:this.hasAttribute("default-hidden-captions"),forwardSeekOffset:this.getAttribute("forward-seek-offset"),backwardSeekOffset:this.getAttribute("backward-seek-offset"),playbackRates:this.getAttribute("playbackrates"),defaultShowRemainingTime:this.hasAttribute("default-show-remaining-time"),poster:this.getAttribute("poster"),placeholder:this.getAttribute("placeholder"),title:this.getAttribute("title")};e.nohotkeys=e.nohotkeys||!e.hasSrc||e.isDialogOpen,[H.StreamTypes.LIVE,H.StreamTypes.LL_LIVE,H.StreamTypes.DVR,H.StreamTypes.LL_DVR].includes(e.streamType)&&(e.hotkeys=e.hotkeys||"",e.hotkeys+=" noarrowleft noarrowright"),ci(f`
1094
+ `;var ro=()=>D(Hn),no=()=>D(Wn),oo=()=>D(Fn),so=()=>D(Kn),lo=()=>D(Yn),co=()=>D(Gn),uo=()=>D(Zn),mo=()=>D(Qn),ho=()=>D(qn),po=()=>D(zn),bo=()=>D(jn),Eo=t=>D(Xn,t),fo=t=>D(Jn,t),go=()=>D(eo),vo=()=>D(to),Ao=()=>D(io),_o=()=>D(ao);var V=require("@mux/playback-core");var se={LG:"large",SM:"small",XS:"extra-small"},mi,yo,ui=class extends va{constructor(){super();T(this,mi);I(this,mi,yo).call(this)}static get observedAttributes(){return["audio","has-open-dialog","has-src","nohotkeys","hotkeys","stream-type","player-size","default-hidden-captions","forward-seek-offset","backward-seek-offset","playbackrates","default-show-remaining-time","poster","placeholder","title"]}attributeChangedCallback(){this.render()}render(){var a,r,n;let e={hasSrc:this.hasAttribute("has-src"),isDialogOpen:this.hasAttribute("has-open-dialog"),audio:this.hasAttribute("audio"),nohotkeys:this.hasAttribute("nohotkeys"),hotkeys:this.getAttribute("hotkeys"),streamType:this.getAttribute("stream-type"),playerSize:this.getAttribute("player-size"),defaultHiddenCaptions:this.hasAttribute("default-hidden-captions"),forwardSeekOffset:this.getAttribute("forward-seek-offset"),backwardSeekOffset:this.getAttribute("backward-seek-offset"),playbackRates:this.getAttribute("playbackrates"),defaultShowRemainingTime:this.hasAttribute("default-show-remaining-time"),poster:this.getAttribute("poster"),placeholder:this.getAttribute("placeholder"),title:this.getAttribute("title")};e.nohotkeys=e.nohotkeys||!e.hasSrc||e.isDialogOpen,[V.StreamTypes.LIVE,V.StreamTypes.LL_LIVE,V.StreamTypes.DVR,V.StreamTypes.LL_DVR].includes(e.streamType)&&(e.hotkeys=e.hotkeys||"",e.hotkeys+=" noarrowleft noarrowright"),di(b`
1036
1095
  <style>
1037
1096
  ${Vn}
1038
1097
  </style>
@@ -1055,235 +1114,246 @@ media-time-display {
1055
1114
  ${$l(e)}
1056
1115
  <slot></slot>
1057
1116
  </media-controller>
1058
- `,this.shadowRoot),(n=this.shadowRoot)==null||n.querySelectorAll("*").forEach(s=>{if(!s.localName.includes("-"))return;let l=s.localName.match(/^([^-]+)-(.*)-(button|range|display)$/);if(!l)return;let[,,c,m]=l;c==="text"&&s.classList.contains("title-display")&&(c="title");let E=s.closest('[slot="top-chrome"]')?"top":s.closest('[slot="centered-chrome"]')?"center":"bottom";s.setAttribute("part",`${E} ${c} ${m}`)})}};hi=new WeakSet,yo=function(){var e,a;try{(e=window==null?void 0:window.CSS)==null||e.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{}};M.customElements.get("media-theme-mux")||M.customElements.define("media-theme-mux",mi);var $l=t=>{let{streamType:i,playerSize:e,audio:a}=t;if(a)switch(i){case H.StreamTypes.LIVE:case H.StreamTypes.LL_LIVE:return Hl(t);case H.StreamTypes.DVR:case H.StreamTypes.LL_DVR:return Vl(t);case H.StreamTypes.ON_DEMAND:default:return Bl(t)}switch(i){case H.StreamTypes.LIVE:case H.StreamTypes.LL_LIVE:switch(e){case de.LG:return Gl(t);case de.SM:return Yl(t);case de.XS:return Kl(t)}case H.StreamTypes.DVR:case H.StreamTypes.LL_DVR:switch(e){case de.LG:return ql(t);case de.SM:return Ql(t);case de.XS:return Zl(t)}case H.StreamTypes.ON_DEMAND:default:switch(e){case de.LG:return Fl(t);case de.SM:return Wl(t);case de.XS:return Pa(t)}}},K=t=>f`
1117
+ `,this.shadowRoot),(n=this.shadowRoot)==null||n.querySelectorAll("*").forEach(s=>{if(!s.localName.includes("-"))return;let l=s.localName.match(/^([^-]+)-(.*)-(button|range|display)$/);if(!l)return;let[,,c,m]=l;c==="text"&&s.classList.contains("title-display")&&(c="title");let f=s.closest('[slot="top-chrome"]')?"top":s.closest('[slot="centered-chrome"]')?"center":"bottom";s.setAttribute("part",`${f} ${c} ${m}`)})}};mi=new WeakSet,yo=function(){var e,a;try{(e=window==null?void 0:window.CSS)==null||e.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{}};k.customElements.get("media-theme-mux")||k.customElements.define("media-theme-mux",ui);var $l=t=>{let{streamType:i,playerSize:e,audio:a}=t;if(a)switch(i){case V.StreamTypes.LIVE:case V.StreamTypes.LL_LIVE:return Hl(t);case V.StreamTypes.DVR:case V.StreamTypes.LL_DVR:return Vl(t);case V.StreamTypes.ON_DEMAND:default:return Bl(t)}switch(i){case V.StreamTypes.LIVE:case V.StreamTypes.LL_LIVE:switch(e){case se.LG:return Zl(t);case se.SM:return Gl(t);case se.XS:return Yl(t)}case V.StreamTypes.DVR:case V.StreamTypes.LL_DVR:switch(e){case se.LG:return zl(t);case se.SM:return ql(t);case se.XS:return Ql(t)}case V.StreamTypes.ON_DEMAND:default:switch(e){case se.LG:return Kl(t);case se.SM:return Fl(t);case se.XS:return Wl(t)}}},H=t=>b`
1059
1118
  <media-play-button disabled="${!t.hasSrc||t.isDialogOpen}" aria-disabled="${!t.hasSrc||t.isDialogOpen&&"true"}">
1060
1119
  ${bo()}
1061
1120
  ${mo()}
1062
- </media-play-button>`,qe=({backwardSeekOffset:t,hasSrc:i,isDialogOpen:e})=>f`
1121
+ </media-play-button>`,qe=({backwardSeekOffset:t,hasSrc:i,isDialogOpen:e})=>b`
1063
1122
  <media-seek-backward-button seek-offset="${t}" disabled="${!i||e}" aria-disabled="${!i||e&&"true"}">
1064
1123
  ${Eo({value:t})}
1065
- </media-seek-backward-button>`,ze=({forwardSeekOffset:t,hasSrc:i,isDialogOpen:e})=>f`
1124
+ </media-seek-backward-button>`,ze=({forwardSeekOffset:t,hasSrc:i,isDialogOpen:e})=>b`
1066
1125
  <media-seek-forward-button seek-offset="${t}" disabled="${!i||e}" aria-disabled="${!i||e&&"true"}">
1067
1126
  ${fo({value:t})}
1068
- </media-seek-forward-button>`,ee=({isDialogOpen:t})=>f`
1127
+ </media-seek-forward-button>`,Y=({isDialogOpen:t})=>b`
1069
1128
  <media-mute-button disabled="${t}" aria-disabled="${t&&"true"}">
1070
1129
  ${go()}
1071
1130
  ${Ao()}
1072
1131
  ${vo()}
1073
1132
  ${_o()}
1074
- </media-mute-button>`,De=({defaultHiddenCaptions:t,isDialogOpen:i})=>f`
1133
+ </media-mute-button>`,le=({defaultHiddenCaptions:t,isDialogOpen:i})=>b`
1075
1134
  <media-captions-button default-showing="${!t}" disabled="${i}" aria-disabled="${i&&"true"}">
1076
1135
  ${no()}
1077
1136
  ${oo()}
1078
- </media-captions-button>`,te=t=>f`
1137
+ </media-captions-button>`,de=t=>b`
1079
1138
  <media-airplay-button disabled="${!t.hasSrc||t.isDialogOpen}" aria-disabled="${!t.hasSrc||t.isDialogOpen&&"true"}">
1080
1139
  ${ro()}
1081
- </media-airplay-button>`,xe=t=>f`
1140
+ </media-airplay-button>`,je=t=>b`
1082
1141
  <media-pip-button disabled="${!t.hasSrc||t.isDialogOpen}" aria-disabled="${!t.hasSrc||t.isDialogOpen&&"true"}">
1083
1142
  ${ho()}
1084
1143
  ${po()}
1085
- </media-pip-button>`,Re=t=>f`
1144
+ </media-pip-button>`,ce=t=>b`
1086
1145
  <media-fullscreen-button disabled="${!t.hasSrc||t.isDialogOpen}" aria-disabled="${!t.hasSrc||t.isDialogOpen&&"true"}">
1087
1146
  ${co()}
1088
1147
  ${uo()}
1089
- </media-fullscreen-button>`,ie=t=>f`
1148
+ </media-fullscreen-button>`,ue=t=>b`
1090
1149
  <media-cast-button disabled="${!t.hasSrc||t.isDialogOpen}" aria-disabled="${!t.hasSrc||t.isDialogOpen&&"true"}">
1091
1150
  ${so()}
1092
1151
  ${lo()}
1093
- </media-cast-button>`,pi=({playbackRates:t,isDialogOpen:i})=>f`
1152
+ </media-cast-button>`,hi=({playbackRates:t,isDialogOpen:i})=>b`
1094
1153
  <media-playback-rate-button rates="${t!=null?t:!1}" disabled="${i}" aria-disabled="${i&&"true"}">
1095
- </media-playback-rate-button>`,ce=({isDialogOpen:t})=>f`
1154
+ </media-playback-rate-button>`,me=({isDialogOpen:t})=>b`
1096
1155
  <media-volume-range disabled="${t}" aria-disabled="${t&&"true"}">
1097
- </media-volume-range>`,je=t=>f`
1156
+ </media-volume-range>`,_e=t=>b`
1098
1157
  <media-time-range disabled="${!t.hasSrc||t.isDialogOpen}" aria-disabled="${!t.hasSrc||t.isDialogOpen&&"true"}">
1099
- </media-time-range>`,bi=({defaultShowRemainingTime:t,hasSrc:i,isDialogOpen:e})=>f`
1158
+ </media-time-range>`,pi=({defaultShowRemainingTime:t,hasSrc:i,isDialogOpen:e})=>b`
1100
1159
  <mxp-time-display remaining="${t}" disabled="${!i||e}" aria-disabled="${!i||e&&"true"}">
1101
- </mxp-time-display>`,ue=({title:t})=>f`
1102
- <media-text-display part="title" class="title-display">${t}</media-text-display>`,Bl=t=>f`
1103
- ${t.title?`<media-control-bar>${ue(t)}</media-control-bar>`:f``}
1160
+ </mxp-time-display>`,he=({title:t})=>b`
1161
+ <media-text-display part="title" class="title-display">${t}</media-text-display>`,Bl=t=>b`
1162
+ ${t.title?b`<media-control-bar>${he(t)}</media-control-bar>`:b``}
1104
1163
  <media-control-bar>
1105
- ${K(t)}
1164
+ ${H(t)}
1106
1165
  ${qe(t)}
1107
1166
  ${ze(t)}
1108
- ${bi(t)}
1109
- ${je(t)}
1110
- ${ee(t)}
1111
- ${ce(t)}
1112
1167
  ${pi(t)}
1113
- ${te(t)}
1114
- ${ie(t)}
1168
+ ${_e(t)}
1169
+ ${Y(t)}
1170
+ ${me(t)}
1171
+ ${hi(t)}
1172
+ ${de(t)}
1173
+ ${ue(t)}
1115
1174
  </media-control-bar>
1116
- `,Vl=t=>f`
1117
- ${t.title?`<media-control-bar>${ue(t)}</media-control-bar>`:f``}
1175
+ `,Vl=t=>b`
1176
+ ${t.title?b`<media-control-bar>${he(t)}</media-control-bar>`:b``}
1118
1177
  <media-control-bar>
1119
- ${K(t)}
1178
+ ${H(t)}
1120
1179
  <slot name="seek-live"></slot>
1121
1180
  ${qe(t)}
1122
1181
  ${ze(t)}
1123
- ${bi(t)}
1124
- ${je(t)}
1125
- ${ee(t)}
1126
- ${ce(t)}
1127
1182
  ${pi(t)}
1128
- ${te(t)}
1129
- ${ie(t)}
1183
+ ${_e(t)}
1184
+ ${Y(t)}
1185
+ ${me(t)}
1186
+ ${hi(t)}
1187
+ ${de(t)}
1188
+ ${ue(t)}
1130
1189
  </media-control-bar>
1131
- `,Hl=t=>f`
1132
- ${t.title?`<media-control-bar>${ue(t)}</media-control-bar>`:f``}
1190
+ `,Hl=t=>b`
1191
+ ${t.title?b`<media-control-bar>${he(t)}</media-control-bar>`:b``}
1133
1192
  <media-control-bar>
1134
- ${K(t)}
1193
+ ${H(t)}
1135
1194
  <slot name="seek-live"></slot>
1136
- ${ee(t)}
1137
- ${ce(t)}
1138
- ${te(t)}
1139
- ${ie(t)}
1140
- </media-control-bar>
1141
- `,Pa=t=>f`
1142
- <media-control-bar slot="top-chrome">
1143
- ${De(t)}
1195
+ ${Y(t)}
1196
+ ${me(t)}
1144
1197
  <div class="spacer"></div>
1145
- ${te(t)}
1146
- ${ie(t)}
1147
- ${xe(t)}
1198
+ ${de(t)}
1199
+ ${ue(t)}
1148
1200
  </media-control-bar>
1149
- <div slot="centered-chrome" class="center-controls">
1150
- ${K(t)}
1151
- </div>
1201
+ `,Wl=t=>b`
1202
+ ${_e(t)}
1152
1203
  <media-control-bar>
1153
- ${ee(t)}
1204
+ ${H(t)}
1205
+ ${Y(t)}
1154
1206
  <div class="spacer"></div>
1155
- ${Re(t)}
1207
+ ${le(t)}
1208
+ ${ce(t)}
1156
1209
  </media-control-bar>
1157
- `,Wl=t=>f`
1210
+ `,Fl=t=>b`
1158
1211
  <media-control-bar slot="top-chrome">
1159
- ${t.title?ue(t):f``}
1160
- <div class="spacer"></div>
1161
- ${De(t)}
1162
- ${te(t)}
1163
- ${ie(t)}
1164
- ${xe(t)}
1212
+ ${t.title?he(t):b``}
1165
1213
  </media-control-bar>
1166
1214
  <div slot="centered-chrome" class="center-controls">
1167
1215
  ${qe(t)}
1168
- ${K(t)}
1216
+ ${H(t)}
1169
1217
  ${ze(t)}
1170
1218
  </div>
1171
- ${je(t)}
1219
+ ${_e(t)}
1172
1220
  <media-control-bar>
1173
- ${bi(t)}
1174
- ${ee(t)}
1175
- ${ce(t)}
1176
- <div class="spacer"></div>
1177
1221
  ${pi(t)}
1178
- ${Re(t)}
1179
- <div class="padding-2"></div>
1222
+ ${Y(t)}
1223
+ ${me(t)}
1224
+ <div class="spacer"></div>
1225
+ ${hi(t)}
1226
+ ${le(t)}
1227
+ ${de(t)}
1228
+ ${ue(t)}
1229
+ ${je(t)}
1230
+ ${ce(t)}
1180
1231
  </media-control-bar>
1181
- `,Fl=t=>f`
1232
+ `,Kl=t=>b`
1182
1233
  <media-control-bar slot="top-chrome">
1183
- ${t.title?ue(t):f``}
1234
+ ${t.title?he(t):b``}
1184
1235
  </media-control-bar>
1185
1236
  <div slot="centered-chrome" class="center-controls">
1186
- ${K(t)}
1237
+ ${H(t)}
1187
1238
  </div>
1188
- ${je(t)}
1239
+ ${_e(t)}
1189
1240
  <media-control-bar>
1190
- ${K(t)}
1241
+ ${H(t)}
1191
1242
  ${qe(t)}
1192
1243
  ${ze(t)}
1193
- ${bi(t)}
1194
- ${ee(t)}
1195
- ${ce(t)}
1196
- <div class="spacer"></div>
1197
1244
  ${pi(t)}
1198
- ${De(t)}
1199
- ${te(t)}
1200
- ${ie(t)}
1201
- ${xe(t)}
1202
- ${Re(t)}
1203
- <div class="padding-2"></div>
1245
+ ${Y(t)}
1246
+ ${me(t)}
1247
+ <div class="spacer"></div>
1248
+ ${hi(t)}
1249
+ ${le(t)}
1250
+ ${de(t)}
1251
+ ${ue(t)}
1252
+ ${je(t)}
1253
+ ${ce(t)}
1204
1254
  </media-control-bar>
1205
- `,Kl=Pa,Yl=t=>f`
1255
+ `,Yl=t=>b`
1206
1256
  <media-control-bar slot="top-chrome">
1207
- ${t.title?ue(t):f``}
1257
+ <slot name="seek-live"></slot>
1258
+ </media-control-bar>
1259
+ <media-control-bar>
1260
+ ${H(t)}
1261
+ ${Y(t)}
1208
1262
  <div class="spacer"></div>
1209
- ${De(t)}
1210
- ${te(t)}
1211
- ${ie(t)}
1212
- ${xe(t)}
1263
+ ${le(t)}
1264
+ ${ce(t)}
1265
+ </media-control-bar>
1266
+ `,Gl=t=>b`
1267
+ <media-control-bar slot="top-chrome">
1268
+ <slot name="seek-live"></slot>
1269
+ ${t.title?he(t):b``}
1213
1270
  </media-control-bar>
1214
1271
  <div slot="centered-chrome" class="center-controls">
1215
- ${K(t)}
1272
+ ${H(t)}
1216
1273
  </div>
1217
1274
  <media-control-bar>
1218
- ${ee(t)}
1219
- ${ce(t)}
1220
- <slot name="seek-live"></slot>
1275
+ ${Y(t)}
1276
+ ${me(t)}
1221
1277
  <div class="spacer"></div>
1222
- ${Re(t)}
1278
+ ${le(t)}
1279
+ ${de(t)}
1280
+ ${ue(t)}
1281
+ ${je(t)}
1282
+ ${ce(t)}
1223
1283
  </media-control-bar>
1224
- `,Gl=t=>f`
1284
+ `,Zl=t=>b`
1225
1285
  <media-control-bar slot="top-chrome">
1226
- ${t.title?ue(t):f``}
1286
+ <slot name="seek-live"></slot>
1287
+ ${t.title?he(t):b``}
1227
1288
  </media-control-bar>
1228
1289
  <div slot="centered-chrome" class="center-controls">
1229
- ${K(t)}
1290
+ ${H(t)}
1230
1291
  </div>
1231
1292
  <media-control-bar>
1232
- ${ee(t)}
1293
+ ${H(t)}
1294
+ ${Y(t)}
1295
+ ${me(t)}
1296
+ <div class="spacer"></div>
1297
+ ${le(t)}
1298
+ ${de(t)}
1299
+ ${ue(t)}
1300
+ ${je(t)}
1233
1301
  ${ce(t)}
1302
+ </media-control-bar>
1303
+ `,Ql=t=>b`
1304
+ <media-control-bar slot="top-chrome">
1234
1305
  <slot name="seek-live"></slot>
1306
+ </media-control-bar>
1307
+ ${_e(t)}
1308
+ <media-control-bar>
1309
+ ${H(t)}
1310
+ ${Y(t)}
1235
1311
  <div class="spacer"></div>
1236
- ${De(t)}
1237
- ${te(t)}
1238
- ${ie(t)}
1239
- ${xe(t)}
1240
- ${Re(t)}
1312
+ ${le(t)}
1313
+ ${ce(t)}
1241
1314
  </media-control-bar>
1242
- `,Zl=Pa,Ql=t=>f`
1315
+ `,ql=t=>b`
1243
1316
  <media-control-bar slot="top-chrome">
1244
- ${t.title?ue(t):f``}
1245
- <div class="spacer"></div>
1246
- ${De(t)}
1247
- ${te(t)}
1248
- ${ie(t)}
1249
- ${xe(t)}
1317
+ <slot name="seek-live"></slot>
1318
+ ${t.title?he(t):b``}
1250
1319
  </media-control-bar>
1251
1320
  <div slot="centered-chrome" class="center-controls">
1252
1321
  ${qe(t)}
1253
- ${K(t)}
1322
+ ${H(t)}
1254
1323
  ${ze(t)}
1255
1324
  </div>
1256
- ${je(t)}
1325
+ ${_e(t)}
1257
1326
  <media-control-bar>
1258
- ${ee(t)}
1259
- ${ce(t)}
1260
- <slot name="seek-live"></slot>
1327
+ ${Y(t)}
1328
+ ${me(t)}
1261
1329
  <div class="spacer"></div>
1262
- ${Re(t)}
1263
- <div class="padding-2"></div>
1330
+ ${le(t)}
1331
+ ${de(t)}
1332
+ ${ue(t)}
1333
+ ${je(t)}
1334
+ ${ce(t)}
1264
1335
  </media-control-bar>
1265
- `,ql=t=>f`
1336
+ `,zl=t=>b`
1266
1337
  <media-control-bar slot="top-chrome">
1267
- ${t.title?ue(t):f``}
1338
+ <slot name="seek-live"></slot>
1339
+ ${t.title?he(t):b``}
1268
1340
  </media-control-bar>
1269
1341
  <div slot="centered-chrome" class="center-controls">
1270
- ${K(t)}
1342
+ ${H(t)}
1271
1343
  </div>
1272
- ${je(t)}
1344
+ ${_e(t)}
1273
1345
  <media-control-bar>
1274
- ${K(t)}
1346
+ ${H(t)}
1275
1347
  ${qe(t)}
1276
1348
  ${ze(t)}
1277
- ${ee(t)}
1278
- ${ce(t)}
1279
- <slot name="seek-live"></slot>
1349
+ ${Y(t)}
1350
+ ${me(t)}
1280
1351
  <div class="spacer"></div>
1281
- ${De(t)}
1282
- ${te(t)}
1283
- ${ie(t)}
1284
- ${xe(t)}
1285
- ${Re(t)}
1286
- <div class="padding-2"></div>
1352
+ ${le(t)}
1353
+ ${de(t)}
1354
+ ${ue(t)}
1355
+ ${je(t)}
1356
+ ${ce(t)}
1287
1357
  </media-control-bar>
1288
1358
  `;var Io=`
1289
1359
  :host {
@@ -1337,7 +1407,7 @@ media-time-display {
1337
1407
  text-align: center;
1338
1408
  line-height: 1.4;
1339
1409
  }
1340
- `,Mo=G.createElement("template");Mo.innerHTML=`
1410
+ `,Mo=Z.createElement("template");Mo.innerHTML=`
1341
1411
  <style>
1342
1412
  ${Io}
1343
1413
  </style>
@@ -1345,9 +1415,9 @@ media-time-display {
1345
1415
  <div class="dialog">
1346
1416
  <slot></slot>
1347
1417
  </div>
1348
- `;var ge=class extends M.HTMLElement{constructor(){var e;super();this.attachShadow({mode:"open"}),(e=this.shadowRoot)==null||e.appendChild(this.constructor.template.content.cloneNode(!0))}show(){this.setAttribute("open",""),this.dispatchEvent(new CustomEvent("open",{composed:!0,bubbles:!0})),To(this)}close(){!this.hasAttribute("open")||(this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("close",{composed:!0,bubbles:!0})),zl(this))}attributeChangedCallback(e,a,r){e==="open"&&a!==r&&(r!=null?this.show():this.close())}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","dialog"),this.hasAttribute("open")&&To(this)}};ge.styles=Io,ge.template=Mo,ge.observedAttributes=["open"];function To(t){let i=new CustomEvent("initfocus",{composed:!0,bubbles:!0,cancelable:!0});if(t.dispatchEvent(i),i.defaultPrevented)return;let e=t.querySelector("[autofocus]:not([disabled])");!e&&t.tabIndex>=0&&(e=t),e||(e=So(t.shadowRoot)),t._previouslyFocusedElement=G.activeElement,G.activeElement instanceof HTMLElement&&G.activeElement.blur(),t.addEventListener("transitionend",()=>{e instanceof HTMLElement&&e.focus({preventScroll:!0})},{once:!0})}function So(t){let e=["button","input","keygen","select","textarea"].map(function(r){return r+":not([disabled])"});e.push('[tabindex]:not([disabled]):not([tabindex=""])');let a=t==null?void 0:t.querySelector(e.join(", "));if(!a&&"attachShadow"in Element.prototype){let r=(t==null?void 0:t.querySelectorAll("*"))||[];for(let n=0;n<r.length&&!(r[n].tagName&&r[n].shadowRoot&&(a=So(r[n].shadowRoot),a));n++);}return a}function zl(t){t._previouslyFocusedElement instanceof HTMLElement&&t._previouslyFocusedElement.focus()}M.customElements.get("media-dialog")||(M.customElements.define("media-dialog",ge),M.MediaDialog=ge);var Ua=ge;var ko=G.createElement("template");ko.innerHTML=`
1418
+ `;var ye=class extends k.HTMLElement{constructor(){var e;super();this.attachShadow({mode:"open"}),(e=this.shadowRoot)==null||e.appendChild(this.constructor.template.content.cloneNode(!0))}show(){this.setAttribute("open",""),this.dispatchEvent(new CustomEvent("open",{composed:!0,bubbles:!0})),To(this)}close(){!this.hasAttribute("open")||(this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("close",{composed:!0,bubbles:!0})),jl(this))}attributeChangedCallback(e,a,r){e==="open"&&a!==r&&(r!=null?this.show():this.close())}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","dialog"),this.hasAttribute("open")&&To(this)}};ye.styles=Io,ye.template=Mo,ye.observedAttributes=["open"];function To(t){let i=new CustomEvent("initfocus",{composed:!0,bubbles:!0,cancelable:!0});if(t.dispatchEvent(i),i.defaultPrevented)return;let e=t.querySelector("[autofocus]:not([disabled])");!e&&t.tabIndex>=0&&(e=t),e||(e=ko(t.shadowRoot)),t._previouslyFocusedElement=Z.activeElement,Z.activeElement instanceof HTMLElement&&Z.activeElement.blur(),t.addEventListener("transitionend",()=>{e instanceof HTMLElement&&e.focus({preventScroll:!0})},{once:!0})}function ko(t){let e=["button","input","keygen","select","textarea"].map(function(r){return r+":not([disabled])"});e.push('[tabindex]:not([disabled]):not([tabindex=""])');let a=t==null?void 0:t.querySelector(e.join(", "));if(!a&&"attachShadow"in Element.prototype){let r=(t==null?void 0:t.querySelectorAll("*"))||[];for(let n=0;n<r.length&&!(r[n].tagName&&r[n].shadowRoot&&(a=ko(r[n].shadowRoot),a));n++);}return a}function jl(t){t._previouslyFocusedElement instanceof HTMLElement&&t._previouslyFocusedElement.focus()}k.customElements.get("media-dialog")||(k.customElements.define("media-dialog",ye),k.MediaDialog=ye);var Pa=ye;var So=Z.createElement("template");So.innerHTML=`
1349
1419
  <style>
1350
- ${Ua.styles}
1420
+ ${Pa.styles}
1351
1421
 
1352
1422
  .close {
1353
1423
  background: none;
@@ -1376,7 +1446,7 @@ media-time-display {
1376
1446
  </svg>
1377
1447
  </button>
1378
1448
  </slot>
1379
- `;var St=class extends Ua{constructor(){var i,e;super(),(e=(i=this.shadowRoot)==null?void 0:i.querySelector(".close"))==null||e.addEventListener("click",()=>{this.close()})}};St.template=ko;M.customElements.get("mxp-dialog")||(M.customElements.define("mxp-dialog",St),M.MxpDialog=St);var Lo=`:host {
1449
+ `;var kt=class extends Pa{constructor(){var i,e;super(),(e=(i=this.shadowRoot)==null?void 0:i.querySelector(".close"))==null||e.addEventListener("click",()=>{this.close()})}};kt.template=So;k.customElements.get("mxp-dialog")||(k.customElements.define("mxp-dialog",kt),k.MxpDialog=kt);var Lo=`:host {
1380
1450
  display: inline-block;
1381
1451
  width: 100%;
1382
1452
  }
@@ -1391,21 +1461,36 @@ a {
1391
1461
  font-size: 0.9em;
1392
1462
  text-decoration: underline;
1393
1463
  }
1394
- [part~='seek-live'] {
1395
- height: 44px;
1464
+
1465
+ [audio] [part~='seek-live'] {
1466
+ margin: 0;
1467
+ height: 42px;
1468
+ border-radius: 0;
1396
1469
  background-color: var(--media-control-background, rgba(20, 20, 30, 0.7));
1397
- color: white;
1470
+ }
1471
+
1472
+ [part~='seek-live'] {
1473
+ margin-left: 10px;
1474
+ margin-right: 5px;
1475
+ align-self: center;
1476
+ position: relative;
1477
+ box-sizing: border-box;
1478
+ padding: 4px 6px;
1479
+ border-radius: 12px;
1480
+ background-color: rgba(20, 20, 30, 0.7);
1481
+ font-size: 0.75rem;
1482
+ line-height: 1;
1483
+ color: #fff;
1398
1484
  border: none;
1399
1485
  cursor: pointer;
1400
1486
  }
1401
1487
 
1402
- [part~='seek-live']::before {
1403
- content: '\u25CF ';
1404
- color: rgb(118, 118, 118);
1405
- padding-right: 5px;
1488
+ [part~='seek-live'] svg {
1489
+ width: 8px;
1490
+ fill: rgb(118, 118, 118);
1406
1491
  }
1407
- [part~='seek-live'][in-live-window]::before {
1408
- color: #fb3c4d;
1492
+ [part~='seek-live'][in-live-window] svg {
1493
+ fill: #fb3c4d;
1409
1494
  }
1410
1495
 
1411
1496
  [part~='seek-live'][disabled] {
@@ -1527,13 +1612,13 @@ a {
1527
1612
  ::part(title display) {
1528
1613
  display: var(--media-controls, var(--media-title-display));
1529
1614
  }
1530
- `;var Pe=require("@mux/playback-core"),wo=t=>f`
1615
+ `;var Pe=require("@mux/playback-core"),wo=t=>b`
1531
1616
  <style>
1532
1617
  ${Lo}
1533
1618
  </style>
1534
- ${Jl(t)}
1535
- `,Co=t=>[Pe.StreamTypes.LIVE,Pe.StreamTypes.LL_LIVE].includes(t.streamType),Xl=t=>[Pe.StreamTypes.LIVE,Pe.StreamTypes.LL_LIVE,Pe.StreamTypes.DVR,Pe.StreamTypes.LL_DVR].includes(t.streamType),Jl=t=>{var i,e,a,r,n,s,l,c,m,E,y,k,_,O,x,P,C,re,Y,ne,Oe,xt,$a,Ba,Va,Ha,Wa,Fa,Ka,Ya,Ga,Za,Qa,qa,za,ja,Xa,Ja,er,tr,ir,ar,rr;return f`
1536
- <${Ra((i=Sa(t.theme))!=null?i:"media-theme-mux")}
1619
+ ${ed(t)}
1620
+ `,Co=t=>[Pe.StreamTypes.LIVE,Pe.StreamTypes.LL_LIVE].includes(t.streamType),Jl=t=>[Pe.StreamTypes.LIVE,Pe.StreamTypes.LL_LIVE,Pe.StreamTypes.DVR,Pe.StreamTypes.LL_DVR].includes(t.streamType),ed=t=>{var i,e,a,r,n,s,l,c,m,f,_,S,y,W,P,U,C,ie,G,ae,Oe,Dt,Na,$a,Ba,Va,Ha,Wa,Fa,Ka,Ya,Ga,Za,Qa,qa,za,ja,Xa,Ja,er,tr,ir,ar,rr;return b`
1621
+ <${Ra((i=ka(t.theme))!=null?i:"media-theme-mux")}
1537
1622
  has-src="${(e=t.hasSrc)!=null?e:!1}"
1538
1623
  has-open-dialog="${(a=t.isDialogOpen)!=null?a:!1}"
1539
1624
  nohotkeys="${(r=t.noHotKeys)!=null?r:!1}"
@@ -1543,26 +1628,27 @@ a {
1543
1628
  stream-type="${(l=t.streamType)!=null?l:!1}"
1544
1629
  player-size="${(c=t.playerSize)!=null?c:!1}"
1545
1630
  default-hidden-captions="${(m=t.defaultHiddenCaptions)!=null?m:!1}"
1546
- forward-seek-offset="${(E=t.forwardSeekOffset)!=null?E:!1}"
1547
- backward-seek-offset="${(y=t.backwardSeekOffset)!=null?y:!1}"
1548
- playbackrates="${(k=t.playbackRates)!=null?k:!1}"
1549
- default-show-remaining-time="${(_=t.defaultShowRemainingTime)!=null?_:!1}"
1550
- title="${(O=t.title)!=null?O:!1}"
1551
- hotkeys="${(x=t.hotKeys)!=null?x:!1}"
1552
- poster="${t.poster===""?!1:(P=t.poster)!=null?P:!1}"
1631
+ forward-seek-offset="${(f=t.forwardSeekOffset)!=null?f:!1}"
1632
+ backward-seek-offset="${(_=t.backwardSeekOffset)!=null?_:!1}"
1633
+ playbackrates="${(S=t.playbackRates)!=null?S:!1}"
1634
+ default-show-remaining-time="${(y=t.defaultShowRemainingTime)!=null?y:!1}"
1635
+ title="${(W=t.title)!=null?W:!1}"
1636
+ hotkeys="${(P=t.hotKeys)!=null?P:!1}"
1637
+ poster="${t.poster===""?!1:(U=t.poster)!=null?U:!1}"
1553
1638
  placeholder="${(C=t.placeholder)!=null?C:!1}"
1554
1639
  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"
1555
1640
  >
1556
1641
  <mux-video
1557
1642
  slot="media"
1558
- crossorigin="${(re=t.crossOrigin)!=null?re:""}"
1643
+ crossorigin="${(ie=t.crossOrigin)!=null?ie:""}"
1559
1644
  playsinline
1560
- autoplay="${(Y=t.autoplay)!=null?Y:!1}"
1561
- muted="${(ne=t.muted)!=null?ne:!1}"
1645
+ autoplay="${(G=t.autoplay)!=null?G:!1}"
1646
+ muted="${(ae=t.muted)!=null?ae:!1}"
1562
1647
  loop="${(Oe=t.loop)!=null?Oe:!1}"
1563
- preload="${(xt=t.preload)!=null?xt:!1}"
1564
- debug="${($a=t.debug)!=null?$a:!1}"
1565
- experimental-cmcd="${(Ba=t.experimentalCmcd)!=null?Ba:!1}"
1648
+ preload="${(Dt=t.preload)!=null?Dt:!1}"
1649
+ debug="${(Na=t.debug)!=null?Na:!1}"
1650
+ experimental-cmcd="${($a=t.experimentalCmcd)!=null?$a:!1}"
1651
+ prefer-cmcd="${(Ba=t.preferCmcd)!=null?Ba:!1}"
1566
1652
  disable-cookies="${(Va=t.disableCookies)!=null?Va:!1}"
1567
1653
  prefer-playback="${(Ha=t.preferPlayback)!=null?Ha:!1}"
1568
1654
  start-time="${t.startTime!=null?t.startTime:!1}"
@@ -1580,9 +1666,9 @@ a {
1580
1666
  cast-stream-type="${Co(t)?"live":!1}"
1581
1667
  exportparts="video"
1582
1668
  >
1583
- ${t.storyboard?f`<track label="thumbnails" default kind="metadata" src="${t.storyboard}" />`:f``}
1669
+ ${t.storyboard?b`<track label="thumbnails" default kind="metadata" src="${t.storyboard}" />`:b``}
1584
1670
  </mux-video>
1585
- ${Xl(t)?f`<button
1671
+ ${Jl(t)?b`<button
1586
1672
  slot="seek-live"
1587
1673
  part="${Co(t)?"top":"bottom"} seek-live button"
1588
1674
  disabled="${t.inLiveWindow||!t.hasSrc||t.isDialogOpen}"
@@ -1590,26 +1676,27 @@ a {
1590
1676
  in-live-window="${t.inLiveWindow}"
1591
1677
  onclick="${function($o){var nr;if((nr=t.onSeekToLive)==null||nr.call(t,$o),t.paused){let Bo=new CustomEvent("mediaplayrequest",{composed:!0,bubbles:!0});this.dispatchEvent(Bo)}}}"
1592
1678
  >
1679
+ <svg viewBox="0 0 8 8"><circle cx="4" cy="4" r="4"></circle></svg>
1593
1680
  Live
1594
- </button>`:f``}
1681
+ </button>`:b``}
1595
1682
  <mxp-dialog
1596
1683
  no-auto-hide
1597
1684
  open="${(Xa=t.isDialogOpen)!=null?Xa:!1}"
1598
1685
  onclose="${t.onCloseErrorDialog}"
1599
1686
  oninitfocus="${t.onInitFocusDialog}"
1600
1687
  >
1601
- ${(Ja=t.dialog)!=null&&Ja.title?f`<h3>${t.dialog.title}</h3>`:f``}
1688
+ ${(Ja=t.dialog)!=null&&Ja.title?b`<h3>${t.dialog.title}</h3>`:b``}
1602
1689
  <p>
1603
1690
  ${(er=t.dialog)==null?void 0:er.message}
1604
- ${(tr=t.dialog)!=null&&tr.linkUrl?f`<a
1691
+ ${(tr=t.dialog)!=null&&tr.linkUrl?b`<a
1605
1692
  href="${t.dialog.linkUrl}"
1606
1693
  target="_blank"
1607
1694
  rel="external noopener"
1608
1695
  aria-label="${(ir=t.dialog.linkText)!=null?ir:""} ${A("(opens in a new window)")}"
1609
1696
  >${(ar=t.dialog.linkText)!=null?ar:t.dialog.linkUrl}</a
1610
- >`:f``}
1697
+ >`:b``}
1611
1698
  </p>
1612
1699
  </mxp-dialog>
1613
- </${Ra((rr=Sa(t.theme))!=null?rr:"media-theme-mux")}>
1614
- `};var kt=require("@mux/mux-video");function Ei(t,i,e,a,r){var l,c,m;let n={},s={};switch(t.code){case kt.MediaError.MEDIA_ERR_NETWORK:{switch(n.title=A("Network Error",r),n.message=t.message,(l=t.data)==null?void 0:l.response.code){case 412:{n.title=A("Video is not currently available",r),n.message=A("The live stream or video file are not yet ready.",r),s.message=A("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=A("Video does not exist",r),n.message="",s.message=A("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=A("Invalid playback URL",r),n.message=A("The video URL or playback-token are formatted with incorrect or incomplete information.",r),s.message=A("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:y,sub:k}=Ee(a),_=Date.now()>E*1e3,O=k!==e,x=y!=="v",P={timeStyle:"medium",dateStyle:"medium"};if(_){n.title=A("Video URL has expired",r),n.message=A("The video\u2019s secured playback-token has expired.",r),s.message=A("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,P).format(E*1e3),currentDate:new Intl.DateTimeFormat(Me.code,P).format(Date.now())}),s.file="403-expired-token.md";break}if(O){n.title=A("Video URL is formatted incorrectly",r),n.message=A("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),s.message=A("The specified playback ID {playbackId} and the playback ID encoded in the playback-token {tokenPlaybackId} do not match.",r).format({playbackId:e,tokenPlaybackId:k}),s.file="403-playback-id-mismatch.md";break}if(x){n.title=A("Video URL is formatted incorrectly",r),n.message=A("The playback-token is formatted with incorrect information.",r),s.message=A("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=A("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 kt.MediaError.MEDIA_ERR_DECODE:{let{message:E}=t;n={title:A("Media Error",r),message:E},s.file="media-decode-error.md";break}case kt.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:{let E=(m=(c=t.data)==null?void 0:c.response)==null?void 0:m.code;if(E>=400&&E<500){t.code=kt.MediaError.MEDIA_ERR_NETWORK,t.data={response:{code:E}},{dialog:n,devlog:s}=Ei(t,i,e,a);break}n={title:A("Source Not Supported",r),message:t.message},s.file="media-src-not-supported.md";break}default:n={title:A("Error",r),message:t.message};break}return i&&(n={title:A("Your device appears to be offline",r),message:A("Check your internet connection and try reloading this video.",r)}),{dialog:n,devlog:s}}var ed=Object.values(S.StreamTypes),td=700,id=300,Oa={LG:"large",SM:"small",XS:"extra-small"};function fi(t){let i=t.getBoundingClientRect();return i.width<id?Oa.XS:i.width<td?Oa.SM:Oa.LG}var me={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",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 ad(t,i){var a,r;return{src:!t.playbackId&&t.src,playbackId:t.playbackId,hasSrc:!!t.playbackId||!!t.src,poster:t.poster,storyboard:t.storyboard,placeholder:t.getAttribute("placeholder"),theme:t.getAttribute("theme"),thumbnailTime:!t.tokens.thumbnail&&t.thumbnailTime,autoplay:t.autoplay,crossOrigin:t.crossOrigin,loop:t.loop,noHotKeys:t.hasAttribute(b.NOHOTKEYS),hotKeys:t.getAttribute(b.HOTKEYS),muted:t.muted,paused:t.paused,preload:t.preload,envKey:t.envKey,experimentalCmcd:t.experimentalCmcd,debug:t.debug,disableCookies:t.disableCookies,tokens:t.tokens,beaconCollectionDomain:t.beaconCollectionDomain,metadata:t.metadata,playerSoftwareName:t.playerSoftwareName,playerSoftwareVersion:t.playerSoftwareVersion,startTime:t.startTime,preferPlayback:t.preferPlayback,audio:t.audio,streamType:t.streamType,primaryColor:t.primaryColor,secondaryColor:t.secondaryColor,forwardSeekOffset:t.forwardSeekOffset,backwardSeekOffset:t.backwardSeekOffset,defaultHiddenCaptions:t.defaultHiddenCaptions,defaultShowRemainingTime:t.defaultShowRemainingTime,playbackRates:t.getAttribute(b.PLAYBACK_RATES),customDomain:(a=t.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?a:void 0,playerSize:fi((r=t.mediaController)!=null?r:t),metadataVideoId:t.getAttribute(g.Attributes.METADATA_VIDEO_ID),metadataVideoTitle:t.getAttribute(g.Attributes.METADATA_VIDEO_TITLE),metadataViewerUserId:t.getAttribute(g.Attributes.METADATA_VIEWER_USER_ID),title:t.getAttribute(b.TITLE),...i}}var rd=Object.values(g.Attributes),nd=Object.values(me),od=Object.values(b),sd=ri(),ld="mux-player",Do={dialog:void 0,isDialogOpen:!1,inLiveWindow:!1},Ue,Ct,he,wt,Je,ae,et,gi,Ae,Xe,tt,vi,Dt,Na,Ai,xo,_i,Ro,yi,Po,Ti,Uo,Ii,Oo,Mi,No,Lt=class extends Ca{constructor(){super();T(this,et);T(this,Ae);T(this,tt);T(this,Dt);T(this,Ai);T(this,_i);T(this,yi);T(this,Ti);T(this,Ii);T(this,Mi);T(this,Ue,!1);T(this,Ct,{});T(this,he,!0);T(this,wt,new ai(this,"hotkeys"));T(this,Je,void 0);T(this,ae,{...Do,onCloseErrorDialog:()=>I(this,Ae,Xe).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:e=>{Ta(this,G.activeElement)||e.preventDefault()},onSeekToLive:()=>ka(this)});this.attachShadow({mode:"open"}),this.isConnected&&I(this,et,gi).call(this)}static get observedAttributes(){var e;return[...(e=Ca.observedAttributes)!=null?e:[],...nd,...rd,...od]}get theme(){var e,a;return Array.from((a=(e=this.shadowRoot)==null?void 0:e.children)!=null?a:[]).find(({localName:r})=>r.startsWith("media-theme-"))}get mediaController(){var e,a;return(a=(e=this.theme)==null?void 0:e.shadowRoot)==null?void 0:a.querySelector("media-controller")}connectedCallback(){I(this,Dt,Na).call(this),I(this,Ai,xo).call(this)}disconnectedCallback(){I(this,_i,Ro).call(this)}attributeChangedCallback(e,a,r){switch(v(this,Ue)||I(this,et,gi).call(this),super.attributeChangedCallback(e,a,r),e){case b.HOTKEYS:v(this,wt).value=r;break;case b.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&Le(A("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case b.THUMBNAIL_TOKEN:{let{aud:s}=Ee(r);r&&s!=="t"&&Le(A("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:s}));break}case b.STORYBOARD_TOKEN:{let{aud:s}=Ee(r);r&&s!=="s"&&Le(A("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")&&X(A("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&&!ed.includes(this.streamType)&&ni({file:"invalid-stream-type.md",message:A("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})}):ni({file:"invalid-stream-type.md",message:String(A("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,me.SRC,b.PLAYBACK_TOKEN].includes(e)&&a!==r&&B(this,ae,{...v(this,ae),...Do}),I(this,tt,vi).call(this,{[In(e)]:r})}get experimentalCmcd(){return this.hasAttribute(g.Attributes.EXPERIMENTAL_CMCD)}set experimentalCmcd(e){!!e!==this.experimentalCmcd&&(e?this.setAttribute(g.Attributes.EXPERIMENTAL_CMCD,""):this.removeAttribute(g.Attributes.EXPERIMENTAL_CMCD))}get hasPlayed(){var e,a;return(a=(e=this.mediaController)==null?void 0:e.hasAttribute("media-has-played"))!=null?a:!1}get inLiveWindow(){return v(this,ae).inLiveWindow}get _hls(){var e;return(e=this.media)==null?void 0:e._hls}get mux(){var e;return(e=this.media)==null?void 0:e.mux}get playbackId(){var e;return(e=this.getAttribute(g.Attributes.PLAYBACK_ID))!=null?e:void 0}set playbackId(e){e?this.setAttribute(g.Attributes.PLAYBACK_ID,e):this.removeAttribute(g.Attributes.PLAYBACK_ID)}get src(){var e,a;return this.playbackId?(e=ve(this,me.SRC))!=null?e:void 0:(a=this.getAttribute(me.SRC))!=null?a:void 0}set src(e){e?this.setAttribute(me.SRC,e):this.removeAttribute(me.SRC)}get poster(){var a;let e=this.getAttribute(me.POSTER);if(e!=null)return e;if(this.playbackId&&!this.audio)return yn(this.playbackId,{domain:this.customDomain,thumbnailTime:(a=this.thumbnailTime)!=null?a:this.startTime,token:this.tokens.thumbnail})}set poster(e){e||e===""?this.setAttribute(me.POSTER,e):this.removeAttribute(me.POSTER)}get storyboard(){if(this.playbackId&&!this.audio&&(!this.streamType||![S.StreamTypes.LIVE,S.StreamTypes.LL_LIVE,S.StreamTypes.DVR,S.StreamTypes.LL_DVR].includes(this.streamType)))return Tn(this.playbackId,{domain:this.customDomain,token:this.tokens.storyboard})}get audio(){return this.hasAttribute(b.AUDIO)}set audio(e){if(!e){this.removeAttribute(b.AUDIO);return}this.setAttribute(b.AUDIO,"")}get hotkeys(){return v(this,wt)}get nohotkeys(){return this.hasAttribute(b.NOHOTKEYS)}set nohotkeys(e){if(!e){this.removeAttribute(b.NOHOTKEYS);return}this.setAttribute(b.NOHOTKEYS,"")}get thumbnailTime(){return se(this.getAttribute(b.THUMBNAIL_TIME))}set thumbnailTime(e){this.setAttribute(b.THUMBNAIL_TIME,`${e}`)}get title(){var e;return(e=this.getAttribute(b.TITLE))!=null?e:""}set title(e){e!==this.title&&(e?this.setAttribute(b.TITLE,e):this.removeAttribute("title"),super.title=e)}get placeholder(){var e;return(e=ve(this,b.PLACEHOLDER))!=null?e:""}set placeholder(e){this.setAttribute(b.PLACEHOLDER,`${e}`)}get primaryColor(){var e;return(e=this.getAttribute(b.PRIMARY_COLOR))!=null?e:void 0}set primaryColor(e){this.setAttribute(b.PRIMARY_COLOR,`${e}`)}get secondaryColor(){var e;return(e=this.getAttribute(b.SECONDARY_COLOR))!=null?e:void 0}set secondaryColor(e){this.setAttribute(b.SECONDARY_COLOR,`${e}`)}get defaultShowRemainingTime(){return this.hasAttribute(b.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(e){e?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(e=>Number(e)).filter(e=>!Number.isNaN(e)).sort((e,a)=>e-a)}set playbackRates(e){if(!e){this.removeAttribute(b.PLAYBACK_RATES);return}this.setAttribute(b.PLAYBACK_RATES,e.join(" "))}get forwardSeekOffset(){var e;return(e=se(this.getAttribute(b.FORWARD_SEEK_OFFSET)))!=null?e:10}set forwardSeekOffset(e){this.setAttribute(b.FORWARD_SEEK_OFFSET,`${e}`)}get backwardSeekOffset(){var e;return(e=se(this.getAttribute(b.BACKWARD_SEEK_OFFSET)))!=null?e:10}set backwardSeekOffset(e){this.setAttribute(b.BACKWARD_SEEK_OFFSET,`${e}`)}get defaultHiddenCaptions(){return this.hasAttribute(b.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(e){e?this.setAttribute(b.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(b.DEFAULT_HIDDEN_CAPTIONS)}get playerSoftwareName(){var e;return(e=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_NAME))!=null?e:ld}get playerSoftwareVersion(){var e;return(e=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_VERSION))!=null?e:sd}get beaconCollectionDomain(){var e;return(e=this.getAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN))!=null?e:void 0}set beaconCollectionDomain(e){e!==this.beaconCollectionDomain&&(e?this.setAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN,e):this.removeAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN))}get customDomain(){var e;return(e=this.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?e:void 0}set customDomain(e){e!==this.customDomain&&(e?this.setAttribute(g.Attributes.CUSTOM_DOMAIN,e):this.removeAttribute(g.Attributes.CUSTOM_DOMAIN))}get envKey(){var e;return(e=ve(this,g.Attributes.ENV_KEY))!=null?e:void 0}set envKey(e){this.setAttribute(g.Attributes.ENV_KEY,`${e}`)}get debug(){return ve(this,g.Attributes.DEBUG)!=null}set debug(e){e?this.setAttribute(g.Attributes.DEBUG,""):this.removeAttribute(g.Attributes.DEBUG)}get disableCookies(){return ve(this,g.Attributes.DISABLE_COOKIES)!=null}set disableCookies(e){e?this.setAttribute(g.Attributes.DISABLE_COOKIES,""):this.removeAttribute(g.Attributes.DISABLE_COOKIES)}get streamType(){return ve(this,g.Attributes.STREAM_TYPE)}set streamType(e){this.setAttribute(g.Attributes.STREAM_TYPE,`${e}`)}get startTime(){return se(ve(this,g.Attributes.START_TIME))}set startTime(e){this.setAttribute(g.Attributes.START_TIME,`${e}`)}get preferPlayback(){let e=this.getAttribute(g.Attributes.PREFER_PLAYBACK);if(e===S.PlaybackTypes.MSE||e===S.PlaybackTypes.NATIVE)return e}set preferPlayback(e){e!==this.preferPlayback&&(e===S.PlaybackTypes.MSE||e===S.PlaybackTypes.NATIVE?this.setAttribute(g.Attributes.PREFER_PLAYBACK,e):this.removeAttribute(g.Attributes.PREFER_PLAYBACK))}get metadata(){var e;return(e=this.media)==null?void 0:e.metadata}set metadata(e){if(v(this,Ue)||I(this,et,gi).call(this),!this.media){X("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata=e}get tokens(){let e=this.getAttribute(b.PLAYBACK_TOKEN),a=this.getAttribute(b.THUMBNAIL_TOKEN),r=this.getAttribute(b.STORYBOARD_TOKEN);return{...v(this,Ct),...e!=null?{playback:e}:{},...a!=null?{thumbnail:a}:{},...r!=null?{storyboard:r}:{}}}set tokens(e){B(this,Ct,e!=null?e:{})}get playbackToken(){var e;return(e=this.getAttribute(b.PLAYBACK_TOKEN))!=null?e:void 0}set playbackToken(e){this.setAttribute(b.PLAYBACK_TOKEN,`${e}`)}get thumbnailToken(){var e;return(e=this.getAttribute(b.THUMBNAIL_TOKEN))!=null?e:void 0}set thumbnailToken(e){this.setAttribute(b.THUMBNAIL_TOKEN,`${e}`)}get storyboardToken(){var e;return(e=this.getAttribute(b.STORYBOARD_TOKEN))!=null?e:void 0}set storyboardToken(e){this.setAttribute(b.STORYBOARD_TOKEN,`${e}`)}addTextTrack(e,a,r,n){var l;let s=(l=this.media)==null?void 0:l.nativeEl;if(!!s)return(0,S.addTextTrack)(s,e,a,r,n)}removeTextTrack(e){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(!!a)return(0,S.removeTextTrack)(a,e)}get textTracks(){var e;return(e=this.media)==null?void 0:e.textTracks}};Ue=new WeakMap,Ct=new WeakMap,he=new WeakMap,wt=new WeakMap,Je=new WeakMap,ae=new WeakMap,et=new WeakSet,gi=function(){var e,a,r;if(!v(this,Ue)){B(this,Ue,!0),I(this,Ae,Xe).call(this,{playerSize:fi(this)});try{if(customElements.upgrade(this.theme),!(this.theme instanceof M.HTMLElement))throw""}catch{X(`<${(e=this.theme)==null?void 0:e.localName}> failed to upgrade!`)}try{if(customElements.upgrade(this.media),!(this.media instanceof g.default))throw""}catch{X("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof mt))throw""}catch{X("<media-controller> failed to upgrade!")}Dn(this),I(this,Ti,Uo).call(this),I(this,Ii,Oo).call(this),I(this,yi,Po).call(this),B(this,he,(r=(a=this.mediaController)==null?void 0:a.hasAttribute("user-inactive"))!=null?r:!0),I(this,Mi,No).call(this)}},Ae=new WeakSet,Xe=function(e){Object.assign(v(this,ae),e),I(this,tt,vi).call(this)},tt=new WeakSet,vi=function(e={}){ci(wo(ad(this,{...v(this,ae),...e})),this.shadowRoot)},Dt=new WeakSet,Na=function(){var e,a;v(this,ae).playerSize!=fi((e=this.mediaController)!=null?e:this)&&I(this,Ae,Xe).call(this,{playerSize:fi((a=this.mediaController)!=null?a:this)})},Ai=new WeakSet,xo=function(){var e;B(this,Je,new ResizeObserver(()=>I(this,Dt,Na).call(this))),v(this,Je).observe((e=this.mediaController)!=null?e:this)},_i=new WeakSet,Ro=function(){var e;(e=v(this,Je))==null||e.disconnect()},yi=new WeakSet,Po=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&&[S.StreamTypes.LIVE,S.StreamTypes.LL_LIVE,S.StreamTypes.DVR,S.StreamTypes.LL_DVR].includes(this.streamType)&&this.hasPlayed&&ka(this)});let e=()=>{let c=Sn(this),m=v(this,ae).inLiveWindow;c!==m&&(I(this,Ae,Xe).call(this,{inLiveWindow:c}),this.dispatchEvent(new CustomEvent("inlivewindowchange",{composed:!0,bubbles:!0,detail:this.inLiveWindow})))};(r=this.media)==null||r.addEventListener("progress",e),(n=this.media)==null||n.addEventListener("waiting",e),(s=this.media)==null||s.addEventListener("timeupdate",e),(l=this.media)==null||l.addEventListener("emptied",e)},Ti=new WeakSet,Uo=function(){var a;let e=r=>{let{detail:n}=r;if(n instanceof g.MediaError||(n=new g.MediaError(n.message,n.code,n.fatal)),!(n!=null&&n.fatal)){Le(n),n.data&&Le(`${n.name} data:`,n.data);return}let{dialog:s,devlog:l}=Ei(n,!window.navigator.onLine,this.playbackId,this.playbackToken);l.message&&ni(l),X(n),n.data&&X(`${n.name} data:`,n.data),I(this,Ae,Xe).call(this,{isDialogOpen:!0,dialog:s})};this.addEventListener("error",e),this.media&&(this.media.errorTranslator=(r={})=>{var s,l,c;if(!((s=this.media)!=null&&s.error))return r;let{devlog:n}=Ei((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}))})},Ii=new WeakSet,Oo=function(){var a,r,n,s;let e=()=>I(this,tt,vi).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",e),(s=(n=this.media)==null?void 0:n.textTracks)==null||s.addEventListener("removetrack",e)},Mi=new WeakSet,No=function(){var E,y,k;let e=this.mediaController,a=/.*Version\/.*Safari\/.*/.test(navigator.userAgent);if(a)return;let r,n=new WeakMap,s=()=>this.streamType&&[S.StreamTypes.LIVE,S.StreamTypes.LL_LIVE].includes(this.streamType)&&!this.secondaryColor&&this.offsetWidth>=800,l=(_,O,x=!1)=>{if(s())return;Array.from(_&&_.activeCues||[]).forEach(C=>{if(!(!C.snapToLines||C.line<-5||C.line>=0&&C.line<10))if(!O||this.paused){let re=C.text.split(`
1615
- `).length,Y=a?-2:-3;this.streamType&&[S.StreamTypes.LIVE,S.StreamTypes.LL_LIVE].includes(this.streamType)&&(Y=a?-1:-2);let ne=Y-re;if(C.line===ne&&!x)return;n.has(C)||n.set(C,C.line),C.line=ne-1,C.line=ne}else setTimeout(()=>{C.line=n.get(C)||"auto"},500)})},c=()=>{var _;l(r,(_=e==null?void 0:e.hasAttribute("user-inactive"))!=null?_:!1)},m=()=>{var x;let O=Array.from(((x=e==null?void 0:e.media)==null?void 0:x.textTracks)||[]).filter(P=>["subtitles","captions"].includes(P.kind)&&P.mode==="showing")[0];O!==r&&(r==null||r.removeEventListener("cuechange",c)),r=O,r==null||r.addEventListener("cuechange",c),l(r,v(this,he))};if(m(),(E=e==null?void 0:e.media)==null||E.textTracks.addEventListener("change",m),(y=e==null?void 0:e.media)==null||y.textTracks.addEventListener("addtrack",m),navigator.userAgent.includes("Chrome/")){let _=()=>{l(r,v(this,he),!0),this.paused||window.requestAnimationFrame(_)};(k=e==null?void 0:e.media)==null||k.addEventListener("playing",()=>{_()})}e==null||e.addEventListener("userinactivechange",()=>{let _=e==null?void 0:e.hasAttribute("user-inactive");v(this,he)!==_&&(B(this,he,_),l(r,v(this,he)))})};function ve(t,i){return t.media?t.media.getAttribute(i):t.getAttribute(i)}M.customElements.get("mux-player")||(M.customElements.define("mux-player",Lt),M.MuxPlayerElement=Lt);var dd=Lt;
1700
+ </${Ra((rr=ka(t.theme))!=null?rr:"media-theme-mux")}>
1701
+ `};var St=require("@mux/mux-video");function bi(t,i,e,a,r){var l,c,m;let n={},s={};switch(t.code){case St.MediaError.MEDIA_ERR_NETWORK:{switch(n.title=A("Network Error",r),n.message=t.message,(l=t.data)==null?void 0:l.response.code){case 412:{n.title=A("Video is not currently available",r),n.message=A("The live stream or video file are not yet ready.",r),s.message=A("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=A("Video does not exist",r),n.message="",s.message=A("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=A("Invalid playback URL",r),n.message=A("The video URL or playback-token are formatted with incorrect or incomplete information.",r),s.message=A("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:f,aud:_,sub:S}=ge(a),y=Date.now()>f*1e3,W=S!==e,P=_!=="v",U={timeStyle:"medium",dateStyle:"medium"};if(y){n.title=A("Video URL has expired",r),n.message=A("The video\u2019s secured playback-token has expired.",r),s.message=A("This playback is using signed URLs and the playback-token has expired. Expired at: {expiredDate}. Current time: {currentDate}.",r).format({expiredDate:new Intl.DateTimeFormat(Ce.code,U).format(f*1e3),currentDate:new Intl.DateTimeFormat(Ce.code,U).format(Date.now())}),s.file="403-expired-token.md";break}if(W){n.title=A("Video URL is formatted incorrectly",r),n.message=A("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),s.message=A("The specified playback ID {playbackId} and the playback ID encoded in the playback-token {tokenPlaybackId} do not match.",r).format({playbackId:e,tokenPlaybackId:S}),s.file="403-playback-id-mismatch.md";break}if(P){n.title=A("Video URL is formatted incorrectly",r),n.message=A("The playback-token is formatted with incorrect information.",r),s.message=A("The playback-token has an incorrect aud value: {tokenType}. aud value should be v.",r).format({tokenType:_}),s.file="403-incorrect-aud-value.md";break}s.message=A("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 St.MediaError.MEDIA_ERR_DECODE:{let{message:f}=t;n={title:A("Media Error",r),message:f},s.file="media-decode-error.md";break}case St.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:{let f=(m=(c=t.data)==null?void 0:c.response)==null?void 0:m.code;if(f>=400&&f<500){t.code=St.MediaError.MEDIA_ERR_NETWORK,t.data={response:{code:f}},{dialog:n,devlog:s}=bi(t,i,e,a);break}n={title:A("Source Not Supported",r),message:t.message},s.file="media-src-not-supported.md";break}default:n={title:A("Error",r),message:t.message};break}return i&&(n={title:A("Your device appears to be offline",r),message:A("Check your internet connection and try reloading this video.",r)}),{dialog:n,devlog:s}}var td=Object.values(M.StreamTypes),id=700,ad=300,Ua={LG:"large",SM:"small",XS:"extra-small"};function Ei(t){let i=t.getBoundingClientRect();return i.width<ad?Ua.XS:i.width<id?Ua.SM:Ua.LG}var pe={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",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 rd(t,i){var a,r;return{src:!t.playbackId&&t.src,playbackId:t.playbackId,hasSrc:!!t.playbackId||!!t.src,poster:t.poster,storyboard:t.storyboard,placeholder:t.getAttribute("placeholder"),theme:t.getAttribute("theme"),thumbnailTime:!t.tokens.thumbnail&&t.thumbnailTime,autoplay:t.autoplay,crossOrigin:t.crossOrigin,loop:t.loop,noHotKeys:t.hasAttribute(E.NOHOTKEYS),hotKeys:t.getAttribute(E.HOTKEYS),muted:t.muted,paused:t.paused,preload:t.preload,envKey:t.envKey,experimentalCmcd:t.experimentalCmcd,preferCmcd:t.preferCmcd,debug:t.debug,disableCookies:t.disableCookies,tokens:t.tokens,beaconCollectionDomain:t.beaconCollectionDomain,metadata:t.metadata,playerSoftwareName:t.playerSoftwareName,playerSoftwareVersion:t.playerSoftwareVersion,startTime:t.startTime,preferPlayback:t.preferPlayback,audio:t.audio,streamType:t.streamType,primaryColor:t.primaryColor,secondaryColor:t.secondaryColor,forwardSeekOffset:t.forwardSeekOffset,backwardSeekOffset:t.backwardSeekOffset,defaultHiddenCaptions:t.defaultHiddenCaptions,defaultShowRemainingTime:t.defaultShowRemainingTime,playbackRates:t.getAttribute(E.PLAYBACK_RATES),customDomain:(a=t.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?a:void 0,playerSize:Ei((r=t.mediaController)!=null?r:t),metadataVideoId:t.getAttribute(g.Attributes.METADATA_VIDEO_ID),metadataVideoTitle:t.getAttribute(g.Attributes.METADATA_VIDEO_TITLE),metadataViewerUserId:t.getAttribute(g.Attributes.METADATA_VIEWER_USER_ID),title:t.getAttribute(E.TITLE),...i}}var nd=Object.values(g.Attributes),od=Object.values(pe),sd=Object.values(E),ld=ai(),dd="mux-player",xo={dialog:void 0,isDialogOpen:!1,inLiveWindow:!1},Ue,Ct,be,wt,Je,te,et,fi,Ie,Xe,tt,gi,xt,Oa,vi,Do,Ai,Ro,_i,Po,yi,Uo,Ti,Oo,Ii,No,Lt=class extends Ca{constructor(){super();T(this,et);T(this,Ie);T(this,tt);T(this,xt);T(this,vi);T(this,Ai);T(this,_i);T(this,yi);T(this,Ti);T(this,Ii);T(this,Ue,!1);T(this,Ct,{});T(this,be,!0);T(this,wt,new ii(this,"hotkeys"));T(this,Je,void 0);T(this,te,{...xo,onCloseErrorDialog:()=>I(this,Ie,Xe).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:e=>{Ta(this,Z.activeElement)||e.preventDefault()},onSeekToLive:()=>Sa(this)});this.attachShadow({mode:"open"}),this.isConnected&&I(this,et,fi).call(this)}static get observedAttributes(){var e;return[...(e=Ca.observedAttributes)!=null?e:[],...od,...nd,...sd]}get theme(){var e,a;return Array.from((a=(e=this.shadowRoot)==null?void 0:e.children)!=null?a:[]).find(({localName:r})=>r.startsWith("media-theme-"))}get mediaController(){var e,a;return(a=(e=this.theme)==null?void 0:e.shadowRoot)==null?void 0:a.querySelector("media-controller")}connectedCallback(){I(this,xt,Oa).call(this),I(this,vi,Do).call(this)}disconnectedCallback(){I(this,Ai,Ro).call(this)}attributeChangedCallback(e,a,r){switch(v(this,Ue)||I(this,et,fi).call(this),super.attributeChangedCallback(e,a,r),e){case E.HOTKEYS:v(this,wt).value=r;break;case E.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&ve(A("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case E.THUMBNAIL_TOKEN:{let{aud:s}=ge(r);r&&s!=="t"&&ve(A("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:s}));break}case E.STORYBOARD_TOKEN:{let{aud:s}=ge(r);r&&s!=="s"&&ve(A("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(A("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&&!td.includes(this.streamType)&&ri({file:"invalid-stream-type.md",message:A("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})}):ri({file:"invalid-stream-type.md",message:String(A("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,pe.SRC,E.PLAYBACK_TOKEN].includes(e)&&a!==r&&$(this,te,{...v(this,te),...xo}),I(this,tt,gi).call(this,{[In(e)]:r})}get experimentalCmcd(){return this.hasAttribute(g.Attributes.EXPERIMENTAL_CMCD)}set experimentalCmcd(e){!!e!==this.experimentalCmcd&&(e?this.setAttribute(g.Attributes.EXPERIMENTAL_CMCD,""):this.removeAttribute(g.Attributes.EXPERIMENTAL_CMCD))}get preferCmcd(){var e;return(e=this.getAttribute(g.Attributes.PREFER_CMCD))!=null?e:void 0}set preferCmcd(e){e!==this.preferCmcd&&(e?M.CmcdTypeValues.includes(e)?this.setAttribute(g.Attributes.PREFER_CMCD,e):ve(`Invalid value for preferCmcd. Must be one of ${M.CmcdTypeValues.join()}`):this.removeAttribute(g.Attributes.PREFER_CMCD))}get hasPlayed(){var e,a;return(a=(e=this.mediaController)==null?void 0:e.hasAttribute("media-has-played"))!=null?a:!1}get inLiveWindow(){return v(this,te).inLiveWindow}get _hls(){var e;return(e=this.media)==null?void 0:e._hls}get mux(){var e;return(e=this.media)==null?void 0:e.mux}get playbackId(){var e;return(e=this.getAttribute(g.Attributes.PLAYBACK_ID))!=null?e:void 0}set playbackId(e){e?this.setAttribute(g.Attributes.PLAYBACK_ID,e):this.removeAttribute(g.Attributes.PLAYBACK_ID)}get src(){var e,a;return this.playbackId?(e=Te(this,pe.SRC))!=null?e:void 0:(a=this.getAttribute(pe.SRC))!=null?a:void 0}set src(e){e?this.setAttribute(pe.SRC,e):this.removeAttribute(pe.SRC)}get poster(){var a;let e=this.getAttribute(pe.POSTER);if(e!=null)return e;if(this.playbackId&&!this.audio)return yn(this.playbackId,{domain:this.customDomain,thumbnailTime:(a=this.thumbnailTime)!=null?a:this.startTime,token:this.tokens.thumbnail})}set poster(e){e||e===""?this.setAttribute(pe.POSTER,e):this.removeAttribute(pe.POSTER)}get storyboard(){if(this.playbackId&&!this.audio&&(!this.streamType||![M.StreamTypes.LIVE,M.StreamTypes.LL_LIVE,M.StreamTypes.DVR,M.StreamTypes.LL_DVR].includes(this.streamType)))return Tn(this.playbackId,{domain:this.customDomain,token:this.tokens.storyboard})}get audio(){return this.hasAttribute(E.AUDIO)}set audio(e){if(!e){this.removeAttribute(E.AUDIO);return}this.setAttribute(E.AUDIO,"")}get hotkeys(){return v(this,wt)}get nohotkeys(){return this.hasAttribute(E.NOHOTKEYS)}set nohotkeys(e){if(!e){this.removeAttribute(E.NOHOTKEYS);return}this.setAttribute(E.NOHOTKEYS,"")}get thumbnailTime(){return ne(this.getAttribute(E.THUMBNAIL_TIME))}set thumbnailTime(e){this.setAttribute(E.THUMBNAIL_TIME,`${e}`)}get title(){var e;return(e=this.getAttribute(E.TITLE))!=null?e:""}set title(e){e!==this.title&&(e?this.setAttribute(E.TITLE,e):this.removeAttribute("title"),super.title=e)}get placeholder(){var e;return(e=Te(this,E.PLACEHOLDER))!=null?e:""}set placeholder(e){this.setAttribute(E.PLACEHOLDER,`${e}`)}get primaryColor(){var e;return(e=this.getAttribute(E.PRIMARY_COLOR))!=null?e:void 0}set primaryColor(e){this.setAttribute(E.PRIMARY_COLOR,`${e}`)}get secondaryColor(){var e;return(e=this.getAttribute(E.SECONDARY_COLOR))!=null?e:"rgb(0 0 0 / .65)"}set secondaryColor(e){this.setAttribute(E.SECONDARY_COLOR,`${e}`)}get defaultShowRemainingTime(){return this.hasAttribute(E.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(e){e?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(e=>Number(e)).filter(e=>!Number.isNaN(e)).sort((e,a)=>e-a)}set playbackRates(e){if(!e){this.removeAttribute(E.PLAYBACK_RATES);return}this.setAttribute(E.PLAYBACK_RATES,e.join(" "))}get forwardSeekOffset(){var e;return(e=ne(this.getAttribute(E.FORWARD_SEEK_OFFSET)))!=null?e:10}set forwardSeekOffset(e){this.setAttribute(E.FORWARD_SEEK_OFFSET,`${e}`)}get backwardSeekOffset(){var e;return(e=ne(this.getAttribute(E.BACKWARD_SEEK_OFFSET)))!=null?e:10}set backwardSeekOffset(e){this.setAttribute(E.BACKWARD_SEEK_OFFSET,`${e}`)}get defaultHiddenCaptions(){return this.hasAttribute(E.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(e){e?this.setAttribute(E.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(E.DEFAULT_HIDDEN_CAPTIONS)}get playerSoftwareName(){var e;return(e=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_NAME))!=null?e:dd}get playerSoftwareVersion(){var e;return(e=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_VERSION))!=null?e:ld}get beaconCollectionDomain(){var e;return(e=this.getAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN))!=null?e:void 0}set beaconCollectionDomain(e){e!==this.beaconCollectionDomain&&(e?this.setAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN,e):this.removeAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN))}get customDomain(){var e;return(e=this.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?e:void 0}set customDomain(e){e!==this.customDomain&&(e?this.setAttribute(g.Attributes.CUSTOM_DOMAIN,e):this.removeAttribute(g.Attributes.CUSTOM_DOMAIN))}get envKey(){var e;return(e=Te(this,g.Attributes.ENV_KEY))!=null?e:void 0}set envKey(e){this.setAttribute(g.Attributes.ENV_KEY,`${e}`)}get debug(){return Te(this,g.Attributes.DEBUG)!=null}set debug(e){e?this.setAttribute(g.Attributes.DEBUG,""):this.removeAttribute(g.Attributes.DEBUG)}get disableCookies(){return Te(this,g.Attributes.DISABLE_COOKIES)!=null}set disableCookies(e){e?this.setAttribute(g.Attributes.DISABLE_COOKIES,""):this.removeAttribute(g.Attributes.DISABLE_COOKIES)}get streamType(){return Te(this,g.Attributes.STREAM_TYPE)}set streamType(e){this.setAttribute(g.Attributes.STREAM_TYPE,`${e}`)}get startTime(){return ne(Te(this,g.Attributes.START_TIME))}set startTime(e){this.setAttribute(g.Attributes.START_TIME,`${e}`)}get preferPlayback(){let e=this.getAttribute(g.Attributes.PREFER_PLAYBACK);if(e===M.PlaybackTypes.MSE||e===M.PlaybackTypes.NATIVE)return e}set preferPlayback(e){e!==this.preferPlayback&&(e===M.PlaybackTypes.MSE||e===M.PlaybackTypes.NATIVE?this.setAttribute(g.Attributes.PREFER_PLAYBACK,e):this.removeAttribute(g.Attributes.PREFER_PLAYBACK))}get metadata(){var e;return(e=this.media)==null?void 0:e.metadata}set metadata(e){if(v(this,Ue)||I(this,et,fi).call(this),!this.media){J("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata=e}get tokens(){let e=this.getAttribute(E.PLAYBACK_TOKEN),a=this.getAttribute(E.THUMBNAIL_TOKEN),r=this.getAttribute(E.STORYBOARD_TOKEN);return{...v(this,Ct),...e!=null?{playback:e}:{},...a!=null?{thumbnail:a}:{},...r!=null?{storyboard:r}:{}}}set tokens(e){$(this,Ct,e!=null?e:{})}get playbackToken(){var e;return(e=this.getAttribute(E.PLAYBACK_TOKEN))!=null?e:void 0}set playbackToken(e){this.setAttribute(E.PLAYBACK_TOKEN,`${e}`)}get thumbnailToken(){var e;return(e=this.getAttribute(E.THUMBNAIL_TOKEN))!=null?e:void 0}set thumbnailToken(e){this.setAttribute(E.THUMBNAIL_TOKEN,`${e}`)}get storyboardToken(){var e;return(e=this.getAttribute(E.STORYBOARD_TOKEN))!=null?e:void 0}set storyboardToken(e){this.setAttribute(E.STORYBOARD_TOKEN,`${e}`)}addTextTrack(e,a,r,n){var l;let s=(l=this.media)==null?void 0:l.nativeEl;if(!!s)return(0,M.addTextTrack)(s,e,a,r,n)}removeTextTrack(e){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(!!a)return(0,M.removeTextTrack)(a,e)}get textTracks(){var e;return(e=this.media)==null?void 0:e.textTracks}};Ue=new WeakMap,Ct=new WeakMap,be=new WeakMap,wt=new WeakMap,Je=new WeakMap,te=new WeakMap,et=new WeakSet,fi=function(){var e,a,r;if(!v(this,Ue)){$(this,Ue,!0),I(this,Ie,Xe).call(this,{playerSize:Ei(this)});try{if(customElements.upgrade(this.theme),!(this.theme instanceof k.HTMLElement))throw""}catch{J(`<${(e=this.theme)==null?void 0:e.localName}> 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 mt))throw""}catch{J("<media-controller> failed to upgrade!")}xn(this),I(this,yi,Uo).call(this),I(this,Ti,Oo).call(this),I(this,_i,Po).call(this),$(this,be,(r=(a=this.mediaController)==null?void 0:a.hasAttribute("user-inactive"))!=null?r:!0),I(this,Ii,No).call(this)}},Ie=new WeakSet,Xe=function(e){Object.assign(v(this,te),e),I(this,tt,gi).call(this)},tt=new WeakSet,gi=function(e={}){di(wo(rd(this,{...v(this,te),...e})),this.shadowRoot)},xt=new WeakSet,Oa=function(){var e,a;v(this,te).playerSize!=Ei((e=this.mediaController)!=null?e:this)&&I(this,Ie,Xe).call(this,{playerSize:Ei((a=this.mediaController)!=null?a:this)})},vi=new WeakSet,Do=function(){var e;$(this,Je,new ResizeObserver(()=>I(this,xt,Oa).call(this))),v(this,Je).observe((e=this.mediaController)!=null?e:this)},Ai=new WeakSet,Ro=function(){var e;(e=v(this,Je))==null||e.disconnect()},_i=new WeakSet,Po=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&&[M.StreamTypes.LIVE,M.StreamTypes.LL_LIVE,M.StreamTypes.DVR,M.StreamTypes.LL_DVR].includes(this.streamType)&&this.hasPlayed&&Sa(this)});let e=()=>{let c=kn(this),m=v(this,te).inLiveWindow;c!==m&&(I(this,Ie,Xe).call(this,{inLiveWindow:c}),this.dispatchEvent(new CustomEvent("inlivewindowchange",{composed:!0,bubbles:!0,detail:this.inLiveWindow})))};(r=this.media)==null||r.addEventListener("progress",e),(n=this.media)==null||n.addEventListener("waiting",e),(s=this.media)==null||s.addEventListener("timeupdate",e),(l=this.media)==null||l.addEventListener("emptied",e)},yi=new WeakSet,Uo=function(){var a;let e=r=>{let{detail:n}=r;if(n instanceof g.MediaError||(n=new g.MediaError(n.message,n.code,n.fatal)),!(n!=null&&n.fatal)){ve(n),n.data&&ve(`${n.name} data:`,n.data);return}let{dialog:s,devlog:l}=bi(n,!window.navigator.onLine,this.playbackId,this.playbackToken);l.message&&ri(l),J(n),n.data&&J(`${n.name} data:`,n.data),I(this,Ie,Xe).call(this,{isDialogOpen:!0,dialog:s})};this.addEventListener("error",e),this.media&&(this.media.errorTranslator=(r={})=>{var s,l,c;if(!((s=this.media)!=null&&s.error))return r;let{devlog:n}=bi((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}))})},Ti=new WeakSet,Oo=function(){var a,r,n,s;let e=()=>I(this,tt,gi).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",e),(s=(n=this.media)==null?void 0:n.textTracks)==null||s.addEventListener("removetrack",e)},Ii=new WeakSet,No=function(){var f,_,S;let e=this.mediaController,a=/.*Version\/.*Safari\/.*/.test(navigator.userAgent);if(a)return;let r,n=new WeakMap,s=()=>this.streamType&&[M.StreamTypes.LIVE,M.StreamTypes.LL_LIVE].includes(this.streamType)&&!this.secondaryColor&&this.offsetWidth>=800,l=(y,W,P=!1)=>{if(s())return;Array.from(y&&y.activeCues||[]).forEach(C=>{if(!(!C.snapToLines||C.line<-5||C.line>=0&&C.line<10))if(!W||this.paused){let ie=C.text.split(`
1702
+ `).length,G=a?-2:-3;this.streamType&&[M.StreamTypes.LIVE,M.StreamTypes.LL_LIVE].includes(this.streamType)&&(G=a?-1:-2);let ae=G-ie;if(C.line===ae&&!P)return;n.has(C)||n.set(C,C.line),C.line=ae-1,C.line=ae}else setTimeout(()=>{C.line=n.get(C)||"auto"},500)})},c=()=>{var y;l(r,(y=e==null?void 0:e.hasAttribute("user-inactive"))!=null?y:!1)},m=()=>{var P;let W=Array.from(((P=e==null?void 0:e.media)==null?void 0:P.textTracks)||[]).filter(U=>["subtitles","captions"].includes(U.kind)&&U.mode==="showing")[0];W!==r&&(r==null||r.removeEventListener("cuechange",c)),r=W,r==null||r.addEventListener("cuechange",c),l(r,v(this,be))};if(m(),(f=e==null?void 0:e.media)==null||f.textTracks.addEventListener("change",m),(_=e==null?void 0:e.media)==null||_.textTracks.addEventListener("addtrack",m),navigator.userAgent.includes("Chrome/")){let y=()=>{l(r,v(this,be),!0),this.paused||window.requestAnimationFrame(y)};(S=e==null?void 0:e.media)==null||S.addEventListener("playing",()=>{y()})}e==null||e.addEventListener("userinactivechange",()=>{let y=e==null?void 0:e.hasAttribute("user-inactive");v(this,be)!==y&&($(this,be,y),l(r,v(this,be)))})};function Te(t,i){return t.media?t.media.getAttribute(i):t.getAttribute(i)}k.customElements.get("mux-player")||(k.customElements.define("mux-player",Lt),k.MuxPlayerElement=Lt);var cd=Lt;