@mux/mux-player 1.11.0 → 1.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +266 -236
- package/dist/index.mjs +62 -62
- package/dist/mux-player.js +346 -304
- package/dist/mux-player.mjs +346 -304
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Il=Object.create;var Ui=Object.defineProperty;var kl=Object.getOwnPropertyDescriptor;var Ml=Object.getOwnPropertyNames;var Sl=Object.getPrototypeOf,wl=Object.prototype.hasOwnProperty;var Ll=(i,e)=>{for(var t in e)Ui(i,t,{get:e[t],enumerable:!0})},ts=(i,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ml(e))!wl.call(i,r)&&r!==t&&Ui(i,r,{get:()=>e[r],enumerable:!(a=kl(e,r))||a.enumerable});return i};var Cl=(i,e,t)=>(t=i!=null?Il(Sl(i)):{},ts(e||!i||!i.__esModule?Ui(t,"default",{value:i,enumerable:!0}):t,i)),Rl=i=>ts(Ui({},"__esModule",{value:!0}),i);var nr=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)};var I=(i,e,t)=>(nr(i,e,"read from private field"),t?t.call(i):e.get(i)),x=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},te=(i,e,t,a)=>(nr(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t);var P=(i,e,t)=>(nr(i,e,"access private method"),t);var Vu={};Ll(Vu,{MediaError:()=>E.MediaError,default:()=>Wu,getVideoAttribute:()=>ht});module.exports=Rl(Vu);var ft=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class i extends ft{}globalThis.DocumentFragment=i}var Gt=class extends ft{},sr=class extends ft{},xl={get(i){},define(i,e,t){},upgrade(i){},whenDefined(i){return Promise.resolve(Gt)}},Zt,or=class{constructor(e,t={}){x(this,Zt,void 0);te(this,Zt,t==null?void 0:t.detail)}get detail(){return I(this,Zt)}initCustomEvent(){}};Zt=new WeakMap;function Dl(i,e){return new Gt}var is={document:{createElement:Dl},DocumentFragment,customElements:xl,CustomEvent:or,EventTarget:ft,HTMLElement:Gt,HTMLVideoElement:sr},as=typeof window=="undefined"||typeof globalThis.customElements=="undefined",O=as?is:globalThis,X=as?is.document:globalThis.document;var p={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_VOLUME_REQUEST:"mediavolumerequest",MEDIA_SEEK_REQUEST:"mediaseekrequest",MEDIA_AIRPLAY_REQUEST:"mediaairplayrequest",MEDIA_ENTER_FULLSCREEN_REQUEST:"mediaenterfullscreenrequest",MEDIA_EXIT_FULLSCREEN_REQUEST:"mediaexitfullscreenrequest",MEDIA_PREVIEW_REQUEST:"mediapreviewrequest",MEDIA_ENTER_PIP_REQUEST:"mediaenterpiprequest",MEDIA_EXIT_PIP_REQUEST:"mediaexitpiprequest",MEDIA_ENTER_CAST_REQUEST:"mediaentercastrequest",MEDIA_EXIT_CAST_REQUEST:"mediaexitcastrequest",MEDIA_SHOW_TEXT_TRACKS_REQUEST:"mediashowtexttracksrequest",MEDIA_HIDE_TEXT_TRACKS_REQUEST:"mediahidetexttracksrequest",MEDIA_SHOW_CAPTIONS_REQUEST:"mediashowcaptionsrequest",MEDIA_SHOW_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_CAPTIONS_REQUEST:"mediadisablecaptionsrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",MEDIA_SEEK_TO_LIVE_REQUEST:"mediaseektoliverequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},qt={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"},v={MEDIA_CHROME_ATTRIBUTES:"media-chrome-attributes",MEDIA_CONTROLLER:"media-controller"},o={MEDIA_AIRPLAY_UNAVAILABLE:"media-airplay-unavailable",MEDIA_FULLSCREEN_UNAVAILABLE:"media-fullscreen-unavailable",MEDIA_PIP_UNAVAILABLE:"media-pip-unavailable",MEDIA_CAST_UNAVAILABLE:"media-cast-unavailable",MEDIA_PAUSED:"media-paused",MEDIA_HAS_PLAYED:"media-has-played",MEDIA_MUTED:"media-muted",MEDIA_VOLUME_LEVEL:"media-volume-level",MEDIA_VOLUME:"media-volume",MEDIA_VOLUME_UNAVAILABLE:"media-volume-unavailable",MEDIA_IS_PIP:"media-is-pip",MEDIA_IS_CASTING:"media-is-casting",MEDIA_CAPTIONS_LIST:"media-captions-list",MEDIA_SUBTITLES_LIST:"media-subtitles-list",MEDIA_CAPTIONS_SHOWING:"media-captions-showing",MEDIA_SUBTITLES_SHOWING:"media-subtitles-showing",MEDIA_IS_FULLSCREEN:"media-is-fullscreen",MEDIA_PLAYBACK_RATE:"media-playback-rate",MEDIA_CURRENT_TIME:"media-current-time",MEDIA_DURATION:"media-duration",MEDIA_SEEKABLE:"media-seekable",MEDIA_PREVIEW_TIME:"media-preview-time",MEDIA_PREVIEW_IMAGE:"media-preview-image",MEDIA_PREVIEW_COORDS:"media-preview-coords",MEDIA_LOADING:"media-loading",MEDIA_BUFFERED:"media-buffered",MEDIA_STREAM_TYPE:"media-stream-type",MEDIA_TARGET_LIVE_WINDOW:"media-target-live-window",MEDIA_TIME_IS_LIVE:"media-time-is-live"},Gu=Object.entries(qt).reduce((i,[e,t])=>{let a=o[e];return a&&(i[t]=a),i},{userinactivechange:"user-inactive"}),rs=Object.entries(o).reduce((i,[e,t])=>{let a=qt[e];return a&&(i[t]=a),i},{"user-inactive":"userinactivechange"}),vt={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},Qe={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var lr={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},Ae={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},se={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var W={AUDIO_PLAYER:()=>"audio player",VIDEO_PLAYER:()=>"video player",VOLUME:()=>"volume",SEEK:()=>"seek",CLOSED_CAPTIONS:()=>"closed captions",PLAYBACK_RATE:({playbackRate:i=1}={})=>`current playback rate ${i}`,PLAYBACK_TIME:()=>"playback time",MEDIA_LOADING:()=>"media loading"},S={PLAY:()=>"play",PAUSE:()=>"pause",MUTE:()=>"mute",UNMUTE:()=>"unmute",AIRPLAY:()=>"air play",ENTER_CAST:()=>"start casting",EXIT_CAST:()=>"stop casting",ENTER_FULLSCREEN:()=>"enter fullscreen mode",EXIT_FULLSCREEN:()=>"exit fullscreen mode",ENTER_PIP:()=>"enter picture in picture mode",EXIT_PIP:()=>"exit picture in picture mode",SEEK_FORWARD_N_SECS:({seekOffset:i=30}={})=>`seek forward ${i} seconds`,SEEK_BACK_N_SECS:({seekOffset:i=30}={})=>`seek back ${i} seconds`,SEEK_LIVE:()=>"seek to live",PLAYING_LIVE:()=>"playing live"},Nl={...W,...S};function Bi(i,e=!1){return i.split("_").map(function(t,a){return(a||e?t[0].toUpperCase():t[0].toLowerCase())+t.slice(1).toLowerCase()}).join("")}function ns(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function ss(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}function $i(i){return typeof i!="string"?!1:!isNaN(i)&&!isNaN(parseFloat(i))}var Hi=i=>new Promise(e=>setTimeout(e,i));var os=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],Pl=(i,e)=>{let t=i===1?os[e].singular:os[e].plural;return`${i} ${t}`},ze=i=>{if(!ss(i))return"";let e=Math.abs(i),t=e!==i,a=new Date(0,0,0,0,0,e,0);return`${[a.getHours(),a.getMinutes(),a.getSeconds()].map((l,u)=>l&&Pl(l,u)).filter(l=>l).join(", ")}${t?" remaining":""}`};function J(i,e){let t=!1;i<0&&(t=!0,i=0-i),i=i<0?0:i;let a=Math.floor(i%60),r=Math.floor(i/60%60),n=Math.floor(i/3600),s=Math.floor(e/60%60),l=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(n=r=a="-"),n=n>0||l>0?n+":":"",r=((n||s>=10)&&r<10?"0"+r:r)+":",a=a<10?"0"+a:a,(t?"-":"")+n+r+a}var Ul=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}});function ls(i=Ul){return Array.from(i).map((e,t)=>[Number(i.start(t).toFixed(3)),Number(i.end(t).toFixed(3))].join(":")).join(" ")}var Wi=(i,e,t=".value")=>{let a=i.querySelector(t);!a||(a.textContent=e)},$l=(i,e)=>{let t=`slot[name="${e}"]`,a=i.shadowRoot.querySelector(t);return a?a.children:[]},Vi=(i,e)=>$l(i,e)[0],Qt=(i,e)=>!i||!e?!1:i.contains(e)?!0:Qt(i,e.getRootNode().host),Xe=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||Xe(i.getRootNode().host,e)};function D(i,e){var t;let a;for(a of i.querySelectorAll("style")){let r;try{r=(t=a.sheet)==null?void 0:t.cssRules}catch{continue}for(let n of r!=null?r:[])if(n.selectorText===e)return n}return a!=null&&a.sheet?(a.sheet.insertRule(`${e}{}`,a.sheet.cssRules.length),a.sheet.cssRules[a.sheet.cssRules.length-1]):{style:{setProperty:()=>{},removeProperty:()=>{}}}}var Fi=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},dr=class{observe(){}},ds={ResizeObserver:dr,HTMLElement:class extends Fi{},DocumentFragment:class extends Fi{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},CustomEvent:function(){},getComputedStyle:function(){}},Hl={createElement:function(){return new ds.HTMLElement},addEventListener(){},removeEventListener(){}},us=typeof window=="undefined"||typeof window.customElements=="undefined",d=us?ds:window,m=us?Hl:window.document;var Wl=Object.defineProperty,Vl=(i,e,t)=>e in i?Wl(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Fl=(i,e,t)=>(Vl(i,typeof e!="symbol"?e+"":e,t),t),cs=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ie=(i,e,t)=>(cs(i,e,"read from private field"),t?t.call(i):e.get(i)),Ki=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Yi=(i,e,t,a)=>(cs(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ce,Gi,Et,Zi,ms=m.createElement("template");ms.innerHTML=`
|
|
1
|
+
"use strict";var Hl=Object.create;var qi=Object.defineProperty;var Wl=Object.getOwnPropertyDescriptor;var Fl=Object.getOwnPropertyNames;var Kl=Object.getPrototypeOf,Yl=Object.prototype.hasOwnProperty;var Gl=(i,e)=>{for(var t in e)qi(i,t,{get:e[t],enumerable:!0})},hs=(i,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Fl(e))!Yl.call(i,r)&&r!==t&&qi(i,r,{get:()=>e[r],enumerable:!(a=Wl(e,r))||a.enumerable});return i};var Zl=(i,e,t)=>(t=i!=null?Hl(Kl(i)):{},hs(e||!i||!i.__esModule?qi(t,"default",{value:i,enumerable:!0}):t,i)),ql=i=>hs(qi({},"__esModule",{value:!0}),i);var fr=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)};var k=(i,e,t)=>(fr(i,e,"read from private field"),t?t.call(i):e.get(i)),V=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},le=(i,e,t,a)=>(fr(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t);var Y=(i,e,t)=>(fr(i,e,"access private method"),t);var rc={};Gl(rc,{MediaError:()=>g.MediaError,default:()=>ac,getVideoAttribute:()=>It});module.exports=ql(rc);var Mt=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class i extends Mt{}globalThis.DocumentFragment=i}var oi=class extends Mt{},gr=class extends Mt{},Ql={get(i){},define(i,e,t){},upgrade(i){},whenDefined(i){return Promise.resolve(oi)}},li,Ar=class{constructor(e,t={}){V(this,li,void 0);le(this,li,t==null?void 0:t.detail)}get detail(){return k(this,li)}initCustomEvent(){}};li=new WeakMap;function zl(i,e){return new oi}var ps={document:{createElement:zl},DocumentFragment,customElements:Ql,CustomEvent:Ar,EventTarget:Mt,HTMLElement:oi,HTMLVideoElement:gr},Es=typeof window=="undefined"||typeof globalThis.customElements=="undefined",W=Es?ps:globalThis,se=Es?ps.document:globalThis.document;var b={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_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",MEDIA_SEEK_TO_LIVE_REQUEST:"mediaseektoliverequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},Lt={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_SUBTITLES_LIST:"mediasubtitleslistchange",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",BREAKPOINTS_CHANGE:"breakpointchange"},v={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},o={MEDIA_AIRPLAY_UNAVAILABLE:"mediaairplayunavailable",MEDIA_FULLSCREEN_UNAVAILABLE:"mediafullscreenunavailable",MEDIA_PIP_UNAVAILABLE:"mediapipunavailable",MEDIA_CAST_UNAVAILABLE:"mediacastunavailable",MEDIA_PAUSED:"mediapaused",MEDIA_HAS_PLAYED:"mediahasplayed",MEDIA_ENDED:"mediaended",MEDIA_MUTED:"mediamuted",MEDIA_VOLUME_LEVEL:"mediavolumelevel",MEDIA_VOLUME:"mediavolume",MEDIA_VOLUME_UNAVAILABLE:"mediavolumeunavailable",MEDIA_IS_PIP:"mediaispip",MEDIA_IS_CASTING:"mediaiscasting",MEDIA_SUBTITLES_LIST:"mediasubtitleslist",MEDIA_SUBTITLES_SHOWING:"mediasubtitlesshowing",MEDIA_IS_FULLSCREEN:"mediaisfullscreen",MEDIA_PLAYBACK_RATE:"mediaplaybackrate",MEDIA_CURRENT_TIME:"mediacurrenttime",MEDIA_DURATION:"mediaduration",MEDIA_SEEKABLE:"mediaseekable",MEDIA_PREVIEW_TIME:"mediapreviewtime",MEDIA_PREVIEW_IMAGE:"mediapreviewimage",MEDIA_PREVIEW_COORDS:"mediapreviewcoords",MEDIA_LOADING:"medialoading",MEDIA_BUFFERED:"mediabuffered",MEDIA_STREAM_TYPE:"mediastreamtype",MEDIA_TARGET_LIVE_WINDOW:"mediatargetlivewindow",MEDIA_TIME_IS_LIVE:"mediatimeislive"},lc=Object.entries(Lt).reduce((i,[e,t])=>{let a=o[e];return a&&(i[t]=a),i},{userinactivechange:"userinactive"}),bs=Object.entries(o).reduce((i,[e,t])=>{let a=Lt[e];return a&&(i[t]=a),i},{userinactive:"userinactivechange"}),wt={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},Qi={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var _r={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},Me={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},he={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var q={AUDIO_PLAYER:()=>"audio player",VIDEO_PLAYER:()=>"video player",VOLUME:()=>"volume",SEEK:()=>"seek",CLOSED_CAPTIONS:()=>"closed captions",PLAYBACK_RATE:({playbackRate:i=1}={})=>`current playback rate ${i}`,PLAYBACK_TIME:()=>"playback time",MEDIA_LOADING:()=>"media loading"},R={PLAY:()=>"play",PAUSE:()=>"pause",MUTE:()=>"mute",UNMUTE:()=>"unmute",AIRPLAY:()=>"air play",ENTER_CAST:()=>"start casting",EXIT_CAST:()=>"stop casting",ENTER_FULLSCREEN:()=>"enter fullscreen mode",EXIT_FULLSCREEN:()=>"exit fullscreen mode",ENTER_PIP:()=>"enter picture in picture mode",EXIT_PIP:()=>"exit picture in picture mode",SEEK_FORWARD_N_SECS:({seekOffset:i=30}={})=>`seek forward ${i} seconds`,SEEK_BACK_N_SECS:({seekOffset:i=30}={})=>`seek back ${i} seconds`,SEEK_LIVE:()=>"seek to live",PLAYING_LIVE:()=>"playing live"},Jl={...q,...R};function zi(i,e=!1){return i.split("_").map(function(t,a){return(a||e?t[0].toUpperCase():t[0].toLowerCase())+t.slice(1).toLowerCase()}).join("")}function vs(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function fs(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}function Xi(i){return typeof i!="string"?!1:!isNaN(i)&&!isNaN(parseFloat(i))}var Ji=i=>new Promise(e=>setTimeout(e,i));var gs=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],jl=(i,e)=>{let t=i===1?gs[e].singular:gs[e].plural;return`${i} ${t}`},rt=i=>{if(!fs(i))return"";let e=Math.abs(i),t=e!==i,a=new Date(0,0,0,0,0,e,0);return`${[a.getHours(),a.getMinutes(),a.getSeconds()].map((l,u)=>l&&jl(l,u)).filter(l=>l).join(", ")}${t?" remaining":""}`};function ve(i,e){let t=!1;i<0&&(t=!0,i=0-i),i=i<0?0:i;let a=Math.floor(i%60),r=Math.floor(i/60%60),n=Math.floor(i/3600),s=Math.floor(e/60%60),l=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(n=r=a="-"),n=n>0||l>0?n+":":"",r=((n||s>=10)&&r<10?"0"+r:r)+":",a=a<10?"0"+a:a,(t?"-":"")+n+r+a}var ed=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}});function As(i=ed){return Array.from(i).map((e,t)=>[Number(i.start(t).toFixed(3)),Number(i.end(t).toFixed(3))].join(":")).join(" ")}var _s=(i,e,t=".value")=>{let a=i.querySelector(t);!a||(a.textContent=e)},id=(i,e)=>{let t=`slot[name="${e}"]`,a=i.shadowRoot.querySelector(t);return a?a.children:[]},ys=(i,e)=>id(i,e)[0],di=(i,e)=>!i||!e?!1:i.contains(e)?!0:di(i,e.getRootNode().host),nt=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||nt(i.getRootNode().host,e)};function L(i,e){var t;let a;for(a of i.querySelectorAll("style")){let r;try{r=(t=a.sheet)==null?void 0:t.cssRules}catch{continue}for(let n of r!=null?r:[])if(n.selectorText===e)return n}return a!=null&&a.sheet?(a.sheet.insertRule(`${e}{}`,a.sheet.cssRules.length),a.sheet.cssRules[a.sheet.cssRules.length-1]):{style:{setProperty:()=>{},removeProperty:()=>{}}}}function O(i,e){let t=i.getAttribute(e);return t!=null?+t:void 0}function P(i,e,t){if(O(i,e)!=t){if(t==null){i.removeAttribute(e);return}i.setAttribute(e,`${+t}`)}}function w(i,e){return i.hasAttribute(e)}function D(i,e,t){if(w(i,e)!=t){if(t==null){i.removeAttribute(e);return}i.toggleAttribute(e,t)}}function H(i,e){var t;return(t=i.getAttribute(e))!=null?t:void 0}function F(i,e,t){if(H(i,e)!=t){if(t==null){i.removeAttribute(e);return}i.setAttribute(e,`${t}`)}}var ji=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},yr=class{observe(){}},Ts={ResizeObserver:yr,HTMLElement:class extends ji{},DocumentFragment:class extends ji{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},CustomEvent:function(){},getComputedStyle:function(){}},ad={createElement:function(){return new Ts.HTMLElement},addEventListener(){},removeEventListener(){}},Is=typeof window=="undefined"||typeof window.customElements=="undefined",d=Is?Ts:window,c=Is?ad:window.document;var rd=Object.defineProperty,nd=(i,e,t)=>e in i?rd(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,sd=(i,e,t)=>(nd(i,typeof e!="symbol"?e+"":e,t),t),ks=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},de=(i,e,t)=>(ks(i,e,"read from private field"),t?t.call(i):e.get(i)),ea=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ta=(i,e,t,a)=>(ks(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),fe,ia,Ct,aa,Ss=c.createElement("template");Ss.innerHTML=`
|
|
2
2
|
<style>
|
|
3
3
|
:host {
|
|
4
4
|
font: var(--media-font,
|
|
@@ -46,38 +46,38 @@
|
|
|
46
46
|
min-width: 100%;
|
|
47
47
|
}
|
|
48
48
|
</style>
|
|
49
|
-
`;var
|
|
49
|
+
`;var C=class extends d.HTMLElement{constructor(e={}){if(super(),ea(this,fe,void 0),sd(this,"preventClick",!1),ea(this,ia,a=>{this.preventClick||this.handleClick(a)}),ea(this,Ct,a=>{let{key:r}=a;if(!this.keysUsed.includes(r)){this.removeEventListener("keyup",de(this,Ct));return}this.preventClick||this.handleClick(a)}),ea(this,aa,a=>{let{metaKey:r,altKey:n,key:s}=a;if(r||n||!this.keysUsed.includes(s)){this.removeEventListener("keyup",de(this,Ct));return}this.addEventListener("keyup",de(this,Ct),{once:!0})}),!this.shadowRoot){this.attachShadow({mode:"open"});let a=Ss.content.cloneNode(!0);this.nativeEl=a;let r=e.slotTemplate;r||(r=c.createElement("template"),r.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),this.shadowRoot.appendChild(a)}let{style:t}=L(this.shadowRoot,":host");t.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`)}static get observedAttributes(){return["disabled",v.MEDIA_CONTROLLER]}enable(){this.addEventListener("click",de(this,ia)),this.addEventListener("keydown",de(this,aa)),this.tabIndex=0}disable(){this.removeEventListener("click",de(this,ia)),this.removeEventListener("keydown",de(this,aa)),this.removeEventListener("keyup",de(this,Ct)),this.tabIndex=-1}attributeChangedCallback(e,t,a){var r,n,s,l,u;e===v.MEDIA_CONTROLLER?(t&&((n=(r=de(this,fe))==null?void 0:r.unassociateElement)==null||n.call(r,this),ta(this,fe,null)),a&&(ta(this,fe,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=de(this,fe))==null?void 0:l.associateElement)==null||u.call(l,this))):e==="disabled"&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){var e,t,a;this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","button");let r=this.getAttribute(v.MEDIA_CONTROLLER);r&&(ta(this,fe,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=de(this,fe))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;this.disable(),(t=(e=de(this,fe))==null?void 0:e.unassociateElement)==null||t.call(e,this),ta(this,fe,null)}get keysUsed(){return["Enter"," "]}handleClick(e){}};fe=new WeakMap;ia=new WeakMap;Ct=new WeakMap;aa=new WeakMap;d.customElements.get("media-chrome-button")||d.customElements.define("media-chrome-button",C);var od=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
50
50
|
<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"/>
|
|
51
51
|
</svg>
|
|
52
|
-
`,
|
|
53
|
-
<slot name="airplay">${
|
|
54
|
-
`;var
|
|
52
|
+
`,Ms=c.createElement("template");Ms.innerHTML=`
|
|
53
|
+
<slot name="airplay">${od}</slot>
|
|
54
|
+
`;var Tr=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_AIRPLAY_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Ms,...e})}connectedCallback(){this.setAttribute("aria-label",R.AIRPLAY()),super.connectedCallback()}get mediaAirplayUnavailable(){return H(this,o.MEDIA_AIRPLAY_UNAVAILABLE)}set mediaAirplayUnavailable(e){F(this,o.MEDIA_AIRPLAY_UNAVAILABLE,e)}handleClick(){let e=new d.CustomEvent(b.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};d.customElements.get("media-airplay-button")||d.customElements.define("media-airplay-button",Tr);var ld='<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/></g></svg>',dd='<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/><path class="cast_caf_icon_boxfill" d="M5,7 L5,8.63 C8,8.6 13.37,14 13.37,17 L19,17 L19,7 Z"/></g></svg>',ws=c.createElement("template");ws.innerHTML=`
|
|
55
55
|
<style>
|
|
56
|
-
:host([${o.MEDIA_IS_CASTING}]) slot:not([name=exit])
|
|
57
|
-
:host([${o.MEDIA_IS_CASTING}]) ::slotted(:not([slot=exit])) {
|
|
56
|
+
:host([${o.MEDIA_IS_CASTING}]) slot:not([name=exit]):not([name=icon]) {
|
|
58
57
|
display: none !important;
|
|
59
58
|
}
|
|
60
59
|
|
|
61
60
|
|
|
62
|
-
:host(:not([${o.MEDIA_IS_CASTING}])) slot:not([name=enter])
|
|
63
|
-
:host(:not([${o.MEDIA_IS_CASTING}])) ::slotted(:not([slot=enter])) {
|
|
61
|
+
:host(:not([${o.MEDIA_IS_CASTING}])) slot:not([name=enter]):not([name=icon]) {
|
|
64
62
|
display: none !important;
|
|
65
63
|
}
|
|
66
64
|
</style>
|
|
67
65
|
|
|
68
|
-
<slot name="
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
<slot name="icon">
|
|
67
|
+
<slot name="enter">${ld}</slot>
|
|
68
|
+
<slot name="exit">${dd}</slot>
|
|
69
|
+
</slot>
|
|
70
|
+
`;var Ls=i=>{let t=i.getAttribute(o.MEDIA_IS_CASTING)!=null?R.EXIT_CAST():R.ENTER_CAST();i.setAttribute("aria-label",t)},Ir=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_CASTING,o.MEDIA_CAST_UNAVAILABLE]}constructor(e={}){super({slotTemplate:ws,...e})}connectedCallback(){Ls(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_IS_CASTING&&Ls(this),super.attributeChangedCallback(e,t,a)}get mediaIsCasting(){return w(this,o.MEDIA_IS_CASTING)}set mediaIsCasting(e){D(this,o.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return H(this,o.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){F(this,o.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){let e=this.mediaIsCasting?b.MEDIA_EXIT_CAST_REQUEST:b.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-cast-button")||d.customElements.define("media-cast-button",Ir);var Cs=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ke=(i,e,t)=>(Cs(i,e,"read from private field"),t?t.call(i):e.get(i)),ud=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ra=(i,e,t,a)=>(Cs(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),te,Rs=c.createElement("template");Rs.innerHTML=`
|
|
71
71
|
<style>
|
|
72
72
|
:host {
|
|
73
73
|
display: var(--media-control-display, var(--media-gesture-receiver-display, inline-block));
|
|
74
74
|
box-sizing: border-box;
|
|
75
75
|
}
|
|
76
76
|
</style>
|
|
77
|
-
`;var
|
|
77
|
+
`;var kr=class extends d.HTMLElement{constructor(e={}){if(super(),ud(this,te,void 0),!this.shadowRoot){let t=this.attachShadow({mode:"open"}),a=Rs.content.cloneNode(!0);this.nativeEl=a;let r=e.slotTemplate;r||(r=c.createElement("template"),r.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),t.appendChild(a)}}static get observedAttributes(){return[v.MEDIA_CONTROLLER,o.MEDIA_PAUSED]}attributeChangedCallback(e,t,a){var r,n,s,l,u;e===v.MEDIA_CONTROLLER&&(t&&((n=(r=Ke(this,te))==null?void 0:r.unassociateElement)==null||n.call(r,this),ra(this,te,null)),a&&(ra(this,te,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=Ke(this,te))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,t,a,r;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),ra(this,te,cd(this)),this.getAttribute(v.MEDIA_CONTROLLER)&&((t=(e=Ke(this,te))==null?void 0:e.associateElement)==null||t.call(e,this)),(a=Ke(this,te))==null||a.addEventListener("pointerdown",this),(r=Ke(this,te))==null||r.addEventListener("click",this)}disconnectedCallback(){var e,t,a,r;this.getAttribute(v.MEDIA_CONTROLLER)&&((t=(e=Ke(this,te))==null?void 0:e.unassociateElement)==null||t.call(e,this)),(a=Ke(this,te))==null||a.removeEventListener("pointerdown",this),(r=Ke(this,te))==null||r.removeEventListener("click",this),ra(this,te,null)}handleEvent(e){var t;let a=(t=e.composedPath())==null?void 0:t[0];if(!!["video","media-controller"].includes(a==null?void 0:a.localName)){if(e.type==="pointerdown")this._pointerType=e.pointerType;else if(e.type==="click"){let{clientX:n,clientY:s}=e,{left:l,top:u,width:m,height:p}=this.getBoundingClientRect(),f=n-l,A=s-u;if(f<0||A<0||f>m||A>p||m===0&&p===0)return;let{pointerType:T=this._pointerType}=e;if(this._pointerType=void 0,T===_r.TOUCH){this.handleTap(e);return}else if(T===_r.MOUSE){this.handleMouseClick(e);return}}}}get mediaPaused(){return w(this,o.MEDIA_PAUSED)}set mediaPaused(e){D(this,o.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(e){let t=this.mediaPaused?b.MEDIA_PLAY_REQUEST:b.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(t,{composed:!0,bubbles:!0}))}};te=new WeakMap;function cd(i){var e;let t=i.getAttribute(v.MEDIA_CONTROLLER);return t?(e=i.getRootNode())==null?void 0:e.getElementById(t):nt(i,"media-controller")}d.customElements.get("media-gesture-receiver")||d.customElements.define("media-gesture-receiver",kr);var S={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive"},Ds=c.createElement("template");Ds.innerHTML=`
|
|
78
78
|
<style>
|
|
79
79
|
|
|
80
|
-
:host([
|
|
80
|
+
:host([${o.MEDIA_IS_FULLSCREEN}]) ::slotted([slot=media]) {
|
|
81
81
|
outline: none;
|
|
82
82
|
}
|
|
83
83
|
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
background-color: var(--media-background-color, #000);
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
:host(:not([
|
|
92
|
+
:host(:not([${S.AUDIO}])) [part~=layer]:not([part~=media-layer]) {
|
|
93
93
|
position: absolute;
|
|
94
94
|
top: 0;
|
|
95
95
|
left: 0;
|
|
@@ -102,15 +102,24 @@
|
|
|
102
102
|
background: none;
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
+
slot[name=media] {
|
|
106
|
+
display: var(--media-slot-display, contents);
|
|
107
|
+
}
|
|
108
|
+
|
|
105
109
|
|
|
106
|
-
:host([
|
|
110
|
+
:host([${S.AUDIO}]) slot[name=media] {
|
|
111
|
+
display: var(--media-slot-display, none);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
:host([${S.AUDIO}]) [part~=layer][part~=gesture-layer] {
|
|
107
116
|
height: 0;
|
|
108
117
|
display: block;
|
|
109
118
|
}
|
|
110
119
|
|
|
111
120
|
|
|
112
|
-
:host(:not([
|
|
113
|
-
:host(:not([
|
|
121
|
+
:host(:not([${S.AUDIO}])[${S.GESTURES_DISABLED}]) ::slotted([slot=gestures-chrome]),
|
|
122
|
+
:host(:not([${S.AUDIO}])[${S.GESTURES_DISABLED}]) media-gesture-receiver[slot=gestures-chrome] {
|
|
114
123
|
display: none;
|
|
115
124
|
}
|
|
116
125
|
|
|
@@ -119,13 +128,13 @@
|
|
|
119
128
|
pointer-events: auto;
|
|
120
129
|
}
|
|
121
130
|
|
|
122
|
-
:host(:not([
|
|
131
|
+
:host(:not([${S.AUDIO}])) *[part~=layer][part~=centered-layer] {
|
|
123
132
|
align-items: center;
|
|
124
133
|
justify-content: center;
|
|
125
134
|
}
|
|
126
135
|
|
|
127
|
-
:host(:not([
|
|
128
|
-
:host(:not([
|
|
136
|
+
:host(:not([${S.AUDIO}])) ::slotted(media-gesture-receiver[slot=gestures-chrome]),
|
|
137
|
+
:host(:not([${S.AUDIO}])) media-gesture-receiver[slot=gestures-chrome] {
|
|
129
138
|
align-self: stretch;
|
|
130
139
|
flex-grow: 1;
|
|
131
140
|
}
|
|
@@ -145,7 +154,7 @@
|
|
|
145
154
|
}
|
|
146
155
|
|
|
147
156
|
|
|
148
|
-
:host(:not([
|
|
157
|
+
:host(:not([${S.AUDIO}])) .spacer {
|
|
149
158
|
flex-grow: 1;
|
|
150
159
|
}
|
|
151
160
|
|
|
@@ -157,13 +166,13 @@
|
|
|
157
166
|
}
|
|
158
167
|
|
|
159
168
|
|
|
160
|
-
::slotted(:not([slot=media]):not([
|
|
169
|
+
::slotted(:not([slot=media]):not([${S.NO_AUTOHIDE}])) {
|
|
161
170
|
opacity: 1;
|
|
162
171
|
transition: opacity 0.25s;
|
|
163
172
|
}
|
|
164
173
|
|
|
165
174
|
|
|
166
|
-
:host([
|
|
175
|
+
:host([${S.USER_INACTIVE}]:not([${o.MEDIA_PAUSED}]):not([${o.MEDIA_IS_CASTING}]):not([${S.AUDIO}])) ::slotted(:not([slot=media]):not([${S.NO_AUTOHIDE}])) {
|
|
167
176
|
opacity: 0;
|
|
168
177
|
transition: opacity 1s;
|
|
169
178
|
}
|
|
@@ -189,7 +198,7 @@
|
|
|
189
198
|
|
|
190
199
|
<slot part="bottom chrome"></slot>
|
|
191
200
|
</span>
|
|
192
|
-
`;var Ql=Object.values(o),zl="sm:384 md:576 lg:768 xl:960",Xl=i=>{var e;for(let t of i){let a=t.target;if(!a.isConnected)continue;let r=(e=a.getAttribute("breakpoints"))!=null?e:zl,n=Jl(r),s=jl(n,t.contentRect);Object.keys(n).forEach(l=>{if(s.includes(l)){a.hasAttribute(`breakpoint-${l}`)||a.setAttribute(`breakpoint-${l}`,"");return}a.removeAttribute(`breakpoint-${l}`)})}};function Jl(i){let e=i.split(/\s+/);return Object.fromEntries(e.map(t=>t.split(":")))}function jl(i,e){return Object.keys(i).filter(t=>e.width>=i[t])}var zi=class extends d.HTMLElement{constructor(){super(),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Es.content.cloneNode(!0)));let e=s=>{let l=this.media;for(let u of s)u.type==="childList"&&(u.removedNodes.forEach(c=>{if(c.slot=="media"&&u.target==this){let f=u.previousSibling&&u.previousSibling.previousElementSibling;if(!f||!l)this.mediaUnsetCallback(c);else{let A=f.slot!=="media";for(;(f=f.previousSibling)!==null;)f.slot=="media"&&(A=!1);A&&this.mediaUnsetCallback(c)}}}),l&&u.addedNodes.forEach(c=>{c==l&&this.handleMediaUpdated(l).then(f=>this.mediaSetCallback(f))}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0});let a=new ResizeObserver(Xl);this.resizeObserver=a,a.observe(this);let r=this.media,n=this.querySelector(":scope > slot[slot=media]");n&&n.addEventListener("slotchange",()=>{if(!n.assignedElements({flatten:!0}).length){this.mediaUnsetCallback(r);return}this.media&&(r=this.media,this.handleMediaUpdated(this.media).then(l=>this.mediaSetCallback(l)))})}static get observedAttributes(){return["autohide","gestures-disabled"].concat(Ql)}attributeChangedCallback(e,t,a){e.toLowerCase()=="autohide"&&(this.autohide=a)}get media(){let e=this.querySelector(":scope > [slot=media]");return(e==null?void 0:e.nodeName)=="SLOT"&&(e=e.assignedElements({flatten:!0})[0]),e}mediaSetCallback(e){this._mediaClickPlayToggle=()=>{let t=e.paused?p.MEDIA_PLAY_REQUEST:p.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(t,{composed:!0,bubbles:!0}))}}handleMediaUpdated(e){let t=n=>Promise.resolve(n),a=n=>(console.error('<media-chrome>: Media element set with slot="media" does not appear to be compatible.',n),Promise.reject(n));if(!e)return a(e);let r=e.nodeName.toLowerCase();return r.includes("-")?d.customElements.whenDefined(r).then(()=>t(e)):t(e)}mediaUnsetCallback(e){}connectedCallback(){let t=this.getAttribute("audio")!=null?W.AUDIO_PLAYER():W.VIDEO_PLAYER();this.setAttribute("role","region"),this.setAttribute("aria-label",t),this.media&&this.handleMediaUpdated(this.media).then(s=>this.mediaSetCallback(s)),this.setAttribute("user-inactive","user-inactive");let a=()=>{if(this.autohide<0||this.hasAttribute("user-inactive"))return;this.setAttribute("user-inactive","");let s=new d.CustomEvent(qt.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(s)},r=()=>{if(!this.hasAttribute("user-inactive"))return;this.removeAttribute("user-inactive");let s=new d.CustomEvent(qt.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(s)},n=()=>{r(),d.clearTimeout(this._inactiveTimeout),!(this.autohide<0)&&(this._inactiveTimeout=d.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 u;return["media-play-button","media-fullscreen-button"].includes((u=l==null?void 0:l.nodeName)==null?void 0:u.toLowerCase())})&&n()}),this.addEventListener("pointermove",s=>{s.pointerType==="mouse"&&s.target!==this&&(r(),d.clearTimeout(this._inactiveTimeout),[this,this.media].includes(s.target)&&n())}),this.addEventListener("mouseleave",()=>{a()}),this.addEventListener("keyup",()=>{this.setAttribute("media-keyboard-control","")}),d.addEventListener("mouseup",()=>{this.removeAttribute("media-keyboard-control")})}set autohide(e){e=Number(e),this._autohide=isNaN(e)?0:e}get autohide(){return this._autohide===void 0?2:this._autohide}};d.customElements.get("media-container-temp")||d.customElements.define("media-container-temp",zi);var gs=zi;var As=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},V=(i,e,t)=>(As(i,e,"read from private field"),t?t.call(i):e.get(i)),hr=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},pr=(i,e,t,a)=>(As(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),gt,At,j,Xi=class{constructor(e,t){hr(this,gt,void 0),hr(this,At,void 0),hr(this,j,new Set),pr(this,gt,e),pr(this,At,t)}[Symbol.iterator](){return V(this,j).values()}get length(){return V(this,j).size}get value(){var e;return(e=[...V(this,j)].join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(pr(this,j,new Set),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return[...V(this,j)][e]}values(){return V(this,j).values()}keys(){return V(this,j).keys()}forEach(e){V(this,j).forEach(e)}add(...e){var t,a;e.forEach(r=>V(this,j).add(r)),!(this.value===""&&!((t=V(this,gt))!=null&&t.hasAttribute(`${V(this,At)}`)))&&((a=V(this,gt))==null||a.setAttribute(`${V(this,At)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>V(this,j).delete(a)),(t=V(this,gt))==null||t.setAttribute(`${V(this,At)}`,`${this.value}`)}contains(e){return V(this,j).has(e)}toggle(e,t){return typeof t!="undefined"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){this.remove(e),this.add(t)}};gt=new WeakMap;At=new WeakMap;j=new WeakMap;var br=(i="")=>i.split(/\s+/),_s=(i="")=>{let[e,t]=i.split(":"),a=t?decodeURIComponent(t):void 0;return{language:e,label:a}},zt=(i="",e={})=>br(i).map(t=>{let a=_s(t);return{...e,...a}}),ed=i=>Array.isArray(i)?i.map(e=>typeof e=="string"?_s(e):e):typeof i=="string"?zt(i):[i],fr=({label:i,language:e}={})=>i?`${e}:${encodeURIComponent(i)}`:e,Xt=(i=[])=>Array.prototype.map.call(i,fr).join(" "),td=(i,e)=>t=>t[i]===e,ys=i=>{let e=Object.entries(i).map(([t,a])=>td(t,a));return t=>e.every(a=>a(t))},Jt=(i,e=[],t=[])=>{let a=ed(t).map(ys),r=n=>a.some(s=>s(n));Array.from(e).filter(r).forEach(n=>{n.mode=i})},_t=(i,e=()=>!0)=>{if(!(i!=null&&i.textTracks))return[];let t=typeof e=="function"?e:ys(e);return Array.from(i.textTracks).filter(t)},vr=i=>{let e=!!i.getAttribute(o.MEDIA_CAPTIONS_SHOWING),t=!i.hasAttribute("no-subtitles-fallback")&&!!i.getAttribute(o.MEDIA_SUBTITLES_SHOWING);return e||t},Je=(i,e=!1)=>{var t,a,r,n;if(vr(i)){let l=i.getAttribute(o.MEDIA_CAPTIONS_SHOWING);if(l){let c=new window.CustomEvent(p.MEDIA_DISABLE_CAPTIONS_REQUEST,{composed:!0,bubbles:!0,detail:l});i.dispatchEvent(c)}let u=i.getAttribute(o.MEDIA_SUBTITLES_SHOWING);if(u&&!i.hasAttribute("no-subtitles-fallback")){let c=new window.CustomEvent(p.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:u});i.dispatchEvent(c)}}else if(!e){let[l]=(a=br((t=i.getAttribute(o.MEDIA_CAPTIONS_LIST))!=null?t:""))!=null?a:[];if(l){let u=new window.CustomEvent(p.MEDIA_SHOW_CAPTIONS_REQUEST,{composed:!0,bubbles:!0,detail:l});i.dispatchEvent(u)}else if(i.hasAttribute("no-subtitles-fallback"))console.error("Attempting to enable closed captions but none are available! Please verify your media content if this is unexpected.");else{let[u]=(n=br((r=i.getAttribute(o.MEDIA_SUBTITLES_LIST))!=null?r:""))!=null?n:[];if(u){let c=new window.CustomEvent(p.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:u});i.dispatchEvent(c)}}}};var U={enter:"requestFullscreen",exit:"exitFullscreen",event:"fullscreenchange",element:"fullscreenElement",error:"fullscreenerror",enabled:"fullscreenEnabled"};m.fullscreenElement===void 0&&(U.enter="webkitRequestFullScreen",U.exit=m.webkitExitFullscreen!=null?"webkitExitFullscreen":"webkitCancelFullScreen",U.event="webkitfullscreenchange",U.element="webkitFullscreenElement",U.error="webkitfullscreenerror",U.enabled="webkitFullscreenEnabled");var Ji,Er=()=>{var i,e;return Ji||(Ji=(e=(i=m)==null?void 0:i.createElement)==null?void 0:e.call(i,"video"),Ji)},Ts=async(i=Er())=>{if(!i)return!1;let e=i.volume;return i.volume=e/2+.1,await Hi(0),i.volume!==e},id=(i=Er())=>typeof(i==null?void 0:i.requestPictureInPicture)=="function",ad=(i=Er())=>{let e=m[U.enabled];return!e&&i&&(e="webkitSupportsFullscreen"in i),e},gr=ad(),Is=id(),ks=!!d.WebKitPlaybackTargetAvailabilityEvent,Ms=!!d.chrome;var ji,Ss=Ts().then(i=>(ji=i,ji)),rd=Object.values(se),Ar=i=>_t(i.media,{kind:vt.SUBTITLES}),_r=i=>_t(i.media,{kind:vt.CAPTIONS}),nd=i=>_t(i.media,{kind:vt.SUBTITLES,mode:Qe.SHOWING}),sd=i=>_t(i.media,{kind:vt.CAPTIONS,mode:Qe.SHOWING}),Q={MEDIA_PAUSED:{get:function(i){let{media:e}=i;return e?e.paused:!0},mediaEvents:["play","pause","emptied"]},MEDIA_HAS_PLAYED:{get:function(i){let{media:e}=i;return e?!e.paused:!1},mediaEvents:["playing","emptied"]},MEDIA_PLAYBACK_RATE:{get:function(i){let{media:e}=i;return!e||typeof e.playbackRate=="undefined"?1:e.playbackRate},mediaEvents:["ratechange","loadstart"]},MEDIA_MUTED:{get:function(i){let{media:e}=i;return!e||typeof e.muted=="undefined"?!1:e.muted},mediaEvents:["volumechange"]},MEDIA_VOLUME:{get:function(i){let{media:e}=i;return!e||typeof e.volume=="undefined"?1:Number(e.volume)},mediaEvents:["volumechange"]},MEDIA_VOLUME_LEVEL:{get:function(i){let{media:e}=i,t="high";if(!e||typeof e.volume=="undefined")return t;let{muted:a,volume:r}=e;return r===0||a?t="off":r<.5?t="low":r<.75&&(t="medium"),t},mediaEvents:["volumechange"]},MEDIA_CURRENT_TIME:{get:function(i){let{media:e}=i;return!e||typeof e.currentTime=="undefined"?0:e.currentTime},mediaEvents:["timeupdate","loadedmetadata"]},MEDIA_DURATION:{get:function(i){let{media:e}=i;return!e||!Number.isFinite(e.duration)?NaN:e.duration},mediaEvents:["durationchange","loadedmetadata","emptied"]},MEDIA_SEEKABLE:{get:function(i){var e;let{media:t}=i;if(!((e=t==null?void 0:t.seekable)!=null&&e.length))return;let a=t.seekable.start(0),r=t.seekable.end(t.seekable.length-1);if(!(!a&&!r))return[Number(a.toFixed(3)),Number(r.toFixed(3))].join(":")},mediaEvents:["loadedmetadata","emptied","progress"]},MEDIA_LOADING:{get:function(i){var e;return((e=i.media)==null?void 0:e.readyState)<3},mediaEvents:["waiting","playing","emptied"]},MEDIA_BUFFERED:{get:function(i){var e;ls((e=i.media)==null?void 0:e.buffered)},mediaEvents:["progress","emptied"]},MEDIA_STREAM_TYPE:{get:function(i){let{media:e}=i;if(!e)return;let{streamType:t}=e;if(rd.includes(t)){if(t===se.UNKNOWN){let r=i.getAttribute("default-stream-type");return[se.LIVE,se.ON_DEMAND].includes(r)?r:void 0}return t}let a=e.duration;if(a===1/0)return se.LIVE;if(Number.isFinite(a))return se.ON_DEMAND;{let r=i.getAttribute("default-stream-type");if([se.LIVE,se.ON_DEMAND].includes(r))return r}},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange"]},MEDIA_TARGET_LIVE_WINDOW:{get:function(i){let{media:e}=i;if(!e)return Number.NaN;let{targetLiveWindow:t}=e,a=Q.MEDIA_STREAM_TYPE.get(i);return(t==null||Number.isNaN(t))&&a===se.LIVE?0:t},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange","targetlivewindowchange"]},MEDIA_TIME_IS_LIVE:{get:function(i){let{media:e}=i;if(!e)return!1;if(typeof e.liveEdgeStart=="number")return Number.isNaN(e.liveEdgeStart)?!1:e.currentTime>=e.liveEdgeStart;if(!(Q.MEDIA_STREAM_TYPE.get(i)==="live"))return!1;let a=e.seekable;if(!a)return!0;if(!a.length)return!1;let r=i.hasAttribute("liveedgeoffset")?Number(i.getAttribute("liveedgeoffset")):10,n=a.end(a.length-1)-r;return e.currentTime>=n},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},MEDIA_IS_FULLSCREEN:{get:function(i,e){let a=!!m[U.element]&&(e==null?void 0:e.target);return Qt(i.fullscreenElement,a)},rootEvents:[U.event]},MEDIA_IS_PIP:{get:function(i,e){var t;let a=i.media;if(!a)return!1;if(e)return e.type=="enterpictureinpicture";{let r=(t=i.getRootNode().pictureInPictureElement)!=null?t:m.pictureInPictureElement;return Qt(a,r)}},mediaEvents:["enterpictureinpicture","leavepictureinpicture"]},MEDIA_IS_CASTING:{get:function(i,e){var t;let{media:a}=i;if(!a)return!1;let r=(t=globalThis.CastableVideoElement)==null?void 0:t.castElement,n=Qt(a,r);return(e==null?void 0:e.type)==="castchange"&&(e==null?void 0:e.detail)==="CONNECTING"&&(n="connecting"),n},mediaEvents:["entercast","leavecast","castchange"]},MEDIA_AIRPLAY_UNAVAILABLE:{get:function(i,e){if(!ks)return Ae.UNSUPPORTED;if(!!e&&e.availability!=="available"&&e.availability==="not-available")return Ae.UNAVAILABLE},mediaEvents:["webkitplaybacktargetavailabilitychanged"]},MEDIA_CAST_UNAVAILABLE:{get:function(){var i;let e=(i=globalThis.CastableVideoElement)==null?void 0:i.castState;if(!Ms||!e)return Ae.UNSUPPORTED;if(!e.includes("CONNECT"))return Ae.UNAVAILABLE},mediaEvents:["castchange"]},MEDIA_FULLSCREEN_UNAVAILABLE:{get:function(){return gr?void 0:Ae.UNAVAILABLE}},MEDIA_PIP_UNAVAILABLE:{get:function(){return Is?void 0:Ae.UNSUPPORTED}},MEDIA_VOLUME_UNAVAILABLE:{get:function(i){if(ji!==void 0&&!ji)return Ae.UNSUPPORTED;let{media:e}=i;if(e&&typeof e.volume=="undefined")return Ae.UNAVAILABLE},mediaEvents:["loadstart"]},MEDIA_CAPTIONS_LIST:{get:function(i){return Xt(_r(i))||void 0},mediaEvents:["loadstart"],trackListEvents:["addtrack","removetrack"]},MEDIA_SUBTITLES_LIST:{get:function(i){return Xt(Ar(i))||void 0},mediaEvents:["loadstart"],trackListEvents:["addtrack","removetrack"]},MEDIA_CAPTIONS_SHOWING:{get:function(i){return Xt(sd(i))||void 0},mediaEvents:["loadstart"],trackListEvents:["addtrack","removetrack","change"]},MEDIA_SUBTITLES_SHOWING:{get:function(i){return Xt(nd(i))||void 0},mediaEvents:["loadstart"],trackListEvents:["addtrack","removetrack","change"]}},ea={MEDIA_PLAY_REQUEST:(i,e,t)=>{let a=Q.MEDIA_STREAM_TYPE.get(t),r=t.getAttribute("noautoseektolive")===null;a==se.LIVE&&r&&ea.MEDIA_SEEK_TO_LIVE_REQUEST(i),i.play().catch(()=>{})},MEDIA_PAUSE_REQUEST:i=>i.pause(),MEDIA_MUTE_REQUEST:i=>i.muted=!0,MEDIA_UNMUTE_REQUEST:i=>{i.muted=!1,i.volume===0&&(i.volume=.25)},MEDIA_VOLUME_REQUEST:(i,e,t)=>{let a=e.detail;if(i.volume=a,a>0&&i.muted&&(i.muted=!1),!t.hasAttribute("novolumepref"))try{d.localStorage.setItem("media-chrome-pref-volume",a.toString())}catch{}},MEDIA_ENTER_FULLSCREEN_REQUEST:(i,e,t)=>{if(!gr){console.warn("Fullscreen support is unavailable; not entering fullscreen");return}m.pictureInPictureElement&&m.exitPictureInPicture(),t[U.enter]?t.fullscreenElement[U.enter]():i.webkitEnterFullscreen?i.webkitEnterFullscreen():i.requestFullscreen?i.requestFullscreen():console.warn("MediaChrome: Fullscreen not supported")},MEDIA_EXIT_FULLSCREEN_REQUEST:()=>{m[U.exit]()},MEDIA_ENTER_PIP_REQUEST:i=>{if(!m.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!i.requestPictureInPicture){console.warn("MediaChrome: The current media does not support picture-in-picture");return}m[U.element]&&m[U.exit]();let e=()=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};i.requestPictureInPicture().catch(t=>{if(t.code===11)if(i.readyState===0&&i.preload==="none"){let a=()=>{i.removeEventListener("loadedmetadata",r),i.preload="none"},r=()=>{i.requestPictureInPicture().catch(e),a()};i.addEventListener("loadedmetadata",r),i.preload="metadata",setTimeout(()=>{i.readyState===0&&e(),a()},1e3)}else throw t;else throw t})},MEDIA_EXIT_PIP_REQUEST:()=>{m.pictureInPictureElement&&m.exitPictureInPicture()},MEDIA_ENTER_CAST_REQUEST:i=>{var e;!((e=globalThis.CastableVideoElement)!=null&&e.castEnabled)||(m[U.element]&&m[U.exit](),i.requestCast())},MEDIA_EXIT_CAST_REQUEST:async()=>{var i;(i=globalThis.CastableVideoElement)!=null&&i.castElement&&globalThis.CastableVideoElement.exitCast()},MEDIA_SEEK_REQUEST:(i,e)=>{let t=e.detail;(i.readyState>0||i.readyState===void 0)&&(i.currentTime=t)},MEDIA_PLAYBACK_RATE_REQUEST:(i,e)=>{i.playbackRate=e.detail},MEDIA_PREVIEW_REQUEST:(i,e,t)=>{var a;if(!i)return;let r=e.detail;r===null&&t.propagateMediaState(o.MEDIA_PREVIEW_TIME,void 0),t.propagateMediaState(o.MEDIA_PREVIEW_TIME,r);let[n]=_t(i,{kind:vt.METADATA,label:"thumbnails"});if(!(n&&n.cues))return;if(r===null){t.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,void 0),t.propagateMediaState(o.MEDIA_PREVIEW_COORDS,void 0);return}let s=Array.prototype.find.call(n.cues,f=>f.startTime>=r);if(!s)return;let l=/'^(?:[a-z]+:)?\/\//i.test(s.text)||(a=i.querySelector('track[label="thumbnails"]'))==null?void 0:a.src,u=new URL(s.text,l),c=new URLSearchParams(u.hash).get("#xywh");t.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,u.href),t.propagateMediaState(o.MEDIA_PREVIEW_COORDS,c.split(",").join(" "))},MEDIA_SHOW_CAPTIONS_REQUEST:(i,e,t)=>{let a=_r(t),{detail:r=[]}=e;Jt(Qe.SHOWING,a,r)},MEDIA_DISABLE_CAPTIONS_REQUEST:(i,e,t)=>{let a=_r(t),{detail:r=[]}=e;Jt(Qe.DISABLED,a,r)},MEDIA_SHOW_SUBTITLES_REQUEST:(i,e,t)=>{let a=Ar(t),{detail:r=[]}=e;Jt(Qe.SHOWING,a,r)},MEDIA_DISABLE_SUBTITLES_REQUEST:(i,e,t)=>{let a=Ar(t),{detail:r=[]}=e;Jt(Qe.DISABLED,a,r)},MEDIA_AIRPLAY_REQUEST:i=>{if(!!i){if(!(i.webkitShowPlaybackTargetPicker&&d.WebKitPlaybackTargetAvailabilityEvent)){console.warn("received a request to select AirPlay but AirPlay is not supported in this environment");return}i.webkitShowPlaybackTargetPicker()}},MEDIA_SEEK_TO_LIVE_REQUEST:i=>{let e=i.seekable;if(!e){console.warn("MediaController: Media element does not support seeking to live.");return}if(!e.length){console.warn("MediaController: Media is unable to seek to live.");return}i.currentTime=e.end(e.length-1)}};var Ir=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},je=(i,e,t)=>(Ir(i,e,"read from private field"),t?t.call(i):e.get(i)),ta=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ws=(i,e,t,a)=>(Ir(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),yt=(i,e,t)=>(Ir(i,e,"access private method"),t),Oe,jt,Tt,ti,ia,yr,Rs=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],od=10,Ls=0,aa=class extends gs{constructor(){super(),ta(this,Tt),ta(this,ia),ta(this,Oe,new Xi(this,"hotkeys")),ta(this,jt,void 0),Q.MEDIA_VOLUME_UNAVAILABLE.get(this)===void 0&&Ss.then(()=>{this.propagateMediaState(o.MEDIA_VOLUME_UNAVAILABLE,Q.MEDIA_VOLUME_UNAVAILABLE.get(this))}),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,this.associateElement(this),Object.keys(ea).forEach(e=>{let t=`_handle${Bi(e,!0)}`;this[t]=a=>{if(a.stopPropagation(),!this.media){console.warn("MediaController: No media available.");return}ea[e](this.media,a,this)},this.addEventListener(p[e],this[t])}),this._mediaStatePropagators={},Object.keys(Q).forEach(e=>{this._mediaStatePropagators[e]=t=>{this.propagateMediaState(o[e],Q[e].get(this,t))}}),this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat("nohotkeys","hotkeys","default-stream-type")}get fullscreenElement(){var e;return(e=je(this,jt))!=null?e:this}set fullscreenElement(e){this.hasAttribute("fullscreen-element")&&this.removeAttribute("fullscreen-element"),ws(this,jt,e)}attributeChangedCallback(e,t,a){var r;if(e==="nohotkeys")a!==t&&a===""?(this.hasAttribute("hotkeys")&&console.warn("Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):a!==t&&a===null&&this.enableHotkeys();else if(e==="hotkeys")je(this,Oe).value=a;else if(e==="default-stream-type")this.propagateMediaState(o.MEDIA_STREAM_TYPE);else if(e==="fullscreen-element"){let n=a?(r=this.getRootNode())==null?void 0:r.getElementById(a):void 0;ws(this,jt,n)}super.attributeChangedCallback(e,t,a)}mediaSetCallback(e){if(super.mediaSetCallback(e),e.hasAttribute("tabindex")||e.setAttribute("tabindex",-1),Object.keys(Q).forEach(t=>{let{mediaEvents:a,rootEvents:r,trackListEvents:n}=Q[t],s=this._mediaStatePropagators[t];a==null||a.forEach(l=>{e.addEventListener(l,s)}),r==null||r.forEach(l=>{this.getRootNode().addEventListener(l,s)}),n==null||n.forEach(l=>{var u;(u=e.textTracks)==null||u.addEventListener(l,s)})}),!this.hasAttribute("novolumepref"))try{let t=d.localStorage.getItem("media-chrome-pref-volume");t!==null&&(e.volume=t)}catch(t){console.debug("Error getting volume pref",t)}}mediaUnsetCallback(e){super.mediaUnsetCallback(e),Object.keys(Q).forEach(t=>{let{mediaEvents:a,rootEvents:r,trackListEvents:n}=Q[t],s=this._mediaStatePropagators[t];a==null||a.forEach(l=>{e.removeEventListener(l,s)}),r==null||r.forEach(l=>{this.getRootNode().removeEventListener(l,s)}),n==null||n.forEach(l=>{var u;(u=e.textTracks)==null||u.removeEventListener(l,s)})}),this.propagateMediaState(o.MEDIA_PAUSED,!0)}propagateMediaState(e,t){let a=this.getAttribute(e);if(Cs(this.mediaStateReceivers,e,t),a===this.getAttribute(e))return;let r=new d.CustomEvent(rs[e],{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(r)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(t.has(e))return;let a=this.registerMediaStateReceiver.bind(this),r=this.unregisterMediaStateReceiver.bind(this),n=cd(e,a,r);Object.keys(p).forEach(s=>{e.addEventListener(p[s],this[`_handle${Bi(s,!0)}`])}),t.set(e,n)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(!t.has(e))return;t.get(e)(),t.delete(e),Object.keys(p).forEach(r=>{e.removeEventListener(p[r],this[`_handle${Bi(r,!0)}`])})}registerMediaStateReceiver(e){if(!e)return;let t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),Object.keys(Q).forEach(r=>{let n=Q[r];Cs([e],o[r],n.get(this))}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,a=t.indexOf(e);a<0||t.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",yt(this,ia,yr))}disableHotkeys(){this.removeEventListener("keydown",yt(this,ia,yr)),this.removeEventListener("keyup",yt(this,Tt,ti))}get hotkeys(){return je(this,Oe)}keyboardShortcutHandler(e){var t,a,r,n;if(((n=(r=(t=e.target.getAttribute("keysused"))==null?void 0:t.split(" "))!=null?r:(a=e.target)==null?void 0:a.keysUsed)!=null?n:[]).map(y=>y==="Space"?" ":y).filter(Boolean).includes(e.key))return;let l,u,c,f,A,g=od;if(!je(this,Oe).contains(`no${e.key.toLowerCase()}`)&&!(e.key===" "&&je(this,Oe).contains("nospace")))switch(e.key){case" ":case"k":l=this.getAttribute(o.MEDIA_PAUSED)!=null?p.MEDIA_PLAY_REQUEST:p.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new d.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"m":l=this.getAttribute(o.MEDIA_VOLUME_LEVEL)==="off"?p.MEDIA_UNMUTE_REQUEST:p.MEDIA_MUTE_REQUEST,this.dispatchEvent(new d.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"f":l=this.getAttribute(o.MEDIA_IS_FULLSCREEN)!=null?p.MEDIA_EXIT_FULLSCREEN_REQUEST:p.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new d.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"c":Je(this);break;case"ArrowLeft":u=this.getAttribute(o.MEDIA_CURRENT_TIME),c=u&&!Number.isNaN(+u)?+u:Ls,f=Math.max(c-g,0),A=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:f}),this.dispatchEvent(A);break;case"ArrowRight":u=this.getAttribute(o.MEDIA_CURRENT_TIME),c=u&&!Number.isNaN(+u)?+u:Ls,f=Math.max(c+g,0),A=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:f}),this.dispatchEvent(A);break;default:break}}};Oe=new WeakMap;jt=new WeakMap;Tt=new WeakSet;ti=function(i){let{key:e}=i;if(!Rs.includes(e)){this.removeEventListener("keyup",yt(this,Tt,ti));return}this.keyboardShortcutHandler(i)};ia=new WeakSet;yr=function(i){let{metaKey:e,altKey:t,key:a}=i;if(e||t||!Rs.includes(a)){this.removeEventListener("keyup",yt(this,Tt,ti));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(je(this,Oe).contains(`no${a.toLowerCase()}`)||a===" "&&je(this,Oe).contains("nospace"))&&i.preventDefault(),this.addEventListener("keyup",yt(this,Tt,ti),{once:!0})};var ld=Object.values(o),xs=i=>{var e,t,a,r;let{observedAttributes:n}=i.constructor;!n&&((e=i.nodeName)==null?void 0:e.includes("-"))&&(d.customElements.upgrade(i),{observedAttributes:n}=i.constructor);let s=(r=(a=(t=i==null?void 0:i.getAttribute)==null?void 0:t.call(i,v.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(n||s)?(n||s).filter(l=>ld.includes(l)):[]},Tr=i=>!!xs(i).length,dd=async(i,e,t)=>(i.isConnected||await Hi(0),t==null?i.removeAttribute(e):typeof t=="boolean"?t?i.setAttribute(e,""):i.removeAttribute(e):Number.isNaN(t)?i.removeAttribute(e):i.setAttribute(e,t)),ud=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},ei=(i,e)=>{if(ud(i))return;let t=(r,n)=>{var s,l;Tr(r)&&n(r);let{children:u=[]}=r!=null?r:{},c=(l=(s=r==null?void 0:r.shadowRoot)==null?void 0:s.children)!=null?l:[];[...u,...c].forEach(A=>ei(A,n))},a=i==null?void 0:i.nodeName.toLowerCase();if(a.includes("-")&&!Tr(i)){d.customElements.whenDefined(a).then(()=>{t(i,e)});return}t(i,e)},Cs=(i,e,t)=>{i.forEach(a=>{!xs(a).includes(e)||dd(a,e,t)})},cd=(i,e,t)=>{ei(i,e);let a=u=>{var c;let f=(c=u==null?void 0:u.composedPath()[0])!=null?c:u.target;e(f)},r=u=>{var c;let f=(c=u==null?void 0:u.composedPath()[0])!=null?c:u.target;t(f)};i.addEventListener(p.REGISTER_MEDIA_STATE_RECEIVER,a),i.addEventListener(p.UNREGISTER_MEDIA_STATE_RECEIVER,r);let n=u=>{u.forEach(c=>{let{addedNodes:f=[],removedNodes:A=[],type:g,target:y,attributeName:R}=c;g==="childList"?(Array.prototype.forEach.call(f,$=>ei($,e)),Array.prototype.forEach.call(A,$=>ei($,t))):g==="attributes"&&R===v.MEDIA_CHROME_ATTRIBUTES&&(Tr(y)?e(y):t(y))})},s=new MutationObserver(n);return s.observe(i,{childList:!0,attributes:!0,subtree:!0}),()=>{ei(i,t),s.disconnect(),i.removeEventListener(p.REGISTER_MEDIA_STATE_RECEIVER,a),i.removeEventListener(p.UNREGISTER_MEDIA_STATE_RECEIVER,r)}};d.customElements.get("media-controller")||d.customElements.define("media-controller",aa);var ii=aa;var Os=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},_e=(i,e,t)=>(Os(i,e,"read from private field"),t?t.call(i):e.get(i)),ra=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ai=(i,e,t,a)=>(Os(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),na,me,sa,oa,Ns=m.createElement("template"),Ds=`
|
|
201
|
+
`;var md=Object.values(o),hd="sm:384 md:576 lg:768 xl:960",pd=i=>{var e;for(let t of i){let a=t.target;if(!a.isConnected)continue;let r=(e=a.getAttribute(S.BREAKPOINTS))!=null?e:hd,n=Ed(r),s=bd(n,t.contentRect),l=!1;if(Object.keys(n).forEach(u=>{if(s.includes(u)){a.hasAttribute(`breakpoint${u}`)||(a.setAttribute(`breakpoint${u}`,""),l=!0);return}a.hasAttribute(`breakpoint${u}`)&&(a.removeAttribute(`breakpoint${u}`),l=!0)}),l){let u=new CustomEvent(Lt.BREAKPOINTS_CHANGE,{detail:s});a.dispatchEvent(u)}}};function Ed(i){let e=i.split(/\s+/);return Object.fromEntries(e.map(t=>t.split(":")))}function bd(i,e){return Object.keys(i).filter(t=>e.width>=i[t])}var na=class extends d.HTMLElement{constructor(){super(),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Ds.content.cloneNode(!0)));let e=s=>{let l=this.media;for(let u of s)u.type==="childList"&&(u.removedNodes.forEach(m=>{if(m.slot=="media"&&u.target==this){let p=u.previousSibling&&u.previousSibling.previousElementSibling;if(!p||!l)this.mediaUnsetCallback(m);else{let f=p.slot!=="media";for(;(p=p.previousSibling)!==null;)p.slot=="media"&&(f=!1);f&&this.mediaUnsetCallback(m)}}}),l&&u.addedNodes.forEach(m=>{m==l&&this.handleMediaUpdated(l).then(p=>this.mediaSetCallback(p))}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0});let a=new ResizeObserver(pd);this.resizeObserver=a,a.observe(this);let r=this.media,n=this.querySelector(":scope > slot[slot=media]");n&&n.addEventListener("slotchange",()=>{if(!n.assignedElements({flatten:!0}).length){this.mediaUnsetCallback(r);return}this.media&&(r=this.media,this.handleMediaUpdated(this.media).then(l=>this.mediaSetCallback(l)))})}static get observedAttributes(){return[S.AUTOHIDE,S.GESTURES_DISABLED].concat(md)}attributeChangedCallback(e,t,a){e.toLowerCase()==S.AUTOHIDE&&(this.autohide=a)}get media(){let e=this.querySelector(":scope > [slot=media]");return(e==null?void 0:e.nodeName)=="SLOT"&&(e=e.assignedElements({flatten:!0})[0]),e}mediaSetCallback(e){this._mediaClickPlayToggle=()=>{let t=e.paused?b.MEDIA_PLAY_REQUEST:b.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(t,{composed:!0,bubbles:!0}))}}handleMediaUpdated(e){let t=n=>Promise.resolve(n),a=n=>(console.error('<media-chrome>: Media element set with slot="media" does not appear to be compatible.',n),Promise.reject(n));if(!e)return a(e);let r=e.nodeName.toLowerCase();return r.includes("-")?d.customElements.whenDefined(r).then(()=>t(e)):t(e)}mediaUnsetCallback(e){}connectedCallback(){let t=this.getAttribute(S.AUDIO)!=null?q.AUDIO_PLAYER():q.VIDEO_PLAYER();this.setAttribute("role","region"),this.setAttribute("aria-label",t),this.media&&this.handleMediaUpdated(this.media).then(s=>this.mediaSetCallback(s)),this.setAttribute(S.USER_INACTIVE,"");let a=()=>{if(this.autohide<0||this.hasAttribute(S.USER_INACTIVE))return;this.setAttribute(S.USER_INACTIVE,"");let s=new d.CustomEvent(Lt.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(s)},r=()=>{if(!this.hasAttribute(S.USER_INACTIVE))return;this.removeAttribute(S.USER_INACTIVE);let s=new d.CustomEvent(Lt.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(s)},n=()=>{r(),d.clearTimeout(this._inactiveTimeout),!(this.autohide<0)&&(this._inactiveTimeout=d.setTimeout(()=>{a()},this.autohide*1e3))};this.addEventListener("keyup",()=>{n()}),this.addEventListener("pointerup",s=>{s.pointerType==="touch"?[this,this.media].includes(s.target)&&!this.hasAttribute(S.USER_INACTIVE)?a():n():s.composedPath().some(l=>{var u;return["media-play-button","media-fullscreen-button"].includes((u=l==null?void 0:l.nodeName)==null?void 0:u.toLowerCase())})&&n()}),this.addEventListener("pointermove",s=>{s.pointerType==="mouse"&&(r(),d.clearTimeout(this._inactiveTimeout),[this,this.media].includes(s.target)&&n())}),this.addEventListener("mouseleave",()=>{a()}),this.addEventListener("keyup",()=>{this.setAttribute(S.KEYBOARD_CONTROL,"")}),d.addEventListener("mouseup",()=>{this.removeAttribute(S.KEYBOARD_CONTROL)})}set autohide(e){e=Number(e),this._autohide=isNaN(e)?0:e}get autohide(){return this._autohide===void 0?2:this._autohide}};var xs=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},G=(i,e,t)=>(xs(i,e,"read from private field"),t?t.call(i):e.get(i)),ui=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},sa=(i,e,t,a)=>(xs(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Rt,Dt,oa,st,Le,Ye,xt=class{constructor(e,t,{defaultValue:a}={defaultValue:void 0}){ui(this,Le),ui(this,Rt,void 0),ui(this,Dt,void 0),ui(this,oa,void 0),ui(this,st,new Set),sa(this,Rt,e),sa(this,Dt,t),sa(this,oa,new Set(a))}[Symbol.iterator](){return G(this,Le,Ye).values()}get length(){return G(this,Le,Ye).size}get value(){var e;return(e=[...G(this,Le,Ye)].join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(sa(this,st,new Set),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return[...G(this,Le,Ye)][e]}values(){return G(this,Le,Ye).values()}forEach(e){G(this,Le,Ye).forEach(e)}add(...e){var t,a;e.forEach(r=>G(this,st).add(r)),!(this.value===""&&!((t=G(this,Rt))!=null&&t.hasAttribute(`${G(this,Dt)}`)))&&((a=G(this,Rt))==null||a.setAttribute(`${G(this,Dt)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>G(this,st).delete(a)),(t=G(this,Rt))==null||t.setAttribute(`${G(this,Dt)}`,`${this.value}`)}contains(e){return G(this,Le,Ye).has(e)}toggle(e,t){return typeof t!="undefined"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){return this.remove(e),this.add(t),e===t}};Rt=new WeakMap;Dt=new WeakMap;oa=new WeakMap;st=new WeakMap;Le=new WeakSet;Ye=function(){return G(this,st).size?G(this,st):G(this,oa)};var Os=(i="")=>i.split(/\s+/),Ns=(i="")=>{let[e,t,a]=i.split(":"),r=a?decodeURIComponent(a):void 0;return e=e==="cc"?"captions":"subtitles",{kind:e,language:t,label:r}},Ot=(i="",e={})=>Os(i).map(t=>{let a=Ns(t);return{...e,...a}}),vd=i=>Array.isArray(i)?i.map(e=>typeof e=="string"?Ns(e):e):typeof i=="string"?Ot(i):[i],Sr=({kind:i,label:e,language:t}={kind:"subtitles"})=>e?`${i==="captions"?"cc":"sb"}:${t}:${encodeURIComponent(e)}`:t,ci=(i=[])=>Array.prototype.map.call(i,Sr).join(" "),fd=(i,e)=>t=>t[i]===e,Ps=i=>{let e=Object.entries(i).map(([t,a])=>fd(t,a));return t=>e.every(a=>a(t))},Mr=(i,e=[],t=[])=>{let a=vd(t).map(Ps),r=n=>a.some(s=>s(n));Array.from(e).filter(r).forEach(n=>{n.mode=i})},la=(i,e=()=>!0)=>{if(!(i!=null&&i.textTracks))return[];let t=typeof e=="function"?e:Ps(e);return Array.from(i.textTracks).filter(t)},Lr=i=>!!i.getAttribute(o.MEDIA_SUBTITLES_SHOWING),we=(i,e)=>{var t,a;let r=Lr(i);if(r||e===!1){let n=i.getAttribute(o.MEDIA_SUBTITLES_SHOWING);if(n){let s=new window.CustomEvent(b.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:n});i.dispatchEvent(s)}}else if(!r||e===!0){let[n]=(a=Os((t=i.getAttribute(o.MEDIA_SUBTITLES_LIST))!=null?t:""))!=null?a:[];if(n){let s=new window.CustomEvent(b.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:n});i.dispatchEvent(s)}}else console.error("Attempting to enable captions or subtitles but none are available! Please verify your media content if this is unexpected.")};var U={enter:"requestFullscreen",exit:"exitFullscreen",rootEvents:["fullscreenchange"],mediaEvents:[],element:"fullscreenElement",error:"fullscreenerror",enabled:"fullscreenEnabled"};c.fullscreenElement===void 0&&(U.enter="webkitRequestFullScreen",U.exit=c.webkitExitFullscreen!=null?"webkitExitFullscreen":"webkitCancelFullScreen",U.rootEvents=["webkitfullscreenchange"],U.mediaEvents=["webkitbeginfullscreen","webkitendfullscreen"],U.element="webkitFullscreenElement",U.error="webkitfullscreenerror",U.enabled="webkitFullscreenEnabled");var da,wr=()=>{var i,e;return da||(da=(e=(i=c)==null?void 0:i.createElement)==null?void 0:e.call(i,"video"),da)},Us=async(i=wr())=>{if(!i)return!1;let e=i.volume;return i.volume=e/2+.1,await Ji(0),i.volume!==e},gd=(i=wr())=>typeof(i==null?void 0:i.requestPictureInPicture)=="function",Ad=(i=wr())=>{let e=c[U.enabled];return!e&&i&&(e="webkitSupportsFullscreen"in i),e},Cr=Ad(),Bs=gd(),$s=!!d.WebKitPlaybackTargetAvailabilityEvent,Vs=!!d.chrome;var ua,Hs=Us().then(i=>(ua=i,ua)),_d=Object.values(he),Rr=i=>la(i.media,e=>[wt.SUBTITLES,wt.CAPTIONS].includes(e.kind)).sort((e,t)=>e.kind>=t.kind?1:-1),yd=i=>la(i.media,e=>e.mode===Qi.SHOWING&&[wt.SUBTITLES,wt.CAPTIONS].includes(e.kind)),ie={MEDIA_PAUSED:{get:function(i){let{media:e}=i;return e?e.paused:!0},mediaEvents:["play","playing","pause","emptied"]},MEDIA_HAS_PLAYED:{get:function(i){let{media:e}=i;return e?!e.paused:!1},mediaEvents:["playing","emptied"]},MEDIA_ENDED:{get:function(i){let{media:e}=i;return e?e.ended:!1},mediaEvents:["seeked","ended","emptied"]},MEDIA_PLAYBACK_RATE:{get:function(i){let{media:e}=i;return!e||typeof e.playbackRate=="undefined"?1:e.playbackRate},mediaEvents:["ratechange","loadstart"]},MEDIA_MUTED:{get:function(i){let{media:e}=i;return!e||typeof e.muted=="undefined"?!1:e.muted},mediaEvents:["volumechange"]},MEDIA_VOLUME:{get:function(i){let{media:e}=i;return!e||typeof e.volume=="undefined"?1:Number(e.volume)},mediaEvents:["volumechange"]},MEDIA_VOLUME_LEVEL:{get:function(i){let{media:e}=i,t="high";if(!e||typeof e.volume=="undefined")return t;let{muted:a,volume:r}=e;return r===0||a?t="off":r<.5?t="low":r<.75&&(t="medium"),t},mediaEvents:["volumechange"]},MEDIA_CURRENT_TIME:{get:function(i){let{media:e}=i;return!e||typeof e.currentTime=="undefined"?0:e.currentTime},mediaEvents:["timeupdate","loadedmetadata"]},MEDIA_DURATION:{get:function(i){let{media:e}=i;return!e||!Number.isFinite(e.duration)?NaN:e.duration},mediaEvents:["durationchange","loadedmetadata","emptied"]},MEDIA_SEEKABLE:{get:function(i){var e;let{media:t}=i;if(!((e=t==null?void 0:t.seekable)!=null&&e.length))return;let a=t.seekable.start(0),r=t.seekable.end(t.seekable.length-1);if(!(!a&&!r))return[Number(a.toFixed(3)),Number(r.toFixed(3))].join(":")},mediaEvents:["loadedmetadata","emptied","progress"]},MEDIA_LOADING:{get:function(i){var e;return((e=i.media)==null?void 0:e.readyState)<3},mediaEvents:["waiting","playing","emptied"]},MEDIA_BUFFERED:{get:function(i){var e;return As((e=i.media)==null?void 0:e.buffered)},mediaEvents:["progress","emptied"]},MEDIA_STREAM_TYPE:{get:function(i){let{media:e}=i;if(!e)return;let{streamType:t}=e;if(_d.includes(t)){if(t===he.UNKNOWN){let r=i.getAttribute("defaultstreamtype");return[he.LIVE,he.ON_DEMAND].includes(r)?r:void 0}return t}let a=e.duration;if(a===1/0)return he.LIVE;if(Number.isFinite(a))return he.ON_DEMAND;{let r=i.getAttribute("defaultstreamtype");if([he.LIVE,he.ON_DEMAND].includes(r))return r}},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange"]},MEDIA_TARGET_LIVE_WINDOW:{get:function(i){let{media:e}=i;if(!e)return Number.NaN;let{targetLiveWindow:t}=e,a=ie.MEDIA_STREAM_TYPE.get(i);return(t==null||Number.isNaN(t))&&a===he.LIVE?0:t},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange","targetlivewindowchange"]},MEDIA_TIME_IS_LIVE:{get:function(i){let{media:e}=i;if(!e)return!1;if(typeof e.liveEdgeStart=="number")return Number.isNaN(e.liveEdgeStart)?!1:e.currentTime>=e.liveEdgeStart;if(!(ie.MEDIA_STREAM_TYPE.get(i)==="live"))return!1;let a=e.seekable;if(!a)return!0;if(!a.length)return!1;let r=i.hasAttribute("liveedgeoffset")?Number(i.getAttribute("liveedgeoffset")):10,n=a.end(a.length-1)-r;return e.currentTime>=n},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},MEDIA_IS_FULLSCREEN:{get:function(i,e){var t;let a=i.media;if(a&&c[U.element]===void 0&&"webkitDisplayingFullscreen"in a)return a.webkitDisplayingFullscreen&&a.webkitPresentationMode==="fullscreen";let r;return e?r=c[U.element]?e.target:null:r=(t=i.getRootNode().fullscreenElement)!=null?t:c[U.element],di(i.fullscreenElement,r)},rootEvents:U.rootEvents,mediaEvents:U.mediaEvents},MEDIA_IS_PIP:{get:function(i,e){var t;let a=i.media;if(!a)return!1;if(e)return e.type=="enterpictureinpicture";{let r=(t=i.getRootNode().pictureInPictureElement)!=null?t:c.pictureInPictureElement;return di(a,r)}},mediaEvents:["enterpictureinpicture","leavepictureinpicture"]},MEDIA_IS_CASTING:{get:function(i,e){var t;let{media:a}=i;if(!a)return!1;let r=(t=globalThis.CastableVideoElement)==null?void 0:t.castElement,n=di(a,r);return(e==null?void 0:e.type)==="castchange"&&(e==null?void 0:e.detail)==="CONNECTING"&&(n="connecting"),n},mediaEvents:["entercast","leavecast","castchange"]},MEDIA_AIRPLAY_UNAVAILABLE:{get:function(i,e){if(!$s)return Me.UNSUPPORTED;if(!!e&&e.availability!=="available"&&e.availability==="not-available")return Me.UNAVAILABLE},mediaEvents:["webkitplaybacktargetavailabilitychanged"]},MEDIA_CAST_UNAVAILABLE:{get:function(){var i;let e=(i=globalThis.CastableVideoElement)==null?void 0:i.castState;if(!Vs||!e)return Me.UNSUPPORTED;if(!e.includes("CONNECT"))return Me.UNAVAILABLE},mediaEvents:["castchange"]},MEDIA_FULLSCREEN_UNAVAILABLE:{get:function(){return Cr?void 0:Me.UNAVAILABLE}},MEDIA_PIP_UNAVAILABLE:{get:function(){return Bs?void 0:Me.UNSUPPORTED}},MEDIA_VOLUME_UNAVAILABLE:{get:function(i){if(ua!==void 0&&!ua)return Me.UNSUPPORTED;let{media:e}=i;if(e&&typeof e.volume=="undefined")return Me.UNAVAILABLE},mediaEvents:["loadstart"]},MEDIA_SUBTITLES_LIST:{get:function(i){return ci(Rr(i))||void 0},mediaEvents:["loadstart"],trackListEvents:["addtrack","removetrack"]},MEDIA_SUBTITLES_SHOWING:{get:function(i){return i.hasAttribute("defaultsubtitles")&&!i.hasAttribute(o.MEDIA_HAS_PLAYED)&&!i.hasAttribute(o.MEDIA_SUBTITLES_SHOWING)&&we(i,!0),ci(yd(i))||void 0},mediaEvents:["loadstart"],trackListEvents:["addtrack","removetrack","change"]}},ca={MEDIA_PLAY_REQUEST:(i,e,t)=>{var a;let r=ie.MEDIA_STREAM_TYPE.get(t),n=t.getAttribute("noautoseektolive")===null;r==he.LIVE&&n&&ca.MEDIA_SEEK_TO_LIVE_REQUEST(i),(a=i.play())==null||a.catch(()=>{})},MEDIA_PAUSE_REQUEST:i=>i.pause(),MEDIA_MUTE_REQUEST:i=>i.muted=!0,MEDIA_UNMUTE_REQUEST:i=>{i.muted=!1,i.volume===0&&(i.volume=.25)},MEDIA_VOLUME_REQUEST:(i,e,t)=>{let a=e.detail;if(i.volume=a,a>0&&i.muted&&(i.muted=!1),!t.hasAttribute("novolumepref"))try{d.localStorage.setItem("media-chrome-pref-volume",a.toString())}catch{}},MEDIA_ENTER_FULLSCREEN_REQUEST:(i,e,t)=>{if(!Cr){console.warn("Fullscreen support is unavailable; not entering fullscreen");return}c.pictureInPictureElement&&c.exitPictureInPicture(),t[U.enter]?t.fullscreenElement[U.enter]():i.webkitEnterFullscreen?i.webkitEnterFullscreen():i.requestFullscreen?i.requestFullscreen():console.warn("MediaChrome: Fullscreen not supported")},MEDIA_EXIT_FULLSCREEN_REQUEST:()=>{c[U.exit]()},MEDIA_ENTER_PIP_REQUEST:i=>{if(!c.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!i.requestPictureInPicture){console.warn("MediaChrome: The current media does not support picture-in-picture");return}c[U.element]&&c[U.exit]();let e=()=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};i.requestPictureInPicture().catch(t=>{if(t.code===11)if(i.readyState===0&&i.preload==="none"){let a=()=>{i.removeEventListener("loadedmetadata",r),i.preload="none"},r=()=>{i.requestPictureInPicture().catch(e),a()};i.addEventListener("loadedmetadata",r),i.preload="metadata",setTimeout(()=>{i.readyState===0&&e(),a()},1e3)}else throw t;else throw t})},MEDIA_EXIT_PIP_REQUEST:()=>{c.pictureInPictureElement&&c.exitPictureInPicture()},MEDIA_ENTER_CAST_REQUEST:i=>{var e;!((e=globalThis.CastableVideoElement)!=null&&e.castEnabled)||(c[U.element]&&c[U.exit](),i.requestCast())},MEDIA_EXIT_CAST_REQUEST:async()=>{var i;(i=globalThis.CastableVideoElement)!=null&&i.castElement&&globalThis.CastableVideoElement.exitCast()},MEDIA_SEEK_REQUEST:(i,e)=>{let t=e.detail;(i.readyState>0||i.readyState===void 0)&&(i.currentTime=t)},MEDIA_PLAYBACK_RATE_REQUEST:(i,e)=>{i.playbackRate=e.detail},MEDIA_PREVIEW_REQUEST:(i,e,t)=>{var a;if(!i)return;let r=e.detail;r===null&&t.propagateMediaState(o.MEDIA_PREVIEW_TIME,void 0),t.propagateMediaState(o.MEDIA_PREVIEW_TIME,r);let[n]=la(i,{kind:wt.METADATA,label:"thumbnails"});if(!(n&&n.cues))return;if(r===null){t.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,void 0),t.propagateMediaState(o.MEDIA_PREVIEW_COORDS,void 0);return}let s=Array.prototype.find.call(n.cues,p=>p.startTime>=r);if(!s)return;let l=/'^(?:[a-z]+:)?\/\//i.test(s.text)||(a=i.querySelector('track[label="thumbnails"]'))==null?void 0:a.src,u=new URL(s.text,l),m=new URLSearchParams(u.hash).get("#xywh");t.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,u.href),t.propagateMediaState(o.MEDIA_PREVIEW_COORDS,m.split(",").join(" "))},MEDIA_SHOW_SUBTITLES_REQUEST:(i,e,t)=>{let a=Rr(t),{detail:r=[]}=e;Mr(Qi.SHOWING,a,r)},MEDIA_DISABLE_SUBTITLES_REQUEST:(i,e,t)=>{let a=Rr(t),{detail:r=[]}=e;Mr(Qi.DISABLED,a,r)},MEDIA_AIRPLAY_REQUEST:i=>{if(!!i){if(!(i.webkitShowPlaybackTargetPicker&&d.WebKitPlaybackTargetAvailabilityEvent)){console.warn("received a request to select AirPlay but AirPlay is not supported in this environment");return}i.webkitShowPlaybackTargetPicker()}},MEDIA_SEEK_TO_LIVE_REQUEST:i=>{let e=i.seekable;if(!e){console.warn("MediaController: Media element does not support seeking to live.");return}if(!e.length){console.warn("MediaController: Media is unable to seek to live.");return}i.currentTime=e.end(e.length-1)}};var Or=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},lt=(i,e,t)=>(Or(i,e,"read from private field"),t?t.call(i):e.get(i)),ma=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ws=(i,e,t,a)=>(Or(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Nt=(i,e,t)=>(Or(i,e,"access private method"),t),Ge,mi,Pt,hi,ha,Dr,Ys=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],Td=10,Fs=0,ae={DEFAULT_SUBTITLES:"defaultsubtitles",DEFAULT_STREAM_TYPE:"defaultstreamtype",FULLSCREEN_ELEMENT:"fullscreenelement",HOTKEYS:"hotkeys",KEYS_USED:"keysused",LIVE_EDGE_OFFSET:"liveedgeoffset",NO_AUTO_SEEK_TO_LIVE:"noautoseektolive",NO_HOTKEYS:"nohotkeys"},pa=class extends na{constructor(){super(),ma(this,Pt),ma(this,ha),ma(this,Ge,new xt(this,ae.HOTKEYS)),ma(this,mi,void 0),ie.MEDIA_VOLUME_UNAVAILABLE.get(this)===void 0&&Hs.then(()=>{this.propagateMediaState(o.MEDIA_VOLUME_UNAVAILABLE,ie.MEDIA_VOLUME_UNAVAILABLE.get(this))}),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,this.associateElement(this),Object.keys(ca).forEach(e=>{let t=`_handle${zi(e,!0)}`;this[t]=a=>{if(a.stopPropagation(),!this.media){console.warn("MediaController: No media available.");return}ca[e](this.media,a,this)},this.addEventListener(b[e],this[t])}),this._mediaStatePropagators={},Object.keys(ie).forEach(e=>{this._mediaStatePropagators[e]=t=>{this.propagateMediaState(o[e],ie[e].get(this,t))}}),this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(ae.NO_HOTKEYS,ae.HOTKEYS,ae.DEFAULT_STREAM_TYPE,ae.DEFAULT_SUBTITLES)}get fullscreenElement(){var e;return(e=lt(this,mi))!=null?e:this}set fullscreenElement(e){this.hasAttribute(ae.FULLSCREEN_ELEMENT)&&this.removeAttribute(ae.FULLSCREEN_ELEMENT),Ws(this,mi,e)}attributeChangedCallback(e,t,a){var r;if(e===ae.NO_HOTKEYS)a!==t&&a===""?(this.hasAttribute(ae.HOTKEYS)&&console.warn("Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):a!==t&&a===null&&this.enableHotkeys();else if(e===ae.HOTKEYS)lt(this,Ge).value=a;else if(e===ae.DEFAULT_SUBTITLES&&a!==t&&a==="")we(this,!0);else if(e===ae.DEFAULT_STREAM_TYPE)this.propagateMediaState(o.MEDIA_STREAM_TYPE);else if(e===ae.FULLSCREEN_ELEMENT){let n=a?(r=this.getRootNode())==null?void 0:r.getElementById(a):void 0;Ws(this,mi,n)}super.attributeChangedCallback(e,t,a)}mediaSetCallback(e){if(super.mediaSetCallback(e),e.hasAttribute("tabindex")||(e.tabIndex=-1),Object.keys(ie).forEach(t=>{let{mediaEvents:a,rootEvents:r,trackListEvents:n}=ie[t],s=this._mediaStatePropagators[t];a==null||a.forEach(l=>{e.addEventListener(l,s),s()}),r==null||r.forEach(l=>{this.getRootNode().addEventListener(l,s),s()}),n==null||n.forEach(l=>{var u;(u=e.textTracks)==null||u.addEventListener(l,s),s()})}),!this.hasAttribute("novolumepref"))try{let t=d.localStorage.getItem("media-chrome-pref-volume");t!==null&&(e.volume=t)}catch(t){console.debug("Error getting volume pref",t)}}mediaUnsetCallback(e){super.mediaUnsetCallback(e),Object.keys(ie).forEach(t=>{let{mediaEvents:a,rootEvents:r,trackListEvents:n}=ie[t],s=this._mediaStatePropagators[t];a==null||a.forEach(l=>{e.removeEventListener(l,s)}),r==null||r.forEach(l=>{this.getRootNode().removeEventListener(l,s)}),n==null||n.forEach(l=>{var u;(u=e.textTracks)==null||u.removeEventListener(l,s)})}),this.propagateMediaState(o.MEDIA_PAUSED,!0)}propagateMediaState(e,t){let a=this.getAttribute(e);if(Ks(this.mediaStateReceivers,e,t),a===this.getAttribute(e))return;let r=new d.CustomEvent(bs[e],{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(r)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(t.has(e))return;let a=this.registerMediaStateReceiver.bind(this),r=this.unregisterMediaStateReceiver.bind(this),n=Md(e,a,r);Object.keys(b).forEach(s=>{e.addEventListener(b[s],this[`_handle${zi(s,!0)}`])}),t.set(e,n)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(!t.has(e))return;t.get(e)(),t.delete(e),Object.keys(b).forEach(r=>{e.removeEventListener(b[r],this[`_handle${zi(r,!0)}`])})}registerMediaStateReceiver(e){if(!e)return;let t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),Object.keys(ie).forEach(r=>{let n=ie[r];Ks([e],o[r],n.get(this))}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,a=t.indexOf(e);a<0||t.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",Nt(this,ha,Dr))}disableHotkeys(){this.removeEventListener("keydown",Nt(this,ha,Dr)),this.removeEventListener("keyup",Nt(this,Pt,hi))}get hotkeys(){return lt(this,Ge)}keyboardShortcutHandler(e){var t,a,r,n;if(((n=(r=(t=e.target.getAttribute(ae.KEYS_USED))==null?void 0:t.split(" "))!=null?r:(a=e.target)==null?void 0:a.keysUsed)!=null?n:[]).map(T=>T==="Space"?" ":T).filter(Boolean).includes(e.key))return;let l,u,m,p,f,A=Td;if(!lt(this,Ge).contains(`no${e.key.toLowerCase()}`)&&!(e.key===" "&<(this,Ge).contains("nospace")))switch(e.key){case" ":case"k":l=this.getAttribute(o.MEDIA_PAUSED)!=null?b.MEDIA_PLAY_REQUEST:b.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new d.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"m":l=this.getAttribute(o.MEDIA_VOLUME_LEVEL)==="off"?b.MEDIA_UNMUTE_REQUEST:b.MEDIA_MUTE_REQUEST,this.dispatchEvent(new d.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"f":l=this.getAttribute(o.MEDIA_IS_FULLSCREEN)!=null?b.MEDIA_EXIT_FULLSCREEN_REQUEST:b.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new d.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"c":we(this);break;case"ArrowLeft":u=this.getAttribute(o.MEDIA_CURRENT_TIME),m=u&&!Number.isNaN(+u)?+u:Fs,p=Math.max(m-A,0),f=new d.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:p}),this.dispatchEvent(f);break;case"ArrowRight":u=this.getAttribute(o.MEDIA_CURRENT_TIME),m=u&&!Number.isNaN(+u)?+u:Fs,p=Math.max(m+A,0),f=new d.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:p}),this.dispatchEvent(f);break;default:break}}};Ge=new WeakMap;mi=new WeakMap;Pt=new WeakSet;hi=function(i){let{key:e}=i;if(!Ys.includes(e)){this.removeEventListener("keyup",Nt(this,Pt,hi));return}this.keyboardShortcutHandler(i)};ha=new WeakSet;Dr=function(i){let{metaKey:e,altKey:t,key:a}=i;if(e||t||!Ys.includes(a)){this.removeEventListener("keyup",Nt(this,Pt,hi));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(lt(this,Ge).contains(`no${a.toLowerCase()}`)||a===" "&<(this,Ge).contains("nospace"))&&i.preventDefault(),this.addEventListener("keyup",Nt(this,Pt,hi),{once:!0})};var Id=Object.values(o),Gs=i=>{var e,t,a,r;let{observedAttributes:n}=i.constructor;!n&&((e=i.nodeName)==null?void 0:e.includes("-"))&&(d.customElements.upgrade(i),{observedAttributes:n}=i.constructor);let s=(r=(a=(t=i==null?void 0:i.getAttribute)==null?void 0:t.call(i,v.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(n||s)?(n||s).filter(l=>Id.includes(l)):[]},xr=i=>!!Gs(i).length,kd=async(i,e,t)=>(i.isConnected||await Ji(0),t==null?i.removeAttribute(e):typeof t=="boolean"?t?i.setAttribute(e,""):i.removeAttribute(e):Number.isNaN(t)?i.removeAttribute(e):i.setAttribute(e,t)),Sd=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},ot=(i,e)=>{if(Sd(i))return;let t=(r,n)=>{var s,l;xr(r)&&n(r);let{children:u=[]}=r!=null?r:{},m=(l=(s=r==null?void 0:r.shadowRoot)==null?void 0:s.children)!=null?l:[];[...u,...m].forEach(f=>ot(f,n))},a=i==null?void 0:i.nodeName.toLowerCase();if(a.includes("-")&&!xr(i)){d.customElements.whenDefined(a).then(()=>{t(i,e)});return}t(i,e)},Ks=(i,e,t)=>{i.forEach(a=>{!Gs(a).includes(e)||kd(a,e,t)})},Md=(i,e,t)=>{ot(i,e);let a=p=>{var f;let A=(f=p==null?void 0:p.composedPath()[0])!=null?f:p.target;e(A)},r=p=>{var f;let A=(f=p==null?void 0:p.composedPath()[0])!=null?f:p.target;t(A)};i.addEventListener(b.REGISTER_MEDIA_STATE_RECEIVER,a),i.addEventListener(b.UNREGISTER_MEDIA_STATE_RECEIVER,r);let n=p=>{p.forEach(f=>{let{addedNodes:A=[],removedNodes:T=[],type:B,target:Z,attributeName:I}=f;B==="childList"?(Array.prototype.forEach.call(A,ne=>ot(ne,e)),Array.prototype.forEach.call(T,ne=>ot(ne,t))):B==="attributes"&&I===v.MEDIA_CHROME_ATTRIBUTES&&(xr(Z)?e(Z):t(Z))})},s=[],l=p=>{let f=p.target;f.name!=="media"&&(s.forEach(A=>ot(A,t)),s=[...f.assignedElements({flatten:!0})],s.forEach(A=>ot(A,e)))};i.addEventListener("slotchange",l);let u=new MutationObserver(n);return u.observe(i,{childList:!0,attributes:!0,subtree:!0}),()=>{ot(i,t),i.removeEventListener("slotchange",l),u.disconnect(),i.removeEventListener(b.REGISTER_MEDIA_STATE_RECEIVER,a),i.removeEventListener(b.UNREGISTER_MEDIA_STATE_RECEIVER,r)}};d.customElements.get("media-controller")||d.customElements.define("media-controller",pa);var Nr=pa;var qs=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ce=(i,e,t)=>(qs(i,e,"read from private field"),t?t.call(i):e.get(i)),Ea=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},pi=(i,e,t,a)=>(qs(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ba,ge,va,fa,Qs=c.createElement("template"),Zs=`
|
|
193
202
|
height: var(--thumb-height);
|
|
194
203
|
width: var(--media-range-thumb-width, 10px);
|
|
195
204
|
border: var(--media-range-thumb-border, none);
|
|
@@ -200,7 +209,7 @@
|
|
|
200
209
|
transition: var(--media-range-thumb-transition, none);
|
|
201
210
|
transform: var(--media-range-thumb-transform, none);
|
|
202
211
|
opacity: var(--media-range-thumb-opacity, 1);
|
|
203
|
-
`,
|
|
212
|
+
`,Pr=`
|
|
204
213
|
min-width: 40px;
|
|
205
214
|
height: var(--track-height);
|
|
206
215
|
border: var(--media-range-track-border, none);
|
|
@@ -212,7 +221,7 @@
|
|
|
212
221
|
transition: var(--media-range-track-transition, none);
|
|
213
222
|
transform: translate(var(--media-range-track-translate-x, 0), var(--media-range-track-translate-y, 0));
|
|
214
223
|
cursor: pointer;
|
|
215
|
-
`;
|
|
224
|
+
`;Qs.innerHTML=`
|
|
216
225
|
<style>
|
|
217
226
|
:host {
|
|
218
227
|
--thumb-height: var(--media-range-thumb-height, 10px);
|
|
@@ -270,19 +279,19 @@
|
|
|
270
279
|
|
|
271
280
|
input[type=range]::-webkit-slider-thumb {
|
|
272
281
|
-webkit-appearance: none;
|
|
273
|
-
${
|
|
282
|
+
${Zs}
|
|
274
283
|
|
|
275
284
|
margin-top: calc(calc(0px - var(--thumb-height) + var(--track-height)) / 2);
|
|
276
285
|
}
|
|
277
286
|
|
|
278
287
|
|
|
279
288
|
input[type=range]::-moz-range-thumb {
|
|
280
|
-
${
|
|
289
|
+
${Zs}
|
|
281
290
|
translate: var(--media-range-track-translate-x, 0) var(--media-range-track-translate-y, 0);
|
|
282
291
|
}
|
|
283
292
|
|
|
284
|
-
input[type=range]::-webkit-slider-runnable-track { ${
|
|
285
|
-
input[type=range]::-moz-range-track { ${
|
|
293
|
+
input[type=range]::-webkit-slider-runnable-track { ${Pr} }
|
|
294
|
+
input[type=range]::-moz-range-track { ${Pr} }
|
|
286
295
|
input[type=range]::-ms-track {
|
|
287
296
|
|
|
288
297
|
width: 100%;
|
|
@@ -292,7 +301,7 @@
|
|
|
292
301
|
border-color: transparent;
|
|
293
302
|
color: transparent;
|
|
294
303
|
|
|
295
|
-
${
|
|
304
|
+
${Pr}
|
|
296
305
|
}
|
|
297
306
|
|
|
298
307
|
#background,
|
|
@@ -352,26 +361,33 @@
|
|
|
352
361
|
<div id="hoverzone"></div>
|
|
353
362
|
<input id="range" type="range" min="0" max="1000" step="any" value="0">
|
|
354
363
|
</div>
|
|
355
|
-
`;var
|
|
364
|
+
`;var dt=class extends d.HTMLElement{constructor(){super(),Ea(this,ba,void 0),Ea(this,ge,void 0),Ea(this,va,()=>{if(this.range.matches(":focus-visible")){let{style:t}=L(this.shadowRoot,":host");t.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),Ea(this,fa,()=>{let{style:t}=L(this.shadowRoot,":host");t.removeProperty("--_focus-visible-box-shadow")}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Qs.content.cloneNode(!0)));let{style:e}=L(this.shadowRoot,":host");e.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-block))`),this.container=this.shadowRoot.querySelector("#container"),this.range=this.shadowRoot.querySelector("#range"),this.range.addEventListener("input",this.updateBar.bind(this)),pi(this,ba,parseInt(getComputedStyle(this).getPropertyValue("--media-range-thumb-width")||"10",10))}static get observedAttributes(){return["disabled","aria-disabled",v.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n,s,l,u;e===v.MEDIA_CONTROLLER?(t&&((n=(r=Ce(this,ge))==null?void 0:r.unassociateElement)==null||n.call(r,this),pi(this,ge,null)),a&&(pi(this,ge,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=Ce(this,ge))==null?void 0:l.associateElement)==null||u.call(l,this))):(e==="disabled"||e==="aria-disabled"&&t!==a)&&(a==null?this.range.removeAttribute(e):this.range.setAttribute(e,a))}connectedCallback(){var e,t,a;let r=this.getAttribute(v.MEDIA_CONTROLLER);r&&(pi(this,ge,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=Ce(this,ge))==null?void 0:t.associateElement)==null||a.call(t,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",Ce(this,va)),this.shadowRoot.addEventListener("focusout",Ce(this,fa))}disconnectedCallback(){var e,t;(t=(e=Ce(this,ge))==null?void 0:e.unassociateElement)==null||t.call(e,this),pi(this,ge,null),this.shadowRoot.removeEventListener("focusin",Ce(this,va)),this.shadowRoot.removeEventListener("focusout",Ce(this,fa))}updatePointerBar(e){let t=this.range.getBoundingClientRect(),a=(e.clientX-t.left)/t.width;a=Math.max(0,Math.min(1,a));let{style:r}=L(this.shadowRoot,"#pointer");r.setProperty("width",`${a*t.width}px`)}updateBar(){let e=this.getBarColors(),t="linear-gradient(to right, ",a=0;e.forEach(n=>{n[1]<a||(t=t+`${n[0]} ${a}%, ${n[0]} ${n[1]}%,`,a=n[1])}),t=t.slice(0,t.length-1)+")";let{style:r}=L(this.shadowRoot,"#range");r.setProperty("--media-range-track-progress-internal",t)}getBarColors(){let e=this.range,t=e.value-e.min,a=e.max-e.min,r=t/a*100,n=0;return e.value>e.min&&e.value<e.max&&(n=Ce(this,ba)*(.5-r/100)/e.offsetWidth*100),[["var(--media-range-bar-color, var(--media-primary-color, rgb(238 238 238)))",r+n],["var(--media-range-track-color, transparent)",100]]}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};ba=new WeakMap;ge=new WeakMap;va=new WeakMap;fa=new WeakMap;d.customElements.get("media-chrome-range")||d.customElements.define("media-chrome-range",dt);var zs=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ga=(i,e,t)=>(zs(i,e,"read from private field"),t?t.call(i):e.get(i)),Ld=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Aa=(i,e,t,a)=>(zs(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ae,Xs=c.createElement("template");Xs.innerHTML=`
|
|
356
365
|
<style>
|
|
357
366
|
:host {
|
|
358
367
|
|
|
359
368
|
box-sizing: border-box;
|
|
360
369
|
display: var(--media-control-display, var(--media-control-bar-display, inline-flex));
|
|
361
370
|
color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));
|
|
362
|
-
--media-loading-icon-
|
|
371
|
+
--media-loading-indicator-icon-height: 44px;
|
|
363
372
|
}
|
|
364
373
|
|
|
365
374
|
media-time-range,
|
|
366
375
|
::slotted(media-time-range),
|
|
367
|
-
::slotted(media-progress-range),
|
|
368
376
|
::slotted(media-clip-selector) {
|
|
369
377
|
flex-grow: 1;
|
|
370
378
|
}
|
|
379
|
+
|
|
380
|
+
media-time-range,
|
|
381
|
+
::slotted(media-time-range),
|
|
382
|
+
::slotted(media-clip-selector),
|
|
383
|
+
media-volume-range,
|
|
384
|
+
::slotted(media-volume-range) {
|
|
385
|
+
height: var(--_range-auto-size, calc(var(--media-control-height, 24px) + 2 * var(--_media-range-padding)));
|
|
386
|
+
}
|
|
371
387
|
</style>
|
|
372
388
|
|
|
373
389
|
<slot></slot>
|
|
374
|
-
`;var
|
|
390
|
+
`;var Ur=class extends d.HTMLElement{constructor(){super(),Ld(this,Ae,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Xs.content.cloneNode(!0))),this.shadowRoot.querySelector("slot").addEventListener("slotchange",({target:e})=>{let t=e.assignedElements({flatten:!0}).every(n=>["media-time-range","media-volume-range"].includes(n.nodeName.toLowerCase())),{style:a}=L(this.shadowRoot,":host"),r=t?"unset":"initial";a.setProperty("--_range-auto-size",r)})}static get observedAttributes(){return[v.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n,s,l,u;e===v.MEDIA_CONTROLLER&&(t&&((n=(r=ga(this,Ae))==null?void 0:r.unassociateElement)==null||n.call(r,this),Aa(this,Ae,null)),a&&(Aa(this,Ae,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=ga(this,Ae))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(v.MEDIA_CONTROLLER);r&&(Aa(this,Ae,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=ga(this,Ae))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=ga(this,Ae))==null?void 0:e.unassociateElement)==null||t.call(e,this),Aa(this,Ae,null)}};Ae=new WeakMap;d.customElements.get("media-control-bar")||d.customElements.define("media-control-bar",Ur);var Js=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},_a=(i,e,t)=>(Js(i,e,"read from private field"),t?t.call(i):e.get(i)),wd=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ya=(i,e,t,a)=>(Js(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),_e,js=c.createElement("template");js.innerHTML=`
|
|
375
391
|
<style>
|
|
376
392
|
:host {
|
|
377
393
|
font: var(--media-font,
|
|
@@ -380,7 +396,7 @@
|
|
|
380
396
|
var(--media-text-content-height, var(--media-control-height, 24px))
|
|
381
397
|
var(--media-font-family, helvetica neue, segoe ui, roboto, arial, sans-serif));
|
|
382
398
|
color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));
|
|
383
|
-
background: var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7)));
|
|
399
|
+
background: var(--media-text-background, var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7))));
|
|
384
400
|
padding: var(--media-control-padding, 10px);
|
|
385
401
|
display: inline-flex;
|
|
386
402
|
justify-content: center;
|
|
@@ -404,49 +420,49 @@
|
|
|
404
420
|
}
|
|
405
421
|
</style>
|
|
406
422
|
<slot></slot>
|
|
407
|
-
`;var
|
|
423
|
+
`;var Re=class extends d.HTMLElement{constructor(){super(),wd(this,_e,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(js.content.cloneNode(!0)));let{style:e}=L(this.shadowRoot,":host");e.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`)}static get observedAttributes(){return[v.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n,s,l,u;e===v.MEDIA_CONTROLLER&&(t&&((n=(r=_a(this,_e))==null?void 0:r.unassociateElement)==null||n.call(r,this),ya(this,_e,null)),a&&(ya(this,_e,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=_a(this,_e))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(v.MEDIA_CONTROLLER);r&&(ya(this,_e,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=_a(this,_e))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=_a(this,_e))==null?void 0:e.unassociateElement)==null||t.call(e,this),ya(this,_e,null)}};_e=new WeakMap;d.customElements.get("media-text-display")||d.customElements.define("media-text-display",Re);var to=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},eo=(i,e,t)=>(to(i,e,"read from private field"),t?t.call(i):e.get(i)),Cd=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Rd=(i,e,t,a)=>(to(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ei,Br=class extends Re{constructor(){super(),Cd(this,Ei,void 0),Rd(this,Ei,this.shadowRoot.querySelector("slot")),eo(this,Ei).textContent=ve(0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_DURATION]}attributeChangedCallback(e,t,a){e===o.MEDIA_DURATION&&(eo(this,Ei).textContent=ve(a)),super.attributeChangedCallback(e,t,a)}get mediaDuration(){return O(this,o.MEDIA_DURATION)}set mediaDuration(e){P(this,o.MEDIA_DURATION,e)}};Ei=new WeakMap;d.customElements.get("media-duration-display")||d.customElements.define("media-duration-display",Br);var no=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},$r=(i,e,t)=>(no(i,e,"read from private field"),t?t.call(i):e.get(i)),Dd=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},xd=(i,e,t,a)=>(no(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ut,De={REMAINING:"remaining",SHOW_DURATION:"showduration"},io=[...Object.values(De),o.MEDIA_CURRENT_TIME,o.MEDIA_DURATION,o.MEDIA_SEEKABLE],ao=["Enter"," "],Od=" / ",ro=(i,{timesSep:e=Od}={})=>{var t,a,r,n;let s=i.hasAttribute(De.REMAINING),l=i.hasAttribute(De.SHOW_DURATION),u=(t=i.mediaCurrentTime)!=null?t:0,[,m]=(a=i.mediaSeekable)!=null?a:[],p=(n=(r=i.mediaDuration)!=null?r:m)!=null?n:0,f=s?ve(0-(p-u)):ve(u);return l?`${f}${e}${ve(p)}`:f},Nd="video not loaded, unknown time.",Pd=i=>{var e;let t=i.mediaCurrentTime,[,a]=(e=i.mediaSeekable)!=null?e:[],r=i.mediaDuration||a;if(t==null||r==null){i.setAttribute("aria-valuetext",Nd);return}let n=i.hasAttribute(De.REMAINING),s=i.hasAttribute(De.SHOW_DURATION),l=n?rt(0-(r-t)):rt(t);if(!s){i.setAttribute("aria-valuetext",l);return}let u=rt(r),m=`${l} of ${u}`;i.setAttribute("aria-valuetext",m)},Vr=class extends Re{constructor(){super(),Dd(this,Ut,void 0),xd(this,Ut,this.shadowRoot.querySelector("slot")),$r(this,Ut).innerHTML=`${ro(this)}`;let{style:e}=L(this.shadowRoot,":host");e.setProperty("cursor","pointer");let{style:t}=L(this.shadowRoot,":host(:hover)");t.setProperty("background","var(--media-control-hover-background, rgba(50 50 70 / .7))")}static get observedAttributes(){return[...super.observedAttributes,...io,"disabled"]}connectedCallback(){this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","progressbar"),this.setAttribute("aria-label",q.PLAYBACK_TIME());let e=t=>{let{key:a}=t;if(!ao.includes(a)){this.removeEventListener("keyup",e);return}this.toggleTimeDisplay()};this.addEventListener("keydown",t=>{let{metaKey:a,altKey:r,key:n}=t;if(a||r||!ao.includes(n)){this.removeEventListener("keyup",e);return}this.addEventListener("keyup",e)}),this.addEventListener("click",this.toggleTimeDisplay),super.connectedCallback()}toggleTimeDisplay(){this.hasAttribute("remaining")?this.removeAttribute("remaining"):this.setAttribute("remaining","")}disconnectedCallback(){this.disable(),super.disconnectedCallback()}attributeChangedCallback(e,t,a){io.includes(e)?this.update():e==="disabled"&&a!==t&&(a==null?this.enable():this.disable()),super.attributeChangedCallback(e,t,a)}enable(){this.tabIndex=0}disable(){this.tabIndex=-1}get remaining(){return w(this,De.REMAINING)}set remaining(e){D(this,De.REMAINING,e)}get showDuration(){return w(this,De.SHOW_DURATION)}set showDuration(e){D(this,De.SHOW_DURATION,e)}get mediaDuration(){return O(this,o.MEDIA_DURATION)}set mediaDuration(e){P(this,o.MEDIA_DURATION,e)}get mediaCurrentTime(){return O(this,o.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){P(this,o.MEDIA_CURRENT_TIME,e)}get mediaSeekable(){let e=this.getAttribute(o.MEDIA_SEEKABLE);if(!!e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(o.MEDIA_SEEKABLE);return}this.setAttribute(o.MEDIA_SEEKABLE,e.join(":"))}update(){let e=ro(this);Pd(this),e!==$r(this,Ut).innerHTML&&($r(this,Ut).innerHTML=e)}};Ut=new WeakMap;d.customElements.get("media-time-display")||d.customElements.define("media-time-display",Vr);var Ud=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
408
424
|
<path d="M22.83 5.68a2.58 2.58 0 0 0-2.3-2.5c-3.62-.24-11.44-.24-15.06 0a2.58 2.58 0 0 0-2.3 2.5c-.23 4.21-.23 8.43 0 12.64a2.58 2.58 0 0 0 2.3 2.5c3.62.24 11.44.24 15.06 0a2.58 2.58 0 0 0 2.3-2.5c.23-4.21.23-8.43 0-12.64Zm-11.39 9.45a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.92 3.92 0 0 1 .92-2.77 3.18 3.18 0 0 1 2.43-1 2.94 2.94 0 0 1 2.13.78c.364.359.62.813.74 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.17 1.61 1.61 0 0 0-1.29.58 2.79 2.79 0 0 0-.5 1.89 3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.48 1.48 0 0 0 1-.37 2.1 2.1 0 0 0 .59-1.14l1.4.44a3.23 3.23 0 0 1-1.07 1.69Zm7.22 0a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.88 3.88 0 0 1 .93-2.77 3.14 3.14 0 0 1 2.42-1 3 3 0 0 1 2.16.82 2.8 2.8 0 0 1 .73 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.21 1.61 1.61 0 0 0-1.29.58A2.79 2.79 0 0 0 15 12a3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.44 1.44 0 0 0 1-.37 2.1 2.1 0 0 0 .6-1.15l1.4.44a3.17 3.17 0 0 1-1.1 1.7Z"/>
|
|
409
|
-
</svg>`,
|
|
425
|
+
</svg>`,Bd=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
410
426
|
<path d="M17.73 14.09a1.4 1.4 0 0 1-1 .37 1.579 1.579 0 0 1-1.27-.58A3 3 0 0 1 15 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34A2.89 2.89 0 0 0 19 9.07a3 3 0 0 0-2.14-.78 3.14 3.14 0 0 0-2.42 1 3.91 3.91 0 0 0-.93 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.17 3.17 0 0 0 1.07-1.74l-1.4-.45c-.083.43-.3.822-.62 1.12Zm-7.22 0a1.43 1.43 0 0 1-1 .37 1.58 1.58 0 0 1-1.27-.58A3 3 0 0 1 7.76 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34a2.81 2.81 0 0 0-.74-1.32 2.94 2.94 0 0 0-2.13-.78 3.18 3.18 0 0 0-2.43 1 4 4 0 0 0-.92 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.23 3.23 0 0 0 1.07-1.74l-1.4-.45a2.06 2.06 0 0 1-.6 1.07Zm12.32-8.41a2.59 2.59 0 0 0-2.3-2.51C18.72 3.05 15.86 3 13 3c-2.86 0-5.72.05-7.53.17a2.59 2.59 0 0 0-2.3 2.51c-.23 4.207-.23 8.423 0 12.63a2.57 2.57 0 0 0 2.3 2.5c1.81.13 4.67.19 7.53.19 2.86 0 5.72-.06 7.53-.19a2.57 2.57 0 0 0 2.3-2.5c.23-4.207.23-8.423 0-12.63Zm-1.49 12.53a1.11 1.11 0 0 1-.91 1.11c-1.67.11-4.45.18-7.43.18-2.98 0-5.76-.07-7.43-.18a1.11 1.11 0 0 1-.91-1.11c-.21-4.14-.21-8.29 0-12.43a1.11 1.11 0 0 1 .91-1.11C7.24 4.56 10 4.49 13 4.49s5.76.07 7.43.18a1.11 1.11 0 0 1 .91 1.11c.21 4.14.21 8.29 0 12.43Z"/>
|
|
411
|
-
</svg>`,
|
|
427
|
+
</svg>`,uo=c.createElement("template");uo.innerHTML=`
|
|
412
428
|
<style>
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
}
|
|
429
|
+
:host([aria-checked="true"]) slot[name=off] {
|
|
430
|
+
display: none !important;
|
|
431
|
+
}
|
|
417
432
|
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
}
|
|
433
|
+
|
|
434
|
+
:host(:not([aria-checked="true"])) slot[name=on] {
|
|
435
|
+
display: none !important;
|
|
436
|
+
}
|
|
423
437
|
</style>
|
|
424
|
-
|
|
425
|
-
<slot name="
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
`;var
|
|
438
|
+
|
|
439
|
+
<slot name="icon">
|
|
440
|
+
<slot name="on">${Ud}</slot>
|
|
441
|
+
<slot name="off">${Bd}</slot>
|
|
442
|
+
</slot>
|
|
443
|
+
`;var so=i=>{i.setAttribute("aria-checked",Lr(i))},oo=(i,e)=>{let t=i.getAttribute(e);return t?Ot(t):[]},lo=(i,e,t)=>{if(!t){i.removeAttribute(e);return}let a=ci(t);i.getAttribute(e)!==a&&i.setAttribute(e,a)},Hr=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}constructor(e={}){super({slotTemplate:uo,...e}),this._captionsReady=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",q.CLOSED_CAPTIONS()),so(this)}attributeChangedCallback(e,t,a){e===o.MEDIA_SUBTITLES_SHOWING&&so(this),super.attributeChangedCallback(e,t,a)}get mediaSubtitlesList(){return oo(this,o.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){lo(this,o.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return oo(this,o.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){lo(this,o.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){we(this)}};d.customElements.get("media-captions-button")||d.customElements.define("media-captions-button",Hr);function Bt(i){let e=Math.abs(i.seekOffset),t=R.SEEK_BACK_N_SECS({seekOffset:e});i.setAttribute("aria-label",t)}function $t(i,e){let t=ys(i,e),a=i.seekOffset;_s(t,a)}var Ta={SEEK_OFFSET:"seekoffset"},co=30,$d=`<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)">${co}</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>`,mo=c.createElement("template");mo.innerHTML=`
|
|
444
|
+
<slot name="forward">${$d}</slot>
|
|
445
|
+
`;var Vd=0,Wr=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,Ta.SEEK_OFFSET]}constructor(e={}){super({slotTemplate:mo,...e})}connectedCallback(){Bt(this),$t(this,"forward"),super.connectedCallback()}attributeChangedCallback(e,t,a){e===Ta.SEEK_OFFSET&&($t(this,"forward"),Bt(this)),super.attributeChangedCallback(e,t,a)}get seekOffset(){var e;return(e=O(this,Ta.SEEK_OFFSET))!=null?e:co}set seekOffset(e){P(this,Ta.SEEK_OFFSET,e)}get mediaCurrentTime(){var e;return(e=O(this,o.MEDIA_CURRENT_TIME))!=null?e:Vd}set mediaCurrentTime(e){P(this,o.MEDIA_CURRENT_TIME,e)}handleClick(){let e=this.mediaCurrentTime+this.seekOffset,t=new d.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};d.customElements.get("media-seek-forward-button")||d.customElements.define("media-seek-forward-button",Wr);var Hd=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
430
446
|
<path d="M16 3v2.5h3.5V9H22V3h-6ZM4 9h2.5V5.5H10V3H4v6Zm15.5 9.5H16V21h6v-6h-2.5v3.5ZM6.5 15H4v6h6v-2.5H6.5V15Z"/>
|
|
431
|
-
</svg>`,
|
|
447
|
+
</svg>`,Wd=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
432
448
|
<path d="M18.5 6.5V3H16v6h6V6.5h-3.5ZM16 21h2.5v-3.5H22V15h-6v6ZM4 17.5h3.5V21H10v-6H4v2.5Zm3.5-11H4V9h6V3H7.5v3.5Z"/>
|
|
433
|
-
</svg>`,
|
|
449
|
+
</svg>`,po=c.createElement("template");po.innerHTML=`
|
|
434
450
|
<style>
|
|
435
|
-
:host([${o.MEDIA_IS_FULLSCREEN}]) slot:not([name=exit])
|
|
436
|
-
:host([${o.MEDIA_IS_FULLSCREEN}]) ::slotted(:not([slot=exit])) {
|
|
451
|
+
:host([${o.MEDIA_IS_FULLSCREEN}]) slot:not([name=exit]):not([name=icon]) {
|
|
437
452
|
display: none !important;
|
|
438
453
|
}
|
|
439
454
|
|
|
440
455
|
|
|
441
|
-
:host(:not([${o.MEDIA_IS_FULLSCREEN}])) slot:not([name=enter])
|
|
442
|
-
:host(:not([${o.MEDIA_IS_FULLSCREEN}])) ::slotted(:not([slot=enter])) {
|
|
456
|
+
:host(:not([${o.MEDIA_IS_FULLSCREEN}])) slot:not([name=enter]):not([name=icon]) {
|
|
443
457
|
display: none !important;
|
|
444
458
|
}
|
|
445
459
|
</style>
|
|
446
460
|
|
|
447
|
-
<slot name="
|
|
448
|
-
|
|
449
|
-
|
|
461
|
+
<slot name="icon">
|
|
462
|
+
<slot name="enter">${Hd}</slot>
|
|
463
|
+
<slot name="exit">${Wd}</slot>
|
|
464
|
+
</slot>
|
|
465
|
+
`;var ho=i=>{let e=i.mediaIsFullscreen?R.EXIT_FULLSCREEN():R.ENTER_FULLSCREEN();i.setAttribute("aria-label",e)},Fr=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_FULLSCREEN,o.MEDIA_FULLSCREEN_UNAVAILABLE]}constructor(e={}){super({slotTemplate:po,...e})}connectedCallback(){ho(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_IS_FULLSCREEN&&ho(this),super.attributeChangedCallback(e,t,a)}get mediaFullscreenUnavailable(){return H(this,o.MEDIA_FULLSCREEN_UNAVAILABLE)}set mediaFullscreenUnavailable(e){F(this,o.MEDIA_FULLSCREEN_UNAVAILABLE,e)}get mediaIsFullscreen(){return w(this,o.MEDIA_IS_FULLSCREEN)}set mediaIsFullscreen(e){D(this,o.MEDIA_IS_FULLSCREEN,e)}handleClick(){let e=this.mediaIsFullscreen?b.MEDIA_EXIT_FULLSCREEN_REQUEST:b.MEDIA_ENTER_FULLSCREEN_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-fullscreen-button")||d.customElements.define("media-fullscreen-button",Fr);var{MEDIA_TIME_IS_LIVE:Ia,MEDIA_PAUSED:bi}=o,{MEDIA_SEEK_TO_LIVE_REQUEST:Fd,MEDIA_PLAY_REQUEST:Kd}=b,Yd='<svg viewBox="0 0 6 12"><circle cx="3" cy="6" r="2"></circle></svg>',Eo=c.createElement("template");Eo.innerHTML=`
|
|
450
466
|
<style>
|
|
451
467
|
|
|
452
468
|
slot[name=indicator] > *,
|
|
@@ -457,97 +473,94 @@
|
|
|
457
473
|
color: var(--media-live-button-icon-color, rgb(140, 140, 140));
|
|
458
474
|
}
|
|
459
475
|
|
|
460
|
-
:host([${
|
|
461
|
-
:host([${
|
|
462
|
-
fill: var(--media-live-indicator-color, rgb(255, 0, 0));
|
|
463
|
-
color: var(--media-live-indicator-color, rgb(255, 0, 0));
|
|
476
|
+
:host([${Ia}]:not([${bi}])) slot[name=indicator] > *,
|
|
477
|
+
:host([${Ia}]:not([${bi}])) ::slotted([slot=indicator]) {
|
|
478
|
+
fill: var(--media-live-button-indicator-color, rgb(255, 0, 0));
|
|
479
|
+
color: var(--media-live-button-indicator-color, rgb(255, 0, 0));
|
|
464
480
|
}
|
|
465
481
|
|
|
466
|
-
:host([${
|
|
482
|
+
:host([${Ia}]:not([${bi}])) {
|
|
467
483
|
cursor: not-allowed;
|
|
468
484
|
}
|
|
469
485
|
|
|
470
486
|
</style>
|
|
471
487
|
|
|
472
|
-
<slot name="indicator">${
|
|
488
|
+
<slot name="indicator">${Yd}</slot>
|
|
473
489
|
|
|
474
490
|
<slot name="spacer"> </slot><slot name="text">LIVE</slot>
|
|
475
|
-
`;var
|
|
491
|
+
`;var Kr=class extends C{static get observedAttributes(){return[...super.observedAttributes,bi,Ia]}constructor(e={}){super({slotTemplate:Eo,...e}),this.setAttribute("aria-label",R.SEEK_LIVE())}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),this.mediaPaused||!this.mediaTimeIsLive?(this.setAttribute("aria-label",R.SEEK_LIVE()),this.removeAttribute("aria-disabled")):(this.setAttribute("aria-label",R.PLAYING_LIVE()),this.setAttribute("aria-disabled","true"))}get mediaPaused(){return w(this,o.MEDIA_PAUSED)}set mediaPaused(e){D(this,o.MEDIA_PAUSED,e)}get mediaTimeIsLive(){return w(this,o.MEDIA_TIME_IS_LIVE)}set mediaTimeIsLive(e){D(this,o.MEDIA_TIME_IS_LIVE,e)}handleClick(){!this.mediaPaused&&this.mediaTimeIsLive||(this.dispatchEvent(new d.CustomEvent(Fd,{composed:!0,bubbles:!0})),this.hasAttribute(bi)&&this.dispatchEvent(new d.CustomEvent(Kd,{composed:!0,bubbles:!0})))}};d.customElements.get("media-live-button")||d.customElements.define("media-live-button",Kr);var{MEDIA_VOLUME_LEVEL:vi}=o,Gd=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
476
492
|
<path d="M16.5 12A4.5 4.5 0 0 0 14 8v2.18l2.45 2.45a4.22 4.22 0 0 0 .05-.63Zm2.5 0a6.84 6.84 0 0 1-.54 2.64L20 16.15A8.8 8.8 0 0 0 21 12a9 9 0 0 0-7-8.77v2.06A7 7 0 0 1 19 12ZM4.27 3 3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25A6.92 6.92 0 0 1 14 18.7v2.06A9 9 0 0 0 17.69 19l2 2.05L21 19.73l-9-9L4.27 3ZM12 4 9.91 6.09 12 8.18V4Z"/>
|
|
477
|
-
</svg>`,
|
|
493
|
+
</svg>`,bo=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
478
494
|
<path d="M3 9v6h4l5 5V4L7 9H3Zm13.5 3A4.5 4.5 0 0 0 14 8v8a4.47 4.47 0 0 0 2.5-4Z"/>
|
|
479
|
-
</svg>`,
|
|
495
|
+
</svg>`,Zd=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
480
496
|
<path d="M3 9v6h4l5 5V4L7 9H3Zm13.5 3A4.5 4.5 0 0 0 14 8v8a4.47 4.47 0 0 0 2.5-4ZM14 3.23v2.06a7 7 0 0 1 0 13.42v2.06a9 9 0 0 0 0-17.54Z"/>
|
|
481
|
-
</svg>`,
|
|
497
|
+
</svg>`,fo=c.createElement("template");fo.innerHTML=`
|
|
482
498
|
<style>
|
|
483
499
|
|
|
484
|
-
:host(:not([${
|
|
485
|
-
:host(
|
|
486
|
-
:host([${o.MEDIA_VOLUME_LEVEL}=high]) slot:not([name=high]) > *,
|
|
487
|
-
:host([${o.MEDIA_VOLUME_LEVEL}=high]) ::slotted(:not([slot=high])) {
|
|
500
|
+
:host(:not([${vi}])) slot:not([name=high]):not([name=icon]),
|
|
501
|
+
:host([${vi}=high]) slot:not([name=high]):not([name=icon]) {
|
|
488
502
|
display: none !important;
|
|
489
503
|
}
|
|
490
504
|
|
|
491
|
-
:host([${
|
|
492
|
-
:host([${o.MEDIA_VOLUME_LEVEL}=off]) ::slotted(:not([slot=off])) {
|
|
505
|
+
:host([${vi}=off]) slot:not([name=off]):not([name=icon]) {
|
|
493
506
|
display: none !important;
|
|
494
507
|
}
|
|
495
508
|
|
|
496
|
-
:host([${
|
|
497
|
-
:host([${o.MEDIA_VOLUME_LEVEL}=low]) ::slotted(:not([slot=low])) {
|
|
509
|
+
:host([${vi}=low]) slot:not([name=low]):not([name=icon]) {
|
|
498
510
|
display: none !important;
|
|
499
511
|
}
|
|
500
512
|
|
|
501
|
-
:host([${
|
|
502
|
-
:host([${o.MEDIA_VOLUME_LEVEL}=medium]) ::slotted(:not([slot=medium])) {
|
|
513
|
+
:host([${vi}=medium]) slot:not([name=medium]):not([name=icon]) {
|
|
503
514
|
display: none !important;
|
|
504
515
|
}
|
|
505
516
|
</style>
|
|
506
517
|
|
|
507
|
-
<slot name="
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
518
|
+
<slot name="icon">
|
|
519
|
+
<slot name="off">${Gd}</slot>
|
|
520
|
+
<slot name="low">${bo}</slot>
|
|
521
|
+
<slot name="medium">${bo}</slot>
|
|
522
|
+
<slot name="high">${Zd}</slot>
|
|
523
|
+
</slot>
|
|
524
|
+
`;var vo=i=>{let t=i.mediaVolumeLevel==="off"?R.UNMUTE():R.MUTE();i.setAttribute("aria-label",t)},Yr=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME_LEVEL]}constructor(e={}){super({slotTemplate:fo,...e})}connectedCallback(){vo(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_VOLUME_LEVEL&&vo(this),super.attributeChangedCallback(e,t,a)}get mediaVolumeLevel(){return H(this,o.MEDIA_VOLUME_LEVEL)}set mediaVolumeLevel(e){F(this,o.MEDIA_VOLUME_LEVEL,e)}handleClick(){let e=this.mediaVolumeLevel==="off"?b.MEDIA_UNMUTE_REQUEST:b.MEDIA_MUTE_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-mute-button")||d.customElements.define("media-mute-button",Yr);var go=`<svg aria-hidden="true" viewBox="0 0 28 24">
|
|
512
525
|
<path d="M24 3H4a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h20a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1Zm-1 16H5V5h18v14Zm-3-8h-7v5h7v-5Z"/>
|
|
513
|
-
</svg>`,
|
|
526
|
+
</svg>`,_o=c.createElement("template");_o.innerHTML=`
|
|
514
527
|
<style>
|
|
515
|
-
:host([${o.MEDIA_IS_PIP}]) slot:not([name=exit])
|
|
516
|
-
:host([${o.MEDIA_IS_PIP}]) ::slotted(:not([slot=exit])) {
|
|
528
|
+
:host([${o.MEDIA_IS_PIP}]) slot:not([name=exit]):not([name=icon]) {
|
|
517
529
|
display: none !important;
|
|
518
530
|
}
|
|
519
531
|
|
|
520
532
|
|
|
521
|
-
:host(:not([${o.MEDIA_IS_PIP}])) slot:not([name=enter])
|
|
522
|
-
:host(:not([${o.MEDIA_IS_PIP}])) ::slotted(:not([slot=enter])) {
|
|
533
|
+
:host(:not([${o.MEDIA_IS_PIP}])) slot:not([name=enter]):not([name=icon]) {
|
|
523
534
|
display: none !important;
|
|
524
535
|
}
|
|
525
536
|
</style>
|
|
526
537
|
|
|
527
|
-
<slot name="
|
|
528
|
-
|
|
529
|
-
|
|
538
|
+
<slot name="icon">
|
|
539
|
+
<slot name="enter">${go}</slot>
|
|
540
|
+
<slot name="exit">${go}</slot>
|
|
541
|
+
</slot>
|
|
542
|
+
`;var Ao=i=>{let e=i.mediaIsPip?R.EXIT_PIP():R.ENTER_PIP();i.setAttribute("aria-label",e)},Gr=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_PIP,o.MEDIA_PIP_UNAVAILABLE]}constructor(e={}){super({slotTemplate:_o,...e})}connectedCallback(){Ao(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_IS_PIP&&Ao(this),super.attributeChangedCallback(e,t,a)}get mediaPipUnavailable(){return H(this,o.MEDIA_PIP_UNAVAILABLE)}set mediaPipUnavailable(e){F(this,o.MEDIA_PIP_UNAVAILABLE,e)}get mediaIsPip(){return w(this,o.MEDIA_IS_PIP)}set mediaIsPip(e){D(this,o.MEDIA_IS_PIP,e)}handleClick(){let e=this.mediaIsPip?b.MEDIA_EXIT_PIP_REQUEST:b.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-pip-button")||d.customElements.define("media-pip-button",Gr);var qd=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
530
543
|
<path d="m6 21 15-9L6 3v18Z"/>
|
|
531
|
-
</svg>`,
|
|
544
|
+
</svg>`,Qd=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
532
545
|
<path d="M6 20h4V4H6v16Zm8-16v16h4V4h-4Z"/>
|
|
533
|
-
</svg>`,
|
|
546
|
+
</svg>`,To=c.createElement("template");To.innerHTML=`
|
|
534
547
|
<style>
|
|
535
|
-
:host([${o.MEDIA_PAUSED}]) slot[name=pause]
|
|
536
|
-
:host([${o.MEDIA_PAUSED}]) ::slotted([slot=pause]) {
|
|
548
|
+
:host([${o.MEDIA_PAUSED}]) slot[name=pause] {
|
|
537
549
|
display: none !important;
|
|
538
550
|
}
|
|
539
551
|
|
|
540
|
-
:host(:not([${o.MEDIA_PAUSED}])) slot[name=play]
|
|
541
|
-
:host(:not([${o.MEDIA_PAUSED}])) ::slotted([slot=play]) {
|
|
552
|
+
:host(:not([${o.MEDIA_PAUSED}])) slot[name=play] {
|
|
542
553
|
display: none !important;
|
|
543
554
|
}
|
|
544
555
|
</style>
|
|
545
556
|
|
|
546
|
-
<slot name="
|
|
547
|
-
|
|
548
|
-
|
|
557
|
+
<slot name="icon">
|
|
558
|
+
<slot name="play">${qd}</slot>
|
|
559
|
+
<slot name="pause">${Qd}</slot>
|
|
560
|
+
</slot>
|
|
561
|
+
`;var yo=i=>{let e=i.mediaPaused?R.PLAY():R.PAUSE();i.setAttribute("aria-label",e)},Zr=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PAUSED,o.MEDIA_ENDED]}constructor(e={}){super({slotTemplate:To,...e})}connectedCallback(){yo(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_PAUSED&&yo(this),super.attributeChangedCallback(e,t,a)}get mediaPaused(){return w(this,o.MEDIA_PAUSED)}set mediaPaused(e){D(this,o.MEDIA_PAUSED,e)}handleClick(){let e=this.mediaPaused?b.MEDIA_PLAY_REQUEST:b.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-play-button")||d.customElements.define("media-play-button",Zr);var zd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ka=(i,e,t)=>(zd(i,e,"read from private field"),t?t.call(i):e.get(i)),Xd=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Vt,qr={RATES:"rates"},Jd=[1,1.25,1.5,1.75,2],Sa=1,Io=c.createElement("template");Io.innerHTML=`
|
|
549
562
|
<span id="container"></span>
|
|
550
|
-
`;var
|
|
563
|
+
`;var Qr=class extends C{constructor(e={}){super({slotTemplate:Io,...e}),Xd(this,Vt,new xt(this,qr.RATES,{defaultValue:Jd})),this.container=this.shadowRoot.querySelector("#container"),this.container.innerHTML=`${Sa}x`}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,qr.RATES]}attributeChangedCallback(e,t,a){if(e===qr.RATES&&(ka(this,Vt).value=a),e===o.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,n=Number.isNaN(r)?Sa:r;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",q.PLAYBACK_RATE({playbackRate:n}));return}super.attributeChangedCallback(e,t,a)}get rates(){return ka(this,Vt)}set rates(e){e?Array.isArray(e)&&(ka(this,Vt).value=e.join(" ")):ka(this,Vt).value=""}get mediaPlaybackRate(){var e;return(e=O(this,o.MEDIA_PLAYBACK_RATE))!=null?e:Sa}set mediaPlaybackRate(e){P(this,o.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,t;let a=Array.from(this.rates.values(),s=>+s).sort(),r=(t=(e=a.find(s=>s>this.mediaPlaybackRate))!=null?e:a[0])!=null?t:Sa,n=new d.CustomEvent(b.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)}};Vt=new WeakMap;d.customElements.get("media-playback-rate-button")||d.customElements.define("media-playback-rate-button",Qr);var ye={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"},ko=c.createElement("template");ko.innerHTML=`
|
|
551
564
|
<style>
|
|
552
565
|
:host {
|
|
553
566
|
pointer-events: none;
|
|
@@ -561,17 +574,17 @@
|
|
|
561
574
|
min-width: 100%;
|
|
562
575
|
min-height: 100%;
|
|
563
576
|
background-repeat: no-repeat;
|
|
564
|
-
background-position: var(--media-background-position, var(--media-object-position, center));
|
|
565
|
-
background-size: var(--media-background-size, var(--media-object-fit, contain));
|
|
577
|
+
background-position: var(--media-poster-image-background-position, var(--media-object-position, center));
|
|
578
|
+
background-size: var(--media-poster-image-background-size, var(--media-object-fit, contain));
|
|
566
579
|
object-fit: var(--media-object-fit, contain);
|
|
567
580
|
object-position: var(--media-object-position, center);
|
|
568
581
|
}
|
|
569
582
|
</style>
|
|
570
583
|
|
|
571
584
|
<img aria-hidden="true" id="image"/>
|
|
572
|
-
`;var
|
|
573
|
-
<slot name="backward">${
|
|
574
|
-
`;var
|
|
585
|
+
`;var jd=i=>{i.style.removeProperty("background-image")},eu=(i,e)=>{i.style["background-image"]=`url('${e}')`},zr=class extends d.HTMLElement{static get observedAttributes(){return[ye.PLACEHOLDER_SRC,ye.SRC]}constructor(){super(),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(ko.content.cloneNode(!0))),this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,t,a){e===ye.SRC&&(a==null?this.image.removeAttribute(ye.SRC):this.image.setAttribute(ye.SRC,a)),e===ye.PLACEHOLDER_SRC&&(a==null?jd(this.image):eu(this.image,a))}get placeholderSrc(){return H(this,ye.PLACEHOLDER_SRC)}set placeholderSrc(e){F(this,ye.SRC,e)}get src(){return H(this,ye.SRC)}set src(e){F(this,ye.SRC,e)}};d.customElements.get("media-poster-image")||d.customElements.define("media-poster-image",zr);var Ma={SEEK_OFFSET:"seekoffset"},So=30,tu=`<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)">${So}</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>`,Mo=c.createElement("template");Mo.innerHTML=`
|
|
586
|
+
<slot name="backward">${tu}</slot>
|
|
587
|
+
`;var iu=0,Xr=class extends C{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,Ma.SEEK_OFFSET]}constructor(e={}){super({slotTemplate:Mo,...e})}connectedCallback(){Bt(this),$t(this,"backward"),super.connectedCallback()}attributeChangedCallback(e,t,a){e===Ma.SEEK_OFFSET&&($t(this,"backward"),Bt(this)),super.attributeChangedCallback(e,t,a)}get seekOffset(){var e;return(e=O(this,Ma.SEEK_OFFSET))!=null?e:So}set seekOffset(e){P(this,Ma.SEEK_OFFSET,e)}get mediaCurrentTime(){var e;return(e=O(this,o.MEDIA_CURRENT_TIME))!=null?e:iu}set mediaCurrentTime(e){P(this,o.MEDIA_CURRENT_TIME,e)}handleClick(){let e=Math.max(this.mediaCurrentTime-this.seekOffset,0),t=new d.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};d.customElements.get("media-seek-backward-button")||d.customElements.define("media-seek-backward-button",Xr);var wo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Lo=(i,e,t)=>(wo(i,e,"read from private field"),t?t.call(i):e.get(i)),au=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ru=(i,e,t,a)=>(wo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),fi,Jr=class extends Re{constructor(){super(),au(this,fi,void 0),ru(this,fi,this.shadowRoot.querySelector("slot")),Lo(this,fi).textContent=ve(0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,t,a){e===o.MEDIA_PREVIEW_TIME&&a!=null&&(Lo(this,fi).textContent=ve(a)),super.attributeChangedCallback(e,t,a)}get mediaPreviewTime(){return O(this,o.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){P(this,o.MEDIA_PREVIEW_TIME,e)}};fi=new WeakMap;d.customElements.get("media-preview-time-display")||d.customElements.define("media-preview-time-display",Jr);var Co=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},La=(i,e,t)=>(Co(i,e,"read from private field"),t?t.call(i):e.get(i)),nu=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},wa=(i,e,t,a)=>(Co(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Te,Ro=c.createElement("template");Ro.innerHTML=`
|
|
575
588
|
<style>
|
|
576
589
|
:host {
|
|
577
590
|
box-sizing: border-box;
|
|
@@ -584,8 +597,8 @@
|
|
|
584
597
|
position: relative;
|
|
585
598
|
}
|
|
586
599
|
</style>
|
|
587
|
-
<img crossorigin loading="eager" decoding="async"
|
|
588
|
-
`;var
|
|
600
|
+
<img crossorigin loading="eager" decoding="async">
|
|
601
|
+
`;var jr=class extends d.HTMLElement{constructor(){super(),nu(this,Te,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Ro.content.cloneNode(!0)))}static get observedAttributes(){return[v.MEDIA_CONTROLLER,o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,t,a;let r=this.getAttribute(v.MEDIA_CONTROLLER);r&&(wa(this,Te,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=La(this,Te))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=La(this,Te))==null?void 0:e.unassociateElement)==null||t.call(e,this),wa(this,Te,null)}attributeChangedCallback(e,t,a){var r,n,s,l,u;[o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===v.MEDIA_CONTROLLER&&(t&&((n=(r=La(this,Te))==null?void 0:r.unassociateElement)==null||n.call(r,this),wa(this,Te,null)),a&&(wa(this,Te,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=La(this,Te))==null?void 0:l.associateElement)==null||u.call(l,this)))}get mediaPreviewImage(){return H(this,o.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){F(this,o.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewCoords(){let e=this.getAttribute(o.MEDIA_PREVIEW_COORDS);if(!!e)return e.split(/\s+/).map(t=>+t)}set mediaPreviewCoords(e){if(!e){this.removeAttribute(o.MEDIA_PREVIEW_COORDS);return}this.setAttribute(o.MEDIA_PREVIEW_COORDS,e.join(" "))}update(){let e=this.mediaPreviewCoords,t=this.mediaPreviewImage;if(!(e&&t))return;let[a,r,n,s]=e,l=t.split("#")[0],u=getComputedStyle(this),{maxWidth:m,maxHeight:p,minWidth:f,minHeight:A}=u,T=Math.min(parseInt(m)/n,parseInt(p)/s),B=Math.max(parseInt(f)/n,parseInt(A)/s),Z=T<1,I=Z?T:B>1?B:1,{style:ne}=L(this.shadowRoot,":host"),be=L(this.shadowRoot,"img").style,oe=this.shadowRoot.querySelector("img"),si=Z?"min":"max";ne.setProperty(`${si}-width`,"initial","important"),ne.setProperty(`${si}-height`,"initial","important"),ne.width=`${n*I}px`,ne.height=`${s*I}px`;let St=()=>{be.width=`${this.imgWidth*I}px`,be.height=`${this.imgHeight*I}px`,be.display="block"};oe.src!==l&&(oe.onload=()=>{this.imgWidth=oe.naturalWidth,this.imgHeight=oe.naturalHeight,St()},oe.src=l,St()),St(),be.transform=`translate(-${a*I}px, -${r*I}px)`}};Te=new WeakMap;d.customElements.get("media-preview-thumbnail")||d.customElements.define("media-preview-thumbnail",jr);var dn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},$=(i,e,t)=>(dn(i,e,"read from private field"),t?t.call(i):e.get(i)),Q=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ze=(i,e,t,a)=>(dn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),gi=(i,e,t)=>(dn(i,e,"access private method"),t),Ai,Ca,_i,Na,Pa,Ra,tn,an,Do,Da,rn,xa,Ht,yi,nn,Ua,Ba,Oa,sn,on,xo,su="video not loaded, unknown time.",en=i=>{let e=i.range,t=rt(+e.value),a=rt(+e.max),r=t&&a?`${t} of ${a}`:su;e.setAttribute("aria-valuetext",r)},Oo=c.createElement("template");Oo.innerHTML=`
|
|
589
602
|
<style>
|
|
590
603
|
:host {
|
|
591
604
|
--media-preview-border-radius: 3px;
|
|
@@ -635,7 +648,7 @@
|
|
|
635
648
|
|
|
636
649
|
transition: visibility 0s .25s;
|
|
637
650
|
transition-delay: calc(var(--media-preview-transition-delay-out, 0s) + var(--media-preview-transition-duration-out, .25s));
|
|
638
|
-
background: var(--media-preview-
|
|
651
|
+
background: var(--media-preview-thumbnail-background, var(--media-preview-background, var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7)))));
|
|
639
652
|
box-shadow: var(--media-preview-thumbnail-box-shadow, 0 0 4px rgb(0 0 0 / .2));
|
|
640
653
|
max-width: var(--media-preview-thumbnail-max-width, 180px);
|
|
641
654
|
max-height: var(--media-preview-thumbnail-max-height, 160px);
|
|
@@ -690,7 +703,7 @@
|
|
|
690
703
|
|
|
691
704
|
</slot>
|
|
692
705
|
</div>
|
|
693
|
-
`;var
|
|
706
|
+
`;var ln=class extends dt{constructor(){super(),Q(this,Ra),Q(this,an),Q(this,Da),Q(this,Oa),Q(this,on),Q(this,Ai,void 0),Q(this,Ca,void 0),Q(this,_i,void 0),Q(this,Na,void 0),Q(this,Pa,void 0),Q(this,xa,t=>{if([...$(this,Ai)].some(p=>t.composedPath().includes(p)))return;this.updatePointerBar(t);let a=this.mediaDuration;if(!a)return;let r=this.range.getBoundingClientRect(),n=(t.clientX-r.left)/r.width;n=Math.max(0,Math.min(1,n));let s=gi(this,Da,rn).call(this,$(this,Ca),n),{style:l}=L(this.shadowRoot,"#preview-rail");l.transform=`translateX(${s})`;let u=n*a,m=new d.CustomEvent(b.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:u});this.dispatchEvent(m)}),Q(this,Ht,!1),Q(this,yi,t=>{(!t.composedPath().includes(this)||[...$(this,Ai)].some(a=>t.composedPath().includes(a)))&&(d.removeEventListener("pointermove",$(this,yi)),Ze(this,Ht,!1),$(this,Ua).call(this))}),Q(this,nn,()=>{d.addEventListener("pointermove",$(this,xa),!1)}),Q(this,Ua,()=>{d.removeEventListener("pointermove",$(this,xa));let t=new d.CustomEvent(b.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:null});this.dispatchEvent(t)}),Q(this,Ba,()=>{let t=this.getAttribute(o.MEDIA_DURATION);!$(this,Ht)&&t&&(Ze(this,Ht,!0),$(this,nn).call(this),d.addEventListener("pointermove",$(this,yi),!1))}),this.container.appendChild(Oo.content.cloneNode(!0)),this.range.addEventListener("input",()=>{cancelAnimationFrame(this._refreshId);let a=this.range.value,r=new d.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:a});this.dispatchEvent(r)}),this._refreshBar=()=>{let t=(performance.now()-this._updateTimestamp)/1e3;this.range.value=this.mediaCurrentTime+t*this.mediaPlaybackRate,this.updateBar(),this.updateCurrentBox(),this._refreshId=requestAnimationFrame(this._refreshBar)},Ze(this,Ai,this.shadowRoot.querySelectorAll('[part~="box"]')),Ze(this,Ca,this.shadowRoot.querySelector('[part~="preview-box"]')),Ze(this,_i,this.shadowRoot.querySelector('[part~="current-box"]'));let e=getComputedStyle(this);Ze(this,Na,parseInt(e.getPropertyValue("--media-box-padding-left"))),Ze(this,Pa,parseInt(e.getPropertyValue("--media-box-padding-right"))),gi(this,Oa,sn).call(this)}static get observedAttributes(){return[...super.observedAttributes,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",q.SEEK()),super.connectedCallback()}disconnectedCallback(){cancelAnimationFrame(this._refreshId),super.disconnectedCallback()}attributeChangedCallback(e,t,a){var r,n,s,l,u;(e===o.MEDIA_CURRENT_TIME||e===o.MEDIA_PAUSED||e===o.MEDIA_LOADING)&&(this._updateTimestamp=performance.now(),this.range.value=this.mediaCurrentTime,en(this),this.updateBar(),this.updateCurrentBox(),cancelAnimationFrame(this._refreshId),!this.mediaPaused&&!this.mediaLoading&&(this._refreshId=requestAnimationFrame(this._refreshBar))),e===o.MEDIA_DURATION&&(this.range.max=(n=(r=$(this,Ra,tn))!=null?r:this.mediaDuration)!=null?n:1e3,en(this),this.updateBar(),this.updateCurrentBox()),e===o.MEDIA_SEEKABLE&&(this.range.min=(s=$(this,an,Do))!=null?s:0,this.range.max=(u=(l=$(this,Ra,tn))!=null?l:this.mediaDuration)!=null?u:1e3,en(this),this.updateBar()),e===o.MEDIA_BUFFERED&&this.updateBar(),e==="disabled"&&(a==null?gi(this,Oa,sn).call(this):gi(this,on,xo).call(this)),super.attributeChangedCallback(e,t,a)}get mediaPaused(){return w(this,o.MEDIA_PAUSED)}set mediaPaused(e){D(this,o.MEDIA_PAUSED,e)}get mediaLoading(){return w(this,o.MEDIA_LOADING)}set mediaLoading(e){D(this,o.MEDIA_LOADING,e)}get mediaDuration(){return O(this,o.MEDIA_DURATION)}set mediaDuration(e){P(this,o.MEDIA_DURATION,e)}get mediaCurrentTime(){return O(this,o.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){P(this,o.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){var e;return(e=O(this,o.MEDIA_PLAYBACK_RATE))!=null?e:1}set mediaPlaybackrate(e){P(this,o.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){let e=this.getAttribute(o.MEDIA_BUFFERED);return e?e.split(" ").map(t=>t.split(":").map(a=>+a)):[]}set mediaBuffered(e){if(!e){this.removeAttribute(o.MEDIA_BUFFERED);return}let t=e.map((a,r)=>`${a}:${r}`).join(" ");this.setAttribute(o.MEDIA_BUFFERED,t)}get mediaSeekable(){let e=this.getAttribute(o.MEDIA_SEEKABLE);if(!!e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(o.MEDIA_SEEKABLE);return}this.setAttribute(o.MEDIA_SEEKABLE,e.join(":"))}get mediaPreviewImage(){return H(this,o.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){F(this,o.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return O(this,o.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){P(this,o.MEDIA_PREVIEW_TIME,e)}getBarColors(){var e;let t=super.getBarColors(),{range:a}=this,r=a.max-a.min,n=this.mediaBuffered;if(!n.length||!Number.isFinite(r)||r<=0)return t;let s=this.mediaCurrentTime,[,l=a.min]=(e=n.find(([p,f])=>p<=s&&s<=f))!=null?e:[],m=(l-a.min)/r*100;return t.splice(1,0,["var(--media-time-range-buffered-color, rgb(255 255 255 / .4))",m]),t}updateCurrentBox(){if(!$(this,_i).assignedElements().length)return;let e=this.range.value/(this.range.max-this.range.min),t=gi(this,Da,rn).call(this,$(this,_i),e),{style:a}=L(this.shadowRoot,"#current-rail");a.transform=`translateX(${t})`}};Ai=new WeakMap;Ca=new WeakMap;_i=new WeakMap;Na=new WeakMap;Pa=new WeakMap;Ra=new WeakSet;tn=function(){var i;let[,e]=(i=this.mediaSeekable)!=null?i:[];return e};an=new WeakSet;Do=function(){var i;let[e]=(i=this.mediaSeekable)!=null?i:[];return e};Da=new WeakSet;rn=function(i,e){var t;let a=`${e*100*100}%`,r=i.offsetWidth;if(!r)return a;let n=(t=this.getAttribute("bounds")?nt(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?t:this,s=this.range.getBoundingClientRect(),l=n.getBoundingClientRect(),u=($(this,Na)-(s.left-l.left-r/2))/s.width*100,m=(l.right-s.left-r/2-$(this,Pa))/s.width*100;return Number.isNaN(u)||(a=`max(${u*100}%, ${a})`),Number.isNaN(m)||(a=`min(${a}, ${m*100}%)`),a};xa=new WeakMap;Ht=new WeakMap;yi=new WeakMap;nn=new WeakMap;Ua=new WeakMap;Ba=new WeakMap;Oa=new WeakSet;sn=function(){this.addEventListener("pointermove",$(this,Ba),!1)};on=new WeakSet;xo=function(){d.removeEventListener("pointermove",$(this,yi)),this.removeEventListener("pointermove",$(this,Ba)),Ze(this,Ht,!1),$(this,Ua).call(this)};d.customElements.get("media-time-range")||d.customElements.define("media-time-range",ln);var Po=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Wt=(i,e,t)=>(Po(i,e,"read from private field"),t?t.call(i):e.get(i)),un=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ft=(i,e,t,a)=>(Po(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ie,$a,Va,No={LOADING_DELAY:"loadingdelay"},Uo=500,Bo=c.createElement("template"),ou=`
|
|
694
707
|
<svg aria-hidden="true" viewBox="0 0 100 100">
|
|
695
708
|
<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">
|
|
696
709
|
<animateTransform
|
|
@@ -703,12 +716,13 @@
|
|
|
703
716
|
repeatCount="indefinite" />
|
|
704
717
|
</path>
|
|
705
718
|
</svg>
|
|
706
|
-
`;
|
|
719
|
+
`;Bo.innerHTML=`
|
|
707
720
|
<style>
|
|
708
721
|
:host {
|
|
709
722
|
display: var(--media-control-display, var(--media-loading-indicator-display, inline-block));
|
|
710
723
|
vertical-align: middle;
|
|
711
724
|
box-sizing: border-box;
|
|
725
|
+
--_loading-indicator-delay: var(--media-loading-indicator-transition-delay, ${Uo}ms);
|
|
712
726
|
}
|
|
713
727
|
|
|
714
728
|
#status {
|
|
@@ -719,30 +733,37 @@
|
|
|
719
733
|
|
|
720
734
|
:host slot[name=loading] > *,
|
|
721
735
|
:host ::slotted([slot=loading]) {
|
|
722
|
-
opacity:
|
|
736
|
+
opacity: var(--media-loading-indicator-opacity, 0);
|
|
723
737
|
transition: opacity 0.15s;
|
|
724
738
|
}
|
|
725
739
|
|
|
726
|
-
:host(:not([
|
|
727
|
-
:host(:not([
|
|
728
|
-
opacity:
|
|
740
|
+
:host([${o.MEDIA_LOADING}]:not([${o.MEDIA_PAUSED}])) slot[name=loading] > *,
|
|
741
|
+
:host([${o.MEDIA_LOADING}]:not([${o.MEDIA_PAUSED}])) ::slotted([slot=loading]) {
|
|
742
|
+
opacity: var(--media-loading-indicator-opacity, 1);
|
|
743
|
+
transition: opacity 0.15s var(--_loading-indicator-delay);
|
|
729
744
|
}
|
|
730
745
|
|
|
731
|
-
:host
|
|
732
|
-
|
|
746
|
+
:host #status {
|
|
747
|
+
visibility: var(--media-loading-indicator-opacity, hidden);
|
|
748
|
+
transition: visibility 0.15s;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
:host([${o.MEDIA_LOADING}]:not([${o.MEDIA_PAUSED}])) #status {
|
|
752
|
+
visibility: var(--media-loading-indicator-opacity, visible);
|
|
753
|
+
transition: visibility 0.15s var(--_loading-indicator-delay);
|
|
733
754
|
}
|
|
734
755
|
|
|
735
756
|
svg, img, ::slotted(svg), ::slotted(img) {
|
|
736
|
-
width: var(--media-loading-icon-width
|
|
737
|
-
height: var(--media-loading-icon-height);
|
|
757
|
+
width: var(--media-loading-indicator-icon-width);
|
|
758
|
+
height: var(--media-loading-indicator-icon-height, 100px);
|
|
738
759
|
fill: var(--media-icon-color, var(--media-primary-color, rgb(238 238 238)));
|
|
739
760
|
vertical-align: middle;
|
|
740
761
|
}
|
|
741
762
|
</style>
|
|
742
763
|
|
|
743
|
-
<slot name="loading">${
|
|
744
|
-
<div id="status" role="status" aria-live="polite">${
|
|
745
|
-
`;var
|
|
764
|
+
<slot name="loading">${ou}</slot>
|
|
765
|
+
<div id="status" role="status" aria-live="polite">${q.MEDIA_LOADING()}</div>
|
|
766
|
+
`;var cn=class extends d.HTMLElement{constructor(){if(super(),un(this,Ie,void 0),un(this,$a,Uo),un(this,Va,void 0),!this.shadowRoot){let t=this.attachShadow({mode:"open"}),a=Bo.content.cloneNode(!0);t.appendChild(a)}let{style:e}=L(this.shadowRoot,":host");Ft(this,Va,e)}static get observedAttributes(){return[v.MEDIA_CONTROLLER,o.MEDIA_PAUSED,o.MEDIA_LOADING,No.LOADING_DELAY]}attributeChangedCallback(e,t,a){var r,n,s,l,u;e===No.LOADING_DELAY&&t!==a?this.loadingDelay=Number(a):e===v.MEDIA_CONTROLLER&&(t&&((n=(r=Wt(this,Ie))==null?void 0:r.unassociateElement)==null||n.call(r,this),Ft(this,Ie,null)),a&&(Ft(this,Ie,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=Wt(this,Ie))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(v.MEDIA_CONTROLLER);r&&(Ft(this,Ie,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=Wt(this,Ie))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Wt(this,Ie))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ft(this,Ie,null)}get loadingDelay(){return Wt(this,$a)}set loadingDelay(e){Ft(this,$a,e),Wt(this,Va).setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return w(this,o.MEDIA_PAUSED)}set mediaPaused(e){D(this,o.MEDIA_PAUSED,e)}get mediaLoading(){return w(this,o.MEDIA_LOADING)}set mediaLoading(e){D(this,o.MEDIA_LOADING,e)}};Ie=new WeakMap;$a=new WeakMap;Va=new WeakMap;d.customElements.get("media-loading-indicator")||d.customElements.define("media-loading-indicator",cn);var lu=100,du=1,uu=i=>i.mediaMuted?0:Math.round(i.mediaVolume*i.range.max),cu=({value:i,max:e})=>`${Math.round(i/e*100)}%`,mn=class extends dt{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME,o.MEDIA_MUTED,o.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.max=lu,this.range.addEventListener("input",()=>{let t=this.range.value/this.range.max,a=new d.CustomEvent(b.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(a)})}connectedCallback(){this.range.setAttribute("aria-label",q.VOLUME()),super.connectedCallback()}attributeChangedCallback(e,t,a){if(e===o.MEDIA_VOLUME||e===o.MEDIA_MUTED){let r=uu(this);this.range.value=r,this.range.setAttribute("aria-valuetext",cu(this.range)),this.updateBar()}super.attributeChangedCallback(e,t,a)}get mediaVolume(){var e;return(e=O(this,o.MEDIA_VOLUME))!=null?e:du}set mediaVolume(e){P(this,o.MEDIA_VOLUME,e)}get mediaMuted(){return w(this,o.MEDIA_MUTED)}set mediaMuted(e){D(this,o.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return H(this,o.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){F(this,o.MEDIA_VOLUME_UNAVAILABLE,e)}};d.customElements.get("media-volume-range")||d.customElements.define("media-volume-range",mn);var fn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},M=(i,e,t)=>(fn(i,e,"read from private field"),t?t.call(i):e.get(i)),J=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ue=(i,e,t,a)=>(fn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),xe=(i,e,t)=>(fn(i,e,"access private method"),t),Qe,Yt,Ti,Gt,Ii,Oe,Zt,hn,qe,ut,Ha,Wa,pn,Kt,En,ki,Fa,Ka,bn,vn,$o,gn,Vo,Ho=c.createElement("template");Ho.innerHTML=`
|
|
746
767
|
<style>
|
|
747
768
|
:host ul {
|
|
748
769
|
font: var(--media-font,
|
|
@@ -780,7 +801,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
|
|
|
780
801
|
<ul tabindex="0">
|
|
781
802
|
<slot></slot>
|
|
782
803
|
</ul>
|
|
783
|
-
`;var
|
|
804
|
+
`;var Ya=class extends d.HTMLElement{constructor(e={}){if(super(),J(this,Oe),J(this,qe),J(this,Wa),J(this,ki),J(this,Ka),J(this,vn),J(this,gn),J(this,Qe,""),J(this,Yt,null),J(this,Ti,void 0),J(this,Gt,void 0),J(this,Ii,!1),J(this,Ha,t=>{this.handleClick(t)}),J(this,Kt,t=>{let{key:a}=t;if(a==="Escape"){this.removeEventListener("keyup",M(this,Kt));return}if(a==="Meta"){ue(this,Ii,!1);return}xe(this,Wa,pn).call(this,t)}),J(this,En,t=>{let{key:a,altKey:r}=t;if(r){this.removeEventListener("keyup",M(this,Kt));return}if(a==="Meta"){ue(this,Ii,!0);return}if(this.keysUsed.includes(a)&&t.preventDefault(),M(this,Ii)&&this.keysUsed.includes(a)){xe(this,Wa,pn).call(this,t);return}this.addEventListener("keyup",M(this,Kt),{once:!0})}),!this.shadowRoot){let t=this.attachShadow({mode:"open"}),a=Ho.content.cloneNode(!0);this.nativeEl=a;let r=e.slotTemplate;r||(r=c.createElement("template"),r.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),t.appendChild(a)}ue(this,Ti,this.shadowRoot.querySelector("slot")),M(this,Ti).addEventListener("slotchange",()=>{ue(this,Oe,M(this,Ti).assignedElements({flatten:!0}),hn),M(this,Oe,Zt).length===1&&M(this,Oe,Zt)[0].nodeName.toLowerCase()==="slot"&&ue(this,Oe,M(this,Oe,Zt)[0].assignedElements({flatten:!0}),hn);let t=M(this,qe,ut);if(t.some(n=>n.getAttribute("tabindex")==="0"))return;let r=t.filter(n=>n.getAttribute("aria-selected")==="true")[0];r||(r=t[0]),r&&(r.setAttribute("tabindex",0),r.setAttribute("aria-selected","true"))})}static get observedAttributes(){return["disabled",v.MEDIA_CONTROLLER]}get selectedOptions(){return M(this,qe,ut).filter(e=>e.getAttribute("aria-selected")==="true")}get value(){return this.selectedOptions[0].value||this.selectedOptions[0].textContent}set value(e){let t=M(this,qe,ut).find(a=>a.value===e||a.textContent===e);!t||xe(this,Ka,bn).call(this,t)}focus(){var e;(e=this.selectedOptions[0])==null||e.focus()}enable(){this.addEventListener("click",M(this,Ha)),this.addEventListener("keydown",M(this,En))}disable(){this.removeEventListener("click",M(this,Ha)),this.removeEventListener("keyup",M(this,Kt))}attributeChangedCallback(e,t,a){var r,n;if(e===v.MEDIA_CONTROLLER){if(t){let s=c.getElementById(t);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=c.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}else e==="disabled"&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){var e;this.hasAttribute("disabled")||this.enable(),this.hasAttribute("role")||this.setAttribute("role","listbox");let t=this.getAttribute(v.MEDIA_CONTROLLER);if(t){let a=c.getElementById(t);(e=a==null?void 0:a.associateElement)==null||e.call(a,this)}}disconnectedCallback(){var e;this.disable();let t=this.getAttribute(v.MEDIA_CONTROLLER);if(t){let a=c.getElementById(t);(e=a==null?void 0:a.unassociateElement)==null||e.call(a,this)}}get keysUsed(){return["Enter"," ","ArrowDown","ArrowUp","Home","End"]}handleSelection(e,t){let a=xe(this,ki,Fa).call(this,e);!a||xe(this,Ka,bn).call(this,a,t)}handleMovement(e){let{key:t}=e,a=M(this,qe,ut),r=xe(this,ki,Fa).call(this,e);r||(r=a.filter(s=>s.getAttribute("tabindex")==="0")[0]);let n;switch(t){case"ArrowDown":n=r.nextElementSibling,n!=null&&n.hasAttribute("disabled")&&(n=n.nextElementSibling);break;case"ArrowUp":n=r.previousElementSibling,n!=null&&n.hasAttribute("disabled")&&(n=n.previousElementSibling);break;case"Home":n=a[0];break;case"End":n=a[a.length-1];break;default:n=xe(this,vn,$o).call(this,t);break}n&&(a.forEach(s=>s.setAttribute("tabindex","-1")),n.setAttribute("tabindex","0"),n.focus())}handleClick(e){let t=xe(this,ki,Fa).call(this,e);!t||t.hasAttribute("disabled")||(M(this,qe,ut).forEach(a=>a.setAttribute("tabindex","-1")),t.setAttribute("tabindex","0"),this.handleSelection(e,this.hasAttribute("aria-multiselectable")&&this.getAttribute("aria-multiselectable")==="true"))}};Qe=new WeakMap;Yt=new WeakMap;Ti=new WeakMap;Gt=new WeakMap;Ii=new WeakMap;Oe=new WeakSet;Zt=function(){return M(this,Gt)||ue(this,Gt,Array.from(this.shadowRoot.querySelectorAll("media-chrome-listitem"))),M(this,Gt)};hn=function(i){ue(this,Gt,i)};qe=new WeakSet;ut=function(){return M(this,Oe,Zt).filter(i=>!i.hasAttribute("disabled"))};Ha=new WeakMap;Wa=new WeakSet;pn=function(i){let{key:e}=i;e==="Enter"||e===" "?this.handleSelection(i,this.hasAttribute("aria-multiselectable")&&this.getAttribute("aria-multiselectable")==="true"):this.handleMovement(i)};Kt=new WeakMap;En=new WeakMap;ki=new WeakSet;Fa=function(i){let e=i.composedPath(),t=e.findIndex(a=>a.nodeName==="MEDIA-CHROME-LISTITEM");return e[t]};Ka=new WeakSet;bn=function(i,e){(!this.hasAttribute("aria-multiselectable")||this.getAttribute("aria-multiselectable")!=="true")&&M(this,Oe,Zt).forEach(t=>t.setAttribute("aria-selected","false")),e&&i.getAttribute("aria-selected")==="true"?i.setAttribute("aria-selected","false"):i.setAttribute("aria-selected","true"),this.dispatchEvent(new Event("change"))};vn=new WeakSet;$o=function(i){xe(this,gn,Vo).call(this);let e=M(this,qe,ut),t=e.findIndex(m=>m.getAttribute("tabindex")==="0");ue(this,Qe,M(this,Qe)+i);let a=M(this,Qe).split("").every(m=>m===i),r=e.slice(t+(a?1:0)).filter(m=>m.textContent.toLowerCase().startsWith(M(this,Qe))),n=e.slice(0,t-(a?1:0)).filter(m=>m.textContent.toLowerCase().startsWith(M(this,Qe))),s=[],l=[];return a&&(s=e.slice(t+(a?1:0)).filter(m=>m.textContent.startsWith(i)),l=e.slice(0,t-(a?1:0)).filter(m=>m.textContent.startsWith(i))),[...r,...n,...s,...l][0]};gn=new WeakSet;Vo=function(){d.clearTimeout(M(this,Yt)),ue(this,Yt,null),ue(this,Yt,d.setTimeout(()=>{ue(this,Qe,""),ue(this,Yt,null)},500))};d.customElements.get("media-chrome-listbox")||d.customElements.define("media-chrome-listbox",Ya);var Wo=Ya;var yn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},E=(i,e,t)=>(yn(i,e,"read from private field"),t?t.call(i):e.get(i)),z=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ce=(i,e,t,a)=>(yn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ne=(i,e,t)=>(yn(i,e,"access private method"),t),qt,Si,Qt,K,Mi,x,ke,Li,ct,zt,Ga,An,Fo,_n,Ko,Xt,wi,Tn,Yo,Za,In,Go=c.createElement("template");Go.innerHTML=`
|
|
784
805
|
<style>
|
|
785
806
|
:host {
|
|
786
807
|
display: inline-flex;
|
|
@@ -808,7 +829,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
|
|
|
808
829
|
<slot></slot>
|
|
809
830
|
</media-chrome-listbox>
|
|
810
831
|
</slot>
|
|
811
|
-
`;var
|
|
832
|
+
`;var qa=class extends d.HTMLElement{constructor(){var e;if(super(),z(this,An),z(this,_n),z(this,Xt),z(this,Tn),z(this,Za),z(this,qt,void 0),z(this,Si,void 0),z(this,Qt,!0),z(this,K,void 0),z(this,Mi,void 0),z(this,x,void 0),z(this,ke,void 0),z(this,Li,!1),z(this,ct,a=>{let{key:r}=a;if(!this.keysUsed.includes(r)){this.removeEventListener("keyup",E(this,ct));return}a.composedPath().includes(E(this,K))&&(r==="Enter"||r===" ")?E(this,qt).call(this):r==="Escape"&&!E(this,ke).hidden&&Ne(this,Xt,wi).call(this)}),z(this,zt,a=>{let{metaKey:r,altKey:n,key:s}=a;if(r||n||!this.keysUsed.includes(s)){this.removeEventListener("keyup",E(this,ct));return}a.preventDefault(),this.addEventListener("keyup",E(this,ct),{once:!0})}),z(this,Ga,a=>{a.composedPath().includes(this)||E(this,ke).hidden||Ne(this,Xt,wi).call(this)}),!this.shadowRoot){let a=this.attachShadow({mode:"open"}),r=Go.content.cloneNode(!0);this.nativeEl=r,a.appendChild(r)}let{style:t}=L(this.shadowRoot,":host");t.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),ce(this,qt,Ne(this,An,Fo).bind(this)),ce(this,Si,Ne(this,_n,Ko).bind(this)),(e=this.init)==null||e.call(this),ce(this,K,this.shadowRoot.querySelector("[part=button]")),ce(this,x,this.shadowRoot.querySelector("[part=listbox]")),ce(this,Mi,this.shadowRoot.querySelector("slot[name=button]")),E(this,Mi).addEventListener("slotchange",()=>{let a=E(this,Mi).assignedElements()[0];!a||(this.disable(),ce(this,K,a),E(this,K).preventClick=!0,E(this,K).hasAttribute("disabled")&&ce(this,Qt,!1),E(this,Qt)?(this.enable(),E(this,K).setAttribute("aria-haspopup","listbox")):this.disable())}),ce(this,ke,this.shadowRoot.querySelector("slot[name=listbox]")),E(this,ke).addEventListener("slotchange",()=>{this.disable(),ce(this,x,E(this,ke).assignedElements()[0]||E(this,x)),this.enable()})}static get observedAttributes(){return["disabled",v.MEDIA_CONTROLLER]}enable(){E(this,K).removeAttribute("disabled"),E(this,K).addEventListener("click",E(this,qt)),E(this,K).addEventListener("keydown",E(this,zt)),E(this,x).addEventListener("keydown",E(this,zt)),Ne(this,Za,In).call(this),E(this,x).addEventListener("change",E(this,Si)),c.addEventListener("click",E(this,Ga))}disable(){E(this,K).setAttribute("disabled",""),E(this,K).removeEventListener("click",E(this,qt)),E(this,K).removeEventListener("keydown",E(this,zt)),E(this,K).removeEventListener("keyup",E(this,ct)),E(this,x).removeEventListener("keydown",E(this,zt)),E(this,x).removeEventListener("keyup",E(this,ct)),E(this,x).addEventListener("change",E(this,Si)),c.removeEventListener("click",E(this,Ga))}attributeChangedCallback(e,t,a){var r,n;if(e===v.MEDIA_CONTROLLER){if(t){let s=c.getElementById(t);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this),E(this,x).removeAttribute(v.MEDIA_CONTROLLER)}if(a){let s=c.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this),E(this,x).setAttribute(v.MEDIA_CONTROLLER,a)}}else e==="disabled"&&a!==t&&(a==null?(ce(this,Qt,!0),this.enable()):(ce(this,Qt,!1),this.disable()))}connectedCallback(){var e;this.hasAttribute("disabled")||this.enable();let t=this.getAttribute(v.MEDIA_CONTROLLER);if(t){let a=c.getElementById(t);(e=a==null?void 0:a.associateElement)==null||e.call(a,this),E(this,x).setAttribute(v.MEDIA_CONTROLLER,t)}}disconnectedCallback(){var e;this.disable();let t=this.getAttribute(v.MEDIA_CONTROLLER);if(t){let a=c.getElementById(t);(e=a==null?void 0:a.unassociateElement)==null||e.call(a,this),E(this,x).removeAttribute(v.MEDIA_CONTROLLER)}}get keysUsed(){return["Enter","Escape"," ","ArrowUp","ArrowDown","f","c","k","m"]}};qt=new WeakMap;Si=new WeakMap;Qt=new WeakMap;K=new WeakMap;Mi=new WeakMap;x=new WeakMap;ke=new WeakMap;Li=new WeakMap;ct=new WeakMap;zt=new WeakMap;Ga=new WeakMap;An=new WeakSet;Fo=function(){Ne(this,Xt,wi).call(this)};_n=new WeakSet;Ko=function(){Ne(this,Xt,wi).call(this,!0)};Xt=new WeakSet;wi=function(i){E(this,ke).hidden=!E(this,ke).hidden||i,Ne(this,Za,In).call(this,i),E(this,ke).hidden?(this.shadowRoot.activeElement===E(this,x)||E(this,x).contains(this.shadowRoot.activeElement))&&E(this,K).focus():(E(this,x).focus(),Ne(this,Tn,Yo).call(this))};Tn=new WeakSet;Yo=function(){var i;if(E(this,x).offsetWidth===0)return;let e=E(this,K).getBoundingClientRect();if(this.hasAttribute("mediacontroller")||E(this,K).hasAttribute("mediacontroller")||E(this,x).hasAttribute("mediacontroller")){E(this,x).style.zIndex="1",E(this,x).style.bottom="unset",E(this,x).style.top=e.height+"px";return}let a=((i=this.getAttribute("bounds")?nt(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?i:this).getBoundingClientRect(),r=E(this,x).getBoundingClientRect(),n=-Math.max(e.x+r.width-a.right,0);E(this,x).style.transform=`translateX(${n}px)`};Za=new WeakSet;In=function(i=!1){ce(this,Li,!E(this,Li)||i),E(this,K).setAttribute("aria-expanded",E(this,Li))};d.customElements.get("media-chrome-selectmenu")||d.customElements.define("media-chrome-selectmenu",qa);var Zo=qa;var qo=c.createElement("template");qo.innerHTML=`
|
|
812
833
|
<style>
|
|
813
834
|
:host {
|
|
814
835
|
display: list-item;
|
|
@@ -825,24 +846,23 @@ svg, img, ::slotted(svg), ::slotted(img) {
|
|
|
825
846
|
<li>
|
|
826
847
|
<slot></slot>
|
|
827
848
|
</li>
|
|
828
|
-
`;var
|
|
849
|
+
`;var kn={VALUE:"value"},Sn=class extends d.HTMLElement{static get observedAttributes(){return["disabled","aria-selected",kn.VALUE,v.MEDIA_CONTROLLER]}constructor(){if(super(),!this.shadowRoot){let e=this.attachShadow({mode:"open"}),t=qo.content.cloneNode(!0);this.nativeEl=t,e.appendChild(t)}}set value(e){this.setAttribute(kn.VALUE,e)}get value(){return this.getAttribute(kn.VALUE)}enable(){this.hasAttribute("tabindex")||this.setAttribute("tabindex",-1),this.hasAttribute("aria-selected")||this.setAttribute("aria-selected","false")}disable(){this.removeAttribute("tabindex")}attributeChangedCallback(e,t,a){var r,n;if(e===v.MEDIA_CONTROLLER){if(t){let s=c.getElementById(t);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=c.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}else e==="disabled"&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){var e;this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","option");let t=this.getAttribute(v.MEDIA_CONTROLLER);if(t){let a=c.getElementById(t);(e=a==null?void 0:a.associateElement)==null||e.call(a,this)}}disconnectedCallback(){var e;this.disable();let t=this.getAttribute(v.MEDIA_CONTROLLER);if(t){let a=c.getElementById(t);(e=a==null?void 0:a.unassociateElement)==null||e.call(a,this)}}handleClick(){}};d.customElements.get("media-chrome-listitem")||d.customElements.define("media-chrome-listitem",Sn);var Cn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},re=(i,e,t)=>(Cn(i,e,"read from private field"),t?t.call(i):e.get(i)),mt=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ht=(i,e,t,a)=>(Cn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),pt=(i,e,t)=>(Cn(i,e,"access private method"),t),Jt,Pe,me,Mn,zo,Rn,Xo,Ci,Qa,za,Ln,Jo=`
|
|
829
850
|
fill: var(--media-icon-color, var(--media-primary-color, rgb(238 238 238)));
|
|
830
851
|
height: var(--media-captions-indicator-height, 1em);
|
|
831
852
|
vertical-align: var(--media-captions-indicator-vertical-align, bottom);
|
|
832
853
|
margin-inline-start: 1ch;
|
|
833
|
-
`,
|
|
834
|
-
<svg style="${
|
|
854
|
+
`,mu=`
|
|
855
|
+
<svg style="${Jo}" aria-hidden="true" viewBox="0 0 26 24">
|
|
835
856
|
<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"/>
|
|
836
|
-
</svg>`,
|
|
857
|
+
</svg>`,jo=c.createElement("template");jo.innerHTML=`
|
|
837
858
|
<style>
|
|
838
859
|
media-chrome-listitem {
|
|
839
860
|
white-space: var(--media-captions-listbox-white-space, nowrap);
|
|
840
861
|
}
|
|
841
|
-
|
|
842
862
|
</style>
|
|
843
|
-
<slot hidden name="captions-indicator">${
|
|
844
|
-
`;var
|
|
845
|
-
${a}${i.file}`}Ve(e)}var K={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},ot={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},Ko=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),iu=Yo.VideoEvents.filter(i=>i!=="error"),au=Object.values(K).filter(i=>![K.PLAYSINLINE].includes(i)),ru=Object.values(ot);function Go(i){i.querySelectorAll(":scope > track").forEach(e=>{var t;(t=i.media)==null||t.append(e.cloneNode())}),iu.forEach(e=>{var t;(t=i.media)==null||t.addEventListener(e,a=>{i.dispatchEvent(new Event(a.type))})})}var Sn=class extends O.HTMLElement{static get observedAttributes(){return[...au,...ru]}constructor(){super(),this.querySelectorAll(":scope > track").forEach(a=>{var r;(r=this.media)==null||r.append(a.cloneNode())});let e=a=>{for(let r of a)r.type==="childList"&&(r.removedNodes.forEach(n=>{var l,u;let s=(l=this.media)==null?void 0:l.querySelector(`track[src="${n.src}"]`);s&&((u=this.media)==null||u.removeChild(s))}),r.addedNodes.forEach(n=>{var s;(s=this.media)==null||s.append(n.cloneNode())}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(e,t,a){var r,n;switch(e){case ot.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case ot.VOLUME:{let s=(r=Me(a))!=null?r:1;this.media&&(this.media.volume=s);return}case ot.PLAYBACKRATE:{let s=(n=Me(a))!=null?n:1;this.media&&(this.media.playbackRate=s,this.media.defaultPlaybackRate=s);return}}}play(){var e,t;return(t=(e=this.media)==null?void 0:e.play())!=null?t:Promise.reject()}pause(){var e;(e=this.media)==null||e.pause()}requestCast(e){var t;return(t=this.media)==null?void 0:t.requestCast(e)}get media(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("mux-video")}get paused(){var e,t;return(t=(e=this.media)==null?void 0:e.paused)!=null?t:!0}get duration(){var e,t;return(t=(e=this.media)==null?void 0:e.duration)!=null?t:NaN}get ended(){var e,t;return(t=(e=this.media)==null?void 0:e.ended)!=null?t:!1}get buffered(){var e,t;return(t=(e=this.media)==null?void 0:e.buffered)!=null?t:Ko}get seekable(){var e,t;return(t=(e=this.media)==null?void 0:e.seekable)!=null?t:Ko}get readyState(){var e,t;return(t=(e=this.media)==null?void 0:e.readyState)!=null?t:0}get videoWidth(){var e,t;return(t=(e=this.media)==null?void 0:e.videoWidth)!=null?t:0}get videoHeight(){var e,t;return(t=(e=this.media)==null?void 0:e.videoHeight)!=null?t:0}get currentTime(){var e,t;return(t=(e=this.media)==null?void 0:e.currentTime)!=null?t:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,t;return(t=(e=this.media)==null?void 0:e.volume)!=null?t:1}set volume(e){this.media&&(this.media.volume=Number(e))}get playbackRate(){var e,t;return(t=(e=this.media)==null?void 0:e.playbackRate)!=null?t:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get defaultPlaybackRate(){var e;return(e=Me(this.getAttribute(ot.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(ot.PLAYBACKRATE,`${e}`):this.removeAttribute(ot.PLAYBACKRATE)}get crossOrigin(){return Ai(this,K.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(K.CROSSORIGIN,`${e}`)}get autoplay(){return Ai(this,K.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(K.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(K.AUTOPLAY)}get loop(){return Ai(this,K.LOOP)!=null}set loop(e){e?this.setAttribute(K.LOOP,""):this.removeAttribute(K.LOOP)}get muted(){var e,t;return(t=(e=this.media)==null?void 0:e.muted)!=null?t:!1}set muted(e){this.media&&(this.media.muted=Boolean(e))}get defaultMuted(){return Ai(this,K.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(K.MUTED,""):this.removeAttribute(K.MUTED)}get playsInline(){return Ai(this,K.PLAYSINLINE)!=null}set playsInline(e){le("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(e){["","none","metadata","auto"].includes(e)?this.setAttribute(K.PRELOAD,e):this.removeAttribute(K.PRELOAD)}};function Ai(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var wn=Sn;var nu=Object.defineProperty,su=(i,e,t)=>e in i?nu(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,ou=(i,e,t)=>(su(i,typeof e!="symbol"?e+"":e,t),t),Xo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},_=(i,e,t)=>(Xo(i,e,"read from private field"),t?t.call(i):e.get(i)),Ee=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Se=(i,e,t,a)=>(Xo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Bt,Ka,lt,_i,Fe,Ke,Ye,dt,$t,Ya,de,Zo=1,qo=0,lu=1,du={processCallback(i,e,t){if(!!t){for(let[a,r]of e)if(a in t){let n=t[a];typeof n=="boolean"&&r instanceof Z&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=n:typeof n=="function"&&r instanceof Z?r.element[r.attributeName]=n:r.value=n}}}},we=class extends d.DocumentFragment{constructor(e,t,a=du){var r;super(),Ee(this,Bt,void 0),Ee(this,Ka,void 0),this.append(e.content.cloneNode(!0)),Se(this,Bt,Jo(this)),Se(this,Ka,a),(r=a.createCallback)==null||r.call(a,this,_(this,Bt),t),a.processCallback(this,_(this,Bt),t)}update(e){_(this,Ka).processCallback(this,_(this,Bt),e)}};Bt=new WeakMap;Ka=new WeakMap;var Jo=(i,e=[])=>{let t,a;for(let r of i.attributes||[])if(r.value.includes("{{")){let n=new Ln;for([t,a]of zo(r.value))if(!t)n.append(a);else{let s=new Z(i,r.name,r.namespaceURI);n.append(s),e.push([a,s])}r.value=n.toString()}for(let r of i.childNodes)if(r.nodeType===Zo&&!(r instanceof HTMLTemplateElement))Jo(r,e);else if(r.nodeType===Zo||r.data.includes("{{")){let n=[];if(r.data)for([t,a]of zo(r.data))if(!t)n.push(new Text(a));else{let s=new Le(i);n.push(s),e.push([a,s])}else if(r instanceof HTMLTemplateElement){let s=new yi(i,r);n.push(s),e.push([s.expression,s])}r.replaceWith(...n.flatMap(s=>s.replacementNodes||[s]))}return e},Qo={},zo=i=>{let e="",t=0,a=Qo[i],r=0,n;if(a)return a;for(a=[];n=i[r];r++)n==="{"&&i[r+1]==="{"&&i[r-1]!=="\\"&&i[r+2]&&++t==1?(e&&a.push([qo,e]),e="",r++):n==="}"&&i[r+1]==="}"&&i[r-1]!=="\\"&&!--t?(a.push([lu,e.trim()]),e="",r++):e+=n||"";return e&&a.push([qo,(t>0?"{{":"")+e]),Qo[i]=a},uu=11,Ga=class{get value(){return""}set value(e){}toString(){return this.value}},jo=new WeakMap,Ln=class{constructor(){Ee(this,lt,[])}[Symbol.iterator](){return _(this,lt).values()}get length(){return _(this,lt).length}item(e){return _(this,lt)[e]}append(...e){for(let t of e)t instanceof Z&&jo.set(t,this),_(this,lt).push(t)}toString(){return _(this,lt).join("")}};lt=new WeakMap;var Z=class extends Ga{constructor(e,t,a){super(),Ee(this,dt),Ee(this,_i,""),Ee(this,Fe,void 0),Ee(this,Ke,void 0),Ee(this,Ye,void 0),Se(this,Fe,e),Se(this,Ke,t),Se(this,Ye,a)}get attributeName(){return _(this,Ke)}get attributeNamespace(){return _(this,Ye)}get element(){return _(this,Fe)}get value(){return _(this,_i)}set value(e){_(this,_i)!==e&&(Se(this,_i,e),!_(this,dt,$t)||_(this,dt,$t).length===1?e==null?_(this,Fe).removeAttributeNS(_(this,Ye),_(this,Ke)):_(this,Fe).setAttributeNS(_(this,Ye),_(this,Ke),e):_(this,Fe).setAttributeNS(_(this,Ye),_(this,Ke),_(this,dt,$t)))}get booleanValue(){return _(this,Fe).hasAttributeNS(_(this,Ye),_(this,Ke))}set booleanValue(e){if(!_(this,dt,$t)||_(this,dt,$t).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};_i=new WeakMap;Fe=new WeakMap;Ke=new WeakMap;Ye=new WeakMap;dt=new WeakSet;$t=function(){return jo.get(this)};var Le=class extends Ga{constructor(e,t){super(),Ee(this,Ya,void 0),Ee(this,de,void 0),Se(this,Ya,e),Se(this,de,t?[...t]:[new Text])}get replacementNodes(){return _(this,de)}get parentNode(){return _(this,Ya)}get nextSibling(){return _(this,de)[_(this,de).length-1].nextSibling}get previousSibling(){return _(this,de)[0].previousSibling}get value(){return _(this,de).map(e=>e.textContent).join("")}set value(e){this.replace(e)}replace(...e){let t=e.flat().flatMap(a=>a==null?[new Text]:a.forEach?[...a]:a.nodeType===uu?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);t.length||t.push(new Text),Se(this,de,cu(_(this,de)[0].parentNode,_(this,de),t,this.nextSibling))}};Ya=new WeakMap;de=new WeakMap;var yi=class extends Le{constructor(e,t){let a=t.getAttribute("directive")||t.getAttribute("type"),r=t.getAttribute("expression")||t.getAttribute(a)||"";r.startsWith("{{")&&(r=r.trim().slice(2,-2).trim()),super(e),ou(this,"directive"),this.expression=r,this.template=t,this.directive=a}};function cu(i,e,t,a=null){let r=0,n,s,l,u=t.length,c=e.length;for(;r<u&&r<c&&e[r]==t[r];)r++;for(;r<u&&r<c&&t[u-1]==e[c-1];)a=t[--c,--u];if(r==c)for(;r<u;)i.insertBefore(t[r++],a);if(r==u)for(;r<c;)i.removeChild(e[r++]);else{for(n=e[r];r<u;)l=t[r++],s=n?n.nextSibling:a,n==l?n=s:r<u&&t[r]==s?(i.replaceChild(l,n),n=s):i.insertBefore(l,n);for(;n!=a;)s=n.nextSibling,i.removeChild(n),n=s}return t}var el={string:i=>String(i)},qa=class{constructor(e){this.template=e,this.state=void 0}},ut=new WeakMap,ct=new WeakMap,Cn={partial:(i,e)=>{e[i.expression]=new qa(i.template)},if:(i,e)=>{var t;if(il(i.expression,e))if(ut.get(i)!==i.template){ut.set(i,i.template);let a=new we(i.template,e,Qa);i.replace(a),ct.set(i,a)}else(t=ct.get(i))==null||t.update(e);else i.replace(""),ut.delete(i),ct.delete(i)}},mu=Object.keys(Cn),Qa={processCallback(i,e,t){var a,r;if(!!t)for(let[n,s]of e){if(s instanceof yi){if(!s.directive){let u=mu.find(c=>s.template.hasAttribute(c));u&&(s.directive=u,s.expression=s.template.getAttribute(u))}(a=Cn[s.directive])==null||a.call(Cn,s,t);continue}let l=il(n,t);if(l instanceof qa){ut.get(s)!==l.template?(ut.set(s,l.template),l=new we(l.template,l.state,Qa),s.value=l,ct.set(s,l)):(r=ct.get(s))==null||r.update(l.state);continue}l?(s instanceof Z&&s.attributeName.startsWith("aria-")&&(l=String(l)),s instanceof Z?typeof l=="boolean"?s.booleanValue=l:typeof l=="function"?s.element[s.attributeName]=l:s.value=l:(s.value=l,ut.delete(s),ct.delete(s))):s instanceof Z?s.value=void 0:(s.value=void 0,ut.delete(s),ct.delete(s))}}},tl={"!":i=>!i,"!!":i=>!!i,"==":(i,e)=>i==e,"!=":(i,e)=>i!=e,">":(i,e)=>i>e,">=":(i,e)=>i>=e,"<":(i,e)=>i<e,"<=":(i,e)=>i<=e,"??":(i,e)=>i!=null?i:e,"|":(i,e)=>{var t;return(t=el[e])==null?void 0:t.call(el,i)}};function hu(i){return pu(i,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function il(i,e={}){var t,a,r,n,s,l,u;let c=hu(i);if(c.length===0||c.some(({type:f})=>!f))return Ti(i);if(((t=c[0])==null?void 0:t.token)===">"){let f=e[(a=c[1])==null?void 0:a.token];if(!f)return Ti(i);let A={...e};f.state=A;let g=c.slice(2);for(let y=0;y<g.length;y+=3){let R=(r=g[y])==null?void 0:r.token,$=(n=g[y+1])==null?void 0:n.token,k=(s=g[y+2])==null?void 0:s.token;R&&$==="="&&(A[R]=Ii(k,e))}return f}if(c.length===1)return Za(c[0])?Ii(c[0].token,e):Ti(i);if(c.length===2){let f=(l=c[0])==null?void 0:l.token,A=tl[f];if(!A||!Za(c[1]))return Ti(i);let g=Ii(c[1].token,e);return A(g)}if(c.length===3){let f=(u=c[1])==null?void 0:u.token,A=tl[f];if(!A||!Za(c[0])||!Za(c[2]))return Ti(i);let g=Ii(c[0].token,e);if(f==="|")return A(g,c[2].token);let y=Ii(c[2].token,e);return A(g,y)}}function Ti(i){return console.warn(`Warning: invalid expression \`${i}\``),!1}function Za({type:i}){return["number","boolean","string","param"].includes(i)}function Ii(i,e){let t=i[0],a=i.slice(-1);return i==="true"||i==="false"?i==="true":t===a&&["'",'"'].includes(t)?i.slice(1,-1):$i(i)?parseFloat(i):e[i]}function pu(i,e){let t,a,r,n=[];for(;i;){r=null,t=i.length;for(let s in e)a=e[s].exec(i),a&&a.index<t&&(r={token:a[0],type:s,matches:a.slice(1)},t=a.index);t&&n.push({token:i.substr(0,t),type:void 0}),r&&n.push(r),i=i.substr(t+(r?r.token.length:0))}return n}var bu=Object.defineProperty,fu=(i,e,t)=>e in i?bu(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Mi=(i,e,t)=>(fu(i,typeof e!="symbol"?e+"":e,t),t),Pn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Dn=(i,e,t)=>(Pn(i,e,"read from private field"),t?t.call(i):e.get(i)),ki=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},mt=(i,e,t,a)=>(Pn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Rn=(i,e,t)=>(Pn(i,e,"access private method"),t),Ht,za,Wt,On,al,Xa,Nn,xn={"media-target-live-window":"targetLiveWindow","media-stream-type":"streamType"},rl=m.createElement("template");rl.innerHTML=`
|
|
863
|
+
<slot hidden name="captions-indicator">${mu}</slot>
|
|
864
|
+
`;var Qo=(i,e)=>i.label===e.label&&i.language===e.language,wn=class extends Wo{constructor(){super({slotTemplate:jo}),mt(this,Mn),mt(this,Rn),mt(this,Ci),mt(this,za),mt(this,Jt,[]),mt(this,Pe,void 0),mt(this,me,void 0);let e=c.createElement("media-chrome-listitem");e.part.add("listitem"),e.value="off",e.textContent="Off",ht(this,Pe,e);let t=this.shadowRoot.querySelector('[name="captions-indicator"]');ht(this,me,t.firstElementChild),t.addEventListener("slotchange",()=>{let a=t.assignedElements();if(a.length===1&&a[0].nodeName.toLowerCase()==="slot"){let r=a[0].assignedElements();r.length===0?ht(this,me,a[0].firstElementChild):r.length===1&&ht(this,me,r[0])}re(this,me)||ht(this,me,t.firstElementChild),ht(this,me,re(this,me).cloneNode(!0)),re(this,me).removeAttribute("slot"),re(this,me).setAttribute("style",Jo)})}static get observedAttributes(){return[...super.observedAttributes,"aria-multiselectable",o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,t,a){if(e===o.MEDIA_SUBTITLES_LIST&&t!==a)ht(this,Jt,pt(this,Mn,zo).call(this,a,re(this,Jt))),pt(this,Ci,Qa).call(this);else if(e===o.MEDIA_SUBTITLES_SHOWING&&t!==a){let r=Ot(a!=null?a:"")[0];re(this,Jt).forEach(n=>{n.selected=n.language===r.language&&n.label===r.label}),pt(this,Ci,Qa).call(this)}else e==="aria-multiselectable"&&(this.removeAttribute("aria-multiselectable"),console.warn("Captions List doesn't currently support multiple selections. You can enable multiple items via the media.textTrack API."));super.attributeChangedCallback(e,t,a)}connectedCallback(){pt(this,Ci,Qa).call(this),this.addEventListener("change",pt(this,za,Ln)),super.connectedCallback()}disconnectedCallback(){this.removeEventListener("change",pt(this,za,Ln)),super.disconnectedCallback()}};Jt=new WeakMap;Pe=new WeakMap;me=new WeakMap;Mn=new WeakSet;zo=function(i,e){let t=i?Ot(i!=null?i:""):[],a=[],r=[];return e.forEach(n=>{t.some(s=>Qo(s,n))||a.push(n)}),t.forEach(n=>{e.some(s=>Qo(s,n))||r.push(n)}),a.forEach(n=>n.el.remove()),e.filter(n=>!a.includes(n)).concat(r)};Rn=new WeakSet;Xo=function(i){let e=this.shadowRoot.querySelector("ul slot");i.forEach(t=>{var a;let r=t.el,n=!0,s=(a=t.kind)!=null?a:"subs";if(!r){r=c.createElement("media-chrome-listitem"),n=!1,r.part.add("listitem"),r.value=Sr(t);let l=c.createElement("span");l.textContent=t.label,r.append(l),s==="captions"&&r.append(re(this,me).cloneNode(!0))}t.selected?r.setAttribute("aria-selected","true"):r.setAttribute("aria-selected","false"),n||(e.append(r),t.el=r)})};Ci=new WeakSet;Qa=function(){let i=this.shadowRoot.querySelector("ul slot");i.contains(re(this,Pe))||i.append(re(this,Pe)),this.hasAttribute(o.MEDIA_SUBTITLES_SHOWING)?(re(this,Pe).setAttribute("aria-selected","false"),re(this,Pe).setAttribute("tabindex","-1")):(re(this,Pe).setAttribute("aria-selected","true"),re(this,Pe).setAttribute("tabindex","0")),pt(this,Rn,Xo).call(this,re(this,Jt))};za=new WeakSet;Ln=function(){var i;let e=(i=this.selectedOptions[0])==null?void 0:i.value;if(we(this,!1),!e)return;let t=new d.CustomEvent(b.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)};d.customElements.get("media-captions-listbox")||d.customElements.define("media-captions-listbox",wn);var Dn=class extends Zo{constructor(){super()}init(){let e=c.createElement("media-captions-button");e.part.add("button"),e.preventClick=!0;let t=c.createElement("media-captions-listbox");t.part.add("listbox"),t.setAttribute("exportparts","listitem");let a=this.shadowRoot.querySelector("slot[name=button]"),r=this.shadowRoot.querySelector("slot[name=listbox]");a.textContent="",r.textContent="",a.append(e),r.append(t)}};d.customElements.get("media-captions-selectmenu")||d.customElements.define("media-captions-selectmenu",Dn);var g=Zl(require("@mux/mux-video")),N=require("@mux/playback-core");var ll=require("@mux/mux-video");var hu="en",Et={code:hu};var el="en";function y(i,e=!0){var r,n;let t=e&&(n=(r=Et)==null?void 0:r[i])!=null?n:i,a=e?Et.code:el;return new xn(t,a)}var xn=class{constructor(e,t=(a=>(a=Et.code)!=null?a:el)()){this.message=e,this.locale=t}format(e){return this.message.replace(/\{(\w+)\}/g,(t,a)=>{var r;return(r=e[a])!=null?r:""})}toString(){return this.message}};function tl(i){let e="";return Object.entries(i).forEach(([t,a])=>{a!=null&&(e+=`${Xa(t)}: ${a}; `)}),e?e.trim():void 0}function Xa(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Ja(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Ue(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function ja(i){let e=pu(i).toString();return e?"?"+e:""}function pu(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}function ze(i){let e=(i!=null?i:"").split(".")[1];if(!e)return{};let t=e.replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(t).split("").map(function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}var On=(i,e)=>!i||!e?!1:i.contains(e)?!0:On(i,e.getRootNode().host);var er=require("@mux/playback-core");var Nn="mux.com",Eu=()=>{try{return"1.11.1"}catch{}return"UNKNOWN"},bu=Eu(),ir=()=>bu,Pn=(i,{maxResolution:e,token:t,domain:a=Nn}={})=>{let s=!!t?{token:t}:{redundant_streams:!0,...e?{max_resolution:e}:{}};return`https://stream.${a}/${i}.m3u8${ja(s)}`},il=(i,{token:e,thumbnailTime:t,domain:a=Nn}={})=>{let r=e==null?t:void 0,{aud:n}=ze(e);if(!(e&&n!=="t"))return`https://image.${a}/${i}/thumbnail.webp${ja({token:e,time:r})}`},al=(i,{token:e,domain:t=Nn}={})=>{let{aud:a}=ze(e);if(!(e&&a!=="s"))return`https://image.${t}/${i}/storyboard.vtt${ja({token:e,format:"webp"})}`},Ri=i=>{if(!!i){if([er.StreamTypes.LIVE,er.StreamTypes.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return er.StreamTypes.LIVE}};var vu={crossorigin:"crossOrigin",playsinline:"playsInline"};function rl(i){var e;return(e=vu[i])!=null?e:Ja(i)}var bt,vt,j,tr=class{constructor(e,t){V(this,bt,void 0);V(this,vt,void 0);V(this,j,[]);le(this,bt,e),le(this,vt,t)}[Symbol.iterator](){return k(this,j).values()}get length(){return k(this,j).length}get value(){var e;return(e=k(this,j).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(le(this,j,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return k(this,j)[e]}values(){return k(this,j).values()}keys(){return k(this,j).keys()}forEach(e){k(this,j).forEach(e)}add(...e){var t,a;e.forEach(r=>{this.contains(r)||k(this,j).push(r)}),!(this.value===""&&!((t=k(this,bt))!=null&&t.hasAttribute(`${k(this,vt)}`)))&&((a=k(this,bt))==null||a.setAttribute(`${k(this,vt)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>{k(this,j).splice(k(this,j).indexOf(a),1)}),(t=k(this,bt))==null||t.setAttribute(`${k(this,vt)}`,`${this.value}`)}contains(e){return k(this,j).includes(e)}toggle(e,t){return typeof t!="undefined"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){this.remove(e),this.add(t)}};bt=new WeakMap,vt=new WeakMap,j=new WeakMap;var nl=`[mux-player ${ir()}]`;function Xe(...i){console.warn(nl,...i)}function pe(...i){console.error(nl,...i)}function Un(i){var t;let e=(t=i.message)!=null?t:"";if(i.context&&(e+=` ${i.context}`),i.file){let a="https://github.com/muxinc/elements/blob/main/errors/";e+=` ${y("Read more: ")}
|
|
865
|
+
${a}${i.file}`}Xe(e)}var X={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},ft={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},ol=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),fu=ll.VideoEvents.filter(i=>i!=="error"),gu=Object.values(X).filter(i=>![X.PLAYSINLINE].includes(i)),Au=Object.values(ft);function dl(i){i.querySelectorAll(":scope > track").forEach(e=>{var t;(t=i.media)==null||t.append(e.cloneNode())}),fu.forEach(e=>{var t;(t=i.media)==null||t.addEventListener(e,a=>{i.dispatchEvent(new Event(a.type))})})}var Bn=class extends W.HTMLElement{static get observedAttributes(){return[...gu,...Au]}constructor(){super(),this.querySelectorAll(":scope > track").forEach(a=>{var r;(r=this.media)==null||r.append(a.cloneNode())});let e=a=>{for(let r of a)r.type==="childList"&&(r.removedNodes.forEach(n=>{var l,u;let s=(l=this.media)==null?void 0:l.querySelector(`track[src="${n.src}"]`);s&&((u=this.media)==null||u.removeChild(s))}),r.addedNodes.forEach(n=>{var s;(s=this.media)==null||s.append(n.cloneNode())}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(e,t,a){var r,n;switch(e){case ft.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case ft.VOLUME:{let s=(r=Ue(a))!=null?r:1;this.media&&(this.media.volume=s);return}case ft.PLAYBACKRATE:{let s=(n=Ue(a))!=null?n:1;this.media&&(this.media.playbackRate=s,this.media.defaultPlaybackRate=s);return}}}play(){var e,t;return(t=(e=this.media)==null?void 0:e.play())!=null?t:Promise.reject()}pause(){var e;(e=this.media)==null||e.pause()}requestCast(e){var t;return(t=this.media)==null?void 0:t.requestCast(e)}get media(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("mux-video")}get paused(){var e,t;return(t=(e=this.media)==null?void 0:e.paused)!=null?t:!0}get duration(){var e,t;return(t=(e=this.media)==null?void 0:e.duration)!=null?t:NaN}get ended(){var e,t;return(t=(e=this.media)==null?void 0:e.ended)!=null?t:!1}get buffered(){var e,t;return(t=(e=this.media)==null?void 0:e.buffered)!=null?t:ol}get seekable(){var e,t;return(t=(e=this.media)==null?void 0:e.seekable)!=null?t:ol}get readyState(){var e,t;return(t=(e=this.media)==null?void 0:e.readyState)!=null?t:0}get videoWidth(){var e,t;return(t=(e=this.media)==null?void 0:e.videoWidth)!=null?t:0}get videoHeight(){var e,t;return(t=(e=this.media)==null?void 0:e.videoHeight)!=null?t:0}get currentTime(){var e,t;return(t=(e=this.media)==null?void 0:e.currentTime)!=null?t:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,t;return(t=(e=this.media)==null?void 0:e.volume)!=null?t:1}set volume(e){this.media&&(this.media.volume=Number(e))}get playbackRate(){var e,t;return(t=(e=this.media)==null?void 0:e.playbackRate)!=null?t:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get defaultPlaybackRate(){var e;return(e=Ue(this.getAttribute(ft.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(ft.PLAYBACKRATE,`${e}`):this.removeAttribute(ft.PLAYBACKRATE)}get crossOrigin(){return Di(this,X.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(X.CROSSORIGIN,`${e}`)}get autoplay(){return Di(this,X.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(X.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(X.AUTOPLAY)}get loop(){return Di(this,X.LOOP)!=null}set loop(e){e?this.setAttribute(X.LOOP,""):this.removeAttribute(X.LOOP)}get muted(){var e,t;return(t=(e=this.media)==null?void 0:e.muted)!=null?t:!1}set muted(e){this.media&&(this.media.muted=Boolean(e))}get defaultMuted(){return Di(this,X.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(X.MUTED,""):this.removeAttribute(X.MUTED)}get playsInline(){return Di(this,X.PLAYSINLINE)!=null}set playsInline(e){pe("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(e){["","none","metadata","auto"].includes(e)?this.setAttribute(X.PRELOAD,e):this.removeAttribute(X.PRELOAD)}};function Di(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var $n=Bn;var _u=Object.defineProperty,yu=(i,e,t)=>e in i?_u(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Tu=(i,e,t)=>(yu(i,typeof e!="symbol"?e+"":e,t),t),pl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},_=(i,e,t)=>(pl(i,e,"read from private field"),t?t.call(i):e.get(i)),Se=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Be=(i,e,t,a)=>(pl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),jt,ar,gt,xi,Je,je,et,At,ei,rr,Ee,ul=1,cl=0,Iu=1,ku={processCallback(i,e,t){if(!!t){for(let[a,r]of e)if(a in t){let n=t[a];typeof n=="boolean"&&r instanceof ee&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=n:typeof n=="function"&&r instanceof ee?r.element[r.attributeName]=n:r.value=n}}}},$e=class extends d.DocumentFragment{constructor(e,t,a=ku){var r;super(),Se(this,jt,void 0),Se(this,ar,void 0),this.append(e.content.cloneNode(!0)),Be(this,jt,El(this)),Be(this,ar,a),(r=a.createCallback)==null||r.call(a,this,_(this,jt),t),a.processCallback(this,_(this,jt),t)}update(e){_(this,ar).processCallback(this,_(this,jt),e)}};jt=new WeakMap;ar=new WeakMap;var El=(i,e=[])=>{let t,a;for(let r of i.attributes||[])if(r.value.includes("{{")){let n=new Vn;for([t,a]of hl(r.value))if(!t)n.append(a);else{let s=new ee(i,r.name,r.namespaceURI);n.append(s),e.push([a,s])}r.value=n.toString()}for(let r of i.childNodes)if(r.nodeType===ul&&!(r instanceof HTMLTemplateElement))El(r,e);else if(r.nodeType===ul||r.data.includes("{{")){let n=[];if(r.data)for([t,a]of hl(r.data))if(!t)n.push(new Text(a));else{let s=new Ve(i);n.push(s),e.push([a,s])}else if(r instanceof HTMLTemplateElement){let s=new Oi(i,r);n.push(s),e.push([s.expression,s])}r.replaceWith(...n.flatMap(s=>s.replacementNodes||[s]))}return e},ml={},hl=i=>{let e="",t=0,a=ml[i],r=0,n;if(a)return a;for(a=[];n=i[r];r++)n==="{"&&i[r+1]==="{"&&i[r-1]!=="\\"&&i[r+2]&&++t==1?(e&&a.push([cl,e]),e="",r++):n==="}"&&i[r+1]==="}"&&i[r-1]!=="\\"&&!--t?(a.push([Iu,e.trim()]),e="",r++):e+=n||"";return e&&a.push([cl,(t>0?"{{":"")+e]),ml[i]=a},Su=11,nr=class{get value(){return""}set value(e){}toString(){return this.value}},bl=new WeakMap,Vn=class{constructor(){Se(this,gt,[])}[Symbol.iterator](){return _(this,gt).values()}get length(){return _(this,gt).length}item(e){return _(this,gt)[e]}append(...e){for(let t of e)t instanceof ee&&bl.set(t,this),_(this,gt).push(t)}toString(){return _(this,gt).join("")}};gt=new WeakMap;var ee=class extends nr{constructor(e,t,a){super(),Se(this,At),Se(this,xi,""),Se(this,Je,void 0),Se(this,je,void 0),Se(this,et,void 0),Be(this,Je,e),Be(this,je,t),Be(this,et,a)}get attributeName(){return _(this,je)}get attributeNamespace(){return _(this,et)}get element(){return _(this,Je)}get value(){return _(this,xi)}set value(e){_(this,xi)!==e&&(Be(this,xi,e),!_(this,At,ei)||_(this,At,ei).length===1?e==null?_(this,Je).removeAttributeNS(_(this,et),_(this,je)):_(this,Je).setAttributeNS(_(this,et),_(this,je),e):_(this,Je).setAttributeNS(_(this,et),_(this,je),_(this,At,ei)))}get booleanValue(){return _(this,Je).hasAttributeNS(_(this,et),_(this,je))}set booleanValue(e){if(!_(this,At,ei)||_(this,At,ei).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};xi=new WeakMap;Je=new WeakMap;je=new WeakMap;et=new WeakMap;At=new WeakSet;ei=function(){return bl.get(this)};var Ve=class extends nr{constructor(e,t){super(),Se(this,rr,void 0),Se(this,Ee,void 0),Be(this,rr,e),Be(this,Ee,t?[...t]:[new Text])}get replacementNodes(){return _(this,Ee)}get parentNode(){return _(this,rr)}get nextSibling(){return _(this,Ee)[_(this,Ee).length-1].nextSibling}get previousSibling(){return _(this,Ee)[0].previousSibling}get value(){return _(this,Ee).map(e=>e.textContent).join("")}set value(e){this.replace(e)}replace(...e){let t=e.flat().flatMap(a=>a==null?[new Text]:a.forEach?[...a]:a.nodeType===Su?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);t.length||t.push(new Text),Be(this,Ee,Mu(_(this,Ee)[0].parentNode,_(this,Ee),t,this.nextSibling))}};rr=new WeakMap;Ee=new WeakMap;var Oi=class extends Ve{constructor(e,t){let a=t.getAttribute("directive")||t.getAttribute("type"),r=t.getAttribute("expression")||t.getAttribute(a)||"";r.startsWith("{{")&&(r=r.trim().slice(2,-2).trim()),super(e),Tu(this,"directive"),this.expression=r,this.template=t,this.directive=a}};function Mu(i,e,t,a=null){let r=0,n,s,l,u=t.length,m=e.length;for(;r<u&&r<m&&e[r]==t[r];)r++;for(;r<u&&r<m&&t[u-1]==e[m-1];)a=t[--m,--u];if(r==m)for(;r<u;)i.insertBefore(t[r++],a);if(r==u)for(;r<m;)i.removeChild(e[r++]);else{for(n=e[r];r<u;)l=t[r++],s=n?n.nextSibling:a,n==l?n=s:r<u&&t[r]==s?(i.replaceChild(l,n),n=s):i.insertBefore(l,n);for(;n!=a;)s=n.nextSibling,i.removeChild(n),n=s}return t}var vl={string:i=>String(i)},or=class{constructor(e){this.template=e,this.state=void 0}},_t=new WeakMap,yt=new WeakMap,Hn={partial:(i,e)=>{e[i.expression]=new or(i.template)},if:(i,e)=>{var t;if(gl(i.expression,e))if(_t.get(i)!==i.template){_t.set(i,i.template);let a=new $e(i.template,e,lr);i.replace(a),yt.set(i,a)}else(t=yt.get(i))==null||t.update(e);else i.replace(""),_t.delete(i),yt.delete(i)}},Lu=Object.keys(Hn),lr={processCallback(i,e,t){var a,r;if(!!t)for(let[n,s]of e){if(s instanceof Oi){if(!s.directive){let u=Lu.find(m=>s.template.hasAttribute(m));u&&(s.directive=u,s.expression=s.template.getAttribute(u))}(a=Hn[s.directive])==null||a.call(Hn,s,t);continue}let l=gl(n,t);if(l instanceof or){_t.get(s)!==l.template?(_t.set(s,l.template),l=new $e(l.template,l.state,lr),s.value=l,yt.set(s,l)):(r=yt.get(s))==null||r.update(l.state);continue}l?(s instanceof ee&&s.attributeName.startsWith("aria-")&&(l=String(l)),s instanceof ee?typeof l=="boolean"?s.booleanValue=l:typeof l=="function"?s.element[s.attributeName]=l:s.value=l:(s.value=l,_t.delete(s),yt.delete(s))):s instanceof ee?s.value=void 0:(s.value=void 0,_t.delete(s),yt.delete(s))}}},fl={"!":i=>!i,"!!":i=>!!i,"==":(i,e)=>i==e,"!=":(i,e)=>i!=e,">":(i,e)=>i>e,">=":(i,e)=>i>=e,"<":(i,e)=>i<e,"<=":(i,e)=>i<=e,"??":(i,e)=>i!=null?i:e,"|":(i,e)=>{var t;return(t=vl[e])==null?void 0:t.call(vl,i)}};function wu(i){return Cu(i,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function gl(i,e={}){var t,a,r,n,s,l,u;let m=wu(i);if(m.length===0||m.some(({type:p})=>!p))return Ni(i);if(((t=m[0])==null?void 0:t.token)===">"){let p=e[(a=m[1])==null?void 0:a.token];if(!p)return Ni(i);let f={...e};p.state=f;let A=m.slice(2);for(let T=0;T<A.length;T+=3){let B=(r=A[T])==null?void 0:r.token,Z=(n=A[T+1])==null?void 0:n.token,I=(s=A[T+2])==null?void 0:s.token;B&&Z==="="&&(f[B]=Pi(I,e))}return p}if(m.length===1)return sr(m[0])?Pi(m[0].token,e):Ni(i);if(m.length===2){let p=(l=m[0])==null?void 0:l.token,f=fl[p];if(!f||!sr(m[1]))return Ni(i);let A=Pi(m[1].token,e);return f(A)}if(m.length===3){let p=(u=m[1])==null?void 0:u.token,f=fl[p];if(!f||!sr(m[0])||!sr(m[2]))return Ni(i);let A=Pi(m[0].token,e);if(p==="|")return f(A,m[2].token);let T=Pi(m[2].token,e);return f(A,T)}}function Ni(i){return console.warn(`Warning: invalid expression \`${i}\``),!1}function sr({type:i}){return["number","boolean","string","param"].includes(i)}function Pi(i,e){let t=i[0],a=i.slice(-1);return i==="true"||i==="false"?i==="true":t===a&&["'",'"'].includes(t)?i.slice(1,-1):Xi(i)?parseFloat(i):e[i]}function Cu(i,e){let t,a,r,n=[];for(;i;){r=null,t=i.length;for(let s in e)a=e[s].exec(i),a&&a.index<t&&(r={token:a[0],type:s,matches:a.slice(1)},t=a.index);t&&n.push({token:i.substr(0,t),type:void 0}),r&&n.push(r),i=i.substr(t+(r?r.token.length:0))}return n}var Ru=Object.defineProperty,Du=(i,e,t)=>e in i?Ru(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Bi=(i,e,t)=>(Du(i,typeof e!="symbol"?e+"":e,t),t),Zn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Kn=(i,e,t)=>(Zn(i,e,"read from private field"),t?t.call(i):e.get(i)),Ui=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Tt=(i,e,t,a)=>(Zn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Wn=(i,e,t)=>(Zn(i,e,"access private method"),t),ti,dr,ii,Yn,Al,ur,Gn,Fn={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},_l=c.createElement("template");_l.innerHTML=`
|
|
846
866
|
<style>
|
|
847
867
|
:host {
|
|
848
868
|
display: inline-block;
|
|
@@ -853,8 +873,18 @@ ${a}${i.file}`}Ve(e)}var K={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"
|
|
|
853
873
|
width: 100%;
|
|
854
874
|
height: 100%;
|
|
855
875
|
}
|
|
876
|
+
|
|
877
|
+
media-controller:not([mediasubtitleslist]) media-captions-selectmenu,
|
|
878
|
+
media-captions-button:not([mediasubtitleslist]),
|
|
879
|
+
media-volume-range[mediavolumeunavailable],
|
|
880
|
+
media-airplay-button[mediaairplayunavailable],
|
|
881
|
+
media-fullscreen-button[mediafullscreenunavailable],
|
|
882
|
+
media-cast-button[mediacastunavailable],
|
|
883
|
+
media-pip-button[mediapipunavailable] {
|
|
884
|
+
display: none;
|
|
885
|
+
}
|
|
856
886
|
</style>
|
|
857
|
-
`;var
|
|
887
|
+
`;var ai=class extends d.HTMLElement{constructor(){super(),Ui(this,Yn),Ui(this,ur),Bi(this,"renderRoot"),Bi(this,"renderer"),Ui(this,ti,void 0),Ui(this,dr,void 0),Ui(this,ii,void 0),this.shadowRoot?this.renderRoot=this.shadowRoot:(this.renderRoot=this.attachShadow({mode:"open"}),this.createRenderer());let e=new MutationObserver(t=>{t.some(a=>{let r=a.target;return r===this?!0:r.localName!=="media-controller"?!1:!!(Fn[a.attributeName]||a.attributeName.startsWith("breakpoint"))})&&this.render()});e.observe(this,{attributes:!0}),e.observe(this.renderRoot,{attributes:!0,subtree:!0}),Wn(this,Yn,Al).call(this,"template")}get mediaController(){return this.renderRoot.querySelector("media-controller")}get template(){var e;return(e=Kn(this,ti))!=null?e:this.constructor.template}set template(e){Tt(this,ii,null),Tt(this,ti,e),this.createRenderer()}get props(){var e,t,a;let r=[...Array.from((t=(e=this.mediaController)==null?void 0:e.attributes)!=null?t:[]).filter(({name:s})=>Fn[s]||s.startsWith("breakpoint")),...Array.from(this.attributes)],n={};for(let s of r){let l=(a=Fn[s.name])!=null?a:vs(s.name),{value:u}=s;u!=null?(Xi(u)&&(u=parseFloat(u)),n[l]=u===""?!0:u):n[l]=!1}return n}attributeChangedCallback(e,t,a){e==="template"&&t!=a&&Wn(this,ur,Gn).call(this)}connectedCallback(){Wn(this,ur,Gn).call(this)}createRenderer(){this.template&&this.template!==Kn(this,dr)&&(Tt(this,dr,this.template),this.renderer=new $e(this.template,this.props,this.constructor.processor),this.renderRoot.textContent="",this.renderRoot.append(_l.content.cloneNode(!0),this.renderer))}render(){var e;(e=this.renderer)==null||e.update(this.props)}};ti=new WeakMap;dr=new WeakMap;ii=new WeakMap;Yn=new WeakSet;Al=function(i){if(Object.prototype.hasOwnProperty.call(this,i)){let e=this[i];delete this[i],this[i]=e}};ur=new WeakSet;Gn=function(){var i;let e=this.getAttribute("template");if(!e||e===Kn(this,ii))return;let t=this.getRootNode(),a=(i=t==null?void 0:t.getElementById)==null?void 0:i.call(t,e);if(a){Tt(this,ii,e),Tt(this,ti,a),this.createRenderer();return}xu(e)&&(Tt(this,ii,e),Ou(e).then(r=>{let n=c.createElement("template");n.innerHTML=r,Tt(this,ti,n),this.createRenderer()}).catch(console.error))};Bi(ai,"template");Bi(ai,"observedAttributes",["template"]);Bi(ai,"processor",lr);function xu(i){if(!/^(\/|\.\/|https?:\/\/)/.test(i))return!1;let e=/^https?:\/\//.test(i)?void 0:location.origin;try{new URL(i,e)}catch{return!1}return!0}async function Ou(i){let e=await fetch(i);if(e.status!==200)throw new Error(`Failed to load resource: the server responded with a status of ${e.status}`);return e.text()}d.customElements.get("media-theme")||d.customElements.define("media-theme",ai);var yl=`:host {
|
|
858
888
|
--media-control-display: var(--controls);
|
|
859
889
|
--media-loading-indicator-display: var(--loading-indicator);
|
|
860
890
|
--media-dialog-display: var(--dialog);
|
|
@@ -970,7 +1000,7 @@ media-theme {
|
|
|
970
1000
|
--media-duration-display-display: var(--duration-display, var(--bottom-duration-display));
|
|
971
1001
|
--media-title-display-display: var(--title-display, var(--bottom-title-display));
|
|
972
1002
|
}
|
|
973
|
-
`;var
|
|
1003
|
+
`;var Tl=`<!-- prettier-ignore -->
|
|
974
1004
|
<template id="media-theme-mux">
|
|
975
1005
|
<style>
|
|
976
1006
|
:host {
|
|
@@ -982,7 +1012,7 @@ media-theme {
|
|
|
982
1012
|
--media-range-bar-color: var(--_primary-color);
|
|
983
1013
|
--media-control-background: var(--_secondary-color);
|
|
984
1014
|
--media-control-hover-background: var(--_secondary-color);
|
|
985
|
-
--media-time-buffered-color: rgba(255, 255, 255, 0.4);
|
|
1015
|
+
--media-time-range-buffered-color: rgba(255, 255, 255, 0.4);
|
|
986
1016
|
--media-range-track-background:
|
|
987
1017
|
linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.5)),
|
|
988
1018
|
linear-gradient(rgba(20, 20, 30, 0.7), rgba(20, 20, 30, 0.7));
|
|
@@ -1025,8 +1055,8 @@ media-theme {
|
|
|
1025
1055
|
width: 100%;
|
|
1026
1056
|
}
|
|
1027
1057
|
|
|
1028
|
-
[disabled],
|
|
1029
|
-
[aria-disabled='true'] {
|
|
1058
|
+
[disabled]:not(media-live-button),
|
|
1059
|
+
[aria-disabled='true']:not(media-live-button) {
|
|
1030
1060
|
opacity: 60%;
|
|
1031
1061
|
cursor: not-allowed;
|
|
1032
1062
|
}
|
|
@@ -1035,7 +1065,7 @@ media-theme {
|
|
|
1035
1065
|
z-index: 10;
|
|
1036
1066
|
}
|
|
1037
1067
|
|
|
1038
|
-
media-controller:not(
|
|
1068
|
+
media-controller:not([mediasubtitleslist]) media-captions-selectmenu {
|
|
1039
1069
|
--captions-selectmenu: none;
|
|
1040
1070
|
}
|
|
1041
1071
|
|
|
@@ -1045,7 +1075,7 @@ media-theme {
|
|
|
1045
1075
|
media-controller ::slotted([slot='media']) {
|
|
1046
1076
|
--media-webkit-text-track-transition: transform 0.433s ease-out 0.3s;
|
|
1047
1077
|
}
|
|
1048
|
-
media-controller:is([
|
|
1078
|
+
media-controller:is([mediapaused],:not([userinactive])) ::slotted([slot='media']) {
|
|
1049
1079
|
/* 42px is the height of the control bar and progress bar
|
|
1050
1080
|
* with an additional 5px as a buffer, to get 47px */
|
|
1051
1081
|
--media-webkit-text-track-transform: translateY(-47px);
|
|
@@ -1060,23 +1090,23 @@ media-theme {
|
|
|
1060
1090
|
--media-text-color: white;
|
|
1061
1091
|
}
|
|
1062
1092
|
|
|
1063
|
-
media-volume-range[
|
|
1093
|
+
media-volume-range[mediavolumeunavailable] {
|
|
1064
1094
|
--volume-range: none;
|
|
1065
1095
|
}
|
|
1066
1096
|
|
|
1067
|
-
media-airplay-button[
|
|
1097
|
+
media-airplay-button[mediaairplayunavailable] {
|
|
1068
1098
|
--airplay-button: none;
|
|
1069
1099
|
}
|
|
1070
1100
|
|
|
1071
|
-
media-fullscreen-button[
|
|
1101
|
+
media-fullscreen-button[mediafullscreenunavailable] {
|
|
1072
1102
|
--fullscreen-button: none;
|
|
1073
1103
|
}
|
|
1074
1104
|
|
|
1075
|
-
media-cast-button[
|
|
1105
|
+
media-cast-button[mediacastunavailable] {
|
|
1076
1106
|
--cast-button: none;
|
|
1077
1107
|
}
|
|
1078
1108
|
|
|
1079
|
-
media-pip-button[
|
|
1109
|
+
media-pip-button[mediapipunavailable] {
|
|
1080
1110
|
--pip-button: none;
|
|
1081
1111
|
}
|
|
1082
1112
|
|
|
@@ -1098,11 +1128,11 @@ media-theme {
|
|
|
1098
1128
|
--media-control-padding: 4px 3px;
|
|
1099
1129
|
}
|
|
1100
1130
|
|
|
1101
|
-
[
|
|
1131
|
+
[breakpointsm] media-control-bar {
|
|
1102
1132
|
--media-control-padding: 9px 5px;
|
|
1103
1133
|
}
|
|
1104
1134
|
|
|
1105
|
-
[
|
|
1135
|
+
[breakpointmd] media-control-bar {
|
|
1106
1136
|
--media-control-padding: 9px 7px;
|
|
1107
1137
|
}
|
|
1108
1138
|
|
|
@@ -1151,7 +1181,7 @@ media-theme {
|
|
|
1151
1181
|
transition: background-color 1s;
|
|
1152
1182
|
}
|
|
1153
1183
|
|
|
1154
|
-
media-controller:is([
|
|
1184
|
+
media-controller:is([mediapaused], :not([userinactive]))::part(vertical-layer) {
|
|
1155
1185
|
background-color: var(--controls-backdrop-color, var(--controls, transparent));
|
|
1156
1186
|
transition: background-color 0.25s;
|
|
1157
1187
|
}
|
|
@@ -1215,7 +1245,7 @@ media-theme {
|
|
|
1215
1245
|
opacity: 1;
|
|
1216
1246
|
}
|
|
1217
1247
|
|
|
1218
|
-
media-loading-indicator[
|
|
1248
|
+
media-loading-indicator[medialoading]:not([mediapaused]) ~ div > * {
|
|
1219
1249
|
opacity: 0;
|
|
1220
1250
|
transition-delay: 400ms;
|
|
1221
1251
|
}
|
|
@@ -1272,7 +1302,7 @@ media-theme {
|
|
|
1272
1302
|
|
|
1273
1303
|
<template partial="SeekBackwardButton">
|
|
1274
1304
|
<media-seek-backward-button
|
|
1275
|
-
|
|
1305
|
+
seekoffset="{{backwardseekoffset}}"
|
|
1276
1306
|
part="{{section ?? 'bottom'}} seek-backward button"
|
|
1277
1307
|
disabled="{{disabled}}"
|
|
1278
1308
|
aria-disabled="{{disabled}}"
|
|
@@ -1280,7 +1310,7 @@ media-theme {
|
|
|
1280
1310
|
<svg aria-hidden="true" viewBox="0 0 22 24" slot="backward">
|
|
1281
1311
|
<path d="M11 6V3L5.37 7 11 10.94V8a5.54 5.54 0 0 1 1.9 10.48v2.12A7.5 7.5 0 0 0 11 6Z" />
|
|
1282
1312
|
<text class="value" transform="translate(2.5 21)" style="font-size: 8px; font-family: 'ArialMT', 'Arial'">
|
|
1283
|
-
{{
|
|
1313
|
+
{{backwardseekoffset}}
|
|
1284
1314
|
</text>
|
|
1285
1315
|
</svg>
|
|
1286
1316
|
</media-seek-backward-button>
|
|
@@ -1288,7 +1318,7 @@ media-theme {
|
|
|
1288
1318
|
|
|
1289
1319
|
<template partial="SeekForwardButton">
|
|
1290
1320
|
<media-seek-forward-button
|
|
1291
|
-
|
|
1321
|
+
seekoffset="{{forwardseekoffset}}"
|
|
1292
1322
|
part="{{section ?? 'bottom'}} seek-forward button"
|
|
1293
1323
|
disabled="{{disabled}}"
|
|
1294
1324
|
aria-disabled="{{disabled}}"
|
|
@@ -1296,7 +1326,7 @@ media-theme {
|
|
|
1296
1326
|
<svg aria-hidden="true" viewBox="0 0 22 24" slot="forward">
|
|
1297
1327
|
<path d="M11 6V3l5.61 4L11 10.94V8a5.54 5.54 0 0 0-1.9 10.48v2.12A7.5 7.5 0 0 1 11 6Z" />
|
|
1298
1328
|
<text class="value" transform="translate(10 21)" style="font-size: 8px; font-family: 'ArialMT', 'Arial'">
|
|
1299
|
-
{{
|
|
1329
|
+
{{forwardseekoffset}}
|
|
1300
1330
|
</text>
|
|
1301
1331
|
</svg>
|
|
1302
1332
|
</media-seek-forward-button>
|
|
@@ -1344,7 +1374,6 @@ media-theme {
|
|
|
1344
1374
|
|
|
1345
1375
|
<template partial="CaptionsMenuButton">
|
|
1346
1376
|
<media-captions-selectmenu
|
|
1347
|
-
default-showing="{{defaultShowingCaptions}}"
|
|
1348
1377
|
part="bottom captions selectmenu"
|
|
1349
1378
|
disabled="{{disabled}}"
|
|
1350
1379
|
aria-disabled="{{disabled}}"
|
|
@@ -1420,7 +1449,7 @@ media-theme {
|
|
|
1420
1449
|
|
|
1421
1450
|
<template partial="PlaybackRateButton">
|
|
1422
1451
|
<media-playback-rate-button
|
|
1423
|
-
rates="{{
|
|
1452
|
+
rates="{{playbackrates}}"
|
|
1424
1453
|
part="bottom playback-rate button"
|
|
1425
1454
|
disabled="{{disabled}}"
|
|
1426
1455
|
aria-disabled="{{disabled}}"
|
|
@@ -1437,8 +1466,8 @@ media-theme {
|
|
|
1437
1466
|
|
|
1438
1467
|
<template partial="TimeDisplay">
|
|
1439
1468
|
<media-time-display
|
|
1440
|
-
remaining="{{
|
|
1441
|
-
|
|
1469
|
+
remaining="{{defaultshowremainingtime}}"
|
|
1470
|
+
showduration="{{!hideduration}}"
|
|
1442
1471
|
part="bottom time display"
|
|
1443
1472
|
disabled="{{disabled}}"
|
|
1444
1473
|
aria-disabled="{{disabled}}"
|
|
@@ -1454,23 +1483,24 @@ media-theme {
|
|
|
1454
1483
|
</template>
|
|
1455
1484
|
|
|
1456
1485
|
<media-controller
|
|
1457
|
-
|
|
1486
|
+
defaultstreamtype="{{defaultstreamtype ?? 'on-demand'}}"
|
|
1458
1487
|
breakpoints="sm:300 md:700"
|
|
1459
|
-
|
|
1488
|
+
gesturesdisabled="{{disabled}}"
|
|
1460
1489
|
hotkeys="{{hotkeys}}"
|
|
1461
1490
|
nohotkeys="{{nohotkeys}}"
|
|
1462
1491
|
novolumepref="{{novolumepref}}"
|
|
1463
1492
|
audio="{{audio}}"
|
|
1464
1493
|
noautoseektolive="{{noautoseektolive}}"
|
|
1494
|
+
defaultsubtitles="{{defaultsubtitles}}"
|
|
1465
1495
|
exportparts="layer, media-layer, poster-layer, vertical-layer, centered-layer, gesture-layer"
|
|
1466
1496
|
>
|
|
1467
1497
|
<slot name="media" slot="media"></slot>
|
|
1468
1498
|
<slot name="poster" slot="poster"></slot>
|
|
1469
|
-
<media-loading-indicator slot="centered-chrome"
|
|
1499
|
+
<media-loading-indicator slot="centered-chrome" noautohide></media-loading-indicator>
|
|
1470
1500
|
|
|
1471
1501
|
<template if="audio">
|
|
1472
1502
|
|
|
1473
|
-
<template if="
|
|
1503
|
+
<template if="streamtype == 'on-demand'">
|
|
1474
1504
|
<template if="title">
|
|
1475
1505
|
<media-control-bar>{{>TitleDisplay}}</media-control-bar>
|
|
1476
1506
|
</template>
|
|
@@ -1488,9 +1518,9 @@ media-theme {
|
|
|
1488
1518
|
</media-control-bar>
|
|
1489
1519
|
</template>
|
|
1490
1520
|
|
|
1491
|
-
<template if="
|
|
1521
|
+
<template if="streamtype == 'live'">
|
|
1492
1522
|
|
|
1493
|
-
<template if="
|
|
1523
|
+
<template if="targetlivewindow > 0">
|
|
1494
1524
|
<template if="title">
|
|
1495
1525
|
<media-control-bar>{{>TitleDisplay}}</media-control-bar>
|
|
1496
1526
|
</template>
|
|
@@ -1509,7 +1539,7 @@ media-theme {
|
|
|
1509
1539
|
</media-control-bar>
|
|
1510
1540
|
</template>
|
|
1511
1541
|
|
|
1512
|
-
<template if="!
|
|
1542
|
+
<template if="!targetlivewindow">
|
|
1513
1543
|
<template if="title">
|
|
1514
1544
|
<media-control-bar>{{>TitleDisplay}}</media-control-bar>
|
|
1515
1545
|
</template>
|
|
@@ -1529,9 +1559,9 @@ media-theme {
|
|
|
1529
1559
|
|
|
1530
1560
|
<template if="!audio">
|
|
1531
1561
|
|
|
1532
|
-
<template if="
|
|
1562
|
+
<template if="streamtype == 'on-demand'">
|
|
1533
1563
|
|
|
1534
|
-
<template if="!
|
|
1564
|
+
<template if="!breakpointsm">
|
|
1535
1565
|
{{>TimeRange}}
|
|
1536
1566
|
<media-control-bar>
|
|
1537
1567
|
{{>PlayButton}}
|
|
@@ -1542,8 +1572,8 @@ media-theme {
|
|
|
1542
1572
|
</media-control-bar>
|
|
1543
1573
|
</template>
|
|
1544
1574
|
|
|
1545
|
-
<template if="
|
|
1546
|
-
<template if="!
|
|
1575
|
+
<template if="breakpointsm">
|
|
1576
|
+
<template if="!breakpointmd">
|
|
1547
1577
|
<media-control-bar slot="top-chrome">
|
|
1548
1578
|
{{>TitleDisplay}}
|
|
1549
1579
|
</media-control-bar>
|
|
@@ -1569,7 +1599,7 @@ media-theme {
|
|
|
1569
1599
|
</template>
|
|
1570
1600
|
</template>
|
|
1571
1601
|
|
|
1572
|
-
<template if="
|
|
1602
|
+
<template if="breakpointmd">
|
|
1573
1603
|
<media-control-bar slot="top-chrome">
|
|
1574
1604
|
{{>TitleDisplay}}
|
|
1575
1605
|
</media-control-bar>
|
|
@@ -1596,11 +1626,11 @@ media-theme {
|
|
|
1596
1626
|
|
|
1597
1627
|
</template>
|
|
1598
1628
|
|
|
1599
|
-
<template if="
|
|
1629
|
+
<template if="streamtype == 'live'">
|
|
1600
1630
|
|
|
1601
|
-
<template if="!
|
|
1631
|
+
<template if="!targetlivewindow">
|
|
1602
1632
|
|
|
1603
|
-
<template if="!
|
|
1633
|
+
<template if="!breakpointsm">
|
|
1604
1634
|
<media-control-bar slot="top-chrome">
|
|
1605
1635
|
{{>LiveButton}}
|
|
1606
1636
|
</media-control-bar>
|
|
@@ -1613,8 +1643,8 @@ media-theme {
|
|
|
1613
1643
|
</media-control-bar>
|
|
1614
1644
|
</template>
|
|
1615
1645
|
|
|
1616
|
-
<template if="
|
|
1617
|
-
<template if="!
|
|
1646
|
+
<template if="breakpointsm">
|
|
1647
|
+
<template if="!breakpointmd">
|
|
1618
1648
|
<media-control-bar slot="top-chrome">
|
|
1619
1649
|
{{>LiveButton}}
|
|
1620
1650
|
{{>TitleDisplay}}
|
|
@@ -1636,7 +1666,7 @@ media-theme {
|
|
|
1636
1666
|
</template>
|
|
1637
1667
|
</template>
|
|
1638
1668
|
|
|
1639
|
-
<template if="
|
|
1669
|
+
<template if="breakpointmd">
|
|
1640
1670
|
<media-control-bar slot="top-chrome">
|
|
1641
1671
|
{{>LiveButton}}
|
|
1642
1672
|
{{>TitleDisplay}}
|
|
@@ -1658,9 +1688,9 @@ media-theme {
|
|
|
1658
1688
|
</template>
|
|
1659
1689
|
</template>
|
|
1660
1690
|
|
|
1661
|
-
<template if="
|
|
1691
|
+
<template if="targetlivewindow > 0">
|
|
1662
1692
|
|
|
1663
|
-
<template if="!
|
|
1693
|
+
<template if="!breakpointsm">
|
|
1664
1694
|
<media-control-bar slot="top-chrome">
|
|
1665
1695
|
{{>LiveButton}}
|
|
1666
1696
|
</media-control-bar>
|
|
@@ -1674,8 +1704,8 @@ media-theme {
|
|
|
1674
1704
|
</media-control-bar>
|
|
1675
1705
|
</template>
|
|
1676
1706
|
|
|
1677
|
-
<template if="
|
|
1678
|
-
<template if="!
|
|
1707
|
+
<template if="breakpointsm">
|
|
1708
|
+
<template if="!breakpointmd">
|
|
1679
1709
|
<media-control-bar slot="top-chrome">
|
|
1680
1710
|
{{>LiveButton}}
|
|
1681
1711
|
{{>TitleDisplay}}
|
|
@@ -1700,7 +1730,7 @@ media-theme {
|
|
|
1700
1730
|
</template>
|
|
1701
1731
|
</template>
|
|
1702
1732
|
|
|
1703
|
-
<template if="
|
|
1733
|
+
<template if="breakpointmd">
|
|
1704
1734
|
<media-control-bar slot="top-chrome">
|
|
1705
1735
|
{{>LiveButton}}
|
|
1706
1736
|
{{>TitleDisplay}}
|
|
@@ -1734,7 +1764,7 @@ media-theme {
|
|
|
1734
1764
|
|
|
1735
1765
|
</media-controller>
|
|
1736
1766
|
</template>
|
|
1737
|
-
`;var
|
|
1767
|
+
`;var kl=`
|
|
1738
1768
|
:host {
|
|
1739
1769
|
z-index: 100;
|
|
1740
1770
|
display: var(--media-dialog-display, flex);
|
|
@@ -1786,17 +1816,17 @@ media-theme {
|
|
|
1786
1816
|
text-align: center;
|
|
1787
1817
|
line-height: 1.4;
|
|
1788
1818
|
}
|
|
1789
|
-
`,
|
|
1819
|
+
`,Sl=se.createElement("template");Sl.innerHTML=`
|
|
1790
1820
|
<style>
|
|
1791
|
-
${
|
|
1821
|
+
${kl}
|
|
1792
1822
|
</style>
|
|
1793
1823
|
|
|
1794
1824
|
<div class="dialog">
|
|
1795
1825
|
<slot></slot>
|
|
1796
1826
|
</div>
|
|
1797
|
-
`;var
|
|
1827
|
+
`;var tt=class extends W.HTMLElement{constructor(){var t;super();this.attachShadow({mode:"open"}),(t=this.shadowRoot)==null||t.appendChild(this.constructor.template.content.cloneNode(!0))}show(){this.setAttribute("open",""),this.dispatchEvent(new CustomEvent("open",{composed:!0,bubbles:!0})),Il(this)}close(){!this.hasAttribute("open")||(this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("close",{composed:!0,bubbles:!0})),Uu(this))}attributeChangedCallback(t,a,r){t==="open"&&a!==r&&(r!=null?this.show():this.close())}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","dialog"),this.hasAttribute("open")&&Il(this)}};tt.styles=kl,tt.template=Sl,tt.observedAttributes=["open"];function Il(i){let e=new CustomEvent("initfocus",{composed:!0,bubbles:!0,cancelable:!0});if(i.dispatchEvent(e),e.defaultPrevented)return;let t=i.querySelector("[autofocus]:not([disabled])");!t&&i.tabIndex>=0&&(t=i),t||(t=Ml(i.shadowRoot)),i._previouslyFocusedElement=se.activeElement,se.activeElement instanceof HTMLElement&&se.activeElement.blur(),i.addEventListener("transitionend",()=>{t instanceof HTMLElement&&t.focus({preventScroll:!0})},{once:!0})}function Ml(i){let t=["button","input","keygen","select","textarea"].map(function(r){return r+":not([disabled])"});t.push('[tabindex]:not([disabled]):not([tabindex=""])');let a=i==null?void 0:i.querySelector(t.join(", "));if(!a&&"attachShadow"in Element.prototype){let r=(i==null?void 0:i.querySelectorAll("*"))||[];for(let n=0;n<r.length&&!(r[n].tagName&&r[n].shadowRoot&&(a=Ml(r[n].shadowRoot),a));n++);}return a}function Uu(i){i._previouslyFocusedElement instanceof HTMLElement&&i._previouslyFocusedElement.focus()}W.customElements.get("media-dialog")||(W.customElements.define("media-dialog",tt),W.MediaDialog=tt);var qn=tt;var Ll=se.createElement("template");Ll.innerHTML=`
|
|
1798
1828
|
<style>
|
|
1799
|
-
${
|
|
1829
|
+
${qn.styles}
|
|
1800
1830
|
|
|
1801
1831
|
.close {
|
|
1802
1832
|
background: none;
|
|
@@ -1825,81 +1855,81 @@ media-theme {
|
|
|
1825
1855
|
</svg>
|
|
1826
1856
|
</button>
|
|
1827
1857
|
</slot>
|
|
1828
|
-
`;var
|
|
1858
|
+
`;var $i=class extends qn{constructor(){var e,t;super(),(t=(e=this.shadowRoot)==null?void 0:e.querySelector(".close"))==null||t.addEventListener("click",()=>{this.close()})}};$i.template=Ll;W.customElements.get("mxp-dialog")||(W.customElements.define("mxp-dialog",$i),W.MxpDialog=$i);var Vi=new WeakMap,Hi=class{constructor(e,t){this.element=e;this.type=t;this.element.addEventListener(this.type,this);let a=Vi.get(this.element);a&&a.set(this.type,this)}set(e){if(typeof e=="function")this.handleEvent=e.bind(this.element);else if(typeof e=="object"&&typeof e.handleEvent=="function")this.handleEvent=e.handleEvent.bind(e);else{this.element.removeEventListener(this.type,this);let t=Vi.get(this.element);t&&t.delete(this.type)}}static for(e){Vi.has(e.element)||Vi.set(e.element,new Map);let t=e.attributeName.slice(2),a=Vi.get(e.element);return a&&a.has(t)?a.get(t):new Hi(e.element,t)}};function Bu(i,e){return i instanceof ee&&i.attributeName.startsWith("on")?(Hi.for(i).set(e),i.element.removeAttributeNS(i.attributeNamespace,i.attributeName),!0):!1}function $u(i,e){return e instanceof cr&&i instanceof Ve?(e.renderInto(i),!0):!1}function Vu(i,e){return e instanceof DocumentFragment&&i instanceof Ve?(e.childNodes.length&&i.replace(...e.childNodes),!0):!1}function Hu(i,e){if(i instanceof ee){let t=i.attributeNamespace,a=i.element.getAttributeNS(t,i.attributeName);return String(e)!==a&&(i.value=String(e)),!0}return i.value=String(e),!0}function Wu(i,e){if(i instanceof ee&&e instanceof Element){let t=i.element;return t[i.attributeName]!==e&&(i.element.removeAttributeNS(i.attributeNamespace,i.attributeName),t[i.attributeName]=e),!0}return!1}function Fu(i,e){if(typeof e=="boolean"&&i instanceof ee){let t=i.attributeNamespace,a=i.element.hasAttributeNS(t,i.attributeName);return e!==a&&(i.booleanValue=e),!0}return!1}function Ku(i,e){return e===!1&&i instanceof Ve?(i.replace(""),!0):!1}function Yu(i,e){Wu(i,e)||Fu(i,e)||Bu(i,e)||Ku(i,e)||$u(i,e)||Vu(i,e)||Hu(i,e)}var Qn=new Map,wl=new WeakMap,Cl=new WeakMap,cr=class{constructor(e,t,a){this.strings=e;this.values=t;this.processor=a;this.stringsKey=this.strings.join("")}get template(){if(Qn.has(this.stringsKey))return Qn.get(this.stringsKey);{let e=se.createElement("template"),t=this.strings.length-1;return e.innerHTML=this.strings.reduce((a,r,n)=>a+r+(n<t?`{{ ${n} }}`:""),""),Qn.set(this.stringsKey,e),e}}renderInto(e){var r;let t=this.template;if(wl.get(e)!==t){wl.set(e,t);let n=new $e(t,this.values,this.processor);Cl.set(e,n),e instanceof Ve?e.replace(...n.children):e.appendChild(n);return}let a=Cl.get(e);(r=a==null?void 0:a.update)==null||r.call(a,this.values)}},Gu={processCallback(i,e,t){var a;if(!!t){for(let[r,n]of e)if(r in t){let s=(a=t[r])!=null?a:"";Yu(n,s)}}}};function He(i,...e){return new cr(i,e,Gu)}function Rl(i,e){i.renderInto(e)}var Dl=require("@mux/playback-core"),zn=se.createElement("template");"innerHTML"in zn&&(zn.innerHTML=Tl);var xl=i=>He`
|
|
1829
1859
|
<style>
|
|
1830
|
-
${
|
|
1860
|
+
${yl}
|
|
1831
1861
|
</style>
|
|
1832
|
-
${
|
|
1833
|
-
`,
|
|
1862
|
+
${qu(i)}
|
|
1863
|
+
`,Zu=i=>{let e=i.hotKeys?`${i.hotKeys}`:"";return Ri(i.streamType)==="live"&&(e+=" noarrowleft noarrowright"),e},qu=i=>{var e,t,a,r,n,s,l,u,m,p,f,A,T,B,Z,I,ne,be,oe,si,St,jn,es,ts,is,as,rs,ns,ss,os,ls,ds,us,cs,ms;return He`
|
|
1834
1864
|
<media-theme
|
|
1835
|
-
template="${(e=i.themeTemplate)!=null?e
|
|
1836
|
-
|
|
1837
|
-
hotkeys="${
|
|
1865
|
+
template="${(e=i.themeTemplate)!=null?e:zn.content.children[0]}"
|
|
1866
|
+
defaultstreamtype="${(t=i.defaultStreamType)!=null?t:!1}"
|
|
1867
|
+
hotkeys="${Zu(i)||!1}"
|
|
1838
1868
|
nohotkeys="${i.noHotKeys||!i.hasSrc||i.isDialogOpen||!1}"
|
|
1839
|
-
noautoseektolive="${!!((a=i.streamType)!=null&&a.includes(
|
|
1869
|
+
noautoseektolive="${!!((a=i.streamType)!=null&&a.includes(Dl.StreamTypes.LIVE))&&i.targetLiveWindow!==0}"
|
|
1840
1870
|
novolumepref="${i.novolumepref||!1}"
|
|
1841
1871
|
disabled="${!i.hasSrc||i.isDialogOpen}"
|
|
1842
1872
|
audio="${(r=i.audio)!=null?r:!1}"
|
|
1843
|
-
style="${(n=
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
title="${(
|
|
1873
|
+
style="${(n=tl({"--media-primary-color":i.primaryColor,"--media-secondary-color":i.secondaryColor}))!=null?n:!1}"
|
|
1874
|
+
defaultsubtitles="${!i.defaultHiddenCaptions}"
|
|
1875
|
+
forwardseekoffset="${(s=i.forwardSeekOffset)!=null?s:!1}"
|
|
1876
|
+
backwardseekoffset="${(l=i.backwardSeekOffset)!=null?l:!1}"
|
|
1877
|
+
playbackrates="${(u=i.playbackRates)!=null?u:!1}"
|
|
1878
|
+
defaultshowremainingtime="${(m=i.defaultShowRemainingTime)!=null?m:!1}"
|
|
1879
|
+
hideduration="${(p=i.hideDuration)!=null?p:!1}"
|
|
1880
|
+
title="${(f=i.title)!=null?f:!1}"
|
|
1851
1881
|
exportparts="top, center, bottom, layer, media-layer, poster-layer, vertical-layer, centered-layer, gesture-layer, poster, live, play, button, seek-backward, seek-forward, mute, captions, airplay, pip, fullscreen, cast, playback-rate, volume, range, time, display"
|
|
1852
1882
|
>
|
|
1853
1883
|
<mux-video
|
|
1854
1884
|
slot="media"
|
|
1855
|
-
target-live-window="${(
|
|
1856
|
-
stream-type="${(
|
|
1857
|
-
crossorigin="${(
|
|
1885
|
+
target-live-window="${(A=i.targetLiveWindow)!=null?A:!1}"
|
|
1886
|
+
stream-type="${(T=Ri(i.streamType))!=null?T:!1}"
|
|
1887
|
+
crossorigin="${(B=i.crossOrigin)!=null?B:""}"
|
|
1858
1888
|
playsinline
|
|
1859
|
-
autoplay="${(
|
|
1860
|
-
muted="${(
|
|
1861
|
-
loop="${(
|
|
1862
|
-
preload="${(
|
|
1863
|
-
debug="${(
|
|
1864
|
-
prefer-cmcd="${(
|
|
1865
|
-
disable-cookies="${(
|
|
1866
|
-
prefer-playback="${(
|
|
1889
|
+
autoplay="${(Z=i.autoplay)!=null?Z:!1}"
|
|
1890
|
+
muted="${(I=i.muted)!=null?I:!1}"
|
|
1891
|
+
loop="${(ne=i.loop)!=null?ne:!1}"
|
|
1892
|
+
preload="${(be=i.preload)!=null?be:!1}"
|
|
1893
|
+
debug="${(oe=i.debug)!=null?oe:!1}"
|
|
1894
|
+
prefer-cmcd="${(si=i.preferCmcd)!=null?si:!1}"
|
|
1895
|
+
disable-cookies="${(St=i.disableCookies)!=null?St:!1}"
|
|
1896
|
+
prefer-playback="${(jn=i.preferPlayback)!=null?jn:!1}"
|
|
1867
1897
|
start-time="${i.startTime!=null?i.startTime:!1}"
|
|
1868
|
-
beacon-collection-domain="${(
|
|
1869
|
-
player-software-name="${(
|
|
1870
|
-
player-software-version="${(
|
|
1871
|
-
env-key="${(
|
|
1872
|
-
custom-domain="${(
|
|
1873
|
-
src="${i.src?i.src:i.playbackId?
|
|
1874
|
-
cast-src="${i.src?i.src:i.playbackId?
|
|
1898
|
+
beacon-collection-domain="${(es=i.beaconCollectionDomain)!=null?es:!1}"
|
|
1899
|
+
player-software-name="${(ts=i.playerSoftwareName)!=null?ts:!1}"
|
|
1900
|
+
player-software-version="${(is=i.playerSoftwareVersion)!=null?is:!1}"
|
|
1901
|
+
env-key="${(as=i.envKey)!=null?as:!1}"
|
|
1902
|
+
custom-domain="${(rs=i.customDomain)!=null?rs:!1}"
|
|
1903
|
+
src="${i.src?i.src:i.playbackId?Pn(i.playbackId,{maxResolution:i.maxResolution,domain:i.customDomain,token:i.tokens.playback}):!1}"
|
|
1904
|
+
cast-src="${i.src?i.src:i.playbackId?Pn(i.playbackId,{maxResolution:i.maxResolution,domain:i.customDomain,token:i.tokens.playback}):!1}"
|
|
1875
1905
|
exportparts="video"
|
|
1876
1906
|
>
|
|
1877
|
-
${i.storyboard?
|
|
1907
|
+
${i.storyboard?He`<track label="thumbnails" default kind="metadata" src="${i.storyboard}" />`:He``}
|
|
1878
1908
|
</mux-video>
|
|
1879
1909
|
<media-poster-image
|
|
1880
1910
|
slot="poster"
|
|
1881
1911
|
part="poster"
|
|
1882
|
-
src="${i.poster===""?!1:(
|
|
1883
|
-
placeholder-src="${(
|
|
1912
|
+
src="${i.poster===""?!1:(ns=i.poster)!=null?ns:!1}"
|
|
1913
|
+
placeholder-src="${(ss=i.placeholder)!=null?ss:!1}"
|
|
1884
1914
|
></media-poster-image>
|
|
1885
1915
|
<mxp-dialog
|
|
1886
1916
|
no-auto-hide
|
|
1887
|
-
open="${(
|
|
1917
|
+
open="${(os=i.isDialogOpen)!=null?os:!1}"
|
|
1888
1918
|
onclose="${i.onCloseErrorDialog}"
|
|
1889
1919
|
oninitfocus="${i.onInitFocusDialog}"
|
|
1890
1920
|
>
|
|
1891
|
-
${(
|
|
1921
|
+
${(ls=i.dialog)!=null&&ls.title?He`<h3>${i.dialog.title}</h3>`:He``}
|
|
1892
1922
|
<p>
|
|
1893
|
-
${(
|
|
1894
|
-
${(
|
|
1923
|
+
${(ds=i.dialog)==null?void 0:ds.message}
|
|
1924
|
+
${(us=i.dialog)!=null&&us.linkUrl?He`<a
|
|
1895
1925
|
href="${i.dialog.linkUrl}"
|
|
1896
1926
|
target="_blank"
|
|
1897
1927
|
rel="external noopener"
|
|
1898
|
-
aria-label="${(
|
|
1899
|
-
>${(
|
|
1900
|
-
>`:
|
|
1928
|
+
aria-label="${(cs=i.dialog.linkText)!=null?cs:""} ${y("(opens in a new window)")}"
|
|
1929
|
+
>${(ms=i.dialog.linkText)!=null?ms:i.dialog.linkUrl}</a
|
|
1930
|
+
>`:He``}
|
|
1901
1931
|
</p>
|
|
1902
1932
|
</mxp-dialog>
|
|
1903
1933
|
</media-theme>
|
|
1904
|
-
`};var Ci=require("@mux/mux-video");function ja(i,e,t,a,r){var l,u,c;let n={},s={};switch(i.code){case Ci.MediaError.MEDIA_ERR_NETWORK:{switch(n.title=T("Network Error",r),n.message=i.message,(l=i.data)==null?void 0:l.response.code){case 412:{n.title=T("Video is not currently available",r),n.message=T("The live stream or video file are not yet ready.",r),s.message=T("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=T("Video does not exist",r),n.message="",s.message=T("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=T("Invalid playback URL",r),n.message=T("The video URL or playback-token are formatted with incorrect or incomplete information.",r),s.message=T("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:A,sub:g}=We(a),y=Date.now()>f*1e3,R=g!==t,$=A!=="v",k={timeStyle:"medium",dateStyle:"medium"};if(y){n.title=T("Video URL has expired",r),n.message=T("The video\u2019s secured playback-token has expired.",r),s.message=T("The video\u2019s secured playback-token has expired.",r),s.context=T("Expired at: {expiredDate}. Current time: {currentDate}.",r).format({expiredDate:new Intl.DateTimeFormat(rt.code,k).format(f*1e3),currentDate:new Intl.DateTimeFormat(rt.code,k).format(Date.now())}),s.file="403-expired-token.md";break}if(R){n.title=T("Video URL is formatted incorrectly",r),n.message=T("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),s.message=T("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),s.context=T("Specified playback ID: {playbackId} and the playback ID encoded in the playback-token: {tokenPlaybackId}",r).format({playbackId:t,tokenPlaybackId:g}),s.file="403-playback-id-mismatch.md";break}if($){n.title=T("Video URL is formatted incorrectly",r),n.message=T("The playback-token is formatted with incorrect information.",r),s.message=T("The playback-token is formatted with incorrect information.",r),s.context=T("The playback-token has an incorrect aud value: {tokenType}. aud value should be v.",r).format({tokenType:A}),s.file="403-incorrect-aud-value.md";break}s.message=T("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 Ci.MediaError.MEDIA_ERR_DECODE:{let{message:f}=i;n={title:T("Media Error",r),message:f},s.file="media-decode-error.md";break}case Ci.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:{let f=(c=(u=i.data)==null?void 0:u.response)==null?void 0:c.code;if(f>=400&&f<500){i.code=Ci.MediaError.MEDIA_ERR_NETWORK,i.data={response:{code:f}},{dialog:n,devlog:s}=ja(i,e,t,a);break}n={title:T("Source Not Supported",r),message:i.message},s.file="media-src-not-supported.md";break}default:n={title:T("Error",r),message:i.message};break}return e&&(n={title:T("Your device appears to be offline",r),message:T("Check your internet connection and try reloading this video.",r)}),{dialog:n,devlog:s}}var Re={SRC:"src",POSTER:"poster"},h={STYLE:"style",DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-color",FORWARD_SEEK_OFFSET:"forward-seek-offset",BACKWARD_SEEK_OFFSET:"backward-seek-offset",PLAYBACK_TOKEN:"playback-token",THUMBNAIL_TOKEN:"thumbnail-token",STORYBOARD_TOKEN:"storyboard-token",STORYBOARD_SRC:"storyboard-src",THUMBNAIL_TIME:"thumbnail-time",AUDIO:"audio",NOHOTKEYS:"nohotkeys",HOTKEYS:"hotkeys",PLAYBACK_RATES:"playbackrates",DEFAULT_SHOW_REMAINING_TIME:"default-show-remaining-time",TITLE:"title",PLACEHOLDER:"placeholder",THEME:"theme",DEFAULT_STREAM_TYPE:"default-stream-type",TARGET_LIVE_WINDOW:"target-live-window",NO_VOLUME_PREF:"no-volume-pref"},Hn=["audio","backward-seek-offset","default-show-remaining-time","default-showing-captions","noautoseektolive","disabled","exportparts","forward-seek-offset","hide-duration","hotkeys","nohotkeys","playbackrates","default-stream-type","stream-type","style","target-live-window","template","title","no-volume-pref"];function Du(i,e){var a;return{src:!i.playbackId&&i.src,playbackId:i.playbackId,hasSrc:!!i.playbackId||!!i.src,poster:i.poster,storyboard:i.storyboard,storyboardSrc:i.getAttribute(h.STORYBOARD_SRC),placeholder:i.getAttribute("placeholder"),themeTemplate:Ou(i),thumbnailTime:!i.tokens.thumbnail&&i.thumbnailTime,autoplay:i.autoplay,crossOrigin:i.crossOrigin,loop:i.loop,noHotKeys:i.hasAttribute(h.NOHOTKEYS),hotKeys:i.getAttribute(h.HOTKEYS),muted:i.muted,paused:i.paused,preload:i.preload,envKey:i.envKey,preferCmcd:i.preferCmcd,debug:i.debug,disableCookies:i.disableCookies,tokens:i.tokens,beaconCollectionDomain:i.beaconCollectionDomain,maxResolution:i.maxResolution,metadata:i.metadata,playerSoftwareName:i.playerSoftwareName,playerSoftwareVersion:i.playerSoftwareVersion,startTime:i.startTime,preferPlayback:i.preferPlayback,audio:i.audio,defaultStreamType:i.defaultStreamType,targetLiveWindow:i.getAttribute(E.Attributes.TARGET_LIVE_WINDOW),streamType:gi(i.getAttribute(E.Attributes.STREAM_TYPE)),primaryColor:i.primaryColor,secondaryColor:i.secondaryColor,forwardSeekOffset:i.forwardSeekOffset,backwardSeekOffset:i.backwardSeekOffset,defaultHiddenCaptions:i.defaultHiddenCaptions,defaultShowRemainingTime:i.defaultShowRemainingTime,hideDuration:Nu(i),playbackRates:i.getAttribute(h.PLAYBACK_RATES),customDomain:(a=i.getAttribute(E.Attributes.CUSTOM_DOMAIN))!=null?a:void 0,title:i.getAttribute(h.TITLE),novolumepref:i.hasAttribute(h.NO_VOLUME_PREF),...e}}function Ou(i){var t,a;let e=i.getAttribute(h.THEME);if(e){let r=(a=(t=i.getRootNode())==null?void 0:t.getElementById)==null?void 0:a.call(t,e);if(r)return r;e.startsWith("media-theme-")||(e=`media-theme-${e}`);let n=O.customElements.get(e);if(n!=null&&n.template)return n.template}}function Nu(i){var t;let e=(t=i.mediaController)==null?void 0:t.querySelector("media-time-display");return e&&getComputedStyle(e).getPropertyValue("--media-duration-display-display").trim()==="none"}function vl(i){return i.getAttributeNames().filter(e=>e.startsWith("metadata-")).reduce((e,t)=>{let a=i.getAttribute(t);return a!==null&&(e[t.replace(/^metadata-/,"").replace(/-/g,"_")]=a),e},{})}var Pu=Object.values(E.Attributes),Uu=Object.values(Re),Bu=Object.values(h),$u=Fa(),Hu="mux-player",El={dialog:void 0,isDialogOpen:!1},xi,Di,xe,Oi,pt,Ze,Ft,er,gl,Ni,Wn,qe,Kt,tr,Al,ir,_l,ar,yl,rr,Tl,Ri=class extends wn{constructor(){super();x(this,Ze);x(this,er);x(this,Ni);x(this,qe);x(this,tr);x(this,ir);x(this,ar);x(this,rr);x(this,xi,!1);x(this,Di,{});x(this,xe,!0);x(this,Oi,new Va(this,"hotkeys"));x(this,pt,{...El,onCloseErrorDialog:()=>P(this,Ni,Wn).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:t=>{Tn(this,X.activeElement)||t.preventDefault()}});this.attachShadow({mode:"open"}),P(this,er,gl).call(this),this.isConnected&&P(this,Ze,Ft).call(this)}static get observedAttributes(){var t;return[...(t=wn.observedAttributes)!=null?t:[],...Uu,...Pu,...Bu]}get mediaTheme(){var t;return(t=this.shadowRoot)==null?void 0:t.querySelector("media-theme")}get mediaController(){var t,a;return(a=(t=this.mediaTheme)==null?void 0:t.shadowRoot)==null?void 0:a.querySelector("media-controller")}connectedCallback(){var a;let t=(a=this.shadowRoot)==null?void 0:a.querySelector("mux-video");t&&(t.metadata=vl(this))}attributeChangedCallback(t,a,r){switch(P(this,Ze,Ft).call(this),super.attributeChangedCallback(t,a,r),t){case h.HOTKEYS:I(this,Oi).value=r;break;case h.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&Ve(T("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case h.THUMBNAIL_TOKEN:{let{aud:s}=We(r);r&&s!=="t"&&Ve(T("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:s}));break}case h.STORYBOARD_TOKEN:{let{aud:s}=We(r);r&&s!=="s"&&Ve(T("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:s}));break}case E.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&le(T("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r}));break}case E.Attributes.STREAM_TYPE:r&&![C.StreamTypes.LIVE,C.StreamTypes.ON_DEMAND,C.StreamTypes.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:Mn({file:"invalid-stream-type.md",message:T("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):this.targetLiveWindow=r===C.StreamTypes.LIVE?0:Number.NaN}[E.Attributes.PLAYBACK_ID,Re.SRC,h.PLAYBACK_TOKEN].includes(t)&&a!==r&&te(this,pt,{...I(this,pt),...El}),P(this,qe,Kt).call(this,{[Wo(t)]:r})}get preferCmcd(){var t;return(t=this.getAttribute(E.Attributes.PREFER_CMCD))!=null?t:void 0}set preferCmcd(t){t!==this.preferCmcd&&(t?C.CmcdTypeValues.includes(t)?this.setAttribute(E.Attributes.PREFER_CMCD,t):Ve(`Invalid value for preferCmcd. Must be one of ${C.CmcdTypeValues.join()}`):this.removeAttribute(E.Attributes.PREFER_CMCD))}get hasPlayed(){var t,a;return(a=(t=this.mediaController)==null?void 0:t.hasAttribute("media-has-played"))!=null?a:!1}get inLiveWindow(){var t;return(t=this.mediaController)==null?void 0:t.hasAttribute("media-time-is-live")}get _hls(){var t;return(t=this.media)==null?void 0:t._hls}get mux(){var t;return(t=this.media)==null?void 0:t.mux}get theme(){var t;return(t=this.getAttribute(h.THEME))!=null?t:""}set theme(t){this.setAttribute(h.THEME,`${t}`)}get themeProps(){let t=this.mediaTheme;if(!t)return;let a={};for(let r of t.getAttributeNames()){if(Hn.includes(r))continue;let n=t.getAttribute(r);a[$a(r)]=n===""?!0:n}return a}set themeProps(t){var r,n;P(this,Ze,Ft).call(this);let a={...this.themeProps,...t};for(let s in a){if(Hn.includes(s))continue;let l=t==null?void 0:t[s];typeof l=="boolean"||l==null?(r=this.mediaTheme)==null||r.toggleAttribute(Ba(s),Boolean(l)):(n=this.mediaTheme)==null||n.setAttribute(Ba(s),l)}}get playbackId(){var t;return(t=this.getAttribute(E.Attributes.PLAYBACK_ID))!=null?t:void 0}set playbackId(t){t?this.setAttribute(E.Attributes.PLAYBACK_ID,t):this.removeAttribute(E.Attributes.PLAYBACK_ID)}get src(){var t,a;return this.playbackId?(t=ht(this,Re.SRC))!=null?t:void 0:(a=this.getAttribute(Re.SRC))!=null?a:void 0}set src(t){t?this.setAttribute(Re.SRC,t):this.removeAttribute(Re.SRC)}get poster(){var a;let t=this.getAttribute(Re.POSTER);if(t!=null)return t;if(this.playbackId&&!this.audio)return $o(this.playbackId,{domain:this.customDomain,thumbnailTime:(a=this.thumbnailTime)!=null?a:this.startTime,token:this.tokens.thumbnail})}set poster(t){t||t===""?this.setAttribute(Re.POSTER,t):this.removeAttribute(Re.POSTER)}get storyboardSrc(){var t;return(t=this.getAttribute(h.STORYBOARD_SRC))!=null?t:void 0}set storyboardSrc(t){t?this.setAttribute(h.STORYBOARD_SRC,t):this.removeAttribute(h.STORYBOARD_SRC)}get storyboard(){if(this.storyboardSrc&&!this.tokens.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[C.StreamTypes.LIVE,C.StreamTypes.UNKNOWN].includes(this.streamType)))return Ho(this.playbackId,{domain:this.customDomain,token:this.tokens.storyboard})}get audio(){return this.hasAttribute(h.AUDIO)}set audio(t){if(!t){this.removeAttribute(h.AUDIO);return}this.setAttribute(h.AUDIO,"")}get hotkeys(){return I(this,Oi)}get nohotkeys(){return this.hasAttribute(h.NOHOTKEYS)}set nohotkeys(t){if(!t){this.removeAttribute(h.NOHOTKEYS);return}this.setAttribute(h.NOHOTKEYS,"")}get thumbnailTime(){return Me(this.getAttribute(h.THUMBNAIL_TIME))}set thumbnailTime(t){this.setAttribute(h.THUMBNAIL_TIME,`${t}`)}get title(){var t;return(t=this.getAttribute(h.TITLE))!=null?t:""}set title(t){t!==this.title&&(t?this.setAttribute(h.TITLE,t):this.removeAttribute("title"),super.title=t)}get placeholder(){var t;return(t=ht(this,h.PLACEHOLDER))!=null?t:""}set placeholder(t){this.setAttribute(h.PLACEHOLDER,`${t}`)}get primaryColor(){var a,r;let t=this.getAttribute(h.PRIMARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=O.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),t))return t}set primaryColor(t){this.setAttribute(h.PRIMARY_COLOR,`${t}`)}get secondaryColor(){var a,r;let t=this.getAttribute(h.SECONDARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=O.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),t))return t}set secondaryColor(t){this.setAttribute(h.SECONDARY_COLOR,`${t}`)}get defaultShowRemainingTime(){return this.hasAttribute(h.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(t){t?this.setAttribute(h.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(h.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(!!this.hasAttribute(h.PLAYBACK_RATES))return this.getAttribute(h.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(t=>Number(t)).filter(t=>!Number.isNaN(t)).sort((t,a)=>t-a)}set playbackRates(t){if(!t){this.removeAttribute(h.PLAYBACK_RATES);return}this.setAttribute(h.PLAYBACK_RATES,t.join(" "))}get forwardSeekOffset(){var t;return(t=Me(this.getAttribute(h.FORWARD_SEEK_OFFSET)))!=null?t:10}set forwardSeekOffset(t){this.setAttribute(h.FORWARD_SEEK_OFFSET,`${t}`)}get backwardSeekOffset(){var t;return(t=Me(this.getAttribute(h.BACKWARD_SEEK_OFFSET)))!=null?t:10}set backwardSeekOffset(t){this.setAttribute(h.BACKWARD_SEEK_OFFSET,`${t}`)}get defaultHiddenCaptions(){return this.hasAttribute(h.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(t){t?this.setAttribute(h.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(h.DEFAULT_HIDDEN_CAPTIONS)}get playerSoftwareName(){var t;return(t=this.getAttribute(E.Attributes.PLAYER_SOFTWARE_NAME))!=null?t:Hu}get playerSoftwareVersion(){var t;return(t=this.getAttribute(E.Attributes.PLAYER_SOFTWARE_VERSION))!=null?t:$u}get beaconCollectionDomain(){var t;return(t=this.getAttribute(E.Attributes.BEACON_COLLECTION_DOMAIN))!=null?t:void 0}set beaconCollectionDomain(t){t!==this.beaconCollectionDomain&&(t?this.setAttribute(E.Attributes.BEACON_COLLECTION_DOMAIN,t):this.removeAttribute(E.Attributes.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var t;return(t=this.getAttribute(E.Attributes.MAX_RESOLUTION))!=null?t:void 0}set maxResolution(t){t!==this.maxResolution&&(t?this.setAttribute(E.Attributes.MAX_RESOLUTION,t):this.removeAttribute(E.Attributes.MAX_RESOLUTION))}get customDomain(){var t;return(t=this.getAttribute(E.Attributes.CUSTOM_DOMAIN))!=null?t:void 0}set customDomain(t){t!==this.customDomain&&(t?this.setAttribute(E.Attributes.CUSTOM_DOMAIN,t):this.removeAttribute(E.Attributes.CUSTOM_DOMAIN))}get envKey(){var t;return(t=ht(this,E.Attributes.ENV_KEY))!=null?t:void 0}set envKey(t){this.setAttribute(E.Attributes.ENV_KEY,`${t}`)}get noVolumePref(){return this.hasAttribute(h.NO_VOLUME_PREF)}set noVolumePref(t){t?this.setAttribute(h.NO_VOLUME_PREF,""):this.removeAttribute(h.NO_VOLUME_PREF)}get debug(){return ht(this,E.Attributes.DEBUG)!=null}set debug(t){t?this.setAttribute(E.Attributes.DEBUG,""):this.removeAttribute(E.Attributes.DEBUG)}get disableCookies(){return ht(this,E.Attributes.DISABLE_COOKIES)!=null}set disableCookies(t){t?this.setAttribute(E.Attributes.DISABLE_COOKIES,""):this.removeAttribute(E.Attributes.DISABLE_COOKIES)}get streamType(){var t,a,r;return(r=(a=this.getAttribute(E.Attributes.STREAM_TYPE))!=null?a:(t=this.media)==null?void 0:t.streamType)!=null?r:C.StreamTypes.UNKNOWN}set streamType(t){this.setAttribute(E.Attributes.STREAM_TYPE,`${t}`)}get defaultStreamType(){var t,a,r;return(r=(a=this.getAttribute(h.DEFAULT_STREAM_TYPE))!=null?a:(t=this.mediaController)==null?void 0:t.getAttribute(h.DEFAULT_STREAM_TYPE))!=null?r:C.StreamTypes.ON_DEMAND}set defaultStreamType(t){t?this.setAttribute(h.DEFAULT_STREAM_TYPE,t):this.removeAttribute(h.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var t,a;return this.hasAttribute(h.TARGET_LIVE_WINDOW)?+this.getAttribute(h.TARGET_LIVE_WINDOW):(a=(t=this.media)==null?void 0:t.targetLiveWindow)!=null?a:Number.NaN}set targetLiveWindow(t){t!=this.targetLiveWindow&&(t==null?this.removeAttribute(h.TARGET_LIVE_WINDOW):this.setAttribute(h.TARGET_LIVE_WINDOW,`${+t}`))}get liveEdgeStart(){var t;return(t=this.media)==null?void 0:t.liveEdgeStart}get startTime(){return Me(ht(this,E.Attributes.START_TIME))}set startTime(t){this.setAttribute(E.Attributes.START_TIME,`${t}`)}get preferPlayback(){let t=this.getAttribute(E.Attributes.PREFER_PLAYBACK);if(t===C.PlaybackTypes.MSE||t===C.PlaybackTypes.NATIVE)return t}set preferPlayback(t){t!==this.preferPlayback&&(t===C.PlaybackTypes.MSE||t===C.PlaybackTypes.NATIVE?this.setAttribute(E.Attributes.PREFER_PLAYBACK,t):this.removeAttribute(E.Attributes.PREFER_PLAYBACK))}get metadata(){var t;return(t=this.media)==null?void 0:t.metadata}set metadata(t){if(P(this,Ze,Ft).call(this),!this.media){le("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...vl(this),...t}}async addCuePoints(t){var a;if(P(this,Ze,Ft).call(this),!this.media){le("underlying media element missing when trying to addCuePoints. cuePoints will not be added.");return}return(a=this.media)==null?void 0:a.addCuePoints(t)}get activeCuePoint(){var t;return(t=this.media)==null?void 0:t.activeCuePoint}get cuePoints(){var t,a;return(a=(t=this.media)==null?void 0:t.cuePoints)!=null?a:[]}getStartDate(){var t;return(t=this.media)==null?void 0:t.getStartDate()}get currentPdt(){var t;return(t=this.media)==null?void 0:t.currentPdt}get tokens(){let t=this.getAttribute(h.PLAYBACK_TOKEN),a=this.getAttribute(h.THUMBNAIL_TOKEN),r=this.getAttribute(h.STORYBOARD_TOKEN);return{...I(this,Di),...t!=null?{playback:t}:{},...a!=null?{thumbnail:a}:{},...r!=null?{storyboard:r}:{}}}set tokens(t){te(this,Di,t!=null?t:{})}get playbackToken(){var t;return(t=this.getAttribute(h.PLAYBACK_TOKEN))!=null?t:void 0}set playbackToken(t){this.setAttribute(h.PLAYBACK_TOKEN,`${t}`)}get thumbnailToken(){var t;return(t=this.getAttribute(h.THUMBNAIL_TOKEN))!=null?t:void 0}set thumbnailToken(t){this.setAttribute(h.THUMBNAIL_TOKEN,`${t}`)}get storyboardToken(){var t;return(t=this.getAttribute(h.STORYBOARD_TOKEN))!=null?t:void 0}set storyboardToken(t){this.setAttribute(h.STORYBOARD_TOKEN,`${t}`)}addTextTrack(t,a,r,n){var l;let s=(l=this.media)==null?void 0:l.nativeEl;if(!!s)return(0,C.addTextTrack)(s,t,a,r,n)}removeTextTrack(t){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(!!a)return(0,C.removeTextTrack)(a,t)}get textTracks(){var t;return(t=this.media)==null?void 0:t.textTracks}};xi=new WeakMap,Di=new WeakMap,xe=new WeakMap,Oi=new WeakMap,pt=new WeakMap,Ze=new WeakSet,Ft=function(){var t,a,r;if(!I(this,xi)){te(this,xi,!0),P(this,qe,Kt).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof O.HTMLElement))throw""}catch{le("<media-theme> failed to upgrade!")}try{if(customElements.upgrade(this.media),!(this.media instanceof E.default))throw""}catch{le("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof ii))throw""}catch{le("<media-controller> failed to upgrade!")}Go(this),P(this,tr,Al).call(this),P(this,ir,_l).call(this),P(this,ar,yl).call(this),te(this,xe,(a=(t=this.mediaController)==null?void 0:t.hasAttribute("user-inactive"))!=null?a:!0),P(this,rr,Tl).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",()=>{P(this,qe,Kt).call(this)})}},er=new WeakSet,gl=function(){var t,a;try{(t=window==null?void 0:window.CSS)==null||t.registerProperty({name:"--media-primary-color",syntax:"<color>",inherits:!0}),(a=window==null?void 0:window.CSS)==null||a.registerProperty({name:"--media-secondary-color",syntax:"<color>",inherits:!0})}catch{}},Ni=new WeakSet,Wn=function(t){Object.assign(I(this,pt),t),P(this,qe,Kt).call(this)},qe=new WeakSet,Kt=function(t={}){pl(fl(Du(this,{...I(this,pt),...t})),this.shadowRoot)},tr=new WeakSet,Al=function(){let t=r=>{var l,u;if(!(r!=null&&r.startsWith("theme-")))return;let n=r.replace(/^theme-/,"");if(Hn.includes(n))return;let s=this.getAttribute(r);s!=null?(l=this.mediaTheme)==null||l.setAttribute(n,s):(u=this.mediaTheme)==null||u.removeAttribute(n)};new MutationObserver(r=>{for(let{attributeName:n}of r)t(n)}).observe(this,{attributes:!0}),this.getAttributeNames().forEach(t)},ir=new WeakSet,_l=function(){var a;let t=r=>{let{detail:n}=r;if(n instanceof E.MediaError||(n=new E.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}=ja(n,!window.navigator.onLine,this.playbackId,this.playbackToken);l.message&&Mn(l),le(n),n.data&&le(`${n.name} data:`,n.data),P(this,Ni,Wn).call(this,{isDialogOpen:!0,dialog:s})};this.addEventListener("error",t),this.media&&(this.media.errorTranslator=(r={})=>{var s,l,u;if(!(((s=this.media)==null?void 0:s.error)instanceof E.MediaError))return r;let{devlog:n}=ja((l=this.media)==null?void 0:l.error,!window.navigator.onLine,this.playbackId,this.playbackToken,!1);return{player_error_code:(u=this.media)==null?void 0:u.error.code,player_error_message:n.message?String(n.message):r.player_error_message,player_error_context:n.context?String(n.context):r.player_error_context}}),(a=this.media)==null||a.addEventListener("error",r=>{var s,l;let{detail:n}=r;if(!n){let{message:u,code:c}=(l=(s=this.media)==null?void 0:s.error)!=null?l:{};n=new E.MediaError(u,c)}!(n!=null&&n.fatal)||this.dispatchEvent(new CustomEvent("error",{detail:n}))})},ar=new WeakSet,yl=function(){var a,r,n,s;let t=()=>P(this,qe,Kt).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",t),(s=(n=this.media)==null?void 0:n.textTracks)==null||s.addEventListener("removetrack",t)},rr=new WeakSet,Tl=function(){var f,A;let t=/.*Version\/.*Safari\/.*/.test(navigator.userAgent);if(!/Firefox/i.test(navigator.userAgent))return;let r,n=new WeakMap,s=()=>this.streamType===C.StreamTypes.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,l=(g,y,R=!1)=>{if(s())return;Array.from(g&&g.activeCues||[]).forEach(k=>{if(!(!k.snapToLines||k.line<-5||k.line>=0&&k.line<10))if(!y||this.paused){let ge=k.text.split(`
|
|
1905
|
-
`).length,
|
|
1934
|
+
`};var Wi=require("@mux/mux-video");function mr(i,e,t,a,r){var l,u,m;let n={},s={};switch(i.code){case Wi.MediaError.MEDIA_ERR_NETWORK:{switch(n.title=y("Network Error",r),n.message=i.message,(l=i.data)==null?void 0:l.response.code){case 412:{n.title=y("Video is not currently available",r),n.message=y("The live stream or video file are not yet ready.",r),s.message=y("This playback-id may belong to a live stream that is not currently active or an asset that is not ready.",r),s.file="412-not-playable.md";break}case 404:{n.title=y("Video does not exist",r),n.message="",s.message=y("This playback-id does not exist. You may have used an Asset ID or an ID from a different resource.",r),s.file="404-not-found.md";break}case 403:{if(n.title=y("Invalid playback URL",r),n.message=y("The video URL or playback-token are formatted with incorrect or incomplete information.",r),s.message=y("403 error trying to access this playback URL. If this is a signed URL, you might need to provide a playback-token.",r),s.file="missing-signed-tokens.md",!a)break;let{exp:p,aud:f,sub:A}=ze(a),T=Date.now()>p*1e3,B=A!==t,Z=f!=="v",I={timeStyle:"medium",dateStyle:"medium"};if(T){n.title=y("Video URL has expired",r),n.message=y("The video\u2019s secured playback-token has expired.",r),s.message=y("The video\u2019s secured playback-token has expired.",r),s.context=y("Expired at: {expiredDate}. Current time: {currentDate}.",r).format({expiredDate:new Intl.DateTimeFormat(Et.code,I).format(p*1e3),currentDate:new Intl.DateTimeFormat(Et.code,I).format(Date.now())}),s.file="403-expired-token.md";break}if(B){n.title=y("Video URL is formatted incorrectly",r),n.message=y("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),s.message=y("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),s.context=y("Specified playback ID: {playbackId} and the playback ID encoded in the playback-token: {tokenPlaybackId}",r).format({playbackId:t,tokenPlaybackId:A}),s.file="403-playback-id-mismatch.md";break}if(Z){n.title=y("Video URL is formatted incorrectly",r),n.message=y("The playback-token is formatted with incorrect information.",r),s.message=y("The playback-token is formatted with incorrect information.",r),s.context=y("The playback-token has an incorrect aud value: {tokenType}. aud value should be v.",r).format({tokenType:f}),s.file="403-incorrect-aud-value.md";break}s.message=y("403 error trying to access this playback URL. If this is a signed playback ID, the token might not have been generated correctly.",r),s.file="403-malformatted-token.md";break}}break}case Wi.MediaError.MEDIA_ERR_DECODE:{let{message:p}=i;n={title:y("Media Error",r),message:p},s.file="media-decode-error.md";break}case Wi.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:{let p=(m=(u=i.data)==null?void 0:u.response)==null?void 0:m.code;if(p>=400&&p<500){i.code=Wi.MediaError.MEDIA_ERR_NETWORK,i.data={response:{code:p}},{dialog:n,devlog:s}=mr(i,e,t,a);break}n={title:y("Source Not Supported",r),message:i.message},s.file="media-src-not-supported.md";break}default:n={title:y("Error",r),message:i.message};break}return e&&(n={title:y("Your device appears to be offline",r),message:y("Check your internet connection and try reloading this video.",r)}),{dialog:n,devlog:s}}var We={SRC:"src",POSTER:"poster"},h={STYLE:"style",DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-color",FORWARD_SEEK_OFFSET:"forward-seek-offset",BACKWARD_SEEK_OFFSET:"backward-seek-offset",PLAYBACK_TOKEN:"playback-token",THUMBNAIL_TOKEN:"thumbnail-token",STORYBOARD_TOKEN:"storyboard-token",STORYBOARD_SRC:"storyboard-src",THUMBNAIL_TIME:"thumbnail-time",AUDIO:"audio",NOHOTKEYS:"nohotkeys",HOTKEYS:"hotkeys",PLAYBACK_RATES:"playbackrates",DEFAULT_SHOW_REMAINING_TIME:"default-show-remaining-time",TITLE:"title",PLACEHOLDER:"placeholder",THEME:"theme",DEFAULT_STREAM_TYPE:"default-stream-type",TARGET_LIVE_WINDOW:"target-live-window",NO_VOLUME_PREF:"no-volume-pref"},Xn=["audio","backwardseekoffset","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","novolumepref"];function Qu(i,e){var a;return{src:!i.playbackId&&i.src,playbackId:i.playbackId,hasSrc:!!i.playbackId||!!i.src,poster:i.poster,storyboard:i.storyboard,storyboardSrc:i.getAttribute(h.STORYBOARD_SRC),placeholder:i.getAttribute("placeholder"),themeTemplate:zu(i),thumbnailTime:!i.tokens.thumbnail&&i.thumbnailTime,autoplay:i.autoplay,crossOrigin:i.crossOrigin,loop:i.loop,noHotKeys:i.hasAttribute(h.NOHOTKEYS),hotKeys:i.getAttribute(h.HOTKEYS),muted:i.muted,paused:i.paused,preload:i.preload,envKey:i.envKey,preferCmcd:i.preferCmcd,debug:i.debug,disableCookies:i.disableCookies,tokens:i.tokens,beaconCollectionDomain:i.beaconCollectionDomain,maxResolution:i.maxResolution,metadata:i.metadata,playerSoftwareName:i.playerSoftwareName,playerSoftwareVersion:i.playerSoftwareVersion,startTime:i.startTime,preferPlayback:i.preferPlayback,audio:i.audio,defaultStreamType:i.defaultStreamType,targetLiveWindow:i.getAttribute(g.Attributes.TARGET_LIVE_WINDOW),streamType:Ri(i.getAttribute(g.Attributes.STREAM_TYPE)),primaryColor:i.primaryColor,secondaryColor:i.secondaryColor,forwardSeekOffset:i.forwardSeekOffset,backwardSeekOffset:i.backwardSeekOffset,defaultHiddenCaptions:i.defaultHiddenCaptions,defaultShowRemainingTime:i.defaultShowRemainingTime,hideDuration:Xu(i),playbackRates:i.getAttribute(h.PLAYBACK_RATES),customDomain:(a=i.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?a:void 0,title:i.getAttribute(h.TITLE),novolumepref:i.hasAttribute(h.NO_VOLUME_PREF),...e}}function zu(i){var t,a;let e=i.getAttribute(h.THEME);if(e){let r=(a=(t=i.getRootNode())==null?void 0:t.getElementById)==null?void 0:a.call(t,e);if(r)return r;e.startsWith("media-theme-")||(e=`media-theme-${e}`);let n=W.customElements.get(e);if(n!=null&&n.template)return n.template}}function Xu(i){var t;let e=(t=i.mediaController)==null?void 0:t.querySelector("media-time-display");return e&&getComputedStyle(e).getPropertyValue("--media-duration-display-display").trim()==="none"}function Ol(i){return i.getAttributeNames().filter(e=>e.startsWith("metadata-")).reduce((e,t)=>{let a=i.getAttribute(t);return a!==null&&(e[t.replace(/^metadata-/,"").replace(/-/g,"_")]=a),e},{})}var Ju=Object.values(g.Attributes),ju=Object.values(We),ec=Object.values(h),tc=ir(),ic="mux-player",Nl={dialog:void 0,isDialogOpen:!1},Ki,Yi,Fe,Gi,kt,it,ri,hr,Pl,Zi,Jn,at,ni,pr,Ul,Er,Bl,br,$l,vr,Vl,Fi=class extends $n{constructor(){super();V(this,it);V(this,hr);V(this,Zi);V(this,at);V(this,pr);V(this,Er);V(this,br);V(this,vr);V(this,Ki,!1);V(this,Yi,{});V(this,Fe,!0);V(this,Gi,new tr(this,"hotkeys"));V(this,kt,{...Nl,onCloseErrorDialog:()=>Y(this,Zi,Jn).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:t=>{On(this,se.activeElement)||t.preventDefault()}});this.attachShadow({mode:"open"}),Y(this,hr,Pl).call(this),this.isConnected&&Y(this,it,ri).call(this)}static get observedAttributes(){var t;return[...(t=$n.observedAttributes)!=null?t:[],...ju,...Ju,...ec]}get mediaTheme(){var t;return(t=this.shadowRoot)==null?void 0:t.querySelector("media-theme")}get mediaController(){var t,a;return(a=(t=this.mediaTheme)==null?void 0:t.shadowRoot)==null?void 0:a.querySelector("media-controller")}connectedCallback(){var a;let t=(a=this.shadowRoot)==null?void 0:a.querySelector("mux-video");t&&(t.metadata=Ol(this))}attributeChangedCallback(t,a,r){switch(Y(this,it,ri).call(this),super.attributeChangedCallback(t,a,r),t){case h.HOTKEYS:k(this,Gi).value=r;break;case h.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&Xe(y("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case h.THUMBNAIL_TOKEN:{let{aud:s}=ze(r);r&&s!=="t"&&Xe(y("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:s}));break}case h.STORYBOARD_TOKEN:{let{aud:s}=ze(r);r&&s!=="s"&&Xe(y("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:s}));break}case g.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&pe(y("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r}));break}case g.Attributes.STREAM_TYPE:r&&![N.StreamTypes.LIVE,N.StreamTypes.ON_DEMAND,N.StreamTypes.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:Un({file:"invalid-stream-type.md",message:y("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):this.targetLiveWindow=r===N.StreamTypes.LIVE?0:Number.NaN}[g.Attributes.PLAYBACK_ID,We.SRC,h.PLAYBACK_TOKEN].includes(t)&&a!==r&&le(this,kt,{...k(this,kt),...Nl}),Y(this,at,ni).call(this,{[rl(t)]:r})}get preferCmcd(){var t;return(t=this.getAttribute(g.Attributes.PREFER_CMCD))!=null?t:void 0}set preferCmcd(t){t!==this.preferCmcd&&(t?N.CmcdTypeValues.includes(t)?this.setAttribute(g.Attributes.PREFER_CMCD,t):Xe(`Invalid value for preferCmcd. Must be one of ${N.CmcdTypeValues.join()}`):this.removeAttribute(g.Attributes.PREFER_CMCD))}get hasPlayed(){var t,a;return(a=(t=this.mediaController)==null?void 0:t.hasAttribute("media-has-played"))!=null?a:!1}get inLiveWindow(){var t;return(t=this.mediaController)==null?void 0:t.hasAttribute("media-time-is-live")}get _hls(){var t;return(t=this.media)==null?void 0:t._hls}get mux(){var t;return(t=this.media)==null?void 0:t.mux}get theme(){var t;return(t=this.getAttribute(h.THEME))!=null?t:""}set theme(t){this.setAttribute(h.THEME,`${t}`)}get themeProps(){let t=this.mediaTheme;if(!t)return;let a={};for(let r of t.getAttributeNames()){if(Xn.includes(r))continue;let n=t.getAttribute(r);a[Ja(r)]=n===""?!0:n}return a}set themeProps(t){var r,n;Y(this,it,ri).call(this);let a={...this.themeProps,...t};for(let s in a){if(Xn.includes(s))continue;let l=t==null?void 0:t[s];typeof l=="boolean"||l==null?(r=this.mediaTheme)==null||r.toggleAttribute(Xa(s),Boolean(l)):(n=this.mediaTheme)==null||n.setAttribute(Xa(s),l)}}get playbackId(){var t;return(t=this.getAttribute(g.Attributes.PLAYBACK_ID))!=null?t:void 0}set playbackId(t){t?this.setAttribute(g.Attributes.PLAYBACK_ID,t):this.removeAttribute(g.Attributes.PLAYBACK_ID)}get src(){var t,a;return this.playbackId?(t=It(this,We.SRC))!=null?t:void 0:(a=this.getAttribute(We.SRC))!=null?a:void 0}set src(t){t?this.setAttribute(We.SRC,t):this.removeAttribute(We.SRC)}get poster(){var a;let t=this.getAttribute(We.POSTER);if(t!=null)return t;if(this.playbackId&&!this.audio)return il(this.playbackId,{domain:this.customDomain,thumbnailTime:(a=this.thumbnailTime)!=null?a:this.startTime,token:this.tokens.thumbnail})}set poster(t){t||t===""?this.setAttribute(We.POSTER,t):this.removeAttribute(We.POSTER)}get storyboardSrc(){var t;return(t=this.getAttribute(h.STORYBOARD_SRC))!=null?t:void 0}set storyboardSrc(t){t?this.setAttribute(h.STORYBOARD_SRC,t):this.removeAttribute(h.STORYBOARD_SRC)}get storyboard(){if(this.storyboardSrc&&!this.tokens.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[N.StreamTypes.LIVE,N.StreamTypes.UNKNOWN].includes(this.streamType)))return al(this.playbackId,{domain:this.customDomain,token:this.tokens.storyboard})}get audio(){return this.hasAttribute(h.AUDIO)}set audio(t){if(!t){this.removeAttribute(h.AUDIO);return}this.setAttribute(h.AUDIO,"")}get hotkeys(){return k(this,Gi)}get nohotkeys(){return this.hasAttribute(h.NOHOTKEYS)}set nohotkeys(t){if(!t){this.removeAttribute(h.NOHOTKEYS);return}this.setAttribute(h.NOHOTKEYS,"")}get thumbnailTime(){return Ue(this.getAttribute(h.THUMBNAIL_TIME))}set thumbnailTime(t){this.setAttribute(h.THUMBNAIL_TIME,`${t}`)}get title(){var t;return(t=this.getAttribute(h.TITLE))!=null?t:""}set title(t){t!==this.title&&(t?this.setAttribute(h.TITLE,t):this.removeAttribute("title"),super.title=t)}get placeholder(){var t;return(t=It(this,h.PLACEHOLDER))!=null?t:""}set placeholder(t){this.setAttribute(h.PLACEHOLDER,`${t}`)}get primaryColor(){var a,r;let t=this.getAttribute(h.PRIMARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=W.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),t))return t}set primaryColor(t){this.setAttribute(h.PRIMARY_COLOR,`${t}`)}get secondaryColor(){var a,r;let t=this.getAttribute(h.SECONDARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=W.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),t))return t}set secondaryColor(t){this.setAttribute(h.SECONDARY_COLOR,`${t}`)}get defaultShowRemainingTime(){return this.hasAttribute(h.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(t){t?this.setAttribute(h.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(h.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(!!this.hasAttribute(h.PLAYBACK_RATES))return this.getAttribute(h.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(t=>Number(t)).filter(t=>!Number.isNaN(t)).sort((t,a)=>t-a)}set playbackRates(t){if(!t){this.removeAttribute(h.PLAYBACK_RATES);return}this.setAttribute(h.PLAYBACK_RATES,t.join(" "))}get forwardSeekOffset(){var t;return(t=Ue(this.getAttribute(h.FORWARD_SEEK_OFFSET)))!=null?t:10}set forwardSeekOffset(t){this.setAttribute(h.FORWARD_SEEK_OFFSET,`${t}`)}get backwardSeekOffset(){var t;return(t=Ue(this.getAttribute(h.BACKWARD_SEEK_OFFSET)))!=null?t:10}set backwardSeekOffset(t){this.setAttribute(h.BACKWARD_SEEK_OFFSET,`${t}`)}get defaultHiddenCaptions(){return this.hasAttribute(h.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(t){t?this.setAttribute(h.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(h.DEFAULT_HIDDEN_CAPTIONS)}get playerSoftwareName(){var t;return(t=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_NAME))!=null?t:ic}get playerSoftwareVersion(){var t;return(t=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_VERSION))!=null?t:tc}get beaconCollectionDomain(){var t;return(t=this.getAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN))!=null?t:void 0}set beaconCollectionDomain(t){t!==this.beaconCollectionDomain&&(t?this.setAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN,t):this.removeAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var t;return(t=this.getAttribute(g.Attributes.MAX_RESOLUTION))!=null?t:void 0}set maxResolution(t){t!==this.maxResolution&&(t?this.setAttribute(g.Attributes.MAX_RESOLUTION,t):this.removeAttribute(g.Attributes.MAX_RESOLUTION))}get customDomain(){var t;return(t=this.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?t:void 0}set customDomain(t){t!==this.customDomain&&(t?this.setAttribute(g.Attributes.CUSTOM_DOMAIN,t):this.removeAttribute(g.Attributes.CUSTOM_DOMAIN))}get envKey(){var t;return(t=It(this,g.Attributes.ENV_KEY))!=null?t:void 0}set envKey(t){this.setAttribute(g.Attributes.ENV_KEY,`${t}`)}get noVolumePref(){return this.hasAttribute(h.NO_VOLUME_PREF)}set noVolumePref(t){t?this.setAttribute(h.NO_VOLUME_PREF,""):this.removeAttribute(h.NO_VOLUME_PREF)}get debug(){return It(this,g.Attributes.DEBUG)!=null}set debug(t){t?this.setAttribute(g.Attributes.DEBUG,""):this.removeAttribute(g.Attributes.DEBUG)}get disableCookies(){return It(this,g.Attributes.DISABLE_COOKIES)!=null}set disableCookies(t){t?this.setAttribute(g.Attributes.DISABLE_COOKIES,""):this.removeAttribute(g.Attributes.DISABLE_COOKIES)}get streamType(){var t,a,r;return(r=(a=this.getAttribute(g.Attributes.STREAM_TYPE))!=null?a:(t=this.media)==null?void 0:t.streamType)!=null?r:N.StreamTypes.UNKNOWN}set streamType(t){this.setAttribute(g.Attributes.STREAM_TYPE,`${t}`)}get defaultStreamType(){var t,a,r;return(r=(a=this.getAttribute(h.DEFAULT_STREAM_TYPE))!=null?a:(t=this.mediaController)==null?void 0:t.getAttribute(h.DEFAULT_STREAM_TYPE))!=null?r:N.StreamTypes.ON_DEMAND}set defaultStreamType(t){t?this.setAttribute(h.DEFAULT_STREAM_TYPE,t):this.removeAttribute(h.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var t,a;return this.hasAttribute(h.TARGET_LIVE_WINDOW)?+this.getAttribute(h.TARGET_LIVE_WINDOW):(a=(t=this.media)==null?void 0:t.targetLiveWindow)!=null?a:Number.NaN}set targetLiveWindow(t){t!=this.targetLiveWindow&&(t==null?this.removeAttribute(h.TARGET_LIVE_WINDOW):this.setAttribute(h.TARGET_LIVE_WINDOW,`${+t}`))}get liveEdgeStart(){var t;return(t=this.media)==null?void 0:t.liveEdgeStart}get startTime(){return Ue(It(this,g.Attributes.START_TIME))}set startTime(t){this.setAttribute(g.Attributes.START_TIME,`${t}`)}get preferPlayback(){let t=this.getAttribute(g.Attributes.PREFER_PLAYBACK);if(t===N.PlaybackTypes.MSE||t===N.PlaybackTypes.NATIVE)return t}set preferPlayback(t){t!==this.preferPlayback&&(t===N.PlaybackTypes.MSE||t===N.PlaybackTypes.NATIVE?this.setAttribute(g.Attributes.PREFER_PLAYBACK,t):this.removeAttribute(g.Attributes.PREFER_PLAYBACK))}get metadata(){var t;return(t=this.media)==null?void 0:t.metadata}set metadata(t){if(Y(this,it,ri).call(this),!this.media){pe("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...Ol(this),...t}}async addCuePoints(t){var a;if(Y(this,it,ri).call(this),!this.media){pe("underlying media element missing when trying to addCuePoints. cuePoints will not be added.");return}return(a=this.media)==null?void 0:a.addCuePoints(t)}get activeCuePoint(){var t;return(t=this.media)==null?void 0:t.activeCuePoint}get cuePoints(){var t,a;return(a=(t=this.media)==null?void 0:t.cuePoints)!=null?a:[]}getStartDate(){var t;return(t=this.media)==null?void 0:t.getStartDate()}get currentPdt(){var t;return(t=this.media)==null?void 0:t.currentPdt}get tokens(){let t=this.getAttribute(h.PLAYBACK_TOKEN),a=this.getAttribute(h.THUMBNAIL_TOKEN),r=this.getAttribute(h.STORYBOARD_TOKEN);return{...k(this,Yi),...t!=null?{playback:t}:{},...a!=null?{thumbnail:a}:{},...r!=null?{storyboard:r}:{}}}set tokens(t){le(this,Yi,t!=null?t:{})}get playbackToken(){var t;return(t=this.getAttribute(h.PLAYBACK_TOKEN))!=null?t:void 0}set playbackToken(t){this.setAttribute(h.PLAYBACK_TOKEN,`${t}`)}get thumbnailToken(){var t;return(t=this.getAttribute(h.THUMBNAIL_TOKEN))!=null?t:void 0}set thumbnailToken(t){this.setAttribute(h.THUMBNAIL_TOKEN,`${t}`)}get storyboardToken(){var t;return(t=this.getAttribute(h.STORYBOARD_TOKEN))!=null?t:void 0}set storyboardToken(t){this.setAttribute(h.STORYBOARD_TOKEN,`${t}`)}addTextTrack(t,a,r,n){var l;let s=(l=this.media)==null?void 0:l.nativeEl;if(!!s)return(0,N.addTextTrack)(s,t,a,r,n)}removeTextTrack(t){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(!!a)return(0,N.removeTextTrack)(a,t)}get textTracks(){var t;return(t=this.media)==null?void 0:t.textTracks}};Ki=new WeakMap,Yi=new WeakMap,Fe=new WeakMap,Gi=new WeakMap,kt=new WeakMap,it=new WeakSet,ri=function(){var t,a,r;if(!k(this,Ki)){le(this,Ki,!0),Y(this,at,ni).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof W.HTMLElement))throw""}catch{pe("<media-theme> failed to upgrade!")}try{if(customElements.upgrade(this.media),!(this.media instanceof g.default))throw""}catch{pe("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof Nr))throw""}catch{pe("<media-controller> failed to upgrade!")}dl(this),Y(this,pr,Ul).call(this),Y(this,Er,Bl).call(this),Y(this,br,$l).call(this),le(this,Fe,(a=(t=this.mediaController)==null?void 0:t.hasAttribute("userinactive"))!=null?a:!0),Y(this,vr,Vl).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",()=>{Y(this,at,ni).call(this)})}},hr=new WeakSet,Pl=function(){var t,a;try{(t=window==null?void 0:window.CSS)==null||t.registerProperty({name:"--media-primary-color",syntax:"<color>",inherits:!0}),(a=window==null?void 0:window.CSS)==null||a.registerProperty({name:"--media-secondary-color",syntax:"<color>",inherits:!0})}catch{}},Zi=new WeakSet,Jn=function(t){Object.assign(k(this,kt),t),Y(this,at,ni).call(this)},at=new WeakSet,ni=function(t={}){Rl(xl(Qu(this,{...k(this,kt),...t})),this.shadowRoot)},pr=new WeakSet,Ul=function(){let t=r=>{var l,u;if(!(r!=null&&r.startsWith("theme-")))return;let n=r.replace(/^theme-/,"");if(Xn.includes(n))return;let s=this.getAttribute(r);s!=null?(l=this.mediaTheme)==null||l.setAttribute(n,s):(u=this.mediaTheme)==null||u.removeAttribute(n)};new MutationObserver(r=>{for(let{attributeName:n}of r)t(n)}).observe(this,{attributes:!0}),this.getAttributeNames().forEach(t)},Er=new WeakSet,Bl=function(){var a;let t=r=>{let{detail:n}=r;if(n instanceof g.MediaError||(n=new g.MediaError(n.message,n.code,n.fatal)),!(n!=null&&n.fatal)){Xe(n),n.data&&Xe(`${n.name} data:`,n.data);return}let{dialog:s,devlog:l}=mr(n,!window.navigator.onLine,this.playbackId,this.playbackToken);l.message&&Un(l),pe(n),n.data&&pe(`${n.name} data:`,n.data),Y(this,Zi,Jn).call(this,{isDialogOpen:!0,dialog:s})};this.addEventListener("error",t),this.media&&(this.media.errorTranslator=(r={})=>{var s,l,u;if(!(((s=this.media)==null?void 0:s.error)instanceof g.MediaError))return r;let{devlog:n}=mr((l=this.media)==null?void 0:l.error,!window.navigator.onLine,this.playbackId,this.playbackToken,!1);return{player_error_code:(u=this.media)==null?void 0:u.error.code,player_error_message:n.message?String(n.message):r.player_error_message,player_error_context:n.context?String(n.context):r.player_error_context}}),(a=this.media)==null||a.addEventListener("error",r=>{var s,l;let{detail:n}=r;if(!n){let{message:u,code:m}=(l=(s=this.media)==null?void 0:s.error)!=null?l:{};n=new g.MediaError(u,m)}!(n!=null&&n.fatal)||this.dispatchEvent(new CustomEvent("error",{detail:n}))})},br=new WeakSet,$l=function(){var a,r,n,s;let t=()=>Y(this,at,ni).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",t),(s=(n=this.media)==null?void 0:n.textTracks)==null||s.addEventListener("removetrack",t)},vr=new WeakSet,Vl=function(){var p,f;let t=/.*Version\/.*Safari\/.*/.test(navigator.userAgent);if(!/Firefox/i.test(navigator.userAgent))return;let r,n=new WeakMap,s=()=>this.streamType===N.StreamTypes.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,l=(A,T,B=!1)=>{if(s())return;Array.from(A&&A.activeCues||[]).forEach(I=>{if(!(!I.snapToLines||I.line<-5||I.line>=0&&I.line<10))if(!T||this.paused){let ne=I.text.split(`
|
|
1935
|
+
`).length,be=t?-2:-3;this.streamType===N.StreamTypes.LIVE&&(be=t?-1:-2);let oe=be-ne;if(I.line===oe&&!B)return;n.has(I)||n.set(I,I.line),I.line=oe-1,I.line=oe}else setTimeout(()=>{I.line=n.get(I)||"auto"},500)})},u=()=>{var A,T;l(r,(T=(A=this.mediaController)==null?void 0:A.hasAttribute("userinactive"))!=null?T:!1)},m=()=>{var B,Z;let T=Array.from(((Z=(B=this.mediaController)==null?void 0:B.media)==null?void 0:Z.textTracks)||[]).filter(I=>["subtitles","captions"].includes(I.kind)&&I.mode==="showing")[0];T!==r&&(r==null||r.removeEventListener("cuechange",u)),r=T,r==null||r.addEventListener("cuechange",u),l(r,k(this,Fe))};if(m(),(p=this.textTracks)==null||p.addEventListener("change",m),(f=this.textTracks)==null||f.addEventListener("addtrack",m),navigator.userAgent.includes("Chrome/")){let A=()=>{l(r,k(this,Fe),!0),this.paused||window.requestAnimationFrame(A)};this.addEventListener("playing",()=>{A()})}this.addEventListener("userinactivechange",()=>{var T,B;let A=(B=(T=this.mediaController)==null?void 0:T.hasAttribute("userinactive"))!=null?B:!0;k(this,Fe)!==A&&(le(this,Fe,A),l(r,k(this,Fe)))})};function It(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}W.customElements.get("mux-player")||(W.customElements.define("mux-player",Fi),W.MuxPlayerElement=Fi);var ac=Fi;
|